Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
eedcfc5d
Commit
eedcfc5d
authored
Aug 13, 2018
by
Martin Reinecke
Browse files
Merge remote-tracking branch 'origin/redesigning_resolve' into redesign
parents
3d54c5ea
c1ba0c60
Changes
3
Show whitespace changes
Inline
Side-by-side
nifty5/library/amplitude_model.py
View file @
eedcfc5d
...
...
@@ -24,7 +24,6 @@ from ..compat import *
from
..domains.power_space
import
PowerSpace
from
..domains.unstructured_domain
import
UnstructuredDomain
from
..field
import
Field
from
..multi_field
import
MultiField
from
..multi_domain
import
MultiDomain
from
..sugar
import
makeOp
,
sqrt
from
..operators.operator
import
Operator
...
...
@@ -149,3 +148,7 @@ class AmplitudeModel(Operator):
@
property
def
ceps
(
self
):
return
self
.
_ceps
@
property
def
norm_phi_mean
(
self
):
return
self
.
_norm_phi_mean
nifty5/library/inverse_gamma_model.py
View file @
eedcfc5d
...
...
@@ -56,11 +56,19 @@ class InverseGammaModel(Operator):
return
Linearization
(
points
,
jac
)
@
staticmethod
def
IG
(
self
,
field
,
alpha
,
q
):
def
IG
(
field
,
alpha
,
q
):
foo
=
invgamma
.
ppf
(
norm
.
cdf
(
field
.
local_data
),
alpha
,
scale
=
q
)
return
Field
.
from_local_data
(
field
.
domain
,
foo
)
@
staticmethod
def
inverseIG
(
self
,
u
,
alpha
,
q
):
def
inverseIG
(
u
,
alpha
,
q
):
res
=
norm
.
ppf
(
invgamma
.
cdf
(
u
.
local_data
,
alpha
,
scale
=
q
))
return
Field
.
from_local_data
(
u
.
domain
,
res
)
@
property
def
alpha
(
self
):
return
self
.
_alpha
@
property
def
q
(
self
):
return
self
.
_q
nifty5/linearization.py
View file @
eedcfc5d
...
...
@@ -6,7 +6,6 @@ from .compat import *
from
.field
import
Field
from
.multi_field
import
MultiField
from
.sugar
import
makeOp
from
.domain_tuple
import
DomainTuple
class
Linearization
(
object
):
...
...
@@ -110,7 +109,6 @@ class Linearization(object):
return
self
.
__mul__
(
other
)
def
vdot
(
self
,
other
):
from
.domain_tuple
import
DomainTuple
from
.operators.simple_linear_operators
import
VdotOperator
if
isinstance
(
other
,
(
Field
,
MultiField
)):
return
Linearization
(
...
...
@@ -123,7 +121,6 @@ class Linearization(object):
def
sum
(
self
):
from
.operators.simple_linear_operators
import
SumReductionOperator
from
.sugar
import
full
return
Linearization
(
Field
.
scalar
(
self
.
_val
.
sum
()),
SumReductionOperator
(
self
.
_jac
.
target
)(
self
.
_jac
))
...
...
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