Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Normalization does not clip distances at 0 #92

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/mrvi/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,7 @@ def per_sample_inference_fn(pair):
normalization_means = normalization_means.reshape(-1, 1, 1, 1)
normalization_vars = normalization_vars.reshape(-1, 1, 1, 1)
normalized_dists = (
np.clip(sampled_dists - normalization_means, a_min=0, a_max=None)
/ (normalization_vars**0.5)
(sampled_dists - normalization_means) / (normalization_vars**0.5)
).mean(dim="mc_sample") # (n_cells, n_samples, n_samples)

# Compute each reduction
Expand Down
Loading