public interface GradientCollector
extends java.lang.AutoCloseable
The GradientCollector should be opened with a try-with-resources. All operations
performed within the try-with-resources are recorded and the variables marked. When backward function is called, gradients are collected w.r.t previously marked
variables.
| Modifier and Type | Method and Description |
|---|---|
void |
backward(NDArray target)
Calculate the gradient w.r.t previously marked variable (head).
|
void |
close() |
void backward(NDArray target)
target - the target NDArray to calculate the gradient w.r.t headvoid close()
close in interface java.lang.AutoCloseable