public class StochasticDiffFunctionTester
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
numBatches |
protected int |
testBatchSize |
protected AbstractStochasticCachingDiffFunction |
thisFunc |
Constructor and Description |
---|
StochasticDiffFunctionTester(Function function) |
Modifier and Type | Method and Description |
---|---|
void |
arrayToFile(double[] thisArray,
java.lang.String fileName) |
double[] |
getVariance(double[] x) |
double[] |
getVariance(double[] x,
int batchSize) |
void |
listToFile(java.util.List<double[]> thisList,
java.lang.String fileName) |
double |
testConditionNumber(int samples) |
boolean |
testDerivatives(double[] x,
double functionTolerance)
This function tests to make sure that the sum of the stochastic calculated gradients is equal to the
full gradient.
|
boolean |
testSumOfBatches(double[] x,
double functionTolerance)
This function tests to make sure that the sum of the stochastic calculated gradients is equal to the
full gradient.
|
void |
testVariance(double[] x) |
protected int testBatchSize
protected int numBatches
protected AbstractStochasticCachingDiffFunction thisFunc
public StochasticDiffFunctionTester(Function function)
public boolean testSumOfBatches(double[] x, double functionTolerance)
x
- is the point to evaluate the function atfunctionTolerance
- is the tolerance to place on the infinity norm of the gradient and valuepublic boolean testDerivatives(double[] x, double functionTolerance)
x
- is the point to evaluate the function atfunctionTolerance
- is the tolerance to place on the infinity norm of the gradient and valuepublic double testConditionNumber(int samples)
public double[] getVariance(double[] x)
public double[] getVariance(double[] x, int batchSize)
public void testVariance(double[] x)
public void listToFile(java.util.List<double[]> thisList, java.lang.String fileName)
public void arrayToFile(double[] thisArray, java.lang.String fileName)