├── README.md
├── LICENSE
└── PositionEmbedding_Discussion.ipynb
/README.md:
--------------------------------------------------------------------------------
1 | # Position-Embedding-Discussion
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/PositionEmbedding_Discussion.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "provenance": [],
7 | "gpuType": "T4"
8 | },
9 | "kernelspec": {
10 | "name": "python3",
11 | "display_name": "Python 3"
12 | },
13 | "language_info": {
14 | "name": "python"
15 | },
16 | "accelerator": "GPU",
17 | "gpuClass": "standard",
18 | "widgets": {
19 | "application/vnd.jupyter.widget-state+json": {
20 | "8fc3ffd3192e410690bfb1c15cc91df8": {
21 | "model_module": "@jupyter-widgets/controls",
22 | "model_name": "HBoxModel",
23 | "model_module_version": "1.5.0",
24 | "state": {
25 | "_dom_classes": [],
26 | "_model_module": "@jupyter-widgets/controls",
27 | "_model_module_version": "1.5.0",
28 | "_model_name": "HBoxModel",
29 | "_view_count": null,
30 | "_view_module": "@jupyter-widgets/controls",
31 | "_view_module_version": "1.5.0",
32 | "_view_name": "HBoxView",
33 | "box_style": "",
34 | "children": [
35 | "IPY_MODEL_194715023f574cb6945498787a28599e",
36 | "IPY_MODEL_e6ca529399674745849418cb0cc9d63e",
37 | "IPY_MODEL_d33de86165ae4bbab6185ac13a4a7169"
38 | ],
39 | "layout": "IPY_MODEL_6437b891ad8f4433bf59f112a1446b26"
40 | }
41 | },
42 | "194715023f574cb6945498787a28599e": {
43 | "model_module": "@jupyter-widgets/controls",
44 | "model_name": "HTMLModel",
45 | "model_module_version": "1.5.0",
46 | "state": {
47 | "_dom_classes": [],
48 | "_model_module": "@jupyter-widgets/controls",
49 | "_model_module_version": "1.5.0",
50 | "_model_name": "HTMLModel",
51 | "_view_count": null,
52 | "_view_module": "@jupyter-widgets/controls",
53 | "_view_module_version": "1.5.0",
54 | "_view_name": "HTMLView",
55 | "description": "",
56 | "description_tooltip": null,
57 | "layout": "IPY_MODEL_0b0696c421c24b719a9e0d3ac48a264f",
58 | "placeholder": "",
59 | "style": "IPY_MODEL_b4bbefacd57644149fc055dc2ba8809a",
60 | "value": "Dl Completed...: 100%"
61 | }
62 | },
63 | "e6ca529399674745849418cb0cc9d63e": {
64 | "model_module": "@jupyter-widgets/controls",
65 | "model_name": "FloatProgressModel",
66 | "model_module_version": "1.5.0",
67 | "state": {
68 | "_dom_classes": [],
69 | "_model_module": "@jupyter-widgets/controls",
70 | "_model_module_version": "1.5.0",
71 | "_model_name": "FloatProgressModel",
72 | "_view_count": null,
73 | "_view_module": "@jupyter-widgets/controls",
74 | "_view_module_version": "1.5.0",
75 | "_view_name": "ProgressView",
76 | "bar_style": "success",
77 | "description": "",
78 | "description_tooltip": null,
79 | "layout": "IPY_MODEL_773075570214465f90615fc25895a6f8",
80 | "max": 1,
81 | "min": 0,
82 | "orientation": "horizontal",
83 | "style": "IPY_MODEL_9cba2aed6b6c40eeb15fc09adfcee5d2",
84 | "value": 1
85 | }
86 | },
87 | "d33de86165ae4bbab6185ac13a4a7169": {
88 | "model_module": "@jupyter-widgets/controls",
89 | "model_name": "HTMLModel",
90 | "model_module_version": "1.5.0",
91 | "state": {
92 | "_dom_classes": [],
93 | "_model_module": "@jupyter-widgets/controls",
94 | "_model_module_version": "1.5.0",
95 | "_model_name": "HTMLModel",
96 | "_view_count": null,
97 | "_view_module": "@jupyter-widgets/controls",
98 | "_view_module_version": "1.5.0",
99 | "_view_name": "HTMLView",
100 | "description": "",
101 | "description_tooltip": null,
102 | "layout": "IPY_MODEL_061391e9db9f4edd8d2b33aef1aca202",
103 | "placeholder": "",
104 | "style": "IPY_MODEL_44cf3199fd5c4ea7bbfeff15de48dadd",
105 | "value": " 1/1 [00:01<00:00, 1.55s/ url]"
106 | }
107 | },
108 | "6437b891ad8f4433bf59f112a1446b26": {
109 | "model_module": "@jupyter-widgets/base",
110 | "model_name": "LayoutModel",
111 | "model_module_version": "1.2.0",
112 | "state": {
113 | "_model_module": "@jupyter-widgets/base",
114 | "_model_module_version": "1.2.0",
115 | "_model_name": "LayoutModel",
116 | "_view_count": null,
117 | "_view_module": "@jupyter-widgets/base",
118 | "_view_module_version": "1.2.0",
119 | "_view_name": "LayoutView",
120 | "align_content": null,
121 | "align_items": null,
122 | "align_self": null,
123 | "border": null,
124 | "bottom": null,
125 | "display": null,
126 | "flex": null,
127 | "flex_flow": null,
128 | "grid_area": null,
129 | "grid_auto_columns": null,
130 | "grid_auto_flow": null,
131 | "grid_auto_rows": null,
132 | "grid_column": null,
133 | "grid_gap": null,
134 | "grid_row": null,
135 | "grid_template_areas": null,
136 | "grid_template_columns": null,
137 | "grid_template_rows": null,
138 | "height": null,
139 | "justify_content": null,
140 | "justify_items": null,
141 | "left": null,
142 | "margin": null,
143 | "max_height": null,
144 | "max_width": null,
145 | "min_height": null,
146 | "min_width": null,
147 | "object_fit": null,
148 | "object_position": null,
149 | "order": null,
150 | "overflow": null,
151 | "overflow_x": null,
152 | "overflow_y": null,
153 | "padding": null,
154 | "right": null,
155 | "top": null,
156 | "visibility": null,
157 | "width": null
158 | }
159 | },
160 | "0b0696c421c24b719a9e0d3ac48a264f": {
161 | "model_module": "@jupyter-widgets/base",
162 | "model_name": "LayoutModel",
163 | "model_module_version": "1.2.0",
164 | "state": {
165 | "_model_module": "@jupyter-widgets/base",
166 | "_model_module_version": "1.2.0",
167 | "_model_name": "LayoutModel",
168 | "_view_count": null,
169 | "_view_module": "@jupyter-widgets/base",
170 | "_view_module_version": "1.2.0",
171 | "_view_name": "LayoutView",
172 | "align_content": null,
173 | "align_items": null,
174 | "align_self": null,
175 | "border": null,
176 | "bottom": null,
177 | "display": null,
178 | "flex": null,
179 | "flex_flow": null,
180 | "grid_area": null,
181 | "grid_auto_columns": null,
182 | "grid_auto_flow": null,
183 | "grid_auto_rows": null,
184 | "grid_column": null,
185 | "grid_gap": null,
186 | "grid_row": null,
187 | "grid_template_areas": null,
188 | "grid_template_columns": null,
189 | "grid_template_rows": null,
190 | "height": null,
191 | "justify_content": null,
192 | "justify_items": null,
193 | "left": null,
194 | "margin": null,
195 | "max_height": null,
196 | "max_width": null,
197 | "min_height": null,
198 | "min_width": null,
199 | "object_fit": null,
200 | "object_position": null,
201 | "order": null,
202 | "overflow": null,
203 | "overflow_x": null,
204 | "overflow_y": null,
205 | "padding": null,
206 | "right": null,
207 | "top": null,
208 | "visibility": null,
209 | "width": null
210 | }
211 | },
212 | "b4bbefacd57644149fc055dc2ba8809a": {
213 | "model_module": "@jupyter-widgets/controls",
214 | "model_name": "DescriptionStyleModel",
215 | "model_module_version": "1.5.0",
216 | "state": {
217 | "_model_module": "@jupyter-widgets/controls",
218 | "_model_module_version": "1.5.0",
219 | "_model_name": "DescriptionStyleModel",
220 | "_view_count": null,
221 | "_view_module": "@jupyter-widgets/base",
222 | "_view_module_version": "1.2.0",
223 | "_view_name": "StyleView",
224 | "description_width": ""
225 | }
226 | },
227 | "773075570214465f90615fc25895a6f8": {
228 | "model_module": "@jupyter-widgets/base",
229 | "model_name": "LayoutModel",
230 | "model_module_version": "1.2.0",
231 | "state": {
232 | "_model_module": "@jupyter-widgets/base",
233 | "_model_module_version": "1.2.0",
234 | "_model_name": "LayoutModel",
235 | "_view_count": null,
236 | "_view_module": "@jupyter-widgets/base",
237 | "_view_module_version": "1.2.0",
238 | "_view_name": "LayoutView",
239 | "align_content": null,
240 | "align_items": null,
241 | "align_self": null,
242 | "border": null,
243 | "bottom": null,
244 | "display": null,
245 | "flex": null,
246 | "flex_flow": null,
247 | "grid_area": null,
248 | "grid_auto_columns": null,
249 | "grid_auto_flow": null,
250 | "grid_auto_rows": null,
251 | "grid_column": null,
252 | "grid_gap": null,
253 | "grid_row": null,
254 | "grid_template_areas": null,
255 | "grid_template_columns": null,
256 | "grid_template_rows": null,
257 | "height": null,
258 | "justify_content": null,
259 | "justify_items": null,
260 | "left": null,
261 | "margin": null,
262 | "max_height": null,
263 | "max_width": null,
264 | "min_height": null,
265 | "min_width": null,
266 | "object_fit": null,
267 | "object_position": null,
268 | "order": null,
269 | "overflow": null,
270 | "overflow_x": null,
271 | "overflow_y": null,
272 | "padding": null,
273 | "right": null,
274 | "top": null,
275 | "visibility": null,
276 | "width": "20px"
277 | }
278 | },
279 | "9cba2aed6b6c40eeb15fc09adfcee5d2": {
280 | "model_module": "@jupyter-widgets/controls",
281 | "model_name": "ProgressStyleModel",
282 | "model_module_version": "1.5.0",
283 | "state": {
284 | "_model_module": "@jupyter-widgets/controls",
285 | "_model_module_version": "1.5.0",
286 | "_model_name": "ProgressStyleModel",
287 | "_view_count": null,
288 | "_view_module": "@jupyter-widgets/base",
289 | "_view_module_version": "1.2.0",
290 | "_view_name": "StyleView",
291 | "bar_color": null,
292 | "description_width": ""
293 | }
294 | },
295 | "061391e9db9f4edd8d2b33aef1aca202": {
296 | "model_module": "@jupyter-widgets/base",
297 | "model_name": "LayoutModel",
298 | "model_module_version": "1.2.0",
299 | "state": {
300 | "_model_module": "@jupyter-widgets/base",
301 | "_model_module_version": "1.2.0",
302 | "_model_name": "LayoutModel",
303 | "_view_count": null,
304 | "_view_module": "@jupyter-widgets/base",
305 | "_view_module_version": "1.2.0",
306 | "_view_name": "LayoutView",
307 | "align_content": null,
308 | "align_items": null,
309 | "align_self": null,
310 | "border": null,
311 | "bottom": null,
312 | "display": null,
313 | "flex": null,
314 | "flex_flow": null,
315 | "grid_area": null,
316 | "grid_auto_columns": null,
317 | "grid_auto_flow": null,
318 | "grid_auto_rows": null,
319 | "grid_column": null,
320 | "grid_gap": null,
321 | "grid_row": null,
322 | "grid_template_areas": null,
323 | "grid_template_columns": null,
324 | "grid_template_rows": null,
325 | "height": null,
326 | "justify_content": null,
327 | "justify_items": null,
328 | "left": null,
329 | "margin": null,
330 | "max_height": null,
331 | "max_width": null,
332 | "min_height": null,
333 | "min_width": null,
334 | "object_fit": null,
335 | "object_position": null,
336 | "order": null,
337 | "overflow": null,
338 | "overflow_x": null,
339 | "overflow_y": null,
340 | "padding": null,
341 | "right": null,
342 | "top": null,
343 | "visibility": null,
344 | "width": null
345 | }
346 | },
347 | "44cf3199fd5c4ea7bbfeff15de48dadd": {
348 | "model_module": "@jupyter-widgets/controls",
349 | "model_name": "DescriptionStyleModel",
350 | "model_module_version": "1.5.0",
351 | "state": {
352 | "_model_module": "@jupyter-widgets/controls",
353 | "_model_module_version": "1.5.0",
354 | "_model_name": "DescriptionStyleModel",
355 | "_view_count": null,
356 | "_view_module": "@jupyter-widgets/base",
357 | "_view_module_version": "1.2.0",
358 | "_view_name": "StyleView",
359 | "description_width": ""
360 | }
361 | },
362 | "63117fcc267e4d9b9d83c81448ec891a": {
363 | "model_module": "@jupyter-widgets/controls",
364 | "model_name": "HBoxModel",
365 | "model_module_version": "1.5.0",
366 | "state": {
367 | "_dom_classes": [],
368 | "_model_module": "@jupyter-widgets/controls",
369 | "_model_module_version": "1.5.0",
370 | "_model_name": "HBoxModel",
371 | "_view_count": null,
372 | "_view_module": "@jupyter-widgets/controls",
373 | "_view_module_version": "1.5.0",
374 | "_view_name": "HBoxView",
375 | "box_style": "",
376 | "children": [
377 | "IPY_MODEL_eef23369bd3643fbac4d9daedd35bf8e",
378 | "IPY_MODEL_10c2178666304d40900ec1aa7ed81a2a",
379 | "IPY_MODEL_5e4072737287496da4921b5cf8500a7c"
380 | ],
381 | "layout": "IPY_MODEL_20f744e4872e4400a1cce33c5b5e093d"
382 | }
383 | },
384 | "eef23369bd3643fbac4d9daedd35bf8e": {
385 | "model_module": "@jupyter-widgets/controls",
386 | "model_name": "HTMLModel",
387 | "model_module_version": "1.5.0",
388 | "state": {
389 | "_dom_classes": [],
390 | "_model_module": "@jupyter-widgets/controls",
391 | "_model_module_version": "1.5.0",
392 | "_model_name": "HTMLModel",
393 | "_view_count": null,
394 | "_view_module": "@jupyter-widgets/controls",
395 | "_view_module_version": "1.5.0",
396 | "_view_name": "HTMLView",
397 | "description": "",
398 | "description_tooltip": null,
399 | "layout": "IPY_MODEL_f9f72195acc44f4692eff40af44809c3",
400 | "placeholder": "",
401 | "style": "IPY_MODEL_1a9a4c298f2449319e2137f35c2a6f42",
402 | "value": "Dl Size...: 100%"
403 | }
404 | },
405 | "10c2178666304d40900ec1aa7ed81a2a": {
406 | "model_module": "@jupyter-widgets/controls",
407 | "model_name": "FloatProgressModel",
408 | "model_module_version": "1.5.0",
409 | "state": {
410 | "_dom_classes": [],
411 | "_model_module": "@jupyter-widgets/controls",
412 | "_model_module_version": "1.5.0",
413 | "_model_name": "FloatProgressModel",
414 | "_view_count": null,
415 | "_view_module": "@jupyter-widgets/controls",
416 | "_view_module_version": "1.5.0",
417 | "_view_name": "ProgressView",
418 | "bar_style": "success",
419 | "description": "",
420 | "description_tooltip": null,
421 | "layout": "IPY_MODEL_dcd3e61974f145d684ae05df73cafc89",
422 | "max": 1,
423 | "min": 0,
424 | "orientation": "horizontal",
425 | "style": "IPY_MODEL_10f73b7c2aec4eed92a0d41d0e8bede1",
426 | "value": 1
427 | }
428 | },
429 | "5e4072737287496da4921b5cf8500a7c": {
430 | "model_module": "@jupyter-widgets/controls",
431 | "model_name": "HTMLModel",
432 | "model_module_version": "1.5.0",
433 | "state": {
434 | "_dom_classes": [],
435 | "_model_module": "@jupyter-widgets/controls",
436 | "_model_module_version": "1.5.0",
437 | "_model_name": "HTMLModel",
438 | "_view_count": null,
439 | "_view_module": "@jupyter-widgets/controls",
440 | "_view_module_version": "1.5.0",
441 | "_view_name": "HTMLView",
442 | "description": "",
443 | "description_tooltip": null,
444 | "layout": "IPY_MODEL_2a857876349e44f09119067f8c3ecd45",
445 | "placeholder": "",
446 | "style": "IPY_MODEL_6bffef1006cf4e5fb962296a9f436cff",
447 | "value": " 80/80 [00:01<00:00, 75.48 MiB/s]"
448 | }
449 | },
450 | "20f744e4872e4400a1cce33c5b5e093d": {
451 | "model_module": "@jupyter-widgets/base",
452 | "model_name": "LayoutModel",
453 | "model_module_version": "1.2.0",
454 | "state": {
455 | "_model_module": "@jupyter-widgets/base",
456 | "_model_module_version": "1.2.0",
457 | "_model_name": "LayoutModel",
458 | "_view_count": null,
459 | "_view_module": "@jupyter-widgets/base",
460 | "_view_module_version": "1.2.0",
461 | "_view_name": "LayoutView",
462 | "align_content": null,
463 | "align_items": null,
464 | "align_self": null,
465 | "border": null,
466 | "bottom": null,
467 | "display": null,
468 | "flex": null,
469 | "flex_flow": null,
470 | "grid_area": null,
471 | "grid_auto_columns": null,
472 | "grid_auto_flow": null,
473 | "grid_auto_rows": null,
474 | "grid_column": null,
475 | "grid_gap": null,
476 | "grid_row": null,
477 | "grid_template_areas": null,
478 | "grid_template_columns": null,
479 | "grid_template_rows": null,
480 | "height": null,
481 | "justify_content": null,
482 | "justify_items": null,
483 | "left": null,
484 | "margin": null,
485 | "max_height": null,
486 | "max_width": null,
487 | "min_height": null,
488 | "min_width": null,
489 | "object_fit": null,
490 | "object_position": null,
491 | "order": null,
492 | "overflow": null,
493 | "overflow_x": null,
494 | "overflow_y": null,
495 | "padding": null,
496 | "right": null,
497 | "top": null,
498 | "visibility": null,
499 | "width": null
500 | }
501 | },
502 | "f9f72195acc44f4692eff40af44809c3": {
503 | "model_module": "@jupyter-widgets/base",
504 | "model_name": "LayoutModel",
505 | "model_module_version": "1.2.0",
506 | "state": {
507 | "_model_module": "@jupyter-widgets/base",
508 | "_model_module_version": "1.2.0",
509 | "_model_name": "LayoutModel",
510 | "_view_count": null,
511 | "_view_module": "@jupyter-widgets/base",
512 | "_view_module_version": "1.2.0",
513 | "_view_name": "LayoutView",
514 | "align_content": null,
515 | "align_items": null,
516 | "align_self": null,
517 | "border": null,
518 | "bottom": null,
519 | "display": null,
520 | "flex": null,
521 | "flex_flow": null,
522 | "grid_area": null,
523 | "grid_auto_columns": null,
524 | "grid_auto_flow": null,
525 | "grid_auto_rows": null,
526 | "grid_column": null,
527 | "grid_gap": null,
528 | "grid_row": null,
529 | "grid_template_areas": null,
530 | "grid_template_columns": null,
531 | "grid_template_rows": null,
532 | "height": null,
533 | "justify_content": null,
534 | "justify_items": null,
535 | "left": null,
536 | "margin": null,
537 | "max_height": null,
538 | "max_width": null,
539 | "min_height": null,
540 | "min_width": null,
541 | "object_fit": null,
542 | "object_position": null,
543 | "order": null,
544 | "overflow": null,
545 | "overflow_x": null,
546 | "overflow_y": null,
547 | "padding": null,
548 | "right": null,
549 | "top": null,
550 | "visibility": null,
551 | "width": null
552 | }
553 | },
554 | "1a9a4c298f2449319e2137f35c2a6f42": {
555 | "model_module": "@jupyter-widgets/controls",
556 | "model_name": "DescriptionStyleModel",
557 | "model_module_version": "1.5.0",
558 | "state": {
559 | "_model_module": "@jupyter-widgets/controls",
560 | "_model_module_version": "1.5.0",
561 | "_model_name": "DescriptionStyleModel",
562 | "_view_count": null,
563 | "_view_module": "@jupyter-widgets/base",
564 | "_view_module_version": "1.2.0",
565 | "_view_name": "StyleView",
566 | "description_width": ""
567 | }
568 | },
569 | "dcd3e61974f145d684ae05df73cafc89": {
570 | "model_module": "@jupyter-widgets/base",
571 | "model_name": "LayoutModel",
572 | "model_module_version": "1.2.0",
573 | "state": {
574 | "_model_module": "@jupyter-widgets/base",
575 | "_model_module_version": "1.2.0",
576 | "_model_name": "LayoutModel",
577 | "_view_count": null,
578 | "_view_module": "@jupyter-widgets/base",
579 | "_view_module_version": "1.2.0",
580 | "_view_name": "LayoutView",
581 | "align_content": null,
582 | "align_items": null,
583 | "align_self": null,
584 | "border": null,
585 | "bottom": null,
586 | "display": null,
587 | "flex": null,
588 | "flex_flow": null,
589 | "grid_area": null,
590 | "grid_auto_columns": null,
591 | "grid_auto_flow": null,
592 | "grid_auto_rows": null,
593 | "grid_column": null,
594 | "grid_gap": null,
595 | "grid_row": null,
596 | "grid_template_areas": null,
597 | "grid_template_columns": null,
598 | "grid_template_rows": null,
599 | "height": null,
600 | "justify_content": null,
601 | "justify_items": null,
602 | "left": null,
603 | "margin": null,
604 | "max_height": null,
605 | "max_width": null,
606 | "min_height": null,
607 | "min_width": null,
608 | "object_fit": null,
609 | "object_position": null,
610 | "order": null,
611 | "overflow": null,
612 | "overflow_x": null,
613 | "overflow_y": null,
614 | "padding": null,
615 | "right": null,
616 | "top": null,
617 | "visibility": null,
618 | "width": "20px"
619 | }
620 | },
621 | "10f73b7c2aec4eed92a0d41d0e8bede1": {
622 | "model_module": "@jupyter-widgets/controls",
623 | "model_name": "ProgressStyleModel",
624 | "model_module_version": "1.5.0",
625 | "state": {
626 | "_model_module": "@jupyter-widgets/controls",
627 | "_model_module_version": "1.5.0",
628 | "_model_name": "ProgressStyleModel",
629 | "_view_count": null,
630 | "_view_module": "@jupyter-widgets/base",
631 | "_view_module_version": "1.2.0",
632 | "_view_name": "StyleView",
633 | "bar_color": null,
634 | "description_width": ""
635 | }
636 | },
637 | "2a857876349e44f09119067f8c3ecd45": {
638 | "model_module": "@jupyter-widgets/base",
639 | "model_name": "LayoutModel",
640 | "model_module_version": "1.2.0",
641 | "state": {
642 | "_model_module": "@jupyter-widgets/base",
643 | "_model_module_version": "1.2.0",
644 | "_model_name": "LayoutModel",
645 | "_view_count": null,
646 | "_view_module": "@jupyter-widgets/base",
647 | "_view_module_version": "1.2.0",
648 | "_view_name": "LayoutView",
649 | "align_content": null,
650 | "align_items": null,
651 | "align_self": null,
652 | "border": null,
653 | "bottom": null,
654 | "display": null,
655 | "flex": null,
656 | "flex_flow": null,
657 | "grid_area": null,
658 | "grid_auto_columns": null,
659 | "grid_auto_flow": null,
660 | "grid_auto_rows": null,
661 | "grid_column": null,
662 | "grid_gap": null,
663 | "grid_row": null,
664 | "grid_template_areas": null,
665 | "grid_template_columns": null,
666 | "grid_template_rows": null,
667 | "height": null,
668 | "justify_content": null,
669 | "justify_items": null,
670 | "left": null,
671 | "margin": null,
672 | "max_height": null,
673 | "max_width": null,
674 | "min_height": null,
675 | "min_width": null,
676 | "object_fit": null,
677 | "object_position": null,
678 | "order": null,
679 | "overflow": null,
680 | "overflow_x": null,
681 | "overflow_y": null,
682 | "padding": null,
683 | "right": null,
684 | "top": null,
685 | "visibility": null,
686 | "width": null
687 | }
688 | },
689 | "6bffef1006cf4e5fb962296a9f436cff": {
690 | "model_module": "@jupyter-widgets/controls",
691 | "model_name": "DescriptionStyleModel",
692 | "model_module_version": "1.5.0",
693 | "state": {
694 | "_model_module": "@jupyter-widgets/controls",
695 | "_model_module_version": "1.5.0",
696 | "_model_name": "DescriptionStyleModel",
697 | "_view_count": null,
698 | "_view_module": "@jupyter-widgets/base",
699 | "_view_module_version": "1.2.0",
700 | "_view_name": "StyleView",
701 | "description_width": ""
702 | }
703 | },
704 | "cd666a0c2b2e48b995cc54ca36fccdf3": {
705 | "model_module": "@jupyter-widgets/controls",
706 | "model_name": "HBoxModel",
707 | "model_module_version": "1.5.0",
708 | "state": {
709 | "_dom_classes": [],
710 | "_model_module": "@jupyter-widgets/controls",
711 | "_model_module_version": "1.5.0",
712 | "_model_name": "HBoxModel",
713 | "_view_count": null,
714 | "_view_module": "@jupyter-widgets/controls",
715 | "_view_module_version": "1.5.0",
716 | "_view_name": "HBoxView",
717 | "box_style": "",
718 | "children": [
719 | "IPY_MODEL_e89b1d933be84497b573d2d898b48951",
720 | "IPY_MODEL_223f0c3e7d0243eea7889b07b4ef9b1f",
721 | "IPY_MODEL_c61a98a2d1434686a1359a2bdcbaf4aa"
722 | ],
723 | "layout": "IPY_MODEL_6a2def4fcd044b869970ca1925a775d8"
724 | }
725 | },
726 | "e89b1d933be84497b573d2d898b48951": {
727 | "model_module": "@jupyter-widgets/controls",
728 | "model_name": "HTMLModel",
729 | "model_module_version": "1.5.0",
730 | "state": {
731 | "_dom_classes": [],
732 | "_model_module": "@jupyter-widgets/controls",
733 | "_model_module_version": "1.5.0",
734 | "_model_name": "HTMLModel",
735 | "_view_count": null,
736 | "_view_module": "@jupyter-widgets/controls",
737 | "_view_module_version": "1.5.0",
738 | "_view_name": "HTMLView",
739 | "description": "",
740 | "description_tooltip": null,
741 | "layout": "IPY_MODEL_1c2f4629a1454ab6a363069fb418a117",
742 | "placeholder": "",
743 | "style": "IPY_MODEL_c63ecefd70b14c268e4cfb113b1dc4eb",
744 | "value": "Generating splits...: 100%"
745 | }
746 | },
747 | "223f0c3e7d0243eea7889b07b4ef9b1f": {
748 | "model_module": "@jupyter-widgets/controls",
749 | "model_name": "FloatProgressModel",
750 | "model_module_version": "1.5.0",
751 | "state": {
752 | "_dom_classes": [],
753 | "_model_module": "@jupyter-widgets/controls",
754 | "_model_module_version": "1.5.0",
755 | "_model_name": "FloatProgressModel",
756 | "_view_count": null,
757 | "_view_module": "@jupyter-widgets/controls",
758 | "_view_module_version": "1.5.0",
759 | "_view_name": "ProgressView",
760 | "bar_style": "",
761 | "description": "",
762 | "description_tooltip": null,
763 | "layout": "IPY_MODEL_a336071f42d94b77aeac4f9d185ccc0c",
764 | "max": 3,
765 | "min": 0,
766 | "orientation": "horizontal",
767 | "style": "IPY_MODEL_0d7bd5d5cfba4aaabf64589d054b9d56",
768 | "value": 3
769 | }
770 | },
771 | "c61a98a2d1434686a1359a2bdcbaf4aa": {
772 | "model_module": "@jupyter-widgets/controls",
773 | "model_name": "HTMLModel",
774 | "model_module_version": "1.5.0",
775 | "state": {
776 | "_dom_classes": [],
777 | "_model_module": "@jupyter-widgets/controls",
778 | "_model_module_version": "1.5.0",
779 | "_model_name": "HTMLModel",
780 | "_view_count": null,
781 | "_view_module": "@jupyter-widgets/controls",
782 | "_view_module_version": "1.5.0",
783 | "_view_name": "HTMLView",
784 | "description": "",
785 | "description_tooltip": null,
786 | "layout": "IPY_MODEL_77c25dd467f249f2a349af3261032aac",
787 | "placeholder": "",
788 | "style": "IPY_MODEL_48db30e6f6e0407297c83738a5c6fa13",
789 | "value": " 3/3 [00:57<00:00, 18.77s/ splits]"
790 | }
791 | },
792 | "6a2def4fcd044b869970ca1925a775d8": {
793 | "model_module": "@jupyter-widgets/base",
794 | "model_name": "LayoutModel",
795 | "model_module_version": "1.2.0",
796 | "state": {
797 | "_model_module": "@jupyter-widgets/base",
798 | "_model_module_version": "1.2.0",
799 | "_model_name": "LayoutModel",
800 | "_view_count": null,
801 | "_view_module": "@jupyter-widgets/base",
802 | "_view_module_version": "1.2.0",
803 | "_view_name": "LayoutView",
804 | "align_content": null,
805 | "align_items": null,
806 | "align_self": null,
807 | "border": null,
808 | "bottom": null,
809 | "display": null,
810 | "flex": null,
811 | "flex_flow": null,
812 | "grid_area": null,
813 | "grid_auto_columns": null,
814 | "grid_auto_flow": null,
815 | "grid_auto_rows": null,
816 | "grid_column": null,
817 | "grid_gap": null,
818 | "grid_row": null,
819 | "grid_template_areas": null,
820 | "grid_template_columns": null,
821 | "grid_template_rows": null,
822 | "height": null,
823 | "justify_content": null,
824 | "justify_items": null,
825 | "left": null,
826 | "margin": null,
827 | "max_height": null,
828 | "max_width": null,
829 | "min_height": null,
830 | "min_width": null,
831 | "object_fit": null,
832 | "object_position": null,
833 | "order": null,
834 | "overflow": null,
835 | "overflow_x": null,
836 | "overflow_y": null,
837 | "padding": null,
838 | "right": null,
839 | "top": null,
840 | "visibility": "hidden",
841 | "width": null
842 | }
843 | },
844 | "1c2f4629a1454ab6a363069fb418a117": {
845 | "model_module": "@jupyter-widgets/base",
846 | "model_name": "LayoutModel",
847 | "model_module_version": "1.2.0",
848 | "state": {
849 | "_model_module": "@jupyter-widgets/base",
850 | "_model_module_version": "1.2.0",
851 | "_model_name": "LayoutModel",
852 | "_view_count": null,
853 | "_view_module": "@jupyter-widgets/base",
854 | "_view_module_version": "1.2.0",
855 | "_view_name": "LayoutView",
856 | "align_content": null,
857 | "align_items": null,
858 | "align_self": null,
859 | "border": null,
860 | "bottom": null,
861 | "display": null,
862 | "flex": null,
863 | "flex_flow": null,
864 | "grid_area": null,
865 | "grid_auto_columns": null,
866 | "grid_auto_flow": null,
867 | "grid_auto_rows": null,
868 | "grid_column": null,
869 | "grid_gap": null,
870 | "grid_row": null,
871 | "grid_template_areas": null,
872 | "grid_template_columns": null,
873 | "grid_template_rows": null,
874 | "height": null,
875 | "justify_content": null,
876 | "justify_items": null,
877 | "left": null,
878 | "margin": null,
879 | "max_height": null,
880 | "max_width": null,
881 | "min_height": null,
882 | "min_width": null,
883 | "object_fit": null,
884 | "object_position": null,
885 | "order": null,
886 | "overflow": null,
887 | "overflow_x": null,
888 | "overflow_y": null,
889 | "padding": null,
890 | "right": null,
891 | "top": null,
892 | "visibility": null,
893 | "width": null
894 | }
895 | },
896 | "c63ecefd70b14c268e4cfb113b1dc4eb": {
897 | "model_module": "@jupyter-widgets/controls",
898 | "model_name": "DescriptionStyleModel",
899 | "model_module_version": "1.5.0",
900 | "state": {
901 | "_model_module": "@jupyter-widgets/controls",
902 | "_model_module_version": "1.5.0",
903 | "_model_name": "DescriptionStyleModel",
904 | "_view_count": null,
905 | "_view_module": "@jupyter-widgets/base",
906 | "_view_module_version": "1.2.0",
907 | "_view_name": "StyleView",
908 | "description_width": ""
909 | }
910 | },
911 | "a336071f42d94b77aeac4f9d185ccc0c": {
912 | "model_module": "@jupyter-widgets/base",
913 | "model_name": "LayoutModel",
914 | "model_module_version": "1.2.0",
915 | "state": {
916 | "_model_module": "@jupyter-widgets/base",
917 | "_model_module_version": "1.2.0",
918 | "_model_name": "LayoutModel",
919 | "_view_count": null,
920 | "_view_module": "@jupyter-widgets/base",
921 | "_view_module_version": "1.2.0",
922 | "_view_name": "LayoutView",
923 | "align_content": null,
924 | "align_items": null,
925 | "align_self": null,
926 | "border": null,
927 | "bottom": null,
928 | "display": null,
929 | "flex": null,
930 | "flex_flow": null,
931 | "grid_area": null,
932 | "grid_auto_columns": null,
933 | "grid_auto_flow": null,
934 | "grid_auto_rows": null,
935 | "grid_column": null,
936 | "grid_gap": null,
937 | "grid_row": null,
938 | "grid_template_areas": null,
939 | "grid_template_columns": null,
940 | "grid_template_rows": null,
941 | "height": null,
942 | "justify_content": null,
943 | "justify_items": null,
944 | "left": null,
945 | "margin": null,
946 | "max_height": null,
947 | "max_width": null,
948 | "min_height": null,
949 | "min_width": null,
950 | "object_fit": null,
951 | "object_position": null,
952 | "order": null,
953 | "overflow": null,
954 | "overflow_x": null,
955 | "overflow_y": null,
956 | "padding": null,
957 | "right": null,
958 | "top": null,
959 | "visibility": null,
960 | "width": null
961 | }
962 | },
963 | "0d7bd5d5cfba4aaabf64589d054b9d56": {
964 | "model_module": "@jupyter-widgets/controls",
965 | "model_name": "ProgressStyleModel",
966 | "model_module_version": "1.5.0",
967 | "state": {
968 | "_model_module": "@jupyter-widgets/controls",
969 | "_model_module_version": "1.5.0",
970 | "_model_name": "ProgressStyleModel",
971 | "_view_count": null,
972 | "_view_module": "@jupyter-widgets/base",
973 | "_view_module_version": "1.2.0",
974 | "_view_name": "StyleView",
975 | "bar_color": null,
976 | "description_width": ""
977 | }
978 | },
979 | "77c25dd467f249f2a349af3261032aac": {
980 | "model_module": "@jupyter-widgets/base",
981 | "model_name": "LayoutModel",
982 | "model_module_version": "1.2.0",
983 | "state": {
984 | "_model_module": "@jupyter-widgets/base",
985 | "_model_module_version": "1.2.0",
986 | "_model_name": "LayoutModel",
987 | "_view_count": null,
988 | "_view_module": "@jupyter-widgets/base",
989 | "_view_module_version": "1.2.0",
990 | "_view_name": "LayoutView",
991 | "align_content": null,
992 | "align_items": null,
993 | "align_self": null,
994 | "border": null,
995 | "bottom": null,
996 | "display": null,
997 | "flex": null,
998 | "flex_flow": null,
999 | "grid_area": null,
1000 | "grid_auto_columns": null,
1001 | "grid_auto_flow": null,
1002 | "grid_auto_rows": null,
1003 | "grid_column": null,
1004 | "grid_gap": null,
1005 | "grid_row": null,
1006 | "grid_template_areas": null,
1007 | "grid_template_columns": null,
1008 | "grid_template_rows": null,
1009 | "height": null,
1010 | "justify_content": null,
1011 | "justify_items": null,
1012 | "left": null,
1013 | "margin": null,
1014 | "max_height": null,
1015 | "max_width": null,
1016 | "min_height": null,
1017 | "min_width": null,
1018 | "object_fit": null,
1019 | "object_position": null,
1020 | "order": null,
1021 | "overflow": null,
1022 | "overflow_x": null,
1023 | "overflow_y": null,
1024 | "padding": null,
1025 | "right": null,
1026 | "top": null,
1027 | "visibility": null,
1028 | "width": null
1029 | }
1030 | },
1031 | "48db30e6f6e0407297c83738a5c6fa13": {
1032 | "model_module": "@jupyter-widgets/controls",
1033 | "model_name": "DescriptionStyleModel",
1034 | "model_module_version": "1.5.0",
1035 | "state": {
1036 | "_model_module": "@jupyter-widgets/controls",
1037 | "_model_module_version": "1.5.0",
1038 | "_model_name": "DescriptionStyleModel",
1039 | "_view_count": null,
1040 | "_view_module": "@jupyter-widgets/base",
1041 | "_view_module_version": "1.2.0",
1042 | "_view_name": "StyleView",
1043 | "description_width": ""
1044 | }
1045 | },
1046 | "149bab124f4c4f44b59ef4d63a07f02d": {
1047 | "model_module": "@jupyter-widgets/controls",
1048 | "model_name": "HBoxModel",
1049 | "model_module_version": "1.5.0",
1050 | "state": {
1051 | "_dom_classes": [],
1052 | "_model_module": "@jupyter-widgets/controls",
1053 | "_model_module_version": "1.5.0",
1054 | "_model_name": "HBoxModel",
1055 | "_view_count": null,
1056 | "_view_module": "@jupyter-widgets/controls",
1057 | "_view_module_version": "1.5.0",
1058 | "_view_name": "HBoxView",
1059 | "box_style": "",
1060 | "children": [
1061 | "IPY_MODEL_06efa4a5c87e463690f87c9b67e3f44a",
1062 | "IPY_MODEL_3630b3350dc548549631ceb2b46130b6",
1063 | "IPY_MODEL_4acc59eee6f74cfc80b831d0ef177bc6"
1064 | ],
1065 | "layout": "IPY_MODEL_09ccfba66baa407ca46b82e4238d1ed2"
1066 | }
1067 | },
1068 | "06efa4a5c87e463690f87c9b67e3f44a": {
1069 | "model_module": "@jupyter-widgets/controls",
1070 | "model_name": "HTMLModel",
1071 | "model_module_version": "1.5.0",
1072 | "state": {
1073 | "_dom_classes": [],
1074 | "_model_module": "@jupyter-widgets/controls",
1075 | "_model_module_version": "1.5.0",
1076 | "_model_name": "HTMLModel",
1077 | "_view_count": null,
1078 | "_view_module": "@jupyter-widgets/controls",
1079 | "_view_module_version": "1.5.0",
1080 | "_view_name": "HTMLView",
1081 | "description": "",
1082 | "description_tooltip": null,
1083 | "layout": "IPY_MODEL_1c16f6e380f843ce8e59fff0d1cad88b",
1084 | "placeholder": "",
1085 | "style": "IPY_MODEL_727d0a9eea1143fb97e37e5722e2adb5",
1086 | "value": "Generating train examples...: 100%"
1087 | }
1088 | },
1089 | "3630b3350dc548549631ceb2b46130b6": {
1090 | "model_module": "@jupyter-widgets/controls",
1091 | "model_name": "FloatProgressModel",
1092 | "model_module_version": "1.5.0",
1093 | "state": {
1094 | "_dom_classes": [],
1095 | "_model_module": "@jupyter-widgets/controls",
1096 | "_model_module_version": "1.5.0",
1097 | "_model_name": "FloatProgressModel",
1098 | "_view_count": null,
1099 | "_view_module": "@jupyter-widgets/controls",
1100 | "_view_module_version": "1.5.0",
1101 | "_view_name": "ProgressView",
1102 | "bar_style": "",
1103 | "description": "",
1104 | "description_tooltip": null,
1105 | "layout": "IPY_MODEL_c333de07fea040338b250efe6de5bd15",
1106 | "max": 25000,
1107 | "min": 0,
1108 | "orientation": "horizontal",
1109 | "style": "IPY_MODEL_b43d812de0b24b25bd4bf12e33d642ad",
1110 | "value": 25000
1111 | }
1112 | },
1113 | "4acc59eee6f74cfc80b831d0ef177bc6": {
1114 | "model_module": "@jupyter-widgets/controls",
1115 | "model_name": "HTMLModel",
1116 | "model_module_version": "1.5.0",
1117 | "state": {
1118 | "_dom_classes": [],
1119 | "_model_module": "@jupyter-widgets/controls",
1120 | "_model_module_version": "1.5.0",
1121 | "_model_name": "HTMLModel",
1122 | "_view_count": null,
1123 | "_view_module": "@jupyter-widgets/controls",
1124 | "_view_module_version": "1.5.0",
1125 | "_view_name": "HTMLView",
1126 | "description": "",
1127 | "description_tooltip": null,
1128 | "layout": "IPY_MODEL_21fed1f71da44f21b2fb0814b4de58c5",
1129 | "placeholder": "",
1130 | "style": "IPY_MODEL_593709e37e36407da8612ad3f101c0be",
1131 | "value": " 24941/25000 [00:13<00:00, 2307.16 examples/s]"
1132 | }
1133 | },
1134 | "09ccfba66baa407ca46b82e4238d1ed2": {
1135 | "model_module": "@jupyter-widgets/base",
1136 | "model_name": "LayoutModel",
1137 | "model_module_version": "1.2.0",
1138 | "state": {
1139 | "_model_module": "@jupyter-widgets/base",
1140 | "_model_module_version": "1.2.0",
1141 | "_model_name": "LayoutModel",
1142 | "_view_count": null,
1143 | "_view_module": "@jupyter-widgets/base",
1144 | "_view_module_version": "1.2.0",
1145 | "_view_name": "LayoutView",
1146 | "align_content": null,
1147 | "align_items": null,
1148 | "align_self": null,
1149 | "border": null,
1150 | "bottom": null,
1151 | "display": null,
1152 | "flex": null,
1153 | "flex_flow": null,
1154 | "grid_area": null,
1155 | "grid_auto_columns": null,
1156 | "grid_auto_flow": null,
1157 | "grid_auto_rows": null,
1158 | "grid_column": null,
1159 | "grid_gap": null,
1160 | "grid_row": null,
1161 | "grid_template_areas": null,
1162 | "grid_template_columns": null,
1163 | "grid_template_rows": null,
1164 | "height": null,
1165 | "justify_content": null,
1166 | "justify_items": null,
1167 | "left": null,
1168 | "margin": null,
1169 | "max_height": null,
1170 | "max_width": null,
1171 | "min_height": null,
1172 | "min_width": null,
1173 | "object_fit": null,
1174 | "object_position": null,
1175 | "order": null,
1176 | "overflow": null,
1177 | "overflow_x": null,
1178 | "overflow_y": null,
1179 | "padding": null,
1180 | "right": null,
1181 | "top": null,
1182 | "visibility": "hidden",
1183 | "width": null
1184 | }
1185 | },
1186 | "1c16f6e380f843ce8e59fff0d1cad88b": {
1187 | "model_module": "@jupyter-widgets/base",
1188 | "model_name": "LayoutModel",
1189 | "model_module_version": "1.2.0",
1190 | "state": {
1191 | "_model_module": "@jupyter-widgets/base",
1192 | "_model_module_version": "1.2.0",
1193 | "_model_name": "LayoutModel",
1194 | "_view_count": null,
1195 | "_view_module": "@jupyter-widgets/base",
1196 | "_view_module_version": "1.2.0",
1197 | "_view_name": "LayoutView",
1198 | "align_content": null,
1199 | "align_items": null,
1200 | "align_self": null,
1201 | "border": null,
1202 | "bottom": null,
1203 | "display": null,
1204 | "flex": null,
1205 | "flex_flow": null,
1206 | "grid_area": null,
1207 | "grid_auto_columns": null,
1208 | "grid_auto_flow": null,
1209 | "grid_auto_rows": null,
1210 | "grid_column": null,
1211 | "grid_gap": null,
1212 | "grid_row": null,
1213 | "grid_template_areas": null,
1214 | "grid_template_columns": null,
1215 | "grid_template_rows": null,
1216 | "height": null,
1217 | "justify_content": null,
1218 | "justify_items": null,
1219 | "left": null,
1220 | "margin": null,
1221 | "max_height": null,
1222 | "max_width": null,
1223 | "min_height": null,
1224 | "min_width": null,
1225 | "object_fit": null,
1226 | "object_position": null,
1227 | "order": null,
1228 | "overflow": null,
1229 | "overflow_x": null,
1230 | "overflow_y": null,
1231 | "padding": null,
1232 | "right": null,
1233 | "top": null,
1234 | "visibility": null,
1235 | "width": null
1236 | }
1237 | },
1238 | "727d0a9eea1143fb97e37e5722e2adb5": {
1239 | "model_module": "@jupyter-widgets/controls",
1240 | "model_name": "DescriptionStyleModel",
1241 | "model_module_version": "1.5.0",
1242 | "state": {
1243 | "_model_module": "@jupyter-widgets/controls",
1244 | "_model_module_version": "1.5.0",
1245 | "_model_name": "DescriptionStyleModel",
1246 | "_view_count": null,
1247 | "_view_module": "@jupyter-widgets/base",
1248 | "_view_module_version": "1.2.0",
1249 | "_view_name": "StyleView",
1250 | "description_width": ""
1251 | }
1252 | },
1253 | "c333de07fea040338b250efe6de5bd15": {
1254 | "model_module": "@jupyter-widgets/base",
1255 | "model_name": "LayoutModel",
1256 | "model_module_version": "1.2.0",
1257 | "state": {
1258 | "_model_module": "@jupyter-widgets/base",
1259 | "_model_module_version": "1.2.0",
1260 | "_model_name": "LayoutModel",
1261 | "_view_count": null,
1262 | "_view_module": "@jupyter-widgets/base",
1263 | "_view_module_version": "1.2.0",
1264 | "_view_name": "LayoutView",
1265 | "align_content": null,
1266 | "align_items": null,
1267 | "align_self": null,
1268 | "border": null,
1269 | "bottom": null,
1270 | "display": null,
1271 | "flex": null,
1272 | "flex_flow": null,
1273 | "grid_area": null,
1274 | "grid_auto_columns": null,
1275 | "grid_auto_flow": null,
1276 | "grid_auto_rows": null,
1277 | "grid_column": null,
1278 | "grid_gap": null,
1279 | "grid_row": null,
1280 | "grid_template_areas": null,
1281 | "grid_template_columns": null,
1282 | "grid_template_rows": null,
1283 | "height": null,
1284 | "justify_content": null,
1285 | "justify_items": null,
1286 | "left": null,
1287 | "margin": null,
1288 | "max_height": null,
1289 | "max_width": null,
1290 | "min_height": null,
1291 | "min_width": null,
1292 | "object_fit": null,
1293 | "object_position": null,
1294 | "order": null,
1295 | "overflow": null,
1296 | "overflow_x": null,
1297 | "overflow_y": null,
1298 | "padding": null,
1299 | "right": null,
1300 | "top": null,
1301 | "visibility": null,
1302 | "width": null
1303 | }
1304 | },
1305 | "b43d812de0b24b25bd4bf12e33d642ad": {
1306 | "model_module": "@jupyter-widgets/controls",
1307 | "model_name": "ProgressStyleModel",
1308 | "model_module_version": "1.5.0",
1309 | "state": {
1310 | "_model_module": "@jupyter-widgets/controls",
1311 | "_model_module_version": "1.5.0",
1312 | "_model_name": "ProgressStyleModel",
1313 | "_view_count": null,
1314 | "_view_module": "@jupyter-widgets/base",
1315 | "_view_module_version": "1.2.0",
1316 | "_view_name": "StyleView",
1317 | "bar_color": null,
1318 | "description_width": ""
1319 | }
1320 | },
1321 | "21fed1f71da44f21b2fb0814b4de58c5": {
1322 | "model_module": "@jupyter-widgets/base",
1323 | "model_name": "LayoutModel",
1324 | "model_module_version": "1.2.0",
1325 | "state": {
1326 | "_model_module": "@jupyter-widgets/base",
1327 | "_model_module_version": "1.2.0",
1328 | "_model_name": "LayoutModel",
1329 | "_view_count": null,
1330 | "_view_module": "@jupyter-widgets/base",
1331 | "_view_module_version": "1.2.0",
1332 | "_view_name": "LayoutView",
1333 | "align_content": null,
1334 | "align_items": null,
1335 | "align_self": null,
1336 | "border": null,
1337 | "bottom": null,
1338 | "display": null,
1339 | "flex": null,
1340 | "flex_flow": null,
1341 | "grid_area": null,
1342 | "grid_auto_columns": null,
1343 | "grid_auto_flow": null,
1344 | "grid_auto_rows": null,
1345 | "grid_column": null,
1346 | "grid_gap": null,
1347 | "grid_row": null,
1348 | "grid_template_areas": null,
1349 | "grid_template_columns": null,
1350 | "grid_template_rows": null,
1351 | "height": null,
1352 | "justify_content": null,
1353 | "justify_items": null,
1354 | "left": null,
1355 | "margin": null,
1356 | "max_height": null,
1357 | "max_width": null,
1358 | "min_height": null,
1359 | "min_width": null,
1360 | "object_fit": null,
1361 | "object_position": null,
1362 | "order": null,
1363 | "overflow": null,
1364 | "overflow_x": null,
1365 | "overflow_y": null,
1366 | "padding": null,
1367 | "right": null,
1368 | "top": null,
1369 | "visibility": null,
1370 | "width": null
1371 | }
1372 | },
1373 | "593709e37e36407da8612ad3f101c0be": {
1374 | "model_module": "@jupyter-widgets/controls",
1375 | "model_name": "DescriptionStyleModel",
1376 | "model_module_version": "1.5.0",
1377 | "state": {
1378 | "_model_module": "@jupyter-widgets/controls",
1379 | "_model_module_version": "1.5.0",
1380 | "_model_name": "DescriptionStyleModel",
1381 | "_view_count": null,
1382 | "_view_module": "@jupyter-widgets/base",
1383 | "_view_module_version": "1.2.0",
1384 | "_view_name": "StyleView",
1385 | "description_width": ""
1386 | }
1387 | },
1388 | "40a1e79a8fac4ff4ba1c8f186ac47340": {
1389 | "model_module": "@jupyter-widgets/controls",
1390 | "model_name": "HBoxModel",
1391 | "model_module_version": "1.5.0",
1392 | "state": {
1393 | "_dom_classes": [],
1394 | "_model_module": "@jupyter-widgets/controls",
1395 | "_model_module_version": "1.5.0",
1396 | "_model_name": "HBoxModel",
1397 | "_view_count": null,
1398 | "_view_module": "@jupyter-widgets/controls",
1399 | "_view_module_version": "1.5.0",
1400 | "_view_name": "HBoxView",
1401 | "box_style": "",
1402 | "children": [
1403 | "IPY_MODEL_a6d2b1e5f7ff46a8a18a37f2a1a0f526",
1404 | "IPY_MODEL_85b941ee509f411b8e3bd978b3d1cff5",
1405 | "IPY_MODEL_2c800664c8d043db892e40e07fce2f96"
1406 | ],
1407 | "layout": "IPY_MODEL_317410e8927a49ba8ba968e32269a08f"
1408 | }
1409 | },
1410 | "a6d2b1e5f7ff46a8a18a37f2a1a0f526": {
1411 | "model_module": "@jupyter-widgets/controls",
1412 | "model_name": "HTMLModel",
1413 | "model_module_version": "1.5.0",
1414 | "state": {
1415 | "_dom_classes": [],
1416 | "_model_module": "@jupyter-widgets/controls",
1417 | "_model_module_version": "1.5.0",
1418 | "_model_name": "HTMLModel",
1419 | "_view_count": null,
1420 | "_view_module": "@jupyter-widgets/controls",
1421 | "_view_module_version": "1.5.0",
1422 | "_view_name": "HTMLView",
1423 | "description": "",
1424 | "description_tooltip": null,
1425 | "layout": "IPY_MODEL_3fb33e76f8104b04aa18dfc464b72a1b",
1426 | "placeholder": "",
1427 | "style": "IPY_MODEL_d6315fd8422541a8bfa04cbabb976e94",
1428 | "value": "Shuffling /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0.incompleteSAD0T3/imdb_reviews-train.tfrecord*...: 70%"
1429 | }
1430 | },
1431 | "85b941ee509f411b8e3bd978b3d1cff5": {
1432 | "model_module": "@jupyter-widgets/controls",
1433 | "model_name": "FloatProgressModel",
1434 | "model_module_version": "1.5.0",
1435 | "state": {
1436 | "_dom_classes": [],
1437 | "_model_module": "@jupyter-widgets/controls",
1438 | "_model_module_version": "1.5.0",
1439 | "_model_name": "FloatProgressModel",
1440 | "_view_count": null,
1441 | "_view_module": "@jupyter-widgets/controls",
1442 | "_view_module_version": "1.5.0",
1443 | "_view_name": "ProgressView",
1444 | "bar_style": "",
1445 | "description": "",
1446 | "description_tooltip": null,
1447 | "layout": "IPY_MODEL_58c7d4ffceb44332a3b362737e6a3554",
1448 | "max": 25000,
1449 | "min": 0,
1450 | "orientation": "horizontal",
1451 | "style": "IPY_MODEL_5212b25a72474677b638478932d87425",
1452 | "value": 25000
1453 | }
1454 | },
1455 | "2c800664c8d043db892e40e07fce2f96": {
1456 | "model_module": "@jupyter-widgets/controls",
1457 | "model_name": "HTMLModel",
1458 | "model_module_version": "1.5.0",
1459 | "state": {
1460 | "_dom_classes": [],
1461 | "_model_module": "@jupyter-widgets/controls",
1462 | "_model_module_version": "1.5.0",
1463 | "_model_name": "HTMLModel",
1464 | "_view_count": null,
1465 | "_view_module": "@jupyter-widgets/controls",
1466 | "_view_module_version": "1.5.0",
1467 | "_view_name": "HTMLView",
1468 | "description": "",
1469 | "description_tooltip": null,
1470 | "layout": "IPY_MODEL_0d891a5143fa42bfb9b106391eb91939",
1471 | "placeholder": "",
1472 | "style": "IPY_MODEL_ed5f5d0280354ac9961fd05488548091",
1473 | "value": " 17517/25000 [00:00<00:00, 46400.19 examples/s]"
1474 | }
1475 | },
1476 | "317410e8927a49ba8ba968e32269a08f": {
1477 | "model_module": "@jupyter-widgets/base",
1478 | "model_name": "LayoutModel",
1479 | "model_module_version": "1.2.0",
1480 | "state": {
1481 | "_model_module": "@jupyter-widgets/base",
1482 | "_model_module_version": "1.2.0",
1483 | "_model_name": "LayoutModel",
1484 | "_view_count": null,
1485 | "_view_module": "@jupyter-widgets/base",
1486 | "_view_module_version": "1.2.0",
1487 | "_view_name": "LayoutView",
1488 | "align_content": null,
1489 | "align_items": null,
1490 | "align_self": null,
1491 | "border": null,
1492 | "bottom": null,
1493 | "display": null,
1494 | "flex": null,
1495 | "flex_flow": null,
1496 | "grid_area": null,
1497 | "grid_auto_columns": null,
1498 | "grid_auto_flow": null,
1499 | "grid_auto_rows": null,
1500 | "grid_column": null,
1501 | "grid_gap": null,
1502 | "grid_row": null,
1503 | "grid_template_areas": null,
1504 | "grid_template_columns": null,
1505 | "grid_template_rows": null,
1506 | "height": null,
1507 | "justify_content": null,
1508 | "justify_items": null,
1509 | "left": null,
1510 | "margin": null,
1511 | "max_height": null,
1512 | "max_width": null,
1513 | "min_height": null,
1514 | "min_width": null,
1515 | "object_fit": null,
1516 | "object_position": null,
1517 | "order": null,
1518 | "overflow": null,
1519 | "overflow_x": null,
1520 | "overflow_y": null,
1521 | "padding": null,
1522 | "right": null,
1523 | "top": null,
1524 | "visibility": "hidden",
1525 | "width": null
1526 | }
1527 | },
1528 | "3fb33e76f8104b04aa18dfc464b72a1b": {
1529 | "model_module": "@jupyter-widgets/base",
1530 | "model_name": "LayoutModel",
1531 | "model_module_version": "1.2.0",
1532 | "state": {
1533 | "_model_module": "@jupyter-widgets/base",
1534 | "_model_module_version": "1.2.0",
1535 | "_model_name": "LayoutModel",
1536 | "_view_count": null,
1537 | "_view_module": "@jupyter-widgets/base",
1538 | "_view_module_version": "1.2.0",
1539 | "_view_name": "LayoutView",
1540 | "align_content": null,
1541 | "align_items": null,
1542 | "align_self": null,
1543 | "border": null,
1544 | "bottom": null,
1545 | "display": null,
1546 | "flex": null,
1547 | "flex_flow": null,
1548 | "grid_area": null,
1549 | "grid_auto_columns": null,
1550 | "grid_auto_flow": null,
1551 | "grid_auto_rows": null,
1552 | "grid_column": null,
1553 | "grid_gap": null,
1554 | "grid_row": null,
1555 | "grid_template_areas": null,
1556 | "grid_template_columns": null,
1557 | "grid_template_rows": null,
1558 | "height": null,
1559 | "justify_content": null,
1560 | "justify_items": null,
1561 | "left": null,
1562 | "margin": null,
1563 | "max_height": null,
1564 | "max_width": null,
1565 | "min_height": null,
1566 | "min_width": null,
1567 | "object_fit": null,
1568 | "object_position": null,
1569 | "order": null,
1570 | "overflow": null,
1571 | "overflow_x": null,
1572 | "overflow_y": null,
1573 | "padding": null,
1574 | "right": null,
1575 | "top": null,
1576 | "visibility": null,
1577 | "width": null
1578 | }
1579 | },
1580 | "d6315fd8422541a8bfa04cbabb976e94": {
1581 | "model_module": "@jupyter-widgets/controls",
1582 | "model_name": "DescriptionStyleModel",
1583 | "model_module_version": "1.5.0",
1584 | "state": {
1585 | "_model_module": "@jupyter-widgets/controls",
1586 | "_model_module_version": "1.5.0",
1587 | "_model_name": "DescriptionStyleModel",
1588 | "_view_count": null,
1589 | "_view_module": "@jupyter-widgets/base",
1590 | "_view_module_version": "1.2.0",
1591 | "_view_name": "StyleView",
1592 | "description_width": ""
1593 | }
1594 | },
1595 | "58c7d4ffceb44332a3b362737e6a3554": {
1596 | "model_module": "@jupyter-widgets/base",
1597 | "model_name": "LayoutModel",
1598 | "model_module_version": "1.2.0",
1599 | "state": {
1600 | "_model_module": "@jupyter-widgets/base",
1601 | "_model_module_version": "1.2.0",
1602 | "_model_name": "LayoutModel",
1603 | "_view_count": null,
1604 | "_view_module": "@jupyter-widgets/base",
1605 | "_view_module_version": "1.2.0",
1606 | "_view_name": "LayoutView",
1607 | "align_content": null,
1608 | "align_items": null,
1609 | "align_self": null,
1610 | "border": null,
1611 | "bottom": null,
1612 | "display": null,
1613 | "flex": null,
1614 | "flex_flow": null,
1615 | "grid_area": null,
1616 | "grid_auto_columns": null,
1617 | "grid_auto_flow": null,
1618 | "grid_auto_rows": null,
1619 | "grid_column": null,
1620 | "grid_gap": null,
1621 | "grid_row": null,
1622 | "grid_template_areas": null,
1623 | "grid_template_columns": null,
1624 | "grid_template_rows": null,
1625 | "height": null,
1626 | "justify_content": null,
1627 | "justify_items": null,
1628 | "left": null,
1629 | "margin": null,
1630 | "max_height": null,
1631 | "max_width": null,
1632 | "min_height": null,
1633 | "min_width": null,
1634 | "object_fit": null,
1635 | "object_position": null,
1636 | "order": null,
1637 | "overflow": null,
1638 | "overflow_x": null,
1639 | "overflow_y": null,
1640 | "padding": null,
1641 | "right": null,
1642 | "top": null,
1643 | "visibility": null,
1644 | "width": null
1645 | }
1646 | },
1647 | "5212b25a72474677b638478932d87425": {
1648 | "model_module": "@jupyter-widgets/controls",
1649 | "model_name": "ProgressStyleModel",
1650 | "model_module_version": "1.5.0",
1651 | "state": {
1652 | "_model_module": "@jupyter-widgets/controls",
1653 | "_model_module_version": "1.5.0",
1654 | "_model_name": "ProgressStyleModel",
1655 | "_view_count": null,
1656 | "_view_module": "@jupyter-widgets/base",
1657 | "_view_module_version": "1.2.0",
1658 | "_view_name": "StyleView",
1659 | "bar_color": null,
1660 | "description_width": ""
1661 | }
1662 | },
1663 | "0d891a5143fa42bfb9b106391eb91939": {
1664 | "model_module": "@jupyter-widgets/base",
1665 | "model_name": "LayoutModel",
1666 | "model_module_version": "1.2.0",
1667 | "state": {
1668 | "_model_module": "@jupyter-widgets/base",
1669 | "_model_module_version": "1.2.0",
1670 | "_model_name": "LayoutModel",
1671 | "_view_count": null,
1672 | "_view_module": "@jupyter-widgets/base",
1673 | "_view_module_version": "1.2.0",
1674 | "_view_name": "LayoutView",
1675 | "align_content": null,
1676 | "align_items": null,
1677 | "align_self": null,
1678 | "border": null,
1679 | "bottom": null,
1680 | "display": null,
1681 | "flex": null,
1682 | "flex_flow": null,
1683 | "grid_area": null,
1684 | "grid_auto_columns": null,
1685 | "grid_auto_flow": null,
1686 | "grid_auto_rows": null,
1687 | "grid_column": null,
1688 | "grid_gap": null,
1689 | "grid_row": null,
1690 | "grid_template_areas": null,
1691 | "grid_template_columns": null,
1692 | "grid_template_rows": null,
1693 | "height": null,
1694 | "justify_content": null,
1695 | "justify_items": null,
1696 | "left": null,
1697 | "margin": null,
1698 | "max_height": null,
1699 | "max_width": null,
1700 | "min_height": null,
1701 | "min_width": null,
1702 | "object_fit": null,
1703 | "object_position": null,
1704 | "order": null,
1705 | "overflow": null,
1706 | "overflow_x": null,
1707 | "overflow_y": null,
1708 | "padding": null,
1709 | "right": null,
1710 | "top": null,
1711 | "visibility": null,
1712 | "width": null
1713 | }
1714 | },
1715 | "ed5f5d0280354ac9961fd05488548091": {
1716 | "model_module": "@jupyter-widgets/controls",
1717 | "model_name": "DescriptionStyleModel",
1718 | "model_module_version": "1.5.0",
1719 | "state": {
1720 | "_model_module": "@jupyter-widgets/controls",
1721 | "_model_module_version": "1.5.0",
1722 | "_model_name": "DescriptionStyleModel",
1723 | "_view_count": null,
1724 | "_view_module": "@jupyter-widgets/base",
1725 | "_view_module_version": "1.2.0",
1726 | "_view_name": "StyleView",
1727 | "description_width": ""
1728 | }
1729 | },
1730 | "7cd65bceb9cb4944aeb30c186a9bc90e": {
1731 | "model_module": "@jupyter-widgets/controls",
1732 | "model_name": "HBoxModel",
1733 | "model_module_version": "1.5.0",
1734 | "state": {
1735 | "_dom_classes": [],
1736 | "_model_module": "@jupyter-widgets/controls",
1737 | "_model_module_version": "1.5.0",
1738 | "_model_name": "HBoxModel",
1739 | "_view_count": null,
1740 | "_view_module": "@jupyter-widgets/controls",
1741 | "_view_module_version": "1.5.0",
1742 | "_view_name": "HBoxView",
1743 | "box_style": "",
1744 | "children": [
1745 | "IPY_MODEL_0dc894352c154805ba2d3596f43c9e4f",
1746 | "IPY_MODEL_ef3e7f7b90d24a39a535963ca42ca0a3",
1747 | "IPY_MODEL_d8a83f84c41d436d9f6c6866527cf7c0"
1748 | ],
1749 | "layout": "IPY_MODEL_5e9a252ecc7041afafeb4527f214b2fd"
1750 | }
1751 | },
1752 | "0dc894352c154805ba2d3596f43c9e4f": {
1753 | "model_module": "@jupyter-widgets/controls",
1754 | "model_name": "HTMLModel",
1755 | "model_module_version": "1.5.0",
1756 | "state": {
1757 | "_dom_classes": [],
1758 | "_model_module": "@jupyter-widgets/controls",
1759 | "_model_module_version": "1.5.0",
1760 | "_model_name": "HTMLModel",
1761 | "_view_count": null,
1762 | "_view_module": "@jupyter-widgets/controls",
1763 | "_view_module_version": "1.5.0",
1764 | "_view_name": "HTMLView",
1765 | "description": "",
1766 | "description_tooltip": null,
1767 | "layout": "IPY_MODEL_a78402b082574cbbbeeeca72584496ec",
1768 | "placeholder": "",
1769 | "style": "IPY_MODEL_01688391d2ea438db0388c43408de598",
1770 | "value": "Generating test examples...: 99%"
1771 | }
1772 | },
1773 | "ef3e7f7b90d24a39a535963ca42ca0a3": {
1774 | "model_module": "@jupyter-widgets/controls",
1775 | "model_name": "FloatProgressModel",
1776 | "model_module_version": "1.5.0",
1777 | "state": {
1778 | "_dom_classes": [],
1779 | "_model_module": "@jupyter-widgets/controls",
1780 | "_model_module_version": "1.5.0",
1781 | "_model_name": "FloatProgressModel",
1782 | "_view_count": null,
1783 | "_view_module": "@jupyter-widgets/controls",
1784 | "_view_module_version": "1.5.0",
1785 | "_view_name": "ProgressView",
1786 | "bar_style": "",
1787 | "description": "",
1788 | "description_tooltip": null,
1789 | "layout": "IPY_MODEL_1186620e299d45819962a4aadc384935",
1790 | "max": 25000,
1791 | "min": 0,
1792 | "orientation": "horizontal",
1793 | "style": "IPY_MODEL_31f86ffde7e84dfea6ef496a07a8bac7",
1794 | "value": 25000
1795 | }
1796 | },
1797 | "d8a83f84c41d436d9f6c6866527cf7c0": {
1798 | "model_module": "@jupyter-widgets/controls",
1799 | "model_name": "HTMLModel",
1800 | "model_module_version": "1.5.0",
1801 | "state": {
1802 | "_dom_classes": [],
1803 | "_model_module": "@jupyter-widgets/controls",
1804 | "_model_module_version": "1.5.0",
1805 | "_model_name": "HTMLModel",
1806 | "_view_count": null,
1807 | "_view_module": "@jupyter-widgets/controls",
1808 | "_view_module_version": "1.5.0",
1809 | "_view_name": "HTMLView",
1810 | "description": "",
1811 | "description_tooltip": null,
1812 | "layout": "IPY_MODEL_52eb4b36d34c4cac84395dc3d7a2e531",
1813 | "placeholder": "",
1814 | "style": "IPY_MODEL_a0f11fe12e104dd284054dc9e11c372d",
1815 | "value": " 24770/25000 [00:07<00:00, 2729.13 examples/s]"
1816 | }
1817 | },
1818 | "5e9a252ecc7041afafeb4527f214b2fd": {
1819 | "model_module": "@jupyter-widgets/base",
1820 | "model_name": "LayoutModel",
1821 | "model_module_version": "1.2.0",
1822 | "state": {
1823 | "_model_module": "@jupyter-widgets/base",
1824 | "_model_module_version": "1.2.0",
1825 | "_model_name": "LayoutModel",
1826 | "_view_count": null,
1827 | "_view_module": "@jupyter-widgets/base",
1828 | "_view_module_version": "1.2.0",
1829 | "_view_name": "LayoutView",
1830 | "align_content": null,
1831 | "align_items": null,
1832 | "align_self": null,
1833 | "border": null,
1834 | "bottom": null,
1835 | "display": null,
1836 | "flex": null,
1837 | "flex_flow": null,
1838 | "grid_area": null,
1839 | "grid_auto_columns": null,
1840 | "grid_auto_flow": null,
1841 | "grid_auto_rows": null,
1842 | "grid_column": null,
1843 | "grid_gap": null,
1844 | "grid_row": null,
1845 | "grid_template_areas": null,
1846 | "grid_template_columns": null,
1847 | "grid_template_rows": null,
1848 | "height": null,
1849 | "justify_content": null,
1850 | "justify_items": null,
1851 | "left": null,
1852 | "margin": null,
1853 | "max_height": null,
1854 | "max_width": null,
1855 | "min_height": null,
1856 | "min_width": null,
1857 | "object_fit": null,
1858 | "object_position": null,
1859 | "order": null,
1860 | "overflow": null,
1861 | "overflow_x": null,
1862 | "overflow_y": null,
1863 | "padding": null,
1864 | "right": null,
1865 | "top": null,
1866 | "visibility": "hidden",
1867 | "width": null
1868 | }
1869 | },
1870 | "a78402b082574cbbbeeeca72584496ec": {
1871 | "model_module": "@jupyter-widgets/base",
1872 | "model_name": "LayoutModel",
1873 | "model_module_version": "1.2.0",
1874 | "state": {
1875 | "_model_module": "@jupyter-widgets/base",
1876 | "_model_module_version": "1.2.0",
1877 | "_model_name": "LayoutModel",
1878 | "_view_count": null,
1879 | "_view_module": "@jupyter-widgets/base",
1880 | "_view_module_version": "1.2.0",
1881 | "_view_name": "LayoutView",
1882 | "align_content": null,
1883 | "align_items": null,
1884 | "align_self": null,
1885 | "border": null,
1886 | "bottom": null,
1887 | "display": null,
1888 | "flex": null,
1889 | "flex_flow": null,
1890 | "grid_area": null,
1891 | "grid_auto_columns": null,
1892 | "grid_auto_flow": null,
1893 | "grid_auto_rows": null,
1894 | "grid_column": null,
1895 | "grid_gap": null,
1896 | "grid_row": null,
1897 | "grid_template_areas": null,
1898 | "grid_template_columns": null,
1899 | "grid_template_rows": null,
1900 | "height": null,
1901 | "justify_content": null,
1902 | "justify_items": null,
1903 | "left": null,
1904 | "margin": null,
1905 | "max_height": null,
1906 | "max_width": null,
1907 | "min_height": null,
1908 | "min_width": null,
1909 | "object_fit": null,
1910 | "object_position": null,
1911 | "order": null,
1912 | "overflow": null,
1913 | "overflow_x": null,
1914 | "overflow_y": null,
1915 | "padding": null,
1916 | "right": null,
1917 | "top": null,
1918 | "visibility": null,
1919 | "width": null
1920 | }
1921 | },
1922 | "01688391d2ea438db0388c43408de598": {
1923 | "model_module": "@jupyter-widgets/controls",
1924 | "model_name": "DescriptionStyleModel",
1925 | "model_module_version": "1.5.0",
1926 | "state": {
1927 | "_model_module": "@jupyter-widgets/controls",
1928 | "_model_module_version": "1.5.0",
1929 | "_model_name": "DescriptionStyleModel",
1930 | "_view_count": null,
1931 | "_view_module": "@jupyter-widgets/base",
1932 | "_view_module_version": "1.2.0",
1933 | "_view_name": "StyleView",
1934 | "description_width": ""
1935 | }
1936 | },
1937 | "1186620e299d45819962a4aadc384935": {
1938 | "model_module": "@jupyter-widgets/base",
1939 | "model_name": "LayoutModel",
1940 | "model_module_version": "1.2.0",
1941 | "state": {
1942 | "_model_module": "@jupyter-widgets/base",
1943 | "_model_module_version": "1.2.0",
1944 | "_model_name": "LayoutModel",
1945 | "_view_count": null,
1946 | "_view_module": "@jupyter-widgets/base",
1947 | "_view_module_version": "1.2.0",
1948 | "_view_name": "LayoutView",
1949 | "align_content": null,
1950 | "align_items": null,
1951 | "align_self": null,
1952 | "border": null,
1953 | "bottom": null,
1954 | "display": null,
1955 | "flex": null,
1956 | "flex_flow": null,
1957 | "grid_area": null,
1958 | "grid_auto_columns": null,
1959 | "grid_auto_flow": null,
1960 | "grid_auto_rows": null,
1961 | "grid_column": null,
1962 | "grid_gap": null,
1963 | "grid_row": null,
1964 | "grid_template_areas": null,
1965 | "grid_template_columns": null,
1966 | "grid_template_rows": null,
1967 | "height": null,
1968 | "justify_content": null,
1969 | "justify_items": null,
1970 | "left": null,
1971 | "margin": null,
1972 | "max_height": null,
1973 | "max_width": null,
1974 | "min_height": null,
1975 | "min_width": null,
1976 | "object_fit": null,
1977 | "object_position": null,
1978 | "order": null,
1979 | "overflow": null,
1980 | "overflow_x": null,
1981 | "overflow_y": null,
1982 | "padding": null,
1983 | "right": null,
1984 | "top": null,
1985 | "visibility": null,
1986 | "width": null
1987 | }
1988 | },
1989 | "31f86ffde7e84dfea6ef496a07a8bac7": {
1990 | "model_module": "@jupyter-widgets/controls",
1991 | "model_name": "ProgressStyleModel",
1992 | "model_module_version": "1.5.0",
1993 | "state": {
1994 | "_model_module": "@jupyter-widgets/controls",
1995 | "_model_module_version": "1.5.0",
1996 | "_model_name": "ProgressStyleModel",
1997 | "_view_count": null,
1998 | "_view_module": "@jupyter-widgets/base",
1999 | "_view_module_version": "1.2.0",
2000 | "_view_name": "StyleView",
2001 | "bar_color": null,
2002 | "description_width": ""
2003 | }
2004 | },
2005 | "52eb4b36d34c4cac84395dc3d7a2e531": {
2006 | "model_module": "@jupyter-widgets/base",
2007 | "model_name": "LayoutModel",
2008 | "model_module_version": "1.2.0",
2009 | "state": {
2010 | "_model_module": "@jupyter-widgets/base",
2011 | "_model_module_version": "1.2.0",
2012 | "_model_name": "LayoutModel",
2013 | "_view_count": null,
2014 | "_view_module": "@jupyter-widgets/base",
2015 | "_view_module_version": "1.2.0",
2016 | "_view_name": "LayoutView",
2017 | "align_content": null,
2018 | "align_items": null,
2019 | "align_self": null,
2020 | "border": null,
2021 | "bottom": null,
2022 | "display": null,
2023 | "flex": null,
2024 | "flex_flow": null,
2025 | "grid_area": null,
2026 | "grid_auto_columns": null,
2027 | "grid_auto_flow": null,
2028 | "grid_auto_rows": null,
2029 | "grid_column": null,
2030 | "grid_gap": null,
2031 | "grid_row": null,
2032 | "grid_template_areas": null,
2033 | "grid_template_columns": null,
2034 | "grid_template_rows": null,
2035 | "height": null,
2036 | "justify_content": null,
2037 | "justify_items": null,
2038 | "left": null,
2039 | "margin": null,
2040 | "max_height": null,
2041 | "max_width": null,
2042 | "min_height": null,
2043 | "min_width": null,
2044 | "object_fit": null,
2045 | "object_position": null,
2046 | "order": null,
2047 | "overflow": null,
2048 | "overflow_x": null,
2049 | "overflow_y": null,
2050 | "padding": null,
2051 | "right": null,
2052 | "top": null,
2053 | "visibility": null,
2054 | "width": null
2055 | }
2056 | },
2057 | "a0f11fe12e104dd284054dc9e11c372d": {
2058 | "model_module": "@jupyter-widgets/controls",
2059 | "model_name": "DescriptionStyleModel",
2060 | "model_module_version": "1.5.0",
2061 | "state": {
2062 | "_model_module": "@jupyter-widgets/controls",
2063 | "_model_module_version": "1.5.0",
2064 | "_model_name": "DescriptionStyleModel",
2065 | "_view_count": null,
2066 | "_view_module": "@jupyter-widgets/base",
2067 | "_view_module_version": "1.2.0",
2068 | "_view_name": "StyleView",
2069 | "description_width": ""
2070 | }
2071 | },
2072 | "c53d7572399a4e32804c6b353f055030": {
2073 | "model_module": "@jupyter-widgets/controls",
2074 | "model_name": "HBoxModel",
2075 | "model_module_version": "1.5.0",
2076 | "state": {
2077 | "_dom_classes": [],
2078 | "_model_module": "@jupyter-widgets/controls",
2079 | "_model_module_version": "1.5.0",
2080 | "_model_name": "HBoxModel",
2081 | "_view_count": null,
2082 | "_view_module": "@jupyter-widgets/controls",
2083 | "_view_module_version": "1.5.0",
2084 | "_view_name": "HBoxView",
2085 | "box_style": "",
2086 | "children": [
2087 | "IPY_MODEL_9a51db6daeb74ac590d120b6a74ce6a3",
2088 | "IPY_MODEL_62afcb8f9fc242a0bf3fb455e0304f96",
2089 | "IPY_MODEL_d444e4552f2c4d35a202e457bf8efd0b"
2090 | ],
2091 | "layout": "IPY_MODEL_f6ed3a1763d144fcadd5ff7c83966b80"
2092 | }
2093 | },
2094 | "9a51db6daeb74ac590d120b6a74ce6a3": {
2095 | "model_module": "@jupyter-widgets/controls",
2096 | "model_name": "HTMLModel",
2097 | "model_module_version": "1.5.0",
2098 | "state": {
2099 | "_dom_classes": [],
2100 | "_model_module": "@jupyter-widgets/controls",
2101 | "_model_module_version": "1.5.0",
2102 | "_model_name": "HTMLModel",
2103 | "_view_count": null,
2104 | "_view_module": "@jupyter-widgets/controls",
2105 | "_view_module_version": "1.5.0",
2106 | "_view_name": "HTMLView",
2107 | "description": "",
2108 | "description_tooltip": null,
2109 | "layout": "IPY_MODEL_f5fedede8bec441d82804ab9918f5b24",
2110 | "placeholder": "",
2111 | "style": "IPY_MODEL_a183da90da714155811e0e0143e316eb",
2112 | "value": "Shuffling /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0.incompleteSAD0T3/imdb_reviews-test.tfrecord*...: 61%"
2113 | }
2114 | },
2115 | "62afcb8f9fc242a0bf3fb455e0304f96": {
2116 | "model_module": "@jupyter-widgets/controls",
2117 | "model_name": "FloatProgressModel",
2118 | "model_module_version": "1.5.0",
2119 | "state": {
2120 | "_dom_classes": [],
2121 | "_model_module": "@jupyter-widgets/controls",
2122 | "_model_module_version": "1.5.0",
2123 | "_model_name": "FloatProgressModel",
2124 | "_view_count": null,
2125 | "_view_module": "@jupyter-widgets/controls",
2126 | "_view_module_version": "1.5.0",
2127 | "_view_name": "ProgressView",
2128 | "bar_style": "",
2129 | "description": "",
2130 | "description_tooltip": null,
2131 | "layout": "IPY_MODEL_263db6859652481985789ad8da51447c",
2132 | "max": 25000,
2133 | "min": 0,
2134 | "orientation": "horizontal",
2135 | "style": "IPY_MODEL_3aab6c731da44c15a9dfba98672d0735",
2136 | "value": 25000
2137 | }
2138 | },
2139 | "d444e4552f2c4d35a202e457bf8efd0b": {
2140 | "model_module": "@jupyter-widgets/controls",
2141 | "model_name": "HTMLModel",
2142 | "model_module_version": "1.5.0",
2143 | "state": {
2144 | "_dom_classes": [],
2145 | "_model_module": "@jupyter-widgets/controls",
2146 | "_model_module_version": "1.5.0",
2147 | "_model_name": "HTMLModel",
2148 | "_view_count": null,
2149 | "_view_module": "@jupyter-widgets/controls",
2150 | "_view_module_version": "1.5.0",
2151 | "_view_name": "HTMLView",
2152 | "description": "",
2153 | "description_tooltip": null,
2154 | "layout": "IPY_MODEL_e8bd7a69d9454970bc358e2994c0d1ba",
2155 | "placeholder": "",
2156 | "style": "IPY_MODEL_da20567a8cc6422d8684310b92e9119e",
2157 | "value": " 15273/25000 [00:00<00:00, 152714.49 examples/s]"
2158 | }
2159 | },
2160 | "f6ed3a1763d144fcadd5ff7c83966b80": {
2161 | "model_module": "@jupyter-widgets/base",
2162 | "model_name": "LayoutModel",
2163 | "model_module_version": "1.2.0",
2164 | "state": {
2165 | "_model_module": "@jupyter-widgets/base",
2166 | "_model_module_version": "1.2.0",
2167 | "_model_name": "LayoutModel",
2168 | "_view_count": null,
2169 | "_view_module": "@jupyter-widgets/base",
2170 | "_view_module_version": "1.2.0",
2171 | "_view_name": "LayoutView",
2172 | "align_content": null,
2173 | "align_items": null,
2174 | "align_self": null,
2175 | "border": null,
2176 | "bottom": null,
2177 | "display": null,
2178 | "flex": null,
2179 | "flex_flow": null,
2180 | "grid_area": null,
2181 | "grid_auto_columns": null,
2182 | "grid_auto_flow": null,
2183 | "grid_auto_rows": null,
2184 | "grid_column": null,
2185 | "grid_gap": null,
2186 | "grid_row": null,
2187 | "grid_template_areas": null,
2188 | "grid_template_columns": null,
2189 | "grid_template_rows": null,
2190 | "height": null,
2191 | "justify_content": null,
2192 | "justify_items": null,
2193 | "left": null,
2194 | "margin": null,
2195 | "max_height": null,
2196 | "max_width": null,
2197 | "min_height": null,
2198 | "min_width": null,
2199 | "object_fit": null,
2200 | "object_position": null,
2201 | "order": null,
2202 | "overflow": null,
2203 | "overflow_x": null,
2204 | "overflow_y": null,
2205 | "padding": null,
2206 | "right": null,
2207 | "top": null,
2208 | "visibility": "hidden",
2209 | "width": null
2210 | }
2211 | },
2212 | "f5fedede8bec441d82804ab9918f5b24": {
2213 | "model_module": "@jupyter-widgets/base",
2214 | "model_name": "LayoutModel",
2215 | "model_module_version": "1.2.0",
2216 | "state": {
2217 | "_model_module": "@jupyter-widgets/base",
2218 | "_model_module_version": "1.2.0",
2219 | "_model_name": "LayoutModel",
2220 | "_view_count": null,
2221 | "_view_module": "@jupyter-widgets/base",
2222 | "_view_module_version": "1.2.0",
2223 | "_view_name": "LayoutView",
2224 | "align_content": null,
2225 | "align_items": null,
2226 | "align_self": null,
2227 | "border": null,
2228 | "bottom": null,
2229 | "display": null,
2230 | "flex": null,
2231 | "flex_flow": null,
2232 | "grid_area": null,
2233 | "grid_auto_columns": null,
2234 | "grid_auto_flow": null,
2235 | "grid_auto_rows": null,
2236 | "grid_column": null,
2237 | "grid_gap": null,
2238 | "grid_row": null,
2239 | "grid_template_areas": null,
2240 | "grid_template_columns": null,
2241 | "grid_template_rows": null,
2242 | "height": null,
2243 | "justify_content": null,
2244 | "justify_items": null,
2245 | "left": null,
2246 | "margin": null,
2247 | "max_height": null,
2248 | "max_width": null,
2249 | "min_height": null,
2250 | "min_width": null,
2251 | "object_fit": null,
2252 | "object_position": null,
2253 | "order": null,
2254 | "overflow": null,
2255 | "overflow_x": null,
2256 | "overflow_y": null,
2257 | "padding": null,
2258 | "right": null,
2259 | "top": null,
2260 | "visibility": null,
2261 | "width": null
2262 | }
2263 | },
2264 | "a183da90da714155811e0e0143e316eb": {
2265 | "model_module": "@jupyter-widgets/controls",
2266 | "model_name": "DescriptionStyleModel",
2267 | "model_module_version": "1.5.0",
2268 | "state": {
2269 | "_model_module": "@jupyter-widgets/controls",
2270 | "_model_module_version": "1.5.0",
2271 | "_model_name": "DescriptionStyleModel",
2272 | "_view_count": null,
2273 | "_view_module": "@jupyter-widgets/base",
2274 | "_view_module_version": "1.2.0",
2275 | "_view_name": "StyleView",
2276 | "description_width": ""
2277 | }
2278 | },
2279 | "263db6859652481985789ad8da51447c": {
2280 | "model_module": "@jupyter-widgets/base",
2281 | "model_name": "LayoutModel",
2282 | "model_module_version": "1.2.0",
2283 | "state": {
2284 | "_model_module": "@jupyter-widgets/base",
2285 | "_model_module_version": "1.2.0",
2286 | "_model_name": "LayoutModel",
2287 | "_view_count": null,
2288 | "_view_module": "@jupyter-widgets/base",
2289 | "_view_module_version": "1.2.0",
2290 | "_view_name": "LayoutView",
2291 | "align_content": null,
2292 | "align_items": null,
2293 | "align_self": null,
2294 | "border": null,
2295 | "bottom": null,
2296 | "display": null,
2297 | "flex": null,
2298 | "flex_flow": null,
2299 | "grid_area": null,
2300 | "grid_auto_columns": null,
2301 | "grid_auto_flow": null,
2302 | "grid_auto_rows": null,
2303 | "grid_column": null,
2304 | "grid_gap": null,
2305 | "grid_row": null,
2306 | "grid_template_areas": null,
2307 | "grid_template_columns": null,
2308 | "grid_template_rows": null,
2309 | "height": null,
2310 | "justify_content": null,
2311 | "justify_items": null,
2312 | "left": null,
2313 | "margin": null,
2314 | "max_height": null,
2315 | "max_width": null,
2316 | "min_height": null,
2317 | "min_width": null,
2318 | "object_fit": null,
2319 | "object_position": null,
2320 | "order": null,
2321 | "overflow": null,
2322 | "overflow_x": null,
2323 | "overflow_y": null,
2324 | "padding": null,
2325 | "right": null,
2326 | "top": null,
2327 | "visibility": null,
2328 | "width": null
2329 | }
2330 | },
2331 | "3aab6c731da44c15a9dfba98672d0735": {
2332 | "model_module": "@jupyter-widgets/controls",
2333 | "model_name": "ProgressStyleModel",
2334 | "model_module_version": "1.5.0",
2335 | "state": {
2336 | "_model_module": "@jupyter-widgets/controls",
2337 | "_model_module_version": "1.5.0",
2338 | "_model_name": "ProgressStyleModel",
2339 | "_view_count": null,
2340 | "_view_module": "@jupyter-widgets/base",
2341 | "_view_module_version": "1.2.0",
2342 | "_view_name": "StyleView",
2343 | "bar_color": null,
2344 | "description_width": ""
2345 | }
2346 | },
2347 | "e8bd7a69d9454970bc358e2994c0d1ba": {
2348 | "model_module": "@jupyter-widgets/base",
2349 | "model_name": "LayoutModel",
2350 | "model_module_version": "1.2.0",
2351 | "state": {
2352 | "_model_module": "@jupyter-widgets/base",
2353 | "_model_module_version": "1.2.0",
2354 | "_model_name": "LayoutModel",
2355 | "_view_count": null,
2356 | "_view_module": "@jupyter-widgets/base",
2357 | "_view_module_version": "1.2.0",
2358 | "_view_name": "LayoutView",
2359 | "align_content": null,
2360 | "align_items": null,
2361 | "align_self": null,
2362 | "border": null,
2363 | "bottom": null,
2364 | "display": null,
2365 | "flex": null,
2366 | "flex_flow": null,
2367 | "grid_area": null,
2368 | "grid_auto_columns": null,
2369 | "grid_auto_flow": null,
2370 | "grid_auto_rows": null,
2371 | "grid_column": null,
2372 | "grid_gap": null,
2373 | "grid_row": null,
2374 | "grid_template_areas": null,
2375 | "grid_template_columns": null,
2376 | "grid_template_rows": null,
2377 | "height": null,
2378 | "justify_content": null,
2379 | "justify_items": null,
2380 | "left": null,
2381 | "margin": null,
2382 | "max_height": null,
2383 | "max_width": null,
2384 | "min_height": null,
2385 | "min_width": null,
2386 | "object_fit": null,
2387 | "object_position": null,
2388 | "order": null,
2389 | "overflow": null,
2390 | "overflow_x": null,
2391 | "overflow_y": null,
2392 | "padding": null,
2393 | "right": null,
2394 | "top": null,
2395 | "visibility": null,
2396 | "width": null
2397 | }
2398 | },
2399 | "da20567a8cc6422d8684310b92e9119e": {
2400 | "model_module": "@jupyter-widgets/controls",
2401 | "model_name": "DescriptionStyleModel",
2402 | "model_module_version": "1.5.0",
2403 | "state": {
2404 | "_model_module": "@jupyter-widgets/controls",
2405 | "_model_module_version": "1.5.0",
2406 | "_model_name": "DescriptionStyleModel",
2407 | "_view_count": null,
2408 | "_view_module": "@jupyter-widgets/base",
2409 | "_view_module_version": "1.2.0",
2410 | "_view_name": "StyleView",
2411 | "description_width": ""
2412 | }
2413 | },
2414 | "cfd9342f64534a579161b6e2a94a81d8": {
2415 | "model_module": "@jupyter-widgets/controls",
2416 | "model_name": "HBoxModel",
2417 | "model_module_version": "1.5.0",
2418 | "state": {
2419 | "_dom_classes": [],
2420 | "_model_module": "@jupyter-widgets/controls",
2421 | "_model_module_version": "1.5.0",
2422 | "_model_name": "HBoxModel",
2423 | "_view_count": null,
2424 | "_view_module": "@jupyter-widgets/controls",
2425 | "_view_module_version": "1.5.0",
2426 | "_view_name": "HBoxView",
2427 | "box_style": "",
2428 | "children": [
2429 | "IPY_MODEL_75dd1253ae5940e19b5e6f745dc25bfa",
2430 | "IPY_MODEL_d9641c8b5ec1466796335ab37adf92fc",
2431 | "IPY_MODEL_7ad81f5aa9424c2a8987d426453c935d"
2432 | ],
2433 | "layout": "IPY_MODEL_7b7ca5db7bee4456850e3ce8babe2b99"
2434 | }
2435 | },
2436 | "75dd1253ae5940e19b5e6f745dc25bfa": {
2437 | "model_module": "@jupyter-widgets/controls",
2438 | "model_name": "HTMLModel",
2439 | "model_module_version": "1.5.0",
2440 | "state": {
2441 | "_dom_classes": [],
2442 | "_model_module": "@jupyter-widgets/controls",
2443 | "_model_module_version": "1.5.0",
2444 | "_model_name": "HTMLModel",
2445 | "_view_count": null,
2446 | "_view_module": "@jupyter-widgets/controls",
2447 | "_view_module_version": "1.5.0",
2448 | "_view_name": "HTMLView",
2449 | "description": "",
2450 | "description_tooltip": null,
2451 | "layout": "IPY_MODEL_c04f23fa0f0f4e7687a00fb99cc9f293",
2452 | "placeholder": "",
2453 | "style": "IPY_MODEL_5afc20c36e1f4a94b82819f732a4d0f6",
2454 | "value": "Generating unsupervised examples...: 100%"
2455 | }
2456 | },
2457 | "d9641c8b5ec1466796335ab37adf92fc": {
2458 | "model_module": "@jupyter-widgets/controls",
2459 | "model_name": "FloatProgressModel",
2460 | "model_module_version": "1.5.0",
2461 | "state": {
2462 | "_dom_classes": [],
2463 | "_model_module": "@jupyter-widgets/controls",
2464 | "_model_module_version": "1.5.0",
2465 | "_model_name": "FloatProgressModel",
2466 | "_view_count": null,
2467 | "_view_module": "@jupyter-widgets/controls",
2468 | "_view_module_version": "1.5.0",
2469 | "_view_name": "ProgressView",
2470 | "bar_style": "",
2471 | "description": "",
2472 | "description_tooltip": null,
2473 | "layout": "IPY_MODEL_ca44537116d349ae90f23a0c012a7e00",
2474 | "max": 50000,
2475 | "min": 0,
2476 | "orientation": "horizontal",
2477 | "style": "IPY_MODEL_2b139c7107394539bdb4891f3276301d",
2478 | "value": 50000
2479 | }
2480 | },
2481 | "7ad81f5aa9424c2a8987d426453c935d": {
2482 | "model_module": "@jupyter-widgets/controls",
2483 | "model_name": "HTMLModel",
2484 | "model_module_version": "1.5.0",
2485 | "state": {
2486 | "_dom_classes": [],
2487 | "_model_module": "@jupyter-widgets/controls",
2488 | "_model_module_version": "1.5.0",
2489 | "_model_name": "HTMLModel",
2490 | "_view_count": null,
2491 | "_view_module": "@jupyter-widgets/controls",
2492 | "_view_module_version": "1.5.0",
2493 | "_view_name": "HTMLView",
2494 | "description": "",
2495 | "description_tooltip": null,
2496 | "layout": "IPY_MODEL_0657b8f40f98454eb2d4609bc5ccffe8",
2497 | "placeholder": "",
2498 | "style": "IPY_MODEL_1ad5ada5601041f3ab7c126074927fb2",
2499 | "value": " 49899/50000 [00:17<00:00, 5338.74 examples/s]"
2500 | }
2501 | },
2502 | "7b7ca5db7bee4456850e3ce8babe2b99": {
2503 | "model_module": "@jupyter-widgets/base",
2504 | "model_name": "LayoutModel",
2505 | "model_module_version": "1.2.0",
2506 | "state": {
2507 | "_model_module": "@jupyter-widgets/base",
2508 | "_model_module_version": "1.2.0",
2509 | "_model_name": "LayoutModel",
2510 | "_view_count": null,
2511 | "_view_module": "@jupyter-widgets/base",
2512 | "_view_module_version": "1.2.0",
2513 | "_view_name": "LayoutView",
2514 | "align_content": null,
2515 | "align_items": null,
2516 | "align_self": null,
2517 | "border": null,
2518 | "bottom": null,
2519 | "display": null,
2520 | "flex": null,
2521 | "flex_flow": null,
2522 | "grid_area": null,
2523 | "grid_auto_columns": null,
2524 | "grid_auto_flow": null,
2525 | "grid_auto_rows": null,
2526 | "grid_column": null,
2527 | "grid_gap": null,
2528 | "grid_row": null,
2529 | "grid_template_areas": null,
2530 | "grid_template_columns": null,
2531 | "grid_template_rows": null,
2532 | "height": null,
2533 | "justify_content": null,
2534 | "justify_items": null,
2535 | "left": null,
2536 | "margin": null,
2537 | "max_height": null,
2538 | "max_width": null,
2539 | "min_height": null,
2540 | "min_width": null,
2541 | "object_fit": null,
2542 | "object_position": null,
2543 | "order": null,
2544 | "overflow": null,
2545 | "overflow_x": null,
2546 | "overflow_y": null,
2547 | "padding": null,
2548 | "right": null,
2549 | "top": null,
2550 | "visibility": "hidden",
2551 | "width": null
2552 | }
2553 | },
2554 | "c04f23fa0f0f4e7687a00fb99cc9f293": {
2555 | "model_module": "@jupyter-widgets/base",
2556 | "model_name": "LayoutModel",
2557 | "model_module_version": "1.2.0",
2558 | "state": {
2559 | "_model_module": "@jupyter-widgets/base",
2560 | "_model_module_version": "1.2.0",
2561 | "_model_name": "LayoutModel",
2562 | "_view_count": null,
2563 | "_view_module": "@jupyter-widgets/base",
2564 | "_view_module_version": "1.2.0",
2565 | "_view_name": "LayoutView",
2566 | "align_content": null,
2567 | "align_items": null,
2568 | "align_self": null,
2569 | "border": null,
2570 | "bottom": null,
2571 | "display": null,
2572 | "flex": null,
2573 | "flex_flow": null,
2574 | "grid_area": null,
2575 | "grid_auto_columns": null,
2576 | "grid_auto_flow": null,
2577 | "grid_auto_rows": null,
2578 | "grid_column": null,
2579 | "grid_gap": null,
2580 | "grid_row": null,
2581 | "grid_template_areas": null,
2582 | "grid_template_columns": null,
2583 | "grid_template_rows": null,
2584 | "height": null,
2585 | "justify_content": null,
2586 | "justify_items": null,
2587 | "left": null,
2588 | "margin": null,
2589 | "max_height": null,
2590 | "max_width": null,
2591 | "min_height": null,
2592 | "min_width": null,
2593 | "object_fit": null,
2594 | "object_position": null,
2595 | "order": null,
2596 | "overflow": null,
2597 | "overflow_x": null,
2598 | "overflow_y": null,
2599 | "padding": null,
2600 | "right": null,
2601 | "top": null,
2602 | "visibility": null,
2603 | "width": null
2604 | }
2605 | },
2606 | "5afc20c36e1f4a94b82819f732a4d0f6": {
2607 | "model_module": "@jupyter-widgets/controls",
2608 | "model_name": "DescriptionStyleModel",
2609 | "model_module_version": "1.5.0",
2610 | "state": {
2611 | "_model_module": "@jupyter-widgets/controls",
2612 | "_model_module_version": "1.5.0",
2613 | "_model_name": "DescriptionStyleModel",
2614 | "_view_count": null,
2615 | "_view_module": "@jupyter-widgets/base",
2616 | "_view_module_version": "1.2.0",
2617 | "_view_name": "StyleView",
2618 | "description_width": ""
2619 | }
2620 | },
2621 | "ca44537116d349ae90f23a0c012a7e00": {
2622 | "model_module": "@jupyter-widgets/base",
2623 | "model_name": "LayoutModel",
2624 | "model_module_version": "1.2.0",
2625 | "state": {
2626 | "_model_module": "@jupyter-widgets/base",
2627 | "_model_module_version": "1.2.0",
2628 | "_model_name": "LayoutModel",
2629 | "_view_count": null,
2630 | "_view_module": "@jupyter-widgets/base",
2631 | "_view_module_version": "1.2.0",
2632 | "_view_name": "LayoutView",
2633 | "align_content": null,
2634 | "align_items": null,
2635 | "align_self": null,
2636 | "border": null,
2637 | "bottom": null,
2638 | "display": null,
2639 | "flex": null,
2640 | "flex_flow": null,
2641 | "grid_area": null,
2642 | "grid_auto_columns": null,
2643 | "grid_auto_flow": null,
2644 | "grid_auto_rows": null,
2645 | "grid_column": null,
2646 | "grid_gap": null,
2647 | "grid_row": null,
2648 | "grid_template_areas": null,
2649 | "grid_template_columns": null,
2650 | "grid_template_rows": null,
2651 | "height": null,
2652 | "justify_content": null,
2653 | "justify_items": null,
2654 | "left": null,
2655 | "margin": null,
2656 | "max_height": null,
2657 | "max_width": null,
2658 | "min_height": null,
2659 | "min_width": null,
2660 | "object_fit": null,
2661 | "object_position": null,
2662 | "order": null,
2663 | "overflow": null,
2664 | "overflow_x": null,
2665 | "overflow_y": null,
2666 | "padding": null,
2667 | "right": null,
2668 | "top": null,
2669 | "visibility": null,
2670 | "width": null
2671 | }
2672 | },
2673 | "2b139c7107394539bdb4891f3276301d": {
2674 | "model_module": "@jupyter-widgets/controls",
2675 | "model_name": "ProgressStyleModel",
2676 | "model_module_version": "1.5.0",
2677 | "state": {
2678 | "_model_module": "@jupyter-widgets/controls",
2679 | "_model_module_version": "1.5.0",
2680 | "_model_name": "ProgressStyleModel",
2681 | "_view_count": null,
2682 | "_view_module": "@jupyter-widgets/base",
2683 | "_view_module_version": "1.2.0",
2684 | "_view_name": "StyleView",
2685 | "bar_color": null,
2686 | "description_width": ""
2687 | }
2688 | },
2689 | "0657b8f40f98454eb2d4609bc5ccffe8": {
2690 | "model_module": "@jupyter-widgets/base",
2691 | "model_name": "LayoutModel",
2692 | "model_module_version": "1.2.0",
2693 | "state": {
2694 | "_model_module": "@jupyter-widgets/base",
2695 | "_model_module_version": "1.2.0",
2696 | "_model_name": "LayoutModel",
2697 | "_view_count": null,
2698 | "_view_module": "@jupyter-widgets/base",
2699 | "_view_module_version": "1.2.0",
2700 | "_view_name": "LayoutView",
2701 | "align_content": null,
2702 | "align_items": null,
2703 | "align_self": null,
2704 | "border": null,
2705 | "bottom": null,
2706 | "display": null,
2707 | "flex": null,
2708 | "flex_flow": null,
2709 | "grid_area": null,
2710 | "grid_auto_columns": null,
2711 | "grid_auto_flow": null,
2712 | "grid_auto_rows": null,
2713 | "grid_column": null,
2714 | "grid_gap": null,
2715 | "grid_row": null,
2716 | "grid_template_areas": null,
2717 | "grid_template_columns": null,
2718 | "grid_template_rows": null,
2719 | "height": null,
2720 | "justify_content": null,
2721 | "justify_items": null,
2722 | "left": null,
2723 | "margin": null,
2724 | "max_height": null,
2725 | "max_width": null,
2726 | "min_height": null,
2727 | "min_width": null,
2728 | "object_fit": null,
2729 | "object_position": null,
2730 | "order": null,
2731 | "overflow": null,
2732 | "overflow_x": null,
2733 | "overflow_y": null,
2734 | "padding": null,
2735 | "right": null,
2736 | "top": null,
2737 | "visibility": null,
2738 | "width": null
2739 | }
2740 | },
2741 | "1ad5ada5601041f3ab7c126074927fb2": {
2742 | "model_module": "@jupyter-widgets/controls",
2743 | "model_name": "DescriptionStyleModel",
2744 | "model_module_version": "1.5.0",
2745 | "state": {
2746 | "_model_module": "@jupyter-widgets/controls",
2747 | "_model_module_version": "1.5.0",
2748 | "_model_name": "DescriptionStyleModel",
2749 | "_view_count": null,
2750 | "_view_module": "@jupyter-widgets/base",
2751 | "_view_module_version": "1.2.0",
2752 | "_view_name": "StyleView",
2753 | "description_width": ""
2754 | }
2755 | },
2756 | "5a81f7fbf0a74a3e8eb09b968c8e5b9b": {
2757 | "model_module": "@jupyter-widgets/controls",
2758 | "model_name": "HBoxModel",
2759 | "model_module_version": "1.5.0",
2760 | "state": {
2761 | "_dom_classes": [],
2762 | "_model_module": "@jupyter-widgets/controls",
2763 | "_model_module_version": "1.5.0",
2764 | "_model_name": "HBoxModel",
2765 | "_view_count": null,
2766 | "_view_module": "@jupyter-widgets/controls",
2767 | "_view_module_version": "1.5.0",
2768 | "_view_name": "HBoxView",
2769 | "box_style": "",
2770 | "children": [
2771 | "IPY_MODEL_815adf56656f43b097e7228409d15494",
2772 | "IPY_MODEL_19f3854e27aa4e4ea022d6e0638117f3",
2773 | "IPY_MODEL_084e60db582d4e7283f0adc8e5aeb7f4"
2774 | ],
2775 | "layout": "IPY_MODEL_6948abc6e29d4b148bf04a9fc609f9e8"
2776 | }
2777 | },
2778 | "815adf56656f43b097e7228409d15494": {
2779 | "model_module": "@jupyter-widgets/controls",
2780 | "model_name": "HTMLModel",
2781 | "model_module_version": "1.5.0",
2782 | "state": {
2783 | "_dom_classes": [],
2784 | "_model_module": "@jupyter-widgets/controls",
2785 | "_model_module_version": "1.5.0",
2786 | "_model_name": "HTMLModel",
2787 | "_view_count": null,
2788 | "_view_module": "@jupyter-widgets/controls",
2789 | "_view_module_version": "1.5.0",
2790 | "_view_name": "HTMLView",
2791 | "description": "",
2792 | "description_tooltip": null,
2793 | "layout": "IPY_MODEL_109489ef947849ef9f3a069bf2cf25d6",
2794 | "placeholder": "",
2795 | "style": "IPY_MODEL_4d746014d6aa4c8d8b375dfe323c2914",
2796 | "value": "Shuffling /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0.incompleteSAD0T3/imdb_reviews-unsupervised.tfrecord*...: 72%"
2797 | }
2798 | },
2799 | "19f3854e27aa4e4ea022d6e0638117f3": {
2800 | "model_module": "@jupyter-widgets/controls",
2801 | "model_name": "FloatProgressModel",
2802 | "model_module_version": "1.5.0",
2803 | "state": {
2804 | "_dom_classes": [],
2805 | "_model_module": "@jupyter-widgets/controls",
2806 | "_model_module_version": "1.5.0",
2807 | "_model_name": "FloatProgressModel",
2808 | "_view_count": null,
2809 | "_view_module": "@jupyter-widgets/controls",
2810 | "_view_module_version": "1.5.0",
2811 | "_view_name": "ProgressView",
2812 | "bar_style": "",
2813 | "description": "",
2814 | "description_tooltip": null,
2815 | "layout": "IPY_MODEL_ea4ee7e61067487eac60a152067b6485",
2816 | "max": 50000,
2817 | "min": 0,
2818 | "orientation": "horizontal",
2819 | "style": "IPY_MODEL_44a3cc03595a4cb2a4baa16f8e4a9393",
2820 | "value": 50000
2821 | }
2822 | },
2823 | "084e60db582d4e7283f0adc8e5aeb7f4": {
2824 | "model_module": "@jupyter-widgets/controls",
2825 | "model_name": "HTMLModel",
2826 | "model_module_version": "1.5.0",
2827 | "state": {
2828 | "_dom_classes": [],
2829 | "_model_module": "@jupyter-widgets/controls",
2830 | "_model_module_version": "1.5.0",
2831 | "_model_name": "HTMLModel",
2832 | "_view_count": null,
2833 | "_view_module": "@jupyter-widgets/controls",
2834 | "_view_module_version": "1.5.0",
2835 | "_view_name": "HTMLView",
2836 | "description": "",
2837 | "description_tooltip": null,
2838 | "layout": "IPY_MODEL_1fdca155f1b442099c043c320e569ffd",
2839 | "placeholder": "",
2840 | "style": "IPY_MODEL_834ee15d726d4ee19f2e6b3372dead8f",
2841 | "value": " 35873/50000 [00:00<00:00, 194008.10 examples/s]"
2842 | }
2843 | },
2844 | "6948abc6e29d4b148bf04a9fc609f9e8": {
2845 | "model_module": "@jupyter-widgets/base",
2846 | "model_name": "LayoutModel",
2847 | "model_module_version": "1.2.0",
2848 | "state": {
2849 | "_model_module": "@jupyter-widgets/base",
2850 | "_model_module_version": "1.2.0",
2851 | "_model_name": "LayoutModel",
2852 | "_view_count": null,
2853 | "_view_module": "@jupyter-widgets/base",
2854 | "_view_module_version": "1.2.0",
2855 | "_view_name": "LayoutView",
2856 | "align_content": null,
2857 | "align_items": null,
2858 | "align_self": null,
2859 | "border": null,
2860 | "bottom": null,
2861 | "display": null,
2862 | "flex": null,
2863 | "flex_flow": null,
2864 | "grid_area": null,
2865 | "grid_auto_columns": null,
2866 | "grid_auto_flow": null,
2867 | "grid_auto_rows": null,
2868 | "grid_column": null,
2869 | "grid_gap": null,
2870 | "grid_row": null,
2871 | "grid_template_areas": null,
2872 | "grid_template_columns": null,
2873 | "grid_template_rows": null,
2874 | "height": null,
2875 | "justify_content": null,
2876 | "justify_items": null,
2877 | "left": null,
2878 | "margin": null,
2879 | "max_height": null,
2880 | "max_width": null,
2881 | "min_height": null,
2882 | "min_width": null,
2883 | "object_fit": null,
2884 | "object_position": null,
2885 | "order": null,
2886 | "overflow": null,
2887 | "overflow_x": null,
2888 | "overflow_y": null,
2889 | "padding": null,
2890 | "right": null,
2891 | "top": null,
2892 | "visibility": "hidden",
2893 | "width": null
2894 | }
2895 | },
2896 | "109489ef947849ef9f3a069bf2cf25d6": {
2897 | "model_module": "@jupyter-widgets/base",
2898 | "model_name": "LayoutModel",
2899 | "model_module_version": "1.2.0",
2900 | "state": {
2901 | "_model_module": "@jupyter-widgets/base",
2902 | "_model_module_version": "1.2.0",
2903 | "_model_name": "LayoutModel",
2904 | "_view_count": null,
2905 | "_view_module": "@jupyter-widgets/base",
2906 | "_view_module_version": "1.2.0",
2907 | "_view_name": "LayoutView",
2908 | "align_content": null,
2909 | "align_items": null,
2910 | "align_self": null,
2911 | "border": null,
2912 | "bottom": null,
2913 | "display": null,
2914 | "flex": null,
2915 | "flex_flow": null,
2916 | "grid_area": null,
2917 | "grid_auto_columns": null,
2918 | "grid_auto_flow": null,
2919 | "grid_auto_rows": null,
2920 | "grid_column": null,
2921 | "grid_gap": null,
2922 | "grid_row": null,
2923 | "grid_template_areas": null,
2924 | "grid_template_columns": null,
2925 | "grid_template_rows": null,
2926 | "height": null,
2927 | "justify_content": null,
2928 | "justify_items": null,
2929 | "left": null,
2930 | "margin": null,
2931 | "max_height": null,
2932 | "max_width": null,
2933 | "min_height": null,
2934 | "min_width": null,
2935 | "object_fit": null,
2936 | "object_position": null,
2937 | "order": null,
2938 | "overflow": null,
2939 | "overflow_x": null,
2940 | "overflow_y": null,
2941 | "padding": null,
2942 | "right": null,
2943 | "top": null,
2944 | "visibility": null,
2945 | "width": null
2946 | }
2947 | },
2948 | "4d746014d6aa4c8d8b375dfe323c2914": {
2949 | "model_module": "@jupyter-widgets/controls",
2950 | "model_name": "DescriptionStyleModel",
2951 | "model_module_version": "1.5.0",
2952 | "state": {
2953 | "_model_module": "@jupyter-widgets/controls",
2954 | "_model_module_version": "1.5.0",
2955 | "_model_name": "DescriptionStyleModel",
2956 | "_view_count": null,
2957 | "_view_module": "@jupyter-widgets/base",
2958 | "_view_module_version": "1.2.0",
2959 | "_view_name": "StyleView",
2960 | "description_width": ""
2961 | }
2962 | },
2963 | "ea4ee7e61067487eac60a152067b6485": {
2964 | "model_module": "@jupyter-widgets/base",
2965 | "model_name": "LayoutModel",
2966 | "model_module_version": "1.2.0",
2967 | "state": {
2968 | "_model_module": "@jupyter-widgets/base",
2969 | "_model_module_version": "1.2.0",
2970 | "_model_name": "LayoutModel",
2971 | "_view_count": null,
2972 | "_view_module": "@jupyter-widgets/base",
2973 | "_view_module_version": "1.2.0",
2974 | "_view_name": "LayoutView",
2975 | "align_content": null,
2976 | "align_items": null,
2977 | "align_self": null,
2978 | "border": null,
2979 | "bottom": null,
2980 | "display": null,
2981 | "flex": null,
2982 | "flex_flow": null,
2983 | "grid_area": null,
2984 | "grid_auto_columns": null,
2985 | "grid_auto_flow": null,
2986 | "grid_auto_rows": null,
2987 | "grid_column": null,
2988 | "grid_gap": null,
2989 | "grid_row": null,
2990 | "grid_template_areas": null,
2991 | "grid_template_columns": null,
2992 | "grid_template_rows": null,
2993 | "height": null,
2994 | "justify_content": null,
2995 | "justify_items": null,
2996 | "left": null,
2997 | "margin": null,
2998 | "max_height": null,
2999 | "max_width": null,
3000 | "min_height": null,
3001 | "min_width": null,
3002 | "object_fit": null,
3003 | "object_position": null,
3004 | "order": null,
3005 | "overflow": null,
3006 | "overflow_x": null,
3007 | "overflow_y": null,
3008 | "padding": null,
3009 | "right": null,
3010 | "top": null,
3011 | "visibility": null,
3012 | "width": null
3013 | }
3014 | },
3015 | "44a3cc03595a4cb2a4baa16f8e4a9393": {
3016 | "model_module": "@jupyter-widgets/controls",
3017 | "model_name": "ProgressStyleModel",
3018 | "model_module_version": "1.5.0",
3019 | "state": {
3020 | "_model_module": "@jupyter-widgets/controls",
3021 | "_model_module_version": "1.5.0",
3022 | "_model_name": "ProgressStyleModel",
3023 | "_view_count": null,
3024 | "_view_module": "@jupyter-widgets/base",
3025 | "_view_module_version": "1.2.0",
3026 | "_view_name": "StyleView",
3027 | "bar_color": null,
3028 | "description_width": ""
3029 | }
3030 | },
3031 | "1fdca155f1b442099c043c320e569ffd": {
3032 | "model_module": "@jupyter-widgets/base",
3033 | "model_name": "LayoutModel",
3034 | "model_module_version": "1.2.0",
3035 | "state": {
3036 | "_model_module": "@jupyter-widgets/base",
3037 | "_model_module_version": "1.2.0",
3038 | "_model_name": "LayoutModel",
3039 | "_view_count": null,
3040 | "_view_module": "@jupyter-widgets/base",
3041 | "_view_module_version": "1.2.0",
3042 | "_view_name": "LayoutView",
3043 | "align_content": null,
3044 | "align_items": null,
3045 | "align_self": null,
3046 | "border": null,
3047 | "bottom": null,
3048 | "display": null,
3049 | "flex": null,
3050 | "flex_flow": null,
3051 | "grid_area": null,
3052 | "grid_auto_columns": null,
3053 | "grid_auto_flow": null,
3054 | "grid_auto_rows": null,
3055 | "grid_column": null,
3056 | "grid_gap": null,
3057 | "grid_row": null,
3058 | "grid_template_areas": null,
3059 | "grid_template_columns": null,
3060 | "grid_template_rows": null,
3061 | "height": null,
3062 | "justify_content": null,
3063 | "justify_items": null,
3064 | "left": null,
3065 | "margin": null,
3066 | "max_height": null,
3067 | "max_width": null,
3068 | "min_height": null,
3069 | "min_width": null,
3070 | "object_fit": null,
3071 | "object_position": null,
3072 | "order": null,
3073 | "overflow": null,
3074 | "overflow_x": null,
3075 | "overflow_y": null,
3076 | "padding": null,
3077 | "right": null,
3078 | "top": null,
3079 | "visibility": null,
3080 | "width": null
3081 | }
3082 | },
3083 | "834ee15d726d4ee19f2e6b3372dead8f": {
3084 | "model_module": "@jupyter-widgets/controls",
3085 | "model_name": "DescriptionStyleModel",
3086 | "model_module_version": "1.5.0",
3087 | "state": {
3088 | "_model_module": "@jupyter-widgets/controls",
3089 | "_model_module_version": "1.5.0",
3090 | "_model_name": "DescriptionStyleModel",
3091 | "_view_count": null,
3092 | "_view_module": "@jupyter-widgets/base",
3093 | "_view_module_version": "1.2.0",
3094 | "_view_name": "StyleView",
3095 | "description_width": ""
3096 | }
3097 | }
3098 | }
3099 | }
3100 | },
3101 | "cells": [
3102 | {
3103 | "cell_type": "markdown",
3104 | "source": [
3105 | "# [KerasNLP] Position Embedding Techniques in Transformers\n",
3106 | "\n",
3107 | "**Author:** [Usha Rengaraju](https://www.linkedin.com/in/usha-rengaraju-b570b7a2/)
\n",
3108 | "**Date created:** 2023/07/10
\n",
3109 | "**Last modified:** 2023/07/10
\n",
3110 | "**Description:** Position Embedding Techniques in Transformers using KerasNLP"
3111 | ],
3112 | "metadata": {
3113 | "id": "yvKc4pDsVJGN"
3114 | }
3115 | },
3116 | {
3117 | "cell_type": "markdown",
3118 | "source": [
3119 | "## Overview\n",
3120 | "\n",
3121 | "Embedding layers are the ones which convert the input data to embedding vector form with some added information like position encoding and much more. There are various embedding layers already implemented in KerasNLP which we can use on the go.\n",
3122 | "\n",
3123 | "In this guide we create a simple text classification pipeline and showcase the various embedding layers and their affects on the performance."
3124 | ],
3125 | "metadata": {
3126 | "id": "pcanbuwJ7PUX"
3127 | }
3128 | },
3129 | {
3130 | "cell_type": "markdown",
3131 | "source": [
3132 | "## Imports & setup\n",
3133 | "\n",
3134 | "This tutorial requires you to have KerasNLP installed:\n",
3135 | "\n",
3136 | "```shell\n",
3137 | "pip install keras-nlp\n",
3138 | "```\n",
3139 | "\n",
3140 | "We begin by importing all required packages:"
3141 | ],
3142 | "metadata": {
3143 | "id": "DmC_kCnI7VPq"
3144 | }
3145 | },
3146 | {
3147 | "cell_type": "code",
3148 | "execution_count": null,
3149 | "metadata": {
3150 | "id": "6_hxrvF7nKnR",
3151 | "colab": {
3152 | "base_uri": "https://localhost:8080/"
3153 | },
3154 | "outputId": "80323c7e-4991-4bf2-f741-c661508d5f93"
3155 | },
3156 | "outputs": [
3157 | {
3158 | "output_type": "stream",
3159 | "name": "stdout",
3160 | "text": [
3161 | "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/42.2 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m42.2/42.2 kB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
3162 | "\u001b[?25h"
3163 | ]
3164 | }
3165 | ],
3166 | "source": [
3167 | "!pip install -q keras-nlp einops"
3168 | ]
3169 | },
3170 | {
3171 | "cell_type": "code",
3172 | "source": [
3173 | "import os\n",
3174 | "import re\n",
3175 | "import json\n",
3176 | "import string\n",
3177 | "import numpy as np\n",
3178 | "import tensorflow as tf\n",
3179 | "from tensorflow import keras\n",
3180 | "from tensorflow.keras import layers\n",
3181 | "import keras_nlp"
3182 | ],
3183 | "metadata": {
3184 | "id": "TJN1sCA8nUWh"
3185 | },
3186 | "execution_count": null,
3187 | "outputs": []
3188 | },
3189 | {
3190 | "cell_type": "markdown",
3191 | "source": [
3192 | "## Data loading\n",
3193 | "\n",
3194 | "This guide uses the\n",
3195 | "[IMDB review dataset](https://www.kaggle.com/datasets/lakshmi25npathi/imdb-dataset-of-50k-movie-reviews)\n",
3196 | "for demonstration purposes.\n",
3197 | "\n",
3198 | "To get started, we first load the dataset:"
3199 | ],
3200 | "metadata": {
3201 | "id": "r8CwaHyl_8oX"
3202 | }
3203 | },
3204 | {
3205 | "cell_type": "code",
3206 | "source": [
3207 | "import keras_nlp\n",
3208 | "import tensorflow_datasets as tfds\n",
3209 | "\n",
3210 | "imdb_train, imdb_test = tfds.load(\n",
3211 | " \"imdb_reviews\",\n",
3212 | " split=[\"train\", \"test\"],\n",
3213 | " as_supervised=True,\n",
3214 | " batch_size=16,\n",
3215 | ")\n"
3216 | ],
3217 | "metadata": {
3218 | "id": "hMSCeP3InUv_",
3219 | "colab": {
3220 | "base_uri": "https://localhost:8080/",
3221 | "height": 116,
3222 | "referenced_widgets": [
3223 | "8fc3ffd3192e410690bfb1c15cc91df8",
3224 | "194715023f574cb6945498787a28599e",
3225 | "e6ca529399674745849418cb0cc9d63e",
3226 | "d33de86165ae4bbab6185ac13a4a7169",
3227 | "6437b891ad8f4433bf59f112a1446b26",
3228 | "0b0696c421c24b719a9e0d3ac48a264f",
3229 | "b4bbefacd57644149fc055dc2ba8809a",
3230 | "773075570214465f90615fc25895a6f8",
3231 | "9cba2aed6b6c40eeb15fc09adfcee5d2",
3232 | "061391e9db9f4edd8d2b33aef1aca202",
3233 | "44cf3199fd5c4ea7bbfeff15de48dadd",
3234 | "63117fcc267e4d9b9d83c81448ec891a",
3235 | "eef23369bd3643fbac4d9daedd35bf8e",
3236 | "10c2178666304d40900ec1aa7ed81a2a",
3237 | "5e4072737287496da4921b5cf8500a7c",
3238 | "20f744e4872e4400a1cce33c5b5e093d",
3239 | "f9f72195acc44f4692eff40af44809c3",
3240 | "1a9a4c298f2449319e2137f35c2a6f42",
3241 | "dcd3e61974f145d684ae05df73cafc89",
3242 | "10f73b7c2aec4eed92a0d41d0e8bede1",
3243 | "2a857876349e44f09119067f8c3ecd45",
3244 | "6bffef1006cf4e5fb962296a9f436cff",
3245 | "cd666a0c2b2e48b995cc54ca36fccdf3",
3246 | "e89b1d933be84497b573d2d898b48951",
3247 | "223f0c3e7d0243eea7889b07b4ef9b1f",
3248 | "c61a98a2d1434686a1359a2bdcbaf4aa",
3249 | "6a2def4fcd044b869970ca1925a775d8",
3250 | "1c2f4629a1454ab6a363069fb418a117",
3251 | "c63ecefd70b14c268e4cfb113b1dc4eb",
3252 | "a336071f42d94b77aeac4f9d185ccc0c",
3253 | "0d7bd5d5cfba4aaabf64589d054b9d56",
3254 | "77c25dd467f249f2a349af3261032aac",
3255 | "48db30e6f6e0407297c83738a5c6fa13",
3256 | "149bab124f4c4f44b59ef4d63a07f02d",
3257 | "06efa4a5c87e463690f87c9b67e3f44a",
3258 | "3630b3350dc548549631ceb2b46130b6",
3259 | "4acc59eee6f74cfc80b831d0ef177bc6",
3260 | "09ccfba66baa407ca46b82e4238d1ed2",
3261 | "1c16f6e380f843ce8e59fff0d1cad88b",
3262 | "727d0a9eea1143fb97e37e5722e2adb5",
3263 | "c333de07fea040338b250efe6de5bd15",
3264 | "b43d812de0b24b25bd4bf12e33d642ad",
3265 | "21fed1f71da44f21b2fb0814b4de58c5",
3266 | "593709e37e36407da8612ad3f101c0be",
3267 | "40a1e79a8fac4ff4ba1c8f186ac47340",
3268 | "a6d2b1e5f7ff46a8a18a37f2a1a0f526",
3269 | "85b941ee509f411b8e3bd978b3d1cff5",
3270 | "2c800664c8d043db892e40e07fce2f96",
3271 | "317410e8927a49ba8ba968e32269a08f",
3272 | "3fb33e76f8104b04aa18dfc464b72a1b",
3273 | "d6315fd8422541a8bfa04cbabb976e94",
3274 | "58c7d4ffceb44332a3b362737e6a3554",
3275 | "5212b25a72474677b638478932d87425",
3276 | "0d891a5143fa42bfb9b106391eb91939",
3277 | "ed5f5d0280354ac9961fd05488548091",
3278 | "7cd65bceb9cb4944aeb30c186a9bc90e",
3279 | "0dc894352c154805ba2d3596f43c9e4f",
3280 | "ef3e7f7b90d24a39a535963ca42ca0a3",
3281 | "d8a83f84c41d436d9f6c6866527cf7c0",
3282 | "5e9a252ecc7041afafeb4527f214b2fd",
3283 | "a78402b082574cbbbeeeca72584496ec",
3284 | "01688391d2ea438db0388c43408de598",
3285 | "1186620e299d45819962a4aadc384935",
3286 | "31f86ffde7e84dfea6ef496a07a8bac7",
3287 | "52eb4b36d34c4cac84395dc3d7a2e531",
3288 | "a0f11fe12e104dd284054dc9e11c372d",
3289 | "c53d7572399a4e32804c6b353f055030",
3290 | "9a51db6daeb74ac590d120b6a74ce6a3",
3291 | "62afcb8f9fc242a0bf3fb455e0304f96",
3292 | "d444e4552f2c4d35a202e457bf8efd0b",
3293 | "f6ed3a1763d144fcadd5ff7c83966b80",
3294 | "f5fedede8bec441d82804ab9918f5b24",
3295 | "a183da90da714155811e0e0143e316eb",
3296 | "263db6859652481985789ad8da51447c",
3297 | "3aab6c731da44c15a9dfba98672d0735",
3298 | "e8bd7a69d9454970bc358e2994c0d1ba",
3299 | "da20567a8cc6422d8684310b92e9119e",
3300 | "cfd9342f64534a579161b6e2a94a81d8",
3301 | "75dd1253ae5940e19b5e6f745dc25bfa",
3302 | "d9641c8b5ec1466796335ab37adf92fc",
3303 | "7ad81f5aa9424c2a8987d426453c935d",
3304 | "7b7ca5db7bee4456850e3ce8babe2b99",
3305 | "c04f23fa0f0f4e7687a00fb99cc9f293",
3306 | "5afc20c36e1f4a94b82819f732a4d0f6",
3307 | "ca44537116d349ae90f23a0c012a7e00",
3308 | "2b139c7107394539bdb4891f3276301d",
3309 | "0657b8f40f98454eb2d4609bc5ccffe8",
3310 | "1ad5ada5601041f3ab7c126074927fb2",
3311 | "5a81f7fbf0a74a3e8eb09b968c8e5b9b",
3312 | "815adf56656f43b097e7228409d15494",
3313 | "19f3854e27aa4e4ea022d6e0638117f3",
3314 | "084e60db582d4e7283f0adc8e5aeb7f4",
3315 | "6948abc6e29d4b148bf04a9fc609f9e8",
3316 | "109489ef947849ef9f3a069bf2cf25d6",
3317 | "4d746014d6aa4c8d8b375dfe323c2914",
3318 | "ea4ee7e61067487eac60a152067b6485",
3319 | "44a3cc03595a4cb2a4baa16f8e4a9393",
3320 | "1fdca155f1b442099c043c320e569ffd",
3321 | "834ee15d726d4ee19f2e6b3372dead8f"
3322 | ]
3323 | },
3324 | "outputId": "ac9857a5-9eef-42f8-b85a-fb9b29a0626f"
3325 | },
3326 | "execution_count": null,
3327 | "outputs": [
3328 | {
3329 | "output_type": "stream",
3330 | "name": "stdout",
3331 | "text": [
3332 | "Downloading and preparing dataset 80.23 MiB (download: 80.23 MiB, generated: Unknown size, total: 80.23 MiB) to /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0...\n"
3333 | ]
3334 | },
3335 | {
3336 | "output_type": "display_data",
3337 | "data": {
3338 | "text/plain": [
3339 | "Dl Completed...: 0 url [00:00, ? url/s]"
3340 | ],
3341 | "application/vnd.jupyter.widget-view+json": {
3342 | "version_major": 2,
3343 | "version_minor": 0,
3344 | "model_id": "8fc3ffd3192e410690bfb1c15cc91df8"
3345 | }
3346 | },
3347 | "metadata": {}
3348 | },
3349 | {
3350 | "output_type": "display_data",
3351 | "data": {
3352 | "text/plain": [
3353 | "Dl Size...: 0 MiB [00:00, ? MiB/s]"
3354 | ],
3355 | "application/vnd.jupyter.widget-view+json": {
3356 | "version_major": 2,
3357 | "version_minor": 0,
3358 | "model_id": "63117fcc267e4d9b9d83c81448ec891a"
3359 | }
3360 | },
3361 | "metadata": {}
3362 | },
3363 | {
3364 | "output_type": "display_data",
3365 | "data": {
3366 | "text/plain": [
3367 | "Generating splits...: 0%| | 0/3 [00:00, ? splits/s]"
3368 | ],
3369 | "application/vnd.jupyter.widget-view+json": {
3370 | "version_major": 2,
3371 | "version_minor": 0,
3372 | "model_id": "cd666a0c2b2e48b995cc54ca36fccdf3"
3373 | }
3374 | },
3375 | "metadata": {}
3376 | },
3377 | {
3378 | "output_type": "display_data",
3379 | "data": {
3380 | "text/plain": [
3381 | "Generating train examples...: 0%| | 0/25000 [00:00, ? examples/s]"
3382 | ],
3383 | "application/vnd.jupyter.widget-view+json": {
3384 | "version_major": 2,
3385 | "version_minor": 0,
3386 | "model_id": "149bab124f4c4f44b59ef4d63a07f02d"
3387 | }
3388 | },
3389 | "metadata": {}
3390 | },
3391 | {
3392 | "output_type": "display_data",
3393 | "data": {
3394 | "text/plain": [
3395 | "Shuffling /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0.incompleteSAD0T3/imdb_reviews-train.tfrecord…"
3396 | ],
3397 | "application/vnd.jupyter.widget-view+json": {
3398 | "version_major": 2,
3399 | "version_minor": 0,
3400 | "model_id": "40a1e79a8fac4ff4ba1c8f186ac47340"
3401 | }
3402 | },
3403 | "metadata": {}
3404 | },
3405 | {
3406 | "output_type": "display_data",
3407 | "data": {
3408 | "text/plain": [
3409 | "Generating test examples...: 0%| | 0/25000 [00:00, ? examples/s]"
3410 | ],
3411 | "application/vnd.jupyter.widget-view+json": {
3412 | "version_major": 2,
3413 | "version_minor": 0,
3414 | "model_id": "7cd65bceb9cb4944aeb30c186a9bc90e"
3415 | }
3416 | },
3417 | "metadata": {}
3418 | },
3419 | {
3420 | "output_type": "display_data",
3421 | "data": {
3422 | "text/plain": [
3423 | "Shuffling /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0.incompleteSAD0T3/imdb_reviews-test.tfrecord*…"
3424 | ],
3425 | "application/vnd.jupyter.widget-view+json": {
3426 | "version_major": 2,
3427 | "version_minor": 0,
3428 | "model_id": "c53d7572399a4e32804c6b353f055030"
3429 | }
3430 | },
3431 | "metadata": {}
3432 | },
3433 | {
3434 | "output_type": "display_data",
3435 | "data": {
3436 | "text/plain": [
3437 | "Generating unsupervised examples...: 0%| | 0/50000 [00:00, ? examples/s]"
3438 | ],
3439 | "application/vnd.jupyter.widget-view+json": {
3440 | "version_major": 2,
3441 | "version_minor": 0,
3442 | "model_id": "cfd9342f64534a579161b6e2a94a81d8"
3443 | }
3444 | },
3445 | "metadata": {}
3446 | },
3447 | {
3448 | "output_type": "display_data",
3449 | "data": {
3450 | "text/plain": [
3451 | "Shuffling /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0.incompleteSAD0T3/imdb_reviews-unsupervised.t…"
3452 | ],
3453 | "application/vnd.jupyter.widget-view+json": {
3454 | "version_major": 2,
3455 | "version_minor": 0,
3456 | "model_id": "5a81f7fbf0a74a3e8eb09b968c8e5b9b"
3457 | }
3458 | },
3459 | "metadata": {}
3460 | },
3461 | {
3462 | "output_type": "stream",
3463 | "name": "stdout",
3464 | "text": [
3465 | "Dataset imdb_reviews downloaded and prepared to /root/tensorflow_datasets/imdb_reviews/plain_text/1.0.0. Subsequent calls will reuse this data.\n"
3466 | ]
3467 | }
3468 | ]
3469 | },
3470 | {
3471 | "cell_type": "markdown",
3472 | "source": [
3473 | "## Preprocessing dataset\n",
3474 | "\n",
3475 | "Next we move on to preprocessing the dataset, we use the `WordPieceTokenizer` from kerasNLP to tokenize the dataset and kerasNLP StartEndPacker to pack the input dataset. Then we create the data generator to train the model\n"
3476 | ],
3477 | "metadata": {
3478 | "id": "bznCghSL3Efx"
3479 | }
3480 | },
3481 | {
3482 | "cell_type": "code",
3483 | "source": [
3484 | "vocab = keras_nlp.tokenizers.compute_word_piece_vocabulary(\n",
3485 | " imdb_train.map(lambda x, y: x),\n",
3486 | " vocabulary_size=20_000,\n",
3487 | " lowercase=True,\n",
3488 | " strip_accents=True,\n",
3489 | " reserved_tokens=[\"[PAD]\", \"[START]\", \"[END]\", \"[MASK]\", \"[UNK]\"],\n",
3490 | ")\n",
3491 | "tokenizer = keras_nlp.tokenizers.WordPieceTokenizer(\n",
3492 | " vocabulary=vocab,\n",
3493 | " lowercase=True,\n",
3494 | " strip_accents=True,\n",
3495 | " oov_token=\"[UNK]\",\n",
3496 | ")\n",
3497 | "packer = keras_nlp.layers.StartEndPacker(\n",
3498 | " start_value=tokenizer.token_to_id(\"[START]\"),\n",
3499 | " end_value=tokenizer.token_to_id(\"[END]\"),\n",
3500 | " pad_value=tokenizer.token_to_id(\"[PAD]\"),\n",
3501 | " sequence_length=512,\n",
3502 | ")\n",
3503 | "\n",
3504 | "\n",
3505 | "def preprocess(x, y):\n",
3506 | " token_ids = packer(tokenizer(x))\n",
3507 | " return token_ids, y\n",
3508 | "\n",
3509 | "\n",
3510 | "imdb_preproc_train_ds = imdb_train.map(\n",
3511 | " preprocess, num_parallel_calls=tf.data.AUTOTUNE\n",
3512 | ").prefetch(tf.data.AUTOTUNE)\n",
3513 | "imdb_preproc_val_ds = imdb_test.map(\n",
3514 | " preprocess, num_parallel_calls=tf.data.AUTOTUNE\n",
3515 | ").prefetch(tf.data.AUTOTUNE)"
3516 | ],
3517 | "metadata": {
3518 | "id": "_3YdW2AJpwsE"
3519 | },
3520 | "execution_count": null,
3521 | "outputs": []
3522 | },
3523 | {
3524 | "cell_type": "markdown",
3525 | "source": [
3526 | "## Model Building\n",
3527 | "\n",
3528 | "For this simple classification pipeline, we use the pretrained `BertClassifier` from kerasNLP\n",
3529 | "\n",
3530 | "In the following guide we create a simple classifier using the kerasNLP `TransformerEncoder` and Dense layers and then each time change the embedding layers to see the affects"
3531 | ],
3532 | "metadata": {
3533 | "id": "IklgP0xH3ees"
3534 | }
3535 | },
3536 | {
3537 | "cell_type": "code",
3538 | "source": [
3539 | "# Load a BERT model.\n",
3540 | "classifier = keras_nlp.models.BertClassifier.from_preset(\"bert_tiny_en_uncased\",num_classes=2)\n",
3541 | "# Fine-tune on IMDb movie reviews.\n",
3542 | "classifier.fit(imdb_train, validation_data=imdb_test)\n",
3543 | "# Predict two new examples.\n",
3544 | "classifier.predict([\"What an amazing movie!\", \"A total waste of my time.\"])"
3545 | ],
3546 | "metadata": {
3547 | "colab": {
3548 | "base_uri": "https://localhost:8080/"
3549 | },
3550 | "id": "46PNav8XoQ9-",
3551 | "outputId": "fe57e2f3-e9a2-4cb4-e20e-c3598fa7b42c"
3552 | },
3553 | "execution_count": null,
3554 | "outputs": [
3555 | {
3556 | "output_type": "stream",
3557 | "name": "stdout",
3558 | "text": [
3559 | "1563/1563 [==============================] - 436s 236ms/step - loss: 0.4154 - sparse_categorical_accuracy: 0.8056 - val_loss: 0.3105 - val_sparse_categorical_accuracy: 0.8684\n",
3560 | "1/1 [==============================] - 3s 3s/step\n"
3561 | ]
3562 | },
3563 | {
3564 | "output_type": "execute_result",
3565 | "data": {
3566 | "text/plain": [
3567 | "array([[-2.1772902, 1.5806383],\n",
3568 | " [ 1.2048193, -0.9244135]], dtype=float32)"
3569 | ]
3570 | },
3571 | "metadata": {},
3572 | "execution_count": 12
3573 | }
3574 | ]
3575 | },
3576 | {
3577 | "cell_type": "markdown",
3578 | "source": [
3579 | "## Position Embedding\n",
3580 | "\n",
3581 | "\n",
3582 | "\n",
3583 | "**sequence_length**: The maximum length of the dynamic sequence.\n",
3584 | "\n",
3585 | "**initializer**: The initializer to use for the embedding weights. Defaults to \"glorot_uniform\".\n",
3586 | "\n",
3587 | "**seq_axis**: The axis of the input tensor where we add the embeddings."
3588 | ],
3589 | "metadata": {
3590 | "id": "2dun_bCjzI7Q"
3591 | }
3592 | },
3593 | {
3594 | "cell_type": "code",
3595 | "source": [
3596 | "token_id_input = keras.Input(\n",
3597 | " shape=(None,),\n",
3598 | " dtype=\"int32\",\n",
3599 | " name=\"token_ids\",\n",
3600 | ")\n",
3601 | "embed = keras.layers.Embedding(\n",
3602 | " input_dim=len(vocab), output_dim=64\n",
3603 | ")(token_id_input)\n",
3604 | "outputs = keras_nlp.layers.PositionEmbedding(\n",
3605 | " sequence_length=packer.sequence_length,\n",
3606 | ")(embed)\n",
3607 | "outputs = embed+outputs\n",
3608 | "outputs = keras_nlp.layers.TransformerEncoder(\n",
3609 | " num_heads=2,\n",
3610 | " intermediate_dim=128,\n",
3611 | " dropout=0.1,\n",
3612 | ")(outputs)\n",
3613 | "outputs = keras.layers.Dense(2)(outputs[:, 0, :])\n",
3614 | "model = keras.Model(\n",
3615 | " inputs=token_id_input,\n",
3616 | " outputs=outputs,\n",
3617 | ")\n",
3618 | "\n",
3619 | "model.summary()"
3620 | ],
3621 | "metadata": {
3622 | "colab": {
3623 | "base_uri": "https://localhost:8080/"
3624 | },
3625 | "id": "pASrqxQEzL_u",
3626 | "outputId": "7a70d9b8-2041-4b27-fb03-0075e6c183c0"
3627 | },
3628 | "execution_count": null,
3629 | "outputs": [
3630 | {
3631 | "output_type": "stream",
3632 | "name": "stdout",
3633 | "text": [
3634 | "Model: \"model_5\"\n",
3635 | "__________________________________________________________________________________________________\n",
3636 | " Layer (type) Output Shape Param # Connected to \n",
3637 | "==================================================================================================\n",
3638 | " token_ids (InputLayer) [(None, None)] 0 [] \n",
3639 | " \n",
3640 | " embedding_2 (Embedding) (None, None, 64) 1226880 ['token_ids[0][0]'] \n",
3641 | " \n",
3642 | " position_embedding_11 (Positio (None, None, 64) 32768 ['embedding_2[0][0]'] \n",
3643 | " nEmbedding) \n",
3644 | " \n",
3645 | " tf.__operators__.add_1 (TFOpLa (None, None, 64) 0 ['embedding_2[0][0]', \n",
3646 | " mbda) 'position_embedding_11[0][0]'] \n",
3647 | " \n",
3648 | " transformer_encoder_8 (Transfo (None, None, 64) 33472 ['tf.__operators__.add_1[0][0]'] \n",
3649 | " rmerEncoder) \n",
3650 | " \n",
3651 | " tf.__operators__.getitem_11 (S (None, 64) 0 ['transformer_encoder_8[0][0]'] \n",
3652 | " licingOpLambda) \n",
3653 | " \n",
3654 | " dense_5 (Dense) (None, 2) 130 ['tf.__operators__.getitem_11[0][\n",
3655 | " 0]'] \n",
3656 | " \n",
3657 | "==================================================================================================\n",
3658 | "Total params: 1,293,250\n",
3659 | "Trainable params: 1,293,250\n",
3660 | "Non-trainable params: 0\n",
3661 | "__________________________________________________________________________________________________\n"
3662 | ]
3663 | }
3664 | ]
3665 | },
3666 | {
3667 | "cell_type": "code",
3668 | "source": [
3669 | "model.compile(\n",
3670 | " loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),\n",
3671 | " optimizer=keras.optimizers.experimental.AdamW(5e-5),\n",
3672 | " metrics=keras.metrics.SparseCategoricalAccuracy(),\n",
3673 | " jit_compile=True,\n",
3674 | ")\n",
3675 | "model.fit(\n",
3676 | " imdb_preproc_train_ds,\n",
3677 | " validation_data=imdb_preproc_val_ds,\n",
3678 | " epochs=3,\n",
3679 | ")"
3680 | ],
3681 | "metadata": {
3682 | "colab": {
3683 | "base_uri": "https://localhost:8080/"
3684 | },
3685 | "id": "qcBtcZ8XzPI8",
3686 | "outputId": "d0e8f95e-2d1e-4dd6-b26b-f13a44774b4e"
3687 | },
3688 | "execution_count": null,
3689 | "outputs": [
3690 | {
3691 | "output_type": "stream",
3692 | "name": "stdout",
3693 | "text": [
3694 | "Epoch 1/3\n",
3695 | "1563/1563 [==============================] - 177s 109ms/step - loss: 0.6726 - sparse_categorical_accuracy: 0.5700 - val_loss: 0.5469 - val_sparse_categorical_accuracy: 0.7202\n",
3696 | "Epoch 2/3\n",
3697 | "1563/1563 [==============================] - 154s 99ms/step - loss: 0.3747 - sparse_categorical_accuracy: 0.8389 - val_loss: 0.3275 - val_sparse_categorical_accuracy: 0.8637\n",
3698 | "Epoch 3/3\n",
3699 | "1563/1563 [==============================] - 144s 92ms/step - loss: 0.2647 - sparse_categorical_accuracy: 0.8938 - val_loss: 0.2988 - val_sparse_categorical_accuracy: 0.8767\n"
3700 | ]
3701 | },
3702 | {
3703 | "output_type": "execute_result",
3704 | "data": {
3705 | "text/plain": [
3706 | ""
3707 | ]
3708 | },
3709 | "metadata": {},
3710 | "execution_count": 42
3711 | }
3712 | ]
3713 | },
3714 | {
3715 | "cell_type": "markdown",
3716 | "source": [
3717 | "## Sine Positional Embedding\n",
3718 | "\n",
3719 | "This layer calculates the position encoding as a mix of sine and cosine functions with geometrically increasing wavelengths. Defined and formulized in Attention is All You Need.\n",
3720 | "\n",
3721 | "**max_wavelength**: The maximum angular wavelength of the sine/cosine curves, as described in Attention is All You Need. Defaults to 10000."
3722 | ],
3723 | "metadata": {
3724 | "id": "v3W3bPJPz3lx"
3725 | }
3726 | },
3727 | {
3728 | "cell_type": "code",
3729 | "source": [
3730 | "token_id_input = keras.Input(\n",
3731 | " shape=(None,),\n",
3732 | " dtype=\"int32\",\n",
3733 | " name=\"token_ids\",\n",
3734 | ")\n",
3735 | "embed = keras.layers.Embedding(\n",
3736 | " input_dim=len(vocab), output_dim=64\n",
3737 | ")(token_id_input)\n",
3738 | "outputs = keras_nlp.layers.SinePositionEncoding()(embed)\n",
3739 | "outputs = embed+outputs\n",
3740 | "outputs = keras_nlp.layers.TransformerEncoder(\n",
3741 | " num_heads=2,\n",
3742 | " intermediate_dim=128,\n",
3743 | " dropout=0.1,\n",
3744 | ")(outputs)\n",
3745 | "outputs = keras.layers.Dense(2)(outputs[:, 0, :])\n",
3746 | "model = keras.Model(\n",
3747 | " inputs=token_id_input,\n",
3748 | " outputs=outputs,\n",
3749 | ")\n",
3750 | "\n",
3751 | "model.summary()"
3752 | ],
3753 | "metadata": {
3754 | "colab": {
3755 | "base_uri": "https://localhost:8080/"
3756 | },
3757 | "id": "aVk8T47Yzzi4",
3758 | "outputId": "1bc452ab-613d-420d-97bf-3aeb595e6600"
3759 | },
3760 | "execution_count": null,
3761 | "outputs": [
3762 | {
3763 | "output_type": "stream",
3764 | "name": "stdout",
3765 | "text": [
3766 | "Model: \"model_8\"\n",
3767 | "__________________________________________________________________________________________________\n",
3768 | " Layer (type) Output Shape Param # Connected to \n",
3769 | "==================================================================================================\n",
3770 | " token_ids (InputLayer) [(None, None)] 0 [] \n",
3771 | " \n",
3772 | " embedding_3 (Embedding) (None, None, 64) 1226880 ['token_ids[0][0]'] \n",
3773 | " \n",
3774 | " sine_position_encoding_2 (Sine (None, None, 64) 0 ['embedding_3[0][0]'] \n",
3775 | " PositionEncoding) \n",
3776 | " \n",
3777 | " tf.__operators__.add_2 (TFOpLa (None, None, 64) 0 ['embedding_3[0][0]', \n",
3778 | " mbda) 'sine_position_encoding_2[0][0]'\n",
3779 | " ] \n",
3780 | " \n",
3781 | " transformer_encoder_11 (Transf (None, None, 64) 33472 ['tf.__operators__.add_2[0][0]'] \n",
3782 | " ormerEncoder) \n",
3783 | " \n",
3784 | " tf.__operators__.getitem_14 (S (None, 64) 0 ['transformer_encoder_11[0][0]'] \n",
3785 | " licingOpLambda) \n",
3786 | " \n",
3787 | " dense_8 (Dense) (None, 2) 130 ['tf.__operators__.getitem_14[0][\n",
3788 | " 0]'] \n",
3789 | " \n",
3790 | "==================================================================================================\n",
3791 | "Total params: 1,260,482\n",
3792 | "Trainable params: 1,260,482\n",
3793 | "Non-trainable params: 0\n",
3794 | "__________________________________________________________________________________________________\n"
3795 | ]
3796 | }
3797 | ]
3798 | },
3799 | {
3800 | "cell_type": "code",
3801 | "source": [
3802 | "model.compile(\n",
3803 | " loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),\n",
3804 | " optimizer=keras.optimizers.experimental.AdamW(5e-5),\n",
3805 | " metrics=keras.metrics.SparseCategoricalAccuracy(),\n",
3806 | " jit_compile=True,\n",
3807 | ")\n",
3808 | "model.fit(\n",
3809 | " imdb_preproc_train_ds,\n",
3810 | " validation_data=imdb_preproc_val_ds,\n",
3811 | " epochs=3,\n",
3812 | ")"
3813 | ],
3814 | "metadata": {
3815 | "colab": {
3816 | "base_uri": "https://localhost:8080/"
3817 | },
3818 | "id": "4Vi6tkusz8-k",
3819 | "outputId": "9a5bd483-fdf2-4086-f3e7-10a71e4cf8c9"
3820 | },
3821 | "execution_count": null,
3822 | "outputs": [
3823 | {
3824 | "output_type": "stream",
3825 | "name": "stdout",
3826 | "text": [
3827 | "Epoch 1/3\n",
3828 | "1563/1563 [==============================] - 159s 97ms/step - loss: 0.7058 - sparse_categorical_accuracy: 0.5028 - val_loss: 0.6950 - val_sparse_categorical_accuracy: 0.5000\n",
3829 | "Epoch 2/3\n",
3830 | "1563/1563 [==============================] - 159s 102ms/step - loss: 0.6889 - sparse_categorical_accuracy: 0.5364 - val_loss: 0.6695 - val_sparse_categorical_accuracy: 0.5344\n",
3831 | "Epoch 3/3\n",
3832 | "1563/1563 [==============================] - 155s 99ms/step - loss: 0.5447 - sparse_categorical_accuracy: 0.7310 - val_loss: 0.4687 - val_sparse_categorical_accuracy: 0.7697\n"
3833 | ]
3834 | },
3835 | {
3836 | "output_type": "execute_result",
3837 | "data": {
3838 | "text/plain": [
3839 | ""
3840 | ]
3841 | },
3842 | "metadata": {},
3843 | "execution_count": 49
3844 | }
3845 | ]
3846 | },
3847 | {
3848 | "cell_type": "markdown",
3849 | "source": [
3850 | "## Rotary embeddings\n",
3851 | "\n",
3852 | "Rotary position embedding is a sort of position embedding that naturally combines explicit relative position dependency in the formulation of self-attention while encoding absolute positional information with rotation matrices.\n",
3853 | "\n",
3854 | "**rotary_ndims**: The rotatory matrix dimensions\n",
3855 | "\n",
3856 | "**max_wavelength**: The maximum angular wavelength of the sine/cosine curves, as described in Attention is All You Need. Defaults to 10000."
3857 | ],
3858 | "metadata": {
3859 | "id": "S_48Odbh7CCs"
3860 | }
3861 | },
3862 | {
3863 | "cell_type": "code",
3864 | "source": [
3865 | "class RotaryEmbedding(keras.layers.Layer):\n",
3866 | " def __init__(self, rotary_ndims, max_wavelength=10000):\n",
3867 | " super().__init__()\n",
3868 | " self.rotary_ndims = int(rotary_ndims)\n",
3869 | " self.max_wavelength = max_wavelength\n",
3870 | " self.to_qk = keras.layers.Dense(units=rotary_ndims * 4, use_bias=False)\n",
3871 | "\n",
3872 | " def _apply_rotary_pos_emb(self, tensor, cos_emb, sin_emb):\n",
3873 | " cos_emb = cos_emb[: tf.shape(tensor)[0], : tf.shape(tensor)[1]]\n",
3874 | " sin_emb = sin_emb[: tf.shape(tensor)[0], : tf.shape(tensor)[1]]\n",
3875 | " x1, x2 = tf.split(tensor, 2, axis=-1)\n",
3876 | " half_rot_tensor = tf.concat((-x2, x1), axis=-1)\n",
3877 | " ret = (tensor * cos_emb) + (half_rot_tensor * sin_emb)\n",
3878 | " return ret\n",
3879 | "\n",
3880 | " def _compute_cos_sin_embedding(self, x, seq_dim=1):\n",
3881 | " seq_len = tf.shape(x)[seq_dim]\n",
3882 | " range = tf.range(\n",
3883 | " start=0, limit=self.rotary_ndims, delta=2, dtype=\"float32\"\n",
3884 | " )\n",
3885 | " inverse_freq = 1.0 / (\n",
3886 | " self.max_wavelength ** (range / self.rotary_ndims)\n",
3887 | " )\n",
3888 | " tensor = tf.range(seq_len, dtype=inverse_freq.dtype)\n",
3889 | " freqs = tf.einsum(\"i, j -> ij\", tensor, inverse_freq)\n",
3890 | " embedding = tf.concat((freqs, freqs), axis=-1)\n",
3891 | " return tf.cos(embedding), tf.sin(embedding)\n",
3892 | "\n",
3893 | " def call(self, x):\n",
3894 | " qk = self.to_qk(x)\n",
3895 | " qk = tf.split(qk, num_or_size_splits=2, axis=-1)\n",
3896 | " query, key = qk\n",
3897 | "\n",
3898 | " query_rot, query_pass = (\n",
3899 | " query[..., : self.rotary_ndims],\n",
3900 | " query[..., self.rotary_ndims :],\n",
3901 | " )\n",
3902 | " key_rot, key_pass = (\n",
3903 | " key[..., : self.rotary_ndims],\n",
3904 | " key[..., self.rotary_ndims :],\n",
3905 | " )\n",
3906 | " cos_emb, sin_emb = self._compute_cos_sin_embedding(key_rot, seq_dim=1)\n",
3907 | " query_emb = self._apply_rotary_pos_emb(query_rot, cos_emb, sin_emb)\n",
3908 | " key_emb = self._apply_rotary_pos_emb(key_rot, cos_emb, sin_emb)\n",
3909 | " query = tf.concat((query_emb, query_pass), axis=-1)\n",
3910 | "\n",
3911 | " return query\n",
3912 | "\n",
3913 | " def get_config(self):\n",
3914 | " config = super().get_config()\n",
3915 | " config.update(\n",
3916 | " {\n",
3917 | " \"rotary_ndims\": self.rotary_ndims,\n",
3918 | " \"max_wavelength\": self.max_wavelength,\n",
3919 | " }\n",
3920 | " )\n",
3921 | "\n",
3922 | " return config\n",
3923 | "\n"
3924 | ],
3925 | "metadata": {
3926 | "id": "_bqIXwR12dfi",
3927 | "colab": {
3928 | "base_uri": "https://localhost:8080/"
3929 | },
3930 | "outputId": "7986b80c-78f2-4248-8aff-82cf3a8a7f4b"
3931 | },
3932 | "execution_count": null,
3933 | "outputs": [
3934 | {
3935 | "output_type": "execute_result",
3936 | "data": {
3937 | "text/plain": [
3938 | "TensorShape([2, 128])"
3939 | ]
3940 | },
3941 | "metadata": {},
3942 | "execution_count": 46
3943 | }
3944 | ]
3945 | },
3946 | {
3947 | "cell_type": "code",
3948 | "source": [
3949 | "from einops import rearrange, repeat\n",
3950 | "\n",
3951 | "token_id_input = keras.Input(\n",
3952 | " shape=(None,),\n",
3953 | " dtype=\"int32\",\n",
3954 | " name=\"token_ids\",\n",
3955 | ")\n",
3956 | "embed = keras.layers.Embedding(\n",
3957 | " input_dim=len(vocab), output_dim=128\n",
3958 | ")(token_id_input)\n",
3959 | "outputs = RotaryEmbedding(64)(embed)\n",
3960 | "outputs=outputs+embed\n",
3961 | "outputs = keras_nlp.layers.TransformerEncoder(\n",
3962 | " num_heads=2,\n",
3963 | " intermediate_dim=128,\n",
3964 | " dropout=0.1,\n",
3965 | ")(outputs)\n",
3966 | "outputs = keras.layers.Dense(2)(outputs[:, 0, :])\n",
3967 | "model = keras.Model(\n",
3968 | " inputs=token_id_input,\n",
3969 | " outputs=outputs,\n",
3970 | ")\n",
3971 | "\n",
3972 | "model.summary()"
3973 | ],
3974 | "metadata": {
3975 | "colab": {
3976 | "base_uri": "https://localhost:8080/"
3977 | },
3978 | "id": "o4mc34DT7N6i",
3979 | "outputId": "7e2159ec-3e7a-4a96-e702-adee68c3b8c6"
3980 | },
3981 | "execution_count": null,
3982 | "outputs": [
3983 | {
3984 | "output_type": "stream",
3985 | "name": "stdout",
3986 | "text": [
3987 | "Model: \"model\"\n",
3988 | "__________________________________________________________________________________________________\n",
3989 | " Layer (type) Output Shape Param # Connected to \n",
3990 | "==================================================================================================\n",
3991 | " token_ids (InputLayer) [(None, None)] 0 [] \n",
3992 | " \n",
3993 | " embedding_7 (Embedding) (None, None, 128) 2453760 ['token_ids[0][0]'] \n",
3994 | " \n",
3995 | " rotary_embedding_37 (RotaryEmb (None, None, 128) 32768 ['embedding_7[0][0]'] \n",
3996 | " edding) \n",
3997 | " \n",
3998 | " tf.__operators__.add_3 (TFOpLa (None, None, 128) 0 ['rotary_embedding_37[0][0]', \n",
3999 | " mbda) 'embedding_7[0][0]'] \n",
4000 | " \n",
4001 | " transformer_encoder (Transform (None, None, 128) 99584 ['tf.__operators__.add_3[0][0]'] \n",
4002 | " erEncoder) \n",
4003 | " \n",
4004 | " tf.__operators__.getitem (Slic (None, 128) 0 ['transformer_encoder[0][0]'] \n",
4005 | " ingOpLambda) \n",
4006 | " \n",
4007 | " dense_37 (Dense) (None, 2) 258 ['tf.__operators__.getitem[0][0]'\n",
4008 | " ] \n",
4009 | " \n",
4010 | "==================================================================================================\n",
4011 | "Total params: 2,586,370\n",
4012 | "Trainable params: 2,586,370\n",
4013 | "Non-trainable params: 0\n",
4014 | "__________________________________________________________________________________________________\n"
4015 | ]
4016 | }
4017 | ]
4018 | },
4019 | {
4020 | "cell_type": "code",
4021 | "source": [
4022 | "model.compile(\n",
4023 | " loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),\n",
4024 | " optimizer=keras.optimizers.experimental.AdamW(5e-5),\n",
4025 | " metrics=keras.metrics.SparseCategoricalAccuracy(),\n",
4026 | " jit_compile=True,\n",
4027 | ")\n",
4028 | "model.fit(\n",
4029 | " imdb_preproc_train_ds,\n",
4030 | " validation_data=imdb_preproc_val_ds,\n",
4031 | " epochs=3,\n",
4032 | ")"
4033 | ],
4034 | "metadata": {
4035 | "colab": {
4036 | "base_uri": "https://localhost:8080/"
4037 | },
4038 | "id": "fT4eWdIR7Qcb",
4039 | "outputId": "b5a44040-ce02-48ef-d9ea-4937c5f5eb30"
4040 | },
4041 | "execution_count": null,
4042 | "outputs": [
4043 | {
4044 | "output_type": "stream",
4045 | "name": "stdout",
4046 | "text": [
4047 | "Epoch 1/3\n",
4048 | "1563/1563 [==============================] - 32s 16ms/step - loss: 0.7163 - sparse_categorical_accuracy: 0.5028 - val_loss: 0.6969 - val_sparse_categorical_accuracy: 0.5000\n",
4049 | "Epoch 2/3\n",
4050 | "1563/1563 [==============================] - 23s 15ms/step - loss: 0.7025 - sparse_categorical_accuracy: 0.5047 - val_loss: 0.6964 - val_sparse_categorical_accuracy: 0.5000\n",
4051 | "Epoch 3/3\n",
4052 | "1563/1563 [==============================] - 23s 15ms/step - loss: 0.6986 - sparse_categorical_accuracy: 0.5032 - val_loss: 0.6956 - val_sparse_categorical_accuracy: 0.5000\n"
4053 | ]
4054 | },
4055 | {
4056 | "output_type": "execute_result",
4057 | "data": {
4058 | "text/plain": [
4059 | ""
4060 | ]
4061 | },
4062 | "metadata": {},
4063 | "execution_count": 47
4064 | }
4065 | ]
4066 | },
4067 | {
4068 | "cell_type": "markdown",
4069 | "source": [
4070 | "## Alibi embeddings\n",
4071 | "\n",
4072 | "Without using actual position embeddings, ALiBi completes the positional embedding task. Instead, ALiBi penalises the attention value that a given query can give to a given key based on how far apart the key and query are from one another when calculating the attention between a given key and query. As a result, the penalty is relatively low when a key and question are close together and very high when they are far apart.\n",
4073 | "\n",
4074 | "The idea behind this strategy is the obvious one that words that are nearby matter a lot more than words that are far away. It takes in the attention head size and total heads as the input parameters.\n",
4075 | "\n",
4076 | "\n"
4077 | ],
4078 | "metadata": {
4079 | "id": "Ads3RvmfDIae"
4080 | }
4081 | },
4082 | {
4083 | "cell_type": "code",
4084 | "source": [
4085 | "!pip install einops"
4086 | ],
4087 | "metadata": {
4088 | "colab": {
4089 | "base_uri": "https://localhost:8080/"
4090 | },
4091 | "id": "_EnisJQ4GcaL",
4092 | "outputId": "5833bca3-b46a-4ce7-fea5-aaa9d3bbb1fb"
4093 | },
4094 | "execution_count": null,
4095 | "outputs": [
4096 | {
4097 | "output_type": "stream",
4098 | "name": "stdout",
4099 | "text": [
4100 | "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
4101 | "Collecting einops\n",
4102 | " Downloading einops-0.6.1-py3-none-any.whl (42 kB)\n",
4103 | "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m42.2/42.2 kB\u001b[0m \u001b[31m2.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
4104 | "\u001b[?25hInstalling collected packages: einops\n",
4105 | "Successfully installed einops-0.6.1\n"
4106 | ]
4107 | }
4108 | ]
4109 | },
4110 | {
4111 | "cell_type": "code",
4112 | "source": [
4113 | "import math\n",
4114 | "from einops import rearrange, repeat, reduce\n",
4115 | "\n",
4116 | "\n",
4117 | "class AlibiPositionalBias(layers.Layer):\n",
4118 | " def __init__(self, heads, total_heads):\n",
4119 | " super(AlibiPositionalBias,self).__init__()\n",
4120 | " self.heads = heads\n",
4121 | " self.total_heads = total_heads\n",
4122 | " slopes = self._get_slopes(heads)\n",
4123 | " slopes = tf.convert_to_tensor(slopes, dtype=tf.float32)\n",
4124 | " slopes = rearrange(slopes, 'h -> h 1 1')\n",
4125 | " self.slopes =slopes\n",
4126 | " self.bias=None\n",
4127 | "\n",
4128 | " def get_bias(self, i, j):\n",
4129 | " i_arange = tf.range(j - i, j)\n",
4130 | " j_arange = tf.range(j)\n",
4131 | " bias = -tf.math.abs(rearrange(j_arange, 'j -> 1 1 j') - rearrange(i_arange, 'i -> 1 i 1'))\n",
4132 | " return bias\n",
4133 | " @staticmethod\n",
4134 | " def _get_slopes(heads):\n",
4135 | " def get_slopes_power_of_2(n):\n",
4136 | " start = (2**(-2**-(math.log2(n)-3)))\n",
4137 | " ratio = start\n",
4138 | " return [start*ratio**i for i in range(n)]\n",
4139 | "\n",
4140 | " if math.log2(heads).is_integer():\n",
4141 | " return get_slopes_power_of_2(heads)\n",
4142 | "\n",
4143 | " closest_power_of_2 = 2 ** math.floor(math.log2(heads))\n",
4144 | " return get_slopes_power_of_2(closest_power_of_2) + get_slopes_power_of_2(2 * closest_power_of_2)[0::2][:heads-closest_power_of_2]\n",
4145 | "\n",
4146 | "\n",
4147 | " def call(self, i, j):\n",
4148 | " h = self.total_heads\n",
4149 | "\n",
4150 | " if self.bias and self.bias.shape[-1] >= j:\n",
4151 | " return self.bias[..., :i, :j]\n",
4152 | "\n",
4153 | " bias = self.get_bias(i, j)\n",
4154 | " bias = tf.cast(bias,dtype=tf.float32) * self.slopes\n",
4155 | " self.bias = bias\n",
4156 | "\n",
4157 | " return self.bias\n",
4158 | "\n",
4159 | "class LearnedAlibiPositionalBias(AlibiPositionalBias):\n",
4160 | " def __init__(self, heads, total_heads):\n",
4161 | " super(LearnedAlibiPositionalBias,self).__init__(heads, total_heads)\n",
4162 | " log_slopes = tf.math.log(self.slopes)\n",
4163 | " self.learned_logslopes = tf.Variable(log_slopes)\n",
4164 | "\n",
4165 | " def call(self, i, j):\n",
4166 | " h = self.heads\n",
4167 | "\n",
4168 | " def get_slopes(param):\n",
4169 | " return tf.math.exp(param)\n",
4170 | "\n",
4171 | " if self.bias and self.bias.shape[-1] >= j:\n",
4172 | " bias = self.bias[..., :i, :j]\n",
4173 | " else:\n",
4174 | " bias = self.get_bias(i, j)\n",
4175 | " self.bias=bias\n",
4176 | "\n",
4177 | " slopes = get_slopes(self.learned_logslopes)\n",
4178 | " bias = tf.cast(bias,dtype=tf.float32) * slopes\n",
4179 | "\n",
4180 | " return bias"
4181 | ],
4182 | "metadata": {
4183 | "id": "YhNrk6dYCsPI"
4184 | },
4185 | "execution_count": null,
4186 | "outputs": []
4187 | },
4188 | {
4189 | "cell_type": "code",
4190 | "source": [
4191 | "token_id_input = keras.Input(\n",
4192 | " shape=(None,),\n",
4193 | " dtype=\"int32\",\n",
4194 | " name=\"token_ids\",\n",
4195 | ")\n",
4196 | "embed = keras.layers.Embedding(\n",
4197 | " input_dim=len(vocab), output_dim=64\n",
4198 | ")(token_id_input)\n",
4199 | "outputs = embed+LearnedAlibiPositionalBias(1,32)(512,64)\n",
4200 | "outputs = keras_nlp.layers.TransformerEncoder(\n",
4201 | " num_heads=2,\n",
4202 | " intermediate_dim=128,\n",
4203 | " dropout=0.1,\n",
4204 | ")(outputs)\n",
4205 | "outputs = keras.layers.Dense(2)(outputs[:, 0, :])\n",
4206 | "model = keras.Model(\n",
4207 | " inputs=token_id_input,\n",
4208 | " outputs=outputs,\n",
4209 | ")\n",
4210 | "\n",
4211 | "model.summary()"
4212 | ],
4213 | "metadata": {
4214 | "colab": {
4215 | "base_uri": "https://localhost:8080/"
4216 | },
4217 | "outputId": "666df52c-7b73-4801-9d55-65c401886bf1",
4218 | "id": "ZrsuDAbfV-uA"
4219 | },
4220 | "execution_count": null,
4221 | "outputs": [
4222 | {
4223 | "output_type": "stream",
4224 | "name": "stdout",
4225 | "text": [
4226 | "Model: \"model_2\"\n",
4227 | "_________________________________________________________________\n",
4228 | " Layer (type) Output Shape Param # \n",
4229 | "=================================================================\n",
4230 | " token_ids (InputLayer) [(None, None)] 0 \n",
4231 | " \n",
4232 | " embedding_2 (Embedding) (None, None, 64) 1226880 \n",
4233 | " \n",
4234 | " tf.__operators__.add_2 (TFO (None, 512, 64) 0 \n",
4235 | " pLambda) \n",
4236 | " \n",
4237 | " transformer_encoder_2 (Tran (None, 512, 64) 33472 \n",
4238 | " sformerEncoder) \n",
4239 | " \n",
4240 | " tf.__operators__.getitem_2 (None, 64) 0 \n",
4241 | " (SlicingOpLambda) \n",
4242 | " \n",
4243 | " dense_2 (Dense) (None, 2) 130 \n",
4244 | " \n",
4245 | "=================================================================\n",
4246 | "Total params: 1,260,482\n",
4247 | "Trainable params: 1,260,482\n",
4248 | "Non-trainable params: 0\n",
4249 | "_________________________________________________________________\n"
4250 | ]
4251 | }
4252 | ]
4253 | },
4254 | {
4255 | "cell_type": "code",
4256 | "source": [
4257 | "model.compile(\n",
4258 | " loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),\n",
4259 | " optimizer=keras.optimizers.experimental.AdamW(5e-5),\n",
4260 | " metrics=keras.metrics.SparseCategoricalAccuracy(),\n",
4261 | " jit_compile=True,\n",
4262 | ")\n",
4263 | "model.fit(\n",
4264 | " imdb_preproc_train_ds,\n",
4265 | " validation_data=imdb_preproc_val_ds,\n",
4266 | " epochs=3,\n",
4267 | ")"
4268 | ],
4269 | "metadata": {
4270 | "id": "suG3kCuCV-uL"
4271 | },
4272 | "execution_count": null,
4273 | "outputs": []
4274 | },
4275 | {
4276 | "cell_type": "code",
4277 | "source": [],
4278 | "metadata": {
4279 | "id": "HTPukbUiM3W8"
4280 | },
4281 | "execution_count": null,
4282 | "outputs": []
4283 | }
4284 | ]
4285 | }
--------------------------------------------------------------------------------