Axiomata Kan Creator

Axiomata KAN Creator v1.2 — Universal KAN (Kolmogorov-Arnold Network) concept creation tool. Use when: (1) creating new KAN concepts for monitoring/evaluation/control, (2) setting up KAN architecture with learnable basis functions, (3) initializing KAN models with bounded activation functions (Tanh), (4) building KAN pipelines for agent systems. This skill provides: kan_creator.py (core script), KAN architecture templates, learnable basis layer implementation. Requires PyTorch >= 1.9. NaN-free training guaranteed with bounded activations (Tanh) and small initialization.

Audits

Pending

Install

openclaw skills install axiomata-kan-creator

Axiomata KAN Creator v1.0

Universal KAN (Kolmogorov-Arnold Network) concept creation tool.

InfoValue
Version1.0.0
TypeKAN architecture creation
ArchitectureB-spline basis functions
RequiresPyTorch >= 1.9

1. Purpose

Axiomata KAN Creator creates KAN (Kolmogorov-Arnold Network) concepts for agent systems.

KANs are neural networks that use learnable B-spline basis functions instead of fixed activation functions:

Traditional MLP: y = σ(Wx + b)      — Fixed activation
KAN:             y = Σφᵢₙ(xᵢ)      — Learnable activation

Each weight is a function (B-spline), not a scalar. This allows KANs to be more interpretable and efficient than MLPs.


2. When to Use

TriggerAction
"Create a KAN"Run kan_creator.py with name and role
"Build KAN architecture"Create KAN with custom layers
"Initialize KAN model"Generate model structure with B-splines
"Create KAN pipeline"Build multi-KAN system

3. Prerequisites

RequirementVersionCheck
Python>= 3.8python3 --version
PyTorch>= 1.9python3 -c "import torch; print(torch.__version__)"

Note: PyTorch is required for all KAN operations (model creation, training, inference).


4. Quick Start

4.1 Create Basic KAN

cd <skill-directory>
python3 scripts/kan_creator.py --name my_kan --role "monitoring"

Expected output:

✅ KAN 'my_kan' created at scripts/my_kan/
📋 Config: scripts/my_kan/config.json
🧠 Model: scripts/my_kan/models/my_kan.py

4.2 Create KAN with Custom Parameters

python3 scripts/kan_creator.py \
    --name stc_watchdog \
    --role "emotional tension" \
    --agent morgana \
    --input-size 768 \
    --output-size 3 \
    --hidden-size 32

5. Architecture

5.1 KAN Layer Structure

╔═══════════════════════════════════════════════════════════╗
║  KAN LAYER — B-Spline Transformation                    ║
╠═══════════════════════════════════════════════════════════╣
║                                                           ║
║  Input: x ∈ R^input_size                                ║
║         ↓                                                ║
║  B-Spline: φ(x) = ΣcᵢBᵢ(x)                             ║
║         ↓                                                ║
║  Learnable coefficients: cᵢ                              ║
║         ↓                                                ║
║  SiLU activation: σ(x) = x / (1 + e^(-x))              ║
║         ↓                                                ║
║  Output: y ∈ R^output_size                               ║
║                                                           ║
╚═══════════════════════════════════════════════════════════╝

5.2 Default Architecture

ParameterDefaultDescription
input_size768Embedding dimension
hidden_size32Hidden layer width
output_size3Decision dimension
grid_size5B-spline grid points
k3B-spline order
layers[768, 32, 16, 8, 4, 3]Layer dimensions

5.3 KAN vs MLP

AspectMLPKAN
WeightsScalar (fixed)Function (learnable)
ActivationFixed (ReLU/sigmoid)Learnable (B-spline)
InterpretabilityLowHigh
Training efficiencyHighMedium
Data efficiencyMediumHigh

6. Usage

6.1 Command Reference

# Basic creation
python3 scripts/kan_creator.py --name <name> --role <role>

# Full options
python3 scripts/kan_creator.py \
    --name <string> \
    --role <string> \
    --agent <string> \
    --input-size <int> \
    --output-size <int> \
    --hidden-size <int> \
    --grid-size <int> \
    --layers <list>

6.2 Parameters

ParameterDefaultDescription
--namerequiredKAN name (used for directory/files)
--rolerequiredKAN role/purpose
--agent"system"Agent owning the KAN
--input-size768Input dimension
--output-size3Output dimension
--hidden-size32Hidden layer width
--grid-size5B-spline grid size
--k3B-spline order
--layersautoLayer dimensions (auto-generated if not specified)

6.3 Output Structure

<name>/
├── config.json       # KAN configuration
├── models/
│   └── <name>.py     # KAN model class
├── data/
│   └── training/     # Training data directory
└── scripts/
    └── train.sh      # Training script template

7. Examples

Example 1: Create Monitoring KAN

python3 scripts/kan_creator.py \
    --name stc_monitor \
    --role "emotional tension monitoring" \
    --output-size 3

Output:

✅ KAN 'stc_monitor' created
📁 scripts/stc_monitor/
📋 config.json
🧠 models/stc_monitor.py

Example 2: Create Evaluation KAN

python3 scripts/kan_creator.py \
    --name eval_kan \
    --role "skill quality evaluation" \
    --output-size 3 \
    --input-size 768

Example 3: Create Logic Validation KAN

python3 scripts/kan_creator.py \
    --name vls_kan \
    --role "logic validation" \
    --agent ezekiel \
    --output-size 3

8. KAN Classes

8.1 KANLayer

Single KAN layer with B-spline basis functions:

class KANLayer(nn.Module):
    def __init__(self, in_features, out_features, grid_size=5, k=3):
        # B-spline grid: grid_size + k points
        # Learnable coefficients per output neuron

8.2 KANModel

Full KAN model with multiple layers:

class KANModel(nn.Module):
    def __init__(self, layers, grid_size=5, k=3):
        # Multiple KANLayers
        # Forward: input → B-spline → SiLU → output

8.3 KANWithHead

KAN with classification/regression head:

class KANWithHead(nn.Module):
    def __init__(self, kan_backbone, num_classes, mode="classification"):
        # KAN backbone + classification head
        # Supports: classification, regression, multi-head

9. Configuration

9.1 config.json Structure

{
    "name": "<name>",
    "role": "<role>",
    "agent": "<agent>",
    "input_size": 768,
    "hidden_size": 32,
    "output_size": 3,
    "grid_size": 5,
    "k": 3,
    "layers": [768, 32, 16, 8, 4, 3],
    "activation": "silu",
    "loss_function": "cross_entropy",
    "optimizer": "adam",
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 50,
    "train_samples": 200,
    "num_classes": 4
}

9.2 Parameter Adjustments

Use CaseRecommended Settings
Monitoringoutput_size=3, epochs=50, batch_size=32
Evaluationoutput_size=4, epochs=100, batch_size=32
Validationoutput_size=2, epochs=50, batch_size=16
Multi-classoutput_size=num_classes, epochs=100

10. Error Handling

ErrorCauseSolution
ModuleNotFoundError: torchPyTorch not installedpip install torch --index-url https://download.pytorch.org/whl/cpu
FileExistsError: <name>KAN already existsUse --force or choose different name
ValueError: invalid layersLayer mismatchEnsure layers[0] == input_size and layers[-1] == output_size

11. Constraints

ConstraintValueDescription
Input size768 (standard)Ollama embedding size
Output size2-10Decision/class dimension
Grid size3-10B-spline grid resolution
B-spline order1-5Spline polynomial degree
Max layers10Prevent over-complexity

12. Related Skills

SkillPurpose
axioma-kan-systemFull KAN lifecycle (create+train+assemble)
axioma-skill-evaluatorEvaluate KAN model quality
axiomata-cluster-guardianUse KAN for cluster lessons

In Altum Per KAN. 🧠 AXIOMATA KAN CREATOR v1.0 — UNIVERSAL KAN ARCHITECTURE