Giter Club home page Giter Club logo

comet's Introduction

Concept Learners for Few-Shot Learning

Kaidi Cao*, Maria Brbić*, Jure Leskovec

Project website


This repo contains the reference source code in PyTorch of the COMET algorithm. COMET is a meta-learning method that learns generalizable representations along human-understandable concept dimensions. For more details please check our paper Concept Learners for Few-Shot Learning (ICLR '21).

Dependencies

The code is built with following libraries:

Getting started

CUB dataset
  • Change directory to ./filelists/CUB
  • Run source ./download_CUB.sh
Tabula Muris dataset
  • Change directory to ./filelists/tabula_muris
  • Run source ./download_TM.sh

Usage

Training

We provide an example here:

Run python ./train.py --dataset CUB --model Conv4NP --method comet --train_aug

Testing

We provide an example here:

Run python ./test.py --dataset CUB --model Conv4NP --method comet --train_aug

Tabula Muris benchmark

If you would like to test your algorithm on the new benchmark dataset introduced in our work, you can download the data as described above or directly at http://snap.stanford.edu/comet/data/tabula-muris-comet.zip.

Dataset needs to be preprocessed using preprocess.py. Train/test/validation splits are available in load_tabula_muris.

Running this code requires anndata and scanpy libraries.

Citing

If you find our code useful, please consider citing:

@inproceedings{
    cao2021concept,
    title={Concept Learners for Few-Shot Learning},
    author={Cao, Kaidi and Brbi\'c, Maria and Leskovec, Jure},
    booktitle={International Conference on Learning Representations (ICLR)},
    year={2021},
}

Our codebase is developed based on the benchmark implementation from paper A Closer Look at Few-shot Classification.

Tabula Muris benchmark is developed based on the mouse aging cell atlas from paper https://www.nature.com/articles/s41586-020-2496-1.

comet's People

Contributors

kaidic avatar mbrbic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comet's Issues

error with training example on CUB

Running :
python ./train.py --dataset CUB --model Conv4NP --method comet --train_aug

Error :

File "/content/drive/MyDrive/FYP/comet-master/comet-master/CUB/data/dataset.py", line 68, in init
with open(data_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './filelists/CUB/base.json'

数据集的获取

求Reuters数据集和 Flowers数据集(概念处理的文件或者处理好的数据集)

Question on training with TM dataset

I used the following command to train the model with TM dataset
python ./train.py --model Conv4NP --method comet --train_aug

But, the following errors occur

Traceback (most recent call last):
  File "./train.py", line 13, in <module>
    from data.datamgr import SimpleDataManager, SetDataManager
  File "/root/notebooks/nfs/work/yanwei.liu/comet/TM/data/__init__.py", line 1, in <module>
    from . import datamgr
  File "/root/notebooks/nfs/work/yanwei.liu/comet/TM/data/datamgr.py", line 7, in <module>
    import data.additional_transforms as add_transforms
ModuleNotFoundError: No module named 'data.additional_transforms'

Thus I read comet/TM/data__init__.py. Line 3 from . import additional_transforms so I checkcomet/TM/data/ folder, there's no any .py file named additional_transforms. Did you forget to push the file to GitHub? or the command I used wasn't correct?

Thanks

PS. I have used the process.py to preprocess the dataset according to your guideline in README file.

Issues downloading CUB_200 dataset

Congratulations on the nice work!

I'm having some issues downloading the CUB 200 dataset with the download_CUB.sh script. It seems that the wget command does not work for Google Drive folders. Instead, the following command seems to work:

gdown https://drive.google.com/uc?id=1hbzc_P1FuxMkcabkgn9ZKinBwW683j45

Pre-trained model release

Hello,

are there any plans to release a model checkpoint used in the paper? Would be much appreciated.

Thanks.

How to conduct 'Unsupervised concept annotation'

The paper mentioned that it used autoencoder to do the so-called 'unsupervised concept annotation'.
Does it mean that it used the code proposed in (Zhang et al., 2018) to generate the bounding boxes and then use them as input of the COMET?

questions about parts

when using parts in CUB dataset, do you sample a point in a part, or sample a patch in a part?

x,y,joints training problem

image
I'm having a problem in joints is what data?
image
If I only need two arguments, then one is the label and one is the image (b,17,3,84,84)
image
Can you tell me what joints is, or what I did wrong and why there are only two parameters

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.