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


C# EncogWriteHelper.Flush方法代码示例

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


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

示例1: Save

        /// <summary>
        /// Save the script to a stream.
        /// </summary>
        ///
        /// <param name="stream">The output stream.</param>
        public void Save(Stream stream)
        {
            var xout = new EncogWriteHelper(stream);
            SaveSubSection(xout, "HEADER", "DATASOURCE");
            SaveConfig(xout);

            if (_script.Fields != null)
            {
                SaveData(xout);
                SaveNormalize(xout);
            }

            SaveSubSection(xout, "RANDOMIZE", "CONFIG");
            SaveSubSection(xout, "CLUSTER", "CONFIG");
            SaveSubSection(xout, "BALANCE", "CONFIG");

            if (_script.Segregate.SegregateTargets != null)
            {
                SaveSegregate(xout);
            }
            SaveSubSection(xout, "GENERATE", "CONFIG");
            SaveMachineLearning(xout);
            SaveTasks(xout);
            xout.Flush();
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:30,代码来源:ScriptSave.cs

示例2: Save

 public void Save(Stream stream)
 {
     EncogWriteHelper helper = new EncogWriteHelper(stream);
     if (0 == 0)
     {
         this.x4ec53e22935ca8a4(helper, "HEADER", "DATASOURCE");
         goto Label_00BF;
     }
     Label_000D:
     this.xb65907545d46dd44(helper);
     this.x3d1973763c1ba5f6(helper);
     helper.Flush();
     return;
     Label_0094:
     this.x4ec53e22935ca8a4(helper, "RANDOMIZE", "CONFIG");
     if (-2 == 0)
     {
         goto Label_00C8;
     }
     goto Label_00DD;
     Label_00BF:
     this.x2cf4bfede7840d5b(helper);
     if (this._x594135906c55045c.Fields == null)
     {
         goto Label_0094;
     }
     Label_00C8:
     this.x80a029c2a0fbca61(helper);
     this.x6f59fa9537dbb843(helper);
     if (2 != 0)
     {
         if (0 != 0)
         {
             goto Label_00BF;
         }
         goto Label_0094;
     }
     Label_00DD:
     if (0 == 0)
     {
         this.x4ec53e22935ca8a4(helper, "CLUSTER", "CONFIG");
         this.x4ec53e22935ca8a4(helper, "BALANCE", "CONFIG");
         if (this._x594135906c55045c.Segregate.SegregateTargets != null)
         {
             this.x312a5c458079831e(helper);
         }
         else if (0 != 0)
         {
             goto Label_00BF;
         }
         this.x4ec53e22935ca8a4(helper, "GENERATE", "CONFIG");
     }
     goto Label_000D;
 }
开发者ID:neismit,项目名称:emds,代码行数:54,代码来源:ScriptSave.cs

示例3: Save


//.........这里部分代码省略.........
            var pop = (NEATPopulation) obj;
            xout.AddSection("NEAT-POPULATION");
            xout.AddSubSection("CONFIG");
            xout.WriteProperty(PersistConst.Snapshot, pop.Snapshot);
            xout.WriteProperty(NEATPopulation.PropertyOutputActivation,
                               pop.OutputActivationFunction);
            xout.WriteProperty(NEATPopulation.PropertyNEATActivation,
                               pop.NeatActivationFunction);
            xout.WriteProperty(PersistConst.InputCount, pop.InputCount);
            xout.WriteProperty(PersistConst.OutputCount, pop.OutputCount);
            xout.WriteProperty(PopulationConst.PropertyOldAgePenalty,
                               pop.OldAgePenalty);
            xout.WriteProperty(PopulationConst.PropertyOldAgeThreshold,
                               pop.OldAgeThreshold);
            xout.WriteProperty(PopulationConst.PropertyPopulationSize,
                               pop.PopulationSize);
            xout.WriteProperty(PopulationConst.PropertySurvivalRate,
                               pop.SurvivalRate);
            xout.WriteProperty(PopulationConst.PropertyYoungAgeThreshold,
                               pop.YoungBonusAgeThreshold);
            xout.WriteProperty(PopulationConst.PropertyYoungAgeBonus,
                               pop.YoungScoreBonus);
            xout.WriteProperty(PopulationConst.PropertyNextGenomeID, pop.GenomeIDGenerate.CurrentID);
            xout.WriteProperty(PopulationConst.PropertyNextInnovationID, pop.InnovationIDGenerate.CurrentID);
            xout.WriteProperty(PopulationConst.PropertyNextGeneID, pop.GeneIDGenerate.CurrentID);
            xout.WriteProperty(PopulationConst.PropertyNextSpeciesID, pop.SpeciesIDGenerate.CurrentID);
            xout.AddSubSection("INNOVATIONS");
            if (pop.Innovations != null)
            {
                foreach (IInnovation innovation  in  pop.Innovations.Innovations)
                {
                    var neatInnovation = (NEATInnovation) innovation;
                    xout.AddColumn(neatInnovation.InnovationID);
                    xout.AddColumn(InnovationTypeToString(neatInnovation.InnovationType));
                    xout.AddColumn(NeuronTypeToString(neatInnovation.NeuronType));
                    xout.AddColumn(neatInnovation.SplitX);
                    xout.AddColumn(neatInnovation.SplitY);
                    xout.AddColumn(neatInnovation.NeuronID);
                    xout.AddColumn(neatInnovation.FromNeuronID);
                    xout.AddColumn(neatInnovation.ToNeuronID);
                    xout.WriteLine();
                }
            }
            xout.AddSubSection("GENOMES");

            foreach (IGenome genome  in  pop.Genomes)
            {
                var neatGenome = (NEATGenome) genome;
                xout.AddColumn("g");
                xout.AddColumn(neatGenome.GenomeID);
                xout.AddColumn(neatGenome.SpeciesID);
                xout.AddColumn(neatGenome.AdjustedScore);
                xout.AddColumn(neatGenome.AmountToSpawn);
                xout.AddColumn(neatGenome.NetworkDepth);
                xout.AddColumn(neatGenome.Score);
                xout.WriteLine();

                foreach (IGene neuronGene  in  neatGenome.Neurons.Genes)
                {
                    var neatNeuronGene = (NEATNeuronGene) neuronGene;
                    xout.AddColumn("n");
                    xout.AddColumn(neatNeuronGene.Id);
                    xout.AddColumn(NeuronTypeToString(neatNeuronGene.NeuronType));
                    xout.AddColumn(neatNeuronGene.Enabled);
                    xout.AddColumn(neatNeuronGene.InnovationId);
                    xout.AddColumn(neatNeuronGene.ActivationResponse);
                    xout.AddColumn(neatNeuronGene.SplitX);
                    xout.AddColumn(neatNeuronGene.SplitY);
                    xout.WriteLine();
                }

                foreach (IGene linkGene  in  neatGenome.Links.Genes)
                {
                    var neatLinkGene = (NEATLinkGene) linkGene;
                    xout.AddColumn("l");
                    xout.AddColumn(neatLinkGene.Id);
                    xout.AddColumn(neatLinkGene.Enabled);
                    xout.AddColumn(neatLinkGene.Recurrent);
                    xout.AddColumn(neatLinkGene.FromNeuronID);
                    xout.AddColumn(neatLinkGene.ToNeuronID);
                    xout.AddColumn(neatLinkGene.Weight);
                    xout.AddColumn(neatLinkGene.InnovationId);
                    xout.WriteLine();
                }
            }
            xout.AddSubSection("SPECIES");

            foreach (ISpecies species  in  pop.Species)
            {
                xout.AddColumn(species.SpeciesID);
                xout.AddColumn(species.Age);
                xout.AddColumn(species.BestScore);
                xout.AddColumn(species.GensNoImprovement);
                xout.AddColumn(species.NumToSpawn);
                xout.AddColumn(species.SpawnsRequired);
                xout.AddColumn(species.Leader.GenomeID);
                xout.WriteLine();
            }
            xout.Flush();
        }
开发者ID:neismit,项目名称:emds,代码行数:101,代码来源:PersistNEATPopulation.cs

示例4: Save

 public void Save(Stream os, object obj)
 {
     IActivationFunction function;
     double num;
     IRadialBasisFunction function2;
     IActivationFunction[] activationFunctions;
     int num3;
     double[] @params;
     int num4;
     IRadialBasisFunction[] functionArray2;
     int num5;
     EncogWriteHelper helper = new EncogWriteHelper(os);
     RBFNetwork network = (RBFNetwork) obj;
     FlatNetworkRBF flat = (FlatNetworkRBF) network.Flat;
     helper.AddSection("RBF-NETWORK");
     helper.AddSubSection("PARAMS");
     goto Label_03F8;
     Label_0033:
     if (num5 < functionArray2.Length)
     {
         function2 = functionArray2[num5];
         if (0 == 0)
         {
             helper.AddColumn(function2.GetType().Name);
             helper.AddColumn(function2.Width);
             goto Label_006E;
         }
         if ((((uint) num3) | 0x7fffffff) != 0)
         {
             goto Label_02E5;
         }
         goto Label_020D;
     }
     helper.Flush();
     return;
     Label_006E:
     helper.AddColumn(function2.Peak);
     double[] centers = function2.Centers;
     int index = 0;
     while (index < centers.Length)
     {
         double d = centers[index];
         helper.AddColumn(d);
         index++;
     }
     if ((((uint) index) - ((uint) num5)) <= uint.MaxValue)
     {
         helper.WriteLine();
         if ((((uint) num5) - ((uint) index)) < 0)
         {
             goto Label_02A1;
         }
         num5++;
         goto Label_0033;
     }
     return;
     Label_00C6:
     functionArray2 = flat.RBF;
     num5 = 0;
     if ((((uint) num) - ((uint) num)) < 0)
     {
         goto Label_0125;
     }
     goto Label_0033;
     Label_00FA:
     if (num3 < activationFunctions.Length)
     {
         function = activationFunctions[num3];
         goto Label_0161;
     }
     helper.AddSubSection("RBF");
     if ((((uint) num5) | 15) != 0)
     {
         goto Label_01B0;
     }
     goto Label_011D;
     Label_0117:
     num4++;
     Label_011D:
     if (num4 < @params.Length)
     {
         num = @params[num4];
         helper.AddColumn(num);
         goto Label_0117;
     }
     Label_0125:
     helper.WriteLine();
     num3++;
     goto Label_00FA;
     Label_0161:
     helper.AddColumn(function.GetType().Name);
     @params = function.Params;
     Label_017A:
     num4 = 0;
     if ((((uint) num5) + ((uint) index)) > uint.MaxValue)
     {
         goto Label_03BC;
     }
     if ((((uint) num4) + ((uint) num)) <= uint.MaxValue)
     {
//.........这里部分代码省略.........
开发者ID:neismit,项目名称:emds,代码行数:101,代码来源:PersistRBFNetwork.cs

示例5: Save

 public void Save(Stream os, object obj)
 {
     EncogWriteHelper helper = new EncogWriteHelper(os);
     BAMNetwork network = (BAMNetwork) obj;
     helper.AddSection("BAM");
     if (0 == 0)
     {
         helper.AddSubSection("PARAMS");
         helper.AddProperties(network.Properties);
         if (0 == 0)
         {
             helper.AddSubSection("NETWORK");
             helper.WriteProperty("f1Count", network.F1Count);
             helper.WriteProperty("f2Count", network.F2Count);
             helper.WriteProperty("weightsF1F2", network.WeightsF1ToF2);
             helper.WriteProperty("weightsF2F1", network.WeightsF2ToF1);
             helper.Flush();
         }
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:20,代码来源:PersistBAM.cs

示例6: SaveData

        /// <summary>
        /// Save the data fields.
        /// </summary>
        ///
        /// <param name="xout">The output file.</param>
        private void SaveData(EncogWriteHelper xout)
        {
            SaveSubSection(xout, "DATA", "CONFIG");
            xout.AddSubSection("STATS");
            xout.AddColumn("name");
            xout.AddColumn("isclass");
            xout.AddColumn("iscomplete");
            xout.AddColumn("isint");
            xout.AddColumn("isreal");
            xout.AddColumn("amax");
            xout.AddColumn("amin");
            xout.AddColumn("mean");
            xout.AddColumn("sdev");
            xout.WriteLine();


            foreach (DataField field  in  _script.Fields)
            {
                xout.AddColumn(field.Name);
                xout.AddColumn(field.Class);
                xout.AddColumn(field.Complete);
                xout.AddColumn(field.Integer);
                xout.AddColumn(field.Real);
                xout.AddColumn(field.Max);
                xout.AddColumn(field.Min);
                xout.AddColumn(field.Mean);
                xout.AddColumn(field.StandardDeviation);
                xout.WriteLine();
            }
            xout.Flush();

            xout.AddSubSection("CLASSES");
            xout.AddColumn("field");
            xout.AddColumn("code");
            xout.AddColumn("name");
            xout.WriteLine();


            foreach (DataField field  in  _script.Fields)
            {
                if (field.Class)
                {
                    foreach (AnalystClassItem col  in  field.ClassMembers)
                    {
                        xout.AddColumn(field.Name);
                        xout.AddColumn(col.Code);
                        xout.AddColumn(col.Name);
                        xout.AddColumn(col.Count);
                        xout.WriteLine();
                    }
                }
            }
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:58,代码来源:ScriptSave.cs

示例7: Save

        /// <inheritdoc/>
        public void Save(Stream os, Object obj)
        {
            EncogWriteHelper writer = new EncogWriteHelper(os);
            HiddenMarkovModel net = (HiddenMarkovModel)obj;

            writer.AddSection("HMM");
            writer.AddSubSection("PARAMS");
            writer.AddProperties(net.Properties);
            writer.AddSubSection("CONFIG");

            writer.WriteProperty(HiddenMarkovModel.TAG_STATES, net.StateCount);
            if (net.Items != null)
            {
                writer.WriteProperty(HiddenMarkovModel.TAG_ITEMS, net.Items);
            }
            writer.WriteProperty(HiddenMarkovModel.TAG_PI, net.Pi);
            writer.WriteProperty(HiddenMarkovModel.TAG_TRANSITION, new Matrix(net.TransitionProbability));

            for (int i = 0; i < net.StateCount; i++)
            {
                writer.AddSubSection("DISTRIBUTION-" + i);
                IStateDistribution sd = net.StateDistributions[i];
                writer.WriteProperty(HiddenMarkovModel.TAG_DIST_TYPE, sd.GetType().Name);

                if (sd is ContinousDistribution)
                {
                    ContinousDistribution cDist = (ContinousDistribution)sd;
                    writer.WriteProperty(HiddenMarkovModel.TAG_MEAN, cDist.Mean);
                    writer.WriteProperty(HiddenMarkovModel.TAG_COVARIANCE, cDist.Covariance);

                }
                else if (sd is DiscreteDistribution)
                {
                    DiscreteDistribution dDist = (DiscreteDistribution)sd;
                    writer.WriteProperty(HiddenMarkovModel.TAG_PROBABILITIES, new Matrix(dDist.Probabilities));
                }
            }

            writer.Flush();
        }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:41,代码来源:PersistHMM.cs

示例8: Save

        /// <summary>
        /// 
        /// </summary>
        ///
        public void Save(Stream os, Object obj)
        {
            var xout = new EncogWriteHelper(os);
            var pnn = (BasicPNN) obj;
            xout.AddSection("PNN");
            xout.AddSubSection("PARAMS");
            xout.AddProperties(pnn.Properties);
            xout.AddSubSection("NETWORK");

            xout.WriteProperty(PersistConst.Error, pnn.Error);
            xout.WriteProperty(PersistConst.InputCount, pnn.InputCount);
            xout.WriteProperty(PersistConst.Kernel,
                               KernelToString(pnn.Kernel));
            xout.WriteProperty(PersistConst.OutputCount, pnn.OutputCount);
            xout.WriteProperty(PropertyOutputMode,
                               OutputModeToString(pnn.OutputMode));
            xout.WriteProperty(PersistConst.Sigma, pnn.Sigma);

            xout.AddSubSection("SAMPLES");

            if (pnn.Samples != null)
            {
                foreach (IMLDataPair pair in pnn.Samples)
                {
                    for (int i = 0; i < pair.Input.Count; i++)
                    {
                        xout.AddColumn(pair.Input[i]);
                    }

                    for (int i = 0; i < pair.Ideal.Count; i++)
                    {
                        xout.AddColumn(pair.Ideal[i]);
                    }
                    xout.WriteLine();
                }
            }
            xout.Flush();
        }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:42,代码来源:PersistBasicPNN.cs

示例9: Save

 public virtual void Save(Stream os, object obj)
 {
     EncogWriteHelper xout = new EncogWriteHelper(os);
     NEATNetwork network = (NEATNetwork) obj;
     xout.AddSection("NEAT");
     xout.AddSubSection("PARAMS");
     xout.AddProperties(network.Properties);
     xout.AddSubSection("NETWORK");
     if (8 != 0)
     {
     }
     xout.WriteProperty("inputCount", network.InputCount);
     xout.WriteProperty("outputCount", network.OutputCount);
     xout.WriteProperty("activationFunction", network.ActivationFunction);
     xout.WriteProperty("outAct", network.OutputActivationFunction);
     xout.WriteProperty("depth", network.NetworkDepth);
     Label_0087:
     xout.WriteProperty("snapshot", network.Snapshot);
     xout.AddSubSection("NEURONS");
     using (IEnumerator<NEATNeuron> enumerator = network.Neurons.GetEnumerator())
     {
         NEATNeuron current;
         goto Label_00E3;
     Label_00B2:
         if (8 == 0)
         {
             goto Label_00F6;
         }
         xout.AddColumn(current.ActivationResponse);
         xout.AddColumn(current.SplitX);
         xout.AddColumn(current.SplitY);
         xout.WriteLine();
     Label_00E3:
         if (!enumerator.MoveNext())
         {
             goto Label_0124;
         }
         current = enumerator.Current;
     Label_00F6:
         xout.AddColumn((int) current.NeuronID);
         xout.AddColumn(PersistNEATPopulation.NeuronTypeToString(current.NeuronType));
         goto Label_00B2;
     }
     Label_0124:
     xout.AddSubSection("LINKS");
     foreach (NEATNeuron neuron2 in network.Neurons)
     {
         foreach (NEATLink link in neuron2.OutputboundLinks)
         {
             WriteLink(xout, link);
         }
     }
     xout.Flush();
     if (-1 != 0)
     {
         return;
     }
     goto Label_0087;
 }
开发者ID:neismit,项目名称:emds,代码行数:59,代码来源:PersistNEATNetwork.cs

示例10: Save

        /// <inheritdoc/>
        public void Save(Stream os, Object obj)
        {
            var xout = new EncogWriteHelper(os);
            var art1 = (ART1) obj;
            xout.AddSection("ART1");
            xout.AddSubSection("PARAMS");
            xout.AddProperties(art1.Properties);
            xout.AddSubSection("NETWORK");

            xout.WriteProperty(BasicART.PropertyA1, art1.A1);
            xout.WriteProperty(BasicART.PropertyB1, art1.B1);
            xout.WriteProperty(BasicART.PropertyC1, art1.C1);
            xout.WriteProperty(BasicART.PropertyD1, art1.D1);
            xout.WriteProperty(PersistConst.PropertyF1Count, art1.F1Count);
            xout.WriteProperty(PersistConst.PropertyF2Count, art1.F2Count);
            xout.WriteProperty(BasicART.PropertyNoWinner, art1.NoWinner);
            xout.WriteProperty(BasicART.PropertyL, art1.L);
            xout.WriteProperty(BasicART.PropertyVigilance, art1.Vigilance);
            xout.WriteProperty(PersistConst.PropertyWeightsF1F2,
                               art1.WeightsF1ToF2);
            xout.WriteProperty(PersistConst.PropertyWeightsF2F1,
                               art1.WeightsF2ToF1);

            xout.Flush();
        }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:26,代码来源:PersistART1.cs

示例11: Save

        /// <summary>
        /// Save the object.
        /// </summary>
        /// <param name="os">The output stream.</param>
        /// <param name="obj">The object to save.</param>
        public virtual void Save(Stream os, Object obj)
        {
            var xout = new EncogWriteHelper(os);
            var neat = (NEATNetwork) obj;
            xout.AddSection("NEAT");
            xout.AddSubSection("PARAMS");
            xout.AddProperties(neat.Properties);
            xout.AddSubSection("NETWORK");

            xout.WriteProperty(PersistConst.InputCount, neat.InputCount);
            xout.WriteProperty(PersistConst.OutputCount, neat.OutputCount);
            xout.WriteProperty(PersistConst.ActivationFunction,
                               neat.ActivationFunction);
            xout.WriteProperty(NEATPopulation.PropertyOutputActivation,
                               neat.OutputActivationFunction);
            xout.WriteProperty(PersistConst.Depth, neat.NetworkDepth);
            xout.WriteProperty(PersistConst.Snapshot, neat.Snapshot);

            xout.AddSubSection("NEURONS");

            foreach (NEATNeuron neatNeuron  in  neat.Neurons)
            {
                xout.AddColumn((int)neatNeuron.NeuronID);
                xout.AddColumn(PersistNEATPopulation.NeuronTypeToString(neatNeuron.NeuronType));
                xout.AddColumn(neatNeuron.ActivationResponse);
                xout.AddColumn(neatNeuron.SplitX);
                xout.AddColumn(neatNeuron.SplitY);
                xout.WriteLine();
            }

            xout.AddSubSection("LINKS");

            foreach (NEATNeuron neatNeuron  in  neat.Neurons)
            {
                foreach (NEATLink link  in  neatNeuron.OutputboundLinks)
                {
                    WriteLink(xout, link);
                }
            }

            xout.Flush();
        }
开发者ID:neismit,项目名称:emds,代码行数:47,代码来源:PersistNEATNetwork.cs

示例12: Save

 public virtual void Save(Stream os, object obj)
 {
     NEATPopulation population;
     EncogWriteHelper helper = new EncogWriteHelper(os);
     if (0 == 0)
     {
         population = (NEATPopulation) obj;
         if (-2147483648 != 0)
         {
             goto Label_05B6;
         }
     }
     Label_000D:
     helper.Flush();
     return;
     Label_0018:
     using (IEnumerator<ISpecies> enumerator5 = population.Species.GetEnumerator())
     {
         ISpecies species;
         goto Label_0049;
     Label_0027:
         helper.AddColumn(species.Leader.GenomeID);
         if (-2 == 0)
         {
             goto Label_000D;
         }
         helper.WriteLine();
     Label_0049:
         if (enumerator5.MoveNext())
         {
             goto Label_00A2;
         }
         goto Label_000D;
     Label_0054:
         helper.AddColumn(species.BestScore);
         helper.AddColumn(species.GensNoImprovement);
         helper.AddColumn(species.NumToSpawn);
         helper.AddColumn(species.SpawnsRequired);
         goto Label_0027;
     Label_008C:
         helper.AddColumn(species.Age);
         if (0x7fffffff != 0)
         {
             goto Label_0054;
         }
         goto Label_000D;
     Label_00A2:
         species = enumerator5.Current;
         helper.AddColumn(species.SpeciesID);
         goto Label_008C;
     }
     Label_00D2:
     if (population.Innovations != null)
     {
         goto Label_03B2;
     }
     Label_00DD:
     helper.AddSubSection("GENOMES");
     using (IEnumerator<IGenome> enumerator2 = population.Genomes.GetEnumerator())
     {
         IGenome genome;
         NEATGenome genome2;
         goto Label_01E0;
     Label_00FA:
         using (List<IGene>.Enumerator enumerator4 = genome2.Links.Genes.GetEnumerator())
         {
             IGene gene3;
             NEATLinkGene gene4;
             goto Label_0129;
         Label_010F:
             if (2 == 0)
             {
                 goto Label_016F;
             }
             helper.AddColumn(gene4.InnovationId);
             helper.WriteLine();
         Label_0129:
             if (enumerator4.MoveNext())
             {
                 goto Label_01C4;
             }
             goto Label_01E0;
         Label_013A:
             helper.AddColumn(gene4.Weight);
             goto Label_010F;
         Label_014C:
             helper.AddColumn(gene4.ToNeuronID);
             if (4 != 0)
             {
                 goto Label_013A;
             }
             goto Label_018C;
         Label_0162:
             helper.AddColumn(gene4.Enabled);
         Label_016F:
             helper.AddColumn(gene4.Recurrent);
             helper.AddColumn(gene4.FromNeuronID);
             if (0 == 0)
             {
                 goto Label_014C;
//.........这里部分代码省略.........
开发者ID:neismit,项目名称:emds,代码行数:101,代码来源:PersistNEATPopulation.cs

示例13: Save

 public void Save(Stream os, object obj)
 {
     HopfieldNetwork network;
     EncogWriteHelper helper = new EncogWriteHelper(os);
     goto Label_00A2;
     Label_0028:
     helper.WriteProperty("neurons", network.NeuronCount);
     helper.Flush();
     if (4 != 0)
     {
         return;
     }
     if (4 != 0)
     {
         goto Label_00A2;
     }
     goto Label_0064;
     Label_004C:
     helper.WriteProperty("output", network.CurrentState.Data);
     goto Label_0028;
     Label_0064:
     helper.AddSection("HOPFIELD");
     helper.AddSubSection("PARAMS");
     if (2 == 0)
     {
         goto Label_004C;
     }
     helper.AddProperties(network.Properties);
     helper.AddSubSection("NETWORK");
     if (0 == 0)
     {
         helper.WriteProperty("weights", network.Weights);
         goto Label_004C;
     }
     goto Label_0028;
     Label_00A2:
     network = (HopfieldNetwork) obj;
     goto Label_0064;
 }
开发者ID:neismit,项目名称:emds,代码行数:39,代码来源:PersistHopfield.cs

示例14: Save

        /// <summary>
        /// 
        /// </summary>
        ///
        public void Save(Stream os, Object obj)
        {
            var xout = new EncogWriteHelper(os);
            var bam = (BAMNetwork) obj;
            xout.AddSection("BAM");
            xout.AddSubSection("PARAMS");
            xout.AddProperties(bam.Properties);
            xout.AddSubSection("NETWORK");

            xout.WriteProperty(PersistConst.PropertyF1Count, bam.F1Count);
            xout.WriteProperty(PersistConst.PropertyF2Count, bam.F2Count);
            xout.WriteProperty(PersistConst.PropertyWeightsF1F2,
                               bam.WeightsF1ToF2);
            xout.WriteProperty(PersistConst.PropertyWeightsF2F1,
                               bam.WeightsF2ToF1);

            xout.Flush();
        }
开发者ID:neismit,项目名称:emds,代码行数:22,代码来源:PersistBAM.cs

示例15: Save

 public void Save(Stream os, object obj)
 {
     SupportVectorMachine machine;
     EncogWriteHelper helper = new EncogWriteHelper(os);
     if (8 != 0)
     {
     }
     Label_026A:
     machine = (SupportVectorMachine) obj;
     helper.AddSection("SVM");
     if (0 == 0)
     {
         while (true)
         {
             helper.AddSubSection("PARAMS");
             helper.AddProperties(machine.Properties);
             helper.AddSubSection("SVM-PARAM");
             helper.WriteProperty("inputCount", machine.InputCount);
             helper.WriteProperty("C", machine.Params.C);
             if (0 == 0)
             {
                 helper.WriteProperty("cacheSize", machine.Params.cache_size);
                 if (-2 == 0)
                 {
                     goto Label_026A;
                 }
                 helper.WriteProperty("coef0", machine.Params.coef0);
                 helper.WriteProperty("degree", machine.Params.degree);
                 helper.WriteProperty("eps", machine.Params.eps);
                 helper.WriteProperty("gamma", machine.Params.gamma);
                 helper.WriteProperty("kernelType", machine.Params.kernel_type);
             }
             helper.WriteProperty("nrWeight", machine.Params.nr_weight);
             if (1 != 0)
             {
                 helper.WriteProperty("nu", machine.Params.nu);
                 helper.WriteProperty("p", machine.Params.p);
                 helper.WriteProperty("probability", machine.Params.probability);
                 helper.WriteProperty("shrinking", machine.Params.shrinking);
                 helper.WriteProperty("svmType", machine.Params.svm_type);
                 helper.WriteProperty("weight", machine.Params.weight);
                 helper.WriteProperty("weightLabel", machine.Params.weight_label);
                 break;
             }
         }
     }
     Label_0092:
     while (machine.Model != null)
     {
         helper.AddSubSection("SVM-MODEL");
         try
         {
             StreamWriter writer;
             ASCIIEncoding encoding;
             MemoryStream stream = new MemoryStream();
             if (1 != 0)
             {
                 goto Label_005F;
             }
         Label_003E:
             helper.Write(encoding.GetString(stream.ToArray()));
             writer.Close();
             stream.Close();
             break;
         Label_005F:
             writer = new StreamWriter(stream);
             if (0 == 0)
             {
                 svm.svm_save_model(writer, machine.Model);
             }
             encoding = new ASCIIEncoding();
             goto Label_003E;
         }
         catch (IOException exception)
         {
             throw new PersistError(exception);
         }
     }
     while (true)
     {
         helper.Flush();
         if (-2147483648 != 0)
         {
             return;
         }
         if (0 != 0)
         {
             goto Label_0092;
         }
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:91,代码来源:PersistSVM.cs


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