public int size() { return backingMap.size(); }
public int size() { int size = 0; for (Map.Entry<K1, TwoDimensionalMap<K2, K3, V>> entry : map.entrySet()) { size += entry.getValue().size(); } return size; }
this.numHid = op.numHid; this.numBinaryMatrices = binaryTransform.size(); binaryTransformSize = numHid * (2 * numHid + 1); if (op.useTensors) {
StringBuilder output = new StringBuilder(); if (binaryTransform.size() > 0) { if (binaryTransform.size() == 1) { output.append("Binary transform matrix\n"); } else { if (binaryTensors.size() > 0) { if (binaryTensors.size() == 1) { output.append("Binary transform tensor\n"); } else { if (binaryClassification.size() > 0) { if (binaryClassification.size() == 1) { output.append("Binary classification matrix\n"); } else {
public DVModel(TwoDimensionalMap<String, String, SimpleMatrix> binaryTransform, Map<String, SimpleMatrix> unaryTransform, TwoDimensionalMap<String, String, SimpleMatrix> binaryScore, Map<String, SimpleMatrix> unaryScore, Map<String, SimpleMatrix> wordVectors, Options op) { this.op = op; this.binaryTransform = binaryTransform; this.unaryTransform = unaryTransform; this.binaryScore = binaryScore; this.unaryScore = unaryScore; this.wordVectors = wordVectors; this.numBinaryMatrices = binaryTransform.size(); this.numUnaryMatrices = unaryTransform.size(); if (numBinaryMatrices > 0) { this.binaryTransformSize = binaryTransform.iterator().next().getValue().getNumElements(); this.binaryScoreSize = binaryScore.iterator().next().getValue().getNumElements(); } else { this.binaryTransformSize = 0; this.binaryScoreSize = 0; } if (numUnaryMatrices > 0) { this.unaryTransformSize = unaryTransform.values().iterator().next().getNumElements(); this.unaryScoreSize = unaryScore.values().iterator().next().getNumElements(); } else { this.unaryTransformSize = 0; this.unaryScoreSize = 0; } this.numRows = op.lexOptions.numHid; this.numCols = op.lexOptions.numHid; this.identity = SimpleMatrix.identity(numRows); this.rand = new Random(op.trainOptions.randomSeed); }
numBinaryMatrices = binaryTransform.size();
numBinaryMatrices = binaryTransform.size(); binaryTransformSize = numHid * (2 * numHid + 1); if (op.useTensors) {
public int size() { return backingMap.size(); }
public int size() { return backingMap.size(); }
public int size() { return backingMap.size(); }
public int size() { int size = 0; for (Map.Entry<K1, TwoDimensionalMap<K2, K3, V>> entry : map.entrySet()) { size += entry.getValue().size(); } return size; }
public int size() { int size = 0; for (Map.Entry<K1, TwoDimensionalMap<K2, K3, V>> entry : map.entrySet()) { size += entry.getValue().size(); } return size; }
public int size() { int size = 0; for (Map.Entry<K1, TwoDimensionalMap<K2, K3, V>> entry : map.entrySet()) { size += entry.getValue().size(); } return size; }
this.numHid = op.numHid; this.numBinaryMatrices = binaryTransform.size(); binaryTransformSize = numHid * (2 * numHid + 1); if (op.useTensors) {
public DVModel(TwoDimensionalMap<String, String, SimpleMatrix> binaryTransform, Map<String, SimpleMatrix> unaryTransform, TwoDimensionalMap<String, String, SimpleMatrix> binaryScore, Map<String, SimpleMatrix> unaryScore, Map<String, SimpleMatrix> wordVectors, Options op) { this.op = op; this.binaryTransform = binaryTransform; this.unaryTransform = unaryTransform; this.binaryScore = binaryScore; this.unaryScore = unaryScore; this.wordVectors = wordVectors; this.numBinaryMatrices = binaryTransform.size(); this.numUnaryMatrices = unaryTransform.size(); if (numBinaryMatrices > 0) { this.binaryTransformSize = binaryTransform.iterator().next().getValue().getNumElements(); this.binaryScoreSize = binaryScore.iterator().next().getValue().getNumElements(); } else { this.binaryTransformSize = 0; this.binaryScoreSize = 0; } if (numUnaryMatrices > 0) { this.unaryTransformSize = unaryTransform.values().iterator().next().getNumElements(); this.unaryScoreSize = unaryScore.values().iterator().next().getNumElements(); } else { this.unaryTransformSize = 0; this.unaryScoreSize = 0; } this.numRows = op.lexOptions.numHid; this.numCols = op.lexOptions.numHid; this.identity = SimpleMatrix.identity(numRows); this.rand = new Random(op.trainOptions.randomSeed); }
public DVModel(TwoDimensionalMap<String, String, SimpleMatrix> binaryTransform, Map<String, SimpleMatrix> unaryTransform, TwoDimensionalMap<String, String, SimpleMatrix> binaryScore, Map<String, SimpleMatrix> unaryScore, Map<String, SimpleMatrix> wordVectors, Options op) { this.op = op; this.binaryTransform = binaryTransform; this.unaryTransform = unaryTransform; this.binaryScore = binaryScore; this.unaryScore = unaryScore; this.wordVectors = wordVectors; this.numBinaryMatrices = binaryTransform.size(); this.numUnaryMatrices = unaryTransform.size(); if (numBinaryMatrices > 0) { this.binaryTransformSize = binaryTransform.iterator().next().getValue().getNumElements(); this.binaryScoreSize = binaryScore.iterator().next().getValue().getNumElements(); } else { this.binaryTransformSize = 0; this.binaryScoreSize = 0; } if (numUnaryMatrices > 0) { this.unaryTransformSize = unaryTransform.values().iterator().next().getNumElements(); this.unaryScoreSize = unaryScore.values().iterator().next().getNumElements(); } else { this.unaryTransformSize = 0; this.unaryScoreSize = 0; } this.numRows = op.lexOptions.numHid; this.numCols = op.lexOptions.numHid; this.identity = SimpleMatrix.identity(numRows); this.rand = new Random(op.trainOptions.randomSeed); }
public DVModel(TwoDimensionalMap<String, String, SimpleMatrix> binaryTransform, Map<String, SimpleMatrix> unaryTransform, TwoDimensionalMap<String, String, SimpleMatrix> binaryScore, Map<String, SimpleMatrix> unaryScore, Map<String, SimpleMatrix> wordVectors, Options op) { this.op = op; this.binaryTransform = binaryTransform; this.unaryTransform = unaryTransform; this.binaryScore = binaryScore; this.unaryScore = unaryScore; this.wordVectors = wordVectors; this.numBinaryMatrices = binaryTransform.size(); this.numUnaryMatrices = unaryTransform.size(); if (numBinaryMatrices > 0) { this.binaryTransformSize = binaryTransform.iterator().next().getValue().getNumElements(); this.binaryScoreSize = binaryScore.iterator().next().getValue().getNumElements(); } else { this.binaryTransformSize = 0; this.binaryScoreSize = 0; } if (numUnaryMatrices > 0) { this.unaryTransformSize = unaryTransform.values().iterator().next().getNumElements(); this.unaryScoreSize = unaryScore.values().iterator().next().getNumElements(); } else { this.unaryTransformSize = 0; this.unaryScoreSize = 0; } this.numRows = op.lexOptions.numHid; this.numCols = op.lexOptions.numHid; this.identity = SimpleMatrix.identity(numRows); this.rand = new Random(op.trainOptions.randomSeed); }