for (TwoDimensionalMap.Entry<String, String, SimpleMatrix> entry : model.binaryTransform) {
int numRows = entry.getValue().numRows();
int numCols = entry.getValue().numCols();
binaryTD.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));
}
if (!model.op.combineClassification) {
for (TwoDimensionalMap.Entry<String, String, SimpleMatrix> entry : model.binaryClassification) {
int numRows = entry.getValue().numRows();
int numCols = entry.getValue().numCols();
binaryCD.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));
}
}
if (model.op.useTensors) {
for (TwoDimensionalMap.Entry<String, String, SimpleTensor> entry : model.binaryTensors) {
int numRows = entry.getValue().numRows();
int numCols = entry.getValue().numCols();
int numSlices = entry.getValue().numSlices();
binaryTensorTD.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleTensor(numRows, numCols, numSlices));
}
}
for (Map.Entry<String, SimpleMatrix> entry : model.unaryClassification.entrySet()) {
int numRows = entry.getValue().numRows();
int numCols = entry.getValue().numCols();
unaryCD.put(entry.getKey(), new SimpleMatrix(numRows, numCols));
}
for (Map.Entry<String, SimpleMatrix> entry : model.wordVectors.entrySet()) {
int numRows = entry.getValue().numRows();
int numCols = entry.getValue().numCols();
wordVectorD.put(entry.getKey(), new SimpleMatrix(numRows, numCols));
}
// TODO: This part can easily be parallelized
List<Tree> forwardPropTrees = Generics.newArrayList();
for (Tree tree : trainingBatch) {