コード例 #1
0
        public static NetworkEditor CreateVaryWeights(DoubleRange varyPercentageRange)
        {
            var manipulationConfig = NetworkModificationConfiguration.Create()
                                     .ConfigureWeight(WeightModificationConfiguration.Create()
                                                      .ConfigureTarget(AllWeightModificationTarget.Create())
                                                      .ConfigureGradationFilter(AllWeightModificationGradationFilter.Create())
                                                      .ConfigureModifier(PercentageVariationWeightModifier.Create(varyPercentageRange)));

            var manipulator = new NetworkManipulator(manipulationConfig);

            return(new NetworkEditor(manipulator));
        }
コード例 #2
0
        public static NetworkEditor CreateRandom(DoubleRange biasRange, DoubleRange weightRange)
        {
            var manipulationConfig = NetworkModificationConfiguration.Create()
                                     .ConfigureBias(BiasModificationConfiguration.Create()
                                                    .ConfigureTarget(AllBiasModificationTarget.Create())
                                                    .ConfigureGradationFilter(AllBiasModificationGradationFilter.Create())
                                                    .ConfigureModifier(RandomBiasModifier.Create(biasRange)))
                                     .ConfigureWeight(WeightModificationConfiguration.Create()
                                                      .ConfigureTarget(AllWeightModificationTarget.Create())
                                                      .ConfigureGradationFilter(AllWeightModificationGradationFilter.Create())
                                                      .ConfigureModifier(RandomWeightModifier.Create(weightRange)))
                                     .ConfigureActivationFunction(ActivationFunctionModificationConfiguration.Create()
                                                                  .ConfigureTarget(AllActivationFunctionModificationTarget.Create())
                                                                  .ConfigureGradationFilter(AllActivationFunctionModificationGradationFilter.Create())
                                                                  .ConfigureModifier(RandomActivationFunctionModifier.Create())
                                                                  );

            var manipulator = new NetworkManipulator(manipulationConfig);

            return(new NetworkEditor(manipulator));
        }