Example #1
0
    private void ComputeInputs(System.IntPtr model, double[,] values)
    {
        var nbInputs = values.GetUpperBound(0) - 1;

        for (int y = 0; y < values.GetUpperBound(1); y++)
        {
            double[] inputs   = new double[nbInputs];
            int      expected = 0;

            for (int x = 0; x < values.GetUpperBound(0); x++)
            {
                var value = values[x, y];

                if (x == nbInputs)
                {
                    expected = Convert.ToInt32(value);
                }
                else
                {
                    inputs[x] = value;
                }
            }

            int result = PanebWrapper.classification_compute(model, inputs.Length, inputs);
            Debug.Log("Expected: " + expected + "; Result = " + result);
        }
    }
Example #2
0
    private void MoveAxis(System.IntPtr weights)
    {
        foreach (var white in whites)
        {
            var x = white.position.x;
            var z = white.position.z;

            int direction = PanebWrapper.classification_compute(weights, 2, new double[] { x, z });
            white.position += direction == 1 ? Vector3.up : Vector3.down;
        }
    }