[−][src]Struct radiate::models::evtree::network::NeuralNetwork
The neural network struct is meant to represent a simple feed forward neural network with the ability to maniupate it's weights and biases, and feed forward a 1D vector of a predetermined size (input_size).
Fields
weights: Vec<Matrix<f32>>
biases: Vec<Matrix<f32>>
Methods
impl NeuralNetwork
[src]
implement the nerual network
pub fn new(input_size: i32) -> Self
[src]
Create a new neural network
This returns a completely empty neural network, to create a random network chain the 'fill_random()' method ontop of this method call.
pub fn fill_random(self) -> Self
[src]
Randomly fill the weights and biases of the neural network This method consumes the network, generates random vecs representing the weights and biases, assigns them, and returns the consumed NeuralNetwork back to the caller.
pub fn edit_weights(
&mut self,
weight_mutate: f32,
weight_transform: f32,
layer_mutate: f32
)
[src]
&mut self,
weight_mutate: f32,
weight_transform: f32,
layer_mutate: f32
)
Edit the weights randomly of the matrix objects within the network pub fn edit_weights(&mut self, layer_rate: f32, weight_mutate: f32, weight_transform: f32) {
pub fn generate_random_network(
&mut self
) -> (Vec<Matrix<f32>>, Vec<Matrix<f32>>)
[src]
&mut self
) -> (Vec<Matrix<f32>>, Vec<Matrix<f32>>)
Generate a random neural network with at least one hidden layer and each layer with a size of at least one. Return a tuble containin the vec of weights represented by a simple matrix and a vec of biases represeted by a simple matrix as well.
pub fn feed_forward(&self, input: Matrix<f32>) -> Matrix<f32>
[src]
feed forward a matrix through the neural network and output a matrix
pub fn weight_sum(&self) -> f32
[src]
Compute the sum of the weights of the neural network pretty simple.
Trait Implementations
impl Clone for NeuralNetwork
[src]
fn clone(&self) -> NeuralNetwork
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for NeuralNetwork
[src]
impl Drop for NeuralNetwork
[src]
impl PartialEq<NeuralNetwork> for NeuralNetwork
[src]
Override the partialeq trait for the neural network. This is needed because there is no impmenetation for partialeq for a ThreadRng which the nerual net ownes. Because that doesn't matter for a partialeq, this override only checks what is actually needed. Without this the program will not compile.
Auto Trait Implementations
impl RefUnwindSafe for NeuralNetwork
impl Send for NeuralNetwork
impl Sync for NeuralNetwork
impl Unpin for NeuralNetwork
impl UnwindSafe for NeuralNetwork
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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<T> Type for T
[src]
const METATYPE: MetaType
[src]
type Meta = Concrete
Type of metadata for type.
fn meta(self: *const T) -> <T as Type>::Meta
[src]
fn data(self: *const T) -> *const ()
[src]
fn data_mut(self: *mut T) -> *mut ()
[src]
fn dangling(_t: <T as Type>::Meta) -> NonNull<T>
[src]
fn fatten(thin: *mut (), _t: <T as Type>::Meta) -> *mut T
[src]
fn meta_type(self: *const Self) -> MetaType
[src]
impl<T> Type for T where
T: ?Sized,
[src]
T: ?Sized,
default fn meta(self: *const T) -> <T as Type>::Meta
[src]
default fn data(self: *const T) -> *const ()
[src]
default fn data_mut(self: *mut T) -> *mut ()
[src]
default fn dangling(t: <T as Type>::Meta) -> NonNull<T>
[src]
default fn fatten(thin: *mut (), t: <T as Type>::Meta) -> *mut T
[src]
const METATYPE: MetaType
[src]
type Meta: 'static
fn meta_type(self: *const Self) -> MetaType
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,