Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused by data set and output orientations #161

Open
moosehill opened this issue Oct 26, 2021 · 4 comments
Open

Confused by data set and output orientations #161

moosehill opened this issue Oct 26, 2021 · 4 comments

Comments

@moosehill
Copy link

It looks like the data set is flipped vertically relative to the output? I see an earlier commit that seems to have introduced this flip, but I don't understand why they look different. Can someone explain?
Banners_and_Alerts_and_A_Neural_Network_Playground

I'd like to show this to students in a class on Thursday and don't know how to explain this point.

@emmanuelrouxfr
Copy link

Hello @moosehill !

It's probably due to the way the thumbnail of the dataset (visible in top left corner of the playground) is generated using this function drawDatasetThumbnails,

Indeed, the function context.fillRect is filling the small square by considering the origin of the coordinates in the top left corner (with increasing values of X2 pointing downwards... while the data plotted in the right hand side of the playground is rendered with the positive value of X2 pointing upward.

image

I could solve it by adding a "-" (minus) sign before the d.y (which is X2) on line 1003 in the same drawDatasetThumbnails function

context.fillRect(w * (d.x + 6) / 12, h * (-d.y + 6) / 12, 4, 4);

which gives the following display :

image

Hope it helps :)
All the best,
Emmanuel

@emmanuelrouxfr
Copy link

I was about to do the same pull request as this one :
#101

I hope this will be integrated in the main branch quickly...

Have a great day,
Emmanuel

emmanuelrouxfr pushed a commit to emmanuelrouxfr/playground that referenced this issue Oct 27, 2021
@moosehill
Copy link
Author

moosehill commented Oct 27, 2021 via email

@moosehill
Copy link
Author

That issue looks pretty old, but I hope so as well. It would make explaining the display much simpler.

emmanuelrouxfr added a commit to emmanuelrouxfr/playground that referenced this issue Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants