This is an implementation of a simple 2d physics simulator usable from the pytorch framework.

The main function is

torch.ByteTensor flatland.generate_sequence(bool pulling,
                                            int nb_sequences,
                                            int nb_images,
                                            int image_height, int image_width,
                                            int nb_shapes,
                                            bool random_shape_size, bool random_colors)


The returned ByteTensor has five dimensions:

Warning: For improper parameters values (e.g. too many shapes, too small images), the simulation may be stuck.

Installation and test

make -j -k