本文整理汇总了C#中Encog.Neural.Networks.Training.Propagation.TrainingContinuation类的典型用法代码示例。如果您正苦于以下问题:C# TrainingContinuation类的具体用法?C# TrainingContinuation怎么用?C# TrainingContinuation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrainingContinuation类属于Encog.Neural.Networks.Training.Propagation命名空间,在下文中一共展示了TrainingContinuation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <inheritdoc/>
public Object Read(Stream mask0)
{
var result = new TrainingContinuation();
var ins0 = new EncogReadHelper(mask0);
EncogFileSection section;
while ((section = ins0.ReadNextSection()) != null)
{
if (section.SectionName.Equals("CONT")
&& section.SubSectionName.Equals("PARAMS"))
{
IDictionary<String, String> paras = section.ParseParams();
foreach (String key in paras.Keys)
{
if (key.Equals("type", StringComparison.InvariantCultureIgnoreCase))
{
result.TrainingType = paras[key];
}
else
{
double[] list = EncogFileSection
.ParseDoubleArray(paras, key);
result.Put(key, list);
}
}
}
}
return result;
}
示例2: Pause
public override sealed TrainingContinuation Pause()
{
TrainingContinuation continuation = new TrainingContinuation {
TrainingType = base.GetType().Name
};
continuation.Set("LAST_GRADIENTS", ((TrainFlatNetworkResilient) base.FlatTraining).LastGradient);
continuation.Set("UPDATE_VALUES", ((TrainFlatNetworkResilient) base.FlatTraining).UpdateValues);
return continuation;
}
示例3: IsValidResume
public bool IsValidResume(TrainingContinuation state)
{
if (!state.Contents.ContainsKey("LAST_DELTA"))
{
return false;
}
if (!state.TrainingType.Equals(base.GetType().Name))
{
return false;
}
double[] numArray = (double[]) state.Get("LAST_DELTA");
return (numArray.Length == ((IContainsFlat) this.Method).Flat.Weights.Length);
}
示例4: Resume
public override sealed void Resume(TrainingContinuation state)
{
if (!this.IsValidResume(state))
{
throw new TrainingError("Invalid training resume data length");
}
double[] src = (double[]) state.Get("LAST_GRADIENTS");
double[] numArray2 = (double[]) state.Get("UPDATE_VALUES");
EngineArray.ArrayCopy(src, ((TrainFlatNetworkResilient) base.FlatTraining).LastGradient);
if (8 != 0)
{
}
EngineArray.ArrayCopy(numArray2, ((TrainFlatNetworkResilient) base.FlatTraining).UpdateValues);
}
示例5: IsValidResume
public bool IsValidResume(TrainingContinuation state)
{
if (state.Contents.ContainsKey("LAST_GRADIENTS"))
{
if (0 == 0)
{
if (0x7fffffff != 0)
{
}
if (!state.Contents.ContainsKey("UPDATE_VALUES"))
{
goto Label_004B;
}
}
if (state.TrainingType.Equals(base.GetType().Name))
{
double[] numArray = (double[]) state.Get("LAST_GRADIENTS");
return (numArray.Length == ((IContainsFlat) this.Method).Flat.Weights.Length);
}
return false;
}
Label_004B:
return false;
}
示例6: Save
/// <summary>
/// Save the object.
/// </summary>
/// <param name="obj">The object to save.</param>
/// <param name="xmlout">The XML output object.</param>
public void Save(IEncogPersistedObject obj, WriteXML xmlout)
{
PersistorUtil.BeginEncogObject(
EncogPersistedCollection.TYPE_TRAINING_CONTINUATION, xmlout, obj,
true);
this.current = (TrainingContinuation)obj;
xmlout.BeginTag(TrainingContinuationPersistor.TAG_ITEMS);
SaveItems(xmlout);
xmlout.EndTag();
xmlout.EndTag();
}
示例7: Load
/// <summary>
/// Load the object.
/// </summary>
/// <param name="xmlin">The XML object to load from.</param>
/// <returns>The loaded object.</returns>
public IEncogPersistedObject Load(ReadXML xmlin)
{
this.current = new TrainingContinuation();
String name = xmlin.LastTag.Attributes[
EncogPersistedCollection.ATTRIBUTE_NAME];
String description = xmlin.LastTag.Attributes[
EncogPersistedCollection.ATTRIBUTE_DESCRIPTION];
this.current.Name = name;
this.current.Description = description;
while (xmlin.ReadToTag())
{
if (xmlin.IsIt(TrainingContinuationPersistor.TAG_ITEMS, true))
{
HandleItems(xmlin);
}
else if (xmlin.IsIt(
EncogPersistedCollection.TYPE_TRAINING_CONTINUATION, false))
{
break;
}
}
return this.current;
}
示例8: Resume
/// <inheritdoc/>
public override void Resume(TrainingContinuation state)
{
}
示例9: Resume
/// <summary>
/// from Encog.ml.train.MLTrain
/// </summary>
///
public abstract void Resume(
TrainingContinuation state);
示例10: Resume
/// <inheritdoc/>
public void Resume(TrainingContinuation state)
{
}
示例11: Resume
public override void Resume(TrainingContinuation state)
{
if (!this.IsValidResume(state))
{
throw new TrainingError("Invalid training resume data length");
}
double[] src = (double[]) state.Contents["LAST_GRADIENTS"];
EngineArray.ArrayCopy(src, ((TrainFlatNetworkQPROP) base.FlatTraining).LastGradient);
}
示例12: Pause
public override TrainingContinuation Pause()
{
TrainingContinuation continuation;
TrainingContinuation continuation2 = new TrainingContinuation();
do
{
continuation2.TrainingType = base.GetType().Name;
continuation = continuation2;
TrainFlatNetworkQPROP flatTraining = (TrainFlatNetworkQPROP) base.FlatTraining;
double[] lastGradient = flatTraining.LastGradient;
continuation.Contents["LAST_GRADIENTS"] = lastGradient;
}
while (0x7fffffff == 0);
return continuation;
}
示例13: Read
public object Read(Stream mask0)
{
EncogReadHelper helper;
EncogFileSection section;
IDictionary<string, string> dictionary;
TrainingContinuation continuation = new TrainingContinuation();
if (3 != 0)
{
helper = new EncogReadHelper(mask0);
goto Label_001E;
}
Label_0010:
if ((-2 == 0) || (4 == 0))
{
goto Label_005C;
}
Label_001E:
if ((section = helper.ReadNextSection()) == null)
{
return continuation;
}
if (!section.SectionName.Equals("CONT"))
{
if (1 != 0)
{
if (0xff == 0)
{
return continuation;
}
goto Label_0010;
}
if (0 == 0)
{
goto Label_0077;
}
goto Label_001E;
}
Label_005C:
if (section.SubSectionName.Equals("PARAMS"))
{
dictionary = section.ParseParams();
}
else if ((0 == 0) && ((0 != 0) || (3 != 0)))
{
goto Label_001E;
}
Label_0077:
using (IEnumerator<string> enumerator = dictionary.Keys.GetEnumerator())
{
string current;
double[] numArray;
goto Label_0090;
Label_0086:
continuation.Put(current, numArray);
Label_0090:
if (enumerator.MoveNext())
{
current = enumerator.Current;
if (current.Equals("type", StringComparison.InvariantCultureIgnoreCase))
{
continuation.TrainingType = dictionary[current];
goto Label_0090;
}
numArray = EncogFileSection.ParseDoubleArray(dictionary, current);
if (0xff != 0)
{
}
goto Label_0086;
}
}
goto Label_001E;
}
示例14: Pause
public override sealed TrainingContinuation Pause()
{
TrainingContinuation continuation;
TrainingContinuation continuation2 = new TrainingContinuation {
TrainingType = base.GetType().Name
};
if (0 == 0)
{
continuation = continuation2;
TrainFlatNetworkBackPropagation flatTraining = (TrainFlatNetworkBackPropagation) base.FlatTraining;
double[] lastDelta = flatTraining.LastDelta;
continuation.Set("LAST_DELTA", lastDelta);
}
return continuation;
}
示例15: Resume
public override sealed void Resume(TrainingContinuation state)
{
if (!this.IsValidResume(state))
{
throw new TrainingError("Invalid training resume data length");
}
((TrainFlatNetworkBackPropagation) base.FlatTraining).LastDelta = (double[]) state.Get("LAST_DELTA");
}