File size: 4,990 Bytes
fc0f7bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Transformations
=====================

.. currentmodule:: optax

.. autosummary::
    adaptive_grad_clip
    AdaptiveGradClipState
    add_decayed_weights
    AddDecayedWeightsState
    add_noise
    AddNoiseState
    apply_every
    ApplyEvery
    bias_correction
    conditionally_mask
    conditionally_transform
    ConditionallyMaskState
    ConditionallyTransformState
    centralize
    clip
    clip_by_block_rms
    ClipState
    clip_by_global_norm
    ClipByGlobalNormState
    ema
    EmaState
    EmptyState
    global_norm
    GradientTransformation
    GradientTransformationExtraArgs
    identity
    keep_params_nonnegative
    NonNegativeParamsState
    OptState
    Params
    per_example_global_norm_clip
    per_example_layer_norm_clip
    scale
    ScaleState
    scale_by_adadelta
    ScaleByAdaDeltaState
    scale_by_adam
    scale_by_adamax
    ScaleByAdamState
    scale_by_amsgrad
    ScaleByAmsgradState
    scale_by_backtracking_linesearch
    ScaleByBacktrackingLinesearchState
    scale_by_belief
    ScaleByBeliefState
    scale_by_factored_rms
    FactoredState
    scale_by_learning_rate
    scale_by_lion
    ScaleByLionState
    scale_by_novograd
    ScaleByNovogradState
    scale_by_optimistic_gradient
    scale_by_param_block_norm
    scale_by_param_block_rms
    scale_by_polyak
    scale_by_radam
    scale_by_rms
    ScaleByRmsState
    scale_by_rprop
    ScaleByRpropState
    scale_by_rss
    ScaleByRssState
    scale_by_schedule
    ScaleByScheduleState
    scale_by_sm3
    ScaleBySM3State
    scale_by_stddev
    ScaleByRStdDevState
    scale_by_trust_ratio
    ScaleByTrustRatioState
    scale_by_yogi
    set_to_zero
    stateless
    stateless_with_tree_map
    trace
    TraceState
    TransformInitFn
    TransformUpdateFn
    update_infinity_moment
    update_moment
    update_moment_per_elem_norm
    Updates
    with_extra_args_support
    zero_nans
    ZeroNansState


Types
~~~~~

.. autoclass:: GradientTransformation

.. autoclass:: GradientTransformationExtraArgs

.. autoclass:: TransformInitFn

.. autoclass:: TransformUpdateFn

.. autoclass:: OptState

.. autoclass:: Params

.. autoclass:: Updates


Transformations and states
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: adaptive_grad_clip
.. autoclass:: AdaptiveGradClipState

.. autofunction:: add_decayed_weights
.. autoclass:: AddDecayedWeightsState

.. autofunction:: add_noise
.. autoclass:: AddNoiseState

.. autofunction:: apply_every
.. autoclass:: ApplyEvery

.. autofunction:: bias_correction

.. autofunction:: centralize

.. autofunction:: conditionally_mask
.. autoclass:: ConditionallyMaskState

.. autofunction:: conditionally_transform
.. autoclass:: ConditionallyTransformState

.. autofunction:: clip
.. autofunction:: clip_by_block_rms
.. autoclass:: ClipState

.. autofunction:: clip_by_global_norm
.. autoclass:: ClipByGlobalNormState

.. autofunction:: ema
.. autoclass:: EmaState

.. autoclass:: EmptyState

.. autofunction:: global_norm

.. autofunction:: identity

.. autofunction:: keep_params_nonnegative
.. autoclass:: NonNegativeParamsState

.. autofunction:: per_example_global_norm_clip
.. autofunction:: per_example_layer_norm_clip

.. autofunction:: scale
.. autoclass:: ScaleState

.. autofunction:: scale_by_adadelta
.. autoclass:: ScaleByAdaDeltaState

.. autofunction:: scale_by_adam
.. autofunction:: scale_by_adamax
.. autoclass:: ScaleByAdamState

.. autofunction:: scale_by_amsgrad
.. autoclass:: ScaleByAmsgradState

.. autofunction:: scale_by_backtracking_linesearch
.. autoclass:: ScaleByBacktrackingLinesearchState

.. autofunction:: scale_by_belief
.. autoclass:: ScaleByBeliefState

.. autofunction:: scale_by_factored_rms
.. autoclass:: FactoredState

.. autofunction:: scale_by_learning_rate

.. autofunction:: scale_by_lion
.. autoclass:: ScaleByLionState

.. autofunction:: scale_by_novograd
.. autoclass:: ScaleByNovogradState

.. autofunction:: scale_by_optimistic_gradient

.. autofunction:: scale_by_param_block_norm

.. autofunction:: scale_by_param_block_rms

.. autofunction:: scale_by_radam

.. autofunction:: scale_by_polyak

.. autofunction:: scale_by_rms
.. autoclass:: ScaleByRmsState

.. autofunction:: scale_by_rprop
.. autoclass:: ScaleByRpropState

.. autofunction:: scale_by_rss
.. autoclass:: ScaleByRssState

.. autofunction:: scale_by_schedule
.. autoclass:: ScaleByScheduleState

.. autofunction:: scale_by_sm3
.. autoclass:: ScaleBySM3State

.. autofunction:: scale_by_stddev
.. autoclass:: ScaleByRStdDevState

.. autofunction:: scale_by_trust_ratio
.. autoclass:: ScaleByTrustRatioState

.. autofunction:: scale_by_yogi

.. autofunction:: set_to_zero

.. autofunction:: stateless
.. autofunction:: stateless_with_tree_map

.. autofunction:: trace
.. autoclass:: TraceState

.. autofunction:: update_infinity_moment
.. autofunction:: update_moment
.. autofunction:: update_moment_per_elem_norm

.. autofunction:: with_extra_args_support

.. autofunction:: zero_nans
.. autoclass:: ZeroNansState