@@ -55,7 +55,7 @@ def __init__(self, input=None, label=None,\
55
55
if i == 0 :
56
56
layer_input = self .x
57
57
else :
58
- layer_input = self .sigmoid_layers [- 1 ].output ()
58
+ layer_input = self .sigmoid_layers [- 1 ].sample_h_given_v ()
59
59
60
60
# construct sigmoid_layer
61
61
sigmoid_layer = HiddenLayer (input = layer_input ,
@@ -76,7 +76,7 @@ def __init__(self, input=None, label=None,\
76
76
77
77
78
78
# layer for output using Logistic Regression
79
- self .log_layer = LogisticRegression (input = self .sigmoid_layers [- 1 ].output (),
79
+ self .log_layer = LogisticRegression (input = self .sigmoid_layers [- 1 ].sample_h_given_v (),
80
80
label = self .y ,
81
81
n_in = hidden_layer_sizes [- 1 ],
82
82
n_out = n_outs )
@@ -92,9 +92,8 @@ def pretrain(self, lr=0.1, k=1, epochs=100):
92
92
if i == 0 :
93
93
layer_input = self .x
94
94
else :
95
- layer_input = self .sigmoid_layers [i - 1 ].output ( )
95
+ layer_input = self .sigmoid_layers [i - 1 ].sample_h_given_v ( layer_input )
96
96
rbm = self .rbm_layers [i ]
97
-
98
97
99
98
for epoch in xrange (epochs ):
100
99
c = []
@@ -108,7 +107,7 @@ def pretrain(self, lr=0.1, k=1, epochs=100):
108
107
109
108
110
109
def finetune (self , lr = 0.1 , epochs = 100 ):
111
- layer_input = self .sigmoid_layers [- 1 ].output ()
110
+ layer_input = self .sigmoid_layers [- 1 ].sample_h_given_v ()
112
111
113
112
# train log_layer
114
113
epoch = 0
0 commit comments