astrai 2.2.0

A pretty bad neural network library
Documentation
use super::*;

pub type NeuronID = (usize, usize); // layer, index

impl Network {
	// TODO: move to initialization context
    pub fn add_connection(&mut self, in_neuron_id: NeuronID, out_neuron_id: NeuronID, weight: f64) {
        self.connections.push(Connection {
            in_neuron_id,
            out_neuron_id,
            weight,
            enabled: true,
        });
    }

    pub fn get_input_layer(&self) -> Layer {
        self.layers.last().unwrap().clone()
    }

    pub fn get_output_layer(&self) -> Layer {
        self.layers.last().unwrap().clone()
    }

    pub fn zero_out_network(&mut self) {
        for layer in self.layers.iter_mut() {
            layer.zero_out();
        }
	}
}