OutputSpec<T>

Structs · AiDotNet.Interfaces

One declared output of a multi-output model: what it is called, what shape it has, how it is scored, and how heavily it counts.

Inheritance: ValueType → OutputSpec<T>

Implements: IEquatable<OutputSpec<T>>

How It Works

The unit of a DECLARED objective. A model whose paper objective is a sum over several heads cannot express that through a single prediction tensor: whatever the prediction omits receives no gradient, so that branch trains not at all — silently, since the loss still falls and every generic invariant still passes. ABCNet is the case in hand; its recognition head was never supervised.

Weight is part of the declaration rather than folded into the loss function because the paper states it separately and readers compare against the paper. ABCNet’s objective is L_det + L_bezier + L_rec; Inception’s auxiliary classifier is weighted 0.4. A weight buried inside a custom loss cannot be read off, cross-checked, or reported.

Constructors

Constructor Summary
OutputSpec(string Name, ILossFunction<T> Loss, double Weight) One declared output of a multi-output model: what it is called, what shape it has, how it is scored, and how heavily it counts.
OutputSpec(string name, ILossFunction<T> loss) A term weighted 1.0 — the common case.

Properties

Property Summary
ILossFunction<T> Loss { get; set; } How this output is scored against its target.
double Weight { get; set; } Multiplier applied to this term in the total, per the model’s paper.
string Name { get; set; } Human-readable name, used in diagnostics and in the harness’s target generation.

Methods

Method Summary
bool Equals(OutputSpec<T> other)
bool Equals(object obj)
bool op_Equality(OutputSpec<T> left, OutputSpec<T> right)
bool op_Inequality(OutputSpec<T> left, OutputSpec<T> right)
int GetHashCode()
string ToString()
void Deconstruct(string Name, ILossFunction<T> Loss, double Weight)