Skip to content

Commit

Permalink
fix mutation to include negative numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperCodec committed Feb 12, 2024
1 parent a52f3f3 commit 9ed73ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl<const I: usize, const O: usize> RandomlyMutable for NeuralNetworkTopology<I
let mut n = n.write().unwrap();
let i = rng.gen_range(0..n.inputs.len());
let (_, w) = &mut n.inputs[i];
*w += rng.gen::<f32>() * rate;
*w += rng.gen_range(-1.0..1.0) * rate;
}
}
}
Expand Down

0 comments on commit 9ed73ce

Please sign in to comment.