Skip to content

Commit

Permalink
Touch-ups in examples and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Jul 5, 2015
1 parent b1d9448 commit 35bcd5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions docs/sources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ model.fit(X_train, Y_train, nb_epoch=5, batch_size=32)

Alternatively, you can feed batches to your model manually:
```python
model.train(X_batch, Y_batch)
model.train_on_batch(X_batch, Y_batch)
```

Evaluate your performance in one line:
Expand All @@ -81,7 +81,7 @@ classes = model.predict_classes(X_test, batch_size=32)
proba = model.predict_proba(X_test, batch_size=32)
```

Building a network of LSTMs, a deep CNN, a word2vec embedder or any other model is just as fast. The ideas behind deep learning are simple, so why should their implementation be painful?
Building a network of LSTMs, a deep CNN, a Neural Turing Machine, a word2vec embedder or any other model is just as fast. The ideas behind deep learning are simple, so why should their implementation be painful?

Have a look at the [examples](examples.md).

Expand Down Expand Up @@ -116,15 +116,15 @@ Keras welcomes all contributions from the community.
- Keep a pragmatic mindset and avoid bloat. Only add to the source if that is the only path forward.
- New features should be documented. Make sure you update the documentation along with your Pull Request.
- The documentation for every new feature should include a usage example in the form of a code snippet.
- All changes should be tested. A formal test process will be introduced very soon.
- All changes should be tested. Make sure any new feature you add has a corresponding unit test.
- Even if you don't contribute to the Keras source code, if you have an application of Keras that is concise and powerful, please consider adding it to our collection of [examples](https://github.com/fchollet/keras/tree/master/examples).


## Why this name, Keras?

Keras (κέρας) means _horn_ in Greek. It is a reference to a literary image from ancient Greek and Latin literature, first found in the _Odyssey_, where dream spirits (_Oneiroi_, singular _Oneiros_) are divided between those who deceive men with false visions, who arrive to Earth through a gate of ivory, and those who announce a future that will come to pass, who arrive through a gate of horn. It's a play on the words κέρας (horn) / κραίνω (fulfill), and ἐλέφας (ivory) / ἐλεφαίρομαι (deceive).

Keras was developed as part of the research effort of project ONEIROS (Open-ended Neuro-Electronic Intelligent Robot Operating System).
Keras was developed as part of the research effort of project __ONEIROS__ (*Open-ended Neuro-Electronic Intelligent Robot Operating System*).

> _"Oneiroi are beyond our unravelling --who can be sure what tale they tell? Not all that men look for comes to pass. Two gates there are that give passage to fleeting Oneiroi; one is made of horn, one of ivory. The Oneiroi that pass through sawn ivory are deceitful, bearing a message that will not be fulfilled; those that come out through polished horn have truth behind them, to be accomplished for men who see them."_
Expand Down
6 changes: 3 additions & 3 deletions docs/sources/layers/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ model.add(RepeatVector(2)) # output shape: (nb_samples, 2, 10)
keras.layers.core.Merge(models, mode='sum')
```

Merge the output of a list of models into a single tensor, following one of two modes: `sum` or `concat`.
Merge the output of a list of layers (or containers) into a single tensor, following one of two modes: `sum` or `concat`.

- __Arguments__:
- __models__: List of `Sequential` models.
- __mode__: String, one of `{'sum', 'concat'}`. `sum` will simply sum the outputs of the models (therefore all models should have an output with the same shape). `concat` will concatenate the outputs along the last dimension (therefore all models should have an output that only differ along the last dimension).
- __layers__: List of layers or [containers](/layers/containers/).
- __mode__: String, one of `{'sum', 'concat'}`. `sum` will simply sum the outputs of the layers (therefore all layers should have an output with the same shape). `concat` will concatenate the outputs along the last dimension (therefore all layers should have an output that only differ along the last dimension).

- __Example__:

Expand Down
6 changes: 2 additions & 4 deletions examples/kaggle_otto_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pandas as pd
np.random.seed(1337) # for reproducibility

from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
Expand All @@ -17,7 +18,7 @@
This demonstrates how to reach a score of 0.4890 (local validation)
on the Kaggle Otto challenge, with a deep net using Keras.
Compatible Python 2.7-3.4
Compatible Python 2.7-3.4. Requires Scikit-Learn and Pandas.
Recommended to run on GPU:
Command: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python kaggle_otto_nn.py
Expand All @@ -35,8 +36,6 @@
Get the data from Kaggle: https://www.kaggle.com/c/otto-group-product-classification-challenge/data
'''

np.random.seed(1337) # for reproducibility

def load_data(path, train=True):
df = pd.read_csv(path)
X = df.values.copy()
Expand Down Expand Up @@ -121,4 +120,3 @@ def make_submission(y_prob, ids, encoder, fname):

proba = model.predict_proba(X_test)
make_submission(proba, ids, encoder, fname='keras-otto.csv')

2 changes: 1 addition & 1 deletion examples/mnist_irnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
arXiv:1504.00941v2 [cs.NE] 7 Apr 201
http://arxiv.org/pdf/1504.00941v2.pdf
Optimizer is replaced with RMSprop which give more stable and steady
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
Expand Down

0 comments on commit 35bcd5a

Please sign in to comment.