LazyAdam
Customizes the LazyAdam optimizer.
Prototype
1 | def create_hash_optimizer(learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-8, name="LazyAdam", use_fusion_optim=False) |
Parameters
Parameter |
Type |
Mandatory/Optional |
Description |
|---|---|---|---|
learning_rate |
float/tf.Tensor |
Optional |
Learning rate Default value: 0.001 Value range: [0.0, 10.0] |
beta1 |
float |
Optional |
Exponential decay rate estimated at the first moment Default value: 0.9 Value range: (0.0, 1.0) |
beta2 |
float |
Optional |
Exponential decay rate estimated at the second moment Default value: 0.999 Value range: [0.0, 1.0] |
epsilon |
float |
Optional |
Adds the value to the denominator to improve data stability. Default value: 1e-8 Value range: (0.0, 1.0] |
name |
string |
Optional |
Name of the optimizer Default value: LazyAdam Name length range: [1, 200]. |
use_fusion_optim |
bool |
Optional |
Whether to use the LazyAdam fused operator to calculate and update slot_m, slot_v, and variable. Default value: False Value range: |
Return Value
An instance object of the CustomizedLazyAdam optimizer.
Example
1 2 | from mx_rec.optimizers.lazy_adam import create_hash_optimizer hashtable_optimizer = create_hash_optimizer() |