示例#1
0
        public void InitialChistaNet()
        {
            if (StableImage is NeuralNetworkImage image)
            {
                RunningChistaNet = new ChistaNet(image);
            }
            else if (StableImage is NeuralNetworkLineImage line_image)
            {
                RunningChistaNet = new ChistaNetLine(line_image);
            }

            else
            {
                throw new Exception("The stable image does not exist.");
            }
        }
示例#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;
            }
        }