Skip to content

Meta-Learning Suite (MAML/Reptile/iMAML/ALFA) and SEAL Investigation #286

@ooples

Description

@ooples

Overview

This issue serves as the master epic for tracking the implementation of the entire Meta-Learning Suite. It consolidates the required features into a high-level checklist, with each item linking to a separate, highly-detailed implementation plan (a "sub-epic").


Implementation Plan

Epic 1: Data Abstractions

Goal: Build the foundational data loaders required for all meta-learning tasks.


Epic 2: Baseline Algorithms

Goal: Implement well-established meta-learning algorithms to serve as performance baselines.


Epic 3: Advanced Algorithm

Goal: Implement the state-of-the-art SEAL algorithm.


Epic 4: Documentation & Examples

Goal: Ensure the new meta-learning suite is accessible, understandable, and easy to use.


Future Work (Out of Scope for this Epic)

The following algorithms were considered during the initial investigation but are not part of the initial implementation. They may be prioritized in the future.

  • iMAML (Implicit MAML)
  • ALFA (Adaptive Layer-wise First-order Approximation)
  • Meta-SGD

⚠️ CRITICAL ARCHITECTURAL REQUIREMENTS

Before implementing this user story, you MUST review:

Mandatory Implementation Checklist

1. INumericOperations Usage (CRITICAL)

  • Include protected static readonly INumericOperations<T> NumOps = MathHelper.GetNumericOperations<T>(); in base class
  • NEVER hardcode double, float, or specific numeric types - use generic T
  • NEVER use default(T) - use NumOps.Zero instead
  • Use NumOps.Zero, NumOps.One, NumOps.FromDouble() for values
  • Use NumOps.Add(), NumOps.Multiply(), etc. for arithmetic
  • Use NumOps.LessThan(), NumOps.GreaterThan(), etc. for comparisons

2. Inheritance Pattern (REQUIRED)

  • Create I{FeatureName}.cs in src/Interfaces/ (root level, NOT subfolders)
  • Create {FeatureName}Base.cs in src/{FeatureArea}/ inheriting from interface
  • Create concrete classes inheriting from Base class (NOT directly from interface)

3. PredictionModelBuilder Integration (REQUIRED)

  • Add private field: private I{FeatureName}<T>? _{featureName}; to PredictionModelBuilder.cs
  • Add Configure method taking ONLY interface (no parameters):
    public IPredictionModelBuilder<T, TInput, TOutput> Configure{FeatureName}(I{FeatureName}<T> {featureName})
    {
        _{featureName} = {featureName};
        return this;
    }
  • Use feature in Build() with default: var {featureName} = _{featureName} ?? new Default{FeatureName}<T>();
  • Verify feature is ACTUALLY USED in execution flow

4. Beginner-Friendly Defaults (REQUIRED)

  • Constructor parameters with defaults from research/industry standards
  • Document WHY each default was chosen (cite papers/standards)
  • Validate parameters and throw ArgumentException for invalid values

5. Property Initialization (CRITICAL)

  • NEVER use default! operator
  • String properties: = string.Empty;
  • Collections: = new List<T>(); or = new Vector<T>(0);
  • Numeric properties: appropriate default or NumOps.Zero

6. Class Organization (REQUIRED)

  • One class/enum/interface per file
  • ALL interfaces in src/Interfaces/ (root level)
  • Namespace mirrors folder structure (e.g., src/Regularization/namespace AiDotNet.Regularization)

7. Documentation (REQUIRED)

  • XML documentation for all public members
  • <b>For Beginners:</b> sections with analogies and examples
  • Document all <param>, <returns>, <exception> tags
  • Explain default value choices

8. Testing (REQUIRED)

  • Minimum 80% code coverage
  • Test with multiple numeric types (double, float)
  • Test default values are applied correctly
  • Test edge cases and exceptions
  • Integration tests for PredictionModelBuilder usage

⚠️ Failure to follow these requirements will result in repeated implementation mistakes and PR rejections.

See full details: .github/USER_STORY_ARCHITECTURAL_REQUIREMENTS.md

Metadata

Metadata

Assignees

Labels

featureFeature work itemroadmapRoadmap-tracked itemtrainingTraining harness/configs

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions