diff --git a/mmodel/theano/THEANO.py b/mmodel/theano/THEANO.py index 26a20d4..a6e66db 100644 --- a/mmodel/theano/THEANO.py +++ b/mmodel/theano/THEANO.py @@ -37,16 +37,15 @@ class ModelTHEANO(ModelBase): else: X_train, X_test, Y_train, Y_test = cross_validation.train_test_split(X, Y, test_size=0.2, random_state=0) - print type(X), type(X_train), type(X_train[0]) - return - - X_train, Y_train = np.array(X_train), np.array(Y_train) - X_test, Y_test = np.array(X_test), np.array(Y_test) + X_train = theano.shared(np.asarray(X_train, dtype=theano.config.floatX), borrow=True) + Y_train = theano.shared(np.asarray(Y_train, dtype=theano.config.floatX), borrow=True) + X_test = theano.shared(np.asarray(X_test, dtype=theano.config.floatX), borrow=True) + Y_test = theano.shared(np.asarray(Y_test, dtype=theano.config.floatX), borrow=True) n_train_batches = X_train.shape[0] / batch_size n_test_batches = X_test.shape[0] / batch_size - rng = np.random.RandomState("whoami") + rng = np.random.RandomState(12306) index = T.lscalar() x = T.matrix('x') y = T.ivector('y') @@ -89,7 +88,7 @@ class ModelTHEANO(ModelBase): layer2 = ConvPoolLayer( rng, input=layer1.output, - image_shape=(batch_size, nkerns[0], 16, 16), + image_shape=(batch_size, nkerns[1], 16, 16), filter_shape=(nkerns[2], nkerns[1], 5, 5), poolsize=(3, 3) ) -- libgit2 0.21.2