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).

1  
!7
2  
3  
cmodule LearnTabs > DynSingleFunctionWithPrintLog {
4  
  void doIt {
5  
    L<File> all = listImageFiles(ai_browserTabsTrainingDataDir());
6  
    Pair<L<File>> files = filterAntiFilter(all, f -> !fileNameContainsIC(f, "notabs"));
7  
    pnl(pairToList(files));
8  
    Pair<L<RGBImage>> images = pair(
9  
      map loadImage(files.a),
10  
      map loadImage(files.b));
11  
12  
    replace Entry with T3<Int, FourPointsRange, Double>.
13  
    replace Submission with L<Entry>.
14  
    
15  
    AIStrategy_Racer_RandomWithVary<Submission> strategy = new AIStrategy_Racer_RandomWithVary;
16  
    strategy.submit = func(Submission s) -> double {
17  
      double score = 0;
18  
      for (RGBImage img : images.a)
19  
        score += imageAnalysis_332parameterScore(s, img);
20  
      for (RGBImage img : images.b)
21  
        score -= imageAnalysis_332parameterScore(s, img);
22  
      ret score;
23  
    };
24  
    strategy.random = func -> Submission {
25  
      ll(t3(
26  
        random(256),
27  
        fourPointsRange_autoSwap(random(0, 30000), random(0, 30000)),
28  
        random()))
29  
    };
30  
    strategy.vary = null;
31  
    
32  
    runStrategyWhileImprovement(strategy);
33  
    print("[done]");
34  
  }
35  
}

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: 217 / 489
Version history: 4 change(s)
Referenced in: [show references]