Skip to content

Commit

Permalink
added __slots__ to SGD with Momentum
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnakul committed Mar 13, 2021
1 parent 0de7738 commit cd6a034
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MLlib/optim/sgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class SGDWithMomentum(optim.Optimizer):
The momentum (beta)
"""

__slots__ = ('beta', 'lr', 'v')

def __init__(self, parameters, lr=0.001, momentum=0.9):
super().__init__(parameters)
self.beta = momentum
Expand Down

0 comments on commit cd6a034

Please sign in to comment.