Coder Social home page Coder Social logo

sucpa-convergence's Introduction

SUCPA Convergence

This is the code to analyze the convergence of the SUCPA algorithm.

Requirements

Check that you have the packages listed in requirements.txt installed. If not, run:

conda create --name sucpa python=3.10
conda activate sucpa
pip install -r requirements.txt

Usage

Running SUCPA on NLP datasets

To run the SUCPA algorithm for a specific value of $\beta^{[0]}$ (for instance, $\beta^{[0]}=\begin{bmatrix} 0.1 & 0.2 \end{bmatrix}$) run:

python run_sucpa.py \
    --dataset=sst2 \
    --steps=10 \
    --beta_init=0.1,0.2

You can also run the SUCPA algorithm for a range of values of $\beta^{[0]}$ by defining a number of repetitions and an initial seed:

python run_sucpa.py \
    --dataset=sst2 \
    --steps=10 \
    --repetitions=10 \
    --random_state=3892

In all cases, the results will be saved in the results/dataset={dataset} folder. Supported datasets for these experiments are sst2 (two classes) and mnli (three classes). Logits for these datasets are contained in the data directory and were obtained with the code in this repository.

Running SUCPA on image dataset

The procedure tu run SUCPA on image datasets is the same as for NLP datasets, so you just need to run (for instance):

python run_sucpa.py \
    --dataset=cat-dog \
    --steps=10 \
    --beta_init=0.1,0.2

The logits for the image datasets are contained in the data directory and were obtained fine-tuning a ResNet18 model on the Cat-Dog dataset of this Kaggle competition. To obtain the logits and labels contained in the data/dogs-vs-cats/ directory you can download the dataset, open it on the ./data directory and run the run_resnet.py script.

Results

Citation

sucpa-convergence's People

Contributors

lautaroest avatar lpsc-fiuba 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.