-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (37 loc) · 970 Bytes
/
main.py
File metadata and controls
43 lines (37 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# import torch
import time
from configuration import config
from datasets import *
from methods.adapter_clip import AdapterCLIP
from methods.er_baseline import ER
from methods.clib import CLIB
from methods.maple import MaPLe
from methods.mvp_clip import CLIP_MVP
from methods.rainbow_memory import RM
from methods.finetuning import FT
from methods.ewcpp import EWCpp
from methods.lwf import LwF
from methods.mvp import MVP
from methods.continual_clip import ContinualCLIP
# torch.backends.cudnn.enabled = False
methods = {
"er": ER,
"clib": CLIB,
"rm": RM,
"lwf": LwF,
"Finetuning": FT,
"ewc++": EWCpp,
"mvp": MVP,
"continual-clip": ContinualCLIP,
"mvp-clip": CLIP_MVP,
"maple": MaPLe,
"adapter-clip": AdapterCLIP,
"lora-clip": AdapterCLIP
}
def main():
# Get Configurations
args = config.base_parser()
trainer = methods[args.method](**vars(args))
trainer.run()
if __name__ == "__main__":
main()