File tree 2 files changed +59
-0
lines changed
2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ import sys
2
+ sys .path .append ('./Radiology_and_AI' )
3
+ from validation .run_eval import run_eval
4
+ import torchio as tio
5
+
6
+ validation_transform = tio .Compose ([
7
+ tio .ZNormalization (masking_method = tio .ZNormalization .mean ),
8
+ tio .CropOrPad ((240 , 240 , 160 )),
9
+ tio .OneHot (num_classes = 5 )
10
+
11
+ ])
12
+
13
+ run_eval (
14
+ input_data_path = '../brats_new/BraTS2020_TrainingData/MICCAI_BraTS2020_TrainingData' ,
15
+ model_path = "../randgamma.pt" ,
16
+ validation_transform = validation_transform ,
17
+ seed = 42 ,
18
+ train_val_split_ration = 0.9 ,
19
+ batch_size = 1
20
+ )
Original file line number Diff line number Diff line change
1
+ import sys
2
+ sys .path .append ('./Radiology_and_AI' )
3
+ from training .run_training import run_training
4
+ import torchio as tio
5
+
6
+ training_transform = tio .Compose ([
7
+ tio .ZNormalization (masking_method = tio .ZNormalization .mean ),
8
+ tio .RandomBiasField (p = 0.5 ),
9
+ tio .CropOrPad ((240 , 240 , 160 )),
10
+ tio .OneHot (num_classes = 5 ),
11
+
12
+ ])
13
+
14
+ validation_transform = tio .Compose ([
15
+ tio .ZNormalization (masking_method = tio .ZNormalization .mean ),
16
+ tio .CropOrPad ((240 , 240 , 160 )),
17
+ tio .OneHot (num_classes = 5 )
18
+
19
+ ])
20
+
21
+ run_training (
22
+ input_data_path = '../brats_new/BraTS2020_TrainingData/MICCAI_BraTS2020_TrainingData' ,
23
+ output_model_path = './Models/test_train_randbias_1e-3.pt' ,
24
+ training_transform = training_transform ,
25
+ validation_transform = validation_transform ,
26
+ max_epochs = 10 ,
27
+ learning_rate = 1e-3 ,
28
+ num_loading_cpus = 2 ,
29
+ batch_size = 2 ,
30
+ train_val_split_ration = 0.9 ,
31
+ seed = 42 ,
32
+ amp_backend = 'apex' ,
33
+ amp_level = 'O1' ,
34
+ precision = 16 ,
35
+ wandb_logging = True ,
36
+ wandb_project_name = 'macai' ,
37
+ wandb_run_name = 'randbias_1e-3' ,
38
+
39
+ )
You can’t perform that action at this time.
0 commit comments