/* N E U R A L N E M R E @ E */
#ifndef _NEURO_H
#define _NEURO_H
/* Kod simulacije neuralne mre`e koriste}i fuzzy varijable, sve te`ine ~vora predstavljaju fuzzy varijablu, svaka te`ina je zapravo klasa, a pointer *set ukazuje na ~vor s kojega se uzima ulaz. Operator *actual svakog ~vora (fuzzy_object) pokazuje na te`inu preko koje je stigla najve}a pobuda. Izlaz iz ~vora je pohranjen u varijabli notes. */
#include
#include
#include
#include
#include
#include
#include "fuzzy.h"
#ifdef __cplusplus
extern "C"{
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef BIAS
#define BIAS 1
#endif
/* declaration of (pointer on) fuzzy object that presents BIAS */
extern struct fuzzy_object *BIAS_fuzzy_object;
/* defining of treasurehold level, over variable treasureholdadd, as common/extern. It means if different neurons use different treasurehold level it must be reset each time before calling a function (using treeasureholdadd variable) for each neuron. Function for setting treasurehold level (later in library) is " void treasurehold_set(float new_value)". */
extern float treasureholdadd;
/* defining of exponent in function node_output (and node_output_derivation) for the case 'e' as common/extern. It means if different neurons use different exponent in function node_output (and node_output_derivation) for the case 'e' it must be reset each time before calling a function for each neuron. Function for setting the exponent (node_output(_derivation) case 'e') (later in library) is " void node_output_e_exponent_set(float new_value)". */
extern float node_output_e_exponent;
/* definiranje strukture koja pohranjuje koeficijente ucenja */
typedef struct koef_learn {
float winner_T, winner_F, node_T, node_F;
} koef_learn;
/* definition of the structure, used inside genetic structures, that stores dimensionality of the input */
struct input_size{
int number_of_input_dimensions; /* presents input dimensionality */
int *dimensions; /* presents input size in each dimension and has number_of_input_dimenzions elements. For example for 2D input number_of_input_dimenzions=2, *(dimensions+0)=horisontal_dimension, and *(dimensions+1)=vertical_dimension. */
}input_size;
/* structure subsystem_tree stores informations of tree structure of its related neural_subsystem */
typedef struct subsystem_tree{
int identification_number; /* each subsystem_tree has its own identification number that must be the same as of the gene related to the same neural_subsystem and must be inside the range [1, number of subsystems inside the system]. Presents the subsystem's order number inside the neural_system */
int number_of_populations; /* number of neuron_populations inside the neural_subsystem */
struct fuzzy_set *input; /* pointer on input fuzzy_set. If particular population input are different (not described with the selected function for "preparing_input") then it could be set input=0, while all neuron populations should point somewhere inside leaf structure, or inputs for those pointing on (input=0) must be later defined */
int number_of_leaf_pairs, *leaf_pairs[2]; /* leaf_pairs, consists number_of_leaf_pairs number of pairs of integers [neuron_population identification_number, its leaf population identification_number]. Each neuron_population should be provided with an identification number, presenting its order number inside the neural subsystem, under the same criterion the subsystem tree is provided with its one. Neuron population identification_number must be the same as of related nucleotide_base. leaf population identification_number=0 means the neuron_population receives input from the input fuzzy_set as 0 is identification number of the input fuzzy_set. */
/* identification numbers for neuron populations are later used to define subsystem's firing_list. Since identification numbers must be given from roots toward leaves firing_list points on populations in reverse order (from the one with the highest identification number to one with the identification_number=0) of their identification numbers. firing_list may be rearranged manualy or with an additional function! */
int number_of_leaf_in_other_subsystems, *leaf_in_other_subsystems[3]; /* leaf_in_other_subsystems consists number_of_leaf_in_other_subsystems triplets of integers [neuron_population, its leaf's neural_subsystem's identification_number, leaf's identification_number inside its neural_subsystem] */
} subsystem_tree;
/* definiranje struktura neuralne mre`e pomo}u fuzzy skupa i njegovih klasa - N E U R A L S T R U C T U R E S */
typedef struct Level{
int Level_number, number_of_nodes; /* layer's number in the neuron architecture and number of nodes it consists of */
struct Level *ahead, *follow; /* pointers on lower and higher layer */
struct fuzzy_object* *nodes; /* vector of pointers on nodes in the layer */
} Level;
typedef struct neuron{
char *name; /* pointer on vector representing neuron's name */
int number_of_Levels; /* number of layers inside the neuron */
struct Level *first_Level, *actual_Level, *last_Level; /* pointers on the first layer, layer in process (or can store some other information points on layer) and the last layer */
struct fuzzy_object *output; /* pointer on output presented as fuzzy object */
} neuron, *p_neuron;
typedef struct neuron_population{
struct nucleotide_base *code; /* pointer on the nucleotide_base used to create the population */
int number_of_neurones; /* number of neurones in the population */
struct neuron **neurones; /* vector of pointers on neurones consisted in the population */
struct neural_subsystem *subsystem; /* pointer on the neural subsystem the neuron population belongs to */
struct learning_algorithm *learning_algorithm; /* pointer on the structure learning_algorithm having information about all neurones' inside the population learning algorithms */
int number_of_root_populations, number_of_leaf_populations; /* number of neuron populations proceeding output to and receiving input from */
struct neuron_population **root, **leaf; /* pointer on neuron population toward root and list of pointers on neuron populations receiving input from. It's suggested first, while creating population, to create fuzzy_set structure that points on all objects in fuzzy sets on its leaves populations' output, or if there no population toward leaves, on requested set of fuzzy objects in the (sub)system input. Than input fuzzy sets of its neurones are created to point on requested set of fuzzy objects, while pointers are red from population's input fuzzy set (neuron_population.input*). */
struct fuzzy_set *input, *output; /* pointer on fuzzy sets presenting input into and output from the population (enables having on input and output more than one neuron output) */
} neuron_population;
typedef struct neural_subsystem{
struct gene *code; /* pointer on the gene used to create the subsystem */
struct neural_system *system; /* pointer on the neural system the neural subsystem belongs to */
int number_of_populations; /* number of neuron populations the subsystem consists of, equal number of nucleotide bases in the gene */
int number_of_roots_populations, number_of_leaves_populations; /* number of neuron populations presenting root and leaves of its tree structure */
struct neuron_population **roots, **leaves; /* pointer on lists of neuron populations presenting root and leaves of its tree structure */
int number_of_root_subsystems, number_of_leaf_subsystems; /* number of neural subsystems toward the root and toward the leaves of the neural system tree structure */
struct neural_subsystem **root, **leaf; /* pointer on neural subsystem toward root and list of pointers on neural subsystems receiving input from. It's suggested first, while creating subsystem, to create fuzzy_set structure that points on all objects in fuzzy sets on its leaves subsystems' output, or if there no population toward leaves, on requested set of fuzzy objects in the system input fuzzy set. Than input fuzzy sets of its populations are created to point on requested set of fuzzy objects, while pointers are red from subsystem's input fuzzy set (neural_subsystem.input*). */
struct fuzzy_set *input, *output; /* pointer on fuzzy sets presenting input into and output from the subsystem */
struct neuron_population **firing_list; /* list of pointers on all populations inside the subsystem organised in order (from the first to the last element on the list) they should be fired. Order of backpropagation learning is just opposite */
int number_of_shared_inputs; /* number of inputs (membership values) shared by populations inside the subsystem. Must be preset on <0 (usually -1), since 0 means no overlaping inputs, and >0 is the number of overlaping inputs. */
float **shared_inputs; /* pointer on inputs (membership values) shared by populations inside the subsystem. It is filled during the creation of the subsystem ('s populations) learning algorithms. */
enum Bool *output_is_shared; /* vector of Boolean values corresponding to populations inside the firing_list vector. Value T means its output is shared between some other populations inside the subsystem. It is filled (and formed) during the creation of the subsystem ('s populations) learning algorithms. */
} neural_subsystem;
typedef struct neural_system{
struct chromosome *code; /* pointer on the chromosome used to create the system */
int number_of_subsystems; /* number of neural subsystems the system consists of, equal number of genes in the chromosome */
int number_of_roots_subsystems, number_of_leaves_subsystems; /* number of subsystems presenting root and leaves of its tree structure */
struct neural_subsystem **roots, **leaves; /* pointer on lists of subsystems presenting root and leaves of its tree structure */
struct fuzzy_set *input, *output; /* pointer on fuzzy sets presenting input into and output from the system */
struct neural_subsystem **firing_list; /* list of pointers on all subsystems inside the system organised in order (from the first to the last element on the list) they should be fired. Order of backpropagation learning is just opposite */
int number_of_shared_inputs; /* number of inputs (membership values) shared by subsystems inside the system. Must be preset on <0 (usually -1), since 0 means no overlaping inputs, and >0 is the number of overlaping inputs. */
float **shared_inputs; /* pointer on inputs (membership values) shared by subsystems inside the system. It is filled during the creation of the ystem ('s subsystems' populations) learning algorithms. */
enum Bool *output_is_shared; /* vector of Boolean values corresponding to subsystems inside the firing_list vector. Value T means its output is shared between some other subsystems inside the system. It is filled (and formed) during the creation of the system ('s subsystems' populations) learning algorithms. */
} neural_system;
typedef struct neuron_type_descriptor{
char *name; /* pointer to list of characters (no space or interpuctions, instead "_" could be used) meaning name of the neuron type, ending with space character */
int number_of_Levels, inputs_per_first_Level_node, *nodes_per_Level; /* number of layers in neuron, number of inputs into neuron and list describing number of nodes from the first layer through the output layer (also presenting number of neuron outputs) */
enum Bool recurrence; /* flag if neuron has recurrent connections (T=1) (F=0 means no recurrent connections) */
int number_of_recurrent_connected_layers, *source, *destination; /* number_of_recurrent_connected_layers means how many layers have recurrent connection, *source is pointer on list of layers, in order, that input (proceed their output into recurrent connection) recurrent connection, *destination is pointer on list of layers feeling recurrent connection as input and each element of the list must have its pair in the list belongs to source */
int number_of_functions_for_creating_neuron; /* number of functions that could be used for creating neuron */
struct neuron* (**create_neuron)(struct fuzzy_set*); /* pointer on array of pointers on functions for creating the neuron type */
struct neuron_population* (*create_neuron_population)(struct nucleotide_base*,int, struct fuzzy_set*, int, int, int, struct fuzzy_set** (*)(struct neuron_population*, int, int, int)); /* pointer on the function for creating neuron population from the given data in nucleotide code and given function for preparing input from neuron population's one into its neurones', and usually given number of neurones in population, input fuzzy set, window radius for neurones inside the population (means window radius for their inputs), horisontal and vertical resolution of input picture */
struct neuron_population* (*create_neuron_population_from_nucleotide_base)(struct nucleotide_base*, struct fuzzy_set*); /* pointer onto the function that creates (required type of) neuron population from the data stored inside the nucleotide base and input fuzzy set only */
struct neuron_population* (*create_neuron_population_from_nucleotide_base_without_input)(struct nucleotide_base* ); /* pointer onto the function that creates neuron population without having input fuzzy set. If the finction doesn't exist the value must be set zero (0). Enables recurrent connected populations by letting input fuzzy set being created after the population is created. Should be used in combination with "adding_input_to_neuron_population" */
void (*adding_input_to_neuron_population)(struct neuron_population* , struct fuzzy_set* ); /* creates input fuzzy set inside already existing neuron population. Should be use in combination with "create_neuron_population_from_nucleotide_base_without_input" */
struct fuzzy_set** (*prepare_input)(struct neuron_population*, int, int, int); /* pointer on the function preparing each neuron inside neuron population input by returning array of pointers on fuzzy sets each fuzzy set for its neuron and in the same order as neurones inside the neuron population */
int number_linear_output_functions; /* number of available functions for calculation of (pre-non-linearised) output for each node of that type of neuron */
float (**node_linear_output)(struct fuzzy_object*, int); /* pointer on list of pointers on functions for calculation of (pre-non-linearised) output for each node of the neuron, argument is each node of the neuron by itself and integer usually presents Level (layer) in process number */
int number_of_node_output_functions; /* number of available functions for calculation of non-linear output (and derivation) for that type of neuron */
float (**node_output)(float ), (**node_output_derivation)(float ); /* the first is pointer on list of pointers on functions for calculation of (non-linear) node output with linear output as argument, while the second points on list of pointers on functions for derivation of non-linear function used for output non-linearisation (the first function) with argument named with association on backpropagation algorithm */
int number_of_firing_functions; /* number of available functions for firing that type of neuron */
void (**firing_neuron)(struct neuron*, struct nucleotide_base*); /* pointer on list of pointers on functions for firing (processing from input through its layers to output) neuron */
int number_of_learning_algorithms; /* number of available learning algorithms for that type of neuron */
struct neuron_learning_algorithm* (**create_learning_algorithm)(struct nucleotide_base*, struct neuron*, float); /* pointer on list of pointers on functions for generating available learning algorithms for that type of neuron */
} neuron_type_descriptor;
typedef struct set_of_neuron_types{
int number_of_neuron_types; /* number of neuron type descriptors in the set */
struct neuron_type_descriptor **descriptors; /* pointer on list of pointers on descriptors. To add new type of neuron its descriptor should be written and pointer on it added to list, while number_of_neuron_types ought to be incremented for 1. */
} set_of_neuron_types;
/* Definition of the structures used to emulate ART2 network as described in G.A. Carpenter and S. Grossberg, ART 2: self-organization of stable category recognition codes for analog input patterns, in G.A. Carpenter and S. Grossberg, Pattern recognition by self-organizing neural networks, The MIT Press, London, 1991, pp. 397-423 */
typedef struct ART2{
float ro, a, b, c, d, theta; /* a, b, c, d are constants as well as theta=threshold, and ro=vigilance */
float (*fx)(float , float ); /* (*fx)() is pointer on the function f(x) used for calculation of v inside F1 */
int N, M; /* is number of inputs plus the number of output classes, while M is the number of inputs only */
struct ART2_F1 **F1; /* **F1=*F1[M] is vector of pointers on each of ART2_F1 classes */
struct ART2_F2 **F2, *F2Max; /* **F2=*F2[N-M] is vector of pointers on each of ART2_F2 classes, while *F2Max=TJ is the pointer on the chosen class (with the highest Tj) */
struct fuzzy_set *input; /* pointer on input fuzzy set (with M characteristics) */
struct fuzzy_object *output; /* pointer on output fuzzy object (with N-M characteristics) */
} ART2;
typedef struct ART2_F1{
float *input, w, x, v, u, p, q, r; /* input is pointer on the membership value of related input fuzzy set characteristic, while other variables are members of ART2_F1 class */
struct connection **top_down; /* **top_down=*top_down[N-M] is the vector of pointers on weights of top-down connections for the selected ART2_F1 class */
} ART2_F1;
typedef struct ART2_F2{
int number; /* number is order number of the ART2_F2 class and is between 0 and N-M-1; helps us when approaching using F2Max */
float Tj; /* Tj is output value (activity level) of the ART2_F2 class */
enum Bool reset; /* reset='T' if the ART2_F2 class has been reset in current trial, otherwise reset='F' */
struct connection **bottom_up; /* **bottom_up=*bottom-up[M] is the vector of pointers weights of bottom-up connections for the selected ART2_F2 class */
} ART2_F2;
typedef struct connection{
float *input, weight; /* *input is pointer onto the selected input value for the connection, while weight is the weight of connection */
} connection;
/* G E N E T I C S T R U C T U R E S */
typedef struct nucleotide_base{
int identification_number; /* identifies nucleotide base inside the gene (population's order number) and must be equal to identification number of the population, the nucleotide base describes/corresponds to, inside the gene's related subsystem tree */
struct input_size *handling_input; /* pointer on the structure that stores information about input dimensionality */
enum Bool local_receptive_fields; /* T if neurones inside the population have local receptive fields (input through window), while F if each neurone inside the population cover whole input fuzzy set */
int overlaping_in_each_dimension, window_side_lenght; /* Of interest only if local_receptive_fields=T; overlaping_in_each_dimension presents number of fuzzy objects covered by both neighbouring neurones, window_side_lenght presents lenght of one side of local receptive field while all side (in all dimensions) are expected to have the same lenght (means the same number of fuzzy objects, but not required to have the same number of characteristics) */
struct neuron_type_descriptor *type; /* pointer on descriptor of type of neurones to be used; number of neurones is decided while creating neuron_population due of number of inputs and outputs and chosen neuron type */
struct neuron* (*create_neuron)(); /* pointer on the function to be used for creating the neuron type */
float (*node_linear_output)(struct fuzzy_object *node, int); /* pointer on chosen function for calculation of (pre-non-linearised) output for each node of the neuron, argument is each node of the neuron by itself and integer usually presents Level (layer) in process number */
float (*node_output)(float linear_output), (*node_output_derivation)(float expected_output); /* the first is pointer on chosen function for calculation of (non-linear) node output with linear output as argument, while the second points on chosen function for derivation of non-linear function used for output non-linearisation (the first function) with argument named with association on backpropagation algorithm */
void (*firing_neuron)(); /* pointer on chosen function for firing (processing from input through its layers to output) neuron */
struct neuron_learning_algorithm* (*create_learning_algorithm)(struct nucleotide_base*, struct neuron*, float); /* pointer on the function for generating chosen learning algorithm for all particular neurons inside the neuron population*/
struct learning_algorithm* (*create_population_learning_algorithm)(struct nucleotide_base*, struct neuron_population*, float); /* pointer on the function for generating chosen learning algorithm for the neuron population as whole */
struct nucleotide_base *ahead, *follow; /* pointer on previous and following nucleotide_base in the chain - gene */
} nucleotide_base;
typedef struct gene{
int identification_number; /* must be equal with identification number of the related subsystem tree (subsystem's qrder number) */
struct nucleotide_base *gene_begin, *gene_end, *actual_nucleotide_base; /* pointers on begin and end of gene for the subsystem as well as on chosen nucleotide_base */
int number_of_nucleotide_bases; /* number of nucleotide_bases in the gene */
struct gene *ahead, *follow; /* pointer on previous and following gene in the chain - chromosome */
} gene;
typedef struct chromosome{
int number_of_genes; /* number of genes in chromosome */
struct gene **genes; /* pointer on genes, organised as a vector, that form chromosome */
struct gene *chromosome_begin, *chromosome_end, *actual_gene; /* pointers on begin and end of chromosome for the system as well as on chosen gene */
} chromosome;
/* structures for inforcing learning algorithm */
typedef struct learning_algorithm {
char *name, *comment;
struct neuron_population *population;
struct neuron_learning_algorithm **neuron_learning; /* vector of pointers onto structures neuron_learning_algorithm one per each neuron in the population. The number of neurones in the population is stored inside structure neuron_population. */
struct learning_algorithm* (*create)(struct nucleotide_base*, struct neuron_population*, float); /* pointer onto function for creating structure learning_algorithm */
void (*fire)(struct learning_algorithm*); /* pointer onto function for firing structure learning_algorithm */
void (*weights_correction)(struct learning_algorithm*); /* pointer onto function for weights updating */
void (*reset_weights_correction)(struct learning_algorithm*); /* pointer onto function for reset weights updates (NOT weights inside the neurones BUT calculated corrections for each weight (NOT WEIGHT ITSELF) is reseted on 0.0 */
void (*deleting)(struct learning_algorithm*); /* pointer onto function for deleting structure learning_algorithm */
float learning_rate;
int number_of_shared_inputs; /* number of inputs (membership values) shared by neurones inside the population the learning algorithm corresponds to. Must be preset on <0 (usually -1), since 0 means no overlaping inputs, and >0 is the number of overlaping inputs. */
float **shared_inputs; /* pointer on inputs (membership values) shared by neurones inside the population the learning algorithm corresponds to. It is filled during the creation of the learning algorithm. */
enum Bool *output_is_shared; /* vector of Boolean values corresponding to neurones inside the neurones vector of the population the learning algorithm corresponds to. Value T means its output is shared between some other neurones inside the population. It is filled (and formed) during the creation of the learning algorithm. */
} learning_algorithm;
typedef struct neuron_learning_algorithm {
char *name, *comment;
struct neuron *nn;
struct nucleotide_base *code;
struct characteristic ***weight_pointer;
float learning_rate, **weight_correction, **neuron_copy; /* neuron_copy is proposed for storing all node output values at the time for use with (1 step beckward) recursive neurons (storing node outputs at time=t to be use for weight correction at time t+1) */
int *number_of_weights_per_Level;
struct neuron_learning_algorithm* (*create)(struct nucleotide_base*, struct neuron*, float); /* pointer onto function for creating structure neuron_learning_algorithm */
void (*fire)(struct neuron_learning_algorithm*); /* pointer onto function for firing structure neuron_learning_algorithm */
void (*weights_correction)(struct neuron_learning_algorithm*); /* pointer onto function for weights updating */
void (*reset_weights_correction)(struct neuron_learning_algorithm*); /* pointer onto function for reset weights updates (NOT weights inside the neuron BUT calculated corrections for each weight (NOT WEIGHT ITSELF) is reseted on 0.0 */
void (*deleting)(struct neuron_learning_algorithm*); /* pointer onto function for deleting structure neuron_learning_algorithm */
} neuron_learning_algorithm;
/* structures for keeping record of the most important neuron output (the most important) path */
typedef struct backwinner {
struct fuzzy_object*winner;
struct characteristic *weight;
struct backwinner *ahead, *follow;
} backwinner;
typedef struct p_backwinner{ backwinner *first, *last; } p_backwinner;
/* structure fuzzy_state_neural_network is proposed dealing with neural networks based on fuzzy-state model */
typedef struct fuzzy_state_neural_network{
neuron *network;
int number_of_states, characteristics_per_state;
struct fuzzy_object **states;
} fuzzy_state_neural_network;
/* structure BP_correction_memory stores informations necessary for BP algorithm as well as weight corrections. "*network" points on struct neuron BP is being applied on; "***weight_pointer" points on vectors (pointers pointing on continuos area), separate for each Level (in _input2node version first Level is excluded) whose elements are pointers on weights of (all) nodes in the Level; "**weight_correction" is built identicly as "***weight_pointer" while elements of vectors are corrections for weights pointed by element on the same place in "***weight_pointer" vectors; "*number_of_weights_per_Level" is vector (points on continuos space reserved for) whose elements are numbers of weights in particular Level (except first Level in case _input2node version) in the same order as Levels; "learning_rate" is constant of learning according BP algorithm. */
typedef struct BP_correction_memory{
struct neuron *network;
struct characteristic ***weight_pointer;
float learning_rate, **weight_correction;
int *number_of_weights_per_Level;
} BP_correction_memory;
/* "T"* MA"T"(int number_of_elements) where "T" means type and can be 'KL'=koef_learn, 'Le'=Level, 'N'=neuron, 'BW'=backwinner, 'PBW'=p_backwinner, 'FSNN'=fuzzy_state_neural_network, 'BW'=backwinner or any of previous letters with (one or more) prefix 'p' =pointer on */
/* Pointer to reserved (allocated) space is returned! */
/* It deals with memory allocation (testmalloc) request for number_of_elements locations of type "T". In the case there is no available memory request is being repeated up to 101 times and if there is still lack of testfree memory unsucessfull end of process is caused (exit(1)). */
koef_learn* MAKL(long int number_of_elements);
Level* MALe(long int number_of_elements);
neuron* MAN(long int number_of_elements);
backwinner* MABW(long int number_of_elements);
p_backwinner* MAPBW(long int number_of_elements);
fuzzy_state_neural_network* MAFSNN(long int number_of_elements);
BP_correction_memory* MABPCM(long int number_of_elements);
neuron_population* MANP(long int number_of_elements);
neural_subsystem* MANSS(long int number_of_elements);
neural_system* MANS(long int number_of_elements);
neuron_type_descriptor* MANTD(long int number_of_elements);
set_of_neuron_types* MASNT(long int number_of_elements);
nucleotide_base* MANB(long int number_of_elements);
gene* MAG(long int number_of_elements);
chromosome* MACh(long int number_of_elements);
learning_algorithm* MALA(long int number_of_elements);
neuron_learning_algorithm* MANLA(long int number_of_elements);
ART2* MAART2(long int number_of_elements);
ART2_F1* MAART2_F1(long int number_of_elements);
ART2_F2* MAART2_F2(long int number_of_elements);
connection* MACn(long int number_of_elements);
struct input_size* MAIS(long int number_of_elements);
struct subsystem_tree* MASST(long int number_of_elements);
koef_learn** MApKL(long int number_of_elements);
Level** MApLe(long int number_of_elements);
neuron** MApN(long int number_of_elements);
backwinner** MApBW(long int number_of_elements);
p_backwinner** MApPBW(long int number_of_elements);
fuzzy_state_neural_network** MApFSNN(long int number_of_elements);
BP_correction_memory** MApBPCM(long int number_of_elements);
neuron_population** MApNP(long int number_of_elements);
neural_subsystem** MApNSS(long int number_of_elements);
neural_system** MApNS(long int number_of_elements);
neuron_type_descriptor** MApNTD(long int number_of_elements);
set_of_neuron_types** MApSNT(long int number_of_elements);
nucleotide_base** MApNB(long int number_of_elements);
gene** MApG(long int number_of_elements);
chromosome** MApCh(long int number_of_elements);
learning_algorithm** MApLA(long int number_of_elements);
neuron_learning_algorithm** MApNLA(long int number_of_elements);
ART2** MApART2(long int number_of_elements);
ART2_F1** MApART2_F1(long int number_of_elements);
ART2_F2** MApART2_F2(long int number_of_elements);
connection** MApCn(long int number_of_elements);
struct input_size** MApIS(long int number_of_elements);
struct subsystem_tree** MApSST(long int number_of_elements);
koef_learn*** MAppKL(long int number_of_elements);
Level*** MAppLe(long int number_of_elements);
neuron*** MAppN(long int number_of_elements);
backwinner*** MAppBW(long int number_of_elements);
p_backwinner*** MAppPBW(long int number_of_elements);
fuzzy_state_neural_network*** MAppFSNN(long int number_of_elements);
BP_correction_memory*** MAppBPCM(long int number_of_elements);
neuron_population*** MAppNP(long int number_of_elements);
neural_subsystem*** MAppNSS(long int number_of_elements);
neural_system*** MAppNS(long int number_of_elements);
neuron_type_descriptor*** MAppNTD(long int number_of_elements);
set_of_neuron_types*** MAppSNT(long int number_of_elements);
nucleotide_base*** MAppNB(long int number_of_elements);
gene*** MAppG(long int number_of_elements);
chromosome*** MAppCh(long int number_of_elements);
learning_algorithm*** MAppLA(long int number_of_elements);
neuron_learning_algorithm*** MAppNLA(long int number_of_elements);
ART2*** MAppART2(long int number_of_elements);
ART2_F1*** MAppART2_F1(long int number_of_elements);
ART2_F2*** MAppART2_F2(long int number_of_elements);
connection*** MAppCn(long int number_of_elements);
struct input_size*** MAppIS(long int number_of_elements);
struct subsystem_tree*** MAppSST(long int number_of_elements);
koef_learn**** MApppKL(long int number_of_elements);
Level**** MApppLe(long int number_of_elements);
neuron**** MApppN(long int number_of_elements);
backwinner**** MApppBW(long int number_of_elements);
p_backwinner**** MApppPBW(long int number_of_elements);
fuzzy_state_neural_network**** MApppFSNN(long int number_of_elements);
BP_correction_memory**** MApppBPCM(long int number_of_elements);
neuron_population**** MApppNP(long int number_of_elements);
neural_subsystem**** MApppNSS(long int number_of_elements);
neural_system**** MApppNS(long int number_of_elements);
neuron_type_descriptor**** MApppNTD(long int number_of_elements);
set_of_neuron_types**** MApppSNT(long int number_of_elements);
nucleotide_base**** MApppNB(long int number_of_elements);
gene**** MApppG(long int number_of_elements);
chromosome**** MApppCh(long int number_of_elements);
learning_algorithm**** MApppLA(long int number_of_elements);
neuron_learning_algorithm**** MApppNLA(long int number_of_elements);
ART2**** MApppART2(long int number_of_elements);
ART2_F1**** MApppART2_F1(long int number_of_elements);
ART2_F2**** MApppART2_F2(long int number_of_elements);
connection**** MApppCn(long int number_of_elements);
struct input_size**** MApppIS(long int number_of_elements);
struct subsystem_tree**** MApppSST(long int number_of_elements);
/* *fill_node() puni ~vor inicijalnim te`inama i pointerima na prethodni sloj (odnosno izvoru pobude) pomo}u funkcije *fill_weight() koja puni te`ine i pointere */
struct characteristic *fill_weight(struct characteristic *link, float *weights);
struct fuzzy_object *fill_node(int nmbr_weights, float *weights);
/* *fill_Level() puni svaki sloj s te`inama iz weights vektora */
struct Level *fill_Level(int Level_Nr, int nmbr_of_weights, int nmbr_of_nodes, float *weights, Level *ahead);
/* net_output() pohranjuje izlaz iz mre`e u fuzzy skup s zadanim imenom i imenima klasa, a pointer *set svake klase ukazuje na njen ulaz; tako|er upisuje pointer na izlaz u neuron.output */
struct fuzzy_object *net_output(neuron *net_head, char *names);
/* fill_net() upravlja generiranjem mre`e na osnovu zadanih: *name, *nmbr_of_nodes, nmbr_of_net_input, *weights, *input */
struct neuron *fill_net(char *name, int nmbr_of_Levels, int *nmbr_of_nodes, int nmbr_of_net_input, char* output_names, float *weights, float *input);
/* *fill_net_auto(); sama generira: *number_of_nodes, *weights, *output_names */
struct neuron *fill_net_auto( char *name, int number_of_Levels, int nmbr_of_net_input, int number_of_net_output, float *input);
/* *fill_net_auto_defLev(); je kao *fill_net_auto(); samo sto korisnik sljedno definira broj cvorova po slojevima, osim prvog i posljednjeg sloja */
struct neuron *fill_net_auto_defLev( char *name, int number_of_Levels, int nmbr_of_net_input, int number_of_net_output, float *input, int *nr_of_nodes);
/* *fill_Level1_overlaping(); ista je kao *fill_Level();, samo sto je ulaz u cvor pripadni pixel i njegova overlap okolina, te samo puni cvorove prvog sloja */
struct Level *fill_Level1_overlaping(int number_of_nodes, float *input, int overlap, int dimension1, int dimension2);
/* fill_net_overlaping(); ista je kao *fill_net();, samo sto je ulaz u cvor pripadni pixel i njegova overlap okolina */
struct neuron *fill_net_overlaping(char *name, int nmbr_of_Levels, int *nmbr_of_nodes, int nmbr_of_net_input, char* output_names, float *weights, float *input, int overlap, int dimension1, int dimension2);
/* *fill_net_auto_overlaping(); ista je kao *fill_net_auto();, samo sto je ulaz u cvor pripadni pixel i njegova overlap okolina */
struct neuron *fill_net_auto_overlaping( char *name, int number_of_Levels, int number_of_net_output, float *input, int overlap, int dimension1, int dimension2);
/* *fill_net_auto_defLev_overlaping(); ista je kao *fill_net_auto_defLev();, samo sto je ulaz u cvor pripadni pixel i njegova overlap okolina */
struct neuron *fill_net_auto_defLev_overlaping( char *name, int number_of_Levels, int number_of_net_output, float *input, int *nr_of_nodes, int overlap, int dimension1, int dimension2);
/* *fill_weight_for_fuzzy_input() puni te`ine ~vorova za fuzzy ulaz tako da svaka te`ina odgovara jednoj klasi ulaznog fuzzy skupa */
struct characteristic *fill_weight_for_fuzzy_input(struct characteristic *link, float weight);
/* *fill_node_for_fuzzy_input() puni ~vor prvog sloja kod fuzzy ulaza tako da svaki ~vor odgovara pripadnom fuzzy skupu na ulazu */
struct fuzzy_object *fill_node_for_fuzzy_input(struct fuzzy_object*fuzzy_input);
/* *fill_Level1_fuzzy_input() sli~na je funkciji *fill_Level() samo {to vodi ra~una da je to prvi sloj s fuzzy ulazom u kojem je mogu}e da se za svaki ~vor postavlja razli~iti broj te`ina */
struct Level *fill_Level1_fuzzy_input(int Level_No, int number_of_nodes, link_set *fuzzy_input, Level *ahead);
/* *fill_net_fuzzy_input() ista je kao *fill_net() samo {to je ulaz u mre`u skup fuzzy skupova, *weights ne sadr`i te`ine prvog sluja mre`e, (*(number_of_nodes+0);); mora biti jednak broju fuzzy skupova na ulazu */
struct neuron *fill_net_fuzzy_input(char *name, int nmbr_of_Levels, int *nmbr_of_nodes, char* output_names, float *weights, link_set *fuzzy_input);
/* *fill_net_auto_fuzzy_input() je ista kao *fill_net_auto() samo {to je ulaz u mre`u skup fuzzy skupova */
struct neuron *fill_net_auto_fuzzy_input( char *name, int number_of_Levels, int nmbr_of_fuzzy_objects_for_input, int number_of_net_output, struct fuzzy_object* *fuzzy_input);
/* *fill_net_auto_defLev_fuzzy_input() je ista kao *fill_net_auto() samo {to korisnik sljedno definira broj cvorova po sloju, osim prvog i zadnjeg */
struct neuron *fill_net_auto_def_Lev_fuzzy_input( char *name, int number_of_Levels, int nmbr_of_fuzzy_objects_for_input, int number_of_net_output, struct fuzzy_object* *fuzzy_input, int *nr_of_nodes);
/* *fill_Level1_fuzzy_input_overlaping() ista je kao *fill_Level1_fuzzy_input(), samo sto je ulaz u cvor pripadni pixel i njegova overlap okolina */
struct Level *fill_Level1_fuzzy_input_overlaping(int number_of_nodes, link_set *fuzzy_input, int overlap, int dimension1, int dimension2);
/* *fill_net_fuzzy_input_overlaping() ista je kao *fill_net_fuzzy_input() samo {to je ulaz u cvor prvog sloja pripadni pixel i njegova overlap okolina */
struct neuron *fill_net_fuzzy_input_overlaping(char *name, int nmbr_of_Levels, int *nmbr_of_nodes, char* output_names, float *weights, struct link_set *fuzzy_input, int overlap, int dimension1, int dimension2);
/* *fill_net_auto_fuzzy_input_overlaping() je ista kao *fill_net_auto_fuzzy_input() samo {to je ulaz u cvor prvog sloja pripadni pixel i njegova overlap okolina */
struct neuron *fill_net_auto_fuzzy_input_overlaping( char *name, int number_of_Levels, int number_of_net_output, struct fuzzy_object* *fuzzy_input, int overlap, int dimension1, int dimension2);
/* *fill_net_auto_defLev_fuzzy_input_overlaping() je ista kao *fill_net_auto_defLev_fuzzy_input() samo {to je ulaz u cvor prvog sloja pripadni pixel i njegova overlap okolina */
struct neuron *fill_net_auto_def_Lev_fuzzy_input_overlaping( char *name, int number_of_Levels, int number_of_net_output, struct fuzzy_object* *fuzzy_input, int *nr_of_nodes, int overlap, int dimension1, int dimension2);
/* fill_nodes_for_fuzzy_input_characteristic2node() puni sve ~vorove prvog sloja kod fuzzy ulaza istovremeno tako da svaki ~vor odgovara pripadnoj osobini svih fuzzy skupova na ulazu */
void fill_nodes_for_fuzzy_input_characteristic2node(struct Level *head, struct fuzzy_object* *fuzzy_input, int number_of_nodes, int nmbr_of_0weights);
/* *fill_Level1_fuzzy_input_characteristic2node() sli~na je funkciji *fill_Level1_fuzzy_input(); samo {to se u ovom slu~aju istom ~voru pridru`uju iste osobine svih fuzzy skupova na ulazu, umjesto pojedinog fuzzy skupa */
struct Level *fill_Level1_fuzzy_input_characteristic2node(int Level_No, int number_of_nodes, struct link_set *fuzzy_input, struct Level *ahead, int nmbr_of_0weights);
/* *fill_net_fuzzy_input_characteristic2node() ista je kao *fill_net_fuzzy_input() samo {to se ~vorovima prvog sloja mre`e pridru`uju istovrsne osobine fuzzy skupovana ulazu. Nu`an uvjet je da su fuzzy skupovi na ulazu identi~ne gra|e - da su osobine (klase); poredane unutar fuzzy skupa (liste); s identi~nim redoslijedom. Parametar nmbr_of_0weights odgovara broju osobina (klasa); svakog ulaznog fuzzy skupa */
struct neuron *fill_net_fuzzy_input_characteristic2node(char *name, int nmbr_of_Levels, int *nmbr_of_nodes, char* output_names, float *weights, struct link_set *fuzzy_input, int nmbr_of_0weights);
/* *fill_net_auto_fuzzy_input_characteristic2node() ista je kao *fill_net_auto_fuzzy_input() samo {to se ~vorovima prvog sloja mre`e pridru`uju istovrsne osobine fuzzy skupovana ulazu. Nu`an uvjet je da su fuzzy skupovi na ulazu identi~ne gra|e - da su osobine (klase); poredane unutar fuzzy skupa (liste); s identi~nim redoslijedom */
struct neuron *fill_net_auto_fuzzy_input_characteristic2node( char *name, int number_of_Levels, int nmbr_of_fuzzy_objects_for_input, int number_of_net_output, struct fuzzy_object* *fuzzy_input);
/* *fill_net_auto_defLev_fuzzy_input_characteristic2node() ista je kao *fill_net_auto_fuzzy_input_characteristic2node() samo {to korisnik sljedno definira broj cvorova u svakom sloju osim prvog i posljednjeg */
struct neuron *fill_net_auto_defLev_fuzzy_input_characteristic2node( char *name, int number_of_Levels, int nmbr_of_fuzzy_objects_for_input, int number_of_net_output, struct fuzzy_object* *fuzzy_input, int *nr_of_nodes);
/* *fill_Level1_fuzzy_input_characteristic2node_overlaping() ista je kao *fill_Level1_fuzzy_input_characteristic2node(), samo sto su ulaz u cvor istovrsne klase pripadnog pixela i njegove overlap okoline */
struct Level *fill_Level1_fuzzy_input_characteristic2node_overlaping(int number_of_nodes, struct link_set *fuzzy_input, int overlap, int dimension1, int dimension2);
/* *fill_net_fuzzy_input_characteristic2node_overlaping() ista je kao *fill_net_fuzzy_input_characteristic2node() samo {to su ulaz u cvor istovrsne klase pripadnog pixela i njegove overlap okoline */
struct neuron *fill_net_fuzzy_input_characteristic2node_overlaping(char *name, int nmbr_of_Levels, int *nmbr_of_nodes, char* output_names, float *weights, struct link_set *fuzzy_input, int overlap, int dimension1, int dimension2);
/* *fill_net_auto_fuzzy_input_characteristic2node_overlaping() ista je kao *fill_net_auto_fuzzy_input_characteristic2node() samo {to su ulaz u cvor istovrsne klase pripadnog pixela i njegove overlap okoline */
struct neuron *fill_net_auto_fuzzy_input_characteristic2node_overlaping( char *name, int number_of_Levels, int number_of_net_output, struct fuzzy_object* *fuzzy_input, int overlap, int dimension1, int dimension2);
/* *fill_net_auto_defLev_fuzzy_input_characteristic2node_overlaping() ista je kao *fill_net_auto_defLev_fuzzy_input_characteristic2node(); samo {to su ulaz u cvor istovrsne klase pripadnog pixela i njegove overlap okoline */
struct neuron *fill_net_auto_defLev_fuzzy_input_characteristic2node_overlaping( char *name, int number_of_Levels, int number_of_net_output, struct fuzzy_object* *fuzzy_input, int *nr_of_nodes, int overlap, int dimension1, int dimension2);
/* delete_node() je funkcija za brisanje pohranjenog cvora mreze */
void delete_node(struct fuzzy_object *head);
/* delete_Level() je funkcija za brisanje sloja pohranjene mre`e kod brisanja mre`e. U slu}aju kada se iz mre`e `eli samo izbaciti neki sloj, treba taj sloj prije brisanja premostiti (preusmjeriti pointere te`ina slijede}eg sloja);! */
void delete_Level(struct Level *head);
/* delete_neuron() je funkcija za brisanje pohranjene mre`e */
void delete_neuron(struct neuron *head);
/* *construct_backwinner() konstruira niz s elementima tipa backwinner i pointerom na njen po~etak i kraj tipa p_backwinner */
p_backwinner *construct_backwinner(struct neuron *net_head);
/* fill_backwinner() puni listu pointerima na klase (te`ine) preko kojih je propagirala najve}a pobuda s ulaza na izlaz mre`e */
void fill_backwinner(struct p_backwinner *head, struct neuron *net_head);
/* treasurehold_set() enable setting of treasurehold level */
void treasurehold_set( float addition);
/* node_output_e_exponent_set() enable setting of node_output_e_exponent value */
void node_output_e_exponent_set(float new_value);
/* node_out_type() define type of node output */
extern char node_output_type;
void node_out_type( char t);
/* node_output() omogu}ava nelinearizaciju izlaza iz ~vora i postavljanje praga osjeta, ovisno o sloju u kojem se ~vor nalazi */
float node_output(float value);
/* cycle() izvr{ava jedan ciklus rada mre`e */
void cycle(struct neuron *net_head);
/* cycle_correlation() je slicna funkciji cycle() samo sto se svaki ulaz u tezinu nekog cvora 1. sloja mnozi s ulazom pripadnog elementa, tako da za specijalni slucaj tezina dobijamo korelaciju tog elementa; funkcija ima smisla samo za ili ne-fuzzy ulaz ili characteristic2node fuzzy i to u oba slucaja samo ako je mreza generirana s overlaping */
/* uz nju se za ucenje koristi net_learn_correlation ili net_learn_limited_correlation */
void cycle_correlation(struct neuron *net_head);
/* set_rude() setting rude coefficients */
extern float rude_w_T, rude_w_F, rude_n_T, rude_n_F;
void set_rude( float rwT, float rwF, float rnT, float rnF);
/* set_fine() setting fine coefficients */
extern float fine_w_T, fine_w_F, fine_n_T, fine_n_F;
void set_fine( float fwT, float fwF, float fnT, float fnF);
/* rude_koef_learn() je funkcija koja puni koeficijente za ucenje visokim vrijednostima, a oni se prvenstveno upotrebljavaju kod prvog koraka ucenja */
void rude_koef_learn(struct koef_learn *k_l);
/* fine_koef_learn() je funkcija koja puni koeficijente za ucenje niskim vrijednostima, a oni se prvenstveno upotrebljavaju kod drugog koraka ucenja */
void fine_koef_learn(struct koef_learn *k_l);
/* F_normalisation() se poziva u slucaju pogresnog odgovora i djeluje kao prevencija za slucaj kada su sve tezine osim pobjednicke 0 */
void F_normalisation(struct fuzzy_object *head);
/* node_learn() je funkcija koja se poziva u net_learn, a svrha joj je u~enje (ispravljanje te`ina) danog ~vora ovisno o vrsti dobijenog odgovora (to~an ili kriv); */
void node_learn(struct fuzzy_object*head, enum Bool true_output, koef_learn *k_l);
/* node_winner_learn() je funkcija koja se poziva u net_learn, a svrha joj je u~enje (ispravljanje te`ina) danog ~vora, koji se nalazi na putu pobjedni~ke propagacije najve}eg izlaza, ovisno o vrsti dobijenog odgovora (to~an ili kriv); */
void node_winner_learn(struct backwinner *head, enum Bool true_output, koef_learn *k_l);
/* net_learn() je funkcija za u~enje mre`e, a *true_name je vektor u koji je zapisano ime klase (osobine) u izlaznom fuzzy skupu (net_head->output);; glavna ispravka se vr{i nad te`inama na koje ukazuje struktura backwinner, a manje nad te`inama svakog sloja */
void net_learn(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l);
/* net_learn_correlation() je slicna funkciji net_learn() samo sto poziva cycle_correlation() mjesto cycle() */
void net_learn_correlation(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l);
/* net_learn_limited() je funkcija za u~enje mre`e slicna net_learn(), s jedinom razlikom sto se ucenje nastavlja i ako je odgovor tocan sve dok je clanstvo u tom odgovoru < limit, limit je realan broj izmedu 0.0 i 1.0 */
void net_learn_limited(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l, float limit);
/* net_learn_limited_correlation() je slicna funkciji net_learn_limited() samo sto poziva cycle_correlation() mjesto cycle(); */
void net_learn_limited_correlation(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l, float limit);
/* net_learn_iterationlimit() slicna je net_learn() samo sto je broj iteracija ogranicen */
void net_learn_iterationlimit(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l, int iterationlimit);
/* net_learn_iterationlimit_correlation() je slicna funkciji net_learn_correlation() samo sto je broj iteracija ogranicen */
void net_learn_iterationlimit_correlation(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l, int iterationlimit);
/* net_learn_iterationlimit_limited() je funkcija za u~enje mre`e slicna net_learn_limited() samo sto je broj iteracija ogranicen */
void net_learn_iterationlimit_limited(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l, int iterationlimit, float limit);
/* net_learn_iterationlimit_limited_correlation() je slicna funkciji net_learn_limited_correlation() samo sto je broj iteracija ogranicen */
void net_learn_iterationlimit_limited_correlation(struct neuron *net_head, char *true_name, struct p_backwinner *head_p_backwinner, koef_learn *k_l, int iterationlimit, float limit);
/* *fill_node_for_fuzzy_input2node() is similar to *fill_node_for_fuzzy_input() with difference that each node is connected with its input characteristic and pointer first points toward its input calss membership */
struct fuzzy_object *fill_node_for_fuzzy_input2node(struct characteristic *fuzzy_input);
/* *fill_Level1_fuzzy_input2node() is similar to *fill_Level1_fuzzy_input() with difference that the first layer just copy membership of each characteristic into node (its m.notes); that means each input's characteristic is being mapped onto its node */
struct Level *fill_Level1_fuzzy_input2node(int Level_No, int number_of_nodes, int nmbr_of_net_input, struct link_set *fuzzy_input, struct Level *ahead);
/* *fill_net_fuzzy_input2node() is similar to *fill_net_fuzzy_input() with difference that the first layer just copy membership of each characteristic into node (its m.notes); that means each input's characteristic is being mapped onto its node */
struct neuron *fill_net_fuzzy_input2node(char *name, int nmbr_of_Levels, int nmbr_of_net_input, int *nmbr_of_nodes, char* output_names, float *weights, struct link_set *fuzzy_input);
/* *fill_net_auto_def_Lev_fuzzy_input2node() is similar to *fill_net_auto_def_Lev_fuzzy_input() with difference that the first layer just copy membership of each characteristic into node (its m.notes); that means each input's characteristic is being mapped onto its node */
struct neuron *fill_net_auto_def_Lev_fuzzy_input2node( char *name, int number_of_Levels, int nmbr_of_fuzzy_objects_for_input, int number_of_net_output, struct fuzzy_object **fuzzy_input, int *nr_of_nodes);
/* **fuzzy_input() organises vector of pointers on fuzzy objects, elements of fuzzy sets pointed by elements of vector pointed by input */
struct fuzzy_object **fuzzy_input(struct fuzzy_set **input, int number_of_fuzzy_sets);
/* **fuzzy_input_for_fuzzy_state_neural_network() forms state fuzzy set and then organises pointers on all fuzzy objects from fuzzy sets (input+statre); into vector*/
/* number_of_fuzzy_sets_in_input is only number of fuzzy sets pointed by input, while state fuzzy set is being added later in function */
struct fuzzy_object **fuzzy_input_for_fuzzy_state_neural_network(struct fuzzy_set **input, int number_of_fuzzy_sets_in_input, int number_of_states, int characteristics_per_state);
/* *fill_fuzzy_state_neural_network() forms and fills structure fuzzy_state_neural_network together with all its elements (including forming and filling of neural network and vector of pointers states); */
/* number_of_fuzzy_sets_in_input is only number of fuzzy sets pointed by input, while state fuzzy set is being added later inside function */
struct fuzzy_state_neural_network *fill_fuzzy_state_neural_network(char *name, int number_of_fuzzy_sets_in_input, int number_of_net_output, int number_of_states, int number_of_characteristics_per_state, struct fuzzy_set **input);
/* delete_fuzzy_state_neural_network() deletes structure fuzzy_state_neural_network with all its elements (including neural network); */
void delete_fuzzy_state_neural_network(struct fuzzy_state_neural_network *head);
/* state_normalisation() makes sum of all nodes presenting characteristics of the same state is equall 1.0 */
void state_normalisation(struct fuzzy_state_neural_network *head);
/* state_reset() reset all nodes presenting characteristics of states on 0.0 */
void state_reset(struct fuzzy_state_neural_network *head);
/* cycle_input2node() izvr{ava jedan ciklus rada mre`e */
void cycle_input2node(struct neuron *net_head);
/* cycle_fsnn_without_feedback() izvr{ava jedan ciklus rada mre`e FSNN gdje se ne ucitava s ulaza koji pokazuju na drugi sloj mreze, tj. eliminira se povratna veza */
void cycle_fsnn_without_feedback(struct neuron *net_head);
/* cycle_input2node_Max() is the same as cycle_input2node() except instead of sum in calculation of node output Maximum input is proceeded into function "node_output();" */
void cycle_input2node_Max(struct neuron *net_head);
/* cycle_fsnn_without_feedback_Max() is the same as cycle_fsnn_without_feedback() except instead of sum in calculation of node output Maximum input is proceeded into function "node_output();" */
void cycle_fsnn_without_feedback_Max(struct neuron *net_head);
/* reset_BP_correction_memory_input2node() only resets weight corrections for each weight on 0.0 without affecting anything else. */
void reset_BP_correction_memory_input2node(BP_correction_memory *head);
/* *BP_correction_memory_setup_input2node() forms and fills structure BP_correction_memory and setting correction weights on 0.0. "*nn" is pointer on neural network BP algorithm is going to be applied on, "learning_rate" is coefficient of learning in BP algorithm. */
BP_correction_memory *BP_correction_memory_setup_input2node(neuron *nn, float learning_rate);
/* delete_BP_correction_memory_input2node() deletes BP_correction_memory pointed by "*head" but not neural neuron pointed by its element 'neuron* network'. "*head" is pointer on structure BP_correction_memory to be deleted. */
void delete_BP_correction_memory_input2node(BP_correction_memory *head);
/* node_output_derivation() calculate (usuallu non-linear) function, gotten as the first derivation of node output (usually non-linear) function, inported as variable "value", for use in BP algorithm based learning. */
float node_output_derivation(float value);
/* BP_learn_cycle_input2node() calculates weight corrections for neural network pointed inside structure BP_correction_memory pointed by "*memory" according vector of expected answers. Network output is red from last Level's node's m.notes rather than from output fuzzy set. "*memory" is pointer on BP_correction_memory consists pointer on neural network and used to store weight corrections (by incrementing previous weight correction for each weight);, "*expected_output" is pointer on expected value of each node output (equivalent to output fuzzy set each characteristic membership); in the same order as characteristics in output fuzzy set (as last Level nodes);. */
/* NOTE: BP_learn_cycle_input2node() doesn't correct weights. To do so one needs to call function BP_weight_correction_input2node(); after this. */
/* Used BackPropagation algorithm is from IEEE "Neural Networks Theoretical Foundations and Analysis", pp.211-221, article "Backpropagation Through Time: What It Does and How to Do It" by P.J. Werbos */
void BP_learn_cycle_input2node(BP_correction_memory *memory, float *expected_output);
/* BP_learn_cycle_fsnn_without_feedback() is similar to BP_learn_cycle_input2node() with the difference inputs correspond previous state (pointing to second Level's nodes); are not taken in calculation. */
/* NOTE: BP_learn_cycle_fsnn_without_feedback() doesn't correct weights. To do so one needs to call function BP_weight_correction_input2node(); after this. */
/* Used BackPropagation algorithm is from IEEE "Neural Networks Theoretical Foundations and Analysis", pp.211-221, article "Backpropagation Through Time: What It Does and How to Do It" by P.J. Werbos */
void BP_learn_cycle_fsnn_without_feedback(BP_correction_memory *memory, float *expected_output);
/* BP_weight_correction_input2node() changes weight of neural network pointed in structure "*memory" according structure BP_correction_memory, pointed by "*memory", elements learning_rate and weight corrections stored in element weight_correction. "*memory" points on structure BP_correction_memory consists information of neural network whose weights will be updated as well as information of weights update and learning coefficient (learning_rate);. */
/* NOTE: BP_weight_correction_input2node() doesn't reset weights correction on 0.0. To perform that one needs to call function reset_BP_correction_memory_input2node(); after this function. */
void BP_weight_correction_input2node(BP_correction_memory *memory);
/* float abs_sum_BP_weight_corrections() calculate absolute sum (sum of absolute values) of all weight corrections */
float abs_sum_BP_weight_corrections(BP_correction_memory *memory);
/* functions for setting up NEURON TYPE DESCRIPTORs */
/* neuron_type_descriptor* setup_highest_difference_from_neighborns_descriptor() sets up neuron_type_descriptor for highest_difference_from_neighborns class of neurones */
neuron_type_descriptor* setup_highest_difference_from_neighborns_descriptor();
/* neuron_type_descriptor* setup_corner_extractor_descriptor() sets up neuron_type_descriptor for corner_extractor class of neurones */
neuron_type_descriptor* setup_corner_extractor_descriptor();
/* neuron_type_descriptor* setup_sort2r_descriptor() sets up neuron_type_descriptor for sort2 class of neurones */
neuron_type_descriptor* setup_sort2_descriptor();
/* neuron_type_descriptor* setup_number_of_corner_extractor_descriptor() sets up neuron_type_descriptor for number_of_corner_extractor class of neurones */
neuron_type_descriptor* setup_number_of_corner_extractor_descriptor();
/* neuron_type_descriptor* setup_area_separator_descriptor() sets up neuron_type_descriptor for area separator class of neurones */
neuron_type_descriptor* setup_area_separator_descriptor();
/* neuron_type_descriptor* setup_area_without_edges_separator_descriptor() sets up neuron_type_descriptor for area without edges separator class of neurones */
/* area without edges separator is similar to area separator with difference pixel on the picture edge have no pair in nodes in the 2nd Level and output and in that way dimension of the 2nd Level and the output is shorter by 2 in each dimension. Everything else is the same. */
neuron_type_descriptor* setup_area_without_edges_separator_descriptor();
/* setting up FCNN_2L descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_descriptor() sets up neuron_type_descriptor for FCNN_2L (Fully Connected Neural Network with 2 Layers) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_descriptor();
/* setting up FCNN_3L descriptor */
/* neuron_type_descriptor* setup_FCNN_3L_descriptor() sets up neuron_type_descriptor for FCNN_3L (Fully Connected Neural Network with 2 Layers) class of neurones */
neuron_type_descriptor* setup_FCNN_3L_descriptor();
/* setting up FCNN_4L descriptor */
/* neuron_type_descriptor* setup_FCNN_4L_descriptor() sets up neuron_type_descriptor for FCNN_4L (Fully Connected Neural Network with 4 Layers) class of neurones */
neuron_type_descriptor* setup_FCNN_4L_descriptor();
/* setting up FCNN_5L descriptor */
/* neuron_type_descriptor* setup_FCNN_5L_descriptor() sets up neuron_type_descriptor for FCNN_5L (Fully Connected Neural Network with 5 Layers) class of neurones */
neuron_type_descriptor* setup_FCNN_5L_descriptor();
/* setting up FCNN_2L_W descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_descriptor() sets up neuron_type_descriptor for FCNN_2L_W (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_descriptor();
/* setting up FCNN_3L_W descriptor */
/* neuron_type_descriptor* setup_FCNN_3L_W_descriptor() sets up neuron_type_descriptor for FCNN_3L_W (Fully Connected Neural Network with 3 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius) class of neurones */
neuron_type_descriptor* setup_FCNN_3L_W_descriptor();
/* setting up FCNN_4L_W descriptor */
/* neuron_type_descriptor* setup_FCNN_4L_W_descriptor() sets up neuron_type_descriptor for FCNN_4L_W (Fully Connected Neural Network with 4 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius) class of neurones */
neuron_type_descriptor* setup_FCNN_4L_W_descriptor();
/* setting up FCNN_5L_W descriptor */
/* neuron_type_descriptor* setup_FCNN_5L_W_descriptor() sets up neuron_type_descriptor for FCNN_5L_W (Fully Connected Neural Network with 5 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius) class of neurones */
neuron_type_descriptor* setup_FCNN_5L_W_descriptor();
/* setting up FCNN_2L_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_descriptor();
/* setting up FCNN_3L_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_3L_1out_descriptor() sets up neuron_type_descriptor for FCNN_3L_1out (Fully Connected Neural Network with 3 Layers and only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_3L_1out_descriptor();
/* setting up FCNN_4L_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_4L_1out_descriptor() sets up neuron_type_descriptor for FCNN_4L_1out (Fully Connected Neural Network with 4 Layers and only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_4L_1out_descriptor();
/* setting up FCNN_5L_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_5L_1out_descriptor() sets up neuron_type_descriptor for FCNN_5L_1out (Fully Connected Neural Network with 5 Layers and only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_5L_1out_descriptor();
/* setting up FCNN_2L_W_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_descriptor();
/* setting up FCNN_3L_W_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_3L_W_1out_descriptor() sets up neuron_type_descriptor for FCNN_3L_W_1out (Fully Connected Neural Network with 3 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_3L_W_1out_descriptor();
/* setting up FCNN_4L_W_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_4L_W_1out_descriptor() sets up neuron_type_descriptor for FCNN_4L_W_1out (Fully Connected Neural Network with 4 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_4L_W_1out_descriptor();
/* setting up FCNN_5L_W_1out descriptor */
/* neuron_type_descriptor* setup_FCNN_5L_W_1out_descriptor() sets up neuron_type_descriptor for FCNN_5L_W_1out (Fully Connected Neural Network with 5 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node) class of neurones */
neuron_type_descriptor* setup_FCNN_5L_W_1out_descriptor();
/* setting up FCNN_2L_FBALL_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_11 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_11_descriptor();
/* setting up FCNN_2L_FBALL_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_22 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_22_descriptor();
/* setting up FCNN_2L_FBALL_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_21 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer on 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_21_descriptor();
/* setting up FCNN_2L_FBALL_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_22_21 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer on 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_22_21_descriptor();
/* setting up FCNN_2L_FBALL_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_21_11 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer on 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_21_11_descriptor();
/* setting up FCNN_2L_FBALL_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_22_11 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_22_11_descriptor();
/* setting up FCNN_2L_FBALL_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FBALL_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FBALL_22_21_11 (Fully Connected Neural Network with 2 Layers and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FBALL_22_21_11_descriptor();
/* setting up FCNN_2L_W_FBALL_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_11_descriptor();
/* setting up FCNN_2L_W_FBALL_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_22 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_descriptor();
/* setting up FCNN_2L_W_FBALL_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_21_descriptor();
/* setting up FCNN_2L_W_FBALL_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_22_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_11_descriptor();
/* setting up FCNN_2L_W_FBALL_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_21_11_descriptor();
/* setting up FCNN_2L_W_FBALL_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_22_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_21_descriptor();
/* setting up FCNN_2L_W_FBALL_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FBALL_22_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FBALL_22_21_11_descriptor();
/* setting up FCNN_2L_1out_FBALL_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_11_descriptor();
/* setting up FCNN_2L_1out_FBALL_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_22 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_descriptor();
/* setting up FCNN_2L_1out_FBALL_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_21 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto the 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_21_descriptor();
/* setting up FCNN_2L_1out_FBALL_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_22_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_11_descriptor();
/* setting up FCNN_2L_1out_FBALL_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_21_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_21_11_descriptor();
/* setting up FCNN_2L_1out_FBALL_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_22_21 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_21_descriptor();
/* setting up FCNN_2L_1out_FBALL_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FBALL_22_21_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FBALL_22_21_11_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_11_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_22 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto the 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_21_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_22_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_11_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_21_11_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_22_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_21_descriptor();
/* setting up FCNN_2L_W_1out_FBALL_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FBALL_22_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback to all (means all nodes from feedback source are producing feedback onto all nodes of feedback destination) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FBALL_22_21_11_descriptor();
/* setting up FCNN_2L_FB1_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_11 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_11_descriptor();
/* setting up FCNN_2L_FB1_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_22 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_22_descriptor();
/* setting up FCNN_2L_FB1_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_21 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer on 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_21_descriptor();
/* setting up FCNN_2L_FB1_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_22_11 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_22_11_descriptor();
/* setting up FCNN_2L_FB1_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_21_11 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer on 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_21_11_descriptor();
/* setting up FCNN_2L_FB1_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_22_21 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer on 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_22_21_descriptor();
/* setting up FCNN_2L_FB1_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_FB1_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_FB1_22_21_11 (Fully Connected Neural Network with 2 Layers and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_FB1_22_21_11_descriptor();
/* setting up FCNN_2L_W_FB1_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_11_descriptor();
/* setting up FCNN_2L_W_FB1_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_22 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_descriptor();
/* setting up FCNN_2L_W_FB1_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_21_descriptor();
/* setting up FCNN_2L_W_FB1_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_22_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_11_descriptor();
/* setting up FCNN_2L_W_FB1_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_21_11_descriptor();
/* setting up FCNN_2L_W_FB1_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_22_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_21_descriptor();
/* setting up FCNN_2L_W_FB1_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_FB1_22_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radius, and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_FB1_22_21_11_descriptor();
/* setting up FCNN_2L_1out_FB1_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_11_descriptor();
/* setting up FCNN_2L_1out_FB1_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_22 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_descriptor();
/* setting up FCNN_2L_1out_FB1_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_21 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto the 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_21_descriptor();
/* setting up FCNN_2L_1out_FB1_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_22_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_11_descriptor();
/* setting up FCNN_2L_1out_FB1_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_21_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_21_11_descriptor();
/* setting up FCNN_2L_1out_FB1_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_22_21 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_21_descriptor();
/* setting up FCNN_2L_1out_FB1_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_1out_FB1_22_21_11 (Fully Connected Neural Network with 2 Layers and only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_1out_FB1_22_21_11_descriptor();
/* setting up FCNN_2L_W_1out_FB1_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_11_descriptor();
/* setting up FCNN_2L_W_1out_FB1_22 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_22 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_descriptor();
/* setting up FCNN_2L_W_1out_FB1_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto the 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_21_descriptor();
/* setting up FCNN_2L_W_1out_FB1_22_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_22_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_11_descriptor();
/* setting up FCNN_2L_W_1out_FB1_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_21_11_descriptor();
/* setting up FCNN_2L_W_1out_FB1_22_21 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_21_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_22_21 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_21_descriptor();
/* setting up FCNN_2L_W_1out_FB1_22_21_11 descriptor */
/* neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_21_11_descriptor() sets up neuron_type_descriptor for FCNN_2L_W_1out_FB1_22_21_11 (Fully Connected Neural Network with 2 Layers and input through window function-each of neurones inside neuron population receives input from associated input and its neighborns within distance window radiusand only one output=only one last layer's node and feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) from 2nd layer onto itself and from 2nd layer onto 1st layer and from 1st layer onto itself) class of neurones */
neuron_type_descriptor* setup_FCNN_2L_W_1out_FB1_22_21_11_descriptor();
/* Convolutional NNs */
/* setting up convolutional_layer_neuron descriptor */
/* neuron_type_descriptor* setup_convolutional_layer_neuron_descriptor() sets up neuron_type_descriptor for convolutional_layer_neuron class of neurones, used in simulation of CNs (Convolutional NNs) */
/* adviced when input is combined output of other neurones */
/* prepare input function takes whole input fuzzy set as 3D where the 3rd dimension presents different outputs each presenting 2D picture */
/* spatial neighborhood is preserved by taking always all pixel (outputs) with the same 2D coordinate (inside the output pictures of each output) together */
neuron_type_descriptor* setup_convolutional_layer_neuron_descriptor();
/* neuron_type_descriptor* setup_convolutional_layer_neuron_descriptor1() sets up neuron_type_descriptor for convolutional_layer_neuron class of neurones, used in simulation of CNs (Convolutional NNs) similar to convolutional_layer_neuron_descriptor just with another function for preparing input */
/* adviced when input is the original picture */
/* prepare input function takes whole input fuzzy set as one big 2D picture */
neuron_type_descriptor* setup_convolutional_layer_neuron_descriptor1();
/* setting up averaging_layer_neuron descriptor */
/* neuron_type_descriptor* setup_averaging_layer_neuron_descriptor() sets up neuron_type_descriptor for averaging_layer_neuron class of neurones, used in simulation of CNs (Convolutional NNs) */
neuron_type_descriptor* setup_averaging_layer_neuron_descriptor();
/* setting up simple_neuron descriptor */
/* neuron_type_descriptor* setup_simple_neuron_descriptor() sets up neuron_type_descriptor for simple_neuron class of neurones, used in simulation of CNs (Convolutional NNs) */
neuron_type_descriptor* setup_simple_neuron_descriptor();
/* common functions for almost all types of neurones */
void *creating_neuron_population_output(neuron_population *np);
/* creates neuron population's output fuzzy set whose fuzzy objects are neuron population's neurones' output fuzzy objects in the same order as neurones inside neuron population */
enum Bool setup_weights_pointers(Level* actual_Level, Level *previous_Level);
/* fill pointers of actual_level's nodes' characteristics (weights) toward previous_Level's nodes. Characteristics (weights) of each actual_Level's node points toward each of previous_Level's nodes (it means each actual_Level's node consists pointers toward all previous_Level nodes). In the case any actual_Level's node has different number of characteristics (weights) than previous_Level has nodes F=0 is returned. Otherwise T=1 i returned. */
float even_minus_odd(struct fuzzy_object *node, int Level_number);
/* Sum of weighted odd inputs is substracted from sum of weighted even inputs. 0 is taken as even number! first_characteristic points on 0 input, first_characteristic->follow points on 1st input etc. */
float Max_output_node(struct fuzzy_object *node);
/* calculate Maximum of all weighted inputs into the node and DOESN'T WRITE into node's m.notes */
float exp_node_output(float linear_output);
/* node's output is non-linearised using exponential function y(x)=-1+1/(1+e^(-node_output_e_exponent*x)); where node_output_e_exponent is declared as extern and preset on 5.0. Output is also filtered with treasurehold set up over common/extern variable "treasureholdadd". */
/* THRESHOLD MUSN'T BE FORGOTEN TO BE SETUP as outputs are between -1 and 1 so threshold should be -1.0 */
float exp_node_output_derivation(float value);
/* output is the first derivation of exp_node_output() function for the given value */
float exp_positive_node_output(float linear_output);
/* node's output is non-linearised using exponential function y(x)=1/(1+e^(-node_output_e_exponent*x)). Output is also filtered with treasurehold set up over common/extern variable "treasureholdadd". */
float exp_positive_node_output_derivation(float value);
/* output is the first derivation of exp_node_output() function for the given value */
float tgh_node_output(float linear_output);
/* node's output is non-linearised using tanges hiperbolic function y(x)=(tgh(2*x*PI-PI)+1)/2. Output is also filtered with treasurehold set up over common/extern variable "treasureholdadd". */
float tgh_node_output_derivation(float value);
/* output is the first derivation of tgh_node_output() function for the given value */
float treasureholded_node_output(float linear_output);
/* node's output is non-linearised through filtering with treasurehold set up over common/extern variable "treasureholdadd". */
float treasureholded_node_output_derivation(float value);
/* output is the first derivation of treasureholded_node_output() function for the given value */
float unchanged_linear_node_output(float linear_output);
/* output is unchanged linear node output */
float unchanged_linear_node_output_derivation(float value);
/* output is the first derivation of unchanged_linear_node_output() function for the given value */
struct neuron *create_FCNN_1L_1out(struct fuzzy_set *input);
/* create the neuron of FCNN with only 1 layer and only 1 characteristic in the output fuzzy object type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to one node). Output fuzzy object consists just one characteristics as there are nodes in the first and only Level. */
struct neuron *create_FCNN(struct fuzzy_set *input, int number_of_Levels);
/* create the neuron of FCNN type with given number of layers. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The each successive Level nodes are receving inputs each from all nodes of the preceded Level. Output fuzzy object consists as many characteristics as there are nodes in the last Level (= number of nodes in each Level = number of input fuzzy set objects' characteristics). */
struct neuron *create_FCNN_with_only_1_output(struct fuzzy_set *input, int number_of_Levels);
/* create the neuron of FCNN with only 1 characteristic in the output fuzzy object type and with given number of layers. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The each successive Level nodes are receving inputs each from all nodes of the preceded Level. Output fuzzy object consists just one characteristics as there are nodes in the last Level, while number of nodes per Level linearly decreases from the first Level (the same number of nodes as input fuzzy set characteristics) toward the last one (only one characteristic). */
struct neuron *create_recurrent_FCNN(struct fuzzy_set *input, int number_of_Levels, int number_of_recurrent_connections, int *source, int *destination);
/* create the recurrent neuron of FCNN type with given number of layers (int number_of_Levels), number of feedback connections (int number_of_recurrent_connections) and given vector of feedback origin (int *source) and vector of feedback destination (int *destination). Vectors source and destination have number_of_recurrent_connections elements each and their elements presents pairs (source,destination) each pair presents one recurrent (feedback) (and no necessary recurrent) connection. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The each successive Level nodes are receving inputs each from all nodes of the preceded Level plus, if the Level number is inside the vector destination, from its pair (in the vector source) nodes' output. Output fuzzy object consists as many characteristics as there are nodes in the last Level (= number of nodes in each Level = number of input fuzzy set objects' characteristics). */
struct neuron *create_recurrent_FCNN_with_only_1_output(struct fuzzy_set *input, int number_of_Levels, int number_of_recurrent_connections, int *source, int *destination);
/* create the recurrent neuron of FCNN with only 1 output type with given number of layers (int number_of_Levels), number of feedback connections (int number_of_recurrent_connections) and given vector of feedback origin (int *source) and vector of feedback destination (int *destination). Vectors source and destination have number_of_recurrent_connections elements each and their elements presents pairs (source,destination) each pair presents one recurrent (feedback) (and no necessary recurrent) connection. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The each successive Level nodes are receving inputs each from all nodes of the preceded Level plus, if the Level number is inside the vector destination, from its pair (in the vector source) nodes' output. Output fuzzy object consists as many characteristics as there are nodes in the last Level (just one). Number of nodes linearly decrease from the first layer (as many nodes as input characteristics) toward the last layer (only one node). */
struct neuron *create_recurrent_FCNN_FB1(struct fuzzy_set *input, int number_of_Levels, int number_of_recurrent_connections, int *source, int *destination);
/* create the recurrent neuron of FCNN_FB1 type with given number of layers (int number_of_Levels), number of feedback connections (int number_of_recurrent_connections) and given vector of feedback origin (int *source) and vector of feedback destination (int *destination). Vectors source and destination have number_of_recurrent_connections elements each and their elements presents pairs (source,destination) each pair presents one recurrent (feedback) (and no necessary recurrent) connection. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The each successive Level nodes are receving inputs each from all nodes of the preceded Level plus, if the Level number is inside the vector destination, from its pair (in the vector source) nodes' output. Output fuzzy object consists as many characteristics as there are nodes in the last Level (= number of nodes in each Level = number of input fuzzy set objects' characteristics). */
/* FB1 meansfeedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) */
struct neuron *create_recurrent_FCNN_FB1_with_only_1_output(struct fuzzy_set *input, int number_of_Levels, int number_of_recurrent_connections, int *source, int *destination);
/* create the recurrent neuron of FCNN_FB1 with only 1 output type with given number of layers (int number_of_Levels), number of feedback connections (int number_of_recurrent_connections) and given vector of feedback origin (int *source) and vector of feedback destination (int *destination). Vectors source and destination have number_of_recurrent_connections elements each and their elements presents pairs (source,destination) each pair presents one recurrent (feedback) (and no necessary recurrent) connection. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The each successive Level nodes are receving inputs each from all nodes of the preceded Level plus, if the Level number is inside the vector destination, from its pair (in the vector source) nodes' output. Output fuzzy object consists as many characteristics as there are nodes in the last Level (just one). Number of nodes linearly decrease from the first layer (as many nodes as input characteristics) toward the last layer (only one node). */
/* FB1 means feedback one to one (means each node from feedback source is producing feedback onto its pair node of feedback destination and its the node on the same place inside destination layer as source is inside source layer, while in a case whan source layer has more nodes than destination layer only nodes that have their pair inside destination layer run feedback and similarly if destination layer has more nodes than source layer only nodes having their pair inside the source layer receive feedback, number of feedback connections is limited with lower of number of nodes in source layer and number of nodes in destination layer) */
struct neuron *create_FCNN_1L_1out_fixed_weights(struct fuzzy_set *input);
/* create the neuron of FCNN with only 1 layer and only 1 characteristic in the output fuzzy object type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to one node). Output fuzzy object consists just one characteristics as there are nodes in the first and only Level. */
/* all weights are preset on the value stored in extern float fixed_weight */
extern float fixed_weight;
/* extern variable fixed_weight is used to setup weights in neurones whose all weights inside the weight matrice are initiated on the same value. */
/* fixed_weight is preset on 1.0, but could be changed prior to a function (that uses it) call */
void fixing_weights(neuron *n);
/* fixing weights (setting all weights on the same value) on the value stored in extern float fixed_weight */
float sum_of_all_weighted_inputs(struct fuzzy_object *node, int Level_number);
/* sum of all inputs multiplied each with its weight (membership of pointer onto the input), including for the bias, is returned. */
/* the bias is defined in "neuro.h" as BIAS=1, but could be redefined if you defined it (#define BIAS __) before including "neuro.h" */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
float product_of_all_weighted_inputs(struct fuzzy_object *node, int Level_number);
/* product of all inputs multiplied each with its weight (membership of pointer onto the input) is returned. */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
float highest_weighted_input(struct fuzzy_object *node, int Level_number);
/* the highest value (input*weight) all inputs multiplied each with its weight (membership of pointer onto the input) is returned. */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
void firing_standard_neuron(struct neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. Node output function is pointed inside neuron's nucleide base. Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
void firing_recurrent_neuron(struct neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. Node output function is pointed inside neuron's nucleide base. Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* firing_recurent_neuron() fires firing_standard_neuron() until neuron output is stabilised (means diverge not more than limit [each last Level nodes' output is not changed more than limit since previous fireing]) */
void firing_feedback_neuron(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. Node output function is pointed inside neuron's nucleide base. Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* this function is specially developed for neurons with feedback (recurrent connection) within the same layer but CAN HANDLE also STANDARD NEURON */
/* while processing a layer new output is stored into a buffer and at the end copied from the buffer onto nodes' output */
void firing_recurrent_neuron_with_feedback(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. Node output function is pointed inside neuron's nucleide base. Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* firing_recurent_neuron_with_feedback() fires firing_feedback_neuron() until neuron output is stabilised (means diverge not more than limit [each last Level nodes' output is not changed more than limit since previous fireing]) or Maximal_number_of_iterations is reached (that is the case neuron output diverge) */
/* this function is specially developed for neurons with feedback (recurrent connection) within the same layer but CAN HANDLE also STANDARD NEURON */
/* while processing a layer new output is stored into a buffer and at the end copied from the buffer onto nodes' output */
float sum_of_2multiplications_with_maximum_of_3(struct fuzzy_object *node, int Level_number);
/* input is considered as consequtive (non-overlapping) groups of five weighted inputs the first two of them are multiplicated with the maximal value (the highest one) of the following three inputs and than all products are sumed (i.e. output= input1*input2*Max(input3+input4+input5) + input6*input7*Max(input8+input9+input10) + input11*input12*Max(input13+input14+input15) + input16*input17*Max(input18+input19+input20) + ....). In the case number of inputs is not divisible with five exit (exit_handling(7,remainder of (number of inputs/5))) is caused. */
/* in the case Level_number<0, there is only 3 inputs while output is sum of multiplications of them as written above. In the case number of inputs is not divisible with 3 exit (exit_handling(13,remainder of (number of inputs/3))) is caused. */
float sum_of_roots_of_2multiplications_with_maximum_of_3(struct fuzzy_object *node, int Level_number);
/* input is considered as consequtive (non-overlapping) groups of five weighted inputs the first two of them are multiplicated with the maximal value (the highest one) of the following three inputs and than third roots of all (means of each of them) products are sumed (i.e. output= third_root(input1*input2*Max(input3+input4+input5)) + third_root(input6*input7*Max(input8+input9+input10)) + third_root(input11*input12*Max(input13+input14+input15)) + third_root(input16*input17*Max(input18+input19+input20)) + ....). In the case number of inputs is not divisible with five exit (exit_handling(8,remainder of (number of inputs/5))) is caused. */
/* in the case Level_number<0, there is only 3 inputs while output is sum of third roots of multiplications of them as written above. In the case number of inputs is not divisible with 3 exit (exit_handling(14,remainder of (number of inputs/3))) is caused. */
float arithmetic_mean_of_roots_of_2multiplications_with_maximum_of_3(struct fuzzy_object *node, int Level_number);
/* input is considered as consequtive (non-overlapping) groups of five weighted inputs the first two of them are multiplicated with the maximal value (the highest one) of the following three inputs and than arithmetic mean of third roots of all products calculated (i.e. output= arithmetic mean(third_root(input1*input2*Max(input3+input4+input5)), third_root(input6*input7*Max(input8+input9+input10)), third_root(input11*input12*Max(input13+input14+input15)), third_root(input16*input17*Max(input18+input19+input20)), ....)). In the case number of inputs is not divisible with five exit (exit_handling(9,remainder of (number of inputs/5))) is caused. */
/* in the case Level_number<0, there is only 3 inputs while output is arithmetic mean of third roots of multiplications of them as written above. In the case number of inputs is not divisible with 3 exit (exit_handling(15,remainder of (number of inputs/3))) is caused. */
float highest_arithmetic_mean_of_2_with_maximum_of_3(struct fuzzy_object *node, int Level_number);
/* input is considered as consequtive (non-overlapping) groups of five weighted inputs arithmetic mean is calculated of the first two and the maximal value (the highest one) of the following three inputs and the highest one proceeded on output (i.e. output= Max(arithmetic mean(input1*input2*Max(input3+input4+input5)), arithmetic mean(input6*input7*Max(input8+input9+input10)), arithmetic mean(input11*input12*Max(input13+input14+input15)), arithmetic mean(input16*input17*Max(input18+input19+input20)), ....)). In the case number of inputs is not divisible with five exit (exit_handling(10,remainder of (number of inputs/5))) is caused. */
/* in the case Level_number<0, there is only 3 inputs while output is the highest arithmetic mean of multiplications of them as written above. In the case number of inputs is not divisible with 3 exit (exit_handling(16,remainder of (number of inputs/3))) is caused. */
float product_of_first_n_with_complements_of_rest(struct fuzzy_object *node, int n);
/* output is product of the first n inputs and the rest of inputs are complemented. It means: "output=input1*input2*....*inputn*(1-input(n+1))*(1-input(n+2))*(1-input(n+3))*...*(1-inputlast)" */
/* also each input is multiplied with its (characteristic) weight prior to multiplying with other inputs or their complements */
extern int sequence_randomiser;
/* extern int sequence_randomiser is used in filling_weights_with_randum_numbers() to add additional dimension of randomness as when is a sequence randomise because of high processor frequence time(0) and clock() are not necessary changed inbetween elements */
void filling_weights_with_randum_numbers(struct neuron *head);
/* fills weights inside the neuron with random numbers from [0,1] real interval. Randomisation is reached using random number generator randomised by general time (datum+actual time), processor time and weight's position inside the neuron. */
/* functions that deal on neuron population level */
struct fuzzy_set **preparing_neuron_population_neuron_inputs_through_window(neuron_population *np, int window_radius, int horisontal_resolution, int vertical_resolution);
/* Returns pointer on array of pointers on fuzzy sets (the same number of fuzzy sets as fuzzy objects in input fuzzy set). Prepares neuron population's neurones' input fuzzy sets from neuron population input fuzzy set presenting "picture" with dimension horisontal_resolution * vertical_resolution in a following way: each fuzzy object in neural population's input fuzzy set becomes the first fuzzy object in one and only one neuron's (inside the population) input fuzzy set, other fuzzy objects in input fuzzy set of a neuron (inside population) are fuzzy objects placed on the neuron population input "picture" inside window radius from the first object in the neuron's input (or better said placed inside square each side equal two times window radius with center in the first object in neuron's input). It is similar as shifting square window (each side=2*window_radius) on the picture and inputing the central pixel as the first followed by other pixel inside window. If neuron population has different number of neurones than its input fuzzy set unsucessful program termination is caused (exit(1)) ! */
/* When returned array is used memory consisting data not necessary for future work should be liberate (using command testfree())! This usually means following: "for(i=0; inumber_of_neurones; testfree((char*)(*(head+i))->name), testfree((char*)(*(head+i))->objects), testfree((char*)*(head+i++))); testfree((char*)head);" after creating neuron population's neurones. */
struct fuzzy_set *many2one(int number_of_sets, struct fuzzy_set **sets);
/* Create new fuzzy set pointing on all objects member of fuzzy sets pointed by array sets. Variable number_of_sets meand how many fuzzy sets are pointed by array sets. Array sets consists pointers on fuzzy sets. */
/* The created fuzzy set has the name THE NUMBER OF FUZZY SETS IT CONSISTS ! */
/* After use when new fuzzy set (as set of pointers on fuzzy objects) is no more required memory should be liberated usually in following way: "testfree((char*)fuzzy_set_pointer->name);testfree((char*)fuzzy_set_pointer->objects);testfree((char*)fuzzy_set_pointer);", where "fuzzy_set_pointer" is name given to the pointer on the fuzzy set (means earlier in program such command as fuzzy_set_pointer=many2one(....). */
neuron_population *create_neuron_population(nucleotide_base *code, int number_of_neurones_in_population, struct fuzzy_set *input, int window_radius, int horisontal_input_resolution, int vertical_input_resolution, struct fuzzy_set** (*prepare_input)(neuron_population*, int, int, int));
/* Creates neuron population from information stored in its nucleotide base. "number_of_neurones_in_population" presents number of neurones to be created to form the population. "input" is fuzzy set used as input in the population. In the case input is union of several fuzzy sets the required one should be defined by creating new structure fuzzy_set consisting pointers on all fuzzy_objects presenting input into the population (it can be done using function many2one()). "window_radius", "horisontal_input_resolution" and "vertical_input_resolution" are to be used in function pointed by "prepare_input" and in the case prepare_input=nill their values are not of interest and are not used in the function. "prepare_input()" is pointer on function that rearrange neurones' inputs from the population's input by forming array of fuzzy sets each fuzzy set for one and only one neuron in the population. In the case all neurones receive input from all fuzzy objects in the population's input fuzzy set input preparing function is NOT REQUIRED so should be "prepare_input=nill" ! */
/* Pointer toward root population IS SET UP AS NILL and SHOULD BE WRITTEN LATER as well as number_of_leaf_populations that IS also SET UP AS NILL. Array of pointers toward leaf populations IS NOT CREATED (MEMORY IS NOT RESERVED) while pointer on the array (**leaf) IS NILL and SHOULD BE CREATED AND FILLED LATER ! */
/* In the case input is wanted to be considered as 2 dimensional (for organisation of the population's neurones inputs) horisontal_input_resolution presents horisontal and vertical_input_resolution vertical dimension of input "picture" (pixel=fuzzy object), while window_radius presents radius (half of window side's lenght) of window for each of the population's neuron input. In that case must be satisfied "horisontal_input_resolution*vertical_input_resolution=input->number_of_objects" and "window_radius>0". */
void fire_neuron_population(neuron_population *np);
/* fire_neuron_population() fires neuron population by firing each neuron inside the population */
void fill_neuron_population_root_and_leaf(struct neuron_population *np, int number_of_leaf, int number_of_root, struct neuron_population **root, struct neuron_population **leaf);
/* creates and fills vectors root and leaf inside the neuron population consisting pointers onto neuron populations the population receives input from (root) and proceedings output to (leaf) */
void delete_neuron_population(struct neuron_population *head);
/* deletes neuron population and releases its memory */
/* functions that deal on neural subsystem level */
void creating_neural_subsystem_output(struct neural_subsystem *ns);
/* creates neural subsystem's output fuzzy set whose fuzzy objects are neural subsystem's root (last layer of neuron populations according the direction of information/input processing) neuron populations' output fuzzy sets in the same order as neuron populations inside the roots vector (of pointers) of the neural subsystem */
void delete_neural_subsystem(struct neural_subsystem *head);
/* deletes neural subsystem and releases its memory */
struct neural_subsystem *create_neural_subsystem_from_gene(gene *code, struct fuzzy_set *input);
/* creates neural system from information stored in its gene and input fuzzy set */
/* missing (important) part that should create neuron populations inside the subsystem and fill its pointers to leaves and root consisted neuron populations tree as well to other subsystems */
/* the problem is how to define/choose input fuzzy set per particular neuron population - maybe they should create input fuzzy set each for itself from their pointers on leaves neuron populations */
void filling_neural_subsystem_tree_of_neural_populations(struct neural_subsystem *ns, struct neuron_population ***populations_with_leaves, int *number_of_leaves);
/* fills both, the neural_subsystem's roots and leaves vectors and its populations' root and leaf vectors, from the vector populations_with_leaves that has as many elements as there are populations inside the subsystem, each of them pointing to vector of pointers first one onto the related population (according its identification_number) followed by its leaves, the number of leaves is stored on the same position (inside the vector) in the vector number_of_leaves. The populations in the vector populations_with_leaves are stored starting from the subsystem's root populations toward the leaves, in the same order as populations' related identification_numbers should be */
void fill_neural_subsystem_root_and_leaf(struct neural_subsystem *ns, int number_of_leaf, int number_of_root, struct neural_subsystem **root, struct neural_subsystem **leaf);
/* creates and fills vectors root and leaf inside the neural subsystem consisting pointers onto neural subsystems the subsystem receives input from (root) and proceedings output to (leaf) */
neural_subsystem *create_neural_subsystem_from_gene_and_subsystem_tree(struct gene *code, struct subsystem_tree *tree, neuron_population ***virtual_populations, enum Bool **inputs);
/* creates neural subsystem from information provided in related gene and subsystem tree, while virtual_populations and inputs enable creation of neuron populations that receive input or proceed output outside from/of their subsystem as well as implementing recurrent connections. virtual_populations must be an allocated space of memory dimension = number_of_subsystems_in_the_system * number_of_populations_in_the_subsystem(subsystem_identification(order)_number=row_number(0-number_of_subsystems-1)+1), first column is pointers to subsystems, while other in a row point to populations belonging to the subsystem in the first column and are organised in order according populations' numbers inside the subsystem_tree, and if population/subsystem is not created yet pointer must be 0 otherwise point to related population/subsystem. inputs is Boolean matrix each element shows if its neuron population, pointed on the equivalent position of virtual_populations without the first row, has undefined input fuzzy_set, must be preset on F while T means the related population has undefined (at the moment) input fuzzy set. */
void fire_neural_subsystem(struct neural_subsystem *ns);
/* fires neural subsystem by firing its populations in the same order as written (pointers) in its vector firing_list */
/* teaching subsystem */
void create_learning_algorithms_inside_subsystem(struct neural_subsystem *ns, float learning_constant);
/* creates learning algorithm for all populations (and therefore all neurones) inside the subsystem with chosen learning constant */
/* also (creates and) fills vectors shared_inputs and output_is_shared when (the subsystem's) number_of_shared_inputs is less than zero */
void fire_learning_algorithms_inside_subsystem(struct neural_subsystem *ns);
/* fires learning algorithm for all populations (and therefore all neurones) inside the subsystem */
/* it (usually) doesn't include weights update */
/* also cares for the case some populations share the same input to enable each population to have original value while its learning is trigged and to have updated valu on the output if its output is shared */
/* at the end all inputs are set to updated (by firing learning) values */
void learning_algorithms_weights_correction_inside_subsystem(struct neural_subsystem *ns);
/* updates weights for all populations (and therefore all neurones) inside the subsystem */
void learning_algorithms_reset_weights_correction_inside_subsystem(struct neural_subsystem *ns);
/* reset weights correction for all populations (and therefore all neurones) inside the subsystem */
void delete_learning_algorithms_inside_subsystem(struct neural_subsystem *ns);
/* deletes learning algorithm for all populations (and therefore all neurones) inside the subsystem */
/* changes learning rate into already existing learning algorithm (includes changing of learning rate into consisted neuron learning algorithms) */
void change_subsystem_learning_rate(struct neural_subsystem *ns, float new_learning_rate);
/* functions that deal with neural_system */
neural_system *create_neural_system(struct chromosome *code, struct subsystem_tree **trees);
/* creates neural system together with filling tree structures inside the system (through calling required functions) and input fuzzy sets */
/* struct subsystem_tree **trees must consists subsystem trees of all subsystems inside the system in order from roots toward leaves. Opposite order is stored into the system's firing_list used for firing the subsystem. firing_list can be later manualy (or by an additional function) rearranged */
void fire_neural_system(struct neural_system *s);
/* fires neural system by firing its subsystems in the same order as written (pointers) in its vector firing_list */
float **finding_phantom_objects_inside_system(struct neural_system *s);
/* phantom objects are fuzzy objects inserted to present zero input when input window (local input field) gets out of the input fuzzy set (usually representing picture) */
/* returns vector of pointers on phantom objects' memberships, but the first value is not pointer but NUMBER OF PHANTOM OBJECTS' MEMBERSHIPS INSIDE THE POPULATION. So returned vector has number of pointers + 1 element */
void refreshing_phantom_objects(float **p);
/* seting all characteristics' membership values on 0.0 for all values pointed by the vector p */
/* the first element inside the vector p MUST BE number of pointers inside the vector. So vector p has number of pointers + 1 element */
/* teaching system */
void create_learning_algorithms_inside_system(struct neural_system *s, float learning_constant);
/* creates learning algorithm for all subsystems (and therefore all populations and all neurones) inside the system with chosen learning constant */
/* also (creates and) fills vectors shared_inputs and output_is_shared when (the system's) number_of_shared_inputs is less than zero */
void delete_neural_system(struct neural_system *head);
/* deletes neural system and releases its memory */
void fire_learning_algorithms_inside_system(struct neural_system *s);
/* fires learning algorithm for all subsystems (and therefore all populations and all neurones) inside the system */
/* it (usually) doesn't include weights update */
/* also cares for the case some subsystems share the same input to enable each subsystem to have original value while its learning is trigged and to have updated valu on the output if its output is shared */
/* at the end all inputs are set to updated (by firing learning) values */
void learning_algorithms_weights_correction_inside_system(struct neural_system *s);
/* updates weights for all subsystems (and therefore all populations and all neurones) inside the system */
void learning_algorithms_reset_weights_correction_inside_system(struct neural_system *s);
/* reset weights correction for all subsystems (and therefore all populations and all neurones) inside the subsystem */
void delete_learning_algorithms_inside_system(struct neural_system *s);
/* deletes learning algorithm for all subsystems (and therefore all populations and all neurones) inside the subsystem */
void change_system_learning_rate(struct neural_system *s, float new_learning_rate);
/* changes learning rate into already existing neural system's neural subsystems' populations' learning algorithm (includes changing of learning rate into consisted neuron learning algorithms) */
/* highest_difference_from_neighborns neuron functions */
neuron *create_highest_difference_from_neighborns(struct fuzzy_set *input);
/* create the neuron of highest_difference_from_neighborns type. Input fuzzy set (record) consists of (pointers on) fuzzy objects the first of them is the one whose the highest difference from neighborns is to be calculated while its neighborns follow. */
Level *first_Level_highest_difference_from_neighborns(struct fuzzy_set *input);
/* create first Level (and its nodes for highest_difference_from_neighborns neuron type. Objects from input fuzzy sets are pointed from the first object in pair with each other object for each nodes in order (1st node:1st & 2nd; 2nd node:1st & 3rd; 3rd node:1st & 4th; etc.);. Also if input fuzzy set's objects consist more than 1 characteristic characteristics are pointed in their order first from the first object than from its pair one by one zic-zac (1st object 1st characteristic, its pair object 1st characteristic, 1st object 2nd characteristic, its pair object 2nd characteristic, 1st object 3rd characteristic, its pair object 3rd characteristic, 1st object 4th characteristic, its pair object 4th characteristic, etc.);. OBJECTS are assumet to HAVE THE SAME NUMBER OF characteristics ! */
struct fuzzy_object *node_first_Level_highest_difference_from_neighborns(struct fuzzy_object *object1, struct fuzzy_object *object2);
/* creates node for 1st Level of highest_difference_from_neighborns neuron type. If objects consist more than 1 characteristic characteristics are pointed in their order first from the object1 than from object2 one by one zic-zac (object1 1st characteristic, object2 1st characteristic, object1 2nd characteristic, object2 2nd characteristic, object1 3rd characteristic, object2 3rd characteristic, object1 4th characteristic, object2 4th characteristic, etc.);. OBJECTS are assumet to HAVE THE SAME NUMBER OF characteristics ! */
void firing_highest_difference_from_neighborns(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. (First Level) node output function is pointed inside neuron's nucleide base while the last Level (only one) node output is its Maximal input. It means the function can deal with multi-layer (multi-Level) neurones whose last Level function is to find Maximum of the previous layer (Level) outputs. Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* corner_extractor neuron functions */
struct fuzzy_set **preparing_corner_extractor_neuron_population_neuron_inputs_through_window(neuron_population *np, int window_radius, int horisontal_resolution, int vertical_resolution);
/* Returns pointer on array of pointers on fuzzy sets (the same number of fuzzy sets as fuzzy objects in input fuzzy set). Prepares neuron population's neurones' input fuzzy sets from neuron population input fuzzy set presenting "picture" with dimension horisontal_resolution * vertical_resolution in a following way: each fuzzy object in neural population's input fuzzy set becomes the first fuzzy object in one and only one neuron's (inside the population) input fuzzy set, other fuzzy objects in input fuzzy set of a neuron (inside population) are fuzzy objects placed on the neuron population input "picture" inside window radius from the first object in the neuron's input (or better said placed inside square each side equal two times window radius=1 with center in the first object in neuron's input). It is similar as shifting square window (each side=2*window_radius) on the picture and inputing the central pixel as the first followed by other pixel inside window. If the window gets out of picture (means central pixel is on the edge) pixel out of picture are replaced with created fuzzy_object pointed with edge whose characteristics' memberships are all 0.0 and consists as many characteristics as input fuzzy_set's the first objects does. If neuron population has different number of neurones than its input fuzzy set unsucessful program termination is caused (exit_handling(3,1)) ! */
/* When returned array is used memory consisting data not necessary for future work should be liberate (using command testfree())! This usually means following: "for(i=0; inumber_of_neurones; testfree((char*)(*(head+i))->name), testfree((char*)(*(head+i))->objects), testfree((char*)*(head+i++))); testfree((char*)head);" after creating neuron population's neurones. */
neuron *create_corner_extractor(struct fuzzy_set *input);
/* create the neuron of corner_extractor type. Input fuzzy set (record) consists of (pointers on) fuzzy objects the first of them is the middle one in the window (dimension3*3) that is also supposed to be a peak of recognised corner while its neighborns follow. */
Level *first_Level_corner_extractor(struct fuzzy_set *input);
/* create first Level (and its nodes for corner_extractor neuron type. Objects from input fuzzy sets are pointed that each node has inputs presenting rotating angles of 45, 90, and 135 degrees with corner always in central pixel (the first 8 nodes) or straight line throught the central pixel (the last 4 nodes). Also if input fuzzy set's objects consist more than 1 characteristic characteristics are pointed in their order first from the first object than from its pairs one by one (1st object 1st characteristic, second object 1st characteristic, third object 1st characteristic, 1st object 2nd characteristic, second object 2nd characteristic, third object 2nd characteristic, 1st object 3rd characteristic, second object 3rd characteristic, third object 3rd characteristic, 1st object 4th characteristic, second object 4th characteristic, third object 4th characteristic, etc.). OBJECTS are assumed to HAVE THE SAME NUMBER OF characteristics ! */
struct fuzzy_object *node_first_Level_corner_extractor(int node_number, struct fuzzy_set *input);
/* creates node for 1st Level of corner_extractor neuron type. Objects from input fuzzy sets are pointed that each node has inputs presenting rotating angles of 45, 90, and 135 degrees with corner always in central pixel (the first 8 nodes) or straight line throught the central pixel (the last 4 nodes). If input fuzzy set's objects consist more than 1 characteristic characteristics are pointed in their order first from the first object than from its pairs one by one (1st object 1st characteristic, second object 1st characteristic, third object 1st characteristic, 1st object 2nd characteristic, second object 2nd characteristic, third object 2nd characteristic, 1st object 3rd characteristic, second object 3rd characteristic, third object 3rd characteristic, 1st object 4th characteristic, second object 4th characteristic, third object 4th characteristic, etc. OBJECTS are assumet to HAVE THE SAME NUMBER OF characteristics ! */
/* Note node_number is node's position inside the Level and can be 1..12, but not its (pointer) position inside vector nodes that is 0..11! In fact node_number=i+1, where i is node's (pointer) place inside vector nodes for the Level. */
void firing_corner_extractor(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. (First Level) node output function is pointed inside neuron's nucleide base while the one before the last Level (two) node(s) output is its Maximal input. The last Level node output is n=N1*(1-N2), where n is the last Level's node output, while N1 and N2 are its inputs (the one Level's ahead of the last one nodes outputs), that means the last Level output is product of first with complement of second the Level ahead the last one nodes' output. It means the function can deal with multi-layer (multi-Level) neurones whose the one ahead the last Level function is to find Maximums of the previous layer (Level) outputs and the last Level function is n=N1*(1-N2). Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* since there are 2 group of nodes in the first Level (8+4) each of them using different (linear) output function, the second group is marked (when calling linear node output function) with negative Level number that is Level=-1*Level */
float corner_extractor_last_Level_output(struct fuzzy_object *node);
/* node output is n=N1*(1-N2), where n is the last Level's node output, while N1 and N2 are its inputs. If there is more than 2 inputs into the node exit_handling(12,1) is called! */
/* sort2 neuron functions */
neuron *create_sort2(struct fuzzy_set *input);
/* create the neuron of sort2 type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics with associated one (the one having the same number of characteristics in input fuzzy set preceding as the node having the first Level nodes preceeding) placed first. The second Level nodes are receving inputs each from all the first Level nodes. Output fuzzy object consists as many characteristics as there are nodes in the second Level (= number of nodes in the first Level = number of input fuzzy set objects' characteristics). */
/* output presents input sorted into an order! */
float sort2_first_Level(struct fuzzy_object *node, int number_of_inputs);
/* node is pointer on the node in process, while number_of_inputs is number of inputs for the node (function could be rewritten without that input, it's only included because of the requirement for 2 input values into the function, however it saves some calculation time). Output is normalised position of the first input among others. It means number of inputs higher than the first one normalised by dividing with number of inputs. */
/* Note there is no multiplication of input and associated weight ! */
float sort2_second_Level(struct fuzzy_object *node, int node_position);
/* input into the node are all the first Level nodes' outputs. Output is input whose associated the first Level node's output (normalised value) is the highest one less or equal to normalised node position (node position/number of the first Level nodes) (number of the first Level nodes is half of number of the node's inputs). Associated input of a first Level's node is placed as its first (characteristic's) input. */
/* Note there is no multiplication of input and associated weight ! */
void firing_sort2(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. (First Level) node output function is "sort2_first_Level()" while the last (the second one) Level nodes output function is "sort2_second_Level()". Node output function is "unchanged_linear_node_output()". It means nothing is taken from the nucleotide base but the nucleotide base remains in function call because of compatibility (can be replaced in call with "0"). Of course function can later be changed to take node output function as well as either the first or the second Level linear function from the nucleotide base. */
/* number_of_corner_extractor neuron functions */
struct fuzzy_set **preparing_number_of_corner_extractor_neuron_population_neuron_inputs(neuron_population *np, int step, int lowest_number_of_corners, int highest_number_of_corners);
/* Returns pointer on array of pointers on fuzzy sets (the same number of fuzzy sets as fuzzy objects in input fuzzy set). Enables usage of common create neuron population function. For each neuron (inside the population) input fuzzy set is copied with its name equall to the number of corners possibility of is to be extracted. If neuron population has different number of neurones than its input fuzzy set unsucessful program termination is caused (exit(1)) ! */
/* NOTE: Each of output fuzzy sets' variable "name" is not used as a pointer, but as an integer variable! Instead of pointing toward lokacion consisting the name of the fuzzy set its value presents (NOT POINT ON) the number of corners possibility of is to be extracted!!!!!!! */
/* When returned array is used memory consisting data not necessary for future work should be liberate (using command testfree())! This usually means following: "for(i=0; inumber_of_neurones; testfree((char*)(*(head+i))->name), testfree((char*)(*(head+i))->objects), testfree((char*)*(head+i++))); testfree((char*)head);" after creating neuron population's neurones. */
/* int step, int lowest_number_of_corners, int highest_number_of_corners are use to describe whot number of corners is of interest to us. "lowest_number_of_corners" presents the begin of interval (the lowest number of corners of interest to us), "highest_number_of_corners" presents the end of the interval (the highest number of corners of interest to us), while "step" presents step for taking numbers inside the interval (step=1 means each number from the interval, step=2 means every second number from the interval, step=3 means every third number from the interval, etc.). If highest_number_of_corners!=lowest_number_of_corners+n*step, n is an integer, highest_number_of_corners is not taken into account means no neuron is being assigned to extract possibility for highest_number_of_corners number of corners ! */
/* in the function "create_neuron_population" call step is noted as window_radius, lowest_number_of_corners as horisontal_input_resolution, and highest_number_of_corners as vertical_input_resolution !!!!! */
/* input should be prepared by preprocessing throught "sort"NN */
neuron *create_number_of_corner_extractor(struct fuzzy_set *input);
/* create the neuron of number_of_corner_extractor type. Input fuzzy set consists in its variable (char*) "name" the number of corners possibility of is to be extracted. NOTE: Not pointer on the number but the number ITSELF !!!!! */
/* Neuron's name (and also neuron's output' characteristic's name) is not (char*) but its value is the number of corners possibility of is to be extracted. NOTE: Not pointer on the number but the number ITSELF !!!!! */
void firing_number_of_corner_extractor(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. The node output function is pointed inside neuron's nucleide base. Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* number_of_corner_extractor neuron is expected to have only one Level with only one node!! */
/* neuron's name (and also neuron's output' characteristic's name) is expected instead of being pointer onto char (as declared) but its (their) value(s) is (are) the number of corners possibility of is to be extracted. NOTE: Not pointer on the number but the number ITSELF !!!!! */
/* area_separator neuron functions */
struct fuzzy_set **preparing_area_separator_neuron_population_neuron_inputs(neuron_population *np, int window_radius, int horisontal_resolution, int vertical_resolution);
/* vector of fuzzy sets is formed with only 1 element, the neuron population input fuzzy set, while its first object's the first characteristic points "ahead" on new characteristic storing horisontal_resolution in membership and pointing "ahead" on new characteristic storing vertical_resolution in membership. The new characteristics are NOT causing shifting object's pointer "first on anyone of them. They should be deleted and "testfree" after reading horisontal and vertical resolution from them, and pointer "ahead" of the object's the first characteristic restored on 0. */
/* int window_radius is not of use here and are kept as input only because of compatibility */
neuron *create_area_separator(struct fuzzy_set *input);
/* create the neuron of area_separator type. The first Level's nodes are receiving input from one (each from its own/assigned characteristic) input fuzzy set objects' characteristics followed by neighbouring nodes (all 8 of them) outputs. The second Level nodes are receving inputs each from the first Level node on the same position followed by its (the first layer node's) neighbouring nodes (all 8 of them) outputs. Output fuzzy object consists as many characteristics as there are nodes in the second Level (= number of nodes in the first Level = number of input fuzzy set objects' characteristics). */
/* after reading horisontal and vertical resolution the 2 characteristics pointed by the first object's first characteristic pointer ahead are deleted and space is "testfree", while pointer "ahead" of the object's the first characteristic is restored on 0. */
float area_separator_all_Levels(struct fuzzy_object *node, int Level_number);
/* calculates node output for neuron of area separator type. For the first Level constants threshold and alpha are preset during declaration. */
void firing_area_separator(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. The node output (non-linearising) function is pointed inside neuron's nucleide base and is applied only on the second Level's nodes (NODE OUTPUT non-linearising FUNCTION IS NOT APPLIED ON THE FIRST LEVEL'S NODES!), while node linear output function is "area_separator_all_Levels" (without checking is the same pointed inside nucleotide base). Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* area_separator neuron is expected to have 2 Levels each with the same numbers of nodes as pixels on the screen!! */
/* the first Level's nodes are run until their output is converged, means ASE (average square error) is less or equall to preset ASElimit */
/* area_without_edges_separator neuron functions */
neuron *create_area_without_edges_separator(struct fuzzy_set *input);
/* create the neuron of area_without_edges_separator type. The first Level's nodes are receiving input from one (each from its own/assigned characteristic) input fuzzy set objects' characteristics followed by neighbouring nodes (all 8 of them) outputs. The second Level nodes are receving inputs each from the first Level node on the same position (excluding nodes on the picture's edge) followed by its (the first layer node's) neighbouring nodes (all 8 of them, but excluding nodes on the edge of the picture) outputs. Output fuzzy object consists as many characteristics as there are nodes in the second Level (= number of input fuzzy set objects' characteristics excluding edges of the input picture). */
/* after reading horisontal and vertical resolution the 2 characteristics pointed by the first object's first characteristic pointer ahead are deleted and space is "testfree", while pointer "ahead" of the object's the first characteristic is restored on 0. */
/* IMPORTANT: THIS IS ONLY FOR INPUT WITH ONLY ONE CHARACTERISTIC PER FUZZY OBJECT !!!!! If there is more than one characteristic per fuzzy object, only first Level (corner and edges neighboors connecting) creation should be changed! Everything else is OK! */
float area_without_edges_separator_all_Levels(struct fuzzy_object *node, int Level_number);
/* calculates node output for neuron of area separator type. For the first Level constants threshold and alpha are preset during declaration. */
void firing_area_without_edges_separator(neuron *head, nucleotide_base *code);
/* calculate processing of input through neuron onto output. The node output (non-linearising) function is pointed inside neuron's nucleide base and is applied only on the second Level's nodes (NODE OUTPUT non-linearising FUNCTION IS NOT APPLIED ON THE FIRST LEVEL'S NODES!), while node linear output function is "area_without_edges_separator_all_Levels" (without checking is the same pointed inside nucleotide base). Common/extern float treasureholdadd variable is used for defining treasurehold and can be set using function "void treasurehold_set(float new_treasurehold)" prior to the function executing. */
/* area_without_edges_separator neuron is expected to have 2 Levels each with the same numbers of nodes as pixels on the screen!! */
/* the first Level's nodes are run until their output is converged, means ASE (average square error) is less or equall to preset ASElimit */
/* FCNN_2L neuron functions */
neuron *create_FCNN_2L(struct fuzzy_set *input);
/* create the neuron of FCNN_2L type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. Output fuzzy object consists as many characteristics as there are nodes in the second Level (= number of nodes in the first Level = number of input fuzzy set objects' characteristics). */
/* FCNN_3L neuron functions */
neuron *create_FCNN_3L(struct fuzzy_set *input);
/* create the neuron of FCNN_3L type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. The third Level nodes are receving inputs each from all the second Level nodes. Output fuzzy object consists as many characteristics as there are nodes in the third Level (= number of nodes in the second Level = number of nodes in the first Level = number of input fuzzy set objects' characteristics). */
/* FCNN_4L neuron functions */
neuron *create_FCNN_4L(struct fuzzy_set *input);
/* create the neuron of FCNN_4L type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. The third Level nodes are receving inputs each from all the second Level nodes. The fourth Level nodes are receving inputs each from all the third Level nodes. Output fuzzy object consists as many characteristics as there are nodes in the fourth Level (= number of nodes in the third Level = number of nodes in the second Level = number of nodes in the first Level = number of input fuzzy set objects' characteristics). */
/* FCNN_5L neuron functions */
neuron *create_FCNN_5L(struct fuzzy_set *input);
/* create the neuron of FCNN_5L type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. The third Level nodes are receving inputs each from all the second Level nodes. The fourth Level nodes are receving inputs each from all the third Level nodes. The fifth Level nodes are receving inputs each from all the fourth Level nodes. Output fuzzy object consists as many characteristics as there are nodes in the fifth Level (= number of nodes in the fourth Level = number of nodes in the third Level = number of nodes in the second Level = number of nodes in the first Level = number of input fuzzy set objects' characteristics). */
/* FCNN_2L_1out neuron functions */
neuron *create_FCNN_2L_1out(struct fuzzy_set *input);
/* create the neuron of FCNN_2L_1out type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. Output fuzzy object consists just one characteristics as there are nodes in the second Level, while number of nodes per Level linearly decreases from the first Level (the same number of nodes as input fuzzy set characteristics) toward the last one (only one characteristic). */
/* FCNN_3L_1out neuron functions */
neuron *create_FCNN_3L_1out(struct fuzzy_set *input);
/* create the neuron of FCNN_3L_1out type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. The third Level nodes are receving inputs each from all the second Level nodes. Output fuzzy object consists just one characteristics as there are nodes in the third Level, while number of nodes per Level linearly decreases from the first Level (the same number of nodes as input fuzzy set characteristics) toward the last one (only one characteristic). */
/* FCNN_4L_1out neuron functions */
neuron *create_FCNN_4L_1out(struct fuzzy_set *input);
/* create the neuron of FCNN_4L_1out type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. The third Level nodes are receving inputs each from all the second Level nodes. The fifth Level nodes are receving inputs each from all the third Level nodes. Output fuzzy object consists just one characteristics as there are nodes in the fourth Level, while number of nodes per Level linearly decreases from the first Level (the same number of nodes as input fuzzy set characteristics) toward the last one (only one characteristic). */
/* FCNN_5L_1out neuron functions */
neuron *create_FCNN_5L_1out(struct fuzzy_set *input);
/* create the neuron of FCNN_5L_1out type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to all nodes). The second Level nodes are receving inputs each from all the first Level nodes. The third Level nodes are receving inputs each from all the second Level nodes. The fourth Level nodes are receving inputs each from all the third Level nodes. The fifth Level nodes are receving inputs each from all the fourth Level nodes. Output fuzzy object consists just one characteristics as there are nodes in the fifth Level, while number of nodes per Level linearly decreases from the first Level (the same number of nodes as input fuzzy set characteristics) toward the last one (only one characteristic). */
/* FCNN_2L_FBALL_11 neuron functions*/
neuron *create_FCNN_2L_FBALL_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_11 type */
/* FCNN_2L_FBALL_22 neuron functions*/
neuron *create_FCNN_2L_FBALL_22(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_22 type */
/* FCNN_2L_FBALL_21 neuron functions*/
neuron *create_FCNN_2L_FBALL_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_21 type */
/* FCNN_2L_FBALL_22_11 neuron functions*/
neuron *create_FCNN_2L_FBALL_22_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_22_11 type */
/* FCNN_2L_FBALL_21_11 neuron functions*/
neuron *create_FCNN_2L_FBALL_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_21_11 type */
/* FCNN_2L_FBALL_22_21 neuron functions*/
neuron *create_FCNN_2L_FBALL_22_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_22_21 type */
/* FCNN_2L_FBALL_22_21_11 neuron functions*/
neuron *create_FCNN_2L_FBALL_22_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FBALL_22_21_11 type */
/* FCNN_2L_1out_FBALL_11 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_11 type */
/* FCNN_2L_1out_FBALL_22 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_22(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_22 type */
/* FCNN_2L_1out_FBALL_21 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_21 type */
/* FCNN_2L_1out_FBALL_22_11 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_22_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_22_11 type */
/* FCNN_2L_1out_FBALL_22_21 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_22_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_22_21 type */
/* FCNN_2L_1out_FBALL_21_11 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_21_11 type */
/* FCNN_2L_1out_FBALL_22_21_11 neuron functions*/
neuron *create_FCNN_2L_1out_FBALL_22_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FBALL_22_21_11 type */
/* FCNN_2L_FB1_11 neuron functions*/
neuron *create_FCNN_2L_FB1_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_11 type */
/* FCNN_2L_FB1_22 neuron functions*/
neuron *create_FCNN_2L_FB1_22(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_22 type */
/* FCNN_2L_FB1_21 neuron functions*/
neuron *create_FCNN_2L_FB1_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_21 type */
/* FCNN_2L_FB1_22_11 neuron functions*/
neuron *create_FCNN_2L_FB1_22_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_22_11 type */
/* FCNN_2L_FB1_21_11 neuron functions*/
neuron *create_FCNN_2L_FB1_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_21_11 type */
/* FCNN_2L_FB1_22_21 neuron functions*/
neuron *create_FCNN_2L_FB1_22_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_22_21 type */
/* FCNN_2L_FB1_22_21_11 neuron functions*/
neuron *create_FCNN_2L_FB1_22_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_FB1_22_21_11 type */
/* FCNN_2L_1out_FB1_11 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_11 type */
/* FCNN_2L_1out_FB1_22 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_22(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_22 type */
/* FCNN_2L_1out_FB1_21 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_21 type */
/* FCNN_2L_1out_FB1_22_11 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_22_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_22_11 type */
/* FCNN_2L_1out_FB1_22_21 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_22_21(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_22_21 type */
/* FCNN_2L_1out_FB1_21_11 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_21_11 type */
/* FCNN_2L_1out_FB1_22_21_11 neuron functions*/
neuron *create_FCNN_2L_1out_FB1_22_21_11(struct fuzzy_set *input);
/* creates neuron of FCNN_2L_1out_FB1_22_21_11 type */
/* CONVOLUTIONAL NEURON functions */
struct fuzzy_set **preparing_neuron_population_input_by_preserving_spatial_neighborhood_for_convolutional_layer_neuron(neuron_population *np, int square_window_side_lenght, int horisontal_resolution, int overlaping_in_each_dimension);
/* Returns pointer on array of pointers on fuzzy sets each consisting fuzzy objects inside squared window of given size (int square_window_side_lenght), while step of window moving is the same in both direction (int overlaping_in_each_dimension). Window is moved "from left to right" (lower to higher) "row by row". */
/* Spatial neighborhood is preserved by treating all inputs on the same place inside input sets (leaf_population's output fuzzy sets forming input fuzzy set) as one from the window point of view. It means the input is considered as 3D set where input sets are placed parallely along the third dimension while window is moved just over the first set and together with each element from the first set it takes all elements on the same position through the 3rd dimension */
/* window of the size 1x1 will collect np->number_of_leaf_populations inputs, of the size 2x2 will collect 4*np->number_of_leaf_populations inputs, etc. */
/* The input picture is considered as (horisontal_resolution/np->number_of_leaf_populations)*vertical_resolution, and therefore the input sets must be organised (chained) through the horisontal dimension */
/* ALL INPUT FUZZY SETS (consisted in the np->input fuzzy set) ARE EXPECTED TO HAVE THE SAME NUMBER OF FUZZY OBJECTS nr, so np->input->number_of_objects=nr*np->number_of_leaf_populations. */
/* The picture is divided in that way that its corner pixels belong only to one window, but must belong to a window. That causes that sometimes right or bottom edge windows getting out of the picture. */
/* If the rightest column or the lowest row windows are getting out of the picture they consist the same number of fuzzy objects - fuzzy objects outside the picture are with zero membership and the same structure as the top left fuzzy object on the picture */
/* When returned array is used memory consisting data not necessary for future work should be liberate (using command free())! This usually means following: "for(i=0; inumber_of_neurones; free((char*)(*(head+i))->name), free((char*)(*(head+i))->objects), free((char*)*(head+i++))); free((char*)head);" after creating neuron population's neurones. */
struct fuzzy_set **preparing_neuron_population_input_for_convolutional_layer_neuron(neuron_population *np, int square_window_side_lenght, int horisontal_resolution, int overlaping_in_each_dimension);
/* Returns pointer on array of pointers on fuzzy sets each consisting fuzzy objects inside squared window of given size (int square_window_side_lenght), while step of window moving is the same in both direction (int overlaping_in_each_dimension). Window is moved "from left to right" (lower to higher) "row by row". */
/* Prepares neuron population's neurones' input fuzzy sets from neuron population input fuzzy set presenting "picture" with dimension horisontal_resolution * vertical_resolution (calculated from number of objects in input fuzzy set and horisontal_dimension). It is similar as dividing the picture on square windows that overlaping. */
/* The picture is divided in that way that its corner pixels belong only to one window, but must belong to a window. That causes that sometimes right or bottom edge windows getting out of the picture. */
/* If the rightest column or the lowest row windows are getting out of the picture they consist the same number of fuzzy objects - fuzzy objects outside the picture are with zero membership and the same structure as the top left fuzzy object on the picture */
/* When returned array is used memory consisting data not necessary for future work should be liberate (using command testfree())! This usually means following: "for(i=0; inumber_of_neurones; testfree((char*)(*(head+i))->name), testfree((char*)(*(head+i))->objects), testfree((char*)*(head+i++))); testfree((char*)head);" after creating neuron population's neurones. */
neuron_population *create_convolutional_layer_neuron_population_from_nucleotide_base(nucleotide_base *code, struct fuzzy_set *input);
/* creates convolutional layer neuron population, presenting feature map, from nucleotide base and input fuzzy set */
/* RBF */
float RBF_exp(struct fuzzy_object *node, int Level_number);
/* RBF_exp=exp(-(1/2)sum(squared difference between each input and its weight)) */
/* although already designed RBF descriptor expects neuron to have only 1 layer, this function deals also with multilayer neurones for the purpose of future compatibility */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
/* entropy */
float entropy_Deluce_Termini(struct fuzzy_object *node, int Level_number);
/* entropy_Deluce_Termini=-(1/(n*ln(2)))*SUM(w(j)*input(j)*ln(input(j))). If pure entropy wants to be calculated than must be w(j)=1 for each j; otherwise the result is a biased/weighted measure/indication of Deluce and Termini entropy */
/* output is (when weights are different from 1) a biased/weighted measire/indication of Deluce and Termini entropy */
/* this function deals also with multilayer neurones */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
/* defining Reyni's entropy parameter alpha and presetting on 0.9 */
/* alpha MUST BE POSITIVE BUT NOT 1.0 (usually between 0 and 1) */
extern float Reyni_alpha;
float entropy_Reyni(struct fuzzy_object *node, int Level_number);
/* entropy_Reyni(alpha)=(1/(1-alpha))*ln(SUM(w(j)*(input(j)^alpha))). If pure entropy wants to be calculated than must be w(j)=1 for each j; otherwise the result is a biased/weighted measure/indication of Deluce and Termini entropy */
/* output is (when weights are different from 1) a biased/weighted measure/indication of Reyni entropy */
/* this function deals also with multilayer neurones */
/* Reyni's constant alpha MUST BE POSITIVE BUT NOT 1.0 (usually between 0 and 1) */
/* alpha is stored into extern float Reyni_alpha preset on 0.9 */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
/* ART2 functions */
/* setting up ART2 descriptor */
/* neuron_type_descriptor* setup_ART2_descriptor() sets up neuron_type_descriptor for ART2(Adaptive Resonance Theory) class of neurones according G.A. Carpenter and S. Grossberg, ART 2: self-organization of stable category recognition codes for analog input patterns, in G.A. Carpenter and S. Grossberg, Pattern recognition by self-organizing neural networks, The MIT Press, London, 1991, pp. 397-423 */
neuron_type_descriptor* setup_ART2_descriptor();
neuron *create_ART2(struct fuzzy_set *input);
/* creates an ART2 system with parameters as written and returns pointer on it as pointer onto type neuron */
/* LOOK OUT: THIS FUNCTION HASN'T BEEN TESTED!!!! It exists only because of compatibility and for future interfaces. */
ART2 *construct_ART2(float ro, float theta, float a, float b, float d, int n, struct fuzzy_set *input, int fx);
/* constructs and initialise ART2 system with given parameters */
/* ro is vigilance, theta is the threshold (in function f(x)), a, b, and d are ART2 parameters, n is number of output classes (n=N-M), *input is pointer on the input fuzzy set, and fx notices what kind of f(x) function is used: fx=0 ==> piecewise_linear_fx , fx=1 ==> continuously_differentiable_fx */
float piecewise_linear_fx(float x, float theta);
/* calculates piecewise linear function between 0 and 1 */
/* piecewise_linear_fx(x,theta)={ 0 if xname; means how many corner possibility is to be calculated) inputs while increase (decrease) others. */
/* BP_NCE_without_learning_algorithm is similar to BP_without_learning_algorithm and specialised for "number of corner extractor" neuron type only */
/* BP_NCE_without_learning_algorithm just copy changes from neurones output fuzzy object onto neurone's input fuzzy set when it presents other neurone's (or neuron population's or ...) output. */
/* It is proposed for use with "number of corner extractor" type of neurones (not proposed to learn) enabling him to be a part of biger neural configuration teached using BP algorithm */
/* setting up BP_AS_without_learning_algorithm */
neuron_learning_algorithm *BP_AS_without_learning_algorithm_setup(nucleotide_base *code, neuron *nn, float learning_rate);
/* BP_AS_without_learning_algorithm_setup() forms and fills structure neuron_learning_algorithm and without setting correction weights on 0.0 - infact correction weights doesn't exist. "code" is pointer on the nucleotide base used to generate the neuron "nn" is pointer on neuron BP algorithm is going to be applied on, "learning_rate" is constant used to (multiplied with the difference between actual and expected neuron output) decrease (increase) inputs in the case it is another neurone's (or higher structure's) output. */
/* BP_AS_without_learning_algorithm is similar to BP_without_learning_algorithm and specialised for "area separator" neuron type only */
/* BP_AS_without_learning_algorithm just copy changes from neurones output fuzzy object onto neurone's input fuzzy set when it presents other neurone's (or neuron population's or ...) output. */
/* It is proposed for use with "area separator" type of neurones (not proposed to learn) enabling him to be a part of biger neural configuration teached using BP algorithm */
/* BP_neuron_learning_algorithm functions */
void firing_BP(neuron_learning_algorithm *memory);
/* firing_BP() performs a cycle of calculation of all neuron's weights correction (only calculate corrections but DOESN'T change any weight) according the neuron output value */
/* neuron output (fuzzy object characteristics) must have expected values (right values NOT its previous output) since its the last Level remember its previous output */
/* neuron input IS CHANGED to expected values (previous input- learning_rate * sum(calculated derivation of the input value according each the first Level node receiving input from the input characteristic)) EXCEPT in the case input IS PICTURE (means not a neuron output) */
/* NOTE: firing_BP() doesn't correct weights. To do so one needs to call function BP_weight_correction() after. */
/* Used BackPropagation algorithm is from IEEE "Neural Networks Theoretical Foundations and Analysis", pp.211-221, article "Backpropagation Through Time: What It Does and How to Do It" by P.J. Werbos */
void reset_weights_correction(neuron_learning_algorithm *head);
/* reset_weights_correction() only resets weight corrections for each weight on 0.0 without affecting anything else. */
void delete_neuron_learning_algorithm(neuron_learning_algorithm *head);
/* delete_neuron_learning_algorithm() deletes neuron_learning_algorithm pointed by "*head" but not neuron pointed by its element 'neuron* network'. "*head" is pointer on structure neuron_learning_algorithm to be deleted. */
void BP_weights_correction_without_limits(neuron_learning_algorithm *memory);
/* BP_weights_correction_without_limits() unlike BP_weights_correction() allows (corrected) weights to get out of interval (-1,1) */
/* BP_weight_correction() changes weight of neuron pointed in structure neuron_learning_algorithm. "*memory" points on structure neuron_learning_algorithm consists information of neuron whose weights will be updated as well as information of weights update and learning coefficient (learning_rate). */
/* NOTE: BP_weight_correction() doesn't reset weights correction on 0.0. To perform that one needs to call function reset_weights_correction() after this function. */
void BP_weights_correction(neuron_learning_algorithm *memory);
/* BP_weight_correction() changes weight of neuron pointed in structure neuron_learning_algorithm. "*memory" points on structure neuron_learning_algorithm consists information of neuron whose weights will be updated as well as information of weights update and learning coefficient (learning_rate). */
/* NOTE: BP_weight_correction() doesn't reset weights correction on 0.0. To perform that one needs to call function reset_weights_correction() after this function. */
/* updated weights are limited inside real range [-1.0, 1.0] */
void BP_weights_correction10(neuron_learning_algorithm *memory);
/* BP_weight_correction() changes weight of neuron pointed in structure neuron_learning_algorithm. "*memory" points on structure neuron_learning_algorithm consists information of neuron whose weights will be updated as well as information of weights update and learning coefficient (learning_rate). */
/* NOTE: BP_weight_correction() doesn't reset weights correction on 0.0. To perform that one needs to call function reset_weights_correction() after this function. */
/* updated weights are limited inside real range [-10.0, 10.0] */
/* weight_shaking_learning_algorithm functions */
void firing_weight_shaking(neuron_learning_algorithm *memory);
/* firing_weight_shaking() performs a cycle of weight shaking and fires neuron and in the case new output is closer (or equally close as old output) to the targeted one new weights are permanently stored, otherwise old weights are restored. Targeted output is given by setting up the neuron output value */
/* neuron output (fuzzy object characteristics) must have expected values (right values NOT its previous output) since its the last Level remember its previous output */
/* neuron input IS NOT CHANGED to expected values */
/* weight shaking means randomly incrementing/decrementing each weight by no more than learning rate. It menas old_weight-learning_rate=name; means how many corner possibility is to be calculated) inputs are decreased (increased) by the product of learning constant and difference between actual and expected neuron output, while other inputs are increased (decreased) */
/* neuron input IS CHANGED EXCEPT in the case input IS PICTURE (means not a neuron output) */
void delete_BP_NCE_without_learning_algorithm(neuron_learning_algorithm *head);
/* delete_BP_NCE_without_learning_algorithm() deletes neuron_learning_algorithm pointed by "*head" but not neuron pointed by its element 'neuron* nn'. "*head" is pointer on structure neuron_learning_algorithm to be deleted. */
/* BP_AS_without_learning_algorithm functions */
void firing_BP_AS_without_learning(neuron_learning_algorithm *memory);
/* firing_BP_AS_without_learning() maps changes from neurone's output onto its input in order to enable "area separator" type of neurones (not proposed for learning) to be a part of larger BackPropagation trained neural structure */
/* neuron output (fuzzy object characteristics) must have expected values (right values NOT its previous output) since its the last Level remember its previous output */
/* neuron input (each characteristic) is decreased by product of learning_rate and difference of associated neuron output value (2nd Level node's output) and expected value (output characteristic) */
/* neuron input IS CHANGED EXCEPT in the case input IS PICTURE (means not a neuron output) */
void delete_BP_AS_without_learning_algorithm(neuron_learning_algorithm *head);
/* delete_BP_AS_without_learning_algorithm() deletes neuron_learning_algorithm pointed by "*head" but not neuron pointed by its element 'neuron* nn'. "*head" is pointer on structure neuron_learning_algorithm to be deleted. */
/* convolutional layer feature map learning algorithms functions */
void equilize_weights_for_convolutional_layer_neuron_population(neuron_population *np);
/* set all neurones, inside the neuron population, weights the same as of the first neuron in the population */
void fire_convolutional_layer_feature_map_learning_algorithm(learning_algorithm *head);
/* fire_convolutional_layer_feature_map_learning_algorithm() fires neuron learning algorithm functions for just the first neurone in the population */
void convolutional_layer_feature_map_learning_algorithm_weights_correction(learning_algorithm *head);
/* learning_convolutional_layer_feature_map_algorithm_weights_correction() update weights (fires weights correction functions) for all neurones in the population by correcting the first neuron's weights and replicating them on other neurones in the population */
void convolutional_layer_feature_map_learning_algorithm_reset_weights_correction(learning_algorithm *head);
/* convolutional_layer_feature_map_learning_algorithm_reset_weights_correction() resets weight corrections (fires reset weights correction functions) for the first neurone in the population */
void delete_convolutional_layer_feature_map_learning_algorithm(learning_algorithm *head);
/* delete_convolutional_layer_feature_map_learning_algorithm() delete's learning algorithm structure together with the first neuron learning algorithm structure it points on (neuron learning structures for the first neurone inside the neural population) */
/* PRINTING WEIGHTS */
void print_node_weights(struct fuzzy_object *node, FILE *fn);
/* print weights of the node into the file fn, weights are separated with commas */
void print_layer_weights(Level *layer, FILE *fn);
/* print weights of the layer into the file fn, nodes are separated with ",," (except the first one that hasn't the first comma) where BR is node's order number inside the layer */
void print_neuron_weights(neuron *nn, FILE *fn);
/* print weights of the neuron into the file fn, layers are separated with new line (CR) (except the first one) and "," where BR is layer's order number inside the neuron */
void print_neuron_population_weights(neuron_population *np, FILE *fn);
/* print weights of the neurones, inside the population, into the file fn, neurones are separated with two new lines (CR) (except the first one) and "," where BR is neuron's order number inside the neuron_population */
/* in the case when the population's code (nucleotide base) element create_population_learning_algorithm=create_convolutional_layer_feature_map_learning_algorithm only the first neuron's weights are printed led only with "," */
void print_neural_subsystem_weights(neural_subsystem *ns, FILE *fn);
/* print weights of the neurones, inside the subsystem, into the file fn, neuron_populations are separated with two new lines (CR) (except the first one) and "," where BR is neuron_population's nucleotide_base's identification number */
/* neuron_populations, inside the subsystem, are printed in the same order as inside the subsystem's firing_list */
void print_neural_system_weights(neural_system *n, FILE *fn);
/* print weights of the neurones, inside the system, into the file fn, neural_subsystems are separated with two new lines (CR) (except the first one) and "," where BR is neural_subsystem's gene's identification number */
/* neural_subsystems, inside the system, are printed in the same order as inside the system's firing_list */
/* FUNCTIONS FOR READING DIFFERENT GRAPHIC FORMATS */
float *read_bitmap(char *fname);
/* float *read_bitmap(char *fname) reads file (whose name is pointed by fname) made by UNIX program "bitmap", forms float vector with dimension width*height+2, and return pointer on the vector. The first 2 elements of the vector are (float)width and (float)height, respectly. "width" presents horisontal picture resolution, while "height" vertical. */
/* All comments on this library are welcome. Feel testfree to contact author if there is anything you would like or you need to be added or anything you suggest to change.
This library is for use only in education and research. It is not for commercial use! Written permission from author is necessary for commercial use or for inclusion as a part of project or program or another library!
Programs, projects, libraries or anything consists this library or its part MUST NOT be sold without author permission!
Author: Dekovich Igor,
ph: (-61) (2) 4225 2673,
mobile: (-61) 042 189 69 84
e-mail: idekovich@yahoo.com*/
/* Split 1994 & Auckland 1995/96/97 */
/* Auckland 26/10/96 */
/* last revision 15/10/97 */
/* setting up each_with_last descriptor */
/* neuron_type_descriptor* setup_each_with_last_descriptor() sets up neuron_type_descriptor for each_with_last class of neurones */
/* each_with_last has 1 output less than inputs, 1 layer and each output is combination (according used node_linear_output and node_output functions) of input fuzzy objects on the same position and the last input (e.g. n-th output is a combination of n-th input fuzzy object with the last one) */
neuron_type_descriptor* setup_each_with_last_descriptor();
neuron *create_each_with_last(struct fuzzy_set *input);
/* create the neuron of each_with_last with only 1 layer and number_of_input_fuzzy_objects - 1 characteristic in the output fuzzy object (and the same number of nodes in the first and only layer/Level). The first Level's nodes are receiving input each from related input (first from the first input fuzzy_object, second from the second input fuzzy_object, and so on) and from the last of all input fuzzy set objects' (all characteristics to one node). Output fuzzy object consists number_of_input_fuzzy_objects -1 one characteristics as there are nodes in the first and only Level. */
neuron *create_each_with_last_fixed_weights(struct fuzzy_set *input);
/* create the neuron of FCNN with only 1 layer and only 1 characteristic in the output fuzzy object type. The first Level's nodes are receiving input from all input fuzzy set objects' characteristics (all characteristics to one node). Output fuzzy object consists just one characteristics as there are nodes in the first and only Level. */
/* all weights are preset on the value stored in extern float fixed_weight */
float sum_of_all_times_exponent_of_last_weighted_inputs(struct fuzzy_object *node, int Level_number);
/* sum of all but the last inputs multiplied each with its weight (membership of pointer onto the input) is multiplied with the exponent (e^) of the last weighted (weight is membership of pointer onto the input) input and returned. */
/* value "int Level_number" has meaning to distinguist the first Level from other Levels */
/* setting up BP_sum_of_all_times_exponent_of_last_weighted_inputs_neuron_learning_algorithm */
neuron_learning_algorithm *BP_sum_of_all_times_exponent_of_last_weighted_inputs_neuron_learning_algorithm_setup(nucleotide_base *code, neuron *nn, float learning_rate);
/* *BP_sum_of_all_times_exponent_of_last_weighted_inputs_neuron_learning_algorithm__setup() forms and fills structure neuron_learning_algorithm and setting correction weights on 0.0. "code" is pointer on the nucleotide base used to generate the neuron "nn" is pointer on neuron BP algorithm is going to be applied on, "learning_rate" is coefficient of learning in BP algorithm. */
/* BP_sum_of_all_times_exponent_of_last_weighted_inputs_neuron_learning_algorithm functions */
void firing_BP_sum_of_all_times_exponent_of_last_weighted_inputs(neuron_learning_algorithm *memory);
/* firing_BP_sum_of_all_times_exponent_of_last_weighted_inputs() performs a cycle of calculation of all neuron's weights correction (only calculate corrections but DOESN'T change any weight) according the neuron output value */
/* neuron output (fuzzy object characteristics) must have expected values (right values NOT its previous output) since its the last Level remember its previous output */
/* neuron input IS CHANGED to expected values (previous input- learning_rate * sum(calculated derivation of the input value according each the first Level node receiving input from the input characteristic)) (EXCEPT in the case input IS PICTURE (means not a neuron output) - DISABLED - INPUT FUZZY SET'S MEMBERSHIPS ARE ALWAYS CHANGED!) */
/* NOTE: firing_BP_sum_of_all_times_exponent_of_last_weighted_inputs() doesn't correct weights. To do so one needs to call function BP_weight_correction() after. */
/* Used BackPropagation algorithm is from IEEE "Neural Networks Theoretical Foundations and Analysis", pp.211-221, article "Backpropagation Through Time: What It Does and How to Do It" by P.J. Werbos */
void fire_BP_sum_of_all_times_exponent_of_last_weighted_inputs_neuron(neuron_learning_algorithm *memory);
/* fire_BP_sum_of_all_times_exponent_of_last_weighted_inputs() performs a cycle of calculation of all neuron's weights correction (only calculate corrections but DOESN'T change any weight) according the neuron output value */
/* neuron output (fuzzy object characteristics) must have expected values (right values NOT its previous output) since its the last Level remember its previous output */
/* neuron input IS CHANGED to expected values (previous input- learning_rate * sum(calculated derivation of the input value according each the first Level node receiving input from the input characteristic)) (EXCEPT in the case input IS PICTURE (means not a neuron output) - DISABLED - INPUT FUZZY SET'S MEMBERSHIPS ARE ALWAYS CHANGED!) */
/* NOTE: fire_BP_sum_of_all_times_exponent_of_last_weighted_inputs() doesn't correct weights. To do so one needs to call function BP_weight_correction() after. */
/* Used BackPropagation algorithm is from IEEE "Neural Networks Theoretical Foundations and Analysis", pp.211-221, article "Backpropagation Through Time: What It Does and How to Do It" by P.J. Werbos */
#ifdef __cplusplus
}
#endif
#endif