-
Notifications
You must be signed in to change notification settings - Fork 4
/
main_inv_holo_optim.py
32 lines (23 loc) · 1.01 KB
/
main_inv_holo_optim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# %%
""" Inverse design the HOE.
Here we use pre-trained neural litho digital twin to find a better doe layout to send to fab.
"""
from cuda_config import device
from trainer.mbo_holo import MBOHolo
from param.param_inv_design_holography import optim_param, settings
from utils.visualize_utils import show
from utils.general_utils import load_image
holo_target = load_image('data/target.bmp', normlize_flag=True)[None].to(device)
show(holo_target[0, 0], 'target')
# %%
# initialize the optimizer
hoe_optimizer = MBOHolo(optim_param['model_choice'],
settings['use_litho_model_flag'],
optim_param['num_iters'],
optim_param['source_mask_optim_lr'],
optim_param['use_scheduler'],
optim_param['image_visualize_interval'],
save_dir=optim_param['save_dir'],
)
# optimize the hoe
optimized_hoe = hoe_optimizer.optim(holo_target)