TorchLean API

NN.Spec.Module.LinearRegression

Linear regression as an NNModuleSpec #

The spec model file (NN/Spec/Models/LinearRegression.lean) defines the math: forward and backward/VJP pieces.

This file provides the small NNModuleSpec wrapper so linear regression can be composed via SpecChain and recognized by export tooling (PyTorch string renderings, dimension metadata, etc.).

Package a fixed-parameter linear regression as a NNModuleSpec.

PyTorch analogy: nn.Linear(inDim, 1).

Instances For