MCPcopy
hub / github.com/hyperopt/hyperopt / test_lnorm

Function test_lnorm

hyperopt/pyll/tests/test_stochastic.py:18–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def test_lnorm():
19 G = scope
20 choice = G.choice
21 uniform = G.uniform
22 quantized_uniform = G.quniform
23
24 inker_size = quantized_uniform(low=0, high=7.99, q=2) + 3
25 # -- test that it runs
26 lnorm = as_apply(
27 {
28 "kwargs": {
29 "inker_shape": (inker_size, inker_size),
30 "outker_shape": (inker_size, inker_size),
31 "remove_mean": choice([0, 1]),
32 "stretch": uniform(low=0, high=10),
33 "threshold": uniform(
34 low=old_div(0.1, np.sqrt(10.0)), high=10 * np.sqrt(10)
35 ),
36 }
37 }
38 )
39 print(lnorm)
40 print(("len", len(str(lnorm))))
41 # not sure what to assert
42 # ... this is too fragile
43 # assert len(str(lnorm)) == 980
44
45
46def test_sample_deterministic():

Callers

nothing calls this directly

Calls 3

as_applyFunction · 0.90
choiceFunction · 0.85
uniformFunction · 0.85

Tested by

no test coverage detected