Skip to content

Commit

Permalink
unified usage of of std vs variance
Browse files Browse the repository at this point in the history
  • Loading branch information
M-R-Schaefer committed Jun 20, 2024
1 parent 212c981 commit 4ce7ac6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ipsuite/analysis/model/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from ipsuite import base, models, utils
from ipsuite.analysis.model.math import decompose_stress_tensor, force_decomposition
from ipsuite.analysis.model.plots import get_cdf_figure, get_figure, get_hist, get_calibration_figure, get_gaussianicity_figure
from ipsuite.analysis.model.plots import get_cdf_figure, get_figure, get_hist, get_calibration_figure, get_gaussianicity_figure, slice_ensemble_uncertainty
from ipsuite.geometry import BarycenterMapping
from ipsuite.utils.ase_sim import freeze_copy_atoms

Expand Down Expand Up @@ -248,7 +248,7 @@ def get_data(self):
self.content["energy_err"] = np.abs(energy_true - energy_pred)

energy_uncertainty = [
np.sqrt(a.calc.results["energy_uncertainty"]) / len(a) for a in self.y
a.calc.results["energy_uncertainty"] / len(a) for a in self.y
]
energy_uncertainty = np.array(energy_uncertainty) * 1000
self.content["energy_unc"] = energy_uncertainty
Expand All @@ -264,7 +264,7 @@ def get_data(self):

self.content["forces_true"] = true_forces
self.content["forces_err"] = np.abs(true_forces - pred_forces)
self.content["forces_unc"] = np.sqrt(forces_uncertainty) * 1000
self.content["forces_unc"] = forces_uncertainty * 1000
self.content["forces_ensemble"] = np.array(forces_ensemble) * 1000

def get_metrics(self):
Expand Down Expand Up @@ -317,11 +317,9 @@ def get_plots(self, save=False):

gaussianicy_figures = []
for (start, end) in self.force_dist_slices:
error_true, error_pred = slice_ensemble_uncertainty(self.content["forces_true"], self.content["forces_ensemble"], start, end)
fig = get_gaussianicity_figure(
self.content["forces_true"],
self.content["forces_ensemble"],
start,
end,
error_true, error_pred
)
gaussianicy_figures.append(fig)
if save:
Expand Down

0 comments on commit 4ce7ac6

Please sign in to comment.