Fix build errors
This commit is contained in:
@@ -31,8 +31,6 @@ export class SimpleGA {
|
||||
// Duplicating logic is safer to avoid instantiation overhead if large.
|
||||
// Logic from DenseNetwork: sum((full_in + 1) * out)
|
||||
// Let's just instantiate one to be sure.
|
||||
const dummy = new DenseNetwork(this.layerSizes);
|
||||
const size = dummy.getWeights().length;
|
||||
|
||||
for (let i = 0; i < this.config.populationSize; i++) {
|
||||
const dn = new DenseNetwork(this.layerSizes);
|
||||
@@ -88,8 +86,6 @@ export class SimpleGA {
|
||||
let bestFitness = -Infinity;
|
||||
|
||||
for (let i = 0; i < k; i++) {
|
||||
const randIdx = indices[Math.floor(Math.random() * indices.length)]; // Pick from sorted or unsorted?
|
||||
// Better to pick pure random index from 0..popSize-1
|
||||
const r = Math.floor(Math.random() * indices.length);
|
||||
const realIdx = indices[r];
|
||||
if (fitnesses[realIdx] > bestFitness) {
|
||||
|
||||
Reference in New Issue
Block a user