Skip to content

Commit 7c31f30

Browse files
committed
cargo fmt
1 parent b95084d commit 7c31f30

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

examples/custom_activation.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ fn fitness(g: &AgentDNA) -> f32 {
2727
let n = rng.gen::<f32>();
2828
let n2 = rng.gen::<f32>();
2929

30-
let expected = if (n + n2) / 2. >= 0.5 {
31-
0
32-
} else {
33-
1
34-
};
30+
let expected = if (n + n2) / 2. >= 0.5 { 0 } else { 1 };
3531

3632
let result = network.predict([n, n2]);
3733
network.flush_state();
@@ -73,20 +69,16 @@ fn main() {
7369
let mut sim = GeneticSim::new(
7470
#[cfg(not(feature = "rayon"))]
7571
Vec::gen_random(&mut rng, 100),
76-
7772
#[cfg(feature = "rayon")]
7873
Vec::gen_random(100),
79-
8074
fitness,
81-
8275
#[cfg(not(feature = "serde"))]
8376
division_pruning_nextgen,
84-
8577
#[cfg(feature = "serde")]
8678
serde_nextgen,
8779
);
8880

8981
for _ in 0..200 {
9082
sim.next_generation();
9183
}
92-
}
84+
}

0 commit comments

Comments
 (0)