fd1
Posts: 13
Joined: Fri Sep 30, 2016 11:59 am

Running AI algorithms on Rpi

Sat Oct 01, 2016 3:58 am

Is it possible? How about doing machine learning stuff? Anyone done this before?

User avatar
Gavinmc42
Posts: 3748
Joined: Wed Aug 28, 2013 3:31 am

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 5:13 am

There was a post about a combat flight sim using Alpha to beat a combat vet.
The deep learning stuff was done on a super computer and then ported to a Pi to run on.

With OpenGL I can now run Warzone2100 on a Pi3, it is open source so the AI can be studied. Games usually have leading edge AI.

A couple of year ago I would have said it cannot be done.
Now I want to try ;)

Most of it these days is done with GPU cores.
Could it be done in the VC4 on the Pi?
pikrellcam shows how a side effect of H.264 VC4 compression can be used for motion detection.

Intel's flying 100 drones show controlled flocking behavior.
Depends on your definition of AI, Human level general purpose AI?
Not for a few more years ;)

Could a Siri level voice recog run on a Pi?
Pi based voice controlled wheel chair, done?
http://techpublications.org/index.php/I ... e/view/127

https://en.wikipedia.org/wiki/Cognitive_radio
In Oz there is now a RF band for this 933-935MHz

Very specific AI, one task AI's? I think we are going to see more of these.
Robot Farm, Smarter Home Automation, smarter vacuum cleaners etc.
Collision avoiding drones can be had by opening your wallet.
Collision avoiding cars, er nearly :o
Self parking cars, nearly standard on new models.

Sensors are now cheap enough that your smart mobile phone can detect earthquakes.

Lots of AI stuff is still in the Cloud, this should trickle down.
Ant/bug level AI has been around for decades.
https://en.wikipedia.org/wiki/Subsumption_architecture
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

ejolson
Posts: 3584
Joined: Tue Mar 18, 2014 11:47 am

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 5:17 am

fd1 wrote:Is it possible? How about doing machine learning stuff? Anyone done this before?
With faster computers larger neural networks can be built. Even though most of the mathematics remains unchanged, as the size increases it becomes possible to train the neutral networks to do interesting things that would be difficult to achieve with conventional programming techniques. With the advent of GPU accelerators use of large neural networks has become practical.

To my knowledge no neural network code has been developed for the VideoCore4 GPU of the Raspberry Pi. Moreover, this particular GPU may be too slow to construct neutral networks large enough to solve interesting problems. On the other hand, maybe not. I just found a free book online that looks well written. It explains why and how neural networks are used with examples in Python. If I had time, it looks like fun reading.

User avatar
Gavinmc42
Posts: 3748
Joined: Wed Aug 28, 2013 3:31 am

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 5:43 am

Nice book link

It might take someone really smart to run AI in the VC4.
But we have NEON/SIMD on the 2, 3, could do some AI stuff with them?
Time to hit the books?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 7:52 am

Depends on the goals.

Machine learning has been done for decades on systems that are a lot less powerful than even the ARMv6 in the RPi A/B, with a lot less RAM and a lot less persistant storage than you are likely to have.

For decades the machines used for such projects ranged from 1MIPS to 100MIPS CPU's (FP not often used in machine learning back then), with less than 8MB of RAM, and less than 128MB of persistant storage.

So can machine learning be accomplished on the RPi, most definitely. Can it keep up with the latest algorithms used for the purpose, yes it can. Is it going to be of a speed that today may be considered usable, no (at least not on the ARMv6 at 700MHz, maybe on the combination of 4 ARMv8 cores running at 1200MHz plus the combined processing power of the VideoCore IV while the RPi is running absolutely nothing else and using 100% of the available processing power 100% of the time).
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

al887
Posts: 6
Joined: Mon Sep 26, 2016 7:46 pm

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 9:22 am

Why not? Pi is a linux computer. You can run anything that runs on linux.

Regarding machine learning, I recommend you to check following Python libraries. Numpy, Pandas and scikit-learn (most importantly). These are core libraries. You can find many other Python libraries related to machine learning (deep learning, computer vision etc.)

Regarding AI algorithms in general, you can check Python code for AIMA book (standard book for AI): https://github.com/aimacode/aima-python

--
Aleks J. Vinson
Certified Java Developer
http://www.java-forums.org
Last edited by al887 on Sat Oct 29, 2016 2:36 pm, edited 1 time in total.

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 10:07 am

I think AI is a fantasy invented by the "gee whizz kids" to look cool and impress girls, like many of the fantasy's that involve computers, good example, just recently they discovered a planet going round our nearest sun 4 light years away, found it with ease, an astronomer was asked why did it take so long to discover, he said its over the south pole and the telescopes that can see it don't have beaches, beach babes and no where to drive a fast cars, think that says it all.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

User avatar
Paeryn
Posts: 2679
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 10:41 am

johnb_summers wrote:I think AI is a fantasy invented by the "gee whizz kids" to look cool and impress girls, like many of the fantasy's that involve computers, good example, just recently they discovered a planet going round our nearest sun 4 light years away, found it with ease, an astronomer was asked why did it take so long to discover, he said its over the south pole and the telescopes that can see it don't have beaches, beach babes and no where to drive a fast cars, think that says it all.
How does this "good example" relate to computers or AI? AI isn't a fantasy invented to look cool or impress girls. It may come as a shock to you that some people aren't interested in looking cool or impressing anyone (either male or female).

AI is in basic terms getting a machine to respond automatically to its environment in a way that improves its chances of reaching a certain goal. Nothing fantastical about that.
She who travels light — forgot something.

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 11:01 am

AI = Artificial Intelligence = pure fantasy.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

Heater
Posts: 13371
Joined: Tue Jul 17, 2012 3:02 pm

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 11:39 am

I think that "Artificial Intelligence" is a silly name for whatever it is they do.

We have no rigorous definition of what "intelligence" is. So how can we make an artificial one?

I think it's self-contradictory. Imagine we could make an "artificial mathematician", a machine that did what mathematicians do. Then my question would be "What is artificial about it? Surely it is an actual mathematician".
Memory in C++ is a leaky abstraction .

ElEscalador
Posts: 680
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 12:10 pm

Tomatoes tomatoes... AI isn't silly, but maybe labeling it AI is. Who cares what they call it though - it's just the idea of a computer program that learns. The pi should be able to do this - what level of learning it's capable of is the unknown. Simple math programs? Getting smarter at the snake game? I'd think so. Useful levels?? I dunno. I have a few projects first but I ope to tinker with it.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

User avatar
Paeryn
Posts: 2679
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 12:23 pm

It's about creating systems that can behave in an intelligent way, that is ones that can respond to stimuli, learn what works to improve its situation and what doesn't, and to use that information when deciding what to do next.

The name might not be the best description in the world, but it serves its purpose.
She who travels light — forgot something.

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 1:19 pm

Paeryn wrote:It's about creating systems that can behave in an intelligent way, that is ones that can respond to stimuli, learn what works to improve its situation and what doesn't, and to use that information when deciding what to do next.

The name might not be the best description in the world, but it serves its purpose.
so Automated Interaction and not Artificial Intelligence but don't sound as sexy does it, Gee Whiz where's the coolness in that.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

ghans
Posts: 7873
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 1:25 pm

Ins't this is the very reason people tend to prefer the term "Machine Learning" these days ??

I guess it is only a matter of time till someone publishes an essay called
"Machine Learning" considered harmful

and proposing a new , better , absolutely universal term for the field :lol:

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Heater
Posts: 13371
Joined: Tue Jul 17, 2012 3:02 pm

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 2:06 pm

I think I prefer "Machine Learning".

But what does that mean?

When a person learns something clearly something has changed in their brain. We could say that a human brain has a "state" and when someone learns something that state has changed.

Well, guess what? All computers and programs have a "state", temporarily in memory or more permanently on a disk or whatever.

Back in the 1970's some electronics magazine, Wireless World perhaps, published an project description called "Cybernetic Cynthia". Cynthia was a robotic snail. She would pull her head into her shell if you touched here. If you touched her more and more she would get used to the idea and slowly learn not to pull her head into her shell in response. Cynthia could learn, at least that. Leave her for a while and next time you touched her she would pull her head in again. She could also forget.

Cynthia's machine learning was nothing more than a capacitor that got charged up more and more with each touch stimulus. When the voltage on the capacitor got higher it inhibited the head retraction response.

I'm not convinced that AI or ML has advance much since Cynthia. It just got bigger.
Memory in C++ is a leaky abstraction .

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 2:45 pm

AI in popular culture is still science fiction, but machine learning is already here. One example is the Google "AI" bot that beat the Go world champion. This is often seen as one of the hardest games and impossible for a computer to consistently win because of the sheer size.
In fact, the number of possible variations in just the first 40 moves of a Go game on a 19x19 board already surpasses the number of atoms in the universe.
It is often said that it requires an element of intuition, but machine learning has beat a human.
There are 10 types of people: those who understand binary and those who don't.

ejolson
Posts: 3584
Joined: Tue Mar 18, 2014 11:47 am

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 3:31 pm

Heater wrote:I'm not convinced that AI or ML has advance much since Cynthia. It just got bigger.
I think it is very interesting that, without changing much else, as the size of a neutral network gets bigger it is able to learn how to do tasks that otherwise would be very difficult to program. Apparently the transition to usefulness happens when the number of layers in the network increase beyond eight. Only recently this became practical to achieve with GPU accelerators that are thousands of times faster than a Pi. However, as with many things, the Pi computers are good enough for learning concepts, even when not powerful enough for practical applications.

Heater
Posts: 13371
Joined: Tue Jul 17, 2012 3:02 pm

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 4:09 pm

Which ever way you slice it, neural nets, fuzzy logic, what ever AI algorithms we have now a days. No matter what hardware it runs on, GPU's or Google cloud farms etc. It all comes down to the same simple thing:

A computer, with memory, inputs and outputs.

The question then is: Can we build an "intelligent" thing out of that with some algorithm or other?

A satisfying answer, to me at the moment anyway, would be "No".

A disturbing answer, to many, would be "Yes". Disturbing because it would prove that we are nothing more than machines.

Anyway, whatever you call it, it's amazing what the compute power and memory available today can do.
Last edited by Heater on Wed Oct 05, 2016 7:29 am, edited 1 time in total.
Memory in C++ is a leaky abstraction .

ejolson
Posts: 3584
Joined: Tue Mar 18, 2014 11:47 am

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 4:28 pm

Heater wrote:A disturbing answer, to many, would be "Yes". Disturbing because it would prove that we are nothing more than machines.
While possibly disturbing, I don't see how neural networks being able to learn complex tasks proves humans are machines. Dogs easily learn to recognize people and horses can autonomously navigate the roads while pulling a cart. There are and will be many more tasks that computers do better than humans. Mankind is distinguished not by the ability of thinking or doing, but by the gift moral responsibility.

Heater
Posts: 13371
Joined: Tue Jul 17, 2012 3:02 pm

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 5:18 pm

ejolson,

I did not say that neural networks being able to learn complex tasks proves humans are machines.

What I'm suggesting is that if we can build algorithms that do the intelligent things that humans do, then it strongly suggests that humans are nothing special. Just complex mechanisms, like the computer running our algorithms.

This idea disturbs a lot of people because they like to think that humans have some metaphysical, spiritual thing that separates us from inanimate objects and animals and such.

Mankind likes to distinguish itself with talk of morality. The argument seems too be that we have morals and you can't build morals into a machine.

Now, I like this idea of moral responsibility. And I hope we all do. But what actually is it?

Simply put we could say it is "doing the right thing". Whatever "right" means. Who decides what that is?

Given that, history shows that humans don't really have any such thing. One only has to study history and see what atrocities have been going on for millenia.

Putting all this together, if we build a perfect ejolson emulator, indistinguishable from the real ejolson, then we can say that obviously our machine has no moral responsibility. It's just a machine right? Therefore we can deduce the real ejolson has no moral responsibility either. He just thinks he has. (Well I should say "says he has" because it's not clear what "thinking" means at this point).

Please don't take any of my ramblings seriously. I'm just riffing on ideas, in my simple way, that philosophers have been bouncing around since forever.
Memory in C++ is a leaky abstraction .

User avatar
Douglas6
Posts: 4769
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 5:24 pm

It's probably a mistake to conflate intelligence with consciousness, that quickly gets you into some deep philosophical mires.

User avatar
davidcoton
Posts: 4151
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 5:43 pm

Heater wrote:if we build a perfect ejolson emulator
That is a big if. Can we? Should we? Will we ever?
Maybe it is just not possible to make a perfect emulation of a person. Maybe that is because of whatever it is that makes humans unique.

I'm suggesting that this test of a perfect emulation is at least the top end of the Turing test, and possibly beyond that. If an emulation reaches that stage, then the uniqueness of humans could be in doubt, but more likely it will be because human programming has understood, captured, and mechanised that uniqueness. So even the creation of a perfect emulation proves nothing, given who did the creating.

Now if a non-human intelligence built the perfect human emulator, that would be a whole different ball game.
Signature retired

Heater
Posts: 13371
Joined: Tue Jul 17, 2012 3:02 pm

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 6:51 pm

@Douglas6,
It's probably a mistake to conflate intelligence with consciousness, that quickly gets you into some deep philosophical mires.
Oh yeah, let's not go there. It could go around in circles for ever.

For example. One aspect of consciousness is feeling pain. Well, for sure I do. I really don't want to stick hand in the fire. However I cannot be sure that anyone else does. They might scream and cuss, like me, when they stick there hand in the fire but how I can I be sure that's because they feel pain like me. Perhaps it's just a mechanical response. Perhaps I am the only being that has consciousness.

Ah, sorry, I said we should not go there...

@davidcoton,

Yes, it's a gigantic "if". Let's call it a Gedankenexperiment.
Maybe it is just not possible to make a perfect emulation of a person. Maybe that is because of whatever it is that makes humans unique.
Yes. Then the question is: If it's not possible, in principle, to make an emulation of a human because of "whatever it is that makes humans unique", then what is that thing?
Now if a non-human intelligence built the perfect human emulator, that would be a whole different ball game.
But, but, a non-human thing built humans in the first place. Seemingly did not require any intelligence to do so either!
Memory in C++ is a leaky abstraction .

User avatar
davidcoton
Posts: 4151
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 7:22 pm

Heater wrote:But, but, a non-human thing built humans in the first place. Seemingly did not require any intelligence to do so either!
That's debatable, but too far off topic for here and now.
Signature retired

Tzarls
Authorised Reseller
Authorised Reseller
Posts: 224
Joined: Tue Feb 26, 2013 6:59 am

Re: Running AI algorithms on Rpi

Sat Oct 01, 2016 7:30 pm

Isn't there people who can't feel pain? On a certain level pain is just a tool to help us stay in one piece. The sensors in your hands tell you brain that something is wrong, then you react by taking your hand out of the fire. For people with problems in their "sensors" the alert doesn't exist. Therefore they can be concsious of the fact that keeping their hands in the fire is not good for their health. They can even see and smell their flesh burning. But they can feel the pain ,because their "sensors" are malfunctioning. So the ability or disability to feel pain just proves that we have a mecanism to interact with our surrounding and know when things go wrong (whatever "go wrong" is).

Return to “General discussion”