Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Dnn.Components.Softmax Module Reference

Exported Modules

module  Compute.DeviceTypeTraits
module  Dnn.TensorTypes
module  Compute.OperationTraits
module  Compute.MemoryResource
module  Dnn.TensorDataType
module  Compute.UnaryOperation
module  Compute.ExecutionContextFactory
module  Dnn.TensorDataTypeTraits
module  Serialization.ModelArchive
module  Compute.IExecutionContext
module  Dnn.Components.SoftmaxConfig
module  Dnn.ComponentType
module  Dnn.Component
module  Compute.CpuMemoryResource
module  Compute.Device
module  Compute.DeviceId
module  Dnn.Tensor
module  Compute.DeviceType
module  Serialization.Mode
module  Compute.ExecutionContext
module  Dnn.ITensor

Classes

class  Mila::Dnn::Softmax< TDeviceType, TPrecision >
 Softmax activation module (device-templated). More...

Typedefs

using ComponentBase = Component<TDeviceType, TPrecision>
using MR = typename DeviceTypeTraits<TDeviceType>::memory_resource
using OpType = typename OperationTraits<OperationType::SoftmaxOp, TDeviceType, TPrecision>::type
using TensorType = Tensor<TPrecision, MR>

Functions

 Softmax (const std::string &name, const SoftmaxConfig &config, std::optional< DeviceId > device_id=std::nullopt)
 ~Softmax () override=default
void backward (const ITensor &input, const ITensor &output_grad, ITensor &input_grad)
 Backward pass - delegates to backend operation.
void createOperation ()
 Create the backend compute operation.
void forward (const ITensor &input, ITensor &output)
 Forward pass - delegates to backend operation.
int64_t getAxis () const noexcept
 Get the softmax axis.
DeviceId getDeviceId () const override
 Get the device identifier for this module.
std::vector< ITensor * > getGradients () const override
 Get parameter gradient tensors.
MemoryStats getMemoryStats () const override
 Return the current memory allocation breakdown for this component.
std::vector< ITensor * > getParameters () const override
 Get trainable parameter tensors.
const ComponentType getType () const override
 Get the component type identifier.
void onBuilding (const BuildContext &build_config) override
 Hook invoked during build() to initialize component with input shape.
void onExecutionContextSet () override
 Get the configuration.
void onTrainingModeChanging (TrainingMode training_mode) override
 Hook invoked when training mode changes.
size_t parameterCount () const override
 Number of trainable parameters.
void save_ (ModelArchive &archive, SerializationMode mode) const override
 Persist module state to archive.
void synchronize () override
 Wait for all asynchronous work submitted by this module to complete.
std::string toString () const override
 Generate human-readable description of the module.
void validateInputShape (const ITensor &input) const
 Validate input shape for softmax operation.
void validateInputShape (const shape_t &input_shape) const
 Validate input shape for softmax operation.

Variables

SoftmaxConfig config_
std::shared_ptr< OpTypeoperation_ { nullptr }
std::unique_ptr< IExecutionContextowned_exec_context_ { nullptr }

Files

file  /__w/Mila/Mila/Mila/Src/Dnn/Components/Normalization/Softmax.ixx
 Device-templated Softmax activation module.