Documentation
¶
Overview ¶
Package testgrad provides function to test autograd.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Func ¶
type Func struct { // Src declares the function (which must be named `F`) to compute the gradient of. Src string // GradOf lists all the functions for which we compute the gradient of. // If GradOf is empty, we compute the gradient of F. GradOf []string // Want stores the source code of the expected gradient of the function Want string // GradImportName is the name of the import of the grad package. // If empty, then the default import name is used. GradImportName string // Wants stores the source code of the expected synthetic auxiliary functions. Wants map[string]string // Err is the substring expected if the compiler returns an error. Err string }
Func tests the computation of the gradient of a function.
type Method ¶ added in v0.4.0
type Method struct { // Src declares the function (which must be named `F`) to compute the gradient of. Src string // GradOf lists all the functions for which we compute the gradient of. // If GradOf is empty, we compute the gradient of F. GradOf []string // Want stores the source code of the expected gradient of the function Want string // GradImportName is the name of the import of the grad package. // If empty, then the default import name is used. GradImportName string // Wants stores the source code of the expected synthetic auxiliary functions. Wants map[string]string // Err is the substring expected if the compiler returns an error. Err string }
Method computes the gradient of methods and compare the result with an expected outcome.
Click to show internal directories.
Click to hide internal directories.