softmaxLayer — Create a softmax layer object.
softmaxLayer(Name, Value, ...) stores softmax layer metadata.
Syntax
layer = softmaxLayer(Name, Value)Inputs
Name, Value- Type
Any- Required
- Variadic
- Description
- Paired, layer-specific recognized property names and values; duplicate names are invalid.
Returns
layer- Type
Any- Description
- Host layer metadata object with the named runtime class.
Errors
RunMat:deepLearning:InvalidInput- When
- A required layer size, numeric alpha, or name-value option is invalid, or more than one output is requested.
- Message
deep learning layer received invalid input
Layer metadata
The object records the softmax layer kind and optional metadata.
The result is a host layer object. Optional name-value arguments may be omitted to use defaults. Name and Description are text. Recognized name-value options are stored under their canonical property names; unknown, duplicate, and cross-layer option names are rejected. A layer graph can retain recognized options that are not yet executable by forward or training.
Placement and validation
The constructor validates required sizes and option syntax before downloading resident controls. Numeric and logical controls needed for validation may be gathered; data, learnables, recurrent state, and initializer captures retain their original storage and provider ownership. The result is a host metadata object, not a GPU kernel invocation. Invalid host text options reject without downloading earlier resident values. Execution validates parameter geometry and provider support separately.
Structural sizes are stored in double-valued layer properties. Typed integer sizes must survive that conversion exactly: the exact uint64 value 9,007,199,254,740,993 is rejected, while an aligned exactly representable larger integer remains admissible if it fits the host size range. This boundary does not imply that a network with that many units can be allocated.
Example
Create and inspect a layer
layer = softmaxLayer('Name', 'prob'); fprintf('%s\n', layer.Name);Expected output:
probUsing softmaxLayer with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how softmaxLayer changes the result.
Run a small softmaxLayer example, explain the result, then change one input and compare the output.
FAQ
Does constructing the layer run a model or GPU kernel?⌄
No. This call creates a host layer object; model execution is a separate operation.
Are all recognized layer options implemented by forward?⌄
No. Constructor acceptance records canonical options but does not establish an executable network form. Pending operational options require separate execution admission.
Related Deep Learning functions
adamupdate · analyzeNetwork · bilstmLayer · classificationLayer · combvec · convolution1dLayer · crossentropy · dlarray · dlarray.minus · dlarray.mtimes · dlarray.plus · dlarray.rdivide · dlarray.sum · dlarray.times · dlfeval · dlgradient · dlnetwork · dlupdate · eluLayer · exportONNXNetwork · featureInputLayer · forward · fullyConnectedLayer · get.Learnables · get.State · globalAveragePooling1dLayer · layerGraph · layerNormalizationLayer · lstmLayer · padsequences · regressionLayer · reluLayer · sequenceInputLayer · set.Learnables · set.State · trainingOptions · trainnet · trainNetwork
Source you can read
Every RunMat function's source is public. Read exactly how softmaxLayer is executed, line by line, in Rust.
- View the source for softmaxLayer in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.