From e201372252fc53d93dc7bcd1b369d83ac3466d95 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 13 Oct 2022 17:27:17 +0100 Subject: [PATCH] write quick Jupyter notebook to test data ....I'm paranoid --- ...rainfallwater_embed_dataset_explorer.ipynb | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 aimodel/src/rainfallwater_embed_dataset_explorer.ipynb diff --git a/aimodel/src/rainfallwater_embed_dataset_explorer.ipynb b/aimodel/src/rainfallwater_embed_dataset_explorer.ipynb new file mode 100644 index 0000000..c1a65ed --- /dev/null +++ b/aimodel/src/rainfallwater_embed_dataset_explorer.ipynb @@ -0,0 +1,90 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "1f6fdebf-69c5-46ab-a5a8-f9c91f000ff3", + "metadata": {}, + "outputs": [], + "source": [ + "import tensorflow as tf\n", + "\n", + "from lib.dataset.dataset_segmenter import dataset_segmenter\n", + "from lib.dataset.batched_iterator import batched_iterator" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a6a94dd-5c4e-4481-bfae-eb5ccf6214db", + "metadata": {}, + "outputs": [], + "source": [ + "dirpath=\"/home/bryan-smithl/Documents/repos/PhD-Rainfall-Radar/aimodel/output/rainfallwater_records_embed_2022-10-06_contrast_embed_umap_d512e19_tfrecord\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d1aa931a-ecf2-4134-8e70-87db4ae60736", + "metadata": {}, + "outputs": [], + "source": [ + "dataset_train, dataset_validate = dataset_segmenter(\n", + "\tdirpath_input=dirpath,\n", + "\tbatch_size=32,\n", + "\twater_threshold=0.1,\n", + "\tshape_water_desired=[94, 94]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "456f7c8f-3f7d-4a2c-b361-900588c49612", + "metadata": {}, + "outputs": [], + "source": [ + "i = 0\n", + "for (items, label) in dataset_train:\n", + " #print(\"ITEMS\", len(items), [ item.shape for item in items ])\n", + " print(\"ITEMS\", len(items), items)\n", + " print(\"LABEL\", label)\n", + " \n", + " i+= 1\n", + " if i > 5:\n", + " break\n", + "print(\"ITEMS DONE\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d682fb59-c6a3-4ae9-9683-2eae2f36a5eb", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}