Architecture<T>

Models & Types · AiDotNet.AutoML

Represents a neural network architecture discovered through NAS.

For Beginners

Think of this as a blueprint for a neural network. NAS algorithms explore many possible blueprints and find the best one for your task. This class stores that blueprint so you can:

  • Save it to disk for later use
  • Share it with others
  • Load it to recreate the same network structure

How It Works

This class captures the structure of a neural network discovered through Neural Architecture Search (NAS). It includes the operations connecting nodes and optional channel information for cost estimation.

Constructors

Constructor Summary
Architecture()

Properties

Property Summary
Dictionary<int, int> NodeChannels { get; set; } Optional per-node channel counts (typically output channels) used for cost estimation.
List<ValueTuple<int, int, string>> Operations { get; set; } Operations in the architecture: (to_node, from_node, operation)
int NodeCount { get; set; } Number of nodes in the architecture

Methods

Method Summary
Architecture<T> FromBytes(byte[] data) Deserializes an architecture from a binary byte array.
Architecture<T> FromJson(string json) Deserializes an architecture from a JSON string.
Architecture<T> LoadFromFile(string filePath) Loads an architecture from a JSON file.
byte[] ToBytes() Serializes the architecture to a binary byte array.
string GetDescription() Gets a description of the architecture.
string ToJson(bool indented) Serializes the architecture to a JSON string.
void AddOperation(int toNode, int fromNode, string operation) Adds an operation to the architecture
void SaveToFile(string filePath, bool indented) Saves the architecture to a JSON file.