-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{"EMBEDDING": "RESNET18", | ||
"OUT_DIM": 256, | ||
"NUM_TRANSFORM": 5, | ||
"NUM_HIDDEN_FLOW": 10, | ||
"HIDDEN_DIM_FLOW": 256, | ||
"MODEL": "NSF", | ||
"LEARNING_RATE": 0.0005, | ||
"CLIP_GRADIENT": 5.0, | ||
"THETA_SHIFT": 9.5, | ||
"THETA_SCALE": 9.5, | ||
"BATCH_SIZE": 256 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{"EMBEDDING": "RESNET18_FFT_FILTER", | ||
"OUT_DIM": 256, | ||
"NUM_TRANSFORM": 5, | ||
"NUM_HIDDEN_FLOW": 10, | ||
"HIDDEN_DIM_FLOW": 256, | ||
"MODEL": "NSF", | ||
"LEARNING_RATE": 0.0003, | ||
"CLIP_GRADIENT": 5.0, | ||
"THETA_SHIFT": 50, | ||
"THETA_SCALE": 50, | ||
"BATCH_SIZE": 256 | ||
} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import torch\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"from cryo_sbi import CryoEmSimulator\n", | ||
"#from cryo_sbi import gen_training_set\n", | ||
"from cryo_sbi.inference.train_npe_model import npe_train_no_saving\n", | ||
"%load_ext autoreload\n", | ||
"%autoreload 2" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Creating particles and then training with them" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Training neural network:\n" | ||
] | ||
}, | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
" 5%|▍ | 28/600 [10:54<3:41:57, 23.28s/epoch, loss=-.243] " | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#torch.cuda.empty_cache()\n", | ||
"#npe_train_no_saving(\n", | ||
"# image_config=\"6wxb/image_params_mixed_training.json\",\n", | ||
"# train_config=\"6wxb/resnet18_fft_encoder.json\",\n", | ||
"# epochs=600,\n", | ||
"# estimator_file=\"estimator_6wxb.estimator\",\n", | ||
"# loss_file=\"6wxb_loss\",\n", | ||
"# device=\"cuda\",\n", | ||
"# simulation_batch_size=1024\n", | ||
"#)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Training neural network:\n" | ||
] | ||
}, | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
" 0%| | 0/600 [00:00<?, ?epoch/s]/mnt/ceph/users/levans/cryo_em_SBI/.venv/lib/python3.9/site-packages/torch/nn/modules/conv.py:459: UserWarning: Applied workaround for CuDNN issue, install nvrtc.so (Triggered internally at ../aten/src/ATen/native/cudnn/Conv_v8.cpp:80.)\n", | ||
" return F.conv2d(input, weight, bias, self.stride,\n", | ||
"100%|██████████| 600/600 [7:17:29<00:00, 43.75s/epoch, loss=12.6] \n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"torch.cuda.empty_cache()\n", | ||
"npe_train_no_saving(\n", | ||
" image_config=\"/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/6wxb/image_params_mixed_training.json\",\n", | ||
" train_config=\"/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/6wxb/resnet18_encoder.json\",\n", | ||
" epochs=600,\n", | ||
" estimator_file= \"/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/estimator_6xwb_no_fft.estimator\",\n", | ||
" loss_file=\"/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/6wxb_no_fft_loss\",\n", | ||
" device=\"cuda\",\n", | ||
" simulation_batch_size=1024\n", | ||
")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3.9.15 64-bit", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.15" | ||
}, | ||
"orig_nbformat": 4, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "7b7fbdd20bcc2083504065e64dd68e11295ac29c39a09e225403f090756a3e6a" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import torch | ||
import matplotlib.pyplot as plt | ||
|
||
from cryo_sbi import CryoEmSimulator | ||
#from cryo_sbi import gen_training_set | ||
from cryo_sbi.inference.train_npe_model import npe_train_no_saving | ||
print(torch.version.cuda) | ||
|
||
torch.cuda.empty_cache() | ||
npe_train_no_saving( | ||
image_config="/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/6wxb/image_params_mixed_training.json", | ||
train_config="/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/6wxb/resnet18_encoder.json", | ||
epochs=600, | ||
estimator_file= "/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/estimator_6xwb_no_fft.estimator", | ||
loss_file="/mnt/ceph/users/levans/cryo_em_SBI/Lukes_folder/6wxb_no_fft_loss", | ||
device="cuda", | ||
simulation_batch_size=1024 | ||
) | ||
|
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.