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
1daa9c51
Commit
1daa9c51
authored
Aug 09, 2018
by
Martin Reinecke
Browse files
streamlining
parent
af29238f
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/library/amplitude_model.py
View file @
1daa9c51
...
...
@@ -129,8 +129,7 @@ class AmplitudeModel(Operator):
kern
=
lambda
k
:
_ceps_kernel
(
dof_space
,
k
,
ceps_a
,
ceps_k
)
cepstrum
=
create_cepstrum_amplitude_field
(
dof_space
,
kern
)
ceps
=
makeOp
(
sqrt
(
cepstrum
))
self
.
_smooth_op
=
sym
(
qht
(
ceps
))
self
.
_smooth_op
=
sym
(
qht
(
makeOp
(
sqrt
(
cepstrum
))))
self
.
_keys
=
tuple
(
keys
)
def
apply
(
self
,
x
):
...
...
nifty5/library/correlated_fields.py
View file @
1daa9c51
...
...
@@ -39,22 +39,16 @@ class CorrelatedField(Operator):
amplitude_model : model for correlation structure
'''
def
__init__
(
self
,
s_space
,
amplitude_model
):
self
.
_s_space
=
s_space
self
.
_amplitude_model
=
amplitude_model
self
.
_h_space
=
s_space
.
get_default_codomain
()
self
.
_ht
=
HarmonicTransformOperator
(
self
.
_h_space
,
s_space
)
self
.
_p_space
=
amplitude_model
.
target
[
0
]
self
.
_power_distributor
=
PowerDistributor
(
self
.
_h_space
,
self
.
_p_space
)
h_space
=
s_space
.
get_default_codomain
()
self
.
_ht
=
HarmonicTransformOperator
(
h_space
,
s_space
)
p_space
=
amplitude_model
.
target
[
0
]
power_distributor
=
PowerDistributor
(
h_space
,
p_space
)
self
.
_A
=
power_distributor
(
amplitude_model
)
self
.
_domain
=
MultiDomain
.
union
(
(
self
.
_amplitude_model
.
domain
,
MultiDomain
.
make
({
"xi"
:
self
.
_h_space
})))
(
amplitude_model
.
domain
,
MultiDomain
.
make
({
"xi"
:
h_space
})))
def
apply
(
self
,
x
):
A
=
self
.
_power_distributor
(
self
.
_amplitude_model
(
x
))
correlated_field_h
=
A
*
x
[
"xi"
]
correlated_field
=
self
.
_ht
(
correlated_field_h
)
return
correlated_field
return
self
.
_ht
(
self
.
_A
(
x
)
*
x
[
"xi"
])
# def make_mf_correlated_field(s_space_spatial, s_space_energy,
...
...
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