Esempio n. 1
0
 def test_logistic_zero(self):
     r = RBM(10, 10)
     self.assertEquals(r._RBM__logistic(0), 0.5)
Esempio n. 2
0
 def test_logistic_zero(self):
     r = RBM(10, 10)
     self.assertEquals(r._RBM__logistic(0), 0.5)
Esempio n. 3
0
 def test_regenerate_negative_samples(self):
     r = RBM(5, 10)
     data = [[1,1,1,1,1]]
     with self.assertRaises(UnboundLocalError):
         v,h = r.regenerate(data, -1)
Esempio n. 4
0
 def test_rbm(self):
     r = RBM(10, 10)
Esempio n. 5
0
 def test_regenerate(self):
     r = RBM(5, 10)
     data = [[1,1,1,1,1]]
     v,h = r.regenerate(data, 1)
Esempio n. 6
0
 def test_regenerate_wrong_shape(self):
     r = RBM(5, 10)
     data = [[1,1,1,1]]
     with self.assertRaises(ValueError):
         v,h = r.regenerate(data, 1)
Esempio n. 7
0
 def test_train_rbm_negative_batches(self):
     r = RBM(5, 10)
     data = [[1,1,1,1,1],[0,0,0,0,0]]
     with self.assertRaises(ValueError):
         r.train(data,1,-1)
Esempio n. 8
0
 def test_train_rbm_wrong_shape(self):
     r = RBM(5, 10)
     data = [[0,0,0,0]]
     with self.assertRaises(ValueError):
         r.train(data,1,1)
Esempio n. 9
0
 def train_rbm(self):
     r = RBM(5, 10)
     data = [[1,1,1,1,1],[0,0,0,0,0]]
     r.train(data,1,1)
Esempio n. 10
0
 def test_negative_visible_constructor(self):
     with self.assertRaises(ValueError):
         r = RBM(-10, 10)
Esempio n. 11
0
 def test_negative_hidden_constructor(self):
     with self.assertRaises(ValueError):
         r = RBM(10, -10)