MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / main

Function main

unsupervised_class2/rbm_tf.py:122–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120
121
122def main():
123 Xtrain, Ytrain, Xtest, Ytest = getKaggleMNIST()
124
125 # same as autoencoder_tf.py
126 Xtrain = Xtrain.astype(np.float32)
127 Xtest = Xtest.astype(np.float32)
128 _, D = Xtrain.shape
129 K = len(set(Ytrain))
130 dnn = DNN(D, [1000, 750, 500], K, UnsupervisedModel=RBM)
131 init_op = tf.compat.v1.global_variables_initializer()
132 with tf.compat.v1.Session() as session:
133 session.run(init_op)
134 dnn.set_session(session)
135 dnn.fit(Xtrain, Ytrain, Xtest, Ytest, pretrain=True, epochs=10)
136
137
138if __name__ == '__main__':

Callers 1

rbm_tf.pyFile · 0.70

Calls 5

set_sessionMethod · 0.95
fitMethod · 0.95
getKaggleMNISTFunction · 0.90
DNNClass · 0.90
runMethod · 0.45

Tested by

no test coverage detected