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
TThe numeric type used for calculations.
TInputThe input data type.
TOutputThe output data type.
- Inherited Members
Properties
StoredGradientCount
Gets the number of tasks with stored gradients.
int StoredGradientCount { get; }
Property Value
Methods
ProjectGradient(Vector<T>)
Projects a gradient to satisfy all task constraints.
Vector<T> ProjectGradient(Vector<T> gradient)
Parameters
gradientVector<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
taskGradientVector<T>The average gradient for the task.
ViolatesConstraint(Vector<T>)
Checks if a gradient violates any task constraint.
bool ViolatesConstraint(Vector<T> gradient)
Parameters
gradientVector<T>The gradient to check.
Returns
- bool
True if any constraint is violated.