What is machine learning?

General discussion for topics related to the FreeBASIC project or its community.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

What is machine learning?

Post by Tourist Trap »

Hi all,

maybe I missed a train or something? I struggle to learn machines, at least as far as it means computing. And I'm hearing about machine being learning at their turn... What can computers learn? Can it be you and me ? :D

I guess I'm quite ignorant here, and begging for science from the knowers ;)

Thanks!

ps: useless to say Wikipedia is far too pedantic to my taste on this topic!
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: What is machine learning?

Post by anonymous1337 »

Our team just won a local civic hackathon for the government using machine learning. Microsoft has some good chatbot technologies that have pre-loaded with algorithms and data sets and can train against your conversational workflows. It's pretty cool stuff.

As far as I'm aware, it's really fancy statistic analysis stuff. It stores the refinements of these statistical analysis in the form of neural networks.

You take a neural net, feed it input and ways for it to process the data, measure the output, and allow the AI to be trained or retrain itself. This training / learning is often done with assistance of some hardcoded or presumed rules, or entirely from scratch (without human data, using reinforcement learning, with the blank slate being known as "tabula rasa")

My favorite tech in this field of recent interest is AlphaGo: https://deepmind.com/blog/alphago-zero- ... g-scratch/
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: What is machine learning?

Post by BasicCoder2 »

Tourist Trap wrote:What can computers learn?
First of all keep in mind that the general purpose computer cannot learn anything or indeed do anything by itself. Your computer has to be wired up (by programming) to do anything at all. Often people say a computer can or can't do this that all the other but a more accurate way of talking about it is to say that a particular program, a computer wired up in a certain way, can or can't do this that or the other. What we can ultimately program a particular computer to do is an open question.

A better question is:
"What have programs been able to learn so far?"

As regards the neural net programs mentioned by anonymous1337 they essentially keep rewiring themselves toward getting a closer and closer output value that gives the best outcomes however the resulting wiring can be somewhat obscure so we don't really know how they wired themselves, that is, we don't know what algorithms the ANN has discovered to compute those results.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

Hi anonymous1337,
hi BasicCoder2,

Thanks for the answers. My concern to say truth would be now, if I had to do machine learning in FB, where should I start?

I can say the things more precisely. Python, R, all claim that you should learn ML with their help. But no, they just provide a full assortment of libs and predefined black boxes that will do the job for you (at least if you know the how-to of the black boxes). If you are like me and are here also because FB leaves you stand close to the fundamentals while being not difficult to read or write, then you wouldn't feel good with the R approach. I would prefer to craft a simplified example, than to run a big one where I just don't figure out what's going on. This said, maybe it's a too difficult affair. I don't know.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: What is machine learning?

Post by angros47 »

Start from this:
viewtopic.php?t=17673
and this:
viewtopic.php?t=17697
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

angros47 wrote:Start from this:
viewtopic.php?t=17673
and this:
viewtopic.php?t=17697
The topics pointed out are terrific, very inspiring. Maybe I start to see. So we set up some array of value, say 64, and say binary. We show a number in the pixel format say, and we ask the array to return what it should if he could see! But after its guess, we tell the array what bits should have been 0 rather than one, so next time they will not associate the same answer to the same pic....

Let's say the pic shows 000000... and the array returns randomly 01100... then we can tell the array where it's wrong.

But how does this allow the array to learn, that requires a lot of memory to store the appropriate answers for the learnt things. And how to extrapolate to unknown novelties??

Still have to read. Thanks anyway.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

Artificial neural networks use random numbers and random shuffling. With random shuffling it is impossible for a generator with less than 226 bits of internal state to produce all the possible permutations of a 52-card deck, for example. Mersenne Twister comes into its own here with a period of 2^19937 - 1 allowing shuffling a 2080-card deck. However, FB's implementation fails us here by only using a 32 bit seed. My RndMT, on the other hand, gives us access to all entry points of the sequence. My latest generator, CMWC4096, has a period of 2^131086 and gives access to all entry points. However, all PRNGs, to some extent, have a predictable output.

Of course, another way is to use a cryptographic generator which does not have a predictable output and has no idea what a period is. Cryptographic generator's are usually slow, see FB's generator #5, but my CryptoRndII is very fast.

For small nets, I should not think it makes a blind bit of difference. Paul Doe pointed this out to me a little while ago when my 'purist' stance was rejecting 'weak' generators when for small requests of random numbers it would not be possible to determine that they were weak.

For large nets I would use CryptoRndII.

Of course, being a purist if I got into neural networks then I would use CryptoRndII no matter what the size of the net was. <smile>
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

deltarho[1859] wrote:Artificial neural networks use random numbers and random shuffling.
My concern is more about how damn does the machine remember the previous states? That the experiment is not fully powerful, if the random coverage is not sufficient, I don't feel it as a disturbing point. But the way the things get in memory, I can't figure it. Just a set of coefficients suffices? What size should be such a set of tuning coefficients?As huge as the whole data or not far? Much less??
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: What is machine learning?

Post by Dinosaur »

Hi All

Just to show a different perspective on this.

Machine learning IMO is the ability of an intelligent device (computer) to adapt to external variables and "learn" to provide the
responses that will achieve the end result.

This could be applied in the area of voice recognition and decide the persons mood.
Equally it can analyze key strokes and learn that the typist is trying to say something.

My area of interest has always been Industrial machines, and reading various articles and attempting to get solutions
to certain problems has been disappointing.
Engineers as a whole still rely on simple logic to achieve basic performance , and then accept operator input to adapt
to and improve performance.

Unfortunately my math skills are sadly lacking, which caused me to approach a number of scholars in that area, but after years of this
I am back to identifiable logic with fine tuning input by operators on a regular basis, or recipes customized to suit the situation.

I understand the problem but simply can't translate it into a solution.
So anyone attempting machine learning better be prepared for the long haul.

Regards
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

I remember a cryptographer some years ago saying that a BSc degree in maths was one thing and an MSc degree in maths was another but until you have a PhD in cryptography then you cannot call yourself a cryptographer. I thought that was a little arrogant but having 'dabbled' in cryptography for the last 15 years I am now inclined to agree with him. It seems to me that we may have a similar situation with artificial intelligence.
Dinosaur wrote:So anyone attempting machine learning better be prepared for the long haul.
Getting a doctorate in any subject is a long haul. <smile>
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

deltarho[1859] wrote: Getting a doctorate in any subject is a long haul. <smile>
Ok let's graduate all of us!
Can you help me complete this naive embryon of try?

Code: Select all

 'a, b, c, d must be learned 

' (x + y)² = x² + y ² + 2 x*y
'the machine will try a*x + b*y + + c*x*y + d*y*x + e*x*x + f*y*y

function Try(a as double, b as double, c as double, d as double, e as double, f as double, x as double, y as double) as double
    return a*x + b*y + + c*x*y + d*y*x + e*x*x + f*y*y
end function

function TrueAnswer(x as double, y as double) as double
    return (x + y)^2
end function

function Make_a_vary_and_reinforce_best_choice(a as double, x as double, y as double) as double
    dim a1, b, c, d, e, f  as double
    a1 = rnd()*100 - 50
    b = rnd()*100 - 50
    c = rnd()*100 - 50
    d = rnd()*100 - 50
    e = rnd()*100 - 50
    f = rnd()*100 - 50
    '
    if (Try(a1, b, c, d, e, f, x, y) - TrueAnswer(x, y))<(Try(a2, b, c, d, e, f, x, y) - TrueAnswer(x, y)) then
        Probability_for_a += 0.01
        if Probability_for_a>1 then Probability_for_a = 1
    else
        Probability_for_a -= 0.01
        if Probability_for_a<1 then Probability_for_a = 0
    end if
    return Probability_for_a
end function

'(eof)
You should see what it wants to do. It supposes that the machine will learn (x +y)2 = x2 + y2 + 2xy, with only a more general configuration with 5 coefficients and an excess of operation to be removed by equalling some coefficients to 0. Said differently, probability for coefficient f to be 1 is 1. Ok there is no null coefficients here but you see what I mean!
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

Yours truly wrote:Mersenne Twister comes into its own here with a period of 2^19937 - 1 allowing shuffling a 2080-card deck.
I got that from Fisher–Yates shuffle toward the bottom.

The table goes as far as a deck of 4199. I wondered what size deck we could go to using CMWC4096 and got 10,940 for a period of 131010, just less than CMWC's 131086. I used the same arithmetic on 2080 and got 19932 - pretty close to MT's 19937.

So, if you want to shuffle up to 10,940 elements then CMWC4096 is one way to do it. Actually, if you want to shuffle more than 2080 elements then even MT falls short.

This is no big deal but if you want to shuffle more than 98 elements, for example, then you'll need a generator of at least more than 512 bits of internal state to cover all possible permutations; and there are not many of them. Needing to shuffle more than 98 elements is probably not particularly rare.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

Tourist Trap wrote:Can you help me complete this naive embryon of try?
I cannot. To write that means you have dabbled with this subject more than I have. <smile>
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

deltarho[1859] wrote:
Tourist Trap wrote:Can you help me complete this naive embryon of try?
I cannot. To write that means you have dabbled with this subject more than I have. <smile>
I think then that we are in a perfect equality because you can not have less knowledge than I in this ;)
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

<smile> Nice try!

I am reminded of "The blind leading the blind".

Here is another: The more incompetent a person is the more likely they are to over estimate their competence.

I am very competent and know exactly when I am out of my depth.

There must be others on this forum who can 'chip in'.
Post Reply