Giter VIP home page Giter VIP logo

ocdm's Introduction

Object-centric disentangled mechanisms

This repository contains code for the final chapter of my PhD thesis. Said chapter deals with the compositional generalisation capabilities of Object Centric models, specifically Slot Attention. Additionally, it can be used to reproduce the results from previous chapters, though there are no scripts provided to do so.

Setting up

First use the requirements.txt to create an environment, either using conda, pyenv or whatever python enviroment manager you prefer. Appart from the PyTorch libraries (including Torchvision), the repo heavily relies on Hydra to create, compose and run experiment configurations. It also uses PyTorch Lightning to define and log model runs.

Project structure

The code is organized following this nice template. It foregoes using some of Hydra's features such as Structured Configs and just uses plain json files. These are located in the configs folder. The main entry points for execution are located in the bin folder, including scripts to train and analyse models, and create the Pentomino dataset. All model source codes are included in the src folder.

Running experiments

Each experiment can be run using the train.py script by using a commmand with the following structure:

python -m bin.train experiment=<name-of-the-experiment> <extra-options>

The extra options here can be either parameters already present in the config such as model.latent.latent_size=12 or new parameters, in which case they must be prepended with a +. For example:

# change latent size
python -m bin.train experiment=vae_dsprites model.latent.latent_size=16

# debug (use fast dev run)
python -m bin.train experiment=vae_dsprites +debug=fdr

All experiment logs will be stored in data/logs. Summary information can be accessed using Tensorboard if you run the server as:

tensorboard --logdir data/logs

For remote connctions use the --bind_all flag and then connect to the machine IP and port 6006:

tensorboard --logdir data/logs --bind_all

ocdm's People

Contributors

miltonllera avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.