'Plots the rewards received as the model was evaluated during training.
If image_name is None, should be used in jupyter notebook. If
called outside of jupyter, execution of the program will halt and
a pop-up with the graph will appear. Execution will not continue
until the pop-up is closed.
Args:
image_name: Name to use when saving the plot to a file. If not
provided, image will be shown immediately.
directory: Path to directory where figure should be saved. If
None, defaults to self.output_dir.
start_at_epoch: Training epoch where the plot should begin.'

def plot_evaluation(self, image_name=None, directory=None, start_at_epoch=0):

    if (directory is None):
        directory = self.output_dir
    reward_batch = self.output_every_nth
    x = [(reward_batch * i) for i in np.arange(len(self.eval_avg_reward))]
    start_index = (start_at_epoch / self.output_every_nth)
    plt.figure()
    plt.plot(x[start_index:], self.eval_avg_reward[start_index:])
    plt.plot(x[start_index:], self.eval_avg_music_theory_reward[start_index:])
    plt.plot(x[start_index:], self.eval_avg_note_rnn_reward[start_index:])
    plt.xlabel('Training    epoch')
    plt.ylabel('Average    reward')
    plt.legend(['Total', 'Music    theory', 'Note    RNN'], loc='best')
    if (image_name is not None):
        plt.savefig(((directory + '/') + image_name))
    else:
        plt.show()
