Commit 267ab565 authored by Reimar H Leike's avatar Reimar H Leike

now checking all models in the library directory

parent 55439304
......@@ -111,6 +111,52 @@ class Model_Tests(unittest.TestCase):
ift.extra.check_value_gradient_consistency(
ift.PointwisePositiveTanh(model))
@expand(product(
[ift.GLSpace(15),
ift.RGSpace(64, distances=.789),
ift.RGSpace([32, 32], distances=.789)],
[4],
[0.5],
[2.],
[3.],
[1.5],
[1.75],
[1.3],
[4, 78, 23],
))
def testModelLibrary(self, space, Npixdof, ceps_a,
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]
S = ift.ScalingOperator(1., model.position.domain)
model = model.at(S.draw_sample())
ift.extra.check_value_gradient_consistency(model)
model2 = ift.make_correlated_field(space, model)[0]
S = ift.ScalingOperator(1., model2.position.domain)
model2 = model2.at(S.draw_sample())
ift.extra.check_value_gradient_consistency(model2)
@expand(product(
[ift.GLSpace(15),
ift.RGSpace(64, distances=.789),
ift.RGSpace([32, 32], distances=.789)],
[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
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