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

Definition of connection function types used by the Mila DNN library. More...

#include <string>
#include <stdexcept>

Namespaces

namespace  Mila
 Mila main API namespace.

Enumerations

enum class  Mila::Dnn::ConnectionType { Addition }
 Connection types supported by residual and skip-connection components. More...

Functions

std::string Mila::Dnn::connectionTypeToString (ConnectionType type)
 Converts a ConnectionType enum value to its string representation.
ConnectionType Mila::Dnn::stringToConnectionType (const std::string &name)
 Converts a string to its corresponding ConnectionType enum value.

Detailed Description

Definition of connection function types used by the Mila DNN library.

Enumeration Type Documentation

◆ ConnectionType

enum class Mila::Dnn::ConnectionType
exportstrong

Connection types supported by residual and skip-connection components.

Defines how the input and transformed output are combined in residual and skip-connection architectures.

Currently only Addition is implemented. Other types (multiplication, concatenation) may be added in the future.

Enumerator
Addition 

Element-wise addition (y = x + F(x)).

Function Documentation

◆ connectionTypeToString()

std::string Mila::Dnn::connectionTypeToString ( ConnectionType type)
inlineexport

Converts a ConnectionType enum value to its string representation.

Parameters
typeThe ConnectionType to convert
Returns
std::string The string representation of the connection type

Example:

auto name = connectionTypeToString(ConnectionType::Addition);
// name == "Addition"

◆ stringToConnectionType()

ConnectionType Mila::Dnn::stringToConnectionType ( const std::string & name)
inlineexport

Converts a string to its corresponding ConnectionType enum value.

Parameters
nameThe string representation of a connection type
Returns
ConnectionType The corresponding enum value
Exceptions
std::invalid_argumentif the string doesn't match any known connection type

Example:

auto type = stringToConnectionType("Addition");
// type == ConnectionType::Addition