The official account of WeChat
Flatten layer is implemented in Keras.layers.core . flatten() class.
effect:
Flatten layer is used to “flatten” the input, that is, to make the multi-dimensional input one-dimensional. It is often used in the transition from convolution layer to fully connected layer. Flatten does not affect the size of the batch.
example:
from keras.models import Sequential
from keras.layers.core import Flatten
from keras.layers.convolutional import Convolution2D
from keras.utils.vis_utils import plot_model
model = Sequential()
model.add(Convolution2D(64,3,3,border_mode="same",input_shape=(3,32,32)))
# now:model.output_shape==(None,64,32,32)
model.add(Flatten())
# now: model.output_shape==(None,65536)
plot_model(model, to_file='Flatten.png', show_shapes=True)
In order to better understand the function of flatten layer, I visualize this neural network, as shown in the figure below:
Read More:
- Keras saves save() and save in the model_ weights()
- [Keras] ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to
- AttributeError: module…ops‘ has no attribute ‘_TensorLike‘, ValueError: `updates` argument..eager
- tf.layers.conv1d Function analysis (one dimensional convolution)
- The principle of deformable convolution
- tf.contrib.layers .xavier_ Initializer function usage
- Build your own resnet18 network and load torch vision’s own weight
- Resolve importerror: cannot import name ‘TF_ utils’
- The usage details of SVM
- tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.
- Numpy realizes the forward propagation process of CNN
- onnx.onnx_cpp2py_export.checker.ValidationError
- Tensorflow 2.1.0 error resolution: failed call to cuinit: CUDA_ ERROR_ NO_ DEVICE: no CUDA-capable device is detected
- Tensorflow: How to use expand_Dim() to add dimensions
- In tensorflow tf.reduce_ Mean function
- Deep learning: derivation of sigmoid function and loss function
- Tensorflow in function tf.Print Method of outputting intermediate value
- Pytorch — nn.Sequential () module
- After the model is instantiated by keras, the result returns nonetype
- Tensorflow image random_ There seems to be something wrong with the shift function