CreditRuleBase<T>
Base Classes · AiDotNet.NeuralNetworks.CreditAssignment
Public, extensible base class for credit-assignment (learning) rules in the Direct-Feedback-Alignment
family. Subclass this to author your own rule with minimal code: the base owns all the shared machinery — the
per-layer feedback-matrix cache (lazily built and re-initialized when the network shape changes), the
error/target projection and teaching-signal shaping helpers, feedback normalization/sign helpers, seeded random
generation, and an overridable per-step feedback-update hook — so a subclass usually only implements
ComputeTeachingSignals (and, for a learned-feedback rule, UpdateFeedback).
Implements: IFeedbackLearningRule<T>
For Beginners
when a neural network is wrong, every layer needs a message that says “here’s how your output should change.” Standard back-propagation computes that message exactly by chaining backwards through all later layers. The rules in this family instead hand each layer a cheaper shortcut message — usually the final output error pushed through a small random (or learned) matrix — and the network still learns. This base class already contains the plumbing those shortcuts need; to invent your own rule you mostly just decide how to turn the output error into each layer’s teaching signal.
How It Works
Writing a custom rule. A minimal Direct-Feedback-Alignment-style rule looks like this:
For a rule whose feedback is learned (e.g. Kolen-Pollack), also override UpdateFeedback.
Properties
| Property | Summary |
|---|---|
bool IsExactBackprop { get; } |
|
string Name { get; } |
Methods
| Method | Summary |
|---|---|
void ComputeTeachingSignals(ICreditAssignmentContext<T> context) |
|
void Initialize(ICreditAssignmentContext<T> context) |