module Num::Grad
Extended Modules
Defined in:
grad/backends/agnostic.crgrad/backends/cpu.cr
grad/backends/opencl.cr
grad/primitives/context.cr:35
grad/primitives/context.cr:152
Instance Method Summary
-
#register(name : String, gate : Num::Grad::Gate(U), result : Num::Grad::Variable(U), *parents : Num::Grad::Variable(U)) forall U
Cached a node in the computational graph.
Instance Method Detail
def register(name : String, gate : Num::Grad::Gate(U), result : Num::Grad::Variable(U), *parents : Num::Grad::Variable(U)) forall U
#
Cached a node in the computational graph. This is only required if an operation needs to be backpropogated.
Arguments
- name :
String
- Description of the operation - gate :
Gate
- Operation gate containing a backward method and cached arguments - result :
Variable
- The result of the operation being cached - parents :
Variable
- The operands present in operation being cached
This method should be used sparingly by Users of the application. It should only be necessary when a User is defining their own custom activation function or Layer.