diff --git a/sknn/ae.py b/sknn/ae.py index 1c16e57..3298cde 100644 --- a/sknn/ae.py +++ b/sknn/ae.py @@ -25,7 +25,7 @@ def __init__(self, units=None, cost='msre', tied_weights=False, - corruption_level=None): + corruption_level=0.5): assert warning is None, \ "Specify layer parameters as keyword arguments, not positional arguments." diff --git a/sknn/tests/test_ae.py b/sknn/tests/test_ae.py index 0c7f44b..dd5fd80 100644 --- a/sknn/tests/test_ae.py +++ b/sknn/tests/test_ae.py @@ -21,12 +21,16 @@ def test_FitData(self): class TestParameters(unittest.TestCase): def test_CostFunctions(self): + X = numpy.zeros((8,4)) for t in ['msre', 'mbce']: - AE(layers=[L("Sigmoid", units=8, cost=t)]) + ae = AE(layers=[L("Sigmoid", units=8, cost=t)], n_iter=1) + ae.fit(X) def test_LayerTypes(self): + X = numpy.zeros((8,4)) for l in ['autoencoder', 'denoising']: - AE(layers=[L("Sigmoid", type=l, units=8)]) + ae = AE(layers=[L("Sigmoid", type=l, units=8)]) + ae.fit(X) def test_UnknownCostFunction(self): assert_raises(NotImplementedError, L, "Sigmoid", cost="unknown")