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
49218708
Commit
49218708
authored
Nov 14, 2019
by
Philipp Arras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actually return amplitude in one-space case
parent
beebf0dc
Pipeline
#63676
passed with stages
in 9 minutes and 15 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
7 deletions
+17
-7
demos/find_amplitude_parameters.py
demos/find_amplitude_parameters.py
+1
-1
demos/getting_started_3.py
demos/getting_started_3.py
+1
-1
demos/getting_started_mf.py
demos/getting_started_mf.py
+2
-2
demos/newamplitudes.py
demos/newamplitudes.py
+1
-1
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+12
-2
No files found.
demos/find_amplitude_parameters.py
View file @
49218708
...
@@ -38,7 +38,7 @@ if __name__ == '__main__':
...
@@ -38,7 +38,7 @@ if __name__ == '__main__':
fa
.
add_fluctuations
(
ift
.
RGSpace
(
32
),
3
,
5
,
1
,
1e-6
,
2
,
fa
.
add_fluctuations
(
ift
.
RGSpace
(
32
),
3
,
5
,
1
,
1e-6
,
2
,
1e-6
,
slope_means
[
1
],
1
,
'freq'
)
1e-6
,
slope_means
[
1
],
1
,
'freq'
)
correlated_field
=
fa
.
finalize
()
correlated_field
=
fa
.
finalize
()
amplitudes
=
fa
.
amplitudes
amplitudes
=
fa
.
normalized_
amplitudes
plt
.
style
.
use
(
'seaborn-notebook'
)
plt
.
style
.
use
(
'seaborn-notebook'
)
tgt
=
correlated_field
.
target
tgt
=
correlated_field
.
target
...
...
demos/getting_started_3.py
View file @
49218708
...
@@ -61,7 +61,7 @@ if __name__ == '__main__':
...
@@ -61,7 +61,7 @@ if __name__ == '__main__':
cfmaker
.
add_fluctuations
(
position_space
,
cfmaker
.
add_fluctuations
(
position_space
,
1.
,
1e-2
,
1
,
.
5
,
.
1
,
.
5
,
-
3
,
0.5
,
''
)
1.
,
1e-2
,
1
,
.
5
,
.
1
,
.
5
,
-
3
,
0.5
,
''
)
correlated_field
=
cfmaker
.
finalize
()
correlated_field
=
cfmaker
.
finalize
()
A
=
cfmaker
.
amplitude
s
[
0
]
A
=
cfmaker
.
amplitude
# Apply a nonlinearity
# Apply a nonlinearity
signal
=
ift
.
sigmoid
(
correlated_field
)
signal
=
ift
.
sigmoid
(
correlated_field
)
...
...
demos/getting_started_mf.py
View file @
49218708
...
@@ -78,8 +78,8 @@ if __name__ == '__main__':
...
@@ -78,8 +78,8 @@ if __name__ == '__main__':
-
1.5
,
.
5
,
'amp2'
)
-
1.5
,
.
5
,
'amp2'
)
correlated_field
=
cfmaker
.
finalize
()
correlated_field
=
cfmaker
.
finalize
()
A1
=
cfmaker
.
amplitudes
[
0
]
A1
=
cfmaker
.
normalized_
amplitudes
[
0
]
A2
=
cfmaker
.
amplitudes
[
1
]
A2
=
cfmaker
.
normalized_
amplitudes
[
1
]
DC
=
SingleDomain
(
correlated_field
.
target
,
position_space
)
DC
=
SingleDomain
(
correlated_field
.
target
,
position_space
)
# Apply a nonlinearity
# Apply a nonlinearity
...
...
demos/newamplitudes.py
View file @
49218708
...
@@ -7,7 +7,7 @@ sspace = ift.RGSpace((128,))
...
@@ -7,7 +7,7 @@ sspace = ift.RGSpace((128,))
fa
=
ift
.
CorrelatedFieldMaker
.
make
(
10
,
0.1
,
''
)
fa
=
ift
.
CorrelatedFieldMaker
.
make
(
10
,
0.1
,
''
)
fa
.
add_fluctuations
(
sspace
,
10
,
2
,
1
,
1e-6
,
2
,
1e-6
,
-
2
,
1e-6
,
'spatial'
)
fa
.
add_fluctuations
(
sspace
,
10
,
2
,
1
,
1e-6
,
2
,
1e-6
,
-
2
,
1e-6
,
'spatial'
)
op
=
fa
.
finalize
()
op
=
fa
.
finalize
()
A
=
fa
.
amplitude
s
[
0
]
A
=
fa
.
amplitude
cstpos
=
ift
.
from_random
(
'normal'
,
op
.
domain
)
cstpos
=
ift
.
from_random
(
'normal'
,
op
.
domain
)
p1
,
p2
=
[
ift
.
Plot
()
for
_
in
range
(
2
)]
p1
,
p2
=
[
ift
.
Plot
()
for
_
in
range
(
2
)]
...
...
nifty5/library/correlated_fields.py
View file @
49218708
...
@@ -372,7 +372,7 @@ class CorrelatedFieldMaker:
...
@@ -372,7 +372,7 @@ class CorrelatedFieldMaker:
lst
=
[(
'Offset amplitude'
,
self
.
amplitude_total_offset
),
lst
=
[(
'Offset amplitude'
,
self
.
amplitude_total_offset
),
(
'Total fluctuation amplitude'
,
self
.
total_fluctuation
)]
(
'Total fluctuation amplitude'
,
self
.
total_fluctuation
)]
namps
=
len
(
self
.
amplitudes
)
namps
=
len
(
self
.
_a
)
if
namps
>
1
:
if
namps
>
1
:
for
ii
in
range
(
namps
):
for
ii
in
range
(
namps
):
lst
.
append
((
'Slice fluctuation (space {})'
.
format
(
ii
),
lst
.
append
((
'Slice fluctuation (space {})'
.
format
(
ii
),
...
@@ -399,9 +399,19 @@ class CorrelatedFieldMaker:
...
@@ -399,9 +399,19 @@ class CorrelatedFieldMaker:
return
fluctuations_slice_mean
/
np
.
mean
(
np
.
sqrt
(
scm
))
return
fluctuations_slice_mean
/
np
.
mean
(
np
.
sqrt
(
scm
))
@
property
@
property
def
amplitudes
(
self
):
def
normalized_
amplitudes
(
self
):
return
self
.
_a
return
self
.
_a
@
property
def
amplitude
(
self
):
if
len
(
self
.
_a
)
>
1
:
s
=
(
'If more than one spectrum is present in the model,'
,
' no unique set of amplitudes exist because only the'
,
' relative scale is determined.'
)
raise
NotImplementedError
(
s
)
expand
=
VdotOperator
(
full
(
self
.
_a
[
0
].
target
,
1
)).
adjoint
return
self
.
_a
[
0
]
*
(
expand
@
self
.
amplitude_total_offset
)
@
property
@
property
def
amplitude_total_offset
(
self
):
def
amplitude_total_offset
(
self
):
return
self
.
_azm
return
self
.
_azm
...
...
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