Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neel Shah
NIFTy
Commits
f5cdf137
Commit
f5cdf137
authored
Nov 06, 2019
by
Philipp Frank
Browse files
slope now works as intended but jacobian fails with linearizations
parent
87834184
Changes
2
Hide whitespace changes
Inline
Side-by-side
demos/newamplitudes.py
View file @
f5cdf137
...
@@ -6,7 +6,7 @@ sspace = ift.RGSpace((128,))
...
@@ -6,7 +6,7 @@ sspace = ift.RGSpace((128,))
hspace
=
sspace
.
get_default_codomain
()
hspace
=
sspace
.
get_default_codomain
()
target0
=
ift
.
PowerSpace
(
hspace
)
target0
=
ift
.
PowerSpace
(
hspace
)
fa
=
ift
.
FinalAmplitude
()
fa
=
ift
.
CorrelatedFieldMaker
()
fa
.
add_fluctuations
(
target0
,
10
,
2
,
1
,
1e-6
,
2
,
1e-6
,
-
2
,
1e-6
,
'spatial'
)
fa
.
add_fluctuations
(
target0
,
10
,
2
,
1
,
1e-6
,
2
,
1e-6
,
-
2
,
1e-6
,
'spatial'
)
op
=
fa
.
finalize
(
10
,
0.1
,
''
)
op
=
fa
.
finalize
(
10
,
0.1
,
''
)
A
=
fa
.
amplitudes
[
0
]
A
=
fa
.
amplitudes
[
0
]
...
...
nifty5/library/correlated_fields.py
View file @
f5cdf137
...
@@ -61,10 +61,10 @@ class _SlopeOperator(Operator):
...
@@ -61,10 +61,10 @@ class _SlopeOperator(Operator):
loglogavgslope
.
domain
)
loglogavgslope
.
domain
)
logkl
=
_log_k_lengths
(
self
.
_target
[
0
])
logkl
=
_log_k_lengths
(
self
.
_target
[
0
])
assert
logkl
.
shape
[
0
]
==
self
.
_target
[
0
].
shape
[
0
]
-
1
assert
logkl
.
shape
[
0
]
==
self
.
_target
[
0
].
shape
[
0
]
-
1
logkl
-=
logkl
[
0
]
logkl
=
np
.
insert
(
logkl
,
0
,
0
)
logkl
=
np
.
insert
(
logkl
,
0
,
0
)
self
.
_t
=
VdotOperator
(
from_global_data
(
self
.
_target
,
logkl
)).
adjoint
self
.
_t
=
VdotOperator
(
from_global_data
(
self
.
_target
,
logkl
)).
adjoint
self
.
_T
=
float
(
logkl
[
-
1
])
self
.
_T
=
float
(
logkl
[
-
1
]
-
logkl
[
1
]
)
ind
=
(
smooth
.
target
.
shape
[
0
]
-
1
,)
ind
=
(
smooth
.
target
.
shape
[
0
]
-
1
,)
self
.
_extr_op
=
ValueInserter
(
smooth
.
target
,
ind
).
adjoint
self
.
_extr_op
=
ValueInserter
(
smooth
.
target
,
ind
).
adjoint
...
@@ -73,7 +73,7 @@ class _SlopeOperator(Operator):
...
@@ -73,7 +73,7 @@ class _SlopeOperator(Operator):
smooth
=
self
.
_smooth
(
x
)
smooth
=
self
.
_smooth
(
x
)
res0
=
self
.
_llas
(
x
)
res0
=
self
.
_llas
(
x
)
res1
=
self
.
_extr_op
(
smooth
)
/
self
.
_T
res1
=
self
.
_extr_op
(
smooth
)
/
self
.
_T
return
self
.
_t
(
res0
-
res1
)
+
smooth
return
self
.
_t
(
res0
-
res1
)
+
smooth
def
_log_k_lengths
(
pspace
):
def
_log_k_lengths
(
pspace
):
...
@@ -245,7 +245,7 @@ class CorrelatedFieldMaker:
...
@@ -245,7 +245,7 @@ class CorrelatedFieldMaker:
prefix
+
'flexibility'
)
prefix
+
'flexibility'
)
asp
=
_lognormal_moment_matching
(
asperity_mean
,
asperity_stddev
,
asp
=
_lognormal_moment_matching
(
asperity_mean
,
asperity_stddev
,
prefix
+
'asperity'
)
prefix
+
'asperity'
)
avgsl
=
_normal
(
loglogavgslope_mean
,
loglogavgslope_
mean
,
avgsl
=
_normal
(
loglogavgslope_mean
,
loglogavgslope_
stddev
,
prefix
+
'loglogavgslope'
)
prefix
+
'loglogavgslope'
)
self
.
add_fluctuations_from_ops
(
target
,
fluct
,
flex
,
asp
,
avgsl
,
self
.
add_fluctuations_from_ops
(
target
,
fluct
,
flex
,
asp
,
avgsl
,
prefix
+
'spectrum'
)
prefix
+
'spectrum'
)
...
...
Write
Preview
Supports
Markdown
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