-
-
Notifications
You must be signed in to change notification settings - Fork 195
390 convert optimizers class to num power #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
apphp
wants to merge
23
commits into
RubixML:3.0
Choose a base branch
from
apphp:390-convert-optimizers-class-to-NumPower
base: 3.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
033de60
390 convert StepDecay to Numpower
apphp a02c4a0
390 convert RMSProp to Numpower
apphp cccfa79
390 added math explanation for step() methods
apphp f1c55e6
390 convert Momentum to Numpower
apphp 919ce36
390 convert Cyclical to NumPower
apphp d806494
390 added math formulas to momentum.md
apphp 3fa08ec
390 added math formulas to rms-prop.md
apphp 537b586
390 added math formulas to stochastic.md
apphp 331fb36
390 convert Adam to NumPower
apphp 47ad665
390 refactoring CyclicalTest - added dataprovider for constructor tests
apphp 3575565
390 refactoring CyclicalTest - added dataprovider for constructor tests
apphp 8677c76
390 refactoring AdamTest - added dataprovider for constructor tests
apphp 269405b
390 refactoring MomentumTest - added dataprovider for constructor tests
apphp aca753e
390 refactoring RMSPropTest - added dataprovider for constructor tests
apphp e9c4831
390 refactoring StepDecayTest - added dataprovider for constructor tests
apphp 8d3f76a
390 refactoring StochasticTest - added dataprovider for constructor t…
apphp 23397ef
390 convert AdaMax to NumPower
apphp 223a90e
390 convert AdaMax to NumPower
apphp db1c6db
390 Added warm initialization test for zeroed Adam optimizer caches
apphp 548c055
Code cleanup: removed redundant docblocks, adjusted formatting, and a…
apphp 40cf94b
390 convert AdaGrad to NumPower
apphp a67655f
390- Fix broken link to the Adam optimizer source file in documentation
apphp 5255d64
ML-390 Typo fixes
apphp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,35 @@ | ||
| <span style="float:right;"><a href="https://github.com/RubixML/ML/blob/master/src/NeuralNet/Optimizers/AdaGrad.php">[source]</a></span> | ||
| <span style="float:right;"><a href="https://github.com/RubixML/ML/blob/master/src/NeuralNet/Optimizers/AdaGrad/AdaGrad.php">[source]</a></span> | ||
|
|
||
| # AdaGrad | ||
| Short for *Adaptive Gradient*, the AdaGrad Optimizer speeds up the learning of parameters that do not change often and slows down the learning of parameters that do enjoy heavy activity. Due to AdaGrad's infinitely decaying step size, training may be slow or fail to converge using a low learning rate. | ||
|
|
||
| ## Mathematical formulation | ||
| Per step (element-wise), AdaGrad accumulates the sum of squared gradients and scales the update by the root of this sum: | ||
|
|
||
| $$ | ||
| \begin{aligned} | ||
| \mathbf{n}_t &= \mathbf{n}_{t-1} + \mathbf{g}_t^{2} \\ | ||
| \Delta{\theta}_t &= \alpha\, \frac{\mathbf{g}_t}{\sqrt{\mathbf{n}_t} + \varepsilon} | ||
| \end{aligned} | ||
| $$ | ||
|
|
||
| where: | ||
| - $t$ is the current step, | ||
| - $\alpha$ is the learning rate (`rate`), | ||
| - $\mathbf{g}_t$ is the current gradient, and $\mathbf{g}_t^{2}$ denotes element-wise square, | ||
| - $\varepsilon$ is a small constant for numerical stability (in the implementation, the denominator is clipped from below by `EPSILON`). | ||
|
|
||
| ## Parameters | ||
| | # | Name | Default | Type | Description | | ||
| |---|---|---|---|---| | ||
| | 1 | rate | 0.01 | float | The learning rate that controls the global step size. | | ||
|
|
||
| ## Example | ||
| ```php | ||
| use Rubix\ML\NeuralNet\Optimizers\AdaGrad; | ||
| use Rubix\ML\NeuralNet\Optimizers\AdaGrad\AdaGrad; | ||
|
|
||
| $optimizer = new AdaGrad(0.125); | ||
| ``` | ||
|
|
||
| ## References | ||
| [^1]: J. Duchi et al. (2011). Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. | ||
| [^1]: J. Duchi et al. (2011). Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.