generated from tulane-cmps6730/sample-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
# [OT3P: Optimal-Transport guided Test-Time Adaptation for Vision-Language Models](https://docs.google.com/presentation/d/1Z65LXU6kdW3wt3b9PXE5-DFxuurNGz3e7i-bBIPssi4/edit?usp=sharing) | ||
|
||
This README provides an overview and usage instructions for the shell scripts used in this project. Each script is designed to perform specific machine learning tasks using the DomainBed framework for domain adaptation. | ||
|
||
### Using this repository | ||
#### - Codes | ||
|
||
- At the start of the course, students will be divided into project teams. Each team will receive a copy of this starter code in a new repository. E.g.: | ||
https://github.com/tulane-cmps6730/project-alpha | ||
- Each team member will then clone their team repository to their personal computer to work on their project. E.g.: `git clone https://github.com/tulane-cmps6730/project-alpha` | ||
- See [GettingStarted.md](GettingStarted.md) for instructions on using the starter code. | ||
1. **erm.sh** - Trains models using Empirical Risk Minimization (ERM) on single and multiple source environments. The script accepts dataset name and data directory as inputs. To run the script, enter the command below in the terminal. | ||
|
||
```bash | ||
DATA_DIR=<path_to_data> ./erm.sh <dataset_name> | ||
``` | ||
|
||
### Contents | ||
2. **baseline_tta.sh** - Performs test-time adaptation using different algorithms on the PACS dataset after ERM model is trained. This script iterates over different seeds and environments to apply test-time adaptation (TTA) methods like T3A and Tent on models trained under the ERM framework. To run the script, enter the command below in the terminal. | ||
|
||
- [docs](docs): template to create slides for project presentations | ||
- [nlp](nlp): Python project code | ||
- [notebooks](notebooks): Jupyter notebooks for project development and experimentation | ||
- [report](report): LaTeX report | ||
- [tests](tests): unit tests for project code | ||
```bash | ||
bash ./baseline_tta.sh <dataset_name> | ||
``` | ||
|
||
### Background Resources | ||
3. **OT3P.sh** - Code for our proposed method. It applies prompt-based test-time adaptation using a trained ERM model. It requires specifying a data directory and a dataset. To run the script, enter the command below in the terminal. | ||
|
||
```bash | ||
DATA_DIR=<path_to_data> ./OT3P.sh <dataset_name> | ||
``` | ||
|
||
##### Note: our codes are adapted from the DomainBed repository. You can find the original code at https://github.com/facebookresearch/DomainBed | ||
|
||
----- | ||
|
||
#### - Datasets | ||
|
||
1. **Vision Task Dataset**: | ||
|
||
We use PACS for our vision classification task. You can download the dataset at https://datasets.activeloop.ai/docs/ml/datasets/pacs-dataset/ | ||
|
||
2. **NLP Task Dataset**: | ||
|
||
We use SST5 and Yelp datasets for our NLP classification task. You can download them at the following links, respectively. | ||
|
||
- Yelp: https://www.yelp.com/dataset | ||
- SST5: https://nlp.stanford.edu/sentiment/ | ||
|
||
The following will give you some technical background on the technologies used here: | ||
|
||
1. Refresh your Python by completing this online tutorial: <https://www.learnpython.org/> (3 hours) | ||
2. Create a GitHub account at <https://github.com/> | ||
3. Setup git by following <https://help.github.com/en/articles/set-up-git> (30 minutes) | ||
4. Learn git by completing the [Introduction to GitHub](https://lab.github.com/githubtraining/introduction-to-github) tutorial, reading the [git handbook](https://guides.github.com/introduction/git-handbook/), then completing the [Managing merge conflicts](https://lab.github.com/githubtraining/managing-merge-conflicts) tutorial (1 hour). | ||
5. Install the Python data science stack from <https://www.anaconda.com/distribution/> . **We will use Python 3** (30 minutes) | ||
6. Complete the scikit-learn tutorial from <https://www.datacamp.com/community/tutorials/machine-learning-python> (2 hours) | ||
7. Understand how python packages work by going through the [Python Packaging User Guide](https://packaging.python.org/tutorials/) (you can skip the "Creating Documentation" section). (1 hour) | ||
8. Complete Part 1 of the [Flask tutorial](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world), which is the library we will use for making a web demo for your project. |