[−][src]Struct deep_learning_playground::neural_network::NeuralNetwork
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]
&mut self,
weight: &Array2<T>,
bias: &Array2<T>,
activate_function: &Box<dyn Fn(Array2<T>) -> Array2<T>>
) -> Result<(), Error>
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]
&mut self,
weight: &Array2<T>,
bias: &Array2<T>,
activate_function: &Box<dyn Fn(Array2<T>) -> Array2<T>>
)
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]
fn default() -> NeuralNetwork<T>
[src]
impl<T: Float + Display> Display for NeuralNetwork<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for NeuralNetwork<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for NeuralNetwork<T> where
T: Send,
T: Send,
impl<T> Sync for NeuralNetwork<T> where
T: Sync,
T: Sync,
impl<T> Unpin for NeuralNetwork<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for NeuralNetwork<T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromPy<T> for T
fn from_py(t: T, Python) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoPy<U> for T where
U: FromPy<T>,
U: FromPy<T>,
default fn into_py(self, py: Python) -> U
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,