Esempio n. 1
0
        protected bool _componentHasWrongSize(NetworkComponent componentToAdd)
        {
            if (NumberOfComponents == 0)
            {
                return(false);
            }

            return(_tail.Component.NumberOfOutputs != componentToAdd.NumberOfInputs);
        }
Esempio n. 2
0
        public override void Add(NetworkComponent componentToAdd)
        {
            Layer layerToAdd = componentToAdd as Layer;

            if (layerToAdd == null)
            {
                throw new ArgumentException("Attempt to add non-layer to a LayerChain.");
            }
            this.Add(layerToAdd);
        }
Esempio n. 3
0
        public virtual void Add(NetworkComponent componentToAdd)
        {
            if (_componentHasWrongSize(componentToAdd))
            {
                throw new ArgumentException("Attempt to add with inputs size differnt from output size of the last existing Layer");
            }

            _networkComponentNode nodeToAdd = new _networkComponentNode(componentToAdd);

            if (_head == null)
            {
                _head = nodeToAdd;
                _tail = _head;
            }
            else
            {
                _tail.Next          = nodeToAdd;
                _tail.Next.Previous = _tail;
                _tail = _tail.Next;
            }
        }
Esempio n. 4
0
 public NetworkComponentChain(NetworkComponent component)
     : this()
 {
     Add(component);
 }
Esempio n. 5
0
 public _networkComponentNode(NetworkComponent component)
 {
     Component = component;
 }