public class DBOW<T extends SequenceElement> extends Object implements SequenceLearningAlgorithm<T>
| Modifier and Type | Field and Description |
|---|---|
protected VectorsConfiguration |
configuration |
protected WeightLookupTable<T> |
lookupTable |
protected double |
negative |
protected SkipGram<T> |
skipGram |
protected boolean |
useAdaGrad |
protected VocabCache<T> |
vocabCache |
protected int |
window |
| Constructor and Description |
|---|
DBOW() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(VocabCache<T> vocabCache,
WeightLookupTable<T> lookupTable,
VectorsConfiguration configuration) |
protected void |
dbow(int i,
Sequence<T> sequence,
int b,
AtomicLong nextRandom,
double alpha) |
String |
getCodeName() |
boolean |
isEarlyTerminationHit()
DBOW has no reasons for early termination
|
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)
DBOW doesn't involves any pretraining
|
protected VocabCache<T extends SequenceElement> vocabCache
protected WeightLookupTable<T extends SequenceElement> lookupTable
protected VectorsConfiguration configuration
protected int window
protected boolean useAdaGrad
protected double negative
protected SkipGram<T extends SequenceElement> skipGram
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>iterator - public double learnSequence(@NonNull
Sequence<T> sequence,
@NonNull
AtomicLong nextRandom,
double learningRate)
SequenceLearningAlgorithmlearnSequence in interface SequenceLearningAlgorithm<T extends SequenceElement>public boolean isEarlyTerminationHit()
isEarlyTerminationHit in interface SequenceLearningAlgorithm<T extends SequenceElement>protected void dbow(int i,
Sequence<T> sequence,
int b,
AtomicLong nextRandom,
double alpha)
Copyright © 2016. All Rights Reserved.