We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 71a9ae3 + d518851 commit 50ace2aCopy full SHA for 50ace2a
sdcflows/interfaces/bspline.py
@@ -195,6 +195,7 @@ def _run_interface(self, runtime):
195
center = np.mean(data[mask])
196
197
data -= center
198
+ data[~mask] = 0
199
200
# Calculate collocation matrix from (possibly resized) image and knot grids
201
colmat = sparse_hstack(
@@ -214,7 +215,7 @@ def _run_interface(self, runtime):
214
215
alpha=self.inputs.ridge_alpha, fit_intercept=False, solver="lsqr"
216
)
217
for attempt in range(3):
- model.fit(colmat[mask.reshape(-1), :], data[mask])
218
+ model.fit(colmat, data.reshape(-1))
219
extreme = np.abs(model.coef_).max()
220
LOGGER.debug(f"Model fit attempt {attempt}: max(|coeffs|) = {extreme}")
221
# Normal values seem to be ~1e2, bad ~1e8. May want to tweak this if
0 commit comments