diff --git a/notebooks/wut-predict.ipynb b/notebooks/wut-predict.ipynb index de94d95..28f9e63 100644 --- a/notebooks/wut-predict.ipynb +++ b/notebooks/wut-predict.ipynb @@ -74,29 +74,12 @@ "from sklearn.decomposition import PCA\n", "\n", "# Seaborn pip dependency\n", - "import seaborn as sns" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Interact\n", - "# https://ipywidgets.readthedocs.io/en/stable/examples/Using%20Interact.html\n", + "import seaborn as sns\n", + "\n", "from __future__ import print_function\n", "from ipywidgets import interact, interactive, fixed, interact_manual\n", - "import ipywidgets as widgets" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Display Images\n", + "import ipywidgets as widgets\n", + "\n", "from IPython.display import display, Image" ] }, @@ -106,7 +89,13 @@ "metadata": {}, "outputs": [], "source": [ - "ENCODING='FSK9k6'" + "#ENCODING='APT'\n", + "#ENCODING='CW'\n", + "#ENCODING='FM'\n", + "#ENCODING='FSK9k6'\n", + "ENCODING='GMSK2k4'\n", + "#ENCODING='GMSK4k8'\n", + "#ENCODING='USB'" ] }, { @@ -208,7 +197,7 @@ "metadata": {}, "outputs": [], "source": [ - "print(num_test)" + "print(\"Number of observations to test:\", num_test)" ] }, { @@ -217,7 +206,6 @@ "metadata": {}, "outputs": [], "source": [ - "# This function will plot images in the form of a grid with 1 row and 3 columns where images are placed in each column.\n", "def plotImages(images_arr):\n", " fig, axes = plt.subplots(1, 3, figsize=(20,20))\n", " axes = axes.flatten()\n", @@ -301,6 +289,13 @@ " rating = 'good'\n", "print('Observation: %s' % (rating))" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/notebooks/wut-train.ipynb b/notebooks/wut-train.ipynb index be2d819..23495b4 100644 --- a/notebooks/wut-train.ipynb +++ b/notebooks/wut-train.ipynb @@ -69,18 +69,13 @@ "metadata": {}, "outputs": [], "source": [ - "# Visualization\n", "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from sklearn.decomposition import PCA\n", - "# Seaborn pip dependency\n", "import seaborn as sns\n", - "# Interact\n", - "# https://ipywidgets.readthedocs.io/en/stable/examples/Using%20Interact.html\n", "from ipywidgets import interact, interactive, fixed, interact_manual\n", "import ipywidgets as widgets\n", - "# Display Images\n", "from IPython.display import display, Image\n", "from IPython.display import SVG" ] @@ -91,13 +86,35 @@ "metadata": {}, "outputs": [], "source": [ - "ENCODING='FSK9k6'\n", - "#batch_size = 64\n", + "#ENCODING='APT'\n", + "#ENCODING='BPSK1k2' # Fail\n", + "#ENCODING='FSK9k6'\n", + "#ENCODING='FM'\n", + "ENCODING='GMSK2k4'\n", + "#ENCODING='GMSK4k8'\n", + "#ENCODING='USB'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#batch_size = 8\n", + "#atch_size = 16\n", + "#atch_size = 32\n", + "batch_size = 64\n", + "#batch_size = 128\n", + "#batch_size = 256\n", "#epochs = 4\n", - "batch_size = 128\n", - "epochs = 4\n", + "epochs = 8\n", + "#IMG_WIDTH = 208\n", + "#IMG_HEIGHT = 402\n", "IMG_WIDTH = 416\n", - "IMG_HEIGHT = 803" + "IMG_HEIGHT = 803\n", + "#IMG_WIDTH = 823\n", + "#IMG_HEIGHT = 1603" ] }, { @@ -133,9 +150,9 @@ "print('Validation bad images: ', num_val_bad)\n", "print('Validation images: ', total_val)\n", "print('')\n", - "print('Reduce training and validation set')\n", - "total_train = 5000\n", - "total_val = 5000\n", + "#print('Reduce training and validation set')\n", + "#total_train = 1000\n", + "#total_val = 1000\n", "print('Training reduced to: ', total_train)\n", "print('Validation reduced to: ', total_val)" ] @@ -390,7 +407,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "loss = history.history['loss']\n", @@ -398,8 +417,10 @@ "\n", "epochs_range = range(epochs)\n", "\n", + "save_plot_dir = os.path.join('/srv/satnogs/data/models/', ENCODING)\n", + "os.makedirs(save_plot_dir, exist_ok=True)\n", "plot_file=(\"wut-plot-\" + ENCODING + \".png\")\n", - "save_path_plot = os.path.join('/srv/satnogs/data/models/', ENCODING, plot_file)\n", + "save_path_plot = os.path.join(save_plot_dir, plot_file)\n", "print(save_path_plot)\n", "\n", "plt.figure(figsize=(8, 8))\n", @@ -491,6 +512,13 @@ "source": [ "#SVG(model_to_dot(model).create(prog='dot', format='svg'))" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/notebooks/wut.ipynb b/notebooks/wut.ipynb index 29d7efa..ca2a489 100644 --- a/notebooks/wut.ipynb +++ b/notebooks/wut.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -47,24 +47,16 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Start\n" - ] - } - ], + "outputs": [], "source": [ "print(\"Start\")" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -73,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -91,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -116,7 +108,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -129,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -139,7 +131,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -152,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -162,24 +154,16 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Python import done\n" - ] - } - ], + "outputs": [], "source": [ "print(\"Python import done\")" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -190,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -200,7 +184,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -210,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -220,7 +204,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -230,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -239,7 +223,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -249,20 +233,9 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "total training good images: 16739\n", - "total training bad images: 3961\n", - "--\n", - "Total training images: 20700\n" - ] - } - ], + "outputs": [], "source": [ "print('total training good images:', num_train_good)\n", "print('total training bad images:', num_train_bad)\n", @@ -272,20 +245,9 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "total validation good images: 16716\n", - "total validation bad images: 3934\n", - "--\n", - "Total validation images: 20650\n" - ] - } - ], + "outputs": [], "source": [ "print('total validation good images:', num_val_good)\n", "print('total validation bad images:', num_val_bad)\n",