class_docstr: Implements a recurrent DQN designed to produce melody sequences.
class_docstr_tok: ["Implements","a","recurrent","DQN","designed","to","produce","melody","sequences","."]
docstr: Computes cumulative reward for all music theory functions.
  
  Args:
    action: A one-hot encoding of the chosen action.
  Returns:
    Float reward value.
docstr_tok: ["Computes","cumulative","reward","for","all","music","theory","functions",".","Args",":","action",":","A","one-hot","encoding","of","the","chosen","action",".","Returns",":","Float","reward","value","."]
code: def reward_music_theory(self, action):
      """Computes cumulative reward for all music theory functions.
  
      Args:
        action: A one-hot encoding of the chosen action.
      Returns:
        Float reward value.
      """
      reward = self.reward_key(action)
      tf.logging.debug("Key: %s", reward)
      prev_reward = reward
  
      reward += self.reward_tonic(action)
      if reward != prev_reward:
          tf.logging.debug("Tonic: %s", reward)
      prev_reward = reward
  
      reward += self.reward_penalize_repeating(action)
      if reward != prev_reward:
          tf.logging.debug("Penalize repeating: %s", reward)
      prev_reward = reward
  
      reward += self.reward_penalize_autocorrelation(action)
      if reward != prev_reward:
          tf.logging.debug("Penalize autocorr: %s", reward)
      prev_reward = reward
  
      reward += self.reward_motif(action)
      if reward != prev_reward:
          tf.logging.debug("Reward motif: %s", reward)
      prev_reward = reward
  
      reward += self.reward_repeated_motif(action)
      if reward != prev_reward:
          tf.logging.debug("Reward repeated motif: %s", reward)
      prev_reward = reward
  
      # New rewards based on Gauldin's book, "A Practical Approach to Eighteenth
      # Century Counterpoint"
      reward += self.reward_preferred_intervals(action)
      if reward != prev_reward:
          tf.logging.debug("Reward preferred_intervals: %s", reward)
      prev_reward = reward
  
      reward += self.reward_leap_up_back(action)
      if reward != prev_reward:
          tf.logging.debug("Reward leap up back: %s", reward)
      prev_reward = reward
  
      reward += self.reward_high_low_unique(action)
      if reward != prev_reward:
          tf.logging.debug("Reward high low unique: %s", reward)
  
      return reward
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  import random
  import urllib
  from magenta.models.rl_tuner import note_rnn_loader
  from magenta.models.rl_tuner import rl_tuner_eval_metrics
  from magenta.models.rl_tuner import rl_tuner_ops
  import matplotlib.pyplot
  from note_seq import melodies_lib
  from note_seq import midi_io
  import numpy
  import scipy.special
  from six.moves import range
  from six.moves import reload_module
  from six.moves import urllib
  import tensorflow.compat.v1
label_desc: Use image node_id 16 for calling the RLTuner obj's underlying member method code with example usage: obj.reward_music_theory(action) and returns: reward