本文整理汇总了C#中Encog.Persist.EncogWriteHelper.AddColumn方法的典型用法代码示例。如果您正苦于以下问题:C# EncogWriteHelper.AddColumn方法的具体用法?C# EncogWriteHelper.AddColumn怎么用?C# EncogWriteHelper.AddColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encog.Persist.EncogWriteHelper
的用法示例。
在下文中一共展示了EncogWriteHelper.AddColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: Save
/// <inheritdoc/>
public void Save(Stream os, Object obj)
{
var xout = new EncogWriteHelper(os);
var net = (BasicNetwork) obj;
FlatNetwork flat = net.Structure.Flat;
xout.AddSection("BASIC");
xout.AddSubSection("PARAMS");
xout.AddProperties(net.Properties);
xout.AddSubSection("NETWORK");
xout.WriteProperty(BasicNetwork.TagBeginTraining,
flat.BeginTraining);
xout.WriteProperty(BasicNetwork.TagConnectionLimit,
flat.ConnectionLimit);
xout.WriteProperty(BasicNetwork.TagContextTargetOffset,
flat.ContextTargetOffset);
xout.WriteProperty(BasicNetwork.TagContextTargetSize,
flat.ContextTargetSize);
xout.WriteProperty(BasicNetwork.TagEndTraining, flat.EndTraining);
xout.WriteProperty(BasicNetwork.TagHasContext, flat.HasContext);
xout.WriteProperty(PersistConst.InputCount, flat.InputCount);
xout.WriteProperty(BasicNetwork.TagLayerCounts, flat.LayerCounts);
xout.WriteProperty(BasicNetwork.TagLayerFeedCounts,
flat.LayerFeedCounts);
xout.WriteProperty(BasicNetwork.TagLayerContextCount,
flat.LayerContextCount);
xout.WriteProperty(BasicNetwork.TagLayerIndex, flat.LayerIndex);
xout.WriteProperty(PersistConst.Output, flat.LayerOutput);
xout.WriteProperty(PersistConst.OutputCount, flat.OutputCount);
xout.WriteProperty(BasicNetwork.TagWeightIndex, flat.WeightIndex);
xout.WriteProperty(PersistConst.Weights, flat.Weights);
xout.WriteProperty(BasicNetwork.TagBiasActivation,
flat.BiasActivation);
xout.AddSubSection("ACTIVATION");
foreach (IActivationFunction af in flat.ActivationFunctions)
{
xout.AddColumn(af.GetType().Name);
for (int i = 0; i < af.Params.Length; i++)
{
xout.AddColumn(af.Params[i]);
}
xout.WriteLine();
}
xout.Flush();
}
示例3: 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();
}
示例4: Save
/// <inheritdoc/>
public void Save(Stream os, Object obj)
{
var output = new EncogWriteHelper(os);
var pop = (NEATPopulation)obj;
output.AddSection("NEAT-POPULATION");
output.AddSubSection("CONFIG");
output.WriteProperty(PersistConst.ActivationCycles, pop.ActivationCycles);
if (pop.IsHyperNEAT)
{
output.WriteProperty(NEATPopulation.PropertyNEATActivation,TypeCppn);
}
else
{
IActivationFunction af = pop.ActivationFunctions.Contents[0].obj;
output.WriteProperty(NEATPopulation.PropertyNEATActivation, af);
}
output.WriteProperty(PersistConst.InputCount, pop.InputCount);
output.WriteProperty(PersistConst.OutputCount, pop.OutputCount);
output.WriteProperty(NEATPopulation.PropertyCycles, pop.ActivationCycles);
output.WriteProperty(NEATPopulation.PropertyPopulationSize, pop.PopulationSize);
output.WriteProperty(NEATPopulation.PropertySurvivalRate, pop.SurvivalRate);
output.AddSubSection("INNOVATIONS");
if (pop.Innovations != null)
{
foreach (string key in pop.Innovations.Innovations.Keys)
{
NEATInnovation innovation = pop.Innovations.Innovations[key];
output.AddColumn(key);
output.AddColumn(innovation.InnovationId);
output.AddColumn(innovation.NeuronId);
output.WriteLine();
}
}
output.AddSubSection("SPECIES");
// make sure the best species goes first
ISpecies bestSpecies = pop.DetermineBestSpecies();
if (bestSpecies != null)
{
SaveSpecies(output, bestSpecies);
}
// now write the other species, other than the best one
foreach (ISpecies species in pop.Species)
{
if (species != bestSpecies)
{
SaveSpecies(output, species);
}
}
output.Flush();
}
示例5: SaveSpecies
private void SaveSpecies(EncogWriteHelper output, ISpecies species)
{
output.AddColumn("s");
output.AddColumn(species.Age);
output.AddColumn(species.BestScore);
output.AddColumn(species.GensNoImprovement);
output.WriteLine();
foreach (IGenome genome in species.Members)
{
var neatGenome = (NEATGenome)genome;
output.AddColumn("g");
output.AddColumn(neatGenome.AdjustedScore);
output.AddColumn(neatGenome.Score);
output.AddColumn(neatGenome.BirthGeneration);
output.WriteLine();
foreach (NEATNeuronGene neatNeuronGene in neatGenome.NeuronsChromosome)
{
output.AddColumn("n");
output.AddColumn(neatNeuronGene.Id);
output.AddColumn(neatNeuronGene.ActivationFunction);
output.AddColumn(NeuronTypeToString(neatNeuronGene.NeuronType));
output.AddColumn(neatNeuronGene.InnovationId);
output.WriteLine();
}
foreach (NEATLinkGene neatLinkGene in neatGenome.LinksChromosome)
{
output.AddColumn("l");
output.AddColumn(neatLinkGene.Id);
output.AddColumn(neatLinkGene.Enabled);
output.AddColumn(neatLinkGene.FromNeuronId);
output.AddColumn(neatLinkGene.ToNeuronId);
output.AddColumn(neatLinkGene.Weight);
output.AddColumn(neatLinkGene.InnovationId);
output.WriteLine();
}
}
}
示例6: SaveNormalize
/// <summary>
/// Save the normalization data.
/// </summary>
///
/// <param name="xout">The output file.</param>
private void SaveNormalize(EncogWriteHelper xout)
{
SaveSubSection(xout, "NORMALIZE", "CONFIG");
xout.AddSubSection("RANGE");
xout.AddColumn("name");
xout.AddColumn("io");
xout.AddColumn("timeSlice");
xout.AddColumn("action");
xout.AddColumn("high");
xout.AddColumn("low");
xout.WriteLine();
foreach (AnalystField field in _script.Normalize.NormalizedFields)
{
xout.AddColumn(field.Name);
xout.AddColumn(field.Input ? "input" : "output");
xout.AddColumn(field.TimeSlice);
switch (field.Action)
{
case NormalizationAction.Ignore:
xout.AddColumn("ignore");
break;
case NormalizationAction.Normalize:
xout.AddColumn("range");
break;
case NormalizationAction.PassThrough:
xout.AddColumn("pass");
break;
case NormalizationAction.OneOf:
xout.AddColumn("oneof");
break;
case NormalizationAction.Equilateral:
xout.AddColumn("equilateral");
break;
case NormalizationAction.SingleField:
xout.AddColumn("single");
break;
default:
throw new AnalystError("Unknown action: " + field.Action);
}
xout.AddColumn(field.NormalizedHigh);
xout.AddColumn(field.NormalizedLow);
xout.WriteLine();
}
}
示例7: x6f59fa9537dbb843
private void x6f59fa9537dbb843(EncogWriteHelper xa58d1d9c6fa55c59)
{
this.x4ec53e22935ca8a4(xa58d1d9c6fa55c59, "NORMALIZE", "CONFIG");
xa58d1d9c6fa55c59.AddSubSection("RANGE");
xa58d1d9c6fa55c59.AddColumn("name");
xa58d1d9c6fa55c59.AddColumn("io");
if (0 == 0)
{
}
xa58d1d9c6fa55c59.AddColumn("timeSlice");
xa58d1d9c6fa55c59.AddColumn("action");
xa58d1d9c6fa55c59.AddColumn("high");
xa58d1d9c6fa55c59.AddColumn("low");
xa58d1d9c6fa55c59.WriteLine();
using (IEnumerator<AnalystField> enumerator = this._x594135906c55045c.Normalize.NormalizedFields.GetEnumerator())
{
AnalystField field;
Label_0060:
if (enumerator.MoveNext())
{
goto Label_015A;
}
return;
Label_008D:
xa58d1d9c6fa55c59.AddColumn(field.NormalizedHigh);
xa58d1d9c6fa55c59.AddColumn(field.NormalizedLow);
xa58d1d9c6fa55c59.WriteLine();
if (0 == 0)
{
goto Label_0060;
}
goto Label_008D;
Label_00B0:
xa58d1d9c6fa55c59.AddColumn("single");
if (2 == 0)
{
goto Label_015A;
}
goto Label_008D;
Label_00C9:
xa58d1d9c6fa55c59.AddColumn("pass");
goto Label_008D;
Label_00D6:
xa58d1d9c6fa55c59.AddColumn("oneof");
goto Label_008D;
Label_00E3:
xa58d1d9c6fa55c59.AddColumn("equilateral");
goto Label_008D;
Label_00F7:
xa58d1d9c6fa55c59.AddColumn("range");
goto Label_008D;
Label_010C:
xa58d1d9c6fa55c59.AddColumn(field.TimeSlice);
switch (field.Action)
{
case NormalizationAction.PassThrough:
goto Label_00C9;
case NormalizationAction.Normalize:
goto Label_00F7;
case NormalizationAction.Ignore:
break;
case NormalizationAction.OneOf:
goto Label_00D6;
case NormalizationAction.Equilateral:
goto Label_00E3;
case NormalizationAction.SingleField:
goto Label_00B0;
default:
throw new AnalystError("Unknown action: " + field.Action);
}
xa58d1d9c6fa55c59.AddColumn("ignore");
if (15 != 0)
{
goto Label_018C;
}
if (0 != 0)
{
goto Label_0060;
}
Label_015A:
field = enumerator.Current;
xa58d1d9c6fa55c59.AddColumn(field.Name);
xa58d1d9c6fa55c59.AddColumn(field.Input ? "input" : "output");
goto Label_010C;
Label_018C:
if (4 != 0)
{
goto Label_008D;
}
goto Label_0060;
}
}
示例8: 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;
//.........这里部分代码省略.........
示例9: 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();
}
示例10: 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)
{
//.........这里部分代码省略.........
示例11: Save
/// <inheritdoc />
public void Save(Stream ostream, Object obj)
{
var writer = new EncogWriteHelper(ostream);
var pop = (PrgPopulation) obj;
writer.AddSection("BASIC");
writer.AddSubSection("PARAMS");
writer.AddProperties(pop.Properties);
writer.AddSubSection("EPL-OPCODES");
foreach (IProgramExtensionTemplate temp in pop.Context
.Functions.OpCodes)
{
writer.AddColumn(temp.Name);
writer.AddColumn(temp.ChildNodeCount);
writer.WriteLine();
}
writer.AddSubSection("EPL-SYMBOLIC");
writer.AddColumn("name");
writer.AddColumn("type");
writer.AddColumn("enum");
writer.AddColumn("enum_type");
writer.AddColumn("enum_count");
writer.WriteLine();
// write the first line, the result
writer.AddColumn("");
writer.AddColumn(GetType(pop.Context.Result));
writer.AddColumn(pop.Context.Result.EnumType);
writer.AddColumn(pop.Context.Result.EnumValueCount);
writer.WriteLine();
// write the next lines, the variables
foreach (VariableMapping mapping in pop.Context.DefinedVariables)
{
writer.AddColumn(mapping.Name);
writer.AddColumn(GetType(mapping));
writer.AddColumn(mapping.EnumType);
writer.AddColumn(mapping.EnumValueCount);
writer.WriteLine();
}
writer.AddSubSection("EPL-POPULATION");
foreach (ISpecies species in pop.Species)
{
if (species.Members.Count > 0)
{
writer.AddColumn("s");
writer.AddColumn(species.Age);
writer.AddColumn(species.BestScore);
writer.AddColumn(species.GensNoImprovement);
writer.WriteLine();
foreach (IGenome genome in species.Members)
{
var prg = (EncogProgram) genome;
writer.AddColumn("p");
if (Double.IsInfinity(prg.Score)
|| Double.IsNaN(prg.Score))
{
writer.AddColumn("NaN");
writer.AddColumn("NaN");
}
else
{
writer.AddColumn(prg.Score);
writer.AddColumn(prg.AdjustedScore);
}
writer.AddColumn(prg.GenerateEPL());
writer.WriteLine();
}
}
}
writer.Flush();
}
示例12: Save
public void Save(Stream os, object obj)
{
BasicNetwork network;
FlatNetwork flat;
IActivationFunction function;
int num;
IActivationFunction[] activationFunctions;
int num2;
EncogWriteHelper helper = new EncogWriteHelper(os);
if ((((uint) num2) + ((uint) num)) >= 0)
{
goto Label_0290;
}
goto Label_0059;
Label_0024:
if (num < function.Params.Length)
{
helper.AddColumn(function.Params[num]);
goto Label_0080;
}
if (-1 == 0)
{
goto Label_00CC;
}
helper.WriteLine();
Label_0040:
num2++;
Label_0046:
if (num2 < activationFunctions.Length)
{
goto Label_00F8;
}
helper.Flush();
goto Label_0071;
Label_0059:
num++;
if (((uint) num2) <= uint.MaxValue)
{
goto Label_0024;
}
Label_0071:
if (1 != 0)
{
return;
}
goto Label_0290;
Label_0080:
if ((((uint) num2) + ((uint) num)) < 0)
{
goto Label_0135;
}
goto Label_0059;
Label_00CC:
helper.WriteProperty("biasActivation", flat.BiasActivation);
helper.AddSubSection("ACTIVATION");
activationFunctions = flat.ActivationFunctions;
num2 = 0;
goto Label_0046;
Label_00F8:
function = activationFunctions[num2];
if (((uint) num2) >= 0)
{
helper.AddColumn(function.GetType().Name);
}
if (0x7fffffff != 0)
{
num = 0;
goto Label_0024;
}
goto Label_0080;
Label_0135:
helper.WriteProperty("outputCount", flat.OutputCount);
if ((((uint) num) & 0) != 0)
{
goto Label_00F8;
}
helper.WriteProperty("weightIndex", flat.WeightIndex);
helper.WriteProperty("weights", flat.Weights);
goto Label_00CC;
Label_0290:
network = (BasicNetwork) obj;
flat = network.Structure.Flat;
helper.AddSection("BASIC");
helper.AddSubSection("PARAMS");
helper.AddProperties(network.Properties);
if (((uint) num2) < 0)
{
goto Label_0040;
}
helper.AddSubSection("NETWORK");
helper.WriteProperty("beginTraining", flat.BeginTraining);
helper.WriteProperty("connectionLimit", flat.ConnectionLimit);
helper.WriteProperty("contextTargetOffset", flat.ContextTargetOffset);
helper.WriteProperty("contextTargetSize", flat.ContextTargetSize);
helper.WriteProperty("endTraining", flat.EndTraining);
helper.WriteProperty("hasContext", flat.HasContext);
helper.WriteProperty("inputCount", flat.InputCount);
helper.WriteProperty("layerCounts", flat.LayerCounts);
helper.WriteProperty("layerFeedCounts", flat.LayerFeedCounts);
helper.WriteProperty("layerContextCount", flat.LayerContextCount);
//.........这里部分代码省略.........
示例13: Save
public void Save(Stream os, object obj)
{
BasicPNN cpnn;
int num;
int num2;
EncogWriteHelper helper = new EncogWriteHelper(os);
goto Label_01F0;
Label_0017:
using (IEnumerator<IMLDataPair> enumerator = cpnn.Samples.GetEnumerator())
{
IMLDataPair pair;
goto Label_0054;
Label_0026:
helper.AddColumn(pair.Ideal[num2]);
num2++;
Label_003F:
if (num2 < pair.Ideal.Count)
{
goto Label_0026;
}
helper.WriteLine();
Label_0054:
if (enumerator.MoveNext())
{
goto Label_00F0;
}
if ((((uint) num) - ((uint) num2)) > uint.MaxValue)
{
goto Label_00DD;
}
if ((((uint) num2) + ((uint) num)) >= 0)
{
goto Label_010F;
}
if ((((uint) num2) - ((uint) num)) >= 0)
{
goto Label_00F0;
}
if ((((uint) num2) + ((uint) num2)) > uint.MaxValue)
{
goto Label_010F;
}
Label_00C7:
helper.AddColumn(pair.Input[num]);
num++;
Label_00DD:
if (num < pair.Input.Count)
{
goto Label_00C7;
}
num2 = 0;
goto Label_003F;
Label_00F0:
pair = enumerator.Current;
num = 0;
goto Label_00DD;
}
Label_010F:
helper.Flush();
return;
Label_01F0:
cpnn = (BasicPNN) obj;
helper.AddSection("PNN");
helper.AddSubSection("PARAMS");
helper.AddProperties(cpnn.Properties);
helper.AddSubSection("NETWORK");
helper.WriteProperty("error", cpnn.Error);
helper.WriteProperty("inputCount", cpnn.InputCount);
helper.WriteProperty("kernel", KernelToString(cpnn.Kernel));
if ((((uint) num) & 0) != 0)
{
goto Label_0017;
}
helper.WriteProperty("outputCount", cpnn.OutputCount);
helper.WriteProperty("outputMode", OutputModeToString(cpnn.OutputMode));
if ((((uint) num2) | 1) == 0)
{
goto Label_0017;
}
helper.WriteProperty("sigma", cpnn.Sigma);
if (0 == 0)
{
helper.AddSubSection("SAMPLES");
goto Label_0017;
}
goto Label_01F0;
}
示例14: x80a029c2a0fbca61
private void x80a029c2a0fbca61(EncogWriteHelper xa58d1d9c6fa55c59)
{
DataField field;
DataField field2;
DataField[] fieldArray;
int num;
DataField[] fields;
int num2;
this.x4ec53e22935ca8a4(xa58d1d9c6fa55c59, "DATA", "CONFIG");
if ((((uint) num) | 8) != 0)
{
xa58d1d9c6fa55c59.AddSubSection("STATS");
}
goto Label_031C;
Label_0033:
if (((uint) num2) > uint.MaxValue)
{
goto Label_0062;
}
Label_0045:
num2++;
Label_004B:
if (num2 < fields.Length)
{
field2 = fields[num2];
if (0x7fffffff != 0)
{
goto Label_0058;
}
goto Label_0170;
}
if ((((uint) num2) | 0x7fffffff) != 0)
{
if ((((uint) num2) | uint.MaxValue) != 0)
{
return;
}
goto Label_031C;
}
goto Label_01F9;
Label_0058:
if (field2.Class)
{
using (IEnumerator<AnalystClassItem> enumerator = field2.ClassMembers.GetEnumerator())
{
goto Label_00AE;
Label_0090:
if ((((uint) num) | 3) == 0)
{
goto Label_0045;
}
xa58d1d9c6fa55c59.WriteLine();
Label_00AE:
if (enumerator.MoveNext())
{
AnalystClassItem current = enumerator.Current;
xa58d1d9c6fa55c59.AddColumn(field2.Name);
xa58d1d9c6fa55c59.AddColumn(current.Code);
xa58d1d9c6fa55c59.AddColumn(current.Name);
xa58d1d9c6fa55c59.AddColumn(current.Count);
goto Label_0090;
}
goto Label_0045;
}
}
goto Label_0033;
Label_0062:
if ((((uint) num) & 0) != 0)
{
goto Label_0058;
}
goto Label_0045;
Label_0170:
xa58d1d9c6fa55c59.AddColumn("code");
if ((((uint) num2) + ((uint) num)) > uint.MaxValue)
{
goto Label_0033;
}
xa58d1d9c6fa55c59.AddColumn("name");
xa58d1d9c6fa55c59.WriteLine();
if ((((uint) num2) & 0) == 0)
{
fields = this._x594135906c55045c.Fields;
num2 = 0;
if (0 != 0)
{
goto Label_0331;
}
if (((uint) num2) > uint.MaxValue)
{
goto Label_0058;
}
goto Label_004B;
}
goto Label_01F9;
Label_01B3:
if (num < fieldArray.Length)
{
field = fieldArray[num];
goto Label_0369;
//.........这里部分代码省略.........
示例15: WriteLink
private static void WriteLink(EncogWriteHelper xout, NEATLink link)
{
xout.AddColumn((int) link.FromNeuron.NeuronID);
xout.AddColumn((int) link.ToNeuron.NeuronID);
xout.AddColumn(link.Recurrent);
xout.AddColumn(link.Weight);
xout.WriteLine();
}