acme-tensor 0.3.1

A comprehensive tensor library for Rust with support for automatic-differentiation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
    Appellation: scalar <mod>
    Contrib: FL03 <jo3mccain@icloud.com>
*/
use crate::tensor::TensorBase;
use acme::prelude::Scalar;

pub trait ScalarExt: Scalar {
    fn into_tensor(self) -> TensorBase<Self> {
        TensorBase::from_scalar(self)
    }
    fn sigmoid(self) -> Self {
        (Self::one() + self.neg().exp()).recip()
    }
}

impl<S> ScalarExt for S where S: Scalar {}