-
Notifications
You must be signed in to change notification settings - Fork 149
Conversation
… image loading and saving.
…es only every 10th iteration during training.
…pha on saving for RGB PNGs.
…cing into separate function, fixing one X10 issue.
…it broadcast that fixes X10-side corruption.
…d adding AnimatedImage interface.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
input, | ||
{ | ||
LazyTensorBarrier() | ||
return $0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕳
…the edge of the image.
…lead to more stable results.
… and display functionality.
…d adding AnimatedImage interface.
…the edge of the image.
…lead to more stable results.
… and display functionality.
Co-authored-by: marcrasi <marcrasi@google.com>
Co-authored-by: marcrasi <marcrasi@google.com>
…t-models into CellularAutomata
…documentation comments.
@marcrasi - I believe that I've addressed all of your (really helpful) comments about the image APIs. I now determine colorspace based on the size of the number of color channels present, and I've extracted all the special-case handling we had for various image cases into composable methods. For image saving, it seemed cleanest to do these as extensions on Tensor, because that lead to simple code at the use site. I've added documentation to both Image and AnimatedImage to try to write down all the assumptions that were implicit before, and added preconditions where appropriate. In the process of testing all these changes across the models, I found existing problems with three of them, so it was nice to uncover those and fix them as part of this. |
Can't wait @BradLarson That was an awesome demo 🖼 |
Awesome job @BradLarson and thanks team @saeta @ematejska et al. Just found out via an appendix in a research paper that cellular automata are used in the Procgen Benchmark environments, like CaveFlyer, to generate game level layouts (OpenAI, 2019). E.g. "Procedural generation controls the level layout via cellular automata..." |
This adds an implementation of the model from "Growing Neural Cellular Automata", as well as an accompanying notebook. Experiments 1, 2, and 3 from that publication have been implemented in the command-line example. Experiment 4 will be added later, once PR #631 has been merged to add necessary checkpointing and restoration functionality.
Both eager-mode and X10 backends are supported, and most hyperparameters can be set via command-line options.
In addition to the neural cellular automata model, this makes some more significant modifications to the image loading and saving APIs within swift-models (as needed by this model):
AnimatedImage
type has been added, which allows for direct writing of animated GIFs from arrays of Tensors. This uses a native-Swift GIF writer in theGIF
type, and should work across platforms and in Colab. The animated GIF writer uses a default quantized colorspace, and better results could be obtained in the future by using quantization that adapts to the image frames.