nn22 is a small and basic NN framework that was built having the following criteria in mind.
- Function as a close-to all purpose NN framework allowing to define a NN with: a. as many layers as you want, b. as many neurons per layer as you want, c. the activation function per layer that you want, d. the ability to feed back as many delayed outputs as you want, e. the ability to delay the input vector as many times... f. ...and other stuff, and do so in an easy way.
- To have its main functions logically separated and uncluttered so that the may be modified at will and easily understood.
- To have all source code available at plain sight, nothing hidden inside an obscure library.
- The possibility to insert 'keyboard;' breaks at any point of the code so that all variables and functions behavior can be evaluated through 'who' and commands alike.
- To be able to run in both Octave and Matlab.
- To serve a didactic purpose.
- It is not a full featured NN framework.
- It is not fast.
- It is not intended to work as a commercial product does.
- It is not even intended to pair other open source frameworks available that are indeed fast and provide good results.
- ...and this renders the previous stated objective: it has a didactic purpose. And just that :)
- There is a specialization course taught by Dr. Eng. Daniel Patino at the INAUT institute, Universidad Nacional de San Juan, Argentina, called "Neural Networks Applied to System's Identification and Control" ("Redes Neuronales Aplicadas a la Identificacion y Control de Sistemas") and belongs to INAUT's MSc and PhD programs.
- The author of this code (that would be me, Alejandro) attended professor Patino's classes.
- One of the course's assignments was to build simple NN solutions for the AND, XOR, SINE, FIR and other problems, including a multi-input multi-output non-linear dynamic system's identification, ...yes, true, that one is not that simple.
- The author of the code got engaged and did an extra mile, for the sake of machine learning coding joyfulness, sort of ;)
- To serve as a didactic means of learning the insights of NN.
- To have some other training strategies added.
- To grow in functions that underline its didactic purpose.
OK now,
- From Octave's command line load nn22.m (you may use Matlab).
- Follow the menu indications, by either loading or creating a new Neural Network.
- Data for training and testing is included in .txt files. Or you may create new data.
- Adjust constants for training.
- Train, feed the NN and plot results.
- Spare some time understanding the code, should be pretty straight forward.
- The neural network structure is: a) easily modified by its .ini file. b) visible in the neurons data structure included in each .mat file.
- This very simple framework is meant to provide a means to play and understand neural networks basics. Nothing more than that.
- Profound knowledge of Trial and Error is a must.
- Files particular to each NN solution are included as examples and as templates to be modified to suit your own NN solution. a) and_Structure.ini b) and_Constants.m c) and_nnData.mat d) and_createIOdata.m e) and_plotIOdata.m f) and_ioIdealTest.txt g) and_ioIdealTrain.txt h) and_ioInputTest.txt i) and_ioInputTrain.txt ...where 'and' should be replaced by your NN's Base Name, e.g.: xor, sine, fir, etc. (etc. meaning your own base name ;)
- File a) is the .ini NN structure definition. Edit it.
- Files b) and c) may be omitted, but if they exist, you should respect their existence. They may contain useful information regarding the NN :) If they do not exist, they will be created by the program.
- Files d) and e) are templates and have to be adapted to your solution.
- Files f) to i) are the .txt data files. If they do not exist, the program can create them. There is a menu option for that task... and it calls the function listed as file d) _createIOdata.m It should be easy to build your own data set for a particular solution.
- There are three files that contain localization info: a) nn_localization.m b) nn_localization_en_US.m c) nn_localization_es_AR.m
- File a) is called at the very beginning of nn22.m and helps the user to choose between files b), c), and perhaps other localized files that may be added in the future.
- Files b) and c) contain the localized messages and are twin files with the same number of lines, containing the same structure variable declarations, all belonging to the 'msG' global structure, one of them assigns messages in English language and the other in Spanish.
- In order to add another language you may add an edited copy of file b) and then add another option to file a). You may also follow the brief instructions included at the end of the a) file, 'nn_localization.m'.
The project consists of a few very simple .m files for a Basic Neural Networks study under Octave (or Matlab).
The idea is to provide a context for beginners that will allow to develop neural networks, while at the same time get to see and feel the behavior of a basic neural networks' functioning.
The code is completely open to be modified and may suit several scenarios.
The code commenting is verbose, and variables and functions do respect English formatting, so that code may be self explanatory.
Messages to the screen are localized, both in English and Spanish, and it is really easy to add another language to the localization.
If any further explanation is needed, the forum/discussion page may be of help :)
Comments and suggestions are very welcome.
Copyright (C) 2014 Alejandro Quiroga Alsina
The copyright is made under GNU General Public License. README.txt, COPYING.txt and LICENSE.txt files add info on this regard.