public class FirstIterationFunctionAdapter extends java.lang.Object implements org.datavec.spark.functions.FlatMapFunctionAdapter<java.util.Iterator<scala.Tuple2<java.util.List<VocabWord>,java.lang.Long>>,java.util.Map.Entry<VocabWord,org.nd4j.linalg.api.ndarray.INDArray>>
Constructor and Description |
---|
FirstIterationFunctionAdapter(org.apache.spark.broadcast.Broadcast<java.util.Map<java.lang.String,java.lang.Object>> word2vecVarMapBroadcast,
org.apache.spark.broadcast.Broadcast<double[]> expTableBroadcast,
org.apache.spark.broadcast.Broadcast<VocabCache<VocabWord>> vocabCacheBroadcast) |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<java.util.Map.Entry<VocabWord,org.nd4j.linalg.api.ndarray.INDArray>> |
call(java.util.Iterator<scala.Tuple2<java.util.List<VocabWord>,java.lang.Long>> pairIter) |
void |
iterateSample(VocabWord w1,
VocabWord w2,
double currentSentenceAlpha) |
void |
skipGram(int ithWordInSentence,
java.util.List<VocabWord> vocabWordsList,
int b,
double currentSentenceAlpha) |
void |
trainSentence(java.util.List<VocabWord> vocabWordsList,
double currentSentenceAlpha) |
public FirstIterationFunctionAdapter(org.apache.spark.broadcast.Broadcast<java.util.Map<java.lang.String,java.lang.Object>> word2vecVarMapBroadcast, org.apache.spark.broadcast.Broadcast<double[]> expTableBroadcast, org.apache.spark.broadcast.Broadcast<VocabCache<VocabWord>> vocabCacheBroadcast)
public java.lang.Iterable<java.util.Map.Entry<VocabWord,org.nd4j.linalg.api.ndarray.INDArray>> call(java.util.Iterator<scala.Tuple2<java.util.List<VocabWord>,java.lang.Long>> pairIter)
public void trainSentence(java.util.List<VocabWord> vocabWordsList, double currentSentenceAlpha)
public void skipGram(int ithWordInSentence, java.util.List<VocabWord> vocabWordsList, int b, double currentSentenceAlpha)