Link to the application: https://github.com/YudongYao/AutoPhaseNN
References:
-
Get the SBI-FAIR repository
git clone --depth 1 https://github.com/DSC-SPIDAL/sbi-fair SBI_FAIR_DIR=${PWD}/sbi-fair
-
Create a directory for downloading datasets and store results
mkdir autophasenn cd autophasenn mkdir output
-
Get the datasets for training
The AutoPhaseNN dataset (a list of files) requires processing (downloading data and upscaling). The loading script will build and use the Docker container that is provided in the repository to do so.
Instead of the whole dataset you may want to load some sample files for testing. If so, before running the loading script create a shorter list of files for downloading:
mkdir -p aicdi/default wget -q -O - https://github.com/YudongYao/AutoPhaseNN/raw/3375cf98206a83f329faaf4c74eed924f3f4a2fe/TF2/aicdi_data.txt | head -n 300 > aicdi/default/aicdi_data.txt
${SBI_FAIR_DIR}/tools/scripts/load_dataset.py ${SBI_FAIR_DIR}/datasets/autophasenn/datasets.yaml aicdi
-
Create a file with parameters
# Few epochs for testing echo 'epochs: 2' > options.yaml echo 'gpu_num: 1' >> options.yaml echo 'train_size: 100' >> options.yaml
We will update the list of available options here, in the meantime please refer to the original repository https://github.com/YudongYao/AutoPhaseNN for the list of all options.
-
Build Docker container
cd ${SBI_FAIR_DIR}/models/autophasenn ./build_docker.sh cd - # Go back to results directory
-
Run Training
GPU_SWITCH='--runtime=nvidia --gpus all' # or '' for CPU workloads # Mount the directories with the dataset VOLUME_MOUNTS='-v ./aicdi/default:/input/train_dataset -v ./output:/output -v ./options.yaml:/input/options.yaml' docker run ${GPU_SWITCH} ${VOLUME_MOUNTS} autophasenn run train
-
Build Apptainer container
cd ${SBI_FAIR_DIR}/models/autophasenn ./build_apptainer.sh cd - # Go back to results directory
-
Run Training
GPU_SWITCH='--nv' # or '' for CPU workloads # Mount the directories with the dataset VOLUME_MOUNTS='--bind ./aicdi/default:/input/train_dataset --bind ./output:/output --bind ./options.yaml:/input/options.yaml' apptainer run --app train ${GPU_SWITCH} ${VOLUME_MOUNTS} ${SBI_FAIR_DIR}/autophasenn/autophasenn.sif
The outputs of the run will be available in ./output
.