[Pharo-users] Re: Agile Artificial Intelligence

2020-10-04 Thread Alexandre Bergel via Pharo-users
Very well spotted!

Thank you very much! 
Added here: https://github.com/Apress/agile-ai-in-pharo/issues/6

I will fix in the second edition. Even if all the code contained in the book is 
automatically tested, in this case, this was not enough. 

Thank you!

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



> On 21-08-2020, at 02:07, bentai  wrote:
> 
> I think I found another bug in the book. I am using the Safari version, and 
> the code in the text doesn't match the screenshot.  For example, the text 
> says:
> somePoints := OrderedCollection new.
> 500 timesRepeat: [somePoints add: {(50 atRandom - 25) . (50 atRandom - 
> 25)}].
> f := [ :x | (-2 * x) - 3 ].
> "We use the Roassal Grapher engine to plot our points"
> g := RTGrapher new.
> d := RTData new.
> d dotShapecolor: [ :p | (p second > (f value: p first)) ifTrue: [ Color 
> red trans ]ifFalse: [ Color blue trans ] ].
> d points: somePoints.
> d x: #first.
> d y: #second.
> g add: d.
> g
> "" The rendered code in the Safari version gets an error, whereas the 
> screenshot version works:
> f := [  :x | (-2 * x) - 3 ].
> 
> somePoints := OrderedCollection new.
> 500 timesRepeat: [ somePoints add: (( 50 atRandom - 25 ) @ ( 50 atRandom - 25 
> )) ].
> 
> g := RTGrapher new.
> d := RTData new.
> d dotShape color: [ :p | (p y > (f value: p x)) ifTrue: [ Color red trans ] 
> ifFalse: [ Color blue trans ] ].
> d points: somePoints.
> d x: #x.
> d y: #y.
> g add: d.
> g
> ---
> 
> This may be part of the cause of my bug report on Git, e.g. there is a 
> mismatch between the eBook version, the printed version and the 
> Safari/OReilly version.
> 
> It is Pharo 7.0.4, but I don't know if that matters in this case.
> 
> I apologize for not following the procedure of cloning the github repository 
> and creating bug request from there with pull requests, but I am still 
> working out the configuration of Iceberg.
> 
> Cheers,
> Tom Sturgeon
> 
> Sent from the Pharo Smalltalk Users mailing list archive 
>  at Nabble.com.



[Pharo-users] Re: Agile Artificial Intelligence first trained Perceptron

2020-10-04 Thread Alexandre Bergel via Pharo-users
Hello,

Sorry to reply late. I just saw this email.

Each training modify the weights and bias of the perceptron by a small 
quantity. It is just that, in this very particular case, from 31 or 32 is the 
drop that makes all things change...

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



> On 21-08-2020, at 01:31, bentai  wrote:
> 
> I noticed that if I trained the OR gate with 31 iterations, the first test
> would fail.
> 
> If I train with 32 iterations, then the test for #(0 0) would pass.
> 
> What is the explanation for this "tipping point"?
> 
> The other tests pass, even if timeRepeat := 1.
> 
> I just decided to experiment a bit.
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>