public class GloVe<T extends SequenceElement> extends java.lang.Object implements ElementsLearningAlgorithm<T>
Modifier and Type | Class and Description |
---|---|
static class |
GloVe.Builder<T extends SequenceElement> |
Modifier and Type | Field and Description |
---|---|
protected double |
alpha |
protected int |
batchSize |
protected double |
learningRate |
protected int |
maxmemory |
Constructor and Description |
---|
GloVe() |
Modifier and Type | Method and Description |
---|---|
void |
configure(VocabCache<T> vocabCache,
WeightLookupTable<T> lookupTable,
VectorsConfiguration configuration) |
void |
finish() |
java.lang.String |
getCodeName() |
boolean |
isEarlyTerminationHit()
Since GloVe is learning representations using elements CoOccurences, all training is done in GloVe class internally, so only first thread will execute learning process,
and the rest of parent threads will just exit learning process
|
double |
learnSequence(Sequence<T> sequence,
java.util.concurrent.atomic.AtomicLong nextRandom,
double learningRate)
Learns sequence using GloVe algorithm
|
void |
pretrain(SequenceIterator<T> iterator)
pretrain is used to build CoOccurrence matrix for GloVe algorithm
|
protected double alpha
protected double learningRate
protected int maxmemory
protected int batchSize
public java.lang.String getCodeName()
getCodeName
in interface ElementsLearningAlgorithm<T extends SequenceElement>
public void finish()
finish
in interface ElementsLearningAlgorithm<T extends SequenceElement>
public void configure(@NonNull VocabCache<T> vocabCache, @NonNull WeightLookupTable<T> lookupTable, @NonNull VectorsConfiguration configuration)
configure
in interface ElementsLearningAlgorithm<T extends SequenceElement>
public void pretrain(@NonNull SequenceIterator<T> iterator)
pretrain
in interface ElementsLearningAlgorithm<T extends SequenceElement>
iterator
- public double learnSequence(@NonNull Sequence<T> sequence, @NonNull java.util.concurrent.atomic.AtomicLong nextRandom, double learningRate)
learnSequence
in interface ElementsLearningAlgorithm<T extends SequenceElement>
sequence
- nextRandom
- learningRate
- public boolean isEarlyTerminationHit()
isEarlyTerminationHit
in interface ElementsLearningAlgorithm<T extends SequenceElement>