(self, action, reward_amount=3.0)
return reward
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.
Evaluates if highest and lowest notes in composition occurred once.
Evaluates if highest and lowest notes in composition occurred once .
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
def reward_high_low_unique ( self , action , reward_amount = 3.0 ) : 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