diff --git a/models/agi/agi.utils.js b/models/agi/agi.utils.js new file mode 100644 index 0000000..7e2b1b1 --- /dev/null +++ b/models/agi/agi.utils.js @@ -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)); +}