Skip to content

Commit 533bfba

Browse files
committed
Use norm of upper bound instead of max
1 parent 825b0b7 commit 533bfba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

simpeg/directives/_vector_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ def endIter(self):
140140
indices.append(mapping.indices)
141141

142142
amplitude = np.linalg.norm(np.vstack(vec_model), axis=0)
143-
upper_bound = np.hstack(upper_bound)
144-
upper_bound = np.max(upper_bound[~np.isinf(upper_bound)])
143+
upper_bound = np.linalg.norm(np.vstack(upper_bound), axis=0)
145144
out_bound = amplitude > upper_bound
146145

147146
if np.any(out_bound):
148147
scale = upper_bound / amplitude
148+
149149
for ind in indices:
150150
vec = model[ind]
151151
vec[out_bound] *= scale[out_bound]

0 commit comments

Comments
 (0)