Skip to content

Genann library port to RISC OS, a simple, fast, reliable and hackable C library for training and using feedforward Artificial Neural Networks (ANN)

License

Notifications You must be signed in to change notification settings

ZFPSystems/genann

Repository files navigation

=============================================
Genann Neural Network Library port to RISC OS
=============================================
------------
-DISCLAIMER-
------------
This is a port to RISC OS of a C library called Genann (read the intro for more details). The library was ported to RISC OS by Paolo Fabio Zaino.
By downloading and using this library you accept the license and the terms of use:
The library and all the code and info in this repository are provided as is and I am not liable for any issue/problems you may have using this library.

On specific request on the license of the author of the original Genann Library, given that I am modifying the lib from time to time to adapt/improve it as needed for RISC OS and ARM CPUs, I have to declare that this one IS NOT the original Genann library.

-----------
-  INTRO  -
-----------
This is the RISC OS port of Genann library, a minimal, well-tested C library for training and using feedforward Artificial Neural Network (ANN).

The primary focus of the original Genann library is to be simple, fast, reliable and hackable, all stuff that is focus of RISC OS as well so I thought the two would match wonderfuly and it seems they do.

This library compiled is only ~6KB and provides all the minimal requirements to create powerful Artificial Neural Netowrks to use in you rown software for example to do Image Recognition or other uses typical of ANN. Because of it's extremely small size it can be used virtually in any ARM based Platform (included old Acorn Archimedes, A series, RiscPCs etc... for the retrocoders among you) or the Pico board.

I have pre-compiled and added make file to generate code compatible with ARMv2 Architecture, ARMv4, ARMv5, ARMv6 and ARMv7 and should work fine also on ARMv8.

I have put attention to make sure Genann works on both Acorn/ROOL DDE (Desktop Developemnt Environment, ex AcornC/C++) and GCC for RISC OS, so you are free to choose your favorite compiler.

Genann is also threadsafe so, in theory, you could use it with libraries like !Vista in Acorn/ROOL DDE C++ as well as with PThreads on GCC.

---------------
-HOW TO USE IT-
---------------
For a detailed tutorial/examples please look at the various examples code in the GenannExamples directory, they can be executed directly from RISC OS Desktop and they also come with source code to look at (from the original Genann authors, I just ported/adapted the code to compile and work on RISC OS).

So here is a quick how-to:
1) Make sure the Filler has seen the "Library Application" !Genann before you attempt to compile your code with Gennan library.

2) In your own code include the Genann library as follow:
#include "GenannLib:genann.h"

(The above combined with point 1 will make your life very easy when creating code the uses Genann)

3) On your Makefile (or your compiling and linking instructions) make sure you point at the right AIF file by using:

For DDE:
	cc blah blah -I GenannLib:
	link blah blah GenannLib:o.genanDDE[<X><Y>]

	Where [<X><Y>] are optionals and should be specified only when you want to use an architecture optimized version of the library, while for general compilations just using GenannDDE is more than enough.

	If you are pedantic then "blah blah" is your specific stuff, so not a literal thing to type ;)

	<X> can be either 26 or 32
	<Y> can be ARMv2 or ARMv4 or ARMv5 or ARMv6 or ARMv7

	So for example:
	link blah blah GenannLib:o.genannDDE
	link blah blah GenannLib:o.genannDDE26ARMv2
	link blah blah GenannLib:o.genannDDE32ARMv7

For GCC:
	CFLAGS=-IGenannLib:
	LDFLAGS= blah blah -l:GenannLib:o.genannGCC

	And then use the variables above as:
	gcc $(CFLAGS) blah blah $(LDFLAGS)

For more info look at the Manual.PDF in this repo.

-----------------------------------
- Supported Programming Languages -
-----------------------------------

Right now you can use RISC OS Genann with:

- ROOL DDE C
- GCC C
- GCC C++

-------------
- Tested On -
-------------

- RComp Mini.M (i.MX6)		(RISC OS 5.27 ) [PASSED!]	(Tester Paolo F.Z.)
- RComp ARMBook			(RISC OS 5.27 ) [To be tested]
- RComp ARMini			(RISC OS      ) [To be tested]

- Pi Zero			(RISC OS 5.xx ) [PASSED!]	(Tester Tristan M.)
- RaspberryPi 3			(RISC OS 5.24 ) [PASSED!]	(Tester Paolo F.Z.)
- RaspberryPi 2			(RISC OS 5.24 ) [To be tested]
- RaspberryPi 1			(RISC OS 5.24 ) [To be tested]

- PandaBoard			(RISC OS      ) [To be tested]

- Castle Iyonix PC		(RISC OS 5.24 ) [PASSED!]	(Tester Paolo F.Z)

- Acorn RiscPC 700 StrongARM	(RISC OS 4.39 ) [To be tested]
- Acorn RiscPC 600 StrongARM	(RISC OS 6.00 ) [To be tested]
- Acorn RiscPC 700 Kinetic	(RISC OS 4.03 ) [To be tested]

- Acorn A3010			(RISC OS 3.10*) [To be tested]
- Acorn A3020			(RISC OS 3.11*) [To be tested]

- Acorn A5000 (ARM3)		(RISC OS 3.10*) [To be tested]
- Acorn Archimedes 310 (ARM3)	(RISC OS 3.11*) [To be tested]

- MiSTer Archie Core A3000	(RISC OS 3.11*) [To be tested]

Emulators
- VirtualAcorn Adj-SA StrongARM	(RISC OS 4.39 ) [PASSED!]	(Tester Paolo F.Z.)
- VirtualAcorn Adj-SA ARMFE7500	(RISC OS 4.39 ) [PASSED!]	(Tester Paolo F.Z.)

- RPMEmu			(RISC OS 5.24 ) [PASSED!]	(Tester Paolo F.Z.)

- VirtualA5000			(RISC OS 3.11*) [To be tested]

- ArchiEmu ARM3			(RISC OS 3.11*) [NOT PASSED!]	(Tester Paolo F.Z.)

Tests consists of:

- Running the generic version of the test suite and the specific version for the ARM architecture on the tested system
- Run all the generic examples

If all code completes succesfully and results are as expected then the test is considered passed, otherwise is not passed.

* Please Note: All RISC OS 3.1x systems requires ROOL DDE CLib to be able to run code using Genann library.

---------
-FINALLY-
---------
There is also a test suite that will provide you with a raw performance analisys and full functionality test of the library on your specific platform, look in GenannTests for it.

Enjoy!