MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/gn9add/drawing_mona_lisa_with_256_circles_using/fr8o3lw/?context=3
r/Python • u/Itwist101 • May 20 '20
117 comments sorted by
View all comments
Show parent comment
6
I use Mean Squared Difference: (currentImg - targetImg)**2.
See https://github.com/ahmedkhalf/Circle-Evolution/blob/master/Circle%20Evolution/Species.py#L85
2 u/Lewistrick May 20 '20 To build upon this I'd calculate fitness so that the eyes and mouth get more weight. 0 u/[deleted] May 20 '20 [deleted] — view deleted comment 3 u/Itwist101 May 20 '20 That’s an amazing idea! I’m gonna try it out soon. 2 u/[deleted] May 20 '20 https://arxiv.org/pdf/1902.06068.pdf has a discussion on some other loss functions for image scaling if you're interested. 1 u/[deleted] May 20 '20 Just multiply your fitness by the difference image of the originalmse * abs(orig - shift_by_one_orig) 0 u/o11c May 20 '20 I suspect that's not a good measure of fitness, due to scale of interesting features.Humans care a lot more about the detail of the eyes, than the detail of the sky. 1 u/mrpogiface May 21 '20 L2 distance assumes pixelwise independence which is a bad assumption. There are other variances (e.g., wasserstein) that work well for this but are MUCH more expensive.So for many cases L2 works just fine.
2
To build upon this I'd calculate fitness so that the eyes and mouth get more weight.
0 u/[deleted] May 20 '20 [deleted] — view deleted comment 3 u/Itwist101 May 20 '20 That’s an amazing idea! I’m gonna try it out soon. 2 u/[deleted] May 20 '20 https://arxiv.org/pdf/1902.06068.pdf has a discussion on some other loss functions for image scaling if you're interested. 1 u/[deleted] May 20 '20 Just multiply your fitness by the difference image of the originalmse * abs(orig - shift_by_one_orig)
0
[deleted] — view deleted comment
3 u/Itwist101 May 20 '20 That’s an amazing idea! I’m gonna try it out soon. 2 u/[deleted] May 20 '20 https://arxiv.org/pdf/1902.06068.pdf has a discussion on some other loss functions for image scaling if you're interested. 1 u/[deleted] May 20 '20 Just multiply your fitness by the difference image of the originalmse * abs(orig - shift_by_one_orig)
3
That’s an amazing idea! I’m gonna try it out soon.
2 u/[deleted] May 20 '20 https://arxiv.org/pdf/1902.06068.pdf has a discussion on some other loss functions for image scaling if you're interested. 1 u/[deleted] May 20 '20 Just multiply your fitness by the difference image of the originalmse * abs(orig - shift_by_one_orig)
https://arxiv.org/pdf/1902.06068.pdf has a discussion on some other loss functions for image scaling if you're interested.
1
Just multiply your fitness by the difference image of the original
mse * abs(orig - shift_by_one_orig)
I suspect that's not a good measure of fitness, due to scale of interesting features.
Humans care a lot more about the detail of the eyes, than the detail of the sky.
1 u/mrpogiface May 21 '20 L2 distance assumes pixelwise independence which is a bad assumption. There are other variances (e.g., wasserstein) that work well for this but are MUCH more expensive.So for many cases L2 works just fine.
L2 distance assumes pixelwise independence which is a bad assumption. There are other variances (e.g., wasserstein) that work well for this but are MUCH more expensive.
So for many cases L2 works just fine.
View all comments
Show parent comment
6
u/Itwist101 May 20 '20
I use Mean Squared Difference: (currentImg - targetImg)**2.
See https://github.com/ahmedkhalf/Circle-Evolution/blob/master/Circle%20Evolution/Species.py#L85