Author Topic: Application of a "Bias" in AI Programming  (Read 6672 times)

0 Members and 1 Guest are viewing this topic.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Application of a "Bias" in AI Programming
« on: September 06, 2018, 11:04:23 am »
In an AI program, the decision making process often calls for the program to interpret an event and place a weight value to the results. As an example the program determines if the event increases or decreases a particular value. The increase/decrease could be used as a "weight" should that particular event be encountered in the future. I'm now exploring how to place a Bias to that weight however I'm not sure if the bias which I'm reading about in AI programming is one generated by the programmer or does the program itself determine the bias. Would a bias mean that I would need to consider the likelihood of the event occurring as I have a better idea of where I want the program to go or would a "normal" AI program explore the event more (ie how many times in the past or how relevant/impactful the event was) in order to measure a bias value?

FellippeHeitor

  • Guest
Re: Application of a "Bias" in AI Programming
« Reply #1 on: September 06, 2018, 01:34:12 pm »
Deep question. Hope someone will have a good reply for you soon (I have no idea).

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #2 on: September 06, 2018, 02:00:10 pm »
I can barely comprehend my own intelligence (or lack there-of) therefore your question is a deep one as Fellippe points out. I started down the AI path back in 1992 when I published a connect four program in a magazine that used an AI engine of my own design. I started reading books on the subject and soon realized the complexities involved in programming such beasts would need to be a full time endeavor with training in many disciplined areas.

My suggestion is to find books on the AI subjects you wish to explore, or better yet, find a forum where these deep subjects are discussed by other interested parties.

Good luck in your studies and I do look forward to any code you may share in the future. The subject fascinates me.
In order to understand recursion, one must first understand recursion.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #3 on: September 06, 2018, 05:04:32 pm »
I too am a fan of AI but apparently I have a limited tolerance for abstract theory and prefer to perform experiments in code.

I too wrote up an AI for Connect 4, but not sure I want to publish. It's just coding how I would play only it can see diagonal connects way better than I, :) I have to be on my toes just to tie. I have read that there is a way to play a perfect game and if you go first you are a sure winner.

And then there was Battleship! One of these days I might get to chess, but I think checkers would have to be first.

So Dimster I hope you stay with this forum and keep us updated on your progress. The field is very broad from game AI to facial or voice recognition to driving and avatar's on Mars... do you have a particular area of interest?

BTW are you asking about training a Neural Net with weights and bias talk?
« Last Edit: September 06, 2018, 05:05:35 pm by bplus »

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #4 on: September 07, 2018, 10:34:04 am »
Thanks Guys - the code I have written so far is rough, infantile and leads me to believe the computer (not me) is very dumb. Yes bplus I'm trying to understand the Sigmoid Neurons in terms of the basic language. Appears a lot of the present AI coding is in Python. Back on the .net I had some good advice on further reading for Decision Algorythms which has lead me to this point. I think I have a few more years of reading and coding before my SN can can raise its game to kindergarten status. But the joy is in the hunt. I think what I will try is both approaches for a BIAS.

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #5 on: September 07, 2018, 06:54:24 pm »
Dimster, I think the answer is yes.

This is a philosophical question, and I'd say the answer depends on who wants the AI app. In my line of work, the customer expects predictable and repeatable performance, and not something you might use as a demo, to show of how AI makes decisions like haphazard human beings. So any bias has to be configured by the programmer, responding to performance requirements.

On the other hand, I might imagine a machine learning program, which determines outcomes for different "biases," and then adjusts accordingly over time. But as I alluded to before, the unpredictability of such a program would make it unacceptable in certain control applications. My 2 cents' worth.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #6 on: September 08, 2018, 09:02:10 am »
Thank you Bert

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Application of a "Bias" in AI Programming
« Reply #7 on: September 08, 2018, 09:18:17 am »
I think all AIs have to start first with the programmer's bias, and then evolve from there.   Consider something like a predictive spellchecker: 

First, you'd program it with a dictionary.  Then you'd tell it what YOU thought the common words should be, and a few basic rules of grammer.  "Joe ATE dinner", instead of "Joe EAT dinner."  In this case, you're teaching it some basic tense structure....

And the user goes back and corrects the issue by making it, "Joe, EAT dinner".  Now instead of saying what Joe did in the past, it's a direct command for him to do something in the present...

The AI started with what you taught it, but it records the user's actual style of typing/writing, and in time it changes the response from "change EAT to ATE", to become, "ADD comma after subject".

It starts with what we -- the programmers -- know/think to be correct, and then it "learns" from there.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #8 on: September 08, 2018, 11:27:15 am »
I watched this, basic Perceptron,

and think this might be translated to QB64.

Hi Dimster, Is this the kind of stuff you are looking into from Python video's?

When you talk of events and their probabilities it sounds like probability theory.
Isn't bias another name for weight?

Anyway in video link above, I learn that weights are started with Random values and are "trained" with computer program to match a given set of samples, improving the guessing process slowly, adjusting weights incrementally according to errors in guesses.

It all looks so easy until you go and try to duplicate what you saw. ;D

Append:
Oh here is the book author referred to in video link above:
https://natureofcode.com/book/chapter-10-neural-networks/
EDIT: Daniel Shiffman's book

Append #2: Oh there's the bias! used to prevent washout from multiplications by 0.
« Last Edit: September 08, 2018, 12:18:42 pm by bplus »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #9 on: September 08, 2018, 12:46:23 pm »
Hi Dimster
in my little experience I Agree with Steve
Quote
It starts with what we -- the programmers -- know/think to be correct, and then it "learns" from there.
in the way that if you create an AI and you give to AI: a memory ( a system to record) , an insight (a system to evaluate that is stored), a judgment ( a system to compare actual parameters in use with that comes up from stored experience), an autodrive (a system to change behaviores: divinding it in a system to create behavioures and a system to evaluate behavioures ) then you can give to AI a bias as addictional  behaviour or you can believe that in a long time of evolution (experience->evaluation ->adjourning parameters -> doing many alternative behavioures using new parameters ->evaluating behavioures-> select best behavioures to use)  the AI that you have coded evaluate the bias as a good value/parameter to bring with it.

So you must have strong flexibile algorythm to gain these results with an AI...
See  how rigid is the algorithm to do the best choice among all those possible.
https://www.hackerearth.com/blog/artificial-intelligence/minimax-algorithm-alpha-beta-pruning/

On the other hand I remember that on the offline website (.net) someone posted a link to a video in which we can see how AI can learn playing a videogame and how AI can increase its performances using neural network system.

Good Coding
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #10 on: September 08, 2018, 02:07:23 pm »
OK it looks like Bias is treated as another input to "weigh" and adjust in training sessions, it has automatic value of 1 so when all the other inputs might be 0 there is still a value to weigh ie the sum won't be 0. Bias is a way to track the origin, could be very important for pattern recognition the relation to the origin,

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #11 on: September 08, 2018, 02:14:33 pm »
I did an AI for a card game once. It would track the players bets and plays and form a bias on how it would respond based on that data. It seemed like it played better when a player played better, but it wasn't completely AI. Good play was based on a known set of playing statistics, so all the AI was really doing was adjusting its play to a randomized set of bets and moves within a skill level database, determined by the player's deviation from the best known possible bet and play.

Pete

- My wife says I have N.I. which I assume means "Natural" Intelligence, but she says that contains too many syllables.
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #12 on: September 08, 2018, 03:37:53 pm »
Thanks again all - I have read the articles/watched YouTube and all of it is very helpful. I did view that video back on .net but didn't keep the link.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #13 on: September 08, 2018, 10:51:09 pm »
OK Bias in action!

Code: QB64: [Select]
  1. _TITLE "NN 1" 'by B+ started 2018-09-08 my first attempt with training a Neural Net
  2.  
  3. '2018-09-09 retest this updating the Bias Weight with the others, though I suspect it will stir up a storm? Nope!
  4.  
  5. CONST WW = 800
  6. CONST WH = 620
  7. SCREEN _NEWIMAGE(WW, WH, 32)
  8. _SCREENMOVE 300, 60
  9.  
  10. 'need a place to store inputs x, y, B for bias
  11. 'well just use loops
  12. 'dim and init weights
  13. CONST LR = .2 'Learning Rate don't overcorrect errors
  14. DIM SHARED BiasWeight AS SINGLE, Bias AS INTEGER, ArrayStart AS INTEGER, ArrayEnd AS INTEGER, SQ AS INTEGER, Mode AS INTEGER
  15. DIM i AS INTEGER, rx AS INTEGER, ry AS INTEGER, colr AS LONG, cnt AS INTEGER, x AS INTEGER, y AS INTEGER, correct AS SINGLE
  16. Mode = 1
  17. ArrayStart = 1 'Start range of x, y
  18. ArrayEnd = 60 'End range of x, y
  19. SQ = 10 'for graphic squares drawing to watch Perceptron Learn Y > X
  20.  
  21. 'setup weights
  22. DIM SHARED WX(ArrayStart TO ArrayEnd) AS SINGLE, WY(ArrayStart TO ArrayEnd) AS SINGLE
  23. Bias = 1
  24. BiasWeight = RND * 2 - 1
  25. FOR i = ArrayStart TO ArrayEnd
  26.     WX(i) = RND * 2 - 1
  27.     WY(i) = RND * 2 - 1
  28.  
  29. '61 x 61 squares of side 10 pixels fit in 610 x 610 pixel area
  30. 'train 1000 random points per frame 10 frames per second and show progress of learning hopefully
  31. WHILE _KEYDOWN(27) = 0
  32.     CLS
  33.     IF Mode = 1 THEN _TITLE "Training Pattern #1: Y >= X" ELSE _TITLE "Training Pattern #2: Framed!"
  34.     cnt = 0
  35.     FOR i = 1 TO 1000 'train 10% of points at a time
  36.         rx = INT(RND * ArrayEnd) + 1: ry = INT(RND * ArrayEnd) + 1 '60 x 60 field so can show circles of radius 10
  37.         Train rx, ry
  38.     NEXT
  39.     FOR y = ArrayStart TO ArrayEnd
  40.         FOR x = ArrayStart TO ArrayEnd
  41.             IF Mode = 1 THEN
  42.                 IF TrainThis%(x, y) = -1 THEN LINE (x * SQ, y * SQ)-STEP(SQ, SQ), _RGB32(0, 0, 255), B
  43.                 IF TrainThis%(x, y) = 1 THEN LINE (x * SQ, y * SQ)-STEP(SQ, SQ), _RGB32(255, 255, 255), B
  44.                 IF TrainThis%(x, y) - Perceptron%(x, y) THEN 'wrong! Perceptron
  45.                     colr = _RGB32(255, 0, 0)
  46.                 ELSE 'good job Perceptron!
  47.                     colr = _RGB32(0, 200, 0): cnt = cnt + 1
  48.                 END IF
  49.             ELSE
  50.                 IF TrainThat%(x, y) = -1 THEN LINE (x * SQ, y * SQ)-STEP(SQ, SQ), _RGB32(0, 0, 255), B
  51.                 IF TrainThat%(x, y) = 1 THEN LINE (x * SQ, y * SQ)-STEP(SQ, SQ), _RGB32(255, 255, 255), B
  52.                 IF TrainThat%(x, y) - Perceptron%(x, y) THEN 'wrong! Perceptron
  53.                     colr = _RGB32(255, 0, 0)
  54.                 ELSE 'good job Perceptron!
  55.                     colr = _RGB32(0, 200, 0): cnt = cnt + 1
  56.                 END IF
  57.             END IF
  58.             LINE (x * SQ + 2, y * SQ + 2)-STEP(SQ - 3, SQ - 3), colr, BF
  59.         NEXT
  60.     NEXT
  61.     correct = INT(cnt * 10000 / (61 * 61)) / 100
  62.     _PRINTSTRING (650, 10), "Correct:" + STR$(correct) + "%"
  63.     IF Mode = 1 THEN
  64.         _PRINTSTRING (640, 30), "White Frame Y >= X"
  65.         _PRINTSTRING (640, 50), " Blue Frame Y <  X"
  66.     ELSE
  67.         _PRINTSTRING (620, 30), "White Frame Train +1"
  68.         _PRINTSTRING (620, 50), " Blue Frame Train -1"
  69.         _PRINTSTRING (640, 180), "Wait for it... ;)"
  70.     END IF
  71.     _PRINTSTRING (640, 70), "Green Fill Correct"
  72.     _PRINTSTRING (640, 90), "Red Fill Incorrect"
  73.     _PRINTSTRING (620, 130), "Training 1000 random"
  74.     _PRINTSTRING (620, 146), "points in 10th second."
  75.     IF correct > 95.51 AND Mode = 1 THEN
  76.         Mode = 2
  77.         mBox "Hmm... there seems to be a real battle at the border. OK 95.5% has been exceeded, let's see how fast this retrains to a new pattern...", "OK Now Test New Training Set!"
  78.     ELSEIF Mode = 2 AND correct > 96.5 THEN
  79.         mBox "Over a 96.5% chance you're pregnant!", "OMG!"
  80.         SYSTEM
  81.     END IF
  82.     _DISPLAY
  83.     _LIMIT 10
  84.  
  85. FUNCTION Perceptron% (x AS INTEGER, y AS INTEGER)
  86.     DIM sum AS SINGLE
  87.     sum = x * WX(x) + y * WY(y) + Bias * BiasWeight 'sum the inputs times weight
  88.     Perceptron% = Sign%(sum) 'apply the activation function to the sum for output
  89.  
  90. FUNCTION Sign% (n AS SINGLE) 'very simple activation function
  91.     IF n < 0 THEN Sign% = -1 ELSE Sign% = 1
  92.  
  93. 'this sub trains one randomly chosen Perceptron weight set
  94. SUB Train (rx AS INTEGER, ry AS INTEGER)
  95.     'adjust Perceptrons weights until get good results
  96.     '1. provide Perceptron with Inputs for which the correct answer is known
  97.     '2. have perceptron guess the answer
  98.     '3. Compute the error
  99.     '4. Adjust weights according to error
  100.     '5. repeat until shaped up
  101.  
  102.     'so what are we going to train , oh there it is
  103.     DIM Guess AS INTEGER, Correct AS INTEGER, Errror AS SINGLE, OK$
  104.     Guess = Perceptron%(rx, ry)
  105.     IF Mode = 1 THEN
  106.         Correct = TrainThis%(rx, ry)
  107.     ELSE
  108.         Correct = TrainThat%(rx, ry)
  109.     END IF
  110.     Errror = Correct - Guess 'either 0 when Guess = Correct  -2 or 2 when not
  111.     IF Errror THEN
  112.         WX(rx) = WX(rx) + rx * Errror * LR
  113.         WY(ry) = WY(ry) + ry * Errror * LR
  114.         BiasWeight = BiasWeight + 1 * Errror * LR
  115.     END IF
  116.  
  117. FUNCTION TrainThis% (x AS INTEGER, y AS INTEGER)
  118.     IF y >= x THEN TrainThis% = 1 ELSE TrainThis% = -1 'the x = y function is the line between true and false
  119.  
  120. FUNCTION TrainThat% (x AS INTEGER, y AS INTEGER) 'draw a frame
  121.     IF x = ArrayStart OR x = ArrayStart + 1 OR x = ArrayEnd - 1 OR x = ArrayEnd THEN
  122.         TrainThat% = 1
  123.     ELSEIF y = ArrayStart OR y = ArrayStart + 1 OR y = ArrayEnd - 1 OR y = ArrayEnd THEN
  124.         TrainThat% = 1
  125.     ELSEIF x >= 29 AND x <= 32 AND y >= 12 AND y <= 49 THEN
  126.         TrainThat% = 1
  127.     ELSEIF y >= 29 AND y <= 32 AND x >= 12 AND x <= 49 THEN
  128.         TrainThat% = 1
  129.     ELSE
  130.         TrainThat% = -1
  131.     END IF
  132.  
  133. 'title$ limit is 57 chars, all lines are 58 chars max
  134. ' version bak 2018-09-07_10P
  135. SUB mBox (m$, title$)
  136.  
  137.     'first screen dimensions items to restore at exit
  138.     DIM curScrn AS LONG, backScrn AS LONG, mbx AS LONG 'some handles
  139.     DIM ti AS INTEGER, limit AS INTEGER 'ti = text index for t$(), limit is number of chars per line
  140.     DIM i AS INTEGER, j AS INTEGER, ff AS _BIT, add AS _BYTE 'index, flag and
  141.     DIM bxH AS INTEGER, bxW AS INTEGER 'first as cells then as pixels
  142.     DIM mb AS INTEGER, mx AS INTEGER, my AS INTEGER, mi AS INTEGER, grabx AS INTEGER, graby AS INTEGER
  143.     DIM tlx AS INTEGER, tly AS INTEGER 'top left corner of message box
  144.     DIM lastx AS INTEGER, lasty AS INTEGER, r AS INTEGER
  145.     DIM b$, c$, tail$, d$
  146.     sw = _WIDTH
  147.     sh = _HEIGHT
  148.     fg = _DEFAULTCOLOR
  149.     bg = _BACKGROUNDCOLOR
  150.     'screen snapshot
  151.     curScrn = _DEST
  152.     backScrn = _NEWIMAGE(sw, sh, 32)
  153.     _PUTIMAGE , curScrn, backScrn
  154.  
  155.     'setup t$() to store strings with ti as index, linit 58 chars per line max, b$ is for build
  156.     REDIM t$(0): ti = 0: limit = 58: b$ = ""
  157.     FOR i = 1 TO LEN(m$)
  158.         c$ = MID$(m$, i, 1)
  159.         'are there any new line signals, CR, LF or both? take CRLF or LFCR as one break but dbl LF or CR means blank line
  160.         SELECT CASE c$
  161.             CASE CHR$(13) 'load line
  162.                 IF MID$(m$, i + 1, 1) = CHR$(10) THEN i = i + 1
  163.                 t$(ti) = b$: b$ = "": ti = ti + 1: REDIM _PRESERVE t$(ti)
  164.             CASE CHR$(10)
  165.                 IF MID$(m$, i + 1, 1) = CHR$(13) THEN i = i + 1
  166.                 t$(ti) = b$: b$ = "": ti = ti + 1: REDIM _PRESERVE t$(ti)
  167.             CASE ELSE
  168.                 IF c$ = CHR$(9) THEN c$ = SPACE$(4): add = 4 ELSE add = 1
  169.                 IF LEN(b$) + add > limit THEN
  170.                     tail$ = "": ff = 0
  171.                     FOR j = LEN(b$) TO 1 STEP -1 'backup until find a space, save the tail end for next line
  172.                         d$ = MID$(b$, j, 1)
  173.                         IF d$ = " " THEN
  174.                             t$(ti) = MID$(b$, 1, j - 1): b$ = tail$ + c$: ti = ti + 1: REDIM _PRESERVE t$(ti)
  175.                             ff = 1 'found space flag
  176.                             EXIT FOR
  177.                         ELSE
  178.                             tail$ = d$ + tail$ 'the tail grows!
  179.                         END IF
  180.                     NEXT
  181.                     IF ff = 0 THEN 'no break? OK
  182.                         t$(ti) = b$: b$ = c$: ti = ti + 1: REDIM _PRESERVE t$(ti)
  183.                     END IF
  184.                 ELSE
  185.                     b$ = b$ + c$ 'just keep building the line
  186.                 END IF
  187.         END SELECT
  188.     NEXT
  189.     t$(ti) = b$
  190.     bxH = ti + 3: bxW = limit + 2
  191.  
  192.     'draw message box
  193.     mbx = _NEWIMAGE(60 * 8, (bxH + 1) * 16, 32)
  194.     _DEST mbx
  195.     COLOR _RGB32(60, 40, 25), _RGB32(225, 225, 255)
  196.     LOCATE 1, 1: PRINT LEFT$(SPACE$((bxW - LEN(title$) - 3) / 2) + title$ + SPACE$(bxW), bxW)
  197.     COLOR _RGB32(225, 225, 255), _RGB32(200, 0, 0)
  198.     LOCATE 1, bxW - 2: PRINT " X "
  199.     COLOR _RGB32(60, 40, 25), _RGB32(255, 160, 90)
  200.     LOCATE 2, 1: PRINT SPACE$(bxW);
  201.     FOR r = 0 TO ti
  202.         LOCATE 1 + r + 2, 1: PRINT LEFT$(" " + t$(r) + SPACE$(bxW), bxW);
  203.     NEXT
  204.     LOCATE 1 + bxH, 1: PRINT SPACE$(limit + 2);
  205.  
  206.     'now for the action
  207.     _DEST curScrn
  208.  
  209.     'convert to pixels the top left corner of box at moment
  210.     bxW = bxW * 8: bxH = bxH * 16
  211.     tlx = (sw - bxW) / 2: tly = (sh - bxH) / 2
  212.     lastx = tlx: lasty = tly
  213.     'now allow user to move it around or just read it
  214.     WHILE _KEYDOWN(27) = 0 AND _KEYDOWN(13) = 0 AND _KEYDOWN(32) = 0
  215.         CLS
  216.         _PUTIMAGE , backScrn
  217.         _PUTIMAGE (tlx, tly), mbx, curScrn
  218.         _DISPLAY
  219.         WHILE _MOUSEINPUT: WEND
  220.         mx = _MOUSEX: my = _MOUSEY: mb = _MOUSEBUTTON(1)
  221.         IF mb THEN
  222.             IF mx >= tlx AND mx <= tlx + bxW AND my >= tly AND my <= tly + 16 THEN 'mouse down on title bar
  223.                 IF mx >= tlx + bxW - 24 THEN EXIT WHILE
  224.                 grabx = mx - tlx: graby = my - tly
  225.                 DO WHILE mb 'wait for release
  226.                     mi = _MOUSEINPUT: mb = _MOUSEBUTTON(1)
  227.                     mx = _MOUSEX: my = _MOUSEY
  228.                     IF mx - grabx >= 0 AND mx - grabx <= sw - bxW AND my - graby >= 0 AND my - graby <= sh - bxH THEN
  229.                         'attempt to speed up with less updates
  230.                         IF ((lastx - (mx - grabx)) ^ 2 + (lasty - (my - graby)) ^ 2) ^ .5 > 10 THEN
  231.                             tlx = mx - grabx: tly = my - graby
  232.                             CLS
  233.                             _PUTIMAGE , backScrn
  234.                             _PUTIMAGE (tlx, tly), mbx, curScrn
  235.                             lastx = tlx: lasty = tly
  236.                             _DISPLAY
  237.                         END IF
  238.                     END IF
  239.                     _LIMIT 400
  240.                 LOOP
  241.             END IF
  242.         END IF
  243.         _LIMIT 400
  244.     WEND
  245.     'put things back
  246.     COLOR _RGB32(255, 255, 255), _RGB32(0, 0, 0): CLS
  247.     _PUTIMAGE , backScrn
  248.     _DISPLAY
  249.     COLOR fg, bg
  250.     _FREEIMAGE backScrn
  251.     _FREEIMAGE mbx
  252.     _KEYCLEAR
  253.  
  254.  
  255.  
  256.  

Append: Oh crud! Was I suppose to update the BiasWeight also?
EDIT: this code edited since posting, I added update to BaisWeight but didn't make a big difference; it might have sped up the time to hit target correct %'s.
« Last Edit: September 09, 2018, 12:29:06 am by bplus »

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: Application of a "Bias" in AI Programming
« Reply #14 on: September 10, 2018, 10:46:53 am »
So the difference between a "weight" and a "bias" in AI programming are very subtle bplus??? ie "Bias =1 : BiasWeight= RND*2-1". I do see the logic to your previous comment of bias simply being treated as another input to weight. If you were to decided an AI program MUST have an identifiable "Weight" and identifiable "Bias", would you say your "Bias = 1" would change to "Weight =1", as this value is more concrete and fixed. Or would you have "BiasWeight = RND*2-1", would in fact be considered as the "Weight". because weight in an AI program is always changing by the bias. Confusing I know. I guess, because of what I'm reading in AI programming, there is always a distinction between weight and bias.. Very much appreciate the comments in your program and the 96.5% chance of pregnancy.