Skip to content

Commit

Permalink
fixed tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Dingel321 committed Jul 19, 2024
1 parent 37e67e5 commit 1252811
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions tutorials/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from scipy.spatial.transform import Rotation\n",
"import umap\n",
"\n",
"from cryo_sbi import CryoEmSimulator\n",
"import cryo_sbi.inference.train_npe_model as train_npe_model\n",
Expand All @@ -20,6 +19,24 @@
"from cryo_sbi.utils.visualize_models import plot_model"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### If you want to run the latent space analysis with UMAP, you need to install the following package:\n",
"You can find the installation instructions [here](https://umap-learn.readthedocs.io/en/latest/). \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# If you installed umap you can import it here \n",
"import umap"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -363,7 +380,7 @@
"plt.scatter(\n",
" latent_vecs_transformed[:, 0],\n",
" latent_vecs_transformed[:, 1],\n",
" c=dist,\n",
" c=side_length,\n",
" cmap=\"viridis\",\n",
" s=10,\n",
")\n",
Expand All @@ -389,13 +406,6 @@
"plt.xlabel(\"UMAP 1\")\n",
"plt.ylabel(\"UMAP 2\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 1252811

Please sign in to comment.