Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Activation.Config.ixx File Reference

Configuration for the unified elementwise Activation component. More...

#include <stdexcept>
#include <string>
#include <string_view>
#include <sstream>
import Serialization.Metadata;
import Dnn.ApproximationMethod;
import Dnn.ActivationType;
import Dnn.ComponentConfig;
import Dnn.Component;

Classes

class  Mila::Dnn::ActivationConfig
 Configuration class for the elementwise Activation component. More...
 Type-safe metadata container for component serialization. More...

Namespaces

namespace  Mila
 Mila main API namespace.

Functions

constexpr bool Mila::Dnn::isElementwiseActivation (ActivationType type) noexcept
 True for the elementwise unary activations expressible by Activation.

Detailed Description

Configuration for the unified elementwise Activation component.

Carries the ActivationType as serializable architecture metadata plus the function-specific runtime scalars (LeakyReLU alpha, GELU approximation flavor). The component itself is specialized on a compile-time ActivationType TFn; this config is the data side of the config-describes / type-realizes split documented in Specifications/FfnAndMoE.md section 5. The model factory bridges the runtime enum to the compile-time instantiation.

Function Documentation

◆ isElementwiseActivation()

bool Mila::Dnn::isElementwiseActivation ( ActivationType type)
constexprexportnoexcept

True for the elementwise unary activations expressible by Activation.

Swiglu is the lone structural (gated) function in ActivationType; it lives in the GatedMLP/Swiglu component family, not here. None is the identity function and is a valid elementwise selection.