Table of Contents

AiDotNet API Reference

Welcome to the AiDotNet API Reference documentation. This section provides complete API documentation for all public classes, interfaces, methods, and properties.

Core Namespaces

Namespace Description
AiDotNet Core builder and result types (AiModelBuilder, AiModelResult)
AiDotNet.Configuration Configuration options and settings
AiDotNet.NeuralNetworks 100+ neural network architectures
AiDotNet.Classification 28+ classification algorithms
AiDotNet.Regression 41+ regression algorithms
AiDotNet.Clustering 20+ clustering algorithms
AiDotNet.ComputerVision 50+ vision models (YOLO, DETR, SAM)
AiDotNet.Audio 90+ audio models (Whisper, TTS)
AiDotNet.ReinforcementLearning 80+ RL agents (DQN, PPO, SAC)
AiDotNet.Diffusion 20+ diffusion models
AiDotNet.LoRA 37+ LoRA adapters (QLoRA, DoRA)
AiDotNet.RAG 50+ RAG components
AiDotNet.DistributedTraining DDP, FSDP, ZeRO strategies
AiDotNet.AutoML Automatic model selection
AiDotNet.Serving Production model serving
AiDotNet.Tensors Tensor operations and linear algebra
AiDotNet.Tokenization Text tokenization (BPE, WordPiece)

Quick Start

using AiDotNet;

// Build and train a model using the facade pattern
var result = await new AiModelBuilder<double, double[], double>()
    .ConfigureModel(new NeuralNetwork<double>(inputSize: 10, hiddenSize: 64, outputSize: 2))
    .ConfigureOptimizer(new AdamOptimizer<double>())
    .ConfigurePreprocessing()
    .BuildAsync(features, labels);

// Make predictions using the result directly
var prediction = result.Predict(newSample);

Entry Points

AiModelBuilder

The AiModelBuilder<T, TInput, TOutput> class is your primary entry point for building and training models. It uses a fluent builder pattern for configuration.

Key methods:

  • ConfigureModel() - Set the model architecture
  • ConfigureOptimizer() - Set the training optimizer
  • ConfigurePreprocessing() - Configure data preprocessing
  • ConfigureAutoML() - Enable automatic model selection
  • ConfigureHuggingFace() - Load HuggingFace models
  • ConfigureDistributedTraining() - Enable multi-GPU training
  • BuildAsync() - Build and train the model

AiModelResult

The AiModelResult<T, TInput, TOutput> class wraps your trained model and provides inference capabilities.

Key properties and methods:

  • Predict() - Make predictions on new data
  • Model - Access the underlying trained model
  • Metrics - Training and validation metrics
  • Save() / Load() - Model persistence

See Also