/// Creation ///
    // Nodes ---
    ANNGraphicNode CreateGNode(ANNNode n)
    {
        if (n == null)
        {
            return(null);
        }
        GUIStyle style = new GUIStyle();

        if (n.GetLayerOrder() == (int)ANNLayerOrders.Input)
        {
            style = inStyle;
        }
        else if (n.GetLayerOrder() == (int)ANNLayerOrders.Output)
        {
            style = outStyle;
        }
        else
        {
            style = hdnStyle;
        }
        ANNGraphicNode gnode = new ANNGraphicNode(n, new Vector2(0, 0), nodeScale.x, nodeScale.y, style);

        gNodes.Add(gnode);
        return(gnode);
    }
Exemple #2
0
    void ApplyActivationToLayer()
    {
        ANNNode node = (ANNNode)target;

        if (node == null || node.network == null)
        {
            return;
        }

        if (node.GetType() == typeof(ANNInputNode))
        {
            List <ANNInputNode> list = node.network.InputNodes;
            for (int i = 0; i < list.Count; ++i)
            {
                list[i].ActivationMethodType = node.ActivationMethodType;
            }
        }
        else if (node.GetType() == typeof(ANNOutputNode))
        {
            List <ANNOutputNode> list = node.network.OutputNodes;
            for (int i = 0; i < list.Count; ++i)
            {
                list[i].ActivationMethodType = node.ActivationMethodType;
            }
        }
        else if (node.GetType() == typeof(ANNHiddenNode))
        {
            List <ANNHiddenNode> list = node.network.GetHiddenNodesFromLayerOrder(node.GetLayerOrder());
            for (int i = 0; i < list.Count; ++i)
            {
                list[i].ActivationMethodType = node.ActivationMethodType;
            }
        }
    }