class_docstr: Implements a recurrent DQN designed to produce melody sequences.
class_docstr_tok: ["Implements","a","recurrent","DQN","designed","to","produce","melody","sequences","."]
docstr: Saves a checkpoint of the model and a .npz file with stored rewards.
  
  Args:
    name: String name to use for the checkpoint and rewards files.
    directory: Path to directory where the data will be saved. Defaults to
      self.output_dir if None is provided.
docstr_tok: ["Saves","a","checkpoint","of","the","model","and","a",".npz","file","with","stored","rewards",".","Args",":","name",":","String","name","to","use","for","the","checkpoint","and","rewards","files",".","directory",":","Path","to","directory","where","the","data","will","be","saved",".","Defaults","to","self.output_dir","if","None","is","provided","."]
code: def save_model(self, name, directory=None):
      """Saves a checkpoint of the model and a .npz file with stored rewards.
  
      Args:
        name: String name to use for the checkpoint and rewards files.
        directory: Path to directory where the data will be saved. Defaults to
          self.output_dir if None is provided.
      """
      if directory is None:
          directory = self.output_dir
  
      save_loc = os.path.join(directory, name)
      self.saver.save(
          self.session,
          save_loc,
          global_step=len(self.rewards_batched) * self.output_every_nth,
      )
  
      self.save_stored_rewards(name)
  
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 40 for calling the RLTuner obj's underlying member method code with example usage: obj.save_model(name, directory) without return types