Exemplo n.º 1
0
        public static INetwork Train(this INetwork network, TrainingConfig config, IEnumerable <DataItem> dataset)
        {
            var trainer = new Trainer(network, config);

            trainer.Train(dataset);
            return(network);
        }
Exemplo n.º 2
0
        public void PerformTrainingTest()
        {
            var config = new TrainingConfig {
                Epochs = 5
            };
            var source = new TextDataSource(config, @"..\..\..\..\Resources\Data\tinyshakespeare.txt");

            var model = new ModelTrainer().PerformTraining(config, source);

            model.Save(@"..\..\..\..\Resources\Model\shakespeare_epoch5.dnn");
        }
Exemplo n.º 3
0
    public void LoadConfig()
    {
        AnnouncementConfigData = new AnnouncementConfig();
        BadgeAttrConfigData    = new BadgeAttrConfig();
        ConstStringConfigData  = new ConstStringConfig();
        CommonConfig           = new CommonConfig();

        AttrNameConfigData        = new AttrNameConfig();
        RoleBaseConfigData2       = new BaseDataConfig2();
        AttrDataConfigData        = new AttrDataConfig();
        TeamLevelConfigData       = new TeamLevelConfig();
        RoleLevelConfigData       = new RoleLevelConfig();
        NPCConfigData             = new NPCDataConfig();
        SkillConfig               = new SkillConfig();
        GoodsConfigData           = new GoodsConfig();
        StoreGoodsConfigData      = new StoreGoodsConfig();
        BaseDataBuyConfigData     = new BaseDataBuyConfig();
        TaskConfigData            = new TaskDataConfig();
        AwardPackConfigData       = new AwardPackDataConfig();
        PractiseConfig            = new PractiseConfig();
        PracticePveConfig         = new PracticePveConfig();
        PractiseStepConfig        = new PractiseStepConfig();
        GameModeConfig            = new GameModeConfig();
        TrainingConfig            = new TrainingConfig();
        TattooConfig              = new TattooConfig();
        EquipmentConfigData       = new EquipmentConfig();
        TourConfig                = new TourConfig();
        GuideConfig               = new GuideConfig();
        FunctionConditionConfig   = new FunctionConditionConfig();
        RoleShapeConfig           = new RoleShapeConfig();
        FashionConfig             = new FashionConfig();
        FashionShopConfig         = new FashionShopConfig();
        VipPrivilegeConfig        = new VipPrivilegeConfig();
        pushConfig                = new PushConfig();
        presentHpConfigData       = new PresentHpConfig();
        LotteryConfig             = new LotteryConfig();
        starAttrConfig            = new StarAttrConfig();
        qualityAttrCorConfig      = new QualityAttrCorConfig();
        skillUpConfig             = new SkillUpConfig();
        RankConfig                = new RankConfig();
        signConfig                = new SignConfig();
        NewComerSignConfig        = new NewComerSignConfig();
        FightingCapacityConfig    = new FightingCapacityConfig();
        BodyInfoListConfig        = new BodyInfoListConfig();
        BadgeSlotsConfig          = new BadgeSlotConfig();
        GoodsComposeNewConfigData = new GoodsComposeNewConfig();

        SceneConfig = new SceneConfig();

        ReboundAttrConfigData    = new ReboundAttrConfig();
        CareerConfigData         = new CareerConfig();
        PotientialEffectConfig   = new PotientialEffectConfig();
        PVPPointConfig           = new PVPPointConfig();
        WinningStreakAwardConfig = new WinningStreakAwardConfig();
        ArticleStrengthConfig    = new ArticleStrengthConfig();
        PhRegainConfig           = new PhRegainConfig();
        MatchAchievementConfig   = new MatchAchievementConfig();
        SpecialActionConfig      = new SpecialActionConfig();
        StealConfig           = new StealConfig();
        CurveRateConfig       = new CurveRateConfig();
        DunkRateConfig        = new DunkRateConfig();
        AIConfig              = new AIConfig();
        AttrReduceConfig      = new AttrReduceConfig();
        qualifyingConfig      = new QualifyingConfig();
        qualifyingNewConfig   = new QualifyingNewConfig();
        qualifyingNewerConfig = new QualifyingNewerConfig();
        bullFightConfig       = new BullFightConfig();
        HedgingConfig         = new HedgingConfig();
        roleGiftConfig        = new RoleGiftConfig();
        DebugConfig           = new DebugConfig();
        shootGameConfig       = new ShootGameConfig();
        MapConfig             = new MapConfig();
        activityConfig        = new ActivityConfig();
        trialConfig           = new TrialConfig();
        gameMatchConfig       = new GameMatchConfig();
        shootSolutionManager  = new ShootSolutionManager();
        talentConfig          = new TalentConfig();
        ladderConfig          = new LadderConfig();
        matchSoundConfig      = new MatchSoundConfig();
        matchMsgConfig        = new MatchMsgConfig();
        MatchPointsConfig     = new MatchPointsConfig();
        AnimationSampleManager.Instance.LoadXml();
    }
Exemplo n.º 4
0
        public PatternMatching(int x, int y, int output)
        {
            InitializeComponent();

            ProgressBegin();

            pm = new Grid2DControler(x, y, output);

            BasicConfig    bc = pm.BasicConfiguration;
            TrainingConfig tc = pm.TrainingConfiguration;
            Grid2DConfig   gc = new Grid2DConfig(bc.Node);

            bc.ActivationType.Value            = EActivationType.Symmetric;
            bc.BiasNeuronEnable.Value          = true;
            bc.BiasNeuronOutput.Value          = 0.9d;
            bc.DeadNeuronDecayEnabled.Value    = false;
            bc.FlatspotEliminationEnable.Value = true;
            bc.FlatspotElimination.Value       = 0.05d;
            bc.InitialSymmetryBreaking.Value   = 0.2d;
            bc.LearningRate.Value             = 0.3d;
            bc.ManhattanTrainingEnable.Value  = false;
            bc.MomentumTermEnable.Value       = false;
            bc.SymmetryPreventionEnable.Value = true;
            bc.SymmetryPrevention.Value       = 0.05d;
            bc.WeightDecayEnable.Value        = true;
            bc.WeightDecay.Value = 0.01d;

            bc.LowInput.Value   = -3d;
            bc.HighInput.Value  = 3d;
            bc.LowOutput.Value  = -0.95d;
            bc.HighOutput.Value = 0.95d;

            tc.AutoTrainingAttempts.Value          = 1;
            tc.AutoTrainingEpochs.Value            = 400;
            tc.AutoTrainingPercentSuccessful.Value = 1.0d;
            tc.ShuffleEnable.Value          = true; // make it more robust for noise
            tc.ShuffleNoiseSigma.Value      = 0.2d;
            tc.ShuffleSwapProbability.Value = 0.2d; // 0.2 = every 5ht pixel is swapped (20% probability) !!

            gc.All2AllEnable.Value         = false;
            gc.HorizontalLinesEnable.Value = true;
            gc.VerticalLinesEnable.Value   = true;
            gc.RingsEnable.Value           = true;
            gc.LittleSquaresEnable.Value   = true;

            pm.BuildNetwork(true);

            //pm.NetworkTrainer = new SimpleTrainer();
            //pm.NetworkTrainer = new OpenloopTrainer();
            //pm.NetworkTrainer = new ConditionalTrainer();
            pm.NetworkTrainer = new FeedbackTrainer();

            ProgressStatus(50);

            pm.Patterns.PatternAdded   += pm_OnNewPatternAdded;
            pm.PatternSelectionChanged += pm_OnPatternSelectionChanged;
            pm.InputChanged            += pm_OnInputChanged;
            pm.NetworkRebuilt          += pm_OnNetworkRebuilt;

            outputStat.Init(pm);
            inputGrid.Init(pm);
            inputGrid.OnGridChanged += inputGrid_OnGridChanged;

            ProgressEnd();
        }