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

Architecture identity for top-level model networks. More...

#include <string>
#include <string_view>
#include <cctype>

Namespaces

namespace  Mila
 Mila main API namespace.

Enumerations

enum class  Mila::Dnn::ModelType : int {
  Unknown = 0 , Gpt2 , Llama , Gemma ,
  Mistral , Bert
}
 Canonical list of framework-known model architectures. More...

Functions

ModelType Mila::Dnn::modelTypeFromString (std::string_view s) noexcept
 Parse a case-insensitive architecture name into a ModelType.
std::string Mila::Dnn::toString (ModelType t) noexcept
 Convert a ModelType to its canonical architecture name.

Detailed Description

Architecture identity for top-level model networks.

ModelType names the model family (GPT-2, LLaMA, Gemma, ...). It is a distinct axis from ComponentType, which names the structural kind of a component (Linear, Transformer block, Network). A LlamaTransformer and a GemmaTransformer are both ComponentType::Network; they differ by ModelType. Keeping the two axes separate is why the per-architecture values were removed from ComponentType.

Enumeration Type Documentation

◆ ModelType

enum class Mila::Dnn::ModelType : int
exportstrong

Canonical list of framework-known model architectures.

Enumerator
Gpt2 

GPT-2 style decoder network.

Llama 

LLaMA 3 style decoder network.

Gemma 

Gemma 4 style decoder network.

Mistral 

Mistral style decoder network.

Bert 

BERT style encoder network.

Function Documentation

◆ modelTypeFromString()

ModelType Mila::Dnn::modelTypeFromString ( std::string_view s)
inlineexportnoexcept

Parse a case-insensitive architecture name into a ModelType.

Named distinctly from the ComponentType parser: overloading on return type alone is not possible, and both parsers take a string_view. Returns ModelType::Unknown for unrecognized input.

◆ toString()

std::string Mila::Dnn::toString ( ModelType t)
inlineexportnoexcept

Convert a ModelType to its canonical architecture name.

Overloads (does not collide with) the ComponentType toString: the argument type disambiguates. Returns "Unknown" for unrecognized values.