3 Commits
Author SHA1 Message Date
swim 742052f649 1000 iteration jobs 2026-08-10 23:55:15 +09:00
swim be7aac2115 new TODO 2026-08-10 23:54:56 +09:00
swim 792e91536c renamed ExamplePtychoEngine 2026-08-10 23:54:24 +09:00
11 changed files with 344 additions and 5 deletions
+3 -2
View File
@@ -1,7 +1,6 @@
TODO: TODO:
- Clean up BO states - unify `BOEngine.__init__()`
- unify `BOEngine.__init__()`
- BO train_x/y transfer between engines for single job - BO train_x/y transfer between engines for single job
- multi-GPU dispatcher - multi-GPU dispatcher
- template job sequences / yamls - template job sequences / yamls
@@ -11,3 +10,5 @@ TODO:
- fold_slice: load diffractions / hdf5 files; change only param per job - fold_slice: load diffractions / hdf5 files; change only param per job
- restructure `FoldSlicePtychoEngine.__init__()` to load data but not params - restructure `FoldSlicePtychoEngine.__init__()` to load data but not params
- write new `prepare_data.m` - write new `prepare_data.m`
- separate `config` into `bo_config` and `ptycho_config`; let `BOEngine` have no knowledge of ptychography and vice versa.
- add GPU version of ExamplePtychoEngine
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
#SBATCH --job-name=Si2V
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --gres=gpu:rtx-6000ada:1
#SBATCH --time=100:00:00
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
echo "2V"
pwd
hostname
date
export PATH=/home/shared/MATLAB/R2021a/bin:$PATH
export PATH=/usr/local/cuda-11.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
source /home/swim/bo-ptycho/venv/bin/activate
YAML=examples/260809-Si/Si_02V1_2.yaml
cat $YAML
python -u main.py $YAML
date
echo "SLURM JOB FINISHED"
+59
View File
@@ -0,0 +1,59 @@
job:
type: "random+sobo"
random_iters: 100
sobo_iters: 1000
io:
input_data_path: '/home/swim/shared/Si_project/data/Si2V1_2.mat'
result_dir: '/home/swim/bo-ptycho/results/260809-Si/Si2V1_2'
verbosity: 1
ptycho:
engine: 'fold_slice'
path: '/home/swim/fold_slice-stable'
params:
voltage: 200
alpha_max: 30
defocus: -250
rot_ang: 0.3
Nlayers: 20
thickness: 250
rbf: 37
Nprobe: 1
N_scan_x: 64
N_scan_y: 64
tilt_x: 2
tilt_y: 0
scan_step_size: 0.36
Niter: 100
Niter_save_results: 100
CBED_size: 192
ADU: 1
extra_print_info: 'FIB'
scan_number: 1
gpu_id: 1
roi_label: '0_Ndp64'
diff_pattern_blur: 1
probe_change_start: 1
object_change_start: 1
grouping: 64
probe_posiiton_search: 1
regularize_layers: 0.2
variable_probe: false
bo:
mode: 'sobo'
acquisition: 'ucb'
metric: 'log_fourier'
params:
alpha_max:
defocus:
radius: 100
rot_ang:
Nlayers:
radius: 5
type: int
thickness:
radius: 100
train_x:
train_y:
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
#SBATCH --job-name=Si5V
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --gres=gpu:rtx-6000ada:1
#SBATCH --time=100:00:00
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
echo "5V"
pwd
hostname
date
export PATH=/home/shared/MATLAB/R2021a/bin:$PATH
export PATH=/usr/local/cuda-11.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
source /home/swim/bo-ptycho/venv/bin/activate
YAML=examples/260809-Si/Si_05V1_2.yaml
cat $YAML
python -u main.py $YAML
date
echo "SLURM JOB FINISHED"
+59
View File
@@ -0,0 +1,59 @@
job:
type: "random+sobo"
random_iters: 100
sobo_iters: 1000
io:
input_data_path: '/home/swim/shared/Si_project/data/Si5V1_2.mat'
result_dir: '/home/swim/bo-ptycho/results/260809-Si/Si5V1_2'
verbosity: 1
ptycho:
engine: 'fold_slice'
path: '/home/swim/fold_slice-stable'
params:
voltage: 200
alpha_max: 30
defocus: -200
rot_ang: 1
Nlayers: 20
thickness: 250
rbf: 37
Nprobe: 1
N_scan_x: 64
N_scan_y: 64
tilt_x: 3
tilt_y: -1
scan_step_size: 0.36
Niter: 100
Niter_save_results: 100
CBED_size: 192
ADU: 1
extra_print_info: 'FIB'
scan_number: 1
gpu_id: 1
roi_label: '0_Ndp64'
diff_pattern_blur: 1
probe_change_start: 1
object_change_start: 1
grouping: 64
probe_posiiton_search: 1
regularize_layers: 0.2
variable_probe: false
bo:
mode: 'sobo'
acquisition: 'ucb'
metric: 'log_fourier'
params:
alpha_max:
defocus:
radius: 100
rot_ang:
Nlayers:
radius: 5
type: int
thickness:
radius: 150
train_x:
train_y:
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
#SBATCH --job-name=Si8V
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --gres=gpu:rtx-6000ada:1
#SBATCH --time=100:00:00
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
echo "8V"
pwd
hostname
date
export PATH=/home/shared/MATLAB/R2021a/bin:$PATH
export PATH=/usr/local/cuda-11.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
source /home/swim/bo-ptycho/venv/bin/activate
YAML=examples/260809-Si/Si_08V1_2.yaml
cat $YAML
python -u main.py $YAML
date
echo "SLURM JOB FINISHED"
+59
View File
@@ -0,0 +1,59 @@
job:
type: "random+sobo"
random_iters: 100
sobo_iters: 1000
io:
input_data_path: '/home/swim/shared/Si_project/data/Si8V1_2.mat'
result_dir: '/home/swim/bo-ptycho/results/260809-Si/Si8V1_2'
verbosity: 1
ptycho:
engine: 'fold_slice'
path: '/home/swim/fold_slice-stable'
params:
voltage: 200
alpha_max: 30
defocus: -200
rot_ang: 1.3
Nlayers: 25
thickness: 350
rbf: 37
Nprobe: 1
N_scan_x: 64
N_scan_y: 64
tilt_x: 4
tilt_y: 0
scan_step_size: 0.36
Niter: 100
Niter_save_results: 100
CBED_size: 192
ADU: 1
extra_print_info: 'FIB'
scan_number: 1
gpu_id: 1
roi_label: '0_Ndp64'
diff_pattern_blur: 1
probe_change_start: 1
object_change_start: 1
grouping: 64
probe_posiiton_search: 1
regularize_layers: 0.2
variable_probe: false
bo:
mode: 'sobo'
acquisition: 'ucb'
metric: 'log_fourier'
params:
alpha_max:
defocus:
radius: 100
rot_ang:
Nlayers:
radius: 5
type: int
thickness:
radius: 150
train_x:
train_y:
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
#SBATCH --job-name=Si30V
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --gres=gpu:rtx-6000ada:1
#SBATCH --time=100:00:00
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
echo "30V"
pwd
hostname
date
export PATH=/home/shared/MATLAB/R2021a/bin:$PATH
export PATH=/usr/local/cuda-11.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
source /home/swim/bo-ptycho/venv/bin/activate
YAML=examples/260809-Si/Si_30V3_2.yaml
cat $YAML
python -u main.py $YAML
date
echo "SLURM JOB FINISHED"
+59
View File
@@ -0,0 +1,59 @@
job:
type: "random+sobo"
random_iters: 100
sobo_iters: 1000
io:
input_data_path: '/home/swim/shared/Si_project/data/Si30V3_2.mat'
result_dir: '/home/swim/bo-ptycho/results/260809-Si/Si30V3_2'
verbosity: 1
ptycho:
engine: 'fold_slice'
path: '/home/swim/fold_slice-stable'
params:
voltage: 200
alpha_max: 30
defocus: 175
rot_ang: 0.1
Nlayers: 30
thickness: 680
rbf: 37
Nprobe: 1
N_scan_x: 64
N_scan_y: 64
tilt_x: 5
tilt_y: 3
scan_step_size: 0.35
Niter: 100
Niter_save_results: 100
CBED_size: 192
ADU: 1
extra_print_info: 'FIB'
scan_number: 1
gpu_id: 1
roi_label: '0_Ndp64'
diff_pattern_blur: 1
probe_change_start: 1
object_change_start: 1
grouping: 64
probe_posiiton_search: 1
regularize_layers: 0.2
variable_probe: false
bo:
mode: 'sobo'
acquisition: 'ucb'
metric: 'log_fourier'
params:
alpha_max:
defocus:
radius: 50
rot_ang:
Nlayers:
radius: 5
type: int
thickness:
radius: 100
train_x:
train_y:
+1 -2
View File
@@ -1,5 +1,4 @@
from .base import PtychoEngine from .example import ExamplePtychoEngine
from .ptycho_example import ExamplePtychoEngine
from .fold_slice import FoldSlicePtychoEngine from .fold_slice import FoldSlicePtychoEngine
engines = { engines = {
@@ -8,7 +8,6 @@ class ExamplePtychoEngine(PtychoEngine):
def __init__(self, config): def __init__(self, config):
super().__init__(config) super().__init__(config)
# run single ptychography job based on `config`
def run(self, run_id="") -> None: def run(self, run_id="") -> None:
print(f"[{run_id}] [ExamplePtychoEngine] Sleeping for 0.1 second.") print(f"[{run_id}] [ExamplePtychoEngine] Sleeping for 0.1 second.")
time.sleep(0.1) time.sleep(0.1)