keras 0.2.0__py2.7.egg
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- EGG-INFO/PKG-INFO +11 -0
- EGG-INFO/SOURCES.txt +51 -0
- EGG-INFO/dependency_links.txt +1 -0
- EGG-INFO/requires.txt +6 -0
- EGG-INFO/top_level.txt +1 -0
- EGG-INFO/zip-safe +1 -0
- keras/__init__.py +15 -0
- keras/__init__.pyc +0 -0
- keras/activations.py +49 -0
- keras/activations.pyc +0 -0
- keras/backend/__init__.py +39 -0
- keras/backend/__init__.pyc +0 -0
- keras/backend/common.py +31 -0
- keras/backend/common.pyc +0 -0
- keras/backend/tensorflow_backend.py +602 -0
- keras/backend/tensorflow_backend.pyc +0 -0
- keras/backend/theano_backend.py +622 -0
- keras/backend/theano_backend.pyc +0 -0
- keras/callbacks.py +295 -0
- keras/callbacks.pyc +0 -0
- keras/constraints.py +45 -0
- keras/constraints.pyc +0 -0
- keras/datasets/__init__.py +0 -0
- keras/datasets/__init__.pyc +0 -0
- keras/datasets/cifar.py +22 -0
- keras/datasets/cifar.pyc +0 -0
- keras/datasets/cifar10.py +31 -0
- keras/datasets/cifar10.pyc +0 -0
- keras/datasets/cifar100.py +28 -0
- keras/datasets/cifar100.pyc +0 -0
- keras/datasets/data_utils.py +50 -0
- keras/datasets/data_utils.pyc +0 -0
- keras/datasets/imdb.py +66 -0
- keras/datasets/imdb.pyc +0 -0
- keras/datasets/mnist.py +23 -0
- keras/datasets/mnist.pyc +0 -0
- keras/datasets/reuters.py +148 -0
- keras/datasets/reuters.pyc +0 -0
- keras/initializations.py +86 -0
- keras/initializations.pyc +0 -0
- keras/layers/__init__.py +0 -0
- keras/layers/__init__.pyc +0 -0
- keras/layers/advanced_activations.py +156 -0
- keras/layers/advanced_activations.pyc +0 -0
- keras/layers/containers.py +405 -0
- keras/layers/containers.pyc +0 -0
- keras/layers/convolutional.py +505 -0
- keras/layers/convolutional.pyc +0 -0
- keras/layers/core.py +1428 -0
- keras/layers/core.pyc +0 -0
- keras/layers/embeddings.py +88 -0
- keras/layers/embeddings.pyc +0 -0
- keras/layers/noise.py +55 -0
- keras/layers/noise.pyc +0 -0
- keras/layers/normalization.py +123 -0
- keras/layers/normalization.pyc +0 -0
- keras/layers/ntm.py +326 -0
- keras/layers/ntm.pyc +0 -0
- keras/layers/recurrent.py +354 -0
- keras/layers/recurrent.pyc +0 -0
- keras/models.py +743 -0
- keras/models.pyc +0 -0
- keras/objectives.py +59 -0
- keras/objectives.pyc +0 -0
- keras/optimizers.py +229 -0
- keras/optimizers.pyc +0 -0
- keras/preprocessing/__init__.py +0 -0
- keras/preprocessing/__init__.pyc +0 -0
- keras/preprocessing/image.py +246 -0
- keras/preprocessing/image.pyc +0 -0
- keras/preprocessing/sequence.py +124 -0
- keras/preprocessing/sequence.pyc +0 -0
- keras/preprocessing/text.py +176 -0
- keras/preprocessing/text.pyc +0 -0
- keras/regularizers.py +86 -0
- keras/regularizers.pyc +0 -0
- keras/utils/__init__.py +0 -0
- keras/utils/__init__.pyc +0 -0
- keras/utils/generic_utils.py +133 -0
- keras/utils/generic_utils.pyc +0 -0
- keras/utils/io_utils.py +71 -0
- keras/utils/io_utils.pyc +0 -0
- keras/utils/layer_utils.py +93 -0
- keras/utils/layer_utils.pyc +0 -0
- keras/utils/np_utils.py +53 -0
- keras/utils/np_utils.pyc +0 -0
- keras/utils/test_utils.py +27 -0
- keras/utils/test_utils.pyc +0 -0
- keras/utils/theano_utils.py +44 -0
- keras/utils/theano_utils.pyc +0 -0
- keras/utils/visualize_util.py +41 -0
- keras/utils/visualize_util.pyc +0 -0
- keras/wrappers/__init__.py +0 -0
- keras/wrappers/__init__.pyc +0 -0
- keras/wrappers/scikit_learn.py +266 -0
- keras/wrappers/scikit_learn.pyc +0 -0
- tests/__init__.py +0 -0
- tests/__init__.pyc +0 -0
- tests/manual/__init__.py +0 -0
- tests/manual/__init__.pyc +0 -0
- tests/manual/check_autoencoder.py +134 -0
- tests/manual/check_autoencoder.pyc +0 -0
- tests/manual/check_callbacks.py +236 -0
- tests/manual/check_callbacks.pyc +0 -0
- tests/manual/check_constraints.py +100 -0
- tests/manual/check_constraints.pyc +0 -0
- tests/manual/check_masked_recurrent.py +130 -0
- tests/manual/check_masked_recurrent.pyc +0 -0
- tests/manual/check_model_utils.py +44 -0
- tests/manual/check_model_utils.pyc +0 -0
- tests/manual/check_save_weights.py +40 -0
- tests/manual/check_save_weights.pyc +0 -0
- tests/manual/check_wrappers.py +126 -0
- tests/manual/check_wrappers.pyc +0 -0
- tests/manual/check_yaml.py +101 -0
- tests/manual/check_yaml.pyc +0 -0
EGG-INFO/PKG-INFO
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 1.1
|
|
2
|
+
Name: Keras
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Theano-based Deep Learning library
|
|
5
|
+
Home-page: https://github.com/fchollet/keras
|
|
6
|
+
Author: Francois Chollet
|
|
7
|
+
Author-email: francois.chollet@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Download-URL: https://github.com/fchollet/keras/tarball/0.2.0
|
|
10
|
+
Description: UNKNOWN
|
|
11
|
+
Platform: UNKNOWN
|
EGG-INFO/SOURCES.txt
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
setup.cfg
|
|
2
|
+
setup.py
|
|
3
|
+
Keras.egg-info/PKG-INFO
|
|
4
|
+
Keras.egg-info/SOURCES.txt
|
|
5
|
+
Keras.egg-info/dependency_links.txt
|
|
6
|
+
Keras.egg-info/requires.txt
|
|
7
|
+
Keras.egg-info/top_level.txt
|
|
8
|
+
keras/__init__.py
|
|
9
|
+
keras/activations.py
|
|
10
|
+
keras/callbacks.py
|
|
11
|
+
keras/constraints.py
|
|
12
|
+
keras/initializations.py
|
|
13
|
+
keras/models.py
|
|
14
|
+
keras/objectives.py
|
|
15
|
+
keras/optimizers.py
|
|
16
|
+
keras/regularizers.py
|
|
17
|
+
keras/backend/__init__.py
|
|
18
|
+
keras/backend/common.py
|
|
19
|
+
keras/backend/tensorflow_backend.py
|
|
20
|
+
keras/backend/theano_backend.py
|
|
21
|
+
keras/datasets/__init__.py
|
|
22
|
+
keras/datasets/cifar.py
|
|
23
|
+
keras/datasets/cifar10.py
|
|
24
|
+
keras/datasets/cifar100.py
|
|
25
|
+
keras/datasets/data_utils.py
|
|
26
|
+
keras/datasets/imdb.py
|
|
27
|
+
keras/datasets/mnist.py
|
|
28
|
+
keras/datasets/reuters.py
|
|
29
|
+
keras/layers/__init__.py
|
|
30
|
+
keras/layers/advanced_activations.py
|
|
31
|
+
keras/layers/containers.py
|
|
32
|
+
keras/layers/convolutional.py
|
|
33
|
+
keras/layers/core.py
|
|
34
|
+
keras/layers/embeddings.py
|
|
35
|
+
keras/layers/noise.py
|
|
36
|
+
keras/layers/normalization.py
|
|
37
|
+
keras/layers/ntm.py
|
|
38
|
+
keras/layers/recurrent.py
|
|
39
|
+
keras/preprocessing/__init__.py
|
|
40
|
+
keras/preprocessing/image.py
|
|
41
|
+
keras/preprocessing/sequence.py
|
|
42
|
+
keras/preprocessing/text.py
|
|
43
|
+
keras/utils/__init__.py
|
|
44
|
+
keras/utils/generic_utils.py
|
|
45
|
+
keras/utils/io_utils.py
|
|
46
|
+
keras/utils/layer_utils.py
|
|
47
|
+
keras/utils/np_utils.py
|
|
48
|
+
keras/utils/test_utils.py
|
|
49
|
+
keras/utils/visualize_util.py
|
|
50
|
+
keras/wrappers/__init__.py
|
|
51
|
+
keras/wrappers/scikit_learn.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
EGG-INFO/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
keras
|
EGG-INFO/zip-safe
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
keras/__init__.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
"""
|
|
3
|
+
Keras: Theano-based Deep Learning library
|
|
4
|
+
==================================
|
|
5
|
+
Keras is a minimalist, highly modular neural network library in
|
|
6
|
+
the spirit of Torch, written in Python / Theano so as not to have
|
|
7
|
+
to deal with the dearth of ecosystem in Lua. It was developed with
|
|
8
|
+
a focus on enabling fast experimentation. Being able to go from
|
|
9
|
+
idea to result with the least possible delay is key to doing
|
|
10
|
+
good research.
|
|
11
|
+
|
|
12
|
+
See http://keras.io/
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
__version__ = '0.2.0'
|
keras/__init__.pyc
ADDED
|
Binary file
|
keras/activations.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
from . import backend as K
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def softmax(x):
|
|
6
|
+
ndim = K.ndim(x)
|
|
7
|
+
if ndim == 2:
|
|
8
|
+
return K.softmax(x)
|
|
9
|
+
elif ndim == 3:
|
|
10
|
+
# apply softmax to each timestep
|
|
11
|
+
def step(x, states):
|
|
12
|
+
return K.softmax(x), []
|
|
13
|
+
last_output, outputs, states = K.rnn(step, x, [], masking=False)
|
|
14
|
+
return outputs
|
|
15
|
+
else:
|
|
16
|
+
raise Exception('Cannot apply softmax to a tensor that is not 2D or 3D. ' +
|
|
17
|
+
'Here, ndim=' + str(ndim))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def softplus(x):
|
|
21
|
+
return K.softplus(x)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def relu(x, alpha=0., max_value=None):
|
|
25
|
+
return K.relu(x, alpha=alpha, max_value=max_value)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def tanh(x):
|
|
29
|
+
return K.tanh(x)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def sigmoid(x):
|
|
33
|
+
return K.sigmoid(x)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def hard_sigmoid(x):
|
|
37
|
+
return K.hard_sigmoid(x)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def linear(x):
|
|
41
|
+
'''
|
|
42
|
+
The function returns the variable that is passed in, so all types work
|
|
43
|
+
'''
|
|
44
|
+
return x
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
from .utils.generic_utils import get_from_module
|
|
48
|
+
def get(identifier):
|
|
49
|
+
return get_from_module(identifier, globals(), 'activation function')
|
keras/activations.pyc
ADDED
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
from __future__ import print_function
|
|
3
|
+
import os
|
|
4
|
+
import json
|
|
5
|
+
from .common import epsilon, floatx, set_epsilon, set_floatx
|
|
6
|
+
|
|
7
|
+
_keras_dir = os.path.expanduser(os.path.join('~', '.keras'))
|
|
8
|
+
if not os.path.exists(_keras_dir):
|
|
9
|
+
os.makedirs(_keras_dir)
|
|
10
|
+
|
|
11
|
+
_BACKEND = 'theano'
|
|
12
|
+
_config_path = os.path.expanduser(os.path.join('~', '.keras', 'keras.json'))
|
|
13
|
+
if os.path.exists(_config_path):
|
|
14
|
+
_config = json.load(open(_config_path))
|
|
15
|
+
_floatx = _config.get('floatx', floatx())
|
|
16
|
+
assert _floatx in {'float32', 'float64'}
|
|
17
|
+
_epsilon = _config.get('epsilon', epsilon())
|
|
18
|
+
assert type(_epsilon) == float
|
|
19
|
+
_backend = _config.get('backend', _BACKEND)
|
|
20
|
+
assert _backend in {'theano', 'tensorflow'}
|
|
21
|
+
|
|
22
|
+
set_floatx(_floatx)
|
|
23
|
+
set_epsilon(_epsilon)
|
|
24
|
+
_BACKEND = _backend
|
|
25
|
+
else:
|
|
26
|
+
# save config file, for easy edition
|
|
27
|
+
_config = {'floatx': floatx(),
|
|
28
|
+
'epsilon': epsilon(),
|
|
29
|
+
'backend': _BACKEND}
|
|
30
|
+
json.dump(_config, open(_config_path, 'w'))
|
|
31
|
+
|
|
32
|
+
if _BACKEND == 'theano':
|
|
33
|
+
print('Using Theano backend.')
|
|
34
|
+
from .theano_backend import *
|
|
35
|
+
elif _BACKEND == 'tensorflow':
|
|
36
|
+
print('Using TensorFlow backend.')
|
|
37
|
+
from .tensorflow_backend import *
|
|
38
|
+
else:
|
|
39
|
+
raise Exception('Unknown backend: ' + str(backend))
|
|
Binary file
|
keras/backend/common.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
# the type of float to use throughout the session.
|
|
4
|
+
_FLOATX = 'float32'
|
|
5
|
+
_EPSILON = 10e-8
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def epsilon():
|
|
9
|
+
return _EPSILON
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def set_epsilon(e):
|
|
13
|
+
global _EPSILON
|
|
14
|
+
_EPSILON = e
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def floatx():
|
|
18
|
+
return _FLOATX
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def set_floatx(floatx):
|
|
22
|
+
global _FLOATX
|
|
23
|
+
if floatx not in {'float32', 'float64'}:
|
|
24
|
+
raise Exception('Unknown floatx type: ' + str(floatx))
|
|
25
|
+
_FLOATX = floatx
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def cast_to_floatx(x):
|
|
29
|
+
'''Cast a Numpy array to floatx.
|
|
30
|
+
'''
|
|
31
|
+
return np.asarray(x, dtype=_FLOATX)
|
keras/backend/common.pyc
ADDED
|
Binary file
|