Fix build errors

This commit is contained in:
Peter Stockings
2026-01-15 18:27:20 +11:00
parent fab6a7e03f
commit 1c0e4c3af6
19 changed files with 35 additions and 39 deletions

View File

@@ -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) {