class_docstr: Class which stores a list of layers describing the model. Can train the layer
  weights on a dataset, evaluate on a test set and serialize the model.
  Additional functionality can be added to the fit method through callback functions.
  
  Arguments:
      layers: layer container, a list of layers (that will be containerized),
              or a serialized model description
      dataset (NervanaDataIterator): Data set (ignored, will be removed)
      weights_only (bool): set to True if you do not want to recreate layers
                           and states during deserialization from a serialized model
                           description.  Defaults to False.
      name (str): Model name.  Defaults to "model"
      optimizer (Optimizer): Optimizer object which defines the learning rule for updating
                             model parameters (i.e., GradientDescentMomentum, Adadelta)
class_docstr_tok: ["Class","which","stores","a","list","of","layers","describing","the","model",".","Can","train","the","layer","weights","on","a","dataset",",","evaluate","on","a","test","set","and","serialize","the","model",".","Additional","functionality","can","be","added","to","the","fit","method","through","callback","functions",".","Arguments",":","layers",":","layer","container",",","a","list","of","layers","(","that","will","be","containerized",")",",","or","a","serialized","model","description","dataset","(","NervanaDataIterator",")",":","Data","set","(","ignored",",","will","be","removed",")","weights_only","(","bool",")",":","set","to","True","if","you","do","not","want","to","recreate","layers","and","states","during","deserialization","from","a","serialized","model","description",".","Defaults","to","False",".","name","(","str",")",":","Model","name",".","Defaults","to","``","model","''","optimizer","(","Optimizer",")",":","Optimizer","object","which","defines","the","learning","rule","for","updating","model","parameters","(","i.e.",",","GradientDescentMomentum",",","Adadelta",")"]
docstr: Trains the model parameters on a dataset by minimizing the cost function through
  gradient descent and updates the layer weights according to a learning rule
  defined in optimizer.
  
  Arguments:
      dataset (NervanaDataIterator): An iterable of minibatches where each
          element is a (x, y) tuple where x is the input data and y are the labels.
          x is of dimension (feature_size, batch_size)
          y is of dimension (label_size, batch_size)
          Length of the iterator is num_batches which is num_data / batch_size.
      cost (Cost): Defines the function which the model is minimizing based
                   on the output of the last layer and the input labels.
      optimizer (Optimizer): Defines the learning rule for updating the model parameters.
      num_epochs: Number of times to iterate over the dataset.
      callbacks (Callbacks): Defines callbacks to run at the end of each mini-batch / epoch.
docstr_tok: ["Trains","the","model","parameters","on","a","dataset","by","minimizing","the","cost","function","through","gradient","descent","and","updates","the","layer","weights","according","to","a","learning","rule","defined","in","optimizer",".","Arguments",":","dataset","(","NervanaDataIterator",")",":","An","iterable","of","minibatches","where","each","element","is","a","(","x",",","y",")","tuple","where","x","is","the","input","data","and","y","are","the","labels",".","x","is","of","dimension","(","feature_size",",","batch_size",")","y","is","of","dimension","(","label_size",",","batch_size",")","Length","of","the","iterator","is","num_batches","which","is","num_data","\/","batch_size",".","cost","(","Cost",")",":","Defines","the","function","which","the","model","is","minimizing","based","on","the","output","of","the","last","layer","and","the","input","labels",".","optimizer","(","Optimizer",")",":","Defines","the","learning","rule","for","updating","the","model","parameters",".","num_epochs",":","Number","of","times","to","iterate","over","the","dataset",".","callbacks","(","Callbacks",")",":","Defines","callbacks","to","run","at","the","end","of","each","mini-batch","\/","epoch","."]
code: def fit(self, dataset, cost, optimizer, num_epochs, callbacks):
      """
      Trains the model parameters on a dataset by minimizing the cost function through
      gradient descent and updates the layer weights according to a learning rule
      defined in optimizer.
  
      Arguments:
          dataset (NervanaDataIterator): An iterable of minibatches where each
              element is a (x, y) tuple where x is the input data and y are the labels.
              x is of dimension (feature_size, batch_size)
              y is of dimension (label_size, batch_size)
              Length of the iterator is num_batches which is num_data / batch_size.
          cost (Cost): Defines the function which the model is minimizing based
                       on the output of the last layer and the input labels.
          optimizer (Optimizer): Defines the learning rule for updating the model parameters.
          num_epochs: Number of times to iterate over the dataset.
          callbacks (Callbacks): Defines callbacks to run at the end of each mini-batch / epoch.
      """
      self.nbatches = dataset.nbatches
      self.ndata = dataset.ndata
      # self.set_shortcut()  # infer if bprop shortcut can be used
      self.total_cost = np.empty([1, 1], dtype=np.float32)
      self.optimizer = optimizer
      self.initialize(dataset, cost)
  
      callbacks.on_train_begin(num_epochs)
      while self.epoch_index < num_epochs and not self.finished:
          self.nbatches = dataset.nbatches
  
          callbacks.on_epoch_begin(self.epoch_index)
  
          self._epoch_fit(dataset, callbacks)
  
          callbacks.on_epoch_end(self.epoch_index)
  
          self.epoch_index += 1
  
      callbacks.on_train_end()
  
imports: from __future__ import division, print_function
  from builtins import str, zip
  from collections import OrderedDict
  import logging
  from neon import __version__
  from neon import NervanaObject, logger
  from neon.backends.backend import Block
  from neon.transforms import CrossEntropyBinary, Logistic
  from neon.util.persist import load_obj, save_obj, load_class
  from neon.util.modeldesc import ModelDescription
  from neon.layers import Sequential, Activation
  from neon.layers.container import DeltasTree, SkipThought
  from neon.util.beamsearch import BeamSearch
  from neon.optimizers.optimizer import get_param_list
  import numpy
label_desc: Use image node_id 7 for calling the Model obj's underlying member method code with example usage: obj.fit(dataset, cost, optimizer, num_epochs, callbacks) without return types