{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "generate_colors_from_text.ipynb",
      "provenance": [],
      "toc_visible": true,
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/mrm8488/shared_colab_notebooks/blob/master/generate_colors_from_text.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ULJWa_BuQEnX",
        "colab_type": "text"
      },
      "source": [
        "# Keras model to generate colors"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "6QX9OnnRRJRm",
        "colab_type": "text"
      },
      "source": [
        "### Overview\n",
        "\n",
        "1.  Choose a language model to best represent input text\n",
        "2.  Clean and prepare data for training\n",
        "3. Build a basic Keras sequential neural network model\n",
        "4. Apply recurrent neural network (RNN) to process character sequences.\n",
        "5. Generate 3 channel RGB color outputs.\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "rDLk7ZE8R4Av",
        "colab_type": "text"
      },
      "source": [
        "![schema](https://gitcdn.xyz/cdn/Tony607/blog_statics/2bc83b36beab8672dcca45926f927b8189a74ec3/images/keras_colors/build_overview.png)"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "l6M4HKlcQBpt",
        "colab_type": "code",
        "outputId": "b0c843b4-7ed8-4314-c7a6-f85e8eceb9e5",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 54
        }
      },
      "source": [
        "!ls -l"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "total 4\n",
            "drwxr-xr-x 1 root root 4096 Apr 29 16:32 sample_data\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "z6FuqsPERvu9",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "import scipy.stats as stats\n",
        "import pylab as plt"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "n0sZWRjfTAVK",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "df = pd.read_csv(\"colors.csv\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "sNZZBV9STHHt",
        "colab_type": "code",
        "outputId": "d354d920-723e-4858-ad8d-9534ede28e81",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 198
        }
      },
      "source": [
        "df.head()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>name</th>\n",
              "      <th>red</th>\n",
              "      <th>green</th>\n",
              "      <th>blue</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>parakeet</td>\n",
              "      <td>174</td>\n",
              "      <td>182</td>\n",
              "      <td>87</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>saddle brown</td>\n",
              "      <td>88</td>\n",
              "      <td>52</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>cucumber crush</td>\n",
              "      <td>222</td>\n",
              "      <td>237</td>\n",
              "      <td>215</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>pool blue</td>\n",
              "      <td>134</td>\n",
              "      <td>194</td>\n",
              "      <td>201</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>distance</td>\n",
              "      <td>98</td>\n",
              "      <td>110</td>\n",
              "      <td>130</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "             name  red  green  blue\n",
              "0        parakeet  174    182    87\n",
              "1    saddle brown   88     52     1\n",
              "2  cucumber crush  222    237   215\n",
              "3       pool blue  134    194   201\n",
              "4        distance   98    110   130"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 4
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "WwszDLrdTIh6",
        "colab_type": "code",
        "outputId": "690a853a-f30b-4112-b8a0-f3b4d858d5d8",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 74
        }
      },
      "source": [
        "h = sorted(df['name'].str.len().as_matrix())"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:1: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
            "  \"\"\"Entry point for launching an IPython kernel.\n"
          ],
          "name": "stderr"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "o_xD6GjMTjaN",
        "colab_type": "code",
        "outputId": "444502c7-a2c2-4ce7-bf78-d3bd419affee",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 338
        }
      },
      "source": [
        "fit = stats.norm.pdf(h, np.mean(h), np.std(h))  #this is a fitting indeed\n",
        "plt.plot(h,fit,'-o')\n",
        "plt.hist(h,normed=True)      #use this to draw histogram of your data\n",
        "plt.xlabel('Chars')\n",
        "plt.ylabel('Probability density')\n",
        "plt.show()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/usr/local/lib/python3.6/dist-packages/matplotlib/axes/_axes.py:6521: MatplotlibDeprecationWarning: \n",
            "The 'normed' kwarg was deprecated in Matplotlib 2.1 and will be removed in 3.1. Use 'density' instead.\n",
            "  alternative=\"'density'\", removal=\"3.1\")\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VPW9//HXZyYbILKGRRaDiCKL\ndYm4VgVFRatoqxWrt2rt1eutbe12f9hFqff21vbWbuq9ra22Wq1LrQsWFEGoCyqyCCqE3SiLhl1Z\nDElmPr8/5kRDSDKTZeZkJu/n43EeM3Pme2Y+40g+893N3REREWlKJOwARESk/VOyEBGRpJQsREQk\nKSULERFJSslCRESSUrIQEZGklCxERCQpJQsREUlKyUJERJLKCzuAttK7d28vKSkJOwwRkayycOHC\nLe5enKxcziSLkpISFixYEHYYIiJZxczeTaWcmqFERCQpJQsREUlKyUJERJJSshARkaSULEREJCkl\nCxERSUrJQkREklKyEBGRpJQsREQkqZyZwS0tMKVbSO/7YTjvKyItppqFiIgkpWQhIiJJqRlKMqKk\n8gHAEg8mTwOg/LbzwgtIRJpFNQtJu08TRe0RnA+Shoi0f0oWkgH7JgkRyT5KFhIqdw87BBFJgZKF\npFW1R5t8fuJdc3lh5WYlDZF2Th3ckjbucHPNVSSaoJyGmqK27qriyntfZ8yQnnzv7MM5rqRng30Z\n6gwXCVdaaxZmdo6ZrTCz1WY2u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qz3h7ktITAQ7wMweM7PlZvZgkFgws5vN\nbL6ZvW1md9c5/08z+3Ww18k3zeySoMwSM3sxjA8n0hj9mhFpnlEk9khoyNHASGAjMBc4mcReA3e6\n+60AZvYX4HPA08E1Be5eGjz3FnC2u2+oXc5BpL1QzUKk7bzu7uuDxeoWAyXB+bHBDmZvkdhzYGSd\nax6pc38u8Gcz+1cSSzmItBtKFiLNsxQ4tpHn6q7DEwPyzKwI+F/gYncfTWLF06I65XbX3nH3fwN+\nCAwCFppZr7YMXKQ1lCxEmmc2UFh3M6tgYbfPNlK+NjFsCfZYuLiRcpjZUHef5+43A5tJJA2RdkF9\nFiLN4O5uZhcBvzaz/wdUkljF9MlGyu8wsz+QWBL7A2B+Ey//P2Y2DDDgeWBJW8Yu0hpadVZERJJS\nM5SIiCSlZCEiIkkpWYiISFJKFiIikpSShYiIJKVkISIiSSlZiIhIUkoWIiKS1P8HMaHxxmPyclkA\nAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Aug_0DjrT1bf",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "names = df['name'].values"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "TSX_KQJmUZg5",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "from tensorflow.python.keras import preprocessing\n",
        "from tensorflow.python.keras.preprocessing.text import Tokenizer\n",
        "\n",
        "maxlen = 25\n",
        "t = Tokenizer(char_level=True)\n",
        "t.fit_on_texts(names)\n",
        "tokenized = t.texts_to_sequences(names)\n",
        "padded_names = preprocessing.sequence.pad_sequences(tokenized, maxlen=maxlen)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "B56P6HGXU04E",
        "colab_type": "code",
        "outputId": "41294496-dba4-45ef-ab01-d2685ec023e6",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 145
        }
      },
      "source": [
        "padded_names"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([[ 0,  0,  0, ...,  1,  1,  9],\n",
              "       [ 0,  0,  0, ...,  8, 20,  6],\n",
              "       [ 0,  0,  0, ..., 12, 10, 16],\n",
              "       ...,\n",
              "       [ 0,  0,  0, ...,  8,  6,  1],\n",
              "       [ 0,  0,  0, ...,  1,  1,  6],\n",
              "       [ 0,  0,  0, ...,  5, 11,  1]], dtype=int32)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 9
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Lg_1RQjrVBCI",
        "colab_type": "text"
      },
      "source": [
        "### One-hot encoding"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "t14_DxCLU5vj",
        "colab_type": "code",
        "outputId": "89f85bf0-4fdc-4662-bdd7-8ac53ebcdf59",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 508
        }
      },
      "source": [
        "t.word_index"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "{' ': 4,\n",
              " 'a': 2,\n",
              " 'b': 18,\n",
              " 'c': 11,\n",
              " 'd': 13,\n",
              " 'e': 1,\n",
              " 'f': 22,\n",
              " 'g': 14,\n",
              " 'h': 16,\n",
              " 'i': 5,\n",
              " 'j': 26,\n",
              " 'k': 21,\n",
              " 'l': 7,\n",
              " 'm': 17,\n",
              " 'n': 6,\n",
              " 'o': 8,\n",
              " 'p': 15,\n",
              " 'q': 25,\n",
              " 'r': 3,\n",
              " 's': 10,\n",
              " 't': 9,\n",
              " 'u': 12,\n",
              " 'v': 23,\n",
              " 'w': 20,\n",
              " 'x': 27,\n",
              " 'y': 19,\n",
              " 'z': 24}"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 10
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "9blBjxXFVIaZ",
        "colab_type": "code",
        "outputId": "1f8f9e68-0157-44b1-91ea-d080cfc47db6",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 35
        }
      },
      "source": [
        "from keras.utils import np_utils\n",
        "one_hot_names = np_utils.to_categorical(padded_names)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Using TensorFlow backend.\n"
          ],
          "name": "stderr"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "g59lWoZqVQI-",
        "colab_type": "code",
        "outputId": "18cdbc48-4e7f-407d-ade4-32ac58cac7ac",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 926
        }
      },
      "source": [
        "one_hot_names[0]"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([[1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
              "       [0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.,\n",
              "        0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]], dtype=float32)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "gjGsqbzYVR11",
        "colab_type": "code",
        "outputId": "86a8bbd1-4877-4431-a75b-45149584bfca",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 35
        }
      },
      "source": [
        "one_hot_names.shape"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(14157, 25, 28)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 13
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "w43dWc4BVoSt",
        "colab_type": "text"
      },
      "source": [
        "### Data normalization"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "04quFcarVhRD",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "# The RGB values are between 0 - 255\n",
        "# scale them to be between 0 - 1\n",
        "def norm(value):\n",
        "    return value / 255.0"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8jFpgL_yVz9u",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "normalized_values = np.column_stack([norm(df[\"red\"]), norm(df[\"green\"]), norm(df[\"blue\"])])"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ENhuxpydV5-L",
        "colab_type": "code",
        "outputId": "72291e40-cc06-42f0-94a8-04536bc5c8cc",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 35
        }
      },
      "source": [
        "normalized_values[0]"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([0.68235294, 0.71372549, 0.34117647])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 16
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "g2JivLsNWJ1c",
        "colab_type": "text"
      },
      "source": [
        "### Build the model"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LlEv9h4sV7c-",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "from tensorflow.python.keras.models import Sequential\n",
        "from tensorflow.python.keras.layers import Dense, Dropout, LSTM, Reshape"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "JDENutPyWR9N",
        "colab_type": "code",
        "outputId": "b9274c93-be23-4dc7-a4b8-faa4d892d069",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 92
        }
      },
      "source": [
        "model = Sequential()\n",
        "model.add(LSTM(256, return_sequences=True, input_shape=(maxlen, 28)))\n",
        "model.add(LSTM(128))\n",
        "model.add(Dense(128, activation='relu'))\n",
        "model.add(Dense(3, activation='sigmoid'))"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Colocations handled automatically by placer.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "lJ3k3T4NWXzg",
        "colab_type": "code",
        "outputId": "e6ac6ae7-968c-4711-b3d3-8930649268a1",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 92
        }
      },
      "source": [
        "model.compile(optimizer='adam', loss='mse', metrics=['acc'])"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/losses_utils.py:170: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Use tf.cast instead.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "KvI3rLF5WjUm",
        "colab_type": "text"
      },
      "source": [
        "### Training"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "YdBvcyMMWk_J",
        "colab_type": "code",
        "outputId": "55d0a3c1-072f-470d-edef-feab7a314346",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1565
        }
      },
      "source": [
        "history = model.fit(one_hot_names, normalized_values,\n",
        "                    epochs=40,\n",
        "                    batch_size=32,\n",
        "                    validation_split=0.1)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Train on 12741 samples, validate on 1416 samples\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Use tf.cast instead.\n",
            "Epoch 1/40\n",
            "12741/12741 [==============================] - 36s 3ms/sample - loss: 0.0601 - acc: 0.6332 - val_loss: 0.0601 - val_acc: 0.6716\n",
            "Epoch 2/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0553 - acc: 0.6637 - val_loss: 0.0575 - val_acc: 0.6624\n",
            "Epoch 3/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0525 - acc: 0.6624 - val_loss: 0.0558 - val_acc: 0.6751\n",
            "Epoch 4/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0503 - acc: 0.6619 - val_loss: 0.0512 - val_acc: 0.6843\n",
            "Epoch 5/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0479 - acc: 0.6652 - val_loss: 0.0500 - val_acc: 0.6893\n",
            "Epoch 6/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0458 - acc: 0.6740 - val_loss: 0.0495 - val_acc: 0.6603\n",
            "Epoch 7/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0435 - acc: 0.6777 - val_loss: 0.0479 - val_acc: 0.6766\n",
            "Epoch 8/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0415 - acc: 0.6819 - val_loss: 0.0466 - val_acc: 0.6547\n",
            "Epoch 9/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0393 - acc: 0.6868 - val_loss: 0.0455 - val_acc: 0.6871\n",
            "Epoch 10/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0370 - acc: 0.6921 - val_loss: 0.0450 - val_acc: 0.7062\n",
            "Epoch 11/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0345 - acc: 0.6970 - val_loss: 0.0451 - val_acc: 0.6921\n",
            "Epoch 12/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0319 - acc: 0.7018 - val_loss: 0.0446 - val_acc: 0.6801\n",
            "Epoch 13/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0293 - acc: 0.7076 - val_loss: 0.0465 - val_acc: 0.6864\n",
            "Epoch 14/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0265 - acc: 0.7158 - val_loss: 0.0461 - val_acc: 0.6942\n",
            "Epoch 15/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0239 - acc: 0.7184 - val_loss: 0.0491 - val_acc: 0.6921\n",
            "Epoch 16/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0216 - acc: 0.7249 - val_loss: 0.0470 - val_acc: 0.6893\n",
            "Epoch 17/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0189 - acc: 0.7342 - val_loss: 0.0487 - val_acc: 0.7112\n",
            "Epoch 18/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0167 - acc: 0.7389 - val_loss: 0.0476 - val_acc: 0.6956\n",
            "Epoch 19/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0152 - acc: 0.7412 - val_loss: 0.0488 - val_acc: 0.6900\n",
            "Epoch 20/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0137 - acc: 0.7531 - val_loss: 0.0486 - val_acc: 0.6970\n",
            "Epoch 21/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0125 - acc: 0.7547 - val_loss: 0.0493 - val_acc: 0.7034\n",
            "Epoch 22/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0114 - acc: 0.7683 - val_loss: 0.0486 - val_acc: 0.6949\n",
            "Epoch 23/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0107 - acc: 0.7747 - val_loss: 0.0503 - val_acc: 0.7069\n",
            "Epoch 24/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0100 - acc: 0.7784 - val_loss: 0.0495 - val_acc: 0.7105\n",
            "Epoch 25/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0092 - acc: 0.7817 - val_loss: 0.0494 - val_acc: 0.7006\n",
            "Epoch 26/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0089 - acc: 0.7871 - val_loss: 0.0508 - val_acc: 0.6992\n",
            "Epoch 27/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0085 - acc: 0.7956 - val_loss: 0.0492 - val_acc: 0.6970\n",
            "Epoch 28/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0080 - acc: 0.7981 - val_loss: 0.0487 - val_acc: 0.7041\n",
            "Epoch 29/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0079 - acc: 0.7981 - val_loss: 0.0506 - val_acc: 0.7048\n",
            "Epoch 30/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0075 - acc: 0.8046 - val_loss: 0.0494 - val_acc: 0.6886\n",
            "Epoch 31/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0074 - acc: 0.8012 - val_loss: 0.0483 - val_acc: 0.7097\n",
            "Epoch 32/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0072 - acc: 0.8089 - val_loss: 0.0499 - val_acc: 0.6928\n",
            "Epoch 33/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0068 - acc: 0.8170 - val_loss: 0.0496 - val_acc: 0.6815\n",
            "Epoch 34/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0068 - acc: 0.8177 - val_loss: 0.0493 - val_acc: 0.7133\n",
            "Epoch 35/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0066 - acc: 0.8214 - val_loss: 0.0493 - val_acc: 0.7041\n",
            "Epoch 36/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0063 - acc: 0.8258 - val_loss: 0.0492 - val_acc: 0.6956\n",
            "Epoch 37/40\n",
            "12741/12741 [==============================] - 35s 3ms/sample - loss: 0.0062 - acc: 0.8258 - val_loss: 0.0483 - val_acc: 0.6886\n",
            "Epoch 38/40\n",
            "12741/12741 [==============================] - 33s 3ms/sample - loss: 0.0062 - acc: 0.8251 - val_loss: 0.0487 - val_acc: 0.7048\n",
            "Epoch 39/40\n",
            "12741/12741 [==============================] - 34s 3ms/sample - loss: 0.0061 - acc: 0.8331 - val_loss: 0.0490 - val_acc: 0.7069\n",
            "Epoch 40/40\n",
            "12741/12741 [==============================] - 32s 3ms/sample - loss: 0.0059 - acc: 0.8364 - val_loss: 0.0488 - val_acc: 0.7020\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "m3lR-LhdvgM1",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "r9zSzz5Avtz-",
        "colab_type": "text"
      },
      "source": [
        "### Testing the model"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Vs2OqfmXvy0_",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "# plot a color image\n",
        "def plot_rgb(rgb):\n",
        "    data = [[rgb]]\n",
        "    plt.figure(figsize=(2,2))\n",
        "    plt.imshow(data, interpolation='nearest')\n",
        "    plt.show()\n",
        "\n",
        "def scale(n):\n",
        "    return int(n * 255) \n",
        "\n",
        "def predict(name):\n",
        "    name = name.lower()\n",
        "    tokenized = t.texts_to_sequences([name])\n",
        "    padded = preprocessing.sequence.pad_sequences(tokenized, maxlen=maxlen)\n",
        "    one_hot = np_utils.to_categorical(padded, num_classes=28)\n",
        "    pred = model.predict(np.array(one_hot))[0]\n",
        "    r, g, b = scale(pred[0]), scale(pred[1]), scale(pred[2])\n",
        "    print(name + ',', 'R,G,B:', r,g,b)\n",
        "    plot_rgb(pred)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "KF_upsS6v6s_",
        "colab_type": "code",
        "outputId": "af9298b1-55fb-4dce-9e88-48a6f0469343",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 500
        }
      },
      "source": [
        "predict(\"tensorflow orange\")\n",
        "predict(\"forest\")\n",
        "predict(\"keras red\")"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "tensorflow orange, R,G,B: 248 137 63\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKIAAACPCAYAAAB5wADzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB71JREFUeJzt3V2IXGcdx/HvL0mThTZtN0lJFxsS\nQ4sSRVqzFF/QiolQvYiFVq0oJpASIYiCCgYCXrQXtoovFxU0RGlswaYNSCON1CZp9UITXXwLqaSb\nFMXEtLZRgrG0Wv17MWfDZJ3Zmd1z9szfM78PLHNenpnnOeyPM3M4859HEYHZoC0Y9ADMwEG0JBxE\nS8FBtBQcREvBQbQUHERLwUG0FBxES2HRoAfQzYrLL4vVoyODHobNwq/OXHgpIq6Zy3PTBnH16Ag/\n+/T6QQ/DZmHkCz/541y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FX\nAefqGd6c9TyuiGg/ht30MS1yprfm/cDmYnkz8Nj0BpJGJS0pllcA7wSeqW2Es9NzajguPeY7gMNR\nfNpPrJ8p78baVjfRqmWa2aCvwtqutJYDh4BJ4CCwrNg+Duwult8BHKN1pXYM2Drocfc4pg8Az9I6\nY+8stt1Nq4oRYAR4FDgJ/AJYO+gxV3RcXwKOF/+np4A39npN31mxFDK9NdsQcxAtBQfRUnAQLQUH\n0VJwEC0FB9FScBAthf8C4hubKzwmgfYAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 144x144 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "forest, R,G,B: 26 74 28\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKIAAACPCAYAAAB5wADzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB6VJREFUeJzt3V2IXGcdx/Hvb3fZpNA05qVsFw2N\nwaJEkVaX4nvFRqhexEKLVhSzEIkQBEG8CAS8aC9sFV8uKmiIQuyFxgakkUa0SVq8MdEVX0Iq6SZF\ncZO02irRUuyL/XsxZ8Nknd2ZnXP2zD9nfh9Y9pw5z5znOcyPmTmc+Z9HEYHZoI0MegBm4CBaEg6i\npeAgWgoOoqXgIFoKDqKl4CBaCg6ipTA26AEsZmR8JMauSTs86+CVf73yXERc389z077SY9eMcf37\nJgY9DFuGC0fm/tLvc/3RbCk4iJaCg2gpOIiWgoNoKTiIlkKpIEpaL+kxSbPF/3VLtL1O0pykB8v0\nac1U9h1xD3AsIm4CjhXri7kP+GXJ/qyhygbxY8CBYvkAcGenRpLeCUwAvyjZnzVU2SBORMTFYvkZ\nWmG7gqQR4Ov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h7i8fupVXFCLAaeBg4C/wa2DLoMVd0\nXF8BThev0+PAW7rt01dWLIVMH802xBxES8FBtBQcREvBQbQUHERLwUG0FBxES+F/4GuRUwvYBlEA\nAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 144x144 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "keras red, R,G,B: 147 38 60\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKIAAACPCAYAAAB5wADzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB7lJREFUeJzt3V2IXGcdx/HvL5uXvUhas4mki8bE\nYFGiSKtL8QWtmAjVi1ho1YpiAikRgiKoSCDgRXthq/hyUUFDlMYWNDYgjTRim6RFBBNd8CWkkmxS\nlCam1UYJhtJo69+LORsm68zO7J6zZ/6e+X1gmfPyzDzPYX/MzOHM/zyKCMwGbdGgB2AGDqIl4SBa\nCg6ipeAgWgoOoqXgIFoKDqKl4CBaCosHPYBulo8sibElo4Mehs3Bs1cuvxARr57Pc9MGcWzJKF9a\nd9Ogh2Fz8NnTv/zzfJ/rj2ZLwUG0FBxES8FBtBQcREvBQbQUSgVR0pikJyRNFY8rZ2l7naRzkh4o\n06c1U9l3xF3AkYi4EThSrHdzL/CLkv1ZQ5UN4oeBfcXyPuD2To0kvR1YAzxesj9rqLJBXBMRF4rl\n52iF7RqSFgFfB77Y68Uk7ZA0KWny8iv/Ljk0+3/S8xKfpMPADR127W5fiYiQ1KkkcCdwKCLOSZq1\nr4jYA+wBeN3oCpcXDpGeQYyIzd32SXpe0nhEXJA0Dvy1Q7N3Au+RtBNYDiyVdDkiZvs+aUOm7I8e\nDgJbgfu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g==\n",
            "text/plain": [
              "<Figure size 144x144 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QDLQ7CHiwGlH",
        "colab_type": "code",
        "outputId": "d75ea8e1-e06d-45fa-9370-111f95bccbe4",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 178
        }
      },
      "source": [
        "predict(\"clear blue\")"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "clear blue, R,G,B: 36 117 211\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKIAAACPCAYAAAB5wADzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB7xJREFUeJzt3V2IXGcdx/HvL5smKTSJeZFkq6Ex\nWJRUpdWl+IJWTITqRSy0akVpAikRgiCoF4GAF+2FrcWXiwoaojS2oLEBaaQR2yQt3pjogi8hkXQ3\nRTExjTaWYKmNtP69mLNhss7szO45e+bvmd8Hljkvz8zzHPbHmTmc+c+jiMBs0BYMegBm4CBaEg6i\npeAgWgoOoqXgIFoKDqKl4CBaCg6ipbBw0APoZuTaFXHN8usHPQybhcsXTr0YEW+cy3PTBvGa5dez\n7p79gx6GzcLkQ+/881yf67dmS8FBtBQcREvBQbQUHERLwUG0FEoFUdJKSU9LmigeV8zQdpmks5Ie\nLtOnNVPZM+Iu4EhE3AgcKda7uR/4Zcn+rKHKBvETwL5ieR9wR6dGkt4DrAGeKtmfNVTZIK6JiPPF\n8gu0wnYVSQuAbwBf6fViknZIGpc0/vq/Xio5NPt/0vMWn6TDwNoOu3a3r0RESOpUErgTOBQRZyXN\n2FdE7AH2ACxZe5PLC4dIzyBGxOZ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8FBtBQcREvBQbQU/gtnzJsG7FozNwAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 144x144 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "opldVSUawLAr",
        "colab_type": "code",
        "outputId": "4de7799e-2fb8-4e1b-e270-b56907cdcd04",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 178
        }
      },
      "source": [
        "predict(\"red hell\")"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "red hell, R,G,B: 174 41 60\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKIAAACPCAYAAAB5wADzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB7tJREFUeJzt3V2IXGcdx/HvL9m8CE1qXtp00dA0\ntFSiSKtL8QWtmAjVi1hsbSuKCaRECIKgXgQCXrQXthZfLipoiNLYgsYGpJFGtElaRDCpC7aGtKSb\nFMXEtNoo0VBSjf69mLNhss7szO45e+bvmd8Hljkvz8zzHPbHzBzO/M+jiMBs0OYNegBm4CBaEg6i\npeAgWgoOoqXgIFoKDqKl4CBaCg6ipTAy6AF0s3RkQVy9YPGgh2EzcPLC+dci4qrZPDdtEK9esJiH\nrrtp0MOwGfjEi7/6w2yf649mS8FBtBQcREvBQbQUHERLwUG0FEoFUdJySU9Jmigel03TdqmkU5Ie\nLtOnNVPZd8TtwMGIuAE4WKx3cz/wy5L9WUOVDeLHgd3F8m7g9k6NJL0bWAX8omR/1lBlg7gqIs4U\ny6/QCttlJM0Dvg58udeLSdoqaVzS+N8v/qvk0Oz/Sc9LfJIOANd02LWjfSUiQlKnksBtw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O2gx1zRcX0VOFb8n54G3tbrNX1lxVLI9NFsQ8xBtBQcREvBQbQUHERL\nwUG0FBxES8FBtBT+CwqxmtoWXB3cAAAAAElFTkSuQmCC\n",
            "text/plain": [
              "<Figure size 144x144 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tik7v5t4wPpQ",
        "colab_type": "code",
        "outputId": "b8d93be2-b31b-44ed-c244-5bb57a08bb1b",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 178
        }
      },
      "source": [
        "predict(\"yellow submarine\")"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "yellow submarine, R,G,B: 233 205 130\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKIAAACPCAYAAAB5wADzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB7xJREFUeJzt3V2IXGcdx/HvLwlJoU3zspFk2y6N\nwaJEkdQuxRd8wUSoXsRCq1YUE0iJEgRBvQgEetFe2Fp8uaigIUpjAxobkEYasU3S4o1Ju6A1pCXd\npCgmTauNJVhLK9W/F3M2TNaZndk9Z8/8PfP7wDLn5Zl5nsP+ODNnz/7nUURgNmgLBj0AM3AQLQkH\n0VJwEC0FB9FScBAtBQfRUnAQLQUH0VJYNOgBdDOy/MoYu2b5oIdhs/DMcy++EhFvm8tz0wZx7Jrl\nPLbvK4Mehs3C6pvu+vNcn+u3ZkvBQbQUHERLwUG0FBxES8FBtBRKBVHSSkmPS5osHlfM0PZqSWcl\nPVCmT2umsmfEncCRiLgBOFKsd3MP8NuS/VlDlQ3ip4G9xfJe4NZOjSTdBKwGHivZnzVU2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s4sKdY/iBwgtaV2glg26DH3eOYPgU8T+uM\nvavYdjetKkaAK4CHgdPAU8C6QY+5ouP6FnCy+D09Abyr12v6zoqlkOmt2YaYg2gpOIiWgoNoKTiI\nloKDaCk4iJaCg2gp/BfnP6A0MQsNFAAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 144x144 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "CeKXN_Bcwj7s",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "model.save(\"colors.h5\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "oVQB90mJwown",
        "colab_type": "code",
        "outputId": "1420b056-eb23-4f7e-a840-6ebee314a816",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 938
        }
      },
      "source": [
        "\n",
        "!pip install tensorflowjs "
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Collecting tensorflowjs\n",
            "  Downloading https://files.pythonhosted.org/packages/79/29/35e1aa467436ff46b98df65a08c49faaedb3429e1c512d1d90fe308040a0/tensorflowjs-1.0.1-py3-none-any.whl\n",
            "Collecting numpy==1.15.1 (from tensorflowjs)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/fe/94/7049fed8373c52839c8cde619acaf2c9b83082b935e5aa8c0fa27a4a8bcc/numpy-1.15.1-cp36-cp36m-manylinux1_x86_64.whl (13.9MB)\n",
            "\u001b[K    100% |████████████████████████████████| 13.9MB 2.6MB/s \n",
            "\u001b[?25hCollecting tf-nightly-2.0-preview>=2.0.0.dev20190304 (from tensorflowjs)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/a0/e4/f9480931602cf846811e05cb5d9a122273841ea95e314408cfa917b985aa/tf_nightly_2.0_preview-2.0.0.dev20190410-cp36-cp36m-manylinux1_x86_64.whl (95.8MB)\n",
            "\u001b[K    100% |████████████████████████████████| 95.8MB 323kB/s \n",
            "\u001b[?25hCollecting tensorflow-hub==0.3.0 (from tensorflowjs)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/9e/f0/3a3ced04c8359e562f1b91918d9bde797c8a916fcfeddc8dc5d673d1be20/tensorflow_hub-0.3.0-py2.py3-none-any.whl (73kB)\n",
            "\u001b[K    100% |████████████████████████████████| 81kB 17.4MB/s \n",
            "\u001b[?25hRequirement already satisfied: keras==2.2.4 in /usr/local/lib/python3.6/dist-packages (from tensorflowjs) (2.2.4)\n",
            "Requirement already satisfied: h5py==2.8.0 in /usr/local/lib/python3.6/dist-packages (from tensorflowjs) (2.8.0)\n",
            "Requirement already satisfied: six==1.11.0 in /usr/local/lib/python3.6/dist-packages (from tensorflowjs) (1.11.0)\n",
            "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (0.33.1)\n",
            "Collecting tensorflow-estimator-2.0-preview (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/ea/46/8d8ae20e56a8d09da0b408d1930bf5744fca63d1ad717dcda04a832e3d3b/tensorflow_estimator_2.0_preview-1.14.0.dev2019041000-py2.py3-none-any.whl (356kB)\n",
            "\u001b[K    100% |████████████████████████████████| 358kB 19.8MB/s \n",
            "\u001b[?25hRequirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (0.7.1)\n",
            "Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (1.0.7)\n",
            "Collecting google-pasta>=0.1.2 (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/64/bb/f1bbc131d6294baa6085a222d29abadd012696b73dcbf8cf1bf56b9f082a/google_pasta-0.1.5-py3-none-any.whl (51kB)\n",
            "\u001b[K    100% |████████████████████████████████| 61kB 21.9MB/s \n",
            "\u001b[?25hRequirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (1.1.0)\n",
            "Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (0.2.2)\n",
            "Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (1.15.0)\n",
            "Requirement already satisfied: protobuf>=3.6.1 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (3.7.1)\n",
            "Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (0.7.1)\n",
            "Collecting tb-nightly<1.15.0a0,>=1.14.0a0 (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/5d/17/a3d05a0664c11703259aa79d2b58b871b3bb1fff24153f75db04540489db/tb_nightly-1.14.0a20190319-py3-none-any.whl (3.0MB)\n",
            "\u001b[K    100% |████████████████████████████████| 3.0MB 10.5MB/s \n",
            "\u001b[?25hRequirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.6/dist-packages (from tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (1.0.9)\n",
            "Requirement already satisfied: scipy>=0.14 in /usr/local/lib/python3.6/dist-packages (from keras==2.2.4->tensorflowjs) (1.1.0)\n",
            "Requirement already satisfied: pyyaml in /usr/local/lib/python3.6/dist-packages (from keras==2.2.4->tensorflowjs) (3.13)\n",
            "Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from protobuf>=3.6.1->tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (40.9.0)\n",
            "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tb-nightly<1.15.0a0,>=1.14.0a0->tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (3.1)\n",
            "Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.6/dist-packages (from tb-nightly<1.15.0a0,>=1.14.0a0->tf-nightly-2.0-preview>=2.0.0.dev20190304->tensorflowjs) (0.15.2)\n",
            "\u001b[31mfeaturetools 0.4.1 has requirement pandas>=0.23.0, but you'll have pandas 0.22.0 which is incompatible.\u001b[0m\n",
            "\u001b[31mdatascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.\u001b[0m\n",
            "\u001b[31malbumentations 0.1.12 has requirement imgaug<0.2.7,>=0.2.5, but you'll have imgaug 0.2.8 which is incompatible.\u001b[0m\n",
            "Installing collected packages: numpy, tensorflow-estimator-2.0-preview, google-pasta, tb-nightly, tf-nightly-2.0-preview, tensorflow-hub, tensorflowjs\n",
            "  Found existing installation: numpy 1.14.6\n",
            "    Uninstalling numpy-1.14.6:\n",
            "      Successfully uninstalled numpy-1.14.6\n",
            "  Found existing installation: tensorflow-hub 0.4.0\n",
            "    Uninstalling tensorflow-hub-0.4.0:\n",
            "      Successfully uninstalled tensorflow-hub-0.4.0\n",
            "Successfully installed google-pasta-0.1.5 numpy-1.15.1 tb-nightly-1.14.0a20190319 tensorflow-estimator-2.0-preview-1.14.0.dev2019041000 tensorflow-hub-0.3.0 tensorflowjs-1.0.1 tf-nightly-2.0-preview-2.0.0.dev20190410\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.colab-display-data+json": {
              "pip_warning": {
                "packages": [
                  "numpy",
                  "tensorflow",
                  "tensorflow_estimator"
                ]
              }
            }
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ChR4q-2dw_IB",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!mkdir model\n",
        "!tensorflowjs_converter --input_format keras colors.h5 model/"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "58oNmM2QxMEP",
        "colab_type": "code",
        "outputId": "dbede73e-42ee-4b7d-b584-6bf314eb1f86",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 68
        }
      },
      "source": [
        "!zip -r model.zip model"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "  adding: model/ (stored 0%)\n",
            "  adding: model/model.json (deflated 80%)\n",
            "  adding: model/group1-shard1of1.bin (deflated 7%)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "4xNLEnbPxahX",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "from google.colab import files\n",
        "files.download('model.zip')"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "zc0nvCcUxgMk",
        "colab_type": "code",
        "outputId": "d6815eb4-d484-4db7-ea45-fbb1c4530a09",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 119
        }
      },
      "source": [
        "!ls -l"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "total 8136\n",
            "-rw-r--r-- 1 root root  331648 Apr 10 17:23 colors.csv\n",
            "-rw-r--r-- 1 root root 6107176 Apr 10 19:41 colors.h5\n",
            "drwxr-xr-x 2 root root    4096 Apr 10 19:41 model\n",
            "-rw-r--r-- 1 root root 1878641 Apr 10 19:42 model.zip\n",
            "drwxr-xr-x 1 root root    4096 Apr  4 20:20 sample_data\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "2Tt7INiAxqg7",
        "colab_type": "code",
        "outputId": "d3decf04-b1a3-4004-e5b3-f0c5165992ce",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "cd model"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/content/model\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "EyiwV847xt7S",
        "colab_type": "code",
        "outputId": "b880d9b2-8e4f-47b3-8d7d-0d61baafed9b",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 68
        }
      },
      "source": [
        "!ls -l"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "total 1984\n",
            "-rw-r--r-- 1 root root 2023436 Apr 10 19:41 group1-shard1of1.bin\n",
            "-rw-r--r-- 1 root root    4085 Apr 10 19:41 model.json\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "-r4aEq2NxwrN",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}