-
Notifications
You must be signed in to change notification settings - Fork 1
/
train_config_case2D.yaml
executable file
·153 lines (153 loc) · 4.73 KB
/
train_config_case2D.yaml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Set a fixed random seed for reproducibility, or null
manual_seed: null
# Network dimension, determine whether to use 2D network or 3D network
dim: 2
# model configuration
model:
# model class, CASENet is based on ResNet
name: ResNet
# number of input channels to the model
in_channels: 1
# number of output classes
out_channels: 5
# set layers
layers: [3, 4, 23, 3]
# whether to apply the sigmoid function, set false for training, true for testing
final_sigmoid: False
# trainer configuration
trainer:
# path to the checkpoint directory
checkpoint_dir: /mnt/lustre/shenrui/project/edgeDL/checkpoints/pelvis/casenet2d
# path to latest checkpoint or null; if provided the training will be resumed
resume: /mnt/lustre/shenrui/project/edgeDL/checkpoints/pelvis/casenet2d/last_checkpoint_iter20000.pytorch
# how many iterations between validations
validate_after_iters: 5000
# how many iterations between tensorboard logging
log_after_iters: 50
# how many iterations evaluated in validations, set null for evaluating whole val set
validate_iters: null
# how many iterations before start level set alignment
align_start_iters: 20000
# how many iterations between level set alignment
align_after_iters: 5000
# max number of epochs
epochs: 100
# max number of iterations, set null for finishing all epochs
iters: null
# model with lower eval score is considered better
eval_score_higher_is_better: False
# optimizer configuration
optimizer:
# initial learning rate
learning_rate: 0.0001
# weight decay
weight_decay: 0.001
# loss function configuration
loss:
# loss function to be used during training
name: STEALEdgeLoss
# A manual rescaling weight given to each class.
loss_weight: null
# a target value that is ignored and does not contribute to the input gradient
ignore_index: null
# evaluation metric configuration
eval_metric:
name: STEALEdgeLoss
# a target label that is ignored during metric evaluation
ignore_index: null
lr_scheduler:
name: MultiStepLR
milestones: [10, 30, 60]
gamma: 0.2
# configuration for level set alignment
level_set:
# Apply 2D or 3D level set
dim: 2
# lambda value in level set equation (see README.md)
lambda_: 0.1
# alpha value in level set equation (see README.md)
alpha: 1
# sigma value applied to gt map
sigma: 1
# smoothing iteration in each step
smoothing: 1
# radius value in generating boundary (SegToEdge)
render_radius: 1
# set true for semantic gt
is_gt_semantic: True
# method used in level set ('MLS' for morphological level set)
method: 'MLS'
# balloon value in level set
balloon: 0
# threshold value in level set
threshold: 0.95
# level set iterations
step_ckpts: 50
# input shape for level set, dz x Y x X, set dz as 1 for 2D level set
dz: 1
# batch size used in evaluation
batch_size: 16
# path prefix for saving alignment results, full folder path is prefix + num of iter
prefix: '/mnt/lustre/shenrui/data/pelvis_predict_BCE'
# number of subprocesses used for level set calculation
n_workers: 16
# data loaders configuration
loaders:
# train patch size given to the network, can be 2D [W, H] or 3D [D, W, H]
train_patch: [350, 350]
# train stride between patches, can be 2D or 3D
train_stride: [100, 100]
# validation patch (can be bigger than train patch since there is no backprop)
val_patch: [350, 350]
# validation stride (validation patches doesn't need to overlap)
val_stride: [350, 350]
# clip image value within the range
clip_val: [-1000, 2000]
# paths to the training datasets
train_path:
- '/mnt/lustre/shenrui/data/pelvis_resampled/dataset_train.txt'
# paths to the validation datasets
val_path:
- '/mnt/lustre/shenrui/data/pelvis_resampled/dataset_val.txt'
# how many subprocesses to use for data loading
num_workers: 8
# batch size in training process
batch_size: 4
# data transformations/augmentations
transformer:
train:
raw:
- name: ClipNormalize
- name: RandomRotate
axes: [[0, 1]]
angle_spectrum: 30
mode: reflect
- name: ElasticDeformation
spline_order: 3
- name: ToTensor
expand_dims: true
label:
- name: RandomRotate
axes: [[0, 1]]
angle_spectrum: 30
mode: reflect
- name: ElasticDeformation
spline_order: 0
- name: SegToEdge
out_channels: 5
radius: 1
- name: ToTensor
expand_dims: false
dtype: 'long'
test:
raw:
- name: ClipNormalize
- name: ToTensor
expand_dims: true
label:
- name: SegToEdge
out_channels: 5
radius: 1
- name: ToTensor
expand_dims: false
dtype: 'long'