Skip to content

Commit

Permalink
functional API intermediate output doc in faq
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemcdonald committed May 10, 2016
1 parent 8327b37 commit c8452ad
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/templates/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,21 @@ layer_output = get_3rd_layer_output([X, 0])[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).
Another more flexible way of getting output from intermediate layers is to use the [functional API](/getting-started/functional-api-guide). For example, if you have created an autoencoder for MNIST:

```python
inputs = Input(shape=(784,))
encoded = Dense(32, activation='relu')(inputs)
decoded = Dense(784)(encoded)
model = Model(input=inputs, output=decoded)
```

After compiling and training the model, you can get the output of the data from the encoder like this:

```python
encoder = Model(input=inputs, output=encoded)
X_encoded = encoder.predict(X)
```

---

Expand Down

0 comments on commit c8452ad

Please sign in to comment.