public interface WeightLookupTable<T extends SequenceElement>
extends java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
double |
getGradient(int column,
double gradient)
Returns gradient for specified word
|
java.lang.Long |
getTableId()
Returns unique ID of this table.
|
VocabCache<T> |
getVocabCache()
Returns corresponding vocabulary
|
org.nd4j.linalg.api.ndarray.INDArray |
getWeights() |
void |
iterate(T w1,
T w2)
Deprecated.
|
void |
iterateSample(T w1,
T w2,
java.util.concurrent.atomic.AtomicLong nextRandom,
double alpha)
Deprecated.
|
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(BarnesHutTsne tsne,
int numWords,
java.io.File file)
Render the words via TSNE
|
void |
plotVocab(BarnesHutTsne tsne,
int numWords,
UiConnectionInfo connectionInfo)
Render the words via TSNE
|
void |
plotVocab(int numWords,
java.io.File file)
Render the words via tsne
|
void |
plotVocab(int numWords,
UiConnectionInfo connectionInfo)
Render the words via tsne
|
void |
putCode(int codeIndex,
org.nd4j.linalg.api.ndarray.INDArray code) |
void |
putVector(java.lang.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
|
void |
setTableId(java.lang.Long tableId)
Set's table Id.
|
org.nd4j.linalg.api.ndarray.INDArray |
vector(java.lang.String word) |
java.util.Iterator<org.nd4j.linalg.api.ndarray.INDArray> |
vectors()
Iterates through all of the vectors in the cache
|
java.lang.Long getTableId()
void setTableId(java.lang.Long tableId)
tableId - int layerSize()
double getGradient(int column,
double gradient)
column - gradient - void resetWeights(boolean reset)
reset - void plotVocab(BarnesHutTsne tsne, int numWords, UiConnectionInfo connectionInfo)
tsne - the tsne to usevoid plotVocab(BarnesHutTsne tsne, int numWords, java.io.File file)
tsne - the tsne to usevoid plotVocab(int numWords,
UiConnectionInfo connectionInfo)
void plotVocab(int numWords,
java.io.File file)
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 load@Deprecated void iterate(T w1, T w2)
w1 - the first word to iterate onw2 - the second word to iterate on@Deprecated void iterateSample(T w1, T w2, java.util.concurrent.atomic.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(java.lang.String word,
org.nd4j.linalg.api.ndarray.INDArray vector)
word - the word to insertvector - the vector to insertorg.nd4j.linalg.api.ndarray.INDArray vector(java.lang.String word)
word - void resetWeights()
void setLearningRate(double lr)
lr - java.util.Iterator<org.nd4j.linalg.api.ndarray.INDArray> vectors()
org.nd4j.linalg.api.ndarray.INDArray getWeights()
VocabCache<T> getVocabCache()