# [−][src]Type Definition radiate_matrix_tree::matrix_tree::evtree::Evtree

type Evtree = Tree<NetNode>;

A tree struct to encapsulate a bidirectional binary tree.AsMut

Each node within the tree has three pointers to its parent, left, and right child. They also have a randomly generated neural network and an output option (classification).

This struct holds the root of the tree. The tree also contains a size which represents the number of nodes in the tree, an input size which is the size of the input vector (1D), and is used to generate nodes alone with the output options which is an owned vec of i32s represnting different outputs of the classification.

## Implementations

`impl Evtree`

[src]

implement the tree

`pub fn gut_random_node(&mut self, r: &mut ThreadRng)`

[src]

Gut a random node from the tree. Get a random index from the tree then give that node a new neural network.

`pub fn edit_random_node_networks(`

&mut self,

weight_mutate: f32,

weight_transform: f32,

layer_mutate: f32

)

[src]

&mut self,

weight_mutate: f32,

weight_transform: f32,

layer_mutate: f32

)

Go through each of the nodes in the tree and randomly mutate the weights and biases within the network

`pub fn asymmetry(&self) -> f32`

[src]

Compute the asymmetry for a single tree by adding the height times the neural network weight sum of the tree and putting it through the sine function to compress the number between (-1, 1)

`pub fn propagate(&self, inputs: Matrix<f32>) -> u8`

[src]

## Trait Implementations

`impl Genome<Tree<NetNode>, TreeEnvionment> for Evtree`

[src]

`fn crossover(`

one: &Evtree,

two: &Evtree,

settings: &Arc<RwLock<TreeEnvionment>>,

crossover_rate: f32

) -> Option<Evtree>

[src]

one: &Evtree,

two: &Evtree,

settings: &Arc<RwLock<TreeEnvionment>>,

crossover_rate: f32

) -> Option<Evtree>

one should be the more fit Evtree and two should be the less fit Evtree. This function should attemp to produce a Evtree which is no higher than the specified max height of a Evtree.

`fn base(settings: &mut TreeEnvionment) -> Evtree`

[src]

Implement the base trait for the tree This provides a generic way to get a base tree for starting the evolution process Get the base tree type and return a randomly generated base tree created through the tree settings given to it at its new() call

`fn distance(`

one: &Evtree,

two: &Evtree,

_settings: &Arc<RwLock<TreeEnvionment>>

) -> f32

[src]

one: &Evtree,

two: &Evtree,

_settings: &Arc<RwLock<TreeEnvionment>>

) -> f32

takes in a Rc<RefCell<Self in order to make it simpler for the Generation to throw types it already has inside the function by simplmy cloing them. This function will drop the references to the Self traits at the end of this function's scope