Table of Contents

Interface IGradientConstraintStrategy<T, TInput, TOutput>

Namespace
AiDotNet.ContinualLearning.Interfaces
Assembly
AiDotNet.dll

Extended strategy interface for gradient-based constraint strategies.

public interface IGradientConstraintStrategy<T, TInput, TOutput> : IMemoryBasedStrategy<T, TInput, TOutput>, IContinualLearningStrategy<T, TInput, TOutput>

Type Parameters

T

The numeric type used for calculations.

TInput

The input data type.

TOutput

The output data type.

Inherited Members

Properties

StoredGradientCount

Gets the number of tasks with stored gradients.

int StoredGradientCount { get; }

Property Value

int

Methods

ProjectGradient(Vector<T>)

Projects a gradient to satisfy all task constraints.

Vector<T> ProjectGradient(Vector<T> gradient)

Parameters

gradient Vector<T>

The gradient to project.

Returns

Vector<T>

The projected gradient.

StoreTaskGradient(Vector<T>)

Stores the gradient for a completed task.

void StoreTaskGradient(Vector<T> taskGradient)

Parameters

taskGradient Vector<T>

The average gradient for the task.

ViolatesConstraint(Vector<T>)

Checks if a gradient violates any task constraint.

bool ViolatesConstraint(Vector<T> gradient)

Parameters

gradient Vector<T>

The gradient to check.

Returns

bool

True if any constraint is violated.