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 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 NetProcess(NetProcessInfo state) { if (state == null) { throw new ArgumentNullException(nameof(state)); } history = NetProcessHistory.Restore(state.stable_image, state.accuracy_chain_history); if (state.running_image is NeuralNetworkImage image) { RunningChistaNet = new ChistaNet(image); } else if (state.running_image is NeuralNetworkLineImage line_image) { RunningChistaNet = new ChistaNetLine(line_image); } else if (state.stable_image == null) { throw new ArgumentException(nameof(state), "The state must have stable-image or running-image"); } else { return; } record_count = state.running_record_count; total_accruacy = state.running_total_accruacy; if (record_count > 0) { RunningAccuracy = total_accruacy / record_count; } }
public NetProcess(IChistaNet chista_net) { RunningChistaNet = chista_net ?? throw new ArgumentNullException(nameof(chista_net)); history = new NetProcessHistory(); }