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
Neel Shah
NIFTy
Commits
dbe068db
Commit
dbe068db
authored
Nov 19, 2019
by
Reimar H Leike
Browse files
more fixes
parent
574cc254
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/library/inverse_gamma_operator.py
View file @
dbe068db
...
...
@@ -50,4 +50,4 @@ def InverseGammaOperator(domain, alpha, q, delta=0.001):
distance between sampling points for linear interpolation.
"""
func
=
lambda
x
:
np
.
log
(
invgamma
.
ppf
(
norm
.
cdf
(
x
),
alpha
))
return
InterpolatingOperator
(
domain
,
func
,
(
-
8.2
,
8.2
),
delta
)
return
InterpolatingOperator
(
domain
,
func
,
(
-
8.2
,
8.2
),
delta
)
.
exp
()
nifty5/operators/interpolating_operator.py
View file @
dbe068db
...
...
@@ -67,14 +67,14 @@ class InterpolatingOperator(Operator):
# Operator
fi
=
np
.
floor
(
val
).
astype
(
int
)
w
=
val
-
fi
res
=
np
.
exp
(
(
1
-
w
)
*
self
.
_table
[
fi
]
+
w
*
self
.
_table
[
fi
+
1
]
)
res
=
(
1
-
w
)
*
self
.
_table
[
fi
]
+
w
*
self
.
_table
[
fi
+
1
]
points
=
Field
.
from_local_data
(
self
.
_domain
,
res
)
if
not
lin
:
return
points
# Derivative of linear interpolation
der
=
self
.
_deriv
[
fi
]
*
res
der
=
self
.
_deriv
[
fi
]
jac
=
makeOp
(
Field
.
from_local_data
(
self
.
_domain
,
der
))
jac
=
jac
(
x
.
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