Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
8387ab10
Commit
8387ab10
authored
Dec 04, 2019
by
Philipp Arras
Browse files
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/library/correlated_fields.py
View file @
8387ab10
...
...
@@ -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
=
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment