GithubHelp home page GithubHelp logo

expt's Introduction

ExPT: Synthetic Pretraining for Few-Shot Experimental Design

This is the official implementation of the paper ExPT: Synthetic Pretraining for Few-Shot Experimental Design in PyTorch. We propose Experiment Pretrained Transformer (ExPT), a novel method that can solve challenging experimental design problems with only a handful of labeled data points. During pretraining, we only assume knowledge of a finite collection of unlabelled data points from the input domain and train ExPT to optimize diverse synthetic functions defined over this domain. Unsupervised pretraining allows ExPT to adapt to any design task at test time in an in-context fashion by conditioning on a few labeled data points from the target task and generating the candidate optima. Please check out our project website and blog post for more details and discussions.

Install

First, clone the repository:

git clone https://github.com/tung-nd/ExPT.git

Then install the dependencies as listed in env.yml and activate the environment:

conda env create -f env.yml
conda activate expt

Pretraining

To pretrain ExPT for the Ant domain, run

CUDA_VISIBLE_DEVICES=0 python train_expt.py --config configs/pretrain_ant.yaml

Similar for dkitty (D'Kitty), tf8 (TF-Bind-8), and tf10 (TF-Bind-10). This code will pretrain ExPT with the default hyperparameters we used in the paper. Please check out the config file for more pretraining options.

Adaptation

To evaluate a pretrained ExPT model, run

CUDA_VISIBLE_DEVICES=0 python eval_tnp_backward_from_gp.py \
    --config configs/pretrain_ant.yaml \
    --model.pretrained_path=PATH/TO/CHECKPOINT \
    --data.eval_data_ratio=0.01 \
    --data.eval_samping_strategy='random'

In which, eval_data_ratio denotes the ratio of labeled data points you use to condition the model, and eval_samping_strategy denotes the strategy for selecting these points, which can be either 'random' or 'poor' as defined in the paper.

Citation

If you find this repo useful in your research, please consider citing our paper:

@article{nguyen2023expt,
  title={ExPT: Synthetic Pretraining for Few-Shot Experimental Design},
  author={Nguyen, Tung and Agrawal, Sudhanshu and Grover, Aditya},
  journal={arXiv preprint arXiv:2310.19961},
  year={2023}
}

expt's People

Contributors

tung-nd avatar sudhanshuagrawal27 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.