From c53372e679d98bd3988ac17d73f5318ed48b3a00 Mon Sep 17 00:00:00 2001
From: Ycblue <yuchialan@gmail.com>
Date: Thu, 31 Aug 2023 18:27:14 +0200
Subject: [PATCH] config

---
 config.yaml | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 workflow.md | 10 ++++++--
 2 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 config.yaml

diff --git a/config.yaml b/config.yaml
new file mode 100644
index 0000000..81cca28
--- /dev/null
+++ b/config.yaml
@@ -0,0 +1,70 @@
+#General:
+gpu_ids: '0'
+phase: train
+verbose: False
+update_TB_images_freq: 5000
+grid_search: False
+n_min_layers: 4
+n_max_layers: 7
+run_dev_mode: False
+
+#Data:
+###########
+# Update! #
+###########
+stain: HE
+stainB: PAS
+pathStainA: /path/to/A
+pathStainB: /path/to/B
+resultsPath: /train/result/path
+testResultsPath: /test/result/path
+dataStage: Train
+###########
+
+suffix: ''
+dataset_mode: unaligned
+preload: True
+direction: BtoA
+serial_batches: 4
+num_threads: 4
+batch_size: 3
+load_size: 640
+crop_size: 640
+max_dataset_size: inf
+preprocess: none
+no_flip: False
+
+#Model:
+model: cycle_gan
+input_nc: 3
+output_nc: 3
+ngf: 32 # # of gen filters in the last conv layer
+ndf: 32 # # of disc filters in the first conv layer
+netD: n_layers
+netG: unet
+n_layers_D: 4
+n_layers_G: 7
+norm: instance
+init_type: normal
+init_gain: 0.02
+no_dropout: False
+use_MC: False
+
+#SegModel
+use_segm_model: True  
+segm_model_path: /path/to/flash/model/
+
+#Training:
+niters: 30000
+niters_init: 0
+beta1: 0.5
+lambda_id: 1
+lr: 0.0001
+gan_mode: lsgan
+pool_size: 50
+lr_policy: linear
+niters_linDecay: 100
+niters_stepDecay: 50
+validation_freq: 1000
+saveModelEachNIteration: 10000
+print_memory_usage_freq: 5000
\ No newline at end of file
diff --git a/workflow.md b/workflow.md
index a8e3bb2..e738e1e 100644
--- a/workflow.md
+++ b/workflow.md
@@ -15,20 +15,26 @@
 `CUDA_VISIBLE_DEVICES=0 python train.py --config config.yaml --gridsearch`
 
    Directory output should look like this:
+```
 ├── somewhere
 │   ├── StainA_StainB
 │   │   ├── cycle_gan_gen_unet_4_32_dis_n_layers_4_32_batch...
 │   │   ├── cycle_gan_gen_unet_4_32_dis_n_layers_5_32_batch...
 │   │   │   ├── Models
+```
+
 
 4. Run test_gridseach.py to generate visual_check images to decide which model is best
 `CUDA_VISIBLE_DEVICES=0 python test_gridsearch.py --config config.yaml`
-
+```
 ├── somewhere
 │   ├── StainA_StainB
 │   │   ├── gridsearch_visual_check_4_8.png
 │   │   ├── cycle_gan_gen_unet_4_32_dis_n_layers_4_32_batch...
 │   │   ├── cycle_gan_gen_unet_4_32_dis_n_layers_5_32_batch...
 │   │   │   ├── Models
+```
+
+5. Copy best model with directory to `somewhere/StainA_StainB/best/
 
-5. Copy best model with directory to `somewhere/StainA_StainB/best/
\ No newline at end of file
+6. run `test.py` and the best model should be found automatically.
\ No newline at end of file
-- 
GitLab