class_docstr: A wrapper class for using multiple Optimizers within the same model.
  
  To assign different optimizers to different layers we first define
  the different optimizers:
  
  .. code-block:: python
  
      from neon.optimizers import GradientDescentMomentum, RMSprop
  
      optimizer_A = GradientDescentMomentum(learning_rate=0.01, momentum_coef=0.9)
      optimizer_B = GradientDescentMomentum(learning_rate=0.05, momentum_coef=0.9)
      optimizer_C = RMSprop(learning_rate=2e-3, decay_rate=0.95)
  
  Then, we instantiate this class and pass a
  dictionary mapping layers to optimizers. The keys can either be:
  ``default``, a layer class name (e.g. ``Bias``), or the Layer's name
  attribute. The latter takes precedence for finer layer-to-layer control.
  
  For example, if we have the following layers,
  
  .. code-block:: python
  
      layers = []
      layers.append(Linear(nout = 100, init=Gaussian(), name="layer_one"))
      layers.append(Linear(nout = 50, init=Gaussian(), name="layer_two"))
      layers.append(Affine(nout = 5, init=Gaussian(), activation=Softmax()))
  
  we can define multiple optimizers with
  
  .. code-block:: python
  
      from neon.optimizers import MultiOptimizer
  
      # dictionary of mappings
      mapping = {'default': optimizer_A, # default optimizer
                 'Linear': optimizer_B, # all layers from the Linear class
                 'layer_two': optimizer_C} # this overrides the previous entry
  
      # use multiple optimizers
      opt = MultiOptimizer(mapping)
  
  After definition, we have the following mapping
  
  +----------------------+----------------------------+
  | Layer                | Optimizer                  |
  +======================+============================+
  | ``layer_one``        | ``optimizer_B``            |
  +----------------------+----------------------------+
  | ``layer_two``        | ``optimizer_C``            |
  +----------------------+----------------------------+
  | ``Affine.Linear``    | ``optimizer_B``            |
  +----------------------+----------------------------+
  | ``Affine.Bias``      | ``optimizer_A``            |
  +----------------------+----------------------------+
  | ``Affine.Softmax``   | ``None (no parameters)``   |
  +----------------------+----------------------------+
class_docstr_tok: ["A","wrapper","class","for","using","multiple","Optimizers","within","the","same","model",".","To","assign","different","optimizers","to","different","layers","we","first","define","the","different","optimizers",":","..","code-block",":",":","python","from","neon.optimizers","import","GradientDescentMomentum",",","RMSprop","optimizer_A","=","GradientDescentMomentum","(","learning_rate=0.01",",","momentum_coef=0.9",")","optimizer_B","=","GradientDescentMomentum","(","learning_rate=0.05",",","momentum_coef=0.9",")","optimizer_C","=","RMSprop","(","learning_rate=2e-3",",","decay_rate=0.95",")","Then",",","we","instantiate","this","class","and","pass","a","dictionary","mapping","layers","to","optimizers",".","The","keys","can","either","be",":","``","default","``",",","a","layer","class","name","(","e.g",".","``","Bias","``",")",",","or","the","Layer","'s","name","attribute",".","The","latter","takes","precedence","for","finer","layer-to-layer","control",".","For","example",",","if","we","have","the","following","layers",",","..","code-block",":",":","python","layers","=","[","]","layers.append","(","Linear","(","nout","=","100",",","init=Gaussian","(",")",",","name=","''","layer_one","''",")",")","layers.append","(","Linear","(","nout","=","50",",","init=Gaussian","(",")",",","name=","''","layer_two","''",")",")","layers.append","(","Affine","(","nout","=","5",",","init=Gaussian","(",")",",","activation=Softmax","(",")",")",")","we","can","define","multiple","optimizers","with","..","code-block",":",":","python","from","neon.optimizers","import","MultiOptimizer","#","dictionary","of","mappings","mapping","=","{","'default","'",":","optimizer_A",",","#","default","optimizer","'Linear","'",":","optimizer_B",",","#","all","layers","from","the","Linear","class","'layer_two","'",":","optimizer_C","}","#","this","overrides","the","previous","entry","#","use","multiple","optimizers","opt","=","MultiOptimizer","(","mapping",")","After","definition",",","we","have","the","following","mapping","+","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","Layer","|","Optimizer","|","+======================+============================+","|","``","layer_one","``","|","``","optimizer_B","``","|","+","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","layer_two","``","|","``","optimizer_C","``","|","+","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","Affine.Linear","``","|","``","optimizer_B","``","|","+","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","Affine.Bias","``","|","``","optimizer_A","``","|","+","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","Affine.Softmax","``","|","``","None","(","no","parameters",")","``","|","+","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+"]
code: def gen_class(cls, pdict):
      for key in pdict["optimizer_mapping"]:
          # these should be optimizers
          typ = pdict["optimizer_mapping"][key]["type"]
          ocls = load_class(typ)
          if "config" not in pdict["optimizer_mapping"][key]:
              pdict["optimizer_mapping"][key]["config"] = {}
          conf = pdict["optimizer_mapping"][key]["config"]
          pdict["optimizer_mapping"][key] = ocls.gen_class(conf)
      return cls(**pdict)
  
imports: from __future__ import division
  from neon import NervanaObject
  from neon.util.persist import load_class
  import logging
  import numpy
label_desc: Use image node_id 2 for calling the MultiOptimizer obj's underlying member method code with example usage: obj.gen_class(cls, pdict) and returns: cls