Skip to content

Commit

Permalink
added current notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dingel321 committed Apr 14, 2023
1 parent a6646d4 commit 529bfc0
Show file tree
Hide file tree
Showing 16 changed files with 2,355 additions and 1,269 deletions.
16 changes: 0 additions & 16 deletions experiments/6wxb/image_params_bending_training.json

This file was deleted.

12 changes: 0 additions & 12 deletions experiments/6wxb/resnet18_fft_mask_encoder.json

This file was deleted.

22 changes: 17 additions & 5 deletions experiments/6wxb/train.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
python3 -m cryo_sbi.inference.NPE_train_without_saving \
--image_config_file 6wxb/image_params_training.json \
--image_config_file 6wxb/image_params_mixed_training.json \
--train_config_file 6wxb/resnet18_fft_encoder.json\
--epochs 300 \
--estimator_file 6wxb/posterior_6wxb_fft.estimator \
--loss_file 6wxb/posterior_6wxb_fft.loss \
--n_workers 24
--epochs 200 \
--estimator_file 6wxb/6wxb_mixed_posterior.estimator \
--loss_file 6wxb/6wxb_mixed_posterior.loss \
--n_workers 24 \
--train_from_checkpoint \
--state_dict_file 6wxb/posterior_torsion.estimator

python3 -m cryo_sbi.inference.NPE_train_without_saving \
--image_config_file 6wxb/image_params_mixed_training.json \
--train_config_file 6wxb/resnet18_fft_noise_encoder.json\
--epochs 200 \
--estimator_file 6wxb/6wxb_mixed_posterior_noise.estimator \
--loss_file 6wxb/6wxb_mixed_posterior_noise.loss \
--n_workers 24 \
--train_from_checkpoint \
--state_dict_file 6wxb/6wxb_mixed_posterior.estimator
38 changes: 9 additions & 29 deletions notebooks/analysis_model_missmatch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"id": "c11d3bbe-f081-467b-9a51-f993cd7dea8a",
"metadata": {},
"outputs": [],
Expand All @@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "daa12d64",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -55,25 +55,17 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "f2eb23c1-3229-48a7-a965-deb74277e0a8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"../protein_models/hsp90_models.npy\n"
]
}
],
"outputs": [],
"source": [
"cryosbi = CryoEmSimulator(config_dir + \"image_params_training.json\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "269ee74f-9a78-4c27-bd7f-14ec441de8ba",
"metadata": {},
"outputs": [],
Expand All @@ -96,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"id": "935c6abe-74fc-4ca6-a29f-36e89e89a198",
"metadata": {},
"outputs": [],
Expand All @@ -106,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"id": "fb6ef49b",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -192,22 +184,10 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"id": "034912d5-3bbf-486d-999a-314a8fc617e4",
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "module 'cryo_sbi.inference.priors' has no attribute 'get_unirom_prior_1d'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb Cell 13\u001b[0m in \u001b[0;36m<cell line: 4>\u001b[0;34m()\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m \u001b[39mfor\u001b[39;00m i \u001b[39min\u001b[39;00m \u001b[39mrange\u001b[39m(\u001b[39m5\u001b[39m):\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m cryosbi\u001b[39m.\u001b[39mmodels \u001b[39m=\u001b[39m models[:, i]\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=5'>6</a>\u001b[0m loader \u001b[39m=\u001b[39m JointLoader(\n\u001b[0;32m----> <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m priors\u001b[39m.\u001b[39;49mget_unirom_prior_1d(cryosbi\u001b[39m.\u001b[39mmax_index),\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m cryosbi\u001b[39m.\u001b[39msimulator,\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=8'>9</a>\u001b[0m vectorized\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m,\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m batch_size\u001b[39m=\u001b[39m\u001b[39m1\u001b[39m, \n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m num_workers\u001b[39m=\u001b[39mnum_workers,\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m prefetch_factor\u001b[39m=\u001b[39m\u001b[39m1\u001b[39m\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m )\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=14'>15</a>\u001b[0m estimator\u001b[39m.\u001b[39mcuda()\n\u001b[1;32m <a href='vscode-notebook-cell:/home/dingeldein/Desktop/cryo_em_SBI/notebooks/analysis_model_missmatch.ipynb#X15sZmlsZQ%3D%3D?line=15'>16</a>\u001b[0m estimator\u001b[39m.\u001b[39meval()\n",
"\u001b[0;31mAttributeError\u001b[0m: module 'cryo_sbi.inference.priors' has no attribute 'get_unirom_prior_1d'"
]
}
],
"outputs": [],
"source": [
"all_levels = []\n",
"all_coverages = []\n",
Expand Down
Loading

0 comments on commit 529bfc0

Please sign in to comment.