Skip to content

Commit

Permalink
Create agi.utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 15, 2024
1 parent 70acd9c commit d868fea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions models/agi/agi.utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function randomize(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}

export function normalize(arr) {
return arr.map(x => x / Math.max(...arr));
}

0 comments on commit d868fea

Please sign in to comment.