-
Notifications
You must be signed in to change notification settings - Fork 1
License
Retystety/NeuralNetworks
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
-BaseNeuralNet
-NeuralNetMethods
-ForEachConnectionHandle Do not call functions with “_” prefix directly. BaseNeuralNet < Reference Ready to use net with sigmoidal activation function f(x)=x/sqrt(1+x^2). Reference Semi “abstract” class. Base for all neural networks. 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
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.
Node Singleton container for methods that would cause cyclic dependency errors if placed as member functions. String print_net(BaseNeuralNet net) - converts net to JSON string.
BaseNeuralNet parse_net(String json) - converts String back to BaseNeuralNet.
Reference “Abstract” class. Provides way to change connections (weights) in a custom way. void _for_each_connection(int x, int y, int z, int index, BaseNeuralNet net)
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published