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

Shared approximation method enum for activation functions. More...

#include <string_view>

Namespaces

namespace  Mila
 Mila main API namespace.

Enumerations

enum class  Mila::Dnn::ApproximationMethod { Exact , Tanh , Sigmoid }
 Approximation methods usable by activation functions. More...

Functions

constexpr std::string_view Mila::Dnn::ApproximationMethodToString (ApproximationMethod m) noexcept
 Convert ApproximationMethod to a short string.

Detailed Description

Shared approximation method enum for activation functions.

Export a small enum and helper to-string for reuse by GELU, SwiGLU and others.

Enumeration Type Documentation

◆ ApproximationMethod

enum class Mila::Dnn::ApproximationMethod
exportstrong

Approximation methods usable by activation functions.

Enumerator
Exact 

Exact implementation using erf.

Tanh 

Fast tanh-based approximation.

Sigmoid 

Sigmoid-based approximation.

Function Documentation

◆ ApproximationMethodToString()

std::string_view Mila::Dnn::ApproximationMethodToString ( ApproximationMethod m)
constexprexportnoexcept

Convert ApproximationMethod to a short string.

Returns a constexpr std::string_view suitable for logging/serialization.