Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify usage of output column generated by the exporter #618

Merged
merged 6 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/getstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ output_test = pd.read_hdf(os.path.join("<output_folder_path>", "output_exporter.

The dataframes contain `phase`, `epoch`, `entry`, `output`, `target`, and `loss` columns, and can be easily used to visualize the results.

For classification tasks, the `output` column contains the results from a [softmax function](https://pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html). This means each entry in the `output` column is a list with one element for each class. Each element represents the probability of that class occurring.
gcroci2 marked this conversation as resolved.
Show resolved Hide resolved

Example for plotting training loss curves using [Plotly Express](https://plotly.com/python/plotly-express/):

```python
Expand Down
24 changes: 10 additions & 14 deletions tutorials/training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,8 @@
"metadata": {},
"outputs": [],
"source": [
"output_train = pd.read_hdf(\n",
" os.path.join(output_path, f\"gnn_{task}\", \"output_exporter.hdf5\"), key=\"training\"\n",
")\n",
"output_test = pd.read_hdf(\n",
" os.path.join(output_path, f\"gnn_{task}\", \"output_exporter.hdf5\"), key=\"testing\"\n",
")\n",
"output_train = pd.read_hdf(os.path.join(output_path, f\"gnn_{task}\", \"output_exporter.hdf5\"), key=\"training\")\n",
"output_test = pd.read_hdf(os.path.join(output_path, f\"gnn_{task}\", \"output_exporter.hdf5\"), key=\"testing\")\n",
"output_train.head()"
]
},
Expand All @@ -436,7 +432,11 @@
"source": [
"The dataframes contain `phase`, `epoch`, `entry`, `output`, `target`, and `loss` columns, and can be easily used to visualize the results.\n",
"\n",
"For example, the loss across the epochs can be plotted for the training and the validation sets:\n"
"For classification tasks, as in the current tutorial, the `output` column contains the results from a [softmax function](https://pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html). This means each entry in the `output` column is a list with one element for each class. Each element represents the probability of that class occurring.\n",
gcroci2 marked this conversation as resolved.
Show resolved Hide resolved
"\n",
"Here specifically, the `output` column contains a list with two elements, respectively representing the predicted probabilities that the data point is 0 (first element of the list, representing non-binder class) and 1 (second element of the list, representing binder class).\n",
gcroci2 marked this conversation as resolved.
Show resolved Hide resolved
"\n",
"The loss across the epochs can be plotted for the training and the validation sets:\n"
]
},
{
Expand Down Expand Up @@ -671,12 +671,8 @@
"metadata": {},
"outputs": [],
"source": [
"output_train = pd.read_hdf(\n",
" os.path.join(output_path, f\"cnn_{task}\", \"output_exporter.hdf5\"), key=\"training\"\n",
")\n",
"output_test = pd.read_hdf(\n",
" os.path.join(output_path, f\"cnn_{task}\", \"output_exporter.hdf5\"), key=\"testing\"\n",
")\n",
"output_train = pd.read_hdf(os.path.join(output_path, f\"cnn_{task}\", \"output_exporter.hdf5\"), key=\"training\")\n",
"output_test = pd.read_hdf(os.path.join(output_path, f\"cnn_{task}\", \"output_exporter.hdf5\"), key=\"testing\")\n",
"output_train.head()"
]
},
Expand Down Expand Up @@ -767,7 +763,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.12"
},
"orig_nbformat": 4
},
Expand Down
Loading