示例#1
0
    public double[] predict(double[] input_array)
    {
        matrix inputs = matrix.fromArray(input_array);
        matrix hidden = matrix.multiply(this.weights_ih, inputs);

        hidden.add(bias_h);
        hidden.map(Globals.activation_function.sig.func1);

        // Generating outputs
        matrix output = matrix.multiply(this.weights_ho, hidden);

        output.add(this.bias_o);
        output.map(Globals.activation_function.sig.func1);

        return(output.toArray());
    }
示例#2
0
    // This function is never used in this car project
    public double[] feedForward(double[] input_array)
    {
        // Generating the hidden outputs
        matrix inputs = matrix.fromArray(input_array);
        matrix hidden = matrix.multiply(this.weights_ih, inputs);

        hidden.add(this.bias_h);
        // Activation fucntion!
        hidden.map(sigmoid);

        // Generating the output's output
        matrix output = matrix.multiply(this.weights_ho, hidden);

        output.add(this.bias_o);
        output.map(sigmoid);

        // Send back to the caller
        return(output.toArray());
    }