public class DM<T extends SequenceElement> extends Object implements SequenceLearningAlgorithm<T>
Modifier and Type | Field and Description |
---|---|
protected double[] |
expTable |
protected static double |
MAX_EXP |
protected double |
negative |
protected double |
sampling |
protected org.nd4j.linalg.api.ndarray.INDArray |
syn0 |
protected org.nd4j.linalg.api.ndarray.INDArray |
syn1 |
protected org.nd4j.linalg.api.ndarray.INDArray |
syn1Neg |
protected org.nd4j.linalg.api.ndarray.INDArray |
table |
protected boolean |
useAdaGrad |
protected int |
window |
Constructor and Description |
---|
DM() |
Modifier and Type | Method and Description |
---|---|
void |
configure(VocabCache<T> vocabCache,
WeightLookupTable<T> lookupTable,
VectorsConfiguration configuration) |
void |
dm(int i,
Sequence<T> sequence,
int b,
AtomicLong nextRandom,
double alpha) |
String |
getCodeName() |
boolean |
isEarlyTerminationHit() |
double |
learnSequence(Sequence<T> sequence,
AtomicLong nextRandom,
double learningRate)
This method does training over the sequence of elements passed into it
|
void |
pretrain(SequenceIterator<T> iterator) |
protected static double MAX_EXP
protected int window
protected boolean useAdaGrad
protected double negative
protected double sampling
protected double[] expTable
protected org.nd4j.linalg.api.ndarray.INDArray syn0
protected org.nd4j.linalg.api.ndarray.INDArray syn1
protected org.nd4j.linalg.api.ndarray.INDArray syn1Neg
protected org.nd4j.linalg.api.ndarray.INDArray table
public String getCodeName()
getCodeName
in interface SequenceLearningAlgorithm<T extends SequenceElement>
public void configure(@NonNull VocabCache<T> vocabCache, @NonNull WeightLookupTable<T> lookupTable, @NonNull VectorsConfiguration configuration)
configure
in interface SequenceLearningAlgorithm<T extends SequenceElement>
public void pretrain(SequenceIterator<T> iterator)
pretrain
in interface SequenceLearningAlgorithm<T extends SequenceElement>
public double learnSequence(Sequence<T> sequence, AtomicLong nextRandom, double learningRate)
SequenceLearningAlgorithm
learnSequence
in interface SequenceLearningAlgorithm<T extends SequenceElement>
public void dm(int i, Sequence<T> sequence, int b, AtomicLong nextRandom, double alpha)
public boolean isEarlyTerminationHit()
isEarlyTerminationHit
in interface SequenceLearningAlgorithm<T extends SequenceElement>
Copyright © 2016. All Rights Reserved.