Beispiel #1
0
    // Draw ---
    public void Draw()
    {
        if (inNode == null || outNode == null)
        {
            return;
        }
        Vector3 oCenter = new Vector3(outNode.rect.x + outNode.rect.width, outNode.rect.y + outNode.rect.height / 2, 0);
        Vector3 iCenter = new Vector3(inNode.rect.x, inNode.rect.y + inNode.rect.height / 2, 0);

        Handles.DrawBezier(
            oCenter,
            iCenter,
            iCenter,
            oCenter,
            color,
            null,
            (ANNMathHelpers.Sigmoid(connection.weight) - 0.5f) * ANNProperties.GraphicWeightMultiplier
            );
    }
Beispiel #2
0
 private void GenerateUID()
 {
     uid = ANNMathHelpers.GenerateUID("connection");
 }
 // Sigmoid Activation -
 public static float SigmoidActivation(float value)
 {
     return(ANNMathHelpers.Sigmoid(value)); // A = sigmoid(x)
 }
 // Tanh Activation -
 public static float TanhActivation(float value)
 {
     return(ANNMathHelpers.Tanh(value)); // A = Tanh(x)
 }
Beispiel #5
0
 /// SERIALIZATION ///
 // UID ---
 private void GenerateUID()
 {
     uid = ANNMathHelpers.GenerateUID("node");
 }