public final class RBM extends Object
RBMCostFunction. Create new instances with the
RBM.RBMBuilder or with the static factory methods.| Modifier and Type | Class and Description |
|---|---|
static class |
RBM.RBMBuilder |
| Modifier and Type | Method and Description |
|---|---|
static RBM |
deserialize(DataInputStream in)
Deserializes the RBM back from the binary stream input.
|
WeightMatrix[] |
getNeuralNetworkWeights(int outputLayerSize)
Creates a weight matrix that can be used for unsupervised weight
initialization in the
MultilayerPerceptron. |
de.jungblut.math.DoubleMatrix[] |
getWeights() |
de.jungblut.math.DoubleVector |
predict(de.jungblut.math.DoubleVector input)
Returns the hidden activations of the last RBM.
|
de.jungblut.math.DoubleVector |
reconstructInput(de.jungblut.math.DoubleVector hiddenActivations)
Creates a reconstruction of the input using the given hidden activations.
|
static void |
serialize(RBM model,
DataOutput out)
Serializes this RBM model into the given output stream.
|
void |
setSeed(long seed)
Sets the internally used rng seed.
|
static RBM |
single(int numHiddenNodes) |
static RBM |
single(int numHiddenNodes,
ActivationFunction func) |
static RBM |
singleGPU(int numHiddenNodes,
ActivationFunction func) |
static RBM |
stacked(ActivationFunction func,
int... numHiddenNodes)
Creates a new stacked RBM with sigmoid activation and with the given number
of hidden nodes in each stacked layer.
|
static RBM |
stacked(int... numHiddenNodes)
Creates a new stacked RBM with sigmoid activation and with the given number
of hidden nodes in each stacked layer.
|
static RBM |
stackedGPU(ActivationFunction func,
int... numHiddenNodes)
Creates a new stacked RBM with sigmoid activation and with the given number
of hidden nodes in each stacked layer.
|
void |
train(de.jungblut.math.DoubleVector[] trainingSet,
double alpha,
int numIterations)
Trains the RBM on the given training set.
|
void |
train(de.jungblut.math.DoubleVector[] trainingSet,
Minimizer minimizer,
int numIterations)
Trains the RBM on the given training set.
|
public void train(de.jungblut.math.DoubleVector[] trainingSet,
double alpha,
int numIterations)
trainingSet - the training set to train on.alpha - the learning rate for gradient descent.numIterations - how many iterations of training have to be done. (if
converged before, it will stop training)public void train(de.jungblut.math.DoubleVector[] trainingSet,
Minimizer minimizer,
int numIterations)
trainingSet - the training set to train on.minimizer - the minimizer to use. Note that the costfunction's
gradient isn't the real gradient and thus can't be optimized by
line searching minimizers like Fmincg.numIterations - how many iterations of training have to be done. (if
converged before, it will stop training)public de.jungblut.math.DoubleVector predict(de.jungblut.math.DoubleVector input)
input - the input of the first RBM.public de.jungblut.math.DoubleVector reconstructInput(de.jungblut.math.DoubleVector hiddenActivations)
predict(DoubleVector)).hiddenActivations - the activations of the predict method.public de.jungblut.math.DoubleMatrix[] getWeights()
public WeightMatrix[] getNeuralNetworkWeights(int outputLayerSize)
MultilayerPerceptron.outputLayerSize - the size of the classification layer on top of this
RBM.WeightMatrix that maps layers to the weights.public void setSeed(long seed)
public static void serialize(RBM model, DataOutput out) throws IOException
IOExceptionpublic static RBM deserialize(DataInputStream in) throws IOException
IOExceptionpublic static RBM single(int numHiddenNodes, ActivationFunction func)
public static RBM stacked(ActivationFunction func, int... numHiddenNodes)
public static RBM single(int numHiddenNodes)
public static RBM stacked(int... numHiddenNodes)
public static RBM singleGPU(int numHiddenNodes, ActivationFunction func)
public static RBM stackedGPU(ActivationFunction func, int... numHiddenNodes)
Copyright © 2016. All rights reserved.