Esempio n. 1
0
 public NetProcess(INeuralNetworkImage image)
 {
     if (image == null)
     {
         throw new ArgumentNullException(nameof(image));
     }
     history = NetProcessHistory.Restore(image);
 }
Esempio n. 2
0
        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;
            }
        }