public class SentimentModel extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> |
binaryClassification
CxN+1, where N = size of word vectors, C is the number of classes
|
int |
binaryClassificationSize
How many elements a classification matrix has
|
TwoDimensionalMap<String,String,SimpleTensor> |
binaryTensors
2Nx2NxN, where N is the size of the word vectors
|
int |
binaryTensorSize
How many elements the binary transformation tensors have
|
TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> |
binaryTransform
Nx2N+1, where N is the size of the word vectors
|
int |
binaryTransformSize
How many elements a transformation matrix has
|
int |
numBinaryMatrices
Cached here for easy calculation of the model size;
TwoDimensionalMap does not return that in O(1) time
|
int |
numClasses
How many classes the RNN is built to test against
|
int |
numHid
Dimension of hidden layers, size of word vectors, etc
|
int |
numUnaryMatrices
Cached here for easy calculation of the model size;
TwoDimensionalMap does not return that in O(1) time
|
Map<String,org.ejml.simple.SimpleMatrix> |
unaryClassification
CxN+1, where N = size of word vectors, C is the number of classes
|
int |
unaryClassificationSize
How many elements a classification matrix has
|
Map<String,org.ejml.simple.SimpleMatrix> |
wordVectors |
Constructor and Description |
---|
SentimentModel(RNNOptions op,
List<Tree> trainingTrees)
The traditional way of initializing an empty model suitable for training.
|
Modifier and Type | Method and Description |
---|---|
String |
basicCategory(String category) |
org.ejml.simple.SimpleMatrix |
getBinaryClassification(String left,
String right) |
SimpleTensor |
getBinaryTensor(String left,
String right) |
org.ejml.simple.SimpleMatrix |
getBinaryTransform(String left,
String right) |
org.ejml.simple.SimpleMatrix |
getClassWForNode(Tree node) |
SimpleTensor |
getTensorForNode(Tree node) |
org.ejml.simple.SimpleMatrix |
getUnaryClassification(String category) |
String |
getVocabWord(String word) |
org.ejml.simple.SimpleMatrix |
getWForNode(Tree node) |
org.ejml.simple.SimpleMatrix |
getWordVector(String word) |
static SentimentModel |
loadSerialized(String path) |
double[] |
paramsToVector() |
void |
printParamInformation(int index) |
void |
saveSerialized(String path) |
int |
totalParamSize() |
void |
vectorToParams(double[] theta) |
public final TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryTransform
public final TwoDimensionalMap<String,String,SimpleTensor> binaryTensors
public final TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryClassification
public final Map<String,org.ejml.simple.SimpleMatrix> unaryClassification
public final int numClasses
public final int numHid
public final int numBinaryMatrices
public final int binaryTransformSize
public final int binaryTensorSize
public final int binaryClassificationSize
public final int numUnaryMatrices
public final int unaryClassificationSize
public SentimentModel(RNNOptions op, List<Tree> trainingTrees)
public int totalParamSize()
public double[] paramsToVector()
public void vectorToParams(double[] theta)
public org.ejml.simple.SimpleMatrix getWForNode(Tree node)
public SimpleTensor getTensorForNode(Tree node)
public org.ejml.simple.SimpleMatrix getClassWForNode(Tree node)
public org.ejml.simple.SimpleMatrix getWordVector(String word)
public org.ejml.simple.SimpleMatrix getUnaryClassification(String category)
public org.ejml.simple.SimpleMatrix getBinaryClassification(String left, String right)
public org.ejml.simple.SimpleMatrix getBinaryTransform(String left, String right)
public SimpleTensor getBinaryTensor(String left, String right)
public void saveSerialized(String path)
public static SentimentModel loadSerialized(String path)
public void printParamInformation(int index)