adding a dense layer, still not much convergence
[notebooks.git] / Functional_RNN.ipynb
blobf771af55ff8abff4f374cd66a5fa02f925f200d7
2   "nbformat": 4,
3   "nbformat_minor": 0,
4   "metadata": {
5     "colab": {
6       "name": "Functional RNN.ipynb",
7       "provenance": [],
8       "collapsed_sections": []
9     },
10     "kernelspec": {
11       "name": "python3",
12       "display_name": "Python 3"
13     },
14     "language_info": {
15       "name": "python"
16     }
17   },
18   "cells": [
19     {
20       "cell_type": "code",
21       "source": [
22         "import tensorflow as tf\n",
23         "tf.__version__"
24       ],
25       "metadata": {
26         "colab": {
27           "base_uri": "https://localhost:8080/",
28           "height": 37
29         },
30         "id": "IzBT2yHt1NjL",
31         "outputId": "d587af73-00d3-44a1-a970-200c2006c615"
32       },
33       "execution_count": null,
34       "outputs": [
35         {
36           "output_type": "execute_result",
37           "data": {
38             "text/plain": [
39               "'2.8.2'"
40             ],
41             "application/vnd.google.colaboratory.intrinsic+json": {
42               "type": "string"
43             }
44           },
45           "metadata": {},
46           "execution_count": 17
47         }
48       ]
49     },
50     {
51       "cell_type": "code",
52       "execution_count": null,
53       "metadata": {
54         "colab": {
55           "base_uri": "https://localhost:8080/",
56           "height": 466
57         },
58         "id": "IUzn0o5VvjWg",
59         "outputId": "943ecd0d-d337-41b8-dbe3-77e9baef34aa"
60       },
61       "outputs": [
62         {
63           "output_type": "execute_result",
64           "data": {
65             "text/plain": [
66               "<IPython.core.display.Image object>"
67             ],
68             "image/png": "iVBORw0KGgoAAAANSUhEUgAAANEAAAHBCAIAAAB4+cmXAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3deVhTV/oH8HMTQpIbkqASNgNIQI2oWDdqEauto5Xa0rJHRcSOfVDbWscFrFjLY+sKFjsM6IPj9OnUKQSBQWCm6owI3bDj04IiFEEtCCKGYiRCkCXc3x93Jk9+iJCNE4Lv5y/vPZdz3xy+3i3hhKAoCgGAEcPSBYBnDmQO4AaZA7hB5gBuNroLZWVln376qaVKAWPVCy+8sG3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Xs2bMVCoX+3Rqts7OToiiBQIBG2UCZAkfmmpqaEEIikWjQ1s7OToTQnj17tA+oGhoatNfvT8PlcouLiwMCAvbv3y+RSGQyWVdXl3FdaWVlZR06dKikpGTQSTNZLJZIJFq+fHlWVlZVVdWBAwf07NYUtbW1CCGpVIpG00CZCEfm6Ju+7u7uQVvpLKakpOgefsvKyobtdvr06YWFhc3NzfHx8XK5PDk52eiuEEKpqamnT58uLi52dXUdektvb28mk1lVVaVPtyY6d+4cQoieoWKUDJTpcGRuxowZDAajtLR00FY3NzcOh2PoexLNzc3V1dUIIZFIdPDgwTlz5lRXVxvXFUVR8fHxlZWV+fn5dnZ2A1rb2tpWr16tu6aurk6j0dDTR4yolpaWlJQUsVj81ltvoVEwUOaCI3MikSg0NDQnJ+fUqVMqleratWsZGRnaVg6Hs379+szMzPT0dJVKpdFompqa7t27N3Sfzc3NGzdurKmp6enpKS8vb2hoWLBggXFdVVdXHzly5OTJkywWS/c9qOTkZIQQj8e7cOFCcXGxSqXq7e0tLy9ft24dj8fbtm2b6SOji6Kojo6O/v5+iqJaW1vlcvnChQuZTGZ+fj59PWfxgTIbE+9BKP3uZR49erRhw4YJEybY2dkFBATs3bsXISQWi69evUpRVHd3d3x8vLu7u42NDR3QqqqqtLQ0kiQRQpMnT75161ZGRgY99B4eHrW1tfX19f7+/uPGjWMyma6urgkJCfQbCYN2NXRtlZWVg45MUlISvUFQUJCnp6ednR2bzfby8pLJZJWVlfqMjD73rQUFBb6+viRJ2tra0jN40jeqfn5++/bta2tr093YsgNFWdGzkmfWmJyvxDqelQCga+xnrqamhng6mUxm6QKfOWN/ohepVErBJHmjydg/zoHRBjIHcIPMAdwgcwA3yBzADTIHcIPMAdwgcwA3yBzADTIHcIPMAdwgcwA3yBzADTIHcDPPZ5mw/cmQdaGH5Rn8ftthmOXzyuDZYfpn0wkIDcAMrucAbpA5gBtkDuAGmQO4/R/q6MPXKBGydAAAAABJRU5ErkJggg==\n"
69           },
70           "metadata": {},
71           "execution_count": 38
72         }
73       ],
74       "source": [
75         "inputs = tf.keras.Input(shape=(3,5,))\n",
76         "t1 = tf.keras.layers.LSTM(4)(inputs) # input shape shape [batch, timesteps, feature]\n",
77         "t2 = tf.keras.layers.Dense(4)(t1)\n",
78         "x = tf.keras.layers.Dense(4, activation=tf.nn.relu)(t2)\n",
79         "outputs = tf.keras.layers.Dense(5, activation=tf.nn.softmax)(x)\n",
80         "model = tf.keras.Model(inputs=inputs, outputs=outputs)\n",
81         "tf.keras.utils.plot_model(model)"
82       ]
83     },
84     {
85       "cell_type": "code",
86       "source": [
87         "model.summary(\n",
88         "    line_length=None,\n",
89         "    positions=None,\n",
90         "    print_fn=None,\n",
91         "    expand_nested=False,\n",
92         "    show_trainable=False,\n",
93         ")\n"
94       ],
95       "metadata": {
96         "colab": {
97           "base_uri": "https://localhost:8080/"
98         },
99         "id": "m_HWHhzoy2kO",
100         "outputId": "8bb5309e-ec1b-4d1b-adf3-1fd0d8e06961"
101       },
102       "execution_count": null,
103       "outputs": [
104         {
105           "output_type": "stream",
106           "name": "stdout",
107           "text": [
108             "Model: \"model\"\n",
109             "_________________________________________________________________\n",
110             " Layer (type)                Output Shape              Param #   \n",
111             "=================================================================\n",
112             " input_5 (InputLayer)        [(None, 3)]               0         \n",
113             "                                                                 \n",
114             " dense (Dense)               (None, 4)                 16        \n",
115             "                                                                 \n",
116             " dense_1 (Dense)             (None, 5)                 25        \n",
117             "                                                                 \n",
118             "=================================================================\n",
119             "Total params: 41\n",
120             "Trainable params: 41\n",
121             "Non-trainable params: 0\n",
122             "_________________________________________________________________\n"
123           ]
124         }
125       ]
126     },
127     {
128       "cell_type": "code",
129       "source": [
130         "model.plot_model()"
131       ],
132       "metadata": {
133         "colab": {
134           "base_uri": "https://localhost:8080/",
135           "height": 164
136         },
137         "id": "mddJmC7KzEYD",
138         "outputId": "d2a50371-a703-44ae-854b-1a0092860ef7"
139       },
140       "execution_count": null,
141       "outputs": [
142         {
143           "output_type": "error",
144           "ename": "AttributeError",
145           "evalue": "ignored",
146           "traceback": [
147             "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
148             "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
149             "\u001b[0;32m<ipython-input-15-691d3246f92a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
150             "\u001b[0;31mAttributeError\u001b[0m: 'Functional' object has no attribute 'plot_model'"
151           ]
152         }
153       ]
154     }
155   ]