public abstract class AbstractMiniBatchCostFunction extends Object implements CostFunction
Minimizer. The extending cost functions should be as stateless as
possible.| Constructor and Description |
|---|
AbstractMiniBatchCostFunction(de.jungblut.math.DoubleVector[] inputMatrix,
de.jungblut.math.DoubleVector[] outcomeMatrix,
int batchSize,
int numThreads)
An abstract minibatch costfunction.
|
AbstractMiniBatchCostFunction(de.jungblut.math.DoubleVector[] inputMatrix,
de.jungblut.math.DoubleVector[] outcomeMatrix,
int batchSize,
int numThreads,
boolean stochastic)
An abstract minibatch costfunction.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract CostGradientTuple |
evaluateBatch(de.jungblut.math.DoubleVector theta,
de.jungblut.math.DoubleMatrix featureBatch,
de.jungblut.math.DoubleMatrix outcomeBatch)
Evaluate the batch.
|
CostGradientTuple |
evaluateCost(de.jungblut.math.DoubleVector input)
Evaluation for the cost function to retrieve cost and gradient.
|
public AbstractMiniBatchCostFunction(de.jungblut.math.DoubleVector[] inputMatrix,
de.jungblut.math.DoubleVector[] outcomeMatrix,
int batchSize,
int numThreads)
inputMatrix - the data to crunch, bias will be added while calculating
the batches.outcomeMatrix - the data that denotes the outcome of the features-
while supervised learning. Can be null for unsupervised methods.batchSize - the batch size to use, 0 denotes full batch learning by
default.numThreads - the number of threads to use to calculate the batches.public AbstractMiniBatchCostFunction(de.jungblut.math.DoubleVector[] inputMatrix,
de.jungblut.math.DoubleVector[] outcomeMatrix,
int batchSize,
int numThreads,
boolean stochastic)
inputMatrix - the data to crunch, bias will be added while calculating
the batches.outcomeMatrix - the data that denotes the outcome of the features-
while supervised learning. Can be null for unsupervised methods.batchSize - the batch size to use, 0 denotes full batch learning by
default.numThreads - the number of threads to use to calculate the batches.stochastic - if true the batches will be evaluated stochastically,
that means that each iteration the next batch is chosen to
evaluate and calculate gradient and cost.public final CostGradientTuple evaluateCost(de.jungblut.math.DoubleVector input)
CostFunctionevaluateCost in interface CostFunctioninput - a given input vectorprotected abstract CostGradientTuple evaluateBatch(de.jungblut.math.DoubleVector theta, de.jungblut.math.DoubleMatrix featureBatch, de.jungblut.math.DoubleMatrix outcomeBatch)
theta - the parameters to use.featureBatch - the batch matrix as input (already contains a bias!).outcomeBatch - the batch matrix denoting the output.evaluateCost(DoubleVector).Copyright © 2016. All rights reserved.