forked from Lee-Gihun/MEDIAR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetupDict.py
39 lines (32 loc) · 869 Bytes
/
SetupDict.py
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
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import monai
import core
from train_tools import models
from train_tools.models import *
__all__ = ["TRAINER", "OPTIMIZER", "SCHEDULER"]
TRAINER = {
"baseline": core.Baseline.Trainer,
"mediar": core.MEDIAR.Trainer,
}
PREDICTOR = {
"baseline": core.Baseline.Predictor,
"mediar": core.MEDIAR.Predictor,
"ensemble_mediar": core.MEDIAR.EnsemblePredictor,
}
MODELS = {
"unet": monai.networks.nets.UNet,
"unetr": monai.networks.nets.unetr.UNETR,
"swinunetr": monai.networks.nets.SwinUNETR,
"mediar-former": models.MEDIARFormer,
}
OPTIMIZER = {
"sgd": optim.SGD,
"adam": optim.Adam,
"adamw": optim.AdamW,
}
SCHEDULER = {
"step": lr_scheduler.StepLR,
"multistep": lr_scheduler.MultiStepLR,
"cosine": lr_scheduler.CosineAnnealingLR,
}