 SoftMax - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Tensors : Operations on Tensors : DeepLearning/Tensor/SoftMax

SoftMax

compute max over entries of a Tensor

SoftMin

compute min over entries of a Tensor

SoftPlus

compute sum over entries of a Tensor

SoftProduct

compute product over entries of a Tensor

 Calling Sequence SoftMax(t,opts) SoftMaxCrossEntropyWithLogits(t,opts) SoftPlus(t,opts)

Parameters

 t - Tensor opts - zero or more options as specified below

Options

 • axis=list(integer) or integer

The value of option axis is an integer or list of integers which describes which axis of the input Tensor to reduce across.

 • name=string

The value of option name specifies an optional name for this Tensor, to be displayed in output and when visualizing the dataflow graph.

Description

 • The SoftMax(t,opts) command computes the softmax function of a Tensor,
 • The SoftMaxCrossEntropyWithLogits(t,labels=x,logits=y) command computes the softmax function with labels x and logits y.
 • The SoftPlus(t,opts) command computes log(exp(t)+t).

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $W≔\mathrm{Variable}\left(\left[\left[29.,93.,-29.\right],\left[-12.,-80.,96.\right],\left[96.,-92.,89.\right]\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${W}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: \left[3, 3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)
 > $\mathrm{SoftMax}\left(W\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Softmax:0}}\\ {\mathrm{Shape: \left[3, 3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (2)
 > $\mathrm{SoftPlus}\left(W,\mathrm{name}="sp"\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: sp:0}}\\ {\mathrm{Shape: \left[3, 3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)

Compatibility

 • The SoftMax, SoftMin, SoftPlus and SoftProduct commands were introduced in Maple 2018.