public final class MultilayerPerceptronCostFunction extends AbstractMiniBatchCostFunction
| Modifier and Type | Class and Description |
|---|---|
static class |
MultilayerPerceptronCostFunction.NetworkConfiguration |
| Constructor and Description |
|---|
MultilayerPerceptronCostFunction(MultilayerPerceptron network,
de.jungblut.math.DoubleVector[] features,
de.jungblut.math.DoubleVector[] outcome) |
| Modifier and Type | Method and Description |
|---|---|
static de.jungblut.math.DoubleMatrix[] |
backwardPropagate(de.jungblut.math.DoubleMatrix y,
de.jungblut.math.DoubleMatrix[] thetas,
de.jungblut.math.DoubleMatrix[] ax,
de.jungblut.math.DoubleMatrix[] zx,
MultilayerPerceptronCostFunction.NetworkConfiguration conf) |
static void |
calculateGradients(de.jungblut.math.DoubleMatrix[] thetas,
de.jungblut.math.DoubleMatrix[] thetaGradients,
de.jungblut.math.DoubleMatrix[] ax,
de.jungblut.math.DoubleMatrix[] deltaX,
int m,
MultilayerPerceptronCostFunction.NetworkConfiguration conf) |
static double |
calculateRegularization(de.jungblut.math.DoubleMatrix[] thetas,
int m,
MultilayerPerceptronCostFunction.NetworkConfiguration conf) |
static CostGradientTuple |
computeNextStep(de.jungblut.math.DoubleVector input,
de.jungblut.math.DoubleMatrix x,
de.jungblut.math.DoubleMatrix y,
MultilayerPerceptronCostFunction.NetworkConfiguration conf)
Do a full forward pass and backpropagate the error.
|
static int[][] |
computeUnfoldParameters(int[] layerSizes)
Calculates the unfold parameters to unroll a learned theta vector in their
matrix.
|
static void |
dropout(Random rnd,
de.jungblut.math.DoubleMatrix activations,
double p)
Computes dropout for the activations matrix.
|
static void |
dropoutVisibleLayer(de.jungblut.math.DoubleMatrix x,
de.jungblut.math.DoubleMatrix[] ax,
MultilayerPerceptronCostFunction.NetworkConfiguration conf) |
protected CostGradientTuple |
evaluateBatch(de.jungblut.math.DoubleVector theta,
de.jungblut.math.DoubleMatrix featureBatch,
de.jungblut.math.DoubleMatrix outcomeBatch)
Evaluate the batch.
|
static void |
forwardPropagate(de.jungblut.math.DoubleMatrix[] thetas,
de.jungblut.math.DoubleMatrix[] ax,
de.jungblut.math.DoubleMatrix[] zx,
MultilayerPerceptronCostFunction.NetworkConfiguration conf) |
evaluateCostpublic MultilayerPerceptronCostFunction(MultilayerPerceptron network, de.jungblut.math.DoubleVector[] features, de.jungblut.math.DoubleVector[] outcome)
protected CostGradientTuple evaluateBatch(de.jungblut.math.DoubleVector theta, de.jungblut.math.DoubleMatrix featureBatch, de.jungblut.math.DoubleMatrix outcomeBatch)
AbstractMiniBatchCostFunctionevaluateBatch in class AbstractMiniBatchCostFunctiontheta - the parameters to use.featureBatch - the batch matrix as input (already contains a bias!).outcomeBatch - the batch matrix denoting the output.AbstractMiniBatchCostFunction.evaluateCost(DoubleVector).public static CostGradientTuple computeNextStep(de.jungblut.math.DoubleVector input, de.jungblut.math.DoubleMatrix x, de.jungblut.math.DoubleMatrix y, MultilayerPerceptronCostFunction.NetworkConfiguration conf)
input - the input parameters (theta).x - the features.y - the outcome.public static void forwardPropagate(de.jungblut.math.DoubleMatrix[] thetas,
de.jungblut.math.DoubleMatrix[] ax,
de.jungblut.math.DoubleMatrix[] zx,
MultilayerPerceptronCostFunction.NetworkConfiguration conf)
public static de.jungblut.math.DoubleMatrix[] backwardPropagate(de.jungblut.math.DoubleMatrix y,
de.jungblut.math.DoubleMatrix[] thetas,
de.jungblut.math.DoubleMatrix[] ax,
de.jungblut.math.DoubleMatrix[] zx,
MultilayerPerceptronCostFunction.NetworkConfiguration conf)
public static void calculateGradients(de.jungblut.math.DoubleMatrix[] thetas,
de.jungblut.math.DoubleMatrix[] thetaGradients,
de.jungblut.math.DoubleMatrix[] ax,
de.jungblut.math.DoubleMatrix[] deltaX,
int m,
MultilayerPerceptronCostFunction.NetworkConfiguration conf)
public static double calculateRegularization(de.jungblut.math.DoubleMatrix[] thetas,
int m,
MultilayerPerceptronCostFunction.NetworkConfiguration conf)
public static void dropoutVisibleLayer(de.jungblut.math.DoubleMatrix x,
de.jungblut.math.DoubleMatrix[] ax,
MultilayerPerceptronCostFunction.NetworkConfiguration conf)
public static int[][] computeUnfoldParameters(int[] layerSizes)
layerSizes - the layer size that the MultilayerPerceptron got
instantiated with.DenseMatrixFolder with.public static void dropout(Random rnd, de.jungblut.math.DoubleMatrix activations, double p)
rnd - the random number generator to consult.activations - activations of units per record on each column.p - dropout probability.Copyright © 2016. All rights reserved.