Contents

update(_:with:)

Updates a model with a new shaped array of examples.

Declaration

func update(_ model: inout MultivariateLinearRegressor<Scalar>.Model, with input: AnnotatedBatch<Scalar>) async throws -> Scalar

Parameters

  • model:

    A model to update.

  • input:

    An annotated batch containing the features and annotations. The last dimension of the features is the model’s input size and the last dimension of the annotations is the model’s output size. All the leading dimensions of the features must match all leading dimensions of the annotations. For example, the feature shape can be [N, X] and the annotation shape can be [N, Y] for N examples where X is the input size and Y is the output size.

Return Value

The mean squared error for the batch, also known as the batch loss.

See Also

Fitting Progressively