GradCheckOptions
Interface in IR
Options for gradCheck.
import type { GradCheckOptions } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
interface GradCheckOptions { readonly wrt: string | readonly string[]; readonly at: readonly (readonly unknown[])[]; readonly mode?: 'forward' | 'reverse'; readonly custom?: Readonly<Record<string, string>>; readonly h?: number; readonly tolerance?: number;}Instance properties
wrtread onlystring | readonly string[]The parameters to check the derivative with respect to: one name or a list. Each is an
f32or anf32vector, and in reverse mode also anf32matrix.atread onlyreadonly (readonly unknown[])[]The points: each is the argument list of one call of the function, in its order, with a vector or a matrix as an array of numbers.
modeoptionalread only'forward' | 'reverse'The mode of the derivative under check. Defaults to
'forward'.customoptionalread onlyReadonly<Record<string, string>>Reverse mode: the author-written adjoints to hold, as
customofgrad’s options.hoptionalread onlynumberThe step of the central difference. Defaults to
1e-5.toleranceoptionalread onlynumberThe relative tolerance: a partial derivative passes when it is within
tolerance * max(1, |difference|)of the central difference. Defaults to1e-4.
See also
Source
src/core/passes/grad-check.ts, line 15, at commit af54ddad5