layerganza
Version:
A feed-forward neural network with injectable layers, activation functions, and optimizers.
19 lines (18 loc) • 557 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function arrayShuffle(array) {
let counter = array.length;
// While there are elements in the array
while (counter > 0) {
// Pick a random index
let index = Math.floor(Math.random() * counter);
// Decrease counter by 1
counter--;
// And swap the last element with it
let temp = array[counter];
array[counter] = array[index];
array[index] = temp;
}
return array;
}
exports.default = arrayShuffle;