Search in sources :

Example 6 with DoubleMatrix

use of org.jblas.DoubleMatrix in project MindsEye by SimiaCryptus.

the class FullyConnectedLayer method multiplyT.

/**
 * Multiply t.
 *
 * @param matrix the matrix
 * @param in     the in
 * @param out    the out
 */
public static void multiplyT(final double[] matrix, @Nonnull final double[] in, @Nonnull final double[] out) {
    @Nonnull DoubleMatrix doubleMatrix = new DoubleMatrix(in.length, out.length, matrix);
    @Nonnull final DoubleMatrix matrixObj = FullyConnectedLayer.transpose(doubleMatrix);
    matrixObj.mmuli(new DoubleMatrix(in.length, 1, in), new DoubleMatrix(out.length, 1, out));
    RecycleBin.DOUBLES.recycle(matrixObj.data, matrixObj.data.length);
}
Also used : DoubleMatrix(org.jblas.DoubleMatrix) Nonnull(javax.annotation.Nonnull)

Aggregations

DoubleMatrix (org.jblas.DoubleMatrix)6 Nonnull (javax.annotation.Nonnull)3 JsonObject (com.google.gson.JsonObject)1 Coordinate (com.simiacryptus.mindseye.lang.Coordinate)1 DataSerializer (com.simiacryptus.mindseye.lang.DataSerializer)1 Delta (com.simiacryptus.mindseye.lang.Delta)1 DeltaSet (com.simiacryptus.mindseye.lang.DeltaSet)1 Layer (com.simiacryptus.mindseye.lang.Layer)1 LayerBase (com.simiacryptus.mindseye.lang.LayerBase)1 RecycleBin (com.simiacryptus.mindseye.lang.RecycleBin)1 Result (com.simiacryptus.mindseye.lang.Result)1 Tensor (com.simiacryptus.mindseye.lang.Tensor)1 TensorArray (com.simiacryptus.mindseye.lang.TensorArray)1 TensorList (com.simiacryptus.mindseye.lang.TensorList)1 FastRandom (com.simiacryptus.util.FastRandom)1 Util (com.simiacryptus.util.Util)1 JsonUtil (com.simiacryptus.util.io.JsonUtil)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Map (java.util.Map)1