예제 #1
0
 def test_logistic_zero(self):
     r = RBM(10, 10)
     self.assertEquals(r._RBM__logistic(0), 0.5)
예제 #2
0
 def test_logistic_zero(self):
     r = RBM(10, 10)
     self.assertEquals(r._RBM__logistic(0), 0.5)
예제 #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)
예제 #4
0
 def test_rbm(self):
     r = RBM(10, 10)
예제 #5
0
 def test_regenerate(self):
     r = RBM(5, 10)
     data = [[1,1,1,1,1]]
     v,h = r.regenerate(data, 1)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #10
0
 def test_negative_visible_constructor(self):
     with self.assertRaises(ValueError):
         r = RBM(-10, 10)
예제 #11
0
 def test_negative_hidden_constructor(self):
     with self.assertRaises(ValueError):
         r = RBM(10, -10)