/// <summary> /// The generated network. /// </summary> /// <returns></returns> public BasicNetwork Generate() { BasicNetwork network = new BasicNetwork(new BAMLogic()); ILayer f1Layer = new BasicLayer(new ActivationBiPolar(), false, F1Neurons); ILayer f2Layer = new BasicLayer(new ActivationBiPolar(), false, F2Neurons); ISynapse synapseInputToOutput = new WeightedSynapse(f1Layer, f2Layer); ISynapse synapseOutputToInput = new WeightedSynapse(f2Layer, f1Layer); f1Layer.AddSynapse(synapseInputToOutput); f2Layer.AddSynapse(synapseOutputToInput); network.TagLayer(BAMPattern.TAG_F1, f1Layer); network.TagLayer(BAMPattern.TAG_F2, f2Layer); network.Structure.FinalizeStructure(); network.Structure.FinalizeStructure(); f1Layer.Y = PatternConst.START_Y; f2Layer.Y = PatternConst.START_Y; f1Layer.X = PatternConst.START_X; f2Layer.X = PatternConst.INDENT_X; return(network); }
/// <summary> /// Generate the RBF network. /// </summary> /// <returns>The neural network.</returns> public BasicNetwork Generate() { int y = PatternConst.START_Y; BasicLayer inputLayer = new BasicLayer(new ActivationLinear(), false, this.InputNeurons); inputLayer.X = PatternConst.START_X; inputLayer.Y = y; y += PatternConst.INC_Y; BasicLayer outputLayer = new BasicLayer(ActivationFunction, false, this.OutputNeurons); outputLayer.X = PatternConst.START_X; outputLayer.Y = y; NEATSynapse synapse = new NEATSynapse(inputLayer, outputLayer, this.neurons, this.NEATActivation, 0); synapse.Snapshot = this.Snapshot; inputLayer.AddSynapse(synapse); BasicNetwork network = new BasicNetwork(); network.TagLayer(BasicNetwork.TAG_INPUT, inputLayer); network.TagLayer(BasicNetwork.TAG_OUTPUT, outputLayer); network.Structure.FinalizeStructure(); return(network); }
/// <summary> /// Generate the network. /// </summary> /// <returns>The generated network.</returns> public BasicNetwork Generate() { ILayer input, instar, outstar; int y = PatternConst.START_Y; BasicNetwork network = new BasicNetwork(); network.AddLayer(input = new BasicLayer(new ActivationLinear(), false, this.inputCount)); network.AddLayer(instar = new BasicLayer(new ActivationCompetitive(), false, this.instarCount)); network.AddLayer(outstar = new BasicLayer(new ActivationLinear(), false, this.outstarCount)); network.Structure.FinalizeStructure(); network.Reset(); input.X = PatternConst.START_X; input.Y = y; y += PatternConst.INC_Y; instar.X = PatternConst.START_X; instar.Y = y; y += PatternConst.INC_Y; outstar.X = PatternConst.START_X; outstar.Y = y; // tag as needed network.TagLayer(BasicNetwork.TAG_INPUT, input); network.TagLayer(BasicNetwork.TAG_OUTPUT, outstar); network.TagLayer(CPNPattern.TAG_INSTAR, instar); network.TagLayer(CPNPattern.TAG_OUTSTAR, outstar); return(network); }
/// <summary> /// Generate the RBF network. /// </summary> /// <returns>The neural network.</returns> public BasicNetwork Generate() { ILayer input = new BasicLayer(new ActivationLinear(), false, this.inputNeurons); ILayer output = new BasicLayer(new ActivationLinear(), false, this.outputNeurons); BasicNetwork network = new BasicNetwork(); RadialBasisFunctionLayer rbfLayer = new RadialBasisFunctionLayer( this.hiddenNeurons); network.AddLayer(input); network.AddLayer(rbfLayer, SynapseType.Direct); network.AddLayer(output); network.Structure.FinalizeStructure(); network.Reset(); network.TagLayer(RBF_LAYER, rbfLayer); rbfLayer.RandomizeRBFCentersAndWidths(this.inputNeurons, -1, 1, RBFEnum.Gaussian); int y = PatternConst.START_Y; input.X = PatternConst.START_X; input.Y = y; y += PatternConst.INC_Y; rbfLayer.X = PatternConst.START_X; rbfLayer.Y = y; y += PatternConst.INC_Y; output.X = PatternConst.START_X; output.Y = y; return(network); }
/// <summary> /// Generate the neural network. /// </summary> /// <returns>The generated neural network.</returns> public BasicNetwork Generate() { BasicNetwork network = new BasicNetwork(new ART1Logic()); int y = PatternConst.START_Y; ILayer layerF1 = new BasicLayer(new ActivationLinear(), false, this.InputNeurons); ILayer layerF2 = new BasicLayer(new ActivationLinear(), false, this.OutputNeurons); ISynapse synapseF1toF2 = new WeightedSynapse(layerF1, layerF2); ISynapse synapseF2toF1 = new WeightedSynapse(layerF2, layerF1); layerF1.Next.Add(synapseF1toF2); layerF2.Next.Add(synapseF2toF1); // apply tags network.TagLayer(BasicNetwork.TAG_INPUT, layerF1); network.TagLayer(BasicNetwork.TAG_OUTPUT, layerF2); network.TagLayer(ART1Pattern.TAG_F1, layerF1); network.TagLayer(ART1Pattern.TAG_F2, layerF2); layerF1.X = PatternConst.START_X; layerF1.Y = y; y += PatternConst.INC_Y; layerF2.X = PatternConst.START_X; layerF2.Y = y; network.SetProperty(ARTLogic.PROPERTY_A1, this.A1); network.SetProperty(ARTLogic.PROPERTY_B1, this.B1); network.SetProperty(ARTLogic.PROPERTY_C1, this.C1); network.SetProperty(ARTLogic.PROPERTY_D1, this.D1); network.SetProperty(ARTLogic.PROPERTY_L, this.L); network.SetProperty(ARTLogic.PROPERTY_VIGILANCE, this.Vigilance); network.Structure.FinalizeStructure(); return(network); }
/// <summary> /// Generate the network. /// </summary> /// <returns>The generated network.</returns> public BasicNetwork Generate() { ILayer input, instar, outstar; int y = PatternConst.START_Y; BasicNetwork network = new BasicNetwork(); network.AddLayer(input = new BasicLayer(new ActivationLinear(), false, this.inputCount)); network.AddLayer(instar = new BasicLayer(new ActivationCompetitive(), false, this.instarCount)); network.AddLayer(outstar = new BasicLayer(new ActivationLinear(), false, this.outstarCount)); network.Structure.FinalizeStructure(); network.Reset(); input.X = PatternConst.START_X; input.Y = y; y += PatternConst.INC_Y; instar.X = PatternConst.START_X; instar.Y = y; y += PatternConst.INC_Y; outstar.X = PatternConst.START_X; outstar.Y = y; // tag as needed network.TagLayer(BasicNetwork.TAG_INPUT, input); network.TagLayer(BasicNetwork.TAG_OUTPUT, outstar); network.TagLayer(CPNPattern.TAG_INSTAR, instar); network.TagLayer(CPNPattern.TAG_OUTSTAR, outstar); return network; }
/// <summary> /// Generate the RBF network. /// </summary> /// <returns>The neural network.</returns> public BasicNetwork Generate() { int y = PatternConst.START_Y; BasicLayer inputLayer = new BasicLayer(new ActivationLinear(), false, this.InputNeurons); inputLayer.X = PatternConst.START_X; inputLayer.Y = y; y += PatternConst.INC_Y; BasicLayer outputLayer = new BasicLayer(ActivationFunction, false, this.OutputNeurons); outputLayer.X = PatternConst.START_X; outputLayer.Y = y; NEATSynapse synapse = new NEATSynapse(inputLayer, outputLayer, this.neurons, this.NEATActivation, 0); synapse.Snapshot = this.Snapshot; inputLayer.AddSynapse(synapse); BasicNetwork network = new BasicNetwork(); network.TagLayer(BasicNetwork.TAG_INPUT, inputLayer); network.TagLayer(BasicNetwork.TAG_OUTPUT, outputLayer); network.Structure.FinalizeStructure(); return network; }
/// <summary> /// The generated network. /// </summary> /// <returns></returns> public BasicNetwork Generate() { BasicNetwork network = new BasicNetwork(new BAMLogic()); ILayer f1Layer = new BasicLayer(new ActivationBiPolar(), false, F1Neurons); ILayer f2Layer = new BasicLayer(new ActivationBiPolar(), false, F2Neurons); ISynapse synapseInputToOutput = new WeightedSynapse(f1Layer, f2Layer); ISynapse synapseOutputToInput = new WeightedSynapse(f2Layer, f1Layer); f1Layer.AddSynapse(synapseInputToOutput); f2Layer.AddSynapse(synapseOutputToInput); network.TagLayer(BAMPattern.TAG_F1, f1Layer); network.TagLayer(BAMPattern.TAG_F2, f2Layer); network.Structure.FinalizeStructure(); network.Structure.FinalizeStructure(); f1Layer.Y = PatternConst.START_Y; f2Layer.Y = PatternConst.START_Y; f1Layer.X = PatternConst.START_X; f2Layer.X = PatternConst.INDENT_X; return network; }
/// <summary> /// Generate the RBF network. /// </summary> /// <returns>The neural network.</returns> public BasicNetwork Generate() { ILayer input = new BasicLayer(new ActivationLinear(), false, this.inputNeurons); ILayer output = new BasicLayer(new ActivationLinear(), false, this.outputNeurons); BasicNetwork network = new BasicNetwork(); RadialBasisFunctionLayer rbfLayer = new RadialBasisFunctionLayer( this.hiddenNeurons); network.AddLayer(input); network.AddLayer(rbfLayer, SynapseType.Direct); network.AddLayer(output); network.Structure.FinalizeStructure(); network.Reset(); network.TagLayer(RBF_LAYER, rbfLayer); rbfLayer.RandomizeRBFCentersAndWidths(this.inputNeurons, -1, 1, RBFEnum.Gaussian); int y = PatternConst.START_Y; input.X = PatternConst.START_X; input.Y = y; y += PatternConst.INC_Y; rbfLayer.X = PatternConst.START_X; rbfLayer.Y = y; y += PatternConst.INC_Y; output.X = PatternConst.START_X; output.Y = y; return network; }
/// <summary> /// Generate the neural network. /// </summary> /// <returns>The generated neural network.</returns> public BasicNetwork Generate() { BasicNetwork network = new BasicNetwork(new ART1Logic()); int y = PatternConst.START_Y; ILayer layerF1 = new BasicLayer(new ActivationLinear(), false, this.InputNeurons); ILayer layerF2 = new BasicLayer(new ActivationLinear(), false, this.OutputNeurons); ISynapse synapseF1toF2 = new WeightedSynapse(layerF1, layerF2); ISynapse synapseF2toF1 = new WeightedSynapse(layerF2, layerF1); layerF1.Next.Add(synapseF1toF2); layerF2.Next.Add(synapseF2toF1); // apply tags network.TagLayer(BasicNetwork.TAG_INPUT, layerF1); network.TagLayer(BasicNetwork.TAG_OUTPUT, layerF2); network.TagLayer(ART1Pattern.TAG_F1, layerF1); network.TagLayer(ART1Pattern.TAG_F2, layerF2); layerF1.X = PatternConst.START_X; layerF1.Y = y; y += PatternConst.INC_Y; layerF2.X = PatternConst.START_X; layerF2.Y = y; network.SetProperty(ARTLogic.PROPERTY_A1, this.A1); network.SetProperty(ARTLogic.PROPERTY_B1, this.B1); network.SetProperty(ARTLogic.PROPERTY_C1, this.C1); network.SetProperty(ARTLogic.PROPERTY_D1, this.D1); network.SetProperty(ARTLogic.PROPERTY_L, this.L); network.SetProperty(ARTLogic.PROPERTY_VIGILANCE, this.Vigilance); network.Structure.FinalizeStructure(); return network; }