Neural Networks

The place to share and discuss your Ultibo projects.
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Neural Networks

Postby Gavinmc42 » Sat Jan 20, 2018 1:20 pm

Been going though the Laz/fpc forum, playing catchup to this Free Pascal stuff .
Found an interesting post
http://forum.lazarus.freepascal.org/ind ... #msg266776

Made a new project, added "uses uconvolutionneuralnetwork", found the missing UBit file and it compiled :o
This Free Pascal stuff is so clean, in any other language a missing dependency would have crashed it.

Had been looking for some Pascal NN code, this one is recent ;)
Lots of assembler in the uvolume that will need fixing, converting Intel floating point to ARM/VC4:(
asm - vmov etc looks like it could be SIMD/NEON converted.
Since most NN stuff needs to be highly optimized asm this would be a good place to start.

Nearly no idea how to use it. Yet.
Perhaps get it running on this Intel box first?
cpuid reports " AVX: advanced vector extensions = false"
Think I might need something better than a Celeron Duo :(

uvolume -

Code: Select all

{$DEFINE AVX32}   

Add extra defines and code for ARM6_SIMD, ARM7_NEON, ARM8_NEON.
Perhaps Intel SSE assembler?

The OpenCL stuff could be of use since that mostly works on the QPU's now.
RPF says 64bit NEON should be faster than QPU's, why not use both :D

Neural network can still work with 8 bit integers, so maybe one day even faster?

Anyway, an interesting way to start NNing in Ultibo on Pi's.
Wonder if Joao Paulo Schwarz Schuler has a Pi?
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Neural Networks

Postby Gavinmc42 » Tue Apr 16, 2019 7:52 am

There is a Pascal port of this C Neural network
https://github.com/glouw/tinn
Useful links too.

Small enough I might be able to figure it out ;)
https://sourceforge.net/projects/pastinn/

No dependencies?
Years ago I came across a character recog system that used a optical mouse as the camera sensor.
But Ultibo Pi camera now works and does colour ;)

Train it to sort coloured Lego?
Been wondering when someone would do this.
https://www.seeedstudio.com/Kittenbot-L ... -2950.html
Lego bots? Will one set make a Lego picking up robot?

Autonomous PiLego combat bots ;)
User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Neural Networks

Postby Ultibo » Thu Apr 18, 2019 12:25 am

Gavinmc42 wrote:There is a Pascal port of this C Neural network
https://github.com/glouw/tinn
Useful links too.

Small enough I might be able to figure it out ;)
https://sourceforge.net/projects/pastinn/

No dependencies?

At a quick look it appears there are no dependencies at all and it uses stock standard Pascal code, it should just about compile in Ultibo without changes.
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Neural Networks

Postby Gavinmc42 » Thu Apr 18, 2019 2:26 am

I have played with most of the big NN tools, Tensorflow, Torch, Leaf, Caffe....
Even Tensorflow Lite is still big.
I don't have a use case to devote the time to learning these tools.
This looks like it is small enough to learn and understand without taking up a lifetime to learn the tool like the big sets;)

A hobby version, simple enough to grasp and learn the basics of NN.
What I have been finding with Ultibo, the simple examples do 90% of my requirements.
Reducing the requirements helps too :lol:

Doing basic stuff with Ultibo teaches the basics and there is so much I want to learn.
And so much I dreamed about doing 40 years ago is now within reach.
Not only in a professional way but as hobbyist.

Easter break fun time ;)
Brutus
Posts: 32
Joined: Sun Jan 20, 2019 1:24 pm

Re: Neural Networks

Postby Brutus » Mon Apr 29, 2019 5:06 pm

I read a lot of posts from Gavin and always like them.

He's the R&D manager in the Ultibo business. :D
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Neural Networks

Postby Gavinmc42 » Tue Apr 30, 2019 1:02 am

He's the R&D manager in the Ultibo business

I have had that Title on a business card once and another with "Chief Scientist" :D
All it means is someone else is doing the hard work.

I'm just a hardware guy looking for easier ways to do hard software.
Unfortunately I'm interested in lots of things so it does not take much to distract me :lol:
It is getting easier but the more I learn, the more I find out there is still much more to learn.

I am now learning Prolog and trying to figure out how to add Fuzzy Logic to LIL.
Prolog is massive and longer term but LIL with Fuzzy Logic and that NN code should make for interesting tiny robots.

But Ultibo talking to the Prolog or any other language compiler binary file, interesting possibilities :ugeek:

That's why I'm also interested in scripting, Ultibo then becomes like a Linux OS that can be used as a command line interface.
The flexibility that scripting adds moves Ultibo from a Specific Purpose OS to a General Purpose OS.
Reinventing the wheel? Perhaps, but in the process I learn how to make wheels ;)
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Neural Networks

Postby Gavinmc42 » Tue Apr 30, 2019 8:42 am

Link to old genetic algorithm with Pascal code
http://centres.exeter.ac.uk/cee/ga/index.htm

Plus Thaddy has done ternary and fuzzy code apparently even on Pi's?
https://forum.lazarus.freepascal.org/in ... c=41144.15

Or was that the GOLDparser he did on Pi's.
http://www.goldparser.org/
A lot to chew on here :o

Useful stuff for controls, AI, gaming programs etc.
Hmm, what does that PascalSCADA stuff have in it?

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest