Var
Var
is a type of variable for keeping gradients and a history of function calls.
Merlin.Var
— Type.Var
Variable struct.
Var
contains the following members:
data
args
grad
Example
T = Float32
x = Var(rand(T,10,5)) # x.grad is set to `nothing`
x = zerograd(rand(T,10,5)) # x.grad is initialized as zero.
Merlin.gradient!
— Method.gradient!(top::Var)
Compute gradients.
Merlin.isparam
— Method.isparam(x::Var)
Returns whether x
is a parameter or not
Merlin.topsort
— Method.topsort(tops::T...)
Topological sort.