Skip to content

Commit

Permalink
Fix "auto" for forward-mode vs reverse-mode jacobians, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Dec 23, 2024
1 parent 67239c1 commit ee76205
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
7 changes: 0 additions & 7 deletions .flake8

This file was deleted.

5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
*.pyc
*.egg-info
__pycache__
.mypy_cache
.dmypy.json
.pytype
.hypothesis
.ipynb_checkpoints
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Brent Yi
Copyright (c) 2024 Brent Yi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/jaxls/_factor_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def compute_jac_with_perturb(factor: _AnalyzedFactor) -> jax.Array:
"reverse": jax.jacrev,
"auto": jax.jacrev
if factor.residual_dim < val_subset._get_tangent_dim()
else jax.jacrev,
else jax.jacfwd,
}[factor.jac_mode]
return jacfunc(
# The residual function, with respect to to some local delta.
Expand Down

0 comments on commit ee76205

Please sign in to comment.