Commit 8387ab10 authored by Philipp Arras's avatar Philipp Arras

Merge branch 'nifty6_cfm_offset' into 'NIFTy_6'

correlated_field.py: Implement offset in finalize

See merge request !386
parents f61cb6b2 7334440b
Pipeline #64965 passed with stages
in 9 minutes and 54 seconds
......@@ -32,6 +32,8 @@ from ..operators.operator import Operator
from ..operators.simple_linear_operators import VdotOperator, ducktape
from ..probing import StatCalculator
from ..sugar import from_global_data, full, makeDomain
from ..field import Field
from ..multi_field import MultiField
def _reshaper(x, N):
......@@ -467,11 +469,16 @@ class CorrelatedFieldMaker:
"""
offset vs zeromode: volume factor
"""
op = self._finalize_from_op()
if offset is not None:
raise NotImplementedError
offset = float(offset)
# Deviations from this offset must not be considered here as they
# are learned by the zeromode
if isinstance(offset, (Field, MultiField)):
op = Adder(offset) @ op
else:
offset = float(offset)
op = Adder(full(op.target, offset)) @ op
op = self._finalize_from_op()
if prior_info > 0:
from ..sugar import from_random
samps = [
......
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