Table of Contents

Class AlignmentFeedbackData<T>

Namespace
AiDotNet.Models
Assembly
AiDotNet.dll

Contains human feedback data for AI alignment.

public class AlignmentFeedbackData<T>

Type Parameters

T

The numeric data type used for calculations.

Inheritance
AlignmentFeedbackData<T>
Inherited Members

Properties

Inputs

Gets or sets the input prompts or examples.

public Matrix<T> Inputs { get; set; }

Property Value

Matrix<T>

Outputs

Gets or sets the model outputs for each input.

public Matrix<T> Outputs { get; set; }

Property Value

Matrix<T>

Preferences

Gets or sets human preference comparisons.

public (int preferred, int notPreferred)[] Preferences { get; set; }

Property Value

(int preferred, int notPreferred)[]

Remarks

Each element is a pair of indices into Outputs, with the first being preferred.

Ratings

Gets or sets numerical ratings for each output (optional).

public double[] Ratings { get; set; }

Property Value

double[]

Rewards

Gets or sets reward labels for reinforcement learning.

public double[] Rewards { get; set; }

Property Value

double[]

TextualFeedback

Gets or sets textual feedback for outputs (optional).

public string[] TextualFeedback { get; set; }

Property Value

string[]

Methods

EnsurePreferencesValid()

Validates preference indices and throws if invalid.

public void EnsurePreferencesValid()

Exceptions

InvalidOperationException

Thrown when preference indices are out of bounds.

ValidatePreferences()

Validates that preference indices are within valid bounds.

public bool ValidatePreferences()

Returns

bool

True if all preference indices are valid, false otherwise.

Remarks

For Beginners: This method checks that all the preference pairs reference valid output indices. Since preferences are pairs of indices pointing to specific outputs, they must all be within the range of available outputs.