Commit 6b9e5599 authored by Martin Reinecke's avatar Martin Reinecke

cosmetics

parent 3124afc0
......@@ -83,7 +83,7 @@ class Energy_Tests(unittest.TestCase):
model = self.make_model(
type1, space_key='s1', space=space, seed=seed)['s1']
model = ift.PointwiseExponential(model)
d = np.random.poisson(120, size = space.shape)
d = np.random.poisson(120, size=space.shape)
d = ift.Field.from_global_data(space, d)
energy = ift.PoissonianEnergy(model, d)
ift.extra.check_value_gradient_consistency(energy)
......@@ -118,8 +118,7 @@ class Energy_Tests(unittest.TestCase):
model = self.make_model(
type1, space_key='s1', space=space, seed=seed)['s1']
model = ift.PointwisePositiveTanh(model)
d = np.random.binomial(1, 0.1, size = space.shape)
d = np.random.binomial(1, 0.1, size=space.shape)
d = ift.Field.from_global_data(space, d)
energy = ift.BernoulliEnergy(model, d)
ift.extra.check_value_gradient_consistency(energy)
......@@ -125,11 +125,11 @@ class Model_Tests(unittest.TestCase):
[4, 78, 23],
))
def testModelLibrary(self, space, Npixdof, ceps_a,
ceps_k, sm, sv, im, iv, seed):
#tests amplitude model and coorelated field model
ceps_k, sm, sv, im, iv, seed):
# tests amplitude model and coorelated field model
np.random.seed(seed)
model = ift.make_amplitude_model(space,
Npixdof, ceps_a, ceps_k, sm, sv, im, iv)[0]
model = ift.make_amplitude_model(space, Npixdof, ceps_a, ceps_k, sm,
sv, im, iv)[0]
S = ift.ScalingOperator(1., model.position.domain)
model = model.at(S.draw_sample())
ift.extra.check_value_gradient_consistency(model)
......@@ -143,20 +143,18 @@ class Model_Tests(unittest.TestCase):
[ift.GLSpace(15),
ift.RGSpace(64, distances=.789),
ift.RGSpace([32, 32], distances=.789)],
[4,78,23]))
[4, 78, 23]))
def testPointModel(seld, space, seed):
S = ift.ScalingOperator(1., space)
pos = ift.MultiField.from_dict(
{'points': S.draw_sample()})
alpha = 1.5
q = 0.73
model = ift.PointSources(pos, alpha, q)
#All those cdfs and ppfs are not that accurate
# All those cdfs and ppfs are not that accurate
ift.extra.check_value_gradient_consistency(model, tol=1e-5)
@expand(product(
['Variable', 'Constant'],
[ift.GLSpace(15),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment