class_docstr: Implements a recurrent DQN designed to produce melody sequences.
class_docstr_tok: ["Implements","a","recurrent","DQN","designed","to","produce","melody","sequences","."]
docstr: Stores an experience in the model's experience replay buffer.
  
  One experience consists of an initial observation and internal LSTM state,
  which led to the execution of an action, the receipt of a reward, and
  finally a new observation and a new LSTM internal state.
  
  Args:
    observation: A one hot encoding of an observed note.
    state: The internal state of the q_network MelodyRNN LSTM model.
    action: A one hot encoding of action taken by network.
    reward: Reward received for taking the action.
    newobservation: The next observation that resulted from the action.
      Unless stochastic_observations is True, the action and new
      observation will be the same.
    newstate: The internal state of the q_network MelodyRNN that is
      observed after taking the action.
    new_reward_state: The internal state of the reward_rnn network that is
      observed after taking the action
docstr_tok: ["Stores","an","experience","in","the","model","'s","experience","replay","buffer",".","One","experience","consists","of","an","initial","observation","and","internal","LSTM","state",",","which","led","to","the","execution","of","an","action",",","the","receipt","of","a","reward",",","and","finally","a","new","observation","and","a","new","LSTM","internal","state",".","Args",":","observation",":","A","one","hot","encoding","of","an","observed","note",".","state",":","The","internal","state","of","the","q_network","MelodyRNN","LSTM","model",".","action",":","A","one","hot","encoding","of","action","taken","by","network",".","reward",":","Reward","received","for","taking","the","action",".","newobservation",":","The","next","observation","that","resulted","from","the","action",".","Unless","stochastic_observations","is","True",",","the","action","and","new","observation","will","be","the","same",".","newstate",":","The","internal","state","of","the","q_network","MelodyRNN","that","is","observed","after","taking","the","action",".","new_reward_state",":","The","internal","state","of","the","reward_rnn","network","that","is","observed","after","taking","the","action"]
code: def store(
      self,
      observation,
      state,
      action,
      reward,
      newobservation,
      newstate,
      new_reward_state,
  ):
      """Stores an experience in the model's experience replay buffer.
  
      One experience consists of an initial observation and internal LSTM state,
      which led to the execution of an action, the receipt of a reward, and
      finally a new observation and a new LSTM internal state.
  
      Args:
        observation: A one hot encoding of an observed note.
        state: The internal state of the q_network MelodyRNN LSTM model.
        action: A one hot encoding of action taken by network.
        reward: Reward received for taking the action.
        newobservation: The next observation that resulted from the action.
          Unless stochastic_observations is True, the action and new
          observation will be the same.
        newstate: The internal state of the q_network MelodyRNN that is
          observed after taking the action.
        new_reward_state: The internal state of the reward_rnn network that is
          observed after taking the action
      """
      if (
          self.num_times_store_called % self.dqn_hparams.store_every_nth
          == 0
      ):
          self.experience.append(
              (
                  observation,
                  state,
                  action,
                  reward,
                  newobservation,
                  newstate,
                  new_reward_state,
              )
          )
      self.num_times_store_called += 1
  
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 10 for calling the RLTuner obj's underlying member method code with example usage: obj.store(observation, state, action, reward, newobservation, newstate, new_reward_state) without return types