[][src]Struct deep_learning_playground::neural_network::NeuralNetwork

pub struct NeuralNetwork<T> { /* fields omitted */ }

Methods

impl<T: Float + 'static> NeuralNetwork<T>[src]

pub fn new(init_neurons: Array2<T>) -> Result<Self, Error>[src]

new is the constructor of NeuralNetwork. If the height of a given matrix is not 1, it means batch processing.

Arguments

  • init_neurons - The initial matrix \(\mathbb{R}^{n\times m}\).

pub fn safe_next(
    &mut self,
    weight: &Array2<T>,
    bias: &Array2<T>,
    activate_function: &Box<dyn Fn(Array2<T>) -> Array2<T>>
) -> Result<(), Error>
[src]

Let a current matrix \(X^{1\times m_X}\), given arguments \(W^{n_W\times m_W}\) (weight) and \(B^{1\times m_B}\) (bias) where \(m_X=n_W\), \(m_W=m_B\). Thus, next computes next neurons \(X W+B\). If \(m_X \not = n_W\) or \(m_W \not = m_B\), it returns Err.

Arguments

  • weight - Weight matrix \(W^{n_W\times m_W}\) for computing next neuron.
  • bias - Bias matrix \(B^{1\times m_B}\) for computing next neuron.
  • activate_function - The activate function.

pub fn next(
    &mut self,
    weight: &Array2<T>,
    bias: &Array2<T>,
    activate_function: &Box<dyn Fn(Array2<T>) -> Array2<T>>
)
[src]

Compute \(h(X\cdot W+B)\) where \(X^{n_X\times m_X}\) is a neurons matrix, \(W^{n_W\times m_W\) is a weights matrix, \(B^{1\tims m_B}\) is a bias matrix. These arguments must follow \(m_X=n_W\), \(m_W=m_B\).

Arguments

  • weight - Weight matrix \(W^{n_W\times m_W\) for computing next neuron.
  • bias - Bias matrix \(B^{n_B\times m_B}\) for computing next neuron.
  • activate_function - The activate_function.

pub fn dim(&self) -> (Ix, Ix)[src]

dim returns the shape of the array.

pub fn argmax(&self) -> Vec<usize>[src]

argmax returns the index of maximum value. 行毎の最大値

Trait Implementations

impl<T: Default> Default for NeuralNetwork<T>[src]

impl<T: Float + Display> Display for NeuralNetwork<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for NeuralNetwork<T> where
    T: RefUnwindSafe

impl<T> Send for NeuralNetwork<T> where
    T: Send

impl<T> Sync for NeuralNetwork<T> where
    T: Sync

impl<T> Unpin for NeuralNetwork<T> where
    T: Unpin

impl<T> UnwindSafe for NeuralNetwork<T> where
    T: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromPy<T> for T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoPy<U> for T where
    U: FromPy<T>, 

impl<T> SetParameter for T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,