├── .dockerignore
├── SAGunicorn.py
├── SAWaitress.py
├── README.md
├── Dockerfile
├── qaapp.py
├── SAFlask.py
├── SAFlaskFinal.py
├── Running_Flask_in_Colab.ipynb
├── Image_Classification_Web_App.ipynb
└── Deploying_Tensorflow_Model_Part_1.ipynb
/.dockerignore:
--------------------------------------------------------------------------------
1 | Dockerfile
2 | README.md
3 | *.pyc
4 | *.pyo
5 | *.pyd
6 | __pycache__
--------------------------------------------------------------------------------
/SAGunicorn.py:
--------------------------------------------------------------------------------
1 | #The details of this code can be found in my video here - #https://www.youtube.com/watch?v=hIq4bVT2ghk
2 |
3 | from SAFlask import app
4 |
5 | if __name__ == "__main__":
6 | app.run()
--------------------------------------------------------------------------------
/SAWaitress.py:
--------------------------------------------------------------------------------
1 | #The details of this code can be found in my video here - #https://www.youtube.com/watch?v=hIq4bVT2ghk
2 |
3 | from waitress import serve
4 | import SAFlaskFinal
5 |
6 | serve(SAFlaskFinal.app, port=8000, threads=6)
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # model-deployment
2 | This playlist covers model deployment covered as part of course in YouTube - https://www.youtube.com/playlist?list=PL3N9eeOlCrP5PlN1jwOB3jVZE6nYTVswk
3 |
4 | If you are specifically looking for model deployment on Google Cloud Platform you can check - https://www.youtube.com/playlist?list=PL3N9eeOlCrP4VXtFJTjmGsqI-Emk2keVL
5 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # lightweight python
2 | FROM python:3.7-slim
3 |
4 | # Copy local code to the container image.
5 | ENV APP_HOME /app
6 | WORKDIR $APP_HOME
7 | COPY . ./
8 |
9 | # Install dependencies
10 | RUN pip install tensorflow==2.1.0 tensorflow-datasets Flask gunicorn
11 |
12 | # Run the flask service on container startup
13 | CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 SAGunicorns
--------------------------------------------------------------------------------
/qaapp.py:
--------------------------------------------------------------------------------
1 | #cdqa_pipeline.to('cpu')
2 | #joblib.dump(cdqa_pipeline, './models/bert_qa_custom.joblib')
3 |
4 | #streamlit run --server.enableCORS false qaapp.py
5 |
6 | import joblib
7 | import requests
8 | import streamlit as st
9 |
10 | st.set_option('deprecation.showfileUploaderEncoding', False)
11 | st.title("Question Answering Webapp")
12 | st.text("What would you like to know about Amazon today?")
13 |
14 | @st.cache(allow_output_mutation=True)
15 | def load_model():
16 | model=joblib.load('bert_qa_custom.joblib')
17 | return model
18 |
19 | with st.spinner('Loading Model Into Memory....'):
20 | model = load_model()
21 |
22 | text = st.text_input('Enter your questions here..')
23 | if text:
24 | st.write("Response :")
25 | with st.spinner('Searching for answers.....'):
26 | prediction = model.predict(text)
27 | st.write('answer: {}'.format(prediction[0]))
28 | st.write('title: {}'.format(prediction[1]))
29 | st.write('paragraph: {}'.format(prediction[2]))
30 | st.write("")
--------------------------------------------------------------------------------
/SAFlask.py:
--------------------------------------------------------------------------------
1 |
2 | #The details of this code can be found in my video here - #https://www.youtube.com/watch?v=hIq4bVT2ghk
3 | import tensorflow_datasets as tfds
4 | import tensorflow as tf
5 | from flask import Flask, jsonify, make_response, request
6 |
7 | app = Flask(__name__)
8 | padding_size = 1000
9 | model = tf.keras.models.load_model('sentiment_analysis.hdf5')
10 | text_encoder = tfds.features.text.TokenTextEncoder.load_from_file("sa_encoder.vocab")
11 |
12 | print('Model and Vocabalory loaded.......')
13 |
14 |
15 | def pad_to_size(vec, size):
16 | zeros = [0] * (size - len(vec))
17 | vec.extend(zeros)
18 | return vec
19 |
20 |
21 | def predict_fn(predict_text, pad_size):
22 | encoded_text = text_encoder.encode(predict_text)
23 | encoded_text = pad_to_size(encoded_text, pad_size)
24 | encoded_text = tf.cast(encoded_text, tf.int64)
25 | predictions = model.predict(tf.expand_dims(encoded_text, 0))
26 |
27 | return (predictions.tolist())
28 |
29 |
30 | @app.route('/seclassifier', methods=['POST'])
31 | def predict_sentiment():
32 | text = request.get_json()['text']
33 | print(text)
34 | predictions = predict_fn(text, padding_size)
35 | sentiment = 'positive' if float(''.join(map(str,predictions[0]))) > 0 else 'Negative'
36 | return jsonify({'predictions ':predictions, 'sentiment ': sentiment})
37 |
38 |
39 | if __name__ == "__main__":
40 | app.run(host='0.0.0.0', port='5000')
41 |
--------------------------------------------------------------------------------
/SAFlaskFinal.py:
--------------------------------------------------------------------------------
1 | #The details of this code can be found in my video here - #https://www.youtube.com/watch?v=hIq4bVT2ghk
2 |
3 | import tensorflow_datasets as tfds
4 | import tensorflow as tf
5 | from flask import Flask, jsonify, make_response, request
6 | from healthcheck import HealthCheck
7 |
8 | import logging
9 |
10 | app = Flask(__name__)
11 | padding_size = 1000
12 | model = tf.keras.models.load_model('sentiment_analysis.hdf5')
13 | text_encoder = tfds.features.text.TokenTextEncoder.load_from_file("sa_encoder.vocab")
14 |
15 | logging.basicConfig(filename="flask.log", level=logging.DEBUG,
16 | format='%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s')
17 | logging.info('Model and Vocabalory loaded.......')
18 |
19 | health = HealthCheck(app, "/hcheck")
20 |
21 |
22 | def howami():
23 | return True, "I am Good"
24 |
25 |
26 | health.add_check(howami)
27 |
28 |
29 | def pad_to_size(vec, size):
30 | zeros = [0] * (size - len(vec))
31 | vec.extend(zeros)
32 | return vec
33 |
34 |
35 | def predict_fn(predict_text, pad_size):
36 | encoded_text = text_encoder.encode(predict_text)
37 | encoded_text = pad_to_size(encoded_text, pad_size)
38 | encoded_text = tf.cast(encoded_text, tf.int64)
39 | predictions = model.predict(tf.expand_dims(encoded_text, 0))
40 |
41 | return (predictions.tolist())
42 |
43 |
44 | @app.route('/seclassifier', methods=['POST'])
45 | def predict_sentiment():
46 | text = request.get_json()['text']
47 | print(text)
48 | predictions = predict_fn(text, padding_size)
49 | sentiment = 'positive' if float(''.join(map(str, predictions[0]))) > 0 else 'Negative'
50 | app.logger.info("Prediction :" + str(predictions[0]) + "sentiment :" + sentiment)
51 | return jsonify({'predictions ': predictions, 'sentiment ': sentiment})
52 |
53 |
54 | if __name__ == "__main__":
55 | app.run(host='0.0.0.0', port='5000')
56 |
--------------------------------------------------------------------------------
/Running_Flask_in_Colab.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "name": "Running Flask in Colab.ipynb",
7 | "provenance": [],
8 | "collapsed_sections": [],
9 | "authorship_tag": "ABX9TyMGGZL5R0nae2QlpU2LjWwD",
10 | "include_colab_link": true
11 | },
12 | "kernelspec": {
13 | "name": "python3",
14 | "display_name": "Python 3"
15 | }
16 | },
17 | "cells": [
18 | {
19 | "cell_type": "markdown",
20 | "metadata": {
21 | "id": "view-in-github",
22 | "colab_type": "text"
23 | },
24 | "source": [
25 | "
"
26 | ]
27 | },
28 | {
29 | "cell_type": "code",
30 | "metadata": {
31 | "id": "p-MlOTXR-hv4",
32 | "colab_type": "code",
33 | "colab": {
34 | "base_uri": "https://localhost:8080/",
35 | "height": 128
36 | },
37 | "outputId": "12d04138-e270-4999-d389-904247835ffa"
38 | },
39 | "source": [
40 | "from google.colab import drive\n",
41 | "drive.mount('/content/drive')"
42 | ],
43 | "execution_count": null,
44 | "outputs": [
45 | {
46 | "output_type": "stream",
47 | "text": [
48 | "Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly\n",
49 | "\n",
50 | "Enter your authorization code:\n",
51 | "··········\n",
52 | "Mounted at /content/drive\n"
53 | ],
54 | "name": "stdout"
55 | }
56 | ]
57 | },
58 | {
59 | "cell_type": "code",
60 | "metadata": {
61 | "id": "jGokItTB-jhh",
62 | "colab_type": "code",
63 | "colab": {
64 | "base_uri": "https://localhost:8080/",
65 | "height": 90
66 | },
67 | "outputId": "00804d4a-3375-4b9a-cb26-bf3d436f4f79"
68 | },
69 | "source": [
70 | "!ls '/content/drive/My Drive/Colab Notebooks/models/'"
71 | ],
72 | "execution_count": null,
73 | "outputs": [
74 | {
75 | "output_type": "stream",
76 | "text": [
77 | "fashion.hdf5\t\t sa_encoder.vocab.tokens1\n",
78 | "fashion_tpu.hdf5\t sentiment_analysis.hdf5\n",
79 | "final_sentiment_analysis.hdf5 sentiment_analysis.hdf51\n",
80 | "sa_encoder.vocab.tokens\n"
81 | ],
82 | "name": "stdout"
83 | }
84 | ]
85 | },
86 | {
87 | "cell_type": "code",
88 | "metadata": {
89 | "id": "xk6pqXHXpChi",
90 | "colab_type": "code",
91 | "colab": {
92 | "base_uri": "https://localhost:8080/",
93 | "height": 35
94 | },
95 | "outputId": "d3fced59-250a-4a53-db4d-b669783a9cc4"
96 | },
97 | "source": [
98 | "import socket\n",
99 | "print(socket.gethostbyname(socket.gethostname()))"
100 | ],
101 | "execution_count": null,
102 | "outputs": [
103 | {
104 | "output_type": "stream",
105 | "text": [
106 | "172.28.0.2\n"
107 | ],
108 | "name": "stdout"
109 | }
110 | ]
111 | },
112 | {
113 | "cell_type": "code",
114 | "metadata": {
115 | "id": "5DUmBgC4tLgD",
116 | "colab_type": "code",
117 | "colab": {
118 | "base_uri": "https://localhost:8080/",
119 | "height": 145
120 | },
121 | "outputId": "c8b500f5-1a2c-4605-f191-87fc08cf2645"
122 | },
123 | "source": [
124 | "import tensorflow_datasets as tfds\n",
125 | "import tensorflow as tf\n",
126 | "from flask import Flask, jsonify, make_response, request\n",
127 | "import threading\n",
128 | "\n",
129 | "app = Flask(__name__)\n",
130 | "padding_size = 1000\n",
131 | "model = tf.keras.models.load_model('/content/drive/My Drive/Colab Notebooks/models/sentiment_analysis.hdf5')\n",
132 | "text_encoder = tfds.features.text.TokenTextEncoder.load_from_file(\"/content/drive/My Drive/Colab Notebooks/models/sa_encoder.vocab\")\n",
133 | "\n",
134 | "print('Model and Vocabalory loaded.......')\n",
135 | "\n",
136 | "@app.route(\"/\")\n",
137 | "def hello():\n",
138 | " return \"I am alive!\"\n",
139 | "\n",
140 | "def pad_to_size(vec, size):\n",
141 | " zeros = [0] * (size - len(vec))\n",
142 | " vec.extend(zeros)\n",
143 | " return vec\n",
144 | "\n",
145 | "\n",
146 | "def predict_fn(predict_text, pad_size):\n",
147 | " encoded_text = text_encoder.encode(predict_text)\n",
148 | " encoded_text = pad_to_size(encoded_text, pad_size)\n",
149 | " encoded_text = tf.cast(encoded_text, tf.int64)\n",
150 | " predictions = model.predict(tf.expand_dims(encoded_text, 0))\n",
151 | "\n",
152 | " return (predictions.tolist())\n",
153 | "\n",
154 | "\n",
155 | "@app.route('/seclassifier', methods=['POST'])\n",
156 | "def predict_sentiment():\n",
157 | " text = request.get_json()['text']\n",
158 | " print(text)\n",
159 | " predictions = predict_fn(text, padding_size)\n",
160 | " sentiment = 'positive' if float(''.join(map(str,predictions[0]))) > 0 else 'Negative'\n",
161 | " return jsonify({'predictions ':predictions, 'sentiment ': sentiment})\n",
162 | "\n",
163 | "\n",
164 | "threading.Thread(target=app.run, kwargs={'host':'0.0.0.0','port':6000}).start() "
165 | ],
166 | "execution_count": null,
167 | "outputs": [
168 | {
169 | "output_type": "stream",
170 | "text": [
171 | "Model and Vocabalory loaded.......\n",
172 | " * Serving Flask app \"__main__\" (lazy loading)\n",
173 | " * Environment: production\n",
174 | "\u001b[31m WARNING: This is a development server. Do not use it in a production deployment.\u001b[0m\n",
175 | "\u001b[2m Use a production WSGI server instead.\u001b[0m\n",
176 | " * Debug mode: off\n"
177 | ],
178 | "name": "stdout"
179 | },
180 | {
181 | "output_type": "stream",
182 | "text": [
183 | " * Running on http://0.0.0.0:6000/ (Press CTRL+C to quit)\n"
184 | ],
185 | "name": "stderr"
186 | }
187 | ]
188 | },
189 | {
190 | "cell_type": "code",
191 | "metadata": {
192 | "id": "XDrmi6eQuHDQ",
193 | "colab_type": "code",
194 | "colab": {
195 | "base_uri": "https://localhost:8080/",
196 | "height": 72
197 | },
198 | "outputId": "cceb2a11-a60c-45df-867c-cb0b272d4a88"
199 | },
200 | "source": [
201 | "import requests\n",
202 | "req = requests.get(\"http://172.28.0.2:6000/\")\n",
203 | "print(req.status_code)\n",
204 | "print(req.text)"
205 | ],
206 | "execution_count": null,
207 | "outputs": [
208 | {
209 | "output_type": "stream",
210 | "text": [
211 | "172.28.0.2 - - [05/Jun/2020 14:25:01] \"\u001b[37mGET / HTTP/1.1\u001b[0m\" 200 -\n"
212 | ],
213 | "name": "stderr"
214 | },
215 | {
216 | "output_type": "stream",
217 | "text": [
218 | "200\n",
219 | "I am alive!\n"
220 | ],
221 | "name": "stdout"
222 | }
223 | ]
224 | },
225 | {
226 | "cell_type": "code",
227 | "metadata": {
228 | "id": "w0Vbn3kFz3V2",
229 | "colab_type": "code",
230 | "colab": {
231 | "base_uri": "https://localhost:8080/",
232 | "height": 108
233 | },
234 | "outputId": "320bfa92-02dd-476d-bc95-747ebb87e405"
235 | },
236 | "source": [
237 | "import requests, json\n",
238 | "headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}\n",
239 | "data = {\"text\":\"Still working my way through it but definitely changes your view on investment. Wish it was available on Audible\"}\n",
240 | "req = requests.post(\"http://172.28.0.2:6000/seclassifier\", data=json.dumps(data), headers=headers)\n",
241 | "\n",
242 | "print(req.status_code)\n",
243 | "print(req.text)"
244 | ],
245 | "execution_count": null,
246 | "outputs": [
247 | {
248 | "output_type": "stream",
249 | "text": [
250 | "Still working my way through it but definitely changes your view on investment. Wish it was available on Audible\n"
251 | ],
252 | "name": "stdout"
253 | },
254 | {
255 | "output_type": "stream",
256 | "text": [
257 | "172.28.0.2 - - [05/Jun/2020 14:25:35] \"\u001b[37mPOST /seclassifier HTTP/1.1\u001b[0m\" 200 -\n"
258 | ],
259 | "name": "stderr"
260 | },
261 | {
262 | "output_type": "stream",
263 | "text": [
264 | "200\n",
265 | "{\"predictions \":[[0.8370056748390198]],\"sentiment \":\"positive\"}\n",
266 | "\n"
267 | ],
268 | "name": "stdout"
269 | }
270 | ]
271 | },
272 | {
273 | "cell_type": "code",
274 | "metadata": {
275 | "id": "stWiQxHI16Qi",
276 | "colab_type": "code",
277 | "colab": {
278 | "base_uri": "https://localhost:8080/",
279 | "height": 108
280 | },
281 | "outputId": "1e56d6b8-da6f-4697-e8c8-29c8419384c4"
282 | },
283 | "source": [
284 | "import requests, json\n",
285 | "headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}\n",
286 | "data = {\"text\":\"I thought this will be good one. But I was wrong\"}\n",
287 | "req = requests.post(\"http://172.28.0.2:6000/seclassifier\", data=json.dumps(data), headers=headers)\n",
288 | "\n",
289 | "print(req.status_code)\n",
290 | "print(req.text)"
291 | ],
292 | "execution_count": null,
293 | "outputs": [
294 | {
295 | "output_type": "stream",
296 | "text": [
297 | "I thought this will be good one. But I was wrong\n"
298 | ],
299 | "name": "stdout"
300 | },
301 | {
302 | "output_type": "stream",
303 | "text": [
304 | "172.28.0.2 - - [05/Jun/2020 14:26:08] \"\u001b[37mPOST /seclassifier HTTP/1.1\u001b[0m\" 200 -\n"
305 | ],
306 | "name": "stderr"
307 | },
308 | {
309 | "output_type": "stream",
310 | "text": [
311 | "200\n",
312 | "{\"predictions \":[[-0.8676939606666565]],\"sentiment \":\"Negative\"}\n",
313 | "\n"
314 | ],
315 | "name": "stdout"
316 | }
317 | ]
318 | },
319 | {
320 | "cell_type": "code",
321 | "metadata": {
322 | "id": "R0jA9Xev2zz-",
323 | "colab_type": "code",
324 | "colab": {
325 | "base_uri": "https://localhost:8080/",
326 | "height": 110
327 | },
328 | "outputId": "305c9b08-e1d4-4668-89ff-06c1f369845a"
329 | },
330 | "source": [
331 | "!ps -eaf | grep python"
332 | ],
333 | "execution_count": null,
334 | "outputs": [
335 | {
336 | "output_type": "stream",
337 | "text": [
338 | "root 18 8 0 13:59 ? 00:00:03 /usr/bin/python2 /usr/local/bin/jupyter-notebook --ip=\"172.28.0.2\" --port=9000 --FileContentsManager.root_dir=\"/\" --MappingKernelManager.root_dir=\"/content\"\n",
339 | "root 126 18 0 14:04 ? 00:00:08 /usr/bin/python3 -m ipykernel_launcher -f /root/.local/share/jupyter/runtime/kernel-4b17b2d1-f76b-46f8-a312-6700eb4ce66e.json\n",
340 | "root 745 126 0 14:26 ? 00:00:00 /bin/bash -c ps -eaf | grep python\n",
341 | "root 747 745 0 14:26 ? 00:00:00 grep python\n"
342 | ],
343 | "name": "stdout"
344 | }
345 | ]
346 | },
347 | {
348 | "cell_type": "code",
349 | "metadata": {
350 | "id": "eGJiHeCD5a1K",
351 | "colab_type": "code",
352 | "colab": {
353 | "base_uri": "https://localhost:8080/",
354 | "height": 35
355 | },
356 | "outputId": "9fe8d1a0-d0a6-43f7-f7c7-6af02b9e4c3d"
357 | },
358 | "source": [
359 | "import flask\n",
360 | "flask.__version__"
361 | ],
362 | "execution_count": null,
363 | "outputs": [
364 | {
365 | "output_type": "execute_result",
366 | "data": {
367 | "application/vnd.google.colaboratory.intrinsic": {
368 | "type": "string"
369 | },
370 | "text/plain": [
371 | "'1.1.2'"
372 | ]
373 | },
374 | "metadata": {
375 | "tags": []
376 | },
377 | "execution_count": 4
378 | }
379 | ]
380 | },
381 | {
382 | "cell_type": "code",
383 | "metadata": {
384 | "id": "yDJ3bhrzG65X",
385 | "colab_type": "code",
386 | "colab": {
387 | "base_uri": "https://localhost:8080/",
388 | "height": 310
389 | },
390 | "outputId": "ac9444b5-5218-4df2-8f1e-88d997fb0e85"
391 | },
392 | "source": [
393 | "!pip install flask-ngrok"
394 | ],
395 | "execution_count": null,
396 | "outputs": [
397 | {
398 | "output_type": "stream",
399 | "text": [
400 | "Collecting flask-ngrok\n",
401 | " Downloading https://files.pythonhosted.org/packages/af/6c/f54cb686ad1129e27d125d182f90f52b32f284e6c8df58c1bae54fa1adbc/flask_ngrok-0.0.25-py3-none-any.whl\n",
402 | "Requirement already satisfied: Flask>=0.8 in /usr/local/lib/python3.6/dist-packages (from flask-ngrok) (1.1.2)\n",
403 | "Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from flask-ngrok) (2.23.0)\n",
404 | "Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.6/dist-packages (from Flask>=0.8->flask-ngrok) (7.1.2)\n",
405 | "Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python3.6/dist-packages (from Flask>=0.8->flask-ngrok) (1.1.0)\n",
406 | "Requirement already satisfied: Werkzeug>=0.15 in /usr/local/lib/python3.6/dist-packages (from Flask>=0.8->flask-ngrok) (1.0.1)\n",
407 | "Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/lib/python3.6/dist-packages (from Flask>=0.8->flask-ngrok) (2.11.2)\n",
408 | "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->flask-ngrok) (2020.6.20)\n",
409 | "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->flask-ngrok) (3.0.4)\n",
410 | "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->flask-ngrok) (2.10)\n",
411 | "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->flask-ngrok) (1.24.3)\n",
412 | "Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from Jinja2>=2.10.1->Flask>=0.8->flask-ngrok) (1.1.1)\n",
413 | "Installing collected packages: flask-ngrok\n",
414 | "Successfully installed flask-ngrok-0.0.25\n"
415 | ],
416 | "name": "stdout"
417 | }
418 | ]
419 | },
420 | {
421 | "cell_type": "code",
422 | "metadata": {
423 | "id": "35JGfAl1yXvE",
424 | "colab_type": "code",
425 | "colab": {
426 | "base_uri": "https://localhost:8080/",
427 | "height": 363
428 | },
429 | "outputId": "21e41b8c-bfce-4498-e4c9-d19ea6c76cd9"
430 | },
431 | "source": [
432 | "import tensorflow_datasets as tfds\n",
433 | "import tensorflow as tf\n",
434 | "from flask import Flask, jsonify, make_response, request\n",
435 | "from flask_ngrok import run_with_ngrok\n",
436 | "\n",
437 | "app = Flask(__name__)\n",
438 | "run_with_ngrok(app)\n",
439 | "\n",
440 | "padding_size = 1000\n",
441 | "model = tf.keras.models.load_model('/content/drive/My Drive/Colab Notebooks/models/sentiment_analysis.hdf5')\n",
442 | "text_encoder = tfds.features.text.TokenTextEncoder.load_from_file(\"/content/drive/My Drive/Colab Notebooks/models/sa_encoder.vocab\")\n",
443 | "\n",
444 | "print('Model and Vocabalory loaded.......')\n",
445 | "\n",
446 | "@app.route(\"/\")\n",
447 | "def hello():\n",
448 | " return \"I am alive!\"\n",
449 | "\n",
450 | "def pad_to_size(vec, size):\n",
451 | " zeros = [0] * (size - len(vec))\n",
452 | " vec.extend(zeros)\n",
453 | " return vec\n",
454 | "\n",
455 | "\n",
456 | "def predict_fn(predict_text, pad_size):\n",
457 | " encoded_text = text_encoder.encode(predict_text)\n",
458 | " encoded_text = pad_to_size(encoded_text, pad_size)\n",
459 | " encoded_text = tf.cast(encoded_text, tf.int64)\n",
460 | " predictions = model.predict(tf.expand_dims(encoded_text, 0))\n",
461 | "\n",
462 | " return (predictions.tolist())\n",
463 | "\n",
464 | "\n",
465 | "@app.route('/seclassifier', methods=['POST'])\n",
466 | "def predict_sentiment():\n",
467 | " text = request.get_json()['text']\n",
468 | " print(text)\n",
469 | " predictions = predict_fn(text, padding_size)\n",
470 | " sentiment = 'positive' if float(''.join(map(str,predictions[0]))) > 0 else 'Negative'\n",
471 | " return jsonify({'predictions ':predictions, 'sentiment ': sentiment})\n",
472 | "\n",
473 | "if __name__ == '__main__':\n",
474 | " app.run()"
475 | ],
476 | "execution_count": null,
477 | "outputs": [
478 | {
479 | "output_type": "stream",
480 | "text": [
481 | "Model and Vocabalory loaded.......\n",
482 | " * Serving Flask app \"__main__\" (lazy loading)\n",
483 | " * Environment: production\n",
484 | "\u001b[31m WARNING: This is a development server. Do not use it in a production deployment.\u001b[0m\n",
485 | "\u001b[2m Use a production WSGI server instead.\u001b[0m\n",
486 | " * Debug mode: off\n"
487 | ],
488 | "name": "stdout"
489 | },
490 | {
491 | "output_type": "stream",
492 | "text": [
493 | " * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n",
494 | "Exception in thread Thread-5:\n",
495 | "Traceback (most recent call last):\n",
496 | " File \"/usr/lib/python3.6/threading.py\", line 916, in _bootstrap_inner\n",
497 | " self.run()\n",
498 | " File \"/usr/lib/python3.6/threading.py\", line 1182, in run\n",
499 | " self.function(*self.args, **self.kwargs)\n",
500 | " File \"/usr/local/lib/python3.6/dist-packages/flask_ngrok.py\", line 70, in start_ngrok\n",
501 | " ngrok_address = _run_ngrok()\n",
502 | " File \"/usr/local/lib/python3.6/dist-packages/flask_ngrok.py\", line 38, in _run_ngrok\n",
503 | " tunnel_url = j['tunnels'][0]['public_url'] # Do the parsing of the get\n",
504 | "IndexError: list index out of range\n",
505 | "\n"
506 | ],
507 | "name": "stderr"
508 | }
509 | ]
510 | },
511 | {
512 | "cell_type": "code",
513 | "metadata": {
514 | "id": "5vgwRobA02md",
515 | "colab_type": "code",
516 | "colab": {}
517 | },
518 | "source": [
519 | ""
520 | ],
521 | "execution_count": null,
522 | "outputs": []
523 | }
524 | ]
525 | }
--------------------------------------------------------------------------------
/Image_Classification_Web_App.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "name": "Image Classification Web App.ipynb",
7 | "provenance": [],
8 | "authorship_tag": "ABX9TyMXK/xufEJNKsCZKy6NxNgv",
9 | "include_colab_link": true
10 | },
11 | "kernelspec": {
12 | "name": "python3",
13 | "display_name": "Python 3"
14 | },
15 | "accelerator": "GPU"
16 | },
17 | "cells": [
18 | {
19 | "cell_type": "markdown",
20 | "metadata": {
21 | "id": "view-in-github",
22 | "colab_type": "text"
23 | },
24 | "source": [
25 | "
"
26 | ]
27 | },
28 | {
29 | "cell_type": "markdown",
30 | "metadata": {
31 | "id": "tHxbCcQYO1-s",
32 | "colab_type": "text"
33 | },
34 | "source": [
35 | "This video is supporting code for my video - https://youtu.be/AIDo3GO9t5A"
36 | ]
37 | },
38 | {
39 | "cell_type": "code",
40 | "metadata": {
41 | "id": "j5C8c_IfYHfH",
42 | "colab_type": "code",
43 | "colab": {
44 | "base_uri": "https://localhost:8080/",
45 | "height": 690
46 | },
47 | "outputId": "04681d81-1cdd-454a-c2b5-6615691b2597"
48 | },
49 | "source": [
50 | "!pip install -U ipykernel"
51 | ],
52 | "execution_count": null,
53 | "outputs": [
54 | {
55 | "output_type": "stream",
56 | "text": [
57 | "Collecting ipykernel\n",
58 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/52/19/c2812690d8b340987eecd2cbc18549b1d130b94c5d97fcbe49f5f8710edf/ipykernel-5.3.4-py3-none-any.whl (120kB)\n",
59 | "\r\u001b[K |██▊ | 10kB 17.6MB/s eta 0:00:01\r\u001b[K |█████▍ | 20kB 6.2MB/s eta 0:00:01\r\u001b[K |████████▏ | 30kB 7.2MB/s eta 0:00:01\r\u001b[K |██████████▉ | 40kB 7.8MB/s eta 0:00:01\r\u001b[K |█████████████▋ | 51kB 6.6MB/s eta 0:00:01\r\u001b[K |████████████████▎ | 61kB 7.2MB/s eta 0:00:01\r\u001b[K |███████████████████ | 71kB 7.9MB/s eta 0:00:01\r\u001b[K |█████████████████████▊ | 81kB 8.2MB/s eta 0:00:01\r\u001b[K |████████████████████████▌ | 92kB 8.2MB/s eta 0:00:01\r\u001b[K |███████████████████████████▏ | 102kB 8.6MB/s eta 0:00:01\r\u001b[K |██████████████████████████████ | 112kB 8.6MB/s eta 0:00:01\r\u001b[K |████████████████████████████████| 122kB 8.6MB/s \n",
60 | "\u001b[?25hRequirement already satisfied, skipping upgrade: jupyter-client in /usr/local/lib/python3.6/dist-packages (from ipykernel) (5.3.5)\n",
61 | "Requirement already satisfied, skipping upgrade: tornado>=4.2 in /usr/local/lib/python3.6/dist-packages (from ipykernel) (5.1.1)\n",
62 | "Requirement already satisfied, skipping upgrade: ipython>=5.0.0 in /usr/local/lib/python3.6/dist-packages (from ipykernel) (5.5.0)\n",
63 | "Requirement already satisfied, skipping upgrade: traitlets>=4.1.0 in /usr/local/lib/python3.6/dist-packages (from ipykernel) (4.3.3)\n",
64 | "Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from jupyter-client->ipykernel) (2.8.1)\n",
65 | "Requirement already satisfied, skipping upgrade: pyzmq>=13 in /usr/local/lib/python3.6/dist-packages (from jupyter-client->ipykernel) (19.0.1)\n",
66 | "Requirement already satisfied, skipping upgrade: jupyter-core>=4.6.0 in /usr/local/lib/python3.6/dist-packages (from jupyter-client->ipykernel) (4.6.3)\n",
67 | "Requirement already satisfied, skipping upgrade: pexpect; sys_platform != \"win32\" in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (4.8.0)\n",
68 | "Requirement already satisfied, skipping upgrade: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (1.0.18)\n",
69 | "Requirement already satisfied, skipping upgrade: setuptools>=18.5 in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (49.2.0)\n",
70 | "Requirement already satisfied, skipping upgrade: pickleshare in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (0.7.5)\n",
71 | "Requirement already satisfied, skipping upgrade: decorator in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (4.4.2)\n",
72 | "Requirement already satisfied, skipping upgrade: pygments in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (2.1.3)\n",
73 | "Requirement already satisfied, skipping upgrade: simplegeneric>0.8 in /usr/local/lib/python3.6/dist-packages (from ipython>=5.0.0->ipykernel) (0.8.1)\n",
74 | "Requirement already satisfied, skipping upgrade: six in /usr/local/lib/python3.6/dist-packages (from traitlets>=4.1.0->ipykernel) (1.15.0)\n",
75 | "Requirement already satisfied, skipping upgrade: ipython-genutils in /usr/local/lib/python3.6/dist-packages (from traitlets>=4.1.0->ipykernel) (0.2.0)\n",
76 | "Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in /usr/local/lib/python3.6/dist-packages (from pexpect; sys_platform != \"win32\"->ipython>=5.0.0->ipykernel) (0.6.0)\n",
77 | "Requirement already satisfied, skipping upgrade: wcwidth in /usr/local/lib/python3.6/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=5.0.0->ipykernel) (0.2.5)\n",
78 | "\u001b[31mERROR: google-colab 1.0.0 has requirement ipykernel~=4.10, but you'll have ipykernel 5.3.4 which is incompatible.\u001b[0m\n",
79 | "Installing collected packages: ipykernel\n",
80 | " Found existing installation: ipykernel 4.10.1\n",
81 | " Uninstalling ipykernel-4.10.1:\n",
82 | " Successfully uninstalled ipykernel-4.10.1\n",
83 | "Successfully installed ipykernel-5.3.4\n"
84 | ],
85 | "name": "stdout"
86 | },
87 | {
88 | "output_type": "display_data",
89 | "data": {
90 | "application/vnd.colab-display-data+json": {
91 | "pip_warning": {
92 | "packages": [
93 | "ipykernel"
94 | ]
95 | }
96 | }
97 | },
98 | "metadata": {
99 | "tags": []
100 | }
101 | }
102 | ]
103 | },
104 | {
105 | "cell_type": "code",
106 | "metadata": {
107 | "id": "uxclE-m8LZa6",
108 | "colab_type": "code",
109 | "colab": {
110 | "base_uri": "https://localhost:8080/",
111 | "height": 163
112 | },
113 | "outputId": "319bd314-7215-4651-958b-841a62886671"
114 | },
115 | "source": [
116 | "!pip install -q streamlit"
117 | ],
118 | "execution_count": null,
119 | "outputs": [
120 | {
121 | "output_type": "stream",
122 | "text": [
123 | "\u001b[K |████████████████████████████████| 7.1MB 8.3MB/s \n",
124 | "\u001b[K |████████████████████████████████| 102kB 13.9MB/s \n",
125 | "\u001b[K |████████████████████████████████| 4.4MB 56.6MB/s \n",
126 | "\u001b[K |████████████████████████████████| 112kB 63.9MB/s \n",
127 | "\u001b[?25h Building wheel for validators (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
128 | " Building wheel for watchdog (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
129 | " Building wheel for blinker (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
130 | " Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n"
131 | ],
132 | "name": "stdout"
133 | }
134 | ]
135 | },
136 | {
137 | "cell_type": "code",
138 | "metadata": {
139 | "id": "a3gBR5EsiIa7",
140 | "colab_type": "code",
141 | "colab": {
142 | "base_uri": "https://localhost:8080/",
143 | "height": 237
144 | },
145 | "outputId": "4e180790-d975-4fab-d05b-d8bffeb27f59"
146 | },
147 | "source": [
148 | "!pip install pyngrok"
149 | ],
150 | "execution_count": null,
151 | "outputs": [
152 | {
153 | "output_type": "stream",
154 | "text": [
155 | "Collecting pyngrok\n",
156 | " Downloading https://files.pythonhosted.org/packages/94/bb/0d5bff58a5bd9b17f1c35821ffb127f10eca7a3fc844e0ad827026ac1d2c/pyngrok-4.1.8.tar.gz\n",
157 | "Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyngrok) (0.16.0)\n",
158 | "Requirement already satisfied: PyYAML in /usr/local/lib/python3.6/dist-packages (from pyngrok) (3.13)\n",
159 | "Building wheels for collected packages: pyngrok\n",
160 | " Building wheel for pyngrok (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
161 | " Created wheel for pyngrok: filename=pyngrok-4.1.8-cp36-none-any.whl size=16337 sha256=1fc3c0eff40a0449b1721f785d433a8d79507bf60005ab34eb2f836a07cba342\n",
162 | " Stored in directory: /root/.cache/pip/wheels/7d/25/b7/5e4a3aefe7dd2dd9cec445786d64fe70e885109636fea356c7\n",
163 | "Successfully built pyngrok\n",
164 | "Installing collected packages: pyngrok\n",
165 | "Successfully installed pyngrok-4.1.8\n"
166 | ],
167 | "name": "stdout"
168 | }
169 | ]
170 | },
171 | {
172 | "cell_type": "markdown",
173 | "metadata": {
174 | "id": "xEjZmh1V078P",
175 | "colab_type": "text"
176 | },
177 | "source": [
178 | "Update the token below from creating an account in ngrok website\n",
179 | "\n",
180 | "You can ignore Ngrok step completely if you are not looking to expose your app to internet\n",
181 | "\n"
182 | ]
183 | },
184 | {
185 | "cell_type": "code",
186 | "metadata": {
187 | "id": "YjoAEsIEh-oZ",
188 | "colab_type": "code",
189 | "cellView": "both",
190 | "colab": {
191 | "base_uri": "https://localhost:8080/",
192 | "height": 35
193 | },
194 | "outputId": "d3b5a7b4-1499-44c5-f590-0a2afa27ffa8"
195 | },
196 | "source": [
197 | "!ngrok authtoken XXXXXXXXXX"
198 | ],
199 | "execution_count": null,
200 | "outputs": [
201 | {
202 | "output_type": "stream",
203 | "text": [
204 | "Authtoken saved to configuration file: /root/.ngrok2/ngrok.yml\n"
205 | ],
206 | "name": "stdout"
207 | }
208 | ]
209 | },
210 | {
211 | "cell_type": "code",
212 | "metadata": {
213 | "id": "hvmlfY16Yg9O",
214 | "colab_type": "code",
215 | "colab": {
216 | "base_uri": "https://localhost:8080/",
217 | "height": 128
218 | },
219 | "outputId": "c65fd890-1821-470c-defd-530697ae5690"
220 | },
221 | "source": [
222 | "from google.colab import drive\n",
223 | "drive.mount('/content/drive')"
224 | ],
225 | "execution_count": null,
226 | "outputs": [
227 | {
228 | "output_type": "stream",
229 | "text": [
230 | "Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly\n",
231 | "\n",
232 | "Enter your authorization code:\n",
233 | "··········\n",
234 | "Mounted at /content/drive\n"
235 | ],
236 | "name": "stdout"
237 | }
238 | ]
239 | },
240 | {
241 | "cell_type": "code",
242 | "metadata": {
243 | "id": "RuNpGDdZY3WW",
244 | "colab_type": "code",
245 | "colab": {
246 | "base_uri": "https://localhost:8080/",
247 | "height": 35
248 | },
249 | "outputId": "8873ea48-b853-468f-fef5-caffac20fac9"
250 | },
251 | "source": [
252 | "%%writefile score.py\n",
253 | "\n",
254 | "import tensorflow as tf\n",
255 | "import numpy as np\n",
256 | "import streamlit as st\n",
257 | "from PIL import Image\n",
258 | "import requests\n",
259 | "from io import BytesIO\n",
260 | "\n",
261 | "st.set_option('deprecation.showfileUploaderEncoding', False)\n",
262 | "st.title(\"Bean Image Classifier\")\n",
263 | "st.text(\"Provide URL of bean Image for image classification\")\n",
264 | "\n",
265 | "@st.cache(allow_output_mutation=True)\n",
266 | "def load_model():\n",
267 | " model = tf.keras.models.load_model('/content/drive/My Drive/Colab Notebooks/models/image/models')\n",
268 | " return model\n",
269 | "\n",
270 | "with st.spinner('Loading Model Into Memory....'):\n",
271 | " model = load_model()\n",
272 | "\n",
273 | "classes=['angular_leaf_spot','bean_rust','healthy']\n",
274 | "\n",
275 | "def scale(image):\n",
276 | " image = tf.cast(image, tf.float32)\n",
277 | " image /= 255.0\n",
278 | "\n",
279 | " return tf.image.resize(image,[224,224])\n",
280 | "\n",
281 | "def decode_img(image):\n",
282 | " img = tf.image.decode_jpeg(image, channels=3)\n",
283 | " img = scale(img)\n",
284 | " return np.expand_dims(img, axis=0)\n",
285 | "\n",
286 | "path = st.text_input('Enter Image URL to Classify.. ','http://barmac.com.au/wp-content/uploads/sites/3/2016/01/Angular-Leaf-Spot-Beans1.jpg')\n",
287 | "if path is not None:\n",
288 | " content = requests.get(path).content\n",
289 | "\n",
290 | " st.write(\"Predicted Class :\")\n",
291 | " with st.spinner('classifying.....'):\n",
292 | " label =np.argmax(model.predict(decode_img(content)),axis=1)\n",
293 | " st.write(classes[label[0]]) \n",
294 | " st.write(\"\")\n",
295 | " image = Image.open(BytesIO(content))\n",
296 | " st.image(image, caption='Classifying Bean Image', use_column_width=True) \n"
297 | ],
298 | "execution_count": null,
299 | "outputs": [
300 | {
301 | "output_type": "stream",
302 | "text": [
303 | "Writing score.py\n"
304 | ],
305 | "name": "stdout"
306 | }
307 | ]
308 | },
309 | {
310 | "cell_type": "code",
311 | "metadata": {
312 | "id": "ZeUbOXBNhVmq",
313 | "colab_type": "code",
314 | "colab": {
315 | "base_uri": "https://localhost:8080/",
316 | "height": 35
317 | },
318 | "outputId": "60f8bd7b-eb67-4271-a631-f46fcb32f8b9"
319 | },
320 | "source": [
321 | "!nohup streamlit run score.py &"
322 | ],
323 | "execution_count": null,
324 | "outputs": [
325 | {
326 | "output_type": "stream",
327 | "text": [
328 | "nohup: appending output to 'nohup.out'\n"
329 | ],
330 | "name": "stdout"
331 | }
332 | ]
333 | },
334 | {
335 | "cell_type": "code",
336 | "metadata": {
337 | "id": "YB0kwgXqhdeo",
338 | "colab_type": "code",
339 | "colab": {
340 | "base_uri": "https://localhost:8080/",
341 | "height": 35
342 | },
343 | "outputId": "3d9af946-1d73-4048-bbc1-02cc5bcc775e"
344 | },
345 | "source": [
346 | "from pyngrok import ngrok\n",
347 | "\n",
348 | "url = ngrok.connect(port=8501)\n",
349 | "url"
350 | ],
351 | "execution_count": null,
352 | "outputs": [
353 | {
354 | "output_type": "execute_result",
355 | "data": {
356 | "application/vnd.google.colaboratory.intrinsic+json": {
357 | "type": "string"
358 | },
359 | "text/plain": [
360 | "'http://a9a13001a9f3.ngrok.io'"
361 | ]
362 | },
363 | "metadata": {
364 | "tags": []
365 | },
366 | "execution_count": 7
367 | }
368 | ]
369 | },
370 | {
371 | "cell_type": "code",
372 | "metadata": {
373 | "id": "71SR5W0rkrsw",
374 | "colab_type": "code",
375 | "colab": {
376 | "base_uri": "https://localhost:8080/",
377 | "height": 965
378 | },
379 | "outputId": "013536a2-82cc-410d-f7f9-0518f39c72bb"
380 | },
381 | "source": [
382 | "!cat nohup.out"
383 | ],
384 | "execution_count": null,
385 | "outputs": [
386 | {
387 | "output_type": "stream",
388 | "text": [
389 | "2020-08-02 02:02:29.927135: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1\n",
390 | "\n",
391 | " You can now view your Streamlit app in your browser.\n",
392 | "\n",
393 | " Network URL: http://172.28.0.2:8501\n",
394 | " External URL: http://35.233.217.185:8501\n",
395 | "\n",
396 | "2020-08-02 02:02:32.545123: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1\n",
397 | "2020-08-02 02:02:32.605044: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
398 | "2020-08-02 02:02:32.605722: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: \n",
399 | "pciBusID: 0000:00:04.0 name: Tesla T4 computeCapability: 7.5\n",
400 | "coreClock: 1.59GHz coreCount: 40 deviceMemorySize: 14.73GiB deviceMemoryBandwidth: 298.08GiB/s\n",
401 | "2020-08-02 02:02:32.605768: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1\n",
402 | "2020-08-02 02:02:32.845506: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10\n",
403 | "2020-08-02 02:02:32.944938: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10\n",
404 | "2020-08-02 02:02:32.964090: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10\n",
405 | "2020-08-02 02:02:33.250182: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10\n",
406 | "2020-08-02 02:02:33.264820: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10\n",
407 | "2020-08-02 02:02:33.790480: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n",
408 | "2020-08-02 02:02:33.790706: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
409 | "2020-08-02 02:02:33.791466: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
410 | "2020-08-02 02:02:33.792055: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0\n",
411 | "2020-08-02 02:02:33.839029: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2200000000 Hz\n",
412 | "2020-08-02 02:02:33.839309: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x820e000 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n",
413 | "2020-08-02 02:02:33.839347: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version\n",
414 | "2020-08-02 02:02:33.980601: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
415 | "2020-08-02 02:02:33.981455: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x820e1c0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:\n",
416 | "2020-08-02 02:02:33.981493: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Tesla T4, Compute Capability 7.5\n",
417 | "2020-08-02 02:02:33.982413: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
418 | "2020-08-02 02:02:33.983045: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: \n",
419 | "pciBusID: 0000:00:04.0 name: Tesla T4 computeCapability: 7.5\n",
420 | "coreClock: 1.59GHz coreCount: 40 deviceMemorySize: 14.73GiB deviceMemoryBandwidth: 298.08GiB/s\n",
421 | "2020-08-02 02:02:33.983101: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1\n",
422 | "2020-08-02 02:02:33.983132: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10\n",
423 | "2020-08-02 02:02:33.983147: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10\n",
424 | "2020-08-02 02:02:33.983161: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10\n",
425 | "2020-08-02 02:02:33.983174: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10\n",
426 | "2020-08-02 02:02:33.983188: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10\n",
427 | "2020-08-02 02:02:33.983202: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n",
428 | "2020-08-02 02:02:33.983262: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
429 | "2020-08-02 02:02:33.983889: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
430 | "2020-08-02 02:02:33.984456: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0\n",
431 | "2020-08-02 02:02:33.987717: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1\n",
432 | "2020-08-02 02:02:40.793738: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:\n",
433 | "2020-08-02 02:02:40.793811: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0 \n",
434 | "2020-08-02 02:02:40.793823: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N \n",
435 | "2020-08-02 02:02:40.795019: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
436 | "2020-08-02 02:02:40.795866: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
437 | "2020-08-02 02:02:40.796559: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
438 | "2020-08-02 02:02:40.796618: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 13970 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5)\n",
439 | "2020-08-02 02:02:49.601432: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10\n",
440 | "2020-08-02 02:02:51.024007: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n"
441 | ],
442 | "name": "stdout"
443 | }
444 | ]
445 | },
446 | {
447 | "cell_type": "code",
448 | "metadata": {
449 | "id": "1B4K9lQ6mHhQ",
450 | "colab_type": "code",
451 | "colab": {}
452 | },
453 | "source": [
454 | ""
455 | ],
456 | "execution_count": null,
457 | "outputs": []
458 | }
459 | ]
460 | }
--------------------------------------------------------------------------------
/Deploying_Tensorflow_Model_Part_1.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "name": "Deploying Tensorflow Model - Part 1.ipynb",
7 | "provenance": [],
8 | "authorship_tag": "ABX9TyPLGBUznaAd2BHYNyBQ+Jno",
9 | "include_colab_link": true
10 | },
11 | "kernelspec": {
12 | "name": "python3",
13 | "display_name": "Python 3"
14 | }
15 | },
16 | "cells": [
17 | {
18 | "cell_type": "markdown",
19 | "metadata": {
20 | "id": "view-in-github",
21 | "colab_type": "text"
22 | },
23 | "source": [
24 | "
"
25 | ]
26 | },
27 | {
28 | "cell_type": "markdown",
29 | "metadata": {
30 | "id": "iD5_Q9BBWBMs",
31 | "colab_type": "text"
32 | },
33 | "source": [
34 | "\n",
35 | "\n"
36 | ]
37 | },
38 | {
39 | "cell_type": "markdown",
40 | "metadata": {
41 | "id": "nFEP2UcuWwPu",
42 | "colab_type": "text"
43 | },
44 | "source": [
45 | ""
46 | ]
47 | },
48 | {
49 | "cell_type": "code",
50 | "metadata": {
51 | "id": "p-MlOTXR-hv4",
52 | "colab_type": "code",
53 | "colab": {
54 | "base_uri": "https://localhost:8080/",
55 | "height": 125
56 | },
57 | "outputId": "41a1c296-2725-4c05-b230-df970382e0bb"
58 | },
59 | "source": [
60 | "from google.colab import drive\n",
61 | "drive.mount('/content/drive')"
62 | ],
63 | "execution_count": null,
64 | "outputs": [
65 | {
66 | "output_type": "stream",
67 | "text": [
68 | "Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly\n",
69 | "\n",
70 | "Enter your authorization code:\n",
71 | "··········\n",
72 | "Mounted at /content/drive\n"
73 | ],
74 | "name": "stdout"
75 | }
76 | ]
77 | },
78 | {
79 | "cell_type": "code",
80 | "metadata": {
81 | "id": "jGokItTB-jhh",
82 | "colab_type": "code",
83 | "colab": {
84 | "base_uri": "https://localhost:8080/",
85 | "height": 70
86 | },
87 | "outputId": "885d2c9b-fa4a-4cc1-dcd2-18bd91a0ab72"
88 | },
89 | "source": [
90 | "!ls '/content/drive/My Drive/Colab Notebooks/models/'"
91 | ],
92 | "execution_count": null,
93 | "outputs": [
94 | {
95 | "output_type": "stream",
96 | "text": [
97 | "final_sentiment_analysis.hdf5 sentiment_analysis.hdf5\n",
98 | "sa_encoder.vocab.tokens sentiment_analysis.hdf51\n",
99 | "sa_encoder.vocab.tokens1\n"
100 | ],
101 | "name": "stdout"
102 | }
103 | ]
104 | },
105 | {
106 | "cell_type": "code",
107 | "metadata": {
108 | "id": "UBJLdSSI-tub",
109 | "colab_type": "code",
110 | "colab": {
111 | "base_uri": "https://localhost:8080/",
112 | "height": 34
113 | },
114 | "outputId": "9cb05ea5-dfa2-43da-a029-48f86f017534"
115 | },
116 | "source": [
117 | "from __future__ import absolute_import, division, print_function, unicode_literals\n",
118 | "\n",
119 | "try:\n",
120 | " %tensorflow_version 2.x\n",
121 | "except Exception:\n",
122 | " pass\n",
123 | "import tensorflow as tf"
124 | ],
125 | "execution_count": null,
126 | "outputs": [
127 | {
128 | "output_type": "stream",
129 | "text": [
130 | "TensorFlow 2.x selected.\n"
131 | ],
132 | "name": "stdout"
133 | }
134 | ]
135 | },
136 | {
137 | "cell_type": "code",
138 | "metadata": {
139 | "id": "PZksqtMB_aQA",
140 | "colab_type": "code",
141 | "colab": {
142 | "base_uri": "https://localhost:8080/",
143 | "height": 34
144 | },
145 | "outputId": "093d41f8-3dd0-4ab4-b166-b96e2b012611"
146 | },
147 | "source": [
148 | "print(tf.__version__)"
149 | ],
150 | "execution_count": null,
151 | "outputs": [
152 | {
153 | "output_type": "stream",
154 | "text": [
155 | "2.1.0\n"
156 | ],
157 | "name": "stdout"
158 | }
159 | ]
160 | },
161 | {
162 | "cell_type": "code",
163 | "metadata": {
164 | "id": "maZ-e6wjCzhT",
165 | "colab_type": "code",
166 | "colab": {
167 | "base_uri": "https://localhost:8080/",
168 | "height": 34
169 | },
170 | "outputId": "bb3f9ac7-b123-4ce7-ba1a-2499ce89f735"
171 | },
172 | "source": [
173 | "model = tf.keras.models.load_model('/content/drive/My Drive/Colab Notebooks/models/sentiment_analysis.hdf5')\n",
174 | "print(model.outputs)"
175 | ],
176 | "execution_count": null,
177 | "outputs": [
178 | {
179 | "output_type": "stream",
180 | "text": [
181 | "[]\n"
182 | ],
183 | "name": "stdout"
184 | }
185 | ]
186 | },
187 | {
188 | "cell_type": "code",
189 | "metadata": {
190 | "id": "6zTdiB1tDNL3",
191 | "colab_type": "code",
192 | "colab": {
193 | "base_uri": "https://localhost:8080/",
194 | "height": 34
195 | },
196 | "outputId": "554e4350-9213-4e5a-ba72-9aa3ffb59d1f"
197 | },
198 | "source": [
199 | "print(model.inputs)"
200 | ],
201 | "execution_count": null,
202 | "outputs": [
203 | {
204 | "output_type": "stream",
205 | "text": [
206 | "[]\n"
207 | ],
208 | "name": "stdout"
209 | }
210 | ]
211 | },
212 | {
213 | "cell_type": "code",
214 | "metadata": {
215 | "id": "FivKArNqDSf4",
216 | "colab_type": "code",
217 | "colab": {
218 | "base_uri": "https://localhost:8080/",
219 | "height": 514
220 | },
221 | "outputId": "bd927296-bd39-4f02-9105-34186f5de1dd"
222 | },
223 | "source": [
224 | "model.summary()"
225 | ],
226 | "execution_count": null,
227 | "outputs": [
228 | {
229 | "output_type": "stream",
230 | "text": [
231 | "Model: \"sequential_2\"\n",
232 | "_________________________________________________________________\n",
233 | "Layer (type) Output Shape Param # \n",
234 | "=================================================================\n",
235 | "embedding_2 (Embedding) (None, None, 128) 9438720 \n",
236 | "_________________________________________________________________\n",
237 | "bidirectional_5 (Bidirection (None, None, 256) 263168 \n",
238 | "_________________________________________________________________\n",
239 | "bidirectional_6 (Bidirection (None, 128) 164352 \n",
240 | "_________________________________________________________________\n",
241 | "dense_8 (Dense) (None, 64) 8256 \n",
242 | "_________________________________________________________________\n",
243 | "dropout_6 (Dropout) (None, 64) 0 \n",
244 | "_________________________________________________________________\n",
245 | "dense_9 (Dense) (None, 32) 2080 \n",
246 | "_________________________________________________________________\n",
247 | "dropout_7 (Dropout) (None, 32) 0 \n",
248 | "_________________________________________________________________\n",
249 | "dense_10 (Dense) (None, 16) 528 \n",
250 | "_________________________________________________________________\n",
251 | "dropout_8 (Dropout) (None, 16) 0 \n",
252 | "_________________________________________________________________\n",
253 | "dense_11 (Dense) (None, 1) 17 \n",
254 | "=================================================================\n",
255 | "Total params: 9,877,121\n",
256 | "Trainable params: 9,877,121\n",
257 | "Non-trainable params: 0\n",
258 | "_________________________________________________________________\n"
259 | ],
260 | "name": "stdout"
261 | }
262 | ]
263 | },
264 | {
265 | "cell_type": "code",
266 | "metadata": {
267 | "id": "prqxFd_Ix1wh",
268 | "colab_type": "code",
269 | "colab": {
270 | "base_uri": "https://localhost:8080/",
271 | "height": 1000
272 | },
273 | "outputId": "de999f2b-d5a3-4333-9106-1cadd02f041a"
274 | },
275 | "source": [
276 | "model.get_weights()"
277 | ],
278 | "execution_count": null,
279 | "outputs": [
280 | {
281 | "output_type": "execute_result",
282 | "data": {
283 | "text/plain": [
284 | "[array([[-0.04629749, 0.01110122, -0.03263856, ..., 0.03305478,\n",
285 | " 0.05579415, 0.03214427],\n",
286 | " [-0.04206273, -0.05558819, -0.01833712, ..., -0.01560727,\n",
287 | " 0.06167749, -0.00132483],\n",
288 | " [ 0.00293742, 0.03017613, -0.05452958, ..., -0.02469147,\n",
289 | " 0.05835793, 0.05551361],\n",
290 | " ...,\n",
291 | " [-0.04581881, 0.04027994, 0.00380965, ..., 0.01255488,\n",
292 | " 0.00666949, 0.04146244],\n",
293 | " [ 0.03165385, -0.02949343, -0.03873481, ..., -0.01048608,\n",
294 | " 0.02723416, 0.01732886],\n",
295 | " [-0.03989124, -0.02672502, 0.01777582, ..., -0.04596042,\n",
296 | " 0.04822646, 0.04781136]], dtype=float32),\n",
297 | " array([[-0.1087565 , 0.00725023, -0.00725317, ..., -0.13343191,\n",
298 | " -0.04476446, -0.07642907],\n",
299 | " [ 0.04909128, 0.07869313, -0.07312109, ..., -0.09178353,\n",
300 | " -0.01334419, -0.07912165],\n",
301 | " [ 0.04738641, 0.06753984, 0.02692822, ..., 0.01726119,\n",
302 | " 0.08938981, 0.04791883],\n",
303 | " ...,\n",
304 | " [-0.10809879, -0.02525443, 0.0285022 , ..., 0.16985697,\n",
305 | " 0.05318509, -0.01092821],\n",
306 | " [ 0.06007785, -0.04516843, 0.0456744 , ..., 0.12330289,\n",
307 | " 0.01619206, 0.15889642],\n",
308 | " [ 0.06474997, -0.08735643, -0.00954457, ..., 0.07794626,\n",
309 | " -0.03463706, 0.15487759]], dtype=float32),\n",
310 | " array([[ 0.00890297, 0.0367904 , 0.04311248, ..., -0.04280928,\n",
311 | " 0.01316974, -0.04825889],\n",
312 | " [-0.04523464, 0.00348579, -0.07172167, ..., -0.0565719 ,\n",
313 | " 0.02742938, -0.00643239],\n",
314 | " [-0.00646426, -0.04764731, -0.00864654, ..., -0.0100337 ,\n",
315 | " -0.00578077, -0.00302217],\n",
316 | " ...,\n",
317 | " [ 0.05975493, -0.03401382, 0.00649735, ..., 0.01382878,\n",
318 | " 0.09050762, 0.10517547],\n",
319 | " [-0.01850713, 0.01358179, -0.11441372, ..., -0.01625968,\n",
320 | " -0.06463523, -0.03777753],\n",
321 | " [-0.02745367, -0.1288594 , -0.10178564, ..., -0.08860108,\n",
322 | " 0.10690753, 0.04421301]], dtype=float32),\n",
323 | " array([-3.36837769e-02, -3.94320376e-02, 2.29352154e-02, -2.15189010e-02,\n",
324 | " 1.90079212e-03, -1.68202911e-02, -4.22206558e-02, -1.40262665e-02,\n",
325 | " 2.11508432e-03, -6.74453378e-02, -1.81215967e-03, 1.51412562e-02,\n",
326 | " -3.19804698e-02, -1.10806106e-02, -3.03853839e-03, -2.39352193e-02,\n",
327 | " -5.25768064e-02, -2.90312478e-03, -3.61880264e-03, -1.15463817e-02,\n",
328 | " -2.36903187e-02, -7.39042414e-04, 2.19870452e-02, 9.54254007e-04,\n",
329 | " -7.90661424e-02, -2.55894139e-02, 1.40072992e-02, -1.82449687e-02,\n",
330 | " -5.64208329e-02, 7.93800410e-03, -4.16535512e-02, -1.66365542e-02,\n",
331 | " -3.37199271e-02, 2.60276496e-02, -3.83044370e-02, 1.72497460e-03,\n",
332 | " -4.38569859e-02, -6.27753064e-02, -4.74149883e-02, -7.85822608e-03,\n",
333 | " 2.28598937e-02, 3.42501290e-02, 6.85544545e-03, -3.78172696e-02,\n",
334 | " -4.41036373e-03, -4.50699637e-03, -2.34788600e-02, 2.91549577e-03,\n",
335 | " -8.49280413e-03, -1.76783912e-02, 3.86430286e-02, 2.89697340e-03,\n",
336 | " -6.27807621e-03, -3.67235839e-02, -4.66552153e-02, 1.01824086e-02,\n",
337 | " -8.55241343e-03, -1.16285356e-02, 2.71141659e-02, -3.07712313e-02,\n",
338 | " -4.96850833e-02, -1.28148384e-02, -4.21503745e-02, 2.44842879e-02,\n",
339 | " 8.70403461e-03, 3.01713925e-02, 5.95911220e-03, -4.98337345e-03,\n",
340 | " 5.84838260e-03, -1.60292666e-02, -2.71081887e-02, -8.55169445e-02,\n",
341 | " -1.78267080e-02, -5.91836916e-03, -2.63444893e-03, -1.50633715e-02,\n",
342 | " -7.90008157e-03, -2.08838489e-02, 8.03926680e-03, -4.05940507e-03,\n",
343 | " -2.55228635e-02, -1.98488198e-02, -5.51642329e-02, -2.85579991e-02,\n",
344 | " -1.85159314e-02, -7.43503822e-03, -2.99282558e-02, -1.00216956e-03,\n",
345 | " -8.61751754e-03, -1.14210853e-02, 4.12240764e-03, 1.02757560e-02,\n",
346 | " 1.40121058e-02, -4.92543019e-02, 1.51845487e-02, -3.16929221e-02,\n",
347 | " -8.34875926e-03, 3.88450595e-03, 2.22045258e-02, -1.40876393e-03,\n",
348 | " -7.76403677e-03, -4.86251805e-03, 1.07476804e-02, -3.12193036e-02,\n",
349 | " -6.47490658e-03, 6.52603339e-03, -6.92657232e-02, -8.32433533e-03,\n",
350 | " -2.90824063e-02, 2.80573908e-02, -1.44029176e-02, -2.74115168e-02,\n",
351 | " 8.80907103e-03, -2.38782819e-02, -2.17266306e-02, -1.49507588e-03,\n",
352 | " -1.51111158e-02, -3.38777937e-02, 6.31595962e-03, 1.08988711e-03,\n",
353 | " -6.98582409e-03, -1.74204540e-02, -5.17525058e-03, -4.33116825e-03,\n",
354 | " 3.48056480e-02, -1.57557130e-02, -1.89108420e-02, 1.63334180e-02,\n",
355 | " 9.56729531e-01, 9.45391357e-01, 9.98229682e-01, 9.59797919e-01,\n",
356 | " 9.49455738e-01, 9.63351011e-01, 9.53696728e-01, 9.76490974e-01,\n",
357 | " 9.74310756e-01, 9.35222685e-01, 9.82339442e-01, 9.58186030e-01,\n",
358 | " 9.52718437e-01, 9.77271438e-01, 9.82989073e-01, 9.70198333e-01,\n",
359 | " 9.44782257e-01, 9.81974900e-01, 9.76631701e-01, 9.62901890e-01,\n",
360 | " 9.61633742e-01, 9.80575323e-01, 9.95112896e-01, 9.74191010e-01,\n",
361 | " 8.99155557e-01, 9.69716847e-01, 9.75211620e-01, 9.70810771e-01,\n",
362 | " 9.30945098e-01, 9.51653421e-01, 9.44585562e-01, 9.75764215e-01,\n",
363 | " 9.48627055e-01, 1.00551558e+00, 9.26290691e-01, 9.79250968e-01,\n",
364 | " 9.45755124e-01, 9.27820683e-01, 9.56530571e-01, 9.46910143e-01,\n",
365 | " 9.79789317e-01, 9.95181978e-01, 9.84213948e-01, 9.14376676e-01,\n",
366 | " 9.78189111e-01, 9.80366051e-01, 9.66569126e-01, 9.43322301e-01,\n",
367 | " 9.73144233e-01, 9.69866872e-01, 9.79587495e-01, 9.67272520e-01,\n",
368 | " 9.45412815e-01, 9.51055467e-01, 9.43220496e-01, 9.55446303e-01,\n",
369 | " 9.58964765e-01, 9.67144132e-01, 9.71399426e-01, 9.80027735e-01,\n",
370 | " 9.39040601e-01, 9.52576995e-01, 9.63009894e-01, 9.76403177e-01,\n",
371 | " 9.62861955e-01, 9.98177826e-01, 1.00274062e+00, 9.73251939e-01,\n",
372 | " 9.54328954e-01, 9.86613452e-01, 9.68008280e-01, 9.27279234e-01,\n",
373 | " 9.59914386e-01, 9.77681994e-01, 9.84172463e-01, 9.76337492e-01,\n",
374 | " 9.73941267e-01, 9.65650499e-01, 9.30386364e-01, 9.66791689e-01,\n",
375 | " 9.38654304e-01, 9.73659039e-01, 9.10610318e-01, 9.70991790e-01,\n",
376 | " 9.55115199e-01, 9.65562522e-01, 9.27964747e-01, 9.82150376e-01,\n",
377 | " 9.66325939e-01, 9.63256419e-01, 9.67449665e-01, 9.97418702e-01,\n",
378 | " 9.73599851e-01, 9.55179393e-01, 9.68756020e-01, 9.45081055e-01,\n",
379 | " 9.84196603e-01, 9.71818149e-01, 9.82353091e-01, 9.88037884e-01,\n",
380 | " 9.69696879e-01, 9.31147516e-01, 9.73716676e-01, 9.65882421e-01,\n",
381 | " 9.73971784e-01, 9.73869681e-01, 9.37389433e-01, 9.85544026e-01,\n",
382 | " 9.57291663e-01, 1.00109446e+00, 9.87814486e-01, 9.64981675e-01,\n",
383 | " 9.51332510e-01, 9.47861433e-01, 9.76665258e-01, 9.80749130e-01,\n",
384 | " 9.77705956e-01, 9.35858786e-01, 9.66404438e-01, 9.91650522e-01,\n",
385 | " 9.71374214e-01, 9.49542403e-01, 9.73765552e-01, 9.72427309e-01,\n",
386 | " 1.02161956e+00, 9.74326730e-01, 9.14806843e-01, 9.87780273e-01,\n",
387 | " -3.81709571e-04, 8.85103550e-03, -1.06415683e-02, 1.46886632e-02,\n",
388 | " 1.13123478e-02, -1.13453213e-02, 6.10671379e-03, -1.35854864e-02,\n",
389 | " -8.37319531e-03, 3.80454469e-03, -1.52190244e-02, 1.98203903e-02,\n",
390 | " -8.12917762e-03, -6.78139459e-03, 1.41385887e-02, -4.11612075e-03,\n",
391 | " -1.78066944e-03, 1.69376063e-03, -7.45489215e-03, 7.21688336e-03,\n",
392 | " -3.93588468e-03, -1.02957431e-02, 9.24223743e-04, 5.47925523e-03,\n",
393 | " -3.16302618e-03, -5.90247754e-03, 1.44192493e-02, -1.11856153e-02,\n",
394 | " 1.29749626e-03, 1.29607593e-04, -5.56932529e-03, -1.04591800e-02,\n",
395 | " -2.23989855e-03, -1.93906333e-02, -4.06855019e-03, -9.14807897e-03,\n",
396 | " -6.03628205e-03, -2.14859168e-03, 8.32902966e-04, 2.84192967e-03,\n",
397 | " -9.86028090e-03, 1.58460215e-02, -2.07921467e-03, -8.96150805e-03,\n",
398 | " 2.74651404e-03, 9.52508068e-04, -4.93401289e-03, -2.92146578e-03,\n",
399 | " -4.68820101e-03, -2.28525372e-03, -1.11524761e-02, -7.90379383e-03,\n",
400 | " 1.35774016e-02, 1.24521097e-02, -3.70075274e-03, 6.67840056e-03,\n",
401 | " -4.67442954e-03, 7.48345954e-03, -1.07925795e-02, -6.23191358e-04,\n",
402 | " -5.43362927e-03, -2.60429340e-03, 1.03946747e-02, 9.88052413e-03,\n",
403 | " 7.96648301e-03, -1.15933241e-02, -1.27530769e-02, -9.81584843e-03,\n",
404 | " -7.40378629e-03, -1.90639682e-02, 8.56355205e-03, 1.64131203e-03,\n",
405 | " 8.22841190e-03, -6.52892003e-03, 1.15769869e-02, -2.42536329e-03,\n",
406 | " -6.08763983e-03, 6.55062683e-03, 5.93312457e-03, -1.10119162e-02,\n",
407 | " 1.90382788e-03, 1.84075907e-03, -2.26600934e-03, -5.62858582e-03,\n",
408 | " -1.41956727e-03, -3.10504832e-03, 5.51183894e-03, -6.72546029e-03,\n",
409 | " 3.66157619e-03, 2.22921092e-03, 7.04695703e-04, -1.17116524e-02,\n",
410 | " 5.34590287e-03, -2.91862967e-03, -8.15753825e-03, 1.89752725e-03,\n",
411 | " -4.28805733e-03, 1.02453260e-02, -8.37024022e-03, -5.67699177e-03,\n",
412 | " 4.42735665e-03, 4.86013340e-03, 1.46266259e-02, 8.65715556e-04,\n",
413 | " 1.21052852e-02, 1.23288110e-03, -3.45272897e-03, -1.08888466e-02,\n",
414 | " 3.93830426e-03, 1.32852430e-02, -3.54361744e-03, -6.20762166e-03,\n",
415 | " -1.17807910e-02, -3.79850762e-03, 6.02782937e-03, -1.65751092e-02,\n",
416 | " -2.94425339e-03, -4.16631438e-03, 1.46815728e-05, 1.68641866e-03,\n",
417 | " -4.70905472e-03, -4.08268999e-04, -4.06326866e-03, -1.01857549e-02,\n",
418 | " -1.58590134e-02, 9.88711789e-03, -7.53058295e-04, 2.04539392e-02,\n",
419 | " -3.54306102e-02, -3.99206579e-02, 1.74986850e-02, -2.59642750e-02,\n",
420 | " -3.77055752e-04, -1.79521050e-02, -4.18070965e-02, -1.56056546e-02,\n",
421 | " 1.42939924e-03, -6.71001524e-02, 5.38047263e-03, 1.40461950e-02,\n",
422 | " -3.13856117e-02, -1.23721771e-02, -4.40635206e-03, -2.29710117e-02,\n",
423 | " -5.13940230e-02, -8.38549342e-03, -4.77516383e-04, -1.38966171e-02,\n",
424 | " -1.69352889e-02, -2.67042487e-05, 2.64742561e-02, -6.23752538e-04,\n",
425 | " -7.67138600e-02, -2.69478075e-02, 2.54217591e-02, -1.83219016e-02,\n",
426 | " -5.03241271e-02, 6.93464652e-03, -4.40837853e-02, -1.65122785e-02,\n",
427 | " -3.65746841e-02, 2.73051746e-02, -3.94098274e-02, 1.31772924e-03,\n",
428 | " -4.49885391e-02, -6.19527213e-02, -5.52342720e-02, -1.48430802e-02,\n",
429 | " 2.30715852e-02, 4.09209393e-02, 7.96316098e-03, -3.79416011e-02,\n",
430 | " -6.00904319e-03, -5.69068315e-03, -2.53173374e-02, 2.67025898e-04,\n",
431 | " -9.06006154e-03, -1.39681399e-02, 3.58832777e-02, -2.57660565e-03,\n",
432 | " -1.12442523e-02, -3.79888527e-02, -4.76600081e-02, 1.57052800e-02,\n",
433 | " -6.59479154e-03, -1.28766578e-02, 3.17066349e-02, -4.35156263e-02,\n",
434 | " -5.05588688e-02, -1.79391298e-02, -4.28052731e-02, 3.51695940e-02,\n",
435 | " 5.65348845e-03, 2.17280276e-02, 4.90195164e-03, -5.61992265e-03,\n",
436 | " 1.18372003e-02, -1.69737339e-02, -2.67676134e-02, -8.50393027e-02,\n",
437 | " -1.75091252e-02, -5.71432756e-03, -5.47221163e-03, -9.66549013e-03,\n",
438 | " -1.08143305e-02, -1.99848618e-02, 1.22896601e-02, -2.15724576e-03,\n",
439 | " -1.79953557e-02, -2.05608457e-02, -5.49047217e-02, -2.96108816e-02,\n",
440 | " -1.53377848e-02, -1.29916631e-02, -3.07457522e-02, 1.86230370e-03,\n",
441 | " -7.96250999e-03, -1.11111728e-02, 8.88452050e-04, 1.00751556e-02,\n",
442 | " 1.53939109e-02, -4.97993194e-02, 2.32874695e-02, -3.20563950e-02,\n",
443 | " -1.05730677e-02, 6.28419966e-03, 2.44978759e-02, -2.68546422e-03,\n",
444 | " -2.26519839e-03, -1.07720960e-02, 1.92789212e-02, -3.12478468e-02,\n",
445 | " -1.60006457e-03, 6.84449263e-03, -7.06885755e-02, -1.00259120e-02,\n",
446 | " -2.96708103e-02, 3.50511968e-02, -1.77915487e-02, -2.05699261e-02,\n",
447 | " 1.19508235e-02, -1.98767446e-02, -2.44157352e-02, 6.34009717e-03,\n",
448 | " -1.69769954e-02, -3.57292853e-02, 1.34808198e-02, -7.75094551e-04,\n",
449 | " -7.33640697e-03, -2.19425857e-02, -7.27383234e-03, -4.86379117e-03,\n",
450 | " 2.83152778e-02, -1.49833318e-02, -9.58317798e-03, 1.78983696e-02],\n",
451 | " dtype=float32),\n",
452 | " array([[ 0.06355544, 0.07832399, 0.16078195, ..., 0.10843943,\n",
453 | " -0.00406908, 0.05296046],\n",
454 | " [ 0.0416122 , -0.01382835, 0.20560463, ..., 0.04545842,\n",
455 | " 0.10319187, 0.01695581],\n",
456 | " [ 0.08521511, 0.0360985 , 0.09550186, ..., 0.156339 ,\n",
457 | " -0.0771867 , -0.00863549],\n",
458 | " ...,\n",
459 | " [ 0.02114338, -0.0751447 , -0.16649075, ..., -0.04536337,\n",
460 | " -0.07391482, -0.10807986],\n",
461 | " [-0.00391077, -0.06944872, -0.13373116, ..., -0.08819646,\n",
462 | " -0.07002177, -0.04465593],\n",
463 | " [-0.11471328, 0.01142035, -0.13923678, ..., -0.19934858,\n",
464 | " -0.09494537, -0.12171682]], dtype=float32),\n",
465 | " array([[-0.08688223, 0.02145691, 0.12471917, ..., 0.05015749,\n",
466 | " 0.06122041, 0.02965781],\n",
467 | " [-0.09422395, -0.02273887, -0.02288393, ..., -0.05929275,\n",
468 | " -0.01136553, -0.04991761],\n",
469 | " [-0.04290146, -0.07660959, -0.20239566, ..., 0.06898481,\n",
470 | " 0.09709524, 0.05520569],\n",
471 | " ...,\n",
472 | " [ 0.02588722, -0.03129688, -0.07318392, ..., 0.01438368,\n",
473 | " 0.02559766, 0.06242995],\n",
474 | " [ 0.07330567, -0.03976078, 0.10107688, ..., -0.11538383,\n",
475 | " 0.06238476, 0.01336663],\n",
476 | " [-0.09471766, -0.04004548, -0.0775513 , ..., 0.03972678,\n",
477 | " -0.0030373 , -0.08053348]], dtype=float32),\n",
478 | " array([-7.16793984e-02, -4.15719822e-02, -6.84623942e-02, -1.08012602e-01,\n",
479 | " -5.14338911e-02, -7.80883133e-02, -1.15547732e-01, -5.10916784e-02,\n",
480 | " -6.96225539e-02, -6.33873716e-02, 1.83847286e-02, -6.29061610e-02,\n",
481 | " -1.71938271e-03, -2.45866645e-02, -3.73672955e-02, -8.51028636e-02,\n",
482 | " -5.06807715e-02, -1.63219832e-02, -4.83440906e-02, -5.14871441e-02,\n",
483 | " -4.96179610e-02, -5.32084852e-02, -1.18552089e-01, -5.40971532e-02,\n",
484 | " -7.35526830e-02, -4.25771698e-02, -6.95929155e-02, -6.04436137e-02,\n",
485 | " -1.08962752e-01, -6.45915419e-02, -9.34795588e-02, -7.10829869e-02,\n",
486 | " -3.69148068e-02, -8.75838622e-02, -3.73307094e-02, -2.31548734e-02,\n",
487 | " -8.31677094e-02, -5.15503623e-02, -7.04921186e-02, -6.27154186e-02,\n",
488 | " -6.51084110e-02, -4.01620232e-02, -3.46078612e-02, -4.62016724e-02,\n",
489 | " -1.29403826e-02, -3.64272632e-02, -4.86711375e-02, 2.29896232e-02,\n",
490 | " -2.60517951e-02, -7.44541436e-02, -9.68247280e-02, -4.31389473e-02,\n",
491 | " -5.99452890e-02, -6.95601627e-02, -2.64166165e-02, -3.39374840e-02,\n",
492 | " -7.23912790e-02, -1.44642606e-01, -3.23183164e-02, -8.38416368e-02,\n",
493 | " -6.07848167e-02, -5.41434176e-02, -6.67206645e-02, -5.47031797e-02,\n",
494 | " -3.84647660e-02, -5.59726171e-02, -6.65299073e-02, -7.49108195e-02,\n",
495 | " -1.38884233e-02, -2.69307867e-02, -4.97939326e-02, -6.76172376e-02,\n",
496 | " -9.36961994e-02, -1.23803586e-01, -5.12889996e-02, -1.72890007e-01,\n",
497 | " -9.25109759e-02, -1.28880255e-02, -2.25379579e-02, -2.81395186e-02,\n",
498 | " -5.21033211e-03, -7.36981779e-02, -6.03808984e-02, -5.19053452e-02,\n",
499 | " -3.90435643e-02, -5.96590340e-02, -1.26945265e-02, -1.01337902e-01,\n",
500 | " -2.52681784e-02, -1.00661054e-01, -7.36837611e-02, -5.73205613e-02,\n",
501 | " -6.27888963e-02, -2.61751954e-02, -1.51400454e-02, -1.88649017e-02,\n",
502 | " -5.43511771e-02, -4.10514772e-02, -2.85639204e-02, -3.69751523e-03,\n",
503 | " -3.23245376e-02, -1.39361367e-01, -4.03894447e-02, -7.31107444e-02,\n",
504 | " -4.67068516e-03, -8.02552924e-02, -4.06017490e-02, -1.86391585e-02,\n",
505 | " -7.19779655e-02, -4.92056385e-02, -7.28462040e-02, -3.93975154e-02,\n",
506 | " -3.71646509e-02, -3.55111472e-02, -3.07158027e-02, -4.52588089e-02,\n",
507 | " -1.29687106e-02, -1.59220949e-01, -5.13823405e-02, -4.38464545e-02,\n",
508 | " -8.12994391e-02, -3.51659507e-02, -7.32382387e-02, -4.79816571e-02,\n",
509 | " -4.98812348e-02, -2.07491852e-02, -4.72525926e-03, -4.61642584e-03,\n",
510 | " 9.35774267e-01, 9.53137457e-01, 8.97251427e-01, 8.95372629e-01,\n",
511 | " 9.70344722e-01, 9.11213517e-01, 8.78995597e-01, 9.32688057e-01,\n",
512 | " 9.39038038e-01, 9.46145833e-01, 1.06364381e+00, 9.38554227e-01,\n",
513 | " 1.03305244e+00, 1.00642753e+00, 1.00397670e+00, 9.26249862e-01,\n",
514 | " 9.41133797e-01, 1.01922023e+00, 9.79169905e-01, 9.78172958e-01,\n",
515 | " 9.61819768e-01, 9.77857590e-01, 9.23036814e-01, 9.27186072e-01,\n",
516 | " 9.36981261e-01, 9.72430706e-01, 9.29110110e-01, 9.20395851e-01,\n",
517 | " 9.01230454e-01, 9.29345667e-01, 8.68173778e-01, 9.35410559e-01,\n",
518 | " 9.78311241e-01, 8.88684571e-01, 9.51382279e-01, 1.01443446e+00,\n",
519 | " 8.97147954e-01, 9.26165044e-01, 9.38287497e-01, 9.30931151e-01,\n",
520 | " 9.22194779e-01, 9.87567544e-01, 9.40079629e-01, 9.32054579e-01,\n",
521 | " 1.03716195e+00, 9.86252725e-01, 9.72340584e-01, 9.78992701e-01,\n",
522 | " 1.00190604e+00, 9.35558021e-01, 9.07413304e-01, 9.33339059e-01,\n",
523 | " 9.20668781e-01, 8.94614100e-01, 1.02391684e+00, 9.78495896e-01,\n",
524 | " 9.24094796e-01, 8.48539233e-01, 9.72380221e-01, 8.95383418e-01,\n",
525 | " 9.40831959e-01, 9.55799580e-01, 9.32601511e-01, 9.27828074e-01,\n",
526 | " 9.77661192e-01, 9.59395468e-01, 8.61108482e-01, 9.17160273e-01,\n",
527 | " 1.02989924e+00, 9.33297873e-01, 9.31142032e-01, 9.32413340e-01,\n",
528 | " 8.98503661e-01, 8.25632095e-01, 9.63135123e-01, 8.10915053e-01,\n",
529 | " 9.15849030e-01, 1.02307200e+00, 9.94736731e-01, 1.00267076e+00,\n",
530 | " 1.04061031e+00, 9.31079686e-01, 9.49882507e-01, 9.32492197e-01,\n",
531 | " 9.71755564e-01, 9.20790374e-01, 1.02127576e+00, 9.06574309e-01,\n",
532 | " 1.01649415e+00, 8.50874543e-01, 9.07697141e-01, 9.38857555e-01,\n",
533 | " 9.66193438e-01, 1.00204968e+00, 1.02611840e+00, 1.00754440e+00,\n",
534 | " 9.54348207e-01, 9.75895822e-01, 9.73143816e-01, 1.03868759e+00,\n",
535 | " 9.99414980e-01, 8.63768697e-01, 9.70534623e-01, 9.40110505e-01,\n",
536 | " 1.03802097e+00, 9.54748929e-01, 9.93623137e-01, 1.01800311e+00,\n",
537 | " 9.49599802e-01, 9.77124035e-01, 9.28310096e-01, 9.96616721e-01,\n",
538 | " 9.56614673e-01, 9.63645339e-01, 9.79392111e-01, 9.73570406e-01,\n",
539 | " 9.39075172e-01, 8.51372242e-01, 9.50680494e-01, 9.90454257e-01,\n",
540 | " 8.99973154e-01, 9.93453741e-01, 9.04049933e-01, 9.49960232e-01,\n",
541 | " 9.52077210e-01, 9.66409326e-01, 9.62354779e-01, 1.03351653e+00,\n",
542 | " 1.38578825e-02, -1.05891526e-02, -1.91221200e-02, 1.48506751e-02,\n",
543 | " -1.47551689e-02, 1.44137954e-02, -2.31966488e-02, -1.97903160e-02,\n",
544 | " -3.29332729e-03, -1.70787312e-02, -2.03434955e-02, 6.67295838e-03,\n",
545 | " -1.94868874e-02, 2.15328261e-02, -1.64179895e-02, 1.63245350e-02,\n",
546 | " 7.92171992e-03, -1.77886020e-02, 1.56465638e-02, 6.23885076e-03,\n",
547 | " -1.92956552e-02, -2.26227865e-02, -1.69150010e-02, -2.39506969e-03,\n",
548 | " -2.27627326e-02, -1.94955673e-02, -1.46283535e-02, -8.37412197e-03,\n",
549 | " -1.77788027e-02, 1.65610481e-02, -1.51076643e-02, 1.59222391e-02,\n",
550 | " -1.49295572e-02, 1.34449173e-02, 1.95637625e-02, -1.31253097e-02,\n",
551 | " -2.70640049e-02, -1.82021745e-02, -1.87491942e-02, 1.15108788e-02,\n",
552 | " -1.92237180e-02, 2.51893396e-03, -2.50251014e-02, -2.14331783e-02,\n",
553 | " 1.84129924e-02, -1.39209097e-02, -1.43081220e-02, 1.85718667e-02,\n",
554 | " -1.83001701e-02, -2.74283178e-02, -2.27442104e-02, -1.65592041e-02,\n",
555 | " 8.97226483e-03, 2.79641394e-02, 1.51545126e-02, -1.49994344e-02,\n",
556 | " 1.61969289e-02, -2.20211204e-02, -1.11518074e-02, -1.41983377e-02,\n",
557 | " 3.80480080e-03, -6.15887064e-03, -1.91997513e-02, -1.12296883e-02,\n",
558 | " 1.58483237e-02, 1.40495235e-02, -1.09075261e-02, -1.54760228e-02,\n",
559 | " -1.69905163e-02, -6.53833710e-03, 1.18178930e-02, 1.28323222e-02,\n",
560 | " -3.15730576e-03, 1.77910887e-02, 1.96012352e-02, 1.99581087e-02,\n",
561 | " 2.50584502e-02, 2.43883692e-02, -1.43640237e-02, 1.09561849e-02,\n",
562 | " -1.10785766e-02, 2.16925051e-02, -6.23802748e-03, -2.14090738e-02,\n",
563 | " 1.95576232e-02, 3.52995633e-03, -2.17541978e-02, 1.54962232e-02,\n",
564 | " 1.43309515e-02, 2.22967491e-02, 2.23280527e-02, -2.95864698e-03,\n",
565 | " -1.68008916e-02, 1.03148567e-02, 2.02620998e-02, -2.09954046e-02,\n",
566 | " 1.31110046e-02, -9.22653265e-03, 7.40055973e-03, 1.95608214e-02,\n",
567 | " -1.71532389e-02, 1.17439171e-02, 1.08253472e-02, -3.21419747e-03,\n",
568 | " 1.41027477e-02, -1.24281766e-02, 1.13951312e-02, 1.99904982e-02,\n",
569 | " 1.90317109e-02, -1.72216147e-02, -1.69647150e-02, -1.59426481e-02,\n",
570 | " -2.27415692e-02, 9.75866336e-03, 1.29213007e-02, -1.29374610e-02,\n",
571 | " -1.98693550e-03, -2.48476975e-02, 1.10245226e-02, 8.34720035e-04,\n",
572 | " -1.14041353e-02, -1.51484516e-02, 1.54193640e-02, -1.24025615e-02,\n",
573 | " 1.65565740e-02, 1.12104742e-02, 6.90079527e-03, 1.79194361e-02,\n",
574 | " -7.08242208e-02, -4.31619100e-02, -5.04342206e-02, -1.11042239e-01,\n",
575 | " -4.41470183e-02, -7.83439130e-02, -1.15179352e-01, -5.70478402e-02,\n",
576 | " -6.83519393e-02, -6.56170771e-02, 2.17690710e-02, -6.87570572e-02,\n",
577 | " 7.43615767e-03, -2.25720834e-02, -3.50502245e-02, -8.36781934e-02,\n",
578 | " -5.02644368e-02, -1.46484124e-02, -4.67963852e-02, -5.01325764e-02,\n",
579 | " -5.04450686e-02, -5.76552898e-02, -1.20116450e-01, -5.35401143e-02,\n",
580 | " -7.58939534e-02, -4.23228368e-02, -6.56295344e-02, -5.87519966e-02,\n",
581 | " -1.09971724e-01, -5.91517054e-02, -9.45704803e-02, -7.17268363e-02,\n",
582 | " -3.85567099e-02, -8.48686397e-02, -2.11663265e-02, -1.77251697e-02,\n",
583 | " -9.10936370e-02, -5.83163872e-02, -7.00889304e-02, -6.17094561e-02,\n",
584 | " -6.38765544e-02, -4.00147699e-02, -2.79661771e-02, -4.52192985e-02,\n",
585 | " -1.30439587e-02, -3.69204134e-02, -4.70331572e-02, 4.64347973e-02,\n",
586 | " -2.46198885e-02, -7.87583068e-02, -9.98397470e-02, -4.50663008e-02,\n",
587 | " -5.97225763e-02, -6.90280870e-02, -1.70852561e-02, -3.37837376e-02,\n",
588 | " -7.23201483e-02, -1.42704517e-01, -2.77064294e-02, -7.73345903e-02,\n",
589 | " -6.18195646e-02, -5.79780042e-02, -7.12114051e-02, -4.90729585e-02,\n",
590 | " -4.04072367e-02, -5.48446253e-02, -4.06567156e-02, -8.24714527e-02,\n",
591 | " -8.59836955e-03, -2.87848655e-02, -3.58696692e-02, -6.84108213e-02,\n",
592 | " -9.42396149e-02, -1.03657544e-01, -5.65150976e-02, -1.76116198e-01,\n",
593 | " -9.69503894e-02, -8.36467370e-03, -2.28795409e-02, -2.87235286e-02,\n",
594 | " -5.10341561e-05, -7.48265013e-02, -6.01938367e-02, -5.47612756e-02,\n",
595 | " -3.77737768e-02, -5.12269624e-02, -1.03809740e-02, -1.01642154e-01,\n",
596 | " -1.93958245e-02, -1.01194613e-01, -7.57263750e-02, -5.89633957e-02,\n",
597 | " -5.65518327e-02, -2.41656378e-02, -5.91644458e-03, -1.61138941e-02,\n",
598 | " -5.44840619e-02, -4.23141159e-02, -2.65542306e-02, 2.07266188e-03,\n",
599 | " -3.26631479e-02, -1.40723258e-01, -4.17331643e-02, -6.02001101e-02,\n",
600 | " -2.98691960e-03, -7.18837529e-02, -3.84078771e-02, -1.55303627e-02,\n",
601 | " -6.29521385e-02, -4.63734753e-02, -7.09468797e-02, -3.71973589e-02,\n",
602 | " -4.45895717e-02, -3.56948823e-02, -3.11661754e-02, -4.70641814e-02,\n",
603 | " 1.18021294e-02, -1.60789385e-01, -5.35478480e-02, -4.30749655e-02,\n",
604 | " -8.12940598e-02, -3.71371284e-02, -8.99619833e-02, -4.86796051e-02,\n",
605 | " -5.00846691e-02, -1.91553533e-02, -6.59319293e-03, -5.93757315e-04],\n",
606 | " dtype=float32),\n",
607 | " array([[-0.0713004 , 0.12274464, -0.02350219, ..., 0.00664587,\n",
608 | " 0.02502706, 0.04813394],\n",
609 | " [-0.0896517 , 0.04741639, 0.10243201, ..., 0.07727836,\n",
610 | " 0.06204639, -0.06138038],\n",
611 | " [ 0.03938958, 0.06321952, 0.02411073, ..., 0.02907597,\n",
612 | " -0.12459963, -0.12003688],\n",
613 | " ...,\n",
614 | " [ 0.11942392, -0.02451244, 0.08363792, ..., 0.03482716,\n",
615 | " 0.14105384, 0.1293355 ],\n",
616 | " [ 0.02452879, 0.01712959, -0.09490503, ..., -0.13678424,\n",
617 | " -0.0666692 , -0.07746021],\n",
618 | " [-0.00676717, 0.01884836, -0.08304276, ..., -0.09870892,\n",
619 | " -0.00292641, -0.033502 ]], dtype=float32),\n",
620 | " array([[ 0.09470616, -0.08678675, -0.03212385, ..., 0.00238637,\n",
621 | " 0.03616362, 0.0280148 ],\n",
622 | " [-0.00300044, 0.00327112, -0.02678528, ..., 0.0217937 ,\n",
623 | " 0.07545257, 0.13455415],\n",
624 | " [-0.03898003, 0.00035783, 0.04758789, ..., -0.06376951,\n",
625 | " -0.07266227, -0.02776853],\n",
626 | " ...,\n",
627 | " [ 0.00841846, -0.0402837 , -0.08233275, ..., 0.03467233,\n",
628 | " -0.05760959, -0.02927889],\n",
629 | " [-0.00826381, -0.0572143 , -0.01139491, ..., -0.10500748,\n",
630 | " 0.00911033, -0.06388084],\n",
631 | " [-0.0846457 , -0.11517596, 0.01114641, ..., -0.01158612,\n",
632 | " 0.01965757, 0.06901938]], dtype=float32),\n",
633 | " array([-2.28893179e-02, -5.85289970e-02, -4.66832295e-02, -5.60659170e-02,\n",
634 | " -7.33553320e-02, -4.63167839e-02, -7.05779865e-02, -9.26942155e-02,\n",
635 | " -2.41438784e-02, -3.51777785e-02, -3.06019075e-02, -4.51006591e-02,\n",
636 | " -8.59275982e-02, -3.24670002e-02, -7.05388263e-02, -4.28729281e-02,\n",
637 | " -4.49061878e-02, -6.21839277e-02, -5.21446317e-02, -4.87463288e-02,\n",
638 | " -7.43624866e-02, -5.60029037e-02, -8.00249726e-02, -7.88187608e-02,\n",
639 | " -8.29362869e-02, -6.05227426e-02, -3.81795913e-02, -6.00090735e-02,\n",
640 | " -7.29672164e-02, -6.78697005e-02, -3.09665166e-02, -4.40529026e-02,\n",
641 | " -7.18111172e-02, -1.96745936e-02, -7.70709142e-02, -6.54298216e-02,\n",
642 | " -4.38749008e-02, -9.38344300e-02, -8.61070752e-02, -4.01978344e-02,\n",
643 | " -8.11016858e-02, -4.54812348e-02, -4.78812642e-02, -3.60166021e-02,\n",
644 | " -9.64276195e-02, -3.54668200e-02, -4.19971384e-02, -5.88696636e-02,\n",
645 | " -5.73225506e-02, -6.85039833e-02, -4.35130820e-02, -5.46753928e-02,\n",
646 | " -4.21778001e-02, -6.37698397e-02, -8.80134329e-02, -5.20209260e-02,\n",
647 | " -7.21287876e-02, -8.15817863e-02, -6.48432896e-02, -4.37571183e-02,\n",
648 | " -6.88381866e-02, -8.62596631e-02, -8.31576660e-02, -7.28439689e-02,\n",
649 | " 9.78309333e-01, 9.49949563e-01, 9.59375799e-01, 9.55128431e-01,\n",
650 | " 9.27140474e-01, 9.59907889e-01, 9.56085801e-01, 9.12190020e-01,\n",
651 | " 9.73837078e-01, 9.73705113e-01, 9.65834260e-01, 9.60022867e-01,\n",
652 | " 9.20716524e-01, 9.69631553e-01, 9.31945920e-01, 9.63129461e-01,\n",
653 | " 9.58169580e-01, 9.44110632e-01, 9.50391412e-01, 9.62349474e-01,\n",
654 | " 9.36221242e-01, 9.48942125e-01, 9.26928043e-01, 9.21503186e-01,\n",
655 | " 9.16104496e-01, 9.46321368e-01, 9.64529395e-01, 9.37282145e-01,\n",
656 | " 9.36214626e-01, 9.36970949e-01, 9.70690191e-01, 9.63807881e-01,\n",
657 | " 9.34521377e-01, 9.84581232e-01, 9.38461185e-01, 9.43751156e-01,\n",
658 | " 9.59032178e-01, 9.29565609e-01, 9.28113818e-01, 9.65659976e-01,\n",
659 | " 9.37950552e-01, 9.56670702e-01, 9.56716955e-01, 9.68040884e-01,\n",
660 | " 9.17294383e-01, 9.69253540e-01, 9.63573992e-01, 9.39656198e-01,\n",
661 | " 9.47120309e-01, 9.33715463e-01, 9.61356163e-01, 9.52218950e-01,\n",
662 | " 9.57602024e-01, 9.46048677e-01, 9.20420170e-01, 9.50185239e-01,\n",
663 | " 9.36957181e-01, 9.30698812e-01, 9.49399233e-01, 9.59793508e-01,\n",
664 | " 9.37834382e-01, 9.22817111e-01, 9.21872616e-01, 9.28634703e-01,\n",
665 | " 1.10717416e-02, -1.98366940e-02, 1.35573819e-02, 6.11790409e-03,\n",
666 | " -2.94593330e-02, 3.64312083e-02, -9.53952316e-04, 6.86745625e-04,\n",
667 | " 6.65780576e-03, 2.26335377e-02, -3.15952711e-02, -8.10754718e-04,\n",
668 | " 1.07485149e-02, -1.48763796e-02, -3.72752473e-02, 5.22700790e-03,\n",
669 | " -5.81257511e-03, 8.41069687e-03, 1.43840378e-02, 5.29026100e-03,\n",
670 | " 1.46082854e-02, 1.77569240e-02, 3.97329452e-03, 9.98333003e-03,\n",
671 | " 6.99869310e-03, 1.69532988e-02, 2.98659666e-03, -1.90581996e-02,\n",
672 | " -9.40379454e-04, -2.59579178e-02, -7.26896385e-03, -1.55300042e-02,\n",
673 | " 8.36694241e-03, -2.37148628e-02, -5.80249878e-04, -1.43576425e-03,\n",
674 | " -1.15806665e-02, 4.75651305e-03, -1.55318649e-02, -4.53512603e-03,\n",
675 | " 2.94596120e-03, -3.18335406e-02, 1.55976013e-04, 1.98691171e-02,\n",
676 | " 9.86786187e-03, -4.99999570e-03, -1.21941091e-02, -3.30577232e-03,\n",
677 | " -1.68771911e-02, -9.75944661e-03, -1.56822558e-02, 5.75864129e-03,\n",
678 | " 1.28995432e-02, -1.78978462e-02, 1.80537638e-03, -1.15379971e-02,\n",
679 | " -2.34480412e-03, 9.52599756e-03, 4.57163854e-03, 6.06518472e-03,\n",
680 | " 6.97467988e-03, 2.42081820e-03, 2.95456108e-02, 1.20767485e-02,\n",
681 | " -2.82426700e-02, -5.68718016e-02, -4.12492789e-02, -5.34842387e-02,\n",
682 | " -7.29165822e-02, -4.21997234e-02, -4.94927578e-02, -9.10553262e-02,\n",
683 | " -2.77719162e-02, -3.02026123e-02, -3.40790413e-02, -3.46829630e-02,\n",
684 | " -8.60827789e-02, -2.42659915e-02, -7.17368647e-02, -4.17484716e-02,\n",
685 | " -4.71368171e-02, -5.49145490e-02, -4.79412861e-02, -3.81037556e-02,\n",
686 | " -7.05275983e-02, -5.22350073e-02, -6.48369789e-02, -7.81647786e-02,\n",
687 | " -7.88003728e-02, -5.51349185e-02, -3.87750342e-02, -6.08086735e-02,\n",
688 | " -6.59930333e-02, -6.57470003e-02, -3.11621744e-02, -3.28694880e-02,\n",
689 | " -6.59037307e-02, -1.71600617e-02, -6.83232918e-02, -4.00214680e-02,\n",
690 | " -4.44157422e-02, -8.51977915e-02, -8.01714584e-02, -3.88622880e-02,\n",
691 | " -7.12321326e-02, -3.94476652e-02, -4.16899920e-02, -3.46028209e-02,\n",
692 | " -9.31475163e-02, -2.63635274e-02, -3.25482413e-02, -5.61934784e-02,\n",
693 | " -3.81420217e-02, -6.64208010e-02, -3.83012258e-02, -4.15582471e-02,\n",
694 | " -3.54507975e-02, -6.03758991e-02, -9.08010304e-02, -4.83720824e-02,\n",
695 | " -6.37759417e-02, -7.26469681e-02, -4.49242815e-02, -4.24377695e-02,\n",
696 | " -6.68759719e-02, -8.22376534e-02, -8.58968645e-02, -7.30406940e-02],\n",
697 | " dtype=float32),\n",
698 | " array([[-0.01887825, -0.06977708, 0.11970701, ..., -0.04651228,\n",
699 | " -0.06939306, 0.08715115],\n",
700 | " [ 0.11554077, 0.08088007, 0.04742007, ..., -0.02761068,\n",
701 | " -0.16364147, -0.08966529],\n",
702 | " [-0.10345326, -0.14326252, -0.02295549, ..., -0.04528121,\n",
703 | " 0.04611645, 0.04834072],\n",
704 | " ...,\n",
705 | " [ 0.00208994, 0.04163339, -0.00090946, ..., -0.05785042,\n",
706 | " -0.02157852, 0.04601119],\n",
707 | " [ 0.02292334, 0.01308324, -0.00773633, ..., 0.03773192,\n",
708 | " -0.08945257, -0.18432961],\n",
709 | " [ 0.10129703, -0.06119158, -0.11688493, ..., -0.07989626,\n",
710 | " 0.00905442, -0.07730512]], dtype=float32),\n",
711 | " array([[-0.0471104 , -0.00768661, -0.06336494, ..., 0.03845741,\n",
712 | " 0.00783754, 0.03857947],\n",
713 | " [-0.03947123, -0.01834715, -0.04376094, ..., 0.04169813,\n",
714 | " 0.0394429 , -0.01571208],\n",
715 | " [-0.00510062, -0.00744471, -0.00105934, ..., 0.0636677 ,\n",
716 | " 0.09001381, 0.06129375],\n",
717 | " ...,\n",
718 | " [ 0.07598845, -0.06669033, 0.01840958, ..., 0.0217731 ,\n",
719 | " -0.01576392, 0.10232896],\n",
720 | " [ 0.02081851, -0.08279958, 0.1184071 , ..., 0.00389871,\n",
721 | " -0.07648397, 0.08365794],\n",
722 | " [-0.05969255, -0.00372885, 0.09949125, ..., -0.01212646,\n",
723 | " 0.00106808, -0.0591018 ]], dtype=float32),\n",
724 | " array([-3.66426446e-02, -5.51243462e-02, -4.44541685e-02, -2.52144504e-02,\n",
725 | " -5.12705296e-02, -2.93319765e-02, -6.45157844e-02, -4.66785021e-02,\n",
726 | " -4.42754105e-02, -3.26002948e-02, -3.47336791e-02, -5.62862232e-02,\n",
727 | " -1.64041966e-02, -1.21143209e-02, 1.14298034e-02, -1.75408684e-02,\n",
728 | " -2.47490834e-02, -2.05691699e-02, -2.35802047e-02, -1.21640071e-01,\n",
729 | " -1.36824383e-04, -3.54730561e-02, -6.60893917e-02, -3.16050984e-02,\n",
730 | " -1.70192644e-02, -5.46176173e-02, -3.85368466e-02, -4.22348864e-02,\n",
731 | " -4.16863449e-02, -2.60297153e-02, -1.19050883e-01, -5.71870506e-02,\n",
732 | " -1.33658480e-02, -1.82885248e-02, -1.13999806e-01, -2.63048336e-02,\n",
733 | " -3.24459299e-02, -4.70508449e-02, -2.68233865e-02, -5.70601411e-02,\n",
734 | " -4.03484814e-02, -2.68030278e-02, -4.33521979e-02, -2.18051393e-02,\n",
735 | " -3.22502218e-02, -3.09702829e-02, -5.85721545e-02, -5.09563535e-02,\n",
736 | " -2.73768976e-02, -5.56293018e-02, -4.02044170e-02, -3.21705863e-02,\n",
737 | " -1.02847002e-01, -1.58788767e-02, -2.80070975e-02, -5.40509708e-02,\n",
738 | " -1.32104293e-01, -9.03597753e-03, -3.20936888e-02, -1.01368420e-01,\n",
739 | " -1.96283795e-02, -2.90519744e-02, -2.75159646e-02, -4.58070412e-02,\n",
740 | " 1.03360164e+00, 9.56232607e-01, 9.42091346e-01, 1.04144275e+00,\n",
741 | " 9.99262452e-01, 9.70473349e-01, 1.02414191e+00, 1.00865626e+00,\n",
742 | " 1.02367854e+00, 1.02157593e+00, 1.01556730e+00, 9.72941160e-01,\n",
743 | " 1.03556907e+00, 1.00582159e+00, 9.16242659e-01, 1.04999566e+00,\n",
744 | " 1.04699397e+00, 9.97637987e-01, 9.52181935e-01, 1.11724651e+00,\n",
745 | " 1.01142025e+00, 1.01408041e+00, 9.71291780e-01, 1.02556980e+00,\n",
746 | " 1.06424677e+00, 9.66782391e-01, 1.05077267e+00, 1.04701626e+00,\n",
747 | " 1.03285980e+00, 1.04945385e+00, 1.02183700e+00, 9.97042716e-01,\n",
748 | " 9.63985026e-01, 1.04907405e+00, 8.71828556e-01, 1.03812706e+00,\n",
749 | " 1.02087820e+00, 9.73679781e-01, 1.03798819e+00, 9.65613544e-01,\n",
750 | " 9.42343414e-01, 1.05326927e+00, 1.00549972e+00, 9.77574170e-01,\n",
751 | " 9.99248266e-01, 1.02229607e+00, 9.56866980e-01, 1.01405942e+00,\n",
752 | " 1.01797080e+00, 9.56031621e-01, 1.02427495e+00, 9.75832224e-01,\n",
753 | " 9.67584670e-01, 1.01285553e+00, 1.04763055e+00, 1.11101234e+00,\n",
754 | " 8.75931740e-01, 1.03013098e+00, 9.84092951e-01, 1.01120055e+00,\n",
755 | " 1.05118585e+00, 9.96305108e-01, 1.02119553e+00, 9.03447926e-01,\n",
756 | " 4.63708420e-05, 7.91086257e-03, -8.01444240e-03, 3.97692844e-02,\n",
757 | " -6.53210981e-03, -4.52643782e-02, -4.82086390e-02, 1.33571308e-02,\n",
758 | " 1.24753099e-02, 9.53332242e-03, 4.55029868e-03, -1.67011982e-03,\n",
759 | " 1.00709144e-02, -1.59197208e-02, 2.51487531e-02, -1.50887035e-02,\n",
760 | " -1.51178148e-02, 6.19117217e-03, 3.62137556e-02, -3.47537198e-03,\n",
761 | " -2.48915758e-02, -7.15103559e-03, 4.93802689e-03, -6.91717630e-03,\n",
762 | " -2.51576956e-02, 1.24903815e-02, 2.64482833e-02, 6.53671054e-03,\n",
763 | " 3.69756147e-02, 2.05129925e-02, -2.95790397e-02, -4.09188448e-03,\n",
764 | " -2.33714655e-03, -3.39003396e-03, 2.12054849e-02, -6.62930822e-03,\n",
765 | " -2.65044030e-02, 2.20597945e-02, 8.11596122e-03, -2.07428578e-02,\n",
766 | " 5.67575265e-03, 2.16103941e-02, 4.03286749e-03, 3.72748412e-02,\n",
767 | " 1.07439840e-02, 1.28457202e-02, 2.77070925e-02, 1.46281151e-02,\n",
768 | " 1.57713294e-02, 3.33058983e-02, -3.42217349e-02, -1.43159078e-02,\n",
769 | " 2.95842960e-02, 5.41793881e-03, -8.28130520e-04, -4.71212678e-02,\n",
770 | " 1.01959966e-02, -1.30243842e-02, 2.45536454e-02, -2.15612445e-02,\n",
771 | " 1.02901477e-02, -5.11718867e-03, 3.49222943e-02, 8.77515995e-04,\n",
772 | " -1.59177091e-02, -5.52202836e-02, -4.70051318e-02, -2.23056134e-02,\n",
773 | " -3.14628072e-02, -1.94175951e-02, -3.99461836e-02, -1.37201780e-02,\n",
774 | " -3.29736397e-02, -2.69608628e-02, -2.65449081e-02, -5.61944321e-02,\n",
775 | " -7.02759763e-03, 4.91974351e-04, 2.32698675e-02, -7.48546736e-04,\n",
776 | " -8.80232733e-03, -2.26211492e-02, -1.52755911e-02, -2.22498588e-02,\n",
777 | " 1.11075500e-02, -2.44984906e-02, -4.25488204e-02, -2.43558213e-02,\n",
778 | " 1.63153594e-03, -5.38912229e-02, 2.54373415e-03, -4.66937711e-03,\n",
779 | " 2.99201137e-03, -2.07129288e-02, -3.13131027e-02, -4.73502241e-02,\n",
780 | " 8.75261519e-03, 1.00504514e-03, -1.10795185e-01, -5.51236514e-03,\n",
781 | " -2.12712307e-02, -5.02784550e-02, -1.57325119e-02, -4.94511090e-02,\n",
782 | " -3.44211310e-02, 6.75437390e-04, -4.27596346e-02, -8.22405238e-03,\n",
783 | " -8.57585296e-03, -1.14680240e-02, -5.71498685e-02, -4.38575447e-02,\n",
784 | " -2.21089390e-03, -5.25956824e-02, -2.33178567e-02, -2.01459061e-02,\n",
785 | " -7.90884197e-02, 6.00642641e-04, -5.70003816e-04, 4.43143956e-03,\n",
786 | " -1.27087981e-01, 3.12101888e-03, -2.55211461e-02, -5.56407012e-02,\n",
787 | " -9.64495447e-03, -2.62480825e-02, 2.52449675e-03, -4.73853461e-02],\n",
788 | " dtype=float32),\n",
789 | " array([[ 0.07505666, 0.06402622, -0.11078825, ..., -0.12451799,\n",
790 | " 0.12558348, 0.05233577],\n",
791 | " [ 0.14999351, -0.09445602, 0.05601509, ..., 0.08562315,\n",
792 | " -0.13590032, 0.01179127],\n",
793 | " [-0.03735239, 0.14920132, -0.01977091, ..., 0.11217168,\n",
794 | " 0.06707249, -0.12696634],\n",
795 | " ...,\n",
796 | " [ 0.05152626, 0.0413969 , -0.05841354, ..., -0.08575772,\n",
797 | " 0.06699349, 0.11734959],\n",
798 | " [-0.19014232, 0.00551147, -0.11632296, ..., -0.06384467,\n",
799 | " -0.17496112, -0.0466045 ],\n",
800 | " [ 0.11754652, 0.09803104, 0.03205966, ..., -0.15667023,\n",
801 | " -0.11039561, -0.1209601 ]], dtype=float32),\n",
802 | " array([ 0.00663646, 0.01500279, -0.03963555, -0.04675338, 0.0016065 ,\n",
803 | " -0.01329151, -0.04740306, -0.02884662, -0.0552247 , 0.02298482,\n",
804 | " -0.02356849, 0.00905259, -0.03928961, 0.00487946, 0.00756297,\n",
805 | " -0.05389287, -0.03644611, 0.01958988, -0.01690085, -0.02296226,\n",
806 | " -0.02934478, -0.0407522 , -0.01577823, -0.01522873, -0.08445927,\n",
807 | " -0.00363804, -0.03213322, -0.00419953, -0.02635506, -0.02961822,\n",
808 | " -0.05016376, -0.06339645, 0.0083609 , -0.05565426, -0.00302892,\n",
809 | " 0.01085183, 0.00173716, -0.03369003, 0.01890958, 0.0027798 ,\n",
810 | " 0.01772042, 0.00667819, -0.04998991, -0.03125491, -0.04077869,\n",
811 | " 0.0028753 , -0.02295871, -0.05984503, 0.00884045, 0.00950707,\n",
812 | " -0.04413578, -0.04442953, 0.00192504, 0.01559755, 0.00229057,\n",
813 | " -0.00411291, 0.00366815, -0.0291485 , -0.00090509, -0.0399253 ,\n",
814 | " -0.01504341, -0.01442915, -0.02115109, -0.03347214], dtype=float32),\n",
815 | " array([[ 0.01710712, 0.05899733, 0.19687712, ..., -0.16414592,\n",
816 | " -0.1729225 , 0.250805 ],\n",
817 | " [ 0.0212338 , 0.09614811, -0.29050896, ..., -0.00999625,\n",
818 | " -0.17816451, -0.10987644],\n",
819 | " [-0.1450137 , -0.09381005, 0.14288498, ..., -0.02291354,\n",
820 | " -0.1018327 , 0.08779028],\n",
821 | " ...,\n",
822 | " [-0.04191932, -0.24704039, -0.27977762, ..., 0.04444192,\n",
823 | " 0.14089833, -0.13210642],\n",
824 | " [ 0.2870728 , 0.06294189, -0.20518191, ..., -0.23227683,\n",
825 | " 0.00949242, 0.1063434 ],\n",
826 | " [ 0.17682791, -0.0257488 , -0.14495434, ..., 0.13260809,\n",
827 | " 0.10122415, 0.11349083]], dtype=float32),\n",
828 | " array([ 0.06070757, 0.03470645, -0.01056474, 0.05891937, 0.04047546,\n",
829 | " 0.04035885, 0.01412428, 0.03505876, 0.07902474, 0.03970112,\n",
830 | " 0.02213142, 0.05471941, -0.05341211, -0.0015829 , 0.05047364,\n",
831 | " 0.04321249, 0.04018799, -0.00080443, 0.03680886, -0.04207543,\n",
832 | " -0.00228095, 0.01724998, 0.02404504, 0.04932764, 0.04539732,\n",
833 | " -0.04217253, 0.04508245, 0.01458768, 0.06814823, 0.02390035,\n",
834 | " 0.00890458, 0.00050514], dtype=float32),\n",
835 | " array([[-0.03181389, 0.36461648, 0.21937227, -0.08787145, 0.18259533,\n",
836 | " -0.10403243, -0.24254403, 0.12336899, -0.22536959, 0.22124617,\n",
837 | " 0.3858685 , 0.35751647, 0.3850931 , -0.14543447, 0.07271428,\n",
838 | " 0.03124721],\n",
839 | " [ 0.30015758, 0.23534928, -0.12342435, -0.3554176 , -0.13775481,\n",
840 | " -0.29805458, 0.2782133 , 0.13659884, 0.2745876 , -0.07014683,\n",
841 | " -0.1397669 , 0.1843088 , 0.22818515, -0.27713686, -0.34773144,\n",
842 | " -0.3316393 ],\n",
843 | " [-0.00469875, 0.28815445, 0.21893021, 0.0338263 , -0.28240445,\n",
844 | " -0.17489761, 0.11985137, 0.05247853, 0.29214996, 0.33651045,\n",
845 | " 0.31352937, 0.01852868, 0.19706537, -0.3997658 , -0.07218935,\n",
846 | " 0.08277316],\n",
847 | " [-0.37601382, 0.20769934, 0.3044312 , 0.26381913, -0.33120865,\n",
848 | " 0.06304118, 0.14172421, 0.03820411, 0.24263158, 0.03216947,\n",
849 | " -0.35713422, -0.04552888, -0.03292144, 0.19712627, 0.0645666 ,\n",
850 | " 0.3477676 ],\n",
851 | " [-0.3410033 , 0.16600682, -0.40391058, 0.11205281, -0.27729502,\n",
852 | " 0.11571773, 0.05837025, 0.14824443, 0.23224385, 0.2587573 ,\n",
853 | " 0.07087312, 0.331417 , 0.30079114, -0.28334638, -0.03011922,\n",
854 | " -0.28644213],\n",
855 | " [ 0.35002202, -0.00667038, -0.12044734, -0.10690704, -0.00250458,\n",
856 | " 0.01032064, 0.12428732, -0.32014468, 0.10854278, 0.2761535 ,\n",
857 | " -0.07496271, 0.14598933, 0.25464275, 0.16554764, -0.28366598,\n",
858 | " 0.06502755],\n",
859 | " [-0.22298749, 0.12001247, -0.07739963, 0.18335296, 0.12494181,\n",
860 | " 0.07654858, 0.06422438, 0.00137177, 0.02304127, -0.29803985,\n",
861 | " -0.24536064, -0.36777598, -0.00233974, -0.19202173, 0.17830467,\n",
862 | " -0.06320915],\n",
863 | " [-0.19243963, -0.5162476 , 0.2887326 , -0.20053177, 0.02099118,\n",
864 | " -0.12572756, -0.26222202, 0.12307905, -0.09653259, -0.00993652,\n",
865 | " 0.11800483, 0.01500315, 0.04311377, -0.0989319 , -0.18214574,\n",
866 | " 0.3233209 ],\n",
867 | " [ 0.00292671, -0.30775398, 0.2230125 , 0.12114804, 0.1222524 ,\n",
868 | " 0.08607944, -0.03567095, 0.05554473, 0.13489185, -0.38399616,\n",
869 | " -0.04994347, -0.28247142, -0.1407669 , 0.16138533, -0.10637195,\n",
870 | " 0.04249942],\n",
871 | " [-0.11343817, 0.04448226, 0.15629469, 0.42081538, -0.34839165,\n",
872 | " -0.14974415, -0.03622079, 0.14736058, -0.11092319, -0.1407115 ,\n",
873 | " -0.12021533, -0.29137936, 0.17137238, -0.24613929, 0.32762602,\n",
874 | " -0.09470203],\n",
875 | " [-0.1881683 , 0.11836835, 0.05790296, 0.08476032, 0.02068776,\n",
876 | " -0.38476402, 0.28988943, -0.0288113 , 0.13078676, 0.27763173,\n",
877 | " 0.22504163, 0.33593044, -0.07217048, -0.12091418, 0.18034475,\n",
878 | " -0.22418436],\n",
879 | " [ 0.15105532, -0.11705495, 0.3674667 , 0.363718 , 0.10412659,\n",
880 | " -0.35990825, 0.11399814, -0.23819828, -0.08863869, 0.02802679,\n",
881 | " 0.1437467 , -0.25184903, -0.02095903, -0.00977133, 0.25159526,\n",
882 | " -0.11894038],\n",
883 | " [-0.0093493 , 0.22396839, 0.2437612 , -0.35386696, -0.03015039,\n",
884 | " 0.02968696, 0.239706 , -0.28024212, -0.18360813, -0.16204412,\n",
885 | " 0.28210846, -0.22262257, 0.3347047 , 0.0739947 , -0.30375302,\n",
886 | " -0.2546232 ],\n",
887 | " [-0.29796588, -0.21649683, -0.16674398, 0.3031154 , -0.04349583,\n",
888 | " -0.30568284, -0.17184502, 0.29973665, 0.00871616, -0.27609646,\n",
889 | " 0.17039387, 0.13682918, -0.24142027, -0.06861473, -0.24007618,\n",
890 | " 0.2715835 ],\n",
891 | " [ 0.06526909, -0.29244354, 0.16544972, 0.17392205, 0.21360847,\n",
892 | " -0.0915836 , -0.06729836, -0.15326335, -0.43512848, -0.04309068,\n",
893 | " 0.10169224, -0.409573 , -0.16315383, -0.00780383, 0.0168947 ,\n",
894 | " 0.24890439],\n",
895 | " [ 0.28596145, 0.3411141 , 0.1016633 , -0.12404642, 0.13194 ,\n",
896 | " -0.1563824 , 0.24932957, 0.3115531 , 0.10110721, 0.05686445,\n",
897 | " -0.00755071, 0.32657337, -0.07614633, -0.17004499, 0.00828885,\n",
898 | " 0.11708102],\n",
899 | " [-0.06987403, -0.5014448 , 0.34601277, -0.11264189, 0.14104289,\n",
900 | " -0.12513761, -0.30137274, 0.20378883, -0.06660958, -0.14585659,\n",
901 | " 0.19443376, 0.2352993 , -0.25633577, -0.25387967, -0.01543014,\n",
902 | " 0.06348623],\n",
903 | " [ 0.13911544, -0.3318961 , -0.14756398, 0.13538703, 0.20408534,\n",
904 | " -0.1612719 , -0.22945021, -0.3170605 , -0.18153918, -0.37688178,\n",
905 | " 0.07146352, -0.2789289 , -0.26379904, 0.39369026, 0.22697724,\n",
906 | " 0.11840305],\n",
907 | " [-0.12734856, 0.13243565, -0.34357324, -0.35339123, 0.00850511,\n",
908 | " -0.35691306, 0.08194444, -0.36914635, 0.23007323, 0.07935331,\n",
909 | " 0.06446976, 0.08764478, -0.06447454, -0.13523917, -0.21261711,\n",
910 | " -0.33069617],\n",
911 | " [ 0.170694 , -0.02122952, -0.0067374 , -0.09356851, -0.07322819,\n",
912 | " -0.36744735, -0.04747267, 0.26535437, 0.08359791, 0.3238836 ,\n",
913 | " -0.18979463, -0.18159418, -0.12189484, 0.34403357, 0.08832032,\n",
914 | " -0.08044112],\n",
915 | " [ 0.09397195, -0.2108204 , -0.0560944 , 0.37144122, 0.28218314,\n",
916 | " 0.15767191, -0.23192717, -0.20479654, 0.06101264, 0.23501319,\n",
917 | " -0.05869558, -0.06200844, 0.07128817, 0.31021088, 0.05618818,\n",
918 | " 0.10938841],\n",
919 | " [ 0.14407031, 0.07658152, 0.072148 , -0.04923255, 0.10020608,\n",
920 | " -0.24626613, -0.3004887 , 0.30941892, -0.13862629, -0.10644016,\n",
921 | " 0.20252647, 0.16769968, -0.330388 , -0.00644404, -0.09990501,\n",
922 | " 0.05682618],\n",
923 | " [-0.19771017, -0.00463851, -0.28224167, -0.00722877, 0.02486053,\n",
924 | " -0.13751242, 0.10230814, 0.28130555, 0.21303718, 0.24798435,\n",
925 | " 0.07492059, 0.27412608, -0.03058494, 0.22399727, 0.03092592,\n",
926 | " 0.12563941],\n",
927 | " [-0.10345565, 0.02441081, 0.00296274, -0.17417578, -0.21602124,\n",
928 | " 0.3627831 , 0.17673486, -0.01667277, 0.15430304, -0.01696996,\n",
929 | " 0.4480442 , 0.23536582, 0.3618978 , 0.12143793, -0.14396907,\n",
930 | " -0.25193492],\n",
931 | " [ 0.16758727, 0.4215446 , -0.21741767, -0.39419007, -0.24863143,\n",
932 | " -0.14874093, 0.18475841, -0.34813526, 0.38610274, -0.15354364,\n",
933 | " 0.36834246, 0.16785684, 0.05379786, -0.24522713, -0.10196028,\n",
934 | " 0.03414837],\n",
935 | " [-0.07029969, -0.19911379, 0.06190927, 0.27118817, -0.2737118 ,\n",
936 | " 0.2617822 , -0.10694262, 0.0076831 , -0.08962224, 0.1403898 ,\n",
937 | " -0.09807394, -0.17504035, -0.06456191, 0.24633321, 0.24579565,\n",
938 | " -0.1538896 ],\n",
939 | " [-0.2817283 , -0.07318467, 0.04285529, 0.12865804, 0.24825683,\n",
940 | " 0.08824237, -0.18290383, 0.18724097, -0.30482438, 0.02618245,\n",
941 | " -0.26522484, -0.19828922, -0.23894064, 0.24095143, 0.17880344,\n",
942 | " -0.2709629 ],\n",
943 | " [-0.28918597, -0.16183259, -0.07423458, -0.08513089, 0.04434022,\n",
944 | " -0.2262579 , 0.24874245, -0.23073797, 0.11765265, 0.18133168,\n",
945 | " 0.4270475 , 0.07870139, 0.24253517, 0.17272191, -0.29287612,\n",
946 | " -0.06029308],\n",
947 | " [-0.23279765, 0.02380678, 0.42579928, 0.45328426, -0.25106153,\n",
948 | " 0.1891483 , -0.08696147, 0.24683139, -0.02191213, 0.0326785 ,\n",
949 | " -0.3724371 , -0.3177612 , -0.3237853 , -0.05886461, 0.01364644,\n",
950 | " -0.12020141],\n",
951 | " [-0.27560648, 0.01893821, -0.16332875, -0.18978739, -0.364101 ,\n",
952 | " -0.34961298, 0.28775886, -0.38398445, -0.04276223, 0.19484045,\n",
953 | " 0.03937349, 0.20153666, 0.01663716, -0.0921661 , 0.22097008,\n",
954 | " -0.24838117],\n",
955 | " [ 0.41217238, 0.08434208, 0.11611683, -0.05583868, -0.23828606,\n",
956 | " -0.03270978, 0.19925064, -0.47661307, 0.14938584, 0.30124822,\n",
957 | " -0.20539896, 0.11503673, 0.2971983 , -0.00082268, -0.29682884,\n",
958 | " -0.0207689 ],\n",
959 | " [ 0.19959189, -0.32331905, 0.0944791 , 0.42149034, 0.30526033,\n",
960 | " -0.14329761, -0.18511426, -0.17082566, 0.04276067, -0.29316524,\n",
961 | " -0.05988038, 0.11745096, -0.23252259, 0.45617214, -0.09669437,\n",
962 | " 0.05247087]], dtype=float32),\n",
963 | " array([-0.03747373, 0.17003675, 0.11738642, 0.19547006, 0.07437114,\n",
964 | " -0.05025492, 0.04694998, 0.10664285, 0.05696655, 0.0621058 ,\n",
965 | " -0.0350681 , 0.08893936, 0.1775616 , 0.06103926, 0.10087743,\n",
966 | " 0.07751313], dtype=float32),\n",
967 | " array([[-0.01885461],\n",
968 | " [-0.15283838],\n",
969 | " [ 0.25808784],\n",
970 | " [ 0.17146689],\n",
971 | " [ 0.54414177],\n",
972 | " [-0.08877844],\n",
973 | " [-0.48487845],\n",
974 | " [ 0.43206635],\n",
975 | " [-0.20456102],\n",
976 | " [-0.5560462 ],\n",
977 | " [-0.05018496],\n",
978 | " [-0.21270362],\n",
979 | " [-0.12712412],\n",
980 | " [ 0.16027448],\n",
981 | " [ 0.499727 ],\n",
982 | " [ 0.55800885]], dtype=float32),\n",
983 | " array([0.05340275], dtype=float32)]"
984 | ]
985 | },
986 | "metadata": {
987 | "tags": []
988 | },
989 | "execution_count": 8
990 | }
991 | ]
992 | },
993 | {
994 | "cell_type": "code",
995 | "metadata": {
996 | "id": "sJVFZSgcyFXU",
997 | "colab_type": "code",
998 | "colab": {}
999 | },
1000 | "source": [
1001 | "emb_layer=model.get_layer(index=0)"
1002 | ],
1003 | "execution_count": null,
1004 | "outputs": []
1005 | },
1006 | {
1007 | "cell_type": "code",
1008 | "metadata": {
1009 | "id": "2eu8L8Rvynrq",
1010 | "colab_type": "code",
1011 | "colab": {
1012 | "base_uri": "https://localhost:8080/",
1013 | "height": 34
1014 | },
1015 | "outputId": "5f24600f-6a76-432f-9c01-321449ed2bb0"
1016 | },
1017 | "source": [
1018 | "emb_layer.output_shape"
1019 | ],
1020 | "execution_count": null,
1021 | "outputs": [
1022 | {
1023 | "output_type": "execute_result",
1024 | "data": {
1025 | "text/plain": [
1026 | "(None, None, 128)"
1027 | ]
1028 | },
1029 | "metadata": {
1030 | "tags": []
1031 | },
1032 | "execution_count": 11
1033 | }
1034 | ]
1035 | },
1036 | {
1037 | "cell_type": "code",
1038 | "metadata": {
1039 | "id": "iztjRZKGvVNw",
1040 | "colab_type": "code",
1041 | "colab": {
1042 | "base_uri": "https://localhost:8080/",
1043 | "height": 34
1044 | },
1045 | "outputId": "eb71e080-dbaa-46d9-bb29-e92b96142595"
1046 | },
1047 | "source": [
1048 | "emb_weights=emb_layer.get_weights()[0]\n",
1049 | "emb_weights.shape"
1050 | ],
1051 | "execution_count": null,
1052 | "outputs": [
1053 | {
1054 | "output_type": "execute_result",
1055 | "data": {
1056 | "text/plain": [
1057 | "(73740, 128)"
1058 | ]
1059 | },
1060 | "metadata": {
1061 | "tags": []
1062 | },
1063 | "execution_count": 15
1064 | }
1065 | ]
1066 | },
1067 | {
1068 | "cell_type": "code",
1069 | "metadata": {
1070 | "id": "ktaEHKpZvkDI",
1071 | "colab_type": "code",
1072 | "colab": {}
1073 | },
1074 | "source": [
1075 | "lstm1_layer=model.get_layer(index=1)"
1076 | ],
1077 | "execution_count": null,
1078 | "outputs": []
1079 | },
1080 | {
1081 | "cell_type": "code",
1082 | "metadata": {
1083 | "id": "wnzIJZl2zG8w",
1084 | "colab_type": "code",
1085 | "colab": {
1086 | "base_uri": "https://localhost:8080/",
1087 | "height": 34
1088 | },
1089 | "outputId": "3cce5a1e-9bbf-47d4-f7e6-6f5f6a11881b"
1090 | },
1091 | "source": [
1092 | "lstm1_layer.output_shape"
1093 | ],
1094 | "execution_count": null,
1095 | "outputs": [
1096 | {
1097 | "output_type": "execute_result",
1098 | "data": {
1099 | "text/plain": [
1100 | "(None, None, 256)"
1101 | ]
1102 | },
1103 | "metadata": {
1104 | "tags": []
1105 | },
1106 | "execution_count": 17
1107 | }
1108 | ]
1109 | },
1110 | {
1111 | "cell_type": "code",
1112 | "metadata": {
1113 | "id": "fOv55iUCzJxv",
1114 | "colab_type": "code",
1115 | "colab": {
1116 | "base_uri": "https://localhost:8080/",
1117 | "height": 1000
1118 | },
1119 | "outputId": "f73fc939-adc1-40f9-f210-67023971dcc9"
1120 | },
1121 | "source": [
1122 | "lstm1_layer.weights"
1123 | ],
1124 | "execution_count": null,
1125 | "outputs": [
1126 | {
1127 | "output_type": "execute_result",
1128 | "data": {
1129 | "text/plain": [
1130 | "[,\n",
1144 | " ,\n",
1158 | " ,\n",
1288 | " ,\n",
1302 | " ,\n",
1316 | " ]"
1446 | ]
1447 | },
1448 | "metadata": {
1449 | "tags": []
1450 | },
1451 | "execution_count": 18
1452 | }
1453 | ]
1454 | },
1455 | {
1456 | "cell_type": "code",
1457 | "metadata": {
1458 | "id": "2itZnNmDzujR",
1459 | "colab_type": "code",
1460 | "colab": {}
1461 | },
1462 | "source": [
1463 | "import tensorflow_datasets as tfds\n",
1464 | "import tensorflow as tf"
1465 | ],
1466 | "execution_count": null,
1467 | "outputs": []
1468 | },
1469 | {
1470 | "cell_type": "code",
1471 | "metadata": {
1472 | "id": "7zMUoW04Cxyi",
1473 | "colab_type": "code",
1474 | "colab": {}
1475 | },
1476 | "source": [
1477 | "model = tf.keras.models.load_model('/content/drive/My Drive/Colab Notebooks/models/final_sentiment_analysis.hdf5')\n",
1478 | "text_encoder = tfds.features.text.TokenTextEncoder.load_from_file(\"/content/drive/My Drive/Colab Notebooks/models/sa_encoder.vocab\")"
1479 | ],
1480 | "execution_count": null,
1481 | "outputs": []
1482 | },
1483 | {
1484 | "cell_type": "code",
1485 | "metadata": {
1486 | "id": "QSEWMSKzBGYB",
1487 | "colab_type": "code",
1488 | "colab": {}
1489 | },
1490 | "source": [
1491 | "def pad_to_size(vec, size):\n",
1492 | " zeros = [0] * (size - len(vec))\n",
1493 | " vec.extend(zeros)\n",
1494 | " return vec"
1495 | ],
1496 | "execution_count": null,
1497 | "outputs": []
1498 | },
1499 | {
1500 | "cell_type": "code",
1501 | "metadata": {
1502 | "id": "_9wTpaO7BM-C",
1503 | "colab_type": "code",
1504 | "colab": {}
1505 | },
1506 | "source": [
1507 | "def predict_fn(pred_text, pad_size):\n",
1508 | " encoded_pred_text = text_encoder.encode(pred_text)\n",
1509 | " encoded_pred_text = pad_to_size(encoded_pred_text, pad_size)\n",
1510 | " encoded_pred_text = tf.cast(encoded_pred_text, tf.int64)\n",
1511 | " predictions = model.predict(tf.expand_dims(encoded_pred_text, 0))\n",
1512 | "\n",
1513 | " return (predictions)"
1514 | ],
1515 | "execution_count": null,
1516 | "outputs": []
1517 | },
1518 | {
1519 | "cell_type": "code",
1520 | "metadata": {
1521 | "id": "3QyBxurSBacI",
1522 | "colab_type": "code",
1523 | "colab": {
1524 | "base_uri": "https://localhost:8080/",
1525 | "height": 34
1526 | },
1527 | "outputId": "10b8cd1e-388d-4646-d878-22489be03def"
1528 | },
1529 | "source": [
1530 | "pred_text = ('Unfortunately this product did not come with the CD nor did the pages go in order. The pages were misleading which made the flow of the content even more challenging to follow (started with Part IV vs Part I). I got this as a Xmas present for my partner and he was disappointed to put it lightly. I will be looking into how I can get my money back on this item and how I can return it.')\n",
1531 | "predictions = predict_fn(pred_text, 1000)\n",
1532 | "print(predictions)"
1533 | ],
1534 | "execution_count": null,
1535 | "outputs": [
1536 | {
1537 | "output_type": "stream",
1538 | "text": [
1539 | "[[-7.519889]]\n"
1540 | ],
1541 | "name": "stdout"
1542 | }
1543 | ]
1544 | },
1545 | {
1546 | "cell_type": "code",
1547 | "metadata": {
1548 | "id": "CfeTbnhGEmDI",
1549 | "colab_type": "code",
1550 | "colab": {
1551 | "base_uri": "https://localhost:8080/",
1552 | "height": 34
1553 | },
1554 | "outputId": "182c814a-c833-43cf-c5d4-a2cafd94b1ac"
1555 | },
1556 | "source": [
1557 | "pred_text = ('Both the original content and the additional content in his edition are great. However, the additional content has been added at the expense of eleven chapters and the appendix, which you must use an included CD to access. The CD however does not even contain the chapters themselves, but a link to a webpage from which to download them. I purchase physical copies of nonfiction books because the formatting is generally superior to e-book versions, making them easier to read. This has been particularly counter-productive in this instance, as not only is it annoying to have to switch, but the missing chapters seem to have been removed almost at random. Also, the provided digital chapters are .pdf files instead of e-book files, so reading them is actually worse than reading a normal e-book.')\n",
1558 | "predictions = predict_fn(pred_text, 1000)\n",
1559 | "print(predictions)"
1560 | ],
1561 | "execution_count": null,
1562 | "outputs": [
1563 | {
1564 | "output_type": "stream",
1565 | "text": [
1566 | "[[-2.784692]]\n"
1567 | ],
1568 | "name": "stdout"
1569 | }
1570 | ]
1571 | },
1572 | {
1573 | "cell_type": "code",
1574 | "metadata": {
1575 | "id": "1HY1llCMGocB",
1576 | "colab_type": "code",
1577 | "colab": {
1578 | "base_uri": "https://localhost:8080/",
1579 | "height": 34
1580 | },
1581 | "outputId": "bc31b3fc-99a4-4d84-cba6-fc672b790060"
1582 | },
1583 | "source": [
1584 | "pred_text = ('Still working my way through it but definitely changes your view on investment. Wish it was available on Audible')\n",
1585 | "predictions = predict_fn(pred_text, 1000)\n",
1586 | "print(predictions)"
1587 | ],
1588 | "execution_count": null,
1589 | "outputs": [
1590 | {
1591 | "output_type": "stream",
1592 | "text": [
1593 | "[[2.3042152]]\n"
1594 | ],
1595 | "name": "stdout"
1596 | }
1597 | ]
1598 | },
1599 | {
1600 | "cell_type": "code",
1601 | "metadata": {
1602 | "id": "w5Ld83J_GxDj",
1603 | "colab_type": "code",
1604 | "colab": {
1605 | "base_uri": "https://localhost:8080/",
1606 | "height": 34
1607 | },
1608 | "outputId": "58164bb7-febf-4b65-9bd5-d04ce3e515ad"
1609 | },
1610 | "source": [
1611 | "pred_text = (\"Consistent in its service and quality of food. The items weve tried have always been very tasty. Cool ambiance and vibe.\")\n",
1612 | "predictions = predict_fn(pred_text, 1000)\n",
1613 | "print(predictions)"
1614 | ],
1615 | "execution_count": null,
1616 | "outputs": [
1617 | {
1618 | "output_type": "stream",
1619 | "text": [
1620 | "[[0.6921133]]\n"
1621 | ],
1622 | "name": "stdout"
1623 | }
1624 | ]
1625 | },
1626 | {
1627 | "cell_type": "code",
1628 | "metadata": {
1629 | "id": "SR7_QPRLBHXx",
1630 | "colab_type": "code",
1631 | "colab": {
1632 | "base_uri": "https://localhost:8080/",
1633 | "height": 34
1634 | },
1635 | "outputId": "ed58d22f-25ca-4443-ab82-e9d77098b757"
1636 | },
1637 | "source": [
1638 | "pred_text = (\"I sat there for 10 min and never got offered the menu or anything to drink. We didn't get any kind of attention even though there were only 3 more customers\")\n",
1639 | "predictions = predict_fn(pred_text, 1000)\n",
1640 | "print(predictions)"
1641 | ],
1642 | "execution_count": null,
1643 | "outputs": [
1644 | {
1645 | "output_type": "stream",
1646 | "text": [
1647 | "[[-2.9662268]]\n"
1648 | ],
1649 | "name": "stdout"
1650 | }
1651 | ]
1652 | },
1653 | {
1654 | "cell_type": "code",
1655 | "metadata": {
1656 | "id": "kTKonwdkB-5B",
1657 | "colab_type": "code",
1658 | "colab": {}
1659 | },
1660 | "source": [
1661 | ""
1662 | ],
1663 | "execution_count": null,
1664 | "outputs": []
1665 | }
1666 | ]
1667 | }
--------------------------------------------------------------------------------