Update doc re: layer reconstruction
@@ -5,11 +5,21 @@ All Keras layers have a number of methods in common:
- `layer.get_weights()`: returns the weights of the layer as a list of Numpy arrays.
- `layer.set_weights(weights)`: sets the weights of the layer from a list of Numpy arrays (with the same shapes as the output of `get_weights`).
- `layer.get_config()`: returns a dictionary containing the configuration of the layer. The layer can be reinstantiated from its config via:
+
+```python
+layer = Dense(32)
+config = layer.get_config()
+reconstructed_layer = Dense.from_config(config)
+```
+
+Or:
+
```python
from keras.utils.layer_utils import layer_from_config
config = layer.get_config()
-layer = layer_from_config(config)
+layer = layer_from_config({'class_name': layer.__class__.__name__,
+ 'config': config})
```
If a layer has a single node (i.e. if it isn't a shared layer), you can get its input tensor, output tensor, input shape and output shape via:
