{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "keras_save_load_model.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/gmihaila/machine_learning_toolbox/blob/master/keras_save_load_model.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "metadata": {
        "id": "6jmtlk4UhR2A",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## Save Load model in keras"
      ]
    },
    {
      "metadata": {
        "id": "vSKuhkhohQ_V",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 53
        },
        "outputId": "539c2842-f33b-4fdf-ced5-90f1e7ff88bb"
      },
      "cell_type": "code",
      "source": [
        "from IPython.display import clear_output\n",
        "\n",
        "print(\"Install pydot\")\n",
        "!apt-get -qq install -y graphviz && pip install -q pydot\n",
        "clear_output()\n",
        "\n",
        "print(\"Downloading data...\")\n",
        "!wget https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv\n",
        "clear_output()\n",
        "\n",
        "!ls"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "model.json  model_weights.h5  pima-indians-diabetes.data.csv\tsample_data\n",
            "model.png   model.yaml\t      pima-indians-diabetes.data.csv.1\twhole_model.h5\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "cVCl1YndhcsL",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 35
        },
        "outputId": "22b17207-cbe3-48f9-93e4-fb59bf515d57"
      },
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import pandas as pd\n",
        "\n",
        "from keras.layers import Input, Dense\n",
        "from keras.models import Model, load_model\n",
        "from keras.utils.vis_utils import plot_model\n",
        "\n",
        "from IPython.display import Image"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Using TensorFlow backend.\n"
          ],
          "name": "stderr"
        }
      ]
    },
    {
      "metadata": {
        "id": "EqrPFc2Rheah",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 53
        },
        "outputId": "2f2aa79d-21db-49e0-f5cc-3c32e9ab439e"
      },
      "cell_type": "code",
      "source": [
        "# Parse data\n",
        "path_file = 'pima-indians-diabetes.data.csv'\n",
        "\n",
        "df = pd.read_csv(path_file, header=None)\n",
        "data = np.array(df.values, dtype=float)\n",
        "\n",
        "x = data[:,:8]  # fist 8 columns\n",
        "y = data[:,8]   # last column\n",
        "\n",
        "print('x shape: ',x.shape)\n",
        "print('y shape: ',y.shape)"
      ],
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "x shape:  (768, 8)\n",
            "y shape:  (768,)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "2cy-qKHjhf8R",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "# build model\n",
        "\n",
        "n_input = 8  # number of inputs\n",
        "n_output = 1 # number of outputs\n",
        "\n",
        "# build each layer\n",
        "model_input = Input(shape=(n_input,), name='INPUT')\n",
        "model_layer1 = Dense(units=8, activation='relu', name='DENSE1')(model_input)\n",
        "model_output = Dense(units=1, activation='sigmoid', name='OUTPUT')(model_layer1)\n",
        "# assemble model\n",
        "model = Model([model_input], model_output)\n",
        "# compile model\n",
        "model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "AsNrhIHdhiAq",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 312
        },
        "outputId": "449a81f1-fdfc-4c08-b079-a2f731f13bb6"
      },
      "cell_type": "code",
      "source": [
        "# image model\n",
        "plot_model(model, to_file='model.png', show_shapes=True, show_layer_names=True)\n",
        "Image('model.png')"
      ],
      "execution_count": 5,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWUAAAEnCAYAAABxFVLcAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nOzde1RTZ7o/8O8OJIRAwkUFAQUJaL1Wx0qrqLXqjC6loAgoI7ZH7c+ivSDeinhBS9FqcaHF\n6mm9jJ2jrUXEorXa8eiUOrbqao9SFaeWIioUEVDuF0F4fn84SY0JkJBAgj6ftfKH7373fp+8OzzE\nzbufLRARgTHGmEUQmTsAxhhjf+CkzBhjFoSTMmOMWRBOyowxZkGsH284e/YskpKSzBELY4w9VUaM\nGIHFixdrtGl9U87Ly8PBgwc7LCjGTOHgwYPIz883dxidyrlz53Du3Dlzh/HUOnfuHM6ePavVrvVN\nWSU1NbVdA2LMlARBwKJFizB9+nRzh9JphIWFAeCfdXNRzf/j+JoyY4xZEE7KjDFmQTgpM8aYBeGk\nzBhjFoSTMmOMWRBOyow94tixY3BwcMBXX31l7lAs3smTJxEbG4u0tDQolUoIggBBEPDKK69o9Z0w\nYQLkcjmsrKwwYMAAXLhwwQwRG+bzzz+Hn58f5HI5vLy8MGfOHBQWFqq3HzlyBBs3bkRjY6NJx+Wk\nzNgjuGiiftasWYPk5GSsWLECISEhuH79Onx8fNClSxfs27cPX3/9tUb/EydOIDU1FYGBgcjKysLQ\noUPNFLl+UlJSEBERgbCwMOTn5+Pw4cM4ffo0Jk2ahAcPHgAAgoKCIJVKMX78eJSVlZlsbE7KjD0i\nICAA5eXlCAwMNHcoqK2thb+/v7nD0LJhwwZ88cUXOHDgAORyuca25ORkiEQiREZGory83EwRGu+T\nTz6Bu7s7li1bBgcHBwwZMgSLFy9GZmYmzp8/r+63cOF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CQCaTSVzaNjU1Renp6RQREUGlpaW0srJCFouF\n9Ho9paWlkSAIFBsbSxUVFfT161fFYkgp3/o3cr+fVquV9Ho97ezsiMdGR0fJaDQSALp06RLV1dX9\n8drm5uYTS+KkzIHUErFEZ5eBraysJADU3t5+6uecmJigW7duUWpqqliqNyUlhUpKSujDhw8n2t+9\ne5fS0tLI7XZLu5G/+JMfOSmzgBao9ZQtFgslJiZqPYy/kvv9nJ+fJ0EQaHh4WMVRqefo6IjKyspo\ncHBQsT5XV1fJYDBQf3+/7Gv9yY/8+oIxH2lVRUwNJpMJNpsNNpsN29vbWg9HlqOjI4yNjcHlcol7\nQyqho6MD169fh9VqVaxPKTgpM8YAAC0tLbh//z6qq6svVNEhu92O169fY3x8XPJa67MMDAzg06dP\nePfu3bnvSs9JmTGZWltbMTQ0hK2tLWRkZGBkZETrISmmu7sbVqsVvb29Wg9Fsjt37uDly5deNUb8\n8ebNG+zv78NutyMhIUGRPuUQzj0iYxdcT08Penp6tB6GasrLy1FeXq71MDRjNpthNps1i89Pyowx\nFkA4KTPGWADhpMwYYwGEkzJjjAUQTsqMMRZAdL9+fSL/Qp1O6bEwxljQePXqFR48eCD7Op+XxKm9\nPxZjjF1kvu5O7vOTMmOMMeXxO2XGGAsgnJQZYyyAcFJmjLEAIgD4R+tBMMYY+8+/eJ5SBbW4tTAA\nAAAASUVORK5CYII=\n",
            "text/plain": [
              "<IPython.core.display.Image object>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 5
        }
      ]
    },
    {
      "metadata": {
        "id": "GezHsJ2lhk6x",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 395
        },
        "outputId": "9fdd9f6f-b427-45b9-b524-b88f864f68b6"
      },
      "cell_type": "code",
      "source": [
        "# fit model\n",
        "model.fit(x, y, epochs=10, batch_size=10)"
      ],
      "execution_count": 6,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Epoch 1/10\n",
            "768/768 [==============================] - 0s 295us/step - loss: 6.0555 - acc: 0.5768\n",
            "Epoch 2/10\n",
            "768/768 [==============================] - 0s 97us/step - loss: 5.8343 - acc: 0.5990\n",
            "Epoch 3/10\n",
            "768/768 [==============================] - 0s 95us/step - loss: 5.7260 - acc: 0.6237\n",
            "Epoch 4/10\n",
            "768/768 [==============================] - 0s 93us/step - loss: 5.7296 - acc: 0.6250\n",
            "Epoch 5/10\n",
            "768/768 [==============================] - 0s 100us/step - loss: 5.6708 - acc: 0.6302\n",
            "Epoch 6/10\n",
            "768/768 [==============================] - 0s 100us/step - loss: 5.6364 - acc: 0.6224\n",
            "Epoch 7/10\n",
            "768/768 [==============================] - 0s 94us/step - loss: 5.6071 - acc: 0.6237\n",
            "Epoch 8/10\n",
            "768/768 [==============================] - 0s 99us/step - loss: 5.4702 - acc: 0.6341\n",
            "Epoch 9/10\n",
            "768/768 [==============================] - 0s 90us/step - loss: 5.4395 - acc: 0.6354\n",
            "Epoch 10/10\n",
            "768/768 [==============================] - 0s 98us/step - loss: 5.4271 - acc: 0.6250\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<keras.callbacks.History at 0x7f487eaccb70>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 6
        }
      ]
    },
    {
      "metadata": {
        "id": "NFbn7tjFhmt5",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 71
        },
        "outputId": "c195367a-9ccb-4442-9123-09d7ab511c68"
      },
      "cell_type": "code",
      "source": [
        "# evaluate the model\n",
        "scores = model.evaluate(x, y)\n",
        "print(\"\\n%s: %.2f%%\" % (model.metrics_names[1], scores[1]*100))"
      ],
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "768/768 [==============================] - 0s 51us/step\n",
            "\n",
            "acc: 62.37%\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "w6uyjucJiEzN",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## Save - Load whole model (weights+architecture)"
      ]
    },
    {
      "metadata": {
        "id": "usTuRCIohu5g",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 323
        },
        "outputId": "d9e6df06-00a9-433a-d1ed-dd291be53922"
      },
      "cell_type": "code",
      "source": [
        "model.save(\"whole_model.h5\")\n",
        "\n",
        "model_1 = load_model(\"whole_model.h5\")\n",
        "\n",
        "print(model_1.summary())\n",
        "\n",
        "# evaluate the model\n",
        "scores = model_1.evaluate(x, y)\n",
        "print(\"\\n%s: %.2f%%\" % (model_1.metrics_names[1], scores[1]*100))"
      ],
      "execution_count": 8,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "_________________________________________________________________\n",
            "Layer (type)                 Output Shape              Param #   \n",
            "=================================================================\n",
            "INPUT (InputLayer)           (None, 8)                 0         \n",
            "_________________________________________________________________\n",
            "DENSE1 (Dense)               (None, 8)                 72        \n",
            "_________________________________________________________________\n",
            "OUTPUT (Dense)               (None, 1)                 9         \n",
            "=================================================================\n",
            "Total params: 81\n",
            "Trainable params: 81\n",
            "Non-trainable params: 0\n",
            "_________________________________________________________________\n",
            "None\n",
            "768/768 [==============================] - 0s 66us/step\n",
            "\n",
            "acc: 62.37%\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "ubJk3-PwiQ0Y",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## Save - Load weights and architecture [JSON format]"
      ]
    },
    {
      "metadata": {
        "id": "BdeLEOTiiDft",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "from keras.models import model_from_json\n",
        "\n",
        "# serialize model to JSON\n",
        "model_json = model.to_json()\n",
        "with open(\"model.json\", \"w\") as json_file:\n",
        "    json_file.write(model_json)\n",
        "\n",
        "model.save_weights(\"model_weights.h5\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "RdvKeEliiuVl",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 323
        },
        "outputId": "1ad319f4-c648-41a7-89fd-5bc00b6aefec"
      },
      "cell_type": "code",
      "source": [
        "with open(\"model.json\", \"r\") as json_file:\n",
        "    loaded_model_json = json_file.read()\n",
        "    \n",
        "model_2 = model_from_json(loaded_model_json)\n",
        "\n",
        "# compile model\n",
        "model_2.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])\n",
        "\n",
        "# load weights into new model\n",
        "model_2.load_weights(\"model_weights.h5\")\n",
        "\n",
        "\n",
        "\n",
        "print(model_2.summary())\n",
        "\n",
        "# evaluate the model\n",
        "scores = model_2.evaluate(x, y)\n",
        "print(\"\\n%s: %.2f%%\" % (model_2.metrics_names[1], scores[1]*100))"
      ],
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "_________________________________________________________________\n",
            "Layer (type)                 Output Shape              Param #   \n",
            "=================================================================\n",
            "INPUT (InputLayer)           (None, 8)                 0         \n",
            "_________________________________________________________________\n",
            "DENSE1 (Dense)               (None, 8)                 72        \n",
            "_________________________________________________________________\n",
            "OUTPUT (Dense)               (None, 1)                 9         \n",
            "=================================================================\n",
            "Total params: 81\n",
            "Trainable params: 81\n",
            "Non-trainable params: 0\n",
            "_________________________________________________________________\n",
            "None\n",
            "768/768 [==============================] - 0s 70us/step\n",
            "\n",
            "acc: 62.37%\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "m51EU-kxJNVK",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## Save - Load weights and architecture [YAML format]"
      ]
    },
    {
      "metadata": {
        "id": "v6K6YsraJQwj",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "from keras.models import model_from_yaml\n",
        "\n",
        "# serialize model to YAML\n",
        "model_yaml = model.to_yaml()\n",
        "\n",
        "with open(\"model.yaml\", \"w\") as yaml_file:\n",
        "    yaml_file.write(model_yaml)\n",
        "    \n",
        "# serialize weights to HDF5\n",
        "model.save_weights(\"model_weights.h5\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "PWZx55j7JS8L",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 323
        },
        "outputId": "4fe9725f-1cc2-4692-b187-b47a3a92158d"
      },
      "cell_type": "code",
      "source": [
        "# load YAML and create model\n",
        "yaml_file = open('model.yaml', 'r')\n",
        "\n",
        "with open(\"model.yaml\", \"r\") as yaml_file:\n",
        "    loaded_model_yaml = yaml_file.read()\n",
        "\n",
        "model_3 = model_from_yaml(loaded_model_yaml)\n",
        "\n",
        "# compile model\n",
        "model_3.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])\n",
        "\n",
        "# load weights into new model\n",
        "model_3.load_weights(\"model_weights.h5\")\n",
        "\n",
        "print(model_3.summary())\n",
        "\n",
        "# evaluate the model\n",
        "scores = model_3.evaluate(x, y)\n",
        "print(\"\\n%s: %.2f%%\" % (model_3.metrics_names[1], scores[1]*100))"
      ],
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "_________________________________________________________________\n",
            "Layer (type)                 Output Shape              Param #   \n",
            "=================================================================\n",
            "INPUT (InputLayer)           (None, 8)                 0         \n",
            "_________________________________________________________________\n",
            "DENSE1 (Dense)               (None, 8)                 72        \n",
            "_________________________________________________________________\n",
            "OUTPUT (Dense)               (None, 1)                 9         \n",
            "=================================================================\n",
            "Total params: 81\n",
            "Trainable params: 81\n",
            "Non-trainable params: 0\n",
            "_________________________________________________________________\n",
            "None\n",
            "768/768 [==============================] - 0s 75us/step\n",
            "\n",
            "acc: 62.37%\n"
          ],
          "name": "stdout"
        }
      ]
    }
  ]
}