public override _Tensor[] ForwardPass(_Tensor[] inputs) { results[0] = (NN_Utils.Matmul(kernel, inputs[0])) + bias; activationFunction.Activate(ref results[0]); return(results); }
// Update is called once per frame void Update() { if (Input.touchCount == 1) { float startTime = Time.realtimeSinceStartup; NN_Utils.Matmul(inputTensor, weightTensor); float endTime = Time.realtimeSinceStartup; stdTime = endTime - startTime; } if (Input.touchCount == 2) { float initTime = Time.realtimeSinceStartup; double[,] result = new double[1, colums]; alglib.rmatrixgemm(1, colums, inputSize, 1, input, 0, 0, 0, weights, 0, 0, 0, 1, ref result, 0, 0); float endTime = Time.realtimeSinceStartup; gemmTime = endTime - initTime; } }