Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BradenEverson authored Apr 16, 2024
1 parent 57421dc commit 434a6d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ fn main() {

let mut new_net = Network::new(4);

new_net.set_input(InputTypes::DENSE(2))
new_net.set_input(InputTypes::DENSE(2));
new_net.add_layer(LayerTypes::DENSE(3, Activations::RELU, 0.001));
new_net.add_layer(LayerTypes::DENSE(1, Activations::SIGMOID, 0.001));

new_net.compile();

new_net.fit(&inputs, &outputs, 2, ErrorTypes::MeanAbsolute);

println!("1 and 0: {:?}", new_net.predict(vec![1.0,0.0])[0]);
println!("0 and 1: {:?}", new_net.predict(vec![0.0,1.0])[0]);
println!("1 and 1: {:?}", new_net.predict(vec![1.0,1.0])[0]);
println!("0 and 0: {:?}", new_net.predict(vec![0.0,0.0])[0]);
println!("1 and 0: {:?}", new_net.predict(&vec![1.0,0.0])[0]);
println!("0 and 1: {:?}", new_net.predict(&vec![0.0,1.0])[0]);
println!("1 and 1: {:?}", new_net.predict(&vec![1.0,1.0])[0]);
println!("0 and 0: {:?}", new_net.predict(&vec![0.0,0.0])[0]);

new_net.save("best_network.json");
}
Expand Down

0 comments on commit 434a6d4

Please sign in to comment.