/// <summary> /// Instanciate a new pattern matching building block. /// </summary> /// <param name="numberOfInputs">The count of input neurons.</param> /// <param name="numberOfClasses">The count of output neurons.</param> /// <param name="builder">A network structure builder (to replace the default).</param> public Controler(int numberOfInputs, int numberOfClasses, INetworkStructureBuilder builder) { ConfigNode.AttachRootNodeToHost(this); _patterns = new PatternSet(numberOfClasses); _outputTraining = new double[numberOfClasses]; _inputPattern = new double[numberOfInputs]; _builder = builder; //BuildNetwork(true); }
/// <summary> /// Builds the Network. Call this method straight after the constructor. /// </summary> /// <param name="adaptConfiguration"></param> public void BuildNetwork(bool adaptConfiguration) { _network = new Network(_node); if (_builder == null) { _builder = new DefaultStructureBuilder(_dimensions, 1); } _builder.Network = _network; if (adaptConfiguration) { _builder.AdaptConfiguration(); } _builder.ConnectNetwork(); _network.FirstLayer.BindActivity(_inputPattern); _network.LastLayer.BindTraining(_outputTraining); }
/// <summary> /// Imports a Network. Call this method instead of <see cref="BuildNetwork"/> if you want to use your own network structure. /// </summary> /// <param name="network"></param> /// <param name="adaptConfiguration"></param> public void ImportNetwork(Network network, bool adaptConfiguration) { _network = network; _node.AttatchToHost(_network); if (_builder == null) { _builder = new DefaultStructureBuilder(_dimensions, 1); } _builder.Network = _network; if (adaptConfiguration) { _builder.AdaptConfiguration(); } _network.FirstLayer.BindActivity(_inputPattern); _network.LastLayer.BindTraining(_outputTraining); }
/// <summary> /// Imports a Network. Call this method instead of <see cref="BuildNetwork"/> if you want to use your own network structure. /// </summary> /// <param name="network"></param> /// <param name="adaptConfiguration"></param> public void ImportNetwork(Network network, bool adaptConfiguration) { _network = network; _node.AttatchToHost(_network); if(_builder == null) _builder = new DefaultStructureBuilder(_dimensions, 1); _builder.Network = _network; if(adaptConfiguration) _builder.AdaptConfiguration(); _network.FirstLayer.BindActivity(_inputPattern); _network.LastLayer.BindTraining(_outputTraining); }
/// <summary> /// Builds the Network. Call this method straight after the constructor. /// </summary> /// <param name="adaptConfiguration"></param> public void BuildNetwork(bool adaptConfiguration) { _network = new Network(_node); if(_builder == null) _builder = new DefaultStructureBuilder(_dimensions, 1); _builder.Network = _network; if(adaptConfiguration) _builder.AdaptConfiguration(); _builder.ConnectNetwork(); _network.FirstLayer.BindActivity(_inputPattern); _network.LastLayer.BindTraining(_outputTraining); }
/// <summary> /// Instanciate a new pattern matching building block. /// </summary> /// <param name="numberOfInputs">The count of input neurons.</param> /// <param name="numberOfClasses">The count of output neurons.</param> /// <param name="builder">A network structure builder (to replace the default).</param> public Controler(int numberOfInputs, int numberOfClasses, INetworkStructureBuilder builder) { ConfigNode.AttachRootNodeToHost(this); _patterns = new PatternSet(numberOfClasses); _outputTraining = new double[numberOfClasses]; _inputPattern = new double[numberOfInputs]; _builder = builder; //BuildNetwork(true); }