예제 #1
0
 public void vectorToParams(double[] theta) {
   NeuralUtils.vectorToParams(
       theta,
       binaryTransform.valueIterator(),
       binaryClassification.valueIterator(),
       SimpleTensor.iteratorSimpleMatrix(binaryTensors.valueIterator()),
       unaryClassification.values().iterator(),
       wordVectors.values().iterator());
 }
예제 #2
0
 public double[] paramsToVector() {
   int totalSize = totalParamSize();
   return NeuralUtils.paramsToVector(
       totalSize,
       binaryTransform.valueIterator(),
       binaryClassification.valueIterator(),
       SimpleTensor.iteratorSimpleMatrix(binaryTensors.valueIterator()),
       unaryClassification.values().iterator(),
       wordVectors.values().iterator());
 }
예제 #3
0
 SimpleTensor randomBinaryTensor() {
   double range = 1.0 / (4.0 * numHid);
   SimpleTensor tensor = SimpleTensor.random(numHid * 2, numHid * 2, numHid, -range, range, rand);
   return tensor.scale(op.trainOptions.scalingForInit);
 }