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

TAO interface #143

Merged
merged 72 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
63c37ee
Basic TAO interface, add to Firedrake tests
jrmaddison May 2, 2024
3373a25
OverloadedType / PETSc Vec conversion interface (ported from tlm_adjo…
jrmaddison May 2, 2024
1ccb0d3
Update comment
jrmaddison May 2, 2024
3230abf
Remove PETScVecInterface.dtype
jrmaddison May 2, 2024
32b87f3
Port TAO interface from tlm_adjoint
jrmaddison May 2, 2024
0a319c7
TAO interface: Bounds
jrmaddison May 2, 2024
4b44451
Parallel is incorrect -- raise an exception
jrmaddison May 2, 2024
64eb9ff
Parallel workaround
jrmaddison May 10, 2024
b69e269
Parallel fix
jrmaddison May 10, 2024
36cfd6a
Parallel fix
jrmaddison May 10, 2024
a337a51
Parallel fix
jrmaddison May 10, 2024
f030221
Correct initial guess
jrmaddison May 10, 2024
3acde76
Add missing first order adjoint run when evaluating Hessian actions
jrmaddison May 20, 2024
8464ff5
Convert assertion failure to a ValueError exception
jrmaddison May 20, 2024
b3cc040
Documentation, tidying
jrmaddison May 20, 2024
2772a75
Add destroy calls
jrmaddison May 20, 2024
a55c91d
Bugfix
jrmaddison May 21, 2024
6812201
Define the LMVM initial Hessian inverse, set to be the same as used f…
jrmaddison May 23, 2024
08c3d5c
flake8
jrmaddison May 23, 2024
a80a0e7
Remove use of _ad_convert_type when defining bounds
jrmaddison Jun 20, 2024
611af4c
TaoSetUp should be called last
jrmaddison Jun 20, 2024
79b0855
API update
jrmaddison Jun 20, 2024
d6a5cd5
Documentation
jrmaddison Jun 20, 2024
4e92511
Add warning re the use of a global vector
jrmaddison Jun 20, 2024
abb3c07
Restore delete part of test_simple_inversion
jrmaddison Jun 20, 2024
1448494
flake8
jrmaddison Jun 20, 2024
d4fa983
Correct documentation
jrmaddison Jun 20, 2024
0e888e8
test vec concatenate
Ig-dolci Jun 27, 2024
a7fb96b
wip
Ig-dolci Jun 27, 2024
6458edc
ok
Ig-dolci Jun 28, 2024
704dbaf
Update pyadjoint/adjfloat.py
Ig-dolci Jul 18, 2024
bc1e773
Update pyadjoint/optimization/tao_solver.py
Ig-dolci Jul 18, 2024
d006c38
wip
Ig-dolci Jul 18, 2024
f45ac87
adjfloat update
Ig-dolci Jul 18, 2024
95c42d5
wip
Ig-dolci Jul 18, 2024
485e836
prepared bounds; ad_assign
Ig-dolci Jul 18, 2024
e087687
linting
Ig-dolci Jul 18, 2024
775d1e3
_ad_to_petsc/_ad_from_petsc
Ig-dolci Jul 19, 2024
e490d58
Update pyadjoint/adjfloat.py
Ig-dolci Jul 19, 2024
8760619
Update pyadjoint/adjfloat.py
Ig-dolci Jul 19, 2024
92bbdb7
Apply suggestions from code review
Ig-dolci Jul 19, 2024
c3c38d5
Tidying and fixes
jrmaddison Jul 19, 2024
adc7051
AdjFloat._ad_to_petsc and AdjFloat._ad_from_petsc Exception bugfix an…
jrmaddison Jul 30, 2024
2cb79bd
Update pyadjoint/optimization/tao_solver.py
jrmaddison Jul 30, 2024
25a12e3
Update pyadjoint/optimization/tao_solver.py
jrmaddison Jul 30, 2024
5c5fb1b
Documentation
jrmaddison Jul 30, 2024
86577c6
Apply scalar bounds using PETScVecInterface
jrmaddison Jul 30, 2024
59cd350
flake8
jrmaddison Jul 30, 2024
6f3a5a5
Remove format specifiers
jrmaddison Jul 30, 2024
39a2178
Tidying
jrmaddison Jul 30, 2024
5995e89
Remove OverloadedType._ad_assign
jrmaddison Jul 30, 2024
0d9133b
Check convergence reason
jrmaddison Jul 31, 2024
dd0e192
Update pyadjoint/overloaded_type.py
jrmaddison Aug 5, 2024
0f84623
Update pyadjoint/overloaded_type.py
jrmaddison Aug 5, 2024
25dab2d
Update pyadjoint/adjfloat.py
jrmaddison Aug 5, 2024
e9a7090
Update pyadjoint/optimization/tao_solver.py
jrmaddison Aug 5, 2024
3142d98
Add length check before zip
jrmaddison Aug 5, 2024
3caa063
Clarify that x_sub as returned by getSubVector is passed to restoreSu…
jrmaddison Aug 5, 2024
17e0883
Use OptionsManager class from Firedrake, with very minor edits to rem…
jrmaddison Aug 8, 2024
0577926
Document add_destroy_finalizer
jrmaddison Aug 8, 2024
56b23d5
Remove Vec.destroy calls
jrmaddison Aug 8, 2024
233197c
Rename M, X, Y, new_M, new_M_dual
jrmaddison Aug 8, 2024
1931549
Document PETSc Python contexts
jrmaddison Aug 8, 2024
8b6021a
Add comment for B_0_matrix
jrmaddison Aug 8, 2024
79d6a99
taoobjective -> tao_objective
jrmaddison Aug 8, 2024
19d7695
More descriptive error message on convergence failure
jrmaddison Aug 8, 2024
733b50a
Minor fixes
jrmaddison Aug 8, 2024
590cb2d
Check for PETSc in OptionsManager
jrmaddison Aug 8, 2024
1357952
Fix comment
jrmaddison Aug 8, 2024
08674cf
PETSc/TAO API fix
jrmaddison Sep 10, 2024
cd51a38
Remove attach_destroy_finalizer
jrmaddison Sep 20, 2024
d30c57e
flake8
jrmaddison Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyadjoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
from .optimization.optimization_problem import MinimizationProblem
from .optimization.ipopt_solver import IPOPTSolver
from .optimization.rol_solver import ROLSolver
from .optimization.tao_solver import TAOSolver
from .optimization.constraints import InequalityConstraint, EqualityConstraint
from .optimization.moola_problem import MoolaOptimizationProblem
6 changes: 6 additions & 0 deletions pyadjoint/adjfloat.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ def _ad_str(self):
"""Return the string of the taped value of this variable."""
return str(self.block_variable.saved_output)

def _ad_to_petsc(self, vec=None):
raise NotImplementedError("_ad_to_petsc not implemented for AdjFloat.")

def _ad_from_petsc(self, vec):
raise NotImplementedError("_ad_from_petsc not implemented for AdjFloat.")


_exp = math.exp
_log = math.log
Expand Down
Loading