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
0dfcda3b
Commit
0dfcda3b
authored
Nov 06, 2019
by
Martin Reinecke
Browse files
cosmetics
parent
46c7f781
Pipeline
#63100
passed with stages
in 7 minutes and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/energy_operators.py
View file @
0dfcda3b
...
@@ -65,6 +65,7 @@ class Squared2NormOperator(EnergyOperator):
...
@@ -65,6 +65,7 @@ class Squared2NormOperator(EnergyOperator):
return
x
.
new
(
val
,
jac
)
return
x
.
new
(
val
,
jac
)
return
Field
.
scalar
(
x
.
vdot
(
x
))
return
Field
.
scalar
(
x
.
vdot
(
x
))
class
QuadraticFormOperator
(
EnergyOperator
):
class
QuadraticFormOperator
(
EnergyOperator
):
"""Computes the L2-norm of a Field or MultiField with respect to a
"""Computes the L2-norm of a Field or MultiField with respect to a
specific kernel given by `endo`.
specific kernel given by `endo`.
...
...
nifty5/operators/log1p.py
View file @
0dfcda3b
...
@@ -40,4 +40,3 @@ class Log1p(Operator):
...
@@ -40,4 +40,3 @@ class Log1p(Operator):
return
res
return
res
jac
=
DiagonalOperator
(
1
/
(
1
+
xval
))
jac
=
DiagonalOperator
(
1
/
(
1
+
xval
))
return
x
.
new
(
res
,
jac
@
x
.
jac
)
return
x
.
new
(
res
,
jac
@
x
.
jac
)
test/test_energy_gradients.py
View file @
0dfcda3b
...
@@ -46,10 +46,12 @@ def test_gaussian(field):
...
@@ -46,10 +46,12 @@ def test_gaussian(field):
energy
=
ift
.
GaussianEnergy
(
domain
=
field
.
domain
)
energy
=
ift
.
GaussianEnergy
(
domain
=
field
.
domain
)
ift
.
extra
.
check_jacobian_consistency
(
energy
,
field
)
ift
.
extra
.
check_jacobian_consistency
(
energy
,
field
)
def
test_studentt
(
field
):
def
test_studentt
(
field
):
energy
=
ift
.
StudentTEnergy
(
domain
=
field
.
domain
,
theta
=
.
5
)
energy
=
ift
.
StudentTEnergy
(
domain
=
field
.
domain
,
theta
=
.
5
)
ift
.
extra
.
check_jacobian_consistency
(
energy
,
field
,
tol
=
1e-6
)
ift
.
extra
.
check_jacobian_consistency
(
energy
,
field
,
tol
=
1e-6
)
def
test_inverse_gamma
(
field
):
def
test_inverse_gamma
(
field
):
field
=
field
.
exp
()
field
=
field
.
exp
()
space
=
field
.
domain
space
=
field
.
domain
...
...
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