diff --git a/nifty5/operators/energy_operators.py b/nifty5/operators/energy_operators.py index 1e8b761f447f45e3dfb6acb9eea5c19689c7c5d0..d6d3170ca5cc6494e7f4a2d80c27452c65bf497d 100644 --- a/nifty5/operators/energy_operators.py +++ b/nifty5/operators/energy_operators.py @@ -65,6 +65,7 @@ class Squared2NormOperator(EnergyOperator): return x.new(val, jac) return Field.scalar(x.vdot(x)) + class QuadraticFormOperator(EnergyOperator): """Computes the L2-norm of a Field or MultiField with respect to a specific kernel given by `endo`. diff --git a/nifty5/operators/log1p.py b/nifty5/operators/log1p.py index 016f1c71001a499fc81e7ed6ea08c169274ab0a6..2dca0c3144b6ab11a9b731acc51f75aa83ee4e12 100644 --- a/nifty5/operators/log1p.py +++ b/nifty5/operators/log1p.py @@ -40,4 +40,3 @@ class Log1p(Operator): return res jac = DiagonalOperator(1/(1+xval)) return x.new(res, jac@x.jac) - diff --git a/test/test_energy_gradients.py b/test/test_energy_gradients.py index 4b117c83ac517b7db8beb9bfbac5d9f6239efcbb..0e6a9371f0a40ea69be5816d64a02e6fc0ec5f49 100644 --- a/test/test_energy_gradients.py +++ b/test/test_energy_gradients.py @@ -46,10 +46,12 @@ def test_gaussian(field): energy = ift.GaussianEnergy(domain=field.domain) ift.extra.check_jacobian_consistency(energy, field) + def test_studentt(field): energy = ift.StudentTEnergy(domain=field.domain, theta=.5) ift.extra.check_jacobian_consistency(energy, field, tol=1e-6) + def test_inverse_gamma(field): field = field.exp() space = field.domain