Machine learning "from scratch" #2 How to train your neuron

avatar
(Edited)

How to train single neuron? How does methodology of learning look? What is DELTA rule? How to check training efficiency? What is ADALINE model?

graphics source

Philosophy of machine learning

British philosopher John Locke (do not confuse with character from popular TV series “Lost”) said that every man borns as “tabula rasa” (blank slate), without any built-in mental content what means that every mind needs experience during life to gain knowledge. If we consider his theorem we will find it’s truth. What is more, after 300 years we can easily make analogy to artificial neural networks, and say that they operate under the same rules. Artificial neurons after creating are not adapted to any tasks and they also have to be trained.

John Locke (from popular TV series “Lost”) and Dharma Project graphics source

The main idea is to show them repeatedly data sets and make them more "sensitive" for these data which we would classify as truth. Interesting is that after training, neural network is going to recognize also these data sets which it have never seen - but there is a condition - these data sets need look similar to training data. Sometimes it’s helpful, but sometimes not, so we will continue learning process using single batch for many iterations until we reach satisfying efficiency level.

Learning in progress..

We know main idea, but how does this “mechanism of learning” work? To be honest - it’s all coming down to synapses weights w tuning, exactly like in biological process. Every synapse is treaten as individual tuner for every input, what allows us to modulating signals which flow through single neuron.

graphics source

How does tuning look? We’re going to describe it, but first let’s tell about types of machine learning.

We distinguish the following types of training:

  • supervised learning - learning with a teacher (human) - it lets neuron for very precisely classification. For this type of training we must have two pieces of information which will be shown to our network - we need to know what we’d like set as inputs, and what result we would to receive as output. This willingness of receive specific result is called “prediction” (also known as “desired output”). If neuron has these informations, it will find all of dependencies between them, and will remember for the future classification.

  • unsupervised learning - learning without a teacher - this type of training uses so-called “cluster analysis”. It is slower than classical supervised learning (needs more iterations), but its undeniable advantage is that there’s no need to know what we would receive as output. After some time of training, without human interference neurons will "automatically" learn that there are data which are similar to the others, and there are data which are much different - that will be base for future classification.

In this article we consider only supervised learning case. Of course the most trivial method is manually setting of the synapses weights and watching what will we receive as output, but that’s not exactly what we would like to deal with (cause it’s boring!). There is a method which is much more better but still enough simple. Ladies and Gentlemen, I present to you DELTA rule.

DELTA - it sounds proud.graphics source

Some maths

DELTA rule for single input and for his synapse could be written as short equation:

wj|i+1 = wj|i + η(z - y)xi

where:

wj|i - synapse weight, number j in i iteration

wj|i+1 - weight of the same synapse in next iteration

xj - input, number j

z - desired output (prediction)

y - actual output

η - learning rate

j- input number or weight number

i - iteration number


Of course we apply rule for every j input.

For first iteration we should set weights as very small values, different from each other. This asymmetry doesn’t matter for single neuron, but it will do if we create more complex, multilayer network.

In equation appears learning rate η, which is a value chosen by human and which is instruction “how big step should learning function do, for every update of weights”. Process of learning could be compared to tuning the radio from early 90’s. This old type of radio has a knob, which we can turn to find frequency which is used by our favourite radio station. Now imagine that every turn of knob is iteration, and angle of turn is learning rate (learning step). If we change knob position too abruptly it could make result of searching really divergent from our expectations. Opposite situation is when we make too small, “shy” steps - then our tuning will take a long time and there is possibility that it never ends.

Morpheus about machine learning; graphics source

We are exactly in the same situation if we set too high or too low learning rate. That’s why optimal value for learning rate is so important - it provides satisfying algorithm convergence in enough short time.

Learning rate could be constant for whole time of training process, but there are also more complex algorithms where its gradually changed (so-called adaptive learning rate adjustment methods). In our case we will treat learning rate as a small number close to 0 (e.g. 0.07 or 0.2 or 0.4 etc.)

DELTA rule is iterative algorithm, what means that every step (iteration) updates synapses weights, what approximating actual output y to desired output z.

Something is going to update; graphics source

In theory we would to receive actual output y equal to desired output z. In mathematical context it means that we would like to minimize error function.

E = ½ Σj = 0 (zj - yj)2 -> min

where:

E - error function

zj - desired output for j

yj - output for single data set, number j

Error function is some kind of quality indicator. It determines how large averaged square error occurs after training between desired and actual outputs for all data sets. Of course we want it to be as small as is possible.

Summary

DELTA rule is rather simple method, but this is basis and starting point for more complex learning algorithms. It’s worth noting that after applying this learning rule, our neuron evolves from perceptron into ADALINE model (ADAptive LINear Element). In following articles I’m going to show how this simple model could be implement for hobby purposes (e.g. character recognition).

We made progress!; graphics source


Thanks for your attention!

Graphics

I confirm that I have used Google advanced image search with usage rights: "free to use, share or modify, even commercially"

Bibliography

  1. R. Tadeusiewicz "Sieci neuronowe" Akademicka Oficyna Wydaw. RM, Warszawa 1993. Seria: Problemy Współczesnej Nauki i Techniki. Informatyka.

See also:

Machine learning #1 About artificial neurons - perceptrons



0
0
0.000
8 comments
avatar

Thank you for your contribution.

  • The utopian tutorials are specifically to be used in a technical way to help the open source community learn new content.
  • In the next tutorial we suggest you use the tutorials template. Link

Please read the guidelines here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

0
0
0.000
avatar

Thank you for your review, @portugalcoin!

So far this week you've reviewed 12 contributions. Keep up the good work!

0
0
0.000
avatar



This post has been voted on by the steemstem curation team and voting trail.

There is more to SteemSTEM than just writing posts, check here for some more tips on being a community member. You can also join our discord here to get to know the rest of the community!

0
0
0.000
avatar

Hi @callmejoe!

Your post was upvoted by utopian.io in cooperation with steemstem - supporting knowledge, innovation and technological advancement on the Steem Blockchain.

Contribute to Open Source with utopian.io

Learn how to contribute on our website and join the new open source economy.

Want to chat? Join the Utopian Community on Discord https://discord.gg/h52nFrV

0
0
0.000
avatar

DHARMA project <3

0
0
0.000
avatar

[War Announce, 전쟁선언문] v.4.1 (@tipU talk included; revived from downvote-hide )
( https://steemit.com/selfvotejustice/@selfvotejustice/war-announce-v-4-1-tipu-talk-included-revived-from-downvote-hide )
2018.08.14.Tue.02:31 (utc+9), @SelfVoteJustice, revived from downvote-hide of

[War Announce, 전쟁선언문] v.4 (@tipU talk included; revived from downvote-hide )
( https://steemit.com/selfvotejustice/@selfvotejustice/war-announce-v-4-tipu-talk-included-revived-from-downvote-hide )
2018.08.14.Tue.02:31 (utc+9), @SelfVoteJustice, revived from downvote-hide of the original

[War Announce, 전쟁선언문] v.4 (@tipU talk included; revived from downvote-hide )
( https://steemit.com/selfvotejustice/@selfvotejustice/war-announce-v-4-tipu-talk-included-revived-from-downvote-hide )
2018.08.14.Tue.02:31 (utc+9), @SelfVoteJustice, revived from downvote-hide of the original

==

[War Announce, 전쟁선언문]

Why you are getting this message is that you got involved into the war for Right to live, Freedom of Speech/Writings/Curation and Right to be Shown since some stupid self-fucked-justice Content-Nazism or Anti-freedom Commie Red Guards are people's-court-bamboo-spearing me @SelfVoteJustice and my writings.

.

Sorry for your inconveniences, but this message will be revived and upgrade forever until it is not hidden. Peace will be made as soon as such slaughters stop.

.

How to avoid this message : You can be next victims. Don't tell me to stop this message since it is of no use, but tell the man-slaughterers not to man-slaughter or at least not to upvote, comment, resteem, or delegate you or your writings or you should expel the slaughterers from your voting investment guild. Or you can mute me.

.
downvoting slaughterers : @changyoon=@topping

여러분이 이 메시지를 보는 이유는 다음과 같은 전쟁터에 휘말렸기 때문입니다. 어리석은 자뻑 정의감에 의한 언론검열, 컨텐츠 나찌, 공산주의 홍위병들이 저 @SelfVoteJustice 및 그 글들을 인민재판 죽창질하고 있기에 생존권과, 언론의 자유, 글이 보여질 자유를 지키기 위한 불가피한 항쟁을 하고 있습니다.

.

불편을 느끼신다면 죄송하지만, 이 메세지는 감춰지지 않을때까지, 무한 반복 재생될 것입니다. 평화는 죽창질 학살이 멈춰진다면, 즉시 성립됩니다.

.

당신이 다음 죽창질의 희생자가 될 수도 있습니다. 이 메세지를 보고싶지 않으시다면, 학살받아 기본권을 위해 항쟁하는 피해자에게 하지 말아달라고 해서는 이루어질수 없으며, 학살자들에게 다운보팅 학살을 멈추거나, 아니면 최소한 님의 글에 업보팅, 댓글, 리스팀, 님에게 임대를 하지 말라고 하시거나, 여러분의 보팅조합에서 그들을 축출하셔야 합니다. 또는 저를 mute 하셔도 좋습니다.

==

Newly included in v.2 upgrade

Evidence of @changyoon=@topping

from
https://steemit.com/selfvotejustice/@selfvotejustice/4btp5c-confused-changyoon-for-or-against-selfvotejustice-campaign#@selfvotejustice/re-selfvotejustice-4btp5c-confused-changyoon-for-or-against-selfvotejustice-campaign-20180807t095801975z

Funny..

@changyoon has been downvoting-slaughter @SelfVoteJustice at his stupid self-fucked justice.

And @topping started to bamboo-spear from this post.

But @topping is delegating all his 18,838.689 STEEM Power
to voting robots (-18,778.040 STEEM)
and is downvoting with only the downvoting power of just 60.0 Steem.

Very funny.

And
What do these mean ?
Same guy?

--

Withdraw Vest. Route | changyoon(46) | 1%2018-08-02, 12:46
From Account @changyoon(46)
To Account @topping
Percent 100
Auto Vest

--

Withdraw Vest. Route | changyoon(46) | 0%2018-08-03, 18:10
From Account @changyoon(46)
To Account @topping
Percent
Auto Vest

--

2018.08.08
Delegator @changyoon(46)
Delegatee @topping
Vesting Shares 1000000.000000 VESTS

**

@topping
YOON (25)
14 followers No posts Not following anybody
Joined ‎March‎ ‎2018

18,838.689 STEEM
(-18,778.040 STEEM)

Delegatee Amount Vesting Shares Delegation Time
@steemhunt(63) 5,017.005 SP 10.165 MVests 2018-06-04, 03:58
@tipu(62) 13,761.049 SP 27.881 MVests 2018-06-22, 22:43

Delegator Amount Vesting Shares Delegation Time
@changyoon(46) 493.612 SP 1.000 MVests 2018-08-08, 12:41

**

Funny
No post, no comments for several months and just voting robot investing guy for interest profit
is bamboo-spearing others at the funny stupid self-fucked justice.

LOL

As I wrote in

@SelfVoteJustice : Who bamboo-spears Self-Voting ? v.1 part 1 - robot industry
( https://steemit.com/selfvotejustice/@selfvotejustice/selfvotejustice-who-bamboo-spears-self-voting-v-1-part-1 )
2018.07.30.Mon.07:07 (utc+9), @SelfVoteJustice

My prophecy was right.

The robot industry will bamboo-spear humans to gather their investors and buyers.
And robot industry investors are bamboo-spear human writer-and-curators to get more profit.

Very Silly !!

Is this a terminator war ?

==

Newly included in v.4 and upgraded in v.4.1

Talks with @tipU who pay the man-slaughterer @changyoon=@topping.

Copy from the original talks around https://steemit.com/selfvotejustice/@selfvotejustice/steem-invest-diary-2018-08-09#@selfvotejustice/re-tipu-re-selfvotejustice-re-arcange-re-steem-invest-diary-2018-08-09-20180809t185103609z

@tipU : Dude, can you stop spamming those book-long comments that make no sense at all?

@SelfVoteJustice : "

@tipu, thank you for your leaving your opinions.

If you are human and you read some part of my writings, at least the red fonts,
you may know what I mean at my writing.

It's not spamming.
It's for Right to live, Freedom of Writing and Curation, and Right to be Shown.

As you work for Steem people,
I also work for Steem people and Steem future.

If you are human,
I hope that you read the comment of mine,
and decide which side to go.

I hope that you decide not to make me your enemy but friend, then we can make Steem more peaceful and prosperous place.

If you decide to make me your enemy, it can be a war and I will try to destroy your voting guild though my fundamental philosophy is not against such voting guild since I am for selfvoting and mutual voting too.
"

@cardboard(=@tipU) : No, we're gonna do differently - leave @tipU alone.

@SelfVoteJustice : "

Hi, @cardboard.

Are you @tipU relevant ?

If yes,
I want to talk with you for peace.
We can stop the war with talks, I think.

If no, and you cannot control @tipU,
well we can still talk,
but I don't think we can stop my war.
I guess that you do as you do,
and I need to go on with my war for my Right to live, and Freedom of Speech and Curation.
"

@cardboard(=@tipU) : I am relevant to @tipU. I am in no war. Peace (and stop spamming).

@SelfVoteJustice : "

Thank you very much, @cardboard, for letting me know whom I can talk about this war with @tipU.

I have no reason to be in war with @tipU
except
that my enemies who downvoting-slaughter me @SelfVoteJustice is involved in @tipU, delegating and getting profit from @tipU.

He is @changyoon=@topping.
I would appreciate if you can read and do one of the things recommended to avoid my War Announce message.

'How to avoid this message : You can be next victims. Don't tell me to stop this message since it is of no use, but tell the man-slaughterers not to man-slaughter or at least not to upvote, comment, resteem, or delegate you or your writings or you should expel the slaughterers from your voting investment guild. Or you can mute me.

.
.
downvoting slaughterers : @changyoon=@topping'
.
.

_1. Please tell your client @topping not to downvote me @SelfVoteJustice
or
_2. Please tell your client @topping not to delegate @tipU,
and/or please expel and ban the downvoting-slaughters to join @tipU.
or
_3. Please tell your customers to mute me @SelfVoteJustice, in order not to see my War Announce messages.

Those are what I can think at this time.
If you have better suggestions, please let me know to consider.

Sorry for your inconveniences
and Thank you again for this kind talk,
@cardboard.

--

Regardless of the war above,
I am looking for profitable delegation service.

How much apr does @tipU provide ?

If @tipU is competitive, and @tipU declares ban for bamboo-spearing investers in order to avoid this kind of future wars involvement,

I am sure that I will let my supporters to invest at least more than @changyoon=@topping.
"

@tipU : I can not stop them from delegating to @tipU, they can delegate to whoever they want.

@SelfVoteJustice : "

I agree that you didn't know who some of your investors were,
and I know that you didn't mean this war.

And I don't want to hinder your business.
Rather I am interested in @tipU concept and I can be your supporter.

However, now you know that
some of your investors are bamboo-spearing others at their stupid self-fucked-justice,
and wars are broken out due to some of your investors' man-slaughtering,
and you, your customers and your business are being affected by the wars,

And the man-slaughtered victims, one side of the wars are letting you know how to avoid such astray bulletins from the battle fields.

I think that
it's time for you to decide your policy about this kind of inevitable wars
and hopefully this kind of man-slaughtering investors.

My War Announcement
for my Right to Live and Freedom of Wiring/Curation
will be revived forever until it is not downvoting-hidden,

and eventually it will secure my Life and Freedom in Steem
and will change the atmosphere of Steem.

It will remove such stupid self-fucked-justice Content Nazism, Content Fascism,
and the people's-court-bamboo-spearing Commie Red Guards from Steem,

and Steem will become a peaceful and prosperous place soon.
"

@cardboard(=@tipU) : Im sorry but just becsuse you are making accusations doesn't mean its true. How can I know that you didn't start it?

@SelfVoteJustice : "

Thank you, @cardboard, for your inqury.

Steem blockchain is said to be open database.

I guess that you are deeper into technology than me.
(I just guess since you are in @tipU.)

If you are interested in it 'its true',
you can check the blockchain.

Or you can even contact and ask @changyoon=@topping.
If he denies my story and stops downvoting me, no need of War for me.

And Peace instantly.
No need of my reviving the War Announce message any more.

He may acknowledge that he started downvoting and is still doing,
since he seems to be proud of it. Stupid.

And you know that 'its true', and it will help you decide your policy.
"

@tipU : I will just ignore you, have fun.I will just ignore you, have fun.

@SelfVoteJustice : "

'Not so bad choice, @tipU.
You will remain neutral, but pay the man-slaughters, and
Your customers and other investors will consider overall situations.'
"

@tipU : What man-slaughters, what are you talking about? I'm sorry but either your English is very bad or you need to see a doctor. Do whatever you want in your happy world, I'm afraid everyone else will ignore you as well.
The only thing you achieved is being very irritating. Consider this advice with doctor, eh?

@SelfVoteJustice : "

Doctors say I am very good.

For English, thank you for reminding me of my bad English, which I know.
If it is in grammar school, I need to study more,
but in real world and also in Steem world, most native or non-native English users can understand me even with my bad English. If you don't understand what I mean, I guess that you should study global English.

I guess that you know what I mean by man-slaughter, since we already talked about it without any difficulties around
https://steemit.com/selfvotejustice/@selfvotejustice/re-cardboard-re-selfvotejustice-re-cardboard-re-selfvotejustice-re-tipu-re-selfvotejustice-re-arcange-re-steem-invest-diary-2018-08-09-20180809t233718008z#@selfvotejustice/re-cardboard-re-selfvotejustice-re-tipu-re-selfvotejustice-re-tipu-re-selfvotejustice-re-cardboard-re-selfvotejustice-re-cardboard-re-selfvotejustice-re-tipu-re-selfvotejustice-re-arcange-re-steem-invest-diary-2018-08-09-20180810t021032493z

I think that you want to just evade the time of decision by saying that you don't understand what I mean.

It's your decision.
Let's see how the situations evolve.

Anyway, thank you for your opinions.
"

@tipU : I wont change it.

@SelfVoteJustice : It's your choice, and you will be responsible for your choice.

@tipU : Why do you think that you can just spam people with long copy-paste comments and threat people that they have to do what you tell them? Just no, I do not agree on this. Next time try to talk, explain what do you want - not spam with some stupid war-announce comments. Just go away, no one wants you here, mind your own business.

@SelfVoteJustice : "

Stupid.

Right to Live, Freedom of Speech/Write/Curation and Right to be Shown are quite more important than just my business and your business.

If you don't understand why I revive my writings,
even after your reading my War Announcement,
there's little to say more.

But if you want peace, the chance is always open.

Stop paying to the man-slaughterers.

"

@cardboard : Do you have any court judgment that he sloughtered a man (wtf am I even writing...). If no - go away.

@SelfVoteJustice : "

Stupid.
Man-slaughter in real world is hitting the man and killing and expel him from the real world. Man-slaughter in Steem is downvoting-hide somebody's writing and expel him from Steem.
Stop paying to man-slaughterers, @tipU.
"

@cardboard(=@tipU) : He can do whatever he wants, I'm not his dad and it's a private thing between you and him. Get off.

@SelfVoteJustice : "

Stupid.
Now I am talking about your @tipU policy to pay man-slaughtering investors.
The war is now also between me @SelfVoteJustice and @tipU paying to slaughterers.
Stop paying to man-slaughtering investors.

Enough talks made and know each other's opinions. Peace will be made as soon as @tipU stops paying to the slaughtering investors, @changyoon=@topping at this time and it is known to me.
"

@cardboard(=@tipU) : Have fun.

--

What's New in v.4.1

A few more stupid are joining down-voting slaughterers, but they are just humming.
For the time being, original a few bad guys are targeted until the man-slaughtering voting guild @tipU is exploded.
Fun Game.

0
0
0.000
avatar

Congratulations @callmejoe! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

0
0
0.000