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: Get the activation outputs of the final model layer for the dataset
  
  Arguments:
      dataset (NervanaDataIterator) Dataset iterator to perform fit on
      num_beams (int, optional) Nonzero to use beamsearch for sequence to sequence models
      steps (Int): Length of desired output in number of time steps
  
  Returns:
      Host numpy array: the output of the final layer for the entire Dataset
docstr_tok: ["Get","the","activation","outputs","of","the","final","model","layer","for","the","dataset","Arguments",":","dataset","(","NervanaDataIterator",")","Dataset","iterator","to","perform","fit","on","num_beams","(","int",",","optional",")","Nonzero","to","use","beamsearch","for","sequence","to","sequence","models","steps","(","Int",")",":","Length","of","desired","output","in","number","of","time","steps","Returns",":","Host","numpy","array",":","the","output","of","the","final","layer","for","the","entire","Dataset"]
code: def get_outputs_beam(self, dataset, num_beams=0, steps=None):
      """
      Get the activation outputs of the final model layer for the dataset
  
      Arguments:
          dataset (NervanaDataIterator) Dataset iterator to perform fit on
          num_beams (int, optional) Nonzero to use beamsearch for sequence to sequence models
          steps (Int): Length of desired output in number of time steps
  
      Returns:
          Host numpy array: the output of the final layer for the entire Dataset
      """
      self.initialize(dataset)
      dataset.reset()  # Move "pointer" back to beginning of dataset
      n = dataset.nbatches
      x = self.layers.layers[-1].outputs
      assert not isinstance(
          x, list
      ), "Can not get_outputs with Branch terminal"
      if num_beams > 0:
          beamsearch = BeamSearch(self.layers)
      Ypred = None
      logger.info(
          "Performing beam search with " + str(num_beams) + " beams"
      )
      for idx, (x, t) in enumerate(dataset):
          if num_beams > 0:
              x = beamsearch.beamsearch(x, num_beams, steps=steps)
          else:
              x = self.fprop(x, inference=True)
          if Ypred is None:
              (dim0, dim1) = x.shape
              Ypred = np.empty((n * dim1, dim0), dtype=x.dtype)
              nsteps = dim1 // self.be.bsz
          cur_batch = slice(idx * dim1, (idx + 1) * dim1)
          Ypred[cur_batch] = x.get().T
  
      # Handle the beam search case.
      if dim0 == getattr(dataset, "seq_length", None):
          b = self.be.bsz
          s = dataset.seq_length
          Ypred = Ypred.reshape((n * b, s, -1))
  
      # Handle the recurrent case.
      elif nsteps != 1:
          b, s = (self.be.bsz, nsteps)
          Ypred = (
              Ypred.reshape((n, s, b, -1))
              .transpose(0, 2, 1, 3)
              .copy()
              .reshape(n * b, s, -1)
          )
  
      return Ypred[: dataset.ndata]
  
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 13 for calling the Model obj's underlying member method code with example usage: obj.get_outputs_beam(dataset, num_beams, steps) and returns: Ypred