Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
d79ada59
Commit
d79ada59
authored
Nov 22, 2019
by
Philipp Frank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dofdex for zeromode
parent
398b5bc0
Pipeline
#64200
failed with stages
in 5 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+16
-7
No files found.
nifty5/library/correlated_fields.py
View file @
d79ada59
...
...
@@ -324,11 +324,14 @@ class _Amplitude(Operator):
op
=
Distributor
@
op
sig_fluc
=
Distributor
@
sig_fluc
op
=
Adder
(
Distributor
(
vol0
))
@
(
sig_fluc
*
(
azm_expander
@
azm
.
one_over
())
*
op
)
self
.
_fluc
=
(
_Distributor
(
dofdex
,
fluctuations
.
target
,
distributed_tgt
[
0
])
@
fluctuations
)
else
:
op
=
(
Adder
(
vol0
))
@
(
sig_fluc
*
(
azm_expander
@
azm
.
one_over
())
*
op
)
self
.
_fluct
=
fluctuations
self
.
apply
=
op
.
apply
self
.
_fluc
=
fluctuations
self
.
_domain
,
self
.
_target
=
op
.
domain
,
op
.
target
self
.
_space
=
space
...
...
@@ -348,11 +351,19 @@ class CorrelatedFieldMaker:
self
.
_total_N
=
total_N
@
staticmethod
def
make
(
offset_amplitude_mean
,
offset_amplitude_stddev
,
prefix
,
total_N
=
0
):
def
make
(
offset_amplitude_mean
,
offset_amplitude_stddev
,
prefix
,
total_N
=
0
,
dofdex
=
None
):
if
dofdex
is
None
:
dofdex
=
np
.
full
(
total_N
,
0
)
else
:
assert
len
(
dofdex
)
==
total_N
N
=
max
(
dofdex
)
+
1
if
total_N
>
0
else
0
zm
=
_LognormalMomentMatching
(
offset_amplitude_mean
,
offset_amplitude_stddev
,
prefix
+
'zeromode'
,
total_N
)
N
)
zm
=
_Distributor
(
dofdex
,
zm
.
target
,
UnstructuredDomain
(
total_N
))
@
zm
return
CorrelatedFieldMaker
(
zm
,
prefix
,
total_N
)
def
add_fluctuations
(
self
,
...
...
@@ -409,9 +420,7 @@ class CorrelatedFieldMaker:
self
.
_position_spaces
.
append
(
position_space
)
self
.
_spaces
.
append
(
space
)
def
finalize_from_op
(
self
,
zeromode
,
prefix
=
''
):
assert
isinstance
(
zeromode
,
Operator
)
self
.
_azm
=
zeromode
def
_finalize_from_op
(
self
,
zeromode
,
prefix
=
''
):
n_amplitudes
=
len
(
self
.
_a
)
if
self
.
_total_N
>
0
:
hspace
=
makeDomain
([
UnstructuredDomain
(
self
.
_total_N
)]
+
...
...
@@ -459,7 +468,7 @@ class CorrelatedFieldMaker:
raise
NotImplementedError
offset
=
float
(
offset
)
op
=
self
.
finalize_from_op
(
self
.
_azm
,
self
.
_prefix
)
op
=
self
.
_
finalize_from_op
(
self
.
_azm
,
self
.
_prefix
)
if
prior_info
>
0
:
from
..sugar
import
from_random
samps
=
[
...
...
Write
Preview
Markdown
is supported
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