protected bool _componentHasWrongSize(NetComponent componentToAdd) { if (NumberOfComponents == 0) { return(false); } return(_tail.Component.NumberOfOutputs != componentToAdd.NumberOfInputs); }
protected void _addComponent(NetComponent componentToAdd, bool istrainable) { 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, istrainable); if (_head == null) { _head = nodeToAdd; _tail = _head; } else { _tail.Next = nodeToAdd; _tail.Next.Previous = _tail; _tail = _tail.Next; } }
public _networkComponentNode(NetComponent component, bool istrainable) { Component = component; IsTrainable = istrainable; }
public NetComponentChain(NetComponent component) : this() { AddFixed(component); }
public void AddFixed(NetComponent componentToAdd) { _addComponent(componentToAdd, istrainable: false); }