rename to dzgcoop
This commit is contained in:
30
train.py
30
train.py
@@ -28,7 +28,7 @@ import trainers.cocoop
|
||||
import trainers.zsclip
|
||||
import trainers.maple
|
||||
import trainers.independentVL
|
||||
import trainers.promptsrc
|
||||
import trainers.dzgcoop
|
||||
|
||||
|
||||
def print_args(args, cfg):
|
||||
@@ -110,20 +110,20 @@ def extend_cfg(cfg):
|
||||
cfg.TRAINER.MAPLE.PROMPT_DEPTH = 9 # Max 12, minimum 0, for 1 it will act as shallow MaPLe (J=1)
|
||||
cfg.DATASET.SUBSAMPLE_CLASSES = "all" # all, base or new
|
||||
|
||||
# Config for PromptSRC
|
||||
cfg.TRAINER.PROMPTSRC = CN()
|
||||
cfg.TRAINER.PROMPTSRC.N_CTX_VISION = 4 # number of context vectors at the vision branch
|
||||
cfg.TRAINER.PROMPTSRC.N_CTX_TEXT = 4 # number of context vectors at the language branch
|
||||
cfg.TRAINER.PROMPTSRC.CTX_INIT = "a photo of a" # initialization words
|
||||
cfg.TRAINER.PROMPTSRC.PREC = "fp16" # fp16, fp32, amp
|
||||
cfg.TRAINER.PROMPTSRC.PROMPT_DEPTH_VISION = 9 # Max 12, minimum 0, for 0 it will be using shallow IVLP prompting (J=1)
|
||||
cfg.TRAINER.PROMPTSRC.PROMPT_DEPTH_TEXT = 9 # Max 12, minimum 0, for 0 it will be using shallow IVLP prompting (J=1)
|
||||
cfg.TRAINER.PROMPTSRC.TEXT_LOSS_WEIGHT = 25
|
||||
cfg.TRAINER.PROMPTSRC.TEXT_LOSS_WEIGHT_STRONG = 25 # lambda2: strong text constraint weight
|
||||
cfg.TRAINER.PROMPTSRC.TEXT_LOSS_WEIGHT_WEAK = 2.5 # lambda3: weak text constraint weight
|
||||
cfg.TRAINER.PROMPTSRC.IMAGE_LOSS_WEIGHT = 10
|
||||
cfg.TRAINER.PROMPTSRC.GPA_MEAN = 15
|
||||
cfg.TRAINER.PROMPTSRC.GPA_STD = 1
|
||||
# Config for DZGCoOp
|
||||
cfg.TRAINER.DZGCOOP = CN()
|
||||
cfg.TRAINER.DZGCOOP.N_CTX_VISION = 4 # number of context vectors at the vision branch
|
||||
cfg.TRAINER.DZGCOOP.N_CTX_TEXT = 4 # number of context vectors at the language branch
|
||||
cfg.TRAINER.DZGCOOP.CTX_INIT = "a photo of a" # initialization words
|
||||
cfg.TRAINER.DZGCOOP.PREC = "fp16" # fp16, fp32, amp
|
||||
cfg.TRAINER.DZGCOOP.PROMPT_DEPTH_VISION = 9 # Max 12, minimum 0, for 0 it will be using shallow IVLP prompting (J=1)
|
||||
cfg.TRAINER.DZGCOOP.PROMPT_DEPTH_TEXT = 9 # Max 12, minimum 0, for 0 it will be using shallow IVLP prompting (J=1)
|
||||
cfg.TRAINER.DZGCOOP.TEXT_LOSS_WEIGHT = 25
|
||||
cfg.TRAINER.DZGCOOP.TEXT_LOSS_WEIGHT_STRONG = 25 # lambda2: strong text constraint weight
|
||||
cfg.TRAINER.DZGCOOP.TEXT_LOSS_WEIGHT_WEAK = 2.5 # lambda3: weak text constraint weight
|
||||
cfg.TRAINER.DZGCOOP.IMAGE_LOSS_WEIGHT = 10
|
||||
cfg.TRAINER.DZGCOOP.GPA_MEAN = 15
|
||||
cfg.TRAINER.DZGCOOP.GPA_STD = 1
|
||||
cfg.DATASET.SUBSAMPLE_CLASSES = "all" # all, base or new
|
||||
|
||||
# Config for independent Vision Language prompting (independent-vlp)
|
||||
|
||||
Reference in New Issue
Block a user