Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Growing Neural Cellular Automata #669

Merged
merged 69 commits into from
Oct 20, 2020

Conversation

BradLarson
Copy link
Contributor

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):

  • Support for loading and saving PNGs with an alpha channel has been added.
  • The loading and saving interfaces have been changed to reflect the support for both PNG and JPG images.
  • A new 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 the GIF 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.

…es only every 10th iteration during training.
…cing into separate function, fixing one X10 issue.
…it broadcast that fixes X10-side corruption.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

input,
{
LazyTensorBarrier()
return $0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕳

@BradLarson BradLarson changed the base branch from master to tensorflow-0.11 October 9, 2020 17:27
@BradLarson BradLarson changed the base branch from tensorflow-0.11 to master October 9, 2020 17:27
@BradLarson
Copy link
Contributor Author

@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.

@8bitmp3
Copy link
Contributor

8bitmp3 commented Oct 17, 2020

Can't wait @BradLarson That was an awesome demo 🖼

@BradLarson BradLarson merged commit b6e5d01 into tensorflow:master Oct 20, 2020
@8bitmp3
Copy link
Contributor

8bitmp3 commented Oct 28, 2020

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..."

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants