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 -> ScalarParameters
- 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]forNexamples whereXis the input size andYis the output size.
Return Value
The mean squared error for the batch, also known as the batch loss.