From 00260bf2fa7e1b872b12ec3642e84e8938716931 Mon Sep 17 00:00:00 2001 From: Anton Bushuiev Date: Fri, 27 Dec 2024 13:50:11 +0100 Subject: [PATCH] Minor update of smiles transformer in demo --- notebooks/demo.ipynb | 1381 +++++++++++++++++++++++------------------- 1 file changed, 759 insertions(+), 622 deletions(-) diff --git a/notebooks/demo.ipynb b/notebooks/demo.ipynb index 8c1d765..1e09e3f 100644 --- a/notebooks/demo.ipynb +++ b/notebooks/demo.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -26,6 +26,7 @@ "from massspecgym.data.transforms import SpecTokenizer, MolFingerprinter, SpecBinner\n", "from massspecgym.models.retrieval import DeepSetsRetrieval, RandomRetrieval, FingerprintFFNRetrieval, FromDictRetrieval\n", "from massspecgym.models.de_novo import DummyDeNovo, RandomDeNovo, SmilesTransformer\n", + "from massspecgym.models.tokenizers import SmilesBPETokenizer, SelfiesTokenizer\n", "\n", "%load_ext autoreload\n", "%autoreload 2" @@ -33,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -52,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -80,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -116,7 +117,8 @@ "model = DeepSetsRetrieval(\n", " bootstrap_metrics=True,\n", " df_test_path='./df_test.pkl',\n", - " out_channels=2048\n", + " out_channels=2048,\n", + " fourier_features=True\n", ")\n", "# model = RandomRetrieval()\n", "\n", @@ -140,599 +142,20 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/anton/miniconda3/envs/massspecgym/lib/python3.11/site-packages/pytorch_lightning/loggers/wandb.py:396: There is a wandb run already in progress and newly created instances of `WandbLogger` will reuse this run. If this is not desired, call `wandb.finish()` before instantiating `WandbLogger`.\n", - "/Users/anton/miniconda3/envs/massspecgym/lib/python3.11/site-packages/pytorch_lightning/trainer/connectors/data_connector.py:441: The 'val_dataloader' does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` to `num_workers=7` in the `DataLoader` to improve performance.\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "f4846a7ea9ca4580b503ef1bb26fc688", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Validation: | | 0/? [00:00