Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Fix for corrputor AI exceptions, tests that actually run fit().
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjc committed May 17, 2015
1 parent 37717b7 commit e365d94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sknn/ae.py
Expand Up @@ -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."
Expand Down
8 changes: 6 additions & 2 deletions sknn/tests/test_ae.py
Expand Up @@ -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")
Expand Down

0 comments on commit e365d94

Please sign in to comment.