Skip to content

Commit

Permalink
something is wrong with the error
Browse files Browse the repository at this point in the history
  • Loading branch information
smribet committed Jan 15, 2025
1 parent 0fb9234 commit fb7b6c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions py4DSTEM/tomography/tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit fb7b6c5

Please sign in to comment.