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

12
LINES

< > BotCompany Repo | #1020473 // ai_trainable_multiplyingNumberConversion

JavaX fragment (include)

1  
static F1<S> ai_trainable_multiplyingNumberConversion(LS trainingParams) {
2  
  double ratio = 1;
3  
  S pat = null;
4  
  for (S key, S value : listParamsToMap(trainingParams)) {
5  
    long a = parseFirstLong(key), b = parseFirstLong(value);
6  
    pat = replaceFirstLong(value, "*");
7  
    ratio = doubleRatio(b, a);
8  
  }
9  
  final double _ratio = ratio;
10  
  final S _pat = pat;
11  
  ret func(S s) -> S { format(_pat, round(parseFirstLong(s)*_ratio)) };
12  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1020473
Snippet name: ai_trainable_multiplyingNumberConversion
Eternal ID of this version: #1020473/3
Text MD5: 27c3c3075c5d0d29350e165aed8d35a9
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-23 19:30:18
Source code size: 443 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 369 / 398
Version history: 2 change(s)
Referenced in: [show references]