Commit 710a658a authored by inhuszar's avatar inhuszar
Browse files

Cost normalisation by non-zero mask area.

parent 78dc0c0b
......@@ -154,7 +154,7 @@ class CostMSD(Cost):
if combined_mask is not None:
costs = costs * combined_mask[nonzero]
if self.metaparameters.get("normalise"):
return np.sum(costs) / stensors.shape[-1]
return np.sum(costs) / np.count_nonzero(nonzero) # mod 13 Aug 2020
return np.sum(costs)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment