Skip to content

ML & Optimisation

Eleven components spanning classical machine learning, Bayesian inference, deep learning, genetic algorithms, and mathematical optimisation -- G6's learning and search toolkit.

Overview

This cluster provides the learning substrate for G6. At the classical end, adapt_sklearn wraps scikit-learn estimators behind an AIBlock interface, while adapt_bayesian and adapt_automl offer Bayesian and AutoML approaches. For numerical optimisation, adapt_optimisation provides scipy-backed solvers with built-in test functions (sphere, Rosenbrock, Rastrigin, Ackley), and adapt_pygad adds genetic algorithm search via PyGAD.

The deep learning components (adapt_keras, adapt_pytorch) are optional-extras -- torch and keras are installed per-component as needed, keeping the base installation lightweight. adapt_learning provides meta-learning capabilities, while adapt_eurisko implements Eurisko-style heuristic discovery.

At the top of the stack, hyperdistillation and deep_understanding combine multiple learning signals into compressed, high-fidelity representations -- the "hyper" in G6's name.

Components

Component Description MCP Tools
adapt_sklearn Scikit-learn estimator wrapping with ModelConfig --
adapt_bayesian Bayesian inference and probabilistic modelling --
adapt_automl AutoML meta-learner — FLAML, AutoGluon, H2O, sklearn 13
adapt_algo_selector Algorithm selection based on dataset meta-features --
adapt_optimisation Scipy optimisation with function registry --
adapt_pygad Genetic algorithms via PyGAD --
adapt_keras Keras deep learning integration --
adapt_pytorch PyTorch deep learning integration --
adapt_learning Meta-learning and learning-to-learn --
adapt_eurisko Eurisko-style heuristic discovery --
hyperdistillation Multi-signal knowledge compression --
deep_understanding Deep semantic understanding layers --

Architecture

graph TD
    SKLEARN[adapt_sklearn] --> CORE[core.AIBlock]
    BAYES[adapt_bayesian] --> CORE
    AUTO[adapt_automl] --> SKLEARN
    OPT[adapt_optimisation] --> CORE
    PYGAD[adapt_pygad] --> CORE
    KERAS[adapt_keras] --> CORE
    TORCH[adapt_pytorch] --> CORE
    LEARN[adapt_learning] --> SKLEARN
    LEARN --> BAYES
    EURISKO[adapt_eurisko] --> LEARN
    HYPER[hyperdistillation] --> LEARN
    HYPER --> TORCH
    DEEP[deep_understanding] --> HYPER

Key Patterns

Input-Driven Configuration. In adapt_sklearn, the estimator type is controlled by model_config_data on the input, not the block. The block's model_config_data is only a default. Tests must pass config via MLInput to select the right estimator. This keeps blocks stateless and reusable.

Optional Deep Learning. Keras and PyTorch are marked as optional extras in pyproject.toml with python = "<3.13" guards where needed (e.g., PyMC's pytensor dependency). Components use try/except imports and return actionable install-required errors when the backend is unavailable. The PyTorch MCP adapter is pilot-oriented: it persists a latest checkpoint for train-predict-export workflows, but it is not a full model registry or production monitoring layer.

Function Registry. adapt_optimisation maintains a registry of named test functions (sphere, rosenbrock, rastrigin, ackley) with known optima. This enables benchmarking and regression testing of optimisation methods without external datasets. In end-user workflows, it should usually be called after a recipe or job agent has translated the domain task into an objective function, bounds, and constraints; the component does not discover that business framing on its own.