Idris2Doc : NN.Training.Training

NN.Training.Training

(source)

Reexports

importpublic Data.ScientificNotation

Definitions

optimiseStep : InterfaceOnPositionslNum=>p=%+> (e>-+@l) ->Costate (IO<!>e) ->OptimiserpstateTy->Costate (IO<!>Const (p.Shp, stateTy))
  Performs a single step of optimisation of some differentiable function
`f : p -> l`, additionally handling some effect `e`
The optimiser used is allowed to be stateful meaning the result of the
optimisation is both the final parameter and the state of the optimiser

Totality: total
Visibility: public export
evalFw : (a->Exteb) ->Costate (IO<!>e) ->Costate (IO<!>Const2ab)
  Evaluates the forward pass of some effectful lens

Totality: total
Visibility: public export
optimise : InterfaceOnPositionslNum=> {default100_ : Nat} ->Materialise (p.Shp) =>MaterialisestateTy=>ScientificDisplay (p.Shp) =>ScientificDisplay (l.Shp) =>ScientificDisplaystateTy=>p=%+> (e>-+@l) ->Costate (IO<!>e) ->IO (p.Shp) ->OptimiserpstateTy->Nat->IO (p.Shp, stateTy)
  Iterates `optimiseStep` `numSteps` times, and logs the progress to the 
console. Materialises parameter and state between steps

Totality: total
Visibility: public export
buildSupervisedLearningSystem : (f : x=\\=>y) -> (loss : y=\\=>l) ->Materialise ((Paramf) .Shp) =>InterfaceOnPositions (Paramf) Materialise=>Paramf=%+> (SupervisedData (x.Shp) ((Paramloss) .Shp) >-+@l)
  TODO is the better name here "buildOptimiser"?

Totality: total
Visibility: public export
totalLoss : Num (l.Shp) => (f : x=\\=> (e>-+@y)) -> (loss : y=\\=>l) -> (Paramf) .Shp->Costate (IO<!>e) ->Costate (IO<!>Const2 (Vectn (x.Shp, (Paramloss) .Shp)) (l.Shp))
  Evaluating the total loss over test/inference data in an effectul setting 
requires a handler for the effect. Usually when the effect is `Dist n`,
the handler is simply sampling. We can't do anything else, really!

Totality: total
Visibility: public export
averageLoss : Num (l.Shp) =>Fractional (l.Shp) =>CastNat (l.Shp) => (f : x=\\=> (e>-+@y)) -> (loss : y=\\=>l) -> (Paramf) .Shp->Costate (IO<!>e) ->Costate (IO<!>Const2 (Vectn (x.Shp, (Paramloss) .Shp)) (l.Shp))
  Average loss in test/inference 

Totality: total
Visibility: public export
train : {default100_ : Nat} -> (m : a-\->b) -> (loss : b=\\=>l) ->InterfaceOnPositionslNum=>ScientificDisplay (l.Shp) =>Materialise (m.Params) =>MaterialisestateTy=>ScientificDisplay (m.Params) =>ScientificDisplaystateTy=>DataLoader (a.Shp) ((Paramloss) .Shp) ->Optimiser (ParamContm) stateTy->Nat->IO (m.Params, stateTy)
Totality: total
Visibility: public export
averageLoss : (m : a-\->b) -> (loss : b=\\=>l) ->Fractional (l.Shp) =>CastNat (l.Shp) =>m.Params->DataLoader (a.Shp) ((Paramloss) .Shp) ->l.Shp
  Average loss over a dataset

Totality: total
Visibility: public export
evalPrint : ScientificDisplay (a.Shp) =>ScientificDisplay (b.Shp) => (m : a-\->b) ->m.Params->DataLoader (a.Shp) (b.Shp) ->IO ()
  Print a model's predictions on a dataset's inputs

Totality: total
Visibility: public export