Skip to content

Commit

Permalink
adds contour figure, shell updates, clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyPlanden committed Nov 26, 2024
1 parent 183bda1 commit 1b7c54c
Show file tree
Hide file tree
Showing 30 changed files with 33 additions and 19 deletions.
Binary file added joss/figures/contour_evolution_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_evolution_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_evolution_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_evolution_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_gradient_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_gradient_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_gradient_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_gradient_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_heuristic_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_heuristic_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/contour_heuristic_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/convergence_maximising.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/convergence_minimising.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/evolution_parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/gradient_parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/heuristic_parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/contour_total.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/converge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/countour_evolution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/countour_gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/countour_heuristic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/optimisers_parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added joss/figures/joss/sim-landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified joss/figures/simulation.png
16 changes: 12 additions & 4 deletions joss/image_combine.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
magick convert +append figures/design_gravimetric.png figures/design_prediction.png figures/joss/design.png
convert +append figures/design_gravimetric.png figures/design_prediction.png figures/joss/design.png

magick convert +append figures/gradient_parameters.png figures/evolution_parameters.png figures/heuristic_parameters.png figures/joss/optimisers_parameters.png
convert +append figures/gradient_parameters.png figures/evolution_parameters.png figures/heuristic_parameters.png figures/joss/optimisers_parameters.png

magick convert +append figures/convergence_minimising.png figures/convergence_maximising.png figures/joss/converge.png
convert +append figures/convergence_minimising.png figures/convergence_maximising.png figures/joss/converge.png

magick convert +append figures/simulation.png figures/landscape.png figures/joss/sim-landscape.png
convert +append figures/simulation.png figures/landscape.png figures/joss/sim-landscape.png

convert +append figures/contour_gradient_0.png figures/contour_gradient_1.png figures/contour_gradient_2.png figures/contour_gradient_3.png figures/joss/countour_gradient.png

convert +append figures/contour_evolution_0.png figures/contour_evolution_1.png figures/contour_evolution_2.png figures/contour_evolution_3.png figures/joss/countour_evolution.png

convert +append figures/contour_heuristic_0.png figures/contour_heuristic_1.png figures/contour_heuristic_2.png figures/joss/countour_heuristic.png

convert -append figures/joss/countour_gradient.png figures/joss/countour_evolution.png figures/joss/countour_heuristic.png figures/joss/countour_total.png
2 changes: 2 additions & 0 deletions joss/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ Furthermore, we can also compare the performance of the various optimisation alg

![Convergence in the parameter values obtained for various (meta)heuristics. \label{fig:optimiser-inference}](figures/joss/optimisers_parameters.png){ width=100% }

![Counter plot for all optimisers. \label{fig:optimiser-inference}](figures/joss/contour_total.png){ width=100% }

This parameterisation task can also be approached from the Bayesian perspective, which we will present below using PyBOP's sampler methods. The optimisation equation presented in equation \autoref{eqn:parameterisation} does not represent the Bayesian parameter identification task, and as such we introduce Bayes Theorem as,

\begin{equation}
Expand Down
Binary file modified joss/paper.pdf
Binary file not shown.
34 changes: 19 additions & 15 deletions joss/param_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
# Run optimisation
results = optim.run()
print("True parameter values:", parameters.true_value())
print("Estimated parameters:", results.x)

# Plot convergence
cost_log = optim.log["cost_best"]
Expand Down Expand Up @@ -220,13 +219,7 @@
## Do the same for the maximising cost functions
convergence_traces = []
first_MAP = True
# sigma0 = pybop.Parameter(
# "Sigma",
# initial_value=0.012,
# prior=pybop.Gaussian(0.012, 0.005),
# bounds=[0, 0.05],
# )
# sigma0 = 0.02

for cost in maximising_cost_classes:
if cost is pybop.GaussianLogLikelihoodKnownSigma:
cost = cost(problem, sigma0=sigma)
Expand All @@ -246,14 +239,13 @@
optim = pybop.CMAES(
cost,
verbose=True,
max_iterations=500,
max_iterations=125,
max_unchanged_iterations=25,
)

# Run optimisation
results = optim.run()
print("True parameter values:", parameters.true_value())
print("Estimated parameters:", results.x)

# Plot convergence
cost_log = optim.log["cost_best"]
Expand Down Expand Up @@ -342,7 +334,6 @@
# Run optimisation
results = optim.run()
print("True parameter values:", parameters.true_value())
print("Estimated parameters:", results.x)

# Plot the parameter traces
parameter_fig = pybop.plot.parameters(optim, show=False, title=None)
Expand All @@ -355,6 +346,12 @@
parameter_fig.data[j].showlegend = False
parameter_traces.extend(parameter_fig.data)

# Plot the cost landscape with optimisation path
contour = pybop.plot.contour(
optim, steps=25, title="", margin=dict(l=30, r=30, t=30, b=30)
)
contour.write_image(f"joss/figures/contour_gradient_{i}.png")

# Plot the parameter traces together
parameter_fig.update_layout(width=576, height=1024, plot_bgcolor="white")
parameter_fig.data = []
Expand Down Expand Up @@ -396,7 +393,6 @@
# Run optimisation
results = optim.run()
print("True parameter values:", parameters.true_value())
print("Estimated parameters:", results.x)

# Plot the parameter traces
parameter_fig = pybop.plot.parameters(optim, show=False, title=None)
Expand All @@ -409,6 +405,12 @@
parameter_fig.data[j].showlegend = False
parameter_traces.extend(parameter_fig.data)

# Plot the cost landscape with optimisation path
contour = pybop.plot.contour(
optim, steps=25, title="", margin=dict(l=30, r=30, t=30, b=30)
)
contour.write_image(f"joss/figures/contour_evolution_{i}.png")

# Plot the parameter traces together
parameter_fig.update_layout(width=576, height=1024, plot_bgcolor="white")
parameter_fig.data = []
Expand Down Expand Up @@ -440,7 +442,6 @@
# Run optimisation
results = optim.run()
print("True parameter values:", parameters.true_value())
print("Estimated parameters:", results.x)

# Plot the parameter traces
parameter_fig = pybop.plot.parameters(optim, show=False, title=None)
Expand All @@ -453,8 +454,11 @@
parameter_fig.data[j].showlegend = False
parameter_traces.extend(parameter_fig.data)

# # Plot the cost landscape with optimisation path
# pybop.plot.contour(optim, steps=15)
# Plot the cost landscape with optimisation path
contour = pybop.plot.contour(
optim, steps=25, title="", margin=dict(l=30, r=30, t=30, b=30)
)
contour.write_image(f"joss/figures/contour_heuristic_{i}.png")

# Plot the parameter traces together
parameter_fig.update_layout(width=576, height=1024, plot_bgcolor="white")
Expand Down

0 comments on commit 1b7c54c

Please sign in to comment.