NoiseNCA (Artificial Life 2024) [Project Page]
Official implementation of the paper titled "NoiseNCA: Noisy Seed Improves Spatio-Temporal Continuity of Neural Cellular Automata"
For a quick and hands-on experimentation we suggest trying our Google Colab notebook (click on Open in Colab button at the top of the readme). Otherwise, you can follow the instructions below to set up the environment on your local machine.
- Clone the repository
git clone https://github.com/IVRL/NoiseNCA.git
cd NoiseNCA
- Create a new virtual environment and install the required python packages.
The requirements are very light and are listed in the
requirements.txt
file. We use PyTorch for the implementation and Weights & Biases (W&B) for logging.
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
We used 45 textures from DyNCA to train and test our model. You can download the data by running the following command:
python3 download_textures.py
The data will be downloaded to the data
directory.
To run the code you will need to have a yaml config file that specifies the training configuration.
You can find the sample config files for Noise-NCA, Vanilla-NCA, and PE-NCA in the configs
directory.
Running the train.py
code will train the specified NCA model on all the textures in a given directory.
For example, to train the Noise-NCA model on the textures in the data directory, you can run the following command:
python3 train.py --config configs/Noise-NCA.yaml --data_dir data/textures/
The loss_type key in the config file specifies the loss function used for training the model.
The supported values are OT
, Gram
, and SlW
for optimal transport, Gram matrix, and sliced Wasserstein loss,
respectively. In the paper we used the OT loss.
loss:
attr:
loss_type: "OT"
For the Noise-NCA model, you can specify the noise level for each target texture. In the sample config file, we provide the noise level for each texture that was used in the paper.
model:
type: "NoiseNCA"
noise_levels: { default: 0.10, # This is the default noise level for images that are not listed below
bumpy_0081: 0.25,
bumpy_0169: 0.25,
} # We found these noise levels to work well for the given textures.
attr:
chn: 12
fc_dim: 96
To record the training logs in wandb (Weights and Biases), you can set the wandb
key in the config file.
wandb:
project: "Project Name"
key: "Your API Key"
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.