class_docstr: Implements a recurrent DQN designed to produce melody sequences.
class_docstr_tok: ["Implements","a","recurrent","DQN","designed","to","produce","melody","sequences","."]
docstr: Evaluates if highest and lowest notes in composition occurred once.
  
  Args:
    action: One-hot encoding of the chosen action.
    reward_amount: Amount of reward that will be given for the highest note
      being unique, and again for the lowest note being unique.
  Returns:
    Float reward value.
docstr_tok: ["Evaluates","if","highest","and","lowest","notes","in","composition","occurred","once",".","Args",":","action",":","One-hot","encoding","of","the","chosen","action",".","reward_amount",":","Amount","of","reward","that","will","be","given","for","the","highest","note","being","unique",",","and","again","for","the","lowest","note","being","unique",".","Returns",":","Float","reward","value","."]
code: def reward_high_low_unique(self, action, reward_amount=3.0):
      """Evaluates if highest and lowest notes in composition occurred once.
  
      Args:
        action: One-hot encoding of the chosen action.
        reward_amount: Amount of reward that will be given for the highest note
          being unique, and again for the lowest note being unique.
      Returns:
        Float reward value.
      """
      if len(self.composition) + 1 != self.num_notes_in_melody:
          return 0.0
  
      composition = np.array(self.composition)
      composition = np.append(composition, np.argmax(action))
  
      reward = 0.0
  
      if self.detect_high_unique(composition):
          reward += reward_amount
  
      if self.detect_low_unique(composition):
          reward += reward_amount
  
      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 34 for calling the RLTuner obj's underlying member method code with example usage: obj.reward_high_low_unique(action, reward_amount) and returns: reward, int