FlattenLayer - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

DeepLearning

 FlattenLayer
 flatten layer

 Calling Sequence FlattenLayer(opts)

Parameters

 opts - (optional) one or more keyword options described below

Options

 • channels : one of first, last, or auto.
 Specifies the ordering of dimensions in the input. For details consult the TensorFlow documentation.
 • inputshape : list of integers or the symbol auto
 Shape of the input Tensor, not including the batch axis.
 With the default value auto, the shape is inferred. If inference is not possible, an error is issued.
 This option need only be specified when this layer is the first in a Sequential model.

Description

 • FlattenLayer(opts) creates a flattening neural network layer.
 • This function is part of the DeepLearning package, so it can be used in the short form FlattenLayer(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[FlattenLayer](..).

Details

 • The implementation of FlattenLayer uses tf.keras.layers.Flatten from the TensorFlow Python API. Consult the TensorFlow Python API documentation for tf.keras.layers.Flatten for more information.

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right)$
 $\left[{\mathrm{AddMultiple}}{,}{\mathrm{ApplyOperation}}{,}{\mathrm{BatchNormalizationLayer}}{,}{\mathrm{BidirectionalLayer}}{,}{\mathrm{BucketizedColumn}}{,}{\mathrm{CategoricalColumn}}{,}{\mathrm{Classify}}{,}{\mathrm{Concatenate}}{,}{\mathrm{Constant}}{,}{\mathrm{ConvolutionLayer}}{,}{\mathrm{DNNClassifier}}{,}{\mathrm{DNNLinearCombinedClassifier}}{,}{\mathrm{DNNLinearCombinedRegressor}}{,}{\mathrm{DNNRegressor}}{,}{\mathrm{Dataset}}{,}{\mathrm{DenseLayer}}{,}{\mathrm{DropoutLayer}}{,}{\mathrm{EinsteinSummation}}{,}{\mathrm{EmbeddingLayer}}{,}{\mathrm{Estimator}}{,}{\mathrm{FeatureColumn}}{,}{\mathrm{Fill}}{,}{\mathrm{FlattenLayer}}{,}{\mathrm{GRULayer}}{,}{\mathrm{GatedRecurrentUnitLayer}}{,}{\mathrm{GetDefaultGraph}}{,}{\mathrm{GetDefaultSession}}{,}{\mathrm{GetEagerExecution}}{,}{\mathrm{GetVariable}}{,}{\mathrm{GradientTape}}{,}{\mathrm{IdentityMatrix}}{,}{\mathrm{LSTMLayer}}{,}{\mathrm{Layer}}{,}{\mathrm{LinearClassifier}}{,}{\mathrm{LinearRegressor}}{,}{\mathrm{LongShortTermMemoryLayer}}{,}{\mathrm{MaxPoolingLayer}}{,}{\mathrm{Model}}{,}{\mathrm{NumericColumn}}{,}{\mathrm{OneHot}}{,}{\mathrm{Ones}}{,}{\mathrm{Operation}}{,}{\mathrm{Optimizer}}{,}{\mathrm{Placeholder}}{,}{\mathrm{RandomTensor}}{,}{\mathrm{ResetDefaultGraph}}{,}{\mathrm{Restore}}{,}{\mathrm{Save}}{,}{\mathrm{Sequential}}{,}{\mathrm{Session}}{,}{\mathrm{SetEagerExecution}}{,}{\mathrm{SetRandomSeed}}{,}{\mathrm{SoftMaxLayer}}{,}{\mathrm{SoftmaxLayer}}{,}{\mathrm{Tensor}}{,}{\mathrm{Variable}}{,}{\mathrm{Variables}}{,}{\mathrm{VariablesInitializer}}{,}{\mathrm{Zeros}}\right]$ (1)
 > $\mathrm{model}≔\mathrm{Sequential}\left(\left[\mathrm{ConvolutionLayer}\left(64,\left[3,3\right]\right),\mathrm{FlattenLayer}\left(\right)\right]\right)$
 ${\mathrm{model}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Model}}\\ {\mathrm{}}\end{array}\right]$ (2)
 > $\mathrm{model}:-\mathrm{Compile}\left(\right)$

Compatibility

 • The DeepLearning[FlattenLayer] command was introduced in Maple 2021.
 • For more information on Maple 2021 changes, see Updates in Maple 2021.

 See Also