klyn.math.nn.Sequential.evaluate
method
public evaluate(notnull features as NDArray<T>, notnull targets as NDArray<T>, batchSize as Long = 64l) as Evaluation
Description

Computes sample-weighted regression loss with fixed parameters and no optimizer updates. Accuracy is unavailable on the returned evaluation.

Parameters
ParameterDescription
featuresBatched inputs.
targetsFloating expected values, shaped like model outputs.
batchSizePositive evaluation batch size, including a short tail.
Returns

Loss-only evaluation; neither input is modified.

Throws
  • ValueException for invalid options, shapes or non-finite input.
  • NullException if features, targets is null at runtime; statically null arguments are rejected with TypeError.
Example

print(model.evaluate(xTest, yTest).loss)