()
| 120 | |
| 121 | |
| 122 | def 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 | |
| 138 | if __name__ == '__main__': |
no test coverage detected