public abstract class BaseSparkSequenceLearningAlgorithm extends java.lang.Object implements SparkSequenceLearningAlgorithm
Modifier and Type | Field and Description |
---|---|
protected ElementsLearningAlgorithm<ShallowSequenceElement> |
elementsLearningAlgorithm |
protected VectorsConfiguration |
vectorsConfiguration |
protected VocabCache<ShallowSequenceElement> |
vocabCache |
Constructor and Description |
---|
BaseSparkSequenceLearningAlgorithm() |
Modifier and Type | Method and Description |
---|---|
void |
configure(VocabCache<ShallowSequenceElement> vocabCache,
WeightLookupTable<ShallowSequenceElement> lookupTable,
VectorsConfiguration configuration) |
void |
finish() |
ElementsLearningAlgorithm<ShallowSequenceElement> |
getElementsLearningAlgorithm() |
org.nd4j.linalg.api.ndarray.INDArray |
inferSequence(Sequence<ShallowSequenceElement> sequence,
long nextRandom,
double learningRate,
double minLearningRate,
int iterations)
This method does training on previously unseen paragraph, and returns inferred vector
|
boolean |
isEarlyTerminationHit() |
void |
pretrain(SequenceIterator<ShallowSequenceElement> iterator) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCodeName, learnSequence
protected transient VocabCache<ShallowSequenceElement> vocabCache
protected transient VectorsConfiguration vectorsConfiguration
protected transient ElementsLearningAlgorithm<ShallowSequenceElement> elementsLearningAlgorithm
public void configure(VocabCache<ShallowSequenceElement> vocabCache, WeightLookupTable<ShallowSequenceElement> lookupTable, VectorsConfiguration configuration)
configure
in interface SequenceLearningAlgorithm<ShallowSequenceElement>
public void pretrain(SequenceIterator<ShallowSequenceElement> iterator)
pretrain
in interface SequenceLearningAlgorithm<ShallowSequenceElement>
public boolean isEarlyTerminationHit()
isEarlyTerminationHit
in interface SequenceLearningAlgorithm<ShallowSequenceElement>
public org.nd4j.linalg.api.ndarray.INDArray inferSequence(Sequence<ShallowSequenceElement> sequence, long nextRandom, double learningRate, double minLearningRate, int iterations)
SequenceLearningAlgorithm
inferSequence
in interface SequenceLearningAlgorithm<ShallowSequenceElement>
public ElementsLearningAlgorithm<ShallowSequenceElement> getElementsLearningAlgorithm()
getElementsLearningAlgorithm
in interface SequenceLearningAlgorithm<ShallowSequenceElement>
public void finish()
finish
in interface SequenceLearningAlgorithm<ShallowSequenceElement>