Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions csrc/embedding/adagrad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ void SparseAdagrad::add_param_group(
const SparseOptimizerParamGroup &param_group) {
SparseOptimizerParamGroup param_group_(param_group.params());
// set options for group
if (!param_group_.has_options()) {
if (!param_group.has_options()) {
param_group_.set_options(defaults_->clone());
} else {
param_group_.set_options(param_group_.options().clone());
param_group_.set_options(param_group.options().clone());
}
// init optimizer global state for hashtable name <-> hashtable ptr
for (const auto &param : param_group_.params()) {
init_param_state(param.second, param_group_.options());
}
// add param group
param_groups_.emplace_back(param_group);
param_groups_.emplace_back(param_group_);
}

void SparseAdagrad::add_parameters(
Expand Down
2 changes: 2 additions & 0 deletions recis/optim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from recis.optim.sparse_adam import SparseAdam as SparseAdam
from recis.optim.sparse_adamw import SparseAdamW as SparseAdamW
from recis.optim.sparse_adamw_tf import SparseAdamWTF as SparseAdamWTF
from recis.optim.sparse_adagrad import SparseAdagrad as SparseAdagrad


__all__ = [
Expand All @@ -22,5 +23,6 @@
"SparseAdam",
"SparseAdamW",
"SparseAdamWTF",
"SparseAdagrad",
"wrapped_named_optimizer",
]