public NetProcess(INeuralNetworkImage image) { if (image == null) { throw new ArgumentNullException(nameof(image)); } history = NetProcessHistory.Restore(image); }
public static NetProcessHistory Restore(INeuralNetworkImage stable_image) { var history = new NetProcessHistory(); if (stable_image != null) { history.StableNetImage = new NetProcessImage(stable_image, -1); } return(history); }
public NetProcessInfo( INeuralNetworkImage running_image, int running_record_count, double running_total_accruacy, INeuralNetworkImage stable_image, double[] accuracy_chain_history) { this.running_image = running_image; this.running_record_count = running_record_count; this.running_total_accruacy = running_total_accruacy; this.stable_image = stable_image; this.accuracy_chain_history = accuracy_chain_history; }
public static void Serialize(FileStream stream, INeuralNetworkImage image) { if (image is NeuralNetworkImage cu_image) { NeuralNetworkSerializer.Serialize(stream, cu_image); } else if (image is NeuralNetworkLineImage cu_line_image) { NeuralNetworkLineSerializer.Serialize(stream, cu_line_image); } else { throw new Exception( "The serializer for this type of INeuralNetworkImage is not registed."); } }
public void AddOutOfLineProgress(INeuralNetworkImage image) { if (image == null) { throw new ArgumentNullException(nameof(image)); } if (!Stopped) { throw new Exception("The process is not stoped."); } process_locker.AcquireWriterLock(100); try { out_of_lines.Add(new NetProcess(image)); CheckBestRunningProcess(); } finally { process_locker.ReleaseWriterLock(); } }
public static NetProcessHistory Restore(INeuralNetworkImage stable_image, double[] chain) { var history = new NetProcessHistory(); if (stable_image != null) { if (chain == null || chain.Length < 1) { throw new ArgumentNullException(nameof(chain)); } history.StableNetImage = new NetProcessImage(stable_image, chain[0]); foreach (var accuracy in chain) { history.accuracy_chain.AddLast(accuracy); } } return(history); }
public NetProcessImage(INeuralNetworkImage image, double accuracy) { Image = image ?? throw new ArgumentNullException(nameof(image)); Accuracy = accuracy; }