|
template<typename TInput = float, typename TOutput = TInput> |
using | Mila::Dnn::CpuSoftmax = Softmax< DeviceType::Cpu, TInput, TOutput > |
| Type alias for CPU-based softmax module with customizable tensor types.
|
|
template<typename TInput = float, typename TOutput = TInput> |
using | Mila::Dnn::CudaSoftmax = Softmax< DeviceType::Cuda, TInput, TOutput > |
| Type alias for CUDA-based softmax module with customizable tensor types.
|
|
using | ModuleBase = Module< TDeviceType, TInput, TOutput > |
| Alias for base module type.
|
|
using | MR = std::conditional_t< TDeviceType==DeviceType::Cuda, CudaMemoryResource, CpuMemoryResource > |
| Memory resource type used for tensors, selected based on device type.
|
|
|
| Softmax (const std::string &device_name, const SoftmaxConfig &config) |
| Constructs a new Softmax module with a device name.
|
|
| Softmax (std::shared_ptr< DeviceContext > device_context, const SoftmaxConfig &config) |
| Constructs a new Softmax module with a provided device context.
|
|
void | backward (const Tensor< TInput, MR > &input, const Tensor< TOutput, MR > &output_grad, Tensor< TInput, MR > &input_grad) |
| Performs the backward pass of the Softmax operation.
|
|
void | createOperation () |
| Creates the appropriate softmax operation for the current device.
|
|
void | forward (const Tensor< TInput, MR > &input, Tensor< TOutput, MR > &output) |
| Performs the forward pass of the softmax operation.
|
|
int64_t | getAxis () const |
| Gets the axis used for softmax computation.
|
|
void | load (ModelArchive &archive) override |
| Deserializes the module state from a ZIP archive.
|
|
size_t | parameterCount () const override |
| Gets the number of trainable parameters in this module.
|
|
void | save (ModelArchive &zip) const override |
| Serializes the module state to a ZIP archive.
|
|
std::string | toString () const override |
| Generates a string representation of this module's configuration.
|
|
|
OperationAttributes | attributes_ |
| Operation attributes and configuration.
|
|
SoftmaxConfig | config_ |
| Configuration for the Softmax module.
|
|
std::shared_ptr< UnaryOperation< TDeviceType, TInput, TOutput > > | operation_ { nullptr } |
| The operation that implements the softmax calculation.
|
|
std::vector< std::shared_ptr< Tensor< TOutput, MR > > > | output_state_ |
| Collection of output state tensors for caching.
|
|
std::vector< std::shared_ptr< Tensor< TInput, MR > > > | parameters_ |
| Collection of parameters for this module (empty for Softmax).
|
|