Skip to content

Commit

Permalink
rescale sampling coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
brisvag committed Sep 11, 2024
1 parent 46a22af commit 40d4584
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fidder/erase/sparse_local_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ def estimate_local_mean_3d(
grid = CubicBSplineGrid3d(resolution=resolution)
optimiser = torch.optim.Adam(grid.parameters(), lr=0.01)

foreground_sample_idx_rescaled = foreground_sample_idx / volume.shape
for i in range(500):
# what does the model predict for our observations?
prediction = grid(foreground_sample_idx).squeeze()
prediction = grid(foreground_sample_idx_rescaled).squeeze()

# zero gradients and calculate loss between observations and model prediction
optimiser.zero_grad()
Expand Down

0 comments on commit 40d4584

Please sign in to comment.