TorchLean API

NN.GraphSpec.Models.TorchLean.Resnet18

TorchLean-executable model: ResNet-18 (GraphSpec.DAG-backed) #

This is the executable-facing wrapper for NN.GraphSpec.Models.ResNet18.

Important design point:

So we expose:

def NN.GraphSpec.Models.TorchLean.resnet18Model (inC h w numClasses : ) (h_inC : inC > 0) (h_h : h > 0) (h_w : w > 0) (h_cls : numClasses > 0) :
DAG.Model (ResNet18.params inC numClasses) [Shape.CHW inC h w] (Shape.Vec numClasses)

The ResNet-18 model as a GraphSpec.DAG.Model (typed residual graph).

Instances For
    def NN.GraphSpec.Models.TorchLean.resnet18Program (inC h w numClasses : ) (h_inC : inC > 0) (h_h : h > 0) (h_w : w > 0) (h_cls : numClasses > 0) {α : Type} [Context α] [DecidableEq Spec.Shape] :

    Compile resnet18Model into a backend-polymorphic TorchLean program.

    You can run this on the eager backend or record it into the compiled backend.

    Instances For
      def NN.GraphSpec.Models.TorchLean.resnet18InitParams (inC h w numClasses : ) (h_inC : inC > 0) (h_h : h > 0) (h_w : w > 0) (h_cls : numClasses > 0) :

      Deterministic Float initialization for the ResNet-18 parameter list.

      Instances For