[−][src]Struct radiate::models::neat::layers::dense::Dense
Fields
inputs: Vec<NeuronId>
outputs: Vec<NeuronId>
nodes: Vec<Neuron>
edges: Vec<Edge>
edge_innov_map: HashMap<Uuid, EdgeId>
trace_states: Option<Tracer>
layer_type: LayerType
activation: Activation
Implementations
impl Dense
[src]
pub fn new(
num_in: u32,
num_out: u32,
layer_type: LayerType,
activation: Activation
) -> Self
[src]
num_in: u32,
num_out: u32,
layer_type: LayerType,
activation: Activation
) -> Self
create a new fully connected dense layer. Each input is connected to each output with a randomly generated weight attached to the connection
pub fn get_edge_by_innov(&self, innov: &Uuid) -> Option<&Edge>
[src]
Get edge by innov
pub fn contains_edge(&self, innov: &Uuid) -> bool
[src]
Check if this layer contains an edge.
pub fn get_outputs(&self) -> Option<Vec<f32>>
[src]
get the outputs from the layer in a vec form
pub fn add_node(&mut self, activation: Activation, direction: NeuronDirection)
[src]
Add a node to the network by getting a random edge and inserting the new node in-between that edge's source and destination nodes. The old weight is pushed forward while the new weight is randomly chosen and put between the old source node and the new node
pub fn add_edge(&mut self)
[src]
add a connection to the network. Randomly get a sending node that cannot be an output and a receiving node which is not an input node, the validate that the desired connection can be made. If it can be, make the connection with a weight of .5 in order to minimally impact the network
pub fn get_output_states(&self) -> Vec<f32>
[src]
get the states of the output neurons. This allows softmax and other specific actions to be taken where knowledge of more than just the immediate neuron's state must be known
pub fn set_output_values(&mut self)
[src]
Because the output neurons might need to be seen togehter, this must be called to set their values before finishing the feed forward function
pub fn update_traces(&mut self)
[src]
take a snapshot of the neuron's values at this time step if trace is enabled
Trait Implementations
impl Clone for Dense
[src]
impl Debug for Dense
[src]
impl<'de> Deserialize<'de> for Dense
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Dense
[src]
Simple override of display for neat to debug a little cleaner
impl Genome<Dense, NeatEnvironment> for Dense where
Dense: Layer,
[src]
Dense: Layer,
fn crossover(
child: &Dense,
parent_two: &Dense,
env: Arc<RwLock<NeatEnvironment>>,
crossover_rate: f32
) -> Option<Dense>
[src]
child: &Dense,
parent_two: &Dense,
env: Arc<RwLock<NeatEnvironment>>,
crossover_rate: f32
) -> Option<Dense>
fn distance(one: &Dense, two: &Dense, _: Arc<RwLock<NeatEnvironment>>) -> f32
[src]
fn base(_: &mut E) -> T where
T: Sized,
[src]
T: Sized,
impl Layer for Dense
[src]
fn forward(&mut self, data: &Vec<f32>) -> Option<Vec<f32>>
[src]
Feed a vec of inputs through the network, will panic! if the shapes of the values do not match or if something goes wrong within the feed forward process.
fn backward(&mut self, error: &Vec<f32>, learning_rate: f32) -> Option<Vec<f32>>
[src]
Backpropagation algorithm, transfer the error through the network and change the weights of the edges accordingly, this is pretty straightforward due to the design of the neat graph
fn reset(&mut self)
[src]
fn add_tracer(&mut self)
[src]
add a tracer to the layer to keep track of historical meta data
fn remove_tracer(&mut self)
[src]
fn as_ref_any(&self) -> &dyn Any where
Self: Sized + 'static,
[src]
Self: Sized + 'static,
fn as_mut_any(&mut self) -> &mut dyn Any where
Self: Sized + 'static,
[src]
Self: Sized + 'static,
fn shape(&self) -> (usize, usize)
[src]
impl PartialEq<Dense> for Dense
[src]
Implement partialeq for neat because if neat itself is to be used as a problem, it must be able to compare one to another
impl Serialize for Dense
[src]
Auto Trait Implementations
impl RefUnwindSafe for Dense
impl Send for Dense
impl Sync for Dense
impl Unpin for Dense
impl UnwindSafe for Dense
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<L> LayerClone for L where
L: 'static + Layer + Clone,
[src]
L: 'static + Layer + Clone,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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.
pub 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>,