Commit e3f9d9b4 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add multi field support for find_position

parent 9974ac4e
Pipeline #72640 passed with stages
in 19 minutes and 57 seconds
......@@ -496,7 +496,10 @@ def calculate_position(operator, output):
raise TypeError
if output.domain != operator.target:
raise TypeError
cov = 1e-3*output.val.max()**2
if isinstance(output, MultiField):
cov = 1e-3*max([vv.max() for vv in output.val.values()])**2
else:
cov = 1e-3*output.val.max()**2
invcov = ScalingOperator(output.domain, cov).inverse
d = output + invcov.draw_sample(from_inverse=True)
lh = GaussianEnergy(d, invcov) @ operator
......
Markdown is supported
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