Skip to content

Commit

Permalink
FEA:add SparseAdam trainer
Browse files Browse the repository at this point in the history
  • Loading branch information
EliverQ authored and chenyushuo committed Dec 10, 2020
1 parent 1789405 commit 05e9f56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recbole/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def _build_optimizer(self):
optimizer = optim.Adagrad(self.model.parameters(), lr=self.learning_rate)
elif self.learner.lower() == 'rmsprop':
optimizer = optim.RMSprop(self.model.parameters(), lr=self.learning_rate)
elif self.learner.lower() == 'sparse_adam':
optimizer =optim.SparseAdam(self.model.parameters(), lr=self.learning_rate)
else:
self.logger.warning('Received unrecognized optimizer, set default Adam optimizer')
optimizer = optim.Adam(self.model.parameters(), lr=self.learning_rate)
Expand Down

0 comments on commit 05e9f56

Please sign in to comment.