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


C# BasicNetwork.AddLayer方法代码示例

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


在下文中一共展示了BasicNetwork.AddLayer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 Hopfield neural network.
        /// </summary>
        /// <returns>The generated network.</returns>
        public BasicNetwork Generate()
        {
            ILayer layer = new BasicLayer(new ActivationBiPolar(), false,
                    this.neuronCount);

            BasicNetwork result = new BasicNetwork(new HopfieldLogic());
            result.AddLayer(layer);
            layer.AddNext(layer);
            layer.X = PatternConst.START_X;
            layer.Y = PatternConst.START_Y;
            result.Structure.FinalizeStructure();
            result.Reset();
            return result;
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:18,代码来源:HopfieldPattern.cs

示例3: Generate

 /// <summary>
 /// Generate the RSOM 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);
     int y = PatternConst.START_Y;
     BasicNetwork network = new BasicNetwork();
     network.AddLayer(input);
     network.AddLayer(output);
     input.X = PatternConst.START_X;
     output.X = PatternConst.START_X;
     input.Y = y;
     y += PatternConst.INC_Y;
     output.Y = y;
     network.Logic = new SOMLogic();
     network.Structure.FinalizeStructure();
     network.Reset();
     return network;
 }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:24,代码来源:SOMPattern.cs

示例4: Generate

        /// <summary>
        /// Generate a Jordan neural network.
        /// </summary>
        /// <returns>A Jordan neural network.</returns>
        public BasicNetwork Generate()
        {
            // construct an Jordan type network
            ILayer input = new BasicLayer(this.activation, false,
                   this.inputNeurons);
            ILayer hidden = new BasicLayer(this.activation, true,
                   this.hiddenNeurons);
            ILayer output = new BasicLayer(this.activation, true,
                   this.outputNeurons);
            ILayer context = new ContextLayer(this.outputNeurons);
            BasicNetwork network = new BasicNetwork();
            network.AddLayer(input);
            network.AddLayer(hidden);
            network.AddLayer(output);

            output.AddNext(context, SynapseType.OneToOne);
            context.AddNext(hidden);

            int y = PatternConst.START_Y;
            input.X = PatternConst.START_X;
            input.Y = y;
            y += PatternConst.INC_Y;
            hidden.X = PatternConst.START_X;
            hidden.Y = y;
            context.X = PatternConst.INDENT_X;
            context.Y = y;
            y += PatternConst.INC_Y;
            output.X = PatternConst.START_X;
            output.Y = y;

            network.Structure.FinalizeStructure();
            network.Reset();
            return network;
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:38,代码来源:JordanPattern.cs

示例5: Generate

        /// <summary>
        /// Generate the network.
        /// </summary>
        /// <returns>The generated network.</returns>
        public BasicNetwork Generate()
        {
            ILayer layer = new BasicLayer(new ActivationBiPolar(), true,
                    this.neuronCount);

            BasicNetwork result = new BasicNetwork(new BoltzmannLogic());
            result.SetProperty(BoltzmannLogic.PROPERTY_ANNEAL_CYCLES, this.annealCycles);
            result.SetProperty(BoltzmannLogic.PROPERTY_RUN_CYCLES, this.runCycles);
            result.SetProperty(BoltzmannLogic.PROPERTY_TEMPERATURE, this.temperature);
            result.AddLayer(layer);
            layer.AddNext(layer);
            layer.X = PatternConst.START_X;
            layer.Y = PatternConst.START_Y;
            result.Structure.FinalizeStructure();
            result.Reset();
            return result;
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:21,代码来源:BoltzmannPattern.cs

示例6: 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

示例7: Generate

        /// <summary>
        /// Generate the network.
        /// </summary>
        /// <returns>The generated network.</returns>
        public BasicNetwork Generate()
        {
            BasicNetwork network = new BasicNetwork();

            int y = PatternConst.START_Y;

            ILayer inputLayer = new BasicLayer(new ActivationLinear(), false, InputNeurons);
            ILayer outputLayer = new BasicLayer(new ActivationLinear(), true, OutputNeurons);

            network.AddLayer(inputLayer);
            network.AddLayer(outputLayer);
            network.Structure.FinalizeStructure();

            (new RangeRandomizer(-0.5, 0.5)).Randomize(network);

            inputLayer.X = PatternConst.START_X;
            inputLayer.Y = y;
            y += PatternConst.INC_Y;

            outputLayer.X = PatternConst.START_X;
            outputLayer.Y = y;

            return network;
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:28,代码来源:ADALINEPattern.cs

示例8: Generate

        /// <summary>
        /// Generate the Elman neural network.
        /// </summary>
        /// <returns>The Elman neural network.</returns>
        public BasicNetwork Generate()
        {
            int y = PatternConst.START_Y;
            ILayer input = new BasicLayer(this.activation, false,
                   this.inputNeurons);

            BasicNetwork result = new BasicNetwork();
            result.AddLayer(input);

            input.X = PatternConst.START_X;
            input.Y = y;
            y += PatternConst.INC_Y;

            foreach (int count in this.hidden)
            {

                ILayer hidden = new BasicLayer(
                       this.activation, true, count);

                result.AddLayer(hidden);
                hidden.X = PatternConst.START_X;
                hidden.Y = y;
                y += PatternConst.INC_Y;
            }

            ILayer output = new BasicLayer(this.activation, true,
                   this.outputNeurons);
            result.AddLayer(output);
            output.X = PatternConst.START_X;
            output.Y = y;
            y += PatternConst.INC_Y;

            result.Structure.FinalizeStructure();
            result.Reset();

            return result;
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:41,代码来源:FeedFowardPattern.cs

示例9: Generate

        /// <summary>
        /// Generate the RSOM network.
        /// </summary>
        /// <returns>The neural network.</returns>
        public BasicNetwork Generate()
        {
            ILayer output = new BasicLayer(new ActivationLinear(), false,
                    this.outputNeurons);
            ILayer input = new BasicLayer(new ActivationLinear(), false,
                    this.inputNeurons);

            BasicNetwork network = new BasicNetwork();
            ILayer context = new ContextLayer(this.outputNeurons);
            network.AddLayer(input);
            network.AddLayer(output);

            output.AddNext(context, SynapseType.OneToOne);
            context.AddNext(input);

            int y = PatternConst.START_Y;
            input.X = PatternConst.START_X;
            input.Y = y;

            context.X = PatternConst.INDENT_X;
            context.Y = y;

            y += PatternConst.INC_Y;

            output.X = PatternConst.START_X;
            output.Y = y;

            network.Structure.FinalizeStructure();
            network.Reset();
            return network;
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:35,代码来源:RSOMPattern.cs


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