Skip to content

Commit f85695c

Browse files
patyorkfchollet
authored andcommitted
FAQ updates (keras-team#5281)
* FAQ updates * spelling/grammar * more detail about a Batch * Update FAQ
1 parent 66f2613 commit f85695c

File tree

1 file changed

+18
-0
lines changed
  • docs/templates/getting-started

1 file changed

+18
-0
lines changed

docs/templates/getting-started/faq.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- [How should I cite Keras?](#how-should-i-cite-keras)
44
- [How can I run Keras on GPU?](#how-can-i-run-keras-on-gpu)
5+
- [What does \["sample", "batch", "epoch"\] mean?](#what-does-sample-batch-epoch-mean)
56
- [How can I save a Keras model?](#how-can-i-save-a-keras-model)
67
- [Why is the training loss much higher than the testing loss?](#why-is-the-training-loss-much-higher-than-the-testing-loss)
78
- [How can I obtain the output of an intermediate layer?](#how-can-i-obtain-the-output-of-an-intermediate-layer)
@@ -31,6 +32,8 @@ Please cite Keras in your publications if it helps your research. Here is an exa
3132
}
3233
```
3334

35+
---
36+
3437
### How can I run Keras on GPU?
3538

3639
If you are running on the TensorFlow backend, your code will automatically run on GPU if any available GPU is detected.
@@ -54,6 +57,21 @@ theano.config.floatX = 'float32'
5457

5558
---
5659

60+
### What does \["sample", "batch", "epoch"\] mean?
61+
62+
Below are some common definitions that are necessary to know and understand to correctly utilize Keras:
63+
64+
- **Sample**: one element of a dataset.
65+
- *Example:* one image is a **sample** in a convolutional network
66+
- *Example:* one audio file is a **sample** for a speech recognition model
67+
- **Batch**: a set of *N* samples. The samples in a **batch** are processed independently, in parallel. If training, a batch results in only one update to the model.
68+
- A **batch** generally approximates the distribution of the input data better than a single input. The larger the batch, the better the approximation; however, it is also true that the batch will take longer to processes and will still result in only one update. For inference (evaluate/predict), it is recommended to pick a batch size that is as large as you can afford without going out of memory (since larger batches will usually result in faster evaluating/prediction).
69+
- **Epoch**: an arbitrary cutoff, generally defined as "one pass over the entire dataset", used to separate training into distinct phases, which is useful for logging and periodic evaluation.
70+
- When using `evaluation_data` or `evaluation_split` with the `fit` method of Keras models, evaluation will be run at the end of every **epoch**.
71+
- Within Keras, there is the ability to add [callbacks](https://keras.io/callbacks/) specifically designed to be run at the end of an **epoch**. Examples of these are learning rate changes and model checkpointing (saving).
72+
73+
---
74+
5775
### How can I save a Keras model?
5876

5977
*It is not recommended to use pickle or cPickle to save a Keras model.*

0 commit comments

Comments
 (0)