public abstract class BaseSparkLearningAlgorithm extends java.lang.Object implements SparkElementsLearningAlgorithm
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicLong |
nextRandom |
protected VectorsConfiguration |
vectorsConfiguration |
protected VocabCache<ShallowSequenceElement> |
vocabCache |
Modifier | Constructor and Description |
---|---|
protected |
BaseSparkLearningAlgorithm() |
Modifier and Type | Method and Description |
---|---|
static Sequence<ShallowSequenceElement> |
applySubsampling(Sequence<ShallowSequenceElement> sequence,
java.util.concurrent.atomic.AtomicLong nextRandom,
long totalElementsCount,
double prob) |
void |
configure(VocabCache<ShallowSequenceElement> vocabCache,
WeightLookupTable<ShallowSequenceElement> lookupTable,
VectorsConfiguration configuration) |
void |
finish() |
boolean |
isEarlyTerminationHit() |
double |
learnSequence(Sequence<ShallowSequenceElement> sequence,
java.util.concurrent.atomic.AtomicLong nextRandom,
double learningRate)
This method does training over the sequence of elements passed into it
|
void |
pretrain(SequenceIterator<ShallowSequenceElement> iterator) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
frameSequence, getTrainingDriver
getCodeName
protected transient VocabCache<ShallowSequenceElement> vocabCache
protected transient VectorsConfiguration vectorsConfiguration
protected transient java.util.concurrent.atomic.AtomicLong nextRandom
public double learnSequence(Sequence<ShallowSequenceElement> sequence, java.util.concurrent.atomic.AtomicLong nextRandom, double learningRate)
ElementsLearningAlgorithm
learnSequence
in interface ElementsLearningAlgorithm<ShallowSequenceElement>
public void configure(VocabCache<ShallowSequenceElement> vocabCache, WeightLookupTable<ShallowSequenceElement> lookupTable, VectorsConfiguration configuration)
configure
in interface ElementsLearningAlgorithm<ShallowSequenceElement>
public void pretrain(SequenceIterator<ShallowSequenceElement> iterator)
pretrain
in interface ElementsLearningAlgorithm<ShallowSequenceElement>
public boolean isEarlyTerminationHit()
isEarlyTerminationHit
in interface ElementsLearningAlgorithm<ShallowSequenceElement>
public void finish()
finish
in interface ElementsLearningAlgorithm<ShallowSequenceElement>
public static Sequence<ShallowSequenceElement> applySubsampling(@NonNull Sequence<ShallowSequenceElement> sequence, @NonNull java.util.concurrent.atomic.AtomicLong nextRandom, long totalElementsCount, double prob)