Skip to content

Commit babe9ee

Browse files
authored
Merge pull request #13 from milzj/devel
Devel
2 parents 2c81f38 + 5fb63f6 commit babe9ee

15 files changed

+309
-439
lines changed

.github/workflows/test-FW4PDE.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
run:
1717
shell: bash -l {0}
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Setup Miniconda
21-
uses: conda-incubator/setup-miniconda@v2.2.0
21+
uses: conda-incubator/setup-miniconda@v3
2222
with:
2323
activate-environment: anaconda-client-env
2424
environment-file: environment.yml

examples/convex/example57/example57.py

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
plot(solution_final)
7575
plt.savefig("solution.pdf")
7676

77+
gradient_final = sol["gradient_final"].data
78+
c = plot(gradient_final)
79+
plt.colorbar(c)
80+
plt.savefig("gradient_final.pdf")
81+
7782
solution_final = sol["control_final"]
7883
obj = problem.obj
7984
obj(solution_final)

fw4pde/algorithms/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
from .box_lmo import NumpyBoxLMO, MoolaBoxLMO
22
from .frank_wolfe import FrankWolfe
3-
from .frank_wolfe_memory import FrankWolfeMemory

fw4pde/algorithms/frank_wolfe.py

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def solve(self):
160160

161161
# Update stats
162162
self.data.update({"control_final": u})
163+
self.data.update({"gradient_final": gradient})
163164
objective_final = obj_u + nonsmooth_obj(u.data)
164165
self.data.update({"objective_final": objective_final})
165166

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

171172
self.data.update({"control_best": u})
173+
self.data.update({"gradient_best": gradient})
172174
self.data.update({"objective_best": objective_final})
173175
objective_best = objective_final
174176

fw4pde/algorithms/frank_wolfe_memory.py

-333
This file was deleted.

0 commit comments

Comments
 (0)