Skip to content

Retystety/NeuralNetworks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 

Repository files navigation

Description

This plugin aims to provide an easy and flexible artificial neural networks framework.

Elements

-NeuralNet
-BaseNeuralNet
-NeuralNetMethods
-ForEachConnectionHandle

Documentacion

Do not call functions with “_” prefix directly.

NeuralNet

Inherits:

BaseNeuralNet < Reference

Description

Ready to use net with sigmoidal activation function f(x)=x/sqrt(1+x^2).

BaseNeuralNet

Inherits:

Reference

Description

Semi “abstract” class. Base for all neural networks.

Properties

Array net_structure - Array of ints describing each layer size. setget will return or pass duplicate

Array data - Array of arrays of floats, value of each connection (weight). setget will return or pass duplicate

Array neuron_dat - Array of arrays of floats, last neuron value or neuron error value, depends on whether was .calculate() or .back_propagation() method called last, setget will return or pass duplicate

Methods

BaseNeuralNet new(Array net_structure) - Creates a new object sets self.net_structure to duplicate of net_structure. Sets value of each connection to 0.

void add_random(float min_val, float max_val) - Adds random value to each connection.

void multiply_random(float min_val, float max_val) - Multiplies each connection by random value.

Array calculate(Array input) - Runs net. Returns Array of floats of size of last self.net_structure cell value.

void back_propagation(Array error, float lerning_factor) - Propagates error and correct connections.

float _actiavte(float e) - “Virtual” function. Default return value is always zero. Override it with activation function of your choice.

float _derivative(float x) - “Virtual” function. Derivative of activation function in point x. No need to overwrite it if you don't plan to use back propagation.

void for_each_connection(ForEachConnectionHandle handle) - Calls handle._for_each_connection(int x, int y, int z, BaseNeuralNet net) for each connection where x and y (x is closer to or is in the output layer) are neurons that it is connecting. Z is the first self.data index and index is second. In another words connection is data[z][index]. Index is calculated from this formula i = x*(net_structure[z]+1)+y. Net is self.

NeuralNetMethods

Inherits:

Node

Description

Singleton container for methods that would cause cyclic dependency errors if placed as member functions.

Methods

String print_net(BaseNeuralNet net) - converts net to JSON string.

BaseNeuralNet parse_net(String json) - converts String back to BaseNeuralNet.

ForEachConnectionHandle

Inherits:

Reference

Description

“Abstract” class. Provides way to change connections (weights) in a custom way.

Methods

void _for_each_connection(int x, int y, int z, int index, BaseNeuralNet net)

How to

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published