class_docstr: Implements a recurrent DQN designed to produce melody sequences.
class_docstr_tok: ["Implements","a","recurrent","DQN","designed","to","produce","melody","sequences","."]
docstr: Rewards based on probabilities learned from data by trained RNN.
  
  Computes the reward_network's learned softmax probabilities. When used as
  rewards, allows the model to maintain information it learned from data.
  
  Args:
    action: A one-hot encoding of the chosen action.
    reward_scores: The value for each note output by the reward_rnn.
  Returns:
    Float reward value.
docstr_tok: ["Rewards","based","on","probabilities","learned","from","data","by","trained","RNN",".","Computes","the","reward_network","'s","learned","softmax","probabilities",".","When","used","as","rewards",",","allows","the","model","to","maintain","information","it","learned","from","data",".","Args",":","action",":","A","one-hot","encoding","of","the","chosen","action",".","reward_scores",":","The","value","for","each","note","output","by","the","reward_rnn",".","Returns",":","Float","reward","value","."]
code: def reward_from_reward_rnn_scores(self, action, reward_scores):
      """Rewards based on probabilities learned from data by trained RNN.
  
      Computes the reward_network's learned softmax probabilities. When used as
      rewards, allows the model to maintain information it learned from data.
  
      Args:
        action: A one-hot encoding of the chosen action.
        reward_scores: The value for each note output by the reward_rnn.
      Returns:
        Float reward value.
      """
      action_note = np.argmax(action)
      normalization_constant = scipy.special.logsumexp(reward_scores)
      return reward_scores[action_note] - normalization_constant
  
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 14 for calling the RLTuner obj's underlying member method code with example usage: obj.reward_from_reward_rnn_scores(action, reward_scores) and returns: unknown