public interface WeightLookupTable extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
iterate(VocabWord w1,
VocabWord w2)
Iterate on the given 2 vocab words
|
void |
iterateSample(VocabWord w1,
VocabWord w2,
AtomicLong nextRandom,
double alpha)
Iterate on the given 2 vocab words
|
int |
layerSize()
The layer size for the lookup table
|
org.nd4j.linalg.api.ndarray.INDArray |
loadCodes(int[] codes)
Loads the co-occurrences for the given codes
|
void |
plotVocab()
Render the words via tsne
|
void |
plotVocab(Tsne tsne)
Render the words via TSNE
|
void |
putCode(int codeIndex,
org.nd4j.linalg.api.ndarray.INDArray code) |
void |
putVector(String word,
org.nd4j.linalg.api.ndarray.INDArray vector)
Inserts a word vector
|
void |
resetWeights()
Reset the weights of the cache
|
void |
resetWeights(boolean reset)
Clear out all weights regardless
|
void |
setLearningRate(double lr)
Sets the learning rate
|
org.nd4j.linalg.api.ndarray.INDArray |
vector(String word) |
Iterator<org.nd4j.linalg.api.ndarray.INDArray> |
vectors()
Iterates through all of the vectors in the cache
|
int layerSize()
void resetWeights(boolean reset)
reset
- void plotVocab(Tsne tsne)
tsne
- the tsne to usevoid plotVocab()
void putCode(int codeIndex, org.nd4j.linalg.api.ndarray.INDArray code)
codeIndex
- code
- org.nd4j.linalg.api.ndarray.INDArray loadCodes(int[] codes)
codes
- the codes to loadvoid iterate(VocabWord w1, VocabWord w2)
w1
- the first word to iterate onw2
- the second word to iterate onvoid iterateSample(VocabWord w1, VocabWord w2, AtomicLong nextRandom, double alpha)
w1
- the first word to iterate onw2
- the second word to iterate onnextRandom
- nextRandom for samplingalpha
- the alpha to use for learningvoid putVector(String word, org.nd4j.linalg.api.ndarray.INDArray vector)
word
- the word to insertvector
- the vector to insertorg.nd4j.linalg.api.ndarray.INDArray vector(String word)
word
- void resetWeights()
void setLearningRate(double lr)
lr
- Iterator<org.nd4j.linalg.api.ndarray.INDArray> vectors()
Copyright © 2015. All rights reserved.