public class GradientCheckUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkGradients(ComputationGraph graph,
double epsilon,
double maxRelError,
boolean print,
boolean exitOnFirstError,
org.nd4j.linalg.api.ndarray.INDArray[] inputs,
org.nd4j.linalg.api.ndarray.INDArray[] labels)
Check backprop gradients for a ComputationGraph
|
static boolean |
checkGradients(MultiLayerNetwork mln,
double epsilon,
double maxRelError,
boolean print,
boolean exitOnFirstError,
org.nd4j.linalg.api.ndarray.INDArray input,
org.nd4j.linalg.api.ndarray.INDArray labels,
boolean useUpdater)
Check backprop gradients for a MultiLayerNetwork.
|
public static boolean checkGradients(MultiLayerNetwork mln, double epsilon, double maxRelError, boolean print, boolean exitOnFirstError, org.nd4j.linalg.api.ndarray.INDArray input, org.nd4j.linalg.api.ndarray.INDArray labels, boolean useUpdater)
mln - MultiLayerNetwork to test. This must be initialized.epsilon - Usually on the order/ of 1e-4 or so.maxRelError - Maximum relative error. Usually < 0.01, though maybe more for deep networksprint - Whether to print full pass/failure details for each parameter gradientexitOnFirstError - If true: return upon first failure. If false: continue checking even if
one parameter gradient has failed. Typically use false for debugging, true for unit tests.input - Input array to use for forward pass. May be mini-batch data.labels - Labels/targets to use to calculate backprop gradient. May be mini-batch data.useUpdater - Whether to put the gradient through Updater.update(...). Necessary for testing things
like l1 and l2 regularization.public static boolean checkGradients(ComputationGraph graph, double epsilon, double maxRelError, boolean print, boolean exitOnFirstError, org.nd4j.linalg.api.ndarray.INDArray[] inputs, org.nd4j.linalg.api.ndarray.INDArray[] labels)
graph - ComputationGraph to test. This must be initialized.epsilon - Usually on the order of 1e-4 or so.maxRelError - Maximum relative error. Usually < 0.01, though maybe more for deep networksprint - Whether to print full pass/failure details for each parameter gradientexitOnFirstError - If true: return upon first failure. If false: continue checking even if
one parameter gradient has failed. Typically use false for debugging, true for unit tests.inputs - Input arrays to use for forward pass. May be mini-batch data.labels - Labels/targets (output) arrays to use to calculate backprop gradient. May be mini-batch data.Copyright © 2016. All Rights Reserved.