From df331cc5e0340c8ca157337af7dd4043d07e00b3 Mon Sep 17 00:00:00 2001 From: floydsoft Date: Tue, 7 Jul 2015 04:59:00 +0800 Subject: [PATCH 1/2] fix doc --- docs/sources/layers/noise.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/layers/noise.md b/docs/sources/layers/noise.md index ef2124b7b..9589dc884 100644 --- a/docs/sources/layers/noise.md +++ b/docs/sources/layers/noise.md @@ -2,7 +2,7 @@ ## GaussianNoise ```python -keras.layers.core.GaussianNoise(sigma) +keras.layers.noise.GaussianNoise(sigma) ``` Apply to the input an additive zero-centred gaussian noise with standard deviation `sigma`. This is useful to mitigate overfitting (you could see it as a kind of random data augmentation). Gaussian Noise (GS) is a natural choice as corruption process for real valued inputs. @@ -16,4 +16,4 @@ The gaussian noise is only added at training time. - __sigma__: float, standard deviation of the noise distribution. ---- \ No newline at end of file +--- From 7ff158de41f99a9422309ba3f0aad4804a3a58f3 Mon Sep 17 00:00:00 2001 From: Moto H Date: Tue, 7 Jul 2015 14:22:25 +0900 Subject: [PATCH 2/2] Modified comment and fixed batch_size --- examples/mnist_irnn.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/mnist_irnn.py b/examples/mnist_irnn.py index 59ab29261..5171de759 100644 --- a/examples/mnist_irnn.py +++ b/examples/mnist_irnn.py @@ -12,7 +12,7 @@ from keras.optimizers import RMSprop from keras.utils import np_utils ''' - This is a reproduction of the IRNN experiment + This is a reproduction of the IRNN experiment with pixel-by-pixel sequential MNIST in "A Simple Way to Initialize Recurrent Networks of Rectified Linear Units " by Quoc V. Le, Navdeep Jaitly, Geoffrey E. Hinton @@ -23,8 +23,8 @@ from keras.utils import np_utils Optimizer is replaced with RMSprop which yields more stable and steady improvement. - 0.80 train/test accuracy and 0.55 train/test loss after 70 epochs - (it's still underfitting at that point, though). + Reaches 0.93 train/test accuracy after 900 epochs (which roughly corresponds + to 1687500 steps in the original paper.) ''' batch_size = 32 @@ -64,7 +64,7 @@ model.add(Activation('softmax')) rmsprop = RMSprop(lr=learning_rate) model.compile(loss='categorical_crossentropy', optimizer=rmsprop) -model.fit(X_train, Y_train, batch_size=16, nb_epoch=nb_epochs, +model.fit(X_train, Y_train, batch_size=batch_size, nb_epoch=nb_epochs, show_accuracy=True, verbose=1, validation_data=(X_test, Y_test)) scores = model.evaluate(X_test, Y_test, show_accuracy=True, verbose=0) @@ -79,9 +79,9 @@ model.add(Activation('softmax')) rmsprop = RMSprop(lr=learning_rate) model.compile(loss='categorical_crossentropy', optimizer=rmsprop) -model.fit(X_train, Y_train, batch_size=16, nb_epoch=nb_epochs, +model.fit(X_train, Y_train, batch_size=batch_size, nb_epoch=nb_epochs, show_accuracy=True, verbose=1, validation_data=(X_test, Y_test)) scores = model.evaluate(X_test, Y_test, show_accuracy=True, verbose=0) print('LSTM test score:', scores[0]) -print('LSTM test accuracy:', scores[1]) \ No newline at end of file +print('LSTM test accuracy:', scores[1])