Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implicit/truncated backward modes #29

Merged
merged 14 commits into from
Jan 19, 2022
Prev Previous commit
Next Next commit
add ValueError messages
  • Loading branch information
bamos committed Jan 11, 2022
commit fd7d42e53ead6bbf462abe6c389bc85e5364d352
6 changes: 4 additions & 2 deletions theseus/optimizer/nonlinear/nonlinear_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ def _optimize_impl(
backward_num_iterations = 1
else:
if "backward_num_iterations" not in kwargs:
raise ValueError()
raise ValueError(
"backward_num_iterations expected but not received"
)
backward_num_iterations = kwargs["backward_num_iterations"]

num_no_grad_iter = self.params.max_iterations - backward_num_iterations
Expand Down Expand Up @@ -305,7 +307,7 @@ def _optimize_impl(

return info
else:
raise ValueError()
raise ValueError("Unrecognized backward mode")

@abc.abstractmethod
def compute_delta(self, **kwargs) -> torch.Tensor:
Expand Down