예제 #1
0
 def test_prop_up(self):
     res = self.rbm.prop_up(self.visible_layer)
     expected = neur.sigmoid(np.array([[ 1.260987,  2.484167],
                                       [ 1.142713,  1.844246],
                                       [ 0.878157,  1.070012],
                                       [ 0.364556,  0.974234]]))
     self.assertTrue(self.all_equalish(res, expected))
예제 #2
0
 def encode(self, x):
     # add ones
     m = len(x)
     x = np.hstack([np.ones((m,1)), x])
     return neur.sigmoid(np.dot(x, self.encode_weights.transpose()))
예제 #3
0
 def test_prop_up(self):
     res = self.rbm.prop_up(self.visible_layer)
     expected = neur.sigmoid(
         np.array([[1.260987, 2.484167], [1.142713, 1.844246],
                   [0.878157, 1.070012], [0.364556, 0.974234]]))
     self.assertTrue(self.all_equalish(res, expected))
예제 #4
0
파일: rbm.py 프로젝트: bhauman/neurpy
 def prop_up(self, vis_layer):
     return neur.sigmoid(np.dot(vis_layer, self.weights.transpose()))
예제 #5
0
파일: rbm.py 프로젝트: bhauman/neurpy
 def prop_down(self, hid_layer):
     return neur.sigmoid(np.dot(hid_layer, self.weights))
예제 #6
0
 def test_sigmoid(self):
     res = neur.sigmoid(np.array(([1, 2], [3, 4])))
     target = np.array([[0.7310585, 0.88079708], [0.95257413, 0.98201379]])
     self.equalish(res, target)
예제 #7
0
파일: rbm_bias.py 프로젝트: bhauman/neurpy
 def prop_down(self, hid_layer):
     vis_bias = self.expand_visible_bias(hid_layer.shape[0])
     return neur.sigmoid(np.dot(hid_layer, self.weights) + vis_bias)
예제 #8
0
파일: rbm_bias.py 프로젝트: bhauman/neurpy
 def prop_up(self, vis_layer):
     hid_bias = self.expand_hidden_bias(vis_layer.shape[0])
     res = np.dot(vis_layer, self.weights.transpose()) + hid_bias
     return neur.sigmoid(res)
예제 #9
0
 def test_sigmoid(self):
     res = neur.sigmoid(np.array(([1, 2], [3, 4])))
     target = np.array([[0.7310585, 0.88079708], [0.95257413, 0.98201379]])
     self.equalish(res, target)
예제 #10
0
파일: rbm_bias.py 프로젝트: bhauman/neurpy
 def prop_down(self, hid_layer):
     vis_bias = self.expand_visible_bias(hid_layer.shape[0])
     return neur.sigmoid(np.dot(hid_layer, self.weights) + vis_bias)
예제 #11
0
파일: rbm_bias.py 프로젝트: bhauman/neurpy
 def prop_up(self, vis_layer):
     hid_bias = self.expand_hidden_bias(vis_layer.shape[0])
     res = np.dot(vis_layer, self.weights.transpose()) + hid_bias
     return neur.sigmoid(res)