Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
c1a84f56
Commit
c1a84f56
authored
6 years ago
by
Philipp Frank
Browse files
Options
Downloads
Patches
Plain Diff
resolution independent amplitude model priors
parent
6ddae70b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
demos/getting_started_3.py
+5
-3
5 additions, 3 deletions
demos/getting_started_3.py
nifty5/library/amplitude_model.py
+1
-1
1 addition, 1 deletion
nifty5/library/amplitude_model.py
nifty5/library/correlated_fields.py
+1
-2
1 addition, 2 deletions
nifty5/library/correlated_fields.py
with
7 additions
and
6 deletions
demos/getting_started_3.py
+
5
−
3
View file @
c1a84f56
...
@@ -32,7 +32,7 @@ if __name__ == '__main__':
...
@@ -32,7 +32,7 @@ if __name__ == '__main__':
position_space
=
ift
.
RGSpace
([
128
,
128
])
position_space
=
ift
.
RGSpace
([
128
,
128
])
# Setting up an amplitude model
# 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
)
dummy
=
ift
.
from_random
(
'
normal
'
,
A
.
domain
)
# Building the model for a correlated signal
# Building the model for a correlated signal
...
@@ -46,9 +46,11 @@ if __name__ == '__main__':
...
@@ -46,9 +46,11 @@ if __name__ == '__main__':
'
xi
'
:
harmonic_space
'
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:
# 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
# apply some nonlinearity
signal
=
ift
.
positive_tanh
(
correlated_field
)
signal
=
ift
.
positive_tanh
(
correlated_field
)
...
...
This diff is collapsed.
Click to expand it.
nifty5/library/amplitude_model.py
+
1
−
1
View file @
c1a84f56
...
@@ -29,7 +29,7 @@ from ..sugar import makeOp, sqrt
...
@@ -29,7 +29,7 @@ from ..sugar import makeOp, sqrt
def
_ceps_kernel
(
dof_space
,
k
,
a
,
k0
):
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
):
def
create_cepstrum_amplitude_field
(
domain
,
cepstrum
):
...
...
This diff is collapsed.
Click to expand it.
nifty5/library/correlated_fields.py
+
1
−
2
View file @
c1a84f56
...
@@ -44,9 +44,8 @@ def CorrelatedField(s_space, amplitude_model):
...
@@ -44,9 +44,8 @@ def CorrelatedField(s_space, amplitude_model):
power_distributor
=
PowerDistributor
(
h_space
,
p_space
)
power_distributor
=
PowerDistributor
(
h_space
,
p_space
)
A
=
power_distributor
(
amplitude_model
)
A
=
power_distributor
(
amplitude_model
)
vol
=
h_space
.
scalar_dvol
vol
=
h_space
.
scalar_dvol
#vol = 1.
vol
=
ScalingOperator
(
vol
**
(
-
0.5
),
h_space
)
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
,
def
MfCorrelatedField
(
s_space_spatial
,
s_space_energy
,
amplitude_model_spatial
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment