Artificial Neural Networks for lua

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
SirRanjid
Prole
Posts: 39
Joined: Sun Nov 19, 2017 1:44 pm
Contact:

Re: Artificial Neural Networks for lua

Post by SirRanjid »

Added rotation and some better coloring.

https://love2d.org/imgmirrur/WElg2wE.mp4

Overfitting in motion.
https://love2d.org/imgmirrur/3eXAqEw.mp4

(somehow the graph only renders if you hit space once)
Attachments
lnn4.love
(9.41 KiB) Downloaded 351 times
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Artificial Neural Networks for lua

Post by darkfrei »

SirRanjid wrote: Tue Jul 23, 2019 8:37 am I made it look nicer.
I've updated your script to the 11.3.

The long space enables and disables the wave line.

1. That is the wave line in the middle?
2. Why the learned NN have wrong result by the 1, 0 input? It shows 0, not expected 1
3. Why you have "nn.func.cos, nn.func.sin", the second one must be the derivative of the first one
4. How works this feature with canvas? I've not used it before.
2020-10-24T22_34_08-not learned.png
2020-10-24T22_34_08-not learned.png (475.85 KiB) Viewed 6520 times
2020-10-24T22_39_46-learned.png
2020-10-24T22_39_46-learned.png (464.85 KiB) Viewed 6520 times
Attachments
lnn3a_11.3.love
(8.04 KiB) Downloaded 253 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
SirRanjid
Prole
Posts: 39
Joined: Sun Nov 19, 2017 1:44 pm
Contact:

Re: Artificial Neural Networks for lua

Post by SirRanjid »

darkfrei wrote: Sat Oct 24, 2020 8:49 pm
I've updated your script to the 11.3.

The long space enables and disables the wave line.

1. That is the wave line in the middle?
2. Why the learned NN have wrong result by the 1, 0 input? It shows 0, not expected 1
3. Why you have "nn.func.cos, nn.func.sin", the second one must be the derivative of the first one
4. How works this feature with canvas? I've not used it before.
Thanks!

1. I do not understand what you mean with wave line? or you mean the plotter. it shows the error if it gets consistently to 0 its good.
2. The net has no optimizatios whatsoever to counter vanishing gradients etc. (just restart the program and hope it works the next time)
3. sin actually is the derivate of cos and vice versa (sin' = cos; sin'' = sin)
4. canvas is like the screen you render to but as texture. so you render to an invisible screen, then render the invisible screen
like you tell the program to forward any render operation to a canvas by enabling it. then render and disable rendering to the canvas.
after that you can draw the canvas to the screen or another canvas
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Artificial Neural Networks for lua

Post by darkfrei »

SirRanjid wrote: Fri Oct 30, 2020 4:48 pm 3. sin actually is the derivate of cos and vice versa (sin' = cos; sin'' = sin)
4. canvas is like the screen you render to but as texture. so you render to an invisible screen, then render the invisible screen
like you tell the program to forward any render operation to a canvas by enabling it. then render and disable rendering to the canvas.
after that you can draw the canvas to the screen or another canvas
3. sin' = cos but cos' = -sin; sin'' = - sin

4. Why here is two canvas? The first one can use the second, but the second one can use the fist one.
Is canvas here to fast simulation? To set the vertical synchronization?
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
SirRanjid
Prole
Posts: 39
Joined: Sun Nov 19, 2017 1:44 pm
Contact:

Re: Artificial Neural Networks for lua

Post by SirRanjid »

darkfrei wrote: Fri Oct 30, 2020 5:06 pm
SirRanjid wrote: Fri Oct 30, 2020 4:48 pm 3. sin actually is the derivate of cos and vice versa (sin' = cos; sin'' = sin)
4. canvas is like the screen you render to but as texture. so you render to an invisible screen, then render the invisible screen
like you tell the program to forward any render operation to a canvas by enabling it. then render and disable rendering to the canvas.
after that you can draw the canvas to the screen or another canvas
3. sin' = cos but cos' = -sin; sin'' = - sin

4. Why here is two canvas? The first one can use the second, but the second one can use the fist one.
Is canvas here to fast simulation? To set the vertical synchronization?
3. oh okay my fault ^^'

4. i think for the fading effect of the plot i used it. the implementation may or may not be optimimal
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 6 guests