make_network

Macro make_network 

Source
macro_rules! make_network {
    ($neurons:expr) => { ... };
    ($neurons:expr, $next:expr) => { ... };
    ($neurons:expr, $next:expr, $($c:tt),*) => { ... };
}
Expand description

Helper macro used to initialize a neural network, simply pass a comma separated list the number of neurons for each layer, works for any sized neural network.

ยงExample

use mynn::network::{ProcessLayer, EndLayer};
use mynn::make_network;
 
let network = make_network!(2, 3, 1);
let network2 = ProcessLayer::<3, 2, 1, ProcessLayer<1, 3, 1, EndLayer<1>>>::new(ProcessLayer::new(EndLayer()));
 
assert_eq!(std::any::type_name_of_val(&network), std::any::type_name_of_val(&network2));