Exemple #1
0
        public void AddConnection(string p_inLayerId, string p_outLayerId, Connection p_connecion)
        {
            NeuralGroup inGroup  = _layers[p_inLayerId].OutputGroup;
            NeuralGroup outGroup = _layers[p_outLayerId].InputGroup;

            _connections.Add(p_connecion.Id, p_connecion);
            if (inGroup != null)
            {
                inGroup.AddOutConnection(p_connecion);
            }
            if (outGroup != null)
            {
                outGroup.AddInConnection(p_connecion);
            }

            CreateGraphBase();
        }
Exemple #2
0
        public Connection AddConnection(string p_inLayerId, string p_outLayerId, Connection.INIT p_init = Connection.INIT.UNIFORM, bool p_trainable = true, float p_limit = 0.05f)
        {
            NeuralGroup inGroup  = _layers[p_inLayerId].OutputGroup;
            NeuralGroup outGroup = _layers[p_outLayerId].InputGroup;

            Connection connection = new Connection(inGroup, outGroup, p_trainable, _layers[p_inLayerId].Id, _layers[p_outLayerId].Id);

            connection.Init(p_init, p_limit);
            _connections.Add(connection.Id, connection);
            if (inGroup != null)
            {
                inGroup.AddOutConnection(connection);
            }
            if (outGroup != null)
            {
                outGroup.AddInConnection(connection);
            }

            CreateGraphBase();

            return(connection);
        }