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:
- Deep learning: derivation of sigmoid function and loss function
- Summary of Python deep learning packages
- caffe deep learning [three] compilation error: fatal error: hdf5.h: No such file or directory compilation terminated.
- SCSS use / deep / error, the latest usage: v-deep
- Android learning notes 03: some problems and solutions in the learning process
- Error in tensorflow loading model valueerror: unknown layer: functional
- OpenGL learning notes and other learning thinking
- In machine learning, the prediction errors in sklearn, such as mean square error, etc
- To solve the problem that deep in 20.2 system cannot save and transform the format of typora, and provide an effective installation method of typora
- Problems in learning Aidl
- Some problems and solutions in learning opengl in vs2017
- Installing sklearn (scikit learn) module related to Python machine learning in Windows
- Problems and solutions in learning opengl
- Some pitfalls in OpenGL learning
- Record the problems encountered in OpenGL learning
- Deep understanding of async await asynchronous programming synchronization
- Mistakes in learning Flink programming
- Problems in the second day of Android learning
- How to Configure Inter VLAN Routing on Layer 3 Switches?
- [Solved] ONNXImporter::handleNode DNN/ONNX和create layer “onnx::Gather_384“ of type “NonMaxSuppression“