newron 0.4.0

A Rust library to train and infer deep learning models.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::tensor::Tensor;
use std::fmt;

pub trait Layer {
    fn forward(&self, input: &Tensor) -> Tensor;
    fn backward(&mut self, input: &Tensor, grad_output: Tensor) -> Tensor;
    fn get_info(&self) -> String;
}

impl fmt::Debug for dyn Layer {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.get_info())
    }
}