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

Re: What is machine learning?

Post by Tourist Trap »

deltarho[1859] wrote: Here is another: The more incompetent a person is the more likely they are to over estimate their competence.
Maybe you just need to be moved on this holly quest by an epic goal. You should consider then that I didn't really choose this challenge totally randomly. Very often in programming we meet nested IFs that we feel that we could simplify but we don't find the shortest boolean equation. This way to treat things with coefficients like above is made to let the machine solve this for us. Don't you find this as good as anything else as a daily grail?
Think of the ton of typing saved in nested loops and ifs if we could find how to train the computer to cleanse itself from excess of nested verbosity!


Said differently, my claim is that:
input -> nested ifs -> output
is the same as input -> single line boolean equation -> output

And finding the simple line form should be possible by a learning approach.
(or not)
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

Tourist Trap wrote:Think of the ton of typing saved in nested loops and ifs if we could find how to train the computer to cleanse itself from excess of nested verbosity!
I expect -O3 to do that for me. However, -O3 can be a tad over enthusiastic at times and I wish I had a switch to tell the compiler not to optimise specifically selected code.
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: What is machine learning?

Post by badidea »

Other interpretations of machine learning:
* People learning how to use a machine
* People being thought a machine (it happens in schools now)
But probably that is not what you mean.
Neural networks is one way of implementing machine learning. Another might be biological evolution like code (or a combination).
I assume that Facebook's face recognition uses a neural network, but in combination with pre-defined logic rules. Same for self-driving cars. The teaching time would otherwise be uneconomic and learning the car what a collision is and how to prevent it, is better not done by trial and error. Although it can also learn form "almost collisions".

The most advanced neural network code (with back-propagation) that I once made, was a program that learned the color 'yellow'. One does not need a neural net for this, but it went as follows:
3 inputs: Red, green and blue values (each 0...1 or -1...+1), maybe some additional inputs like "red squared". A few intermediate cells (although probably not needed for this simple case), 1 output cell (-1...+1), where > 0 was "yellow" and =< 0 was "not yellow". The 3 layers of cells connected by 2 layers of weights. Random values for the weights at start.

A random color was generated and its RGB components supplied to the inputs, the result was a "yellow" or "not yellow" output. I, as teacher, told the program then (by a key press) "correct" or "incorrect". In both cases the network could be adjusted based on these outcomes. Lets say I judged the result incorrect, then the program had to change something to its network. It is where to (complex) back-propagation comes in action.

It determines which of the inputs contributed most to the "error" (incorrect answer) based on its input cell value and connection weights. The weights where then adjusted accordingly. A little, not too much, like a child which might needs multiple corrections before it learns not to throw with Lego-bricks. Slowly, step be step, the program than became better a recognizing yellow to a point where the teacher (me, but it could be an Internet search engine as well) does not know anymore the difference between somewhat yellow and yellowish-green.

Not sure where I have the code. I tried more complex things, but I was disappointed by the results. To get better neural nets, a random initialized net is probably not the best. A human is also not born with a random initialized brain, there is already "code" present. And the current human or animal brain is most likely the result of millions of years of iteration (evolution) with millions of individuals and failures. Like a lot of CPU power and a very long running "program". I am talking more about general artificial intelligence now. Something different then a highly specialized machine that learned how to recognize faces or play Go (going the read the linked Go article now...)
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: What is machine learning?

Post by BasicCoder2 »

badidea wrote:
The most advanced neural network code (with back-propagation) that I once made, was a program that learned the color 'yellow'. One does not need a neural net for this,
True you could just list all the RGB values that you consider to be examples of the color yellow however a neural net may well use less units of memory and also be able to use those same units to output other color groupings otherwise you would need as many units of memory as there are possible colors in a 32 bit color code. 2^32

Code: Select all

'      +--------------+
'R --->|              |----> GREENS
'G --->|  connections |----> REDS
'B --->|              |----> BLUES
'      |              |----> PURPLES
'      |              |----> BROWNS
' and so on ... 
The human visual system actually makes decisions based on past experience about what it is seeing. Although you think you are seeing what is out there in fact it is an hallucination based on the current visual input and past experience. You see what you expect to see and fail to see things that should be easy to see. This is called attention blindness. The color you experience is influenced by bounding colors and the color of the light source. So it is not a simple matter of looking at the RGB values of a single area of color. Your ANN yellow may well be classified as brown by a human visual system.

https://nerdist.com/5-optical-illusions ... the-dress/
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

badidea wrote: Lets say I judged the result incorrect, then the program had to change something to its network. It is where to (complex) back-propagation comes in action.

It determines which of the inputs contributed most to the "error" (incorrect answer) based on its input cell value and connection weights. The weights where then adjusted accordingly
I don't see how to find who contributes most to the error. A key point really.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: What is machine learning?

Post by Dinosaur »

Hi All
I don't see how to find who contributes most to the error. A key point really.
You HAVE to take the human out of the decision making process. Keeping with the example of creating a colour, the feedback
has to be an electrical error signal (sensor) or a computation of the RGB values to decide if Yellow is possible with that combination.(only known to the programmer)
Rating the result on how close it is to yellow would be the "improvement".
Then when the different combinations are tested, the last change will signify an improvement or a greater deviation from the target.

Regards
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

Dinosaur wrote:the last change will signify an improvement or a greater deviation from the target.
I don't know why I figured out that I should change all the parameters at once. Thanks I see know, and I'll make some try.
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: What is machine learning?

Post by badidea »

Tourist Trap wrote:I don't see how to find who contributes most to the error. A key point really.
I found my old code, but it is a bit of a mess. Multiple different versions.
Anyway, back then, I found this link quite useful.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: What is machine learning?

Post by marcov »

I've had it with Machine Learning!

I fed my neural net two million throws of the dice, yet it still couldn't predict the outcome of the next one!
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: What is machine learning?

Post by Dinosaur »

Hi All
I fed my neural net two million throws of the dice, yet it still couldn't predict the outcome of the next one!
LOL, Try Lottery numbers next.

REgards
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: What is machine learning?

Post by badidea »

marcov wrote:I fed my neural net two million throws of the dice, yet it still couldn't predict the outcome of the next one!
You should not have used deltarho's random number generator for that.
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: What is machine learning?

Post by deltarho[1859] »

marcov wrote:I fed my neural net two million throws of the dice, yet it still couldn't predict the outcome of the next one!
That made me laugh. If it was so capable you would be in line for a Nobel Prize. <smile>

Talking of Lottery numbers I wrote a lottery program which uses Intel's RdRand. I win, admittedly small amounts, much more often that I did when a PRNG was used. Since I am not requesting shed loads of numbers it should not make a blind bit of difference, in theory. However, I have been using RdRand for some years now and the 'before' and 'after' results are significant. The reason? I have no idea. A friend has the same application but he does not have RdRand so I replaced it with BCryptGenRandom. I do better than him. I kid you not.

I did a very large test a few years ago on, I think, five generators and whilst they all had bad days, random numbers do that, RdRand's (good days)/(bad days) was significantly better than the rest. RdRand is not particularly fast but if you want really top draw quality it is gold dust.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: What is machine learning?

Post by marcov »

Better than the joke is keeping an eye on what machine learning really is used for in the current gulf: selecting products you might buy in commercial settings (commercials, related links etc). Mostly that's a business without a deep penalty for mis-predicts (false negatives or positives). It is a potential lost sale, nothing more (and the chances on sales are not extremely high to begin with)

I have some practical experience with machine learning from the machine vision world. Can be good on a somewhat predictable but fuzzy input stream. Somewhat predictable because results on input too far from the taught norm is unpredictable.

A certain fuzz factor is not required, but without it, other methods are usually heaps faster and more accurate.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: What is machine learning?

Post by Tourist Trap »

marcov wrote:Better than the joke is keeping an eye on what machine learning really is used for in the current gulf: selecting products you might buy in commercial settings (commercials, related links etc). Mostly that's a business without a deep penalty for mis-predicts (false negatives or positives). It is a potential lost sale, nothing more (and the chances on sales are not extremely high to begin with)
More worrying is the fact that the companies apply this technique to big data. But if you have the huge amount of data, you do not probably need machine learning, it will just be costless. Intuitively I can understand very well that any machine to which you give a sufficient amount of data will find the polynom that fits well for it. If you don't even need mathematical precision everywhere along your polynomial then use machine learning. Hopefully this vision won't be totally right, but in general it's maybe nothing but this, a gadget put at the entrance inteface of big data flow and that can converge towards a kind of sufficient predictor if correctly tuned depending on what you call sufficient.
Post Reply