Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acmi-lab/OnlineLabelShift
Code accompanying our paper titled Online Label Shift: Optimal Dynamic Regret meets Practical Algorithms
https://github.com/acmi-lab/OnlineLabelShift
distribution-shift domain-adaptation machine-learning
Last synced: 9 days ago
JSON representation
Code accompanying our paper titled Online Label Shift: Optimal Dynamic Regret meets Practical Algorithms
- Host: GitHub
- URL: https://github.com/acmi-lab/OnlineLabelShift
- Owner: acmi-lab
- License: apache-2.0
- Created: 2023-05-31T05:31:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-01T10:48:06.000Z (over 1 year ago)
- Last Synced: 2024-08-02T15:32:45.023Z (3 months ago)
- Topics: distribution-shift, domain-adaptation, machine-learning
- Language: Python
- Homepage: https://arxiv.org/abs/2305.19570
- Size: 91.8 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Online Label Shift
`OnlineLabelShift` is the official implementation of the accompanying paper [Online Label Shift: Optimal Dynamic Regret meets Practical Algorithms](https://arxiv.org/pdf/2305.19570.pdf).
For more details, please refer to the paper.
## Setup Environment
```
conda env update --file environment.yml
```## Run Online Label Shift Experiment
The following command runs the online label shift experiment.
It expects the base model has been trained and saved under `/model````
python scripts/run_ols.py -d synthetic -m logreg --do-all 1 -t 1000 --save 1
```To see all the options
```
python scripts/run_ols.py -h
```## Train model
This script supports model training for synthetic, cifar10, and mnist datasets.
```
python scripts/train_model.py -d -m -e
```The corresponding models are:
| Data | Model |
| --------- | -------- |
| synthetic | logreg |
| mnist | fcn |
| cifar10 | resnet18 |## Generate Synthetic Data
To run experiments on synthetic data, one should first generate the data with the following command:
```
python scripts/gen_synth_data.py
```