明確概念
Strategies of learning: Supervised learning(有測(cè)試集結(jié)果), Unsupervised learning(無(wú)測(cè)試集結(jié)果), Reinforcement learning(有環(huán)境感知)
Perception algorithm: input by its weight, sum all of the weighted inputs, Compute the perception output
lerp: lerp(start,stop,amt), 一個(gè)變量在 start 和 stop 之間按照 amt 取值指定一個(gè)數(shù)番电,the lerp function is convenient for creating motion along a straight path and for drawing dotted lines.
明確功能
1.通過(guò)感知算法判斷一個(gè)點(diǎn)落在線的左邊還是右邊
-Provide perception inputs and known answer
-Ask perception to guess the answer
-Compute the error
=desired - guess
=input * (desired - guess)
=weight +?input * (desired - guess)
=weight +?input * (desired - guess) * learning rate
-Adjust all the weights according to the error
-Repeat N times to get appropriate input weights
功能設(shè)計(jì)
類:Perception
屬性:weights
方法:guess, feedforward
偽代碼
setup(){
}
draw(){
}
class Perception{
? ? 定義屬性
? ? Perception(){}
????定義方法
}
正式代碼
見(jiàn):
Processing/Neural_networks at master · JoeyQiang/Processing · GitHub
代碼優(yōu)化
1.點(diǎn)集出現(xiàn)“虛擬線”的左右兩側(cè)
2.Neural networks diagram