EderSantana / deeplivecoding

Deep Learning presentation and live coding demo
MIT License
7 stars 8 forks source link

train_set and test_set #1

Open rick168 opened 9 years ago

rick168 commented 9 years ago

https://github.com/EderSantana/deeplivecoding/blob/master/demo-rehearsal.py train_set, valid_set, test_set = cPickle.load(file('mnist.pkl', 'r')) print(len(train_set)) train_x, train_y = train_set test_x , test_y = test_set

Please see the code on this link: https://www.kaggle.com/mattgenkin/digit-recognizer/first-attempts-with-neural-net-in-theano/code

trX = np.array(train.values[:][:, 1:], dtype=np.float32)/256 trY = np.array(train.values[:][:, 0], dtype=int) teX = np.array(test.values[:], dtype=np.float32)/256 trY_onehot = np.zeros((trY.shape[0], 10), dtype=np.float32) trY_onehot[np.arange(trY.shape[0]), trY] = 1

Please advise how to define train_set and test_set in this case.

Thanks!

EderSantana commented 9 years ago

I believe trX is the equivalent to train_x...

But if you are looking for a good way to do deep learning with Python/Theano I recommend you to take a look at Keras. Here is an example on how to train a neural net to classify the MNIST dataset. I've been writing most of my deep learning with that library lately. Check it out!