How to use

fannExplorer

fannKernel


Installation

Unzip the distribution file.


Starting up

Doubleclick fannKernel.exe in the fannKernel subdiretory.

Doubleclick fannExplorer.html or the fannExplorer projector in the fannFlash subdirectory.

You can run multiple fannExplorer clients simultaneously, the fannKernel is multi-threaded, so you only need to run one fannKernel when you train several neural networks at the same time.

Security notice: Use a firewall when you are connected to the internet and do not run fannKernel on a webserver. fannKernel is intended to be used in a friendly environment such as on a local machine or in an intranet behind a firewall. fannKernel uses SOAP over tcp/ip by default on port 2718 (first four digits of the exponential constant) to communicate with fannExplorer clients. fannKernel does not implement authentication or encryption.


Loading a neural network

In the fannExplorer menu choose View/Show All.

Load a neural network and related data (xor, sunspot etc. are provided) with File/Load Neural Network, File/Load Training Data and File/Load Test Data in the menu.


Training and testing a neural network

To train the neural network you have loaded click the Controller Training pane header.

Click the Randomize or Initialize button. Click the Train button.

To view the output from the neural network click the Controller Testing pane header.

Click the Execute button.

Experiment with the settings on the Algorithm pane. See the fann library documentation (available here) for an explanation of their use. Repeat the steps from above. Try changing the number of epochs. Click on the stop sign if you want to stop an ongoing training.


Animation

Load the three BesselJ sample files. Click Show All in the View menu. Then try:

On the Algorithm pane Set Training Algorithm to Incremental
   
On the Training pane

Set Maximum number of epochs to 6000

Set Stop when mse falls below to 0

Set Epochs between mse reports to 100

Set Epochs between display updates to 500

Check the Update output plot while animating box

Click Randomize, then click Animate immediately followed by a click on the Testing pane header.

This will produce an animation similar to the one seen on the fann library front page that was produced by Mathematica. Repeat the last step to try the animation again. If you want to stop an animation then switch to the Training pane and click the stop sign.


Editing data and weights

The training and test data you have loaded can be viewed and changed by clicking on the edit buttons on the Training and Test panes. To change a value click on it. To delete a data item click on it and then on the delete button. The Add button appends a zero initialized data item to the end of the data set.

The weights in the neural network can be individually edited in the datagrid in the Weight Graph window.


Working with files

All neural network files are placed in the net subdirectory below the fannKernel's startup directory. The files have extensions named according to their content. Fann neural network definitions have extension .net, training data have .train and test data have .test. When you save files you can optionally save fixed point format files as well, these have an additional extension of .fixed. Only floating point files can be used with fannKernel.

If you follow the same naming convention and place copies of your own fann files in the net subdirectory, then they become available in the fannExplorer's Load dialogs, so you can train your own neural networks.


Tools menu

The Tools menu provide tools for connecting to a remote fannKernel, for using multiple neural networks from the one client and for displaying status information.

Status...
Displays a window with the latest status information for the session.
   
Server...

Allows a client to connect to a fannKernel server placed on a remote machine in a local area network and/or using a non-default port number. As mentioned in the security notes fannKernel is not intended for use over the internet both due to security and latency.

   
Context...

Allows a client to reset the current user context and to connect to previously loaded user contexts. A context is created every time a fannExplorer client connects to the fannKernel. The context consists of a neural network, training and test data. See the fannKernel window for information regarding the state of loaded user contexts. User contexts are purged from fannKernel after default one hour. fannExplorer uses a heartbeat to keep its current user context alive even if there is no activity.

These facilities should be considered experimental, please refer to the Known Problems section below.


General notes

If you observe a bug please provide a short description of the problem to freegoldbar at yahoo dot com.

When used in a browser it is recommended to download the latest flash player plugin from Macromedia even if a version 7 flash plugin is already installed.

Different browsers perform differently with a rich, multithreaded client. Better performance have surprisingly been observed for fannExplorer in Microsoft Internet Explorer than in Opera.

Neural networks are purged from the fannKernel if they have not been used or viewed for an hour. The number of minutes can be set when starting the fannKernel i.e. 'fannKernel 1440' will purge neural networks and data that has not been used for 24 hours.

The port number used by fannKernel can be given as a second argument, for example 'fannKernel 60 3141' would use the first digits from pi as the port number. However the service description file fannKernel.wsdl also contains the port number and consequently require editing to match the chosen port number. fannExplorer clients will also need to connect to the server via the Tools/Server menu.

Soap enabled languages such as Macromedia ActionScript and Microsoft .Net based languages can use the fannKernel directly. Languages that do not support Soap natively, may support Soap via a toolkit. The included fannDotNet proxy dll's for Microsoft .NET are not used by fannExplorer. They can optionally be used by languages such as C#.Net, VB.Net, Mathematica 5 etc...


Known problems

When a client exits its context may be prematurely cleaned up. That is the context will still exist in the fannKernel but without any meaningful data. Attaching to such a context can lead to deadlock in the fannKernel. Workaround: Save neural networks and data before closing the client and avoid attaching to contexts that do not show meaningful names when the context status is printed in the fannKernel window. A solution is actively being sought.

The scenario where fannKernel runs on one machine and clients run on other machines have not been tried or tested. fannKernel has also not been tested on a multi-processor machine. Feedback on these scenarios are welcome.


Known limitations

The fannKernel has to be started before any clients are started. If not then the clients must be restarted after the kernel has been started or connected with the Server setup dialog available via the Tools/Server menu.

When using the keyboard to change the Hidden layers (in the Create New Neural Network dialog) and the Select output neuron for plot (in Controller/Testing pane) it is required to press Enter (not Tab) after typing a number.

When saving a neural network only the properties that are present in the fann file format are saved, in the current format that does not include for example the training algorithm.

In this version the focus has been on developing a graphical user interface for fann, not on documenting the fannKernel. Please refer to the fann library documentation and if used in .Net the Object Browser.


Performance notes

The editor for training and test data is intended for smaller data sets, when working with large data sets or neural networks with many input/output neurons a text editor or a script is a more effective solution.

When working with neural networks with a large number of connections (hundreds or thousands), close the Weight Graph as it takes a substantial time to update and the graph will not be very informative.

The data used for testing should be restricted to a reasonable amount when the output plot is used. This is especially true when animating the output. A suggestion is to have a smaller set of test data for plotting and a full set to verify the neural network and calculate the mean square error.

The datagrids update much slower than the graph and plots so view the graphics during animations.


Implementation notes

The fannExplorer and fannKernel was written as a test case to see if Soap represents a viable alternative for cross platform applications to the proprietary Sun Java. Soap is vendor, language, operating system and protocol independent. The sample fannExplorer client was written in ActionScript (a proprietary JavaScript derivative used in Macromedia Flash). The fannKernel was built with Microsoft Visual Studio C++ 7.1, Boost C++ Library 1.32, gSOAP 2.7.0d and a slightly modified fann 1.2.0 library.

The modifications to the fann library was a fix for an incompatibility with sockets under windows affecting the initialization of random numbers (submitted for future inclusion in the fann library) and a change to avoid resetting internal fann data structures to allow smooth animations thanks to S. Nissen, project manager for the fann library.


License

Copyright 2005/2548 written by freegoldbar at yahoo dot com. All rights reserved. For private and educational use only. Not for sale, commercial or military use. No warranties given or implied. No suitability for any purpose.

To obtain the latest version go to http://www.geocities.com/freegoldbar/


License Addendum for fannKernel

Part of the software embedded in this product is gSOAP software.

Portions created by gSOAP are Copyright (C) 2001-2004 Robert A. van Engelen, Genivia inc. All Rights Reserved.

THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY GENIVIA INC AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE