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
spacing
  • Loading branch information
bamos committed Dec 12, 2021
commit 0894d6a14f45386de350bbace1b89fd7c4fd9ac9
5 changes: 3 additions & 2 deletions examples/backward_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def quad_error_fn(optim_vars, aux_vars):

da_dx = torch.autograd.grad(updated_inputs["a"], data_x, retain_graph=True)[0].squeeze()

print("\n--- backward_mode=FULL")
print("--- backward_mode=FULL")
print(da_dx.numpy())


Expand Down Expand Up @@ -116,7 +116,8 @@ def fit_x(data_x_np):
data_x_np = data_x.detach().clone().numpy()
dfit_x = nd.Gradient(fit_x)
g = dfit_x(data_x_np)
print("--- Numeric derivative")

print("\n--- Numeric derivative")
print(g)

theseus_inputs["x"] = data_x
Expand Down