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",")"]
code: def __init__(
      self,
      layers,
      dataset=None,
      weights_only=False,
      name="model",
      optimizer=None,
  ):
      super(Model, self).__init__(name)
      self.optimizer = optimizer
      self.params = None  # should be able to remove
      self.states = None  # should be able to remove
      self.epoch_index = 0
      self.finished = False
      self.initialized = False
      self.cost = None
      self.nbatches = 0
      self.ndata = 0
  
      if dataset is not None:
          logger.warning(
              "dataset is a deprecated argument and will be ignored"
          )
  
      if type(layers) in (ModelDescription, dict):
          # load up the model from a serialized file (dataset could be None here)
          self.deserialize(layers, load_states=(not weights_only))
      elif isinstance(layers, (str, bytes)):
          self.load_params(layers, load_states=(not weights_only))
      else:
          # Wrap the list of layers in a Sequential container if a raw list of layers
          if isinstance(layers, list):
              self.layers = Sequential(layers)
          else:
              self.layers = layers
  
              if isinstance(layers, SkipThought) and hasattr(
                  layers, "layer_dict"
              ):
                  self.layer_dict = layers.layer_dict
  
      self.layers.propagate_parallelism("Data")
  
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 1 to create a new Model object from inherited base classes: NervanaObject with example: obj = Model(layers, dataset, weights_only, name, optimizer)