3717 Commits

Autor SHA1 Mensagem Data
Frédéric Branchaud-Charron 58d1d0678f Fix test in multiprocessing (#7058) 2017-06-20 15:56:45 -07:00
Francois Chollet abf8691ade Temp fix to multiprocessing tests 2017-06-20 12:48:18 -07:00
Francois Chollet 7425e68cd6 Style fixes 2017-06-20 12:47:52 -07:00
Frédéric Branchaud-Charron ab6b82c2db Fix the ordering bugs when using pickle_safe=True (#6891)
* Initial support for Datasets

* Fix warnings

* Fix for python2

* Fix travis deps

* Fix python2 indexing

* Fix test and docs

* Avoir use of future, use multiprocessing.pool

* Changed warning and better moduling

* fix threading test

* Move Dataset and enqueuers to utils.data_utils

* Skip None input, add seed for generators

* Skip None input fix

* pep8

* Fix example

* Add test in training and changed Dataset to hold item

* Revert to batch handling

* Docs update

* PEP8

* Rename in test

* Better documentation in Sequence

* Typo in sequence warning

* Rename pickle_safe and max_q_size, typos

* Typo in docstring

* Fix tests in training
2017-06-20 10:55:46 -07:00
Andrea Esuli 6814506528 Renamed one_hot function to hashing_trick, made hashing stable (#6887)
* Replaced one_hot function with hashing_trick

* Update text_test.py

* PEP8 fix

* Update text.py

* Put one_hot back, added documentation

* Changes following the review comments

* PEP8

* Chages after second review

* fixed wrong default for hashing_trick

* formatted documentation

* typo
2017-06-20 10:22:02 -07:00
Shaofan Lai 1ddf23528e Fix bug in preprocess_weights_for_loading (#6960)
* add skip_compile option to keras.models.load_model()

* update document

* change name from skip_compile to compile

* fix bug in `preprocess_weights_for_loading` so that layer of type `Model` can be coverted correctly

* update codestyle

* updated

* fix indent

* revert changing

* update spacing
2017-06-20 10:21:14 -07:00
Sebastian Brandes 86c8d1dd45 Fixed default header in RemoteMonitor callback. (#7040)
* Fixed default header in RemoteMonitor callback.

* Removed default headers from RemoteMonitor

The requests library automatically adds the appropriate headers by default.

* Fixed PEP8 warning in RemoteMonitor constructor
2017-06-20 10:20:28 -07:00
Andrew Hundt 929ae992c2 test_multiprocessing.py fix incorrect use of numpy.random.randint (#7030)
* test_multiprocessing.py fix test which actually throws two exceptions

* test_multiprocessing.py fixed incorrect usage of np.random.randint()
https://docs.scipy.org/doc/numpy-1.11.0/reference/generated/numpy.random.randint.html

* test_multiprocessing.py remove extra parens
2017-06-20 10:18:28 -07:00
Taehoon Lee 3d9428d344 Increase test coverage (#7037) 2017-06-19 12:12:50 -07:00
Rik Nijessen e0543fbfc8 throw an error when receiving empty batch, instead of returning nans at the end (#7038) 2017-06-19 11:23:41 -07:00
Stefan Schweter 767846e642 fix url to LSTM paper (#7025) 2017-06-18 15:59:05 -07:00
Andrey M d852c2d772 Replace plot_loss_callback example with json_logging_callback (#4116) (#6941)
The original plotting example doesn't work and a working version is somewhat too involved for a lambda.
2017-06-18 14:21:39 -07:00
Elliot Saba ff45159b69 Rename tensorboard histogram names to silence warnings (#7017) 2017-06-17 18:22:58 -07:00
Taehoon Lee 7766ab341f Speed up Theano tests (#7011) 2017-06-17 16:26:07 -07:00
François Chollet 4135aeebc4 Revert "Avoid DeprecationWarning from inspect.getargspec (#6817)" (#7018)
This reverts commit ced84c4b42.
2017-06-16 20:47:14 -07:00
Chris ced84c4b42 Avoid DeprecationWarning from inspect.getargspec (#6817)
* Utility function to check if a callable has a given keyword argument

* Replace uses of getargspec with the new has_arg function

Not changing keras.backend, because that gives ImportErrors due to
a circular import (conv_utils uses the backend, and is imported
before generic_utils in utils/__init__.py)

Not changing keras.utils.test_utils, because that change exposes
(what looks to me like) a latent bug

* Added unit tests for the has_arg function

* Replace incorrect use of getargspec in test_utils.py

The previous code would always fail to detect the 'weights' argument.
Simply replacing getargspec would cause the tests for some of the legacy
layers to fail because the passed 'weights' argument is bad.

Instead, I have added a check for whether the passed `weights` array
is empty, this avoids tripping the bug.

* Replacing getargspec with has_arg in the backend modules

This requires reordering imports to avoid errors caused by
conv_utils trying to import the backend, the backend wanting to
import generic_utils, and utils/__init__.py listing conv_utils
before generic_utils.
2017-06-16 15:09:25 -07:00
Zafarali Ahmed 8d5b2ce60c Add example to compare RELU with SELU (#6990)
* Add exampe to compare RELU with SELU fchollet/keras#6924

* Add header description

* Add axes labels

* Increase size of MLP #6990

* Reduce network size, reduce dropout rate, reduce dense units

* Reduce network size, add recommendations to reduce overfitting

* Encapsulate hyperparameters and create generic network builder

* Rename file to be more descriptive

* Add @tboquet's suggestion to export to png #6990

* Docstring clean-up

* Change optimizer to sgd, increase epochs

* Update docstrings

* Fix PEP8
2017-06-16 15:00:16 -07:00
Andrew Hundt c0f0b660a6 mean_square_error => mean_squared_error (#7015)
training.py `'mean_squared_error'` was misspelled as `'mean_square_error'`.
2017-06-16 13:01:31 -07:00
Olli Huotari d3c33613a1 Keras 2 _*generator displaying warning always about semantic changes from Keras 1 (#7001)
* Warn always about semantic changes if having keras1 args in *_generator calls.

* modified api upgrade warning message to be more detailed

* minor fix to pep8 syntax
2017-06-16 12:48:44 -07:00
Mako 5ca5699b00 Fixed some descriptions in backend (#6778)
* Fix to use floatx as argument in set_floatx

* Add line break

* Change to lower case

* Use 'x' as in moving_average_update description

* Fix to drop duplicate in one_hot Returns

* The foldr Returns convert to foldl itself

* Add back quote

* Add back quote

* Rebase and integrate comment on one-hot
2017-06-16 11:12:14 -07:00
Daniel Høyer Iversen be6503a8a8 Add space in error message 2017-06-16 10:47:40 -07:00
Yu-Yang c73ba916f6 Fix model loading for LeakyReLU layer (#7010) 2017-06-16 09:12:18 -07:00
Andrew Hundt e1c3988198 "here" links are difficult for individuals that need a screen reader for accessibility. (#6976)
* links named "here" are difficult for individuals that need a screen reader for accessibility.

* line length
2017-06-15 21:30:39 -07:00
Francois Chollet f65a56fb65 Exclude CNTK from TimeDistributed learning phase test 2017-06-14 16:09:52 -07:00
Francois Chollet 00a2724260 Merge branch 'EntilZha-master' 2017-06-14 14:51:49 -07:00
Francois Chollet a625fcde5c Add learning phase support for TimeDistributed 2017-06-14 14:51:06 -07:00
Francois Chollet 73f374ec67 Merge branch 'master' of https://github.com/EntilZha/keras into EntilZha-master 2017-06-14 14:39:26 -07:00
Rizky Luthfianto 21cf50734a add Scaled Exponential Linear Unit activation (#6924)
* add Scaled Exponential Linear Unit activation

* selu: hardcode alpha and scale variable

* add AlphaDropout (from SELU), K.floor backend function, and tests

* move AlphaDropout from core layers to noise layers

* fix pep8 and tensorflow backend failure

* undo add (delete) K.floor on backends

* undo add (delete): selu in check_single_tensor_operation

* [skip ci] edit docstring

remove `alpha` and `scale` from docstring

* add(initializers): selu_normal

* fix: use 'q' instead of 'rate'

* [skip ci] update comment

* feat(AlphaDropout): add 'noise_shape' param back

* add SpatialAlphaDropout1D layer

* [skip ci] update comment

* [skip ci] remove unnecessary check

* update equation

* remove spatialalphadropout test

* fix(AlphaDropout): add get_config method

* [skip ci] s/selu_normal/lecun_normal

* [skip ci] fix docstring to LeCun normal init
2017-06-14 11:38:09 -07:00
Taehoon Lee 4a6f06f06d Increase test coverage (#6765)
* Increase test coverage

* Move sequence util and fix merge conflict
2017-06-14 09:34:15 -07:00
Simon Brugman 295e4f8064 Update lstm_benchmark.py (#6966)
Removed typo
2017-06-13 11:13:21 -07:00
td2014 f4cb890024 Minor typo correction in faq.md (#6964)
* Minor typo in FAQ corrected

* Cleanup of other instances of filed typo in faq.md
2017-06-12 17:19:58 -07:00
Leoyzen cd943231d1 Generator should use Process Lock when pickle safe instead of Threading Lock (#6911)
* Fix the issue that when n can be mod by batch_size, the shuffle never happened

* Ensure generator lock will be process version instead of threading lock

* Add refs and comments of training generator lock

* Update comment
2017-06-12 13:59:45 -07:00
Chris f7b925a893 Use the pytest tmpdir fixture (#6901)
* Use the pytest tmpdir fixture (#6881)

* Run test_data_utils in a temporary directory

* Check output using os.path.isdir or os.path.isfile instead of os.path.exists

* Use the tmpdir fixture instead of mkdtemp

* Use in_tmpdir fixture when writing files in tests

... to avoid leaving files in the repository when tests fail, and also to
avoid the possibility of race conditions when several tests try to access
the same file.
2017-06-12 13:05:40 -07:00
Gleb Sidora 5d63ab4251 More descriptive message when user specifies non-existing metric for early stopping (#6954) 2017-06-12 13:04:44 -07:00
Francois Chollet d4b618bf23 Prepare new PyPI release. 2.0.5 2017-06-12 11:46:21 -07:00
Taehoon Lee 5012678e17 Fix typos (#6949) 2017-06-11 17:22:16 -07:00
Chen 11d9c995cc fixes #3859 clipnorm tensorflow (#6859)
* make clipnorm work with embeddings layer

* test for embedding + clipnorm

* update embedding_with_clipnorm test nb_epoch to epochs
2017-06-10 12:08:04 -07:00
GPhilo d92fab69a2 Parallel directory iterator initialization (#6890)
* added parallel counting of sample files when initializing DirectoryIterator

* Updated to actually run in parallel.

* Added parallel generation of the filenames and labels lists

* Added documentation and removed commented-out code

* style fixes

* changes discussed in pull request

* Removed trailing spaces

* Switching to thread pool

* fixed broken import
2017-06-09 19:41:44 -07:00
Martin Hallén 19463a19b8 Fine-tuning InceptionV3: Correct number of layers for two last inception blocks. (#6918) 2017-06-09 17:54:06 -07:00
Tang, Cheng ca1122fe80 update with more meaningful error message for CNTK backend (#6915)
* update with more meaningful error message

* fix unclear error message

* fix message format issues.
2017-06-09 13:05:57 -07:00
Jan Zikes 7fc707e13e Fix comments for binary_crossentropy and sparse_crossentropy. (#6919) 2017-06-09 10:55:40 -07:00
Maxim Grechkin 846d25ab97 fix a bug when model.fit assumed that x[0] has len, not true for sparse matrices (#6916) 2017-06-08 21:20:00 -07:00
Erik Smistad 8c0a8b4b04 Use batch_input_shape in input layer even if input_tensor is set (#6883) 2017-06-07 12:35:35 -07:00
Daniel Høyer Iversen 1b1e09a366 Remove duplicated batch_set_value in cntk_backend (#6878) 2017-06-07 00:00:25 -07:00
Taehoon Lee fd427b8cdb Fix typos (#6879) 2017-06-07 00:00:11 -07:00
Somshubra Majumdar 53303fdb10 Improvements to style transfer as discussed in https://github.com/fchollet/keras/pull/6872 (#6877) 2017-06-06 23:40:32 -07:00
fchollet 720ed1adc4 Update README.md 2017-06-06 23:09:41 -07:00
fchollet 43e418d1d2 Deflake TensorBoard callback tests. 2017-06-06 23:08:48 -07:00
Cheng Tang 75d9415c82 Add CNTK backend. 2017-06-06 23:03:04 -07:00
Francois Chollet 552978dc58 Allow arbitrary channel dimensions in ImageDataGenerator 2017-06-06 16:29:08 -07:00