libfann / fann

Official github repository for Fast Artificial Neural Network Library (FANN)
GNU Lesser General Public License v2.1
1.59k stars 380 forks source link

Possible solution for Sparse network see also #67 #136

Open mkostrun opened 1 year ago

mkostrun commented 1 year ago

From my previous work on fann-like libraries it would be beneficial to associate with weights an array "is_mutable". In case if a certain weight is set to, say, zero, and its is_mutable set to zero, as well, then during optimization this weight stays immutable, that is, fixed to its initial value. I did a fork of fann for rlabplus, that implements this mechanics, and if you want we could merge it with current fann.

mkostrun commented 1 year ago

I am following up with my past self: Other benefit of having immutable flag for each weight is that then the cascade/shortcut network as needing specialized treatment, become unnecessary. By adding to each layer past the input one a number of linear nodes, where the number of nodes is equal to the sum of the outputs of all previous layers; then setting the weights of these additional nodes to [1,0,0,0] and so forth; and then making them immutable; one creates an equivalent structure to the shortcut network. In other words, the shortcut network is just a special case of a general feed-forward network, where certain weights are fixed, so it doesn't need special treatment. However, for this to work one needs immutable flag for the weight and bias arrays, as proposed in my first post.