ó ùµÈ[c@sfdZddlZejjdejjfd„ƒYƒZejjdejjfd„ƒYƒZdS(sÐA `_SVRGOptimizer` encapsulates two optimizers to support SVRGModule in single machine and distributed settings. Both `_AssignmentOptimizer` and `_SVRGOptimizer` are designed to be used with SVRGModule only. iÿÿÿÿNt_AssignmentOptimizercBseZdZd„ZRS(sÂ_AssignmentOptimizer assigns gradients to weights for SVRGModule's full gradients accumulation in the KVStore. It is a helper optimizer that is designed to be used with SVRGModule only. cCs ||(dS(s”Assign the gradients to weight for accumulating full gradients in the KVStore across all devices and workers. Parameters ---------- index : int The unique index of the parameter into the individual learning rates and weight decays. Learning rates and weight decay may be set via `set_lr_mult()` and `set_wd_mult()`, respectively. weight : NDArray The parameter to be updated. grad : NDArray The gradient of the objective with respect to this parameter. state: any obj AssignmentOptimizer will not need to be associated with state. N((tselftindextweighttgradtstate((sn/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/contrib/svrg_optimization/svrg_optimizer.pytupdates(t__name__t __module__t__doc__R(((sn/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/contrib/svrg_optimization/svrg_optimizer.pyRst_SVRGOptimizercBsAeZdZd„Zed„ƒZd„Zd„Zd„ZRS(s_SVRGOptimizer is a wrapper class for two optimizers: _AssignmentOptimizer for accumulating full gradients in the KVStore and a default optimizer that is passed in as a parameter in `mod.init_optimizer()` The _SVRGOptimizer is designed to be used with SVRGModule only. This optimizer accepts the following parameters in addition to those accepted by :class:`.Optimizer`. Parameters ---------- default_optimizer: str or Optimizer Optimizer passed-in when invoke on mx.mod.init_optimizer in SVRGModule cKst|j|}tt|ƒj|t|tƒrOtjj|||_ n ||_ tjjt j ƒ|_ dS(N( t _check_paramstsuperR t__init__t isinstancetstrtmxt optimizertcreatet default_optRRtaux_opt(Rtdefault_optimizertkwargst base_param((sn/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/contrib/svrg_optimization/svrg_optimizer.pyR @s  c Kstt|ƒ}ddddddddd d g }i}x7|jƒD])\}}||krC||||s