4 ms·
This is cute, but am I missing some way to make it run faster? It seems to only happen in real time. Group sizes of any more than about 10 make my machine slow
by SamBam 5y ago
This is cute, but am I missing some way to make it run faster? It seems to only happen in real time.
Group sizes of any more than about 10 make my machine slow to a crawl. Using the suggested population size of 500, then means it takes running 50 groups to pass 1 generation. With the suggested time of 17s, that's about 15 minutes per generation. The recommended 50 generations would therefore take over 12 hours.
And that's at the low-end of their recommendations. Population size of 1000 and 100 generations would take 50 hours.
I feel like usually with these things you want to run most of the generations headless, as fast as possible, and only show a few exemplars from each generation so the user can see how the evolution is progressing.
- trekhleb 5y agoYes, currently the simulation performance is one of the biggest issues (https://github.com/trekhleb/self-parking-car-evolution/issues https://github.com/trekhleb/self-parking-car-evolution/issue...). You may try to check the “Performance boost” checkbox that simplifies the geometry. It should give you approx x1.5 performance increase. But even with x1.5 boost the performance is still an issue, yes
- riboflavin123 5y agoThe page says: > For better results, increase the population size to 500-1000 and wait for 50-100 generations Do you have example output from that? I'd expect my computer to take months of running 24/7 to get there.
- trekhleb 5y agoYes, you may press the "Restore Evolution" button (at the bottom of the screen) and then upload the pre-saved training checkpoints from here https://github.com/trekhleb/self-parking-car-evolution/tree/master/src/checkpoints https://github.com/trekhleb/self-parking-car-evolution/tree/... You may also press the "Restore Evolution" button and then press "Use demo checkpoint" to use some pre-trained data.
- riboflavin123 5y agoOh, amazing. Thanks!
- andai 5y agoDoes each visitor submit their dna back to the server? Using the power of the web this allows you to have as many "cores" as you have visitors, and train massively parallel!
- trekhleb 5y agoCurrently all calculations are happening in user’s browsers - no sending to the backend.
- criddell 5y agoHave you thought about a native version? I get the appeal of writing for the browser but it's so damned slow compared to what you could get natively.
- trekhleb 5y agoI haven’t thought about the native version, it was fun trying to implement it for browser. To resolve the performance issue I would try next to switch to the 2D simulation engine, since we don’t use the height during the parking. Getting rid of the 3rd dimension, lights and complex geometry would increase the performance drastically I believe
- andai 5y agoAnd then still render it in 3D, right? That's a really cool idea.
- trekhleb 5y agoYes, training may happen pretty fast in 2D, but then applied to the 3D to final visualizations. But this is just an assumption. I haven’t tried this approach yet.
- criddell 5y agohttps://rednuht.org/genetic_cars_2/ https://rednuht.org/genetic_cars_2/ does something like this. You can turn off visualizations and let it run for a while then turn visualizations back on or replay the best result.
- athorax 5y agoMaybe you could have an option to not render all the generations and maybe only show the animation for the Nth run
- goodpoint 5y agoIndeed, the simulation should not be done in real time. The 3D world could be a cute way for users to change the parking scenario and then let the algorithm run in background and show the winners every 1000 cycles.