From ee76205073fc26e632edb547ce6a39338eca09d9 Mon Sep 17 00:00:00 2001 From: brentyi Date: Mon, 23 Dec 2024 02:20:05 -0800 Subject: [PATCH] Fix "auto" for forward-mode vs reverse-mode jacobians, cleanup --- .flake8 | 7 ------- .gitignore | 5 ----- LICENSE | 2 +- src/jaxls/_factor_graph.py | 2 +- 4 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 17277ba..0000000 --- a/.flake8 +++ /dev/null @@ -1,7 +0,0 @@ -[flake8] -# E203: whitespace before : -# E501: line too long ( characters) -# W503: line break before binary operator -; ignore = E203,E501,D100,D101,D102,D103,W503 -ignore = E203,E501,W503 -per-file-ignores = __init__.py:F401,F403 diff --git a/.gitignore b/.gitignore index 4c4cd68..afe062f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,3 @@ *.pyc *.egg-info __pycache__ -.mypy_cache -.dmypy.json -.pytype -.hypothesis -.ipynb_checkpoints diff --git a/LICENSE b/LICENSE index f090814..2fb1edd 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/src/jaxls/_factor_graph.py b/src/jaxls/_factor_graph.py index aa41a00..78317b9 100644 --- a/src/jaxls/_factor_graph.py +++ b/src/jaxls/_factor_graph.py @@ -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.