From fb7b6c51dd8ac9ea0199d4f41b7286e3523e2395 Mon Sep 17 00:00:00 2001 From: smribet Date: Tue, 14 Jan 2025 16:21:55 -0800 Subject: [PATCH] something is wrong with the error --- py4DSTEM/tomography/tomography.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/py4DSTEM/tomography/tomography.py b/py4DSTEM/tomography/tomography.py index 963e85192..7111ef304 100644 --- a/py4DSTEM/tomography/tomography.py +++ b/py4DSTEM/tomography/tomography.py @@ -1481,10 +1481,10 @@ def _calculate_update( if dp_patterns.shape[0] == 0: update = xp.zeros(object_sliced.shape) - error = xp.mean(object_sliced.ravel() ** 2) + error = xp.mean(object_sliced.ravel() ** 2) ** 0.5 error = copy_to_device(error, "cpu") - + print("hello") else: weights = np.hstack( [ @@ -1537,7 +1537,9 @@ def _calculate_update( update = dp_patterns_counted - object_sliced - error = xp.mean(update.ravel() ** 2) + error = ( + xp.mean(update.ravel() ** 2) ** 0.5 / dp_patterns_counted.mean(0).sum() + ) error = copy_to_device(error, "cpu")