当前位置: 首页>>代码示例>>C#>>正文


C# Simulator.WeightInformationReader方法代码示例

本文整理汇总了C#中Simulator.WeightInformationReader方法的典型用法代码示例。如果您正苦于以下问题:C# Simulator.WeightInformationReader方法的具体用法?C# Simulator.WeightInformationReader怎么用?C# Simulator.WeightInformationReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Simulator的用法示例。


在下文中一共展示了Simulator.WeightInformationReader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessThread

        private void ProcessThread()
        {
            for (int batchIndex = currentBathDataIndex; batchIndex < batchDataList.Count; batchIndex++)
            {
                learningStatus = LearningStatus.Training;

                currentBathDataIndex = batchIndex;

                simulator = batchDataList[batchIndex].Simulator;
                learningSetupList = batchDataList[batchIndex].LearningSetupList;

                simulator.UseActivationInformation = saveLayerActivationCheckBox.Checked;
                simulator.UseWeightInformation = saveWeightCheckBox.Checked;

                this.Invoke(new MethodInvoker(delegate
                {
                    BatchListBoxRefresh();
                    TestDisplayRefresh();
                }));

                for (int learningSetupIndex = currentLearningSetupIndex; learningSetupIndex < learningSetupList.Count; learningSetupIndex++)
                {
                    totalEpoch = 0;
                    for (int i = 0; i < learningSetupIndex; i++) totalEpoch += learningSetupList[i].TrainingEpoch;

                    currentLearningSetupIndex = learningSetupIndex;
                    List<MatchingInformation> currentTrainingMatchingInformationList = learningSetupList[learningSetupIndex].TrainingMatchingInformationList;
                    List<MatchingInformation> currentTestMatchingInformationList = learningSetupList[learningSetupIndex].TestMatchingInformationList;

                    List<TrialInformation> testMatrixTrialInformationList = new List<TrialInformation>();
                    foreach (MatchingInformation testMatchingInformation in currentTestMatchingInformationList)
                    {
                        bool isSRN = false;
                        foreach (Order order in simulator.ProcessDictionary[testMatchingInformation.ProcessName])
                        {
                            if (order.Code == OrderCode.SRNTraining || order.Code == OrderCode.SRNTest) isSRN = true;
                        }

                        List<StimuliMatrix> stimuliMatrixList;
                        if (isSRN && learningSetupList[learningSetupIndex].MatrixCalculationSize == 1) stimuliMatrixList = simulator.StimuliPackDictionary[testMatchingInformation.StimuliPackName].GetMatrixStimuliData(true, true, 1);
                        else stimuliMatrixList = simulator.StimuliPackDictionary[testMatchingInformation.StimuliPackName].GetMatrixStimuliData(false, false, simulator.StimuliPackDictionary[testMatchingInformation.StimuliPackName].Count);
                        foreach (StimuliMatrix stimuliMatrix in stimuliMatrixList)
                        {
                            TrialInformation newTestTrialInformation = new TrialInformation();
                            newTestTrialInformation.Process = simulator.ProcessDictionary[testMatchingInformation.ProcessName];
                            newTestTrialInformation.PatternSetup = testMatchingInformation.PatternSetup;
                            newTestTrialInformation.StimuliMatrix = stimuliMatrix;

                            testMatrixTrialInformationList.Add(newTestTrialInformation);
                        }
                    }

                    if (currentEpoch == 0)
                    {
                        learningStatus = LearningStatus.Test;
                        if (simulator.UseWeightInformation) simulator.WeightInformationReader(totalEpoch + 0);
                        for (int testIndex = 0; testIndex < testMatrixTrialInformationList.Count; testIndex++)
                        {
                            simulator.Process(testMatrixTrialInformationList[testIndex], totalEpoch + 0);
                        }

                    }

                    for (int epochIndex = currentEpoch; epochIndex < learningSetupList[learningSetupIndex].TrainingEpoch; epochIndex++)
                    {
                        learningStatus = LearningStatus.Training;

                        currentTick = DateTime.Now.Ticks;

                        currentEpoch = epochIndex;

                        List<TrialInformation> trainingMatrixTrialInformationList = new List<TrialInformation>();
                        foreach (MatchingInformation trainingMatchingInformation in currentTrainingMatchingInformationList)
                        {
                            List<StimuliMatrix> stimuliMatrixList = new List<StimuliMatrix>();
                            switch (learningSetupList[learningSetupIndex].TrainingProcessMode)
                            {
                                case ProcessMode.RandomAll:
                                case ProcessMode.RandomInStimuliPack:
                                    stimuliMatrixList = simulator.StimuliPackDictionary[trainingMatchingInformation.StimuliPackName].GetMatrixStimuliData(true, true, learningSetupList[learningSetupIndex].MatrixCalculationSize);
                                    break;
                                case ProcessMode.SequentialAll:
                                case ProcessMode.SequentialinStimuliPack:
                                    stimuliMatrixList = simulator.StimuliPackDictionary[trainingMatchingInformation.StimuliPackName].GetMatrixStimuliData(true, false, learningSetupList[learningSetupIndex].MatrixCalculationSize);
                                    break;
                            }

                            foreach (StimuliMatrix stimuliMatrix in stimuliMatrixList)
                            {
                                TrialInformation newTrainingTrialInformation = new TrialInformation();
                                newTrainingTrialInformation.Process = simulator.ProcessDictionary[trainingMatchingInformation.ProcessName];
                                newTrainingTrialInformation.PatternSetup = trainingMatchingInformation.PatternSetup;
                                newTrainingTrialInformation.StimuliMatrix = stimuliMatrix;

                                trainingMatrixTrialInformationList.Add(newTrainingTrialInformation);
                            }
                        }

                        switch (learningSetupList[learningSetupIndex].TrainingProcessMode)
                        {
//.........这里部分代码省略.........
开发者ID:CODEJIN,项目名称:HJ-Net,代码行数:101,代码来源:BatchLearningForm.cs


注:本文中的Simulator.WeightInformationReader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。