mirror of
https://github.com/c-sooyoung/bo-ptycho.git
synced 2026-09-17 21:29:07 +09:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceba9193f9 | ||
|
|
635f2db5f0 |
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2026 Sooyoung Cheong
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation the
|
||||||
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
# TODO:
|
# TODO:
|
||||||
|
|
||||||
- fold_slice:
|
- fold_slice:
|
||||||
- load diffractions / hdf5 files; change only param per job
|
- 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
|
||||||
@@ -17,10 +16,9 @@
|
|||||||
- change job.sub to job.sh
|
- change job.sub to job.sh
|
||||||
- dynamic jobname
|
- dynamic jobname
|
||||||
- pre-check result directory
|
- pre-check result directory
|
||||||
- clean up examples for Si-FIB paper version
|
|
||||||
|
|
||||||
# TODAY:
|
# TODAY:
|
||||||
- rename `BOEngine` to `Sampler`
|
- change yaml schema, use stages in config-new.yaml
|
||||||
- separation of available GPUs and parallel sample batches
|
- separation of available GPUs and parallel sample batches
|
||||||
- prepare next batch for efficient GPU use
|
- prepare next batch for efficient GPU use
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
io:
|
||||||
|
input_data_path: '/home/swim/shared/Si_project/data/Si2V1_2.mat'
|
||||||
|
result_dir: '/home/swim/bo-ptycho/results/test'
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
|
ptycho:
|
||||||
|
engine: 'fake'
|
||||||
|
# path: '/home/swim/fold_slice-park'
|
||||||
|
params:
|
||||||
|
voltage: 200
|
||||||
|
alpha_max: 30
|
||||||
|
defocus: -250
|
||||||
|
rot_ang: 0.3
|
||||||
|
Nlayers: 20
|
||||||
|
thickness: 250
|
||||||
|
rbf: 37
|
||||||
|
tilt_x: 2
|
||||||
|
tilt_y: 0
|
||||||
|
scan_step_size: 0.36
|
||||||
|
|
||||||
|
Niter: 10
|
||||||
|
Niter_save_results: 10
|
||||||
|
|
||||||
|
CBED_size: 192
|
||||||
|
ADU: 1
|
||||||
|
Nprobe: 1
|
||||||
|
N_scan_x: 64
|
||||||
|
N_scan_y: 64
|
||||||
|
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_position_search: 1
|
||||||
|
regularize_layers: 0.2
|
||||||
|
variable_probe: false
|
||||||
|
|
||||||
|
search:
|
||||||
|
metric: log_fourier
|
||||||
|
|
||||||
|
params:
|
||||||
|
defocus:
|
||||||
|
radius: 100
|
||||||
|
Nlayers:
|
||||||
|
radius: 5
|
||||||
|
type: int
|
||||||
|
thickness:
|
||||||
|
radius: 150
|
||||||
|
|
||||||
|
train_x:
|
||||||
|
train_y:
|
||||||
|
|
||||||
|
stages:
|
||||||
|
# - sampler: fixed
|
||||||
|
|
||||||
|
# - sampler: grid
|
||||||
|
# defocus: 7
|
||||||
|
# Nlayers: 11
|
||||||
|
# thickness: 7
|
||||||
|
|
||||||
|
- sampler: random
|
||||||
|
samples: 16
|
||||||
|
|
||||||
|
- sampler: sobo
|
||||||
|
samples: 256
|
||||||
|
batch: 4
|
||||||
|
acquisition: 'ucb'
|
||||||
|
beta: 0.1
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# bo-ptycho
|
||||||
|
|
||||||
|
This code is a (re)implementation of Bayesian Optimized ptychography in python for use at LEMON lab, used for
|
||||||
|
|
||||||
|
- Optimization-based Thickness Estimation and FIB-induced Damage Characterization of TEM Sample via Multislice Electron Ptychography (manuscript)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Code usage
|
||||||
|
|
||||||
|
Prerequisites:
|
||||||
|
1. Create a python virtual environment with [requirements.txt](./requirements.txt)
|
||||||
|
2. Download [fold_slice](#)
|
||||||
|
2. Download [experimental data](#)
|
||||||
|
|
||||||
|
Reconstruction and parameter optimization:
|
||||||
|
1. Edit [config.yaml](./config.yaml)
|
||||||
|
- Example configurations can be found under `examples/silicon-fib/`
|
||||||
|
- Set io.input_data_path and io.result_dir as needed (WARNING: the result directory will be completely removed)
|
||||||
|
- Set ptycho.path to your fold_slice path
|
||||||
|
2. Edit [job.sub](./job.sub)
|
||||||
|
- Set the SBATCH configurations as needed (especially `gres` and `output`)
|
||||||
|
- The number of GPUs should match bo.batch in config.yaml
|
||||||
|
- Set the virtual environment path
|
||||||
|
- Set the config.yaml path
|
||||||
|
3. Submit the job via SLURM
|
||||||
Reference in New Issue
Block a user