Skip to content

Commit

Permalink
fix(torch): default gradient clipping to true when using madgrad
Browse files Browse the repository at this point in the history
  • Loading branch information
fantes authored and mergify[bot] committed Apr 9, 2021
1 parent 0657d82 commit 5979019
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backends/torch/torchsolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace dd
if (ad_solver.has("solver_type"))
_solver_type = ad_solver.get("solver_type").get<std::string>();

if (_solver_type == "RANGER" || _solver_type == "RANGER_PLUS")
if (_solver_type == "RANGER" || _solver_type == "RANGER_PLUS"
|| _solver_type == "MADGRAD")
_clip = true;

if (_solver_type == "RANGER_PLUS")
Expand Down

0 comments on commit 5979019

Please sign in to comment.