.. _f-sgd: module ``optim.sgd`` ==================== .. inheritance-diagram:: mlstatpy.optim.sgd Short summary +++++++++++++ module ``mlstatpy.optim.sgd`` Implements simple stochastic gradient optimisation. It is inspired from `_stochastic_optimizers.py `_. :githublink:`%|py|8` Classes +++++++ +-----------------------------------------------------------+------------------------------------------------------+ | class | truncated documentation | +===========================================================+======================================================+ | :class:`BaseOptimizer ` | Base stochastic gradient descent optimizer. | +-----------------------------------------------------------+------------------------------------------------------+ | :class:`SGDOptimizer ` | Stochastic gradient descent optimizer with momentum. | +-----------------------------------------------------------+------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | method | truncated documentation | +=================================================================================================+===========================================================================================+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_display_progress ` | Displays training progress. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_display_progress ` | Displays training progress. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_evaluate_early_stopping ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_evaluate_early_stopping ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_get_updates ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_get_updates ` | Gets the values used to update params with given gradients. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_regularize_gradient ` | Applies regularization. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :py:meth:`_regularize_gradient ` | Applies regularization. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`iteration_ends ` | Performs update to learning rate and potentially other states at the end of an iteration. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`iteration_ends ` | Performs updates to learning rate and potential other states at the end of an iteration. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`loss_regularization ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`loss_regularization ` | | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`train ` | Optimizes the coefficients. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`train ` | Optimizes the coefficients. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`update_coef ` | Updates coefficients with given gradient. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ | :meth:`update_coef ` | Updates coefficients with given gradient. | +-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlstatpy.optim.sgd :members: :special-members: __init__ :show-inheritance: