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

# Online Help

###### All Products    Maple    MapleSim

DeepLearning/Model/Evaluate

evaluate model object

 Calling Sequence mdl:-Evaluate(x, y, opts)

Parameters

 mdl - a Model object x - (optional) list, Array, DataFrame, DataSeries, Matrix, or Vector; input data y - (optional) list, Array, DataFrame, DataSeries, Matrix, or Vector; target data

Options

 • batchsize = posint or none
 Number of samples per gradient update. If unspecified, batchsize will default to 32.
 • steps = integer or none
 Total number of steps (batches of samples) before declaring the evaluation round finished. Ignored with the default value of none.

Description

 • Evaluate evaluates a Model on a particular set of inputs.

Details

 • The implementation of Evaluate uses the evaluate method from tf.keras.Model in the TensorFlow Python API. Consult the TensorFlow Python API documentation for tf.keras.Model for more information on its use during TensorFlow computations.

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{v1}≔\mathrm{Vector}\left(8,i→i,\mathrm{datatype}={\mathrm{float}}_{8}\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1.}\\ {2.}\\ {3.}\\ {4.}\\ {5.}\\ {6.}\\ {7.}\\ {8.}\end{array}\right]$ (2)
 > $\mathrm{v2}≔\mathrm{Vector}\left(8,\left[-1.0,1.0,5.0,11.0,19.0,29.0,41.0,55.0\right],\mathrm{datatype}={\mathrm{float}}_{8}\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{-1.}\\ {1.}\\ {5.}\\ {11.}\\ {19.}\\ {29.}\\ {41.}\\ {55.}\end{array}\right]$ (3)
 > $\mathrm{model}≔\mathrm{Sequential}\left(\left[\mathrm{DenseLayer}\left(1,\mathrm{inputshape}=\left[1\right]\right)\right]\right)$
 ${\mathrm{model}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Model}}\\ {\mathrm{}}\end{array}\right]$ (4)
 > $\mathrm{model}:-\mathrm{Compile}\left(\mathrm{optimizer}="sgd",\mathrm{loss}="mean_squared_error"\right)$
 > $\mathrm{model}:-\mathrm{Fit}\left(\mathrm{v1},\mathrm{v2},\mathrm{epochs}=500\right)$
 ${">"}$ (5)
 > $\mathrm{model}:-\mathrm{Evaluate}\left(\left[10\right],\left[30\right]\right)$
 $\left\{{"loss"}{=}{1036.85949707031}{,}{"accuracy"}{=}{0.}\right\}$ (6)

Compatibility

 • The DeepLearning/Model/Evaluate command was introduced in Maple 2021.
 • For more information on Maple 2021 changes, see Updates in Maple 2021.

 See Also