corrected parameter for learning_phase (#2284)
This commit is contained in:
parent
d50f469c09
commit
66ebd2a843
8
docs/templates/getting-started/faq.md
vendored
8
docs/templates/getting-started/faq.md
vendored
@ -134,13 +134,15 @@ to pass the learning phase flag to your function:
|
|||||||
get_3rd_layer_output = K.function([model.layers[0].input, K.learning_phase()],
|
get_3rd_layer_output = K.function([model.layers[0].input, K.learning_phase()],
|
||||||
[model.layers[3].output])
|
[model.layers[3].output])
|
||||||
|
|
||||||
# output in train mode
|
# output in train mode = 0
|
||||||
layer_output = get_3rd_layer_output([X, 1])[0]
|
layer_output = get_3rd_layer_output([X, 0])[0]
|
||||||
|
|
||||||
# output in test mode
|
# output in test mode = 1
|
||||||
layer_output = get_3rd_layer_output([X, 1])[0]
|
layer_output = get_3rd_layer_output([X, 1])[0]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Another more flexible way of getting output from intermediate layers is to use the [functional API](/getting-started/functional-api-guide).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### How can I use Keras with datasets that don't fit in memory?
|
### How can I use Keras with datasets that don't fit in memory?
|
||||||
|
Loading…
Reference in New Issue
Block a user