Skip to content

Commit

Permalink
hsp90 posterior calc and moving things around
Browse files Browse the repository at this point in the history
  • Loading branch information
aevans1 committed Sep 13, 2023
1 parent 51db67f commit 6af4b30
Show file tree
Hide file tree
Showing 36 changed files with 7,515 additions and 460 deletions.
462 changes: 462 additions & 0 deletions Lukes_folder/6wxb/6wxb_MMD.ipynb

Large diffs are not rendered by default.

3,941 changes: 3,941 additions & 0 deletions Lukes_folder/6wxb/6wxb_MMD_bandwidths.ipynb

Large diffs are not rendered by default.

551 changes: 551 additions & 0 deletions Lukes_folder/6wxb/6wxb_MMD_index.ipynb

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
479 changes: 479 additions & 0 deletions Lukes_folder/6wxb/6wxb_experimental_data.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
554 changes: 554 additions & 0 deletions Lukes_folder/6wxb/6wxb_images.ipynb

Large diffs are not rendered by default.

Binary file added Lukes_folder/6wxb/6wxb_loss
Binary file not shown.
Binary file added Lukes_folder/6wxb/6wxb_no_fft_loss
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"PIXEL_SIZE": 2.06,
"SIGMA": [0.5, 5.0],
"MODEL_FILE": "../data/protein_models/6wxb_mixed_models.npy",
"SHIFT": 40,
"SHIFT": true,
"DEFOCUS": [0.5, 5.0],
"SNR": [0.01,1.0],
"SNR": [0.001, 0.1],
"RADIUS_MASK": 100,
"AMP": 0.1,
"B_FACTOR": [1.0, 100.0]
"B_FACTOR": [1.0, 100.0],
"ELECWAVE": 0.019866
}
12 changes: 12 additions & 0 deletions Lukes_folder/6wxb/6wxb_params/resnet18_encoder.json
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
}
12 changes: 12 additions & 0 deletions Lukes_folder/6wxb/6wxb_params/resnet18_fft_encoder.json
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
}
409 changes: 409 additions & 0 deletions Lukes_folder/6wxb/6wxb_prior_to_posterior.ipynb

Large diffs are not rendered by default.

Binary file added Lukes_folder/6wxb/distance_boot.npz
Binary file not shown.
Binary file added Lukes_folder/6wxb/distances_boot.npz
Binary file not shown.
Binary file not shown.
Binary file added Lukes_folder/6wxb/posterior_samples_exp.npz
Binary file not shown.
194 changes: 194 additions & 0 deletions Lukes_folder/6wxb/test_log_posteriors.ipynb

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions Lukes_folder/6wxb/train_6xwb.ipynb
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
}
19 changes: 19 additions & 0 deletions Lukes_folder/6wxb/train_6xwb.py
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
)

418 changes: 0 additions & 418 deletions Lukes_folder/6wxb_prior_to_posterior.ipynb

This file was deleted.

9 changes: 7 additions & 2 deletions Lukes_folder/comparing_estimator_posteriors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3.9.15 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -260,7 +260,12 @@
"pygments_lexer": "ipython3",
"version": "3.9.15"
},
"orig_nbformat": 4
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "7b7fbdd20bcc2083504065e64dd68e11295ac29c39a09e225403f090756a3e6a"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
Binary file added Lukes_folder/hsp90_posterior_mat.npz
Binary file not shown.
333 changes: 333 additions & 0 deletions Lukes_folder/hsp90_prior_to_posterior.ipynb

Large diffs are not rendered by default.

225 changes: 225 additions & 0 deletions Lukes_folder/hsp90_test_log_posteriors copy.ipynb

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions Lukes_folder/hsp90_test_log_posteriors.ipynb

Large diffs are not rendered by default.

37 changes: 0 additions & 37 deletions Lukes_folder/jupyter_ASPIRE_config.yaml

This file was deleted.

0 comments on commit 6af4b30

Please sign in to comment.