TorchLean API

NN.Examples.Quickstart.TypedTraining

Training with explicit precision #

Fit an affine model to one sample using the loss (prediction - target)^2 / 2. The derivative with respect to the prediction is its residual. A typed VJP converts that residual into parameter gradients, and nn.sgdStep applies the existing SGD kernel.

The model has no buffer-update hooks. State, data, gradients, and learning rate use the selected scalar throughout. Call run for a binary128 example, or fit with another supported Context. This is CPU software execution; no arbitrary-precision CUDA or checkpoint support is implied.

@[reducible, inline]

The concrete scalar selected for the runnable example.

Instances For

    A scalar affine model with caller-supplied typed weight and bias.

    Instances For

      Reuse one typed graph for several SGD updates of half squared error on one sample.

      Instances For

        Train from a coefficient that cannot be represented in binary64, then print exact rationals.

        Instances For