DeepLearning
DenseLayer
create dense layer
Calling Sequence
Parameters
Options
Description
Details
Examples
Compatibility
DenseLayer(units,opts)
units
-
positive integer
opts
one or more options as specified below
activation : string or symbol
Specifies the activation function to use, one of deserialize, elu, exponential, gelu, get, hard_sigmoid, linear, relu, selu, serialize, sigmoid, softmax, softplus, softsign, swish, or tanh. Default is linear, the identity function.
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.
usebias : truefalse
Specifies whether to use a bias vector. Default is true.
The DenseLayer(units, opts) command creates a dense neural network layer with the dimensionality of the output space equal to units.
This function is part of the DeepLearning package, so it can be used in the short form DenseLayer(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[DenseLayer](..).
The implementation of DenseLayer uses tf.keras.layers.Dense from the TensorFlow Python API. Consult the TensorFlow Python API documentation for tf.keras.layers.Dense for more information.
with⁡DeepLearning
AddMultiple,ApplyOperation,BatchNormalizationLayer,BidirectionalLayer,BucketizedColumn,CategoricalColumn,Classify,Concatenate,Constant,ConvolutionLayer,DNNClassifier,DNNLinearCombinedClassifier,DNNLinearCombinedRegressor,DNNRegressor,Dataset,DenseLayer,DropoutLayer,EinsteinSummation,EmbeddingLayer,Estimator,FeatureColumn,Fill,FlattenLayer,GRULayer,GatedRecurrentUnitLayer,GetDefaultGraph,GetDefaultSession,GetEagerExecution,GetVariable,GradientTape,IdentityMatrix,LSTMLayer,Layer,LinearClassifier,LinearRegressor,LongShortTermMemoryLayer,MaxPoolingLayer,Model,NumericColumn,OneHot,Ones,Operation,Optimizer,Placeholder,RandomTensor,ResetDefaultGraph,Restore,Save,Sequential,Session,SetEagerExecution,SetRandomSeed,SoftMaxLayer,SoftmaxLayer,Tensor,Variable,Variables,VariablesInitializer,Zeros
v1≔Vector⁡8,i↦i,datatype=float8
v1≔1.2.3.4.5.6.7.8.
v2≔Vector⁡8,−1.0,1.0,5.0,11.0,19.0,29.0,41.0,55.0,datatype=float8
v2≔−1.1.5.11.19.29.41.55.
model≔Sequential⁡DenseLayer⁡2,inputshape=1
model≔DeepLearning Model<keras.src.engine.sequential.Sequential object at 0x7f19f0d18290>
model:-Compile⁡optimizer=sgd,loss=mean_squared_error
model:-Fit⁡v1,v2,epochs=500
<Python object: <keras.src.callbacks.History object at 0x7f19e7f7c110>>
model:-Evaluate⁡10,30
loss=849.608520507812,accuracy=0.
The DeepLearning[DenseLayer] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
DeepLearning Overview
Download Help Document