From 661488955cd8ccd3485c81401eea96b6ba85bdad Mon Sep 17 00:00:00 2001 From: Rahul Mohan Date: Thu, 15 Oct 2015 17:35:25 -0700 Subject: [PATCH 1/3] Added fix for ReLU --- Keras.egg-info/PKG-INFO | 11 ++++++ Keras.egg-info/SOURCES.txt | 57 +++++++++++++++++++++++++++++ Keras.egg-info/dependency_links.txt | 1 + Keras.egg-info/requires.txt | 5 +++ Keras.egg-info/top_level.txt | 2 + keras/activations.py | 2 +- 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 Keras.egg-info/PKG-INFO create mode 100644 Keras.egg-info/SOURCES.txt create mode 100644 Keras.egg-info/dependency_links.txt create mode 100644 Keras.egg-info/requires.txt create mode 100644 Keras.egg-info/top_level.txt diff --git a/Keras.egg-info/PKG-INFO b/Keras.egg-info/PKG-INFO new file mode 100644 index 000000000000..35f45816a8cb --- /dev/null +++ b/Keras.egg-info/PKG-INFO @@ -0,0 +1,11 @@ +Metadata-Version: 1.1 +Name: Keras +Version: 0.2.0 +Summary: Theano-based Deep Learning library +Home-page: https://github.com/fchollet/keras +Author: Francois Chollet +Author-email: francois.chollet@gmail.com +License: MIT +Download-URL: https://github.com/fchollet/keras/tarball/0.2.0 +Description: UNKNOWN +Platform: UNKNOWN diff --git a/Keras.egg-info/SOURCES.txt b/Keras.egg-info/SOURCES.txt new file mode 100644 index 000000000000..fde5ca79f410 --- /dev/null +++ b/Keras.egg-info/SOURCES.txt @@ -0,0 +1,57 @@ +setup.cfg +setup.py +Keras.egg-info/PKG-INFO +Keras.egg-info/SOURCES.txt +Keras.egg-info/dependency_links.txt +Keras.egg-info/requires.txt +Keras.egg-info/top_level.txt +keras/__init__.py +keras/activations.py +keras/callbacks.py +keras/constraints.py +keras/initializations.py +keras/models.py +keras/objectives.py +keras/optimizers.py +keras/regularizers.py +keras/datasets/__init__.py +keras/datasets/cifar.py +keras/datasets/cifar10.py +keras/datasets/cifar100.py +keras/datasets/data_utils.py +keras/datasets/imdb.py +keras/datasets/mnist.py +keras/datasets/reuters.py +keras/layers/__init__.py +keras/layers/advanced_activations.py +keras/layers/containers.py +keras/layers/convolutional.py +keras/layers/core.py +keras/layers/embeddings.py +keras/layers/noise.py +keras/layers/normalization.py +keras/layers/recurrent.py +keras/preprocessing/__init__.py +keras/preprocessing/image.py +keras/preprocessing/sequence.py +keras/preprocessing/text.py +keras/utils/__init__.py +keras/utils/generic_utils.py +keras/utils/io_utils.py +keras/utils/layer_utils.py +keras/utils/np_utils.py +keras/utils/test_utils.py +keras/utils/theano_utils.py +keras/utils/visualize_util.py +keras/wrappers/__init__.py +keras/wrappers/scikit_learn.py +tests/__init__.py +tests/manual/__init__.py +tests/manual/check_autoencoder.py +tests/manual/check_callbacks.py +tests/manual/check_constraints.py +tests/manual/check_masked_recurrent.py +tests/manual/check_model_utils.py +tests/manual/check_save_weights.py +tests/manual/check_wrappers.py +tests/manual/check_yaml.py \ No newline at end of file diff --git a/Keras.egg-info/dependency_links.txt b/Keras.egg-info/dependency_links.txt new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/Keras.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/Keras.egg-info/requires.txt b/Keras.egg-info/requires.txt new file mode 100644 index 000000000000..2a55768242f5 --- /dev/null +++ b/Keras.egg-info/requires.txt @@ -0,0 +1,5 @@ +theano +pyyaml + +[h5py] +h5py diff --git a/Keras.egg-info/top_level.txt b/Keras.egg-info/top_level.txt new file mode 100644 index 000000000000..dbf85e80b368 --- /dev/null +++ b/Keras.egg-info/top_level.txt @@ -0,0 +1,2 @@ +keras +tests diff --git a/keras/activations.py b/keras/activations.py index e34962eedef3..88f1de103101 100644 --- a/keras/activations.py +++ b/keras/activations.py @@ -17,7 +17,7 @@ def softplus(x): def relu(x): - return T.nnet.relu(x) + return (x + abs(x)) / 2.0 def tanh(x): From 0f457a4c2f26147173399a283664a03906b26e25 Mon Sep 17 00:00:00 2001 From: Nathan Boley Date: Thu, 15 Oct 2015 17:40:34 -0700 Subject: [PATCH 2/3] Added a cast to prevent the float64 compile warnings. --- keras/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keras/models.py b/keras/models.py index 708b4ec1835c..38fbeff42d4c 100644 --- a/keras/models.py +++ b/keras/models.py @@ -374,8 +374,8 @@ def compile(self, optimizer, loss, class_mode="categorical", theano_mode=None): test_accuracy = T.mean(T.eq(T.argmax(self.y, axis=-1), T.argmax(self.y_test, axis=-1))) elif class_mode == "binary": - train_accuracy = T.mean(T.eq(self.y, T.round(self.y_train))) - test_accuracy = T.mean(T.eq(self.y, T.round(self.y_test))) + train_accuracy = T.mean(T.eq(self.y, T.round(self.y_train)), dtype='float32') + test_accuracy = T.mean(T.eq(self.y, T.round(self.y_test)), dtype='float32') else: raise Exception("Invalid class mode:" + str(class_mode)) self.class_mode = class_mode From 9fc25843f47a39e1d157e26a68205841108d2aff Mon Sep 17 00:00:00 2001 From: Rahul Mohan Date: Thu, 15 Oct 2015 19:03:27 -0700 Subject: [PATCH 3/3] Sped up max pooling significantly --- keras/layers/convolutional.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keras/layers/convolutional.py b/keras/layers/convolutional.py index bb86aa7bbd01..ebb2ee4dfb69 100644 --- a/keras/layers/convolutional.py +++ b/keras/layers/convolutional.py @@ -4,7 +4,7 @@ import theano import theano.tensor as T from theano.tensor.signal import downsample - +from theano.sandbox.cuda.dnn import dnn_pool from .. import activations, initializations, regularizers, constraints from ..utils.theano_utils import shared_zeros, on_gpu from ..layers.core import Layer @@ -343,7 +343,8 @@ def output_shape(self): def get_output(self, train=False): X = self.get_input(train) - output = downsample.max_pool_2d(X, ds=self.pool_size, st=self.stride, ignore_border=self.ignore_border) + output = dnn_pool(X, self.pool_size, stride=self.stride); + #output = downsample.max_pool_2d(X, ds=self.pool_size, st=self.stride, ignore_border=self.ignore_border) return output def get_config(self):