当前位置: 首页>>代码示例>>C#>>正文


C# BasicNetwork.TagLayer方法代码示例

本文整理汇总了C#中BasicNetwork.TagLayer方法的典型用法代码示例。如果您正苦于以下问题:C# BasicNetwork.TagLayer方法的具体用法?C# BasicNetwork.TagLayer怎么用?C# BasicNetwork.TagLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BasicNetwork的用法示例。


在下文中一共展示了BasicNetwork.TagLayer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Generate

        /// <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;
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:36,代码来源:CPNPattern.cs

示例2: Generate

        /// <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;


        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:29,代码来源:NEATPattern.cs

示例3: Generate

 /// <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;
 }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:30,代码来源:RadialBasisPattern.cs

示例4: Generate

        /// <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;
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:33,代码来源:BAMPattern.cs

示例5: Generate

        /// <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;
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:41,代码来源:ART1Pattern.cs


注:本文中的BasicNetwork.TagLayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。