@Deprecated public class Word2VecPerformerVoid extends java.lang.Object implements org.apache.spark.api.java.function.VoidFunction<Pair<java.util.List<VocabWord>,java.util.concurrent.atomic.AtomicLong>>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADAGRAD
Deprecated.
|
static java.lang.String |
ALPHA
Deprecated.
|
static java.lang.String |
ITERATIONS
Deprecated.
|
static java.lang.String |
MIN_ALPHA
Deprecated.
|
static java.lang.String |
NAME_SPACE
Deprecated.
|
static java.lang.String |
NEGATIVE
Deprecated.
|
static java.lang.String |
NUM_WORDS
Deprecated.
|
static java.lang.String |
TABLE
Deprecated.
|
static java.lang.String |
VECTOR_LENGTH
Deprecated.
|
static java.lang.String |
WINDOW
Deprecated.
|
Constructor and Description |
---|
Word2VecPerformerVoid(org.apache.spark.SparkConf sc,
org.apache.spark.broadcast.Broadcast<java.util.concurrent.atomic.AtomicLong> wordCount,
InMemoryLookupTable weights)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
call(Pair<java.util.List<VocabWord>,java.util.concurrent.atomic.AtomicLong> pair)
Deprecated.
|
double |
getAlpha()
Deprecated.
|
double[] |
getExpTable()
Deprecated.
|
int |
getIterations()
Deprecated.
|
int |
getLastChecked()
Deprecated.
|
static org.slf4j.Logger |
getLog()
Deprecated.
|
static double |
getMAX_EXP()
Deprecated.
|
double |
getMinAlpha()
Deprecated.
|
double |
getNegative()
Deprecated.
|
java.util.concurrent.atomic.AtomicLong |
getNextRandom()
Deprecated.
|
int |
getNumWords()
Deprecated.
|
org.nd4j.linalg.api.ndarray.INDArray |
getTable()
Deprecated.
|
int |
getTotalWords()
Deprecated.
|
int |
getVectorLength()
Deprecated.
|
InMemoryLookupTable |
getWeights()
Deprecated.
|
int |
getWindow()
Deprecated.
|
org.apache.spark.broadcast.Broadcast<java.util.concurrent.atomic.AtomicLong> |
getWordCount()
Deprecated.
|
boolean |
isUseAdaGrad()
Deprecated.
|
void |
iterateSample(VocabWord w1,
VocabWord w2,
double alpha)
Deprecated.
Iterate on the given 2 vocab words
|
void |
setAlpha(double alpha)
Deprecated.
|
void |
setExpTable(double[] expTable)
Deprecated.
|
void |
setIterations(int iterations)
Deprecated.
|
void |
setLastChecked(int lastChecked)
Deprecated.
|
static void |
setMAX_EXP(double MAX_EXP)
Deprecated.
|
void |
setMinAlpha(double minAlpha)
Deprecated.
|
void |
setNegative(double negative)
Deprecated.
|
void |
setNextRandom(java.util.concurrent.atomic.AtomicLong nextRandom)
Deprecated.
|
void |
setNumWords(int numWords)
Deprecated.
|
void |
setTable(org.nd4j.linalg.api.ndarray.INDArray table)
Deprecated.
|
void |
setTotalWords(int totalWords)
Deprecated.
|
void |
setup(org.apache.spark.SparkConf conf)
Deprecated.
|
void |
setUseAdaGrad(boolean useAdaGrad)
Deprecated.
|
void |
setVectorLength(int vectorLength)
Deprecated.
|
void |
setWeights(InMemoryLookupTable weights)
Deprecated.
|
void |
setWindow(int window)
Deprecated.
|
void |
setWordCount(org.apache.spark.broadcast.Broadcast<java.util.concurrent.atomic.AtomicLong> wordCount)
Deprecated.
|
void |
skipGram(int i,
java.util.List<VocabWord> sentence,
int b,
double alpha)
Deprecated.
Train via skip gram
|
void |
trainSentence(java.util.List<VocabWord> sentence,
double alpha)
Deprecated.
Train on a list of vocab words
|
public static final java.lang.String NAME_SPACE
public static final java.lang.String VECTOR_LENGTH
public static final java.lang.String ADAGRAD
public static final java.lang.String NEGATIVE
public static final java.lang.String NUM_WORDS
public static final java.lang.String TABLE
public static final java.lang.String WINDOW
public static final java.lang.String ALPHA
public static final java.lang.String MIN_ALPHA
public static final java.lang.String ITERATIONS
public Word2VecPerformerVoid(org.apache.spark.SparkConf sc, org.apache.spark.broadcast.Broadcast<java.util.concurrent.atomic.AtomicLong> wordCount, InMemoryLookupTable weights)
public void setup(org.apache.spark.SparkConf conf)
public int getVectorLength()
public void setVectorLength(int vectorLength)
public double[] getExpTable()
public void setExpTable(double[] expTable)
public InMemoryLookupTable getWeights()
public void setWeights(InMemoryLookupTable weights)
public org.apache.spark.broadcast.Broadcast<java.util.concurrent.atomic.AtomicLong> getWordCount()
public void setWordCount(org.apache.spark.broadcast.Broadcast<java.util.concurrent.atomic.AtomicLong> wordCount)
public int getLastChecked()
public void setLastChecked(int lastChecked)
public static org.slf4j.Logger getLog()
public int getIterations()
public void setIterations(int iterations)
public int getTotalWords()
public void setTotalWords(int totalWords)
public double getMinAlpha()
public void setMinAlpha(double minAlpha)
public double getAlpha()
public void setAlpha(double alpha)
public java.util.concurrent.atomic.AtomicLong getNextRandom()
public void setNextRandom(java.util.concurrent.atomic.AtomicLong nextRandom)
public int getWindow()
public void setWindow(int window)
public org.nd4j.linalg.api.ndarray.INDArray getTable()
public void setTable(org.nd4j.linalg.api.ndarray.INDArray table)
public int getNumWords()
public void setNumWords(int numWords)
public double getNegative()
public void setNegative(double negative)
public boolean isUseAdaGrad()
public void setUseAdaGrad(boolean useAdaGrad)
public static double getMAX_EXP()
public static void setMAX_EXP(double MAX_EXP)
public void trainSentence(java.util.List<VocabWord> sentence, double alpha)
sentence
- the list of vocab words to train onpublic void skipGram(int i, java.util.List<VocabWord> sentence, int b, double alpha)
i
- sentence
- public void iterateSample(VocabWord w1, VocabWord w2, double alpha)
w1
- the first word to iterate onw2
- the second word to iterate on