Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

35
LINES

< > BotCompany Repo | #1022921 // Learn Tabs / No Tabs [dev.]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (6949L/37K).

!7

cmodule LearnTabs > DynSingleFunctionWithPrintLog {
  void doIt {
    L<File> all = listImageFiles(ai_browserTabsTrainingDataDir());
    Pair<L<File>> files = filterAntiFilter(all, f -> !fileNameContainsIC(f, "notabs"));
    pnl(pairToList(files));
    Pair<L<RGBImage>> images = pair(
      map loadImage(files.a),
      map loadImage(files.b));

    replace Entry with T3<Int, FourPointsRange, Double>.
    replace Submission with L<Entry>.
    
    AIStrategy_Racer_RandomWithVary<Submission> strategy = new AIStrategy_Racer_RandomWithVary;
    strategy.submit = func(Submission s) -> double {
      double score = 0;
      for (RGBImage img : images.a)
        score += imageAnalysis_332parameterScore(s, img);
      for (RGBImage img : images.b)
        score -= imageAnalysis_332parameterScore(s, img);
      ret score;
    };
    strategy.random = func -> Submission {
      ll(t3(
        random(256),
        fourPointsRange_autoSwap(random(0, 30000), random(0, 30000)),
        random()))
    };
    strategy.vary = null;
    
    runStrategyWhileImprovement(strategy);
    print("[done]");
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022921
Snippet name: Learn Tabs / No Tabs [dev.]
Eternal ID of this version: #1022921/5
Text MD5: f8a9c2ce78c1f1f03c6e59b7c61d14e1
Transpilation MD5: 147899b7c01cad4debd81f38bc19a693
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-14 22:07:19
Source code size: 1144 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 294 / 580
Version history: 4 change(s)
Referenced in: [show references]