Link to the application: https://www.anl.gov/psc/ptychonn-uses-neural-networks-for-faster-xray-imaging
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 ptychonn cd ptychonn mkdir output
-
Get the datasets for training
${SBI_FAIR_DIR}/tools/scripts/load_dataset.py ${SBI_FAIR_DIR}/datasets/ptychonn/datasets.yaml ptychonn_20191008_39
-
Create a file with parameters
# Few epochs for testing echo 'epochs: 2' > options.yaml
We will update the list of available options here, in the meantime please refer to the original repository https://github.com/Presciman/PtychoNN-torch for the list of all options.
-
Build Docker container
cd ${SBI_FAIR_DIR}/models/ptychonn ./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 ./ptychonn_20191008_39/default:/input/train_dataset -v ./output:/output -v ./options.yaml:/input/options.yaml' docker run ${GPU_SWITCH} ${VOLUME_MOUNTS} ptychonn run train
-
Build Apptainer container
cd ${SBI_FAIR_DIR}/models/ptychonn ./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 ./ptychonn_20191008_39/default:/input/train_dataset --bind ./output:/output --bind ./options.yaml:/input/options.yaml' apptainer run --app train ${GPU_SWITCH} ${VOLUME_MOUNTS} ${SBI_FAIR_DIR}/models/ptychonn/ptychonn.sif
The outputs of the run will be available in ./output
.