Skip to content

Commit

Permalink
add weightdecay to Adam (intel-analytics#2415)
Browse files Browse the repository at this point in the history
* add weightdecay

* revert

* some change

* some update

* some update
  • Loading branch information
qiuxin2012 committed Jul 14, 2020
1 parent c454f69 commit a750024
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/dllib/src/bigdl/dllib/keras/optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self,
epsilon=1e-8,
decay=0.0,
schedule=None,
weight_decay=0.0,
bigdl_type="float"):
"""
:param lr learning rate
Expand All @@ -60,13 +61,15 @@ def __init__(self,
beta_2,
epsilon,
decay,
weight_decay,
schedule if (schedule) else Default()
)
self.bigdl_type = bigdl_type


class AdamWeightDecay(OptimMethod, ZooKerasCreator):
"""
Implements BERT version of Adam algorithm.
>>> adam = AdamWeightDecay()
creating: createZooKerasAdamWeightDecay
"""
Expand Down

0 comments on commit a750024

Please sign in to comment.