Skip to content

Commit

Permalink
Merge pull request #13 from milzj/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
milzj authored Feb 10, 2024
2 parents 2c81f38 + 5fb63f6 commit babe9ee
Show file tree
Hide file tree
Showing 15 changed files with 309 additions and 439 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-FW4PDE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.2.0
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: anaconda-client-env
environment-file: environment.yml
Expand Down
5 changes: 5 additions & 0 deletions examples/convex/example57/example57.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
plot(solution_final)
plt.savefig("solution.pdf")

gradient_final = sol["gradient_final"].data
c = plot(gradient_final)
plt.colorbar(c)
plt.savefig("gradient_final.pdf")

solution_final = sol["control_final"]
obj = problem.obj
obj(solution_final)
Expand Down
1 change: 0 additions & 1 deletion fw4pde/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from .box_lmo import NumpyBoxLMO, MoolaBoxLMO
from .frank_wolfe import FrankWolfe
from .frank_wolfe_memory import FrankWolfeMemory
2 changes: 2 additions & 0 deletions fw4pde/algorithms/frank_wolfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def solve(self):

# Update stats
self.data.update({"control_final": u})
self.data.update({"gradient_final": gradient})
objective_final = obj_u + nonsmooth_obj(u.data)
self.data.update({"objective_final": objective_final})

Expand All @@ -169,6 +170,7 @@ def solve(self):
if objective_final < objective_best:

self.data.update({"control_best": u})
self.data.update({"gradient_best": gradient})
self.data.update({"objective_best": objective_final})
objective_best = objective_final

Expand Down
333 changes: 0 additions & 333 deletions fw4pde/algorithms/frank_wolfe_memory.py

This file was deleted.

Loading

0 comments on commit babe9ee

Please sign in to comment.