jupyter notebooks are useful for visualization, but in the current state they rely on files that may not be added yet.Fine tune the fully-connected layer with the learned phase mask (code not available).Note that you can also run with the hybrid_maskopt.py phase mask optimization with the included file "assets/psf_hybrid_optneg_8x9_1e-1.npy" Optimize the phase mask for the weights of the learned convolutional kernels with hybrid_maskopt.py.You'll need to change directories to suit your own needs. npy file and training images for phase mask optimization. Walk through the first sections of HybridNNMaskOpt.ipynb until "Extract optimized phase mask", making sure to save the tiled psf.For similar conditions as in paper results, use: There is much more code than necessary in this file from our experimenting. Train a network with hybrid_cifar10.py.Walk through ONNMaskOpt.ipynb from "Visualization of phase mask optimization" and plug in the checkpoint from onn_maskopt.py.Įxample to optimize a hybrid two-layer CNN for CIFAR-10 (rough outline):.You can use the sample psf in the assets folder or use the one you save from the ONNMaskOpt.ipynb walkthrough onn_maskopt.py: optimizes a phase mask to correspond to a pre-computed PSF.You can use the saved checkpoint folder we link below, or the checkpoint from running onn_quickdraw-16-tiled.py Walk through ONNMaskOpt.ipynb until the "Visualization of phase mask optimization" section.onn_quickdraw-16-tiled.py: optimizes a single-layer tiled kernel PSF model for the quickdraw-16 dataset.Download quickdraw-16 training dataset (see below) into assets folder.Our code was run with Python 3.5.5 and Tensorflow 1.4.0.Įxample to optimize a single-layer optical correlator for QuickDraw-16: Note 2: The Tensorflow fft2 function may also have changed in more recent updates, which has caused some differences in optimization results. Note 1: If you have a more up-to-date version of scipy, you may need to change the function to imageio.imwrite.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |