{"id":13577124,"url":"https://github.com/acmi-lab/OnlineLabelShift","last_synced_at":"2025-04-05T09:31:05.681Z","repository":{"id":171501425,"uuid":"647589111","full_name":"acmi-lab/OnlineLabelShift","owner":"acmi-lab","description":"Code accompanying our paper titled Online Label Shift: Optimal Dynamic Regret meets Practical Algorithms","archived":false,"fork":false,"pushed_at":"2023-06-01T10:48:06.000Z","size":94,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-05T13:44:49.432Z","etag":null,"topics":["distribution-shift","domain-adaptation","machine-learning"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2305.19570","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acmi-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-31T05:31:06.000Z","updated_at":"2023-08-21T18:42:24.000Z","dependencies_parsed_at":"2024-03-17T06:59:54.050Z","dependency_job_id":null,"html_url":"https://github.com/acmi-lab/OnlineLabelShift","commit_stats":null,"previous_names":["acmi-lab/onlinelabelshift"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmi-lab%2FOnlineLabelShift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmi-lab%2FOnlineLabelShift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmi-lab%2FOnlineLabelShift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmi-lab%2FOnlineLabelShift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acmi-lab","download_url":"https://codeload.github.com/acmi-lab/OnlineLabelShift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318084,"owners_count":20919448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distribution-shift","domain-adaptation","machine-learning"],"created_at":"2024-08-01T15:01:18.270Z","updated_at":"2025-04-05T09:31:00.670Z","avatar_url":"https://github.com/acmi-lab.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Online Label Shift\n\n\n`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). \nFor more details, please refer to the paper. \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/acmi-lab/OnlineLabelShift/assets/43626310/3be87ecf-641e-49d7-92a8-993825fabbeb\" /\u003e\n\u003c/p\u003e\n\n## Setup Environment\n\n```\nconda env update --file environment.yml\n```\n\n## Run Online Label Shift Experiment\n\nThe following command runs the online label shift experiment.\nIt expects the base model has been trained and saved under `/model`\n\n```\npython scripts/run_ols.py -d synthetic -m logreg --do-all 1 -t 1000 --save 1\n```\n\nTo see all the options\n\n```\npython scripts/run_ols.py -h\n```\n\n## Train model\n\nThis script supports model training for synthetic, cifar10, and mnist datasets.\n\n```\npython scripts/train_model.py -d \u003cdata\u003e -m \u003cmodel\u003e -e \u003cepoch\u003e\n```\n\nThe corresponding models are:\n\n| Data      | Model    |\n| --------- | -------- |\n| synthetic | logreg   |\n| mnist     | fcn      |\n| cifar10   | resnet18 |\n\n## Generate Synthetic Data\n\nTo run experiments on synthetic data, one should first generate the data with the following command:\n\n```\npython scripts/gen_synth_data.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmi-lab%2FOnlineLabelShift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facmi-lab%2FOnlineLabelShift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmi-lab%2FOnlineLabelShift/lists"}