Sign in to follow this  
Followers 0
qwertylol

neural network

4 posts in this topic

has someone tried to write that in au3 ?

Share this post


Link to post
Share on other sites



Well if you want to start in this subject i would recommend to make a perceptron, which is the simplest version of a neural network.

I just made this in a couple of minutes, it is not very clean but it should be able to learn OR logic command, and you will see the changes in the weights of it while it trains.

When you open the program the weights will be a random number and if you enter 0 or 1 to X and Y you will have random results, but after you train it you will see that if you input (1,1) you will have 1, (1,0) and (0,1) will give you 1 as well and (0,0) will give you 0.

#include <GUIConstants.au3>
GUICreate("Perceptron", 300, 3ÂBJÚÝÜÚYH

HÈ
ÚÝÜZYÚH
N
HÈÂBIÌÍÕÔ×õdU$ÄTEtäDõr²b33cµu5õd4$ÄR²b33cµu5ô4Ä4$Ääu2¤wV7G&Ä7&VFTÆ° ÅÕ½Ðí`èÅÕ½Ðì°ÄÀ°ÈÀ°ÈÀ°ÈÀ¤(ÀÌØí½`ôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕt;, 25,18,20,20)
GuiCtrlCreateLabel("Y:", 10,50,20, 20)
$oY HÕRPÝÜX]R[]
    ][ÝÉ][ÝËK

BÌÍÑÕRWÐ]ÛÕZ[[ÈÒuT7G&Ä7&VFT'WGFöâgV÷CµG&æærgV÷C²ÂsÂ#cRÂÂ3¢b33c´uTô'WG½¹}MÑÉÐôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíIÕ¸ÅÕ½Ðì°ÄäÀ°ÈØÔ°ÄÀÀ°ÌÀ¤)Õ¥
Ñɱ
eateLabel("Learning Rate", 5,100,75,20)
$oLR=1
$oWX=RanÛJLKJBÌÍÛÕÖOT[ÛJLKJBÌÍÛÕØT[ÛJLKJBÝZPÝÜX]SX[
    V÷Cµ&W7VÇC¢gV÷C²Â#Ã##ÃSÃ#¢b33c¶õ&W7VÇBÒuT7G&Ä7&VFTçWBgV÷ìÅÕ½Ðì°ÈÔ°ÈÌà°ÈÀ°ÈÀ¤)Õ¥
Ñɱ
ÉÑ1° ÅÕ½ÐíY±Õ̽èÅÕ½Ðì°ÄÀÀ°ÄÀ°5,20)
GuiCtrlCreateLabel(StringFormat( "  %.2f   %.2f   %.2f", &#ÍÛÕÞ ÌÍÛÕÖK ÌÍÛÕØ[ÐÔKMKLL
BÌÍÚLÌÍÛÕÈHT7G&Ä7&VFTçWBgV÷C²gV÷C²ÂÃ#ÃSÃ#3Âb33c´U5ôÕTÅDÄäR²b33c´U5]9QIQUI8¤)U%MÑMÑÑ ¤)]¡¥±Ä($ÀÌØíµÍôU%Ñ5Í ¤(%M±Ð($Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = &#036ÑÕRWÐ]ÛÔÝBBRY
    ÌÍÛÕÖ
ÕRPÝXY
    ÌÍÛÖ
JÉÌÍÛÕÖJÕRPÝBb33c¶õ²b33c¶õv"fwC³FVà uT7G&Å6WDFFb33c¶õ&W7VÇBÃ VÇ($$$%U%
ÑɱMÑÑ ÀÌØí½IÍձаÀ¤($$%¹%($%
ÍÀÌØíµÍôÀÌØíU%Button_Training
            $i=1
            While $i<10
                $k=1
                For &ÌÍÚÏLHÈ
ÝBBBBBTÙ[XÝBBBBBPØÙH   ÌÍÚÏLHÈKBBBBBBBIÌÍÙCÒb33c¶õu²b33c¶õu²b33c¶õv  b33c¶æ5uÒb33c¶ôÅ"¢Òb33c¶W7B $$$$$$ÀÌØí¥¹]dôÀÌØí½1H¨ Ä´ÀÌØíÍФ($$$$$$$ÀÌØí¥¹]ôÀÌØí½1H¨ Ä´036;est)
                            $oWX=$oWX+$incWX
                            $oWY=$oWY+ÌÍÚ[ÕÖBBBBBBBIÌÍÛÕØIÌÍÛÕØÉÌÍÚ[ÕØBBBBBPØÙH  ÌÍÚÏLÈK b33c¶W7CÒb33c¶õu²b33c¶õv  b33c¶æ5uÒb33c¶ôÅ"¢Òb33cÍФ($$$$$$$ÀÌØí¥¹]ôÀÌØí½1H¨ Ä´ÀÌØíÍФ($$$$$$$ÀÌØí½]`ôÀÌØí½]`¬#036;incWX
                            $oWb=$oWb+$incWb
                        Case $k=3 ; 0,BBBBBBBIÌÍÙÝIÌÍÛÕÖJÉÌÍÛÕØBBBBBBIÌÍÚ[ÕÖOIÌÍÛÓKIÌͶW7B b33c¶æ5v#Òb33c¶ôÅ"¢Òb33c¶W7B b33c¶õuÒb33c¶õuÀÌØí¥¹]d($$$$$$$ÀÌØí½]ôÀÌØí½]¬ÀÌØí¥¹]($$$$$%
ÍÀÌØí¬ôÐìÀ°
                            $est=$oWb
                            $incWb=$oLR*(0-$est)
                BBIÌÍÛÕØIÌÍÛÕØÉÌÍÚ[ÕØBBBBBBPÛÛÛÛUÜ]J   ][ÝÈ  ][ÝÉ[ÉÌ3c¶æ5v"f×´5" VæE6VÆV7@ bb33c¶¢fÇC³ÓrFVà uT7G&Å6WDÑ ÀÌØí½°ÀÌØí¨µÀíMÑÉ¥¹½ÉµÐ ÅÕ½Ðìì¸É¸É¸f", $oWx, $oWY, $oWb)&@CRLF,"update")
            Q[ÙBBBBBQÕRPÝÙ]]J   ÌÍÛÕË  ÌÍÚ[ÔÝ[ÑÜX]
    ][ÝÎÈRã&bRã&bRã&bgV÷C²Âb33c¶õwÂb33c¶õuÂb33c¶õv"f×´5$Äb $$%¹%($$$$ÀÌØí¨ôÀÌØí¨¬Ä($$$%% ÀÌØí½]`¬ÀÌØí½]d¬ÀÌØí½]ÐìÀ¤nd ($oWX+$oWb)>0 And ($oWY+$oWb)>0 And $oWb&ÏL[BBBBIÌÍÚOLBBBBIÌÍÚÏMBBBQ[YBBBS^BBUÑ[BQ[ÙÆV7@¥tVæ@¤uTFVÆWFR¤W@

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0