Skip to content
GitLab
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
c1a84f56
Commit
c1a84f56
authored
Sep 24, 2018
by
Philipp Frank
Browse files
resolution independent amplitude model priors
parent
6ddae70b
Changes
3
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_3.py
View file @
c1a84f56
...
...
@@ -32,7 +32,7 @@ if __name__ == '__main__':
position_space
=
ift
.
RGSpace
([
128
,
128
])
# Setting up an amplitude model
A
=
ift
.
AmplitudeModel
(
position_space
,
1
6
,
1
,
1
0
,
-
4.
,
1
,
0
.
,
1.
)
A
=
ift
.
AmplitudeModel
(
position_space
,
6
4
,
3
,
0
.4
,
-
4.
,
1
,
1
.
,
1.
)
dummy
=
ift
.
from_random
(
'normal'
,
A
.
domain
)
# Building the model for a correlated signal
...
...
@@ -46,9 +46,11 @@ if __name__ == '__main__':
'xi'
:
harmonic_space
})))
correlated_field
=
ht
(
power_distributor
(
A
)
*
ift
.
FieldAdapter
(
domain
,
"xi"
))
vol
=
harmonic_space
.
scalar_dvol
vol
=
ift
.
ScalingOperator
(
vol
**
(
-
0.5
),
harmonic_space
)
correlated_field
=
ht
(
vol
(
power_distributor
(
A
))
*
ift
.
FieldAdapter
(
domain
,
"xi"
))
# alternatively to the block above one can do:
#
correlated_field = ift.CorrelatedField(position_space, A)
#correlated_field = ift.CorrelatedField(position_space, A)
# apply some nonlinearity
signal
=
ift
.
positive_tanh
(
correlated_field
)
...
...
nifty5/library/amplitude_model.py
View file @
c1a84f56
...
...
@@ -29,7 +29,7 @@ from ..sugar import makeOp, sqrt
def
_ceps_kernel
(
dof_space
,
k
,
a
,
k0
):
return
a
**
2
/
(
1
+
(
k
/
(
k0
*
dof_space
.
bindistances
[
0
])
)
**
2
)
**
2
return
a
**
2
/
(
1
+
(
k
/
k0
)
**
2
)
**
2
def
create_cepstrum_amplitude_field
(
domain
,
cepstrum
):
...
...
nifty5/library/correlated_fields.py
View file @
c1a84f56
...
...
@@ -44,9 +44,8 @@ def CorrelatedField(s_space, amplitude_model):
power_distributor
=
PowerDistributor
(
h_space
,
p_space
)
A
=
power_distributor
(
amplitude_model
)
vol
=
h_space
.
scalar_dvol
#vol = 1.
vol
=
ScalingOperator
(
vol
**
(
-
0.5
),
h_space
)
return
ht
(
vol
(
A
*
FieldAdapter
(
MultiDomain
.
make
({
"xi"
:
h_space
}),
"xi"
))
)
return
ht
(
vol
(
A
)
*
FieldAdapter
(
MultiDomain
.
make
({
"xi"
:
h_space
}),
"xi"
))
def
MfCorrelatedField
(
s_space_spatial
,
s_space_energy
,
amplitude_model_spatial
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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