-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Description
I'm curious what type of functions one should be able grad
over. i.e. what is the implicit restriction on a
def grad (f:a->Float) (x:a) : a = snd (vjp f x) 1.0
Currently it seems to work for tables and tuples, but other things crash for me (for instance custom data
types).
Was playing around with something Flax-like for grouping params and functions, but I think this might be the wrong path given #331 and because I am not smart enough to figure out how to unpack a tuple a Params to a Param of a tuples.
data Param a =
AsParam a
Init ParamInit
def Layer (inp:Type) (out:Type) (param:Type) : Type=
{forward:({key: Key & params:param} -> inp -> out) &
params: param &
init: Bool }
Metadata
Metadata
Assignees
Labels
No labels