Package ai.djl.training
Interface GradientCollector
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface GradientCollector extends java.lang.AutoCloseableAn interface that provides a mechanism to collect gradients during training.The
GradientCollectorshould be opened with a try-with-resources. All operations performed within the try-with-resources are recorded and the variables marked. Whenbackward functionis called, gradients are collected w.r.t previously marked variables.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbackward(NDArray target)Calculate the gradient w.r.t previously marked variable (head).voidclose()
-
-
-
Method Detail
-
backward
void backward(NDArray target)
Calculate the gradient w.r.t previously marked variable (head).- Parameters:
target- the target NDArray to calculate the gradient w.r.t head
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-