(self, observation, state)
return rewards
Get note scores from the reward_rnn to use as a reward based on data.

    Runs the reward_rnn on an observation and initial state. Useful for
    maintaining the probabilities of the original LSTM model while training with
    reinforcement learning.

    Args:
      observation: One-hot encoding of the observed note.
      state: Vector representing the internal state of the target_q_network
        LSTM.

    Returns:
      Action scores produced by reward_rnn.
Get note scores from the reward_rnn to use as a reward based on data.
Get note scores from the reward_rnn to use as a reward based on data .
def get_reward_rnn_scores(self, observation, state):
    """Get note scores from the reward_rnn to use as a reward based on data.

    Runs the reward_rnn on an observation and initial state. Useful for
    maintaining the probabilities of the original LSTM model while training with
    reinforcement learning.

    Args:
      observation: One-hot encoding of the observed note.
      state: Vector representing the internal state of the target_q_network
        LSTM.

    Returns:
      Action scores produced by reward_rnn.
    """
    state = np.atleast_2d(state)

    input_batch = np.reshape(observation, (self.reward_rnn.batch_size, 1,
                                           self.num_actions))
    lengths = np.full(self.reward_rnn.batch_size, 1, dtype=int)

    rewards, = self.session.run(
        self.reward_scores,
        {self.reward_rnn.melody_sequence: input_batch,
         self.reward_rnn.initial_state: state,
         self.reward_rnn.lengths: lengths})
    return rewards
def get_reward_rnn_scores ( self , observation , state ) : state = np . atleast_2d ( state ) input_batch = np . reshape ( observation , ( self . reward_rnn . batch_size , 1 , self . num_actions ) ) lengths = np . full ( self . reward_rnn . batch_size , 1 , dtype = int ) rewards , = self . session . run ( self . reward_scores , { self . reward_rnn . melody_sequence : input_batch , self . reward_rnn . initial_state : state , self . reward_rnn . lengths : lengths } ) return rewards