diff --git "a/data/layouts/deep_learning_with_python_francois_chollet.json" "b/data/layouts/deep_learning_with_python_francois_chollet.json" new file mode 100644--- /dev/null +++ "b/data/layouts/deep_learning_with_python_francois_chollet.json" @@ -0,0 +1 @@ +{"bookId": "deep_learning_with_python_francois_chollet", "title": "Deep Learning with Python", "author": "François Chollet", "totalPages": 493, "engine": "pymupdf", "pages": [{"page": 1, "dimensions": {"width": 595.0, "height": 842.0}, "blocks": []}, {"page": 2, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Deep Learning with Python", "words": [{"w": "Deep", "b": [0.2022, 0.1108, 0.3115, 0.1503]}, {"w": "Learning", "b": [0.3241, 0.1108, 0.5231, 0.1503]}, {"w": "with", "b": [0.5357, 0.1108, 0.631, 0.1503]}, {"w": "Python", "b": [0.6437, 0.1108, 0.7978, 0.1503]}]}, {"id": "b_1", "type": "paragraph", "text": "François Chollet", "words": [{"w": "François", "b": [0.4107, 0.1793, 0.5046, 0.199]}, {"w": "Chollet", "b": [0.5109, 0.1793, 0.5894, 0.199]}]}]}, {"page": 3, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Copyright", "words": [{"w": "Copyright", "b": [0.1294, 0.1076, 0.2862, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact", "words": [{"w": "For", "b": [0.1294, 0.1588, 0.1645, 0.1785]}, {"w": "online", "b": [0.1708, 0.1588, 0.2338, 0.1785]}, {"w": "information", "b": [0.2401, 0.1588, 0.3592, 0.1785]}, {"w": "and", "b": [0.3656, 0.1588, 0.402, 0.1785]}, {"w": "ordering", "b": [0.4083, 0.1588, 0.4937, 0.1785]}, {"w": "of", "b": [0.5001, 0.1588, 0.5211, 0.1785]}, {"w": "this", "b": [0.5274, 0.1588, 0.5638, 0.1785]}, {"w": "and", "b": [0.5701, 0.1588, 0.6066, 0.1785]}, {"w": "other", "b": [0.6129, 0.1588, 0.6647, 0.1785]}, {"w": "Manning", "b": [0.671, 0.1588, 0.7621, 0.1785]}, {"w": "books,", "b": [0.7684, 0.1588, 0.835, 0.1785]}, {"w": "please", "b": [0.1294, 0.1793, 0.1925, 0.199]}, {"w": "visit", "b": [0.1988, 0.1793, 0.2422, 0.199]}, {"w": "www.manning.com.", "b": [0.2485, 0.1793, 0.4521, 0.199]}, {"w": "The", "b": [0.4585, 0.1793, 0.4977, 0.199]}, {"w": "publisher", "b": [0.504, 0.1793, 0.5979, 0.199]}, {"w": "offers", "b": [0.6042, 0.1793, 0.6625, 0.199]}, {"w": "discounts", "b": [0.6688, 0.1793, 0.7641, 0.199]}, {"w": "on", "b": [0.7705, 0.1793, 0.7957, 0.199]}, {"w": "this", "b": [0.802, 0.1793, 0.8384, 0.199]}, {"w": "book", "b": [0.1294, 0.1998, 0.1799, 0.2195]}, {"w": "when", "b": [0.1862, 0.1998, 0.2408, 0.2195]}, {"w": "ordered", "b": [0.2471, 0.1998, 0.3242, 0.2195]}, {"w": "in", "b": [0.3305, 0.1998, 0.3501, 0.2195]}, {"w": "quantity.", "b": [0.3564, 0.1998, 0.4437, 0.2195]}, {"w": "For", "b": [0.45, 0.1998, 0.4851, 0.2195]}, {"w": "more", "b": [0.4914, 0.1998, 0.5432, 0.2195]}, {"w": "information,", "b": [0.5495, 0.1998, 0.6749, 0.2195]}, {"w": "please", "b": [0.6812, 0.1998, 0.7443, 0.2195]}, {"w": "contact", "b": [0.7506, 0.1998, 0.8234, 0.2195]}]}, {"id": "b_2", "type": "paragraph", "text": "Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Email: orders@manning.com", "words": [{"w": "Special", "b": [0.2152, 0.2375, 0.2946, 0.2526]}, {"w": "Sales", "b": [0.306, 0.2375, 0.3628, 0.2526]}, {"w": "Department", "b": [0.3741, 0.2375, 0.4876, 0.2526]}, {"w": "Manning", "b": [0.2152, 0.2527, 0.2946, 0.2678]}, {"w": "Publications", "b": [0.306, 0.2527, 0.4422, 0.2678]}, {"w": "Co.", "b": [0.4536, 0.2527, 0.4876, 0.2678]}, {"w": "20", "b": [0.2152, 0.2678, 0.2379, 0.2829]}, {"w": "Baldwin", "b": [0.2492, 0.2678, 0.3287, 0.2829]}, {"w": "Road", "b": [0.34, 0.2678, 0.3855, 0.2829]}, {"w": "PO", "b": [0.2152, 0.283, 0.2379, 0.2981]}, {"w": "Box", "b": [0.2492, 0.283, 0.2833, 0.2981]}, {"w": "761", "b": [0.2946, 0.283, 0.3287, 0.2981]}, {"w": "Shelter", "b": [0.2152, 0.2981, 0.2946, 0.3133]}, {"w": "Island,", "b": [0.306, 0.2981, 0.3855, 0.3133]}, {"w": "NY", "b": [0.3968, 0.2981, 0.4195, 0.3133]}, {"w": "11964", "b": [0.4309, 0.2981, 0.4876, 0.3133]}, {"w": "Email:", "b": [0.2152, 0.3133, 0.2833, 0.3284]}, {"w": "orders@manning.com", "b": [0.2947, 0.3133, 0.499, 0.3284]}]}, {"id": "b_3", "type": "paragraph", "text": "©2018 by Manning Publications Co. All rights reserved.", "words": [{"w": "©2018", "b": [0.1294, 0.3513, 0.199, 0.371]}, {"w": "by", "b": [0.2053, 0.3513, 0.2306, 0.371]}, {"w": "Manning", "b": [0.2369, 0.3513, 0.328, 0.371]}, {"w": "Publications", "b": [0.3343, 0.3513, 0.459, 0.371]}, {"w": "Co.", "b": [0.4653, 0.3513, 0.5011, 0.371]}, {"w": "All", "b": [0.5074, 0.3513, 0.5396, 0.371]}, {"w": "rights", "b": [0.5459, 0.3513, 0.6034, 0.371]}, {"w": "reserved.", "b": [0.6097, 0.3513, 0.7014, 0.371]}]}, {"id": "b_4", "type": "paragraph", "text": "No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.", "words": [{"w": "No", "b": [0.1294, 0.3941, 0.1602, 0.4138]}, {"w": "part", "b": [0.1665, 0.3941, 0.2058, 0.4138]}, {"w": "of", "b": [0.2121, 0.3941, 0.2331, 0.4138]}, {"w": "this", "b": [0.2394, 0.3941, 0.2758, 0.4138]}, {"w": "publication", "b": [0.2822, 0.3941, 0.3957, 0.4138]}, {"w": "may", "b": [0.402, 0.3941, 0.4454, 0.4138]}, {"w": "be", "b": [0.4517, 0.3941, 0.4755, 0.4138]}, {"w": "reproduced,", "b": [0.4818, 0.3941, 0.6016, 0.4138]}, {"w": "stored", "b": [0.6079, 0.3941, 0.6696, 0.4138]}, {"w": "in", "b": [0.6759, 0.3941, 0.6955, 0.4138]}, {"w": "a", "b": [0.7018, 0.3941, 0.713, 0.4138]}, {"w": "retrieval", "b": [0.7193, 0.3941, 0.8034, 0.4138]}, {"w": "system,", "b": [0.1294, 0.4146, 0.2058, 0.4343]}, {"w": "or", "b": [0.2121, 0.4146, 0.2331, 0.4343]}, {"w": "transmitted,", "b": [0.2394, 0.4146, 0.3592, 0.4343]}, {"w": "in", "b": [0.3656, 0.4146, 0.3852, 0.4343]}, {"w": "any", "b": [0.3915, 0.4146, 0.4279, 0.4343]}, {"w": "form", "b": [0.4342, 0.4146, 0.4833, 0.4343]}, {"w": "or", "b": [0.4896, 0.4146, 0.5106, 0.4343]}, {"w": "by", "b": [0.5169, 0.4146, 0.5421, 0.4343]}, {"w": "means", "b": [0.5484, 0.4146, 0.6129, 0.4343]}, {"w": "electronic,", "b": [0.6192, 0.4146, 0.7249, 0.4343]}, {"w": "mechanical,", "b": [0.7312, 0.4146, 0.8523, 0.4343]}, {"w": "photocopying,", "b": [0.1294, 0.4351, 0.2745, 0.4548]}, {"w": "or", "b": [0.2808, 0.4351, 0.3018, 0.4548]}, {"w": "otherwise,", "b": [0.3081, 0.4351, 0.4125, 0.4548]}, {"w": "without", "b": [0.4188, 0.4351, 0.4959, 0.4548]}, {"w": "prior", "b": [0.5022, 0.4351, 0.5512, 0.4548]}, {"w": "written", "b": [0.5575, 0.4351, 0.629, 0.4548]}, {"w": "permission", "b": [0.6353, 0.4351, 0.746, 0.4548]}, {"w": "of", "b": [0.7523, 0.4351, 0.7733, 0.4548]}, {"w": "the", "b": [0.7796, 0.4351, 0.8105, 0.4548]}, {"w": "publisher.", "b": [0.1294, 0.4556, 0.2282, 0.4753]}]}, {"id": "b_5", "type": "paragraph", "text": "Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps.", "words": [{"w": "Many", "b": [0.1294, 0.4984, 0.1883, 0.5181]}, {"w": "of", "b": [0.1946, 0.4984, 0.2156, 0.5181]}, {"w": "the", "b": [0.2219, 0.4984, 0.2527, 0.5181]}, {"w": "designations", "b": [0.259, 0.4984, 0.3852, 0.5181]}, {"w": "used", "b": [0.3915, 0.4984, 0.4377, 0.5181]}, {"w": "by", "b": [0.444, 0.4984, 0.4692, 0.5181]}, {"w": "manufacturers", "b": [0.4755, 0.4984, 0.6198, 0.5181]}, {"w": "and", "b": [0.6261, 0.4984, 0.6626, 0.5181]}, {"w": "sellers", "b": [0.6689, 0.4984, 0.7333, 0.5181]}, {"w": "to", "b": [0.7396, 0.4984, 0.7592, 0.5181]}, {"w": "distinguish", "b": [0.1294, 0.5189, 0.2402, 0.5386]}, {"w": "their", "b": [0.2465, 0.5189, 0.2927, 0.5386]}, {"w": "products", "b": [0.299, 0.5189, 0.3859, 0.5386]}, {"w": "are", "b": [0.3922, 0.5189, 0.423, 0.5386]}, {"w": "claimed", "b": [0.4293, 0.5189, 0.5092, 0.5386]}, {"w": "as", "b": [0.5155, 0.5189, 0.5365, 0.5386]}, {"w": "trademarks.", "b": [0.5428, 0.5189, 0.6612, 0.5386]}, {"w": "Where", "b": [0.6675, 0.5189, 0.7347, 0.5386]}, {"w": "those", "b": [0.7409, 0.5189, 0.7942, 0.5386]}, {"w": "designations", "b": [0.1294, 0.5394, 0.2555, 0.5591]}, {"w": "appear", "b": [0.2618, 0.5394, 0.3291, 0.5591]}, {"w": "in", "b": [0.3354, 0.5394, 0.355, 0.5591]}, {"w": "the", "b": [0.3613, 0.5394, 0.3921, 0.5591]}, {"w": "book,", "b": [0.3984, 0.5394, 0.4552, 0.5591]}, {"w": "and", "b": [0.4615, 0.5394, 0.4979, 0.5591]}, {"w": "Manning", "b": [0.5042, 0.5394, 0.5953, 0.5591]}, {"w": "Publications", "b": [0.6016, 0.5394, 0.7264, 0.5591]}, {"w": "was", "b": [0.7327, 0.5394, 0.7719, 0.5591]}, {"w": "aware", "b": [0.7782, 0.5394, 0.8384, 0.5591]}, {"w": "of", "b": [0.8447, 0.5394, 0.8658, 0.5591]}, {"w": "a", "b": [0.1294, 0.5599, 0.1406, 0.5796]}, {"w": "trademark", "b": [0.1469, 0.5599, 0.2492, 0.5796]}, {"w": "claim,", "b": [0.2555, 0.5599, 0.3178, 0.5796]}, {"w": "the", "b": [0.3242, 0.5599, 0.355, 0.5796]}, {"w": "designations", "b": [0.3613, 0.5599, 0.4874, 0.5796]}, {"w": "have", "b": [0.4937, 0.5599, 0.5413, 0.5796]}, {"w": "been", "b": [0.5477, 0.5599, 0.5953, 0.5796]}, {"w": "printed", "b": [0.6015, 0.5599, 0.673, 0.5796]}, {"w": "in", "b": [0.6793, 0.5599, 0.6989, 0.5796]}, {"w": "initial", "b": [0.7052, 0.5599, 0.7641, 0.5796]}, {"w": "caps", "b": [0.7704, 0.5599, 0.8152, 0.5796]}, {"w": "or", "b": [0.8215, 0.5599, 0.8425, 0.5796]}, {"w": "all", "b": [0.1294, 0.5804, 0.1546, 0.6001]}, {"w": "caps.", "b": [0.1609, 0.5804, 0.2121, 0.6001]}]}, {"id": "b_6", "type": "paragraph", "text": "Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine.", "words": [{"w": "Recognizing", "b": [0.1546, 0.6231, 0.2822, 0.6429]}, {"w": "the", "b": [0.2885, 0.6231, 0.3193, 0.6429]}, {"w": "importance", "b": [0.3256, 0.6231, 0.4391, 0.6429]}, {"w": "of", "b": [0.4454, 0.6231, 0.4664, 0.6429]}, {"w": "preserving", "b": [0.4727, 0.6231, 0.5792, 0.6429]}, {"w": "what", "b": [0.5855, 0.6231, 0.6345, 0.6429]}, {"w": "has", "b": [0.6408, 0.6231, 0.6745, 0.6429]}, {"w": "been", "b": [0.6808, 0.6231, 0.7284, 0.6429]}, {"w": "written,", "b": [0.7347, 0.6231, 0.8125, 0.6429]}, {"w": "it", "b": [0.8188, 0.6231, 0.8328, 0.6429]}, {"w": "is", "b": [0.8391, 0.6231, 0.8559, 0.6429]}, {"w": "Manning’s", "b": [0.1294, 0.6436, 0.2373, 0.6634]}, {"w": "policy", "b": [0.2436, 0.6436, 0.3067, 0.6634]}, {"w": "to", "b": [0.313, 0.6436, 0.3326, 0.6634]}, {"w": "have", "b": [0.3389, 0.6436, 0.3866, 0.6634]}, {"w": "the", "b": [0.3929, 0.6436, 0.4237, 0.6634]}, {"w": "books", "b": [0.43, 0.6436, 0.4903, 0.6634]}, {"w": "we", "b": [0.4966, 0.6436, 0.526, 0.6634]}, {"w": "publish", "b": [0.5323, 0.6436, 0.6066, 0.6634]}, {"w": "printed", "b": [0.6129, 0.6436, 0.6843, 0.6634]}, {"w": "on", "b": [0.6906, 0.6436, 0.7158, 0.6634]}, {"w": "acid-free", "b": [0.7221, 0.6436, 0.8118, 0.6634]}, {"w": "paper,", "b": [0.1294, 0.6641, 0.1907, 0.6839]}, {"w": "and", "b": [0.197, 0.6641, 0.2335, 0.6839]}, {"w": "we", "b": [0.2398, 0.6641, 0.2692, 0.6839]}, {"w": "exert", "b": [0.2755, 0.6641, 0.3259, 0.6839]}, {"w": "our", "b": [0.3322, 0.6641, 0.3658, 0.6839]}, {"w": "best", "b": [0.3722, 0.6641, 0.4128, 0.6839]}, {"w": "efforts", "b": [0.4191, 0.6641, 0.4845, 0.6839]}, {"w": "to", "b": [0.4908, 0.6641, 0.5104, 0.6839]}, {"w": "that", "b": [0.5167, 0.6641, 0.5545, 0.6839]}, {"w": "end.", "b": [0.5608, 0.6641, 0.6036, 0.6839]}, {"w": "Recognizing", "b": [0.6099, 0.6641, 0.7374, 0.6839]}, {"w": "also", "b": [0.7437, 0.6641, 0.7843, 0.6839]}, {"w": "our", "b": [0.7906, 0.6641, 0.8243, 0.6839]}, {"w": "responsibility", "b": [0.1294, 0.6846, 0.2668, 0.7044]}, {"w": "to", "b": [0.2731, 0.6846, 0.2927, 0.7044]}, {"w": "conserve", "b": [0.299, 0.6846, 0.3887, 0.7044]}, {"w": "the", "b": [0.395, 0.6846, 0.4258, 0.7044]}, {"w": "resources", "b": [0.4321, 0.6846, 0.5273, 0.7044]}, {"w": "of", "b": [0.5336, 0.6846, 0.5546, 0.7044]}, {"w": "our", "b": [0.5609, 0.6846, 0.5946, 0.7044]}, {"w": "planet,", "b": [0.6009, 0.6846, 0.6688, 0.7044]}, {"w": "Manning", "b": [0.6751, 0.6846, 0.7662, 0.7044]}, {"w": "books", "b": [0.7725, 0.6846, 0.8328, 0.7044]}, {"w": "are", "b": [0.8391, 0.6846, 0.8699, 0.7044]}, {"w": "printed", "b": [0.1294, 0.7051, 0.2009, 0.7249]}, {"w": "on", "b": [0.2072, 0.7051, 0.2324, 0.7249]}, {"w": "paper", "b": [0.2387, 0.7051, 0.2947, 0.7249]}, {"w": "that", "b": [0.301, 0.7051, 0.3389, 0.7249]}, {"w": "is", "b": [0.3452, 0.7051, 0.362, 0.7249]}, {"w": "at", "b": [0.3683, 0.7051, 0.3865, 0.7249]}, {"w": "least", "b": [0.3928, 0.7051, 0.4391, 0.7249]}, {"w": "15", "b": [0.4454, 0.7051, 0.4706, 0.7249]}, {"w": "percent", "b": [0.4769, 0.7051, 0.5512, 0.7249]}, {"w": "recycled", "b": [0.5575, 0.7051, 0.6429, 0.7249]}, {"w": "and", "b": [0.6492, 0.7051, 0.6856, 0.7249]}, {"w": "processed", "b": [0.6919, 0.7051, 0.7914, 0.7249]}, {"w": "without", "b": [0.1294, 0.7256, 0.2065, 0.7454]}, {"w": "the", "b": [0.2128, 0.7256, 0.2436, 0.7454]}, {"w": "use", "b": [0.2499, 0.7256, 0.2836, 0.7454]}, {"w": "of", "b": [0.2899, 0.7256, 0.3109, 0.7454]}, {"w": "elemental", "b": [0.3172, 0.7256, 0.4153, 0.7454]}, {"w": "chlorine.", "b": [0.4215, 0.7256, 0.5105, 0.7454]}]}, {"id": "b_7", "type": "paragraph", "text": "Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964", "words": [{"w": "Manning", "b": [0.3249, 0.7765, 0.3867, 0.7883]}, {"w": "Publications", "b": [0.3955, 0.7765, 0.5014, 0.7883]}, {"w": "Co.", "b": [0.5102, 0.7765, 0.5367, 0.7883]}, {"w": "20", "b": [0.3249, 0.789, 0.3426, 0.8008]}, {"w": "Baldwin", "b": [0.3514, 0.789, 0.4131, 0.8008]}, {"w": "Road", "b": [0.422, 0.789, 0.4573, 0.8008]}, {"w": "PO", "b": [0.3249, 0.8015, 0.3426, 0.8133]}, {"w": "Box", "b": [0.3514, 0.8015, 0.3778, 0.8133]}, {"w": "761", "b": [0.3867, 0.8015, 0.4131, 0.8133]}, {"w": "Shelter", "b": [0.3249, 0.814, 0.3867, 0.8258]}, {"w": "Island,", "b": [0.3955, 0.814, 0.4573, 0.8258]}, {"w": "NY", "b": [0.4661, 0.814, 0.4837, 0.8258]}, {"w": "11964", "b": [0.4925, 0.814, 0.5367, 0.8258]}]}, {"id": "b_8", "type": "paragraph", "text": "Development editor: Toni Arritola Technical development editor: Jerry Gaines Review editor: Aleksandar Dragosavljević Project editor: Tiffany Taylor", "words": [{"w": "Development", "b": [0.1357, 0.8525, 0.2606, 0.8677]}, {"w": "editor:", "b": [0.2719, 0.8525, 0.3514, 0.8677]}, {"w": "Toni", "b": [0.3628, 0.8525, 0.4082, 0.8677]}, {"w": "Arritola", "b": [0.4195, 0.8525, 0.5103, 0.8677]}, {"w": "Technical", "b": [0.1357, 0.8677, 0.2379, 0.8828]}, {"w": "development", "b": [0.2492, 0.8677, 0.3741, 0.8828]}, {"w": "editor:", "b": [0.3855, 0.8677, 0.4649, 0.8828]}, {"w": "Jerry", "b": [0.4763, 0.8677, 0.533, 0.8828]}, {"w": "Gaines", "b": [0.5444, 0.8677, 0.6125, 0.8828]}, {"w": "Review", "b": [0.1357, 0.8828, 0.2038, 0.898]}, {"w": "editor:", "b": [0.2152, 0.8828, 0.2946, 0.898]}, {"w": "Aleksandar", "b": [0.306, 0.8828, 0.4195, 0.898]}, {"w": "Dragosavljević", "b": [0.4309, 0.8828, 0.5898, 0.898]}, {"w": "Project", "b": [0.1357, 0.898, 0.2152, 0.9131]}, {"w": "editor:", "b": [0.2265, 0.898, 0.306, 0.9131]}, {"w": "Tiffany", "b": [0.3173, 0.898, 0.3968, 0.9131]}, {"w": "Taylor", "b": [0.4082, 0.898, 0.4763, 0.9131]}]}]}, {"page": 4, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Copyeditor: Tiffany Taylor Proofreader: Katie Tennant Technical proofreaders: Alex Ott and Richard Tobias Typesetter: Dottie Marsico Cover designer: Marija Tudor", "words": [{"w": "Copyeditor:", "b": [0.1357, 0.0851, 0.2606, 0.1002]}, {"w": "Tiffany", "b": [0.2719, 0.0851, 0.3514, 0.1002]}, {"w": "Taylor", "b": [0.3628, 0.0851, 0.4309, 0.1002]}, {"w": "Proofreader:", "b": [0.1357, 0.1002, 0.2719, 0.1154]}, {"w": "Katie", "b": [0.2833, 0.1002, 0.34, 0.1154]}, {"w": "Tennant", "b": [0.3514, 0.1002, 0.4309, 0.1154]}, {"w": "Technical", "b": [0.1357, 0.1154, 0.2379, 0.1305]}, {"w": "proofreaders:", "b": [0.2492, 0.1154, 0.3968, 0.1305]}, {"w": "Alex", "b": [0.4082, 0.1154, 0.4536, 0.1305]}, {"w": "Ott", "b": [0.4649, 0.1154, 0.499, 0.1305]}, {"w": "and", "b": [0.5103, 0.1154, 0.5444, 0.1305]}, {"w": "Richard", "b": [0.5557, 0.1154, 0.6352, 0.1305]}, {"w": "Tobias", "b": [0.6465, 0.1154, 0.7146, 0.1305]}, {"w": "Typesetter:", "b": [0.1357, 0.1305, 0.2606, 0.1457]}, {"w": "Dottie", "b": [0.2719, 0.1305, 0.34, 0.1457]}, {"w": "Marsico", "b": [0.3514, 0.1305, 0.4309, 0.1457]}, {"w": "Cover", "b": [0.1357, 0.1457, 0.1925, 0.1608]}, {"w": "designer:", "b": [0.2038, 0.1457, 0.306, 0.1608]}, {"w": "Marija", "b": [0.3173, 0.1457, 0.3855, 0.1608]}, {"w": "Tudor", "b": [0.3968, 0.1457, 0.4536, 0.1608]}]}, {"id": "b_1", "type": "paragraph", "text": "ISBN 9781617294433", "words": [{"w": "ISBN", "b": [0.1294, 0.1837, 0.1869, 0.2035]}, {"w": "9781617294433", "b": [0.1932, 0.1837, 0.3572, 0.2035]}]}, {"id": "b_2", "type": "paragraph", "text": "Printed in the United States of America", "words": [{"w": "Printed", "b": [0.1294, 0.2265, 0.2023, 0.2462]}, {"w": "in", "b": [0.2086, 0.2265, 0.2282, 0.2462]}, {"w": "the", "b": [0.2345, 0.2265, 0.2654, 0.2462]}, {"w": "United", "b": [0.2717, 0.2265, 0.3403, 0.2462]}, {"w": "States", "b": [0.3466, 0.2265, 0.4069, 0.2462]}, {"w": "of", "b": [0.4132, 0.2265, 0.4342, 0.2462]}, {"w": "America", "b": [0.4405, 0.2265, 0.5274, 0.2462]}]}, {"id": "b_3", "type": "paragraph", "text": "1 2 3 4 5 6 7 8 9 10 – EBM – 22 21 20 19 18 17", "words": [{"w": "1", "b": [0.1294, 0.2693, 0.142, 0.289]}, {"w": "2", "b": [0.1483, 0.2693, 0.1609, 0.289]}, {"w": "3", "b": [0.1673, 0.2693, 0.1799, 0.289]}, {"w": "4", "b": [0.1862, 0.2693, 0.1988, 0.289]}, {"w": "5", "b": [0.2051, 0.2693, 0.2177, 0.289]}, {"w": "6", "b": [0.224, 0.2693, 0.2366, 0.289]}, {"w": "7", "b": [0.2429, 0.2693, 0.2555, 0.289]}, {"w": "8", "b": [0.2618, 0.2693, 0.2745, 0.289]}, {"w": "9", "b": [0.2808, 0.2693, 0.2934, 0.289]}, {"w": "10", "b": [0.2997, 0.2693, 0.3249, 0.289]}, {"w": "–", "b": [0.3312, 0.2693, 0.3438, 0.289]}, {"w": "EBM", "b": [0.3501, 0.2693, 0.4048, 0.289]}, {"w": "–", "b": [0.4111, 0.2693, 0.4237, 0.289]}, {"w": "22", "b": [0.43, 0.2693, 0.4553, 0.289]}, {"w": "21", "b": [0.4616, 0.2693, 0.4868, 0.289]}, {"w": "20", "b": [0.4931, 0.2693, 0.5183, 0.289]}, {"w": "19", "b": [0.5246, 0.2693, 0.5498, 0.289]}, {"w": "18", "b": [0.5562, 0.2693, 0.5814, 0.289]}, {"w": "17", "b": [0.5877, 0.2693, 0.6129, 0.289]}]}]}, {"page": 5, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Brief Table of Contents", "words": [{"w": "Brief", "b": [0.1294, 0.1076, 0.2068, 0.1355]}, {"w": "Table", "b": [0.2157, 0.1076, 0.2998, 0.1355]}, {"w": "of", "b": [0.3087, 0.1076, 0.3385, 0.1355]}, {"w": "Contents", "b": [0.3474, 0.1076, 0.4844, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Copyright", "words": [{"w": "Copyright", "b": [0.1483, 0.1499, 0.2506, 0.1696]}]}, {"id": "b_2", "type": "paragraph", "text": "Brief Table of Contents", "words": [{"w": "Brief", "b": [0.1483, 0.1775, 0.2002, 0.1972]}, {"w": "Table", "b": [0.2065, 0.1775, 0.2621, 0.1972]}, {"w": "of", "b": [0.2684, 0.1775, 0.2895, 0.1972]}, {"w": "Contents", "b": [0.2958, 0.1775, 0.3855, 0.1972]}]}, {"id": "b_3", "type": "paragraph", "text": "Table of Contents", "words": [{"w": "Table", "b": [0.1483, 0.2051, 0.204, 0.2249]}, {"w": "of", "b": [0.2103, 0.2051, 0.2313, 0.2249]}, {"w": "Contents", "b": [0.2376, 0.2051, 0.3273, 0.2249]}]}, {"id": "b_4", "type": "paragraph", "text": "Preface", "words": [{"w": "Preface", "b": [0.1483, 0.2327, 0.224, 0.2525]}]}, {"id": "b_5", "type": "paragraph", "text": "Acknowledgments", "words": [{"w": "Acknowledgments", "b": [0.1483, 0.2604, 0.3375, 0.2801]}]}, {"id": "b_6", "type": "paragraph", "text": "About this Book", "words": [{"w": "About", "b": [0.1483, 0.288, 0.2114, 0.3077]}, {"w": "this", "b": [0.2177, 0.288, 0.2542, 0.3077]}, {"w": "Book", "b": [0.2605, 0.288, 0.3151, 0.3077]}]}, {"id": "b_7", "type": "paragraph", "text": "About the Author", "words": [{"w": "About", "b": [0.1483, 0.3156, 0.2114, 0.3354]}, {"w": "the", "b": [0.2177, 0.3156, 0.2485, 0.3354]}, {"w": "Author", "b": [0.2548, 0.3156, 0.3263, 0.3354]}]}, {"id": "b_8", "type": "paragraph", "text": "About the Cover", "words": [{"w": "About", "b": [0.1483, 0.3433, 0.2114, 0.363]}, {"w": "the", "b": [0.2177, 0.3433, 0.2485, 0.363]}, {"w": "Cover", "b": [0.2548, 0.3433, 0.3165, 0.363]}]}, {"id": "b_9", "type": "paragraph", "text": "1. Fundamentals of deep learning Chapter 1. What is deep learning?", "words": [{"w": "1.", "b": [0.1483, 0.3816, 0.1673, 0.4013]}, {"w": "Fundamentals", "b": [0.1736, 0.3816, 0.3151, 0.4013]}, {"w": "of", "b": [0.3214, 0.3816, 0.3424, 0.4013]}, {"w": "deep", "b": [0.3487, 0.3816, 0.3964, 0.4013]}, {"w": "learning", "b": [0.4027, 0.3816, 0.4853, 0.4013]}, {"w": "Chapter", "b": [0.1673, 0.4155, 0.2471, 0.4352]}, {"w": "1.", "b": [0.2534, 0.4155, 0.2723, 0.4352]}, {"w": "What", "b": [0.2786, 0.4155, 0.3333, 0.4352]}, {"w": "is", "b": [0.3396, 0.4155, 0.3564, 0.4352]}, {"w": "deep", "b": [0.3627, 0.4155, 0.4104, 0.4352]}, {"w": "learning?", "b": [0.4167, 0.4155, 0.5105, 0.4352]}]}, {"id": "b_10", "type": "paragraph", "text": "Chapter 2. Before we begin: the mathematical building blocks of neural networks", "words": [{"w": "Chapter", "b": [0.1673, 0.4431, 0.2471, 0.4628]}, {"w": "2.", "b": [0.2534, 0.4431, 0.2723, 0.4628]}, {"w": "Before", "b": [0.2786, 0.4431, 0.3473, 0.4628]}, {"w": "we", "b": [0.3536, 0.4431, 0.383, 0.4628]}, {"w": "begin:", "b": [0.3893, 0.4431, 0.4524, 0.4628]}, {"w": "the", "b": [0.4587, 0.4431, 0.4895, 0.4628]}, {"w": "mathematical", "b": [0.4958, 0.4431, 0.6317, 0.4628]}, {"w": "building", "b": [0.638, 0.4431, 0.7221, 0.4628]}, {"w": "blocks", "b": [0.7284, 0.4431, 0.7943, 0.4628]}, {"w": "of", "b": [0.1673, 0.4636, 0.1883, 0.4833]}, {"w": "neural", "b": [0.1946, 0.4636, 0.2576, 0.4833]}, {"w": "networks", "b": [0.2639, 0.4636, 0.3564, 0.4833]}]}, {"id": "b_11", "type": "paragraph", "text": "Chapter 3. Getting started with neural networks", "words": [{"w": "Chapter", "b": [0.1673, 0.4912, 0.2471, 0.511]}, {"w": "3.", "b": [0.2534, 0.4912, 0.2723, 0.511]}, {"w": "Getting", "b": [0.2786, 0.4912, 0.3543, 0.511]}, {"w": "started", "b": [0.3606, 0.4912, 0.4279, 0.511]}, {"w": "with", "b": [0.4342, 0.4912, 0.479, 0.511]}, {"w": "neural", "b": [0.4853, 0.4912, 0.5484, 0.511]}, {"w": "networks", "b": [0.5547, 0.4912, 0.6472, 0.511]}]}, {"id": "b_12", "type": "paragraph", "text": "Chapter 4. Fundamentals of machine learning", "words": [{"w": "Chapter", "b": [0.1673, 0.5189, 0.2471, 0.5386]}, {"w": "4.", "b": [0.2534, 0.5189, 0.2723, 0.5386]}, {"w": "Fundamentals", "b": [0.2786, 0.5189, 0.4202, 0.5386]}, {"w": "of", "b": [0.4265, 0.5189, 0.4475, 0.5386]}, {"w": "machine", "b": [0.4538, 0.5189, 0.5393, 0.5386]}, {"w": "learning", "b": [0.5456, 0.5189, 0.6283, 0.5386]}]}, {"id": "b_13", "type": "paragraph", "text": "2. Deep learning in practice Chapter 5. Deep learning for computer vision", "words": [{"w": "2.", "b": [0.1483, 0.5572, 0.1673, 0.5769]}, {"w": "Deep", "b": [0.1736, 0.5572, 0.2268, 0.5769]}, {"w": "learning", "b": [0.2331, 0.5572, 0.3158, 0.5769]}, {"w": "in", "b": [0.3221, 0.5572, 0.3417, 0.5769]}, {"w": "practice", "b": [0.348, 0.5572, 0.4278, 0.5769]}, {"w": "Chapter", "b": [0.1673, 0.5911, 0.2471, 0.6108]}, {"w": "5.", "b": [0.2534, 0.5911, 0.2723, 0.6108]}, {"w": "Deep", "b": [0.2786, 0.5911, 0.3319, 0.6108]}, {"w": "learning", "b": [0.3382, 0.5911, 0.4208, 0.6108]}, {"w": "for", "b": [0.4272, 0.5911, 0.4566, 0.6108]}, {"w": "computer", "b": [0.4629, 0.5911, 0.5581, 0.6108]}, {"w": "vision", "b": [0.5645, 0.5911, 0.6261, 0.6108]}]}, {"id": "b_14", "type": "paragraph", "text": "Chapter 6. Deep learning for text and sequences", "words": [{"w": "Chapter", "b": [0.1673, 0.6187, 0.2471, 0.6384]}, {"w": "6.", "b": [0.2534, 0.6187, 0.2723, 0.6384]}, {"w": "Deep", "b": [0.2786, 0.6187, 0.3319, 0.6384]}, {"w": "learning", "b": [0.3382, 0.6187, 0.4208, 0.6384]}, {"w": "for", "b": [0.4272, 0.6187, 0.4566, 0.6384]}, {"w": "text", "b": [0.4629, 0.6187, 0.5007, 0.6384]}, {"w": "and", "b": [0.507, 0.6187, 0.5434, 0.6384]}, {"w": "sequences", "b": [0.5497, 0.6187, 0.652, 0.6384]}]}, {"id": "b_15", "type": "equation", "text": "Chapter 7. Advanced deep-learning best practices", "words": [{"w": "Chapter", "b": [0.1673, 0.6463, 0.2471, 0.6661]}, {"w": "7.", "b": [0.2534, 0.6463, 0.2723, 0.6661]}, {"w": "Advanced", "b": [0.2786, 0.6463, 0.3809, 0.6661]}, {"w": "deep-learning", "b": [0.3872, 0.6463, 0.5259, 0.6661]}, {"w": "best", "b": [0.5322, 0.6463, 0.5729, 0.6661]}, {"w": "practices", "b": [0.5792, 0.6463, 0.6688, 0.6661]}]}, {"id": "b_16", "type": "paragraph", "text": "Chapter 8. Generative deep learning", "words": [{"w": "Chapter", "b": [0.1673, 0.6739, 0.2471, 0.6937]}, {"w": "8.", "b": [0.2534, 0.6739, 0.2723, 0.6937]}, {"w": "Generative", "b": [0.2786, 0.6739, 0.3893, 0.6937]}, {"w": "deep", "b": [0.3956, 0.6739, 0.4432, 0.6937]}, {"w": "learning", "b": [0.4496, 0.6739, 0.5322, 0.6937]}]}, {"id": "b_17", "type": "paragraph", "text": "Chapter 9. Conclusions", "words": [{"w": "Chapter", "b": [0.1673, 0.7016, 0.2471, 0.7213]}, {"w": "9.", "b": [0.2534, 0.7016, 0.2723, 0.7213]}, {"w": "Conclusions", "b": [0.2786, 0.7016, 0.4034, 0.7213]}]}, {"id": "b_18", "type": "paragraph", "text": "Appendix A. Installing Keras and its dependencies on Ubuntu", "words": [{"w": "Appendix", "b": [0.1483, 0.7399, 0.2478, 0.7596]}, {"w": "A.", "b": [0.2541, 0.7399, 0.2786, 0.7596]}, {"w": "Installing", "b": [0.285, 0.7399, 0.3803, 0.7596]}, {"w": "Keras", "b": [0.3866, 0.7399, 0.4454, 0.7596]}, {"w": "and", "b": [0.4517, 0.7399, 0.4881, 0.7596]}, {"w": "its", "b": [0.4944, 0.7399, 0.5183, 0.7596]}, {"w": "dependencies", "b": [0.5246, 0.7399, 0.6605, 0.7596]}, {"w": "on", "b": [0.6668, 0.7399, 0.692, 0.7596]}, {"w": "Ubuntu", "b": [0.6983, 0.7399, 0.774, 0.7596]}]}, {"id": "b_19", "type": "paragraph", "text": "Appendix B. Running Jupyter notebooks on an EC2 GPU instance", "words": [{"w": "Appendix", "b": [0.1483, 0.7675, 0.2478, 0.7873]}, {"w": "B.", "b": [0.2541, 0.7675, 0.2773, 0.7873]}, {"w": "Running", "b": [0.2836, 0.7675, 0.3705, 0.7873]}, {"w": "Jupyter", "b": [0.3768, 0.7675, 0.451, 0.7873]}, {"w": "notebooks", "b": [0.4573, 0.7675, 0.561, 0.7873]}, {"w": "on", "b": [0.5674, 0.7675, 0.5926, 0.7873]}, {"w": "an", "b": [0.5989, 0.7675, 0.6227, 0.7873]}, {"w": "EC2", "b": [0.629, 0.7675, 0.6739, 0.7873]}, {"w": "GPU", "b": [0.6802, 0.7675, 0.7306, 0.7873]}, {"w": "instance", "b": [0.7369, 0.7675, 0.8196, 0.7873]}]}, {"id": "b_20", "type": "paragraph", "text": "Index", "words": [{"w": "Index", "b": [0.1546, 0.8059, 0.2121, 0.8256]}]}, {"id": "b_21", "type": "paragraph", "text": "List of Figures", "words": [{"w": "List", "b": [0.1546, 0.8442, 0.1939, 0.8639]}, {"w": "of", "b": [0.2002, 0.8442, 0.2212, 0.8639]}, {"w": "Figures", "b": [0.2275, 0.8442, 0.3032, 0.8639]}]}, {"id": "b_22", "type": "paragraph", "text": "List of Tables", "words": [{"w": "List", "b": [0.1546, 0.8825, 0.1939, 0.9023]}, {"w": "of", "b": [0.2002, 0.8825, 0.2212, 0.9023]}, {"w": "Tables", "b": [0.2275, 0.8825, 0.293, 0.9023]}]}]}, {"page": 6, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "List of Listings", "words": [{"w": "List", "b": [0.1546, 0.0857, 0.1939, 0.1054]}, {"w": "of", "b": [0.2002, 0.0857, 0.2212, 0.1054]}, {"w": "Listings", "b": [0.2275, 0.0857, 0.3088, 0.1054]}]}]}, {"page": 7, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Table of Contents", "words": [{"w": "Table", "b": [0.1294, 0.1076, 0.2135, 0.1355]}, {"w": "of", "b": [0.2224, 0.1076, 0.2522, 0.1355]}, {"w": "Contents", "b": [0.2611, 0.1076, 0.3981, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Copyright", "words": [{"w": "Copyright", "b": [0.1483, 0.1499, 0.2506, 0.1696]}]}, {"id": "b_2", "type": "paragraph", "text": "Brief Table of Contents", "words": [{"w": "Brief", "b": [0.1483, 0.1775, 0.2002, 0.1972]}, {"w": "Table", "b": [0.2065, 0.1775, 0.2621, 0.1972]}, {"w": "of", "b": [0.2684, 0.1775, 0.2895, 0.1972]}, {"w": "Contents", "b": [0.2958, 0.1775, 0.3855, 0.1972]}]}, {"id": "b_3", "type": "paragraph", "text": "Table of Contents", "words": [{"w": "Table", "b": [0.1483, 0.2051, 0.204, 0.2249]}, {"w": "of", "b": [0.2103, 0.2051, 0.2313, 0.2249]}, {"w": "Contents", "b": [0.2376, 0.2051, 0.3273, 0.2249]}]}, {"id": "b_4", "type": "paragraph", "text": "Preface", "words": [{"w": "Preface", "b": [0.1483, 0.2327, 0.224, 0.2525]}]}, {"id": "b_5", "type": "paragraph", "text": "Acknowledgments", "words": [{"w": "Acknowledgments", "b": [0.1483, 0.2604, 0.3375, 0.2801]}]}, {"id": "b_6", "type": "paragraph", "text": "About this Book", "words": [{"w": "About", "b": [0.1483, 0.288, 0.2114, 0.3077]}, {"w": "this", "b": [0.2177, 0.288, 0.2542, 0.3077]}, {"w": "Book", "b": [0.2605, 0.288, 0.3151, 0.3077]}]}, {"id": "b_7", "type": "paragraph", "text": "About the Author", "words": [{"w": "About", "b": [0.1483, 0.3156, 0.2114, 0.3354]}, {"w": "the", "b": [0.2177, 0.3156, 0.2485, 0.3354]}, {"w": "Author", "b": [0.2548, 0.3156, 0.3263, 0.3354]}]}, {"id": "b_8", "type": "paragraph", "text": "About the Cover", "words": [{"w": "About", "b": [0.1483, 0.3433, 0.2114, 0.363]}, {"w": "the", "b": [0.2177, 0.3433, 0.2485, 0.363]}, {"w": "Cover", "b": [0.2548, 0.3433, 0.3165, 0.363]}]}, {"id": "b_9", "type": "paragraph", "text": "1. Fundamentals of deep learning Chapter 1. What is deep learning?", "words": [{"w": "1.", "b": [0.1483, 0.3816, 0.1673, 0.4013]}, {"w": "Fundamentals", "b": [0.1736, 0.3816, 0.3151, 0.4013]}, {"w": "of", "b": [0.3214, 0.3816, 0.3424, 0.4013]}, {"w": "deep", "b": [0.3487, 0.3816, 0.3964, 0.4013]}, {"w": "learning", "b": [0.4027, 0.3816, 0.4853, 0.4013]}, {"w": "Chapter", "b": [0.1673, 0.4155, 0.2471, 0.4352]}, {"w": "1.", "b": [0.2534, 0.4155, 0.2723, 0.4352]}, {"w": "What", "b": [0.2786, 0.4155, 0.3333, 0.4352]}, {"w": "is", "b": [0.3396, 0.4155, 0.3564, 0.4352]}, {"w": "deep", "b": [0.3627, 0.4155, 0.4104, 0.4352]}, {"w": "learning?", "b": [0.4167, 0.4155, 0.5105, 0.4352]}]}, {"id": "b_10", "type": "paragraph", "text": "1.1. Artificial intelligence, machine learning, and deep learning", "words": [{"w": "1.1.", "b": [0.1862, 0.4493, 0.224, 0.4691]}, {"w": "Artificial", "b": [0.2303, 0.4493, 0.3228, 0.4691]}, {"w": "intelligence,", "b": [0.3291, 0.4493, 0.4531, 0.4691]}, {"w": "machine", "b": [0.4594, 0.4493, 0.5449, 0.4691]}, {"w": "learning,", "b": [0.5512, 0.4493, 0.6402, 0.4691]}, {"w": "and", "b": [0.6465, 0.4493, 0.6829, 0.4691]}, {"w": "deep", "b": [0.6892, 0.4493, 0.7368, 0.4691]}, {"w": "learning", "b": [0.1862, 0.4698, 0.2688, 0.4896]}]}, {"id": "b_11", "type": "paragraph", "text": "1.1.1. Artificial intelligence 1.1.2. Machine learning 1.1.3. Learning representations from data 1.1.4. The “deep” in deep learning 1.1.5. Understanding how deep learning works, in three figures", "words": [{"w": "1.1.1.", "b": [0.2051, 0.5037, 0.2618, 0.5234]}, {"w": "Artificial", "b": [0.2682, 0.5037, 0.3606, 0.5234]}, {"w": "intelligence", "b": [0.3669, 0.5037, 0.4846, 0.5234]}, {"w": "1.1.2.", "b": [0.2051, 0.5313, 0.2618, 0.5511]}, {"w": "Machine", "b": [0.2682, 0.5313, 0.3564, 0.5511]}, {"w": "learning", "b": [0.3627, 0.5313, 0.4454, 0.5511]}, {"w": "1.1.3.", "b": [0.2051, 0.559, 0.2618, 0.5787]}, {"w": "Learning", "b": [0.2682, 0.559, 0.3592, 0.5787]}, {"w": "representations", "b": [0.3655, 0.559, 0.5182, 0.5787]}, {"w": "from", "b": [0.5245, 0.559, 0.5736, 0.5787]}, {"w": "data", "b": [0.5799, 0.559, 0.6219, 0.5787]}, {"w": "1.1.4.", "b": [0.2051, 0.5866, 0.2618, 0.6063]}, {"w": "The", "b": [0.2682, 0.5866, 0.3074, 0.6063]}, {"w": "“deep”", "b": [0.3137, 0.5866, 0.3837, 0.6063]}, {"w": "in", "b": [0.39, 0.5866, 0.4096, 0.6063]}, {"w": "deep", "b": [0.416, 0.5866, 0.4636, 0.6063]}, {"w": "learning", "b": [0.4699, 0.5866, 0.5525, 0.6063]}, {"w": "1.1.5.", "b": [0.2051, 0.6142, 0.2618, 0.634]}, {"w": "Understanding", "b": [0.2682, 0.6142, 0.4167, 0.634]}, {"w": "how", "b": [0.423, 0.6142, 0.4664, 0.634]}, {"w": "deep", "b": [0.4727, 0.6142, 0.5204, 0.634]}, {"w": "learning", "b": [0.5267, 0.6142, 0.6093, 0.634]}, {"w": "works,", "b": [0.6156, 0.6142, 0.6836, 0.634]}, {"w": "in", "b": [0.6899, 0.6142, 0.7095, 0.634]}, {"w": "three", "b": [0.7158, 0.6142, 0.7663, 0.634]}, {"w": "figures", "b": [0.2051, 0.6347, 0.2751, 0.6545]}]}, {"id": "b_12", "type": "paragraph", "text": "1.1.6. What deep learning has achieved so far 1.1.7. Don’t believe the short-term hype 1.1.8. The promise of AI 1.2. Before deep learning: a brief history of machine learning", "words": [{"w": "1.1.6.", "b": [0.2051, 0.6624, 0.2618, 0.6821]}, {"w": "What", "b": [0.2682, 0.6624, 0.3228, 0.6821]}, {"w": "deep", "b": [0.3291, 0.6624, 0.3767, 0.6821]}, {"w": "learning", "b": [0.383, 0.6624, 0.4657, 0.6821]}, {"w": "has", "b": [0.472, 0.6624, 0.5056, 0.6821]}, {"w": "achieved", "b": [0.5119, 0.6624, 0.6016, 0.6821]}, {"w": "so", "b": [0.6079, 0.6624, 0.6303, 0.6821]}, {"w": "far", "b": [0.6366, 0.6624, 0.6646, 0.6821]}, {"w": "1.1.7.", "b": [0.2051, 0.69, 0.2618, 0.7097]}, {"w": "Don’t", "b": [0.2682, 0.69, 0.3266, 0.7097]}, {"w": "believe", "b": [0.3329, 0.69, 0.4057, 0.7097]}, {"w": "the", "b": [0.412, 0.69, 0.4428, 0.7097]}, {"w": "short-term", "b": [0.4492, 0.69, 0.5542, 0.7097]}, {"w": "hype", "b": [0.5605, 0.69, 0.6096, 0.7097]}, {"w": "1.1.8.", "b": [0.2051, 0.7176, 0.2618, 0.7374]}, {"w": "The", "b": [0.2682, 0.7176, 0.3074, 0.7374]}, {"w": "promise", "b": [0.3137, 0.7176, 0.395, 0.7374]}, {"w": "of", "b": [0.4013, 0.7176, 0.4223, 0.7374]}, {"w": "AI", "b": [0.4286, 0.7176, 0.4552, 0.7374]}, {"w": "1.2.", "b": [0.1862, 0.7559, 0.224, 0.7757]}, {"w": "Before", "b": [0.2303, 0.7559, 0.299, 0.7757]}, {"w": "deep", "b": [0.3053, 0.7559, 0.3529, 0.7757]}, {"w": "learning:", "b": [0.3592, 0.7559, 0.4489, 0.7757]}, {"w": "a", "b": [0.4552, 0.7559, 0.4664, 0.7757]}, {"w": "brief", "b": [0.4727, 0.7559, 0.5203, 0.7757]}, {"w": "history", "b": [0.5266, 0.7559, 0.5967, 0.7757]}, {"w": "of", "b": [0.603, 0.7559, 0.624, 0.7757]}, {"w": "machine", "b": [0.6303, 0.7559, 0.7158, 0.7757]}, {"w": "learning", "b": [0.1862, 0.7764, 0.2688, 0.7962]}]}, {"id": "b_13", "type": "paragraph", "text": "1.2.1. Probabilistic modeling 1.2.2. Early neural networks 1.2.3. Kernel methods", "words": [{"w": "1.2.1.", "b": [0.2051, 0.8103, 0.2618, 0.8301]}, {"w": "Probabilistic", "b": [0.2682, 0.8103, 0.3957, 0.8301]}, {"w": "modeling", "b": [0.402, 0.8103, 0.4973, 0.8301]}, {"w": "1.2.2.", "b": [0.2051, 0.8379, 0.2618, 0.8577]}, {"w": "Early", "b": [0.2682, 0.8379, 0.3228, 0.8577]}, {"w": "neural", "b": [0.3291, 0.8379, 0.3921, 0.8577]}, {"w": "networks", "b": [0.3984, 0.8379, 0.4909, 0.8577]}, {"w": "1.2.3.", "b": [0.2051, 0.8656, 0.2618, 0.8853]}, {"w": "Kernel", "b": [0.2682, 0.8656, 0.3368, 0.8853]}, {"w": "methods", "b": [0.3431, 0.8656, 0.4286, 0.8853]}]}]}, {"page": 8, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1.2.4. Decision trees, random forests, and gradient boosting machines", "words": [{"w": "1.2.4.", "b": [0.2051, 0.0857, 0.2618, 0.1054]}, {"w": "Decision", "b": [0.2682, 0.0857, 0.3578, 0.1054]}, {"w": "trees,", "b": [0.3641, 0.0857, 0.4181, 0.1054]}, {"w": "random", "b": [0.4244, 0.0857, 0.5014, 0.1054]}, {"w": "forests,", "b": [0.5077, 0.0857, 0.5813, 0.1054]}, {"w": "and", "b": [0.5876, 0.0857, 0.624, 0.1054]}, {"w": "gradient", "b": [0.6303, 0.0857, 0.713, 0.1054]}, {"w": "boosting", "b": [0.2051, 0.1062, 0.292, 0.1259]}, {"w": "machines", "b": [0.2983, 0.1062, 0.3936, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "1.2.5. Back to neural networks 1.2.6. What makes deep learning different 1.2.7. The modern machine-learning landscape 1.3. Why deep learning? Why now? 1.3.1. Hardware 1.3.2. Data 1.3.3. Algorithms 1.3.4. A new wave of investment 1.3.5. The democratization of deep learning 1.3.6. Will it last? Chapter 2. Before we begin: the mathematical building blocks of neural networks", "words": [{"w": "1.2.5.", "b": [0.2051, 0.1338, 0.2618, 0.1535]}, {"w": "Back", "b": [0.2682, 0.1338, 0.32, 0.1535]}, {"w": "to", "b": [0.3263, 0.1338, 0.3459, 0.1535]}, {"w": "neural", "b": [0.3522, 0.1338, 0.4153, 0.1535]}, {"w": "networks", "b": [0.4216, 0.1338, 0.5141, 0.1535]}, {"w": "1.2.6.", "b": [0.2051, 0.1614, 0.2618, 0.1812]}, {"w": "What", "b": [0.2682, 0.1614, 0.3228, 0.1812]}, {"w": "makes", "b": [0.3291, 0.1614, 0.3936, 0.1812]}, {"w": "deep", "b": [0.3999, 0.1614, 0.4475, 0.1812]}, {"w": "learning", "b": [0.4538, 0.1614, 0.5365, 0.1812]}, {"w": "different", "b": [0.5428, 0.1614, 0.6291, 0.1812]}, {"w": "1.2.7.", "b": [0.2051, 0.1891, 0.2618, 0.2088]}, {"w": "The", "b": [0.2682, 0.1891, 0.3074, 0.2088]}, {"w": "modern", "b": [0.3137, 0.1891, 0.3908, 0.2088]}, {"w": "machine-learning", "b": [0.3971, 0.1891, 0.5736, 0.2088]}, {"w": "landscape", "b": [0.5799, 0.1891, 0.6794, 0.2088]}, {"w": "1.3.", "b": [0.1862, 0.2274, 0.224, 0.2471]}, {"w": "Why", "b": [0.2303, 0.2274, 0.2794, 0.2471]}, {"w": "deep", "b": [0.2857, 0.2274, 0.3333, 0.2471]}, {"w": "learning?", "b": [0.3396, 0.2274, 0.4335, 0.2471]}, {"w": "Why", "b": [0.4398, 0.2274, 0.4888, 0.2471]}, {"w": "now?", "b": [0.4951, 0.2274, 0.5497, 0.2471]}, {"w": "1.3.1.", "b": [0.2051, 0.2613, 0.2618, 0.281]}, {"w": "Hardware", "b": [0.2682, 0.2613, 0.3676, 0.281]}, {"w": "1.3.2.", "b": [0.2051, 0.2889, 0.2618, 0.3086]}, {"w": "Data", "b": [0.2682, 0.2889, 0.3158, 0.3086]}, {"w": "1.3.3.", "b": [0.2051, 0.3165, 0.2618, 0.3363]}, {"w": "Algorithms", "b": [0.2682, 0.3165, 0.3831, 0.3363]}, {"w": "1.3.4.", "b": [0.2051, 0.3442, 0.2618, 0.3639]}, {"w": "A", "b": [0.2682, 0.3442, 0.2864, 0.3639]}, {"w": "new", "b": [0.2927, 0.3442, 0.3347, 0.3639]}, {"w": "wave", "b": [0.341, 0.3442, 0.3942, 0.3639]}, {"w": "of", "b": [0.4005, 0.3442, 0.4216, 0.3639]}, {"w": "investment", "b": [0.4279, 0.3442, 0.5386, 0.3639]}, {"w": "1.3.5.", "b": [0.2051, 0.3718, 0.2618, 0.3915]}, {"w": "The", "b": [0.2682, 0.3718, 0.3074, 0.3915]}, {"w": "democratization", "b": [0.3137, 0.3718, 0.4762, 0.3915]}, {"w": "of", "b": [0.4825, 0.3718, 0.5035, 0.3915]}, {"w": "deep", "b": [0.5098, 0.3718, 0.5575, 0.3915]}, {"w": "learning", "b": [0.5638, 0.3718, 0.6464, 0.3915]}, {"w": "1.3.6.", "b": [0.2051, 0.3994, 0.2618, 0.4192]}, {"w": "Will", "b": [0.2682, 0.3994, 0.312, 0.4192]}, {"w": "it", "b": [0.3183, 0.3994, 0.3323, 0.4192]}, {"w": "last?", "b": [0.3386, 0.3994, 0.3849, 0.4192]}, {"w": "Chapter", "b": [0.1673, 0.4377, 0.2471, 0.4575]}, {"w": "2.", "b": [0.2534, 0.4377, 0.2723, 0.4575]}, {"w": "Before", "b": [0.2786, 0.4377, 0.3473, 0.4575]}, {"w": "we", "b": [0.3536, 0.4377, 0.383, 0.4575]}, {"w": "begin:", "b": [0.3893, 0.4377, 0.4524, 0.4575]}, {"w": "the", "b": [0.4587, 0.4377, 0.4895, 0.4575]}, {"w": "mathematical", "b": [0.4958, 0.4377, 0.6317, 0.4575]}, {"w": "building", "b": [0.638, 0.4377, 0.7221, 0.4575]}, {"w": "blocks", "b": [0.7284, 0.4377, 0.7943, 0.4575]}, {"w": "of", "b": [0.1673, 0.4582, 0.1883, 0.478]}, {"w": "neural", "b": [0.1946, 0.4582, 0.2576, 0.478]}, {"w": "networks", "b": [0.2639, 0.4582, 0.3564, 0.478]}]}, {"id": "b_2", "type": "paragraph", "text": "2.1. A first look at a neural network 2.2. Data representations for neural networks 2.2.1. Scalars (0D tensors) 2.2.2. Vectors (1D tensors) 2.2.3. Matrices (2D tensors) 2.2.4. 3D tensors and higher-dimensional tensors 2.2.5. Key attributes 2.2.6. Manipulating tensors in Numpy 2.2.7. The notion of data batches 2.2.8. Real-world examples of data tensors 2.2.9. Vector data 2.2.10. Timeseries data or sequence data 2.2.11. Image data 2.2.12. Video data", "words": [{"w": "2.1.", "b": [0.1862, 0.4921, 0.224, 0.5119]}, {"w": "A", "b": [0.2303, 0.4921, 0.2485, 0.5119]}, {"w": "first", "b": [0.2548, 0.4921, 0.2955, 0.5119]}, {"w": "look", "b": [0.3018, 0.4921, 0.3466, 0.5119]}, {"w": "at", "b": [0.3529, 0.4921, 0.3712, 0.5119]}, {"w": "a", "b": [0.3775, 0.4921, 0.3887, 0.5119]}, {"w": "neural", "b": [0.395, 0.4921, 0.458, 0.5119]}, {"w": "network", "b": [0.4643, 0.4921, 0.547, 0.5119]}, {"w": "2.2.", "b": [0.1862, 0.5197, 0.224, 0.5395]}, {"w": "Data", "b": [0.2303, 0.5197, 0.2779, 0.5395]}, {"w": "representations", "b": [0.2842, 0.5197, 0.437, 0.5395]}, {"w": "for", "b": [0.4433, 0.5197, 0.4727, 0.5395]}, {"w": "neural", "b": [0.479, 0.5197, 0.542, 0.5395]}, {"w": "networks", "b": [0.5483, 0.5197, 0.6408, 0.5395]}, {"w": "2.2.1.", "b": [0.2051, 0.5536, 0.2618, 0.5734]}, {"w": "Scalars", "b": [0.2682, 0.5536, 0.341, 0.5734]}, {"w": "(0D", "b": [0.3473, 0.5536, 0.3865, 0.5734]}, {"w": "tensors)", "b": [0.3928, 0.5536, 0.4727, 0.5734]}, {"w": "2.2.2.", "b": [0.2051, 0.5812, 0.2618, 0.601]}, {"w": "Vectors", "b": [0.2682, 0.5812, 0.3438, 0.601]}, {"w": "(1D", "b": [0.3501, 0.5812, 0.3893, 0.601]}, {"w": "tensors)", "b": [0.3957, 0.5812, 0.4755, 0.601]}, {"w": "2.2.3.", "b": [0.2051, 0.6089, 0.2618, 0.6286]}, {"w": "Matrices", "b": [0.2682, 0.6089, 0.3564, 0.6286]}, {"w": "(2D", "b": [0.3627, 0.6089, 0.402, 0.6286]}, {"w": "tensors)", "b": [0.4083, 0.6089, 0.4881, 0.6286]}, {"w": "2.2.4.", "b": [0.2051, 0.6365, 0.2618, 0.6563]}, {"w": "3D", "b": [0.2682, 0.6365, 0.299, 0.6563]}, {"w": "tensors", "b": [0.3053, 0.6365, 0.3768, 0.6563]}, {"w": "and", "b": [0.3831, 0.6365, 0.4195, 0.6563]}, {"w": "higher-dimensional", "b": [0.4258, 0.6365, 0.6215, 0.6563]}, {"w": "tensors", "b": [0.6278, 0.6365, 0.6992, 0.6563]}, {"w": "2.2.5.", "b": [0.2051, 0.6641, 0.2618, 0.6839]}, {"w": "Key", "b": [0.2682, 0.6641, 0.3102, 0.6839]}, {"w": "attributes", "b": [0.3165, 0.6641, 0.4104, 0.6839]}, {"w": "2.2.6.", "b": [0.2051, 0.6918, 0.2618, 0.7115]}, {"w": "Manipulating", "b": [0.2682, 0.6918, 0.4041, 0.7115]}, {"w": "tensors", "b": [0.4104, 0.6918, 0.4819, 0.7115]}, {"w": "in", "b": [0.4882, 0.6918, 0.5078, 0.7115]}, {"w": "Numpy", "b": [0.5141, 0.6918, 0.5898, 0.7115]}, {"w": "2.2.7.", "b": [0.2051, 0.7194, 0.2618, 0.7391]}, {"w": "The", "b": [0.2682, 0.7194, 0.3074, 0.7391]}, {"w": "notion", "b": [0.3137, 0.7194, 0.3782, 0.7391]}, {"w": "of", "b": [0.3845, 0.7194, 0.4055, 0.7391]}, {"w": "data", "b": [0.4118, 0.7194, 0.4538, 0.7391]}, {"w": "batches", "b": [0.4601, 0.7194, 0.5358, 0.7391]}, {"w": "2.2.8.", "b": [0.2051, 0.747, 0.2618, 0.7668]}, {"w": "Real-world", "b": [0.2682, 0.747, 0.3816, 0.7668]}, {"w": "examples", "b": [0.388, 0.747, 0.4832, 0.7668]}, {"w": "of", "b": [0.4895, 0.747, 0.5105, 0.7668]}, {"w": "data", "b": [0.5169, 0.747, 0.5589, 0.7668]}, {"w": "tensors", "b": [0.5652, 0.747, 0.6367, 0.7668]}, {"w": "2.2.9.", "b": [0.2051, 0.7747, 0.2618, 0.7944]}, {"w": "Vector", "b": [0.2682, 0.7747, 0.334, 0.7944]}, {"w": "data", "b": [0.3403, 0.7747, 0.3823, 0.7944]}, {"w": "2.2.10.", "b": [0.2051, 0.8023, 0.2745, 0.822]}, {"w": "Timeseries", "b": [0.2808, 0.8023, 0.3906, 0.822]}, {"w": "data", "b": [0.3969, 0.8023, 0.4389, 0.822]}, {"w": "or", "b": [0.4452, 0.8023, 0.4662, 0.822]}, {"w": "sequence", "b": [0.4725, 0.8023, 0.565, 0.822]}, {"w": "data", "b": [0.5713, 0.8023, 0.6133, 0.822]}, {"w": "2.2.11.", "b": [0.2051, 0.8299, 0.2735, 0.8497]}, {"w": "Image", "b": [0.2798, 0.8299, 0.3429, 0.8497]}, {"w": "data", "b": [0.3492, 0.8299, 0.3912, 0.8497]}, {"w": "2.2.12.", "b": [0.2051, 0.8576, 0.2745, 0.8773]}, {"w": "Video", "b": [0.2808, 0.8576, 0.3409, 0.8773]}, {"w": "data", "b": [0.3472, 0.8576, 0.3892, 0.8773]}]}]}, {"page": 9, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2.3. The gears of neural networks: tensor operations 2.3.1. Element-wise operations 2.3.2. Broadcasting 2.3.3. Tensor dot 2.3.4. Tensor reshaping 2.3.5. Geometric interpretation of tensor operations 2.3.6. A geometric interpretation of deep learning 2.4. The engine of neural networks: gradient-based optimization", "words": [{"w": "2.3.", "b": [0.1862, 0.0857, 0.224, 0.1054]}, {"w": "The", "b": [0.2303, 0.0857, 0.2695, 0.1054]}, {"w": "gears", "b": [0.2758, 0.0857, 0.3291, 0.1054]}, {"w": "of", "b": [0.3354, 0.0857, 0.3564, 0.1054]}, {"w": "neural", "b": [0.3627, 0.0857, 0.4257, 0.1054]}, {"w": "networks:", "b": [0.432, 0.0857, 0.5315, 0.1054]}, {"w": "tensor", "b": [0.5378, 0.0857, 0.5995, 0.1054]}, {"w": "operations", "b": [0.6058, 0.0857, 0.7109, 0.1054]}, {"w": "2.3.1.", "b": [0.2051, 0.1195, 0.2618, 0.1393]}, {"w": "Element-wise", "b": [0.2682, 0.1195, 0.4069, 0.1393]}, {"w": "operations", "b": [0.4132, 0.1195, 0.5183, 0.1393]}, {"w": "2.3.2.", "b": [0.2051, 0.1472, 0.2618, 0.1669]}, {"w": "Broadcasting", "b": [0.2682, 0.1472, 0.4013, 0.1669]}, {"w": "2.3.3.", "b": [0.2051, 0.1748, 0.2618, 0.1945]}, {"w": "Tensor", "b": [0.2682, 0.1748, 0.3364, 0.1945]}, {"w": "dot", "b": [0.3427, 0.1748, 0.375, 0.1945]}, {"w": "2.3.4.", "b": [0.2051, 0.2024, 0.2618, 0.2222]}, {"w": "Tensor", "b": [0.2682, 0.2024, 0.3364, 0.2222]}, {"w": "reshaping", "b": [0.3427, 0.2024, 0.4408, 0.2222]}, {"w": "2.3.5.", "b": [0.2051, 0.2301, 0.2618, 0.2498]}, {"w": "Geometric", "b": [0.2682, 0.2301, 0.3746, 0.2498]}, {"w": "interpretation", "b": [0.3809, 0.2301, 0.5169, 0.2498]}, {"w": "of", "b": [0.5232, 0.2301, 0.5442, 0.2498]}, {"w": "tensor", "b": [0.5505, 0.2301, 0.6121, 0.2498]}, {"w": "operations", "b": [0.6184, 0.2301, 0.7235, 0.2498]}, {"w": "2.3.6.", "b": [0.2051, 0.2577, 0.2618, 0.2774]}, {"w": "A", "b": [0.2682, 0.2577, 0.2864, 0.2774]}, {"w": "geometric", "b": [0.2927, 0.2577, 0.3936, 0.2774]}, {"w": "interpretation", "b": [0.3999, 0.2577, 0.5358, 0.2774]}, {"w": "of", "b": [0.5421, 0.2577, 0.5631, 0.2774]}, {"w": "deep", "b": [0.5694, 0.2577, 0.617, 0.2774]}, {"w": "learning", "b": [0.6233, 0.2577, 0.706, 0.2774]}, {"w": "2.4.", "b": [0.1862, 0.296, 0.224, 0.3158]}, {"w": "The", "b": [0.2303, 0.296, 0.2695, 0.3158]}, {"w": "engine", "b": [0.2758, 0.296, 0.3431, 0.3158]}, {"w": "of", "b": [0.3494, 0.296, 0.3704, 0.3158]}, {"w": "neural", "b": [0.3767, 0.296, 0.4398, 0.3158]}, {"w": "networks:", "b": [0.4461, 0.296, 0.5456, 0.3158]}, {"w": "gradient-based", "b": [0.5519, 0.296, 0.7004, 0.3158]}, {"w": "optimization", "b": [0.1862, 0.3165, 0.3137, 0.3363]}]}, {"id": "b_1", "type": "paragraph", "text": "2.4.1. What’s a derivative? 2.4.2. Derivative of a tensor operation: the gradient 2.4.3. Stochastic gradient descent 2.4.4. Chaining derivatives: the Backpropagation algorithm", "words": [{"w": "2.4.1.", "b": [0.2051, 0.3504, 0.2618, 0.3701]}, {"w": "What’s", "b": [0.2682, 0.3504, 0.3396, 0.3701]}, {"w": "a", "b": [0.3459, 0.3504, 0.3571, 0.3701]}, {"w": "derivative?", "b": [0.3634, 0.3504, 0.4755, 0.3701]}, {"w": "2.4.2.", "b": [0.2051, 0.378, 0.2618, 0.3978]}, {"w": "Derivative", "b": [0.2682, 0.378, 0.3746, 0.3978]}, {"w": "of", "b": [0.3809, 0.378, 0.402, 0.3978]}, {"w": "a", "b": [0.4083, 0.378, 0.4195, 0.3978]}, {"w": "tensor", "b": [0.4258, 0.378, 0.4874, 0.3978]}, {"w": "operation:", "b": [0.4937, 0.378, 0.596, 0.3978]}, {"w": "the", "b": [0.6023, 0.378, 0.6331, 0.3978]}, {"w": "gradient", "b": [0.6395, 0.378, 0.7221, 0.3978]}, {"w": "2.4.3.", "b": [0.2051, 0.4057, 0.2618, 0.4254]}, {"w": "Stochastic", "b": [0.2682, 0.4057, 0.3719, 0.4254]}, {"w": "gradient", "b": [0.3782, 0.4057, 0.4608, 0.4254]}, {"w": "descent", "b": [0.4671, 0.4057, 0.5428, 0.4254]}, {"w": "2.4.4.", "b": [0.2051, 0.4333, 0.2618, 0.453]}, {"w": "Chaining", "b": [0.2682, 0.4333, 0.3607, 0.453]}, {"w": "derivatives:", "b": [0.367, 0.4333, 0.4847, 0.453]}, {"w": "the", "b": [0.491, 0.4333, 0.5218, 0.453]}, {"w": "Backpropagation", "b": [0.5281, 0.4333, 0.7004, 0.453]}, {"w": "algorithm", "b": [0.2051, 0.4538, 0.3032, 0.4735]}]}, {"id": "b_2", "type": "paragraph", "text": "2.5. Looking back at our first example Chapter 3. Getting started with neural networks", "words": [{"w": "2.5.", "b": [0.1862, 0.4921, 0.224, 0.5119]}, {"w": "Looking", "b": [0.2303, 0.4921, 0.3158, 0.5119]}, {"w": "back", "b": [0.3221, 0.4921, 0.3697, 0.5119]}, {"w": "at", "b": [0.376, 0.4921, 0.3943, 0.5119]}, {"w": "our", "b": [0.4006, 0.4921, 0.4342, 0.5119]}, {"w": "first", "b": [0.4405, 0.4921, 0.4811, 0.5119]}, {"w": "example", "b": [0.4874, 0.4921, 0.5729, 0.5119]}, {"w": "Chapter", "b": [0.1673, 0.5304, 0.2471, 0.5502]}, {"w": "3.", "b": [0.2534, 0.5304, 0.2723, 0.5502]}, {"w": "Getting", "b": [0.2786, 0.5304, 0.3543, 0.5502]}, {"w": "started", "b": [0.3606, 0.5304, 0.4279, 0.5502]}, {"w": "with", "b": [0.4342, 0.5304, 0.479, 0.5502]}, {"w": "neural", "b": [0.4853, 0.5304, 0.5484, 0.5502]}, {"w": "networks", "b": [0.5547, 0.5304, 0.6472, 0.5502]}]}, {"id": "b_3", "type": "paragraph", "text": "3.1. Anatomy of a neural network 3.1.1. Layers: the building blocks of deep learning 3.1.2. Models: networks of layers 3.1.3. Loss functions and optimizers: keys to configuring the learning process", "words": [{"w": "3.1.", "b": [0.1862, 0.5643, 0.224, 0.5841]}, {"w": "Anatomy", "b": [0.2303, 0.5643, 0.3242, 0.5841]}, {"w": "of", "b": [0.3305, 0.5643, 0.3515, 0.5841]}, {"w": "a", "b": [0.3578, 0.5643, 0.369, 0.5841]}, {"w": "neural", "b": [0.3753, 0.5643, 0.4384, 0.5841]}, {"w": "network", "b": [0.4447, 0.5643, 0.5273, 0.5841]}, {"w": "3.1.1.", "b": [0.2051, 0.5982, 0.2618, 0.6179]}, {"w": "Layers:", "b": [0.2682, 0.5982, 0.3438, 0.6179]}, {"w": "the", "b": [0.3501, 0.5982, 0.3809, 0.6179]}, {"w": "building", "b": [0.3872, 0.5982, 0.4713, 0.6179]}, {"w": "blocks", "b": [0.4777, 0.5982, 0.5435, 0.6179]}, {"w": "of", "b": [0.5498, 0.5982, 0.5708, 0.6179]}, {"w": "deep", "b": [0.5771, 0.5982, 0.6248, 0.6179]}, {"w": "learning", "b": [0.6311, 0.5982, 0.7137, 0.6179]}, {"w": "3.1.2.", "b": [0.2051, 0.6258, 0.2618, 0.6456]}, {"w": "Models:", "b": [0.2682, 0.6258, 0.3508, 0.6456]}, {"w": "networks", "b": [0.3572, 0.6258, 0.4496, 0.6456]}, {"w": "of", "b": [0.4559, 0.6258, 0.4769, 0.6456]}, {"w": "layers", "b": [0.4833, 0.6258, 0.5435, 0.6456]}, {"w": "3.1.3.", "b": [0.2051, 0.6534, 0.2618, 0.6732]}, {"w": "Loss", "b": [0.2682, 0.6534, 0.3158, 0.6732]}, {"w": "functions", "b": [0.3221, 0.6534, 0.416, 0.6732]}, {"w": "and", "b": [0.4223, 0.6534, 0.4587, 0.6732]}, {"w": "optimizers:", "b": [0.465, 0.6534, 0.5786, 0.6732]}, {"w": "keys", "b": [0.5849, 0.6534, 0.6311, 0.6732]}, {"w": "to", "b": [0.6374, 0.6534, 0.657, 0.6732]}, {"w": "configuring", "b": [0.2051, 0.6739, 0.3228, 0.6937]}, {"w": "the", "b": [0.3291, 0.6739, 0.3599, 0.6937]}, {"w": "learning", "b": [0.3662, 0.6739, 0.4489, 0.6937]}, {"w": "process", "b": [0.4552, 0.6739, 0.5309, 0.6937]}]}, {"id": "b_4", "type": "paragraph", "text": "3.2. Introduction to Keras 3.2.1. Keras, TensorFlow, Theano, and CNTK 3.2.2. Developing with Keras: a quick overview 3.3. Setting up a deep-learning workstation 3.3.1. Jupyter notebooks: the preferred way to run deep-learning experiments", "words": [{"w": "3.2.", "b": [0.1862, 0.7123, 0.224, 0.732]}, {"w": "Introduction", "b": [0.2303, 0.7123, 0.355, 0.732]}, {"w": "to", "b": [0.3613, 0.7123, 0.381, 0.732]}, {"w": "Keras", "b": [0.3873, 0.7123, 0.4461, 0.732]}, {"w": "3.2.1.", "b": [0.2051, 0.7461, 0.2618, 0.7659]}, {"w": "Keras,", "b": [0.2682, 0.7461, 0.3333, 0.7659]}, {"w": "TensorFlow,", "b": [0.3396, 0.7461, 0.4644, 0.7659]}, {"w": "Theano,", "b": [0.4707, 0.7461, 0.5527, 0.7659]}, {"w": "and", "b": [0.559, 0.7461, 0.5954, 0.7659]}, {"w": "CNTK", "b": [0.6017, 0.7461, 0.6704, 0.7659]}, {"w": "3.2.2.", "b": [0.2051, 0.7738, 0.2618, 0.7935]}, {"w": "Developing", "b": [0.2682, 0.7738, 0.3859, 0.7935]}, {"w": "with", "b": [0.3922, 0.7738, 0.437, 0.7935]}, {"w": "Keras:", "b": [0.4433, 0.7738, 0.5092, 0.7935]}, {"w": "a", "b": [0.5155, 0.7738, 0.5267, 0.7935]}, {"w": "quick", "b": [0.533, 0.7738, 0.589, 0.7935]}, {"w": "overview", "b": [0.5953, 0.7738, 0.6892, 0.7935]}, {"w": "3.3.", "b": [0.1862, 0.8121, 0.224, 0.8318]}, {"w": "Setting", "b": [0.2303, 0.8121, 0.3018, 0.8318]}, {"w": "up", "b": [0.3081, 0.8121, 0.3333, 0.8318]}, {"w": "a", "b": [0.3396, 0.8121, 0.3508, 0.8318]}, {"w": "deep-learning", "b": [0.3572, 0.8121, 0.4958, 0.8318]}, {"w": "workstation", "b": [0.5021, 0.8121, 0.6213, 0.8318]}, {"w": "3.3.1.", "b": [0.2051, 0.846, 0.2618, 0.8657]}, {"w": "Jupyter", "b": [0.2682, 0.846, 0.3424, 0.8657]}, {"w": "notebooks:", "b": [0.3487, 0.846, 0.4594, 0.8657]}, {"w": "the", "b": [0.4657, 0.846, 0.4966, 0.8657]}, {"w": "preferred", "b": [0.5029, 0.846, 0.5953, 0.8657]}, {"w": "way", "b": [0.6016, 0.846, 0.6436, 0.8657]}, {"w": "to", "b": [0.6499, 0.846, 0.6696, 0.8657]}, {"w": "run", "b": [0.6759, 0.846, 0.7095, 0.8657]}, {"w": "deep-learning", "b": [0.2051, 0.8665, 0.3438, 0.8862]}, {"w": "experiments", "b": [0.3501, 0.8665, 0.4734, 0.8862]}]}, {"id": "b_5", "type": "paragraph", "text": "3.3.2. Getting Keras running: two options", "words": [{"w": "3.3.2.", "b": [0.2051, 0.8941, 0.2618, 0.9138]}, {"w": "Getting", "b": [0.2682, 0.8941, 0.3438, 0.9138]}, {"w": "Keras", "b": [0.3501, 0.8941, 0.409, 0.9138]}, {"w": "running:", "b": [0.4153, 0.8941, 0.5008, 0.9138]}, {"w": "two", "b": [0.5071, 0.8941, 0.5449, 0.9138]}, {"w": "options", "b": [0.5512, 0.8941, 0.6255, 0.9138]}]}]}, {"page": 10, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "3.3.3. Running deep-learning jobs in the cloud: pros and cons", "words": [{"w": "3.3.3.", "b": [0.2051, 0.0857, 0.2618, 0.1054]}, {"w": "Running", "b": [0.2682, 0.0857, 0.3551, 0.1054]}, {"w": "deep-learning", "b": [0.3614, 0.0857, 0.5001, 0.1054]}, {"w": "jobs", "b": [0.5064, 0.0857, 0.5484, 0.1054]}, {"w": "in", "b": [0.5547, 0.0857, 0.5743, 0.1054]}, {"w": "the", "b": [0.5807, 0.0857, 0.6115, 0.1054]}, {"w": "cloud:", "b": [0.6178, 0.0857, 0.6808, 0.1054]}, {"w": "pros", "b": [0.6872, 0.0857, 0.7306, 0.1054]}, {"w": "and", "b": [0.2051, 0.1062, 0.2415, 0.1259]}, {"w": "cons", "b": [0.2478, 0.1062, 0.2941, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "3.3.4. What is the best GPU for deep learning? 3.4. Classifying movie reviews: a binary classification example", "words": [{"w": "3.3.4.", "b": [0.2051, 0.1338, 0.2618, 0.1535]}, {"w": "What", "b": [0.2682, 0.1338, 0.3228, 0.1535]}, {"w": "is", "b": [0.3291, 0.1338, 0.3459, 0.1535]}, {"w": "the", "b": [0.3522, 0.1338, 0.3831, 0.1535]}, {"w": "best", "b": [0.3894, 0.1338, 0.43, 0.1535]}, {"w": "GPU", "b": [0.4363, 0.1338, 0.4868, 0.1535]}, {"w": "for", "b": [0.4931, 0.1338, 0.5225, 0.1535]}, {"w": "deep", "b": [0.5288, 0.1338, 0.5764, 0.1535]}, {"w": "learning?", "b": [0.5827, 0.1338, 0.6766, 0.1535]}, {"w": "3.4.", "b": [0.1862, 0.1721, 0.224, 0.1919]}, {"w": "Classifying", "b": [0.2303, 0.1721, 0.3452, 0.1919]}, {"w": "movie", "b": [0.3516, 0.1721, 0.4146, 0.1919]}, {"w": "reviews:", "b": [0.4209, 0.1721, 0.5064, 0.1919]}, {"w": "a", "b": [0.5127, 0.1721, 0.5239, 0.1919]}, {"w": "binary", "b": [0.5302, 0.1721, 0.5947, 0.1919]}, {"w": "classification", "b": [0.601, 0.1721, 0.7341, 0.1919]}, {"w": "example", "b": [0.1862, 0.1926, 0.2716, 0.2124]}]}, {"id": "b_2", "type": "paragraph", "text": "3.4.1. The IMDB dataset 3.4.2. Preparing the data 3.4.3. Building your network 3.4.4. Validating your approach 3.4.5. Using a trained network to generate predictions on new data", "words": [{"w": "3.4.1.", "b": [0.2051, 0.2265, 0.2618, 0.2462]}, {"w": "The", "b": [0.2682, 0.2265, 0.3074, 0.2462]}, {"w": "IMDB", "b": [0.3137, 0.2265, 0.3796, 0.2462]}, {"w": "dataset", "b": [0.3859, 0.2265, 0.4559, 0.2462]}, {"w": "3.4.2.", "b": [0.2051, 0.2541, 0.2618, 0.2739]}, {"w": "Preparing", "b": [0.2682, 0.2541, 0.3662, 0.2739]}, {"w": "the", "b": [0.3725, 0.2541, 0.4034, 0.2739]}, {"w": "data", "b": [0.4097, 0.2541, 0.4517, 0.2739]}, {"w": "3.4.3.", "b": [0.2051, 0.2818, 0.2618, 0.3015]}, {"w": "Building", "b": [0.2682, 0.2818, 0.3565, 0.3015]}, {"w": "your", "b": [0.3628, 0.2818, 0.409, 0.3015]}, {"w": "network", "b": [0.4153, 0.2818, 0.498, 0.3015]}, {"w": "3.4.4.", "b": [0.2051, 0.3094, 0.2618, 0.3291]}, {"w": "Validating", "b": [0.2682, 0.3094, 0.3719, 0.3291]}, {"w": "your", "b": [0.3782, 0.3094, 0.4244, 0.3291]}, {"w": "approach", "b": [0.4307, 0.3094, 0.5232, 0.3291]}, {"w": "3.4.5.", "b": [0.2051, 0.337, 0.2618, 0.3568]}, {"w": "Using", "b": [0.2682, 0.337, 0.3284, 0.3568]}, {"w": "a", "b": [0.3347, 0.337, 0.3459, 0.3568]}, {"w": "trained", "b": [0.3522, 0.337, 0.4223, 0.3568]}, {"w": "network", "b": [0.4286, 0.337, 0.5113, 0.3568]}, {"w": "to", "b": [0.5176, 0.337, 0.5372, 0.3568]}, {"w": "generate", "b": [0.5435, 0.337, 0.6289, 0.3568]}, {"w": "predictions", "b": [0.6352, 0.337, 0.7473, 0.3568]}, {"w": "on", "b": [0.2051, 0.3575, 0.2303, 0.3773]}, {"w": "new", "b": [0.2366, 0.3575, 0.2786, 0.3773]}, {"w": "data", "b": [0.285, 0.3575, 0.327, 0.3773]}]}, {"id": "b_3", "type": "paragraph", "text": "3.4.6. Further experiments 3.4.7. Wrapping up 3.5. Classifying newswires: a multiclass classification example", "words": [{"w": "3.4.6.", "b": [0.2051, 0.3852, 0.2618, 0.4049]}, {"w": "Further", "b": [0.2682, 0.3852, 0.3424, 0.4049]}, {"w": "experiments", "b": [0.3487, 0.3852, 0.472, 0.4049]}, {"w": "3.4.7.", "b": [0.2051, 0.4128, 0.2618, 0.4325]}, {"w": "Wrapping", "b": [0.2682, 0.4128, 0.368, 0.4325]}, {"w": "up", "b": [0.3743, 0.4128, 0.3995, 0.4325]}, {"w": "3.5.", "b": [0.1862, 0.4511, 0.224, 0.4709]}, {"w": "Classifying", "b": [0.2303, 0.4511, 0.3452, 0.4709]}, {"w": "newswires:", "b": [0.3516, 0.4511, 0.465, 0.4709]}, {"w": "a", "b": [0.4713, 0.4511, 0.4825, 0.4709]}, {"w": "multiclass", "b": [0.4889, 0.4511, 0.5912, 0.4709]}, {"w": "classification", "b": [0.5975, 0.4511, 0.7306, 0.4709]}, {"w": "example", "b": [0.1862, 0.4716, 0.2716, 0.4914]}]}, {"id": "b_4", "type": "paragraph", "text": "3.5.1. The Reuters dataset 3.5.2. Preparing the data 3.5.3. Building your network 3.5.4. Validating your approach 3.5.5. Generating predictions on new data 3.5.6. A different way to handle the labels and the loss 3.5.7. The importance of having sufficiently large intermediate layers", "words": [{"w": "3.5.1.", "b": [0.2051, 0.5055, 0.2618, 0.5252]}, {"w": "The", "b": [0.2682, 0.5055, 0.3074, 0.5252]}, {"w": "Reuters", "b": [0.3137, 0.5055, 0.3908, 0.5252]}, {"w": "dataset", "b": [0.3971, 0.5055, 0.4671, 0.5252]}, {"w": "3.5.2.", "b": [0.2051, 0.5331, 0.2618, 0.5529]}, {"w": "Preparing", "b": [0.2682, 0.5331, 0.3662, 0.5529]}, {"w": "the", "b": [0.3725, 0.5331, 0.4034, 0.5529]}, {"w": "data", "b": [0.4097, 0.5331, 0.4517, 0.5529]}, {"w": "3.5.3.", "b": [0.2051, 0.5607, 0.2618, 0.5805]}, {"w": "Building", "b": [0.2682, 0.5607, 0.3565, 0.5805]}, {"w": "your", "b": [0.3628, 0.5607, 0.409, 0.5805]}, {"w": "network", "b": [0.4153, 0.5607, 0.498, 0.5805]}, {"w": "3.5.4.", "b": [0.2051, 0.5884, 0.2618, 0.6081]}, {"w": "Validating", "b": [0.2682, 0.5884, 0.3719, 0.6081]}, {"w": "your", "b": [0.3782, 0.5884, 0.4244, 0.6081]}, {"w": "approach", "b": [0.4307, 0.5884, 0.5232, 0.6081]}, {"w": "3.5.5.", "b": [0.2051, 0.616, 0.2618, 0.6358]}, {"w": "Generating", "b": [0.2682, 0.616, 0.3802, 0.6358]}, {"w": "predictions", "b": [0.3865, 0.616, 0.4986, 0.6358]}, {"w": "on", "b": [0.5049, 0.616, 0.5302, 0.6358]}, {"w": "new", "b": [0.5365, 0.616, 0.5785, 0.6358]}, {"w": "data", "b": [0.5848, 0.616, 0.6268, 0.6358]}, {"w": "3.5.6.", "b": [0.2051, 0.6436, 0.2618, 0.6634]}, {"w": "A", "b": [0.2682, 0.6436, 0.2864, 0.6634]}, {"w": "different", "b": [0.2927, 0.6436, 0.3791, 0.6634]}, {"w": "way", "b": [0.3854, 0.6436, 0.4274, 0.6634]}, {"w": "to", "b": [0.4337, 0.6436, 0.4533, 0.6634]}, {"w": "handle", "b": [0.4596, 0.6436, 0.5269, 0.6634]}, {"w": "the", "b": [0.5332, 0.6436, 0.564, 0.6634]}, {"w": "labels", "b": [0.5703, 0.6436, 0.6292, 0.6634]}, {"w": "and", "b": [0.6355, 0.6436, 0.6719, 0.6634]}, {"w": "the", "b": [0.6782, 0.6436, 0.709, 0.6634]}, {"w": "loss", "b": [0.7154, 0.6436, 0.7546, 0.6634]}, {"w": "3.5.7.", "b": [0.2051, 0.6713, 0.2618, 0.691]}, {"w": "The", "b": [0.2682, 0.6713, 0.3074, 0.691]}, {"w": "importance", "b": [0.3137, 0.6713, 0.4272, 0.691]}, {"w": "of", "b": [0.4335, 0.6713, 0.4545, 0.691]}, {"w": "having", "b": [0.4608, 0.6713, 0.5295, 0.691]}, {"w": "sufficiently", "b": [0.5358, 0.6713, 0.6502, 0.691]}, {"w": "large", "b": [0.6565, 0.6713, 0.7064, 0.691]}, {"w": "intermediate", "b": [0.2051, 0.6918, 0.3312, 0.7115]}, {"w": "layers", "b": [0.3375, 0.6918, 0.3977, 0.7115]}]}, {"id": "b_5", "type": "paragraph", "text": "3.5.8. Further experiments 3.5.9. Wrapping up 3.6. Predicting house prices: a regression example 3.6.1. The Boston Housing Price dataset 3.6.2. Preparing the data 3.6.3. Building your network", "words": [{"w": "3.5.8.", "b": [0.2051, 0.7194, 0.2618, 0.7391]}, {"w": "Further", "b": [0.2682, 0.7194, 0.3424, 0.7391]}, {"w": "experiments", "b": [0.3487, 0.7194, 0.472, 0.7391]}, {"w": "3.5.9.", "b": [0.2051, 0.747, 0.2618, 0.7668]}, {"w": "Wrapping", "b": [0.2682, 0.747, 0.368, 0.7668]}, {"w": "up", "b": [0.3743, 0.747, 0.3995, 0.7668]}, {"w": "3.6.", "b": [0.1862, 0.7854, 0.224, 0.8051]}, {"w": "Predicting", "b": [0.2303, 0.7854, 0.334, 0.8051]}, {"w": "house", "b": [0.3403, 0.7854, 0.3992, 0.8051]}, {"w": "prices:", "b": [0.4055, 0.7854, 0.4727, 0.8051]}, {"w": "a", "b": [0.479, 0.7854, 0.4902, 0.8051]}, {"w": "regression", "b": [0.4965, 0.7854, 0.6002, 0.8051]}, {"w": "example", "b": [0.6065, 0.7854, 0.692, 0.8051]}, {"w": "3.6.1.", "b": [0.2051, 0.8192, 0.2618, 0.839]}, {"w": "The", "b": [0.2682, 0.8192, 0.3074, 0.839]}, {"w": "Boston", "b": [0.3137, 0.8192, 0.3852, 0.839]}, {"w": "Housing", "b": [0.3915, 0.8192, 0.477, 0.839]}, {"w": "Price", "b": [0.4833, 0.8192, 0.5351, 0.839]}, {"w": "dataset", "b": [0.5414, 0.8192, 0.6115, 0.839]}, {"w": "3.6.2.", "b": [0.2051, 0.8469, 0.2618, 0.8666]}, {"w": "Preparing", "b": [0.2682, 0.8469, 0.3662, 0.8666]}, {"w": "the", "b": [0.3725, 0.8469, 0.4034, 0.8666]}, {"w": "data", "b": [0.4097, 0.8469, 0.4517, 0.8666]}, {"w": "3.6.3.", "b": [0.2051, 0.8745, 0.2618, 0.8942]}, {"w": "Building", "b": [0.2682, 0.8745, 0.3565, 0.8942]}, {"w": "your", "b": [0.3628, 0.8745, 0.409, 0.8942]}, {"w": "network", "b": [0.4153, 0.8745, 0.498, 0.8942]}]}]}, {"page": 11, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3.6.4. Validating your approach using K-fold validation 3.6.5. Wrapping up Chapter 4. Fundamentals of machine learning", "words": [{"w": "3.6.4.", "b": [0.2051, 0.0857, 0.2618, 0.1054]}, {"w": "Validating", "b": [0.2682, 0.0857, 0.3719, 0.1054]}, {"w": "your", "b": [0.3782, 0.0857, 0.4244, 0.1054]}, {"w": "approach", "b": [0.4307, 0.0857, 0.5232, 0.1054]}, {"w": "using", "b": [0.5295, 0.0857, 0.5841, 0.1054]}, {"w": "K-fold", "b": [0.5904, 0.0857, 0.6577, 0.1054]}, {"w": "validation", "b": [0.664, 0.0857, 0.7649, 0.1054]}, {"w": "3.6.5.", "b": [0.2051, 0.1133, 0.2618, 0.133]}, {"w": "Wrapping", "b": [0.2682, 0.1133, 0.368, 0.133]}, {"w": "up", "b": [0.3743, 0.1133, 0.3995, 0.133]}, {"w": "Chapter", "b": [0.1673, 0.1516, 0.2471, 0.1714]}, {"w": "4.", "b": [0.2534, 0.1516, 0.2723, 0.1714]}, {"w": "Fundamentals", "b": [0.2786, 0.1516, 0.4202, 0.1714]}, {"w": "of", "b": [0.4265, 0.1516, 0.4475, 0.1714]}, {"w": "machine", "b": [0.4538, 0.1516, 0.5393, 0.1714]}, {"w": "learning", "b": [0.5456, 0.1516, 0.6283, 0.1714]}]}, {"id": "b_1", "type": "paragraph", "text": "4.1. Four branches of machine learning 4.1.1. Supervised learning 4.1.2. Unsupervised learning 4.1.3. Self-supervised learning 4.1.4. Reinforcement learning 4.2. Evaluating machine-learning models 4.2.1. Training, validation, and test sets 4.2.2. Things to keep in mind 4.3. Data preprocessing, feature engineering, and feature learning", "words": [{"w": "4.1.", "b": [0.1862, 0.1855, 0.224, 0.2052]}, {"w": "Four", "b": [0.2303, 0.1855, 0.278, 0.2052]}, {"w": "branches", "b": [0.2843, 0.1855, 0.3739, 0.2052]}, {"w": "of", "b": [0.3802, 0.1855, 0.4012, 0.2052]}, {"w": "machine", "b": [0.4076, 0.1855, 0.493, 0.2052]}, {"w": "learning", "b": [0.4993, 0.1855, 0.582, 0.2052]}, {"w": "4.1.1.", "b": [0.2051, 0.2194, 0.2618, 0.2391]}, {"w": "Supervised", "b": [0.2682, 0.2194, 0.3803, 0.2391]}, {"w": "learning", "b": [0.3866, 0.2194, 0.4692, 0.2391]}, {"w": "4.1.2.", "b": [0.2051, 0.247, 0.2618, 0.2667]}, {"w": "Unsupervised", "b": [0.2682, 0.247, 0.4069, 0.2667]}, {"w": "learning", "b": [0.4132, 0.247, 0.4958, 0.2667]}, {"w": "4.1.3.", "b": [0.2051, 0.2746, 0.2618, 0.2944]}, {"w": "Self-supervised", "b": [0.2682, 0.2746, 0.4251, 0.2944]}, {"w": "learning", "b": [0.4314, 0.2746, 0.5141, 0.2944]}, {"w": "4.1.4.", "b": [0.2051, 0.3023, 0.2618, 0.322]}, {"w": "Reinforcement", "b": [0.2682, 0.3023, 0.4181, 0.322]}, {"w": "learning", "b": [0.4244, 0.3023, 0.507, 0.322]}, {"w": "4.2.", "b": [0.1862, 0.3406, 0.224, 0.3603]}, {"w": "Evaluating", "b": [0.2303, 0.3406, 0.3396, 0.3603]}, {"w": "machine-learning", "b": [0.3459, 0.3406, 0.5225, 0.3603]}, {"w": "models", "b": [0.5288, 0.3406, 0.6016, 0.3603]}, {"w": "4.2.1.", "b": [0.2051, 0.3745, 0.2618, 0.3942]}, {"w": "Training,", "b": [0.2682, 0.3745, 0.3604, 0.3942]}, {"w": "validation,", "b": [0.3668, 0.3745, 0.474, 0.3942]}, {"w": "and", "b": [0.4803, 0.3745, 0.5167, 0.3942]}, {"w": "test", "b": [0.523, 0.3745, 0.558, 0.3942]}, {"w": "sets", "b": [0.5643, 0.3745, 0.6022, 0.3942]}, {"w": "4.2.2.", "b": [0.2051, 0.4021, 0.2618, 0.4218]}, {"w": "Things", "b": [0.2682, 0.4021, 0.3382, 0.4218]}, {"w": "to", "b": [0.3445, 0.4021, 0.3642, 0.4218]}, {"w": "keep", "b": [0.3705, 0.4021, 0.4181, 0.4218]}, {"w": "in", "b": [0.4244, 0.4021, 0.444, 0.4218]}, {"w": "mind", "b": [0.4503, 0.4021, 0.5022, 0.4218]}, {"w": "4.3.", "b": [0.1862, 0.4404, 0.224, 0.4602]}, {"w": "Data", "b": [0.2303, 0.4404, 0.2779, 0.4602]}, {"w": "preprocessing,", "b": [0.2842, 0.4404, 0.4307, 0.4602]}, {"w": "feature", "b": [0.437, 0.4404, 0.507, 0.4602]}, {"w": "engineering,", "b": [0.5133, 0.4404, 0.6387, 0.4602]}, {"w": "and", "b": [0.645, 0.4404, 0.6814, 0.4602]}, {"w": "feature", "b": [0.6877, 0.4404, 0.7578, 0.4602]}, {"w": "learning", "b": [0.1862, 0.4609, 0.2688, 0.4807]}]}, {"id": "b_2", "type": "paragraph", "text": "4.3.1. Data preprocessing for neural networks 4.3.2. Feature engineering 4.4. Overfitting and underfitting 4.4.1. Reducing the network’s size 4.4.2. Adding weight regularization 4.4.3. Adding dropout 4.5. The universal workflow of machine learning 4.5.1. Defining the problem and assembling a dataset 4.5.2. Choosing a measure of success 4.5.3. Deciding on an evaluation protocol 4.5.4. Preparing your data 4.5.5. Developing a model that does better than a baseline", "words": [{"w": "4.3.1.", "b": [0.2051, 0.4948, 0.2618, 0.5145]}, {"w": "Data", "b": [0.2682, 0.4948, 0.3158, 0.5145]}, {"w": "preprocessing", "b": [0.3221, 0.4948, 0.4622, 0.5145]}, {"w": "for", "b": [0.4685, 0.4948, 0.4979, 0.5145]}, {"w": "neural", "b": [0.5042, 0.4948, 0.5673, 0.5145]}, {"w": "networks", "b": [0.5736, 0.4948, 0.666, 0.5145]}, {"w": "4.3.2.", "b": [0.2051, 0.5224, 0.2618, 0.5422]}, {"w": "Feature", "b": [0.2682, 0.5224, 0.3438, 0.5422]}, {"w": "engineering", "b": [0.3501, 0.5224, 0.4692, 0.5422]}, {"w": "4.4.", "b": [0.1862, 0.5607, 0.224, 0.5805]}, {"w": "Overfitting", "b": [0.2303, 0.5607, 0.3424, 0.5805]}, {"w": "and", "b": [0.3487, 0.5607, 0.3852, 0.5805]}, {"w": "underfitting", "b": [0.3915, 0.5607, 0.5106, 0.5805]}, {"w": "4.4.1.", "b": [0.2051, 0.5946, 0.2618, 0.6144]}, {"w": "Reducing", "b": [0.2682, 0.5946, 0.3648, 0.6144]}, {"w": "the", "b": [0.3712, 0.5946, 0.402, 0.6144]}, {"w": "network’s", "b": [0.4083, 0.5946, 0.5077, 0.6144]}, {"w": "size", "b": [0.5141, 0.5946, 0.5533, 0.6144]}, {"w": "4.4.2.", "b": [0.2051, 0.6222, 0.2618, 0.642]}, {"w": "Adding", "b": [0.2682, 0.6222, 0.3438, 0.642]}, {"w": "weight", "b": [0.3501, 0.6222, 0.4188, 0.642]}, {"w": "regularization", "b": [0.4251, 0.6222, 0.5652, 0.642]}, {"w": "4.4.3.", "b": [0.2051, 0.6499, 0.2618, 0.6696]}, {"w": "Adding", "b": [0.2682, 0.6499, 0.3438, 0.6696]}, {"w": "dropout", "b": [0.3501, 0.6499, 0.4286, 0.6696]}, {"w": "4.5.", "b": [0.1862, 0.6882, 0.224, 0.7079]}, {"w": "The", "b": [0.2303, 0.6882, 0.2695, 0.7079]}, {"w": "universal", "b": [0.2758, 0.6882, 0.3683, 0.7079]}, {"w": "workflow", "b": [0.3746, 0.6882, 0.4727, 0.7079]}, {"w": "of", "b": [0.479, 0.6882, 0.5, 0.7079]}, {"w": "machine", "b": [0.5063, 0.6882, 0.5918, 0.7079]}, {"w": "learning", "b": [0.5981, 0.6882, 0.6808, 0.7079]}, {"w": "4.5.1.", "b": [0.2051, 0.7221, 0.2618, 0.7418]}, {"w": "Defining", "b": [0.2682, 0.7221, 0.3578, 0.7418]}, {"w": "the", "b": [0.3641, 0.7221, 0.395, 0.7418]}, {"w": "problem", "b": [0.4013, 0.7221, 0.4853, 0.7418]}, {"w": "and", "b": [0.4917, 0.7221, 0.5281, 0.7418]}, {"w": "assembling", "b": [0.5344, 0.7221, 0.6479, 0.7418]}, {"w": "a", "b": [0.6542, 0.7221, 0.6654, 0.7418]}, {"w": "dataset", "b": [0.6717, 0.7221, 0.7418, 0.7418]}, {"w": "4.5.2.", "b": [0.2051, 0.7497, 0.2618, 0.7694]}, {"w": "Choosing", "b": [0.2682, 0.7497, 0.3649, 0.7694]}, {"w": "a", "b": [0.3712, 0.7497, 0.3824, 0.7694]}, {"w": "measure", "b": [0.3887, 0.7497, 0.4727, 0.7694]}, {"w": "of", "b": [0.479, 0.7497, 0.5001, 0.7694]}, {"w": "success", "b": [0.5064, 0.7497, 0.582, 0.7694]}, {"w": "4.5.3.", "b": [0.2051, 0.7773, 0.2618, 0.7971]}, {"w": "Deciding", "b": [0.2682, 0.7773, 0.3606, 0.7971]}, {"w": "on", "b": [0.3669, 0.7773, 0.3922, 0.7971]}, {"w": "an", "b": [0.3985, 0.7773, 0.4223, 0.7971]}, {"w": "evaluation", "b": [0.4286, 0.7773, 0.5337, 0.7971]}, {"w": "protocol", "b": [0.54, 0.7773, 0.6241, 0.7971]}, {"w": "4.5.4.", "b": [0.2051, 0.805, 0.2618, 0.8247]}, {"w": "Preparing", "b": [0.2682, 0.805, 0.3662, 0.8247]}, {"w": "your", "b": [0.3725, 0.805, 0.4188, 0.8247]}, {"w": "data", "b": [0.4251, 0.805, 0.4671, 0.8247]}, {"w": "4.5.5.", "b": [0.2051, 0.8326, 0.2618, 0.8523]}, {"w": "Developing", "b": [0.2682, 0.8326, 0.3859, 0.8523]}, {"w": "a", "b": [0.3922, 0.8326, 0.4034, 0.8523]}, {"w": "model", "b": [0.4097, 0.8326, 0.4727, 0.8523]}, {"w": "that", "b": [0.479, 0.8326, 0.5169, 0.8523]}, {"w": "does", "b": [0.5232, 0.8326, 0.5694, 0.8523]}, {"w": "better", "b": [0.5757, 0.8326, 0.6332, 0.8523]}, {"w": "than", "b": [0.6395, 0.8326, 0.6829, 0.8523]}, {"w": "a", "b": [0.6892, 0.8326, 0.7004, 0.8523]}, {"w": "baseline", "b": [0.2051, 0.8531, 0.2878, 0.8728]}]}, {"id": "b_3", "type": "paragraph", "text": "4.5.6. Scaling up: developing a model that overfits", "words": [{"w": "4.5.6.", "b": [0.2051, 0.8807, 0.2618, 0.9005]}, {"w": "Scaling", "b": [0.2682, 0.8807, 0.3438, 0.9005]}, {"w": "up:", "b": [0.3501, 0.8807, 0.3824, 0.9005]}, {"w": "developing", "b": [0.3887, 0.8807, 0.5008, 0.9005]}, {"w": "a", "b": [0.5071, 0.8807, 0.5183, 0.9005]}, {"w": "model", "b": [0.5246, 0.8807, 0.5877, 0.9005]}, {"w": "that", "b": [0.594, 0.8807, 0.6318, 0.9005]}, {"w": "overfits", "b": [0.6381, 0.8807, 0.7152, 0.9005]}]}]}, {"page": 12, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4.5.7. Regularizing your model and tuning your hyperparameters", "words": [{"w": "4.5.7.", "b": [0.2051, 0.0857, 0.2618, 0.1054]}, {"w": "Regularizing", "b": [0.2682, 0.0857, 0.3985, 0.1054]}, {"w": "your", "b": [0.4048, 0.0857, 0.451, 0.1054]}, {"w": "model", "b": [0.4573, 0.0857, 0.5204, 0.1054]}, {"w": "and", "b": [0.5267, 0.0857, 0.5631, 0.1054]}, {"w": "tuning", "b": [0.5694, 0.0857, 0.6339, 0.1054]}, {"w": "your", "b": [0.6402, 0.0857, 0.6864, 0.1054]}, {"w": "hyperparameters", "b": [0.2051, 0.1062, 0.3732, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "2. Deep learning in practice Chapter 5. Deep learning for computer vision", "words": [{"w": "2.", "b": [0.1483, 0.1445, 0.1673, 0.1642]}, {"w": "Deep", "b": [0.1736, 0.1445, 0.2268, 0.1642]}, {"w": "learning", "b": [0.2331, 0.1445, 0.3158, 0.1642]}, {"w": "in", "b": [0.3221, 0.1445, 0.3417, 0.1642]}, {"w": "practice", "b": [0.348, 0.1445, 0.4278, 0.1642]}, {"w": "Chapter", "b": [0.1673, 0.1784, 0.2471, 0.1981]}, {"w": "5.", "b": [0.2534, 0.1784, 0.2723, 0.1981]}, {"w": "Deep", "b": [0.2786, 0.1784, 0.3319, 0.1981]}, {"w": "learning", "b": [0.3382, 0.1784, 0.4208, 0.1981]}, {"w": "for", "b": [0.4272, 0.1784, 0.4566, 0.1981]}, {"w": "computer", "b": [0.4629, 0.1784, 0.5581, 0.1981]}, {"w": "vision", "b": [0.5645, 0.1784, 0.6261, 0.1981]}]}, {"id": "b_2", "type": "paragraph", "text": "5.1. Introduction to convnets 5.1.1. The convolution operation 5.1.2. The max-pooling operation 5.2. Training a convnet from scratch on a small dataset 5.2.1. The relevance of deep learning for small-data problems", "words": [{"w": "5.1.", "b": [0.1862, 0.2122, 0.224, 0.232]}, {"w": "Introduction", "b": [0.2303, 0.2122, 0.355, 0.232]}, {"w": "to", "b": [0.3613, 0.2122, 0.381, 0.232]}, {"w": "convnets", "b": [0.3873, 0.2122, 0.4769, 0.232]}, {"w": "5.1.1.", "b": [0.2051, 0.2461, 0.2618, 0.2659]}, {"w": "The", "b": [0.2682, 0.2461, 0.3074, 0.2659]}, {"w": "convolution", "b": [0.3137, 0.2461, 0.4342, 0.2659]}, {"w": "operation", "b": [0.4405, 0.2461, 0.5358, 0.2659]}, {"w": "5.1.2.", "b": [0.2051, 0.2737, 0.2618, 0.2935]}, {"w": "The", "b": [0.2682, 0.2737, 0.3074, 0.2935]}, {"w": "max-pooling", "b": [0.3137, 0.2737, 0.4426, 0.2935]}, {"w": "operation", "b": [0.4489, 0.2737, 0.5442, 0.2935]}, {"w": "5.2.", "b": [0.1862, 0.3121, 0.224, 0.3318]}, {"w": "Training", "b": [0.2303, 0.3121, 0.3163, 0.3318]}, {"w": "a", "b": [0.3226, 0.3121, 0.3338, 0.3318]}, {"w": "convnet", "b": [0.3401, 0.3121, 0.42, 0.3318]}, {"w": "from", "b": [0.4263, 0.3121, 0.4753, 0.3318]}, {"w": "scratch", "b": [0.4816, 0.3121, 0.5531, 0.3318]}, {"w": "on", "b": [0.5594, 0.3121, 0.5846, 0.3318]}, {"w": "a", "b": [0.5909, 0.3121, 0.6021, 0.3318]}, {"w": "small", "b": [0.6084, 0.3121, 0.6631, 0.3318]}, {"w": "dataset", "b": [0.6694, 0.3121, 0.7394, 0.3318]}, {"w": "5.2.1.", "b": [0.2051, 0.3459, 0.2618, 0.3657]}, {"w": "The", "b": [0.2682, 0.3459, 0.3074, 0.3657]}, {"w": "relevance", "b": [0.3137, 0.3459, 0.4103, 0.3657]}, {"w": "of", "b": [0.4166, 0.3459, 0.4376, 0.3657]}, {"w": "deep", "b": [0.444, 0.3459, 0.4916, 0.3657]}, {"w": "learning", "b": [0.4979, 0.3459, 0.5805, 0.3657]}, {"w": "for", "b": [0.5869, 0.3459, 0.6163, 0.3657]}, {"w": "small-data", "b": [0.6226, 0.3459, 0.7277, 0.3657]}, {"w": "problems", "b": [0.2051, 0.3664, 0.299, 0.3862]}]}, {"id": "b_3", "type": "paragraph", "text": "5.2.2. Downloading the data 5.2.3. Building your network 5.2.4. Data preprocessing 5.2.5. Using data augmentation 5.3. Using a pretrained convnet 5.3.1. Feature extraction 5.3.2. Fine-tuning 5.3.3. Wrapping up 5.4. Visualizing what convnets learn 5.4.1. Visualizing intermediate activations 5.4.2. Visualizing convnet filters 5.4.3. Visualizing heatmaps of class activation Chapter 6. Deep learning for text and sequences", "words": [{"w": "5.2.2.", "b": [0.2051, 0.3941, 0.2618, 0.4138]}, {"w": "Downloading", "b": [0.2682, 0.3941, 0.4055, 0.4138]}, {"w": "the", "b": [0.4118, 0.3941, 0.4426, 0.4138]}, {"w": "data", "b": [0.4489, 0.3941, 0.4909, 0.4138]}, {"w": "5.2.3.", "b": [0.2051, 0.4217, 0.2618, 0.4414]}, {"w": "Building", "b": [0.2682, 0.4217, 0.3565, 0.4414]}, {"w": "your", "b": [0.3628, 0.4217, 0.409, 0.4414]}, {"w": "network", "b": [0.4153, 0.4217, 0.498, 0.4414]}, {"w": "5.2.4.", "b": [0.2051, 0.4493, 0.2618, 0.4691]}, {"w": "Data", "b": [0.2682, 0.4493, 0.3158, 0.4691]}, {"w": "preprocessing", "b": [0.3221, 0.4493, 0.4622, 0.4691]}, {"w": "5.2.5.", "b": [0.2051, 0.477, 0.2618, 0.4967]}, {"w": "Using", "b": [0.2682, 0.477, 0.3284, 0.4967]}, {"w": "data", "b": [0.3347, 0.477, 0.3768, 0.4967]}, {"w": "augmentation", "b": [0.3831, 0.477, 0.5204, 0.4967]}, {"w": "5.3.", "b": [0.1862, 0.5153, 0.224, 0.535]}, {"w": "Using", "b": [0.2303, 0.5153, 0.2906, 0.535]}, {"w": "a", "b": [0.2969, 0.5153, 0.3081, 0.535]}, {"w": "pretrained", "b": [0.3144, 0.5153, 0.4167, 0.535]}, {"w": "convnet", "b": [0.423, 0.5153, 0.5028, 0.535]}, {"w": "5.3.1.", "b": [0.2051, 0.5492, 0.2618, 0.5689]}, {"w": "Feature", "b": [0.2682, 0.5492, 0.3438, 0.5689]}, {"w": "extraction", "b": [0.3501, 0.5492, 0.451, 0.5689]}, {"w": "5.3.2.", "b": [0.2051, 0.5768, 0.2618, 0.5965]}, {"w": "Fine-tuning", "b": [0.2682, 0.5768, 0.3859, 0.5965]}, {"w": "5.3.3.", "b": [0.2051, 0.6044, 0.2618, 0.6242]}, {"w": "Wrapping", "b": [0.2682, 0.6044, 0.368, 0.6242]}, {"w": "up", "b": [0.3743, 0.6044, 0.3995, 0.6242]}, {"w": "5.4.", "b": [0.1862, 0.6427, 0.224, 0.6625]}, {"w": "Visualizing", "b": [0.2303, 0.6427, 0.3451, 0.6625]}, {"w": "what", "b": [0.3514, 0.6427, 0.4005, 0.6625]}, {"w": "convnets", "b": [0.4068, 0.6427, 0.4964, 0.6625]}, {"w": "learn", "b": [0.5028, 0.6427, 0.5532, 0.6625]}, {"w": "5.4.1.", "b": [0.2051, 0.6766, 0.2618, 0.6964]}, {"w": "Visualizing", "b": [0.2682, 0.6766, 0.383, 0.6964]}, {"w": "intermediate", "b": [0.3893, 0.6766, 0.5154, 0.6964]}, {"w": "activations", "b": [0.5217, 0.6766, 0.631, 0.6964]}, {"w": "5.4.2.", "b": [0.2051, 0.7042, 0.2618, 0.724]}, {"w": "Visualizing", "b": [0.2682, 0.7042, 0.383, 0.724]}, {"w": "convnet", "b": [0.3893, 0.7042, 0.4691, 0.724]}, {"w": "filters", "b": [0.4754, 0.7042, 0.5343, 0.724]}, {"w": "5.4.3.", "b": [0.2051, 0.7319, 0.2618, 0.7516]}, {"w": "Visualizing", "b": [0.2682, 0.7319, 0.383, 0.7516]}, {"w": "heatmaps", "b": [0.3893, 0.7319, 0.4845, 0.7516]}, {"w": "of", "b": [0.4908, 0.7319, 0.5119, 0.7516]}, {"w": "class", "b": [0.5182, 0.7319, 0.5672, 0.7516]}, {"w": "activation", "b": [0.5735, 0.7319, 0.673, 0.7516]}, {"w": "Chapter", "b": [0.1673, 0.7702, 0.2471, 0.7899]}, {"w": "6.", "b": [0.2534, 0.7702, 0.2723, 0.7899]}, {"w": "Deep", "b": [0.2786, 0.7702, 0.3319, 0.7899]}, {"w": "learning", "b": [0.3382, 0.7702, 0.4208, 0.7899]}, {"w": "for", "b": [0.4272, 0.7702, 0.4566, 0.7899]}, {"w": "text", "b": [0.4629, 0.7702, 0.5007, 0.7899]}, {"w": "and", "b": [0.507, 0.7702, 0.5434, 0.7899]}, {"w": "sequences", "b": [0.5497, 0.7702, 0.652, 0.7899]}]}, {"id": "b_4", "type": "paragraph", "text": "6.1. Working with text data 6.1.1. One-hot encoding of words and characters 6.1.2. Using word embeddings", "words": [{"w": "6.1.", "b": [0.1862, 0.8041, 0.224, 0.8238]}, {"w": "Working", "b": [0.2303, 0.8041, 0.318, 0.8238]}, {"w": "with", "b": [0.3243, 0.8041, 0.3691, 0.8238]}, {"w": "text", "b": [0.3754, 0.8041, 0.4133, 0.8238]}, {"w": "data", "b": [0.4196, 0.8041, 0.4616, 0.8238]}, {"w": "6.1.1.", "b": [0.2051, 0.8379, 0.2618, 0.8577]}, {"w": "One-hot", "b": [0.2682, 0.8379, 0.3508, 0.8577]}, {"w": "encoding", "b": [0.3571, 0.8379, 0.4496, 0.8577]}, {"w": "of", "b": [0.4559, 0.8379, 0.4769, 0.8577]}, {"w": "words", "b": [0.4832, 0.8379, 0.5449, 0.8577]}, {"w": "and", "b": [0.5512, 0.8379, 0.5876, 0.8577]}, {"w": "characters", "b": [0.5939, 0.8379, 0.6962, 0.8577]}, {"w": "6.1.2.", "b": [0.2051, 0.8656, 0.2618, 0.8853]}, {"w": "Using", "b": [0.2682, 0.8656, 0.3284, 0.8853]}, {"w": "word", "b": [0.3347, 0.8656, 0.3866, 0.8853]}, {"w": "embeddings", "b": [0.3929, 0.8656, 0.5148, 0.8853]}]}]}, {"page": 13, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "6.1.3. Putting it all together: from raw text to word embeddings", "words": [{"w": "6.1.3.", "b": [0.2051, 0.0857, 0.2618, 0.1054]}, {"w": "Putting", "b": [0.2682, 0.0857, 0.3411, 0.1054]}, {"w": "it", "b": [0.3474, 0.0857, 0.3614, 0.1054]}, {"w": "all", "b": [0.3677, 0.0857, 0.3929, 0.1054]}, {"w": "together:", "b": [0.3992, 0.0857, 0.4889, 0.1054]}, {"w": "from", "b": [0.4952, 0.0857, 0.5442, 0.1054]}, {"w": "raw", "b": [0.5506, 0.0857, 0.5884, 0.1054]}, {"w": "text", "b": [0.5947, 0.0857, 0.6325, 0.1054]}, {"w": "to", "b": [0.6388, 0.0857, 0.6584, 0.1054]}, {"w": "word", "b": [0.6648, 0.0857, 0.7166, 0.1054]}, {"w": "embeddings", "b": [0.2051, 0.1062, 0.327, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "6.1.4. Wrapping up 6.2. Understanding recurrent neural networks 6.2.1. A recurrent layer in Keras 6.2.2. Understanding the LSTM and GRU layers 6.2.3. A concrete LSTM example in Keras 6.2.4. Wrapping up 6.3. Advanced use of recurrent neural networks 6.3.1. A temperature-forecasting problem 6.3.2. Preparing the data 6.3.3. A common-sense, non-machine-learning baseline 6.3.4. A basic machine-learning approach 6.3.5. A first recurrent baseline 6.3.6. Using recurrent dropout to fight overfitting 6.3.7. Stacking recurrent layers 6.3.8. Using bidirectional RNNs 6.3.9. Going even further 6.3.10. Wrapping up 6.4. Sequence processing with convnets 6.4.1. Understanding 1D convolution for sequence data 6.4.2. 1D pooling for sequence data 6.4.3. Implementing a 1D convnet 6.4.4. Combining CNNs and RNNs to process long sequences", "words": [{"w": "6.1.4.", "b": [0.2051, 0.1338, 0.2618, 0.1535]}, {"w": "Wrapping", "b": [0.2682, 0.1338, 0.368, 0.1535]}, {"w": "up", "b": [0.3743, 0.1338, 0.3995, 0.1535]}, {"w": "6.2.", "b": [0.1862, 0.1721, 0.224, 0.1919]}, {"w": "Understanding", "b": [0.2303, 0.1721, 0.3788, 0.1919]}, {"w": "recurrent", "b": [0.3852, 0.1721, 0.4762, 0.1919]}, {"w": "neural", "b": [0.4825, 0.1721, 0.5455, 0.1919]}, {"w": "networks", "b": [0.5518, 0.1721, 0.6443, 0.1919]}, {"w": "6.2.1.", "b": [0.2051, 0.206, 0.2618, 0.2257]}, {"w": "A", "b": [0.2682, 0.206, 0.2864, 0.2257]}, {"w": "recurrent", "b": [0.2927, 0.206, 0.3837, 0.2257]}, {"w": "layer", "b": [0.39, 0.206, 0.4404, 0.2257]}, {"w": "in", "b": [0.4468, 0.206, 0.4664, 0.2257]}, {"w": "Keras", "b": [0.4727, 0.206, 0.5315, 0.2257]}, {"w": "6.2.2.", "b": [0.2051, 0.2336, 0.2618, 0.2534]}, {"w": "Understanding", "b": [0.2682, 0.2336, 0.4167, 0.2534]}, {"w": "the", "b": [0.423, 0.2336, 0.4538, 0.2534]}, {"w": "LSTM", "b": [0.4601, 0.2336, 0.5274, 0.2534]}, {"w": "and", "b": [0.5337, 0.2336, 0.5701, 0.2534]}, {"w": "GRU", "b": [0.5764, 0.2336, 0.6297, 0.2534]}, {"w": "layers", "b": [0.636, 0.2336, 0.6962, 0.2534]}, {"w": "6.2.3.", "b": [0.2051, 0.2613, 0.2618, 0.281]}, {"w": "A", "b": [0.2682, 0.2613, 0.2864, 0.281]}, {"w": "concrete", "b": [0.2927, 0.2613, 0.3781, 0.281]}, {"w": "LSTM", "b": [0.3844, 0.2613, 0.4517, 0.281]}, {"w": "example", "b": [0.458, 0.2613, 0.5435, 0.281]}, {"w": "in", "b": [0.5498, 0.2613, 0.5694, 0.281]}, {"w": "Keras", "b": [0.5757, 0.2613, 0.6345, 0.281]}, {"w": "6.2.4.", "b": [0.2051, 0.2889, 0.2618, 0.3086]}, {"w": "Wrapping", "b": [0.2682, 0.2889, 0.368, 0.3086]}, {"w": "up", "b": [0.3743, 0.2889, 0.3995, 0.3086]}, {"w": "6.3.", "b": [0.1862, 0.3272, 0.224, 0.347]}, {"w": "Advanced", "b": [0.2303, 0.3272, 0.3326, 0.347]}, {"w": "use", "b": [0.3389, 0.3272, 0.3725, 0.347]}, {"w": "of", "b": [0.3788, 0.3272, 0.3998, 0.347]}, {"w": "recurrent", "b": [0.4061, 0.3272, 0.4972, 0.347]}, {"w": "neural", "b": [0.5035, 0.3272, 0.5665, 0.347]}, {"w": "networks", "b": [0.5728, 0.3272, 0.6653, 0.347]}, {"w": "6.3.1.", "b": [0.2051, 0.3611, 0.2618, 0.3808]}, {"w": "A", "b": [0.2682, 0.3611, 0.2864, 0.3808]}, {"w": "temperature-forecasting", "b": [0.2927, 0.3611, 0.5336, 0.3808]}, {"w": "problem", "b": [0.5399, 0.3611, 0.624, 0.3808]}, {"w": "6.3.2.", "b": [0.2051, 0.3887, 0.2618, 0.4085]}, {"w": "Preparing", "b": [0.2682, 0.3887, 0.3662, 0.4085]}, {"w": "the", "b": [0.3725, 0.3887, 0.4034, 0.4085]}, {"w": "data", "b": [0.4097, 0.3887, 0.4517, 0.4085]}, {"w": "6.3.3.", "b": [0.2051, 0.4164, 0.2618, 0.4361]}, {"w": "A", "b": [0.2682, 0.4164, 0.2864, 0.4361]}, {"w": "common-sense,", "b": [0.2927, 0.4164, 0.4503, 0.4361]}, {"w": "non-machine-learning", "b": [0.4566, 0.4164, 0.6794, 0.4361]}, {"w": "baseline", "b": [0.6857, 0.4164, 0.7684, 0.4361]}, {"w": "6.3.4.", "b": [0.2051, 0.444, 0.2618, 0.4637]}, {"w": "A", "b": [0.2682, 0.444, 0.2864, 0.4637]}, {"w": "basic", "b": [0.2927, 0.444, 0.3445, 0.4637]}, {"w": "machine-learning", "b": [0.3508, 0.444, 0.5273, 0.4637]}, {"w": "approach", "b": [0.5337, 0.444, 0.6261, 0.4637]}, {"w": "6.3.5.", "b": [0.2051, 0.4716, 0.2618, 0.4914]}, {"w": "A", "b": [0.2682, 0.4716, 0.2864, 0.4914]}, {"w": "first", "b": [0.2927, 0.4716, 0.3333, 0.4914]}, {"w": "recurrent", "b": [0.3396, 0.4716, 0.4307, 0.4914]}, {"w": "baseline", "b": [0.437, 0.4716, 0.5196, 0.4914]}, {"w": "6.3.6.", "b": [0.2051, 0.4992, 0.2618, 0.519]}, {"w": "Using", "b": [0.2682, 0.4992, 0.3284, 0.519]}, {"w": "recurrent", "b": [0.3347, 0.4992, 0.4258, 0.519]}, {"w": "dropout", "b": [0.4321, 0.4992, 0.5105, 0.519]}, {"w": "to", "b": [0.5169, 0.4992, 0.5365, 0.519]}, {"w": "fight", "b": [0.5428, 0.4992, 0.5904, 0.519]}, {"w": "overfitting", "b": [0.5967, 0.4992, 0.7032, 0.519]}, {"w": "6.3.7.", "b": [0.2051, 0.5269, 0.2618, 0.5466]}, {"w": "Stacking", "b": [0.2682, 0.5269, 0.3564, 0.5466]}, {"w": "recurrent", "b": [0.3628, 0.5269, 0.4538, 0.5466]}, {"w": "layers", "b": [0.4601, 0.5269, 0.5203, 0.5466]}, {"w": "6.3.8.", "b": [0.2051, 0.5545, 0.2618, 0.5742]}, {"w": "Using", "b": [0.2682, 0.5545, 0.3284, 0.5742]}, {"w": "bidirectional", "b": [0.3347, 0.5545, 0.4622, 0.5742]}, {"w": "RNNs", "b": [0.4685, 0.5545, 0.5316, 0.5742]}, {"w": "6.3.9.", "b": [0.2051, 0.5821, 0.2618, 0.6019]}, {"w": "Going", "b": [0.2682, 0.5821, 0.3312, 0.6019]}, {"w": "even", "b": [0.3375, 0.5821, 0.3852, 0.6019]}, {"w": "further", "b": [0.3915, 0.5821, 0.4601, 0.6019]}, {"w": "6.3.10.", "b": [0.2051, 0.6098, 0.2745, 0.6295]}, {"w": "Wrapping", "b": [0.2808, 0.6098, 0.3806, 0.6295]}, {"w": "up", "b": [0.3869, 0.6098, 0.4122, 0.6295]}, {"w": "6.4.", "b": [0.1862, 0.6481, 0.224, 0.6678]}, {"w": "Sequence", "b": [0.2303, 0.6481, 0.327, 0.6678]}, {"w": "processing", "b": [0.3333, 0.6481, 0.4412, 0.6678]}, {"w": "with", "b": [0.4475, 0.6481, 0.4923, 0.6678]}, {"w": "convnets", "b": [0.4986, 0.6481, 0.5883, 0.6678]}, {"w": "6.4.1.", "b": [0.2051, 0.682, 0.2618, 0.7017]}, {"w": "Understanding", "b": [0.2682, 0.682, 0.4167, 0.7017]}, {"w": "1D", "b": [0.423, 0.682, 0.4538, 0.7017]}, {"w": "convolution", "b": [0.4601, 0.682, 0.5807, 0.7017]}, {"w": "for", "b": [0.587, 0.682, 0.6164, 0.7017]}, {"w": "sequence", "b": [0.6227, 0.682, 0.7151, 0.7017]}, {"w": "data", "b": [0.7214, 0.682, 0.7635, 0.7017]}, {"w": "6.4.2.", "b": [0.2051, 0.7096, 0.2618, 0.7293]}, {"w": "1D", "b": [0.2682, 0.7096, 0.299, 0.7293]}, {"w": "pooling", "b": [0.3053, 0.7096, 0.3824, 0.7293]}, {"w": "for", "b": [0.3887, 0.7096, 0.4181, 0.7293]}, {"w": "sequence", "b": [0.4244, 0.7096, 0.5169, 0.7293]}, {"w": "data", "b": [0.5232, 0.7096, 0.5652, 0.7293]}, {"w": "6.4.3.", "b": [0.2051, 0.7372, 0.2618, 0.757]}, {"w": "Implementing", "b": [0.2682, 0.7372, 0.4097, 0.757]}, {"w": "a", "b": [0.416, 0.7372, 0.4272, 0.757]}, {"w": "1D", "b": [0.4335, 0.7372, 0.4643, 0.757]}, {"w": "convnet", "b": [0.4706, 0.7372, 0.5505, 0.757]}, {"w": "6.4.4.", "b": [0.2051, 0.7649, 0.2618, 0.7846]}, {"w": "Combining", "b": [0.2682, 0.7649, 0.3817, 0.7846]}, {"w": "CNNs", "b": [0.388, 0.7649, 0.4511, 0.7846]}, {"w": "and", "b": [0.4574, 0.7649, 0.4938, 0.7846]}, {"w": "RNNs", "b": [0.5001, 0.7649, 0.5632, 0.7846]}, {"w": "to", "b": [0.5695, 0.7649, 0.5891, 0.7846]}, {"w": "process", "b": [0.5954, 0.7649, 0.6711, 0.7846]}, {"w": "long", "b": [0.6774, 0.7649, 0.7222, 0.7846]}, {"w": "sequences", "b": [0.2051, 0.7854, 0.3074, 0.8051]}]}, {"id": "b_2", "type": "equation", "text": "6.4.5. Wrapping up Chapter 7. Advanced deep-learning best practices", "words": [{"w": "6.4.5.", "b": [0.2051, 0.813, 0.2618, 0.8327]}, {"w": "Wrapping", "b": [0.2682, 0.813, 0.368, 0.8327]}, {"w": "up", "b": [0.3743, 0.813, 0.3995, 0.8327]}, {"w": "Chapter", "b": [0.1673, 0.8513, 0.2471, 0.8711]}, {"w": "7.", "b": [0.2534, 0.8513, 0.2723, 0.8711]}, {"w": "Advanced", "b": [0.2786, 0.8513, 0.3809, 0.8711]}, {"w": "deep-learning", "b": [0.3872, 0.8513, 0.5259, 0.8711]}, {"w": "best", "b": [0.5322, 0.8513, 0.5729, 0.8711]}, {"w": "practices", "b": [0.5792, 0.8513, 0.6688, 0.8711]}]}]}, {"page": 14, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "7.1. Going beyond the Sequential model: the Keras functional API", "words": [{"w": "7.1.", "b": [0.1862, 0.0857, 0.224, 0.1054]}, {"w": "Going", "b": [0.2303, 0.0857, 0.2934, 0.1054]}, {"w": "beyond", "b": [0.2997, 0.0857, 0.374, 0.1054]}, {"w": "the", "b": [0.3803, 0.0857, 0.4111, 0.1054]}, {"w": "Sequential", "b": [0.4174, 0.0857, 0.5239, 0.1054]}, {"w": "model:", "b": [0.5302, 0.0857, 0.6003, 0.1054]}, {"w": "the", "b": [0.6066, 0.0857, 0.6374, 0.1054]}, {"w": "Keras", "b": [0.6437, 0.0857, 0.7025, 0.1054]}, {"w": "functional", "b": [0.1862, 0.1062, 0.2885, 0.1259]}, {"w": "API", "b": [0.2948, 0.1062, 0.3354, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "7.1.1. Introduction to the functional API 7.1.2. Multi-input models 7.1.3. Multi-output models 7.1.4. Directed acyclic graphs of layers 7.1.5. Layer weight sharing 7.1.6. Models as layers 7.1.7. Wrapping up 7.2. Inspecting and monitoring deep-learning models using Keras callbacks and TensorBoard", "words": [{"w": "7.1.1.", "b": [0.2051, 0.14, 0.2618, 0.1598]}, {"w": "Introduction", "b": [0.2682, 0.14, 0.3929, 0.1598]}, {"w": "to", "b": [0.3992, 0.14, 0.4188, 0.1598]}, {"w": "the", "b": [0.4251, 0.14, 0.4559, 0.1598]}, {"w": "functional", "b": [0.4622, 0.14, 0.5645, 0.1598]}, {"w": "API", "b": [0.5708, 0.14, 0.6115, 0.1598]}, {"w": "7.1.2.", "b": [0.2051, 0.1677, 0.2618, 0.1874]}, {"w": "Multi-input", "b": [0.2682, 0.1677, 0.3845, 0.1874]}, {"w": "models", "b": [0.3908, 0.1677, 0.4637, 0.1874]}, {"w": "7.1.3.", "b": [0.2051, 0.1953, 0.2618, 0.215]}, {"w": "Multi-output", "b": [0.2682, 0.1953, 0.3971, 0.215]}, {"w": "models", "b": [0.4034, 0.1953, 0.4763, 0.215]}, {"w": "7.1.4.", "b": [0.2051, 0.2229, 0.2618, 0.2427]}, {"w": "Directed", "b": [0.2682, 0.2229, 0.355, 0.2427]}, {"w": "acyclic", "b": [0.3613, 0.2229, 0.4328, 0.2427]}, {"w": "graphs", "b": [0.4391, 0.2229, 0.5063, 0.2427]}, {"w": "of", "b": [0.5126, 0.2229, 0.5336, 0.2427]}, {"w": "layers", "b": [0.5399, 0.2229, 0.6002, 0.2427]}, {"w": "7.1.5.", "b": [0.2051, 0.2506, 0.2618, 0.2703]}, {"w": "Layer", "b": [0.2682, 0.2506, 0.327, 0.2703]}, {"w": "weight", "b": [0.3333, 0.2506, 0.402, 0.2703]}, {"w": "sharing", "b": [0.4083, 0.2506, 0.4825, 0.2703]}, {"w": "7.1.6.", "b": [0.2051, 0.2782, 0.2618, 0.2979]}, {"w": "Models", "b": [0.2682, 0.2782, 0.3438, 0.2979]}, {"w": "as", "b": [0.3501, 0.2782, 0.3712, 0.2979]}, {"w": "layers", "b": [0.3775, 0.2782, 0.4377, 0.2979]}, {"w": "7.1.7.", "b": [0.2051, 0.3058, 0.2618, 0.3256]}, {"w": "Wrapping", "b": [0.2682, 0.3058, 0.368, 0.3256]}, {"w": "up", "b": [0.3743, 0.3058, 0.3995, 0.3256]}, {"w": "7.2.", "b": [0.1862, 0.3442, 0.224, 0.3639]}, {"w": "Inspecting", "b": [0.2303, 0.3442, 0.3354, 0.3639]}, {"w": "and", "b": [0.3417, 0.3442, 0.3781, 0.3639]}, {"w": "monitoring", "b": [0.3844, 0.3442, 0.4966, 0.3639]}, {"w": "deep-learning", "b": [0.5029, 0.3442, 0.6416, 0.3639]}, {"w": "models", "b": [0.6479, 0.3442, 0.7208, 0.3639]}, {"w": "using", "b": [0.7271, 0.3442, 0.7817, 0.3639]}, {"w": "Keras", "b": [0.1862, 0.3647, 0.245, 0.3844]}, {"w": "callbacks", "b": [0.2513, 0.3647, 0.3452, 0.3844]}, {"w": "and", "b": [0.3515, 0.3647, 0.3879, 0.3844]}, {"w": "TensorBoard", "b": [0.3942, 0.3647, 0.5241, 0.3844]}]}, {"id": "b_2", "type": "paragraph", "text": "7.2.1. Using callbacks to act on a model during training 7.2.2. Introduction to TensorBoard: the TensorFlow visualization framework", "words": [{"w": "7.2.1.", "b": [0.2051, 0.3985, 0.2618, 0.4183]}, {"w": "Using", "b": [0.2682, 0.3985, 0.3284, 0.4183]}, {"w": "callbacks", "b": [0.3347, 0.3985, 0.4286, 0.4183]}, {"w": "to", "b": [0.4349, 0.3985, 0.4545, 0.4183]}, {"w": "act", "b": [0.4608, 0.3985, 0.4902, 0.4183]}, {"w": "on", "b": [0.4965, 0.3985, 0.5218, 0.4183]}, {"w": "a", "b": [0.5281, 0.3985, 0.5393, 0.4183]}, {"w": "model", "b": [0.5456, 0.3985, 0.6087, 0.4183]}, {"w": "during", "b": [0.615, 0.3985, 0.6808, 0.4183]}, {"w": "training", "b": [0.6871, 0.3985, 0.7656, 0.4183]}, {"w": "7.2.2.", "b": [0.2051, 0.4262, 0.2618, 0.4459]}, {"w": "Introduction", "b": [0.2682, 0.4262, 0.3929, 0.4459]}, {"w": "to", "b": [0.3992, 0.4262, 0.4188, 0.4459]}, {"w": "TensorBoard:", "b": [0.4251, 0.4262, 0.562, 0.4459]}, {"w": "the", "b": [0.5683, 0.4262, 0.5992, 0.4459]}, {"w": "TensorFlow", "b": [0.6055, 0.4262, 0.7256, 0.4459]}, {"w": "visualization", "b": [0.2051, 0.4467, 0.334, 0.4664]}, {"w": "framework", "b": [0.3403, 0.4467, 0.451, 0.4664]}]}, {"id": "b_3", "type": "paragraph", "text": "7.2.3. Wrapping up 7.3. Getting the most out of your models 7.3.1. Advanced architecture patterns 7.3.2. Hyperparameter optimization 7.3.3. Model ensembling 7.3.4. Wrapping up Chapter 8. Generative deep learning", "words": [{"w": "7.2.3.", "b": [0.2051, 0.4743, 0.2618, 0.494]}, {"w": "Wrapping", "b": [0.2682, 0.4743, 0.368, 0.494]}, {"w": "up", "b": [0.3743, 0.4743, 0.3995, 0.494]}, {"w": "7.3.", "b": [0.1862, 0.5126, 0.224, 0.5324]}, {"w": "Getting", "b": [0.2303, 0.5126, 0.306, 0.5324]}, {"w": "the", "b": [0.3123, 0.5126, 0.3431, 0.5324]}, {"w": "most", "b": [0.3494, 0.5126, 0.3985, 0.5324]}, {"w": "out", "b": [0.4048, 0.5126, 0.437, 0.5324]}, {"w": "of", "b": [0.4433, 0.5126, 0.4644, 0.5324]}, {"w": "your", "b": [0.4707, 0.5126, 0.5169, 0.5324]}, {"w": "models", "b": [0.5232, 0.5126, 0.5961, 0.5324]}, {"w": "7.3.1.", "b": [0.2051, 0.5465, 0.2618, 0.5662]}, {"w": "Advanced", "b": [0.2682, 0.5465, 0.3704, 0.5662]}, {"w": "architecture", "b": [0.3767, 0.5465, 0.4958, 0.5662]}, {"w": "patterns", "b": [0.5021, 0.5465, 0.582, 0.5662]}, {"w": "7.3.2.", "b": [0.2051, 0.5741, 0.2618, 0.5939]}, {"w": "Hyperparameter", "b": [0.2682, 0.5741, 0.432, 0.5939]}, {"w": "optimization", "b": [0.4384, 0.5741, 0.5659, 0.5939]}, {"w": "7.3.3.", "b": [0.2051, 0.6017, 0.2618, 0.6215]}, {"w": "Model", "b": [0.2682, 0.6017, 0.334, 0.6215]}, {"w": "ensembling", "b": [0.3403, 0.6017, 0.4566, 0.6215]}, {"w": "7.3.4.", "b": [0.2051, 0.6294, 0.2618, 0.6491]}, {"w": "Wrapping", "b": [0.2682, 0.6294, 0.368, 0.6491]}, {"w": "up", "b": [0.3743, 0.6294, 0.3995, 0.6491]}, {"w": "Chapter", "b": [0.1673, 0.6677, 0.2471, 0.6874]}, {"w": "8.", "b": [0.2534, 0.6677, 0.2723, 0.6874]}, {"w": "Generative", "b": [0.2786, 0.6677, 0.3893, 0.6874]}, {"w": "deep", "b": [0.3956, 0.6677, 0.4432, 0.6874]}, {"w": "learning", "b": [0.4496, 0.6677, 0.5322, 0.6874]}]}, {"id": "b_4", "type": "paragraph", "text": "8.1. Text generation with LSTM 8.1.1. A brief history of generative recurrent networks 8.1.2. How do you generate sequence data? 8.1.3. The importance of the sampling strategy 8.1.4. Implementing character-level LSTM text generation", "words": [{"w": "8.1.", "b": [0.1862, 0.7016, 0.224, 0.7213]}, {"w": "Text", "b": [0.2303, 0.7016, 0.2748, 0.7213]}, {"w": "generation", "b": [0.2811, 0.7016, 0.3876, 0.7213]}, {"w": "with", "b": [0.3939, 0.7016, 0.4387, 0.7213]}, {"w": "LSTM", "b": [0.445, 0.7016, 0.5123, 0.7213]}, {"w": "8.1.1.", "b": [0.2051, 0.7354, 0.2618, 0.7552]}, {"w": "A", "b": [0.2682, 0.7354, 0.2864, 0.7552]}, {"w": "brief", "b": [0.2927, 0.7354, 0.3403, 0.7552]}, {"w": "history", "b": [0.3466, 0.7354, 0.4167, 0.7552]}, {"w": "of", "b": [0.423, 0.7354, 0.444, 0.7552]}, {"w": "generative", "b": [0.4503, 0.7354, 0.5554, 0.7552]}, {"w": "recurrent", "b": [0.5617, 0.7354, 0.6527, 0.7552]}, {"w": "networks", "b": [0.659, 0.7354, 0.7515, 0.7552]}, {"w": "8.1.2.", "b": [0.2051, 0.7631, 0.2618, 0.7828]}, {"w": "How", "b": [0.2682, 0.7631, 0.3172, 0.7828]}, {"w": "do", "b": [0.3235, 0.7631, 0.3487, 0.7828]}, {"w": "you", "b": [0.355, 0.7631, 0.3929, 0.7828]}, {"w": "generate", "b": [0.3992, 0.7631, 0.4846, 0.7828]}, {"w": "sequence", "b": [0.4909, 0.7631, 0.5834, 0.7828]}, {"w": "data?", "b": [0.5897, 0.7631, 0.6429, 0.7828]}, {"w": "8.1.3.", "b": [0.2051, 0.7907, 0.2618, 0.8104]}, {"w": "The", "b": [0.2682, 0.7907, 0.3074, 0.8104]}, {"w": "importance", "b": [0.3137, 0.7907, 0.4272, 0.8104]}, {"w": "of", "b": [0.4335, 0.7907, 0.4545, 0.8104]}, {"w": "the", "b": [0.4608, 0.7907, 0.4916, 0.8104]}, {"w": "sampling", "b": [0.4979, 0.7907, 0.5904, 0.8104]}, {"w": "strategy", "b": [0.5967, 0.7907, 0.6766, 0.8104]}, {"w": "8.1.4.", "b": [0.2051, 0.8183, 0.2618, 0.8381]}, {"w": "Implementing", "b": [0.2682, 0.8183, 0.4097, 0.8381]}, {"w": "character-level", "b": [0.416, 0.8183, 0.5653, 0.8381]}, {"w": "LSTM", "b": [0.5716, 0.8183, 0.6389, 0.8381]}, {"w": "text", "b": [0.6452, 0.8183, 0.683, 0.8381]}, {"w": "generation", "b": [0.2051, 0.8388, 0.3116, 0.8586]}]}, {"id": "b_5", "type": "paragraph", "text": "8.1.5. Wrapping up", "words": [{"w": "8.1.5.", "b": [0.2051, 0.8665, 0.2618, 0.8862]}, {"w": "Wrapping", "b": [0.2682, 0.8665, 0.368, 0.8862]}, {"w": "up", "b": [0.3743, 0.8665, 0.3995, 0.8862]}]}]}, {"page": 15, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "8.2. DeepDream 8.2.1. Implementing DeepDream in Keras 8.2.2. Wrapping up 8.3. Neural style transfer 8.3.1. The content loss 8.3.2. The style loss 8.3.3. Neural style transfer in Keras 8.3.4. Wrapping up 8.4. Generating images with variational autoencoders 8.4.1. Sampling from latent spaces of images 8.4.2. Concept vectors for image editing 8.4.3. Variational autoencoders 8.4.4. Wrapping up 8.5. Introduction to generative adversarial networks 8.5.1. A schematic GAN implementation 8.5.2. A bag of tricks 8.5.3. The generator 8.5.4. The discriminator 8.5.5. The adversarial network 8.5.6. How to train your DCGAN 8.5.7. Wrapping up Chapter 9. Conclusions", "words": [{"w": "8.2.", "b": [0.1862, 0.0857, 0.224, 0.1054]}, {"w": "DeepDream", "b": [0.2303, 0.0857, 0.3522, 0.1054]}, {"w": "8.2.1.", "b": [0.2051, 0.1195, 0.2618, 0.1393]}, {"w": "Implementing", "b": [0.2682, 0.1195, 0.4097, 0.1393]}, {"w": "DeepDream", "b": [0.416, 0.1195, 0.5379, 0.1393]}, {"w": "in", "b": [0.5442, 0.1195, 0.5638, 0.1393]}, {"w": "Keras", "b": [0.5701, 0.1195, 0.6289, 0.1393]}, {"w": "8.2.2.", "b": [0.2051, 0.1472, 0.2618, 0.1669]}, {"w": "Wrapping", "b": [0.2682, 0.1472, 0.368, 0.1669]}, {"w": "up", "b": [0.3743, 0.1472, 0.3995, 0.1669]}, {"w": "8.3.", "b": [0.1862, 0.1855, 0.224, 0.2052]}, {"w": "Neural", "b": [0.2303, 0.1855, 0.299, 0.2052]}, {"w": "style", "b": [0.3053, 0.1855, 0.3529, 0.2052]}, {"w": "transfer", "b": [0.3592, 0.1855, 0.4363, 0.2052]}, {"w": "8.3.1.", "b": [0.2051, 0.2194, 0.2618, 0.2391]}, {"w": "The", "b": [0.2682, 0.2194, 0.3074, 0.2391]}, {"w": "content", "b": [0.3137, 0.2194, 0.388, 0.2391]}, {"w": "loss", "b": [0.3943, 0.2194, 0.4335, 0.2391]}, {"w": "8.3.2.", "b": [0.2051, 0.247, 0.2618, 0.2667]}, {"w": "The", "b": [0.2682, 0.247, 0.3074, 0.2667]}, {"w": "style", "b": [0.3137, 0.247, 0.3613, 0.2667]}, {"w": "loss", "b": [0.3676, 0.247, 0.4069, 0.2667]}, {"w": "8.3.3.", "b": [0.2051, 0.2746, 0.2618, 0.2944]}, {"w": "Neural", "b": [0.2682, 0.2746, 0.3368, 0.2944]}, {"w": "style", "b": [0.3431, 0.2746, 0.3908, 0.2944]}, {"w": "transfer", "b": [0.3971, 0.2746, 0.4741, 0.2944]}, {"w": "in", "b": [0.4804, 0.2746, 0.5, 0.2944]}, {"w": "Keras", "b": [0.5063, 0.2746, 0.5652, 0.2944]}, {"w": "8.3.4.", "b": [0.2051, 0.3023, 0.2618, 0.322]}, {"w": "Wrapping", "b": [0.2682, 0.3023, 0.368, 0.322]}, {"w": "up", "b": [0.3743, 0.3023, 0.3995, 0.322]}, {"w": "8.4.", "b": [0.1862, 0.3406, 0.224, 0.3603]}, {"w": "Generating", "b": [0.2303, 0.3406, 0.3424, 0.3603]}, {"w": "images", "b": [0.3487, 0.3406, 0.4202, 0.3603]}, {"w": "with", "b": [0.4265, 0.3406, 0.4713, 0.3603]}, {"w": "variational", "b": [0.4776, 0.3406, 0.5855, 0.3603]}, {"w": "autoencoders", "b": [0.5918, 0.3406, 0.7249, 0.3603]}, {"w": "8.4.1.", "b": [0.2051, 0.3745, 0.2618, 0.3942]}, {"w": "Sampling", "b": [0.2682, 0.3745, 0.3649, 0.3942]}, {"w": "from", "b": [0.3712, 0.3745, 0.4202, 0.3942]}, {"w": "latent", "b": [0.4265, 0.3745, 0.4826, 0.3942]}, {"w": "spaces", "b": [0.4889, 0.3745, 0.5547, 0.3942]}, {"w": "of", "b": [0.561, 0.3745, 0.582, 0.3942]}, {"w": "images", "b": [0.5883, 0.3745, 0.6598, 0.3942]}, {"w": "8.4.2.", "b": [0.2051, 0.4021, 0.2618, 0.4218]}, {"w": "Concept", "b": [0.2682, 0.4021, 0.3522, 0.4218]}, {"w": "vectors", "b": [0.3585, 0.4021, 0.4314, 0.4218]}, {"w": "for", "b": [0.4377, 0.4021, 0.4671, 0.4218]}, {"w": "image", "b": [0.4734, 0.4021, 0.5351, 0.4218]}, {"w": "editing", "b": [0.5414, 0.4021, 0.6115, 0.4218]}, {"w": "8.4.3.", "b": [0.2051, 0.4297, 0.2618, 0.4495]}, {"w": "Variational", "b": [0.2682, 0.4297, 0.3789, 0.4495]}, {"w": "autoencoders", "b": [0.3852, 0.4297, 0.5183, 0.4495]}, {"w": "8.4.4.", "b": [0.2051, 0.4574, 0.2618, 0.4771]}, {"w": "Wrapping", "b": [0.2682, 0.4574, 0.368, 0.4771]}, {"w": "up", "b": [0.3743, 0.4574, 0.3995, 0.4771]}, {"w": "8.5.", "b": [0.1862, 0.4957, 0.224, 0.5154]}, {"w": "Introduction", "b": [0.2303, 0.4957, 0.355, 0.5154]}, {"w": "to", "b": [0.3613, 0.4957, 0.381, 0.5154]}, {"w": "generative", "b": [0.3873, 0.4957, 0.4923, 0.5154]}, {"w": "adversarial", "b": [0.4986, 0.4957, 0.6093, 0.5154]}, {"w": "networks", "b": [0.6156, 0.4957, 0.7081, 0.5154]}, {"w": "8.5.1.", "b": [0.2051, 0.5296, 0.2618, 0.5493]}, {"w": "A", "b": [0.2682, 0.5296, 0.2864, 0.5493]}, {"w": "schematic", "b": [0.2927, 0.5296, 0.3936, 0.5493]}, {"w": "GAN", "b": [0.3999, 0.5296, 0.4545, 0.5493]}, {"w": "implementation", "b": [0.4608, 0.5296, 0.6192, 0.5493]}, {"w": "8.5.2.", "b": [0.2051, 0.5572, 0.2618, 0.5769]}, {"w": "A", "b": [0.2682, 0.5572, 0.2864, 0.5769]}, {"w": "bag", "b": [0.2927, 0.5572, 0.3291, 0.5769]}, {"w": "of", "b": [0.3354, 0.5572, 0.3564, 0.5769]}, {"w": "tricks", "b": [0.3627, 0.5572, 0.4188, 0.5769]}, {"w": "8.5.3.", "b": [0.2051, 0.5848, 0.2618, 0.6046]}, {"w": "The", "b": [0.2682, 0.5848, 0.3074, 0.6046]}, {"w": "generator", "b": [0.3137, 0.5848, 0.4089, 0.6046]}, {"w": "8.5.4.", "b": [0.2051, 0.6124, 0.2618, 0.6322]}, {"w": "The", "b": [0.2682, 0.6124, 0.3074, 0.6322]}, {"w": "discriminator", "b": [0.3137, 0.6124, 0.4482, 0.6322]}, {"w": "8.5.5.", "b": [0.2051, 0.6401, 0.2618, 0.6598]}, {"w": "The", "b": [0.2682, 0.6401, 0.3074, 0.6598]}, {"w": "adversarial", "b": [0.3137, 0.6401, 0.4244, 0.6598]}, {"w": "network", "b": [0.4307, 0.6401, 0.5133, 0.6598]}, {"w": "8.5.6.", "b": [0.2051, 0.6677, 0.2618, 0.6874]}, {"w": "How", "b": [0.2682, 0.6677, 0.3172, 0.6874]}, {"w": "to", "b": [0.3235, 0.6677, 0.3431, 0.6874]}, {"w": "train", "b": [0.3494, 0.6677, 0.3957, 0.6874]}, {"w": "your", "b": [0.402, 0.6677, 0.4482, 0.6874]}, {"w": "DCGAN", "b": [0.4545, 0.6677, 0.5442, 0.6874]}, {"w": "8.5.7.", "b": [0.2051, 0.6953, 0.2618, 0.7151]}, {"w": "Wrapping", "b": [0.2682, 0.6953, 0.368, 0.7151]}, {"w": "up", "b": [0.3743, 0.6953, 0.3995, 0.7151]}, {"w": "Chapter", "b": [0.1673, 0.7337, 0.2471, 0.7534]}, {"w": "9.", "b": [0.2534, 0.7337, 0.2723, 0.7534]}, {"w": "Conclusions", "b": [0.2786, 0.7337, 0.4034, 0.7534]}]}, {"id": "b_1", "type": "paragraph", "text": "9.1. Key concepts in review 9.1.1. Various approaches to AI 9.1.2. What makes deep learning special within the field of machine learning", "words": [{"w": "9.1.", "b": [0.1862, 0.7675, 0.224, 0.7873]}, {"w": "Key", "b": [0.2303, 0.7675, 0.2723, 0.7873]}, {"w": "concepts", "b": [0.2786, 0.7675, 0.3669, 0.7873]}, {"w": "in", "b": [0.3732, 0.7675, 0.3928, 0.7873]}, {"w": "review", "b": [0.3992, 0.7675, 0.4678, 0.7873]}, {"w": "9.1.1.", "b": [0.2051, 0.8014, 0.2618, 0.8211]}, {"w": "Various", "b": [0.2682, 0.8014, 0.3452, 0.8211]}, {"w": "approaches", "b": [0.3515, 0.8014, 0.465, 0.8211]}, {"w": "to", "b": [0.4713, 0.8014, 0.4909, 0.8211]}, {"w": "AI", "b": [0.4972, 0.8014, 0.5239, 0.8211]}, {"w": "9.1.2.", "b": [0.2051, 0.829, 0.2618, 0.8488]}, {"w": "What", "b": [0.2682, 0.829, 0.3228, 0.8488]}, {"w": "makes", "b": [0.3291, 0.829, 0.3936, 0.8488]}, {"w": "deep", "b": [0.3999, 0.829, 0.4475, 0.8488]}, {"w": "learning", "b": [0.4538, 0.829, 0.5365, 0.8488]}, {"w": "special", "b": [0.5428, 0.829, 0.6128, 0.8488]}, {"w": "within", "b": [0.6191, 0.829, 0.6836, 0.8488]}, {"w": "the", "b": [0.6899, 0.829, 0.7207, 0.8488]}, {"w": "field", "b": [0.2051, 0.8495, 0.2513, 0.8693]}, {"w": "of", "b": [0.2576, 0.8495, 0.2786, 0.8693]}, {"w": "machine", "b": [0.285, 0.8495, 0.3704, 0.8693]}, {"w": "learning", "b": [0.3767, 0.8495, 0.4594, 0.8693]}]}, {"id": "b_2", "type": "paragraph", "text": "9.1.3. How to think about deep learning", "words": [{"w": "9.1.3.", "b": [0.2051, 0.8772, 0.2618, 0.8969]}, {"w": "How", "b": [0.2682, 0.8772, 0.3172, 0.8969]}, {"w": "to", "b": [0.3235, 0.8772, 0.3431, 0.8969]}, {"w": "think", "b": [0.3494, 0.8772, 0.4013, 0.8969]}, {"w": "about", "b": [0.4076, 0.8772, 0.4637, 0.8969]}, {"w": "deep", "b": [0.47, 0.8772, 0.5176, 0.8969]}, {"w": "learning", "b": [0.5239, 0.8772, 0.6066, 0.8969]}]}]}, {"page": 16, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "9.1.4. Key enabling technologies 9.1.5. The universal machine-learning workflow 9.1.6. Key network architectures 9.1.7. The space of possibilities 9.2. The limitations of deep learning 9.2.1. The risk of anthropomorphizing machine- learning models", "words": [{"w": "9.1.4.", "b": [0.2051, 0.0857, 0.2618, 0.1054]}, {"w": "Key", "b": [0.2682, 0.0857, 0.3102, 0.1054]}, {"w": "enabling", "b": [0.3165, 0.0857, 0.4034, 0.1054]}, {"w": "technologies", "b": [0.4097, 0.0857, 0.5372, 0.1054]}, {"w": "9.1.5.", "b": [0.2051, 0.1133, 0.2618, 0.133]}, {"w": "The", "b": [0.2682, 0.1133, 0.3074, 0.133]}, {"w": "universal", "b": [0.3137, 0.1133, 0.4062, 0.133]}, {"w": "machine-learning", "b": [0.4125, 0.1133, 0.589, 0.133]}, {"w": "workflow", "b": [0.5953, 0.1133, 0.6934, 0.133]}, {"w": "9.1.6.", "b": [0.2051, 0.1409, 0.2618, 0.1607]}, {"w": "Key", "b": [0.2682, 0.1409, 0.3102, 0.1607]}, {"w": "network", "b": [0.3165, 0.1409, 0.3992, 0.1607]}, {"w": "architectures", "b": [0.4055, 0.1409, 0.5343, 0.1607]}, {"w": "9.1.7.", "b": [0.2051, 0.1686, 0.2618, 0.1883]}, {"w": "The", "b": [0.2682, 0.1686, 0.3074, 0.1883]}, {"w": "space", "b": [0.3137, 0.1686, 0.3697, 0.1883]}, {"w": "of", "b": [0.376, 0.1686, 0.397, 0.1883]}, {"w": "possibilities", "b": [0.4033, 0.1686, 0.5239, 0.1883]}, {"w": "9.2.", "b": [0.1862, 0.2069, 0.224, 0.2266]}, {"w": "The", "b": [0.2303, 0.2069, 0.2695, 0.2266]}, {"w": "limitations", "b": [0.2758, 0.2069, 0.3838, 0.2266]}, {"w": "of", "b": [0.3901, 0.2069, 0.4111, 0.2266]}, {"w": "deep", "b": [0.4174, 0.2069, 0.465, 0.2266]}, {"w": "learning", "b": [0.4713, 0.2069, 0.554, 0.2266]}, {"w": "9.2.1.", "b": [0.2051, 0.2408, 0.2618, 0.2605]}, {"w": "The", "b": [0.2682, 0.2408, 0.3074, 0.2605]}, {"w": "risk", "b": [0.3137, 0.2408, 0.3515, 0.2605]}, {"w": "of", "b": [0.3578, 0.2408, 0.3788, 0.2605]}, {"w": "anthropomorphizing", "b": [0.3852, 0.2408, 0.5911, 0.2605]}, {"w": "machine-", "b": [0.5975, 0.2408, 0.6913, 0.2605]}, {"w": "learning", "b": [0.2051, 0.2613, 0.2878, 0.281]}, {"w": "models", "b": [0.2941, 0.2613, 0.3669, 0.281]}]}, {"id": "b_1", "type": "paragraph", "text": "9.2.2. Local generalization vs. extreme generalization 9.2.3. Wrapping up 9.3. The future of deep learning 9.3.1. Models as programs 9.3.2. Beyond backpropagation and differentiable layers", "words": [{"w": "9.2.2.", "b": [0.2051, 0.2889, 0.2618, 0.3086]}, {"w": "Local", "b": [0.2682, 0.2889, 0.3256, 0.3086]}, {"w": "generalization", "b": [0.3319, 0.2889, 0.4748, 0.3086]}, {"w": "vs.", "b": [0.4811, 0.2889, 0.5098, 0.3086]}, {"w": "extreme", "b": [0.5161, 0.2889, 0.5974, 0.3086]}, {"w": "generalization", "b": [0.6037, 0.2889, 0.7466, 0.3086]}, {"w": "9.2.3.", "b": [0.2051, 0.3165, 0.2618, 0.3363]}, {"w": "Wrapping", "b": [0.2682, 0.3165, 0.368, 0.3363]}, {"w": "up", "b": [0.3743, 0.3165, 0.3995, 0.3363]}, {"w": "9.3.", "b": [0.1862, 0.3549, 0.224, 0.3746]}, {"w": "The", "b": [0.2303, 0.3549, 0.2695, 0.3746]}, {"w": "future", "b": [0.2758, 0.3549, 0.3361, 0.3746]}, {"w": "of", "b": [0.3424, 0.3549, 0.3634, 0.3746]}, {"w": "deep", "b": [0.3697, 0.3549, 0.4173, 0.3746]}, {"w": "learning", "b": [0.4236, 0.3549, 0.5063, 0.3746]}, {"w": "9.3.1.", "b": [0.2051, 0.3887, 0.2618, 0.4085]}, {"w": "Models", "b": [0.2682, 0.3887, 0.3438, 0.4085]}, {"w": "as", "b": [0.3501, 0.3887, 0.3712, 0.4085]}, {"w": "programs", "b": [0.3775, 0.3887, 0.4727, 0.4085]}, {"w": "9.3.2.", "b": [0.2051, 0.4164, 0.2618, 0.4361]}, {"w": "Beyond", "b": [0.2682, 0.4164, 0.3466, 0.4361]}, {"w": "backpropagation", "b": [0.3529, 0.4164, 0.5211, 0.4361]}, {"w": "and", "b": [0.5274, 0.4164, 0.5638, 0.4361]}, {"w": "differentiable", "b": [0.5701, 0.4164, 0.7055, 0.4361]}, {"w": "layers", "b": [0.2051, 0.4369, 0.2653, 0.4566]}]}, {"id": "b_2", "type": "paragraph", "text": "9.3.3. Automated machine learning 9.3.4. Lifelong learning and modular subroutine reuse 9.3.5. The long-term vision 9.4. Staying up to date in a fast-moving field 9.4.1. Practice on real-world problems using Kaggle 9.4.2. Read about the latest developments on arXiv 9.4.3. Explore the Keras ecosystem 9.5. Final words Appendix A. Installing Keras and its dependencies on Ubuntu", "words": [{"w": "9.3.3.", "b": [0.2051, 0.4645, 0.2618, 0.4842]}, {"w": "Automated", "b": [0.2682, 0.4645, 0.3803, 0.4842]}, {"w": "machine", "b": [0.3866, 0.4645, 0.472, 0.4842]}, {"w": "learning", "b": [0.4783, 0.4645, 0.561, 0.4842]}, {"w": "9.3.4.", "b": [0.2051, 0.4921, 0.2618, 0.5119]}, {"w": "Lifelong", "b": [0.2682, 0.4921, 0.355, 0.5119]}, {"w": "learning", "b": [0.3613, 0.4921, 0.444, 0.5119]}, {"w": "and", "b": [0.4503, 0.4921, 0.4867, 0.5119]}, {"w": "modular", "b": [0.493, 0.4921, 0.5771, 0.5119]}, {"w": "subroutine", "b": [0.5834, 0.4921, 0.6899, 0.5119]}, {"w": "reuse", "b": [0.6962, 0.4921, 0.7495, 0.5119]}, {"w": "9.3.5.", "b": [0.2051, 0.5197, 0.2618, 0.5395]}, {"w": "The", "b": [0.2682, 0.5197, 0.3074, 0.5395]}, {"w": "long-term", "b": [0.3137, 0.5197, 0.4132, 0.5395]}, {"w": "vision", "b": [0.4195, 0.5197, 0.4812, 0.5395]}, {"w": "9.4.", "b": [0.1862, 0.5581, 0.224, 0.5778]}, {"w": "Staying", "b": [0.2303, 0.5581, 0.3074, 0.5778]}, {"w": "up", "b": [0.3137, 0.5581, 0.3389, 0.5778]}, {"w": "to", "b": [0.3452, 0.5581, 0.3649, 0.5778]}, {"w": "date", "b": [0.3712, 0.5581, 0.4132, 0.5778]}, {"w": "in", "b": [0.4195, 0.5581, 0.4391, 0.5778]}, {"w": "a", "b": [0.4454, 0.5581, 0.4566, 0.5778]}, {"w": "fast-moving", "b": [0.4629, 0.5581, 0.5849, 0.5778]}, {"w": "field", "b": [0.5912, 0.5581, 0.6374, 0.5778]}, {"w": "9.4.1.", "b": [0.2051, 0.5919, 0.2618, 0.6117]}, {"w": "Practice", "b": [0.2682, 0.5919, 0.3494, 0.6117]}, {"w": "on", "b": [0.3557, 0.5919, 0.3809, 0.6117]}, {"w": "real-world", "b": [0.3872, 0.5919, 0.4923, 0.6117]}, {"w": "problems", "b": [0.4986, 0.5919, 0.5925, 0.6117]}, {"w": "using", "b": [0.5988, 0.5919, 0.6535, 0.6117]}, {"w": "Kaggle", "b": [0.6598, 0.5919, 0.7326, 0.6117]}, {"w": "9.4.2.", "b": [0.2051, 0.6196, 0.2618, 0.6393]}, {"w": "Read", "b": [0.2682, 0.6196, 0.32, 0.6393]}, {"w": "about", "b": [0.3263, 0.6196, 0.3824, 0.6393]}, {"w": "the", "b": [0.3887, 0.6196, 0.4195, 0.6393]}, {"w": "latest", "b": [0.4258, 0.6196, 0.479, 0.6393]}, {"w": "developments", "b": [0.4853, 0.6196, 0.6255, 0.6393]}, {"w": "on", "b": [0.6318, 0.6196, 0.657, 0.6393]}, {"w": "arXiv", "b": [0.6633, 0.6196, 0.7208, 0.6393]}, {"w": "9.4.3.", "b": [0.2051, 0.6472, 0.2618, 0.6669]}, {"w": "Explore", "b": [0.2682, 0.6472, 0.348, 0.6669]}, {"w": "the", "b": [0.3543, 0.6472, 0.3852, 0.6669]}, {"w": "Keras", "b": [0.3915, 0.6472, 0.4503, 0.6669]}, {"w": "ecosystem", "b": [0.4566, 0.6472, 0.5617, 0.6669]}, {"w": "9.5.", "b": [0.1862, 0.6855, 0.224, 0.7053]}, {"w": "Final", "b": [0.2303, 0.6855, 0.2822, 0.7053]}, {"w": "words", "b": [0.2885, 0.6855, 0.3501, 0.7053]}, {"w": "Appendix", "b": [0.1483, 0.7239, 0.2478, 0.7436]}, {"w": "A.", "b": [0.2541, 0.7239, 0.2786, 0.7436]}, {"w": "Installing", "b": [0.285, 0.7239, 0.3803, 0.7436]}, {"w": "Keras", "b": [0.3866, 0.7239, 0.4454, 0.7436]}, {"w": "and", "b": [0.4517, 0.7239, 0.4881, 0.7436]}, {"w": "its", "b": [0.4944, 0.7239, 0.5183, 0.7436]}, {"w": "dependencies", "b": [0.5246, 0.7239, 0.6605, 0.7436]}, {"w": "on", "b": [0.6668, 0.7239, 0.692, 0.7436]}, {"w": "Ubuntu", "b": [0.6983, 0.7239, 0.774, 0.7436]}]}, {"id": "b_3", "type": "paragraph", "text": "A.1. Installing the Python scientific suite", "words": [{"w": "A.1.", "b": [0.1673, 0.7577, 0.2107, 0.7775]}, {"w": "Installing", "b": [0.217, 0.7577, 0.3123, 0.7775]}, {"w": "the", "b": [0.3186, 0.7577, 0.3494, 0.7775]}, {"w": "Python", "b": [0.3557, 0.7577, 0.4272, 0.7775]}, {"w": "scientific", "b": [0.4335, 0.7577, 0.526, 0.7775]}, {"w": "suite", "b": [0.5323, 0.7577, 0.58, 0.7775]}]}, {"id": "b_4", "type": "paragraph", "text": "A.2. Setting up GPU support", "words": [{"w": "A.2.", "b": [0.1673, 0.7854, 0.2107, 0.8051]}, {"w": "Setting", "b": [0.217, 0.7854, 0.2885, 0.8051]}, {"w": "up", "b": [0.2948, 0.7854, 0.32, 0.8051]}, {"w": "GPU", "b": [0.3263, 0.7854, 0.3768, 0.8051]}, {"w": "support", "b": [0.3831, 0.7854, 0.4588, 0.8051]}]}, {"id": "b_5", "type": "paragraph", "text": "A.3. Installing Theano (optional)", "words": [{"w": "A.3.", "b": [0.1673, 0.813, 0.2107, 0.8327]}, {"w": "Installing", "b": [0.217, 0.813, 0.3123, 0.8327]}, {"w": "Theano", "b": [0.3186, 0.813, 0.3943, 0.8327]}, {"w": "(optional)", "b": [0.4006, 0.813, 0.5001, 0.8327]}]}, {"id": "b_6", "type": "paragraph", "text": "A.4. Installing Keras", "words": [{"w": "A.4.", "b": [0.1673, 0.8406, 0.2107, 0.8604]}, {"w": "Installing", "b": [0.217, 0.8406, 0.3123, 0.8604]}, {"w": "Keras", "b": [0.3186, 0.8406, 0.3774, 0.8604]}]}, {"id": "b_7", "type": "paragraph", "text": "Appendix B. Running Jupyter notebooks on an EC2 GPU instance", "words": [{"w": "Appendix", "b": [0.1483, 0.8789, 0.2478, 0.8987]}, {"w": "B.", "b": [0.2541, 0.8789, 0.2773, 0.8987]}, {"w": "Running", "b": [0.2836, 0.8789, 0.3705, 0.8987]}, {"w": "Jupyter", "b": [0.3768, 0.8789, 0.451, 0.8987]}, {"w": "notebooks", "b": [0.4573, 0.8789, 0.561, 0.8987]}, {"w": "on", "b": [0.5674, 0.8789, 0.5926, 0.8987]}, {"w": "an", "b": [0.5989, 0.8789, 0.6227, 0.8987]}, {"w": "EC2", "b": [0.629, 0.8789, 0.6739, 0.8987]}, {"w": "GPU", "b": [0.6802, 0.8789, 0.7306, 0.8987]}, {"w": "instance", "b": [0.7369, 0.8789, 0.8196, 0.8987]}]}]}, {"page": 17, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "B.1. What are Jupyter notebooks? Why run Jupyter notebooks on AWS GPUs?", "words": [{"w": "B.1.", "b": [0.1673, 0.0857, 0.2093, 0.1054]}, {"w": "What", "b": [0.2156, 0.0857, 0.2702, 0.1054]}, {"w": "are", "b": [0.2766, 0.0857, 0.3074, 0.1054]}, {"w": "Jupyter", "b": [0.3137, 0.0857, 0.3879, 0.1054]}, {"w": "notebooks?", "b": [0.3942, 0.0857, 0.5091, 0.1054]}, {"w": "Why", "b": [0.5154, 0.0857, 0.5645, 0.1054]}, {"w": "run", "b": [0.5708, 0.0857, 0.6044, 0.1054]}, {"w": "Jupyter", "b": [0.6107, 0.0857, 0.685, 0.1054]}, {"w": "notebooks", "b": [0.6913, 0.0857, 0.795, 0.1054]}, {"w": "on", "b": [0.1673, 0.1062, 0.1925, 0.1259]}, {"w": "AWS", "b": [0.1988, 0.1062, 0.2528, 0.1259]}, {"w": "GPUs?", "b": [0.2591, 0.1062, 0.3306, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "B.2. Why would you not want to use Jupyter on AWS for deep learning?", "words": [{"w": "B.2.", "b": [0.1673, 0.1338, 0.2093, 0.1535]}, {"w": "Why", "b": [0.2156, 0.1338, 0.2646, 0.1535]}, {"w": "would", "b": [0.271, 0.1338, 0.334, 0.1535]}, {"w": "you", "b": [0.3403, 0.1338, 0.3782, 0.1535]}, {"w": "not", "b": [0.3845, 0.1338, 0.4167, 0.1535]}, {"w": "want", "b": [0.423, 0.1338, 0.4721, 0.1535]}, {"w": "to", "b": [0.4784, 0.1338, 0.498, 0.1535]}, {"w": "use", "b": [0.5043, 0.1338, 0.5379, 0.1535]}, {"w": "Jupyter", "b": [0.5442, 0.1338, 0.6185, 0.1535]}, {"w": "on", "b": [0.6248, 0.1338, 0.65, 0.1535]}, {"w": "AWS", "b": [0.6563, 0.1338, 0.7103, 0.1535]}, {"w": "for", "b": [0.7166, 0.1338, 0.7461, 0.1535]}, {"w": "deep", "b": [0.7524, 0.1338, 0.8, 0.1535]}, {"w": "learning?", "b": [0.1673, 0.1543, 0.2611, 0.174]}]}, {"id": "b_2", "type": "paragraph", "text": "B.3. Setting up an AWS GPU instance", "words": [{"w": "B.3.", "b": [0.1673, 0.1819, 0.2093, 0.2017]}, {"w": "Setting", "b": [0.2156, 0.1819, 0.2871, 0.2017]}, {"w": "up", "b": [0.2934, 0.1819, 0.3186, 0.2017]}, {"w": "an", "b": [0.3249, 0.1819, 0.3488, 0.2017]}, {"w": "AWS", "b": [0.3551, 0.1819, 0.4091, 0.2017]}, {"w": "GPU", "b": [0.4154, 0.1819, 0.4658, 0.2017]}, {"w": "instance", "b": [0.4721, 0.1819, 0.5548, 0.2017]}]}, {"id": "b_3", "type": "paragraph", "text": "B.3.1. Configuring Jupyter", "words": [{"w": "B.3.1.", "b": [0.1862, 0.2158, 0.2471, 0.2355]}, {"w": "Configuring", "b": [0.2534, 0.2158, 0.3768, 0.2355]}, {"w": "Jupyter", "b": [0.3831, 0.2158, 0.4573, 0.2355]}]}, {"id": "b_4", "type": "paragraph", "text": "B.4. Installing Keras", "words": [{"w": "B.4.", "b": [0.1673, 0.2541, 0.2093, 0.2739]}, {"w": "Installing", "b": [0.2156, 0.2541, 0.3109, 0.2739]}, {"w": "Keras", "b": [0.3172, 0.2541, 0.376, 0.2739]}]}, {"id": "b_5", "type": "paragraph", "text": "B.5. Setting up local port forwarding", "words": [{"w": "B.5.", "b": [0.1673, 0.2818, 0.2093, 0.3015]}, {"w": "Setting", "b": [0.2156, 0.2818, 0.2871, 0.3015]}, {"w": "up", "b": [0.2934, 0.2818, 0.3186, 0.3015]}, {"w": "local", "b": [0.3249, 0.2818, 0.374, 0.3015]}, {"w": "port", "b": [0.3803, 0.2818, 0.4209, 0.3015]}, {"w": "forwarding", "b": [0.4272, 0.2818, 0.5393, 0.3015]}]}, {"id": "b_6", "type": "paragraph", "text": "B.6. Using Jupyter from your local browser", "words": [{"w": "B.6.", "b": [0.1673, 0.3094, 0.2093, 0.3291]}, {"w": "Using", "b": [0.2156, 0.3094, 0.2759, 0.3291]}, {"w": "Jupyter", "b": [0.2822, 0.3094, 0.3564, 0.3291]}, {"w": "from", "b": [0.3628, 0.3094, 0.4118, 0.3291]}, {"w": "your", "b": [0.4181, 0.3094, 0.4643, 0.3291]}, {"w": "local", "b": [0.4706, 0.3094, 0.5197, 0.3291]}, {"w": "browser", "b": [0.526, 0.3094, 0.6072, 0.3291]}]}, {"id": "b_7", "type": "paragraph", "text": "Index", "words": [{"w": "Index", "b": [0.1546, 0.3477, 0.2121, 0.3675]}]}, {"id": "b_8", "type": "paragraph", "text": "List of Figures", "words": [{"w": "List", "b": [0.1546, 0.386, 0.1939, 0.4058]}, {"w": "of", "b": [0.2002, 0.386, 0.2212, 0.4058]}, {"w": "Figures", "b": [0.2275, 0.386, 0.3032, 0.4058]}]}, {"id": "b_9", "type": "paragraph", "text": "List of Tables", "words": [{"w": "List", "b": [0.1546, 0.4244, 0.1939, 0.4441]}, {"w": "of", "b": [0.2002, 0.4244, 0.2212, 0.4441]}, {"w": "Tables", "b": [0.2275, 0.4244, 0.293, 0.4441]}]}, {"id": "b_10", "type": "paragraph", "text": "List of Listings", "words": [{"w": "List", "b": [0.1546, 0.4627, 0.1939, 0.4824]}, {"w": "of", "b": [0.2002, 0.4627, 0.2212, 0.4824]}, {"w": "Listings", "b": [0.2275, 0.4627, 0.3088, 0.4824]}]}]}, {"page": 18, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Preface", "words": [{"w": "Preface", "b": [0.1294, 0.1076, 0.2438, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "If you’ve picked up this book, you’re probably aware of the extraordinary progress that deep learning has represented for the field of artificial intelligence in the recent past. In a mere five years, we’ve gone from near-unusable image recognition and speech transcription, to superhuman performance on these tasks.", "words": [{"w": "If", "b": [0.1294, 0.1588, 0.1462, 0.1785]}, {"w": "you’ve", "b": [0.1525, 0.1588, 0.2226, 0.1785]}, {"w": "picked", "b": [0.2289, 0.1588, 0.2961, 0.1785]}, {"w": "up", "b": [0.3024, 0.1588, 0.3277, 0.1785]}, {"w": "this", "b": [0.334, 0.1588, 0.3704, 0.1785]}, {"w": "book,", "b": [0.3767, 0.1588, 0.4335, 0.1785]}, {"w": "you’re", "b": [0.4398, 0.1588, 0.5056, 0.1785]}, {"w": "probably", "b": [0.5119, 0.1588, 0.6016, 0.1785]}, {"w": "aware", "b": [0.6079, 0.1588, 0.6681, 0.1785]}, {"w": "of", "b": [0.6744, 0.1588, 0.6955, 0.1785]}, {"w": "the", "b": [0.7018, 0.1588, 0.7326, 0.1785]}, {"w": "extraordinary", "b": [0.1294, 0.1793, 0.2653, 0.199]}, {"w": "progress", "b": [0.2716, 0.1793, 0.3571, 0.199]}, {"w": "that", "b": [0.3634, 0.1793, 0.4012, 0.199]}, {"w": "deep", "b": [0.4075, 0.1793, 0.4552, 0.199]}, {"w": "learning", "b": [0.4615, 0.1793, 0.5441, 0.199]}, {"w": "has", "b": [0.5504, 0.1793, 0.5841, 0.199]}, {"w": "represented", "b": [0.5904, 0.1793, 0.7066, 0.199]}, {"w": "for", "b": [0.7129, 0.1793, 0.7423, 0.199]}, {"w": "the", "b": [0.7486, 0.1793, 0.7794, 0.199]}, {"w": "field", "b": [0.7857, 0.1793, 0.832, 0.199]}, {"w": "of", "b": [0.8383, 0.1793, 0.8593, 0.199]}, {"w": "artificial", "b": [0.1294, 0.1998, 0.2149, 0.2195]}, {"w": "intelligence", "b": [0.2212, 0.1998, 0.3389, 0.2195]}, {"w": "in", "b": [0.3452, 0.1998, 0.3648, 0.2195]}, {"w": "the", "b": [0.3711, 0.1998, 0.402, 0.2195]}, {"w": "recent", "b": [0.4083, 0.1998, 0.4699, 0.2195]}, {"w": "past.", "b": [0.4762, 0.1998, 0.5231, 0.2195]}, {"w": "In", "b": [0.5294, 0.1998, 0.5505, 0.2195]}, {"w": "a", "b": [0.5568, 0.1998, 0.568, 0.2195]}, {"w": "mere", "b": [0.5743, 0.1998, 0.6247, 0.2195]}, {"w": "five", "b": [0.631, 0.1998, 0.6702, 0.2195]}, {"w": "years,", "b": [0.6765, 0.1998, 0.7361, 0.2195]}, {"w": "we’ve", "b": [0.7424, 0.1998, 0.804, 0.2195]}, {"w": "gone", "b": [0.8103, 0.1998, 0.8593, 0.2195]}, {"w": "from", "b": [0.1294, 0.2203, 0.1785, 0.24]}, {"w": "near-unusable", "b": [0.1848, 0.2203, 0.3257, 0.24]}, {"w": "image", "b": [0.332, 0.2203, 0.3937, 0.24]}, {"w": "recognition", "b": [0.4, 0.2203, 0.5149, 0.24]}, {"w": "and", "b": [0.5212, 0.2203, 0.5576, 0.24]}, {"w": "speech", "b": [0.5639, 0.2203, 0.6325, 0.24]}, {"w": "transcription,", "b": [0.6388, 0.2203, 0.7727, 0.24]}, {"w": "to", "b": [0.779, 0.2203, 0.7986, 0.24]}, {"w": "superhuman", "b": [0.1294, 0.2408, 0.2527, 0.2605]}, {"w": "performance", "b": [0.259, 0.2408, 0.3865, 0.2605]}, {"w": "on", "b": [0.3928, 0.2408, 0.418, 0.2605]}, {"w": "these", "b": [0.4243, 0.2408, 0.4762, 0.2605]}, {"w": "tasks.", "b": [0.4825, 0.2408, 0.5392, 0.2605]}]}, {"id": "b_2", "type": "paragraph", "text": "The consequences of this sudden progress extend to almost every industry. But in order to begin deploying deep-learning technology to every problem that it could solve, we need to make it accessible to as many people as possible, including non-experts—people who aren’t researchers or graduate students. For deep learning to reach its full potential, we need to radically democratize it.", "words": [{"w": "The", "b": [0.1294, 0.2835, 0.1686, 0.3033]}, {"w": "consequences", "b": [0.1749, 0.2835, 0.3136, 0.3033]}, {"w": "of", "b": [0.3199, 0.2835, 0.341, 0.3033]}, {"w": "this", "b": [0.3473, 0.2835, 0.3837, 0.3033]}, {"w": "sudden", "b": [0.39, 0.2835, 0.4615, 0.3033]}, {"w": "progress", "b": [0.4678, 0.2835, 0.5533, 0.3033]}, {"w": "extend", "b": [0.5596, 0.2835, 0.6268, 0.3033]}, {"w": "to", "b": [0.6331, 0.2835, 0.6527, 0.3033]}, {"w": "almost", "b": [0.6591, 0.2835, 0.7263, 0.3033]}, {"w": "every", "b": [0.7326, 0.2835, 0.7887, 0.3033]}, {"w": "industry.", "b": [0.1294, 0.304, 0.2168, 0.3238]}, {"w": "But", "b": [0.2231, 0.304, 0.2595, 0.3238]}, {"w": "in", "b": [0.2658, 0.304, 0.2855, 0.3238]}, {"w": "order", "b": [0.2918, 0.304, 0.345, 0.3238]}, {"w": "to", "b": [0.3513, 0.304, 0.3709, 0.3238]}, {"w": "begin", "b": [0.3772, 0.304, 0.4333, 0.3238]}, {"w": "deploying", "b": [0.4396, 0.304, 0.5405, 0.3238]}, {"w": "deep-learning", "b": [0.5468, 0.304, 0.6855, 0.3238]}, {"w": "technology", "b": [0.6918, 0.304, 0.8039, 0.3238]}, {"w": "to", "b": [0.8101, 0.304, 0.8297, 0.3238]}, {"w": "every", "b": [0.1294, 0.3245, 0.1854, 0.3443]}, {"w": "problem", "b": [0.1917, 0.3245, 0.2758, 0.3443]}, {"w": "that", "b": [0.2821, 0.3245, 0.32, 0.3443]}, {"w": "it", "b": [0.3263, 0.3245, 0.3403, 0.3443]}, {"w": "could", "b": [0.3466, 0.3245, 0.4027, 0.3443]}, {"w": "solve,", "b": [0.409, 0.3245, 0.4685, 0.3443]}, {"w": "we", "b": [0.4748, 0.3245, 0.5042, 0.3443]}, {"w": "need", "b": [0.5105, 0.3245, 0.5582, 0.3443]}, {"w": "to", "b": [0.5645, 0.3245, 0.5841, 0.3443]}, {"w": "make", "b": [0.5904, 0.3245, 0.6451, 0.3443]}, {"w": "it", "b": [0.6514, 0.3245, 0.6654, 0.3443]}, {"w": "accessible", "b": [0.6717, 0.3245, 0.774, 0.3443]}, {"w": "to", "b": [0.7803, 0.3245, 0.7999, 0.3443]}, {"w": "as", "b": [0.8062, 0.3245, 0.8272, 0.3443]}, {"w": "many", "b": [0.1294, 0.345, 0.1855, 0.3648]}, {"w": "people", "b": [0.1918, 0.345, 0.259, 0.3648]}, {"w": "as", "b": [0.2653, 0.345, 0.2863, 0.3648]}, {"w": "possible,", "b": [0.2926, 0.345, 0.3816, 0.3648]}, {"w": "including", "b": [0.388, 0.345, 0.4833, 0.3648]}, {"w": "non-experts—people", "b": [0.4896, 0.345, 0.7011, 0.3648]}, {"w": "who", "b": [0.7074, 0.345, 0.7508, 0.3648]}, {"w": "aren’t", "b": [0.7571, 0.345, 0.8155, 0.3648]}, {"w": "researchers", "b": [0.1294, 0.3656, 0.2429, 0.3853]}, {"w": "or", "b": [0.2492, 0.3656, 0.2702, 0.3853]}, {"w": "graduate", "b": [0.2765, 0.3656, 0.3633, 0.3853]}, {"w": "students.", "b": [0.3696, 0.3656, 0.4586, 0.3853]}, {"w": "For", "b": [0.4649, 0.3656, 0.5, 0.3853]}, {"w": "deep", "b": [0.5063, 0.3656, 0.5539, 0.3853]}, {"w": "learning", "b": [0.5602, 0.3656, 0.6429, 0.3853]}, {"w": "to", "b": [0.6492, 0.3656, 0.6688, 0.3853]}, {"w": "reach", "b": [0.6751, 0.3656, 0.7297, 0.3853]}, {"w": "its", "b": [0.736, 0.3656, 0.7599, 0.3853]}, {"w": "full", "b": [0.7662, 0.3656, 0.8012, 0.3853]}, {"w": "potential,", "b": [0.1294, 0.3861, 0.224, 0.4058]}, {"w": "we", "b": [0.2303, 0.3861, 0.2597, 0.4058]}, {"w": "need", "b": [0.266, 0.3861, 0.3137, 0.4058]}, {"w": "to", "b": [0.32, 0.3861, 0.3396, 0.4058]}, {"w": "radically", "b": [0.3459, 0.3861, 0.4342, 0.4058]}, {"w": "democratize", "b": [0.4405, 0.3861, 0.5637, 0.4058]}, {"w": "it.", "b": [0.57, 0.3861, 0.5903, 0.4058]}]}, {"id": "b_3", "type": "paragraph", "text": "When I released the first version of the Keras deep-learning framework in March 2015, the democratization of AI wasn’t what I had in mind. I had been doing research in machine learning for several years, and had built Keras to help me with my own experiments. But throughout 2015 and 2016, tens of thousands of new people entered the field of deep learning; many of them picked up Keras because it was—and still is— the easiest framework to get started with. As I watched scores of newcomers use Keras in unexpected, powerful ways, I came to care deeply about the accessibility and democratization of AI. I realized that the further we spread these technologies, the more useful and valuable they become. Accessibility quickly became an explicit goal in the development of Keras, and over a few short years, the Keras developer community has made fantastic achievements on this front. We’ve put deep learning into the hands of tens of thousands of people, who in turn are using it to solve important problems we didn’t even know existed until recently.", "words": [{"w": "When", "b": [0.1294, 0.4288, 0.1897, 0.4486]}, {"w": "I", "b": [0.196, 0.4288, 0.2044, 0.4486]}, {"w": "released", "b": [0.2107, 0.4288, 0.2933, 0.4486]}, {"w": "the", "b": [0.2996, 0.4288, 0.3304, 0.4486]}, {"w": "first", "b": [0.3367, 0.4288, 0.3774, 0.4486]}, {"w": "version", "b": [0.3837, 0.4288, 0.458, 0.4486]}, {"w": "of", "b": [0.4643, 0.4288, 0.4853, 0.4486]}, {"w": "the", "b": [0.4916, 0.4288, 0.5224, 0.4486]}, {"w": "Keras", "b": [0.5287, 0.4288, 0.5875, 0.4486]}, {"w": "deep-learning", "b": [0.5938, 0.4288, 0.7325, 0.4486]}, {"w": "framework", "b": [0.7388, 0.4288, 0.8495, 0.4486]}, {"w": "in", "b": [0.1294, 0.4493, 0.149, 0.4691]}, {"w": "March", "b": [0.1553, 0.4493, 0.2212, 0.4691]}, {"w": "2015,", "b": [0.2275, 0.4493, 0.2842, 0.4691]}, {"w": "the", "b": [0.2906, 0.4493, 0.3214, 0.4691]}, {"w": "democratization", "b": [0.3277, 0.4493, 0.4902, 0.4691]}, {"w": "of", "b": [0.4965, 0.4493, 0.5175, 0.4691]}, {"w": "AI", "b": [0.5238, 0.4493, 0.5505, 0.4691]}, {"w": "wasn’t", "b": [0.5568, 0.4493, 0.6235, 0.4691]}, {"w": "what", "b": [0.6298, 0.4493, 0.6789, 0.4691]}, {"w": "I", "b": [0.6851, 0.4493, 0.6935, 0.4691]}, {"w": "had", "b": [0.6999, 0.4493, 0.7363, 0.4691]}, {"w": "in", "b": [0.7426, 0.4493, 0.7622, 0.4691]}, {"w": "mind.", "b": [0.7685, 0.4493, 0.8267, 0.4691]}, {"w": "I", "b": [0.833, 0.4493, 0.8414, 0.4691]}, {"w": "had", "b": [0.1294, 0.4698, 0.1658, 0.4896]}, {"w": "been", "b": [0.1721, 0.4698, 0.2198, 0.4896]}, {"w": "doing", "b": [0.2261, 0.4698, 0.2835, 0.4896]}, {"w": "research", "b": [0.2898, 0.4698, 0.3739, 0.4896]}, {"w": "in", "b": [0.3802, 0.4698, 0.3998, 0.4896]}, {"w": "machine", "b": [0.4061, 0.4698, 0.4916, 0.4896]}, {"w": "learning", "b": [0.4979, 0.4698, 0.5805, 0.4896]}, {"w": "for", "b": [0.5869, 0.4698, 0.6163, 0.4896]}, {"w": "several", "b": [0.6226, 0.4698, 0.694, 0.4896]}, {"w": "years,", "b": [0.7003, 0.4698, 0.7599, 0.4896]}, {"w": "and", "b": [0.7662, 0.4698, 0.8026, 0.4896]}, {"w": "had", "b": [0.8089, 0.4698, 0.8453, 0.4896]}, {"w": "built", "b": [0.1294, 0.4903, 0.1757, 0.5101]}, {"w": "Keras", "b": [0.182, 0.4903, 0.2408, 0.5101]}, {"w": "to", "b": [0.2471, 0.4903, 0.2667, 0.5101]}, {"w": "help", "b": [0.273, 0.4903, 0.3165, 0.5101]}, {"w": "me", "b": [0.3228, 0.4903, 0.3536, 0.5101]}, {"w": "with", "b": [0.3599, 0.4903, 0.4048, 0.5101]}, {"w": "my", "b": [0.4111, 0.4903, 0.4433, 0.5101]}, {"w": "own", "b": [0.4496, 0.4903, 0.4931, 0.5101]}, {"w": "experiments.", "b": [0.4993, 0.4903, 0.6289, 0.5101]}, {"w": "But", "b": [0.6352, 0.4903, 0.6717, 0.5101]}, {"w": "throughout", "b": [0.678, 0.4903, 0.7887, 0.5101]}, {"w": "2015", "b": [0.795, 0.4903, 0.8455, 0.5101]}, {"w": "and", "b": [0.1294, 0.5108, 0.1658, 0.5306]}, {"w": "2016,", "b": [0.1721, 0.5108, 0.2289, 0.5306]}, {"w": "tens", "b": [0.2352, 0.5108, 0.2758, 0.5306]}, {"w": "of", "b": [0.2822, 0.5108, 0.3032, 0.5306]}, {"w": "thousands", "b": [0.3095, 0.5108, 0.4104, 0.5306]}, {"w": "of", "b": [0.4167, 0.5108, 0.4377, 0.5306]}, {"w": "new", "b": [0.444, 0.5108, 0.486, 0.5306]}, {"w": "people", "b": [0.4923, 0.5108, 0.5596, 0.5306]}, {"w": "entered", "b": [0.5659, 0.5108, 0.6401, 0.5306]}, {"w": "the", "b": [0.6464, 0.5108, 0.6773, 0.5306]}, {"w": "field", "b": [0.6836, 0.5108, 0.7298, 0.5306]}, {"w": "of", "b": [0.7361, 0.5108, 0.7571, 0.5306]}, {"w": "deep", "b": [0.7634, 0.5108, 0.8111, 0.5306]}, {"w": "learning;", "b": [0.1294, 0.5313, 0.2191, 0.5511]}, {"w": "many", "b": [0.2254, 0.5313, 0.2814, 0.5511]}, {"w": "of", "b": [0.2878, 0.5313, 0.3088, 0.5511]}, {"w": "them", "b": [0.3151, 0.5313, 0.3655, 0.5511]}, {"w": "picked", "b": [0.3718, 0.5313, 0.439, 0.5511]}, {"w": "up", "b": [0.4453, 0.5313, 0.4706, 0.5511]}, {"w": "Keras", "b": [0.4769, 0.5313, 0.5357, 0.5511]}, {"w": "because", "b": [0.542, 0.5313, 0.6218, 0.5511]}, {"w": "it", "b": [0.6281, 0.5313, 0.6422, 0.5511]}, {"w": "was—and", "b": [0.6485, 0.5313, 0.7494, 0.5511]}, {"w": "still", "b": [0.7557, 0.5313, 0.7935, 0.5511]}, {"w": "is—", "b": [0.7998, 0.5313, 0.8419, 0.5511]}, {"w": "the", "b": [0.1294, 0.5518, 0.1602, 0.5716]}, {"w": "easiest", "b": [0.1665, 0.5518, 0.2338, 0.5716]}, {"w": "framework", "b": [0.2401, 0.5518, 0.3508, 0.5716]}, {"w": "to", "b": [0.3571, 0.5518, 0.3767, 0.5716]}, {"w": "get", "b": [0.383, 0.5518, 0.4138, 0.5716]}, {"w": "started", "b": [0.4201, 0.5518, 0.4874, 0.5716]}, {"w": "with.", "b": [0.4937, 0.5518, 0.5449, 0.5716]}, {"w": "As", "b": [0.5512, 0.5518, 0.5792, 0.5716]}, {"w": "I", "b": [0.5855, 0.5518, 0.5939, 0.5716]}, {"w": "watched", "b": [0.6002, 0.5518, 0.6843, 0.5716]}, {"w": "scores", "b": [0.6906, 0.5518, 0.7536, 0.5716]}, {"w": "of", "b": [0.7599, 0.5518, 0.7809, 0.5716]}, {"w": "newcomers", "b": [0.1294, 0.5723, 0.2443, 0.5921]}, {"w": "use", "b": [0.2506, 0.5723, 0.2842, 0.5921]}, {"w": "Keras", "b": [0.2905, 0.5723, 0.3493, 0.5921]}, {"w": "in", "b": [0.3557, 0.5723, 0.3753, 0.5921]}, {"w": "unexpected,", "b": [0.3816, 0.5723, 0.5028, 0.5921]}, {"w": "powerful", "b": [0.5091, 0.5723, 0.6001, 0.5921]}, {"w": "ways,", "b": [0.6064, 0.5723, 0.6646, 0.5921]}, {"w": "I", "b": [0.6709, 0.5723, 0.6793, 0.5921]}, {"w": "came", "b": [0.6856, 0.5723, 0.7388, 0.5921]}, {"w": "to", "b": [0.7451, 0.5723, 0.7648, 0.5921]}, {"w": "care", "b": [0.7711, 0.5723, 0.8131, 0.5921]}, {"w": "deeply", "b": [0.1294, 0.5928, 0.1967, 0.6126]}, {"w": "about", "b": [0.203, 0.5928, 0.259, 0.6126]}, {"w": "the", "b": [0.2653, 0.5928, 0.2962, 0.6126]}, {"w": "accessibility", "b": [0.3025, 0.5928, 0.4272, 0.6126]}, {"w": "and", "b": [0.4335, 0.5928, 0.4699, 0.6126]}, {"w": "democratization", "b": [0.4762, 0.5928, 0.6387, 0.6126]}, {"w": "of", "b": [0.6451, 0.5928, 0.6661, 0.6126]}, {"w": "AI.", "b": [0.6724, 0.5928, 0.7053, 0.6126]}, {"w": "I", "b": [0.7116, 0.5928, 0.72, 0.6126]}, {"w": "realized", "b": [0.7263, 0.5928, 0.8061, 0.6126]}, {"w": "that", "b": [0.8125, 0.5928, 0.8503, 0.6126]}, {"w": "the", "b": [0.1294, 0.6133, 0.1602, 0.6331]}, {"w": "further", "b": [0.1665, 0.6133, 0.2352, 0.6331]}, {"w": "we", "b": [0.2415, 0.6133, 0.2709, 0.6331]}, {"w": "spread", "b": [0.2772, 0.6133, 0.343, 0.6331]}, {"w": "these", "b": [0.3494, 0.6133, 0.4012, 0.6331]}, {"w": "technologies,", "b": [0.4075, 0.6133, 0.5413, 0.6331]}, {"w": "the", "b": [0.5476, 0.6133, 0.5785, 0.6331]}, {"w": "more", "b": [0.5848, 0.6133, 0.6366, 0.6331]}, {"w": "useful", "b": [0.6429, 0.6133, 0.7046, 0.6331]}, {"w": "and", "b": [0.7109, 0.6133, 0.7473, 0.6331]}, {"w": "valuable", "b": [0.7536, 0.6133, 0.8391, 0.6331]}, {"w": "they", "b": [0.1294, 0.6338, 0.1729, 0.6536]}, {"w": "become.", "b": [0.1792, 0.6338, 0.2639, 0.6536]}, {"w": "Accessibility", "b": [0.2702, 0.6338, 0.402, 0.6536]}, {"w": "quickly", "b": [0.4083, 0.6338, 0.4839, 0.6536]}, {"w": "became", "b": [0.4902, 0.6338, 0.5673, 0.6536]}, {"w": "an", "b": [0.5736, 0.6338, 0.5974, 0.6536]}, {"w": "explicit", "b": [0.6037, 0.6338, 0.6794, 0.6536]}, {"w": "goal", "b": [0.6856, 0.6338, 0.729, 0.6536]}, {"w": "in", "b": [0.7353, 0.6338, 0.755, 0.6536]}, {"w": "the", "b": [0.7613, 0.6338, 0.7921, 0.6536]}, {"w": "development", "b": [0.1294, 0.6543, 0.2597, 0.6741]}, {"w": "of", "b": [0.266, 0.6543, 0.287, 0.6741]}, {"w": "Keras,", "b": [0.2934, 0.6543, 0.3585, 0.6741]}, {"w": "and", "b": [0.3648, 0.6543, 0.4012, 0.6741]}, {"w": "over", "b": [0.4075, 0.6543, 0.4524, 0.6741]}, {"w": "a", "b": [0.4587, 0.6543, 0.4699, 0.6741]}, {"w": "few", "b": [0.4762, 0.6543, 0.514, 0.6741]}, {"w": "short", "b": [0.5203, 0.6543, 0.5707, 0.6741]}, {"w": "years,", "b": [0.577, 0.6543, 0.6366, 0.6741]}, {"w": "the", "b": [0.6429, 0.6543, 0.6737, 0.6741]}, {"w": "Keras", "b": [0.68, 0.6543, 0.7388, 0.6741]}, {"w": "developer", "b": [0.7451, 0.6543, 0.8446, 0.6741]}, {"w": "community", "b": [0.1294, 0.6748, 0.2443, 0.6946]}, {"w": "has", "b": [0.2506, 0.6748, 0.2843, 0.6946]}, {"w": "made", "b": [0.2906, 0.6748, 0.3452, 0.6946]}, {"w": "fantastic", "b": [0.3515, 0.6748, 0.437, 0.6946]}, {"w": "achievements", "b": [0.4433, 0.6748, 0.5806, 0.6946]}, {"w": "on", "b": [0.5868, 0.6748, 0.6121, 0.6946]}, {"w": "this", "b": [0.6184, 0.6748, 0.6548, 0.6946]}, {"w": "front.", "b": [0.6611, 0.6748, 0.7165, 0.6946]}, {"w": "We’ve", "b": [0.7228, 0.6748, 0.788, 0.6946]}, {"w": "put", "b": [0.7943, 0.6748, 0.8265, 0.6946]}, {"w": "deep", "b": [0.1294, 0.6953, 0.177, 0.7151]}, {"w": "learning", "b": [0.1833, 0.6953, 0.266, 0.7151]}, {"w": "into", "b": [0.2723, 0.6953, 0.3116, 0.7151]}, {"w": "the", "b": [0.3179, 0.6953, 0.3487, 0.7151]}, {"w": "hands", "b": [0.355, 0.6953, 0.4139, 0.7151]}, {"w": "of", "b": [0.4202, 0.6953, 0.4412, 0.7151]}, {"w": "tens", "b": [0.4475, 0.6953, 0.4881, 0.7151]}, {"w": "of", "b": [0.4944, 0.6953, 0.5154, 0.7151]}, {"w": "thousands", "b": [0.5217, 0.6953, 0.6227, 0.7151]}, {"w": "of", "b": [0.629, 0.6953, 0.65, 0.7151]}, {"w": "people,", "b": [0.6563, 0.6953, 0.7298, 0.7151]}, {"w": "who", "b": [0.7361, 0.6953, 0.7796, 0.7151]}, {"w": "in", "b": [0.7859, 0.6953, 0.8055, 0.7151]}, {"w": "turn", "b": [0.8118, 0.6953, 0.8525, 0.7151]}, {"w": "are", "b": [0.1294, 0.7158, 0.1602, 0.7356]}, {"w": "using", "b": [0.1665, 0.7158, 0.2212, 0.7356]}, {"w": "it", "b": [0.2275, 0.7158, 0.2415, 0.7356]}, {"w": "to", "b": [0.2478, 0.7158, 0.2674, 0.7356]}, {"w": "solve", "b": [0.2738, 0.7158, 0.327, 0.7356]}, {"w": "important", "b": [0.3333, 0.7158, 0.4314, 0.7356]}, {"w": "problems", "b": [0.4377, 0.7158, 0.5315, 0.7356]}, {"w": "we", "b": [0.5379, 0.7158, 0.5673, 0.7356]}, {"w": "didn’t", "b": [0.5736, 0.7158, 0.6334, 0.7356]}, {"w": "even", "b": [0.6397, 0.7158, 0.6873, 0.7356]}, {"w": "know", "b": [0.6936, 0.7158, 0.7497, 0.7356]}, {"w": "existed", "b": [0.756, 0.7158, 0.8274, 0.7356]}, {"w": "until", "b": [0.1294, 0.7363, 0.1757, 0.7561]}, {"w": "recently.", "b": [0.182, 0.7363, 0.2679, 0.7561]}]}, {"id": "b_4", "type": "paragraph", "text": "The book you’re holding is another step on the way to making deep learning available to as many people as possible. Keras had always needed a companion course to simultaneously cover fundamentals of deep learning, Keras usage patterns, and deep-learning best practices. This book is my best effort to produce such a course. I wrote it with a focus on making the concepts behind deep learning, and their", "words": [{"w": "The", "b": [0.1294, 0.7791, 0.1686, 0.7989]}, {"w": "book", "b": [0.1749, 0.7791, 0.2254, 0.7989]}, {"w": "you’re", "b": [0.2317, 0.7791, 0.2975, 0.7989]}, {"w": "holding", "b": [0.3038, 0.7791, 0.3809, 0.7989]}, {"w": "is", "b": [0.3872, 0.7791, 0.4041, 0.7989]}, {"w": "another", "b": [0.4104, 0.7791, 0.486, 0.7989]}, {"w": "step", "b": [0.4923, 0.7791, 0.533, 0.7989]}, {"w": "on", "b": [0.5393, 0.7791, 0.5645, 0.7989]}, {"w": "the", "b": [0.5708, 0.7791, 0.6016, 0.7989]}, {"w": "way", "b": [0.6079, 0.7791, 0.65, 0.7989]}, {"w": "to", "b": [0.6563, 0.7791, 0.6759, 0.7989]}, {"w": "making", "b": [0.6822, 0.7791, 0.7579, 0.7989]}, {"w": "deep", "b": [0.7642, 0.7791, 0.8118, 0.7989]}, {"w": "learning", "b": [0.1294, 0.7996, 0.2121, 0.8194]}, {"w": "available", "b": [0.2184, 0.7996, 0.3094, 0.8194]}, {"w": "to", "b": [0.3158, 0.7996, 0.3354, 0.8194]}, {"w": "as", "b": [0.3417, 0.7996, 0.3627, 0.8194]}, {"w": "many", "b": [0.369, 0.7996, 0.4251, 0.8194]}, {"w": "people", "b": [0.4314, 0.7996, 0.4986, 0.8194]}, {"w": "as", "b": [0.5049, 0.7996, 0.5259, 0.8194]}, {"w": "possible.", "b": [0.5322, 0.7996, 0.6212, 0.8194]}, {"w": "Keras", "b": [0.6275, 0.7996, 0.6864, 0.8194]}, {"w": "had", "b": [0.6926, 0.7996, 0.729, 0.8194]}, {"w": "always", "b": [0.7353, 0.7996, 0.8054, 0.8194]}, {"w": "needed", "b": [0.1294, 0.8201, 0.2009, 0.8399]}, {"w": "a", "b": [0.2072, 0.8201, 0.2184, 0.8399]}, {"w": "companion", "b": [0.2247, 0.8201, 0.3368, 0.8399]}, {"w": "course", "b": [0.3431, 0.8201, 0.4089, 0.8399]}, {"w": "to", "b": [0.4152, 0.8201, 0.4348, 0.8399]}, {"w": "simultaneously", "b": [0.4412, 0.8201, 0.5939, 0.8399]}, {"w": "cover", "b": [0.6002, 0.8201, 0.6563, 0.8399]}, {"w": "fundamentals", "b": [0.6626, 0.8201, 0.7985, 0.8399]}, {"w": "of", "b": [0.8048, 0.8201, 0.8258, 0.8399]}, {"w": "deep", "b": [0.1294, 0.8406, 0.177, 0.8604]}, {"w": "learning,", "b": [0.1833, 0.8406, 0.2723, 0.8604]}, {"w": "Keras", "b": [0.2786, 0.8406, 0.3374, 0.8604]}, {"w": "usage", "b": [0.3438, 0.8406, 0.4012, 0.8604]}, {"w": "patterns,", "b": [0.4075, 0.8406, 0.4937, 0.8604]}, {"w": "and", "b": [0.5, 0.8406, 0.5364, 0.8604]}, {"w": "deep-learning", "b": [0.5427, 0.8406, 0.6814, 0.8604]}, {"w": "best", "b": [0.6876, 0.8406, 0.7283, 0.8604]}, {"w": "practices.", "b": [0.7346, 0.8406, 0.8305, 0.8604]}, {"w": "This", "b": [0.1294, 0.8611, 0.1743, 0.8809]}, {"w": "book", "b": [0.1806, 0.8611, 0.231, 0.8809]}, {"w": "is", "b": [0.2373, 0.8611, 0.2542, 0.8809]}, {"w": "my", "b": [0.2605, 0.8611, 0.2927, 0.8809]}, {"w": "best", "b": [0.299, 0.8611, 0.3396, 0.8809]}, {"w": "effort", "b": [0.3459, 0.8611, 0.4015, 0.8809]}, {"w": "to", "b": [0.4078, 0.8611, 0.4274, 0.8809]}, {"w": "produce", "b": [0.4337, 0.8611, 0.515, 0.8809]}, {"w": "such", "b": [0.5213, 0.8611, 0.5675, 0.8809]}, {"w": "a", "b": [0.5738, 0.8611, 0.585, 0.8809]}, {"w": "course.", "b": [0.5914, 0.8611, 0.6635, 0.8809]}, {"w": "I", "b": [0.6698, 0.8611, 0.6782, 0.8809]}, {"w": "wrote", "b": [0.6845, 0.8611, 0.742, 0.8809]}, {"w": "it", "b": [0.7483, 0.8611, 0.7623, 0.8809]}, {"w": "with", "b": [0.7686, 0.8611, 0.8134, 0.8809]}, {"w": "a", "b": [0.8197, 0.8611, 0.8309, 0.8809]}, {"w": "focus", "b": [0.1294, 0.8816, 0.1841, 0.9014]}, {"w": "on", "b": [0.1904, 0.8816, 0.2156, 0.9014]}, {"w": "making", "b": [0.2219, 0.8816, 0.2976, 0.9014]}, {"w": "the", "b": [0.3039, 0.8816, 0.3347, 0.9014]}, {"w": "concepts", "b": [0.341, 0.8816, 0.4293, 0.9014]}, {"w": "behind", "b": [0.4356, 0.8816, 0.5042, 0.9014]}, {"w": "deep", "b": [0.5105, 0.8816, 0.5581, 0.9014]}, {"w": "learning,", "b": [0.5644, 0.8816, 0.6534, 0.9014]}, {"w": "and", "b": [0.6597, 0.8816, 0.6961, 0.9014]}, {"w": "their", "b": [0.7024, 0.8816, 0.7487, 0.9014]}]}]}, {"page": 19, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "implementation, as approachable as possible. Doing so didn’t require me to dumb down anything—I strongly believe that there are no difficult ideas in deep learning. I hope you’ll find this book valuable and that it will enable you to begin building intelligent applications and solve the problems that matter to you.", "words": [{"w": "implementation,", "b": [0.1294, 0.0857, 0.2941, 0.1054]}, {"w": "as", "b": [0.3004, 0.0857, 0.3214, 0.1054]}, {"w": "approachable", "b": [0.3277, 0.0857, 0.4622, 0.1054]}, {"w": "as", "b": [0.4685, 0.0857, 0.4895, 0.1054]}, {"w": "possible.", "b": [0.4958, 0.0857, 0.5848, 0.1054]}, {"w": "Doing", "b": [0.5911, 0.0857, 0.6542, 0.1054]}, {"w": "so", "b": [0.6605, 0.0857, 0.6829, 0.1054]}, {"w": "didn’t", "b": [0.6892, 0.0857, 0.749, 0.1054]}, {"w": "require", "b": [0.7553, 0.0857, 0.8267, 0.1054]}, {"w": "me", "b": [0.833, 0.0857, 0.8638, 0.1054]}, {"w": "to", "b": [0.1294, 0.1062, 0.149, 0.1259]}, {"w": "dumb", "b": [0.1553, 0.1062, 0.2128, 0.1259]}, {"w": "down", "b": [0.2191, 0.1062, 0.2752, 0.1259]}, {"w": "anything—I", "b": [0.2815, 0.1062, 0.4034, 0.1259]}, {"w": "strongly", "b": [0.4097, 0.1062, 0.4924, 0.1259]}, {"w": "believe", "b": [0.4987, 0.1062, 0.5715, 0.1259]}, {"w": "that", "b": [0.5778, 0.1062, 0.6157, 0.1259]}, {"w": "there", "b": [0.622, 0.1062, 0.6724, 0.1259]}, {"w": "are", "b": [0.6787, 0.1062, 0.7095, 0.1259]}, {"w": "no", "b": [0.7158, 0.1062, 0.741, 0.1259]}, {"w": "difficult", "b": [0.7473, 0.1062, 0.8281, 0.1259]}, {"w": "ideas", "b": [0.1294, 0.1267, 0.1813, 0.1464]}, {"w": "in", "b": [0.1876, 0.1267, 0.2072, 0.1464]}, {"w": "deep", "b": [0.2135, 0.1267, 0.2611, 0.1464]}, {"w": "learning.", "b": [0.2674, 0.1267, 0.3564, 0.1464]}, {"w": "I", "b": [0.3627, 0.1267, 0.3711, 0.1464]}, {"w": "hope", "b": [0.3774, 0.1267, 0.4264, 0.1464]}, {"w": "you’ll", "b": [0.4328, 0.1267, 0.493, 0.1464]}, {"w": "find", "b": [0.4993, 0.1267, 0.54, 0.1464]}, {"w": "this", "b": [0.5463, 0.1267, 0.5827, 0.1464]}, {"w": "book", "b": [0.589, 0.1267, 0.6395, 0.1464]}, {"w": "valuable", "b": [0.6458, 0.1267, 0.7312, 0.1464]}, {"w": "and", "b": [0.7376, 0.1267, 0.774, 0.1464]}, {"w": "that", "b": [0.7803, 0.1267, 0.8181, 0.1464]}, {"w": "it", "b": [0.8244, 0.1267, 0.8385, 0.1464]}, {"w": "will", "b": [0.1294, 0.1472, 0.1687, 0.1669]}, {"w": "enable", "b": [0.175, 0.1472, 0.2408, 0.1669]}, {"w": "you", "b": [0.2471, 0.1472, 0.2849, 0.1669]}, {"w": "to", "b": [0.2912, 0.1472, 0.3109, 0.1669]}, {"w": "begin", "b": [0.3172, 0.1472, 0.3732, 0.1669]}, {"w": "building", "b": [0.3795, 0.1472, 0.4636, 0.1669]}, {"w": "intelligent", "b": [0.4699, 0.1472, 0.5722, 0.1669]}, {"w": "applications", "b": [0.5786, 0.1472, 0.7005, 0.1669]}, {"w": "and", "b": [0.7068, 0.1472, 0.7432, 0.1669]}, {"w": "solve", "b": [0.7495, 0.1472, 0.8028, 0.1669]}, {"w": "the", "b": [0.8091, 0.1472, 0.8399, 0.1669]}, {"w": "problems", "b": [0.1294, 0.1677, 0.2233, 0.1874]}, {"w": "that", "b": [0.2296, 0.1677, 0.2674, 0.1874]}, {"w": "matter", "b": [0.2738, 0.1677, 0.3382, 0.1874]}, {"w": "to", "b": [0.3445, 0.1677, 0.3641, 0.1874]}, {"w": "you.", "b": [0.3704, 0.1677, 0.4146, 0.1874]}]}]}, {"page": 20, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Acknowledgments", "words": [{"w": "Acknowledgments", "b": [0.1294, 0.1076, 0.4093, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "I’d like to thank the Keras community for making this book possible. Keras has grown to have hundreds of open source contributors and more than 200,000 users. Your contributions and feedback have turned Keras into what it is today.", "words": [{"w": "I’d", "b": [0.1294, 0.1588, 0.1588, 0.1785]}, {"w": "like", "b": [0.1651, 0.1588, 0.203, 0.1785]}, {"w": "to", "b": [0.2093, 0.1588, 0.2289, 0.1785]}, {"w": "thank", "b": [0.2352, 0.1588, 0.2913, 0.1785]}, {"w": "the", "b": [0.2976, 0.1588, 0.3284, 0.1785]}, {"w": "Keras", "b": [0.3347, 0.1588, 0.3935, 0.1785]}, {"w": "community", "b": [0.3998, 0.1588, 0.5148, 0.1785]}, {"w": "for", "b": [0.5211, 0.1588, 0.5505, 0.1785]}, {"w": "making", "b": [0.5568, 0.1588, 0.6325, 0.1785]}, {"w": "this", "b": [0.6388, 0.1588, 0.6752, 0.1785]}, {"w": "book", "b": [0.6815, 0.1588, 0.732, 0.1785]}, {"w": "possible.", "b": [0.7383, 0.1588, 0.8273, 0.1785]}, {"w": "Keras", "b": [0.1294, 0.1793, 0.1882, 0.199]}, {"w": "has", "b": [0.1945, 0.1793, 0.2282, 0.199]}, {"w": "grown", "b": [0.2345, 0.1793, 0.2989, 0.199]}, {"w": "to", "b": [0.3052, 0.1793, 0.3249, 0.199]}, {"w": "have", "b": [0.3312, 0.1793, 0.3788, 0.199]}, {"w": "hundreds", "b": [0.3851, 0.1793, 0.4776, 0.199]}, {"w": "of", "b": [0.4839, 0.1793, 0.5049, 0.199]}, {"w": "open", "b": [0.5112, 0.1793, 0.5602, 0.199]}, {"w": "source", "b": [0.5665, 0.1793, 0.6324, 0.199]}, {"w": "contributors", "b": [0.6387, 0.1793, 0.7606, 0.199]}, {"w": "and", "b": [0.7669, 0.1793, 0.8033, 0.199]}, {"w": "more", "b": [0.8096, 0.1793, 0.8614, 0.199]}, {"w": "than", "b": [0.1294, 0.1998, 0.1729, 0.2195]}, {"w": "200,000", "b": [0.1792, 0.1998, 0.2611, 0.2195]}, {"w": "users.", "b": [0.2674, 0.1998, 0.3256, 0.2195]}, {"w": "Your", "b": [0.3319, 0.1998, 0.3812, 0.2195]}, {"w": "contributions", "b": [0.3875, 0.1998, 0.5207, 0.2195]}, {"w": "and", "b": [0.527, 0.1998, 0.5634, 0.2195]}, {"w": "feedback", "b": [0.5697, 0.1998, 0.6607, 0.2195]}, {"w": "have", "b": [0.667, 0.1998, 0.7147, 0.2195]}, {"w": "turned", "b": [0.721, 0.1998, 0.7854, 0.2195]}, {"w": "Keras", "b": [0.7917, 0.1998, 0.8506, 0.2195]}, {"w": "into", "b": [0.1294, 0.2203, 0.1687, 0.24]}, {"w": "what", "b": [0.175, 0.2203, 0.224, 0.24]}, {"w": "it", "b": [0.2303, 0.2203, 0.2443, 0.24]}, {"w": "is", "b": [0.2506, 0.2203, 0.2675, 0.24]}, {"w": "today.", "b": [0.2738, 0.2203, 0.3345, 0.24]}]}, {"id": "b_2", "type": "paragraph", "text": "I’d also like to thank Google for backing the Keras project. It has been fantastic to see Keras adopted as TensorFlow’s high-level API. A smooth integration between Keras and TensorFlow greatly benefits both TensorFlow users and Keras users and makes deep learning accessible to most.", "words": [{"w": "I’d", "b": [0.1294, 0.263, 0.1588, 0.2828]}, {"w": "also", "b": [0.1651, 0.263, 0.2058, 0.2828]}, {"w": "like", "b": [0.2121, 0.263, 0.2499, 0.2828]}, {"w": "to", "b": [0.2562, 0.263, 0.2758, 0.2828]}, {"w": "thank", "b": [0.2822, 0.263, 0.3382, 0.2828]}, {"w": "Google", "b": [0.3445, 0.263, 0.4188, 0.2828]}, {"w": "for", "b": [0.4251, 0.263, 0.4545, 0.2828]}, {"w": "backing", "b": [0.4608, 0.263, 0.5407, 0.2828]}, {"w": "the", "b": [0.547, 0.263, 0.5778, 0.2828]}, {"w": "Keras", "b": [0.5841, 0.263, 0.6429, 0.2828]}, {"w": "project.", "b": [0.6492, 0.263, 0.7256, 0.2828]}, {"w": "It", "b": [0.7319, 0.263, 0.7473, 0.2828]}, {"w": "has", "b": [0.7536, 0.263, 0.7872, 0.2828]}, {"w": "been", "b": [0.7936, 0.263, 0.8412, 0.2828]}, {"w": "fantastic", "b": [0.1294, 0.2835, 0.2149, 0.3033]}, {"w": "to", "b": [0.2212, 0.2835, 0.2408, 0.3033]}, {"w": "see", "b": [0.2471, 0.2835, 0.2793, 0.3033]}, {"w": "Keras", "b": [0.2856, 0.2835, 0.3445, 0.3033]}, {"w": "adopted", "b": [0.3508, 0.2835, 0.4306, 0.3033]}, {"w": "as", "b": [0.4369, 0.2835, 0.458, 0.3033]}, {"w": "TensorFlow’s", "b": [0.4643, 0.2835, 0.6012, 0.3033]}, {"w": "high-level", "b": [0.6075, 0.2835, 0.7098, 0.3033]}, {"w": "API.", "b": [0.7161, 0.2835, 0.763, 0.3033]}, {"w": "A", "b": [0.7693, 0.2835, 0.7875, 0.3033]}, {"w": "smooth", "b": [0.7938, 0.2835, 0.8681, 0.3033]}, {"w": "integration", "b": [0.1294, 0.304, 0.2387, 0.3238]}, {"w": "between", "b": [0.245, 0.304, 0.3291, 0.3238]}, {"w": "Keras", "b": [0.3354, 0.304, 0.3942, 0.3238]}, {"w": "and", "b": [0.4005, 0.304, 0.4369, 0.3238]}, {"w": "TensorFlow", "b": [0.4432, 0.304, 0.5634, 0.3238]}, {"w": "greatly", "b": [0.5697, 0.304, 0.6397, 0.3238]}, {"w": "benefits", "b": [0.646, 0.304, 0.7259, 0.3238]}, {"w": "both", "b": [0.7322, 0.304, 0.777, 0.3238]}, {"w": "TensorFlow", "b": [0.1294, 0.3245, 0.2496, 0.3443]}, {"w": "users", "b": [0.2559, 0.3245, 0.3077, 0.3443]}, {"w": "and", "b": [0.314, 0.3245, 0.3504, 0.3443]}, {"w": "Keras", "b": [0.3567, 0.3245, 0.4156, 0.3443]}, {"w": "users", "b": [0.4219, 0.3245, 0.4737, 0.3443]}, {"w": "and", "b": [0.48, 0.3245, 0.5165, 0.3443]}, {"w": "makes", "b": [0.5228, 0.3245, 0.5872, 0.3443]}, {"w": "deep", "b": [0.5935, 0.3245, 0.6411, 0.3443]}, {"w": "learning", "b": [0.6474, 0.3245, 0.7301, 0.3443]}, {"w": "accessible", "b": [0.7364, 0.3245, 0.8387, 0.3443]}, {"w": "to", "b": [0.845, 0.3245, 0.8646, 0.3443]}, {"w": "most.", "b": [0.1294, 0.345, 0.1848, 0.3648]}]}, {"id": "b_3", "type": "paragraph", "text": "I want to thank the people at Manning who made this book possible: publisher Marjan Bace and everyone on the editorial and production teams, including Christina Taylor, Janet Vail, Tiffany Taylor, Katie Tennant, Dottie Marsico, and many others who worked behind the scenes.", "words": [{"w": "I", "b": [0.1294, 0.3878, 0.1378, 0.4076]}, {"w": "want", "b": [0.1441, 0.3878, 0.1932, 0.4076]}, {"w": "to", "b": [0.1995, 0.3878, 0.2191, 0.4076]}, {"w": "thank", "b": [0.2254, 0.3878, 0.2814, 0.4076]}, {"w": "the", "b": [0.2878, 0.3878, 0.3186, 0.4076]}, {"w": "people", "b": [0.3249, 0.3878, 0.3921, 0.4076]}, {"w": "at", "b": [0.3984, 0.3878, 0.4167, 0.4076]}, {"w": "Manning", "b": [0.423, 0.3878, 0.5141, 0.4076]}, {"w": "who", "b": [0.5204, 0.3878, 0.5638, 0.4076]}, {"w": "made", "b": [0.5701, 0.3878, 0.6247, 0.4076]}, {"w": "this", "b": [0.6311, 0.3878, 0.6675, 0.4076]}, {"w": "book", "b": [0.6738, 0.3878, 0.7243, 0.4076]}, {"w": "possible:", "b": [0.7306, 0.3878, 0.8203, 0.4076]}, {"w": "publisher", "b": [0.1294, 0.4083, 0.2233, 0.4281]}, {"w": "Marjan", "b": [0.2296, 0.4083, 0.3025, 0.4281]}, {"w": "Bace", "b": [0.3088, 0.4083, 0.3592, 0.4281]}, {"w": "and", "b": [0.3655, 0.4083, 0.4019, 0.4281]}, {"w": "everyone", "b": [0.4082, 0.4083, 0.5007, 0.4281]}, {"w": "on", "b": [0.507, 0.4083, 0.5322, 0.4281]}, {"w": "the", "b": [0.5385, 0.4083, 0.5693, 0.4281]}, {"w": "editorial", "b": [0.5757, 0.4083, 0.6597, 0.4281]}, {"w": "and", "b": [0.666, 0.4083, 0.7025, 0.4281]}, {"w": "production", "b": [0.7087, 0.4083, 0.818, 0.4281]}, {"w": "teams,", "b": [0.1294, 0.4288, 0.1946, 0.4486]}, {"w": "including", "b": [0.2009, 0.4288, 0.2962, 0.4486]}, {"w": "Christina", "b": [0.3025, 0.4288, 0.395, 0.4486]}, {"w": "Taylor,", "b": [0.4013, 0.4288, 0.472, 0.4486]}, {"w": "Janet", "b": [0.4783, 0.4288, 0.5302, 0.4486]}, {"w": "Vail,", "b": [0.5365, 0.4288, 0.5834, 0.4486]}, {"w": "Tiffany", "b": [0.5897, 0.4288, 0.664, 0.4486]}, {"w": "Taylor,", "b": [0.6703, 0.4288, 0.7411, 0.4486]}, {"w": "Katie", "b": [0.7474, 0.4288, 0.802, 0.4486]}, {"w": "Tennant,", "b": [0.1294, 0.4493, 0.2166, 0.4691]}, {"w": "Dottie", "b": [0.2229, 0.4493, 0.286, 0.4691]}, {"w": "Marsico,", "b": [0.2923, 0.4493, 0.3813, 0.4691]}, {"w": "and", "b": [0.3876, 0.4493, 0.424, 0.4691]}, {"w": "many", "b": [0.4303, 0.4493, 0.4864, 0.4691]}, {"w": "others", "b": [0.4927, 0.4493, 0.5543, 0.4691]}, {"w": "who", "b": [0.5606, 0.4493, 0.6041, 0.4691]}, {"w": "worked", "b": [0.6103, 0.4493, 0.686, 0.4691]}, {"w": "behind", "b": [0.6923, 0.4493, 0.7609, 0.4691]}, {"w": "the", "b": [0.7672, 0.4493, 0.7981, 0.4691]}, {"w": "scenes.", "b": [0.1294, 0.4698, 0.2016, 0.4896]}]}, {"id": "b_4", "type": "paragraph", "text": "Many thanks go to the technical peer reviewers led by Aleksandar Dragosavljević—Diego Acuña Rozas, Geoff Barto, David Blumenthal- Barby, Abel Brown, Clark Dorman, Clark Gaylord, Thomas Heiman, Wilson Mar, Sumit Pal, Vladimir Pasman, Gustavo Patino, Peter Rabinovitch, Alvin Raj, Claudio Rodriguez, Srdjan Santic, Richard Tobias, Martin Verzilli, William E. Wheeler, and Daniel Williams—and the forum contributors. Their contributions included catching technical mistakes, errors in terminology, and typos, and making topic suggestions. Each pass through the review process and each piece of feedback implemented through the forum topics shaped and molded the manuscript.", "words": [{"w": "Many", "b": [0.1294, 0.5126, 0.1883, 0.5324]}, {"w": "thanks", "b": [0.1946, 0.5126, 0.2604, 0.5324]}, {"w": "go", "b": [0.2667, 0.5126, 0.292, 0.5324]}, {"w": "to", "b": [0.2983, 0.5126, 0.3179, 0.5324]}, {"w": "the", "b": [0.3242, 0.5126, 0.355, 0.5324]}, {"w": "technical", "b": [0.3613, 0.5126, 0.4524, 0.5324]}, {"w": "peer", "b": [0.4587, 0.5126, 0.5021, 0.5324]}, {"w": "reviewers", "b": [0.5084, 0.5126, 0.6065, 0.5324]}, {"w": "led", "b": [0.6128, 0.5126, 0.6436, 0.5324]}, {"w": "by", "b": [0.6499, 0.5126, 0.6751, 0.5324]}, {"w": "Aleksandar", "b": [0.6815, 0.5126, 0.7963, 0.5324]}, {"w": "Dragosavljević—Diego", "b": [0.1294, 0.5331, 0.369, 0.5529]}, {"w": "Acuña", "b": [0.3753, 0.5331, 0.4412, 0.5529]}, {"w": "Rozas,", "b": [0.4475, 0.5331, 0.5154, 0.5529]}, {"w": "Geoff", "b": [0.5217, 0.5331, 0.5801, 0.5529]}, {"w": "Barto,", "b": [0.5864, 0.5331, 0.6487, 0.5529]}, {"w": "David", "b": [0.655, 0.5331, 0.7167, 0.5529]}, {"w": "Blumenthal-", "b": [0.723, 0.5331, 0.8491, 0.5529]}, {"w": "Barby,", "b": [0.1294, 0.5536, 0.1957, 0.5734]}, {"w": "Abel", "b": [0.202, 0.5536, 0.2511, 0.5734]}, {"w": "Brown,", "b": [0.2574, 0.5536, 0.3324, 0.5734]}, {"w": "Clark", "b": [0.3387, 0.5536, 0.3947, 0.5734]}, {"w": "Dorman,", "b": [0.401, 0.5536, 0.49, 0.5734]}, {"w": "Clark", "b": [0.4963, 0.5536, 0.5523, 0.5734]}, {"w": "Gaylord,", "b": [0.5587, 0.5536, 0.6476, 0.5734]}, {"w": "Thomas", "b": [0.6539, 0.5536, 0.7352, 0.5734]}, {"w": "Heiman,", "b": [0.7415, 0.5536, 0.8277, 0.5734]}, {"w": "Wilson", "b": [0.1294, 0.5741, 0.2013, 0.5939]}, {"w": "Mar,", "b": [0.2076, 0.5741, 0.2549, 0.5939]}, {"w": "Sumit", "b": [0.2612, 0.5741, 0.3215, 0.5939]}, {"w": "Pal,", "b": [0.3278, 0.5741, 0.3663, 0.5939]}, {"w": "Vladimir", "b": [0.3727, 0.5741, 0.4637, 0.5939]}, {"w": "Pasman,", "b": [0.4701, 0.5741, 0.5548, 0.5939]}, {"w": "Gustavo", "b": [0.5611, 0.5741, 0.6452, 0.5939]}, {"w": "Patino,", "b": [0.6515, 0.5741, 0.7223, 0.5939]}, {"w": "Peter", "b": [0.7286, 0.5741, 0.7805, 0.5939]}, {"w": "Rabinovitch,", "b": [0.1294, 0.5946, 0.259, 0.6144]}, {"w": "Alvin", "b": [0.2653, 0.5946, 0.3228, 0.6144]}, {"w": "Raj,", "b": [0.3291, 0.5946, 0.3704, 0.6144]}, {"w": "Claudio", "b": [0.3767, 0.5946, 0.4566, 0.6144]}, {"w": "Rodriguez,", "b": [0.4629, 0.5946, 0.5743, 0.6144]}, {"w": "Srdjan", "b": [0.5806, 0.5946, 0.6465, 0.6144]}, {"w": "Santic,", "b": [0.6528, 0.5946, 0.7222, 0.6144]}, {"w": "Richard", "b": [0.7285, 0.5946, 0.8084, 0.6144]}, {"w": "Tobias,", "b": [0.1294, 0.6151, 0.2026, 0.6349]}, {"w": "Martin", "b": [0.2089, 0.6151, 0.2776, 0.6349]}, {"w": "Verzilli,", "b": [0.2839, 0.6151, 0.3645, 0.6349]}, {"w": "William", "b": [0.3708, 0.6151, 0.4524, 0.6349]}, {"w": "E.", "b": [0.4587, 0.6151, 0.4804, 0.6349]}, {"w": "Wheeler,", "b": [0.4868, 0.6151, 0.5774, 0.6349]}, {"w": "and", "b": [0.5837, 0.6151, 0.6202, 0.6349]}, {"w": "Daniel", "b": [0.6265, 0.6151, 0.6937, 0.6349]}, {"w": "Williams—and", "b": [0.7, 0.6151, 0.8532, 0.6349]}, {"w": "the", "b": [0.1294, 0.6356, 0.1602, 0.6554]}, {"w": "forum", "b": [0.1665, 0.6356, 0.2282, 0.6554]}, {"w": "contributors.", "b": [0.2345, 0.6356, 0.3627, 0.6554]}, {"w": "Their", "b": [0.369, 0.6356, 0.4237, 0.6554]}, {"w": "contributions", "b": [0.43, 0.6356, 0.5631, 0.6554]}, {"w": "included", "b": [0.5694, 0.6356, 0.6563, 0.6554]}, {"w": "catching", "b": [0.6626, 0.6356, 0.7481, 0.6554]}, {"w": "technical", "b": [0.7544, 0.6356, 0.8454, 0.6554]}, {"w": "mistakes,", "b": [0.1294, 0.6561, 0.224, 0.6759]}, {"w": "errors", "b": [0.2303, 0.6561, 0.2891, 0.6759]}, {"w": "in", "b": [0.2954, 0.6561, 0.3151, 0.6759]}, {"w": "terminology,", "b": [0.3214, 0.6561, 0.4493, 0.6759]}, {"w": "and", "b": [0.4556, 0.6561, 0.4921, 0.6759]}, {"w": "typos,", "b": [0.4984, 0.6561, 0.5594, 0.6759]}, {"w": "and", "b": [0.5657, 0.6561, 0.6021, 0.6759]}, {"w": "making", "b": [0.6084, 0.6561, 0.6841, 0.6759]}, {"w": "topic", "b": [0.6904, 0.6561, 0.7408, 0.6759]}, {"w": "suggestions.", "b": [0.1294, 0.6766, 0.2534, 0.6964]}, {"w": "Each", "b": [0.2598, 0.6766, 0.3102, 0.6964]}, {"w": "pass", "b": [0.3165, 0.6766, 0.3599, 0.6964]}, {"w": "through", "b": [0.3662, 0.6766, 0.4447, 0.6964]}, {"w": "the", "b": [0.451, 0.6766, 0.4818, 0.6964]}, {"w": "review", "b": [0.4881, 0.6766, 0.5568, 0.6964]}, {"w": "process", "b": [0.5631, 0.6766, 0.6387, 0.6964]}, {"w": "and", "b": [0.6451, 0.6766, 0.6815, 0.6964]}, {"w": "each", "b": [0.6878, 0.6766, 0.734, 0.6964]}, {"w": "piece", "b": [0.7403, 0.6766, 0.7935, 0.6964]}, {"w": "of", "b": [0.7998, 0.6766, 0.8209, 0.6964]}, {"w": "feedback", "b": [0.1294, 0.6971, 0.2205, 0.7169]}, {"w": "implemented", "b": [0.2268, 0.6971, 0.3585, 0.7169]}, {"w": "through", "b": [0.3648, 0.6971, 0.4433, 0.7169]}, {"w": "the", "b": [0.4496, 0.6971, 0.4804, 0.7169]}, {"w": "forum", "b": [0.4867, 0.6971, 0.5484, 0.7169]}, {"w": "topics", "b": [0.5547, 0.6971, 0.6149, 0.7169]}, {"w": "shaped", "b": [0.6212, 0.6971, 0.6913, 0.7169]}, {"w": "and", "b": [0.6975, 0.6971, 0.7339, 0.7169]}, {"w": "molded", "b": [0.7402, 0.6971, 0.8159, 0.7169]}, {"w": "the", "b": [0.8222, 0.6971, 0.853, 0.7169]}, {"w": "manuscript.", "b": [0.1294, 0.7176, 0.2478, 0.7374]}]}, {"id": "b_5", "type": "paragraph", "text": "On the technical side, special thanks go to Jerry Gaines, who served as the book’s technical editor; and Alex Ott and Richard Tobias, who served as the book’s technical proofreaders. They’re the best technical editors I could have hoped for.", "words": [{"w": "On", "b": [0.1294, 0.7604, 0.1602, 0.7801]}, {"w": "the", "b": [0.1665, 0.7604, 0.1974, 0.7801]}, {"w": "technical", "b": [0.2037, 0.7604, 0.2947, 0.7801]}, {"w": "side,", "b": [0.301, 0.7604, 0.348, 0.7801]}, {"w": "special", "b": [0.3543, 0.7604, 0.4244, 0.7801]}, {"w": "thanks", "b": [0.4307, 0.7604, 0.4965, 0.7801]}, {"w": "go", "b": [0.5028, 0.7604, 0.5281, 0.7801]}, {"w": "to", "b": [0.5344, 0.7604, 0.554, 0.7801]}, {"w": "Jerry", "b": [0.5603, 0.7604, 0.6107, 0.7801]}, {"w": "Gaines,", "b": [0.617, 0.7604, 0.6934, 0.7801]}, {"w": "who", "b": [0.6997, 0.7604, 0.7431, 0.7801]}, {"w": "served", "b": [0.7494, 0.7604, 0.8153, 0.7801]}, {"w": "as", "b": [0.8216, 0.7604, 0.8426, 0.7801]}, {"w": "the", "b": [0.1294, 0.7809, 0.1602, 0.8006]}, {"w": "book’s", "b": [0.1665, 0.7809, 0.2338, 0.8006]}, {"w": "technical", "b": [0.2401, 0.7809, 0.3312, 0.8006]}, {"w": "editor;", "b": [0.3375, 0.7809, 0.4034, 0.8006]}, {"w": "and", "b": [0.4097, 0.7809, 0.4461, 0.8006]}, {"w": "Alex", "b": [0.4524, 0.7809, 0.5014, 0.8006]}, {"w": "Ott", "b": [0.5077, 0.7809, 0.54, 0.8006]}, {"w": "and", "b": [0.5463, 0.7809, 0.5827, 0.8006]}, {"w": "Richard", "b": [0.589, 0.7809, 0.6689, 0.8006]}, {"w": "Tobias,", "b": [0.6751, 0.7809, 0.7483, 0.8006]}, {"w": "who", "b": [0.7546, 0.7809, 0.7981, 0.8006]}, {"w": "served", "b": [0.8044, 0.7809, 0.8702, 0.8006]}, {"w": "as", "b": [0.1294, 0.8014, 0.1504, 0.8211]}, {"w": "the", "b": [0.1567, 0.8014, 0.1876, 0.8211]}, {"w": "book’s", "b": [0.1939, 0.8014, 0.2611, 0.8211]}, {"w": "technical", "b": [0.2674, 0.8014, 0.3585, 0.8211]}, {"w": "proofreaders.", "b": [0.3648, 0.8014, 0.4986, 0.8211]}, {"w": "They’re", "b": [0.5049, 0.8014, 0.5847, 0.8211]}, {"w": "the", "b": [0.591, 0.8014, 0.6219, 0.8211]}, {"w": "best", "b": [0.6282, 0.8014, 0.6688, 0.8211]}, {"w": "technical", "b": [0.6751, 0.8014, 0.7662, 0.8211]}, {"w": "editors", "b": [0.7725, 0.8014, 0.8411, 0.8211]}, {"w": "I", "b": [0.8475, 0.8014, 0.8559, 0.8211]}, {"w": "could", "b": [0.1294, 0.8219, 0.1855, 0.8416]}, {"w": "have", "b": [0.1918, 0.8219, 0.2394, 0.8416]}, {"w": "hoped", "b": [0.2457, 0.8219, 0.3074, 0.8416]}, {"w": "for.", "b": [0.3137, 0.8219, 0.348, 0.8416]}]}, {"id": "b_6", "type": "paragraph", "text": "Finally, I’d like to express my gratitude to my wife Maria for being extremely supportive throughout the development of Keras and the", "words": [{"w": "Finally,", "b": [0.1294, 0.8647, 0.2056, 0.8844]}, {"w": "I’d", "b": [0.2119, 0.8647, 0.2413, 0.8844]}, {"w": "like", "b": [0.2476, 0.8647, 0.2854, 0.8844]}, {"w": "to", "b": [0.2917, 0.8647, 0.3114, 0.8844]}, {"w": "express", "b": [0.3177, 0.8647, 0.3933, 0.8844]}, {"w": "my", "b": [0.3996, 0.8647, 0.4319, 0.8844]}, {"w": "gratitude", "b": [0.4382, 0.8647, 0.5278, 0.8844]}, {"w": "to", "b": [0.5341, 0.8647, 0.5538, 0.8844]}, {"w": "my", "b": [0.5601, 0.8647, 0.5923, 0.8844]}, {"w": "wife", "b": [0.5986, 0.8647, 0.6435, 0.8844]}, {"w": "Maria", "b": [0.6498, 0.8647, 0.71, 0.8844]}, {"w": "for", "b": [0.7163, 0.8647, 0.7457, 0.8844]}, {"w": "being", "b": [0.752, 0.8647, 0.8081, 0.8844]}, {"w": "extremely", "b": [0.1294, 0.8852, 0.2303, 0.9049]}, {"w": "supportive", "b": [0.2366, 0.8852, 0.3431, 0.9049]}, {"w": "throughout", "b": [0.3494, 0.8852, 0.4601, 0.9049]}, {"w": "the", "b": [0.4664, 0.8852, 0.4973, 0.9049]}, {"w": "development", "b": [0.5036, 0.8852, 0.6339, 0.9049]}, {"w": "of", "b": [0.6402, 0.8852, 0.6612, 0.9049]}, {"w": "Keras", "b": [0.6675, 0.8852, 0.7263, 0.9049]}, {"w": "and", "b": [0.7326, 0.8852, 0.769, 0.9049]}, {"w": "the", "b": [0.7753, 0.8852, 0.8061, 0.9049]}]}]}, {"page": 21, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "writing of this book.", "words": [{"w": "writing", "b": [0.1294, 0.0857, 0.2023, 0.1054]}, {"w": "of", "b": [0.2086, 0.0857, 0.2296, 0.1054]}, {"w": "this", "b": [0.2359, 0.0857, 0.2724, 0.1054]}, {"w": "book.", "b": [0.2787, 0.0857, 0.3354, 0.1054]}]}]}, {"page": 22, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "About this Book", "words": [{"w": "About", "b": [0.1294, 0.1076, 0.2247, 0.1355]}, {"w": "this", "b": [0.2337, 0.1076, 0.2892, 0.1355]}, {"w": "Book", "b": [0.2982, 0.1076, 0.3776, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This book was written for anyone who wishes to explore deep learning from scratch or broaden their understanding of deep learning. Whether you’re a practicing machine-learning engineer, a software developer, or a college student, you’ll find value in these pages.", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1743, 0.1785]}, {"w": "book", "b": [0.1806, 0.1588, 0.231, 0.1785]}, {"w": "was", "b": [0.2373, 0.1588, 0.2766, 0.1785]}, {"w": "written", "b": [0.2829, 0.1588, 0.3543, 0.1785]}, {"w": "for", "b": [0.3606, 0.1588, 0.39, 0.1785]}, {"w": "anyone", "b": [0.3964, 0.1588, 0.4692, 0.1785]}, {"w": "who", "b": [0.4755, 0.1588, 0.5189, 0.1785]}, {"w": "wishes", "b": [0.5253, 0.1588, 0.5939, 0.1785]}, {"w": "to", "b": [0.6002, 0.1588, 0.6199, 0.1785]}, {"w": "explore", "b": [0.6262, 0.1588, 0.7018, 0.1785]}, {"w": "deep", "b": [0.7081, 0.1588, 0.7557, 0.1785]}, {"w": "learning", "b": [0.762, 0.1588, 0.8447, 0.1785]}, {"w": "from", "b": [0.1294, 0.1793, 0.1785, 0.199]}, {"w": "scratch", "b": [0.1848, 0.1793, 0.2562, 0.199]}, {"w": "or", "b": [0.2625, 0.1793, 0.2835, 0.199]}, {"w": "broaden", "b": [0.2898, 0.1793, 0.3711, 0.199]}, {"w": "their", "b": [0.3774, 0.1793, 0.4236, 0.199]}, {"w": "understanding", "b": [0.4299, 0.1793, 0.5729, 0.199]}, {"w": "of", "b": [0.5792, 0.1793, 0.6002, 0.199]}, {"w": "deep", "b": [0.6065, 0.1793, 0.6541, 0.199]}, {"w": "learning.", "b": [0.6604, 0.1793, 0.7494, 0.199]}, {"w": "Whether", "b": [0.7556, 0.1793, 0.8425, 0.199]}, {"w": "you’re", "b": [0.1294, 0.1998, 0.1953, 0.2195]}, {"w": "a", "b": [0.2016, 0.1998, 0.2128, 0.2195]}, {"w": "practicing", "b": [0.2191, 0.1998, 0.3199, 0.2195]}, {"w": "machine-learning", "b": [0.3262, 0.1998, 0.5028, 0.2195]}, {"w": "engineer,", "b": [0.5091, 0.1998, 0.6012, 0.2195]}, {"w": "a", "b": [0.6075, 0.1998, 0.6187, 0.2195]}, {"w": "software", "b": [0.625, 0.1998, 0.7118, 0.2195]}, {"w": "developer,", "b": [0.7181, 0.1998, 0.8229, 0.2195]}, {"w": "or", "b": [0.8292, 0.1998, 0.8502, 0.2195]}, {"w": "a", "b": [0.8565, 0.1998, 0.8677, 0.2195]}, {"w": "college", "b": [0.1294, 0.2203, 0.2023, 0.24]}, {"w": "student,", "b": [0.2086, 0.2203, 0.2878, 0.24]}, {"w": "you’ll", "b": [0.2941, 0.2203, 0.3543, 0.24]}, {"w": "find", "b": [0.3606, 0.2203, 0.4013, 0.24]}, {"w": "value", "b": [0.4076, 0.2203, 0.4622, 0.24]}, {"w": "in", "b": [0.4685, 0.2203, 0.4881, 0.24]}, {"w": "these", "b": [0.4945, 0.2203, 0.5463, 0.24]}, {"w": "pages.", "b": [0.5525, 0.2203, 0.6163, 0.24]}]}, {"id": "b_2", "type": "paragraph", "text": "This book offers a practical, hands-on exploration of deep learning. It avoids mathematical notation, preferring instead to explain quantitative concepts via code snippets and to build practical intuition about the core ideas of machine learning and deep learning.", "words": [{"w": "This", "b": [0.1294, 0.263, 0.1743, 0.2828]}, {"w": "book", "b": [0.1806, 0.263, 0.231, 0.2828]}, {"w": "offers", "b": [0.2373, 0.263, 0.2957, 0.2828]}, {"w": "a", "b": [0.302, 0.263, 0.3132, 0.2828]}, {"w": "practical,", "b": [0.3195, 0.263, 0.4127, 0.2828]}, {"w": "hands-on", "b": [0.419, 0.263, 0.5115, 0.2828]}, {"w": "exploration", "b": [0.5178, 0.263, 0.6327, 0.2828]}, {"w": "of", "b": [0.639, 0.263, 0.66, 0.2828]}, {"w": "deep", "b": [0.6663, 0.263, 0.7139, 0.2828]}, {"w": "learning.", "b": [0.7202, 0.263, 0.8092, 0.2828]}, {"w": "It", "b": [0.8155, 0.263, 0.8309, 0.2828]}, {"w": "avoids", "b": [0.1294, 0.2835, 0.1953, 0.3033]}, {"w": "mathematical", "b": [0.2016, 0.2835, 0.3375, 0.3033]}, {"w": "notation,", "b": [0.3438, 0.2835, 0.4328, 0.3033]}, {"w": "preferring", "b": [0.4391, 0.2835, 0.54, 0.3033]}, {"w": "instead", "b": [0.5463, 0.2835, 0.6177, 0.3033]}, {"w": "to", "b": [0.624, 0.2835, 0.6437, 0.3033]}, {"w": "explain", "b": [0.6499, 0.2835, 0.7241, 0.3033]}, {"w": "quantitative", "b": [0.7304, 0.2835, 0.8496, 0.3033]}, {"w": "concepts", "b": [0.1294, 0.304, 0.2177, 0.3238]}, {"w": "via", "b": [0.224, 0.304, 0.2548, 0.3238]}, {"w": "code", "b": [0.2611, 0.304, 0.3087, 0.3238]}, {"w": "snippets", "b": [0.315, 0.304, 0.3977, 0.3238]}, {"w": "and", "b": [0.404, 0.304, 0.4405, 0.3238]}, {"w": "to", "b": [0.4468, 0.304, 0.4664, 0.3238]}, {"w": "build", "b": [0.4727, 0.304, 0.5246, 0.3238]}, {"w": "practical", "b": [0.5309, 0.304, 0.6177, 0.3238]}, {"w": "intuition", "b": [0.624, 0.304, 0.7096, 0.3238]}, {"w": "about", "b": [0.7159, 0.304, 0.7719, 0.3238]}, {"w": "the", "b": [0.7782, 0.304, 0.809, 0.3238]}, {"w": "core", "b": [0.8154, 0.304, 0.8588, 0.3238]}, {"w": "ideas", "b": [0.1294, 0.3245, 0.1813, 0.3443]}, {"w": "of", "b": [0.1876, 0.3245, 0.2086, 0.3443]}, {"w": "machine", "b": [0.2149, 0.3245, 0.3003, 0.3443]}, {"w": "learning", "b": [0.3066, 0.3245, 0.3893, 0.3443]}, {"w": "and", "b": [0.3956, 0.3245, 0.432, 0.3443]}, {"w": "deep", "b": [0.4383, 0.3245, 0.4859, 0.3443]}, {"w": "learning.", "b": [0.4922, 0.3245, 0.5812, 0.3443]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ll learn from more than 30 code examples that include detailed commentary, practical recommendations, and simple high-level explanations of everything you need to know to start using deep learning to solve concrete problems.", "words": [{"w": "You’ll", "b": [0.1294, 0.3673, 0.1928, 0.3871]}, {"w": "learn", "b": [0.1991, 0.3673, 0.2495, 0.3871]}, {"w": "from", "b": [0.2558, 0.3673, 0.3048, 0.3871]}, {"w": "more", "b": [0.3111, 0.3673, 0.363, 0.3871]}, {"w": "than", "b": [0.3693, 0.3673, 0.4127, 0.3871]}, {"w": "30", "b": [0.419, 0.3673, 0.4443, 0.3871]}, {"w": "code", "b": [0.4506, 0.3673, 0.4982, 0.3871]}, {"w": "examples", "b": [0.5045, 0.3673, 0.5998, 0.3871]}, {"w": "that", "b": [0.6061, 0.3673, 0.6439, 0.3871]}, {"w": "include", "b": [0.6502, 0.3673, 0.7245, 0.3871]}, {"w": "detailed", "b": [0.7308, 0.3673, 0.8107, 0.3871]}, {"w": "commentary,", "b": [0.1294, 0.3878, 0.2602, 0.4076]}, {"w": "practical", "b": [0.2665, 0.3878, 0.3533, 0.4076]}, {"w": "recommendations,", "b": [0.3596, 0.3878, 0.5453, 0.4076]}, {"w": "and", "b": [0.5516, 0.3878, 0.588, 0.4076]}, {"w": "simple", "b": [0.5943, 0.3878, 0.6616, 0.4076]}, {"w": "high-level", "b": [0.6679, 0.3878, 0.7702, 0.4076]}, {"w": "explanations", "b": [0.1294, 0.4083, 0.2569, 0.4281]}, {"w": "of", "b": [0.2632, 0.4083, 0.2842, 0.4281]}, {"w": "everything", "b": [0.2906, 0.4083, 0.3984, 0.4281]}, {"w": "you", "b": [0.4048, 0.4083, 0.4426, 0.4281]}, {"w": "need", "b": [0.4489, 0.4083, 0.4965, 0.4281]}, {"w": "to", "b": [0.5028, 0.4083, 0.5225, 0.4281]}, {"w": "know", "b": [0.5288, 0.4083, 0.5848, 0.4281]}, {"w": "to", "b": [0.5911, 0.4083, 0.6107, 0.4281]}, {"w": "start", "b": [0.6171, 0.4083, 0.6605, 0.4281]}, {"w": "using", "b": [0.6668, 0.4083, 0.7215, 0.4281]}, {"w": "deep", "b": [0.7278, 0.4083, 0.7754, 0.4281]}, {"w": "learning", "b": [0.7817, 0.4083, 0.8644, 0.4281]}, {"w": "to", "b": [0.1294, 0.4288, 0.149, 0.4486]}, {"w": "solve", "b": [0.1553, 0.4288, 0.2086, 0.4486]}, {"w": "concrete", "b": [0.2149, 0.4288, 0.3003, 0.4486]}, {"w": "problems.", "b": [0.3066, 0.4288, 0.4068, 0.4486]}]}, {"id": "b_4", "type": "paragraph", "text": "The code examples use the Python deep-learning framework Keras, with TensorFlow as a backend engine. Keras, one of the most popular and fastest-growing deep-learning frameworks, is widely recommended as the best tool to get started with deep learning.", "words": [{"w": "The", "b": [0.1294, 0.4716, 0.1686, 0.4914]}, {"w": "code", "b": [0.1749, 0.4716, 0.2226, 0.4914]}, {"w": "examples", "b": [0.2289, 0.4716, 0.3242, 0.4914]}, {"w": "use", "b": [0.3305, 0.4716, 0.3641, 0.4914]}, {"w": "the", "b": [0.3704, 0.4716, 0.4012, 0.4914]}, {"w": "Python", "b": [0.4075, 0.4716, 0.479, 0.4914]}, {"w": "deep-learning", "b": [0.4853, 0.4716, 0.624, 0.4914]}, {"w": "framework", "b": [0.6303, 0.4716, 0.741, 0.4914]}, {"w": "Keras,", "b": [0.7473, 0.4716, 0.8124, 0.4914]}, {"w": "with", "b": [0.8187, 0.4716, 0.8636, 0.4914]}, {"w": "TensorFlow", "b": [0.1294, 0.4921, 0.2496, 0.5119]}, {"w": "as", "b": [0.2559, 0.4921, 0.2769, 0.5119]}, {"w": "a", "b": [0.2832, 0.4921, 0.2944, 0.5119]}, {"w": "backend", "b": [0.3007, 0.4921, 0.3847, 0.5119]}, {"w": "engine.", "b": [0.3911, 0.4921, 0.4646, 0.5119]}, {"w": "Keras,", "b": [0.4709, 0.4921, 0.5361, 0.5119]}, {"w": "one", "b": [0.5424, 0.4921, 0.5788, 0.5119]}, {"w": "of", "b": [0.5851, 0.4921, 0.6061, 0.5119]}, {"w": "the", "b": [0.6124, 0.4921, 0.6432, 0.5119]}, {"w": "most", "b": [0.6495, 0.4921, 0.6986, 0.5119]}, {"w": "popular", "b": [0.7049, 0.4921, 0.7819, 0.5119]}, {"w": "and", "b": [0.7882, 0.4921, 0.8247, 0.5119]}, {"w": "fastest-growing", "b": [0.1294, 0.5126, 0.2863, 0.5324]}, {"w": "deep-learning", "b": [0.2926, 0.5126, 0.4313, 0.5324]}, {"w": "frameworks,", "b": [0.4376, 0.5126, 0.5644, 0.5324]}, {"w": "is", "b": [0.5707, 0.5126, 0.5876, 0.5324]}, {"w": "widely", "b": [0.5939, 0.5126, 0.6625, 0.5324]}, {"w": "recommended", "b": [0.6688, 0.5126, 0.8117, 0.5324]}, {"w": "as", "b": [0.8181, 0.5126, 0.8391, 0.5324]}, {"w": "the", "b": [0.1294, 0.5331, 0.1602, 0.5529]}, {"w": "best", "b": [0.1665, 0.5331, 0.2072, 0.5529]}, {"w": "tool", "b": [0.2135, 0.5331, 0.2527, 0.5529]}, {"w": "to", "b": [0.259, 0.5331, 0.2787, 0.5529]}, {"w": "get", "b": [0.285, 0.5331, 0.3158, 0.5529]}, {"w": "started", "b": [0.3221, 0.5331, 0.3894, 0.5529]}, {"w": "with", "b": [0.3957, 0.5331, 0.4405, 0.5529]}, {"w": "deep", "b": [0.4468, 0.5331, 0.4945, 0.5529]}, {"w": "learning.", "b": [0.5008, 0.5331, 0.5897, 0.5529]}]}, {"id": "b_5", "type": "paragraph", "text": "After reading this book, you’ll have a solid understand of what deep learning is, when it’s applicable, and what its limitations are. You’ll be familiar with the standard workflow for approaching and solving machine-learning problems, and you’ll know how to address commonly encountered issues. You’ll be able to use Keras to tackle real-world problems ranging from computer vision to natural-language processing: image classification, timeseries forecasting, sentiment analysis, image and text generation, and more.", "words": [{"w": "After", "b": [0.1294, 0.5759, 0.1826, 0.5956]}, {"w": "reading", "b": [0.1889, 0.5759, 0.2646, 0.5956]}, {"w": "this", "b": [0.2709, 0.5759, 0.3074, 0.5956]}, {"w": "book,", "b": [0.3137, 0.5759, 0.3704, 0.5956]}, {"w": "you’ll", "b": [0.3767, 0.5759, 0.437, 0.5956]}, {"w": "have", "b": [0.4433, 0.5759, 0.4909, 0.5956]}, {"w": "a", "b": [0.4972, 0.5759, 0.5084, 0.5956]}, {"w": "solid", "b": [0.5147, 0.5759, 0.5638, 0.5956]}, {"w": "understand", "b": [0.5701, 0.5759, 0.6808, 0.5956]}, {"w": "of", "b": [0.6871, 0.5759, 0.7081, 0.5956]}, {"w": "what", "b": [0.7144, 0.5759, 0.7635, 0.5956]}, {"w": "deep", "b": [0.7698, 0.5759, 0.8174, 0.5956]}, {"w": "learning", "b": [0.1294, 0.5964, 0.2121, 0.6161]}, {"w": "is,", "b": [0.2184, 0.5964, 0.2415, 0.6161]}, {"w": "when", "b": [0.2478, 0.5964, 0.3025, 0.6161]}, {"w": "it’s", "b": [0.3088, 0.5964, 0.3396, 0.6161]}, {"w": "applicable,", "b": [0.3459, 0.5964, 0.4559, 0.6161]}, {"w": "and", "b": [0.4622, 0.5964, 0.4986, 0.6161]}, {"w": "what", "b": [0.5049, 0.5964, 0.554, 0.6161]}, {"w": "its", "b": [0.5603, 0.5964, 0.5841, 0.6161]}, {"w": "limitations", "b": [0.5904, 0.5964, 0.6984, 0.6161]}, {"w": "are.", "b": [0.7046, 0.5964, 0.7417, 0.6161]}, {"w": "You’ll", "b": [0.748, 0.5964, 0.8113, 0.6161]}, {"w": "be", "b": [0.8176, 0.5964, 0.8414, 0.6161]}, {"w": "familiar", "b": [0.1294, 0.6169, 0.2093, 0.6366]}, {"w": "with", "b": [0.2156, 0.6169, 0.2604, 0.6366]}, {"w": "the", "b": [0.2667, 0.6169, 0.2976, 0.6366]}, {"w": "standard", "b": [0.3039, 0.6169, 0.3893, 0.6366]}, {"w": "workflow", "b": [0.3956, 0.6169, 0.4937, 0.6366]}, {"w": "for", "b": [0.5, 0.6169, 0.5294, 0.6366]}, {"w": "approaching", "b": [0.5357, 0.6169, 0.6604, 0.6366]}, {"w": "and", "b": [0.6667, 0.6169, 0.7032, 0.6366]}, {"w": "solving", "b": [0.7095, 0.6169, 0.7838, 0.6366]}, {"w": "machine-learning", "b": [0.1294, 0.6374, 0.3059, 0.6571]}, {"w": "problems,", "b": [0.3122, 0.6374, 0.4124, 0.6571]}, {"w": "and", "b": [0.4188, 0.6374, 0.4552, 0.6571]}, {"w": "you’ll", "b": [0.4615, 0.6374, 0.5217, 0.6571]}, {"w": "know", "b": [0.5281, 0.6374, 0.5841, 0.6571]}, {"w": "how", "b": [0.5904, 0.6374, 0.6338, 0.6571]}, {"w": "to", "b": [0.6401, 0.6374, 0.6597, 0.6571]}, {"w": "address", "b": [0.666, 0.6374, 0.7417, 0.6571]}, {"w": "commonly", "b": [0.748, 0.6374, 0.8559, 0.6571]}, {"w": "encountered", "b": [0.1294, 0.6579, 0.2527, 0.6776]}, {"w": "issues.", "b": [0.259, 0.6579, 0.3256, 0.6776]}, {"w": "You’ll", "b": [0.3319, 0.6579, 0.3952, 0.6776]}, {"w": "be", "b": [0.4015, 0.6579, 0.4253, 0.6776]}, {"w": "able", "b": [0.4316, 0.6579, 0.4737, 0.6776]}, {"w": "to", "b": [0.48, 0.6579, 0.4996, 0.6776]}, {"w": "use", "b": [0.5059, 0.6579, 0.5395, 0.6776]}, {"w": "Keras", "b": [0.5458, 0.6579, 0.6047, 0.6776]}, {"w": "to", "b": [0.611, 0.6579, 0.6306, 0.6776]}, {"w": "tackle", "b": [0.6369, 0.6579, 0.6971, 0.6776]}, {"w": "real-world", "b": [0.7034, 0.6579, 0.8085, 0.6776]}, {"w": "problems", "b": [0.1294, 0.6784, 0.2233, 0.6981]}, {"w": "ranging", "b": [0.2296, 0.6784, 0.3067, 0.6981]}, {"w": "from", "b": [0.313, 0.6784, 0.362, 0.6981]}, {"w": "computer", "b": [0.3683, 0.6784, 0.4636, 0.6981]}, {"w": "vision", "b": [0.4699, 0.6784, 0.5315, 0.6981]}, {"w": "to", "b": [0.5378, 0.6784, 0.5575, 0.6981]}, {"w": "natural-language", "b": [0.5638, 0.6784, 0.7333, 0.6981]}, {"w": "processing:", "b": [0.7396, 0.6784, 0.8545, 0.6981]}, {"w": "image", "b": [0.1294, 0.6989, 0.1911, 0.7186]}, {"w": "classification,", "b": [0.1974, 0.6989, 0.3368, 0.7186]}, {"w": "timeseries", "b": [0.3431, 0.6989, 0.4454, 0.7186]}, {"w": "forecasting,", "b": [0.4517, 0.6989, 0.5701, 0.7186]}, {"w": "sentiment", "b": [0.5764, 0.6989, 0.6745, 0.7186]}, {"w": "analysis,", "b": [0.6808, 0.6989, 0.7684, 0.7186]}, {"w": "image", "b": [0.7747, 0.6989, 0.8363, 0.7186]}, {"w": "and", "b": [0.1294, 0.7194, 0.1658, 0.7391]}, {"w": "text", "b": [0.1721, 0.7194, 0.21, 0.7391]}, {"w": "generation,", "b": [0.2163, 0.7194, 0.3291, 0.7391]}, {"w": "and", "b": [0.3353, 0.7194, 0.3718, 0.7391]}, {"w": "more.", "b": [0.3781, 0.7194, 0.4362, 0.7391]}]}, {"id": "b_6", "type": "paragraph", "text": "Who should read this book", "words": [{"w": "Who", "b": [0.1294, 0.7762, 0.1878, 0.7985]}, {"w": "should", "b": [0.1949, 0.7762, 0.2753, 0.7985]}, {"w": "read", "b": [0.2824, 0.7762, 0.3371, 0.7985]}, {"w": "this", "b": [0.3442, 0.7762, 0.3883, 0.7985]}, {"w": "book", "b": [0.3954, 0.7762, 0.4554, 0.7985]}]}, {"id": "b_7", "type": "paragraph", "text": "This book is written for people with Python programming experience who want to get started with machine learning and deep learning. But this book can also be valuable to many different types of readers:", "words": [{"w": "This", "b": [0.1294, 0.8219, 0.1743, 0.8416]}, {"w": "book", "b": [0.1806, 0.8219, 0.231, 0.8416]}, {"w": "is", "b": [0.2373, 0.8219, 0.2542, 0.8416]}, {"w": "written", "b": [0.2605, 0.8219, 0.3319, 0.8416]}, {"w": "for", "b": [0.3382, 0.8219, 0.3676, 0.8416]}, {"w": "people", "b": [0.374, 0.8219, 0.4412, 0.8416]}, {"w": "with", "b": [0.4475, 0.8219, 0.4924, 0.8416]}, {"w": "Python", "b": [0.4987, 0.8219, 0.5702, 0.8416]}, {"w": "programming", "b": [0.5765, 0.8219, 0.7138, 0.8416]}, {"w": "experience", "b": [0.7201, 0.8219, 0.8294, 0.8416]}, {"w": "who", "b": [0.1294, 0.8424, 0.1729, 0.8621]}, {"w": "want", "b": [0.1792, 0.8424, 0.2282, 0.8621]}, {"w": "to", "b": [0.2345, 0.8424, 0.2541, 0.8621]}, {"w": "get", "b": [0.2604, 0.8424, 0.2913, 0.8621]}, {"w": "started", "b": [0.2976, 0.8424, 0.3648, 0.8621]}, {"w": "with", "b": [0.3711, 0.8424, 0.416, 0.8621]}, {"w": "machine", "b": [0.4223, 0.8424, 0.5077, 0.8621]}, {"w": "learning", "b": [0.5141, 0.8424, 0.5967, 0.8621]}, {"w": "and", "b": [0.603, 0.8424, 0.6395, 0.8621]}, {"w": "deep", "b": [0.6458, 0.8424, 0.6934, 0.8621]}, {"w": "learning.", "b": [0.6996, 0.8424, 0.7886, 0.8621]}, {"w": "But", "b": [0.7949, 0.8424, 0.8313, 0.8621]}, {"w": "this", "b": [0.1294, 0.8629, 0.1659, 0.8826]}, {"w": "book", "b": [0.1722, 0.8629, 0.2226, 0.8826]}, {"w": "can", "b": [0.2289, 0.8629, 0.2639, 0.8826]}, {"w": "also", "b": [0.2702, 0.8629, 0.3109, 0.8826]}, {"w": "be", "b": [0.3172, 0.8629, 0.341, 0.8826]}, {"w": "valuable", "b": [0.3473, 0.8629, 0.4328, 0.8826]}, {"w": "to", "b": [0.4391, 0.8629, 0.4587, 0.8826]}, {"w": "many", "b": [0.465, 0.8629, 0.5211, 0.8826]}, {"w": "different", "b": [0.5274, 0.8629, 0.6137, 0.8826]}, {"w": "types", "b": [0.62, 0.8629, 0.6733, 0.8826]}, {"w": "of", "b": [0.6796, 0.8629, 0.7006, 0.8826]}, {"w": "readers:", "b": [0.7069, 0.8629, 0.7867, 0.8826]}]}]}, {"page": 23, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "If you’re a data scientist familiar with machine learning, this book will provide you with a solid, practical introduction to deep learning, the fastest-growing and most significant subfield of machine learning. If you’re a deep-learning expert looking to get started with the Keras framework, you’ll find this book to be the best Keras crash course available. If you’re a graduate student studying deep learning in a formal setting, you’ll find this book to be a practical complement to your education, helping you build intuition around the behavior of deep neural networks and familiarizing you with key best practices.", "words": [{"w": "If", "b": [0.1799, 0.0857, 0.1967, 0.1054]}, {"w": "you’re", "b": [0.203, 0.0857, 0.2688, 0.1054]}, {"w": "a", "b": [0.2751, 0.0857, 0.2863, 0.1054]}, {"w": "data", "b": [0.2926, 0.0857, 0.3346, 0.1054]}, {"w": "scientist", "b": [0.341, 0.0857, 0.4236, 0.1054]}, {"w": "familiar", "b": [0.43, 0.0857, 0.5098, 0.1054]}, {"w": "with", "b": [0.5161, 0.0857, 0.561, 0.1054]}, {"w": "machine", "b": [0.5673, 0.0857, 0.6527, 0.1054]}, {"w": "learning,", "b": [0.6591, 0.0857, 0.748, 0.1054]}, {"w": "this", "b": [0.7543, 0.0857, 0.7908, 0.1054]}, {"w": "book", "b": [0.7971, 0.0857, 0.8475, 0.1054]}, {"w": "will", "b": [0.1799, 0.1062, 0.2191, 0.1259]}, {"w": "provide", "b": [0.2254, 0.1062, 0.3025, 0.1259]}, {"w": "you", "b": [0.3088, 0.1062, 0.3466, 0.1259]}, {"w": "with", "b": [0.3529, 0.1062, 0.3978, 0.1259]}, {"w": "a", "b": [0.4041, 0.1062, 0.4153, 0.1259]}, {"w": "solid,", "b": [0.4216, 0.1062, 0.477, 0.1259]}, {"w": "practical", "b": [0.4833, 0.1062, 0.5701, 0.1259]}, {"w": "introduction", "b": [0.5764, 0.1062, 0.6998, 0.1259]}, {"w": "to", "b": [0.706, 0.1062, 0.7256, 0.1259]}, {"w": "deep", "b": [0.7319, 0.1062, 0.7795, 0.1259]}, {"w": "learning,", "b": [0.1799, 0.1267, 0.2688, 0.1464]}, {"w": "the", "b": [0.2751, 0.1267, 0.306, 0.1464]}, {"w": "fastest-growing", "b": [0.3123, 0.1267, 0.4692, 0.1464]}, {"w": "and", "b": [0.4755, 0.1267, 0.5119, 0.1464]}, {"w": "most", "b": [0.5182, 0.1267, 0.5673, 0.1464]}, {"w": "significant", "b": [0.5736, 0.1267, 0.6801, 0.1464]}, {"w": "subfield", "b": [0.6864, 0.1267, 0.7677, 0.1464]}, {"w": "of", "b": [0.774, 0.1267, 0.795, 0.1464]}, {"w": "machine", "b": [0.1799, 0.1472, 0.2653, 0.1669]}, {"w": "learning.", "b": [0.2716, 0.1472, 0.3606, 0.1669]}, {"w": "If", "b": [0.1799, 0.1677, 0.1967, 0.1874]}, {"w": "you’re", "b": [0.203, 0.1677, 0.2688, 0.1874]}, {"w": "a", "b": [0.2751, 0.1677, 0.2863, 0.1874]}, {"w": "deep-learning", "b": [0.2926, 0.1677, 0.4313, 0.1874]}, {"w": "expert", "b": [0.4376, 0.1677, 0.5007, 0.1874]}, {"w": "looking", "b": [0.507, 0.1677, 0.5841, 0.1874]}, {"w": "to", "b": [0.5904, 0.1677, 0.61, 0.1874]}, {"w": "get", "b": [0.6163, 0.1677, 0.6471, 0.1874]}, {"w": "started", "b": [0.6534, 0.1677, 0.7207, 0.1874]}, {"w": "with", "b": [0.727, 0.1677, 0.7718, 0.1874]}, {"w": "the", "b": [0.7781, 0.1677, 0.809, 0.1874]}, {"w": "Keras", "b": [0.1799, 0.1882, 0.2387, 0.2079]}, {"w": "framework,", "b": [0.245, 0.1882, 0.362, 0.2079]}, {"w": "you’ll", "b": [0.3683, 0.1882, 0.4285, 0.2079]}, {"w": "find", "b": [0.4348, 0.1882, 0.4755, 0.2079]}, {"w": "this", "b": [0.4818, 0.1882, 0.5182, 0.2079]}, {"w": "book", "b": [0.5245, 0.1882, 0.575, 0.2079]}, {"w": "to", "b": [0.5813, 0.1882, 0.6009, 0.2079]}, {"w": "be", "b": [0.6072, 0.1882, 0.6311, 0.2079]}, {"w": "the", "b": [0.6374, 0.1882, 0.6682, 0.2079]}, {"w": "best", "b": [0.6745, 0.1882, 0.7151, 0.2079]}, {"w": "Keras", "b": [0.7214, 0.1882, 0.7803, 0.2079]}, {"w": "crash", "b": [0.7865, 0.1882, 0.8397, 0.2079]}, {"w": "course", "b": [0.1799, 0.2087, 0.2457, 0.2284]}, {"w": "available.", "b": [0.252, 0.2087, 0.3494, 0.2284]}, {"w": "If", "b": [0.1799, 0.2292, 0.1967, 0.2489]}, {"w": "you’re", "b": [0.203, 0.2292, 0.2688, 0.2489]}, {"w": "a", "b": [0.2751, 0.2292, 0.2863, 0.2489]}, {"w": "graduate", "b": [0.2926, 0.2292, 0.3795, 0.2489]}, {"w": "student", "b": [0.3858, 0.2292, 0.4587, 0.2489]}, {"w": "studying", "b": [0.465, 0.2292, 0.5519, 0.2489]}, {"w": "deep", "b": [0.5582, 0.2292, 0.6058, 0.2489]}, {"w": "learning", "b": [0.6121, 0.2292, 0.6948, 0.2489]}, {"w": "in", "b": [0.7011, 0.2292, 0.7207, 0.2489]}, {"w": "a", "b": [0.727, 0.2292, 0.7382, 0.2489]}, {"w": "formal", "b": [0.7445, 0.2292, 0.8118, 0.2489]}, {"w": "setting,", "b": [0.1799, 0.2497, 0.2534, 0.2694]}, {"w": "you’ll", "b": [0.2598, 0.2497, 0.32, 0.2694]}, {"w": "find", "b": [0.3263, 0.2497, 0.367, 0.2694]}, {"w": "this", "b": [0.3733, 0.2497, 0.4097, 0.2694]}, {"w": "book", "b": [0.416, 0.2497, 0.4665, 0.2694]}, {"w": "to", "b": [0.4728, 0.2497, 0.4924, 0.2694]}, {"w": "be", "b": [0.4987, 0.2497, 0.5225, 0.2694]}, {"w": "a", "b": [0.5288, 0.2497, 0.54, 0.2694]}, {"w": "practical", "b": [0.5463, 0.2497, 0.6332, 0.2694]}, {"w": "complement", "b": [0.6395, 0.2497, 0.7642, 0.2694]}, {"w": "to", "b": [0.7704, 0.2497, 0.79, 0.2694]}, {"w": "your", "b": [0.7964, 0.2497, 0.8426, 0.2694]}, {"w": "education,", "b": [0.1799, 0.2702, 0.2842, 0.2899]}, {"w": "helping", "b": [0.2906, 0.2702, 0.3662, 0.2899]}, {"w": "you", "b": [0.3725, 0.2702, 0.4104, 0.2899]}, {"w": "build", "b": [0.4167, 0.2702, 0.4685, 0.2899]}, {"w": "intuition", "b": [0.4749, 0.2702, 0.5604, 0.2899]}, {"w": "around", "b": [0.5667, 0.2702, 0.6367, 0.2899]}, {"w": "the", "b": [0.643, 0.2702, 0.6739, 0.2899]}, {"w": "behavior", "b": [0.6802, 0.2702, 0.7684, 0.2899]}, {"w": "of", "b": [0.7747, 0.2702, 0.7958, 0.2899]}, {"w": "deep", "b": [0.8021, 0.2702, 0.8497, 0.2899]}, {"w": "neural", "b": [0.1799, 0.2907, 0.2429, 0.3104]}, {"w": "networks", "b": [0.2492, 0.2907, 0.3417, 0.3104]}, {"w": "and", "b": [0.348, 0.2907, 0.3844, 0.3104]}, {"w": "familiarizing", "b": [0.3907, 0.2907, 0.521, 0.3104]}, {"w": "you", "b": [0.5273, 0.2907, 0.5652, 0.3104]}, {"w": "with", "b": [0.5715, 0.2907, 0.6163, 0.3104]}, {"w": "key", "b": [0.6227, 0.2907, 0.6591, 0.3104]}, {"w": "best", "b": [0.6653, 0.2907, 0.706, 0.3104]}, {"w": "practices.", "b": [0.7123, 0.2907, 0.8082, 0.3104]}]}, {"id": "b_1", "type": "paragraph", "text": "Even technically minded people who don’t code regularly will find this book useful as an introduction to both basic and advanced deep-learning concepts.", "words": [{"w": "Even", "b": [0.1294, 0.3335, 0.1813, 0.3532]}, {"w": "technically", "b": [0.1876, 0.3335, 0.2982, 0.3532]}, {"w": "minded", "b": [0.3046, 0.3335, 0.3802, 0.3532]}, {"w": "people", "b": [0.3865, 0.3335, 0.4538, 0.3532]}, {"w": "who", "b": [0.4601, 0.3335, 0.5035, 0.3532]}, {"w": "don’t", "b": [0.5098, 0.3335, 0.5626, 0.3532]}, {"w": "code", "b": [0.5689, 0.3335, 0.6165, 0.3532]}, {"w": "regularly", "b": [0.6228, 0.3335, 0.7139, 0.3532]}, {"w": "will", "b": [0.7202, 0.3335, 0.7594, 0.3532]}, {"w": "find", "b": [0.7657, 0.3335, 0.8064, 0.3532]}, {"w": "this", "b": [0.8127, 0.3335, 0.8491, 0.3532]}, {"w": "book", "b": [0.1294, 0.354, 0.1799, 0.3737]}, {"w": "useful", "b": [0.1862, 0.354, 0.2478, 0.3737]}, {"w": "as", "b": [0.2541, 0.354, 0.2751, 0.3737]}, {"w": "an", "b": [0.2814, 0.354, 0.3053, 0.3737]}, {"w": "introduction", "b": [0.3116, 0.354, 0.4349, 0.3737]}, {"w": "to", "b": [0.4412, 0.354, 0.4608, 0.3737]}, {"w": "both", "b": [0.4671, 0.354, 0.512, 0.3737]}, {"w": "basic", "b": [0.5183, 0.354, 0.5701, 0.3737]}, {"w": "and", "b": [0.5764, 0.354, 0.6129, 0.3737]}, {"w": "advanced", "b": [0.6192, 0.354, 0.7144, 0.3737]}, {"w": "deep-learning", "b": [0.7207, 0.354, 0.8594, 0.3737]}, {"w": "concepts.", "b": [0.1294, 0.3745, 0.224, 0.3942]}]}, {"id": "b_2", "type": "paragraph", "text": "In order to use Keras, you’ll need reasonable Python proficiency. Additionally, familiarity with the Numpy library will be helpful, although it isn’t required. You don’t need previous experience with machine learning or deep learning: this book covers from scratch all the necessary basics. You don’t need an advanced mathematics background, either—high school–level mathematics should suffice in order to follow along.", "words": [{"w": "In", "b": [0.1294, 0.4172, 0.1504, 0.437]}, {"w": "order", "b": [0.1567, 0.4172, 0.21, 0.437]}, {"w": "to", "b": [0.2163, 0.4172, 0.2359, 0.437]}, {"w": "use", "b": [0.2422, 0.4172, 0.2758, 0.437]}, {"w": "Keras,", "b": [0.2821, 0.4172, 0.3473, 0.437]}, {"w": "you’ll", "b": [0.3536, 0.4172, 0.4138, 0.437]}, {"w": "need", "b": [0.4201, 0.4172, 0.4678, 0.437]}, {"w": "reasonable", "b": [0.4741, 0.4172, 0.5819, 0.437]}, {"w": "Python", "b": [0.5882, 0.4172, 0.6597, 0.437]}, {"w": "proficiency.", "b": [0.666, 0.4172, 0.7855, 0.437]}, {"w": "Additionally,", "b": [0.1294, 0.4377, 0.2616, 0.4575]}, {"w": "familiarity", "b": [0.2679, 0.4377, 0.3744, 0.4575]}, {"w": "with", "b": [0.3807, 0.4377, 0.4256, 0.4575]}, {"w": "the", "b": [0.4319, 0.4377, 0.4627, 0.4575]}, {"w": "Numpy", "b": [0.469, 0.4377, 0.5447, 0.4575]}, {"w": "library", "b": [0.551, 0.4377, 0.6182, 0.4575]}, {"w": "will", "b": [0.6245, 0.4377, 0.6638, 0.4575]}, {"w": "be", "b": [0.6701, 0.4377, 0.6939, 0.4575]}, {"w": "helpful,", "b": [0.7001, 0.4377, 0.7779, 0.4575]}, {"w": "although", "b": [0.1294, 0.4582, 0.2177, 0.478]}, {"w": "it", "b": [0.224, 0.4582, 0.238, 0.478]}, {"w": "isn’t", "b": [0.2443, 0.4582, 0.2887, 0.478]}, {"w": "required.", "b": [0.295, 0.4582, 0.3854, 0.478]}, {"w": "You", "b": [0.3917, 0.4582, 0.4326, 0.478]}, {"w": "don’t", "b": [0.4389, 0.4582, 0.4917, 0.478]}, {"w": "need", "b": [0.498, 0.4582, 0.5456, 0.478]}, {"w": "previous", "b": [0.5519, 0.4582, 0.6388, 0.478]}, {"w": "experience", "b": [0.6451, 0.4582, 0.7544, 0.478]}, {"w": "with", "b": [0.7607, 0.4582, 0.8055, 0.478]}, {"w": "machine", "b": [0.1294, 0.4787, 0.2149, 0.4985]}, {"w": "learning", "b": [0.2212, 0.4787, 0.3038, 0.4985]}, {"w": "or", "b": [0.3102, 0.4787, 0.3312, 0.4985]}, {"w": "deep", "b": [0.3375, 0.4787, 0.3851, 0.4985]}, {"w": "learning:", "b": [0.3914, 0.4787, 0.4811, 0.4985]}, {"w": "this", "b": [0.4874, 0.4787, 0.5238, 0.4985]}, {"w": "book", "b": [0.5301, 0.4787, 0.5806, 0.4985]}, {"w": "covers", "b": [0.5868, 0.4787, 0.6527, 0.4985]}, {"w": "from", "b": [0.659, 0.4787, 0.708, 0.4985]}, {"w": "scratch", "b": [0.7143, 0.4787, 0.7858, 0.4985]}, {"w": "all", "b": [0.7921, 0.4787, 0.8173, 0.4985]}, {"w": "the", "b": [0.8236, 0.4787, 0.8544, 0.4985]}, {"w": "necessary", "b": [0.1294, 0.4992, 0.2275, 0.519]}, {"w": "basics.", "b": [0.2338, 0.4992, 0.3017, 0.519]}, {"w": "You", "b": [0.308, 0.4992, 0.3489, 0.519]}, {"w": "don’t", "b": [0.3552, 0.4992, 0.408, 0.519]}, {"w": "need", "b": [0.4144, 0.4992, 0.462, 0.519]}, {"w": "an", "b": [0.4683, 0.4992, 0.4921, 0.519]}, {"w": "advanced", "b": [0.4984, 0.4992, 0.5937, 0.519]}, {"w": "mathematics", "b": [0.6, 0.4992, 0.7275, 0.519]}, {"w": "background,", "b": [0.7338, 0.4992, 0.8592, 0.519]}, {"w": "either—high", "b": [0.1294, 0.5197, 0.2569, 0.5395]}, {"w": "school–level", "b": [0.2632, 0.5197, 0.3908, 0.5395]}, {"w": "mathematics", "b": [0.397, 0.5197, 0.5245, 0.5395]}, {"w": "should", "b": [0.5308, 0.5197, 0.5981, 0.5395]}, {"w": "suffice", "b": [0.6044, 0.5197, 0.6726, 0.5395]}, {"w": "in", "b": [0.6789, 0.5197, 0.6985, 0.5395]}, {"w": "order", "b": [0.7048, 0.5197, 0.758, 0.5395]}, {"w": "to", "b": [0.7643, 0.5197, 0.784, 0.5395]}, {"w": "follow", "b": [0.7903, 0.5197, 0.8561, 0.5395]}, {"w": "along.", "b": [0.1294, 0.5402, 0.1918, 0.56]}]}, {"id": "b_3", "type": "paragraph", "text": "Roadmap", "words": [{"w": "Roadmap", "b": [0.1294, 0.5971, 0.2477, 0.6193]}]}, {"id": "b_4", "type": "paragraph", "text": "This book is structured in two parts. If you have no prior experience with machine learning, I strongly recommend that you complete part 1 before approaching part 2. We’ll start with simple examples, and as the book goes on, we’ll get increasingly close to state-of-the-art techniques.", "words": [{"w": "This", "b": [0.1294, 0.6427, 0.1743, 0.6625]}, {"w": "book", "b": [0.1806, 0.6427, 0.231, 0.6625]}, {"w": "is", "b": [0.2373, 0.6427, 0.2542, 0.6625]}, {"w": "structured", "b": [0.2605, 0.6427, 0.3613, 0.6625]}, {"w": "in", "b": [0.3676, 0.6427, 0.3873, 0.6625]}, {"w": "two", "b": [0.3936, 0.6427, 0.4314, 0.6625]}, {"w": "parts.", "b": [0.4377, 0.6427, 0.4931, 0.6625]}, {"w": "If", "b": [0.4994, 0.6427, 0.5162, 0.6625]}, {"w": "you", "b": [0.5225, 0.6427, 0.5603, 0.6625]}, {"w": "have", "b": [0.5666, 0.6427, 0.6143, 0.6625]}, {"w": "no", "b": [0.6206, 0.6427, 0.6458, 0.6625]}, {"w": "prior", "b": [0.6521, 0.6427, 0.7011, 0.6625]}, {"w": "experience", "b": [0.7074, 0.6427, 0.8167, 0.6625]}, {"w": "with", "b": [0.823, 0.6427, 0.8678, 0.6625]}, {"w": "machine", "b": [0.1294, 0.6632, 0.2149, 0.683]}, {"w": "learning,", "b": [0.2212, 0.6632, 0.3102, 0.683]}, {"w": "I", "b": [0.3165, 0.6632, 0.3249, 0.683]}, {"w": "strongly", "b": [0.3312, 0.6632, 0.4139, 0.683]}, {"w": "recommend", "b": [0.4202, 0.6632, 0.5393, 0.683]}, {"w": "that", "b": [0.5456, 0.6632, 0.5834, 0.683]}, {"w": "you", "b": [0.5897, 0.6632, 0.6275, 0.683]}, {"w": "complete", "b": [0.6338, 0.6632, 0.7262, 0.683]}, {"w": "part", "b": [0.7325, 0.6632, 0.7718, 0.683]}, {"w": "1", "b": [0.7781, 0.6632, 0.7907, 0.683]}, {"w": "before", "b": [0.797, 0.6632, 0.8614, 0.683]}, {"w": "approaching", "b": [0.1294, 0.6837, 0.2541, 0.7035]}, {"w": "part", "b": [0.2604, 0.6837, 0.2996, 0.7035]}, {"w": "2.", "b": [0.3059, 0.6837, 0.3248, 0.7035]}, {"w": "We’ll", "b": [0.3311, 0.6837, 0.3866, 0.7035]}, {"w": "start", "b": [0.3929, 0.6837, 0.4363, 0.7035]}, {"w": "with", "b": [0.4426, 0.6837, 0.4875, 0.7035]}, {"w": "simple", "b": [0.4938, 0.6837, 0.561, 0.7035]}, {"w": "examples,", "b": [0.5673, 0.6837, 0.6689, 0.7035]}, {"w": "and", "b": [0.6752, 0.6837, 0.7117, 0.7035]}, {"w": "as", "b": [0.718, 0.6837, 0.739, 0.7035]}, {"w": "the", "b": [0.7453, 0.6837, 0.7761, 0.7035]}, {"w": "book", "b": [0.7824, 0.6837, 0.8329, 0.7035]}, {"w": "goes", "b": [0.1294, 0.7042, 0.1757, 0.724]}, {"w": "on,", "b": [0.182, 0.7042, 0.2135, 0.724]}, {"w": "we’ll", "b": [0.2198, 0.7042, 0.2716, 0.724]}, {"w": "get", "b": [0.2779, 0.7042, 0.3088, 0.724]}, {"w": "increasingly", "b": [0.3151, 0.7042, 0.4384, 0.724]}, {"w": "close", "b": [0.4447, 0.7042, 0.4965, 0.724]}, {"w": "to", "b": [0.5028, 0.7042, 0.5225, 0.724]}, {"w": "state-of-the-art", "b": [0.5288, 0.7042, 0.6787, 0.724]}, {"w": "techniques.", "b": [0.685, 0.7042, 0.7992, 0.724]}]}, {"id": "b_5", "type": "paragraph", "text": "Part 1 is a high-level introduction to deep learning, providing context and definitions, and explaining all the notions required to get started with machine learning and neural networks:", "words": [{"w": "Part", "b": [0.1294, 0.747, 0.1701, 0.7668]}, {"w": "1", "b": [0.1764, 0.747, 0.189, 0.7668]}, {"w": "is", "b": [0.1953, 0.747, 0.2121, 0.7668]}, {"w": "a", "b": [0.2184, 0.747, 0.2296, 0.7668]}, {"w": "high-level", "b": [0.2359, 0.747, 0.3382, 0.7668]}, {"w": "introduction", "b": [0.3445, 0.747, 0.4678, 0.7668]}, {"w": "to", "b": [0.4741, 0.747, 0.4938, 0.7668]}, {"w": "deep", "b": [0.5001, 0.747, 0.5477, 0.7668]}, {"w": "learning,", "b": [0.554, 0.747, 0.643, 0.7668]}, {"w": "providing", "b": [0.6493, 0.747, 0.7474, 0.7668]}, {"w": "context", "b": [0.7537, 0.747, 0.8279, 0.7668]}, {"w": "and", "b": [0.8342, 0.747, 0.8707, 0.7668]}, {"w": "definitions,", "b": [0.1294, 0.7675, 0.2436, 0.7873]}, {"w": "and", "b": [0.2499, 0.7675, 0.2864, 0.7873]}, {"w": "explaining", "b": [0.2927, 0.7675, 0.3992, 0.7873]}, {"w": "all", "b": [0.4055, 0.7675, 0.4307, 0.7873]}, {"w": "the", "b": [0.437, 0.7675, 0.4678, 0.7873]}, {"w": "notions", "b": [0.4741, 0.7675, 0.5484, 0.7873]}, {"w": "required", "b": [0.5547, 0.7675, 0.6388, 0.7873]}, {"w": "to", "b": [0.645, 0.7675, 0.6646, 0.7873]}, {"w": "get", "b": [0.671, 0.7675, 0.7018, 0.7873]}, {"w": "started", "b": [0.7081, 0.7675, 0.7753, 0.7873]}, {"w": "with", "b": [0.7816, 0.7675, 0.8265, 0.7873]}, {"w": "machine", "b": [0.1294, 0.788, 0.2149, 0.8078]}, {"w": "learning", "b": [0.2212, 0.788, 0.3038, 0.8078]}, {"w": "and", "b": [0.3102, 0.788, 0.3466, 0.8078]}, {"w": "neural", "b": [0.3529, 0.788, 0.4159, 0.8078]}, {"w": "networks:", "b": [0.4222, 0.788, 0.5217, 0.8078]}]}, {"id": "b_6", "type": "paragraph", "text": "Chapter 1 presents essential context and background knowledge around AI, machine learning, and deep learning. Chapter 2 introduces fundamental concepts necessary in order to approach deep learning: tensors, tensor operations, gradient descent,", "words": [{"w": "Chapter", "b": [0.1799, 0.8264, 0.2597, 0.8461]}, {"w": "1", "b": [0.266, 0.8264, 0.2786, 0.8461]}, {"w": "presents", "b": [0.2849, 0.8264, 0.3676, 0.8461]}, {"w": "essential", "b": [0.3739, 0.8264, 0.4608, 0.8461]}, {"w": "context", "b": [0.4671, 0.8264, 0.5413, 0.8461]}, {"w": "and", "b": [0.5477, 0.8264, 0.5841, 0.8461]}, {"w": "background", "b": [0.5904, 0.8264, 0.7095, 0.8461]}, {"w": "knowledge", "b": [0.7158, 0.8264, 0.8265, 0.8461]}, {"w": "around", "b": [0.1799, 0.8469, 0.2499, 0.8666]}, {"w": "AI,", "b": [0.2562, 0.8469, 0.2891, 0.8666]}, {"w": "machine", "b": [0.2954, 0.8469, 0.3809, 0.8666]}, {"w": "learning,", "b": [0.3872, 0.8469, 0.4762, 0.8666]}, {"w": "and", "b": [0.4825, 0.8469, 0.5189, 0.8666]}, {"w": "deep", "b": [0.5252, 0.8469, 0.5729, 0.8666]}, {"w": "learning.", "b": [0.5792, 0.8469, 0.6681, 0.8666]}, {"w": "Chapter", "b": [0.1799, 0.8674, 0.2597, 0.8871]}, {"w": "2", "b": [0.266, 0.8674, 0.2786, 0.8871]}, {"w": "introduces", "b": [0.2849, 0.8674, 0.39, 0.8871]}, {"w": "fundamental", "b": [0.3963, 0.8674, 0.5224, 0.8871]}, {"w": "concepts", "b": [0.5287, 0.8674, 0.617, 0.8871]}, {"w": "necessary", "b": [0.6233, 0.8674, 0.7214, 0.8871]}, {"w": "in", "b": [0.7277, 0.8674, 0.7473, 0.8871]}, {"w": "order", "b": [0.7536, 0.8674, 0.8068, 0.8871]}, {"w": "to", "b": [0.8131, 0.8674, 0.8328, 0.8871]}, {"w": "approach", "b": [0.1799, 0.8879, 0.2723, 0.9076]}, {"w": "deep", "b": [0.2786, 0.8879, 0.3262, 0.9076]}, {"w": "learning:", "b": [0.3326, 0.8879, 0.4222, 0.9076]}, {"w": "tensors,", "b": [0.4285, 0.8879, 0.5063, 0.9076]}, {"w": "tensor", "b": [0.5126, 0.8879, 0.5743, 0.9076]}, {"w": "operations,", "b": [0.5806, 0.8879, 0.692, 0.9076]}, {"w": "gradient", "b": [0.6983, 0.8879, 0.7809, 0.9076]}, {"w": "descent,", "b": [0.7872, 0.8879, 0.8692, 0.9076]}]}]}, {"page": 24, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "and backpropagation. This chapter also features the book’s first example of a working neural network. Chapter 3 includes everything you need to get started with neural networks: an introduction to Keras, our deep-learning framework of choice; a guide for setting up your workstation; and three foundational code examples with detailed explanations. By the end of this chapter, you’ll be able to train simple neural networks to handle classification and regression tasks, and you’ll have a solid idea of what’s happening in the background as you train them. Chapter 4 explores the canonical machine-learning workflow. You’ll also learn about common pitfalls and their solutions.", "words": [{"w": "and", "b": [0.1799, 0.0857, 0.2163, 0.1054]}, {"w": "backpropagation.", "b": [0.2226, 0.0857, 0.397, 0.1054]}, {"w": "This", "b": [0.4033, 0.0857, 0.4482, 0.1054]}, {"w": "chapter", "b": [0.4545, 0.0857, 0.5287, 0.1054]}, {"w": "also", "b": [0.535, 0.0857, 0.5757, 0.1054]}, {"w": "features", "b": [0.582, 0.0857, 0.6618, 0.1054]}, {"w": "the", "b": [0.6681, 0.0857, 0.699, 0.1054]}, {"w": "book’s", "b": [0.7053, 0.0857, 0.7725, 0.1054]}, {"w": "first", "b": [0.7788, 0.0857, 0.8194, 0.1054]}, {"w": "example", "b": [0.1799, 0.1062, 0.2653, 0.1259]}, {"w": "of", "b": [0.2716, 0.1062, 0.2926, 0.1259]}, {"w": "a", "b": [0.299, 0.1062, 0.3102, 0.1259]}, {"w": "working", "b": [0.3165, 0.1062, 0.4005, 0.1259]}, {"w": "neural", "b": [0.4068, 0.1062, 0.4699, 0.1259]}, {"w": "network.", "b": [0.4762, 0.1062, 0.5652, 0.1259]}, {"w": "Chapter", "b": [0.1799, 0.1267, 0.2597, 0.1464]}, {"w": "3", "b": [0.266, 0.1267, 0.2786, 0.1464]}, {"w": "includes", "b": [0.2849, 0.1267, 0.369, 0.1464]}, {"w": "everything", "b": [0.3753, 0.1267, 0.4832, 0.1464]}, {"w": "you", "b": [0.4895, 0.1267, 0.5273, 0.1464]}, {"w": "need", "b": [0.5337, 0.1267, 0.5813, 0.1464]}, {"w": "to", "b": [0.5876, 0.1267, 0.6072, 0.1464]}, {"w": "get", "b": [0.6135, 0.1267, 0.6443, 0.1464]}, {"w": "started", "b": [0.6506, 0.1267, 0.7179, 0.1464]}, {"w": "with", "b": [0.7242, 0.1267, 0.7691, 0.1464]}, {"w": "neural", "b": [0.7754, 0.1267, 0.8384, 0.1464]}, {"w": "networks:", "b": [0.1799, 0.1472, 0.2794, 0.1669]}, {"w": "an", "b": [0.2857, 0.1472, 0.3095, 0.1669]}, {"w": "introduction", "b": [0.3158, 0.1472, 0.4391, 0.1669]}, {"w": "to", "b": [0.4454, 0.1472, 0.465, 0.1669]}, {"w": "Keras,", "b": [0.4713, 0.1472, 0.5365, 0.1669]}, {"w": "our", "b": [0.5428, 0.1472, 0.5764, 0.1669]}, {"w": "deep-learning", "b": [0.5827, 0.1472, 0.7214, 0.1669]}, {"w": "framework", "b": [0.7277, 0.1472, 0.8384, 0.1669]}, {"w": "of", "b": [0.8447, 0.1472, 0.8657, 0.1669]}, {"w": "choice;", "b": [0.1799, 0.1677, 0.2527, 0.1874]}, {"w": "a", "b": [0.259, 0.1677, 0.2702, 0.1874]}, {"w": "guide", "b": [0.2765, 0.1677, 0.3326, 0.1874]}, {"w": "for", "b": [0.3389, 0.1677, 0.3683, 0.1874]}, {"w": "setting", "b": [0.3746, 0.1677, 0.4419, 0.1874]}, {"w": "up", "b": [0.4482, 0.1677, 0.4734, 0.1874]}, {"w": "your", "b": [0.4797, 0.1677, 0.526, 0.1874]}, {"w": "workstation;", "b": [0.5323, 0.1677, 0.6584, 0.1874]}, {"w": "and", "b": [0.6647, 0.1677, 0.7011, 0.1874]}, {"w": "three", "b": [0.7074, 0.1677, 0.7579, 0.1874]}, {"w": "foundational", "b": [0.1799, 0.1882, 0.3074, 0.2079]}, {"w": "code", "b": [0.3137, 0.1882, 0.3613, 0.2079]}, {"w": "examples", "b": [0.3676, 0.1882, 0.4629, 0.2079]}, {"w": "with", "b": [0.4692, 0.1882, 0.5141, 0.2079]}, {"w": "detailed", "b": [0.5204, 0.1882, 0.6002, 0.2079]}, {"w": "explanations.", "b": [0.6065, 0.1882, 0.7404, 0.2079]}, {"w": "By", "b": [0.7467, 0.1882, 0.7761, 0.2079]}, {"w": "the", "b": [0.7824, 0.1882, 0.8132, 0.2079]}, {"w": "end", "b": [0.8195, 0.1882, 0.856, 0.2079]}, {"w": "of", "b": [0.1799, 0.2087, 0.2009, 0.2284]}, {"w": "this", "b": [0.2072, 0.2087, 0.2436, 0.2284]}, {"w": "chapter,", "b": [0.2499, 0.2087, 0.3295, 0.2284]}, {"w": "you’ll", "b": [0.3358, 0.2087, 0.396, 0.2284]}, {"w": "be", "b": [0.4023, 0.2087, 0.4261, 0.2284]}, {"w": "able", "b": [0.4325, 0.2087, 0.4745, 0.2284]}, {"w": "to", "b": [0.4808, 0.2087, 0.5004, 0.2284]}, {"w": "train", "b": [0.5067, 0.2087, 0.553, 0.2284]}, {"w": "simple", "b": [0.5593, 0.2087, 0.6265, 0.2284]}, {"w": "neural", "b": [0.6328, 0.2087, 0.6959, 0.2284]}, {"w": "networks", "b": [0.7022, 0.2087, 0.7947, 0.2284]}, {"w": "to", "b": [0.801, 0.2087, 0.8206, 0.2284]}, {"w": "handle", "b": [0.1799, 0.2292, 0.2471, 0.2489]}, {"w": "classification", "b": [0.2534, 0.2292, 0.3865, 0.2489]}, {"w": "and", "b": [0.3928, 0.2292, 0.4293, 0.2489]}, {"w": "regression", "b": [0.4356, 0.2292, 0.5393, 0.2489]}, {"w": "tasks,", "b": [0.5456, 0.2292, 0.6023, 0.2489]}, {"w": "and", "b": [0.6086, 0.2292, 0.6451, 0.2489]}, {"w": "you’ll", "b": [0.6514, 0.2292, 0.7116, 0.2489]}, {"w": "have", "b": [0.7179, 0.2292, 0.7655, 0.2489]}, {"w": "a", "b": [0.7718, 0.2292, 0.783, 0.2489]}, {"w": "solid", "b": [0.7893, 0.2292, 0.8384, 0.2489]}, {"w": "idea", "b": [0.1799, 0.2497, 0.2219, 0.2694]}, {"w": "of", "b": [0.2282, 0.2497, 0.2492, 0.2694]}, {"w": "what’s", "b": [0.2555, 0.2497, 0.3214, 0.2694]}, {"w": "happening", "b": [0.3277, 0.2497, 0.4328, 0.2694]}, {"w": "in", "b": [0.4391, 0.2497, 0.4587, 0.2694]}, {"w": "the", "b": [0.465, 0.2497, 0.4958, 0.2694]}, {"w": "background", "b": [0.5021, 0.2497, 0.6212, 0.2694]}, {"w": "as", "b": [0.6275, 0.2497, 0.6485, 0.2694]}, {"w": "you", "b": [0.6548, 0.2497, 0.6927, 0.2694]}, {"w": "train", "b": [0.699, 0.2497, 0.7452, 0.2694]}, {"w": "them.", "b": [0.7515, 0.2497, 0.8083, 0.2694]}, {"w": "Chapter", "b": [0.1799, 0.2702, 0.2597, 0.2899]}, {"w": "4", "b": [0.266, 0.2702, 0.2786, 0.2899]}, {"w": "explores", "b": [0.2849, 0.2702, 0.3704, 0.2899]}, {"w": "the", "b": [0.3767, 0.2702, 0.4075, 0.2899]}, {"w": "canonical", "b": [0.4138, 0.2702, 0.5105, 0.2899]}, {"w": "machine-learning", "b": [0.5168, 0.2702, 0.6933, 0.2899]}, {"w": "workflow.", "b": [0.6996, 0.2702, 0.8023, 0.2899]}, {"w": "You’ll", "b": [0.1799, 0.2907, 0.2432, 0.3104]}, {"w": "also", "b": [0.2495, 0.2907, 0.2902, 0.3104]}, {"w": "learn", "b": [0.2965, 0.2907, 0.3469, 0.3104]}, {"w": "about", "b": [0.3532, 0.2907, 0.4092, 0.3104]}, {"w": "common", "b": [0.4155, 0.2907, 0.5038, 0.3104]}, {"w": "pitfalls", "b": [0.5101, 0.2907, 0.5802, 0.3104]}, {"w": "and", "b": [0.5865, 0.2907, 0.623, 0.3104]}, {"w": "their", "b": [0.6293, 0.2907, 0.6755, 0.3104]}, {"w": "solutions.", "b": [0.6818, 0.2907, 0.7792, 0.3104]}]}, {"id": "b_1", "type": "paragraph", "text": "Part 2 takes an in-depth dive into practical applications of deep learning in computer vision and natural-language processing. Many of the examples introduced in this part can be used as templates to solve problems you’ll encounter in the real-world practice of deep learning:", "words": [{"w": "Part", "b": [0.1294, 0.3335, 0.1701, 0.3532]}, {"w": "2", "b": [0.1764, 0.3335, 0.189, 0.3532]}, {"w": "takes", "b": [0.1953, 0.3335, 0.2471, 0.3532]}, {"w": "an", "b": [0.2534, 0.3335, 0.2772, 0.3532]}, {"w": "in-depth", "b": [0.2835, 0.3335, 0.3676, 0.3532]}, {"w": "dive", "b": [0.3739, 0.3335, 0.4173, 0.3532]}, {"w": "into", "b": [0.4236, 0.3335, 0.4629, 0.3532]}, {"w": "practical", "b": [0.4692, 0.3335, 0.5561, 0.3532]}, {"w": "applications", "b": [0.5624, 0.3335, 0.6843, 0.3532]}, {"w": "of", "b": [0.6906, 0.3335, 0.7116, 0.3532]}, {"w": "deep", "b": [0.7179, 0.3335, 0.7655, 0.3532]}, {"w": "learning", "b": [0.7718, 0.3335, 0.8545, 0.3532]}, {"w": "in", "b": [0.1294, 0.354, 0.149, 0.3737]}, {"w": "computer", "b": [0.1553, 0.354, 0.2506, 0.3737]}, {"w": "vision", "b": [0.2569, 0.354, 0.3186, 0.3737]}, {"w": "and", "b": [0.3249, 0.354, 0.3613, 0.3737]}, {"w": "natural-language", "b": [0.3676, 0.354, 0.5372, 0.3737]}, {"w": "processing.", "b": [0.5435, 0.354, 0.6577, 0.3737]}, {"w": "Many", "b": [0.664, 0.354, 0.7228, 0.3737]}, {"w": "of", "b": [0.7291, 0.354, 0.7501, 0.3737]}, {"w": "the", "b": [0.7564, 0.354, 0.7872, 0.3737]}, {"w": "examples", "b": [0.1294, 0.3745, 0.2247, 0.3942]}, {"w": "introduced", "b": [0.231, 0.3745, 0.3389, 0.3942]}, {"w": "in", "b": [0.3452, 0.3745, 0.3648, 0.3942]}, {"w": "this", "b": [0.3711, 0.3745, 0.4076, 0.3942]}, {"w": "part", "b": [0.4139, 0.3745, 0.4531, 0.3942]}, {"w": "can", "b": [0.4594, 0.3745, 0.4944, 0.3942]}, {"w": "be", "b": [0.5007, 0.3745, 0.5245, 0.3942]}, {"w": "used", "b": [0.5309, 0.3745, 0.5771, 0.3942]}, {"w": "as", "b": [0.5834, 0.3745, 0.6044, 0.3942]}, {"w": "templates", "b": [0.6107, 0.3745, 0.7074, 0.3942]}, {"w": "to", "b": [0.7137, 0.3745, 0.7333, 0.3942]}, {"w": "solve", "b": [0.7396, 0.3745, 0.7929, 0.3942]}, {"w": "problems", "b": [0.1294, 0.395, 0.2233, 0.4147]}, {"w": "you’ll", "b": [0.2296, 0.395, 0.2899, 0.4147]}, {"w": "encounter", "b": [0.2962, 0.395, 0.3956, 0.4147]}, {"w": "in", "b": [0.402, 0.395, 0.4216, 0.4147]}, {"w": "the", "b": [0.4279, 0.395, 0.4587, 0.4147]}, {"w": "real-world", "b": [0.465, 0.395, 0.5701, 0.4147]}, {"w": "practice", "b": [0.5764, 0.395, 0.6562, 0.4147]}, {"w": "of", "b": [0.6624, 0.395, 0.6835, 0.4147]}, {"w": "deep", "b": [0.6898, 0.395, 0.7374, 0.4147]}, {"w": "learning:", "b": [0.7437, 0.395, 0.8334, 0.4147]}]}, {"id": "b_2", "type": "paragraph", "text": "Chapter 5 examines a range of practical computer-vision examples, with a focus on image classification. Chapter 6 gives you practice with techniques for processing sequence data, such as text and timeseries. Chapter 7 introduces advanced techniques for building state-of-the- art deep-learning models. Chapter 8 explains generative models: deep-learning models capable of creating images and text, with sometimes surprisingly artistic results. Chapter 9 is dedicated to consolidating what you’ve learned throughout the book, as well as opening perspectives on the limitations of deep learning and exploring its probable future.", "words": [{"w": "Chapter", "b": [0.1799, 0.4333, 0.2597, 0.453]}, {"w": "5", "b": [0.266, 0.4333, 0.2786, 0.453]}, {"w": "examines", "b": [0.2849, 0.4333, 0.3802, 0.453]}, {"w": "a", "b": [0.3865, 0.4333, 0.3977, 0.453]}, {"w": "range", "b": [0.404, 0.4333, 0.46, 0.453]}, {"w": "of", "b": [0.4663, 0.4333, 0.4874, 0.453]}, {"w": "practical", "b": [0.4937, 0.4333, 0.5805, 0.453]}, {"w": "computer-vision", "b": [0.5868, 0.4333, 0.7516, 0.453]}, {"w": "examples,", "b": [0.7579, 0.4333, 0.8595, 0.453]}, {"w": "with", "b": [0.1799, 0.4538, 0.2247, 0.4735]}, {"w": "a", "b": [0.231, 0.4538, 0.2422, 0.4735]}, {"w": "focus", "b": [0.2485, 0.4538, 0.3032, 0.4735]}, {"w": "on", "b": [0.3095, 0.4538, 0.3347, 0.4735]}, {"w": "image", "b": [0.341, 0.4538, 0.4027, 0.4735]}, {"w": "classification.", "b": [0.409, 0.4538, 0.5484, 0.4735]}, {"w": "Chapter", "b": [0.1799, 0.4743, 0.2597, 0.494]}, {"w": "6", "b": [0.266, 0.4743, 0.2786, 0.494]}, {"w": "gives", "b": [0.2849, 0.4743, 0.3382, 0.494]}, {"w": "you", "b": [0.3445, 0.4743, 0.3823, 0.494]}, {"w": "practice", "b": [0.3886, 0.4743, 0.4685, 0.494]}, {"w": "with", "b": [0.4748, 0.4743, 0.5196, 0.494]}, {"w": "techniques", "b": [0.5259, 0.4743, 0.6338, 0.494]}, {"w": "for", "b": [0.6401, 0.4743, 0.6695, 0.494]}, {"w": "processing", "b": [0.6758, 0.4743, 0.7837, 0.494]}, {"w": "sequence", "b": [0.1799, 0.4948, 0.2723, 0.5145]}, {"w": "data,", "b": [0.2786, 0.4948, 0.327, 0.5145]}, {"w": "such", "b": [0.3333, 0.4948, 0.3795, 0.5145]}, {"w": "as", "b": [0.3858, 0.4948, 0.4068, 0.5145]}, {"w": "text", "b": [0.4131, 0.4948, 0.451, 0.5145]}, {"w": "and", "b": [0.4573, 0.4948, 0.4937, 0.5145]}, {"w": "timeseries.", "b": [0.5, 0.4948, 0.6086, 0.5145]}, {"w": "Chapter", "b": [0.1799, 0.5153, 0.2597, 0.535]}, {"w": "7", "b": [0.266, 0.5153, 0.2786, 0.535]}, {"w": "introduces", "b": [0.2849, 0.5153, 0.39, 0.535]}, {"w": "advanced", "b": [0.3963, 0.5153, 0.4916, 0.535]}, {"w": "techniques", "b": [0.4979, 0.5153, 0.6058, 0.535]}, {"w": "for", "b": [0.6121, 0.5153, 0.6415, 0.535]}, {"w": "building", "b": [0.6478, 0.5153, 0.7319, 0.535]}, {"w": "state-of-the-", "b": [0.7382, 0.5153, 0.8615, 0.535]}, {"w": "art", "b": [0.1799, 0.5358, 0.2065, 0.5555]}, {"w": "deep-learning", "b": [0.2128, 0.5358, 0.3515, 0.5555]}, {"w": "models.", "b": [0.3578, 0.5358, 0.437, 0.5555]}, {"w": "Chapter", "b": [0.1799, 0.5563, 0.2597, 0.576]}, {"w": "8", "b": [0.266, 0.5563, 0.2786, 0.576]}, {"w": "explains", "b": [0.2849, 0.5563, 0.369, 0.576]}, {"w": "generative", "b": [0.3753, 0.5563, 0.4804, 0.576]}, {"w": "models:", "b": [0.4867, 0.5563, 0.5666, 0.576]}, {"w": "deep-learning", "b": [0.5729, 0.5563, 0.7116, 0.576]}, {"w": "models", "b": [0.7179, 0.5563, 0.7908, 0.576]}, {"w": "capable", "b": [0.1799, 0.5768, 0.2569, 0.5965]}, {"w": "of", "b": [0.2632, 0.5768, 0.2842, 0.5965]}, {"w": "creating", "b": [0.2905, 0.5768, 0.3718, 0.5965]}, {"w": "images", "b": [0.3781, 0.5768, 0.4496, 0.5965]}, {"w": "and", "b": [0.4559, 0.5768, 0.4923, 0.5965]}, {"w": "text,", "b": [0.4986, 0.5768, 0.5427, 0.5965]}, {"w": "with", "b": [0.549, 0.5768, 0.5939, 0.5965]}, {"w": "sometimes", "b": [0.6002, 0.5768, 0.7081, 0.5965]}, {"w": "surprisingly", "b": [0.7144, 0.5768, 0.835, 0.5965]}, {"w": "artistic", "b": [0.1799, 0.5973, 0.2485, 0.617]}, {"w": "results.", "b": [0.2548, 0.5973, 0.327, 0.617]}, {"w": "Chapter", "b": [0.1799, 0.6178, 0.2597, 0.6375]}, {"w": "9", "b": [0.266, 0.6178, 0.2786, 0.6375]}, {"w": "is", "b": [0.2849, 0.6178, 0.3018, 0.6375]}, {"w": "dedicated", "b": [0.3081, 0.6178, 0.4047, 0.6375]}, {"w": "to", "b": [0.411, 0.6178, 0.4307, 0.6375]}, {"w": "consolidating", "b": [0.437, 0.6178, 0.5729, 0.6375]}, {"w": "what", "b": [0.5792, 0.6178, 0.6282, 0.6375]}, {"w": "you’ve", "b": [0.6346, 0.6178, 0.7046, 0.6375]}, {"w": "learned", "b": [0.7109, 0.6178, 0.7852, 0.6375]}, {"w": "throughout", "b": [0.1799, 0.6383, 0.2906, 0.658]}, {"w": "the", "b": [0.2969, 0.6383, 0.3277, 0.658]}, {"w": "book,", "b": [0.334, 0.6383, 0.3908, 0.658]}, {"w": "as", "b": [0.3971, 0.6383, 0.4181, 0.658]}, {"w": "well", "b": [0.4244, 0.6383, 0.4678, 0.658]}, {"w": "as", "b": [0.4741, 0.6383, 0.4952, 0.658]}, {"w": "opening", "b": [0.5015, 0.6383, 0.5827, 0.658]}, {"w": "perspectives", "b": [0.5891, 0.6383, 0.7137, 0.658]}, {"w": "on", "b": [0.72, 0.6383, 0.7453, 0.658]}, {"w": "the", "b": [0.7516, 0.6383, 0.7824, 0.658]}, {"w": "limitations", "b": [0.1799, 0.6588, 0.2878, 0.6785]}, {"w": "of", "b": [0.2941, 0.6588, 0.3151, 0.6785]}, {"w": "deep", "b": [0.3214, 0.6588, 0.369, 0.6785]}, {"w": "learning", "b": [0.3753, 0.6588, 0.458, 0.6785]}, {"w": "and", "b": [0.4643, 0.6588, 0.5007, 0.6785]}, {"w": "exploring", "b": [0.507, 0.6588, 0.6037, 0.6785]}, {"w": "its", "b": [0.61, 0.6588, 0.6339, 0.6785]}, {"w": "probable", "b": [0.6402, 0.6588, 0.7284, 0.6785]}, {"w": "future.", "b": [0.7347, 0.6588, 0.8013, 0.6785]}]}, {"id": "b_3", "type": "equation", "text": "Software/hardware requirements", "words": [{"w": "Software/hardware", "b": [0.1294, 0.7156, 0.3633, 0.7378]}, {"w": "requirements", "b": [0.3703, 0.7156, 0.5317, 0.7378]}]}, {"id": "b_4", "type": "paragraph", "text": "All of this book’s code examples use the Keras deep-learning framework (https://keras.io), which is open source and free to download. You’ll need access to a UNIX machine; it’s possible to use Windows, too, but I don’t recommend it. Appendix A walks you through the complete setup.", "words": [{"w": "All", "b": [0.1294, 0.7613, 0.1617, 0.781]}, {"w": "of", "b": [0.168, 0.7613, 0.189, 0.781]}, {"w": "this", "b": [0.1953, 0.7613, 0.2317, 0.781]}, {"w": "book’s", "b": [0.238, 0.7613, 0.3053, 0.781]}, {"w": "code", "b": [0.3116, 0.7613, 0.3592, 0.781]}, {"w": "examples", "b": [0.3655, 0.7613, 0.4608, 0.781]}, {"w": "use", "b": [0.4671, 0.7613, 0.5007, 0.781]}, {"w": "the", "b": [0.5071, 0.7613, 0.5379, 0.781]}, {"w": "Keras", "b": [0.5442, 0.7613, 0.603, 0.781]}, {"w": "deep-learning", "b": [0.6093, 0.7613, 0.748, 0.781]}, {"w": "framework", "b": [0.7543, 0.7613, 0.865, 0.781]}, {"w": "(https://keras.io),", "b": [0.1294, 0.7818, 0.3017, 0.8015]}, {"w": "which", "b": [0.308, 0.7818, 0.3697, 0.8015]}, {"w": "is", "b": [0.376, 0.7818, 0.3928, 0.8015]}, {"w": "open", "b": [0.3991, 0.7818, 0.4482, 0.8015]}, {"w": "source", "b": [0.4545, 0.7818, 0.5203, 0.8015]}, {"w": "and", "b": [0.5266, 0.7818, 0.5631, 0.8015]}, {"w": "free", "b": [0.5694, 0.7818, 0.6086, 0.8015]}, {"w": "to", "b": [0.6149, 0.7818, 0.6345, 0.8015]}, {"w": "download.", "b": [0.6408, 0.7818, 0.7466, 0.8015]}, {"w": "You’ll", "b": [0.7529, 0.7818, 0.8162, 0.8015]}, {"w": "need", "b": [0.8225, 0.7818, 0.8701, 0.8015]}, {"w": "access", "b": [0.1294, 0.8023, 0.1938, 0.822]}, {"w": "to", "b": [0.2001, 0.8023, 0.2198, 0.822]}, {"w": "a", "b": [0.2261, 0.8023, 0.2373, 0.822]}, {"w": "UNIX", "b": [0.2436, 0.8023, 0.3066, 0.822]}, {"w": "machine;", "b": [0.3129, 0.8023, 0.4054, 0.822]}, {"w": "it’s", "b": [0.4117, 0.8023, 0.4425, 0.822]}, {"w": "possible", "b": [0.4488, 0.8023, 0.5315, 0.822]}, {"w": "to", "b": [0.5378, 0.8023, 0.5575, 0.822]}, {"w": "use", "b": [0.5638, 0.8023, 0.5974, 0.822]}, {"w": "Windows,", "b": [0.6037, 0.8023, 0.7057, 0.822]}, {"w": "too,", "b": [0.712, 0.8023, 0.7505, 0.822]}, {"w": "but", "b": [0.7568, 0.8023, 0.7891, 0.822]}, {"w": "I", "b": [0.7954, 0.8023, 0.8038, 0.822]}, {"w": "don’t", "b": [0.8101, 0.8023, 0.8629, 0.822]}, {"w": "recommend", "b": [0.1294, 0.8228, 0.2485, 0.8425]}, {"w": "it.", "b": [0.2548, 0.8228, 0.2751, 0.8425]}, {"w": "Appendix", "b": [0.2814, 0.8228, 0.3809, 0.8425]}, {"w": "A", "b": [0.3872, 0.8228, 0.4054, 0.8425]}, {"w": "walks", "b": [0.4117, 0.8228, 0.4706, 0.8425]}, {"w": "you", "b": [0.4769, 0.8228, 0.5147, 0.8425]}, {"w": "through", "b": [0.521, 0.8228, 0.5995, 0.8425]}, {"w": "the", "b": [0.6058, 0.8228, 0.6366, 0.8425]}, {"w": "complete", "b": [0.6429, 0.8228, 0.7354, 0.8425]}, {"w": "setup.", "b": [0.7417, 0.8228, 0.8013, 0.8425]}]}, {"id": "b_5", "type": "paragraph", "text": "I also recommend that you have a recent NVIDIA GPU on your machine, such as a TITAN X. This isn’t required, but it will make your", "words": [{"w": "I", "b": [0.1294, 0.8656, 0.1378, 0.8853]}, {"w": "also", "b": [0.1441, 0.8656, 0.1848, 0.8853]}, {"w": "recommend", "b": [0.1911, 0.8656, 0.3102, 0.8853]}, {"w": "that", "b": [0.3165, 0.8656, 0.3543, 0.8853]}, {"w": "you", "b": [0.3606, 0.8656, 0.3984, 0.8853]}, {"w": "have", "b": [0.4048, 0.8656, 0.4524, 0.8853]}, {"w": "a", "b": [0.4587, 0.8656, 0.4699, 0.8853]}, {"w": "recent", "b": [0.4762, 0.8656, 0.5378, 0.8853]}, {"w": "NVIDIA", "b": [0.5441, 0.8656, 0.6338, 0.8853]}, {"w": "GPU", "b": [0.6401, 0.8656, 0.6905, 0.8853]}, {"w": "on", "b": [0.6968, 0.8656, 0.7221, 0.8853]}, {"w": "your", "b": [0.7284, 0.8656, 0.7746, 0.8853]}, {"w": "machine,", "b": [0.1294, 0.8861, 0.2212, 0.9058]}, {"w": "such", "b": [0.2275, 0.8861, 0.2737, 0.9058]}, {"w": "as", "b": [0.28, 0.8861, 0.301, 0.9058]}, {"w": "a", "b": [0.3074, 0.8861, 0.3186, 0.9058]}, {"w": "TITAN", "b": [0.3249, 0.8861, 0.3985, 0.9058]}, {"w": "X.", "b": [0.4048, 0.8861, 0.4293, 0.9058]}, {"w": "This", "b": [0.4356, 0.8861, 0.4804, 0.9058]}, {"w": "isn’t", "b": [0.4868, 0.8861, 0.5312, 0.9058]}, {"w": "required,", "b": [0.5375, 0.8861, 0.6278, 0.9058]}, {"w": "but", "b": [0.6341, 0.8861, 0.6664, 0.9058]}, {"w": "it", "b": [0.6727, 0.8861, 0.6867, 0.9058]}, {"w": "will", "b": [0.693, 0.8861, 0.7323, 0.9058]}, {"w": "make", "b": [0.7386, 0.8861, 0.7932, 0.9058]}, {"w": "your", "b": [0.7995, 0.8861, 0.8457, 0.9058]}]}]}, {"page": 25, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "experience better by allowing you to run the code examples several times faster. See section 3.3 for more information about setting up a deep- learning workstation.", "words": [{"w": "experience", "b": [0.1294, 0.0857, 0.2387, 0.1054]}, {"w": "better", "b": [0.245, 0.0857, 0.3024, 0.1054]}, {"w": "by", "b": [0.3087, 0.0857, 0.3339, 0.1054]}, {"w": "allowing", "b": [0.3402, 0.0857, 0.4285, 0.1054]}, {"w": "you", "b": [0.4348, 0.0857, 0.4727, 0.1054]}, {"w": "to", "b": [0.479, 0.0857, 0.4986, 0.1054]}, {"w": "run", "b": [0.5049, 0.0857, 0.5385, 0.1054]}, {"w": "the", "b": [0.5449, 0.0857, 0.5757, 0.1054]}, {"w": "code", "b": [0.582, 0.0857, 0.6296, 0.1054]}, {"w": "examples", "b": [0.6359, 0.0857, 0.7312, 0.1054]}, {"w": "several", "b": [0.7375, 0.0857, 0.8089, 0.1054]}, {"w": "times", "b": [0.8153, 0.0857, 0.8699, 0.1054]}, {"w": "faster.", "b": [0.1294, 0.1062, 0.1903, 0.1259]}, {"w": "See", "b": [0.1967, 0.1062, 0.2331, 0.1259]}, {"w": "section", "b": [0.2394, 0.1062, 0.3108, 0.1259]}, {"w": "3.3", "b": [0.3172, 0.1062, 0.3487, 0.1259]}, {"w": "for", "b": [0.355, 0.1062, 0.3844, 0.1259]}, {"w": "more", "b": [0.3907, 0.1062, 0.4425, 0.1259]}, {"w": "information", "b": [0.4488, 0.1062, 0.5679, 0.1259]}, {"w": "about", "b": [0.5743, 0.1062, 0.6303, 0.1259]}, {"w": "setting", "b": [0.6366, 0.1062, 0.7039, 0.1259]}, {"w": "up", "b": [0.7102, 0.1062, 0.7354, 0.1259]}, {"w": "a", "b": [0.7417, 0.1062, 0.7529, 0.1259]}, {"w": "deep-", "b": [0.7592, 0.1062, 0.8153, 0.1259]}, {"w": "learning", "b": [0.1294, 0.1267, 0.2121, 0.1464]}, {"w": "workstation.", "b": [0.2184, 0.1267, 0.3438, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "If you don’t have access to a local workstation with a recent NVIDIA GPU, you can use a cloud environment, instead. In particular, you can use Google Cloud instances (such as an n1-standard-8 instance with an NVIDIA Tesla K80 add-on) or Amazon Web Services (AWS) GPU instances (such as a p2.xlarge instance). Appendix B presents in detail one possible cloud workflow that runs an AWS instance via Jupyter notebooks, accessible in your browser.", "words": [{"w": "If", "b": [0.1294, 0.1695, 0.1462, 0.1892]}, {"w": "you", "b": [0.1525, 0.1695, 0.1904, 0.1892]}, {"w": "don’t", "b": [0.1967, 0.1695, 0.2495, 0.1892]}, {"w": "have", "b": [0.2558, 0.1695, 0.3034, 0.1892]}, {"w": "access", "b": [0.3097, 0.1695, 0.3741, 0.1892]}, {"w": "to", "b": [0.3804, 0.1695, 0.4001, 0.1892]}, {"w": "a", "b": [0.4064, 0.1695, 0.4176, 0.1892]}, {"w": "local", "b": [0.4239, 0.1695, 0.4729, 0.1892]}, {"w": "workstation", "b": [0.4792, 0.1695, 0.5983, 0.1892]}, {"w": "with", "b": [0.6046, 0.1695, 0.6495, 0.1892]}, {"w": "a", "b": [0.6558, 0.1695, 0.667, 0.1892]}, {"w": "recent", "b": [0.6733, 0.1695, 0.7349, 0.1892]}, {"w": "NVIDIA", "b": [0.7412, 0.1695, 0.8309, 0.1892]}, {"w": "GPU,", "b": [0.1294, 0.19, 0.1862, 0.2097]}, {"w": "you", "b": [0.1925, 0.19, 0.2303, 0.2097]}, {"w": "can", "b": [0.2366, 0.19, 0.2716, 0.2097]}, {"w": "use", "b": [0.2779, 0.19, 0.3116, 0.2097]}, {"w": "a", "b": [0.3179, 0.19, 0.3291, 0.2097]}, {"w": "cloud", "b": [0.3354, 0.19, 0.3914, 0.2097]}, {"w": "environment,", "b": [0.3977, 0.19, 0.5316, 0.2097]}, {"w": "instead.", "b": [0.5379, 0.19, 0.6156, 0.2097]}, {"w": "In", "b": [0.6219, 0.19, 0.643, 0.2097]}, {"w": "particular,", "b": [0.6493, 0.19, 0.7512, 0.2097]}, {"w": "you", "b": [0.7575, 0.19, 0.7953, 0.2097]}, {"w": "can", "b": [0.8016, 0.19, 0.8366, 0.2097]}, {"w": "use", "b": [0.1294, 0.2105, 0.163, 0.2302]}, {"w": "Google", "b": [0.1693, 0.2105, 0.2436, 0.2302]}, {"w": "Cloud", "b": [0.2499, 0.2105, 0.3116, 0.2302]}, {"w": "instances", "b": [0.3179, 0.2105, 0.4104, 0.2302]}, {"w": "(such", "b": [0.4167, 0.2105, 0.4713, 0.2302]}, {"w": "as", "b": [0.4776, 0.2105, 0.4986, 0.2302]}, {"w": "an", "b": [0.5049, 0.2105, 0.5288, 0.2302]}, {"w": "n1-standard-8", "b": [0.5351, 0.2105, 0.6752, 0.2302]}, {"w": "instance", "b": [0.6815, 0.2105, 0.7641, 0.2302]}, {"w": "with", "b": [0.7704, 0.2105, 0.8153, 0.2302]}, {"w": "an", "b": [0.8216, 0.2105, 0.8454, 0.2302]}, {"w": "NVIDIA", "b": [0.1294, 0.231, 0.2191, 0.2507]}, {"w": "Tesla", "b": [0.2254, 0.231, 0.2783, 0.2507]}, {"w": "K80", "b": [0.2846, 0.231, 0.328, 0.2507]}, {"w": "add-on)", "b": [0.3343, 0.231, 0.4128, 0.2507]}, {"w": "or", "b": [0.4191, 0.231, 0.4401, 0.2507]}, {"w": "Amazon", "b": [0.4464, 0.231, 0.5319, 0.2507]}, {"w": "Web", "b": [0.5382, 0.231, 0.5838, 0.2507]}, {"w": "Services", "b": [0.5901, 0.231, 0.6755, 0.2507]}, {"w": "(AWS)", "b": [0.6818, 0.231, 0.7527, 0.2507]}, {"w": "GPU", "b": [0.759, 0.231, 0.8094, 0.2507]}, {"w": "instances", "b": [0.1294, 0.2515, 0.2219, 0.2712]}, {"w": "(such", "b": [0.2282, 0.2515, 0.2828, 0.2712]}, {"w": "as", "b": [0.2891, 0.2515, 0.3102, 0.2712]}, {"w": "a", "b": [0.3165, 0.2515, 0.3277, 0.2712]}, {"w": "p2.xlarge", "b": [0.334, 0.2515, 0.4281, 0.2712]}, {"w": "instance).", "b": [0.4344, 0.2515, 0.5317, 0.2712]}, {"w": "Appendix", "b": [0.538, 0.2515, 0.6375, 0.2712]}, {"w": "B", "b": [0.6438, 0.2515, 0.6606, 0.2712]}, {"w": "presents", "b": [0.6669, 0.2515, 0.7496, 0.2712]}, {"w": "in", "b": [0.7559, 0.2515, 0.7755, 0.2712]}, {"w": "detail", "b": [0.7818, 0.2515, 0.8379, 0.2712]}, {"w": "one", "b": [0.1294, 0.272, 0.1658, 0.2917]}, {"w": "possible", "b": [0.1721, 0.272, 0.2548, 0.2917]}, {"w": "cloud", "b": [0.2611, 0.272, 0.3172, 0.2917]}, {"w": "workflow", "b": [0.3235, 0.272, 0.4216, 0.2917]}, {"w": "that", "b": [0.4279, 0.272, 0.4657, 0.2917]}, {"w": "runs", "b": [0.472, 0.272, 0.5155, 0.2917]}, {"w": "an", "b": [0.5218, 0.272, 0.5456, 0.2917]}, {"w": "AWS", "b": [0.5519, 0.272, 0.6059, 0.2917]}, {"w": "instance", "b": [0.6122, 0.272, 0.6949, 0.2917]}, {"w": "via", "b": [0.7012, 0.272, 0.732, 0.2917]}, {"w": "Jupyter", "b": [0.7383, 0.272, 0.8126, 0.2917]}, {"w": "notebooks,", "b": [0.1294, 0.2925, 0.2394, 0.3122]}, {"w": "accessible", "b": [0.2457, 0.2925, 0.348, 0.3122]}, {"w": "in", "b": [0.3543, 0.2925, 0.3739, 0.3122]}, {"w": "your", "b": [0.3802, 0.2925, 0.4265, 0.3122]}, {"w": "browser.", "b": [0.4328, 0.2925, 0.5189, 0.3122]}]}, {"id": "b_2", "type": "paragraph", "text": "Source code", "words": [{"w": "Source", "b": [0.1294, 0.3493, 0.2125, 0.3715]}, {"w": "code", "b": [0.2195, 0.3493, 0.2747, 0.3715]}]}, {"id": "b_3", "type": "paragraph", "text": "All code examples in this book are available for download as Jupyter notebooks from the book’s website, www.manning.com/books/deep- learning-with-python, and on GitHub at https://github.com/fchollet/deep- learning-with-python-notebooks.", "words": [{"w": "All", "b": [0.1294, 0.395, 0.1617, 0.4147]}, {"w": "code", "b": [0.168, 0.395, 0.2156, 0.4147]}, {"w": "examples", "b": [0.2219, 0.395, 0.3172, 0.4147]}, {"w": "in", "b": [0.3235, 0.395, 0.3431, 0.4147]}, {"w": "this", "b": [0.3494, 0.395, 0.3859, 0.4147]}, {"w": "book", "b": [0.3922, 0.395, 0.4426, 0.4147]}, {"w": "are", "b": [0.4489, 0.395, 0.4797, 0.4147]}, {"w": "available", "b": [0.486, 0.395, 0.5771, 0.4147]}, {"w": "for", "b": [0.5834, 0.395, 0.6128, 0.4147]}, {"w": "download", "b": [0.6191, 0.395, 0.7186, 0.4147]}, {"w": "as", "b": [0.7249, 0.395, 0.7459, 0.4147]}, {"w": "Jupyter", "b": [0.7522, 0.395, 0.8265, 0.4147]}, {"w": "notebooks", "b": [0.1294, 0.4155, 0.2331, 0.4352]}, {"w": "from", "b": [0.2394, 0.4155, 0.2885, 0.4352]}, {"w": "the", "b": [0.2948, 0.4155, 0.3256, 0.4352]}, {"w": "book’s", "b": [0.3319, 0.4155, 0.3992, 0.4352]}, {"w": "website,", "b": [0.4055, 0.4155, 0.4888, 0.4352]}, {"w": "www.manning.com/books/deep-", "b": [0.4951, 0.4155, 0.8228, 0.4352]}, {"w": "learning-with-python,", "b": [0.1294, 0.436, 0.3501, 0.4557]}, {"w": "and", "b": [0.3564, 0.436, 0.3928, 0.4557]}, {"w": "on", "b": [0.3991, 0.436, 0.4243, 0.4557]}, {"w": "GitHub", "b": [0.4306, 0.436, 0.5063, 0.4557]}, {"w": "at", "b": [0.5126, 0.436, 0.5308, 0.4557]}, {"w": "https://github.com/fchollet/deep-", "b": [0.5371, 0.436, 0.8686, 0.4557]}, {"w": "learning-with-python-notebooks.", "b": [0.1294, 0.4565, 0.4622, 0.4762]}]}, {"id": "b_4", "type": "paragraph", "text": "Book forum", "words": [{"w": "Book", "b": [0.1294, 0.5133, 0.1925, 0.5355]}, {"w": "forum", "b": [0.1996, 0.5133, 0.2753, 0.5355]}]}, {"id": "b_5", "type": "paragraph", "text": "Purchase of Deep Learning with Python includes free access to a private web forum run by Manning Publications where you can make comments about the book, ask technical questions, and receive help from the author and from other users. To access the forum, go to https://forums.manning.com/forums/deep-learning-with-python. You can also learn more about Manning’s forums and the rules of conduct at https://forums.manning.com/forums/about.", "words": [{"w": "Purchase", "b": [0.1294, 0.559, 0.2205, 0.5787]}, {"w": "of", "b": [0.2268, 0.559, 0.2478, 0.5787]}, {"w": "Deep", "b": [0.2541, 0.559, 0.3073, 0.5787]}, {"w": "Learning", "b": [0.3136, 0.559, 0.4061, 0.5787]}, {"w": "with", "b": [0.4124, 0.559, 0.4559, 0.5787]}, {"w": "Python", "b": [0.4622, 0.559, 0.5337, 0.5787]}, {"w": "includes", "b": [0.5399, 0.559, 0.624, 0.5787]}, {"w": "free", "b": [0.6303, 0.559, 0.6695, 0.5787]}, {"w": "access", "b": [0.6758, 0.559, 0.7403, 0.5787]}, {"w": "to", "b": [0.7466, 0.559, 0.7662, 0.5787]}, {"w": "a", "b": [0.7725, 0.559, 0.7837, 0.5787]}, {"w": "private", "b": [0.79, 0.559, 0.8601, 0.5787]}, {"w": "web", "b": [0.1294, 0.5795, 0.1714, 0.5992]}, {"w": "forum", "b": [0.1777, 0.5795, 0.2394, 0.5992]}, {"w": "run", "b": [0.2457, 0.5795, 0.2793, 0.5992]}, {"w": "by", "b": [0.2856, 0.5795, 0.3109, 0.5992]}, {"w": "Manning", "b": [0.3172, 0.5795, 0.4083, 0.5992]}, {"w": "Publications", "b": [0.4146, 0.5795, 0.5393, 0.5992]}, {"w": "where", "b": [0.5456, 0.5795, 0.6072, 0.5992]}, {"w": "you", "b": [0.6135, 0.5795, 0.6514, 0.5992]}, {"w": "can", "b": [0.6577, 0.5795, 0.6927, 0.5992]}, {"w": "make", "b": [0.699, 0.5795, 0.7536, 0.5992]}, {"w": "comments", "b": [0.76, 0.5795, 0.8637, 0.5992]}, {"w": "about", "b": [0.1294, 0.6, 0.1855, 0.6197]}, {"w": "the", "b": [0.1918, 0.6, 0.2226, 0.6197]}, {"w": "book,", "b": [0.2289, 0.6, 0.2857, 0.6197]}, {"w": "ask", "b": [0.292, 0.6, 0.3256, 0.6197]}, {"w": "technical", "b": [0.3319, 0.6, 0.423, 0.6197]}, {"w": "questions,", "b": [0.4292, 0.6, 0.5308, 0.6197]}, {"w": "and", "b": [0.5371, 0.6, 0.5736, 0.6197]}, {"w": "receive", "b": [0.5799, 0.6, 0.6527, 0.6197]}, {"w": "help", "b": [0.659, 0.6, 0.7024, 0.6197]}, {"w": "from", "b": [0.7088, 0.6, 0.7578, 0.6197]}, {"w": "the", "b": [0.7641, 0.6, 0.7949, 0.6197]}, {"w": "author", "b": [0.8012, 0.6, 0.8657, 0.6197]}, {"w": "and", "b": [0.1294, 0.6205, 0.1658, 0.6402]}, {"w": "from", "b": [0.1721, 0.6205, 0.2212, 0.6402]}, {"w": "other", "b": [0.2275, 0.6205, 0.2793, 0.6402]}, {"w": "users.", "b": [0.2856, 0.6205, 0.3438, 0.6402]}, {"w": "To", "b": [0.3501, 0.6205, 0.3763, 0.6402]}, {"w": "access", "b": [0.3826, 0.6205, 0.4471, 0.6402]}, {"w": "the", "b": [0.4534, 0.6205, 0.4842, 0.6402]}, {"w": "forum,", "b": [0.4905, 0.6205, 0.5585, 0.6402]}, {"w": "go", "b": [0.5648, 0.6205, 0.59, 0.6402]}, {"w": "to", "b": [0.5963, 0.6205, 0.6159, 0.6402]}, {"w": "https://forums.manning.com/forums/deep-learning-with-python.", "b": [0.1294, 0.641, 0.7775, 0.6607]}, {"w": "You", "b": [0.7838, 0.641, 0.8247, 0.6607]}, {"w": "can", "b": [0.831, 0.641, 0.866, 0.6607]}, {"w": "also", "b": [0.1294, 0.6615, 0.1701, 0.6812]}, {"w": "learn", "b": [0.1764, 0.6615, 0.2268, 0.6812]}, {"w": "more", "b": [0.2331, 0.6615, 0.2849, 0.6812]}, {"w": "about", "b": [0.2912, 0.6615, 0.3473, 0.6812]}, {"w": "Manning’s", "b": [0.3536, 0.6615, 0.4615, 0.6812]}, {"w": "forums", "b": [0.4678, 0.6615, 0.5392, 0.6812]}, {"w": "and", "b": [0.5455, 0.6615, 0.582, 0.6812]}, {"w": "the", "b": [0.5883, 0.6615, 0.6191, 0.6812]}, {"w": "rules", "b": [0.6254, 0.6615, 0.6745, 0.6812]}, {"w": "of", "b": [0.6808, 0.6615, 0.7018, 0.6812]}, {"w": "conduct", "b": [0.7081, 0.6615, 0.7879, 0.6812]}, {"w": "at", "b": [0.7942, 0.6615, 0.8125, 0.6812]}, {"w": "https://forums.manning.com/forums/about.", "b": [0.1294, 0.682, 0.5631, 0.7017]}]}, {"id": "b_6", "type": "paragraph", "text": "Manning’s commitment to our readers is to provide a venue where a meaningful dialogue between individual readers and between readers and the author can take place. It isn’t a commitment to any specific amount of participation on the part of the author, whose contribution to the forum remains voluntary (and unpaid). We suggest you try asking him some challenging questions lest his interest stray! The forum and the archives of previous discussions will be accessible from the publisher’s website as long as the book is in print.", "words": [{"w": "Manning’s", "b": [0.1294, 0.7247, 0.2373, 0.7445]}, {"w": "commitment", "b": [0.2436, 0.7247, 0.3712, 0.7445]}, {"w": "to", "b": [0.3775, 0.7247, 0.3971, 0.7445]}, {"w": "our", "b": [0.4034, 0.7247, 0.437, 0.7445]}, {"w": "readers", "b": [0.4433, 0.7247, 0.5162, 0.7445]}, {"w": "is", "b": [0.5225, 0.7247, 0.5393, 0.7445]}, {"w": "to", "b": [0.5456, 0.7247, 0.5652, 0.7445]}, {"w": "provide", "b": [0.5715, 0.7247, 0.6486, 0.7445]}, {"w": "a", "b": [0.6549, 0.7247, 0.6661, 0.7445]}, {"w": "venue", "b": [0.6724, 0.7247, 0.7327, 0.7445]}, {"w": "where", "b": [0.739, 0.7247, 0.8006, 0.7445]}, {"w": "a", "b": [0.8069, 0.7247, 0.8181, 0.7445]}, {"w": "meaningful", "b": [0.1294, 0.7453, 0.2443, 0.765]}, {"w": "dialogue", "b": [0.2506, 0.7453, 0.3375, 0.765]}, {"w": "between", "b": [0.3438, 0.7453, 0.4279, 0.765]}, {"w": "individual", "b": [0.4342, 0.7453, 0.5365, 0.765]}, {"w": "readers", "b": [0.5428, 0.7453, 0.6156, 0.765]}, {"w": "and", "b": [0.6219, 0.7453, 0.6583, 0.765]}, {"w": "between", "b": [0.6647, 0.7453, 0.7487, 0.765]}, {"w": "readers", "b": [0.7549, 0.7453, 0.8277, 0.765]}, {"w": "and", "b": [0.834, 0.7453, 0.8705, 0.765]}, {"w": "the", "b": [0.1294, 0.7658, 0.1602, 0.7855]}, {"w": "author", "b": [0.1665, 0.7658, 0.231, 0.7855]}, {"w": "can", "b": [0.2373, 0.7658, 0.2723, 0.7855]}, {"w": "take", "b": [0.2786, 0.7658, 0.3206, 0.7855]}, {"w": "place.", "b": [0.327, 0.7658, 0.3865, 0.7855]}, {"w": "It", "b": [0.3928, 0.7658, 0.4082, 0.7855]}, {"w": "isn’t", "b": [0.4145, 0.7658, 0.4589, 0.7855]}, {"w": "a", "b": [0.4652, 0.7658, 0.4764, 0.7855]}, {"w": "commitment", "b": [0.4827, 0.7658, 0.6102, 0.7855]}, {"w": "to", "b": [0.6165, 0.7658, 0.6361, 0.7855]}, {"w": "any", "b": [0.6424, 0.7658, 0.6789, 0.7855]}, {"w": "specific", "b": [0.6852, 0.7658, 0.7636, 0.7855]}, {"w": "amount", "b": [0.7699, 0.7658, 0.8456, 0.7855]}, {"w": "of", "b": [0.1294, 0.7863, 0.1504, 0.806]}, {"w": "participation", "b": [0.1567, 0.7863, 0.2842, 0.806]}, {"w": "on", "b": [0.2906, 0.7863, 0.3158, 0.806]}, {"w": "the", "b": [0.3221, 0.7863, 0.3529, 0.806]}, {"w": "part", "b": [0.3592, 0.7863, 0.3984, 0.806]}, {"w": "of", "b": [0.4048, 0.7863, 0.4258, 0.806]}, {"w": "the", "b": [0.4321, 0.7863, 0.4629, 0.806]}, {"w": "author,", "b": [0.4692, 0.7863, 0.5389, 0.806]}, {"w": "whose", "b": [0.5452, 0.7863, 0.6096, 0.806]}, {"w": "contribution", "b": [0.6159, 0.7863, 0.7393, 0.806]}, {"w": "to", "b": [0.7456, 0.7863, 0.7652, 0.806]}, {"w": "the", "b": [0.7715, 0.7863, 0.8023, 0.806]}, {"w": "forum", "b": [0.8086, 0.7863, 0.8703, 0.806]}, {"w": "remains", "b": [0.1294, 0.8068, 0.2093, 0.8265]}, {"w": "voluntary", "b": [0.2156, 0.8068, 0.3123, 0.8265]}, {"w": "(and", "b": [0.3186, 0.8068, 0.3634, 0.8265]}, {"w": "unpaid).", "b": [0.3697, 0.8068, 0.4531, 0.8265]}, {"w": "We", "b": [0.4594, 0.8068, 0.4923, 0.8265]}, {"w": "suggest", "b": [0.4987, 0.8068, 0.5743, 0.8265]}, {"w": "you", "b": [0.5806, 0.8068, 0.6185, 0.8265]}, {"w": "try", "b": [0.6248, 0.8068, 0.6528, 0.8265]}, {"w": "asking", "b": [0.6591, 0.8068, 0.725, 0.8265]}, {"w": "him", "b": [0.7313, 0.8068, 0.7705, 0.8265]}, {"w": "some", "b": [0.7768, 0.8068, 0.8301, 0.8265]}, {"w": "challenging", "b": [0.1294, 0.8273, 0.2471, 0.847]}, {"w": "questions", "b": [0.2534, 0.8273, 0.3487, 0.847]}, {"w": "lest", "b": [0.355, 0.8273, 0.3901, 0.847]}, {"w": "his", "b": [0.3963, 0.8273, 0.4258, 0.847]}, {"w": "interest", "b": [0.4321, 0.8273, 0.5063, 0.847]}, {"w": "stray!", "b": [0.5126, 0.8273, 0.5701, 0.847]}, {"w": "The", "b": [0.5764, 0.8273, 0.6156, 0.847]}, {"w": "forum", "b": [0.6219, 0.8273, 0.6836, 0.847]}, {"w": "and", "b": [0.6899, 0.8273, 0.7263, 0.847]}, {"w": "the", "b": [0.7326, 0.8273, 0.7634, 0.847]}, {"w": "archives", "b": [0.7697, 0.8273, 0.8538, 0.847]}, {"w": "of", "b": [0.1294, 0.8478, 0.1504, 0.8675]}, {"w": "previous", "b": [0.1567, 0.8478, 0.2436, 0.8675]}, {"w": "discussions", "b": [0.2499, 0.8478, 0.3648, 0.8675]}, {"w": "will", "b": [0.3712, 0.8478, 0.4104, 0.8675]}, {"w": "be", "b": [0.4167, 0.8478, 0.4405, 0.8675]}, {"w": "accessible", "b": [0.4468, 0.8478, 0.5491, 0.8675]}, {"w": "from", "b": [0.5554, 0.8478, 0.6044, 0.8675]}, {"w": "the", "b": [0.6107, 0.8478, 0.6416, 0.8675]}, {"w": "publisher’s", "b": [0.6479, 0.8478, 0.7595, 0.8675]}, {"w": "website", "b": [0.7658, 0.8478, 0.8428, 0.8675]}, {"w": "as", "b": [0.8492, 0.8478, 0.8702, 0.8675]}, {"w": "long", "b": [0.1294, 0.8683, 0.1743, 0.888]}, {"w": "as", "b": [0.1806, 0.8683, 0.2016, 0.888]}, {"w": "the", "b": [0.2079, 0.8683, 0.2387, 0.888]}, {"w": "book", "b": [0.245, 0.8683, 0.2955, 0.888]}, {"w": "is", "b": [0.3018, 0.8683, 0.3186, 0.888]}, {"w": "in", "b": [0.3249, 0.8683, 0.3445, 0.888]}, {"w": "print.", "b": [0.3508, 0.8683, 0.4048, 0.888]}]}]}, {"page": 26, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "About the Author", "words": [{"w": "About", "b": [0.1294, 0.1076, 0.2247, 0.1355]}, {"w": "the", "b": [0.2337, 0.1076, 0.2813, 0.1355]}, {"w": "Author", "b": [0.2902, 0.1076, 0.4014, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "François Chollet works on deep learning at Google in Mountain View, CA. He is the creator of the Keras deep-learning library, as well as a contributor to the TensorFlow machine-learning framework. He also does deep-learning research, with a focus on computer vision and the application of machine learning to formal reasoning. His papers have been published at major conferences in the field, including the Conference on Computer Vision and Pattern Recognition (CVPR), the Conference and Workshop on Neural Information Processing Systems (NIPS), the International Conference on Learning Representations (ICLR), and others.", "words": [{"w": "François", "b": [0.1294, 0.3263, 0.2163, 0.3461]}, {"w": "Chollet", "b": [0.2226, 0.3263, 0.2969, 0.3461]}, {"w": "works", "b": [0.3032, 0.3263, 0.3648, 0.3461]}, {"w": "on", "b": [0.3712, 0.3263, 0.3964, 0.3461]}, {"w": "deep", "b": [0.4027, 0.3263, 0.4503, 0.3461]}, {"w": "learning", "b": [0.4566, 0.3263, 0.5393, 0.3461]}, {"w": "at", "b": [0.5456, 0.3263, 0.5638, 0.3461]}, {"w": "Google", "b": [0.5701, 0.3263, 0.6444, 0.3461]}, {"w": "in", "b": [0.6507, 0.3263, 0.6703, 0.3461]}, {"w": "Mountain", "b": [0.6766, 0.3263, 0.7747, 0.3461]}, {"w": "View,", "b": [0.781, 0.3263, 0.8388, 0.3461]}, {"w": "CA.", "b": [0.1294, 0.3468, 0.1708, 0.3666]}, {"w": "He", "b": [0.1771, 0.3468, 0.2065, 0.3666]}, {"w": "is", "b": [0.2128, 0.3468, 0.2296, 0.3666]}, {"w": "the", "b": [0.2359, 0.3468, 0.2667, 0.3666]}, {"w": "creator", "b": [0.273, 0.3468, 0.3431, 0.3666]}, {"w": "of", "b": [0.3494, 0.3468, 0.3704, 0.3666]}, {"w": "the", "b": [0.3767, 0.3468, 0.4075, 0.3666]}, {"w": "Keras", "b": [0.4138, 0.3468, 0.4727, 0.3666]}, {"w": "deep-learning", "b": [0.479, 0.3468, 0.6177, 0.3666]}, {"w": "library,", "b": [0.624, 0.3468, 0.6958, 0.3666]}, {"w": "as", "b": [0.7021, 0.3468, 0.7231, 0.3666]}, {"w": "well", "b": [0.7294, 0.3468, 0.7729, 0.3666]}, {"w": "as", "b": [0.7792, 0.3468, 0.8002, 0.3666]}, {"w": "a", "b": [0.8065, 0.3468, 0.8177, 0.3666]}, {"w": "contributor", "b": [0.1294, 0.3673, 0.2415, 0.3871]}, {"w": "to", "b": [0.2478, 0.3673, 0.2674, 0.3871]}, {"w": "the", "b": [0.2738, 0.3673, 0.3046, 0.3871]}, {"w": "TensorFlow", "b": [0.3109, 0.3673, 0.431, 0.3871]}, {"w": "machine-learning", "b": [0.4373, 0.3673, 0.6138, 0.3871]}, {"w": "framework.", "b": [0.6202, 0.3673, 0.7371, 0.3871]}, {"w": "He", "b": [0.7434, 0.3673, 0.7728, 0.3871]}, {"w": "also", "b": [0.7791, 0.3673, 0.8198, 0.3871]}, {"w": "does", "b": [0.1294, 0.3878, 0.1757, 0.4076]}, {"w": "deep-learning", "b": [0.182, 0.3878, 0.3206, 0.4076]}, {"w": "research,", "b": [0.327, 0.3878, 0.4173, 0.4076]}, {"w": "with", "b": [0.4236, 0.3878, 0.4684, 0.4076]}, {"w": "a", "b": [0.4748, 0.3878, 0.486, 0.4076]}, {"w": "focus", "b": [0.4923, 0.3878, 0.5469, 0.4076]}, {"w": "on", "b": [0.5532, 0.3878, 0.5784, 0.4076]}, {"w": "computer", "b": [0.5847, 0.3878, 0.68, 0.4076]}, {"w": "vision", "b": [0.6863, 0.3878, 0.7479, 0.4076]}, {"w": "and", "b": [0.7542, 0.3878, 0.7907, 0.4076]}, {"w": "the", "b": [0.797, 0.3878, 0.8278, 0.4076]}, {"w": "application", "b": [0.1294, 0.4083, 0.2415, 0.4281]}, {"w": "of", "b": [0.2478, 0.4083, 0.2688, 0.4281]}, {"w": "machine", "b": [0.2751, 0.4083, 0.3606, 0.4281]}, {"w": "learning", "b": [0.3669, 0.4083, 0.4496, 0.4281]}, {"w": "to", "b": [0.4559, 0.4083, 0.4755, 0.4281]}, {"w": "formal", "b": [0.4818, 0.4083, 0.5491, 0.4281]}, {"w": "reasoning.", "b": [0.5554, 0.4083, 0.6598, 0.4281]}, {"w": "His", "b": [0.6661, 0.4083, 0.7011, 0.4281]}, {"w": "papers", "b": [0.7074, 0.4083, 0.7732, 0.4281]}, {"w": "have", "b": [0.7796, 0.4083, 0.8272, 0.4281]}, {"w": "been", "b": [0.1294, 0.4288, 0.177, 0.4486]}, {"w": "published", "b": [0.1833, 0.4288, 0.2814, 0.4486]}, {"w": "at", "b": [0.2878, 0.4288, 0.306, 0.4486]}, {"w": "major", "b": [0.3123, 0.4288, 0.3711, 0.4486]}, {"w": "conferences", "b": [0.3774, 0.4288, 0.4979, 0.4486]}, {"w": "in", "b": [0.5041, 0.4288, 0.5238, 0.4486]}, {"w": "the", "b": [0.5301, 0.4288, 0.5609, 0.4486]}, {"w": "field,", "b": [0.5672, 0.4288, 0.6197, 0.4486]}, {"w": "including", "b": [0.626, 0.4288, 0.7214, 0.4486]}, {"w": "the", "b": [0.7277, 0.4288, 0.7585, 0.4486]}, {"w": "Conference", "b": [0.1294, 0.4493, 0.2457, 0.4691]}, {"w": "on", "b": [0.252, 0.4493, 0.2772, 0.4691]}, {"w": "Computer", "b": [0.2835, 0.4493, 0.3844, 0.4691]}, {"w": "Vision", "b": [0.3907, 0.4493, 0.4565, 0.4691]}, {"w": "and", "b": [0.4628, 0.4493, 0.4992, 0.4691]}, {"w": "Pattern", "b": [0.5055, 0.4493, 0.577, 0.4691]}, {"w": "Recognition", "b": [0.5833, 0.4493, 0.7066, 0.4691]}, {"w": "(CVPR),", "b": [0.7129, 0.4493, 0.8019, 0.4691]}, {"w": "the", "b": [0.8082, 0.4493, 0.839, 0.4691]}, {"w": "Conference", "b": [0.1294, 0.4698, 0.2457, 0.4896]}, {"w": "and", "b": [0.252, 0.4698, 0.2884, 0.4896]}, {"w": "Workshop", "b": [0.2947, 0.4698, 0.3978, 0.4896]}, {"w": "on", "b": [0.4041, 0.4698, 0.4293, 0.4896]}, {"w": "Neural", "b": [0.4356, 0.4698, 0.5042, 0.4896]}, {"w": "Information", "b": [0.5105, 0.4698, 0.631, 0.4896]}, {"w": "Processing", "b": [0.6373, 0.4698, 0.7467, 0.4896]}, {"w": "Systems", "b": [0.753, 0.4698, 0.8371, 0.4896]}, {"w": "(NIPS),", "b": [0.1294, 0.4903, 0.2072, 0.5101]}, {"w": "the", "b": [0.2135, 0.4903, 0.2443, 0.5101]}, {"w": "International", "b": [0.2506, 0.4903, 0.3795, 0.5101]}, {"w": "Conference", "b": [0.3858, 0.4903, 0.5021, 0.5101]}, {"w": "on", "b": [0.5084, 0.4903, 0.5336, 0.5101]}, {"w": "Learning", "b": [0.5399, 0.4903, 0.631, 0.5101]}, {"w": "Representations", "b": [0.6373, 0.4903, 0.7984, 0.5101]}, {"w": "(ICLR),", "b": [0.1294, 0.5108, 0.21, 0.5306]}, {"w": "and", "b": [0.2163, 0.5108, 0.2527, 0.5306]}, {"w": "others.", "b": [0.259, 0.5108, 0.327, 0.5306]}]}]}, {"page": 27, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "About the Cover", "words": [{"w": "About", "b": [0.1294, 0.1076, 0.2247, 0.1355]}, {"w": "the", "b": [0.2337, 0.1076, 0.2813, 0.1355]}, {"w": "Cover", "b": [0.2902, 0.1076, 0.3835, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "The figure on the cover of Deep Learning with Python is captioned “Habit of a Persian Lady in 1568.” The illustration is taken from Thomas Jefferys’ A Collection of the Dresses of Different Nations, Ancient and Modern (four volumes), London, published between 1757 and 1772. The title page states that these are hand-colored copperplate engravings, heightened with gum arabic.", "words": [{"w": "The", "b": [0.1294, 0.1588, 0.1686, 0.1785]}, {"w": "figure", "b": [0.1749, 0.1588, 0.2352, 0.1785]}, {"w": "on", "b": [0.2415, 0.1588, 0.2667, 0.1785]}, {"w": "the", "b": [0.273, 0.1588, 0.3038, 0.1785]}, {"w": "cover", "b": [0.3102, 0.1588, 0.3662, 0.1785]}, {"w": "of", "b": [0.3725, 0.1588, 0.3935, 0.1785]}, {"w": "Deep", "b": [0.3998, 0.1588, 0.453, 0.1785]}, {"w": "Learning", "b": [0.4593, 0.1588, 0.5518, 0.1785]}, {"w": "with", "b": [0.5581, 0.1588, 0.6016, 0.1785]}, {"w": "Python", "b": [0.6079, 0.1588, 0.6793, 0.1785]}, {"w": "is", "b": [0.6856, 0.1588, 0.7024, 0.1785]}, {"w": "captioned", "b": [0.7088, 0.1588, 0.8068, 0.1785]}, {"w": "“Habit", "b": [0.1294, 0.1793, 0.1967, 0.199]}, {"w": "of", "b": [0.203, 0.1793, 0.224, 0.199]}, {"w": "a", "b": [0.2303, 0.1793, 0.2415, 0.199]}, {"w": "Persian", "b": [0.2478, 0.1793, 0.3221, 0.199]}, {"w": "Lady", "b": [0.3284, 0.1793, 0.3802, 0.199]}, {"w": "in", "b": [0.3865, 0.1793, 0.4061, 0.199]}, {"w": "1568.”", "b": [0.4124, 0.1793, 0.4804, 0.199]}, {"w": "The", "b": [0.4867, 0.1793, 0.5259, 0.199]}, {"w": "illustration", "b": [0.5322, 0.1793, 0.6416, 0.199]}, {"w": "is", "b": [0.6479, 0.1793, 0.6647, 0.199]}, {"w": "taken", "b": [0.671, 0.1793, 0.7256, 0.199]}, {"w": "from", "b": [0.732, 0.1793, 0.781, 0.199]}, {"w": "Thomas", "b": [0.7873, 0.1793, 0.8686, 0.199]}, {"w": "Jefferys’", "b": [0.1294, 0.1998, 0.2172, 0.2195]}, {"w": "A", "b": [0.2235, 0.1998, 0.2389, 0.2195]}, {"w": "Collection", "b": [0.2452, 0.1998, 0.3503, 0.2195]}, {"w": "of", "b": [0.3566, 0.1998, 0.3763, 0.2195]}, {"w": "the", "b": [0.3826, 0.1998, 0.4134, 0.2195]}, {"w": "Dresses", "b": [0.4197, 0.1998, 0.4986, 0.2195]}, {"w": "of", "b": [0.5049, 0.1998, 0.5245, 0.2195]}, {"w": "Different", "b": [0.5308, 0.1998, 0.621, 0.2195]}, {"w": "Nations,", "b": [0.6273, 0.1998, 0.7121, 0.2195]}, {"w": "Ancient", "b": [0.7184, 0.1998, 0.7955, 0.2195]}, {"w": "and", "b": [0.8018, 0.1998, 0.8396, 0.2195]}, {"w": "Modern", "b": [0.1294, 0.2203, 0.2093, 0.24]}, {"w": "(four", "b": [0.2156, 0.2203, 0.266, 0.24]}, {"w": "volumes),", "b": [0.2723, 0.2203, 0.3725, 0.24]}, {"w": "London,", "b": [0.3788, 0.2203, 0.4636, 0.24]}, {"w": "published", "b": [0.4699, 0.2203, 0.568, 0.24]}, {"w": "between", "b": [0.5743, 0.2203, 0.6584, 0.24]}, {"w": "1757", "b": [0.6647, 0.2203, 0.7151, 0.24]}, {"w": "and", "b": [0.7214, 0.2203, 0.7579, 0.24]}, {"w": "1772.", "b": [0.7642, 0.2203, 0.8209, 0.24]}, {"w": "The", "b": [0.8272, 0.2203, 0.8664, 0.24]}, {"w": "title", "b": [0.1294, 0.2408, 0.1687, 0.2605]}, {"w": "page", "b": [0.175, 0.2408, 0.2226, 0.2605]}, {"w": "states", "b": [0.2289, 0.2408, 0.285, 0.2605]}, {"w": "that", "b": [0.2913, 0.2408, 0.3291, 0.2605]}, {"w": "these", "b": [0.3354, 0.2408, 0.3872, 0.2605]}, {"w": "are", "b": [0.3936, 0.2408, 0.4244, 0.2605]}, {"w": "hand-colored", "b": [0.4307, 0.2408, 0.5637, 0.2605]}, {"w": "copperplate", "b": [0.5701, 0.2408, 0.6877, 0.2605]}, {"w": "engravings,", "b": [0.694, 0.2408, 0.811, 0.2605]}, {"w": "heightened", "b": [0.1294, 0.2613, 0.2401, 0.281]}, {"w": "with", "b": [0.2464, 0.2613, 0.2913, 0.281]}, {"w": "gum", "b": [0.2976, 0.2613, 0.3424, 0.281]}, {"w": "arabic.", "b": [0.3487, 0.2613, 0.4167, 0.281]}]}, {"id": "b_2", "type": "paragraph", "text": "Thomas Jefferys (1719–1771) was called “Geographer to King George III.” He was an English cartographer who was the leading map supplier of his day. He engraved and printed maps for government and other official bodies and produced a wide range of commercial maps and atlases, especially of North America. His work as a map maker sparked an interest in local dress customs of the lands he surveyed and mapped, which are brilliantly displayed in this collection. Fascination with faraway lands and travel for pleasure were relatively new phenomena in the late eighteenth century, and collections such as this one were popular, introducing both the tourist as well as the armchair traveler to the inhabitants of other countries.", "words": [{"w": "Thomas", "b": [0.1294, 0.304, 0.2107, 0.3238]}, {"w": "Jefferys", "b": [0.217, 0.304, 0.2964, 0.3238]}, {"w": "(1719–1771)", "b": [0.3027, 0.304, 0.433, 0.3238]}, {"w": "was", "b": [0.4393, 0.304, 0.4785, 0.3238]}, {"w": "called", "b": [0.4848, 0.304, 0.5451, 0.3238]}, {"w": "“Geographer", "b": [0.5514, 0.304, 0.6816, 0.3238]}, {"w": "to", "b": [0.688, 0.304, 0.7076, 0.3238]}, {"w": "King", "b": [0.7139, 0.304, 0.7643, 0.3238]}, {"w": "George", "b": [0.7706, 0.304, 0.8444, 0.3238]}, {"w": "III.”", "b": [0.1294, 0.3245, 0.1721, 0.3443]}, {"w": "He", "b": [0.1784, 0.3245, 0.2078, 0.3443]}, {"w": "was", "b": [0.2141, 0.3245, 0.2534, 0.3443]}, {"w": "an", "b": [0.2597, 0.3245, 0.2835, 0.3443]}, {"w": "English", "b": [0.2898, 0.3245, 0.3669, 0.3443]}, {"w": "cartographer", "b": [0.3732, 0.3245, 0.5007, 0.3443]}, {"w": "who", "b": [0.507, 0.3245, 0.5504, 0.3443]}, {"w": "was", "b": [0.5567, 0.3245, 0.5959, 0.3443]}, {"w": "the", "b": [0.6022, 0.3245, 0.6331, 0.3443]}, {"w": "leading", "b": [0.6394, 0.3245, 0.7136, 0.3443]}, {"w": "map", "b": [0.7199, 0.3245, 0.7633, 0.3443]}, {"w": "supplier", "b": [0.7696, 0.3245, 0.8509, 0.3443]}, {"w": "of", "b": [0.1294, 0.345, 0.1504, 0.3648]}, {"w": "his", "b": [0.1567, 0.345, 0.1862, 0.3648]}, {"w": "day.", "b": [0.1925, 0.345, 0.2336, 0.3648]}, {"w": "He", "b": [0.2399, 0.345, 0.2693, 0.3648]}, {"w": "engraved", "b": [0.2756, 0.345, 0.368, 0.3648]}, {"w": "and", "b": [0.3744, 0.345, 0.4108, 0.3648]}, {"w": "printed", "b": [0.4171, 0.345, 0.4885, 0.3648]}, {"w": "maps", "b": [0.4949, 0.345, 0.5481, 0.3648]}, {"w": "for", "b": [0.5544, 0.345, 0.5838, 0.3648]}, {"w": "government", "b": [0.5901, 0.345, 0.7106, 0.3648]}, {"w": "and", "b": [0.7169, 0.345, 0.7534, 0.3648]}, {"w": "other", "b": [0.7597, 0.345, 0.8115, 0.3648]}, {"w": "official", "b": [0.1294, 0.3656, 0.2018, 0.3853]}, {"w": "bodies", "b": [0.2081, 0.3656, 0.274, 0.3853]}, {"w": "and", "b": [0.2803, 0.3656, 0.3167, 0.3853]}, {"w": "produced", "b": [0.323, 0.3656, 0.4169, 0.3853]}, {"w": "a", "b": [0.4232, 0.3656, 0.4344, 0.3853]}, {"w": "wide", "b": [0.4407, 0.3656, 0.4897, 0.3853]}, {"w": "range", "b": [0.496, 0.3656, 0.5521, 0.3853]}, {"w": "of", "b": [0.5584, 0.3656, 0.5794, 0.3853]}, {"w": "commercial", "b": [0.5856, 0.3656, 0.7047, 0.3853]}, {"w": "maps", "b": [0.711, 0.3656, 0.7643, 0.3853]}, {"w": "and", "b": [0.7706, 0.3656, 0.807, 0.3853]}, {"w": "atlases,", "b": [0.1294, 0.3861, 0.203, 0.4058]}, {"w": "especially", "b": [0.2093, 0.3861, 0.3102, 0.4058]}, {"w": "of", "b": [0.3165, 0.3861, 0.3375, 0.4058]}, {"w": "North", "b": [0.3438, 0.3861, 0.4026, 0.4058]}, {"w": "America.", "b": [0.4089, 0.3861, 0.5021, 0.4058]}, {"w": "His", "b": [0.5084, 0.3861, 0.5434, 0.4058]}, {"w": "work", "b": [0.5497, 0.3861, 0.6016, 0.4058]}, {"w": "as", "b": [0.6079, 0.3861, 0.6289, 0.4058]}, {"w": "a", "b": [0.6352, 0.3861, 0.6464, 0.4058]}, {"w": "map", "b": [0.6527, 0.3861, 0.6962, 0.4058]}, {"w": "maker", "b": [0.7025, 0.3861, 0.7655, 0.4058]}, {"w": "sparked", "b": [0.7718, 0.3861, 0.8503, 0.4058]}, {"w": "an", "b": [0.1294, 0.4066, 0.1532, 0.4263]}, {"w": "interest", "b": [0.1595, 0.4066, 0.2338, 0.4263]}, {"w": "in", "b": [0.2401, 0.4066, 0.2597, 0.4263]}, {"w": "local", "b": [0.266, 0.4066, 0.3151, 0.4263]}, {"w": "dress", "b": [0.3214, 0.4066, 0.3732, 0.4263]}, {"w": "customs", "b": [0.3795, 0.4066, 0.4622, 0.4263]}, {"w": "of", "b": [0.4685, 0.4066, 0.4895, 0.4263]}, {"w": "the", "b": [0.4958, 0.4066, 0.5266, 0.4263]}, {"w": "lands", "b": [0.5329, 0.4066, 0.5862, 0.4263]}, {"w": "he", "b": [0.5925, 0.4066, 0.6163, 0.4263]}, {"w": "surveyed", "b": [0.6226, 0.4066, 0.7137, 0.4263]}, {"w": "and", "b": [0.72, 0.4066, 0.7564, 0.4263]}, {"w": "mapped,", "b": [0.7627, 0.4066, 0.8489, 0.4263]}, {"w": "which", "b": [0.1294, 0.4271, 0.1911, 0.4468]}, {"w": "are", "b": [0.1974, 0.4271, 0.2282, 0.4468]}, {"w": "brilliantly", "b": [0.2345, 0.4271, 0.334, 0.4468]}, {"w": "displayed", "b": [0.3403, 0.4271, 0.437, 0.4468]}, {"w": "in", "b": [0.4433, 0.4271, 0.4629, 0.4468]}, {"w": "this", "b": [0.4692, 0.4271, 0.5057, 0.4468]}, {"w": "collection.", "b": [0.512, 0.4271, 0.6178, 0.4468]}, {"w": "Fascination", "b": [0.6241, 0.4271, 0.7404, 0.4468]}, {"w": "with", "b": [0.7467, 0.4271, 0.7916, 0.4468]}, {"w": "faraway", "b": [0.1294, 0.4476, 0.2106, 0.4673]}, {"w": "lands", "b": [0.2169, 0.4476, 0.2702, 0.4673]}, {"w": "and", "b": [0.2765, 0.4476, 0.3129, 0.4673]}, {"w": "travel", "b": [0.3192, 0.4476, 0.3767, 0.4673]}, {"w": "for", "b": [0.383, 0.4476, 0.4124, 0.4673]}, {"w": "pleasure", "b": [0.4187, 0.4476, 0.5027, 0.4673]}, {"w": "were", "b": [0.509, 0.4476, 0.5581, 0.4673]}, {"w": "relatively", "b": [0.5644, 0.4476, 0.6596, 0.4673]}, {"w": "new", "b": [0.6659, 0.4476, 0.708, 0.4673]}, {"w": "phenomena", "b": [0.7143, 0.4476, 0.8306, 0.4673]}, {"w": "in", "b": [0.8369, 0.4476, 0.8565, 0.4673]}, {"w": "the", "b": [0.1294, 0.4681, 0.1602, 0.4878]}, {"w": "late", "b": [0.1665, 0.4681, 0.203, 0.4878]}, {"w": "eighteenth", "b": [0.2093, 0.4681, 0.3144, 0.4878]}, {"w": "century,", "b": [0.3207, 0.4681, 0.4009, 0.4878]}, {"w": "and", "b": [0.4072, 0.4681, 0.4437, 0.4878]}, {"w": "collections", "b": [0.45, 0.4681, 0.5593, 0.4878]}, {"w": "such", "b": [0.5656, 0.4681, 0.6118, 0.4878]}, {"w": "as", "b": [0.6181, 0.4681, 0.6391, 0.4878]}, {"w": "this", "b": [0.6454, 0.4681, 0.6819, 0.4878]}, {"w": "one", "b": [0.6882, 0.4681, 0.7246, 0.4878]}, {"w": "were", "b": [0.7309, 0.4681, 0.78, 0.4878]}, {"w": "popular,", "b": [0.7863, 0.4681, 0.8686, 0.4878]}, {"w": "introducing", "b": [0.1294, 0.4886, 0.2457, 0.5083]}, {"w": "both", "b": [0.252, 0.4886, 0.2969, 0.5083]}, {"w": "the", "b": [0.3032, 0.4886, 0.334, 0.5083]}, {"w": "tourist", "b": [0.3403, 0.4886, 0.4048, 0.5083]}, {"w": "as", "b": [0.4111, 0.4886, 0.4321, 0.5083]}, {"w": "well", "b": [0.4384, 0.4886, 0.4819, 0.5083]}, {"w": "as", "b": [0.4882, 0.4886, 0.5092, 0.5083]}, {"w": "the", "b": [0.5155, 0.4886, 0.5463, 0.5083]}, {"w": "armchair", "b": [0.5526, 0.4886, 0.6423, 0.5083]}, {"w": "traveler", "b": [0.6486, 0.4886, 0.7256, 0.5083]}, {"w": "to", "b": [0.7319, 0.4886, 0.7516, 0.5083]}, {"w": "the", "b": [0.7579, 0.4886, 0.7887, 0.5083]}, {"w": "inhabitants", "b": [0.1294, 0.5091, 0.2401, 0.5288]}, {"w": "of", "b": [0.2464, 0.5091, 0.2674, 0.5288]}, {"w": "other", "b": [0.2738, 0.5091, 0.3256, 0.5288]}, {"w": "countries.", "b": [0.3319, 0.5091, 0.4307, 0.5288]}]}, {"id": "b_3", "type": "paragraph", "text": "The diversity of the drawings in Jefferys’ volumes speaks vividly of the uniqueness and individuality of the world’s nations some 200 years ago. Dress codes have changed since then, and the diversity by region and country, so rich at the time, has faded away. It’s now often hard to tell the inhabitants of one continent from another. Perhaps, trying to view it optimistically, we’ve traded a cultural and visual diversity for a more varied personal life—or a more varied and interesting intellectual and technical life.", "words": [{"w": "The", "b": [0.1294, 0.5518, 0.1686, 0.5716]}, {"w": "diversity", "b": [0.1749, 0.5518, 0.2632, 0.5716]}, {"w": "of", "b": [0.2695, 0.5518, 0.2906, 0.5716]}, {"w": "the", "b": [0.2969, 0.5518, 0.3277, 0.5716]}, {"w": "drawings", "b": [0.334, 0.5518, 0.4265, 0.5716]}, {"w": "in", "b": [0.4328, 0.5518, 0.4524, 0.5716]}, {"w": "Jefferys’", "b": [0.4587, 0.5518, 0.5465, 0.5716]}, {"w": "volumes", "b": [0.5528, 0.5518, 0.6383, 0.5716]}, {"w": "speaks", "b": [0.6446, 0.5518, 0.7118, 0.5716]}, {"w": "vividly", "b": [0.7181, 0.5518, 0.7896, 0.5716]}, {"w": "of", "b": [0.7959, 0.5518, 0.8169, 0.5716]}, {"w": "the", "b": [0.8232, 0.5518, 0.8541, 0.5716]}, {"w": "uniqueness", "b": [0.1294, 0.5723, 0.2415, 0.5921]}, {"w": "and", "b": [0.2478, 0.5723, 0.2842, 0.5921]}, {"w": "individuality", "b": [0.2906, 0.5723, 0.4195, 0.5921]}, {"w": "of", "b": [0.4258, 0.5723, 0.4468, 0.5921]}, {"w": "the", "b": [0.4531, 0.5723, 0.484, 0.5921]}, {"w": "world’s", "b": [0.4903, 0.5723, 0.5659, 0.5921]}, {"w": "nations", "b": [0.5722, 0.5723, 0.6451, 0.5921]}, {"w": "some", "b": [0.6514, 0.5723, 0.7046, 0.5921]}, {"w": "200", "b": [0.7109, 0.5723, 0.7488, 0.5921]}, {"w": "years", "b": [0.7551, 0.5723, 0.8083, 0.5921]}, {"w": "ago.", "b": [0.8146, 0.5723, 0.8573, 0.5921]}, {"w": "Dress", "b": [0.1294, 0.5928, 0.1869, 0.6126]}, {"w": "codes", "b": [0.1932, 0.5928, 0.2506, 0.6126]}, {"w": "have", "b": [0.2569, 0.5928, 0.3045, 0.6126]}, {"w": "changed", "b": [0.3108, 0.5928, 0.3949, 0.6126]}, {"w": "since", "b": [0.4012, 0.5928, 0.453, 0.6126]}, {"w": "then,", "b": [0.4593, 0.5928, 0.5091, 0.6126]}, {"w": "and", "b": [0.5154, 0.5928, 0.5518, 0.6126]}, {"w": "the", "b": [0.5581, 0.5928, 0.5889, 0.6126]}, {"w": "diversity", "b": [0.5953, 0.5928, 0.6835, 0.6126]}, {"w": "by", "b": [0.6899, 0.5928, 0.7151, 0.6126]}, {"w": "region", "b": [0.7214, 0.5928, 0.7858, 0.6126]}, {"w": "and", "b": [0.7921, 0.5928, 0.8286, 0.6126]}, {"w": "country,", "b": [0.1294, 0.6133, 0.2111, 0.6331]}, {"w": "so", "b": [0.2174, 0.6133, 0.2399, 0.6331]}, {"w": "rich", "b": [0.2462, 0.6133, 0.2854, 0.6331]}, {"w": "at", "b": [0.2917, 0.6133, 0.3099, 0.6331]}, {"w": "the", "b": [0.3162, 0.6133, 0.3471, 0.6331]}, {"w": "time,", "b": [0.3534, 0.6133, 0.4045, 0.6331]}, {"w": "has", "b": [0.4108, 0.6133, 0.4445, 0.6331]}, {"w": "faded", "b": [0.4507, 0.6133, 0.5067, 0.6331]}, {"w": "away.", "b": [0.513, 0.6133, 0.5709, 0.6331]}, {"w": "It’s", "b": [0.5772, 0.6133, 0.6095, 0.6331]}, {"w": "now", "b": [0.6158, 0.6133, 0.6592, 0.6331]}, {"w": "often", "b": [0.6655, 0.6133, 0.7173, 0.6331]}, {"w": "hard", "b": [0.7237, 0.6133, 0.7685, 0.6331]}, {"w": "to", "b": [0.7748, 0.6133, 0.7944, 0.6331]}, {"w": "tell", "b": [0.8007, 0.6133, 0.833, 0.6331]}, {"w": "the", "b": [0.8393, 0.6133, 0.8701, 0.6331]}, {"w": "inhabitants", "b": [0.1294, 0.6338, 0.2401, 0.6536]}, {"w": "of", "b": [0.2464, 0.6338, 0.2674, 0.6536]}, {"w": "one", "b": [0.2738, 0.6338, 0.3102, 0.6536]}, {"w": "continent", "b": [0.3165, 0.6338, 0.4104, 0.6536]}, {"w": "from", "b": [0.4167, 0.6338, 0.4657, 0.6536]}, {"w": "another.", "b": [0.472, 0.6338, 0.5525, 0.6536]}, {"w": "Perhaps,", "b": [0.5588, 0.6338, 0.645, 0.6536]}, {"w": "trying", "b": [0.6513, 0.6338, 0.7116, 0.6536]}, {"w": "to", "b": [0.7179, 0.6338, 0.7375, 0.6536]}, {"w": "view", "b": [0.7438, 0.6338, 0.7929, 0.6536]}, {"w": "it", "b": [0.7992, 0.6338, 0.8132, 0.6536]}, {"w": "optimistically,", "b": [0.1294, 0.6543, 0.2728, 0.6741]}, {"w": "we’ve", "b": [0.2791, 0.6543, 0.3407, 0.6741]}, {"w": "traded", "b": [0.347, 0.6543, 0.4101, 0.6741]}, {"w": "a", "b": [0.4164, 0.6543, 0.4276, 0.6741]}, {"w": "cultural", "b": [0.4339, 0.6543, 0.511, 0.6741]}, {"w": "and", "b": [0.5173, 0.6543, 0.5537, 0.6741]}, {"w": "visual", "b": [0.56, 0.6543, 0.6203, 0.6741]}, {"w": "diversity", "b": [0.6266, 0.6543, 0.7149, 0.6741]}, {"w": "for", "b": [0.7212, 0.6543, 0.7506, 0.6741]}, {"w": "a", "b": [0.7569, 0.6543, 0.7681, 0.6741]}, {"w": "more", "b": [0.7744, 0.6543, 0.8262, 0.6741]}, {"w": "varied", "b": [0.1294, 0.6748, 0.1925, 0.6946]}, {"w": "personal", "b": [0.1988, 0.6748, 0.2842, 0.6946]}, {"w": "life—or", "b": [0.2905, 0.6748, 0.3704, 0.6946]}, {"w": "a", "b": [0.3767, 0.6748, 0.3879, 0.6946]}, {"w": "more", "b": [0.3942, 0.6748, 0.446, 0.6946]}, {"w": "varied", "b": [0.4524, 0.6748, 0.5154, 0.6946]}, {"w": "and", "b": [0.5217, 0.6748, 0.5581, 0.6946]}, {"w": "interesting", "b": [0.5644, 0.6748, 0.6709, 0.6946]}, {"w": "intellectual", "b": [0.6772, 0.6748, 0.7893, 0.6946]}, {"w": "and", "b": [0.7955, 0.6748, 0.832, 0.6946]}, {"w": "technical", "b": [0.1294, 0.6953, 0.2205, 0.7151]}, {"w": "life.", "b": [0.2268, 0.6953, 0.2667, 0.7151]}]}, {"id": "b_4", "type": "paragraph", "text": "At a time when it’s difficult to tell one computer book from another, Manning celebrates the inventiveness and initiative of the computer business with book covers based on the rich diversity of regional life of two centuries ago, brought back to life by Jefferys’ pictures.", "words": [{"w": "At", "b": [0.1294, 0.7381, 0.1546, 0.7579]}, {"w": "a", "b": [0.1609, 0.7381, 0.1721, 0.7579]}, {"w": "time", "b": [0.1785, 0.7381, 0.2233, 0.7579]}, {"w": "when", "b": [0.2296, 0.7381, 0.2842, 0.7579]}, {"w": "it’s", "b": [0.2906, 0.7381, 0.3214, 0.7579]}, {"w": "difficult", "b": [0.3277, 0.7381, 0.4085, 0.7579]}, {"w": "to", "b": [0.4148, 0.7381, 0.4344, 0.7579]}, {"w": "tell", "b": [0.4407, 0.7381, 0.473, 0.7579]}, {"w": "one", "b": [0.4793, 0.7381, 0.5157, 0.7579]}, {"w": "computer", "b": [0.522, 0.7381, 0.6173, 0.7579]}, {"w": "book", "b": [0.6236, 0.7381, 0.6741, 0.7579]}, {"w": "from", "b": [0.6804, 0.7381, 0.7294, 0.7579]}, {"w": "another,", "b": [0.7357, 0.7381, 0.8166, 0.7579]}, {"w": "Manning", "b": [0.1294, 0.7586, 0.2205, 0.7784]}, {"w": "celebrates", "b": [0.2268, 0.7586, 0.3277, 0.7784]}, {"w": "the", "b": [0.334, 0.7586, 0.3648, 0.7784]}, {"w": "inventiveness", "b": [0.3711, 0.7586, 0.5084, 0.7784]}, {"w": "and", "b": [0.5147, 0.7586, 0.5512, 0.7784]}, {"w": "initiative", "b": [0.5575, 0.7586, 0.6472, 0.7784]}, {"w": "of", "b": [0.6534, 0.7586, 0.6744, 0.7784]}, {"w": "the", "b": [0.6807, 0.7586, 0.7115, 0.7784]}, {"w": "computer", "b": [0.7178, 0.7586, 0.8131, 0.7784]}, {"w": "business", "b": [0.1294, 0.7791, 0.2149, 0.7989]}, {"w": "with", "b": [0.2212, 0.7791, 0.2661, 0.7989]}, {"w": "book", "b": [0.2724, 0.7791, 0.3228, 0.7989]}, {"w": "covers", "b": [0.3291, 0.7791, 0.395, 0.7989]}, {"w": "based", "b": [0.4013, 0.7791, 0.4587, 0.7989]}, {"w": "on", "b": [0.465, 0.7791, 0.4902, 0.7989]}, {"w": "the", "b": [0.4965, 0.7791, 0.5274, 0.7989]}, {"w": "rich", "b": [0.5337, 0.7791, 0.5729, 0.7989]}, {"w": "diversity", "b": [0.5792, 0.7791, 0.6675, 0.7989]}, {"w": "of", "b": [0.6738, 0.7791, 0.6948, 0.7989]}, {"w": "regional", "b": [0.7011, 0.7791, 0.7838, 0.7989]}, {"w": "life", "b": [0.7901, 0.7791, 0.8237, 0.7989]}, {"w": "of", "b": [0.83, 0.7791, 0.851, 0.7989]}, {"w": "two", "b": [0.1294, 0.7996, 0.1673, 0.8194]}, {"w": "centuries", "b": [0.1736, 0.7996, 0.2646, 0.8194]}, {"w": "ago,", "b": [0.2709, 0.7996, 0.3137, 0.8194]}, {"w": "brought", "b": [0.32, 0.7996, 0.3984, 0.8194]}, {"w": "back", "b": [0.4048, 0.7996, 0.4524, 0.8194]}, {"w": "to", "b": [0.4586, 0.7996, 0.4783, 0.8194]}, {"w": "life", "b": [0.4846, 0.7996, 0.5182, 0.8194]}, {"w": "by", "b": [0.5245, 0.7996, 0.5497, 0.8194]}, {"w": "Jefferys’", "b": [0.556, 0.7996, 0.6438, 0.8194]}, {"w": "pictures.", "b": [0.6501, 0.7996, 0.7363, 0.8194]}]}]}, {"page": 28, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Part 1. Fundamentals of deep learning", "words": [{"w": "Part", "b": [0.1294, 0.1076, 0.1969, 0.1355]}, {"w": "1.", "b": [0.2058, 0.1076, 0.2326, 0.1355]}, {"w": "Fundamentals", "b": [0.2415, 0.1076, 0.4599, 0.1355]}, {"w": "of", "b": [0.4688, 0.1076, 0.4986, 0.1355]}, {"w": "deep", "b": [0.5075, 0.1076, 0.579, 0.1355]}, {"w": "learning", "b": [0.5879, 0.1076, 0.715, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapters 1–4 of this book will give you a foundational understanding of what deep learning is, what it can achieve, and how it works. It will also make you familiar with the canonical workflow for solving data problems using deep learning. If you aren’t already highly knowledgeable about deep learning, you should definitely begin by reading part 1 in full before moving on to the practical applications in part 2.", "words": [{"w": "Chapters", "b": [0.1294, 0.1588, 0.2191, 0.1785]}, {"w": "1–4", "b": [0.2254, 0.1588, 0.2632, 0.1785]}, {"w": "of", "b": [0.2695, 0.1588, 0.2905, 0.1785]}, {"w": "this", "b": [0.2969, 0.1588, 0.3333, 0.1785]}, {"w": "book", "b": [0.3396, 0.1588, 0.3901, 0.1785]}, {"w": "will", "b": [0.3964, 0.1588, 0.4356, 0.1785]}, {"w": "give", "b": [0.4419, 0.1588, 0.4854, 0.1785]}, {"w": "you", "b": [0.4917, 0.1588, 0.5295, 0.1785]}, {"w": "a", "b": [0.5358, 0.1588, 0.547, 0.1785]}, {"w": "foundational", "b": [0.5533, 0.1588, 0.6808, 0.1785]}, {"w": "understanding", "b": [0.6871, 0.1588, 0.8301, 0.1785]}, {"w": "of", "b": [0.8364, 0.1588, 0.8574, 0.1785]}, {"w": "what", "b": [0.1294, 0.1793, 0.1785, 0.199]}, {"w": "deep", "b": [0.1848, 0.1793, 0.2324, 0.199]}, {"w": "learning", "b": [0.2387, 0.1793, 0.3214, 0.199]}, {"w": "is,", "b": [0.3277, 0.1793, 0.3508, 0.199]}, {"w": "what", "b": [0.3571, 0.1793, 0.4061, 0.199]}, {"w": "it", "b": [0.4124, 0.1793, 0.4265, 0.199]}, {"w": "can", "b": [0.4328, 0.1793, 0.4678, 0.199]}, {"w": "achieve,", "b": [0.4741, 0.1793, 0.5574, 0.199]}, {"w": "and", "b": [0.5637, 0.1793, 0.6002, 0.199]}, {"w": "how", "b": [0.6065, 0.1793, 0.6499, 0.199]}, {"w": "it", "b": [0.6562, 0.1793, 0.6703, 0.199]}, {"w": "works.", "b": [0.6766, 0.1793, 0.7445, 0.199]}, {"w": "It", "b": [0.7508, 0.1793, 0.7662, 0.199]}, {"w": "will", "b": [0.7725, 0.1793, 0.8117, 0.199]}, {"w": "also", "b": [0.818, 0.1793, 0.8587, 0.199]}, {"w": "make", "b": [0.1294, 0.1998, 0.1841, 0.2195]}, {"w": "you", "b": [0.1904, 0.1998, 0.2282, 0.2195]}, {"w": "familiar", "b": [0.2345, 0.1998, 0.3144, 0.2195]}, {"w": "with", "b": [0.3207, 0.1998, 0.3655, 0.2195]}, {"w": "the", "b": [0.3718, 0.1998, 0.4027, 0.2195]}, {"w": "canonical", "b": [0.409, 0.1998, 0.5056, 0.2195]}, {"w": "workflow", "b": [0.5119, 0.1998, 0.61, 0.2195]}, {"w": "for", "b": [0.6163, 0.1998, 0.6457, 0.2195]}, {"w": "solving", "b": [0.652, 0.1998, 0.7263, 0.2195]}, {"w": "data", "b": [0.7326, 0.1998, 0.7747, 0.2195]}, {"w": "problems", "b": [0.1294, 0.2203, 0.2233, 0.24]}, {"w": "using", "b": [0.2296, 0.2203, 0.2843, 0.24]}, {"w": "deep", "b": [0.2906, 0.2203, 0.3382, 0.24]}, {"w": "learning.", "b": [0.3445, 0.2203, 0.4335, 0.24]}, {"w": "If", "b": [0.4398, 0.2203, 0.4566, 0.24]}, {"w": "you", "b": [0.4629, 0.2203, 0.5007, 0.24]}, {"w": "aren’t", "b": [0.507, 0.2203, 0.5654, 0.24]}, {"w": "already", "b": [0.5717, 0.2203, 0.6459, 0.24]}, {"w": "highly", "b": [0.6522, 0.2203, 0.7167, 0.24]}, {"w": "knowledgeable", "b": [0.1294, 0.2408, 0.2821, 0.2605]}, {"w": "about", "b": [0.2884, 0.2408, 0.3445, 0.2605]}, {"w": "deep", "b": [0.3508, 0.2408, 0.3984, 0.2605]}, {"w": "learning,", "b": [0.4047, 0.2408, 0.4937, 0.2605]}, {"w": "you", "b": [0.5, 0.2408, 0.5378, 0.2605]}, {"w": "should", "b": [0.5441, 0.2408, 0.6114, 0.2605]}, {"w": "definitely", "b": [0.6177, 0.2408, 0.7144, 0.2605]}, {"w": "begin", "b": [0.7207, 0.2408, 0.7768, 0.2605]}, {"w": "by", "b": [0.7831, 0.2408, 0.8083, 0.2605]}, {"w": "reading", "b": [0.1294, 0.2613, 0.2051, 0.281]}, {"w": "part", "b": [0.2114, 0.2613, 0.2506, 0.281]}, {"w": "1", "b": [0.2569, 0.2613, 0.2695, 0.281]}, {"w": "in", "b": [0.2758, 0.2613, 0.2954, 0.281]}, {"w": "full", "b": [0.3017, 0.2613, 0.3368, 0.281]}, {"w": "before", "b": [0.3431, 0.2613, 0.4075, 0.281]}, {"w": "moving", "b": [0.4138, 0.2613, 0.4909, 0.281]}, {"w": "on", "b": [0.4972, 0.2613, 0.5224, 0.281]}, {"w": "to", "b": [0.5287, 0.2613, 0.5484, 0.281]}, {"w": "the", "b": [0.5547, 0.2613, 0.5855, 0.281]}, {"w": "practical", "b": [0.5918, 0.2613, 0.6787, 0.281]}, {"w": "applications", "b": [0.685, 0.2613, 0.8069, 0.281]}, {"w": "in", "b": [0.8132, 0.2613, 0.8328, 0.281]}, {"w": "part", "b": [0.1294, 0.2818, 0.1686, 0.3015]}, {"w": "2.", "b": [0.1749, 0.2818, 0.1939, 0.3015]}]}]}, {"page": 29, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 1. What is deep learning?", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "1.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "What", "b": [0.3011, 0.1076, 0.3865, 0.1355]}, {"w": "is", "b": [0.3954, 0.1076, 0.4192, 0.1355]}, {"w": "deep", "b": [0.4281, 0.1076, 0.4996, 0.1355]}, {"w": "learning?", "b": [0.5085, 0.1076, 0.6534, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1729, 0.1785]}, {"w": "chapter", "b": [0.1792, 0.1588, 0.2562, 0.1785]}, {"w": "covers", "b": [0.2626, 0.1588, 0.3284, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "High-level definitions of fundamental concepts Timeline of the development of machine learning Key factors behind deep learning’s rising popularity and future potential", "words": [{"w": "High-level", "b": [0.1799, 0.1971, 0.2878, 0.2168]}, {"w": "definitions", "b": [0.2941, 0.1971, 0.402, 0.2168]}, {"w": "of", "b": [0.4083, 0.1971, 0.4293, 0.2168]}, {"w": "fundamental", "b": [0.4356, 0.1971, 0.5617, 0.2168]}, {"w": "concepts", "b": [0.568, 0.1971, 0.6563, 0.2168]}, {"w": "Timeline", "b": [0.1799, 0.2176, 0.2701, 0.2373]}, {"w": "of", "b": [0.2764, 0.2176, 0.2974, 0.2373]}, {"w": "the", "b": [0.3037, 0.2176, 0.3345, 0.2373]}, {"w": "development", "b": [0.3408, 0.2176, 0.4711, 0.2373]}, {"w": "of", "b": [0.4774, 0.2176, 0.4985, 0.2373]}, {"w": "machine", "b": [0.5048, 0.2176, 0.5902, 0.2373]}, {"w": "learning", "b": [0.5965, 0.2176, 0.6792, 0.2373]}, {"w": "Key", "b": [0.1799, 0.2381, 0.2219, 0.2578]}, {"w": "factors", "b": [0.2282, 0.2381, 0.2968, 0.2578]}, {"w": "behind", "b": [0.3031, 0.2381, 0.3718, 0.2578]}, {"w": "deep", "b": [0.3781, 0.2381, 0.4257, 0.2578]}, {"w": "learning’s", "b": [0.432, 0.2381, 0.5315, 0.2578]}, {"w": "rising", "b": [0.5378, 0.2381, 0.5953, 0.2578]}, {"w": "popularity", "b": [0.6016, 0.2381, 0.7053, 0.2578]}, {"w": "and", "b": [0.7116, 0.2381, 0.748, 0.2578]}, {"w": "future", "b": [0.7543, 0.2381, 0.8146, 0.2578]}, {"w": "potential", "b": [0.1799, 0.2586, 0.2682, 0.2783]}]}, {"id": "b_3", "type": "paragraph", "text": "In the past few years, artificial intelligence (AI) has been a subject of intense media hype. Machine learning, deep learning, and AI come up in countless articles, often outside of technology-minded publications. We’re promised a future of intelligent chatbots, self-driving cars, and virtual assistants—a future sometimes painted in a grim light and other times as utopian, where human jobs will be scarce and most economic activity will be handled by robots or AI agents. For a future or current practitioner of machine learning, it’s important to be able to recognize the signal in the noise so that you can tell world-changing developments from overhyped press releases. Our future is at stake, and it’s a future in which you have an active role to play: after reading this book, you’ll be one of those who develop the AI agents. So let’s tackle these questions: What has deep learning achieved so far? How significant is it? Where are we headed next? Should you believe the hype?", "words": [{"w": "In", "b": [0.1294, 0.3014, 0.1504, 0.3211]}, {"w": "the", "b": [0.1567, 0.3014, 0.1876, 0.3211]}, {"w": "past", "b": [0.1939, 0.3014, 0.2345, 0.3211]}, {"w": "few", "b": [0.2408, 0.3014, 0.2786, 0.3211]}, {"w": "years,", "b": [0.2849, 0.3014, 0.3445, 0.3211]}, {"w": "artificial", "b": [0.3508, 0.3014, 0.4362, 0.3211]}, {"w": "intelligence", "b": [0.4425, 0.3014, 0.5602, 0.3211]}, {"w": "(AI)", "b": [0.5665, 0.3014, 0.61, 0.3211]}, {"w": "has", "b": [0.6163, 0.3014, 0.6499, 0.3211]}, {"w": "been", "b": [0.6562, 0.3014, 0.7038, 0.3211]}, {"w": "a", "b": [0.7101, 0.3014, 0.7213, 0.3211]}, {"w": "subject", "b": [0.7276, 0.3014, 0.7991, 0.3211]}, {"w": "of", "b": [0.8054, 0.3014, 0.8264, 0.3211]}, {"w": "intense", "b": [0.1294, 0.3219, 0.2009, 0.3416]}, {"w": "media", "b": [0.2072, 0.3219, 0.2688, 0.3416]}, {"w": "hype.", "b": [0.2751, 0.3219, 0.3305, 0.3416]}, {"w": "Machine", "b": [0.3368, 0.3219, 0.4251, 0.3416]}, {"w": "learning,", "b": [0.4314, 0.3219, 0.5203, 0.3416]}, {"w": "deep", "b": [0.5266, 0.3219, 0.5743, 0.3416]}, {"w": "learning,", "b": [0.5806, 0.3219, 0.6695, 0.3416]}, {"w": "and", "b": [0.6758, 0.3219, 0.7122, 0.3416]}, {"w": "AI", "b": [0.7185, 0.3219, 0.7451, 0.3416]}, {"w": "come", "b": [0.7514, 0.3219, 0.8061, 0.3416]}, {"w": "up", "b": [0.8124, 0.3219, 0.8376, 0.3416]}, {"w": "in", "b": [0.8439, 0.3219, 0.8635, 0.3416]}, {"w": "countless", "b": [0.1294, 0.3424, 0.2233, 0.3621]}, {"w": "articles,", "b": [0.2296, 0.3424, 0.3088, 0.3621]}, {"w": "often", "b": [0.3151, 0.3424, 0.3669, 0.3621]}, {"w": "outside", "b": [0.3732, 0.3424, 0.4461, 0.3621]}, {"w": "of", "b": [0.4524, 0.3424, 0.4734, 0.3621]}, {"w": "technology-minded", "b": [0.4797, 0.3424, 0.6759, 0.3621]}, {"w": "publications.", "b": [0.6822, 0.3424, 0.8118, 0.3621]}, {"w": "We’re", "b": [0.1294, 0.3629, 0.1904, 0.3826]}, {"w": "promised", "b": [0.1967, 0.3629, 0.2906, 0.3826]}, {"w": "a", "b": [0.2969, 0.3629, 0.3081, 0.3826]}, {"w": "future", "b": [0.3144, 0.3629, 0.3747, 0.3826]}, {"w": "of", "b": [0.381, 0.3629, 0.402, 0.3826]}, {"w": "intelligent", "b": [0.4083, 0.3629, 0.5106, 0.3826]}, {"w": "chatbots,", "b": [0.5168, 0.3629, 0.6072, 0.3826]}, {"w": "self-driving", "b": [0.6135, 0.3629, 0.7312, 0.3826]}, {"w": "cars,", "b": [0.7375, 0.3629, 0.7844, 0.3826]}, {"w": "and", "b": [0.7908, 0.3629, 0.8272, 0.3826]}, {"w": "virtual", "b": [0.1294, 0.3834, 0.1953, 0.4031]}, {"w": "assistants—a", "b": [0.2016, 0.3834, 0.3333, 0.4031]}, {"w": "future", "b": [0.3396, 0.3834, 0.3999, 0.4031]}, {"w": "sometimes", "b": [0.4062, 0.3834, 0.5141, 0.4031]}, {"w": "painted", "b": [0.5204, 0.3834, 0.5947, 0.4031]}, {"w": "in", "b": [0.601, 0.3834, 0.6206, 0.4031]}, {"w": "a", "b": [0.6269, 0.3834, 0.6381, 0.4031]}, {"w": "grim", "b": [0.6444, 0.3834, 0.692, 0.4031]}, {"w": "light", "b": [0.6984, 0.3834, 0.7446, 0.4031]}, {"w": "and", "b": [0.7509, 0.3834, 0.7874, 0.4031]}, {"w": "other", "b": [0.7937, 0.3834, 0.8455, 0.4031]}, {"w": "times", "b": [0.1294, 0.4039, 0.1841, 0.4236]}, {"w": "as", "b": [0.1904, 0.4039, 0.2114, 0.4236]}, {"w": "utopian,", "b": [0.2177, 0.4039, 0.2997, 0.4236]}, {"w": "where", "b": [0.306, 0.4039, 0.3676, 0.4236]}, {"w": "human", "b": [0.3739, 0.4039, 0.4426, 0.4236]}, {"w": "jobs", "b": [0.4489, 0.4039, 0.4909, 0.4236]}, {"w": "will", "b": [0.4972, 0.4039, 0.5365, 0.4236]}, {"w": "be", "b": [0.5428, 0.4039, 0.5666, 0.4236]}, {"w": "scarce", "b": [0.5729, 0.4039, 0.6359, 0.4236]}, {"w": "and", "b": [0.6422, 0.4039, 0.6786, 0.4236]}, {"w": "most", "b": [0.6849, 0.4039, 0.734, 0.4236]}, {"w": "economic", "b": [0.7403, 0.4039, 0.8384, 0.4236]}, {"w": "activity", "b": [0.1294, 0.4244, 0.2051, 0.4441]}, {"w": "will", "b": [0.2114, 0.4244, 0.2506, 0.4441]}, {"w": "be", "b": [0.257, 0.4244, 0.2808, 0.4441]}, {"w": "handled", "b": [0.2871, 0.4244, 0.3669, 0.4441]}, {"w": "by", "b": [0.3732, 0.4244, 0.3985, 0.4441]}, {"w": "robots", "b": [0.4048, 0.4244, 0.4678, 0.4441]}, {"w": "or", "b": [0.4741, 0.4244, 0.4952, 0.4441]}, {"w": "AI", "b": [0.5015, 0.4244, 0.5281, 0.4441]}, {"w": "agents.", "b": [0.5344, 0.4244, 0.6051, 0.4441]}, {"w": "For", "b": [0.6115, 0.4244, 0.6465, 0.4441]}, {"w": "a", "b": [0.6528, 0.4244, 0.664, 0.4441]}, {"w": "future", "b": [0.6703, 0.4244, 0.7305, 0.4441]}, {"w": "or", "b": [0.7368, 0.4244, 0.7579, 0.4441]}, {"w": "current", "b": [0.7642, 0.4244, 0.8356, 0.4441]}, {"w": "practitioner", "b": [0.1294, 0.4449, 0.2457, 0.4646]}, {"w": "of", "b": [0.252, 0.4449, 0.273, 0.4646]}, {"w": "machine", "b": [0.2793, 0.4449, 0.3648, 0.4646]}, {"w": "learning,", "b": [0.3711, 0.4449, 0.4601, 0.4646]}, {"w": "it’s", "b": [0.4664, 0.4449, 0.4972, 0.4646]}, {"w": "important", "b": [0.5035, 0.4449, 0.6016, 0.4646]}, {"w": "to", "b": [0.6079, 0.4449, 0.6275, 0.4646]}, {"w": "be", "b": [0.6338, 0.4449, 0.6576, 0.4646]}, {"w": "able", "b": [0.6639, 0.4449, 0.7059, 0.4646]}, {"w": "to", "b": [0.7123, 0.4449, 0.7319, 0.4646]}, {"w": "recognize", "b": [0.7382, 0.4449, 0.8362, 0.4646]}, {"w": "the", "b": [0.1294, 0.4654, 0.1602, 0.4851]}, {"w": "signal", "b": [0.1665, 0.4654, 0.2268, 0.4851]}, {"w": "in", "b": [0.2331, 0.4654, 0.2527, 0.4851]}, {"w": "the", "b": [0.259, 0.4654, 0.2899, 0.4851]}, {"w": "noise", "b": [0.2962, 0.4654, 0.3494, 0.4851]}, {"w": "so", "b": [0.3557, 0.4654, 0.3782, 0.4851]}, {"w": "that", "b": [0.3845, 0.4654, 0.4223, 0.4851]}, {"w": "you", "b": [0.4286, 0.4654, 0.4665, 0.4851]}, {"w": "can", "b": [0.4728, 0.4654, 0.5078, 0.4851]}, {"w": "tell", "b": [0.5141, 0.4654, 0.5463, 0.4851]}, {"w": "world-changing", "b": [0.5526, 0.4654, 0.7124, 0.4851]}, {"w": "developments", "b": [0.7186, 0.4654, 0.8587, 0.4851]}, {"w": "from", "b": [0.1294, 0.4859, 0.1785, 0.5056]}, {"w": "overhyped", "b": [0.1848, 0.4859, 0.2912, 0.5056]}, {"w": "press", "b": [0.2975, 0.4859, 0.3494, 0.5056]}, {"w": "releases.", "b": [0.3557, 0.4859, 0.4418, 0.5056]}, {"w": "Our", "b": [0.4481, 0.4859, 0.4874, 0.5056]}, {"w": "future", "b": [0.4937, 0.4859, 0.5539, 0.5056]}, {"w": "is", "b": [0.5602, 0.4859, 0.577, 0.5056]}, {"w": "at", "b": [0.5833, 0.4859, 0.6016, 0.5056]}, {"w": "stake,", "b": [0.6079, 0.4859, 0.666, 0.5056]}, {"w": "and", "b": [0.6723, 0.4859, 0.7087, 0.5056]}, {"w": "it’s", "b": [0.7151, 0.4859, 0.7459, 0.5056]}, {"w": "a", "b": [0.7522, 0.4859, 0.7634, 0.5056]}, {"w": "future", "b": [0.7697, 0.4859, 0.8299, 0.5056]}, {"w": "in", "b": [0.8362, 0.4859, 0.8558, 0.5056]}, {"w": "which", "b": [0.1294, 0.5064, 0.1911, 0.5261]}, {"w": "you", "b": [0.1974, 0.5064, 0.2352, 0.5261]}, {"w": "have", "b": [0.2415, 0.5064, 0.2891, 0.5261]}, {"w": "an", "b": [0.2954, 0.5064, 0.3193, 0.5261]}, {"w": "active", "b": [0.3256, 0.5064, 0.3858, 0.5261]}, {"w": "role", "b": [0.3921, 0.5064, 0.4313, 0.5261]}, {"w": "to", "b": [0.4376, 0.5064, 0.4573, 0.5261]}, {"w": "play:", "b": [0.4635, 0.5064, 0.514, 0.5261]}, {"w": "after", "b": [0.5203, 0.5064, 0.5665, 0.5261]}, {"w": "reading", "b": [0.5728, 0.5064, 0.6484, 0.5261]}, {"w": "this", "b": [0.6548, 0.5064, 0.6912, 0.5261]}, {"w": "book,", "b": [0.6975, 0.5064, 0.7543, 0.5261]}, {"w": "you’ll", "b": [0.7606, 0.5064, 0.8208, 0.5261]}, {"w": "be", "b": [0.8271, 0.5064, 0.851, 0.5261]}, {"w": "one", "b": [0.1294, 0.5269, 0.1658, 0.5466]}, {"w": "of", "b": [0.1721, 0.5269, 0.1932, 0.5466]}, {"w": "those", "b": [0.1995, 0.5269, 0.2527, 0.5466]}, {"w": "who", "b": [0.259, 0.5269, 0.3025, 0.5466]}, {"w": "develop", "b": [0.3088, 0.5269, 0.3886, 0.5466]}, {"w": "the", "b": [0.3949, 0.5269, 0.4258, 0.5466]}, {"w": "AI", "b": [0.4321, 0.5269, 0.4587, 0.5466]}, {"w": "agents.", "b": [0.465, 0.5269, 0.5357, 0.5466]}, {"w": "So", "b": [0.5421, 0.5269, 0.5687, 0.5466]}, {"w": "let’s", "b": [0.575, 0.5269, 0.617, 0.5466]}, {"w": "tackle", "b": [0.6233, 0.5269, 0.6836, 0.5466]}, {"w": "these", "b": [0.6899, 0.5269, 0.7417, 0.5466]}, {"w": "questions:", "b": [0.748, 0.5269, 0.8503, 0.5466]}, {"w": "What", "b": [0.1294, 0.5474, 0.1841, 0.5671]}, {"w": "has", "b": [0.1904, 0.5474, 0.224, 0.5671]}, {"w": "deep", "b": [0.2303, 0.5474, 0.2779, 0.5671]}, {"w": "learning", "b": [0.2842, 0.5474, 0.3669, 0.5671]}, {"w": "achieved", "b": [0.3732, 0.5474, 0.4628, 0.5671]}, {"w": "so", "b": [0.4691, 0.5474, 0.4916, 0.5671]}, {"w": "far?", "b": [0.4979, 0.5474, 0.5371, 0.5671]}, {"w": "How", "b": [0.5434, 0.5474, 0.5924, 0.5671]}, {"w": "significant", "b": [0.5987, 0.5474, 0.7052, 0.5671]}, {"w": "is", "b": [0.7115, 0.5474, 0.7284, 0.5671]}, {"w": "it?", "b": [0.7347, 0.5474, 0.7599, 0.5671]}, {"w": "Where", "b": [0.7662, 0.5474, 0.8334, 0.5671]}, {"w": "are", "b": [0.8397, 0.5474, 0.8705, 0.5671]}, {"w": "we", "b": [0.1294, 0.5679, 0.1588, 0.5876]}, {"w": "headed", "b": [0.1651, 0.5679, 0.2366, 0.5876]}, {"w": "next?", "b": [0.2429, 0.5679, 0.2975, 0.5876]}, {"w": "Should", "b": [0.3038, 0.5679, 0.3753, 0.5876]}, {"w": "you", "b": [0.3816, 0.5679, 0.4195, 0.5876]}, {"w": "believe", "b": [0.4258, 0.5679, 0.4986, 0.5876]}, {"w": "the", "b": [0.5049, 0.5679, 0.5357, 0.5876]}, {"w": "hype?", "b": [0.5421, 0.5679, 0.6023, 0.5876]}]}, {"id": "b_4", "type": "paragraph", "text": "This chapter provides essential context around artificial intelligence, machine learning, and deep learning.", "words": [{"w": "This", "b": [0.1294, 0.6107, 0.1743, 0.6304]}, {"w": "chapter", "b": [0.1806, 0.6107, 0.2548, 0.6304]}, {"w": "provides", "b": [0.2611, 0.6107, 0.348, 0.6304]}, {"w": "essential", "b": [0.3543, 0.6107, 0.4412, 0.6304]}, {"w": "context", "b": [0.4475, 0.6107, 0.5217, 0.6304]}, {"w": "around", "b": [0.5281, 0.6107, 0.5981, 0.6304]}, {"w": "artificial", "b": [0.6044, 0.6107, 0.6899, 0.6304]}, {"w": "intelligence,", "b": [0.6962, 0.6107, 0.8202, 0.6304]}, {"w": "machine", "b": [0.1294, 0.6312, 0.2149, 0.6509]}, {"w": "learning,", "b": [0.2212, 0.6312, 0.3102, 0.6509]}, {"w": "and", "b": [0.3165, 0.6312, 0.3529, 0.6509]}, {"w": "deep", "b": [0.3592, 0.6312, 0.4068, 0.6509]}, {"w": "learning.", "b": [0.4131, 0.6312, 0.5021, 0.6509]}]}, {"id": "b_5", "type": "paragraph", "text": "1.1. Artificial intelligence, machine learning, and deep learning", "words": [{"w": "1.1.", "b": [0.1294, 0.688, 0.172, 0.7102]}, {"w": "Artificial", "b": [0.1791, 0.688, 0.2894, 0.7102]}, {"w": "intelligence,", "b": [0.2965, 0.688, 0.4408, 0.7102]}, {"w": "machine", "b": [0.4479, 0.688, 0.5503, 0.7102]}, {"w": "learning,", "b": [0.5574, 0.688, 0.6654, 0.7102]}, {"w": "and", "b": [0.6725, 0.688, 0.7183, 0.7102]}, {"w": "deep", "b": [0.7254, 0.688, 0.7821, 0.7102]}, {"w": "learning", "b": [0.1294, 0.7121, 0.2303, 0.7343]}]}, {"id": "b_6", "type": "paragraph", "text": "First, we need to define clearly what we’re talking about when we mention AI. What are artificial intelligence, machine learning, and deep learning (see figure 1.1)? How do they relate to each other?", "words": [{"w": "First,", "b": [0.1294, 0.7577, 0.182, 0.7775]}, {"w": "we", "b": [0.1883, 0.7577, 0.2177, 0.7775]}, {"w": "need", "b": [0.224, 0.7577, 0.2716, 0.7775]}, {"w": "to", "b": [0.2779, 0.7577, 0.2976, 0.7775]}, {"w": "define", "b": [0.3039, 0.7577, 0.3669, 0.7775]}, {"w": "clearly", "b": [0.3732, 0.7577, 0.4419, 0.7775]}, {"w": "what", "b": [0.4482, 0.7577, 0.4972, 0.7775]}, {"w": "we’re", "b": [0.5035, 0.7577, 0.5609, 0.7775]}, {"w": "talking", "b": [0.5672, 0.7577, 0.6373, 0.7775]}, {"w": "about", "b": [0.6436, 0.7577, 0.6997, 0.7775]}, {"w": "when", "b": [0.706, 0.7577, 0.7606, 0.7775]}, {"w": "we", "b": [0.7669, 0.7577, 0.7963, 0.7775]}, {"w": "mention", "b": [0.1294, 0.7782, 0.2121, 0.798]}, {"w": "AI.", "b": [0.2184, 0.7782, 0.2513, 0.798]}, {"w": "What", "b": [0.2576, 0.7782, 0.3123, 0.798]}, {"w": "are", "b": [0.3186, 0.7782, 0.3494, 0.798]}, {"w": "artificial", "b": [0.3557, 0.7782, 0.4412, 0.798]}, {"w": "intelligence,", "b": [0.4475, 0.7782, 0.5715, 0.798]}, {"w": "machine", "b": [0.5778, 0.7782, 0.6632, 0.798]}, {"w": "learning,", "b": [0.6695, 0.7782, 0.7585, 0.798]}, {"w": "and", "b": [0.7647, 0.7782, 0.8011, 0.798]}, {"w": "deep", "b": [0.8074, 0.7782, 0.855, 0.798]}, {"w": "learning", "b": [0.1294, 0.7987, 0.2121, 0.8185]}, {"w": "(see", "b": [0.2184, 0.7987, 0.259, 0.8185]}, {"w": "figure", "b": [0.2653, 0.7987, 0.3255, 0.8185]}, {"w": "1.1)?", "b": [0.3318, 0.7987, 0.3829, 0.8185]}, {"w": "How", "b": [0.3892, 0.7987, 0.4383, 0.8185]}, {"w": "do", "b": [0.4446, 0.7987, 0.4698, 0.8185]}, {"w": "they", "b": [0.4761, 0.7987, 0.5196, 0.8185]}, {"w": "relate", "b": [0.5259, 0.7987, 0.5819, 0.8185]}, {"w": "to", "b": [0.5882, 0.7987, 0.6078, 0.8185]}, {"w": "each", "b": [0.6141, 0.7987, 0.6603, 0.8185]}, {"w": "other?", "b": [0.6667, 0.7987, 0.7297, 0.8185]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 1.1. Artificial intelligence, machine learning, and deep learning", "words": [{"w": "Figure", "b": [0.1294, 0.8366, 0.1827, 0.8514]}, {"w": "1.1.", "b": [0.1874, 0.8366, 0.2158, 0.8514]}, {"w": "Artificial", "b": [0.2205, 0.8366, 0.294, 0.8514]}, {"w": "intelligence,", "b": [0.2988, 0.8366, 0.3949, 0.8514]}, {"w": "machine", "b": [0.3997, 0.8366, 0.468, 0.8514]}, {"w": "learning,", "b": [0.4727, 0.8366, 0.5447, 0.8514]}, {"w": "and", "b": [0.5495, 0.8366, 0.5799, 0.8514]}, {"w": "deep", "b": [0.5847, 0.8366, 0.6225, 0.8514]}, {"w": "learning", "b": [0.6272, 0.8366, 0.6945, 0.8514]}]}]}, {"page": 30, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1.1.1. Artificial intelligence", "words": [{"w": "1.1.1.", "b": [0.1294, 0.3121, 0.1862, 0.3318]}, {"w": "Artificial", "b": [0.1925, 0.3121, 0.2906, 0.3318]}, {"w": "intelligence", "b": [0.2969, 0.3121, 0.4188, 0.3318]}]}, {"id": "b_1", "type": "paragraph", "text": "Artificial intelligence was born in the 1950s, when a handful of pioneers from the nascent field of computer science started asking whether computers could be made to “think”—a question whose ramifications we’re still exploring today. A concise definition of the field would be as follows: the effort to automate intellectual tasks normally performed by humans. As such, AI is a general field that encompasses machine learning and deep learning, but that also includes many more approaches that don’t involve any learning. Early chess programs, for instance, only involved hardcoded rules crafted by programmers, and didn’t qualify as machine learning. For a fairly long time, many experts believed that human-level artificial intelligence could be achieved by having programmers handcraft a sufficiently large set of explicit rules for manipulating knowledge. This approach is known as symbolic AI, and it was the dominant paradigm in AI from the 1950s to the late 1980s. It reached its peak popularity during the expert systems boom of the 1980s.", "words": [{"w": "Artificial", "b": [0.1294, 0.3549, 0.2219, 0.3746]}, {"w": "intelligence", "b": [0.2282, 0.3549, 0.3459, 0.3746]}, {"w": "was", "b": [0.3522, 0.3549, 0.3914, 0.3746]}, {"w": "born", "b": [0.3977, 0.3549, 0.444, 0.3746]}, {"w": "in", "b": [0.4503, 0.3549, 0.4699, 0.3746]}, {"w": "the", "b": [0.4762, 0.3549, 0.507, 0.3746]}, {"w": "1950s,", "b": [0.5133, 0.3549, 0.5799, 0.3746]}, {"w": "when", "b": [0.5862, 0.3549, 0.6409, 0.3746]}, {"w": "a", "b": [0.6472, 0.3549, 0.6584, 0.3746]}, {"w": "handful", "b": [0.6647, 0.3549, 0.7417, 0.3746]}, {"w": "of", "b": [0.748, 0.3549, 0.7691, 0.3746]}, {"w": "pioneers", "b": [0.7754, 0.3549, 0.8608, 0.3746]}, {"w": "from", "b": [0.1294, 0.3754, 0.1785, 0.3951]}, {"w": "the", "b": [0.1848, 0.3754, 0.2156, 0.3951]}, {"w": "nascent", "b": [0.2219, 0.3754, 0.2975, 0.3951]}, {"w": "field", "b": [0.3038, 0.3754, 0.3501, 0.3951]}, {"w": "of", "b": [0.3564, 0.3754, 0.3774, 0.3951]}, {"w": "computer", "b": [0.3837, 0.3754, 0.479, 0.3951]}, {"w": "science", "b": [0.4853, 0.3754, 0.5595, 0.3951]}, {"w": "started", "b": [0.5658, 0.3754, 0.6331, 0.3951]}, {"w": "asking", "b": [0.6393, 0.3754, 0.7052, 0.3951]}, {"w": "whether", "b": [0.7115, 0.3754, 0.7927, 0.3951]}, {"w": "computers", "b": [0.1294, 0.3959, 0.2345, 0.4156]}, {"w": "could", "b": [0.2408, 0.3959, 0.2969, 0.4156]}, {"w": "be", "b": [0.3032, 0.3959, 0.327, 0.4156]}, {"w": "made", "b": [0.3333, 0.3959, 0.3879, 0.4156]}, {"w": "to", "b": [0.3942, 0.3959, 0.4139, 0.4156]}, {"w": "“think”—a", "b": [0.4202, 0.3959, 0.5309, 0.4156]}, {"w": "question", "b": [0.5372, 0.3959, 0.6227, 0.4156]}, {"w": "whose", "b": [0.629, 0.3959, 0.6934, 0.4156]}, {"w": "ramifications", "b": [0.6997, 0.3959, 0.8328, 0.4156]}, {"w": "we’re", "b": [0.1294, 0.4164, 0.1868, 0.4361]}, {"w": "still", "b": [0.1931, 0.4164, 0.231, 0.4361]}, {"w": "exploring", "b": [0.2373, 0.4164, 0.334, 0.4361]}, {"w": "today.", "b": [0.3403, 0.4164, 0.401, 0.4361]}, {"w": "A", "b": [0.4073, 0.4164, 0.4255, 0.4361]}, {"w": "concise", "b": [0.4318, 0.4164, 0.5075, 0.4361]}, {"w": "definition", "b": [0.5138, 0.4164, 0.6119, 0.4361]}, {"w": "of", "b": [0.6181, 0.4164, 0.6392, 0.4361]}, {"w": "the", "b": [0.6455, 0.4164, 0.6763, 0.4361]}, {"w": "field", "b": [0.6826, 0.4164, 0.7288, 0.4361]}, {"w": "would", "b": [0.7351, 0.4164, 0.7982, 0.4361]}, {"w": "be", "b": [0.8045, 0.4164, 0.8283, 0.4361]}, {"w": "as", "b": [0.8346, 0.4164, 0.8556, 0.4361]}, {"w": "follows:", "b": [0.1294, 0.4369, 0.2121, 0.4566]}, {"w": "the", "b": [0.2184, 0.4369, 0.2492, 0.4566]}, {"w": "effort", "b": [0.2555, 0.4369, 0.3102, 0.4566]}, {"w": "to", "b": [0.3165, 0.4369, 0.3361, 0.4566]}, {"w": "automate", "b": [0.3424, 0.4369, 0.4363, 0.4566]}, {"w": "intellectual", "b": [0.4426, 0.4369, 0.5561, 0.4566]}, {"w": "tasks", "b": [0.5624, 0.4369, 0.6129, 0.4566]}, {"w": "normally", "b": [0.6192, 0.4369, 0.7103, 0.4566]}, {"w": "performed", "b": [0.7166, 0.4369, 0.8217, 0.4566]}, {"w": "by", "b": [0.828, 0.4369, 0.8518, 0.4566]}, {"w": "humans.", "b": [0.1294, 0.4574, 0.2142, 0.4771]}, {"w": "As", "b": [0.2205, 0.4574, 0.2485, 0.4771]}, {"w": "such,", "b": [0.2548, 0.4574, 0.3074, 0.4771]}, {"w": "AI", "b": [0.3137, 0.4574, 0.3403, 0.4771]}, {"w": "is", "b": [0.3466, 0.4574, 0.3634, 0.4771]}, {"w": "a", "b": [0.3697, 0.4574, 0.3809, 0.4771]}, {"w": "general", "b": [0.3872, 0.4574, 0.4615, 0.4771]}, {"w": "field", "b": [0.4678, 0.4574, 0.514, 0.4771]}, {"w": "that", "b": [0.5203, 0.4574, 0.5582, 0.4771]}, {"w": "encompasses", "b": [0.5645, 0.4574, 0.6962, 0.4771]}, {"w": "machine", "b": [0.7025, 0.4574, 0.788, 0.4771]}, {"w": "learning", "b": [0.1294, 0.4779, 0.2121, 0.4976]}, {"w": "and", "b": [0.2184, 0.4779, 0.2548, 0.4976]}, {"w": "deep", "b": [0.2611, 0.4779, 0.3087, 0.4976]}, {"w": "learning,", "b": [0.315, 0.4779, 0.404, 0.4976]}, {"w": "but", "b": [0.4103, 0.4779, 0.4426, 0.4976]}, {"w": "that", "b": [0.4489, 0.4779, 0.4867, 0.4976]}, {"w": "also", "b": [0.493, 0.4779, 0.5337, 0.4976]}, {"w": "includes", "b": [0.54, 0.4779, 0.624, 0.4976]}, {"w": "many", "b": [0.6303, 0.4779, 0.6864, 0.4976]}, {"w": "more", "b": [0.6927, 0.4779, 0.7445, 0.4976]}, {"w": "approaches", "b": [0.7508, 0.4779, 0.8643, 0.4976]}, {"w": "that", "b": [0.1294, 0.4984, 0.1673, 0.5181]}, {"w": "don’t", "b": [0.1736, 0.4984, 0.2263, 0.5181]}, {"w": "involve", "b": [0.2326, 0.4984, 0.3083, 0.5181]}, {"w": "any", "b": [0.3146, 0.4984, 0.3511, 0.5181]}, {"w": "learning.", "b": [0.3574, 0.4984, 0.4463, 0.5181]}, {"w": "Early", "b": [0.4526, 0.4984, 0.5073, 0.5181]}, {"w": "chess", "b": [0.5136, 0.4984, 0.5682, 0.5181]}, {"w": "programs,", "b": [0.5745, 0.4984, 0.6761, 0.5181]}, {"w": "for", "b": [0.6824, 0.4984, 0.7118, 0.5181]}, {"w": "instance,", "b": [0.7181, 0.4984, 0.8071, 0.5181]}, {"w": "only", "b": [0.8134, 0.4984, 0.8583, 0.5181]}, {"w": "involved", "b": [0.1294, 0.5189, 0.2177, 0.5386]}, {"w": "hardcoded", "b": [0.224, 0.5189, 0.3291, 0.5386]}, {"w": "rules", "b": [0.3354, 0.5189, 0.3844, 0.5386]}, {"w": "crafted", "b": [0.3907, 0.5189, 0.4608, 0.5386]}, {"w": "by", "b": [0.4671, 0.5189, 0.4923, 0.5386]}, {"w": "programmers,", "b": [0.4986, 0.5189, 0.6394, 0.5386]}, {"w": "and", "b": [0.6457, 0.5189, 0.6821, 0.5386]}, {"w": "didn’t", "b": [0.6884, 0.5189, 0.7482, 0.5386]}, {"w": "qualify", "b": [0.7545, 0.5189, 0.826, 0.5386]}, {"w": "as", "b": [0.8323, 0.5189, 0.8533, 0.5386]}, {"w": "machine", "b": [0.1294, 0.5394, 0.2149, 0.5591]}, {"w": "learning.", "b": [0.2212, 0.5394, 0.3102, 0.5591]}, {"w": "For", "b": [0.3165, 0.5394, 0.3515, 0.5591]}, {"w": "a", "b": [0.3578, 0.5394, 0.369, 0.5591]}, {"w": "fairly", "b": [0.3753, 0.5394, 0.43, 0.5591]}, {"w": "long", "b": [0.4363, 0.5394, 0.4811, 0.5591]}, {"w": "time,", "b": [0.4874, 0.5394, 0.5386, 0.5591]}, {"w": "many", "b": [0.5449, 0.5394, 0.6009, 0.5591]}, {"w": "experts", "b": [0.6072, 0.5394, 0.6801, 0.5591]}, {"w": "believed", "b": [0.6864, 0.5394, 0.7719, 0.5591]}, {"w": "that", "b": [0.7782, 0.5394, 0.816, 0.5591]}, {"w": "human-level", "b": [0.1294, 0.5599, 0.2555, 0.5796]}, {"w": "artificial", "b": [0.2618, 0.5599, 0.3473, 0.5796]}, {"w": "intelligence", "b": [0.3536, 0.5599, 0.4713, 0.5796]}, {"w": "could", "b": [0.4775, 0.5599, 0.5336, 0.5796]}, {"w": "be", "b": [0.5399, 0.5599, 0.5637, 0.5796]}, {"w": "achieved", "b": [0.57, 0.5599, 0.6596, 0.5796]}, {"w": "by", "b": [0.6659, 0.5599, 0.6912, 0.5796]}, {"w": "having", "b": [0.6975, 0.5599, 0.7661, 0.5796]}, {"w": "programmers", "b": [0.1294, 0.5804, 0.2639, 0.6001]}, {"w": "handcraft", "b": [0.2702, 0.5804, 0.3655, 0.6001]}, {"w": "a", "b": [0.3718, 0.5804, 0.383, 0.6001]}, {"w": "sufficiently", "b": [0.3893, 0.5804, 0.5037, 0.6001]}, {"w": "large", "b": [0.51, 0.5804, 0.56, 0.6001]}, {"w": "set", "b": [0.5663, 0.5804, 0.5943, 0.6001]}, {"w": "of", "b": [0.6006, 0.5804, 0.6216, 0.6001]}, {"w": "explicit", "b": [0.6279, 0.5804, 0.7036, 0.6001]}, {"w": "rules", "b": [0.7099, 0.5804, 0.7589, 0.6001]}, {"w": "for", "b": [0.7652, 0.5804, 0.7947, 0.6001]}, {"w": "manipulating", "b": [0.1294, 0.6009, 0.2626, 0.6206]}, {"w": "knowledge.", "b": [0.2689, 0.6009, 0.3859, 0.6206]}, {"w": "This", "b": [0.3922, 0.6009, 0.437, 0.6206]}, {"w": "approach", "b": [0.4433, 0.6009, 0.5357, 0.6206]}, {"w": "is", "b": [0.542, 0.6009, 0.5589, 0.6206]}, {"w": "known", "b": [0.5652, 0.6009, 0.6338, 0.6206]}, {"w": "as", "b": [0.6401, 0.6009, 0.6612, 0.6206]}, {"w": "symbolic", "b": [0.6674, 0.6009, 0.7571, 0.6206]}, {"w": "AI,", "b": [0.7634, 0.6009, 0.7935, 0.6206]}, {"w": "and", "b": [0.7998, 0.6009, 0.8363, 0.6206]}, {"w": "it", "b": [0.8426, 0.6009, 0.8566, 0.6206]}, {"w": "was", "b": [0.1294, 0.6214, 0.1686, 0.6411]}, {"w": "the", "b": [0.1749, 0.6214, 0.2058, 0.6411]}, {"w": "dominant", "b": [0.2121, 0.6214, 0.3074, 0.6411]}, {"w": "paradigm", "b": [0.3137, 0.6214, 0.409, 0.6411]}, {"w": "in", "b": [0.4153, 0.6214, 0.4349, 0.6411]}, {"w": "AI", "b": [0.4412, 0.6214, 0.4678, 0.6411]}, {"w": "from", "b": [0.4741, 0.6214, 0.5232, 0.6411]}, {"w": "the", "b": [0.5295, 0.6214, 0.5603, 0.6411]}, {"w": "1950s", "b": [0.5666, 0.6214, 0.6269, 0.6411]}, {"w": "to", "b": [0.6332, 0.6214, 0.6528, 0.6411]}, {"w": "the", "b": [0.6591, 0.6214, 0.6899, 0.6411]}, {"w": "late", "b": [0.6962, 0.6214, 0.7327, 0.6411]}, {"w": "1980s.", "b": [0.739, 0.6214, 0.8055, 0.6411]}, {"w": "It", "b": [0.8118, 0.6214, 0.8273, 0.6411]}, {"w": "reached", "b": [0.1294, 0.6419, 0.2078, 0.6616]}, {"w": "its", "b": [0.2141, 0.6419, 0.238, 0.6616]}, {"w": "peak", "b": [0.2443, 0.6419, 0.2919, 0.6616]}, {"w": "popularity", "b": [0.2982, 0.6419, 0.4019, 0.6616]}, {"w": "during", "b": [0.4082, 0.6419, 0.4741, 0.6616]}, {"w": "the", "b": [0.4804, 0.6419, 0.5112, 0.6616]}, {"w": "expert", "b": [0.5175, 0.6419, 0.5805, 0.6616]}, {"w": "systems", "b": [0.5868, 0.6419, 0.6639, 0.6616]}, {"w": "boom", "b": [0.6702, 0.6419, 0.7276, 0.6616]}, {"w": "of", "b": [0.7339, 0.6419, 0.755, 0.6616]}, {"w": "the", "b": [0.7613, 0.6419, 0.7921, 0.6616]}, {"w": "1980s.", "b": [0.7984, 0.6419, 0.865, 0.6616]}]}, {"id": "b_2", "type": "paragraph", "text": "Although symbolic AI proved suitable to solve well-defined, logical problems, such as playing chess, it turned out to be intractable to figure out explicit rules for solving more complex, fuzzy problems, such as image classification, speech recognition, and language translation. A new approach arose to take symbolic AI’s place: machine learning.", "words": [{"w": "Although", "b": [0.1294, 0.6846, 0.2247, 0.7044]}, {"w": "symbolic", "b": [0.231, 0.6846, 0.3235, 0.7044]}, {"w": "AI", "b": [0.3298, 0.6846, 0.3564, 0.7044]}, {"w": "proved", "b": [0.3628, 0.6846, 0.4328, 0.7044]}, {"w": "suitable", "b": [0.4391, 0.6846, 0.5176, 0.7044]}, {"w": "to", "b": [0.5239, 0.6846, 0.5435, 0.7044]}, {"w": "solve", "b": [0.5498, 0.6846, 0.6031, 0.7044]}, {"w": "well-defined,", "b": [0.6094, 0.6846, 0.7432, 0.7044]}, {"w": "logical", "b": [0.7495, 0.6846, 0.8182, 0.7044]}, {"w": "problems,", "b": [0.1294, 0.7051, 0.2296, 0.7249]}, {"w": "such", "b": [0.2359, 0.7051, 0.2822, 0.7249]}, {"w": "as", "b": [0.2885, 0.7051, 0.3095, 0.7249]}, {"w": "playing", "b": [0.3158, 0.7051, 0.3915, 0.7249]}, {"w": "chess,", "b": [0.3978, 0.7051, 0.4587, 0.7249]}, {"w": "it", "b": [0.465, 0.7051, 0.479, 0.7249]}, {"w": "turned", "b": [0.4853, 0.7051, 0.5498, 0.7249]}, {"w": "out", "b": [0.5561, 0.7051, 0.5883, 0.7249]}, {"w": "to", "b": [0.5947, 0.7051, 0.6143, 0.7249]}, {"w": "be", "b": [0.6206, 0.7051, 0.6444, 0.7249]}, {"w": "intractable", "b": [0.6507, 0.7051, 0.7572, 0.7249]}, {"w": "to", "b": [0.7634, 0.7051, 0.783, 0.7249]}, {"w": "figure", "b": [0.7893, 0.7051, 0.8496, 0.7249]}, {"w": "out", "b": [0.1294, 0.7256, 0.1617, 0.7454]}, {"w": "explicit", "b": [0.168, 0.7256, 0.2436, 0.7454]}, {"w": "rules", "b": [0.2499, 0.7256, 0.299, 0.7454]}, {"w": "for", "b": [0.3053, 0.7256, 0.3347, 0.7454]}, {"w": "solving", "b": [0.341, 0.7256, 0.4153, 0.7454]}, {"w": "more", "b": [0.4216, 0.7256, 0.4734, 0.7454]}, {"w": "complex,", "b": [0.4797, 0.7256, 0.5729, 0.7454]}, {"w": "fuzzy", "b": [0.5792, 0.7256, 0.6353, 0.7454]}, {"w": "problems,", "b": [0.6416, 0.7256, 0.7418, 0.7454]}, {"w": "such", "b": [0.7481, 0.7256, 0.7943, 0.7454]}, {"w": "as", "b": [0.8006, 0.7256, 0.8216, 0.7454]}, {"w": "image", "b": [0.1294, 0.7461, 0.1911, 0.7659]}, {"w": "classification,", "b": [0.1974, 0.7461, 0.3368, 0.7659]}, {"w": "speech", "b": [0.3431, 0.7461, 0.4117, 0.7659]}, {"w": "recognition,", "b": [0.418, 0.7461, 0.5393, 0.7659]}, {"w": "and", "b": [0.5456, 0.7461, 0.582, 0.7659]}, {"w": "language", "b": [0.5882, 0.7461, 0.6793, 0.7659]}, {"w": "translation.", "b": [0.6856, 0.7461, 0.7984, 0.7659]}, {"w": "A", "b": [0.8047, 0.7461, 0.8229, 0.7659]}, {"w": "new", "b": [0.1294, 0.7666, 0.1714, 0.7864]}, {"w": "approach", "b": [0.1777, 0.7666, 0.2702, 0.7864]}, {"w": "arose", "b": [0.2765, 0.7666, 0.3297, 0.7864]}, {"w": "to", "b": [0.336, 0.7666, 0.3557, 0.7864]}, {"w": "take", "b": [0.362, 0.7666, 0.404, 0.7864]}, {"w": "symbolic", "b": [0.4103, 0.7666, 0.5028, 0.7864]}, {"w": "AI’s", "b": [0.5091, 0.7666, 0.5525, 0.7864]}, {"w": "place:", "b": [0.5588, 0.7666, 0.6191, 0.7864]}, {"w": "machine", "b": [0.6253, 0.7666, 0.7108, 0.7864]}, {"w": "learning.", "b": [0.7171, 0.7666, 0.8089, 0.7864]}]}, {"id": "b_3", "type": "paragraph", "text": "1.1.2. Machine learning", "words": [{"w": "1.1.2.", "b": [0.1294, 0.8139, 0.1862, 0.8336]}, {"w": "Machine", "b": [0.1925, 0.8139, 0.2864, 0.8336]}, {"w": "learning", "b": [0.2927, 0.8139, 0.3824, 0.8336]}]}, {"id": "b_4", "type": "paragraph", "text": "In Victorian England, Lady Ada Lovelace was a friend and collaborator of Charles Babbage, the inventor of the Analytical Engine: the first-", "words": [{"w": "In", "b": [0.1294, 0.8567, 0.1504, 0.8764]}, {"w": "Victorian", "b": [0.1567, 0.8567, 0.2505, 0.8764]}, {"w": "England,", "b": [0.2568, 0.8567, 0.3472, 0.8764]}, {"w": "Lady", "b": [0.3535, 0.8567, 0.4053, 0.8764]}, {"w": "Ada", "b": [0.4116, 0.8567, 0.4537, 0.8764]}, {"w": "Lovelace", "b": [0.46, 0.8567, 0.5524, 0.8764]}, {"w": "was", "b": [0.5587, 0.8567, 0.598, 0.8764]}, {"w": "a", "b": [0.6043, 0.8567, 0.6155, 0.8764]}, {"w": "friend", "b": [0.6218, 0.8567, 0.682, 0.8764]}, {"w": "and", "b": [0.6883, 0.8567, 0.7247, 0.8764]}, {"w": "collaborator", "b": [0.731, 0.8567, 0.8529, 0.8764]}, {"w": "of", "b": [0.1294, 0.8772, 0.1504, 0.8969]}, {"w": "Charles", "b": [0.1567, 0.8772, 0.2338, 0.8969]}, {"w": "Babbage,", "b": [0.2401, 0.8772, 0.3347, 0.8969]}, {"w": "the", "b": [0.341, 0.8772, 0.3718, 0.8969]}, {"w": "inventor", "b": [0.3781, 0.8772, 0.4622, 0.8969]}, {"w": "of", "b": [0.4685, 0.8772, 0.4895, 0.8969]}, {"w": "the", "b": [0.4958, 0.8772, 0.5266, 0.8969]}, {"w": "Analytical", "b": [0.5329, 0.8772, 0.6366, 0.8969]}, {"w": "Engine:", "b": [0.6429, 0.8772, 0.7213, 0.8969]}, {"w": "the", "b": [0.7276, 0.8772, 0.7585, 0.8969]}, {"w": "first-", "b": [0.7648, 0.8772, 0.8138, 0.8969]}]}]}, {"page": 31, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "known general-purpose, mechanical computer. Although visionary and far ahead of its time, the Analytical Engine wasn’t meant as a general- purpose computer when it was designed in the 1830s and 1840s, because the concept of general-purpose computation was yet to be invented. It was merely meant as a way to use mechanical operations to automate certain computations from the field of mathematical analysis—hence, the name Analytical Engine. In 1843, Ada Lovelace remarked on the invention, “The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.... Its province is to assist us in making available what we’re already acquainted with.”", "words": [{"w": "known", "b": [0.1294, 0.0857, 0.1981, 0.1054]}, {"w": "general-purpose,", "b": [0.2044, 0.0857, 0.3732, 0.1054]}, {"w": "mechanical", "b": [0.3795, 0.0857, 0.4944, 0.1054]}, {"w": "computer.", "b": [0.5007, 0.0857, 0.6008, 0.1054]}, {"w": "Although", "b": [0.6071, 0.0857, 0.7024, 0.1054]}, {"w": "visionary", "b": [0.7087, 0.0857, 0.8026, 0.1054]}, {"w": "and", "b": [0.8089, 0.0857, 0.8454, 0.1054]}, {"w": "far", "b": [0.1294, 0.1062, 0.1574, 0.1259]}, {"w": "ahead", "b": [0.1637, 0.1062, 0.2225, 0.1259]}, {"w": "of", "b": [0.2289, 0.1062, 0.2499, 0.1259]}, {"w": "its", "b": [0.2562, 0.1062, 0.28, 0.1259]}, {"w": "time,", "b": [0.2863, 0.1062, 0.3375, 0.1259]}, {"w": "the", "b": [0.3438, 0.1062, 0.3746, 0.1259]}, {"w": "Analytical", "b": [0.3809, 0.1062, 0.486, 0.1259]}, {"w": "Engine", "b": [0.4922, 0.1062, 0.5637, 0.1259]}, {"w": "wasn’t", "b": [0.57, 0.1062, 0.6368, 0.1259]}, {"w": "meant", "b": [0.6431, 0.1062, 0.7047, 0.1259]}, {"w": "as", "b": [0.7111, 0.1062, 0.7321, 0.1259]}, {"w": "a", "b": [0.7384, 0.1062, 0.7496, 0.1259]}, {"w": "general-", "b": [0.7559, 0.1062, 0.8385, 0.1259]}, {"w": "purpose", "b": [0.1294, 0.1267, 0.2093, 0.1464]}, {"w": "computer", "b": [0.2156, 0.1267, 0.3109, 0.1464]}, {"w": "when", "b": [0.3172, 0.1267, 0.3718, 0.1464]}, {"w": "it", "b": [0.3781, 0.1267, 0.3921, 0.1464]}, {"w": "was", "b": [0.3984, 0.1267, 0.4377, 0.1464]}, {"w": "designed", "b": [0.444, 0.1267, 0.5337, 0.1464]}, {"w": "in", "b": [0.54, 0.1267, 0.5596, 0.1464]}, {"w": "the", "b": [0.5659, 0.1267, 0.5967, 0.1464]}, {"w": "1830s", "b": [0.603, 0.1267, 0.6633, 0.1464]}, {"w": "and", "b": [0.6696, 0.1267, 0.706, 0.1464]}, {"w": "1840s,", "b": [0.7123, 0.1267, 0.7789, 0.1464]}, {"w": "because", "b": [0.7852, 0.1267, 0.865, 0.1464]}, {"w": "the", "b": [0.1294, 0.1472, 0.1602, 0.1669]}, {"w": "concept", "b": [0.1665, 0.1472, 0.245, 0.1669]}, {"w": "of", "b": [0.2513, 0.1472, 0.2723, 0.1669]}, {"w": "general-purpose", "b": [0.2786, 0.1472, 0.4411, 0.1669]}, {"w": "computation", "b": [0.4474, 0.1472, 0.5735, 0.1669]}, {"w": "was", "b": [0.5798, 0.1472, 0.6191, 0.1669]}, {"w": "yet", "b": [0.6254, 0.1472, 0.6562, 0.1669]}, {"w": "to", "b": [0.6625, 0.1472, 0.6821, 0.1669]}, {"w": "be", "b": [0.6884, 0.1472, 0.7122, 0.1669]}, {"w": "invented.", "b": [0.7185, 0.1472, 0.8117, 0.1669]}, {"w": "It", "b": [0.818, 0.1472, 0.8334, 0.1669]}, {"w": "was", "b": [0.1294, 0.1677, 0.1686, 0.1874]}, {"w": "merely", "b": [0.1749, 0.1677, 0.245, 0.1874]}, {"w": "meant", "b": [0.2513, 0.1677, 0.313, 0.1874]}, {"w": "as", "b": [0.3193, 0.1677, 0.3403, 0.1874]}, {"w": "a", "b": [0.3466, 0.1677, 0.3578, 0.1874]}, {"w": "way", "b": [0.3641, 0.1677, 0.4061, 0.1874]}, {"w": "to", "b": [0.4124, 0.1677, 0.432, 0.1874]}, {"w": "use", "b": [0.4384, 0.1677, 0.472, 0.1874]}, {"w": "mechanical", "b": [0.4783, 0.1677, 0.5932, 0.1874]}, {"w": "operations", "b": [0.5995, 0.1677, 0.7046, 0.1874]}, {"w": "to", "b": [0.7109, 0.1677, 0.7305, 0.1874]}, {"w": "automate", "b": [0.7368, 0.1677, 0.8293, 0.1874]}, {"w": "certain", "b": [0.1294, 0.1882, 0.1981, 0.2079]}, {"w": "computations", "b": [0.2044, 0.1882, 0.3403, 0.2079]}, {"w": "from", "b": [0.3466, 0.1882, 0.3956, 0.2079]}, {"w": "the", "b": [0.4019, 0.1882, 0.4327, 0.2079]}, {"w": "field", "b": [0.439, 0.1882, 0.4853, 0.2079]}, {"w": "of", "b": [0.4916, 0.1882, 0.5126, 0.2079]}, {"w": "mathematical", "b": [0.5189, 0.1882, 0.6548, 0.2079]}, {"w": "analysis—hence,", "b": [0.6611, 0.1882, 0.8328, 0.2079]}, {"w": "the", "b": [0.8391, 0.1882, 0.8699, 0.2079]}, {"w": "name", "b": [0.1294, 0.2087, 0.1841, 0.2284]}, {"w": "Analytical", "b": [0.1904, 0.2087, 0.2954, 0.2284]}, {"w": "Engine.", "b": [0.3018, 0.2087, 0.3795, 0.2284]}, {"w": "In", "b": [0.3858, 0.2087, 0.4068, 0.2284]}, {"w": "1843,", "b": [0.4132, 0.2087, 0.4699, 0.2284]}, {"w": "Ada", "b": [0.4762, 0.2087, 0.5182, 0.2284]}, {"w": "Lovelace", "b": [0.5245, 0.2087, 0.617, 0.2284]}, {"w": "remarked", "b": [0.6233, 0.2087, 0.7186, 0.2284]}, {"w": "on", "b": [0.7249, 0.2087, 0.7501, 0.2284]}, {"w": "the", "b": [0.7564, 0.2087, 0.7872, 0.2284]}, {"w": "invention,", "b": [0.1294, 0.2292, 0.231, 0.2489]}, {"w": "“The", "b": [0.2373, 0.2292, 0.2877, 0.2489]}, {"w": "Analytical", "b": [0.294, 0.2292, 0.3991, 0.2489]}, {"w": "Engine", "b": [0.4054, 0.2292, 0.4769, 0.2489]}, {"w": "has", "b": [0.4832, 0.2292, 0.5168, 0.2489]}, {"w": "no", "b": [0.5231, 0.2292, 0.5484, 0.2489]}, {"w": "pretensions", "b": [0.5547, 0.2292, 0.6696, 0.2489]}, {"w": "whatever", "b": [0.6759, 0.2292, 0.7683, 0.2489]}, {"w": "to", "b": [0.7746, 0.2292, 0.7943, 0.2489]}, {"w": "originate", "b": [0.1294, 0.2497, 0.2191, 0.2694]}, {"w": "anything.", "b": [0.2254, 0.2497, 0.32, 0.2694]}, {"w": "It", "b": [0.3263, 0.2497, 0.3417, 0.2694]}, {"w": "can", "b": [0.348, 0.2497, 0.383, 0.2694]}, {"w": "do", "b": [0.3893, 0.2497, 0.4146, 0.2694]}, {"w": "whatever", "b": [0.4209, 0.2497, 0.5133, 0.2694]}, {"w": "we", "b": [0.5196, 0.2497, 0.549, 0.2694]}, {"w": "know", "b": [0.5553, 0.2497, 0.6114, 0.2694]}, {"w": "how", "b": [0.6177, 0.2497, 0.6611, 0.2694]}, {"w": "to", "b": [0.6675, 0.2497, 0.6871, 0.2694]}, {"w": "order", "b": [0.6934, 0.2497, 0.7466, 0.2694]}, {"w": "it", "b": [0.7529, 0.2497, 0.7669, 0.2694]}, {"w": "to", "b": [0.7732, 0.2497, 0.7929, 0.2694]}, {"w": "perform....", "b": [0.1294, 0.2702, 0.2359, 0.2899]}, {"w": "Its", "b": [0.2422, 0.2702, 0.2674, 0.2899]}, {"w": "province", "b": [0.2737, 0.2702, 0.362, 0.2899]}, {"w": "is", "b": [0.3683, 0.2702, 0.3851, 0.2899]}, {"w": "to", "b": [0.3914, 0.2702, 0.411, 0.2899]}, {"w": "assist", "b": [0.4173, 0.2702, 0.472, 0.2899]}, {"w": "us", "b": [0.4783, 0.2702, 0.5007, 0.2899]}, {"w": "in", "b": [0.507, 0.2702, 0.5267, 0.2899]}, {"w": "making", "b": [0.533, 0.2702, 0.6087, 0.2899]}, {"w": "available", "b": [0.615, 0.2702, 0.706, 0.2899]}, {"w": "what", "b": [0.7123, 0.2702, 0.7614, 0.2899]}, {"w": "we’re", "b": [0.7677, 0.2702, 0.8251, 0.2899]}, {"w": "already", "b": [0.1294, 0.2907, 0.2037, 0.3104]}, {"w": "acquainted", "b": [0.21, 0.2907, 0.3192, 0.3104]}, {"w": "with.”", "b": [0.3255, 0.2907, 0.3879, 0.3104]}]}, {"id": "b_1", "type": "paragraph", "text": "This remark was later quoted by AI pioneer Alan Turing as “Lady Lovelace’s objection” in his landmark 1950 paper “Computing Machinery and Intelligence,”[1] which introduced the Turing test as well as key concepts that would come to shape AI. Turing was quoting Ada Lovelace while pondering whether general-purpose computers could be capable of learning and originality, and he came to the conclusion that they could.", "words": [{"w": "This", "b": [0.1294, 0.3335, 0.1743, 0.3532]}, {"w": "remark", "b": [0.1806, 0.3335, 0.252, 0.3532]}, {"w": "was", "b": [0.2583, 0.3335, 0.2975, 0.3532]}, {"w": "later", "b": [0.3038, 0.3335, 0.3487, 0.3532]}, {"w": "quoted", "b": [0.355, 0.3335, 0.4236, 0.3532]}, {"w": "by", "b": [0.43, 0.3335, 0.4552, 0.3532]}, {"w": "AI", "b": [0.4615, 0.3335, 0.4881, 0.3532]}, {"w": "pioneer", "b": [0.4944, 0.3335, 0.5701, 0.3532]}, {"w": "Alan", "b": [0.5764, 0.3335, 0.6254, 0.3532]}, {"w": "Turing", "b": [0.6317, 0.3335, 0.6994, 0.3532]}, {"w": "as", "b": [0.7057, 0.3335, 0.7268, 0.3532]}, {"w": "“Lady", "b": [0.7331, 0.3335, 0.7961, 0.3532]}, {"w": "Lovelace’s", "b": [0.1294, 0.354, 0.2387, 0.3737]}, {"w": "objection”", "b": [0.245, 0.354, 0.3501, 0.3737]}, {"w": "in", "b": [0.3564, 0.354, 0.376, 0.3737]}, {"w": "his", "b": [0.3823, 0.354, 0.4117, 0.3737]}, {"w": "landmark", "b": [0.418, 0.354, 0.5133, 0.3737]}, {"w": "1950", "b": [0.5196, 0.354, 0.5701, 0.3737]}, {"w": "paper", "b": [0.5764, 0.354, 0.6324, 0.3737]}, {"w": "“Computing", "b": [0.6387, 0.354, 0.7635, 0.3737]}, {"w": "Machinery", "b": [0.1294, 0.3762, 0.2387, 0.396]}, {"w": "and", "b": [0.245, 0.3762, 0.2814, 0.396]}, {"w": "Intelligence,”[1]", "b": [0.2877, 0.374, 0.4463, 0.396]}, {"w": "which", "b": [0.4526, 0.3762, 0.5142, 0.396]}, {"w": "introduced", "b": [0.5206, 0.3762, 0.6284, 0.396]}, {"w": "the", "b": [0.6348, 0.3762, 0.6656, 0.396]}, {"w": "Turing", "b": [0.6718, 0.3762, 0.7391, 0.396]}, {"w": "test", "b": [0.7455, 0.3762, 0.7805, 0.396]}, {"w": "as", "b": [0.7868, 0.3762, 0.8078, 0.396]}, {"w": "well", "b": [0.8141, 0.3762, 0.8575, 0.396]}, {"w": "as", "b": [0.1294, 0.3967, 0.1504, 0.4165]}, {"w": "key", "b": [0.1567, 0.3967, 0.1932, 0.4165]}, {"w": "concepts", "b": [0.1995, 0.3967, 0.2877, 0.4165]}, {"w": "that", "b": [0.294, 0.3967, 0.3319, 0.4165]}, {"w": "would", "b": [0.3382, 0.3967, 0.4012, 0.4165]}, {"w": "come", "b": [0.4076, 0.3967, 0.4622, 0.4165]}, {"w": "to", "b": [0.4685, 0.3967, 0.4881, 0.4165]}, {"w": "shape", "b": [0.4944, 0.3967, 0.5519, 0.4165]}, {"w": "AI.", "b": [0.5582, 0.3967, 0.5911, 0.4165]}, {"w": "Turing", "b": [0.5974, 0.3967, 0.6651, 0.4165]}, {"w": "was", "b": [0.6714, 0.3967, 0.7107, 0.4165]}, {"w": "quoting", "b": [0.717, 0.3967, 0.7941, 0.4165]}, {"w": "Ada", "b": [0.8004, 0.3967, 0.8424, 0.4165]}, {"w": "Lovelace", "b": [0.1294, 0.4172, 0.2219, 0.437]}, {"w": "while", "b": [0.2282, 0.4172, 0.2842, 0.437]}, {"w": "pondering", "b": [0.2905, 0.4172, 0.3928, 0.437]}, {"w": "whether", "b": [0.3991, 0.4172, 0.4804, 0.437]}, {"w": "general-purpose", "b": [0.4867, 0.4172, 0.6492, 0.437]}, {"w": "computers", "b": [0.6554, 0.4172, 0.7605, 0.437]}, {"w": "could", "b": [0.7668, 0.4172, 0.8229, 0.437]}, {"w": "be", "b": [0.8292, 0.4172, 0.853, 0.437]}, {"w": "capable", "b": [0.1294, 0.4377, 0.2065, 0.4575]}, {"w": "of", "b": [0.2128, 0.4377, 0.2338, 0.4575]}, {"w": "learning", "b": [0.2401, 0.4377, 0.3227, 0.4575]}, {"w": "and", "b": [0.329, 0.4377, 0.3655, 0.4575]}, {"w": "originality,", "b": [0.3718, 0.4377, 0.4815, 0.4575]}, {"w": "and", "b": [0.4878, 0.4377, 0.5242, 0.4575]}, {"w": "he", "b": [0.5305, 0.4377, 0.5544, 0.4575]}, {"w": "came", "b": [0.5607, 0.4377, 0.6139, 0.4575]}, {"w": "to", "b": [0.6202, 0.4377, 0.6398, 0.4575]}, {"w": "the", "b": [0.6461, 0.4377, 0.677, 0.4575]}, {"w": "conclusion", "b": [0.6833, 0.4377, 0.7926, 0.4575]}, {"w": "that", "b": [0.7989, 0.4377, 0.8367, 0.4575]}, {"w": "they", "b": [0.1294, 0.4582, 0.1729, 0.478]}, {"w": "could.", "b": [0.1792, 0.4582, 0.2415, 0.478]}]}, {"id": "b_3", "type": "paragraph", "text": "A. M. Turing, “Computing Machinery and Intelligence,” Mind 59, no. 236 (1950): 433-460.", "words": [{"w": "A.", "b": [0.1483, 0.5237, 0.1667, 0.5385]}, {"w": "M.", "b": [0.1715, 0.5237, 0.193, 0.5385]}, {"w": "Turing,", "b": [0.1977, 0.5237, 0.2533, 0.5385]}, {"w": "“Computing", "b": [0.258, 0.5237, 0.3516, 0.5385]}, {"w": "Machinery", "b": [0.3563, 0.5237, 0.4383, 0.5385]}, {"w": "and", "b": [0.443, 0.5237, 0.4703, 0.5385]}, {"w": "Intelligence,”", "b": [0.475, 0.5237, 0.5775, 0.5385]}, {"w": "Mind", "b": [0.5822, 0.5237, 0.6221, 0.5385]}, {"w": "59,", "b": [0.6268, 0.5237, 0.6505, 0.5385]}, {"w": "no.", "b": [0.6552, 0.5237, 0.6788, 0.5385]}, {"w": "236", "b": [0.6836, 0.5237, 0.7119, 0.5385]}, {"w": "(1950):", "b": [0.7167, 0.5237, 0.7724, 0.5385]}, {"w": "433-460.", "b": [0.7771, 0.5237, 0.8449, 0.5385]}]}, {"id": "b_4", "type": "paragraph", "text": "Machine learning arises from this question: could a computer go beyond “what we know how to order it to perform” and learn on its own how to perform a specified task? Could a computer surprise us? Rather than programmers crafting data-processing rules by hand, could a computer automatically learn these rules by looking at data?", "words": [{"w": "Machine", "b": [0.1294, 0.5616, 0.2177, 0.5814]}, {"w": "learning", "b": [0.224, 0.5616, 0.3066, 0.5814]}, {"w": "arises", "b": [0.313, 0.5616, 0.3704, 0.5814]}, {"w": "from", "b": [0.3767, 0.5616, 0.4257, 0.5814]}, {"w": "this", "b": [0.432, 0.5616, 0.4685, 0.5814]}, {"w": "question:", "b": [0.4748, 0.5616, 0.5673, 0.5814]}, {"w": "could", "b": [0.5736, 0.5616, 0.6297, 0.5814]}, {"w": "a", "b": [0.636, 0.5616, 0.6472, 0.5814]}, {"w": "computer", "b": [0.6535, 0.5616, 0.7488, 0.5814]}, {"w": "go", "b": [0.7551, 0.5616, 0.7803, 0.5814]}, {"w": "beyond", "b": [0.7866, 0.5616, 0.8609, 0.5814]}, {"w": "“what", "b": [0.1294, 0.5821, 0.1897, 0.6019]}, {"w": "we", "b": [0.196, 0.5821, 0.2254, 0.6019]}, {"w": "know", "b": [0.2317, 0.5821, 0.2877, 0.6019]}, {"w": "how", "b": [0.294, 0.5821, 0.3375, 0.6019]}, {"w": "to", "b": [0.3438, 0.5821, 0.3634, 0.6019]}, {"w": "order", "b": [0.3697, 0.5821, 0.4229, 0.6019]}, {"w": "it", "b": [0.4292, 0.5821, 0.4433, 0.6019]}, {"w": "to", "b": [0.4496, 0.5821, 0.4692, 0.6019]}, {"w": "perform”", "b": [0.4755, 0.5821, 0.568, 0.6019]}, {"w": "and", "b": [0.5743, 0.5821, 0.6107, 0.6019]}, {"w": "learn", "b": [0.617, 0.5821, 0.6674, 0.6019]}, {"w": "on", "b": [0.6737, 0.5821, 0.6989, 0.6019]}, {"w": "its", "b": [0.7052, 0.5821, 0.729, 0.6019]}, {"w": "own", "b": [0.7354, 0.5821, 0.7788, 0.6019]}, {"w": "how", "b": [0.7851, 0.5821, 0.8285, 0.6019]}, {"w": "to", "b": [0.8348, 0.5821, 0.8545, 0.6019]}, {"w": "perform", "b": [0.1294, 0.6026, 0.2107, 0.6224]}, {"w": "a", "b": [0.217, 0.6026, 0.2282, 0.6224]}, {"w": "specified", "b": [0.2345, 0.6026, 0.3255, 0.6224]}, {"w": "task?", "b": [0.3318, 0.6026, 0.3837, 0.6224]}, {"w": "Could", "b": [0.39, 0.6026, 0.4517, 0.6224]}, {"w": "a", "b": [0.458, 0.6026, 0.4692, 0.6224]}, {"w": "computer", "b": [0.4755, 0.6026, 0.5708, 0.6224]}, {"w": "surprise", "b": [0.5771, 0.6026, 0.6569, 0.6224]}, {"w": "us?", "b": [0.6632, 0.6026, 0.6969, 0.6224]}, {"w": "Rather", "b": [0.7032, 0.6026, 0.7704, 0.6224]}, {"w": "than", "b": [0.7767, 0.6026, 0.8202, 0.6224]}, {"w": "programmers", "b": [0.1294, 0.6231, 0.2639, 0.6429]}, {"w": "crafting", "b": [0.2702, 0.6231, 0.3487, 0.6429]}, {"w": "data-processing", "b": [0.355, 0.6231, 0.5133, 0.6429]}, {"w": "rules", "b": [0.5195, 0.6231, 0.5686, 0.6429]}, {"w": "by", "b": [0.5749, 0.6231, 0.6001, 0.6429]}, {"w": "hand,", "b": [0.6064, 0.6231, 0.6618, 0.6429]}, {"w": "could", "b": [0.6681, 0.6231, 0.7241, 0.6429]}, {"w": "a", "b": [0.7304, 0.6231, 0.7416, 0.6429]}, {"w": "computer", "b": [0.7479, 0.6231, 0.8432, 0.6429]}, {"w": "automatically", "b": [0.1294, 0.6436, 0.2667, 0.6634]}, {"w": "learn", "b": [0.273, 0.6436, 0.3235, 0.6634]}, {"w": "these", "b": [0.3298, 0.6436, 0.3816, 0.6634]}, {"w": "rules", "b": [0.3879, 0.6436, 0.437, 0.6634]}, {"w": "by", "b": [0.4433, 0.6436, 0.4685, 0.6634]}, {"w": "looking", "b": [0.4748, 0.6436, 0.5519, 0.6634]}, {"w": "at", "b": [0.5582, 0.6436, 0.5764, 0.6634]}, {"w": "data?", "b": [0.5827, 0.6436, 0.6359, 0.6634]}]}, {"id": "b_5", "type": "paragraph", "text": "This question opens the door to a new programming paradigm. In classical programming, the paradigm of symbolic AI, humans input rules (a program) and data to be processed according to these rules, and out come answers (see figure 1.2). With machine learning, humans input data as well as the answers expected from the data, and out come the rules. These rules can then be applied to new data to produce original answers.", "words": [{"w": "This", "b": [0.1294, 0.6864, 0.1743, 0.7062]}, {"w": "question", "b": [0.1806, 0.6864, 0.2661, 0.7062]}, {"w": "opens", "b": [0.2724, 0.6864, 0.3312, 0.7062]}, {"w": "the", "b": [0.3375, 0.6864, 0.3684, 0.7062]}, {"w": "door", "b": [0.3747, 0.6864, 0.4209, 0.7062]}, {"w": "to", "b": [0.4272, 0.6864, 0.4468, 0.7062]}, {"w": "a", "b": [0.4531, 0.6864, 0.4643, 0.7062]}, {"w": "new", "b": [0.4706, 0.6864, 0.5127, 0.7062]}, {"w": "programming", "b": [0.519, 0.6864, 0.6563, 0.7062]}, {"w": "paradigm.", "b": [0.6626, 0.6864, 0.7642, 0.7062]}, {"w": "In", "b": [0.7705, 0.6864, 0.7915, 0.7062]}, {"w": "classical", "b": [0.1294, 0.7069, 0.2149, 0.7267]}, {"w": "programming,", "b": [0.2212, 0.7069, 0.3648, 0.7267]}, {"w": "the", "b": [0.3711, 0.7069, 0.402, 0.7267]}, {"w": "paradigm", "b": [0.4083, 0.7069, 0.5035, 0.7267]}, {"w": "of", "b": [0.5098, 0.7069, 0.5309, 0.7267]}, {"w": "symbolic", "b": [0.5372, 0.7069, 0.6297, 0.7267]}, {"w": "AI,", "b": [0.636, 0.7069, 0.6689, 0.7267]}, {"w": "humans", "b": [0.6752, 0.7069, 0.7537, 0.7267]}, {"w": "input", "b": [0.7599, 0.7069, 0.8118, 0.7267]}, {"w": "rules", "b": [0.8181, 0.7069, 0.8671, 0.7267]}, {"w": "(a", "b": [0.1294, 0.7274, 0.149, 0.7472]}, {"w": "program)", "b": [0.1553, 0.7274, 0.2492, 0.7472]}, {"w": "and", "b": [0.2555, 0.7274, 0.2919, 0.7472]}, {"w": "data", "b": [0.2982, 0.7274, 0.3402, 0.7472]}, {"w": "to", "b": [0.3466, 0.7274, 0.3662, 0.7472]}, {"w": "be", "b": [0.3725, 0.7274, 0.3963, 0.7472]}, {"w": "processed", "b": [0.4026, 0.7274, 0.5021, 0.7472]}, {"w": "according", "b": [0.5084, 0.7274, 0.6078, 0.7472]}, {"w": "to", "b": [0.6142, 0.7274, 0.6338, 0.7472]}, {"w": "these", "b": [0.6401, 0.7274, 0.6919, 0.7472]}, {"w": "rules,", "b": [0.6982, 0.7274, 0.7536, 0.7472]}, {"w": "and", "b": [0.7599, 0.7274, 0.7963, 0.7472]}, {"w": "out", "b": [0.8026, 0.7274, 0.8349, 0.7472]}, {"w": "come", "b": [0.1294, 0.7479, 0.1841, 0.7677]}, {"w": "answers", "b": [0.1904, 0.7479, 0.2716, 0.7677]}, {"w": "(see", "b": [0.2779, 0.7479, 0.3185, 0.7677]}, {"w": "figure", "b": [0.3248, 0.7479, 0.3851, 0.7677]}, {"w": "1.2).", "b": [0.3914, 0.7479, 0.4376, 0.7677]}, {"w": "With", "b": [0.4439, 0.7479, 0.4933, 0.7677]}, {"w": "machine", "b": [0.4996, 0.7479, 0.5851, 0.7677]}, {"w": "learning,", "b": [0.5914, 0.7479, 0.6804, 0.7677]}, {"w": "humans", "b": [0.6867, 0.7479, 0.7652, 0.7677]}, {"w": "input", "b": [0.7715, 0.7479, 0.8233, 0.7677]}, {"w": "data", "b": [0.1294, 0.7684, 0.1714, 0.7882]}, {"w": "as", "b": [0.1777, 0.7684, 0.1988, 0.7882]}, {"w": "well", "b": [0.2051, 0.7684, 0.2485, 0.7882]}, {"w": "as", "b": [0.2548, 0.7684, 0.2758, 0.7882]}, {"w": "the", "b": [0.2821, 0.7684, 0.313, 0.7882]}, {"w": "answers", "b": [0.3193, 0.7684, 0.4005, 0.7882]}, {"w": "expected", "b": [0.4068, 0.7684, 0.4965, 0.7882]}, {"w": "from", "b": [0.5028, 0.7684, 0.5518, 0.7882]}, {"w": "the", "b": [0.5581, 0.7684, 0.5889, 0.7882]}, {"w": "data,", "b": [0.5953, 0.7684, 0.6436, 0.7882]}, {"w": "and", "b": [0.6499, 0.7684, 0.6863, 0.7882]}, {"w": "out", "b": [0.6926, 0.7684, 0.7249, 0.7882]}, {"w": "come", "b": [0.7312, 0.7684, 0.7858, 0.7882]}, {"w": "the", "b": [0.7921, 0.7684, 0.8229, 0.7882]}, {"w": "rules.", "b": [0.1294, 0.7889, 0.1848, 0.8087]}, {"w": "These", "b": [0.1911, 0.7889, 0.2513, 0.8087]}, {"w": "rules", "b": [0.2576, 0.7889, 0.3066, 0.8087]}, {"w": "can", "b": [0.3129, 0.7889, 0.3479, 0.8087]}, {"w": "then", "b": [0.3542, 0.7889, 0.3977, 0.8087]}, {"w": "be", "b": [0.404, 0.7889, 0.4278, 0.8087]}, {"w": "applied", "b": [0.4341, 0.7889, 0.5084, 0.8087]}, {"w": "to", "b": [0.5147, 0.7889, 0.5343, 0.8087]}, {"w": "new", "b": [0.5406, 0.7889, 0.5826, 0.8087]}, {"w": "data", "b": [0.5889, 0.7889, 0.631, 0.8087]}, {"w": "to", "b": [0.6373, 0.7889, 0.6569, 0.8087]}, {"w": "produce", "b": [0.6632, 0.7889, 0.7445, 0.8087]}, {"w": "original", "b": [0.7508, 0.7889, 0.8293, 0.8087]}, {"w": "answers.", "b": [0.1294, 0.8094, 0.217, 0.8292]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 1.2. Machine learning: a new programming paradigm", "words": [{"w": "Figure", "b": [0.1294, 0.8473, 0.1827, 0.8621]}, {"w": "1.2.", "b": [0.1874, 0.8473, 0.2158, 0.8621]}, {"w": "Machine", "b": [0.2205, 0.8473, 0.2909, 0.8621]}, {"w": "learning:", "b": [0.2956, 0.8473, 0.3692, 0.8621]}, {"w": "a", "b": [0.3739, 0.8473, 0.3834, 0.8621]}, {"w": "new", "b": [0.3881, 0.8473, 0.4207, 0.8621]}, {"w": "programming", "b": [0.4254, 0.8473, 0.5375, 0.8621]}, {"w": "paradigm", "b": [0.5423, 0.8473, 0.6211, 0.8621]}]}]}, {"page": 32, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "A machine-learning system is trained rather than explicitly programmed. It’s presented with many examples relevant to a task, and it finds statistical structure in these examples that eventually allows the system to come up with rules for automating the task. For instance, if you wished to automate the task of tagging your vacation pictures, you could present a machine-learning system with many examples of pictures already tagged by humans, and the system would learn statistical rules for associating specific pictures to specific tags.", "words": [{"w": "A", "b": [0.1294, 0.2479, 0.1476, 0.2676]}, {"w": "machine-learning", "b": [0.1539, 0.2479, 0.3305, 0.2676]}, {"w": "system", "b": [0.3368, 0.2479, 0.4068, 0.2676]}, {"w": "is", "b": [0.4132, 0.2479, 0.43, 0.2676]}, {"w": "trained", "b": [0.4362, 0.2479, 0.5091, 0.2676]}, {"w": "rather", "b": [0.5154, 0.2479, 0.5742, 0.2676]}, {"w": "than", "b": [0.5805, 0.2479, 0.624, 0.2676]}, {"w": "explicitly", "b": [0.6303, 0.2479, 0.7256, 0.2676]}, {"w": "programmed.", "b": [0.7319, 0.2479, 0.8671, 0.2676]}, {"w": "It’s", "b": [0.1294, 0.2684, 0.1616, 0.2881]}, {"w": "presented", "b": [0.1679, 0.2684, 0.2646, 0.2881]}, {"w": "with", "b": [0.2709, 0.2684, 0.3158, 0.2881]}, {"w": "many", "b": [0.3221, 0.2684, 0.3781, 0.2881]}, {"w": "examples", "b": [0.3844, 0.2684, 0.4797, 0.2881]}, {"w": "relevant", "b": [0.486, 0.2684, 0.5673, 0.2881]}, {"w": "to", "b": [0.5736, 0.2684, 0.5932, 0.2881]}, {"w": "a", "b": [0.5995, 0.2684, 0.6107, 0.2881]}, {"w": "task,", "b": [0.617, 0.2684, 0.664, 0.2881]}, {"w": "and", "b": [0.6703, 0.2684, 0.7067, 0.2881]}, {"w": "it", "b": [0.713, 0.2684, 0.727, 0.2881]}, {"w": "finds", "b": [0.7333, 0.2684, 0.7838, 0.2881]}, {"w": "statistical", "b": [0.1294, 0.2889, 0.2247, 0.3086]}, {"w": "structure", "b": [0.231, 0.2889, 0.3193, 0.3086]}, {"w": "in", "b": [0.3255, 0.2889, 0.3452, 0.3086]}, {"w": "these", "b": [0.3515, 0.2889, 0.4033, 0.3086]}, {"w": "examples", "b": [0.4096, 0.2889, 0.5049, 0.3086]}, {"w": "that", "b": [0.5112, 0.2889, 0.549, 0.3086]}, {"w": "eventually", "b": [0.5553, 0.2889, 0.6604, 0.3086]}, {"w": "allows", "b": [0.6667, 0.2889, 0.7326, 0.3086]}, {"w": "the", "b": [0.7389, 0.2889, 0.7697, 0.3086]}, {"w": "system", "b": [0.776, 0.2889, 0.8461, 0.3086]}, {"w": "to", "b": [0.1294, 0.3094, 0.149, 0.3291]}, {"w": "come", "b": [0.1553, 0.3094, 0.21, 0.3291]}, {"w": "up", "b": [0.2163, 0.3094, 0.2415, 0.3291]}, {"w": "with", "b": [0.2478, 0.3094, 0.2927, 0.3291]}, {"w": "rules", "b": [0.299, 0.3094, 0.348, 0.3291]}, {"w": "for", "b": [0.3543, 0.3094, 0.3837, 0.3291]}, {"w": "automating", "b": [0.39, 0.3094, 0.5036, 0.3291]}, {"w": "the", "b": [0.5099, 0.3094, 0.5407, 0.3291]}, {"w": "task.", "b": [0.547, 0.3094, 0.5939, 0.3291]}, {"w": "For", "b": [0.6003, 0.3094, 0.6353, 0.3291]}, {"w": "instance,", "b": [0.6416, 0.3094, 0.7306, 0.3291]}, {"w": "if", "b": [0.7369, 0.3094, 0.7523, 0.3291]}, {"w": "you", "b": [0.7586, 0.3094, 0.7964, 0.3291]}, {"w": "wished", "b": [0.1294, 0.3299, 0.2009, 0.3496]}, {"w": "to", "b": [0.2072, 0.3299, 0.2268, 0.3496]}, {"w": "automate", "b": [0.2331, 0.3299, 0.3256, 0.3496]}, {"w": "the", "b": [0.3319, 0.3299, 0.3627, 0.3496]}, {"w": "task", "b": [0.369, 0.3299, 0.4097, 0.3496]}, {"w": "of", "b": [0.416, 0.3299, 0.437, 0.3496]}, {"w": "tagging", "b": [0.4433, 0.3299, 0.519, 0.3496]}, {"w": "your", "b": [0.5253, 0.3299, 0.5715, 0.3496]}, {"w": "vacation", "b": [0.5778, 0.3299, 0.6633, 0.3496]}, {"w": "pictures,", "b": [0.6696, 0.3299, 0.7558, 0.3496]}, {"w": "you", "b": [0.7621, 0.3299, 0.7999, 0.3496]}, {"w": "could", "b": [0.8062, 0.3299, 0.8623, 0.3496]}, {"w": "present", "b": [0.1294, 0.3504, 0.2023, 0.3701]}, {"w": "a", "b": [0.2086, 0.3504, 0.2198, 0.3701]}, {"w": "machine-learning", "b": [0.2261, 0.3504, 0.4026, 0.3701]}, {"w": "system", "b": [0.4089, 0.3504, 0.479, 0.3701]}, {"w": "with", "b": [0.4853, 0.3504, 0.5301, 0.3701]}, {"w": "many", "b": [0.5365, 0.3504, 0.5925, 0.3701]}, {"w": "examples", "b": [0.5988, 0.3504, 0.6941, 0.3701]}, {"w": "of", "b": [0.7004, 0.3504, 0.7214, 0.3701]}, {"w": "pictures", "b": [0.7276, 0.3504, 0.8075, 0.3701]}, {"w": "already", "b": [0.1294, 0.3709, 0.2037, 0.3906]}, {"w": "tagged", "b": [0.21, 0.3709, 0.2772, 0.3906]}, {"w": "by", "b": [0.2835, 0.3709, 0.3087, 0.3906]}, {"w": "humans,", "b": [0.315, 0.3709, 0.3998, 0.3906]}, {"w": "and", "b": [0.4061, 0.3709, 0.4426, 0.3906]}, {"w": "the", "b": [0.4489, 0.3709, 0.4797, 0.3906]}, {"w": "system", "b": [0.486, 0.3709, 0.5561, 0.3906]}, {"w": "would", "b": [0.5624, 0.3709, 0.6255, 0.3906]}, {"w": "learn", "b": [0.6318, 0.3709, 0.6822, 0.3906]}, {"w": "statistical", "b": [0.6885, 0.3709, 0.7838, 0.3906]}, {"w": "rules", "b": [0.7901, 0.3709, 0.8391, 0.3906]}, {"w": "for", "b": [0.1294, 0.3914, 0.1588, 0.4111]}, {"w": "associating", "b": [0.1651, 0.3914, 0.2772, 0.4111]}, {"w": "specific", "b": [0.2835, 0.3914, 0.362, 0.4111]}, {"w": "pictures", "b": [0.3683, 0.3914, 0.4482, 0.4111]}, {"w": "to", "b": [0.4545, 0.3914, 0.4741, 0.4111]}, {"w": "specific", "b": [0.4804, 0.3914, 0.5589, 0.4111]}, {"w": "tags.", "b": [0.5651, 0.3914, 0.612, 0.4111]}]}, {"id": "b_1", "type": "paragraph", "text": "Although machine learning only started to flourish in the 1990s, it has quickly become the most popular and most successful subfield of AI, a trend driven by the availability of faster hardware and larger datasets. Machine learning is tightly related to mathematical statistics, but it differs from statistics in several important ways. Unlike statistics, machine learning tends to deal with large, complex datasets (such as a dataset of millions of images, each consisting of tens of thousands of pixels) for which classical statistical analysis such as Bayesian analysis would be impractical. As a result, machine learning, and especially deep learning, exhibits comparatively little mathematical theory—maybe too little—and is engineering oriented. It’s a hands-on discipline in which ideas are proven empirically more often than theoretically.", "words": [{"w": "Although", "b": [0.1294, 0.4342, 0.2247, 0.4539]}, {"w": "machine", "b": [0.231, 0.4342, 0.3165, 0.4539]}, {"w": "learning", "b": [0.3228, 0.4342, 0.4055, 0.4539]}, {"w": "only", "b": [0.4118, 0.4342, 0.4566, 0.4539]}, {"w": "started", "b": [0.4629, 0.4342, 0.5302, 0.4539]}, {"w": "to", "b": [0.5365, 0.4342, 0.5561, 0.4539]}, {"w": "flourish", "b": [0.5624, 0.4342, 0.6409, 0.4539]}, {"w": "in", "b": [0.6472, 0.4342, 0.6668, 0.4539]}, {"w": "the", "b": [0.6731, 0.4342, 0.704, 0.4539]}, {"w": "1990s,", "b": [0.7103, 0.4342, 0.7768, 0.4539]}, {"w": "it", "b": [0.7831, 0.4342, 0.7972, 0.4539]}, {"w": "has", "b": [0.8035, 0.4342, 0.8371, 0.4539]}, {"w": "quickly", "b": [0.1294, 0.4547, 0.2051, 0.4744]}, {"w": "become", "b": [0.2114, 0.4547, 0.2898, 0.4744]}, {"w": "the", "b": [0.2962, 0.4547, 0.327, 0.4744]}, {"w": "most", "b": [0.3333, 0.4547, 0.3824, 0.4744]}, {"w": "popular", "b": [0.3887, 0.4547, 0.4657, 0.4744]}, {"w": "and", "b": [0.472, 0.4547, 0.5085, 0.4744]}, {"w": "most", "b": [0.5148, 0.4547, 0.5638, 0.4744]}, {"w": "successful", "b": [0.5701, 0.4547, 0.6738, 0.4744]}, {"w": "subfield", "b": [0.68, 0.4547, 0.7613, 0.4744]}, {"w": "of", "b": [0.7676, 0.4547, 0.7886, 0.4744]}, {"w": "AI,", "b": [0.7949, 0.4547, 0.8279, 0.4744]}, {"w": "a", "b": [0.8342, 0.4547, 0.8454, 0.4744]}, {"w": "trend", "b": [0.1294, 0.4752, 0.1813, 0.4949]}, {"w": "driven", "b": [0.1876, 0.4752, 0.252, 0.4949]}, {"w": "by", "b": [0.2583, 0.4752, 0.2835, 0.4949]}, {"w": "the", "b": [0.2898, 0.4752, 0.3207, 0.4949]}, {"w": "availability", "b": [0.327, 0.4752, 0.4405, 0.4949]}, {"w": "of", "b": [0.4468, 0.4752, 0.4678, 0.4949]}, {"w": "faster", "b": [0.4741, 0.4752, 0.5301, 0.4949]}, {"w": "hardware", "b": [0.5365, 0.4752, 0.6303, 0.4949]}, {"w": "and", "b": [0.6366, 0.4752, 0.673, 0.4949]}, {"w": "larger", "b": [0.6793, 0.4752, 0.7376, 0.4949]}, {"w": "datasets.", "b": [0.7439, 0.4752, 0.8301, 0.4949]}, {"w": "Machine", "b": [0.1294, 0.4957, 0.2177, 0.5154]}, {"w": "learning", "b": [0.224, 0.4957, 0.3066, 0.5154]}, {"w": "is", "b": [0.313, 0.4957, 0.3298, 0.5154]}, {"w": "tightly", "b": [0.3361, 0.4957, 0.402, 0.5154]}, {"w": "related", "b": [0.4083, 0.4957, 0.4769, 0.5154]}, {"w": "to", "b": [0.4832, 0.4957, 0.5028, 0.5154]}, {"w": "mathematical", "b": [0.5091, 0.4957, 0.645, 0.5154]}, {"w": "statistics,", "b": [0.6513, 0.4957, 0.7445, 0.5154]}, {"w": "but", "b": [0.7508, 0.4957, 0.7831, 0.5154]}, {"w": "it", "b": [0.7894, 0.4957, 0.8034, 0.5154]}, {"w": "differs", "b": [0.1294, 0.5162, 0.1948, 0.5359]}, {"w": "from", "b": [0.2011, 0.5162, 0.2501, 0.5359]}, {"w": "statistics", "b": [0.2564, 0.5162, 0.3433, 0.5359]}, {"w": "in", "b": [0.3497, 0.5162, 0.3693, 0.5359]}, {"w": "several", "b": [0.3756, 0.5162, 0.447, 0.5359]}, {"w": "important", "b": [0.4533, 0.5162, 0.5514, 0.5359]}, {"w": "ways.", "b": [0.5577, 0.5162, 0.6159, 0.5359]}, {"w": "Unlike", "b": [0.6222, 0.5162, 0.6909, 0.5359]}, {"w": "statistics,", "b": [0.6972, 0.5162, 0.7904, 0.5359]}, {"w": "machine", "b": [0.1294, 0.5367, 0.2149, 0.5564]}, {"w": "learning", "b": [0.2212, 0.5367, 0.3038, 0.5564]}, {"w": "tends", "b": [0.3101, 0.5367, 0.3634, 0.5564]}, {"w": "to", "b": [0.3697, 0.5367, 0.3893, 0.5564]}, {"w": "deal", "b": [0.3956, 0.5367, 0.4376, 0.5564]}, {"w": "with", "b": [0.4439, 0.5367, 0.4888, 0.5564]}, {"w": "large,", "b": [0.4951, 0.5367, 0.5513, 0.5564]}, {"w": "complex", "b": [0.5576, 0.5367, 0.6445, 0.5564]}, {"w": "datasets", "b": [0.6508, 0.5367, 0.7307, 0.5564]}, {"w": "(such", "b": [0.737, 0.5367, 0.7916, 0.5564]}, {"w": "as", "b": [0.7979, 0.5367, 0.819, 0.5564]}, {"w": "a", "b": [0.8253, 0.5367, 0.8365, 0.5564]}, {"w": "dataset", "b": [0.1294, 0.5572, 0.1995, 0.5769]}, {"w": "of", "b": [0.2058, 0.5572, 0.2268, 0.5769]}, {"w": "millions", "b": [0.2331, 0.5572, 0.3158, 0.5769]}, {"w": "of", "b": [0.3221, 0.5572, 0.3431, 0.5769]}, {"w": "images,", "b": [0.3494, 0.5572, 0.4272, 0.5769]}, {"w": "each", "b": [0.4335, 0.5572, 0.4797, 0.5769]}, {"w": "consisting", "b": [0.486, 0.5572, 0.5883, 0.5769]}, {"w": "of", "b": [0.5947, 0.5572, 0.6157, 0.5769]}, {"w": "tens", "b": [0.622, 0.5572, 0.6626, 0.5769]}, {"w": "of", "b": [0.6689, 0.5572, 0.6899, 0.5769]}, {"w": "thousands", "b": [0.6962, 0.5572, 0.7971, 0.5769]}, {"w": "of", "b": [0.8034, 0.5572, 0.8244, 0.5769]}, {"w": "pixels)", "b": [0.1294, 0.5777, 0.1981, 0.5974]}, {"w": "for", "b": [0.2044, 0.5777, 0.2338, 0.5974]}, {"w": "which", "b": [0.2401, 0.5777, 0.3018, 0.5974]}, {"w": "classical", "b": [0.3081, 0.5777, 0.3935, 0.5974]}, {"w": "statistical", "b": [0.3998, 0.5777, 0.4951, 0.5974]}, {"w": "analysis", "b": [0.5014, 0.5777, 0.5827, 0.5974]}, {"w": "such", "b": [0.589, 0.5777, 0.6353, 0.5974]}, {"w": "as", "b": [0.6416, 0.5777, 0.6626, 0.5974]}, {"w": "Bayesian", "b": [0.6689, 0.5777, 0.7614, 0.5974]}, {"w": "analysis", "b": [0.7677, 0.5777, 0.849, 0.5974]}, {"w": "would", "b": [0.1294, 0.5982, 0.1925, 0.6179]}, {"w": "be", "b": [0.1988, 0.5982, 0.2226, 0.6179]}, {"w": "impractical.", "b": [0.2289, 0.5982, 0.3487, 0.6179]}, {"w": "As", "b": [0.355, 0.5982, 0.383, 0.6179]}, {"w": "a", "b": [0.3893, 0.5982, 0.4005, 0.6179]}, {"w": "result,", "b": [0.4068, 0.5982, 0.4692, 0.6179]}, {"w": "machine", "b": [0.4755, 0.5982, 0.561, 0.6179]}, {"w": "learning,", "b": [0.5673, 0.5982, 0.6563, 0.6179]}, {"w": "and", "b": [0.6625, 0.5982, 0.6989, 0.6179]}, {"w": "especially", "b": [0.7052, 0.5982, 0.8061, 0.6179]}, {"w": "deep", "b": [0.8124, 0.5982, 0.86, 0.6179]}, {"w": "learning,", "b": [0.1294, 0.6187, 0.2184, 0.6384]}, {"w": "exhibits", "b": [0.2247, 0.6187, 0.3046, 0.6384]}, {"w": "comparatively", "b": [0.3109, 0.6187, 0.4552, 0.6384]}, {"w": "little", "b": [0.4615, 0.6187, 0.5078, 0.6384]}, {"w": "mathematical", "b": [0.5141, 0.6187, 0.65, 0.6384]}, {"w": "theory—maybe", "b": [0.6563, 0.6187, 0.8132, 0.6384]}, {"w": "too", "b": [0.8195, 0.6187, 0.8518, 0.6384]}, {"w": "little—and", "b": [0.1294, 0.6392, 0.2373, 0.6589]}, {"w": "is", "b": [0.2436, 0.6392, 0.2605, 0.6589]}, {"w": "engineering", "b": [0.2668, 0.6392, 0.3859, 0.6589]}, {"w": "oriented.", "b": [0.3922, 0.6392, 0.4811, 0.6589]}, {"w": "It’s", "b": [0.4874, 0.6392, 0.5196, 0.6589]}, {"w": "a", "b": [0.5259, 0.6392, 0.5371, 0.6589]}, {"w": "hands-on", "b": [0.5434, 0.6392, 0.6359, 0.6589]}, {"w": "discipline", "b": [0.6422, 0.6392, 0.7403, 0.6589]}, {"w": "in", "b": [0.7466, 0.6392, 0.7662, 0.6589]}, {"w": "which", "b": [0.7725, 0.6392, 0.8342, 0.6589]}, {"w": "ideas", "b": [0.1294, 0.6597, 0.1813, 0.6794]}, {"w": "are", "b": [0.1876, 0.6597, 0.2184, 0.6794]}, {"w": "proven", "b": [0.2247, 0.6597, 0.2947, 0.6794]}, {"w": "empirically", "b": [0.301, 0.6597, 0.4159, 0.6794]}, {"w": "more", "b": [0.4222, 0.6597, 0.4741, 0.6794]}, {"w": "often", "b": [0.4804, 0.6597, 0.5322, 0.6794]}, {"w": "than", "b": [0.5385, 0.6597, 0.582, 0.6794]}, {"w": "theoretically.", "b": [0.5883, 0.6597, 0.7189, 0.6794]}]}, {"id": "b_2", "type": "paragraph", "text": "1.1.3. Learning representations from data", "words": [{"w": "1.1.3.", "b": [0.1294, 0.7069, 0.1862, 0.7267]}, {"w": "Learning", "b": [0.1925, 0.7069, 0.292, 0.7267]}, {"w": "representations", "b": [0.2983, 0.7069, 0.4641, 0.7267]}, {"w": "from", "b": [0.4704, 0.7069, 0.5232, 0.7267]}, {"w": "data", "b": [0.5295, 0.7069, 0.5772, 0.7267]}]}, {"id": "b_3", "type": "paragraph", "text": "To define deep learning and understand the difference between deep learning and other machine-learning approaches, first we need some idea of what machine--learning algorithms do. I just stated that machine learning discovers rules to execute a data-processing task, given examples of what’s expected. So, to do machine learning, we need three things:", "words": [{"w": "To", "b": [0.1294, 0.7497, 0.1557, 0.7694]}, {"w": "define", "b": [0.162, 0.7497, 0.225, 0.7694]}, {"w": "deep", "b": [0.2313, 0.7497, 0.2789, 0.7694]}, {"w": "learning", "b": [0.2852, 0.7497, 0.3707, 0.7694]}, {"w": "and", "b": [0.377, 0.7497, 0.4134, 0.7694]}, {"w": "understand", "b": [0.4197, 0.7497, 0.5304, 0.7694]}, {"w": "the", "b": [0.5367, 0.7497, 0.5676, 0.7694]}, {"w": "difference", "b": [0.5739, 0.7497, 0.6756, 0.7694]}, {"w": "between", "b": [0.6819, 0.7497, 0.766, 0.7694]}, {"w": "deep", "b": [0.7723, 0.7497, 0.8199, 0.7694]}, {"w": "learning", "b": [0.1294, 0.7702, 0.2121, 0.7899]}, {"w": "and", "b": [0.2184, 0.7702, 0.2548, 0.7899]}, {"w": "other", "b": [0.2611, 0.7702, 0.313, 0.7899]}, {"w": "machine-learning", "b": [0.3193, 0.7702, 0.4958, 0.7899]}, {"w": "approaches,", "b": [0.5021, 0.7702, 0.6219, 0.7899]}, {"w": "first", "b": [0.6282, 0.7702, 0.6688, 0.7899]}, {"w": "we", "b": [0.6751, 0.7702, 0.7045, 0.7899]}, {"w": "need", "b": [0.7108, 0.7702, 0.7585, 0.7899]}, {"w": "some", "b": [0.7648, 0.7702, 0.818, 0.7899]}, {"w": "idea", "b": [0.8243, 0.7702, 0.8664, 0.7899]}, {"w": "of", "b": [0.1294, 0.7907, 0.1504, 0.8104]}, {"w": "what", "b": [0.1567, 0.7907, 0.2058, 0.8104]}, {"w": "machine--learning", "b": [0.2121, 0.7907, 0.397, 0.8104]}, {"w": "algorithms", "b": [0.4033, 0.7907, 0.5112, 0.8104]}, {"w": "do.", "b": [0.5175, 0.7907, 0.549, 0.8104]}, {"w": "I", "b": [0.5553, 0.7907, 0.5637, 0.8104]}, {"w": "just", "b": [0.57, 0.7907, 0.6065, 0.8104]}, {"w": "stated", "b": [0.6128, 0.7907, 0.6716, 0.8104]}, {"w": "that", "b": [0.6779, 0.7907, 0.7158, 0.8104]}, {"w": "machine", "b": [0.7221, 0.7907, 0.8075, 0.8104]}, {"w": "learning", "b": [0.1294, 0.8112, 0.2121, 0.8309]}, {"w": "discovers", "b": [0.2184, 0.8112, 0.3137, 0.8309]}, {"w": "rules", "b": [0.32, 0.8112, 0.369, 0.8309]}, {"w": "to", "b": [0.3753, 0.8112, 0.3949, 0.8309]}, {"w": "execute", "b": [0.4012, 0.8112, 0.4783, 0.8309]}, {"w": "a", "b": [0.4846, 0.8112, 0.4958, 0.8309]}, {"w": "data-processing", "b": [0.5021, 0.8112, 0.6604, 0.8309]}, {"w": "task,", "b": [0.6667, 0.8112, 0.7137, 0.8309]}, {"w": "given", "b": [0.72, 0.8112, 0.776, 0.8309]}, {"w": "examples", "b": [0.1294, 0.8317, 0.2247, 0.8514]}, {"w": "of", "b": [0.231, 0.8317, 0.252, 0.8514]}, {"w": "what’s", "b": [0.2583, 0.8317, 0.3242, 0.8514]}, {"w": "expected.", "b": [0.3305, 0.8317, 0.4264, 0.8514]}, {"w": "So,", "b": [0.4327, 0.8317, 0.4657, 0.8514]}, {"w": "to", "b": [0.472, 0.8317, 0.4916, 0.8514]}, {"w": "do", "b": [0.4979, 0.8317, 0.5231, 0.8514]}, {"w": "machine", "b": [0.5294, 0.8317, 0.6149, 0.8514]}, {"w": "learning,", "b": [0.6212, 0.8317, 0.7102, 0.8514]}, {"w": "we", "b": [0.7165, 0.8317, 0.7459, 0.8514]}, {"w": "need", "b": [0.7522, 0.8317, 0.7998, 0.8514]}, {"w": "three", "b": [0.8061, 0.8317, 0.8566, 0.8514]}, {"w": "things:", "b": [0.1294, 0.8522, 0.1981, 0.8719]}]}]}, {"page": 33, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Input data points— For instance, if the task is speech recognition, these data points could be sound files of people speaking. If the task is image tagging, they could be pictures. Examples of the expected output— In a speech-recognition task, these could be human-generated transcripts of sound files. In an image task, expected outputs could be tags such as “dog,” “cat,” and so on. A way to measure whether the algorithm is doing a good job— This is necessary in order to determine the distance between the algorithm’s current output and its expected output. The measurement is used as a feedback signal to adjust the way the algorithm works. This adjustment step is what we call learning.", "words": [{"w": "Input", "b": [0.1799, 0.0857, 0.2374, 0.1054]}, {"w": "data", "b": [0.2437, 0.0857, 0.2885, 0.1054]}, {"w": "points—", "b": [0.2948, 0.0857, 0.3831, 0.1054]}, {"w": "For", "b": [0.3894, 0.0857, 0.4245, 0.1054]}, {"w": "instance,", "b": [0.4308, 0.0857, 0.5198, 0.1054]}, {"w": "if", "b": [0.5261, 0.0857, 0.5415, 0.1054]}, {"w": "the", "b": [0.5478, 0.0857, 0.5786, 0.1054]}, {"w": "task", "b": [0.5849, 0.0857, 0.6255, 0.1054]}, {"w": "is", "b": [0.6319, 0.0857, 0.6487, 0.1054]}, {"w": "speech", "b": [0.655, 0.0857, 0.7236, 0.1054]}, {"w": "recognition,", "b": [0.7299, 0.0857, 0.8511, 0.1054]}, {"w": "these", "b": [0.1799, 0.1062, 0.2317, 0.1259]}, {"w": "data", "b": [0.238, 0.1062, 0.28, 0.1259]}, {"w": "points", "b": [0.2863, 0.1062, 0.348, 0.1259]}, {"w": "could", "b": [0.3543, 0.1062, 0.4104, 0.1259]}, {"w": "be", "b": [0.4167, 0.1062, 0.4405, 0.1259]}, {"w": "sound", "b": [0.4468, 0.1062, 0.5071, 0.1259]}, {"w": "files", "b": [0.5134, 0.1062, 0.5568, 0.1259]}, {"w": "of", "b": [0.5631, 0.1062, 0.5841, 0.1259]}, {"w": "people", "b": [0.5904, 0.1062, 0.6577, 0.1259]}, {"w": "speaking.", "b": [0.664, 0.1062, 0.76, 0.1259]}, {"w": "If", "b": [0.7663, 0.1062, 0.7831, 0.1259]}, {"w": "the", "b": [0.7894, 0.1062, 0.8202, 0.1259]}, {"w": "task", "b": [0.8265, 0.1062, 0.8672, 0.1259]}, {"w": "is", "b": [0.1799, 0.1267, 0.1967, 0.1464]}, {"w": "image", "b": [0.203, 0.1267, 0.2646, 0.1464]}, {"w": "tagging,", "b": [0.2709, 0.1267, 0.3529, 0.1464]}, {"w": "they", "b": [0.3592, 0.1267, 0.4027, 0.1464]}, {"w": "could", "b": [0.409, 0.1267, 0.465, 0.1464]}, {"w": "be", "b": [0.4713, 0.1267, 0.4951, 0.1464]}, {"w": "pictures.", "b": [0.5015, 0.1267, 0.5876, 0.1464]}, {"w": "Examples", "b": [0.1799, 0.1472, 0.2822, 0.1669]}, {"w": "of", "b": [0.2885, 0.1472, 0.3095, 0.1669]}, {"w": "the", "b": [0.3158, 0.1472, 0.348, 0.1669]}, {"w": "expected", "b": [0.3544, 0.1472, 0.444, 0.1669]}, {"w": "output—", "b": [0.4503, 0.1472, 0.5428, 0.1669]}, {"w": "In", "b": [0.5491, 0.1472, 0.5701, 0.1669]}, {"w": "a", "b": [0.5764, 0.1472, 0.5876, 0.1669]}, {"w": "speech-recognition", "b": [0.5939, 0.1472, 0.7859, 0.1669]}, {"w": "task,", "b": [0.7922, 0.1472, 0.8391, 0.1669]}, {"w": "these", "b": [0.1799, 0.1677, 0.2317, 0.1874]}, {"w": "could", "b": [0.238, 0.1677, 0.2941, 0.1874]}, {"w": "be", "b": [0.3004, 0.1677, 0.3242, 0.1874]}, {"w": "human-generated", "b": [0.3305, 0.1677, 0.5056, 0.1874]}, {"w": "transcripts", "b": [0.5119, 0.1677, 0.617, 0.1874]}, {"w": "of", "b": [0.6233, 0.1677, 0.6443, 0.1874]}, {"w": "sound", "b": [0.6506, 0.1677, 0.7109, 0.1874]}, {"w": "files.", "b": [0.7172, 0.1677, 0.7669, 0.1874]}, {"w": "In", "b": [0.7732, 0.1677, 0.7943, 0.1874]}, {"w": "an", "b": [0.8006, 0.1677, 0.8244, 0.1874]}, {"w": "image", "b": [0.1799, 0.1882, 0.2415, 0.2079]}, {"w": "task,", "b": [0.2478, 0.1882, 0.2948, 0.2079]}, {"w": "expected", "b": [0.3011, 0.1882, 0.3907, 0.2079]}, {"w": "outputs", "b": [0.397, 0.1882, 0.4713, 0.2079]}, {"w": "could", "b": [0.4776, 0.1882, 0.5336, 0.2079]}, {"w": "be", "b": [0.5399, 0.1882, 0.5637, 0.2079]}, {"w": "tags", "b": [0.57, 0.1882, 0.6107, 0.2079]}, {"w": "such", "b": [0.617, 0.1882, 0.6632, 0.2079]}, {"w": "as", "b": [0.6695, 0.1882, 0.6905, 0.2079]}, {"w": "“dog,”", "b": [0.6969, 0.1882, 0.7634, 0.2079]}, {"w": "“cat,”", "b": [0.7697, 0.1882, 0.8278, 0.2079]}, {"w": "and", "b": [0.8341, 0.1882, 0.8706, 0.2079]}, {"w": "so", "b": [0.1799, 0.2087, 0.2023, 0.2284]}, {"w": "on.", "b": [0.2086, 0.2087, 0.2401, 0.2284]}, {"w": "A", "b": [0.1799, 0.2292, 0.1967, 0.2489]}, {"w": "way", "b": [0.203, 0.2292, 0.2436, 0.2489]}, {"w": "to", "b": [0.2499, 0.2292, 0.2696, 0.2489]}, {"w": "measure", "b": [0.2759, 0.2292, 0.3642, 0.2489]}, {"w": "whether", "b": [0.3705, 0.2292, 0.4546, 0.2489]}, {"w": "the", "b": [0.4609, 0.2292, 0.4931, 0.2489]}, {"w": "algorithm", "b": [0.4994, 0.2292, 0.6018, 0.2489]}, {"w": "is", "b": [0.6081, 0.2292, 0.6249, 0.2489]}, {"w": "doing", "b": [0.6312, 0.2292, 0.6901, 0.2489]}, {"w": "a", "b": [0.6964, 0.2292, 0.709, 0.2489]}, {"w": "good", "b": [0.7153, 0.2292, 0.7658, 0.2489]}, {"w": "job—", "b": [0.7721, 0.2292, 0.8295, 0.2489]}, {"w": "This", "b": [0.1799, 0.2497, 0.2247, 0.2694]}, {"w": "is", "b": [0.231, 0.2497, 0.2478, 0.2694]}, {"w": "necessary", "b": [0.2542, 0.2497, 0.3522, 0.2694]}, {"w": "in", "b": [0.3585, 0.2497, 0.3781, 0.2694]}, {"w": "order", "b": [0.3844, 0.2497, 0.4377, 0.2694]}, {"w": "to", "b": [0.444, 0.2497, 0.4636, 0.2694]}, {"w": "determine", "b": [0.4699, 0.2497, 0.5708, 0.2694]}, {"w": "the", "b": [0.5771, 0.2497, 0.6079, 0.2694]}, {"w": "distance", "b": [0.6142, 0.2497, 0.6969, 0.2694]}, {"w": "between", "b": [0.7032, 0.2497, 0.7872, 0.2694]}, {"w": "the", "b": [0.7936, 0.2497, 0.8244, 0.2694]}, {"w": "algorithm’s", "b": [0.1799, 0.2702, 0.2948, 0.2899]}, {"w": "current", "b": [0.3011, 0.2702, 0.3725, 0.2899]}, {"w": "output", "b": [0.3788, 0.2702, 0.4433, 0.2899]}, {"w": "and", "b": [0.4496, 0.2702, 0.486, 0.2899]}, {"w": "its", "b": [0.4923, 0.2702, 0.5162, 0.2899]}, {"w": "expected", "b": [0.5225, 0.2702, 0.6121, 0.2899]}, {"w": "output.", "b": [0.6184, 0.2702, 0.6892, 0.2899]}, {"w": "The", "b": [0.6955, 0.2702, 0.7348, 0.2899]}, {"w": "measurement", "b": [0.1799, 0.2907, 0.3144, 0.3104]}, {"w": "is", "b": [0.3206, 0.2907, 0.3375, 0.3104]}, {"w": "used", "b": [0.3438, 0.2907, 0.39, 0.3104]}, {"w": "as", "b": [0.3963, 0.2907, 0.4173, 0.3104]}, {"w": "a", "b": [0.4236, 0.2907, 0.4348, 0.3104]}, {"w": "feedback", "b": [0.4411, 0.2907, 0.5322, 0.3104]}, {"w": "signal", "b": [0.5385, 0.2907, 0.5987, 0.3104]}, {"w": "to", "b": [0.6051, 0.2907, 0.6247, 0.3104]}, {"w": "adjust", "b": [0.631, 0.2907, 0.6913, 0.3104]}, {"w": "the", "b": [0.6976, 0.2907, 0.7284, 0.3104]}, {"w": "way", "b": [0.7347, 0.2907, 0.7767, 0.3104]}, {"w": "the", "b": [0.783, 0.2907, 0.8138, 0.3104]}, {"w": "algorithm", "b": [0.1799, 0.3112, 0.278, 0.3309]}, {"w": "works.", "b": [0.2843, 0.3112, 0.3522, 0.3309]}, {"w": "This", "b": [0.3585, 0.3112, 0.4034, 0.3309]}, {"w": "adjustment", "b": [0.4097, 0.3112, 0.5204, 0.3309]}, {"w": "step", "b": [0.5267, 0.3112, 0.5674, 0.3309]}, {"w": "is", "b": [0.5737, 0.3112, 0.5905, 0.3309]}, {"w": "what", "b": [0.5968, 0.3112, 0.6458, 0.3309]}, {"w": "we", "b": [0.6521, 0.3112, 0.6816, 0.3309]}, {"w": "call", "b": [0.6879, 0.3112, 0.7243, 0.3309]}, {"w": "learning.", "b": [0.7305, 0.3112, 0.8223, 0.3309]}]}, {"id": "b_1", "type": "paragraph", "text": "A machine-learning model transforms its input data into meaningful outputs, a process that is “learned” from exposure to known examples of inputs and outputs. Therefore, the central problem in machine learning and deep learning is to meaningfully transform data: in other words, to learn useful representations of the input data at hand—representations that get us closer to the expected output. Before we go any further: what’s a representation? At its core, it’s a different way to look at data— to represent or encode data. For instance, a color image can be encoded in the RGB format (red-green-blue) or in the HSV format (hue- saturation-value): these are two different representations of the same data. Some tasks that may be difficult with one representation can become easy with another. For example, the task “select all red pixels in the image” is simpler in the RG format, whereas “make the image less saturated” is simpler in the HSV format. Machine-learning models are all about finding appropriate representations for their input data— transformations of the data that make it more amenable to the task at hand, such as a classification task.", "words": [{"w": "A", "b": [0.1294, 0.354, 0.1476, 0.3737]}, {"w": "machine-learning", "b": [0.1539, 0.354, 0.3305, 0.3737]}, {"w": "model", "b": [0.3368, 0.354, 0.3998, 0.3737]}, {"w": "transforms", "b": [0.4061, 0.354, 0.514, 0.3737]}, {"w": "its", "b": [0.5203, 0.354, 0.5442, 0.3737]}, {"w": "input", "b": [0.5505, 0.354, 0.6023, 0.3737]}, {"w": "data", "b": [0.6087, 0.354, 0.6507, 0.3737]}, {"w": "into", "b": [0.657, 0.354, 0.6962, 0.3737]}, {"w": "meaningful", "b": [0.7025, 0.354, 0.8174, 0.3737]}, {"w": "outputs,", "b": [0.1294, 0.3745, 0.21, 0.3942]}, {"w": "a", "b": [0.2163, 0.3745, 0.2275, 0.3942]}, {"w": "process", "b": [0.2338, 0.3745, 0.3095, 0.3942]}, {"w": "that", "b": [0.3158, 0.3745, 0.3536, 0.3942]}, {"w": "is", "b": [0.3599, 0.3745, 0.3768, 0.3942]}, {"w": "“learned”", "b": [0.3831, 0.3745, 0.4797, 0.3942]}, {"w": "from", "b": [0.486, 0.3745, 0.535, 0.3942]}, {"w": "exposure", "b": [0.5413, 0.3745, 0.6324, 0.3942]}, {"w": "to", "b": [0.6387, 0.3745, 0.6583, 0.3942]}, {"w": "known", "b": [0.6647, 0.3745, 0.7333, 0.3942]}, {"w": "examples", "b": [0.7396, 0.3745, 0.8348, 0.3942]}, {"w": "of", "b": [0.8411, 0.3745, 0.8622, 0.3942]}, {"w": "inputs", "b": [0.1294, 0.395, 0.1911, 0.4147]}, {"w": "and", "b": [0.1974, 0.395, 0.2338, 0.4147]}, {"w": "outputs.", "b": [0.2401, 0.395, 0.3207, 0.4147]}, {"w": "Therefore,", "b": [0.327, 0.395, 0.4328, 0.4147]}, {"w": "the", "b": [0.4391, 0.395, 0.4699, 0.4147]}, {"w": "central", "b": [0.4762, 0.395, 0.5449, 0.4147]}, {"w": "problem", "b": [0.5512, 0.395, 0.6352, 0.4147]}, {"w": "in", "b": [0.6415, 0.395, 0.6612, 0.4147]}, {"w": "machine", "b": [0.6675, 0.395, 0.7529, 0.4147]}, {"w": "learning", "b": [0.7592, 0.395, 0.8419, 0.4147]}, {"w": "and", "b": [0.1294, 0.4155, 0.1658, 0.4352]}, {"w": "deep", "b": [0.1721, 0.4155, 0.2198, 0.4352]}, {"w": "learning", "b": [0.2261, 0.4155, 0.3087, 0.4352]}, {"w": "is", "b": [0.315, 0.4155, 0.3319, 0.4352]}, {"w": "to", "b": [0.3382, 0.4155, 0.3578, 0.4352]}, {"w": "meaningfully", "b": [0.3641, 0.4155, 0.4958, 0.4352]}, {"w": "transform", "b": [0.5021, 0.4155, 0.6016, 0.4352]}, {"w": "data:", "b": [0.6079, 0.4155, 0.6598, 0.4352]}, {"w": "in", "b": [0.6661, 0.4155, 0.6857, 0.4352]}, {"w": "other", "b": [0.692, 0.4155, 0.7438, 0.4352]}, {"w": "words,", "b": [0.7501, 0.4155, 0.8181, 0.4352]}, {"w": "to", "b": [0.8244, 0.4155, 0.844, 0.4352]}, {"w": "learn", "b": [0.1294, 0.436, 0.1798, 0.4557]}, {"w": "useful", "b": [0.1861, 0.436, 0.2478, 0.4557]}, {"w": "representations", "b": [0.2541, 0.436, 0.4092, 0.4557]}, {"w": "of", "b": [0.4154, 0.436, 0.4365, 0.4557]}, {"w": "the", "b": [0.4428, 0.436, 0.4736, 0.4557]}, {"w": "input", "b": [0.4799, 0.436, 0.5318, 0.4557]}, {"w": "data", "b": [0.5381, 0.436, 0.5801, 0.4557]}, {"w": "at", "b": [0.5864, 0.436, 0.6046, 0.4557]}, {"w": "hand—representations", "b": [0.6109, 0.436, 0.8379, 0.4557]}, {"w": "that", "b": [0.1294, 0.4565, 0.1673, 0.4762]}, {"w": "get", "b": [0.1736, 0.4565, 0.2044, 0.4762]}, {"w": "us", "b": [0.2107, 0.4565, 0.2331, 0.4762]}, {"w": "closer", "b": [0.2394, 0.4565, 0.2997, 0.4762]}, {"w": "to", "b": [0.306, 0.4565, 0.3256, 0.4762]}, {"w": "the", "b": [0.3319, 0.4565, 0.3627, 0.4762]}, {"w": "expected", "b": [0.369, 0.4565, 0.4587, 0.4762]}, {"w": "output.", "b": [0.465, 0.4565, 0.5358, 0.4762]}, {"w": "Before", "b": [0.5421, 0.4565, 0.6107, 0.4762]}, {"w": "we", "b": [0.617, 0.4565, 0.6464, 0.4762]}, {"w": "go", "b": [0.6527, 0.4565, 0.678, 0.4762]}, {"w": "any", "b": [0.6843, 0.4565, 0.7207, 0.4762]}, {"w": "further:", "b": [0.727, 0.4565, 0.8027, 0.4762]}, {"w": "what’s", "b": [0.1294, 0.477, 0.1953, 0.4967]}, {"w": "a", "b": [0.2016, 0.477, 0.2128, 0.4967]}, {"w": "representation?", "b": [0.2191, 0.477, 0.3732, 0.4967]}, {"w": "At", "b": [0.3795, 0.477, 0.4047, 0.4967]}, {"w": "its", "b": [0.411, 0.477, 0.4348, 0.4967]}, {"w": "core,", "b": [0.4411, 0.477, 0.4909, 0.4967]}, {"w": "it’s", "b": [0.4972, 0.477, 0.528, 0.4967]}, {"w": "a", "b": [0.5343, 0.477, 0.5455, 0.4967]}, {"w": "different", "b": [0.5518, 0.477, 0.6382, 0.4967]}, {"w": "way", "b": [0.6445, 0.477, 0.6865, 0.4967]}, {"w": "to", "b": [0.6928, 0.477, 0.7125, 0.4967]}, {"w": "look", "b": [0.7188, 0.477, 0.7636, 0.4967]}, {"w": "at", "b": [0.7699, 0.477, 0.7881, 0.4967]}, {"w": "data—", "b": [0.7944, 0.477, 0.8617, 0.4967]}, {"w": "to", "b": [0.1294, 0.4975, 0.149, 0.5172]}, {"w": "represent", "b": [0.1553, 0.4975, 0.2487, 0.5172]}, {"w": "or", "b": [0.255, 0.4975, 0.276, 0.5172]}, {"w": "encode", "b": [0.2823, 0.4975, 0.3538, 0.5172]}, {"w": "data.", "b": [0.3601, 0.4975, 0.4084, 0.5172]}, {"w": "For", "b": [0.4147, 0.4975, 0.4497, 0.5172]}, {"w": "instance,", "b": [0.4561, 0.4975, 0.545, 0.5172]}, {"w": "a", "b": [0.5513, 0.4975, 0.5625, 0.5172]}, {"w": "color", "b": [0.5688, 0.4975, 0.6207, 0.5172]}, {"w": "image", "b": [0.627, 0.4975, 0.6886, 0.5172]}, {"w": "can", "b": [0.6949, 0.4975, 0.73, 0.5172]}, {"w": "be", "b": [0.7363, 0.4975, 0.7601, 0.5172]}, {"w": "encoded", "b": [0.7664, 0.4975, 0.8504, 0.5172]}, {"w": "in", "b": [0.1294, 0.518, 0.149, 0.5377]}, {"w": "the", "b": [0.1553, 0.518, 0.1862, 0.5377]}, {"w": "RGB", "b": [0.1925, 0.518, 0.2443, 0.5377]}, {"w": "format", "b": [0.2506, 0.518, 0.3179, 0.5377]}, {"w": "(red-green-blue)", "b": [0.3242, 0.518, 0.4895, 0.5377]}, {"w": "or", "b": [0.4958, 0.518, 0.5168, 0.5377]}, {"w": "in", "b": [0.5231, 0.518, 0.5427, 0.5377]}, {"w": "the", "b": [0.549, 0.518, 0.5799, 0.5377]}, {"w": "HSV", "b": [0.5862, 0.518, 0.6366, 0.5377]}, {"w": "format", "b": [0.6429, 0.518, 0.7102, 0.5377]}, {"w": "(hue-", "b": [0.7165, 0.518, 0.7697, 0.5377]}, {"w": "saturation-value):", "b": [0.1294, 0.5385, 0.3074, 0.5582]}, {"w": "these", "b": [0.3136, 0.5385, 0.3655, 0.5582]}, {"w": "are", "b": [0.3718, 0.5385, 0.4026, 0.5582]}, {"w": "two", "b": [0.4089, 0.5385, 0.4467, 0.5582]}, {"w": "different", "b": [0.453, 0.5385, 0.5394, 0.5582]}, {"w": "representations", "b": [0.5457, 0.5385, 0.6984, 0.5582]}, {"w": "of", "b": [0.7047, 0.5385, 0.7257, 0.5582]}, {"w": "the", "b": [0.732, 0.5385, 0.7629, 0.5582]}, {"w": "same", "b": [0.7692, 0.5385, 0.821, 0.5582]}, {"w": "data.", "b": [0.1294, 0.559, 0.1777, 0.5787]}, {"w": "Some", "b": [0.1841, 0.559, 0.2415, 0.5787]}, {"w": "tasks", "b": [0.2478, 0.559, 0.2983, 0.5787]}, {"w": "that", "b": [0.3046, 0.559, 0.3424, 0.5787]}, {"w": "may", "b": [0.3487, 0.559, 0.3922, 0.5787]}, {"w": "be", "b": [0.3985, 0.559, 0.4223, 0.5787]}, {"w": "difficult", "b": [0.4286, 0.559, 0.5094, 0.5787]}, {"w": "with", "b": [0.5157, 0.559, 0.5605, 0.5787]}, {"w": "one", "b": [0.5668, 0.559, 0.6033, 0.5787]}, {"w": "representation", "b": [0.6096, 0.559, 0.7525, 0.5787]}, {"w": "can", "b": [0.7588, 0.559, 0.7938, 0.5787]}, {"w": "become", "b": [0.1294, 0.5795, 0.2079, 0.5992]}, {"w": "easy", "b": [0.2142, 0.5795, 0.259, 0.5992]}, {"w": "with", "b": [0.2653, 0.5795, 0.3101, 0.5992]}, {"w": "another.", "b": [0.3164, 0.5795, 0.397, 0.5992]}, {"w": "For", "b": [0.4033, 0.5795, 0.4383, 0.5992]}, {"w": "example,", "b": [0.4446, 0.5795, 0.5364, 0.5992]}, {"w": "the", "b": [0.5427, 0.5795, 0.5735, 0.5992]}, {"w": "task", "b": [0.5799, 0.5795, 0.6205, 0.5992]}, {"w": "“select", "b": [0.6268, 0.5795, 0.6954, 0.5992]}, {"w": "all", "b": [0.7017, 0.5795, 0.727, 0.5992]}, {"w": "red", "b": [0.7333, 0.5795, 0.7655, 0.5992]}, {"w": "pixels", "b": [0.7718, 0.5795, 0.8321, 0.5992]}, {"w": "in", "b": [0.8384, 0.5795, 0.858, 0.5992]}, {"w": "the", "b": [0.1294, 0.6, 0.1602, 0.6197]}, {"w": "image”", "b": [0.1665, 0.6, 0.2394, 0.6197]}, {"w": "is", "b": [0.2457, 0.6, 0.2625, 0.6197]}, {"w": "simpler", "b": [0.2688, 0.6, 0.3445, 0.6197]}, {"w": "in", "b": [0.3508, 0.6, 0.3704, 0.6197]}, {"w": "the", "b": [0.3768, 0.6, 0.4076, 0.6197]}, {"w": "RG", "b": [0.4139, 0.6, 0.4489, 0.6197]}, {"w": "format,", "b": [0.4552, 0.6, 0.5288, 0.6197]}, {"w": "whereas", "b": [0.5351, 0.6, 0.6177, 0.6197]}, {"w": "“make", "b": [0.624, 0.6, 0.6899, 0.6197]}, {"w": "the", "b": [0.6962, 0.6, 0.727, 0.6197]}, {"w": "image", "b": [0.7332, 0.6, 0.7949, 0.6197]}, {"w": "less", "b": [0.8012, 0.6, 0.839, 0.6197]}, {"w": "saturated”", "b": [0.1294, 0.6205, 0.2317, 0.6402]}, {"w": "is", "b": [0.238, 0.6205, 0.2548, 0.6402]}, {"w": "simpler", "b": [0.2611, 0.6205, 0.3368, 0.6402]}, {"w": "in", "b": [0.3431, 0.6205, 0.3627, 0.6402]}, {"w": "the", "b": [0.369, 0.6205, 0.3999, 0.6402]}, {"w": "HSV", "b": [0.4062, 0.6205, 0.4566, 0.6402]}, {"w": "format.", "b": [0.4629, 0.6205, 0.5365, 0.6402]}, {"w": "Machine-learning", "b": [0.5428, 0.6205, 0.7221, 0.6402]}, {"w": "models", "b": [0.7284, 0.6205, 0.8013, 0.6402]}, {"w": "are", "b": [0.8076, 0.6205, 0.8384, 0.6402]}, {"w": "all", "b": [0.8447, 0.6205, 0.8699, 0.6402]}, {"w": "about", "b": [0.1294, 0.641, 0.1855, 0.6607]}, {"w": "finding", "b": [0.1918, 0.641, 0.2646, 0.6607]}, {"w": "appropriate", "b": [0.271, 0.641, 0.3858, 0.6607]}, {"w": "representations", "b": [0.3921, 0.641, 0.5449, 0.6607]}, {"w": "for", "b": [0.5511, 0.641, 0.5805, 0.6607]}, {"w": "their", "b": [0.5868, 0.641, 0.6331, 0.6607]}, {"w": "input", "b": [0.6394, 0.641, 0.6912, 0.6607]}, {"w": "data—", "b": [0.6975, 0.641, 0.7648, 0.6607]}, {"w": "transformations", "b": [0.1294, 0.6615, 0.2878, 0.6812]}, {"w": "of", "b": [0.2941, 0.6615, 0.3151, 0.6812]}, {"w": "the", "b": [0.3214, 0.6615, 0.3522, 0.6812]}, {"w": "data", "b": [0.3585, 0.6615, 0.4005, 0.6812]}, {"w": "that", "b": [0.4068, 0.6615, 0.4447, 0.6812]}, {"w": "make", "b": [0.451, 0.6615, 0.5056, 0.6812]}, {"w": "it", "b": [0.5119, 0.6615, 0.526, 0.6812]}, {"w": "more", "b": [0.5323, 0.6615, 0.5841, 0.6812]}, {"w": "amenable", "b": [0.5904, 0.6615, 0.6871, 0.6812]}, {"w": "to", "b": [0.6934, 0.6615, 0.713, 0.6812]}, {"w": "the", "b": [0.7193, 0.6615, 0.7501, 0.6812]}, {"w": "task", "b": [0.7564, 0.6615, 0.7971, 0.6812]}, {"w": "at", "b": [0.8034, 0.6615, 0.8216, 0.6812]}, {"w": "hand,", "b": [0.1294, 0.682, 0.1848, 0.7017]}, {"w": "such", "b": [0.1911, 0.682, 0.2373, 0.7017]}, {"w": "as", "b": [0.2436, 0.682, 0.2646, 0.7017]}, {"w": "a", "b": [0.2709, 0.682, 0.2821, 0.7017]}, {"w": "classification", "b": [0.2884, 0.682, 0.4216, 0.7017]}, {"w": "task.", "b": [0.4278, 0.682, 0.4748, 0.7017]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s make this concrete. Consider an x-axis, a y-axis, and some points represented by their coordinates in the (x, y) system, as shown in figure 1.3.", "words": [{"w": "Let’s", "b": [0.1294, 0.7248, 0.1798, 0.7445]}, {"w": "make", "b": [0.1862, 0.7248, 0.2408, 0.7445]}, {"w": "this", "b": [0.2471, 0.7248, 0.2836, 0.7445]}, {"w": "concrete.", "b": [0.2899, 0.7248, 0.3816, 0.7445]}, {"w": "Consider", "b": [0.3879, 0.7248, 0.479, 0.7445]}, {"w": "an", "b": [0.4853, 0.7248, 0.5091, 0.7445]}, {"w": "x-axis,", "b": [0.5154, 0.7248, 0.5834, 0.7445]}, {"w": "a", "b": [0.5897, 0.7248, 0.6009, 0.7445]}, {"w": "y-axis,", "b": [0.6072, 0.7248, 0.6752, 0.7445]}, {"w": "and", "b": [0.6815, 0.7248, 0.7179, 0.7445]}, {"w": "some", "b": [0.7242, 0.7248, 0.7774, 0.7445]}, {"w": "points", "b": [0.7838, 0.7248, 0.8454, 0.7445]}, {"w": "represented", "b": [0.1294, 0.7453, 0.2457, 0.765]}, {"w": "by", "b": [0.252, 0.7453, 0.2772, 0.765]}, {"w": "their", "b": [0.2835, 0.7453, 0.3298, 0.765]}, {"w": "coordinates", "b": [0.3361, 0.7453, 0.4524, 0.765]}, {"w": "in", "b": [0.4587, 0.7453, 0.4783, 0.765]}, {"w": "the", "b": [0.4846, 0.7453, 0.5154, 0.765]}, {"w": "(x,", "b": [0.5217, 0.7453, 0.549, 0.765]}, {"w": "y)", "b": [0.5553, 0.7453, 0.5764, 0.765]}, {"w": "system,", "b": [0.5827, 0.7453, 0.6591, 0.765]}, {"w": "as", "b": [0.6653, 0.7453, 0.6863, 0.765]}, {"w": "shown", "b": [0.6926, 0.7453, 0.7585, 0.765]}, {"w": "in", "b": [0.7648, 0.7453, 0.7844, 0.765]}, {"w": "figure", "b": [0.7907, 0.7453, 0.8509, 0.765]}, {"w": "1.3.", "b": [0.1294, 0.7658, 0.1673, 0.7855]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 1.3. Some sample data", "words": [{"w": "Figure", "b": [0.1294, 0.8036, 0.1827, 0.8184]}, {"w": "1.3.", "b": [0.1874, 0.8036, 0.2158, 0.8184]}, {"w": "Some", "b": [0.2205, 0.8036, 0.2646, 0.8184]}, {"w": "sample", "b": [0.2693, 0.8036, 0.3261, 0.8184]}, {"w": "data", "b": [0.3308, 0.8036, 0.3666, 0.8184]}]}]}, {"page": 34, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As you can see, we have a few white points and a few black points. Let’s say we want to develop an algorithm that can take the coordinates (x, y) of a point and output whether that point is likely to be black or to be white. In this case,", "words": [{"w": "As", "b": [0.1294, 0.2755, 0.1574, 0.2953]}, {"w": "you", "b": [0.1637, 0.2755, 0.2016, 0.2953]}, {"w": "can", "b": [0.2079, 0.2755, 0.2429, 0.2953]}, {"w": "see,", "b": [0.2492, 0.2755, 0.2877, 0.2953]}, {"w": "we", "b": [0.294, 0.2755, 0.3234, 0.2953]}, {"w": "have", "b": [0.3298, 0.2755, 0.3774, 0.2953]}, {"w": "a", "b": [0.3837, 0.2755, 0.3949, 0.2953]}, {"w": "few", "b": [0.4012, 0.2755, 0.439, 0.2953]}, {"w": "white", "b": [0.4453, 0.2755, 0.5014, 0.2953]}, {"w": "points", "b": [0.5077, 0.2755, 0.5693, 0.2953]}, {"w": "and", "b": [0.5757, 0.2755, 0.6121, 0.2953]}, {"w": "a", "b": [0.6184, 0.2755, 0.6296, 0.2953]}, {"w": "few", "b": [0.6359, 0.2755, 0.6737, 0.2953]}, {"w": "black", "b": [0.68, 0.2755, 0.7347, 0.2953]}, {"w": "points.", "b": [0.741, 0.2755, 0.8089, 0.2953]}, {"w": "Let’s", "b": [0.8153, 0.2755, 0.8656, 0.2953]}, {"w": "say", "b": [0.1294, 0.296, 0.163, 0.3158]}, {"w": "we", "b": [0.1693, 0.296, 0.1988, 0.3158]}, {"w": "want", "b": [0.2051, 0.296, 0.2541, 0.3158]}, {"w": "to", "b": [0.2604, 0.296, 0.28, 0.3158]}, {"w": "develop", "b": [0.2863, 0.296, 0.3662, 0.3158]}, {"w": "an", "b": [0.3725, 0.296, 0.3963, 0.3158]}, {"w": "algorithm", "b": [0.4026, 0.296, 0.5007, 0.3158]}, {"w": "that", "b": [0.507, 0.296, 0.5449, 0.3158]}, {"w": "can", "b": [0.5512, 0.296, 0.5862, 0.3158]}, {"w": "take", "b": [0.5925, 0.296, 0.6345, 0.3158]}, {"w": "the", "b": [0.6407, 0.296, 0.6716, 0.3158]}, {"w": "coordinates", "b": [0.6779, 0.296, 0.7942, 0.3158]}, {"w": "(x,", "b": [0.8005, 0.296, 0.8278, 0.3158]}, {"w": "y)", "b": [0.8341, 0.296, 0.8551, 0.3158]}, {"w": "of", "b": [0.1294, 0.3165, 0.1504, 0.3363]}, {"w": "a", "b": [0.1567, 0.3165, 0.1679, 0.3363]}, {"w": "point", "b": [0.1742, 0.3165, 0.2261, 0.3363]}, {"w": "and", "b": [0.2324, 0.3165, 0.2688, 0.3363]}, {"w": "output", "b": [0.2751, 0.3165, 0.3396, 0.3363]}, {"w": "whether", "b": [0.3459, 0.3165, 0.4272, 0.3363]}, {"w": "that", "b": [0.4335, 0.3165, 0.4713, 0.3363]}, {"w": "point", "b": [0.4776, 0.3165, 0.5295, 0.3363]}, {"w": "is", "b": [0.5358, 0.3165, 0.5526, 0.3363]}, {"w": "likely", "b": [0.5589, 0.3165, 0.6164, 0.3363]}, {"w": "to", "b": [0.6227, 0.3165, 0.6423, 0.3363]}, {"w": "be", "b": [0.6486, 0.3165, 0.6724, 0.3363]}, {"w": "black", "b": [0.6788, 0.3165, 0.7334, 0.3363]}, {"w": "or", "b": [0.7397, 0.3165, 0.7607, 0.3363]}, {"w": "to", "b": [0.767, 0.3165, 0.7866, 0.3363]}, {"w": "be", "b": [0.793, 0.3165, 0.8168, 0.3363]}, {"w": "white.", "b": [0.1294, 0.337, 0.1918, 0.3568]}, {"w": "In", "b": [0.1981, 0.337, 0.2191, 0.3568]}, {"w": "this", "b": [0.2254, 0.337, 0.2618, 0.3568]}, {"w": "case,", "b": [0.2682, 0.337, 0.3179, 0.3568]}]}, {"id": "b_1", "type": "paragraph", "text": "The inputs are the coordinates of our points. The expected outputs are the colors of our points. A way to measure whether our algorithm is doing a good job could be, for instance, the percentage of points that are being correctly classified.", "words": [{"w": "The", "b": [0.1799, 0.3754, 0.2191, 0.3951]}, {"w": "inputs", "b": [0.2254, 0.3754, 0.2871, 0.3951]}, {"w": "are", "b": [0.2934, 0.3754, 0.3242, 0.3951]}, {"w": "the", "b": [0.3305, 0.3754, 0.3613, 0.3951]}, {"w": "coordinates", "b": [0.3676, 0.3754, 0.4839, 0.3951]}, {"w": "of", "b": [0.4902, 0.3754, 0.5112, 0.3951]}, {"w": "our", "b": [0.5175, 0.3754, 0.5512, 0.3951]}, {"w": "points.", "b": [0.5575, 0.3754, 0.6255, 0.3951]}, {"w": "The", "b": [0.1799, 0.3959, 0.2191, 0.4156]}, {"w": "expected", "b": [0.2254, 0.3959, 0.315, 0.4156]}, {"w": "outputs", "b": [0.3214, 0.3959, 0.3956, 0.4156]}, {"w": "are", "b": [0.402, 0.3959, 0.4328, 0.4156]}, {"w": "the", "b": [0.4391, 0.3959, 0.4699, 0.4156]}, {"w": "colors", "b": [0.4762, 0.3959, 0.5378, 0.4156]}, {"w": "of", "b": [0.5441, 0.3959, 0.5652, 0.4156]}, {"w": "our", "b": [0.5715, 0.3959, 0.6051, 0.4156]}, {"w": "points.", "b": [0.6114, 0.3959, 0.6794, 0.4156]}, {"w": "A", "b": [0.1799, 0.4164, 0.1981, 0.4361]}, {"w": "way", "b": [0.2044, 0.4164, 0.2464, 0.4361]}, {"w": "to", "b": [0.2527, 0.4164, 0.2723, 0.4361]}, {"w": "measure", "b": [0.2786, 0.4164, 0.3627, 0.4361]}, {"w": "whether", "b": [0.369, 0.4164, 0.4503, 0.4361]}, {"w": "our", "b": [0.4566, 0.4164, 0.4902, 0.4361]}, {"w": "algorithm", "b": [0.4965, 0.4164, 0.5946, 0.4361]}, {"w": "is", "b": [0.6009, 0.4164, 0.6177, 0.4361]}, {"w": "doing", "b": [0.624, 0.4164, 0.6815, 0.4361]}, {"w": "a", "b": [0.6878, 0.4164, 0.699, 0.4361]}, {"w": "good", "b": [0.7053, 0.4164, 0.7558, 0.4361]}, {"w": "job", "b": [0.7621, 0.4164, 0.7943, 0.4361]}, {"w": "could", "b": [0.8006, 0.4164, 0.8567, 0.4361]}, {"w": "be,", "b": [0.1799, 0.4369, 0.21, 0.4566]}, {"w": "for", "b": [0.2163, 0.4369, 0.2457, 0.4566]}, {"w": "instance,", "b": [0.252, 0.4369, 0.341, 0.4566]}, {"w": "the", "b": [0.3473, 0.4369, 0.3781, 0.4566]}, {"w": "percentage", "b": [0.3844, 0.4369, 0.4937, 0.4566]}, {"w": "of", "b": [0.5, 0.4369, 0.521, 0.4566]}, {"w": "points", "b": [0.5273, 0.4369, 0.589, 0.4566]}, {"w": "that", "b": [0.5953, 0.4369, 0.6331, 0.4566]}, {"w": "are", "b": [0.6394, 0.4369, 0.6702, 0.4566]}, {"w": "being", "b": [0.6765, 0.4369, 0.7326, 0.4566]}, {"w": "correctly", "b": [0.7388, 0.4369, 0.8284, 0.4566]}, {"w": "classified.", "b": [0.1799, 0.4574, 0.2814, 0.4771]}]}, {"id": "b_2", "type": "paragraph", "text": "What we need here is a new representation of our data that cleanly separates the white points from the black points. One transformation we could use, among many other possibilities, would be a coordinate change, illustrated in figure 1.4.", "words": [{"w": "What", "b": [0.1294, 0.5001, 0.1841, 0.5199]}, {"w": "we", "b": [0.1904, 0.5001, 0.2198, 0.5199]}, {"w": "need", "b": [0.2261, 0.5001, 0.2737, 0.5199]}, {"w": "here", "b": [0.28, 0.5001, 0.3234, 0.5199]}, {"w": "is", "b": [0.3297, 0.5001, 0.3466, 0.5199]}, {"w": "a", "b": [0.3529, 0.5001, 0.3641, 0.5199]}, {"w": "new", "b": [0.3704, 0.5001, 0.4124, 0.5199]}, {"w": "representation", "b": [0.4187, 0.5001, 0.5616, 0.5199]}, {"w": "of", "b": [0.5679, 0.5001, 0.5889, 0.5199]}, {"w": "our", "b": [0.5952, 0.5001, 0.6289, 0.5199]}, {"w": "data", "b": [0.6352, 0.5001, 0.6772, 0.5199]}, {"w": "that", "b": [0.6835, 0.5001, 0.7213, 0.5199]}, {"w": "cleanly", "b": [0.7276, 0.5001, 0.8005, 0.5199]}, {"w": "separates", "b": [0.1294, 0.5206, 0.2219, 0.5404]}, {"w": "the", "b": [0.2282, 0.5206, 0.259, 0.5404]}, {"w": "white", "b": [0.2653, 0.5206, 0.3214, 0.5404]}, {"w": "points", "b": [0.3277, 0.5206, 0.3893, 0.5404]}, {"w": "from", "b": [0.3956, 0.5206, 0.4447, 0.5404]}, {"w": "the", "b": [0.451, 0.5206, 0.4818, 0.5404]}, {"w": "black", "b": [0.4881, 0.5206, 0.5428, 0.5404]}, {"w": "points.", "b": [0.5491, 0.5206, 0.6171, 0.5404]}, {"w": "One", "b": [0.6234, 0.5206, 0.6654, 0.5404]}, {"w": "transformation", "b": [0.6717, 0.5206, 0.8202, 0.5404]}, {"w": "we", "b": [0.8264, 0.5206, 0.8558, 0.5404]}, {"w": "could", "b": [0.1294, 0.5411, 0.1855, 0.5609]}, {"w": "use,", "b": [0.1918, 0.5411, 0.2317, 0.5609]}, {"w": "among", "b": [0.238, 0.5411, 0.3067, 0.5609]}, {"w": "many", "b": [0.313, 0.5411, 0.369, 0.5609]}, {"w": "other", "b": [0.3753, 0.5411, 0.4272, 0.5609]}, {"w": "possibilities,", "b": [0.4335, 0.5411, 0.5603, 0.5609]}, {"w": "would", "b": [0.5667, 0.5411, 0.6297, 0.5609]}, {"w": "be", "b": [0.636, 0.5411, 0.6598, 0.5609]}, {"w": "a", "b": [0.6661, 0.5411, 0.6773, 0.5609]}, {"w": "coordinate", "b": [0.6836, 0.5411, 0.7901, 0.5609]}, {"w": "change,", "b": [0.1294, 0.5616, 0.2072, 0.5814]}, {"w": "illustrated", "b": [0.2135, 0.5616, 0.3144, 0.5814]}, {"w": "in", "b": [0.3207, 0.5616, 0.3403, 0.5814]}, {"w": "figure", "b": [0.3466, 0.5616, 0.4068, 0.5814]}, {"w": "1.4.", "b": [0.4131, 0.5616, 0.4509, 0.5814]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 1.4. Coordinate change", "words": [{"w": "Figure", "b": [0.1294, 0.5995, 0.1827, 0.6143]}, {"w": "1.4.", "b": [0.1874, 0.5995, 0.2158, 0.6143]}, {"w": "Coordinate", "b": [0.2205, 0.5995, 0.3119, 0.6143]}, {"w": "change", "b": [0.3166, 0.5995, 0.3734, 0.6143]}]}, {"id": "b_4", "type": "paragraph", "text": "In this new coordinate system, the coordinates of our points can be said to be a new representation of our data. And it’s a good one! With this representation, the black/white classification problem can be expressed as a simple rule: “Black points are such that x > 0,” or “White points are", "words": [{"w": "In", "b": [0.1294, 0.7952, 0.1504, 0.8149]}, {"w": "this", "b": [0.1567, 0.7952, 0.1932, 0.8149]}, {"w": "new", "b": [0.1995, 0.7952, 0.2415, 0.8149]}, {"w": "coordinate", "b": [0.2478, 0.7952, 0.3543, 0.8149]}, {"w": "system,", "b": [0.3606, 0.7952, 0.437, 0.8149]}, {"w": "the", "b": [0.4433, 0.7952, 0.4741, 0.8149]}, {"w": "coordinates", "b": [0.4804, 0.7952, 0.5967, 0.8149]}, {"w": "of", "b": [0.603, 0.7952, 0.624, 0.8149]}, {"w": "our", "b": [0.6303, 0.7952, 0.664, 0.8149]}, {"w": "points", "b": [0.6703, 0.7952, 0.732, 0.8149]}, {"w": "can", "b": [0.7383, 0.7952, 0.7733, 0.8149]}, {"w": "be", "b": [0.7796, 0.7952, 0.8034, 0.8149]}, {"w": "said", "b": [0.8097, 0.7952, 0.8503, 0.8149]}, {"w": "to", "b": [0.1294, 0.8157, 0.149, 0.8354]}, {"w": "be", "b": [0.1553, 0.8157, 0.1792, 0.8354]}, {"w": "a", "b": [0.1855, 0.8157, 0.1967, 0.8354]}, {"w": "new", "b": [0.203, 0.8157, 0.245, 0.8354]}, {"w": "representation", "b": [0.2513, 0.8157, 0.3942, 0.8354]}, {"w": "of", "b": [0.4005, 0.8157, 0.4215, 0.8354]}, {"w": "our", "b": [0.4278, 0.8157, 0.4615, 0.8354]}, {"w": "data.", "b": [0.4678, 0.8157, 0.5161, 0.8354]}, {"w": "And", "b": [0.5224, 0.8157, 0.5658, 0.8354]}, {"w": "it’s", "b": [0.5721, 0.8157, 0.6029, 0.8354]}, {"w": "a", "b": [0.6093, 0.8157, 0.6205, 0.8354]}, {"w": "good", "b": [0.6268, 0.8157, 0.6772, 0.8354]}, {"w": "one!", "b": [0.6835, 0.8157, 0.7283, 0.8354]}, {"w": "With", "b": [0.7347, 0.8157, 0.7841, 0.8354]}, {"w": "this", "b": [0.7904, 0.8157, 0.8268, 0.8354]}, {"w": "representation,", "b": [0.1294, 0.8362, 0.2786, 0.8559]}, {"w": "the", "b": [0.2849, 0.8362, 0.3158, 0.8559]}, {"w": "black/white", "b": [0.3221, 0.8362, 0.4398, 0.8559]}, {"w": "classification", "b": [0.4461, 0.8362, 0.5792, 0.8559]}, {"w": "problem", "b": [0.5855, 0.8362, 0.6696, 0.8559]}, {"w": "can", "b": [0.6759, 0.8362, 0.7109, 0.8559]}, {"w": "be", "b": [0.7172, 0.8362, 0.741, 0.8559]}, {"w": "expressed", "b": [0.7473, 0.8362, 0.8468, 0.8559]}, {"w": "as", "b": [0.1294, 0.8567, 0.1504, 0.8764]}, {"w": "a", "b": [0.1567, 0.8567, 0.1679, 0.8764]}, {"w": "simple", "b": [0.1742, 0.8567, 0.2415, 0.8764]}, {"w": "rule:", "b": [0.2478, 0.8567, 0.2941, 0.8764]}, {"w": "“Black", "b": [0.3004, 0.8567, 0.3704, 0.8764]}, {"w": "points", "b": [0.3767, 0.8567, 0.4384, 0.8764]}, {"w": "are", "b": [0.4447, 0.8567, 0.4755, 0.8764]}, {"w": "such", "b": [0.4818, 0.8567, 0.528, 0.8764]}, {"w": "that", "b": [0.5343, 0.8567, 0.5721, 0.8764]}, {"w": "x", "b": [0.5785, 0.8567, 0.5911, 0.8764]}, {"w": ">", "b": [0.5974, 0.8567, 0.6116, 0.8764]}, {"w": "0,”", "b": [0.6179, 0.8567, 0.648, 0.8764]}, {"w": "or", "b": [0.6543, 0.8567, 0.6753, 0.8764]}, {"w": "“White", "b": [0.6817, 0.8567, 0.7545, 0.8764]}, {"w": "points", "b": [0.7608, 0.8567, 0.8225, 0.8764]}, {"w": "are", "b": [0.8288, 0.8567, 0.8596, 0.8764]}]}]}, {"page": 35, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "such that x < 0.” This new representation basically solves the classification problem.", "words": [{"w": "such", "b": [0.1294, 0.0857, 0.1757, 0.1054]}, {"w": "that", "b": [0.182, 0.0857, 0.2198, 0.1054]}, {"w": "x", "b": [0.2261, 0.0857, 0.2387, 0.1054]}, {"w": "<", "b": [0.245, 0.0857, 0.2592, 0.1054]}, {"w": "0.”", "b": [0.2656, 0.0857, 0.2957, 0.1054]}, {"w": "This", "b": [0.302, 0.0857, 0.3468, 0.1054]}, {"w": "new", "b": [0.3531, 0.0857, 0.3952, 0.1054]}, {"w": "representation", "b": [0.4015, 0.0857, 0.5444, 0.1054]}, {"w": "basically", "b": [0.5507, 0.0857, 0.6404, 0.1054]}, {"w": "solves", "b": [0.6467, 0.0857, 0.7097, 0.1054]}, {"w": "the", "b": [0.716, 0.0857, 0.7469, 0.1054]}, {"w": "classification", "b": [0.1294, 0.1062, 0.2625, 0.1259]}, {"w": "problem.", "b": [0.2688, 0.1062, 0.3592, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "In this case, we defined the coordinate change by hand. But if instead we tried systematically searching for different possible coordinate changes, and used as feedback the percentage of points being correctly classified, then we would be doing machine learning. Learning, in the context of machine learning, describes an automatic search process for better representations.", "words": [{"w": "In", "b": [0.1294, 0.149, 0.1504, 0.1687]}, {"w": "this", "b": [0.1567, 0.149, 0.1932, 0.1687]}, {"w": "case,", "b": [0.1995, 0.149, 0.2492, 0.1687]}, {"w": "we", "b": [0.2555, 0.149, 0.2849, 0.1687]}, {"w": "defined", "b": [0.2912, 0.149, 0.3669, 0.1687]}, {"w": "the", "b": [0.3732, 0.149, 0.404, 0.1687]}, {"w": "coordinate", "b": [0.4103, 0.149, 0.5168, 0.1687]}, {"w": "change", "b": [0.5231, 0.149, 0.5945, 0.1687]}, {"w": "by", "b": [0.6009, 0.149, 0.6261, 0.1687]}, {"w": "hand.", "b": [0.6324, 0.149, 0.6877, 0.1687]}, {"w": "But", "b": [0.694, 0.149, 0.7305, 0.1687]}, {"w": "if", "b": [0.7368, 0.149, 0.7522, 0.1687]}, {"w": "instead", "b": [0.7585, 0.149, 0.83, 0.1687]}, {"w": "we", "b": [0.8363, 0.149, 0.8657, 0.1687]}, {"w": "tried", "b": [0.1294, 0.1695, 0.1757, 0.1892]}, {"w": "systematically", "b": [0.182, 0.1695, 0.3263, 0.1892]}, {"w": "searching", "b": [0.3326, 0.1695, 0.4293, 0.1892]}, {"w": "for", "b": [0.4356, 0.1695, 0.465, 0.1892]}, {"w": "different", "b": [0.4713, 0.1695, 0.5576, 0.1892]}, {"w": "possible", "b": [0.5639, 0.1695, 0.6466, 0.1892]}, {"w": "coordinate", "b": [0.6529, 0.1695, 0.7594, 0.1892]}, {"w": "changes,", "b": [0.7657, 0.1695, 0.8532, 0.1892]}, {"w": "and", "b": [0.1294, 0.19, 0.1658, 0.2097]}, {"w": "used", "b": [0.1721, 0.19, 0.2184, 0.2097]}, {"w": "as", "b": [0.2247, 0.19, 0.2457, 0.2097]}, {"w": "feedback", "b": [0.252, 0.19, 0.343, 0.2097]}, {"w": "the", "b": [0.3494, 0.19, 0.3802, 0.2097]}, {"w": "percentage", "b": [0.3865, 0.19, 0.4957, 0.2097]}, {"w": "of", "b": [0.502, 0.19, 0.5231, 0.2097]}, {"w": "points", "b": [0.5294, 0.19, 0.591, 0.2097]}, {"w": "being", "b": [0.5973, 0.19, 0.6534, 0.2097]}, {"w": "correctly", "b": [0.6597, 0.19, 0.7494, 0.2097]}, {"w": "classified,", "b": [0.7557, 0.19, 0.8573, 0.2097]}, {"w": "then", "b": [0.1294, 0.2105, 0.1729, 0.2302]}, {"w": "we", "b": [0.1792, 0.2105, 0.2086, 0.2302]}, {"w": "would", "b": [0.2149, 0.2105, 0.2779, 0.2302]}, {"w": "be", "b": [0.2842, 0.2105, 0.3081, 0.2302]}, {"w": "doing", "b": [0.3144, 0.2105, 0.3718, 0.2302]}, {"w": "machine", "b": [0.3781, 0.2105, 0.4636, 0.2302]}, {"w": "learning.", "b": [0.4699, 0.2105, 0.5588, 0.2302]}, {"w": "Learning,", "b": [0.5651, 0.2105, 0.6639, 0.2302]}, {"w": "in", "b": [0.6702, 0.2105, 0.6898, 0.2302]}, {"w": "the", "b": [0.6961, 0.2105, 0.727, 0.2302]}, {"w": "context", "b": [0.7333, 0.2105, 0.8075, 0.2302]}, {"w": "of", "b": [0.8138, 0.2105, 0.8349, 0.2302]}, {"w": "machine", "b": [0.1294, 0.231, 0.2149, 0.2507]}, {"w": "learning,", "b": [0.2212, 0.231, 0.3102, 0.2507]}, {"w": "describes", "b": [0.3165, 0.231, 0.4103, 0.2507]}, {"w": "an", "b": [0.4166, 0.231, 0.4404, 0.2507]}, {"w": "automatic", "b": [0.4468, 0.231, 0.5462, 0.2507]}, {"w": "search", "b": [0.5525, 0.231, 0.617, 0.2507]}, {"w": "process", "b": [0.6233, 0.231, 0.6989, 0.2507]}, {"w": "for", "b": [0.7052, 0.231, 0.7347, 0.2507]}, {"w": "better", "b": [0.741, 0.231, 0.7984, 0.2507]}, {"w": "representations.", "b": [0.1294, 0.2515, 0.2884, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "All machine-learning algorithms consist of automatically finding such transformations that turn data into more-useful representations for a given task. These operations can be coordinate changes, as you just saw, or linear projections (which may destroy information), translations, nonlinear operations (such as “select all points such that x > 0”), and so on. Machine-learning algorithms aren’t usually creative in finding these transformations; they’re merely searching through a predefined set of operations, called a hypothesis space.", "words": [{"w": "All", "b": [0.1294, 0.2942, 0.1617, 0.314]}, {"w": "machine-learning", "b": [0.168, 0.2942, 0.3445, 0.314]}, {"w": "algorithms", "b": [0.3508, 0.2942, 0.4587, 0.314]}, {"w": "consist", "b": [0.465, 0.2942, 0.5351, 0.314]}, {"w": "of", "b": [0.5414, 0.2942, 0.5624, 0.314]}, {"w": "automatically", "b": [0.5687, 0.2942, 0.706, 0.314]}, {"w": "finding", "b": [0.7124, 0.2942, 0.7852, 0.314]}, {"w": "such", "b": [0.7915, 0.2942, 0.8378, 0.314]}, {"w": "transformations", "b": [0.1294, 0.3147, 0.2878, 0.3345]}, {"w": "that", "b": [0.2941, 0.3147, 0.3319, 0.3345]}, {"w": "turn", "b": [0.3382, 0.3147, 0.3788, 0.3345]}, {"w": "data", "b": [0.3852, 0.3147, 0.4272, 0.3345]}, {"w": "into", "b": [0.4335, 0.3147, 0.4727, 0.3345]}, {"w": "more-useful", "b": [0.479, 0.3147, 0.6009, 0.3345]}, {"w": "representations", "b": [0.6072, 0.3147, 0.76, 0.3345]}, {"w": "for", "b": [0.7662, 0.3147, 0.7956, 0.3345]}, {"w": "a", "b": [0.8019, 0.3147, 0.8131, 0.3345]}, {"w": "given", "b": [0.1294, 0.3352, 0.1855, 0.355]}, {"w": "task.", "b": [0.1918, 0.3352, 0.2387, 0.355]}, {"w": "These", "b": [0.245, 0.3352, 0.3053, 0.355]}, {"w": "operations", "b": [0.3116, 0.3352, 0.4167, 0.355]}, {"w": "can", "b": [0.423, 0.3352, 0.458, 0.355]}, {"w": "be", "b": [0.4643, 0.3352, 0.4881, 0.355]}, {"w": "coordinate", "b": [0.4944, 0.3352, 0.6009, 0.355]}, {"w": "changes,", "b": [0.6072, 0.3352, 0.6947, 0.355]}, {"w": "as", "b": [0.7011, 0.3352, 0.7221, 0.355]}, {"w": "you", "b": [0.7284, 0.3352, 0.7662, 0.355]}, {"w": "just", "b": [0.7725, 0.3352, 0.809, 0.355]}, {"w": "saw,", "b": [0.8153, 0.3352, 0.8591, 0.355]}, {"w": "or", "b": [0.1294, 0.3557, 0.1504, 0.3755]}, {"w": "linear", "b": [0.1567, 0.3557, 0.2142, 0.3755]}, {"w": "projections", "b": [0.2205, 0.3557, 0.3326, 0.3755]}, {"w": "(which", "b": [0.3389, 0.3557, 0.4089, 0.3755]}, {"w": "may", "b": [0.4152, 0.3557, 0.4587, 0.3755]}, {"w": "destroy", "b": [0.465, 0.3557, 0.5393, 0.3755]}, {"w": "information),", "b": [0.5456, 0.3557, 0.6794, 0.3755]}, {"w": "translations,", "b": [0.6856, 0.3557, 0.8082, 0.3755]}, {"w": "nonlinear", "b": [0.1294, 0.3762, 0.2247, 0.396]}, {"w": "operations", "b": [0.231, 0.3762, 0.3361, 0.396]}, {"w": "(such", "b": [0.3424, 0.3762, 0.397, 0.396]}, {"w": "as", "b": [0.4033, 0.3762, 0.4244, 0.396]}, {"w": "“select", "b": [0.4307, 0.3762, 0.4993, 0.396]}, {"w": "all", "b": [0.5056, 0.3762, 0.5308, 0.396]}, {"w": "points", "b": [0.5371, 0.3762, 0.5988, 0.396]}, {"w": "such", "b": [0.6051, 0.3762, 0.6514, 0.396]}, {"w": "that", "b": [0.6577, 0.3762, 0.6955, 0.396]}, {"w": "x", "b": [0.7018, 0.3762, 0.7144, 0.396]}, {"w": ">", "b": [0.7207, 0.3762, 0.735, 0.396]}, {"w": "0”),", "b": [0.7413, 0.3762, 0.7798, 0.396]}, {"w": "and", "b": [0.7861, 0.3762, 0.8225, 0.396]}, {"w": "so", "b": [0.8288, 0.3762, 0.8512, 0.396]}, {"w": "on.", "b": [0.1294, 0.3967, 0.1609, 0.4165]}, {"w": "Machine-learning", "b": [0.1673, 0.3967, 0.3466, 0.4165]}, {"w": "algorithms", "b": [0.3529, 0.3967, 0.4608, 0.4165]}, {"w": "aren’t", "b": [0.4671, 0.3967, 0.5254, 0.4165]}, {"w": "usually", "b": [0.5317, 0.3967, 0.6046, 0.4165]}, {"w": "creative", "b": [0.6109, 0.3967, 0.6907, 0.4165]}, {"w": "in", "b": [0.6971, 0.3967, 0.7167, 0.4165]}, {"w": "finding", "b": [0.7229, 0.3967, 0.7958, 0.4165]}, {"w": "these", "b": [0.8021, 0.3967, 0.854, 0.4165]}, {"w": "transformations;", "b": [0.1294, 0.4172, 0.2948, 0.437]}, {"w": "they’re", "b": [0.3011, 0.4172, 0.3725, 0.437]}, {"w": "merely", "b": [0.3788, 0.4172, 0.4489, 0.437]}, {"w": "searching", "b": [0.4552, 0.4172, 0.5518, 0.437]}, {"w": "through", "b": [0.5581, 0.4172, 0.6366, 0.437]}, {"w": "a", "b": [0.6429, 0.4172, 0.6541, 0.437]}, {"w": "predefined", "b": [0.6604, 0.4172, 0.7683, 0.437]}, {"w": "set", "b": [0.7746, 0.4172, 0.8026, 0.437]}, {"w": "of", "b": [0.8089, 0.4172, 0.83, 0.437]}, {"w": "operations,", "b": [0.1294, 0.4377, 0.2408, 0.4575]}, {"w": "called", "b": [0.2471, 0.4377, 0.3074, 0.4575]}, {"w": "a", "b": [0.3137, 0.4377, 0.3249, 0.4575]}, {"w": "hypothesis", "b": [0.3311, 0.4377, 0.4376, 0.4575]}, {"w": "space.", "b": [0.4439, 0.4377, 0.5077, 0.4575]}]}, {"id": "b_3", "type": "paragraph", "text": "So that’s what machine learning is, technically: searching for useful representations of some input data, within a predefined space of possibilities, using guidance from a feedback signal. This simple idea allows for solving a remarkably broad range of intellectual tasks, from speech recognition to autonomous car driving.", "words": [{"w": "So", "b": [0.1294, 0.4805, 0.1561, 0.5003]}, {"w": "that’s", "b": [0.1624, 0.4805, 0.217, 0.5003]}, {"w": "what", "b": [0.2233, 0.4805, 0.2724, 0.5003]}, {"w": "machine", "b": [0.2787, 0.4805, 0.3641, 0.5003]}, {"w": "learning", "b": [0.3704, 0.4805, 0.4531, 0.5003]}, {"w": "is,", "b": [0.4594, 0.4805, 0.4825, 0.5003]}, {"w": "technically:", "b": [0.4888, 0.4805, 0.6065, 0.5003]}, {"w": "searching", "b": [0.6129, 0.4805, 0.7095, 0.5003]}, {"w": "for", "b": [0.7158, 0.4805, 0.7452, 0.5003]}, {"w": "useful", "b": [0.7515, 0.4805, 0.8132, 0.5003]}, {"w": "representations", "b": [0.1294, 0.501, 0.2821, 0.5208]}, {"w": "of", "b": [0.2884, 0.501, 0.3094, 0.5208]}, {"w": "some", "b": [0.3158, 0.501, 0.369, 0.5208]}, {"w": "input", "b": [0.3753, 0.501, 0.4272, 0.5208]}, {"w": "data,", "b": [0.4335, 0.501, 0.4818, 0.5208]}, {"w": "within", "b": [0.4881, 0.501, 0.5526, 0.5208]}, {"w": "a", "b": [0.5589, 0.501, 0.5701, 0.5208]}, {"w": "predefined", "b": [0.5764, 0.501, 0.6843, 0.5208]}, {"w": "space", "b": [0.6905, 0.501, 0.7465, 0.5208]}, {"w": "of", "b": [0.7528, 0.501, 0.7739, 0.5208]}, {"w": "possibilities,", "b": [0.1294, 0.5215, 0.2563, 0.5413]}, {"w": "using", "b": [0.2626, 0.5215, 0.3172, 0.5413]}, {"w": "guidance", "b": [0.3235, 0.5215, 0.4146, 0.5413]}, {"w": "from", "b": [0.4209, 0.5215, 0.47, 0.5413]}, {"w": "a", "b": [0.4763, 0.5215, 0.4875, 0.5413]}, {"w": "feedback", "b": [0.4938, 0.5215, 0.5848, 0.5413]}, {"w": "signal.", "b": [0.5911, 0.5215, 0.6577, 0.5413]}, {"w": "This", "b": [0.664, 0.5215, 0.7088, 0.5413]}, {"w": "simple", "b": [0.7152, 0.5215, 0.7824, 0.5413]}, {"w": "idea", "b": [0.7887, 0.5215, 0.8308, 0.5413]}, {"w": "allows", "b": [0.1294, 0.542, 0.1953, 0.5618]}, {"w": "for", "b": [0.2016, 0.542, 0.231, 0.5618]}, {"w": "solving", "b": [0.2373, 0.542, 0.3116, 0.5618]}, {"w": "a", "b": [0.3179, 0.542, 0.3291, 0.5618]}, {"w": "remarkably", "b": [0.3354, 0.542, 0.4503, 0.5618]}, {"w": "broad", "b": [0.4566, 0.542, 0.514, 0.5618]}, {"w": "range", "b": [0.5203, 0.542, 0.5764, 0.5618]}, {"w": "of", "b": [0.5826, 0.542, 0.6036, 0.5618]}, {"w": "intellectual", "b": [0.6099, 0.542, 0.722, 0.5618]}, {"w": "tasks,", "b": [0.7283, 0.542, 0.7851, 0.5618]}, {"w": "from", "b": [0.7914, 0.542, 0.8404, 0.5618]}, {"w": "speech", "b": [0.1294, 0.5625, 0.1981, 0.5823]}, {"w": "recognition", "b": [0.2044, 0.5625, 0.3193, 0.5823]}, {"w": "to", "b": [0.3256, 0.5625, 0.3452, 0.5823]}, {"w": "autonomous", "b": [0.3515, 0.5625, 0.4748, 0.5823]}, {"w": "car", "b": [0.4811, 0.5625, 0.5119, 0.5823]}, {"w": "driving.", "b": [0.5182, 0.5625, 0.5974, 0.5823]}]}, {"id": "b_4", "type": "paragraph", "text": "Now that you understand what we mean by learning, let’s take a look at what makes deep learning special.", "words": [{"w": "Now", "b": [0.1294, 0.6053, 0.1785, 0.6251]}, {"w": "that", "b": [0.1848, 0.6053, 0.2226, 0.6251]}, {"w": "you", "b": [0.2289, 0.6053, 0.2667, 0.6251]}, {"w": "understand", "b": [0.273, 0.6053, 0.3837, 0.6251]}, {"w": "what", "b": [0.39, 0.6053, 0.4391, 0.6251]}, {"w": "we", "b": [0.4454, 0.6053, 0.4748, 0.6251]}, {"w": "mean", "b": [0.4811, 0.6053, 0.5357, 0.6251]}, {"w": "by", "b": [0.5421, 0.6053, 0.5673, 0.6251]}, {"w": "learning,", "b": [0.5735, 0.6053, 0.6653, 0.6251]}, {"w": "let’s", "b": [0.6716, 0.6053, 0.7137, 0.6251]}, {"w": "take", "b": [0.72, 0.6053, 0.762, 0.6251]}, {"w": "a", "b": [0.7683, 0.6053, 0.7795, 0.6251]}, {"w": "look", "b": [0.7858, 0.6053, 0.8307, 0.6251]}, {"w": "at", "b": [0.837, 0.6053, 0.8552, 0.6251]}, {"w": "what", "b": [0.1294, 0.6258, 0.1785, 0.6456]}, {"w": "makes", "b": [0.1848, 0.6258, 0.2492, 0.6456]}, {"w": "deep", "b": [0.2555, 0.6258, 0.3031, 0.6456]}, {"w": "learning", "b": [0.3094, 0.6258, 0.3949, 0.6456]}, {"w": "special.", "b": [0.4012, 0.6258, 0.4776, 0.6456]}]}, {"id": "b_5", "type": "paragraph", "text": "1.1.4. The “deep” in deep learning", "words": [{"w": "1.1.4.", "b": [0.1294, 0.6731, 0.1862, 0.6928]}, {"w": "The", "b": [0.1925, 0.6731, 0.2345, 0.6928]}, {"w": "“deep”", "b": [0.2408, 0.6731, 0.3165, 0.6928]}, {"w": "in", "b": [0.3228, 0.6731, 0.3439, 0.6928]}, {"w": "deep", "b": [0.3502, 0.6731, 0.4006, 0.6928]}, {"w": "learning", "b": [0.4069, 0.6731, 0.4966, 0.6928]}]}, {"id": "b_6", "type": "paragraph", "text": "Deep learning is a specific subfield of machine learning: a new take on learning representations from data that puts an emphasis on learning successive layers of increasingly meaningful representations. The deep in deep learning isn’t a reference to any kind of deeper understanding achieved by the approach; rather, it stands for this idea of successive layers of representations. How many layers contribute to a model of the data is called the depth of the model. Other appropriate names for the field could have been layered representations learning and hierarchical representations learning. Modern deep learning often involves tens or", "words": [{"w": "Deep", "b": [0.1294, 0.7158, 0.1826, 0.7356]}, {"w": "learning", "b": [0.1889, 0.7158, 0.2716, 0.7356]}, {"w": "is", "b": [0.2779, 0.7158, 0.2947, 0.7356]}, {"w": "a", "b": [0.301, 0.7158, 0.3122, 0.7356]}, {"w": "specific", "b": [0.3186, 0.7158, 0.397, 0.7356]}, {"w": "subfield", "b": [0.4033, 0.7158, 0.4846, 0.7356]}, {"w": "of", "b": [0.4909, 0.7158, 0.5119, 0.7356]}, {"w": "machine", "b": [0.5182, 0.7158, 0.6037, 0.7356]}, {"w": "learning:", "b": [0.61, 0.7158, 0.6997, 0.7356]}, {"w": "a", "b": [0.706, 0.7158, 0.7172, 0.7356]}, {"w": "new", "b": [0.7235, 0.7158, 0.7655, 0.7356]}, {"w": "take", "b": [0.7718, 0.7158, 0.8138, 0.7356]}, {"w": "on", "b": [0.8201, 0.7158, 0.8454, 0.7356]}, {"w": "learning", "b": [0.1294, 0.7363, 0.2121, 0.7561]}, {"w": "representations", "b": [0.2184, 0.7363, 0.3711, 0.7561]}, {"w": "from", "b": [0.3774, 0.7363, 0.4264, 0.7561]}, {"w": "data", "b": [0.4328, 0.7363, 0.4748, 0.7561]}, {"w": "that", "b": [0.4811, 0.7363, 0.5189, 0.7561]}, {"w": "puts", "b": [0.5252, 0.7363, 0.5673, 0.7561]}, {"w": "an", "b": [0.5736, 0.7363, 0.5974, 0.7561]}, {"w": "emphasis", "b": [0.6037, 0.7363, 0.6976, 0.7561]}, {"w": "on", "b": [0.7038, 0.7363, 0.729, 0.7561]}, {"w": "learning", "b": [0.7353, 0.7363, 0.818, 0.7561]}, {"w": "successive", "b": [0.1294, 0.7568, 0.2359, 0.7766]}, {"w": "layers", "b": [0.2422, 0.7568, 0.3038, 0.7766]}, {"w": "of", "b": [0.3101, 0.7568, 0.3311, 0.7766]}, {"w": "increasingly", "b": [0.3375, 0.7568, 0.4608, 0.7766]}, {"w": "meaningful", "b": [0.4671, 0.7568, 0.582, 0.7766]}, {"w": "representations.", "b": [0.5883, 0.7568, 0.7473, 0.7766]}, {"w": "The", "b": [0.7536, 0.7568, 0.7928, 0.7766]}, {"w": "deep", "b": [0.7991, 0.7568, 0.8467, 0.7766]}, {"w": "in", "b": [0.1294, 0.7773, 0.149, 0.7971]}, {"w": "deep", "b": [0.1553, 0.7773, 0.203, 0.7971]}, {"w": "learning", "b": [0.2093, 0.7773, 0.2948, 0.7971]}, {"w": "isn’t", "b": [0.301, 0.7773, 0.3454, 0.7971]}, {"w": "a", "b": [0.3517, 0.7773, 0.3629, 0.7971]}, {"w": "reference", "b": [0.3692, 0.7773, 0.463, 0.7971]}, {"w": "to", "b": [0.4694, 0.7773, 0.489, 0.7971]}, {"w": "any", "b": [0.4953, 0.7773, 0.5317, 0.7971]}, {"w": "kind", "b": [0.538, 0.7773, 0.5829, 0.7971]}, {"w": "of", "b": [0.5892, 0.7773, 0.6102, 0.7971]}, {"w": "deeper", "b": [0.6165, 0.7773, 0.6837, 0.7971]}, {"w": "understanding", "b": [0.69, 0.7773, 0.833, 0.7971]}, {"w": "achieved", "b": [0.1294, 0.7978, 0.2191, 0.8176]}, {"w": "by", "b": [0.2254, 0.7978, 0.2506, 0.8176]}, {"w": "the", "b": [0.2569, 0.7978, 0.2877, 0.8176]}, {"w": "approach;", "b": [0.294, 0.7978, 0.3935, 0.8176]}, {"w": "rather,", "b": [0.3998, 0.7978, 0.4639, 0.8176]}, {"w": "it", "b": [0.4702, 0.7978, 0.4842, 0.8176]}, {"w": "stands", "b": [0.4905, 0.7978, 0.5536, 0.8176]}, {"w": "for", "b": [0.5599, 0.7978, 0.5893, 0.8176]}, {"w": "this", "b": [0.5956, 0.7978, 0.6321, 0.8176]}, {"w": "idea", "b": [0.6384, 0.7978, 0.6804, 0.8176]}, {"w": "of", "b": [0.6867, 0.7978, 0.7077, 0.8176]}, {"w": "successive", "b": [0.714, 0.7978, 0.8205, 0.8176]}, {"w": "layers", "b": [0.1294, 0.8183, 0.1897, 0.8381]}, {"w": "of", "b": [0.196, 0.8183, 0.217, 0.8381]}, {"w": "representations.", "b": [0.2233, 0.8183, 0.3823, 0.8381]}, {"w": "How", "b": [0.3886, 0.8183, 0.4376, 0.8381]}, {"w": "many", "b": [0.444, 0.8183, 0.5, 0.8381]}, {"w": "layers", "b": [0.5063, 0.8183, 0.5665, 0.8381]}, {"w": "contribute", "b": [0.5729, 0.8183, 0.6751, 0.8381]}, {"w": "to", "b": [0.6815, 0.8183, 0.7011, 0.8381]}, {"w": "a", "b": [0.7074, 0.8183, 0.7186, 0.8381]}, {"w": "model", "b": [0.7249, 0.8183, 0.788, 0.8381]}, {"w": "of", "b": [0.7943, 0.8183, 0.8153, 0.8381]}, {"w": "the", "b": [0.8216, 0.8183, 0.8524, 0.8381]}, {"w": "data", "b": [0.1294, 0.8388, 0.1714, 0.8586]}, {"w": "is", "b": [0.1777, 0.8388, 0.1946, 0.8586]}, {"w": "called", "b": [0.2009, 0.8388, 0.2611, 0.8586]}, {"w": "the", "b": [0.2674, 0.8388, 0.2982, 0.8586]}, {"w": "depth", "b": [0.3045, 0.8388, 0.3606, 0.8586]}, {"w": "of", "b": [0.3668, 0.8388, 0.3879, 0.8586]}, {"w": "the", "b": [0.3942, 0.8388, 0.425, 0.8586]}, {"w": "model.", "b": [0.4313, 0.8388, 0.5007, 0.8586]}, {"w": "Other", "b": [0.507, 0.8388, 0.5644, 0.8586]}, {"w": "appropriate", "b": [0.5707, 0.8388, 0.6856, 0.8586]}, {"w": "names", "b": [0.6919, 0.8388, 0.7564, 0.8586]}, {"w": "for", "b": [0.7627, 0.8388, 0.7921, 0.8586]}, {"w": "the", "b": [0.7984, 0.8388, 0.8292, 0.8586]}, {"w": "field", "b": [0.1294, 0.8593, 0.1757, 0.8791]}, {"w": "could", "b": [0.182, 0.8593, 0.238, 0.8791]}, {"w": "have", "b": [0.2443, 0.8593, 0.2919, 0.8791]}, {"w": "been", "b": [0.2982, 0.8593, 0.3459, 0.8791]}, {"w": "layered", "b": [0.3521, 0.8593, 0.4268, 0.8791]}, {"w": "representations", "b": [0.4331, 0.8593, 0.5882, 0.8791]}, {"w": "learning", "b": [0.5945, 0.8593, 0.68, 0.8791]}, {"w": "and", "b": [0.6863, 0.8593, 0.7227, 0.8791]}, {"w": "hierarchical", "b": [0.729, 0.8593, 0.8528, 0.8791]}, {"w": "representations", "b": [0.1294, 0.8798, 0.2845, 0.8996]}, {"w": "learning.", "b": [0.2908, 0.8798, 0.3826, 0.8996]}, {"w": "Modern", "b": [0.3889, 0.8798, 0.4687, 0.8996]}, {"w": "deep", "b": [0.4751, 0.8798, 0.5227, 0.8996]}, {"w": "learning", "b": [0.529, 0.8798, 0.6117, 0.8996]}, {"w": "often", "b": [0.618, 0.8798, 0.6698, 0.8996]}, {"w": "involves", "b": [0.6761, 0.8798, 0.7616, 0.8996]}, {"w": "tens", "b": [0.7679, 0.8798, 0.8085, 0.8996]}, {"w": "or", "b": [0.8148, 0.8798, 0.8359, 0.8996]}]}]}, {"page": 36, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "even hundreds of successive layers of representations—and they’re all learned automatically from exposure to training data. Meanwhile, other approaches to machine learning tend to focus on learning only one or two layers of representations of the data; hence, they’re sometimes called shallow learning.", "words": [{"w": "even", "b": [0.1294, 0.0857, 0.177, 0.1054]}, {"w": "hundreds", "b": [0.1833, 0.0857, 0.2758, 0.1054]}, {"w": "of", "b": [0.2821, 0.0857, 0.3031, 0.1054]}, {"w": "successive", "b": [0.3094, 0.0857, 0.4159, 0.1054]}, {"w": "layers", "b": [0.4222, 0.0857, 0.4825, 0.1054]}, {"w": "of", "b": [0.4888, 0.0857, 0.5098, 0.1054]}, {"w": "representations—and", "b": [0.5161, 0.0857, 0.7305, 0.1054]}, {"w": "they’re", "b": [0.7368, 0.0857, 0.8082, 0.1054]}, {"w": "all", "b": [0.8145, 0.0857, 0.8397, 0.1054]}, {"w": "learned", "b": [0.1294, 0.1062, 0.2037, 0.1259]}, {"w": "automatically", "b": [0.2099, 0.1062, 0.3473, 0.1259]}, {"w": "from", "b": [0.3536, 0.1062, 0.4026, 0.1259]}, {"w": "exposure", "b": [0.4089, 0.1062, 0.5, 0.1259]}, {"w": "to", "b": [0.5063, 0.1062, 0.5259, 0.1259]}, {"w": "training", "b": [0.5322, 0.1062, 0.6107, 0.1259]}, {"w": "data.", "b": [0.617, 0.1062, 0.6653, 0.1259]}, {"w": "Meanwhile,", "b": [0.6716, 0.1062, 0.7914, 0.1259]}, {"w": "other", "b": [0.7977, 0.1062, 0.8496, 0.1259]}, {"w": "approaches", "b": [0.1294, 0.1267, 0.2429, 0.1464]}, {"w": "to", "b": [0.2492, 0.1267, 0.2688, 0.1464]}, {"w": "machine", "b": [0.2751, 0.1267, 0.3606, 0.1464]}, {"w": "learning", "b": [0.3669, 0.1267, 0.4496, 0.1464]}, {"w": "tend", "b": [0.4559, 0.1267, 0.4993, 0.1464]}, {"w": "to", "b": [0.5056, 0.1267, 0.5252, 0.1464]}, {"w": "focus", "b": [0.5315, 0.1267, 0.5862, 0.1464]}, {"w": "on", "b": [0.5925, 0.1267, 0.6177, 0.1464]}, {"w": "learning", "b": [0.624, 0.1267, 0.7067, 0.1464]}, {"w": "only", "b": [0.713, 0.1267, 0.7578, 0.1464]}, {"w": "one", "b": [0.7641, 0.1267, 0.8005, 0.1464]}, {"w": "or", "b": [0.8068, 0.1267, 0.8278, 0.1464]}, {"w": "two", "b": [0.1294, 0.1472, 0.1673, 0.1669]}, {"w": "layers", "b": [0.1736, 0.1472, 0.2338, 0.1669]}, {"w": "of", "b": [0.2401, 0.1472, 0.2611, 0.1669]}, {"w": "representations", "b": [0.2674, 0.1472, 0.4201, 0.1669]}, {"w": "of", "b": [0.4264, 0.1472, 0.4475, 0.1669]}, {"w": "the", "b": [0.4538, 0.1472, 0.4846, 0.1669]}, {"w": "data;", "b": [0.4909, 0.1472, 0.5399, 0.1669]}, {"w": "hence,", "b": [0.5462, 0.1472, 0.6114, 0.1669]}, {"w": "they’re", "b": [0.6177, 0.1472, 0.6891, 0.1669]}, {"w": "sometimes", "b": [0.6954, 0.1472, 0.8033, 0.1669]}, {"w": "called", "b": [0.8097, 0.1472, 0.8699, 0.1669]}, {"w": "shallow", "b": [0.1294, 0.1677, 0.2079, 0.1874]}, {"w": "learning.", "b": [0.2142, 0.1677, 0.306, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "In deep learning, these layered representations are (almost always) learned via models called neural networks, structured in literal layers stacked on top of each other. The term neural network is a reference to neurobiology, but although some of the central concepts in deep learning were developed in part by drawing inspiration from our understanding of the brain, deep-learning models are not models of the brain. There’s no evidence that the brain implements anything like the learning mechanisms used in modern deep-learning models. You may come across pop-science articles proclaiming that deep learning works like the brain or was modeled after the brain, but that isn’t the case. It would be confusing and counterproductive for newcomers to the field to think of deep learning as being in any way related to neurobiology; you don’t need that shroud of “just like our minds” mystique and mystery, and you may as well forget anything you may have read about hypothetical links between deep learning and biology. For our purposes, deep learning is a mathematical framework for learning representations from data.", "words": [{"w": "In", "b": [0.1294, 0.2105, 0.1504, 0.2302]}, {"w": "deep", "b": [0.1567, 0.2105, 0.2044, 0.2302]}, {"w": "learning,", "b": [0.2107, 0.2105, 0.2996, 0.2302]}, {"w": "these", "b": [0.3059, 0.2105, 0.3578, 0.2302]}, {"w": "layered", "b": [0.3641, 0.2105, 0.4383, 0.2302]}, {"w": "representations", "b": [0.4446, 0.2105, 0.5973, 0.2302]}, {"w": "are", "b": [0.6037, 0.2105, 0.6345, 0.2302]}, {"w": "(almost", "b": [0.6408, 0.2105, 0.7164, 0.2302]}, {"w": "always)", "b": [0.7227, 0.2105, 0.8012, 0.2302]}, {"w": "learned", "b": [0.1294, 0.231, 0.2037, 0.2507]}, {"w": "via", "b": [0.21, 0.231, 0.2408, 0.2507]}, {"w": "models", "b": [0.2471, 0.231, 0.32, 0.2507]}, {"w": "called", "b": [0.3263, 0.231, 0.3865, 0.2507]}, {"w": "neural", "b": [0.3928, 0.231, 0.4586, 0.2507]}, {"w": "networks,", "b": [0.4649, 0.231, 0.5623, 0.2507]}, {"w": "structured", "b": [0.5686, 0.231, 0.6695, 0.2507]}, {"w": "in", "b": [0.6758, 0.231, 0.6954, 0.2507]}, {"w": "literal", "b": [0.7017, 0.231, 0.7606, 0.2507]}, {"w": "layers", "b": [0.7669, 0.231, 0.8271, 0.2507]}, {"w": "stacked", "b": [0.1294, 0.2515, 0.2051, 0.2712]}, {"w": "on", "b": [0.2114, 0.2515, 0.2366, 0.2712]}, {"w": "top", "b": [0.2429, 0.2515, 0.2751, 0.2712]}, {"w": "of", "b": [0.2814, 0.2515, 0.3025, 0.2712]}, {"w": "each", "b": [0.3088, 0.2515, 0.355, 0.2712]}, {"w": "other.", "b": [0.3613, 0.2515, 0.418, 0.2712]}, {"w": "The", "b": [0.4243, 0.2515, 0.4635, 0.2712]}, {"w": "term", "b": [0.4698, 0.2515, 0.5161, 0.2712]}, {"w": "neural", "b": [0.5224, 0.2515, 0.5882, 0.2712]}, {"w": "network", "b": [0.5945, 0.2515, 0.6758, 0.2712]}, {"w": "is", "b": [0.6821, 0.2515, 0.6989, 0.2712]}, {"w": "a", "b": [0.7052, 0.2515, 0.7164, 0.2712]}, {"w": "reference", "b": [0.7227, 0.2515, 0.8165, 0.2712]}, {"w": "to", "b": [0.8229, 0.2515, 0.8425, 0.2712]}, {"w": "neurobiology,", "b": [0.1294, 0.272, 0.2686, 0.2917]}, {"w": "but", "b": [0.2749, 0.272, 0.3071, 0.2917]}, {"w": "although", "b": [0.3134, 0.272, 0.4017, 0.2917]}, {"w": "some", "b": [0.408, 0.272, 0.4613, 0.2917]}, {"w": "of", "b": [0.4676, 0.272, 0.4886, 0.2917]}, {"w": "the", "b": [0.4949, 0.272, 0.5257, 0.2917]}, {"w": "central", "b": [0.5321, 0.272, 0.6007, 0.2917]}, {"w": "concepts", "b": [0.607, 0.272, 0.6953, 0.2917]}, {"w": "in", "b": [0.7016, 0.272, 0.7212, 0.2917]}, {"w": "deep", "b": [0.7275, 0.272, 0.7751, 0.2917]}, {"w": "learning", "b": [0.7814, 0.272, 0.8641, 0.2917]}, {"w": "were", "b": [0.1294, 0.2925, 0.1784, 0.3122]}, {"w": "developed", "b": [0.1847, 0.2925, 0.2884, 0.3122]}, {"w": "in", "b": [0.2947, 0.2925, 0.3143, 0.3122]}, {"w": "part", "b": [0.3206, 0.2925, 0.3599, 0.3122]}, {"w": "by", "b": [0.3662, 0.2925, 0.3914, 0.3122]}, {"w": "drawing", "b": [0.3977, 0.2925, 0.4804, 0.3122]}, {"w": "inspiration", "b": [0.4866, 0.2925, 0.5945, 0.3122]}, {"w": "from", "b": [0.6009, 0.2925, 0.6499, 0.3122]}, {"w": "our", "b": [0.6562, 0.2925, 0.6898, 0.3122]}, {"w": "understanding", "b": [0.6961, 0.2925, 0.8391, 0.3122]}, {"w": "of", "b": [0.8454, 0.2925, 0.8664, 0.3122]}, {"w": "the", "b": [0.1294, 0.313, 0.1602, 0.3327]}, {"w": "brain,", "b": [0.1665, 0.313, 0.2247, 0.3327]}, {"w": "deep-learning", "b": [0.231, 0.313, 0.3697, 0.3327]}, {"w": "models", "b": [0.376, 0.313, 0.4489, 0.3327]}, {"w": "are", "b": [0.4552, 0.313, 0.486, 0.3327]}, {"w": "not", "b": [0.4922, 0.313, 0.5245, 0.3327]}, {"w": "models", "b": [0.5308, 0.313, 0.6036, 0.3327]}, {"w": "of", "b": [0.6099, 0.313, 0.631, 0.3327]}, {"w": "the", "b": [0.6373, 0.313, 0.6681, 0.3327]}, {"w": "brain.", "b": [0.6744, 0.313, 0.7325, 0.3327]}, {"w": "There’s", "b": [0.7388, 0.313, 0.8145, 0.3327]}, {"w": "no", "b": [0.8208, 0.313, 0.846, 0.3327]}, {"w": "evidence", "b": [0.1294, 0.3335, 0.2191, 0.3532]}, {"w": "that", "b": [0.2254, 0.3335, 0.2632, 0.3532]}, {"w": "the", "b": [0.2695, 0.3335, 0.3003, 0.3532]}, {"w": "brain", "b": [0.3066, 0.3335, 0.3585, 0.3532]}, {"w": "implements", "b": [0.3648, 0.3335, 0.4825, 0.3532]}, {"w": "anything", "b": [0.4888, 0.3335, 0.5771, 0.3532]}, {"w": "like", "b": [0.5834, 0.3335, 0.6213, 0.3532]}, {"w": "the", "b": [0.6276, 0.3335, 0.6584, 0.3532]}, {"w": "learning", "b": [0.6647, 0.3335, 0.7474, 0.3532]}, {"w": "mechanisms", "b": [0.1294, 0.354, 0.2541, 0.3737]}, {"w": "used", "b": [0.2604, 0.354, 0.3067, 0.3737]}, {"w": "in", "b": [0.313, 0.354, 0.3326, 0.3737]}, {"w": "modern", "b": [0.3389, 0.354, 0.416, 0.3737]}, {"w": "deep-learning", "b": [0.4223, 0.354, 0.561, 0.3737]}, {"w": "models.", "b": [0.5672, 0.354, 0.6464, 0.3737]}, {"w": "You", "b": [0.6527, 0.354, 0.6936, 0.3737]}, {"w": "may", "b": [0.6999, 0.354, 0.7434, 0.3737]}, {"w": "come", "b": [0.7497, 0.354, 0.8043, 0.3737]}, {"w": "across", "b": [0.1294, 0.3745, 0.1925, 0.3942]}, {"w": "pop-science", "b": [0.1988, 0.3745, 0.3192, 0.3942]}, {"w": "articles", "b": [0.3255, 0.3745, 0.3984, 0.3942]}, {"w": "proclaiming", "b": [0.4047, 0.3745, 0.5266, 0.3942]}, {"w": "that", "b": [0.5329, 0.3745, 0.5708, 0.3942]}, {"w": "deep", "b": [0.5771, 0.3745, 0.6247, 0.3942]}, {"w": "learning", "b": [0.631, 0.3745, 0.7137, 0.3942]}, {"w": "works", "b": [0.72, 0.3745, 0.7816, 0.3942]}, {"w": "like", "b": [0.7879, 0.3745, 0.8258, 0.3942]}, {"w": "the", "b": [0.8321, 0.3745, 0.8629, 0.3942]}, {"w": "brain", "b": [0.1294, 0.395, 0.1813, 0.4147]}, {"w": "or", "b": [0.1876, 0.395, 0.2086, 0.4147]}, {"w": "was", "b": [0.2149, 0.395, 0.2541, 0.4147]}, {"w": "modeled", "b": [0.2604, 0.395, 0.3473, 0.4147]}, {"w": "after", "b": [0.3536, 0.395, 0.3998, 0.4147]}, {"w": "the", "b": [0.4061, 0.395, 0.4369, 0.4147]}, {"w": "brain,", "b": [0.4432, 0.395, 0.5013, 0.4147]}, {"w": "but", "b": [0.5077, 0.395, 0.5399, 0.4147]}, {"w": "that", "b": [0.5462, 0.395, 0.584, 0.4147]}, {"w": "isn’t", "b": [0.5903, 0.395, 0.6347, 0.4147]}, {"w": "the", "b": [0.641, 0.395, 0.6718, 0.4147]}, {"w": "case.", "b": [0.6781, 0.395, 0.7279, 0.4147]}, {"w": "It", "b": [0.7342, 0.395, 0.7496, 0.4147]}, {"w": "would", "b": [0.7559, 0.395, 0.819, 0.4147]}, {"w": "be", "b": [0.8253, 0.395, 0.8491, 0.4147]}, {"w": "confusing", "b": [0.1294, 0.4155, 0.2289, 0.4352]}, {"w": "and", "b": [0.2352, 0.4155, 0.2716, 0.4352]}, {"w": "counterproductive", "b": [0.2779, 0.4155, 0.4615, 0.4352]}, {"w": "for", "b": [0.4678, 0.4155, 0.4972, 0.4352]}, {"w": "newcomers", "b": [0.5035, 0.4155, 0.6184, 0.4352]}, {"w": "to", "b": [0.6247, 0.4155, 0.6443, 0.4352]}, {"w": "the", "b": [0.6506, 0.4155, 0.6815, 0.4352]}, {"w": "field", "b": [0.6878, 0.4155, 0.734, 0.4352]}, {"w": "to", "b": [0.7403, 0.4155, 0.7599, 0.4352]}, {"w": "think", "b": [0.7662, 0.4155, 0.8181, 0.4352]}, {"w": "of", "b": [0.8244, 0.4155, 0.8454, 0.4352]}, {"w": "deep", "b": [0.1294, 0.436, 0.177, 0.4557]}, {"w": "learning", "b": [0.1833, 0.436, 0.266, 0.4557]}, {"w": "as", "b": [0.2723, 0.436, 0.2933, 0.4557]}, {"w": "being", "b": [0.2996, 0.436, 0.3557, 0.4557]}, {"w": "in", "b": [0.362, 0.436, 0.3816, 0.4557]}, {"w": "any", "b": [0.3879, 0.436, 0.4243, 0.4557]}, {"w": "way", "b": [0.4306, 0.436, 0.4727, 0.4557]}, {"w": "related", "b": [0.479, 0.436, 0.5476, 0.4557]}, {"w": "to", "b": [0.5539, 0.436, 0.5735, 0.4557]}, {"w": "neurobiology;", "b": [0.5799, 0.436, 0.7214, 0.4557]}, {"w": "you", "b": [0.7277, 0.436, 0.7655, 0.4557]}, {"w": "don’t", "b": [0.7718, 0.436, 0.8246, 0.4557]}, {"w": "need", "b": [0.1294, 0.4565, 0.177, 0.4762]}, {"w": "that", "b": [0.1833, 0.4565, 0.2212, 0.4762]}, {"w": "shroud", "b": [0.2275, 0.4565, 0.2962, 0.4762]}, {"w": "of", "b": [0.3025, 0.4565, 0.3235, 0.4762]}, {"w": "“just", "b": [0.3298, 0.4565, 0.3774, 0.4762]}, {"w": "like", "b": [0.3837, 0.4565, 0.4216, 0.4762]}, {"w": "our", "b": [0.4279, 0.4565, 0.4615, 0.4762]}, {"w": "minds”", "b": [0.4678, 0.4565, 0.5407, 0.4762]}, {"w": "mystique", "b": [0.547, 0.4565, 0.6395, 0.4762]}, {"w": "and", "b": [0.6458, 0.4565, 0.6822, 0.4762]}, {"w": "mystery,", "b": [0.6885, 0.4565, 0.7744, 0.4762]}, {"w": "and", "b": [0.7807, 0.4565, 0.8171, 0.4762]}, {"w": "you", "b": [0.8234, 0.4565, 0.8613, 0.4762]}, {"w": "may", "b": [0.1294, 0.477, 0.1729, 0.4967]}, {"w": "as", "b": [0.1792, 0.477, 0.2002, 0.4967]}, {"w": "well", "b": [0.2065, 0.477, 0.2499, 0.4967]}, {"w": "forget", "b": [0.2562, 0.477, 0.316, 0.4967]}, {"w": "anything", "b": [0.3223, 0.477, 0.4106, 0.4967]}, {"w": "you", "b": [0.4169, 0.477, 0.4547, 0.4967]}, {"w": "may", "b": [0.461, 0.477, 0.5045, 0.4967]}, {"w": "have", "b": [0.5108, 0.477, 0.5584, 0.4967]}, {"w": "read", "b": [0.5647, 0.477, 0.6081, 0.4967]}, {"w": "about", "b": [0.6144, 0.477, 0.6705, 0.4967]}, {"w": "hypothetical", "b": [0.6768, 0.477, 0.8015, 0.4967]}, {"w": "links", "b": [0.8078, 0.477, 0.8569, 0.4967]}, {"w": "between", "b": [0.1294, 0.4975, 0.2135, 0.5172]}, {"w": "deep", "b": [0.2198, 0.4975, 0.2674, 0.5172]}, {"w": "learning", "b": [0.2737, 0.4975, 0.3564, 0.5172]}, {"w": "and", "b": [0.3627, 0.4975, 0.3991, 0.5172]}, {"w": "biology.", "b": [0.4054, 0.4975, 0.4871, 0.5172]}, {"w": "For", "b": [0.4934, 0.4975, 0.5285, 0.5172]}, {"w": "our", "b": [0.5348, 0.4975, 0.5684, 0.5172]}, {"w": "purposes,", "b": [0.5747, 0.4975, 0.6707, 0.5172]}, {"w": "deep", "b": [0.677, 0.4975, 0.7246, 0.5172]}, {"w": "learning", "b": [0.7309, 0.4975, 0.8136, 0.5172]}, {"w": "is", "b": [0.8199, 0.4975, 0.8367, 0.5172]}, {"w": "a", "b": [0.843, 0.4975, 0.8542, 0.5172]}, {"w": "mathematical", "b": [0.1294, 0.518, 0.2653, 0.5377]}, {"w": "framework", "b": [0.2716, 0.518, 0.3823, 0.5377]}, {"w": "for", "b": [0.3886, 0.518, 0.418, 0.5377]}, {"w": "learning", "b": [0.4243, 0.518, 0.507, 0.5377]}, {"w": "representations", "b": [0.5133, 0.518, 0.666, 0.5377]}, {"w": "from", "b": [0.6723, 0.518, 0.7214, 0.5377]}, {"w": "data.", "b": [0.7277, 0.518, 0.776, 0.5377]}]}, {"id": "b_2", "type": "paragraph", "text": "What do the representations learned by a deep-learning algorithm look like? Let’s examine how a network several layers deep (see figure 1.5) transforms an image of a digit in order to recognize what digit it is.", "words": [{"w": "What", "b": [0.1294, 0.5607, 0.1841, 0.5805]}, {"w": "do", "b": [0.1904, 0.5607, 0.2156, 0.5805]}, {"w": "the", "b": [0.2219, 0.5607, 0.2527, 0.5805]}, {"w": "representations", "b": [0.259, 0.5607, 0.4117, 0.5805]}, {"w": "learned", "b": [0.418, 0.5607, 0.4923, 0.5805]}, {"w": "by", "b": [0.4986, 0.5607, 0.5238, 0.5805]}, {"w": "a", "b": [0.5301, 0.5607, 0.5413, 0.5805]}, {"w": "deep-learning", "b": [0.5476, 0.5607, 0.6863, 0.5805]}, {"w": "algorithm", "b": [0.6926, 0.5607, 0.7907, 0.5805]}, {"w": "look", "b": [0.797, 0.5607, 0.8419, 0.5805]}, {"w": "like?", "b": [0.1294, 0.5812, 0.1785, 0.601]}, {"w": "Let’s", "b": [0.1848, 0.5812, 0.2352, 0.601]}, {"w": "examine", "b": [0.2415, 0.5812, 0.3269, 0.601]}, {"w": "how", "b": [0.3333, 0.5812, 0.3767, 0.601]}, {"w": "a", "b": [0.383, 0.5812, 0.3942, 0.601]}, {"w": "network", "b": [0.4005, 0.5812, 0.4832, 0.601]}, {"w": "several", "b": [0.4895, 0.5812, 0.5609, 0.601]}, {"w": "layers", "b": [0.5672, 0.5812, 0.6275, 0.601]}, {"w": "deep", "b": [0.6338, 0.5812, 0.6814, 0.601]}, {"w": "(see", "b": [0.6877, 0.5812, 0.7283, 0.601]}, {"w": "figure", "b": [0.7346, 0.5812, 0.7948, 0.601]}, {"w": "1.5)", "b": [0.8011, 0.5812, 0.841, 0.601]}, {"w": "transforms", "b": [0.1294, 0.6017, 0.2373, 0.6215]}, {"w": "an", "b": [0.2436, 0.6017, 0.2674, 0.6215]}, {"w": "image", "b": [0.2737, 0.6017, 0.3354, 0.6215]}, {"w": "of", "b": [0.3417, 0.6017, 0.3627, 0.6215]}, {"w": "a", "b": [0.369, 0.6017, 0.3802, 0.6215]}, {"w": "digit", "b": [0.3865, 0.6017, 0.4328, 0.6215]}, {"w": "in", "b": [0.4391, 0.6017, 0.4587, 0.6215]}, {"w": "order", "b": [0.465, 0.6017, 0.5182, 0.6215]}, {"w": "to", "b": [0.5245, 0.6017, 0.5442, 0.6215]}, {"w": "recognize", "b": [0.5505, 0.6017, 0.6485, 0.6215]}, {"w": "what", "b": [0.6548, 0.6017, 0.7039, 0.6215]}, {"w": "digit", "b": [0.7102, 0.6017, 0.7564, 0.6215]}, {"w": "it", "b": [0.7628, 0.6017, 0.7768, 0.6215]}, {"w": "is.", "b": [0.7831, 0.6017, 0.8062, 0.6215]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 1.5. A deep neural network for digit classification", "words": [{"w": "Figure", "b": [0.1294, 0.6396, 0.1827, 0.6544]}, {"w": "1.5.", "b": [0.1874, 0.6396, 0.2158, 0.6544]}, {"w": "A", "b": [0.2205, 0.6396, 0.2341, 0.6544]}, {"w": "deep", "b": [0.2389, 0.6396, 0.2767, 0.6544]}, {"w": "neural", "b": [0.2814, 0.6396, 0.334, 0.6544]}, {"w": "network", "b": [0.3387, 0.6396, 0.406, 0.6544]}, {"w": "for", "b": [0.4107, 0.6396, 0.4349, 0.6544]}, {"w": "digit", "b": [0.4396, 0.6396, 0.4764, 0.6544]}, {"w": "classification", "b": [0.4811, 0.6396, 0.5852, 0.6544]}]}, {"id": "b_4", "type": "paragraph", "text": "As you can see in figure 1.6, the network transforms the digit image into representations that are increasingly different from the original image", "words": [{"w": "As", "b": [0.1294, 0.8576, 0.1574, 0.8773]}, {"w": "you", "b": [0.1637, 0.8576, 0.2016, 0.8773]}, {"w": "can", "b": [0.2079, 0.8576, 0.2429, 0.8773]}, {"w": "see", "b": [0.2492, 0.8576, 0.2814, 0.8773]}, {"w": "in", "b": [0.2877, 0.8576, 0.3074, 0.8773]}, {"w": "figure", "b": [0.3136, 0.8576, 0.3739, 0.8773]}, {"w": "1.6,", "b": [0.3802, 0.8576, 0.418, 0.8773]}, {"w": "the", "b": [0.4243, 0.8576, 0.4551, 0.8773]}, {"w": "network", "b": [0.4614, 0.8576, 0.5441, 0.8773]}, {"w": "transforms", "b": [0.5504, 0.8576, 0.6583, 0.8773]}, {"w": "the", "b": [0.6646, 0.8576, 0.6954, 0.8773]}, {"w": "digit", "b": [0.7017, 0.8576, 0.748, 0.8773]}, {"w": "image", "b": [0.7543, 0.8576, 0.816, 0.8773]}, {"w": "into", "b": [0.8223, 0.8576, 0.8615, 0.8773]}, {"w": "representations", "b": [0.1294, 0.8781, 0.2821, 0.8978]}, {"w": "that", "b": [0.2884, 0.8781, 0.3263, 0.8978]}, {"w": "are", "b": [0.3326, 0.8781, 0.3634, 0.8978]}, {"w": "increasingly", "b": [0.3697, 0.8781, 0.493, 0.8978]}, {"w": "different", "b": [0.4993, 0.8781, 0.5856, 0.8978]}, {"w": "from", "b": [0.5919, 0.8781, 0.641, 0.8978]}, {"w": "the", "b": [0.6473, 0.8781, 0.6781, 0.8978]}, {"w": "original", "b": [0.6844, 0.8781, 0.7629, 0.8978]}, {"w": "image", "b": [0.7692, 0.8781, 0.8309, 0.8978]}]}]}, {"page": 37, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "and increasingly informative about the final result. You can think of a deep network as a multistage information-distillation operation, where information goes through successive filters and comes out increasingly purified (that is, useful with regard to some task).", "words": [{"w": "and", "b": [0.1294, 0.0857, 0.1658, 0.1054]}, {"w": "increasingly", "b": [0.1721, 0.0857, 0.2954, 0.1054]}, {"w": "informative", "b": [0.3017, 0.0857, 0.4195, 0.1054]}, {"w": "about", "b": [0.4258, 0.0857, 0.4818, 0.1054]}, {"w": "the", "b": [0.4881, 0.0857, 0.5189, 0.1054]}, {"w": "final", "b": [0.5252, 0.0857, 0.5715, 0.1054]}, {"w": "result.", "b": [0.5778, 0.0857, 0.6402, 0.1054]}, {"w": "You", "b": [0.6465, 0.0857, 0.6873, 0.1054]}, {"w": "can", "b": [0.6936, 0.0857, 0.7286, 0.1054]}, {"w": "think", "b": [0.7349, 0.0857, 0.7868, 0.1054]}, {"w": "of", "b": [0.7931, 0.0857, 0.8141, 0.1054]}, {"w": "a", "b": [0.8204, 0.0857, 0.8316, 0.1054]}, {"w": "deep", "b": [0.1294, 0.1062, 0.177, 0.1259]}, {"w": "network", "b": [0.1833, 0.1062, 0.266, 0.1259]}, {"w": "as", "b": [0.2723, 0.1062, 0.2933, 0.1259]}, {"w": "a", "b": [0.2996, 0.1062, 0.3108, 0.1259]}, {"w": "multistage", "b": [0.3171, 0.1062, 0.4223, 0.1259]}, {"w": "information-distillation", "b": [0.4286, 0.1062, 0.664, 0.1259]}, {"w": "operation,", "b": [0.6702, 0.1062, 0.7718, 0.1259]}, {"w": "where", "b": [0.7781, 0.1062, 0.8397, 0.1259]}, {"w": "information", "b": [0.1294, 0.1267, 0.2485, 0.1464]}, {"w": "goes", "b": [0.2548, 0.1267, 0.3011, 0.1464]}, {"w": "through", "b": [0.3074, 0.1267, 0.3859, 0.1464]}, {"w": "successive", "b": [0.3922, 0.1267, 0.4986, 0.1464]}, {"w": "filters", "b": [0.5049, 0.1267, 0.5638, 0.1464]}, {"w": "and", "b": [0.5701, 0.1267, 0.6065, 0.1464]}, {"w": "comes", "b": [0.6128, 0.1267, 0.6773, 0.1464]}, {"w": "out", "b": [0.6836, 0.1267, 0.7158, 0.1464]}, {"w": "increasingly", "b": [0.7221, 0.1267, 0.8454, 0.1464]}, {"w": "purified", "b": [0.1294, 0.1472, 0.2093, 0.1669]}, {"w": "(that", "b": [0.2156, 0.1472, 0.2618, 0.1669]}, {"w": "is,", "b": [0.2681, 0.1472, 0.2913, 0.1669]}, {"w": "useful", "b": [0.2976, 0.1472, 0.3592, 0.1669]}, {"w": "with", "b": [0.3655, 0.1472, 0.4104, 0.1669]}, {"w": "regard", "b": [0.4167, 0.1472, 0.4811, 0.1669]}, {"w": "to", "b": [0.4874, 0.1472, 0.5071, 0.1669]}, {"w": "some", "b": [0.5134, 0.1472, 0.5666, 0.1669]}, {"w": "task).", "b": [0.5729, 0.1472, 0.6283, 0.1669]}]}, {"id": "b_1", "type": "equation", "text": "Figure 1.6. Deep representations learned by a digit-classification model", "words": [{"w": "Figure", "b": [0.1294, 0.185, 0.1827, 0.1998]}, {"w": "1.6.", "b": [0.1874, 0.185, 0.2158, 0.1998]}, {"w": "Deep", "b": [0.2205, 0.185, 0.2615, 0.1998]}, {"w": "representations", "b": [0.2662, 0.185, 0.3906, 0.1998]}, {"w": "learned", "b": [0.3953, 0.185, 0.4562, 0.1998]}, {"w": "by", "b": [0.461, 0.185, 0.481, 0.1998]}, {"w": "a", "b": [0.4857, 0.185, 0.4951, 0.1998]}, {"w": "digit-classification", "b": [0.4999, 0.185, 0.647, 0.1998]}, {"w": "model", "b": [0.6518, 0.185, 0.7012, 0.1998]}]}, {"id": "b_2", "type": "paragraph", "text": "So that’s what deep learning is, technically: a multistage way to learn data representations. It’s a simple idea—but, as it turns out, very simple mechanisms, sufficiently scaled, can end up looking like magic.", "words": [{"w": "So", "b": [0.1294, 0.5331, 0.1561, 0.5529]}, {"w": "that’s", "b": [0.1624, 0.5331, 0.217, 0.5529]}, {"w": "what", "b": [0.2233, 0.5331, 0.2724, 0.5529]}, {"w": "deep", "b": [0.2787, 0.5331, 0.3263, 0.5529]}, {"w": "learning", "b": [0.3326, 0.5331, 0.4153, 0.5529]}, {"w": "is,", "b": [0.4216, 0.5331, 0.4447, 0.5529]}, {"w": "technically:", "b": [0.451, 0.5331, 0.5687, 0.5529]}, {"w": "a", "b": [0.575, 0.5331, 0.5862, 0.5529]}, {"w": "multistage", "b": [0.5925, 0.5331, 0.6976, 0.5529]}, {"w": "way", "b": [0.7039, 0.5331, 0.746, 0.5529]}, {"w": "to", "b": [0.7523, 0.5331, 0.7719, 0.5529]}, {"w": "learn", "b": [0.7782, 0.5331, 0.8286, 0.5529]}, {"w": "data", "b": [0.1294, 0.5536, 0.1714, 0.5734]}, {"w": "representations.", "b": [0.1777, 0.5536, 0.3368, 0.5734]}, {"w": "It’s", "b": [0.3431, 0.5536, 0.3753, 0.5734]}, {"w": "a", "b": [0.3816, 0.5536, 0.3928, 0.5734]}, {"w": "simple", "b": [0.3991, 0.5536, 0.4664, 0.5734]}, {"w": "idea—but,", "b": [0.4727, 0.5536, 0.5785, 0.5734]}, {"w": "as", "b": [0.5848, 0.5536, 0.6058, 0.5734]}, {"w": "it", "b": [0.6121, 0.5536, 0.6261, 0.5734]}, {"w": "turns", "b": [0.6324, 0.5536, 0.6828, 0.5734]}, {"w": "out,", "b": [0.6891, 0.5536, 0.7277, 0.5734]}, {"w": "very", "b": [0.734, 0.5536, 0.7788, 0.5734]}, {"w": "simple", "b": [0.7851, 0.5536, 0.8524, 0.5734]}, {"w": "mechanisms,", "b": [0.1294, 0.5741, 0.2604, 0.5939]}, {"w": "sufficiently", "b": [0.2667, 0.5741, 0.3812, 0.5939]}, {"w": "scaled,", "b": [0.3875, 0.5741, 0.4568, 0.5939]}, {"w": "can", "b": [0.4631, 0.5741, 0.4981, 0.5939]}, {"w": "end", "b": [0.5045, 0.5741, 0.5409, 0.5939]}, {"w": "up", "b": [0.5472, 0.5741, 0.5724, 0.5939]}, {"w": "looking", "b": [0.5787, 0.5741, 0.6558, 0.5939]}, {"w": "like", "b": [0.6621, 0.5741, 0.7, 0.5939]}, {"w": "magic.", "b": [0.7063, 0.5741, 0.7742, 0.5939]}]}, {"id": "b_3", "type": "paragraph", "text": "1.1.5. Understanding how deep learning works, in three figures", "words": [{"w": "1.1.5.", "b": [0.1294, 0.6214, 0.1862, 0.6411]}, {"w": "Understanding", "b": [0.1925, 0.6214, 0.3537, 0.6411]}, {"w": "how", "b": [0.36, 0.6214, 0.4048, 0.6411]}, {"w": "deep", "b": [0.4111, 0.6214, 0.4616, 0.6411]}, {"w": "learning", "b": [0.4679, 0.6214, 0.5576, 0.6411]}, {"w": "works,", "b": [0.5639, 0.6214, 0.6361, 0.6411]}, {"w": "in", "b": [0.6424, 0.6214, 0.6634, 0.6411]}, {"w": "three", "b": [0.6697, 0.6214, 0.7253, 0.6411]}, {"w": "figures", "b": [0.7316, 0.6214, 0.8054, 0.6411]}]}, {"id": "b_4", "type": "paragraph", "text": "At this point, you know that machine learning is about mapping inputs (such as images) to targets (such as the label “cat”), which is done by observing many examples of input and targets. You also know that deep neural networks do this input-to-target mapping via a deep sequence of simple data transformations (layers) and that these data transformations are learned by exposure to examples. Now let���s look at how this learning happens, concretely.", "words": [{"w": "At", "b": [0.1294, 0.6641, 0.1546, 0.6839]}, {"w": "this", "b": [0.1609, 0.6641, 0.1974, 0.6839]}, {"w": "point,", "b": [0.2037, 0.6641, 0.2619, 0.6839]}, {"w": "you", "b": [0.2682, 0.6641, 0.306, 0.6839]}, {"w": "know", "b": [0.3123, 0.6641, 0.3684, 0.6839]}, {"w": "that", "b": [0.3747, 0.6641, 0.4125, 0.6839]}, {"w": "machine", "b": [0.4188, 0.6641, 0.5043, 0.6839]}, {"w": "learning", "b": [0.5106, 0.6641, 0.5933, 0.6839]}, {"w": "is", "b": [0.5996, 0.6641, 0.6164, 0.6839]}, {"w": "about", "b": [0.6227, 0.6641, 0.6788, 0.6839]}, {"w": "mapping", "b": [0.6851, 0.6641, 0.7734, 0.6839]}, {"w": "inputs", "b": [0.7797, 0.6641, 0.8413, 0.6839]}, {"w": "(such", "b": [0.1294, 0.6846, 0.1841, 0.7044]}, {"w": "as", "b": [0.1904, 0.6846, 0.2114, 0.7044]}, {"w": "images)", "b": [0.2177, 0.6846, 0.2975, 0.7044]}, {"w": "to", "b": [0.3038, 0.6846, 0.3235, 0.7044]}, {"w": "targets", "b": [0.3298, 0.6846, 0.3966, 0.7044]}, {"w": "(such", "b": [0.4029, 0.6846, 0.4575, 0.7044]}, {"w": "as", "b": [0.4638, 0.6846, 0.4848, 0.7044]}, {"w": "the", "b": [0.4911, 0.6846, 0.522, 0.7044]}, {"w": "label", "b": [0.5283, 0.6846, 0.5773, 0.7044]}, {"w": "“cat”),", "b": [0.5836, 0.6846, 0.6501, 0.7044]}, {"w": "which", "b": [0.6564, 0.6846, 0.718, 0.7044]}, {"w": "is", "b": [0.7243, 0.6846, 0.7412, 0.7044]}, {"w": "done", "b": [0.7475, 0.6846, 0.7965, 0.7044]}, {"w": "by", "b": [0.8028, 0.6846, 0.828, 0.7044]}, {"w": "observing", "b": [0.1294, 0.7051, 0.2289, 0.7249]}, {"w": "many", "b": [0.2352, 0.7051, 0.2913, 0.7249]}, {"w": "examples", "b": [0.2976, 0.7051, 0.3928, 0.7249]}, {"w": "of", "b": [0.3992, 0.7051, 0.4202, 0.7249]}, {"w": "input", "b": [0.4265, 0.7051, 0.4783, 0.7249]}, {"w": "and", "b": [0.4846, 0.7051, 0.5211, 0.7249]}, {"w": "targets.", "b": [0.5274, 0.7051, 0.6004, 0.7249]}, {"w": "You", "b": [0.6067, 0.7051, 0.6476, 0.7249]}, {"w": "also", "b": [0.654, 0.7051, 0.6946, 0.7249]}, {"w": "know", "b": [0.7009, 0.7051, 0.757, 0.7249]}, {"w": "that", "b": [0.7633, 0.7051, 0.8011, 0.7249]}, {"w": "deep", "b": [0.8074, 0.7051, 0.855, 0.7249]}, {"w": "neural", "b": [0.1294, 0.7256, 0.1925, 0.7454]}, {"w": "networks", "b": [0.1988, 0.7256, 0.2912, 0.7454]}, {"w": "do", "b": [0.2975, 0.7256, 0.3228, 0.7454]}, {"w": "this", "b": [0.3291, 0.7256, 0.3655, 0.7454]}, {"w": "input-to-target", "b": [0.3718, 0.7256, 0.5171, 0.7454]}, {"w": "mapping", "b": [0.5234, 0.7256, 0.6117, 0.7454]}, {"w": "via", "b": [0.618, 0.7256, 0.6488, 0.7454]}, {"w": "a", "b": [0.6551, 0.7256, 0.6663, 0.7454]}, {"w": "deep", "b": [0.6726, 0.7256, 0.7202, 0.7454]}, {"w": "sequence", "b": [0.7265, 0.7256, 0.819, 0.7454]}, {"w": "of", "b": [0.8253, 0.7256, 0.8463, 0.7454]}, {"w": "simple", "b": [0.1294, 0.7461, 0.1967, 0.7659]}, {"w": "data", "b": [0.203, 0.7461, 0.245, 0.7659]}, {"w": "transformations", "b": [0.2513, 0.7461, 0.4097, 0.7659]}, {"w": "(layers)", "b": [0.416, 0.7461, 0.493, 0.7659]}, {"w": "and", "b": [0.4993, 0.7461, 0.5357, 0.7659]}, {"w": "that", "b": [0.5421, 0.7461, 0.5799, 0.7659]}, {"w": "these", "b": [0.5862, 0.7461, 0.638, 0.7659]}, {"w": "data", "b": [0.6443, 0.7461, 0.6864, 0.7659]}, {"w": "transformations", "b": [0.6927, 0.7461, 0.851, 0.7659]}, {"w": "are", "b": [0.1294, 0.7666, 0.1602, 0.7864]}, {"w": "learned", "b": [0.1665, 0.7666, 0.2408, 0.7864]}, {"w": "by", "b": [0.2471, 0.7666, 0.2723, 0.7864]}, {"w": "exposure", "b": [0.2786, 0.7666, 0.3697, 0.7864]}, {"w": "to", "b": [0.3759, 0.7666, 0.3956, 0.7864]}, {"w": "examples.", "b": [0.4019, 0.7666, 0.5035, 0.7864]}, {"w": "Now", "b": [0.5098, 0.7666, 0.5588, 0.7864]}, {"w": "let’s", "b": [0.5651, 0.7666, 0.6071, 0.7864]}, {"w": "look", "b": [0.6134, 0.7666, 0.6583, 0.7864]}, {"w": "at", "b": [0.6646, 0.7666, 0.6828, 0.7864]}, {"w": "how", "b": [0.6891, 0.7666, 0.7325, 0.7864]}, {"w": "this", "b": [0.7389, 0.7666, 0.7753, 0.7864]}, {"w": "learning", "b": [0.7816, 0.7666, 0.8643, 0.7864]}, {"w": "happens,", "b": [0.1294, 0.7871, 0.2184, 0.8069]}, {"w": "concretely.", "b": [0.2247, 0.7871, 0.3344, 0.8069]}]}, {"id": "b_5", "type": "paragraph", "text": "The specification of what a layer does to its input data is stored in the layer’s weights, which in essence are a bunch of numbers. In technical terms, we’d say that the transformation implemented by a layer is parameterized by its weights (see figure 1.7). (Weights are also", "words": [{"w": "The", "b": [0.1294, 0.8299, 0.1686, 0.8497]}, {"w": "specification", "b": [0.1749, 0.8299, 0.3038, 0.8497]}, {"w": "of", "b": [0.3102, 0.8299, 0.3312, 0.8497]}, {"w": "what", "b": [0.3375, 0.8299, 0.3865, 0.8497]}, {"w": "a", "b": [0.3928, 0.8299, 0.404, 0.8497]}, {"w": "layer", "b": [0.4103, 0.8299, 0.4608, 0.8497]}, {"w": "does", "b": [0.4671, 0.8299, 0.5133, 0.8497]}, {"w": "to", "b": [0.5196, 0.8299, 0.5392, 0.8497]}, {"w": "its", "b": [0.5455, 0.8299, 0.5694, 0.8497]}, {"w": "input", "b": [0.5757, 0.8299, 0.6275, 0.8497]}, {"w": "data", "b": [0.6339, 0.8299, 0.6759, 0.8497]}, {"w": "is", "b": [0.6822, 0.8299, 0.699, 0.8497]}, {"w": "stored", "b": [0.7053, 0.8299, 0.767, 0.8497]}, {"w": "in", "b": [0.7733, 0.8299, 0.7929, 0.8497]}, {"w": "the", "b": [0.7992, 0.8299, 0.83, 0.8497]}, {"w": "layer’s", "b": [0.1294, 0.8504, 0.1976, 0.8702]}, {"w": "weights,", "b": [0.2039, 0.8504, 0.2873, 0.8702]}, {"w": "which", "b": [0.2936, 0.8504, 0.3552, 0.8702]}, {"w": "in", "b": [0.3615, 0.8504, 0.3812, 0.8702]}, {"w": "essence", "b": [0.3875, 0.8504, 0.4645, 0.8702]}, {"w": "are", "b": [0.4708, 0.8504, 0.5016, 0.8702]}, {"w": "a", "b": [0.5079, 0.8504, 0.5191, 0.8702]}, {"w": "bunch", "b": [0.5254, 0.8504, 0.5871, 0.8702]}, {"w": "of", "b": [0.5934, 0.8504, 0.6144, 0.8702]}, {"w": "numbers.", "b": [0.6207, 0.8504, 0.7139, 0.8702]}, {"w": "In", "b": [0.7202, 0.8504, 0.7412, 0.8702]}, {"w": "technical", "b": [0.7475, 0.8504, 0.8386, 0.8702]}, {"w": "terms,", "b": [0.1294, 0.8709, 0.1918, 0.8907]}, {"w": "we’d", "b": [0.1981, 0.8709, 0.2485, 0.8907]}, {"w": "say", "b": [0.2548, 0.8709, 0.2884, 0.8907]}, {"w": "that", "b": [0.2947, 0.8709, 0.3326, 0.8907]}, {"w": "the", "b": [0.3389, 0.8709, 0.3697, 0.8907]}, {"w": "transformation", "b": [0.376, 0.8709, 0.5245, 0.8907]}, {"w": "implemented", "b": [0.5309, 0.8709, 0.6626, 0.8907]}, {"w": "by", "b": [0.6689, 0.8709, 0.6941, 0.8907]}, {"w": "a", "b": [0.7004, 0.8709, 0.7116, 0.8907]}, {"w": "layer", "b": [0.7179, 0.8709, 0.7684, 0.8907]}, {"w": "is", "b": [0.7747, 0.8709, 0.7915, 0.8907]}, {"w": "parameterized", "b": [0.1294, 0.8914, 0.2751, 0.9112]}, {"w": "by", "b": [0.2814, 0.8914, 0.3067, 0.9112]}, {"w": "its", "b": [0.313, 0.8914, 0.3368, 0.9112]}, {"w": "weights", "b": [0.3431, 0.8914, 0.4216, 0.9112]}, {"w": "(see", "b": [0.4279, 0.8914, 0.4685, 0.9112]}, {"w": "figure", "b": [0.4748, 0.8914, 0.535, 0.9112]}, {"w": "1.7).", "b": [0.5413, 0.8914, 0.5876, 0.9112]}, {"w": "(Weights", "b": [0.5939, 0.8914, 0.6843, 0.9112]}, {"w": "are", "b": [0.6906, 0.8914, 0.7214, 0.9112]}, {"w": "also", "b": [0.7277, 0.8914, 0.7684, 0.9112]}]}]}, {"page": 38, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "sometimes called the parameters of a layer.) In this context, learning means finding a set of values for the weights of all layers in a network, such that the network will correctly map example inputs to their associated targets. But here’s the thing: a deep neural network can contain tens of millions of parameters. Finding the correct value for all of them may seem like a daunting task, especially given that modifying the value of one parameter will affect the behavior of all the others!", "words": [{"w": "sometimes", "b": [0.1294, 0.0857, 0.2373, 0.1054]}, {"w": "called", "b": [0.2436, 0.0857, 0.3039, 0.1054]}, {"w": "the", "b": [0.3102, 0.0857, 0.341, 0.1054]}, {"w": "parameters", "b": [0.3473, 0.0857, 0.4622, 0.1054]}, {"w": "of", "b": [0.4685, 0.0857, 0.4895, 0.1054]}, {"w": "a", "b": [0.4958, 0.0857, 0.507, 0.1054]}, {"w": "layer.)", "b": [0.5133, 0.0857, 0.577, 0.1054]}, {"w": "In", "b": [0.5833, 0.0857, 0.6043, 0.1054]}, {"w": "this", "b": [0.6106, 0.0857, 0.6471, 0.1054]}, {"w": "context,", "b": [0.6534, 0.0857, 0.734, 0.1054]}, {"w": "learning", "b": [0.7402, 0.0857, 0.8257, 0.1054]}, {"w": "means", "b": [0.1294, 0.1062, 0.1939, 0.1259]}, {"w": "finding", "b": [0.2002, 0.1062, 0.273, 0.1259]}, {"w": "a", "b": [0.2794, 0.1062, 0.2906, 0.1259]}, {"w": "set", "b": [0.2969, 0.1062, 0.3249, 0.1259]}, {"w": "of", "b": [0.3312, 0.1062, 0.3522, 0.1259]}, {"w": "values", "b": [0.3585, 0.1062, 0.423, 0.1259]}, {"w": "for", "b": [0.4293, 0.1062, 0.4587, 0.1259]}, {"w": "the", "b": [0.465, 0.1062, 0.4958, 0.1259]}, {"w": "weights", "b": [0.5021, 0.1062, 0.5806, 0.1259]}, {"w": "of", "b": [0.5869, 0.1062, 0.6079, 0.1259]}, {"w": "all", "b": [0.6142, 0.1062, 0.6395, 0.1259]}, {"w": "layers", "b": [0.6458, 0.1062, 0.706, 0.1259]}, {"w": "in", "b": [0.7123, 0.1062, 0.7319, 0.1259]}, {"w": "a", "b": [0.7382, 0.1062, 0.7494, 0.1259]}, {"w": "network,", "b": [0.7557, 0.1062, 0.8447, 0.1259]}, {"w": "such", "b": [0.1294, 0.1267, 0.1757, 0.1464]}, {"w": "that", "b": [0.182, 0.1267, 0.2198, 0.1464]}, {"w": "the", "b": [0.2261, 0.1267, 0.2569, 0.1464]}, {"w": "network", "b": [0.2632, 0.1267, 0.3459, 0.1464]}, {"w": "will", "b": [0.3522, 0.1267, 0.3915, 0.1464]}, {"w": "correctly", "b": [0.3978, 0.1267, 0.4874, 0.1464]}, {"w": "map", "b": [0.4937, 0.1267, 0.5372, 0.1464]}, {"w": "example", "b": [0.5435, 0.1267, 0.6289, 0.1464]}, {"w": "inputs", "b": [0.6351, 0.1267, 0.6968, 0.1464]}, {"w": "to", "b": [0.7031, 0.1267, 0.7228, 0.1464]}, {"w": "their", "b": [0.7291, 0.1267, 0.7753, 0.1464]}, {"w": "associated", "b": [0.1294, 0.1472, 0.2331, 0.1669]}, {"w": "targets.", "b": [0.2394, 0.1472, 0.3125, 0.1669]}, {"w": "But", "b": [0.3188, 0.1472, 0.3552, 0.1669]}, {"w": "here’s", "b": [0.3615, 0.1472, 0.4218, 0.1669]}, {"w": "the", "b": [0.4281, 0.1472, 0.4589, 0.1669]}, {"w": "thing:", "b": [0.4652, 0.1472, 0.5241, 0.1669]}, {"w": "a", "b": [0.5304, 0.1472, 0.5416, 0.1669]}, {"w": "deep", "b": [0.5479, 0.1472, 0.5955, 0.1669]}, {"w": "neural", "b": [0.6018, 0.1472, 0.6649, 0.1669]}, {"w": "network", "b": [0.6712, 0.1472, 0.7538, 0.1669]}, {"w": "can", "b": [0.7601, 0.1472, 0.7952, 0.1669]}, {"w": "contain", "b": [0.1294, 0.1677, 0.2037, 0.1874]}, {"w": "tens", "b": [0.21, 0.1677, 0.2506, 0.1874]}, {"w": "of", "b": [0.2569, 0.1677, 0.2779, 0.1874]}, {"w": "millions", "b": [0.2842, 0.1677, 0.367, 0.1874]}, {"w": "of", "b": [0.3733, 0.1677, 0.3943, 0.1874]}, {"w": "parameters.", "b": [0.4006, 0.1677, 0.5176, 0.1874]}, {"w": "Finding", "b": [0.5238, 0.1677, 0.6023, 0.1874]}, {"w": "the", "b": [0.6086, 0.1677, 0.6394, 0.1874]}, {"w": "correct", "b": [0.6457, 0.1677, 0.7158, 0.1874]}, {"w": "value", "b": [0.7221, 0.1677, 0.7767, 0.1874]}, {"w": "for", "b": [0.783, 0.1677, 0.8124, 0.1874]}, {"w": "all", "b": [0.8187, 0.1677, 0.844, 0.1874]}, {"w": "of", "b": [0.1294, 0.1882, 0.1504, 0.2079]}, {"w": "them", "b": [0.1567, 0.1882, 0.2072, 0.2079]}, {"w": "may", "b": [0.2135, 0.1882, 0.2569, 0.2079]}, {"w": "seem", "b": [0.2632, 0.1882, 0.3151, 0.2079]}, {"w": "like", "b": [0.3214, 0.1882, 0.3592, 0.2079]}, {"w": "a", "b": [0.3655, 0.1882, 0.3767, 0.2079]}, {"w": "daunting", "b": [0.383, 0.1882, 0.4713, 0.2079]}, {"w": "task,", "b": [0.4776, 0.1882, 0.5246, 0.2079]}, {"w": "especially", "b": [0.5309, 0.1882, 0.6318, 0.2079]}, {"w": "given", "b": [0.6381, 0.1882, 0.6941, 0.2079]}, {"w": "that", "b": [0.7004, 0.1882, 0.7383, 0.2079]}, {"w": "modifying", "b": [0.7446, 0.1882, 0.8497, 0.2079]}, {"w": "the", "b": [0.1294, 0.2087, 0.1602, 0.2284]}, {"w": "value", "b": [0.1665, 0.2087, 0.2212, 0.2284]}, {"w": "of", "b": [0.2275, 0.2087, 0.2485, 0.2284]}, {"w": "one", "b": [0.2548, 0.2087, 0.2912, 0.2284]}, {"w": "parameter", "b": [0.2975, 0.2087, 0.3984, 0.2284]}, {"w": "will", "b": [0.4047, 0.2087, 0.4439, 0.2284]}, {"w": "affect", "b": [0.4502, 0.2087, 0.5072, 0.2284]}, {"w": "the", "b": [0.5135, 0.2087, 0.5443, 0.2284]}, {"w": "behavior", "b": [0.5506, 0.2087, 0.6389, 0.2284]}, {"w": "of", "b": [0.6452, 0.2087, 0.6662, 0.2284]}, {"w": "all", "b": [0.6725, 0.2087, 0.6977, 0.2284]}, {"w": "the", "b": [0.704, 0.2087, 0.7348, 0.2284]}, {"w": "others!", "b": [0.7412, 0.2087, 0.8112, 0.2284]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 1.7. A neural network is parameterized by its weights.", "words": [{"w": "Figure", "b": [0.1294, 0.2465, 0.1827, 0.2613]}, {"w": "1.7.", "b": [0.1874, 0.2465, 0.2158, 0.2613]}, {"w": "A", "b": [0.2205, 0.2465, 0.2341, 0.2613]}, {"w": "neural", "b": [0.2389, 0.2465, 0.2914, 0.2613]}, {"w": "network", "b": [0.2962, 0.2465, 0.3634, 0.2613]}, {"w": "is", "b": [0.3681, 0.2465, 0.3808, 0.2613]}, {"w": "parameterized", "b": [0.3855, 0.2465, 0.5032, 0.2613]}, {"w": "by", "b": [0.5079, 0.2465, 0.5279, 0.2613]}, {"w": "its", "b": [0.5326, 0.2465, 0.5515, 0.2613]}, {"w": "weights.", "b": [0.5563, 0.2465, 0.6219, 0.2613]}]}, {"id": "b_2", "type": "paragraph", "text": "To control something, first you need to be able to observe it. To control the output of a neural network, you need to be able to measure how far this output is from what you expected. This is the job of the loss function of the network, also called the objective function. The loss function takes the predictions of the network and the true target (what you wanted the network to output) and computes a distance score, capturing how well the network has done on this specific example (see figure 1.8).", "words": [{"w": "To", "b": [0.1294, 0.4903, 0.1557, 0.5101]}, {"w": "control", "b": [0.162, 0.4903, 0.2334, 0.5101]}, {"w": "something,", "b": [0.2397, 0.4903, 0.3512, 0.5101]}, {"w": "first", "b": [0.3575, 0.4903, 0.3981, 0.5101]}, {"w": "you", "b": [0.4044, 0.4903, 0.4423, 0.5101]}, {"w": "need", "b": [0.4486, 0.4903, 0.4962, 0.5101]}, {"w": "to", "b": [0.5025, 0.4903, 0.5221, 0.5101]}, {"w": "be", "b": [0.5284, 0.4903, 0.5522, 0.5101]}, {"w": "able", "b": [0.5586, 0.4903, 0.6006, 0.5101]}, {"w": "to", "b": [0.6069, 0.4903, 0.6265, 0.5101]}, {"w": "observe", "b": [0.6328, 0.4903, 0.7113, 0.5101]}, {"w": "it.", "b": [0.7176, 0.4903, 0.7379, 0.5101]}, {"w": "To", "b": [0.7442, 0.4903, 0.7704, 0.5101]}, {"w": "control", "b": [0.7767, 0.4903, 0.8482, 0.5101]}, {"w": "the", "b": [0.1294, 0.5108, 0.1602, 0.5306]}, {"w": "output", "b": [0.1665, 0.5108, 0.231, 0.5306]}, {"w": "of", "b": [0.2373, 0.5108, 0.2583, 0.5306]}, {"w": "a", "b": [0.2646, 0.5108, 0.2758, 0.5306]}, {"w": "neural", "b": [0.2822, 0.5108, 0.3452, 0.5306]}, {"w": "network,", "b": [0.3515, 0.5108, 0.4405, 0.5306]}, {"w": "you", "b": [0.4468, 0.5108, 0.4846, 0.5306]}, {"w": "need", "b": [0.4909, 0.5108, 0.5385, 0.5306]}, {"w": "to", "b": [0.5449, 0.5108, 0.5645, 0.5306]}, {"w": "be", "b": [0.5708, 0.5108, 0.5946, 0.5306]}, {"w": "able", "b": [0.6009, 0.5108, 0.6429, 0.5306]}, {"w": "to", "b": [0.6492, 0.5108, 0.6688, 0.5306]}, {"w": "measure", "b": [0.6751, 0.5108, 0.7591, 0.5306]}, {"w": "how", "b": [0.7655, 0.5108, 0.8089, 0.5306]}, {"w": "far", "b": [0.8152, 0.5108, 0.8432, 0.5306]}, {"w": "this", "b": [0.1294, 0.5313, 0.1659, 0.5511]}, {"w": "output", "b": [0.1722, 0.5313, 0.2366, 0.5511]}, {"w": "is", "b": [0.243, 0.5313, 0.2598, 0.5511]}, {"w": "from", "b": [0.2661, 0.5313, 0.3151, 0.5511]}, {"w": "what", "b": [0.3214, 0.5313, 0.3705, 0.5511]}, {"w": "you", "b": [0.3768, 0.5313, 0.4146, 0.5511]}, {"w": "expected.", "b": [0.4209, 0.5313, 0.5169, 0.5511]}, {"w": "This", "b": [0.5232, 0.5313, 0.568, 0.5511]}, {"w": "is", "b": [0.5743, 0.5313, 0.5912, 0.5511]}, {"w": "the", "b": [0.5975, 0.5313, 0.6283, 0.5511]}, {"w": "job", "b": [0.6346, 0.5313, 0.6668, 0.5511]}, {"w": "of", "b": [0.6732, 0.5313, 0.6942, 0.5511]}, {"w": "the", "b": [0.7005, 0.5313, 0.7313, 0.5511]}, {"w": "loss", "b": [0.7375, 0.5313, 0.7768, 0.5511]}, {"w": "function", "b": [0.7831, 0.5313, 0.8658, 0.5511]}, {"w": "of", "b": [0.1294, 0.5518, 0.1504, 0.5716]}, {"w": "the", "b": [0.1567, 0.5518, 0.1876, 0.5716]}, {"w": "network,", "b": [0.1939, 0.5518, 0.2828, 0.5716]}, {"w": "also", "b": [0.2891, 0.5518, 0.3298, 0.5716]}, {"w": "called", "b": [0.3361, 0.5518, 0.3963, 0.5716]}, {"w": "the", "b": [0.4026, 0.5518, 0.4335, 0.5716]}, {"w": "objective", "b": [0.4397, 0.5518, 0.5308, 0.5716]}, {"w": "function.", "b": [0.5371, 0.5518, 0.626, 0.5716]}, {"w": "The", "b": [0.6323, 0.5518, 0.6716, 0.5716]}, {"w": "loss", "b": [0.6779, 0.5518, 0.7171, 0.5716]}, {"w": "function", "b": [0.7234, 0.5518, 0.8075, 0.5716]}, {"w": "takes", "b": [0.8138, 0.5518, 0.8656, 0.5716]}, {"w": "the", "b": [0.1294, 0.5723, 0.1602, 0.5921]}, {"w": "predictions", "b": [0.1665, 0.5723, 0.2786, 0.5921]}, {"w": "of", "b": [0.285, 0.5723, 0.306, 0.5921]}, {"w": "the", "b": [0.3123, 0.5723, 0.3431, 0.5921]}, {"w": "network", "b": [0.3494, 0.5723, 0.4321, 0.5921]}, {"w": "and", "b": [0.4384, 0.5723, 0.4748, 0.5921]}, {"w": "the", "b": [0.4811, 0.5723, 0.5119, 0.5921]}, {"w": "true", "b": [0.5182, 0.5723, 0.5575, 0.5921]}, {"w": "target", "b": [0.5638, 0.5723, 0.6207, 0.5921]}, {"w": "(what", "b": [0.627, 0.5723, 0.6844, 0.5921]}, {"w": "you", "b": [0.6907, 0.5723, 0.7286, 0.5921]}, {"w": "wanted", "b": [0.7349, 0.5723, 0.8077, 0.5921]}, {"w": "the", "b": [0.814, 0.5723, 0.8449, 0.5921]}, {"w": "network", "b": [0.1294, 0.5928, 0.2121, 0.6126]}, {"w": "to", "b": [0.2184, 0.5928, 0.238, 0.6126]}, {"w": "output)", "b": [0.2443, 0.5928, 0.3172, 0.6126]}, {"w": "and", "b": [0.3235, 0.5928, 0.3599, 0.6126]}, {"w": "computes", "b": [0.3662, 0.5928, 0.4629, 0.6126]}, {"w": "a", "b": [0.4692, 0.5928, 0.4804, 0.6126]}, {"w": "distance", "b": [0.4867, 0.5928, 0.5694, 0.6126]}, {"w": "score,", "b": [0.5757, 0.5928, 0.6352, 0.6126]}, {"w": "capturing", "b": [0.6415, 0.5928, 0.7368, 0.6126]}, {"w": "how", "b": [0.7431, 0.5928, 0.7865, 0.6126]}, {"w": "well", "b": [0.7928, 0.5928, 0.8363, 0.6126]}, {"w": "the", "b": [0.1294, 0.6133, 0.1602, 0.6331]}, {"w": "network", "b": [0.1665, 0.6133, 0.2492, 0.6331]}, {"w": "has", "b": [0.2555, 0.6133, 0.2891, 0.6331]}, {"w": "done", "b": [0.2954, 0.6133, 0.3445, 0.6331]}, {"w": "on", "b": [0.3508, 0.6133, 0.376, 0.6331]}, {"w": "this", "b": [0.3823, 0.6133, 0.4188, 0.6331]}, {"w": "specific", "b": [0.4251, 0.6133, 0.5035, 0.6331]}, {"w": "example", "b": [0.5098, 0.6133, 0.5953, 0.6331]}, {"w": "(see", "b": [0.6016, 0.6133, 0.6422, 0.6331]}, {"w": "figure", "b": [0.6485, 0.6133, 0.7087, 0.6331]}, {"w": "1.8).", "b": [0.715, 0.6133, 0.7612, 0.6331]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 1.8. A loss function measures the quality of the network’s output.", "words": [{"w": "Figure", "b": [0.1294, 0.6512, 0.1827, 0.666]}, {"w": "1.8.", "b": [0.1874, 0.6512, 0.2158, 0.666]}, {"w": "A", "b": [0.2205, 0.6512, 0.2341, 0.666]}, {"w": "loss", "b": [0.2389, 0.6512, 0.2683, 0.666]}, {"w": "function", "b": [0.273, 0.6512, 0.3403, 0.666]}, {"w": "measures", "b": [0.345, 0.6512, 0.4204, 0.666]}, {"w": "the", "b": [0.4251, 0.6512, 0.4503, 0.666]}, {"w": "quality", "b": [0.4551, 0.6512, 0.5118, 0.666]}, {"w": "of", "b": [0.5166, 0.6512, 0.5323, 0.666]}, {"w": "the", "b": [0.537, 0.6512, 0.5623, 0.666]}, {"w": "network’s", "b": [0.567, 0.6512, 0.6472, 0.666]}, {"w": "output.", "b": [0.6519, 0.6512, 0.7103, 0.666]}]}]}, {"page": 39, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The fundamental trick in deep learning is to use this score as a feedback signal to adjust the value of the weights a little, in a direction that will lower the loss score for the current example (see figure 1.9). This adjustment is the job of the optimizer, which implements what’s called the Backpropagation algorithm: the central algorithm in deep learning. The next chapter explains in more detail how backpropagation works.", "words": [{"w": "The", "b": [0.1294, 0.3959, 0.1686, 0.4156]}, {"w": "fundamental", "b": [0.1749, 0.3959, 0.301, 0.4156]}, {"w": "trick", "b": [0.3074, 0.3959, 0.3536, 0.4156]}, {"w": "in", "b": [0.3599, 0.3959, 0.3795, 0.4156]}, {"w": "deep", "b": [0.3858, 0.3959, 0.4335, 0.4156]}, {"w": "learning", "b": [0.4398, 0.3959, 0.5224, 0.4156]}, {"w": "is", "b": [0.5287, 0.3959, 0.5456, 0.4156]}, {"w": "to", "b": [0.5519, 0.3959, 0.5715, 0.4156]}, {"w": "use", "b": [0.5778, 0.3959, 0.6114, 0.4156]}, {"w": "this", "b": [0.6177, 0.3959, 0.6542, 0.4156]}, {"w": "score", "b": [0.6605, 0.3959, 0.7137, 0.4156]}, {"w": "as", "b": [0.72, 0.3959, 0.741, 0.4156]}, {"w": "a", "b": [0.7473, 0.3959, 0.7585, 0.4156]}, {"w": "feedback", "b": [0.7648, 0.3959, 0.8559, 0.4156]}, {"w": "signal", "b": [0.1294, 0.4164, 0.1897, 0.4361]}, {"w": "to", "b": [0.196, 0.4164, 0.2156, 0.4361]}, {"w": "adjust", "b": [0.2219, 0.4164, 0.2822, 0.4361]}, {"w": "the", "b": [0.2885, 0.4164, 0.3193, 0.4361]}, {"w": "value", "b": [0.3256, 0.4164, 0.3803, 0.4361]}, {"w": "of", "b": [0.3866, 0.4164, 0.4076, 0.4361]}, {"w": "the", "b": [0.4139, 0.4164, 0.4447, 0.4361]}, {"w": "weights", "b": [0.451, 0.4164, 0.5295, 0.4361]}, {"w": "a", "b": [0.5358, 0.4164, 0.547, 0.4361]}, {"w": "little,", "b": [0.5533, 0.4164, 0.6059, 0.4361]}, {"w": "in", "b": [0.6121, 0.4164, 0.6317, 0.4361]}, {"w": "a", "b": [0.638, 0.4164, 0.6492, 0.4361]}, {"w": "direction", "b": [0.6555, 0.4164, 0.7452, 0.4361]}, {"w": "that", "b": [0.7515, 0.4164, 0.7894, 0.4361]}, {"w": "will", "b": [0.7957, 0.4164, 0.8349, 0.4361]}, {"w": "lower", "b": [0.1294, 0.4369, 0.1869, 0.4566]}, {"w": "the", "b": [0.1932, 0.4369, 0.224, 0.4566]}, {"w": "loss", "b": [0.2303, 0.4369, 0.2695, 0.4566]}, {"w": "score", "b": [0.2758, 0.4369, 0.3291, 0.4566]}, {"w": "for", "b": [0.3354, 0.4369, 0.3648, 0.4566]}, {"w": "the", "b": [0.3711, 0.4369, 0.4019, 0.4566]}, {"w": "current", "b": [0.4082, 0.4369, 0.4797, 0.4566]}, {"w": "example", "b": [0.486, 0.4369, 0.5714, 0.4566]}, {"w": "(see", "b": [0.5777, 0.4369, 0.6184, 0.4566]}, {"w": "figure", "b": [0.6246, 0.4369, 0.6848, 0.4566]}, {"w": "1.9).", "b": [0.6912, 0.4369, 0.7374, 0.4566]}, {"w": "This", "b": [0.7437, 0.4369, 0.7885, 0.4566]}, {"w": "adjustment", "b": [0.1294, 0.4574, 0.2401, 0.4771]}, {"w": "is", "b": [0.2464, 0.4574, 0.2633, 0.4771]}, {"w": "the", "b": [0.2696, 0.4574, 0.3004, 0.4771]}, {"w": "job", "b": [0.3067, 0.4574, 0.3389, 0.4771]}, {"w": "of", "b": [0.3452, 0.4574, 0.3663, 0.4771]}, {"w": "the", "b": [0.3726, 0.4574, 0.4034, 0.4771]}, {"w": "optimizer,", "b": [0.4097, 0.4574, 0.5112, 0.4771]}, {"w": "which", "b": [0.5176, 0.4574, 0.5792, 0.4771]}, {"w": "implements", "b": [0.5855, 0.4574, 0.7032, 0.4771]}, {"w": "what’s", "b": [0.7095, 0.4574, 0.7754, 0.4771]}, {"w": "called", "b": [0.7817, 0.4574, 0.8419, 0.4771]}, {"w": "the", "b": [0.1294, 0.4779, 0.1602, 0.4976]}, {"w": "Backpropagation", "b": [0.1665, 0.4779, 0.3407, 0.4976]}, {"w": "algorithm:", "b": [0.347, 0.4779, 0.4522, 0.4976]}, {"w": "the", "b": [0.4585, 0.4779, 0.4893, 0.4976]}, {"w": "central", "b": [0.4956, 0.4779, 0.5642, 0.4976]}, {"w": "algorithm", "b": [0.5705, 0.4779, 0.6686, 0.4976]}, {"w": "in", "b": [0.675, 0.4779, 0.6946, 0.4976]}, {"w": "deep", "b": [0.7009, 0.4779, 0.7485, 0.4976]}, {"w": "learning.", "b": [0.7548, 0.4779, 0.8438, 0.4976]}, {"w": "The", "b": [0.1294, 0.4984, 0.1686, 0.5181]}, {"w": "next", "b": [0.1749, 0.4984, 0.2184, 0.5181]}, {"w": "chapter", "b": [0.2247, 0.4984, 0.2989, 0.5181]}, {"w": "explains", "b": [0.3052, 0.4984, 0.3893, 0.5181]}, {"w": "in", "b": [0.3956, 0.4984, 0.4152, 0.5181]}, {"w": "more", "b": [0.4216, 0.4984, 0.4734, 0.5181]}, {"w": "detail", "b": [0.4797, 0.4984, 0.5357, 0.5181]}, {"w": "how", "b": [0.5421, 0.4984, 0.5855, 0.5181]}, {"w": "backpropagation", "b": [0.5918, 0.4984, 0.7599, 0.5181]}, {"w": "works.", "b": [0.7662, 0.4984, 0.8342, 0.5181]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 1.9. The loss score is used as a feedback signal to adjust the weights.", "words": [{"w": "Figure", "b": [0.1294, 0.5362, 0.1827, 0.551]}, {"w": "1.9.", "b": [0.1874, 0.5362, 0.2158, 0.551]}, {"w": "The", "b": [0.2205, 0.5362, 0.252, 0.551]}, {"w": "loss", "b": [0.2567, 0.5362, 0.2862, 0.551]}, {"w": "score", "b": [0.2909, 0.5362, 0.3326, 0.551]}, {"w": "is", "b": [0.3373, 0.5362, 0.3499, 0.551]}, {"w": "used", "b": [0.3547, 0.5362, 0.3915, 0.551]}, {"w": "as", "b": [0.3962, 0.5362, 0.413, 0.551]}, {"w": "a", "b": [0.4178, 0.5362, 0.4272, 0.551]}, {"w": "feedback", "b": [0.4319, 0.5362, 0.5045, 0.551]}, {"w": "signal", "b": [0.5092, 0.5362, 0.5565, 0.551]}, {"w": "to", "b": [0.5612, 0.5362, 0.577, 0.551]}, {"w": "adjust", "b": [0.5817, 0.5362, 0.6322, 0.551]}, {"w": "the", "b": [0.6369, 0.5362, 0.6621, 0.551]}, {"w": "weights.", "b": [0.6669, 0.5362, 0.7326, 0.551]}]}, {"id": "b_2", "type": "paragraph", "text": "Initially, the weights of the network are assigned random values, so the network merely implements a series of random transformations.", "words": [{"w": "Initially,", "b": [0.1294, 0.8593, 0.2139, 0.8791]}, {"w": "the", "b": [0.2203, 0.8593, 0.2511, 0.8791]}, {"w": "weights", "b": [0.2574, 0.8593, 0.3359, 0.8791]}, {"w": "of", "b": [0.3422, 0.8593, 0.3632, 0.8791]}, {"w": "the", "b": [0.3695, 0.8593, 0.4003, 0.8791]}, {"w": "network", "b": [0.4066, 0.8593, 0.4893, 0.8791]}, {"w": "are", "b": [0.4956, 0.8593, 0.5264, 0.8791]}, {"w": "assigned", "b": [0.5327, 0.8593, 0.6196, 0.8791]}, {"w": "random", "b": [0.6259, 0.8593, 0.7029, 0.8791]}, {"w": "values,", "b": [0.7093, 0.8593, 0.78, 0.8791]}, {"w": "so", "b": [0.7863, 0.8593, 0.8087, 0.8791]}, {"w": "the", "b": [0.8151, 0.8593, 0.8459, 0.8791]}, {"w": "network", "b": [0.1294, 0.8798, 0.2121, 0.8996]}, {"w": "merely", "b": [0.2184, 0.8798, 0.2884, 0.8996]}, {"w": "implements", "b": [0.2947, 0.8798, 0.4125, 0.8996]}, {"w": "a", "b": [0.4188, 0.8798, 0.43, 0.8996]}, {"w": "series", "b": [0.4363, 0.8798, 0.4937, 0.8996]}, {"w": "of", "b": [0.5, 0.8798, 0.521, 0.8996]}, {"w": "random", "b": [0.5273, 0.8798, 0.6044, 0.8996]}, {"w": "transformations.", "b": [0.6107, 0.8798, 0.7754, 0.8996]}]}]}, {"page": 40, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Naturally, its output is far from what it should ideally be, and the loss score is accordingly very high. But with every example the network processes, the weights are adjusted a little in the correct direction, and the loss score decreases. This is the training loop, which, repeated a sufficient number of times (typically tens of iterations over thousands of examples), yields weight values that minimize the loss function. A network with a minimal loss is one for which the outputs are as close as they can be to the targets: a trained network. Once again, it’s a simple mechanism that, once scaled, ends up looking like magic.", "words": [{"w": "Naturally,", "b": [0.1294, 0.0857, 0.2293, 0.1054]}, {"w": "its", "b": [0.2356, 0.0857, 0.2595, 0.1054]}, {"w": "output", "b": [0.2658, 0.0857, 0.3303, 0.1054]}, {"w": "is", "b": [0.3366, 0.0857, 0.3534, 0.1054]}, {"w": "far", "b": [0.3597, 0.0857, 0.3877, 0.1054]}, {"w": "from", "b": [0.394, 0.0857, 0.4431, 0.1054]}, {"w": "what", "b": [0.4494, 0.0857, 0.4984, 0.1054]}, {"w": "it", "b": [0.5047, 0.0857, 0.5187, 0.1054]}, {"w": "should", "b": [0.525, 0.0857, 0.5923, 0.1054]}, {"w": "ideally", "b": [0.5986, 0.0857, 0.6673, 0.1054]}, {"w": "be,", "b": [0.6736, 0.0857, 0.7037, 0.1054]}, {"w": "and", "b": [0.71, 0.0857, 0.7464, 0.1054]}, {"w": "the", "b": [0.7528, 0.0857, 0.7836, 0.1054]}, {"w": "loss", "b": [0.7899, 0.0857, 0.8291, 0.1054]}, {"w": "score", "b": [0.1294, 0.1062, 0.1826, 0.1259]}, {"w": "is", "b": [0.1889, 0.1062, 0.2058, 0.1259]}, {"w": "accordingly", "b": [0.2121, 0.1062, 0.3312, 0.1259]}, {"w": "very", "b": [0.3375, 0.1062, 0.3823, 0.1259]}, {"w": "high.", "b": [0.3886, 0.1062, 0.4398, 0.1259]}, {"w": "But", "b": [0.4461, 0.1062, 0.4825, 0.1259]}, {"w": "with", "b": [0.4888, 0.1062, 0.5337, 0.1259]}, {"w": "every", "b": [0.54, 0.1062, 0.596, 0.1259]}, {"w": "example", "b": [0.6023, 0.1062, 0.6878, 0.1259]}, {"w": "the", "b": [0.694, 0.1062, 0.7248, 0.1259]}, {"w": "network", "b": [0.7311, 0.1062, 0.8138, 0.1259]}, {"w": "processes,", "b": [0.1294, 0.1267, 0.2324, 0.1464]}, {"w": "the", "b": [0.2387, 0.1267, 0.2695, 0.1464]}, {"w": "weights", "b": [0.2758, 0.1267, 0.3543, 0.1464]}, {"w": "are", "b": [0.3606, 0.1267, 0.3914, 0.1464]}, {"w": "adjusted", "b": [0.3977, 0.1267, 0.4818, 0.1464]}, {"w": "a", "b": [0.4881, 0.1267, 0.4993, 0.1464]}, {"w": "little", "b": [0.5056, 0.1267, 0.5519, 0.1464]}, {"w": "in", "b": [0.5582, 0.1267, 0.5778, 0.1464]}, {"w": "the", "b": [0.5841, 0.1267, 0.6149, 0.1464]}, {"w": "correct", "b": [0.6212, 0.1267, 0.6913, 0.1464]}, {"w": "direction,", "b": [0.6976, 0.1267, 0.7936, 0.1464]}, {"w": "and", "b": [0.7999, 0.1267, 0.8363, 0.1464]}, {"w": "the", "b": [0.1294, 0.1472, 0.1602, 0.1669]}, {"w": "loss", "b": [0.1665, 0.1472, 0.2058, 0.1669]}, {"w": "score", "b": [0.2121, 0.1472, 0.2653, 0.1669]}, {"w": "decreases.", "b": [0.2716, 0.1472, 0.3746, 0.1669]}, {"w": "This", "b": [0.3809, 0.1472, 0.4257, 0.1669]}, {"w": "is", "b": [0.432, 0.1472, 0.4489, 0.1669]}, {"w": "the", "b": [0.4552, 0.1472, 0.486, 0.1669]}, {"w": "training", "b": [0.4923, 0.1472, 0.5736, 0.1669]}, {"w": "loop,", "b": [0.5799, 0.1472, 0.631, 0.1669]}, {"w": "which,", "b": [0.6373, 0.1472, 0.7053, 0.1669]}, {"w": "repeated", "b": [0.7116, 0.1472, 0.797, 0.1669]}, {"w": "a", "b": [0.8033, 0.1472, 0.8145, 0.1669]}, {"w": "sufficient", "b": [0.1294, 0.1677, 0.2242, 0.1874]}, {"w": "number", "b": [0.2305, 0.1677, 0.3076, 0.1874]}, {"w": "of", "b": [0.3139, 0.1677, 0.3349, 0.1874]}, {"w": "times", "b": [0.3412, 0.1677, 0.3959, 0.1874]}, {"w": "(typically", "b": [0.4022, 0.1677, 0.4989, 0.1874]}, {"w": "tens", "b": [0.5052, 0.1677, 0.5458, 0.1874]}, {"w": "of", "b": [0.5521, 0.1677, 0.5732, 0.1874]}, {"w": "iterations", "b": [0.5795, 0.1677, 0.6734, 0.1874]}, {"w": "over", "b": [0.6797, 0.1677, 0.7245, 0.1874]}, {"w": "thousands", "b": [0.7308, 0.1677, 0.8317, 0.1874]}, {"w": "of", "b": [0.838, 0.1677, 0.859, 0.1874]}, {"w": "examples),", "b": [0.1294, 0.1882, 0.2394, 0.2079]}, {"w": "yields", "b": [0.2457, 0.1882, 0.306, 0.2079]}, {"w": "weight", "b": [0.3123, 0.1882, 0.3809, 0.2079]}, {"w": "values", "b": [0.3872, 0.1882, 0.4517, 0.2079]}, {"w": "that", "b": [0.458, 0.1882, 0.4958, 0.2079]}, {"w": "minimize", "b": [0.5021, 0.1882, 0.5974, 0.2079]}, {"w": "the", "b": [0.6037, 0.1882, 0.6345, 0.2079]}, {"w": "loss", "b": [0.6408, 0.1882, 0.6801, 0.2079]}, {"w": "function.", "b": [0.6864, 0.1882, 0.7768, 0.2079]}, {"w": "A", "b": [0.7831, 0.1882, 0.8013, 0.2079]}, {"w": "network", "b": [0.1294, 0.2087, 0.2121, 0.2284]}, {"w": "with", "b": [0.2184, 0.2087, 0.2632, 0.2284]}, {"w": "a", "b": [0.2695, 0.2087, 0.2807, 0.2284]}, {"w": "minimal", "b": [0.287, 0.2087, 0.3712, 0.2284]}, {"w": "loss", "b": [0.3775, 0.2087, 0.4167, 0.2284]}, {"w": "is", "b": [0.423, 0.2087, 0.4398, 0.2284]}, {"w": "one", "b": [0.4461, 0.2087, 0.4826, 0.2284]}, {"w": "for", "b": [0.4889, 0.2087, 0.5183, 0.2284]}, {"w": "which", "b": [0.5246, 0.2087, 0.5863, 0.2284]}, {"w": "the", "b": [0.5926, 0.2087, 0.6234, 0.2284]}, {"w": "outputs", "b": [0.6297, 0.2087, 0.704, 0.2284]}, {"w": "are", "b": [0.7103, 0.2087, 0.7411, 0.2284]}, {"w": "as", "b": [0.7474, 0.2087, 0.7684, 0.2284]}, {"w": "close", "b": [0.7747, 0.2087, 0.8266, 0.2284]}, {"w": "as", "b": [0.8329, 0.2087, 0.8539, 0.2284]}, {"w": "they", "b": [0.1294, 0.2292, 0.1729, 0.2489]}, {"w": "can", "b": [0.1792, 0.2292, 0.2142, 0.2489]}, {"w": "be", "b": [0.2205, 0.2292, 0.2443, 0.2489]}, {"w": "to", "b": [0.2506, 0.2292, 0.2702, 0.2489]}, {"w": "the", "b": [0.2765, 0.2292, 0.3073, 0.2489]}, {"w": "targets:", "b": [0.3136, 0.2292, 0.3874, 0.2489]}, {"w": "a", "b": [0.3937, 0.2292, 0.4049, 0.2489]}, {"w": "trained", "b": [0.4112, 0.2292, 0.4813, 0.2489]}, {"w": "network.", "b": [0.4876, 0.2292, 0.5766, 0.2489]}, {"w": "Once", "b": [0.5829, 0.2292, 0.6361, 0.2489]}, {"w": "again,", "b": [0.6424, 0.2292, 0.7033, 0.2489]}, {"w": "it’s", "b": [0.7096, 0.2292, 0.7404, 0.2489]}, {"w": "a", "b": [0.7467, 0.2292, 0.7579, 0.2489]}, {"w": "simple", "b": [0.7643, 0.2292, 0.8315, 0.2489]}, {"w": "mechanism", "b": [0.1294, 0.2497, 0.2443, 0.2694]}, {"w": "that,", "b": [0.2506, 0.2497, 0.2948, 0.2694]}, {"w": "once", "b": [0.3011, 0.2497, 0.3487, 0.2694]}, {"w": "scaled,", "b": [0.355, 0.2497, 0.4244, 0.2694]}, {"w": "ends", "b": [0.4307, 0.2497, 0.4769, 0.2694]}, {"w": "up", "b": [0.4832, 0.2497, 0.5084, 0.2694]}, {"w": "looking", "b": [0.5147, 0.2497, 0.5918, 0.2694]}, {"w": "like", "b": [0.5981, 0.2497, 0.636, 0.2694]}, {"w": "magic.", "b": [0.6423, 0.2497, 0.7102, 0.2694]}]}, {"id": "b_1", "type": "paragraph", "text": "1.1.6. What deep learning has achieved so far", "words": [{"w": "1.1.6.", "b": [0.1294, 0.2969, 0.1862, 0.3167]}, {"w": "What", "b": [0.1925, 0.2969, 0.2527, 0.3167]}, {"w": "deep", "b": [0.259, 0.2969, 0.3095, 0.3167]}, {"w": "learning", "b": [0.3158, 0.2969, 0.4055, 0.3167]}, {"w": "has", "b": [0.4118, 0.2969, 0.4483, 0.3167]}, {"w": "achieved", "b": [0.4546, 0.2969, 0.5485, 0.3167]}, {"w": "so", "b": [0.5548, 0.2969, 0.5772, 0.3167]}, {"w": "far", "b": [0.5835, 0.2969, 0.6157, 0.3167]}]}, {"id": "b_2", "type": "paragraph", "text": "Although deep learning is a fairly old subfield of machine learning, it only rose to prominence in the early 2010s. In the few years since, it has achieved nothing short of a revolution in the field, with remarkable results on perceptual problems such as seeing and hearing—problems involving skills that seem natural and intuitive to humans but have long been elusive for machines.", "words": [{"w": "Although", "b": [0.1294, 0.3397, 0.2247, 0.3594]}, {"w": "deep", "b": [0.231, 0.3397, 0.2786, 0.3594]}, {"w": "learning", "b": [0.285, 0.3397, 0.3676, 0.3594]}, {"w": "is", "b": [0.3739, 0.3397, 0.3908, 0.3594]}, {"w": "a", "b": [0.3971, 0.3397, 0.4083, 0.3594]}, {"w": "fairly", "b": [0.4146, 0.3397, 0.4692, 0.3594]}, {"w": "old", "b": [0.4755, 0.3397, 0.5077, 0.3594]}, {"w": "subfield", "b": [0.5141, 0.3397, 0.5953, 0.3594]}, {"w": "of", "b": [0.6016, 0.3397, 0.6227, 0.3594]}, {"w": "machine", "b": [0.629, 0.3397, 0.7144, 0.3594]}, {"w": "learning,", "b": [0.7207, 0.3397, 0.8097, 0.3594]}, {"w": "it", "b": [0.816, 0.3397, 0.83, 0.3594]}, {"w": "only", "b": [0.1294, 0.3602, 0.1743, 0.3799]}, {"w": "rose", "b": [0.1806, 0.3602, 0.2226, 0.3799]}, {"w": "to", "b": [0.2289, 0.3602, 0.2485, 0.3799]}, {"w": "prominence", "b": [0.2548, 0.3602, 0.3739, 0.3799]}, {"w": "in", "b": [0.3802, 0.3602, 0.3999, 0.3799]}, {"w": "the", "b": [0.4062, 0.3602, 0.437, 0.3799]}, {"w": "early", "b": [0.4433, 0.3602, 0.4937, 0.3799]}, {"w": "2010s.", "b": [0.5, 0.3602, 0.5666, 0.3799]}, {"w": "In", "b": [0.5729, 0.3602, 0.5939, 0.3799]}, {"w": "the", "b": [0.6002, 0.3602, 0.6311, 0.3799]}, {"w": "few", "b": [0.6373, 0.3602, 0.6751, 0.3799]}, {"w": "years", "b": [0.6814, 0.3602, 0.7346, 0.3799]}, {"w": "since,", "b": [0.7409, 0.3602, 0.7991, 0.3799]}, {"w": "it", "b": [0.8054, 0.3602, 0.8194, 0.3799]}, {"w": "has", "b": [0.8257, 0.3602, 0.8594, 0.3799]}, {"w": "achieved", "b": [0.1294, 0.3807, 0.2191, 0.4004]}, {"w": "nothing", "b": [0.2254, 0.3807, 0.3025, 0.4004]}, {"w": "short", "b": [0.3088, 0.3807, 0.3592, 0.4004]}, {"w": "of", "b": [0.3655, 0.3807, 0.3865, 0.4004]}, {"w": "a", "b": [0.3928, 0.3807, 0.404, 0.4004]}, {"w": "revolution", "b": [0.4104, 0.3807, 0.5141, 0.4004]}, {"w": "in", "b": [0.5204, 0.3807, 0.54, 0.4004]}, {"w": "the", "b": [0.5463, 0.3807, 0.5771, 0.4004]}, {"w": "field,", "b": [0.5834, 0.3807, 0.636, 0.4004]}, {"w": "with", "b": [0.6423, 0.3807, 0.6871, 0.4004]}, {"w": "remarkable", "b": [0.6934, 0.3807, 0.8069, 0.4004]}, {"w": "results", "b": [0.1294, 0.4012, 0.1953, 0.4209]}, {"w": "on", "b": [0.2016, 0.4012, 0.2268, 0.4209]}, {"w": "perceptual", "b": [0.2331, 0.4012, 0.3382, 0.4209]}, {"w": "problems", "b": [0.3445, 0.4012, 0.4384, 0.4209]}, {"w": "such", "b": [0.4446, 0.4012, 0.4909, 0.4209]}, {"w": "as", "b": [0.4972, 0.4012, 0.5182, 0.4209]}, {"w": "seeing", "b": [0.5245, 0.4012, 0.589, 0.4209]}, {"w": "and", "b": [0.5953, 0.4012, 0.6317, 0.4209]}, {"w": "hearing—problems", "b": [0.638, 0.4012, 0.8328, 0.4209]}, {"w": "involving", "b": [0.1294, 0.4217, 0.2261, 0.4414]}, {"w": "skills", "b": [0.2324, 0.4217, 0.2857, 0.4414]}, {"w": "that", "b": [0.292, 0.4217, 0.3299, 0.4414]}, {"w": "seem", "b": [0.3362, 0.4217, 0.388, 0.4414]}, {"w": "natural", "b": [0.3943, 0.4217, 0.4644, 0.4414]}, {"w": "and", "b": [0.4707, 0.4217, 0.5071, 0.4414]}, {"w": "intuitive", "b": [0.5134, 0.4217, 0.5975, 0.4414]}, {"w": "to", "b": [0.6038, 0.4217, 0.6234, 0.4414]}, {"w": "humans", "b": [0.6297, 0.4217, 0.7082, 0.4414]}, {"w": "but", "b": [0.7145, 0.4217, 0.7468, 0.4414]}, {"w": "have", "b": [0.7531, 0.4217, 0.8007, 0.4414]}, {"w": "long", "b": [0.807, 0.4217, 0.8519, 0.4414]}, {"w": "been", "b": [0.1294, 0.4422, 0.177, 0.4619]}, {"w": "elusive", "b": [0.1833, 0.4422, 0.2548, 0.4619]}, {"w": "for", "b": [0.2611, 0.4422, 0.2905, 0.4619]}, {"w": "machines.", "b": [0.2968, 0.4422, 0.3984, 0.4619]}]}, {"id": "b_3", "type": "paragraph", "text": "In particular, deep learning has achieved the following breakthroughs, all in historically difficult areas of machine learning:", "words": [{"w": "In", "b": [0.1294, 0.485, 0.1504, 0.5047]}, {"w": "particular,", "b": [0.1567, 0.485, 0.2587, 0.5047]}, {"w": "deep", "b": [0.265, 0.485, 0.3126, 0.5047]}, {"w": "learning", "b": [0.3189, 0.485, 0.4016, 0.5047]}, {"w": "has", "b": [0.4079, 0.485, 0.4415, 0.5047]}, {"w": "achieved", "b": [0.4478, 0.485, 0.5375, 0.5047]}, {"w": "the", "b": [0.5438, 0.485, 0.5746, 0.5047]}, {"w": "following", "b": [0.5809, 0.485, 0.679, 0.5047]}, {"w": "breakthroughs,", "b": [0.6853, 0.485, 0.8359, 0.5047]}, {"w": "all", "b": [0.8422, 0.485, 0.8675, 0.5047]}, {"w": "in", "b": [0.1294, 0.5055, 0.149, 0.5252]}, {"w": "historically", "b": [0.1553, 0.5055, 0.2689, 0.5252]}, {"w": "difficult", "b": [0.2752, 0.5055, 0.356, 0.5252]}, {"w": "areas", "b": [0.3623, 0.5055, 0.4141, 0.5252]}, {"w": "of", "b": [0.4204, 0.5055, 0.4414, 0.5252]}, {"w": "machine", "b": [0.4477, 0.5055, 0.5332, 0.5252]}, {"w": "learning:", "b": [0.5395, 0.5055, 0.6292, 0.5252]}]}, {"id": "b_4", "type": "paragraph", "text": "Near-human-level image classification Near-human-level speech recognition Near-human-level handwriting transcription Improved machine translation Improved text-to-speech conversion Digital assistants such as Google Now and Amazon Alexa Near-human-level autonomous driving Improved ad targeting, as used by Google, Baidu, and Bing Improved search results on the web Ability to answer natural-language questions Superhuman Go playing", "words": [{"w": "Near-human-level", "b": [0.1799, 0.5438, 0.3629, 0.5636]}, {"w": "image", "b": [0.3692, 0.5438, 0.4308, 0.5636]}, {"w": "classification", "b": [0.4371, 0.5438, 0.5703, 0.5636]}, {"w": "Near-human-level", "b": [0.1799, 0.5643, 0.3629, 0.5841]}, {"w": "speech", "b": [0.3692, 0.5643, 0.4378, 0.5841]}, {"w": "recognition", "b": [0.4441, 0.5643, 0.559, 0.5841]}, {"w": "Near-human-level", "b": [0.1799, 0.5848, 0.3629, 0.6046]}, {"w": "handwriting", "b": [0.3692, 0.5848, 0.4911, 0.6046]}, {"w": "transcription", "b": [0.4974, 0.5848, 0.6249, 0.6046]}, {"w": "Improved", "b": [0.1799, 0.6053, 0.2779, 0.6251]}, {"w": "machine", "b": [0.2842, 0.6053, 0.3697, 0.6251]}, {"w": "translation", "b": [0.376, 0.6053, 0.4825, 0.6251]}, {"w": "Improved", "b": [0.1799, 0.6258, 0.2779, 0.6456]}, {"w": "text-to-speech", "b": [0.2842, 0.6258, 0.4272, 0.6456]}, {"w": "conversion", "b": [0.4335, 0.6258, 0.5441, 0.6456]}, {"w": "Digital", "b": [0.1799, 0.6463, 0.2499, 0.6661]}, {"w": "assistants", "b": [0.2562, 0.6463, 0.3516, 0.6661]}, {"w": "such", "b": [0.3579, 0.6463, 0.4041, 0.6661]}, {"w": "as", "b": [0.4104, 0.6463, 0.4314, 0.6661]}, {"w": "Google", "b": [0.4377, 0.6463, 0.512, 0.6661]}, {"w": "Now", "b": [0.5183, 0.6463, 0.5673, 0.6661]}, {"w": "and", "b": [0.5736, 0.6463, 0.6101, 0.6661]}, {"w": "Amazon", "b": [0.6164, 0.6463, 0.7018, 0.6661]}, {"w": "Alexa", "b": [0.7081, 0.6463, 0.7684, 0.6661]}, {"w": "Near-human-level", "b": [0.1799, 0.6668, 0.3629, 0.6866]}, {"w": "autonomous", "b": [0.3692, 0.6668, 0.4925, 0.6866]}, {"w": "driving", "b": [0.4988, 0.6668, 0.5717, 0.6866]}, {"w": "Improved", "b": [0.1799, 0.6873, 0.2779, 0.7071]}, {"w": "ad", "b": [0.2842, 0.6873, 0.3081, 0.7071]}, {"w": "targeting,", "b": [0.3144, 0.6873, 0.4099, 0.7071]}, {"w": "as", "b": [0.4162, 0.6873, 0.4372, 0.7071]}, {"w": "used", "b": [0.4435, 0.6873, 0.4897, 0.7071]}, {"w": "by", "b": [0.496, 0.6873, 0.5213, 0.7071]}, {"w": "Google,", "b": [0.5276, 0.6873, 0.6082, 0.7071]}, {"w": "Baidu,", "b": [0.6145, 0.6873, 0.681, 0.7071]}, {"w": "and", "b": [0.6873, 0.6873, 0.7238, 0.7071]}, {"w": "Bing", "b": [0.7301, 0.6873, 0.7791, 0.7071]}, {"w": "Improved", "b": [0.1799, 0.7078, 0.2779, 0.7276]}, {"w": "search", "b": [0.2842, 0.7078, 0.3487, 0.7276]}, {"w": "results", "b": [0.355, 0.7078, 0.4208, 0.7276]}, {"w": "on", "b": [0.4272, 0.7078, 0.4524, 0.7276]}, {"w": "the", "b": [0.4587, 0.7078, 0.4895, 0.7276]}, {"w": "web", "b": [0.4958, 0.7078, 0.5378, 0.7276]}, {"w": "Ability", "b": [0.1799, 0.7283, 0.2514, 0.7481]}, {"w": "to", "b": [0.2577, 0.7283, 0.2773, 0.7481]}, {"w": "answer", "b": [0.2836, 0.7283, 0.355, 0.7481]}, {"w": "natural-language", "b": [0.3613, 0.7283, 0.5309, 0.7481]}, {"w": "questions", "b": [0.5372, 0.7283, 0.6325, 0.7481]}, {"w": "Superhuman", "b": [0.1799, 0.7488, 0.3074, 0.7686]}, {"w": "Go", "b": [0.3137, 0.7488, 0.3445, 0.7686]}, {"w": "playing", "b": [0.3508, 0.7488, 0.4265, 0.7686]}]}, {"id": "b_5", "type": "paragraph", "text": "We’re still exploring the full extent of what deep learning can do. We’ve started applying it to a wide variety of problems outside of machine perception and natural--language understanding, such as formal reasoning. If successful, this may herald an age where deep learning assists humans in science, software development, and more.", "words": [{"w": "We’re", "b": [0.1294, 0.7916, 0.1904, 0.8113]}, {"w": "still", "b": [0.1967, 0.7916, 0.2346, 0.8113]}, {"w": "exploring", "b": [0.2409, 0.7916, 0.3376, 0.8113]}, {"w": "the", "b": [0.3439, 0.7916, 0.3747, 0.8113]}, {"w": "full", "b": [0.381, 0.7916, 0.416, 0.8113]}, {"w": "extent", "b": [0.4224, 0.7916, 0.484, 0.8113]}, {"w": "of", "b": [0.4903, 0.7916, 0.5113, 0.8113]}, {"w": "what", "b": [0.5176, 0.7916, 0.5667, 0.8113]}, {"w": "deep", "b": [0.573, 0.7916, 0.6206, 0.8113]}, {"w": "learning", "b": [0.6269, 0.7916, 0.7096, 0.8113]}, {"w": "can", "b": [0.7159, 0.7916, 0.7509, 0.8113]}, {"w": "do.", "b": [0.7572, 0.7916, 0.7887, 0.8113]}, {"w": "We’ve", "b": [0.795, 0.7916, 0.8601, 0.8113]}, {"w": "started", "b": [0.1294, 0.8121, 0.1967, 0.8318]}, {"w": "applying", "b": [0.203, 0.8121, 0.2913, 0.8318]}, {"w": "it", "b": [0.2976, 0.8121, 0.3116, 0.8318]}, {"w": "to", "b": [0.3179, 0.8121, 0.3375, 0.8318]}, {"w": "a", "b": [0.3438, 0.8121, 0.355, 0.8318]}, {"w": "wide", "b": [0.3613, 0.8121, 0.4104, 0.8318]}, {"w": "variety", "b": [0.4167, 0.8121, 0.4867, 0.8318]}, {"w": "of", "b": [0.493, 0.8121, 0.5141, 0.8318]}, {"w": "problems", "b": [0.5204, 0.8121, 0.6143, 0.8318]}, {"w": "outside", "b": [0.6205, 0.8121, 0.6934, 0.8318]}, {"w": "of", "b": [0.6997, 0.8121, 0.7207, 0.8318]}, {"w": "machine", "b": [0.727, 0.8121, 0.8125, 0.8318]}, {"w": "perception", "b": [0.1294, 0.8326, 0.2359, 0.8523]}, {"w": "and", "b": [0.2422, 0.8326, 0.2786, 0.8523]}, {"w": "natural--language", "b": [0.2849, 0.8326, 0.4628, 0.8523]}, {"w": "understanding,", "b": [0.4692, 0.8326, 0.6184, 0.8523]}, {"w": "such", "b": [0.6247, 0.8326, 0.6709, 0.8523]}, {"w": "as", "b": [0.6772, 0.8326, 0.6983, 0.8523]}, {"w": "formal", "b": [0.7046, 0.8326, 0.7718, 0.8523]}, {"w": "reasoning.", "b": [0.1294, 0.8531, 0.2338, 0.8728]}, {"w": "If", "b": [0.2401, 0.8531, 0.2569, 0.8728]}, {"w": "successful,", "b": [0.2632, 0.8531, 0.3732, 0.8728]}, {"w": "this", "b": [0.3795, 0.8531, 0.416, 0.8728]}, {"w": "may", "b": [0.4223, 0.8531, 0.4657, 0.8728]}, {"w": "herald", "b": [0.472, 0.8531, 0.535, 0.8728]}, {"w": "an", "b": [0.5413, 0.8531, 0.5651, 0.8728]}, {"w": "age", "b": [0.5714, 0.8531, 0.6064, 0.8728]}, {"w": "where", "b": [0.6127, 0.8531, 0.6744, 0.8728]}, {"w": "deep", "b": [0.6807, 0.8531, 0.7283, 0.8728]}, {"w": "learning", "b": [0.7346, 0.8531, 0.8173, 0.8728]}, {"w": "assists", "b": [0.1294, 0.8736, 0.1939, 0.8933]}, {"w": "humans", "b": [0.2002, 0.8736, 0.2787, 0.8933]}, {"w": "in", "b": [0.285, 0.8736, 0.3046, 0.8933]}, {"w": "science,", "b": [0.3109, 0.8736, 0.3915, 0.8933]}, {"w": "software", "b": [0.3978, 0.8736, 0.4846, 0.8933]}, {"w": "development,", "b": [0.4909, 0.8736, 0.6275, 0.8933]}, {"w": "and", "b": [0.6339, 0.8736, 0.6703, 0.8933]}, {"w": "more.", "b": [0.6766, 0.8736, 0.7347, 0.8933]}]}]}, {"page": 41, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "1.1.7. Don’t believe the short-term hype", "words": [{"w": "1.1.7.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Don’t", "b": [0.1925, 0.0857, 0.2541, 0.1054]}, {"w": "believe", "b": [0.2604, 0.0857, 0.3347, 0.1054]}, {"w": "the", "b": [0.341, 0.0857, 0.3746, 0.1054]}, {"w": "short-term", "b": [0.3809, 0.0857, 0.4972, 0.1054]}, {"w": "hype", "b": [0.5035, 0.0857, 0.5554, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Although deep learning has led to remarkable achievements in recent years, expectations for what the field will be able to achieve in the next decade tend to run much higher than what will likely be possible. Although some world-changing applications like autonomous cars are already within reach, many more are likely to remain elusive for a long time, such as believable dialogue systems, human-level machine translation across arbitrary languages, and human-level natural-language understanding. In particular, talk of human-level general intelligence shouldn’t be taken too seriously. The risk with high expectations for the short term is that, as technology fails to deliver, research investment will dry up, slowing progress for a long time.", "words": [{"w": "Although", "b": [0.1294, 0.1285, 0.2247, 0.1482]}, {"w": "deep", "b": [0.231, 0.1285, 0.2786, 0.1482]}, {"w": "learning", "b": [0.285, 0.1285, 0.3676, 0.1482]}, {"w": "has", "b": [0.3739, 0.1285, 0.4076, 0.1482]}, {"w": "led", "b": [0.4139, 0.1285, 0.4447, 0.1482]}, {"w": "to", "b": [0.451, 0.1285, 0.4706, 0.1482]}, {"w": "remarkable", "b": [0.4769, 0.1285, 0.5904, 0.1482]}, {"w": "achievements", "b": [0.5967, 0.1285, 0.734, 0.1482]}, {"w": "in", "b": [0.7403, 0.1285, 0.7599, 0.1482]}, {"w": "recent", "b": [0.7662, 0.1285, 0.8279, 0.1482]}, {"w": "years,", "b": [0.1294, 0.149, 0.1889, 0.1687]}, {"w": "expectations", "b": [0.1953, 0.149, 0.3214, 0.1687]}, {"w": "for", "b": [0.3277, 0.149, 0.3571, 0.1687]}, {"w": "what", "b": [0.3634, 0.149, 0.4124, 0.1687]}, {"w": "the", "b": [0.4187, 0.149, 0.4496, 0.1687]}, {"w": "field", "b": [0.4559, 0.149, 0.5021, 0.1687]}, {"w": "will", "b": [0.5084, 0.149, 0.5477, 0.1687]}, {"w": "be", "b": [0.554, 0.149, 0.5778, 0.1687]}, {"w": "able", "b": [0.5841, 0.149, 0.6261, 0.1687]}, {"w": "to", "b": [0.6324, 0.149, 0.652, 0.1687]}, {"w": "achieve", "b": [0.6583, 0.149, 0.7353, 0.1687]}, {"w": "in", "b": [0.7416, 0.149, 0.7612, 0.1687]}, {"w": "the", "b": [0.7675, 0.149, 0.7984, 0.1687]}, {"w": "next", "b": [0.8047, 0.149, 0.8481, 0.1687]}, {"w": "decade", "b": [0.1294, 0.1695, 0.1994, 0.1892]}, {"w": "tend", "b": [0.2057, 0.1695, 0.2492, 0.1892]}, {"w": "to", "b": [0.2555, 0.1695, 0.2751, 0.1892]}, {"w": "run", "b": [0.2814, 0.1695, 0.315, 0.1892]}, {"w": "much", "b": [0.3214, 0.1695, 0.3774, 0.1892]}, {"w": "higher", "b": [0.3837, 0.1695, 0.4482, 0.1892]}, {"w": "than", "b": [0.4545, 0.1695, 0.4979, 0.1892]}, {"w": "what", "b": [0.5042, 0.1695, 0.5533, 0.1892]}, {"w": "will", "b": [0.5596, 0.1695, 0.5988, 0.1892]}, {"w": "likely", "b": [0.6051, 0.1695, 0.6626, 0.1892]}, {"w": "be", "b": [0.6689, 0.1695, 0.6927, 0.1892]}, {"w": "possible.", "b": [0.699, 0.1695, 0.788, 0.1892]}, {"w": "Although", "b": [0.1294, 0.19, 0.2247, 0.2097]}, {"w": "some", "b": [0.231, 0.19, 0.2843, 0.2097]}, {"w": "world-changing", "b": [0.2906, 0.19, 0.4503, 0.2097]}, {"w": "applications", "b": [0.4566, 0.19, 0.5785, 0.2097]}, {"w": "like", "b": [0.5848, 0.19, 0.6226, 0.2097]}, {"w": "autonomous", "b": [0.6289, 0.19, 0.7523, 0.2097]}, {"w": "cars", "b": [0.7586, 0.19, 0.7992, 0.2097]}, {"w": "are", "b": [0.8055, 0.19, 0.8363, 0.2097]}, {"w": "already", "b": [0.1294, 0.2105, 0.2037, 0.2302]}, {"w": "within", "b": [0.21, 0.2105, 0.2744, 0.2302]}, {"w": "reach,", "b": [0.2807, 0.2105, 0.3417, 0.2302]}, {"w": "many", "b": [0.348, 0.2105, 0.404, 0.2302]}, {"w": "more", "b": [0.4103, 0.2105, 0.4622, 0.2302]}, {"w": "are", "b": [0.4685, 0.2105, 0.4993, 0.2302]}, {"w": "likely", "b": [0.5056, 0.2105, 0.563, 0.2302]}, {"w": "to", "b": [0.5693, 0.2105, 0.589, 0.2302]}, {"w": "remain", "b": [0.5953, 0.2105, 0.6653, 0.2302]}, {"w": "elusive", "b": [0.6716, 0.2105, 0.7431, 0.2302]}, {"w": "for", "b": [0.7494, 0.2105, 0.7788, 0.2302]}, {"w": "a", "b": [0.7851, 0.2105, 0.7963, 0.2302]}, {"w": "long", "b": [0.8026, 0.2105, 0.8475, 0.2302]}, {"w": "time,", "b": [0.1294, 0.231, 0.1806, 0.2507]}, {"w": "such", "b": [0.1869, 0.231, 0.2331, 0.2507]}, {"w": "as", "b": [0.2394, 0.231, 0.2604, 0.2507]}, {"w": "believable", "b": [0.2667, 0.231, 0.3704, 0.2507]}, {"w": "dialogue", "b": [0.3767, 0.231, 0.4635, 0.2507]}, {"w": "systems,", "b": [0.4698, 0.231, 0.556, 0.2507]}, {"w": "human-level", "b": [0.5624, 0.231, 0.6885, 0.2507]}, {"w": "machine", "b": [0.6948, 0.231, 0.7802, 0.2507]}, {"w": "translation", "b": [0.1294, 0.2515, 0.2359, 0.2712]}, {"w": "across", "b": [0.2422, 0.2515, 0.3053, 0.2712]}, {"w": "arbitrary", "b": [0.3116, 0.2515, 0.3984, 0.2712]}, {"w": "languages,", "b": [0.4047, 0.2515, 0.5119, 0.2712]}, {"w": "and", "b": [0.5182, 0.2515, 0.5546, 0.2712]}, {"w": "human-level", "b": [0.5609, 0.2515, 0.6871, 0.2712]}, {"w": "natural-language", "b": [0.6934, 0.2515, 0.8629, 0.2712]}, {"w": "understanding.", "b": [0.1294, 0.272, 0.2786, 0.2917]}, {"w": "In", "b": [0.2849, 0.272, 0.3059, 0.2917]}, {"w": "particular,", "b": [0.3122, 0.272, 0.4142, 0.2917]}, {"w": "talk", "b": [0.4205, 0.272, 0.4583, 0.2917]}, {"w": "of", "b": [0.4646, 0.272, 0.4856, 0.2917]}, {"w": "human-level", "b": [0.4919, 0.272, 0.6166, 0.2917]}, {"w": "general", "b": [0.6229, 0.272, 0.7, 0.2917]}, {"w": "intelligence", "b": [0.7063, 0.272, 0.824, 0.2917]}, {"w": "shouldn’t", "b": [0.1294, 0.2925, 0.2243, 0.3122]}, {"w": "be", "b": [0.2306, 0.2925, 0.2544, 0.3122]}, {"w": "taken", "b": [0.2607, 0.2925, 0.3153, 0.3122]}, {"w": "too", "b": [0.3216, 0.2925, 0.3539, 0.3122]}, {"w": "seriously.", "b": [0.3602, 0.2925, 0.4559, 0.3122]}, {"w": "The", "b": [0.4622, 0.2925, 0.5014, 0.3122]}, {"w": "risk", "b": [0.5077, 0.2925, 0.5456, 0.3122]}, {"w": "with", "b": [0.5519, 0.2925, 0.5967, 0.3122]}, {"w": "high", "b": [0.603, 0.2925, 0.6479, 0.3122]}, {"w": "expectations", "b": [0.6542, 0.2925, 0.7803, 0.3122]}, {"w": "for", "b": [0.7866, 0.2925, 0.816, 0.3122]}, {"w": "the", "b": [0.8223, 0.2925, 0.8532, 0.3122]}, {"w": "short", "b": [0.1294, 0.313, 0.1799, 0.3327]}, {"w": "term", "b": [0.1862, 0.313, 0.2324, 0.3327]}, {"w": "is", "b": [0.2387, 0.313, 0.2555, 0.3327]}, {"w": "that,", "b": [0.2618, 0.313, 0.306, 0.3327]}, {"w": "as", "b": [0.3123, 0.313, 0.3333, 0.3327]}, {"w": "technology", "b": [0.3396, 0.313, 0.4517, 0.3327]}, {"w": "fails", "b": [0.458, 0.313, 0.5015, 0.3327]}, {"w": "to", "b": [0.5078, 0.313, 0.5274, 0.3327]}, {"w": "deliver,", "b": [0.5337, 0.313, 0.609, 0.3327]}, {"w": "research", "b": [0.6153, 0.313, 0.6993, 0.3327]}, {"w": "investment", "b": [0.7056, 0.313, 0.8163, 0.3327]}, {"w": "will", "b": [0.8226, 0.313, 0.8619, 0.3327]}, {"w": "dry", "b": [0.1294, 0.3335, 0.163, 0.3532]}, {"w": "up,", "b": [0.1693, 0.3335, 0.2009, 0.3532]}, {"w": "slowing", "b": [0.2072, 0.3335, 0.2871, 0.3532]}, {"w": "progress", "b": [0.2934, 0.3335, 0.3788, 0.3532]}, {"w": "for", "b": [0.3852, 0.3335, 0.4146, 0.3532]}, {"w": "a", "b": [0.4209, 0.3335, 0.4321, 0.3532]}, {"w": "long", "b": [0.4384, 0.3335, 0.4832, 0.3532]}, {"w": "time.", "b": [0.4895, 0.3335, 0.5407, 0.3532]}]}, {"id": "b_2", "type": "paragraph", "text": "This has happened before. Twice in the past, AI went through a cycle of intense optimism followed by disappointment and skepticism, with a dearth of funding as a result. It started with symbolic AI in the 1960s. In those early days, projections about AI were flying high. One of the best- known pioneers and proponents of the symbolic AI approach was Marvin Minsky, who claimed in 1967, “Within a generation ... the problem of creating ‘artificial intelligence’ will substantially be solved.” Three years later, in 1970, he made a more precisely quantified prediction: “In from three to eight years we will have a machine with the general intelligence of an average human being.” In 2016, such an achievement still appears to be far in the future—so far that we have no way to predict how long it will take—but in the 1960s and early 1970s, several experts believed it to be right around the corner (as do many people today). A few years later, as these high expectations failed to materialize, researchers and government funds turned away from the field, marking the start of the first AI winter (a reference to a nuclear winter, because this was shortly after the height of the Cold War).", "words": [{"w": "This", "b": [0.1294, 0.3762, 0.1743, 0.396]}, {"w": "has", "b": [0.1806, 0.3762, 0.2142, 0.396]}, {"w": "happened", "b": [0.2205, 0.3762, 0.3172, 0.396]}, {"w": "before.", "b": [0.3235, 0.3762, 0.3942, 0.396]}, {"w": "Twice", "b": [0.4005, 0.3762, 0.4618, 0.396]}, {"w": "in", "b": [0.4681, 0.3762, 0.4877, 0.396]}, {"w": "the", "b": [0.494, 0.3762, 0.5248, 0.396]}, {"w": "past,", "b": [0.5311, 0.3762, 0.5781, 0.396]}, {"w": "AI", "b": [0.5844, 0.3762, 0.611, 0.396]}, {"w": "went", "b": [0.6173, 0.3762, 0.6663, 0.396]}, {"w": "through", "b": [0.6727, 0.3762, 0.7511, 0.396]}, {"w": "a", "b": [0.7574, 0.3762, 0.7686, 0.396]}, {"w": "cycle", "b": [0.7749, 0.3762, 0.8282, 0.396]}, {"w": "of", "b": [0.8345, 0.3762, 0.8555, 0.396]}, {"w": "intense", "b": [0.1294, 0.3967, 0.2009, 0.4165]}, {"w": "optimism", "b": [0.2072, 0.3967, 0.3025, 0.4165]}, {"w": "followed", "b": [0.3088, 0.3967, 0.3985, 0.4165]}, {"w": "by", "b": [0.4048, 0.3967, 0.43, 0.4165]}, {"w": "disappointment", "b": [0.4363, 0.3967, 0.5919, 0.4165]}, {"w": "and", "b": [0.5982, 0.3967, 0.6346, 0.4165]}, {"w": "skepticism,", "b": [0.6409, 0.3967, 0.7552, 0.4165]}, {"w": "with", "b": [0.7614, 0.3967, 0.8062, 0.4165]}, {"w": "a", "b": [0.8125, 0.3967, 0.8237, 0.4165]}, {"w": "dearth", "b": [0.1294, 0.4172, 0.1925, 0.437]}, {"w": "of", "b": [0.1988, 0.4172, 0.2198, 0.437]}, {"w": "funding", "b": [0.2261, 0.4172, 0.3046, 0.437]}, {"w": "as", "b": [0.3109, 0.4172, 0.3319, 0.437]}, {"w": "a", "b": [0.3382, 0.4172, 0.3494, 0.437]}, {"w": "result.", "b": [0.3557, 0.4172, 0.418, 0.437]}, {"w": "It", "b": [0.4244, 0.4172, 0.4398, 0.437]}, {"w": "started", "b": [0.4461, 0.4172, 0.5133, 0.437]}, {"w": "with", "b": [0.5196, 0.4172, 0.5645, 0.437]}, {"w": "symbolic", "b": [0.5708, 0.4172, 0.6633, 0.437]}, {"w": "AI", "b": [0.6696, 0.4172, 0.6962, 0.437]}, {"w": "in", "b": [0.7025, 0.4172, 0.7221, 0.437]}, {"w": "the", "b": [0.7284, 0.4172, 0.7593, 0.437]}, {"w": "1960s.", "b": [0.7656, 0.4172, 0.8322, 0.437]}, {"w": "In", "b": [0.8385, 0.4172, 0.8595, 0.437]}, {"w": "those", "b": [0.1294, 0.4377, 0.1827, 0.4575]}, {"w": "early", "b": [0.189, 0.4377, 0.2394, 0.4575]}, {"w": "days,", "b": [0.2457, 0.4377, 0.2982, 0.4575]}, {"w": "projections", "b": [0.3046, 0.4377, 0.4167, 0.4575]}, {"w": "about", "b": [0.423, 0.4377, 0.479, 0.4575]}, {"w": "AI", "b": [0.4853, 0.4377, 0.5119, 0.4575]}, {"w": "were", "b": [0.5182, 0.4377, 0.5672, 0.4575]}, {"w": "flying", "b": [0.5735, 0.4377, 0.6338, 0.4575]}, {"w": "high.", "b": [0.6401, 0.4377, 0.6913, 0.4575]}, {"w": "One", "b": [0.6976, 0.4377, 0.7396, 0.4575]}, {"w": "of", "b": [0.7459, 0.4377, 0.7669, 0.4575]}, {"w": "the", "b": [0.7732, 0.4377, 0.804, 0.4575]}, {"w": "best-", "b": [0.8103, 0.4377, 0.8594, 0.4575]}, {"w": "known", "b": [0.1294, 0.4582, 0.1981, 0.478]}, {"w": "pioneers", "b": [0.2044, 0.4582, 0.2898, 0.478]}, {"w": "and", "b": [0.2962, 0.4582, 0.3326, 0.478]}, {"w": "proponents", "b": [0.3389, 0.4582, 0.451, 0.478]}, {"w": "of", "b": [0.4573, 0.4582, 0.4783, 0.478]}, {"w": "the", "b": [0.4846, 0.4582, 0.5154, 0.478]}, {"w": "symbolic", "b": [0.5217, 0.4582, 0.6143, 0.478]}, {"w": "AI", "b": [0.6206, 0.4582, 0.6472, 0.478]}, {"w": "approach", "b": [0.6535, 0.4582, 0.7459, 0.478]}, {"w": "was", "b": [0.7522, 0.4582, 0.7915, 0.478]}, {"w": "Marvin", "b": [0.1294, 0.4787, 0.2037, 0.4985]}, {"w": "Minsky,", "b": [0.21, 0.4787, 0.2917, 0.4985]}, {"w": "who", "b": [0.298, 0.4787, 0.3415, 0.4985]}, {"w": "claimed", "b": [0.3478, 0.4787, 0.4277, 0.4985]}, {"w": "in", "b": [0.4339, 0.4787, 0.4536, 0.4985]}, {"w": "1967,", "b": [0.4599, 0.4787, 0.5166, 0.4985]}, {"w": "“Within", "b": [0.5229, 0.4787, 0.6032, 0.4985]}, {"w": "a", "b": [0.6095, 0.4787, 0.6207, 0.4985]}, {"w": "generation", "b": [0.627, 0.4787, 0.7335, 0.4985]}, {"w": "...", "b": [0.7398, 0.4787, 0.7587, 0.4985]}, {"w": "the", "b": [0.765, 0.4787, 0.7958, 0.4985]}, {"w": "problem", "b": [0.1294, 0.4992, 0.2135, 0.519]}, {"w": "of", "b": [0.2198, 0.4992, 0.2408, 0.519]}, {"w": "creating", "b": [0.2471, 0.4992, 0.3284, 0.519]}, {"w": "‘artificial", "b": [0.3347, 0.4992, 0.4285, 0.519]}, {"w": "intelligence’", "b": [0.4348, 0.4992, 0.5609, 0.519]}, {"w": "will", "b": [0.5673, 0.4992, 0.6065, 0.519]}, {"w": "substantially", "b": [0.6128, 0.4992, 0.7404, 0.519]}, {"w": "be", "b": [0.7467, 0.4992, 0.7705, 0.519]}, {"w": "solved.”", "b": [0.7768, 0.4992, 0.8602, 0.519]}, {"w": "Three", "b": [0.1294, 0.5197, 0.1882, 0.5395]}, {"w": "years", "b": [0.1945, 0.5197, 0.2478, 0.5395]}, {"w": "later,", "b": [0.2541, 0.5197, 0.3042, 0.5395]}, {"w": "in", "b": [0.3105, 0.5197, 0.3301, 0.5395]}, {"w": "1970,", "b": [0.3364, 0.5197, 0.3932, 0.5395]}, {"w": "he", "b": [0.3995, 0.5197, 0.4233, 0.5395]}, {"w": "made", "b": [0.4296, 0.5197, 0.4842, 0.5395]}, {"w": "a", "b": [0.4905, 0.5197, 0.5017, 0.5395]}, {"w": "more", "b": [0.508, 0.5197, 0.5599, 0.5395]}, {"w": "precisely", "b": [0.5662, 0.5197, 0.6573, 0.5395]}, {"w": "quantified", "b": [0.6636, 0.5197, 0.7659, 0.5395]}, {"w": "prediction:", "b": [0.1294, 0.5402, 0.2387, 0.56]}, {"w": "“In", "b": [0.245, 0.5402, 0.2772, 0.56]}, {"w": "from", "b": [0.2835, 0.5402, 0.3326, 0.56]}, {"w": "three", "b": [0.3389, 0.5402, 0.3893, 0.56]}, {"w": "to", "b": [0.3956, 0.5402, 0.4152, 0.56]}, {"w": "eight", "b": [0.4216, 0.5402, 0.472, 0.56]}, {"w": "years", "b": [0.4783, 0.5402, 0.5315, 0.56]}, {"w": "we", "b": [0.5378, 0.5402, 0.5673, 0.56]}, {"w": "will", "b": [0.5736, 0.5402, 0.6128, 0.56]}, {"w": "have", "b": [0.6191, 0.5402, 0.6667, 0.56]}, {"w": "a", "b": [0.6731, 0.5402, 0.6843, 0.56]}, {"w": "machine", "b": [0.6906, 0.5402, 0.776, 0.56]}, {"w": "with", "b": [0.7823, 0.5402, 0.8272, 0.56]}, {"w": "the", "b": [0.8334, 0.5402, 0.8642, 0.56]}, {"w": "general", "b": [0.1294, 0.5607, 0.2037, 0.5805]}, {"w": "intelligence", "b": [0.21, 0.5607, 0.3277, 0.5805]}, {"w": "of", "b": [0.334, 0.5607, 0.355, 0.5805]}, {"w": "an", "b": [0.3613, 0.5607, 0.3851, 0.5805]}, {"w": "average", "b": [0.3914, 0.5607, 0.4698, 0.5805]}, {"w": "human", "b": [0.4761, 0.5607, 0.5448, 0.5805]}, {"w": "being.”", "b": [0.5511, 0.5607, 0.6247, 0.5805]}, {"w": "In", "b": [0.631, 0.5607, 0.652, 0.5805]}, {"w": "2016,", "b": [0.6583, 0.5607, 0.7151, 0.5805]}, {"w": "such", "b": [0.7214, 0.5607, 0.7676, 0.5805]}, {"w": "an", "b": [0.7739, 0.5607, 0.7977, 0.5805]}, {"w": "achievement", "b": [0.1294, 0.5812, 0.2569, 0.601]}, {"w": "still", "b": [0.2632, 0.5812, 0.3011, 0.601]}, {"w": "appears", "b": [0.3074, 0.5812, 0.3844, 0.601]}, {"w": "to", "b": [0.3907, 0.5812, 0.4104, 0.601]}, {"w": "be", "b": [0.4167, 0.5812, 0.4405, 0.601]}, {"w": "far", "b": [0.4468, 0.5812, 0.4748, 0.601]}, {"w": "in", "b": [0.4811, 0.5812, 0.5007, 0.601]}, {"w": "the", "b": [0.507, 0.5812, 0.5378, 0.601]}, {"w": "future—so", "b": [0.5441, 0.5812, 0.652, 0.601]}, {"w": "far", "b": [0.6583, 0.5812, 0.6863, 0.601]}, {"w": "that", "b": [0.6926, 0.5812, 0.7304, 0.601]}, {"w": "we", "b": [0.7367, 0.5812, 0.7661, 0.601]}, {"w": "have", "b": [0.7724, 0.5812, 0.8201, 0.601]}, {"w": "no", "b": [0.8264, 0.5812, 0.8516, 0.601]}, {"w": "way", "b": [0.1294, 0.6017, 0.1714, 0.6215]}, {"w": "to", "b": [0.1777, 0.6017, 0.1974, 0.6215]}, {"w": "predict", "b": [0.2037, 0.6017, 0.2737, 0.6215]}, {"w": "how", "b": [0.28, 0.6017, 0.3235, 0.6215]}, {"w": "long", "b": [0.3298, 0.6017, 0.3746, 0.6215]}, {"w": "it", "b": [0.3809, 0.6017, 0.395, 0.6215]}, {"w": "will", "b": [0.4013, 0.6017, 0.4405, 0.6215]}, {"w": "take—but", "b": [0.4468, 0.6017, 0.5463, 0.6215]}, {"w": "in", "b": [0.5526, 0.6017, 0.5723, 0.6215]}, {"w": "the", "b": [0.5786, 0.6017, 0.6094, 0.6215]}, {"w": "1960s", "b": [0.6157, 0.6017, 0.676, 0.6215]}, {"w": "and", "b": [0.6823, 0.6017, 0.7187, 0.6215]}, {"w": "early", "b": [0.725, 0.6017, 0.7754, 0.6215]}, {"w": "1970s,", "b": [0.7817, 0.6017, 0.8483, 0.6215]}, {"w": "several", "b": [0.1294, 0.6222, 0.2009, 0.642]}, {"w": "experts", "b": [0.2072, 0.6222, 0.28, 0.642]}, {"w": "believed", "b": [0.2863, 0.6222, 0.3718, 0.642]}, {"w": "it", "b": [0.3781, 0.6222, 0.3921, 0.642]}, {"w": "to", "b": [0.3984, 0.6222, 0.418, 0.642]}, {"w": "be", "b": [0.4243, 0.6222, 0.4481, 0.642]}, {"w": "right", "b": [0.4544, 0.6222, 0.5021, 0.642]}, {"w": "around", "b": [0.5084, 0.6222, 0.5784, 0.642]}, {"w": "the", "b": [0.5847, 0.6222, 0.6156, 0.642]}, {"w": "corner", "b": [0.6219, 0.6222, 0.6863, 0.642]}, {"w": "(as", "b": [0.6926, 0.6222, 0.722, 0.642]}, {"w": "do", "b": [0.7283, 0.6222, 0.7535, 0.642]}, {"w": "many", "b": [0.7599, 0.6222, 0.8159, 0.642]}, {"w": "people", "b": [0.1294, 0.6427, 0.1967, 0.6625]}, {"w": "today).", "b": [0.203, 0.6427, 0.2737, 0.6625]}, {"w": "A", "b": [0.28, 0.6427, 0.2982, 0.6625]}, {"w": "few", "b": [0.3046, 0.6427, 0.3424, 0.6625]}, {"w": "years", "b": [0.3487, 0.6427, 0.4019, 0.6625]}, {"w": "later,", "b": [0.4082, 0.6427, 0.4583, 0.6625]}, {"w": "as", "b": [0.4646, 0.6427, 0.4856, 0.6625]}, {"w": "these", "b": [0.4919, 0.6427, 0.5438, 0.6625]}, {"w": "high", "b": [0.5501, 0.6427, 0.5949, 0.6625]}, {"w": "expectations", "b": [0.6012, 0.6427, 0.7273, 0.6625]}, {"w": "failed", "b": [0.7336, 0.6427, 0.7911, 0.6625]}, {"w": "to", "b": [0.7974, 0.6427, 0.817, 0.6625]}, {"w": "materialize,", "b": [0.1294, 0.6632, 0.2478, 0.683]}, {"w": "researchers", "b": [0.2541, 0.6632, 0.3675, 0.683]}, {"w": "and", "b": [0.3738, 0.6632, 0.4102, 0.683]}, {"w": "government", "b": [0.4165, 0.6632, 0.537, 0.683]}, {"w": "funds", "b": [0.5434, 0.6632, 0.5994, 0.683]}, {"w": "turned", "b": [0.6057, 0.6632, 0.6702, 0.683]}, {"w": "away", "b": [0.6765, 0.6632, 0.7297, 0.683]}, {"w": "from", "b": [0.736, 0.6632, 0.785, 0.683]}, {"w": "the", "b": [0.7913, 0.6632, 0.8222, 0.683]}, {"w": "field,", "b": [0.1294, 0.6837, 0.182, 0.7035]}, {"w": "marking", "b": [0.1883, 0.6837, 0.2723, 0.7035]}, {"w": "the", "b": [0.2786, 0.6837, 0.3095, 0.7035]}, {"w": "start", "b": [0.3158, 0.6837, 0.3592, 0.7035]}, {"w": "of", "b": [0.3655, 0.6837, 0.3865, 0.7035]}, {"w": "the", "b": [0.3928, 0.6837, 0.4237, 0.7035]}, {"w": "first", "b": [0.43, 0.6837, 0.4706, 0.7035]}, {"w": "AI", "b": [0.4769, 0.6837, 0.5007, 0.7035]}, {"w": "winter", "b": [0.507, 0.6837, 0.5715, 0.7035]}, {"w": "(a", "b": [0.5777, 0.6837, 0.5973, 0.7035]}, {"w": "reference", "b": [0.6036, 0.6837, 0.6975, 0.7035]}, {"w": "to", "b": [0.7038, 0.6837, 0.7234, 0.7035]}, {"w": "a", "b": [0.7297, 0.6837, 0.7409, 0.7035]}, {"w": "nuclear", "b": [0.7472, 0.6837, 0.8214, 0.7035]}, {"w": "winter,", "b": [0.1294, 0.7042, 0.1992, 0.724]}, {"w": "because", "b": [0.2055, 0.7042, 0.2853, 0.724]}, {"w": "this", "b": [0.2916, 0.7042, 0.3281, 0.724]}, {"w": "was", "b": [0.3344, 0.7042, 0.3736, 0.724]}, {"w": "shortly", "b": [0.3799, 0.7042, 0.45, 0.724]}, {"w": "after", "b": [0.4563, 0.7042, 0.5025, 0.724]}, {"w": "the", "b": [0.5088, 0.7042, 0.5396, 0.724]}, {"w": "height", "b": [0.5459, 0.7042, 0.609, 0.724]}, {"w": "of", "b": [0.6153, 0.7042, 0.6363, 0.724]}, {"w": "the", "b": [0.6426, 0.7042, 0.6734, 0.724]}, {"w": "Cold", "b": [0.6798, 0.7042, 0.7288, 0.724]}, {"w": "War).", "b": [0.7351, 0.7042, 0.7912, 0.724]}]}, {"id": "b_3", "type": "paragraph", "text": "It wouldn’t be the last one. In the 1980s, a new take on symbolic AI, expert systems, started gathering steam among large companies. A few initial success stories triggered a wave of investment, with corporations around the world starting their own in-house AI departments to develop expert systems. Around 1985, companies were spending over $1 billion each year on the technology; but by the early 1990s, these systems had proven expensive to maintain, difficult to scale, and limited in scope, and interest died down. Thus began the second AI winter.", "words": [{"w": "It", "b": [0.1294, 0.747, 0.1448, 0.7668]}, {"w": "wouldn’t", "b": [0.1511, 0.747, 0.2418, 0.7668]}, {"w": "be", "b": [0.2481, 0.747, 0.2719, 0.7668]}, {"w": "the", "b": [0.2782, 0.747, 0.309, 0.7668]}, {"w": "last", "b": [0.3153, 0.747, 0.3504, 0.7668]}, {"w": "one.", "b": [0.3567, 0.747, 0.3994, 0.7668]}, {"w": "In", "b": [0.4057, 0.747, 0.4267, 0.7668]}, {"w": "the", "b": [0.433, 0.747, 0.4638, 0.7668]}, {"w": "1980s,", "b": [0.4702, 0.747, 0.5367, 0.7668]}, {"w": "a", "b": [0.543, 0.747, 0.5542, 0.7668]}, {"w": "new", "b": [0.5605, 0.747, 0.6026, 0.7668]}, {"w": "take", "b": [0.6089, 0.747, 0.6509, 0.7668]}, {"w": "on", "b": [0.6572, 0.747, 0.6824, 0.7668]}, {"w": "symbolic", "b": [0.6887, 0.747, 0.7812, 0.7668]}, {"w": "AI,", "b": [0.7875, 0.747, 0.8205, 0.7668]}, {"w": "expert", "b": [0.1294, 0.7675, 0.1925, 0.7873]}, {"w": "systems,", "b": [0.1988, 0.7675, 0.2821, 0.7873]}, {"w": "started", "b": [0.2884, 0.7675, 0.3557, 0.7873]}, {"w": "gathering", "b": [0.362, 0.7675, 0.4572, 0.7873]}, {"w": "steam", "b": [0.4636, 0.7675, 0.5224, 0.7873]}, {"w": "among", "b": [0.5287, 0.7675, 0.5974, 0.7873]}, {"w": "large", "b": [0.6037, 0.7675, 0.6536, 0.7873]}, {"w": "companies.", "b": [0.6599, 0.7675, 0.7741, 0.7873]}, {"w": "A", "b": [0.7804, 0.7675, 0.7986, 0.7873]}, {"w": "few", "b": [0.8049, 0.7675, 0.8427, 0.7873]}, {"w": "initial", "b": [0.1294, 0.788, 0.1883, 0.8078]}, {"w": "success", "b": [0.1946, 0.788, 0.2702, 0.8078]}, {"w": "stories", "b": [0.2766, 0.788, 0.3424, 0.8078]}, {"w": "triggered", "b": [0.3487, 0.788, 0.4398, 0.8078]}, {"w": "a", "b": [0.4461, 0.788, 0.4573, 0.8078]}, {"w": "wave", "b": [0.4636, 0.788, 0.5168, 0.8078]}, {"w": "of", "b": [0.5231, 0.788, 0.5441, 0.8078]}, {"w": "investment,", "b": [0.5505, 0.788, 0.6675, 0.8078]}, {"w": "with", "b": [0.6738, 0.788, 0.7186, 0.8078]}, {"w": "corporations", "b": [0.7249, 0.788, 0.851, 0.8078]}, {"w": "around", "b": [0.1294, 0.8085, 0.1995, 0.8283]}, {"w": "the", "b": [0.2058, 0.8085, 0.2366, 0.8283]}, {"w": "world", "b": [0.2429, 0.8085, 0.3018, 0.8283]}, {"w": "starting", "b": [0.3081, 0.8085, 0.3837, 0.8283]}, {"w": "their", "b": [0.39, 0.8085, 0.4363, 0.8283]}, {"w": "own", "b": [0.4426, 0.8085, 0.486, 0.8283]}, {"w": "in-house", "b": [0.4923, 0.8085, 0.5792, 0.8283]}, {"w": "AI", "b": [0.5855, 0.8085, 0.6121, 0.8283]}, {"w": "departments", "b": [0.6184, 0.8085, 0.7417, 0.8283]}, {"w": "to", "b": [0.748, 0.8085, 0.7677, 0.8283]}, {"w": "develop", "b": [0.774, 0.8085, 0.8538, 0.8283]}, {"w": "expert", "b": [0.1294, 0.829, 0.1925, 0.8488]}, {"w": "systems.", "b": [0.1988, 0.829, 0.285, 0.8488]}, {"w": "Around", "b": [0.2913, 0.829, 0.3683, 0.8488]}, {"w": "1985,", "b": [0.3746, 0.829, 0.4314, 0.8488]}, {"w": "companies", "b": [0.4377, 0.829, 0.5456, 0.8488]}, {"w": "were", "b": [0.5519, 0.829, 0.6009, 0.8488]}, {"w": "spending", "b": [0.6072, 0.829, 0.6983, 0.8488]}, {"w": "over", "b": [0.7046, 0.829, 0.7494, 0.8488]}, {"w": "$1", "b": [0.7557, 0.829, 0.7809, 0.8488]}, {"w": "billion", "b": [0.7872, 0.829, 0.8531, 0.8488]}, {"w": "each", "b": [0.1294, 0.8495, 0.1756, 0.8693]}, {"w": "year", "b": [0.1819, 0.8495, 0.2253, 0.8693]}, {"w": "on", "b": [0.2317, 0.8495, 0.2569, 0.8693]}, {"w": "the", "b": [0.2632, 0.8495, 0.294, 0.8693]}, {"w": "technology;", "b": [0.3003, 0.8495, 0.4194, 0.8693]}, {"w": "but", "b": [0.4257, 0.8495, 0.458, 0.8693]}, {"w": "by", "b": [0.4643, 0.8495, 0.4895, 0.8693]}, {"w": "the", "b": [0.4958, 0.8495, 0.5266, 0.8693]}, {"w": "early", "b": [0.5329, 0.8495, 0.5834, 0.8693]}, {"w": "1990s,", "b": [0.5897, 0.8495, 0.6563, 0.8693]}, {"w": "these", "b": [0.6626, 0.8495, 0.7144, 0.8693]}, {"w": "systems", "b": [0.7207, 0.8495, 0.8006, 0.8693]}, {"w": "had", "b": [0.8069, 0.8495, 0.8433, 0.8693]}, {"w": "proven", "b": [0.1294, 0.87, 0.1995, 0.8898]}, {"w": "expensive", "b": [0.2058, 0.87, 0.3066, 0.8898]}, {"w": "to", "b": [0.313, 0.87, 0.3326, 0.8898]}, {"w": "maintain,", "b": [0.3389, 0.87, 0.4335, 0.8898]}, {"w": "difficult", "b": [0.4398, 0.87, 0.5206, 0.8898]}, {"w": "to", "b": [0.5268, 0.87, 0.5465, 0.8898]}, {"w": "scale,", "b": [0.5528, 0.87, 0.6095, 0.8898]}, {"w": "and", "b": [0.6158, 0.87, 0.6522, 0.8898]}, {"w": "limited", "b": [0.6585, 0.87, 0.73, 0.8898]}, {"w": "in", "b": [0.7363, 0.87, 0.756, 0.8898]}, {"w": "scope,", "b": [0.7623, 0.87, 0.826, 0.8898]}, {"w": "and", "b": [0.8323, 0.87, 0.8687, 0.8898]}, {"w": "interest", "b": [0.1294, 0.8905, 0.2037, 0.9103]}, {"w": "died", "b": [0.21, 0.8905, 0.2534, 0.9103]}, {"w": "down.", "b": [0.2597, 0.8905, 0.3221, 0.9103]}, {"w": "Thus", "b": [0.3284, 0.8905, 0.3788, 0.9103]}, {"w": "began", "b": [0.3852, 0.8905, 0.4454, 0.9103]}, {"w": "the", "b": [0.4517, 0.8905, 0.4825, 0.9103]}, {"w": "second", "b": [0.4888, 0.8905, 0.5589, 0.9103]}, {"w": "AI", "b": [0.5652, 0.8905, 0.5918, 0.9103]}, {"w": "winter.", "b": [0.5981, 0.8905, 0.6674, 0.9103]}]}]}, {"page": 42, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "We may be currently witnessing the third cycle of AI hype and disappointment—and we’re still in the phase of intense optimism. It’s best to moderate our expectations for the short term and make sure people less familiar with the technical side of the field have a clear idea of what deep learning can and can’t deliver.", "words": [{"w": "We", "b": [0.1294, 0.0857, 0.1624, 0.1054]}, {"w": "may", "b": [0.1687, 0.0857, 0.2121, 0.1054]}, {"w": "be", "b": [0.2185, 0.0857, 0.2423, 0.1054]}, {"w": "currently", "b": [0.2486, 0.0857, 0.3396, 0.1054]}, {"w": "witnessing", "b": [0.3459, 0.0857, 0.4539, 0.1054]}, {"w": "the", "b": [0.4602, 0.0857, 0.491, 0.1054]}, {"w": "third", "b": [0.4973, 0.0857, 0.545, 0.1054]}, {"w": "cycle", "b": [0.5513, 0.0857, 0.6045, 0.1054]}, {"w": "of", "b": [0.6108, 0.0857, 0.6318, 0.1054]}, {"w": "AI", "b": [0.6381, 0.0857, 0.6647, 0.1054]}, {"w": "hype", "b": [0.671, 0.0857, 0.7201, 0.1054]}, {"w": "and", "b": [0.7264, 0.0857, 0.7628, 0.1054]}, {"w": "disappointment—and", "b": [0.1294, 0.1062, 0.3466, 0.1259]}, {"w": "we’re", "b": [0.3529, 0.1062, 0.4104, 0.1259]}, {"w": "still", "b": [0.4167, 0.1062, 0.4545, 0.1259]}, {"w": "in", "b": [0.4608, 0.1062, 0.4805, 0.1259]}, {"w": "the", "b": [0.4868, 0.1062, 0.5176, 0.1259]}, {"w": "phase", "b": [0.5239, 0.1062, 0.5813, 0.1259]}, {"w": "of", "b": [0.5876, 0.1062, 0.6087, 0.1259]}, {"w": "intense", "b": [0.615, 0.1062, 0.6864, 0.1259]}, {"w": "optimism.", "b": [0.6927, 0.1062, 0.7944, 0.1259]}, {"w": "It’s", "b": [0.8006, 0.1062, 0.8328, 0.1259]}, {"w": "best", "b": [0.1294, 0.1267, 0.1701, 0.1464]}, {"w": "to", "b": [0.1764, 0.1267, 0.196, 0.1464]}, {"w": "moderate", "b": [0.2023, 0.1267, 0.2962, 0.1464]}, {"w": "our", "b": [0.3025, 0.1267, 0.3361, 0.1464]}, {"w": "expectations", "b": [0.3424, 0.1267, 0.4685, 0.1464]}, {"w": "for", "b": [0.4748, 0.1267, 0.5042, 0.1464]}, {"w": "the", "b": [0.5105, 0.1267, 0.5413, 0.1464]}, {"w": "short", "b": [0.5477, 0.1267, 0.5981, 0.1464]}, {"w": "term", "b": [0.6044, 0.1267, 0.6507, 0.1464]}, {"w": "and", "b": [0.657, 0.1267, 0.6934, 0.1464]}, {"w": "make", "b": [0.6997, 0.1267, 0.7543, 0.1464]}, {"w": "sure", "b": [0.7606, 0.1267, 0.8027, 0.1464]}, {"w": "people", "b": [0.1294, 0.1472, 0.1967, 0.1669]}, {"w": "less", "b": [0.203, 0.1472, 0.2408, 0.1669]}, {"w": "familiar", "b": [0.2471, 0.1472, 0.327, 0.1669]}, {"w": "with", "b": [0.3333, 0.1472, 0.3781, 0.1669]}, {"w": "the", "b": [0.3844, 0.1472, 0.4153, 0.1669]}, {"w": "technical", "b": [0.4216, 0.1472, 0.5126, 0.1669]}, {"w": "side", "b": [0.5189, 0.1472, 0.5596, 0.1669]}, {"w": "of", "b": [0.5659, 0.1472, 0.5869, 0.1669]}, {"w": "the", "b": [0.5932, 0.1472, 0.624, 0.1669]}, {"w": "field", "b": [0.6302, 0.1472, 0.6765, 0.1669]}, {"w": "have", "b": [0.6828, 0.1472, 0.7304, 0.1669]}, {"w": "a", "b": [0.7367, 0.1472, 0.7479, 0.1669]}, {"w": "clear", "b": [0.7542, 0.1472, 0.8032, 0.1669]}, {"w": "idea", "b": [0.8095, 0.1472, 0.8516, 0.1669]}, {"w": "of", "b": [0.1294, 0.1677, 0.1504, 0.1874]}, {"w": "what", "b": [0.1567, 0.1677, 0.2058, 0.1874]}, {"w": "deep", "b": [0.2121, 0.1677, 0.2597, 0.1874]}, {"w": "learning", "b": [0.266, 0.1677, 0.3487, 0.1874]}, {"w": "can", "b": [0.355, 0.1677, 0.39, 0.1874]}, {"w": "and", "b": [0.3963, 0.1677, 0.4327, 0.1874]}, {"w": "can’t", "b": [0.439, 0.1677, 0.489, 0.1874]}, {"w": "deliver.", "b": [0.4953, 0.1677, 0.5702, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "1.1.8. The promise of AI", "words": [{"w": "1.1.8.", "b": [0.1294, 0.2149, 0.1862, 0.2347]}, {"w": "The", "b": [0.1925, 0.2149, 0.2345, 0.2347]}, {"w": "promise", "b": [0.2408, 0.2149, 0.3273, 0.2347]}, {"w": "of", "b": [0.3336, 0.2149, 0.3546, 0.2347]}, {"w": "AI", "b": [0.3609, 0.2149, 0.3889, 0.2347]}]}, {"id": "b_2", "type": "paragraph", "text": "Although we may have unrealistic short-term expectations for AI, the long-term picture is looking bright. We’re only getting started in applying deep learning to many important problems for which it could prove transformative, from medical diagnoses to digital assistants. AI research has been moving forward amazingly quickly in the past five years, in large part due to a level of funding never before seen in the short history of AI, but so far relatively little of this progress has made its way into the products and processes that form our world. Most of the research findings of deep learning aren’t yet applied, or at least not applied to the full range of problems they can solve across all industries. Your doctor doesn’t yet use AI, and neither does your accountant. You probably don’t use AI technologies in your day-to-day life. Of course, you can ask your smartphone simple questions and get reasonable answers, you can get fairly useful product recommendations on Amazon.com, and you can search for “birthday” on Google Photos and instantly find those pictures of your daughter’s birthday party from last month. That’s a far cry from where such technologies used to stand. But such tools are still only accessories to our daily lives. AI has yet to transition to being central to the way we work, think, and live.", "words": [{"w": "Although", "b": [0.1294, 0.2577, 0.2247, 0.2774]}, {"w": "we", "b": [0.231, 0.2577, 0.2604, 0.2774]}, {"w": "may", "b": [0.2667, 0.2577, 0.3102, 0.2774]}, {"w": "have", "b": [0.3165, 0.2577, 0.3641, 0.2774]}, {"w": "unrealistic", "b": [0.3704, 0.2577, 0.4755, 0.2774]}, {"w": "short-term", "b": [0.4818, 0.2577, 0.5869, 0.2774]}, {"w": "expectations", "b": [0.5932, 0.2577, 0.7193, 0.2774]}, {"w": "for", "b": [0.7256, 0.2577, 0.755, 0.2774]}, {"w": "AI,", "b": [0.7613, 0.2577, 0.7943, 0.2774]}, {"w": "the", "b": [0.8006, 0.2577, 0.8314, 0.2774]}, {"w": "long-term", "b": [0.1294, 0.2782, 0.2289, 0.2979]}, {"w": "picture", "b": [0.2352, 0.2782, 0.3053, 0.2979]}, {"w": "is", "b": [0.3116, 0.2782, 0.3284, 0.2979]}, {"w": "looking", "b": [0.3347, 0.2782, 0.4118, 0.2979]}, {"w": "bright.", "b": [0.4181, 0.2782, 0.4847, 0.2979]}, {"w": "We’re", "b": [0.491, 0.2782, 0.5519, 0.2979]}, {"w": "only", "b": [0.5582, 0.2782, 0.6031, 0.2979]}, {"w": "getting", "b": [0.6094, 0.2782, 0.6795, 0.2979]}, {"w": "started", "b": [0.6857, 0.2782, 0.753, 0.2979]}, {"w": "in", "b": [0.7593, 0.2782, 0.7789, 0.2979]}, {"w": "applying", "b": [0.1294, 0.2987, 0.2177, 0.3184]}, {"w": "deep", "b": [0.224, 0.2987, 0.2716, 0.3184]}, {"w": "learning", "b": [0.2779, 0.2987, 0.3606, 0.3184]}, {"w": "to", "b": [0.3669, 0.2987, 0.3865, 0.3184]}, {"w": "many", "b": [0.3928, 0.2987, 0.4489, 0.3184]}, {"w": "important", "b": [0.4552, 0.2987, 0.5533, 0.3184]}, {"w": "problems", "b": [0.5596, 0.2987, 0.6535, 0.3184]}, {"w": "for", "b": [0.6598, 0.2987, 0.6892, 0.3184]}, {"w": "which", "b": [0.6955, 0.2987, 0.7572, 0.3184]}, {"w": "it", "b": [0.7635, 0.2987, 0.7775, 0.3184]}, {"w": "could", "b": [0.7838, 0.2987, 0.8399, 0.3184]}, {"w": "prove", "b": [0.1294, 0.3192, 0.1869, 0.3389]}, {"w": "transformative,", "b": [0.1932, 0.3192, 0.3466, 0.3389]}, {"w": "from", "b": [0.3529, 0.3192, 0.4019, 0.3389]}, {"w": "medical", "b": [0.4082, 0.3192, 0.4881, 0.3389]}, {"w": "diagnoses", "b": [0.4944, 0.3192, 0.5939, 0.3389]}, {"w": "to", "b": [0.6001, 0.3192, 0.6198, 0.3389]}, {"w": "digital", "b": [0.6261, 0.3192, 0.6905, 0.3389]}, {"w": "assistants.", "b": [0.6968, 0.3192, 0.7985, 0.3389]}, {"w": "AI", "b": [0.8048, 0.3192, 0.8314, 0.3389]}, {"w": "research", "b": [0.1294, 0.3397, 0.2134, 0.3594]}, {"w": "has", "b": [0.2197, 0.3397, 0.2534, 0.3594]}, {"w": "been", "b": [0.2597, 0.3397, 0.3073, 0.3594]}, {"w": "moving", "b": [0.3136, 0.3397, 0.3907, 0.3594]}, {"w": "forward", "b": [0.397, 0.3397, 0.4768, 0.3594]}, {"w": "amazingly", "b": [0.4832, 0.3397, 0.5882, 0.3594]}, {"w": "quickly", "b": [0.5945, 0.3397, 0.6702, 0.3594]}, {"w": "in", "b": [0.6765, 0.3397, 0.6962, 0.3594]}, {"w": "the", "b": [0.7025, 0.3397, 0.7333, 0.3594]}, {"w": "past", "b": [0.7396, 0.3397, 0.7802, 0.3594]}, {"w": "five", "b": [0.7865, 0.3397, 0.8258, 0.3594]}, {"w": "years,", "b": [0.1294, 0.3602, 0.1889, 0.3799]}, {"w": "in", "b": [0.1953, 0.3602, 0.2149, 0.3799]}, {"w": "large", "b": [0.2212, 0.3602, 0.2711, 0.3799]}, {"w": "part", "b": [0.2774, 0.3602, 0.3167, 0.3799]}, {"w": "due", "b": [0.323, 0.3602, 0.3594, 0.3799]}, {"w": "to", "b": [0.3657, 0.3602, 0.3853, 0.3799]}, {"w": "a", "b": [0.3916, 0.3602, 0.4028, 0.3799]}, {"w": "level", "b": [0.4091, 0.3602, 0.4582, 0.3799]}, {"w": "of", "b": [0.4645, 0.3602, 0.4855, 0.3799]}, {"w": "funding", "b": [0.4918, 0.3602, 0.5703, 0.3799]}, {"w": "never", "b": [0.5766, 0.3602, 0.6326, 0.3799]}, {"w": "before", "b": [0.6389, 0.3602, 0.7033, 0.3799]}, {"w": "seen", "b": [0.7096, 0.3602, 0.7545, 0.3799]}, {"w": "in", "b": [0.7608, 0.3602, 0.7804, 0.3799]}, {"w": "the", "b": [0.7867, 0.3602, 0.8175, 0.3799]}, {"w": "short", "b": [0.1294, 0.3807, 0.1799, 0.4004]}, {"w": "history", "b": [0.1862, 0.3807, 0.2562, 0.4004]}, {"w": "of", "b": [0.2626, 0.3807, 0.2836, 0.4004]}, {"w": "AI,", "b": [0.2899, 0.3807, 0.3228, 0.4004]}, {"w": "but", "b": [0.3291, 0.3807, 0.3613, 0.4004]}, {"w": "so", "b": [0.3676, 0.3807, 0.3901, 0.4004]}, {"w": "far", "b": [0.3964, 0.3807, 0.4244, 0.4004]}, {"w": "relatively", "b": [0.4307, 0.3807, 0.526, 0.4004]}, {"w": "little", "b": [0.5323, 0.3807, 0.5785, 0.4004]}, {"w": "of", "b": [0.5848, 0.3807, 0.6059, 0.4004]}, {"w": "this", "b": [0.6122, 0.3807, 0.6486, 0.4004]}, {"w": "progress", "b": [0.6549, 0.3807, 0.7404, 0.4004]}, {"w": "has", "b": [0.7467, 0.3807, 0.7803, 0.4004]}, {"w": "made", "b": [0.7866, 0.3807, 0.8413, 0.4004]}, {"w": "its", "b": [0.1294, 0.4012, 0.1533, 0.4209]}, {"w": "way", "b": [0.1595, 0.4012, 0.2016, 0.4209]}, {"w": "into", "b": [0.2079, 0.4012, 0.2471, 0.4209]}, {"w": "the", "b": [0.2534, 0.4012, 0.2843, 0.4209]}, {"w": "products", "b": [0.2906, 0.4012, 0.3774, 0.4209]}, {"w": "and", "b": [0.3838, 0.4012, 0.4202, 0.4209]}, {"w": "processes", "b": [0.4265, 0.4012, 0.5231, 0.4209]}, {"w": "that", "b": [0.5295, 0.4012, 0.5673, 0.4209]}, {"w": "form", "b": [0.5736, 0.4012, 0.6226, 0.4209]}, {"w": "our", "b": [0.6289, 0.4012, 0.6626, 0.4209]}, {"w": "world.", "b": [0.6689, 0.4012, 0.734, 0.4209]}, {"w": "Most", "b": [0.7403, 0.4012, 0.7922, 0.4209]}, {"w": "of", "b": [0.7985, 0.4012, 0.8195, 0.4209]}, {"w": "the", "b": [0.8258, 0.4012, 0.8567, 0.4209]}, {"w": "research", "b": [0.1294, 0.4217, 0.2134, 0.4414]}, {"w": "findings", "b": [0.2197, 0.4217, 0.3024, 0.4414]}, {"w": "of", "b": [0.3087, 0.4217, 0.3298, 0.4414]}, {"w": "deep", "b": [0.3361, 0.4217, 0.3837, 0.4414]}, {"w": "learning", "b": [0.39, 0.4217, 0.4727, 0.4414]}, {"w": "aren’t", "b": [0.479, 0.4217, 0.5373, 0.4414]}, {"w": "yet", "b": [0.5436, 0.4217, 0.5744, 0.4414]}, {"w": "applied,", "b": [0.5807, 0.4217, 0.6613, 0.4414]}, {"w": "or", "b": [0.6676, 0.4217, 0.6886, 0.4414]}, {"w": "at", "b": [0.6949, 0.4217, 0.7131, 0.4414]}, {"w": "least", "b": [0.7194, 0.4217, 0.7656, 0.4414]}, {"w": "not", "b": [0.772, 0.4217, 0.8042, 0.4414]}, {"w": "applied", "b": [0.1294, 0.4422, 0.2037, 0.4619]}, {"w": "to", "b": [0.21, 0.4422, 0.2296, 0.4619]}, {"w": "the", "b": [0.2359, 0.4422, 0.2667, 0.4619]}, {"w": "full", "b": [0.273, 0.4422, 0.3081, 0.4619]}, {"w": "range", "b": [0.3144, 0.4422, 0.3704, 0.4619]}, {"w": "of", "b": [0.3767, 0.4422, 0.3977, 0.4619]}, {"w": "problems", "b": [0.404, 0.4422, 0.4979, 0.4619]}, {"w": "they", "b": [0.5042, 0.4422, 0.5477, 0.4619]}, {"w": "can", "b": [0.554, 0.4422, 0.589, 0.4619]}, {"w": "solve", "b": [0.5953, 0.4422, 0.6486, 0.4619]}, {"w": "across", "b": [0.6549, 0.4422, 0.7179, 0.4619]}, {"w": "all", "b": [0.7242, 0.4422, 0.7494, 0.4619]}, {"w": "industries.", "b": [0.7557, 0.4422, 0.8602, 0.4619]}, {"w": "Your", "b": [0.1294, 0.4627, 0.1787, 0.4824]}, {"w": "doctor", "b": [0.185, 0.4627, 0.2495, 0.4824]}, {"w": "doesn’t", "b": [0.2558, 0.4627, 0.3296, 0.4824]}, {"w": "yet", "b": [0.3359, 0.4627, 0.3667, 0.4824]}, {"w": "use", "b": [0.373, 0.4627, 0.4067, 0.4824]}, {"w": "AI,", "b": [0.413, 0.4627, 0.4459, 0.4824]}, {"w": "and", "b": [0.4522, 0.4627, 0.4886, 0.4824]}, {"w": "neither", "b": [0.4949, 0.4627, 0.565, 0.4824]}, {"w": "does", "b": [0.5713, 0.4627, 0.6175, 0.4824]}, {"w": "your", "b": [0.6238, 0.4627, 0.6701, 0.4824]}, {"w": "accountant.", "b": [0.6764, 0.4627, 0.7919, 0.4824]}, {"w": "You", "b": [0.7983, 0.4627, 0.8391, 0.4824]}, {"w": "probably", "b": [0.1294, 0.4832, 0.2191, 0.5029]}, {"w": "don’t", "b": [0.2254, 0.4832, 0.2782, 0.5029]}, {"w": "use", "b": [0.2845, 0.4832, 0.3181, 0.5029]}, {"w": "AI", "b": [0.3244, 0.4832, 0.351, 0.5029]}, {"w": "technologies", "b": [0.3573, 0.4832, 0.4849, 0.5029]}, {"w": "in", "b": [0.4912, 0.4832, 0.5108, 0.5029]}, {"w": "your", "b": [0.5171, 0.4832, 0.5633, 0.5029]}, {"w": "day-to-day", "b": [0.5696, 0.4832, 0.6789, 0.5029]}, {"w": "life.", "b": [0.6852, 0.4832, 0.7252, 0.5029]}, {"w": "Of", "b": [0.7315, 0.4832, 0.7581, 0.5029]}, {"w": "course,", "b": [0.7644, 0.4832, 0.8365, 0.5029]}, {"w": "you", "b": [0.1294, 0.5037, 0.1673, 0.5234]}, {"w": "can", "b": [0.1736, 0.5037, 0.2086, 0.5234]}, {"w": "ask", "b": [0.2149, 0.5037, 0.2485, 0.5234]}, {"w": "your", "b": [0.2548, 0.5037, 0.301, 0.5234]}, {"w": "smartphone", "b": [0.3073, 0.5037, 0.425, 0.5234]}, {"w": "simple", "b": [0.4313, 0.5037, 0.4986, 0.5234]}, {"w": "questions", "b": [0.5049, 0.5037, 0.6002, 0.5234]}, {"w": "and", "b": [0.6065, 0.5037, 0.643, 0.5234]}, {"w": "get", "b": [0.6493, 0.5037, 0.6801, 0.5234]}, {"w": "reasonable", "b": [0.6864, 0.5037, 0.7943, 0.5234]}, {"w": "answers,", "b": [0.1294, 0.5242, 0.217, 0.5439]}, {"w": "you", "b": [0.2233, 0.5242, 0.2611, 0.5439]}, {"w": "can", "b": [0.2674, 0.5242, 0.3024, 0.5439]}, {"w": "get", "b": [0.3087, 0.5242, 0.3396, 0.5439]}, {"w": "fairly", "b": [0.3459, 0.5242, 0.4005, 0.5439]}, {"w": "useful", "b": [0.4068, 0.5242, 0.4685, 0.5439]}, {"w": "product", "b": [0.4748, 0.5242, 0.5518, 0.5439]}, {"w": "recommendations", "b": [0.5581, 0.5242, 0.7375, 0.5439]}, {"w": "on", "b": [0.7438, 0.5242, 0.769, 0.5439]}, {"w": "Amazon.com,", "b": [0.1294, 0.5447, 0.2709, 0.5644]}, {"w": "and", "b": [0.2772, 0.5447, 0.3137, 0.5644]}, {"w": "you", "b": [0.3199, 0.5447, 0.3578, 0.5644]}, {"w": "can", "b": [0.3641, 0.5447, 0.3991, 0.5644]}, {"w": "search", "b": [0.4054, 0.5447, 0.4698, 0.5644]}, {"w": "for", "b": [0.4761, 0.5447, 0.5056, 0.5644]}, {"w": "“birthday”", "b": [0.5119, 0.5447, 0.6183, 0.5644]}, {"w": "on", "b": [0.6246, 0.5447, 0.6499, 0.5644]}, {"w": "Google", "b": [0.6562, 0.5447, 0.7304, 0.5644]}, {"w": "Photos", "b": [0.7368, 0.5447, 0.8054, 0.5644]}, {"w": "and", "b": [0.8117, 0.5447, 0.8482, 0.5644]}, {"w": "instantly", "b": [0.1294, 0.5652, 0.2163, 0.5849]}, {"w": "find", "b": [0.2226, 0.5652, 0.2633, 0.5849]}, {"w": "those", "b": [0.2696, 0.5652, 0.3228, 0.5849]}, {"w": "pictures", "b": [0.3291, 0.5652, 0.409, 0.5849]}, {"w": "of", "b": [0.4153, 0.5652, 0.4363, 0.5849]}, {"w": "your", "b": [0.4426, 0.5652, 0.4889, 0.5849]}, {"w": "daughter’s", "b": [0.4952, 0.5652, 0.6011, 0.5849]}, {"w": "birthday", "b": [0.6074, 0.5652, 0.6915, 0.5849]}, {"w": "party", "b": [0.6978, 0.5652, 0.7497, 0.5849]}, {"w": "from", "b": [0.756, 0.5652, 0.805, 0.5849]}, {"w": "last", "b": [0.8113, 0.5652, 0.8464, 0.5849]}, {"w": "month.", "b": [0.1294, 0.5857, 0.2002, 0.6054]}, {"w": "That’s", "b": [0.2065, 0.5857, 0.2695, 0.6054]}, {"w": "a", "b": [0.2758, 0.5857, 0.287, 0.6054]}, {"w": "far", "b": [0.2934, 0.5857, 0.3214, 0.6054]}, {"w": "cry", "b": [0.3277, 0.5857, 0.3599, 0.6054]}, {"w": "from", "b": [0.3662, 0.5857, 0.4152, 0.6054]}, {"w": "where", "b": [0.4215, 0.5857, 0.4832, 0.6054]}, {"w": "such", "b": [0.4895, 0.5857, 0.5357, 0.6054]}, {"w": "technologies", "b": [0.542, 0.5857, 0.6695, 0.6054]}, {"w": "used", "b": [0.6758, 0.5857, 0.7221, 0.6054]}, {"w": "to", "b": [0.7284, 0.5857, 0.748, 0.6054]}, {"w": "stand.", "b": [0.7543, 0.5857, 0.8139, 0.6054]}, {"w": "But", "b": [0.8202, 0.5857, 0.8566, 0.6054]}, {"w": "such", "b": [0.1294, 0.6062, 0.1757, 0.6259]}, {"w": "tools", "b": [0.182, 0.6062, 0.231, 0.6259]}, {"w": "are", "b": [0.2373, 0.6062, 0.2681, 0.6259]}, {"w": "still", "b": [0.2744, 0.6062, 0.3123, 0.6259]}, {"w": "only", "b": [0.3186, 0.6062, 0.3635, 0.6259]}, {"w": "accessories", "b": [0.3698, 0.6062, 0.4832, 0.6259]}, {"w": "to", "b": [0.4895, 0.6062, 0.5092, 0.6259]}, {"w": "our", "b": [0.5155, 0.6062, 0.5491, 0.6259]}, {"w": "daily", "b": [0.5554, 0.6062, 0.6059, 0.6259]}, {"w": "lives.", "b": [0.6121, 0.6062, 0.666, 0.6259]}, {"w": "AI", "b": [0.6724, 0.6062, 0.699, 0.6259]}, {"w": "has", "b": [0.7053, 0.6062, 0.7389, 0.6259]}, {"w": "yet", "b": [0.7452, 0.6062, 0.776, 0.6259]}, {"w": "to", "b": [0.7823, 0.6062, 0.802, 0.6259]}, {"w": "transition", "b": [0.1294, 0.6267, 0.2247, 0.6464]}, {"w": "to", "b": [0.231, 0.6267, 0.2506, 0.6464]}, {"w": "being", "b": [0.257, 0.6267, 0.313, 0.6464]}, {"w": "central", "b": [0.3193, 0.6267, 0.388, 0.6464]}, {"w": "to", "b": [0.3943, 0.6267, 0.4139, 0.6464]}, {"w": "the", "b": [0.4202, 0.6267, 0.451, 0.6464]}, {"w": "way", "b": [0.4573, 0.6267, 0.4993, 0.6464]}, {"w": "we", "b": [0.5057, 0.6267, 0.5351, 0.6464]}, {"w": "work,", "b": [0.5414, 0.6267, 0.5995, 0.6464]}, {"w": "think,", "b": [0.6058, 0.6267, 0.664, 0.6464]}, {"w": "and", "b": [0.6703, 0.6267, 0.7067, 0.6464]}, {"w": "live.", "b": [0.713, 0.6267, 0.7572, 0.6464]}]}, {"id": "b_3", "type": "paragraph", "text": "Right now, it may seem hard to believe that AI could have a large impact on our world, because it isn’t yet widely deployed—much as, back in 1995, it would have been difficult to believe in the future impact of the internet. Back then, most people didn’t see how the internet was relevant to them and how it was going to change their lives. The same is true for deep learning and AI today. But make no mistake: AI is coming. In a not-so-distant future, AI will be your assistant, even your friend; it will answer your questions, help educate your kids, and watch over your health. It will deliver your groceries to your door and drive you from point A to point B. It will be your interface to an increasingly complex and information-intensive world. And, even more important, AI will help", "words": [{"w": "Right", "b": [0.1294, 0.6695, 0.1855, 0.6892]}, {"w": "now,", "b": [0.1918, 0.6695, 0.2399, 0.6892]}, {"w": "it", "b": [0.2462, 0.6695, 0.2602, 0.6892]}, {"w": "may", "b": [0.2665, 0.6695, 0.31, 0.6892]}, {"w": "seem", "b": [0.3163, 0.6695, 0.3681, 0.6892]}, {"w": "hard", "b": [0.3744, 0.6695, 0.4193, 0.6892]}, {"w": "to", "b": [0.4256, 0.6695, 0.4452, 0.6892]}, {"w": "believe", "b": [0.4515, 0.6695, 0.5243, 0.6892]}, {"w": "that", "b": [0.5307, 0.6695, 0.5685, 0.6892]}, {"w": "AI", "b": [0.5748, 0.6695, 0.6014, 0.6892]}, {"w": "could", "b": [0.6077, 0.6695, 0.6638, 0.6892]}, {"w": "have", "b": [0.6701, 0.6695, 0.7177, 0.6892]}, {"w": "a", "b": [0.724, 0.6695, 0.7352, 0.6892]}, {"w": "large", "b": [0.7415, 0.6695, 0.7914, 0.6892]}, {"w": "impact", "b": [0.7977, 0.6695, 0.8664, 0.6892]}, {"w": "on", "b": [0.1294, 0.69, 0.1546, 0.7097]}, {"w": "our", "b": [0.1609, 0.69, 0.1946, 0.7097]}, {"w": "world,", "b": [0.2009, 0.69, 0.266, 0.7097]}, {"w": "because", "b": [0.2723, 0.69, 0.3522, 0.7097]}, {"w": "it", "b": [0.3585, 0.69, 0.3725, 0.7097]}, {"w": "isn’t", "b": [0.3788, 0.69, 0.4232, 0.7097]}, {"w": "yet", "b": [0.4295, 0.69, 0.4603, 0.7097]}, {"w": "widely", "b": [0.4666, 0.69, 0.5353, 0.7097]}, {"w": "deployed—much", "b": [0.5416, 0.69, 0.7154, 0.7097]}, {"w": "as,", "b": [0.7216, 0.69, 0.7489, 0.7097]}, {"w": "back", "b": [0.7553, 0.69, 0.8029, 0.7097]}, {"w": "in", "b": [0.8092, 0.69, 0.8288, 0.7097]}, {"w": "1995,", "b": [0.1294, 0.7105, 0.1862, 0.7302]}, {"w": "it", "b": [0.1925, 0.7105, 0.2065, 0.7302]}, {"w": "would", "b": [0.2128, 0.7105, 0.2759, 0.7302]}, {"w": "have", "b": [0.2822, 0.7105, 0.3298, 0.7302]}, {"w": "been", "b": [0.3361, 0.7105, 0.3837, 0.7302]}, {"w": "difficult", "b": [0.39, 0.7105, 0.4708, 0.7302]}, {"w": "to", "b": [0.4771, 0.7105, 0.4968, 0.7302]}, {"w": "believe", "b": [0.5031, 0.7105, 0.5759, 0.7302]}, {"w": "in", "b": [0.5822, 0.7105, 0.6019, 0.7302]}, {"w": "the", "b": [0.6082, 0.7105, 0.639, 0.7302]}, {"w": "future", "b": [0.6453, 0.7105, 0.7055, 0.7302]}, {"w": "impact", "b": [0.7118, 0.7105, 0.7805, 0.7302]}, {"w": "of", "b": [0.7868, 0.7105, 0.8078, 0.7302]}, {"w": "the", "b": [0.8141, 0.7105, 0.845, 0.7302]}, {"w": "internet.", "b": [0.1294, 0.731, 0.2128, 0.7507]}, {"w": "Back", "b": [0.2191, 0.731, 0.2709, 0.7507]}, {"w": "then,", "b": [0.2772, 0.731, 0.327, 0.7507]}, {"w": "most", "b": [0.3333, 0.731, 0.3824, 0.7507]}, {"w": "people", "b": [0.3887, 0.731, 0.4559, 0.7507]}, {"w": "didn’t", "b": [0.4622, 0.731, 0.522, 0.7507]}, {"w": "see", "b": [0.5283, 0.731, 0.5605, 0.7507]}, {"w": "how", "b": [0.5668, 0.731, 0.6102, 0.7507]}, {"w": "the", "b": [0.6165, 0.731, 0.6473, 0.7507]}, {"w": "internet", "b": [0.6537, 0.731, 0.7307, 0.7507]}, {"w": "was", "b": [0.737, 0.731, 0.7762, 0.7507]}, {"w": "relevant", "b": [0.7826, 0.731, 0.8638, 0.7507]}, {"w": "to", "b": [0.1294, 0.7515, 0.149, 0.7712]}, {"w": "them", "b": [0.1553, 0.7515, 0.2058, 0.7712]}, {"w": "and", "b": [0.2121, 0.7515, 0.2485, 0.7712]}, {"w": "how", "b": [0.2548, 0.7515, 0.2983, 0.7712]}, {"w": "it", "b": [0.3046, 0.7515, 0.3186, 0.7712]}, {"w": "was", "b": [0.3249, 0.7515, 0.3641, 0.7712]}, {"w": "going", "b": [0.3704, 0.7515, 0.4279, 0.7712]}, {"w": "to", "b": [0.4342, 0.7515, 0.4538, 0.7712]}, {"w": "change", "b": [0.4601, 0.7515, 0.5316, 0.7712]}, {"w": "their", "b": [0.5379, 0.7515, 0.5841, 0.7712]}, {"w": "lives.", "b": [0.5904, 0.7515, 0.6444, 0.7712]}, {"w": "The", "b": [0.6507, 0.7515, 0.6899, 0.7712]}, {"w": "same", "b": [0.6962, 0.7515, 0.7481, 0.7712]}, {"w": "is", "b": [0.7544, 0.7515, 0.7712, 0.7712]}, {"w": "true", "b": [0.7775, 0.7515, 0.8167, 0.7712]}, {"w": "for", "b": [0.823, 0.7515, 0.8525, 0.7712]}, {"w": "deep", "b": [0.1294, 0.772, 0.177, 0.7917]}, {"w": "learning", "b": [0.1833, 0.772, 0.266, 0.7917]}, {"w": "and", "b": [0.2723, 0.772, 0.3087, 0.7917]}, {"w": "AI", "b": [0.315, 0.772, 0.3416, 0.7917]}, {"w": "today.", "b": [0.3479, 0.772, 0.4087, 0.7917]}, {"w": "But", "b": [0.415, 0.772, 0.4514, 0.7917]}, {"w": "make", "b": [0.4577, 0.772, 0.5124, 0.7917]}, {"w": "no", "b": [0.5187, 0.772, 0.5439, 0.7917]}, {"w": "mistake:", "b": [0.5502, 0.772, 0.6357, 0.7917]}, {"w": "AI", "b": [0.642, 0.772, 0.6686, 0.7917]}, {"w": "is", "b": [0.6749, 0.772, 0.6917, 0.7917]}, {"w": "coming.", "b": [0.698, 0.772, 0.78, 0.7917]}, {"w": "In", "b": [0.7863, 0.772, 0.8073, 0.7917]}, {"w": "a", "b": [0.8137, 0.772, 0.8249, 0.7917]}, {"w": "not-so-distant", "b": [0.1294, 0.7925, 0.2682, 0.8122]}, {"w": "future,", "b": [0.2745, 0.7925, 0.341, 0.8122]}, {"w": "AI", "b": [0.3473, 0.7925, 0.3739, 0.8122]}, {"w": "will", "b": [0.3802, 0.7925, 0.4195, 0.8122]}, {"w": "be", "b": [0.4258, 0.7925, 0.4496, 0.8122]}, {"w": "your", "b": [0.4559, 0.7925, 0.5021, 0.8122]}, {"w": "assistant,", "b": [0.5085, 0.7925, 0.6003, 0.8122]}, {"w": "even", "b": [0.6066, 0.7925, 0.6542, 0.8122]}, {"w": "your", "b": [0.6605, 0.7925, 0.7067, 0.8122]}, {"w": "friend;", "b": [0.713, 0.7925, 0.7803, 0.8122]}, {"w": "it", "b": [0.7866, 0.7925, 0.8006, 0.8122]}, {"w": "will", "b": [0.8069, 0.7925, 0.8462, 0.8122]}, {"w": "answer", "b": [0.1294, 0.813, 0.2009, 0.8327]}, {"w": "your", "b": [0.2072, 0.813, 0.2534, 0.8327]}, {"w": "questions,", "b": [0.2597, 0.813, 0.3613, 0.8327]}, {"w": "help", "b": [0.3676, 0.813, 0.4111, 0.8327]}, {"w": "educate", "b": [0.4174, 0.813, 0.4944, 0.8327]}, {"w": "your", "b": [0.5007, 0.813, 0.5469, 0.8327]}, {"w": "kids,", "b": [0.5533, 0.813, 0.6016, 0.8327]}, {"w": "and", "b": [0.6079, 0.813, 0.6443, 0.8327]}, {"w": "watch", "b": [0.6507, 0.813, 0.7109, 0.8327]}, {"w": "over", "b": [0.7172, 0.813, 0.762, 0.8327]}, {"w": "your", "b": [0.7683, 0.813, 0.8146, 0.8327]}, {"w": "health.", "b": [0.1294, 0.8335, 0.1974, 0.8532]}, {"w": "It", "b": [0.2037, 0.8335, 0.2191, 0.8532]}, {"w": "will", "b": [0.2254, 0.8335, 0.2646, 0.8532]}, {"w": "deliver", "b": [0.271, 0.8335, 0.341, 0.8532]}, {"w": "your", "b": [0.3473, 0.8335, 0.3936, 0.8532]}, {"w": "groceries", "b": [0.3999, 0.8335, 0.4923, 0.8532]}, {"w": "to", "b": [0.4986, 0.8335, 0.5182, 0.8532]}, {"w": "your", "b": [0.5245, 0.8335, 0.5708, 0.8532]}, {"w": "door", "b": [0.5771, 0.8335, 0.6233, 0.8532]}, {"w": "and", "b": [0.6296, 0.8335, 0.6661, 0.8532]}, {"w": "drive", "b": [0.6723, 0.8335, 0.7241, 0.8532]}, {"w": "you", "b": [0.7304, 0.8335, 0.7683, 0.8532]}, {"w": "from", "b": [0.7746, 0.8335, 0.8236, 0.8532]}, {"w": "point", "b": [0.1294, 0.854, 0.1813, 0.8737]}, {"w": "A", "b": [0.1876, 0.854, 0.2058, 0.8737]}, {"w": "to", "b": [0.2121, 0.854, 0.2317, 0.8737]}, {"w": "point", "b": [0.238, 0.854, 0.2899, 0.8737]}, {"w": "B.", "b": [0.2962, 0.854, 0.3193, 0.8737]}, {"w": "It", "b": [0.3256, 0.854, 0.3411, 0.8737]}, {"w": "will", "b": [0.3474, 0.854, 0.3866, 0.8737]}, {"w": "be", "b": [0.3929, 0.854, 0.4167, 0.8737]}, {"w": "your", "b": [0.423, 0.854, 0.4693, 0.8737]}, {"w": "interface", "b": [0.4756, 0.854, 0.5638, 0.8737]}, {"w": "to", "b": [0.5701, 0.854, 0.5898, 0.8737]}, {"w": "an", "b": [0.5961, 0.854, 0.6199, 0.8737]}, {"w": "increasingly", "b": [0.6262, 0.854, 0.7495, 0.8737]}, {"w": "complex", "b": [0.7558, 0.854, 0.8427, 0.8737]}, {"w": "and", "b": [0.1294, 0.8745, 0.1658, 0.8942]}, {"w": "information-intensive", "b": [0.1721, 0.8745, 0.3908, 0.8942]}, {"w": "world.", "b": [0.3971, 0.8745, 0.4622, 0.8942]}, {"w": "And,", "b": [0.4685, 0.8745, 0.5183, 0.8942]}, {"w": "even", "b": [0.5245, 0.8745, 0.5722, 0.8942]}, {"w": "more", "b": [0.5785, 0.8745, 0.6303, 0.8942]}, {"w": "important,", "b": [0.6366, 0.8745, 0.741, 0.8942]}, {"w": "AI", "b": [0.7473, 0.8745, 0.7739, 0.8942]}, {"w": "will", "b": [0.7802, 0.8745, 0.8195, 0.8942]}, {"w": "help", "b": [0.8258, 0.8745, 0.8692, 0.8942]}]}]}, {"page": 43, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "humanity as a whole move forward, by assisting human scientists in new breakthrough discoveries across all scientific fields, from genomics to mathematics.", "words": [{"w": "humanity", "b": [0.1294, 0.0857, 0.2247, 0.1054]}, {"w": "as", "b": [0.231, 0.0857, 0.252, 0.1054]}, {"w": "a", "b": [0.2583, 0.0857, 0.2695, 0.1054]}, {"w": "whole", "b": [0.2758, 0.0857, 0.3375, 0.1054]}, {"w": "move", "b": [0.3438, 0.0857, 0.3999, 0.1054]}, {"w": "forward,", "b": [0.4062, 0.0857, 0.4923, 0.1054]}, {"w": "by", "b": [0.4986, 0.0857, 0.5238, 0.1054]}, {"w": "assisting", "b": [0.5301, 0.0857, 0.6171, 0.1054]}, {"w": "human", "b": [0.6234, 0.0857, 0.692, 0.1054]}, {"w": "scientists", "b": [0.6983, 0.0857, 0.7908, 0.1054]}, {"w": "in", "b": [0.7971, 0.0857, 0.8168, 0.1054]}, {"w": "new", "b": [0.8231, 0.0857, 0.8651, 0.1054]}, {"w": "breakthrough", "b": [0.1294, 0.1062, 0.2639, 0.1259]}, {"w": "discoveries", "b": [0.2702, 0.1062, 0.3837, 0.1259]}, {"w": "across", "b": [0.39, 0.1062, 0.453, 0.1259]}, {"w": "all", "b": [0.4593, 0.1062, 0.4846, 0.1259]}, {"w": "scientific", "b": [0.4909, 0.1062, 0.5833, 0.1259]}, {"w": "fields,", "b": [0.5896, 0.1062, 0.652, 0.1259]}, {"w": "from", "b": [0.6583, 0.1062, 0.7074, 0.1259]}, {"w": "genomics", "b": [0.7137, 0.1062, 0.8103, 0.1259]}, {"w": "to", "b": [0.8167, 0.1062, 0.8363, 0.1259]}, {"w": "mathematics.", "b": [0.1294, 0.1267, 0.2632, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "On the way, we may face a few setbacks and maybe a new AI winter—in much the same way the internet industry was overhyped in 1998–1999 and suffered from a crash that dried up investment throughout the early 2000s. But we’ll get there eventually. AI will end up being applied to nearly every process that makes up our society and our daily lives, much like the internet is today.", "words": [{"w": "On", "b": [0.1294, 0.1695, 0.1602, 0.1892]}, {"w": "the", "b": [0.1665, 0.1695, 0.1974, 0.1892]}, {"w": "way,", "b": [0.2037, 0.1695, 0.2504, 0.1892]}, {"w": "we", "b": [0.2567, 0.1695, 0.2861, 0.1892]}, {"w": "may", "b": [0.2924, 0.1695, 0.3358, 0.1892]}, {"w": "face", "b": [0.3421, 0.1695, 0.3841, 0.1892]}, {"w": "a", "b": [0.3904, 0.1695, 0.4016, 0.1892]}, {"w": "few", "b": [0.408, 0.1695, 0.4458, 0.1892]}, {"w": "setbacks", "b": [0.4521, 0.1695, 0.5375, 0.1892]}, {"w": "and", "b": [0.5438, 0.1695, 0.5803, 0.1892]}, {"w": "maybe", "b": [0.5866, 0.1695, 0.6538, 0.1892]}, {"w": "a", "b": [0.6601, 0.1695, 0.6713, 0.1892]}, {"w": "new", "b": [0.6776, 0.1695, 0.7197, 0.1892]}, {"w": "AI", "b": [0.726, 0.1695, 0.7526, 0.1892]}, {"w": "winter—in", "b": [0.7589, 0.1695, 0.8682, 0.1892]}, {"w": "much", "b": [0.1294, 0.19, 0.1855, 0.2097]}, {"w": "the", "b": [0.1918, 0.19, 0.2226, 0.2097]}, {"w": "same", "b": [0.2289, 0.19, 0.2807, 0.2097]}, {"w": "way", "b": [0.287, 0.19, 0.3291, 0.2097]}, {"w": "the", "b": [0.3354, 0.19, 0.3662, 0.2097]}, {"w": "internet", "b": [0.3725, 0.19, 0.4496, 0.2097]}, {"w": "industry", "b": [0.4559, 0.19, 0.5386, 0.2097]}, {"w": "was", "b": [0.5449, 0.19, 0.5841, 0.2097]}, {"w": "overhyped", "b": [0.5904, 0.19, 0.6969, 0.2097]}, {"w": "in", "b": [0.7031, 0.19, 0.7227, 0.2097]}, {"w": "1998–1999", "b": [0.7291, 0.19, 0.8426, 0.2097]}, {"w": "and", "b": [0.1294, 0.2105, 0.1658, 0.2302]}, {"w": "suffered", "b": [0.1721, 0.2105, 0.2543, 0.2302]}, {"w": "from", "b": [0.2606, 0.2105, 0.3097, 0.2302]}, {"w": "a", "b": [0.316, 0.2105, 0.3272, 0.2302]}, {"w": "crash", "b": [0.3335, 0.2105, 0.3867, 0.2302]}, {"w": "that", "b": [0.393, 0.2105, 0.4309, 0.2302]}, {"w": "dried", "b": [0.4372, 0.2105, 0.489, 0.2302]}, {"w": "up", "b": [0.4953, 0.2105, 0.5205, 0.2302]}, {"w": "investment", "b": [0.5268, 0.2105, 0.6376, 0.2302]}, {"w": "throughout", "b": [0.6439, 0.2105, 0.7546, 0.2302]}, {"w": "the", "b": [0.7609, 0.2105, 0.7917, 0.2302]}, {"w": "early", "b": [0.798, 0.2105, 0.8484, 0.2302]}, {"w": "2000s.", "b": [0.1294, 0.231, 0.196, 0.2507]}, {"w": "But", "b": [0.2023, 0.231, 0.2387, 0.2507]}, {"w": "we’ll", "b": [0.245, 0.231, 0.2969, 0.2507]}, {"w": "get", "b": [0.3032, 0.231, 0.334, 0.2507]}, {"w": "there", "b": [0.3403, 0.231, 0.3908, 0.2507]}, {"w": "eventually.", "b": [0.3971, 0.231, 0.5068, 0.2507]}, {"w": "AI", "b": [0.5131, 0.231, 0.5397, 0.2507]}, {"w": "will", "b": [0.546, 0.231, 0.5852, 0.2507]}, {"w": "end", "b": [0.5915, 0.231, 0.628, 0.2507]}, {"w": "up", "b": [0.6343, 0.231, 0.6595, 0.2507]}, {"w": "being", "b": [0.6658, 0.231, 0.7219, 0.2507]}, {"w": "applied", "b": [0.7282, 0.231, 0.8024, 0.2507]}, {"w": "to", "b": [0.8087, 0.231, 0.8284, 0.2507]}, {"w": "nearly", "b": [0.1294, 0.2515, 0.1925, 0.2712]}, {"w": "every", "b": [0.1988, 0.2515, 0.2548, 0.2712]}, {"w": "process", "b": [0.2611, 0.2515, 0.3367, 0.2712]}, {"w": "that", "b": [0.343, 0.2515, 0.3809, 0.2712]}, {"w": "makes", "b": [0.3872, 0.2515, 0.4516, 0.2712]}, {"w": "up", "b": [0.458, 0.2515, 0.4832, 0.2712]}, {"w": "our", "b": [0.4895, 0.2515, 0.5231, 0.2712]}, {"w": "society", "b": [0.5294, 0.2515, 0.6009, 0.2712]}, {"w": "and", "b": [0.6072, 0.2515, 0.6436, 0.2712]}, {"w": "our", "b": [0.6499, 0.2515, 0.6835, 0.2712]}, {"w": "daily", "b": [0.6899, 0.2515, 0.7403, 0.2712]}, {"w": "lives,", "b": [0.7466, 0.2515, 0.8006, 0.2712]}, {"w": "much", "b": [0.8069, 0.2515, 0.8629, 0.2712]}, {"w": "like", "b": [0.1294, 0.272, 0.1673, 0.2917]}, {"w": "the", "b": [0.1736, 0.272, 0.2044, 0.2917]}, {"w": "internet", "b": [0.2107, 0.272, 0.2878, 0.2917]}, {"w": "is", "b": [0.294, 0.272, 0.3108, 0.2917]}, {"w": "today.", "b": [0.3171, 0.272, 0.3779, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "Don’t believe the short-term hype, but do believe in the long-term vision. It may take a while for AI to be deployed to its true potential—a potential the full extent of which no one has yet dared to dream—but AI is coming, and it will transform our world in a fantastic way.", "words": [{"w": "Don’t", "b": [0.1294, 0.3147, 0.1878, 0.3345]}, {"w": "believe", "b": [0.1941, 0.3147, 0.267, 0.3345]}, {"w": "the", "b": [0.2733, 0.3147, 0.3041, 0.3345]}, {"w": "short-term", "b": [0.3104, 0.3147, 0.4155, 0.3345]}, {"w": "hype,", "b": [0.4218, 0.3147, 0.4772, 0.3345]}, {"w": "but", "b": [0.4835, 0.3147, 0.5157, 0.3345]}, {"w": "do", "b": [0.522, 0.3147, 0.5472, 0.3345]}, {"w": "believe", "b": [0.5535, 0.3147, 0.6264, 0.3345]}, {"w": "in", "b": [0.6327, 0.3147, 0.6523, 0.3345]}, {"w": "the", "b": [0.6586, 0.3147, 0.6895, 0.3345]}, {"w": "long-term", "b": [0.6958, 0.3147, 0.7952, 0.3345]}, {"w": "vision.", "b": [0.8016, 0.3147, 0.8695, 0.3345]}, {"w": "It", "b": [0.1294, 0.3352, 0.1448, 0.355]}, {"w": "may", "b": [0.1511, 0.3352, 0.1946, 0.355]}, {"w": "take", "b": [0.2009, 0.3352, 0.2429, 0.355]}, {"w": "a", "b": [0.2492, 0.3352, 0.2604, 0.355]}, {"w": "while", "b": [0.2667, 0.3352, 0.3228, 0.355]}, {"w": "for", "b": [0.3291, 0.3352, 0.3585, 0.355]}, {"w": "AI", "b": [0.3648, 0.3352, 0.3914, 0.355]}, {"w": "to", "b": [0.3977, 0.3352, 0.4173, 0.355]}, {"w": "be", "b": [0.4236, 0.3352, 0.4475, 0.355]}, {"w": "deployed", "b": [0.4538, 0.3352, 0.5462, 0.355]}, {"w": "to", "b": [0.5525, 0.3352, 0.5722, 0.355]}, {"w": "its", "b": [0.5785, 0.3352, 0.6023, 0.355]}, {"w": "true", "b": [0.6086, 0.3352, 0.6478, 0.355]}, {"w": "potential—a", "b": [0.6541, 0.3352, 0.7788, 0.355]}, {"w": "potential", "b": [0.1294, 0.3557, 0.2177, 0.3755]}, {"w": "the", "b": [0.224, 0.3557, 0.2548, 0.3755]}, {"w": "full", "b": [0.2611, 0.3557, 0.2962, 0.3755]}, {"w": "extent", "b": [0.3025, 0.3557, 0.3641, 0.3755]}, {"w": "of", "b": [0.3704, 0.3557, 0.3915, 0.3755]}, {"w": "which", "b": [0.3978, 0.3557, 0.4594, 0.3755]}, {"w": "no", "b": [0.4657, 0.3557, 0.4909, 0.3755]}, {"w": "one", "b": [0.4973, 0.3557, 0.5337, 0.3755]}, {"w": "has", "b": [0.54, 0.3557, 0.5736, 0.3755]}, {"w": "yet", "b": [0.5799, 0.3557, 0.6107, 0.3755]}, {"w": "dared", "b": [0.6171, 0.3557, 0.6731, 0.3755]}, {"w": "to", "b": [0.6794, 0.3557, 0.699, 0.3755]}, {"w": "dream—but", "b": [0.7053, 0.3557, 0.8258, 0.3755]}, {"w": "AI", "b": [0.8321, 0.3557, 0.8587, 0.3755]}, {"w": "is", "b": [0.1294, 0.3762, 0.1462, 0.396]}, {"w": "coming,", "b": [0.1525, 0.3762, 0.2345, 0.396]}, {"w": "and", "b": [0.2408, 0.3762, 0.2773, 0.396]}, {"w": "it", "b": [0.2836, 0.3762, 0.2976, 0.396]}, {"w": "will", "b": [0.3039, 0.3762, 0.3431, 0.396]}, {"w": "transform", "b": [0.3495, 0.3762, 0.4475, 0.396]}, {"w": "our", "b": [0.4538, 0.3762, 0.4874, 0.396]}, {"w": "world", "b": [0.4937, 0.3762, 0.5526, 0.396]}, {"w": "in", "b": [0.5589, 0.3762, 0.5785, 0.396]}, {"w": "a", "b": [0.5848, 0.3762, 0.596, 0.396]}, {"w": "fantastic", "b": [0.6023, 0.3762, 0.6878, 0.396]}, {"w": "way.", "b": [0.6941, 0.3762, 0.7408, 0.396]}]}, {"id": "b_3", "type": "paragraph", "text": "1.2. Before deep learning: a brief history of machine learning", "words": [{"w": "1.2.", "b": [0.1294, 0.4331, 0.172, 0.4553]}, {"w": "Before", "b": [0.1791, 0.4331, 0.2589, 0.4553]}, {"w": "deep", "b": [0.266, 0.4331, 0.3228, 0.4553]}, {"w": "learning:", "b": [0.3299, 0.4331, 0.4402, 0.4553]}, {"w": "a", "b": [0.4473, 0.4331, 0.4615, 0.4553]}, {"w": "brief", "b": [0.4686, 0.4331, 0.5269, 0.4553]}, {"w": "history", "b": [0.534, 0.4331, 0.6192, 0.4553]}, {"w": "of", "b": [0.6263, 0.4331, 0.6499, 0.4553]}, {"w": "machine", "b": [0.657, 0.4331, 0.7595, 0.4553]}, {"w": "learning", "b": [0.7666, 0.4331, 0.8675, 0.4553]}]}, {"id": "b_4", "type": "paragraph", "text": "Deep learning has reached a level of public attention and industry investment never before seen in the history of AI, but it isn’t the first successful form of machine learning. It’s safe to say that most of the machine-learning algorithms used in the industry today aren’t deep- learning algorithms. Deep learning isn’t always the right tool for the job —sometimes there isn’t enough data for deep learning to be applicable, and sometimes the problem is better solved by a different algorithm. If deep learning is your first contact with machine learning, then you may find yourself in a situation where all you have is the deep-learning hammer, and every machine-learning problem starts to look like a nail. The only way not to fall into this trap is to be familiar with other approaches and practice them when appropriate.", "words": [{"w": "Deep", "b": [0.1294, 0.4787, 0.1826, 0.4985]}, {"w": "learning", "b": [0.1889, 0.4787, 0.2716, 0.4985]}, {"w": "has", "b": [0.2779, 0.4787, 0.3115, 0.4985]}, {"w": "reached", "b": [0.3178, 0.4787, 0.3963, 0.4985]}, {"w": "a", "b": [0.4026, 0.4787, 0.4138, 0.4985]}, {"w": "level", "b": [0.4201, 0.4787, 0.4691, 0.4985]}, {"w": "of", "b": [0.4754, 0.4787, 0.4964, 0.4985]}, {"w": "public", "b": [0.5028, 0.4787, 0.5658, 0.4985]}, {"w": "attention", "b": [0.5721, 0.4787, 0.6604, 0.4985]}, {"w": "and", "b": [0.6667, 0.4787, 0.7031, 0.4985]}, {"w": "industry", "b": [0.7095, 0.4787, 0.7921, 0.4985]}, {"w": "investment", "b": [0.1294, 0.4992, 0.2401, 0.519]}, {"w": "never", "b": [0.2464, 0.4992, 0.3025, 0.519]}, {"w": "before", "b": [0.3088, 0.4992, 0.3732, 0.519]}, {"w": "seen", "b": [0.3795, 0.4992, 0.4243, 0.519]}, {"w": "in", "b": [0.4306, 0.4992, 0.4503, 0.519]}, {"w": "the", "b": [0.4566, 0.4992, 0.4874, 0.519]}, {"w": "history", "b": [0.4937, 0.4992, 0.5638, 0.519]}, {"w": "of", "b": [0.5701, 0.4992, 0.5911, 0.519]}, {"w": "AI,", "b": [0.5974, 0.4992, 0.6303, 0.519]}, {"w": "but", "b": [0.6366, 0.4992, 0.6689, 0.519]}, {"w": "it", "b": [0.6751, 0.4992, 0.6891, 0.519]}, {"w": "isn’t", "b": [0.6954, 0.4992, 0.7398, 0.519]}, {"w": "the", "b": [0.7461, 0.4992, 0.777, 0.519]}, {"w": "first", "b": [0.7833, 0.4992, 0.8239, 0.519]}, {"w": "successful", "b": [0.1294, 0.5197, 0.2331, 0.5395]}, {"w": "form", "b": [0.2394, 0.5197, 0.2884, 0.5395]}, {"w": "of", "b": [0.2947, 0.5197, 0.3158, 0.5395]}, {"w": "machine", "b": [0.3221, 0.5197, 0.4075, 0.5395]}, {"w": "learning.", "b": [0.4138, 0.5197, 0.5028, 0.5395]}, {"w": "It’s", "b": [0.5091, 0.5197, 0.5413, 0.5395]}, {"w": "safe", "b": [0.5476, 0.5197, 0.5882, 0.5395]}, {"w": "to", "b": [0.5945, 0.5197, 0.6141, 0.5395]}, {"w": "say", "b": [0.6205, 0.5197, 0.6541, 0.5395]}, {"w": "that", "b": [0.6604, 0.5197, 0.6982, 0.5395]}, {"w": "most", "b": [0.7045, 0.5197, 0.7536, 0.5395]}, {"w": "of", "b": [0.7599, 0.5197, 0.7809, 0.5395]}, {"w": "the", "b": [0.7872, 0.5197, 0.818, 0.5395]}, {"w": "machine-learning", "b": [0.1294, 0.5402, 0.3059, 0.56]}, {"w": "algorithms", "b": [0.3122, 0.5402, 0.4202, 0.56]}, {"w": "used", "b": [0.4265, 0.5402, 0.4727, 0.56]}, {"w": "in", "b": [0.4789, 0.5402, 0.4986, 0.56]}, {"w": "the", "b": [0.5049, 0.5402, 0.5357, 0.56]}, {"w": "industry", "b": [0.542, 0.5402, 0.6247, 0.56]}, {"w": "today", "b": [0.631, 0.5402, 0.6871, 0.56]}, {"w": "aren’t", "b": [0.6934, 0.5402, 0.7517, 0.56]}, {"w": "deep-", "b": [0.758, 0.5402, 0.814, 0.56]}, {"w": "learning", "b": [0.1294, 0.5607, 0.2121, 0.5805]}, {"w": "algorithms.", "b": [0.2184, 0.5607, 0.3326, 0.5805]}, {"w": "Deep", "b": [0.3389, 0.5607, 0.3921, 0.5805]}, {"w": "learning", "b": [0.3984, 0.5607, 0.4811, 0.5805]}, {"w": "isn’t", "b": [0.4874, 0.5607, 0.5318, 0.5805]}, {"w": "always", "b": [0.5381, 0.5607, 0.6081, 0.5805]}, {"w": "the", "b": [0.6144, 0.5607, 0.6453, 0.5805]}, {"w": "right", "b": [0.6516, 0.5607, 0.6992, 0.5805]}, {"w": "tool", "b": [0.7055, 0.5607, 0.7448, 0.5805]}, {"w": "for", "b": [0.7511, 0.5607, 0.7805, 0.5805]}, {"w": "the", "b": [0.7868, 0.5607, 0.8176, 0.5805]}, {"w": "job", "b": [0.8239, 0.5607, 0.8562, 0.5805]}, {"w": "—sometimes", "b": [0.1294, 0.5812, 0.2626, 0.601]}, {"w": "there", "b": [0.2689, 0.5812, 0.3193, 0.601]}, {"w": "isn’t", "b": [0.3256, 0.5812, 0.37, 0.601]}, {"w": "enough", "b": [0.3763, 0.5812, 0.4505, 0.601]}, {"w": "data", "b": [0.4568, 0.5812, 0.4989, 0.601]}, {"w": "for", "b": [0.5052, 0.5812, 0.5346, 0.601]}, {"w": "deep", "b": [0.5409, 0.5812, 0.5885, 0.601]}, {"w": "learning", "b": [0.5948, 0.5812, 0.6775, 0.601]}, {"w": "to", "b": [0.6838, 0.5812, 0.7034, 0.601]}, {"w": "be", "b": [0.7097, 0.5812, 0.7335, 0.601]}, {"w": "applicable,", "b": [0.7398, 0.5812, 0.8498, 0.601]}, {"w": "and", "b": [0.1294, 0.6017, 0.1658, 0.6215]}, {"w": "sometimes", "b": [0.1721, 0.6017, 0.2801, 0.6215]}, {"w": "the", "b": [0.2864, 0.6017, 0.3172, 0.6215]}, {"w": "problem", "b": [0.3235, 0.6017, 0.4076, 0.6215]}, {"w": "is", "b": [0.4139, 0.6017, 0.4307, 0.6215]}, {"w": "better", "b": [0.437, 0.6017, 0.4945, 0.6215]}, {"w": "solved", "b": [0.5008, 0.6017, 0.5666, 0.6215]}, {"w": "by", "b": [0.5729, 0.6017, 0.5982, 0.6215]}, {"w": "a", "b": [0.6045, 0.6017, 0.6157, 0.6215]}, {"w": "different", "b": [0.622, 0.6017, 0.7083, 0.6215]}, {"w": "algorithm.", "b": [0.7146, 0.6017, 0.819, 0.6215]}, {"w": "If", "b": [0.8253, 0.6017, 0.8421, 0.6215]}, {"w": "deep", "b": [0.1294, 0.6222, 0.177, 0.642]}, {"w": "learning", "b": [0.1833, 0.6222, 0.266, 0.642]}, {"w": "is", "b": [0.2723, 0.6222, 0.2891, 0.642]}, {"w": "your", "b": [0.2954, 0.6222, 0.3417, 0.642]}, {"w": "first", "b": [0.348, 0.6222, 0.3886, 0.642]}, {"w": "contact", "b": [0.3949, 0.6222, 0.4678, 0.642]}, {"w": "with", "b": [0.4741, 0.6222, 0.5189, 0.642]}, {"w": "machine", "b": [0.5253, 0.6222, 0.6107, 0.642]}, {"w": "learning,", "b": [0.617, 0.6222, 0.706, 0.642]}, {"w": "then", "b": [0.7123, 0.6222, 0.7557, 0.642]}, {"w": "you", "b": [0.762, 0.6222, 0.7999, 0.642]}, {"w": "may", "b": [0.8062, 0.6222, 0.8496, 0.642]}, {"w": "find", "b": [0.1294, 0.6427, 0.1701, 0.6625]}, {"w": "yourself", "b": [0.1764, 0.6427, 0.259, 0.6625]}, {"w": "in", "b": [0.2653, 0.6427, 0.285, 0.6625]}, {"w": "a", "b": [0.2913, 0.6427, 0.3025, 0.6625]}, {"w": "situation", "b": [0.3088, 0.6427, 0.3957, 0.6625]}, {"w": "where", "b": [0.402, 0.6427, 0.4636, 0.6625]}, {"w": "all", "b": [0.4699, 0.6427, 0.4951, 0.6625]}, {"w": "you", "b": [0.5014, 0.6427, 0.5393, 0.6625]}, {"w": "have", "b": [0.5456, 0.6427, 0.5932, 0.6625]}, {"w": "is", "b": [0.5995, 0.6427, 0.6163, 0.6625]}, {"w": "the", "b": [0.6226, 0.6427, 0.6534, 0.6625]}, {"w": "deep-learning", "b": [0.6597, 0.6427, 0.7984, 0.6625]}, {"w": "hammer,", "b": [0.1294, 0.6632, 0.2174, 0.683]}, {"w": "and", "b": [0.2237, 0.6632, 0.2601, 0.683]}, {"w": "every", "b": [0.2664, 0.6632, 0.3224, 0.683]}, {"w": "machine-learning", "b": [0.3287, 0.6632, 0.5053, 0.683]}, {"w": "problem", "b": [0.5116, 0.6632, 0.5956, 0.683]}, {"w": "starts", "b": [0.6019, 0.6632, 0.6552, 0.683]}, {"w": "to", "b": [0.6615, 0.6632, 0.6811, 0.683]}, {"w": "look", "b": [0.6874, 0.6632, 0.7323, 0.683]}, {"w": "like", "b": [0.7386, 0.6632, 0.7764, 0.683]}, {"w": "a", "b": [0.7827, 0.6632, 0.7939, 0.683]}, {"w": "nail.", "b": [0.8002, 0.6632, 0.8444, 0.683]}, {"w": "The", "b": [0.1294, 0.6837, 0.1686, 0.7035]}, {"w": "only", "b": [0.1749, 0.6837, 0.2198, 0.7035]}, {"w": "way", "b": [0.2261, 0.6837, 0.2681, 0.7035]}, {"w": "not", "b": [0.2744, 0.6837, 0.3067, 0.7035]}, {"w": "to", "b": [0.313, 0.6837, 0.3326, 0.7035]}, {"w": "fall", "b": [0.3389, 0.6837, 0.3725, 0.7035]}, {"w": "into", "b": [0.3788, 0.6837, 0.4181, 0.7035]}, {"w": "this", "b": [0.4244, 0.6837, 0.4608, 0.7035]}, {"w": "trap", "b": [0.4671, 0.6837, 0.5063, 0.7035]}, {"w": "is", "b": [0.5126, 0.6837, 0.5295, 0.7035]}, {"w": "to", "b": [0.5358, 0.6837, 0.5554, 0.7035]}, {"w": "be", "b": [0.5617, 0.6837, 0.5855, 0.7035]}, {"w": "familiar", "b": [0.5918, 0.6837, 0.6717, 0.7035]}, {"w": "with", "b": [0.678, 0.6837, 0.7229, 0.7035]}, {"w": "other", "b": [0.7292, 0.6837, 0.781, 0.7035]}, {"w": "approaches", "b": [0.1294, 0.7042, 0.2429, 0.724]}, {"w": "and", "b": [0.2492, 0.7042, 0.2856, 0.724]}, {"w": "practice", "b": [0.2919, 0.7042, 0.3718, 0.724]}, {"w": "them", "b": [0.3781, 0.7042, 0.4285, 0.724]}, {"w": "when", "b": [0.4348, 0.7042, 0.4895, 0.724]}, {"w": "appropriate.", "b": [0.4958, 0.7042, 0.617, 0.724]}]}, {"id": "b_5", "type": "paragraph", "text": "A detailed discussion of classical machine-learning approaches is outside of the scope of this book, but we’ll briefly go over them and describe the historical context in which they were developed. This will allow us to place deep learning in the broader context of machine learning and better understand where deep learning comes from and why it matters.", "words": [{"w": "A", "b": [0.1294, 0.747, 0.1476, 0.7668]}, {"w": "detailed", "b": [0.1539, 0.747, 0.2338, 0.7668]}, {"w": "discussion", "b": [0.2401, 0.747, 0.3452, 0.7668]}, {"w": "of", "b": [0.3515, 0.747, 0.3725, 0.7668]}, {"w": "classical", "b": [0.3788, 0.747, 0.4643, 0.7668]}, {"w": "machine-learning", "b": [0.4706, 0.747, 0.6471, 0.7668]}, {"w": "approaches", "b": [0.6535, 0.747, 0.7669, 0.7668]}, {"w": "is", "b": [0.7732, 0.747, 0.79, 0.7668]}, {"w": "outside", "b": [0.7964, 0.747, 0.8692, 0.7668]}, {"w": "of", "b": [0.1294, 0.7675, 0.1504, 0.7873]}, {"w": "the", "b": [0.1567, 0.7675, 0.1876, 0.7873]}, {"w": "scope", "b": [0.1939, 0.7675, 0.2513, 0.7873]}, {"w": "of", "b": [0.2576, 0.7675, 0.2786, 0.7873]}, {"w": "this", "b": [0.2849, 0.7675, 0.3214, 0.7873]}, {"w": "book,", "b": [0.3277, 0.7675, 0.3844, 0.7873]}, {"w": "but", "b": [0.3908, 0.7675, 0.423, 0.7873]}, {"w": "we’ll", "b": [0.4293, 0.7675, 0.4811, 0.7873]}, {"w": "briefly", "b": [0.4874, 0.7675, 0.5547, 0.7873]}, {"w": "go", "b": [0.561, 0.7675, 0.5862, 0.7873]}, {"w": "over", "b": [0.5925, 0.7675, 0.6373, 0.7873]}, {"w": "them", "b": [0.6436, 0.7675, 0.6941, 0.7873]}, {"w": "and", "b": [0.7004, 0.7675, 0.7368, 0.7873]}, {"w": "describe", "b": [0.7431, 0.7675, 0.8272, 0.7873]}, {"w": "the", "b": [0.8335, 0.7675, 0.8643, 0.7873]}, {"w": "historical", "b": [0.1294, 0.788, 0.2233, 0.8078]}, {"w": "context", "b": [0.2296, 0.788, 0.3039, 0.8078]}, {"w": "in", "b": [0.3102, 0.788, 0.3298, 0.8078]}, {"w": "which", "b": [0.3361, 0.788, 0.3978, 0.8078]}, {"w": "they", "b": [0.4041, 0.788, 0.4475, 0.8078]}, {"w": "were", "b": [0.4538, 0.788, 0.5028, 0.8078]}, {"w": "developed.", "b": [0.5091, 0.788, 0.6191, 0.8078]}, {"w": "This", "b": [0.6254, 0.788, 0.6703, 0.8078]}, {"w": "will", "b": [0.6766, 0.788, 0.7158, 0.8078]}, {"w": "allow", "b": [0.7221, 0.788, 0.7782, 0.8078]}, {"w": "us", "b": [0.7845, 0.788, 0.8069, 0.8078]}, {"w": "to", "b": [0.8132, 0.788, 0.8329, 0.8078]}, {"w": "place", "b": [0.1294, 0.8085, 0.1826, 0.8283]}, {"w": "deep", "b": [0.1889, 0.8085, 0.2366, 0.8283]}, {"w": "learning", "b": [0.2429, 0.8085, 0.3255, 0.8283]}, {"w": "in", "b": [0.3318, 0.8085, 0.3515, 0.8283]}, {"w": "the", "b": [0.3578, 0.8085, 0.3886, 0.8283]}, {"w": "broader", "b": [0.3949, 0.8085, 0.4719, 0.8283]}, {"w": "context", "b": [0.4782, 0.8085, 0.5525, 0.8283]}, {"w": "of", "b": [0.5588, 0.8085, 0.5798, 0.8283]}, {"w": "machine", "b": [0.5861, 0.8085, 0.6716, 0.8283]}, {"w": "learning", "b": [0.6779, 0.8085, 0.7605, 0.8283]}, {"w": "and", "b": [0.7668, 0.8085, 0.8033, 0.8283]}, {"w": "better", "b": [0.8096, 0.8085, 0.867, 0.8283]}, {"w": "understand", "b": [0.1294, 0.829, 0.2401, 0.8488]}, {"w": "where", "b": [0.2464, 0.829, 0.308, 0.8488]}, {"w": "deep", "b": [0.3143, 0.829, 0.362, 0.8488]}, {"w": "learning", "b": [0.3683, 0.829, 0.4509, 0.8488]}, {"w": "comes", "b": [0.4572, 0.829, 0.5217, 0.8488]}, {"w": "from", "b": [0.528, 0.829, 0.577, 0.8488]}, {"w": "and", "b": [0.5833, 0.829, 0.6198, 0.8488]}, {"w": "why", "b": [0.6261, 0.829, 0.6695, 0.8488]}, {"w": "it", "b": [0.6758, 0.829, 0.6899, 0.8488]}, {"w": "matters.", "b": [0.6962, 0.829, 0.7767, 0.8488]}]}, {"id": "b_6", "type": "paragraph", "text": "1.2.1. Probabilistic modeling", "words": [{"w": "1.2.1.", "b": [0.1294, 0.8763, 0.1862, 0.896]}, {"w": "Probabilistic", "b": [0.1925, 0.8763, 0.3294, 0.896]}, {"w": "modeling", "b": [0.3357, 0.8763, 0.4352, 0.896]}]}]}, {"page": 44, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Probabilistic modeling is the application of the principles of statistics to data analysis. It was one of the earliest forms of machine learning, and it’s still widely used to this day. One of the best-known algorithms in this category is the Naive Bayes algorithm.", "words": [{"w": "Probabilistic", "b": [0.1294, 0.0857, 0.2602, 0.1054]}, {"w": "modeling", "b": [0.2665, 0.0857, 0.3604, 0.1054]}, {"w": "is", "b": [0.3667, 0.0857, 0.3835, 0.1054]}, {"w": "the", "b": [0.3898, 0.0857, 0.4206, 0.1054]}, {"w": "application", "b": [0.427, 0.0857, 0.5391, 0.1054]}, {"w": "of", "b": [0.5454, 0.0857, 0.5664, 0.1054]}, {"w": "the", "b": [0.5727, 0.0857, 0.6035, 0.1054]}, {"w": "principles", "b": [0.6098, 0.0857, 0.7093, 0.1054]}, {"w": "of", "b": [0.7156, 0.0857, 0.7366, 0.1054]}, {"w": "statistics", "b": [0.7429, 0.0857, 0.8298, 0.1054]}, {"w": "to", "b": [0.8361, 0.0857, 0.8558, 0.1054]}, {"w": "data", "b": [0.1294, 0.1062, 0.1714, 0.1259]}, {"w": "analysis.", "b": [0.1777, 0.1062, 0.2653, 0.1259]}, {"w": "It", "b": [0.2716, 0.1062, 0.287, 0.1259]}, {"w": "was", "b": [0.2934, 0.1062, 0.3326, 0.1259]}, {"w": "one", "b": [0.3389, 0.1062, 0.3753, 0.1259]}, {"w": "of", "b": [0.3816, 0.1062, 0.4026, 0.1259]}, {"w": "the", "b": [0.4089, 0.1062, 0.4398, 0.1259]}, {"w": "earliest", "b": [0.4461, 0.1062, 0.5189, 0.1259]}, {"w": "forms", "b": [0.5252, 0.1062, 0.5841, 0.1259]}, {"w": "of", "b": [0.5904, 0.1062, 0.6114, 0.1259]}, {"w": "machine", "b": [0.6177, 0.1062, 0.7032, 0.1259]}, {"w": "learning,", "b": [0.7095, 0.1062, 0.7984, 0.1259]}, {"w": "and", "b": [0.8047, 0.1062, 0.8411, 0.1259]}, {"w": "it’s", "b": [0.1294, 0.1267, 0.1603, 0.1464]}, {"w": "still", "b": [0.1666, 0.1267, 0.2044, 0.1464]}, {"w": "widely", "b": [0.2107, 0.1267, 0.2794, 0.1464]}, {"w": "used", "b": [0.2857, 0.1267, 0.3319, 0.1464]}, {"w": "to", "b": [0.3382, 0.1267, 0.3579, 0.1464]}, {"w": "this", "b": [0.3642, 0.1267, 0.4006, 0.1464]}, {"w": "day.", "b": [0.4069, 0.1267, 0.448, 0.1464]}, {"w": "One", "b": [0.4543, 0.1267, 0.4963, 0.1464]}, {"w": "of", "b": [0.5026, 0.1267, 0.5237, 0.1464]}, {"w": "the", "b": [0.53, 0.1267, 0.5608, 0.1464]}, {"w": "best-known", "b": [0.5671, 0.1267, 0.6848, 0.1464]}, {"w": "algorithms", "b": [0.6911, 0.1267, 0.799, 0.1464]}, {"w": "in", "b": [0.8053, 0.1267, 0.8249, 0.1464]}, {"w": "this", "b": [0.8313, 0.1267, 0.8677, 0.1464]}, {"w": "category", "b": [0.1294, 0.1472, 0.2163, 0.1669]}, {"w": "is", "b": [0.2226, 0.1472, 0.2394, 0.1669]}, {"w": "the", "b": [0.2457, 0.1472, 0.2765, 0.1669]}, {"w": "Naive", "b": [0.2828, 0.1472, 0.3431, 0.1669]}, {"w": "Bayes", "b": [0.3494, 0.1472, 0.411, 0.1669]}, {"w": "algorithm.", "b": [0.4173, 0.1472, 0.5217, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Naive Bayes is a type of machine-learning classifier based on applying Bayes’ theorem while assuming that the features in the input data are all independent (a strong, or “naive” assumption, which is where the name comes from). This form of data analy-sis predates computers and was applied by hand decades before its first computer implementation (most likely dating back to the 1950s). Bayes’ theorem and the foundations of statistics date back to the eighteenth century, and these are all you need to start using Naive Bayes classifiers.", "words": [{"w": "Naive", "b": [0.1294, 0.19, 0.1897, 0.2097]}, {"w": "Bayes", "b": [0.196, 0.19, 0.2576, 0.2097]}, {"w": "is", "b": [0.2639, 0.19, 0.2807, 0.2097]}, {"w": "a", "b": [0.287, 0.19, 0.2982, 0.2097]}, {"w": "type", "b": [0.3046, 0.19, 0.348, 0.2097]}, {"w": "of", "b": [0.3543, 0.19, 0.3753, 0.2097]}, {"w": "machine-learning", "b": [0.3816, 0.19, 0.5581, 0.2097]}, {"w": "classifier", "b": [0.5645, 0.19, 0.6555, 0.2097]}, {"w": "based", "b": [0.6618, 0.19, 0.7193, 0.2097]}, {"w": "on", "b": [0.7256, 0.19, 0.7508, 0.2097]}, {"w": "applying", "b": [0.7571, 0.19, 0.8454, 0.2097]}, {"w": "Bayes’", "b": [0.1294, 0.2105, 0.1995, 0.2302]}, {"w": "theorem", "b": [0.2058, 0.2105, 0.2884, 0.2302]}, {"w": "while", "b": [0.2947, 0.2105, 0.3508, 0.2302]}, {"w": "assuming", "b": [0.3571, 0.2105, 0.4524, 0.2302]}, {"w": "that", "b": [0.4587, 0.2105, 0.4965, 0.2302]}, {"w": "the", "b": [0.5029, 0.2105, 0.5337, 0.2302]}, {"w": "features", "b": [0.54, 0.2105, 0.6198, 0.2302]}, {"w": "in", "b": [0.6261, 0.2105, 0.6458, 0.2302]}, {"w": "the", "b": [0.652, 0.2105, 0.6828, 0.2302]}, {"w": "input", "b": [0.6891, 0.2105, 0.741, 0.2302]}, {"w": "data", "b": [0.7473, 0.2105, 0.7893, 0.2302]}, {"w": "are", "b": [0.7956, 0.2105, 0.8264, 0.2302]}, {"w": "all", "b": [0.8327, 0.2105, 0.8579, 0.2302]}, {"w": "independent", "b": [0.1294, 0.231, 0.2527, 0.2507]}, {"w": "(a", "b": [0.259, 0.231, 0.2786, 0.2507]}, {"w": "strong,", "b": [0.2849, 0.231, 0.3543, 0.2507]}, {"w": "or", "b": [0.3606, 0.231, 0.3816, 0.2507]}, {"w": "“naive”", "b": [0.3879, 0.231, 0.465, 0.2507]}, {"w": "assumption,", "b": [0.4713, 0.231, 0.5925, 0.2507]}, {"w": "which", "b": [0.5988, 0.231, 0.6605, 0.2507]}, {"w": "is", "b": [0.6668, 0.231, 0.6836, 0.2507]}, {"w": "where", "b": [0.6899, 0.231, 0.7515, 0.2507]}, {"w": "the", "b": [0.7578, 0.231, 0.7887, 0.2507]}, {"w": "name", "b": [0.795, 0.231, 0.8496, 0.2507]}, {"w": "comes", "b": [0.1294, 0.2515, 0.1939, 0.2712]}, {"w": "from).", "b": [0.2002, 0.2515, 0.2639, 0.2712]}, {"w": "This", "b": [0.2702, 0.2515, 0.3151, 0.2712]}, {"w": "form", "b": [0.3214, 0.2515, 0.3704, 0.2712]}, {"w": "of", "b": [0.3767, 0.2515, 0.3977, 0.2712]}, {"w": "data", "b": [0.404, 0.2515, 0.4461, 0.2712]}, {"w": "analy-sis", "b": [0.4523, 0.2515, 0.542, 0.2712]}, {"w": "predates", "b": [0.5483, 0.2515, 0.6324, 0.2712]}, {"w": "computers", "b": [0.6387, 0.2515, 0.7438, 0.2712]}, {"w": "and", "b": [0.7501, 0.2515, 0.7865, 0.2712]}, {"w": "was", "b": [0.7928, 0.2515, 0.832, 0.2712]}, {"w": "applied", "b": [0.1294, 0.272, 0.2037, 0.2917]}, {"w": "by", "b": [0.21, 0.272, 0.2352, 0.2917]}, {"w": "hand", "b": [0.2415, 0.272, 0.2906, 0.2917]}, {"w": "decades", "b": [0.2969, 0.272, 0.3767, 0.2917]}, {"w": "before", "b": [0.383, 0.272, 0.4474, 0.2917]}, {"w": "its", "b": [0.4537, 0.272, 0.4776, 0.2917]}, {"w": "first", "b": [0.4839, 0.272, 0.5245, 0.2917]}, {"w": "computer", "b": [0.5308, 0.272, 0.6261, 0.2917]}, {"w": "implementation", "b": [0.6324, 0.272, 0.7908, 0.2917]}, {"w": "(most", "b": [0.7971, 0.272, 0.8546, 0.2917]}, {"w": "likely", "b": [0.1294, 0.2925, 0.1869, 0.3122]}, {"w": "dating", "b": [0.1932, 0.2925, 0.2562, 0.3122]}, {"w": "back", "b": [0.2625, 0.2925, 0.3101, 0.3122]}, {"w": "to", "b": [0.3165, 0.2925, 0.3361, 0.3122]}, {"w": "the", "b": [0.3424, 0.2925, 0.3732, 0.3122]}, {"w": "1950s).", "b": [0.3795, 0.2925, 0.4545, 0.3122]}, {"w": "Bayes’", "b": [0.4608, 0.2925, 0.5308, 0.3122]}, {"w": "theorem", "b": [0.5372, 0.2925, 0.6198, 0.3122]}, {"w": "and", "b": [0.6261, 0.2925, 0.6625, 0.3122]}, {"w": "the", "b": [0.6689, 0.2925, 0.6997, 0.3122]}, {"w": "foundations", "b": [0.706, 0.2925, 0.8251, 0.3122]}, {"w": "of", "b": [0.8314, 0.2925, 0.8524, 0.3122]}, {"w": "statistics", "b": [0.1294, 0.313, 0.2163, 0.3327]}, {"w": "date", "b": [0.2226, 0.313, 0.2646, 0.3327]}, {"w": "back", "b": [0.271, 0.313, 0.3186, 0.3327]}, {"w": "to", "b": [0.3249, 0.313, 0.3445, 0.3327]}, {"w": "the", "b": [0.3508, 0.313, 0.3816, 0.3327]}, {"w": "eighteenth", "b": [0.388, 0.313, 0.493, 0.3327]}, {"w": "century,", "b": [0.4993, 0.313, 0.5796, 0.3327]}, {"w": "and", "b": [0.5859, 0.313, 0.6223, 0.3327]}, {"w": "these", "b": [0.6286, 0.313, 0.6805, 0.3327]}, {"w": "are", "b": [0.6868, 0.313, 0.7176, 0.3327]}, {"w": "all", "b": [0.7239, 0.313, 0.7491, 0.3327]}, {"w": "you", "b": [0.7554, 0.313, 0.7932, 0.3327]}, {"w": "need", "b": [0.7995, 0.313, 0.8471, 0.3327]}, {"w": "to", "b": [0.1294, 0.3335, 0.149, 0.3532]}, {"w": "start", "b": [0.1553, 0.3335, 0.1988, 0.3532]}, {"w": "using", "b": [0.2051, 0.3335, 0.2598, 0.3532]}, {"w": "Naive", "b": [0.2661, 0.3335, 0.3263, 0.3532]}, {"w": "Bayes", "b": [0.3326, 0.3335, 0.3943, 0.3532]}, {"w": "classifiers.", "b": [0.4006, 0.3335, 0.5077, 0.3532]}]}, {"id": "b_2", "type": "paragraph", "text": "A closely related model is the logistic regression (logreg for short), which is sometimes considered to be the “hello world” of modern machine learning. Don’t be misled by its name—logreg is a classification algorithm rather than a regression algorithm. Much like Naive Bayes, logreg predates computing by a long time, yet it’s still useful to this day, thanks to its simple and versatile nature. It’s often the first thing a data scientist will try on a dataset to get a feel for the classification task at hand.", "words": [{"w": "A", "b": [0.1294, 0.3762, 0.1476, 0.396]}, {"w": "closely", "b": [0.1539, 0.3762, 0.2254, 0.396]}, {"w": "related", "b": [0.2317, 0.3762, 0.3003, 0.396]}, {"w": "model", "b": [0.3066, 0.3762, 0.3697, 0.396]}, {"w": "is", "b": [0.376, 0.3762, 0.3928, 0.396]}, {"w": "the", "b": [0.3992, 0.3762, 0.43, 0.396]}, {"w": "logistic", "b": [0.4362, 0.3762, 0.5105, 0.396]}, {"w": "regression", "b": [0.5168, 0.3762, 0.6214, 0.396]}, {"w": "(logreg", "b": [0.6277, 0.3762, 0.7006, 0.396]}, {"w": "for", "b": [0.7069, 0.3762, 0.7363, 0.396]}, {"w": "short),", "b": [0.7426, 0.3762, 0.8078, 0.396]}, {"w": "which", "b": [0.1294, 0.3967, 0.1911, 0.4165]}, {"w": "is", "b": [0.1974, 0.3967, 0.2142, 0.4165]}, {"w": "sometimes", "b": [0.2205, 0.3967, 0.3284, 0.4165]}, {"w": "considered", "b": [0.3347, 0.3967, 0.444, 0.4165]}, {"w": "to", "b": [0.4503, 0.3967, 0.4699, 0.4165]}, {"w": "be", "b": [0.4762, 0.3967, 0.5001, 0.4165]}, {"w": "the", "b": [0.5064, 0.3967, 0.5372, 0.4165]}, {"w": "“hello", "b": [0.5435, 0.3967, 0.6051, 0.4165]}, {"w": "world”", "b": [0.6115, 0.3967, 0.6815, 0.4165]}, {"w": "of", "b": [0.6878, 0.3967, 0.7088, 0.4165]}, {"w": "modern", "b": [0.7151, 0.3967, 0.7922, 0.4165]}, {"w": "machine", "b": [0.1294, 0.4172, 0.2149, 0.437]}, {"w": "learning.", "b": [0.2212, 0.4172, 0.3102, 0.437]}, {"w": "Don’t", "b": [0.3165, 0.4172, 0.3748, 0.437]}, {"w": "be", "b": [0.3811, 0.4172, 0.4049, 0.437]}, {"w": "misled", "b": [0.4113, 0.4172, 0.4785, 0.437]}, {"w": "by", "b": [0.4848, 0.4172, 0.5101, 0.437]}, {"w": "its", "b": [0.5163, 0.4172, 0.5402, 0.437]}, {"w": "name—logreg", "b": [0.5465, 0.4172, 0.6908, 0.437]}, {"w": "is", "b": [0.6971, 0.4172, 0.7139, 0.437]}, {"w": "a", "b": [0.7202, 0.4172, 0.7314, 0.437]}, {"w": "classification", "b": [0.1294, 0.4377, 0.2625, 0.4575]}, {"w": "algorithm", "b": [0.2688, 0.4377, 0.3669, 0.4575]}, {"w": "rather", "b": [0.3732, 0.4377, 0.4321, 0.4575]}, {"w": "than", "b": [0.4384, 0.4377, 0.4818, 0.4575]}, {"w": "a", "b": [0.4881, 0.4377, 0.4993, 0.4575]}, {"w": "regression", "b": [0.5056, 0.4377, 0.6093, 0.4575]}, {"w": "algorithm.", "b": [0.6156, 0.4377, 0.72, 0.4575]}, {"w": "Much", "b": [0.7263, 0.4377, 0.7852, 0.4575]}, {"w": "like", "b": [0.7915, 0.4377, 0.8293, 0.4575]}, {"w": "Naive", "b": [0.1294, 0.4582, 0.1897, 0.478]}, {"w": "Bayes,", "b": [0.196, 0.4582, 0.2639, 0.478]}, {"w": "logreg", "b": [0.2702, 0.4582, 0.3347, 0.478]}, {"w": "predates", "b": [0.341, 0.4582, 0.425, 0.478]}, {"w": "computing", "b": [0.4313, 0.4582, 0.5393, 0.478]}, {"w": "by", "b": [0.5455, 0.4582, 0.5707, 0.478]}, {"w": "a", "b": [0.577, 0.4582, 0.5882, 0.478]}, {"w": "long", "b": [0.5945, 0.4582, 0.6394, 0.478]}, {"w": "time,", "b": [0.6457, 0.4582, 0.6969, 0.478]}, {"w": "yet", "b": [0.7032, 0.4582, 0.734, 0.478]}, {"w": "it’s", "b": [0.7403, 0.4582, 0.7711, 0.478]}, {"w": "still", "b": [0.7774, 0.4582, 0.8153, 0.478]}, {"w": "useful", "b": [0.1294, 0.4787, 0.1911, 0.4985]}, {"w": "to", "b": [0.1974, 0.4787, 0.217, 0.4985]}, {"w": "this", "b": [0.2233, 0.4787, 0.2598, 0.4985]}, {"w": "day,", "b": [0.2661, 0.4787, 0.3071, 0.4985]}, {"w": "thanks", "b": [0.3134, 0.4787, 0.3793, 0.4985]}, {"w": "to", "b": [0.3856, 0.4787, 0.4052, 0.4985]}, {"w": "its", "b": [0.4115, 0.4787, 0.4354, 0.4985]}, {"w": "simple", "b": [0.4417, 0.4787, 0.509, 0.4985]}, {"w": "and", "b": [0.5153, 0.4787, 0.5517, 0.4985]}, {"w": "versatile", "b": [0.558, 0.4787, 0.6435, 0.4985]}, {"w": "nature.", "b": [0.6498, 0.4787, 0.7191, 0.4985]}, {"w": "It’s", "b": [0.7254, 0.4787, 0.7576, 0.4985]}, {"w": "often", "b": [0.7639, 0.4787, 0.8157, 0.4985]}, {"w": "the", "b": [0.8221, 0.4787, 0.8529, 0.4985]}, {"w": "first", "b": [0.1294, 0.4992, 0.1701, 0.519]}, {"w": "thing", "b": [0.1764, 0.4992, 0.2282, 0.519]}, {"w": "a", "b": [0.2345, 0.4992, 0.2457, 0.519]}, {"w": "data", "b": [0.252, 0.4992, 0.294, 0.519]}, {"w": "scientist", "b": [0.3003, 0.4992, 0.383, 0.519]}, {"w": "will", "b": [0.3893, 0.4992, 0.4286, 0.519]}, {"w": "try", "b": [0.4349, 0.4992, 0.4629, 0.519]}, {"w": "on", "b": [0.4692, 0.4992, 0.4945, 0.519]}, {"w": "a", "b": [0.5008, 0.4992, 0.512, 0.519]}, {"w": "dataset", "b": [0.5183, 0.4992, 0.5883, 0.519]}, {"w": "to", "b": [0.5946, 0.4992, 0.6143, 0.519]}, {"w": "get", "b": [0.6206, 0.4992, 0.6514, 0.519]}, {"w": "a", "b": [0.6577, 0.4992, 0.6689, 0.519]}, {"w": "feel", "b": [0.6752, 0.4992, 0.713, 0.519]}, {"w": "for", "b": [0.7193, 0.4992, 0.7487, 0.519]}, {"w": "the", "b": [0.755, 0.4992, 0.7859, 0.519]}, {"w": "classification", "b": [0.1294, 0.5197, 0.2625, 0.5395]}, {"w": "task", "b": [0.2688, 0.5197, 0.3095, 0.5395]}, {"w": "at", "b": [0.3158, 0.5197, 0.334, 0.5395]}, {"w": "hand.", "b": [0.3403, 0.5197, 0.3956, 0.5395]}]}, {"id": "b_3", "type": "paragraph", "text": "1.2.2. Early neural networks", "words": [{"w": "1.2.2.", "b": [0.1294, 0.567, 0.1862, 0.5867]}, {"w": "Early", "b": [0.1925, 0.567, 0.2527, 0.5867]}, {"w": "neural", "b": [0.259, 0.567, 0.3291, 0.5867]}, {"w": "networks", "b": [0.3354, 0.567, 0.4349, 0.5867]}]}, {"id": "b_4", "type": "paragraph", "text": "Early iterations of neural networks have been completely supplanted by the modern variants covered in these pages, but it’s helpful to be aware of how deep learning originated. Although the core ideas of neural networks were investigated in toy forms as early as the 1950s, the approach took decades to get started. For a long time, the missing piece was an efficient way to train large neural networks. This changed in the mid-1980s, when multiple people independently rediscovered the Backpropagation algorithm—a way to train chains of parametric operations using gradient-descent optimization (later in the book, we’ll precisely define these concepts)—and started applying it to neural networks.", "words": [{"w": "Early", "b": [0.1294, 0.6098, 0.1841, 0.6295]}, {"w": "iterations", "b": [0.1904, 0.6098, 0.2842, 0.6295]}, {"w": "of", "b": [0.2906, 0.6098, 0.3116, 0.6295]}, {"w": "neural", "b": [0.3179, 0.6098, 0.3809, 0.6295]}, {"w": "networks", "b": [0.3872, 0.6098, 0.4797, 0.6295]}, {"w": "have", "b": [0.486, 0.6098, 0.5336, 0.6295]}, {"w": "been", "b": [0.5399, 0.6098, 0.5876, 0.6295]}, {"w": "completely", "b": [0.5939, 0.6098, 0.706, 0.6295]}, {"w": "supplanted", "b": [0.7123, 0.6098, 0.8216, 0.6295]}, {"w": "by", "b": [0.8279, 0.6098, 0.8531, 0.6295]}, {"w": "the", "b": [0.1294, 0.6303, 0.1602, 0.65]}, {"w": "modern", "b": [0.1665, 0.6303, 0.2436, 0.65]}, {"w": "variants", "b": [0.2499, 0.6303, 0.3298, 0.65]}, {"w": "covered", "b": [0.3361, 0.6303, 0.4159, 0.65]}, {"w": "in", "b": [0.4222, 0.6303, 0.4419, 0.65]}, {"w": "these", "b": [0.4482, 0.6303, 0.5, 0.65]}, {"w": "pages,", "b": [0.5063, 0.6303, 0.5701, 0.65]}, {"w": "but", "b": [0.5764, 0.6303, 0.6086, 0.65]}, {"w": "it’s", "b": [0.6149, 0.6303, 0.6457, 0.65]}, {"w": "helpful", "b": [0.652, 0.6303, 0.7234, 0.65]}, {"w": "to", "b": [0.7298, 0.6303, 0.7494, 0.65]}, {"w": "be", "b": [0.7557, 0.6303, 0.7795, 0.65]}, {"w": "aware", "b": [0.7858, 0.6303, 0.846, 0.65]}, {"w": "of", "b": [0.1294, 0.6508, 0.1504, 0.6705]}, {"w": "how", "b": [0.1567, 0.6508, 0.2002, 0.6705]}, {"w": "deep", "b": [0.2065, 0.6508, 0.2541, 0.6705]}, {"w": "learning", "b": [0.2604, 0.6508, 0.3431, 0.6705]}, {"w": "originated.", "b": [0.3494, 0.6508, 0.458, 0.6705]}, {"w": "Although", "b": [0.4643, 0.6508, 0.5596, 0.6705]}, {"w": "the", "b": [0.5659, 0.6508, 0.5967, 0.6705]}, {"w": "core", "b": [0.603, 0.6508, 0.6464, 0.6705]}, {"w": "ideas", "b": [0.6527, 0.6508, 0.7046, 0.6705]}, {"w": "of", "b": [0.7109, 0.6508, 0.7319, 0.6705]}, {"w": "neural", "b": [0.7382, 0.6508, 0.8012, 0.6705]}, {"w": "networks", "b": [0.1294, 0.6713, 0.2219, 0.691]}, {"w": "were", "b": [0.2282, 0.6713, 0.2772, 0.691]}, {"w": "investigated", "b": [0.2835, 0.6713, 0.4054, 0.691]}, {"w": "in", "b": [0.4117, 0.6713, 0.4314, 0.691]}, {"w": "toy", "b": [0.4377, 0.6713, 0.4699, 0.691]}, {"w": "forms", "b": [0.4762, 0.6713, 0.5351, 0.691]}, {"w": "as", "b": [0.5413, 0.6713, 0.5623, 0.691]}, {"w": "early", "b": [0.5686, 0.6713, 0.6191, 0.691]}, {"w": "as", "b": [0.6254, 0.6713, 0.6464, 0.691]}, {"w": "the", "b": [0.6527, 0.6713, 0.6835, 0.691]}, {"w": "1950s,", "b": [0.6898, 0.6713, 0.7564, 0.691]}, {"w": "the", "b": [0.7627, 0.6713, 0.7935, 0.691]}, {"w": "approach", "b": [0.1294, 0.6918, 0.2219, 0.7115]}, {"w": "took", "b": [0.2282, 0.6918, 0.273, 0.7115]}, {"w": "decades", "b": [0.2793, 0.6918, 0.3592, 0.7115]}, {"w": "to", "b": [0.3655, 0.6918, 0.3851, 0.7115]}, {"w": "get", "b": [0.3914, 0.6918, 0.4222, 0.7115]}, {"w": "started.", "b": [0.4285, 0.6918, 0.5021, 0.7115]}, {"w": "For", "b": [0.5084, 0.6918, 0.5434, 0.7115]}, {"w": "a", "b": [0.5497, 0.6918, 0.5609, 0.7115]}, {"w": "long", "b": [0.5673, 0.6918, 0.6121, 0.7115]}, {"w": "time,", "b": [0.6184, 0.6918, 0.6696, 0.7115]}, {"w": "the", "b": [0.6759, 0.6918, 0.7067, 0.7115]}, {"w": "missing", "b": [0.713, 0.6918, 0.7915, 0.7115]}, {"w": "piece", "b": [0.7978, 0.6918, 0.851, 0.7115]}, {"w": "was", "b": [0.1294, 0.7123, 0.1686, 0.732]}, {"w": "an", "b": [0.1749, 0.7123, 0.1988, 0.732]}, {"w": "efficient", "b": [0.2051, 0.7123, 0.2887, 0.732]}, {"w": "way", "b": [0.295, 0.7123, 0.337, 0.732]}, {"w": "to", "b": [0.3433, 0.7123, 0.3629, 0.732]}, {"w": "train", "b": [0.3692, 0.7123, 0.4154, 0.732]}, {"w": "large", "b": [0.4217, 0.7123, 0.4717, 0.732]}, {"w": "neural", "b": [0.478, 0.7123, 0.541, 0.732]}, {"w": "networks.", "b": [0.5473, 0.7123, 0.6461, 0.732]}, {"w": "This", "b": [0.6524, 0.7123, 0.6973, 0.732]}, {"w": "changed", "b": [0.7036, 0.7123, 0.7876, 0.732]}, {"w": "in", "b": [0.7939, 0.7123, 0.8136, 0.732]}, {"w": "the", "b": [0.8199, 0.7123, 0.8507, 0.732]}, {"w": "mid-1980s,", "b": [0.1294, 0.7328, 0.2436, 0.7525]}, {"w": "when", "b": [0.2499, 0.7328, 0.3046, 0.7525]}, {"w": "multiple", "b": [0.3109, 0.7328, 0.395, 0.7525]}, {"w": "people", "b": [0.4013, 0.7328, 0.4685, 0.7525]}, {"w": "independently", "b": [0.4748, 0.7328, 0.6178, 0.7525]}, {"w": "rediscovered", "b": [0.6241, 0.7328, 0.753, 0.7525]}, {"w": "the", "b": [0.7593, 0.7328, 0.7901, 0.7525]}, {"w": "Backpropagation", "b": [0.1294, 0.7533, 0.3018, 0.773]}, {"w": "algorithm—a", "b": [0.3081, 0.7533, 0.4426, 0.773]}, {"w": "way", "b": [0.4489, 0.7533, 0.4909, 0.773]}, {"w": "to", "b": [0.4972, 0.7533, 0.5169, 0.773]}, {"w": "train", "b": [0.5232, 0.7533, 0.5694, 0.773]}, {"w": "chains", "b": [0.5757, 0.7533, 0.6402, 0.773]}, {"w": "of", "b": [0.6465, 0.7533, 0.6675, 0.773]}, {"w": "parametric", "b": [0.6738, 0.7533, 0.7816, 0.773]}, {"w": "operations", "b": [0.1294, 0.7738, 0.2345, 0.7935]}, {"w": "using", "b": [0.2408, 0.7738, 0.2954, 0.7935]}, {"w": "gradient-descent", "b": [0.3018, 0.7738, 0.4685, 0.7935]}, {"w": "optimization", "b": [0.4748, 0.7738, 0.6023, 0.7935]}, {"w": "(later", "b": [0.6086, 0.7738, 0.6618, 0.7935]}, {"w": "in", "b": [0.6682, 0.7738, 0.6878, 0.7935]}, {"w": "the", "b": [0.6941, 0.7738, 0.7249, 0.7935]}, {"w": "book,", "b": [0.7312, 0.7738, 0.788, 0.7935]}, {"w": "we’ll", "b": [0.7943, 0.7738, 0.8461, 0.7935]}, {"w": "precisely", "b": [0.1294, 0.7943, 0.2205, 0.814]}, {"w": "define", "b": [0.2268, 0.7943, 0.2898, 0.814]}, {"w": "these", "b": [0.2961, 0.7943, 0.348, 0.814]}, {"w": "concepts)—and", "b": [0.3543, 0.7943, 0.5126, 0.814]}, {"w": "started", "b": [0.5189, 0.7943, 0.5861, 0.814]}, {"w": "applying", "b": [0.5925, 0.7943, 0.6807, 0.814]}, {"w": "it", "b": [0.6871, 0.7943, 0.7011, 0.814]}, {"w": "to", "b": [0.7074, 0.7943, 0.727, 0.814]}, {"w": "neural", "b": [0.7332, 0.7943, 0.7963, 0.814]}, {"w": "networks.", "b": [0.1294, 0.8148, 0.2282, 0.8345]}]}, {"id": "b_5", "type": "paragraph", "text": "The first successful practical application of neural nets came in 1989 from Bell Labs, when Yann LeCun combined the earlier ideas of", "words": [{"w": "The", "b": [0.1294, 0.8576, 0.1686, 0.8773]}, {"w": "first", "b": [0.1749, 0.8576, 0.2156, 0.8773]}, {"w": "successful", "b": [0.2219, 0.8576, 0.3256, 0.8773]}, {"w": "practical", "b": [0.3319, 0.8576, 0.4187, 0.8773]}, {"w": "application", "b": [0.425, 0.8576, 0.5371, 0.8773]}, {"w": "of", "b": [0.5434, 0.8576, 0.5645, 0.8773]}, {"w": "neural", "b": [0.5708, 0.8576, 0.6338, 0.8773]}, {"w": "nets", "b": [0.6401, 0.8576, 0.6807, 0.8773]}, {"w": "came", "b": [0.6871, 0.8576, 0.7403, 0.8773]}, {"w": "in", "b": [0.7466, 0.8576, 0.7662, 0.8773]}, {"w": "1989", "b": [0.7725, 0.8576, 0.823, 0.8773]}, {"w": "from", "b": [0.1294, 0.8781, 0.1785, 0.8978]}, {"w": "Bell", "b": [0.1848, 0.8781, 0.2268, 0.8978]}, {"w": "Labs,", "b": [0.2331, 0.8781, 0.2885, 0.8978]}, {"w": "when", "b": [0.2948, 0.8781, 0.3494, 0.8978]}, {"w": "Yann", "b": [0.3557, 0.8781, 0.4078, 0.8978]}, {"w": "LeCun", "b": [0.4141, 0.8781, 0.4828, 0.8978]}, {"w": "combined", "b": [0.4891, 0.8781, 0.5886, 0.8978]}, {"w": "the", "b": [0.5949, 0.8781, 0.6257, 0.8978]}, {"w": "earlier", "b": [0.632, 0.8781, 0.6964, 0.8978]}, {"w": "ideas", "b": [0.7027, 0.8781, 0.7545, 0.8978]}, {"w": "of", "b": [0.7608, 0.8781, 0.7818, 0.8978]}]}]}, {"page": 45, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "convolutional neural networks and backpropagation, and applied them to the problem of classifying handwritten digits. The resulting network, dubbed LeNet, was used by the United States Postal Service in the 1990s to automate the reading of ZIP codes on mail envelopes.", "words": [{"w": "convolutional", "b": [0.1294, 0.0857, 0.2682, 0.1054]}, {"w": "neural", "b": [0.2745, 0.0857, 0.3375, 0.1054]}, {"w": "networks", "b": [0.3438, 0.0857, 0.4363, 0.1054]}, {"w": "and", "b": [0.4426, 0.0857, 0.479, 0.1054]}, {"w": "backpropagation,", "b": [0.4853, 0.0857, 0.6598, 0.1054]}, {"w": "and", "b": [0.6661, 0.0857, 0.7025, 0.1054]}, {"w": "applied", "b": [0.7088, 0.0857, 0.7831, 0.1054]}, {"w": "them", "b": [0.7894, 0.0857, 0.8398, 0.1054]}, {"w": "to", "b": [0.8461, 0.0857, 0.8658, 0.1054]}, {"w": "the", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "problem", "b": [0.1665, 0.1062, 0.2506, 0.1259]}, {"w": "of", "b": [0.2569, 0.1062, 0.2779, 0.1259]}, {"w": "classifying", "b": [0.2842, 0.1062, 0.3936, 0.1259]}, {"w": "handwritten", "b": [0.3999, 0.1062, 0.5204, 0.1259]}, {"w": "digits.", "b": [0.5267, 0.1062, 0.5891, 0.1259]}, {"w": "The", "b": [0.5953, 0.1062, 0.6345, 0.1259]}, {"w": "resulting", "b": [0.6408, 0.1062, 0.7291, 0.1259]}, {"w": "network,", "b": [0.7354, 0.1062, 0.8244, 0.1259]}, {"w": "dubbed", "b": [0.1294, 0.1267, 0.2037, 0.1464]}, {"w": "LeNet,", "b": [0.21, 0.1267, 0.2765, 0.1464]}, {"w": "was", "b": [0.2828, 0.1267, 0.3221, 0.1464]}, {"w": "used", "b": [0.3284, 0.1267, 0.3746, 0.1464]}, {"w": "by", "b": [0.3809, 0.1267, 0.4061, 0.1464]}, {"w": "the", "b": [0.4124, 0.1267, 0.4433, 0.1464]}, {"w": "United", "b": [0.4496, 0.1267, 0.5182, 0.1464]}, {"w": "States", "b": [0.5245, 0.1267, 0.5848, 0.1464]}, {"w": "Postal", "b": [0.5911, 0.1267, 0.6528, 0.1464]}, {"w": "Service", "b": [0.6591, 0.1267, 0.7348, 0.1464]}, {"w": "in", "b": [0.7411, 0.1267, 0.7607, 0.1464]}, {"w": "the", "b": [0.767, 0.1267, 0.7978, 0.1464]}, {"w": "1990s", "b": [0.8041, 0.1267, 0.8644, 0.1464]}, {"w": "to", "b": [0.1294, 0.1472, 0.149, 0.1669]}, {"w": "automate", "b": [0.1553, 0.1472, 0.2478, 0.1669]}, {"w": "the", "b": [0.2541, 0.1472, 0.285, 0.1669]}, {"w": "reading", "b": [0.2913, 0.1472, 0.3669, 0.1669]}, {"w": "of", "b": [0.3732, 0.1472, 0.3942, 0.1669]}, {"w": "ZIP", "b": [0.4005, 0.1472, 0.4384, 0.1669]}, {"w": "codes", "b": [0.4447, 0.1472, 0.5021, 0.1669]}, {"w": "on", "b": [0.5084, 0.1472, 0.5337, 0.1669]}, {"w": "mail", "b": [0.54, 0.1472, 0.5848, 0.1669]}, {"w": "envelopes.", "b": [0.5911, 0.1472, 0.6983, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "1.2.3. Kernel methods", "words": [{"w": "1.2.3.", "b": [0.1294, 0.1944, 0.1862, 0.2142]}, {"w": "Kernel", "b": [0.1925, 0.1944, 0.2667, 0.2142]}, {"w": "methods", "b": [0.273, 0.1944, 0.3641, 0.2142]}]}, {"id": "b_2", "type": "paragraph", "text": "As neural networks started to gain some respect among researchers in the 1990s, thanks to this first success, a new approach to machine learning rose to fame and quickly sent neural nets back to oblivion: kernel methods. Kernel methods are a group of classification algorithms, the best known of which is the support vector machine (SVM). The modern formulation of an SVM was developed by Vladimir Vapnik and Corinna Cortes in the early 1990s at Bell Labs and published in 1995,[2] although an older linear formulation was published by Vapnik and Alexey Chervonenkis as early as 1963.[3]", "words": [{"w": "As", "b": [0.1294, 0.2372, 0.1574, 0.2569]}, {"w": "neural", "b": [0.1637, 0.2372, 0.2268, 0.2569]}, {"w": "networks", "b": [0.2331, 0.2372, 0.3256, 0.2569]}, {"w": "started", "b": [0.3319, 0.2372, 0.3991, 0.2569]}, {"w": "to", "b": [0.4054, 0.2372, 0.4251, 0.2569]}, {"w": "gain", "b": [0.4314, 0.2372, 0.4748, 0.2569]}, {"w": "some", "b": [0.4811, 0.2372, 0.5344, 0.2569]}, {"w": "respect", "b": [0.5407, 0.2372, 0.6121, 0.2569]}, {"w": "among", "b": [0.6184, 0.2372, 0.6871, 0.2569]}, {"w": "researchers", "b": [0.6934, 0.2372, 0.8068, 0.2569]}, {"w": "in", "b": [0.8131, 0.2372, 0.8328, 0.2569]}, {"w": "the", "b": [0.8391, 0.2372, 0.8699, 0.2569]}, {"w": "1990s,", "b": [0.1294, 0.2577, 0.196, 0.2774]}, {"w": "thanks", "b": [0.2023, 0.2577, 0.2682, 0.2774]}, {"w": "to", "b": [0.2745, 0.2577, 0.2941, 0.2774]}, {"w": "this", "b": [0.3004, 0.2577, 0.3368, 0.2774]}, {"w": "first", "b": [0.3431, 0.2577, 0.3838, 0.2774]}, {"w": "success,", "b": [0.3901, 0.2577, 0.4721, 0.2774]}, {"w": "a", "b": [0.4784, 0.2577, 0.4896, 0.2774]}, {"w": "new", "b": [0.4959, 0.2577, 0.5379, 0.2774]}, {"w": "approach", "b": [0.5442, 0.2577, 0.6367, 0.2774]}, {"w": "to", "b": [0.6429, 0.2577, 0.6625, 0.2774]}, {"w": "machine", "b": [0.6688, 0.2577, 0.7543, 0.2774]}, {"w": "learning", "b": [0.7606, 0.2577, 0.8433, 0.2774]}, {"w": "rose", "b": [0.1294, 0.2782, 0.1714, 0.2979]}, {"w": "to", "b": [0.1777, 0.2782, 0.1974, 0.2979]}, {"w": "fame", "b": [0.2037, 0.2782, 0.2541, 0.2979]}, {"w": "and", "b": [0.2604, 0.2782, 0.2968, 0.2979]}, {"w": "quickly", "b": [0.3031, 0.2782, 0.3788, 0.2979]}, {"w": "sent", "b": [0.3851, 0.2782, 0.4258, 0.2979]}, {"w": "neural", "b": [0.4321, 0.2782, 0.4951, 0.2979]}, {"w": "nets", "b": [0.5014, 0.2782, 0.5421, 0.2979]}, {"w": "back", "b": [0.5484, 0.2782, 0.596, 0.2979]}, {"w": "to", "b": [0.6023, 0.2782, 0.6219, 0.2979]}, {"w": "oblivion:", "b": [0.6282, 0.2782, 0.7193, 0.2979]}, {"w": "kernel", "b": [0.7256, 0.2782, 0.7887, 0.2979]}, {"w": "methods.", "b": [0.1294, 0.2987, 0.2212, 0.3184]}, {"w": "Kernel", "b": [0.2275, 0.2987, 0.2962, 0.3184]}, {"w": "methods", "b": [0.3025, 0.2987, 0.3865, 0.3184]}, {"w": "are", "b": [0.3928, 0.2987, 0.4236, 0.3184]}, {"w": "a", "b": [0.43, 0.2987, 0.4412, 0.3184]}, {"w": "group", "b": [0.4475, 0.2987, 0.5063, 0.3184]}, {"w": "of", "b": [0.5126, 0.2987, 0.5336, 0.3184]}, {"w": "classification", "b": [0.5399, 0.2987, 0.6731, 0.3184]}, {"w": "algorithms,", "b": [0.6794, 0.2987, 0.7936, 0.3184]}, {"w": "the", "b": [0.7999, 0.2987, 0.8307, 0.3184]}, {"w": "best", "b": [0.1294, 0.3192, 0.1701, 0.3389]}, {"w": "known", "b": [0.1764, 0.3192, 0.245, 0.3389]}, {"w": "of", "b": [0.2513, 0.3192, 0.2723, 0.3389]}, {"w": "which", "b": [0.2786, 0.3192, 0.3403, 0.3389]}, {"w": "is", "b": [0.3466, 0.3192, 0.3634, 0.3389]}, {"w": "the", "b": [0.3697, 0.3192, 0.4006, 0.3389]}, {"w": "support", "b": [0.4069, 0.3192, 0.4839, 0.3389]}, {"w": "vector", "b": [0.4903, 0.3192, 0.5533, 0.3389]}, {"w": "machine", "b": [0.5596, 0.3192, 0.6451, 0.3389]}, {"w": "(SVM).", "b": [0.6513, 0.3192, 0.7291, 0.3389]}, {"w": "The", "b": [0.7354, 0.3192, 0.7747, 0.3389]}, {"w": "modern", "b": [0.781, 0.3192, 0.858, 0.3389]}, {"w": "formulation", "b": [0.1294, 0.3397, 0.2485, 0.3594]}, {"w": "of", "b": [0.2548, 0.3397, 0.2758, 0.3594]}, {"w": "an", "b": [0.2822, 0.3397, 0.306, 0.3594]}, {"w": "SVM", "b": [0.3123, 0.3397, 0.3669, 0.3594]}, {"w": "was", "b": [0.3732, 0.3397, 0.4125, 0.3594]}, {"w": "developed", "b": [0.4188, 0.3397, 0.5225, 0.3594]}, {"w": "by", "b": [0.5288, 0.3397, 0.554, 0.3594]}, {"w": "Vladimir", "b": [0.5603, 0.3397, 0.6514, 0.3594]}, {"w": "Vapnik", "b": [0.6577, 0.3397, 0.7291, 0.3594]}, {"w": "and", "b": [0.7354, 0.3397, 0.7719, 0.3594]}, {"w": "Corinna", "b": [0.7782, 0.3397, 0.8594, 0.3594]}, {"w": "Cortes", "b": [0.1294, 0.362, 0.1953, 0.3817]}, {"w": "in", "b": [0.2016, 0.362, 0.2212, 0.3817]}, {"w": "the", "b": [0.2275, 0.362, 0.2583, 0.3817]}, {"w": "early", "b": [0.2646, 0.362, 0.3151, 0.3817]}, {"w": "1990s", "b": [0.3214, 0.362, 0.3816, 0.3817]}, {"w": "at", "b": [0.388, 0.362, 0.4062, 0.3817]}, {"w": "Bell", "b": [0.4125, 0.362, 0.4545, 0.3817]}, {"w": "Labs", "b": [0.4608, 0.362, 0.5099, 0.3817]}, {"w": "and", "b": [0.5161, 0.362, 0.5525, 0.3817]}, {"w": "published", "b": [0.5588, 0.362, 0.657, 0.3817]}, {"w": "in", "b": [0.6633, 0.362, 0.6829, 0.3817]}, {"w": "1995,[2]", "b": [0.6892, 0.3597, 0.768, 0.3817]}, {"w": "although", "b": [0.7743, 0.362, 0.8626, 0.3817]}, {"w": "an", "b": [0.1294, 0.3825, 0.1532, 0.4022]}, {"w": "older", "b": [0.1595, 0.3825, 0.2114, 0.4022]}, {"w": "linear", "b": [0.2177, 0.3825, 0.2751, 0.4022]}, {"w": "formulation", "b": [0.2814, 0.3825, 0.4005, 0.4022]}, {"w": "was", "b": [0.4068, 0.3825, 0.4461, 0.4022]}, {"w": "published", "b": [0.4524, 0.3825, 0.5505, 0.4022]}, {"w": "by", "b": [0.5568, 0.3825, 0.582, 0.4022]}, {"w": "Vapnik", "b": [0.5883, 0.3825, 0.6597, 0.4022]}, {"w": "and", "b": [0.666, 0.3825, 0.7025, 0.4022]}, {"w": "Alexey", "b": [0.7088, 0.3825, 0.7816, 0.4022]}, {"w": "Chervonenkis", "b": [0.1294, 0.4048, 0.2695, 0.4245]}, {"w": "as", "b": [0.2758, 0.4048, 0.2969, 0.4245]}, {"w": "early", "b": [0.3032, 0.4048, 0.3536, 0.4245]}, {"w": "as", "b": [0.3599, 0.4048, 0.3809, 0.4245]}, {"w": "1963.[3]", "b": [0.3872, 0.4025, 0.466, 0.4245]}]}, {"id": "b_4", "type": "paragraph", "text": "Vladimir Vapnik and Corinna Cortes, “Support-Vector Networks,” Machine Learning 20, no. 3 (1995): 273–297.", "words": [{"w": "Vladimir", "b": [0.1483, 0.4702, 0.2166, 0.485]}, {"w": "Vapnik", "b": [0.2214, 0.4702, 0.275, 0.485]}, {"w": "and", "b": [0.2797, 0.4702, 0.307, 0.485]}, {"w": "Corinna", "b": [0.3118, 0.4702, 0.3727, 0.485]}, {"w": "Cortes,", "b": [0.3774, 0.4702, 0.4316, 0.485]}, {"w": "“Support-Vector", "b": [0.4363, 0.4702, 0.5603, 0.485]}, {"w": "Networks,”", "b": [0.565, 0.4702, 0.6517, 0.485]}, {"w": "Machine", "b": [0.6564, 0.4702, 0.7226, 0.485]}, {"w": "Learning", "b": [0.7273, 0.4702, 0.7967, 0.485]}, {"w": "20,", "b": [0.8014, 0.4702, 0.8251, 0.485]}, {"w": "no.", "b": [0.1483, 0.4854, 0.172, 0.5002]}, {"w": "3", "b": [0.1767, 0.4854, 0.1862, 0.5002]}, {"w": "(1995):", "b": [0.1909, 0.4854, 0.2466, 0.5002]}, {"w": "273–297.", "b": [0.2513, 0.4854, 0.3223, 0.5002]}]}, {"id": "b_6", "type": "paragraph", "text": "Vladimir Vapnik and Alexey Chervonenkis, “A Note on One Class of Perceptrons,” Automation and Remote Control 25 (1964).", "words": [{"w": "Vladimir", "b": [0.1483, 0.5415, 0.2166, 0.5564]}, {"w": "Vapnik", "b": [0.2214, 0.5415, 0.275, 0.5564]}, {"w": "and", "b": [0.2797, 0.5415, 0.307, 0.5564]}, {"w": "Alexey", "b": [0.3118, 0.5415, 0.3664, 0.5564]}, {"w": "Chervonenkis,", "b": [0.3711, 0.5415, 0.4809, 0.5564]}, {"w": "“A", "b": [0.4857, 0.5415, 0.5077, 0.5564]}, {"w": "Note", "b": [0.5125, 0.5415, 0.5492, 0.5564]}, {"w": "on", "b": [0.554, 0.5415, 0.5729, 0.5564]}, {"w": "One", "b": [0.5776, 0.5415, 0.6091, 0.5564]}, {"w": "Class", "b": [0.6139, 0.5415, 0.6549, 0.5564]}, {"w": "of", "b": [0.6596, 0.5415, 0.6754, 0.5564]}, {"w": "Perceptrons,”", "b": [0.6801, 0.5415, 0.7825, 0.5564]}, {"w": "Automation", "b": [0.1483, 0.5567, 0.2366, 0.5715]}, {"w": "and", "b": [0.2414, 0.5567, 0.2697, 0.5715]}, {"w": "Remote", "b": [0.2745, 0.5567, 0.3312, 0.5715]}, {"w": "Control", "b": [0.3359, 0.5567, 0.3941, 0.5715]}, {"w": "25", "b": [0.3988, 0.5567, 0.4177, 0.5715]}, {"w": "(1964).", "b": [0.4225, 0.5567, 0.4776, 0.5715]}]}, {"id": "b_7", "type": "paragraph", "text": "SVMs aim at solving classification problems by finding good decision boundaries (see figure 1.10) between two sets of points belonging to two different categories. A decision boundary can be thought of as a line or surface separating your training data into two spaces corresponding to two categories. To classify new data points, you just need to check which side of the decision boundary they fall on.", "words": [{"w": "SVMs", "b": [0.1294, 0.5946, 0.1939, 0.6144]}, {"w": "aim", "b": [0.2002, 0.5946, 0.238, 0.6144]}, {"w": "at", "b": [0.2443, 0.5946, 0.2626, 0.6144]}, {"w": "solving", "b": [0.2689, 0.5946, 0.3431, 0.6144]}, {"w": "classification", "b": [0.3495, 0.5946, 0.4826, 0.6144]}, {"w": "problems", "b": [0.4889, 0.5946, 0.5828, 0.6144]}, {"w": "by", "b": [0.5891, 0.5946, 0.6143, 0.6144]}, {"w": "finding", "b": [0.6206, 0.5946, 0.6935, 0.6144]}, {"w": "good", "b": [0.6998, 0.5946, 0.7502, 0.6144]}, {"w": "decision", "b": [0.7565, 0.5946, 0.8406, 0.6144]}, {"w": "boundaries", "b": [0.1294, 0.6151, 0.2429, 0.6349]}, {"w": "(see", "b": [0.2492, 0.6151, 0.2898, 0.6349]}, {"w": "figure", "b": [0.2961, 0.6151, 0.3564, 0.6349]}, {"w": "1.10)", "b": [0.3627, 0.6151, 0.4152, 0.6349]}, {"w": "between", "b": [0.4215, 0.6151, 0.5056, 0.6349]}, {"w": "two", "b": [0.5119, 0.6151, 0.5497, 0.6349]}, {"w": "sets", "b": [0.556, 0.6151, 0.5939, 0.6349]}, {"w": "of", "b": [0.6002, 0.6151, 0.6212, 0.6349]}, {"w": "points", "b": [0.6275, 0.6151, 0.6892, 0.6349]}, {"w": "belonging", "b": [0.6955, 0.6151, 0.7964, 0.6349]}, {"w": "to", "b": [0.8027, 0.6151, 0.8223, 0.6349]}, {"w": "two", "b": [0.8286, 0.6151, 0.8665, 0.6349]}, {"w": "different", "b": [0.1294, 0.6356, 0.2158, 0.6554]}, {"w": "categories.", "b": [0.2221, 0.6356, 0.3307, 0.6554]}, {"w": "A", "b": [0.337, 0.6356, 0.3552, 0.6554]}, {"w": "decision", "b": [0.3615, 0.6356, 0.4456, 0.6554]}, {"w": "boundary", "b": [0.4519, 0.6356, 0.5472, 0.6554]}, {"w": "can", "b": [0.5535, 0.6356, 0.5885, 0.6554]}, {"w": "be", "b": [0.5948, 0.6356, 0.6186, 0.6554]}, {"w": "thought", "b": [0.6249, 0.6356, 0.702, 0.6554]}, {"w": "of", "b": [0.7083, 0.6356, 0.7293, 0.6554]}, {"w": "as", "b": [0.7356, 0.6356, 0.7566, 0.6554]}, {"w": "a", "b": [0.763, 0.6356, 0.7742, 0.6554]}, {"w": "line", "b": [0.7805, 0.6356, 0.8183, 0.6554]}, {"w": "or", "b": [0.8246, 0.6356, 0.8456, 0.6554]}, {"w": "surface", "b": [0.1294, 0.6561, 0.2022, 0.6759]}, {"w": "separating", "b": [0.2085, 0.6561, 0.3122, 0.6759]}, {"w": "your", "b": [0.3185, 0.6561, 0.3648, 0.6759]}, {"w": "training", "b": [0.3711, 0.6561, 0.4495, 0.6759]}, {"w": "data", "b": [0.4559, 0.6561, 0.4979, 0.6759]}, {"w": "into", "b": [0.5042, 0.6561, 0.5434, 0.6759]}, {"w": "two", "b": [0.5497, 0.6561, 0.5876, 0.6759]}, {"w": "spaces", "b": [0.5939, 0.6561, 0.6597, 0.6759]}, {"w": "corresponding", "b": [0.666, 0.6561, 0.8103, 0.6759]}, {"w": "to", "b": [0.8167, 0.6561, 0.8363, 0.6759]}, {"w": "two", "b": [0.1294, 0.6766, 0.1673, 0.6964]}, {"w": "categories.", "b": [0.1736, 0.6766, 0.2821, 0.6964]}, {"w": "To", "b": [0.2884, 0.6766, 0.3147, 0.6964]}, {"w": "classify", "b": [0.321, 0.6766, 0.398, 0.6964]}, {"w": "new", "b": [0.4044, 0.6766, 0.4464, 0.6964]}, {"w": "data", "b": [0.4527, 0.6766, 0.4947, 0.6964]}, {"w": "points,", "b": [0.501, 0.6766, 0.569, 0.6964]}, {"w": "you", "b": [0.5753, 0.6766, 0.6131, 0.6964]}, {"w": "just", "b": [0.6195, 0.6766, 0.6559, 0.6964]}, {"w": "need", "b": [0.6622, 0.6766, 0.7098, 0.6964]}, {"w": "to", "b": [0.7161, 0.6766, 0.7357, 0.6964]}, {"w": "check", "b": [0.742, 0.6766, 0.8009, 0.6964]}, {"w": "which", "b": [0.8072, 0.6766, 0.8688, 0.6964]}, {"w": "side", "b": [0.1294, 0.6971, 0.1701, 0.7169]}, {"w": "of", "b": [0.1764, 0.6971, 0.1974, 0.7169]}, {"w": "the", "b": [0.2037, 0.6971, 0.2345, 0.7169]}, {"w": "decision", "b": [0.2408, 0.6971, 0.3249, 0.7169]}, {"w": "boundary", "b": [0.3312, 0.6971, 0.4265, 0.7169]}, {"w": "they", "b": [0.4328, 0.6971, 0.4762, 0.7169]}, {"w": "fall", "b": [0.4825, 0.6971, 0.5161, 0.7169]}, {"w": "on.", "b": [0.5225, 0.6971, 0.554, 0.7169]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 1.10. A decision boundary", "words": [{"w": "Figure", "b": [0.1294, 0.735, 0.1827, 0.7498]}, {"w": "1.10.", "b": [0.1874, 0.735, 0.2252, 0.7498]}, {"w": "A", "b": [0.2299, 0.735, 0.2436, 0.7498]}, {"w": "decision", "b": [0.2483, 0.735, 0.3135, 0.7498]}, {"w": "boundary", "b": [0.3182, 0.735, 0.3971, 0.7498]}]}]}, {"page": 46, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "SVMs proceed to find these boundaries in two steps:", "words": [{"w": "SVMs", "b": [0.1294, 0.2577, 0.1939, 0.2774]}, {"w": "proceed", "b": [0.2002, 0.2577, 0.28, 0.2774]}, {"w": "to", "b": [0.2863, 0.2577, 0.306, 0.2774]}, {"w": "find", "b": [0.3123, 0.2577, 0.3529, 0.2774]}, {"w": "these", "b": [0.3592, 0.2577, 0.4111, 0.2774]}, {"w": "boundaries", "b": [0.4174, 0.2577, 0.5281, 0.2774]}, {"w": "in", "b": [0.5344, 0.2577, 0.554, 0.2774]}, {"w": "two", "b": [0.5603, 0.2577, 0.5981, 0.2774]}, {"w": "steps:", "b": [0.6044, 0.2577, 0.6619, 0.2774]}]}, {"id": "b_1", "type": "paragraph", "text": "1. The data is mapped to a new high-dimensional representation where the decision boundary can be expressed as a hyperplane (if the data was two-dimensional, as in figure 1.10, a hyperplane would be a straight line). 2. A good decision boundary (a separation hyperplane) is computed by trying to maximize the distance between the hyperplane and the closest data points from each class, a step called maximizing the margin. This allows the boundary to generalize well to new samples outside of the training dataset.", "words": [{"w": "1.", "b": [0.1551, 0.296, 0.174, 0.3158]}, {"w": "The", "b": [0.1799, 0.296, 0.2191, 0.3158]}, {"w": "data", "b": [0.2254, 0.296, 0.2674, 0.3158]}, {"w": "is", "b": [0.2737, 0.296, 0.2906, 0.3158]}, {"w": "mapped", "b": [0.2969, 0.296, 0.3767, 0.3158]}, {"w": "to", "b": [0.383, 0.296, 0.4027, 0.3158]}, {"w": "a", "b": [0.409, 0.296, 0.4202, 0.3158]}, {"w": "new", "b": [0.4265, 0.296, 0.4685, 0.3158]}, {"w": "high-dimensional", "b": [0.4748, 0.296, 0.6514, 0.3158]}, {"w": "representation", "b": [0.6577, 0.296, 0.8006, 0.3158]}, {"w": "where", "b": [0.8069, 0.296, 0.8685, 0.3158]}, {"w": "the", "b": [0.1799, 0.3165, 0.2107, 0.3363]}, {"w": "decision", "b": [0.217, 0.3165, 0.3011, 0.3363]}, {"w": "boundary", "b": [0.3074, 0.3165, 0.4027, 0.3363]}, {"w": "can", "b": [0.409, 0.3165, 0.444, 0.3363]}, {"w": "be", "b": [0.4503, 0.3165, 0.4741, 0.3363]}, {"w": "expressed", "b": [0.4804, 0.3165, 0.5799, 0.3363]}, {"w": "as", "b": [0.5862, 0.3165, 0.6072, 0.3363]}, {"w": "a", "b": [0.6135, 0.3165, 0.6247, 0.3363]}, {"w": "hyperplane", "b": [0.631, 0.3165, 0.7431, 0.3363]}, {"w": "(if", "b": [0.7494, 0.3165, 0.7732, 0.3363]}, {"w": "the", "b": [0.7794, 0.3165, 0.8103, 0.3363]}, {"w": "data", "b": [0.8166, 0.3165, 0.8586, 0.3363]}, {"w": "was", "b": [0.1799, 0.337, 0.2191, 0.3568]}, {"w": "two-dimensional,", "b": [0.2254, 0.337, 0.4013, 0.3568]}, {"w": "as", "b": [0.4076, 0.337, 0.4286, 0.3568]}, {"w": "in", "b": [0.4349, 0.337, 0.4545, 0.3568]}, {"w": "figure", "b": [0.4608, 0.337, 0.521, 0.3568]}, {"w": "1.10,", "b": [0.5273, 0.337, 0.5778, 0.3568]}, {"w": "a", "b": [0.5841, 0.337, 0.5953, 0.3568]}, {"w": "hyperplane", "b": [0.6016, 0.337, 0.7137, 0.3568]}, {"w": "would", "b": [0.72, 0.337, 0.783, 0.3568]}, {"w": "be", "b": [0.7893, 0.337, 0.8132, 0.3568]}, {"w": "a", "b": [0.8195, 0.337, 0.8307, 0.3568]}, {"w": "straight", "b": [0.1799, 0.3575, 0.2555, 0.3773]}, {"w": "line).", "b": [0.2618, 0.3575, 0.3144, 0.3773]}, {"w": "2.", "b": [0.1551, 0.378, 0.174, 0.3978]}, {"w": "A", "b": [0.1799, 0.378, 0.1981, 0.3978]}, {"w": "good", "b": [0.2044, 0.378, 0.2548, 0.3978]}, {"w": "decision", "b": [0.2611, 0.378, 0.3452, 0.3978]}, {"w": "boundary", "b": [0.3515, 0.378, 0.4468, 0.3978]}, {"w": "(a", "b": [0.4531, 0.378, 0.4727, 0.3978]}, {"w": "separation", "b": [0.479, 0.378, 0.5827, 0.3978]}, {"w": "hyperplane)", "b": [0.589, 0.378, 0.7095, 0.3978]}, {"w": "is", "b": [0.7158, 0.378, 0.7326, 0.3978]}, {"w": "computed", "b": [0.7389, 0.378, 0.8384, 0.3978]}, {"w": "by", "b": [0.8447, 0.378, 0.8699, 0.3978]}, {"w": "trying", "b": [0.1799, 0.3985, 0.2401, 0.4183]}, {"w": "to", "b": [0.2464, 0.3985, 0.2661, 0.4183]}, {"w": "maximize", "b": [0.2724, 0.3985, 0.3719, 0.4183]}, {"w": "the", "b": [0.3782, 0.3985, 0.409, 0.4183]}, {"w": "distance", "b": [0.4153, 0.3985, 0.498, 0.4183]}, {"w": "between", "b": [0.5043, 0.3985, 0.5883, 0.4183]}, {"w": "the", "b": [0.5946, 0.3985, 0.6255, 0.4183]}, {"w": "hyperplane", "b": [0.6318, 0.3985, 0.7438, 0.4183]}, {"w": "and", "b": [0.7501, 0.3985, 0.7866, 0.4183]}, {"w": "the", "b": [0.7928, 0.3985, 0.8236, 0.4183]}, {"w": "closest", "b": [0.1799, 0.419, 0.2485, 0.4388]}, {"w": "data", "b": [0.2548, 0.419, 0.2969, 0.4388]}, {"w": "points", "b": [0.3032, 0.419, 0.3648, 0.4388]}, {"w": "from", "b": [0.3712, 0.419, 0.4202, 0.4388]}, {"w": "each", "b": [0.4265, 0.419, 0.4727, 0.4388]}, {"w": "class,", "b": [0.479, 0.419, 0.5344, 0.4388]}, {"w": "a", "b": [0.5407, 0.419, 0.5519, 0.4388]}, {"w": "step", "b": [0.5582, 0.419, 0.5988, 0.4388]}, {"w": "called", "b": [0.6051, 0.419, 0.6654, 0.4388]}, {"w": "maximizing", "b": [0.6716, 0.419, 0.7879, 0.4388]}, {"w": "the", "b": [0.7942, 0.419, 0.825, 0.4388]}, {"w": "margin.", "b": [0.1799, 0.4395, 0.2581, 0.4593]}, {"w": "This", "b": [0.2644, 0.4395, 0.3093, 0.4593]}, {"w": "allows", "b": [0.3156, 0.4395, 0.3814, 0.4593]}, {"w": "the", "b": [0.3877, 0.4395, 0.4186, 0.4593]}, {"w": "boundary", "b": [0.4249, 0.4395, 0.5201, 0.4593]}, {"w": "to", "b": [0.5265, 0.4395, 0.5461, 0.4593]}, {"w": "generalize", "b": [0.5524, 0.4395, 0.656, 0.4593]}, {"w": "well", "b": [0.6623, 0.4395, 0.7058, 0.4593]}, {"w": "to", "b": [0.7121, 0.4395, 0.7317, 0.4593]}, {"w": "new", "b": [0.738, 0.4395, 0.78, 0.4593]}, {"w": "samples", "b": [0.7864, 0.4395, 0.8676, 0.4593]}, {"w": "outside", "b": [0.1799, 0.46, 0.2527, 0.4798]}, {"w": "of", "b": [0.259, 0.46, 0.2801, 0.4798]}, {"w": "the", "b": [0.2864, 0.46, 0.3172, 0.4798]}, {"w": "training", "b": [0.3235, 0.46, 0.402, 0.4798]}, {"w": "dataset.", "b": [0.4083, 0.46, 0.4846, 0.4798]}]}, {"id": "b_2", "type": "paragraph", "text": "The technique of mapping data to a high-dimensional representation where a classification problem becomes simpler may look good on paper, but in practice it’s often computationally intractable. That’s where the kernel trick comes in (the key idea that kernel methods are named after). Here’s the gist of it: to find good decision hyperplanes in the new representation space, you don’t have to explicitly compute the coordinates of your points in the new space; you just need to compute the distance between pairs of points in that space, which can be done efficiently using a kernel function. A kernel function is a computationally tractable operation that maps any two points in your initial space to the distance between these points in your target representation space, completely bypassing the explicit computation of the new representation. Kernel functions are typically crafted by hand rather than learned from data—in the case of an SVM, only the separation hyperplane is learned.", "words": [{"w": "The", "b": [0.1294, 0.5028, 0.1686, 0.5226]}, {"w": "technique", "b": [0.1749, 0.5028, 0.273, 0.5226]}, {"w": "of", "b": [0.2793, 0.5028, 0.3003, 0.5226]}, {"w": "mapping", "b": [0.3066, 0.5028, 0.3949, 0.5226]}, {"w": "data", "b": [0.4012, 0.5028, 0.4433, 0.5226]}, {"w": "to", "b": [0.4496, 0.5028, 0.4692, 0.5226]}, {"w": "a", "b": [0.4755, 0.5028, 0.4867, 0.5226]}, {"w": "high-dimensional", "b": [0.493, 0.5028, 0.6696, 0.5226]}, {"w": "representation", "b": [0.6759, 0.5028, 0.8188, 0.5226]}, {"w": "where", "b": [0.1294, 0.5233, 0.191, 0.5431]}, {"w": "a", "b": [0.1973, 0.5233, 0.2085, 0.5431]}, {"w": "classification", "b": [0.2149, 0.5233, 0.348, 0.5431]}, {"w": "problem", "b": [0.3543, 0.5233, 0.4384, 0.5431]}, {"w": "becomes", "b": [0.4447, 0.5233, 0.5329, 0.5431]}, {"w": "simpler", "b": [0.5392, 0.5233, 0.6149, 0.5431]}, {"w": "may", "b": [0.6212, 0.5233, 0.6647, 0.5431]}, {"w": "look", "b": [0.671, 0.5233, 0.7158, 0.5431]}, {"w": "good", "b": [0.722, 0.5233, 0.7725, 0.5431]}, {"w": "on", "b": [0.7788, 0.5233, 0.804, 0.5431]}, {"w": "paper,", "b": [0.1294, 0.5438, 0.1907, 0.5636]}, {"w": "but", "b": [0.197, 0.5438, 0.2293, 0.5636]}, {"w": "in", "b": [0.2356, 0.5438, 0.2552, 0.5636]}, {"w": "practice", "b": [0.2615, 0.5438, 0.3414, 0.5636]}, {"w": "it’s", "b": [0.3477, 0.5438, 0.3785, 0.5636]}, {"w": "often", "b": [0.3848, 0.5438, 0.4366, 0.5636]}, {"w": "computationally", "b": [0.4429, 0.5438, 0.6069, 0.5636]}, {"w": "intractable.", "b": [0.6132, 0.5438, 0.726, 0.5636]}, {"w": "That’s", "b": [0.7323, 0.5438, 0.7953, 0.5636]}, {"w": "where", "b": [0.8016, 0.5438, 0.8632, 0.5636]}, {"w": "the", "b": [0.1294, 0.5643, 0.1602, 0.5841]}, {"w": "kernel", "b": [0.1665, 0.5643, 0.2296, 0.5841]}, {"w": "trick", "b": [0.2359, 0.5643, 0.2821, 0.5841]}, {"w": "comes", "b": [0.2884, 0.5643, 0.3528, 0.5841]}, {"w": "in", "b": [0.3591, 0.5643, 0.3788, 0.5841]}, {"w": "(the", "b": [0.3851, 0.5643, 0.4243, 0.5841]}, {"w": "key", "b": [0.4306, 0.5643, 0.467, 0.5841]}, {"w": "idea", "b": [0.4733, 0.5643, 0.5154, 0.5841]}, {"w": "that", "b": [0.5217, 0.5643, 0.5595, 0.5841]}, {"w": "kernel", "b": [0.5658, 0.5643, 0.6288, 0.5841]}, {"w": "methods", "b": [0.6352, 0.5643, 0.7206, 0.5841]}, {"w": "are", "b": [0.7269, 0.5643, 0.7577, 0.5841]}, {"w": "named", "b": [0.7641, 0.5643, 0.8313, 0.5841]}, {"w": "after).", "b": [0.1294, 0.5848, 0.1903, 0.6046]}, {"w": "Here’s", "b": [0.1966, 0.5848, 0.2625, 0.6046]}, {"w": "the", "b": [0.2688, 0.5848, 0.2996, 0.6046]}, {"w": "gist", "b": [0.3059, 0.5848, 0.3423, 0.6046]}, {"w": "of", "b": [0.3487, 0.5848, 0.3697, 0.6046]}, {"w": "it:", "b": [0.376, 0.5848, 0.397, 0.6046]}, {"w": "to", "b": [0.4033, 0.5848, 0.4229, 0.6046]}, {"w": "find", "b": [0.4293, 0.5848, 0.4699, 0.6046]}, {"w": "good", "b": [0.4762, 0.5848, 0.5266, 0.6046]}, {"w": "decision", "b": [0.533, 0.5848, 0.617, 0.6046]}, {"w": "hyperplanes", "b": [0.6233, 0.5848, 0.7452, 0.6046]}, {"w": "in", "b": [0.7515, 0.5848, 0.7711, 0.6046]}, {"w": "the", "b": [0.7774, 0.5848, 0.8082, 0.6046]}, {"w": "new", "b": [0.8145, 0.5848, 0.8566, 0.6046]}, {"w": "representation", "b": [0.1294, 0.6053, 0.2723, 0.6251]}, {"w": "space,", "b": [0.2786, 0.6053, 0.341, 0.6251]}, {"w": "you", "b": [0.3473, 0.6053, 0.3851, 0.6251]}, {"w": "don’t", "b": [0.3914, 0.6053, 0.4442, 0.6251]}, {"w": "have", "b": [0.4505, 0.6053, 0.4981, 0.6251]}, {"w": "to", "b": [0.5044, 0.6053, 0.524, 0.6251]}, {"w": "explicitly", "b": [0.5303, 0.6053, 0.6256, 0.6251]}, {"w": "compute", "b": [0.632, 0.6053, 0.7188, 0.6251]}, {"w": "the", "b": [0.7251, 0.6053, 0.756, 0.6251]}, {"w": "coordinates", "b": [0.1294, 0.6258, 0.2457, 0.6456]}, {"w": "of", "b": [0.252, 0.6258, 0.273, 0.6456]}, {"w": "your", "b": [0.2793, 0.6258, 0.3256, 0.6456]}, {"w": "points", "b": [0.3319, 0.6258, 0.3936, 0.6456]}, {"w": "in", "b": [0.3999, 0.6258, 0.4195, 0.6456]}, {"w": "the", "b": [0.4258, 0.6258, 0.4566, 0.6456]}, {"w": "new", "b": [0.4629, 0.6258, 0.5049, 0.6456]}, {"w": "space;", "b": [0.5112, 0.6258, 0.5742, 0.6456]}, {"w": "you", "b": [0.5806, 0.6258, 0.6184, 0.6456]}, {"w": "just", "b": [0.6247, 0.6258, 0.6611, 0.6456]}, {"w": "need", "b": [0.6675, 0.6258, 0.7151, 0.6456]}, {"w": "to", "b": [0.7214, 0.6258, 0.741, 0.6456]}, {"w": "compute", "b": [0.7473, 0.6258, 0.8342, 0.6456]}, {"w": "the", "b": [0.1294, 0.6463, 0.1602, 0.6661]}, {"w": "distance", "b": [0.1665, 0.6463, 0.2492, 0.6661]}, {"w": "between", "b": [0.2555, 0.6463, 0.3396, 0.6661]}, {"w": "pairs", "b": [0.3459, 0.6463, 0.3949, 0.6661]}, {"w": "of", "b": [0.4012, 0.6463, 0.4222, 0.6661]}, {"w": "points", "b": [0.4285, 0.6463, 0.4902, 0.6661]}, {"w": "in", "b": [0.4965, 0.6463, 0.5161, 0.6661]}, {"w": "that", "b": [0.5225, 0.6463, 0.5603, 0.6661]}, {"w": "space,", "b": [0.5666, 0.6463, 0.6289, 0.6661]}, {"w": "which", "b": [0.6352, 0.6463, 0.6969, 0.6661]}, {"w": "can", "b": [0.7032, 0.6463, 0.7382, 0.6661]}, {"w": "be", "b": [0.7445, 0.6463, 0.7683, 0.6661]}, {"w": "done", "b": [0.7746, 0.6463, 0.8237, 0.6661]}, {"w": "efficiently", "b": [0.1294, 0.6668, 0.2326, 0.6866]}, {"w": "using", "b": [0.2389, 0.6668, 0.2936, 0.6866]}, {"w": "a", "b": [0.2999, 0.6668, 0.3111, 0.6866]}, {"w": "kernel", "b": [0.3174, 0.6668, 0.3804, 0.6866]}, {"w": "function.", "b": [0.3867, 0.6668, 0.4757, 0.6866]}, {"w": "A", "b": [0.482, 0.6668, 0.5002, 0.6866]}, {"w": "kernel", "b": [0.5065, 0.6668, 0.5696, 0.6866]}, {"w": "function", "b": [0.5759, 0.6668, 0.6599, 0.6866]}, {"w": "is", "b": [0.6663, 0.6668, 0.6831, 0.6866]}, {"w": "a", "b": [0.6894, 0.6668, 0.7006, 0.6866]}, {"w": "computationally", "b": [0.1294, 0.6873, 0.2934, 0.7071]}, {"w": "tractable", "b": [0.2997, 0.6873, 0.3865, 0.7071]}, {"w": "operation", "b": [0.3928, 0.6873, 0.4881, 0.7071]}, {"w": "that", "b": [0.4944, 0.6873, 0.5323, 0.7071]}, {"w": "maps", "b": [0.5386, 0.6873, 0.5918, 0.7071]}, {"w": "any", "b": [0.5981, 0.6873, 0.6346, 0.7071]}, {"w": "two", "b": [0.6409, 0.6873, 0.6787, 0.7071]}, {"w": "points", "b": [0.685, 0.6873, 0.7467, 0.7071]}, {"w": "in", "b": [0.753, 0.6873, 0.7726, 0.7071]}, {"w": "your", "b": [0.7789, 0.6873, 0.8252, 0.7071]}, {"w": "initial", "b": [0.1294, 0.7078, 0.1883, 0.7276]}, {"w": "space", "b": [0.1946, 0.7078, 0.2506, 0.7276]}, {"w": "to", "b": [0.2569, 0.7078, 0.2766, 0.7276]}, {"w": "the", "b": [0.2829, 0.7078, 0.3137, 0.7276]}, {"w": "distance", "b": [0.32, 0.7078, 0.4027, 0.7276]}, {"w": "between", "b": [0.4089, 0.7078, 0.4929, 0.7276]}, {"w": "these", "b": [0.4992, 0.7078, 0.5511, 0.7276]}, {"w": "points", "b": [0.5574, 0.7078, 0.6191, 0.7276]}, {"w": "in", "b": [0.6254, 0.7078, 0.645, 0.7276]}, {"w": "your", "b": [0.6513, 0.7078, 0.6975, 0.7276]}, {"w": "target", "b": [0.7039, 0.7078, 0.7608, 0.7276]}, {"w": "representation", "b": [0.1294, 0.7283, 0.2723, 0.7481]}, {"w": "space,", "b": [0.2786, 0.7283, 0.341, 0.7481]}, {"w": "completely", "b": [0.3473, 0.7283, 0.4594, 0.7481]}, {"w": "bypassing", "b": [0.4657, 0.7283, 0.5666, 0.7481]}, {"w": "the", "b": [0.5729, 0.7283, 0.6037, 0.7481]}, {"w": "explicit", "b": [0.61, 0.7283, 0.6857, 0.7481]}, {"w": "computation", "b": [0.692, 0.7283, 0.8181, 0.7481]}, {"w": "of", "b": [0.8244, 0.7283, 0.8454, 0.7481]}, {"w": "the", "b": [0.1294, 0.7488, 0.1602, 0.7686]}, {"w": "new", "b": [0.1665, 0.7488, 0.2086, 0.7686]}, {"w": "representation.", "b": [0.2149, 0.7488, 0.3641, 0.7686]}, {"w": "Kernel", "b": [0.3704, 0.7488, 0.439, 0.7686]}, {"w": "functions", "b": [0.4453, 0.7488, 0.5392, 0.7686]}, {"w": "are", "b": [0.5455, 0.7488, 0.5763, 0.7686]}, {"w": "typically", "b": [0.5826, 0.7488, 0.6709, 0.7686]}, {"w": "crafted", "b": [0.6772, 0.7488, 0.7472, 0.7686]}, {"w": "by", "b": [0.7535, 0.7488, 0.7788, 0.7686]}, {"w": "hand", "b": [0.7851, 0.7488, 0.8341, 0.7686]}, {"w": "rather", "b": [0.1294, 0.7693, 0.1882, 0.7891]}, {"w": "than", "b": [0.1945, 0.7693, 0.238, 0.7891]}, {"w": "learned", "b": [0.2443, 0.7693, 0.3185, 0.7891]}, {"w": "from", "b": [0.3248, 0.7693, 0.3739, 0.7891]}, {"w": "data—in", "b": [0.3802, 0.7693, 0.4671, 0.7891]}, {"w": "the", "b": [0.4734, 0.7693, 0.5042, 0.7891]}, {"w": "case", "b": [0.5105, 0.7693, 0.5539, 0.7891]}, {"w": "of", "b": [0.5602, 0.7693, 0.5812, 0.7891]}, {"w": "an", "b": [0.5875, 0.7693, 0.6114, 0.7891]}, {"w": "SVM,", "b": [0.6177, 0.7693, 0.6786, 0.7891]}, {"w": "only", "b": [0.6849, 0.7693, 0.7298, 0.7891]}, {"w": "the", "b": [0.7361, 0.7693, 0.7669, 0.7891]}, {"w": "separation", "b": [0.1294, 0.7898, 0.2331, 0.8096]}, {"w": "hyperplane", "b": [0.2394, 0.7898, 0.3515, 0.8096]}, {"w": "is", "b": [0.3577, 0.7898, 0.3746, 0.8096]}, {"w": "learned.", "b": [0.3809, 0.7898, 0.4614, 0.8096]}]}, {"id": "b_3", "type": "paragraph", "text": "At the time they were developed, SVMs exhibited state-of-the-art performance on simple classification problems and were one of the few machine-learning methods backed by extensive theory and amenable to serious mathematical analysis, making them well understood and easily", "words": [{"w": "At", "b": [0.1294, 0.8326, 0.1546, 0.8523]}, {"w": "the", "b": [0.1609, 0.8326, 0.1918, 0.8523]}, {"w": "time", "b": [0.1981, 0.8326, 0.2429, 0.8523]}, {"w": "they", "b": [0.2492, 0.8326, 0.2927, 0.8523]}, {"w": "were", "b": [0.299, 0.8326, 0.348, 0.8523]}, {"w": "developed,", "b": [0.3543, 0.8326, 0.4643, 0.8523]}, {"w": "SVMs", "b": [0.4706, 0.8326, 0.5351, 0.8523]}, {"w": "exhibited", "b": [0.5414, 0.8326, 0.6353, 0.8523]}, {"w": "state-of-the-art", "b": [0.6416, 0.8326, 0.7915, 0.8523]}, {"w": "performance", "b": [0.1294, 0.8531, 0.2569, 0.8728]}, {"w": "on", "b": [0.2632, 0.8531, 0.2884, 0.8728]}, {"w": "simple", "b": [0.2947, 0.8531, 0.362, 0.8728]}, {"w": "classification", "b": [0.3683, 0.8531, 0.5014, 0.8728]}, {"w": "problems", "b": [0.5077, 0.8531, 0.6016, 0.8728]}, {"w": "and", "b": [0.6079, 0.8531, 0.6443, 0.8728]}, {"w": "were", "b": [0.6507, 0.8531, 0.6997, 0.8728]}, {"w": "one", "b": [0.706, 0.8531, 0.7424, 0.8728]}, {"w": "of", "b": [0.7486, 0.8531, 0.7696, 0.8728]}, {"w": "the", "b": [0.7759, 0.8531, 0.8068, 0.8728]}, {"w": "few", "b": [0.8131, 0.8531, 0.8509, 0.8728]}, {"w": "machine-learning", "b": [0.1294, 0.8736, 0.3059, 0.8933]}, {"w": "methods", "b": [0.3122, 0.8736, 0.3977, 0.8933]}, {"w": "backed", "b": [0.404, 0.8736, 0.4755, 0.8933]}, {"w": "by", "b": [0.4818, 0.8736, 0.507, 0.8933]}, {"w": "extensive", "b": [0.5133, 0.8736, 0.6086, 0.8933]}, {"w": "theory", "b": [0.6149, 0.8736, 0.6794, 0.8933]}, {"w": "and", "b": [0.6857, 0.8736, 0.7221, 0.8933]}, {"w": "amenable", "b": [0.7284, 0.8736, 0.8251, 0.8933]}, {"w": "to", "b": [0.8314, 0.8736, 0.851, 0.8933]}, {"w": "serious", "b": [0.1294, 0.8941, 0.2009, 0.9138]}, {"w": "mathematical", "b": [0.2072, 0.8941, 0.3431, 0.9138]}, {"w": "analysis,", "b": [0.3494, 0.8941, 0.437, 0.9138]}, {"w": "making", "b": [0.4433, 0.8941, 0.519, 0.9138]}, {"w": "them", "b": [0.5253, 0.8941, 0.5757, 0.9138]}, {"w": "well", "b": [0.582, 0.8941, 0.6254, 0.9138]}, {"w": "understood", "b": [0.6317, 0.8941, 0.7438, 0.9138]}, {"w": "and", "b": [0.7501, 0.8941, 0.7865, 0.9138]}, {"w": "easily", "b": [0.7928, 0.8941, 0.8517, 0.9138]}]}]}, {"page": 47, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "interpretable. Because of these useful properties, SVMs became extremely popular in the field for a long time.", "words": [{"w": "interpretable.", "b": [0.1294, 0.0857, 0.2632, 0.1054]}, {"w": "Because", "b": [0.2695, 0.0857, 0.3536, 0.1054]}, {"w": "of", "b": [0.3599, 0.0857, 0.3809, 0.1054]}, {"w": "these", "b": [0.3872, 0.0857, 0.439, 0.1054]}, {"w": "useful", "b": [0.4453, 0.0857, 0.507, 0.1054]}, {"w": "properties,", "b": [0.5133, 0.0857, 0.6205, 0.1054]}, {"w": "SVMs", "b": [0.6268, 0.0857, 0.6913, 0.1054]}, {"w": "became", "b": [0.6976, 0.0857, 0.7746, 0.1054]}, {"w": "extremely", "b": [0.1294, 0.1062, 0.2303, 0.1259]}, {"w": "popular", "b": [0.2366, 0.1062, 0.3137, 0.1259]}, {"w": "in", "b": [0.32, 0.1062, 0.3396, 0.1259]}, {"w": "the", "b": [0.3459, 0.1062, 0.3767, 0.1259]}, {"w": "field", "b": [0.383, 0.1062, 0.4293, 0.1259]}, {"w": "for", "b": [0.4356, 0.1062, 0.465, 0.1259]}, {"w": "a", "b": [0.4712, 0.1062, 0.4824, 0.1259]}, {"w": "long", "b": [0.4887, 0.1062, 0.5336, 0.1259]}, {"w": "time.", "b": [0.5399, 0.1062, 0.5911, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "But SVMs proved hard to scale to large datasets and didn’t provide good results for perceptual problems such as image classification. Because an SVM is a shallow method, applying an SVM to perceptual problems requires first extracting useful representations manually (a step called feature engineering), which is difficult and brittle.", "words": [{"w": "But", "b": [0.1294, 0.149, 0.1659, 0.1687]}, {"w": "SVMs", "b": [0.1722, 0.149, 0.2366, 0.1687]}, {"w": "proved", "b": [0.243, 0.149, 0.313, 0.1687]}, {"w": "hard", "b": [0.3193, 0.149, 0.3641, 0.1687]}, {"w": "to", "b": [0.3704, 0.149, 0.3901, 0.1687]}, {"w": "scale", "b": [0.3964, 0.149, 0.4468, 0.1687]}, {"w": "to", "b": [0.4531, 0.149, 0.4727, 0.1687]}, {"w": "large", "b": [0.479, 0.149, 0.529, 0.1687]}, {"w": "datasets", "b": [0.5353, 0.149, 0.6152, 0.1687]}, {"w": "and", "b": [0.6215, 0.149, 0.6579, 0.1687]}, {"w": "didn’t", "b": [0.6642, 0.149, 0.724, 0.1687]}, {"w": "provide", "b": [0.7303, 0.149, 0.8074, 0.1687]}, {"w": "good", "b": [0.8137, 0.149, 0.8641, 0.1687]}, {"w": "results", "b": [0.1294, 0.1695, 0.1953, 0.1892]}, {"w": "for", "b": [0.2016, 0.1695, 0.231, 0.1892]}, {"w": "perceptual", "b": [0.2373, 0.1695, 0.3424, 0.1892]}, {"w": "problems", "b": [0.3487, 0.1695, 0.4426, 0.1892]}, {"w": "such", "b": [0.4489, 0.1695, 0.4951, 0.1892]}, {"w": "as", "b": [0.5014, 0.1695, 0.5224, 0.1892]}, {"w": "image", "b": [0.5287, 0.1695, 0.5904, 0.1892]}, {"w": "classification.", "b": [0.5967, 0.1695, 0.7361, 0.1892]}, {"w": "Because", "b": [0.7423, 0.1695, 0.8264, 0.1892]}, {"w": "an", "b": [0.8327, 0.1695, 0.8565, 0.1892]}, {"w": "SVM", "b": [0.1294, 0.19, 0.1841, 0.2097]}, {"w": "is", "b": [0.1904, 0.19, 0.2072, 0.2097]}, {"w": "a", "b": [0.2135, 0.19, 0.2247, 0.2097]}, {"w": "shallow", "b": [0.231, 0.19, 0.3095, 0.2097]}, {"w": "method,", "b": [0.3158, 0.19, 0.3978, 0.2097]}, {"w": "applying", "b": [0.4041, 0.19, 0.4924, 0.2097]}, {"w": "an", "b": [0.4987, 0.19, 0.5225, 0.2097]}, {"w": "SVM", "b": [0.5288, 0.19, 0.5835, 0.2097]}, {"w": "to", "b": [0.5898, 0.19, 0.6094, 0.2097]}, {"w": "perceptual", "b": [0.6157, 0.19, 0.7208, 0.2097]}, {"w": "problems", "b": [0.7271, 0.19, 0.821, 0.2097]}, {"w": "requires", "b": [0.1294, 0.2105, 0.2107, 0.2302]}, {"w": "first", "b": [0.217, 0.2105, 0.2576, 0.2302]}, {"w": "extracting", "b": [0.2639, 0.2105, 0.3648, 0.2302]}, {"w": "useful", "b": [0.3711, 0.2105, 0.4328, 0.2302]}, {"w": "representations", "b": [0.4391, 0.2105, 0.5918, 0.2302]}, {"w": "manually", "b": [0.598, 0.2105, 0.6919, 0.2302]}, {"w": "(a", "b": [0.6982, 0.2105, 0.7178, 0.2302]}, {"w": "step", "b": [0.7241, 0.2105, 0.7648, 0.2302]}, {"w": "called", "b": [0.7711, 0.2105, 0.8313, 0.2302]}, {"w": "feature", "b": [0.1294, 0.231, 0.1999, 0.2507]}, {"w": "engineering),", "b": [0.2062, 0.231, 0.3414, 0.2507]}, {"w": "which", "b": [0.3477, 0.231, 0.4094, 0.2507]}, {"w": "is", "b": [0.4157, 0.231, 0.4325, 0.2507]}, {"w": "difficult", "b": [0.4388, 0.231, 0.5196, 0.2507]}, {"w": "and", "b": [0.5259, 0.231, 0.5624, 0.2507]}, {"w": "brittle.", "b": [0.5687, 0.231, 0.6352, 0.2507]}]}, {"id": "b_2", "type": "paragraph", "text": "1.2.4. Decision trees, random forests, and gradient boosting machines", "words": [{"w": "1.2.4.", "b": [0.1294, 0.2782, 0.1862, 0.2979]}, {"w": "Decision", "b": [0.1925, 0.2782, 0.2836, 0.2979]}, {"w": "trees,", "b": [0.2899, 0.2782, 0.3475, 0.2979]}, {"w": "random", "b": [0.3538, 0.2782, 0.4393, 0.2979]}, {"w": "forests,", "b": [0.4456, 0.2782, 0.5229, 0.2979]}, {"w": "and", "b": [0.5292, 0.2782, 0.5699, 0.2979]}, {"w": "gradient", "b": [0.5762, 0.2782, 0.6673, 0.2979]}, {"w": "boosting", "b": [0.6736, 0.2782, 0.7647, 0.2979]}, {"w": "machines", "b": [0.1294, 0.2987, 0.2303, 0.3184]}]}, {"id": "b_3", "type": "paragraph", "text": "Decision trees are flowchart-like structures that let you classify input data points or predict output values given inputs (see figure 1.11). They’re easy to visualize and interpret. Decisions trees learned from data began to receive significant research interest in the 2000s, and by 2010 they were often preferred to kernel methods.", "words": [{"w": "Decision", "b": [0.1294, 0.3415, 0.2191, 0.3612]}, {"w": "trees", "b": [0.2254, 0.3415, 0.2735, 0.3612]}, {"w": "are", "b": [0.2798, 0.3415, 0.3106, 0.3612]}, {"w": "flowchart-like", "b": [0.3169, 0.3415, 0.4598, 0.3612]}, {"w": "structures", "b": [0.4661, 0.3415, 0.5642, 0.3612]}, {"w": "that", "b": [0.5705, 0.3415, 0.6083, 0.3612]}, {"w": "let", "b": [0.6146, 0.3415, 0.6399, 0.3612]}, {"w": "you", "b": [0.6462, 0.3415, 0.684, 0.3612]}, {"w": "classify", "b": [0.6903, 0.3415, 0.7674, 0.3612]}, {"w": "input", "b": [0.7737, 0.3415, 0.8255, 0.3612]}, {"w": "data", "b": [0.1294, 0.362, 0.1714, 0.3817]}, {"w": "points", "b": [0.1777, 0.362, 0.2394, 0.3817]}, {"w": "or", "b": [0.2457, 0.362, 0.2667, 0.3817]}, {"w": "predict", "b": [0.273, 0.362, 0.3431, 0.3817]}, {"w": "output", "b": [0.3494, 0.362, 0.4139, 0.3817]}, {"w": "values", "b": [0.4202, 0.362, 0.4846, 0.3817]}, {"w": "given", "b": [0.4909, 0.362, 0.547, 0.3817]}, {"w": "inputs", "b": [0.5533, 0.362, 0.615, 0.3817]}, {"w": "(see", "b": [0.6213, 0.362, 0.6619, 0.3817]}, {"w": "figure", "b": [0.6681, 0.362, 0.7284, 0.3817]}, {"w": "1.11).", "b": [0.7347, 0.362, 0.7926, 0.3817]}, {"w": "They’re", "b": [0.1294, 0.3825, 0.2093, 0.4022]}, {"w": "easy", "b": [0.2156, 0.3825, 0.2604, 0.4022]}, {"w": "to", "b": [0.2667, 0.3825, 0.2863, 0.4022]}, {"w": "visualize", "b": [0.2926, 0.3825, 0.3823, 0.4022]}, {"w": "and", "b": [0.3886, 0.3825, 0.425, 0.4022]}, {"w": "interpret.", "b": [0.4313, 0.3825, 0.5231, 0.4022]}, {"w": "Decisions", "b": [0.5294, 0.3825, 0.6289, 0.4022]}, {"w": "trees", "b": [0.6352, 0.3825, 0.6828, 0.4022]}, {"w": "learned", "b": [0.6891, 0.3825, 0.7634, 0.4022]}, {"w": "from", "b": [0.7697, 0.3825, 0.8187, 0.4022]}, {"w": "data", "b": [0.825, 0.3825, 0.8671, 0.4022]}, {"w": "began", "b": [0.1294, 0.403, 0.1897, 0.4227]}, {"w": "to", "b": [0.196, 0.403, 0.2156, 0.4227]}, {"w": "receive", "b": [0.2219, 0.403, 0.2947, 0.4227]}, {"w": "significant", "b": [0.301, 0.403, 0.4075, 0.4227]}, {"w": "research", "b": [0.4138, 0.403, 0.4979, 0.4227]}, {"w": "interest", "b": [0.5042, 0.403, 0.5784, 0.4227]}, {"w": "in", "b": [0.5847, 0.403, 0.6043, 0.4227]}, {"w": "the", "b": [0.6106, 0.403, 0.6414, 0.4227]}, {"w": "2000s,", "b": [0.6477, 0.403, 0.7143, 0.4227]}, {"w": "and", "b": [0.7206, 0.403, 0.757, 0.4227]}, {"w": "by", "b": [0.7633, 0.403, 0.7886, 0.4227]}, {"w": "2010", "b": [0.7949, 0.403, 0.8453, 0.4227]}, {"w": "they", "b": [0.1294, 0.4235, 0.1729, 0.4432]}, {"w": "were", "b": [0.1792, 0.4235, 0.2282, 0.4432]}, {"w": "often", "b": [0.2345, 0.4235, 0.2863, 0.4432]}, {"w": "preferred", "b": [0.2926, 0.4235, 0.385, 0.4432]}, {"w": "to", "b": [0.3914, 0.4235, 0.411, 0.4432]}, {"w": "kernel", "b": [0.4173, 0.4235, 0.4803, 0.4432]}, {"w": "methods.", "b": [0.4866, 0.4235, 0.5784, 0.4432]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 1.11. A decision tree: the parameters that are learned are the questions about the data. A question could be, for instance, “Is coefficient 2 in the data greater than 3.5?”", "words": [{"w": "Figure", "b": [0.1294, 0.4613, 0.1827, 0.4761]}, {"w": "1.11.", "b": [0.1874, 0.4613, 0.2242, 0.4761]}, {"w": "A", "b": [0.2289, 0.4613, 0.2426, 0.4761]}, {"w": "decision", "b": [0.2473, 0.4613, 0.3125, 0.4761]}, {"w": "tree:", "b": [0.3172, 0.4613, 0.3546, 0.4761]}, {"w": "the", "b": [0.3594, 0.4613, 0.3846, 0.4761]}, {"w": "parameters", "b": [0.3893, 0.4613, 0.4818, 0.4761]}, {"w": "that", "b": [0.4865, 0.4613, 0.5191, 0.4761]}, {"w": "are", "b": [0.5238, 0.4613, 0.5497, 0.4761]}, {"w": "learned", "b": [0.5545, 0.4613, 0.6154, 0.4761]}, {"w": "are", "b": [0.6202, 0.4613, 0.6461, 0.4761]}, {"w": "the", "b": [0.6508, 0.4613, 0.676, 0.4761]}, {"w": "questions", "b": [0.6807, 0.4613, 0.7564, 0.4761]}, {"w": "about", "b": [0.7612, 0.4613, 0.8074, 0.4761]}, {"w": "the", "b": [0.8121, 0.4613, 0.8374, 0.4761]}, {"w": "data.", "b": [0.1294, 0.4765, 0.1699, 0.4913]}, {"w": "A", "b": [0.1746, 0.4765, 0.1883, 0.4913]}, {"w": "question", "b": [0.193, 0.4765, 0.2613, 0.4913]}, {"w": "could", "b": [0.2661, 0.4765, 0.3102, 0.4913]}, {"w": "be,", "b": [0.315, 0.4765, 0.3386, 0.4913]}, {"w": "for", "b": [0.3433, 0.4765, 0.3675, 0.4913]}, {"w": "instance,", "b": [0.3722, 0.4765, 0.4432, 0.4913]}, {"w": "“Is", "b": [0.4479, 0.4765, 0.4721, 0.4913]}, {"w": "coefficient", "b": [0.4768, 0.4765, 0.5598, 0.4913]}, {"w": "2", "b": [0.5645, 0.4765, 0.574, 0.4913]}, {"w": "in", "b": [0.5787, 0.4765, 0.5945, 0.4913]}, {"w": "the", "b": [0.5992, 0.4765, 0.6245, 0.4913]}, {"w": "data", "b": [0.6292, 0.4765, 0.6649, 0.4913]}, {"w": "greater", "b": [0.6697, 0.4765, 0.7281, 0.4913]}, {"w": "than", "b": [0.7329, 0.4765, 0.7697, 0.4913]}, {"w": "3.5?”", "b": [0.7744, 0.4765, 0.817, 0.4913]}]}, {"id": "b_5", "type": "paragraph", "text": "In particular, the Random Forest algorithm introduced a robust, practical take on decision-tree learning that involves building a large number of specialized decision trees and then ensembling their outputs. Random forests are applicable to a wide range of problems—you could say that they’re almost always the second-best algorithm for any shallow machine-learning task. When the popular machine-learning competition website Kaggle (http://kaggle.com) got started in 2010, random forests quickly became a favorite on the platform—until 2014, when gradient boosting machines took over. A gradient boosting machine, much like a random forest, is a machine-learning technique based on ensembling", "words": [{"w": "In", "b": [0.1294, 0.6962, 0.1504, 0.716]}, {"w": "particular,", "b": [0.1567, 0.6962, 0.2587, 0.716]}, {"w": "the", "b": [0.265, 0.6962, 0.2958, 0.716]}, {"w": "Random", "b": [0.3021, 0.6962, 0.3862, 0.716]}, {"w": "Forest", "b": [0.3925, 0.6962, 0.4574, 0.716]}, {"w": "algorithm", "b": [0.4637, 0.6962, 0.5618, 0.716]}, {"w": "introduced", "b": [0.5681, 0.6962, 0.676, 0.716]}, {"w": "a", "b": [0.6823, 0.6962, 0.6935, 0.716]}, {"w": "robust,", "b": [0.6998, 0.6962, 0.7692, 0.716]}, {"w": "practical", "b": [0.7755, 0.6962, 0.8623, 0.716]}, {"w": "take", "b": [0.1294, 0.7167, 0.1714, 0.7365]}, {"w": "on", "b": [0.1777, 0.7167, 0.203, 0.7365]}, {"w": "decision-tree", "b": [0.2093, 0.7167, 0.3396, 0.7365]}, {"w": "learning", "b": [0.3459, 0.7167, 0.4285, 0.7365]}, {"w": "that", "b": [0.4348, 0.7167, 0.4727, 0.7365]}, {"w": "involves", "b": [0.479, 0.7167, 0.5645, 0.7365]}, {"w": "building", "b": [0.5708, 0.7167, 0.6549, 0.7365]}, {"w": "a", "b": [0.6612, 0.7167, 0.6724, 0.7365]}, {"w": "large", "b": [0.6787, 0.7167, 0.7286, 0.7365]}, {"w": "number", "b": [0.7349, 0.7167, 0.8119, 0.7365]}, {"w": "of", "b": [0.8183, 0.7167, 0.8393, 0.7365]}, {"w": "specialized", "b": [0.1294, 0.7372, 0.2415, 0.757]}, {"w": "decision", "b": [0.2478, 0.7372, 0.3318, 0.757]}, {"w": "trees", "b": [0.3381, 0.7372, 0.3858, 0.757]}, {"w": "and", "b": [0.3921, 0.7372, 0.4285, 0.757]}, {"w": "then", "b": [0.4348, 0.7372, 0.4782, 0.757]}, {"w": "ensembling", "b": [0.4846, 0.7372, 0.6009, 0.757]}, {"w": "their", "b": [0.6072, 0.7372, 0.6534, 0.757]}, {"w": "outputs.", "b": [0.6597, 0.7372, 0.7403, 0.757]}, {"w": "Random", "b": [0.7466, 0.7372, 0.8321, 0.757]}, {"w": "forests", "b": [0.1294, 0.7577, 0.1967, 0.7775]}, {"w": "are", "b": [0.203, 0.7577, 0.2338, 0.7775]}, {"w": "applicable", "b": [0.2401, 0.7577, 0.3438, 0.7775]}, {"w": "to", "b": [0.3501, 0.7577, 0.3697, 0.7775]}, {"w": "a", "b": [0.376, 0.7577, 0.3872, 0.7775]}, {"w": "wide", "b": [0.3935, 0.7577, 0.4425, 0.7775]}, {"w": "range", "b": [0.4488, 0.7577, 0.5049, 0.7775]}, {"w": "of", "b": [0.5112, 0.7577, 0.5322, 0.7775]}, {"w": "problems—you", "b": [0.5385, 0.7577, 0.6955, 0.7775]}, {"w": "could", "b": [0.7018, 0.7577, 0.7578, 0.7775]}, {"w": "say", "b": [0.7641, 0.7577, 0.7977, 0.7775]}, {"w": "that", "b": [0.804, 0.7577, 0.8418, 0.7775]}, {"w": "they’re", "b": [0.1294, 0.7782, 0.2009, 0.798]}, {"w": "almost", "b": [0.2072, 0.7782, 0.2744, 0.798]}, {"w": "always", "b": [0.2807, 0.7782, 0.3508, 0.798]}, {"w": "the", "b": [0.3571, 0.7782, 0.3879, 0.798]}, {"w": "second-best", "b": [0.3942, 0.7782, 0.5133, 0.798]}, {"w": "algorithm", "b": [0.5196, 0.7782, 0.6177, 0.798]}, {"w": "for", "b": [0.624, 0.7782, 0.6535, 0.798]}, {"w": "any", "b": [0.6598, 0.7782, 0.6962, 0.798]}, {"w": "shallow", "b": [0.7025, 0.7782, 0.781, 0.798]}, {"w": "machine-learning", "b": [0.1294, 0.7987, 0.3059, 0.8185]}, {"w": "task.", "b": [0.3122, 0.7987, 0.3592, 0.8185]}, {"w": "When", "b": [0.3655, 0.7987, 0.4257, 0.8185]}, {"w": "the", "b": [0.432, 0.7987, 0.4629, 0.8185]}, {"w": "popular", "b": [0.4692, 0.7987, 0.5462, 0.8185]}, {"w": "machine-learning", "b": [0.5525, 0.7987, 0.7291, 0.8185]}, {"w": "competition", "b": [0.7353, 0.7987, 0.8558, 0.8185]}, {"w": "website", "b": [0.1294, 0.8192, 0.2065, 0.839]}, {"w": "Kaggle", "b": [0.2128, 0.8192, 0.2856, 0.839]}, {"w": "(http://kaggle.com)", "b": [0.2919, 0.8192, 0.4859, 0.839]}, {"w": "got", "b": [0.4923, 0.8192, 0.5245, 0.839]}, {"w": "started", "b": [0.5308, 0.8192, 0.5981, 0.839]}, {"w": "in", "b": [0.6044, 0.8192, 0.624, 0.839]}, {"w": "2010,", "b": [0.6303, 0.8192, 0.687, 0.839]}, {"w": "random", "b": [0.6934, 0.8192, 0.7704, 0.839]}, {"w": "forests", "b": [0.7767, 0.8192, 0.844, 0.839]}, {"w": "quickly", "b": [0.1294, 0.8397, 0.2051, 0.8595]}, {"w": "became", "b": [0.2114, 0.8397, 0.2884, 0.8595]}, {"w": "a", "b": [0.2947, 0.8397, 0.3059, 0.8595]}, {"w": "favorite", "b": [0.3122, 0.8397, 0.3907, 0.8595]}, {"w": "on", "b": [0.397, 0.8397, 0.4222, 0.8595]}, {"w": "the", "b": [0.4285, 0.8397, 0.4594, 0.8595]}, {"w": "platform—until", "b": [0.4657, 0.8397, 0.624, 0.8595]}, {"w": "2014,", "b": [0.6303, 0.8397, 0.6871, 0.8595]}, {"w": "when", "b": [0.6934, 0.8397, 0.748, 0.8595]}, {"w": "gradient", "b": [0.7543, 0.8397, 0.8398, 0.8595]}, {"w": "boosting", "b": [0.1294, 0.8602, 0.2163, 0.88]}, {"w": "machines", "b": [0.2226, 0.8602, 0.3179, 0.88]}, {"w": "took", "b": [0.3242, 0.8602, 0.369, 0.88]}, {"w": "over.", "b": [0.3753, 0.8602, 0.4251, 0.88]}, {"w": "A", "b": [0.4314, 0.8602, 0.4496, 0.88]}, {"w": "gradient", "b": [0.4559, 0.8602, 0.5386, 0.88]}, {"w": "boosting", "b": [0.5449, 0.8602, 0.6318, 0.88]}, {"w": "machine,", "b": [0.6381, 0.8602, 0.7299, 0.88]}, {"w": "much", "b": [0.7362, 0.8602, 0.7922, 0.88]}, {"w": "like", "b": [0.7985, 0.8602, 0.8364, 0.88]}, {"w": "a", "b": [0.8427, 0.8602, 0.8539, 0.88]}, {"w": "random", "b": [0.1294, 0.8807, 0.2065, 0.9005]}, {"w": "forest,", "b": [0.2128, 0.8807, 0.2765, 0.9005]}, {"w": "is", "b": [0.2828, 0.8807, 0.2997, 0.9005]}, {"w": "a", "b": [0.306, 0.8807, 0.3172, 0.9005]}, {"w": "machine-learning", "b": [0.3235, 0.8807, 0.5, 0.9005]}, {"w": "technique", "b": [0.5063, 0.8807, 0.6044, 0.9005]}, {"w": "based", "b": [0.6107, 0.8807, 0.6681, 0.9005]}, {"w": "on", "b": [0.6744, 0.8807, 0.6997, 0.9005]}, {"w": "ensembling", "b": [0.706, 0.8807, 0.8223, 0.9005]}]}]}, {"page": 48, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "weak prediction models, generally decision trees. It uses gradient boosting, a way to improve any machine-learning model by iteratively training new models that specialize in addressing the weak points of the previous models. Applied to decision trees, the use of the gradient boosting technique results in models that strictly outperform random forests most of the time, while having similar properties. It may be one of the best, if not the best, algorithm for dealing with nonperceptual data today. Alongside deep learning, it’s one of the most commonly used techniques in Kaggle competitions.", "words": [{"w": "weak", "b": [0.1294, 0.0857, 0.1826, 0.1054]}, {"w": "prediction", "b": [0.1889, 0.0857, 0.2912, 0.1054]}, {"w": "models,", "b": [0.2975, 0.0857, 0.3767, 0.1054]}, {"w": "generally", "b": [0.383, 0.0857, 0.4769, 0.1054]}, {"w": "decision", "b": [0.4832, 0.0857, 0.5673, 0.1054]}, {"w": "trees.", "b": [0.5736, 0.0857, 0.6275, 0.1054]}, {"w": "It", "b": [0.6338, 0.0857, 0.6492, 0.1054]}, {"w": "uses", "b": [0.6554, 0.0857, 0.6989, 0.1054]}, {"w": "gradient", "b": [0.7052, 0.0857, 0.7907, 0.1054]}, {"w": "boosting,", "b": [0.1294, 0.1062, 0.2226, 0.1259]}, {"w": "a", "b": [0.2289, 0.1062, 0.2401, 0.1259]}, {"w": "way", "b": [0.2464, 0.1062, 0.2884, 0.1259]}, {"w": "to", "b": [0.2948, 0.1062, 0.3144, 0.1259]}, {"w": "improve", "b": [0.3207, 0.1062, 0.4048, 0.1259]}, {"w": "any", "b": [0.4111, 0.1062, 0.4475, 0.1259]}, {"w": "machine-learning", "b": [0.4538, 0.1062, 0.6303, 0.1259]}, {"w": "model", "b": [0.6366, 0.1062, 0.6997, 0.1259]}, {"w": "by", "b": [0.706, 0.1062, 0.7312, 0.1259]}, {"w": "iteratively", "b": [0.7375, 0.1062, 0.8398, 0.1259]}, {"w": "training", "b": [0.1294, 0.1267, 0.2079, 0.1464]}, {"w": "new", "b": [0.2142, 0.1267, 0.2562, 0.1464]}, {"w": "models", "b": [0.2625, 0.1267, 0.3354, 0.1464]}, {"w": "that", "b": [0.3417, 0.1267, 0.3796, 0.1464]}, {"w": "specialize", "b": [0.3859, 0.1267, 0.4853, 0.1464]}, {"w": "in", "b": [0.4916, 0.1267, 0.5113, 0.1464]}, {"w": "addressing", "b": [0.5176, 0.1267, 0.6255, 0.1464]}, {"w": "the", "b": [0.6318, 0.1267, 0.6626, 0.1464]}, {"w": "weak", "b": [0.6689, 0.1267, 0.7221, 0.1464]}, {"w": "points", "b": [0.7284, 0.1267, 0.7901, 0.1464]}, {"w": "of", "b": [0.7963, 0.1267, 0.8173, 0.1464]}, {"w": "the", "b": [0.8236, 0.1267, 0.8545, 0.1464]}, {"w": "previous", "b": [0.1294, 0.1472, 0.2163, 0.1669]}, {"w": "models.", "b": [0.2226, 0.1472, 0.3018, 0.1669]}, {"w": "Applied", "b": [0.3081, 0.1472, 0.3894, 0.1669]}, {"w": "to", "b": [0.3957, 0.1472, 0.4153, 0.1669]}, {"w": "decision", "b": [0.4216, 0.1472, 0.5057, 0.1669]}, {"w": "trees,", "b": [0.512, 0.1472, 0.5659, 0.1669]}, {"w": "the", "b": [0.5722, 0.1472, 0.6031, 0.1669]}, {"w": "use", "b": [0.6094, 0.1472, 0.643, 0.1669]}, {"w": "of", "b": [0.6493, 0.1472, 0.6703, 0.1669]}, {"w": "the", "b": [0.6766, 0.1472, 0.7074, 0.1669]}, {"w": "gradient", "b": [0.7137, 0.1472, 0.7964, 0.1669]}, {"w": "boosting", "b": [0.1294, 0.1677, 0.2163, 0.1874]}, {"w": "technique", "b": [0.2226, 0.1677, 0.3207, 0.1874]}, {"w": "results", "b": [0.327, 0.1677, 0.3929, 0.1874]}, {"w": "in", "b": [0.3992, 0.1677, 0.4188, 0.1874]}, {"w": "models", "b": [0.4251, 0.1677, 0.498, 0.1874]}, {"w": "that", "b": [0.5043, 0.1677, 0.5421, 0.1874]}, {"w": "strictly", "b": [0.5484, 0.1677, 0.6185, 0.1874]}, {"w": "outperform", "b": [0.6247, 0.1677, 0.7382, 0.1874]}, {"w": "random", "b": [0.7445, 0.1677, 0.8216, 0.1874]}, {"w": "forests", "b": [0.1294, 0.1882, 0.1967, 0.2079]}, {"w": "most", "b": [0.203, 0.1882, 0.252, 0.2079]}, {"w": "of", "b": [0.2583, 0.1882, 0.2794, 0.2079]}, {"w": "the", "b": [0.2857, 0.1882, 0.3165, 0.2079]}, {"w": "time,", "b": [0.3228, 0.1882, 0.374, 0.2079]}, {"w": "while", "b": [0.3803, 0.1882, 0.4363, 0.2079]}, {"w": "having", "b": [0.4426, 0.1882, 0.5113, 0.2079]}, {"w": "similar", "b": [0.5176, 0.1882, 0.5877, 0.2079]}, {"w": "properties.", "b": [0.594, 0.1882, 0.7012, 0.2079]}, {"w": "It", "b": [0.7075, 0.1882, 0.7229, 0.2079]}, {"w": "may", "b": [0.7292, 0.1882, 0.7726, 0.2079]}, {"w": "be", "b": [0.7789, 0.1882, 0.8027, 0.2079]}, {"w": "one", "b": [0.809, 0.1882, 0.8455, 0.2079]}, {"w": "of", "b": [0.1294, 0.2087, 0.1504, 0.2284]}, {"w": "the", "b": [0.1567, 0.2087, 0.1876, 0.2284]}, {"w": "best,", "b": [0.1939, 0.2087, 0.2408, 0.2284]}, {"w": "if", "b": [0.2471, 0.2087, 0.2625, 0.2284]}, {"w": "not", "b": [0.2688, 0.2087, 0.3011, 0.2284]}, {"w": "the", "b": [0.3074, 0.2087, 0.3382, 0.2284]}, {"w": "best,", "b": [0.3445, 0.2087, 0.3914, 0.2284]}, {"w": "algorithm", "b": [0.3977, 0.2087, 0.4958, 0.2284]}, {"w": "for", "b": [0.5021, 0.2087, 0.5315, 0.2284]}, {"w": "dealing", "b": [0.5378, 0.2087, 0.6121, 0.2284]}, {"w": "with", "b": [0.6184, 0.2087, 0.6633, 0.2284]}, {"w": "nonperceptual", "b": [0.6696, 0.2087, 0.8125, 0.2284]}, {"w": "data", "b": [0.8188, 0.2087, 0.8608, 0.2284]}, {"w": "today.", "b": [0.1294, 0.2292, 0.1901, 0.2489]}, {"w": "Alongside", "b": [0.1964, 0.2292, 0.3001, 0.2489]}, {"w": "deep", "b": [0.3064, 0.2292, 0.3541, 0.2489]}, {"w": "learning,", "b": [0.3604, 0.2292, 0.4493, 0.2489]}, {"w": "it’s", "b": [0.4557, 0.2292, 0.4865, 0.2489]}, {"w": "one", "b": [0.4928, 0.2292, 0.5292, 0.2489]}, {"w": "of", "b": [0.5355, 0.2292, 0.5565, 0.2489]}, {"w": "the", "b": [0.5628, 0.2292, 0.5936, 0.2489]}, {"w": "most", "b": [0.6, 0.2292, 0.649, 0.2489]}, {"w": "commonly", "b": [0.6553, 0.2292, 0.7632, 0.2489]}, {"w": "used", "b": [0.7695, 0.2292, 0.8158, 0.2489]}, {"w": "techniques", "b": [0.1294, 0.2497, 0.2373, 0.2694]}, {"w": "in", "b": [0.2436, 0.2497, 0.2632, 0.2694]}, {"w": "Kaggle", "b": [0.2695, 0.2497, 0.3424, 0.2694]}, {"w": "competitions.", "b": [0.3487, 0.2497, 0.4853, 0.2694]}]}, {"id": "b_1", "type": "paragraph", "text": "1.2.5. Back to neural networks", "words": [{"w": "1.2.5.", "b": [0.1294, 0.2969, 0.1862, 0.3167]}, {"w": "Back", "b": [0.1925, 0.2969, 0.2471, 0.3167]}, {"w": "to", "b": [0.2534, 0.2969, 0.2745, 0.3167]}, {"w": "neural", "b": [0.2808, 0.2969, 0.3508, 0.3167]}, {"w": "networks", "b": [0.3572, 0.2969, 0.4566, 0.3167]}]}, {"id": "b_2", "type": "paragraph", "text": "Around 2010, although neural networks were almost completely shunned by the scientific community at large, a number of people still working on neural networks started to make important breakthroughs: the groups of Geoffrey Hinton at the University of Toronto, Yoshua Bengio at the University of Montreal, Yann LeCun at New York University, and IDSIA in Switzerland.", "words": [{"w": "Around", "b": [0.1294, 0.3397, 0.2065, 0.3594]}, {"w": "2010,", "b": [0.2128, 0.3397, 0.2695, 0.3594]}, {"w": "although", "b": [0.2758, 0.3397, 0.3641, 0.3594]}, {"w": "neural", "b": [0.3704, 0.3397, 0.4335, 0.3594]}, {"w": "networks", "b": [0.4398, 0.3397, 0.5323, 0.3594]}, {"w": "were", "b": [0.5386, 0.3397, 0.5876, 0.3594]}, {"w": "almost", "b": [0.5939, 0.3397, 0.6612, 0.3594]}, {"w": "completely", "b": [0.6675, 0.3397, 0.7796, 0.3594]}, {"w": "shunned", "b": [0.7859, 0.3397, 0.87, 0.3594]}, {"w": "by", "b": [0.1294, 0.3602, 0.1546, 0.3799]}, {"w": "the", "b": [0.1609, 0.3602, 0.1918, 0.3799]}, {"w": "scientific", "b": [0.1981, 0.3602, 0.2906, 0.3799]}, {"w": "community", "b": [0.2969, 0.3602, 0.4118, 0.3799]}, {"w": "at", "b": [0.4181, 0.3602, 0.4363, 0.3799]}, {"w": "large,", "b": [0.4426, 0.3602, 0.4988, 0.3799]}, {"w": "a", "b": [0.5051, 0.3602, 0.5163, 0.3799]}, {"w": "number", "b": [0.5226, 0.3602, 0.5997, 0.3799]}, {"w": "of", "b": [0.606, 0.3602, 0.627, 0.3799]}, {"w": "people", "b": [0.6333, 0.3602, 0.7006, 0.3799]}, {"w": "still", "b": [0.7068, 0.3602, 0.7447, 0.3799]}, {"w": "working", "b": [0.751, 0.3602, 0.8351, 0.3799]}, {"w": "on", "b": [0.8414, 0.3602, 0.8666, 0.3799]}, {"w": "neural", "b": [0.1294, 0.3807, 0.1925, 0.4004]}, {"w": "networks", "b": [0.1988, 0.3807, 0.2912, 0.4004]}, {"w": "started", "b": [0.2975, 0.3807, 0.3648, 0.4004]}, {"w": "to", "b": [0.3711, 0.3807, 0.3907, 0.4004]}, {"w": "make", "b": [0.397, 0.3807, 0.4517, 0.4004]}, {"w": "important", "b": [0.458, 0.3807, 0.5561, 0.4004]}, {"w": "breakthroughs:", "b": [0.5624, 0.3807, 0.7137, 0.4004]}, {"w": "the", "b": [0.72, 0.3807, 0.7508, 0.4004]}, {"w": "groups", "b": [0.7572, 0.3807, 0.8258, 0.4004]}, {"w": "of", "b": [0.8321, 0.3807, 0.8531, 0.4004]}, {"w": "Geoffrey", "b": [0.1294, 0.4012, 0.22, 0.4209]}, {"w": "Hinton", "b": [0.2263, 0.4012, 0.2964, 0.4209]}, {"w": "at", "b": [0.3027, 0.4012, 0.3209, 0.4209]}, {"w": "the", "b": [0.3272, 0.4012, 0.358, 0.4209]}, {"w": "University", "b": [0.3643, 0.4012, 0.4708, 0.4209]}, {"w": "of", "b": [0.4771, 0.4012, 0.4981, 0.4209]}, {"w": "Toronto,", "b": [0.5044, 0.4012, 0.5903, 0.4209]}, {"w": "Yoshua", "b": [0.5966, 0.4012, 0.6711, 0.4209]}, {"w": "Bengio", "b": [0.6774, 0.4012, 0.7503, 0.4209]}, {"w": "at", "b": [0.7566, 0.4012, 0.7748, 0.4209]}, {"w": "the", "b": [0.7811, 0.4012, 0.8119, 0.4209]}, {"w": "University", "b": [0.1294, 0.4217, 0.2359, 0.4414]}, {"w": "of", "b": [0.2422, 0.4217, 0.2632, 0.4414]}, {"w": "Montreal,", "b": [0.2695, 0.4217, 0.3683, 0.4414]}, {"w": "Yann", "b": [0.3746, 0.4217, 0.4267, 0.4414]}, {"w": "LeCun", "b": [0.433, 0.4217, 0.5017, 0.4414]}, {"w": "at", "b": [0.508, 0.4217, 0.5262, 0.4414]}, {"w": "New", "b": [0.5325, 0.4217, 0.5802, 0.4414]}, {"w": "York", "b": [0.5865, 0.4217, 0.6358, 0.4414]}, {"w": "University,", "b": [0.6421, 0.4217, 0.7532, 0.4414]}, {"w": "and", "b": [0.7595, 0.4217, 0.796, 0.4414]}, {"w": "IDSIA", "b": [0.8023, 0.4217, 0.8695, 0.4414]}, {"w": "in", "b": [0.1294, 0.4422, 0.149, 0.4619]}, {"w": "Switzerland.", "b": [0.1553, 0.4422, 0.2822, 0.4619]}]}, {"id": "b_3", "type": "paragraph", "text": "In 2011, Dan Ciresan from IDSIA began to win academic image- classification competitions with GPU-trained deep neural networks—the first practical success of modern deep learning. But the watershed moment came in 2012, with the entry of Hinton’s group in the yearly large-scale image-classification challenge ImageNet. The ImageNet challenge was notoriously difficult at the time, consisting of classifying high-resolution color images into 1,000 different categories after training on 1.4 million images. In 2011, the top-five accuracy of the winning model, based on classical approaches to computer vision, was only 74.3%. Then, in 2012, a team led by Alex Krizhevsky and advised by Geoffrey Hinton was able to achieve a top-five accuracy of 83.6%—a significant breakthrough. The competition has been dominated by deep convolutional neural networks every year since. By 2015, the winner reached an accuracy of 96.4%, and the classification task on ImageNet was considered to be a completely solved problem.", "words": [{"w": "In", "b": [0.1294, 0.485, 0.1504, 0.5047]}, {"w": "2011,", "b": [0.1567, 0.485, 0.2126, 0.5047]}, {"w": "Dan", "b": [0.2189, 0.485, 0.2609, 0.5047]}, {"w": "Ciresan", "b": [0.2672, 0.485, 0.3443, 0.5047]}, {"w": "from", "b": [0.3506, 0.485, 0.3996, 0.5047]}, {"w": "IDSIA", "b": [0.4059, 0.485, 0.4732, 0.5047]}, {"w": "began", "b": [0.4795, 0.485, 0.5397, 0.5047]}, {"w": "to", "b": [0.546, 0.485, 0.5656, 0.5047]}, {"w": "win", "b": [0.5719, 0.485, 0.6098, 0.5047]}, {"w": "academic", "b": [0.6161, 0.485, 0.7113, 0.5047]}, {"w": "image-", "b": [0.7176, 0.485, 0.7877, 0.5047]}, {"w": "classification", "b": [0.1294, 0.5055, 0.2625, 0.5252]}, {"w": "competitions", "b": [0.2688, 0.5055, 0.3992, 0.5252]}, {"w": "with", "b": [0.4055, 0.5055, 0.4503, 0.5252]}, {"w": "GPU-trained", "b": [0.4566, 0.5055, 0.5855, 0.5252]}, {"w": "deep", "b": [0.5919, 0.5055, 0.6395, 0.5252]}, {"w": "neural", "b": [0.6458, 0.5055, 0.7088, 0.5252]}, {"w": "networks—the", "b": [0.7151, 0.5055, 0.8637, 0.5252]}, {"w": "first", "b": [0.1294, 0.526, 0.1701, 0.5457]}, {"w": "practical", "b": [0.1764, 0.526, 0.2632, 0.5457]}, {"w": "success", "b": [0.2695, 0.526, 0.3452, 0.5457]}, {"w": "of", "b": [0.3515, 0.526, 0.3725, 0.5457]}, {"w": "modern", "b": [0.3788, 0.526, 0.4559, 0.5457]}, {"w": "deep", "b": [0.4622, 0.526, 0.5098, 0.5457]}, {"w": "learning.", "b": [0.5161, 0.526, 0.6051, 0.5457]}, {"w": "But", "b": [0.6114, 0.526, 0.6478, 0.5457]}, {"w": "the", "b": [0.6541, 0.526, 0.685, 0.5457]}, {"w": "watershed", "b": [0.6913, 0.526, 0.7935, 0.5457]}, {"w": "moment", "b": [0.1294, 0.5465, 0.2121, 0.5662]}, {"w": "came", "b": [0.2184, 0.5465, 0.2716, 0.5662]}, {"w": "in", "b": [0.2779, 0.5465, 0.2976, 0.5662]}, {"w": "2012,", "b": [0.3039, 0.5465, 0.3606, 0.5662]}, {"w": "with", "b": [0.3669, 0.5465, 0.4118, 0.5662]}, {"w": "the", "b": [0.4181, 0.5465, 0.4489, 0.5662]}, {"w": "entry", "b": [0.4552, 0.5465, 0.5071, 0.5662]}, {"w": "of", "b": [0.5134, 0.5465, 0.5344, 0.5662]}, {"w": "Hinton’s", "b": [0.5407, 0.5465, 0.6275, 0.5662]}, {"w": "group", "b": [0.6338, 0.5465, 0.6927, 0.5662]}, {"w": "in", "b": [0.699, 0.5465, 0.7186, 0.5662]}, {"w": "the", "b": [0.7249, 0.5465, 0.7557, 0.5662]}, {"w": "yearly", "b": [0.762, 0.5465, 0.8251, 0.5662]}, {"w": "large-scale", "b": [0.1294, 0.567, 0.2382, 0.5867]}, {"w": "image-classification", "b": [0.2445, 0.567, 0.4477, 0.5867]}, {"w": "challenge", "b": [0.454, 0.567, 0.5506, 0.5867]}, {"w": "ImageNet.", "b": [0.557, 0.567, 0.6627, 0.5867]}, {"w": "The", "b": [0.669, 0.567, 0.7083, 0.5867]}, {"w": "ImageNet", "b": [0.7146, 0.567, 0.814, 0.5867]}, {"w": "challenge", "b": [0.1294, 0.5875, 0.2261, 0.6072]}, {"w": "was", "b": [0.2324, 0.5875, 0.2716, 0.6072]}, {"w": "notoriously", "b": [0.2779, 0.5875, 0.3928, 0.6072]}, {"w": "difficult", "b": [0.3992, 0.5875, 0.4799, 0.6072]}, {"w": "at", "b": [0.4862, 0.5875, 0.5045, 0.6072]}, {"w": "the", "b": [0.5108, 0.5875, 0.5416, 0.6072]}, {"w": "time,", "b": [0.5479, 0.5875, 0.5991, 0.6072]}, {"w": "consisting", "b": [0.6053, 0.5875, 0.7076, 0.6072]}, {"w": "of", "b": [0.7139, 0.5875, 0.7349, 0.6072]}, {"w": "classifying", "b": [0.7413, 0.5875, 0.8506, 0.6072]}, {"w": "high-resolution", "b": [0.1294, 0.608, 0.2836, 0.6277]}, {"w": "color", "b": [0.2899, 0.608, 0.3417, 0.6277]}, {"w": "images", "b": [0.348, 0.608, 0.4195, 0.6277]}, {"w": "into", "b": [0.4258, 0.608, 0.465, 0.6277]}, {"w": "1,000", "b": [0.4713, 0.608, 0.5281, 0.6277]}, {"w": "different", "b": [0.5344, 0.608, 0.6208, 0.6277]}, {"w": "categories", "b": [0.6271, 0.608, 0.7293, 0.6277]}, {"w": "after", "b": [0.7356, 0.608, 0.7819, 0.6277]}, {"w": "training", "b": [0.7882, 0.608, 0.8666, 0.6277]}, {"w": "on", "b": [0.1294, 0.6285, 0.1546, 0.6482]}, {"w": "1.4", "b": [0.1609, 0.6285, 0.1925, 0.6482]}, {"w": "million", "b": [0.1988, 0.6285, 0.2717, 0.6482]}, {"w": "images.", "b": [0.278, 0.6285, 0.3558, 0.6482]}, {"w": "In", "b": [0.362, 0.6285, 0.383, 0.6482]}, {"w": "2011,", "b": [0.3893, 0.6285, 0.4452, 0.6482]}, {"w": "the", "b": [0.4515, 0.6285, 0.4823, 0.6482]}, {"w": "top-five", "b": [0.4886, 0.6285, 0.5685, 0.6482]}, {"w": "accuracy", "b": [0.5748, 0.6285, 0.6644, 0.6482]}, {"w": "of", "b": [0.6707, 0.6285, 0.6917, 0.6482]}, {"w": "the", "b": [0.698, 0.6285, 0.7289, 0.6482]}, {"w": "winning", "b": [0.7352, 0.6285, 0.8178, 0.6482]}, {"w": "model,", "b": [0.1294, 0.649, 0.1988, 0.6687]}, {"w": "based", "b": [0.2051, 0.649, 0.2625, 0.6687]}, {"w": "on", "b": [0.2688, 0.649, 0.2941, 0.6687]}, {"w": "classical", "b": [0.3004, 0.649, 0.3858, 0.6687]}, {"w": "approaches", "b": [0.3921, 0.649, 0.5056, 0.6687]}, {"w": "to", "b": [0.5119, 0.649, 0.5315, 0.6687]}, {"w": "computer", "b": [0.5378, 0.649, 0.6331, 0.6687]}, {"w": "vision,", "b": [0.6394, 0.649, 0.7074, 0.6687]}, {"w": "was", "b": [0.7137, 0.649, 0.7529, 0.6687]}, {"w": "only", "b": [0.7592, 0.649, 0.8041, 0.6687]}, {"w": "74.3%.", "b": [0.1294, 0.6695, 0.2009, 0.6892]}, {"w": "Then,", "b": [0.2072, 0.6695, 0.2653, 0.6892]}, {"w": "in", "b": [0.2716, 0.6695, 0.2912, 0.6892]}, {"w": "2012,", "b": [0.2976, 0.6695, 0.3543, 0.6892]}, {"w": "a", "b": [0.3606, 0.6695, 0.3718, 0.6892]}, {"w": "team", "b": [0.3781, 0.6695, 0.4272, 0.6892]}, {"w": "led", "b": [0.4335, 0.6695, 0.4643, 0.6892]}, {"w": "by", "b": [0.4706, 0.6695, 0.4958, 0.6892]}, {"w": "Alex", "b": [0.5021, 0.6695, 0.5512, 0.6892]}, {"w": "Krizhevsky", "b": [0.5575, 0.6695, 0.6738, 0.6892]}, {"w": "and", "b": [0.6801, 0.6695, 0.7165, 0.6892]}, {"w": "advised", "b": [0.7228, 0.6695, 0.7999, 0.6892]}, {"w": "by", "b": [0.8062, 0.6695, 0.8314, 0.6892]}, {"w": "Geoffrey", "b": [0.1294, 0.69, 0.22, 0.7097]}, {"w": "Hinton", "b": [0.2263, 0.69, 0.2964, 0.7097]}, {"w": "was", "b": [0.3027, 0.69, 0.3419, 0.7097]}, {"w": "able", "b": [0.3482, 0.69, 0.3902, 0.7097]}, {"w": "to", "b": [0.3966, 0.69, 0.4162, 0.7097]}, {"w": "achieve", "b": [0.4225, 0.69, 0.4995, 0.7097]}, {"w": "a", "b": [0.5058, 0.69, 0.517, 0.7097]}, {"w": "top-five", "b": [0.5233, 0.69, 0.6032, 0.7097]}, {"w": "accuracy", "b": [0.6095, 0.69, 0.6991, 0.7097]}, {"w": "of", "b": [0.7054, 0.69, 0.7265, 0.7097]}, {"w": "83.6%—a", "b": [0.7328, 0.69, 0.8343, 0.7097]}, {"w": "significant", "b": [0.1294, 0.7105, 0.2359, 0.7302]}, {"w": "breakthrough.", "b": [0.2422, 0.7105, 0.383, 0.7302]}, {"w": "The", "b": [0.3893, 0.7105, 0.4285, 0.7302]}, {"w": "competition", "b": [0.4348, 0.7105, 0.5554, 0.7302]}, {"w": "has", "b": [0.5617, 0.7105, 0.5953, 0.7302]}, {"w": "been", "b": [0.6016, 0.7105, 0.6492, 0.7302]}, {"w": "dominated", "b": [0.6555, 0.7105, 0.7621, 0.7302]}, {"w": "by", "b": [0.7684, 0.7105, 0.7936, 0.7302]}, {"w": "deep", "b": [0.7999, 0.7105, 0.8475, 0.7302]}, {"w": "convolutional", "b": [0.1294, 0.731, 0.2682, 0.7507]}, {"w": "neural", "b": [0.2745, 0.731, 0.3375, 0.7507]}, {"w": "networks", "b": [0.3438, 0.731, 0.4363, 0.7507]}, {"w": "every", "b": [0.4426, 0.731, 0.4986, 0.7507]}, {"w": "year", "b": [0.5049, 0.731, 0.5483, 0.7507]}, {"w": "since.", "b": [0.5546, 0.731, 0.6128, 0.7507]}, {"w": "By", "b": [0.6191, 0.731, 0.6485, 0.7507]}, {"w": "2015,", "b": [0.6548, 0.731, 0.7116, 0.7507]}, {"w": "the", "b": [0.7179, 0.731, 0.7487, 0.7507]}, {"w": "winner", "b": [0.755, 0.731, 0.8251, 0.7507]}, {"w": "reached", "b": [0.1294, 0.7515, 0.2078, 0.7712]}, {"w": "an", "b": [0.2141, 0.7515, 0.238, 0.7712]}, {"w": "accuracy", "b": [0.2443, 0.7515, 0.3339, 0.7712]}, {"w": "of", "b": [0.3402, 0.7515, 0.3612, 0.7712]}, {"w": "96.4%,", "b": [0.3675, 0.7515, 0.439, 0.7712]}, {"w": "and", "b": [0.4453, 0.7515, 0.4817, 0.7712]}, {"w": "the", "b": [0.488, 0.7515, 0.5188, 0.7712]}, {"w": "classification", "b": [0.5252, 0.7515, 0.6583, 0.7712]}, {"w": "task", "b": [0.6646, 0.7515, 0.7052, 0.7712]}, {"w": "on", "b": [0.7115, 0.7515, 0.7367, 0.7712]}, {"w": "ImageNet", "b": [0.7431, 0.7515, 0.8425, 0.7712]}, {"w": "was", "b": [0.1294, 0.772, 0.1686, 0.7917]}, {"w": "considered", "b": [0.1749, 0.772, 0.2842, 0.7917]}, {"w": "to", "b": [0.2905, 0.772, 0.3102, 0.7917]}, {"w": "be", "b": [0.3165, 0.772, 0.3403, 0.7917]}, {"w": "a", "b": [0.3466, 0.772, 0.3578, 0.7917]}, {"w": "completely", "b": [0.3641, 0.772, 0.4762, 0.7917]}, {"w": "solved", "b": [0.4825, 0.772, 0.5484, 0.7917]}, {"w": "problem.", "b": [0.5547, 0.772, 0.6451, 0.7917]}]}, {"id": "b_4", "type": "paragraph", "text": "Since 2012, deep convolutional neural networks (convnets) have become the go-to algorithm for all computer vision tasks; more generally, they work on all perceptual tasks. At major computer vision conferences in 2015 and 2016, it was nearly impossible to find presentations that didn’t", "words": [{"w": "Since", "b": [0.1294, 0.8148, 0.1855, 0.8345]}, {"w": "2012,", "b": [0.1918, 0.8148, 0.2485, 0.8345]}, {"w": "deep", "b": [0.2548, 0.8148, 0.3025, 0.8345]}, {"w": "convolutional", "b": [0.3088, 0.8148, 0.4475, 0.8345]}, {"w": "neural", "b": [0.4538, 0.8148, 0.5169, 0.8345]}, {"w": "networks", "b": [0.5232, 0.8148, 0.6156, 0.8345]}, {"w": "(convnets)", "b": [0.6219, 0.8148, 0.7269, 0.8345]}, {"w": "have", "b": [0.7332, 0.8148, 0.7809, 0.8345]}, {"w": "become", "b": [0.7872, 0.8148, 0.8656, 0.8345]}, {"w": "the", "b": [0.1294, 0.8353, 0.1602, 0.855]}, {"w": "go-to", "b": [0.1665, 0.8353, 0.2198, 0.855]}, {"w": "algorithm", "b": [0.2261, 0.8353, 0.3242, 0.855]}, {"w": "for", "b": [0.3305, 0.8353, 0.3599, 0.855]}, {"w": "all", "b": [0.3662, 0.8353, 0.3915, 0.855]}, {"w": "computer", "b": [0.3978, 0.8353, 0.493, 0.855]}, {"w": "vision", "b": [0.4993, 0.8353, 0.561, 0.855]}, {"w": "tasks;", "b": [0.5673, 0.8353, 0.6248, 0.855]}, {"w": "more", "b": [0.6311, 0.8353, 0.6829, 0.855]}, {"w": "generally,", "b": [0.6892, 0.8353, 0.7877, 0.855]}, {"w": "they", "b": [0.794, 0.8353, 0.8374, 0.855]}, {"w": "work", "b": [0.1294, 0.8558, 0.1813, 0.8755]}, {"w": "on", "b": [0.1876, 0.8558, 0.2128, 0.8755]}, {"w": "all", "b": [0.2191, 0.8558, 0.2443, 0.8755]}, {"w": "perceptual", "b": [0.2506, 0.8558, 0.3557, 0.8755]}, {"w": "tasks.", "b": [0.362, 0.8558, 0.4188, 0.8755]}, {"w": "At", "b": [0.4251, 0.8558, 0.4503, 0.8755]}, {"w": "major", "b": [0.4566, 0.8558, 0.5154, 0.8755]}, {"w": "computer", "b": [0.5217, 0.8558, 0.617, 0.8755]}, {"w": "vision", "b": [0.6233, 0.8558, 0.685, 0.8755]}, {"w": "conferences", "b": [0.6913, 0.8558, 0.8117, 0.8755]}, {"w": "in", "b": [0.818, 0.8558, 0.8376, 0.8755]}, {"w": "2015", "b": [0.1294, 0.8763, 0.1799, 0.896]}, {"w": "and", "b": [0.1862, 0.8763, 0.2226, 0.896]}, {"w": "2016,", "b": [0.2289, 0.8763, 0.2857, 0.896]}, {"w": "it", "b": [0.292, 0.8763, 0.306, 0.896]}, {"w": "was", "b": [0.3123, 0.8763, 0.3515, 0.896]}, {"w": "nearly", "b": [0.3578, 0.8763, 0.4209, 0.896]}, {"w": "impossible", "b": [0.4272, 0.8763, 0.5365, 0.896]}, {"w": "to", "b": [0.5428, 0.8763, 0.5624, 0.896]}, {"w": "find", "b": [0.5687, 0.8763, 0.6094, 0.896]}, {"w": "presentations", "b": [0.6157, 0.8763, 0.7488, 0.896]}, {"w": "that", "b": [0.7551, 0.8763, 0.793, 0.896]}, {"w": "didn’t", "b": [0.7993, 0.8763, 0.859, 0.896]}]}]}, {"page": 49, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "involve convnets in some form. At the same time, deep learning has also found applications in many other types of problems, such as natural- language processing. It has completely replaced SVMs and decision trees in a wide range of applications. For instance, for several years, the European Organization for Nuclear Research, CERN, used decision tree– based methods for analysis of particle data from the ATLAS detector at the Large Hadron Collider (LHC); but CERN eventually switched to Keras-based deep neural networks due to their higher performance and ease of training on large datasets.", "words": [{"w": "involve", "b": [0.1294, 0.0857, 0.2051, 0.1054]}, {"w": "convnets", "b": [0.2114, 0.0857, 0.3011, 0.1054]}, {"w": "in", "b": [0.3074, 0.0857, 0.327, 0.1054]}, {"w": "some", "b": [0.3333, 0.0857, 0.3865, 0.1054]}, {"w": "form.", "b": [0.3928, 0.0857, 0.4482, 0.1054]}, {"w": "At", "b": [0.4545, 0.0857, 0.4797, 0.1054]}, {"w": "the", "b": [0.486, 0.0857, 0.5169, 0.1054]}, {"w": "same", "b": [0.5232, 0.0857, 0.575, 0.1054]}, {"w": "time,", "b": [0.5813, 0.0857, 0.6325, 0.1054]}, {"w": "deep", "b": [0.6388, 0.0857, 0.6864, 0.1054]}, {"w": "learning", "b": [0.6927, 0.0857, 0.7754, 0.1054]}, {"w": "has", "b": [0.7817, 0.0857, 0.8153, 0.1054]}, {"w": "also", "b": [0.8216, 0.0857, 0.8622, 0.1054]}, {"w": "found", "b": [0.1294, 0.1062, 0.1883, 0.1259]}, {"w": "applications", "b": [0.1946, 0.1062, 0.3165, 0.1259]}, {"w": "in", "b": [0.3228, 0.1062, 0.3424, 0.1259]}, {"w": "many", "b": [0.3487, 0.1062, 0.4048, 0.1259]}, {"w": "other", "b": [0.4111, 0.1062, 0.4629, 0.1259]}, {"w": "types", "b": [0.4692, 0.1062, 0.5225, 0.1259]}, {"w": "of", "b": [0.5288, 0.1062, 0.5498, 0.1259]}, {"w": "problems,", "b": [0.5561, 0.1062, 0.6563, 0.1259]}, {"w": "such", "b": [0.6626, 0.1062, 0.7088, 0.1259]}, {"w": "as", "b": [0.7152, 0.1062, 0.7362, 0.1259]}, {"w": "natural-", "b": [0.7425, 0.1062, 0.8209, 0.1259]}, {"w": "language", "b": [0.1294, 0.1267, 0.2205, 0.1464]}, {"w": "processing.", "b": [0.2268, 0.1267, 0.341, 0.1464]}, {"w": "It", "b": [0.3473, 0.1267, 0.3627, 0.1464]}, {"w": "has", "b": [0.369, 0.1267, 0.4026, 0.1464]}, {"w": "completely", "b": [0.4089, 0.1267, 0.521, 0.1464]}, {"w": "replaced", "b": [0.5273, 0.1267, 0.6128, 0.1464]}, {"w": "SVMs", "b": [0.6191, 0.1267, 0.6836, 0.1464]}, {"w": "and", "b": [0.6899, 0.1267, 0.7263, 0.1464]}, {"w": "decision", "b": [0.7326, 0.1267, 0.8167, 0.1464]}, {"w": "trees", "b": [0.823, 0.1267, 0.8706, 0.1464]}, {"w": "in", "b": [0.1294, 0.1472, 0.149, 0.1669]}, {"w": "a", "b": [0.1553, 0.1472, 0.1665, 0.1669]}, {"w": "wide", "b": [0.1729, 0.1472, 0.2219, 0.1669]}, {"w": "range", "b": [0.2282, 0.1472, 0.2842, 0.1669]}, {"w": "of", "b": [0.2905, 0.1472, 0.3115, 0.1669]}, {"w": "applications.", "b": [0.3178, 0.1472, 0.4461, 0.1669]}, {"w": "For", "b": [0.4524, 0.1472, 0.4874, 0.1669]}, {"w": "instance,", "b": [0.4937, 0.1472, 0.5827, 0.1669]}, {"w": "for", "b": [0.589, 0.1472, 0.6184, 0.1669]}, {"w": "several", "b": [0.6247, 0.1472, 0.6962, 0.1669]}, {"w": "years,", "b": [0.7024, 0.1472, 0.7619, 0.1669]}, {"w": "the", "b": [0.7682, 0.1472, 0.7991, 0.1669]}, {"w": "European", "b": [0.1294, 0.1677, 0.2261, 0.1874]}, {"w": "Organization", "b": [0.2324, 0.1677, 0.3636, 0.1874]}, {"w": "for", "b": [0.3699, 0.1677, 0.3993, 0.1874]}, {"w": "Nuclear", "b": [0.4057, 0.1677, 0.4855, 0.1874]}, {"w": "Research,", "b": [0.4918, 0.1677, 0.5906, 0.1874]}, {"w": "CERN,", "b": [0.5969, 0.1677, 0.6704, 0.1874]}, {"w": "used", "b": [0.6768, 0.1677, 0.723, 0.1874]}, {"w": "decision", "b": [0.7293, 0.1677, 0.8134, 0.1874]}, {"w": "tree–", "b": [0.8197, 0.1677, 0.8701, 0.1874]}, {"w": "based", "b": [0.1294, 0.1882, 0.1869, 0.2079]}, {"w": "methods", "b": [0.1932, 0.1882, 0.2786, 0.2079]}, {"w": "for", "b": [0.285, 0.1882, 0.3144, 0.2079]}, {"w": "analysis", "b": [0.3207, 0.1882, 0.402, 0.2079]}, {"w": "of", "b": [0.4083, 0.1882, 0.4293, 0.2079]}, {"w": "particle", "b": [0.4356, 0.1882, 0.5112, 0.2079]}, {"w": "data", "b": [0.5175, 0.1882, 0.5596, 0.2079]}, {"w": "from", "b": [0.5658, 0.1882, 0.6148, 0.2079]}, {"w": "the", "b": [0.6211, 0.1882, 0.652, 0.2079]}, {"w": "ATLAS", "b": [0.6583, 0.1882, 0.7367, 0.2079]}, {"w": "detector", "b": [0.7431, 0.1882, 0.8243, 0.2079]}, {"w": "at", "b": [0.8306, 0.1882, 0.8488, 0.2079]}, {"w": "the", "b": [0.1294, 0.2087, 0.1602, 0.2284]}, {"w": "Large", "b": [0.1665, 0.2087, 0.2249, 0.2284]}, {"w": "Hadron", "b": [0.2312, 0.2087, 0.3069, 0.2284]}, {"w": "Collider", "b": [0.3132, 0.2087, 0.3959, 0.2284]}, {"w": "(LHC);", "b": [0.4022, 0.2087, 0.4764, 0.2284]}, {"w": "but", "b": [0.4827, 0.2087, 0.515, 0.2284]}, {"w": "CERN", "b": [0.5213, 0.2087, 0.5886, 0.2284]}, {"w": "eventually", "b": [0.5949, 0.2087, 0.7, 0.2284]}, {"w": "switched", "b": [0.7063, 0.2087, 0.7959, 0.2284]}, {"w": "to", "b": [0.8022, 0.2087, 0.8219, 0.2284]}, {"w": "Keras-based", "b": [0.1294, 0.2292, 0.2541, 0.2489]}, {"w": "deep", "b": [0.2604, 0.2292, 0.308, 0.2489]}, {"w": "neural", "b": [0.3143, 0.2292, 0.3774, 0.2489]}, {"w": "networks", "b": [0.3837, 0.2292, 0.4761, 0.2489]}, {"w": "due", "b": [0.4824, 0.2292, 0.5188, 0.2489]}, {"w": "to", "b": [0.5251, 0.2292, 0.5448, 0.2489]}, {"w": "their", "b": [0.5511, 0.2292, 0.5973, 0.2489]}, {"w": "higher", "b": [0.6036, 0.2292, 0.6681, 0.2489]}, {"w": "performance", "b": [0.6744, 0.2292, 0.8018, 0.2489]}, {"w": "and", "b": [0.8082, 0.2292, 0.8446, 0.2489]}, {"w": "ease", "b": [0.1294, 0.2497, 0.1728, 0.2694]}, {"w": "of", "b": [0.1791, 0.2497, 0.2001, 0.2694]}, {"w": "training", "b": [0.2065, 0.2497, 0.2849, 0.2694]}, {"w": "on", "b": [0.2912, 0.2497, 0.3165, 0.2694]}, {"w": "large", "b": [0.3228, 0.2497, 0.3727, 0.2694]}, {"w": "datasets.", "b": [0.379, 0.2497, 0.4652, 0.2694]}]}, {"id": "b_1", "type": "paragraph", "text": "1.2.6. What makes deep learning different", "words": [{"w": "1.2.6.", "b": [0.1294, 0.2969, 0.1862, 0.3167]}, {"w": "What", "b": [0.1925, 0.2969, 0.2527, 0.3167]}, {"w": "makes", "b": [0.259, 0.2969, 0.3277, 0.3167]}, {"w": "deep", "b": [0.334, 0.2969, 0.3845, 0.3167]}, {"w": "learning", "b": [0.3908, 0.2969, 0.4805, 0.3167]}, {"w": "different", "b": [0.4868, 0.2969, 0.5802, 0.3167]}]}, {"id": "b_2", "type": "paragraph", "text": "The primary reason deep learning took off so quickly is that it offered better performance on many problems. But that’s not the only reason. Deep learning also makes problem-solving much easier, because it completely automates what used to be the most crucial step in a machine-learning workflow: feature engineering.", "words": [{"w": "The", "b": [0.1294, 0.3397, 0.1686, 0.3594]}, {"w": "primary", "b": [0.1749, 0.3397, 0.2548, 0.3594]}, {"w": "reason", "b": [0.2611, 0.3397, 0.327, 0.3594]}, {"w": "deep", "b": [0.3333, 0.3397, 0.3809, 0.3594]}, {"w": "learning", "b": [0.3872, 0.3397, 0.4699, 0.3594]}, {"w": "took", "b": [0.4762, 0.3397, 0.521, 0.3594]}, {"w": "off", "b": [0.5273, 0.3397, 0.5562, 0.3594]}, {"w": "so", "b": [0.5625, 0.3397, 0.585, 0.3594]}, {"w": "quickly", "b": [0.5913, 0.3397, 0.6669, 0.3594]}, {"w": "is", "b": [0.6733, 0.3397, 0.6901, 0.3594]}, {"w": "that", "b": [0.6964, 0.3397, 0.7342, 0.3594]}, {"w": "it", "b": [0.7405, 0.3397, 0.7546, 0.3594]}, {"w": "offered", "b": [0.7609, 0.3397, 0.8332, 0.3594]}, {"w": "better", "b": [0.1294, 0.3602, 0.1869, 0.3799]}, {"w": "performance", "b": [0.1932, 0.3602, 0.3206, 0.3799]}, {"w": "on", "b": [0.3269, 0.3602, 0.3522, 0.3799]}, {"w": "many", "b": [0.3585, 0.3602, 0.4145, 0.3799]}, {"w": "problems.", "b": [0.4208, 0.3602, 0.521, 0.3799]}, {"w": "But", "b": [0.5273, 0.3602, 0.5638, 0.3799]}, {"w": "that’s", "b": [0.5701, 0.3602, 0.6247, 0.3799]}, {"w": "not", "b": [0.631, 0.3602, 0.6632, 0.3799]}, {"w": "the", "b": [0.6695, 0.3602, 0.7003, 0.3799]}, {"w": "only", "b": [0.7067, 0.3602, 0.7515, 0.3799]}, {"w": "reason.", "b": [0.7578, 0.3602, 0.83, 0.3799]}, {"w": "Deep", "b": [0.1294, 0.3807, 0.1826, 0.4004]}, {"w": "learning", "b": [0.1889, 0.3807, 0.2716, 0.4004]}, {"w": "also", "b": [0.2779, 0.3807, 0.3186, 0.4004]}, {"w": "makes", "b": [0.3249, 0.3807, 0.3893, 0.4004]}, {"w": "problem-solving", "b": [0.3956, 0.3807, 0.5624, 0.4004]}, {"w": "much", "b": [0.5687, 0.3807, 0.6247, 0.4004]}, {"w": "easier,", "b": [0.631, 0.3807, 0.6951, 0.4004]}, {"w": "because", "b": [0.7014, 0.3807, 0.7812, 0.4004]}, {"w": "it", "b": [0.7876, 0.3807, 0.8016, 0.4004]}, {"w": "completely", "b": [0.1294, 0.4012, 0.2415, 0.4209]}, {"w": "automates", "b": [0.2478, 0.4012, 0.3501, 0.4209]}, {"w": "what", "b": [0.3564, 0.4012, 0.4055, 0.4209]}, {"w": "used", "b": [0.4118, 0.4012, 0.458, 0.4209]}, {"w": "to", "b": [0.4643, 0.4012, 0.4839, 0.4209]}, {"w": "be", "b": [0.4902, 0.4012, 0.5141, 0.4209]}, {"w": "the", "b": [0.5204, 0.4012, 0.5512, 0.4209]}, {"w": "most", "b": [0.5575, 0.4012, 0.6066, 0.4209]}, {"w": "crucial", "b": [0.6129, 0.4012, 0.6815, 0.4209]}, {"w": "step", "b": [0.6878, 0.4012, 0.7284, 0.4209]}, {"w": "in", "b": [0.7348, 0.4012, 0.7544, 0.4209]}, {"w": "a", "b": [0.7607, 0.4012, 0.7719, 0.4209]}, {"w": "machine-learning", "b": [0.1294, 0.4217, 0.3059, 0.4414]}, {"w": "workflow:", "b": [0.3122, 0.4217, 0.4173, 0.4414]}, {"w": "feature", "b": [0.4236, 0.4217, 0.4936, 0.4414]}, {"w": "engineering.", "b": [0.4999, 0.4217, 0.6253, 0.4414]}]}, {"id": "b_3", "type": "paragraph", "text": "Previous machine-learning techniques—shallow learning—only involved transforming the input data into one or two successive representation spaces, usually via simple transformations such as high- dimensional non-linear projections (SVMs) or decision trees. But the refined representations required by complex problems generally can’t be attained by such techniques. As such, humans had to go to great lengths to make the initial input data more amenable to processing by these methods: they had to manually engineer good layers of representations for their data. This is called feature engineering. Deep learning, on the other hand, completely automates this step: with deep learning, you learn all features in one pass rather than having to engineer them yourself. This has greatly simplified machine-learning workflows, often replacing sophisticated multistage pipelines with a single, simple, end-to-end deep- learning model.", "words": [{"w": "Previous", "b": [0.1294, 0.4645, 0.2177, 0.4842]}, {"w": "machine-learning", "b": [0.224, 0.4645, 0.4005, 0.4842]}, {"w": "techniques—shallow", "b": [0.4068, 0.4645, 0.6184, 0.4842]}, {"w": "learning—only", "b": [0.6247, 0.4645, 0.7775, 0.4842]}, {"w": "involved", "b": [0.1294, 0.485, 0.2177, 0.5047]}, {"w": "transforming", "b": [0.224, 0.485, 0.3543, 0.5047]}, {"w": "the", "b": [0.3606, 0.485, 0.3915, 0.5047]}, {"w": "input", "b": [0.3978, 0.485, 0.4496, 0.5047]}, {"w": "data", "b": [0.4559, 0.485, 0.498, 0.5047]}, {"w": "into", "b": [0.5043, 0.485, 0.5435, 0.5047]}, {"w": "one", "b": [0.5498, 0.485, 0.5863, 0.5047]}, {"w": "or", "b": [0.5926, 0.485, 0.6136, 0.5047]}, {"w": "two", "b": [0.6199, 0.485, 0.6577, 0.5047]}, {"w": "successive", "b": [0.664, 0.485, 0.7705, 0.5047]}, {"w": "representation", "b": [0.1294, 0.5055, 0.2723, 0.5252]}, {"w": "spaces,", "b": [0.2786, 0.5055, 0.3508, 0.5252]}, {"w": "usually", "b": [0.3571, 0.5055, 0.43, 0.5252]}, {"w": "via", "b": [0.4363, 0.5055, 0.4671, 0.5252]}, {"w": "simple", "b": [0.4734, 0.5055, 0.5407, 0.5252]}, {"w": "transformations", "b": [0.547, 0.5055, 0.7053, 0.5252]}, {"w": "such", "b": [0.7116, 0.5055, 0.7579, 0.5252]}, {"w": "as", "b": [0.7642, 0.5055, 0.7852, 0.5252]}, {"w": "high-", "b": [0.7915, 0.5055, 0.8447, 0.5252]}, {"w": "dimensional", "b": [0.1294, 0.526, 0.2527, 0.5457]}, {"w": "non-linear", "b": [0.259, 0.526, 0.3627, 0.5457]}, {"w": "projections", "b": [0.369, 0.526, 0.4811, 0.5457]}, {"w": "(SVMs)", "b": [0.4874, 0.526, 0.5687, 0.5457]}, {"w": "or", "b": [0.575, 0.526, 0.596, 0.5457]}, {"w": "decision", "b": [0.6023, 0.526, 0.6864, 0.5457]}, {"w": "trees.", "b": [0.6927, 0.526, 0.7466, 0.5457]}, {"w": "But", "b": [0.7529, 0.526, 0.7894, 0.5457]}, {"w": "the", "b": [0.7957, 0.526, 0.8265, 0.5457]}, {"w": "refined", "b": [0.1294, 0.5465, 0.2009, 0.5662]}, {"w": "representations", "b": [0.2072, 0.5465, 0.3599, 0.5662]}, {"w": "required", "b": [0.3662, 0.5465, 0.4502, 0.5662]}, {"w": "by", "b": [0.4565, 0.5465, 0.4818, 0.5662]}, {"w": "complex", "b": [0.4881, 0.5465, 0.5749, 0.5662]}, {"w": "problems", "b": [0.5813, 0.5465, 0.6751, 0.5662]}, {"w": "generally", "b": [0.6815, 0.5465, 0.7753, 0.5662]}, {"w": "can’t", "b": [0.7816, 0.5465, 0.8315, 0.5662]}, {"w": "be", "b": [0.8378, 0.5465, 0.8616, 0.5662]}, {"w": "attained", "b": [0.1294, 0.567, 0.2093, 0.5867]}, {"w": "by", "b": [0.2156, 0.567, 0.2408, 0.5867]}, {"w": "such", "b": [0.2471, 0.567, 0.2934, 0.5867]}, {"w": "techniques.", "b": [0.2997, 0.567, 0.4139, 0.5867]}, {"w": "As", "b": [0.4202, 0.567, 0.4482, 0.5867]}, {"w": "such,", "b": [0.4545, 0.567, 0.507, 0.5867]}, {"w": "humans", "b": [0.5133, 0.567, 0.5918, 0.5867]}, {"w": "had", "b": [0.5981, 0.567, 0.6345, 0.5867]}, {"w": "to", "b": [0.6408, 0.567, 0.6605, 0.5867]}, {"w": "go", "b": [0.6668, 0.567, 0.692, 0.5867]}, {"w": "to", "b": [0.6983, 0.567, 0.7179, 0.5867]}, {"w": "great", "b": [0.7242, 0.567, 0.7747, 0.5867]}, {"w": "lengths", "b": [0.781, 0.567, 0.8538, 0.5867]}, {"w": "to", "b": [0.1294, 0.5875, 0.149, 0.6072]}, {"w": "make", "b": [0.1553, 0.5875, 0.21, 0.6072]}, {"w": "the", "b": [0.2163, 0.5875, 0.2471, 0.6072]}, {"w": "initial", "b": [0.2534, 0.5875, 0.3123, 0.6072]}, {"w": "input", "b": [0.3186, 0.5875, 0.3705, 0.6072]}, {"w": "data", "b": [0.3768, 0.5875, 0.4188, 0.6072]}, {"w": "more", "b": [0.4251, 0.5875, 0.4769, 0.6072]}, {"w": "amenable", "b": [0.4833, 0.5875, 0.5799, 0.6072]}, {"w": "to", "b": [0.5862, 0.5875, 0.6059, 0.6072]}, {"w": "processing", "b": [0.6122, 0.5875, 0.72, 0.6072]}, {"w": "by", "b": [0.7264, 0.5875, 0.7516, 0.6072]}, {"w": "these", "b": [0.7579, 0.5875, 0.8097, 0.6072]}, {"w": "methods:", "b": [0.1294, 0.608, 0.2219, 0.6277]}, {"w": "they", "b": [0.2282, 0.608, 0.2717, 0.6277]}, {"w": "had", "b": [0.278, 0.608, 0.3144, 0.6277]}, {"w": "to", "b": [0.3207, 0.608, 0.3403, 0.6277]}, {"w": "manually", "b": [0.3466, 0.608, 0.4405, 0.6277]}, {"w": "engineer", "b": [0.4468, 0.608, 0.5336, 0.6277]}, {"w": "good", "b": [0.5399, 0.608, 0.5904, 0.6277]}, {"w": "layers", "b": [0.5967, 0.608, 0.6569, 0.6277]}, {"w": "of", "b": [0.6632, 0.608, 0.6843, 0.6277]}, {"w": "representations", "b": [0.6906, 0.608, 0.8433, 0.6277]}, {"w": "for", "b": [0.1294, 0.6285, 0.1588, 0.6482]}, {"w": "their", "b": [0.1651, 0.6285, 0.2114, 0.6482]}, {"w": "data.", "b": [0.2177, 0.6285, 0.266, 0.6482]}, {"w": "This", "b": [0.2723, 0.6285, 0.3172, 0.6482]}, {"w": "is", "b": [0.3235, 0.6285, 0.3403, 0.6482]}, {"w": "called", "b": [0.3466, 0.6285, 0.4068, 0.6482]}, {"w": "feature", "b": [0.4131, 0.6285, 0.4836, 0.6482]}, {"w": "engineering.", "b": [0.4899, 0.6285, 0.6167, 0.6482]}, {"w": "Deep", "b": [0.623, 0.6285, 0.6762, 0.6482]}, {"w": "learning,", "b": [0.6825, 0.6285, 0.7715, 0.6482]}, {"w": "on", "b": [0.7778, 0.6285, 0.803, 0.6482]}, {"w": "the", "b": [0.8094, 0.6285, 0.8402, 0.6482]}, {"w": "other", "b": [0.1294, 0.649, 0.1813, 0.6687]}, {"w": "hand,", "b": [0.1876, 0.649, 0.2429, 0.6687]}, {"w": "completely", "b": [0.2492, 0.649, 0.3613, 0.6687]}, {"w": "automates", "b": [0.3676, 0.649, 0.4699, 0.6687]}, {"w": "this", "b": [0.4762, 0.649, 0.5127, 0.6687]}, {"w": "step:", "b": [0.519, 0.649, 0.5666, 0.6687]}, {"w": "with", "b": [0.5729, 0.649, 0.6178, 0.6687]}, {"w": "deep", "b": [0.6241, 0.649, 0.6717, 0.6687]}, {"w": "learning,", "b": [0.678, 0.649, 0.767, 0.6687]}, {"w": "you", "b": [0.7733, 0.649, 0.8111, 0.6687]}, {"w": "learn", "b": [0.8174, 0.649, 0.8679, 0.6687]}, {"w": "all", "b": [0.1294, 0.6695, 0.1546, 0.6892]}, {"w": "features", "b": [0.1609, 0.6695, 0.2408, 0.6892]}, {"w": "in", "b": [0.2471, 0.6695, 0.2667, 0.6892]}, {"w": "one", "b": [0.273, 0.6695, 0.3094, 0.6892]}, {"w": "pass", "b": [0.3158, 0.6695, 0.3592, 0.6892]}, {"w": "rather", "b": [0.3655, 0.6695, 0.4243, 0.6892]}, {"w": "than", "b": [0.4306, 0.6695, 0.474, 0.6892]}, {"w": "having", "b": [0.4803, 0.6695, 0.549, 0.6892]}, {"w": "to", "b": [0.5553, 0.6695, 0.5749, 0.6892]}, {"w": "engineer", "b": [0.5813, 0.6695, 0.6681, 0.6892]}, {"w": "them", "b": [0.6744, 0.6695, 0.7249, 0.6892]}, {"w": "yourself.", "b": [0.7312, 0.6695, 0.8201, 0.6892]}, {"w": "This", "b": [0.1294, 0.69, 0.1743, 0.7097]}, {"w": "has", "b": [0.1806, 0.69, 0.2142, 0.7097]}, {"w": "greatly", "b": [0.2205, 0.69, 0.2906, 0.7097]}, {"w": "simplified", "b": [0.2969, 0.69, 0.3992, 0.7097]}, {"w": "machine-learning", "b": [0.4055, 0.69, 0.582, 0.7097]}, {"w": "workflows,", "b": [0.5883, 0.69, 0.7025, 0.7097]}, {"w": "often", "b": [0.7088, 0.69, 0.7607, 0.7097]}, {"w": "replacing", "b": [0.767, 0.69, 0.8608, 0.7097]}, {"w": "sophisticated", "b": [0.1294, 0.7105, 0.2611, 0.7302]}, {"w": "multistage", "b": [0.2674, 0.7105, 0.3725, 0.7302]}, {"w": "pipelines", "b": [0.3788, 0.7105, 0.4699, 0.7302]}, {"w": "with", "b": [0.4762, 0.7105, 0.5211, 0.7302]}, {"w": "a", "b": [0.5274, 0.7105, 0.5386, 0.7302]}, {"w": "single,", "b": [0.5449, 0.7105, 0.6115, 0.7302]}, {"w": "simple,", "b": [0.6178, 0.7105, 0.6914, 0.7302]}, {"w": "end-to-end", "b": [0.6977, 0.7105, 0.807, 0.7302]}, {"w": "deep-", "b": [0.8133, 0.7105, 0.8693, 0.7302]}, {"w": "learning", "b": [0.1294, 0.731, 0.2121, 0.7507]}, {"w": "model.", "b": [0.2184, 0.731, 0.2878, 0.7507]}]}, {"id": "b_4", "type": "paragraph", "text": "You may ask, if the crux of the issue is to have multiple successive layers of representations, could shallow methods be applied repeatedly to emulate the effects of deep learning? In practice, there are fast- diminishing returns to successive applications of shallow-learning methods, because the optimal first representation layer in a three-layer model isn’t the optimal first layer in a one-layer or two-layer model.", "words": [{"w": "You", "b": [0.1294, 0.7738, 0.1703, 0.7935]}, {"w": "may", "b": [0.1766, 0.7738, 0.2201, 0.7935]}, {"w": "ask,", "b": [0.2264, 0.7738, 0.2663, 0.7935]}, {"w": "if", "b": [0.2726, 0.7738, 0.288, 0.7935]}, {"w": "the", "b": [0.2943, 0.7738, 0.3252, 0.7935]}, {"w": "crux", "b": [0.3315, 0.7738, 0.3763, 0.7935]}, {"w": "of", "b": [0.3826, 0.7738, 0.4036, 0.7935]}, {"w": "the", "b": [0.4099, 0.7738, 0.4408, 0.7935]}, {"w": "issue", "b": [0.4471, 0.7738, 0.4975, 0.7935]}, {"w": "is", "b": [0.5038, 0.7738, 0.5206, 0.7935]}, {"w": "to", "b": [0.5269, 0.7738, 0.5466, 0.7935]}, {"w": "have", "b": [0.5529, 0.7738, 0.6005, 0.7935]}, {"w": "multiple", "b": [0.6068, 0.7738, 0.6909, 0.7935]}, {"w": "successive", "b": [0.6972, 0.7738, 0.8037, 0.7935]}, {"w": "layers", "b": [0.81, 0.7738, 0.8702, 0.7935]}, {"w": "of", "b": [0.1294, 0.7943, 0.1504, 0.814]}, {"w": "representations,", "b": [0.1567, 0.7943, 0.3158, 0.814]}, {"w": "could", "b": [0.3221, 0.7943, 0.3781, 0.814]}, {"w": "shallow", "b": [0.3844, 0.7943, 0.4629, 0.814]}, {"w": "methods", "b": [0.4692, 0.7943, 0.5547, 0.814]}, {"w": "be", "b": [0.561, 0.7943, 0.5848, 0.814]}, {"w": "applied", "b": [0.5911, 0.7943, 0.6654, 0.814]}, {"w": "repeatedly", "b": [0.6716, 0.7943, 0.7767, 0.814]}, {"w": "to", "b": [0.783, 0.7943, 0.8026, 0.814]}, {"w": "emulate", "b": [0.1294, 0.8148, 0.2093, 0.8345]}, {"w": "the", "b": [0.2156, 0.8148, 0.2464, 0.8345]}, {"w": "effects", "b": [0.2527, 0.8148, 0.3195, 0.8345]}, {"w": "of", "b": [0.3258, 0.8148, 0.3468, 0.8345]}, {"w": "deep", "b": [0.3531, 0.8148, 0.4007, 0.8345]}, {"w": "learning?", "b": [0.407, 0.8148, 0.5009, 0.8345]}, {"w": "In", "b": [0.5072, 0.8148, 0.5282, 0.8345]}, {"w": "practice,", "b": [0.5345, 0.8148, 0.6206, 0.8345]}, {"w": "there", "b": [0.627, 0.8148, 0.6774, 0.8345]}, {"w": "are", "b": [0.6837, 0.8148, 0.7145, 0.8345]}, {"w": "fast-", "b": [0.7208, 0.8148, 0.7656, 0.8345]}, {"w": "diminishing", "b": [0.1294, 0.8353, 0.25, 0.855]}, {"w": "returns", "b": [0.2563, 0.8353, 0.3263, 0.855]}, {"w": "to", "b": [0.3326, 0.8353, 0.3523, 0.855]}, {"w": "successive", "b": [0.3586, 0.8353, 0.465, 0.855]}, {"w": "applications", "b": [0.4713, 0.8353, 0.5933, 0.855]}, {"w": "of", "b": [0.5995, 0.8353, 0.6205, 0.855]}, {"w": "shallow-learning", "b": [0.6268, 0.8353, 0.7964, 0.855]}, {"w": "methods,", "b": [0.1294, 0.8558, 0.2212, 0.8755]}, {"w": "because", "b": [0.2275, 0.8558, 0.3074, 0.8755]}, {"w": "the", "b": [0.3136, 0.8558, 0.3445, 0.8755]}, {"w": "optimal", "b": [0.3508, 0.8558, 0.4279, 0.8755]}, {"w": "first", "b": [0.4342, 0.8558, 0.4748, 0.8755]}, {"w": "representation", "b": [0.4811, 0.8558, 0.6264, 0.8755]}, {"w": "layer", "b": [0.6327, 0.8558, 0.6845, 0.8755]}, {"w": "in", "b": [0.6908, 0.8558, 0.7105, 0.8755]}, {"w": "a", "b": [0.7168, 0.8558, 0.7294, 0.8755]}, {"w": "three-layer", "b": [0.7357, 0.8558, 0.8468, 0.8755]}, {"w": "model", "b": [0.1294, 0.8763, 0.1911, 0.896]}, {"w": "isn’t", "b": [0.1974, 0.8763, 0.2394, 0.896]}, {"w": "the", "b": [0.2457, 0.8763, 0.2766, 0.896]}, {"w": "optimal", "b": [0.2829, 0.8763, 0.36, 0.896]}, {"w": "first", "b": [0.3663, 0.8763, 0.4069, 0.896]}, {"w": "layer", "b": [0.4132, 0.8763, 0.4651, 0.896]}, {"w": "in", "b": [0.4714, 0.8763, 0.491, 0.896]}, {"w": "a", "b": [0.4973, 0.8763, 0.5099, 0.896]}, {"w": "one-layer", "b": [0.5162, 0.8763, 0.6129, 0.896]}, {"w": "or", "b": [0.6192, 0.8763, 0.6416, 0.896]}, {"w": "two-layer", "b": [0.6479, 0.8763, 0.7446, 0.896]}, {"w": "model.", "b": [0.7509, 0.8763, 0.8188, 0.896]}]}]}, {"page": 50, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "What is transformative about deep learning is that it allows a model to learn all layers of representation jointly, at the same time, rather than in succession (greedily, as it’s called). With joint feature learning, whenever the model adjusts one of its internal features, all other features that depend on it automatically adapt to the change, without requiring human intervention. Everything is supervised by a single feedback signal: every change in the model serves the end goal. This is much more powerful than greedily stacking shallow models, because it allows for complex, abstract representations to be learned by breaking them down into long series of intermediate spaces (layers); each space is only a simple transformation away from the previous one.", "words": [{"w": "What", "b": [0.1294, 0.0857, 0.1841, 0.1054]}, {"w": "is", "b": [0.1904, 0.0857, 0.2072, 0.1054]}, {"w": "transformative", "b": [0.2135, 0.0857, 0.3606, 0.1054]}, {"w": "about", "b": [0.3669, 0.0857, 0.423, 0.1054]}, {"w": "deep", "b": [0.4293, 0.0857, 0.4769, 0.1054]}, {"w": "learning", "b": [0.4832, 0.0857, 0.5659, 0.1054]}, {"w": "is", "b": [0.5722, 0.0857, 0.589, 0.1054]}, {"w": "that", "b": [0.5953, 0.0857, 0.6331, 0.1054]}, {"w": "it", "b": [0.6395, 0.0857, 0.6535, 0.1054]}, {"w": "allows", "b": [0.6598, 0.0857, 0.7256, 0.1054]}, {"w": "a", "b": [0.732, 0.0857, 0.7432, 0.1054]}, {"w": "model", "b": [0.7495, 0.0857, 0.8125, 0.1054]}, {"w": "to", "b": [0.8188, 0.0857, 0.8385, 0.1054]}, {"w": "learn", "b": [0.1294, 0.1062, 0.1798, 0.1259]}, {"w": "all", "b": [0.1861, 0.1062, 0.2114, 0.1259]}, {"w": "layers", "b": [0.2177, 0.1062, 0.2779, 0.1259]}, {"w": "of", "b": [0.2842, 0.1062, 0.3052, 0.1259]}, {"w": "representation", "b": [0.3115, 0.1062, 0.4544, 0.1259]}, {"w": "jointly,", "b": [0.4607, 0.1062, 0.5314, 0.1259]}, {"w": "at", "b": [0.5378, 0.1062, 0.556, 0.1259]}, {"w": "the", "b": [0.5623, 0.1062, 0.5931, 0.1259]}, {"w": "same", "b": [0.5994, 0.1062, 0.6512, 0.1259]}, {"w": "time,", "b": [0.6576, 0.1062, 0.7087, 0.1259]}, {"w": "rather", "b": [0.715, 0.1062, 0.7738, 0.1259]}, {"w": "than", "b": [0.7801, 0.1062, 0.8236, 0.1259]}, {"w": "in", "b": [0.8299, 0.1062, 0.8495, 0.1259]}, {"w": "succession", "b": [0.1294, 0.1267, 0.2373, 0.1464]}, {"w": "(greedily,", "b": [0.2436, 0.1267, 0.34, 0.1464]}, {"w": "as", "b": [0.3463, 0.1267, 0.3673, 0.1464]}, {"w": "it’s", "b": [0.3736, 0.1267, 0.4045, 0.1464]}, {"w": "called).", "b": [0.4108, 0.1267, 0.4857, 0.1464]}, {"w": "With", "b": [0.492, 0.1267, 0.5415, 0.1464]}, {"w": "joint", "b": [0.5478, 0.1267, 0.594, 0.1464]}, {"w": "feature", "b": [0.6003, 0.1267, 0.6704, 0.1464]}, {"w": "learning,", "b": [0.6767, 0.1267, 0.7656, 0.1464]}, {"w": "whenever", "b": [0.7719, 0.1267, 0.87, 0.1464]}, {"w": "the", "b": [0.1294, 0.1472, 0.1602, 0.1669]}, {"w": "model", "b": [0.1665, 0.1472, 0.2296, 0.1669]}, {"w": "adjusts", "b": [0.2359, 0.1472, 0.306, 0.1669]}, {"w": "one", "b": [0.3123, 0.1472, 0.3487, 0.1669]}, {"w": "of", "b": [0.355, 0.1472, 0.376, 0.1669]}, {"w": "its", "b": [0.3824, 0.1472, 0.4062, 0.1669]}, {"w": "internal", "b": [0.4125, 0.1472, 0.4896, 0.1669]}, {"w": "features,", "b": [0.4959, 0.1472, 0.582, 0.1669]}, {"w": "all", "b": [0.5883, 0.1472, 0.6135, 0.1669]}, {"w": "other", "b": [0.6199, 0.1472, 0.6717, 0.1669]}, {"w": "features", "b": [0.678, 0.1472, 0.7578, 0.1669]}, {"w": "that", "b": [0.764, 0.1472, 0.8019, 0.1669]}, {"w": "depend", "b": [0.1294, 0.1677, 0.2023, 0.1874]}, {"w": "on", "b": [0.2086, 0.1677, 0.2338, 0.1874]}, {"w": "it", "b": [0.2401, 0.1677, 0.2541, 0.1874]}, {"w": "automatically", "b": [0.2604, 0.1677, 0.3978, 0.1874]}, {"w": "adapt", "b": [0.4041, 0.1677, 0.4587, 0.1874]}, {"w": "to", "b": [0.465, 0.1677, 0.4846, 0.1874]}, {"w": "the", "b": [0.4909, 0.1677, 0.5218, 0.1874]}, {"w": "change,", "b": [0.5281, 0.1677, 0.6058, 0.1874]}, {"w": "without", "b": [0.6121, 0.1677, 0.6892, 0.1874]}, {"w": "requiring", "b": [0.6955, 0.1677, 0.788, 0.1874]}, {"w": "human", "b": [0.7943, 0.1677, 0.863, 0.1874]}, {"w": "intervention.", "b": [0.1294, 0.1882, 0.2576, 0.2079]}, {"w": "Everything", "b": [0.2639, 0.1882, 0.376, 0.2079]}, {"w": "is", "b": [0.3824, 0.1882, 0.3992, 0.2079]}, {"w": "supervised", "b": [0.4055, 0.1882, 0.5134, 0.2079]}, {"w": "by", "b": [0.5197, 0.1882, 0.5449, 0.2079]}, {"w": "a", "b": [0.5512, 0.1882, 0.5624, 0.2079]}, {"w": "single", "b": [0.5687, 0.1882, 0.629, 0.2079]}, {"w": "feedback", "b": [0.6352, 0.1882, 0.7263, 0.2079]}, {"w": "signal:", "b": [0.7326, 0.1882, 0.7999, 0.2079]}, {"w": "every", "b": [0.8062, 0.1882, 0.8622, 0.2079]}, {"w": "change", "b": [0.1294, 0.2087, 0.2009, 0.2284]}, {"w": "in", "b": [0.2072, 0.2087, 0.2268, 0.2284]}, {"w": "the", "b": [0.2331, 0.2087, 0.2639, 0.2284]}, {"w": "model", "b": [0.2702, 0.2087, 0.3333, 0.2284]}, {"w": "serves", "b": [0.3396, 0.2087, 0.4026, 0.2284]}, {"w": "the", "b": [0.4089, 0.2087, 0.4398, 0.2284]}, {"w": "end", "b": [0.4461, 0.2087, 0.4825, 0.2284]}, {"w": "goal.", "b": [0.4888, 0.2087, 0.5385, 0.2284]}, {"w": "This", "b": [0.5449, 0.2087, 0.5897, 0.2284]}, {"w": "is", "b": [0.596, 0.2087, 0.6128, 0.2284]}, {"w": "much", "b": [0.6191, 0.2087, 0.6752, 0.2284]}, {"w": "more", "b": [0.6815, 0.2087, 0.7333, 0.2284]}, {"w": "powerful", "b": [0.7396, 0.2087, 0.8307, 0.2284]}, {"w": "than", "b": [0.1294, 0.2292, 0.1729, 0.2489]}, {"w": "greedily", "b": [0.1792, 0.2292, 0.2618, 0.2489]}, {"w": "stacking", "b": [0.2681, 0.2292, 0.3522, 0.2489]}, {"w": "shallow", "b": [0.3585, 0.2292, 0.437, 0.2489]}, {"w": "models,", "b": [0.4433, 0.2292, 0.5224, 0.2489]}, {"w": "because", "b": [0.5287, 0.2292, 0.6086, 0.2489]}, {"w": "it", "b": [0.6149, 0.2292, 0.6289, 0.2489]}, {"w": "allows", "b": [0.6352, 0.2292, 0.7011, 0.2489]}, {"w": "for", "b": [0.7074, 0.2292, 0.7368, 0.2489]}, {"w": "complex,", "b": [0.7431, 0.2292, 0.8363, 0.2489]}, {"w": "abstract", "b": [0.1294, 0.2497, 0.2079, 0.2694]}, {"w": "representations", "b": [0.2142, 0.2497, 0.3669, 0.2694]}, {"w": "to", "b": [0.3732, 0.2497, 0.3928, 0.2694]}, {"w": "be", "b": [0.3991, 0.2497, 0.4229, 0.2694]}, {"w": "learned", "b": [0.4292, 0.2497, 0.5035, 0.2694]}, {"w": "by", "b": [0.5098, 0.2497, 0.535, 0.2694]}, {"w": "breaking", "b": [0.5413, 0.2497, 0.6296, 0.2694]}, {"w": "them", "b": [0.6359, 0.2497, 0.6863, 0.2694]}, {"w": "down", "b": [0.6927, 0.2497, 0.7487, 0.2694]}, {"w": "into", "b": [0.755, 0.2497, 0.7943, 0.2694]}, {"w": "long", "b": [0.8006, 0.2497, 0.8454, 0.2694]}, {"w": "series", "b": [0.1294, 0.2702, 0.1869, 0.2899]}, {"w": "of", "b": [0.1932, 0.2702, 0.2142, 0.2899]}, {"w": "intermediate", "b": [0.2205, 0.2702, 0.3466, 0.2899]}, {"w": "spaces", "b": [0.3528, 0.2702, 0.4187, 0.2899]}, {"w": "(layers);", "b": [0.425, 0.2702, 0.509, 0.2899]}, {"w": "each", "b": [0.5153, 0.2702, 0.5616, 0.2899]}, {"w": "space", "b": [0.5679, 0.2702, 0.6239, 0.2899]}, {"w": "is", "b": [0.6302, 0.2702, 0.647, 0.2899]}, {"w": "only", "b": [0.6533, 0.2702, 0.6982, 0.2899]}, {"w": "a", "b": [0.7045, 0.2702, 0.7157, 0.2899]}, {"w": "simple", "b": [0.722, 0.2702, 0.7893, 0.2899]}, {"w": "transformation", "b": [0.1294, 0.2907, 0.2779, 0.3104]}, {"w": "away", "b": [0.2842, 0.2907, 0.3375, 0.3104]}, {"w": "from", "b": [0.3438, 0.2907, 0.3928, 0.3104]}, {"w": "the", "b": [0.3991, 0.2907, 0.43, 0.3104]}, {"w": "previous", "b": [0.4363, 0.2907, 0.5231, 0.3104]}, {"w": "one.", "b": [0.5294, 0.2907, 0.5722, 0.3104]}]}, {"id": "b_1", "type": "paragraph", "text": "These are the two essential characteristics of how deep learning learns from data: the incremental, layer-by-layer way in which increasingly complex representations are developed, and the fact that these intermediate incremental representations are learned jointly, each layer being updated to follow both the representational needs of the layer above and the needs of the layer below. Together, these two properties have made deep learning vastly more successful than previous approaches to machine learning.", "words": [{"w": "These", "b": [0.1294, 0.3335, 0.1897, 0.3532]}, {"w": "are", "b": [0.196, 0.3335, 0.2268, 0.3532]}, {"w": "the", "b": [0.2331, 0.3335, 0.2639, 0.3532]}, {"w": "two", "b": [0.2702, 0.3335, 0.308, 0.3532]}, {"w": "essential", "b": [0.3143, 0.3335, 0.4012, 0.3532]}, {"w": "characteristics", "b": [0.4075, 0.3335, 0.5518, 0.3532]}, {"w": "of", "b": [0.5581, 0.3335, 0.5791, 0.3532]}, {"w": "how", "b": [0.5854, 0.3335, 0.6289, 0.3532]}, {"w": "deep", "b": [0.6352, 0.3335, 0.6828, 0.3532]}, {"w": "learning", "b": [0.6891, 0.3335, 0.7718, 0.3532]}, {"w": "learns", "b": [0.7781, 0.3335, 0.8383, 0.3532]}, {"w": "from", "b": [0.1294, 0.354, 0.1785, 0.3737]}, {"w": "data:", "b": [0.1848, 0.354, 0.2338, 0.3737]}, {"w": "the", "b": [0.2401, 0.354, 0.2709, 0.3737]}, {"w": "incremental,", "b": [0.2772, 0.354, 0.4031, 0.3737]}, {"w": "layer-by-layer", "b": [0.4094, 0.354, 0.5531, 0.3737]}, {"w": "way", "b": [0.5594, 0.354, 0.6001, 0.3737]}, {"w": "in", "b": [0.6064, 0.354, 0.626, 0.3737]}, {"w": "which", "b": [0.6323, 0.354, 0.6926, 0.3737]}, {"w": "increasingly", "b": [0.6989, 0.354, 0.8226, 0.3737]}, {"w": "complex", "b": [0.1294, 0.3745, 0.2135, 0.3942]}, {"w": "representations", "b": [0.2198, 0.3745, 0.3748, 0.3942]}, {"w": "are", "b": [0.3812, 0.3745, 0.4138, 0.3942]}, {"w": "developed,", "b": [0.4201, 0.3745, 0.5287, 0.3942]}, {"w": "and", "b": [0.535, 0.3745, 0.5714, 0.3942]}, {"w": "the", "b": [0.5777, 0.3745, 0.6086, 0.3942]}, {"w": "fact", "b": [0.6149, 0.3745, 0.6527, 0.3942]}, {"w": "that", "b": [0.659, 0.3745, 0.6968, 0.3942]}, {"w": "these", "b": [0.7031, 0.3745, 0.7549, 0.3942]}, {"w": "intermediate", "b": [0.1294, 0.395, 0.2569, 0.4147]}, {"w": "incremental", "b": [0.2632, 0.395, 0.3828, 0.4147]}, {"w": "representations", "b": [0.3891, 0.395, 0.5442, 0.4147]}, {"w": "are", "b": [0.5505, 0.395, 0.5831, 0.4147]}, {"w": "learned", "b": [0.5895, 0.395, 0.6665, 0.4147]}, {"w": "jointly,", "b": [0.6728, 0.395, 0.7436, 0.4147]}, {"w": "each", "b": [0.7499, 0.395, 0.7961, 0.4147]}, {"w": "layer", "b": [0.8024, 0.395, 0.8528, 0.4147]}, {"w": "being", "b": [0.1294, 0.4155, 0.1855, 0.4352]}, {"w": "updated", "b": [0.1918, 0.4155, 0.2716, 0.4352]}, {"w": "to", "b": [0.2779, 0.4155, 0.2976, 0.4352]}, {"w": "follow", "b": [0.3039, 0.4155, 0.3697, 0.4352]}, {"w": "both", "b": [0.376, 0.4155, 0.4209, 0.4352]}, {"w": "the", "b": [0.4272, 0.4155, 0.458, 0.4352]}, {"w": "representational", "b": [0.4643, 0.4155, 0.6255, 0.4352]}, {"w": "needs", "b": [0.6318, 0.4155, 0.6892, 0.4352]}, {"w": "of", "b": [0.6955, 0.4155, 0.7165, 0.4352]}, {"w": "the", "b": [0.7228, 0.4155, 0.7536, 0.4352]}, {"w": "layer", "b": [0.76, 0.4155, 0.8104, 0.4352]}, {"w": "above", "b": [0.1294, 0.436, 0.1897, 0.4557]}, {"w": "and", "b": [0.196, 0.436, 0.2324, 0.4557]}, {"w": "the", "b": [0.2387, 0.436, 0.2695, 0.4557]}, {"w": "needs", "b": [0.2758, 0.436, 0.3333, 0.4557]}, {"w": "of", "b": [0.3396, 0.436, 0.3606, 0.4557]}, {"w": "the", "b": [0.3669, 0.436, 0.3977, 0.4557]}, {"w": "layer", "b": [0.404, 0.436, 0.4544, 0.4557]}, {"w": "below.", "b": [0.4608, 0.436, 0.527, 0.4557]}, {"w": "Together,", "b": [0.5333, 0.436, 0.6279, 0.4557]}, {"w": "these", "b": [0.6342, 0.436, 0.686, 0.4557]}, {"w": "two", "b": [0.6924, 0.436, 0.7302, 0.4557]}, {"w": "properties", "b": [0.7365, 0.436, 0.8374, 0.4557]}, {"w": "have", "b": [0.1294, 0.4565, 0.177, 0.4762]}, {"w": "made", "b": [0.1833, 0.4565, 0.238, 0.4762]}, {"w": "deep", "b": [0.2443, 0.4565, 0.2919, 0.4762]}, {"w": "learning", "b": [0.2982, 0.4565, 0.3809, 0.4762]}, {"w": "vastly", "b": [0.3872, 0.4565, 0.4475, 0.4762]}, {"w": "more", "b": [0.4538, 0.4565, 0.5056, 0.4762]}, {"w": "successful", "b": [0.5119, 0.4565, 0.6156, 0.4762]}, {"w": "than", "b": [0.6219, 0.4565, 0.6653, 0.4762]}, {"w": "previous", "b": [0.6716, 0.4565, 0.7585, 0.4762]}, {"w": "approaches", "b": [0.1294, 0.477, 0.2429, 0.4967]}, {"w": "to", "b": [0.2492, 0.477, 0.2688, 0.4967]}, {"w": "machine", "b": [0.2751, 0.477, 0.3606, 0.4967]}, {"w": "learning.", "b": [0.3669, 0.477, 0.4559, 0.4967]}]}, {"id": "b_2", "type": "equation", "text": "1.2.7. The modern machine-learning landscape", "words": [{"w": "1.2.7.", "b": [0.1294, 0.5242, 0.1862, 0.5439]}, {"w": "The", "b": [0.1925, 0.5242, 0.2345, 0.5439]}, {"w": "modern", "b": [0.2408, 0.5242, 0.3249, 0.5439]}, {"w": "machine-learning", "b": [0.3312, 0.5242, 0.5204, 0.5439]}, {"w": "landscape", "b": [0.5267, 0.5242, 0.6332, 0.5439]}]}, {"id": "b_3", "type": "paragraph", "text": "A great way to get a sense of the current landscape of machine-learning algorithms and tools is to look at machine-learning competitions on Kaggle. Due to its highly competitive environment (some contests have thousands of entrants and million--dollar prizes) and to the wide variety of machine-learning problems covered, Kaggle offers a realistic way to assess what works and what doesn’t. So, what kind of algorithm is reliably winning competitions? What tools do top entrants use?", "words": [{"w": "A", "b": [0.1294, 0.567, 0.1476, 0.5867]}, {"w": "great", "b": [0.1539, 0.567, 0.2044, 0.5867]}, {"w": "way", "b": [0.2107, 0.567, 0.2527, 0.5867]}, {"w": "to", "b": [0.259, 0.567, 0.2786, 0.5867]}, {"w": "get", "b": [0.2849, 0.567, 0.3158, 0.5867]}, {"w": "a", "b": [0.3221, 0.567, 0.3333, 0.5867]}, {"w": "sense", "b": [0.3396, 0.567, 0.3942, 0.5867]}, {"w": "of", "b": [0.4005, 0.567, 0.4215, 0.5867]}, {"w": "the", "b": [0.4278, 0.567, 0.4587, 0.5867]}, {"w": "current", "b": [0.465, 0.567, 0.5364, 0.5867]}, {"w": "landscape", "b": [0.5427, 0.567, 0.6422, 0.5867]}, {"w": "of", "b": [0.6485, 0.567, 0.6695, 0.5867]}, {"w": "machine-learning", "b": [0.6758, 0.567, 0.8523, 0.5867]}, {"w": "algorithms", "b": [0.1294, 0.5875, 0.2373, 0.6072]}, {"w": "and", "b": [0.2436, 0.5875, 0.2801, 0.6072]}, {"w": "tools", "b": [0.2864, 0.5875, 0.3354, 0.6072]}, {"w": "is", "b": [0.3417, 0.5875, 0.3586, 0.6072]}, {"w": "to", "b": [0.3649, 0.5875, 0.3845, 0.6072]}, {"w": "look", "b": [0.3908, 0.5875, 0.4357, 0.6072]}, {"w": "at", "b": [0.442, 0.5875, 0.4602, 0.6072]}, {"w": "machine-learning", "b": [0.4665, 0.5875, 0.643, 0.6072]}, {"w": "competitions", "b": [0.6492, 0.5875, 0.7796, 0.6072]}, {"w": "on", "b": [0.7859, 0.5875, 0.8111, 0.6072]}, {"w": "Kaggle.", "b": [0.1294, 0.608, 0.2086, 0.6277]}, {"w": "Due", "b": [0.2149, 0.608, 0.2569, 0.6277]}, {"w": "to", "b": [0.2632, 0.608, 0.2828, 0.6277]}, {"w": "its", "b": [0.2891, 0.608, 0.313, 0.6277]}, {"w": "highly", "b": [0.3193, 0.608, 0.3838, 0.6277]}, {"w": "competitive", "b": [0.3901, 0.608, 0.5092, 0.6277]}, {"w": "environment", "b": [0.5155, 0.608, 0.643, 0.6277]}, {"w": "(some", "b": [0.6493, 0.608, 0.711, 0.6277]}, {"w": "contests", "b": [0.7173, 0.608, 0.7986, 0.6277]}, {"w": "have", "b": [0.8049, 0.608, 0.8525, 0.6277]}, {"w": "thousands", "b": [0.1294, 0.6285, 0.2303, 0.6482]}, {"w": "of", "b": [0.2366, 0.6285, 0.2576, 0.6482]}, {"w": "entrants", "b": [0.2639, 0.6285, 0.3438, 0.6482]}, {"w": "and", "b": [0.3501, 0.6285, 0.3865, 0.6482]}, {"w": "million--dollar", "b": [0.3928, 0.6285, 0.5414, 0.6482]}, {"w": "prizes)", "b": [0.5476, 0.6285, 0.6163, 0.6482]}, {"w": "and", "b": [0.6226, 0.6285, 0.659, 0.6482]}, {"w": "to", "b": [0.6653, 0.6285, 0.685, 0.6482]}, {"w": "the", "b": [0.6913, 0.6285, 0.7221, 0.6482]}, {"w": "wide", "b": [0.7284, 0.6285, 0.7774, 0.6482]}, {"w": "variety", "b": [0.7837, 0.6285, 0.8538, 0.6482]}, {"w": "of", "b": [0.1294, 0.649, 0.1504, 0.6687]}, {"w": "machine-learning", "b": [0.1567, 0.649, 0.3333, 0.6687]}, {"w": "problems", "b": [0.3396, 0.649, 0.4335, 0.6687]}, {"w": "covered,", "b": [0.4398, 0.649, 0.5259, 0.6687]}, {"w": "Kaggle", "b": [0.5322, 0.649, 0.6051, 0.6687]}, {"w": "offers", "b": [0.6114, 0.649, 0.6697, 0.6687]}, {"w": "a", "b": [0.676, 0.649, 0.6872, 0.6687]}, {"w": "realistic", "b": [0.6935, 0.649, 0.7734, 0.6687]}, {"w": "way", "b": [0.7797, 0.649, 0.8217, 0.6687]}, {"w": "to", "b": [0.828, 0.649, 0.8476, 0.6687]}, {"w": "assess", "b": [0.1294, 0.6695, 0.1911, 0.6892]}, {"w": "what", "b": [0.1974, 0.6695, 0.2464, 0.6892]}, {"w": "works", "b": [0.2527, 0.6695, 0.3144, 0.6892]}, {"w": "and", "b": [0.3207, 0.6695, 0.3571, 0.6892]}, {"w": "what", "b": [0.3634, 0.6695, 0.4124, 0.6892]}, {"w": "doesn’t.", "b": [0.4187, 0.6695, 0.4989, 0.6892]}, {"w": "So,", "b": [0.5052, 0.6695, 0.5381, 0.6892]}, {"w": "what", "b": [0.5444, 0.6695, 0.5935, 0.6892]}, {"w": "kind", "b": [0.5998, 0.6695, 0.6446, 0.6892]}, {"w": "of", "b": [0.6509, 0.6695, 0.6719, 0.6892]}, {"w": "algorithm", "b": [0.6782, 0.6695, 0.7763, 0.6892]}, {"w": "is", "b": [0.7826, 0.6695, 0.7995, 0.6892]}, {"w": "reliably", "b": [0.1294, 0.69, 0.2065, 0.7097]}, {"w": "winning", "b": [0.2128, 0.69, 0.2955, 0.7097]}, {"w": "competitions?", "b": [0.3018, 0.69, 0.4433, 0.7097]}, {"w": "What", "b": [0.4496, 0.69, 0.5043, 0.7097]}, {"w": "tools", "b": [0.5106, 0.69, 0.5596, 0.7097]}, {"w": "do", "b": [0.5659, 0.69, 0.5912, 0.7097]}, {"w": "top", "b": [0.5975, 0.69, 0.6297, 0.7097]}, {"w": "entrants", "b": [0.636, 0.69, 0.7159, 0.7097]}, {"w": "use?", "b": [0.7222, 0.69, 0.767, 0.7097]}]}, {"id": "b_4", "type": "paragraph", "text": "In 2016 and 2017, Kaggle was dominated by two approaches: gradient boosting machines and deep learning. Specifically, gradient boosting is used for problems where structured data is available, whereas deep learning is used for perceptual problems such as image classification. Practitioners of the former almost always use the excellent XGBoost library, which offers support for the two most popular languages of data science: Python and R. Meanwhile, most of the Kaggle entrants using", "words": [{"w": "In", "b": [0.1294, 0.7328, 0.1504, 0.7525]}, {"w": "2016", "b": [0.1567, 0.7328, 0.2072, 0.7525]}, {"w": "and", "b": [0.2135, 0.7328, 0.2499, 0.7525]}, {"w": "2017,", "b": [0.2562, 0.7328, 0.313, 0.7525]}, {"w": "Kaggle", "b": [0.3193, 0.7328, 0.3921, 0.7525]}, {"w": "was", "b": [0.3984, 0.7328, 0.4377, 0.7525]}, {"w": "dominated", "b": [0.444, 0.7328, 0.5505, 0.7525]}, {"w": "by", "b": [0.5568, 0.7328, 0.582, 0.7525]}, {"w": "two", "b": [0.5883, 0.7328, 0.6262, 0.7525]}, {"w": "approaches:", "b": [0.6325, 0.7328, 0.7529, 0.7525]}, {"w": "gradient", "b": [0.7592, 0.7328, 0.8419, 0.7525]}, {"w": "boosting", "b": [0.1294, 0.7533, 0.2163, 0.773]}, {"w": "machines", "b": [0.2226, 0.7533, 0.3179, 0.773]}, {"w": "and", "b": [0.3242, 0.7533, 0.3606, 0.773]}, {"w": "deep", "b": [0.3669, 0.7533, 0.4146, 0.773]}, {"w": "learning.", "b": [0.4209, 0.7533, 0.5098, 0.773]}, {"w": "Specifically,", "b": [0.5161, 0.7533, 0.6412, 0.773]}, {"w": "gradient", "b": [0.6476, 0.7533, 0.7302, 0.773]}, {"w": "boosting", "b": [0.7365, 0.7533, 0.8234, 0.773]}, {"w": "is", "b": [0.8297, 0.7533, 0.8465, 0.773]}, {"w": "used", "b": [0.1294, 0.7738, 0.1757, 0.7935]}, {"w": "for", "b": [0.182, 0.7738, 0.2114, 0.7935]}, {"w": "problems", "b": [0.2177, 0.7738, 0.3116, 0.7935]}, {"w": "where", "b": [0.3179, 0.7738, 0.3795, 0.7935]}, {"w": "structured", "b": [0.3858, 0.7738, 0.4867, 0.7935]}, {"w": "data", "b": [0.493, 0.7738, 0.535, 0.7935]}, {"w": "is", "b": [0.5413, 0.7738, 0.5581, 0.7935]}, {"w": "available,", "b": [0.5645, 0.7738, 0.6618, 0.7935]}, {"w": "whereas", "b": [0.6681, 0.7738, 0.7508, 0.7935]}, {"w": "deep", "b": [0.7571, 0.7738, 0.8047, 0.7935]}, {"w": "learning", "b": [0.1294, 0.7943, 0.2121, 0.814]}, {"w": "is", "b": [0.2184, 0.7943, 0.2352, 0.814]}, {"w": "used", "b": [0.2415, 0.7943, 0.2878, 0.814]}, {"w": "for", "b": [0.2941, 0.7943, 0.3235, 0.814]}, {"w": "perceptual", "b": [0.3298, 0.7943, 0.4348, 0.814]}, {"w": "problems", "b": [0.4412, 0.7943, 0.535, 0.814]}, {"w": "such", "b": [0.5413, 0.7943, 0.5876, 0.814]}, {"w": "as", "b": [0.5938, 0.7943, 0.6149, 0.814]}, {"w": "image", "b": [0.6212, 0.7943, 0.6828, 0.814]}, {"w": "classification.", "b": [0.6891, 0.7943, 0.8285, 0.814]}, {"w": "Practitioners", "b": [0.1294, 0.8148, 0.2569, 0.8345]}, {"w": "of", "b": [0.2632, 0.8148, 0.2842, 0.8345]}, {"w": "the", "b": [0.2906, 0.8148, 0.3214, 0.8345]}, {"w": "former", "b": [0.3277, 0.8148, 0.3963, 0.8345]}, {"w": "almost", "b": [0.4026, 0.8148, 0.4699, 0.8345]}, {"w": "always", "b": [0.4762, 0.8148, 0.5463, 0.8345]}, {"w": "use", "b": [0.5526, 0.8148, 0.5862, 0.8345]}, {"w": "the", "b": [0.5925, 0.8148, 0.6233, 0.8345]}, {"w": "excellent", "b": [0.6296, 0.8148, 0.7207, 0.8345]}, {"w": "XGBoost", "b": [0.727, 0.8148, 0.8223, 0.8345]}, {"w": "library,", "b": [0.1294, 0.8353, 0.2013, 0.855]}, {"w": "which", "b": [0.2076, 0.8353, 0.2693, 0.855]}, {"w": "offers", "b": [0.2756, 0.8353, 0.334, 0.855]}, {"w": "support", "b": [0.3403, 0.8353, 0.4159, 0.855]}, {"w": "for", "b": [0.4222, 0.8353, 0.4516, 0.855]}, {"w": "the", "b": [0.4579, 0.8353, 0.4888, 0.855]}, {"w": "two", "b": [0.4951, 0.8353, 0.5329, 0.855]}, {"w": "most", "b": [0.5392, 0.8353, 0.5883, 0.855]}, {"w": "popular", "b": [0.5946, 0.8353, 0.6717, 0.855]}, {"w": "languages", "b": [0.678, 0.8353, 0.7788, 0.855]}, {"w": "of", "b": [0.7852, 0.8353, 0.8062, 0.855]}, {"w": "data", "b": [0.8125, 0.8353, 0.8545, 0.855]}, {"w": "science:", "b": [0.1294, 0.8558, 0.2107, 0.8755]}, {"w": "Python", "b": [0.217, 0.8558, 0.2885, 0.8755]}, {"w": "and", "b": [0.2948, 0.8558, 0.3312, 0.8755]}, {"w": "R.", "b": [0.3375, 0.8558, 0.3606, 0.8755]}, {"w": "Meanwhile,", "b": [0.3669, 0.8558, 0.4867, 0.8755]}, {"w": "most", "b": [0.493, 0.8558, 0.5421, 0.8755]}, {"w": "of", "b": [0.5484, 0.8558, 0.5694, 0.8755]}, {"w": "the", "b": [0.5757, 0.8558, 0.6066, 0.8755]}, {"w": "Kaggle", "b": [0.6129, 0.8558, 0.6857, 0.8755]}, {"w": "entrants", "b": [0.692, 0.8558, 0.7719, 0.8755]}, {"w": "using", "b": [0.7782, 0.8558, 0.8329, 0.8755]}]}]}, {"page": 51, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "deep learning use the Keras library, due to its ease of use, flexibility, and support of Python.", "words": [{"w": "deep", "b": [0.1294, 0.0857, 0.177, 0.1054]}, {"w": "learning", "b": [0.1833, 0.0857, 0.266, 0.1054]}, {"w": "use", "b": [0.2723, 0.0857, 0.3059, 0.1054]}, {"w": "the", "b": [0.3122, 0.0857, 0.3431, 0.1054]}, {"w": "Keras", "b": [0.3494, 0.0857, 0.4082, 0.1054]}, {"w": "library,", "b": [0.4145, 0.0857, 0.4864, 0.1054]}, {"w": "due", "b": [0.4927, 0.0857, 0.5291, 0.1054]}, {"w": "to", "b": [0.5354, 0.0857, 0.5551, 0.1054]}, {"w": "its", "b": [0.5614, 0.0857, 0.5852, 0.1054]}, {"w": "ease", "b": [0.5915, 0.0857, 0.6349, 0.1054]}, {"w": "of", "b": [0.6412, 0.0857, 0.6622, 0.1054]}, {"w": "use,", "b": [0.6685, 0.0857, 0.7085, 0.1054]}, {"w": "flexibility,", "b": [0.7148, 0.0857, 0.8189, 0.1054]}, {"w": "and", "b": [0.8252, 0.0857, 0.8617, 0.1054]}, {"w": "support", "b": [0.1294, 0.1062, 0.2051, 0.1259]}, {"w": "of", "b": [0.2114, 0.1062, 0.2324, 0.1259]}, {"w": "Python.", "b": [0.2387, 0.1062, 0.3165, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "These are the two techniques you should be the most familiar with in order to be successful in applied machine learning today: gradient boosting machines, for shallow-learning problems; and deep learning, for perceptual problems. In technical terms, this means you’ll need to be familiar with XGBoost and Keras—the two libraries that currently dominate Kaggle competitions. With this book in hand, you’re already one big step closer.", "words": [{"w": "These", "b": [0.1294, 0.149, 0.1897, 0.1687]}, {"w": "are", "b": [0.196, 0.149, 0.2268, 0.1687]}, {"w": "the", "b": [0.2331, 0.149, 0.2639, 0.1687]}, {"w": "two", "b": [0.2702, 0.149, 0.308, 0.1687]}, {"w": "techniques", "b": [0.3143, 0.149, 0.4222, 0.1687]}, {"w": "you", "b": [0.4285, 0.149, 0.4664, 0.1687]}, {"w": "should", "b": [0.4727, 0.149, 0.54, 0.1687]}, {"w": "be", "b": [0.5463, 0.149, 0.5701, 0.1687]}, {"w": "the", "b": [0.5764, 0.149, 0.6072, 0.1687]}, {"w": "most", "b": [0.6135, 0.149, 0.6626, 0.1687]}, {"w": "familiar", "b": [0.6689, 0.149, 0.7488, 0.1687]}, {"w": "with", "b": [0.7551, 0.149, 0.7999, 0.1687]}, {"w": "in", "b": [0.8062, 0.149, 0.8258, 0.1687]}, {"w": "order", "b": [0.1294, 0.1695, 0.1826, 0.1892]}, {"w": "to", "b": [0.1889, 0.1695, 0.2086, 0.1892]}, {"w": "be", "b": [0.2149, 0.1695, 0.2387, 0.1892]}, {"w": "successful", "b": [0.245, 0.1695, 0.3487, 0.1892]}, {"w": "in", "b": [0.355, 0.1695, 0.3746, 0.1892]}, {"w": "applied", "b": [0.3809, 0.1695, 0.4552, 0.1892]}, {"w": "machine", "b": [0.4615, 0.1695, 0.5469, 0.1892]}, {"w": "learning", "b": [0.5533, 0.1695, 0.6359, 0.1892]}, {"w": "today:", "b": [0.6422, 0.1695, 0.7053, 0.1892]}, {"w": "gradient", "b": [0.7115, 0.1695, 0.7942, 0.1892]}, {"w": "boosting", "b": [0.1294, 0.19, 0.2163, 0.2097]}, {"w": "machines,", "b": [0.2226, 0.19, 0.3242, 0.2097]}, {"w": "for", "b": [0.3305, 0.19, 0.3599, 0.2097]}, {"w": "shallow-learning", "b": [0.3662, 0.19, 0.5358, 0.2097]}, {"w": "problems;", "b": [0.5421, 0.19, 0.643, 0.2097]}, {"w": "and", "b": [0.6493, 0.19, 0.6857, 0.2097]}, {"w": "deep", "b": [0.692, 0.19, 0.7396, 0.2097]}, {"w": "learning,", "b": [0.746, 0.19, 0.8349, 0.2097]}, {"w": "for", "b": [0.8412, 0.19, 0.8706, 0.2097]}, {"w": "perceptual", "b": [0.1294, 0.2105, 0.2345, 0.2302]}, {"w": "problems.", "b": [0.2408, 0.2105, 0.341, 0.2302]}, {"w": "In", "b": [0.3473, 0.2105, 0.3683, 0.2302]}, {"w": "technical", "b": [0.3746, 0.2105, 0.4657, 0.2302]}, {"w": "terms,", "b": [0.472, 0.2105, 0.5343, 0.2302]}, {"w": "this", "b": [0.5406, 0.2105, 0.577, 0.2302]}, {"w": "means", "b": [0.5833, 0.2105, 0.6478, 0.2302]}, {"w": "you’ll", "b": [0.6541, 0.2105, 0.7144, 0.2302]}, {"w": "need", "b": [0.7207, 0.2105, 0.7683, 0.2302]}, {"w": "to", "b": [0.7746, 0.2105, 0.7942, 0.2302]}, {"w": "be", "b": [0.8005, 0.2105, 0.8243, 0.2302]}, {"w": "familiar", "b": [0.1294, 0.231, 0.2093, 0.2507]}, {"w": "with", "b": [0.2156, 0.231, 0.2604, 0.2507]}, {"w": "XGBoost", "b": [0.2667, 0.231, 0.362, 0.2507]}, {"w": "and", "b": [0.3684, 0.231, 0.4048, 0.2507]}, {"w": "Keras—the", "b": [0.4111, 0.231, 0.526, 0.2507]}, {"w": "two", "b": [0.5323, 0.231, 0.5701, 0.2507]}, {"w": "libraries", "b": [0.5764, 0.231, 0.6591, 0.2507]}, {"w": "that", "b": [0.6654, 0.231, 0.7032, 0.2507]}, {"w": "currently", "b": [0.7095, 0.231, 0.8006, 0.2507]}, {"w": "dominate", "b": [0.1294, 0.2515, 0.2233, 0.2712]}, {"w": "Kaggle", "b": [0.2296, 0.2515, 0.3025, 0.2712]}, {"w": "competitions.", "b": [0.3088, 0.2515, 0.4454, 0.2712]}, {"w": "With", "b": [0.4517, 0.2515, 0.5011, 0.2712]}, {"w": "this", "b": [0.5074, 0.2515, 0.5438, 0.2712]}, {"w": "book", "b": [0.5502, 0.2515, 0.6006, 0.2712]}, {"w": "in", "b": [0.6069, 0.2515, 0.6265, 0.2712]}, {"w": "hand,", "b": [0.6328, 0.2515, 0.6882, 0.2712]}, {"w": "you’re", "b": [0.6945, 0.2515, 0.7603, 0.2712]}, {"w": "already", "b": [0.7666, 0.2515, 0.8409, 0.2712]}, {"w": "one", "b": [0.1294, 0.272, 0.1658, 0.2917]}, {"w": "big", "b": [0.1721, 0.272, 0.2044, 0.2917]}, {"w": "step", "b": [0.2107, 0.272, 0.2513, 0.2917]}, {"w": "closer.", "b": [0.2576, 0.272, 0.3228, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "1.3. Why deep learning? Why now?", "words": [{"w": "1.3.", "b": [0.1294, 0.3288, 0.172, 0.351]}, {"w": "Why", "b": [0.1791, 0.3288, 0.2374, 0.351]}, {"w": "deep", "b": [0.2445, 0.3288, 0.3013, 0.351]}, {"w": "learning?", "b": [0.3084, 0.3288, 0.4235, 0.351]}, {"w": "Why", "b": [0.4306, 0.3288, 0.4889, 0.351]}, {"w": "now?", "b": [0.496, 0.3288, 0.5607, 0.351]}]}, {"id": "b_3", "type": "paragraph", "text": "The two key ideas of deep learning for computer vision—convolutional neural networks and backpropagation—were already well understood in 1989. The Long Short-Term Memory (LSTM) algorithm, which is fundamental to deep learning for timeseries, was developed in 1997 and has barely changed since. So why did deep learning only take off after 2012? What changed in these two decades?", "words": [{"w": "The", "b": [0.1294, 0.3745, 0.1686, 0.3942]}, {"w": "two", "b": [0.1749, 0.3745, 0.2128, 0.3942]}, {"w": "key", "b": [0.2191, 0.3745, 0.2555, 0.3942]}, {"w": "ideas", "b": [0.2618, 0.3745, 0.3137, 0.3942]}, {"w": "of", "b": [0.32, 0.3745, 0.341, 0.3942]}, {"w": "deep", "b": [0.3473, 0.3745, 0.3949, 0.3942]}, {"w": "learning", "b": [0.4012, 0.3745, 0.4839, 0.3942]}, {"w": "for", "b": [0.4902, 0.3745, 0.5196, 0.3942]}, {"w": "computer", "b": [0.5259, 0.3745, 0.6212, 0.3942]}, {"w": "vision—convolutional", "b": [0.6275, 0.3745, 0.8531, 0.3942]}, {"w": "neural", "b": [0.1294, 0.395, 0.1925, 0.4147]}, {"w": "networks", "b": [0.1988, 0.395, 0.2912, 0.4147]}, {"w": "and", "b": [0.2975, 0.395, 0.334, 0.4147]}, {"w": "backpropagation—were", "b": [0.3403, 0.395, 0.5826, 0.4147]}, {"w": "already", "b": [0.5889, 0.395, 0.6632, 0.4147]}, {"w": "well", "b": [0.6695, 0.395, 0.7129, 0.4147]}, {"w": "understood", "b": [0.7192, 0.395, 0.8313, 0.4147]}, {"w": "in", "b": [0.8376, 0.395, 0.8572, 0.4147]}, {"w": "1989.", "b": [0.1294, 0.4155, 0.1862, 0.4352]}, {"w": "The", "b": [0.1925, 0.4155, 0.2317, 0.4352]}, {"w": "Long", "b": [0.238, 0.4155, 0.2913, 0.4352]}, {"w": "Short-Term", "b": [0.2976, 0.4155, 0.4135, 0.4352]}, {"w": "Memory", "b": [0.4198, 0.4155, 0.5067, 0.4352]}, {"w": "(LSTM)", "b": [0.513, 0.4155, 0.5971, 0.4352]}, {"w": "algorithm,", "b": [0.6034, 0.4155, 0.7078, 0.4352]}, {"w": "which", "b": [0.7141, 0.4155, 0.7757, 0.4352]}, {"w": "is", "b": [0.782, 0.4155, 0.7989, 0.4352]}, {"w": "fundamental", "b": [0.1294, 0.436, 0.2555, 0.4557]}, {"w": "to", "b": [0.2618, 0.436, 0.2814, 0.4557]}, {"w": "deep", "b": [0.2878, 0.436, 0.3354, 0.4557]}, {"w": "learning", "b": [0.3417, 0.436, 0.4244, 0.4557]}, {"w": "for", "b": [0.4307, 0.436, 0.4601, 0.4557]}, {"w": "timeseries,", "b": [0.4664, 0.436, 0.575, 0.4557]}, {"w": "was", "b": [0.5813, 0.436, 0.6205, 0.4557]}, {"w": "developed", "b": [0.6267, 0.436, 0.7304, 0.4557]}, {"w": "in", "b": [0.7367, 0.436, 0.7563, 0.4557]}, {"w": "1997", "b": [0.7627, 0.436, 0.8131, 0.4557]}, {"w": "and", "b": [0.8194, 0.436, 0.8558, 0.4557]}, {"w": "has", "b": [0.1294, 0.4565, 0.163, 0.4762]}, {"w": "barely", "b": [0.1693, 0.4565, 0.2324, 0.4762]}, {"w": "changed", "b": [0.2387, 0.4565, 0.3227, 0.4762]}, {"w": "since.", "b": [0.329, 0.4565, 0.3872, 0.4762]}, {"w": "So", "b": [0.3935, 0.4565, 0.4201, 0.4762]}, {"w": "why", "b": [0.4264, 0.4565, 0.4699, 0.4762]}, {"w": "did", "b": [0.4762, 0.4565, 0.5084, 0.4762]}, {"w": "deep", "b": [0.5147, 0.4565, 0.5624, 0.4762]}, {"w": "learning", "b": [0.5687, 0.4565, 0.6513, 0.4762]}, {"w": "only", "b": [0.6576, 0.4565, 0.7025, 0.4762]}, {"w": "take", "b": [0.7088, 0.4565, 0.7508, 0.4762]}, {"w": "off", "b": [0.7571, 0.4565, 0.786, 0.4762]}, {"w": "after", "b": [0.7923, 0.4565, 0.8385, 0.4762]}, {"w": "2012?", "b": [0.1294, 0.477, 0.1911, 0.4967]}, {"w": "What", "b": [0.1974, 0.477, 0.252, 0.4967]}, {"w": "changed", "b": [0.2583, 0.477, 0.3424, 0.4967]}, {"w": "in", "b": [0.3487, 0.477, 0.3683, 0.4967]}, {"w": "these", "b": [0.3746, 0.477, 0.4264, 0.4967]}, {"w": "two", "b": [0.4328, 0.477, 0.4706, 0.4967]}, {"w": "decades?", "b": [0.4769, 0.477, 0.5679, 0.4967]}]}, {"id": "b_4", "type": "paragraph", "text": "In general, three technical forces are driving advances in machine learning:", "words": [{"w": "In", "b": [0.1294, 0.5197, 0.1504, 0.5395]}, {"w": "general,", "b": [0.1567, 0.5197, 0.2373, 0.5395]}, {"w": "three", "b": [0.2436, 0.5197, 0.294, 0.5395]}, {"w": "technical", "b": [0.3003, 0.5197, 0.3914, 0.5395]}, {"w": "forces", "b": [0.3977, 0.5197, 0.4593, 0.5395]}, {"w": "are", "b": [0.4656, 0.5197, 0.4964, 0.5395]}, {"w": "driving", "b": [0.5027, 0.5197, 0.5756, 0.5395]}, {"w": "advances", "b": [0.5819, 0.5197, 0.6744, 0.5395]}, {"w": "in", "b": [0.6807, 0.5197, 0.7003, 0.5395]}, {"w": "machine", "b": [0.7066, 0.5197, 0.7921, 0.5395]}, {"w": "learning:", "b": [0.1294, 0.5402, 0.2191, 0.56]}]}, {"id": "b_5", "type": "paragraph", "text": "Hardware Datasets and benchmarks Algorithmic advances", "words": [{"w": "Hardware", "b": [0.1799, 0.5786, 0.2793, 0.5983]}, {"w": "Datasets", "b": [0.1799, 0.5991, 0.2653, 0.6188]}, {"w": "and", "b": [0.2716, 0.5991, 0.3081, 0.6188]}, {"w": "benchmarks", "b": [0.3144, 0.5991, 0.4363, 0.6188]}, {"w": "Algorithmic", "b": [0.1799, 0.6196, 0.3032, 0.6393]}, {"w": "advances", "b": [0.3095, 0.6196, 0.402, 0.6393]}]}, {"id": "b_6", "type": "paragraph", "text": "Because the field is guided by experimental findings rather than by theory, algorithmic advances only become possible when appropriate data and hardware are available to try new ideas (or scale up old ideas, as is often the case). Machine learning isn’t mathematics or physics, where major advances can be done with a pen and a piece of paper. It’s an engineering science.", "words": [{"w": "Because", "b": [0.1294, 0.6624, 0.2135, 0.6821]}, {"w": "the", "b": [0.2198, 0.6624, 0.2506, 0.6821]}, {"w": "field", "b": [0.2569, 0.6624, 0.3031, 0.6821]}, {"w": "is", "b": [0.3094, 0.6624, 0.3263, 0.6821]}, {"w": "guided", "b": [0.3326, 0.6624, 0.4012, 0.6821]}, {"w": "by", "b": [0.4076, 0.6624, 0.4328, 0.6821]}, {"w": "experimental", "b": [0.4391, 0.6624, 0.5708, 0.6821]}, {"w": "findings", "b": [0.5771, 0.6624, 0.6598, 0.6821]}, {"w": "rather", "b": [0.6661, 0.6624, 0.7249, 0.6821]}, {"w": "than", "b": [0.7312, 0.6624, 0.7747, 0.6821]}, {"w": "by", "b": [0.781, 0.6624, 0.8062, 0.6821]}, {"w": "theory,", "b": [0.1294, 0.6829, 0.1985, 0.7026]}, {"w": "algorithmic", "b": [0.2048, 0.6829, 0.3211, 0.7026]}, {"w": "advances", "b": [0.3275, 0.6829, 0.4199, 0.7026]}, {"w": "only", "b": [0.4262, 0.6829, 0.4711, 0.7026]}, {"w": "become", "b": [0.4774, 0.6829, 0.5558, 0.7026]}, {"w": "possible", "b": [0.5621, 0.6829, 0.6448, 0.7026]}, {"w": "when", "b": [0.6511, 0.6829, 0.7058, 0.7026]}, {"w": "appropriate", "b": [0.712, 0.6829, 0.8269, 0.7026]}, {"w": "data", "b": [0.1294, 0.7034, 0.1714, 0.7231]}, {"w": "and", "b": [0.1777, 0.7034, 0.2142, 0.7231]}, {"w": "hardware", "b": [0.2205, 0.7034, 0.3143, 0.7231]}, {"w": "are", "b": [0.3206, 0.7034, 0.3514, 0.7231]}, {"w": "available", "b": [0.3577, 0.7034, 0.4488, 0.7231]}, {"w": "to", "b": [0.4551, 0.7034, 0.4747, 0.7231]}, {"w": "try", "b": [0.481, 0.7034, 0.5091, 0.7231]}, {"w": "new", "b": [0.5154, 0.7034, 0.5574, 0.7231]}, {"w": "ideas", "b": [0.5637, 0.7034, 0.6155, 0.7231]}, {"w": "(or", "b": [0.6218, 0.7034, 0.6513, 0.7231]}, {"w": "scale", "b": [0.6576, 0.7034, 0.708, 0.7231]}, {"w": "up", "b": [0.7143, 0.7034, 0.7395, 0.7231]}, {"w": "old", "b": [0.7458, 0.7034, 0.7781, 0.7231]}, {"w": "ideas,", "b": [0.7844, 0.7034, 0.8425, 0.7231]}, {"w": "as", "b": [0.8488, 0.7034, 0.8698, 0.7231]}, {"w": "is", "b": [0.1294, 0.7239, 0.1462, 0.7436]}, {"w": "often", "b": [0.1525, 0.7239, 0.2044, 0.7436]}, {"w": "the", "b": [0.2107, 0.7239, 0.2415, 0.7436]}, {"w": "case).", "b": [0.2478, 0.7239, 0.3059, 0.7436]}, {"w": "Machine", "b": [0.3122, 0.7239, 0.4005, 0.7436]}, {"w": "learning", "b": [0.4068, 0.7239, 0.4895, 0.7436]}, {"w": "isn’t", "b": [0.4957, 0.7239, 0.5401, 0.7436]}, {"w": "mathematics", "b": [0.5464, 0.7239, 0.674, 0.7436]}, {"w": "or", "b": [0.6803, 0.7239, 0.7013, 0.7436]}, {"w": "physics,", "b": [0.7076, 0.7239, 0.7896, 0.7436]}, {"w": "where", "b": [0.7959, 0.7239, 0.8575, 0.7436]}, {"w": "major", "b": [0.1294, 0.7444, 0.1883, 0.7641]}, {"w": "advances", "b": [0.1946, 0.7444, 0.287, 0.7641]}, {"w": "can", "b": [0.2933, 0.7444, 0.3283, 0.7641]}, {"w": "be", "b": [0.3346, 0.7444, 0.3585, 0.7641]}, {"w": "done", "b": [0.3648, 0.7444, 0.4138, 0.7641]}, {"w": "with", "b": [0.4201, 0.7444, 0.465, 0.7641]}, {"w": "a", "b": [0.4713, 0.7444, 0.4825, 0.7641]}, {"w": "pen", "b": [0.4888, 0.7444, 0.5252, 0.7641]}, {"w": "and", "b": [0.5315, 0.7444, 0.5679, 0.7641]}, {"w": "a", "b": [0.5742, 0.7444, 0.5854, 0.7641]}, {"w": "piece", "b": [0.5917, 0.7444, 0.645, 0.7641]}, {"w": "of", "b": [0.6513, 0.7444, 0.6723, 0.7641]}, {"w": "paper.", "b": [0.6786, 0.7444, 0.7395, 0.7641]}, {"w": "It’s", "b": [0.7458, 0.7444, 0.778, 0.7641]}, {"w": "an", "b": [0.7843, 0.7444, 0.8081, 0.7641]}, {"w": "engineering", "b": [0.1294, 0.7649, 0.2485, 0.7846]}, {"w": "science.", "b": [0.2548, 0.7649, 0.3354, 0.7846]}]}, {"id": "b_7", "type": "paragraph", "text": "The real bottlenecks throughout the 1990s and 2000s were data and hardware. But here’s what happened during that time: the internet took off, and high-performance graphics chips were developed for the needs of the gaming market.", "words": [{"w": "The", "b": [0.1294, 0.8076, 0.1686, 0.8274]}, {"w": "real", "b": [0.1749, 0.8076, 0.2128, 0.8274]}, {"w": "bottlenecks", "b": [0.2191, 0.8076, 0.334, 0.8274]}, {"w": "throughout", "b": [0.3403, 0.8076, 0.451, 0.8274]}, {"w": "the", "b": [0.4573, 0.8076, 0.4881, 0.8274]}, {"w": "1990s", "b": [0.4944, 0.8076, 0.5547, 0.8274]}, {"w": "and", "b": [0.561, 0.8076, 0.5974, 0.8274]}, {"w": "2000s", "b": [0.6037, 0.8076, 0.664, 0.8274]}, {"w": "were", "b": [0.6703, 0.8076, 0.7193, 0.8274]}, {"w": "data", "b": [0.7256, 0.8076, 0.7676, 0.8274]}, {"w": "and", "b": [0.774, 0.8076, 0.8104, 0.8274]}, {"w": "hardware.", "b": [0.1294, 0.8281, 0.2296, 0.8479]}, {"w": "But", "b": [0.2359, 0.8281, 0.2723, 0.8479]}, {"w": "here’s", "b": [0.2786, 0.8281, 0.3388, 0.8479]}, {"w": "what", "b": [0.3451, 0.8281, 0.3942, 0.8479]}, {"w": "happened", "b": [0.4005, 0.8281, 0.4972, 0.8479]}, {"w": "during", "b": [0.5035, 0.8281, 0.5693, 0.8479]}, {"w": "that", "b": [0.5756, 0.8281, 0.6135, 0.8479]}, {"w": "time:", "b": [0.6198, 0.8281, 0.6716, 0.8479]}, {"w": "the", "b": [0.6779, 0.8281, 0.7088, 0.8479]}, {"w": "internet", "b": [0.715, 0.8281, 0.7921, 0.8479]}, {"w": "took", "b": [0.7984, 0.8281, 0.8432, 0.8479]}, {"w": "off,", "b": [0.1294, 0.8486, 0.1647, 0.8684]}, {"w": "and", "b": [0.171, 0.8486, 0.2074, 0.8684]}, {"w": "high-performance", "b": [0.2137, 0.8486, 0.3944, 0.8684]}, {"w": "graphics", "b": [0.4007, 0.8486, 0.4862, 0.8684]}, {"w": "chips", "b": [0.4925, 0.8486, 0.5458, 0.8684]}, {"w": "were", "b": [0.5521, 0.8486, 0.6011, 0.8684]}, {"w": "developed", "b": [0.6074, 0.8486, 0.7111, 0.8684]}, {"w": "for", "b": [0.7174, 0.8486, 0.7468, 0.8684]}, {"w": "the", "b": [0.7531, 0.8486, 0.7839, 0.8684]}, {"w": "needs", "b": [0.7902, 0.8486, 0.8477, 0.8684]}, {"w": "of", "b": [0.1294, 0.8691, 0.1504, 0.8889]}, {"w": "the", "b": [0.1567, 0.8691, 0.1876, 0.8889]}, {"w": "gaming", "b": [0.1939, 0.8691, 0.2695, 0.8889]}, {"w": "market.", "b": [0.2758, 0.8691, 0.3522, 0.8889]}]}]}, {"page": 52, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1.3.1. Hardware", "words": [{"w": "1.3.1.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Hardware", "b": [0.1925, 0.0857, 0.3027, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Between 1990 and 2010, off-the-shelf CPUs became faster by a factor of approximately 5,000. As a result, nowadays it’s possible to run small deep-learning models on your laptop, whereas this would have been intractable 25 years ago.", "words": [{"w": "Between", "b": [0.1294, 0.1285, 0.2177, 0.1482]}, {"w": "1990", "b": [0.224, 0.1285, 0.2744, 0.1482]}, {"w": "and", "b": [0.2807, 0.1285, 0.3172, 0.1482]}, {"w": "2010,", "b": [0.3235, 0.1285, 0.3802, 0.1482]}, {"w": "off-the-shelf", "b": [0.3865, 0.1285, 0.5121, 0.1482]}, {"w": "CPUs", "b": [0.5185, 0.1285, 0.5773, 0.1482]}, {"w": "became", "b": [0.5836, 0.1285, 0.6607, 0.1482]}, {"w": "faster", "b": [0.667, 0.1285, 0.723, 0.1482]}, {"w": "by", "b": [0.7293, 0.1285, 0.7545, 0.1482]}, {"w": "a", "b": [0.7608, 0.1285, 0.772, 0.1482]}, {"w": "factor", "b": [0.7784, 0.1285, 0.8372, 0.1482]}, {"w": "of", "b": [0.8435, 0.1285, 0.8645, 0.1482]}, {"w": "approximately", "b": [0.1294, 0.149, 0.2751, 0.1687]}, {"w": "5,000.", "b": [0.2814, 0.149, 0.3445, 0.1687]}, {"w": "As", "b": [0.3508, 0.149, 0.3788, 0.1687]}, {"w": "a", "b": [0.3852, 0.149, 0.3964, 0.1687]}, {"w": "result,", "b": [0.4027, 0.149, 0.465, 0.1687]}, {"w": "nowadays", "b": [0.4713, 0.149, 0.5722, 0.1687]}, {"w": "it’s", "b": [0.5785, 0.149, 0.6093, 0.1687]}, {"w": "possible", "b": [0.6156, 0.149, 0.6983, 0.1687]}, {"w": "to", "b": [0.7046, 0.149, 0.7242, 0.1687]}, {"w": "run", "b": [0.7305, 0.149, 0.7642, 0.1687]}, {"w": "small", "b": [0.7705, 0.149, 0.8251, 0.1687]}, {"w": "deep-learning", "b": [0.1294, 0.1695, 0.2681, 0.1892]}, {"w": "models", "b": [0.2744, 0.1695, 0.3473, 0.1892]}, {"w": "on", "b": [0.3536, 0.1695, 0.3788, 0.1892]}, {"w": "your", "b": [0.3851, 0.1695, 0.4314, 0.1892]}, {"w": "laptop,", "b": [0.4377, 0.1695, 0.507, 0.1892]}, {"w": "whereas", "b": [0.5133, 0.1695, 0.596, 0.1892]}, {"w": "this", "b": [0.6023, 0.1695, 0.6387, 0.1892]}, {"w": "would", "b": [0.6451, 0.1695, 0.7081, 0.1892]}, {"w": "have", "b": [0.7144, 0.1695, 0.762, 0.1892]}, {"w": "been", "b": [0.7684, 0.1695, 0.816, 0.1892]}, {"w": "intractable", "b": [0.1294, 0.19, 0.2359, 0.2097]}, {"w": "25", "b": [0.2422, 0.19, 0.2674, 0.2097]}, {"w": "years", "b": [0.2737, 0.19, 0.327, 0.2097]}, {"w": "ago.", "b": [0.3333, 0.19, 0.376, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "But typical deep-learning models used in computer vision or speech recognition require orders of magnitude more computational power than what your laptop can deliver. Throughout the 2000s, companies like NVIDIA and AMD have been investing billions of dollars in developing fast, massively parallel chips (graphical processing units [GPUs]) to power the graphics of increasingly photorealistic video games—cheap, single-purpose supercomputers designed to render complex 3D scenes on your screen in real time. This investment came to benefit the scientific community when, in 2007, NVIDIA launched CUDA (https://developer.nvidia.com/about-cuda), a programming interface for its line of GPUs. A small number of GPUs started replacing massive clusters of CPUs in various highly parallelizable applications, beginning with physics modeling. Deep neural networks, consisting mostly of many small matrix multiplications, are also highly parallelizable; and around 2011, some researchers began to write CUDA implementations of neural nets—Dan Ciresan[4] and Alex Krizhevsky[5] were among the first.", "words": [{"w": "But", "b": [0.1294, 0.2327, 0.1659, 0.2525]}, {"w": "typical", "b": [0.1722, 0.2327, 0.2408, 0.2525]}, {"w": "deep-learning", "b": [0.2471, 0.2327, 0.3858, 0.2525]}, {"w": "models", "b": [0.3921, 0.2327, 0.465, 0.2525]}, {"w": "used", "b": [0.4713, 0.2327, 0.5176, 0.2525]}, {"w": "in", "b": [0.5239, 0.2327, 0.5435, 0.2525]}, {"w": "computer", "b": [0.5498, 0.2327, 0.6451, 0.2525]}, {"w": "vision", "b": [0.6514, 0.2327, 0.7131, 0.2525]}, {"w": "or", "b": [0.7194, 0.2327, 0.7404, 0.2525]}, {"w": "speech", "b": [0.7467, 0.2327, 0.8153, 0.2525]}, {"w": "recognition", "b": [0.1294, 0.2532, 0.2443, 0.273]}, {"w": "require", "b": [0.2506, 0.2532, 0.3221, 0.273]}, {"w": "orders", "b": [0.3284, 0.2532, 0.3914, 0.273]}, {"w": "of", "b": [0.3977, 0.2532, 0.4187, 0.273]}, {"w": "magnitude", "b": [0.425, 0.2532, 0.5315, 0.273]}, {"w": "more", "b": [0.5378, 0.2532, 0.5897, 0.273]}, {"w": "computational", "b": [0.596, 0.2532, 0.7403, 0.273]}, {"w": "power", "b": [0.7465, 0.2532, 0.8096, 0.273]}, {"w": "than", "b": [0.8159, 0.2532, 0.8593, 0.273]}, {"w": "what", "b": [0.1294, 0.2737, 0.1785, 0.2935]}, {"w": "your", "b": [0.1848, 0.2737, 0.231, 0.2935]}, {"w": "laptop", "b": [0.2373, 0.2737, 0.3004, 0.2935]}, {"w": "can", "b": [0.3067, 0.2737, 0.3417, 0.2935]}, {"w": "deliver.", "b": [0.348, 0.2737, 0.4229, 0.2935]}, {"w": "Throughout", "b": [0.4292, 0.2737, 0.5483, 0.2935]}, {"w": "the", "b": [0.5546, 0.2737, 0.5855, 0.2935]}, {"w": "2000s,", "b": [0.5918, 0.2737, 0.6584, 0.2935]}, {"w": "companies", "b": [0.6647, 0.2737, 0.7725, 0.2935]}, {"w": "like", "b": [0.7789, 0.2737, 0.8167, 0.2935]}, {"w": "NVIDIA", "b": [0.1294, 0.2942, 0.2191, 0.314]}, {"w": "and", "b": [0.2254, 0.2942, 0.2618, 0.314]}, {"w": "AMD", "b": [0.2681, 0.2942, 0.327, 0.314]}, {"w": "have", "b": [0.3333, 0.2942, 0.3809, 0.314]}, {"w": "been", "b": [0.3872, 0.2942, 0.4348, 0.314]}, {"w": "investing", "b": [0.4411, 0.2942, 0.5336, 0.314]}, {"w": "billions", "b": [0.5399, 0.2942, 0.6156, 0.314]}, {"w": "of", "b": [0.6219, 0.2942, 0.6429, 0.314]}, {"w": "dollars", "b": [0.6492, 0.2942, 0.7179, 0.314]}, {"w": "in", "b": [0.7242, 0.2942, 0.7438, 0.314]}, {"w": "developing", "b": [0.7501, 0.2942, 0.8623, 0.314]}, {"w": "fast,", "b": [0.1294, 0.3147, 0.1721, 0.3345]}, {"w": "massively", "b": [0.1785, 0.3147, 0.2794, 0.3345]}, {"w": "parallel", "b": [0.2857, 0.3147, 0.3613, 0.3345]}, {"w": "chips", "b": [0.3676, 0.3147, 0.4209, 0.3345]}, {"w": "(graphical", "b": [0.4272, 0.3147, 0.5294, 0.3345]}, {"w": "processing", "b": [0.5357, 0.3147, 0.6436, 0.3345]}, {"w": "units", "b": [0.6499, 0.3147, 0.699, 0.3345]}, {"w": "[GPUs])", "b": [0.7053, 0.3147, 0.7908, 0.3345]}, {"w": "to", "b": [0.7971, 0.3147, 0.8167, 0.3345]}, {"w": "power", "b": [0.1294, 0.3352, 0.1925, 0.355]}, {"w": "the", "b": [0.1988, 0.3352, 0.2296, 0.355]}, {"w": "graphics", "b": [0.2359, 0.3352, 0.3214, 0.355]}, {"w": "of", "b": [0.3277, 0.3352, 0.3487, 0.355]}, {"w": "increasingly", "b": [0.355, 0.3352, 0.4783, 0.355]}, {"w": "photorealistic", "b": [0.4845, 0.3352, 0.6219, 0.355]}, {"w": "video", "b": [0.6282, 0.3352, 0.6842, 0.355]}, {"w": "games—cheap,", "b": [0.6905, 0.3352, 0.8453, 0.355]}, {"w": "single-purpose", "b": [0.1294, 0.3557, 0.2779, 0.3755]}, {"w": "supercomputers", "b": [0.2842, 0.3557, 0.444, 0.3755]}, {"w": "designed", "b": [0.4503, 0.3557, 0.54, 0.3755]}, {"w": "to", "b": [0.5463, 0.3557, 0.5659, 0.3755]}, {"w": "render", "b": [0.5722, 0.3557, 0.6366, 0.3755]}, {"w": "complex", "b": [0.6429, 0.3557, 0.7298, 0.3755]}, {"w": "3D", "b": [0.7361, 0.3557, 0.7669, 0.3755]}, {"w": "scenes", "b": [0.7732, 0.3557, 0.8391, 0.3755]}, {"w": "on", "b": [0.8454, 0.3557, 0.8706, 0.3755]}, {"w": "your", "b": [0.1294, 0.3762, 0.1757, 0.396]}, {"w": "screen", "b": [0.182, 0.3762, 0.2464, 0.396]}, {"w": "in", "b": [0.2527, 0.3762, 0.2723, 0.396]}, {"w": "real", "b": [0.2786, 0.3762, 0.3164, 0.396]}, {"w": "time.", "b": [0.3227, 0.3762, 0.3739, 0.396]}, {"w": "This", "b": [0.3802, 0.3762, 0.425, 0.396]}, {"w": "investment", "b": [0.4313, 0.3762, 0.542, 0.396]}, {"w": "came", "b": [0.5483, 0.3762, 0.6016, 0.396]}, {"w": "to", "b": [0.6079, 0.3762, 0.6275, 0.396]}, {"w": "benefit", "b": [0.6338, 0.3762, 0.7039, 0.396]}, {"w": "the", "b": [0.7102, 0.3762, 0.741, 0.396]}, {"w": "scientific", "b": [0.7473, 0.3762, 0.8398, 0.396]}, {"w": "community", "b": [0.1294, 0.3967, 0.2443, 0.4165]}, {"w": "when,", "b": [0.2506, 0.3967, 0.3116, 0.4165]}, {"w": "in", "b": [0.3179, 0.3967, 0.3375, 0.4165]}, {"w": "2007,", "b": [0.3438, 0.3967, 0.4006, 0.4165]}, {"w": "NVIDIA", "b": [0.4069, 0.3967, 0.4965, 0.4165]}, {"w": "launched", "b": [0.5029, 0.3967, 0.5939, 0.4165]}, {"w": "CUDA", "b": [0.6002, 0.3967, 0.6717, 0.4165]}, {"w": "(https://developer.nvidia.com/about-cuda),", "b": [0.1294, 0.4172, 0.5588, 0.437]}, {"w": "a", "b": [0.5651, 0.4172, 0.5763, 0.437]}, {"w": "programming", "b": [0.5826, 0.4172, 0.7199, 0.437]}, {"w": "interface", "b": [0.7263, 0.4172, 0.8145, 0.437]}, {"w": "for", "b": [0.8208, 0.4172, 0.8502, 0.437]}, {"w": "its", "b": [0.1294, 0.4377, 0.1533, 0.4575]}, {"w": "line", "b": [0.1596, 0.4377, 0.1974, 0.4575]}, {"w": "of", "b": [0.2037, 0.4377, 0.2247, 0.4575]}, {"w": "GPUs.", "b": [0.231, 0.4377, 0.2976, 0.4575]}, {"w": "A", "b": [0.3039, 0.4377, 0.3221, 0.4575]}, {"w": "small", "b": [0.3284, 0.4377, 0.3831, 0.4575]}, {"w": "number", "b": [0.3894, 0.4377, 0.4665, 0.4575]}, {"w": "of", "b": [0.4728, 0.4377, 0.4938, 0.4575]}, {"w": "GPUs", "b": [0.5001, 0.4377, 0.5603, 0.4575]}, {"w": "started", "b": [0.5667, 0.4377, 0.6339, 0.4575]}, {"w": "replacing", "b": [0.6402, 0.4377, 0.7341, 0.4575]}, {"w": "massive", "b": [0.7404, 0.4377, 0.8217, 0.4575]}, {"w": "clusters", "b": [0.1294, 0.4582, 0.2065, 0.478]}, {"w": "of", "b": [0.2128, 0.4582, 0.2338, 0.478]}, {"w": "CPUs", "b": [0.2401, 0.4582, 0.299, 0.478]}, {"w": "in", "b": [0.3053, 0.4582, 0.3249, 0.478]}, {"w": "various", "b": [0.3312, 0.4582, 0.4055, 0.478]}, {"w": "highly", "b": [0.4118, 0.4582, 0.4763, 0.478]}, {"w": "parallelizable", "b": [0.4826, 0.4582, 0.6185, 0.478]}, {"w": "applications,", "b": [0.6248, 0.4582, 0.753, 0.478]}, {"w": "beginning", "b": [0.7593, 0.4582, 0.8602, 0.478]}, {"w": "with", "b": [0.1294, 0.4787, 0.1743, 0.4985]}, {"w": "physics", "b": [0.1806, 0.4787, 0.2562, 0.4985]}, {"w": "modeling.", "b": [0.2626, 0.4787, 0.3642, 0.4985]}, {"w": "Deep", "b": [0.3705, 0.4787, 0.4237, 0.4985]}, {"w": "neural", "b": [0.43, 0.4787, 0.493, 0.4985]}, {"w": "networks,", "b": [0.4993, 0.4787, 0.5981, 0.4985]}, {"w": "consisting", "b": [0.6044, 0.4787, 0.7068, 0.4985]}, {"w": "mostly", "b": [0.7131, 0.4787, 0.7818, 0.4985]}, {"w": "of", "b": [0.7881, 0.4787, 0.8091, 0.4985]}, {"w": "many", "b": [0.1294, 0.4992, 0.1855, 0.519]}, {"w": "small", "b": [0.1918, 0.4992, 0.2464, 0.519]}, {"w": "matrix", "b": [0.2527, 0.4992, 0.3186, 0.519]}, {"w": "multiplications,", "b": [0.3249, 0.4992, 0.4826, 0.519]}, {"w": "are", "b": [0.4889, 0.4992, 0.5197, 0.519]}, {"w": "also", "b": [0.526, 0.4992, 0.5666, 0.519]}, {"w": "highly", "b": [0.5729, 0.4992, 0.6374, 0.519]}, {"w": "parallelizable;", "b": [0.6437, 0.4992, 0.7866, 0.519]}, {"w": "and", "b": [0.7929, 0.4992, 0.8293, 0.519]}, {"w": "around", "b": [0.1294, 0.5197, 0.1995, 0.5395]}, {"w": "2011,", "b": [0.2058, 0.5197, 0.2616, 0.5395]}, {"w": "some", "b": [0.2679, 0.5197, 0.3211, 0.5395]}, {"w": "researchers", "b": [0.3275, 0.5197, 0.4409, 0.5395]}, {"w": "began", "b": [0.4472, 0.5197, 0.5074, 0.5395]}, {"w": "to", "b": [0.5137, 0.5197, 0.5334, 0.5395]}, {"w": "write", "b": [0.5397, 0.5197, 0.5915, 0.5395]}, {"w": "CUDA", "b": [0.5978, 0.5197, 0.6693, 0.5395]}, {"w": "implementations", "b": [0.6756, 0.5197, 0.8438, 0.5395]}, {"w": "of", "b": [0.1294, 0.542, 0.1504, 0.5618]}, {"w": "neural", "b": [0.1567, 0.542, 0.2198, 0.5618]}, {"w": "nets—Dan", "b": [0.2261, 0.542, 0.334, 0.5618]}, {"w": "Ciresan[4]", "b": [0.3403, 0.5398, 0.4393, 0.5618]}, {"w": "and", "b": [0.4456, 0.542, 0.4821, 0.5618]}, {"w": "Alex", "b": [0.4884, 0.542, 0.5374, 0.5618]}, {"w": "Krizhevsky[5]", "b": [0.5437, 0.5398, 0.682, 0.5618]}, {"w": "were", "b": [0.6883, 0.542, 0.7373, 0.5618]}, {"w": "among", "b": [0.7436, 0.542, 0.8123, 0.5618]}, {"w": "the", "b": [0.8186, 0.542, 0.8494, 0.5618]}, {"w": "first.", "b": [0.1294, 0.5625, 0.1764, 0.5823]}]}, {"id": "b_4", "type": "paragraph", "text": "See “Flexible, High Performance Convolutional Neural Networks for Image Classification,” Proceedings of the 22nd International Joint Conference on Artificial Intelligence (2011), www.ijcai.org/Proceedings/11/Papers/210.pdf.", "words": [{"w": "See", "b": [0.1483, 0.628, 0.1757, 0.6428]}, {"w": "“Flexible,", "b": [0.1804, 0.628, 0.2555, 0.6428]}, {"w": "High", "b": [0.2603, 0.628, 0.2981, 0.6428]}, {"w": "Performance", "b": [0.3028, 0.628, 0.3995, 0.6428]}, {"w": "Convolutional", "b": [0.4042, 0.628, 0.5125, 0.6428]}, {"w": "Neural", "b": [0.5172, 0.628, 0.5687, 0.6428]}, {"w": "Networks", "b": [0.5734, 0.628, 0.647, 0.6428]}, {"w": "for", "b": [0.6517, 0.628, 0.6738, 0.6428]}, {"w": "Image", "b": [0.6785, 0.628, 0.7258, 0.6428]}, {"w": "Classification,”", "b": [0.7305, 0.628, 0.8477, 0.6428]}, {"w": "Proceedings", "b": [0.1483, 0.6432, 0.2422, 0.658]}, {"w": "of", "b": [0.2469, 0.6432, 0.2617, 0.658]}, {"w": "the", "b": [0.2664, 0.6432, 0.2895, 0.658]}, {"w": "22nd", "b": [0.2942, 0.6432, 0.3321, 0.658]}, {"w": "International", "b": [0.3368, 0.6432, 0.4367, 0.658]}, {"w": "Joint", "b": [0.4414, 0.6432, 0.4792, 0.658]}, {"w": "Conference", "b": [0.484, 0.6432, 0.5704, 0.658]}, {"w": "on", "b": [0.5752, 0.6432, 0.5941, 0.658]}, {"w": "Artificial", "b": [0.5988, 0.6432, 0.6671, 0.658]}, {"w": "Intelligence", "b": [0.6719, 0.6432, 0.7612, 0.658]}, {"w": "(2011),", "b": [0.7659, 0.6432, 0.8203, 0.658]}, {"w": "www.ijcai.org/Proceedings/11/Papers/210.pdf.", "b": [0.1483, 0.6583, 0.5002, 0.6731]}]}, {"id": "b_6", "type": "paragraph", "text": "See “ImageNet Classification with Deep Convolutional Neural Networks,” Advances in Neural Information Processing Systems 25 (2012), http://mng.bz/2286.", "words": [{"w": "See", "b": [0.1483, 0.7145, 0.1757, 0.7293]}, {"w": "“ImageNet", "b": [0.1804, 0.7145, 0.2634, 0.7293]}, {"w": "Classification", "b": [0.2681, 0.7145, 0.3722, 0.7293]}, {"w": "with", "b": [0.3769, 0.7145, 0.4105, 0.7293]}, {"w": "Deep", "b": [0.4153, 0.7145, 0.4552, 0.7293]}, {"w": "Convolutional", "b": [0.4599, 0.7145, 0.5682, 0.7293]}, {"w": "Neural", "b": [0.5729, 0.7145, 0.6244, 0.7293]}, {"w": "Networks,”", "b": [0.6291, 0.7145, 0.7158, 0.7293]}, {"w": "Advances", "b": [0.7205, 0.7145, 0.793, 0.7293]}, {"w": "in", "b": [0.7977, 0.7145, 0.8124, 0.7293]}, {"w": "Neural", "b": [0.1483, 0.7296, 0.2009, 0.7444]}, {"w": "Information", "b": [0.2056, 0.7296, 0.296, 0.7444]}, {"w": "Processing", "b": [0.3007, 0.7296, 0.3841, 0.7444]}, {"w": "Systems", "b": [0.3888, 0.7296, 0.4487, 0.7444]}, {"w": "25", "b": [0.4535, 0.7296, 0.4724, 0.7444]}, {"w": "(2012),", "b": [0.4771, 0.7296, 0.5323, 0.7444]}, {"w": "http://mng.bz/2286.", "b": [0.537, 0.7296, 0.6863, 0.7444]}]}, {"id": "b_7", "type": "paragraph", "text": "What happened is that the gaming market subsidized supercomputing for the next generation of artificial intelligence applications. Sometimes, big things begin as games. Today, the NVIDIA TITAN X, a gaming GPU that cost $1,000 at the end of 2015, can deliver a peak of 6.6 TFLOPS in single precision: 6.6 trillion float32 operations per second. That’s about 350 times more than what you can get out of a modern laptop. On a TITAN X, it takes only a couple of days to train an ImageNet model of", "words": [{"w": "What", "b": [0.1294, 0.7675, 0.1841, 0.7873]}, {"w": "happened", "b": [0.1904, 0.7675, 0.287, 0.7873]}, {"w": "is", "b": [0.2933, 0.7675, 0.3102, 0.7873]}, {"w": "that", "b": [0.3165, 0.7675, 0.3543, 0.7873]}, {"w": "the", "b": [0.3606, 0.7675, 0.3914, 0.7873]}, {"w": "gaming", "b": [0.3977, 0.7675, 0.4734, 0.7873]}, {"w": "market", "b": [0.4797, 0.7675, 0.5498, 0.7873]}, {"w": "subsidized", "b": [0.5561, 0.7675, 0.6626, 0.7873]}, {"w": "supercomputing", "b": [0.6689, 0.7675, 0.8314, 0.7873]}, {"w": "for", "b": [0.8378, 0.7675, 0.8672, 0.7873]}, {"w": "the", "b": [0.1294, 0.788, 0.1602, 0.8078]}, {"w": "next", "b": [0.1665, 0.788, 0.21, 0.8078]}, {"w": "generation", "b": [0.2163, 0.788, 0.3228, 0.8078]}, {"w": "of", "b": [0.3291, 0.788, 0.3501, 0.8078]}, {"w": "artificial", "b": [0.3564, 0.788, 0.4419, 0.8078]}, {"w": "intelligence", "b": [0.4482, 0.788, 0.5659, 0.8078]}, {"w": "applications.", "b": [0.5722, 0.788, 0.7004, 0.8078]}, {"w": "Sometimes,", "b": [0.7066, 0.788, 0.825, 0.8078]}, {"w": "big", "b": [0.8313, 0.788, 0.8635, 0.8078]}, {"w": "things", "b": [0.1294, 0.8085, 0.1911, 0.8283]}, {"w": "begin", "b": [0.1974, 0.8085, 0.2534, 0.8283]}, {"w": "as", "b": [0.2598, 0.8085, 0.2808, 0.8283]}, {"w": "games.", "b": [0.2871, 0.8085, 0.3578, 0.8283]}, {"w": "Today,", "b": [0.3641, 0.8085, 0.4315, 0.8283]}, {"w": "the", "b": [0.4378, 0.8085, 0.4686, 0.8283]}, {"w": "NVIDIA", "b": [0.4749, 0.8085, 0.5646, 0.8283]}, {"w": "TITAN", "b": [0.5709, 0.8085, 0.6445, 0.8283]}, {"w": "X,", "b": [0.6508, 0.8085, 0.6753, 0.8283]}, {"w": "a", "b": [0.6816, 0.8085, 0.6928, 0.8283]}, {"w": "gaming", "b": [0.6991, 0.8085, 0.7748, 0.8283]}, {"w": "GPU", "b": [0.7811, 0.8085, 0.8316, 0.8283]}, {"w": "that", "b": [0.1294, 0.829, 0.1673, 0.8488]}, {"w": "cost", "b": [0.1736, 0.829, 0.2142, 0.8488]}, {"w": "$1,000", "b": [0.2205, 0.829, 0.2899, 0.8488]}, {"w": "at", "b": [0.2962, 0.829, 0.3144, 0.8488]}, {"w": "the", "b": [0.3207, 0.829, 0.3515, 0.8488]}, {"w": "end", "b": [0.3578, 0.829, 0.3943, 0.8488]}, {"w": "of", "b": [0.4006, 0.829, 0.4216, 0.8488]}, {"w": "2015,", "b": [0.4279, 0.829, 0.4846, 0.8488]}, {"w": "can", "b": [0.4909, 0.829, 0.526, 0.8488]}, {"w": "deliver", "b": [0.5323, 0.829, 0.6023, 0.8488]}, {"w": "a", "b": [0.6086, 0.829, 0.6198, 0.8488]}, {"w": "peak", "b": [0.6261, 0.829, 0.6737, 0.8488]}, {"w": "of", "b": [0.68, 0.829, 0.701, 0.8488]}, {"w": "6.6", "b": [0.7073, 0.829, 0.7389, 0.8488]}, {"w": "TFLOPS", "b": [0.7452, 0.829, 0.8363, 0.8488]}, {"w": "in", "b": [0.8426, 0.829, 0.8622, 0.8488]}, {"w": "single", "b": [0.1294, 0.8495, 0.1897, 0.8693]}, {"w": "precision:", "b": [0.196, 0.8495, 0.2955, 0.8693]}, {"w": "6.6", "b": [0.3018, 0.8495, 0.3333, 0.8693]}, {"w": "trillion", "b": [0.3396, 0.8495, 0.4083, 0.8693]}, {"w": "float32", "b": [0.4146, 0.8506, 0.5205, 0.8708]}, {"w": "operations", "b": [0.5268, 0.8495, 0.6319, 0.8693]}, {"w": "per", "b": [0.6382, 0.8495, 0.6704, 0.8693]}, {"w": "second.", "b": [0.6767, 0.8495, 0.7531, 0.8693]}, {"w": "That’s", "b": [0.7594, 0.8495, 0.8224, 0.8693]}, {"w": "about", "b": [0.1294, 0.8709, 0.1855, 0.8907]}, {"w": "350", "b": [0.1918, 0.8709, 0.2296, 0.8907]}, {"w": "times", "b": [0.2359, 0.8709, 0.2906, 0.8907]}, {"w": "more", "b": [0.2969, 0.8709, 0.3487, 0.8907]}, {"w": "than", "b": [0.355, 0.8709, 0.3985, 0.8907]}, {"w": "what", "b": [0.4048, 0.8709, 0.4538, 0.8907]}, {"w": "you", "b": [0.4601, 0.8709, 0.498, 0.8907]}, {"w": "can", "b": [0.5043, 0.8709, 0.5393, 0.8907]}, {"w": "get", "b": [0.5456, 0.8709, 0.5764, 0.8907]}, {"w": "out", "b": [0.5827, 0.8709, 0.615, 0.8907]}, {"w": "of", "b": [0.6213, 0.8709, 0.6423, 0.8907]}, {"w": "a", "b": [0.6486, 0.8709, 0.6598, 0.8907]}, {"w": "modern", "b": [0.6661, 0.8709, 0.7432, 0.8907]}, {"w": "laptop.", "b": [0.7495, 0.8709, 0.8188, 0.8907]}, {"w": "On", "b": [0.8251, 0.8709, 0.856, 0.8907]}, {"w": "a", "b": [0.1294, 0.8914, 0.1406, 0.9112]}, {"w": "TITAN", "b": [0.1469, 0.8914, 0.2205, 0.9112]}, {"w": "X,", "b": [0.2268, 0.8914, 0.2514, 0.9112]}, {"w": "it", "b": [0.2577, 0.8914, 0.2717, 0.9112]}, {"w": "takes", "b": [0.278, 0.8914, 0.3298, 0.9112]}, {"w": "only", "b": [0.3361, 0.8914, 0.381, 0.9112]}, {"w": "a", "b": [0.3873, 0.8914, 0.3985, 0.9112]}, {"w": "couple", "b": [0.4048, 0.8914, 0.472, 0.9112]}, {"w": "of", "b": [0.4784, 0.8914, 0.4994, 0.9112]}, {"w": "days", "b": [0.5057, 0.8914, 0.5519, 0.9112]}, {"w": "to", "b": [0.5582, 0.8914, 0.5778, 0.9112]}, {"w": "train", "b": [0.5841, 0.8914, 0.6304, 0.9112]}, {"w": "an", "b": [0.6367, 0.8914, 0.6605, 0.9112]}, {"w": "ImageNet", "b": [0.6668, 0.8914, 0.7663, 0.9112]}, {"w": "model", "b": [0.7726, 0.8914, 0.8356, 0.9112]}, {"w": "of", "b": [0.842, 0.8914, 0.863, 0.9112]}]}]}, {"page": 53, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the sort that would have won the ILSVRC competition a few years ago. Meanwhile, large companies train deep-learning models on clusters of hundreds of GPUs of a type developed specifically for the needs of deep learning, such as the NVIDIA Tesla K80. The sheer computational power of such clusters is something that would never have been possible without modern GPUs.", "words": [{"w": "the", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "sort", "b": [0.1665, 0.0857, 0.2044, 0.1054]}, {"w": "that", "b": [0.2107, 0.0857, 0.2485, 0.1054]}, {"w": "would", "b": [0.2548, 0.0857, 0.3179, 0.1054]}, {"w": "have", "b": [0.3242, 0.0857, 0.3718, 0.1054]}, {"w": "won", "b": [0.3781, 0.0857, 0.4216, 0.1054]}, {"w": "the", "b": [0.4279, 0.0857, 0.4587, 0.1054]}, {"w": "ILSVRC", "b": [0.465, 0.0857, 0.5547, 0.1054]}, {"w": "competition", "b": [0.561, 0.0857, 0.6816, 0.1054]}, {"w": "a", "b": [0.6879, 0.0857, 0.6991, 0.1054]}, {"w": "few", "b": [0.7054, 0.0857, 0.7432, 0.1054]}, {"w": "years", "b": [0.7495, 0.0857, 0.8027, 0.1054]}, {"w": "ago.", "b": [0.809, 0.0857, 0.8518, 0.1054]}, {"w": "Meanwhile,", "b": [0.1294, 0.1062, 0.2492, 0.1259]}, {"w": "large", "b": [0.2555, 0.1062, 0.3055, 0.1259]}, {"w": "companies", "b": [0.3118, 0.1062, 0.4197, 0.1259]}, {"w": "train", "b": [0.426, 0.1062, 0.4722, 0.1259]}, {"w": "deep-learning", "b": [0.4785, 0.1062, 0.6172, 0.1259]}, {"w": "models", "b": [0.6235, 0.1062, 0.6964, 0.1259]}, {"w": "on", "b": [0.7027, 0.1062, 0.7279, 0.1259]}, {"w": "clusters", "b": [0.7342, 0.1062, 0.8113, 0.1259]}, {"w": "of", "b": [0.8176, 0.1062, 0.8386, 0.1259]}, {"w": "hundreds", "b": [0.1294, 0.1267, 0.2219, 0.1464]}, {"w": "of", "b": [0.2282, 0.1267, 0.2492, 0.1464]}, {"w": "GPUs", "b": [0.2555, 0.1267, 0.3158, 0.1464]}, {"w": "of", "b": [0.3221, 0.1267, 0.3431, 0.1464]}, {"w": "a", "b": [0.3494, 0.1267, 0.3606, 0.1464]}, {"w": "type", "b": [0.3669, 0.1267, 0.4104, 0.1464]}, {"w": "developed", "b": [0.4167, 0.1267, 0.5203, 0.1464]}, {"w": "specifically", "b": [0.5266, 0.1267, 0.6429, 0.1464]}, {"w": "for", "b": [0.6492, 0.1267, 0.6787, 0.1464]}, {"w": "the", "b": [0.685, 0.1267, 0.7158, 0.1464]}, {"w": "needs", "b": [0.7221, 0.1267, 0.7795, 0.1464]}, {"w": "of", "b": [0.7858, 0.1267, 0.8068, 0.1464]}, {"w": "deep", "b": [0.8131, 0.1267, 0.8607, 0.1464]}, {"w": "learning,", "b": [0.1294, 0.1472, 0.2184, 0.1669]}, {"w": "such", "b": [0.2247, 0.1472, 0.2709, 0.1669]}, {"w": "as", "b": [0.2772, 0.1472, 0.2982, 0.1669]}, {"w": "the", "b": [0.3046, 0.1472, 0.3354, 0.1669]}, {"w": "NVIDIA", "b": [0.3417, 0.1472, 0.4313, 0.1669]}, {"w": "Tesla", "b": [0.4376, 0.1472, 0.4905, 0.1669]}, {"w": "K80.", "b": [0.4968, 0.1472, 0.5466, 0.1669]}, {"w": "The", "b": [0.5529, 0.1472, 0.5921, 0.1669]}, {"w": "sheer", "b": [0.5984, 0.1472, 0.6516, 0.1669]}, {"w": "computational", "b": [0.6579, 0.1472, 0.8023, 0.1669]}, {"w": "power", "b": [0.1294, 0.1677, 0.1925, 0.1874]}, {"w": "of", "b": [0.1988, 0.1677, 0.2198, 0.1874]}, {"w": "such", "b": [0.2261, 0.1677, 0.2723, 0.1874]}, {"w": "clusters", "b": [0.2786, 0.1677, 0.3557, 0.1874]}, {"w": "is", "b": [0.362, 0.1677, 0.3788, 0.1874]}, {"w": "something", "b": [0.3851, 0.1677, 0.4902, 0.1874]}, {"w": "that", "b": [0.4965, 0.1677, 0.5344, 0.1874]}, {"w": "would", "b": [0.5407, 0.1677, 0.6038, 0.1874]}, {"w": "never", "b": [0.6101, 0.1677, 0.6661, 0.1874]}, {"w": "have", "b": [0.6724, 0.1677, 0.72, 0.1874]}, {"w": "been", "b": [0.7263, 0.1677, 0.7739, 0.1874]}, {"w": "possible", "b": [0.7802, 0.1677, 0.8629, 0.1874]}, {"w": "without", "b": [0.1294, 0.1882, 0.2065, 0.2079]}, {"w": "modern", "b": [0.2128, 0.1882, 0.2899, 0.2079]}, {"w": "GPUs.", "b": [0.2962, 0.1882, 0.3628, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "What’s more, the deep-learning industry is starting to go beyond GPUs and is investing in increasingly specialized, efficient chips for deep learning. In 2016, at its annual I/O convention, Google revealed its tensor processing unit (TPU) project: a new chip design developed from the ground up to run deep neural networks, which is reportedly 10 times faster and far more energy efficient than top-of-the-line GPUs.", "words": [{"w": "What’s", "b": [0.1294, 0.231, 0.2009, 0.2507]}, {"w": "more,", "b": [0.2072, 0.231, 0.2653, 0.2507]}, {"w": "the", "b": [0.2716, 0.231, 0.3024, 0.2507]}, {"w": "deep-learning", "b": [0.3088, 0.231, 0.4474, 0.2507]}, {"w": "industry", "b": [0.4537, 0.231, 0.5364, 0.2507]}, {"w": "is", "b": [0.5427, 0.231, 0.5596, 0.2507]}, {"w": "starting", "b": [0.5659, 0.231, 0.6416, 0.2507]}, {"w": "to", "b": [0.6479, 0.231, 0.6675, 0.2507]}, {"w": "go", "b": [0.6738, 0.231, 0.699, 0.2507]}, {"w": "beyond", "b": [0.7053, 0.231, 0.7796, 0.2507]}, {"w": "GPUs", "b": [0.7859, 0.231, 0.8462, 0.2507]}, {"w": "and", "b": [0.1294, 0.2515, 0.1658, 0.2712]}, {"w": "is", "b": [0.1721, 0.2515, 0.189, 0.2712]}, {"w": "investing", "b": [0.1953, 0.2515, 0.2878, 0.2712]}, {"w": "in", "b": [0.2941, 0.2515, 0.3137, 0.2712]}, {"w": "increasingly", "b": [0.32, 0.2515, 0.4433, 0.2712]}, {"w": "specialized,", "b": [0.4496, 0.2515, 0.568, 0.2712]}, {"w": "efficient", "b": [0.5743, 0.2515, 0.6578, 0.2712]}, {"w": "chips", "b": [0.6641, 0.2515, 0.7174, 0.2712]}, {"w": "for", "b": [0.7237, 0.2515, 0.7531, 0.2712]}, {"w": "deep", "b": [0.7594, 0.2515, 0.807, 0.2712]}, {"w": "learning.", "b": [0.1294, 0.272, 0.2184, 0.2917]}, {"w": "In", "b": [0.2247, 0.272, 0.2457, 0.2917]}, {"w": "2016,", "b": [0.252, 0.272, 0.3088, 0.2917]}, {"w": "at", "b": [0.3151, 0.272, 0.3333, 0.2917]}, {"w": "its", "b": [0.3396, 0.272, 0.3634, 0.2917]}, {"w": "annual", "b": [0.3697, 0.272, 0.437, 0.2917]}, {"w": "I/O", "b": [0.4433, 0.272, 0.4769, 0.2917]}, {"w": "convention,", "b": [0.4832, 0.272, 0.6016, 0.2917]}, {"w": "Google", "b": [0.6079, 0.272, 0.6822, 0.2917]}, {"w": "revealed", "b": [0.6885, 0.272, 0.774, 0.2917]}, {"w": "its", "b": [0.7803, 0.272, 0.8041, 0.2917]}, {"w": "tensor", "b": [0.1294, 0.2925, 0.1911, 0.3122]}, {"w": "processing", "b": [0.1974, 0.2925, 0.3053, 0.3122]}, {"w": "unit", "b": [0.3116, 0.2925, 0.3508, 0.3122]}, {"w": "(TPU)", "b": [0.3571, 0.2925, 0.4216, 0.3122]}, {"w": "project:", "b": [0.4279, 0.2925, 0.5049, 0.3122]}, {"w": "a", "b": [0.5112, 0.2925, 0.5224, 0.3122]}, {"w": "new", "b": [0.5287, 0.2925, 0.5707, 0.3122]}, {"w": "chip", "b": [0.577, 0.2925, 0.6205, 0.3122]}, {"w": "design", "b": [0.6268, 0.2925, 0.6927, 0.3122]}, {"w": "developed", "b": [0.699, 0.2925, 0.8026, 0.3122]}, {"w": "from", "b": [0.8089, 0.2925, 0.858, 0.3122]}, {"w": "the", "b": [0.1294, 0.313, 0.1602, 0.3327]}, {"w": "ground", "b": [0.1665, 0.313, 0.238, 0.3327]}, {"w": "up", "b": [0.2443, 0.313, 0.2695, 0.3327]}, {"w": "to", "b": [0.2758, 0.313, 0.2955, 0.3327]}, {"w": "run", "b": [0.3018, 0.313, 0.3354, 0.3327]}, {"w": "deep", "b": [0.3417, 0.313, 0.3893, 0.3327]}, {"w": "neural", "b": [0.3956, 0.313, 0.4587, 0.3327]}, {"w": "networks,", "b": [0.465, 0.313, 0.5638, 0.3327]}, {"w": "which", "b": [0.5701, 0.313, 0.6317, 0.3327]}, {"w": "is", "b": [0.638, 0.313, 0.6549, 0.3327]}, {"w": "reportedly", "b": [0.6612, 0.313, 0.7648, 0.3327]}, {"w": "10", "b": [0.7712, 0.313, 0.7964, 0.3327]}, {"w": "times", "b": [0.8027, 0.313, 0.8574, 0.3327]}, {"w": "faster", "b": [0.1294, 0.3335, 0.1854, 0.3532]}, {"w": "and", "b": [0.1917, 0.3335, 0.2282, 0.3532]}, {"w": "far", "b": [0.2345, 0.3335, 0.2625, 0.3532]}, {"w": "more", "b": [0.2688, 0.3335, 0.3206, 0.3532]}, {"w": "energy", "b": [0.3269, 0.3335, 0.3951, 0.3532]}, {"w": "efficient", "b": [0.4014, 0.3335, 0.485, 0.3532]}, {"w": "than", "b": [0.4913, 0.3335, 0.5347, 0.3532]}, {"w": "top-of-the-line", "b": [0.541, 0.3335, 0.6881, 0.3532]}, {"w": "GPUs.", "b": [0.6945, 0.3335, 0.761, 0.3532]}]}, {"id": "b_2", "type": "paragraph", "text": "1.3.2. Data", "words": [{"w": "1.3.2.", "b": [0.1294, 0.3807, 0.1862, 0.4004]}, {"w": "Data", "b": [0.1925, 0.3807, 0.2443, 0.4004]}]}, {"id": "b_3", "type": "paragraph", "text": "AI is sometimes heralded as the new industrial revolution. If deep learning is the steam engine of this revolution, then data is its coal: the raw material that powers our intelligent machines, without which nothing would be possible. When it comes to data, in addition to the exponential progress in storage hardware over the past 20 years (following Moore’s law), the game changer has been the rise of the internet, making it feasible to collect and distribute very large datasets for machine learning. Today, large companies work with image datasets, video datasets, and natural--language datasets that couldn’t have been collected without the internet. User-generated image tags on Flickr, for instance, have been a treasure trove of data for computer vision. So are YouTube videos. And Wikipedia is a key dataset for natural-language processing.", "words": [{"w": "AI", "b": [0.1294, 0.4235, 0.156, 0.4432]}, {"w": "is", "b": [0.1623, 0.4235, 0.1792, 0.4432]}, {"w": "sometimes", "b": [0.1855, 0.4235, 0.2934, 0.4432]}, {"w": "heralded", "b": [0.2997, 0.4235, 0.3865, 0.4432]}, {"w": "as", "b": [0.3928, 0.4235, 0.4139, 0.4432]}, {"w": "the", "b": [0.4202, 0.4235, 0.451, 0.4432]}, {"w": "new", "b": [0.4573, 0.4235, 0.4993, 0.4432]}, {"w": "industrial", "b": [0.5056, 0.4235, 0.6009, 0.4432]}, {"w": "revolution.", "b": [0.6072, 0.4235, 0.7172, 0.4432]}, {"w": "If", "b": [0.7236, 0.4235, 0.7404, 0.4432]}, {"w": "deep", "b": [0.7467, 0.4235, 0.7943, 0.4432]}, {"w": "learning", "b": [0.1294, 0.444, 0.2121, 0.4637]}, {"w": "is", "b": [0.2184, 0.444, 0.2352, 0.4637]}, {"w": "the", "b": [0.2415, 0.444, 0.2723, 0.4637]}, {"w": "steam", "b": [0.2786, 0.444, 0.3375, 0.4637]}, {"w": "engine", "b": [0.3438, 0.444, 0.4111, 0.4637]}, {"w": "of", "b": [0.4174, 0.444, 0.4384, 0.4637]}, {"w": "this", "b": [0.4447, 0.444, 0.4811, 0.4637]}, {"w": "revolution,", "b": [0.4874, 0.444, 0.5975, 0.4637]}, {"w": "then", "b": [0.6038, 0.444, 0.6472, 0.4637]}, {"w": "data", "b": [0.6535, 0.444, 0.6955, 0.4637]}, {"w": "is", "b": [0.7017, 0.444, 0.7186, 0.4637]}, {"w": "its", "b": [0.7249, 0.444, 0.7487, 0.4637]}, {"w": "coal:", "b": [0.755, 0.444, 0.8041, 0.4637]}, {"w": "the", "b": [0.8104, 0.444, 0.8412, 0.4637]}, {"w": "raw", "b": [0.1294, 0.4645, 0.1672, 0.4842]}, {"w": "material", "b": [0.1735, 0.4645, 0.2562, 0.4842]}, {"w": "that", "b": [0.2625, 0.4645, 0.3003, 0.4842]}, {"w": "powers", "b": [0.3066, 0.4645, 0.3795, 0.4842]}, {"w": "our", "b": [0.3858, 0.4645, 0.4194, 0.4842]}, {"w": "intelligent", "b": [0.4257, 0.4645, 0.5281, 0.4842]}, {"w": "machines,", "b": [0.5344, 0.4645, 0.6359, 0.4842]}, {"w": "without", "b": [0.6423, 0.4645, 0.7193, 0.4842]}, {"w": "which", "b": [0.7256, 0.4645, 0.7873, 0.4842]}, {"w": "nothing", "b": [0.7936, 0.4645, 0.8707, 0.4842]}, {"w": "would", "b": [0.1294, 0.485, 0.1925, 0.5047]}, {"w": "be", "b": [0.1988, 0.485, 0.2226, 0.5047]}, {"w": "possible.", "b": [0.2289, 0.485, 0.3179, 0.5047]}, {"w": "When", "b": [0.3242, 0.485, 0.3844, 0.5047]}, {"w": "it", "b": [0.3908, 0.485, 0.4048, 0.5047]}, {"w": "comes", "b": [0.4111, 0.485, 0.4755, 0.5047]}, {"w": "to", "b": [0.4818, 0.485, 0.5014, 0.5047]}, {"w": "data,", "b": [0.5077, 0.485, 0.5561, 0.5047]}, {"w": "in", "b": [0.5624, 0.485, 0.582, 0.5047]}, {"w": "addition", "b": [0.5883, 0.485, 0.671, 0.5047]}, {"w": "to", "b": [0.6773, 0.485, 0.6969, 0.5047]}, {"w": "the", "b": [0.7032, 0.485, 0.7341, 0.5047]}, {"w": "exponential", "b": [0.7404, 0.485, 0.8581, 0.5047]}, {"w": "progress", "b": [0.1294, 0.5055, 0.2149, 0.5252]}, {"w": "in", "b": [0.2212, 0.5055, 0.2408, 0.5252]}, {"w": "storage", "b": [0.2471, 0.5055, 0.32, 0.5252]}, {"w": "hardware", "b": [0.3263, 0.5055, 0.4201, 0.5252]}, {"w": "over", "b": [0.4264, 0.5055, 0.4712, 0.5252]}, {"w": "the", "b": [0.4776, 0.5055, 0.5084, 0.5252]}, {"w": "past", "b": [0.5147, 0.5055, 0.5553, 0.5252]}, {"w": "20", "b": [0.5616, 0.5055, 0.5869, 0.5252]}, {"w": "years", "b": [0.5932, 0.5055, 0.6464, 0.5252]}, {"w": "(following", "b": [0.6527, 0.5055, 0.7592, 0.5252]}, {"w": "Moore’s", "b": [0.7655, 0.5055, 0.8495, 0.5252]}, {"w": "law),", "b": [0.1294, 0.526, 0.1805, 0.5457]}, {"w": "the", "b": [0.1869, 0.526, 0.2177, 0.5457]}, {"w": "game", "b": [0.224, 0.526, 0.2786, 0.5457]}, {"w": "changer", "b": [0.2849, 0.526, 0.3647, 0.5457]}, {"w": "has", "b": [0.3711, 0.526, 0.4047, 0.5457]}, {"w": "been", "b": [0.411, 0.526, 0.4586, 0.5457]}, {"w": "the", "b": [0.4649, 0.526, 0.4957, 0.5457]}, {"w": "rise", "b": [0.502, 0.526, 0.5385, 0.5457]}, {"w": "of", "b": [0.5448, 0.526, 0.5658, 0.5457]}, {"w": "the", "b": [0.5721, 0.526, 0.6029, 0.5457]}, {"w": "internet,", "b": [0.6092, 0.526, 0.6926, 0.5457]}, {"w": "making", "b": [0.6989, 0.526, 0.7746, 0.5457]}, {"w": "it", "b": [0.7809, 0.526, 0.7949, 0.5457]}, {"w": "feasible", "b": [0.1294, 0.5465, 0.2079, 0.5662]}, {"w": "to", "b": [0.2142, 0.5465, 0.2338, 0.5662]}, {"w": "collect", "b": [0.2401, 0.5465, 0.3074, 0.5662]}, {"w": "and", "b": [0.3137, 0.5465, 0.3501, 0.5662]}, {"w": "distribute", "b": [0.3564, 0.5465, 0.4517, 0.5662]}, {"w": "very", "b": [0.458, 0.5465, 0.5028, 0.5662]}, {"w": "large", "b": [0.5091, 0.5465, 0.559, 0.5662]}, {"w": "datasets", "b": [0.5653, 0.5465, 0.6452, 0.5662]}, {"w": "for", "b": [0.6515, 0.5465, 0.6809, 0.5662]}, {"w": "machine", "b": [0.6872, 0.5465, 0.7727, 0.5662]}, {"w": "learning.", "b": [0.779, 0.5465, 0.868, 0.5662]}, {"w": "Today,", "b": [0.1294, 0.567, 0.1968, 0.5867]}, {"w": "large", "b": [0.2031, 0.567, 0.253, 0.5867]}, {"w": "companies", "b": [0.2593, 0.567, 0.3672, 0.5867]}, {"w": "work", "b": [0.3735, 0.567, 0.4254, 0.5867]}, {"w": "with", "b": [0.4317, 0.567, 0.4765, 0.5867]}, {"w": "image", "b": [0.4828, 0.567, 0.5445, 0.5867]}, {"w": "datasets,", "b": [0.5508, 0.567, 0.637, 0.5867]}, {"w": "video", "b": [0.6433, 0.567, 0.6993, 0.5867]}, {"w": "datasets,", "b": [0.7056, 0.567, 0.7918, 0.5867]}, {"w": "and", "b": [0.7981, 0.567, 0.8345, 0.5867]}, {"w": "natural--language", "b": [0.1294, 0.5875, 0.3073, 0.6072]}, {"w": "datasets", "b": [0.3136, 0.5875, 0.3935, 0.6072]}, {"w": "that", "b": [0.3998, 0.5875, 0.4376, 0.6072]}, {"w": "couldn’t", "b": [0.444, 0.5875, 0.5275, 0.6072]}, {"w": "have", "b": [0.5338, 0.5875, 0.5814, 0.6072]}, {"w": "been", "b": [0.5877, 0.5875, 0.6354, 0.6072]}, {"w": "collected", "b": [0.6417, 0.5875, 0.7327, 0.6072]}, {"w": "without", "b": [0.739, 0.5875, 0.8161, 0.6072]}, {"w": "the", "b": [0.8224, 0.5875, 0.8532, 0.6072]}, {"w": "internet.", "b": [0.1294, 0.608, 0.2128, 0.6277]}, {"w": "User-generated", "b": [0.2191, 0.608, 0.3726, 0.6277]}, {"w": "image", "b": [0.379, 0.608, 0.4406, 0.6277]}, {"w": "tags", "b": [0.4469, 0.608, 0.4876, 0.6277]}, {"w": "on", "b": [0.4939, 0.608, 0.5191, 0.6277]}, {"w": "Flickr,", "b": [0.5254, 0.608, 0.5909, 0.6277]}, {"w": "for", "b": [0.5972, 0.608, 0.6266, 0.6277]}, {"w": "instance,", "b": [0.6329, 0.608, 0.7219, 0.6277]}, {"w": "have", "b": [0.7282, 0.608, 0.7758, 0.6277]}, {"w": "been", "b": [0.7821, 0.608, 0.8298, 0.6277]}, {"w": "a", "b": [0.8361, 0.608, 0.8473, 0.6277]}, {"w": "treasure", "b": [0.1294, 0.6285, 0.2093, 0.6482]}, {"w": "trove", "b": [0.2156, 0.6285, 0.2674, 0.6482]}, {"w": "of", "b": [0.2737, 0.6285, 0.2947, 0.6482]}, {"w": "data", "b": [0.301, 0.6285, 0.343, 0.6482]}, {"w": "for", "b": [0.3494, 0.6285, 0.3788, 0.6482]}, {"w": "computer", "b": [0.3851, 0.6285, 0.4804, 0.6482]}, {"w": "vision.", "b": [0.4867, 0.6285, 0.5546, 0.6482]}, {"w": "So", "b": [0.5609, 0.6285, 0.5875, 0.6482]}, {"w": "are", "b": [0.5938, 0.6285, 0.6246, 0.6482]}, {"w": "YouTube", "b": [0.6309, 0.6285, 0.7228, 0.6482]}, {"w": "videos.", "b": [0.7291, 0.6285, 0.8013, 0.6482]}, {"w": "And", "b": [0.8076, 0.6285, 0.851, 0.6482]}, {"w": "Wikipedia", "b": [0.1294, 0.649, 0.2335, 0.6687]}, {"w": "is", "b": [0.2398, 0.649, 0.2566, 0.6687]}, {"w": "a", "b": [0.2629, 0.649, 0.2741, 0.6687]}, {"w": "key", "b": [0.2804, 0.649, 0.3169, 0.6687]}, {"w": "dataset", "b": [0.3232, 0.649, 0.3932, 0.6687]}, {"w": "for", "b": [0.3995, 0.649, 0.4289, 0.6687]}, {"w": "natural-language", "b": [0.4352, 0.649, 0.6048, 0.6687]}, {"w": "processing.", "b": [0.6111, 0.649, 0.7253, 0.6687]}]}, {"id": "b_4", "type": "paragraph", "text": "If there’s one dataset that has been a catalyst for the rise of deep learning, it’s the ImageNet dataset, consisting of 1.4 million images that have been hand annotated with 1,000 image categories (1 category per image). But what makes ImageNet special isn’t just its large size, but also the yearly competition associated with it.[6]", "words": [{"w": "If", "b": [0.1294, 0.6918, 0.1462, 0.7115]}, {"w": "there’s", "b": [0.1525, 0.6918, 0.2198, 0.7115]}, {"w": "one", "b": [0.2261, 0.6918, 0.2625, 0.7115]}, {"w": "dataset", "b": [0.2688, 0.6918, 0.3388, 0.7115]}, {"w": "that", "b": [0.3452, 0.6918, 0.383, 0.7115]}, {"w": "has", "b": [0.3893, 0.6918, 0.4229, 0.7115]}, {"w": "been", "b": [0.4292, 0.6918, 0.4769, 0.7115]}, {"w": "a", "b": [0.4832, 0.6918, 0.4944, 0.7115]}, {"w": "catalyst", "b": [0.5007, 0.6918, 0.5777, 0.7115]}, {"w": "for", "b": [0.584, 0.6918, 0.6135, 0.7115]}, {"w": "the", "b": [0.6198, 0.6918, 0.6506, 0.7115]}, {"w": "rise", "b": [0.6569, 0.6918, 0.6933, 0.7115]}, {"w": "of", "b": [0.6996, 0.6918, 0.7206, 0.7115]}, {"w": "deep", "b": [0.7269, 0.6918, 0.7746, 0.7115]}, {"w": "learning,", "b": [0.7809, 0.6918, 0.8698, 0.7115]}, {"w": "it’s", "b": [0.1294, 0.7123, 0.1603, 0.732]}, {"w": "the", "b": [0.1666, 0.7123, 0.1974, 0.732]}, {"w": "ImageNet", "b": [0.2037, 0.7123, 0.3032, 0.732]}, {"w": "dataset,", "b": [0.3095, 0.7123, 0.3858, 0.732]}, {"w": "consisting", "b": [0.3921, 0.7123, 0.4944, 0.732]}, {"w": "of", "b": [0.5007, 0.7123, 0.5218, 0.732]}, {"w": "1.4", "b": [0.5281, 0.7123, 0.5596, 0.732]}, {"w": "million", "b": [0.5659, 0.7123, 0.6388, 0.732]}, {"w": "images", "b": [0.6451, 0.7123, 0.7165, 0.732]}, {"w": "that", "b": [0.7228, 0.7123, 0.7607, 0.732]}, {"w": "have", "b": [0.767, 0.7123, 0.8146, 0.732]}, {"w": "been", "b": [0.8209, 0.7123, 0.8685, 0.732]}, {"w": "hand", "b": [0.1294, 0.7328, 0.1785, 0.7525]}, {"w": "annotated", "b": [0.1848, 0.7328, 0.2828, 0.7525]}, {"w": "with", "b": [0.2891, 0.7328, 0.334, 0.7525]}, {"w": "1,000", "b": [0.3403, 0.7328, 0.3971, 0.7525]}, {"w": "image", "b": [0.4034, 0.7328, 0.465, 0.7525]}, {"w": "categories", "b": [0.4713, 0.7328, 0.5736, 0.7525]}, {"w": "(1", "b": [0.5799, 0.7328, 0.6009, 0.7525]}, {"w": "category", "b": [0.6072, 0.7328, 0.6941, 0.7525]}, {"w": "per", "b": [0.7004, 0.7328, 0.7326, 0.7525]}, {"w": "image).", "b": [0.7389, 0.7328, 0.8152, 0.7525]}, {"w": "But", "b": [0.8216, 0.7328, 0.858, 0.7525]}, {"w": "what", "b": [0.1294, 0.7533, 0.1785, 0.773]}, {"w": "makes", "b": [0.1848, 0.7533, 0.2492, 0.773]}, {"w": "ImageNet", "b": [0.2555, 0.7533, 0.355, 0.773]}, {"w": "special", "b": [0.3613, 0.7533, 0.4313, 0.773]}, {"w": "isn’t", "b": [0.4376, 0.7533, 0.482, 0.773]}, {"w": "just", "b": [0.4883, 0.7533, 0.5248, 0.773]}, {"w": "its", "b": [0.5311, 0.7533, 0.5549, 0.773]}, {"w": "large", "b": [0.5612, 0.7533, 0.6112, 0.773]}, {"w": "size,", "b": [0.6175, 0.7533, 0.663, 0.773]}, {"w": "but", "b": [0.6693, 0.7533, 0.7015, 0.773]}, {"w": "also", "b": [0.7078, 0.7533, 0.7485, 0.773]}, {"w": "the", "b": [0.7548, 0.7533, 0.7856, 0.773]}, {"w": "yearly", "b": [0.7919, 0.7533, 0.855, 0.773]}, {"w": "competition", "b": [0.1294, 0.7756, 0.2499, 0.7953]}, {"w": "associated", "b": [0.2562, 0.7756, 0.3599, 0.7953]}, {"w": "with", "b": [0.3662, 0.7756, 0.4111, 0.7953]}, {"w": "it.[6]", "b": [0.4174, 0.7733, 0.4597, 0.7953]}]}, {"id": "b_6", "type": "paragraph", "text": "The ImageNet Large Scale Visual Recognition Challenge (ILSVRC), www.image- net.org/challenges/LSVRC.", "words": [{"w": "The", "b": [0.1483, 0.841, 0.1778, 0.8558]}, {"w": "ImageNet", "b": [0.1825, 0.841, 0.2571, 0.8558]}, {"w": "Large", "b": [0.2618, 0.841, 0.3056, 0.8558]}, {"w": "Scale", "b": [0.3103, 0.841, 0.3513, 0.8558]}, {"w": "Visual", "b": [0.356, 0.841, 0.4043, 0.8558]}, {"w": "Recognition", "b": [0.409, 0.841, 0.5015, 0.8558]}, {"w": "Challenge", "b": [0.5062, 0.841, 0.5829, 0.8558]}, {"w": "(ILSVRC),", "b": [0.5877, 0.841, 0.6723, 0.8558]}, {"w": "www.image-", "b": [0.6769, 0.841, 0.774, 0.8558]}, {"w": "net.org/challenges/LSVRC.", "b": [0.1483, 0.8562, 0.3571, 0.871]}]}]}, {"page": 54, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As Kaggle has been demonstrating since 2010, public competitions are an excellent way to motivate researchers and engineers to push the envelope. Having common benchmarks that researchers compete to beat has greatly helped the recent rise of deep learning.", "words": [{"w": "As", "b": [0.1294, 0.0857, 0.1574, 0.1054]}, {"w": "Kaggle", "b": [0.1637, 0.0857, 0.2366, 0.1054]}, {"w": "has", "b": [0.2429, 0.0857, 0.2765, 0.1054]}, {"w": "been", "b": [0.2828, 0.0857, 0.3305, 0.1054]}, {"w": "demonstrating", "b": [0.3368, 0.0857, 0.4811, 0.1054]}, {"w": "since", "b": [0.4874, 0.0857, 0.5393, 0.1054]}, {"w": "2010,", "b": [0.5456, 0.0857, 0.6023, 0.1054]}, {"w": "public", "b": [0.6086, 0.0857, 0.6717, 0.1054]}, {"w": "competitions", "b": [0.678, 0.0857, 0.8083, 0.1054]}, {"w": "are", "b": [0.8146, 0.0857, 0.8454, 0.1054]}, {"w": "an", "b": [0.1294, 0.1062, 0.1532, 0.1259]}, {"w": "excellent", "b": [0.1595, 0.1062, 0.2506, 0.1259]}, {"w": "way", "b": [0.2569, 0.1062, 0.2989, 0.1259]}, {"w": "to", "b": [0.3052, 0.1062, 0.3249, 0.1259]}, {"w": "motivate", "b": [0.3312, 0.1062, 0.4195, 0.1259]}, {"w": "researchers", "b": [0.4258, 0.1062, 0.5392, 0.1259]}, {"w": "and", "b": [0.5455, 0.1062, 0.5819, 0.1259]}, {"w": "engineers", "b": [0.5882, 0.1062, 0.6849, 0.1259]}, {"w": "to", "b": [0.6911, 0.1062, 0.7107, 0.1259]}, {"w": "push", "b": [0.7171, 0.1062, 0.7647, 0.1259]}, {"w": "the", "b": [0.771, 0.1062, 0.8018, 0.1259]}, {"w": "envelope.", "b": [0.1294, 0.1267, 0.2268, 0.1464]}, {"w": "Having", "b": [0.2331, 0.1267, 0.3074, 0.1464]}, {"w": "common", "b": [0.3137, 0.1267, 0.402, 0.1464]}, {"w": "benchmarks", "b": [0.4083, 0.1267, 0.5301, 0.1464]}, {"w": "that", "b": [0.5365, 0.1267, 0.5743, 0.1464]}, {"w": "researchers", "b": [0.5806, 0.1267, 0.694, 0.1464]}, {"w": "compete", "b": [0.7003, 0.1267, 0.7858, 0.1464]}, {"w": "to", "b": [0.7921, 0.1267, 0.8117, 0.1464]}, {"w": "beat", "b": [0.8181, 0.1267, 0.8601, 0.1464]}, {"w": "has", "b": [0.1294, 0.1472, 0.163, 0.1669]}, {"w": "greatly", "b": [0.1693, 0.1472, 0.2394, 0.1669]}, {"w": "helped", "b": [0.2457, 0.1472, 0.313, 0.1669]}, {"w": "the", "b": [0.3193, 0.1472, 0.3501, 0.1669]}, {"w": "recent", "b": [0.3564, 0.1472, 0.418, 0.1669]}, {"w": "rise", "b": [0.4243, 0.1472, 0.4608, 0.1669]}, {"w": "of", "b": [0.4671, 0.1472, 0.4881, 0.1669]}, {"w": "deep", "b": [0.4944, 0.1472, 0.542, 0.1669]}, {"w": "learning.", "b": [0.5482, 0.1472, 0.6372, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "1.3.3. Algorithms", "words": [{"w": "1.3.3.", "b": [0.1294, 0.1944, 0.1862, 0.2142]}, {"w": "Algorithms", "b": [0.1925, 0.1944, 0.3144, 0.2142]}]}, {"id": "b_2", "type": "paragraph", "text": "In addition to hardware and data, until the late 2000s, we were missing a reliable way to train very deep neural networks. As a result, neural networks were still fairly shallow, using only one or two layers of representations; thus, they weren’t able to shine against more-refined shallow methods such as SVMs and random forests. The key issue was that of gradient propagation through deep stacks of layers. The feedback signal used to train neural networks would fade away as the number of layers increased.", "words": [{"w": "In", "b": [0.1294, 0.2372, 0.1504, 0.2569]}, {"w": "addition", "b": [0.1567, 0.2372, 0.2394, 0.2569]}, {"w": "to", "b": [0.2457, 0.2372, 0.2654, 0.2569]}, {"w": "hardware", "b": [0.2717, 0.2372, 0.3655, 0.2569]}, {"w": "and", "b": [0.3718, 0.2372, 0.4082, 0.2569]}, {"w": "data,", "b": [0.4145, 0.2372, 0.4629, 0.2569]}, {"w": "until", "b": [0.4692, 0.2372, 0.5154, 0.2569]}, {"w": "the", "b": [0.5217, 0.2372, 0.5526, 0.2569]}, {"w": "late", "b": [0.5589, 0.2372, 0.5953, 0.2569]}, {"w": "2000s,", "b": [0.6016, 0.2372, 0.6682, 0.2569]}, {"w": "we", "b": [0.6745, 0.2372, 0.7039, 0.2569]}, {"w": "were", "b": [0.7102, 0.2372, 0.7592, 0.2569]}, {"w": "missing", "b": [0.7655, 0.2372, 0.844, 0.2569]}, {"w": "a", "b": [0.8503, 0.2372, 0.8615, 0.2569]}, {"w": "reliable", "b": [0.1294, 0.2577, 0.2051, 0.2774]}, {"w": "way", "b": [0.2114, 0.2577, 0.2534, 0.2774]}, {"w": "to", "b": [0.2597, 0.2577, 0.2793, 0.2774]}, {"w": "train", "b": [0.2856, 0.2577, 0.3319, 0.2774]}, {"w": "very", "b": [0.3382, 0.2577, 0.383, 0.2774]}, {"w": "deep", "b": [0.3893, 0.2577, 0.4369, 0.2774]}, {"w": "neural", "b": [0.4432, 0.2577, 0.5063, 0.2774]}, {"w": "networks.", "b": [0.5126, 0.2577, 0.6114, 0.2774]}, {"w": "As", "b": [0.6176, 0.2577, 0.6456, 0.2774]}, {"w": "a", "b": [0.6519, 0.2577, 0.6631, 0.2774]}, {"w": "result,", "b": [0.6694, 0.2577, 0.7318, 0.2774]}, {"w": "neural", "b": [0.7381, 0.2577, 0.8012, 0.2774]}, {"w": "networks", "b": [0.1294, 0.2782, 0.2219, 0.2979]}, {"w": "were", "b": [0.2282, 0.2782, 0.2772, 0.2979]}, {"w": "still", "b": [0.2835, 0.2782, 0.3214, 0.2979]}, {"w": "fairly", "b": [0.3277, 0.2782, 0.3823, 0.2979]}, {"w": "shallow,", "b": [0.3886, 0.2782, 0.4717, 0.2979]}, {"w": "using", "b": [0.478, 0.2782, 0.5327, 0.2979]}, {"w": "only", "b": [0.539, 0.2782, 0.5839, 0.2979]}, {"w": "one", "b": [0.5902, 0.2782, 0.6266, 0.2979]}, {"w": "or", "b": [0.6329, 0.2782, 0.6539, 0.2979]}, {"w": "two", "b": [0.6602, 0.2782, 0.6981, 0.2979]}, {"w": "layers", "b": [0.7044, 0.2782, 0.7646, 0.2979]}, {"w": "of", "b": [0.7709, 0.2782, 0.7919, 0.2979]}, {"w": "representations;", "b": [0.1294, 0.2987, 0.2891, 0.3184]}, {"w": "thus,", "b": [0.2954, 0.2987, 0.3438, 0.3184]}, {"w": "they", "b": [0.3501, 0.2987, 0.3936, 0.3184]}, {"w": "weren’t", "b": [0.3999, 0.2987, 0.4764, 0.3184]}, {"w": "able", "b": [0.4827, 0.2987, 0.5247, 0.3184]}, {"w": "to", "b": [0.531, 0.2987, 0.5507, 0.3184]}, {"w": "shine", "b": [0.557, 0.2987, 0.6102, 0.3184]}, {"w": "against", "b": [0.6165, 0.2987, 0.688, 0.3184]}, {"w": "more-refined", "b": [0.6943, 0.2987, 0.826, 0.3184]}, {"w": "shallow", "b": [0.1294, 0.3192, 0.2079, 0.3389]}, {"w": "methods", "b": [0.2142, 0.3192, 0.2997, 0.3389]}, {"w": "such", "b": [0.306, 0.3192, 0.3522, 0.3389]}, {"w": "as", "b": [0.3585, 0.3192, 0.3795, 0.3389]}, {"w": "SVMs", "b": [0.3858, 0.3192, 0.4503, 0.3389]}, {"w": "and", "b": [0.4566, 0.3192, 0.493, 0.3389]}, {"w": "random", "b": [0.4993, 0.3192, 0.5764, 0.3389]}, {"w": "forests.", "b": [0.5827, 0.3192, 0.6563, 0.3389]}, {"w": "The", "b": [0.6626, 0.3192, 0.7018, 0.3389]}, {"w": "key", "b": [0.7081, 0.3192, 0.7445, 0.3389]}, {"w": "issue", "b": [0.7508, 0.3192, 0.8013, 0.3389]}, {"w": "was", "b": [0.8076, 0.3192, 0.8468, 0.3389]}, {"w": "that", "b": [0.1294, 0.3397, 0.1673, 0.3594]}, {"w": "of", "b": [0.1736, 0.3397, 0.1946, 0.3594]}, {"w": "gradient", "b": [0.2009, 0.3397, 0.2863, 0.3594]}, {"w": "propagation", "b": [0.2926, 0.3397, 0.4164, 0.3594]}, {"w": "through", "b": [0.4227, 0.3397, 0.5012, 0.3594]}, {"w": "deep", "b": [0.5075, 0.3397, 0.5552, 0.3594]}, {"w": "stacks", "b": [0.5615, 0.3397, 0.6231, 0.3594]}, {"w": "of", "b": [0.6294, 0.3397, 0.6504, 0.3594]}, {"w": "layers.", "b": [0.6567, 0.3397, 0.7233, 0.3594]}, {"w": "The", "b": [0.7296, 0.3397, 0.7688, 0.3594]}, {"w": "feedback", "b": [0.7751, 0.3397, 0.8662, 0.3594]}, {"w": "signal", "b": [0.1294, 0.3602, 0.1897, 0.3799]}, {"w": "used", "b": [0.196, 0.3602, 0.2422, 0.3799]}, {"w": "to", "b": [0.2485, 0.3602, 0.2682, 0.3799]}, {"w": "train", "b": [0.2745, 0.3602, 0.3207, 0.3799]}, {"w": "neural", "b": [0.327, 0.3602, 0.39, 0.3799]}, {"w": "networks", "b": [0.3964, 0.3602, 0.4888, 0.3799]}, {"w": "would", "b": [0.4951, 0.3602, 0.5582, 0.3799]}, {"w": "fade", "b": [0.5645, 0.3602, 0.6079, 0.3799]}, {"w": "away", "b": [0.6142, 0.3602, 0.6675, 0.3799]}, {"w": "as", "b": [0.6738, 0.3602, 0.6948, 0.3799]}, {"w": "the", "b": [0.7011, 0.3602, 0.7319, 0.3799]}, {"w": "number", "b": [0.7382, 0.3602, 0.8153, 0.3799]}, {"w": "of", "b": [0.8216, 0.3602, 0.8426, 0.3799]}, {"w": "layers", "b": [0.1294, 0.3807, 0.1897, 0.4004]}, {"w": "increased.", "b": [0.1959, 0.3807, 0.2975, 0.4004]}]}, {"id": "b_3", "type": "paragraph", "text": "This changed around 2009–2010 with the advent of several simple but important algorithmic improvements that allowed for better gradient propagation:", "words": [{"w": "This", "b": [0.1294, 0.4235, 0.1743, 0.4432]}, {"w": "changed", "b": [0.1806, 0.4235, 0.2646, 0.4432]}, {"w": "around", "b": [0.2709, 0.4235, 0.341, 0.4432]}, {"w": "2009–2010", "b": [0.3473, 0.4235, 0.4608, 0.4432]}, {"w": "with", "b": [0.4671, 0.4235, 0.512, 0.4432]}, {"w": "the", "b": [0.5183, 0.4235, 0.5491, 0.4432]}, {"w": "advent", "b": [0.5554, 0.4235, 0.6227, 0.4432]}, {"w": "of", "b": [0.629, 0.4235, 0.65, 0.4432]}, {"w": "several", "b": [0.6563, 0.4235, 0.7277, 0.4432]}, {"w": "simple", "b": [0.734, 0.4235, 0.8013, 0.4432]}, {"w": "but", "b": [0.8076, 0.4235, 0.8398, 0.4432]}, {"w": "important", "b": [0.1294, 0.444, 0.2275, 0.4637]}, {"w": "algorithmic", "b": [0.2338, 0.444, 0.3501, 0.4637]}, {"w": "improvements", "b": [0.3564, 0.444, 0.5008, 0.4637]}, {"w": "that", "b": [0.5071, 0.444, 0.5449, 0.4637]}, {"w": "allowed", "b": [0.5512, 0.444, 0.6311, 0.4637]}, {"w": "for", "b": [0.6374, 0.444, 0.6668, 0.4637]}, {"w": "better", "b": [0.6731, 0.444, 0.7306, 0.4637]}, {"w": "gradient", "b": [0.7368, 0.444, 0.8194, 0.4637]}, {"w": "propagation:", "b": [0.1294, 0.4645, 0.2569, 0.4842]}]}, {"id": "b_4", "type": "paragraph", "text": "Better activation functions for neural layers Better weight-initialization schemes, starting with layer-wise pretraining, which was quickly abandoned Better optimization schemes, such as RMSProp and Adam", "words": [{"w": "Better", "b": [0.1799, 0.5028, 0.2415, 0.5226]}, {"w": "activation", "b": [0.2478, 0.5028, 0.3487, 0.5226]}, {"w": "functions", "b": [0.355, 0.5028, 0.4475, 0.5226]}, {"w": "for", "b": [0.4538, 0.5028, 0.4832, 0.5226]}, {"w": "neural", "b": [0.4895, 0.5028, 0.5525, 0.5226]}, {"w": "layers", "b": [0.5588, 0.5028, 0.6191, 0.5226]}, {"w": "Better", "b": [0.1799, 0.5233, 0.2415, 0.5431]}, {"w": "weight-initialization", "b": [0.2478, 0.5233, 0.4525, 0.5431]}, {"w": "schemes,", "b": [0.4588, 0.5233, 0.5491, 0.5431]}, {"w": "starting", "b": [0.5554, 0.5233, 0.631, 0.5431]}, {"w": "with", "b": [0.6374, 0.5233, 0.6822, 0.5431]}, {"w": "layer-wise", "b": [0.6885, 0.5233, 0.793, 0.5431]}, {"w": "pretraining,", "b": [0.1799, 0.5438, 0.2969, 0.5636]}, {"w": "which", "b": [0.3032, 0.5438, 0.3648, 0.5636]}, {"w": "was", "b": [0.3711, 0.5438, 0.4104, 0.5636]}, {"w": "quickly", "b": [0.4167, 0.5438, 0.4923, 0.5636]}, {"w": "abandoned", "b": [0.4986, 0.5438, 0.6079, 0.5636]}, {"w": "Better", "b": [0.1799, 0.5643, 0.2415, 0.5841]}, {"w": "optimization", "b": [0.2478, 0.5643, 0.3739, 0.5841]}, {"w": "schemes,", "b": [0.3803, 0.5643, 0.4706, 0.5841]}, {"w": "such", "b": [0.4769, 0.5643, 0.5231, 0.5841]}, {"w": "as", "b": [0.5294, 0.5643, 0.5505, 0.5841]}, {"w": "RMSProp", "b": [0.5568, 0.5643, 0.6577, 0.5841]}, {"w": "and", "b": [0.664, 0.5643, 0.7004, 0.5841]}, {"w": "Adam", "b": [0.7067, 0.5643, 0.7684, 0.5841]}]}, {"id": "b_5", "type": "paragraph", "text": "Only when these improvements began to allow for training models with 10 or more layers did deep learning start to shine.", "words": [{"w": "Only", "b": [0.1294, 0.6071, 0.1799, 0.6268]}, {"w": "when", "b": [0.1862, 0.6071, 0.2408, 0.6268]}, {"w": "these", "b": [0.2471, 0.6071, 0.299, 0.6268]}, {"w": "improvements", "b": [0.3053, 0.6071, 0.4496, 0.6268]}, {"w": "began", "b": [0.4559, 0.6071, 0.5161, 0.6268]}, {"w": "to", "b": [0.5225, 0.6071, 0.5421, 0.6268]}, {"w": "allow", "b": [0.5484, 0.6071, 0.6044, 0.6268]}, {"w": "for", "b": [0.6107, 0.6071, 0.6402, 0.6268]}, {"w": "training", "b": [0.6465, 0.6071, 0.7249, 0.6268]}, {"w": "models", "b": [0.7312, 0.6071, 0.8041, 0.6268]}, {"w": "with", "b": [0.8104, 0.6071, 0.8553, 0.6268]}, {"w": "10", "b": [0.1294, 0.6276, 0.1546, 0.6473]}, {"w": "or", "b": [0.1609, 0.6276, 0.182, 0.6473]}, {"w": "more", "b": [0.1883, 0.6276, 0.2401, 0.6473]}, {"w": "layers", "b": [0.2464, 0.6276, 0.3066, 0.6473]}, {"w": "did", "b": [0.313, 0.6276, 0.3452, 0.6473]}, {"w": "deep", "b": [0.3515, 0.6276, 0.3991, 0.6473]}, {"w": "learning", "b": [0.4054, 0.6276, 0.4881, 0.6473]}, {"w": "start", "b": [0.4944, 0.6276, 0.5378, 0.6473]}, {"w": "to", "b": [0.5441, 0.6276, 0.5638, 0.6473]}, {"w": "shine.", "b": [0.5701, 0.6276, 0.6296, 0.6473]}]}, {"id": "b_6", "type": "paragraph", "text": "Finally, in 2014, 2015, and 2016, even more advanced ways to help gradient propagation were discovered, such as batch normalization, residual connections, and depthwise separable convolutions. Today we can train from scratch models that are thousands of layers deep.", "words": [{"w": "Finally,", "b": [0.1294, 0.6704, 0.2056, 0.6901]}, {"w": "in", "b": [0.2119, 0.6704, 0.2315, 0.6901]}, {"w": "2014,", "b": [0.2378, 0.6704, 0.2946, 0.6901]}, {"w": "2015,", "b": [0.3009, 0.6704, 0.3576, 0.6901]}, {"w": "and", "b": [0.3639, 0.6704, 0.4004, 0.6901]}, {"w": "2016,", "b": [0.4067, 0.6704, 0.4634, 0.6901]}, {"w": "even", "b": [0.4697, 0.6704, 0.5173, 0.6901]}, {"w": "more", "b": [0.5237, 0.6704, 0.5755, 0.6901]}, {"w": "advanced", "b": [0.5818, 0.6704, 0.6771, 0.6901]}, {"w": "ways", "b": [0.6834, 0.6704, 0.7352, 0.6901]}, {"w": "to", "b": [0.7415, 0.6704, 0.7611, 0.6901]}, {"w": "help", "b": [0.7674, 0.6704, 0.8109, 0.6901]}, {"w": "gradient", "b": [0.1294, 0.6909, 0.2121, 0.7106]}, {"w": "propagation", "b": [0.2184, 0.6909, 0.3389, 0.7106]}, {"w": "were", "b": [0.3452, 0.6909, 0.3942, 0.7106]}, {"w": "discovered,", "b": [0.4005, 0.6909, 0.5161, 0.7106]}, {"w": "such", "b": [0.5224, 0.6909, 0.5686, 0.7106]}, {"w": "as", "b": [0.5749, 0.6909, 0.596, 0.7106]}, {"w": "batch", "b": [0.6023, 0.6909, 0.6569, 0.7106]}, {"w": "normalization,", "b": [0.6632, 0.6909, 0.8096, 0.7106]}, {"w": "residual", "b": [0.1294, 0.7114, 0.2093, 0.7311]}, {"w": "connections,", "b": [0.2156, 0.7114, 0.3424, 0.7311]}, {"w": "and", "b": [0.3487, 0.7114, 0.3851, 0.7311]}, {"w": "depthwise", "b": [0.3914, 0.7114, 0.4937, 0.7311]}, {"w": "separable", "b": [0.5, 0.7114, 0.5953, 0.7311]}, {"w": "convolutions.", "b": [0.6016, 0.7114, 0.7382, 0.7311]}, {"w": "Today", "b": [0.7445, 0.7114, 0.8072, 0.7311]}, {"w": "we", "b": [0.8135, 0.7114, 0.8429, 0.7311]}, {"w": "can", "b": [0.1294, 0.7319, 0.1644, 0.7516]}, {"w": "train", "b": [0.1707, 0.7319, 0.217, 0.7516]}, {"w": "from", "b": [0.2233, 0.7319, 0.2723, 0.7516]}, {"w": "scratch", "b": [0.2786, 0.7319, 0.3501, 0.7516]}, {"w": "models", "b": [0.3564, 0.7319, 0.4292, 0.7516]}, {"w": "that", "b": [0.4356, 0.7319, 0.4734, 0.7516]}, {"w": "are", "b": [0.4797, 0.7319, 0.5105, 0.7516]}, {"w": "thousands", "b": [0.5168, 0.7319, 0.6177, 0.7516]}, {"w": "of", "b": [0.624, 0.7319, 0.645, 0.7516]}, {"w": "layers", "b": [0.6513, 0.7319, 0.7116, 0.7516]}, {"w": "deep.", "b": [0.7178, 0.7319, 0.7717, 0.7516]}]}, {"id": "b_7", "type": "paragraph", "text": "1.3.4. A new wave of investment", "words": [{"w": "1.3.4.", "b": [0.1294, 0.7791, 0.1862, 0.7989]}, {"w": "A", "b": [0.1925, 0.7791, 0.2107, 0.7989]}, {"w": "new", "b": [0.217, 0.7791, 0.2604, 0.7989]}, {"w": "wave", "b": [0.2667, 0.7791, 0.3214, 0.7989]}, {"w": "of", "b": [0.3277, 0.7791, 0.3487, 0.7989]}, {"w": "investment", "b": [0.355, 0.7791, 0.4727, 0.7989]}]}, {"id": "b_8", "type": "paragraph", "text": "As deep learning became the new state of the art for computer vision in 2012–2013, and eventually for all perceptual tasks, industry leaders took note. What followed was a gradual wave of industry investment far beyond anything previously seen in the history of AI.", "words": [{"w": "As", "b": [0.1294, 0.8219, 0.1574, 0.8416]}, {"w": "deep", "b": [0.1637, 0.8219, 0.2114, 0.8416]}, {"w": "learning", "b": [0.2177, 0.8219, 0.3003, 0.8416]}, {"w": "became", "b": [0.3066, 0.8219, 0.3837, 0.8416]}, {"w": "the", "b": [0.39, 0.8219, 0.4208, 0.8416]}, {"w": "new", "b": [0.4271, 0.8219, 0.4692, 0.8416]}, {"w": "state", "b": [0.4755, 0.8219, 0.5217, 0.8416]}, {"w": "of", "b": [0.528, 0.8219, 0.549, 0.8416]}, {"w": "the", "b": [0.5553, 0.8219, 0.5861, 0.8416]}, {"w": "art", "b": [0.5925, 0.8219, 0.6191, 0.8416]}, {"w": "for", "b": [0.6254, 0.8219, 0.6548, 0.8416]}, {"w": "computer", "b": [0.6611, 0.8219, 0.7564, 0.8416]}, {"w": "vision", "b": [0.7627, 0.8219, 0.8244, 0.8416]}, {"w": "in", "b": [0.8307, 0.8219, 0.8503, 0.8416]}, {"w": "2012–2013,", "b": [0.1294, 0.8424, 0.2492, 0.8621]}, {"w": "and", "b": [0.2555, 0.8424, 0.292, 0.8621]}, {"w": "eventually", "b": [0.2983, 0.8424, 0.4034, 0.8621]}, {"w": "for", "b": [0.4097, 0.8424, 0.4391, 0.8621]}, {"w": "all", "b": [0.4454, 0.8424, 0.4706, 0.8621]}, {"w": "perceptual", "b": [0.4769, 0.8424, 0.582, 0.8621]}, {"w": "tasks,", "b": [0.5883, 0.8424, 0.6451, 0.8621]}, {"w": "industry", "b": [0.6513, 0.8424, 0.734, 0.8621]}, {"w": "leaders", "b": [0.7403, 0.8424, 0.8117, 0.8621]}, {"w": "took", "b": [0.818, 0.8424, 0.8629, 0.8621]}, {"w": "note.", "b": [0.1294, 0.8629, 0.1792, 0.8826]}, {"w": "What", "b": [0.1855, 0.8629, 0.2401, 0.8826]}, {"w": "followed", "b": [0.2464, 0.8629, 0.3361, 0.8826]}, {"w": "was", "b": [0.3424, 0.8629, 0.3816, 0.8826]}, {"w": "a", "b": [0.3879, 0.8629, 0.3991, 0.8826]}, {"w": "gradual", "b": [0.4054, 0.8629, 0.4811, 0.8826]}, {"w": "wave", "b": [0.4874, 0.8629, 0.5406, 0.8826]}, {"w": "of", "b": [0.5469, 0.8629, 0.5679, 0.8826]}, {"w": "industry", "b": [0.5742, 0.8629, 0.6569, 0.8826]}, {"w": "investment", "b": [0.6632, 0.8629, 0.774, 0.8826]}, {"w": "far", "b": [0.7803, 0.8629, 0.8083, 0.8826]}, {"w": "beyond", "b": [0.1294, 0.8834, 0.2037, 0.9031]}, {"w": "anything", "b": [0.21, 0.8834, 0.2983, 0.9031]}, {"w": "previously", "b": [0.3046, 0.8834, 0.4111, 0.9031]}, {"w": "seen", "b": [0.4174, 0.8834, 0.4622, 0.9031]}, {"w": "in", "b": [0.4685, 0.8834, 0.4881, 0.9031]}, {"w": "the", "b": [0.4944, 0.8834, 0.5252, 0.9031]}, {"w": "history", "b": [0.5315, 0.8834, 0.6016, 0.9031]}, {"w": "of", "b": [0.6079, 0.8834, 0.6289, 0.9031]}, {"w": "AI.", "b": [0.6353, 0.8834, 0.6682, 0.9031]}]}]}, {"page": 55, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In 2011, right before deep learning took the spotlight, the total venture capital investment in AI was around $19 million, which went almost entirely to practical applications of shallow machine-learning approaches. By 2014, it had risen to a staggering $394 million. Dozens of startups launched in these three years, trying to capitalize on the deep- learning hype. Meanwhile, large tech companies such as Google, Facebook, Baidu, and Microsoft have invested in internal research departments in amounts that would most likely dwarf the flow of venture-capital money. Only a few numbers have surfaced: In 2013, Google acquired the deep-learning startup DeepMind for a reported $500 million—the largest acquisition of an AI company in history. In 2014, Baidu started a deep-learning research center in Silicon Valley, investing $300 million in the project. The deep-learning hardware startup Nervana Systems was acquired by Intel in 2016 for over $400 million.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "2011,", "b": [0.1567, 0.0857, 0.2126, 0.1054]}, {"w": "right", "b": [0.2189, 0.0857, 0.2665, 0.1054]}, {"w": "before", "b": [0.2728, 0.0857, 0.3372, 0.1054]}, {"w": "deep", "b": [0.3436, 0.0857, 0.3912, 0.1054]}, {"w": "learning", "b": [0.3975, 0.0857, 0.4801, 0.1054]}, {"w": "took", "b": [0.4865, 0.0857, 0.5313, 0.1054]}, {"w": "the", "b": [0.5376, 0.0857, 0.5684, 0.1054]}, {"w": "spotlight,", "b": [0.5747, 0.0857, 0.6694, 0.1054]}, {"w": "the", "b": [0.6757, 0.0857, 0.7065, 0.1054]}, {"w": "total", "b": [0.7128, 0.0857, 0.7577, 0.1054]}, {"w": "venture", "b": [0.764, 0.0857, 0.8396, 0.1054]}, {"w": "capital", "b": [0.1294, 0.1062, 0.1967, 0.1259]}, {"w": "investment", "b": [0.203, 0.1062, 0.3137, 0.1259]}, {"w": "in", "b": [0.32, 0.1062, 0.3396, 0.1259]}, {"w": "AI", "b": [0.3459, 0.1062, 0.3725, 0.1259]}, {"w": "was", "b": [0.3788, 0.1062, 0.4181, 0.1259]}, {"w": "around", "b": [0.4244, 0.1062, 0.4944, 0.1259]}, {"w": "$19", "b": [0.5007, 0.1062, 0.5386, 0.1259]}, {"w": "million,", "b": [0.5449, 0.1062, 0.6241, 0.1259]}, {"w": "which", "b": [0.6303, 0.1062, 0.692, 0.1259]}, {"w": "went", "b": [0.6983, 0.1062, 0.7473, 0.1259]}, {"w": "almost", "b": [0.7536, 0.1062, 0.8209, 0.1259]}, {"w": "entirely", "b": [0.1294, 0.1267, 0.2065, 0.1464]}, {"w": "to", "b": [0.2128, 0.1267, 0.2324, 0.1464]}, {"w": "practical", "b": [0.2387, 0.1267, 0.3256, 0.1464]}, {"w": "applications", "b": [0.3319, 0.1267, 0.4538, 0.1464]}, {"w": "of", "b": [0.4601, 0.1267, 0.4811, 0.1464]}, {"w": "shallow", "b": [0.4874, 0.1267, 0.5659, 0.1464]}, {"w": "machine-learning", "b": [0.5722, 0.1267, 0.7487, 0.1464]}, {"w": "approaches.", "b": [0.1294, 0.1472, 0.2492, 0.1669]}, {"w": "By", "b": [0.2555, 0.1472, 0.2849, 0.1669]}, {"w": "2014,", "b": [0.2912, 0.1472, 0.348, 0.1669]}, {"w": "it", "b": [0.3543, 0.1472, 0.3683, 0.1669]}, {"w": "had", "b": [0.3746, 0.1472, 0.4111, 0.1669]}, {"w": "risen", "b": [0.4174, 0.1472, 0.4664, 0.1669]}, {"w": "to", "b": [0.4727, 0.1472, 0.4923, 0.1669]}, {"w": "a", "b": [0.4986, 0.1472, 0.5098, 0.1669]}, {"w": "staggering", "b": [0.5161, 0.1472, 0.6212, 0.1669]}, {"w": "$394", "b": [0.6275, 0.1472, 0.6779, 0.1669]}, {"w": "million.", "b": [0.6842, 0.1472, 0.7634, 0.1669]}, {"w": "Dozens", "b": [0.7698, 0.1472, 0.8454, 0.1669]}, {"w": "of", "b": [0.1294, 0.1677, 0.1504, 0.1874]}, {"w": "startups", "b": [0.1567, 0.1677, 0.2352, 0.1874]}, {"w": "launched", "b": [0.2415, 0.1677, 0.3326, 0.1874]}, {"w": "in", "b": [0.3389, 0.1677, 0.3585, 0.1874]}, {"w": "these", "b": [0.3648, 0.1677, 0.4167, 0.1874]}, {"w": "three", "b": [0.423, 0.1677, 0.4734, 0.1874]}, {"w": "years,", "b": [0.4797, 0.1677, 0.5392, 0.1874]}, {"w": "trying", "b": [0.5455, 0.1677, 0.6058, 0.1874]}, {"w": "to", "b": [0.6121, 0.1677, 0.6317, 0.1874]}, {"w": "capitalize", "b": [0.638, 0.1677, 0.7347, 0.1874]}, {"w": "on", "b": [0.741, 0.1677, 0.7662, 0.1874]}, {"w": "the", "b": [0.7725, 0.1677, 0.8034, 0.1874]}, {"w": "deep-", "b": [0.8097, 0.1677, 0.8657, 0.1874]}, {"w": "learning", "b": [0.1294, 0.1882, 0.2121, 0.2079]}, {"w": "hype.", "b": [0.2184, 0.1882, 0.2737, 0.2079]}, {"w": "Meanwhile,", "b": [0.28, 0.1882, 0.3998, 0.2079]}, {"w": "large", "b": [0.4061, 0.1882, 0.4561, 0.2079]}, {"w": "tech", "b": [0.4624, 0.1882, 0.5044, 0.2079]}, {"w": "companies", "b": [0.5107, 0.1882, 0.6186, 0.2079]}, {"w": "such", "b": [0.6249, 0.1882, 0.6711, 0.2079]}, {"w": "as", "b": [0.6775, 0.1882, 0.6985, 0.2079]}, {"w": "Google,", "b": [0.7048, 0.1882, 0.7853, 0.2079]}, {"w": "Facebook,", "b": [0.1294, 0.2087, 0.2338, 0.2284]}, {"w": "Baidu,", "b": [0.2401, 0.2087, 0.3067, 0.2284]}, {"w": "and", "b": [0.313, 0.2087, 0.3494, 0.2284]}, {"w": "Microsoft", "b": [0.3557, 0.2087, 0.4552, 0.2284]}, {"w": "have", "b": [0.4615, 0.2087, 0.5091, 0.2284]}, {"w": "invested", "b": [0.5154, 0.2087, 0.5995, 0.2284]}, {"w": "in", "b": [0.6058, 0.2087, 0.6255, 0.2284]}, {"w": "internal", "b": [0.6318, 0.2087, 0.7088, 0.2284]}, {"w": "research", "b": [0.7151, 0.2087, 0.7992, 0.2284]}, {"w": "departments", "b": [0.1294, 0.2292, 0.2527, 0.2489]}, {"w": "in", "b": [0.259, 0.2292, 0.2786, 0.2489]}, {"w": "amounts", "b": [0.285, 0.2292, 0.3704, 0.2489]}, {"w": "that", "b": [0.3767, 0.2292, 0.4145, 0.2489]}, {"w": "would", "b": [0.4208, 0.2292, 0.4839, 0.2489]}, {"w": "most", "b": [0.4902, 0.2292, 0.5393, 0.2489]}, {"w": "likely", "b": [0.5456, 0.2292, 0.6031, 0.2489]}, {"w": "dwarf", "b": [0.6094, 0.2292, 0.6682, 0.2489]}, {"w": "the", "b": [0.6745, 0.2292, 0.7053, 0.2489]}, {"w": "flow", "b": [0.7116, 0.2292, 0.7579, 0.2489]}, {"w": "of", "b": [0.7642, 0.2292, 0.7852, 0.2489]}, {"w": "venture-capital", "b": [0.1294, 0.2497, 0.2807, 0.2694]}, {"w": "money.", "b": [0.287, 0.2497, 0.3603, 0.2694]}, {"w": "Only", "b": [0.3666, 0.2497, 0.4171, 0.2694]}, {"w": "a", "b": [0.4234, 0.2497, 0.4346, 0.2694]}, {"w": "few", "b": [0.4409, 0.2497, 0.4787, 0.2694]}, {"w": "numbers", "b": [0.485, 0.2497, 0.5719, 0.2694]}, {"w": "have", "b": [0.5782, 0.2497, 0.6258, 0.2694]}, {"w": "surfaced:", "b": [0.6321, 0.2497, 0.7246, 0.2694]}, {"w": "In", "b": [0.7309, 0.2497, 0.7519, 0.2694]}, {"w": "2013,", "b": [0.7582, 0.2497, 0.815, 0.2694]}, {"w": "Google", "b": [0.1294, 0.2702, 0.2037, 0.2899]}, {"w": "acquired", "b": [0.21, 0.2702, 0.2968, 0.2899]}, {"w": "the", "b": [0.3031, 0.2702, 0.3339, 0.2899]}, {"w": "deep-learning", "b": [0.3402, 0.2702, 0.4789, 0.2899]}, {"w": "startup", "b": [0.4852, 0.2702, 0.5539, 0.2899]}, {"w": "DeepMind", "b": [0.5602, 0.2702, 0.6681, 0.2899]}, {"w": "for", "b": [0.6744, 0.2702, 0.7038, 0.2899]}, {"w": "a", "b": [0.7101, 0.2702, 0.7213, 0.2899]}, {"w": "reported", "b": [0.7276, 0.2702, 0.8117, 0.2899]}, {"w": "$500", "b": [0.818, 0.2702, 0.8684, 0.2899]}, {"w": "million—the", "b": [0.1294, 0.2907, 0.2584, 0.3104]}, {"w": "largest", "b": [0.2647, 0.2907, 0.3314, 0.3104]}, {"w": "acquisition", "b": [0.3377, 0.2907, 0.4485, 0.3104]}, {"w": "of", "b": [0.4548, 0.2907, 0.4758, 0.3104]}, {"w": "an", "b": [0.4821, 0.2907, 0.5059, 0.3104]}, {"w": "AI", "b": [0.5122, 0.2907, 0.5388, 0.3104]}, {"w": "company", "b": [0.5451, 0.2907, 0.6376, 0.3104]}, {"w": "in", "b": [0.6439, 0.2907, 0.6635, 0.3104]}, {"w": "history.", "b": [0.6698, 0.2907, 0.7445, 0.3104]}, {"w": "In", "b": [0.7508, 0.2907, 0.7719, 0.3104]}, {"w": "2014,", "b": [0.7782, 0.2907, 0.8349, 0.3104]}, {"w": "Baidu", "b": [0.1294, 0.3112, 0.1897, 0.3309]}, {"w": "started", "b": [0.196, 0.3112, 0.2632, 0.3309]}, {"w": "a", "b": [0.2695, 0.3112, 0.2807, 0.3309]}, {"w": "deep-learning", "b": [0.287, 0.3112, 0.4257, 0.3309]}, {"w": "research", "b": [0.432, 0.3112, 0.5161, 0.3309]}, {"w": "center", "b": [0.5224, 0.3112, 0.584, 0.3309]}, {"w": "in", "b": [0.5903, 0.3112, 0.6099, 0.3309]}, {"w": "Silicon", "b": [0.6162, 0.3112, 0.6877, 0.3309]}, {"w": "Valley,", "b": [0.694, 0.3112, 0.7631, 0.3309]}, {"w": "investing", "b": [0.7694, 0.3112, 0.8619, 0.3309]}, {"w": "$300", "b": [0.1294, 0.3317, 0.1799, 0.3514]}, {"w": "million", "b": [0.1862, 0.3317, 0.2591, 0.3514]}, {"w": "in", "b": [0.2654, 0.3317, 0.285, 0.3514]}, {"w": "the", "b": [0.2913, 0.3317, 0.3221, 0.3514]}, {"w": "project.", "b": [0.3284, 0.3317, 0.4048, 0.3514]}, {"w": "The", "b": [0.4111, 0.3317, 0.4503, 0.3514]}, {"w": "deep-learning", "b": [0.4566, 0.3317, 0.5953, 0.3514]}, {"w": "hardware", "b": [0.6015, 0.3317, 0.6954, 0.3514]}, {"w": "startup", "b": [0.7017, 0.3317, 0.7704, 0.3514]}, {"w": "Nervana", "b": [0.7767, 0.3317, 0.8621, 0.3514]}, {"w": "Systems", "b": [0.1294, 0.3522, 0.2135, 0.3719]}, {"w": "was", "b": [0.2198, 0.3522, 0.259, 0.3719]}, {"w": "acquired", "b": [0.2654, 0.3522, 0.3522, 0.3719]}, {"w": "by", "b": [0.3585, 0.3522, 0.3837, 0.3719]}, {"w": "Intel", "b": [0.39, 0.3522, 0.4363, 0.3719]}, {"w": "in", "b": [0.4426, 0.3522, 0.4622, 0.3719]}, {"w": "2016", "b": [0.4685, 0.3522, 0.519, 0.3719]}, {"w": "for", "b": [0.5253, 0.3522, 0.5547, 0.3719]}, {"w": "over", "b": [0.561, 0.3522, 0.6058, 0.3719]}, {"w": "$400", "b": [0.6121, 0.3522, 0.6626, 0.3719]}, {"w": "million.", "b": [0.6689, 0.3522, 0.7481, 0.3719]}]}, {"id": "b_1", "type": "paragraph", "text": "Machine learning—in particular, deep learning—has become central to the product strategy of these tech giants. In late 2015, Google CEO Sundar Pichai stated, “Machine learning is a core, transformative way by which we’re rethinking how we’re doing everything. We’re thoughtfully applying it across all our products, be it search, ads, YouTube, or Play. And we’re in early days, but you’ll see us—in a systematic way—apply machine learning in all these areas.”[7]", "words": [{"w": "Machine", "b": [0.1294, 0.395, 0.2177, 0.4147]}, {"w": "learning—in", "b": [0.224, 0.395, 0.3515, 0.4147]}, {"w": "particular,", "b": [0.3578, 0.395, 0.4597, 0.4147]}, {"w": "deep", "b": [0.466, 0.395, 0.5136, 0.4147]}, {"w": "learning—has", "b": [0.52, 0.395, 0.6615, 0.4147]}, {"w": "become", "b": [0.6678, 0.395, 0.7462, 0.4147]}, {"w": "central", "b": [0.7525, 0.395, 0.8212, 0.4147]}, {"w": "to", "b": [0.8275, 0.395, 0.8471, 0.4147]}, {"w": "the", "b": [0.1294, 0.4155, 0.1602, 0.4352]}, {"w": "product", "b": [0.1665, 0.4155, 0.2436, 0.4352]}, {"w": "strategy", "b": [0.2499, 0.4155, 0.3298, 0.4352]}, {"w": "of", "b": [0.3361, 0.4155, 0.3571, 0.4352]}, {"w": "these", "b": [0.3634, 0.4155, 0.4152, 0.4352]}, {"w": "tech", "b": [0.4216, 0.4155, 0.4636, 0.4352]}, {"w": "giants.", "b": [0.4699, 0.4155, 0.5365, 0.4352]}, {"w": "In", "b": [0.5428, 0.4155, 0.5638, 0.4352]}, {"w": "late", "b": [0.5701, 0.4155, 0.6065, 0.4352]}, {"w": "2015,", "b": [0.6128, 0.4155, 0.6696, 0.4352]}, {"w": "Google", "b": [0.6758, 0.4155, 0.7501, 0.4352]}, {"w": "CEO", "b": [0.7564, 0.4155, 0.8068, 0.4352]}, {"w": "Sundar", "b": [0.1294, 0.436, 0.2009, 0.4557]}, {"w": "Pichai", "b": [0.2072, 0.436, 0.2702, 0.4557]}, {"w": "stated,", "b": [0.2766, 0.436, 0.3417, 0.4557]}, {"w": "“Machine", "b": [0.348, 0.436, 0.4475, 0.4557]}, {"w": "learning", "b": [0.4538, 0.436, 0.5365, 0.4557]}, {"w": "is", "b": [0.5428, 0.436, 0.5596, 0.4557]}, {"w": "a", "b": [0.5659, 0.436, 0.5771, 0.4557]}, {"w": "core,", "b": [0.5834, 0.436, 0.6331, 0.4557]}, {"w": "transformative", "b": [0.6394, 0.436, 0.7865, 0.4557]}, {"w": "way", "b": [0.7928, 0.436, 0.8349, 0.4557]}, {"w": "by", "b": [0.8412, 0.436, 0.8664, 0.4557]}, {"w": "which", "b": [0.1294, 0.4565, 0.1911, 0.4762]}, {"w": "we’re", "b": [0.1974, 0.4565, 0.2548, 0.4762]}, {"w": "rethinking", "b": [0.2611, 0.4565, 0.3648, 0.4762]}, {"w": "how", "b": [0.3711, 0.4565, 0.4145, 0.4762]}, {"w": "we’re", "b": [0.4208, 0.4565, 0.4783, 0.4762]}, {"w": "doing", "b": [0.4846, 0.4565, 0.542, 0.4762]}, {"w": "everything.", "b": [0.5483, 0.4565, 0.6625, 0.4762]}, {"w": "We’re", "b": [0.6688, 0.4565, 0.7298, 0.4762]}, {"w": "thoughtfully", "b": [0.7361, 0.4565, 0.8608, 0.4762]}, {"w": "applying", "b": [0.1294, 0.477, 0.2177, 0.4967]}, {"w": "it", "b": [0.224, 0.477, 0.238, 0.4967]}, {"w": "across", "b": [0.2443, 0.477, 0.3074, 0.4967]}, {"w": "all", "b": [0.3137, 0.477, 0.3389, 0.4967]}, {"w": "our", "b": [0.3452, 0.477, 0.3788, 0.4967]}, {"w": "products,", "b": [0.3852, 0.477, 0.4783, 0.4967]}, {"w": "be", "b": [0.4846, 0.477, 0.5085, 0.4967]}, {"w": "it", "b": [0.5148, 0.477, 0.5288, 0.4967]}, {"w": "search,", "b": [0.5351, 0.477, 0.6058, 0.4967]}, {"w": "ads,", "b": [0.6121, 0.477, 0.6521, 0.4967]}, {"w": "YouTube,", "b": [0.6584, 0.477, 0.7565, 0.4967]}, {"w": "or", "b": [0.7628, 0.477, 0.7838, 0.4967]}, {"w": "Play.", "b": [0.7901, 0.477, 0.8396, 0.4967]}, {"w": "And", "b": [0.1294, 0.4975, 0.1729, 0.5172]}, {"w": "we’re", "b": [0.1792, 0.4975, 0.2366, 0.5172]}, {"w": "in", "b": [0.2429, 0.4975, 0.2625, 0.5172]}, {"w": "early", "b": [0.2688, 0.4975, 0.3192, 0.5172]}, {"w": "days,", "b": [0.3255, 0.4975, 0.3781, 0.5172]}, {"w": "but", "b": [0.3844, 0.4975, 0.4166, 0.5172]}, {"w": "you’ll", "b": [0.4229, 0.4975, 0.4832, 0.5172]}, {"w": "see", "b": [0.4895, 0.4975, 0.5217, 0.5172]}, {"w": "us—in", "b": [0.528, 0.4975, 0.5953, 0.5172]}, {"w": "a", "b": [0.6016, 0.4975, 0.6128, 0.5172]}, {"w": "systematic", "b": [0.6191, 0.4975, 0.7256, 0.5172]}, {"w": "way—apply", "b": [0.7319, 0.4975, 0.8552, 0.5172]}, {"w": "machine", "b": [0.1294, 0.5197, 0.2149, 0.5395]}, {"w": "learning", "b": [0.2212, 0.5197, 0.3038, 0.5395]}, {"w": "in", "b": [0.3102, 0.5197, 0.3298, 0.5395]}, {"w": "all", "b": [0.3361, 0.5197, 0.3613, 0.5395]}, {"w": "these", "b": [0.3676, 0.5197, 0.4195, 0.5395]}, {"w": "areas.”[7]", "b": [0.4258, 0.5175, 0.5171, 0.5395]}]}, {"id": "b_3", "type": "paragraph", "text": "Sundar Pichai, Alphabet earnings call, Oct. 22, 2015.", "words": [{"w": "Sundar", "b": [0.1483, 0.5852, 0.2019, 0.6]}, {"w": "Pichai,", "b": [0.2067, 0.5852, 0.2587, 0.6]}, {"w": "Alphabet", "b": [0.2634, 0.5852, 0.3328, 0.6]}, {"w": "earnings", "b": [0.3375, 0.5852, 0.4016, 0.6]}, {"w": "call,", "b": [0.4063, 0.5852, 0.4384, 0.6]}, {"w": "Oct.", "b": [0.4431, 0.5852, 0.4752, 0.6]}, {"w": "22,", "b": [0.4799, 0.5852, 0.5035, 0.6]}, {"w": "2015.", "b": [0.5083, 0.5852, 0.5508, 0.6]}]}, {"id": "b_4", "type": "paragraph", "text": "As a result of this wave of investment, the number of people working on deep learning went in just five years from a few hundred to tens of thousands, and research progress has reached a frenetic pace. There are currently no signs that this trend will slow any time soon.", "words": [{"w": "As", "b": [0.1294, 0.6231, 0.1574, 0.6429]}, {"w": "a", "b": [0.1637, 0.6231, 0.1749, 0.6429]}, {"w": "result", "b": [0.1813, 0.6231, 0.2373, 0.6429]}, {"w": "of", "b": [0.2436, 0.6231, 0.2646, 0.6429]}, {"w": "this", "b": [0.2709, 0.6231, 0.3074, 0.6429]}, {"w": "wave", "b": [0.3137, 0.6231, 0.3669, 0.6429]}, {"w": "of", "b": [0.3732, 0.6231, 0.3942, 0.6429]}, {"w": "investment,", "b": [0.4005, 0.6231, 0.5176, 0.6429]}, {"w": "the", "b": [0.5239, 0.6231, 0.5547, 0.6429]}, {"w": "number", "b": [0.561, 0.6231, 0.6381, 0.6429]}, {"w": "of", "b": [0.6444, 0.6231, 0.6654, 0.6429]}, {"w": "people", "b": [0.6717, 0.6231, 0.7389, 0.6429]}, {"w": "working", "b": [0.7452, 0.6231, 0.8293, 0.6429]}, {"w": "on", "b": [0.8356, 0.6231, 0.8609, 0.6429]}, {"w": "deep", "b": [0.1294, 0.6436, 0.177, 0.6634]}, {"w": "learning", "b": [0.1833, 0.6436, 0.266, 0.6634]}, {"w": "went", "b": [0.2723, 0.6436, 0.3214, 0.6634]}, {"w": "in", "b": [0.3277, 0.6436, 0.3473, 0.6634]}, {"w": "just", "b": [0.3536, 0.6436, 0.39, 0.6634]}, {"w": "five", "b": [0.3964, 0.6436, 0.4356, 0.6634]}, {"w": "years", "b": [0.4419, 0.6436, 0.4951, 0.6634]}, {"w": "from", "b": [0.5014, 0.6436, 0.5505, 0.6634]}, {"w": "a", "b": [0.5568, 0.6436, 0.568, 0.6634]}, {"w": "few", "b": [0.5743, 0.6436, 0.6121, 0.6634]}, {"w": "hundred", "b": [0.6184, 0.6436, 0.7011, 0.6634]}, {"w": "to", "b": [0.7073, 0.6436, 0.7269, 0.6634]}, {"w": "tens", "b": [0.7332, 0.6436, 0.7739, 0.6634]}, {"w": "of", "b": [0.7802, 0.6436, 0.8012, 0.6634]}, {"w": "thousands,", "b": [0.1294, 0.6641, 0.2366, 0.6839]}, {"w": "and", "b": [0.2429, 0.6641, 0.2794, 0.6839]}, {"w": "research", "b": [0.2857, 0.6641, 0.3697, 0.6839]}, {"w": "progress", "b": [0.376, 0.6641, 0.4615, 0.6839]}, {"w": "has", "b": [0.4678, 0.6641, 0.5014, 0.6839]}, {"w": "reached", "b": [0.5077, 0.6641, 0.5861, 0.6839]}, {"w": "a", "b": [0.5924, 0.6641, 0.6036, 0.6839]}, {"w": "frenetic", "b": [0.6099, 0.6641, 0.687, 0.6839]}, {"w": "pace.", "b": [0.6933, 0.6641, 0.7458, 0.6839]}, {"w": "There", "b": [0.7521, 0.6641, 0.8109, 0.6839]}, {"w": "are", "b": [0.8172, 0.6641, 0.848, 0.6839]}, {"w": "currently", "b": [0.1294, 0.6846, 0.2205, 0.7044]}, {"w": "no", "b": [0.2268, 0.6846, 0.252, 0.7044]}, {"w": "signs", "b": [0.2583, 0.6846, 0.3102, 0.7044]}, {"w": "that", "b": [0.3165, 0.6846, 0.3543, 0.7044]}, {"w": "this", "b": [0.3606, 0.6846, 0.3971, 0.7044]}, {"w": "trend", "b": [0.4034, 0.6846, 0.4552, 0.7044]}, {"w": "will", "b": [0.4615, 0.6846, 0.5008, 0.7044]}, {"w": "slow", "b": [0.507, 0.6846, 0.5547, 0.7044]}, {"w": "any", "b": [0.561, 0.6846, 0.5974, 0.7044]}, {"w": "time", "b": [0.6037, 0.6846, 0.6486, 0.7044]}, {"w": "soon.", "b": [0.6549, 0.6846, 0.7088, 0.7044]}]}, {"id": "b_5", "type": "paragraph", "text": "1.3.5. The democratization of deep learning", "words": [{"w": "1.3.5.", "b": [0.1294, 0.7319, 0.1862, 0.7516]}, {"w": "The", "b": [0.1925, 0.7319, 0.2345, 0.7516]}, {"w": "democratization", "b": [0.2408, 0.7319, 0.416, 0.7516]}, {"w": "of", "b": [0.4223, 0.7319, 0.4433, 0.7516]}, {"w": "deep", "b": [0.4496, 0.7319, 0.5001, 0.7516]}, {"w": "learning", "b": [0.5064, 0.7319, 0.5961, 0.7516]}]}, {"id": "b_6", "type": "paragraph", "text": "One of the key factors driving this inflow of new faces in deep learning has been the democratization of the toolsets used in the field. In the early days, doing deep learning required significant C++ and CUDA expertise, which few people possessed. Nowadays, basic Python scripting skills suffice to do advanced deep-learning research. This has been driven most notably by the development of Theano and then TensorFlow—two", "words": [{"w": "One", "b": [0.1294, 0.7747, 0.1714, 0.7944]}, {"w": "of", "b": [0.1777, 0.7747, 0.1988, 0.7944]}, {"w": "the", "b": [0.2051, 0.7747, 0.2359, 0.7944]}, {"w": "key", "b": [0.2422, 0.7747, 0.2786, 0.7944]}, {"w": "factors", "b": [0.2849, 0.7747, 0.3536, 0.7944]}, {"w": "driving", "b": [0.3599, 0.7747, 0.4328, 0.7944]}, {"w": "this", "b": [0.4391, 0.7747, 0.4755, 0.7944]}, {"w": "inflow", "b": [0.4818, 0.7747, 0.5477, 0.7944]}, {"w": "of", "b": [0.554, 0.7747, 0.575, 0.7944]}, {"w": "new", "b": [0.5813, 0.7747, 0.6233, 0.7944]}, {"w": "faces", "b": [0.6296, 0.7747, 0.6815, 0.7944]}, {"w": "in", "b": [0.6878, 0.7747, 0.7074, 0.7944]}, {"w": "deep", "b": [0.7137, 0.7747, 0.7613, 0.7944]}, {"w": "learning", "b": [0.7676, 0.7747, 0.8503, 0.7944]}, {"w": "has", "b": [0.1294, 0.7952, 0.163, 0.8149]}, {"w": "been", "b": [0.1693, 0.7952, 0.217, 0.8149]}, {"w": "the", "b": [0.2233, 0.7952, 0.2541, 0.8149]}, {"w": "democratization", "b": [0.2604, 0.7952, 0.4229, 0.8149]}, {"w": "of", "b": [0.4292, 0.7952, 0.4503, 0.8149]}, {"w": "the", "b": [0.4566, 0.7952, 0.4874, 0.8149]}, {"w": "toolsets", "b": [0.4937, 0.7952, 0.5708, 0.8149]}, {"w": "used", "b": [0.5771, 0.7952, 0.6233, 0.8149]}, {"w": "in", "b": [0.6296, 0.7952, 0.6492, 0.8149]}, {"w": "the", "b": [0.6555, 0.7952, 0.6863, 0.8149]}, {"w": "field.", "b": [0.6926, 0.7952, 0.7452, 0.8149]}, {"w": "In", "b": [0.7515, 0.7952, 0.7725, 0.8149]}, {"w": "the", "b": [0.7788, 0.7952, 0.8096, 0.8149]}, {"w": "early", "b": [0.8159, 0.7952, 0.8663, 0.8149]}, {"w": "days,", "b": [0.1294, 0.8157, 0.182, 0.8354]}, {"w": "doing", "b": [0.1883, 0.8157, 0.2457, 0.8354]}, {"w": "deep", "b": [0.252, 0.8157, 0.2997, 0.8354]}, {"w": "learning", "b": [0.306, 0.8157, 0.3886, 0.8354]}, {"w": "required", "b": [0.3949, 0.8157, 0.479, 0.8354]}, {"w": "significant", "b": [0.4853, 0.8157, 0.5918, 0.8354]}, {"w": "C++", "b": [0.5981, 0.8157, 0.6434, 0.8354]}, {"w": "and", "b": [0.6497, 0.8157, 0.6861, 0.8354]}, {"w": "CUDA", "b": [0.6924, 0.8157, 0.7639, 0.8354]}, {"w": "expertise,", "b": [0.7702, 0.8157, 0.8676, 0.8354]}, {"w": "which", "b": [0.1294, 0.8362, 0.1911, 0.8559]}, {"w": "few", "b": [0.1974, 0.8362, 0.2352, 0.8559]}, {"w": "people", "b": [0.2415, 0.8362, 0.3087, 0.8559]}, {"w": "possessed.", "b": [0.315, 0.8362, 0.4208, 0.8559]}, {"w": "Nowadays,", "b": [0.4271, 0.8362, 0.5399, 0.8559]}, {"w": "basic", "b": [0.5462, 0.8362, 0.5981, 0.8559]}, {"w": "Python", "b": [0.6044, 0.8362, 0.6759, 0.8559]}, {"w": "scripting", "b": [0.6822, 0.8362, 0.7705, 0.8559]}, {"w": "skills", "b": [0.7768, 0.8362, 0.83, 0.8559]}, {"w": "suffice", "b": [0.1294, 0.8567, 0.1976, 0.8764]}, {"w": "to", "b": [0.2039, 0.8567, 0.2235, 0.8764]}, {"w": "do", "b": [0.2298, 0.8567, 0.2551, 0.8764]}, {"w": "advanced", "b": [0.2614, 0.8567, 0.3566, 0.8764]}, {"w": "deep-learning", "b": [0.3629, 0.8567, 0.5016, 0.8764]}, {"w": "research.", "b": [0.5079, 0.8567, 0.5983, 0.8764]}, {"w": "This", "b": [0.6046, 0.8567, 0.6494, 0.8764]}, {"w": "has", "b": [0.6557, 0.8567, 0.6894, 0.8764]}, {"w": "been", "b": [0.6957, 0.8567, 0.7433, 0.8764]}, {"w": "driven", "b": [0.7496, 0.8567, 0.814, 0.8764]}, {"w": "most", "b": [0.8203, 0.8567, 0.8694, 0.8764]}, {"w": "notably", "b": [0.1294, 0.8772, 0.2051, 0.8969]}, {"w": "by", "b": [0.2114, 0.8772, 0.2366, 0.8969]}, {"w": "the", "b": [0.2429, 0.8772, 0.2737, 0.8969]}, {"w": "development", "b": [0.28, 0.8772, 0.4104, 0.8969]}, {"w": "of", "b": [0.4167, 0.8772, 0.4377, 0.8969]}, {"w": "Theano", "b": [0.444, 0.8772, 0.5196, 0.8969]}, {"w": "and", "b": [0.5259, 0.8772, 0.5624, 0.8969]}, {"w": "then", "b": [0.5687, 0.8772, 0.6121, 0.8969]}, {"w": "TensorFlow—two", "b": [0.6184, 0.8772, 0.8016, 0.8969]}]}]}, {"page": 56, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "symbolic tensor-manipulation frameworks for Python that support autodifferentiation, greatly simplifying the implementation of new models—and by the rise of user-friendly libraries such as Keras, which makes deep learning as easy as manipulating LEGO bricks. After its release in early 2015, Keras quickly became the go-to deep-learning solution for large numbers of new startups, graduate students, and researchers pivoting into the field.", "words": [{"w": "symbolic", "b": [0.1294, 0.0857, 0.2219, 0.1054]}, {"w": "tensor-manipulation", "b": [0.2282, 0.0857, 0.4309, 0.1054]}, {"w": "frameworks", "b": [0.4372, 0.0857, 0.5577, 0.1054]}, {"w": "for", "b": [0.564, 0.0857, 0.5934, 0.1054]}, {"w": "Python", "b": [0.5997, 0.0857, 0.6712, 0.1054]}, {"w": "that", "b": [0.6775, 0.0857, 0.7153, 0.1054]}, {"w": "support", "b": [0.7216, 0.0857, 0.7973, 0.1054]}, {"w": "autodifferentiation,", "b": [0.1294, 0.1062, 0.323, 0.1259]}, {"w": "greatly", "b": [0.3293, 0.1062, 0.3993, 0.1259]}, {"w": "simplifying", "b": [0.4056, 0.1062, 0.522, 0.1259]}, {"w": "the", "b": [0.5283, 0.1062, 0.5591, 0.1259]}, {"w": "implementation", "b": [0.5654, 0.1062, 0.7238, 0.1259]}, {"w": "of", "b": [0.7301, 0.1062, 0.7511, 0.1259]}, {"w": "new", "b": [0.7574, 0.1062, 0.7994, 0.1259]}, {"w": "models—and", "b": [0.1294, 0.1267, 0.2639, 0.1464]}, {"w": "by", "b": [0.2702, 0.1267, 0.2955, 0.1464]}, {"w": "the", "b": [0.3018, 0.1267, 0.3326, 0.1464]}, {"w": "rise", "b": [0.3389, 0.1267, 0.3753, 0.1464]}, {"w": "of", "b": [0.3816, 0.1267, 0.4027, 0.1464]}, {"w": "user-friendly", "b": [0.409, 0.1267, 0.5387, 0.1464]}, {"w": "libraries", "b": [0.545, 0.1267, 0.6277, 0.1464]}, {"w": "such", "b": [0.634, 0.1267, 0.6802, 0.1464]}, {"w": "as", "b": [0.6865, 0.1267, 0.7076, 0.1464]}, {"w": "Keras,", "b": [0.7139, 0.1267, 0.779, 0.1464]}, {"w": "which", "b": [0.7853, 0.1267, 0.847, 0.1464]}, {"w": "makes", "b": [0.1294, 0.1472, 0.1939, 0.1669]}, {"w": "deep", "b": [0.2002, 0.1472, 0.2478, 0.1669]}, {"w": "learning", "b": [0.2541, 0.1472, 0.3368, 0.1669]}, {"w": "as", "b": [0.3431, 0.1472, 0.3641, 0.1669]}, {"w": "easy", "b": [0.3704, 0.1472, 0.4152, 0.1669]}, {"w": "as", "b": [0.4215, 0.1472, 0.4425, 0.1669]}, {"w": "manipulating", "b": [0.4488, 0.1472, 0.582, 0.1669]}, {"w": "LEGO", "b": [0.5883, 0.1472, 0.6555, 0.1669]}, {"w": "bricks.", "b": [0.6618, 0.1472, 0.7298, 0.1669]}, {"w": "After", "b": [0.7361, 0.1472, 0.7893, 0.1669]}, {"w": "its", "b": [0.7956, 0.1472, 0.8195, 0.1669]}, {"w": "release", "b": [0.1294, 0.1677, 0.1994, 0.1874]}, {"w": "in", "b": [0.2057, 0.1677, 0.2254, 0.1874]}, {"w": "early", "b": [0.2317, 0.1677, 0.2821, 0.1874]}, {"w": "2015,", "b": [0.2884, 0.1677, 0.3452, 0.1874]}, {"w": "Keras", "b": [0.3515, 0.1677, 0.4103, 0.1874]}, {"w": "quickly", "b": [0.4166, 0.1677, 0.4923, 0.1874]}, {"w": "became", "b": [0.4986, 0.1677, 0.5756, 0.1874]}, {"w": "the", "b": [0.5819, 0.1677, 0.6128, 0.1874]}, {"w": "go-to", "b": [0.6191, 0.1677, 0.6723, 0.1874]}, {"w": "deep-learning", "b": [0.6786, 0.1677, 0.8173, 0.1874]}, {"w": "solution", "b": [0.1294, 0.1882, 0.2107, 0.2079]}, {"w": "for", "b": [0.217, 0.1882, 0.2464, 0.2079]}, {"w": "large", "b": [0.2527, 0.1882, 0.3027, 0.2079]}, {"w": "numbers", "b": [0.309, 0.1882, 0.3959, 0.2079]}, {"w": "of", "b": [0.4022, 0.1882, 0.4232, 0.2079]}, {"w": "new", "b": [0.4295, 0.1882, 0.4715, 0.2079]}, {"w": "startups,", "b": [0.4778, 0.1882, 0.5626, 0.2079]}, {"w": "graduate", "b": [0.5689, 0.1882, 0.6558, 0.2079]}, {"w": "students,", "b": [0.6621, 0.1882, 0.7511, 0.2079]}, {"w": "and", "b": [0.7574, 0.1882, 0.7938, 0.2079]}, {"w": "researchers", "b": [0.1294, 0.2087, 0.2429, 0.2284]}, {"w": "pivoting", "b": [0.2492, 0.2087, 0.3333, 0.2284]}, {"w": "into", "b": [0.3396, 0.2087, 0.3788, 0.2284]}, {"w": "the", "b": [0.3851, 0.2087, 0.416, 0.2284]}, {"w": "field.", "b": [0.4223, 0.2087, 0.4748, 0.2284]}]}, {"id": "b_1", "type": "paragraph", "text": "1.3.6. Will it last?", "words": [{"w": "1.3.6.", "b": [0.1294, 0.2559, 0.1862, 0.2757]}, {"w": "Will", "b": [0.1925, 0.2559, 0.2383, 0.2757]}, {"w": "it", "b": [0.2446, 0.2559, 0.26, 0.2757]}, {"w": "last?", "b": [0.2663, 0.2559, 0.3168, 0.2757]}]}, {"id": "b_2", "type": "paragraph", "text": "Is there anything special about deep neural networks that makes them the “right” approach for companies to be investing in and for researchers to flock to? Or is deep learning just a fad that may not last? Will we still be using deep neural networks in 20 years?", "words": [{"w": "Is", "b": [0.1294, 0.2987, 0.1476, 0.3184]}, {"w": "there", "b": [0.1539, 0.2987, 0.2044, 0.3184]}, {"w": "anything", "b": [0.2107, 0.2987, 0.299, 0.3184]}, {"w": "special", "b": [0.3053, 0.2987, 0.3753, 0.3184]}, {"w": "about", "b": [0.3816, 0.2987, 0.4377, 0.3184]}, {"w": "deep", "b": [0.444, 0.2987, 0.4916, 0.3184]}, {"w": "neural", "b": [0.4979, 0.2987, 0.5609, 0.3184]}, {"w": "networks", "b": [0.5673, 0.2987, 0.6597, 0.3184]}, {"w": "that", "b": [0.666, 0.2987, 0.7039, 0.3184]}, {"w": "makes", "b": [0.7102, 0.2987, 0.7746, 0.3184]}, {"w": "them", "b": [0.7809, 0.2987, 0.8314, 0.3184]}, {"w": "the", "b": [0.8377, 0.2987, 0.8685, 0.3184]}, {"w": "“right”", "b": [0.1294, 0.3192, 0.1995, 0.3389]}, {"w": "approach", "b": [0.2058, 0.3192, 0.2982, 0.3389]}, {"w": "for", "b": [0.3045, 0.3192, 0.3339, 0.3389]}, {"w": "companies", "b": [0.3402, 0.3192, 0.4481, 0.3389]}, {"w": "to", "b": [0.4544, 0.3192, 0.4741, 0.3389]}, {"w": "be", "b": [0.4804, 0.3192, 0.5042, 0.3389]}, {"w": "investing", "b": [0.5105, 0.3192, 0.603, 0.3389]}, {"w": "in", "b": [0.6093, 0.3192, 0.6289, 0.3389]}, {"w": "and", "b": [0.6352, 0.3192, 0.6716, 0.3389]}, {"w": "for", "b": [0.6779, 0.3192, 0.7073, 0.3389]}, {"w": "researchers", "b": [0.7136, 0.3192, 0.8271, 0.3389]}, {"w": "to", "b": [0.8334, 0.3192, 0.853, 0.3389]}, {"w": "flock", "b": [0.1294, 0.3397, 0.1813, 0.3594]}, {"w": "to?", "b": [0.1876, 0.3397, 0.2184, 0.3594]}, {"w": "Or", "b": [0.2247, 0.3397, 0.2513, 0.3594]}, {"w": "is", "b": [0.2576, 0.3397, 0.2744, 0.3594]}, {"w": "deep", "b": [0.2807, 0.3397, 0.3284, 0.3594]}, {"w": "learning", "b": [0.3347, 0.3397, 0.4173, 0.3594]}, {"w": "just", "b": [0.4236, 0.3397, 0.4601, 0.3594]}, {"w": "a", "b": [0.4664, 0.3397, 0.4776, 0.3594]}, {"w": "fad", "b": [0.4839, 0.3397, 0.5161, 0.3594]}, {"w": "that", "b": [0.5224, 0.3397, 0.5603, 0.3594]}, {"w": "may", "b": [0.5666, 0.3397, 0.61, 0.3594]}, {"w": "not", "b": [0.6163, 0.3397, 0.6486, 0.3594]}, {"w": "last?", "b": [0.6549, 0.3397, 0.7011, 0.3594]}, {"w": "Will", "b": [0.7074, 0.3397, 0.7512, 0.3594]}, {"w": "we", "b": [0.7575, 0.3397, 0.7869, 0.3594]}, {"w": "still", "b": [0.7932, 0.3397, 0.8311, 0.3594]}, {"w": "be", "b": [0.8374, 0.3397, 0.8612, 0.3594]}, {"w": "using", "b": [0.1294, 0.3602, 0.1841, 0.3799]}, {"w": "deep", "b": [0.1904, 0.3602, 0.238, 0.3799]}, {"w": "neural", "b": [0.2443, 0.3602, 0.3074, 0.3799]}, {"w": "networks", "b": [0.3137, 0.3602, 0.4061, 0.3799]}, {"w": "in", "b": [0.4124, 0.3602, 0.432, 0.3799]}, {"w": "20", "b": [0.4383, 0.3602, 0.4636, 0.3799]}, {"w": "years?", "b": [0.4699, 0.3602, 0.5343, 0.3799]}]}, {"id": "b_3", "type": "paragraph", "text": "Deep learning has several properties that justify its status as an AI revolution, and it’s here to stay. We may not be using neural networks two decades from now, but whatever we use will directly inherit from modern deep learning and its core concepts. These important properties can be broadly sorted into three categories:", "words": [{"w": "Deep", "b": [0.1294, 0.403, 0.1826, 0.4227]}, {"w": "learning", "b": [0.1889, 0.403, 0.2716, 0.4227]}, {"w": "has", "b": [0.2779, 0.403, 0.3115, 0.4227]}, {"w": "several", "b": [0.3178, 0.403, 0.3893, 0.4227]}, {"w": "properties", "b": [0.3956, 0.403, 0.4965, 0.4227]}, {"w": "that", "b": [0.5028, 0.403, 0.5406, 0.4227]}, {"w": "justify", "b": [0.5469, 0.403, 0.6114, 0.4227]}, {"w": "its", "b": [0.6177, 0.403, 0.6415, 0.4227]}, {"w": "status", "b": [0.6479, 0.403, 0.7053, 0.4227]}, {"w": "as", "b": [0.7116, 0.403, 0.7326, 0.4227]}, {"w": "an", "b": [0.7389, 0.403, 0.7628, 0.4227]}, {"w": "AI", "b": [0.7691, 0.403, 0.7957, 0.4227]}, {"w": "revolution,", "b": [0.1294, 0.4235, 0.2394, 0.4432]}, {"w": "and", "b": [0.2457, 0.4235, 0.2822, 0.4432]}, {"w": "it’s", "b": [0.2885, 0.4235, 0.3193, 0.4432]}, {"w": "here", "b": [0.3256, 0.4235, 0.369, 0.4432]}, {"w": "to", "b": [0.3753, 0.4235, 0.3949, 0.4432]}, {"w": "stay.", "b": [0.4012, 0.4235, 0.4465, 0.4432]}, {"w": "We", "b": [0.4528, 0.4235, 0.4858, 0.4432]}, {"w": "may", "b": [0.4921, 0.4235, 0.5356, 0.4432]}, {"w": "not", "b": [0.5419, 0.4235, 0.5741, 0.4432]}, {"w": "be", "b": [0.5804, 0.4235, 0.6042, 0.4432]}, {"w": "using", "b": [0.6105, 0.4235, 0.6652, 0.4432]}, {"w": "neural", "b": [0.6715, 0.4235, 0.7345, 0.4432]}, {"w": "networks", "b": [0.7408, 0.4235, 0.8333, 0.4432]}, {"w": "two", "b": [0.1294, 0.444, 0.1673, 0.4637]}, {"w": "decades", "b": [0.1736, 0.444, 0.2534, 0.4637]}, {"w": "from", "b": [0.2597, 0.444, 0.3087, 0.4637]}, {"w": "now,", "b": [0.315, 0.444, 0.3631, 0.4637]}, {"w": "but", "b": [0.3695, 0.444, 0.4017, 0.4637]}, {"w": "whatever", "b": [0.408, 0.444, 0.5004, 0.4637]}, {"w": "we", "b": [0.5068, 0.444, 0.5362, 0.4637]}, {"w": "use", "b": [0.5425, 0.444, 0.5761, 0.4637]}, {"w": "will", "b": [0.5824, 0.444, 0.6217, 0.4637]}, {"w": "directly", "b": [0.628, 0.444, 0.705, 0.4637]}, {"w": "inherit", "b": [0.7113, 0.444, 0.7772, 0.4637]}, {"w": "from", "b": [0.7835, 0.444, 0.8325, 0.4637]}, {"w": "modern", "b": [0.1294, 0.4645, 0.2065, 0.4842]}, {"w": "deep", "b": [0.2128, 0.4645, 0.2604, 0.4842]}, {"w": "learning", "b": [0.2667, 0.4645, 0.3494, 0.4842]}, {"w": "and", "b": [0.3557, 0.4645, 0.3921, 0.4842]}, {"w": "its", "b": [0.3984, 0.4645, 0.4223, 0.4842]}, {"w": "core", "b": [0.4286, 0.4645, 0.472, 0.4842]}, {"w": "concepts.", "b": [0.4783, 0.4645, 0.5729, 0.4842]}, {"w": "These", "b": [0.5791, 0.4645, 0.6393, 0.4842]}, {"w": "important", "b": [0.6456, 0.4645, 0.7437, 0.4842]}, {"w": "properties", "b": [0.7501, 0.4645, 0.8509, 0.4842]}, {"w": "can", "b": [0.1294, 0.485, 0.1644, 0.5047]}, {"w": "be", "b": [0.1707, 0.485, 0.1945, 0.5047]}, {"w": "broadly", "b": [0.2009, 0.485, 0.2779, 0.5047]}, {"w": "sorted", "b": [0.2842, 0.485, 0.3459, 0.5047]}, {"w": "into", "b": [0.3522, 0.485, 0.3914, 0.5047]}, {"w": "three", "b": [0.3977, 0.485, 0.4482, 0.5047]}, {"w": "categories:", "b": [0.4545, 0.485, 0.5637, 0.5047]}]}, {"id": "b_4", "type": "paragraph", "text": "Simplicity— Deep learning removes the need for feature engineering, replacing complex, brittle, engineering-heavy pipelines with simple, end-to-end trainable models that are typically built using only five or six different tensor operations. Scalability— Deep learning is highly amenable to parallelization on GPUs or TPUs, so it can take full advantage of Moore’s law. In addition, deep-learning models are trained by iterating over small batches of data, allowing them to be trained on datasets of arbitrary size. (The only bottleneck is the amount of parallel computational power available, which, thanks to Moore’s law, is a fast--moving barrier.) Versatility and reusability— Unlike many prior machine-learning approaches, deep-learning models can be trained on additional data without restarting from scratch, making them viable for continuous online learning—an important property for very large production models. Furthermore, trained deep-learning models are repurposable and thus reusable: for instance, it’s possible to take a deep-learning model trained for image classification and drop it into a video-processing pipeline. This allows us to reinvest previous", "words": [{"w": "Simplicity—", "b": [0.1799, 0.5233, 0.3088, 0.5431]}, {"w": "Deep", "b": [0.3151, 0.5233, 0.3683, 0.5431]}, {"w": "learning", "b": [0.3746, 0.5233, 0.4573, 0.5431]}, {"w": "removes", "b": [0.4636, 0.5233, 0.549, 0.5431]}, {"w": "the", "b": [0.5554, 0.5233, 0.5862, 0.5431]}, {"w": "need", "b": [0.5925, 0.5233, 0.6401, 0.5431]}, {"w": "for", "b": [0.6464, 0.5233, 0.6758, 0.5431]}, {"w": "feature", "b": [0.6821, 0.5233, 0.7522, 0.5431]}, {"w": "engineering,", "b": [0.1799, 0.5438, 0.3053, 0.5636]}, {"w": "replacing", "b": [0.3116, 0.5438, 0.4054, 0.5636]}, {"w": "complex,", "b": [0.4117, 0.5438, 0.5049, 0.5636]}, {"w": "brittle,", "b": [0.5112, 0.5438, 0.5778, 0.5636]}, {"w": "engineering-heavy", "b": [0.5841, 0.5438, 0.7718, 0.5636]}, {"w": "pipelines", "b": [0.7781, 0.5438, 0.8692, 0.5636]}, {"w": "with", "b": [0.1799, 0.5643, 0.2247, 0.5841]}, {"w": "simple,", "b": [0.231, 0.5643, 0.3046, 0.5841]}, {"w": "end-to-end", "b": [0.3109, 0.5643, 0.4202, 0.5841]}, {"w": "trainable", "b": [0.4265, 0.5643, 0.5147, 0.5841]}, {"w": "models", "b": [0.521, 0.5643, 0.5939, 0.5841]}, {"w": "that", "b": [0.6002, 0.5643, 0.6381, 0.5841]}, {"w": "are", "b": [0.6444, 0.5643, 0.6752, 0.5841]}, {"w": "typically", "b": [0.6815, 0.5643, 0.7698, 0.5841]}, {"w": "built", "b": [0.7761, 0.5643, 0.8223, 0.5841]}, {"w": "using", "b": [0.1799, 0.5848, 0.2345, 0.6046]}, {"w": "only", "b": [0.2408, 0.5848, 0.2857, 0.6046]}, {"w": "five", "b": [0.292, 0.5848, 0.3312, 0.6046]}, {"w": "or", "b": [0.3375, 0.5848, 0.3585, 0.6046]}, {"w": "six", "b": [0.3648, 0.5848, 0.3943, 0.6046]}, {"w": "different", "b": [0.4006, 0.5848, 0.487, 0.6046]}, {"w": "tensor", "b": [0.4933, 0.5848, 0.5549, 0.6046]}, {"w": "operations.", "b": [0.5612, 0.5848, 0.6726, 0.6046]}, {"w": "Scalability—", "b": [0.1799, 0.6053, 0.3144, 0.6251]}, {"w": "Deep", "b": [0.3207, 0.6053, 0.3739, 0.6251]}, {"w": "learning", "b": [0.3802, 0.6053, 0.4629, 0.6251]}, {"w": "is", "b": [0.4692, 0.6053, 0.486, 0.6251]}, {"w": "highly", "b": [0.4923, 0.6053, 0.5568, 0.6251]}, {"w": "amenable", "b": [0.5631, 0.6053, 0.6598, 0.6251]}, {"w": "to", "b": [0.6661, 0.6053, 0.6857, 0.6251]}, {"w": "parallelization", "b": [0.692, 0.6053, 0.8363, 0.6251]}, {"w": "on", "b": [0.8426, 0.6053, 0.8679, 0.6251]}, {"w": "GPUs", "b": [0.1799, 0.6258, 0.2401, 0.6456]}, {"w": "or", "b": [0.2464, 0.6258, 0.2674, 0.6456]}, {"w": "TPUs,", "b": [0.2738, 0.6258, 0.3375, 0.6456]}, {"w": "so", "b": [0.3438, 0.6258, 0.3663, 0.6456]}, {"w": "it", "b": [0.3726, 0.6258, 0.3866, 0.6456]}, {"w": "can", "b": [0.3929, 0.6258, 0.4279, 0.6456]}, {"w": "take", "b": [0.4342, 0.6258, 0.4762, 0.6456]}, {"w": "full", "b": [0.4825, 0.6258, 0.5176, 0.6456]}, {"w": "advantage", "b": [0.5239, 0.6258, 0.6262, 0.6456]}, {"w": "of", "b": [0.6325, 0.6258, 0.6535, 0.6456]}, {"w": "Moore’s", "b": [0.6598, 0.6258, 0.7438, 0.6456]}, {"w": "law.", "b": [0.7501, 0.6258, 0.7912, 0.6456]}, {"w": "In", "b": [0.7975, 0.6258, 0.8186, 0.6456]}, {"w": "addition,", "b": [0.1799, 0.6463, 0.2689, 0.6661]}, {"w": "deep-learning", "b": [0.2751, 0.6463, 0.4138, 0.6661]}, {"w": "models", "b": [0.4201, 0.6463, 0.493, 0.6661]}, {"w": "are", "b": [0.4993, 0.6463, 0.5301, 0.6661]}, {"w": "trained", "b": [0.5364, 0.6463, 0.6065, 0.6661]}, {"w": "by", "b": [0.6128, 0.6463, 0.638, 0.6661]}, {"w": "iterating", "b": [0.6443, 0.6463, 0.7284, 0.6661]}, {"w": "over", "b": [0.7347, 0.6463, 0.7795, 0.6661]}, {"w": "small", "b": [0.7858, 0.6463, 0.8405, 0.6661]}, {"w": "batches", "b": [0.1799, 0.6668, 0.2555, 0.6866]}, {"w": "of", "b": [0.2618, 0.6668, 0.2828, 0.6866]}, {"w": "data,", "b": [0.2891, 0.6668, 0.3375, 0.6866]}, {"w": "allowing", "b": [0.3438, 0.6668, 0.4321, 0.6866]}, {"w": "them", "b": [0.4384, 0.6668, 0.4888, 0.6866]}, {"w": "to", "b": [0.4951, 0.6668, 0.5148, 0.6866]}, {"w": "be", "b": [0.5211, 0.6668, 0.5449, 0.6866]}, {"w": "trained", "b": [0.5512, 0.6668, 0.6212, 0.6866]}, {"w": "on", "b": [0.6275, 0.6668, 0.6528, 0.6866]}, {"w": "datasets", "b": [0.6591, 0.6668, 0.7389, 0.6866]}, {"w": "of", "b": [0.7452, 0.6668, 0.7663, 0.6866]}, {"w": "arbitrary", "b": [0.7726, 0.6668, 0.8594, 0.6866]}, {"w": "size.", "b": [0.1799, 0.6873, 0.2254, 0.7071]}, {"w": "(The", "b": [0.2317, 0.6873, 0.2793, 0.7071]}, {"w": "only", "b": [0.2856, 0.6873, 0.3305, 0.7071]}, {"w": "bottleneck", "b": [0.3368, 0.6873, 0.4419, 0.7071]}, {"w": "is", "b": [0.4482, 0.6873, 0.465, 0.7071]}, {"w": "the", "b": [0.4713, 0.6873, 0.5021, 0.7071]}, {"w": "amount", "b": [0.5085, 0.6873, 0.5841, 0.7071]}, {"w": "of", "b": [0.5904, 0.6873, 0.6115, 0.7071]}, {"w": "parallel", "b": [0.6178, 0.6873, 0.6934, 0.7071]}, {"w": "computational", "b": [0.6997, 0.6873, 0.8441, 0.7071]}, {"w": "power", "b": [0.1799, 0.7078, 0.2429, 0.7276]}, {"w": "available,", "b": [0.2492, 0.7078, 0.3466, 0.7276]}, {"w": "which,", "b": [0.3529, 0.7078, 0.4208, 0.7276]}, {"w": "thanks", "b": [0.4272, 0.7078, 0.493, 0.7276]}, {"w": "to", "b": [0.4993, 0.7078, 0.5189, 0.7276]}, {"w": "Moore’s", "b": [0.5253, 0.7078, 0.6093, 0.7276]}, {"w": "law,", "b": [0.6156, 0.7078, 0.6567, 0.7276]}, {"w": "is", "b": [0.663, 0.7078, 0.6798, 0.7276]}, {"w": "a", "b": [0.6861, 0.7078, 0.6973, 0.7276]}, {"w": "fast--moving", "b": [0.7036, 0.7078, 0.834, 0.7276]}, {"w": "barrier.)", "b": [0.1799, 0.7283, 0.2604, 0.7481]}, {"w": "Versatility", "b": [0.1799, 0.7488, 0.2836, 0.7686]}, {"w": "and", "b": [0.2899, 0.7488, 0.3292, 0.7686]}, {"w": "reusability—", "b": [0.3355, 0.7488, 0.47, 0.7686]}, {"w": "Unlike", "b": [0.4763, 0.7488, 0.545, 0.7686]}, {"w": "many", "b": [0.5513, 0.7488, 0.6073, 0.7686]}, {"w": "prior", "b": [0.6136, 0.7488, 0.6627, 0.7686]}, {"w": "machine-learning", "b": [0.669, 0.7488, 0.8455, 0.7686]}, {"w": "approaches,", "b": [0.1799, 0.7693, 0.2996, 0.7891]}, {"w": "deep-learning", "b": [0.3059, 0.7693, 0.4446, 0.7891]}, {"w": "models", "b": [0.4509, 0.7693, 0.5238, 0.7891]}, {"w": "can", "b": [0.5301, 0.7693, 0.5651, 0.7891]}, {"w": "be", "b": [0.5714, 0.7693, 0.5953, 0.7891]}, {"w": "trained", "b": [0.6016, 0.7693, 0.6716, 0.7891]}, {"w": "on", "b": [0.6779, 0.7693, 0.7031, 0.7891]}, {"w": "additional", "b": [0.7095, 0.7693, 0.8104, 0.7891]}, {"w": "data", "b": [0.8167, 0.7693, 0.8587, 0.7891]}, {"w": "without", "b": [0.1799, 0.7898, 0.257, 0.8096]}, {"w": "restarting", "b": [0.2633, 0.7898, 0.3585, 0.8096]}, {"w": "from", "b": [0.3648, 0.7898, 0.4139, 0.8096]}, {"w": "scratch,", "b": [0.4202, 0.7898, 0.4979, 0.8096]}, {"w": "making", "b": [0.5042, 0.7898, 0.5799, 0.8096]}, {"w": "them", "b": [0.5862, 0.7898, 0.6366, 0.8096]}, {"w": "viable", "b": [0.643, 0.7898, 0.7046, 0.8096]}, {"w": "for", "b": [0.7109, 0.7898, 0.7403, 0.8096]}, {"w": "continuous", "b": [0.7466, 0.7898, 0.8573, 0.8096]}, {"w": "online", "b": [0.1799, 0.8103, 0.2429, 0.8301]}, {"w": "learning—an", "b": [0.2492, 0.8103, 0.3809, 0.8301]}, {"w": "important", "b": [0.3872, 0.8103, 0.4853, 0.8301]}, {"w": "property", "b": [0.4917, 0.8103, 0.5771, 0.8301]}, {"w": "for", "b": [0.5834, 0.8103, 0.6128, 0.8301]}, {"w": "very", "b": [0.6191, 0.8103, 0.664, 0.8301]}, {"w": "large", "b": [0.6703, 0.8103, 0.7202, 0.8301]}, {"w": "production", "b": [0.7265, 0.8103, 0.8358, 0.8301]}, {"w": "models.", "b": [0.1799, 0.8308, 0.259, 0.8506]}, {"w": "Furthermore,", "b": [0.2654, 0.8308, 0.3978, 0.8506]}, {"w": "trained", "b": [0.404, 0.8308, 0.4741, 0.8506]}, {"w": "deep-learning", "b": [0.4804, 0.8308, 0.6191, 0.8506]}, {"w": "models", "b": [0.6254, 0.8308, 0.6983, 0.8506]}, {"w": "are", "b": [0.7046, 0.8308, 0.7354, 0.8506]}, {"w": "repurposable", "b": [0.1799, 0.8513, 0.3102, 0.8711]}, {"w": "and", "b": [0.3165, 0.8513, 0.3529, 0.8711]}, {"w": "thus", "b": [0.3592, 0.8513, 0.4012, 0.8711]}, {"w": "reusable:", "b": [0.4076, 0.8513, 0.4986, 0.8711]}, {"w": "for", "b": [0.5049, 0.8513, 0.5343, 0.8711]}, {"w": "instance,", "b": [0.5406, 0.8513, 0.6296, 0.8711]}, {"w": "it’s", "b": [0.6359, 0.8513, 0.6667, 0.8711]}, {"w": "possible", "b": [0.673, 0.8513, 0.7557, 0.8711]}, {"w": "to", "b": [0.762, 0.8513, 0.7816, 0.8711]}, {"w": "take", "b": [0.7879, 0.8513, 0.83, 0.8711]}, {"w": "a", "b": [0.8363, 0.8513, 0.8475, 0.8711]}, {"w": "deep-learning", "b": [0.1799, 0.8718, 0.3186, 0.8916]}, {"w": "model", "b": [0.3249, 0.8718, 0.3879, 0.8916]}, {"w": "trained", "b": [0.3942, 0.8718, 0.4642, 0.8916]}, {"w": "for", "b": [0.4705, 0.8718, 0.5, 0.8916]}, {"w": "image", "b": [0.5063, 0.8718, 0.5679, 0.8916]}, {"w": "classification", "b": [0.5742, 0.8718, 0.7073, 0.8916]}, {"w": "and", "b": [0.7136, 0.8718, 0.7501, 0.8916]}, {"w": "drop", "b": [0.7564, 0.8718, 0.8026, 0.8916]}, {"w": "it", "b": [0.8089, 0.8718, 0.8229, 0.8916]}, {"w": "into", "b": [0.8293, 0.8718, 0.8685, 0.8916]}, {"w": "a", "b": [0.1799, 0.8923, 0.1911, 0.9121]}, {"w": "video-processing", "b": [0.1974, 0.8923, 0.3697, 0.9121]}, {"w": "pipeline.", "b": [0.376, 0.8923, 0.4636, 0.9121]}, {"w": "This", "b": [0.4699, 0.8923, 0.5148, 0.9121]}, {"w": "allows", "b": [0.5211, 0.8923, 0.5869, 0.9121]}, {"w": "us", "b": [0.5932, 0.8923, 0.6157, 0.9121]}, {"w": "to", "b": [0.622, 0.8923, 0.6416, 0.9121]}, {"w": "reinvest", "b": [0.6479, 0.8923, 0.7278, 0.9121]}, {"w": "previous", "b": [0.7341, 0.8923, 0.821, 0.9121]}]}]}, {"page": 57, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "work into increasingly complex and powerful models. This also makes deep learning applicable to fairly small datasets.", "words": [{"w": "work", "b": [0.1799, 0.0857, 0.2317, 0.1054]}, {"w": "into", "b": [0.238, 0.0857, 0.2773, 0.1054]}, {"w": "increasingly", "b": [0.2835, 0.0857, 0.4068, 0.1054]}, {"w": "complex", "b": [0.4132, 0.0857, 0.5, 0.1054]}, {"w": "and", "b": [0.5063, 0.0857, 0.5428, 0.1054]}, {"w": "powerful", "b": [0.5491, 0.0857, 0.6401, 0.1054]}, {"w": "models.", "b": [0.6464, 0.0857, 0.7256, 0.1054]}, {"w": "This", "b": [0.7319, 0.0857, 0.7768, 0.1054]}, {"w": "also", "b": [0.7831, 0.0857, 0.8237, 0.1054]}, {"w": "makes", "b": [0.1799, 0.1062, 0.2443, 0.1259]}, {"w": "deep", "b": [0.2506, 0.1062, 0.2982, 0.1259]}, {"w": "learning", "b": [0.3046, 0.1062, 0.3872, 0.1259]}, {"w": "applicable", "b": [0.3935, 0.1062, 0.4972, 0.1259]}, {"w": "to", "b": [0.5035, 0.1062, 0.5231, 0.1259]}, {"w": "fairly", "b": [0.5294, 0.1062, 0.5841, 0.1259]}, {"w": "small", "b": [0.5904, 0.1062, 0.6451, 0.1259]}, {"w": "datasets.", "b": [0.6514, 0.1062, 0.7375, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Deep learning has only been in the spotlight for a few years, and we haven’t yet established the full scope of what it can do. With every passing month, we learn about new use cases and engineering improvements that lift previous limitations. Following a scientific revolution, progress generally follows a sigmoid curve: it starts with a period of fast progress, which gradually stabilizes as researchers hit hard limitations, and then further improvements become incremental. Deep learning in 2017 seems to be in the first half of that sigmoid, with much more progress to come in the next few years.", "words": [{"w": "Deep", "b": [0.1294, 0.149, 0.1826, 0.1687]}, {"w": "learning", "b": [0.1889, 0.149, 0.2716, 0.1687]}, {"w": "has", "b": [0.2779, 0.149, 0.3115, 0.1687]}, {"w": "only", "b": [0.3178, 0.149, 0.3627, 0.1687]}, {"w": "been", "b": [0.369, 0.149, 0.4166, 0.1687]}, {"w": "in", "b": [0.4229, 0.149, 0.4426, 0.1687]}, {"w": "the", "b": [0.4489, 0.149, 0.4797, 0.1687]}, {"w": "spotlight", "b": [0.486, 0.149, 0.5743, 0.1687]}, {"w": "for", "b": [0.5806, 0.149, 0.61, 0.1687]}, {"w": "a", "b": [0.6163, 0.149, 0.6275, 0.1687]}, {"w": "few", "b": [0.6339, 0.149, 0.6717, 0.1687]}, {"w": "years,", "b": [0.678, 0.149, 0.7375, 0.1687]}, {"w": "and", "b": [0.7438, 0.149, 0.7802, 0.1687]}, {"w": "we", "b": [0.7865, 0.149, 0.816, 0.1687]}, {"w": "haven’t", "b": [0.1294, 0.1695, 0.2046, 0.1892]}, {"w": "yet", "b": [0.2109, 0.1695, 0.2417, 0.1892]}, {"w": "established", "b": [0.248, 0.1695, 0.3601, 0.1892]}, {"w": "the", "b": [0.3664, 0.1695, 0.3973, 0.1892]}, {"w": "full", "b": [0.4036, 0.1695, 0.4386, 0.1892]}, {"w": "scope", "b": [0.4449, 0.1695, 0.5024, 0.1892]}, {"w": "of", "b": [0.5087, 0.1695, 0.5297, 0.1892]}, {"w": "what", "b": [0.536, 0.1695, 0.585, 0.1892]}, {"w": "it", "b": [0.5913, 0.1695, 0.6054, 0.1892]}, {"w": "can", "b": [0.6117, 0.1695, 0.6467, 0.1892]}, {"w": "do.", "b": [0.6529, 0.1695, 0.6844, 0.1892]}, {"w": "With", "b": [0.6907, 0.1695, 0.7402, 0.1892]}, {"w": "every", "b": [0.7465, 0.1695, 0.8025, 0.1892]}, {"w": "passing", "b": [0.1294, 0.19, 0.2051, 0.2097]}, {"w": "month,", "b": [0.2114, 0.19, 0.2822, 0.2097]}, {"w": "we", "b": [0.2885, 0.19, 0.3179, 0.2097]}, {"w": "learn", "b": [0.3242, 0.19, 0.3746, 0.2097]}, {"w": "about", "b": [0.3809, 0.19, 0.437, 0.2097]}, {"w": "new", "b": [0.4433, 0.19, 0.4853, 0.2097]}, {"w": "use", "b": [0.4916, 0.19, 0.5253, 0.2097]}, {"w": "cases", "b": [0.5316, 0.19, 0.5848, 0.2097]}, {"w": "and", "b": [0.5911, 0.19, 0.6275, 0.2097]}, {"w": "engineering", "b": [0.6338, 0.19, 0.7529, 0.2097]}, {"w": "improvements", "b": [0.1294, 0.2105, 0.2738, 0.2302]}, {"w": "that", "b": [0.2801, 0.2105, 0.3179, 0.2302]}, {"w": "lift", "b": [0.3242, 0.2105, 0.3536, 0.2302]}, {"w": "previous", "b": [0.36, 0.2105, 0.4468, 0.2302]}, {"w": "limitations.", "b": [0.4531, 0.2105, 0.5674, 0.2302]}, {"w": "Following", "b": [0.5737, 0.2105, 0.6774, 0.2302]}, {"w": "a", "b": [0.6836, 0.2105, 0.6948, 0.2302]}, {"w": "scientific", "b": [0.7011, 0.2105, 0.7936, 0.2302]}, {"w": "revolution,", "b": [0.1294, 0.231, 0.2394, 0.2507]}, {"w": "progress", "b": [0.2457, 0.231, 0.3312, 0.2507]}, {"w": "generally", "b": [0.3375, 0.231, 0.4314, 0.2507]}, {"w": "follows", "b": [0.4377, 0.231, 0.5133, 0.2507]}, {"w": "a", "b": [0.5197, 0.231, 0.5309, 0.2507]}, {"w": "sigmoid", "b": [0.5372, 0.231, 0.6185, 0.2507]}, {"w": "curve:", "b": [0.6248, 0.231, 0.6878, 0.2507]}, {"w": "it", "b": [0.6941, 0.231, 0.7081, 0.2507]}, {"w": "starts", "b": [0.7144, 0.231, 0.7677, 0.2507]}, {"w": "with", "b": [0.774, 0.231, 0.8189, 0.2507]}, {"w": "a", "b": [0.8252, 0.231, 0.8364, 0.2507]}, {"w": "period", "b": [0.1294, 0.2515, 0.1939, 0.2712]}, {"w": "of", "b": [0.2002, 0.2515, 0.2212, 0.2712]}, {"w": "fast", "b": [0.2275, 0.2515, 0.2639, 0.2712]}, {"w": "progress,", "b": [0.2702, 0.2515, 0.362, 0.2712]}, {"w": "which", "b": [0.3683, 0.2515, 0.43, 0.2712]}, {"w": "gradually", "b": [0.4363, 0.2515, 0.5315, 0.2712]}, {"w": "stabilizes", "b": [0.5378, 0.2515, 0.6317, 0.2712]}, {"w": "as", "b": [0.638, 0.2515, 0.659, 0.2712]}, {"w": "researchers", "b": [0.6653, 0.2515, 0.7788, 0.2712]}, {"w": "hit", "b": [0.7851, 0.2515, 0.8117, 0.2712]}, {"w": "hard", "b": [0.818, 0.2515, 0.8628, 0.2712]}, {"w": "limitations,", "b": [0.1294, 0.272, 0.2437, 0.2917]}, {"w": "and", "b": [0.25, 0.272, 0.2864, 0.2917]}, {"w": "then", "b": [0.2927, 0.272, 0.3361, 0.2917]}, {"w": "further", "b": [0.3424, 0.272, 0.4111, 0.2917]}, {"w": "improvements", "b": [0.4174, 0.272, 0.5617, 0.2917]}, {"w": "become", "b": [0.568, 0.272, 0.6465, 0.2917]}, {"w": "incremental.", "b": [0.6528, 0.272, 0.7782, 0.2917]}, {"w": "Deep", "b": [0.7845, 0.272, 0.8377, 0.2917]}, {"w": "learning", "b": [0.1294, 0.2925, 0.2121, 0.3122]}, {"w": "in", "b": [0.2184, 0.2925, 0.238, 0.3122]}, {"w": "2017", "b": [0.2443, 0.2925, 0.2948, 0.3122]}, {"w": "seems", "b": [0.3011, 0.2925, 0.3627, 0.3122]}, {"w": "to", "b": [0.369, 0.2925, 0.3886, 0.3122]}, {"w": "be", "b": [0.3949, 0.2925, 0.4187, 0.3122]}, {"w": "in", "b": [0.425, 0.2925, 0.4447, 0.3122]}, {"w": "the", "b": [0.451, 0.2925, 0.4818, 0.3122]}, {"w": "first", "b": [0.4881, 0.2925, 0.5288, 0.3122]}, {"w": "half", "b": [0.5351, 0.2925, 0.5743, 0.3122]}, {"w": "of", "b": [0.5806, 0.2925, 0.6016, 0.3122]}, {"w": "that", "b": [0.6079, 0.2925, 0.6457, 0.3122]}, {"w": "sigmoid,", "b": [0.6521, 0.2925, 0.7397, 0.3122]}, {"w": "with", "b": [0.746, 0.2925, 0.7908, 0.3122]}, {"w": "much", "b": [0.7971, 0.2925, 0.8532, 0.3122]}, {"w": "more", "b": [0.1294, 0.313, 0.1813, 0.3327]}, {"w": "progress", "b": [0.1876, 0.313, 0.273, 0.3327]}, {"w": "to", "b": [0.2793, 0.313, 0.299, 0.3327]}, {"w": "come", "b": [0.3053, 0.313, 0.3599, 0.3327]}, {"w": "in", "b": [0.3662, 0.313, 0.3858, 0.3327]}, {"w": "the", "b": [0.3921, 0.313, 0.423, 0.3327]}, {"w": "next", "b": [0.4293, 0.313, 0.4727, 0.3327]}, {"w": "few", "b": [0.479, 0.313, 0.5168, 0.3327]}, {"w": "years.", "b": [0.5231, 0.313, 0.5827, 0.3327]}]}]}, {"page": 58, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 2. Before we begin: the mathematical building blocks of neural networks", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "2.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Before", "b": [0.3011, 0.1076, 0.4016, 0.1355]}, {"w": "we", "b": [0.4105, 0.1076, 0.4522, 0.1355]}, {"w": "begin:", "b": [0.4611, 0.1076, 0.5564, 0.1355]}, {"w": "the", "b": [0.5654, 0.1076, 0.613, 0.1355]}, {"w": "mathematical", "b": [0.6219, 0.1076, 0.8303, 0.1355]}, {"w": "building", "b": [0.1294, 0.137, 0.2565, 0.165]}, {"w": "blocks", "b": [0.2655, 0.137, 0.3628, 0.165]}, {"w": "of", "b": [0.3717, 0.137, 0.4015, 0.165]}, {"w": "neural", "b": [0.4104, 0.137, 0.5097, 0.165]}, {"w": "networks", "b": [0.5186, 0.137, 0.6595, 0.165]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1882, 0.1729, 0.2079]}, {"w": "chapter", "b": [0.1792, 0.1882, 0.2562, 0.2079]}, {"w": "covers", "b": [0.2626, 0.1882, 0.3284, 0.2079]}]}, {"id": "b_2", "type": "paragraph", "text": "A first example of a neural network Tensors and tensor operations How neural networks learn via backpropagation and gradient descent", "words": [{"w": "A", "b": [0.1799, 0.2265, 0.1981, 0.2462]}, {"w": "first", "b": [0.2044, 0.2265, 0.245, 0.2462]}, {"w": "example", "b": [0.2513, 0.2265, 0.3368, 0.2462]}, {"w": "of", "b": [0.3431, 0.2265, 0.3641, 0.2462]}, {"w": "a", "b": [0.3704, 0.2265, 0.3816, 0.2462]}, {"w": "neural", "b": [0.3879, 0.2265, 0.451, 0.2462]}, {"w": "network", "b": [0.4573, 0.2265, 0.5399, 0.2462]}, {"w": "Tensors", "b": [0.1799, 0.247, 0.258, 0.2667]}, {"w": "and", "b": [0.2643, 0.247, 0.3007, 0.2667]}, {"w": "tensor", "b": [0.307, 0.247, 0.3687, 0.2667]}, {"w": "operations", "b": [0.375, 0.247, 0.4801, 0.2667]}, {"w": "How", "b": [0.1799, 0.2675, 0.2289, 0.2872]}, {"w": "neural", "b": [0.2352, 0.2675, 0.2982, 0.2872]}, {"w": "networks", "b": [0.3046, 0.2675, 0.397, 0.2872]}, {"w": "learn", "b": [0.4033, 0.2675, 0.4538, 0.2872]}, {"w": "via", "b": [0.4601, 0.2675, 0.4909, 0.2872]}, {"w": "backpropagation", "b": [0.4972, 0.2675, 0.6653, 0.2872]}, {"w": "and", "b": [0.6716, 0.2675, 0.7081, 0.2872]}, {"w": "gradient", "b": [0.7144, 0.2675, 0.797, 0.2872]}, {"w": "descent", "b": [0.1799, 0.288, 0.2555, 0.3077]}]}, {"id": "b_3", "type": "paragraph", "text": "Understanding deep learning requires familiarity with many simple mathematical concepts: tensors, tensor operations, differentiation, gradient descent, and so on. Our goal in this chapter will be to build your intuition about these notions without getting overly technical. In particular, we’ll steer away from mathematical notation, which can be off-putting for those without any mathematics background and isn’t strictly necessary to explain things well.", "words": [{"w": "Understanding", "b": [0.1294, 0.3308, 0.2779, 0.3505]}, {"w": "deep", "b": [0.2842, 0.3308, 0.3319, 0.3505]}, {"w": "learning", "b": [0.3382, 0.3308, 0.4208, 0.3505]}, {"w": "requires", "b": [0.4272, 0.3308, 0.5084, 0.3505]}, {"w": "familiarity", "b": [0.5147, 0.3308, 0.6212, 0.3505]}, {"w": "with", "b": [0.6275, 0.3308, 0.6724, 0.3505]}, {"w": "many", "b": [0.6787, 0.3308, 0.7347, 0.3505]}, {"w": "simple", "b": [0.741, 0.3308, 0.8083, 0.3505]}, {"w": "mathematical", "b": [0.1294, 0.3513, 0.2653, 0.371]}, {"w": "concepts:", "b": [0.2716, 0.3513, 0.3669, 0.371]}, {"w": "tensors,", "b": [0.3732, 0.3513, 0.451, 0.371]}, {"w": "tensor", "b": [0.4573, 0.3513, 0.5189, 0.371]}, {"w": "operations,", "b": [0.5253, 0.3513, 0.6367, 0.371]}, {"w": "differentiation,", "b": [0.643, 0.3513, 0.793, 0.371]}, {"w": "gradient", "b": [0.1294, 0.3718, 0.2121, 0.3915]}, {"w": "descent,", "b": [0.2184, 0.3718, 0.3003, 0.3915]}, {"w": "and", "b": [0.3066, 0.3718, 0.3431, 0.3915]}, {"w": "so", "b": [0.3494, 0.3718, 0.3718, 0.3915]}, {"w": "on.", "b": [0.3781, 0.3718, 0.4096, 0.3915]}, {"w": "Our", "b": [0.416, 0.3718, 0.4552, 0.3915]}, {"w": "goal", "b": [0.4615, 0.3718, 0.5049, 0.3915]}, {"w": "in", "b": [0.5112, 0.3718, 0.5309, 0.3915]}, {"w": "this", "b": [0.5372, 0.3718, 0.5736, 0.3915]}, {"w": "chapter", "b": [0.5799, 0.3718, 0.6542, 0.3915]}, {"w": "will", "b": [0.6605, 0.3718, 0.6997, 0.3915]}, {"w": "be", "b": [0.706, 0.3718, 0.7298, 0.3915]}, {"w": "to", "b": [0.7361, 0.3718, 0.7558, 0.3915]}, {"w": "build", "b": [0.7621, 0.3718, 0.8139, 0.3915]}, {"w": "your", "b": [0.8202, 0.3718, 0.8665, 0.3915]}, {"w": "intuition", "b": [0.1294, 0.3923, 0.2149, 0.412]}, {"w": "about", "b": [0.2212, 0.3923, 0.2773, 0.412]}, {"w": "these", "b": [0.2836, 0.3923, 0.3354, 0.412]}, {"w": "notions", "b": [0.3417, 0.3923, 0.416, 0.412]}, {"w": "without", "b": [0.4223, 0.3923, 0.4994, 0.412]}, {"w": "getting", "b": [0.5057, 0.3923, 0.5758, 0.412]}, {"w": "overly", "b": [0.582, 0.3923, 0.6465, 0.412]}, {"w": "technical.", "b": [0.6528, 0.3923, 0.7502, 0.412]}, {"w": "In", "b": [0.7565, 0.3923, 0.7775, 0.412]}, {"w": "particular,", "b": [0.1294, 0.4128, 0.2313, 0.4325]}, {"w": "we’ll", "b": [0.2377, 0.4128, 0.2895, 0.4325]}, {"w": "steer", "b": [0.2958, 0.4128, 0.3434, 0.4325]}, {"w": "away", "b": [0.3497, 0.4128, 0.403, 0.4325]}, {"w": "from", "b": [0.4093, 0.4128, 0.4583, 0.4325]}, {"w": "mathematical", "b": [0.4646, 0.4128, 0.6005, 0.4325]}, {"w": "notation,", "b": [0.6068, 0.4128, 0.6958, 0.4325]}, {"w": "which", "b": [0.7021, 0.4128, 0.7638, 0.4325]}, {"w": "can", "b": [0.7701, 0.4128, 0.8051, 0.4325]}, {"w": "be", "b": [0.8114, 0.4128, 0.8352, 0.4325]}, {"w": "off-putting", "b": [0.1294, 0.4333, 0.2383, 0.453]}, {"w": "for", "b": [0.2446, 0.4333, 0.274, 0.453]}, {"w": "those", "b": [0.2803, 0.4333, 0.3335, 0.453]}, {"w": "without", "b": [0.3398, 0.4333, 0.4169, 0.453]}, {"w": "any", "b": [0.4232, 0.4333, 0.4597, 0.453]}, {"w": "mathematics", "b": [0.4659, 0.4333, 0.5935, 0.453]}, {"w": "background", "b": [0.5998, 0.4333, 0.7189, 0.453]}, {"w": "and", "b": [0.7252, 0.4333, 0.7616, 0.453]}, {"w": "isn’t", "b": [0.7679, 0.4333, 0.8122, 0.453]}, {"w": "strictly", "b": [0.1294, 0.4538, 0.1995, 0.4735]}, {"w": "necessary", "b": [0.2058, 0.4538, 0.3038, 0.4735]}, {"w": "to", "b": [0.3102, 0.4538, 0.3298, 0.4735]}, {"w": "explain", "b": [0.3361, 0.4538, 0.4104, 0.4735]}, {"w": "things", "b": [0.4167, 0.4538, 0.4783, 0.4735]}, {"w": "well.", "b": [0.4846, 0.4538, 0.5344, 0.4735]}]}, {"id": "b_4", "type": "paragraph", "text": "To add some context for tensors and gradient descent, we’ll begin the chapter with a practical example of a neural network. Then we’ll go over every new concept that’s been introduced, point by point. Keep in mind that these concepts will be essential for you to understand the practical examples that will come in the following chapters!", "words": [{"w": "To", "b": [0.1294, 0.4966, 0.1557, 0.5163]}, {"w": "add", "b": [0.162, 0.4966, 0.1984, 0.5163]}, {"w": "some", "b": [0.2047, 0.4966, 0.258, 0.5163]}, {"w": "context", "b": [0.2643, 0.4966, 0.3385, 0.5163]}, {"w": "for", "b": [0.3448, 0.4966, 0.3743, 0.5163]}, {"w": "tensors", "b": [0.3806, 0.4966, 0.452, 0.5163]}, {"w": "and", "b": [0.4583, 0.4966, 0.4948, 0.5163]}, {"w": "gradient", "b": [0.5011, 0.4966, 0.5837, 0.5163]}, {"w": "descent,", "b": [0.59, 0.4966, 0.672, 0.5163]}, {"w": "we’ll", "b": [0.6783, 0.4966, 0.7301, 0.5163]}, {"w": "begin", "b": [0.7364, 0.4966, 0.7925, 0.5163]}, {"w": "the", "b": [0.7988, 0.4966, 0.8296, 0.5163]}, {"w": "chapter", "b": [0.1294, 0.5171, 0.2037, 0.5368]}, {"w": "with", "b": [0.21, 0.5171, 0.2548, 0.5368]}, {"w": "a", "b": [0.2611, 0.5171, 0.2723, 0.5368]}, {"w": "practical", "b": [0.2786, 0.5171, 0.3655, 0.5368]}, {"w": "example", "b": [0.3718, 0.5171, 0.4572, 0.5368]}, {"w": "of", "b": [0.4636, 0.5171, 0.4846, 0.5368]}, {"w": "a", "b": [0.4909, 0.5171, 0.5021, 0.5368]}, {"w": "neural", "b": [0.5084, 0.5171, 0.5714, 0.5368]}, {"w": "network.", "b": [0.5777, 0.5171, 0.6667, 0.5368]}, {"w": "Then", "b": [0.6729, 0.5171, 0.7247, 0.5368]}, {"w": "we’ll", "b": [0.7311, 0.5171, 0.7829, 0.5368]}, {"w": "go", "b": [0.7892, 0.5171, 0.8144, 0.5368]}, {"w": "over", "b": [0.8207, 0.5171, 0.8656, 0.5368]}, {"w": "every", "b": [0.1294, 0.5376, 0.1854, 0.5573]}, {"w": "new", "b": [0.1917, 0.5376, 0.2338, 0.5573]}, {"w": "concept", "b": [0.2401, 0.5376, 0.3185, 0.5573]}, {"w": "that’s", "b": [0.3248, 0.5376, 0.3795, 0.5573]}, {"w": "been", "b": [0.3858, 0.5376, 0.4334, 0.5573]}, {"w": "introduced,", "b": [0.4397, 0.5376, 0.5539, 0.5573]}, {"w": "point", "b": [0.5602, 0.5376, 0.6121, 0.5573]}, {"w": "by", "b": [0.6184, 0.5376, 0.6436, 0.5573]}, {"w": "point.", "b": [0.6499, 0.5376, 0.7081, 0.5573]}, {"w": "Keep", "b": [0.7144, 0.5376, 0.7676, 0.5573]}, {"w": "in", "b": [0.7739, 0.5376, 0.7935, 0.5573]}, {"w": "mind", "b": [0.7998, 0.5376, 0.8517, 0.5573]}, {"w": "that", "b": [0.1294, 0.5581, 0.1673, 0.5778]}, {"w": "these", "b": [0.1736, 0.5581, 0.2254, 0.5778]}, {"w": "concepts", "b": [0.2317, 0.5581, 0.32, 0.5778]}, {"w": "will", "b": [0.3263, 0.5581, 0.3655, 0.5778]}, {"w": "be", "b": [0.3718, 0.5581, 0.3956, 0.5778]}, {"w": "essential", "b": [0.402, 0.5581, 0.4888, 0.5778]}, {"w": "for", "b": [0.4951, 0.5581, 0.5245, 0.5778]}, {"w": "you", "b": [0.5308, 0.5581, 0.5686, 0.5778]}, {"w": "to", "b": [0.5749, 0.5581, 0.5946, 0.5778]}, {"w": "understand", "b": [0.6009, 0.5581, 0.7116, 0.5778]}, {"w": "the", "b": [0.7179, 0.5581, 0.7487, 0.5778]}, {"w": "practical", "b": [0.755, 0.5581, 0.8418, 0.5778]}, {"w": "examples", "b": [0.1294, 0.5786, 0.2247, 0.5983]}, {"w": "that", "b": [0.231, 0.5786, 0.2688, 0.5983]}, {"w": "will", "b": [0.2751, 0.5786, 0.3144, 0.5983]}, {"w": "come", "b": [0.3207, 0.5786, 0.3753, 0.5983]}, {"w": "in", "b": [0.3816, 0.5786, 0.4013, 0.5983]}, {"w": "the", "b": [0.4076, 0.5786, 0.4384, 0.5983]}, {"w": "following", "b": [0.4447, 0.5786, 0.5428, 0.5983]}, {"w": "chapters!", "b": [0.5491, 0.5786, 0.6416, 0.5983]}]}, {"id": "b_5", "type": "paragraph", "text": "After reading this chapter, you’ll have an intuitive understanding of how neural networks work, and you’ll be able to move on to practical applications—which will start with chapter 3.", "words": [{"w": "After", "b": [0.1294, 0.6214, 0.1826, 0.6411]}, {"w": "reading", "b": [0.1889, 0.6214, 0.2646, 0.6411]}, {"w": "this", "b": [0.2709, 0.6214, 0.3074, 0.6411]}, {"w": "chapter,", "b": [0.3137, 0.6214, 0.3932, 0.6411]}, {"w": "you’ll", "b": [0.3995, 0.6214, 0.4597, 0.6411]}, {"w": "have", "b": [0.466, 0.6214, 0.5137, 0.6411]}, {"w": "an", "b": [0.52, 0.6214, 0.5438, 0.6411]}, {"w": "intuitive", "b": [0.5501, 0.6214, 0.6342, 0.6411]}, {"w": "understanding", "b": [0.6405, 0.6214, 0.7834, 0.6411]}, {"w": "of", "b": [0.7897, 0.6214, 0.8107, 0.6411]}, {"w": "how", "b": [0.8171, 0.6214, 0.8605, 0.6411]}, {"w": "neural", "b": [0.1294, 0.6419, 0.1925, 0.6616]}, {"w": "networks", "b": [0.1988, 0.6419, 0.2912, 0.6616]}, {"w": "work,", "b": [0.2975, 0.6419, 0.3557, 0.6616]}, {"w": "and", "b": [0.362, 0.6419, 0.3984, 0.6616]}, {"w": "you’ll", "b": [0.4047, 0.6419, 0.465, 0.6616]}, {"w": "be", "b": [0.4713, 0.6419, 0.4951, 0.6616]}, {"w": "able", "b": [0.5014, 0.6419, 0.5434, 0.6616]}, {"w": "to", "b": [0.5497, 0.6419, 0.5694, 0.6616]}, {"w": "move", "b": [0.5757, 0.6419, 0.6317, 0.6616]}, {"w": "on", "b": [0.638, 0.6419, 0.6632, 0.6616]}, {"w": "to", "b": [0.6695, 0.6419, 0.6891, 0.6616]}, {"w": "practical", "b": [0.6955, 0.6419, 0.7823, 0.6616]}, {"w": "applications—which", "b": [0.1294, 0.6624, 0.3382, 0.6821]}, {"w": "will", "b": [0.3445, 0.6624, 0.3838, 0.6821]}, {"w": "start", "b": [0.3901, 0.6624, 0.4335, 0.6821]}, {"w": "with", "b": [0.4398, 0.6624, 0.4847, 0.6821]}, {"w": "chapter", "b": [0.4909, 0.6624, 0.5651, 0.6821]}, {"w": "3.", "b": [0.5715, 0.6624, 0.5904, 0.6821]}]}, {"id": "b_6", "type": "paragraph", "text": "2.1. A first look at a neural network", "words": [{"w": "2.1.", "b": [0.1294, 0.7192, 0.172, 0.7414]}, {"w": "A", "b": [0.1791, 0.7192, 0.1996, 0.7414]}, {"w": "first", "b": [0.2067, 0.7192, 0.2571, 0.7414]}, {"w": "look", "b": [0.2642, 0.7192, 0.3162, 0.7414]}, {"w": "at", "b": [0.3233, 0.7192, 0.347, 0.7414]}, {"w": "a", "b": [0.3541, 0.7192, 0.3682, 0.7414]}, {"w": "neural", "b": [0.3753, 0.7192, 0.4542, 0.7414]}, {"w": "network", "b": [0.4613, 0.7192, 0.5622, 0.7414]}]}, {"id": "b_7", "type": "paragraph", "text": "Let’s look at a concrete example of a neural network that uses the Python library Keras to learn to classify handwritten digits. Unless you already have experience with Keras or similar libraries, you won’t understand everything about this first example right away. You probably haven’t even installed Keras yet; that’s fine. In the next chapter, we’ll review each element in the example and explain them in detail. So don’t worry", "words": [{"w": "Let’s", "b": [0.1294, 0.7649, 0.1798, 0.7846]}, {"w": "look", "b": [0.1862, 0.7649, 0.231, 0.7846]}, {"w": "at", "b": [0.2373, 0.7649, 0.2555, 0.7846]}, {"w": "a", "b": [0.2618, 0.7649, 0.273, 0.7846]}, {"w": "concrete", "b": [0.2793, 0.7649, 0.3648, 0.7846]}, {"w": "example", "b": [0.3711, 0.7649, 0.4565, 0.7846]}, {"w": "of", "b": [0.4629, 0.7649, 0.4839, 0.7846]}, {"w": "a", "b": [0.4902, 0.7649, 0.5014, 0.7846]}, {"w": "neural", "b": [0.5077, 0.7649, 0.5707, 0.7846]}, {"w": "network", "b": [0.577, 0.7649, 0.6597, 0.7846]}, {"w": "that", "b": [0.666, 0.7649, 0.7038, 0.7846]}, {"w": "uses", "b": [0.7101, 0.7649, 0.7536, 0.7846]}, {"w": "the", "b": [0.7599, 0.7649, 0.7907, 0.7846]}, {"w": "Python", "b": [0.797, 0.7649, 0.8685, 0.7846]}, {"w": "library", "b": [0.1294, 0.7854, 0.1967, 0.8051]}, {"w": "Keras", "b": [0.203, 0.7854, 0.2618, 0.8051]}, {"w": "to", "b": [0.2681, 0.7854, 0.2877, 0.8051]}, {"w": "learn", "b": [0.294, 0.7854, 0.3445, 0.8051]}, {"w": "to", "b": [0.3508, 0.7854, 0.3704, 0.8051]}, {"w": "classify", "b": [0.3767, 0.7854, 0.4538, 0.8051]}, {"w": "handwritten", "b": [0.4601, 0.7854, 0.5806, 0.8051]}, {"w": "digits.", "b": [0.5869, 0.7854, 0.6493, 0.8051]}, {"w": "Unless", "b": [0.6555, 0.7854, 0.7242, 0.8051]}, {"w": "you", "b": [0.7305, 0.7854, 0.7683, 0.8051]}, {"w": "already", "b": [0.7746, 0.7854, 0.8489, 0.8051]}, {"w": "have", "b": [0.1294, 0.8059, 0.177, 0.8256]}, {"w": "experience", "b": [0.1833, 0.8059, 0.2926, 0.8256]}, {"w": "with", "b": [0.2989, 0.8059, 0.3438, 0.8256]}, {"w": "Keras", "b": [0.3501, 0.8059, 0.4089, 0.8256]}, {"w": "or", "b": [0.4152, 0.8059, 0.4362, 0.8256]}, {"w": "similar", "b": [0.4425, 0.8059, 0.5126, 0.8256]}, {"w": "libraries,", "b": [0.5189, 0.8059, 0.6079, 0.8256]}, {"w": "you", "b": [0.6142, 0.8059, 0.652, 0.8256]}, {"w": "won’t", "b": [0.6583, 0.8059, 0.7167, 0.8256]}, {"w": "understand", "b": [0.723, 0.8059, 0.8337, 0.8256]}, {"w": "everything", "b": [0.1294, 0.8264, 0.2373, 0.8461]}, {"w": "about", "b": [0.2436, 0.8264, 0.2997, 0.8461]}, {"w": "this", "b": [0.306, 0.8264, 0.3424, 0.8461]}, {"w": "first", "b": [0.3487, 0.8264, 0.3894, 0.8461]}, {"w": "example", "b": [0.3957, 0.8264, 0.4811, 0.8461]}, {"w": "right", "b": [0.4874, 0.8264, 0.535, 0.8461]}, {"w": "away.", "b": [0.5413, 0.8264, 0.5992, 0.8461]}, {"w": "You", "b": [0.6055, 0.8264, 0.6464, 0.8461]}, {"w": "probably", "b": [0.6528, 0.8264, 0.7424, 0.8461]}, {"w": "haven’t", "b": [0.7487, 0.8264, 0.8239, 0.8461]}, {"w": "even", "b": [0.1294, 0.8469, 0.177, 0.8666]}, {"w": "installed", "b": [0.1833, 0.8469, 0.2688, 0.8666]}, {"w": "Keras", "b": [0.2751, 0.8469, 0.334, 0.8666]}, {"w": "yet;", "b": [0.3403, 0.8469, 0.3781, 0.8666]}, {"w": "that’s", "b": [0.3844, 0.8469, 0.439, 0.8666]}, {"w": "fine.", "b": [0.4453, 0.8469, 0.4909, 0.8666]}, {"w": "In", "b": [0.4972, 0.8469, 0.5182, 0.8666]}, {"w": "the", "b": [0.5245, 0.8469, 0.5553, 0.8666]}, {"w": "next", "b": [0.5616, 0.8469, 0.6051, 0.8666]}, {"w": "chapter,", "b": [0.6114, 0.8469, 0.6909, 0.8666]}, {"w": "we’ll", "b": [0.6972, 0.8469, 0.749, 0.8666]}, {"w": "review", "b": [0.7553, 0.8469, 0.824, 0.8666]}, {"w": "each", "b": [0.1294, 0.8674, 0.1756, 0.8871]}, {"w": "element", "b": [0.1819, 0.8674, 0.2618, 0.8871]}, {"w": "in", "b": [0.2681, 0.8674, 0.2877, 0.8871]}, {"w": "the", "b": [0.294, 0.8674, 0.3248, 0.8871]}, {"w": "example", "b": [0.3311, 0.8674, 0.4166, 0.8871]}, {"w": "and", "b": [0.4229, 0.8674, 0.4593, 0.8871]}, {"w": "explain", "b": [0.4656, 0.8674, 0.5399, 0.8871]}, {"w": "them", "b": [0.5462, 0.8674, 0.5966, 0.8871]}, {"w": "in", "b": [0.603, 0.8674, 0.6226, 0.8871]}, {"w": "detail.", "b": [0.6289, 0.8674, 0.6912, 0.8871]}, {"w": "So", "b": [0.6976, 0.8674, 0.7242, 0.8871]}, {"w": "don’t", "b": [0.7305, 0.8674, 0.7832, 0.8871]}, {"w": "worry", "b": [0.7895, 0.8674, 0.8498, 0.8871]}]}]}, {"page": 59, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "if some steps seem arbitrary or look like magic to you! We’ve got to start somewhere.", "words": [{"w": "if", "b": [0.1294, 0.0857, 0.1448, 0.1054]}, {"w": "some", "b": [0.1511, 0.0857, 0.2044, 0.1054]}, {"w": "steps", "b": [0.2107, 0.0857, 0.2611, 0.1054]}, {"w": "seem", "b": [0.2674, 0.0857, 0.3193, 0.1054]}, {"w": "arbitrary", "b": [0.3256, 0.0857, 0.4124, 0.1054]}, {"w": "or", "b": [0.4188, 0.0857, 0.4398, 0.1054]}, {"w": "look", "b": [0.4461, 0.0857, 0.4909, 0.1054]}, {"w": "like", "b": [0.4972, 0.0857, 0.5351, 0.1054]}, {"w": "magic", "b": [0.5414, 0.0857, 0.603, 0.1054]}, {"w": "to", "b": [0.6093, 0.0857, 0.629, 0.1054]}, {"w": "you!", "b": [0.6353, 0.0857, 0.6815, 0.1054]}, {"w": "We’ve", "b": [0.6878, 0.0857, 0.7529, 0.1054]}, {"w": "got", "b": [0.7593, 0.0857, 0.7915, 0.1054]}, {"w": "to", "b": [0.7978, 0.0857, 0.8174, 0.1054]}, {"w": "start", "b": [0.8237, 0.0857, 0.8672, 0.1054]}, {"w": "somewhere.", "b": [0.1294, 0.1062, 0.2506, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "The problem we’re trying to solve here is to classify grayscale images of handwritten digits (28 × 28 pixels) into their 10 categories (0 through 9). We’ll use the MNIST dataset, a classic in the machine-learning community, which has been around almost as long as the field itself and has been intensively studied. It’s a set of 60,000 training images, plus 10,000 test images, assembled by the National Institute of Standards and Technology (the NIST in MNIST) in the 1980s. You can think of “solving” MNIST as the “Hello World” of deep learning—it’s what you do to verify that your algorithms are working as expected. As you become a machine-learning practitioner, you’ll see MNIST come up over and over again, in scientific papers, blog posts, and so on. You can see some MNIST samples in figure 2.1.", "words": [{"w": "The", "b": [0.1294, 0.149, 0.1686, 0.1687]}, {"w": "problem", "b": [0.1749, 0.149, 0.259, 0.1687]}, {"w": "we’re", "b": [0.2653, 0.149, 0.3227, 0.1687]}, {"w": "trying", "b": [0.329, 0.149, 0.3893, 0.1687]}, {"w": "to", "b": [0.3956, 0.149, 0.4152, 0.1687]}, {"w": "solve", "b": [0.4216, 0.149, 0.4748, 0.1687]}, {"w": "here", "b": [0.4811, 0.149, 0.5245, 0.1687]}, {"w": "is", "b": [0.5308, 0.149, 0.5477, 0.1687]}, {"w": "to", "b": [0.554, 0.149, 0.5736, 0.1687]}, {"w": "classify", "b": [0.5799, 0.149, 0.657, 0.1687]}, {"w": "grayscale", "b": [0.6633, 0.149, 0.7585, 0.1687]}, {"w": "images", "b": [0.7648, 0.149, 0.8363, 0.1687]}, {"w": "of", "b": [0.8426, 0.149, 0.8636, 0.1687]}, {"w": "handwritten", "b": [0.1294, 0.1695, 0.2499, 0.1892]}, {"w": "digits", "b": [0.2562, 0.1695, 0.3123, 0.1892]}, {"w": "(28", "b": [0.3186, 0.1695, 0.3522, 0.1892]}, {"w": "×", "b": [0.3585, 0.1695, 0.3728, 0.1892]}, {"w": "28", "b": [0.3791, 0.1695, 0.4043, 0.1892]}, {"w": "pixels)", "b": [0.4106, 0.1695, 0.4793, 0.1892]}, {"w": "into", "b": [0.4856, 0.1695, 0.5248, 0.1892]}, {"w": "their", "b": [0.5311, 0.1695, 0.5774, 0.1892]}, {"w": "10", "b": [0.5837, 0.1695, 0.6089, 0.1892]}, {"w": "categories", "b": [0.6151, 0.1695, 0.7174, 0.1892]}, {"w": "(0", "b": [0.7237, 0.1695, 0.7447, 0.1892]}, {"w": "through", "b": [0.751, 0.1695, 0.8295, 0.1892]}, {"w": "9).", "b": [0.8358, 0.1695, 0.8631, 0.1892]}, {"w": "We’ll", "b": [0.1294, 0.19, 0.1848, 0.2097]}, {"w": "use", "b": [0.1911, 0.19, 0.2248, 0.2097]}, {"w": "the", "b": [0.2311, 0.19, 0.2619, 0.2097]}, {"w": "MNIST", "b": [0.2682, 0.19, 0.3467, 0.2097]}, {"w": "dataset,", "b": [0.353, 0.19, 0.4293, 0.2097]}, {"w": "a", "b": [0.4356, 0.19, 0.4468, 0.2097]}, {"w": "classic", "b": [0.4532, 0.19, 0.5204, 0.2097]}, {"w": "in", "b": [0.5267, 0.19, 0.5463, 0.2097]}, {"w": "the", "b": [0.5526, 0.19, 0.5835, 0.2097]}, {"w": "machine-learning", "b": [0.5898, 0.19, 0.7663, 0.2097]}, {"w": "community,", "b": [0.1294, 0.2105, 0.249, 0.2302]}, {"w": "which", "b": [0.2553, 0.2105, 0.3169, 0.2302]}, {"w": "has", "b": [0.3233, 0.2105, 0.3569, 0.2302]}, {"w": "been", "b": [0.3632, 0.2105, 0.4108, 0.2302]}, {"w": "around", "b": [0.4171, 0.2105, 0.4872, 0.2302]}, {"w": "almost", "b": [0.4935, 0.2105, 0.5607, 0.2302]}, {"w": "as", "b": [0.567, 0.2105, 0.588, 0.2302]}, {"w": "long", "b": [0.5944, 0.2105, 0.6392, 0.2302]}, {"w": "as", "b": [0.6455, 0.2105, 0.6665, 0.2302]}, {"w": "the", "b": [0.6728, 0.2105, 0.7037, 0.2302]}, {"w": "field", "b": [0.71, 0.2105, 0.7562, 0.2302]}, {"w": "itself", "b": [0.7625, 0.2105, 0.813, 0.2302]}, {"w": "and", "b": [0.8193, 0.2105, 0.8557, 0.2302]}, {"w": "has", "b": [0.1294, 0.231, 0.163, 0.2507]}, {"w": "been", "b": [0.1693, 0.231, 0.217, 0.2507]}, {"w": "intensively", "b": [0.2233, 0.231, 0.334, 0.2507]}, {"w": "studied.", "b": [0.3403, 0.231, 0.4195, 0.2507]}, {"w": "It’s", "b": [0.4258, 0.231, 0.458, 0.2507]}, {"w": "a", "b": [0.4643, 0.231, 0.4755, 0.2507]}, {"w": "set", "b": [0.4818, 0.231, 0.5098, 0.2507]}, {"w": "of", "b": [0.5161, 0.231, 0.5371, 0.2507]}, {"w": "60,000", "b": [0.5434, 0.231, 0.6128, 0.2507]}, {"w": "training", "b": [0.6191, 0.231, 0.6976, 0.2507]}, {"w": "images,", "b": [0.7039, 0.231, 0.7817, 0.2507]}, {"w": "plus", "b": [0.788, 0.231, 0.83, 0.2507]}, {"w": "10,000", "b": [0.1294, 0.2515, 0.1988, 0.2712]}, {"w": "test", "b": [0.2051, 0.2515, 0.2401, 0.2712]}, {"w": "images,", "b": [0.2464, 0.2515, 0.3242, 0.2712]}, {"w": "assembled", "b": [0.3305, 0.2515, 0.4356, 0.2712]}, {"w": "by", "b": [0.4419, 0.2515, 0.4671, 0.2712]}, {"w": "the", "b": [0.4734, 0.2515, 0.5042, 0.2712]}, {"w": "National", "b": [0.5106, 0.2515, 0.5974, 0.2712]}, {"w": "Institute", "b": [0.6037, 0.2515, 0.6864, 0.2712]}, {"w": "of", "b": [0.6927, 0.2515, 0.7137, 0.2712]}, {"w": "Standards", "b": [0.7201, 0.2515, 0.8195, 0.2712]}, {"w": "and", "b": [0.8259, 0.2515, 0.8623, 0.2712]}, {"w": "Technology", "b": [0.1294, 0.272, 0.2482, 0.2917]}, {"w": "(the", "b": [0.2545, 0.272, 0.2937, 0.2917]}, {"w": "NIST", "b": [0.3, 0.272, 0.356, 0.2917]}, {"w": "in", "b": [0.3623, 0.272, 0.382, 0.2917]}, {"w": "MNIST)", "b": [0.3883, 0.272, 0.4752, 0.2917]}, {"w": "in", "b": [0.4815, 0.272, 0.5011, 0.2917]}, {"w": "the", "b": [0.5074, 0.272, 0.5382, 0.2917]}, {"w": "1980s.", "b": [0.5445, 0.272, 0.6111, 0.2917]}, {"w": "You", "b": [0.6174, 0.272, 0.6583, 0.2917]}, {"w": "can", "b": [0.6646, 0.272, 0.6996, 0.2917]}, {"w": "think", "b": [0.7059, 0.272, 0.7578, 0.2917]}, {"w": "of", "b": [0.7641, 0.272, 0.7851, 0.2917]}, {"w": "“solving”", "b": [0.1294, 0.2925, 0.2261, 0.3122]}, {"w": "MNIST", "b": [0.2324, 0.2925, 0.3109, 0.3122]}, {"w": "as", "b": [0.3172, 0.2925, 0.3382, 0.3122]}, {"w": "the", "b": [0.3445, 0.2925, 0.3753, 0.3122]}, {"w": "“Hello", "b": [0.3816, 0.2925, 0.4489, 0.3122]}, {"w": "World”", "b": [0.4552, 0.2925, 0.5288, 0.3122]}, {"w": "of", "b": [0.5351, 0.2925, 0.5561, 0.3122]}, {"w": "deep", "b": [0.5624, 0.2925, 0.6101, 0.3122]}, {"w": "learning—it’s", "b": [0.6164, 0.2925, 0.7551, 0.3122]}, {"w": "what", "b": [0.7614, 0.2925, 0.8104, 0.3122]}, {"w": "you", "b": [0.8167, 0.2925, 0.8546, 0.3122]}, {"w": "do", "b": [0.1294, 0.313, 0.1546, 0.3327]}, {"w": "to", "b": [0.1609, 0.313, 0.1806, 0.3327]}, {"w": "verify", "b": [0.1869, 0.313, 0.2471, 0.3327]}, {"w": "that", "b": [0.2534, 0.313, 0.2913, 0.3327]}, {"w": "your", "b": [0.2976, 0.313, 0.3438, 0.3327]}, {"w": "algorithms", "b": [0.3501, 0.313, 0.458, 0.3327]}, {"w": "are", "b": [0.4643, 0.313, 0.4951, 0.3327]}, {"w": "working", "b": [0.5014, 0.313, 0.5855, 0.3327]}, {"w": "as", "b": [0.5918, 0.313, 0.6128, 0.3327]}, {"w": "expected.", "b": [0.6191, 0.313, 0.7151, 0.3327]}, {"w": "As", "b": [0.7213, 0.313, 0.7494, 0.3327]}, {"w": "you", "b": [0.7557, 0.313, 0.7935, 0.3327]}, {"w": "become", "b": [0.1294, 0.3335, 0.2079, 0.3532]}, {"w": "a", "b": [0.2142, 0.3335, 0.2254, 0.3532]}, {"w": "machine-learning", "b": [0.2317, 0.3335, 0.4082, 0.3532]}, {"w": "practitioner,", "b": [0.4145, 0.3335, 0.536, 0.3532]}, {"w": "you’ll", "b": [0.5423, 0.3335, 0.6026, 0.3532]}, {"w": "see", "b": [0.6089, 0.3335, 0.6411, 0.3532]}, {"w": "MNIST", "b": [0.6474, 0.3335, 0.7259, 0.3532]}, {"w": "come", "b": [0.7322, 0.3335, 0.7868, 0.3532]}, {"w": "up", "b": [0.7931, 0.3335, 0.8184, 0.3532]}, {"w": "over", "b": [0.8247, 0.3335, 0.8695, 0.3532]}, {"w": "and", "b": [0.1294, 0.354, 0.1658, 0.3737]}, {"w": "over", "b": [0.1721, 0.354, 0.217, 0.3737]}, {"w": "again,", "b": [0.2233, 0.354, 0.2842, 0.3737]}, {"w": "in", "b": [0.2905, 0.354, 0.3102, 0.3737]}, {"w": "scientific", "b": [0.3165, 0.354, 0.4089, 0.3737]}, {"w": "papers,", "b": [0.4152, 0.354, 0.4874, 0.3737]}, {"w": "blog", "b": [0.4937, 0.354, 0.5385, 0.3737]}, {"w": "posts,", "b": [0.5449, 0.354, 0.603, 0.3737]}, {"w": "and", "b": [0.6093, 0.354, 0.6457, 0.3737]}, {"w": "so", "b": [0.652, 0.354, 0.6744, 0.3737]}, {"w": "on.", "b": [0.6807, 0.354, 0.7123, 0.3737]}, {"w": "You", "b": [0.7186, 0.354, 0.7595, 0.3737]}, {"w": "can", "b": [0.7658, 0.354, 0.8008, 0.3737]}, {"w": "see", "b": [0.8071, 0.354, 0.8393, 0.3737]}, {"w": "some", "b": [0.1294, 0.3745, 0.1827, 0.3942]}, {"w": "MNIST", "b": [0.189, 0.3745, 0.2674, 0.3942]}, {"w": "samples", "b": [0.2738, 0.3745, 0.355, 0.3942]}, {"w": "in", "b": [0.3613, 0.3745, 0.381, 0.3942]}, {"w": "figure", "b": [0.3872, 0.3745, 0.4475, 0.3942]}, {"w": "2.1.", "b": [0.4538, 0.3745, 0.4916, 0.3942]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 2.1. MNIST sample digits", "words": [{"w": "Figure", "b": [0.1294, 0.4123, 0.1827, 0.4271]}, {"w": "2.1.", "b": [0.1874, 0.4123, 0.2158, 0.4271]}, {"w": "MNIST", "b": [0.2205, 0.4123, 0.2825, 0.4271]}, {"w": "sample", "b": [0.2872, 0.4123, 0.344, 0.4271]}, {"w": "digits", "b": [0.3487, 0.4123, 0.3929, 0.4271]}]}, {"id": "b_3", "type": "paragraph", "text": "Note on classes and labels", "words": [{"w": "Note", "b": [0.1294, 0.5251, 0.1798, 0.5448]}, {"w": "on", "b": [0.1861, 0.5251, 0.2128, 0.5448]}, {"w": "classes", "b": [0.2191, 0.5251, 0.2906, 0.5448]}, {"w": "and", "b": [0.2969, 0.5251, 0.3375, 0.5448]}, {"w": "labels", "b": [0.3438, 0.5251, 0.4055, 0.5448]}]}, {"id": "b_4", "type": "paragraph", "text": "In machine learning, a category in a classification problem is called a class. Data points are called samples. The class associated with a specific sample is called a label.", "words": [{"w": "In", "b": [0.1294, 0.5679, 0.1504, 0.5876]}, {"w": "machine", "b": [0.1567, 0.5679, 0.2422, 0.5876]}, {"w": "learning,", "b": [0.2485, 0.5679, 0.3375, 0.5876]}, {"w": "a", "b": [0.3438, 0.5679, 0.355, 0.5876]}, {"w": "category", "b": [0.3612, 0.5679, 0.4495, 0.5876]}, {"w": "in", "b": [0.4558, 0.5679, 0.4754, 0.5876]}, {"w": "a", "b": [0.4817, 0.5679, 0.4929, 0.5876]}, {"w": "classification", "b": [0.4992, 0.5679, 0.6323, 0.5876]}, {"w": "problem", "b": [0.6387, 0.5679, 0.7227, 0.5876]}, {"w": "is", "b": [0.729, 0.5679, 0.7459, 0.5876]}, {"w": "called", "b": [0.7522, 0.5679, 0.8124, 0.5876]}, {"w": "a", "b": [0.8187, 0.5679, 0.8299, 0.5876]}, {"w": "class.", "b": [0.1294, 0.5884, 0.1862, 0.6081]}, {"w": "Data", "b": [0.1925, 0.5884, 0.2401, 0.6081]}, {"w": "points", "b": [0.2464, 0.5884, 0.3081, 0.6081]}, {"w": "are", "b": [0.3144, 0.5884, 0.3452, 0.6081]}, {"w": "called", "b": [0.3515, 0.5884, 0.4117, 0.6081]}, {"w": "samples.", "b": [0.418, 0.5884, 0.5056, 0.6081]}, {"w": "The", "b": [0.5119, 0.5884, 0.5511, 0.6081]}, {"w": "class", "b": [0.5574, 0.5884, 0.6064, 0.6081]}, {"w": "associated", "b": [0.6128, 0.5884, 0.7164, 0.6081]}, {"w": "with", "b": [0.7227, 0.5884, 0.7676, 0.6081]}, {"w": "a", "b": [0.7739, 0.5884, 0.7851, 0.6081]}, {"w": "specific", "b": [0.7914, 0.5884, 0.8699, 0.6081]}, {"w": "sample", "b": [0.1294, 0.6089, 0.2009, 0.6286]}, {"w": "is", "b": [0.2072, 0.6089, 0.224, 0.6286]}, {"w": "called", "b": [0.2303, 0.6089, 0.2906, 0.6286]}, {"w": "a", "b": [0.2969, 0.6089, 0.3081, 0.6286]}, {"w": "label.", "b": [0.3143, 0.6089, 0.3711, 0.6286]}]}, {"id": "b_5", "type": "paragraph", "text": "You don’t need to try to reproduce this example on your machine just now. If you wish to, you’ll first need to set up Keras, which is covered in section 3.3.", "words": [{"w": "You", "b": [0.1294, 0.6784, 0.1703, 0.6981]}, {"w": "don’t", "b": [0.1766, 0.6784, 0.2294, 0.6981]}, {"w": "need", "b": [0.2357, 0.6784, 0.2834, 0.6981]}, {"w": "to", "b": [0.2897, 0.6784, 0.3093, 0.6981]}, {"w": "try", "b": [0.3156, 0.6784, 0.3436, 0.6981]}, {"w": "to", "b": [0.3499, 0.6784, 0.3696, 0.6981]}, {"w": "reproduce", "b": [0.3759, 0.6784, 0.4767, 0.6981]}, {"w": "this", "b": [0.483, 0.6784, 0.5195, 0.6981]}, {"w": "example", "b": [0.5258, 0.6784, 0.6112, 0.6981]}, {"w": "on", "b": [0.6176, 0.6784, 0.6428, 0.6981]}, {"w": "your", "b": [0.6491, 0.6784, 0.6953, 0.6981]}, {"w": "machine", "b": [0.7016, 0.6784, 0.7871, 0.6981]}, {"w": "just", "b": [0.7934, 0.6784, 0.8299, 0.6981]}, {"w": "now.", "b": [0.1294, 0.6989, 0.1775, 0.7186]}, {"w": "If", "b": [0.1838, 0.6989, 0.2006, 0.7186]}, {"w": "you", "b": [0.2069, 0.6989, 0.2448, 0.7186]}, {"w": "wish", "b": [0.2511, 0.6989, 0.2987, 0.7186]}, {"w": "to,", "b": [0.305, 0.6989, 0.331, 0.7186]}, {"w": "you’ll", "b": [0.3373, 0.6989, 0.3975, 0.7186]}, {"w": "first", "b": [0.4038, 0.6989, 0.4445, 0.7186]}, {"w": "need", "b": [0.4508, 0.6989, 0.4984, 0.7186]}, {"w": "to", "b": [0.5047, 0.6989, 0.5244, 0.7186]}, {"w": "set", "b": [0.5307, 0.6989, 0.5587, 0.7186]}, {"w": "up", "b": [0.565, 0.6989, 0.5902, 0.7186]}, {"w": "Keras,", "b": [0.5965, 0.6989, 0.6617, 0.7186]}, {"w": "which", "b": [0.6679, 0.6989, 0.7296, 0.7186]}, {"w": "is", "b": [0.7359, 0.6989, 0.7527, 0.7186]}, {"w": "covered", "b": [0.759, 0.6989, 0.8389, 0.7186]}, {"w": "in", "b": [0.8452, 0.6989, 0.8648, 0.7186]}, {"w": "section", "b": [0.1294, 0.7194, 0.2009, 0.7391]}, {"w": "3.3.", "b": [0.2072, 0.7194, 0.245, 0.7391]}]}, {"id": "b_6", "type": "paragraph", "text": "The MNIST dataset comes preloaded in Keras, in the form of a set of four Numpy arrays.", "words": [{"w": "The", "b": [0.1294, 0.7622, 0.1686, 0.7819]}, {"w": "MNIST", "b": [0.1749, 0.7622, 0.2534, 0.7819]}, {"w": "dataset", "b": [0.2597, 0.7622, 0.3298, 0.7819]}, {"w": "comes", "b": [0.3361, 0.7622, 0.4005, 0.7819]}, {"w": "preloaded", "b": [0.4068, 0.7622, 0.5063, 0.7819]}, {"w": "in", "b": [0.5126, 0.7622, 0.5322, 0.7819]}, {"w": "Keras,", "b": [0.5385, 0.7622, 0.6037, 0.7819]}, {"w": "in", "b": [0.61, 0.7622, 0.6296, 0.7819]}, {"w": "the", "b": [0.6359, 0.7622, 0.6667, 0.7819]}, {"w": "form", "b": [0.6731, 0.7622, 0.7221, 0.7819]}, {"w": "of", "b": [0.7284, 0.7622, 0.7494, 0.7819]}, {"w": "a", "b": [0.7557, 0.7622, 0.7669, 0.7819]}, {"w": "set", "b": [0.7732, 0.7622, 0.8012, 0.7819]}, {"w": "of", "b": [0.8076, 0.7622, 0.8286, 0.7819]}, {"w": "four", "b": [0.1294, 0.7827, 0.1714, 0.8024]}, {"w": "Numpy", "b": [0.1777, 0.7827, 0.2534, 0.8024]}, {"w": "arrays.", "b": [0.2597, 0.7827, 0.3277, 0.8024]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 2.1. Loading the MNIST dataset in Keras", "words": [{"w": "Listing", "b": [0.1294, 0.8205, 0.1862, 0.8353]}, {"w": "2.1.", "b": [0.1909, 0.8205, 0.2193, 0.8353]}, {"w": "Loading", "b": [0.224, 0.8205, 0.2913, 0.8353]}, {"w": "the", "b": [0.296, 0.8205, 0.3213, 0.8353]}, {"w": "MNIST", "b": [0.326, 0.8205, 0.388, 0.8353]}, {"w": "dataset", "b": [0.3927, 0.8205, 0.4505, 0.8353]}, {"w": "in", "b": [0.4553, 0.8205, 0.471, 0.8353]}, {"w": "Keras", "b": [0.4758, 0.8205, 0.5241, 0.8353]}]}, {"id": "b_8", "type": "paragraph", "text": "from keras.datasets import mnist (train_images, train_labels), (test_images, test_labels) = mnist.load_data()", "words": [{"w": "from", "b": [0.1357, 0.8489, 0.1811, 0.8641]}, {"w": "keras.datasets", "b": [0.1925, 0.8489, 0.3514, 0.8641]}, {"w": "import", "b": [0.3628, 0.8489, 0.4309, 0.8641]}, {"w": "mnist", "b": [0.4422, 0.8489, 0.499, 0.8641]}, {"w": "(train_images,", "b": [0.1357, 0.8641, 0.2946, 0.8792]}, {"w": "train_labels),", "b": [0.306, 0.8641, 0.4649, 0.8792]}, {"w": "(test_images,", "b": [0.4763, 0.8641, 0.6238, 0.8792]}, {"w": "test_labels)", "b": [0.6352, 0.8641, 0.7714, 0.8792]}, {"w": "=", "b": [0.7828, 0.8641, 0.7941, 0.8792]}, {"w": "mnist.load_data()", "b": [0.1357, 0.8792, 0.3287, 0.8944]}]}]}, {"page": 60, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "train_images and train_labels form the training set, the data that the model will learn from. The model will then be tested on the test set, test_images and test_labels. The images are encoded as Numpy arrays, and the labels are an array of digits, ranging from 0 to 9. The images and labels have a one-to-one correspondence.", "words": [{"w": "train_images", "b": [0.1294, 0.0867, 0.311, 0.1069]}, {"w": "and", "b": [0.3174, 0.0857, 0.3538, 0.1054]}, {"w": "train_labels", "b": [0.3601, 0.0867, 0.5417, 0.1069]}, {"w": "form", "b": [0.548, 0.0857, 0.5971, 0.1054]}, {"w": "the", "b": [0.6034, 0.0857, 0.6342, 0.1054]}, {"w": "training", "b": [0.6405, 0.0857, 0.7218, 0.1054]}, {"w": "set,", "b": [0.7281, 0.0857, 0.7624, 0.1054]}, {"w": "the", "b": [0.7687, 0.0857, 0.7995, 0.1054]}, {"w": "data", "b": [0.8058, 0.0857, 0.8479, 0.1054]}, {"w": "that", "b": [0.1294, 0.1071, 0.1673, 0.1268]}, {"w": "the", "b": [0.1736, 0.1071, 0.2044, 0.1268]}, {"w": "model", "b": [0.2107, 0.1071, 0.2738, 0.1268]}, {"w": "will", "b": [0.2801, 0.1071, 0.3193, 0.1268]}, {"w": "learn", "b": [0.3256, 0.1071, 0.376, 0.1268]}, {"w": "from.", "b": [0.3824, 0.1071, 0.4377, 0.1268]}, {"w": "The", "b": [0.444, 0.1071, 0.4832, 0.1268]}, {"w": "model", "b": [0.4895, 0.1071, 0.5526, 0.1268]}, {"w": "will", "b": [0.5589, 0.1071, 0.5982, 0.1268]}, {"w": "then", "b": [0.6045, 0.1071, 0.6479, 0.1268]}, {"w": "be", "b": [0.6542, 0.1071, 0.678, 0.1268]}, {"w": "tested", "b": [0.6843, 0.1071, 0.7432, 0.1268]}, {"w": "on", "b": [0.7495, 0.1071, 0.7747, 0.1268]}, {"w": "the", "b": [0.781, 0.1071, 0.8118, 0.1268]}, {"w": "test", "b": [0.818, 0.1071, 0.8531, 0.1268]}, {"w": "set,", "b": [0.1294, 0.1276, 0.1637, 0.1473]}, {"w": "test_images", "b": [0.17, 0.1286, 0.3365, 0.1488]}, {"w": "and", "b": [0.3428, 0.1276, 0.3793, 0.1473]}, {"w": "test_labels.", "b": [0.3856, 0.1276, 0.5584, 0.1488]}, {"w": "The", "b": [0.5647, 0.1276, 0.6039, 0.1473]}, {"w": "images", "b": [0.6102, 0.1276, 0.6817, 0.1473]}, {"w": "are", "b": [0.688, 0.1276, 0.7188, 0.1473]}, {"w": "encoded", "b": [0.7251, 0.1276, 0.8092, 0.1473]}, {"w": "as", "b": [0.8155, 0.1276, 0.8365, 0.1473]}, {"w": "Numpy", "b": [0.1294, 0.149, 0.2051, 0.1687]}, {"w": "arrays,", "b": [0.2114, 0.149, 0.2793, 0.1687]}, {"w": "and", "b": [0.2856, 0.149, 0.3221, 0.1687]}, {"w": "the", "b": [0.3284, 0.149, 0.3592, 0.1687]}, {"w": "labels", "b": [0.3655, 0.149, 0.4244, 0.1687]}, {"w": "are", "b": [0.4307, 0.149, 0.4615, 0.1687]}, {"w": "an", "b": [0.4678, 0.149, 0.4916, 0.1687]}, {"w": "array", "b": [0.4979, 0.149, 0.5497, 0.1687]}, {"w": "of", "b": [0.556, 0.149, 0.577, 0.1687]}, {"w": "digits,", "b": [0.5833, 0.149, 0.6457, 0.1687]}, {"w": "ranging", "b": [0.652, 0.149, 0.7291, 0.1687]}, {"w": "from", "b": [0.7354, 0.149, 0.7844, 0.1687]}, {"w": "0", "b": [0.7907, 0.149, 0.8033, 0.1687]}, {"w": "to", "b": [0.8096, 0.149, 0.8293, 0.1687]}, {"w": "9.", "b": [0.8356, 0.149, 0.8545, 0.1687]}, {"w": "The", "b": [0.1294, 0.1695, 0.1686, 0.1892]}, {"w": "images", "b": [0.1749, 0.1695, 0.2464, 0.1892]}, {"w": "and", "b": [0.2527, 0.1695, 0.2891, 0.1892]}, {"w": "labels", "b": [0.2954, 0.1695, 0.3543, 0.1892]}, {"w": "have", "b": [0.3606, 0.1695, 0.4082, 0.1892]}, {"w": "a", "b": [0.4145, 0.1695, 0.4257, 0.1892]}, {"w": "one-to-one", "b": [0.432, 0.1695, 0.5413, 0.1892]}, {"w": "correspondence.", "b": [0.5476, 0.1695, 0.7122, 0.1892]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s look at the training data:", "words": [{"w": "Let’s", "b": [0.1294, 0.2122, 0.1798, 0.232]}, {"w": "look", "b": [0.1862, 0.2122, 0.231, 0.232]}, {"w": "at", "b": [0.2373, 0.2122, 0.2555, 0.232]}, {"w": "the", "b": [0.2618, 0.2122, 0.2927, 0.232]}, {"w": "training", "b": [0.299, 0.2122, 0.3774, 0.232]}, {"w": "data:", "b": [0.3837, 0.2122, 0.4328, 0.232]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> train_images.shape (60000, 28, 28) >>> len(train_labels) 60000 >>> train_labels array([5, 0, 4, ..., 5, 6, 8], dtype=uint8)", "words": [{"w": ">>>", "b": [0.1357, 0.25, 0.1698, 0.2651]}, {"w": "train_images.shape", "b": [0.1811, 0.25, 0.3855, 0.2651]}, {"w": "(60000,", "b": [0.1357, 0.2651, 0.2152, 0.2803]}, {"w": "28,", "b": [0.2265, 0.2651, 0.2606, 0.2803]}, {"w": "28)", "b": [0.2719, 0.2651, 0.306, 0.2803]}, {"w": ">>>", "b": [0.1357, 0.2803, 0.1698, 0.2954]}, {"w": "len(train_labels)", "b": [0.1811, 0.2803, 0.3741, 0.2954]}, {"w": "60000", "b": [0.1357, 0.2954, 0.1925, 0.3106]}, {"w": ">>>", "b": [0.1357, 0.3106, 0.1698, 0.3257]}, {"w": "train_labels", "b": [0.1811, 0.3106, 0.3173, 0.3257]}, {"w": "array([5,", "b": [0.1357, 0.3257, 0.2379, 0.3409]}, {"w": "0,", "b": [0.2492, 0.3257, 0.2719, 0.3409]}, {"w": "4,", "b": [0.2833, 0.3257, 0.306, 0.3409]}, {"w": "...,", "b": [0.3173, 0.3257, 0.3628, 0.3409]}, {"w": "5,", "b": [0.3741, 0.3257, 0.3968, 0.3409]}, {"w": "6,", "b": [0.4082, 0.3257, 0.4309, 0.3409]}, {"w": "8],", "b": [0.4422, 0.3257, 0.4763, 0.3409]}, {"w": "dtype=uint8)", "b": [0.4876, 0.3257, 0.6238, 0.3409]}]}, {"id": "b_3", "type": "paragraph", "text": "And here’s the test data:", "words": [{"w": "And", "b": [0.1294, 0.3638, 0.1729, 0.3835]}, {"w": "here’s", "b": [0.1792, 0.3638, 0.2394, 0.3835]}, {"w": "the", "b": [0.2457, 0.3638, 0.2765, 0.3835]}, {"w": "test", "b": [0.2828, 0.3638, 0.3179, 0.3835]}, {"w": "data:", "b": [0.3242, 0.3638, 0.3732, 0.3835]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> test_images.shape (10000, 28, 28) >>> len(test_labels) 10000 >>> test_labels array([7, 2, 1, ..., 4, 5, 6], dtype=uint8)", "words": [{"w": ">>>", "b": [0.1357, 0.4015, 0.1698, 0.4166]}, {"w": "test_images.shape", "b": [0.1811, 0.4015, 0.3741, 0.4166]}, {"w": "(10000,", "b": [0.1357, 0.4167, 0.2152, 0.4318]}, {"w": "28,", "b": [0.2265, 0.4167, 0.2606, 0.4318]}, {"w": "28)", "b": [0.2719, 0.4167, 0.306, 0.4318]}, {"w": ">>>", "b": [0.1357, 0.4318, 0.1698, 0.447]}, {"w": "len(test_labels)", "b": [0.1811, 0.4318, 0.3628, 0.447]}, {"w": "10000", "b": [0.1357, 0.447, 0.1925, 0.4621]}, {"w": ">>>", "b": [0.1357, 0.4621, 0.1698, 0.4773]}, {"w": "test_labels", "b": [0.1811, 0.4621, 0.306, 0.4773]}, {"w": "array([7,", "b": [0.1357, 0.4773, 0.2379, 0.4924]}, {"w": "2,", "b": [0.2492, 0.4773, 0.2719, 0.4924]}, {"w": "1,", "b": [0.2833, 0.4773, 0.306, 0.4924]}, {"w": "...,", "b": [0.3173, 0.4773, 0.3628, 0.4924]}, {"w": "4,", "b": [0.3741, 0.4773, 0.3968, 0.4924]}, {"w": "5,", "b": [0.4082, 0.4773, 0.4309, 0.4924]}, {"w": "6],", "b": [0.4422, 0.4773, 0.4763, 0.4924]}, {"w": "dtype=uint8)", "b": [0.4876, 0.4773, 0.6238, 0.4924]}]}, {"id": "b_5", "type": "paragraph", "text": "The workflow will be as follows: First, we’ll feed the neural network the training data, train_images and train_labels. The network will then learn to associate images and labels. Finally, we’ll ask the network to produce predictions for test_images, and we’ll verify whether these predictions match the labels from test_labels.", "words": [{"w": "The", "b": [0.1294, 0.5153, 0.1686, 0.535]}, {"w": "workflow", "b": [0.1749, 0.5153, 0.273, 0.535]}, {"w": "will", "b": [0.2793, 0.5153, 0.3186, 0.535]}, {"w": "be", "b": [0.3249, 0.5153, 0.3487, 0.535]}, {"w": "as", "b": [0.355, 0.5153, 0.376, 0.535]}, {"w": "follows:", "b": [0.3823, 0.5153, 0.465, 0.535]}, {"w": "First,", "b": [0.4713, 0.5153, 0.5239, 0.535]}, {"w": "we’ll", "b": [0.5302, 0.5153, 0.582, 0.535]}, {"w": "feed", "b": [0.5883, 0.5153, 0.6318, 0.535]}, {"w": "the", "b": [0.6381, 0.5153, 0.6689, 0.535]}, {"w": "neural", "b": [0.6752, 0.5153, 0.7382, 0.535]}, {"w": "network", "b": [0.7445, 0.5153, 0.8272, 0.535]}, {"w": "the", "b": [0.8335, 0.5153, 0.8643, 0.535]}, {"w": "training", "b": [0.1294, 0.5358, 0.2079, 0.5555]}, {"w": "data,", "b": [0.2142, 0.5358, 0.2625, 0.5555]}, {"w": "train_images", "b": [0.2688, 0.5368, 0.4504, 0.557]}, {"w": "and", "b": [0.4568, 0.5358, 0.4932, 0.5555]}, {"w": "train_labels.", "b": [0.4995, 0.5358, 0.6874, 0.557]}, {"w": "The", "b": [0.6937, 0.5358, 0.733, 0.5555]}, {"w": "network", "b": [0.7393, 0.5358, 0.8219, 0.5555]}, {"w": "will", "b": [0.8282, 0.5358, 0.8675, 0.5555]}, {"w": "then", "b": [0.1294, 0.5572, 0.1729, 0.5769]}, {"w": "learn", "b": [0.1792, 0.5572, 0.2296, 0.5769]}, {"w": "to", "b": [0.2359, 0.5572, 0.2555, 0.5769]}, {"w": "associate", "b": [0.2618, 0.5572, 0.3529, 0.5769]}, {"w": "images", "b": [0.3592, 0.5572, 0.4307, 0.5769]}, {"w": "and", "b": [0.437, 0.5572, 0.4734, 0.5769]}, {"w": "labels.", "b": [0.4797, 0.5572, 0.5449, 0.5769]}, {"w": "Finally,", "b": [0.5512, 0.5572, 0.6272, 0.5769]}, {"w": "we’ll", "b": [0.6335, 0.5572, 0.6854, 0.5769]}, {"w": "ask", "b": [0.6917, 0.5572, 0.7253, 0.5769]}, {"w": "the", "b": [0.7316, 0.5572, 0.7624, 0.5769]}, {"w": "network", "b": [0.7688, 0.5572, 0.8514, 0.5769]}, {"w": "to", "b": [0.1294, 0.5777, 0.149, 0.5974]}, {"w": "produce", "b": [0.1553, 0.5777, 0.2366, 0.5974]}, {"w": "predictions", "b": [0.2429, 0.5777, 0.355, 0.5974]}, {"w": "for", "b": [0.3613, 0.5777, 0.3907, 0.5974]}, {"w": "test_images,", "b": [0.397, 0.5777, 0.5698, 0.5989]}, {"w": "and", "b": [0.5761, 0.5777, 0.6126, 0.5974]}, {"w": "we’ll", "b": [0.6189, 0.5777, 0.6707, 0.5974]}, {"w": "verify", "b": [0.677, 0.5777, 0.7372, 0.5974]}, {"w": "whether", "b": [0.7435, 0.5777, 0.8248, 0.5974]}, {"w": "these", "b": [0.1294, 0.5991, 0.1813, 0.6188]}, {"w": "predictions", "b": [0.1876, 0.5991, 0.2997, 0.6188]}, {"w": "match", "b": [0.306, 0.5991, 0.3676, 0.6188]}, {"w": "the", "b": [0.3739, 0.5991, 0.4048, 0.6188]}, {"w": "labels", "b": [0.4111, 0.5991, 0.4699, 0.6188]}, {"w": "from", "b": [0.4762, 0.5991, 0.5253, 0.6188]}, {"w": "test_labels.", "b": [0.5315, 0.5991, 0.7043, 0.6203]}]}, {"id": "b_6", "type": "paragraph", "text": "Let’s build the network—again, remember that you aren’t expected to understand everything about this example yet.", "words": [{"w": "Let’s", "b": [0.1294, 0.6427, 0.1798, 0.6625]}, {"w": "build", "b": [0.1862, 0.6427, 0.238, 0.6625]}, {"w": "the", "b": [0.2443, 0.6427, 0.2752, 0.6625]}, {"w": "network—again,", "b": [0.2815, 0.6427, 0.4503, 0.6625]}, {"w": "remember", "b": [0.4566, 0.6427, 0.5589, 0.6625]}, {"w": "that", "b": [0.5652, 0.6427, 0.603, 0.6625]}, {"w": "you", "b": [0.6093, 0.6427, 0.6472, 0.6625]}, {"w": "aren’t", "b": [0.6535, 0.6427, 0.7118, 0.6625]}, {"w": "expected", "b": [0.7181, 0.6427, 0.8077, 0.6625]}, {"w": "to", "b": [0.814, 0.6427, 0.8337, 0.6625]}, {"w": "understand", "b": [0.1294, 0.6632, 0.2401, 0.683]}, {"w": "everything", "b": [0.2464, 0.6632, 0.3543, 0.683]}, {"w": "about", "b": [0.3606, 0.6632, 0.4167, 0.683]}, {"w": "this", "b": [0.423, 0.6632, 0.4594, 0.683]}, {"w": "example", "b": [0.4657, 0.6632, 0.5512, 0.683]}, {"w": "yet.", "b": [0.5575, 0.6632, 0.5946, 0.683]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 2.2. The network architecture", "words": [{"w": "Listing", "b": [0.1294, 0.7011, 0.1862, 0.7159]}, {"w": "2.2.", "b": [0.1909, 0.7011, 0.2193, 0.7159]}, {"w": "The", "b": [0.224, 0.7011, 0.2555, 0.7159]}, {"w": "network", "b": [0.2603, 0.7011, 0.3275, 0.7159]}, {"w": "architecture", "b": [0.3323, 0.7011, 0.4303, 0.7159]}]}, {"id": "b_8", "type": "paragraph", "text": "from keras import models from keras import layers network = models.Sequential() network.add(layers.Dense(512, activation='relu', input_shape=(28 * 28,))) network.add(layers.Dense(10, activation='softmax'))", "words": [{"w": "from", "b": [0.1357, 0.7295, 0.1811, 0.7447]}, {"w": "keras", "b": [0.1925, 0.7295, 0.2492, 0.7447]}, {"w": "import", "b": [0.2606, 0.7295, 0.3287, 0.7447]}, {"w": "models", "b": [0.34, 0.7295, 0.4082, 0.7447]}, {"w": "from", "b": [0.1357, 0.7447, 0.1811, 0.7598]}, {"w": "keras", "b": [0.1925, 0.7447, 0.2492, 0.7598]}, {"w": "import", "b": [0.2606, 0.7447, 0.3287, 0.7598]}, {"w": "layers", "b": [0.34, 0.7447, 0.4082, 0.7598]}, {"w": "network", "b": [0.1357, 0.775, 0.2152, 0.7901]}, {"w": "=", "b": [0.2265, 0.775, 0.2379, 0.7901]}, {"w": "models.Sequential()", "b": [0.2492, 0.775, 0.4649, 0.7901]}, {"w": "network.add(layers.Dense(512,", "b": [0.1357, 0.7901, 0.4649, 0.8053]}, {"w": "activation='relu',", "b": [0.4763, 0.7901, 0.6806, 0.8053]}, {"w": "input_shape=(28", "b": [0.6919, 0.7901, 0.8622, 0.8053]}, {"w": "*", "b": [0.1357, 0.8053, 0.1471, 0.8204]}, {"w": "28,)))", "b": [0.1584, 0.8053, 0.2265, 0.8204]}, {"w": "network.add(layers.Dense(10,", "b": [0.1357, 0.8204, 0.4536, 0.8356]}, {"w": "activation='softmax'))", "b": [0.4649, 0.8204, 0.7146, 0.8356]}]}, {"id": "b_9", "type": "paragraph", "text": "The core building block of neural networks is the layer, a data- processing module that you can think of as a filter for data. Some data", "words": [{"w": "The", "b": [0.1294, 0.8584, 0.1686, 0.8782]}, {"w": "core", "b": [0.1749, 0.8584, 0.2184, 0.8782]}, {"w": "building", "b": [0.2247, 0.8584, 0.3088, 0.8782]}, {"w": "block", "b": [0.3151, 0.8584, 0.3711, 0.8782]}, {"w": "of", "b": [0.3774, 0.8584, 0.3984, 0.8782]}, {"w": "neural", "b": [0.4048, 0.8584, 0.4678, 0.8782]}, {"w": "networks", "b": [0.4741, 0.8584, 0.5666, 0.8782]}, {"w": "is", "b": [0.5729, 0.8584, 0.5897, 0.8782]}, {"w": "the", "b": [0.596, 0.8584, 0.6268, 0.8782]}, {"w": "layer,", "b": [0.6331, 0.8584, 0.6912, 0.8782]}, {"w": "a", "b": [0.6975, 0.8584, 0.7087, 0.8782]}, {"w": "data-", "b": [0.715, 0.8584, 0.7655, 0.8782]}, {"w": "processing", "b": [0.1294, 0.8789, 0.2373, 0.8987]}, {"w": "module", "b": [0.2436, 0.8789, 0.3193, 0.8987]}, {"w": "that", "b": [0.3256, 0.8789, 0.3634, 0.8987]}, {"w": "you", "b": [0.3697, 0.8789, 0.4076, 0.8987]}, {"w": "can", "b": [0.4139, 0.8789, 0.4489, 0.8987]}, {"w": "think", "b": [0.4552, 0.8789, 0.5071, 0.8987]}, {"w": "of", "b": [0.5134, 0.8789, 0.5344, 0.8987]}, {"w": "as", "b": [0.5407, 0.8789, 0.5617, 0.8987]}, {"w": "a", "b": [0.568, 0.8789, 0.5792, 0.8987]}, {"w": "filter", "b": [0.5855, 0.8789, 0.6346, 0.8987]}, {"w": "for", "b": [0.6409, 0.8789, 0.6703, 0.8987]}, {"w": "data.", "b": [0.6766, 0.8789, 0.7249, 0.8987]}, {"w": "Some", "b": [0.7312, 0.8789, 0.7887, 0.8987]}, {"w": "data", "b": [0.795, 0.8789, 0.837, 0.8987]}]}]}, {"page": 61, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "goes in, and it comes out in a more useful form. Specifically, layers extract representations out of the data fed into them—hopefully, representations that are more meaningful for the problem at hand. Most of deep learning consists of chaining together simple layers that will implement a form of progressive data distillation. A deep-learning model is like a sieve for data processing, made of a succession of increasingly refined data filters—the layers.", "words": [{"w": "goes", "b": [0.1294, 0.0857, 0.1757, 0.1054]}, {"w": "in,", "b": [0.182, 0.0857, 0.2079, 0.1054]}, {"w": "and", "b": [0.2142, 0.0857, 0.2506, 0.1054]}, {"w": "it", "b": [0.2569, 0.0857, 0.271, 0.1054]}, {"w": "comes", "b": [0.2773, 0.0857, 0.3417, 0.1054]}, {"w": "out", "b": [0.348, 0.0857, 0.3803, 0.1054]}, {"w": "in", "b": [0.3866, 0.0857, 0.4062, 0.1054]}, {"w": "a", "b": [0.4125, 0.0857, 0.4237, 0.1054]}, {"w": "more", "b": [0.43, 0.0857, 0.4818, 0.1054]}, {"w": "useful", "b": [0.4881, 0.0857, 0.5498, 0.1054]}, {"w": "form.", "b": [0.556, 0.0857, 0.6114, 0.1054]}, {"w": "Specifically,", "b": [0.6177, 0.0857, 0.7428, 0.1054]}, {"w": "layers", "b": [0.7491, 0.0857, 0.8094, 0.1054]}, {"w": "extract", "b": [0.1294, 0.1062, 0.1981, 0.1259]}, {"w": "representations", "b": [0.2043, 0.1062, 0.3594, 0.1259]}, {"w": "out", "b": [0.3657, 0.1062, 0.3979, 0.1259]}, {"w": "of", "b": [0.4042, 0.1062, 0.4252, 0.1259]}, {"w": "the", "b": [0.4316, 0.1062, 0.4624, 0.1259]}, {"w": "data", "b": [0.4687, 0.1062, 0.5107, 0.1259]}, {"w": "fed", "b": [0.517, 0.1062, 0.5492, 0.1259]}, {"w": "into", "b": [0.5555, 0.1062, 0.5948, 0.1259]}, {"w": "them—hopefully,", "b": [0.6011, 0.1062, 0.7781, 0.1259]}, {"w": "representations", "b": [0.1294, 0.1267, 0.2821, 0.1464]}, {"w": "that", "b": [0.2884, 0.1267, 0.3263, 0.1464]}, {"w": "are", "b": [0.3326, 0.1267, 0.3634, 0.1464]}, {"w": "more", "b": [0.3697, 0.1267, 0.4215, 0.1464]}, {"w": "meaningful", "b": [0.4278, 0.1267, 0.5427, 0.1464]}, {"w": "for", "b": [0.549, 0.1267, 0.5785, 0.1464]}, {"w": "the", "b": [0.5848, 0.1267, 0.6156, 0.1464]}, {"w": "problem", "b": [0.6219, 0.1267, 0.706, 0.1464]}, {"w": "at", "b": [0.7123, 0.1267, 0.7305, 0.1464]}, {"w": "hand.", "b": [0.7368, 0.1267, 0.7921, 0.1464]}, {"w": "Most", "b": [0.7984, 0.1267, 0.8503, 0.1464]}, {"w": "of", "b": [0.1294, 0.1472, 0.1504, 0.1669]}, {"w": "deep", "b": [0.1567, 0.1472, 0.2044, 0.1669]}, {"w": "learning", "b": [0.2107, 0.1472, 0.2933, 0.1669]}, {"w": "consists", "b": [0.2996, 0.1472, 0.3795, 0.1669]}, {"w": "of", "b": [0.3858, 0.1472, 0.4068, 0.1669]}, {"w": "chaining", "b": [0.4131, 0.1472, 0.5, 0.1669]}, {"w": "together", "b": [0.5063, 0.1472, 0.589, 0.1669]}, {"w": "simple", "b": [0.5953, 0.1472, 0.6626, 0.1669]}, {"w": "layers", "b": [0.6689, 0.1472, 0.7291, 0.1669]}, {"w": "that", "b": [0.7354, 0.1472, 0.7732, 0.1669]}, {"w": "will", "b": [0.7796, 0.1472, 0.8188, 0.1669]}, {"w": "implement", "b": [0.1294, 0.1677, 0.2373, 0.1874]}, {"w": "a", "b": [0.2436, 0.1677, 0.2548, 0.1874]}, {"w": "form", "b": [0.2611, 0.1677, 0.3102, 0.1874]}, {"w": "of", "b": [0.3165, 0.1677, 0.3375, 0.1874]}, {"w": "progressive", "b": [0.3438, 0.1677, 0.4601, 0.1874]}, {"w": "data", "b": [0.4664, 0.1677, 0.5112, 0.1874]}, {"w": "distillation.", "b": [0.5175, 0.1677, 0.6331, 0.1874]}, {"w": "A", "b": [0.6394, 0.1677, 0.6577, 0.1874]}, {"w": "deep-learning", "b": [0.664, 0.1677, 0.8027, 0.1874]}, {"w": "model", "b": [0.1294, 0.1882, 0.1925, 0.2079]}, {"w": "is", "b": [0.1988, 0.1882, 0.2156, 0.2079]}, {"w": "like", "b": [0.2219, 0.1882, 0.2598, 0.2079]}, {"w": "a", "b": [0.2661, 0.1882, 0.2773, 0.2079]}, {"w": "sieve", "b": [0.2836, 0.1882, 0.3354, 0.2079]}, {"w": "for", "b": [0.3417, 0.1882, 0.3711, 0.2079]}, {"w": "data", "b": [0.3774, 0.1882, 0.4195, 0.2079]}, {"w": "processing,", "b": [0.4258, 0.1882, 0.54, 0.2079]}, {"w": "made", "b": [0.5463, 0.1882, 0.6009, 0.2079]}, {"w": "of", "b": [0.6072, 0.1882, 0.6282, 0.2079]}, {"w": "a", "b": [0.6345, 0.1882, 0.6457, 0.2079]}, {"w": "succession", "b": [0.652, 0.1882, 0.7599, 0.2079]}, {"w": "of", "b": [0.7662, 0.1882, 0.7872, 0.2079]}, {"w": "increasingly", "b": [0.1294, 0.2087, 0.2527, 0.2284]}, {"w": "refined", "b": [0.259, 0.2087, 0.3305, 0.2284]}, {"w": "data", "b": [0.3368, 0.2087, 0.3788, 0.2284]}, {"w": "filters—the", "b": [0.3851, 0.2087, 0.5, 0.2284]}, {"w": "layers.", "b": [0.5062, 0.2087, 0.5728, 0.2284]}]}, {"id": "b_1", "type": "paragraph", "text": "Here, our network consists of a sequence of two Dense layers, which are densely connected (also called fully connected) neural layers. The second (and last) layer is a 10-way softmax layer, which means it will return an array of 10 probability scores (summing to 1). Each score will be the probability that the current digit image belongs to one of our 10 digit classes.", "words": [{"w": "Here,", "b": [0.1294, 0.2515, 0.1847, 0.2712]}, {"w": "our", "b": [0.191, 0.2515, 0.2247, 0.2712]}, {"w": "network", "b": [0.231, 0.2515, 0.3136, 0.2712]}, {"w": "consists", "b": [0.3199, 0.2515, 0.3998, 0.2712]}, {"w": "of", "b": [0.4061, 0.2515, 0.4272, 0.2712]}, {"w": "a", "b": [0.4335, 0.2515, 0.4447, 0.2712]}, {"w": "sequence", "b": [0.451, 0.2515, 0.5434, 0.2712]}, {"w": "of", "b": [0.5497, 0.2515, 0.5707, 0.2712]}, {"w": "two", "b": [0.577, 0.2515, 0.6149, 0.2712]}, {"w": "Dense", "b": [0.6212, 0.2525, 0.6968, 0.2727]}, {"w": "layers,", "b": [0.7031, 0.2515, 0.7697, 0.2712]}, {"w": "which", "b": [0.776, 0.2515, 0.8376, 0.2712]}, {"w": "are", "b": [0.1294, 0.2729, 0.1602, 0.2926]}, {"w": "densely", "b": [0.1665, 0.2729, 0.2436, 0.2926]}, {"w": "connected", "b": [0.2499, 0.2729, 0.3522, 0.2926]}, {"w": "(also", "b": [0.3585, 0.2729, 0.4075, 0.2926]}, {"w": "called", "b": [0.4138, 0.2729, 0.474, 0.2926]}, {"w": "fully", "b": [0.4803, 0.2729, 0.5251, 0.2926]}, {"w": "connected)", "b": [0.5314, 0.2729, 0.6421, 0.2926]}, {"w": "neural", "b": [0.6484, 0.2729, 0.7114, 0.2926]}, {"w": "layers.", "b": [0.7177, 0.2729, 0.7843, 0.2926]}, {"w": "The", "b": [0.7906, 0.2729, 0.8298, 0.2926]}, {"w": "second", "b": [0.1294, 0.2934, 0.1995, 0.3131]}, {"w": "(and", "b": [0.2058, 0.2934, 0.2506, 0.3131]}, {"w": "last)", "b": [0.2569, 0.2934, 0.3003, 0.3131]}, {"w": "layer", "b": [0.3066, 0.2934, 0.3571, 0.3131]}, {"w": "is", "b": [0.3634, 0.2934, 0.3802, 0.3131]}, {"w": "a", "b": [0.3865, 0.2934, 0.3977, 0.3131]}, {"w": "10-way", "b": [0.404, 0.2934, 0.4797, 0.3131]}, {"w": "softmax", "b": [0.4859, 0.2934, 0.5644, 0.3131]}, {"w": "layer,", "b": [0.5707, 0.2934, 0.6264, 0.3131]}, {"w": "which", "b": [0.6327, 0.2934, 0.6944, 0.3131]}, {"w": "means", "b": [0.7007, 0.2934, 0.7651, 0.3131]}, {"w": "it", "b": [0.7714, 0.2934, 0.7855, 0.3131]}, {"w": "will", "b": [0.7918, 0.2934, 0.831, 0.3131]}, {"w": "return", "b": [0.1294, 0.3139, 0.1897, 0.3336]}, {"w": "an", "b": [0.196, 0.3139, 0.2198, 0.3336]}, {"w": "array", "b": [0.2261, 0.3139, 0.2779, 0.3336]}, {"w": "of", "b": [0.2842, 0.3139, 0.3052, 0.3336]}, {"w": "10", "b": [0.3115, 0.3139, 0.3367, 0.3336]}, {"w": "probability", "b": [0.343, 0.3139, 0.4538, 0.3336]}, {"w": "scores", "b": [0.4601, 0.3139, 0.5231, 0.3336]}, {"w": "(summing", "b": [0.5294, 0.3139, 0.6317, 0.3336]}, {"w": "to", "b": [0.638, 0.3139, 0.6577, 0.3336]}, {"w": "1).", "b": [0.664, 0.3139, 0.6913, 0.3336]}, {"w": "Each", "b": [0.6976, 0.3139, 0.748, 0.3336]}, {"w": "score", "b": [0.7543, 0.3139, 0.8076, 0.3336]}, {"w": "will", "b": [0.8139, 0.3139, 0.8531, 0.3336]}, {"w": "be", "b": [0.1294, 0.3344, 0.1532, 0.3541]}, {"w": "the", "b": [0.1595, 0.3344, 0.1904, 0.3541]}, {"w": "probability", "b": [0.1967, 0.3344, 0.3074, 0.3541]}, {"w": "that", "b": [0.3137, 0.3344, 0.3515, 0.3541]}, {"w": "the", "b": [0.3578, 0.3344, 0.3886, 0.3541]}, {"w": "current", "b": [0.3949, 0.3344, 0.4664, 0.3541]}, {"w": "digit", "b": [0.4727, 0.3344, 0.5189, 0.3541]}, {"w": "image", "b": [0.5252, 0.3344, 0.5869, 0.3541]}, {"w": "belongs", "b": [0.5932, 0.3344, 0.6717, 0.3541]}, {"w": "to", "b": [0.678, 0.3344, 0.6976, 0.3541]}, {"w": "one", "b": [0.7039, 0.3344, 0.7403, 0.3541]}, {"w": "of", "b": [0.7466, 0.3344, 0.7677, 0.3541]}, {"w": "our", "b": [0.774, 0.3344, 0.8076, 0.3541]}, {"w": "10", "b": [0.8139, 0.3344, 0.8391, 0.3541]}, {"w": "digit", "b": [0.1294, 0.3549, 0.1757, 0.3746]}, {"w": "classes.", "b": [0.182, 0.3549, 0.2583, 0.3746]}]}, {"id": "b_2", "type": "paragraph", "text": "To make the network ready for training, we need to pick three more things, as part of the compilation step:", "words": [{"w": "To", "b": [0.1294, 0.3976, 0.1557, 0.4174]}, {"w": "make", "b": [0.162, 0.3976, 0.2166, 0.4174]}, {"w": "the", "b": [0.2229, 0.3976, 0.2538, 0.4174]}, {"w": "network", "b": [0.2601, 0.3976, 0.3427, 0.4174]}, {"w": "ready", "b": [0.349, 0.3976, 0.4051, 0.4174]}, {"w": "for", "b": [0.4114, 0.3976, 0.4408, 0.4174]}, {"w": "training,", "b": [0.4471, 0.3976, 0.5319, 0.4174]}, {"w": "we", "b": [0.5382, 0.3976, 0.5676, 0.4174]}, {"w": "need", "b": [0.5739, 0.3976, 0.6215, 0.4174]}, {"w": "to", "b": [0.6278, 0.3976, 0.6474, 0.4174]}, {"w": "pick", "b": [0.6538, 0.3976, 0.6972, 0.4174]}, {"w": "three", "b": [0.7035, 0.3976, 0.7539, 0.4174]}, {"w": "more", "b": [0.7602, 0.3976, 0.8121, 0.4174]}, {"w": "things,", "b": [0.1294, 0.4181, 0.1974, 0.4379]}, {"w": "as", "b": [0.2037, 0.4181, 0.2247, 0.4379]}, {"w": "part", "b": [0.231, 0.4181, 0.2702, 0.4379]}, {"w": "of", "b": [0.2766, 0.4181, 0.2976, 0.4379]}, {"w": "the", "b": [0.3039, 0.4181, 0.3347, 0.4379]}, {"w": "compilation", "b": [0.341, 0.4181, 0.4615, 0.4379]}, {"w": "step:", "b": [0.4678, 0.4181, 0.5154, 0.4379]}]}, {"id": "b_3", "type": "paragraph", "text": "A loss function— How the network will be able to measure its performance on the training data, and thus how it will be able to steer itself in the right direction. An optimizer— The mechanism through which the network will update itself based on the data it sees and its loss function. Metrics to monitor during training and testing— Here, we’ll only care about accuracy (the fraction of the images that were correctly classified).", "words": [{"w": "A", "b": [0.1799, 0.4565, 0.1967, 0.4762]}, {"w": "loss", "b": [0.203, 0.4565, 0.2422, 0.4762]}, {"w": "function—", "b": [0.2486, 0.4565, 0.3621, 0.4762]}, {"w": "How", "b": [0.3684, 0.4565, 0.4174, 0.4762]}, {"w": "the", "b": [0.4237, 0.4565, 0.4546, 0.4762]}, {"w": "network", "b": [0.4609, 0.4565, 0.5435, 0.4762]}, {"w": "will", "b": [0.5498, 0.4565, 0.5891, 0.4762]}, {"w": "be", "b": [0.5954, 0.4565, 0.6192, 0.4762]}, {"w": "able", "b": [0.6255, 0.4565, 0.6675, 0.4762]}, {"w": "to", "b": [0.6738, 0.4565, 0.6935, 0.4762]}, {"w": "measure", "b": [0.6998, 0.4565, 0.7838, 0.4762]}, {"w": "its", "b": [0.7901, 0.4565, 0.814, 0.4762]}, {"w": "performance", "b": [0.1799, 0.477, 0.3073, 0.4967]}, {"w": "on", "b": [0.3136, 0.477, 0.3389, 0.4967]}, {"w": "the", "b": [0.3452, 0.477, 0.376, 0.4967]}, {"w": "training", "b": [0.3823, 0.477, 0.4608, 0.4967]}, {"w": "data,", "b": [0.4671, 0.477, 0.5154, 0.4967]}, {"w": "and", "b": [0.5217, 0.477, 0.5581, 0.4967]}, {"w": "thus", "b": [0.5645, 0.477, 0.6065, 0.4967]}, {"w": "how", "b": [0.6128, 0.477, 0.6563, 0.4967]}, {"w": "it", "b": [0.6626, 0.477, 0.6766, 0.4967]}, {"w": "will", "b": [0.6829, 0.477, 0.7221, 0.4967]}, {"w": "be", "b": [0.7284, 0.477, 0.7523, 0.4967]}, {"w": "able", "b": [0.7586, 0.477, 0.8006, 0.4967]}, {"w": "to", "b": [0.8069, 0.477, 0.8265, 0.4967]}, {"w": "steer", "b": [0.1799, 0.4975, 0.2275, 0.5172]}, {"w": "itself", "b": [0.2338, 0.4975, 0.2842, 0.5172]}, {"w": "in", "b": [0.2905, 0.4975, 0.3101, 0.5172]}, {"w": "the", "b": [0.3165, 0.4975, 0.3473, 0.5172]}, {"w": "right", "b": [0.3536, 0.4975, 0.4012, 0.5172]}, {"w": "direction.", "b": [0.4075, 0.4975, 0.5035, 0.5172]}, {"w": "An", "b": [0.1799, 0.518, 0.2107, 0.5377]}, {"w": "optimizer—", "b": [0.217, 0.518, 0.339, 0.5377]}, {"w": "The", "b": [0.3452, 0.518, 0.3845, 0.5377]}, {"w": "mechanism", "b": [0.3908, 0.518, 0.5057, 0.5377]}, {"w": "through", "b": [0.512, 0.518, 0.5905, 0.5377]}, {"w": "which", "b": [0.5968, 0.518, 0.6584, 0.5377]}, {"w": "the", "b": [0.6647, 0.518, 0.6956, 0.5377]}, {"w": "network", "b": [0.7019, 0.518, 0.7845, 0.5377]}, {"w": "will", "b": [0.7908, 0.518, 0.8301, 0.5377]}, {"w": "update", "b": [0.1799, 0.5385, 0.2471, 0.5582]}, {"w": "itself", "b": [0.2534, 0.5385, 0.3039, 0.5582]}, {"w": "based", "b": [0.3102, 0.5385, 0.3676, 0.5582]}, {"w": "on", "b": [0.3739, 0.5385, 0.3992, 0.5582]}, {"w": "the", "b": [0.4055, 0.5385, 0.4363, 0.5582]}, {"w": "data", "b": [0.4426, 0.5385, 0.4846, 0.5582]}, {"w": "it", "b": [0.4909, 0.5385, 0.5049, 0.5582]}, {"w": "sees", "b": [0.5113, 0.5385, 0.5533, 0.5582]}, {"w": "and", "b": [0.5596, 0.5385, 0.596, 0.5582]}, {"w": "its", "b": [0.6023, 0.5385, 0.6262, 0.5582]}, {"w": "loss", "b": [0.6325, 0.5385, 0.6717, 0.5582]}, {"w": "function.", "b": [0.678, 0.5385, 0.7684, 0.5582]}, {"w": "Metrics", "b": [0.1799, 0.559, 0.2583, 0.5787]}, {"w": "to", "b": [0.2646, 0.559, 0.2843, 0.5787]}, {"w": "monitor", "b": [0.2906, 0.559, 0.3733, 0.5787]}, {"w": "during", "b": [0.3796, 0.559, 0.4497, 0.5787]}, {"w": "training", "b": [0.456, 0.559, 0.5401, 0.5787]}, {"w": "and", "b": [0.5464, 0.559, 0.5857, 0.5787]}, {"w": "testing—", "b": [0.592, 0.559, 0.6859, 0.5787]}, {"w": "Here,", "b": [0.6922, 0.559, 0.7475, 0.5787]}, {"w": "we’ll", "b": [0.7538, 0.559, 0.8057, 0.5787]}, {"w": "only", "b": [0.812, 0.559, 0.8568, 0.5787]}, {"w": "care", "b": [0.1799, 0.5795, 0.2219, 0.5992]}, {"w": "about", "b": [0.2282, 0.5795, 0.2842, 0.5992]}, {"w": "accuracy", "b": [0.2905, 0.5795, 0.3802, 0.5992]}, {"w": "(the", "b": [0.3865, 0.5795, 0.4257, 0.5992]}, {"w": "fraction", "b": [0.432, 0.5795, 0.5104, 0.5992]}, {"w": "of", "b": [0.5168, 0.5795, 0.5378, 0.5992]}, {"w": "the", "b": [0.5441, 0.5795, 0.5749, 0.5992]}, {"w": "images", "b": [0.5812, 0.5795, 0.6527, 0.5992]}, {"w": "that", "b": [0.659, 0.5795, 0.6968, 0.5992]}, {"w": "were", "b": [0.7031, 0.5795, 0.7521, 0.5992]}, {"w": "correctly", "b": [0.7584, 0.5795, 0.8481, 0.5992]}, {"w": "classified).", "b": [0.1799, 0.6, 0.2898, 0.6197]}]}, {"id": "b_4", "type": "paragraph", "text": "The exact purpose of the loss function and the optimizer will be made clear throughout the next two chapters.", "words": [{"w": "The", "b": [0.1294, 0.6427, 0.1686, 0.6625]}, {"w": "exact", "b": [0.1749, 0.6427, 0.2282, 0.6625]}, {"w": "purpose", "b": [0.2345, 0.6427, 0.3143, 0.6625]}, {"w": "of", "b": [0.3206, 0.6427, 0.3417, 0.6625]}, {"w": "the", "b": [0.348, 0.6427, 0.3788, 0.6625]}, {"w": "loss", "b": [0.3851, 0.6427, 0.4244, 0.6625]}, {"w": "function", "b": [0.4307, 0.6427, 0.5147, 0.6625]}, {"w": "and", "b": [0.521, 0.6427, 0.5575, 0.6625]}, {"w": "the", "b": [0.5638, 0.6427, 0.5946, 0.6625]}, {"w": "optimizer", "b": [0.6009, 0.6427, 0.6976, 0.6625]}, {"w": "will", "b": [0.7039, 0.6427, 0.7432, 0.6625]}, {"w": "be", "b": [0.7495, 0.6427, 0.7733, 0.6625]}, {"w": "made", "b": [0.7796, 0.6427, 0.8342, 0.6625]}, {"w": "clear", "b": [0.1294, 0.6632, 0.1784, 0.683]}, {"w": "throughout", "b": [0.1847, 0.6632, 0.2954, 0.683]}, {"w": "the", "b": [0.3018, 0.6632, 0.3326, 0.683]}, {"w": "next", "b": [0.3389, 0.6632, 0.3823, 0.683]}, {"w": "two", "b": [0.3886, 0.6632, 0.4265, 0.683]}, {"w": "chapters.", "b": [0.4328, 0.6632, 0.5231, 0.683]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 2.3. The compilation step", "words": [{"w": "Listing", "b": [0.1294, 0.7011, 0.1862, 0.7159]}, {"w": "2.3.", "b": [0.1909, 0.7011, 0.2193, 0.7159]}, {"w": "The", "b": [0.224, 0.7011, 0.2555, 0.7159]}, {"w": "compilation", "b": [0.2603, 0.7011, 0.3559, 0.7159]}, {"w": "step", "b": [0.3607, 0.7011, 0.3932, 0.7159]}]}, {"id": "b_6", "type": "paragraph", "text": "network.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])", "words": [{"w": "network.compile(optimizer='rmsprop',", "b": [0.1357, 0.7295, 0.5444, 0.7447]}, {"w": "loss='categorical_crossentropy',", "b": [0.3173, 0.7447, 0.6806, 0.7598]}, {"w": "metrics=['accuracy'])", "b": [0.3173, 0.7598, 0.5557, 0.775]}]}, {"id": "b_7", "type": "paragraph", "text": "Before training, we’ll preprocess the data by reshaping it into the shape the network expects and scaling it so that all values are in the [0, 1] interval. Previously, our training images, for instance, were stored in an array of shape (60000, 28, 28) of type uint8 with values in the", "words": [{"w": "Before", "b": [0.1294, 0.7978, 0.1981, 0.8176]}, {"w": "training,", "b": [0.2044, 0.7978, 0.2891, 0.8176]}, {"w": "we’ll", "b": [0.2954, 0.7978, 0.3473, 0.8176]}, {"w": "preprocess", "b": [0.3536, 0.7978, 0.4615, 0.8176]}, {"w": "the", "b": [0.4678, 0.7978, 0.4986, 0.8176]}, {"w": "data", "b": [0.5049, 0.7978, 0.5469, 0.8176]}, {"w": "by", "b": [0.5532, 0.7978, 0.5785, 0.8176]}, {"w": "reshaping", "b": [0.5848, 0.7978, 0.6828, 0.8176]}, {"w": "it", "b": [0.6891, 0.7978, 0.7032, 0.8176]}, {"w": "into", "b": [0.7095, 0.7978, 0.7487, 0.8176]}, {"w": "the", "b": [0.755, 0.7978, 0.7859, 0.8176]}, {"w": "shape", "b": [0.7922, 0.7978, 0.8496, 0.8176]}, {"w": "the", "b": [0.1294, 0.8183, 0.1602, 0.8381]}, {"w": "network", "b": [0.1665, 0.8183, 0.2492, 0.8381]}, {"w": "expects", "b": [0.2555, 0.8183, 0.3312, 0.8381]}, {"w": "and", "b": [0.3375, 0.8183, 0.3739, 0.8381]}, {"w": "scaling", "b": [0.3802, 0.8183, 0.4517, 0.8381]}, {"w": "it", "b": [0.458, 0.8183, 0.472, 0.8381]}, {"w": "so", "b": [0.4783, 0.8183, 0.5007, 0.8381]}, {"w": "that", "b": [0.507, 0.8183, 0.5449, 0.8381]}, {"w": "all", "b": [0.5512, 0.8183, 0.5764, 0.8381]}, {"w": "values", "b": [0.5827, 0.8183, 0.6472, 0.8381]}, {"w": "are", "b": [0.6534, 0.8183, 0.6842, 0.8381]}, {"w": "in", "b": [0.6905, 0.8183, 0.7101, 0.8381]}, {"w": "the", "b": [0.7164, 0.8183, 0.7473, 0.8381]}, {"w": "[0,", "b": [0.7535, 0.8194, 0.7989, 0.8396]}, {"w": "1]", "b": [0.8141, 0.8194, 0.8443, 0.8396]}, {"w": "interval.", "b": [0.1294, 0.8397, 0.2128, 0.8595]}, {"w": "Previously,", "b": [0.2191, 0.8397, 0.3316, 0.8595]}, {"w": "our", "b": [0.338, 0.8397, 0.3716, 0.8595]}, {"w": "training", "b": [0.3779, 0.8397, 0.4564, 0.8595]}, {"w": "images,", "b": [0.4627, 0.8397, 0.5404, 0.8595]}, {"w": "for", "b": [0.5467, 0.8397, 0.5762, 0.8595]}, {"w": "instance,", "b": [0.5825, 0.8397, 0.6714, 0.8595]}, {"w": "were", "b": [0.6777, 0.8397, 0.7268, 0.8595]}, {"w": "stored", "b": [0.7331, 0.8397, 0.7947, 0.8595]}, {"w": "in", "b": [0.801, 0.8397, 0.8207, 0.8595]}, {"w": "an", "b": [0.827, 0.8397, 0.8508, 0.8595]}, {"w": "array", "b": [0.1294, 0.8602, 0.1812, 0.88]}, {"w": "of", "b": [0.1875, 0.8602, 0.2085, 0.88]}, {"w": "shape", "b": [0.2149, 0.8602, 0.2723, 0.88]}, {"w": "(60000,", "b": [0.2786, 0.8613, 0.3845, 0.8815]}, {"w": "28,", "b": [0.3997, 0.8613, 0.4451, 0.8815]}, {"w": "28)", "b": [0.4602, 0.8613, 0.5056, 0.8815]}, {"w": "of", "b": [0.5119, 0.8602, 0.533, 0.88]}, {"w": "type", "b": [0.5393, 0.8602, 0.5827, 0.88]}, {"w": "uint8", "b": [0.589, 0.8613, 0.6647, 0.8815]}, {"w": "with", "b": [0.671, 0.8602, 0.7158, 0.88]}, {"w": "values", "b": [0.7221, 0.8602, 0.7866, 0.88]}, {"w": "in", "b": [0.7929, 0.8602, 0.8125, 0.88]}, {"w": "the", "b": [0.8188, 0.8602, 0.8497, 0.88]}]}]}, {"page": 62, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "[0, 255] interval. We transform it into a float32 array of shape (60000, 28 * 28) with values between 0 and 1.", "words": [{"w": "[0,", "b": [0.1294, 0.0867, 0.1748, 0.1069]}, {"w": "255]", "b": [0.19, 0.0867, 0.2505, 0.1069]}, {"w": "interval.", "b": [0.2568, 0.0857, 0.3402, 0.1054]}, {"w": "We", "b": [0.3465, 0.0857, 0.3795, 0.1054]}, {"w": "transform", "b": [0.3858, 0.0857, 0.4839, 0.1054]}, {"w": "it", "b": [0.4902, 0.0857, 0.5042, 0.1054]}, {"w": "into", "b": [0.5105, 0.0857, 0.5497, 0.1054]}, {"w": "a", "b": [0.556, 0.0857, 0.5672, 0.1054]}, {"w": "float32", "b": [0.5735, 0.0867, 0.6795, 0.1069]}, {"w": "array", "b": [0.6858, 0.0857, 0.7376, 0.1054]}, {"w": "of", "b": [0.7439, 0.0857, 0.7649, 0.1054]}, {"w": "shape", "b": [0.7712, 0.0857, 0.8287, 0.1054]}, {"w": "(60000,", "b": [0.1294, 0.1081, 0.2354, 0.1283]}, {"w": "28", "b": [0.2505, 0.1081, 0.2808, 0.1283]}, {"w": "*", "b": [0.2959, 0.1081, 0.311, 0.1283]}, {"w": "28)", "b": [0.3262, 0.1081, 0.3716, 0.1283]}, {"w": "with", "b": [0.3779, 0.1071, 0.4228, 0.1268]}, {"w": "values", "b": [0.4291, 0.1071, 0.4935, 0.1268]}, {"w": "between", "b": [0.4998, 0.1071, 0.5839, 0.1268]}, {"w": "0", "b": [0.5902, 0.1071, 0.6028, 0.1268]}, {"w": "and", "b": [0.6091, 0.1071, 0.6455, 0.1268]}, {"w": "1.", "b": [0.6519, 0.1071, 0.6708, 0.1268]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 2.4. Preparing the image data", "words": [{"w": "Listing", "b": [0.1294, 0.1458, 0.1862, 0.1606]}, {"w": "2.4.", "b": [0.1909, 0.1458, 0.2193, 0.1606]}, {"w": "Preparing", "b": [0.224, 0.1458, 0.3056, 0.1606]}, {"w": "the", "b": [0.3104, 0.1458, 0.3356, 0.1606]}, {"w": "image", "b": [0.3403, 0.1458, 0.3887, 0.1606]}, {"w": "data", "b": [0.3934, 0.1458, 0.4291, 0.1606]}]}, {"id": "b_2", "type": "paragraph", "text": "train_images = train_images.reshape((60000, 28 * 28)) train_images = train_images.astype('float32') / 255 test_images = test_images.reshape((10000, 28 * 28)) test_images = test_images.astype('float32') / 255", "words": [{"w": "train_images", "b": [0.1357, 0.1742, 0.2719, 0.1894]}, {"w": "=", "b": [0.2833, 0.1742, 0.2946, 0.1894]}, {"w": "train_images.reshape((60000,", "b": [0.306, 0.1742, 0.6238, 0.1894]}, {"w": "28", "b": [0.6352, 0.1742, 0.6579, 0.1894]}, {"w": "*", "b": [0.6692, 0.1742, 0.6806, 0.1894]}, {"w": "28))", "b": [0.6919, 0.1742, 0.7374, 0.1894]}, {"w": "train_images", "b": [0.1357, 0.1894, 0.2719, 0.2045]}, {"w": "=", "b": [0.2833, 0.1894, 0.2946, 0.2045]}, {"w": "train_images.astype('float32')", "b": [0.306, 0.1894, 0.6465, 0.2045]}, {"w": "/", "b": [0.6579, 0.1894, 0.6692, 0.2045]}, {"w": "255", "b": [0.6806, 0.1894, 0.7146, 0.2045]}, {"w": "test_images", "b": [0.1357, 0.2197, 0.2606, 0.2348]}, {"w": "=", "b": [0.2719, 0.2197, 0.2833, 0.2348]}, {"w": "test_images.reshape((10000,", "b": [0.2946, 0.2197, 0.6011, 0.2348]}, {"w": "28", "b": [0.6125, 0.2197, 0.6352, 0.2348]}, {"w": "*", "b": [0.6465, 0.2197, 0.6579, 0.2348]}, {"w": "28))", "b": [0.6692, 0.2197, 0.7146, 0.2348]}, {"w": "test_images", "b": [0.1357, 0.2348, 0.2606, 0.25]}, {"w": "=", "b": [0.2719, 0.2348, 0.2833, 0.25]}, {"w": "test_images.astype('float32')", "b": [0.2946, 0.2348, 0.6238, 0.25]}, {"w": "/", "b": [0.6352, 0.2348, 0.6465, 0.25]}, {"w": "255", "b": [0.6579, 0.2348, 0.6919, 0.25]}]}, {"id": "b_3", "type": "paragraph", "text": "We also need to categorically encode the labels, a step that’s explained in chapter 3.", "words": [{"w": "We", "b": [0.1294, 0.2729, 0.1624, 0.2926]}, {"w": "also", "b": [0.1687, 0.2729, 0.2093, 0.2926]}, {"w": "need", "b": [0.2157, 0.2729, 0.2633, 0.2926]}, {"w": "to", "b": [0.2696, 0.2729, 0.2892, 0.2926]}, {"w": "categorically", "b": [0.2955, 0.2729, 0.4258, 0.2926]}, {"w": "encode", "b": [0.4321, 0.2729, 0.5036, 0.2926]}, {"w": "the", "b": [0.5099, 0.2729, 0.5407, 0.2926]}, {"w": "labels,", "b": [0.547, 0.2729, 0.6122, 0.2926]}, {"w": "a", "b": [0.6185, 0.2729, 0.6297, 0.2926]}, {"w": "step", "b": [0.636, 0.2729, 0.6766, 0.2926]}, {"w": "that’s", "b": [0.6829, 0.2729, 0.7375, 0.2926]}, {"w": "explained", "b": [0.7438, 0.2729, 0.8418, 0.2926]}, {"w": "in", "b": [0.8482, 0.2729, 0.8678, 0.2926]}, {"w": "chapter", "b": [0.1294, 0.2934, 0.2037, 0.3131]}, {"w": "3.", "b": [0.21, 0.2934, 0.2289, 0.3131]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 2.5. Preparing the labels", "words": [{"w": "Listing", "b": [0.1294, 0.3312, 0.1862, 0.346]}, {"w": "2.5.", "b": [0.1909, 0.3312, 0.2193, 0.346]}, {"w": "Preparing", "b": [0.224, 0.3312, 0.3056, 0.346]}, {"w": "the", "b": [0.3104, 0.3312, 0.3356, 0.346]}, {"w": "labels", "b": [0.3403, 0.3312, 0.3866, 0.346]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras.utils import to_categorical train_labels = to_categorical(train_labels) test_labels = to_categorical(test_labels)", "words": [{"w": "from", "b": [0.1357, 0.3596, 0.1811, 0.3748]}, {"w": "keras.utils", "b": [0.1925, 0.3596, 0.3173, 0.3748]}, {"w": "import", "b": [0.3287, 0.3596, 0.3968, 0.3748]}, {"w": "to_categorical", "b": [0.4082, 0.3596, 0.5671, 0.3748]}, {"w": "train_labels", "b": [0.1357, 0.3899, 0.2719, 0.4051]}, {"w": "=", "b": [0.2833, 0.3899, 0.2946, 0.4051]}, {"w": "to_categorical(train_labels)", "b": [0.306, 0.3899, 0.6238, 0.4051]}, {"w": "test_labels", "b": [0.1357, 0.4051, 0.2606, 0.4202]}, {"w": "=", "b": [0.2719, 0.4051, 0.2833, 0.4202]}, {"w": "to_categorical(test_labels)", "b": [0.2946, 0.4051, 0.6011, 0.4202]}]}, {"id": "b_6", "type": "paragraph", "text": "We’re now ready to train the network, which in Keras is done via a call to the network’s fit method—we fit the model to its training data:", "words": [{"w": "We’re", "b": [0.1294, 0.4431, 0.1904, 0.4628]}, {"w": "now", "b": [0.1967, 0.4431, 0.2401, 0.4628]}, {"w": "ready", "b": [0.2465, 0.4431, 0.3025, 0.4628]}, {"w": "to", "b": [0.3088, 0.4431, 0.3284, 0.4628]}, {"w": "train", "b": [0.3347, 0.4431, 0.381, 0.4628]}, {"w": "the", "b": [0.3873, 0.4431, 0.4181, 0.4628]}, {"w": "network,", "b": [0.4244, 0.4431, 0.5134, 0.4628]}, {"w": "which", "b": [0.5197, 0.4431, 0.5813, 0.4628]}, {"w": "in", "b": [0.5876, 0.4431, 0.6073, 0.4628]}, {"w": "Keras", "b": [0.6136, 0.4431, 0.6724, 0.4628]}, {"w": "is", "b": [0.6787, 0.4431, 0.6955, 0.4628]}, {"w": "done", "b": [0.7018, 0.4431, 0.7509, 0.4628]}, {"w": "via", "b": [0.7572, 0.4431, 0.788, 0.4628]}, {"w": "a", "b": [0.7943, 0.4431, 0.8055, 0.4628]}, {"w": "call", "b": [0.8118, 0.4431, 0.8482, 0.4628]}, {"w": "to", "b": [0.1294, 0.4636, 0.149, 0.4833]}, {"w": "the", "b": [0.1553, 0.4636, 0.1862, 0.4833]}, {"w": "network’s", "b": [0.1925, 0.4636, 0.2919, 0.4833]}, {"w": "fit", "b": [0.2982, 0.4646, 0.3437, 0.4848]}, {"w": "method—we", "b": [0.35, 0.4636, 0.4803, 0.4833]}, {"w": "fit", "b": [0.4866, 0.4636, 0.5076, 0.4833]}, {"w": "the", "b": [0.5139, 0.4636, 0.5447, 0.4833]}, {"w": "model", "b": [0.551, 0.4636, 0.6141, 0.4833]}, {"w": "to", "b": [0.6204, 0.4636, 0.64, 0.4833]}, {"w": "its", "b": [0.6463, 0.4636, 0.6701, 0.4833]}, {"w": "training", "b": [0.6764, 0.4636, 0.7549, 0.4833]}, {"w": "data:", "b": [0.7612, 0.4636, 0.8103, 0.4833]}]}, {"id": "b_7", "type": "paragraph", "text": ">>> network.fit(train_images, train_labels, epochs=5, batch_size=128) Epoch 1/5 60000/60000 [==============================] - 9s - loss: 0.2524 - acc: 0.9273 Epoch 2/5 51328/60000 [========================>.....] - ETA: 1s - loss: 0.1035 - acc: 0.9692", "words": [{"w": ">>>", "b": [0.1357, 0.5022, 0.1698, 0.5174]}, {"w": "network.fit(train_images,", "b": [0.1811, 0.5022, 0.4649, 0.5174]}, {"w": "train_labels,", "b": [0.4763, 0.5022, 0.6238, 0.5174]}, {"w": "epochs=5,", "b": [0.6352, 0.5022, 0.7374, 0.5174]}, {"w": "batch_size=128)", "b": [0.1357, 0.5174, 0.306, 0.5325]}, {"w": "Epoch", "b": [0.1357, 0.5325, 0.1925, 0.5477]}, {"w": "1/5", "b": [0.2038, 0.5325, 0.2379, 0.5477]}, {"w": "60000/60000", "b": [0.1357, 0.5477, 0.2606, 0.5628]}, {"w": "[==============================]", "b": [0.2719, 0.5477, 0.6352, 0.5628]}, {"w": "-", "b": [0.6465, 0.5477, 0.6579, 0.5628]}, {"w": "9s", "b": [0.6692, 0.5477, 0.6919, 0.5628]}, {"w": "-", "b": [0.7033, 0.5477, 0.7146, 0.5628]}, {"w": "loss:", "b": [0.726, 0.5477, 0.7828, 0.5628]}, {"w": "0.2524", "b": [0.7941, 0.5477, 0.8622, 0.5628]}, {"w": "-", "b": [0.1357, 0.5628, 0.1471, 0.578]}, {"w": "acc:", "b": [0.1584, 0.5628, 0.2038, 0.578]}, {"w": "0.9273", "b": [0.2152, 0.5628, 0.2833, 0.578]}, {"w": "Epoch", "b": [0.1357, 0.578, 0.1925, 0.5931]}, {"w": "2/5", "b": [0.2038, 0.578, 0.2379, 0.5931]}, {"w": "51328/60000", "b": [0.1357, 0.5931, 0.2606, 0.6083]}, {"w": "[========================>.....]", "b": [0.2719, 0.5931, 0.6352, 0.6083]}, {"w": "-", "b": [0.6465, 0.5931, 0.6579, 0.6083]}, {"w": "ETA:", "b": [0.6692, 0.5931, 0.7146, 0.6083]}, {"w": "1s", "b": [0.726, 0.5931, 0.7487, 0.6083]}, {"w": "-", "b": [0.7601, 0.5931, 0.7714, 0.6083]}, {"w": "loss:", "b": [0.7828, 0.5931, 0.8395, 0.6083]}, {"w": "0.1035", "b": [0.1357, 0.6083, 0.2038, 0.6234]}, {"w": "-", "b": [0.2152, 0.6083, 0.2265, 0.6234]}, {"w": "acc:", "b": [0.2379, 0.6083, 0.2833, 0.6234]}, {"w": "0.9692", "b": [0.2946, 0.6083, 0.3628, 0.6234]}]}, {"id": "b_8", "type": "paragraph", "text": "Two quantities are displayed during training: the loss of the network over the training data, and the accuracy of the network over the training data.", "words": [{"w": "Two", "b": [0.1294, 0.6463, 0.1739, 0.6661]}, {"w": "quantities", "b": [0.1802, 0.6463, 0.2783, 0.6661]}, {"w": "are", "b": [0.2846, 0.6463, 0.3154, 0.6661]}, {"w": "displayed", "b": [0.3217, 0.6463, 0.4184, 0.6661]}, {"w": "during", "b": [0.4247, 0.6463, 0.4906, 0.6661]}, {"w": "training:", "b": [0.4969, 0.6463, 0.5824, 0.6661]}, {"w": "the", "b": [0.5887, 0.6463, 0.6195, 0.6661]}, {"w": "loss", "b": [0.6258, 0.6463, 0.6651, 0.6661]}, {"w": "of", "b": [0.6714, 0.6463, 0.6924, 0.6661]}, {"w": "the", "b": [0.6987, 0.6463, 0.7295, 0.6661]}, {"w": "network", "b": [0.7358, 0.6463, 0.8185, 0.6661]}, {"w": "over", "b": [0.8248, 0.6463, 0.8696, 0.6661]}, {"w": "the", "b": [0.1294, 0.6668, 0.1602, 0.6866]}, {"w": "training", "b": [0.1665, 0.6668, 0.245, 0.6866]}, {"w": "data,", "b": [0.2513, 0.6668, 0.2997, 0.6866]}, {"w": "and", "b": [0.306, 0.6668, 0.3424, 0.6866]}, {"w": "the", "b": [0.3487, 0.6668, 0.3795, 0.6866]}, {"w": "accuracy", "b": [0.3858, 0.6668, 0.4755, 0.6866]}, {"w": "of", "b": [0.4818, 0.6668, 0.5028, 0.6866]}, {"w": "the", "b": [0.5091, 0.6668, 0.5399, 0.6866]}, {"w": "network", "b": [0.5462, 0.6668, 0.6289, 0.6866]}, {"w": "over", "b": [0.6351, 0.6668, 0.6799, 0.6866]}, {"w": "the", "b": [0.6862, 0.6668, 0.7171, 0.6866]}, {"w": "training", "b": [0.7234, 0.6668, 0.8019, 0.6866]}, {"w": "data.", "b": [0.8082, 0.6668, 0.8565, 0.6866]}]}, {"id": "b_9", "type": "paragraph", "text": "We quickly reach an accuracy of 0.989 (98.9%) on the training data. Now let’s check that the model performs well on the test set, too:", "words": [{"w": "We", "b": [0.1294, 0.7096, 0.1624, 0.7293]}, {"w": "quickly", "b": [0.1687, 0.7096, 0.2444, 0.7293]}, {"w": "reach", "b": [0.2507, 0.7096, 0.3053, 0.7293]}, {"w": "an", "b": [0.3116, 0.7096, 0.3354, 0.7293]}, {"w": "accuracy", "b": [0.3417, 0.7096, 0.4314, 0.7293]}, {"w": "of", "b": [0.4377, 0.7096, 0.4587, 0.7293]}, {"w": "0.989", "b": [0.465, 0.7096, 0.5217, 0.7293]}, {"w": "(98.9%)", "b": [0.528, 0.7096, 0.61, 0.7293]}, {"w": "on", "b": [0.6163, 0.7096, 0.6415, 0.7293]}, {"w": "the", "b": [0.6478, 0.7096, 0.6787, 0.7293]}, {"w": "training", "b": [0.685, 0.7096, 0.7635, 0.7293]}, {"w": "data.", "b": [0.7698, 0.7096, 0.8181, 0.7293]}, {"w": "Now", "b": [0.1294, 0.7301, 0.1785, 0.7498]}, {"w": "let’s", "b": [0.1848, 0.7301, 0.2268, 0.7498]}, {"w": "check", "b": [0.2331, 0.7301, 0.2919, 0.7498]}, {"w": "that", "b": [0.2982, 0.7301, 0.3361, 0.7498]}, {"w": "the", "b": [0.3424, 0.7301, 0.3732, 0.7498]}, {"w": "model", "b": [0.3795, 0.7301, 0.4426, 0.7498]}, {"w": "performs", "b": [0.4489, 0.7301, 0.54, 0.7498]}, {"w": "well", "b": [0.5463, 0.7301, 0.5897, 0.7498]}, {"w": "on", "b": [0.596, 0.7301, 0.6212, 0.7498]}, {"w": "the", "b": [0.6275, 0.7301, 0.6584, 0.7498]}, {"w": "test", "b": [0.6647, 0.7301, 0.6997, 0.7498]}, {"w": "set,", "b": [0.7059, 0.7301, 0.7403, 0.7498]}, {"w": "too:", "b": [0.7466, 0.7301, 0.7858, 0.7498]}]}, {"id": "b_10", "type": "paragraph", "text": ">>> test_loss, test_acc = network.evaluate(test_images, test_labels) >>> print('test_acc:', test_acc) test_acc: 0.9785", "words": [{"w": ">>>", "b": [0.1357, 0.7678, 0.1698, 0.783]}, {"w": "test_loss,", "b": [0.1811, 0.7678, 0.2946, 0.783]}, {"w": "test_acc", "b": [0.306, 0.7678, 0.3968, 0.783]}, {"w": "=", "b": [0.4082, 0.7678, 0.4195, 0.783]}, {"w": "network.evaluate(test_images,", "b": [0.4309, 0.7678, 0.7601, 0.783]}, {"w": "test_labels)", "b": [0.1357, 0.783, 0.2719, 0.7981]}, {"w": ">>>", "b": [0.1357, 0.7981, 0.1698, 0.8133]}, {"w": "print('test_acc:',", "b": [0.1811, 0.7981, 0.3855, 0.8133]}, {"w": "test_acc)", "b": [0.3968, 0.7981, 0.499, 0.8133]}, {"w": "test_acc:", "b": [0.1357, 0.8133, 0.2379, 0.8284]}, {"w": "0.9785", "b": [0.2492, 0.8133, 0.3173, 0.8284]}]}, {"id": "b_11", "type": "paragraph", "text": "The test-set accuracy turns out to be 97.8%—that’s quite a bit lower than the training set accuracy. This gap between training accuracy and test accuracy is an example of overfitting: the fact that machine-learning", "words": [{"w": "The", "b": [0.1294, 0.8513, 0.1686, 0.8711]}, {"w": "test-set", "b": [0.1749, 0.8513, 0.2464, 0.8711]}, {"w": "accuracy", "b": [0.2527, 0.8513, 0.3423, 0.8711]}, {"w": "turns", "b": [0.3486, 0.8513, 0.3991, 0.8711]}, {"w": "out", "b": [0.4054, 0.8513, 0.4376, 0.8711]}, {"w": "to", "b": [0.444, 0.8513, 0.4636, 0.8711]}, {"w": "be", "b": [0.4699, 0.8513, 0.4937, 0.8711]}, {"w": "97.8%—that’s", "b": [0.5, 0.8513, 0.645, 0.8711]}, {"w": "quite", "b": [0.6513, 0.8513, 0.7017, 0.8711]}, {"w": "a", "b": [0.708, 0.8513, 0.7192, 0.8711]}, {"w": "bit", "b": [0.7256, 0.8513, 0.7522, 0.8711]}, {"w": "lower", "b": [0.7585, 0.8513, 0.8159, 0.8711]}, {"w": "than", "b": [0.8222, 0.8513, 0.8657, 0.8711]}, {"w": "the", "b": [0.1294, 0.8718, 0.1602, 0.8916]}, {"w": "training", "b": [0.1665, 0.8718, 0.245, 0.8916]}, {"w": "set", "b": [0.2513, 0.8718, 0.2794, 0.8916]}, {"w": "accuracy.", "b": [0.2857, 0.8718, 0.3799, 0.8916]}, {"w": "This", "b": [0.3862, 0.8718, 0.4311, 0.8916]}, {"w": "gap", "b": [0.4374, 0.8718, 0.4738, 0.8916]}, {"w": "between", "b": [0.4801, 0.8718, 0.5642, 0.8916]}, {"w": "training", "b": [0.5705, 0.8718, 0.6489, 0.8916]}, {"w": "accuracy", "b": [0.6552, 0.8718, 0.7448, 0.8916]}, {"w": "and", "b": [0.7511, 0.8718, 0.7876, 0.8916]}, {"w": "test", "b": [0.7939, 0.8718, 0.8289, 0.8916]}, {"w": "accuracy", "b": [0.1294, 0.8923, 0.219, 0.9121]}, {"w": "is", "b": [0.2253, 0.8923, 0.2422, 0.9121]}, {"w": "an", "b": [0.2485, 0.8923, 0.2723, 0.9121]}, {"w": "example", "b": [0.2786, 0.8923, 0.3641, 0.9121]}, {"w": "of", "b": [0.3704, 0.8923, 0.3914, 0.9121]}, {"w": "overfitting:", "b": [0.3976, 0.8923, 0.5097, 0.9121]}, {"w": "the", "b": [0.516, 0.8923, 0.5469, 0.9121]}, {"w": "fact", "b": [0.5532, 0.8923, 0.591, 0.9121]}, {"w": "that", "b": [0.5973, 0.8923, 0.6351, 0.9121]}, {"w": "machine-learning", "b": [0.6414, 0.8923, 0.818, 0.9121]}]}]}, {"page": 63, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "models tend to perform worse on new data than on their training data. Overfitting is a central topic in chapter 3.", "words": [{"w": "models", "b": [0.1294, 0.0857, 0.2023, 0.1054]}, {"w": "tend", "b": [0.2086, 0.0857, 0.252, 0.1054]}, {"w": "to", "b": [0.2583, 0.0857, 0.278, 0.1054]}, {"w": "perform", "b": [0.2843, 0.0857, 0.3655, 0.1054]}, {"w": "worse", "b": [0.3718, 0.0857, 0.4321, 0.1054]}, {"w": "on", "b": [0.4384, 0.0857, 0.4636, 0.1054]}, {"w": "new", "b": [0.4699, 0.0857, 0.5119, 0.1054]}, {"w": "data", "b": [0.5182, 0.0857, 0.5603, 0.1054]}, {"w": "than", "b": [0.5666, 0.0857, 0.61, 0.1054]}, {"w": "on", "b": [0.6163, 0.0857, 0.6415, 0.1054]}, {"w": "their", "b": [0.6479, 0.0857, 0.6941, 0.1054]}, {"w": "training", "b": [0.7004, 0.0857, 0.7789, 0.1054]}, {"w": "data.", "b": [0.7852, 0.0857, 0.8335, 0.1054]}, {"w": "Overfitting", "b": [0.1294, 0.1062, 0.2415, 0.1259]}, {"w": "is", "b": [0.2478, 0.1062, 0.2646, 0.1259]}, {"w": "a", "b": [0.271, 0.1062, 0.2822, 0.1259]}, {"w": "central", "b": [0.2885, 0.1062, 0.3571, 0.1259]}, {"w": "topic", "b": [0.3634, 0.1062, 0.4138, 0.1259]}, {"w": "in", "b": [0.4201, 0.1062, 0.4397, 0.1259]}, {"w": "chapter", "b": [0.446, 0.1062, 0.5203, 0.1259]}, {"w": "3.", "b": [0.5266, 0.1062, 0.5455, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "This concludes our first example—you just saw how you can build and train a neural network to classify handwritten digits in less than 20 lines of Python code. In the next chapter, I’ll go into detail about every moving piece we just previewed and clarify what’s going on behind the scenes. You’ll learn about tensors, the data-storing objects going into the network; tensor operations, which layers are made of; and gradient descent, which allows your network to learn from its training examples.", "words": [{"w": "This", "b": [0.1294, 0.149, 0.1743, 0.1687]}, {"w": "concludes", "b": [0.1806, 0.149, 0.2814, 0.1687]}, {"w": "our", "b": [0.2878, 0.149, 0.3214, 0.1687]}, {"w": "first", "b": [0.3277, 0.149, 0.3683, 0.1687]}, {"w": "example—you", "b": [0.3746, 0.149, 0.5232, 0.1687]}, {"w": "just", "b": [0.5295, 0.149, 0.5659, 0.1687]}, {"w": "saw", "b": [0.5722, 0.149, 0.6115, 0.1687]}, {"w": "how", "b": [0.6178, 0.149, 0.6612, 0.1687]}, {"w": "you", "b": [0.6675, 0.149, 0.7053, 0.1687]}, {"w": "can", "b": [0.7116, 0.149, 0.7467, 0.1687]}, {"w": "build", "b": [0.753, 0.149, 0.8048, 0.1687]}, {"w": "and", "b": [0.8111, 0.149, 0.8476, 0.1687]}, {"w": "train", "b": [0.1294, 0.1695, 0.1757, 0.1892]}, {"w": "a", "b": [0.182, 0.1695, 0.1932, 0.1892]}, {"w": "neural", "b": [0.1995, 0.1695, 0.2625, 0.1892]}, {"w": "network", "b": [0.2688, 0.1695, 0.3515, 0.1892]}, {"w": "to", "b": [0.3578, 0.1695, 0.3774, 0.1892]}, {"w": "classify", "b": [0.3837, 0.1695, 0.4608, 0.1892]}, {"w": "handwritten", "b": [0.4671, 0.1695, 0.5876, 0.1892]}, {"w": "digits", "b": [0.5939, 0.1695, 0.65, 0.1892]}, {"w": "in", "b": [0.6562, 0.1695, 0.6758, 0.1892]}, {"w": "less", "b": [0.6821, 0.1695, 0.72, 0.1892]}, {"w": "than", "b": [0.7263, 0.1695, 0.7697, 0.1892]}, {"w": "20", "b": [0.776, 0.1695, 0.8012, 0.1892]}, {"w": "lines", "b": [0.8076, 0.1695, 0.8552, 0.1892]}, {"w": "of", "b": [0.1294, 0.19, 0.1504, 0.2097]}, {"w": "Python", "b": [0.1567, 0.19, 0.2282, 0.2097]}, {"w": "code.", "b": [0.2345, 0.19, 0.2885, 0.2097]}, {"w": "In", "b": [0.2948, 0.19, 0.3158, 0.2097]}, {"w": "the", "b": [0.3221, 0.19, 0.3529, 0.2097]}, {"w": "next", "b": [0.3592, 0.19, 0.4027, 0.2097]}, {"w": "chapter,", "b": [0.409, 0.19, 0.4885, 0.2097]}, {"w": "I’ll", "b": [0.4948, 0.19, 0.5256, 0.2097]}, {"w": "go", "b": [0.5319, 0.19, 0.5571, 0.2097]}, {"w": "into", "b": [0.5634, 0.19, 0.6027, 0.2097]}, {"w": "detail", "b": [0.609, 0.19, 0.665, 0.2097]}, {"w": "about", "b": [0.6713, 0.19, 0.7274, 0.2097]}, {"w": "every", "b": [0.7337, 0.19, 0.7897, 0.2097]}, {"w": "moving", "b": [0.1294, 0.2105, 0.2065, 0.2302]}, {"w": "piece", "b": [0.2128, 0.2105, 0.266, 0.2302]}, {"w": "we", "b": [0.2723, 0.2105, 0.3018, 0.2302]}, {"w": "just", "b": [0.3081, 0.2105, 0.3445, 0.2302]}, {"w": "previewed", "b": [0.3508, 0.2105, 0.4559, 0.2302]}, {"w": "and", "b": [0.4621, 0.2105, 0.4986, 0.2302]}, {"w": "clarify", "b": [0.5049, 0.2105, 0.5707, 0.2302]}, {"w": "what’s", "b": [0.577, 0.2105, 0.6429, 0.2302]}, {"w": "going", "b": [0.6492, 0.2105, 0.7066, 0.2302]}, {"w": "on", "b": [0.7129, 0.2105, 0.7382, 0.2302]}, {"w": "behind", "b": [0.7445, 0.2105, 0.8131, 0.2302]}, {"w": "the", "b": [0.8194, 0.2105, 0.8503, 0.2302]}, {"w": "scenes.", "b": [0.1294, 0.231, 0.2016, 0.2507]}, {"w": "You’ll", "b": [0.2079, 0.231, 0.2712, 0.2507]}, {"w": "learn", "b": [0.2775, 0.231, 0.3279, 0.2507]}, {"w": "about", "b": [0.3342, 0.231, 0.3903, 0.2507]}, {"w": "tensors,", "b": [0.3966, 0.231, 0.4744, 0.2507]}, {"w": "the", "b": [0.4807, 0.231, 0.5115, 0.2507]}, {"w": "data-storing", "b": [0.5178, 0.231, 0.6383, 0.2507]}, {"w": "objects", "b": [0.6446, 0.231, 0.7161, 0.2507]}, {"w": "going", "b": [0.7224, 0.231, 0.7799, 0.2507]}, {"w": "into", "b": [0.7862, 0.231, 0.8254, 0.2507]}, {"w": "the", "b": [0.8317, 0.231, 0.8625, 0.2507]}, {"w": "network;", "b": [0.1294, 0.2515, 0.2191, 0.2712]}, {"w": "tensor", "b": [0.2254, 0.2515, 0.287, 0.2712]}, {"w": "operations,", "b": [0.2933, 0.2515, 0.4047, 0.2712]}, {"w": "which", "b": [0.411, 0.2515, 0.4727, 0.2712]}, {"w": "layers", "b": [0.479, 0.2515, 0.5392, 0.2712]}, {"w": "are", "b": [0.5456, 0.2515, 0.5764, 0.2712]}, {"w": "made", "b": [0.5827, 0.2515, 0.6373, 0.2712]}, {"w": "of;", "b": [0.6436, 0.2515, 0.6716, 0.2712]}, {"w": "and", "b": [0.6779, 0.2515, 0.7144, 0.2712]}, {"w": "gradient", "b": [0.7207, 0.2515, 0.8033, 0.2712]}, {"w": "descent,", "b": [0.1294, 0.272, 0.2114, 0.2917]}, {"w": "which", "b": [0.2177, 0.272, 0.2793, 0.2917]}, {"w": "allows", "b": [0.2856, 0.272, 0.3515, 0.2917]}, {"w": "your", "b": [0.3578, 0.272, 0.404, 0.2917]}, {"w": "network", "b": [0.4104, 0.272, 0.493, 0.2917]}, {"w": "to", "b": [0.4993, 0.272, 0.5189, 0.2917]}, {"w": "learn", "b": [0.5253, 0.272, 0.5757, 0.2917]}, {"w": "from", "b": [0.582, 0.272, 0.631, 0.2917]}, {"w": "its", "b": [0.6373, 0.272, 0.6612, 0.2917]}, {"w": "training", "b": [0.6675, 0.272, 0.746, 0.2917]}, {"w": "examples.", "b": [0.7523, 0.272, 0.8538, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "2.2. Data representations for neural networks", "words": [{"w": "2.2.", "b": [0.1294, 0.3288, 0.172, 0.351]}, {"w": "Data", "b": [0.1791, 0.3288, 0.2374, 0.351]}, {"w": "representations", "b": [0.2445, 0.3288, 0.431, 0.351]}, {"w": "for", "b": [0.4381, 0.3288, 0.4744, 0.351]}, {"w": "neural", "b": [0.4815, 0.3288, 0.5603, 0.351]}, {"w": "networks", "b": [0.5674, 0.3288, 0.6793, 0.351]}]}, {"id": "b_3", "type": "paragraph", "text": "In the previous example, we started from data stored in multidimensional Numpy arrays, also called tensors. In general, all current machine- learning systems use tensors as their basic data structure. Tensors are fundamental to the field—so fundamental that Google’s TensorFlow was named after them. So what’s a tensor?", "words": [{"w": "In", "b": [0.1294, 0.3745, 0.1504, 0.3942]}, {"w": "the", "b": [0.1567, 0.3745, 0.1876, 0.3942]}, {"w": "previous", "b": [0.1939, 0.3745, 0.2807, 0.3942]}, {"w": "example,", "b": [0.287, 0.3745, 0.3788, 0.3942]}, {"w": "we", "b": [0.3851, 0.3745, 0.4145, 0.3942]}, {"w": "started", "b": [0.4208, 0.3745, 0.4881, 0.3942]}, {"w": "from", "b": [0.4944, 0.3745, 0.5434, 0.3942]}, {"w": "data", "b": [0.5497, 0.3745, 0.5918, 0.3942]}, {"w": "stored", "b": [0.5981, 0.3745, 0.6597, 0.3942]}, {"w": "in", "b": [0.666, 0.3745, 0.6857, 0.3942]}, {"w": "multidimensional", "b": [0.692, 0.3745, 0.8686, 0.3942]}, {"w": "Numpy", "b": [0.1294, 0.395, 0.2051, 0.4147]}, {"w": "arrays,", "b": [0.2114, 0.395, 0.2793, 0.4147]}, {"w": "also", "b": [0.2856, 0.395, 0.3263, 0.4147]}, {"w": "called", "b": [0.3326, 0.395, 0.3928, 0.4147]}, {"w": "tensors.", "b": [0.3991, 0.395, 0.4783, 0.4147]}, {"w": "In", "b": [0.4846, 0.395, 0.5056, 0.4147]}, {"w": "general,", "b": [0.5119, 0.395, 0.5924, 0.4147]}, {"w": "all", "b": [0.5988, 0.395, 0.624, 0.4147]}, {"w": "current", "b": [0.6303, 0.395, 0.7017, 0.4147]}, {"w": "machine-", "b": [0.708, 0.395, 0.8019, 0.4147]}, {"w": "learning", "b": [0.1294, 0.4155, 0.2121, 0.4352]}, {"w": "systems", "b": [0.2184, 0.4155, 0.2983, 0.4352]}, {"w": "use", "b": [0.3046, 0.4155, 0.3382, 0.4352]}, {"w": "tensors", "b": [0.3445, 0.4155, 0.416, 0.4352]}, {"w": "as", "b": [0.4223, 0.4155, 0.4433, 0.4352]}, {"w": "their", "b": [0.4496, 0.4155, 0.4958, 0.4352]}, {"w": "basic", "b": [0.5021, 0.4155, 0.554, 0.4352]}, {"w": "data", "b": [0.5603, 0.4155, 0.6023, 0.4352]}, {"w": "structure.", "b": [0.6086, 0.4155, 0.7032, 0.4352]}, {"w": "Tensors", "b": [0.7095, 0.4155, 0.7875, 0.4352]}, {"w": "are", "b": [0.7939, 0.4155, 0.8247, 0.4352]}, {"w": "fundamental", "b": [0.1294, 0.436, 0.2555, 0.4557]}, {"w": "to", "b": [0.2618, 0.436, 0.2814, 0.4557]}, {"w": "the", "b": [0.2878, 0.436, 0.3186, 0.4557]}, {"w": "field—so", "b": [0.3248, 0.436, 0.4187, 0.4557]}, {"w": "fundamental", "b": [0.425, 0.436, 0.5511, 0.4557]}, {"w": "that", "b": [0.5574, 0.436, 0.5953, 0.4557]}, {"w": "Google’s", "b": [0.6016, 0.436, 0.6926, 0.4557]}, {"w": "TensorFlow", "b": [0.6989, 0.436, 0.8191, 0.4557]}, {"w": "was", "b": [0.8254, 0.436, 0.8646, 0.4557]}, {"w": "named", "b": [0.1294, 0.4565, 0.1967, 0.4762]}, {"w": "after", "b": [0.203, 0.4565, 0.2492, 0.4762]}, {"w": "them.", "b": [0.2555, 0.4565, 0.3122, 0.4762]}, {"w": "So", "b": [0.3186, 0.4565, 0.3452, 0.4762]}, {"w": "what’s", "b": [0.3515, 0.4565, 0.4173, 0.4762]}, {"w": "a", "b": [0.4236, 0.4565, 0.4348, 0.4762]}, {"w": "tensor?", "b": [0.4411, 0.4565, 0.514, 0.4762]}]}, {"id": "b_4", "type": "paragraph", "text": "At its core, a tensor is a container for data—almost always numerical data. So, it’s a container for numbers. You may be already familiar with matrices, which are 2D tensors: tensors are a generalization of matrices to an arbitrary number of dimensions (note that in the context of tensors, a dimension is often called an axis).", "words": [{"w": "At", "b": [0.1294, 0.4992, 0.1546, 0.519]}, {"w": "its", "b": [0.1609, 0.4992, 0.1848, 0.519]}, {"w": "core,", "b": [0.1911, 0.4992, 0.2408, 0.519]}, {"w": "a", "b": [0.2471, 0.4992, 0.2583, 0.519]}, {"w": "tensor", "b": [0.2646, 0.4992, 0.3263, 0.519]}, {"w": "is", "b": [0.3326, 0.4992, 0.3494, 0.519]}, {"w": "a", "b": [0.3557, 0.4992, 0.3669, 0.519]}, {"w": "container", "b": [0.3732, 0.4992, 0.4671, 0.519]}, {"w": "for", "b": [0.4734, 0.4992, 0.5028, 0.519]}, {"w": "data—almost", "b": [0.5091, 0.4992, 0.6436, 0.519]}, {"w": "always", "b": [0.6499, 0.4992, 0.72, 0.519]}, {"w": "numerical", "b": [0.7263, 0.4992, 0.8272, 0.519]}, {"w": "data.", "b": [0.1294, 0.5197, 0.1777, 0.5395]}, {"w": "So,", "b": [0.1841, 0.5197, 0.217, 0.5395]}, {"w": "it’s", "b": [0.2233, 0.5197, 0.2541, 0.5395]}, {"w": "a", "b": [0.2604, 0.5197, 0.2716, 0.5395]}, {"w": "container", "b": [0.2779, 0.5197, 0.3718, 0.5395]}, {"w": "for", "b": [0.3781, 0.5197, 0.4075, 0.5395]}, {"w": "numbers.", "b": [0.4138, 0.5197, 0.507, 0.5395]}, {"w": "You", "b": [0.5133, 0.5197, 0.5542, 0.5395]}, {"w": "may", "b": [0.5605, 0.5197, 0.604, 0.5395]}, {"w": "be", "b": [0.6103, 0.5197, 0.6341, 0.5395]}, {"w": "already", "b": [0.6404, 0.5197, 0.7146, 0.5395]}, {"w": "familiar", "b": [0.7209, 0.5197, 0.8008, 0.5395]}, {"w": "with", "b": [0.8071, 0.5197, 0.8519, 0.5395]}, {"w": "matrices,", "b": [0.1294, 0.5402, 0.2212, 0.56]}, {"w": "which", "b": [0.2275, 0.5402, 0.2891, 0.56]}, {"w": "are", "b": [0.2954, 0.5402, 0.3262, 0.56]}, {"w": "2D", "b": [0.3326, 0.5402, 0.3634, 0.56]}, {"w": "tensors:", "b": [0.3697, 0.5402, 0.4482, 0.56]}, {"w": "tensors", "b": [0.4545, 0.5402, 0.5259, 0.56]}, {"w": "are", "b": [0.5322, 0.5402, 0.563, 0.56]}, {"w": "a", "b": [0.5693, 0.5402, 0.5805, 0.56]}, {"w": "generalization", "b": [0.5869, 0.5402, 0.7298, 0.56]}, {"w": "of", "b": [0.7361, 0.5402, 0.7571, 0.56]}, {"w": "matrices", "b": [0.7634, 0.5402, 0.8489, 0.56]}, {"w": "to", "b": [0.1294, 0.5607, 0.149, 0.5805]}, {"w": "an", "b": [0.1553, 0.5607, 0.1792, 0.5805]}, {"w": "arbitrary", "b": [0.1855, 0.5607, 0.2723, 0.5805]}, {"w": "number", "b": [0.2786, 0.5607, 0.3557, 0.5805]}, {"w": "of", "b": [0.362, 0.5607, 0.383, 0.5805]}, {"w": "dimensions", "b": [0.3893, 0.5607, 0.5042, 0.5805]}, {"w": "(note", "b": [0.5105, 0.5607, 0.5623, 0.5805]}, {"w": "that", "b": [0.5686, 0.5607, 0.6065, 0.5805]}, {"w": "in", "b": [0.6128, 0.5607, 0.6324, 0.5805]}, {"w": "the", "b": [0.6387, 0.5607, 0.6695, 0.5805]}, {"w": "context", "b": [0.6759, 0.5607, 0.7501, 0.5805]}, {"w": "of", "b": [0.7564, 0.5607, 0.7774, 0.5805]}, {"w": "tensors,", "b": [0.7837, 0.5607, 0.8615, 0.5805]}, {"w": "a", "b": [0.1294, 0.5812, 0.1406, 0.601]}, {"w": "dimension", "b": [0.1469, 0.5812, 0.2506, 0.601]}, {"w": "is", "b": [0.2569, 0.5812, 0.2737, 0.601]}, {"w": "often", "b": [0.28, 0.5812, 0.3319, 0.601]}, {"w": "called", "b": [0.3382, 0.5812, 0.3984, 0.601]}, {"w": "an", "b": [0.4047, 0.5812, 0.4285, 0.601]}, {"w": "axis).", "b": [0.4348, 0.5812, 0.4901, 0.601]}]}, {"id": "b_5", "type": "paragraph", "text": "2.2.1. Scalars (0D tensors)", "words": [{"w": "2.2.1.", "b": [0.1294, 0.6285, 0.1862, 0.6482]}, {"w": "Scalars", "b": [0.1925, 0.6285, 0.271, 0.6482]}, {"w": "(0D", "b": [0.2773, 0.6285, 0.3165, 0.6482]}, {"w": "tensors)", "b": [0.3228, 0.6285, 0.4083, 0.6482]}]}, {"id": "b_6", "type": "paragraph", "text": "A tensor that contains only one number is called a scalar (or scalar tensor, or 0-dimensional tensor, or 0D tensor). In Numpy, a float32 or float64 number is a scalar tensor (or scalar array). You can display the number of axes of a Numpy tensor via the ndim attribute; a scalar tensor has 0 axes (ndim == 0). The number of axes of a tensor is also called its rank. Here’s a Numpy scalar:", "words": [{"w": "A", "b": [0.1294, 0.6713, 0.1476, 0.691]}, {"w": "tensor", "b": [0.1539, 0.6713, 0.2156, 0.691]}, {"w": "that", "b": [0.2219, 0.6713, 0.2597, 0.691]}, {"w": "contains", "b": [0.266, 0.6713, 0.3501, 0.691]}, {"w": "only", "b": [0.3564, 0.6713, 0.4013, 0.691]}, {"w": "one", "b": [0.4076, 0.6713, 0.444, 0.691]}, {"w": "number", "b": [0.4503, 0.6713, 0.5274, 0.691]}, {"w": "is", "b": [0.5337, 0.6713, 0.5505, 0.691]}, {"w": "called", "b": [0.5568, 0.6713, 0.6171, 0.691]}, {"w": "a", "b": [0.6234, 0.6713, 0.6346, 0.691]}, {"w": "scalar", "b": [0.6408, 0.6713, 0.7038, 0.691]}, {"w": "(or", "b": [0.7102, 0.6713, 0.7396, 0.691]}, {"w": "scalar", "b": [0.7459, 0.6713, 0.8047, 0.691]}, {"w": "tensor,", "b": [0.1294, 0.6918, 0.1964, 0.7115]}, {"w": "or", "b": [0.2027, 0.6918, 0.2237, 0.7115]}, {"w": "0-dimensional", "b": [0.23, 0.6918, 0.3743, 0.7115]}, {"w": "tensor,", "b": [0.3806, 0.6918, 0.4476, 0.7115]}, {"w": "or", "b": [0.4539, 0.6918, 0.4749, 0.7115]}, {"w": "0D", "b": [0.4812, 0.6918, 0.512, 0.7115]}, {"w": "tensor).", "b": [0.5183, 0.6918, 0.5947, 0.7115]}, {"w": "In", "b": [0.601, 0.6918, 0.622, 0.7115]}, {"w": "Numpy,", "b": [0.6283, 0.6918, 0.7086, 0.7115]}, {"w": "a", "b": [0.715, 0.6918, 0.7262, 0.7115]}, {"w": "float32", "b": [0.7324, 0.6928, 0.8384, 0.713]}, {"w": "or", "b": [0.8447, 0.6918, 0.8657, 0.7115]}, {"w": "float64", "b": [0.1294, 0.7142, 0.2354, 0.7344]}, {"w": "number", "b": [0.2417, 0.7132, 0.3187, 0.7329]}, {"w": "is", "b": [0.325, 0.7132, 0.3419, 0.7329]}, {"w": "a", "b": [0.3482, 0.7132, 0.3594, 0.7329]}, {"w": "scalar", "b": [0.3657, 0.7132, 0.4245, 0.7329]}, {"w": "tensor", "b": [0.4308, 0.7132, 0.4925, 0.7329]}, {"w": "(or", "b": [0.4988, 0.7132, 0.5282, 0.7329]}, {"w": "scalar", "b": [0.5345, 0.7132, 0.5933, 0.7329]}, {"w": "array).", "b": [0.5996, 0.7132, 0.6661, 0.7329]}, {"w": "You", "b": [0.6724, 0.7132, 0.7133, 0.7329]}, {"w": "can", "b": [0.7196, 0.7132, 0.7546, 0.7329]}, {"w": "display", "b": [0.7609, 0.7132, 0.8338, 0.7329]}, {"w": "the", "b": [0.1294, 0.7346, 0.1602, 0.7543]}, {"w": "number", "b": [0.1665, 0.7346, 0.2436, 0.7543]}, {"w": "of", "b": [0.2499, 0.7346, 0.2709, 0.7543]}, {"w": "axes", "b": [0.2772, 0.7346, 0.3221, 0.7543]}, {"w": "of", "b": [0.3284, 0.7346, 0.3494, 0.7543]}, {"w": "a", "b": [0.3557, 0.7346, 0.3669, 0.7543]}, {"w": "Numpy", "b": [0.3732, 0.7346, 0.4489, 0.7543]}, {"w": "tensor", "b": [0.4552, 0.7346, 0.5168, 0.7543]}, {"w": "via", "b": [0.5231, 0.7346, 0.554, 0.7543]}, {"w": "the", "b": [0.5603, 0.7346, 0.5911, 0.7543]}, {"w": "ndim", "b": [0.5973, 0.7356, 0.6579, 0.7558]}, {"w": "attribute;", "b": [0.6642, 0.7346, 0.7553, 0.7543]}, {"w": "a", "b": [0.7616, 0.7346, 0.7728, 0.7543]}, {"w": "scalar", "b": [0.7791, 0.7346, 0.8379, 0.7543]}, {"w": "tensor", "b": [0.1294, 0.7559, 0.1911, 0.7757]}, {"w": "has", "b": [0.1974, 0.7559, 0.231, 0.7757]}, {"w": "0", "b": [0.2373, 0.7559, 0.2499, 0.7757]}, {"w": "axes", "b": [0.2562, 0.7559, 0.301, 0.7757]}, {"w": "(ndim", "b": [0.3074, 0.7559, 0.3763, 0.7772]}, {"w": "==", "b": [0.3914, 0.757, 0.4217, 0.7772]}, {"w": "0).", "b": [0.4368, 0.7559, 0.4667, 0.7772]}, {"w": "The", "b": [0.473, 0.7559, 0.5122, 0.7757]}, {"w": "number", "b": [0.5185, 0.7559, 0.5956, 0.7757]}, {"w": "of", "b": [0.6019, 0.7559, 0.6229, 0.7757]}, {"w": "axes", "b": [0.6292, 0.7559, 0.674, 0.7757]}, {"w": "of", "b": [0.6804, 0.7559, 0.7014, 0.7757]}, {"w": "a", "b": [0.7077, 0.7559, 0.7189, 0.7757]}, {"w": "tensor", "b": [0.7252, 0.7559, 0.7868, 0.7757]}, {"w": "is", "b": [0.7931, 0.7559, 0.81, 0.7757]}, {"w": "also", "b": [0.8163, 0.7559, 0.8569, 0.7757]}, {"w": "called", "b": [0.1294, 0.7773, 0.1897, 0.7971]}, {"w": "its", "b": [0.196, 0.7773, 0.2198, 0.7971]}, {"w": "rank.", "b": [0.2261, 0.7773, 0.2786, 0.7971]}, {"w": "Here’s", "b": [0.2849, 0.7773, 0.3508, 0.7971]}, {"w": "a", "b": [0.3571, 0.7773, 0.3683, 0.7971]}, {"w": "Numpy", "b": [0.3746, 0.7773, 0.4502, 0.7971]}, {"w": "scalar:", "b": [0.4566, 0.7773, 0.5224, 0.7971]}]}, {"id": "b_7", "type": "equation", "text": ">>> import numpy as np >>> x = np.array(12) >>> x array(12) >>> x.ndim 0", "words": [{"w": ">>>", "b": [0.1357, 0.8151, 0.1698, 0.8302]}, {"w": "import", "b": [0.1811, 0.8151, 0.2492, 0.8302]}, {"w": "numpy", "b": [0.2606, 0.8151, 0.3173, 0.8302]}, {"w": "as", "b": [0.3287, 0.8151, 0.3514, 0.8302]}, {"w": "np", "b": [0.3628, 0.8151, 0.3855, 0.8302]}, {"w": ">>>", "b": [0.1357, 0.8302, 0.1698, 0.8454]}, {"w": "x", "b": [0.1811, 0.8302, 0.1925, 0.8454]}, {"w": "=", "b": [0.2038, 0.8302, 0.2152, 0.8454]}, {"w": "np.array(12)", "b": [0.2265, 0.8302, 0.3628, 0.8454]}, {"w": ">>>", "b": [0.1357, 0.8454, 0.1698, 0.8605]}, {"w": "x", "b": [0.1811, 0.8454, 0.1925, 0.8605]}, {"w": "array(12)", "b": [0.1357, 0.8605, 0.2379, 0.8757]}, {"w": ">>>", "b": [0.1357, 0.8757, 0.1698, 0.8908]}, {"w": "x.ndim", "b": [0.1811, 0.8757, 0.2492, 0.8908]}, {"w": "0", "b": [0.1357, 0.8908, 0.1471, 0.906]}]}]}, {"page": 64, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2.2.2. Vectors (1D tensors)", "words": [{"w": "2.2.2.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Vectors", "b": [0.1925, 0.0857, 0.2728, 0.1054]}, {"w": "(1D", "b": [0.2791, 0.0857, 0.3183, 0.1054]}, {"w": "tensors)", "b": [0.3246, 0.0857, 0.4101, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "An array of numbers is called a vector, or 1D tensor. A 1D tensor is said to have exactly one axis. Following is a Numpy vector:", "words": [{"w": "An", "b": [0.1294, 0.1285, 0.1602, 0.1482]}, {"w": "array", "b": [0.1665, 0.1285, 0.2184, 0.1482]}, {"w": "of", "b": [0.2247, 0.1285, 0.2457, 0.1482]}, {"w": "numbers", "b": [0.252, 0.1285, 0.3389, 0.1482]}, {"w": "is", "b": [0.3452, 0.1285, 0.362, 0.1482]}, {"w": "called", "b": [0.3683, 0.1285, 0.4285, 0.1482]}, {"w": "a", "b": [0.4348, 0.1285, 0.446, 0.1482]}, {"w": "vector,", "b": [0.4523, 0.1285, 0.5217, 0.1482]}, {"w": "or", "b": [0.528, 0.1285, 0.549, 0.1482]}, {"w": "1D", "b": [0.5553, 0.1285, 0.5861, 0.1482]}, {"w": "tensor.", "b": [0.5924, 0.1285, 0.659, 0.1482]}, {"w": "A", "b": [0.6653, 0.1285, 0.6835, 0.1482]}, {"w": "1D", "b": [0.6898, 0.1285, 0.7206, 0.1482]}, {"w": "tensor", "b": [0.7269, 0.1285, 0.7886, 0.1482]}, {"w": "is", "b": [0.7949, 0.1285, 0.8117, 0.1482]}, {"w": "said", "b": [0.818, 0.1285, 0.8587, 0.1482]}, {"w": "to", "b": [0.1294, 0.149, 0.149, 0.1687]}, {"w": "have", "b": [0.1553, 0.149, 0.203, 0.1687]}, {"w": "exactly", "b": [0.2093, 0.149, 0.2821, 0.1687]}, {"w": "one", "b": [0.2884, 0.149, 0.3249, 0.1687]}, {"w": "axis.", "b": [0.3312, 0.149, 0.3781, 0.1687]}, {"w": "Following", "b": [0.3844, 0.149, 0.4881, 0.1687]}, {"w": "is", "b": [0.4945, 0.149, 0.5113, 0.1687]}, {"w": "a", "b": [0.5176, 0.149, 0.5288, 0.1687]}, {"w": "Numpy", "b": [0.5351, 0.149, 0.6108, 0.1687]}, {"w": "vector:", "b": [0.6171, 0.149, 0.6871, 0.1687]}]}, {"id": "b_2", "type": "equation", "text": ">>> x = np.array([12, 3, 6, 14]) >>> x array([12, 3, 6, 14]) >>> x.ndim 1", "words": [{"w": ">>>", "b": [0.1357, 0.1867, 0.1698, 0.2018]}, {"w": "x", "b": [0.1811, 0.1867, 0.1925, 0.2018]}, {"w": "=", "b": [0.2038, 0.1867, 0.2152, 0.2018]}, {"w": "np.array([12,", "b": [0.2265, 0.1867, 0.3741, 0.2018]}, {"w": "3,", "b": [0.3855, 0.1867, 0.4082, 0.2018]}, {"w": "6,", "b": [0.4195, 0.1867, 0.4422, 0.2018]}, {"w": "14])", "b": [0.4536, 0.1867, 0.499, 0.2018]}, {"w": ">>>", "b": [0.1357, 0.2018, 0.1698, 0.217]}, {"w": "x", "b": [0.1811, 0.2018, 0.1925, 0.217]}, {"w": "array([12,", "b": [0.1357, 0.217, 0.2492, 0.2321]}, {"w": "3,", "b": [0.2606, 0.217, 0.2833, 0.2321]}, {"w": "6,", "b": [0.2946, 0.217, 0.3173, 0.2321]}, {"w": "14])", "b": [0.3287, 0.217, 0.3741, 0.2321]}, {"w": ">>>", "b": [0.1357, 0.2322, 0.1698, 0.2473]}, {"w": "x.ndim", "b": [0.1811, 0.2322, 0.2492, 0.2473]}, {"w": "1", "b": [0.1357, 0.2473, 0.1471, 0.2624]}]}, {"id": "b_3", "type": "paragraph", "text": "This vector has five entries and so is called a 5-dimensional vector. Don’t confuse a 5D vector with a 5D tensor! A 5D vector has only one axis and has five dimensions along its axis, whereas a 5D tensor has five axes (and may have any number of dimensions along each axis). Dimensionality can denote either the number of entries along a specific axis (as in the case of our 5D vector) or the number of axes in a tensor (such as a 5D tensor), which can be confusing at times. In the latter case, it’s technically more correct to talk about a tensor of rank 5 (the rank of a tensor being the number of axes), but the ambiguous notation 5D tensor is common regardless.", "words": [{"w": "This", "b": [0.1294, 0.2853, 0.1743, 0.3051]}, {"w": "vector", "b": [0.1806, 0.2853, 0.2436, 0.3051]}, {"w": "has", "b": [0.2499, 0.2853, 0.2835, 0.3051]}, {"w": "five", "b": [0.2898, 0.2853, 0.3291, 0.3051]}, {"w": "entries", "b": [0.3354, 0.2853, 0.4026, 0.3051]}, {"w": "and", "b": [0.4089, 0.2853, 0.4454, 0.3051]}, {"w": "so", "b": [0.4517, 0.2853, 0.4741, 0.3051]}, {"w": "is", "b": [0.4804, 0.2853, 0.4972, 0.3051]}, {"w": "called", "b": [0.5035, 0.2853, 0.5638, 0.3051]}, {"w": "a", "b": [0.5701, 0.2853, 0.5813, 0.3051]}, {"w": "5-dimensional", "b": [0.5875, 0.2853, 0.7319, 0.3051]}, {"w": "vector.", "b": [0.7382, 0.2853, 0.8075, 0.3051]}, {"w": "Don’t", "b": [0.1294, 0.3058, 0.1878, 0.3256]}, {"w": "confuse", "b": [0.1941, 0.3058, 0.2726, 0.3256]}, {"w": "a", "b": [0.2789, 0.3058, 0.2901, 0.3256]}, {"w": "5D", "b": [0.2964, 0.3058, 0.3272, 0.3256]}, {"w": "vector", "b": [0.3335, 0.3058, 0.3966, 0.3256]}, {"w": "with", "b": [0.4029, 0.3058, 0.4477, 0.3256]}, {"w": "a", "b": [0.454, 0.3058, 0.4652, 0.3256]}, {"w": "5D", "b": [0.4715, 0.3058, 0.5024, 0.3256]}, {"w": "tensor!", "b": [0.5087, 0.3058, 0.5787, 0.3256]}, {"w": "A", "b": [0.585, 0.3058, 0.6032, 0.3256]}, {"w": "5D", "b": [0.6095, 0.3058, 0.6404, 0.3256]}, {"w": "vector", "b": [0.6467, 0.3058, 0.7097, 0.3256]}, {"w": "has", "b": [0.716, 0.3058, 0.7496, 0.3256]}, {"w": "only", "b": [0.7559, 0.3058, 0.8008, 0.3256]}, {"w": "one", "b": [0.8071, 0.3058, 0.8435, 0.3256]}, {"w": "axis", "b": [0.1294, 0.3263, 0.1701, 0.3461]}, {"w": "and", "b": [0.1764, 0.3263, 0.2128, 0.3461]}, {"w": "has", "b": [0.2191, 0.3263, 0.2527, 0.3461]}, {"w": "five", "b": [0.259, 0.3263, 0.2982, 0.3461]}, {"w": "dimensions", "b": [0.3046, 0.3263, 0.4195, 0.3461]}, {"w": "along", "b": [0.4258, 0.3263, 0.4818, 0.3461]}, {"w": "its", "b": [0.4881, 0.3263, 0.512, 0.3461]}, {"w": "axis,", "b": [0.5183, 0.3263, 0.5652, 0.3461]}, {"w": "whereas", "b": [0.5715, 0.3263, 0.6542, 0.3461]}, {"w": "a", "b": [0.6604, 0.3263, 0.6716, 0.3461]}, {"w": "5D", "b": [0.6779, 0.3263, 0.7088, 0.3461]}, {"w": "tensor", "b": [0.7151, 0.3263, 0.7767, 0.3461]}, {"w": "has", "b": [0.783, 0.3263, 0.8167, 0.3461]}, {"w": "five", "b": [0.823, 0.3263, 0.8622, 0.3461]}, {"w": "axes", "b": [0.1294, 0.3468, 0.1742, 0.3666]}, {"w": "(and", "b": [0.1805, 0.3468, 0.2254, 0.3666]}, {"w": "may", "b": [0.2317, 0.3468, 0.2751, 0.3666]}, {"w": "have", "b": [0.2814, 0.3468, 0.329, 0.3666]}, {"w": "any", "b": [0.3354, 0.3468, 0.3718, 0.3666]}, {"w": "number", "b": [0.3781, 0.3468, 0.4552, 0.3666]}, {"w": "of", "b": [0.4615, 0.3468, 0.4825, 0.3666]}, {"w": "dimensions", "b": [0.4888, 0.3468, 0.6037, 0.3666]}, {"w": "along", "b": [0.61, 0.3468, 0.6661, 0.3666]}, {"w": "each", "b": [0.6724, 0.3468, 0.7186, 0.3666]}, {"w": "axis).", "b": [0.7249, 0.3468, 0.7802, 0.3666]}, {"w": "Dimensionality", "b": [0.1294, 0.3673, 0.2836, 0.3871]}, {"w": "can", "b": [0.2899, 0.3673, 0.3249, 0.3871]}, {"w": "denote", "b": [0.3312, 0.3673, 0.3984, 0.3871]}, {"w": "either", "b": [0.4047, 0.3673, 0.4622, 0.3871]}, {"w": "the", "b": [0.4685, 0.3673, 0.4993, 0.3871]}, {"w": "number", "b": [0.5056, 0.3673, 0.5827, 0.3871]}, {"w": "of", "b": [0.589, 0.3673, 0.61, 0.3871]}, {"w": "entries", "b": [0.6163, 0.3673, 0.6836, 0.3871]}, {"w": "along", "b": [0.6899, 0.3673, 0.7459, 0.3871]}, {"w": "a", "b": [0.7522, 0.3673, 0.7634, 0.3871]}, {"w": "specific", "b": [0.7697, 0.3673, 0.8482, 0.3871]}, {"w": "axis", "b": [0.1294, 0.3878, 0.1701, 0.4076]}, {"w": "(as", "b": [0.1764, 0.3878, 0.2058, 0.4076]}, {"w": "in", "b": [0.2121, 0.3878, 0.2317, 0.4076]}, {"w": "the", "b": [0.238, 0.3878, 0.2688, 0.4076]}, {"w": "case", "b": [0.2751, 0.3878, 0.3186, 0.4076]}, {"w": "of", "b": [0.3249, 0.3878, 0.3459, 0.4076]}, {"w": "our", "b": [0.3522, 0.3878, 0.3858, 0.4076]}, {"w": "5D", "b": [0.3921, 0.3878, 0.4229, 0.4076]}, {"w": "vector)", "b": [0.4292, 0.3878, 0.5007, 0.4076]}, {"w": "or", "b": [0.507, 0.3878, 0.528, 0.4076]}, {"w": "the", "b": [0.5343, 0.3878, 0.5651, 0.4076]}, {"w": "number", "b": [0.5714, 0.3878, 0.6485, 0.4076]}, {"w": "of", "b": [0.6548, 0.3878, 0.6758, 0.4076]}, {"w": "axes", "b": [0.6821, 0.3878, 0.727, 0.4076]}, {"w": "in", "b": [0.7333, 0.3878, 0.7529, 0.4076]}, {"w": "a", "b": [0.7591, 0.3878, 0.7703, 0.4076]}, {"w": "tensor", "b": [0.7766, 0.3878, 0.8383, 0.4076]}, {"w": "(such", "b": [0.1294, 0.4083, 0.1841, 0.4281]}, {"w": "as", "b": [0.1904, 0.4083, 0.2114, 0.4281]}, {"w": "a", "b": [0.2177, 0.4083, 0.2289, 0.4281]}, {"w": "5D", "b": [0.2352, 0.4083, 0.266, 0.4281]}, {"w": "tensor),", "b": [0.2723, 0.4083, 0.3487, 0.4281]}, {"w": "which", "b": [0.355, 0.4083, 0.4166, 0.4281]}, {"w": "can", "b": [0.4229, 0.4083, 0.458, 0.4281]}, {"w": "be", "b": [0.4643, 0.4083, 0.4881, 0.4281]}, {"w": "confusing", "b": [0.4944, 0.4083, 0.5939, 0.4281]}, {"w": "at", "b": [0.6002, 0.4083, 0.6184, 0.4281]}, {"w": "times.", "b": [0.6247, 0.4083, 0.6857, 0.4281]}, {"w": "In", "b": [0.692, 0.4083, 0.713, 0.4281]}, {"w": "the", "b": [0.7193, 0.4083, 0.7501, 0.4281]}, {"w": "latter", "b": [0.7564, 0.4083, 0.8083, 0.4281]}, {"w": "case,", "b": [0.8146, 0.4083, 0.8643, 0.4281]}, {"w": "it’s", "b": [0.1294, 0.4288, 0.1603, 0.4486]}, {"w": "technically", "b": [0.1666, 0.4288, 0.2772, 0.4486]}, {"w": "more", "b": [0.2836, 0.4288, 0.3354, 0.4486]}, {"w": "correct", "b": [0.3417, 0.4288, 0.4117, 0.4486]}, {"w": "to", "b": [0.418, 0.4288, 0.4377, 0.4486]}, {"w": "talk", "b": [0.444, 0.4288, 0.4818, 0.4486]}, {"w": "about", "b": [0.488, 0.4288, 0.5441, 0.4486]}, {"w": "a", "b": [0.5504, 0.4288, 0.563, 0.4486]}, {"w": "tensor", "b": [0.5693, 0.4288, 0.6324, 0.4486]}, {"w": "of", "b": [0.6387, 0.4288, 0.6583, 0.4486]}, {"w": "rank", "b": [0.6646, 0.4288, 0.7108, 0.4486]}, {"w": "5", "b": [0.7171, 0.4288, 0.7297, 0.4486]}, {"w": "(the", "b": [0.736, 0.4288, 0.7753, 0.4486]}, {"w": "rank", "b": [0.7816, 0.4288, 0.8264, 0.4486]}, {"w": "of", "b": [0.8327, 0.4288, 0.8537, 0.4486]}, {"w": "a", "b": [0.1294, 0.4493, 0.1406, 0.4691]}, {"w": "tensor", "b": [0.1469, 0.4493, 0.2086, 0.4691]}, {"w": "being", "b": [0.2149, 0.4493, 0.2709, 0.4691]}, {"w": "the", "b": [0.2772, 0.4493, 0.3081, 0.4691]}, {"w": "number", "b": [0.3144, 0.4493, 0.3914, 0.4691]}, {"w": "of", "b": [0.3977, 0.4493, 0.4188, 0.4691]}, {"w": "axes),", "b": [0.4251, 0.4493, 0.4846, 0.4691]}, {"w": "but", "b": [0.4909, 0.4493, 0.5231, 0.4691]}, {"w": "the", "b": [0.5294, 0.4493, 0.5603, 0.4691]}, {"w": "ambiguous", "b": [0.5666, 0.4493, 0.6773, 0.4691]}, {"w": "notation", "b": [0.6836, 0.4493, 0.7663, 0.4691]}, {"w": "5D", "b": [0.7725, 0.4493, 0.8033, 0.4691]}, {"w": "tensor", "b": [0.1294, 0.4698, 0.1925, 0.4896]}, {"w": "is", "b": [0.1988, 0.4698, 0.2156, 0.4896]}, {"w": "common", "b": [0.2219, 0.4698, 0.3102, 0.4896]}, {"w": "regardless.", "b": [0.3165, 0.4698, 0.4251, 0.4896]}]}, {"id": "b_4", "type": "paragraph", "text": "2.2.3. Matrices (2D tensors)", "words": [{"w": "2.2.3.", "b": [0.1294, 0.5171, 0.1862, 0.5368]}, {"w": "Matrices", "b": [0.1925, 0.5171, 0.2877, 0.5368]}, {"w": "(2D", "b": [0.294, 0.5171, 0.3333, 0.5368]}, {"w": "tensors)", "b": [0.3396, 0.5171, 0.425, 0.5368]}]}, {"id": "b_5", "type": "paragraph", "text": "An array of vectors is a matrix, or 2D tensor. A matrix has two axes (often referred to rows and columns). You can visually interpret a matrix as a rectangular grid of numbers. This is a Numpy matrix:", "words": [{"w": "An", "b": [0.1294, 0.5599, 0.1602, 0.5796]}, {"w": "array", "b": [0.1665, 0.5599, 0.2184, 0.5796]}, {"w": "of", "b": [0.2247, 0.5599, 0.2457, 0.5796]}, {"w": "vectors", "b": [0.252, 0.5599, 0.3248, 0.5796]}, {"w": "is", "b": [0.3311, 0.5599, 0.348, 0.5796]}, {"w": "a", "b": [0.3543, 0.5599, 0.3655, 0.5796]}, {"w": "matrix,", "b": [0.3718, 0.5599, 0.4439, 0.5796]}, {"w": "or", "b": [0.4502, 0.5599, 0.4712, 0.5796]}, {"w": "2D", "b": [0.4775, 0.5599, 0.5084, 0.5796]}, {"w": "tensor.", "b": [0.5147, 0.5599, 0.5812, 0.5796]}, {"w": "A", "b": [0.5875, 0.5599, 0.6058, 0.5796]}, {"w": "matrix", "b": [0.6121, 0.5599, 0.6779, 0.5796]}, {"w": "has", "b": [0.6842, 0.5599, 0.7179, 0.5796]}, {"w": "two", "b": [0.7242, 0.5599, 0.762, 0.5796]}, {"w": "axes", "b": [0.7683, 0.5599, 0.8131, 0.5796]}, {"w": "(often", "b": [0.1294, 0.5804, 0.1897, 0.6001]}, {"w": "referred", "b": [0.196, 0.5804, 0.2758, 0.6001]}, {"w": "to", "b": [0.2821, 0.5804, 0.3017, 0.6001]}, {"w": "rows", "b": [0.308, 0.5804, 0.3561, 0.6001]}, {"w": "and", "b": [0.3624, 0.5804, 0.3988, 0.6001]}, {"w": "columns).", "b": [0.4051, 0.5804, 0.5039, 0.6001]}, {"w": "You", "b": [0.5102, 0.5804, 0.5511, 0.6001]}, {"w": "can", "b": [0.5575, 0.5804, 0.5925, 0.6001]}, {"w": "visually", "b": [0.5988, 0.5804, 0.6787, 0.6001]}, {"w": "interpret", "b": [0.685, 0.5804, 0.7704, 0.6001]}, {"w": "a", "b": [0.7767, 0.5804, 0.7879, 0.6001]}, {"w": "matrix", "b": [0.7942, 0.5804, 0.8601, 0.6001]}, {"w": "as", "b": [0.1294, 0.6009, 0.1504, 0.6206]}, {"w": "a", "b": [0.1567, 0.6009, 0.1679, 0.6206]}, {"w": "rectangular", "b": [0.1742, 0.6009, 0.2877, 0.6206]}, {"w": "grid", "b": [0.294, 0.6009, 0.3346, 0.6206]}, {"w": "of", "b": [0.341, 0.6009, 0.362, 0.6206]}, {"w": "numbers.", "b": [0.3683, 0.6009, 0.4615, 0.6206]}, {"w": "This", "b": [0.4678, 0.6009, 0.5126, 0.6206]}, {"w": "is", "b": [0.5189, 0.6009, 0.5357, 0.6206]}, {"w": "a", "b": [0.5421, 0.6009, 0.5533, 0.6206]}, {"w": "Numpy", "b": [0.5596, 0.6009, 0.6352, 0.6206]}, {"w": "matrix:", "b": [0.6415, 0.6009, 0.7144, 0.6206]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> x = np.array([[5, 78, 2, 34, 0], [6, 79, 3, 35, 1], [7, 80, 4, 36, 2]]) >>> x.ndim 2", "words": [{"w": ">>>", "b": [0.1357, 0.6386, 0.1698, 0.6537]}, {"w": "x", "b": [0.1811, 0.6386, 0.1925, 0.6537]}, {"w": "=", "b": [0.2038, 0.6386, 0.2152, 0.6537]}, {"w": "np.array([[5,", "b": [0.2265, 0.6386, 0.3741, 0.6537]}, {"w": "78,", "b": [0.3855, 0.6386, 0.4195, 0.6537]}, {"w": "2,", "b": [0.4309, 0.6386, 0.4536, 0.6537]}, {"w": "34,", "b": [0.4649, 0.6386, 0.499, 0.6537]}, {"w": "0],", "b": [0.5103, 0.6386, 0.5444, 0.6537]}, {"w": "[6,", "b": [0.34, 0.6537, 0.3741, 0.6689]}, {"w": "79,", "b": [0.3855, 0.6537, 0.4195, 0.6689]}, {"w": "3,", "b": [0.4309, 0.6537, 0.4536, 0.6689]}, {"w": "35,", "b": [0.4649, 0.6537, 0.499, 0.6689]}, {"w": "1],", "b": [0.5103, 0.6537, 0.5444, 0.6689]}, {"w": "[7,", "b": [0.34, 0.6689, 0.3741, 0.684]}, {"w": "80,", "b": [0.3855, 0.6689, 0.4195, 0.684]}, {"w": "4,", "b": [0.4309, 0.6689, 0.4536, 0.684]}, {"w": "36,", "b": [0.4649, 0.6689, 0.499, 0.684]}, {"w": "2]])", "b": [0.5103, 0.6689, 0.5557, 0.684]}, {"w": ">>>", "b": [0.1357, 0.684, 0.1698, 0.6992]}, {"w": "x.ndim", "b": [0.1811, 0.684, 0.2492, 0.6992]}, {"w": "2", "b": [0.1357, 0.6992, 0.1471, 0.7143]}]}, {"id": "b_7", "type": "paragraph", "text": "The entries from the first axis are called the rows, and the entries from the second axis are called the columns. In the previous example, [5, 78, 2, 34, 0] is the first row of x, and [5, 6, 7] is the first column.", "words": [{"w": "The", "b": [0.1294, 0.7372, 0.1686, 0.757]}, {"w": "entries", "b": [0.1749, 0.7372, 0.2422, 0.757]}, {"w": "from", "b": [0.2485, 0.7372, 0.2975, 0.757]}, {"w": "the", "b": [0.3038, 0.7372, 0.3347, 0.757]}, {"w": "first", "b": [0.341, 0.7372, 0.3816, 0.757]}, {"w": "axis", "b": [0.3879, 0.7372, 0.4286, 0.757]}, {"w": "are", "b": [0.4349, 0.7372, 0.4657, 0.757]}, {"w": "called", "b": [0.472, 0.7372, 0.5322, 0.757]}, {"w": "the", "b": [0.5385, 0.7372, 0.5693, 0.757]}, {"w": "rows,", "b": [0.5756, 0.7372, 0.63, 0.757]}, {"w": "and", "b": [0.6363, 0.7372, 0.6727, 0.757]}, {"w": "the", "b": [0.679, 0.7372, 0.7099, 0.757]}, {"w": "entries", "b": [0.7162, 0.7372, 0.7834, 0.757]}, {"w": "from", "b": [0.7897, 0.7372, 0.8388, 0.757]}, {"w": "the", "b": [0.1294, 0.7577, 0.1602, 0.7775]}, {"w": "second", "b": [0.1665, 0.7577, 0.2366, 0.7775]}, {"w": "axis", "b": [0.2429, 0.7577, 0.2835, 0.7775]}, {"w": "are", "b": [0.2898, 0.7577, 0.3206, 0.7775]}, {"w": "called", "b": [0.327, 0.7577, 0.3872, 0.7775]}, {"w": "the", "b": [0.3935, 0.7577, 0.4243, 0.7775]}, {"w": "columns.", "b": [0.4306, 0.7577, 0.5209, 0.7775]}, {"w": "In", "b": [0.5272, 0.7577, 0.5483, 0.7775]}, {"w": "the", "b": [0.5546, 0.7577, 0.5854, 0.7775]}, {"w": "previous", "b": [0.5917, 0.7577, 0.6786, 0.7775]}, {"w": "example,", "b": [0.6849, 0.7577, 0.7767, 0.7775]}, {"w": "[5,", "b": [0.7829, 0.7588, 0.8283, 0.779]}, {"w": "78,", "b": [0.1294, 0.7802, 0.1748, 0.8004]}, {"w": "2,", "b": [0.19, 0.7802, 0.2202, 0.8004]}, {"w": "34,", "b": [0.2354, 0.7802, 0.2808, 0.8004]}, {"w": "0]", "b": [0.2959, 0.7802, 0.3262, 0.8004]}, {"w": "is", "b": [0.3325, 0.7791, 0.3493, 0.7989]}, {"w": "the", "b": [0.3556, 0.7791, 0.3865, 0.7989]}, {"w": "first", "b": [0.3928, 0.7791, 0.4334, 0.7989]}, {"w": "row", "b": [0.4397, 0.7791, 0.4789, 0.7989]}, {"w": "of", "b": [0.4852, 0.7791, 0.5063, 0.7989]}, {"w": "x,", "b": [0.5125, 0.7791, 0.534, 0.8004]}, {"w": "and", "b": [0.5403, 0.7791, 0.5767, 0.7989]}, {"w": "[5,", "b": [0.583, 0.7802, 0.6284, 0.8004]}, {"w": "6,", "b": [0.6436, 0.7802, 0.6738, 0.8004]}, {"w": "7]", "b": [0.689, 0.7802, 0.7192, 0.8004]}, {"w": "is", "b": [0.7256, 0.7791, 0.7424, 0.7989]}, {"w": "the", "b": [0.7487, 0.7791, 0.7795, 0.7989]}, {"w": "first", "b": [0.7858, 0.7791, 0.8265, 0.7989]}, {"w": "column.", "b": [0.1294, 0.8005, 0.2114, 0.8203]}]}, {"id": "b_8", "type": "equation", "text": "2.2.4. 3D tensors and higher-dimensional tensors", "words": [{"w": "2.2.4.", "b": [0.1294, 0.8478, 0.1862, 0.8675]}, {"w": "3D", "b": [0.1925, 0.8478, 0.2233, 0.8675]}, {"w": "tensors", "b": [0.2296, 0.8478, 0.3067, 0.8675]}, {"w": "and", "b": [0.313, 0.8478, 0.3536, 0.8675]}, {"w": "higher-dimensional", "b": [0.36, 0.8478, 0.5679, 0.8675]}, {"w": "tensors", "b": [0.5742, 0.8478, 0.6512, 0.8675]}]}]}, {"page": 65, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "If you pack such matrices in a new array, you obtain a 3D tensor, which you can visually interpret as a cube of numbers. Following is a Numpy 3D tensor:", "words": [{"w": "If", "b": [0.1294, 0.0857, 0.1462, 0.1054]}, {"w": "you", "b": [0.1525, 0.0857, 0.1904, 0.1054]}, {"w": "pack", "b": [0.1967, 0.0857, 0.2443, 0.1054]}, {"w": "such", "b": [0.2506, 0.0857, 0.2968, 0.1054]}, {"w": "matrices", "b": [0.3031, 0.0857, 0.3886, 0.1054]}, {"w": "in", "b": [0.3949, 0.0857, 0.4145, 0.1054]}, {"w": "a", "b": [0.4208, 0.0857, 0.432, 0.1054]}, {"w": "new", "b": [0.4384, 0.0857, 0.4804, 0.1054]}, {"w": "array,", "b": [0.4867, 0.0857, 0.5431, 0.1054]}, {"w": "you", "b": [0.5494, 0.0857, 0.5873, 0.1054]}, {"w": "obtain", "b": [0.5936, 0.0857, 0.6566, 0.1054]}, {"w": "a", "b": [0.6629, 0.0857, 0.6741, 0.1054]}, {"w": "3D", "b": [0.6805, 0.0857, 0.7113, 0.1054]}, {"w": "tensor,", "b": [0.7176, 0.0857, 0.7845, 0.1054]}, {"w": "which", "b": [0.7908, 0.0857, 0.8525, 0.1054]}, {"w": "you", "b": [0.1294, 0.1062, 0.1673, 0.1259]}, {"w": "can", "b": [0.1736, 0.1062, 0.2086, 0.1259]}, {"w": "visually", "b": [0.2149, 0.1062, 0.2948, 0.1259]}, {"w": "interpret", "b": [0.3011, 0.1062, 0.3865, 0.1259]}, {"w": "as", "b": [0.3928, 0.1062, 0.4139, 0.1259]}, {"w": "a", "b": [0.4202, 0.1062, 0.4314, 0.1259]}, {"w": "cube", "b": [0.4377, 0.1062, 0.4853, 0.1259]}, {"w": "of", "b": [0.4916, 0.1062, 0.5126, 0.1259]}, {"w": "numbers.", "b": [0.5189, 0.1062, 0.6121, 0.1259]}, {"w": "Following", "b": [0.6184, 0.1062, 0.7221, 0.1259]}, {"w": "is", "b": [0.7284, 0.1062, 0.7452, 0.1259]}, {"w": "a", "b": [0.7515, 0.1062, 0.7627, 0.1259]}, {"w": "Numpy", "b": [0.769, 0.1062, 0.8447, 0.1259]}, {"w": "3D", "b": [0.1294, 0.1267, 0.1602, 0.1464]}, {"w": "tensor:", "b": [0.1665, 0.1267, 0.2352, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": ">>> x = np.array([[[5, 78, 2, 34, 0], [6, 79, 3, 35, 1], [7, 80, 4, 36, 2]], [[5, 78, 2, 34, 0], [6, 79, 3, 35, 1], [7, 80, 4, 36, 2]], [[5, 78, 2, 34, 0], [6, 79, 3, 35, 1], [7, 80, 4, 36, 2]]]) >>> x.ndim 3", "words": [{"w": ">>>", "b": [0.1357, 0.1644, 0.1698, 0.1796]}, {"w": "x", "b": [0.1811, 0.1644, 0.1925, 0.1796]}, {"w": "=", "b": [0.2038, 0.1644, 0.2152, 0.1796]}, {"w": "np.array([[[5,", "b": [0.2265, 0.1644, 0.3855, 0.1796]}, {"w": "78,", "b": [0.3968, 0.1644, 0.4309, 0.1796]}, {"w": "2,", "b": [0.4422, 0.1644, 0.4649, 0.1796]}, {"w": "34,", "b": [0.4763, 0.1644, 0.5103, 0.1796]}, {"w": "0],", "b": [0.5217, 0.1644, 0.5557, 0.1796]}, {"w": "[6,", "b": [0.3514, 0.1796, 0.3855, 0.1947]}, {"w": "79,", "b": [0.3968, 0.1796, 0.4309, 0.1947]}, {"w": "3,", "b": [0.4422, 0.1796, 0.4649, 0.1947]}, {"w": "35,", "b": [0.4763, 0.1796, 0.5103, 0.1947]}, {"w": "1],", "b": [0.5217, 0.1796, 0.5557, 0.1947]}, {"w": "[7,", "b": [0.3514, 0.1947, 0.3855, 0.2099]}, {"w": "80,", "b": [0.3968, 0.1947, 0.4309, 0.2099]}, {"w": "4,", "b": [0.4422, 0.1947, 0.4649, 0.2099]}, {"w": "36,", "b": [0.4763, 0.1947, 0.5103, 0.2099]}, {"w": "2]],", "b": [0.5217, 0.1947, 0.5671, 0.2099]}, {"w": "[[5,", "b": [0.34, 0.2099, 0.3855, 0.225]}, {"w": "78,", "b": [0.3968, 0.2099, 0.4309, 0.225]}, {"w": "2,", "b": [0.4422, 0.2099, 0.4649, 0.225]}, {"w": "34,", "b": [0.4763, 0.2099, 0.5103, 0.225]}, {"w": "0],", "b": [0.5217, 0.2099, 0.5557, 0.225]}, {"w": "[6,", "b": [0.3514, 0.225, 0.3855, 0.2402]}, {"w": "79,", "b": [0.3968, 0.225, 0.4309, 0.2402]}, {"w": "3,", "b": [0.4422, 0.225, 0.4649, 0.2402]}, {"w": "35,", "b": [0.4763, 0.225, 0.5103, 0.2402]}, {"w": "1],", "b": [0.5217, 0.225, 0.5557, 0.2402]}, {"w": "[7,", "b": [0.3514, 0.2402, 0.3855, 0.2553]}, {"w": "80,", "b": [0.3968, 0.2402, 0.4309, 0.2553]}, {"w": "4,", "b": [0.4422, 0.2402, 0.4649, 0.2553]}, {"w": "36,", "b": [0.4763, 0.2402, 0.5103, 0.2553]}, {"w": "2]],", "b": [0.5217, 0.2402, 0.5671, 0.2553]}, {"w": "[[5,", "b": [0.34, 0.2553, 0.3855, 0.2705]}, {"w": "78,", "b": [0.3968, 0.2553, 0.4309, 0.2705]}, {"w": "2,", "b": [0.4422, 0.2553, 0.4649, 0.2705]}, {"w": "34,", "b": [0.4763, 0.2553, 0.5103, 0.2705]}, {"w": "0],", "b": [0.5217, 0.2553, 0.5557, 0.2705]}, {"w": "[6,", "b": [0.3514, 0.2705, 0.3855, 0.2856]}, {"w": "79,", "b": [0.3968, 0.2705, 0.4309, 0.2856]}, {"w": "3,", "b": [0.4422, 0.2705, 0.4649, 0.2856]}, {"w": "35,", "b": [0.4763, 0.2705, 0.5103, 0.2856]}, {"w": "1],", "b": [0.5217, 0.2705, 0.5557, 0.2856]}, {"w": "[7,", "b": [0.3514, 0.2856, 0.3855, 0.3008]}, {"w": "80,", "b": [0.3968, 0.2856, 0.4309, 0.3008]}, {"w": "4,", "b": [0.4422, 0.2856, 0.4649, 0.3008]}, {"w": "36,", "b": [0.4763, 0.2856, 0.5103, 0.3008]}, {"w": "2]]])", "b": [0.5217, 0.2856, 0.5784, 0.3008]}, {"w": ">>>", "b": [0.1357, 0.3008, 0.1698, 0.3159]}, {"w": "x.ndim", "b": [0.1811, 0.3008, 0.2492, 0.3159]}, {"w": "3", "b": [0.1357, 0.3159, 0.1471, 0.3311]}]}, {"id": "b_2", "type": "paragraph", "text": "By packing 3D tensors in an array, you can create a 4D tensor, and so on. In deep learning, you’ll generally manipulate tensors that are 0D to 4D, although you may go up to 5D if you process video data.", "words": [{"w": "By", "b": [0.1294, 0.354, 0.1589, 0.3737]}, {"w": "packing", "b": [0.1652, 0.354, 0.245, 0.3737]}, {"w": "3D", "b": [0.2513, 0.354, 0.2822, 0.3737]}, {"w": "tensors", "b": [0.2885, 0.354, 0.3599, 0.3737]}, {"w": "in", "b": [0.3662, 0.354, 0.3859, 0.3737]}, {"w": "an", "b": [0.3922, 0.354, 0.416, 0.3737]}, {"w": "array,", "b": [0.4223, 0.354, 0.4787, 0.3737]}, {"w": "you", "b": [0.485, 0.354, 0.5229, 0.3737]}, {"w": "can", "b": [0.5292, 0.354, 0.5642, 0.3737]}, {"w": "create", "b": [0.5705, 0.354, 0.6307, 0.3737]}, {"w": "a", "b": [0.637, 0.354, 0.6482, 0.3737]}, {"w": "4D", "b": [0.6545, 0.354, 0.6854, 0.3737]}, {"w": "tensor,", "b": [0.6917, 0.354, 0.7586, 0.3737]}, {"w": "and", "b": [0.7649, 0.354, 0.8013, 0.3737]}, {"w": "so", "b": [0.8076, 0.354, 0.8301, 0.3737]}, {"w": "on.", "b": [0.8364, 0.354, 0.8679, 0.3737]}, {"w": "In", "b": [0.1294, 0.3745, 0.1504, 0.3942]}, {"w": "deep", "b": [0.1567, 0.3745, 0.2044, 0.3942]}, {"w": "learning,", "b": [0.2107, 0.3745, 0.2996, 0.3942]}, {"w": "you’ll", "b": [0.3059, 0.3745, 0.3662, 0.3942]}, {"w": "generally", "b": [0.3725, 0.3745, 0.4664, 0.3942]}, {"w": "manipulate", "b": [0.4727, 0.3745, 0.5848, 0.3942]}, {"w": "tensors", "b": [0.5911, 0.3745, 0.6626, 0.3942]}, {"w": "that", "b": [0.6688, 0.3745, 0.7066, 0.3942]}, {"w": "are", "b": [0.7129, 0.3745, 0.7437, 0.3942]}, {"w": "0D", "b": [0.75, 0.3745, 0.7808, 0.3942]}, {"w": "to", "b": [0.7872, 0.3745, 0.8068, 0.3942]}, {"w": "4D,", "b": [0.8131, 0.3745, 0.8502, 0.3942]}, {"w": "although", "b": [0.1294, 0.395, 0.2177, 0.4147]}, {"w": "you", "b": [0.224, 0.395, 0.2618, 0.4147]}, {"w": "may", "b": [0.2682, 0.395, 0.3116, 0.4147]}, {"w": "go", "b": [0.3179, 0.395, 0.3431, 0.4147]}, {"w": "up", "b": [0.3494, 0.395, 0.3747, 0.4147]}, {"w": "to", "b": [0.381, 0.395, 0.4006, 0.4147]}, {"w": "5D", "b": [0.4069, 0.395, 0.4377, 0.4147]}, {"w": "if", "b": [0.444, 0.395, 0.4594, 0.4147]}, {"w": "you", "b": [0.4657, 0.395, 0.5036, 0.4147]}, {"w": "process", "b": [0.5099, 0.395, 0.5855, 0.4147]}, {"w": "video", "b": [0.5919, 0.395, 0.6479, 0.4147]}, {"w": "data.", "b": [0.6542, 0.395, 0.7025, 0.4147]}]}, {"id": "b_3", "type": "paragraph", "text": "2.2.5. Key attributes", "words": [{"w": "2.2.5.", "b": [0.1294, 0.4422, 0.1862, 0.4619]}, {"w": "Key", "b": [0.1925, 0.4422, 0.2359, 0.4619]}, {"w": "attributes", "b": [0.2422, 0.4422, 0.3473, 0.4619]}]}, {"id": "b_4", "type": "paragraph", "text": "A tensor is defined by three key attributes:", "words": [{"w": "A", "b": [0.1294, 0.485, 0.1476, 0.5047]}, {"w": "tensor", "b": [0.1539, 0.485, 0.2156, 0.5047]}, {"w": "is", "b": [0.2219, 0.485, 0.2387, 0.5047]}, {"w": "defined", "b": [0.245, 0.485, 0.3207, 0.5047]}, {"w": "by", "b": [0.327, 0.485, 0.3522, 0.5047]}, {"w": "three", "b": [0.3585, 0.485, 0.4089, 0.5047]}, {"w": "key", "b": [0.4152, 0.485, 0.4517, 0.5047]}, {"w": "attributes:", "b": [0.458, 0.485, 0.5589, 0.5047]}]}, {"id": "b_5", "type": "paragraph", "text": "Number of axes (rank)— For instance, a 3D tensor has three axes, and a matrix has two axes. This is also called the tensor’s ndim in Python libraries such as Numpy. Shape— This is a tuple of integers that describes how many dimensions the tensor has along each axis. For instance, the previous matrix example has shape (3, 5), and the 3D tensor example has shape (3, 3, 5). A vector has a shape with a single element, such as (5,), whereas a scalar has an empty shape, (). Data type (usually called dtype in Python libraries)—This is the type of the data contained in the tensor; for instance, a tensor’s type could be float32, uint8, float64, and so on. On rare occasions, you may see a char tensor. Note that string tensors don’t exist in Numpy (or in most other libraries), because tensors live in preallocated, contiguous memory segments: and strings, being variable length, would preclude the use of this implementation.", "words": [{"w": "Number", "b": [0.1799, 0.5233, 0.2654, 0.5431]}, {"w": "of", "b": [0.2717, 0.5233, 0.2927, 0.5431]}, {"w": "axes", "b": [0.299, 0.5233, 0.3452, 0.5431]}, {"w": "(rank)—", "b": [0.3515, 0.5233, 0.4426, 0.5431]}, {"w": "For", "b": [0.4489, 0.5233, 0.484, 0.5431]}, {"w": "instance,", "b": [0.4903, 0.5233, 0.5792, 0.5431]}, {"w": "a", "b": [0.5856, 0.5233, 0.5968, 0.5431]}, {"w": "3D", "b": [0.6031, 0.5233, 0.6339, 0.5431]}, {"w": "tensor", "b": [0.6402, 0.5233, 0.7018, 0.5431]}, {"w": "has", "b": [0.7082, 0.5233, 0.7418, 0.5431]}, {"w": "three", "b": [0.7481, 0.5233, 0.7985, 0.5431]}, {"w": "axes,", "b": [0.8048, 0.5233, 0.8559, 0.5431]}, {"w": "and", "b": [0.1799, 0.5438, 0.2163, 0.5636]}, {"w": "a", "b": [0.2226, 0.5438, 0.2338, 0.5636]}, {"w": "matrix", "b": [0.2401, 0.5438, 0.306, 0.5636]}, {"w": "has", "b": [0.3123, 0.5438, 0.3459, 0.5636]}, {"w": "two", "b": [0.3522, 0.5438, 0.39, 0.5636]}, {"w": "axes.", "b": [0.3964, 0.5438, 0.4475, 0.5636]}, {"w": "This", "b": [0.4538, 0.5438, 0.4986, 0.5636]}, {"w": "is", "b": [0.5049, 0.5438, 0.5218, 0.5636]}, {"w": "also", "b": [0.5281, 0.5438, 0.5687, 0.5636]}, {"w": "called", "b": [0.575, 0.5438, 0.6353, 0.5636]}, {"w": "the", "b": [0.6416, 0.5438, 0.6724, 0.5636]}, {"w": "tensor’s", "b": [0.6787, 0.5438, 0.758, 0.5636]}, {"w": "ndim", "b": [0.7644, 0.5449, 0.8249, 0.5651]}, {"w": "in", "b": [0.8312, 0.5438, 0.8508, 0.5636]}, {"w": "Python", "b": [0.1799, 0.5652, 0.2514, 0.5849]}, {"w": "libraries", "b": [0.2577, 0.5652, 0.3403, 0.5849]}, {"w": "such", "b": [0.3466, 0.5652, 0.3929, 0.5849]}, {"w": "as", "b": [0.3992, 0.5652, 0.4202, 0.5849]}, {"w": "Numpy.", "b": [0.4265, 0.5652, 0.5068, 0.5849]}, {"w": "Shape—", "b": [0.1799, 0.5857, 0.2696, 0.6054]}, {"w": "This", "b": [0.2759, 0.5857, 0.3207, 0.6054]}, {"w": "is", "b": [0.327, 0.5857, 0.3438, 0.6054]}, {"w": "a", "b": [0.3501, 0.5857, 0.3613, 0.6054]}, {"w": "tuple", "b": [0.3677, 0.5857, 0.4181, 0.6054]}, {"w": "of", "b": [0.4244, 0.5857, 0.4454, 0.6054]}, {"w": "integers", "b": [0.4517, 0.5857, 0.5316, 0.6054]}, {"w": "that", "b": [0.5379, 0.5857, 0.5757, 0.6054]}, {"w": "describes", "b": [0.582, 0.5857, 0.6759, 0.6054]}, {"w": "how", "b": [0.6822, 0.5857, 0.7257, 0.6054]}, {"w": "many", "b": [0.732, 0.5857, 0.788, 0.6054]}, {"w": "dimensions", "b": [0.1799, 0.6062, 0.2948, 0.6259]}, {"w": "the", "b": [0.3011, 0.6062, 0.3319, 0.6259]}, {"w": "tensor", "b": [0.3382, 0.6062, 0.3999, 0.6259]}, {"w": "has", "b": [0.4062, 0.6062, 0.4398, 0.6259]}, {"w": "along", "b": [0.4461, 0.6062, 0.5022, 0.6259]}, {"w": "each", "b": [0.5085, 0.6062, 0.5547, 0.6259]}, {"w": "axis.", "b": [0.561, 0.6062, 0.6079, 0.6259]}, {"w": "For", "b": [0.6143, 0.6062, 0.6493, 0.6259]}, {"w": "instance,", "b": [0.6556, 0.6062, 0.7446, 0.6259]}, {"w": "the", "b": [0.7509, 0.6062, 0.7817, 0.6259]}, {"w": "previous", "b": [0.1799, 0.6267, 0.2667, 0.6464]}, {"w": "matrix", "b": [0.273, 0.6267, 0.3389, 0.6464]}, {"w": "example", "b": [0.3452, 0.6267, 0.4307, 0.6464]}, {"w": "has", "b": [0.437, 0.6267, 0.4706, 0.6464]}, {"w": "shape", "b": [0.4769, 0.6267, 0.5344, 0.6464]}, {"w": "(3,", "b": [0.5406, 0.6277, 0.586, 0.6479]}, {"w": "5),", "b": [0.6012, 0.6267, 0.6377, 0.6479]}, {"w": "and", "b": [0.644, 0.6267, 0.6805, 0.6464]}, {"w": "the", "b": [0.6868, 0.6267, 0.7176, 0.6464]}, {"w": "3D", "b": [0.7239, 0.6267, 0.7547, 0.6464]}, {"w": "tensor", "b": [0.761, 0.6267, 0.8227, 0.6464]}, {"w": "example", "b": [0.1799, 0.6481, 0.2653, 0.6678]}, {"w": "has", "b": [0.2716, 0.6481, 0.3053, 0.6678]}, {"w": "shape", "b": [0.3116, 0.6481, 0.369, 0.6678]}, {"w": "(3,", "b": [0.3753, 0.6491, 0.4207, 0.6693]}, {"w": "3,", "b": [0.4358, 0.6491, 0.4661, 0.6693]}, {"w": "5).", "b": [0.4812, 0.6481, 0.5178, 0.6693]}, {"w": "A", "b": [0.5241, 0.6481, 0.5423, 0.6678]}, {"w": "vector", "b": [0.5487, 0.6481, 0.6117, 0.6678]}, {"w": "has", "b": [0.618, 0.6481, 0.6516, 0.6678]}, {"w": "a", "b": [0.6579, 0.6481, 0.6691, 0.6678]}, {"w": "shape", "b": [0.6754, 0.6481, 0.7329, 0.6678]}, {"w": "with", "b": [0.7392, 0.6481, 0.784, 0.6678]}, {"w": "a", "b": [0.7903, 0.6481, 0.8015, 0.6678]}, {"w": "single", "b": [0.8079, 0.6481, 0.8681, 0.6678]}, {"w": "element,", "b": [0.1799, 0.6695, 0.266, 0.6892]}, {"w": "such", "b": [0.2723, 0.6695, 0.3186, 0.6892]}, {"w": "as", "b": [0.3249, 0.6695, 0.3459, 0.6892]}, {"w": "(5,),", "b": [0.3522, 0.6695, 0.419, 0.6907]}, {"w": "whereas", "b": [0.4253, 0.6695, 0.508, 0.6892]}, {"w": "a", "b": [0.5143, 0.6695, 0.5255, 0.6892]}, {"w": "scalar", "b": [0.5318, 0.6695, 0.5906, 0.6892]}, {"w": "has", "b": [0.5969, 0.6695, 0.6305, 0.6892]}, {"w": "an", "b": [0.6368, 0.6695, 0.6607, 0.6892]}, {"w": "empty", "b": [0.667, 0.6695, 0.73, 0.6892]}, {"w": "shape,", "b": [0.7363, 0.6695, 0.8001, 0.6892]}, {"w": "().", "b": [0.8063, 0.6695, 0.8429, 0.6907]}, {"w": "Data", "b": [0.1799, 0.6909, 0.2303, 0.7106]}, {"w": "type", "b": [0.2366, 0.6909, 0.2786, 0.7106]}, {"w": "(usually", "b": [0.2849, 0.6909, 0.3662, 0.7106]}, {"w": "called", "b": [0.3725, 0.6909, 0.4327, 0.7106]}, {"w": "dtype", "b": [0.439, 0.6919, 0.5147, 0.7121]}, {"w": "in", "b": [0.521, 0.6909, 0.5406, 0.7106]}, {"w": "Python", "b": [0.5469, 0.6909, 0.6184, 0.7106]}, {"w": "libraries)—This", "b": [0.6247, 0.6909, 0.7859, 0.7106]}, {"w": "is", "b": [0.7922, 0.6909, 0.809, 0.7106]}, {"w": "the", "b": [0.8153, 0.6909, 0.8461, 0.7106]}, {"w": "type", "b": [0.1799, 0.7123, 0.2233, 0.732]}, {"w": "of", "b": [0.2296, 0.7123, 0.2506, 0.732]}, {"w": "the", "b": [0.2569, 0.7123, 0.2878, 0.732]}, {"w": "data", "b": [0.2941, 0.7123, 0.3361, 0.732]}, {"w": "contained", "b": [0.3424, 0.7123, 0.4405, 0.732]}, {"w": "in", "b": [0.4468, 0.7123, 0.4664, 0.732]}, {"w": "the", "b": [0.4727, 0.7123, 0.5035, 0.732]}, {"w": "tensor;", "b": [0.5098, 0.7123, 0.5785, 0.732]}, {"w": "for", "b": [0.5848, 0.7123, 0.6142, 0.732]}, {"w": "instance,", "b": [0.6205, 0.7123, 0.7095, 0.732]}, {"w": "a", "b": [0.7158, 0.7123, 0.727, 0.732]}, {"w": "tensor’s", "b": [0.7333, 0.7123, 0.8126, 0.732]}, {"w": "type", "b": [0.8189, 0.7123, 0.8624, 0.732]}, {"w": "could", "b": [0.1799, 0.7328, 0.2359, 0.7525]}, {"w": "be", "b": [0.2422, 0.7328, 0.266, 0.7525]}, {"w": "float32,", "b": [0.2723, 0.7328, 0.3846, 0.754]}, {"w": "uint8,", "b": [0.3909, 0.7328, 0.4729, 0.754]}, {"w": "float64,", "b": [0.4792, 0.7328, 0.5914, 0.754]}, {"w": "and", "b": [0.5977, 0.7328, 0.6342, 0.7525]}, {"w": "so", "b": [0.6405, 0.7328, 0.6629, 0.7525]}, {"w": "on.", "b": [0.6692, 0.7328, 0.7007, 0.7525]}, {"w": "On", "b": [0.707, 0.7328, 0.7379, 0.7525]}, {"w": "rare", "b": [0.7442, 0.7328, 0.7834, 0.7525]}, {"w": "occasions,", "b": [0.1799, 0.7542, 0.2842, 0.7739]}, {"w": "you", "b": [0.2906, 0.7542, 0.3284, 0.7739]}, {"w": "may", "b": [0.3347, 0.7542, 0.3781, 0.7739]}, {"w": "see", "b": [0.3844, 0.7542, 0.4167, 0.7739]}, {"w": "a", "b": [0.423, 0.7542, 0.4342, 0.7739]}, {"w": "char", "b": [0.4404, 0.7552, 0.501, 0.7754]}, {"w": "tensor.", "b": [0.5073, 0.7542, 0.5738, 0.7739]}, {"w": "Note", "b": [0.5802, 0.7542, 0.6292, 0.7739]}, {"w": "that", "b": [0.6355, 0.7542, 0.6733, 0.7739]}, {"w": "string", "b": [0.6796, 0.7542, 0.7371, 0.7739]}, {"w": "tensors", "b": [0.7434, 0.7542, 0.8149, 0.7739]}, {"w": "don’t", "b": [0.1799, 0.7756, 0.2327, 0.7953]}, {"w": "exist", "b": [0.239, 0.7756, 0.2866, 0.7953]}, {"w": "in", "b": [0.2929, 0.7756, 0.3125, 0.7953]}, {"w": "Numpy", "b": [0.3189, 0.7756, 0.3945, 0.7953]}, {"w": "(or", "b": [0.4008, 0.7756, 0.4303, 0.7953]}, {"w": "in", "b": [0.4366, 0.7756, 0.4562, 0.7953]}, {"w": "most", "b": [0.4625, 0.7756, 0.5116, 0.7953]}, {"w": "other", "b": [0.5179, 0.7756, 0.5697, 0.7953]}, {"w": "libraries),", "b": [0.576, 0.7756, 0.6734, 0.7953]}, {"w": "because", "b": [0.6797, 0.7756, 0.7595, 0.7953]}, {"w": "tensors", "b": [0.7658, 0.7756, 0.8373, 0.7953]}, {"w": "live", "b": [0.1799, 0.7961, 0.2177, 0.8158]}, {"w": "in", "b": [0.224, 0.7961, 0.2436, 0.8158]}, {"w": "preallocated,", "b": [0.2499, 0.7961, 0.3795, 0.8158]}, {"w": "contiguous", "b": [0.3858, 0.7961, 0.4965, 0.8158]}, {"w": "memory", "b": [0.5028, 0.7961, 0.5869, 0.8158]}, {"w": "segments:", "b": [0.5932, 0.7961, 0.6941, 0.8158]}, {"w": "and", "b": [0.7004, 0.7961, 0.7368, 0.8158]}, {"w": "strings,", "b": [0.7431, 0.7961, 0.8167, 0.8158]}, {"w": "being", "b": [0.1799, 0.8166, 0.2359, 0.8363]}, {"w": "variable", "b": [0.2422, 0.8166, 0.3235, 0.8363]}, {"w": "length,", "b": [0.3298, 0.8166, 0.3992, 0.8363]}, {"w": "would", "b": [0.4055, 0.8166, 0.4685, 0.8363]}, {"w": "preclude", "b": [0.4748, 0.8166, 0.5617, 0.8363]}, {"w": "the", "b": [0.568, 0.8166, 0.5988, 0.8363]}, {"w": "use", "b": [0.6051, 0.8166, 0.6387, 0.8363]}, {"w": "of", "b": [0.6451, 0.8166, 0.6661, 0.8363]}, {"w": "this", "b": [0.6724, 0.8166, 0.7088, 0.8363]}, {"w": "implementation.", "b": [0.1799, 0.8371, 0.3445, 0.8568]}]}]}, {"page": 66, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "To make this more concrete, let’s look back at the data we processed in the MNIST example. First, we load the MNIST dataset:", "words": [{"w": "To", "b": [0.1294, 0.0857, 0.1557, 0.1054]}, {"w": "make", "b": [0.162, 0.0857, 0.2166, 0.1054]}, {"w": "this", "b": [0.2229, 0.0857, 0.2594, 0.1054]}, {"w": "more", "b": [0.2657, 0.0857, 0.3175, 0.1054]}, {"w": "concrete,", "b": [0.3238, 0.0857, 0.4156, 0.1054]}, {"w": "let’s", "b": [0.4219, 0.0857, 0.4639, 0.1054]}, {"w": "look", "b": [0.4702, 0.0857, 0.515, 0.1054]}, {"w": "back", "b": [0.5213, 0.0857, 0.569, 0.1054]}, {"w": "at", "b": [0.5753, 0.0857, 0.5935, 0.1054]}, {"w": "the", "b": [0.5998, 0.0857, 0.6306, 0.1054]}, {"w": "data", "b": [0.6369, 0.0857, 0.6789, 0.1054]}, {"w": "we", "b": [0.6853, 0.0857, 0.7147, 0.1054]}, {"w": "processed", "b": [0.721, 0.0857, 0.8204, 0.1054]}, {"w": "in", "b": [0.8267, 0.0857, 0.8464, 0.1054]}, {"w": "the", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "MNIST", "b": [0.1665, 0.1062, 0.245, 0.1259]}, {"w": "example.", "b": [0.2513, 0.1062, 0.3431, 0.1259]}, {"w": "First,", "b": [0.3494, 0.1062, 0.402, 0.1259]}, {"w": "we", "b": [0.4083, 0.1062, 0.4377, 0.1259]}, {"w": "load", "b": [0.444, 0.1062, 0.4874, 0.1259]}, {"w": "the", "b": [0.4937, 0.1062, 0.5246, 0.1259]}, {"w": "MNIST", "b": [0.5309, 0.1062, 0.6094, 0.1259]}, {"w": "dataset:", "b": [0.6157, 0.1062, 0.6927, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras.datasets import mnist (train_images, train_labels), (test_images, test_labels) = mnist.load_data()", "words": [{"w": "from", "b": [0.1357, 0.1439, 0.1811, 0.1591]}, {"w": "keras.datasets", "b": [0.1925, 0.1439, 0.3514, 0.1591]}, {"w": "import", "b": [0.3628, 0.1439, 0.4309, 0.1591]}, {"w": "mnist", "b": [0.4422, 0.1439, 0.499, 0.1591]}, {"w": "(train_images,", "b": [0.1357, 0.1591, 0.2946, 0.1742]}, {"w": "train_labels),", "b": [0.306, 0.1591, 0.4649, 0.1742]}, {"w": "(test_images,", "b": [0.4763, 0.1591, 0.6238, 0.1742]}, {"w": "test_labels)", "b": [0.6352, 0.1591, 0.7714, 0.1742]}, {"w": "=", "b": [0.7828, 0.1591, 0.7941, 0.1742]}, {"w": "mnist.load_data()", "b": [0.1357, 0.1742, 0.3287, 0.1894]}]}, {"id": "b_2", "type": "paragraph", "text": "Next, we display the number of axes of the tensor train_images, the ndim attribute:", "words": [{"w": "Next,", "b": [0.1294, 0.2122, 0.1848, 0.232]}, {"w": "we", "b": [0.1911, 0.2122, 0.2205, 0.232]}, {"w": "display", "b": [0.2268, 0.2122, 0.2997, 0.232]}, {"w": "the", "b": [0.306, 0.2122, 0.3368, 0.232]}, {"w": "number", "b": [0.3431, 0.2122, 0.4202, 0.232]}, {"w": "of", "b": [0.4265, 0.2122, 0.4475, 0.232]}, {"w": "axes", "b": [0.4538, 0.2122, 0.4986, 0.232]}, {"w": "of", "b": [0.5049, 0.2122, 0.5259, 0.232]}, {"w": "the", "b": [0.5322, 0.2122, 0.5631, 0.232]}, {"w": "tensor", "b": [0.5694, 0.2122, 0.631, 0.232]}, {"w": "train_images,", "b": [0.6373, 0.2122, 0.8252, 0.2335]}, {"w": "the", "b": [0.8315, 0.2122, 0.8624, 0.232]}, {"w": "ndim", "b": [0.1294, 0.2347, 0.19, 0.2549]}, {"w": "attribute:", "b": [0.1963, 0.2336, 0.2874, 0.2534]}]}, {"id": "b_3", "type": "equation", "text": ">>> print(train_images.ndim) 3", "words": [{"w": ">>>", "b": [0.1357, 0.2723, 0.1698, 0.2874]}, {"w": "print(train_images.ndim)", "b": [0.1811, 0.2723, 0.4536, 0.2874]}, {"w": "3", "b": [0.1357, 0.2874, 0.1471, 0.3026]}]}, {"id": "b_4", "type": "paragraph", "text": "Here’s its shape:", "words": [{"w": "Here’s", "b": [0.1294, 0.3254, 0.1952, 0.3452]}, {"w": "its", "b": [0.2016, 0.3254, 0.2254, 0.3452]}, {"w": "shape:", "b": [0.2317, 0.3254, 0.2961, 0.3452]}]}, {"id": "b_5", "type": "equation", "text": ">>> print(train_images.shape) (60000, 28, 28)", "words": [{"w": ">>>", "b": [0.1357, 0.3632, 0.1698, 0.3783]}, {"w": "print(train_images.shape)", "b": [0.1811, 0.3632, 0.4649, 0.3783]}, {"w": "(60000,", "b": [0.1357, 0.3783, 0.2152, 0.3935]}, {"w": "28,", "b": [0.2265, 0.3783, 0.2606, 0.3935]}, {"w": "28)", "b": [0.2719, 0.3783, 0.306, 0.3935]}]}, {"id": "b_6", "type": "paragraph", "text": "And this is its data type, the dtype attribute:", "words": [{"w": "And", "b": [0.1294, 0.4164, 0.1729, 0.4361]}, {"w": "this", "b": [0.1792, 0.4164, 0.2156, 0.4361]}, {"w": "is", "b": [0.2219, 0.4164, 0.2387, 0.4361]}, {"w": "its", "b": [0.245, 0.4164, 0.2689, 0.4361]}, {"w": "data", "b": [0.2752, 0.4164, 0.3172, 0.4361]}, {"w": "type,", "b": [0.3235, 0.4164, 0.3733, 0.4361]}, {"w": "the", "b": [0.3796, 0.4164, 0.4104, 0.4361]}, {"w": "dtype", "b": [0.4167, 0.4174, 0.4923, 0.4376]}, {"w": "attribute:", "b": [0.4987, 0.4164, 0.5897, 0.4361]}]}, {"id": "b_7", "type": "equation", "text": ">>> print(train_images.dtype) uint8", "words": [{"w": ">>>", "b": [0.1357, 0.455, 0.1698, 0.4701]}, {"w": "print(train_images.dtype)", "b": [0.1811, 0.455, 0.4649, 0.4701]}, {"w": "uint8", "b": [0.1357, 0.4701, 0.1925, 0.4853]}]}, {"id": "b_8", "type": "paragraph", "text": "So what we have here is a 3D tensor of 8-bit integers. More precisely, it’s an array of 60,000 matrices of 28 × 8 integers. Each such matrix is a grayscale image, with coefficients between 0 and 255.", "words": [{"w": "So", "b": [0.1294, 0.5082, 0.1561, 0.5279]}, {"w": "what", "b": [0.1624, 0.5082, 0.2114, 0.5279]}, {"w": "we", "b": [0.2177, 0.5082, 0.2471, 0.5279]}, {"w": "have", "b": [0.2534, 0.5082, 0.301, 0.5279]}, {"w": "here", "b": [0.3074, 0.5082, 0.3508, 0.5279]}, {"w": "is", "b": [0.3571, 0.5082, 0.3739, 0.5279]}, {"w": "a", "b": [0.3802, 0.5082, 0.3914, 0.5279]}, {"w": "3D", "b": [0.3977, 0.5082, 0.4285, 0.5279]}, {"w": "tensor", "b": [0.4348, 0.5082, 0.4965, 0.5279]}, {"w": "of", "b": [0.5028, 0.5082, 0.5238, 0.5279]}, {"w": "8-bit", "b": [0.5301, 0.5082, 0.5778, 0.5279]}, {"w": "integers.", "b": [0.5841, 0.5082, 0.6703, 0.5279]}, {"w": "More", "b": [0.6766, 0.5082, 0.7312, 0.5279]}, {"w": "precisely,", "b": [0.7375, 0.5082, 0.8332, 0.5279]}, {"w": "it’s", "b": [0.8395, 0.5082, 0.8703, 0.5279]}, {"w": "an", "b": [0.1294, 0.5287, 0.1532, 0.5484]}, {"w": "array", "b": [0.1595, 0.5287, 0.2113, 0.5484]}, {"w": "of", "b": [0.2177, 0.5287, 0.2387, 0.5484]}, {"w": "60,000", "b": [0.245, 0.5287, 0.3143, 0.5484]}, {"w": "matrices", "b": [0.3206, 0.5287, 0.4061, 0.5484]}, {"w": "of", "b": [0.4124, 0.5287, 0.4334, 0.5484]}, {"w": "28", "b": [0.4397, 0.5287, 0.465, 0.5484]}, {"w": "×", "b": [0.4713, 0.5287, 0.4855, 0.5484]}, {"w": "8", "b": [0.4918, 0.5287, 0.5044, 0.5484]}, {"w": "integers.", "b": [0.5107, 0.5287, 0.5969, 0.5484]}, {"w": "Each", "b": [0.6031, 0.5287, 0.6536, 0.5484]}, {"w": "such", "b": [0.6599, 0.5287, 0.7061, 0.5484]}, {"w": "matrix", "b": [0.7124, 0.5287, 0.7783, 0.5484]}, {"w": "is", "b": [0.7846, 0.5287, 0.8014, 0.5484]}, {"w": "a", "b": [0.8077, 0.5287, 0.8189, 0.5484]}, {"w": "grayscale", "b": [0.1294, 0.5492, 0.2247, 0.5689]}, {"w": "image,", "b": [0.231, 0.5492, 0.2989, 0.5689]}, {"w": "with", "b": [0.3052, 0.5492, 0.3501, 0.5689]}, {"w": "coefficients", "b": [0.3564, 0.5492, 0.4736, 0.5689]}, {"w": "between", "b": [0.4799, 0.5492, 0.5639, 0.5689]}, {"w": "0", "b": [0.5702, 0.5492, 0.5829, 0.5689]}, {"w": "and", "b": [0.5892, 0.5492, 0.6256, 0.5689]}, {"w": "255.", "b": [0.6319, 0.5492, 0.676, 0.5689]}]}, {"id": "b_9", "type": "paragraph", "text": "Let’s display the fourth digit in this 3D tensor, using the library Matplotlib (part of the standard scientific Python suite); see figure 2.2.", "words": [{"w": "Let’s", "b": [0.1294, 0.5919, 0.1798, 0.6117]}, {"w": "display", "b": [0.1862, 0.5919, 0.259, 0.6117]}, {"w": "the", "b": [0.2653, 0.5919, 0.2962, 0.6117]}, {"w": "fourth", "b": [0.3025, 0.5919, 0.3641, 0.6117]}, {"w": "digit", "b": [0.3704, 0.5919, 0.4167, 0.6117]}, {"w": "in", "b": [0.423, 0.5919, 0.4426, 0.6117]}, {"w": "this", "b": [0.4489, 0.5919, 0.4854, 0.6117]}, {"w": "3D", "b": [0.4917, 0.5919, 0.5225, 0.6117]}, {"w": "tensor,", "b": [0.5288, 0.5919, 0.5957, 0.6117]}, {"w": "using", "b": [0.602, 0.5919, 0.6567, 0.6117]}, {"w": "the", "b": [0.663, 0.5919, 0.6938, 0.6117]}, {"w": "library", "b": [0.7001, 0.5919, 0.7674, 0.6117]}, {"w": "Matplotlib", "b": [0.1294, 0.6124, 0.2359, 0.6322]}, {"w": "(part", "b": [0.2422, 0.6124, 0.2899, 0.6322]}, {"w": "of", "b": [0.2962, 0.6124, 0.3172, 0.6322]}, {"w": "the", "b": [0.3235, 0.6124, 0.3543, 0.6322]}, {"w": "standard", "b": [0.3606, 0.6124, 0.4461, 0.6322]}, {"w": "scientific", "b": [0.4524, 0.6124, 0.5449, 0.6322]}, {"w": "Python", "b": [0.5512, 0.6124, 0.6227, 0.6322]}, {"w": "suite);", "b": [0.629, 0.6124, 0.692, 0.6322]}, {"w": "see", "b": [0.6983, 0.6124, 0.7305, 0.6322]}, {"w": "figure", "b": [0.7368, 0.6124, 0.797, 0.6322]}, {"w": "2.2.", "b": [0.8033, 0.6124, 0.8412, 0.6322]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 2.2. The fourth sample in our dataset", "words": [{"w": "Figure", "b": [0.1294, 0.6503, 0.1827, 0.6651]}, {"w": "2.2.", "b": [0.1874, 0.6503, 0.2158, 0.6651]}, {"w": "The", "b": [0.2205, 0.6503, 0.252, 0.6651]}, {"w": "fourth", "b": [0.2567, 0.6503, 0.3082, 0.6651]}, {"w": "sample", "b": [0.313, 0.6503, 0.3697, 0.6651]}, {"w": "in", "b": [0.3745, 0.6503, 0.3902, 0.6651]}, {"w": "our", "b": [0.395, 0.6503, 0.4234, 0.6651]}, {"w": "dataset", "b": [0.4281, 0.6503, 0.4859, 0.6651]}]}]}, {"page": 67, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 2.6. Displaying the fourth digit", "words": [{"w": "Listing", "b": [0.1294, 0.0852, 0.1862, 0.1]}, {"w": "2.6.", "b": [0.1909, 0.0852, 0.2193, 0.1]}, {"w": "Displaying", "b": [0.224, 0.0852, 0.3102, 0.1]}, {"w": "the", "b": [0.315, 0.0852, 0.3402, 0.1]}, {"w": "fourth", "b": [0.3449, 0.0852, 0.3964, 0.1]}, {"w": "digit", "b": [0.4011, 0.0852, 0.4379, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "digit = train_images[4] import matplotlib.pyplot as plt plt.imshow(digit, cmap=plt.cm.binary) plt.show()", "words": [{"w": "digit", "b": [0.1357, 0.1136, 0.1925, 0.1288]}, {"w": "=", "b": [0.2038, 0.1136, 0.2152, 0.1288]}, {"w": "train_images[4]", "b": [0.2265, 0.1136, 0.3968, 0.1288]}, {"w": "import", "b": [0.1357, 0.1439, 0.2038, 0.1591]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.1439, 0.4082, 0.1591]}, {"w": "as", "b": [0.4195, 0.1439, 0.4422, 0.1591]}, {"w": "plt", "b": [0.4536, 0.1439, 0.4876, 0.1591]}, {"w": "plt.imshow(digit,", "b": [0.1357, 0.1591, 0.3287, 0.1742]}, {"w": "cmap=plt.cm.binary)", "b": [0.34, 0.1591, 0.5557, 0.1742]}, {"w": "plt.show()", "b": [0.1357, 0.1742, 0.2492, 0.1894]}]}, {"id": "b_2", "type": "paragraph", "text": "2.2.6. Manipulating tensors in Numpy", "words": [{"w": "2.2.6.", "b": [0.1294, 0.2167, 0.1862, 0.2364]}, {"w": "Manipulating", "b": [0.1925, 0.2167, 0.3397, 0.2364]}, {"w": "tensors", "b": [0.346, 0.2167, 0.423, 0.2364]}, {"w": "in", "b": [0.4293, 0.2167, 0.4504, 0.2364]}, {"w": "Numpy", "b": [0.4567, 0.2167, 0.5366, 0.2364]}]}, {"id": "b_3", "type": "paragraph", "text": "In the previous example, we selected a specific digit alongside the first axis using the syntax train_images[i]. Selecting specific elements in a tensor is called tensor slicing. Let’s look at the tensor-slicing operations you can do on Numpy arrays.", "words": [{"w": "In", "b": [0.1294, 0.2595, 0.1504, 0.2792]}, {"w": "the", "b": [0.1567, 0.2595, 0.1876, 0.2792]}, {"w": "previous", "b": [0.1939, 0.2595, 0.2807, 0.2792]}, {"w": "example,", "b": [0.287, 0.2595, 0.3788, 0.2792]}, {"w": "we", "b": [0.3851, 0.2595, 0.4145, 0.2792]}, {"w": "selected", "b": [0.4208, 0.2595, 0.5021, 0.2792]}, {"w": "a", "b": [0.5083, 0.2595, 0.5195, 0.2792]}, {"w": "specific", "b": [0.5258, 0.2595, 0.6043, 0.2792]}, {"w": "digit", "b": [0.6106, 0.2595, 0.6569, 0.2792]}, {"w": "alongside", "b": [0.6632, 0.2595, 0.7599, 0.2792]}, {"w": "the", "b": [0.7662, 0.2595, 0.797, 0.2792]}, {"w": "first", "b": [0.8033, 0.2595, 0.8439, 0.2792]}, {"w": "axis", "b": [0.1294, 0.28, 0.1701, 0.2997]}, {"w": "using", "b": [0.1764, 0.28, 0.231, 0.2997]}, {"w": "the", "b": [0.2373, 0.28, 0.2682, 0.2997]}, {"w": "syntax", "b": [0.2745, 0.28, 0.3403, 0.2997]}, {"w": "train_images[i].", "b": [0.3466, 0.28, 0.58, 0.3012]}, {"w": "Selecting", "b": [0.5863, 0.28, 0.6802, 0.2997]}, {"w": "specific", "b": [0.6865, 0.28, 0.7649, 0.2997]}, {"w": "elements", "b": [0.7712, 0.28, 0.8609, 0.2997]}, {"w": "in", "b": [0.1294, 0.3014, 0.149, 0.3211]}, {"w": "a", "b": [0.1553, 0.3014, 0.1665, 0.3211]}, {"w": "tensor", "b": [0.1729, 0.3014, 0.2345, 0.3211]}, {"w": "is", "b": [0.2408, 0.3014, 0.2576, 0.3211]}, {"w": "called", "b": [0.2639, 0.3014, 0.3242, 0.3211]}, {"w": "tensor", "b": [0.3304, 0.3014, 0.3935, 0.3211]}, {"w": "slicing.", "b": [0.3998, 0.3014, 0.4734, 0.3211]}, {"w": "Let’s", "b": [0.4797, 0.3014, 0.5301, 0.3211]}, {"w": "look", "b": [0.5364, 0.3014, 0.5813, 0.3211]}, {"w": "at", "b": [0.5876, 0.3014, 0.6058, 0.3211]}, {"w": "the", "b": [0.6121, 0.3014, 0.6429, 0.3211]}, {"w": "tensor-slicing", "b": [0.6492, 0.3014, 0.7861, 0.3211]}, {"w": "operations", "b": [0.1294, 0.3219, 0.2345, 0.3416]}, {"w": "you", "b": [0.2408, 0.3219, 0.2786, 0.3416]}, {"w": "can", "b": [0.285, 0.3219, 0.32, 0.3416]}, {"w": "do", "b": [0.3263, 0.3219, 0.3515, 0.3416]}, {"w": "on", "b": [0.3578, 0.3219, 0.383, 0.3416]}, {"w": "Numpy", "b": [0.3893, 0.3219, 0.465, 0.3416]}, {"w": "arrays.", "b": [0.4713, 0.3219, 0.5393, 0.3416]}]}, {"id": "b_4", "type": "paragraph", "text": "The following example selects digits #10 to #100 (#100 isn’t included) and puts them in an array of shape (90, 28, 28):", "words": [{"w": "The", "b": [0.1294, 0.3647, 0.1686, 0.3844]}, {"w": "following", "b": [0.1749, 0.3647, 0.273, 0.3844]}, {"w": "example", "b": [0.2794, 0.3647, 0.3648, 0.3844]}, {"w": "selects", "b": [0.3711, 0.3647, 0.4384, 0.3844]}, {"w": "digits", "b": [0.4447, 0.3647, 0.5008, 0.3844]}, {"w": "#10", "b": [0.5071, 0.3647, 0.5449, 0.3844]}, {"w": "to", "b": [0.5512, 0.3647, 0.5708, 0.3844]}, {"w": "#100", "b": [0.5771, 0.3647, 0.6276, 0.3844]}, {"w": "(#100", "b": [0.6339, 0.3647, 0.6928, 0.3844]}, {"w": "isn’t", "b": [0.6991, 0.3647, 0.7434, 0.3844]}, {"w": "included)", "b": [0.7497, 0.3647, 0.845, 0.3844]}, {"w": "and", "b": [0.1294, 0.3852, 0.1658, 0.4049]}, {"w": "puts", "b": [0.1721, 0.3852, 0.2142, 0.4049]}, {"w": "them", "b": [0.2205, 0.3852, 0.271, 0.4049]}, {"w": "in", "b": [0.2773, 0.3852, 0.2969, 0.4049]}, {"w": "an", "b": [0.3032, 0.3852, 0.327, 0.4049]}, {"w": "array", "b": [0.3333, 0.3852, 0.3851, 0.4049]}, {"w": "of", "b": [0.3914, 0.3852, 0.4124, 0.4049]}, {"w": "shape", "b": [0.4188, 0.3852, 0.4762, 0.4049]}, {"w": "(90,", "b": [0.4825, 0.3862, 0.543, 0.4064]}, {"w": "28,", "b": [0.5581, 0.3862, 0.6035, 0.4064]}, {"w": "28):", "b": [0.6187, 0.3852, 0.6711, 0.4064]}]}, {"id": "b_5", "type": "equation", "text": ">>> my_slice = train_images[10:100] >>> print(my_slice.shape) (90, 28, 28)", "words": [{"w": ">>>", "b": [0.1357, 0.4238, 0.1698, 0.4389]}, {"w": "my_slice", "b": [0.1811, 0.4238, 0.2719, 0.4389]}, {"w": "=", "b": [0.2833, 0.4238, 0.2946, 0.4389]}, {"w": "train_images[10:100]", "b": [0.306, 0.4238, 0.533, 0.4389]}, {"w": ">>>", "b": [0.1357, 0.4389, 0.1698, 0.4541]}, {"w": "print(my_slice.shape)", "b": [0.1811, 0.4389, 0.4195, 0.4541]}, {"w": "(90,", "b": [0.1357, 0.4541, 0.1811, 0.4692]}, {"w": "28,", "b": [0.1925, 0.4541, 0.2265, 0.4692]}, {"w": "28)", "b": [0.2379, 0.4541, 0.2719, 0.4692]}]}, {"id": "b_6", "type": "paragraph", "text": "It’s equivalent to this more detailed notation, which specifies a start index and stop index for the slice along each tensor axis. Note that : is equivalent to selecting the entire axis:", "words": [{"w": "It’s", "b": [0.1294, 0.4921, 0.1616, 0.5119]}, {"w": "equivalent", "b": [0.1679, 0.4921, 0.273, 0.5119]}, {"w": "to", "b": [0.2793, 0.4921, 0.299, 0.5119]}, {"w": "this", "b": [0.3053, 0.4921, 0.3417, 0.5119]}, {"w": "more", "b": [0.348, 0.4921, 0.3999, 0.5119]}, {"w": "detailed", "b": [0.4062, 0.4921, 0.486, 0.5119]}, {"w": "notation,", "b": [0.4924, 0.4921, 0.5813, 0.5119]}, {"w": "which", "b": [0.5877, 0.4921, 0.6493, 0.5119]}, {"w": "specifies", "b": [0.6556, 0.4921, 0.7439, 0.5119]}, {"w": "a", "b": [0.7502, 0.4921, 0.7614, 0.5119]}, {"w": "start", "b": [0.7677, 0.4921, 0.8111, 0.5119]}, {"w": "index", "b": [0.1294, 0.5126, 0.1855, 0.5324]}, {"w": "and", "b": [0.1918, 0.5126, 0.2282, 0.5324]}, {"w": "stop", "b": [0.2345, 0.5126, 0.2766, 0.5324]}, {"w": "index", "b": [0.2829, 0.5126, 0.3389, 0.5324]}, {"w": "for", "b": [0.3452, 0.5126, 0.3746, 0.5324]}, {"w": "the", "b": [0.3809, 0.5126, 0.4118, 0.5324]}, {"w": "slice", "b": [0.4181, 0.5126, 0.4643, 0.5324]}, {"w": "along", "b": [0.4706, 0.5126, 0.5267, 0.5324]}, {"w": "each", "b": [0.533, 0.5126, 0.5792, 0.5324]}, {"w": "tensor", "b": [0.5855, 0.5126, 0.6471, 0.5324]}, {"w": "axis.", "b": [0.6534, 0.5126, 0.7003, 0.5324]}, {"w": "Note", "b": [0.7066, 0.5126, 0.7557, 0.5324]}, {"w": "that", "b": [0.762, 0.5126, 0.7998, 0.5324]}, {"w": ":", "b": [0.8061, 0.5137, 0.8212, 0.5339]}, {"w": "is", "b": [0.8275, 0.5126, 0.8444, 0.5324]}, {"w": "equivalent", "b": [0.1294, 0.534, 0.2345, 0.5537]}, {"w": "to", "b": [0.2408, 0.534, 0.2604, 0.5537]}, {"w": "selecting", "b": [0.2667, 0.534, 0.3564, 0.5537]}, {"w": "the", "b": [0.3627, 0.534, 0.3936, 0.5537]}, {"w": "entire", "b": [0.3999, 0.534, 0.4573, 0.5537]}, {"w": "axis:", "b": [0.4636, 0.534, 0.5113, 0.5537]}]}, {"id": "b_7", "type": "paragraph", "text": ">>> my_slice = train_images[10:100, :, :] 1 >>> my_slice.shape (90, 28, 28) >>> my_slice = train_images[10:100, 0:28, 0:28] 2 >>> my_slice.shape (90, 28, 28)", "words": [{"w": ">>>", "b": [0.1357, 0.5717, 0.1698, 0.5869]}, {"w": "my_slice", "b": [0.1811, 0.5717, 0.2719, 0.5869]}, {"w": "=", "b": [0.2833, 0.5717, 0.2946, 0.5869]}, {"w": "train_images[10:100,", "b": [0.306, 0.5717, 0.533, 0.5869]}, {"w": ":,", "b": [0.5444, 0.5717, 0.5671, 0.5869]}, {"w": ":]", "b": [0.5784, 0.5717, 0.6011, 0.5869]}, {"w": "1", "b": [0.8056, 0.5717, 0.8169, 0.5869]}, {"w": ">>>", "b": [0.1357, 0.5869, 0.1698, 0.602]}, {"w": "my_slice.shape", "b": [0.1811, 0.5869, 0.34, 0.602]}, {"w": "(90,", "b": [0.1357, 0.602, 0.1811, 0.6172]}, {"w": "28,", "b": [0.1925, 0.602, 0.2265, 0.6172]}, {"w": "28)", "b": [0.2379, 0.602, 0.2719, 0.6172]}, {"w": ">>>", "b": [0.1357, 0.6172, 0.1698, 0.6323]}, {"w": "my_slice", "b": [0.1811, 0.6172, 0.2719, 0.6323]}, {"w": "=", "b": [0.2833, 0.6172, 0.2946, 0.6323]}, {"w": "train_images[10:100,", "b": [0.306, 0.6172, 0.533, 0.6323]}, {"w": "0:28,", "b": [0.5444, 0.6172, 0.6011, 0.6323]}, {"w": "0:28]", "b": [0.6125, 0.6172, 0.6692, 0.6323]}, {"w": "2", "b": [0.8056, 0.6172, 0.8169, 0.6323]}, {"w": ">>>", "b": [0.1357, 0.6324, 0.1698, 0.6475]}, {"w": "my_slice.shape", "b": [0.1811, 0.6324, 0.34, 0.6475]}, {"w": "(90,", "b": [0.1357, 0.6475, 0.1811, 0.6626]}, {"w": "28,", "b": [0.1925, 0.6475, 0.2265, 0.6626]}, {"w": "28)", "b": [0.2379, 0.6475, 0.2719, 0.6626]}]}, {"id": "b_8", "type": "paragraph", "text": "1 Equivalent to the previous example 2 Also equivalent to the previous example", "words": [{"w": "1", "b": [0.1799, 0.6811, 0.1925, 0.7008]}, {"w": "Equivalent", "b": [0.1988, 0.6811, 0.3165, 0.7008]}, {"w": "to", "b": [0.3228, 0.6811, 0.3439, 0.7008]}, {"w": "the", "b": [0.3502, 0.6811, 0.3838, 0.7008]}, {"w": "previous", "b": [0.3901, 0.6811, 0.4821, 0.7008]}, {"w": "example", "b": [0.4884, 0.6811, 0.5781, 0.7008]}, {"w": "2", "b": [0.1799, 0.7016, 0.1925, 0.7213]}, {"w": "Also", "b": [0.1988, 0.7016, 0.2464, 0.7213]}, {"w": "equivalent", "b": [0.2527, 0.7016, 0.3649, 0.7213]}, {"w": "to", "b": [0.3712, 0.7016, 0.3922, 0.7213]}, {"w": "the", "b": [0.3985, 0.7016, 0.4321, 0.7213]}, {"w": "previous", "b": [0.4384, 0.7016, 0.5305, 0.7213]}, {"w": "example", "b": [0.5368, 0.7016, 0.6265, 0.7213]}]}, {"id": "b_9", "type": "paragraph", "text": "In general, you may select between any two indices along each tensor axis. For instance, in order to select 14 × 14 pixels in the bottom-right corner of all images, you do this:", "words": [{"w": "In", "b": [0.1294, 0.7444, 0.1504, 0.7641]}, {"w": "general,", "b": [0.1567, 0.7444, 0.2373, 0.7641]}, {"w": "you", "b": [0.2436, 0.7444, 0.2814, 0.7641]}, {"w": "may", "b": [0.2877, 0.7444, 0.3312, 0.7641]}, {"w": "select", "b": [0.3375, 0.7444, 0.3949, 0.7641]}, {"w": "between", "b": [0.4012, 0.7444, 0.4853, 0.7641]}, {"w": "any", "b": [0.4916, 0.7444, 0.528, 0.7641]}, {"w": "two", "b": [0.5343, 0.7444, 0.5721, 0.7641]}, {"w": "indices", "b": [0.5785, 0.7444, 0.6499, 0.7641]}, {"w": "along", "b": [0.6562, 0.7444, 0.7123, 0.7641]}, {"w": "each", "b": [0.7186, 0.7444, 0.7648, 0.7641]}, {"w": "tensor", "b": [0.7711, 0.7444, 0.8328, 0.7641]}, {"w": "axis.", "b": [0.1294, 0.7649, 0.1764, 0.7846]}, {"w": "For", "b": [0.1827, 0.7649, 0.2177, 0.7846]}, {"w": "instance,", "b": [0.224, 0.7649, 0.313, 0.7846]}, {"w": "in", "b": [0.3193, 0.7649, 0.3389, 0.7846]}, {"w": "order", "b": [0.3452, 0.7649, 0.3984, 0.7846]}, {"w": "to", "b": [0.4048, 0.7649, 0.4244, 0.7846]}, {"w": "select", "b": [0.4307, 0.7649, 0.4881, 0.7846]}, {"w": "14", "b": [0.4944, 0.7649, 0.5197, 0.7846]}, {"w": "×", "b": [0.526, 0.7649, 0.5402, 0.7846]}, {"w": "14", "b": [0.5465, 0.7649, 0.5717, 0.7846]}, {"w": "pixels", "b": [0.578, 0.7649, 0.6383, 0.7846]}, {"w": "in", "b": [0.6445, 0.7649, 0.6642, 0.7846]}, {"w": "the", "b": [0.6705, 0.7649, 0.7013, 0.7846]}, {"w": "bottom-right", "b": [0.7076, 0.7649, 0.8351, 0.7846]}, {"w": "corner", "b": [0.1294, 0.7854, 0.1938, 0.8051]}, {"w": "of", "b": [0.2001, 0.7854, 0.2212, 0.8051]}, {"w": "all", "b": [0.2275, 0.7854, 0.2527, 0.8051]}, {"w": "images,", "b": [0.259, 0.7854, 0.3368, 0.8051]}, {"w": "you", "b": [0.3431, 0.7854, 0.3809, 0.8051]}, {"w": "do", "b": [0.3872, 0.7854, 0.4124, 0.8051]}, {"w": "this:", "b": [0.4188, 0.7854, 0.4622, 0.8051]}]}, {"id": "b_10", "type": "equation", "text": "my_slice = train_images[:, 14:, 14:]", "words": [{"w": "my_slice", "b": [0.1357, 0.8231, 0.2265, 0.8382]}, {"w": "=", "b": [0.2379, 0.8231, 0.2492, 0.8382]}, {"w": "train_images[:,", "b": [0.2606, 0.8231, 0.4309, 0.8382]}, {"w": "14:,", "b": [0.4422, 0.8231, 0.4876, 0.8382]}, {"w": "14:]", "b": [0.499, 0.8231, 0.5444, 0.8382]}]}, {"id": "b_11", "type": "paragraph", "text": "It’s also possible to use negative indices. Much like negative indices in Python lists, they indicate a position relative to the end of the current", "words": [{"w": "It’s", "b": [0.1294, 0.8611, 0.1616, 0.8809]}, {"w": "also", "b": [0.1679, 0.8611, 0.2086, 0.8809]}, {"w": "possible", "b": [0.2149, 0.8611, 0.2976, 0.8809]}, {"w": "to", "b": [0.3039, 0.8611, 0.3235, 0.8809]}, {"w": "use", "b": [0.3298, 0.8611, 0.3634, 0.8809]}, {"w": "negative", "b": [0.3698, 0.8611, 0.4552, 0.8809]}, {"w": "indices.", "b": [0.4615, 0.8611, 0.5393, 0.8809]}, {"w": "Much", "b": [0.5456, 0.8611, 0.6045, 0.8809]}, {"w": "like", "b": [0.6108, 0.8611, 0.6486, 0.8809]}, {"w": "negative", "b": [0.6549, 0.8611, 0.7404, 0.8809]}, {"w": "indices", "b": [0.7467, 0.8611, 0.8181, 0.8809]}, {"w": "in", "b": [0.8244, 0.8611, 0.8441, 0.8809]}, {"w": "Python", "b": [0.1294, 0.8816, 0.2009, 0.9014]}, {"w": "lists,", "b": [0.2072, 0.8816, 0.2542, 0.9014]}, {"w": "they", "b": [0.2605, 0.8816, 0.3039, 0.9014]}, {"w": "indicate", "b": [0.3102, 0.8816, 0.3901, 0.9014]}, {"w": "a", "b": [0.3964, 0.8816, 0.4076, 0.9014]}, {"w": "position", "b": [0.4139, 0.8816, 0.4952, 0.9014]}, {"w": "relative", "b": [0.5015, 0.8816, 0.5772, 0.9014]}, {"w": "to", "b": [0.5834, 0.8816, 0.603, 0.9014]}, {"w": "the", "b": [0.6093, 0.8816, 0.6402, 0.9014]}, {"w": "end", "b": [0.6465, 0.8816, 0.6829, 0.9014]}, {"w": "of", "b": [0.6892, 0.8816, 0.7102, 0.9014]}, {"w": "the", "b": [0.7165, 0.8816, 0.7473, 0.9014]}, {"w": "current", "b": [0.7536, 0.8816, 0.8251, 0.9014]}]}]}, {"page": 68, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "axis. In order to crop the images to patches of 14 × 14 pixels centered in the middle, you do this:", "words": [{"w": "axis.", "b": [0.1294, 0.0857, 0.1764, 0.1054]}, {"w": "In", "b": [0.1827, 0.0857, 0.2037, 0.1054]}, {"w": "order", "b": [0.21, 0.0857, 0.2632, 0.1054]}, {"w": "to", "b": [0.2695, 0.0857, 0.2891, 0.1054]}, {"w": "crop", "b": [0.2954, 0.0857, 0.3403, 0.1054]}, {"w": "the", "b": [0.3466, 0.0857, 0.3774, 0.1054]}, {"w": "images", "b": [0.3837, 0.0857, 0.4552, 0.1054]}, {"w": "to", "b": [0.4615, 0.0857, 0.4811, 0.1054]}, {"w": "patches", "b": [0.4874, 0.0857, 0.5631, 0.1054]}, {"w": "of", "b": [0.5694, 0.0857, 0.5904, 0.1054]}, {"w": "14", "b": [0.5967, 0.0857, 0.6219, 0.1054]}, {"w": "×", "b": [0.6282, 0.0857, 0.6425, 0.1054]}, {"w": "14", "b": [0.6488, 0.0857, 0.674, 0.1054]}, {"w": "pixels", "b": [0.6803, 0.0857, 0.7406, 0.1054]}, {"w": "centered", "b": [0.7469, 0.0857, 0.8323, 0.1054]}, {"w": "in", "b": [0.8386, 0.0857, 0.8582, 0.1054]}, {"w": "the", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "middle,", "b": [0.1665, 0.1062, 0.2429, 0.1259]}, {"w": "you", "b": [0.2492, 0.1062, 0.2871, 0.1259]}, {"w": "do", "b": [0.2934, 0.1062, 0.3186, 0.1259]}, {"w": "this:", "b": [0.3249, 0.1062, 0.3684, 0.1259]}]}, {"id": "b_1", "type": "equation", "text": "my_slice = train_images[:, 7:-7, 7:-7]", "words": [{"w": "my_slice", "b": [0.1357, 0.1439, 0.2265, 0.1591]}, {"w": "=", "b": [0.2379, 0.1439, 0.2492, 0.1591]}, {"w": "train_images[:,", "b": [0.2606, 0.1439, 0.4309, 0.1591]}, {"w": "7:-7,", "b": [0.4422, 0.1439, 0.499, 0.1591]}, {"w": "7:-7]", "b": [0.5103, 0.1439, 0.5671, 0.1591]}]}, {"id": "b_2", "type": "paragraph", "text": "2.2.7. The notion of data batches", "words": [{"w": "2.2.7.", "b": [0.1294, 0.1864, 0.1862, 0.2061]}, {"w": "The", "b": [0.1925, 0.1864, 0.2345, 0.2061]}, {"w": "notion", "b": [0.2408, 0.1864, 0.3095, 0.2061]}, {"w": "of", "b": [0.3158, 0.1864, 0.3368, 0.2061]}, {"w": "data", "b": [0.3431, 0.1864, 0.3908, 0.2061]}, {"w": "batches", "b": [0.3971, 0.1864, 0.4784, 0.2061]}]}, {"id": "b_3", "type": "paragraph", "text": "In general, the first axis (axis 0, because indexing starts at 0) in all data tensors you’ll come across in deep learning will be the samples axis (sometimes called the samples dimension). In the MNIST example, samples are images of digits.", "words": [{"w": "In", "b": [0.1294, 0.2292, 0.1504, 0.2489]}, {"w": "general,", "b": [0.1567, 0.2292, 0.2373, 0.2489]}, {"w": "the", "b": [0.2436, 0.2292, 0.2744, 0.2489]}, {"w": "first", "b": [0.2807, 0.2292, 0.3214, 0.2489]}, {"w": "axis", "b": [0.3277, 0.2292, 0.3683, 0.2489]}, {"w": "(axis", "b": [0.3746, 0.2292, 0.4236, 0.2489]}, {"w": "0,", "b": [0.43, 0.2292, 0.4489, 0.2489]}, {"w": "because", "b": [0.4552, 0.2292, 0.535, 0.2489]}, {"w": "indexing", "b": [0.5413, 0.2292, 0.6296, 0.2489]}, {"w": "starts", "b": [0.6359, 0.2292, 0.6892, 0.2489]}, {"w": "at", "b": [0.6955, 0.2292, 0.7137, 0.2489]}, {"w": "0)", "b": [0.72, 0.2292, 0.741, 0.2489]}, {"w": "in", "b": [0.7473, 0.2292, 0.7669, 0.2489]}, {"w": "all", "b": [0.7732, 0.2292, 0.7985, 0.2489]}, {"w": "data", "b": [0.8048, 0.2292, 0.8468, 0.2489]}, {"w": "tensors", "b": [0.1294, 0.2497, 0.2009, 0.2694]}, {"w": "you’ll", "b": [0.2072, 0.2497, 0.2674, 0.2694]}, {"w": "come", "b": [0.2738, 0.2497, 0.3284, 0.2694]}, {"w": "across", "b": [0.3347, 0.2497, 0.3977, 0.2694]}, {"w": "in", "b": [0.404, 0.2497, 0.4237, 0.2694]}, {"w": "deep", "b": [0.43, 0.2497, 0.4776, 0.2694]}, {"w": "learning", "b": [0.4839, 0.2497, 0.5666, 0.2694]}, {"w": "will", "b": [0.5728, 0.2497, 0.6121, 0.2694]}, {"w": "be", "b": [0.6184, 0.2497, 0.6422, 0.2694]}, {"w": "the", "b": [0.6485, 0.2497, 0.6793, 0.2694]}, {"w": "samples", "b": [0.6856, 0.2497, 0.7669, 0.2694]}, {"w": "axis", "b": [0.7732, 0.2497, 0.8138, 0.2694]}, {"w": "(sometimes", "b": [0.1294, 0.2702, 0.2457, 0.2899]}, {"w": "called", "b": [0.252, 0.2702, 0.3123, 0.2899]}, {"w": "the", "b": [0.3186, 0.2702, 0.3494, 0.2899]}, {"w": "samples", "b": [0.3557, 0.2702, 0.4369, 0.2899]}, {"w": "dimension).", "b": [0.4432, 0.2702, 0.5616, 0.2899]}, {"w": "In", "b": [0.568, 0.2702, 0.589, 0.2899]}, {"w": "the", "b": [0.5953, 0.2702, 0.6261, 0.2899]}, {"w": "MNIST", "b": [0.6324, 0.2702, 0.7109, 0.2899]}, {"w": "example,", "b": [0.7172, 0.2702, 0.809, 0.2899]}, {"w": "samples", "b": [0.1294, 0.2907, 0.2107, 0.3104]}, {"w": "are", "b": [0.217, 0.2907, 0.2478, 0.3104]}, {"w": "images", "b": [0.2541, 0.2907, 0.3256, 0.3104]}, {"w": "of", "b": [0.3319, 0.2907, 0.3529, 0.3104]}, {"w": "digits.", "b": [0.3592, 0.2907, 0.4216, 0.3104]}]}, {"id": "b_4", "type": "paragraph", "text": "In addition, deep-learning models don’t process an entire dataset at once; rather, they break the data into small batches. Concretely, here’s one batch of our MNIST digits, with batch size of 128:", "words": [{"w": "In", "b": [0.1294, 0.3335, 0.1504, 0.3532]}, {"w": "addition,", "b": [0.1567, 0.3335, 0.2457, 0.3532]}, {"w": "deep-learning", "b": [0.252, 0.3335, 0.3907, 0.3532]}, {"w": "models", "b": [0.397, 0.3335, 0.4699, 0.3532]}, {"w": "don’t", "b": [0.4762, 0.3335, 0.529, 0.3532]}, {"w": "process", "b": [0.5353, 0.3335, 0.6109, 0.3532]}, {"w": "an", "b": [0.6172, 0.3335, 0.641, 0.3532]}, {"w": "entire", "b": [0.6473, 0.3335, 0.7048, 0.3532]}, {"w": "dataset", "b": [0.7111, 0.3335, 0.7811, 0.3532]}, {"w": "at", "b": [0.7875, 0.3335, 0.8057, 0.3532]}, {"w": "once;", "b": [0.812, 0.3335, 0.8666, 0.3532]}, {"w": "rather,", "b": [0.1294, 0.354, 0.1935, 0.3737]}, {"w": "they", "b": [0.1998, 0.354, 0.2433, 0.3737]}, {"w": "break", "b": [0.2496, 0.354, 0.3056, 0.3737]}, {"w": "the", "b": [0.3119, 0.354, 0.3427, 0.3737]}, {"w": "data", "b": [0.349, 0.354, 0.3911, 0.3737]}, {"w": "into", "b": [0.3974, 0.354, 0.4366, 0.3737]}, {"w": "small", "b": [0.4429, 0.354, 0.4976, 0.3737]}, {"w": "batches.", "b": [0.5039, 0.354, 0.5859, 0.3737]}, {"w": "Concretely,", "b": [0.5921, 0.354, 0.7074, 0.3737]}, {"w": "here’s", "b": [0.7137, 0.354, 0.774, 0.3737]}, {"w": "one", "b": [0.7803, 0.354, 0.8167, 0.3737]}, {"w": "batch", "b": [0.1294, 0.3745, 0.1841, 0.3942]}, {"w": "of", "b": [0.1904, 0.3745, 0.2114, 0.3942]}, {"w": "our", "b": [0.2177, 0.3745, 0.2513, 0.3942]}, {"w": "MNIST", "b": [0.2576, 0.3745, 0.3361, 0.3942]}, {"w": "digits,", "b": [0.3424, 0.3745, 0.4048, 0.3942]}, {"w": "with", "b": [0.4111, 0.3745, 0.4559, 0.3942]}, {"w": "batch", "b": [0.4622, 0.3745, 0.5169, 0.3942]}, {"w": "size", "b": [0.5232, 0.3745, 0.5624, 0.3942]}, {"w": "of", "b": [0.5687, 0.3745, 0.5897, 0.3942]}, {"w": "128:", "b": [0.596, 0.3745, 0.6409, 0.3942]}]}, {"id": "b_5", "type": "equation", "text": "batch = train_images[:128]", "words": [{"w": "batch", "b": [0.1357, 0.4122, 0.1925, 0.4273]}, {"w": "=", "b": [0.2038, 0.4122, 0.2152, 0.4273]}, {"w": "train_images[:128]", "b": [0.2265, 0.4122, 0.4309, 0.4273]}]}, {"id": "b_6", "type": "paragraph", "text": "And here’s the next batch:", "words": [{"w": "And", "b": [0.1294, 0.4502, 0.1729, 0.47]}, {"w": "here’s", "b": [0.1792, 0.4502, 0.2394, 0.47]}, {"w": "the", "b": [0.2457, 0.4502, 0.2765, 0.47]}, {"w": "next", "b": [0.2828, 0.4502, 0.3263, 0.47]}, {"w": "batch:", "b": [0.3326, 0.4502, 0.3942, 0.47]}]}, {"id": "b_7", "type": "equation", "text": "batch = train_images[128:256]", "words": [{"w": "batch", "b": [0.1357, 0.488, 0.1925, 0.5031]}, {"w": "=", "b": [0.2038, 0.488, 0.2152, 0.5031]}, {"w": "train_images[128:256]", "b": [0.2265, 0.488, 0.4649, 0.5031]}]}, {"id": "b_8", "type": "paragraph", "text": "And the nth batch:", "words": [{"w": "And", "b": [0.1294, 0.526, 0.1729, 0.5457]}, {"w": "the", "b": [0.1792, 0.526, 0.21, 0.5457]}, {"w": "nth", "b": [0.2163, 0.526, 0.251, 0.5472]}, {"w": "batch:", "b": [0.2574, 0.526, 0.319, 0.5457]}]}, {"id": "b_9", "type": "equation", "text": "batch = train_images[128 * n:128 * (n + 1)]", "words": [{"w": "batch", "b": [0.1357, 0.5646, 0.1925, 0.5798]}, {"w": "=", "b": [0.2038, 0.5646, 0.2152, 0.5798]}, {"w": "train_images[128", "b": [0.2265, 0.5646, 0.4082, 0.5798]}, {"w": "*", "b": [0.4195, 0.5646, 0.4309, 0.5798]}, {"w": "n:128", "b": [0.4422, 0.5646, 0.499, 0.5798]}, {"w": "*", "b": [0.5103, 0.5646, 0.5217, 0.5798]}, {"w": "(n", "b": [0.533, 0.5646, 0.5557, 0.5798]}, {"w": "+", "b": [0.5671, 0.5646, 0.5784, 0.5798]}, {"w": "1)]", "b": [0.5898, 0.5646, 0.6238, 0.5798]}]}, {"id": "b_10", "type": "paragraph", "text": "When considering such a batch tensor, the first axis (axis 0) is called the batch axis or batch dimension. This is a term you’ll frequently encounter when using Keras and other deep-learning libraries.", "words": [{"w": "When", "b": [0.1294, 0.6026, 0.1897, 0.6224]}, {"w": "considering", "b": [0.196, 0.6026, 0.3137, 0.6224]}, {"w": "such", "b": [0.32, 0.6026, 0.3662, 0.6224]}, {"w": "a", "b": [0.3725, 0.6026, 0.3837, 0.6224]}, {"w": "batch", "b": [0.39, 0.6026, 0.4447, 0.6224]}, {"w": "tensor,", "b": [0.451, 0.6026, 0.5179, 0.6224]}, {"w": "the", "b": [0.5242, 0.6026, 0.555, 0.6224]}, {"w": "first", "b": [0.5613, 0.6026, 0.602, 0.6224]}, {"w": "axis", "b": [0.6083, 0.6026, 0.6489, 0.6224]}, {"w": "(axis", "b": [0.6552, 0.6026, 0.7042, 0.6224]}, {"w": "0)", "b": [0.7105, 0.6026, 0.7316, 0.6224]}, {"w": "is", "b": [0.7379, 0.6026, 0.7547, 0.6224]}, {"w": "called", "b": [0.761, 0.6026, 0.8212, 0.6224]}, {"w": "the", "b": [0.8275, 0.6026, 0.8584, 0.6224]}, {"w": "batch", "b": [0.1294, 0.6231, 0.1855, 0.6429]}, {"w": "axis", "b": [0.1918, 0.6231, 0.2324, 0.6429]}, {"w": "or", "b": [0.2387, 0.6231, 0.2597, 0.6429]}, {"w": "batch", "b": [0.266, 0.6231, 0.3221, 0.6429]}, {"w": "dimension.", "b": [0.3284, 0.6231, 0.4383, 0.6429]}, {"w": "This", "b": [0.4447, 0.6231, 0.4895, 0.6429]}, {"w": "is", "b": [0.4958, 0.6231, 0.5126, 0.6429]}, {"w": "a", "b": [0.5189, 0.6231, 0.5301, 0.6429]}, {"w": "term", "b": [0.5365, 0.6231, 0.5827, 0.6429]}, {"w": "you’ll", "b": [0.589, 0.6231, 0.6493, 0.6429]}, {"w": "frequently", "b": [0.6556, 0.6231, 0.7592, 0.6429]}, {"w": "encounter", "b": [0.7656, 0.6231, 0.865, 0.6429]}, {"w": "when", "b": [0.1294, 0.6436, 0.1841, 0.6634]}, {"w": "using", "b": [0.1904, 0.6436, 0.245, 0.6634]}, {"w": "Keras", "b": [0.2513, 0.6436, 0.3102, 0.6634]}, {"w": "and", "b": [0.3165, 0.6436, 0.3529, 0.6634]}, {"w": "other", "b": [0.3592, 0.6436, 0.411, 0.6634]}, {"w": "deep-learning", "b": [0.4173, 0.6436, 0.556, 0.6634]}, {"w": "libraries.", "b": [0.5623, 0.6436, 0.6513, 0.6634]}]}, {"id": "b_11", "type": "equation", "text": "2.2.8. Real-world examples of data tensors", "words": [{"w": "2.2.8.", "b": [0.1294, 0.6909, 0.1862, 0.7106]}, {"w": "Real-world", "b": [0.1925, 0.6909, 0.313, 0.7106]}, {"w": "examples", "b": [0.3193, 0.6909, 0.4188, 0.7106]}, {"w": "of", "b": [0.4251, 0.6909, 0.4461, 0.7106]}, {"w": "data", "b": [0.4524, 0.6909, 0.5001, 0.7106]}, {"w": "tensors", "b": [0.5064, 0.6909, 0.5834, 0.7106]}]}, {"id": "b_12", "type": "paragraph", "text": "Let’s make data tensors more concrete with a few examples similar to what you’ll encounter later. The data you’ll manipulate will almost always fall into one of the following categories:", "words": [{"w": "Let’s", "b": [0.1294, 0.7337, 0.1798, 0.7534]}, {"w": "make", "b": [0.1862, 0.7337, 0.2408, 0.7534]}, {"w": "data", "b": [0.2471, 0.7337, 0.2891, 0.7534]}, {"w": "tensors", "b": [0.2954, 0.7337, 0.3669, 0.7534]}, {"w": "more", "b": [0.3732, 0.7337, 0.425, 0.7534]}, {"w": "concrete", "b": [0.4313, 0.7337, 0.5168, 0.7534]}, {"w": "with", "b": [0.5231, 0.7337, 0.5679, 0.7534]}, {"w": "a", "b": [0.5743, 0.7337, 0.5855, 0.7534]}, {"w": "few", "b": [0.5918, 0.7337, 0.6296, 0.7534]}, {"w": "examples", "b": [0.6359, 0.7337, 0.7312, 0.7534]}, {"w": "similar", "b": [0.7375, 0.7337, 0.8075, 0.7534]}, {"w": "to", "b": [0.8138, 0.7337, 0.8335, 0.7534]}, {"w": "what", "b": [0.1294, 0.7542, 0.1785, 0.7739]}, {"w": "you’ll", "b": [0.1848, 0.7542, 0.245, 0.7739]}, {"w": "encounter", "b": [0.2513, 0.7542, 0.3508, 0.7739]}, {"w": "later.", "b": [0.3571, 0.7542, 0.4068, 0.7739]}, {"w": "The", "b": [0.4131, 0.7542, 0.4523, 0.7739]}, {"w": "data", "b": [0.4586, 0.7542, 0.5007, 0.7739]}, {"w": "you’ll", "b": [0.507, 0.7542, 0.5672, 0.7739]}, {"w": "manipulate", "b": [0.5735, 0.7542, 0.6856, 0.7739]}, {"w": "will", "b": [0.6919, 0.7542, 0.7311, 0.7739]}, {"w": "almost", "b": [0.7374, 0.7542, 0.8047, 0.7739]}, {"w": "always", "b": [0.1294, 0.7747, 0.1995, 0.7944]}, {"w": "fall", "b": [0.2058, 0.7747, 0.2394, 0.7944]}, {"w": "into", "b": [0.2457, 0.7747, 0.285, 0.7944]}, {"w": "one", "b": [0.2913, 0.7747, 0.3277, 0.7944]}, {"w": "of", "b": [0.334, 0.7747, 0.355, 0.7944]}, {"w": "the", "b": [0.3613, 0.7747, 0.3921, 0.7944]}, {"w": "following", "b": [0.3984, 0.7747, 0.4965, 0.7944]}, {"w": "categories:", "b": [0.5029, 0.7747, 0.6121, 0.7944]}]}, {"id": "b_13", "type": "paragraph", "text": "Vector data— 2D tensors of shape (samples, features) Timeseries data or sequence data— 3D tensors of shape (samples, timesteps, features)", "words": [{"w": "Vector", "b": [0.1799, 0.813, 0.2457, 0.8327]}, {"w": "data—", "b": [0.252, 0.813, 0.3221, 0.8327]}, {"w": "2D", "b": [0.3284, 0.813, 0.3592, 0.8327]}, {"w": "tensors", "b": [0.3655, 0.813, 0.437, 0.8327]}, {"w": "of", "b": [0.4433, 0.813, 0.4643, 0.8327]}, {"w": "shape", "b": [0.4706, 0.813, 0.5281, 0.8327]}, {"w": "(samples,", "b": [0.5344, 0.814, 0.6706, 0.8342]}, {"w": "features)", "b": [0.6857, 0.814, 0.8219, 0.8342]}, {"w": "Timeseries", "b": [0.1799, 0.8344, 0.291, 0.8541]}, {"w": "data", "b": [0.2973, 0.8344, 0.3422, 0.8541]}, {"w": "or", "b": [0.3485, 0.8344, 0.3709, 0.8541]}, {"w": "sequence", "b": [0.3772, 0.8344, 0.4725, 0.8541]}, {"w": "data—", "b": [0.4788, 0.8344, 0.5489, 0.8541]}, {"w": "3D", "b": [0.5552, 0.8344, 0.586, 0.8541]}, {"w": "tensors", "b": [0.5923, 0.8344, 0.6638, 0.8541]}, {"w": "of", "b": [0.6701, 0.8344, 0.6911, 0.8541]}, {"w": "shape", "b": [0.6974, 0.8344, 0.7548, 0.8541]}, {"w": "(samples,", "b": [0.1799, 0.8559, 0.3161, 0.8761]}, {"w": "timesteps,", "b": [0.3312, 0.8559, 0.4826, 0.8761]}, {"w": "features)", "b": [0.4977, 0.8559, 0.6339, 0.8761]}]}]}, {"page": 69, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Images— 4D tensors of shape (samples, height, width, channels) or (samples, channels, height, width) Video— 5D tensors of shape (samples, frames, height, width, channels) or (samples, frames, channels, height, width)", "words": [{"w": "Images—", "b": [0.1799, 0.0857, 0.2808, 0.1054]}, {"w": "4D", "b": [0.2871, 0.0857, 0.3179, 0.1054]}, {"w": "tensors", "b": [0.3242, 0.0857, 0.3957, 0.1054]}, {"w": "of", "b": [0.402, 0.0857, 0.423, 0.1054]}, {"w": "shape", "b": [0.4293, 0.0857, 0.4867, 0.1054]}, {"w": "(samples,", "b": [0.493, 0.0867, 0.6293, 0.1069]}, {"w": "height,", "b": [0.6444, 0.0867, 0.7503, 0.1069]}, {"w": "width,", "b": [0.7655, 0.0867, 0.8563, 0.1069]}, {"w": "channels)", "b": [0.1799, 0.1081, 0.3161, 0.1283]}, {"w": "or", "b": [0.3224, 0.1071, 0.3434, 0.1268]}, {"w": "(samples,", "b": [0.3497, 0.1081, 0.4859, 0.1283]}, {"w": "channels,", "b": [0.5011, 0.1081, 0.6373, 0.1283]}, {"w": "height,", "b": [0.6524, 0.1081, 0.7584, 0.1283]}, {"w": "width)", "b": [0.7735, 0.1081, 0.8643, 0.1283]}, {"w": "Video—", "b": [0.1799, 0.1285, 0.264, 0.1482]}, {"w": "5D", "b": [0.2702, 0.1285, 0.3011, 0.1482]}, {"w": "tensors", "b": [0.3074, 0.1285, 0.3788, 0.1482]}, {"w": "of", "b": [0.3851, 0.1285, 0.4062, 0.1482]}, {"w": "shape", "b": [0.4125, 0.1285, 0.4699, 0.1482]}, {"w": "(samples,", "b": [0.4762, 0.1295, 0.6124, 0.1497]}, {"w": "frames,", "b": [0.6276, 0.1295, 0.7335, 0.1497]}, {"w": "height,", "b": [0.7486, 0.1295, 0.8546, 0.1497]}, {"w": "width,", "b": [0.1799, 0.1509, 0.2707, 0.1711]}, {"w": "channels)", "b": [0.2858, 0.1509, 0.422, 0.1711]}, {"w": "or", "b": [0.4284, 0.1499, 0.4494, 0.1696]}, {"w": "(samples,", "b": [0.4557, 0.1509, 0.5919, 0.1711]}, {"w": "frames,", "b": [0.607, 0.1509, 0.713, 0.1711]}, {"w": "channels,", "b": [0.7281, 0.1509, 0.8643, 0.1711]}, {"w": "height,", "b": [0.1799, 0.1723, 0.2858, 0.1925]}, {"w": "width)", "b": [0.3009, 0.1723, 0.3918, 0.1925]}]}, {"id": "b_1", "type": "paragraph", "text": "2.2.9. Vector data", "words": [{"w": "2.2.9.", "b": [0.1294, 0.2194, 0.1862, 0.2391]}, {"w": "Vector", "b": [0.1925, 0.2194, 0.263, 0.2391]}, {"w": "data", "b": [0.2693, 0.2194, 0.3169, 0.2391]}]}, {"id": "b_2", "type": "paragraph", "text": "This is the most common case. In such a dataset, each single data point can be encoded as a vector, and thus a batch of data will be encoded as a 2D tensor (that is, an array of vectors), where the first axis is the samples axis and the second axis is the features axis.", "words": [{"w": "This", "b": [0.1294, 0.2622, 0.1743, 0.2819]}, {"w": "is", "b": [0.1806, 0.2622, 0.1974, 0.2819]}, {"w": "the", "b": [0.2037, 0.2622, 0.2345, 0.2819]}, {"w": "most", "b": [0.2408, 0.2622, 0.2899, 0.2819]}, {"w": "common", "b": [0.2962, 0.2622, 0.3845, 0.2819]}, {"w": "case.", "b": [0.3908, 0.2622, 0.4405, 0.2819]}, {"w": "In", "b": [0.4468, 0.2622, 0.4678, 0.2819]}, {"w": "such", "b": [0.4741, 0.2622, 0.5204, 0.2819]}, {"w": "a", "b": [0.5267, 0.2622, 0.5379, 0.2819]}, {"w": "dataset,", "b": [0.5442, 0.2622, 0.6206, 0.2819]}, {"w": "each", "b": [0.6269, 0.2622, 0.6731, 0.2819]}, {"w": "single", "b": [0.6794, 0.2622, 0.7396, 0.2819]}, {"w": "data", "b": [0.746, 0.2622, 0.788, 0.2819]}, {"w": "point", "b": [0.7943, 0.2622, 0.8462, 0.2819]}, {"w": "can", "b": [0.1294, 0.2827, 0.1644, 0.3024]}, {"w": "be", "b": [0.1707, 0.2827, 0.1945, 0.3024]}, {"w": "encoded", "b": [0.2009, 0.2827, 0.2849, 0.3024]}, {"w": "as", "b": [0.2912, 0.2827, 0.3122, 0.3024]}, {"w": "a", "b": [0.3185, 0.2827, 0.3297, 0.3024]}, {"w": "vector,", "b": [0.336, 0.2827, 0.4043, 0.3024]}, {"w": "and", "b": [0.4106, 0.2827, 0.4471, 0.3024]}, {"w": "thus", "b": [0.4534, 0.2827, 0.4954, 0.3024]}, {"w": "a", "b": [0.5017, 0.2827, 0.5129, 0.3024]}, {"w": "batch", "b": [0.5192, 0.2827, 0.5739, 0.3024]}, {"w": "of", "b": [0.5802, 0.2827, 0.6012, 0.3024]}, {"w": "data", "b": [0.6075, 0.2827, 0.6495, 0.3024]}, {"w": "will", "b": [0.6558, 0.2827, 0.6951, 0.3024]}, {"w": "be", "b": [0.7014, 0.2827, 0.7252, 0.3024]}, {"w": "encoded", "b": [0.7315, 0.2827, 0.8155, 0.3024]}, {"w": "as", "b": [0.8218, 0.2827, 0.8429, 0.3024]}, {"w": "a", "b": [0.8492, 0.2827, 0.8604, 0.3024]}, {"w": "2D", "b": [0.1294, 0.3032, 0.1602, 0.3229]}, {"w": "tensor", "b": [0.1665, 0.3032, 0.2282, 0.3229]}, {"w": "(that", "b": [0.2345, 0.3032, 0.2807, 0.3229]}, {"w": "is,", "b": [0.287, 0.3032, 0.3102, 0.3229]}, {"w": "an", "b": [0.3165, 0.3032, 0.3403, 0.3229]}, {"w": "array", "b": [0.3466, 0.3032, 0.3984, 0.3229]}, {"w": "of", "b": [0.4047, 0.3032, 0.4257, 0.3229]}, {"w": "vectors),", "b": [0.432, 0.3032, 0.5196, 0.3229]}, {"w": "where", "b": [0.5259, 0.3032, 0.5875, 0.3229]}, {"w": "the", "b": [0.5938, 0.3032, 0.6247, 0.3229]}, {"w": "first", "b": [0.631, 0.3032, 0.6716, 0.3229]}, {"w": "axis", "b": [0.6779, 0.3032, 0.7186, 0.3229]}, {"w": "is", "b": [0.7249, 0.3032, 0.7417, 0.3229]}, {"w": "the", "b": [0.748, 0.3032, 0.7788, 0.3229]}, {"w": "samples", "b": [0.7851, 0.3032, 0.8663, 0.3229]}, {"w": "axis", "b": [0.1294, 0.3237, 0.1701, 0.3434]}, {"w": "and", "b": [0.1763, 0.3237, 0.2128, 0.3434]}, {"w": "the", "b": [0.2191, 0.3237, 0.2499, 0.3434]}, {"w": "second", "b": [0.2562, 0.3237, 0.3263, 0.3434]}, {"w": "axis", "b": [0.3326, 0.3237, 0.3732, 0.3434]}, {"w": "is", "b": [0.3795, 0.3237, 0.3963, 0.3434]}, {"w": "the", "b": [0.4026, 0.3237, 0.4335, 0.3434]}, {"w": "features", "b": [0.4397, 0.3237, 0.5201, 0.3434]}, {"w": "axis.", "b": [0.5264, 0.3237, 0.5733, 0.3434]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s take a look at two examples:", "words": [{"w": "Let’s", "b": [0.1294, 0.3664, 0.1798, 0.3862]}, {"w": "take", "b": [0.1862, 0.3664, 0.2282, 0.3862]}, {"w": "a", "b": [0.2345, 0.3664, 0.2457, 0.3862]}, {"w": "look", "b": [0.252, 0.3664, 0.2968, 0.3862]}, {"w": "at", "b": [0.3032, 0.3664, 0.3214, 0.3862]}, {"w": "two", "b": [0.3277, 0.3664, 0.3655, 0.3862]}, {"w": "examples:", "b": [0.3718, 0.3664, 0.4741, 0.3862]}]}, {"id": "b_4", "type": "paragraph", "text": "An actuarial dataset of people, where we consider each person’s age, ZIP code, and income. Each person can be characterized as a vector of 3 values, and thus an entire dataset of 100,000 people can be stored in a 2D tensor of shape (100000, 3). A dataset of text documents, where we represent each document by the counts of how many times each word appears in it (out of a dictionary of 20,000 common words). Each document can be encoded as a vector of 20,000 values (one count per word in the dictionary), and thus an entire dataset of 500 documents can be stored in a tensor of shape (500, 20000).", "words": [{"w": "An", "b": [0.1799, 0.4048, 0.2107, 0.4245]}, {"w": "actuarial", "b": [0.217, 0.4048, 0.3038, 0.4245]}, {"w": "dataset", "b": [0.3102, 0.4048, 0.3802, 0.4245]}, {"w": "of", "b": [0.3865, 0.4048, 0.4075, 0.4245]}, {"w": "people,", "b": [0.4138, 0.4048, 0.4874, 0.4245]}, {"w": "where", "b": [0.4937, 0.4048, 0.5553, 0.4245]}, {"w": "we", "b": [0.5616, 0.4048, 0.591, 0.4245]}, {"w": "consider", "b": [0.5973, 0.4048, 0.6828, 0.4245]}, {"w": "each", "b": [0.6891, 0.4048, 0.7353, 0.4245]}, {"w": "person’s", "b": [0.7416, 0.4048, 0.8256, 0.4245]}, {"w": "age,", "b": [0.1799, 0.4253, 0.2212, 0.445]}, {"w": "ZIP", "b": [0.2275, 0.4253, 0.2653, 0.445]}, {"w": "code,", "b": [0.2716, 0.4253, 0.3256, 0.445]}, {"w": "and", "b": [0.3319, 0.4253, 0.3683, 0.445]}, {"w": "income.", "b": [0.3746, 0.4253, 0.4552, 0.445]}, {"w": "Each", "b": [0.4615, 0.4253, 0.5119, 0.445]}, {"w": "person", "b": [0.5182, 0.4253, 0.5855, 0.445]}, {"w": "can", "b": [0.5918, 0.4253, 0.6268, 0.445]}, {"w": "be", "b": [0.6331, 0.4253, 0.6569, 0.445]}, {"w": "characterized", "b": [0.6632, 0.4253, 0.7977, 0.445]}, {"w": "as", "b": [0.8039, 0.4253, 0.8249, 0.445]}, {"w": "a", "b": [0.8312, 0.4253, 0.8424, 0.445]}, {"w": "vector", "b": [0.1799, 0.4458, 0.2429, 0.4655]}, {"w": "of", "b": [0.2492, 0.4458, 0.2702, 0.4655]}, {"w": "3", "b": [0.2765, 0.4458, 0.2891, 0.4655]}, {"w": "values,", "b": [0.2954, 0.4458, 0.3662, 0.4655]}, {"w": "and", "b": [0.3725, 0.4458, 0.4089, 0.4655]}, {"w": "thus", "b": [0.4152, 0.4458, 0.4573, 0.4655]}, {"w": "an", "b": [0.4636, 0.4458, 0.4874, 0.4655]}, {"w": "entire", "b": [0.4937, 0.4458, 0.5512, 0.4655]}, {"w": "dataset", "b": [0.5575, 0.4458, 0.6275, 0.4655]}, {"w": "of", "b": [0.6338, 0.4458, 0.6548, 0.4655]}, {"w": "100,000", "b": [0.6611, 0.4458, 0.7431, 0.4655]}, {"w": "people", "b": [0.7494, 0.4458, 0.8167, 0.4655]}, {"w": "can", "b": [0.823, 0.4458, 0.858, 0.4655]}, {"w": "be", "b": [0.1799, 0.4663, 0.2037, 0.486]}, {"w": "stored", "b": [0.21, 0.4663, 0.2716, 0.486]}, {"w": "in", "b": [0.2779, 0.4663, 0.2976, 0.486]}, {"w": "a", "b": [0.3039, 0.4663, 0.3151, 0.486]}, {"w": "2D", "b": [0.3214, 0.4663, 0.3522, 0.486]}, {"w": "tensor", "b": [0.3585, 0.4663, 0.4202, 0.486]}, {"w": "of", "b": [0.4265, 0.4663, 0.4475, 0.486]}, {"w": "shape", "b": [0.4538, 0.4663, 0.5112, 0.486]}, {"w": "(100000,", "b": [0.5175, 0.4673, 0.6386, 0.4875]}, {"w": "3).", "b": [0.6537, 0.4663, 0.6903, 0.4875]}, {"w": "A", "b": [0.1799, 0.4877, 0.1981, 0.5074]}, {"w": "dataset", "b": [0.2044, 0.4877, 0.2744, 0.5074]}, {"w": "of", "b": [0.2807, 0.4877, 0.3018, 0.5074]}, {"w": "text", "b": [0.3081, 0.4877, 0.3459, 0.5074]}, {"w": "documents,", "b": [0.3522, 0.4877, 0.4678, 0.5074]}, {"w": "where", "b": [0.4741, 0.4877, 0.5357, 0.5074]}, {"w": "we", "b": [0.5421, 0.4877, 0.5715, 0.5074]}, {"w": "represent", "b": [0.5778, 0.4877, 0.6702, 0.5074]}, {"w": "each", "b": [0.6765, 0.4877, 0.7227, 0.5074]}, {"w": "document", "b": [0.7291, 0.4877, 0.8285, 0.5074]}, {"w": "by", "b": [0.8349, 0.4877, 0.8601, 0.5074]}, {"w": "the", "b": [0.1799, 0.5082, 0.2107, 0.5279]}, {"w": "counts", "b": [0.217, 0.5082, 0.2829, 0.5279]}, {"w": "of", "b": [0.2892, 0.5082, 0.3102, 0.5279]}, {"w": "how", "b": [0.3165, 0.5082, 0.3599, 0.5279]}, {"w": "many", "b": [0.3662, 0.5082, 0.4223, 0.5279]}, {"w": "times", "b": [0.4286, 0.5082, 0.4833, 0.5279]}, {"w": "each", "b": [0.4896, 0.5082, 0.5358, 0.5279]}, {"w": "word", "b": [0.5421, 0.5082, 0.5939, 0.5279]}, {"w": "appears", "b": [0.6002, 0.5082, 0.6773, 0.5279]}, {"w": "in", "b": [0.6836, 0.5082, 0.7032, 0.5279]}, {"w": "it", "b": [0.7095, 0.5082, 0.7235, 0.5279]}, {"w": "(out", "b": [0.7298, 0.5082, 0.7705, 0.5279]}, {"w": "of", "b": [0.7767, 0.5082, 0.7977, 0.5279]}, {"w": "a", "b": [0.804, 0.5082, 0.8152, 0.5279]}, {"w": "dictionary", "b": [0.1799, 0.5287, 0.2822, 0.5484]}, {"w": "of", "b": [0.2885, 0.5287, 0.3095, 0.5484]}, {"w": "20,000", "b": [0.3158, 0.5287, 0.3852, 0.5484]}, {"w": "common", "b": [0.3915, 0.5287, 0.4797, 0.5484]}, {"w": "words).", "b": [0.4861, 0.5287, 0.5624, 0.5484]}, {"w": "Each", "b": [0.5687, 0.5287, 0.6191, 0.5484]}, {"w": "document", "b": [0.6255, 0.5287, 0.7249, 0.5484]}, {"w": "can", "b": [0.7312, 0.5287, 0.7663, 0.5484]}, {"w": "be", "b": [0.7726, 0.5287, 0.7964, 0.5484]}, {"w": "encoded", "b": [0.1799, 0.5492, 0.2639, 0.5689]}, {"w": "as", "b": [0.2702, 0.5492, 0.2912, 0.5689]}, {"w": "a", "b": [0.2975, 0.5492, 0.3087, 0.5689]}, {"w": "vector", "b": [0.315, 0.5492, 0.3781, 0.5689]}, {"w": "of", "b": [0.3844, 0.5492, 0.4054, 0.5689]}, {"w": "20,000", "b": [0.4117, 0.5492, 0.4811, 0.5689]}, {"w": "values", "b": [0.4874, 0.5492, 0.5518, 0.5689]}, {"w": "(one", "b": [0.5581, 0.5492, 0.603, 0.5689]}, {"w": "count", "b": [0.6093, 0.5492, 0.6653, 0.5689]}, {"w": "per", "b": [0.6716, 0.5492, 0.7039, 0.5689]}, {"w": "word", "b": [0.7102, 0.5492, 0.762, 0.5689]}, {"w": "in", "b": [0.7683, 0.5492, 0.7879, 0.5689]}, {"w": "the", "b": [0.7942, 0.5492, 0.825, 0.5689]}, {"w": "dictionary),", "b": [0.1799, 0.5697, 0.2969, 0.5894]}, {"w": "and", "b": [0.3032, 0.5697, 0.3396, 0.5894]}, {"w": "thus", "b": [0.3459, 0.5697, 0.388, 0.5894]}, {"w": "an", "b": [0.3943, 0.5697, 0.4181, 0.5894]}, {"w": "entire", "b": [0.4244, 0.5697, 0.4818, 0.5894]}, {"w": "dataset", "b": [0.4881, 0.5697, 0.5582, 0.5894]}, {"w": "of", "b": [0.5645, 0.5697, 0.5855, 0.5894]}, {"w": "500", "b": [0.5918, 0.5697, 0.6296, 0.5894]}, {"w": "documents", "b": [0.6359, 0.5697, 0.7452, 0.5894]}, {"w": "can", "b": [0.7516, 0.5697, 0.7866, 0.5894]}, {"w": "be", "b": [0.7929, 0.5697, 0.8167, 0.5894]}, {"w": "stored", "b": [0.1799, 0.5902, 0.2415, 0.6099]}, {"w": "in", "b": [0.2478, 0.5902, 0.2674, 0.6099]}, {"w": "a", "b": [0.2738, 0.5902, 0.285, 0.6099]}, {"w": "tensor", "b": [0.2913, 0.5902, 0.3529, 0.6099]}, {"w": "of", "b": [0.3592, 0.5902, 0.3802, 0.6099]}, {"w": "shape", "b": [0.3865, 0.5902, 0.444, 0.6099]}, {"w": "(500,", "b": [0.4503, 0.5912, 0.5259, 0.6114]}, {"w": "20000).", "b": [0.5411, 0.5902, 0.6382, 0.6114]}]}, {"id": "b_5", "type": "paragraph", "text": "2.2.10. Timeseries data or sequence data", "words": [{"w": "2.2.10.", "b": [0.1294, 0.6383, 0.1988, 0.658]}, {"w": "Timeseries", "b": [0.2051, 0.6383, 0.3209, 0.658]}, {"w": "data", "b": [0.3272, 0.6383, 0.3749, 0.658]}, {"w": "or", "b": [0.3812, 0.6383, 0.405, 0.658]}, {"w": "sequence", "b": [0.4113, 0.6383, 0.508, 0.658]}, {"w": "data", "b": [0.5143, 0.6383, 0.562, 0.658]}]}, {"id": "b_6", "type": "paragraph", "text": "Whenever time matters in your data (or the notion of sequence order), it makes sense to store it in a 3D tensor with an explicit time axis. Each sample can be encoded as a sequence of vectors (a 2D tensor), and thus a batch of data will be encoded as a 3D tensor (see figure 2.3).", "words": [{"w": "Whenever", "b": [0.1294, 0.6811, 0.2331, 0.7008]}, {"w": "time", "b": [0.2394, 0.6811, 0.2842, 0.7008]}, {"w": "matters", "b": [0.2905, 0.6811, 0.3648, 0.7008]}, {"w": "in", "b": [0.3711, 0.6811, 0.3907, 0.7008]}, {"w": "your", "b": [0.397, 0.6811, 0.4433, 0.7008]}, {"w": "data", "b": [0.4496, 0.6811, 0.4916, 0.7008]}, {"w": "(or", "b": [0.4979, 0.6811, 0.5273, 0.7008]}, {"w": "the", "b": [0.5336, 0.6811, 0.5645, 0.7008]}, {"w": "notion", "b": [0.5708, 0.6811, 0.6352, 0.7008]}, {"w": "of", "b": [0.6415, 0.6811, 0.6626, 0.7008]}, {"w": "sequence", "b": [0.6689, 0.6811, 0.7613, 0.7008]}, {"w": "order),", "b": [0.7676, 0.6811, 0.8356, 0.7008]}, {"w": "it", "b": [0.8419, 0.6811, 0.8559, 0.7008]}, {"w": "makes", "b": [0.1294, 0.7016, 0.1939, 0.7213]}, {"w": "sense", "b": [0.2002, 0.7016, 0.2548, 0.7213]}, {"w": "to", "b": [0.2611, 0.7016, 0.2807, 0.7213]}, {"w": "store", "b": [0.287, 0.7016, 0.3361, 0.7213]}, {"w": "it", "b": [0.3424, 0.7016, 0.3564, 0.7213]}, {"w": "in", "b": [0.3627, 0.7016, 0.3824, 0.7213]}, {"w": "a", "b": [0.3887, 0.7016, 0.3999, 0.7213]}, {"w": "3D", "b": [0.4062, 0.7016, 0.437, 0.7213]}, {"w": "tensor", "b": [0.4433, 0.7016, 0.5049, 0.7213]}, {"w": "with", "b": [0.5113, 0.7016, 0.5561, 0.7213]}, {"w": "an", "b": [0.5624, 0.7016, 0.5862, 0.7213]}, {"w": "explicit", "b": [0.5925, 0.7016, 0.6682, 0.7213]}, {"w": "time", "b": [0.6744, 0.7016, 0.7193, 0.7213]}, {"w": "axis.", "b": [0.7256, 0.7016, 0.7725, 0.7213]}, {"w": "Each", "b": [0.7789, 0.7016, 0.8293, 0.7213]}, {"w": "sample", "b": [0.1294, 0.7221, 0.2009, 0.7418]}, {"w": "can", "b": [0.2072, 0.7221, 0.2422, 0.7418]}, {"w": "be", "b": [0.2485, 0.7221, 0.2723, 0.7418]}, {"w": "encoded", "b": [0.2786, 0.7221, 0.3627, 0.7418]}, {"w": "as", "b": [0.369, 0.7221, 0.39, 0.7418]}, {"w": "a", "b": [0.3963, 0.7221, 0.4075, 0.7418]}, {"w": "sequence", "b": [0.4138, 0.7221, 0.5063, 0.7418]}, {"w": "of", "b": [0.5126, 0.7221, 0.5336, 0.7418]}, {"w": "vectors", "b": [0.5399, 0.7221, 0.6127, 0.7418]}, {"w": "(a", "b": [0.619, 0.7221, 0.6386, 0.7418]}, {"w": "2D", "b": [0.645, 0.7221, 0.6758, 0.7418]}, {"w": "tensor),", "b": [0.6821, 0.7221, 0.7584, 0.7418]}, {"w": "and", "b": [0.7647, 0.7221, 0.8012, 0.7418]}, {"w": "thus", "b": [0.8075, 0.7221, 0.8495, 0.7418]}, {"w": "a", "b": [0.8558, 0.7221, 0.867, 0.7418]}, {"w": "batch", "b": [0.1294, 0.7426, 0.1841, 0.7623]}, {"w": "of", "b": [0.1904, 0.7426, 0.2114, 0.7623]}, {"w": "data", "b": [0.2177, 0.7426, 0.2597, 0.7623]}, {"w": "will", "b": [0.266, 0.7426, 0.3053, 0.7623]}, {"w": "be", "b": [0.3116, 0.7426, 0.3354, 0.7623]}, {"w": "encoded", "b": [0.3417, 0.7426, 0.4257, 0.7623]}, {"w": "as", "b": [0.432, 0.7426, 0.4531, 0.7623]}, {"w": "a", "b": [0.4593, 0.7426, 0.4705, 0.7623]}, {"w": "3D", "b": [0.4768, 0.7426, 0.5077, 0.7623]}, {"w": "tensor", "b": [0.514, 0.7426, 0.5756, 0.7623]}, {"w": "(see", "b": [0.5819, 0.7426, 0.6225, 0.7623]}, {"w": "figure", "b": [0.6288, 0.7426, 0.6891, 0.7623]}, {"w": "2.3).", "b": [0.6954, 0.7426, 0.7416, 0.7623]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 2.3. A 3D timeseries data tensor", "words": [{"w": "Figure", "b": [0.1294, 0.7849, 0.1827, 0.7997]}, {"w": "2.3.", "b": [0.1874, 0.7849, 0.2158, 0.7997]}, {"w": "A", "b": [0.2205, 0.7849, 0.2341, 0.7997]}, {"w": "3D", "b": [0.2389, 0.7849, 0.262, 0.7997]}, {"w": "timeseries", "b": [0.2667, 0.7849, 0.3476, 0.7997]}, {"w": "data", "b": [0.3523, 0.7849, 0.3881, 0.7997]}, {"w": "tensor", "b": [0.3928, 0.7849, 0.4433, 0.7997]}]}]}, {"page": 70, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The time axis is always the second axis (axis of index 1), by convention. Let’s look at a few examples:", "words": [{"w": "The", "b": [0.1294, 0.2069, 0.1686, 0.2266]}, {"w": "time", "b": [0.1749, 0.2069, 0.2198, 0.2266]}, {"w": "axis", "b": [0.2261, 0.2069, 0.2667, 0.2266]}, {"w": "is", "b": [0.273, 0.2069, 0.2899, 0.2266]}, {"w": "always", "b": [0.2962, 0.2069, 0.3662, 0.2266]}, {"w": "the", "b": [0.3725, 0.2069, 0.4034, 0.2266]}, {"w": "second", "b": [0.4097, 0.2069, 0.4797, 0.2266]}, {"w": "axis", "b": [0.486, 0.2069, 0.5267, 0.2266]}, {"w": "(axis", "b": [0.533, 0.2069, 0.582, 0.2266]}, {"w": "of", "b": [0.5883, 0.2069, 0.6093, 0.2266]}, {"w": "index", "b": [0.6156, 0.2069, 0.6717, 0.2266]}, {"w": "1),", "b": [0.678, 0.2069, 0.7053, 0.2266]}, {"w": "by", "b": [0.7116, 0.2069, 0.7368, 0.2266]}, {"w": "convention.", "b": [0.7432, 0.2069, 0.8616, 0.2266]}, {"w": "Let’s", "b": [0.1294, 0.2274, 0.1798, 0.2471]}, {"w": "look", "b": [0.1862, 0.2274, 0.231, 0.2471]}, {"w": "at", "b": [0.2373, 0.2274, 0.2555, 0.2471]}, {"w": "a", "b": [0.2618, 0.2274, 0.273, 0.2471]}, {"w": "few", "b": [0.2793, 0.2274, 0.3172, 0.2471]}, {"w": "examples:", "b": [0.3235, 0.2274, 0.4257, 0.2471]}]}, {"id": "b_1", "type": "paragraph", "text": "A dataset of stock prices. Every minute, we store the current price of the stock, the highest price in the past minute, and the lowest price in the past minute. Thus every minute is encoded as a 3D vector, an entire day of trading is encoded as a 2D tensor of shape (390, 3) (there are 390 minutes in a trading day), and 250 days’ worth of data can be stored in a 3D tensor of shape (250, 390, 3). Here, each sample would be one day’s worth of data. A dataset of tweets, where we encode each tweet as a sequence of 280 characters out of an alphabet of 128 unique characters. In this setting, each character can be encoded as a binary vector of size 128 (an all-zeros vector except for a 1 entry at the index corresponding to the character). Then each tweet can be encoded as a 2D tensor of shape (280, 128), and a dataset of 1 million tweets can be stored in a tensor of shape (1000000, 280, 128).", "words": [{"w": "A", "b": [0.1799, 0.2657, 0.1981, 0.2855]}, {"w": "dataset", "b": [0.2044, 0.2657, 0.2744, 0.2855]}, {"w": "of", "b": [0.2807, 0.2657, 0.3018, 0.2855]}, {"w": "stock", "b": [0.3081, 0.2657, 0.3613, 0.2855]}, {"w": "prices.", "b": [0.3676, 0.2657, 0.4342, 0.2855]}, {"w": "Every", "b": [0.4405, 0.2657, 0.5007, 0.2855]}, {"w": "minute,", "b": [0.507, 0.2657, 0.5834, 0.2855]}, {"w": "we", "b": [0.5897, 0.2657, 0.6191, 0.2855]}, {"w": "store", "b": [0.6254, 0.2657, 0.6745, 0.2855]}, {"w": "the", "b": [0.6808, 0.2657, 0.7116, 0.2855]}, {"w": "current", "b": [0.7179, 0.2657, 0.7893, 0.2855]}, {"w": "price", "b": [0.7956, 0.2657, 0.8461, 0.2855]}, {"w": "of", "b": [0.1799, 0.2862, 0.2009, 0.306]}, {"w": "the", "b": [0.2072, 0.2862, 0.238, 0.306]}, {"w": "stock,", "b": [0.2443, 0.2862, 0.3039, 0.306]}, {"w": "the", "b": [0.3102, 0.2862, 0.341, 0.306]}, {"w": "highest", "b": [0.3473, 0.2862, 0.4202, 0.306]}, {"w": "price", "b": [0.4265, 0.2862, 0.4769, 0.306]}, {"w": "in", "b": [0.4832, 0.2862, 0.5029, 0.306]}, {"w": "the", "b": [0.5092, 0.2862, 0.54, 0.306]}, {"w": "past", "b": [0.5463, 0.2862, 0.5869, 0.306]}, {"w": "minute,", "b": [0.5932, 0.2862, 0.6696, 0.306]}, {"w": "and", "b": [0.6759, 0.2862, 0.7124, 0.306]}, {"w": "the", "b": [0.7186, 0.2862, 0.7494, 0.306]}, {"w": "lowest", "b": [0.7557, 0.2862, 0.8216, 0.306]}, {"w": "price", "b": [0.1799, 0.3067, 0.2303, 0.3265]}, {"w": "in", "b": [0.2366, 0.3067, 0.2562, 0.3265]}, {"w": "the", "b": [0.2625, 0.3067, 0.2934, 0.3265]}, {"w": "past", "b": [0.2997, 0.3067, 0.3403, 0.3265]}, {"w": "minute.", "b": [0.3466, 0.3067, 0.423, 0.3265]}, {"w": "Thus", "b": [0.4293, 0.3067, 0.4797, 0.3265]}, {"w": "every", "b": [0.4861, 0.3067, 0.5421, 0.3265]}, {"w": "minute", "b": [0.5484, 0.3067, 0.6185, 0.3265]}, {"w": "is", "b": [0.6248, 0.3067, 0.6416, 0.3265]}, {"w": "encoded", "b": [0.6479, 0.3067, 0.732, 0.3265]}, {"w": "as", "b": [0.7383, 0.3067, 0.7593, 0.3265]}, {"w": "a", "b": [0.7656, 0.3067, 0.7768, 0.3265]}, {"w": "3D", "b": [0.7831, 0.3067, 0.8139, 0.3265]}, {"w": "vector,", "b": [0.1799, 0.3272, 0.2482, 0.347]}, {"w": "an", "b": [0.2545, 0.3272, 0.2783, 0.347]}, {"w": "entire", "b": [0.2846, 0.3272, 0.3421, 0.347]}, {"w": "day", "b": [0.3484, 0.3272, 0.3848, 0.347]}, {"w": "of", "b": [0.3911, 0.3272, 0.4121, 0.347]}, {"w": "trading", "b": [0.4184, 0.3272, 0.4899, 0.347]}, {"w": "is", "b": [0.4962, 0.3272, 0.513, 0.347]}, {"w": "encoded", "b": [0.5193, 0.3272, 0.6034, 0.347]}, {"w": "as", "b": [0.6097, 0.3272, 0.6307, 0.347]}, {"w": "a", "b": [0.637, 0.3272, 0.6482, 0.347]}, {"w": "2D", "b": [0.6544, 0.3272, 0.6853, 0.347]}, {"w": "tensor", "b": [0.6916, 0.3272, 0.7532, 0.347]}, {"w": "of", "b": [0.7595, 0.3272, 0.7805, 0.347]}, {"w": "shape", "b": [0.7869, 0.3272, 0.8443, 0.347]}, {"w": "(390,", "b": [0.1799, 0.3488, 0.2555, 0.369]}, {"w": "3)", "b": [0.2707, 0.3488, 0.3009, 0.369]}, {"w": "(there", "b": [0.3073, 0.3477, 0.3661, 0.3675]}, {"w": "are", "b": [0.3724, 0.3477, 0.4032, 0.3675]}, {"w": "390", "b": [0.4095, 0.3477, 0.4474, 0.3675]}, {"w": "minutes", "b": [0.4537, 0.3477, 0.5335, 0.3675]}, {"w": "in", "b": [0.5399, 0.3477, 0.5595, 0.3675]}, {"w": "a", "b": [0.5658, 0.3477, 0.577, 0.3675]}, {"w": "trading", "b": [0.5833, 0.3477, 0.6548, 0.3675]}, {"w": "day),", "b": [0.6611, 0.3477, 0.7122, 0.3675]}, {"w": "and", "b": [0.7185, 0.3477, 0.7549, 0.3675]}, {"w": "250", "b": [0.7612, 0.3477, 0.7991, 0.3675]}, {"w": "days’", "b": [0.8054, 0.3477, 0.86, 0.3675]}, {"w": "worth", "b": [0.1799, 0.3691, 0.2387, 0.3889]}, {"w": "of", "b": [0.245, 0.3691, 0.266, 0.3889]}, {"w": "data", "b": [0.2723, 0.3691, 0.3144, 0.3889]}, {"w": "can", "b": [0.3207, 0.3691, 0.3557, 0.3889]}, {"w": "be", "b": [0.362, 0.3691, 0.3858, 0.3889]}, {"w": "stored", "b": [0.3921, 0.3691, 0.4538, 0.3889]}, {"w": "in", "b": [0.4601, 0.3691, 0.4797, 0.3889]}, {"w": "a", "b": [0.486, 0.3691, 0.4972, 0.3889]}, {"w": "3D", "b": [0.5035, 0.3691, 0.5343, 0.3889]}, {"w": "tensor", "b": [0.5406, 0.3691, 0.6023, 0.3889]}, {"w": "of", "b": [0.6086, 0.3691, 0.6296, 0.3889]}, {"w": "shape", "b": [0.6359, 0.3691, 0.6934, 0.3889]}, {"w": "(250,", "b": [0.6996, 0.3702, 0.7753, 0.3904]}, {"w": "390,", "b": [0.7904, 0.3702, 0.851, 0.3904]}, {"w": "3).", "b": [0.1799, 0.3905, 0.2164, 0.4117]}, {"w": "Here,", "b": [0.2227, 0.3905, 0.2781, 0.4102]}, {"w": "each", "b": [0.2844, 0.3905, 0.3306, 0.4102]}, {"w": "sample", "b": [0.3369, 0.3905, 0.4084, 0.4102]}, {"w": "would", "b": [0.4147, 0.3905, 0.4777, 0.4102]}, {"w": "be", "b": [0.484, 0.3905, 0.5078, 0.4102]}, {"w": "one", "b": [0.5142, 0.3905, 0.5506, 0.4102]}, {"w": "day’s", "b": [0.5569, 0.3905, 0.6101, 0.4102]}, {"w": "worth", "b": [0.6164, 0.3905, 0.6753, 0.4102]}, {"w": "of", "b": [0.6816, 0.3905, 0.7026, 0.4102]}, {"w": "data.", "b": [0.7089, 0.3905, 0.7572, 0.4102]}, {"w": "A", "b": [0.1799, 0.4119, 0.1981, 0.4316]}, {"w": "dataset", "b": [0.2044, 0.4119, 0.2744, 0.4316]}, {"w": "of", "b": [0.2807, 0.4119, 0.3018, 0.4316]}, {"w": "tweets,", "b": [0.3081, 0.4119, 0.3788, 0.4316]}, {"w": "where", "b": [0.3851, 0.4119, 0.4468, 0.4316]}, {"w": "we", "b": [0.4531, 0.4119, 0.4825, 0.4316]}, {"w": "encode", "b": [0.4888, 0.4119, 0.5602, 0.4316]}, {"w": "each", "b": [0.5665, 0.4119, 0.6127, 0.4316]}, {"w": "tweet", "b": [0.619, 0.4119, 0.6737, 0.4316]}, {"w": "as", "b": [0.68, 0.4119, 0.701, 0.4316]}, {"w": "a", "b": [0.7073, 0.4119, 0.7185, 0.4316]}, {"w": "sequence", "b": [0.7248, 0.4119, 0.8173, 0.4316]}, {"w": "of", "b": [0.8236, 0.4119, 0.8446, 0.4316]}, {"w": "280", "b": [0.1799, 0.4324, 0.2177, 0.4521]}, {"w": "characters", "b": [0.224, 0.4324, 0.3262, 0.4521]}, {"w": "out", "b": [0.3326, 0.4324, 0.3648, 0.4521]}, {"w": "of", "b": [0.3711, 0.4324, 0.3921, 0.4521]}, {"w": "an", "b": [0.3984, 0.4324, 0.4222, 0.4521]}, {"w": "alphabet", "b": [0.4285, 0.4324, 0.514, 0.4521]}, {"w": "of", "b": [0.5203, 0.4324, 0.5413, 0.4521]}, {"w": "128", "b": [0.5476, 0.4324, 0.5855, 0.4521]}, {"w": "unique", "b": [0.5918, 0.4324, 0.6604, 0.4521]}, {"w": "characters.", "b": [0.6667, 0.4324, 0.7753, 0.4521]}, {"w": "In", "b": [0.7815, 0.4324, 0.8025, 0.4521]}, {"w": "this", "b": [0.8088, 0.4324, 0.8453, 0.4521]}, {"w": "setting,", "b": [0.1799, 0.4529, 0.2534, 0.4726]}, {"w": "each", "b": [0.2598, 0.4529, 0.306, 0.4726]}, {"w": "character", "b": [0.3123, 0.4529, 0.4047, 0.4726]}, {"w": "can", "b": [0.411, 0.4529, 0.446, 0.4726]}, {"w": "be", "b": [0.4523, 0.4529, 0.4761, 0.4726]}, {"w": "encoded", "b": [0.4824, 0.4529, 0.5665, 0.4726]}, {"w": "as", "b": [0.5728, 0.4529, 0.5938, 0.4726]}, {"w": "a", "b": [0.6001, 0.4529, 0.6113, 0.4726]}, {"w": "binary", "b": [0.6176, 0.4529, 0.6821, 0.4726]}, {"w": "vector", "b": [0.6884, 0.4529, 0.7514, 0.4726]}, {"w": "of", "b": [0.7577, 0.4529, 0.7787, 0.4726]}, {"w": "size", "b": [0.7851, 0.4529, 0.8243, 0.4726]}, {"w": "128", "b": [0.8306, 0.4529, 0.8684, 0.4726]}, {"w": "(an", "b": [0.1799, 0.4734, 0.2121, 0.4931]}, {"w": "all-zeros", "b": [0.2184, 0.4734, 0.3052, 0.4931]}, {"w": "vector", "b": [0.3115, 0.4734, 0.3746, 0.4931]}, {"w": "except", "b": [0.3809, 0.4734, 0.4467, 0.4931]}, {"w": "for", "b": [0.453, 0.4734, 0.4824, 0.4931]}, {"w": "a", "b": [0.4888, 0.4734, 0.5, 0.4931]}, {"w": "1", "b": [0.5063, 0.4734, 0.5189, 0.4931]}, {"w": "entry", "b": [0.5252, 0.4734, 0.577, 0.4931]}, {"w": "at", "b": [0.5833, 0.4734, 0.6015, 0.4931]}, {"w": "the", "b": [0.6078, 0.4734, 0.6386, 0.4931]}, {"w": "index", "b": [0.6449, 0.4734, 0.701, 0.4931]}, {"w": "corresponding", "b": [0.7073, 0.4734, 0.8516, 0.4931]}, {"w": "to", "b": [0.1799, 0.4939, 0.1995, 0.5136]}, {"w": "the", "b": [0.2058, 0.4939, 0.2366, 0.5136]}, {"w": "character).", "b": [0.2429, 0.4939, 0.3501, 0.5136]}, {"w": "Then", "b": [0.3564, 0.4939, 0.4082, 0.5136]}, {"w": "each", "b": [0.4145, 0.4939, 0.4607, 0.5136]}, {"w": "tweet", "b": [0.467, 0.4939, 0.5217, 0.5136]}, {"w": "can", "b": [0.528, 0.4939, 0.563, 0.5136]}, {"w": "be", "b": [0.5693, 0.4939, 0.5931, 0.5136]}, {"w": "encoded", "b": [0.5994, 0.4939, 0.6835, 0.5136]}, {"w": "as", "b": [0.6898, 0.4939, 0.7108, 0.5136]}, {"w": "a", "b": [0.7171, 0.4939, 0.7283, 0.5136]}, {"w": "2D", "b": [0.7346, 0.4939, 0.7654, 0.5136]}, {"w": "tensor", "b": [0.7717, 0.4939, 0.8334, 0.5136]}, {"w": "of", "b": [0.8397, 0.4939, 0.8607, 0.5136]}, {"w": "shape", "b": [0.1799, 0.5144, 0.2373, 0.5341]}, {"w": "(280,", "b": [0.2436, 0.5154, 0.3193, 0.5356]}, {"w": "128),", "b": [0.3344, 0.5144, 0.4013, 0.5356]}, {"w": "and", "b": [0.4076, 0.5144, 0.444, 0.5341]}, {"w": "a", "b": [0.4503, 0.5144, 0.4615, 0.5341]}, {"w": "dataset", "b": [0.4678, 0.5144, 0.5379, 0.5341]}, {"w": "of", "b": [0.5442, 0.5144, 0.5652, 0.5341]}, {"w": "1", "b": [0.5715, 0.5144, 0.5841, 0.5341]}, {"w": "million", "b": [0.5904, 0.5144, 0.6633, 0.5341]}, {"w": "tweets", "b": [0.6696, 0.5144, 0.7341, 0.5341]}, {"w": "can", "b": [0.7404, 0.5144, 0.7754, 0.5341]}, {"w": "be", "b": [0.7817, 0.5144, 0.8055, 0.5341]}, {"w": "stored", "b": [0.1799, 0.5358, 0.2415, 0.5555]}, {"w": "in", "b": [0.2478, 0.5358, 0.2674, 0.5555]}, {"w": "a", "b": [0.2738, 0.5358, 0.285, 0.5555]}, {"w": "tensor", "b": [0.2913, 0.5358, 0.3529, 0.5555]}, {"w": "of", "b": [0.3592, 0.5358, 0.3802, 0.5555]}, {"w": "shape", "b": [0.3865, 0.5358, 0.444, 0.5555]}, {"w": "(1000000,", "b": [0.4503, 0.5368, 0.5865, 0.557]}, {"w": "280,", "b": [0.6016, 0.5368, 0.6621, 0.557]}, {"w": "128).", "b": [0.6773, 0.5358, 0.7442, 0.557]}]}, {"id": "b_2", "type": "paragraph", "text": "2.2.11. Image data", "words": [{"w": "2.2.11.", "b": [0.1294, 0.5839, 0.1974, 0.6037]}, {"w": "Image", "b": [0.2037, 0.5839, 0.2709, 0.6037]}, {"w": "data", "b": [0.2772, 0.5839, 0.3249, 0.6037]}]}, {"id": "b_3", "type": "paragraph", "text": "Images typically have three dimensions: height, width, and color depth. Although grayscale images (like our MNIST digits) have only a single color channel and could thus be stored in 2D tensors, by convention image tensors are always 3D, with a one-dimensional color channel for grayscale images. A batch of 128 grayscale images of size 256 × 256 could thus be stored in a tensor of shape (128, 256, 256, 1), and a batch of 128 color images could be stored in a tensor of shape (128, 256, 256, 3) (see figure 2.4).", "words": [{"w": "Images", "b": [0.1294, 0.6267, 0.2023, 0.6464]}, {"w": "typically", "b": [0.2086, 0.6267, 0.2969, 0.6464]}, {"w": "have", "b": [0.3032, 0.6267, 0.3508, 0.6464]}, {"w": "three", "b": [0.3571, 0.6267, 0.4075, 0.6464]}, {"w": "dimensions:", "b": [0.4138, 0.6267, 0.5358, 0.6464]}, {"w": "height,", "b": [0.5421, 0.6267, 0.6115, 0.6464]}, {"w": "width,", "b": [0.6178, 0.6267, 0.6815, 0.6464]}, {"w": "and", "b": [0.6878, 0.6267, 0.7243, 0.6464]}, {"w": "color", "b": [0.7306, 0.6267, 0.7824, 0.6464]}, {"w": "depth.", "b": [0.7887, 0.6267, 0.8511, 0.6464]}, {"w": "Although", "b": [0.1294, 0.6472, 0.2247, 0.6669]}, {"w": "grayscale", "b": [0.231, 0.6472, 0.3263, 0.6669]}, {"w": "images", "b": [0.3326, 0.6472, 0.404, 0.6669]}, {"w": "(like", "b": [0.4104, 0.6472, 0.4566, 0.6669]}, {"w": "our", "b": [0.4629, 0.6472, 0.4965, 0.6669]}, {"w": "MNIST", "b": [0.5028, 0.6472, 0.5813, 0.6669]}, {"w": "digits)", "b": [0.5876, 0.6472, 0.6521, 0.6669]}, {"w": "have", "b": [0.6583, 0.6472, 0.706, 0.6669]}, {"w": "only", "b": [0.7123, 0.6472, 0.7571, 0.6669]}, {"w": "a", "b": [0.7634, 0.6472, 0.7746, 0.6669]}, {"w": "single", "b": [0.7809, 0.6472, 0.8412, 0.6669]}, {"w": "color", "b": [0.1294, 0.6677, 0.1813, 0.6874]}, {"w": "channel", "b": [0.1876, 0.6677, 0.266, 0.6874]}, {"w": "and", "b": [0.2723, 0.6677, 0.3087, 0.6874]}, {"w": "could", "b": [0.315, 0.6677, 0.3711, 0.6874]}, {"w": "thus", "b": [0.3774, 0.6677, 0.4195, 0.6874]}, {"w": "be", "b": [0.4258, 0.6677, 0.4496, 0.6874]}, {"w": "stored", "b": [0.4559, 0.6677, 0.5175, 0.6874]}, {"w": "in", "b": [0.5238, 0.6677, 0.5435, 0.6874]}, {"w": "2D", "b": [0.5498, 0.6677, 0.5806, 0.6874]}, {"w": "tensors,", "b": [0.5869, 0.6677, 0.6647, 0.6874]}, {"w": "by", "b": [0.671, 0.6677, 0.6962, 0.6874]}, {"w": "convention", "b": [0.7025, 0.6677, 0.8146, 0.6874]}, {"w": "image", "b": [0.1294, 0.6882, 0.1911, 0.7079]}, {"w": "tensors", "b": [0.1974, 0.6882, 0.2688, 0.7079]}, {"w": "are", "b": [0.2751, 0.6882, 0.3059, 0.7079]}, {"w": "always", "b": [0.3122, 0.6882, 0.3823, 0.7079]}, {"w": "3D,", "b": [0.3886, 0.6882, 0.4257, 0.7079]}, {"w": "with", "b": [0.432, 0.6882, 0.4769, 0.7079]}, {"w": "a", "b": [0.4832, 0.6882, 0.4944, 0.7079]}, {"w": "one-dimensional", "b": [0.5007, 0.6882, 0.6688, 0.7079]}, {"w": "color", "b": [0.6751, 0.6882, 0.727, 0.7079]}, {"w": "channel", "b": [0.7333, 0.6882, 0.8117, 0.7079]}, {"w": "for", "b": [0.818, 0.6882, 0.8474, 0.7079]}, {"w": "grayscale", "b": [0.1294, 0.7087, 0.2247, 0.7284]}, {"w": "images.", "b": [0.231, 0.7087, 0.3087, 0.7284]}, {"w": "A", "b": [0.315, 0.7087, 0.3333, 0.7284]}, {"w": "batch", "b": [0.3396, 0.7087, 0.3942, 0.7284]}, {"w": "of", "b": [0.4005, 0.7087, 0.4215, 0.7284]}, {"w": "128", "b": [0.4278, 0.7087, 0.4657, 0.7284]}, {"w": "grayscale", "b": [0.472, 0.7087, 0.5672, 0.7284]}, {"w": "images", "b": [0.5735, 0.7087, 0.645, 0.7284]}, {"w": "of", "b": [0.6513, 0.7087, 0.6723, 0.7284]}, {"w": "size", "b": [0.6786, 0.7087, 0.7179, 0.7284]}, {"w": "256", "b": [0.7242, 0.7087, 0.762, 0.7284]}, {"w": "×", "b": [0.7683, 0.7087, 0.7825, 0.7284]}, {"w": "256", "b": [0.7888, 0.7087, 0.8267, 0.7284]}, {"w": "could", "b": [0.1294, 0.7292, 0.1855, 0.7489]}, {"w": "thus", "b": [0.1918, 0.7292, 0.2338, 0.7489]}, {"w": "be", "b": [0.2401, 0.7292, 0.2639, 0.7489]}, {"w": "stored", "b": [0.2702, 0.7292, 0.3319, 0.7489]}, {"w": "in", "b": [0.3382, 0.7292, 0.3578, 0.7489]}, {"w": "a", "b": [0.3641, 0.7292, 0.3753, 0.7489]}, {"w": "tensor", "b": [0.3816, 0.7292, 0.4433, 0.7489]}, {"w": "of", "b": [0.4496, 0.7292, 0.4706, 0.7489]}, {"w": "shape", "b": [0.4769, 0.7292, 0.5343, 0.7489]}, {"w": "(128,", "b": [0.5406, 0.7302, 0.6163, 0.7504]}, {"w": "256,", "b": [0.6314, 0.7302, 0.692, 0.7504]}, {"w": "256,", "b": [0.7071, 0.7302, 0.7676, 0.7504]}, {"w": "1),", "b": [0.7828, 0.7292, 0.8194, 0.7504]}, {"w": "and", "b": [0.8257, 0.7292, 0.8621, 0.7489]}, {"w": "a", "b": [0.1294, 0.7506, 0.1406, 0.7703]}, {"w": "batch", "b": [0.1469, 0.7506, 0.2016, 0.7703]}, {"w": "of", "b": [0.2079, 0.7506, 0.2289, 0.7703]}, {"w": "128", "b": [0.2352, 0.7506, 0.273, 0.7703]}, {"w": "color", "b": [0.2793, 0.7506, 0.3312, 0.7703]}, {"w": "images", "b": [0.3375, 0.7506, 0.4089, 0.7703]}, {"w": "could", "b": [0.4152, 0.7506, 0.4713, 0.7703]}, {"w": "be", "b": [0.4776, 0.7506, 0.5014, 0.7703]}, {"w": "stored", "b": [0.5077, 0.7506, 0.5694, 0.7703]}, {"w": "in", "b": [0.5757, 0.7506, 0.5953, 0.7703]}, {"w": "a", "b": [0.6016, 0.7506, 0.6128, 0.7703]}, {"w": "tensor", "b": [0.6191, 0.7506, 0.6808, 0.7703]}, {"w": "of", "b": [0.6871, 0.7506, 0.7081, 0.7703]}, {"w": "shape", "b": [0.7144, 0.7506, 0.7718, 0.7703]}, {"w": "(128,", "b": [0.7781, 0.7516, 0.8537, 0.7718]}, {"w": "256,", "b": [0.1294, 0.773, 0.19, 0.7932]}, {"w": "256,", "b": [0.2051, 0.773, 0.2656, 0.7932]}, {"w": "3)", "b": [0.2808, 0.773, 0.311, 0.7932]}, {"w": "(see", "b": [0.3174, 0.772, 0.358, 0.7917]}, {"w": "figure", "b": [0.3643, 0.772, 0.4245, 0.7917]}, {"w": "2.4).", "b": [0.4308, 0.772, 0.477, 0.7917]}]}, {"id": "b_4", "type": "equation", "text": "Figure 2.4. A 4D image data tensor (channels-first convention)", "words": [{"w": "Figure", "b": [0.1294, 0.8107, 0.1827, 0.8255]}, {"w": "2.4.", "b": [0.1874, 0.8107, 0.2158, 0.8255]}, {"w": "A", "b": [0.2205, 0.8107, 0.2341, 0.8255]}, {"w": "4D", "b": [0.2389, 0.8107, 0.262, 0.8255]}, {"w": "image", "b": [0.2667, 0.8107, 0.3151, 0.8255]}, {"w": "data", "b": [0.3198, 0.8107, 0.3555, 0.8255]}, {"w": "tensor", "b": [0.3603, 0.8107, 0.4107, 0.8255]}, {"w": "(channels-first", "b": [0.4154, 0.8107, 0.5321, 0.8255]}, {"w": "convention)", "b": [0.5368, 0.8107, 0.6314, 0.8255]}]}]}, {"page": 71, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "There are two conventions for shapes of images tensors: the channels- last convention (used by TensorFlow) and the channels-first convention (used by Theano). The TensorFlow machine-learning framework, from Google, places the color-depth axis at the end: (samples, height, width, color_depth). Meanwhile, Theano places the color depth axis right after the batch axis: (samples, color_depth, height, width). With the Theano convention, the previous examples would become (128, 1, 256, 256) and (128, 3, 256, 256). The Keras framework provides support for both formats.", "words": [{"w": "There", "b": [0.1294, 0.3442, 0.1882, 0.3639]}, {"w": "are", "b": [0.1945, 0.3442, 0.2253, 0.3639]}, {"w": "two", "b": [0.2317, 0.3442, 0.2695, 0.3639]}, {"w": "conventions", "b": [0.2758, 0.3442, 0.3977, 0.3639]}, {"w": "for", "b": [0.404, 0.3442, 0.4334, 0.3639]}, {"w": "shapes", "b": [0.4397, 0.3442, 0.507, 0.3639]}, {"w": "of", "b": [0.5133, 0.3442, 0.5343, 0.3639]}, {"w": "images", "b": [0.5406, 0.3442, 0.6121, 0.3639]}, {"w": "tensors:", "b": [0.6184, 0.3442, 0.6969, 0.3639]}, {"w": "the", "b": [0.7032, 0.3442, 0.734, 0.3639]}, {"w": "channels-", "b": [0.7402, 0.3442, 0.8383, 0.3639]}, {"w": "last", "b": [0.1294, 0.3647, 0.1659, 0.3844]}, {"w": "convention", "b": [0.1722, 0.3647, 0.2843, 0.3844]}, {"w": "(used", "b": [0.2906, 0.3647, 0.3452, 0.3844]}, {"w": "by", "b": [0.3515, 0.3647, 0.3767, 0.3844]}, {"w": "TensorFlow)", "b": [0.383, 0.3647, 0.5116, 0.3844]}, {"w": "and", "b": [0.5179, 0.3647, 0.5543, 0.3844]}, {"w": "the", "b": [0.5606, 0.3647, 0.5914, 0.3844]}, {"w": "channels-first", "b": [0.5977, 0.3647, 0.7365, 0.3844]}, {"w": "convention", "b": [0.7428, 0.3647, 0.8549, 0.3844]}, {"w": "(used", "b": [0.1294, 0.3852, 0.1841, 0.4049]}, {"w": "by", "b": [0.1904, 0.3852, 0.2156, 0.4049]}, {"w": "Theano).", "b": [0.2219, 0.3852, 0.3122, 0.4049]}, {"w": "The", "b": [0.3186, 0.3852, 0.3578, 0.4049]}, {"w": "TensorFlow", "b": [0.3641, 0.3852, 0.4842, 0.4049]}, {"w": "machine-learning", "b": [0.4905, 0.3852, 0.6671, 0.4049]}, {"w": "framework,", "b": [0.6734, 0.3852, 0.7903, 0.4049]}, {"w": "from", "b": [0.7966, 0.3852, 0.8457, 0.4049]}, {"w": "Google,", "b": [0.1294, 0.4057, 0.21, 0.4254]}, {"w": "places", "b": [0.2163, 0.4057, 0.2793, 0.4254]}, {"w": "the", "b": [0.2856, 0.4057, 0.3165, 0.4254]}, {"w": "color-depth", "b": [0.3228, 0.4057, 0.4385, 0.4254]}, {"w": "axis", "b": [0.4448, 0.4057, 0.4855, 0.4254]}, {"w": "at", "b": [0.4918, 0.4057, 0.51, 0.4254]}, {"w": "the", "b": [0.5163, 0.4057, 0.5471, 0.4254]}, {"w": "end:", "b": [0.5534, 0.4057, 0.5969, 0.4254]}, {"w": "(samples,", "b": [0.6031, 0.4067, 0.7393, 0.4269]}, {"w": "height,", "b": [0.7545, 0.4067, 0.8604, 0.4269]}, {"w": "width,", "b": [0.1294, 0.4281, 0.2202, 0.4483]}, {"w": "color_depth).", "b": [0.2354, 0.4271, 0.4233, 0.4483]}, {"w": "Meanwhile,", "b": [0.4296, 0.4271, 0.5494, 0.4468]}, {"w": "Theano", "b": [0.5557, 0.4271, 0.6314, 0.4468]}, {"w": "places", "b": [0.6377, 0.4271, 0.7007, 0.4468]}, {"w": "the", "b": [0.707, 0.4271, 0.7379, 0.4468]}, {"w": "color", "b": [0.7442, 0.4271, 0.796, 0.4468]}, {"w": "depth", "b": [0.8023, 0.4271, 0.8584, 0.4468]}, {"w": "axis", "b": [0.1294, 0.4484, 0.1701, 0.4682]}, {"w": "right", "b": [0.1764, 0.4484, 0.224, 0.4682]}, {"w": "after", "b": [0.2303, 0.4484, 0.2765, 0.4682]}, {"w": "the", "b": [0.2828, 0.4484, 0.3137, 0.4682]}, {"w": "batch", "b": [0.32, 0.4484, 0.3746, 0.4682]}, {"w": "axis:", "b": [0.3809, 0.4484, 0.4286, 0.4682]}, {"w": "(samples,", "b": [0.4348, 0.4495, 0.571, 0.4697]}, {"w": "color_depth,", "b": [0.5862, 0.4495, 0.7678, 0.4697]}, {"w": "height,", "b": [0.1294, 0.4709, 0.2354, 0.4911]}, {"w": "width).", "b": [0.2505, 0.4698, 0.3476, 0.4911]}, {"w": "With", "b": [0.3539, 0.4698, 0.4034, 0.4896]}, {"w": "the", "b": [0.4097, 0.4698, 0.4405, 0.4896]}, {"w": "Theano", "b": [0.4468, 0.4698, 0.5225, 0.4896]}, {"w": "convention,", "b": [0.5288, 0.4698, 0.6472, 0.4896]}, {"w": "the", "b": [0.6535, 0.4698, 0.6843, 0.4896]}, {"w": "previous", "b": [0.6906, 0.4698, 0.7775, 0.4896]}, {"w": "examples", "b": [0.1294, 0.4912, 0.2247, 0.511]}, {"w": "would", "b": [0.231, 0.4912, 0.2941, 0.511]}, {"w": "become", "b": [0.3004, 0.4912, 0.3788, 0.511]}, {"w": "(128,", "b": [0.3851, 0.4923, 0.4608, 0.5125]}, {"w": "1,", "b": [0.4759, 0.4923, 0.5062, 0.5125]}, {"w": "256,", "b": [0.5213, 0.4923, 0.5818, 0.5125]}, {"w": "256)", "b": [0.597, 0.4923, 0.6575, 0.5125]}, {"w": "and", "b": [0.6639, 0.4912, 0.7003, 0.511]}, {"w": "(128,", "b": [0.7066, 0.4923, 0.7823, 0.5125]}, {"w": "3,", "b": [0.7974, 0.4923, 0.8277, 0.5125]}, {"w": "256,", "b": [0.1294, 0.5137, 0.19, 0.5339]}, {"w": "256).", "b": [0.2051, 0.5126, 0.272, 0.5339]}, {"w": "The", "b": [0.2783, 0.5126, 0.3175, 0.5324]}, {"w": "Keras", "b": [0.3238, 0.5126, 0.3826, 0.5324]}, {"w": "framework", "b": [0.3889, 0.5126, 0.4996, 0.5324]}, {"w": "provides", "b": [0.5059, 0.5126, 0.5928, 0.5324]}, {"w": "support", "b": [0.5991, 0.5126, 0.6748, 0.5324]}, {"w": "for", "b": [0.6811, 0.5126, 0.7105, 0.5324]}, {"w": "both", "b": [0.7168, 0.5126, 0.7616, 0.5324]}, {"w": "formats.", "b": [0.7679, 0.5126, 0.8513, 0.5324]}]}, {"id": "b_1", "type": "paragraph", "text": "2.2.12. Video data", "words": [{"w": "2.2.12.", "b": [0.1294, 0.5607, 0.1988, 0.5805]}, {"w": "Video", "b": [0.2051, 0.5607, 0.2672, 0.5805]}, {"w": "data", "b": [0.2735, 0.5607, 0.3212, 0.5805]}]}, {"id": "b_2", "type": "paragraph", "text": "Video data is one of the few types of real-world data for which you’ll need 5D tensors. A video can be understood as a sequence of frames, each frame being a color image. Because each frame can be stored in a 3D tensor (height, width, color_depth), a sequence of frames can be stored in a 4D tensor (frames, height, width, color_depth), and thus a batch of different videos can be stored in a 5D tensor of shape (-samples, frames, height, width, color_depth).", "words": [{"w": "Video", "b": [0.1294, 0.6035, 0.1896, 0.6233]}, {"w": "data", "b": [0.1959, 0.6035, 0.2379, 0.6233]}, {"w": "is", "b": [0.2442, 0.6035, 0.261, 0.6233]}, {"w": "one", "b": [0.2673, 0.6035, 0.3037, 0.6233]}, {"w": "of", "b": [0.3101, 0.6035, 0.3311, 0.6233]}, {"w": "the", "b": [0.3374, 0.6035, 0.3682, 0.6233]}, {"w": "few", "b": [0.3745, 0.6035, 0.4123, 0.6233]}, {"w": "types", "b": [0.4186, 0.6035, 0.4719, 0.6233]}, {"w": "of", "b": [0.4782, 0.6035, 0.4992, 0.6233]}, {"w": "real-world", "b": [0.5055, 0.6035, 0.6106, 0.6233]}, {"w": "data", "b": [0.6169, 0.6035, 0.6589, 0.6233]}, {"w": "for", "b": [0.6652, 0.6035, 0.6946, 0.6233]}, {"w": "which", "b": [0.7009, 0.6035, 0.7626, 0.6233]}, {"w": "you’ll", "b": [0.7689, 0.6035, 0.8292, 0.6233]}, {"w": "need", "b": [0.1294, 0.624, 0.177, 0.6438]}, {"w": "5D", "b": [0.1833, 0.624, 0.2142, 0.6438]}, {"w": "tensors.", "b": [0.2205, 0.624, 0.2982, 0.6438]}, {"w": "A", "b": [0.3046, 0.624, 0.3228, 0.6438]}, {"w": "video", "b": [0.3291, 0.624, 0.3851, 0.6438]}, {"w": "can", "b": [0.3914, 0.624, 0.4264, 0.6438]}, {"w": "be", "b": [0.4328, 0.624, 0.4566, 0.6438]}, {"w": "understood", "b": [0.4629, 0.624, 0.575, 0.6438]}, {"w": "as", "b": [0.5813, 0.624, 0.6023, 0.6438]}, {"w": "a", "b": [0.6086, 0.624, 0.6198, 0.6438]}, {"w": "sequence", "b": [0.6261, 0.624, 0.7186, 0.6438]}, {"w": "of", "b": [0.7248, 0.624, 0.7458, 0.6438]}, {"w": "frames,", "b": [0.7521, 0.624, 0.8271, 0.6438]}, {"w": "each", "b": [0.1294, 0.6445, 0.1756, 0.6643]}, {"w": "frame", "b": [0.1819, 0.6445, 0.2408, 0.6643]}, {"w": "being", "b": [0.2471, 0.6445, 0.3031, 0.6643]}, {"w": "a", "b": [0.3094, 0.6445, 0.3206, 0.6643]}, {"w": "color", "b": [0.3269, 0.6445, 0.3788, 0.6643]}, {"w": "image.", "b": [0.3851, 0.6445, 0.453, 0.6643]}, {"w": "Because", "b": [0.4593, 0.6445, 0.5434, 0.6643]}, {"w": "each", "b": [0.5497, 0.6445, 0.5959, 0.6643]}, {"w": "frame", "b": [0.6022, 0.6445, 0.661, 0.6643]}, {"w": "can", "b": [0.6674, 0.6445, 0.7024, 0.6643]}, {"w": "be", "b": [0.7087, 0.6445, 0.7325, 0.6643]}, {"w": "stored", "b": [0.7388, 0.6445, 0.8004, 0.6643]}, {"w": "in", "b": [0.8067, 0.6445, 0.8264, 0.6643]}, {"w": "a", "b": [0.8327, 0.6445, 0.8439, 0.6643]}, {"w": "3D", "b": [0.1294, 0.665, 0.1602, 0.6848]}, {"w": "tensor", "b": [0.1665, 0.665, 0.2282, 0.6848]}, {"w": "(height,", "b": [0.2345, 0.6661, 0.3556, 0.6863]}, {"w": "width,", "b": [0.3707, 0.6661, 0.4615, 0.6863]}, {"w": "color_depth),", "b": [0.4767, 0.665, 0.6647, 0.6863]}, {"w": "a", "b": [0.671, 0.665, 0.6822, 0.6848]}, {"w": "sequence", "b": [0.6885, 0.665, 0.7809, 0.6848]}, {"w": "of", "b": [0.7872, 0.665, 0.8082, 0.6848]}, {"w": "frames", "b": [0.1294, 0.6864, 0.1981, 0.7062]}, {"w": "can", "b": [0.2044, 0.6864, 0.2394, 0.7062]}, {"w": "be", "b": [0.2457, 0.6864, 0.2695, 0.7062]}, {"w": "stored", "b": [0.2758, 0.6864, 0.3374, 0.7062]}, {"w": "in", "b": [0.3438, 0.6864, 0.3634, 0.7062]}, {"w": "a", "b": [0.3697, 0.6864, 0.3809, 0.7062]}, {"w": "4D", "b": [0.3872, 0.6864, 0.418, 0.7062]}, {"w": "tensor", "b": [0.4243, 0.6864, 0.486, 0.7062]}, {"w": "(frames,", "b": [0.4922, 0.6875, 0.6133, 0.7077]}, {"w": "height,", "b": [0.6285, 0.6875, 0.7344, 0.7077]}, {"w": "width,", "b": [0.7496, 0.6875, 0.8404, 0.7077]}, {"w": "color_depth),", "b": [0.1294, 0.7078, 0.3174, 0.7291]}, {"w": "and", "b": [0.3237, 0.7078, 0.3601, 0.7276]}, {"w": "thus", "b": [0.3664, 0.7078, 0.4085, 0.7276]}, {"w": "a", "b": [0.4148, 0.7078, 0.426, 0.7276]}, {"w": "batch", "b": [0.4323, 0.7078, 0.4869, 0.7276]}, {"w": "of", "b": [0.4932, 0.7078, 0.5142, 0.7276]}, {"w": "different", "b": [0.5205, 0.7078, 0.6069, 0.7276]}, {"w": "videos", "b": [0.6132, 0.7078, 0.6791, 0.7276]}, {"w": "can", "b": [0.6854, 0.7078, 0.7204, 0.7276]}, {"w": "be", "b": [0.7267, 0.7078, 0.7505, 0.7276]}, {"w": "stored", "b": [0.7568, 0.7078, 0.8185, 0.7276]}, {"w": "in", "b": [0.8248, 0.7078, 0.8444, 0.7276]}, {"w": "a", "b": [0.8507, 0.7078, 0.8619, 0.7276]}, {"w": "5D", "b": [0.1294, 0.7292, 0.1602, 0.7489]}, {"w": "tensor", "b": [0.1665, 0.7292, 0.2282, 0.7489]}, {"w": "of", "b": [0.2345, 0.7292, 0.2555, 0.7489]}, {"w": "shape", "b": [0.2618, 0.7292, 0.3193, 0.7489]}, {"w": "(-samples,", "b": [0.3256, 0.7303, 0.4769, 0.7504]}, {"w": "frames,", "b": [0.4921, 0.7303, 0.598, 0.7504]}, {"w": "height,", "b": [0.6131, 0.7303, 0.7191, 0.7504]}, {"w": "width,", "b": [0.7342, 0.7303, 0.825, 0.7504]}, {"w": "color_depth).", "b": [0.1294, 0.7506, 0.3174, 0.7718]}]}, {"id": "b_3", "type": "paragraph", "text": "For instance, a 60-second, 144 × 256 YouTube video clip sampled at 4 frames per second would have 240 frames. A batch of four such video clips would be stored in a tensor of shape (4, 240, 144, 256, 3). That’s a total of 106,168,320 values! If the dtype of the tensor was float32, then each value would be stored in 32 bits, so the tensor", "words": [{"w": "For", "b": [0.1294, 0.7943, 0.1645, 0.814]}, {"w": "instance,", "b": [0.1708, 0.7943, 0.2597, 0.814]}, {"w": "a", "b": [0.266, 0.7943, 0.2772, 0.814]}, {"w": "60-second,", "b": [0.2835, 0.7943, 0.3935, 0.814]}, {"w": "144", "b": [0.3998, 0.7943, 0.4377, 0.814]}, {"w": "×", "b": [0.444, 0.7943, 0.4582, 0.814]}, {"w": "256", "b": [0.4645, 0.7943, 0.5023, 0.814]}, {"w": "YouTube", "b": [0.5087, 0.7943, 0.6005, 0.814]}, {"w": "video", "b": [0.6068, 0.7943, 0.6629, 0.814]}, {"w": "clip", "b": [0.6692, 0.7943, 0.707, 0.814]}, {"w": "sampled", "b": [0.7133, 0.7943, 0.7974, 0.814]}, {"w": "at", "b": [0.8037, 0.7943, 0.8219, 0.814]}, {"w": "4", "b": [0.8282, 0.7943, 0.8408, 0.814]}, {"w": "frames", "b": [0.1294, 0.8148, 0.1981, 0.8345]}, {"w": "per", "b": [0.2044, 0.8148, 0.2366, 0.8345]}, {"w": "second", "b": [0.2429, 0.8148, 0.3129, 0.8345]}, {"w": "would", "b": [0.3192, 0.8148, 0.3823, 0.8345]}, {"w": "have", "b": [0.3886, 0.8148, 0.4362, 0.8345]}, {"w": "240", "b": [0.4425, 0.8148, 0.4804, 0.8345]}, {"w": "frames.", "b": [0.4867, 0.8148, 0.5616, 0.8345]}, {"w": "A", "b": [0.5679, 0.8148, 0.5861, 0.8345]}, {"w": "batch", "b": [0.5925, 0.8148, 0.6471, 0.8345]}, {"w": "of", "b": [0.6534, 0.8148, 0.6744, 0.8345]}, {"w": "four", "b": [0.6807, 0.8148, 0.7227, 0.8345]}, {"w": "such", "b": [0.729, 0.8148, 0.7753, 0.8345]}, {"w": "video", "b": [0.7816, 0.8148, 0.8376, 0.8345]}, {"w": "clips", "b": [0.1294, 0.8353, 0.1771, 0.855]}, {"w": "would", "b": [0.1834, 0.8353, 0.2464, 0.855]}, {"w": "be", "b": [0.2527, 0.8353, 0.2766, 0.855]}, {"w": "stored", "b": [0.2829, 0.8353, 0.3445, 0.855]}, {"w": "in", "b": [0.3508, 0.8353, 0.3704, 0.855]}, {"w": "a", "b": [0.3768, 0.8353, 0.388, 0.855]}, {"w": "tensor", "b": [0.3943, 0.8353, 0.4559, 0.855]}, {"w": "of", "b": [0.4622, 0.8353, 0.4832, 0.855]}, {"w": "shape", "b": [0.4895, 0.8353, 0.547, 0.855]}, {"w": "(4,", "b": [0.5532, 0.8363, 0.5987, 0.8565]}, {"w": "240,", "b": [0.6138, 0.8363, 0.6743, 0.8565]}, {"w": "144,", "b": [0.6895, 0.8363, 0.75, 0.8565]}, {"w": "256,", "b": [0.7651, 0.8363, 0.8257, 0.8565]}, {"w": "3).", "b": [0.1294, 0.8567, 0.166, 0.8779]}, {"w": "That’s", "b": [0.1723, 0.8567, 0.2353, 0.8764]}, {"w": "a", "b": [0.2417, 0.8567, 0.2529, 0.8764]}, {"w": "total", "b": [0.2592, 0.8567, 0.304, 0.8764]}, {"w": "of", "b": [0.3103, 0.8567, 0.3313, 0.8764]}, {"w": "106,168,320", "b": [0.3376, 0.8567, 0.4638, 0.8764]}, {"w": "values!", "b": [0.4701, 0.8567, 0.5429, 0.8764]}, {"w": "If", "b": [0.5492, 0.8567, 0.566, 0.8764]}, {"w": "the", "b": [0.5723, 0.8567, 0.6032, 0.8764]}, {"w": "dtype", "b": [0.6094, 0.8577, 0.6851, 0.8779]}, {"w": "of", "b": [0.6914, 0.8567, 0.7124, 0.8764]}, {"w": "the", "b": [0.7187, 0.8567, 0.7496, 0.8764]}, {"w": "tensor", "b": [0.7559, 0.8567, 0.8175, 0.8764]}, {"w": "was", "b": [0.8238, 0.8567, 0.8631, 0.8764]}, {"w": "float32,", "b": [0.1294, 0.8781, 0.2417, 0.8993]}, {"w": "then", "b": [0.248, 0.8781, 0.2914, 0.8978]}, {"w": "each", "b": [0.2977, 0.8781, 0.3439, 0.8978]}, {"w": "value", "b": [0.3502, 0.8781, 0.4049, 0.8978]}, {"w": "would", "b": [0.4112, 0.8781, 0.4742, 0.8978]}, {"w": "be", "b": [0.4806, 0.8781, 0.5044, 0.8978]}, {"w": "stored", "b": [0.5107, 0.8781, 0.5723, 0.8978]}, {"w": "in", "b": [0.5786, 0.8781, 0.5983, 0.8978]}, {"w": "32", "b": [0.6046, 0.8781, 0.6298, 0.8978]}, {"w": "bits,", "b": [0.6361, 0.8781, 0.6789, 0.8978]}, {"w": "so", "b": [0.6852, 0.8781, 0.7076, 0.8978]}, {"w": "the", "b": [0.7139, 0.8781, 0.7447, 0.8978]}, {"w": "tensor", "b": [0.751, 0.8781, 0.8127, 0.8978]}]}]}, {"page": 72, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "would represent 405 MB. Heavy! Videos you encounter in real life are much lighter, because they aren’t stored in float32, and they’re typically compressed by a large factor (such as in the MPEG format).", "words": [{"w": "would", "b": [0.1294, 0.0857, 0.1925, 0.1054]}, {"w": "represent", "b": [0.1988, 0.0857, 0.2912, 0.1054]}, {"w": "405", "b": [0.2975, 0.0857, 0.3354, 0.1054]}, {"w": "MB.", "b": [0.3417, 0.0857, 0.3872, 0.1054]}, {"w": "Heavy!", "b": [0.3936, 0.0857, 0.4678, 0.1054]}, {"w": "Videos", "b": [0.4741, 0.0857, 0.544, 0.1054]}, {"w": "you", "b": [0.5503, 0.0857, 0.5882, 0.1054]}, {"w": "encounter", "b": [0.5945, 0.0857, 0.694, 0.1054]}, {"w": "in", "b": [0.7003, 0.0857, 0.7199, 0.1054]}, {"w": "real", "b": [0.7262, 0.0857, 0.764, 0.1054]}, {"w": "life", "b": [0.7703, 0.0857, 0.8039, 0.1054]}, {"w": "are", "b": [0.8102, 0.0857, 0.841, 0.1054]}, {"w": "much", "b": [0.1294, 0.1062, 0.1855, 0.1259]}, {"w": "lighter,", "b": [0.1918, 0.1062, 0.2629, 0.1259]}, {"w": "because", "b": [0.2692, 0.1062, 0.3491, 0.1259]}, {"w": "they", "b": [0.3554, 0.1062, 0.3988, 0.1259]}, {"w": "aren’t", "b": [0.4051, 0.1062, 0.4634, 0.1259]}, {"w": "stored", "b": [0.4698, 0.1062, 0.5314, 0.1259]}, {"w": "in", "b": [0.5377, 0.1062, 0.5573, 0.1259]}, {"w": "float32,", "b": [0.5636, 0.1062, 0.6759, 0.1274]}, {"w": "and", "b": [0.6822, 0.1062, 0.7186, 0.1259]}, {"w": "they’re", "b": [0.7249, 0.1062, 0.7964, 0.1259]}, {"w": "typically", "b": [0.1294, 0.1276, 0.2177, 0.1473]}, {"w": "compressed", "b": [0.224, 0.1276, 0.3431, 0.1473]}, {"w": "by", "b": [0.3494, 0.1276, 0.3746, 0.1473]}, {"w": "a", "b": [0.3809, 0.1276, 0.3921, 0.1473]}, {"w": "large", "b": [0.3984, 0.1276, 0.4484, 0.1473]}, {"w": "factor", "b": [0.4547, 0.1276, 0.5135, 0.1473]}, {"w": "(such", "b": [0.5198, 0.1276, 0.5744, 0.1473]}, {"w": "as", "b": [0.5808, 0.1276, 0.6018, 0.1473]}, {"w": "in", "b": [0.6081, 0.1276, 0.6277, 0.1473]}, {"w": "the", "b": [0.634, 0.1276, 0.6648, 0.1473]}, {"w": "MPEG", "b": [0.6711, 0.1276, 0.7412, 0.1473]}, {"w": "format).", "b": [0.7475, 0.1276, 0.8295, 0.1473]}]}, {"id": "b_1", "type": "paragraph", "text": "2.3. The gears of neural networks: tensor operations", "words": [{"w": "2.3.", "b": [0.1294, 0.1844, 0.172, 0.2066]}, {"w": "The", "b": [0.1791, 0.1844, 0.2264, 0.2066]}, {"w": "gears", "b": [0.2335, 0.1844, 0.2981, 0.2066]}, {"w": "of", "b": [0.3052, 0.1844, 0.3288, 0.2066]}, {"w": "neural", "b": [0.3359, 0.1844, 0.4148, 0.2066]}, {"w": "networks:", "b": [0.4219, 0.1844, 0.5432, 0.2066]}, {"w": "tensor", "b": [0.5503, 0.1844, 0.626, 0.2066]}, {"w": "operations", "b": [0.6331, 0.1844, 0.7608, 0.2066]}]}, {"id": "b_2", "type": "paragraph", "text": "Much as any computer program can be ultimately reduced to a small set of binary operations on binary inputs (AND, OR, NOR, and so on), all transformations learned by deep neural networks can be reduced to a handful of tensor operations applied to tensors of numeric data. For instance, it’s possible to add tensors, multiply tensors, and so on.", "words": [{"w": "Much", "b": [0.1294, 0.2301, 0.1883, 0.2498]}, {"w": "as", "b": [0.1946, 0.2301, 0.2156, 0.2498]}, {"w": "any", "b": [0.2219, 0.2301, 0.2583, 0.2498]}, {"w": "computer", "b": [0.2646, 0.2301, 0.3599, 0.2498]}, {"w": "program", "b": [0.3662, 0.2301, 0.4517, 0.2498]}, {"w": "can", "b": [0.458, 0.2301, 0.493, 0.2498]}, {"w": "be", "b": [0.4993, 0.2301, 0.5231, 0.2498]}, {"w": "ultimately", "b": [0.5294, 0.2301, 0.6317, 0.2498]}, {"w": "reduced", "b": [0.638, 0.2301, 0.7179, 0.2498]}, {"w": "to", "b": [0.7242, 0.2301, 0.7438, 0.2498]}, {"w": "a", "b": [0.7501, 0.2301, 0.7613, 0.2498]}, {"w": "small", "b": [0.7676, 0.2301, 0.8223, 0.2498]}, {"w": "set", "b": [0.8286, 0.2301, 0.8566, 0.2498]}, {"w": "of", "b": [0.1294, 0.2506, 0.1504, 0.2703]}, {"w": "binary", "b": [0.1567, 0.2506, 0.2212, 0.2703]}, {"w": "operations", "b": [0.2275, 0.2506, 0.3326, 0.2703]}, {"w": "on", "b": [0.3389, 0.2506, 0.3641, 0.2703]}, {"w": "binary", "b": [0.3704, 0.2506, 0.4349, 0.2703]}, {"w": "inputs", "b": [0.4412, 0.2506, 0.5029, 0.2703]}, {"w": "(AND,", "b": [0.5092, 0.2506, 0.5785, 0.2703]}, {"w": "OR,", "b": [0.5848, 0.2506, 0.6262, 0.2703]}, {"w": "NOR,", "b": [0.6325, 0.2506, 0.692, 0.2703]}, {"w": "and", "b": [0.6983, 0.2506, 0.7347, 0.2703]}, {"w": "so", "b": [0.741, 0.2506, 0.7635, 0.2703]}, {"w": "on),", "b": [0.7698, 0.2506, 0.8097, 0.2703]}, {"w": "all", "b": [0.816, 0.2506, 0.8412, 0.2703]}, {"w": "transformations", "b": [0.1294, 0.2711, 0.2878, 0.2908]}, {"w": "learned", "b": [0.2941, 0.2711, 0.3683, 0.2908]}, {"w": "by", "b": [0.3746, 0.2711, 0.3998, 0.2908]}, {"w": "deep", "b": [0.4061, 0.2711, 0.4538, 0.2908]}, {"w": "neural", "b": [0.4601, 0.2711, 0.5231, 0.2908]}, {"w": "networks", "b": [0.5294, 0.2711, 0.6219, 0.2908]}, {"w": "can", "b": [0.6282, 0.2711, 0.6632, 0.2908]}, {"w": "be", "b": [0.6695, 0.2711, 0.6933, 0.2908]}, {"w": "reduced", "b": [0.6996, 0.2711, 0.7795, 0.2908]}, {"w": "to", "b": [0.7858, 0.2711, 0.8054, 0.2908]}, {"w": "a", "b": [0.8117, 0.2711, 0.8229, 0.2908]}, {"w": "handful", "b": [0.1294, 0.2916, 0.2065, 0.3113]}, {"w": "of", "b": [0.2128, 0.2916, 0.2338, 0.3113]}, {"w": "tensor", "b": [0.2401, 0.2916, 0.3032, 0.3113]}, {"w": "operations", "b": [0.3095, 0.2916, 0.4174, 0.3113]}, {"w": "applied", "b": [0.4237, 0.2916, 0.4979, 0.3113]}, {"w": "to", "b": [0.5042, 0.2916, 0.5239, 0.3113]}, {"w": "tensors", "b": [0.5302, 0.2916, 0.6016, 0.3113]}, {"w": "of", "b": [0.6079, 0.2916, 0.629, 0.3113]}, {"w": "numeric", "b": [0.6353, 0.2916, 0.7179, 0.3113]}, {"w": "data.", "b": [0.7242, 0.2916, 0.7726, 0.3113]}, {"w": "For", "b": [0.7789, 0.2916, 0.8139, 0.3113]}, {"w": "instance,", "b": [0.1294, 0.3121, 0.2184, 0.3318]}, {"w": "it’s", "b": [0.2247, 0.3121, 0.2555, 0.3318]}, {"w": "possible", "b": [0.2618, 0.3121, 0.3445, 0.3318]}, {"w": "to", "b": [0.3508, 0.3121, 0.3704, 0.3318]}, {"w": "add", "b": [0.3767, 0.3121, 0.4132, 0.3318]}, {"w": "tensors,", "b": [0.4195, 0.3121, 0.4973, 0.3318]}, {"w": "multiply", "b": [0.5036, 0.3121, 0.5891, 0.3318]}, {"w": "tensors,", "b": [0.5954, 0.3121, 0.6731, 0.3318]}, {"w": "and", "b": [0.6795, 0.3121, 0.7159, 0.3318]}, {"w": "so", "b": [0.7222, 0.3121, 0.7446, 0.3318]}, {"w": "on.", "b": [0.7509, 0.3121, 0.7825, 0.3318]}]}, {"id": "b_3", "type": "paragraph", "text": "In our initial example, we were building our network by stacking Dense layers on top of each other. A Keras layer instance looks like this:", "words": [{"w": "In", "b": [0.1294, 0.3549, 0.1504, 0.3746]}, {"w": "our", "b": [0.1567, 0.3549, 0.1904, 0.3746]}, {"w": "initial", "b": [0.1967, 0.3549, 0.2555, 0.3746]}, {"w": "example,", "b": [0.2618, 0.3549, 0.3536, 0.3746]}, {"w": "we", "b": [0.3599, 0.3549, 0.3893, 0.3746]}, {"w": "were", "b": [0.3956, 0.3549, 0.4447, 0.3746]}, {"w": "building", "b": [0.451, 0.3549, 0.5351, 0.3746]}, {"w": "our", "b": [0.5414, 0.3549, 0.575, 0.3746]}, {"w": "network", "b": [0.5813, 0.3549, 0.664, 0.3746]}, {"w": "by", "b": [0.6703, 0.3549, 0.6955, 0.3746]}, {"w": "stacking", "b": [0.7018, 0.3549, 0.7859, 0.3746]}, {"w": "Dense", "b": [0.7921, 0.3559, 0.8678, 0.3761]}, {"w": "layers", "b": [0.1294, 0.3762, 0.1897, 0.396]}, {"w": "on", "b": [0.196, 0.3762, 0.2212, 0.396]}, {"w": "top", "b": [0.2275, 0.3762, 0.2597, 0.396]}, {"w": "of", "b": [0.266, 0.3762, 0.287, 0.396]}, {"w": "each", "b": [0.2934, 0.3762, 0.3396, 0.396]}, {"w": "other.", "b": [0.3459, 0.3762, 0.4026, 0.396]}, {"w": "A", "b": [0.4089, 0.3762, 0.4271, 0.396]}, {"w": "Keras", "b": [0.4334, 0.3762, 0.4922, 0.396]}, {"w": "layer", "b": [0.4986, 0.3762, 0.549, 0.396]}, {"w": "instance", "b": [0.5553, 0.3762, 0.638, 0.396]}, {"w": "looks", "b": [0.6443, 0.3762, 0.6989, 0.396]}, {"w": "like", "b": [0.7052, 0.3762, 0.7431, 0.396]}, {"w": "this:", "b": [0.7494, 0.3762, 0.7928, 0.396]}]}, {"id": "b_4", "type": "equation", "text": "keras.layers.Dense(512, activation='relu')", "words": [{"w": "keras.layers.Dense(512,", "b": [0.1357, 0.414, 0.3968, 0.4291]}, {"w": "activation='relu')", "b": [0.4082, 0.414, 0.6125, 0.4291]}]}, {"id": "b_5", "type": "paragraph", "text": "This layer can be interpreted as a function, which takes as input a 2D tensor and returns another 2D tensor—a new representation for the input tensor. Specifically, the function is as follows (where W is a 2D tensor and b is a vector, both attributes of the layer):", "words": [{"w": "This", "b": [0.1294, 0.452, 0.1743, 0.4717]}, {"w": "layer", "b": [0.1806, 0.452, 0.231, 0.4717]}, {"w": "can", "b": [0.2373, 0.452, 0.2723, 0.4717]}, {"w": "be", "b": [0.2786, 0.452, 0.3024, 0.4717]}, {"w": "interpreted", "b": [0.3087, 0.452, 0.418, 0.4717]}, {"w": "as", "b": [0.4243, 0.452, 0.4453, 0.4717]}, {"w": "a", "b": [0.4516, 0.452, 0.4628, 0.4717]}, {"w": "function,", "b": [0.4692, 0.452, 0.5595, 0.4717]}, {"w": "which", "b": [0.5658, 0.452, 0.6275, 0.4717]}, {"w": "takes", "b": [0.6338, 0.452, 0.6856, 0.4717]}, {"w": "as", "b": [0.6919, 0.452, 0.713, 0.4717]}, {"w": "input", "b": [0.7193, 0.452, 0.7711, 0.4717]}, {"w": "a", "b": [0.7774, 0.452, 0.7886, 0.4717]}, {"w": "2D", "b": [0.7949, 0.452, 0.8258, 0.4717]}, {"w": "tensor", "b": [0.1294, 0.4725, 0.1911, 0.4922]}, {"w": "and", "b": [0.1974, 0.4725, 0.2338, 0.4922]}, {"w": "returns", "b": [0.2401, 0.4725, 0.3102, 0.4922]}, {"w": "another", "b": [0.3165, 0.4725, 0.3921, 0.4922]}, {"w": "2D", "b": [0.3984, 0.4725, 0.4292, 0.4922]}, {"w": "tensor—a", "b": [0.4356, 0.4725, 0.5336, 0.4922]}, {"w": "new", "b": [0.5399, 0.4725, 0.582, 0.4922]}, {"w": "representation", "b": [0.5883, 0.4725, 0.7312, 0.4922]}, {"w": "for", "b": [0.7374, 0.4725, 0.7668, 0.4922]}, {"w": "the", "b": [0.7731, 0.4725, 0.804, 0.4922]}, {"w": "input", "b": [0.8103, 0.4725, 0.8621, 0.4922]}, {"w": "tensor.", "b": [0.1294, 0.493, 0.196, 0.5127]}, {"w": "Specifically,", "b": [0.2023, 0.493, 0.3274, 0.5127]}, {"w": "the", "b": [0.3337, 0.493, 0.3646, 0.5127]}, {"w": "function", "b": [0.3709, 0.493, 0.4549, 0.5127]}, {"w": "is", "b": [0.4612, 0.493, 0.4781, 0.5127]}, {"w": "as", "b": [0.4844, 0.493, 0.5054, 0.5127]}, {"w": "follows", "b": [0.5117, 0.493, 0.5874, 0.5127]}, {"w": "(where", "b": [0.5937, 0.493, 0.6637, 0.5127]}, {"w": "W", "b": [0.67, 0.4941, 0.6851, 0.5142]}, {"w": "is", "b": [0.6914, 0.493, 0.7083, 0.5127]}, {"w": "a", "b": [0.7146, 0.493, 0.7258, 0.5127]}, {"w": "2D", "b": [0.7321, 0.493, 0.7629, 0.5127]}, {"w": "tensor", "b": [0.7692, 0.493, 0.8309, 0.5127]}, {"w": "and", "b": [0.1294, 0.5144, 0.1658, 0.5341]}, {"w": "b", "b": [0.1721, 0.5154, 0.1873, 0.5356]}, {"w": "is", "b": [0.1936, 0.5144, 0.2104, 0.5341]}, {"w": "a", "b": [0.2167, 0.5144, 0.2279, 0.5341]}, {"w": "vector,", "b": [0.2342, 0.5144, 0.3025, 0.5341]}, {"w": "both", "b": [0.3088, 0.5144, 0.3537, 0.5341]}, {"w": "attributes", "b": [0.36, 0.5144, 0.4539, 0.5341]}, {"w": "of", "b": [0.4602, 0.5144, 0.4812, 0.5341]}, {"w": "the", "b": [0.4875, 0.5144, 0.5183, 0.5341]}, {"w": "layer):", "b": [0.5247, 0.5144, 0.5905, 0.5341]}]}, {"id": "b_6", "type": "equation", "text": "output = relu(dot(W, input) + b)", "words": [{"w": "output", "b": [0.1357, 0.553, 0.2038, 0.5682]}, {"w": "=", "b": [0.2152, 0.553, 0.2265, 0.5682]}, {"w": "relu(dot(W,", "b": [0.2379, 0.553, 0.3628, 0.5682]}, {"w": "input)", "b": [0.3741, 0.553, 0.4422, 0.5682]}, {"w": "+", "b": [0.4536, 0.553, 0.4649, 0.5682]}, {"w": "b)", "b": [0.4763, 0.553, 0.499, 0.5682]}]}, {"id": "b_7", "type": "paragraph", "text": "Let’s unpack this. We have three tensor operations here: a dot product (dot) between the input tensor and a tensor named W; an addition (+) between the resulting 2D tensor and a vector b; and, finally, a relu operation. relu(x) is max(x, 0).", "words": [{"w": "Let’s", "b": [0.1294, 0.5911, 0.1798, 0.6108]}, {"w": "unpack", "b": [0.1862, 0.5911, 0.259, 0.6108]}, {"w": "this.", "b": [0.2653, 0.5911, 0.3081, 0.6108]}, {"w": "We", "b": [0.3144, 0.5911, 0.3474, 0.6108]}, {"w": "have", "b": [0.3537, 0.5911, 0.4013, 0.6108]}, {"w": "three", "b": [0.4076, 0.5911, 0.458, 0.6108]}, {"w": "tensor", "b": [0.4643, 0.5911, 0.526, 0.6108]}, {"w": "operations", "b": [0.5323, 0.5911, 0.6374, 0.6108]}, {"w": "here:", "b": [0.6437, 0.5911, 0.6941, 0.6108]}, {"w": "a", "b": [0.7004, 0.5911, 0.7116, 0.6108]}, {"w": "dot", "b": [0.7179, 0.5911, 0.7502, 0.6108]}, {"w": "product", "b": [0.7565, 0.5911, 0.8335, 0.6108]}, {"w": "(dot)", "b": [0.1294, 0.6116, 0.1916, 0.6328]}, {"w": "between", "b": [0.1979, 0.6116, 0.282, 0.6313]}, {"w": "the", "b": [0.2883, 0.6116, 0.3191, 0.6313]}, {"w": "input", "b": [0.3254, 0.6116, 0.3773, 0.6313]}, {"w": "tensor", "b": [0.3836, 0.6116, 0.4452, 0.6313]}, {"w": "and", "b": [0.4515, 0.6116, 0.488, 0.6313]}, {"w": "a", "b": [0.4943, 0.6116, 0.5055, 0.6313]}, {"w": "tensor", "b": [0.5118, 0.6116, 0.5734, 0.6313]}, {"w": "named", "b": [0.5797, 0.6116, 0.647, 0.6313]}, {"w": "W;", "b": [0.6532, 0.6116, 0.6754, 0.6328]}, {"w": "an", "b": [0.6817, 0.6116, 0.7055, 0.6313]}, {"w": "addition", "b": [0.7118, 0.6116, 0.7945, 0.6313]}, {"w": "(+)", "b": [0.8008, 0.6116, 0.8327, 0.6328]}, {"w": "between", "b": [0.1294, 0.6329, 0.2135, 0.6527]}, {"w": "the", "b": [0.2198, 0.6329, 0.2506, 0.6527]}, {"w": "resulting", "b": [0.2569, 0.6329, 0.3452, 0.6527]}, {"w": "2D", "b": [0.3515, 0.6329, 0.3823, 0.6527]}, {"w": "tensor", "b": [0.3886, 0.6329, 0.4503, 0.6527]}, {"w": "and", "b": [0.4566, 0.6329, 0.493, 0.6527]}, {"w": "a", "b": [0.4993, 0.6329, 0.5105, 0.6527]}, {"w": "vector", "b": [0.5168, 0.6329, 0.5799, 0.6527]}, {"w": "b;", "b": [0.5861, 0.6329, 0.6083, 0.6542]}, {"w": "and,", "b": [0.6146, 0.6329, 0.6573, 0.6527]}, {"w": "finally,", "b": [0.6636, 0.6329, 0.7341, 0.6527]}, {"w": "a", "b": [0.7404, 0.6329, 0.7516, 0.6527]}, {"w": "relu", "b": [0.7579, 0.634, 0.8185, 0.6542]}, {"w": "operation.", "b": [0.1294, 0.6543, 0.231, 0.6741]}, {"w": "relu(x)", "b": [0.2373, 0.6554, 0.3432, 0.6756]}, {"w": "is", "b": [0.3495, 0.6543, 0.3664, 0.6741]}, {"w": "max(x,", "b": [0.3726, 0.6554, 0.4635, 0.6756]}, {"w": "0).", "b": [0.4786, 0.6543, 0.5152, 0.6756]}]}, {"id": "b_8", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.7038, 0.1672, 0.7186]}]}, {"id": "b_9", "type": "paragraph", "text": "Although this section deals entirely with linear algebra expressions, you won’t find any mathematical notation here. I’ve found that mathematical concepts can be more readily mastered by programmers with no mathematical background if they’re expressed as short Python snippets instead of mathematical equations. So we’ll use Numpy code throughout.", "words": [{"w": "Although", "b": [0.1294, 0.7372, 0.2247, 0.757]}, {"w": "this", "b": [0.231, 0.7372, 0.2675, 0.757]}, {"w": "section", "b": [0.2738, 0.7372, 0.3452, 0.757]}, {"w": "deals", "b": [0.3516, 0.7372, 0.4034, 0.757]}, {"w": "entirely", "b": [0.4097, 0.7372, 0.4868, 0.757]}, {"w": "with", "b": [0.4931, 0.7372, 0.5379, 0.757]}, {"w": "linear", "b": [0.5442, 0.7372, 0.6017, 0.757]}, {"w": "algebra", "b": [0.608, 0.7372, 0.6822, 0.757]}, {"w": "expressions,", "b": [0.6885, 0.7372, 0.8125, 0.757]}, {"w": "you", "b": [0.8188, 0.7372, 0.8567, 0.757]}, {"w": "won’t", "b": [0.1294, 0.7577, 0.1878, 0.7775]}, {"w": "find", "b": [0.1941, 0.7577, 0.2348, 0.7775]}, {"w": "any", "b": [0.2411, 0.7577, 0.2775, 0.7775]}, {"w": "mathematical", "b": [0.2838, 0.7577, 0.4197, 0.7775]}, {"w": "notation", "b": [0.426, 0.7577, 0.5087, 0.7775]}, {"w": "here.", "b": [0.515, 0.7577, 0.5647, 0.7775]}, {"w": "I’ve", "b": [0.571, 0.7577, 0.6117, 0.7775]}, {"w": "found", "b": [0.6179, 0.7577, 0.6767, 0.7775]}, {"w": "that", "b": [0.683, 0.7577, 0.7209, 0.7775]}, {"w": "mathematical", "b": [0.7272, 0.7577, 0.8631, 0.7775]}, {"w": "concepts", "b": [0.1294, 0.7782, 0.2177, 0.798]}, {"w": "can", "b": [0.224, 0.7782, 0.259, 0.798]}, {"w": "be", "b": [0.2653, 0.7782, 0.2891, 0.798]}, {"w": "more", "b": [0.2954, 0.7782, 0.3473, 0.798]}, {"w": "readily", "b": [0.3536, 0.7782, 0.4236, 0.798]}, {"w": "mastered", "b": [0.4299, 0.7782, 0.521, 0.798]}, {"w": "by", "b": [0.5273, 0.7782, 0.5525, 0.798]}, {"w": "programmers", "b": [0.5588, 0.7782, 0.6933, 0.798]}, {"w": "with", "b": [0.6996, 0.7782, 0.7445, 0.798]}, {"w": "no", "b": [0.7508, 0.7782, 0.776, 0.798]}, {"w": "mathematical", "b": [0.1294, 0.7987, 0.2653, 0.8185]}, {"w": "background", "b": [0.2716, 0.7987, 0.3907, 0.8185]}, {"w": "if", "b": [0.397, 0.7987, 0.4124, 0.8185]}, {"w": "they’re", "b": [0.4188, 0.7987, 0.4902, 0.8185]}, {"w": "expressed", "b": [0.4965, 0.7987, 0.596, 0.8185]}, {"w": "as", "b": [0.6022, 0.7987, 0.6232, 0.8185]}, {"w": "short", "b": [0.6295, 0.7987, 0.68, 0.8185]}, {"w": "Python", "b": [0.6863, 0.7987, 0.7578, 0.8185]}, {"w": "snippets", "b": [0.7641, 0.7987, 0.8468, 0.8185]}, {"w": "instead", "b": [0.1294, 0.8192, 0.2009, 0.839]}, {"w": "of", "b": [0.2072, 0.8192, 0.2282, 0.839]}, {"w": "mathematical", "b": [0.2345, 0.8192, 0.3704, 0.839]}, {"w": "equations.", "b": [0.3767, 0.8192, 0.4797, 0.839]}, {"w": "So", "b": [0.486, 0.8192, 0.5127, 0.839]}, {"w": "we’ll", "b": [0.519, 0.8192, 0.5708, 0.839]}, {"w": "use", "b": [0.5771, 0.8192, 0.6107, 0.839]}, {"w": "Numpy", "b": [0.6171, 0.8192, 0.6927, 0.839]}, {"w": "code", "b": [0.699, 0.8192, 0.7467, 0.839]}, {"w": "throughout.", "b": [0.753, 0.8192, 0.87, 0.839]}]}, {"id": "b_10", "type": "equation", "text": "2.3.1. Element-wise operations", "words": [{"w": "2.3.1.", "b": [0.1294, 0.8932, 0.1862, 0.9129]}, {"w": "Element-wise", "b": [0.1925, 0.8932, 0.3368, 0.9129]}, {"w": "operations", "b": [0.3431, 0.8932, 0.4566, 0.9129]}]}]}, {"page": 73, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The relu operation and addition are element-wise operations: operations that are applied independently to each entry in the tensors being considered. This means these operations are highly amenable to massively parallel implementations (vectorized implementations, a term that comes from the vector processor supercomputer architecture from the 1970–1990 period). If you want to write a naive Python implementation of an element-wise operation, you use a for loop, as in this naive implementation of an element-wise relu operation:", "words": [{"w": "The", "b": [0.1294, 0.0857, 0.1686, 0.1054]}, {"w": "relu", "b": [0.1749, 0.0867, 0.2355, 0.1069]}, {"w": "operation", "b": [0.2418, 0.0857, 0.3371, 0.1054]}, {"w": "and", "b": [0.3434, 0.0857, 0.3798, 0.1054]}, {"w": "addition", "b": [0.3861, 0.0857, 0.4688, 0.1054]}, {"w": "are", "b": [0.4751, 0.0857, 0.5059, 0.1054]}, {"w": "element-wise", "b": [0.5122, 0.0857, 0.6439, 0.1054]}, {"w": "operations:", "b": [0.6501, 0.0857, 0.7622, 0.1054]}, {"w": "operations", "b": [0.1294, 0.1071, 0.2345, 0.1268]}, {"w": "that", "b": [0.2408, 0.1071, 0.2786, 0.1268]}, {"w": "are", "b": [0.285, 0.1071, 0.3158, 0.1268]}, {"w": "applied", "b": [0.3221, 0.1071, 0.3963, 0.1268]}, {"w": "independently", "b": [0.4026, 0.1071, 0.5456, 0.1268]}, {"w": "to", "b": [0.5519, 0.1071, 0.5715, 0.1268]}, {"w": "each", "b": [0.5778, 0.1071, 0.624, 0.1268]}, {"w": "entry", "b": [0.6303, 0.1071, 0.6822, 0.1268]}, {"w": "in", "b": [0.6885, 0.1071, 0.7081, 0.1268]}, {"w": "the", "b": [0.7144, 0.1071, 0.7452, 0.1268]}, {"w": "tensors", "b": [0.7515, 0.1071, 0.823, 0.1268]}, {"w": "being", "b": [0.1294, 0.1276, 0.1855, 0.1473]}, {"w": "considered.", "b": [0.1918, 0.1276, 0.3074, 0.1473]}, {"w": "This", "b": [0.3137, 0.1276, 0.3585, 0.1473]}, {"w": "means", "b": [0.3648, 0.1276, 0.4293, 0.1473]}, {"w": "these", "b": [0.4356, 0.1276, 0.4874, 0.1473]}, {"w": "operations", "b": [0.4937, 0.1276, 0.5988, 0.1473]}, {"w": "are", "b": [0.6051, 0.1276, 0.6359, 0.1473]}, {"w": "highly", "b": [0.6422, 0.1276, 0.7066, 0.1473]}, {"w": "amenable", "b": [0.7129, 0.1276, 0.8096, 0.1473]}, {"w": "to", "b": [0.8159, 0.1276, 0.8355, 0.1473]}, {"w": "massively", "b": [0.1294, 0.1481, 0.2303, 0.1678]}, {"w": "parallel", "b": [0.2366, 0.1481, 0.3123, 0.1678]}, {"w": "implementations", "b": [0.3186, 0.1481, 0.4868, 0.1678]}, {"w": "(vectorized", "b": [0.4931, 0.1481, 0.6051, 0.1678]}, {"w": "implementations,", "b": [0.6114, 0.1481, 0.7858, 0.1678]}, {"w": "a", "b": [0.7922, 0.1481, 0.8034, 0.1678]}, {"w": "term", "b": [0.8097, 0.1481, 0.8559, 0.1678]}, {"w": "that", "b": [0.1294, 0.1686, 0.1673, 0.1883]}, {"w": "comes", "b": [0.1736, 0.1686, 0.238, 0.1883]}, {"w": "from", "b": [0.2443, 0.1686, 0.2934, 0.1883]}, {"w": "the", "b": [0.2997, 0.1686, 0.3305, 0.1883]}, {"w": "vector", "b": [0.3368, 0.1686, 0.3998, 0.1883]}, {"w": "processor", "b": [0.4061, 0.1686, 0.5046, 0.1883]}, {"w": "supercomputer", "b": [0.511, 0.1686, 0.6609, 0.1883]}, {"w": "architecture", "b": [0.6672, 0.1686, 0.7862, 0.1883]}, {"w": "from", "b": [0.7925, 0.1686, 0.8416, 0.1883]}, {"w": "the", "b": [0.1294, 0.1891, 0.1602, 0.2088]}, {"w": "1970–1990", "b": [0.1665, 0.1891, 0.2801, 0.2088]}, {"w": "period).", "b": [0.2864, 0.1891, 0.3655, 0.2088]}, {"w": "If", "b": [0.3718, 0.1891, 0.3886, 0.2088]}, {"w": "you", "b": [0.3949, 0.1891, 0.4328, 0.2088]}, {"w": "want", "b": [0.4391, 0.1891, 0.4881, 0.2088]}, {"w": "to", "b": [0.4944, 0.1891, 0.5141, 0.2088]}, {"w": "write", "b": [0.5204, 0.1891, 0.5722, 0.2088]}, {"w": "a", "b": [0.5785, 0.1891, 0.5897, 0.2088]}, {"w": "naive", "b": [0.596, 0.1891, 0.6507, 0.2088]}, {"w": "Python", "b": [0.657, 0.1891, 0.7284, 0.2088]}, {"w": "implementation", "b": [0.1294, 0.2096, 0.2878, 0.2293]}, {"w": "of", "b": [0.2941, 0.2096, 0.3151, 0.2293]}, {"w": "an", "b": [0.3214, 0.2096, 0.3452, 0.2293]}, {"w": "element-wise", "b": [0.3515, 0.2096, 0.486, 0.2293]}, {"w": "operation,", "b": [0.4922, 0.2096, 0.5938, 0.2293]}, {"w": "you", "b": [0.6001, 0.2096, 0.638, 0.2293]}, {"w": "use", "b": [0.6443, 0.2096, 0.6779, 0.2293]}, {"w": "a", "b": [0.6842, 0.2096, 0.6954, 0.2293]}, {"w": "for", "b": [0.7017, 0.2106, 0.7471, 0.2308]}, {"w": "loop,", "b": [0.7534, 0.2096, 0.8046, 0.2293]}, {"w": "as", "b": [0.8109, 0.2096, 0.8319, 0.2293]}, {"w": "in", "b": [0.8382, 0.2096, 0.8578, 0.2293]}, {"w": "this", "b": [0.1294, 0.231, 0.1659, 0.2507]}, {"w": "naive", "b": [0.1722, 0.231, 0.2268, 0.2507]}, {"w": "implementation", "b": [0.2331, 0.231, 0.3915, 0.2507]}, {"w": "of", "b": [0.3978, 0.231, 0.4188, 0.2507]}, {"w": "an", "b": [0.4251, 0.231, 0.4489, 0.2507]}, {"w": "element-wise", "b": [0.4552, 0.231, 0.5897, 0.2507]}, {"w": "relu", "b": [0.596, 0.232, 0.6565, 0.2522]}, {"w": "operation:", "b": [0.6628, 0.231, 0.7651, 0.2507]}]}, {"id": "b_1", "type": "paragraph", "text": "def naive_relu(x): assert len(x.shape) == 2 1 x = x.copy() 2 for i in range(x.shape[0]): for j in range(x.shape[1]): x[i, j] = max(x[i, j], 0) return x", "words": [{"w": "def", "b": [0.1357, 0.2696, 0.1698, 0.2847]}, {"w": "naive_relu(x):", "b": [0.1811, 0.2696, 0.34, 0.2847]}, {"w": "assert", "b": [0.1811, 0.2847, 0.2492, 0.2999]}, {"w": "len(x.shape)", "b": [0.2606, 0.2847, 0.3968, 0.2999]}, {"w": "==", "b": [0.4082, 0.2847, 0.4309, 0.2999]}, {"w": "2", "b": [0.4422, 0.2847, 0.4536, 0.2999]}, {"w": "1", "b": [0.6353, 0.2847, 0.6466, 0.2999]}, {"w": "x", "b": [0.1811, 0.315, 0.1925, 0.3302]}, {"w": "=", "b": [0.2038, 0.315, 0.2152, 0.3302]}, {"w": "x.copy()", "b": [0.2265, 0.315, 0.3173, 0.3302]}, {"w": "2", "b": [0.6353, 0.315, 0.6466, 0.3302]}, {"w": "for", "b": [0.1811, 0.3302, 0.2152, 0.3453]}, {"w": "i", "b": [0.2265, 0.3302, 0.2379, 0.3453]}, {"w": "in", "b": [0.2492, 0.3302, 0.2719, 0.3453]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.3302, 0.4876, 0.3453]}, {"w": "for", "b": [0.2265, 0.3453, 0.2606, 0.3605]}, {"w": "j", "b": [0.2719, 0.3453, 0.2833, 0.3605]}, {"w": "in", "b": [0.2946, 0.3453, 0.3173, 0.3605]}, {"w": "range(x.shape[1]):", "b": [0.3287, 0.3453, 0.533, 0.3605]}, {"w": "x[i,", "b": [0.2719, 0.3605, 0.3173, 0.3756]}, {"w": "j]", "b": [0.3287, 0.3605, 0.3514, 0.3756]}, {"w": "=", "b": [0.3628, 0.3605, 0.3741, 0.3756]}, {"w": "max(x[i,", "b": [0.3855, 0.3605, 0.4763, 0.3756]}, {"w": "j],", "b": [0.4876, 0.3605, 0.5217, 0.3756]}, {"w": "0)", "b": [0.533, 0.3605, 0.5557, 0.3756]}, {"w": "return", "b": [0.1811, 0.3757, 0.2492, 0.3908]}, {"w": "x", "b": [0.2606, 0.3757, 0.2719, 0.3908]}]}, {"id": "b_2", "type": "paragraph", "text": "1 x is a 2D Numpy tensor. 2 Avoid overwriting the input tensor.", "words": [{"w": "1", "b": [0.1799, 0.4092, 0.1925, 0.429]}, {"w": "x", "b": [0.1988, 0.4092, 0.2114, 0.429]}, {"w": "is", "b": [0.2177, 0.4092, 0.2345, 0.429]}, {"w": "a", "b": [0.2408, 0.4092, 0.2534, 0.429]}, {"w": "2D", "b": [0.2598, 0.4092, 0.2906, 0.429]}, {"w": "Numpy", "b": [0.2969, 0.4092, 0.3768, 0.429]}, {"w": "tensor.", "b": [0.3831, 0.4092, 0.4543, 0.429]}, {"w": "2", "b": [0.1799, 0.4297, 0.1925, 0.4495]}, {"w": "Avoid", "b": [0.1988, 0.4297, 0.2614, 0.4495]}, {"w": "overwriting", "b": [0.2677, 0.4297, 0.3938, 0.4495]}, {"w": "the", "b": [0.4001, 0.4297, 0.4337, 0.4495]}, {"w": "input", "b": [0.44, 0.4297, 0.4975, 0.4495]}, {"w": "tensor.", "b": [0.5038, 0.4297, 0.5751, 0.4495]}]}, {"id": "b_3", "type": "paragraph", "text": "You do the same for addition:", "words": [{"w": "You", "b": [0.1294, 0.4725, 0.1703, 0.4922]}, {"w": "do", "b": [0.1766, 0.4725, 0.2019, 0.4922]}, {"w": "the", "b": [0.2082, 0.4725, 0.239, 0.4922]}, {"w": "same", "b": [0.2453, 0.4725, 0.2971, 0.4922]}, {"w": "for", "b": [0.3034, 0.4725, 0.3329, 0.4922]}, {"w": "addition:", "b": [0.3392, 0.4725, 0.4289, 0.4922]}]}, {"id": "b_4", "type": "paragraph", "text": "def naive_add(x, y): assert len(x.shape) == 2 1 assert x.shape == y.shape x = x.copy() 2 for i in range(x.shape[0]): for j in range(x.shape[1]): x[i, j] += y[i, j] return x", "words": [{"w": "def", "b": [0.1357, 0.5102, 0.1698, 0.5254]}, {"w": "naive_add(x,", "b": [0.1811, 0.5102, 0.3173, 0.5254]}, {"w": "y):", "b": [0.3287, 0.5102, 0.3628, 0.5254]}, {"w": "assert", "b": [0.1811, 0.5254, 0.2492, 0.5405]}, {"w": "len(x.shape)", "b": [0.2606, 0.5254, 0.3968, 0.5405]}, {"w": "==", "b": [0.4082, 0.5254, 0.4309, 0.5405]}, {"w": "2", "b": [0.4422, 0.5254, 0.4536, 0.5405]}, {"w": "1", "b": [0.6012, 0.5254, 0.6125, 0.5405]}, {"w": "assert", "b": [0.1811, 0.5405, 0.2492, 0.5557]}, {"w": "x.shape", "b": [0.2606, 0.5405, 0.34, 0.5557]}, {"w": "==", "b": [0.3514, 0.5405, 0.3741, 0.5557]}, {"w": "y.shape", "b": [0.3855, 0.5405, 0.4649, 0.5557]}, {"w": "x", "b": [0.1811, 0.5709, 0.1925, 0.586]}, {"w": "=", "b": [0.2038, 0.5709, 0.2152, 0.586]}, {"w": "x.copy()", "b": [0.2265, 0.5709, 0.3173, 0.586]}, {"w": "2", "b": [0.6012, 0.5709, 0.6125, 0.586]}, {"w": "for", "b": [0.1811, 0.586, 0.2152, 0.6011]}, {"w": "i", "b": [0.2265, 0.586, 0.2379, 0.6011]}, {"w": "in", "b": [0.2492, 0.586, 0.2719, 0.6011]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.586, 0.4876, 0.6011]}, {"w": "for", "b": [0.2265, 0.6012, 0.2606, 0.6163]}, {"w": "j", "b": [0.2719, 0.6012, 0.2833, 0.6163]}, {"w": "in", "b": [0.2946, 0.6012, 0.3173, 0.6163]}, {"w": "range(x.shape[1]):", "b": [0.3287, 0.6012, 0.533, 0.6163]}, {"w": "x[i,", "b": [0.2719, 0.6163, 0.3173, 0.6315]}, {"w": "j]", "b": [0.3287, 0.6163, 0.3514, 0.6315]}, {"w": "+=", "b": [0.3628, 0.6163, 0.3855, 0.6315]}, {"w": "y[i,", "b": [0.3968, 0.6163, 0.4422, 0.6315]}, {"w": "j]", "b": [0.4536, 0.6163, 0.4763, 0.6315]}, {"w": "return", "b": [0.1811, 0.6315, 0.2492, 0.6466]}, {"w": "x", "b": [0.2606, 0.6315, 0.2719, 0.6466]}]}, {"id": "b_5", "type": "paragraph", "text": "1 x and y are 2D Numpy tensors. 2 Avoid overwriting the input tensor.", "words": [{"w": "1", "b": [0.1799, 0.665, 0.1925, 0.6848]}, {"w": "x", "b": [0.1988, 0.665, 0.2114, 0.6848]}, {"w": "and", "b": [0.2177, 0.665, 0.2584, 0.6848]}, {"w": "y", "b": [0.2647, 0.665, 0.2773, 0.6848]}, {"w": "are", "b": [0.2836, 0.665, 0.3182, 0.6848]}, {"w": "2D", "b": [0.3245, 0.665, 0.3553, 0.6848]}, {"w": "Numpy", "b": [0.3616, 0.665, 0.4415, 0.6848]}, {"w": "tensors.", "b": [0.4478, 0.665, 0.5312, 0.6848]}, {"w": "2", "b": [0.1799, 0.6855, 0.1925, 0.7053]}, {"w": "Avoid", "b": [0.1988, 0.6855, 0.2614, 0.7053]}, {"w": "overwriting", "b": [0.2677, 0.6855, 0.3938, 0.7053]}, {"w": "the", "b": [0.4001, 0.6855, 0.4337, 0.7053]}, {"w": "input", "b": [0.44, 0.6855, 0.4975, 0.7053]}, {"w": "tensor.", "b": [0.5038, 0.6855, 0.5751, 0.7053]}]}, {"id": "b_6", "type": "paragraph", "text": "On the same principle, you can do element-wise multiplication, subtraction, and so on.", "words": [{"w": "On", "b": [0.1294, 0.7283, 0.1602, 0.7481]}, {"w": "the", "b": [0.1665, 0.7283, 0.1974, 0.7481]}, {"w": "same", "b": [0.2037, 0.7283, 0.2555, 0.7481]}, {"w": "principle,", "b": [0.2618, 0.7283, 0.3578, 0.7481]}, {"w": "you", "b": [0.3641, 0.7283, 0.402, 0.7481]}, {"w": "can", "b": [0.4083, 0.7283, 0.4433, 0.7481]}, {"w": "do", "b": [0.4496, 0.7283, 0.4748, 0.7481]}, {"w": "element-wise", "b": [0.4811, 0.7283, 0.6156, 0.7481]}, {"w": "multiplication,", "b": [0.6219, 0.7283, 0.7698, 0.7481]}, {"w": "subtraction,", "b": [0.1294, 0.7488, 0.2478, 0.7686]}, {"w": "and", "b": [0.2541, 0.7488, 0.2906, 0.7686]}, {"w": "so", "b": [0.2969, 0.7488, 0.3193, 0.7686]}, {"w": "on.", "b": [0.3256, 0.7488, 0.3571, 0.7686]}]}, {"id": "b_7", "type": "paragraph", "text": "In practice, when dealing with Numpy arrays, these operations are available as well-optimized built-in Numpy functions, which themselves delegate the heavy lifting to a Basic Linear Algebra Subprograms (BLAS) implementation if you have one installed (which you should). BLAS are low-level, highly parallel, efficient tensor-manipulation routines that are typically implemented in Fortran or C.", "words": [{"w": "In", "b": [0.1294, 0.7916, 0.1504, 0.8113]}, {"w": "practice,", "b": [0.1567, 0.7916, 0.2429, 0.8113]}, {"w": "when", "b": [0.2492, 0.7916, 0.3038, 0.8113]}, {"w": "dealing", "b": [0.3101, 0.7916, 0.3844, 0.8113]}, {"w": "with", "b": [0.3907, 0.7916, 0.4356, 0.8113]}, {"w": "Numpy", "b": [0.4419, 0.7916, 0.5175, 0.8113]}, {"w": "arrays,", "b": [0.5238, 0.7916, 0.5918, 0.8113]}, {"w": "these", "b": [0.5981, 0.7916, 0.6499, 0.8113]}, {"w": "operations", "b": [0.6562, 0.7916, 0.7613, 0.8113]}, {"w": "are", "b": [0.7676, 0.7916, 0.7984, 0.8113]}, {"w": "available", "b": [0.1294, 0.8121, 0.2205, 0.8318]}, {"w": "as", "b": [0.2268, 0.8121, 0.2478, 0.8318]}, {"w": "well-optimized", "b": [0.2541, 0.8121, 0.4068, 0.8318]}, {"w": "built-in", "b": [0.4132, 0.8121, 0.4874, 0.8318]}, {"w": "Numpy", "b": [0.4937, 0.8121, 0.5694, 0.8318]}, {"w": "functions,", "b": [0.5757, 0.8121, 0.6759, 0.8318]}, {"w": "which", "b": [0.6822, 0.8121, 0.7439, 0.8318]}, {"w": "themselves", "b": [0.7501, 0.8121, 0.8622, 0.8318]}, {"w": "delegate", "b": [0.1294, 0.8326, 0.2135, 0.8523]}, {"w": "the", "b": [0.2198, 0.8326, 0.2506, 0.8523]}, {"w": "heavy", "b": [0.2569, 0.8326, 0.3171, 0.8523]}, {"w": "lifting", "b": [0.3234, 0.8326, 0.3851, 0.8523]}, {"w": "to", "b": [0.3914, 0.8326, 0.4111, 0.8523]}, {"w": "a", "b": [0.4174, 0.8326, 0.4286, 0.8523]}, {"w": "Basic", "b": [0.4349, 0.8326, 0.4909, 0.8523]}, {"w": "Linear", "b": [0.4972, 0.8326, 0.5631, 0.8523]}, {"w": "Algebra", "b": [0.5694, 0.8326, 0.6506, 0.8523]}, {"w": "Subprograms", "b": [0.6569, 0.8326, 0.7915, 0.8523]}, {"w": "(BLAS)", "b": [0.1294, 0.8531, 0.2107, 0.8728]}, {"w": "implementation", "b": [0.217, 0.8531, 0.3754, 0.8728]}, {"w": "if", "b": [0.3817, 0.8531, 0.3971, 0.8728]}, {"w": "you", "b": [0.4034, 0.8531, 0.4412, 0.8728]}, {"w": "have", "b": [0.4475, 0.8531, 0.4952, 0.8728]}, {"w": "one", "b": [0.5015, 0.8531, 0.5379, 0.8728]}, {"w": "installed", "b": [0.5442, 0.8531, 0.6297, 0.8728]}, {"w": "(which", "b": [0.6359, 0.8531, 0.706, 0.8728]}, {"w": "you", "b": [0.7123, 0.8531, 0.7501, 0.8728]}, {"w": "should).", "b": [0.7564, 0.8531, 0.8384, 0.8728]}, {"w": "BLAS", "b": [0.1294, 0.8736, 0.1939, 0.8933]}, {"w": "are", "b": [0.2002, 0.8736, 0.231, 0.8933]}, {"w": "low-level,", "b": [0.2373, 0.8736, 0.3389, 0.8933]}, {"w": "highly", "b": [0.3452, 0.8736, 0.4097, 0.8933]}, {"w": "parallel,", "b": [0.416, 0.8736, 0.4979, 0.8933]}, {"w": "efficient", "b": [0.5042, 0.8736, 0.5878, 0.8933]}, {"w": "tensor-manipulation", "b": [0.5941, 0.8736, 0.7968, 0.8933]}, {"w": "routines", "b": [0.1294, 0.8941, 0.2107, 0.9138]}, {"w": "that", "b": [0.217, 0.8941, 0.2548, 0.9138]}, {"w": "are", "b": [0.2611, 0.8941, 0.2919, 0.9138]}, {"w": "typically", "b": [0.2982, 0.8941, 0.3865, 0.9138]}, {"w": "implemented", "b": [0.3928, 0.8941, 0.5246, 0.9138]}, {"w": "in", "b": [0.5308, 0.8941, 0.5504, 0.9138]}, {"w": "Fortran", "b": [0.5567, 0.8941, 0.631, 0.9138]}, {"w": "or", "b": [0.6373, 0.8941, 0.6583, 0.9138]}, {"w": "C.", "b": [0.6646, 0.8941, 0.6877, 0.9138]}]}]}, {"page": 74, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "So, in Numpy, you can do the following element-wise operation, and it will be blazing fast:", "words": [{"w": "So,", "b": [0.1294, 0.0857, 0.1624, 0.1054]}, {"w": "in", "b": [0.1687, 0.0857, 0.1883, 0.1054]}, {"w": "Numpy,", "b": [0.1946, 0.0857, 0.2749, 0.1054]}, {"w": "you", "b": [0.2812, 0.0857, 0.3191, 0.1054]}, {"w": "can", "b": [0.3254, 0.0857, 0.3604, 0.1054]}, {"w": "do", "b": [0.3667, 0.0857, 0.3919, 0.1054]}, {"w": "the", "b": [0.3982, 0.0857, 0.4291, 0.1054]}, {"w": "following", "b": [0.4354, 0.0857, 0.5335, 0.1054]}, {"w": "element-wise", "b": [0.5398, 0.0857, 0.6743, 0.1054]}, {"w": "operation,", "b": [0.6806, 0.0857, 0.7822, 0.1054]}, {"w": "and", "b": [0.7885, 0.0857, 0.8249, 0.1054]}, {"w": "it", "b": [0.8312, 0.0857, 0.8452, 0.1054]}, {"w": "will", "b": [0.1294, 0.1062, 0.1687, 0.1259]}, {"w": "be", "b": [0.175, 0.1062, 0.1988, 0.1259]}, {"w": "blazing", "b": [0.2051, 0.1062, 0.2794, 0.1259]}, {"w": "fast:", "b": [0.2857, 0.1062, 0.3291, 0.1259]}]}, {"id": "b_1", "type": "equation", "text": "import numpy as np z = x + y 1 z = np.maximum(z, 0.) 2", "words": [{"w": "import", "b": [0.1357, 0.1439, 0.2038, 0.1591]}, {"w": "numpy", "b": [0.2152, 0.1439, 0.2719, 0.1591]}, {"w": "as", "b": [0.2833, 0.1439, 0.306, 0.1591]}, {"w": "np", "b": [0.3173, 0.1439, 0.34, 0.1591]}, {"w": "z", "b": [0.1357, 0.1742, 0.1471, 0.1894]}, {"w": "=", "b": [0.1584, 0.1742, 0.1698, 0.1894]}, {"w": "x", "b": [0.1811, 0.1742, 0.1925, 0.1894]}, {"w": "+", "b": [0.2038, 0.1742, 0.2152, 0.1894]}, {"w": "y", "b": [0.2265, 0.1742, 0.2379, 0.1894]}, {"w": "1", "b": [0.4536, 0.1742, 0.465, 0.1894]}, {"w": "z", "b": [0.1357, 0.2045, 0.1471, 0.2197]}, {"w": "=", "b": [0.1584, 0.2045, 0.1698, 0.2197]}, {"w": "np.maximum(z,", "b": [0.1811, 0.2045, 0.3287, 0.2197]}, {"w": "0.)", "b": [0.34, 0.2045, 0.3741, 0.2197]}, {"w": "2", "b": [0.4536, 0.2045, 0.465, 0.2197]}]}, {"id": "b_2", "type": "equation", "text": "1 Element-wise addition 2 Element-wise relu", "words": [{"w": "1", "b": [0.1799, 0.2381, 0.1925, 0.2578]}, {"w": "Element-wise", "b": [0.1988, 0.2381, 0.3431, 0.2578]}, {"w": "addition", "b": [0.3494, 0.2381, 0.4391, 0.2578]}, {"w": "2", "b": [0.1799, 0.2586, 0.1925, 0.2783]}, {"w": "Element-wise", "b": [0.1988, 0.2586, 0.3431, 0.2783]}, {"w": "relu", "b": [0.3494, 0.2586, 0.3924, 0.2783]}]}, {"id": "b_3", "type": "paragraph", "text": "2.3.2. Broadcasting", "words": [{"w": "2.3.2.", "b": [0.1294, 0.3058, 0.1862, 0.3256]}, {"w": "Broadcasting", "b": [0.1925, 0.3058, 0.335, 0.3256]}]}, {"id": "b_4", "type": "paragraph", "text": "Our earlier naive implementation of naive_add only supports the addition of 2D tensors with identical shapes. But in the Dense layer introduced earlier, we added a 2D tensor with a vector. What happens with addition when the shapes of the two tensors being added differ?", "words": [{"w": "Our", "b": [0.1294, 0.3486, 0.1686, 0.3684]}, {"w": "earlier", "b": [0.1749, 0.3486, 0.2394, 0.3684]}, {"w": "naive", "b": [0.2457, 0.3486, 0.3003, 0.3684]}, {"w": "implementation", "b": [0.3066, 0.3486, 0.465, 0.3684]}, {"w": "of", "b": [0.4713, 0.3486, 0.4923, 0.3684]}, {"w": "naive_add", "b": [0.4985, 0.3497, 0.6348, 0.3699]}, {"w": "only", "b": [0.6411, 0.3486, 0.6859, 0.3684]}, {"w": "supports", "b": [0.6922, 0.3486, 0.7777, 0.3684]}, {"w": "the", "b": [0.784, 0.3486, 0.8149, 0.3684]}, {"w": "addition", "b": [0.1294, 0.37, 0.2121, 0.3897]}, {"w": "of", "b": [0.2184, 0.37, 0.2394, 0.3897]}, {"w": "2D", "b": [0.2457, 0.37, 0.2766, 0.3897]}, {"w": "tensors", "b": [0.2829, 0.37, 0.3543, 0.3897]}, {"w": "with", "b": [0.3606, 0.37, 0.4055, 0.3897]}, {"w": "identical", "b": [0.4118, 0.37, 0.4987, 0.3897]}, {"w": "shapes.", "b": [0.505, 0.37, 0.5785, 0.3897]}, {"w": "But", "b": [0.5848, 0.37, 0.6213, 0.3897]}, {"w": "in", "b": [0.6276, 0.37, 0.6472, 0.3897]}, {"w": "the", "b": [0.6535, 0.37, 0.6844, 0.3897]}, {"w": "Dense", "b": [0.6906, 0.3711, 0.7663, 0.3912]}, {"w": "layer", "b": [0.7726, 0.37, 0.823, 0.3897]}, {"w": "introduced", "b": [0.1294, 0.3914, 0.2373, 0.4111]}, {"w": "earlier,", "b": [0.2436, 0.3914, 0.3133, 0.4111]}, {"w": "we", "b": [0.3196, 0.3914, 0.349, 0.4111]}, {"w": "added", "b": [0.3553, 0.3914, 0.4156, 0.4111]}, {"w": "a", "b": [0.4219, 0.3914, 0.4331, 0.4111]}, {"w": "2D", "b": [0.4394, 0.3914, 0.4702, 0.4111]}, {"w": "tensor", "b": [0.4765, 0.3914, 0.5382, 0.4111]}, {"w": "with", "b": [0.5445, 0.3914, 0.5893, 0.4111]}, {"w": "a", "b": [0.5956, 0.3914, 0.6068, 0.4111]}, {"w": "vector.", "b": [0.6131, 0.3914, 0.6811, 0.4111]}, {"w": "What", "b": [0.6874, 0.3914, 0.742, 0.4111]}, {"w": "happens", "b": [0.7483, 0.3914, 0.831, 0.4111]}, {"w": "with", "b": [0.1294, 0.4119, 0.1743, 0.4316]}, {"w": "addition", "b": [0.1806, 0.4119, 0.2633, 0.4316]}, {"w": "when", "b": [0.2696, 0.4119, 0.3242, 0.4316]}, {"w": "the", "b": [0.3305, 0.4119, 0.3613, 0.4316]}, {"w": "shapes", "b": [0.3676, 0.4119, 0.4349, 0.4316]}, {"w": "of", "b": [0.4412, 0.4119, 0.4622, 0.4316]}, {"w": "the", "b": [0.4685, 0.4119, 0.4993, 0.4316]}, {"w": "two", "b": [0.5057, 0.4119, 0.5435, 0.4316]}, {"w": "tensors", "b": [0.5498, 0.4119, 0.6213, 0.4316]}, {"w": "being", "b": [0.6275, 0.4119, 0.6836, 0.4316]}, {"w": "added", "b": [0.6899, 0.4119, 0.7501, 0.4316]}, {"w": "differ?", "b": [0.7564, 0.4119, 0.8232, 0.4316]}]}, {"id": "b_5", "type": "paragraph", "text": "When possible, and if there’s no ambiguity, the smaller tensor will be broadcasted to match the shape of the larger tensor. Broadcasting consists of two steps:", "words": [{"w": "When", "b": [0.1294, 0.4547, 0.1897, 0.4744]}, {"w": "possible,", "b": [0.196, 0.4547, 0.285, 0.4744]}, {"w": "and", "b": [0.2913, 0.4547, 0.3277, 0.4744]}, {"w": "if", "b": [0.334, 0.4547, 0.3494, 0.4744]}, {"w": "there’s", "b": [0.3557, 0.4547, 0.4229, 0.4744]}, {"w": "no", "b": [0.4292, 0.4547, 0.4545, 0.4744]}, {"w": "ambiguity,", "b": [0.4608, 0.4547, 0.5677, 0.4744]}, {"w": "the", "b": [0.574, 0.4547, 0.6049, 0.4744]}, {"w": "smaller", "b": [0.6112, 0.4547, 0.6854, 0.4744]}, {"w": "tensor", "b": [0.6917, 0.4547, 0.7534, 0.4744]}, {"w": "will", "b": [0.7597, 0.4547, 0.799, 0.4744]}, {"w": "be", "b": [0.8053, 0.4547, 0.8291, 0.4744]}, {"w": "broadcasted", "b": [0.1294, 0.4752, 0.2532, 0.4949]}, {"w": "to", "b": [0.2595, 0.4752, 0.2791, 0.4949]}, {"w": "match", "b": [0.2854, 0.4752, 0.3471, 0.4949]}, {"w": "the", "b": [0.3534, 0.4752, 0.3842, 0.4949]}, {"w": "shape", "b": [0.3905, 0.4752, 0.4479, 0.4949]}, {"w": "of", "b": [0.4543, 0.4752, 0.4753, 0.4949]}, {"w": "the", "b": [0.4816, 0.4752, 0.5124, 0.4949]}, {"w": "larger", "b": [0.5187, 0.4752, 0.577, 0.4949]}, {"w": "tensor.", "b": [0.5833, 0.4752, 0.6499, 0.4949]}, {"w": "Broadcasting", "b": [0.6562, 0.4752, 0.7893, 0.4949]}, {"w": "consists", "b": [0.1294, 0.4957, 0.2093, 0.5154]}, {"w": "of", "b": [0.2156, 0.4957, 0.2366, 0.5154]}, {"w": "two", "b": [0.2429, 0.4957, 0.2808, 0.5154]}, {"w": "steps:", "b": [0.2871, 0.4957, 0.3445, 0.5154]}]}, {"id": "b_6", "type": "paragraph", "text": "1. Axes (called broadcast axes) are added to the smaller tensor to match the ndim of the larger tensor. 2. The smaller tensor is repeated alongside these new axes to match the full shape of the larger tensor.", "words": [{"w": "1.", "b": [0.1551, 0.534, 0.174, 0.5537]}, {"w": "Axes", "b": [0.1799, 0.534, 0.2317, 0.5537]}, {"w": "(called", "b": [0.238, 0.534, 0.3066, 0.5537]}, {"w": "broadcast", "b": [0.3129, 0.534, 0.4129, 0.5537]}, {"w": "axes)", "b": [0.4192, 0.534, 0.4724, 0.5537]}, {"w": "are", "b": [0.4787, 0.534, 0.5095, 0.5537]}, {"w": "added", "b": [0.5158, 0.534, 0.5761, 0.5537]}, {"w": "to", "b": [0.5824, 0.534, 0.602, 0.5537]}, {"w": "the", "b": [0.6083, 0.534, 0.6391, 0.5537]}, {"w": "smaller", "b": [0.6454, 0.534, 0.7197, 0.5537]}, {"w": "tensor", "b": [0.726, 0.534, 0.7877, 0.5537]}, {"w": "to", "b": [0.794, 0.534, 0.8136, 0.5537]}, {"w": "match", "b": [0.1799, 0.5545, 0.2415, 0.5742]}, {"w": "the", "b": [0.2478, 0.5545, 0.2786, 0.5742]}, {"w": "ndim", "b": [0.2849, 0.5556, 0.3455, 0.5757]}, {"w": "of", "b": [0.3518, 0.5545, 0.3728, 0.5742]}, {"w": "the", "b": [0.3791, 0.5545, 0.4099, 0.5742]}, {"w": "larger", "b": [0.4162, 0.5545, 0.4746, 0.5742]}, {"w": "tensor.", "b": [0.4809, 0.5545, 0.5474, 0.5742]}, {"w": "2.", "b": [0.1551, 0.5759, 0.174, 0.5956]}, {"w": "The", "b": [0.1799, 0.5759, 0.2191, 0.5956]}, {"w": "smaller", "b": [0.2254, 0.5759, 0.2997, 0.5956]}, {"w": "tensor", "b": [0.306, 0.5759, 0.3676, 0.5956]}, {"w": "is", "b": [0.3739, 0.5759, 0.3908, 0.5956]}, {"w": "repeated", "b": [0.3971, 0.5759, 0.4825, 0.5956]}, {"w": "alongside", "b": [0.4888, 0.5759, 0.5855, 0.5956]}, {"w": "these", "b": [0.5918, 0.5759, 0.6436, 0.5956]}, {"w": "new", "b": [0.6499, 0.5759, 0.692, 0.5956]}, {"w": "axes", "b": [0.6983, 0.5759, 0.7431, 0.5956]}, {"w": "to", "b": [0.7494, 0.5759, 0.769, 0.5956]}, {"w": "match", "b": [0.7753, 0.5759, 0.837, 0.5956]}, {"w": "the", "b": [0.1799, 0.5964, 0.2107, 0.6161]}, {"w": "full", "b": [0.217, 0.5964, 0.252, 0.6161]}, {"w": "shape", "b": [0.2583, 0.5964, 0.3158, 0.6161]}, {"w": "of", "b": [0.3221, 0.5964, 0.3431, 0.6161]}, {"w": "the", "b": [0.3494, 0.5964, 0.3802, 0.6161]}, {"w": "larger", "b": [0.3865, 0.5964, 0.4449, 0.6161]}, {"w": "tensor.", "b": [0.4512, 0.5964, 0.5177, 0.6161]}]}, {"id": "b_7", "type": "paragraph", "text": "Let’s look at a concrete example. Consider X with shape (32, 10) and y with shape (10,). First, we add an empty first axis to y, whose shape becomes (1, 10). Then, we repeat y 32 times alongside this new axis, so that we end up with a tensor Y with shape (32, 10), where Y[i, :] == y for i in range(0, 32). At this point, we can proceed to add X and Y, because they have the same shape.", "words": [{"w": "Let’s", "b": [0.1294, 0.6392, 0.1798, 0.6589]}, {"w": "look", "b": [0.1862, 0.6392, 0.231, 0.6589]}, {"w": "at", "b": [0.2373, 0.6392, 0.2555, 0.6589]}, {"w": "a", "b": [0.2618, 0.6392, 0.273, 0.6589]}, {"w": "concrete", "b": [0.2793, 0.6392, 0.3648, 0.6589]}, {"w": "example.", "b": [0.3711, 0.6392, 0.4629, 0.6589]}, {"w": "Consider", "b": [0.4692, 0.6392, 0.5603, 0.6589]}, {"w": "X", "b": [0.5665, 0.6402, 0.5816, 0.6604]}, {"w": "with", "b": [0.5879, 0.6392, 0.6328, 0.6589]}, {"w": "shape", "b": [0.6391, 0.6392, 0.6965, 0.6589]}, {"w": "(32,", "b": [0.7028, 0.6402, 0.7634, 0.6604]}, {"w": "10)", "b": [0.7785, 0.6402, 0.8239, 0.6604]}, {"w": "and", "b": [0.8302, 0.6392, 0.8667, 0.6589]}, {"w": "y", "b": [0.1294, 0.6616, 0.1445, 0.6818]}, {"w": "with", "b": [0.1509, 0.6606, 0.1957, 0.6803]}, {"w": "shape", "b": [0.202, 0.6606, 0.2595, 0.6803]}, {"w": "(10,).", "b": [0.2657, 0.6606, 0.3477, 0.6818]}, {"w": "First,", "b": [0.354, 0.6606, 0.4066, 0.6803]}, {"w": "we", "b": [0.4129, 0.6606, 0.4423, 0.6803]}, {"w": "add", "b": [0.4486, 0.6606, 0.4851, 0.6803]}, {"w": "an", "b": [0.4914, 0.6606, 0.5152, 0.6803]}, {"w": "empty", "b": [0.5215, 0.6606, 0.5846, 0.6803]}, {"w": "first", "b": [0.5909, 0.6606, 0.6315, 0.6803]}, {"w": "axis", "b": [0.6378, 0.6606, 0.6784, 0.6803]}, {"w": "to", "b": [0.6847, 0.6606, 0.7044, 0.6803]}, {"w": "y,", "b": [0.7106, 0.6606, 0.7321, 0.6818]}, {"w": "whose", "b": [0.7384, 0.6606, 0.8028, 0.6803]}, {"w": "shape", "b": [0.8092, 0.6606, 0.8666, 0.6803]}, {"w": "becomes", "b": [0.1294, 0.682, 0.2177, 0.7017]}, {"w": "(1,", "b": [0.224, 0.683, 0.2694, 0.7032]}, {"w": "10).", "b": [0.2845, 0.682, 0.3362, 0.7032]}, {"w": "Then,", "b": [0.3425, 0.682, 0.4007, 0.7017]}, {"w": "we", "b": [0.407, 0.682, 0.4364, 0.7017]}, {"w": "repeat", "b": [0.4427, 0.682, 0.5043, 0.7017]}, {"w": "y", "b": [0.5106, 0.683, 0.5257, 0.7032]}, {"w": "32", "b": [0.532, 0.682, 0.5573, 0.7017]}, {"w": "times", "b": [0.5636, 0.682, 0.6182, 0.7017]}, {"w": "alongside", "b": [0.6245, 0.682, 0.7212, 0.7017]}, {"w": "this", "b": [0.7275, 0.682, 0.764, 0.7017]}, {"w": "new", "b": [0.7703, 0.682, 0.8123, 0.7017]}, {"w": "axis,", "b": [0.8186, 0.682, 0.8656, 0.7017]}, {"w": "so", "b": [0.1294, 0.7034, 0.1518, 0.7231]}, {"w": "that", "b": [0.1581, 0.7034, 0.196, 0.7231]}, {"w": "we", "b": [0.2023, 0.7034, 0.2317, 0.7231]}, {"w": "end", "b": [0.238, 0.7034, 0.2744, 0.7231]}, {"w": "up", "b": [0.2807, 0.7034, 0.306, 0.7231]}, {"w": "with", "b": [0.3123, 0.7034, 0.3571, 0.7231]}, {"w": "a", "b": [0.3634, 0.7034, 0.3746, 0.7231]}, {"w": "tensor", "b": [0.3809, 0.7034, 0.4426, 0.7231]}, {"w": "Y", "b": [0.4489, 0.7044, 0.464, 0.7246]}, {"w": "with", "b": [0.4703, 0.7034, 0.5152, 0.7231]}, {"w": "shape", "b": [0.5215, 0.7034, 0.5789, 0.7231]}, {"w": "(32,", "b": [0.5852, 0.7044, 0.6458, 0.7246]}, {"w": "10),", "b": [0.6609, 0.7034, 0.7126, 0.7246]}, {"w": "where", "b": [0.7189, 0.7034, 0.7806, 0.7231]}, {"w": "Y[i,", "b": [0.7868, 0.7044, 0.8474, 0.7246]}, {"w": ":]", "b": [0.1294, 0.7258, 0.1597, 0.746]}, {"w": "==", "b": [0.1748, 0.7258, 0.2051, 0.746]}, {"w": "y", "b": [0.2202, 0.7258, 0.2354, 0.746]}, {"w": "for", "b": [0.2417, 0.7247, 0.2711, 0.7445]}, {"w": "i", "b": [0.2774, 0.7258, 0.2925, 0.746]}, {"w": "in", "b": [0.2988, 0.7247, 0.3184, 0.7445]}, {"w": "range(0,", "b": [0.3247, 0.7258, 0.4458, 0.746]}, {"w": "32).", "b": [0.461, 0.7247, 0.5127, 0.746]}, {"w": "At", "b": [0.519, 0.7247, 0.5442, 0.7445]}, {"w": "this", "b": [0.5505, 0.7247, 0.587, 0.7445]}, {"w": "point,", "b": [0.5933, 0.7247, 0.6515, 0.7445]}, {"w": "we", "b": [0.6578, 0.7247, 0.6872, 0.7445]}, {"w": "can", "b": [0.6935, 0.7247, 0.7285, 0.7445]}, {"w": "proceed", "b": [0.7348, 0.7247, 0.8146, 0.7445]}, {"w": "to", "b": [0.8209, 0.7247, 0.8406, 0.7445]}, {"w": "add", "b": [0.1294, 0.7461, 0.1658, 0.7659]}, {"w": "X", "b": [0.1721, 0.7472, 0.1873, 0.7674]}, {"w": "and", "b": [0.1936, 0.7461, 0.23, 0.7659]}, {"w": "Y,", "b": [0.2363, 0.7461, 0.2577, 0.7674]}, {"w": "because", "b": [0.2641, 0.7461, 0.3439, 0.7659]}, {"w": "they", "b": [0.3502, 0.7461, 0.3936, 0.7659]}, {"w": "have", "b": [0.3999, 0.7461, 0.4476, 0.7659]}, {"w": "the", "b": [0.4539, 0.7461, 0.4847, 0.7659]}, {"w": "same", "b": [0.491, 0.7461, 0.5428, 0.7659]}, {"w": "shape.", "b": [0.5492, 0.7461, 0.6129, 0.7659]}]}, {"id": "b_8", "type": "paragraph", "text": "In terms of implementation, no new 2D tensor is created, because that would be terribly inefficient. The repetition operation is entirely virtual: it happens at the algorithmic level rather than at the memory level. But thinking of the vector being repeated 10 times alongside a new axis is a helpful mental model. Here’s what a naive implementation would look like:", "words": [{"w": "In", "b": [0.1294, 0.7898, 0.1504, 0.8096]}, {"w": "terms", "b": [0.1567, 0.7898, 0.2128, 0.8096]}, {"w": "of", "b": [0.2191, 0.7898, 0.2401, 0.8096]}, {"w": "implementation,", "b": [0.2464, 0.7898, 0.4111, 0.8096]}, {"w": "no", "b": [0.4174, 0.7898, 0.4426, 0.8096]}, {"w": "new", "b": [0.4489, 0.7898, 0.4909, 0.8096]}, {"w": "2D", "b": [0.4973, 0.7898, 0.5281, 0.8096]}, {"w": "tensor", "b": [0.5344, 0.7898, 0.596, 0.8096]}, {"w": "is", "b": [0.6023, 0.7898, 0.6192, 0.8096]}, {"w": "created,", "b": [0.6255, 0.7898, 0.7046, 0.8096]}, {"w": "because", "b": [0.7109, 0.7898, 0.7908, 0.8096]}, {"w": "that", "b": [0.7971, 0.7898, 0.8349, 0.8096]}, {"w": "would", "b": [0.1294, 0.8103, 0.1925, 0.8301]}, {"w": "be", "b": [0.1988, 0.8103, 0.2226, 0.8301]}, {"w": "terribly", "b": [0.2289, 0.8103, 0.3032, 0.8301]}, {"w": "inefficient.", "b": [0.3095, 0.8103, 0.419, 0.8301]}, {"w": "The", "b": [0.4253, 0.8103, 0.4645, 0.8301]}, {"w": "repetition", "b": [0.4708, 0.8103, 0.5675, 0.8301]}, {"w": "operation", "b": [0.5738, 0.8103, 0.6691, 0.8301]}, {"w": "is", "b": [0.6753, 0.8103, 0.6921, 0.8301]}, {"w": "entirely", "b": [0.6984, 0.8103, 0.7755, 0.8301]}, {"w": "virtual:", "b": [0.7818, 0.8103, 0.8547, 0.8301]}, {"w": "it", "b": [0.1294, 0.8308, 0.1434, 0.8506]}, {"w": "happens", "b": [0.1497, 0.8308, 0.2324, 0.8506]}, {"w": "at", "b": [0.2387, 0.8308, 0.2569, 0.8506]}, {"w": "the", "b": [0.2632, 0.8308, 0.2941, 0.8506]}, {"w": "algorithmic", "b": [0.3004, 0.8308, 0.4167, 0.8506]}, {"w": "level", "b": [0.423, 0.8308, 0.472, 0.8506]}, {"w": "rather", "b": [0.4783, 0.8308, 0.5372, 0.8506]}, {"w": "than", "b": [0.5435, 0.8308, 0.5869, 0.8506]}, {"w": "at", "b": [0.5932, 0.8308, 0.6114, 0.8506]}, {"w": "the", "b": [0.6177, 0.8308, 0.6486, 0.8506]}, {"w": "memory", "b": [0.6549, 0.8308, 0.7389, 0.8506]}, {"w": "level.", "b": [0.7452, 0.8308, 0.8006, 0.8506]}, {"w": "But", "b": [0.8069, 0.8308, 0.8434, 0.8506]}, {"w": "thinking", "b": [0.1294, 0.8513, 0.2135, 0.8711]}, {"w": "of", "b": [0.2198, 0.8513, 0.2408, 0.8711]}, {"w": "the", "b": [0.2471, 0.8513, 0.278, 0.8711]}, {"w": "vector", "b": [0.2843, 0.8513, 0.3473, 0.8711]}, {"w": "being", "b": [0.3536, 0.8513, 0.4097, 0.8711]}, {"w": "repeated", "b": [0.4159, 0.8513, 0.5014, 0.8711]}, {"w": "10", "b": [0.5077, 0.8513, 0.5329, 0.8711]}, {"w": "times", "b": [0.5392, 0.8513, 0.5939, 0.8711]}, {"w": "alongside", "b": [0.6002, 0.8513, 0.6969, 0.8711]}, {"w": "a", "b": [0.7032, 0.8513, 0.7144, 0.8711]}, {"w": "new", "b": [0.7207, 0.8513, 0.7627, 0.8711]}, {"w": "axis", "b": [0.769, 0.8513, 0.8096, 0.8711]}, {"w": "is", "b": [0.816, 0.8513, 0.8328, 0.8711]}, {"w": "a", "b": [0.8391, 0.8513, 0.8503, 0.8711]}, {"w": "helpful", "b": [0.1294, 0.8718, 0.2009, 0.8916]}, {"w": "mental", "b": [0.2072, 0.8718, 0.2758, 0.8916]}, {"w": "model.", "b": [0.2822, 0.8718, 0.3515, 0.8916]}, {"w": "Here’s", "b": [0.3578, 0.8718, 0.4236, 0.8916]}, {"w": "what", "b": [0.4299, 0.8718, 0.479, 0.8916]}, {"w": "a", "b": [0.4853, 0.8718, 0.4965, 0.8916]}, {"w": "naive", "b": [0.5028, 0.8718, 0.5574, 0.8916]}, {"w": "implementation", "b": [0.5637, 0.8718, 0.7221, 0.8916]}, {"w": "would", "b": [0.7284, 0.8718, 0.7915, 0.8916]}, {"w": "look", "b": [0.7978, 0.8718, 0.8426, 0.8916]}, {"w": "like:", "b": [0.1294, 0.8923, 0.1743, 0.9121]}]}]}, {"page": 75, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "def naive_add_matrix_and_vector(x, y): assert len(x.shape) == 2 1 assert len(y.shape) == 1 2 assert x.shape[1] == y.shape[0] x = x.copy() 3 for i in range(x.shape[0]): for j in range(x.shape[1]): x[i, j] += y[j] return x", "words": [{"w": "def", "b": [0.1357, 0.0851, 0.1698, 0.1002]}, {"w": "naive_add_matrix_and_vector(x,", "b": [0.1811, 0.0851, 0.5217, 0.1002]}, {"w": "y):", "b": [0.533, 0.0851, 0.5671, 0.1002]}, {"w": "assert", "b": [0.1811, 0.1002, 0.2492, 0.1154]}, {"w": "len(x.shape)", "b": [0.2606, 0.1002, 0.3968, 0.1154]}, {"w": "==", "b": [0.4082, 0.1002, 0.4309, 0.1154]}, {"w": "2", "b": [0.4422, 0.1002, 0.4536, 0.1154]}, {"w": "1", "b": [0.6466, 0.1002, 0.658, 0.1154]}, {"w": "assert", "b": [0.1811, 0.1154, 0.2492, 0.1305]}, {"w": "len(y.shape)", "b": [0.2606, 0.1154, 0.3968, 0.1305]}, {"w": "==", "b": [0.4082, 0.1154, 0.4309, 0.1305]}, {"w": "1", "b": [0.4422, 0.1154, 0.4536, 0.1305]}, {"w": "2", "b": [0.6466, 0.1154, 0.658, 0.1305]}, {"w": "assert", "b": [0.1811, 0.1305, 0.2492, 0.1457]}, {"w": "x.shape[1]", "b": [0.2606, 0.1305, 0.3741, 0.1457]}, {"w": "==", "b": [0.3855, 0.1305, 0.4082, 0.1457]}, {"w": "y.shape[0]", "b": [0.4195, 0.1305, 0.533, 0.1457]}, {"w": "x", "b": [0.1811, 0.1608, 0.1925, 0.176]}, {"w": "=", "b": [0.2038, 0.1608, 0.2152, 0.176]}, {"w": "x.copy()", "b": [0.2265, 0.1608, 0.3173, 0.176]}, {"w": "3", "b": [0.6466, 0.1608, 0.658, 0.176]}, {"w": "for", "b": [0.1811, 0.176, 0.2152, 0.1911]}, {"w": "i", "b": [0.2265, 0.176, 0.2379, 0.1911]}, {"w": "in", "b": [0.2492, 0.176, 0.2719, 0.1911]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.176, 0.4876, 0.1911]}, {"w": "for", "b": [0.2265, 0.1912, 0.2606, 0.2063]}, {"w": "j", "b": [0.2719, 0.1912, 0.2833, 0.2063]}, {"w": "in", "b": [0.2946, 0.1912, 0.3173, 0.2063]}, {"w": "range(x.shape[1]):", "b": [0.3287, 0.1912, 0.533, 0.2063]}, {"w": "x[i,", "b": [0.2719, 0.2063, 0.3173, 0.2214]}, {"w": "j]", "b": [0.3287, 0.2063, 0.3514, 0.2214]}, {"w": "+=", "b": [0.3628, 0.2063, 0.3855, 0.2214]}, {"w": "y[j]", "b": [0.3968, 0.2063, 0.4422, 0.2214]}, {"w": "return", "b": [0.1811, 0.2215, 0.2492, 0.2366]}, {"w": "x", "b": [0.2606, 0.2215, 0.2719, 0.2366]}]}, {"id": "b_1", "type": "paragraph", "text": "1 x is a 2D Numpy tensor. 2 y is a Numpy vector. 3 Avoid overwriting the input tensor.", "words": [{"w": "1", "b": [0.1799, 0.255, 0.1925, 0.2748]}, {"w": "x", "b": [0.1988, 0.255, 0.2114, 0.2748]}, {"w": "is", "b": [0.2177, 0.255, 0.2345, 0.2748]}, {"w": "a", "b": [0.2408, 0.255, 0.2534, 0.2748]}, {"w": "2D", "b": [0.2598, 0.255, 0.2906, 0.2748]}, {"w": "Numpy", "b": [0.2969, 0.255, 0.3768, 0.2748]}, {"w": "tensor.", "b": [0.3831, 0.255, 0.4543, 0.2748]}, {"w": "2", "b": [0.1799, 0.2755, 0.1925, 0.2953]}, {"w": "y", "b": [0.1988, 0.2755, 0.2114, 0.2953]}, {"w": "is", "b": [0.2177, 0.2755, 0.2345, 0.2953]}, {"w": "a", "b": [0.2408, 0.2755, 0.2534, 0.2953]}, {"w": "Numpy", "b": [0.2598, 0.2755, 0.3396, 0.2953]}, {"w": "vector.", "b": [0.3459, 0.2755, 0.4172, 0.2953]}, {"w": "3", "b": [0.1799, 0.296, 0.1925, 0.3158]}, {"w": "Avoid", "b": [0.1988, 0.296, 0.2614, 0.3158]}, {"w": "overwriting", "b": [0.2677, 0.296, 0.3938, 0.3158]}, {"w": "the", "b": [0.4001, 0.296, 0.4337, 0.3158]}, {"w": "input", "b": [0.44, 0.296, 0.4975, 0.3158]}, {"w": "tensor.", "b": [0.5038, 0.296, 0.5751, 0.3158]}]}, {"id": "b_2", "type": "paragraph", "text": "With broadcasting, you can generally apply two-tensor element-wise operations if one tensor has shape (a, b, ... n, n + 1, ... m) and the other has shape (n, n + 1, ... m). The broadcasting will then automatically happen for axes a through n - 1.", "words": [{"w": "With", "b": [0.1294, 0.3388, 0.1788, 0.3586]}, {"w": "broadcasting,", "b": [0.1852, 0.3388, 0.3204, 0.3586]}, {"w": "you", "b": [0.3267, 0.3388, 0.3645, 0.3586]}, {"w": "can", "b": [0.3708, 0.3388, 0.4058, 0.3586]}, {"w": "generally", "b": [0.4121, 0.3388, 0.506, 0.3586]}, {"w": "apply", "b": [0.5123, 0.3388, 0.5684, 0.3586]}, {"w": "two-tensor", "b": [0.5747, 0.3388, 0.6826, 0.3586]}, {"w": "element-wise", "b": [0.6889, 0.3388, 0.8234, 0.3586]}, {"w": "operations", "b": [0.1294, 0.3593, 0.2345, 0.3791]}, {"w": "if", "b": [0.2408, 0.3593, 0.2562, 0.3791]}, {"w": "one", "b": [0.2625, 0.3593, 0.299, 0.3791]}, {"w": "tensor", "b": [0.3053, 0.3593, 0.3669, 0.3791]}, {"w": "has", "b": [0.3732, 0.3593, 0.4068, 0.3791]}, {"w": "shape", "b": [0.4132, 0.3593, 0.4706, 0.3791]}, {"w": "(a,", "b": [0.4769, 0.3604, 0.5223, 0.3805]}, {"w": "b,", "b": [0.5374, 0.3604, 0.5677, 0.3805]}, {"w": "...", "b": [0.5828, 0.3604, 0.6282, 0.3805]}, {"w": "n,", "b": [0.6433, 0.3604, 0.6736, 0.3805]}, {"w": "n", "b": [0.6888, 0.3604, 0.7039, 0.3805]}, {"w": "+", "b": [0.719, 0.3604, 0.7342, 0.3805]}, {"w": "1,", "b": [0.7493, 0.3604, 0.7796, 0.3805]}, {"w": "...", "b": [0.7947, 0.3604, 0.8401, 0.3805]}, {"w": "m)", "b": [0.1294, 0.3817, 0.1597, 0.4019]}, {"w": "and", "b": [0.166, 0.3807, 0.2024, 0.4004]}, {"w": "the", "b": [0.2087, 0.3807, 0.2395, 0.4004]}, {"w": "other", "b": [0.2459, 0.3807, 0.2977, 0.4004]}, {"w": "has", "b": [0.304, 0.3807, 0.3376, 0.4004]}, {"w": "shape", "b": [0.3439, 0.3807, 0.4014, 0.4004]}, {"w": "(n,", "b": [0.4076, 0.3817, 0.4531, 0.4019]}, {"w": "n", "b": [0.4682, 0.3817, 0.4833, 0.4019]}, {"w": "+", "b": [0.4985, 0.3817, 0.5136, 0.4019]}, {"w": "1,", "b": [0.5287, 0.3817, 0.559, 0.4019]}, {"w": "...", "b": [0.5741, 0.3817, 0.6195, 0.4019]}, {"w": "m).", "b": [0.6347, 0.3807, 0.6713, 0.4019]}, {"w": "The", "b": [0.6776, 0.3807, 0.7168, 0.4004]}, {"w": "broadcasting", "b": [0.7231, 0.3807, 0.852, 0.4004]}, {"w": "will", "b": [0.1294, 0.4021, 0.1687, 0.4218]}, {"w": "then", "b": [0.175, 0.4021, 0.2184, 0.4218]}, {"w": "automatically", "b": [0.2247, 0.4021, 0.362, 0.4218]}, {"w": "happen", "b": [0.3684, 0.4021, 0.4412, 0.4218]}, {"w": "for", "b": [0.4475, 0.4021, 0.4769, 0.4218]}, {"w": "axes", "b": [0.4832, 0.4021, 0.5281, 0.4218]}, {"w": "a", "b": [0.5343, 0.4031, 0.5494, 0.4233]}, {"w": "through", "b": [0.5557, 0.4021, 0.6342, 0.4218]}, {"w": "n", "b": [0.6405, 0.4031, 0.6556, 0.4233]}, {"w": "-", "b": [0.6708, 0.4031, 0.6859, 0.4233]}, {"w": "1.", "b": [0.701, 0.4021, 0.7225, 0.4233]}]}, {"id": "b_3", "type": "paragraph", "text": "The following example applies the element-wise maximum operation to two tensors of different shapes via broadcasting:", "words": [{"w": "The", "b": [0.1294, 0.4458, 0.1686, 0.4655]}, {"w": "following", "b": [0.1749, 0.4458, 0.273, 0.4655]}, {"w": "example", "b": [0.2794, 0.4458, 0.3648, 0.4655]}, {"w": "applies", "b": [0.3711, 0.4458, 0.4426, 0.4655]}, {"w": "the", "b": [0.4489, 0.4458, 0.4797, 0.4655]}, {"w": "element-wise", "b": [0.486, 0.4458, 0.6205, 0.4655]}, {"w": "maximum", "b": [0.6268, 0.4468, 0.7327, 0.467]}, {"w": "operation", "b": [0.739, 0.4458, 0.8343, 0.4655]}, {"w": "to", "b": [0.8406, 0.4458, 0.8602, 0.4655]}, {"w": "two", "b": [0.1294, 0.4672, 0.1673, 0.4869]}, {"w": "tensors", "b": [0.1736, 0.4672, 0.245, 0.4869]}, {"w": "of", "b": [0.2513, 0.4672, 0.2723, 0.4869]}, {"w": "different", "b": [0.2786, 0.4672, 0.365, 0.4869]}, {"w": "shapes", "b": [0.3713, 0.4672, 0.4386, 0.4869]}, {"w": "via", "b": [0.4449, 0.4672, 0.4757, 0.4869]}, {"w": "broadcasting:", "b": [0.482, 0.4672, 0.618, 0.4869]}]}, {"id": "b_4", "type": "paragraph", "text": "import numpy as np x = np.random.random((64, 3, 32, 10)) 1 y = np.random.random((32, 10)) 2 z = np.maximum(x, y) 3", "words": [{"w": "import", "b": [0.1357, 0.5049, 0.2038, 0.52]}, {"w": "numpy", "b": [0.2152, 0.5049, 0.2719, 0.52]}, {"w": "as", "b": [0.2833, 0.5049, 0.306, 0.52]}, {"w": "np", "b": [0.3173, 0.5049, 0.34, 0.52]}, {"w": "x", "b": [0.1357, 0.5352, 0.1471, 0.5503]}, {"w": "=", "b": [0.1584, 0.5352, 0.1698, 0.5503]}, {"w": "np.random.random((64,", "b": [0.1811, 0.5352, 0.4195, 0.5503]}, {"w": "3,", "b": [0.4309, 0.5352, 0.4536, 0.5503]}, {"w": "32,", "b": [0.4649, 0.5352, 0.499, 0.5503]}, {"w": "10))", "b": [0.5103, 0.5352, 0.5557, 0.5503]}, {"w": "1", "b": [0.6466, 0.5352, 0.658, 0.5503]}, {"w": "y", "b": [0.1357, 0.5504, 0.1471, 0.5655]}, {"w": "=", "b": [0.1584, 0.5504, 0.1698, 0.5655]}, {"w": "np.random.random((32,", "b": [0.1811, 0.5504, 0.4195, 0.5655]}, {"w": "10))", "b": [0.4309, 0.5504, 0.4763, 0.5655]}, {"w": "2", "b": [0.6466, 0.5504, 0.658, 0.5655]}, {"w": "z", "b": [0.1357, 0.5807, 0.1471, 0.5958]}, {"w": "=", "b": [0.1584, 0.5807, 0.1698, 0.5958]}, {"w": "np.maximum(x,", "b": [0.1811, 0.5807, 0.3287, 0.5958]}, {"w": "y)", "b": [0.34, 0.5807, 0.3628, 0.5958]}, {"w": "3", "b": [0.6466, 0.5807, 0.658, 0.5958]}]}, {"id": "b_5", "type": "paragraph", "text": "1 x is a random tensor with shape (64, 3, 32, 10). 2 y is a random tensor with shape (32, 10). 3 The output z has shape (64, 3, 32, 10) like x.", "words": [{"w": "1", "b": [0.1799, 0.6142, 0.1925, 0.634]}, {"w": "x", "b": [0.1988, 0.6142, 0.2114, 0.634]}, {"w": "is", "b": [0.2177, 0.6142, 0.2345, 0.634]}, {"w": "a", "b": [0.2408, 0.6142, 0.2534, 0.634]}, {"w": "random", "b": [0.2598, 0.6142, 0.3452, 0.634]}, {"w": "tensor", "b": [0.3516, 0.6142, 0.4188, 0.634]}, {"w": "with", "b": [0.4251, 0.6142, 0.4728, 0.634]}, {"w": "shape", "b": [0.4791, 0.6142, 0.5407, 0.634]}, {"w": "(64,", "b": [0.547, 0.6142, 0.587, 0.634]}, {"w": "3,", "b": [0.5933, 0.6142, 0.6122, 0.634]}, {"w": "32,", "b": [0.6185, 0.6142, 0.65, 0.634]}, {"w": "10).", "b": [0.6564, 0.6142, 0.6963, 0.634]}, {"w": "2", "b": [0.1799, 0.6347, 0.1925, 0.6545]}, {"w": "y", "b": [0.1988, 0.6347, 0.2114, 0.6545]}, {"w": "is", "b": [0.2177, 0.6347, 0.2345, 0.6545]}, {"w": "a", "b": [0.2408, 0.6347, 0.2534, 0.6545]}, {"w": "random", "b": [0.2598, 0.6347, 0.3452, 0.6545]}, {"w": "tensor", "b": [0.3516, 0.6347, 0.4188, 0.6545]}, {"w": "with", "b": [0.4251, 0.6347, 0.4728, 0.6545]}, {"w": "shape", "b": [0.4791, 0.6347, 0.5407, 0.6545]}, {"w": "(32,", "b": [0.547, 0.6347, 0.587, 0.6545]}, {"w": "10).", "b": [0.5933, 0.6347, 0.6332, 0.6545]}, {"w": "3", "b": [0.1799, 0.6552, 0.1925, 0.675]}, {"w": "The", "b": [0.1988, 0.6552, 0.2408, 0.675]}, {"w": "output", "b": [0.2471, 0.6552, 0.3186, 0.675]}, {"w": "z", "b": [0.3249, 0.6552, 0.3361, 0.675]}, {"w": "has", "b": [0.3424, 0.6552, 0.3789, 0.675]}, {"w": "shape", "b": [0.3852, 0.6552, 0.4469, 0.675]}, {"w": "(64,", "b": [0.4532, 0.6552, 0.4931, 0.675]}, {"w": "3,", "b": [0.4994, 0.6552, 0.5183, 0.675]}, {"w": "32,", "b": [0.5246, 0.6552, 0.5562, 0.675]}, {"w": "10)", "b": [0.5625, 0.6552, 0.5961, 0.675]}, {"w": "like", "b": [0.6024, 0.6552, 0.6417, 0.675]}, {"w": "x.", "b": [0.648, 0.6552, 0.6669, 0.675]}]}, {"id": "b_6", "type": "paragraph", "text": "2.3.3. Tensor dot", "words": [{"w": "2.3.3.", "b": [0.1294, 0.7025, 0.1862, 0.7222]}, {"w": "Tensor", "b": [0.1925, 0.7025, 0.2658, 0.7222]}, {"w": "dot", "b": [0.2721, 0.7025, 0.3072, 0.7222]}]}, {"id": "b_7", "type": "paragraph", "text": "The dot operation, also called a tensor product (not to be confused with an element-wise product) is the most common, most useful tensor operation. Contrary to element-wise operations, it combines entries in the input tensors.", "words": [{"w": "The", "b": [0.1294, 0.7453, 0.1686, 0.765]}, {"w": "dot", "b": [0.1749, 0.7453, 0.2072, 0.765]}, {"w": "operation,", "b": [0.2135, 0.7453, 0.3151, 0.765]}, {"w": "also", "b": [0.3214, 0.7453, 0.362, 0.765]}, {"w": "called", "b": [0.3683, 0.7453, 0.4286, 0.765]}, {"w": "a", "b": [0.4349, 0.7453, 0.4461, 0.765]}, {"w": "tensor", "b": [0.4523, 0.7453, 0.5154, 0.765]}, {"w": "product", "b": [0.5217, 0.7453, 0.5992, 0.765]}, {"w": "(not", "b": [0.6055, 0.7453, 0.6462, 0.765]}, {"w": "to", "b": [0.6525, 0.7453, 0.6721, 0.765]}, {"w": "be", "b": [0.6784, 0.7453, 0.7022, 0.765]}, {"w": "confused", "b": [0.7085, 0.7453, 0.7996, 0.765]}, {"w": "with", "b": [0.8059, 0.7453, 0.8507, 0.765]}, {"w": "an", "b": [0.1294, 0.7658, 0.1532, 0.7855]}, {"w": "element-wise", "b": [0.1595, 0.7658, 0.294, 0.7855]}, {"w": "product)", "b": [0.3003, 0.7658, 0.3858, 0.7855]}, {"w": "is", "b": [0.3921, 0.7658, 0.4089, 0.7855]}, {"w": "the", "b": [0.4152, 0.7658, 0.4461, 0.7855]}, {"w": "most", "b": [0.4524, 0.7658, 0.5014, 0.7855]}, {"w": "common,", "b": [0.5077, 0.7658, 0.6023, 0.7855]}, {"w": "most", "b": [0.6087, 0.7658, 0.6577, 0.7855]}, {"w": "useful", "b": [0.664, 0.7658, 0.7257, 0.7855]}, {"w": "tensor", "b": [0.732, 0.7658, 0.7936, 0.7855]}, {"w": "operation.", "b": [0.1294, 0.7863, 0.231, 0.806]}, {"w": "Contrary", "b": [0.2373, 0.7863, 0.327, 0.806]}, {"w": "to", "b": [0.3333, 0.7863, 0.3529, 0.806]}, {"w": "element-wise", "b": [0.3592, 0.7863, 0.4937, 0.806]}, {"w": "operations,", "b": [0.5, 0.7863, 0.6114, 0.806]}, {"w": "it", "b": [0.6177, 0.7863, 0.6317, 0.806]}, {"w": "combines", "b": [0.638, 0.7863, 0.7347, 0.806]}, {"w": "entries", "b": [0.741, 0.7863, 0.8083, 0.806]}, {"w": "in", "b": [0.8146, 0.7863, 0.8342, 0.806]}, {"w": "the", "b": [0.1294, 0.8068, 0.1602, 0.8265]}, {"w": "input", "b": [0.1665, 0.8068, 0.2184, 0.8265]}, {"w": "tensors.", "b": [0.2247, 0.8068, 0.3025, 0.8265]}]}, {"id": "b_8", "type": "paragraph", "text": "An element-wise product is done with the * operator in Numpy, Keras, Theano, and TensorFlow. dot uses a different syntax in TensorFlow, but in both Numpy and Keras it’s done using the standard dot operator:", "words": [{"w": "An", "b": [0.1294, 0.8495, 0.1602, 0.8693]}, {"w": "element-wise", "b": [0.1665, 0.8495, 0.301, 0.8693]}, {"w": "product", "b": [0.3074, 0.8495, 0.3844, 0.8693]}, {"w": "is", "b": [0.3907, 0.8495, 0.4076, 0.8693]}, {"w": "done", "b": [0.4139, 0.8495, 0.4629, 0.8693]}, {"w": "with", "b": [0.4692, 0.8495, 0.5141, 0.8693]}, {"w": "the", "b": [0.5204, 0.8495, 0.5512, 0.8693]}, {"w": "*", "b": [0.5574, 0.8506, 0.5726, 0.8708]}, {"w": "operator", "b": [0.5789, 0.8495, 0.6629, 0.8693]}, {"w": "in", "b": [0.6692, 0.8495, 0.6889, 0.8693]}, {"w": "Numpy,", "b": [0.6952, 0.8495, 0.7755, 0.8693]}, {"w": "Keras,", "b": [0.7818, 0.8495, 0.8469, 0.8693]}, {"w": "Theano,", "b": [0.1294, 0.8709, 0.2114, 0.8907]}, {"w": "and", "b": [0.2177, 0.8709, 0.2541, 0.8907]}, {"w": "TensorFlow.", "b": [0.2604, 0.8709, 0.3852, 0.8907]}, {"w": "dot", "b": [0.3915, 0.872, 0.4369, 0.8922]}, {"w": "uses", "b": [0.4432, 0.8709, 0.4867, 0.8907]}, {"w": "a", "b": [0.493, 0.8709, 0.5042, 0.8907]}, {"w": "different", "b": [0.5105, 0.8709, 0.5969, 0.8907]}, {"w": "syntax", "b": [0.6032, 0.8709, 0.6691, 0.8907]}, {"w": "in", "b": [0.6754, 0.8709, 0.695, 0.8907]}, {"w": "TensorFlow,", "b": [0.7013, 0.8709, 0.8261, 0.8907]}, {"w": "but", "b": [0.8324, 0.8709, 0.8646, 0.8907]}, {"w": "in", "b": [0.1294, 0.8923, 0.149, 0.9121]}, {"w": "both", "b": [0.1553, 0.8923, 0.2002, 0.9121]}, {"w": "Numpy", "b": [0.2065, 0.8923, 0.2822, 0.9121]}, {"w": "and", "b": [0.2885, 0.8923, 0.3249, 0.9121]}, {"w": "Keras", "b": [0.3312, 0.8923, 0.39, 0.9121]}, {"w": "it’s", "b": [0.3964, 0.8923, 0.4272, 0.9121]}, {"w": "done", "b": [0.4335, 0.8923, 0.4825, 0.9121]}, {"w": "using", "b": [0.4888, 0.8923, 0.5435, 0.9121]}, {"w": "the", "b": [0.5498, 0.8923, 0.5806, 0.9121]}, {"w": "standard", "b": [0.5869, 0.8923, 0.6724, 0.9121]}, {"w": "dot", "b": [0.6787, 0.8934, 0.7241, 0.9136]}, {"w": "operator:", "b": [0.7304, 0.8923, 0.8215, 0.9121]}]}]}, {"page": 76, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "import numpy as np z = np.dot(x, y)", "words": [{"w": "import", "b": [0.1357, 0.0851, 0.2038, 0.1002]}, {"w": "numpy", "b": [0.2152, 0.0851, 0.2719, 0.1002]}, {"w": "as", "b": [0.2833, 0.0851, 0.306, 0.1002]}, {"w": "np", "b": [0.3173, 0.0851, 0.34, 0.1002]}, {"w": "z", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "=", "b": [0.1584, 0.1002, 0.1698, 0.1154]}, {"w": "np.dot(x,", "b": [0.1811, 0.1002, 0.2833, 0.1154]}, {"w": "y)", "b": [0.2946, 0.1002, 0.3173, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "In mathematical notation, you’d note the operation with a dot (.):", "words": [{"w": "In", "b": [0.1294, 0.1383, 0.1504, 0.158]}, {"w": "mathematical", "b": [0.1567, 0.1383, 0.2926, 0.158]}, {"w": "notation,", "b": [0.299, 0.1383, 0.388, 0.158]}, {"w": "you’d", "b": [0.3943, 0.1383, 0.4531, 0.158]}, {"w": "note", "b": [0.4594, 0.1383, 0.5029, 0.158]}, {"w": "the", "b": [0.5092, 0.1383, 0.54, 0.158]}, {"w": "operation", "b": [0.5463, 0.1383, 0.6416, 0.158]}, {"w": "with", "b": [0.6479, 0.1383, 0.6927, 0.158]}, {"w": "a", "b": [0.699, 0.1383, 0.7102, 0.158]}, {"w": "dot", "b": [0.7165, 0.1383, 0.7488, 0.158]}, {"w": "(.):", "b": [0.7551, 0.1383, 0.7939, 0.1595]}]}, {"id": "b_2", "type": "equation", "text": "z = x . y", "words": [{"w": "z", "b": [0.1357, 0.1769, 0.1471, 0.192]}, {"w": "=", "b": [0.1584, 0.1769, 0.1698, 0.192]}, {"w": "x", "b": [0.1811, 0.1769, 0.1925, 0.192]}, {"w": ".", "b": [0.2038, 0.1769, 0.2152, 0.192]}, {"w": "y", "b": [0.2265, 0.1769, 0.2379, 0.192]}]}, {"id": "b_3", "type": "paragraph", "text": "Mathematically, what does the dot operation do? Let’s start with the dot product of two vectors x and y. It’s computed as follows:", "words": [{"w": "Mathematically,", "b": [0.1294, 0.2149, 0.2924, 0.2347]}, {"w": "what", "b": [0.2987, 0.2149, 0.3477, 0.2347]}, {"w": "does", "b": [0.354, 0.2149, 0.4003, 0.2347]}, {"w": "the", "b": [0.4066, 0.2149, 0.4374, 0.2347]}, {"w": "dot", "b": [0.4437, 0.2149, 0.4759, 0.2347]}, {"w": "operation", "b": [0.4823, 0.2149, 0.5775, 0.2347]}, {"w": "do?", "b": [0.5838, 0.2149, 0.6203, 0.2347]}, {"w": "Let’s", "b": [0.6266, 0.2149, 0.677, 0.2347]}, {"w": "start", "b": [0.6833, 0.2149, 0.7267, 0.2347]}, {"w": "with", "b": [0.733, 0.2149, 0.7779, 0.2347]}, {"w": "the", "b": [0.7842, 0.2149, 0.815, 0.2347]}, {"w": "dot", "b": [0.8213, 0.2149, 0.8536, 0.2347]}, {"w": "product", "b": [0.1294, 0.2354, 0.2065, 0.2552]}, {"w": "of", "b": [0.2128, 0.2354, 0.2338, 0.2552]}, {"w": "two", "b": [0.2401, 0.2354, 0.2779, 0.2552]}, {"w": "vectors", "b": [0.2842, 0.2354, 0.3571, 0.2552]}, {"w": "x", "b": [0.3634, 0.2365, 0.3785, 0.2567]}, {"w": "and", "b": [0.3848, 0.2354, 0.4212, 0.2552]}, {"w": "y.", "b": [0.4275, 0.2354, 0.449, 0.2567]}, {"w": "It’s", "b": [0.4553, 0.2354, 0.4875, 0.2552]}, {"w": "computed", "b": [0.4938, 0.2354, 0.5933, 0.2552]}, {"w": "as", "b": [0.5996, 0.2354, 0.6206, 0.2552]}, {"w": "follows:", "b": [0.627, 0.2354, 0.7096, 0.2552]}]}, {"id": "b_4", "type": "paragraph", "text": "def naive_vector_dot(x, y): assert len(x.shape) == 1 1 assert len(y.shape) == 1 1 assert x.shape[0] == y.shape[0] z = 0. for i in range(x.shape[0]): z += x[i] * y[i] return z", "words": [{"w": "def", "b": [0.1357, 0.274, 0.1698, 0.2892]}, {"w": "naive_vector_dot(x,", "b": [0.1811, 0.274, 0.3968, 0.2892]}, {"w": "y):", "b": [0.4082, 0.274, 0.4422, 0.2892]}, {"w": "assert", "b": [0.1811, 0.2892, 0.2492, 0.3043]}, {"w": "len(x.shape)", "b": [0.2606, 0.2892, 0.3968, 0.3043]}, {"w": "==", "b": [0.4082, 0.2892, 0.4309, 0.3043]}, {"w": "1", "b": [0.4422, 0.2892, 0.4536, 0.3043]}, {"w": "1", "b": [0.6125, 0.2892, 0.6239, 0.3043]}, {"w": "assert", "b": [0.1811, 0.3043, 0.2492, 0.3195]}, {"w": "len(y.shape)", "b": [0.2606, 0.3043, 0.3968, 0.3195]}, {"w": "==", "b": [0.4082, 0.3043, 0.4309, 0.3195]}, {"w": "1", "b": [0.4422, 0.3043, 0.4536, 0.3195]}, {"w": "1", "b": [0.6125, 0.3043, 0.6239, 0.3195]}, {"w": "assert", "b": [0.1811, 0.3195, 0.2492, 0.3346]}, {"w": "x.shape[0]", "b": [0.2606, 0.3195, 0.3741, 0.3346]}, {"w": "==", "b": [0.3855, 0.3195, 0.4082, 0.3346]}, {"w": "y.shape[0]", "b": [0.4195, 0.3195, 0.533, 0.3346]}, {"w": "z", "b": [0.1811, 0.3498, 0.1925, 0.3649]}, {"w": "=", "b": [0.2038, 0.3498, 0.2152, 0.3649]}, {"w": "0.", "b": [0.2265, 0.3498, 0.2492, 0.3649]}, {"w": "for", "b": [0.1811, 0.365, 0.2152, 0.3801]}, {"w": "i", "b": [0.2265, 0.365, 0.2379, 0.3801]}, {"w": "in", "b": [0.2492, 0.365, 0.2719, 0.3801]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.365, 0.4876, 0.3801]}, {"w": "z", "b": [0.2265, 0.3801, 0.2379, 0.3953]}, {"w": "+=", "b": [0.2492, 0.3801, 0.2719, 0.3953]}, {"w": "x[i]", "b": [0.2833, 0.3801, 0.3287, 0.3953]}, {"w": "*", "b": [0.34, 0.3801, 0.3514, 0.3953]}, {"w": "y[i]", "b": [0.3628, 0.3801, 0.4082, 0.3953]}, {"w": "return", "b": [0.1811, 0.3953, 0.2492, 0.4104]}, {"w": "z", "b": [0.2606, 0.3953, 0.2719, 0.4104]}]}, {"id": "b_5", "type": "paragraph", "text": "1 x and y are Numpy vectors.", "words": [{"w": "1", "b": [0.1799, 0.4288, 0.1925, 0.4486]}, {"w": "x", "b": [0.1988, 0.4288, 0.2114, 0.4486]}, {"w": "and", "b": [0.2177, 0.4288, 0.2584, 0.4486]}, {"w": "y", "b": [0.2647, 0.4288, 0.2773, 0.4486]}, {"w": "are", "b": [0.2836, 0.4288, 0.3182, 0.4486]}, {"w": "Numpy", "b": [0.3245, 0.4288, 0.4043, 0.4486]}, {"w": "vectors.", "b": [0.4107, 0.4288, 0.494, 0.4486]}]}, {"id": "b_6", "type": "paragraph", "text": "You’ll have noticed that the dot product between two vectors is a scalar and that only vectors with the same number of elements are compatible for a dot product.", "words": [{"w": "You’ll", "b": [0.1294, 0.4716, 0.1928, 0.4914]}, {"w": "have", "b": [0.1991, 0.4716, 0.2467, 0.4914]}, {"w": "noticed", "b": [0.253, 0.4716, 0.3273, 0.4914]}, {"w": "that", "b": [0.3336, 0.4716, 0.3714, 0.4914]}, {"w": "the", "b": [0.3777, 0.4716, 0.4085, 0.4914]}, {"w": "dot", "b": [0.4148, 0.4716, 0.4471, 0.4914]}, {"w": "product", "b": [0.4534, 0.4716, 0.5305, 0.4914]}, {"w": "between", "b": [0.5368, 0.4716, 0.6208, 0.4914]}, {"w": "two", "b": [0.6271, 0.4716, 0.665, 0.4914]}, {"w": "vectors", "b": [0.6713, 0.4716, 0.7441, 0.4914]}, {"w": "is", "b": [0.7504, 0.4716, 0.7672, 0.4914]}, {"w": "a", "b": [0.7736, 0.4716, 0.7848, 0.4914]}, {"w": "scalar", "b": [0.7911, 0.4716, 0.8499, 0.4914]}, {"w": "and", "b": [0.1294, 0.4921, 0.1658, 0.5119]}, {"w": "that", "b": [0.1721, 0.4921, 0.21, 0.5119]}, {"w": "only", "b": [0.2163, 0.4921, 0.2611, 0.5119]}, {"w": "vectors", "b": [0.2674, 0.4921, 0.3403, 0.5119]}, {"w": "with", "b": [0.3466, 0.4921, 0.3915, 0.5119]}, {"w": "the", "b": [0.3978, 0.4921, 0.4286, 0.5119]}, {"w": "same", "b": [0.4349, 0.4921, 0.4867, 0.5119]}, {"w": "number", "b": [0.493, 0.4921, 0.5701, 0.5119]}, {"w": "of", "b": [0.5764, 0.4921, 0.5974, 0.5119]}, {"w": "elements", "b": [0.6037, 0.4921, 0.6934, 0.5119]}, {"w": "are", "b": [0.6996, 0.4921, 0.7304, 0.5119]}, {"w": "compatible", "b": [0.7367, 0.4921, 0.8488, 0.5119]}, {"w": "for", "b": [0.1294, 0.5126, 0.1588, 0.5324]}, {"w": "a", "b": [0.1651, 0.5126, 0.1763, 0.5324]}, {"w": "dot", "b": [0.1826, 0.5126, 0.2149, 0.5324]}, {"w": "product.", "b": [0.2212, 0.5126, 0.3046, 0.5324]}]}, {"id": "b_7", "type": "paragraph", "text": "You can also take the dot product between a matrix x and a vector y, which returns a vector where the coefficients are the dot products between y and the rows of x. You implement it as follows:", "words": [{"w": "You", "b": [0.1294, 0.5554, 0.1703, 0.5751]}, {"w": "can", "b": [0.1766, 0.5554, 0.2116, 0.5751]}, {"w": "also", "b": [0.218, 0.5554, 0.2586, 0.5751]}, {"w": "take", "b": [0.2649, 0.5554, 0.3069, 0.5751]}, {"w": "the", "b": [0.3132, 0.5554, 0.3441, 0.5751]}, {"w": "dot", "b": [0.3504, 0.5554, 0.3826, 0.5751]}, {"w": "product", "b": [0.3889, 0.5554, 0.466, 0.5751]}, {"w": "between", "b": [0.4723, 0.5554, 0.5563, 0.5751]}, {"w": "a", "b": [0.5626, 0.5554, 0.5738, 0.5751]}, {"w": "matrix", "b": [0.5801, 0.5554, 0.646, 0.5751]}, {"w": "x", "b": [0.6522, 0.5564, 0.6674, 0.5766]}, {"w": "and", "b": [0.6737, 0.5554, 0.7101, 0.5751]}, {"w": "a", "b": [0.7164, 0.5554, 0.7276, 0.5751]}, {"w": "vector", "b": [0.7339, 0.5554, 0.797, 0.5751]}, {"w": "y,", "b": [0.8032, 0.5554, 0.8247, 0.5766]}, {"w": "which", "b": [0.1294, 0.5768, 0.1911, 0.5965]}, {"w": "returns", "b": [0.1974, 0.5768, 0.2674, 0.5965]}, {"w": "a", "b": [0.2737, 0.5768, 0.2849, 0.5965]}, {"w": "vector", "b": [0.2912, 0.5768, 0.3543, 0.5965]}, {"w": "where", "b": [0.3606, 0.5768, 0.4222, 0.5965]}, {"w": "the", "b": [0.4285, 0.5768, 0.4593, 0.5965]}, {"w": "coefficients", "b": [0.4656, 0.5768, 0.5828, 0.5965]}, {"w": "are", "b": [0.5891, 0.5768, 0.6199, 0.5965]}, {"w": "the", "b": [0.6262, 0.5768, 0.6571, 0.5965]}, {"w": "dot", "b": [0.6634, 0.5768, 0.6956, 0.5965]}, {"w": "products", "b": [0.7019, 0.5768, 0.7888, 0.5965]}, {"w": "between", "b": [0.1294, 0.5973, 0.2135, 0.617]}, {"w": "y", "b": [0.2198, 0.5983, 0.2349, 0.6185]}, {"w": "and", "b": [0.2412, 0.5973, 0.2776, 0.617]}, {"w": "the", "b": [0.2839, 0.5973, 0.3148, 0.617]}, {"w": "rows", "b": [0.3211, 0.5973, 0.3701, 0.617]}, {"w": "of", "b": [0.3764, 0.5973, 0.3974, 0.617]}, {"w": "x.", "b": [0.4037, 0.5973, 0.4251, 0.6185]}, {"w": "You", "b": [0.4315, 0.5973, 0.4724, 0.617]}, {"w": "implement", "b": [0.4787, 0.5973, 0.5866, 0.617]}, {"w": "it", "b": [0.5929, 0.5973, 0.6069, 0.617]}, {"w": "as", "b": [0.6132, 0.5973, 0.6342, 0.617]}, {"w": "follows:", "b": [0.6405, 0.5973, 0.7232, 0.617]}]}, {"id": "b_8", "type": "paragraph", "text": "import numpy as np def naive_matrix_vector_dot(x, y): assert len(x.shape) == 2 1 assert len(y.shape) == 1 2 assert x.shape[1] == y.shape[0] 3 z = np.zeros(x.shape[0]) 4 for i in range(x.shape[0]): for j in range(x.shape[1]): z[i] += x[i, j] * y[j] return z", "words": [{"w": "import", "b": [0.1357, 0.6359, 0.2038, 0.6511]}, {"w": "numpy", "b": [0.2152, 0.6359, 0.2719, 0.6511]}, {"w": "as", "b": [0.2833, 0.6359, 0.306, 0.6511]}, {"w": "np", "b": [0.3173, 0.6359, 0.34, 0.6511]}, {"w": "def", "b": [0.1357, 0.6662, 0.1698, 0.6814]}, {"w": "naive_matrix_vector_dot(x,", "b": [0.1811, 0.6662, 0.4763, 0.6814]}, {"w": "y):", "b": [0.4876, 0.6662, 0.5217, 0.6814]}, {"w": "assert", "b": [0.1811, 0.6814, 0.2492, 0.6965]}, {"w": "len(x.shape)", "b": [0.2606, 0.6814, 0.3968, 0.6965]}, {"w": "==", "b": [0.4082, 0.6814, 0.4309, 0.6965]}, {"w": "2", "b": [0.4422, 0.6814, 0.4536, 0.6965]}, {"w": "1", "b": [0.658, 0.6814, 0.6693, 0.6965]}, {"w": "assert", "b": [0.1811, 0.6965, 0.2492, 0.7117]}, {"w": "len(y.shape)", "b": [0.2606, 0.6965, 0.3968, 0.7117]}, {"w": "==", "b": [0.4082, 0.6965, 0.4309, 0.7117]}, {"w": "1", "b": [0.4422, 0.6965, 0.4536, 0.7117]}, {"w": "2", "b": [0.658, 0.6965, 0.6693, 0.7117]}, {"w": "assert", "b": [0.1811, 0.7117, 0.2492, 0.7268]}, {"w": "x.shape[1]", "b": [0.2606, 0.7117, 0.3741, 0.7268]}, {"w": "==", "b": [0.3855, 0.7117, 0.4082, 0.7268]}, {"w": "y.shape[0]", "b": [0.4195, 0.7117, 0.533, 0.7268]}, {"w": "3", "b": [0.658, 0.7117, 0.6693, 0.7268]}, {"w": "z", "b": [0.1811, 0.742, 0.1925, 0.7571]}, {"w": "=", "b": [0.2038, 0.742, 0.2152, 0.7571]}, {"w": "np.zeros(x.shape[0])", "b": [0.2265, 0.742, 0.4536, 0.7571]}, {"w": "4", "b": [0.658, 0.742, 0.6693, 0.7571]}, {"w": "for", "b": [0.1811, 0.7571, 0.2152, 0.7723]}, {"w": "i", "b": [0.2265, 0.7571, 0.2379, 0.7723]}, {"w": "in", "b": [0.2492, 0.7571, 0.2719, 0.7723]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.7571, 0.4876, 0.7723]}, {"w": "for", "b": [0.2265, 0.7723, 0.2606, 0.7874]}, {"w": "j", "b": [0.2719, 0.7723, 0.2833, 0.7874]}, {"w": "in", "b": [0.2946, 0.7723, 0.3173, 0.7874]}, {"w": "range(x.shape[1]):", "b": [0.3287, 0.7723, 0.533, 0.7874]}, {"w": "z[i]", "b": [0.2719, 0.7874, 0.3173, 0.8026]}, {"w": "+=", "b": [0.3287, 0.7874, 0.3514, 0.8026]}, {"w": "x[i,", "b": [0.3628, 0.7874, 0.4082, 0.8026]}, {"w": "j]", "b": [0.4195, 0.7874, 0.4422, 0.8026]}, {"w": "*", "b": [0.4536, 0.7874, 0.4649, 0.8026]}, {"w": "y[j]", "b": [0.4763, 0.7874, 0.5217, 0.8026]}, {"w": "return", "b": [0.1811, 0.8026, 0.2492, 0.8177]}, {"w": "z", "b": [0.2606, 0.8026, 0.2719, 0.8177]}]}, {"id": "b_9", "type": "paragraph", "text": "1 x is a Numpy matrix. 2 y is a Numpy vector.", "words": [{"w": "1", "b": [0.1799, 0.8362, 0.1925, 0.8559]}, {"w": "x", "b": [0.1988, 0.8362, 0.2114, 0.8559]}, {"w": "is", "b": [0.2177, 0.8362, 0.2345, 0.8559]}, {"w": "a", "b": [0.2408, 0.8362, 0.2534, 0.8559]}, {"w": "Numpy", "b": [0.2598, 0.8362, 0.3396, 0.8559]}, {"w": "matrix.", "b": [0.3459, 0.8362, 0.4251, 0.8559]}, {"w": "2", "b": [0.1799, 0.8567, 0.1925, 0.8764]}, {"w": "y", "b": [0.1988, 0.8567, 0.2114, 0.8764]}, {"w": "is", "b": [0.2177, 0.8567, 0.2345, 0.8764]}, {"w": "a", "b": [0.2408, 0.8567, 0.2534, 0.8764]}, {"w": "Numpy", "b": [0.2598, 0.8567, 0.3396, 0.8764]}, {"w": "vector.", "b": [0.3459, 0.8567, 0.4172, 0.8764]}]}]}, {"page": 77, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3 The first dimension of x must be the same as the 0th dimension of y! 4 This operation returns a vector of 0s with the same shape as y.", "words": [{"w": "3", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "The", "b": [0.1988, 0.0857, 0.2408, 0.1054]}, {"w": "first", "b": [0.2471, 0.0857, 0.292, 0.1054]}, {"w": "dimension", "b": [0.2983, 0.0857, 0.409, 0.1054]}, {"w": "of", "b": [0.4153, 0.0857, 0.4363, 0.1054]}, {"w": "x", "b": [0.4426, 0.0857, 0.4553, 0.1054]}, {"w": "must", "b": [0.4616, 0.0857, 0.5148, 0.1054]}, {"w": "be", "b": [0.5211, 0.0857, 0.5463, 0.1054]}, {"w": "the", "b": [0.5526, 0.0857, 0.5863, 0.1054]}, {"w": "same", "b": [0.5926, 0.0857, 0.6472, 0.1054]}, {"w": "as", "b": [0.6535, 0.0857, 0.676, 0.1054]}, {"w": "the", "b": [0.6823, 0.0857, 0.7159, 0.1054]}, {"w": "0th", "b": [0.7222, 0.0857, 0.7572, 0.1054]}, {"w": "dimension", "b": [0.1799, 0.1062, 0.2906, 0.1259]}, {"w": "of", "b": [0.2969, 0.1062, 0.3179, 0.1259]}, {"w": "y!", "b": [0.3242, 0.1062, 0.3452, 0.1259]}, {"w": "4", "b": [0.1799, 0.1267, 0.1925, 0.1464]}, {"w": "This", "b": [0.1988, 0.1267, 0.2465, 0.1464]}, {"w": "operation", "b": [0.2528, 0.1267, 0.3565, 0.1464]}, {"w": "returns", "b": [0.3628, 0.1267, 0.4422, 0.1464]}, {"w": "a", "b": [0.4485, 0.1267, 0.4611, 0.1464]}, {"w": "vector", "b": [0.4674, 0.1267, 0.5346, 0.1464]}, {"w": "of", "b": [0.5409, 0.1267, 0.562, 0.1464]}, {"w": "0s", "b": [0.5683, 0.1267, 0.5907, 0.1464]}, {"w": "with", "b": [0.597, 0.1267, 0.6446, 0.1464]}, {"w": "the", "b": [0.6509, 0.1267, 0.6846, 0.1464]}, {"w": "same", "b": [0.6909, 0.1267, 0.7455, 0.1464]}, {"w": "shape", "b": [0.7518, 0.1267, 0.8135, 0.1464]}, {"w": "as", "b": [0.8198, 0.1267, 0.8422, 0.1464]}, {"w": "y.", "b": [0.8485, 0.1267, 0.8661, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "You could also reuse the code we wrote previously, which highlights the relationship between a matrix-vector product and a vector product:", "words": [{"w": "You", "b": [0.1294, 0.1695, 0.1703, 0.1892]}, {"w": "could", "b": [0.1766, 0.1695, 0.2327, 0.1892]}, {"w": "also", "b": [0.239, 0.1695, 0.2796, 0.1892]}, {"w": "reuse", "b": [0.2859, 0.1695, 0.3392, 0.1892]}, {"w": "the", "b": [0.3455, 0.1695, 0.3763, 0.1892]}, {"w": "code", "b": [0.3826, 0.1695, 0.4302, 0.1892]}, {"w": "we", "b": [0.4365, 0.1695, 0.466, 0.1892]}, {"w": "wrote", "b": [0.4723, 0.1695, 0.5297, 0.1892]}, {"w": "previously,", "b": [0.536, 0.1695, 0.6471, 0.1892]}, {"w": "which", "b": [0.6534, 0.1695, 0.7151, 0.1892]}, {"w": "highlights", "b": [0.7214, 0.1695, 0.8223, 0.1892]}, {"w": "the", "b": [0.8286, 0.1695, 0.8595, 0.1892]}, {"w": "relationship", "b": [0.1294, 0.19, 0.2485, 0.2097]}, {"w": "between", "b": [0.2548, 0.19, 0.3389, 0.2097]}, {"w": "a", "b": [0.3452, 0.19, 0.3564, 0.2097]}, {"w": "matrix-vector", "b": [0.3627, 0.19, 0.5, 0.2097]}, {"w": "product", "b": [0.5063, 0.19, 0.5834, 0.2097]}, {"w": "and", "b": [0.5897, 0.19, 0.6261, 0.2097]}, {"w": "a", "b": [0.6324, 0.19, 0.6436, 0.2097]}, {"w": "vector", "b": [0.6498, 0.19, 0.7129, 0.2097]}, {"w": "product:", "b": [0.7192, 0.19, 0.8033, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "def naive_matrix_vector_dot(x, y): z = np.zeros(x.shape[0]) for i in range(x.shape[0]): z[i] = naive_vector_dot(x[i, :], y) return z", "words": [{"w": "def", "b": [0.1357, 0.2277, 0.1698, 0.2428]}, {"w": "naive_matrix_vector_dot(x,", "b": [0.1811, 0.2277, 0.4763, 0.2428]}, {"w": "y):", "b": [0.4876, 0.2277, 0.5217, 0.2428]}, {"w": "z", "b": [0.1811, 0.2428, 0.1925, 0.258]}, {"w": "=", "b": [0.2038, 0.2428, 0.2152, 0.258]}, {"w": "np.zeros(x.shape[0])", "b": [0.2265, 0.2428, 0.4536, 0.258]}, {"w": "for", "b": [0.1811, 0.258, 0.2152, 0.2731]}, {"w": "i", "b": [0.2265, 0.258, 0.2379, 0.2731]}, {"w": "in", "b": [0.2492, 0.258, 0.2719, 0.2731]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.258, 0.4876, 0.2731]}, {"w": "z[i]", "b": [0.2265, 0.2732, 0.2719, 0.2883]}, {"w": "=", "b": [0.2833, 0.2732, 0.2946, 0.2883]}, {"w": "naive_vector_dot(x[i,", "b": [0.306, 0.2732, 0.5444, 0.2883]}, {"w": ":],", "b": [0.5557, 0.2732, 0.5898, 0.2883]}, {"w": "y)", "b": [0.6011, 0.2732, 0.6238, 0.2883]}, {"w": "return", "b": [0.1811, 0.2883, 0.2492, 0.3034]}, {"w": "z", "b": [0.2606, 0.2883, 0.2719, 0.3034]}]}, {"id": "b_3", "type": "paragraph", "text": "Note that as soon as one of the two tensors has an ndim greater than 1, dot is no longer symmetric, which is to say that dot(x, y) isn’t the same as dot(y, x).", "words": [{"w": "Note", "b": [0.1294, 0.3263, 0.1785, 0.3461]}, {"w": "that", "b": [0.1848, 0.3263, 0.2226, 0.3461]}, {"w": "as", "b": [0.2289, 0.3263, 0.2499, 0.3461]}, {"w": "soon", "b": [0.2562, 0.3263, 0.3039, 0.3461]}, {"w": "as", "b": [0.3102, 0.3263, 0.3312, 0.3461]}, {"w": "one", "b": [0.3375, 0.3263, 0.3739, 0.3461]}, {"w": "of", "b": [0.3802, 0.3263, 0.4012, 0.3461]}, {"w": "the", "b": [0.4076, 0.3263, 0.4384, 0.3461]}, {"w": "two", "b": [0.4447, 0.3263, 0.4825, 0.3461]}, {"w": "tensors", "b": [0.4888, 0.3263, 0.5603, 0.3461]}, {"w": "has", "b": [0.5666, 0.3263, 0.6002, 0.3461]}, {"w": "an", "b": [0.6065, 0.3263, 0.6303, 0.3461]}, {"w": "ndim", "b": [0.6366, 0.3274, 0.6971, 0.3476]}, {"w": "greater", "b": [0.7035, 0.3263, 0.7735, 0.3461]}, {"w": "than", "b": [0.7798, 0.3263, 0.8232, 0.3461]}, {"w": "1,", "b": [0.8295, 0.3263, 0.8485, 0.3461]}, {"w": "dot", "b": [0.1294, 0.3488, 0.1748, 0.369]}, {"w": "is", "b": [0.1811, 0.3477, 0.198, 0.3675]}, {"w": "no", "b": [0.2043, 0.3477, 0.2295, 0.3675]}, {"w": "longer", "b": [0.2358, 0.3477, 0.3002, 0.3675]}, {"w": "symmetric,", "b": [0.3065, 0.3477, 0.4194, 0.3675]}, {"w": "which", "b": [0.4257, 0.3477, 0.4873, 0.3675]}, {"w": "is", "b": [0.4936, 0.3477, 0.5104, 0.3675]}, {"w": "to", "b": [0.5168, 0.3477, 0.5364, 0.3675]}, {"w": "say", "b": [0.5427, 0.3477, 0.5763, 0.3675]}, {"w": "that", "b": [0.5826, 0.3477, 0.6205, 0.3675]}, {"w": "dot(x,", "b": [0.6267, 0.3488, 0.7175, 0.369]}, {"w": "y)", "b": [0.7327, 0.3488, 0.7629, 0.369]}, {"w": "isn’t", "b": [0.7693, 0.3477, 0.8137, 0.3675]}, {"w": "the", "b": [0.82, 0.3477, 0.8508, 0.3675]}, {"w": "same", "b": [0.1294, 0.3691, 0.1813, 0.3889]}, {"w": "as", "b": [0.1876, 0.3691, 0.2086, 0.3889]}, {"w": "dot(y,", "b": [0.2149, 0.3702, 0.3057, 0.3904]}, {"w": "x).", "b": [0.3208, 0.3691, 0.3574, 0.3904]}]}, {"id": "b_4", "type": "paragraph", "text": "Of course, a dot product generalizes to tensors with an arbitrary number of axes. The most common applications may be the dot product between two matrices. You can take the dot product of two matrices x and y (dot(x, y)) if and only if x.shape[1] == y.shape[0]. The result is a matrix with shape (x.shape[0], y.shape[1]), where the coefficients are the vector products between the rows of x and the columns of y. Here’s the naive implementation:", "words": [{"w": "Of", "b": [0.1294, 0.4128, 0.156, 0.4325]}, {"w": "course,", "b": [0.1623, 0.4128, 0.2345, 0.4325]}, {"w": "a", "b": [0.2408, 0.4128, 0.252, 0.4325]}, {"w": "dot", "b": [0.2583, 0.4128, 0.2905, 0.4325]}, {"w": "product", "b": [0.2968, 0.4128, 0.3739, 0.4325]}, {"w": "generalizes", "b": [0.3802, 0.4128, 0.4937, 0.4325]}, {"w": "to", "b": [0.5, 0.4128, 0.5196, 0.4325]}, {"w": "tensors", "b": [0.5259, 0.4128, 0.5974, 0.4325]}, {"w": "with", "b": [0.6037, 0.4128, 0.6485, 0.4325]}, {"w": "an", "b": [0.6548, 0.4128, 0.6787, 0.4325]}, {"w": "arbitrary", "b": [0.685, 0.4128, 0.7718, 0.4325]}, {"w": "number", "b": [0.7781, 0.4128, 0.8552, 0.4325]}, {"w": "of", "b": [0.1294, 0.4333, 0.1504, 0.453]}, {"w": "axes.", "b": [0.1567, 0.4333, 0.2079, 0.453]}, {"w": "The", "b": [0.2142, 0.4333, 0.2534, 0.453]}, {"w": "most", "b": [0.2597, 0.4333, 0.3088, 0.453]}, {"w": "common", "b": [0.3151, 0.4333, 0.4034, 0.453]}, {"w": "applications", "b": [0.4097, 0.4333, 0.5316, 0.453]}, {"w": "may", "b": [0.5379, 0.4333, 0.5813, 0.453]}, {"w": "be", "b": [0.5876, 0.4333, 0.6115, 0.453]}, {"w": "the", "b": [0.6178, 0.4333, 0.6486, 0.453]}, {"w": "dot", "b": [0.6548, 0.4333, 0.6871, 0.453]}, {"w": "product", "b": [0.6934, 0.4333, 0.7704, 0.453]}, {"w": "between", "b": [0.7767, 0.4333, 0.8608, 0.453]}, {"w": "two", "b": [0.1294, 0.4538, 0.1673, 0.4735]}, {"w": "matrices.", "b": [0.1736, 0.4538, 0.2653, 0.4735]}, {"w": "You", "b": [0.2716, 0.4538, 0.3125, 0.4735]}, {"w": "can", "b": [0.3188, 0.4538, 0.3539, 0.4735]}, {"w": "take", "b": [0.3602, 0.4538, 0.4022, 0.4735]}, {"w": "the", "b": [0.4085, 0.4538, 0.4393, 0.4735]}, {"w": "dot", "b": [0.4456, 0.4538, 0.4779, 0.4735]}, {"w": "product", "b": [0.4842, 0.4538, 0.5612, 0.4735]}, {"w": "of", "b": [0.5675, 0.4538, 0.5886, 0.4735]}, {"w": "two", "b": [0.5949, 0.4538, 0.6327, 0.4735]}, {"w": "matrices", "b": [0.639, 0.4538, 0.7245, 0.4735]}, {"w": "x", "b": [0.7307, 0.4548, 0.7458, 0.475]}, {"w": "and", "b": [0.7522, 0.4538, 0.7886, 0.4735]}, {"w": "y", "b": [0.7949, 0.4548, 0.81, 0.475]}, {"w": "(dot(x,", "b": [0.1294, 0.4752, 0.2286, 0.4964]}, {"w": "y))", "b": [0.2438, 0.4752, 0.2824, 0.4964]}, {"w": "if", "b": [0.2888, 0.4752, 0.3042, 0.4949]}, {"w": "and", "b": [0.3105, 0.4752, 0.3469, 0.4949]}, {"w": "only", "b": [0.3532, 0.4752, 0.3981, 0.4949]}, {"w": "if", "b": [0.4044, 0.4752, 0.4198, 0.4949]}, {"w": "x.shape[1]", "b": [0.4261, 0.4762, 0.5774, 0.4964]}, {"w": "==", "b": [0.5925, 0.4762, 0.6228, 0.4964]}, {"w": "y.shape[0].", "b": [0.6379, 0.4752, 0.7957, 0.4964]}, {"w": "The", "b": [0.802, 0.4752, 0.8412, 0.4949]}, {"w": "result", "b": [0.1294, 0.4966, 0.1855, 0.5163]}, {"w": "is", "b": [0.1918, 0.4966, 0.2086, 0.5163]}, {"w": "a", "b": [0.2149, 0.4966, 0.2261, 0.5163]}, {"w": "matrix", "b": [0.2324, 0.4966, 0.2983, 0.5163]}, {"w": "with", "b": [0.3046, 0.4966, 0.3494, 0.5163]}, {"w": "shape", "b": [0.3557, 0.4966, 0.4132, 0.5163]}, {"w": "(x.shape[0],", "b": [0.4194, 0.4976, 0.6011, 0.5178]}, {"w": "y.shape[1]),", "b": [0.6162, 0.4966, 0.789, 0.5178]}, {"w": "where", "b": [0.7954, 0.4966, 0.857, 0.5163]}, {"w": "the", "b": [0.1294, 0.518, 0.1602, 0.5377]}, {"w": "coefficients", "b": [0.1665, 0.518, 0.2838, 0.5377]}, {"w": "are", "b": [0.2901, 0.518, 0.3209, 0.5377]}, {"w": "the", "b": [0.3272, 0.518, 0.358, 0.5377]}, {"w": "vector", "b": [0.3643, 0.518, 0.4273, 0.5377]}, {"w": "products", "b": [0.4336, 0.518, 0.5205, 0.5377]}, {"w": "between", "b": [0.5268, 0.518, 0.6109, 0.5377]}, {"w": "the", "b": [0.6172, 0.518, 0.648, 0.5377]}, {"w": "rows", "b": [0.6543, 0.518, 0.7034, 0.5377]}, {"w": "of", "b": [0.7097, 0.518, 0.7307, 0.5377]}, {"w": "x", "b": [0.7369, 0.519, 0.7521, 0.5392]}, {"w": "and", "b": [0.7584, 0.518, 0.7948, 0.5377]}, {"w": "the", "b": [0.8011, 0.518, 0.8319, 0.5377]}, {"w": "columns", "b": [0.1294, 0.5394, 0.2149, 0.5591]}, {"w": "of", "b": [0.2212, 0.5394, 0.2422, 0.5591]}, {"w": "y.", "b": [0.2485, 0.5394, 0.2699, 0.5606]}, {"w": "Here’s", "b": [0.2763, 0.5394, 0.3421, 0.5591]}, {"w": "the", "b": [0.3484, 0.5394, 0.3792, 0.5591]}, {"w": "naive", "b": [0.3855, 0.5394, 0.4402, 0.5591]}, {"w": "implementation:", "b": [0.4465, 0.5394, 0.6118, 0.5591]}]}, {"id": "b_5", "type": "paragraph", "text": "def naive_matrix_dot(x, y): assert len(x.shape) == 2 1 assert len(y.shape) == 2 1 assert x.shape[1] == y.shape[0] 2 z = np.zeros((x.shape[0], y.shape[1])) 3 for i in range(x.shape[0]): 4 for j in range(y.shape[1]): 5 row_x = x[i, :] column_y = y[:, j] z[i, j] = naive_vector_dot(row_x, column_y) return z", "words": [{"w": "def", "b": [0.1357, 0.578, 0.1698, 0.5931]}, {"w": "naive_matrix_dot(x,", "b": [0.1811, 0.578, 0.3968, 0.5931]}, {"w": "y):", "b": [0.4082, 0.578, 0.4422, 0.5931]}, {"w": "assert", "b": [0.1811, 0.5931, 0.2492, 0.6083]}, {"w": "len(x.shape)", "b": [0.2606, 0.5931, 0.3968, 0.6083]}, {"w": "==", "b": [0.4082, 0.5931, 0.4309, 0.6083]}, {"w": "2", "b": [0.4422, 0.5931, 0.4536, 0.6083]}, {"w": "1", "b": [0.6807, 0.5931, 0.692, 0.6083]}, {"w": "assert", "b": [0.1811, 0.6083, 0.2492, 0.6234]}, {"w": "len(y.shape)", "b": [0.2606, 0.6083, 0.3968, 0.6234]}, {"w": "==", "b": [0.4082, 0.6083, 0.4309, 0.6234]}, {"w": "2", "b": [0.4422, 0.6083, 0.4536, 0.6234]}, {"w": "1", "b": [0.6807, 0.6083, 0.692, 0.6234]}, {"w": "assert", "b": [0.1811, 0.6234, 0.2492, 0.6386]}, {"w": "x.shape[1]", "b": [0.2606, 0.6234, 0.3741, 0.6386]}, {"w": "==", "b": [0.3855, 0.6234, 0.4082, 0.6386]}, {"w": "y.shape[0]", "b": [0.4195, 0.6234, 0.533, 0.6386]}, {"w": "2", "b": [0.6807, 0.6234, 0.692, 0.6386]}, {"w": "z", "b": [0.1811, 0.6537, 0.1925, 0.6689]}, {"w": "=", "b": [0.2038, 0.6537, 0.2152, 0.6689]}, {"w": "np.zeros((x.shape[0],", "b": [0.2265, 0.6537, 0.4649, 0.6689]}, {"w": "y.shape[1]))", "b": [0.4763, 0.6537, 0.6125, 0.6689]}, {"w": "3", "b": [0.6807, 0.6537, 0.692, 0.6689]}, {"w": "for", "b": [0.1811, 0.6689, 0.2152, 0.684]}, {"w": "i", "b": [0.2265, 0.6689, 0.2379, 0.684]}, {"w": "in", "b": [0.2492, 0.6689, 0.2719, 0.684]}, {"w": "range(x.shape[0]):", "b": [0.2833, 0.6689, 0.4876, 0.684]}, {"w": "4", "b": [0.6807, 0.6689, 0.692, 0.684]}, {"w": "for", "b": [0.2265, 0.684, 0.2606, 0.6992]}, {"w": "j", "b": [0.2719, 0.684, 0.2833, 0.6992]}, {"w": "in", "b": [0.2946, 0.684, 0.3173, 0.6992]}, {"w": "range(y.shape[1]):", "b": [0.3287, 0.684, 0.533, 0.6992]}, {"w": "5", "b": [0.6807, 0.684, 0.692, 0.6992]}, {"w": "row_x", "b": [0.2719, 0.6992, 0.3287, 0.7143]}, {"w": "=", "b": [0.34, 0.6992, 0.3514, 0.7143]}, {"w": "x[i,", "b": [0.3628, 0.6992, 0.4082, 0.7143]}, {"w": ":]", "b": [0.4195, 0.6992, 0.4422, 0.7143]}, {"w": "column_y", "b": [0.2719, 0.7144, 0.3628, 0.7295]}, {"w": "=", "b": [0.3741, 0.7144, 0.3855, 0.7295]}, {"w": "y[:,", "b": [0.3968, 0.7144, 0.4422, 0.7295]}, {"w": "j]", "b": [0.4536, 0.7144, 0.4763, 0.7295]}, {"w": "z[i,", "b": [0.2719, 0.7295, 0.3173, 0.7447]}, {"w": "j]", "b": [0.3287, 0.7295, 0.3514, 0.7447]}, {"w": "=", "b": [0.3628, 0.7295, 0.3741, 0.7447]}, {"w": "naive_vector_dot(row_x,", "b": [0.3855, 0.7295, 0.6465, 0.7447]}, {"w": "column_y)", "b": [0.6579, 0.7295, 0.7601, 0.7447]}, {"w": "return", "b": [0.1811, 0.7447, 0.2492, 0.7598]}, {"w": "z", "b": [0.2606, 0.7447, 0.2719, 0.7598]}]}, {"id": "b_6", "type": "paragraph", "text": "1 x and y are Numpy matrices. 2 The first dimension of x must be the same as the 0th dimension of y! 3 This operation returns a matrix of 0s with a specific shape. 4 Iterates over the rows of x ... 5 ... and over the columns of y.", "words": [{"w": "1", "b": [0.1799, 0.7782, 0.1925, 0.798]}, {"w": "x", "b": [0.1988, 0.7782, 0.2114, 0.798]}, {"w": "and", "b": [0.2177, 0.7782, 0.2584, 0.798]}, {"w": "y", "b": [0.2647, 0.7782, 0.2773, 0.798]}, {"w": "are", "b": [0.2836, 0.7782, 0.3182, 0.798]}, {"w": "Numpy", "b": [0.3245, 0.7782, 0.4043, 0.798]}, {"w": "matrices.", "b": [0.4107, 0.7782, 0.5094, 0.798]}, {"w": "2", "b": [0.1799, 0.7987, 0.1925, 0.8185]}, {"w": "The", "b": [0.1988, 0.7987, 0.2408, 0.8185]}, {"w": "first", "b": [0.2471, 0.7987, 0.292, 0.8185]}, {"w": "dimension", "b": [0.2983, 0.7987, 0.409, 0.8185]}, {"w": "of", "b": [0.4153, 0.7987, 0.4363, 0.8185]}, {"w": "x", "b": [0.4426, 0.7987, 0.4553, 0.8185]}, {"w": "must", "b": [0.4616, 0.7987, 0.5148, 0.8185]}, {"w": "be", "b": [0.5211, 0.7987, 0.5463, 0.8185]}, {"w": "the", "b": [0.5526, 0.7987, 0.5863, 0.8185]}, {"w": "same", "b": [0.5926, 0.7987, 0.6472, 0.8185]}, {"w": "as", "b": [0.6535, 0.7987, 0.676, 0.8185]}, {"w": "the", "b": [0.6823, 0.7987, 0.7159, 0.8185]}, {"w": "0th", "b": [0.7222, 0.7987, 0.7572, 0.8185]}, {"w": "dimension", "b": [0.1799, 0.8192, 0.2906, 0.839]}, {"w": "of", "b": [0.2969, 0.8192, 0.3179, 0.839]}, {"w": "y!", "b": [0.3242, 0.8192, 0.3452, 0.839]}, {"w": "3", "b": [0.1799, 0.8397, 0.1925, 0.8595]}, {"w": "This", "b": [0.1988, 0.8397, 0.2465, 0.8595]}, {"w": "operation", "b": [0.2528, 0.8397, 0.3565, 0.8595]}, {"w": "returns", "b": [0.3628, 0.8397, 0.4422, 0.8595]}, {"w": "a", "b": [0.4485, 0.8397, 0.4611, 0.8595]}, {"w": "matrix", "b": [0.4674, 0.8397, 0.5403, 0.8595]}, {"w": "of", "b": [0.5466, 0.8397, 0.5676, 0.8595]}, {"w": "0s", "b": [0.5739, 0.8397, 0.5963, 0.8595]}, {"w": "with", "b": [0.6026, 0.8397, 0.6503, 0.8595]}, {"w": "a", "b": [0.6566, 0.8397, 0.6692, 0.8595]}, {"w": "specific", "b": [0.6755, 0.8397, 0.7554, 0.8595]}, {"w": "shape.", "b": [0.7617, 0.8397, 0.8296, 0.8595]}, {"w": "4", "b": [0.1799, 0.8602, 0.1925, 0.88]}, {"w": "Iterates", "b": [0.1988, 0.8602, 0.2814, 0.88]}, {"w": "over", "b": [0.2877, 0.8602, 0.3354, 0.88]}, {"w": "the", "b": [0.3417, 0.8602, 0.3753, 0.88]}, {"w": "rows", "b": [0.3816, 0.8602, 0.433, 0.88]}, {"w": "of", "b": [0.4393, 0.8602, 0.4603, 0.88]}, {"w": "x", "b": [0.4666, 0.8602, 0.4792, 0.88]}, {"w": "...", "b": [0.4855, 0.8602, 0.5044, 0.88]}, {"w": "5", "b": [0.1799, 0.8807, 0.1925, 0.9005]}, {"w": "...", "b": [0.1988, 0.8807, 0.2177, 0.9005]}, {"w": "and", "b": [0.224, 0.8807, 0.2647, 0.9005]}, {"w": "over", "b": [0.271, 0.8807, 0.3186, 0.9005]}, {"w": "the", "b": [0.3249, 0.8807, 0.3585, 0.9005]}, {"w": "columns", "b": [0.3648, 0.8807, 0.4545, 0.9005]}, {"w": "of", "b": [0.4609, 0.8807, 0.4819, 0.9005]}, {"w": "y.", "b": [0.4882, 0.8807, 0.5057, 0.9005]}]}]}, {"page": 78, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "To understand dot-product shape compatibility, it helps to visualize the input and output tensors by aligning them as shown in figure 2.5.", "words": [{"w": "To", "b": [0.1294, 0.0857, 0.1557, 0.1054]}, {"w": "understand", "b": [0.162, 0.0857, 0.2727, 0.1054]}, {"w": "dot-product", "b": [0.279, 0.0857, 0.3967, 0.1054]}, {"w": "shape", "b": [0.403, 0.0857, 0.4604, 0.1054]}, {"w": "compatibility,", "b": [0.4667, 0.0857, 0.6059, 0.1054]}, {"w": "it", "b": [0.6122, 0.0857, 0.6262, 0.1054]}, {"w": "helps", "b": [0.6325, 0.0857, 0.6858, 0.1054]}, {"w": "to", "b": [0.6921, 0.0857, 0.7117, 0.1054]}, {"w": "visualize", "b": [0.718, 0.0857, 0.8077, 0.1054]}, {"w": "the", "b": [0.814, 0.0857, 0.8448, 0.1054]}, {"w": "input", "b": [0.1294, 0.1062, 0.1813, 0.1259]}, {"w": "and", "b": [0.1876, 0.1062, 0.224, 0.1259]}, {"w": "output", "b": [0.2303, 0.1062, 0.2948, 0.1259]}, {"w": "tensors", "b": [0.3011, 0.1062, 0.3726, 0.1259]}, {"w": "by", "b": [0.3789, 0.1062, 0.4041, 0.1259]}, {"w": "aligning", "b": [0.4104, 0.1062, 0.4931, 0.1259]}, {"w": "them", "b": [0.4994, 0.1062, 0.5498, 0.1259]}, {"w": "as", "b": [0.5562, 0.1062, 0.5772, 0.1259]}, {"w": "shown", "b": [0.5835, 0.1062, 0.6493, 0.1259]}, {"w": "in", "b": [0.6556, 0.1062, 0.6752, 0.1259]}, {"w": "figure", "b": [0.6815, 0.1062, 0.7418, 0.1259]}, {"w": "2.5.", "b": [0.7481, 0.1062, 0.7859, 0.1259]}]}, {"id": "b_1", "type": "equation", "text": "Figure 2.5. Matrix dot-product box diagram", "words": [{"w": "Figure", "b": [0.1294, 0.144, 0.1827, 0.1588]}, {"w": "2.5.", "b": [0.1874, 0.144, 0.2158, 0.1588]}, {"w": "Matrix", "b": [0.2205, 0.144, 0.2772, 0.1588]}, {"w": "dot-product", "b": [0.2819, 0.144, 0.3783, 0.1588]}, {"w": "box", "b": [0.383, 0.144, 0.4125, 0.1588]}, {"w": "diagram", "b": [0.4172, 0.144, 0.4855, 0.1588]}]}, {"id": "b_2", "type": "paragraph", "text": "x, y, and z are pictured as rectangles (literal boxes of coefficients). Because the rows and x and the columns of y must have the same size, it follows that the width of x must match the height of y. If you go on to develop new machine-learning algorithms, you’ll likely be drawing such diagrams often.", "words": [{"w": "x,", "b": [0.1294, 0.4725, 0.1509, 0.4937]}, {"w": "y,", "b": [0.1572, 0.4725, 0.1786, 0.4937]}, {"w": "and", "b": [0.1849, 0.4725, 0.2213, 0.4922]}, {"w": "z", "b": [0.2276, 0.4736, 0.2428, 0.4937]}, {"w": "are", "b": [0.2491, 0.4725, 0.2799, 0.4922]}, {"w": "pictured", "b": [0.2862, 0.4725, 0.3688, 0.4922]}, {"w": "as", "b": [0.3752, 0.4725, 0.3962, 0.4922]}, {"w": "rectangles", "b": [0.4025, 0.4725, 0.5047, 0.4922]}, {"w": "(literal", "b": [0.511, 0.4725, 0.5783, 0.4922]}, {"w": "boxes", "b": [0.5846, 0.4725, 0.6435, 0.4922]}, {"w": "of", "b": [0.6498, 0.4725, 0.6708, 0.4922]}, {"w": "coefficients).", "b": [0.6771, 0.4725, 0.8089, 0.4922]}, {"w": "Because", "b": [0.1294, 0.4939, 0.2135, 0.5136]}, {"w": "the", "b": [0.2198, 0.4939, 0.2506, 0.5136]}, {"w": "rows", "b": [0.2569, 0.4939, 0.3059, 0.5136]}, {"w": "and", "b": [0.3122, 0.4939, 0.3487, 0.5136]}, {"w": "x", "b": [0.355, 0.4949, 0.3701, 0.5151]}, {"w": "and", "b": [0.3764, 0.4939, 0.4128, 0.5136]}, {"w": "the", "b": [0.4191, 0.4939, 0.45, 0.5136]}, {"w": "columns", "b": [0.4563, 0.4939, 0.5418, 0.5136]}, {"w": "of", "b": [0.5481, 0.4939, 0.5691, 0.5136]}, {"w": "y", "b": [0.5754, 0.4949, 0.5905, 0.5151]}, {"w": "must", "b": [0.5968, 0.4939, 0.6459, 0.5136]}, {"w": "have", "b": [0.6522, 0.4939, 0.6998, 0.5136]}, {"w": "the", "b": [0.7061, 0.4939, 0.7369, 0.5136]}, {"w": "same", "b": [0.7432, 0.4939, 0.7951, 0.5136]}, {"w": "size,", "b": [0.8014, 0.4939, 0.8469, 0.5136]}, {"w": "it", "b": [0.8532, 0.4939, 0.8672, 0.5136]}, {"w": "follows", "b": [0.1294, 0.5153, 0.2051, 0.535]}, {"w": "that", "b": [0.2114, 0.5153, 0.2492, 0.535]}, {"w": "the", "b": [0.2555, 0.5153, 0.2864, 0.535]}, {"w": "width", "b": [0.2927, 0.5153, 0.3501, 0.535]}, {"w": "of", "b": [0.3564, 0.5153, 0.3775, 0.535]}, {"w": "x", "b": [0.3837, 0.5163, 0.3989, 0.5365]}, {"w": "must", "b": [0.4052, 0.5153, 0.4542, 0.535]}, {"w": "match", "b": [0.4605, 0.5153, 0.5222, 0.535]}, {"w": "the", "b": [0.5285, 0.5153, 0.5593, 0.535]}, {"w": "height", "b": [0.5656, 0.5153, 0.6287, 0.535]}, {"w": "of", "b": [0.635, 0.5153, 0.656, 0.535]}, {"w": "y.", "b": [0.6623, 0.5153, 0.6837, 0.5365]}, {"w": "If", "b": [0.69, 0.5153, 0.7068, 0.535]}, {"w": "you", "b": [0.7131, 0.5153, 0.751, 0.535]}, {"w": "go", "b": [0.7573, 0.5153, 0.7825, 0.535]}, {"w": "on", "b": [0.7888, 0.5153, 0.814, 0.535]}, {"w": "to", "b": [0.8203, 0.5153, 0.84, 0.535]}, {"w": "develop", "b": [0.1294, 0.5367, 0.2093, 0.5564]}, {"w": "new", "b": [0.2156, 0.5367, 0.2576, 0.5564]}, {"w": "machine-learning", "b": [0.2639, 0.5367, 0.4404, 0.5564]}, {"w": "algorithms,", "b": [0.4468, 0.5367, 0.561, 0.5564]}, {"w": "you’ll", "b": [0.5673, 0.5367, 0.6275, 0.5564]}, {"w": "likely", "b": [0.6339, 0.5367, 0.6913, 0.5564]}, {"w": "be", "b": [0.6976, 0.5367, 0.7214, 0.5564]}, {"w": "drawing", "b": [0.7277, 0.5367, 0.8104, 0.5564]}, {"w": "such", "b": [0.8167, 0.5367, 0.863, 0.5564]}, {"w": "diagrams", "b": [0.1294, 0.5572, 0.2219, 0.5769]}, {"w": "often.", "b": [0.2282, 0.5572, 0.2863, 0.5769]}]}, {"id": "b_3", "type": "paragraph", "text": "More generally, you can take the dot product between higher- dimensional tensors, following the same rules for shape compatibility as outlined earlier for the 2D case:", "words": [{"w": "More", "b": [0.1294, 0.6, 0.1841, 0.6197]}, {"w": "generally,", "b": [0.1904, 0.6, 0.2889, 0.6197]}, {"w": "you", "b": [0.2952, 0.6, 0.333, 0.6197]}, {"w": "can", "b": [0.3393, 0.6, 0.3743, 0.6197]}, {"w": "take", "b": [0.3806, 0.6, 0.4227, 0.6197]}, {"w": "the", "b": [0.429, 0.6, 0.4598, 0.6197]}, {"w": "dot", "b": [0.4661, 0.6, 0.4983, 0.6197]}, {"w": "product", "b": [0.5047, 0.6, 0.5817, 0.6197]}, {"w": "between", "b": [0.588, 0.6, 0.6721, 0.6197]}, {"w": "higher-", "b": [0.6784, 0.6, 0.7507, 0.6197]}, {"w": "dimensional", "b": [0.1294, 0.6205, 0.2527, 0.6402]}, {"w": "tensors,", "b": [0.259, 0.6205, 0.3368, 0.6402]}, {"w": "following", "b": [0.3431, 0.6205, 0.4412, 0.6402]}, {"w": "the", "b": [0.4475, 0.6205, 0.4784, 0.6402]}, {"w": "same", "b": [0.4847, 0.6205, 0.5365, 0.6402]}, {"w": "rules", "b": [0.5428, 0.6205, 0.5919, 0.6402]}, {"w": "for", "b": [0.5982, 0.6205, 0.6276, 0.6402]}, {"w": "shape", "b": [0.6339, 0.6205, 0.6913, 0.6402]}, {"w": "compatibility", "b": [0.6976, 0.6205, 0.8322, 0.6402]}, {"w": "as", "b": [0.8384, 0.6205, 0.8594, 0.6402]}, {"w": "outlined", "b": [0.1294, 0.641, 0.2121, 0.6607]}, {"w": "earlier", "b": [0.2184, 0.641, 0.2828, 0.6607]}, {"w": "for", "b": [0.2891, 0.641, 0.3186, 0.6607]}, {"w": "the", "b": [0.3249, 0.641, 0.3557, 0.6607]}, {"w": "2D", "b": [0.362, 0.641, 0.3928, 0.6607]}, {"w": "case:", "b": [0.3991, 0.641, 0.4496, 0.6607]}]}, {"id": "b_4", "type": "equation", "text": "(a, b, c, d) . (d,) -> (a, b, c) (a, b, c, d) . (d, e) -> (a, b, c, e)", "words": [{"w": "(a,", "b": [0.1357, 0.6787, 0.1698, 0.6938]}, {"w": "b,", "b": [0.1811, 0.6787, 0.2038, 0.6938]}, {"w": "c,", "b": [0.2152, 0.6787, 0.2379, 0.6938]}, {"w": "d)", "b": [0.2492, 0.6787, 0.2719, 0.6938]}, {"w": ".", "b": [0.2833, 0.6787, 0.2946, 0.6938]}, {"w": "(d,)", "b": [0.306, 0.6787, 0.3514, 0.6938]}, {"w": "->", "b": [0.3628, 0.6787, 0.3855, 0.6938]}, {"w": "(a,", "b": [0.3968, 0.6787, 0.4309, 0.6938]}, {"w": "b,", "b": [0.4422, 0.6787, 0.4649, 0.6938]}, {"w": "c)", "b": [0.4763, 0.6787, 0.499, 0.6938]}, {"w": "(a,", "b": [0.1357, 0.6939, 0.1698, 0.709]}, {"w": "b,", "b": [0.1811, 0.6939, 0.2038, 0.709]}, {"w": "c,", "b": [0.2152, 0.6939, 0.2379, 0.709]}, {"w": "d)", "b": [0.2492, 0.6939, 0.2719, 0.709]}, {"w": ".", "b": [0.2833, 0.6939, 0.2946, 0.709]}, {"w": "(d,", "b": [0.306, 0.6939, 0.34, 0.709]}, {"w": "e)", "b": [0.3514, 0.6939, 0.3741, 0.709]}, {"w": "->", "b": [0.3855, 0.6939, 0.4082, 0.709]}, {"w": "(a,", "b": [0.4195, 0.6939, 0.4536, 0.709]}, {"w": "b,", "b": [0.4649, 0.6939, 0.4876, 0.709]}, {"w": "c,", "b": [0.499, 0.6939, 0.5217, 0.709]}, {"w": "e)", "b": [0.533, 0.6939, 0.5557, 0.709]}]}, {"id": "b_5", "type": "paragraph", "text": "And so on.", "words": [{"w": "And", "b": [0.1294, 0.7319, 0.1729, 0.7516]}, {"w": "so", "b": [0.1792, 0.7319, 0.2016, 0.7516]}, {"w": "on.", "b": [0.2079, 0.7319, 0.2394, 0.7516]}]}, {"id": "b_6", "type": "paragraph", "text": "2.3.4. Tensor reshaping", "words": [{"w": "2.3.4.", "b": [0.1294, 0.7791, 0.1862, 0.7989]}, {"w": "Tensor", "b": [0.1925, 0.7791, 0.2658, 0.7989]}, {"w": "reshaping", "b": [0.2721, 0.7791, 0.3782, 0.7989]}]}, {"id": "b_7", "type": "paragraph", "text": "A third type of tensor operation that’s essential to understand is tensor reshaping. Although it wasn’t used in the Dense layers in our first neural network example, we used it when we preprocessed the digits data before feeding it into our network:", "words": [{"w": "A", "b": [0.1294, 0.8219, 0.1476, 0.8416]}, {"w": "third", "b": [0.1539, 0.8219, 0.2016, 0.8416]}, {"w": "type", "b": [0.2079, 0.8219, 0.2513, 0.8416]}, {"w": "of", "b": [0.2576, 0.8219, 0.2786, 0.8416]}, {"w": "tensor", "b": [0.285, 0.8219, 0.3466, 0.8416]}, {"w": "operation", "b": [0.3529, 0.8219, 0.4482, 0.8416]}, {"w": "that’s", "b": [0.4545, 0.8219, 0.5091, 0.8416]}, {"w": "essential", "b": [0.5154, 0.8219, 0.6023, 0.8416]}, {"w": "to", "b": [0.6086, 0.8219, 0.6282, 0.8416]}, {"w": "understand", "b": [0.6345, 0.8219, 0.7452, 0.8416]}, {"w": "is", "b": [0.7515, 0.8219, 0.7684, 0.8416]}, {"w": "tensor", "b": [0.7746, 0.8219, 0.8377, 0.8416]}, {"w": "reshaping.", "b": [0.1294, 0.8424, 0.2357, 0.8621]}, {"w": "Although", "b": [0.242, 0.8424, 0.3373, 0.8621]}, {"w": "it", "b": [0.3436, 0.8424, 0.3576, 0.8621]}, {"w": "wasn’t", "b": [0.3639, 0.8424, 0.4307, 0.8621]}, {"w": "used", "b": [0.437, 0.8424, 0.4833, 0.8621]}, {"w": "in", "b": [0.4896, 0.8424, 0.5092, 0.8621]}, {"w": "the", "b": [0.5155, 0.8424, 0.5463, 0.8621]}, {"w": "Dense", "b": [0.5526, 0.8434, 0.6283, 0.8636]}, {"w": "layers", "b": [0.6346, 0.8424, 0.6948, 0.8621]}, {"w": "in", "b": [0.7011, 0.8424, 0.7207, 0.8621]}, {"w": "our", "b": [0.7271, 0.8424, 0.7607, 0.8621]}, {"w": "first", "b": [0.767, 0.8424, 0.8076, 0.8621]}, {"w": "neural", "b": [0.1294, 0.8638, 0.1925, 0.8835]}, {"w": "network", "b": [0.1988, 0.8638, 0.2814, 0.8835]}, {"w": "example,", "b": [0.2877, 0.8638, 0.3795, 0.8835]}, {"w": "we", "b": [0.3858, 0.8638, 0.4152, 0.8835]}, {"w": "used", "b": [0.4215, 0.8638, 0.4678, 0.8835]}, {"w": "it", "b": [0.4741, 0.8638, 0.4881, 0.8835]}, {"w": "when", "b": [0.4944, 0.8638, 0.549, 0.8835]}, {"w": "we", "b": [0.5553, 0.8638, 0.5848, 0.8835]}, {"w": "preprocessed", "b": [0.5911, 0.8638, 0.7227, 0.8835]}, {"w": "the", "b": [0.7291, 0.8638, 0.7599, 0.8835]}, {"w": "digits", "b": [0.7662, 0.8638, 0.8223, 0.8835]}, {"w": "data", "b": [0.8286, 0.8638, 0.8706, 0.8835]}, {"w": "before", "b": [0.1294, 0.8843, 0.1938, 0.904]}, {"w": "feeding", "b": [0.2001, 0.8843, 0.2758, 0.904]}, {"w": "it", "b": [0.2821, 0.8843, 0.2961, 0.904]}, {"w": "into", "b": [0.3024, 0.8843, 0.3417, 0.904]}, {"w": "our", "b": [0.348, 0.8843, 0.3816, 0.904]}, {"w": "network:", "b": [0.3879, 0.8843, 0.4776, 0.904]}]}]}, {"page": 79, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "train_images = train_images.reshape((60000, 28 * 28))", "words": [{"w": "train_images", "b": [0.1357, 0.0851, 0.2719, 0.1002]}, {"w": "=", "b": [0.2833, 0.0851, 0.2946, 0.1002]}, {"w": "train_images.reshape((60000,", "b": [0.306, 0.0851, 0.6238, 0.1002]}, {"w": "28", "b": [0.6352, 0.0851, 0.6579, 0.1002]}, {"w": "*", "b": [0.6692, 0.0851, 0.6806, 0.1002]}, {"w": "28))", "b": [0.6919, 0.0851, 0.7374, 0.1002]}]}, {"id": "b_1", "type": "paragraph", "text": "Reshaping a tensor means rearranging its rows and columns to match a target shape. Naturally, the reshaped tensor has the same total number of coefficients as the initial tensor. Reshaping is best understood via simple examples:", "words": [{"w": "Reshaping", "b": [0.1294, 0.1231, 0.2359, 0.1429]}, {"w": "a", "b": [0.2422, 0.1231, 0.2534, 0.1429]}, {"w": "tensor", "b": [0.2597, 0.1231, 0.3214, 0.1429]}, {"w": "means", "b": [0.3277, 0.1231, 0.3921, 0.1429]}, {"w": "rearranging", "b": [0.3984, 0.1231, 0.5147, 0.1429]}, {"w": "its", "b": [0.521, 0.1231, 0.5449, 0.1429]}, {"w": "rows", "b": [0.5512, 0.1231, 0.6002, 0.1429]}, {"w": "and", "b": [0.6065, 0.1231, 0.6429, 0.1429]}, {"w": "columns", "b": [0.6492, 0.1231, 0.7347, 0.1429]}, {"w": "to", "b": [0.741, 0.1231, 0.7607, 0.1429]}, {"w": "match", "b": [0.767, 0.1231, 0.8286, 0.1429]}, {"w": "a", "b": [0.8349, 0.1231, 0.8461, 0.1429]}, {"w": "target", "b": [0.1294, 0.1436, 0.1864, 0.1634]}, {"w": "shape.", "b": [0.1927, 0.1436, 0.2564, 0.1634]}, {"w": "Naturally,", "b": [0.2627, 0.1436, 0.3627, 0.1634]}, {"w": "the", "b": [0.369, 0.1436, 0.3998, 0.1634]}, {"w": "reshaped", "b": [0.4061, 0.1436, 0.4958, 0.1634]}, {"w": "tensor", "b": [0.5021, 0.1436, 0.5637, 0.1634]}, {"w": "has", "b": [0.57, 0.1436, 0.6036, 0.1634]}, {"w": "the", "b": [0.61, 0.1436, 0.6408, 0.1634]}, {"w": "same", "b": [0.6471, 0.1436, 0.6989, 0.1634]}, {"w": "total", "b": [0.7052, 0.1436, 0.75, 0.1634]}, {"w": "number", "b": [0.7564, 0.1436, 0.8334, 0.1634]}, {"w": "of", "b": [0.8397, 0.1436, 0.8607, 0.1634]}, {"w": "coefficients", "b": [0.1294, 0.1641, 0.2466, 0.1839]}, {"w": "as", "b": [0.2529, 0.1641, 0.2739, 0.1839]}, {"w": "the", "b": [0.2803, 0.1641, 0.3111, 0.1839]}, {"w": "initial", "b": [0.3174, 0.1641, 0.3763, 0.1839]}, {"w": "tensor.", "b": [0.3826, 0.1641, 0.4491, 0.1839]}, {"w": "Reshaping", "b": [0.4554, 0.1641, 0.5619, 0.1839]}, {"w": "is", "b": [0.5682, 0.1641, 0.585, 0.1839]}, {"w": "best", "b": [0.5913, 0.1641, 0.632, 0.1839]}, {"w": "understood", "b": [0.6383, 0.1641, 0.7504, 0.1839]}, {"w": "via", "b": [0.7567, 0.1641, 0.7875, 0.1839]}, {"w": "simple", "b": [0.7938, 0.1641, 0.8611, 0.1839]}, {"w": "examples:", "b": [0.1294, 0.1846, 0.2317, 0.2044]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> x = np.array([[0., 1.], [2., 3.], [4., 5.]]) >>> print(x.shape) (3, 2) >>> x = x.reshape((6, 1)) >>> x array([[ 0.], [ 1.], [ 2.], [ 3.], [ 4.], [ 5.]]) >>> x = x.reshape((2, 3)) >>> x array([[ 0., 1., 2.], [ 3., 4., 5.]])", "words": [{"w": ">>>", "b": [0.1357, 0.2223, 0.1698, 0.2375]}, {"w": "x", "b": [0.1811, 0.2223, 0.1925, 0.2375]}, {"w": "=", "b": [0.2038, 0.2223, 0.2152, 0.2375]}, {"w": "np.array([[0.,", "b": [0.2265, 0.2223, 0.3855, 0.2375]}, {"w": "1.],", "b": [0.3968, 0.2223, 0.4422, 0.2375]}, {"w": "[2.,", "b": [0.3287, 0.2375, 0.3741, 0.2526]}, {"w": "3.],", "b": [0.3855, 0.2375, 0.4309, 0.2526]}, {"w": "[4.,", "b": [0.3287, 0.2527, 0.3741, 0.2678]}, {"w": "5.]])", "b": [0.3855, 0.2527, 0.4422, 0.2678]}, {"w": ">>>", "b": [0.1357, 0.2678, 0.1698, 0.2829]}, {"w": "print(x.shape)", "b": [0.1811, 0.2678, 0.34, 0.2829]}, {"w": "(3,", "b": [0.1357, 0.283, 0.1698, 0.2981]}, {"w": "2)", "b": [0.1811, 0.283, 0.2038, 0.2981]}, {"w": ">>>", "b": [0.1357, 0.3133, 0.1698, 0.3284]}, {"w": "x", "b": [0.1811, 0.3133, 0.1925, 0.3284]}, {"w": "=", "b": [0.2038, 0.3133, 0.2152, 0.3284]}, {"w": "x.reshape((6,", "b": [0.2265, 0.3133, 0.3741, 0.3284]}, {"w": "1))", "b": [0.3855, 0.3133, 0.4195, 0.3284]}, {"w": ">>>", "b": [0.1357, 0.3284, 0.1698, 0.3436]}, {"w": "x", "b": [0.1811, 0.3284, 0.1925, 0.3436]}, {"w": "array([[", "b": [0.1357, 0.3436, 0.2265, 0.3587]}, {"w": "0.],", "b": [0.2379, 0.3436, 0.2833, 0.3587]}, {"w": "[", "b": [0.2152, 0.3587, 0.2265, 0.3739]}, {"w": "1.],", "b": [0.2379, 0.3587, 0.2833, 0.3739]}, {"w": "[", "b": [0.2152, 0.3739, 0.2265, 0.389]}, {"w": "2.],", "b": [0.2379, 0.3739, 0.2833, 0.389]}, {"w": "[", "b": [0.2152, 0.389, 0.2265, 0.4042]}, {"w": "3.],", "b": [0.2379, 0.389, 0.2833, 0.4042]}, {"w": "[", "b": [0.2152, 0.4042, 0.2265, 0.4193]}, {"w": "4.],", "b": [0.2379, 0.4042, 0.2833, 0.4193]}, {"w": "[", "b": [0.2152, 0.4193, 0.2265, 0.4345]}, {"w": "5.]])", "b": [0.2379, 0.4193, 0.2946, 0.4345]}, {"w": ">>>", "b": [0.1471, 0.4496, 0.1811, 0.4648]}, {"w": "x", "b": [0.1925, 0.4496, 0.2038, 0.4648]}, {"w": "=", "b": [0.2152, 0.4496, 0.2265, 0.4648]}, {"w": "x.reshape((2,", "b": [0.2379, 0.4496, 0.3855, 0.4648]}, {"w": "3))", "b": [0.3968, 0.4496, 0.4309, 0.4648]}, {"w": ">>>", "b": [0.1471, 0.4648, 0.1811, 0.4799]}, {"w": "x", "b": [0.1925, 0.4648, 0.2038, 0.4799]}, {"w": "array([[", "b": [0.1471, 0.4799, 0.2379, 0.4951]}, {"w": "0.,", "b": [0.2492, 0.4799, 0.2833, 0.4951]}, {"w": "1.,", "b": [0.306, 0.4799, 0.34, 0.4951]}, {"w": "2.],", "b": [0.3628, 0.4799, 0.4082, 0.4951]}, {"w": "[", "b": [0.2265, 0.4951, 0.2379, 0.5102]}, {"w": "3.,", "b": [0.2492, 0.4951, 0.2833, 0.5102]}, {"w": "4.,", "b": [0.306, 0.4951, 0.34, 0.5102]}, {"w": "5.]])", "b": [0.3628, 0.4951, 0.4195, 0.5102]}]}, {"id": "b_3", "type": "paragraph", "text": "A special case of reshaping that’s commonly encountered is transposition. Transposing a matrix means exchanging its rows and its columns, so that x[i, :] becomes x[:, i]:", "words": [{"w": "A", "b": [0.1294, 0.5331, 0.1476, 0.5529]}, {"w": "special", "b": [0.1539, 0.5331, 0.224, 0.5529]}, {"w": "case", "b": [0.2303, 0.5331, 0.2737, 0.5529]}, {"w": "of", "b": [0.28, 0.5331, 0.301, 0.5529]}, {"w": "reshaping", "b": [0.3073, 0.5331, 0.4054, 0.5529]}, {"w": "that’s", "b": [0.4117, 0.5331, 0.4663, 0.5529]}, {"w": "commonly", "b": [0.4726, 0.5331, 0.5806, 0.5529]}, {"w": "encountered", "b": [0.5869, 0.5331, 0.7101, 0.5529]}, {"w": "is", "b": [0.7164, 0.5331, 0.7333, 0.5529]}, {"w": "transposition.", "b": [0.1294, 0.5536, 0.2689, 0.5734]}, {"w": "Transposing", "b": [0.2752, 0.5536, 0.3999, 0.5734]}, {"w": "a", "b": [0.4062, 0.5536, 0.4174, 0.5734]}, {"w": "matrix", "b": [0.4238, 0.5536, 0.4896, 0.5734]}, {"w": "means", "b": [0.4959, 0.5536, 0.5604, 0.5734]}, {"w": "exchanging", "b": [0.5667, 0.5536, 0.683, 0.5734]}, {"w": "its", "b": [0.6893, 0.5536, 0.7131, 0.5734]}, {"w": "rows", "b": [0.7194, 0.5536, 0.7685, 0.5734]}, {"w": "and", "b": [0.7748, 0.5536, 0.8112, 0.5734]}, {"w": "its", "b": [0.8175, 0.5536, 0.8413, 0.5734]}, {"w": "columns,", "b": [0.1294, 0.5741, 0.2212, 0.5939]}, {"w": "so", "b": [0.2275, 0.5741, 0.2499, 0.5939]}, {"w": "that", "b": [0.2562, 0.5741, 0.2941, 0.5939]}, {"w": "x[i,", "b": [0.3004, 0.5752, 0.3609, 0.5954]}, {"w": ":]", "b": [0.3761, 0.5752, 0.4063, 0.5954]}, {"w": "becomes", "b": [0.4126, 0.5741, 0.5009, 0.5939]}, {"w": "x[:,", "b": [0.5072, 0.5752, 0.5677, 0.5954]}, {"w": "i]:", "b": [0.5829, 0.5741, 0.6201, 0.5954]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> x = np.zeros((300, 20)) 1 >>> x = np.transpose(x) >>> print(x.shape) (20, 300)", "words": [{"w": ">>>", "b": [0.1357, 0.6127, 0.1698, 0.6279]}, {"w": "x", "b": [0.1811, 0.6127, 0.1925, 0.6279]}, {"w": "=", "b": [0.2038, 0.6127, 0.2152, 0.6279]}, {"w": "np.zeros((300,", "b": [0.2265, 0.6127, 0.3855, 0.6279]}, {"w": "20))", "b": [0.3968, 0.6127, 0.4422, 0.6279]}, {"w": "1", "b": [0.5444, 0.6127, 0.5558, 0.6279]}, {"w": ">>>", "b": [0.1357, 0.6279, 0.1698, 0.643]}, {"w": "x", "b": [0.1811, 0.6279, 0.1925, 0.643]}, {"w": "=", "b": [0.2038, 0.6279, 0.2152, 0.643]}, {"w": "np.transpose(x)", "b": [0.2265, 0.6279, 0.3968, 0.643]}, {"w": ">>>", "b": [0.1357, 0.643, 0.1698, 0.6582]}, {"w": "print(x.shape)", "b": [0.1811, 0.643, 0.34, 0.6582]}, {"w": "(20,", "b": [0.1357, 0.6582, 0.1811, 0.6733]}, {"w": "300)", "b": [0.1925, 0.6582, 0.2379, 0.6733]}]}, {"id": "b_5", "type": "equation", "text": "1 Creates an all-zeros matrix of shape (300, 20)", "words": [{"w": "1", "b": [0.1799, 0.6918, 0.1925, 0.7115]}, {"w": "Creates", "b": [0.1988, 0.6918, 0.281, 0.7115]}, {"w": "an", "b": [0.2873, 0.6918, 0.3139, 0.7115]}, {"w": "all-zeros", "b": [0.3202, 0.6918, 0.4108, 0.7115]}, {"w": "matrix", "b": [0.4171, 0.6918, 0.49, 0.7115]}, {"w": "of", "b": [0.4963, 0.6918, 0.5173, 0.7115]}, {"w": "shape", "b": [0.5236, 0.6918, 0.5853, 0.7115]}, {"w": "(300,", "b": [0.5916, 0.6918, 0.6441, 0.7115]}, {"w": "20)", "b": [0.6504, 0.6918, 0.6841, 0.7115]}]}, {"id": "b_6", "type": "paragraph", "text": "2.3.5. Geometric interpretation of tensor operations", "words": [{"w": "2.3.5.", "b": [0.1294, 0.739, 0.1862, 0.7588]}, {"w": "Geometric", "b": [0.1925, 0.739, 0.3059, 0.7588]}, {"w": "interpretation", "b": [0.3122, 0.739, 0.4631, 0.7588]}, {"w": "of", "b": [0.4694, 0.739, 0.4904, 0.7588]}, {"w": "tensor", "b": [0.4967, 0.739, 0.564, 0.7588]}, {"w": "operations", "b": [0.5703, 0.739, 0.6838, 0.7588]}]}, {"id": "b_7", "type": "paragraph", "text": "Because the contents of the tensors manipulated by tensor operations can be interpreted as coordinates of points in some geometric space, all tensor operations have a geometric interpretation. For instance, let’s consider addition. We’ll start with the following vector:", "words": [{"w": "Because", "b": [0.1294, 0.7818, 0.2135, 0.8015]}, {"w": "the", "b": [0.2198, 0.7818, 0.2506, 0.8015]}, {"w": "contents", "b": [0.2569, 0.7818, 0.341, 0.8015]}, {"w": "of", "b": [0.3473, 0.7818, 0.3683, 0.8015]}, {"w": "the", "b": [0.3746, 0.7818, 0.4054, 0.8015]}, {"w": "tensors", "b": [0.4117, 0.7818, 0.4832, 0.8015]}, {"w": "manipulated", "b": [0.4895, 0.7818, 0.6142, 0.8015]}, {"w": "by", "b": [0.6205, 0.7818, 0.6458, 0.8015]}, {"w": "tensor", "b": [0.6521, 0.7818, 0.7137, 0.8015]}, {"w": "operations", "b": [0.72, 0.7818, 0.8251, 0.8015]}, {"w": "can", "b": [0.8314, 0.7818, 0.8664, 0.8015]}, {"w": "be", "b": [0.1294, 0.8023, 0.1532, 0.822]}, {"w": "interpreted", "b": [0.1595, 0.8023, 0.2688, 0.822]}, {"w": "as", "b": [0.2751, 0.8023, 0.2961, 0.822]}, {"w": "coordinates", "b": [0.3024, 0.8023, 0.4187, 0.822]}, {"w": "of", "b": [0.425, 0.8023, 0.446, 0.822]}, {"w": "points", "b": [0.4524, 0.8023, 0.514, 0.822]}, {"w": "in", "b": [0.5203, 0.8023, 0.54, 0.822]}, {"w": "some", "b": [0.5463, 0.8023, 0.5995, 0.822]}, {"w": "geometric", "b": [0.6058, 0.8023, 0.7067, 0.822]}, {"w": "space,", "b": [0.7129, 0.8023, 0.7752, 0.822]}, {"w": "all", "b": [0.7816, 0.8023, 0.8068, 0.822]}, {"w": "tensor", "b": [0.1294, 0.8228, 0.1911, 0.8425]}, {"w": "operations", "b": [0.1974, 0.8228, 0.3025, 0.8425]}, {"w": "have", "b": [0.3088, 0.8228, 0.3564, 0.8425]}, {"w": "a", "b": [0.3627, 0.8228, 0.3739, 0.8425]}, {"w": "geometric", "b": [0.3802, 0.8228, 0.4811, 0.8425]}, {"w": "interpretation.", "b": [0.4874, 0.8228, 0.6296, 0.8425]}, {"w": "For", "b": [0.6359, 0.8228, 0.671, 0.8425]}, {"w": "instance,", "b": [0.6773, 0.8228, 0.7662, 0.8425]}, {"w": "let’s", "b": [0.7725, 0.8228, 0.8145, 0.8425]}, {"w": "consider", "b": [0.1294, 0.8433, 0.2149, 0.863]}, {"w": "addition.", "b": [0.2212, 0.8433, 0.3102, 0.863]}, {"w": "We’ll", "b": [0.3165, 0.8433, 0.3719, 0.863]}, {"w": "start", "b": [0.3782, 0.8433, 0.4216, 0.863]}, {"w": "with", "b": [0.4279, 0.8433, 0.4728, 0.863]}, {"w": "the", "b": [0.4791, 0.8433, 0.5099, 0.863]}, {"w": "following", "b": [0.5162, 0.8433, 0.6143, 0.863]}, {"w": "vector:", "b": [0.6206, 0.8433, 0.6906, 0.863]}]}, {"id": "b_8", "type": "equation", "text": "A = [0.5, 1]", "words": [{"w": "A", "b": [0.1357, 0.881, 0.1471, 0.8962]}, {"w": "=", "b": [0.1584, 0.881, 0.1698, 0.8962]}, {"w": "[0.5,", "b": [0.1811, 0.881, 0.2379, 0.8962]}, {"w": "1]", "b": [0.2492, 0.881, 0.2719, 0.8962]}]}]}, {"page": 80, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "It’s a point in a 2D space (see figure 2.6). It’s common to picture a vector as an arrow linking the origin to the point, as shown in figure 2.7.", "words": [{"w": "It’s", "b": [0.1294, 0.0857, 0.1616, 0.1054]}, {"w": "a", "b": [0.1679, 0.0857, 0.1791, 0.1054]}, {"w": "point", "b": [0.1855, 0.0857, 0.2373, 0.1054]}, {"w": "in", "b": [0.2436, 0.0857, 0.2633, 0.1054]}, {"w": "a", "b": [0.2696, 0.0857, 0.2808, 0.1054]}, {"w": "2D", "b": [0.2871, 0.0857, 0.3179, 0.1054]}, {"w": "space", "b": [0.3242, 0.0857, 0.3802, 0.1054]}, {"w": "(see", "b": [0.3865, 0.0857, 0.4271, 0.1054]}, {"w": "figure", "b": [0.4334, 0.0857, 0.4937, 0.1054]}, {"w": "2.6).", "b": [0.5, 0.0857, 0.5462, 0.1054]}, {"w": "It’s", "b": [0.5525, 0.0857, 0.5847, 0.1054]}, {"w": "common", "b": [0.591, 0.0857, 0.6793, 0.1054]}, {"w": "to", "b": [0.6856, 0.0857, 0.7053, 0.1054]}, {"w": "picture", "b": [0.7116, 0.0857, 0.7816, 0.1054]}, {"w": "a", "b": [0.7879, 0.0857, 0.7991, 0.1054]}, {"w": "vector", "b": [0.8054, 0.0857, 0.8685, 0.1054]}, {"w": "as", "b": [0.1294, 0.1062, 0.1504, 0.1259]}, {"w": "an", "b": [0.1567, 0.1062, 0.1805, 0.1259]}, {"w": "arrow", "b": [0.1869, 0.1062, 0.2457, 0.1259]}, {"w": "linking", "b": [0.252, 0.1062, 0.3235, 0.1259]}, {"w": "the", "b": [0.3298, 0.1062, 0.3606, 0.1259]}, {"w": "origin", "b": [0.3669, 0.1062, 0.4272, 0.1259]}, {"w": "to", "b": [0.4335, 0.1062, 0.4531, 0.1259]}, {"w": "the", "b": [0.4594, 0.1062, 0.4902, 0.1259]}, {"w": "point,", "b": [0.4965, 0.1062, 0.5547, 0.1259]}, {"w": "as", "b": [0.561, 0.1062, 0.582, 0.1259]}, {"w": "shown", "b": [0.5883, 0.1062, 0.6542, 0.1259]}, {"w": "in", "b": [0.6605, 0.1062, 0.6801, 0.1259]}, {"w": "figure", "b": [0.6864, 0.1062, 0.7466, 0.1259]}, {"w": "2.7.", "b": [0.7529, 0.1062, 0.7908, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 2.6. A point in a 2D space", "words": [{"w": "Figure", "b": [0.1294, 0.144, 0.1827, 0.1588]}, {"w": "2.6.", "b": [0.1874, 0.144, 0.2158, 0.1588]}, {"w": "A", "b": [0.2205, 0.144, 0.2341, 0.1588]}, {"w": "point", "b": [0.2389, 0.144, 0.2809, 0.1588]}, {"w": "in", "b": [0.2857, 0.144, 0.3014, 0.1588]}, {"w": "a", "b": [0.3062, 0.144, 0.3156, 0.1588]}, {"w": "2D", "b": [0.3204, 0.144, 0.3435, 0.1588]}, {"w": "space", "b": [0.3482, 0.144, 0.3923, 0.1588]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 2.7. A point in a 2D space pictured as an arrow", "words": [{"w": "Figure", "b": [0.1294, 0.3695, 0.1827, 0.3843]}, {"w": "2.7.", "b": [0.1874, 0.3695, 0.2158, 0.3843]}, {"w": "A", "b": [0.2205, 0.3695, 0.2341, 0.3843]}, {"w": "point", "b": [0.2389, 0.3695, 0.2809, 0.3843]}, {"w": "in", "b": [0.2857, 0.3695, 0.3014, 0.3843]}, {"w": "a", "b": [0.3062, 0.3695, 0.3156, 0.3843]}, {"w": "2D", "b": [0.3204, 0.3695, 0.3435, 0.3843]}, {"w": "space", "b": [0.3482, 0.3695, 0.3923, 0.3843]}, {"w": "pictured", "b": [0.3971, 0.3695, 0.4651, 0.3843]}, {"w": "as", "b": [0.4698, 0.3695, 0.4866, 0.3843]}, {"w": "an", "b": [0.4913, 0.3695, 0.5113, 0.3843]}, {"w": "arrow", "b": [0.516, 0.3695, 0.5651, 0.3843]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s consider a new point, B = [1, 0.25], which we’ll add to the previous one. This is done geometrically by chaining together the vector arrows, with the resulting location being the vector representing the sum of the previous two vectors (see figure 2.8).", "words": [{"w": "Let’s", "b": [0.1294, 0.6, 0.1798, 0.6197]}, {"w": "consider", "b": [0.1862, 0.6, 0.2716, 0.6197]}, {"w": "a", "b": [0.2779, 0.6, 0.2891, 0.6197]}, {"w": "new", "b": [0.2954, 0.6, 0.3375, 0.6197]}, {"w": "point,", "b": [0.3438, 0.6, 0.4019, 0.6197]}, {"w": "B", "b": [0.4082, 0.601, 0.4234, 0.6212]}, {"w": "=", "b": [0.4385, 0.601, 0.4536, 0.6212]}, {"w": "[1,", "b": [0.4688, 0.601, 0.5142, 0.6212]}, {"w": "0.25],", "b": [0.5293, 0.6, 0.6113, 0.6212]}, {"w": "which", "b": [0.6176, 0.6, 0.6793, 0.6197]}, {"w": "we’ll", "b": [0.6856, 0.6, 0.7374, 0.6197]}, {"w": "add", "b": [0.7437, 0.6, 0.7801, 0.6197]}, {"w": "to", "b": [0.7864, 0.6, 0.8061, 0.6197]}, {"w": "the", "b": [0.8124, 0.6, 0.8432, 0.6197]}, {"w": "previous", "b": [0.1294, 0.6214, 0.2163, 0.6411]}, {"w": "one.", "b": [0.2226, 0.6214, 0.2653, 0.6411]}, {"w": "This", "b": [0.2716, 0.6214, 0.3165, 0.6411]}, {"w": "is", "b": [0.3228, 0.6214, 0.3396, 0.6411]}, {"w": "done", "b": [0.3459, 0.6214, 0.395, 0.6411]}, {"w": "geometrically", "b": [0.4013, 0.6214, 0.54, 0.6411]}, {"w": "by", "b": [0.5463, 0.6214, 0.5715, 0.6411]}, {"w": "chaining", "b": [0.5778, 0.6214, 0.6647, 0.6411]}, {"w": "together", "b": [0.671, 0.6214, 0.7537, 0.6411]}, {"w": "the", "b": [0.76, 0.6214, 0.7908, 0.6411]}, {"w": "vector", "b": [0.7971, 0.6214, 0.8602, 0.6411]}, {"w": "arrows,", "b": [0.1294, 0.6419, 0.2044, 0.6616]}, {"w": "with", "b": [0.2107, 0.6419, 0.2555, 0.6616]}, {"w": "the", "b": [0.2618, 0.6419, 0.2926, 0.6616]}, {"w": "resulting", "b": [0.299, 0.6419, 0.3872, 0.6616]}, {"w": "location", "b": [0.3935, 0.6419, 0.4748, 0.6616]}, {"w": "being", "b": [0.4811, 0.6419, 0.5371, 0.6616]}, {"w": "the", "b": [0.5435, 0.6419, 0.5743, 0.6616]}, {"w": "vector", "b": [0.5806, 0.6419, 0.6436, 0.6616]}, {"w": "representing", "b": [0.6499, 0.6419, 0.7746, 0.6616]}, {"w": "the", "b": [0.7809, 0.6419, 0.8118, 0.6616]}, {"w": "sum", "b": [0.8181, 0.6419, 0.8601, 0.6616]}, {"w": "of", "b": [0.1294, 0.6624, 0.1504, 0.6821]}, {"w": "the", "b": [0.1567, 0.6624, 0.1876, 0.6821]}, {"w": "previous", "b": [0.1939, 0.6624, 0.2807, 0.6821]}, {"w": "two", "b": [0.287, 0.6624, 0.3249, 0.6821]}, {"w": "vectors", "b": [0.3312, 0.6624, 0.404, 0.6821]}, {"w": "(see", "b": [0.4104, 0.6624, 0.451, 0.6821]}, {"w": "figure", "b": [0.4572, 0.6624, 0.5175, 0.6821]}, {"w": "2.8).", "b": [0.5238, 0.6624, 0.57, 0.6821]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 2.8. Geometric interpretation of the sum of two vectors", "words": [{"w": "Figure", "b": [0.1294, 0.7002, 0.1827, 0.715]}, {"w": "2.8.", "b": [0.1874, 0.7002, 0.2158, 0.715]}, {"w": "Geometric", "b": [0.2205, 0.7002, 0.3056, 0.715]}, {"w": "interpretation", "b": [0.3103, 0.7002, 0.4234, 0.715]}, {"w": "of", "b": [0.4282, 0.7002, 0.4439, 0.715]}, {"w": "the", "b": [0.4487, 0.7002, 0.4739, 0.715]}, {"w": "sum", "b": [0.4786, 0.7002, 0.5122, 0.715]}, {"w": "of", "b": [0.517, 0.7002, 0.5327, 0.715]}, {"w": "two", "b": [0.5375, 0.7002, 0.5669, 0.715]}, {"w": "vectors", "b": [0.5716, 0.7002, 0.6294, 0.715]}]}]}, {"page": 81, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In general, elementary geometric operations such as affine transformations, rotations, scaling, and so on can be expressed as tensor operations. For instance, a rotation of a 2D vector by an angle theta can be achieved via a dot product with a 2 × 2 matrix R = [u, v], where u and v are both vectors of the plane: u = [cos(theta), sin(theta)] and v = [-sin(theta), cos(theta)].", "words": [{"w": "In", "b": [0.1294, 0.3049, 0.1504, 0.3247]}, {"w": "general,", "b": [0.1567, 0.3049, 0.2373, 0.3247]}, {"w": "elementary", "b": [0.2436, 0.3049, 0.3557, 0.3247]}, {"w": "geometric", "b": [0.362, 0.3049, 0.4628, 0.3247]}, {"w": "operations", "b": [0.4692, 0.3049, 0.5742, 0.3247]}, {"w": "such", "b": [0.5805, 0.3049, 0.6268, 0.3247]}, {"w": "as", "b": [0.6331, 0.3049, 0.6541, 0.3247]}, {"w": "affine", "b": [0.6604, 0.3049, 0.7187, 0.3247]}, {"w": "transformations,", "b": [0.1294, 0.3254, 0.2941, 0.3452]}, {"w": "rotations,", "b": [0.3004, 0.3254, 0.395, 0.3452]}, {"w": "scaling,", "b": [0.4013, 0.3254, 0.479, 0.3452]}, {"w": "and", "b": [0.4853, 0.3254, 0.5218, 0.3452]}, {"w": "so", "b": [0.5281, 0.3254, 0.5505, 0.3452]}, {"w": "on", "b": [0.5568, 0.3254, 0.582, 0.3452]}, {"w": "can", "b": [0.5883, 0.3254, 0.6234, 0.3452]}, {"w": "be", "b": [0.6297, 0.3254, 0.6535, 0.3452]}, {"w": "expressed", "b": [0.6598, 0.3254, 0.7592, 0.3452]}, {"w": "as", "b": [0.7655, 0.3254, 0.7865, 0.3452]}, {"w": "tensor", "b": [0.7928, 0.3254, 0.8545, 0.3452]}, {"w": "operations.", "b": [0.1294, 0.3459, 0.2408, 0.3657]}, {"w": "For", "b": [0.2471, 0.3459, 0.2822, 0.3657]}, {"w": "instance,", "b": [0.2885, 0.3459, 0.3774, 0.3657]}, {"w": "a", "b": [0.3837, 0.3459, 0.3949, 0.3657]}, {"w": "rotation", "b": [0.4012, 0.3459, 0.4797, 0.3657]}, {"w": "of", "b": [0.486, 0.3459, 0.507, 0.3657]}, {"w": "a", "b": [0.5133, 0.3459, 0.5245, 0.3657]}, {"w": "2D", "b": [0.5309, 0.3459, 0.5617, 0.3657]}, {"w": "vector", "b": [0.568, 0.3459, 0.631, 0.3657]}, {"w": "by", "b": [0.6373, 0.3459, 0.6626, 0.3657]}, {"w": "an", "b": [0.6689, 0.3459, 0.6927, 0.3657]}, {"w": "angle", "b": [0.699, 0.3459, 0.7536, 0.3657]}, {"w": "theta", "b": [0.7599, 0.3459, 0.809, 0.3657]}, {"w": "can", "b": [0.8153, 0.3459, 0.8503, 0.3657]}, {"w": "be", "b": [0.1294, 0.3664, 0.1532, 0.3862]}, {"w": "achieved", "b": [0.1595, 0.3664, 0.2492, 0.3862]}, {"w": "via", "b": [0.2555, 0.3664, 0.2863, 0.3862]}, {"w": "a", "b": [0.2926, 0.3664, 0.3038, 0.3862]}, {"w": "dot", "b": [0.3101, 0.3664, 0.3424, 0.3862]}, {"w": "product", "b": [0.3487, 0.3664, 0.4257, 0.3862]}, {"w": "with", "b": [0.432, 0.3664, 0.4769, 0.3862]}, {"w": "a", "b": [0.4832, 0.3664, 0.4944, 0.3862]}, {"w": "2", "b": [0.5007, 0.3664, 0.5133, 0.3862]}, {"w": "×", "b": [0.5196, 0.3664, 0.5338, 0.3862]}, {"w": "2", "b": [0.5401, 0.3664, 0.5527, 0.3862]}, {"w": "matrix", "b": [0.559, 0.3664, 0.6249, 0.3862]}, {"w": "R", "b": [0.6312, 0.3675, 0.6463, 0.3877]}, {"w": "=", "b": [0.6614, 0.3675, 0.6766, 0.3877]}, {"w": "[u,", "b": [0.6917, 0.3675, 0.7371, 0.3877]}, {"w": "v],", "b": [0.7523, 0.3664, 0.7888, 0.3877]}, {"w": "where", "b": [0.7952, 0.3664, 0.8568, 0.3862]}, {"w": "u", "b": [0.1294, 0.3889, 0.1445, 0.4091]}, {"w": "and", "b": [0.1509, 0.3878, 0.1873, 0.4076]}, {"w": "v", "b": [0.1936, 0.3889, 0.2087, 0.4091]}, {"w": "are", "b": [0.215, 0.3878, 0.2458, 0.4076]}, {"w": "both", "b": [0.2521, 0.3878, 0.297, 0.4076]}, {"w": "vectors", "b": [0.3033, 0.3878, 0.3761, 0.4076]}, {"w": "of", "b": [0.3824, 0.3878, 0.4035, 0.4076]}, {"w": "the", "b": [0.4098, 0.3878, 0.4406, 0.4076]}, {"w": "plane:", "b": [0.4469, 0.3878, 0.5085, 0.4076]}, {"w": "u", "b": [0.5148, 0.3889, 0.5299, 0.4091]}, {"w": "=", "b": [0.5451, 0.3889, 0.5602, 0.4091]}, {"w": "[cos(theta),", "b": [0.5753, 0.3889, 0.757, 0.4091]}, {"w": "sin(theta)]", "b": [0.1294, 0.4103, 0.2959, 0.4305]}, {"w": "and", "b": [0.3022, 0.4092, 0.3387, 0.429]}, {"w": "v", "b": [0.345, 0.4103, 0.3601, 0.4305]}, {"w": "=", "b": [0.3752, 0.4103, 0.3904, 0.4305]}, {"w": "[-sin(theta),", "b": [0.4055, 0.4103, 0.6023, 0.4305]}, {"w": "cos(theta)].", "b": [0.6174, 0.4092, 0.7902, 0.4305]}]}, {"id": "b_1", "type": "paragraph", "text": "2.3.6. A geometric interpretation of deep learning", "words": [{"w": "2.3.6.", "b": [0.1294, 0.4574, 0.1862, 0.4771]}, {"w": "A", "b": [0.1925, 0.4574, 0.2107, 0.4771]}, {"w": "geometric", "b": [0.217, 0.4574, 0.3234, 0.4771]}, {"w": "interpretation", "b": [0.3298, 0.4574, 0.4806, 0.4771]}, {"w": "of", "b": [0.4869, 0.4574, 0.5079, 0.4771]}, {"w": "deep", "b": [0.5142, 0.4574, 0.5647, 0.4771]}, {"w": "learning", "b": [0.571, 0.4574, 0.6607, 0.4771]}]}, {"id": "b_2", "type": "paragraph", "text": "You just learned that neural networks consist entirely of chains of tensor operations and that all of these tensor operations are just geometric transformations of the input data. It follows that you can interpret a neural network as a very complex geometric transformation in a high- dimensional space, implemented via a long series of simple steps.", "words": [{"w": "You", "b": [0.1294, 0.5001, 0.1703, 0.5199]}, {"w": "just", "b": [0.1766, 0.5001, 0.2131, 0.5199]}, {"w": "learned", "b": [0.2194, 0.5001, 0.2936, 0.5199]}, {"w": "that", "b": [0.2999, 0.5001, 0.3378, 0.5199]}, {"w": "neural", "b": [0.3441, 0.5001, 0.4071, 0.5199]}, {"w": "networks", "b": [0.4134, 0.5001, 0.5059, 0.5199]}, {"w": "consist", "b": [0.5122, 0.5001, 0.5823, 0.5199]}, {"w": "entirely", "b": [0.5886, 0.5001, 0.6657, 0.5199]}, {"w": "of", "b": [0.672, 0.5001, 0.693, 0.5199]}, {"w": "chains", "b": [0.6993, 0.5001, 0.7637, 0.5199]}, {"w": "of", "b": [0.77, 0.5001, 0.7911, 0.5199]}, {"w": "tensor", "b": [0.7974, 0.5001, 0.859, 0.5199]}, {"w": "operations", "b": [0.1294, 0.5206, 0.2345, 0.5404]}, {"w": "and", "b": [0.2408, 0.5206, 0.2772, 0.5404]}, {"w": "that", "b": [0.2835, 0.5206, 0.3214, 0.5404]}, {"w": "all", "b": [0.3277, 0.5206, 0.3529, 0.5404]}, {"w": "of", "b": [0.3592, 0.5206, 0.3802, 0.5404]}, {"w": "these", "b": [0.3865, 0.5206, 0.4384, 0.5404]}, {"w": "tensor", "b": [0.4447, 0.5206, 0.5063, 0.5404]}, {"w": "operations", "b": [0.5126, 0.5206, 0.6177, 0.5404]}, {"w": "are", "b": [0.624, 0.5206, 0.6548, 0.5404]}, {"w": "just", "b": [0.6611, 0.5206, 0.6975, 0.5404]}, {"w": "geometric", "b": [0.7038, 0.5206, 0.8047, 0.5404]}, {"w": "transformations", "b": [0.1294, 0.5411, 0.2878, 0.5609]}, {"w": "of", "b": [0.2941, 0.5411, 0.3151, 0.5609]}, {"w": "the", "b": [0.3214, 0.5411, 0.3522, 0.5609]}, {"w": "input", "b": [0.3585, 0.5411, 0.4104, 0.5609]}, {"w": "data.", "b": [0.4167, 0.5411, 0.465, 0.5609]}, {"w": "It", "b": [0.4713, 0.5411, 0.4867, 0.5609]}, {"w": "follows", "b": [0.493, 0.5411, 0.5687, 0.5609]}, {"w": "that", "b": [0.575, 0.5411, 0.6129, 0.5609]}, {"w": "you", "b": [0.6192, 0.5411, 0.657, 0.5609]}, {"w": "can", "b": [0.6633, 0.5411, 0.6983, 0.5609]}, {"w": "interpret", "b": [0.7046, 0.5411, 0.7901, 0.5609]}, {"w": "a", "b": [0.7964, 0.5411, 0.8076, 0.5609]}, {"w": "neural", "b": [0.1294, 0.5616, 0.1925, 0.5814]}, {"w": "network", "b": [0.1988, 0.5616, 0.2814, 0.5814]}, {"w": "as", "b": [0.2877, 0.5616, 0.3087, 0.5814]}, {"w": "a", "b": [0.315, 0.5616, 0.3262, 0.5814]}, {"w": "very", "b": [0.3326, 0.5616, 0.3774, 0.5814]}, {"w": "complex", "b": [0.3837, 0.5616, 0.4706, 0.5814]}, {"w": "geometric", "b": [0.4768, 0.5616, 0.5777, 0.5814]}, {"w": "transformation", "b": [0.584, 0.5616, 0.7325, 0.5814]}, {"w": "in", "b": [0.7388, 0.5616, 0.7585, 0.5814]}, {"w": "a", "b": [0.7648, 0.5616, 0.776, 0.5814]}, {"w": "high-", "b": [0.7823, 0.5616, 0.8355, 0.5814]}, {"w": "dimensional", "b": [0.1294, 0.5821, 0.2527, 0.6019]}, {"w": "space,", "b": [0.259, 0.5821, 0.3214, 0.6019]}, {"w": "implemented", "b": [0.3277, 0.5821, 0.4594, 0.6019]}, {"w": "via", "b": [0.4657, 0.5821, 0.4965, 0.6019]}, {"w": "a", "b": [0.5029, 0.5821, 0.5141, 0.6019]}, {"w": "long", "b": [0.5204, 0.5821, 0.5652, 0.6019]}, {"w": "series", "b": [0.5715, 0.5821, 0.629, 0.6019]}, {"w": "of", "b": [0.6353, 0.5821, 0.6563, 0.6019]}, {"w": "simple", "b": [0.6626, 0.5821, 0.7299, 0.6019]}, {"w": "steps.", "b": [0.7362, 0.5821, 0.7929, 0.6019]}]}, {"id": "b_3", "type": "paragraph", "text": "In 3D, the following mental image may prove useful. Imagine two sheets of colored paper: one red and one blue. Put one on top of the other. Now crumple them together into a small ball. That crumpled paper ball is your input data, and each sheet of paper is a class of data in a classification problem. What a neural network (or any other machine-learning model) is meant to do is figure out a transformation of the paper ball that would uncrumple it, so as to make the two classes cleanly separable again. With deep learning, this would be implemented as a series of simple transformations of the 3D space, such as those you could apply on the paper ball with your fingers, one movement at a time.", "words": [{"w": "In", "b": [0.1294, 0.6249, 0.1504, 0.6447]}, {"w": "3D,", "b": [0.1567, 0.6249, 0.1939, 0.6447]}, {"w": "the", "b": [0.2002, 0.6249, 0.231, 0.6447]}, {"w": "following", "b": [0.2373, 0.6249, 0.3354, 0.6447]}, {"w": "mental", "b": [0.3417, 0.6249, 0.4104, 0.6447]}, {"w": "image", "b": [0.4167, 0.6249, 0.4783, 0.6447]}, {"w": "may", "b": [0.4846, 0.6249, 0.5281, 0.6447]}, {"w": "prove", "b": [0.5344, 0.6249, 0.5918, 0.6447]}, {"w": "useful.", "b": [0.5981, 0.6249, 0.6661, 0.6447]}, {"w": "Imagine", "b": [0.6724, 0.6249, 0.7551, 0.6447]}, {"w": "two", "b": [0.7614, 0.6249, 0.7992, 0.6447]}, {"w": "sheets", "b": [0.8055, 0.6249, 0.8672, 0.6447]}, {"w": "of", "b": [0.1294, 0.6454, 0.1504, 0.6652]}, {"w": "colored", "b": [0.1567, 0.6454, 0.2324, 0.6652]}, {"w": "paper:", "b": [0.2387, 0.6454, 0.3017, 0.6652]}, {"w": "one", "b": [0.308, 0.6454, 0.3445, 0.6652]}, {"w": "red", "b": [0.3508, 0.6454, 0.383, 0.6652]}, {"w": "and", "b": [0.3893, 0.6454, 0.4257, 0.6652]}, {"w": "one", "b": [0.432, 0.6454, 0.4684, 0.6652]}, {"w": "blue.", "b": [0.4748, 0.6454, 0.5245, 0.6652]}, {"w": "Put", "b": [0.5308, 0.6454, 0.5645, 0.6652]}, {"w": "one", "b": [0.5708, 0.6454, 0.6072, 0.6652]}, {"w": "on", "b": [0.6135, 0.6454, 0.6387, 0.6652]}, {"w": "top", "b": [0.645, 0.6454, 0.6772, 0.6652]}, {"w": "of", "b": [0.6835, 0.6454, 0.7045, 0.6652]}, {"w": "the", "b": [0.7108, 0.6454, 0.7417, 0.6652]}, {"w": "other.", "b": [0.748, 0.6454, 0.8047, 0.6652]}, {"w": "Now", "b": [0.811, 0.6454, 0.86, 0.6652]}, {"w": "crumple", "b": [0.1294, 0.6659, 0.2121, 0.6857]}, {"w": "them", "b": [0.2184, 0.6659, 0.2688, 0.6857]}, {"w": "together", "b": [0.2751, 0.6659, 0.3578, 0.6857]}, {"w": "into", "b": [0.3641, 0.6659, 0.4034, 0.6857]}, {"w": "a", "b": [0.4097, 0.6659, 0.4209, 0.6857]}, {"w": "small", "b": [0.4272, 0.6659, 0.4818, 0.6857]}, {"w": "ball.", "b": [0.4881, 0.6659, 0.5323, 0.6857]}, {"w": "That", "b": [0.5386, 0.6659, 0.5848, 0.6857]}, {"w": "crumpled", "b": [0.5911, 0.6659, 0.6864, 0.6857]}, {"w": "paper", "b": [0.6927, 0.6659, 0.7488, 0.6857]}, {"w": "ball", "b": [0.7551, 0.6659, 0.7929, 0.6857]}, {"w": "is", "b": [0.7992, 0.6659, 0.816, 0.6857]}, {"w": "your", "b": [0.8223, 0.6659, 0.8686, 0.6857]}, {"w": "input", "b": [0.1294, 0.6864, 0.1813, 0.7062]}, {"w": "data,", "b": [0.1876, 0.6864, 0.2359, 0.7062]}, {"w": "and", "b": [0.2422, 0.6864, 0.2786, 0.7062]}, {"w": "each", "b": [0.285, 0.6864, 0.3312, 0.7062]}, {"w": "sheet", "b": [0.3375, 0.6864, 0.3893, 0.7062]}, {"w": "of", "b": [0.3956, 0.6864, 0.4166, 0.7062]}, {"w": "paper", "b": [0.4229, 0.6864, 0.4789, 0.7062]}, {"w": "is", "b": [0.4852, 0.6864, 0.502, 0.7062]}, {"w": "a", "b": [0.5083, 0.6864, 0.5195, 0.7062]}, {"w": "class", "b": [0.5259, 0.6864, 0.5749, 0.7062]}, {"w": "of", "b": [0.5812, 0.6864, 0.6022, 0.7062]}, {"w": "data", "b": [0.6085, 0.6864, 0.6505, 0.7062]}, {"w": "in", "b": [0.6569, 0.6864, 0.6765, 0.7062]}, {"w": "a", "b": [0.6828, 0.6864, 0.694, 0.7062]}, {"w": "classification", "b": [0.7003, 0.6864, 0.8334, 0.7062]}, {"w": "problem.", "b": [0.1294, 0.7069, 0.2198, 0.7267]}, {"w": "What", "b": [0.2261, 0.7069, 0.2807, 0.7267]}, {"w": "a", "b": [0.287, 0.7069, 0.2982, 0.7267]}, {"w": "neural", "b": [0.3046, 0.7069, 0.3676, 0.7267]}, {"w": "network", "b": [0.3739, 0.7069, 0.4566, 0.7267]}, {"w": "(or", "b": [0.4629, 0.7069, 0.4923, 0.7267]}, {"w": "any", "b": [0.4986, 0.7069, 0.535, 0.7267]}, {"w": "other", "b": [0.5413, 0.7069, 0.5932, 0.7267]}, {"w": "machine-learning", "b": [0.5995, 0.7069, 0.776, 0.7267]}, {"w": "model)", "b": [0.7823, 0.7069, 0.8538, 0.7267]}, {"w": "is", "b": [0.1294, 0.7274, 0.1462, 0.7472]}, {"w": "meant", "b": [0.1525, 0.7274, 0.2142, 0.7472]}, {"w": "to", "b": [0.2205, 0.7274, 0.2401, 0.7472]}, {"w": "do", "b": [0.2464, 0.7274, 0.2716, 0.7472]}, {"w": "is", "b": [0.2779, 0.7274, 0.2948, 0.7472]}, {"w": "figure", "b": [0.3011, 0.7274, 0.3613, 0.7472]}, {"w": "out", "b": [0.3676, 0.7274, 0.3999, 0.7472]}, {"w": "a", "b": [0.4062, 0.7274, 0.4174, 0.7472]}, {"w": "transformation", "b": [0.4237, 0.7274, 0.5722, 0.7472]}, {"w": "of", "b": [0.5785, 0.7274, 0.5995, 0.7472]}, {"w": "the", "b": [0.6058, 0.7274, 0.6367, 0.7472]}, {"w": "paper", "b": [0.643, 0.7274, 0.699, 0.7472]}, {"w": "ball", "b": [0.7053, 0.7274, 0.7431, 0.7472]}, {"w": "that", "b": [0.7494, 0.7274, 0.7873, 0.7472]}, {"w": "would", "b": [0.7936, 0.7274, 0.8566, 0.7472]}, {"w": "uncrumple", "b": [0.1294, 0.7479, 0.2373, 0.7677]}, {"w": "it,", "b": [0.2436, 0.7479, 0.2639, 0.7677]}, {"w": "so", "b": [0.2702, 0.7479, 0.2927, 0.7677]}, {"w": "as", "b": [0.299, 0.7479, 0.32, 0.7677]}, {"w": "to", "b": [0.3263, 0.7479, 0.3459, 0.7677]}, {"w": "make", "b": [0.3522, 0.7479, 0.4069, 0.7677]}, {"w": "the", "b": [0.4132, 0.7479, 0.444, 0.7677]}, {"w": "two", "b": [0.4503, 0.7479, 0.4881, 0.7677]}, {"w": "classes", "b": [0.4945, 0.7479, 0.5645, 0.7677]}, {"w": "cleanly", "b": [0.5708, 0.7479, 0.6437, 0.7677]}, {"w": "separable", "b": [0.65, 0.7479, 0.7452, 0.7677]}, {"w": "again.", "b": [0.7514, 0.7479, 0.8124, 0.7677]}, {"w": "With", "b": [0.8187, 0.7479, 0.8681, 0.7677]}, {"w": "deep", "b": [0.1294, 0.7684, 0.177, 0.7882]}, {"w": "learning,", "b": [0.1833, 0.7684, 0.2723, 0.7882]}, {"w": "this", "b": [0.2786, 0.7684, 0.3151, 0.7882]}, {"w": "would", "b": [0.3214, 0.7684, 0.3844, 0.7882]}, {"w": "be", "b": [0.3908, 0.7684, 0.4146, 0.7882]}, {"w": "implemented", "b": [0.4209, 0.7684, 0.5526, 0.7882]}, {"w": "as", "b": [0.5589, 0.7684, 0.5799, 0.7882]}, {"w": "a", "b": [0.5862, 0.7684, 0.5974, 0.7882]}, {"w": "series", "b": [0.6037, 0.7684, 0.6612, 0.7882]}, {"w": "of", "b": [0.6675, 0.7684, 0.6885, 0.7882]}, {"w": "simple", "b": [0.6948, 0.7684, 0.7621, 0.7882]}, {"w": "transformations", "b": [0.1294, 0.7889, 0.2878, 0.8087]}, {"w": "of", "b": [0.2941, 0.7889, 0.3151, 0.8087]}, {"w": "the", "b": [0.3214, 0.7889, 0.3522, 0.8087]}, {"w": "3D", "b": [0.3585, 0.7889, 0.3893, 0.8087]}, {"w": "space,", "b": [0.3956, 0.7889, 0.458, 0.8087]}, {"w": "such", "b": [0.4643, 0.7889, 0.5105, 0.8087]}, {"w": "as", "b": [0.5168, 0.7889, 0.5378, 0.8087]}, {"w": "those", "b": [0.5441, 0.7889, 0.5974, 0.8087]}, {"w": "you", "b": [0.6037, 0.7889, 0.6415, 0.8087]}, {"w": "could", "b": [0.6478, 0.7889, 0.7039, 0.8087]}, {"w": "apply", "b": [0.7102, 0.7889, 0.7662, 0.8087]}, {"w": "on", "b": [0.7725, 0.7889, 0.7978, 0.8087]}, {"w": "the", "b": [0.8041, 0.7889, 0.8349, 0.8087]}, {"w": "paper", "b": [0.1294, 0.8094, 0.1854, 0.8292]}, {"w": "ball", "b": [0.1917, 0.8094, 0.2296, 0.8292]}, {"w": "with", "b": [0.2359, 0.8094, 0.2807, 0.8292]}, {"w": "your", "b": [0.287, 0.8094, 0.3333, 0.8292]}, {"w": "fingers,", "b": [0.3396, 0.8094, 0.416, 0.8292]}, {"w": "one", "b": [0.4223, 0.8094, 0.4587, 0.8292]}, {"w": "movement", "b": [0.465, 0.8094, 0.5715, 0.8292]}, {"w": "at", "b": [0.5778, 0.8094, 0.596, 0.8292]}, {"w": "a", "b": [0.6023, 0.8094, 0.6135, 0.8292]}, {"w": "time.", "b": [0.6198, 0.8094, 0.671, 0.8292]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 2.9. Uncrumpling a complicated manifold of data", "words": [{"w": "Figure", "b": [0.1294, 0.8473, 0.1827, 0.8621]}, {"w": "2.9.", "b": [0.1874, 0.8473, 0.2158, 0.8621]}, {"w": "Uncrumpling", "b": [0.2205, 0.8473, 0.3288, 0.8621]}, {"w": "a", "b": [0.3335, 0.8473, 0.3429, 0.8621]}, {"w": "complicated", "b": [0.3477, 0.8473, 0.4454, 0.8621]}, {"w": "manifold", "b": [0.4501, 0.8473, 0.5227, 0.8621]}, {"w": "of", "b": [0.5274, 0.8473, 0.5432, 0.8621]}, {"w": "data", "b": [0.5479, 0.8473, 0.5836, 0.8621]}]}]}, {"page": 82, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Uncrumpling paper balls is what machine learning is about: finding neat representations for complex, highly folded data manifolds. At this point, you should have a pretty good intuition as to why deep learning excels at this: it takes the approach of incrementally decomposing a complicated geometric transformation into a long chain of elementary ones, which is pretty much the strategy a human would follow to uncrumple a paper ball. Each layer in a deep network applies a transformation that disentangles the data a little—and a deep stack of layers makes tractable an extremely complicated disentanglement process.", "words": [{"w": "Uncrumpling", "b": [0.1294, 0.2105, 0.2639, 0.2302]}, {"w": "paper", "b": [0.2702, 0.2105, 0.3263, 0.2302]}, {"w": "balls", "b": [0.3326, 0.2105, 0.3802, 0.2302]}, {"w": "is", "b": [0.3865, 0.2105, 0.4034, 0.2302]}, {"w": "what", "b": [0.4097, 0.2105, 0.4587, 0.2302]}, {"w": "machine", "b": [0.465, 0.2105, 0.5505, 0.2302]}, {"w": "learning", "b": [0.5568, 0.2105, 0.6395, 0.2302]}, {"w": "is", "b": [0.6458, 0.2105, 0.6626, 0.2302]}, {"w": "about:", "b": [0.6689, 0.2105, 0.732, 0.2302]}, {"w": "finding", "b": [0.7383, 0.2105, 0.8111, 0.2302]}, {"w": "neat", "b": [0.8174, 0.2105, 0.8595, 0.2302]}, {"w": "representations", "b": [0.1294, 0.231, 0.2821, 0.2507]}, {"w": "for", "b": [0.2884, 0.231, 0.3178, 0.2507]}, {"w": "complex,", "b": [0.3242, 0.231, 0.4173, 0.2507]}, {"w": "highly", "b": [0.4236, 0.231, 0.4881, 0.2507]}, {"w": "folded", "b": [0.4944, 0.231, 0.5589, 0.2507]}, {"w": "data", "b": [0.5652, 0.231, 0.6072, 0.2507]}, {"w": "manifolds.", "b": [0.6135, 0.231, 0.7207, 0.2507]}, {"w": "At", "b": [0.7269, 0.231, 0.7522, 0.2507]}, {"w": "this", "b": [0.7585, 0.231, 0.7949, 0.2507]}, {"w": "point,", "b": [0.8012, 0.231, 0.8594, 0.2507]}, {"w": "you", "b": [0.1294, 0.2515, 0.1673, 0.2712]}, {"w": "should", "b": [0.1736, 0.2515, 0.2408, 0.2712]}, {"w": "have", "b": [0.2471, 0.2515, 0.2948, 0.2712]}, {"w": "a", "b": [0.3011, 0.2515, 0.3123, 0.2712]}, {"w": "pretty", "b": [0.3186, 0.2515, 0.3774, 0.2712]}, {"w": "good", "b": [0.3837, 0.2515, 0.4342, 0.2712]}, {"w": "intuition", "b": [0.4405, 0.2515, 0.526, 0.2712]}, {"w": "as", "b": [0.5323, 0.2515, 0.5533, 0.2712]}, {"w": "to", "b": [0.5596, 0.2515, 0.5793, 0.2712]}, {"w": "why", "b": [0.5856, 0.2515, 0.629, 0.2712]}, {"w": "deep", "b": [0.6353, 0.2515, 0.6829, 0.2712]}, {"w": "learning", "b": [0.6892, 0.2515, 0.7719, 0.2712]}, {"w": "excels", "b": [0.7782, 0.2515, 0.8413, 0.2712]}, {"w": "at", "b": [0.8476, 0.2515, 0.8658, 0.2712]}, {"w": "this:", "b": [0.1294, 0.272, 0.1729, 0.2917]}, {"w": "it", "b": [0.1792, 0.272, 0.1932, 0.2917]}, {"w": "takes", "b": [0.1995, 0.272, 0.2514, 0.2917]}, {"w": "the", "b": [0.2577, 0.272, 0.2885, 0.2917]}, {"w": "approach", "b": [0.2948, 0.272, 0.3872, 0.2917]}, {"w": "of", "b": [0.3936, 0.272, 0.4146, 0.2917]}, {"w": "incrementally", "b": [0.4209, 0.272, 0.5596, 0.2917]}, {"w": "decomposing", "b": [0.5658, 0.272, 0.7003, 0.2917]}, {"w": "a", "b": [0.7066, 0.272, 0.7178, 0.2917]}, {"w": "complicated", "b": [0.7241, 0.272, 0.8474, 0.2917]}, {"w": "geometric", "b": [0.1294, 0.2925, 0.2303, 0.3122]}, {"w": "transformation", "b": [0.2366, 0.2925, 0.3851, 0.3122]}, {"w": "into", "b": [0.3914, 0.2925, 0.4307, 0.3122]}, {"w": "a", "b": [0.437, 0.2925, 0.4482, 0.3122]}, {"w": "long", "b": [0.4545, 0.2925, 0.4993, 0.3122]}, {"w": "chain", "b": [0.5057, 0.2925, 0.5603, 0.3122]}, {"w": "of", "b": [0.5666, 0.2925, 0.5876, 0.3122]}, {"w": "elementary", "b": [0.5939, 0.2925, 0.706, 0.3122]}, {"w": "ones,", "b": [0.7123, 0.2925, 0.7648, 0.3122]}, {"w": "which", "b": [0.7712, 0.2925, 0.8328, 0.3122]}, {"w": "is", "b": [0.8391, 0.2925, 0.8559, 0.3122]}, {"w": "pretty", "b": [0.1294, 0.313, 0.1883, 0.3327]}, {"w": "much", "b": [0.1946, 0.313, 0.2506, 0.3327]}, {"w": "the", "b": [0.2569, 0.313, 0.2878, 0.3327]}, {"w": "strategy", "b": [0.2941, 0.313, 0.3739, 0.3327]}, {"w": "a", "b": [0.3802, 0.313, 0.3914, 0.3327]}, {"w": "human", "b": [0.3977, 0.313, 0.4664, 0.3327]}, {"w": "would", "b": [0.4727, 0.313, 0.5357, 0.3327]}, {"w": "follow", "b": [0.542, 0.313, 0.6079, 0.3327]}, {"w": "to", "b": [0.6142, 0.313, 0.6338, 0.3327]}, {"w": "uncrumple", "b": [0.6401, 0.313, 0.748, 0.3327]}, {"w": "a", "b": [0.7543, 0.313, 0.7655, 0.3327]}, {"w": "paper", "b": [0.7718, 0.313, 0.8279, 0.3327]}, {"w": "ball.", "b": [0.1294, 0.3335, 0.1736, 0.3532]}, {"w": "Each", "b": [0.1799, 0.3335, 0.2303, 0.3532]}, {"w": "layer", "b": [0.2366, 0.3335, 0.287, 0.3532]}, {"w": "in", "b": [0.2933, 0.3335, 0.313, 0.3532]}, {"w": "a", "b": [0.3193, 0.3335, 0.3305, 0.3532]}, {"w": "deep", "b": [0.3368, 0.3335, 0.3844, 0.3532]}, {"w": "network", "b": [0.3907, 0.3335, 0.4734, 0.3532]}, {"w": "applies", "b": [0.4797, 0.3335, 0.5511, 0.3532]}, {"w": "a", "b": [0.5574, 0.3335, 0.5686, 0.3532]}, {"w": "transformation", "b": [0.5749, 0.3335, 0.7235, 0.3532]}, {"w": "that", "b": [0.7298, 0.3335, 0.7676, 0.3532]}, {"w": "disentangles", "b": [0.1294, 0.354, 0.2541, 0.3737]}, {"w": "the", "b": [0.2604, 0.354, 0.2913, 0.3737]}, {"w": "data", "b": [0.2975, 0.354, 0.3396, 0.3737]}, {"w": "a", "b": [0.3459, 0.354, 0.3571, 0.3737]}, {"w": "little—and", "b": [0.3634, 0.354, 0.4713, 0.3737]}, {"w": "a", "b": [0.4776, 0.354, 0.4888, 0.3737]}, {"w": "deep", "b": [0.4951, 0.354, 0.5427, 0.3737]}, {"w": "stack", "b": [0.549, 0.354, 0.6009, 0.3737]}, {"w": "of", "b": [0.6072, 0.354, 0.6282, 0.3737]}, {"w": "layers", "b": [0.6345, 0.354, 0.6947, 0.3737]}, {"w": "makes", "b": [0.701, 0.354, 0.7655, 0.3737]}, {"w": "tractable", "b": [0.7718, 0.354, 0.8587, 0.3737]}, {"w": "an", "b": [0.1294, 0.3745, 0.1532, 0.3942]}, {"w": "extremely", "b": [0.1595, 0.3745, 0.2604, 0.3942]}, {"w": "complicated", "b": [0.2667, 0.3745, 0.39, 0.3942]}, {"w": "disentanglement", "b": [0.3963, 0.3745, 0.5617, 0.3942]}, {"w": "process.", "b": [0.568, 0.3745, 0.6499, 0.3942]}]}, {"id": "b_1", "type": "equation", "text": "2.4. The engine of neural networks: gradient-based optimization", "words": [{"w": "2.4.", "b": [0.1294, 0.4313, 0.172, 0.4535]}, {"w": "The", "b": [0.1791, 0.4313, 0.2264, 0.4535]}, {"w": "engine", "b": [0.2335, 0.4313, 0.3123, 0.4535]}, {"w": "of", "b": [0.3194, 0.4313, 0.343, 0.4535]}, {"w": "neural", "b": [0.3501, 0.4313, 0.429, 0.4535]}, {"w": "networks:", "b": [0.4361, 0.4313, 0.5575, 0.4535]}, {"w": "gradient-based", "b": [0.5645, 0.4313, 0.7459, 0.4535]}, {"w": "optimization", "b": [0.1294, 0.4554, 0.2823, 0.4776]}]}, {"id": "b_2", "type": "paragraph", "text": "As you saw in the previous section, each neural layer from our first network example transforms its input data as follows:", "words": [{"w": "As", "b": [0.1294, 0.501, 0.1574, 0.5208]}, {"w": "you", "b": [0.1637, 0.501, 0.2016, 0.5208]}, {"w": "saw", "b": [0.2079, 0.501, 0.2471, 0.5208]}, {"w": "in", "b": [0.2534, 0.501, 0.273, 0.5208]}, {"w": "the", "b": [0.2794, 0.501, 0.3102, 0.5208]}, {"w": "previous", "b": [0.3165, 0.501, 0.4034, 0.5208]}, {"w": "section,", "b": [0.4097, 0.501, 0.4874, 0.5208]}, {"w": "each", "b": [0.4937, 0.501, 0.54, 0.5208]}, {"w": "neural", "b": [0.5463, 0.501, 0.6093, 0.5208]}, {"w": "layer", "b": [0.6156, 0.501, 0.666, 0.5208]}, {"w": "from", "b": [0.6723, 0.501, 0.7214, 0.5208]}, {"w": "our", "b": [0.7277, 0.501, 0.7613, 0.5208]}, {"w": "first", "b": [0.7676, 0.501, 0.8083, 0.5208]}, {"w": "network", "b": [0.1294, 0.5215, 0.2121, 0.5413]}, {"w": "example", "b": [0.2184, 0.5215, 0.3038, 0.5413]}, {"w": "transforms", "b": [0.3102, 0.5215, 0.418, 0.5413]}, {"w": "its", "b": [0.4244, 0.5215, 0.4482, 0.5413]}, {"w": "input", "b": [0.4545, 0.5215, 0.5064, 0.5413]}, {"w": "data", "b": [0.5127, 0.5215, 0.5547, 0.5413]}, {"w": "as", "b": [0.561, 0.5215, 0.582, 0.5413]}, {"w": "follows:", "b": [0.5883, 0.5215, 0.671, 0.5413]}]}, {"id": "b_3", "type": "equation", "text": "output = relu(dot(W, input) + b)", "words": [{"w": "output", "b": [0.1357, 0.5593, 0.2038, 0.5744]}, {"w": "=", "b": [0.2152, 0.5593, 0.2265, 0.5744]}, {"w": "relu(dot(W,", "b": [0.2379, 0.5593, 0.3628, 0.5744]}, {"w": "input)", "b": [0.3741, 0.5593, 0.4422, 0.5744]}, {"w": "+", "b": [0.4536, 0.5593, 0.4649, 0.5744]}, {"w": "b)", "b": [0.4763, 0.5593, 0.499, 0.5744]}]}, {"id": "b_4", "type": "paragraph", "text": "In this expression, W and b are tensors that are attributes of the layer. They’re called the weights or trainable parameters of the layer (the kernel and bias attributes, respectively). These weights contain the information learned by the network from exposure to training data.", "words": [{"w": "In", "b": [0.1294, 0.5973, 0.1504, 0.617]}, {"w": "this", "b": [0.1567, 0.5973, 0.1932, 0.617]}, {"w": "expression,", "b": [0.1995, 0.5973, 0.3137, 0.617]}, {"w": "W", "b": [0.32, 0.5983, 0.3351, 0.6185]}, {"w": "and", "b": [0.3414, 0.5973, 0.3779, 0.617]}, {"w": "b", "b": [0.3842, 0.5983, 0.3993, 0.6185]}, {"w": "are", "b": [0.4056, 0.5973, 0.4364, 0.617]}, {"w": "tensors", "b": [0.4427, 0.5973, 0.5142, 0.617]}, {"w": "that", "b": [0.5205, 0.5973, 0.5583, 0.617]}, {"w": "are", "b": [0.5646, 0.5973, 0.5954, 0.617]}, {"w": "attributes", "b": [0.6017, 0.5973, 0.6956, 0.617]}, {"w": "of", "b": [0.7019, 0.5973, 0.7229, 0.617]}, {"w": "the", "b": [0.7292, 0.5973, 0.7601, 0.617]}, {"w": "layer.", "b": [0.7664, 0.5973, 0.8216, 0.617]}, {"w": "They’re", "b": [0.1294, 0.6187, 0.2093, 0.6384]}, {"w": "called", "b": [0.2156, 0.6187, 0.2758, 0.6384]}, {"w": "the", "b": [0.2821, 0.6187, 0.3129, 0.6384]}, {"w": "weights", "b": [0.3192, 0.6187, 0.3963, 0.6384]}, {"w": "or", "b": [0.4026, 0.6187, 0.4236, 0.6384]}, {"w": "trainable", "b": [0.4299, 0.6187, 0.5224, 0.6384]}, {"w": "parameters", "b": [0.5287, 0.6187, 0.6436, 0.6384]}, {"w": "of", "b": [0.6499, 0.6187, 0.6709, 0.6384]}, {"w": "the", "b": [0.6772, 0.6187, 0.708, 0.6384]}, {"w": "layer", "b": [0.7143, 0.6187, 0.7648, 0.6384]}, {"w": "(the", "b": [0.7711, 0.6187, 0.8103, 0.6384]}, {"w": "kernel", "b": [0.1294, 0.6402, 0.2202, 0.6604]}, {"w": "and", "b": [0.2265, 0.6392, 0.263, 0.6589]}, {"w": "bias", "b": [0.2693, 0.6402, 0.3298, 0.6604]}, {"w": "attributes,", "b": [0.3361, 0.6392, 0.4363, 0.6589]}, {"w": "respectively).", "b": [0.4426, 0.6392, 0.5792, 0.6589]}, {"w": "These", "b": [0.5855, 0.6392, 0.6458, 0.6589]}, {"w": "weights", "b": [0.6521, 0.6392, 0.7305, 0.6589]}, {"w": "contain", "b": [0.7368, 0.6392, 0.8111, 0.6589]}, {"w": "the", "b": [0.8174, 0.6392, 0.8482, 0.6589]}, {"w": "information", "b": [0.1294, 0.6606, 0.2485, 0.6803]}, {"w": "learned", "b": [0.2548, 0.6606, 0.3291, 0.6803]}, {"w": "by", "b": [0.3354, 0.6606, 0.3606, 0.6803]}, {"w": "the", "b": [0.3669, 0.6606, 0.3977, 0.6803]}, {"w": "network", "b": [0.404, 0.6606, 0.4867, 0.6803]}, {"w": "from", "b": [0.493, 0.6606, 0.5421, 0.6803]}, {"w": "exposure", "b": [0.5484, 0.6606, 0.6394, 0.6803]}, {"w": "to", "b": [0.6457, 0.6606, 0.6654, 0.6803]}, {"w": "training", "b": [0.6717, 0.6606, 0.7501, 0.6803]}, {"w": "data.", "b": [0.7564, 0.6606, 0.8048, 0.6803]}]}, {"id": "b_5", "type": "paragraph", "text": "Initially, these weight matrices are filled with small random values (a step called random initialization). Of course, there’s no reason to expect that relu(dot(W, input) + b), when W and b are random, will yield any useful representations. The resulting representations are meaningless—but they’re a starting point. What comes next is to gradually adjust these weights, based on a feedback signal. This gradual adjustment, also called training, is basically the learning that machine learning is all about.", "words": [{"w": "Initially,", "b": [0.1294, 0.7034, 0.2139, 0.7231]}, {"w": "these", "b": [0.2203, 0.7034, 0.2721, 0.7231]}, {"w": "weight", "b": [0.2784, 0.7034, 0.3471, 0.7231]}, {"w": "matrices", "b": [0.3534, 0.7034, 0.4388, 0.7231]}, {"w": "are", "b": [0.4451, 0.7034, 0.4759, 0.7231]}, {"w": "filled", "b": [0.4822, 0.7034, 0.5355, 0.7231]}, {"w": "with", "b": [0.5418, 0.7034, 0.5867, 0.7231]}, {"w": "small", "b": [0.593, 0.7034, 0.6476, 0.7231]}, {"w": "random", "b": [0.6539, 0.7034, 0.731, 0.7231]}, {"w": "values", "b": [0.7373, 0.7034, 0.8018, 0.7231]}, {"w": "(a", "b": [0.8081, 0.7034, 0.8277, 0.7231]}, {"w": "step", "b": [0.1294, 0.7239, 0.1701, 0.7436]}, {"w": "called", "b": [0.1764, 0.7239, 0.2366, 0.7436]}, {"w": "random", "b": [0.2429, 0.7239, 0.3213, 0.7436]}, {"w": "initialization).", "b": [0.3277, 0.7239, 0.4713, 0.7436]}, {"w": "Of", "b": [0.4776, 0.7239, 0.5042, 0.7436]}, {"w": "course,", "b": [0.5105, 0.7239, 0.5827, 0.7436]}, {"w": "there’s", "b": [0.589, 0.7239, 0.6562, 0.7436]}, {"w": "no", "b": [0.6625, 0.7239, 0.6878, 0.7436]}, {"w": "reason", "b": [0.6941, 0.7239, 0.7599, 0.7436]}, {"w": "to", "b": [0.7662, 0.7239, 0.7858, 0.7436]}, {"w": "expect", "b": [0.7921, 0.7239, 0.858, 0.7436]}, {"w": "that", "b": [0.1294, 0.7444, 0.1673, 0.7641]}, {"w": "relu(dot(W,", "b": [0.1735, 0.7454, 0.34, 0.7656]}, {"w": "input)", "b": [0.3552, 0.7454, 0.446, 0.7656]}, {"w": "+", "b": [0.4611, 0.7454, 0.4762, 0.7656]}, {"w": "b),", "b": [0.4914, 0.7444, 0.528, 0.7656]}, {"w": "when", "b": [0.5343, 0.7444, 0.5889, 0.7641]}, {"w": "W", "b": [0.5952, 0.7454, 0.6104, 0.7656]}, {"w": "and", "b": [0.6167, 0.7444, 0.6531, 0.7641]}, {"w": "b", "b": [0.6594, 0.7454, 0.6745, 0.7656]}, {"w": "are", "b": [0.6809, 0.7444, 0.7117, 0.7641]}, {"w": "random,", "b": [0.718, 0.7444, 0.8013, 0.7641]}, {"w": "will", "b": [0.8076, 0.7444, 0.8469, 0.7641]}, {"w": "yield", "b": [0.1294, 0.7657, 0.1799, 0.7855]}, {"w": "any", "b": [0.1862, 0.7657, 0.2226, 0.7855]}, {"w": "useful", "b": [0.2289, 0.7657, 0.2906, 0.7855]}, {"w": "representations.", "b": [0.2969, 0.7657, 0.4559, 0.7855]}, {"w": "The", "b": [0.4622, 0.7657, 0.5014, 0.7855]}, {"w": "resulting", "b": [0.5077, 0.7657, 0.596, 0.7855]}, {"w": "representations", "b": [0.6023, 0.7657, 0.755, 0.7855]}, {"w": "are", "b": [0.7613, 0.7657, 0.7921, 0.7855]}, {"w": "meaningless—but", "b": [0.1294, 0.7862, 0.3116, 0.806]}, {"w": "they’re", "b": [0.3179, 0.7862, 0.3893, 0.806]}, {"w": "a", "b": [0.3956, 0.7862, 0.4068, 0.806]}, {"w": "starting", "b": [0.4132, 0.7862, 0.4888, 0.806]}, {"w": "point.", "b": [0.4951, 0.7862, 0.5533, 0.806]}, {"w": "What", "b": [0.5596, 0.7862, 0.6142, 0.806]}, {"w": "comes", "b": [0.6205, 0.7862, 0.6849, 0.806]}, {"w": "next", "b": [0.6913, 0.7862, 0.7347, 0.806]}, {"w": "is", "b": [0.741, 0.7862, 0.7578, 0.806]}, {"w": "to", "b": [0.7641, 0.7862, 0.7838, 0.806]}, {"w": "gradually", "b": [0.1294, 0.8067, 0.2247, 0.8265]}, {"w": "adjust", "b": [0.231, 0.8067, 0.2913, 0.8265]}, {"w": "these", "b": [0.2976, 0.8067, 0.3494, 0.8265]}, {"w": "weights,", "b": [0.3557, 0.8067, 0.4405, 0.8265]}, {"w": "based", "b": [0.4468, 0.8067, 0.5042, 0.8265]}, {"w": "on", "b": [0.5105, 0.8067, 0.5358, 0.8265]}, {"w": "a", "b": [0.5421, 0.8067, 0.5533, 0.8265]}, {"w": "feedback", "b": [0.5596, 0.8067, 0.6506, 0.8265]}, {"w": "signal.", "b": [0.6569, 0.8067, 0.7235, 0.8265]}, {"w": "This", "b": [0.7298, 0.8067, 0.7747, 0.8265]}, {"w": "gradual", "b": [0.781, 0.8067, 0.8566, 0.8265]}, {"w": "adjustment,", "b": [0.1294, 0.8272, 0.2464, 0.847]}, {"w": "also", "b": [0.2527, 0.8272, 0.2934, 0.847]}, {"w": "called", "b": [0.2997, 0.8272, 0.3599, 0.847]}, {"w": "training,", "b": [0.3662, 0.8272, 0.4538, 0.847]}, {"w": "is", "b": [0.4601, 0.8272, 0.4769, 0.847]}, {"w": "basically", "b": [0.4832, 0.8272, 0.5729, 0.847]}, {"w": "the", "b": [0.5792, 0.8272, 0.61, 0.847]}, {"w": "learning", "b": [0.6163, 0.8272, 0.699, 0.847]}, {"w": "that", "b": [0.7053, 0.8272, 0.7431, 0.847]}, {"w": "machine", "b": [0.7495, 0.8272, 0.8349, 0.847]}, {"w": "learning", "b": [0.1294, 0.8477, 0.2121, 0.8675]}, {"w": "is", "b": [0.2184, 0.8477, 0.2352, 0.8675]}, {"w": "all", "b": [0.2415, 0.8477, 0.2667, 0.8675]}, {"w": "about.", "b": [0.273, 0.8477, 0.3354, 0.8675]}]}]}, {"page": 83, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This happens within what’s called a training loop, which works as follows. Repeat these steps in a loop, as long as necessary:", "words": [{"w": "This", "b": [0.1294, 0.0857, 0.1743, 0.1054]}, {"w": "happens", "b": [0.1806, 0.0857, 0.2632, 0.1054]}, {"w": "within", "b": [0.2695, 0.0857, 0.334, 0.1054]}, {"w": "what’s", "b": [0.3403, 0.0857, 0.4062, 0.1054]}, {"w": "called", "b": [0.4125, 0.0857, 0.4727, 0.1054]}, {"w": "a", "b": [0.479, 0.0857, 0.4902, 0.1054]}, {"w": "training", "b": [0.4965, 0.0857, 0.5778, 0.1054]}, {"w": "loop,", "b": [0.5841, 0.0857, 0.6352, 0.1054]}, {"w": "which", "b": [0.6415, 0.0857, 0.7032, 0.1054]}, {"w": "works", "b": [0.7095, 0.0857, 0.7711, 0.1054]}, {"w": "as", "b": [0.7775, 0.0857, 0.7985, 0.1054]}, {"w": "follows.", "b": [0.1294, 0.1062, 0.2114, 0.1259]}, {"w": "Repeat", "b": [0.2177, 0.1062, 0.2878, 0.1259]}, {"w": "these", "b": [0.2941, 0.1062, 0.3459, 0.1259]}, {"w": "steps", "b": [0.3522, 0.1062, 0.4027, 0.1259]}, {"w": "in", "b": [0.409, 0.1062, 0.4286, 0.1259]}, {"w": "a", "b": [0.4349, 0.1062, 0.4461, 0.1259]}, {"w": "loop,", "b": [0.4524, 0.1062, 0.5036, 0.1259]}, {"w": "as", "b": [0.5099, 0.1062, 0.5309, 0.1259]}, {"w": "long", "b": [0.5372, 0.1062, 0.582, 0.1259]}, {"w": "as", "b": [0.5883, 0.1062, 0.6094, 0.1259]}, {"w": "necessary:", "b": [0.6157, 0.1062, 0.7207, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "1. Draw a batch of training samples x and corresponding targets y. 2. Run the network on x (a step called the forward pass) to obtain predictions y_pred. 3. Compute the loss of the network on the batch, a measure of the mismatch between y_pred and y. 4. Update all weights of the network in a way that slightly reduces the loss on this batch.", "words": [{"w": "1.", "b": [0.1551, 0.1445, 0.174, 0.1642]}, {"w": "Draw", "b": [0.1799, 0.1445, 0.2359, 0.1642]}, {"w": "a", "b": [0.2422, 0.1445, 0.2534, 0.1642]}, {"w": "batch", "b": [0.2597, 0.1445, 0.3143, 0.1642]}, {"w": "of", "b": [0.3206, 0.1445, 0.3417, 0.1642]}, {"w": "training", "b": [0.348, 0.1445, 0.4264, 0.1642]}, {"w": "samples", "b": [0.4328, 0.1445, 0.514, 0.1642]}, {"w": "x", "b": [0.5203, 0.1455, 0.5354, 0.1657]}, {"w": "and", "b": [0.5417, 0.1445, 0.5782, 0.1642]}, {"w": "corresponding", "b": [0.5845, 0.1445, 0.7288, 0.1642]}, {"w": "targets", "b": [0.7351, 0.1445, 0.8019, 0.1642]}, {"w": "y.", "b": [0.8082, 0.1445, 0.8296, 0.1657]}, {"w": "2.", "b": [0.1551, 0.1659, 0.174, 0.1856]}, {"w": "Run", "b": [0.1799, 0.1659, 0.2219, 0.1856]}, {"w": "the", "b": [0.2282, 0.1659, 0.259, 0.1856]}, {"w": "network", "b": [0.2654, 0.1659, 0.348, 0.1856]}, {"w": "on", "b": [0.3543, 0.1659, 0.3796, 0.1856]}, {"w": "x", "b": [0.3858, 0.1669, 0.401, 0.1871]}, {"w": "(a", "b": [0.4073, 0.1659, 0.4269, 0.1856]}, {"w": "step", "b": [0.4332, 0.1659, 0.4738, 0.1856]}, {"w": "called", "b": [0.4801, 0.1659, 0.5404, 0.1856]}, {"w": "the", "b": [0.5467, 0.1659, 0.5775, 0.1856]}, {"w": "forward", "b": [0.5838, 0.1659, 0.6641, 0.1856]}, {"w": "pass)", "b": [0.6704, 0.1659, 0.7237, 0.1856]}, {"w": "to", "b": [0.73, 0.1659, 0.7496, 0.1856]}, {"w": "obtain", "b": [0.7559, 0.1659, 0.819, 0.1856]}, {"w": "predictions", "b": [0.1799, 0.1873, 0.292, 0.207]}, {"w": "y_pred.", "b": [0.2982, 0.1873, 0.3954, 0.2085]}, {"w": "3.", "b": [0.1551, 0.2087, 0.174, 0.2284]}, {"w": "Compute", "b": [0.1799, 0.2087, 0.2724, 0.2284]}, {"w": "the", "b": [0.2787, 0.2087, 0.3095, 0.2284]}, {"w": "loss", "b": [0.3158, 0.2087, 0.3551, 0.2284]}, {"w": "of", "b": [0.3614, 0.2087, 0.3824, 0.2284]}, {"w": "the", "b": [0.3887, 0.2087, 0.4195, 0.2284]}, {"w": "network", "b": [0.4258, 0.2087, 0.5085, 0.2284]}, {"w": "on", "b": [0.5148, 0.2087, 0.54, 0.2284]}, {"w": "the", "b": [0.5463, 0.2087, 0.5771, 0.2284]}, {"w": "batch,", "b": [0.5835, 0.2087, 0.6444, 0.2284]}, {"w": "a", "b": [0.6507, 0.2087, 0.6619, 0.2284]}, {"w": "measure", "b": [0.6682, 0.2087, 0.7523, 0.2284]}, {"w": "of", "b": [0.7586, 0.2087, 0.7796, 0.2284]}, {"w": "the", "b": [0.7859, 0.2087, 0.8167, 0.2284]}, {"w": "mismatch", "b": [0.1799, 0.2292, 0.278, 0.2489]}, {"w": "between", "b": [0.2843, 0.2292, 0.3683, 0.2489]}, {"w": "y_pred", "b": [0.3746, 0.2302, 0.4654, 0.2504]}, {"w": "and", "b": [0.4717, 0.2292, 0.5081, 0.2489]}, {"w": "y.", "b": [0.5144, 0.2292, 0.5359, 0.2504]}, {"w": "4.", "b": [0.1551, 0.2506, 0.174, 0.2703]}, {"w": "Update", "b": [0.1799, 0.2506, 0.2527, 0.2703]}, {"w": "all", "b": [0.259, 0.2506, 0.2842, 0.2703]}, {"w": "weights", "b": [0.2906, 0.2506, 0.369, 0.2703]}, {"w": "of", "b": [0.3753, 0.2506, 0.3964, 0.2703]}, {"w": "the", "b": [0.4027, 0.2506, 0.4335, 0.2703]}, {"w": "network", "b": [0.4398, 0.2506, 0.5225, 0.2703]}, {"w": "in", "b": [0.5288, 0.2506, 0.5484, 0.2703]}, {"w": "a", "b": [0.5547, 0.2506, 0.5659, 0.2703]}, {"w": "way", "b": [0.5722, 0.2506, 0.6142, 0.2703]}, {"w": "that", "b": [0.6205, 0.2506, 0.6584, 0.2703]}, {"w": "slightly", "b": [0.6647, 0.2506, 0.7404, 0.2703]}, {"w": "reduces", "b": [0.7467, 0.2506, 0.8237, 0.2703]}, {"w": "the", "b": [0.83, 0.2506, 0.8609, 0.2703]}, {"w": "loss", "b": [0.1799, 0.2711, 0.2191, 0.2908]}, {"w": "on", "b": [0.2254, 0.2711, 0.2506, 0.2908]}, {"w": "this", "b": [0.257, 0.2711, 0.2934, 0.2908]}, {"w": "batch.", "b": [0.2997, 0.2711, 0.3607, 0.2908]}]}, {"id": "b_2", "type": "paragraph", "text": "You’ll eventually end up with a network that has a very low loss on its training data: a low mismatch between predictions y_pred and expected targets y. The network has “learned” to map its inputs to correct targets. From afar, it may look like magic, but when you reduce it to elementary steps, it turns out to be simple.", "words": [{"w": "You’ll", "b": [0.1294, 0.3139, 0.1928, 0.3336]}, {"w": "eventually", "b": [0.1991, 0.3139, 0.3042, 0.3336]}, {"w": "end", "b": [0.3105, 0.3139, 0.3469, 0.3336]}, {"w": "up", "b": [0.3532, 0.3139, 0.3784, 0.3336]}, {"w": "with", "b": [0.3847, 0.3139, 0.4296, 0.3336]}, {"w": "a", "b": [0.4359, 0.3139, 0.4471, 0.3336]}, {"w": "network", "b": [0.4534, 0.3139, 0.5361, 0.3336]}, {"w": "that", "b": [0.5424, 0.3139, 0.5802, 0.3336]}, {"w": "has", "b": [0.5865, 0.3139, 0.6201, 0.3336]}, {"w": "a", "b": [0.6264, 0.3139, 0.6376, 0.3336]}, {"w": "very", "b": [0.6439, 0.3139, 0.6888, 0.3336]}, {"w": "low", "b": [0.6951, 0.3139, 0.7329, 0.3336]}, {"w": "loss", "b": [0.7392, 0.3139, 0.7785, 0.3336]}, {"w": "on", "b": [0.7848, 0.3139, 0.81, 0.3336]}, {"w": "its", "b": [0.8163, 0.3139, 0.8401, 0.3336]}, {"w": "training", "b": [0.1294, 0.3344, 0.2079, 0.3541]}, {"w": "data:", "b": [0.2142, 0.3344, 0.2632, 0.3541]}, {"w": "a", "b": [0.2695, 0.3344, 0.2807, 0.3541]}, {"w": "low", "b": [0.287, 0.3344, 0.3249, 0.3541]}, {"w": "mismatch", "b": [0.3312, 0.3344, 0.4293, 0.3541]}, {"w": "between", "b": [0.4356, 0.3344, 0.5197, 0.3541]}, {"w": "predictions", "b": [0.526, 0.3344, 0.6381, 0.3541]}, {"w": "y_pred", "b": [0.6443, 0.3354, 0.7351, 0.3556]}, {"w": "and", "b": [0.7414, 0.3344, 0.7778, 0.3541]}, {"w": "expected", "b": [0.1294, 0.3557, 0.2191, 0.3755]}, {"w": "targets", "b": [0.2254, 0.3557, 0.2921, 0.3755]}, {"w": "y.", "b": [0.2984, 0.3557, 0.3199, 0.377]}, {"w": "The", "b": [0.3262, 0.3557, 0.3654, 0.3755]}, {"w": "network", "b": [0.3717, 0.3557, 0.4544, 0.3755]}, {"w": "has", "b": [0.4607, 0.3557, 0.4943, 0.3755]}, {"w": "“learned”", "b": [0.5006, 0.3557, 0.5972, 0.3755]}, {"w": "to", "b": [0.6036, 0.3557, 0.6232, 0.3755]}, {"w": "map", "b": [0.6295, 0.3557, 0.6729, 0.3755]}, {"w": "its", "b": [0.6792, 0.3557, 0.7031, 0.3755]}, {"w": "inputs", "b": [0.7094, 0.3557, 0.7711, 0.3755]}, {"w": "to", "b": [0.7774, 0.3557, 0.797, 0.3755]}, {"w": "correct", "b": [0.1294, 0.3771, 0.1994, 0.3969]}, {"w": "targets.", "b": [0.2057, 0.3771, 0.2788, 0.3969]}, {"w": "From", "b": [0.2851, 0.3771, 0.3398, 0.3969]}, {"w": "afar,", "b": [0.3461, 0.3771, 0.3906, 0.3969]}, {"w": "it", "b": [0.3969, 0.3771, 0.4109, 0.3969]}, {"w": "may", "b": [0.4172, 0.3771, 0.4607, 0.3969]}, {"w": "look", "b": [0.467, 0.3771, 0.5118, 0.3969]}, {"w": "like", "b": [0.5181, 0.3771, 0.556, 0.3969]}, {"w": "magic,", "b": [0.5623, 0.3771, 0.6302, 0.3969]}, {"w": "but", "b": [0.6365, 0.3771, 0.6688, 0.3969]}, {"w": "when", "b": [0.6751, 0.3771, 0.7297, 0.3969]}, {"w": "you", "b": [0.736, 0.3771, 0.7739, 0.3969]}, {"w": "reduce", "b": [0.7802, 0.3771, 0.8474, 0.3969]}, {"w": "it", "b": [0.8537, 0.3771, 0.8677, 0.3969]}, {"w": "to", "b": [0.1294, 0.3976, 0.149, 0.4174]}, {"w": "elementary", "b": [0.1553, 0.3976, 0.2674, 0.4174]}, {"w": "steps,", "b": [0.2737, 0.3976, 0.3305, 0.4174]}, {"w": "it", "b": [0.3368, 0.3976, 0.3508, 0.4174]}, {"w": "turns", "b": [0.3571, 0.3976, 0.4076, 0.4174]}, {"w": "out", "b": [0.4139, 0.3976, 0.4461, 0.4174]}, {"w": "to", "b": [0.4524, 0.3976, 0.4721, 0.4174]}, {"w": "be", "b": [0.4784, 0.3976, 0.5022, 0.4174]}, {"w": "simple.", "b": [0.5085, 0.3976, 0.5821, 0.4174]}]}, {"id": "b_3", "type": "paragraph", "text": "Step 1 sounds easy enough—just I/O code. Steps 2 and 3 are merely the application of a handful of tensor operations, so you could implement these steps purely from what you learned in the previous section. The difficult part is step 4: updating the network’s weights. Given an individual weight coefficient in the network, how can you compute whether the coefficient should be increased or decreased, and by how much?", "words": [{"w": "Step", "b": [0.1294, 0.4404, 0.1743, 0.4602]}, {"w": "1", "b": [0.1806, 0.4404, 0.1932, 0.4602]}, {"w": "sounds", "b": [0.1995, 0.4404, 0.2696, 0.4602]}, {"w": "easy", "b": [0.2759, 0.4404, 0.3207, 0.4602]}, {"w": "enough—just", "b": [0.327, 0.4404, 0.4629, 0.4602]}, {"w": "I/O", "b": [0.4693, 0.4404, 0.5029, 0.4602]}, {"w": "code.", "b": [0.5092, 0.4404, 0.5631, 0.4602]}, {"w": "Steps", "b": [0.5694, 0.4404, 0.6241, 0.4602]}, {"w": "2", "b": [0.6304, 0.4404, 0.643, 0.4602]}, {"w": "and", "b": [0.6493, 0.4404, 0.6857, 0.4602]}, {"w": "3", "b": [0.692, 0.4404, 0.7047, 0.4602]}, {"w": "are", "b": [0.711, 0.4404, 0.7418, 0.4602]}, {"w": "merely", "b": [0.7481, 0.4404, 0.8181, 0.4602]}, {"w": "the", "b": [0.8244, 0.4404, 0.8553, 0.4602]}, {"w": "application", "b": [0.1294, 0.4609, 0.2415, 0.4807]}, {"w": "of", "b": [0.2478, 0.4609, 0.2688, 0.4807]}, {"w": "a", "b": [0.2751, 0.4609, 0.2863, 0.4807]}, {"w": "handful", "b": [0.2926, 0.4609, 0.3697, 0.4807]}, {"w": "of", "b": [0.376, 0.4609, 0.397, 0.4807]}, {"w": "tensor", "b": [0.4033, 0.4609, 0.465, 0.4807]}, {"w": "operations,", "b": [0.4713, 0.4609, 0.5827, 0.4807]}, {"w": "so", "b": [0.589, 0.4609, 0.6114, 0.4807]}, {"w": "you", "b": [0.6177, 0.4609, 0.6556, 0.4807]}, {"w": "could", "b": [0.6618, 0.4609, 0.7179, 0.4807]}, {"w": "implement", "b": [0.7242, 0.4609, 0.8321, 0.4807]}, {"w": "these", "b": [0.1294, 0.4814, 0.1813, 0.5012]}, {"w": "steps", "b": [0.1876, 0.4814, 0.238, 0.5012]}, {"w": "purely", "b": [0.2443, 0.4814, 0.3088, 0.5012]}, {"w": "from", "b": [0.3151, 0.4814, 0.3641, 0.5012]}, {"w": "what", "b": [0.3704, 0.4814, 0.4195, 0.5012]}, {"w": "you", "b": [0.4258, 0.4814, 0.4636, 0.5012]}, {"w": "learned", "b": [0.4699, 0.4814, 0.5441, 0.5012]}, {"w": "in", "b": [0.5505, 0.4814, 0.5701, 0.5012]}, {"w": "the", "b": [0.5764, 0.4814, 0.6072, 0.5012]}, {"w": "previous", "b": [0.6135, 0.4814, 0.7004, 0.5012]}, {"w": "section.", "b": [0.7067, 0.4814, 0.7845, 0.5012]}, {"w": "The", "b": [0.7908, 0.4814, 0.83, 0.5012]}, {"w": "difficult", "b": [0.1294, 0.5019, 0.2102, 0.5217]}, {"w": "part", "b": [0.2165, 0.5019, 0.2558, 0.5217]}, {"w": "is", "b": [0.2621, 0.5019, 0.2789, 0.5217]}, {"w": "step", "b": [0.2852, 0.5019, 0.3258, 0.5217]}, {"w": "4:", "b": [0.3321, 0.5019, 0.3518, 0.5217]}, {"w": "updating", "b": [0.3581, 0.5019, 0.4464, 0.5217]}, {"w": "the", "b": [0.4527, 0.5019, 0.4835, 0.5217]}, {"w": "network’s", "b": [0.4897, 0.5019, 0.5892, 0.5217]}, {"w": "weights.", "b": [0.5955, 0.5019, 0.6803, 0.5217]}, {"w": "Given", "b": [0.6866, 0.5019, 0.7483, 0.5217]}, {"w": "an", "b": [0.7546, 0.5019, 0.7784, 0.5217]}, {"w": "individual", "b": [0.1294, 0.5224, 0.2317, 0.5422]}, {"w": "weight", "b": [0.238, 0.5224, 0.3067, 0.5422]}, {"w": "coefficient", "b": [0.313, 0.5224, 0.4204, 0.5422]}, {"w": "in", "b": [0.4267, 0.5224, 0.4463, 0.5422]}, {"w": "the", "b": [0.4526, 0.5224, 0.4834, 0.5422]}, {"w": "network,", "b": [0.4897, 0.5224, 0.5787, 0.5422]}, {"w": "how", "b": [0.585, 0.5224, 0.6285, 0.5422]}, {"w": "can", "b": [0.6348, 0.5224, 0.6698, 0.5422]}, {"w": "you", "b": [0.6761, 0.5224, 0.7139, 0.5422]}, {"w": "compute", "b": [0.7202, 0.5224, 0.8071, 0.5422]}, {"w": "whether", "b": [0.1294, 0.5429, 0.2107, 0.5627]}, {"w": "the", "b": [0.217, 0.5429, 0.2478, 0.5627]}, {"w": "coefficient", "b": [0.2541, 0.5429, 0.3615, 0.5627]}, {"w": "should", "b": [0.3678, 0.5429, 0.4351, 0.5627]}, {"w": "be", "b": [0.4413, 0.5429, 0.4652, 0.5627]}, {"w": "increased", "b": [0.4715, 0.5429, 0.5667, 0.5627]}, {"w": "or", "b": [0.573, 0.5429, 0.594, 0.5627]}, {"w": "decreased,", "b": [0.6003, 0.5429, 0.7061, 0.5627]}, {"w": "and", "b": [0.7124, 0.5429, 0.7488, 0.5627]}, {"w": "by", "b": [0.7551, 0.5429, 0.7804, 0.5627]}, {"w": "how", "b": [0.7867, 0.5429, 0.8301, 0.5627]}, {"w": "much?", "b": [0.1294, 0.5634, 0.1967, 0.5832]}]}, {"id": "b_4", "type": "paragraph", "text": "One naive solution would be to freeze all weights in the network except the one scalar coefficient being considered, and try different values for this coefficient. Let’s say the initial value of the coefficient is 0.3. After the forward pass on a batch of data, the loss of the network on the batch is 0.5. If you change the coefficient’s value to 0.35 and rerun the forward pass, the loss increases to 0.6. But if you lower the coefficient to 0.25, the loss falls to 0.4. In this case, it seems that updating the coefficient by -0.05 would contribute to minimizing the loss. This would have to be repeated for all coefficients in the network.", "words": [{"w": "One", "b": [0.1294, 0.6062, 0.1714, 0.6259]}, {"w": "naive", "b": [0.1777, 0.6062, 0.2324, 0.6259]}, {"w": "solution", "b": [0.2387, 0.6062, 0.32, 0.6259]}, {"w": "would", "b": [0.3263, 0.6062, 0.3894, 0.6259]}, {"w": "be", "b": [0.3957, 0.6062, 0.4195, 0.6259]}, {"w": "to", "b": [0.4258, 0.6062, 0.4454, 0.6259]}, {"w": "freeze", "b": [0.4517, 0.6062, 0.5133, 0.6259]}, {"w": "all", "b": [0.5196, 0.6062, 0.5449, 0.6259]}, {"w": "weights", "b": [0.5512, 0.6062, 0.6296, 0.6259]}, {"w": "in", "b": [0.6359, 0.6062, 0.6556, 0.6259]}, {"w": "the", "b": [0.6619, 0.6062, 0.6927, 0.6259]}, {"w": "network", "b": [0.699, 0.6062, 0.7817, 0.6259]}, {"w": "except", "b": [0.788, 0.6062, 0.8538, 0.6259]}, {"w": "the", "b": [0.1294, 0.6267, 0.1602, 0.6464]}, {"w": "one", "b": [0.1665, 0.6267, 0.203, 0.6464]}, {"w": "scalar", "b": [0.2093, 0.6267, 0.2681, 0.6464]}, {"w": "coefficient", "b": [0.2744, 0.6267, 0.3818, 0.6464]}, {"w": "being", "b": [0.3881, 0.6267, 0.4441, 0.6464]}, {"w": "considered,", "b": [0.4505, 0.6267, 0.566, 0.6464]}, {"w": "and", "b": [0.5723, 0.6267, 0.6088, 0.6464]}, {"w": "try", "b": [0.6151, 0.6267, 0.6431, 0.6464]}, {"w": "different", "b": [0.6494, 0.6267, 0.7358, 0.6464]}, {"w": "values", "b": [0.7421, 0.6267, 0.8065, 0.6464]}, {"w": "for", "b": [0.8128, 0.6267, 0.8422, 0.6464]}, {"w": "this", "b": [0.1294, 0.6472, 0.1659, 0.6669]}, {"w": "coefficient.", "b": [0.1722, 0.6472, 0.2859, 0.6669]}, {"w": "Let’s", "b": [0.2922, 0.6472, 0.3426, 0.6669]}, {"w": "say", "b": [0.3489, 0.6472, 0.3825, 0.6669]}, {"w": "the", "b": [0.3888, 0.6472, 0.4197, 0.6669]}, {"w": "initial", "b": [0.426, 0.6472, 0.4848, 0.6669]}, {"w": "value", "b": [0.4911, 0.6472, 0.5458, 0.6669]}, {"w": "of", "b": [0.5521, 0.6472, 0.5731, 0.6669]}, {"w": "the", "b": [0.5794, 0.6472, 0.6102, 0.6669]}, {"w": "coefficient", "b": [0.6165, 0.6472, 0.7239, 0.6669]}, {"w": "is", "b": [0.7302, 0.6472, 0.747, 0.6669]}, {"w": "0.3.", "b": [0.7533, 0.6472, 0.7912, 0.6669]}, {"w": "After", "b": [0.7975, 0.6472, 0.8507, 0.6669]}, {"w": "the", "b": [0.1294, 0.6677, 0.1602, 0.6874]}, {"w": "forward", "b": [0.1665, 0.6677, 0.2464, 0.6874]}, {"w": "pass", "b": [0.2527, 0.6677, 0.2961, 0.6874]}, {"w": "on", "b": [0.3024, 0.6677, 0.3277, 0.6874]}, {"w": "a", "b": [0.334, 0.6677, 0.3452, 0.6874]}, {"w": "batch", "b": [0.3515, 0.6677, 0.4061, 0.6874]}, {"w": "of", "b": [0.4124, 0.6677, 0.4334, 0.6874]}, {"w": "data,", "b": [0.4397, 0.6677, 0.4881, 0.6874]}, {"w": "the", "b": [0.4944, 0.6677, 0.5252, 0.6874]}, {"w": "loss", "b": [0.5315, 0.6677, 0.5707, 0.6874]}, {"w": "of", "b": [0.5771, 0.6677, 0.5981, 0.6874]}, {"w": "the", "b": [0.6044, 0.6677, 0.6352, 0.6874]}, {"w": "network", "b": [0.6415, 0.6677, 0.7242, 0.6874]}, {"w": "on", "b": [0.7305, 0.6677, 0.7557, 0.6874]}, {"w": "the", "b": [0.762, 0.6677, 0.7928, 0.6874]}, {"w": "batch", "b": [0.7991, 0.6677, 0.8538, 0.6874]}, {"w": "is", "b": [0.1294, 0.6882, 0.1462, 0.7079]}, {"w": "0.5.", "b": [0.1525, 0.6882, 0.1904, 0.7079]}, {"w": "If", "b": [0.1967, 0.6882, 0.2135, 0.7079]}, {"w": "you", "b": [0.2198, 0.6882, 0.2576, 0.7079]}, {"w": "change", "b": [0.2639, 0.6882, 0.3354, 0.7079]}, {"w": "the", "b": [0.3417, 0.6882, 0.3725, 0.7079]}, {"w": "coefficient’s", "b": [0.3788, 0.6882, 0.503, 0.7079]}, {"w": "value", "b": [0.5093, 0.6882, 0.5639, 0.7079]}, {"w": "to", "b": [0.5703, 0.6882, 0.5899, 0.7079]}, {"w": "0.35", "b": [0.5962, 0.6882, 0.6403, 0.7079]}, {"w": "and", "b": [0.6466, 0.6882, 0.6831, 0.7079]}, {"w": "rerun", "b": [0.6894, 0.6882, 0.7426, 0.7079]}, {"w": "the", "b": [0.7489, 0.6882, 0.7797, 0.7079]}, {"w": "forward", "b": [0.786, 0.6882, 0.8659, 0.7079]}, {"w": "pass,", "b": [0.1294, 0.7087, 0.1792, 0.7284]}, {"w": "the", "b": [0.1855, 0.7087, 0.2163, 0.7284]}, {"w": "loss", "b": [0.2226, 0.7087, 0.2618, 0.7284]}, {"w": "increases", "b": [0.2682, 0.7087, 0.3606, 0.7284]}, {"w": "to", "b": [0.3669, 0.7087, 0.3865, 0.7284]}, {"w": "0.6.", "b": [0.3928, 0.7087, 0.4307, 0.7284]}, {"w": "But", "b": [0.437, 0.7087, 0.4734, 0.7284]}, {"w": "if", "b": [0.4797, 0.7087, 0.4952, 0.7284]}, {"w": "you", "b": [0.5015, 0.7087, 0.5393, 0.7284]}, {"w": "lower", "b": [0.5456, 0.7087, 0.6031, 0.7284]}, {"w": "the", "b": [0.6094, 0.7087, 0.6402, 0.7284]}, {"w": "coefficient", "b": [0.6465, 0.7087, 0.7539, 0.7284]}, {"w": "to", "b": [0.7602, 0.7087, 0.7798, 0.7284]}, {"w": "0.25,", "b": [0.7861, 0.7087, 0.8365, 0.7284]}, {"w": "the", "b": [0.1294, 0.7292, 0.1602, 0.7489]}, {"w": "loss", "b": [0.1665, 0.7292, 0.2058, 0.7489]}, {"w": "falls", "b": [0.2121, 0.7292, 0.2555, 0.7489]}, {"w": "to", "b": [0.2618, 0.7292, 0.2815, 0.7489]}, {"w": "0.4.", "b": [0.2878, 0.7292, 0.3256, 0.7489]}, {"w": "In", "b": [0.3319, 0.7292, 0.3529, 0.7489]}, {"w": "this", "b": [0.3592, 0.7292, 0.3957, 0.7489]}, {"w": "case,", "b": [0.402, 0.7292, 0.4517, 0.7489]}, {"w": "it", "b": [0.458, 0.7292, 0.4721, 0.7489]}, {"w": "seems", "b": [0.4784, 0.7292, 0.54, 0.7489]}, {"w": "that", "b": [0.5463, 0.7292, 0.5842, 0.7489]}, {"w": "updating", "b": [0.5904, 0.7292, 0.6787, 0.7489]}, {"w": "the", "b": [0.685, 0.7292, 0.7158, 0.7489]}, {"w": "coefficient", "b": [0.7221, 0.7292, 0.8295, 0.7489]}, {"w": "by", "b": [0.8358, 0.7292, 0.861, 0.7489]}, {"w": "-0.05", "b": [0.1294, 0.7497, 0.182, 0.7694]}, {"w": "would", "b": [0.1883, 0.7497, 0.2513, 0.7694]}, {"w": "contribute", "b": [0.2576, 0.7497, 0.3599, 0.7694]}, {"w": "to", "b": [0.3662, 0.7497, 0.3859, 0.7694]}, {"w": "minimizing", "b": [0.3922, 0.7497, 0.5085, 0.7694]}, {"w": "the", "b": [0.5148, 0.7497, 0.5456, 0.7694]}, {"w": "loss.", "b": [0.5519, 0.7497, 0.5975, 0.7694]}, {"w": "This", "b": [0.6038, 0.7497, 0.6487, 0.7694]}, {"w": "would", "b": [0.655, 0.7497, 0.718, 0.7694]}, {"w": "have", "b": [0.7243, 0.7497, 0.772, 0.7694]}, {"w": "to", "b": [0.7783, 0.7497, 0.7979, 0.7694]}, {"w": "be", "b": [0.8042, 0.7497, 0.828, 0.7694]}, {"w": "repeated", "b": [0.1294, 0.7702, 0.2149, 0.7899]}, {"w": "for", "b": [0.2212, 0.7702, 0.2506, 0.7899]}, {"w": "all", "b": [0.2569, 0.7702, 0.2821, 0.7899]}, {"w": "coefficients", "b": [0.2884, 0.7702, 0.4056, 0.7899]}, {"w": "in", "b": [0.4119, 0.7702, 0.4315, 0.7899]}, {"w": "the", "b": [0.4378, 0.7702, 0.4687, 0.7899]}, {"w": "network.", "b": [0.475, 0.7702, 0.5639, 0.7899]}]}, {"id": "b_5", "type": "paragraph", "text": "But such an approach would be horribly inefficient, because you’d need to compute two forward passes (which are expensive) for every individual coefficient (of which there are many, usually thousands and sometimes up to millions). A much better approach is to take advantage", "words": [{"w": "But", "b": [0.1294, 0.813, 0.1659, 0.8327]}, {"w": "such", "b": [0.1722, 0.813, 0.2184, 0.8327]}, {"w": "an", "b": [0.2247, 0.813, 0.2485, 0.8327]}, {"w": "approach", "b": [0.2548, 0.813, 0.3473, 0.8327]}, {"w": "would", "b": [0.3536, 0.813, 0.4167, 0.8327]}, {"w": "be", "b": [0.423, 0.813, 0.4468, 0.8327]}, {"w": "horribly", "b": [0.4531, 0.813, 0.5344, 0.8327]}, {"w": "inefficient,", "b": [0.5407, 0.813, 0.6502, 0.8327]}, {"w": "because", "b": [0.6565, 0.813, 0.7363, 0.8327]}, {"w": "you’d", "b": [0.7426, 0.813, 0.8015, 0.8327]}, {"w": "need", "b": [0.8078, 0.813, 0.8554, 0.8327]}, {"w": "to", "b": [0.1294, 0.8335, 0.149, 0.8532]}, {"w": "compute", "b": [0.1553, 0.8335, 0.2422, 0.8532]}, {"w": "two", "b": [0.2485, 0.8335, 0.2864, 0.8532]}, {"w": "forward", "b": [0.2927, 0.8335, 0.3725, 0.8532]}, {"w": "passes", "b": [0.3788, 0.8335, 0.4433, 0.8532]}, {"w": "(which", "b": [0.4496, 0.8335, 0.5196, 0.8532]}, {"w": "are", "b": [0.5259, 0.8335, 0.5567, 0.8532]}, {"w": "expensive)", "b": [0.563, 0.8335, 0.6723, 0.8532]}, {"w": "for", "b": [0.6786, 0.8335, 0.708, 0.8532]}, {"w": "every", "b": [0.7143, 0.8335, 0.7703, 0.8532]}, {"w": "individual", "b": [0.1294, 0.854, 0.2317, 0.8737]}, {"w": "coefficient", "b": [0.238, 0.854, 0.3454, 0.8737]}, {"w": "(of", "b": [0.3517, 0.854, 0.3811, 0.8737]}, {"w": "which", "b": [0.3874, 0.854, 0.4491, 0.8737]}, {"w": "there", "b": [0.4554, 0.854, 0.5058, 0.8737]}, {"w": "are", "b": [0.5121, 0.854, 0.5429, 0.8737]}, {"w": "many,", "b": [0.5492, 0.854, 0.6099, 0.8737]}, {"w": "usually", "b": [0.6162, 0.854, 0.6891, 0.8737]}, {"w": "thousands", "b": [0.6954, 0.854, 0.7963, 0.8737]}, {"w": "and", "b": [0.8026, 0.854, 0.839, 0.8737]}, {"w": "sometimes", "b": [0.1294, 0.8745, 0.2373, 0.8942]}, {"w": "up", "b": [0.2436, 0.8745, 0.2689, 0.8942]}, {"w": "to", "b": [0.2752, 0.8745, 0.2948, 0.8942]}, {"w": "millions).", "b": [0.3011, 0.8745, 0.3985, 0.8942]}, {"w": "A", "b": [0.4048, 0.8745, 0.423, 0.8942]}, {"w": "much", "b": [0.4293, 0.8745, 0.4854, 0.8942]}, {"w": "better", "b": [0.4917, 0.8745, 0.5491, 0.8942]}, {"w": "approach", "b": [0.5554, 0.8745, 0.6478, 0.8942]}, {"w": "is", "b": [0.6542, 0.8745, 0.671, 0.8942]}, {"w": "to", "b": [0.6773, 0.8745, 0.6969, 0.8942]}, {"w": "take", "b": [0.7032, 0.8745, 0.7452, 0.8942]}, {"w": "advantage", "b": [0.7515, 0.8745, 0.8538, 0.8942]}]}]}, {"page": 84, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "of the fact that all operations used in the network are differentiable, and compute the gradient of the loss with regard to the network’s coefficients. You can then move the coefficients in the opposite direction from the gradient, thus decreasing the loss.", "words": [{"w": "of", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "the", "b": [0.1567, 0.0857, 0.1876, 0.1054]}, {"w": "fact", "b": [0.1939, 0.0857, 0.2317, 0.1054]}, {"w": "that", "b": [0.238, 0.0857, 0.2758, 0.1054]}, {"w": "all", "b": [0.2821, 0.0857, 0.3074, 0.1054]}, {"w": "operations", "b": [0.3137, 0.0857, 0.4188, 0.1054]}, {"w": "used", "b": [0.4251, 0.0857, 0.4713, 0.1054]}, {"w": "in", "b": [0.4776, 0.0857, 0.4972, 0.1054]}, {"w": "the", "b": [0.5035, 0.0857, 0.5344, 0.1054]}, {"w": "network", "b": [0.5407, 0.0857, 0.6233, 0.1054]}, {"w": "are", "b": [0.6296, 0.0857, 0.6604, 0.1054]}, {"w": "differentiable,", "b": [0.6667, 0.0857, 0.8079, 0.1054]}, {"w": "and", "b": [0.8142, 0.0857, 0.8507, 0.1054]}, {"w": "compute", "b": [0.1294, 0.1062, 0.2163, 0.1259]}, {"w": "the", "b": [0.2226, 0.1062, 0.2534, 0.1259]}, {"w": "gradient", "b": [0.2597, 0.1062, 0.3452, 0.1259]}, {"w": "of", "b": [0.3515, 0.1062, 0.3725, 0.1259]}, {"w": "the", "b": [0.3788, 0.1062, 0.4096, 0.1259]}, {"w": "loss", "b": [0.4159, 0.1062, 0.4552, 0.1259]}, {"w": "with", "b": [0.4615, 0.1062, 0.5063, 0.1259]}, {"w": "regard", "b": [0.5126, 0.1062, 0.5771, 0.1259]}, {"w": "to", "b": [0.5834, 0.1062, 0.603, 0.1259]}, {"w": "the", "b": [0.6093, 0.1062, 0.6401, 0.1259]}, {"w": "network’s", "b": [0.6464, 0.1062, 0.7459, 0.1259]}, {"w": "coefficients.", "b": [0.1294, 0.1267, 0.2529, 0.1464]}, {"w": "You", "b": [0.2592, 0.1267, 0.3001, 0.1464]}, {"w": "can", "b": [0.3064, 0.1267, 0.3415, 0.1464]}, {"w": "then", "b": [0.3478, 0.1267, 0.3912, 0.1464]}, {"w": "move", "b": [0.3975, 0.1267, 0.4536, 0.1464]}, {"w": "the", "b": [0.4599, 0.1267, 0.4907, 0.1464]}, {"w": "coefficients", "b": [0.497, 0.1267, 0.6142, 0.1464]}, {"w": "in", "b": [0.6205, 0.1267, 0.6401, 0.1464]}, {"w": "the", "b": [0.6464, 0.1267, 0.6773, 0.1464]}, {"w": "opposite", "b": [0.6836, 0.1267, 0.769, 0.1464]}, {"w": "direction", "b": [0.7754, 0.1267, 0.865, 0.1464]}, {"w": "from", "b": [0.1294, 0.1472, 0.1785, 0.1669]}, {"w": "the", "b": [0.1848, 0.1472, 0.2156, 0.1669]}, {"w": "gradient,", "b": [0.2219, 0.1472, 0.3109, 0.1669]}, {"w": "thus", "b": [0.3172, 0.1472, 0.3592, 0.1669]}, {"w": "decreasing", "b": [0.3655, 0.1472, 0.4734, 0.1669]}, {"w": "the", "b": [0.4797, 0.1472, 0.5105, 0.1669]}, {"w": "loss.", "b": [0.5168, 0.1472, 0.5624, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "If you already know what differentiable means and what a gradient is, you can skip to section 2.4.3. Otherwise, the following two sections will help you understand these concepts.", "words": [{"w": "If", "b": [0.1294, 0.19, 0.1462, 0.2097]}, {"w": "you", "b": [0.1525, 0.19, 0.1904, 0.2097]}, {"w": "already", "b": [0.1967, 0.19, 0.2709, 0.2097]}, {"w": "know", "b": [0.2772, 0.19, 0.3333, 0.2097]}, {"w": "what", "b": [0.3396, 0.19, 0.3886, 0.2097]}, {"w": "differentiable", "b": [0.3949, 0.19, 0.5299, 0.2097]}, {"w": "means", "b": [0.5362, 0.19, 0.6006, 0.2097]}, {"w": "and", "b": [0.6069, 0.19, 0.6433, 0.2097]}, {"w": "what", "b": [0.6496, 0.19, 0.6987, 0.2097]}, {"w": "a", "b": [0.705, 0.19, 0.7162, 0.2097]}, {"w": "gradient", "b": [0.7225, 0.19, 0.808, 0.2097]}, {"w": "is,", "b": [0.8143, 0.19, 0.8374, 0.2097]}, {"w": "you", "b": [0.1294, 0.2105, 0.1673, 0.2302]}, {"w": "can", "b": [0.1736, 0.2105, 0.2086, 0.2302]}, {"w": "skip", "b": [0.2149, 0.2105, 0.2569, 0.2302]}, {"w": "to", "b": [0.2632, 0.2105, 0.2829, 0.2302]}, {"w": "section", "b": [0.2891, 0.2105, 0.3606, 0.2302]}, {"w": "2.4.3.", "b": [0.3669, 0.2105, 0.4236, 0.2302]}, {"w": "Otherwise,", "b": [0.43, 0.2105, 0.5399, 0.2302]}, {"w": "the", "b": [0.5462, 0.2105, 0.5771, 0.2302]}, {"w": "following", "b": [0.5834, 0.2105, 0.6815, 0.2302]}, {"w": "two", "b": [0.6878, 0.2105, 0.7256, 0.2302]}, {"w": "sections", "b": [0.7319, 0.2105, 0.8132, 0.2302]}, {"w": "will", "b": [0.8195, 0.2105, 0.8588, 0.2302]}, {"w": "help", "b": [0.1294, 0.231, 0.1729, 0.2507]}, {"w": "you", "b": [0.1792, 0.231, 0.217, 0.2507]}, {"w": "understand", "b": [0.2233, 0.231, 0.334, 0.2507]}, {"w": "these", "b": [0.3403, 0.231, 0.3921, 0.2507]}, {"w": "concepts.", "b": [0.3984, 0.231, 0.493, 0.2507]}]}, {"id": "b_2", "type": "paragraph", "text": "2.4.1. What’s a derivative?", "words": [{"w": "2.4.1.", "b": [0.1294, 0.2782, 0.1862, 0.2979]}, {"w": "What’s", "b": [0.1925, 0.2782, 0.27, 0.2979]}, {"w": "a", "b": [0.2763, 0.2782, 0.2889, 0.2979]}, {"w": "derivative?", "b": [0.2952, 0.2782, 0.4158, 0.2979]}]}, {"id": "b_3", "type": "paragraph", "text": "Consider a continuous, smooth function f(x) = y, mapping a real number x to a new real number y. Because the function is continuous, a small change in x can only result in a small change in y—that’s the intuition behind continuity. Let’s say you increase x by a small factor epsilon_x: this results in a small epsilon_y change to y:", "words": [{"w": "Consider", "b": [0.1294, 0.321, 0.2205, 0.3407]}, {"w": "a", "b": [0.2268, 0.321, 0.238, 0.3407]}, {"w": "continuous,", "b": [0.2443, 0.321, 0.3613, 0.3407]}, {"w": "smooth", "b": [0.3676, 0.321, 0.4419, 0.3407]}, {"w": "function", "b": [0.4482, 0.321, 0.5323, 0.3407]}, {"w": "f(x)", "b": [0.5386, 0.322, 0.5991, 0.3422]}, {"w": "=", "b": [0.6143, 0.322, 0.6294, 0.3422]}, {"w": "y,", "b": [0.6445, 0.321, 0.666, 0.3422]}, {"w": "mapping", "b": [0.6723, 0.321, 0.7606, 0.3407]}, {"w": "a", "b": [0.7669, 0.321, 0.7781, 0.3407]}, {"w": "real", "b": [0.7844, 0.321, 0.8222, 0.3407]}, {"w": "number", "b": [0.1294, 0.3424, 0.2065, 0.3621]}, {"w": "x", "b": [0.2128, 0.3434, 0.2279, 0.3636]}, {"w": "to", "b": [0.2342, 0.3424, 0.2538, 0.3621]}, {"w": "a", "b": [0.2601, 0.3424, 0.2713, 0.3621]}, {"w": "new", "b": [0.2777, 0.3424, 0.3197, 0.3621]}, {"w": "real", "b": [0.326, 0.3424, 0.3638, 0.3621]}, {"w": "number", "b": [0.3701, 0.3424, 0.4472, 0.3621]}, {"w": "y.", "b": [0.4534, 0.3424, 0.4749, 0.3636]}, {"w": "Because", "b": [0.4812, 0.3424, 0.5652, 0.3621]}, {"w": "the", "b": [0.5716, 0.3424, 0.6024, 0.3621]}, {"w": "function", "b": [0.6087, 0.3424, 0.6928, 0.3621]}, {"w": "is", "b": [0.6991, 0.3424, 0.7159, 0.3621]}, {"w": "continuous,", "b": [0.7222, 0.3424, 0.8392, 0.3621]}, {"w": "a", "b": [0.8455, 0.3424, 0.8567, 0.3621]}, {"w": "small", "b": [0.1294, 0.3638, 0.1841, 0.3835]}, {"w": "change", "b": [0.1904, 0.3638, 0.2618, 0.3835]}, {"w": "in", "b": [0.2681, 0.3638, 0.2878, 0.3835]}, {"w": "x", "b": [0.294, 0.3648, 0.3092, 0.385]}, {"w": "can", "b": [0.3155, 0.3638, 0.3505, 0.3835]}, {"w": "only", "b": [0.3568, 0.3638, 0.4016, 0.3835]}, {"w": "result", "b": [0.4079, 0.3638, 0.464, 0.3835]}, {"w": "in", "b": [0.4703, 0.3638, 0.4899, 0.3835]}, {"w": "a", "b": [0.4962, 0.3638, 0.5074, 0.3835]}, {"w": "small", "b": [0.5137, 0.3638, 0.5684, 0.3835]}, {"w": "change", "b": [0.5747, 0.3638, 0.6462, 0.3835]}, {"w": "in", "b": [0.6525, 0.3638, 0.6721, 0.3835]}, {"w": "y—that’s", "b": [0.6783, 0.3638, 0.7733, 0.385]}, {"w": "the", "b": [0.7796, 0.3638, 0.8105, 0.3835]}, {"w": "intuition", "b": [0.1294, 0.3852, 0.2149, 0.4049]}, {"w": "behind", "b": [0.2212, 0.3852, 0.2899, 0.4049]}, {"w": "continuity.", "b": [0.2962, 0.3852, 0.4031, 0.4049]}, {"w": "Let’s", "b": [0.4094, 0.3852, 0.4599, 0.4049]}, {"w": "say", "b": [0.4662, 0.3852, 0.4998, 0.4049]}, {"w": "you", "b": [0.5061, 0.3852, 0.544, 0.4049]}, {"w": "increase", "b": [0.5503, 0.3852, 0.6329, 0.4049]}, {"w": "x", "b": [0.6392, 0.3862, 0.6543, 0.4064]}, {"w": "by", "b": [0.6606, 0.3852, 0.6859, 0.4049]}, {"w": "a", "b": [0.6922, 0.3852, 0.7034, 0.4049]}, {"w": "small", "b": [0.7097, 0.3852, 0.7643, 0.4049]}, {"w": "factor", "b": [0.7706, 0.3852, 0.8295, 0.4049]}, {"w": "epsilon_x:", "b": [0.1294, 0.4066, 0.2727, 0.4278]}, {"w": "this", "b": [0.279, 0.4066, 0.3154, 0.4263]}, {"w": "results", "b": [0.3217, 0.4066, 0.3876, 0.4263]}, {"w": "in", "b": [0.3939, 0.4066, 0.4135, 0.4263]}, {"w": "a", "b": [0.4198, 0.4066, 0.431, 0.4263]}, {"w": "small", "b": [0.4373, 0.4066, 0.492, 0.4263]}, {"w": "epsilon_y", "b": [0.4983, 0.4076, 0.6345, 0.4278]}, {"w": "change", "b": [0.6408, 0.4066, 0.7122, 0.4263]}, {"w": "to", "b": [0.7186, 0.4066, 0.7382, 0.4263]}, {"w": "y:", "b": [0.7445, 0.4066, 0.7666, 0.4278]}]}, {"id": "b_4", "type": "equation", "text": "f(x + epsilon_x) = y + epsilon_y", "words": [{"w": "f(x", "b": [0.1357, 0.4452, 0.1698, 0.4603]}, {"w": "+", "b": [0.1811, 0.4452, 0.1925, 0.4603]}, {"w": "epsilon_x)", "b": [0.2038, 0.4452, 0.3173, 0.4603]}, {"w": "=", "b": [0.3287, 0.4452, 0.34, 0.4603]}, {"w": "y", "b": [0.3514, 0.4452, 0.3628, 0.4603]}, {"w": "+", "b": [0.3741, 0.4452, 0.3855, 0.4603]}, {"w": "epsilon_y", "b": [0.3968, 0.4452, 0.499, 0.4603]}]}, {"id": "b_5", "type": "paragraph", "text": "In addition, because the function is smooth (its curve doesn’t have any abrupt angles), when epsilon_x is small enough, around a certain point p, it’s possible to approximate f as a linear function of slope a, so that epsilon_y becomes a * epsilon_x:", "words": [{"w": "In", "b": [0.1294, 0.4832, 0.1504, 0.5029]}, {"w": "addition,", "b": [0.1567, 0.4832, 0.2457, 0.5029]}, {"w": "because", "b": [0.252, 0.4832, 0.3319, 0.5029]}, {"w": "the", "b": [0.3382, 0.4832, 0.369, 0.5029]}, {"w": "function", "b": [0.3753, 0.4832, 0.4594, 0.5029]}, {"w": "is", "b": [0.4657, 0.4832, 0.4825, 0.5029]}, {"w": "smooth", "b": [0.4888, 0.4832, 0.5617, 0.5029]}, {"w": "(its", "b": [0.568, 0.4832, 0.6002, 0.5029]}, {"w": "curve", "b": [0.6065, 0.4832, 0.6625, 0.5029]}, {"w": "doesn’t", "b": [0.6688, 0.4832, 0.7426, 0.5029]}, {"w": "have", "b": [0.7489, 0.4832, 0.7966, 0.5029]}, {"w": "any", "b": [0.8029, 0.4832, 0.8393, 0.5029]}, {"w": "abrupt", "b": [0.1294, 0.5037, 0.1939, 0.5234]}, {"w": "angles),", "b": [0.2002, 0.5037, 0.2793, 0.5234]}, {"w": "when", "b": [0.2856, 0.5037, 0.3403, 0.5234]}, {"w": "epsilon_x", "b": [0.3466, 0.5047, 0.4828, 0.5249]}, {"w": "is", "b": [0.4891, 0.5037, 0.5059, 0.5234]}, {"w": "small", "b": [0.5122, 0.5037, 0.5669, 0.5234]}, {"w": "enough,", "b": [0.5732, 0.5037, 0.6538, 0.5234]}, {"w": "around", "b": [0.6601, 0.5037, 0.7301, 0.5234]}, {"w": "a", "b": [0.7364, 0.5037, 0.7476, 0.5234]}, {"w": "certain", "b": [0.7539, 0.5037, 0.8226, 0.5234]}, {"w": "point", "b": [0.1294, 0.5251, 0.1813, 0.5448]}, {"w": "p,", "b": [0.1876, 0.5251, 0.209, 0.5463]}, {"w": "it’s", "b": [0.2153, 0.5251, 0.2462, 0.5448]}, {"w": "possible", "b": [0.2525, 0.5251, 0.3352, 0.5448]}, {"w": "to", "b": [0.3415, 0.5251, 0.3611, 0.5448]}, {"w": "approximate", "b": [0.3674, 0.5251, 0.4935, 0.5448]}, {"w": "f", "b": [0.4998, 0.5261, 0.5149, 0.5463]}, {"w": "as", "b": [0.5212, 0.5251, 0.5422, 0.5448]}, {"w": "a", "b": [0.5485, 0.5251, 0.5597, 0.5448]}, {"w": "linear", "b": [0.566, 0.5251, 0.6235, 0.5448]}, {"w": "function", "b": [0.6298, 0.5251, 0.7138, 0.5448]}, {"w": "of", "b": [0.7202, 0.5251, 0.7412, 0.5448]}, {"w": "slope", "b": [0.7475, 0.5251, 0.8007, 0.5448]}, {"w": "a,", "b": [0.807, 0.5251, 0.8284, 0.5463]}, {"w": "so", "b": [0.8347, 0.5251, 0.8572, 0.5448]}, {"w": "that", "b": [0.1294, 0.5465, 0.1673, 0.5662]}, {"w": "epsilon_y", "b": [0.1735, 0.5475, 0.3098, 0.5677]}, {"w": "becomes", "b": [0.3161, 0.5465, 0.4043, 0.5662]}, {"w": "a", "b": [0.4106, 0.5475, 0.4258, 0.5677]}, {"w": "*", "b": [0.4409, 0.5475, 0.456, 0.5677]}, {"w": "epsilon_x:", "b": [0.4712, 0.5465, 0.6144, 0.5677]}]}, {"id": "b_6", "type": "equation", "text": "f(x + epsilon_x) = y + a * epsilon_x", "words": [{"w": "f(x", "b": [0.1357, 0.5851, 0.1698, 0.6003]}, {"w": "+", "b": [0.1811, 0.5851, 0.1925, 0.6003]}, {"w": "epsilon_x)", "b": [0.2038, 0.5851, 0.3173, 0.6003]}, {"w": "=", "b": [0.3287, 0.5851, 0.34, 0.6003]}, {"w": "y", "b": [0.3514, 0.5851, 0.3628, 0.6003]}, {"w": "+", "b": [0.3741, 0.5851, 0.3855, 0.6003]}, {"w": "a", "b": [0.3968, 0.5851, 0.4082, 0.6003]}, {"w": "*", "b": [0.4195, 0.5851, 0.4309, 0.6003]}, {"w": "epsilon_x", "b": [0.4422, 0.5851, 0.5444, 0.6003]}]}, {"id": "b_7", "type": "paragraph", "text": "Obviously, this linear approximation is valid only when x is close enough to p.", "words": [{"w": "Obviously,", "b": [0.1294, 0.6231, 0.2392, 0.6429]}, {"w": "this", "b": [0.2455, 0.6231, 0.282, 0.6429]}, {"w": "linear", "b": [0.2883, 0.6231, 0.3457, 0.6429]}, {"w": "approximation", "b": [0.352, 0.6231, 0.4991, 0.6429]}, {"w": "is", "b": [0.5055, 0.6231, 0.5223, 0.6429]}, {"w": "valid", "b": [0.5286, 0.6231, 0.579, 0.6429]}, {"w": "only", "b": [0.5853, 0.6231, 0.6302, 0.6429]}, {"w": "when", "b": [0.6365, 0.6231, 0.6911, 0.6429]}, {"w": "x", "b": [0.6974, 0.6242, 0.7125, 0.6444]}, {"w": "is", "b": [0.7188, 0.6231, 0.7357, 0.6429]}, {"w": "close", "b": [0.742, 0.6231, 0.7938, 0.6429]}, {"w": "enough", "b": [0.1294, 0.6445, 0.2037, 0.6643]}, {"w": "to", "b": [0.21, 0.6445, 0.2296, 0.6643]}, {"w": "p.", "b": [0.2359, 0.6445, 0.2573, 0.6658]}]}, {"id": "b_8", "type": "paragraph", "text": "The slope a is called the derivative of f in p. If a is negative, it means a small change of x around p will result in a decrease of f(x) (as shown in figure 2.10); and if a is positive, a small change in x will result in an increase of f(x). Further, the absolute value of a (the magnitude of the derivative) tells you how quickly this increase or decrease will happen.", "words": [{"w": "The", "b": [0.1294, 0.6882, 0.1686, 0.7079]}, {"w": "slope", "b": [0.1749, 0.6882, 0.2282, 0.7079]}, {"w": "a", "b": [0.2345, 0.6893, 0.2496, 0.7094]}, {"w": "is", "b": [0.2559, 0.6882, 0.2727, 0.7079]}, {"w": "called", "b": [0.279, 0.6882, 0.3393, 0.7079]}, {"w": "the", "b": [0.3456, 0.6882, 0.3764, 0.7079]}, {"w": "derivative", "b": [0.3827, 0.6882, 0.4836, 0.7079]}, {"w": "of", "b": [0.4898, 0.6882, 0.5109, 0.7079]}, {"w": "f", "b": [0.5172, 0.6893, 0.5323, 0.7094]}, {"w": "in", "b": [0.5386, 0.6882, 0.5582, 0.7079]}, {"w": "p.", "b": [0.5645, 0.6882, 0.586, 0.7094]}, {"w": "If", "b": [0.5923, 0.6882, 0.6091, 0.7079]}, {"w": "a", "b": [0.6154, 0.6893, 0.6305, 0.7094]}, {"w": "is", "b": [0.6368, 0.6882, 0.6536, 0.7079]}, {"w": "negative,", "b": [0.6599, 0.6882, 0.7517, 0.7079]}, {"w": "it", "b": [0.758, 0.6882, 0.772, 0.7079]}, {"w": "means", "b": [0.7783, 0.6882, 0.8428, 0.7079]}, {"w": "a", "b": [0.8491, 0.6882, 0.8603, 0.7079]}, {"w": "small", "b": [0.1294, 0.7096, 0.1841, 0.7293]}, {"w": "change", "b": [0.1904, 0.7096, 0.2618, 0.7293]}, {"w": "of", "b": [0.2681, 0.7096, 0.2891, 0.7293]}, {"w": "x", "b": [0.2954, 0.7106, 0.3105, 0.7308]}, {"w": "around", "b": [0.3169, 0.7096, 0.3869, 0.7293]}, {"w": "p", "b": [0.3932, 0.7106, 0.4083, 0.7308]}, {"w": "will", "b": [0.4146, 0.7096, 0.4539, 0.7293]}, {"w": "result", "b": [0.4602, 0.7096, 0.5162, 0.7293]}, {"w": "in", "b": [0.5226, 0.7096, 0.5422, 0.7293]}, {"w": "a", "b": [0.5485, 0.7096, 0.5597, 0.7293]}, {"w": "decrease", "b": [0.566, 0.7096, 0.6528, 0.7293]}, {"w": "of", "b": [0.6591, 0.7096, 0.6801, 0.7293]}, {"w": "f(x)", "b": [0.6864, 0.7106, 0.747, 0.7308]}, {"w": "(as", "b": [0.7533, 0.7096, 0.7827, 0.7293]}, {"w": "shown", "b": [0.789, 0.7096, 0.8548, 0.7293]}, {"w": "in", "b": [0.1294, 0.731, 0.149, 0.7507]}, {"w": "figure", "b": [0.1553, 0.731, 0.2156, 0.7507]}, {"w": "2.10);", "b": [0.2219, 0.731, 0.2814, 0.7507]}, {"w": "and", "b": [0.2877, 0.731, 0.3242, 0.7507]}, {"w": "if", "b": [0.3305, 0.731, 0.3459, 0.7507]}, {"w": "a", "b": [0.3521, 0.732, 0.3673, 0.7522]}, {"w": "is", "b": [0.3736, 0.731, 0.3904, 0.7507]}, {"w": "positive,", "b": [0.3967, 0.731, 0.4829, 0.7507]}, {"w": "a", "b": [0.4892, 0.731, 0.5004, 0.7507]}, {"w": "small", "b": [0.5067, 0.731, 0.5614, 0.7507]}, {"w": "change", "b": [0.5677, 0.731, 0.6391, 0.7507]}, {"w": "in", "b": [0.6454, 0.731, 0.6651, 0.7507]}, {"w": "x", "b": [0.6713, 0.732, 0.6865, 0.7522]}, {"w": "will", "b": [0.6928, 0.731, 0.732, 0.7507]}, {"w": "result", "b": [0.7383, 0.731, 0.7944, 0.7507]}, {"w": "in", "b": [0.8007, 0.731, 0.8203, 0.7507]}, {"w": "an", "b": [0.8266, 0.731, 0.8504, 0.7507]}, {"w": "increase", "b": [0.1294, 0.7524, 0.2121, 0.7721]}, {"w": "of", "b": [0.2184, 0.7524, 0.2394, 0.7721]}, {"w": "f(x).", "b": [0.2456, 0.7524, 0.3125, 0.7736]}, {"w": "Further,", "b": [0.3188, 0.7524, 0.3984, 0.7721]}, {"w": "the", "b": [0.4047, 0.7524, 0.4355, 0.7721]}, {"w": "absolute", "b": [0.4418, 0.7524, 0.5259, 0.7721]}, {"w": "value", "b": [0.5322, 0.7524, 0.5868, 0.7721]}, {"w": "of", "b": [0.5931, 0.7524, 0.6141, 0.7721]}, {"w": "a", "b": [0.6204, 0.7534, 0.6355, 0.7736]}, {"w": "(the", "b": [0.6418, 0.7524, 0.6811, 0.7721]}, {"w": "magnitude", "b": [0.6874, 0.7524, 0.7939, 0.7721]}, {"w": "of", "b": [0.8002, 0.7524, 0.8212, 0.7721]}, {"w": "the", "b": [0.8275, 0.7524, 0.8583, 0.7721]}, {"w": "derivative)", "b": [0.1294, 0.7738, 0.2387, 0.7935]}, {"w": "tells", "b": [0.245, 0.7738, 0.287, 0.7935]}, {"w": "you", "b": [0.2934, 0.7738, 0.3312, 0.7935]}, {"w": "how", "b": [0.3375, 0.7738, 0.3809, 0.7935]}, {"w": "quickly", "b": [0.3872, 0.7738, 0.4629, 0.7935]}, {"w": "this", "b": [0.4692, 0.7738, 0.5057, 0.7935]}, {"w": "increase", "b": [0.512, 0.7738, 0.5946, 0.7935]}, {"w": "or", "b": [0.6009, 0.7738, 0.6219, 0.7935]}, {"w": "decrease", "b": [0.6283, 0.7738, 0.7151, 0.7935]}, {"w": "will", "b": [0.7214, 0.7738, 0.7606, 0.7935]}, {"w": "happen.", "b": [0.7669, 0.7738, 0.8461, 0.7935]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure 2.10. Derivative of f in p", "words": [{"w": "Figure", "b": [0.1294, 0.8116, 0.1827, 0.8264]}, {"w": "2.10.", "b": [0.1874, 0.8116, 0.2252, 0.8264]}, {"w": "Derivative", "b": [0.2299, 0.8116, 0.314, 0.8264]}, {"w": "of", "b": [0.3187, 0.8116, 0.3345, 0.8264]}, {"w": "f", "b": [0.3392, 0.8124, 0.3506, 0.8275]}, {"w": "in", "b": [0.3553, 0.8116, 0.3711, 0.8264]}, {"w": "p", "b": [0.3758, 0.8124, 0.3871, 0.8275]}]}]}, {"page": 85, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "For every differentiable function f(x) (differentiable means “can be derived”: for example, smooth, continuous functions can be derived), there exists a derivative function f'(x) that maps values of x to the slope of the local linear approximation of f in those points. For instance, the derivative of cos(x) is -sin(x), the derivative of f(x) = a * x is f'(x) = a, and so on.", "words": [{"w": "For", "b": [0.1294, 0.2452, 0.1645, 0.265]}, {"w": "every", "b": [0.1708, 0.2452, 0.2268, 0.265]}, {"w": "differentiable", "b": [0.2331, 0.2452, 0.3685, 0.265]}, {"w": "function", "b": [0.3748, 0.2452, 0.4589, 0.265]}, {"w": "f(x)", "b": [0.4652, 0.2463, 0.5257, 0.2665]}, {"w": "(differentiable", "b": [0.532, 0.2452, 0.6754, 0.265]}, {"w": "means", "b": [0.6817, 0.2452, 0.7461, 0.265]}, {"w": "“can", "b": [0.7524, 0.2452, 0.7986, 0.265]}, {"w": "be", "b": [0.8049, 0.2452, 0.8288, 0.265]}, {"w": "derived”:", "b": [0.1294, 0.2666, 0.2233, 0.2864]}, {"w": "for", "b": [0.2296, 0.2666, 0.259, 0.2864]}, {"w": "example,", "b": [0.2653, 0.2666, 0.3571, 0.2864]}, {"w": "smooth,", "b": [0.3634, 0.2666, 0.444, 0.2864]}, {"w": "continuous", "b": [0.4503, 0.2666, 0.561, 0.2864]}, {"w": "functions", "b": [0.5673, 0.2666, 0.6612, 0.2864]}, {"w": "can", "b": [0.6675, 0.2666, 0.7025, 0.2864]}, {"w": "be", "b": [0.7088, 0.2666, 0.7326, 0.2864]}, {"w": "derived),", "b": [0.7389, 0.2666, 0.8293, 0.2864]}, {"w": "there", "b": [0.1294, 0.2871, 0.1798, 0.3069]}, {"w": "exists", "b": [0.1861, 0.2871, 0.2436, 0.3069]}, {"w": "a", "b": [0.2499, 0.2871, 0.2611, 0.3069]}, {"w": "derivative", "b": [0.2674, 0.2871, 0.3683, 0.3069]}, {"w": "function", "b": [0.3746, 0.2871, 0.4587, 0.3069]}, {"w": "f'(x)", "b": [0.4649, 0.2882, 0.5406, 0.3084]}, {"w": "that", "b": [0.5469, 0.2871, 0.5848, 0.3069]}, {"w": "maps", "b": [0.5911, 0.2871, 0.6443, 0.3069]}, {"w": "values", "b": [0.6506, 0.2871, 0.7151, 0.3069]}, {"w": "of", "b": [0.7214, 0.2871, 0.7424, 0.3069]}, {"w": "x", "b": [0.7487, 0.2882, 0.7638, 0.3084]}, {"w": "to", "b": [0.7701, 0.2871, 0.7897, 0.3069]}, {"w": "the", "b": [0.796, 0.2871, 0.8269, 0.3069]}, {"w": "slope", "b": [0.1294, 0.3085, 0.1827, 0.3282]}, {"w": "of", "b": [0.189, 0.3085, 0.21, 0.3282]}, {"w": "the", "b": [0.2163, 0.3085, 0.2471, 0.3282]}, {"w": "local", "b": [0.2534, 0.3085, 0.3025, 0.3282]}, {"w": "linear", "b": [0.3088, 0.3085, 0.3662, 0.3282]}, {"w": "approximation", "b": [0.3725, 0.3085, 0.5197, 0.3282]}, {"w": "of", "b": [0.526, 0.3085, 0.547, 0.3282]}, {"w": "f", "b": [0.5532, 0.3096, 0.5683, 0.3297]}, {"w": "in", "b": [0.5746, 0.3085, 0.5943, 0.3282]}, {"w": "those", "b": [0.6006, 0.3085, 0.6538, 0.3282]}, {"w": "points.", "b": [0.6601, 0.3085, 0.7281, 0.3282]}, {"w": "For", "b": [0.7344, 0.3085, 0.7694, 0.3282]}, {"w": "instance,", "b": [0.7758, 0.3085, 0.8647, 0.3282]}, {"w": "the", "b": [0.1294, 0.3299, 0.1602, 0.3496]}, {"w": "derivative", "b": [0.1665, 0.3299, 0.2674, 0.3496]}, {"w": "of", "b": [0.2737, 0.3299, 0.2947, 0.3496]}, {"w": "cos(x)", "b": [0.301, 0.3309, 0.3918, 0.3511]}, {"w": "is", "b": [0.3981, 0.3299, 0.415, 0.3496]}, {"w": "-sin(x),", "b": [0.4212, 0.3299, 0.5335, 0.3511]}, {"w": "the", "b": [0.5398, 0.3299, 0.5706, 0.3496]}, {"w": "derivative", "b": [0.5769, 0.3299, 0.6778, 0.3496]}, {"w": "of", "b": [0.6841, 0.3299, 0.7051, 0.3496]}, {"w": "f(x)", "b": [0.7114, 0.3309, 0.7719, 0.3511]}, {"w": "=", "b": [0.7871, 0.3309, 0.8022, 0.3511]}, {"w": "a", "b": [0.8173, 0.3309, 0.8325, 0.3511]}, {"w": "*", "b": [0.8476, 0.3309, 0.8628, 0.3511]}, {"w": "x", "b": [0.1294, 0.3523, 0.1445, 0.3725]}, {"w": "is", "b": [0.1509, 0.3513, 0.1677, 0.371]}, {"w": "f'(x)", "b": [0.174, 0.3523, 0.2496, 0.3725]}, {"w": "=", "b": [0.2648, 0.3523, 0.2799, 0.3725]}, {"w": "a,", "b": [0.2951, 0.3513, 0.3165, 0.3725]}, {"w": "and", "b": [0.3228, 0.3513, 0.3592, 0.371]}, {"w": "so", "b": [0.3656, 0.3513, 0.388, 0.371]}, {"w": "on.", "b": [0.3943, 0.3513, 0.4258, 0.371]}]}, {"id": "b_1", "type": "paragraph", "text": "If you’re trying to update x by a factor epsilon_x in order to minimize f(x), and you know the derivative of f, then your job is done: the derivative completely describes how f(x) evolves as you change x. If you want to reduce the value of f(x), you just need to move x a little in the opposite direction from the derivative.", "words": [{"w": "If", "b": [0.1294, 0.395, 0.1462, 0.4147]}, {"w": "you’re", "b": [0.1525, 0.395, 0.2184, 0.4147]}, {"w": "trying", "b": [0.2247, 0.395, 0.2849, 0.4147]}, {"w": "to", "b": [0.2912, 0.395, 0.3109, 0.4147]}, {"w": "update", "b": [0.3172, 0.395, 0.3844, 0.4147]}, {"w": "x", "b": [0.3907, 0.396, 0.4058, 0.4162]}, {"w": "by", "b": [0.4121, 0.395, 0.4374, 0.4147]}, {"w": "a", "b": [0.4437, 0.395, 0.4549, 0.4147]}, {"w": "factor", "b": [0.4612, 0.395, 0.52, 0.4147]}, {"w": "epsilon_x", "b": [0.5263, 0.396, 0.6625, 0.4162]}, {"w": "in", "b": [0.6688, 0.395, 0.6885, 0.4147]}, {"w": "order", "b": [0.6948, 0.395, 0.748, 0.4147]}, {"w": "to", "b": [0.7543, 0.395, 0.7739, 0.4147]}, {"w": "minimize", "b": [0.1294, 0.4164, 0.2247, 0.4361]}, {"w": "f(x),", "b": [0.231, 0.4164, 0.2978, 0.4376]}, {"w": "and", "b": [0.3041, 0.4164, 0.3406, 0.4361]}, {"w": "you", "b": [0.3469, 0.4164, 0.3847, 0.4361]}, {"w": "know", "b": [0.391, 0.4164, 0.4471, 0.4361]}, {"w": "the", "b": [0.4534, 0.4164, 0.4842, 0.4361]}, {"w": "derivative", "b": [0.4905, 0.4164, 0.5914, 0.4361]}, {"w": "of", "b": [0.5977, 0.4164, 0.6187, 0.4361]}, {"w": "f,", "b": [0.625, 0.4164, 0.6464, 0.4376]}, {"w": "then", "b": [0.6527, 0.4164, 0.6962, 0.4361]}, {"w": "your", "b": [0.7025, 0.4164, 0.7487, 0.4361]}, {"w": "job", "b": [0.755, 0.4164, 0.7873, 0.4361]}, {"w": "is", "b": [0.7936, 0.4164, 0.8104, 0.4361]}, {"w": "done:", "b": [0.1294, 0.4377, 0.1855, 0.4575]}, {"w": "the", "b": [0.1918, 0.4377, 0.2226, 0.4575]}, {"w": "derivative", "b": [0.2289, 0.4377, 0.3298, 0.4575]}, {"w": "completely", "b": [0.3361, 0.4377, 0.4482, 0.4575]}, {"w": "describes", "b": [0.4545, 0.4377, 0.5484, 0.4575]}, {"w": "how", "b": [0.5547, 0.4377, 0.5981, 0.4575]}, {"w": "f(x)", "b": [0.6043, 0.4388, 0.6649, 0.459]}, {"w": "evolves", "b": [0.6712, 0.4377, 0.7482, 0.4575]}, {"w": "as", "b": [0.7545, 0.4377, 0.7756, 0.4575]}, {"w": "you", "b": [0.7819, 0.4377, 0.8197, 0.4575]}, {"w": "change", "b": [0.1294, 0.4591, 0.2009, 0.4789]}, {"w": "x.", "b": [0.2071, 0.4591, 0.2286, 0.4804]}, {"w": "If", "b": [0.2349, 0.4591, 0.2517, 0.4789]}, {"w": "you", "b": [0.258, 0.4591, 0.2958, 0.4789]}, {"w": "want", "b": [0.3021, 0.4591, 0.3512, 0.4789]}, {"w": "to", "b": [0.3575, 0.4591, 0.3771, 0.4789]}, {"w": "reduce", "b": [0.3834, 0.4591, 0.4506, 0.4789]}, {"w": "the", "b": [0.4569, 0.4591, 0.4878, 0.4789]}, {"w": "value", "b": [0.4941, 0.4591, 0.5487, 0.4789]}, {"w": "of", "b": [0.555, 0.4591, 0.576, 0.4789]}, {"w": "f(x),", "b": [0.5823, 0.4591, 0.6491, 0.4804]}, {"w": "you", "b": [0.6554, 0.4591, 0.6933, 0.4789]}, {"w": "just", "b": [0.6996, 0.4591, 0.736, 0.4789]}, {"w": "need", "b": [0.7424, 0.4591, 0.79, 0.4789]}, {"w": "to", "b": [0.7963, 0.4591, 0.8159, 0.4789]}, {"w": "move", "b": [0.1294, 0.4805, 0.1855, 0.5003]}, {"w": "x", "b": [0.1917, 0.4816, 0.2069, 0.5018]}, {"w": "a", "b": [0.2132, 0.4805, 0.2244, 0.5003]}, {"w": "little", "b": [0.2307, 0.4805, 0.277, 0.5003]}, {"w": "in", "b": [0.2833, 0.4805, 0.3029, 0.5003]}, {"w": "the", "b": [0.3092, 0.4805, 0.34, 0.5003]}, {"w": "opposite", "b": [0.3463, 0.4805, 0.4318, 0.5003]}, {"w": "direction", "b": [0.4381, 0.4805, 0.5278, 0.5003]}, {"w": "from", "b": [0.5341, 0.4805, 0.5832, 0.5003]}, {"w": "the", "b": [0.5895, 0.4805, 0.6203, 0.5003]}, {"w": "derivative.", "b": [0.6266, 0.4805, 0.7338, 0.5003]}]}, {"id": "b_2", "type": "paragraph", "text": "2.4.2. Derivative of a tensor operation: the gradient", "words": [{"w": "2.4.2.", "b": [0.1294, 0.5287, 0.1862, 0.5484]}, {"w": "Derivative", "b": [0.1925, 0.5287, 0.3046, 0.5484]}, {"w": "of", "b": [0.3109, 0.5287, 0.3319, 0.5484]}, {"w": "a", "b": [0.3382, 0.5287, 0.3508, 0.5484]}, {"w": "tensor", "b": [0.3571, 0.5287, 0.4244, 0.5484]}, {"w": "operation:", "b": [0.4307, 0.5287, 0.5428, 0.5484]}, {"w": "the", "b": [0.5491, 0.5287, 0.5827, 0.5484]}, {"w": "gradient", "b": [0.589, 0.5287, 0.6801, 0.5484]}]}, {"id": "b_3", "type": "paragraph", "text": "A gradient is the derivative of a tensor operation. It’s the generalization of the concept of derivatives to functions of multidimensional inputs: that is, to functions that take tensors as inputs.", "words": [{"w": "A", "b": [0.1294, 0.5714, 0.1476, 0.5912]}, {"w": "gradient", "b": [0.1539, 0.5714, 0.2394, 0.5912]}, {"w": "is", "b": [0.2457, 0.5714, 0.2625, 0.5912]}, {"w": "the", "b": [0.2688, 0.5714, 0.2997, 0.5912]}, {"w": "derivative", "b": [0.306, 0.5714, 0.4068, 0.5912]}, {"w": "of", "b": [0.4132, 0.5714, 0.4342, 0.5912]}, {"w": "a", "b": [0.4405, 0.5714, 0.4517, 0.5912]}, {"w": "tensor", "b": [0.458, 0.5714, 0.5196, 0.5912]}, {"w": "operation.", "b": [0.5259, 0.5714, 0.6275, 0.5912]}, {"w": "It’s", "b": [0.6338, 0.5714, 0.666, 0.5912]}, {"w": "the", "b": [0.6723, 0.5714, 0.7031, 0.5912]}, {"w": "generalization", "b": [0.7094, 0.5714, 0.8523, 0.5912]}, {"w": "of", "b": [0.1294, 0.5919, 0.1504, 0.6117]}, {"w": "the", "b": [0.1567, 0.5919, 0.1876, 0.6117]}, {"w": "concept", "b": [0.1939, 0.5919, 0.2723, 0.6117]}, {"w": "of", "b": [0.2786, 0.5919, 0.2996, 0.6117]}, {"w": "derivatives", "b": [0.3059, 0.5919, 0.4166, 0.6117]}, {"w": "to", "b": [0.4229, 0.5919, 0.4426, 0.6117]}, {"w": "functions", "b": [0.4489, 0.5919, 0.5428, 0.6117]}, {"w": "of", "b": [0.5491, 0.5919, 0.5701, 0.6117]}, {"w": "multidimensional", "b": [0.5764, 0.5919, 0.753, 0.6117]}, {"w": "inputs:", "b": [0.7592, 0.5919, 0.8279, 0.6117]}, {"w": "that", "b": [0.1294, 0.6124, 0.1673, 0.6322]}, {"w": "is,", "b": [0.1736, 0.6124, 0.1967, 0.6322]}, {"w": "to", "b": [0.203, 0.6124, 0.2226, 0.6322]}, {"w": "functions", "b": [0.2289, 0.6124, 0.3228, 0.6322]}, {"w": "that", "b": [0.3291, 0.6124, 0.367, 0.6322]}, {"w": "take", "b": [0.3733, 0.6124, 0.4153, 0.6322]}, {"w": "tensors", "b": [0.4216, 0.6124, 0.4931, 0.6322]}, {"w": "as", "b": [0.4994, 0.6124, 0.5204, 0.6322]}, {"w": "inputs.", "b": [0.5267, 0.6124, 0.5947, 0.6322]}]}, {"id": "b_4", "type": "paragraph", "text": "Consider an input vector x, a matrix W, a target y, and a loss function loss. You can use W to compute a target candidate y_pred, and compute the loss, or mismatch, between the target candidate y_pred and the target y:", "words": [{"w": "Consider", "b": [0.1294, 0.6552, 0.2205, 0.675]}, {"w": "an", "b": [0.2268, 0.6552, 0.2506, 0.675]}, {"w": "input", "b": [0.2569, 0.6552, 0.3088, 0.675]}, {"w": "vector", "b": [0.3151, 0.6552, 0.3781, 0.675]}, {"w": "x,", "b": [0.3844, 0.6552, 0.4059, 0.6765]}, {"w": "a", "b": [0.4122, 0.6552, 0.4234, 0.675]}, {"w": "matrix", "b": [0.4297, 0.6552, 0.4955, 0.675]}, {"w": "W,", "b": [0.5018, 0.6552, 0.5232, 0.6765]}, {"w": "a", "b": [0.5296, 0.6552, 0.5408, 0.675]}, {"w": "target", "b": [0.5471, 0.6552, 0.604, 0.675]}, {"w": "y,", "b": [0.6103, 0.6552, 0.6318, 0.6765]}, {"w": "and", "b": [0.6381, 0.6552, 0.6745, 0.675]}, {"w": "a", "b": [0.6808, 0.6552, 0.692, 0.675]}, {"w": "loss", "b": [0.6983, 0.6552, 0.7376, 0.675]}, {"w": "function", "b": [0.7439, 0.6552, 0.8279, 0.675]}, {"w": "loss.", "b": [0.1294, 0.6766, 0.1963, 0.6979]}, {"w": "You", "b": [0.2026, 0.6766, 0.2435, 0.6964]}, {"w": "can", "b": [0.2498, 0.6766, 0.2848, 0.6964]}, {"w": "use", "b": [0.2911, 0.6766, 0.3247, 0.6964]}, {"w": "W", "b": [0.331, 0.6777, 0.3462, 0.6979]}, {"w": "to", "b": [0.3525, 0.6766, 0.3721, 0.6964]}, {"w": "compute", "b": [0.3784, 0.6766, 0.4653, 0.6964]}, {"w": "a", "b": [0.4716, 0.6766, 0.4828, 0.6964]}, {"w": "target", "b": [0.4891, 0.6766, 0.546, 0.6964]}, {"w": "candidate", "b": [0.5523, 0.6766, 0.649, 0.6964]}, {"w": "y_pred,", "b": [0.6553, 0.6766, 0.7524, 0.6979]}, {"w": "and", "b": [0.7587, 0.6766, 0.7951, 0.6964]}, {"w": "compute", "b": [0.1294, 0.698, 0.2163, 0.7178]}, {"w": "the", "b": [0.2226, 0.698, 0.2534, 0.7178]}, {"w": "loss,", "b": [0.2597, 0.698, 0.3053, 0.7178]}, {"w": "or", "b": [0.3116, 0.698, 0.3326, 0.7178]}, {"w": "mismatch,", "b": [0.3389, 0.698, 0.4433, 0.7178]}, {"w": "between", "b": [0.4496, 0.698, 0.5337, 0.7178]}, {"w": "the", "b": [0.54, 0.698, 0.5708, 0.7178]}, {"w": "target", "b": [0.5771, 0.698, 0.634, 0.7178]}, {"w": "candidate", "b": [0.6403, 0.698, 0.737, 0.7178]}, {"w": "y_pred", "b": [0.7433, 0.6991, 0.8341, 0.7192]}, {"w": "and", "b": [0.1294, 0.7194, 0.1658, 0.7391]}, {"w": "the", "b": [0.1721, 0.7194, 0.203, 0.7391]}, {"w": "target", "b": [0.2093, 0.7194, 0.2662, 0.7391]}, {"w": "y:", "b": [0.2725, 0.7194, 0.2947, 0.7406]}]}, {"id": "b_5", "type": "equation", "text": "y_pred = dot(W, x) loss_value = loss(y_pred, y)", "words": [{"w": "y_pred", "b": [0.1357, 0.758, 0.2038, 0.7732]}, {"w": "=", "b": [0.2152, 0.758, 0.2265, 0.7732]}, {"w": "dot(W,", "b": [0.2379, 0.758, 0.306, 0.7732]}, {"w": "x)", "b": [0.3173, 0.758, 0.34, 0.7732]}, {"w": "loss_value", "b": [0.1357, 0.7732, 0.2492, 0.7883]}, {"w": "=", "b": [0.2606, 0.7732, 0.2719, 0.7883]}, {"w": "loss(y_pred,", "b": [0.2833, 0.7732, 0.4195, 0.7883]}, {"w": "y)", "b": [0.4309, 0.7732, 0.4536, 0.7883]}]}, {"id": "b_6", "type": "paragraph", "text": "If the data inputs x and y are frozen, then this can be interpreted as a function mapping values of W to loss values:", "words": [{"w": "If", "b": [0.1294, 0.8112, 0.1462, 0.8309]}, {"w": "the", "b": [0.1525, 0.8112, 0.1833, 0.8309]}, {"w": "data", "b": [0.1897, 0.8112, 0.2317, 0.8309]}, {"w": "inputs", "b": [0.238, 0.8112, 0.2997, 0.8309]}, {"w": "x", "b": [0.3059, 0.8123, 0.3211, 0.8324]}, {"w": "and", "b": [0.3274, 0.8112, 0.3638, 0.8309]}, {"w": "y", "b": [0.3701, 0.8123, 0.3852, 0.8324]}, {"w": "are", "b": [0.3915, 0.8112, 0.4223, 0.8309]}, {"w": "frozen,", "b": [0.4287, 0.8112, 0.4994, 0.8309]}, {"w": "then", "b": [0.5057, 0.8112, 0.5491, 0.8309]}, {"w": "this", "b": [0.5554, 0.8112, 0.5919, 0.8309]}, {"w": "can", "b": [0.5982, 0.8112, 0.6332, 0.8309]}, {"w": "be", "b": [0.6395, 0.8112, 0.6633, 0.8309]}, {"w": "interpreted", "b": [0.6696, 0.8112, 0.7789, 0.8309]}, {"w": "as", "b": [0.7852, 0.8112, 0.8062, 0.8309]}, {"w": "a", "b": [0.8125, 0.8112, 0.8237, 0.8309]}, {"w": "function", "b": [0.1294, 0.8326, 0.2135, 0.8523]}, {"w": "mapping", "b": [0.2198, 0.8326, 0.3081, 0.8523]}, {"w": "values", "b": [0.3144, 0.8326, 0.3788, 0.8523]}, {"w": "of", "b": [0.3852, 0.8326, 0.4062, 0.8523]}, {"w": "W", "b": [0.4124, 0.8336, 0.4276, 0.8538]}, {"w": "to", "b": [0.4339, 0.8326, 0.4535, 0.8523]}, {"w": "loss", "b": [0.4598, 0.8326, 0.4991, 0.8523]}, {"w": "values:", "b": [0.5054, 0.8326, 0.5768, 0.8523]}]}, {"id": "b_7", "type": "equation", "text": "loss_value = f(W)", "words": [{"w": "loss_value", "b": [0.1357, 0.8712, 0.2492, 0.8864]}, {"w": "=", "b": [0.2606, 0.8712, 0.2719, 0.8864]}, {"w": "f(W)", "b": [0.2833, 0.8712, 0.3287, 0.8864]}]}]}, {"page": 86, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Let’s say the current value of W is W0. Then the derivative of f in the point W0 is a tensor gradient(f)(W0) with the same shape as W, where each coefficient gradient(f) (W0)[i, j] indicates the direction and magnitude of the change in loss_value you observe when modifying W0[i, j]. That tensor gradient(f)(W0) is the gradient of the function f(W) = loss_value in W0.", "words": [{"w": "Let’s", "b": [0.1294, 0.0857, 0.1798, 0.1054]}, {"w": "say", "b": [0.1862, 0.0857, 0.2198, 0.1054]}, {"w": "the", "b": [0.2261, 0.0857, 0.2569, 0.1054]}, {"w": "current", "b": [0.2632, 0.0857, 0.3347, 0.1054]}, {"w": "value", "b": [0.341, 0.0857, 0.3956, 0.1054]}, {"w": "of", "b": [0.4019, 0.0857, 0.4229, 0.1054]}, {"w": "W", "b": [0.4292, 0.0867, 0.4443, 0.1069]}, {"w": "is", "b": [0.4506, 0.0857, 0.4675, 0.1054]}, {"w": "W0.", "b": [0.4737, 0.0857, 0.5103, 0.1069]}, {"w": "Then", "b": [0.5166, 0.0857, 0.5685, 0.1054]}, {"w": "the", "b": [0.5748, 0.0857, 0.6056, 0.1054]}, {"w": "derivative", "b": [0.6119, 0.0857, 0.7128, 0.1054]}, {"w": "of", "b": [0.7191, 0.0857, 0.7401, 0.1054]}, {"w": "f", "b": [0.7464, 0.0867, 0.7615, 0.1069]}, {"w": "in", "b": [0.7678, 0.0857, 0.7874, 0.1054]}, {"w": "the", "b": [0.7937, 0.0857, 0.8246, 0.1054]}, {"w": "point", "b": [0.1294, 0.1071, 0.1813, 0.1268]}, {"w": "W0", "b": [0.1876, 0.1081, 0.2178, 0.1283]}, {"w": "is", "b": [0.2241, 0.1071, 0.241, 0.1268]}, {"w": "a", "b": [0.2473, 0.1071, 0.2585, 0.1268]}, {"w": "tensor", "b": [0.2648, 0.1071, 0.3264, 0.1268]}, {"w": "gradient(f)(W0)", "b": [0.3327, 0.1081, 0.5598, 0.1283]}, {"w": "with", "b": [0.5661, 0.1071, 0.6109, 0.1268]}, {"w": "the", "b": [0.6173, 0.1071, 0.6481, 0.1268]}, {"w": "same", "b": [0.6544, 0.1071, 0.7062, 0.1268]}, {"w": "shape", "b": [0.7125, 0.1071, 0.77, 0.1268]}, {"w": "as", "b": [0.7763, 0.1071, 0.7973, 0.1268]}, {"w": "W,", "b": [0.8036, 0.1071, 0.825, 0.1283]}, {"w": "where", "b": [0.1294, 0.1285, 0.191, 0.1482]}, {"w": "each", "b": [0.1973, 0.1285, 0.2436, 0.1482]}, {"w": "coefficient", "b": [0.2499, 0.1285, 0.3573, 0.1482]}, {"w": "gradient(f)", "b": [0.3635, 0.1295, 0.53, 0.1497]}, {"w": "(W0)[i,", "b": [0.5452, 0.1295, 0.6511, 0.1497]}, {"w": "j]", "b": [0.6662, 0.1295, 0.6965, 0.1497]}, {"w": "indicates", "b": [0.7029, 0.1285, 0.7925, 0.1482]}, {"w": "the", "b": [0.7988, 0.1285, 0.8297, 0.1482]}, {"w": "direction", "b": [0.1294, 0.1498, 0.2191, 0.1696]}, {"w": "and", "b": [0.2254, 0.1498, 0.2618, 0.1696]}, {"w": "magnitude", "b": [0.2681, 0.1498, 0.3746, 0.1696]}, {"w": "of", "b": [0.3809, 0.1498, 0.402, 0.1696]}, {"w": "the", "b": [0.4083, 0.1498, 0.4391, 0.1696]}, {"w": "change", "b": [0.4454, 0.1498, 0.5168, 0.1696]}, {"w": "in", "b": [0.5231, 0.1498, 0.5428, 0.1696]}, {"w": "loss_value", "b": [0.549, 0.1509, 0.7003, 0.1711]}, {"w": "you", "b": [0.7067, 0.1498, 0.7445, 0.1696]}, {"w": "observe", "b": [0.7508, 0.1498, 0.8293, 0.1696]}, {"w": "when", "b": [0.1294, 0.1712, 0.1841, 0.191]}, {"w": "modifying", "b": [0.1904, 0.1712, 0.2955, 0.191]}, {"w": "W0[i,", "b": [0.3018, 0.1723, 0.3774, 0.1925]}, {"w": "j].", "b": [0.3926, 0.1712, 0.4292, 0.1925]}, {"w": "That", "b": [0.4355, 0.1712, 0.4817, 0.191]}, {"w": "tensor", "b": [0.488, 0.1712, 0.5497, 0.191]}, {"w": "gradient(f)(W0)", "b": [0.5559, 0.1723, 0.783, 0.1925]}, {"w": "is", "b": [0.7893, 0.1712, 0.8061, 0.191]}, {"w": "the", "b": [0.8124, 0.1712, 0.8433, 0.191]}, {"w": "gradient", "b": [0.1294, 0.1926, 0.2121, 0.2124]}, {"w": "of", "b": [0.2184, 0.1926, 0.2394, 0.2124]}, {"w": "the", "b": [0.2457, 0.1926, 0.2765, 0.2124]}, {"w": "function", "b": [0.2828, 0.1926, 0.3669, 0.2124]}, {"w": "f(W)", "b": [0.3732, 0.1937, 0.4337, 0.2139]}, {"w": "=", "b": [0.4489, 0.1937, 0.464, 0.2139]}, {"w": "loss_value", "b": [0.4791, 0.1937, 0.6305, 0.2139]}, {"w": "in", "b": [0.6368, 0.1926, 0.6564, 0.2124]}, {"w": "W0.", "b": [0.6627, 0.1926, 0.6993, 0.2139]}]}, {"id": "b_1", "type": "paragraph", "text": "You saw earlier that the derivative of a function f(x) of a single coefficient can be interpreted as the slope of the curve of f. Likewise, gradient(f)(W0) can be interpreted as the tensor describing the curvature of f(W) around W0.", "words": [{"w": "You", "b": [0.1294, 0.2363, 0.1703, 0.256]}, {"w": "saw", "b": [0.1766, 0.2363, 0.2159, 0.256]}, {"w": "earlier", "b": [0.2222, 0.2363, 0.2866, 0.256]}, {"w": "that", "b": [0.2929, 0.2363, 0.3307, 0.256]}, {"w": "the", "b": [0.337, 0.2363, 0.3679, 0.256]}, {"w": "derivative", "b": [0.3742, 0.2363, 0.4751, 0.256]}, {"w": "of", "b": [0.4814, 0.2363, 0.5024, 0.256]}, {"w": "a", "b": [0.5087, 0.2363, 0.5199, 0.256]}, {"w": "function", "b": [0.5262, 0.2363, 0.6103, 0.256]}, {"w": "f(x)", "b": [0.6165, 0.2374, 0.677, 0.2575]}, {"w": "of", "b": [0.6833, 0.2363, 0.7043, 0.256]}, {"w": "a", "b": [0.7107, 0.2363, 0.7219, 0.256]}, {"w": "single", "b": [0.7282, 0.2363, 0.7884, 0.256]}, {"w": "coefficient", "b": [0.1294, 0.2577, 0.2368, 0.2774]}, {"w": "can", "b": [0.2431, 0.2577, 0.2781, 0.2774]}, {"w": "be", "b": [0.2844, 0.2577, 0.3083, 0.2774]}, {"w": "interpreted", "b": [0.3146, 0.2577, 0.4238, 0.2774]}, {"w": "as", "b": [0.4301, 0.2577, 0.4512, 0.2774]}, {"w": "the", "b": [0.4575, 0.2577, 0.4883, 0.2774]}, {"w": "slope", "b": [0.4946, 0.2577, 0.5478, 0.2774]}, {"w": "of", "b": [0.5542, 0.2577, 0.5752, 0.2774]}, {"w": "the", "b": [0.5815, 0.2577, 0.6123, 0.2774]}, {"w": "curve", "b": [0.6186, 0.2577, 0.6746, 0.2774]}, {"w": "of", "b": [0.6809, 0.2577, 0.702, 0.2774]}, {"w": "f.", "b": [0.7082, 0.2577, 0.7296, 0.2789]}, {"w": "Likewise,", "b": [0.7359, 0.2577, 0.8347, 0.2774]}, {"w": "gradient(f)(W0)", "b": [0.1294, 0.2801, 0.3564, 0.3003]}, {"w": "can", "b": [0.3628, 0.2791, 0.3978, 0.2988]}, {"w": "be", "b": [0.4041, 0.2791, 0.4279, 0.2988]}, {"w": "interpreted", "b": [0.4342, 0.2791, 0.5435, 0.2988]}, {"w": "as", "b": [0.5498, 0.2791, 0.5708, 0.2988]}, {"w": "the", "b": [0.5771, 0.2791, 0.6079, 0.2988]}, {"w": "tensor", "b": [0.6142, 0.2791, 0.6759, 0.2988]}, {"w": "describing", "b": [0.6822, 0.2791, 0.7873, 0.2988]}, {"w": "the", "b": [0.7936, 0.2791, 0.8244, 0.2988]}, {"w": "curvature", "b": [0.1294, 0.3005, 0.2265, 0.3202]}, {"w": "of", "b": [0.2328, 0.3005, 0.2539, 0.3202]}, {"w": "f(W)", "b": [0.2602, 0.3015, 0.3207, 0.3217]}, {"w": "around", "b": [0.327, 0.3005, 0.3971, 0.3202]}, {"w": "W0.", "b": [0.4033, 0.3005, 0.4399, 0.3217]}]}, {"id": "b_2", "type": "paragraph", "text": "For this reason, in much the same way that, for a function f(x), you can reduce the value of f(x) by moving x a little in the opposite direction from the derivative, with a function f(W) of a tensor, you can reduce f(W) by moving W in the opposite direction from the gradient: for example, W1 = W0 - step * gradient(f)(W0) (where step is a small scaling factor). That means going against the curvature, which intuitively should put you lower on the curve. Note that the scaling factor step is needed because gradient(f)(W0) only approximates the curvature when you’re close to W0, so you don’t want to get too far from W0.", "words": [{"w": "For", "b": [0.1294, 0.3442, 0.1645, 0.3639]}, {"w": "this", "b": [0.1708, 0.3442, 0.2072, 0.3639]}, {"w": "reason,", "b": [0.2135, 0.3442, 0.2857, 0.3639]}, {"w": "in", "b": [0.292, 0.3442, 0.3116, 0.3639]}, {"w": "much", "b": [0.3179, 0.3442, 0.374, 0.3639]}, {"w": "the", "b": [0.3803, 0.3442, 0.4111, 0.3639]}, {"w": "same", "b": [0.4174, 0.3442, 0.4692, 0.3639]}, {"w": "way", "b": [0.4755, 0.3442, 0.5176, 0.3639]}, {"w": "that,", "b": [0.5239, 0.3442, 0.568, 0.3639]}, {"w": "for", "b": [0.5743, 0.3442, 0.6037, 0.3639]}, {"w": "a", "b": [0.61, 0.3442, 0.6212, 0.3639]}, {"w": "function", "b": [0.6275, 0.3442, 0.7116, 0.3639]}, {"w": "f(x),", "b": [0.7179, 0.3442, 0.7847, 0.3654]}, {"w": "you", "b": [0.791, 0.3442, 0.8289, 0.3639]}, {"w": "can", "b": [0.8352, 0.3442, 0.8702, 0.3639]}, {"w": "reduce", "b": [0.1294, 0.3655, 0.1966, 0.3853]}, {"w": "the", "b": [0.2029, 0.3655, 0.2338, 0.3853]}, {"w": "value", "b": [0.2401, 0.3655, 0.2947, 0.3853]}, {"w": "of", "b": [0.301, 0.3655, 0.322, 0.3853]}, {"w": "f(x)", "b": [0.3283, 0.3666, 0.3888, 0.3868]}, {"w": "by", "b": [0.3951, 0.3655, 0.4204, 0.3853]}, {"w": "moving", "b": [0.4267, 0.3655, 0.5038, 0.3853]}, {"w": "x", "b": [0.5101, 0.3666, 0.5252, 0.3868]}, {"w": "a", "b": [0.5315, 0.3655, 0.5427, 0.3853]}, {"w": "little", "b": [0.549, 0.3655, 0.5953, 0.3853]}, {"w": "in", "b": [0.6016, 0.3655, 0.6212, 0.3853]}, {"w": "the", "b": [0.6275, 0.3655, 0.6583, 0.3853]}, {"w": "opposite", "b": [0.6646, 0.3655, 0.7501, 0.3853]}, {"w": "direction", "b": [0.7564, 0.3655, 0.8461, 0.3853]}, {"w": "from", "b": [0.1294, 0.3869, 0.1785, 0.4067]}, {"w": "the", "b": [0.1848, 0.3869, 0.2156, 0.4067]}, {"w": "derivative,", "b": [0.2219, 0.3869, 0.3291, 0.4067]}, {"w": "with", "b": [0.3354, 0.3869, 0.3802, 0.4067]}, {"w": "a", "b": [0.3865, 0.3869, 0.3977, 0.4067]}, {"w": "function", "b": [0.404, 0.3869, 0.4881, 0.4067]}, {"w": "f(W)", "b": [0.4944, 0.388, 0.5549, 0.4082]}, {"w": "of", "b": [0.5612, 0.3869, 0.5822, 0.4067]}, {"w": "a", "b": [0.5885, 0.3869, 0.5997, 0.4067]}, {"w": "tensor,", "b": [0.606, 0.3869, 0.673, 0.4067]}, {"w": "you", "b": [0.6793, 0.3869, 0.7171, 0.4067]}, {"w": "can", "b": [0.7234, 0.3869, 0.7584, 0.4067]}, {"w": "reduce", "b": [0.7647, 0.3869, 0.832, 0.4067]}, {"w": "f(W)", "b": [0.1294, 0.4094, 0.19, 0.4296]}, {"w": "by", "b": [0.1963, 0.4083, 0.2215, 0.4281]}, {"w": "moving", "b": [0.2278, 0.4083, 0.3049, 0.4281]}, {"w": "W", "b": [0.3112, 0.4094, 0.3263, 0.4296]}, {"w": "in", "b": [0.3326, 0.4083, 0.3522, 0.4281]}, {"w": "the", "b": [0.3585, 0.4083, 0.3894, 0.4281]}, {"w": "opposite", "b": [0.3957, 0.4083, 0.4812, 0.4281]}, {"w": "direction", "b": [0.4875, 0.4083, 0.5772, 0.4281]}, {"w": "from", "b": [0.5835, 0.4083, 0.6325, 0.4281]}, {"w": "the", "b": [0.6388, 0.4083, 0.6696, 0.4281]}, {"w": "gradient:", "b": [0.6759, 0.4083, 0.7656, 0.4281]}, {"w": "for", "b": [0.7719, 0.4083, 0.8013, 0.4281]}, {"w": "example,", "b": [0.1294, 0.4297, 0.2212, 0.4495]}, {"w": "W1", "b": [0.2275, 0.4308, 0.2577, 0.451]}, {"w": "=", "b": [0.2729, 0.4308, 0.288, 0.451]}, {"w": "W0", "b": [0.3031, 0.4308, 0.3334, 0.451]}, {"w": "-", "b": [0.3485, 0.4308, 0.3637, 0.451]}, {"w": "step", "b": [0.3788, 0.4308, 0.4394, 0.451]}, {"w": "*", "b": [0.4545, 0.4308, 0.4696, 0.451]}, {"w": "gradient(f)(W0)", "b": [0.4848, 0.4308, 0.7118, 0.451]}, {"w": "(where", "b": [0.7182, 0.4297, 0.7882, 0.4495]}, {"w": "step", "b": [0.7945, 0.4308, 0.855, 0.451]}, {"w": "is", "b": [0.1294, 0.4511, 0.1462, 0.4709]}, {"w": "a", "b": [0.1525, 0.4511, 0.1637, 0.4709]}, {"w": "small", "b": [0.1701, 0.4511, 0.2247, 0.4709]}, {"w": "scaling", "b": [0.231, 0.4511, 0.3025, 0.4709]}, {"w": "factor).", "b": [0.3088, 0.4511, 0.3823, 0.4709]}, {"w": "That", "b": [0.3886, 0.4511, 0.4349, 0.4709]}, {"w": "means", "b": [0.4412, 0.4511, 0.5056, 0.4709]}, {"w": "going", "b": [0.5119, 0.4511, 0.5694, 0.4709]}, {"w": "against", "b": [0.5757, 0.4511, 0.6472, 0.4709]}, {"w": "the", "b": [0.6535, 0.4511, 0.6843, 0.4709]}, {"w": "curvature,", "b": [0.6906, 0.4511, 0.7922, 0.4709]}, {"w": "which", "b": [0.7985, 0.4511, 0.8601, 0.4709]}, {"w": "intuitively", "b": [0.1294, 0.4716, 0.2331, 0.4914]}, {"w": "should", "b": [0.2394, 0.4716, 0.3067, 0.4914]}, {"w": "put", "b": [0.313, 0.4716, 0.3453, 0.4914]}, {"w": "you", "b": [0.3516, 0.4716, 0.3894, 0.4914]}, {"w": "lower", "b": [0.3957, 0.4716, 0.4532, 0.4914]}, {"w": "on", "b": [0.4595, 0.4716, 0.4847, 0.4914]}, {"w": "the", "b": [0.491, 0.4716, 0.5218, 0.4914]}, {"w": "curve.", "b": [0.5281, 0.4716, 0.5905, 0.4914]}, {"w": "Note", "b": [0.5967, 0.4716, 0.6457, 0.4914]}, {"w": "that", "b": [0.652, 0.4716, 0.6899, 0.4914]}, {"w": "the", "b": [0.6962, 0.4716, 0.727, 0.4914]}, {"w": "scaling", "b": [0.7333, 0.4716, 0.8048, 0.4914]}, {"w": "factor", "b": [0.8111, 0.4716, 0.8699, 0.4914]}, {"w": "step", "b": [0.1294, 0.4932, 0.19, 0.5134]}, {"w": "is", "b": [0.1963, 0.4921, 0.2131, 0.5119]}, {"w": "needed", "b": [0.2194, 0.4921, 0.2908, 0.5119]}, {"w": "because", "b": [0.2971, 0.4921, 0.377, 0.5119]}, {"w": "gradient(f)(W0)", "b": [0.3832, 0.4932, 0.6103, 0.5134]}, {"w": "only", "b": [0.6166, 0.4921, 0.6615, 0.5119]}, {"w": "approximates", "b": [0.6678, 0.4921, 0.8037, 0.5119]}, {"w": "the", "b": [0.81, 0.4921, 0.8408, 0.5119]}, {"w": "curvature", "b": [0.1294, 0.5135, 0.2247, 0.5332]}, {"w": "when", "b": [0.231, 0.5135, 0.2856, 0.5332]}, {"w": "you’re", "b": [0.2919, 0.5135, 0.3578, 0.5332]}, {"w": "close", "b": [0.3641, 0.5135, 0.4159, 0.5332]}, {"w": "to", "b": [0.4222, 0.5135, 0.4418, 0.5332]}, {"w": "W0,", "b": [0.4481, 0.5135, 0.4847, 0.5347]}, {"w": "so", "b": [0.491, 0.5135, 0.5134, 0.5332]}, {"w": "you", "b": [0.5197, 0.5135, 0.5576, 0.5332]}, {"w": "don’t", "b": [0.5639, 0.5135, 0.6167, 0.5332]}, {"w": "want", "b": [0.623, 0.5135, 0.672, 0.5332]}, {"w": "to", "b": [0.6783, 0.5135, 0.6979, 0.5332]}, {"w": "get", "b": [0.7042, 0.5135, 0.7351, 0.5332]}, {"w": "too", "b": [0.7414, 0.5135, 0.7736, 0.5332]}, {"w": "far", "b": [0.7799, 0.5135, 0.8079, 0.5332]}, {"w": "from", "b": [0.8142, 0.5135, 0.8633, 0.5332]}, {"w": "W0.", "b": [0.1294, 0.5349, 0.166, 0.5561]}]}, {"id": "b_3", "type": "paragraph", "text": "2.4.3. Stochastic gradient descent", "words": [{"w": "2.4.3.", "b": [0.1294, 0.583, 0.1862, 0.6028]}, {"w": "Stochastic", "b": [0.1925, 0.583, 0.3018, 0.6028]}, {"w": "gradient", "b": [0.3081, 0.583, 0.3992, 0.6028]}, {"w": "descent", "b": [0.4055, 0.583, 0.4853, 0.6028]}]}, {"id": "b_4", "type": "paragraph", "text": "Given a differentiable function, it’s theoretically possible to find its minimum analytically: it’s known that a function’s minimum is a point where the derivative is 0, so all you have to do is find all the points where the derivative goes to 0 and check for which of these points the function has the lowest value.", "words": [{"w": "Given", "b": [0.1294, 0.6258, 0.1911, 0.6456]}, {"w": "a", "b": [0.1974, 0.6258, 0.2086, 0.6456]}, {"w": "differentiable", "b": [0.2149, 0.6258, 0.3503, 0.6456]}, {"w": "function,", "b": [0.3566, 0.6258, 0.447, 0.6456]}, {"w": "it’s", "b": [0.4533, 0.6258, 0.4841, 0.6456]}, {"w": "theoretically", "b": [0.4904, 0.6258, 0.6165, 0.6456]}, {"w": "possible", "b": [0.6228, 0.6258, 0.7055, 0.6456]}, {"w": "to", "b": [0.7118, 0.6258, 0.7314, 0.6456]}, {"w": "find", "b": [0.7377, 0.6258, 0.7784, 0.6456]}, {"w": "its", "b": [0.7847, 0.6258, 0.8085, 0.6456]}, {"w": "minimum", "b": [0.1294, 0.6463, 0.2275, 0.6661]}, {"w": "analytically:", "b": [0.2338, 0.6463, 0.3586, 0.6661]}, {"w": "it’s", "b": [0.3649, 0.6463, 0.3956, 0.6661]}, {"w": "known", "b": [0.402, 0.6463, 0.4706, 0.6661]}, {"w": "that", "b": [0.4769, 0.6463, 0.5148, 0.6661]}, {"w": "a", "b": [0.5211, 0.6463, 0.5323, 0.6661]}, {"w": "function’s", "b": [0.5386, 0.6463, 0.6395, 0.6661]}, {"w": "minimum", "b": [0.6458, 0.6463, 0.7439, 0.6661]}, {"w": "is", "b": [0.7502, 0.6463, 0.767, 0.6661]}, {"w": "a", "b": [0.7733, 0.6463, 0.7845, 0.6661]}, {"w": "point", "b": [0.7908, 0.6463, 0.8427, 0.6661]}, {"w": "where", "b": [0.1294, 0.6668, 0.191, 0.6866]}, {"w": "the", "b": [0.1973, 0.6668, 0.2282, 0.6866]}, {"w": "derivative", "b": [0.2345, 0.6668, 0.3354, 0.6866]}, {"w": "is", "b": [0.3417, 0.6668, 0.3585, 0.6866]}, {"w": "0,", "b": [0.3648, 0.6668, 0.3837, 0.6866]}, {"w": "so", "b": [0.39, 0.6668, 0.4124, 0.6866]}, {"w": "all", "b": [0.4188, 0.6668, 0.444, 0.6866]}, {"w": "you", "b": [0.4503, 0.6668, 0.4881, 0.6866]}, {"w": "have", "b": [0.4944, 0.6668, 0.5421, 0.6866]}, {"w": "to", "b": [0.5484, 0.6668, 0.568, 0.6866]}, {"w": "do", "b": [0.5743, 0.6668, 0.5995, 0.6866]}, {"w": "is", "b": [0.6058, 0.6668, 0.6227, 0.6866]}, {"w": "find", "b": [0.629, 0.6668, 0.6696, 0.6866]}, {"w": "all", "b": [0.6759, 0.6668, 0.7011, 0.6866]}, {"w": "the", "b": [0.7074, 0.6668, 0.7383, 0.6866]}, {"w": "points", "b": [0.7446, 0.6668, 0.8062, 0.6866]}, {"w": "where", "b": [0.1294, 0.6873, 0.191, 0.7071]}, {"w": "the", "b": [0.1973, 0.6873, 0.2282, 0.7071]}, {"w": "derivative", "b": [0.2345, 0.6873, 0.3354, 0.7071]}, {"w": "goes", "b": [0.3417, 0.6873, 0.3879, 0.7071]}, {"w": "to", "b": [0.3942, 0.6873, 0.4138, 0.7071]}, {"w": "0", "b": [0.4201, 0.6873, 0.4328, 0.7071]}, {"w": "and", "b": [0.439, 0.6873, 0.4754, 0.7071]}, {"w": "check", "b": [0.4818, 0.6873, 0.5406, 0.7071]}, {"w": "for", "b": [0.5469, 0.6873, 0.5763, 0.7071]}, {"w": "which", "b": [0.5826, 0.6873, 0.6443, 0.7071]}, {"w": "of", "b": [0.6506, 0.6873, 0.6716, 0.7071]}, {"w": "these", "b": [0.6779, 0.6873, 0.7297, 0.7071]}, {"w": "points", "b": [0.736, 0.6873, 0.7977, 0.7071]}, {"w": "the", "b": [0.804, 0.6873, 0.8348, 0.7071]}, {"w": "function", "b": [0.1294, 0.7078, 0.2135, 0.7276]}, {"w": "has", "b": [0.2198, 0.7078, 0.2534, 0.7276]}, {"w": "the", "b": [0.2597, 0.7078, 0.2906, 0.7276]}, {"w": "lowest", "b": [0.2969, 0.7078, 0.3627, 0.7276]}, {"w": "value.", "b": [0.369, 0.7078, 0.43, 0.7276]}]}, {"id": "b_5", "type": "paragraph", "text": "Applied to a neural network, that means finding analytically the combination of weight values that yields the smallest possible loss function. This can be done by solving the equation gradient(f)(W) = 0 for W. This is a polynomial equation of N variables, where N is the number of coefficients in the network. Although it would be possible to solve such an equation for N = 2 or N = 3, doing so is intractable for real", "words": [{"w": "Applied", "b": [0.1294, 0.7506, 0.2107, 0.7703]}, {"w": "to", "b": [0.217, 0.7506, 0.2366, 0.7703]}, {"w": "a", "b": [0.2429, 0.7506, 0.2541, 0.7703]}, {"w": "neural", "b": [0.2604, 0.7506, 0.3235, 0.7703]}, {"w": "network,", "b": [0.3298, 0.7506, 0.4188, 0.7703]}, {"w": "that", "b": [0.4251, 0.7506, 0.4629, 0.7703]}, {"w": "means", "b": [0.4692, 0.7506, 0.5337, 0.7703]}, {"w": "finding", "b": [0.54, 0.7506, 0.6128, 0.7703]}, {"w": "analytically", "b": [0.6191, 0.7506, 0.7368, 0.7703]}, {"w": "the", "b": [0.7432, 0.7506, 0.774, 0.7703]}, {"w": "combination", "b": [0.1294, 0.7711, 0.2555, 0.7908]}, {"w": "of", "b": [0.2618, 0.7711, 0.2829, 0.7908]}, {"w": "weight", "b": [0.2892, 0.7711, 0.3578, 0.7908]}, {"w": "values", "b": [0.3641, 0.7711, 0.4286, 0.7908]}, {"w": "that", "b": [0.4349, 0.7711, 0.4727, 0.7908]}, {"w": "yields", "b": [0.479, 0.7711, 0.5393, 0.7908]}, {"w": "the", "b": [0.5456, 0.7711, 0.5764, 0.7908]}, {"w": "smallest", "b": [0.5827, 0.7711, 0.6654, 0.7908]}, {"w": "possible", "b": [0.6717, 0.7711, 0.7544, 0.7908]}, {"w": "loss", "b": [0.7606, 0.7711, 0.7999, 0.7908]}, {"w": "function.", "b": [0.1294, 0.7916, 0.2198, 0.8113]}, {"w": "This", "b": [0.2261, 0.7916, 0.271, 0.8113]}, {"w": "can", "b": [0.2773, 0.7916, 0.3123, 0.8113]}, {"w": "be", "b": [0.3186, 0.7916, 0.3424, 0.8113]}, {"w": "done", "b": [0.3487, 0.7916, 0.3977, 0.8113]}, {"w": "by", "b": [0.404, 0.7916, 0.4293, 0.8113]}, {"w": "solving", "b": [0.4356, 0.7916, 0.5099, 0.8113]}, {"w": "the", "b": [0.5162, 0.7916, 0.547, 0.8113]}, {"w": "equation", "b": [0.5533, 0.7916, 0.6402, 0.8113]}, {"w": "gradient(f)(W)", "b": [0.6464, 0.7926, 0.8583, 0.8128]}, {"w": "=", "b": [0.1294, 0.814, 0.1445, 0.8342]}, {"w": "0", "b": [0.1597, 0.814, 0.1748, 0.8342]}, {"w": "for", "b": [0.1811, 0.813, 0.2105, 0.8327]}, {"w": "W.", "b": [0.2168, 0.813, 0.2383, 0.8342]}, {"w": "This", "b": [0.2446, 0.813, 0.2894, 0.8327]}, {"w": "is", "b": [0.2957, 0.813, 0.3126, 0.8327]}, {"w": "a", "b": [0.3189, 0.813, 0.3301, 0.8327]}, {"w": "polynomial", "b": [0.3364, 0.813, 0.4513, 0.8327]}, {"w": "equation", "b": [0.4576, 0.813, 0.5445, 0.8327]}, {"w": "of", "b": [0.5508, 0.813, 0.5718, 0.8327]}, {"w": "N", "b": [0.5781, 0.813, 0.5949, 0.8327]}, {"w": "variables,", "b": [0.6012, 0.813, 0.6985, 0.8327]}, {"w": "where", "b": [0.7049, 0.813, 0.7665, 0.8327]}, {"w": "N", "b": [0.7727, 0.813, 0.7896, 0.8327]}, {"w": "is", "b": [0.7959, 0.813, 0.8127, 0.8327]}, {"w": "the", "b": [0.819, 0.813, 0.8498, 0.8327]}, {"w": "number", "b": [0.1294, 0.8344, 0.2065, 0.8541]}, {"w": "of", "b": [0.2128, 0.8344, 0.2338, 0.8541]}, {"w": "coefficients", "b": [0.2401, 0.8344, 0.3573, 0.8541]}, {"w": "in", "b": [0.3636, 0.8344, 0.3832, 0.8541]}, {"w": "the", "b": [0.3895, 0.8344, 0.4204, 0.8541]}, {"w": "network.", "b": [0.4267, 0.8344, 0.5157, 0.8541]}, {"w": "Although", "b": [0.522, 0.8344, 0.6173, 0.8541]}, {"w": "it", "b": [0.6236, 0.8344, 0.6376, 0.8541]}, {"w": "would", "b": [0.6439, 0.8344, 0.707, 0.8541]}, {"w": "be", "b": [0.7133, 0.8344, 0.7371, 0.8541]}, {"w": "possible", "b": [0.7434, 0.8344, 0.8261, 0.8541]}, {"w": "to", "b": [0.8324, 0.8344, 0.852, 0.8541]}, {"w": "solve", "b": [0.1294, 0.8549, 0.1827, 0.8746]}, {"w": "such", "b": [0.189, 0.8549, 0.2352, 0.8746]}, {"w": "an", "b": [0.2415, 0.8549, 0.2653, 0.8746]}, {"w": "equation", "b": [0.2716, 0.8549, 0.3585, 0.8746]}, {"w": "for", "b": [0.3648, 0.8549, 0.3942, 0.8746]}, {"w": "N", "b": [0.4005, 0.8549, 0.4173, 0.8746]}, {"w": "=", "b": [0.4236, 0.8549, 0.4379, 0.8746]}, {"w": "2", "b": [0.4442, 0.8549, 0.4568, 0.8746]}, {"w": "or", "b": [0.4631, 0.8549, 0.4841, 0.8746]}, {"w": "N", "b": [0.4904, 0.8549, 0.5072, 0.8746]}, {"w": "=", "b": [0.5135, 0.8549, 0.5277, 0.8746]}, {"w": "3,", "b": [0.534, 0.8549, 0.553, 0.8746]}, {"w": "doing", "b": [0.5593, 0.8549, 0.6167, 0.8746]}, {"w": "so", "b": [0.623, 0.8549, 0.6455, 0.8746]}, {"w": "is", "b": [0.6518, 0.8549, 0.6686, 0.8746]}, {"w": "intractable", "b": [0.6749, 0.8549, 0.7814, 0.8746]}, {"w": "for", "b": [0.7877, 0.8549, 0.8171, 0.8746]}, {"w": "real", "b": [0.8234, 0.8549, 0.8612, 0.8746]}]}]}, {"page": 87, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "neural networks, where the number of parameters is never less than a few thousand and can often be several tens of millions.", "words": [{"w": "neural", "b": [0.1294, 0.0857, 0.1925, 0.1054]}, {"w": "networks,", "b": [0.1988, 0.0857, 0.2975, 0.1054]}, {"w": "where", "b": [0.3038, 0.0857, 0.3655, 0.1054]}, {"w": "the", "b": [0.3718, 0.0857, 0.4026, 0.1054]}, {"w": "number", "b": [0.4089, 0.0857, 0.486, 0.1054]}, {"w": "of", "b": [0.4923, 0.0857, 0.5133, 0.1054]}, {"w": "parameters", "b": [0.5196, 0.0857, 0.6303, 0.1054]}, {"w": "is", "b": [0.6366, 0.0857, 0.6534, 0.1054]}, {"w": "never", "b": [0.6597, 0.0857, 0.7157, 0.1054]}, {"w": "less", "b": [0.722, 0.0857, 0.7599, 0.1054]}, {"w": "than", "b": [0.7662, 0.0857, 0.8096, 0.1054]}, {"w": "a", "b": [0.8159, 0.0857, 0.8271, 0.1054]}, {"w": "few", "b": [0.1294, 0.1062, 0.1672, 0.1259]}, {"w": "thousand", "b": [0.1735, 0.1062, 0.2646, 0.1259]}, {"w": "and", "b": [0.2709, 0.1062, 0.3074, 0.1259]}, {"w": "can", "b": [0.3136, 0.1062, 0.3487, 0.1259]}, {"w": "often", "b": [0.355, 0.1062, 0.4068, 0.1259]}, {"w": "be", "b": [0.4131, 0.1062, 0.4369, 0.1259]}, {"w": "several", "b": [0.4432, 0.1062, 0.5147, 0.1259]}, {"w": "tens", "b": [0.521, 0.1062, 0.5616, 0.1259]}, {"w": "of", "b": [0.5679, 0.1062, 0.5889, 0.1259]}, {"w": "millions.", "b": [0.5952, 0.1062, 0.6843, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Instead, you can use the four-step algorithm outlined at the beginning of this section: modify the parameters little by little based on the current loss value on a random batch of data. Because you’re dealing with a differentiable function, you can compute its gradient, which gives you an efficient way to implement step 4. If you update the weights in the opposite direction from the gradient, the loss will be a little less every time:", "words": [{"w": "Instead,", "b": [0.1294, 0.149, 0.2086, 0.1687]}, {"w": "you", "b": [0.2149, 0.149, 0.2527, 0.1687]}, {"w": "can", "b": [0.259, 0.149, 0.294, 0.1687]}, {"w": "use", "b": [0.3003, 0.149, 0.334, 0.1687]}, {"w": "the", "b": [0.3403, 0.149, 0.3711, 0.1687]}, {"w": "four-step", "b": [0.3774, 0.149, 0.4679, 0.1687]}, {"w": "algorithm", "b": [0.4743, 0.149, 0.5724, 0.1687]}, {"w": "outlined", "b": [0.5787, 0.149, 0.6613, 0.1687]}, {"w": "at", "b": [0.6677, 0.149, 0.6859, 0.1687]}, {"w": "the", "b": [0.6922, 0.149, 0.723, 0.1687]}, {"w": "beginning", "b": [0.7293, 0.149, 0.8302, 0.1687]}, {"w": "of", "b": [0.8365, 0.149, 0.8575, 0.1687]}, {"w": "this", "b": [0.1294, 0.1695, 0.1659, 0.1892]}, {"w": "section:", "b": [0.1722, 0.1695, 0.2506, 0.1892]}, {"w": "modify", "b": [0.257, 0.1695, 0.3298, 0.1892]}, {"w": "the", "b": [0.3361, 0.1695, 0.367, 0.1892]}, {"w": "parameters", "b": [0.3733, 0.1695, 0.4839, 0.1892]}, {"w": "little", "b": [0.4902, 0.1695, 0.5365, 0.1892]}, {"w": "by", "b": [0.5428, 0.1695, 0.568, 0.1892]}, {"w": "little", "b": [0.5743, 0.1695, 0.6206, 0.1892]}, {"w": "based", "b": [0.6268, 0.1695, 0.6842, 0.1892]}, {"w": "on", "b": [0.6905, 0.1695, 0.7158, 0.1892]}, {"w": "the", "b": [0.7221, 0.1695, 0.7529, 0.1892]}, {"w": "current", "b": [0.7592, 0.1695, 0.8306, 0.1892]}, {"w": "loss", "b": [0.1294, 0.19, 0.1687, 0.2097]}, {"w": "value", "b": [0.175, 0.19, 0.2296, 0.2097]}, {"w": "on", "b": [0.2359, 0.19, 0.2611, 0.2097]}, {"w": "a", "b": [0.2674, 0.19, 0.2786, 0.2097]}, {"w": "random", "b": [0.285, 0.19, 0.362, 0.2097]}, {"w": "batch", "b": [0.3683, 0.19, 0.423, 0.2097]}, {"w": "of", "b": [0.4293, 0.19, 0.4503, 0.2097]}, {"w": "data.", "b": [0.4566, 0.19, 0.5049, 0.2097]}, {"w": "Because", "b": [0.5112, 0.19, 0.5953, 0.2097]}, {"w": "you’re", "b": [0.6016, 0.19, 0.6674, 0.2097]}, {"w": "dealing", "b": [0.6737, 0.19, 0.748, 0.2097]}, {"w": "with", "b": [0.7543, 0.19, 0.7992, 0.2097]}, {"w": "a", "b": [0.8055, 0.19, 0.8167, 0.2097]}, {"w": "differentiable", "b": [0.1294, 0.2105, 0.2648, 0.2302]}, {"w": "function,", "b": [0.2711, 0.2105, 0.3615, 0.2302]}, {"w": "you", "b": [0.3678, 0.2105, 0.4057, 0.2302]}, {"w": "can", "b": [0.412, 0.2105, 0.447, 0.2302]}, {"w": "compute", "b": [0.4532, 0.2105, 0.5401, 0.2302]}, {"w": "its", "b": [0.5464, 0.2105, 0.5703, 0.2302]}, {"w": "gradient,", "b": [0.5766, 0.2105, 0.6655, 0.2302]}, {"w": "which", "b": [0.6719, 0.2105, 0.7335, 0.2302]}, {"w": "gives", "b": [0.7398, 0.2105, 0.7931, 0.2302]}, {"w": "you", "b": [0.7994, 0.2105, 0.8372, 0.2302]}, {"w": "an", "b": [0.8435, 0.2105, 0.8673, 0.2302]}, {"w": "efficient", "b": [0.1294, 0.231, 0.213, 0.2507]}, {"w": "way", "b": [0.2193, 0.231, 0.2613, 0.2507]}, {"w": "to", "b": [0.2676, 0.231, 0.2873, 0.2507]}, {"w": "implement", "b": [0.2936, 0.231, 0.4015, 0.2507]}, {"w": "step", "b": [0.4078, 0.231, 0.4484, 0.2507]}, {"w": "4.", "b": [0.4547, 0.231, 0.4737, 0.2507]}, {"w": "If", "b": [0.48, 0.231, 0.4968, 0.2507]}, {"w": "you", "b": [0.5031, 0.231, 0.5409, 0.2507]}, {"w": "update", "b": [0.5472, 0.231, 0.6145, 0.2507]}, {"w": "the", "b": [0.6208, 0.231, 0.6516, 0.2507]}, {"w": "weights", "b": [0.6579, 0.231, 0.7364, 0.2507]}, {"w": "in", "b": [0.7427, 0.231, 0.7623, 0.2507]}, {"w": "the", "b": [0.7686, 0.231, 0.7995, 0.2507]}, {"w": "opposite", "b": [0.1294, 0.2515, 0.2149, 0.2712]}, {"w": "direction", "b": [0.2212, 0.2515, 0.3109, 0.2712]}, {"w": "from", "b": [0.3171, 0.2515, 0.3662, 0.2712]}, {"w": "the", "b": [0.3725, 0.2515, 0.4033, 0.2712]}, {"w": "gradient,", "b": [0.4096, 0.2515, 0.4986, 0.2712]}, {"w": "the", "b": [0.5049, 0.2515, 0.5357, 0.2712]}, {"w": "loss", "b": [0.542, 0.2515, 0.5813, 0.2712]}, {"w": "will", "b": [0.5876, 0.2515, 0.6268, 0.2712]}, {"w": "be", "b": [0.6331, 0.2515, 0.657, 0.2712]}, {"w": "a", "b": [0.6633, 0.2515, 0.6745, 0.2712]}, {"w": "little", "b": [0.6808, 0.2515, 0.727, 0.2712]}, {"w": "less", "b": [0.7333, 0.2515, 0.7712, 0.2712]}, {"w": "every", "b": [0.7775, 0.2515, 0.8335, 0.2712]}, {"w": "time:", "b": [0.1294, 0.272, 0.1813, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "1. Draw a batch of training samples x and corresponding targets y. 2. Run the network on x to obtain predictions y_pred. 3. Compute the loss of the network on the batch, a measure of the mismatch between y_pred and y. 4. Compute the gradient of the loss with regard to the network’s parameters (a backward pass). 5. Move the parameters a little in the opposite direction from the gradient—for example W = step * gradient—thus reducing the loss on the batch a bit.", "words": [{"w": "1.", "b": [0.1551, 0.3103, 0.174, 0.33]}, {"w": "Draw", "b": [0.1799, 0.3103, 0.2359, 0.33]}, {"w": "a", "b": [0.2422, 0.3103, 0.2534, 0.33]}, {"w": "batch", "b": [0.2597, 0.3103, 0.3143, 0.33]}, {"w": "of", "b": [0.3206, 0.3103, 0.3417, 0.33]}, {"w": "training", "b": [0.348, 0.3103, 0.4264, 0.33]}, {"w": "samples", "b": [0.4328, 0.3103, 0.514, 0.33]}, {"w": "x", "b": [0.5203, 0.3113, 0.5354, 0.3315]}, {"w": "and", "b": [0.5417, 0.3103, 0.5782, 0.33]}, {"w": "corresponding", "b": [0.5845, 0.3103, 0.7288, 0.33]}, {"w": "targets", "b": [0.7351, 0.3103, 0.8019, 0.33]}, {"w": "y.", "b": [0.8082, 0.3103, 0.8296, 0.3315]}, {"w": "2.", "b": [0.1551, 0.3317, 0.174, 0.3514]}, {"w": "Run", "b": [0.1799, 0.3317, 0.2219, 0.3514]}, {"w": "the", "b": [0.2282, 0.3317, 0.259, 0.3514]}, {"w": "network", "b": [0.2654, 0.3317, 0.348, 0.3514]}, {"w": "on", "b": [0.3543, 0.3317, 0.3796, 0.3514]}, {"w": "x", "b": [0.3858, 0.3327, 0.401, 0.3529]}, {"w": "to", "b": [0.4073, 0.3317, 0.4269, 0.3514]}, {"w": "obtain", "b": [0.4332, 0.3317, 0.4963, 0.3514]}, {"w": "predictions", "b": [0.5026, 0.3317, 0.6147, 0.3514]}, {"w": "y_pred.", "b": [0.6209, 0.3317, 0.7181, 0.3529]}, {"w": "3.", "b": [0.1551, 0.3531, 0.174, 0.3728]}, {"w": "Compute", "b": [0.1799, 0.3531, 0.2724, 0.3728]}, {"w": "the", "b": [0.2787, 0.3531, 0.3095, 0.3728]}, {"w": "loss", "b": [0.3158, 0.3531, 0.3551, 0.3728]}, {"w": "of", "b": [0.3614, 0.3531, 0.3824, 0.3728]}, {"w": "the", "b": [0.3887, 0.3531, 0.4195, 0.3728]}, {"w": "network", "b": [0.4258, 0.3531, 0.5085, 0.3728]}, {"w": "on", "b": [0.5148, 0.3531, 0.54, 0.3728]}, {"w": "the", "b": [0.5463, 0.3531, 0.5771, 0.3728]}, {"w": "batch,", "b": [0.5835, 0.3531, 0.6444, 0.3728]}, {"w": "a", "b": [0.6507, 0.3531, 0.6619, 0.3728]}, {"w": "measure", "b": [0.6682, 0.3531, 0.7523, 0.3728]}, {"w": "of", "b": [0.7586, 0.3531, 0.7796, 0.3728]}, {"w": "the", "b": [0.7859, 0.3531, 0.8167, 0.3728]}, {"w": "mismatch", "b": [0.1799, 0.3736, 0.278, 0.3933]}, {"w": "between", "b": [0.2843, 0.3736, 0.3683, 0.3933]}, {"w": "y_pred", "b": [0.3746, 0.3746, 0.4654, 0.3948]}, {"w": "and", "b": [0.4717, 0.3736, 0.5081, 0.3933]}, {"w": "y.", "b": [0.5144, 0.3736, 0.5359, 0.3948]}, {"w": "4.", "b": [0.1551, 0.395, 0.174, 0.4147]}, {"w": "Compute", "b": [0.1799, 0.395, 0.2724, 0.4147]}, {"w": "the", "b": [0.2787, 0.395, 0.3095, 0.4147]}, {"w": "gradient", "b": [0.3158, 0.395, 0.3985, 0.4147]}, {"w": "of", "b": [0.4048, 0.395, 0.4258, 0.4147]}, {"w": "the", "b": [0.4321, 0.395, 0.4629, 0.4147]}, {"w": "loss", "b": [0.4692, 0.395, 0.5085, 0.4147]}, {"w": "with", "b": [0.5148, 0.395, 0.5596, 0.4147]}, {"w": "regard", "b": [0.5659, 0.395, 0.6304, 0.4147]}, {"w": "to", "b": [0.6367, 0.395, 0.6563, 0.4147]}, {"w": "the", "b": [0.6626, 0.395, 0.6934, 0.4147]}, {"w": "network’s", "b": [0.6997, 0.395, 0.7992, 0.4147]}, {"w": "parameters", "b": [0.1799, 0.4155, 0.2905, 0.4352]}, {"w": "(a", "b": [0.2968, 0.4155, 0.3164, 0.4352]}, {"w": "backward", "b": [0.3227, 0.4155, 0.4213, 0.4352]}, {"w": "pass).", "b": [0.4276, 0.4155, 0.4871, 0.4352]}, {"w": "5.", "b": [0.1551, 0.436, 0.174, 0.4557]}, {"w": "Move", "b": [0.1799, 0.436, 0.2387, 0.4557]}, {"w": "the", "b": [0.245, 0.436, 0.2758, 0.4557]}, {"w": "parameters", "b": [0.2822, 0.436, 0.3928, 0.4557]}, {"w": "a", "b": [0.3991, 0.436, 0.4103, 0.4557]}, {"w": "little", "b": [0.4166, 0.436, 0.4629, 0.4557]}, {"w": "in", "b": [0.4692, 0.436, 0.4888, 0.4557]}, {"w": "the", "b": [0.4951, 0.436, 0.526, 0.4557]}, {"w": "opposite", "b": [0.5323, 0.436, 0.6178, 0.4557]}, {"w": "direction", "b": [0.6241, 0.436, 0.7137, 0.4557]}, {"w": "from", "b": [0.72, 0.436, 0.7691, 0.4557]}, {"w": "the", "b": [0.7754, 0.436, 0.8062, 0.4557]}, {"w": "gradient—for", "b": [0.1799, 0.4565, 0.3172, 0.4762]}, {"w": "example", "b": [0.3235, 0.4565, 0.4089, 0.4762]}, {"w": "W", "b": [0.4152, 0.4575, 0.4303, 0.4777]}, {"w": "=", "b": [0.4455, 0.4575, 0.4606, 0.4777]}, {"w": "step", "b": [0.4757, 0.4575, 0.5363, 0.4777]}, {"w": "*", "b": [0.5514, 0.4575, 0.5665, 0.4777]}, {"w": "gradient—thus", "b": [0.5817, 0.4565, 0.7701, 0.4777]}, {"w": "reducing", "b": [0.7764, 0.4565, 0.8647, 0.4762]}, {"w": "the", "b": [0.1799, 0.4779, 0.2107, 0.4976]}, {"w": "loss", "b": [0.217, 0.4779, 0.2562, 0.4976]}, {"w": "on", "b": [0.2626, 0.4779, 0.2878, 0.4976]}, {"w": "the", "b": [0.2941, 0.4779, 0.3249, 0.4976]}, {"w": "batch", "b": [0.3312, 0.4779, 0.3859, 0.4976]}, {"w": "a", "b": [0.3922, 0.4779, 0.4034, 0.4976]}, {"w": "bit.", "b": [0.4097, 0.4779, 0.4426, 0.4976]}]}, {"id": "b_3", "type": "paragraph", "text": "Easy enough! What I just described is called mini-batch stochastic gradient descent (mini-batch SGD). The term stochastic refers to the fact that each batch of data is drawn at random (stochastic is a scientific synonym of random). Figure 2.11 illustrates what happens in 1D, when the network has only one parameter and you have only one training sample.", "words": [{"w": "Easy", "b": [0.1294, 0.5206, 0.1785, 0.5404]}, {"w": "enough!", "b": [0.1848, 0.5206, 0.2674, 0.5404]}, {"w": "What", "b": [0.2737, 0.5206, 0.3284, 0.5404]}, {"w": "I", "b": [0.3347, 0.5206, 0.3431, 0.5404]}, {"w": "just", "b": [0.3494, 0.5206, 0.3858, 0.5404]}, {"w": "described", "b": [0.3921, 0.5206, 0.4888, 0.5404]}, {"w": "is", "b": [0.4951, 0.5206, 0.5119, 0.5404]}, {"w": "called", "b": [0.5182, 0.5206, 0.5785, 0.5404]}, {"w": "mini-batch", "b": [0.5847, 0.5206, 0.694, 0.5404]}, {"w": "stochastic", "b": [0.7003, 0.5206, 0.8012, 0.5404]}, {"w": "gradient", "b": [0.1294, 0.5411, 0.2149, 0.5609]}, {"w": "descent", "b": [0.2212, 0.5411, 0.2969, 0.5609]}, {"w": "(mini-batch", "b": [0.3031, 0.5411, 0.4208, 0.5609]}, {"w": "SGD).", "b": [0.4271, 0.5411, 0.4923, 0.5609]}, {"w": "The", "b": [0.4986, 0.5411, 0.5378, 0.5609]}, {"w": "term", "b": [0.5441, 0.5411, 0.5904, 0.5609]}, {"w": "stochastic", "b": [0.5966, 0.5411, 0.6975, 0.5609]}, {"w": "refers", "b": [0.7038, 0.5411, 0.7612, 0.5609]}, {"w": "to", "b": [0.7676, 0.5411, 0.7872, 0.5609]}, {"w": "the", "b": [0.7935, 0.5411, 0.8243, 0.5609]}, {"w": "fact", "b": [0.8306, 0.5411, 0.8684, 0.5609]}, {"w": "that", "b": [0.1294, 0.5616, 0.1673, 0.5814]}, {"w": "each", "b": [0.1736, 0.5616, 0.2198, 0.5814]}, {"w": "batch", "b": [0.2261, 0.5616, 0.2807, 0.5814]}, {"w": "of", "b": [0.287, 0.5616, 0.308, 0.5814]}, {"w": "data", "b": [0.3143, 0.5616, 0.3564, 0.5814]}, {"w": "is", "b": [0.3627, 0.5616, 0.3795, 0.5814]}, {"w": "drawn", "b": [0.3858, 0.5616, 0.4488, 0.5814]}, {"w": "at", "b": [0.4552, 0.5616, 0.4734, 0.5814]}, {"w": "random", "b": [0.4797, 0.5616, 0.5567, 0.5814]}, {"w": "(stochastic", "b": [0.563, 0.5616, 0.6723, 0.5814]}, {"w": "is", "b": [0.6786, 0.5616, 0.6954, 0.5814]}, {"w": "a", "b": [0.7017, 0.5616, 0.7129, 0.5814]}, {"w": "scientific", "b": [0.7192, 0.5616, 0.8117, 0.5814]}, {"w": "synonym", "b": [0.1294, 0.5821, 0.2219, 0.6019]}, {"w": "of", "b": [0.2282, 0.5821, 0.2492, 0.6019]}, {"w": "random).", "b": [0.2555, 0.5821, 0.3487, 0.6019]}, {"w": "Figure", "b": [0.355, 0.5821, 0.4209, 0.6019]}, {"w": "2.11", "b": [0.4272, 0.5821, 0.4704, 0.6019]}, {"w": "illustrates", "b": [0.4767, 0.5821, 0.5748, 0.6019]}, {"w": "what", "b": [0.5811, 0.5821, 0.6301, 0.6019]}, {"w": "happens", "b": [0.6365, 0.5821, 0.7191, 0.6019]}, {"w": "in", "b": [0.7254, 0.5821, 0.7451, 0.6019]}, {"w": "1D,", "b": [0.7514, 0.5821, 0.7885, 0.6019]}, {"w": "when", "b": [0.7948, 0.5821, 0.8494, 0.6019]}, {"w": "the", "b": [0.1294, 0.6026, 0.1602, 0.6224]}, {"w": "network", "b": [0.1665, 0.6026, 0.2492, 0.6224]}, {"w": "has", "b": [0.2555, 0.6026, 0.2891, 0.6224]}, {"w": "only", "b": [0.2954, 0.6026, 0.3403, 0.6224]}, {"w": "one", "b": [0.3466, 0.6026, 0.383, 0.6224]}, {"w": "parameter", "b": [0.3893, 0.6026, 0.4902, 0.6224]}, {"w": "and", "b": [0.4965, 0.6026, 0.5329, 0.6224]}, {"w": "you", "b": [0.5392, 0.6026, 0.5771, 0.6224]}, {"w": "have", "b": [0.5834, 0.6026, 0.631, 0.6224]}, {"w": "only", "b": [0.6373, 0.6026, 0.6822, 0.6224]}, {"w": "one", "b": [0.6885, 0.6026, 0.7249, 0.6224]}, {"w": "training", "b": [0.7312, 0.6026, 0.8097, 0.6224]}, {"w": "sample.", "b": [0.1294, 0.6231, 0.2072, 0.6429]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 2.11. SGD down a 1D loss curve (one learnable parameter)", "words": [{"w": "Figure", "b": [0.1294, 0.661, 0.1827, 0.6758]}, {"w": "2.11.", "b": [0.1874, 0.661, 0.2242, 0.6758]}, {"w": "SGD", "b": [0.2289, 0.661, 0.2678, 0.6758]}, {"w": "down", "b": [0.2725, 0.661, 0.3167, 0.6758]}, {"w": "a", "b": [0.3214, 0.661, 0.3309, 0.6758]}, {"w": "1D", "b": [0.3356, 0.661, 0.3587, 0.6758]}, {"w": "loss", "b": [0.3635, 0.661, 0.3929, 0.6758]}, {"w": "curve", "b": [0.3976, 0.661, 0.4428, 0.6758]}, {"w": "(one", "b": [0.4475, 0.661, 0.4822, 0.6758]}, {"w": "learnable", "b": [0.4869, 0.661, 0.5626, 0.6758]}, {"w": "parameter)", "b": [0.5673, 0.661, 0.6587, 0.6758]}]}]}, {"page": 88, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As you can see, intuitively it’s important to pick a reasonable value for the step factor. If it’s too small, the descent down the curve will take many iterations, and it could get stuck in a local minimum. If step is too large, your updates may end up taking you to completely random locations on the curve.", "words": [{"w": "As", "b": [0.1294, 0.0857, 0.1574, 0.1054]}, {"w": "you", "b": [0.1637, 0.0857, 0.2016, 0.1054]}, {"w": "can", "b": [0.2079, 0.0857, 0.2429, 0.1054]}, {"w": "see,", "b": [0.2492, 0.0857, 0.2877, 0.1054]}, {"w": "intuitively", "b": [0.294, 0.0857, 0.3978, 0.1054]}, {"w": "it’s", "b": [0.4041, 0.0857, 0.4349, 0.1054]}, {"w": "important", "b": [0.4412, 0.0857, 0.5393, 0.1054]}, {"w": "to", "b": [0.5456, 0.0857, 0.5652, 0.1054]}, {"w": "pick", "b": [0.5715, 0.0857, 0.615, 0.1054]}, {"w": "a", "b": [0.6213, 0.0857, 0.6325, 0.1054]}, {"w": "reasonable", "b": [0.6388, 0.0857, 0.7466, 0.1054]}, {"w": "value", "b": [0.7529, 0.0857, 0.8076, 0.1054]}, {"w": "for", "b": [0.8139, 0.0857, 0.8433, 0.1054]}, {"w": "the", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "step", "b": [0.1665, 0.1072, 0.2271, 0.1274]}, {"w": "factor.", "b": [0.2334, 0.1062, 0.2971, 0.1259]}, {"w": "If", "b": [0.3034, 0.1062, 0.3202, 0.1259]}, {"w": "it’s", "b": [0.3265, 0.1062, 0.3574, 0.1259]}, {"w": "too", "b": [0.3637, 0.1062, 0.3959, 0.1259]}, {"w": "small,", "b": [0.4022, 0.1062, 0.4632, 0.1259]}, {"w": "the", "b": [0.4695, 0.1062, 0.5003, 0.1259]}, {"w": "descent", "b": [0.5066, 0.1062, 0.5823, 0.1259]}, {"w": "down", "b": [0.5886, 0.1062, 0.6446, 0.1259]}, {"w": "the", "b": [0.6509, 0.1062, 0.6818, 0.1259]}, {"w": "curve", "b": [0.6881, 0.1062, 0.7441, 0.1259]}, {"w": "will", "b": [0.7504, 0.1062, 0.7896, 0.1259]}, {"w": "take", "b": [0.796, 0.1062, 0.838, 0.1259]}, {"w": "many", "b": [0.1294, 0.1276, 0.1855, 0.1473]}, {"w": "iterations,", "b": [0.1918, 0.1276, 0.292, 0.1473]}, {"w": "and", "b": [0.2983, 0.1276, 0.3347, 0.1473]}, {"w": "it", "b": [0.341, 0.1276, 0.355, 0.1473]}, {"w": "could", "b": [0.3613, 0.1276, 0.4174, 0.1473]}, {"w": "get", "b": [0.4237, 0.1276, 0.4545, 0.1473]}, {"w": "stuck", "b": [0.4608, 0.1276, 0.5141, 0.1473]}, {"w": "in", "b": [0.5204, 0.1276, 0.54, 0.1473]}, {"w": "a", "b": [0.5463, 0.1276, 0.5575, 0.1473]}, {"w": "local", "b": [0.5638, 0.1276, 0.6129, 0.1473]}, {"w": "minimum.", "b": [0.6192, 0.1276, 0.7236, 0.1473]}, {"w": "If", "b": [0.7298, 0.1276, 0.7466, 0.1473]}, {"w": "step", "b": [0.7529, 0.1286, 0.8134, 0.1488]}, {"w": "is", "b": [0.8198, 0.1276, 0.8366, 0.1473]}, {"w": "too", "b": [0.1294, 0.149, 0.1617, 0.1687]}, {"w": "large,", "b": [0.168, 0.149, 0.2242, 0.1687]}, {"w": "your", "b": [0.2305, 0.149, 0.2768, 0.1687]}, {"w": "updates", "b": [0.2831, 0.149, 0.3601, 0.1687]}, {"w": "may", "b": [0.3664, 0.149, 0.4099, 0.1687]}, {"w": "end", "b": [0.4162, 0.149, 0.4526, 0.1687]}, {"w": "up", "b": [0.4589, 0.149, 0.4841, 0.1687]}, {"w": "taking", "b": [0.4905, 0.149, 0.5535, 0.1687]}, {"w": "you", "b": [0.5598, 0.149, 0.5977, 0.1687]}, {"w": "to", "b": [0.604, 0.149, 0.6236, 0.1687]}, {"w": "completely", "b": [0.6299, 0.149, 0.742, 0.1687]}, {"w": "random", "b": [0.7483, 0.149, 0.8254, 0.1687]}, {"w": "locations", "b": [0.1294, 0.1695, 0.2205, 0.1892]}, {"w": "on", "b": [0.2268, 0.1695, 0.252, 0.1892]}, {"w": "the", "b": [0.2583, 0.1695, 0.2892, 0.1892]}, {"w": "curve.", "b": [0.2955, 0.1695, 0.3578, 0.1892]}]}, {"id": "b_1", "type": "paragraph", "text": "Note that a variant of the mini-batch SGD algorithm would be to draw a single sample and target at each iteration, rather than drawing a batch of data. This would be true SGD (as opposed to mini-batch SGD). Alternatively, going to the opposite extreme, you could run every step on all data available, which is called batch SGD. Each update would then be more accurate, but far more expensive. The efficient compromise between these two extremes is to use mini-batches of reasonable size.", "words": [{"w": "Note", "b": [0.1294, 0.2122, 0.1785, 0.232]}, {"w": "that", "b": [0.1848, 0.2122, 0.2226, 0.232]}, {"w": "a", "b": [0.2289, 0.2122, 0.2401, 0.232]}, {"w": "variant", "b": [0.2464, 0.2122, 0.3165, 0.232]}, {"w": "of", "b": [0.3228, 0.2122, 0.3438, 0.232]}, {"w": "the", "b": [0.3501, 0.2122, 0.3809, 0.232]}, {"w": "mini-batch", "b": [0.3872, 0.2122, 0.4965, 0.232]}, {"w": "SGD", "b": [0.5028, 0.2122, 0.5533, 0.232]}, {"w": "algorithm", "b": [0.5596, 0.2122, 0.6577, 0.232]}, {"w": "would", "b": [0.664, 0.2122, 0.7271, 0.232]}, {"w": "be", "b": [0.7334, 0.2122, 0.7572, 0.232]}, {"w": "to", "b": [0.7635, 0.2122, 0.7831, 0.232]}, {"w": "draw", "b": [0.7894, 0.2122, 0.8398, 0.232]}, {"w": "a", "b": [0.8462, 0.2122, 0.8574, 0.232]}, {"w": "single", "b": [0.1294, 0.2327, 0.1897, 0.2525]}, {"w": "sample", "b": [0.196, 0.2327, 0.2674, 0.2525]}, {"w": "and", "b": [0.2738, 0.2327, 0.3102, 0.2525]}, {"w": "target", "b": [0.3165, 0.2327, 0.3734, 0.2525]}, {"w": "at", "b": [0.3797, 0.2327, 0.398, 0.2525]}, {"w": "each", "b": [0.4043, 0.2327, 0.4505, 0.2525]}, {"w": "iteration,", "b": [0.4568, 0.2327, 0.5472, 0.2525]}, {"w": "rather", "b": [0.5535, 0.2327, 0.6123, 0.2525]}, {"w": "than", "b": [0.6185, 0.2327, 0.662, 0.2525]}, {"w": "drawing", "b": [0.6683, 0.2327, 0.7509, 0.2525]}, {"w": "a", "b": [0.7573, 0.2327, 0.7685, 0.2525]}, {"w": "batch", "b": [0.7748, 0.2327, 0.8294, 0.2525]}, {"w": "of", "b": [0.8357, 0.2327, 0.8567, 0.2525]}, {"w": "data.", "b": [0.1294, 0.2532, 0.1777, 0.273]}, {"w": "This", "b": [0.1841, 0.2532, 0.2289, 0.273]}, {"w": "would", "b": [0.2352, 0.2532, 0.2983, 0.273]}, {"w": "be", "b": [0.3046, 0.2532, 0.3284, 0.273]}, {"w": "true", "b": [0.3347, 0.2532, 0.3753, 0.273]}, {"w": "SGD", "b": [0.3816, 0.2532, 0.432, 0.273]}, {"w": "(as", "b": [0.4383, 0.2532, 0.4678, 0.273]}, {"w": "opposed", "b": [0.4741, 0.2532, 0.5581, 0.273]}, {"w": "to", "b": [0.5645, 0.2532, 0.5841, 0.273]}, {"w": "mini-batch", "b": [0.5904, 0.2532, 0.6997, 0.273]}, {"w": "SGD).", "b": [0.706, 0.2532, 0.7711, 0.273]}, {"w": "Alternatively,", "b": [0.1294, 0.2737, 0.2672, 0.2935]}, {"w": "going", "b": [0.2735, 0.2737, 0.3309, 0.2935]}, {"w": "to", "b": [0.3372, 0.2737, 0.3569, 0.2935]}, {"w": "the", "b": [0.3632, 0.2737, 0.394, 0.2935]}, {"w": "opposite", "b": [0.4003, 0.2737, 0.4858, 0.2935]}, {"w": "extreme,", "b": [0.4921, 0.2737, 0.5797, 0.2935]}, {"w": "you", "b": [0.586, 0.2737, 0.6238, 0.2935]}, {"w": "could", "b": [0.6301, 0.2737, 0.6862, 0.2935]}, {"w": "run", "b": [0.6925, 0.2737, 0.7261, 0.2935]}, {"w": "every", "b": [0.7324, 0.2737, 0.7884, 0.2935]}, {"w": "step", "b": [0.7947, 0.2737, 0.8354, 0.2935]}, {"w": "on", "b": [0.8417, 0.2737, 0.8669, 0.2935]}, {"w": "all", "b": [0.1294, 0.2942, 0.1561, 0.314]}, {"w": "data", "b": [0.1623, 0.2942, 0.2044, 0.314]}, {"w": "available,", "b": [0.2107, 0.2942, 0.308, 0.314]}, {"w": "which", "b": [0.3144, 0.2942, 0.376, 0.314]}, {"w": "is", "b": [0.3823, 0.2942, 0.3991, 0.314]}, {"w": "called", "b": [0.4054, 0.2942, 0.4657, 0.314]}, {"w": "batch", "b": [0.4719, 0.2942, 0.528, 0.314]}, {"w": "SGD.", "b": [0.5343, 0.2942, 0.5896, 0.314]}, {"w": "Each", "b": [0.5959, 0.2942, 0.6463, 0.314]}, {"w": "update", "b": [0.6526, 0.2942, 0.7199, 0.314]}, {"w": "would", "b": [0.7262, 0.2942, 0.7893, 0.314]}, {"w": "then", "b": [0.7956, 0.2942, 0.839, 0.314]}, {"w": "be", "b": [0.8453, 0.2942, 0.8691, 0.314]}, {"w": "more", "b": [0.1294, 0.3147, 0.1813, 0.3345]}, {"w": "accurate,", "b": [0.1876, 0.3147, 0.2779, 0.3345]}, {"w": "but", "b": [0.2842, 0.3147, 0.3164, 0.3345]}, {"w": "far", "b": [0.3227, 0.3147, 0.3507, 0.3345]}, {"w": "more", "b": [0.357, 0.3147, 0.4089, 0.3345]}, {"w": "expensive.", "b": [0.4152, 0.3147, 0.5224, 0.3345]}, {"w": "The", "b": [0.5287, 0.3147, 0.5679, 0.3345]}, {"w": "efficient", "b": [0.5742, 0.3147, 0.6577, 0.3345]}, {"w": "compromise", "b": [0.6641, 0.3147, 0.7888, 0.3345]}, {"w": "between", "b": [0.1294, 0.3352, 0.2135, 0.355]}, {"w": "these", "b": [0.2198, 0.3352, 0.2716, 0.355]}, {"w": "two", "b": [0.2779, 0.3352, 0.3158, 0.355]}, {"w": "extremes", "b": [0.3221, 0.3352, 0.4131, 0.355]}, {"w": "is", "b": [0.4194, 0.3352, 0.4363, 0.355]}, {"w": "to", "b": [0.4425, 0.3352, 0.4622, 0.355]}, {"w": "use", "b": [0.4685, 0.3352, 0.5021, 0.355]}, {"w": "mini-batches", "b": [0.5084, 0.3352, 0.6387, 0.355]}, {"w": "of", "b": [0.645, 0.3352, 0.666, 0.355]}, {"w": "reasonable", "b": [0.6723, 0.3352, 0.7802, 0.355]}, {"w": "size.", "b": [0.7865, 0.3352, 0.832, 0.355]}]}, {"id": "b_2", "type": "paragraph", "text": "Although figure 2.11 illustrates gradient descent in a 1D parameter space, in practice you’ll use gradient descent in highly dimensional spaces: every weight coefficient in a neural network is a free dimension in the space, and there may be tens of thousands or even millions of them. To help you build intuition about loss surfaces, you can also visualize gradient descent along a 2D loss surface, as shown in figure 2.12. But you can’t possibly visualize what the actual process of training a neural network looks like—you can’t represent a 1,000,000- dimensional space in a way that makes sense to humans. As such, it’s good to keep in mind that the intuitions you develop through these low- dimensional representations may not always be accurate in practice. This has historically been a source of issues in the world of deep-learning research.", "words": [{"w": "Although", "b": [0.1294, 0.378, 0.2247, 0.3978]}, {"w": "figure", "b": [0.231, 0.378, 0.2912, 0.3978]}, {"w": "2.11", "b": [0.2976, 0.378, 0.3408, 0.3978]}, {"w": "illustrates", "b": [0.347, 0.378, 0.4451, 0.3978]}, {"w": "gradient", "b": [0.4515, 0.378, 0.5341, 0.3978]}, {"w": "descent", "b": [0.5404, 0.378, 0.6161, 0.3978]}, {"w": "in", "b": [0.6224, 0.378, 0.642, 0.3978]}, {"w": "a", "b": [0.6483, 0.378, 0.6595, 0.3978]}, {"w": "1D", "b": [0.6658, 0.378, 0.6966, 0.3978]}, {"w": "parameter", "b": [0.703, 0.378, 0.8038, 0.3978]}, {"w": "space,", "b": [0.1294, 0.3985, 0.1917, 0.4183]}, {"w": "in", "b": [0.1981, 0.3985, 0.2177, 0.4183]}, {"w": "practice", "b": [0.224, 0.3985, 0.3038, 0.4183]}, {"w": "you’ll", "b": [0.3101, 0.3985, 0.3704, 0.4183]}, {"w": "use", "b": [0.3767, 0.3985, 0.4103, 0.4183]}, {"w": "gradient", "b": [0.4166, 0.3985, 0.4993, 0.4183]}, {"w": "descent", "b": [0.5056, 0.3985, 0.5813, 0.4183]}, {"w": "in", "b": [0.5876, 0.3985, 0.6072, 0.4183]}, {"w": "highly", "b": [0.6135, 0.3985, 0.678, 0.4183]}, {"w": "dimensional", "b": [0.6843, 0.3985, 0.8076, 0.4183]}, {"w": "spaces:", "b": [0.1294, 0.419, 0.2023, 0.4388]}, {"w": "every", "b": [0.2086, 0.419, 0.2646, 0.4388]}, {"w": "weight", "b": [0.2709, 0.419, 0.3396, 0.4388]}, {"w": "coefficient", "b": [0.3459, 0.419, 0.4532, 0.4388]}, {"w": "in", "b": [0.4596, 0.419, 0.4792, 0.4388]}, {"w": "a", "b": [0.4855, 0.419, 0.4967, 0.4388]}, {"w": "neural", "b": [0.503, 0.419, 0.566, 0.4388]}, {"w": "network", "b": [0.5723, 0.419, 0.655, 0.4388]}, {"w": "is", "b": [0.6613, 0.419, 0.6781, 0.4388]}, {"w": "a", "b": [0.6844, 0.419, 0.6956, 0.4388]}, {"w": "free", "b": [0.7019, 0.419, 0.7411, 0.4388]}, {"w": "dimension", "b": [0.7475, 0.419, 0.8526, 0.4388]}, {"w": "in", "b": [0.1294, 0.4395, 0.149, 0.4593]}, {"w": "the", "b": [0.1553, 0.4395, 0.1862, 0.4593]}, {"w": "space,", "b": [0.1925, 0.4395, 0.2548, 0.4593]}, {"w": "and", "b": [0.2611, 0.4395, 0.2975, 0.4593]}, {"w": "there", "b": [0.3038, 0.4395, 0.3543, 0.4593]}, {"w": "may", "b": [0.3606, 0.4395, 0.404, 0.4593]}, {"w": "be", "b": [0.4103, 0.4395, 0.4341, 0.4593]}, {"w": "tens", "b": [0.4404, 0.4395, 0.4811, 0.4593]}, {"w": "of", "b": [0.4874, 0.4395, 0.5084, 0.4593]}, {"w": "thousands", "b": [0.5147, 0.4395, 0.6156, 0.4593]}, {"w": "or", "b": [0.6219, 0.4395, 0.6429, 0.4593]}, {"w": "even", "b": [0.6492, 0.4395, 0.6969, 0.4593]}, {"w": "millions", "b": [0.7031, 0.4395, 0.7858, 0.4593]}, {"w": "of", "b": [0.7921, 0.4395, 0.8131, 0.4593]}, {"w": "them.", "b": [0.1294, 0.46, 0.1862, 0.4798]}, {"w": "To", "b": [0.1925, 0.46, 0.2187, 0.4798]}, {"w": "help", "b": [0.225, 0.46, 0.2685, 0.4798]}, {"w": "you", "b": [0.2748, 0.46, 0.3126, 0.4798]}, {"w": "build", "b": [0.3189, 0.46, 0.3708, 0.4798]}, {"w": "intuition", "b": [0.3771, 0.46, 0.4626, 0.4798]}, {"w": "about", "b": [0.4689, 0.46, 0.525, 0.4798]}, {"w": "loss", "b": [0.5313, 0.46, 0.5705, 0.4798]}, {"w": "surfaces,", "b": [0.5768, 0.46, 0.6658, 0.4798]}, {"w": "you", "b": [0.6721, 0.46, 0.7099, 0.4798]}, {"w": "can", "b": [0.7162, 0.46, 0.7512, 0.4798]}, {"w": "also", "b": [0.7575, 0.46, 0.7982, 0.4798]}, {"w": "visualize", "b": [0.1294, 0.4805, 0.2191, 0.5003]}, {"w": "gradient", "b": [0.2254, 0.4805, 0.3081, 0.5003]}, {"w": "descent", "b": [0.3144, 0.4805, 0.39, 0.5003]}, {"w": "along", "b": [0.3963, 0.4805, 0.4524, 0.5003]}, {"w": "a", "b": [0.4587, 0.4805, 0.4699, 0.5003]}, {"w": "2D", "b": [0.4762, 0.4805, 0.507, 0.5003]}, {"w": "loss", "b": [0.5133, 0.4805, 0.5526, 0.5003]}, {"w": "surface,", "b": [0.5588, 0.4805, 0.638, 0.5003]}, {"w": "as", "b": [0.6443, 0.4805, 0.6653, 0.5003]}, {"w": "shown", "b": [0.6716, 0.4805, 0.7374, 0.5003]}, {"w": "in", "b": [0.7438, 0.4805, 0.7634, 0.5003]}, {"w": "figure", "b": [0.7697, 0.4805, 0.8299, 0.5003]}, {"w": "2.12.", "b": [0.1294, 0.501, 0.1799, 0.5208]}, {"w": "But", "b": [0.1862, 0.501, 0.2226, 0.5208]}, {"w": "you", "b": [0.2289, 0.501, 0.2668, 0.5208]}, {"w": "can’t", "b": [0.2731, 0.501, 0.323, 0.5208]}, {"w": "possibly", "b": [0.3293, 0.501, 0.4134, 0.5208]}, {"w": "visualize", "b": [0.4197, 0.501, 0.5094, 0.5208]}, {"w": "what", "b": [0.5157, 0.501, 0.5648, 0.5208]}, {"w": "the", "b": [0.5711, 0.501, 0.6019, 0.5208]}, {"w": "actual", "b": [0.6082, 0.501, 0.6684, 0.5208]}, {"w": "process", "b": [0.6748, 0.501, 0.7504, 0.5208]}, {"w": "of", "b": [0.7567, 0.501, 0.7777, 0.5208]}, {"w": "training", "b": [0.784, 0.501, 0.8625, 0.5208]}, {"w": "a", "b": [0.1294, 0.5215, 0.1406, 0.5413]}, {"w": "neural", "b": [0.1469, 0.5215, 0.21, 0.5413]}, {"w": "network", "b": [0.2163, 0.5215, 0.2989, 0.5413]}, {"w": "looks", "b": [0.3052, 0.5215, 0.3599, 0.5413]}, {"w": "like—you", "b": [0.3662, 0.5215, 0.4671, 0.5413]}, {"w": "can’t", "b": [0.4734, 0.5215, 0.5233, 0.5413]}, {"w": "represent", "b": [0.5297, 0.5215, 0.6221, 0.5413]}, {"w": "a", "b": [0.6284, 0.5215, 0.6396, 0.5413]}, {"w": "1,000,000-", "b": [0.6459, 0.5215, 0.7552, 0.5413]}, {"w": "dimensional", "b": [0.1294, 0.542, 0.2527, 0.5618]}, {"w": "space", "b": [0.259, 0.542, 0.315, 0.5618]}, {"w": "in", "b": [0.3213, 0.542, 0.341, 0.5618]}, {"w": "a", "b": [0.3473, 0.542, 0.3585, 0.5618]}, {"w": "way", "b": [0.3648, 0.542, 0.4068, 0.5618]}, {"w": "that", "b": [0.4131, 0.542, 0.451, 0.5618]}, {"w": "makes", "b": [0.4573, 0.542, 0.5217, 0.5618]}, {"w": "sense", "b": [0.528, 0.542, 0.5827, 0.5618]}, {"w": "to", "b": [0.589, 0.542, 0.6086, 0.5618]}, {"w": "humans.", "b": [0.6149, 0.542, 0.6997, 0.5618]}, {"w": "As", "b": [0.706, 0.542, 0.734, 0.5618]}, {"w": "such,", "b": [0.7403, 0.542, 0.7929, 0.5618]}, {"w": "it’s", "b": [0.7992, 0.542, 0.83, 0.5618]}, {"w": "good", "b": [0.1294, 0.5625, 0.1799, 0.5823]}, {"w": "to", "b": [0.1862, 0.5625, 0.2058, 0.5823]}, {"w": "keep", "b": [0.2121, 0.5625, 0.2597, 0.5823]}, {"w": "in", "b": [0.266, 0.5625, 0.2857, 0.5823]}, {"w": "mind", "b": [0.292, 0.5625, 0.3438, 0.5823]}, {"w": "that", "b": [0.3501, 0.5625, 0.388, 0.5823]}, {"w": "the", "b": [0.3943, 0.5625, 0.4251, 0.5823]}, {"w": "intuitions", "b": [0.4314, 0.5625, 0.5267, 0.5823]}, {"w": "you", "b": [0.533, 0.5625, 0.5709, 0.5823]}, {"w": "develop", "b": [0.5772, 0.5625, 0.6571, 0.5823]}, {"w": "through", "b": [0.6634, 0.5625, 0.7418, 0.5823]}, {"w": "these", "b": [0.7481, 0.5625, 0.8, 0.5823]}, {"w": "low-", "b": [0.8062, 0.5625, 0.8524, 0.5823]}, {"w": "dimensional", "b": [0.1294, 0.583, 0.2527, 0.6028]}, {"w": "representations", "b": [0.259, 0.583, 0.4118, 0.6028]}, {"w": "may", "b": [0.4181, 0.583, 0.4615, 0.6028]}, {"w": "not", "b": [0.4678, 0.583, 0.5001, 0.6028]}, {"w": "always", "b": [0.5064, 0.583, 0.5764, 0.6028]}, {"w": "be", "b": [0.5827, 0.583, 0.6065, 0.6028]}, {"w": "accurate", "b": [0.6128, 0.583, 0.6969, 0.6028]}, {"w": "in", "b": [0.7032, 0.583, 0.7228, 0.6028]}, {"w": "practice.", "b": [0.7291, 0.583, 0.8153, 0.6028]}, {"w": "This", "b": [0.8216, 0.583, 0.8664, 0.6028]}, {"w": "has", "b": [0.1294, 0.6035, 0.163, 0.6233]}, {"w": "historically", "b": [0.1693, 0.6035, 0.2829, 0.6233]}, {"w": "been", "b": [0.2892, 0.6035, 0.3368, 0.6233]}, {"w": "a", "b": [0.3431, 0.6035, 0.3543, 0.6233]}, {"w": "source", "b": [0.3606, 0.6035, 0.4264, 0.6233]}, {"w": "of", "b": [0.4328, 0.6035, 0.4538, 0.6233]}, {"w": "issues", "b": [0.4601, 0.6035, 0.5203, 0.6233]}, {"w": "in", "b": [0.5266, 0.6035, 0.5463, 0.6233]}, {"w": "the", "b": [0.5526, 0.6035, 0.5834, 0.6233]}, {"w": "world", "b": [0.5896, 0.6035, 0.6485, 0.6233]}, {"w": "of", "b": [0.6548, 0.6035, 0.6758, 0.6233]}, {"w": "deep-learning", "b": [0.6821, 0.6035, 0.8208, 0.6233]}, {"w": "research.", "b": [0.1294, 0.624, 0.2197, 0.6438]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 2.12. Gradient descent down a 2D loss surface (two learnable parameters)", "words": [{"w": "Figure", "b": [0.1294, 0.6619, 0.1827, 0.6767]}, {"w": "2.12.", "b": [0.1874, 0.6619, 0.2252, 0.6767]}, {"w": "Gradient", "b": [0.2299, 0.6619, 0.3035, 0.6767]}, {"w": "descent", "b": [0.3082, 0.6619, 0.3681, 0.6767]}, {"w": "down", "b": [0.3729, 0.6619, 0.417, 0.6767]}, {"w": "a", "b": [0.4218, 0.6619, 0.4312, 0.6767]}, {"w": "2D", "b": [0.436, 0.6619, 0.4591, 0.6767]}, {"w": "loss", "b": [0.4638, 0.6619, 0.4932, 0.6767]}, {"w": "surface", "b": [0.498, 0.6619, 0.5568, 0.6767]}, {"w": "(two", "b": [0.5615, 0.6619, 0.5973, 0.6767]}, {"w": "learnable", "b": [0.602, 0.6619, 0.6777, 0.6767]}, {"w": "parameters)", "b": [0.6824, 0.6619, 0.7812, 0.6767]}]}]}, {"page": 89, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Additionally, there exist multiple variants of SGD that differ by taking into account previous weight updates when computing the next weight update, rather than just looking at the current value of the gradients. There is, for instance, SGD with momentum, as well as Adagrad, RMSProp, and several others. Such variants are known as optimization methods or optimizers. In particular, the concept of momentum, which is used in many of these variants, deserves your attention. Momentum addresses two issues with SGD: convergence speed and local minima. Consider figure 2.13, which shows the curve of a loss as a function of a network parameter.", "words": [{"w": "Additionally,", "b": [0.1294, 0.3468, 0.2616, 0.3666]}, {"w": "there", "b": [0.2679, 0.3468, 0.3183, 0.3666]}, {"w": "exist", "b": [0.3246, 0.3468, 0.3723, 0.3666]}, {"w": "multiple", "b": [0.3786, 0.3468, 0.4627, 0.3666]}, {"w": "variants", "b": [0.469, 0.3468, 0.5489, 0.3666]}, {"w": "of", "b": [0.5552, 0.3468, 0.5762, 0.3666]}, {"w": "SGD", "b": [0.5825, 0.3468, 0.6329, 0.3666]}, {"w": "that", "b": [0.6393, 0.3468, 0.6771, 0.3666]}, {"w": "differ", "b": [0.6834, 0.3468, 0.7389, 0.3666]}, {"w": "by", "b": [0.7452, 0.3468, 0.7704, 0.3666]}, {"w": "taking", "b": [0.7767, 0.3468, 0.8398, 0.3666]}, {"w": "into", "b": [0.1294, 0.3673, 0.1687, 0.3871]}, {"w": "account", "b": [0.175, 0.3673, 0.2534, 0.3871]}, {"w": "previous", "b": [0.2597, 0.3673, 0.3466, 0.3871]}, {"w": "weight", "b": [0.3529, 0.3673, 0.4216, 0.3871]}, {"w": "updates", "b": [0.4279, 0.3673, 0.5049, 0.3871]}, {"w": "when", "b": [0.5113, 0.3673, 0.5659, 0.3871]}, {"w": "computing", "b": [0.5722, 0.3673, 0.6801, 0.3871]}, {"w": "the", "b": [0.6863, 0.3673, 0.7172, 0.3871]}, {"w": "next", "b": [0.7235, 0.3673, 0.7669, 0.3871]}, {"w": "weight", "b": [0.7732, 0.3673, 0.8419, 0.3871]}, {"w": "update,", "b": [0.1294, 0.3878, 0.203, 0.4076]}, {"w": "rather", "b": [0.2093, 0.3878, 0.2681, 0.4076]}, {"w": "than", "b": [0.2744, 0.3878, 0.3178, 0.4076]}, {"w": "just", "b": [0.3242, 0.3878, 0.3606, 0.4076]}, {"w": "looking", "b": [0.3669, 0.3878, 0.444, 0.4076]}, {"w": "at", "b": [0.4503, 0.3878, 0.4685, 0.4076]}, {"w": "the", "b": [0.4748, 0.3878, 0.5057, 0.4076]}, {"w": "current", "b": [0.512, 0.3878, 0.5834, 0.4076]}, {"w": "value", "b": [0.5897, 0.3878, 0.6443, 0.4076]}, {"w": "of", "b": [0.6507, 0.3878, 0.6717, 0.4076]}, {"w": "the", "b": [0.678, 0.3878, 0.7088, 0.4076]}, {"w": "gradients.", "b": [0.7151, 0.3878, 0.8139, 0.4076]}, {"w": "There", "b": [0.1294, 0.4083, 0.1882, 0.4281]}, {"w": "is,", "b": [0.1945, 0.4083, 0.2177, 0.4281]}, {"w": "for", "b": [0.224, 0.4083, 0.2534, 0.4281]}, {"w": "instance,", "b": [0.2597, 0.4083, 0.3487, 0.4281]}, {"w": "SGD", "b": [0.355, 0.4083, 0.4054, 0.4281]}, {"w": "with", "b": [0.4117, 0.4083, 0.4566, 0.4281]}, {"w": "momentum,", "b": [0.4629, 0.4083, 0.5841, 0.4281]}, {"w": "as", "b": [0.5904, 0.4083, 0.6114, 0.4281]}, {"w": "well", "b": [0.6177, 0.4083, 0.6612, 0.4281]}, {"w": "as", "b": [0.6675, 0.4083, 0.6885, 0.4281]}, {"w": "Adagrad,", "b": [0.6948, 0.4083, 0.7879, 0.4281]}, {"w": "RMSProp,", "b": [0.1294, 0.4288, 0.2366, 0.4486]}, {"w": "and", "b": [0.243, 0.4288, 0.2794, 0.4486]}, {"w": "several", "b": [0.2857, 0.4288, 0.3571, 0.4486]}, {"w": "others.", "b": [0.3634, 0.4288, 0.4314, 0.4486]}, {"w": "Such", "b": [0.4377, 0.4288, 0.4881, 0.4486]}, {"w": "variants", "b": [0.4945, 0.4288, 0.5743, 0.4486]}, {"w": "are", "b": [0.5806, 0.4288, 0.6114, 0.4486]}, {"w": "known", "b": [0.6177, 0.4288, 0.6864, 0.4486]}, {"w": "as", "b": [0.6927, 0.4288, 0.7137, 0.4486]}, {"w": "optimization", "b": [0.72, 0.4288, 0.8461, 0.4486]}, {"w": "methods", "b": [0.1294, 0.4493, 0.2135, 0.4691]}, {"w": "or", "b": [0.2198, 0.4493, 0.2408, 0.4691]}, {"w": "optimizers.", "b": [0.2471, 0.4493, 0.3585, 0.4691]}, {"w": "In", "b": [0.3648, 0.4493, 0.3858, 0.4691]}, {"w": "particular,", "b": [0.3921, 0.4493, 0.4941, 0.4691]}, {"w": "the", "b": [0.5004, 0.4493, 0.5312, 0.4691]}, {"w": "concept", "b": [0.5375, 0.4493, 0.616, 0.4691]}, {"w": "of", "b": [0.6223, 0.4493, 0.6433, 0.4691]}, {"w": "momentum,", "b": [0.6496, 0.4493, 0.7665, 0.4691]}, {"w": "which", "b": [0.7728, 0.4493, 0.8345, 0.4691]}, {"w": "is", "b": [0.8408, 0.4493, 0.8576, 0.4691]}, {"w": "used", "b": [0.1294, 0.4698, 0.1757, 0.4896]}, {"w": "in", "b": [0.182, 0.4698, 0.2016, 0.4896]}, {"w": "many", "b": [0.2079, 0.4698, 0.2639, 0.4896]}, {"w": "of", "b": [0.2702, 0.4698, 0.2913, 0.4896]}, {"w": "these", "b": [0.2976, 0.4698, 0.3494, 0.4896]}, {"w": "variants,", "b": [0.3557, 0.4698, 0.4419, 0.4896]}, {"w": "deserves", "b": [0.4482, 0.4698, 0.535, 0.4896]}, {"w": "your", "b": [0.5413, 0.4698, 0.5876, 0.4896]}, {"w": "attention.", "b": [0.5939, 0.4698, 0.6885, 0.4896]}, {"w": "Momentum", "b": [0.6948, 0.4698, 0.8125, 0.4896]}, {"w": "addresses", "b": [0.1294, 0.4903, 0.2261, 0.5101]}, {"w": "two", "b": [0.2324, 0.4903, 0.2702, 0.5101]}, {"w": "issues", "b": [0.2765, 0.4903, 0.3368, 0.5101]}, {"w": "with", "b": [0.3431, 0.4903, 0.388, 0.5101]}, {"w": "SGD:", "b": [0.3943, 0.4903, 0.4517, 0.5101]}, {"w": "convergence", "b": [0.458, 0.4903, 0.585, 0.5101]}, {"w": "speed", "b": [0.5913, 0.4903, 0.6488, 0.5101]}, {"w": "and", "b": [0.6551, 0.4903, 0.6915, 0.5101]}, {"w": "local", "b": [0.6978, 0.4903, 0.7468, 0.5101]}, {"w": "minima.", "b": [0.7532, 0.4903, 0.8365, 0.5101]}, {"w": "Consider", "b": [0.1294, 0.5108, 0.2205, 0.5306]}, {"w": "figure", "b": [0.2268, 0.5108, 0.287, 0.5306]}, {"w": "2.13,", "b": [0.2933, 0.5108, 0.3438, 0.5306]}, {"w": "which", "b": [0.3501, 0.5108, 0.4117, 0.5306]}, {"w": "shows", "b": [0.418, 0.5108, 0.4811, 0.5306]}, {"w": "the", "b": [0.4874, 0.5108, 0.5182, 0.5306]}, {"w": "curve", "b": [0.5245, 0.5108, 0.5806, 0.5306]}, {"w": "of", "b": [0.5869, 0.5108, 0.6079, 0.5306]}, {"w": "a", "b": [0.6142, 0.5108, 0.6254, 0.5306]}, {"w": "loss", "b": [0.6317, 0.5108, 0.6709, 0.5306]}, {"w": "as", "b": [0.6773, 0.5108, 0.6983, 0.5306]}, {"w": "a", "b": [0.7046, 0.5108, 0.7158, 0.5306]}, {"w": "function", "b": [0.7221, 0.5108, 0.8062, 0.5306]}, {"w": "of", "b": [0.8125, 0.5108, 0.8335, 0.5306]}, {"w": "a", "b": [0.8398, 0.5108, 0.851, 0.5306]}, {"w": "network", "b": [0.1294, 0.5313, 0.2121, 0.5511]}, {"w": "parameter.", "b": [0.2184, 0.5313, 0.3241, 0.5511]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 2.13. A local minimum and a global minimum", "words": [{"w": "Figure", "b": [0.1294, 0.5736, 0.1827, 0.5884]}, {"w": "2.13.", "b": [0.1874, 0.5736, 0.2252, 0.5884]}, {"w": "A", "b": [0.2299, 0.5736, 0.2436, 0.5884]}, {"w": "local", "b": [0.2483, 0.5736, 0.2862, 0.5884]}, {"w": "minimum", "b": [0.2909, 0.5736, 0.3697, 0.5884]}, {"w": "and", "b": [0.3745, 0.5736, 0.405, 0.5884]}, {"w": "a", "b": [0.4097, 0.5736, 0.4192, 0.5884]}, {"w": "global", "b": [0.4239, 0.5736, 0.4733, 0.5884]}, {"w": "minimum", "b": [0.478, 0.5736, 0.5569, 0.5884]}]}, {"id": "b_2", "type": "paragraph", "text": "As you can see, around a certain parameter value, there is a local minimum: around that point, moving left would result in the loss increasing, but so would moving right. If the parameter under consideration were being optimized via SGD with a small learning rate,", "words": [{"w": "As", "b": [0.1294, 0.821, 0.1574, 0.8408]}, {"w": "you", "b": [0.1637, 0.821, 0.2016, 0.8408]}, {"w": "can", "b": [0.2079, 0.821, 0.2429, 0.8408]}, {"w": "see,", "b": [0.2492, 0.821, 0.2877, 0.8408]}, {"w": "around", "b": [0.294, 0.821, 0.3641, 0.8408]}, {"w": "a", "b": [0.3704, 0.821, 0.3816, 0.8408]}, {"w": "certain", "b": [0.3879, 0.821, 0.4565, 0.8408]}, {"w": "parameter", "b": [0.4628, 0.821, 0.5637, 0.8408]}, {"w": "value,", "b": [0.57, 0.821, 0.631, 0.8408]}, {"w": "there", "b": [0.6373, 0.821, 0.6877, 0.8408]}, {"w": "is", "b": [0.694, 0.821, 0.7108, 0.8408]}, {"w": "a", "b": [0.7171, 0.821, 0.7283, 0.8408]}, {"w": "local", "b": [0.7345, 0.821, 0.785, 0.8408]}, {"w": "minimum:", "b": [0.1294, 0.8415, 0.2303, 0.8613]}, {"w": "around", "b": [0.2366, 0.8415, 0.3067, 0.8613]}, {"w": "that", "b": [0.313, 0.8415, 0.3508, 0.8613]}, {"w": "point,", "b": [0.3571, 0.8415, 0.4153, 0.8613]}, {"w": "moving", "b": [0.4216, 0.8415, 0.4987, 0.8613]}, {"w": "left", "b": [0.505, 0.8415, 0.5386, 0.8613]}, {"w": "would", "b": [0.5449, 0.8415, 0.608, 0.8613]}, {"w": "result", "b": [0.6143, 0.8415, 0.6704, 0.8613]}, {"w": "in", "b": [0.6767, 0.8415, 0.6963, 0.8613]}, {"w": "the", "b": [0.7026, 0.8415, 0.7334, 0.8613]}, {"w": "loss", "b": [0.7397, 0.8415, 0.779, 0.8613]}, {"w": "increasing,", "b": [0.1294, 0.862, 0.2394, 0.8818]}, {"w": "but", "b": [0.2457, 0.862, 0.2779, 0.8818]}, {"w": "so", "b": [0.2842, 0.862, 0.3067, 0.8818]}, {"w": "would", "b": [0.313, 0.862, 0.376, 0.8818]}, {"w": "moving", "b": [0.3824, 0.862, 0.4594, 0.8818]}, {"w": "right.", "b": [0.4657, 0.862, 0.5197, 0.8818]}, {"w": "If", "b": [0.526, 0.862, 0.5428, 0.8818]}, {"w": "the", "b": [0.5491, 0.862, 0.5799, 0.8818]}, {"w": "parameter", "b": [0.5863, 0.862, 0.6871, 0.8818]}, {"w": "under", "b": [0.6934, 0.862, 0.7508, 0.8818]}, {"w": "consideration", "b": [0.1294, 0.8825, 0.2653, 0.9023]}, {"w": "were", "b": [0.2716, 0.8825, 0.3206, 0.9023]}, {"w": "being", "b": [0.3269, 0.8825, 0.383, 0.9023]}, {"w": "optimized", "b": [0.3893, 0.8825, 0.4902, 0.9023]}, {"w": "via", "b": [0.4965, 0.8825, 0.5273, 0.9023]}, {"w": "SGD", "b": [0.5336, 0.8825, 0.5841, 0.9023]}, {"w": "with", "b": [0.5904, 0.8825, 0.6352, 0.9023]}, {"w": "a", "b": [0.6415, 0.8825, 0.6527, 0.9023]}, {"w": "small", "b": [0.659, 0.8825, 0.7137, 0.9023]}, {"w": "learning", "b": [0.72, 0.8825, 0.8027, 0.9023]}, {"w": "rate,", "b": [0.809, 0.8825, 0.8531, 0.9023]}]}]}, {"page": 90, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "then the optimization process would get stuck at the local minimum instead of making its way to the global minimum.", "words": [{"w": "then", "b": [0.1294, 0.0857, 0.1729, 0.1054]}, {"w": "the", "b": [0.1792, 0.0857, 0.21, 0.1054]}, {"w": "optimization", "b": [0.2163, 0.0857, 0.3438, 0.1054]}, {"w": "process", "b": [0.3501, 0.0857, 0.4258, 0.1054]}, {"w": "would", "b": [0.4321, 0.0857, 0.4952, 0.1054]}, {"w": "get", "b": [0.5015, 0.0857, 0.5323, 0.1054]}, {"w": "stuck", "b": [0.5386, 0.0857, 0.5919, 0.1054]}, {"w": "at", "b": [0.5982, 0.0857, 0.6164, 0.1054]}, {"w": "the", "b": [0.6227, 0.0857, 0.6535, 0.1054]}, {"w": "local", "b": [0.6598, 0.0857, 0.7088, 0.1054]}, {"w": "minimum", "b": [0.7152, 0.0857, 0.8133, 0.1054]}, {"w": "instead", "b": [0.1294, 0.1062, 0.2009, 0.1259]}, {"w": "of", "b": [0.2072, 0.1062, 0.2282, 0.1259]}, {"w": "making", "b": [0.2345, 0.1062, 0.3102, 0.1259]}, {"w": "its", "b": [0.3165, 0.1062, 0.3403, 0.1259]}, {"w": "way", "b": [0.3466, 0.1062, 0.3887, 0.1259]}, {"w": "to", "b": [0.395, 0.1062, 0.4146, 0.1259]}, {"w": "the", "b": [0.4209, 0.1062, 0.4517, 0.1259]}, {"w": "global", "b": [0.458, 0.1062, 0.5211, 0.1259]}, {"w": "minimum.", "b": [0.5274, 0.1062, 0.6318, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "You can avoid such issues by using momentum, which draws inspiration from physics. A useful mental image here is to think of the optimization process as a small ball rolling down the loss curve. If it has enough momentum, the ball won’t get stuck in a ravine and will end up at the global minimum. Momentum is implemented by moving the ball at each step based not only on the current slope value (current acceleration) but also on the current velocity (resulting from past acceleration). In practice, this means updating the parameter w based not only on the current gradient value but also on the previous parameter update, such as in this naive implementation:", "words": [{"w": "You", "b": [0.1294, 0.149, 0.1703, 0.1687]}, {"w": "can", "b": [0.1766, 0.149, 0.2116, 0.1687]}, {"w": "avoid", "b": [0.218, 0.149, 0.274, 0.1687]}, {"w": "such", "b": [0.2803, 0.149, 0.3266, 0.1687]}, {"w": "issues", "b": [0.3329, 0.149, 0.3931, 0.1687]}, {"w": "by", "b": [0.3994, 0.149, 0.4247, 0.1687]}, {"w": "using", "b": [0.431, 0.149, 0.4856, 0.1687]}, {"w": "momentum,", "b": [0.4919, 0.149, 0.6132, 0.1687]}, {"w": "which", "b": [0.6195, 0.149, 0.6811, 0.1687]}, {"w": "draws", "b": [0.6874, 0.149, 0.7477, 0.1687]}, {"w": "inspiration", "b": [0.754, 0.149, 0.8619, 0.1687]}, {"w": "from", "b": [0.1294, 0.1695, 0.1785, 0.1892]}, {"w": "physics.", "b": [0.1848, 0.1695, 0.2667, 0.1892]}, {"w": "A", "b": [0.273, 0.1695, 0.2913, 0.1892]}, {"w": "useful", "b": [0.2976, 0.1695, 0.3592, 0.1892]}, {"w": "mental", "b": [0.3655, 0.1695, 0.4342, 0.1892]}, {"w": "image", "b": [0.4405, 0.1695, 0.5021, 0.1892]}, {"w": "here", "b": [0.5085, 0.1695, 0.5519, 0.1892]}, {"w": "is", "b": [0.5582, 0.1695, 0.575, 0.1892]}, {"w": "to", "b": [0.5813, 0.1695, 0.6009, 0.1892]}, {"w": "think", "b": [0.6072, 0.1695, 0.6591, 0.1892]}, {"w": "of", "b": [0.6653, 0.1695, 0.6864, 0.1892]}, {"w": "the", "b": [0.6927, 0.1695, 0.7235, 0.1892]}, {"w": "optimization", "b": [0.7298, 0.1695, 0.8573, 0.1892]}, {"w": "process", "b": [0.1294, 0.19, 0.2051, 0.2097]}, {"w": "as", "b": [0.2114, 0.19, 0.2324, 0.2097]}, {"w": "a", "b": [0.2387, 0.19, 0.2499, 0.2097]}, {"w": "small", "b": [0.2562, 0.19, 0.3109, 0.2097]}, {"w": "ball", "b": [0.3172, 0.19, 0.355, 0.2097]}, {"w": "rolling", "b": [0.3613, 0.19, 0.4286, 0.2097]}, {"w": "down", "b": [0.4349, 0.19, 0.4909, 0.2097]}, {"w": "the", "b": [0.4973, 0.19, 0.5281, 0.2097]}, {"w": "loss", "b": [0.5344, 0.19, 0.5736, 0.2097]}, {"w": "curve.", "b": [0.5799, 0.19, 0.6423, 0.2097]}, {"w": "If", "b": [0.6486, 0.19, 0.6654, 0.2097]}, {"w": "it", "b": [0.6717, 0.19, 0.6857, 0.2097]}, {"w": "has", "b": [0.692, 0.19, 0.7256, 0.2097]}, {"w": "enough", "b": [0.732, 0.19, 0.8062, 0.2097]}, {"w": "momentum,", "b": [0.1294, 0.2105, 0.2506, 0.2302]}, {"w": "the", "b": [0.257, 0.2105, 0.2878, 0.2302]}, {"w": "ball", "b": [0.2941, 0.2105, 0.3319, 0.2302]}, {"w": "won’t", "b": [0.3382, 0.2105, 0.3966, 0.2302]}, {"w": "get", "b": [0.4029, 0.2105, 0.4337, 0.2302]}, {"w": "stuck", "b": [0.44, 0.2105, 0.4933, 0.2302]}, {"w": "in", "b": [0.4996, 0.2105, 0.5192, 0.2302]}, {"w": "a", "b": [0.5255, 0.2105, 0.5367, 0.2302]}, {"w": "ravine", "b": [0.543, 0.2105, 0.606, 0.2302]}, {"w": "and", "b": [0.6123, 0.2105, 0.6488, 0.2302]}, {"w": "will", "b": [0.6551, 0.2105, 0.6943, 0.2302]}, {"w": "end", "b": [0.7006, 0.2105, 0.7371, 0.2302]}, {"w": "up", "b": [0.7434, 0.2105, 0.7686, 0.2302]}, {"w": "at", "b": [0.7749, 0.2105, 0.7931, 0.2302]}, {"w": "the", "b": [0.7994, 0.2105, 0.8302, 0.2302]}, {"w": "global", "b": [0.1294, 0.231, 0.1925, 0.2507]}, {"w": "minimum.", "b": [0.1988, 0.231, 0.3032, 0.2507]}, {"w": "Momentum", "b": [0.3095, 0.231, 0.4273, 0.2507]}, {"w": "is", "b": [0.4336, 0.231, 0.4504, 0.2507]}, {"w": "implemented", "b": [0.4567, 0.231, 0.5884, 0.2507]}, {"w": "by", "b": [0.5947, 0.231, 0.62, 0.2507]}, {"w": "moving", "b": [0.6263, 0.231, 0.7033, 0.2507]}, {"w": "the", "b": [0.7097, 0.231, 0.7405, 0.2507]}, {"w": "ball", "b": [0.7468, 0.231, 0.7846, 0.2507]}, {"w": "at", "b": [0.7909, 0.231, 0.8091, 0.2507]}, {"w": "each", "b": [0.8155, 0.231, 0.8617, 0.2507]}, {"w": "step", "b": [0.1294, 0.2515, 0.1701, 0.2712]}, {"w": "based", "b": [0.1764, 0.2515, 0.2338, 0.2712]}, {"w": "not", "b": [0.2401, 0.2515, 0.2723, 0.2712]}, {"w": "only", "b": [0.2786, 0.2515, 0.3235, 0.2712]}, {"w": "on", "b": [0.3298, 0.2515, 0.355, 0.2712]}, {"w": "the", "b": [0.3613, 0.2515, 0.3921, 0.2712]}, {"w": "current", "b": [0.3984, 0.2515, 0.4699, 0.2712]}, {"w": "slope", "b": [0.4762, 0.2515, 0.5294, 0.2712]}, {"w": "value", "b": [0.5357, 0.2515, 0.5904, 0.2712]}, {"w": "(current", "b": [0.5967, 0.2515, 0.6765, 0.2712]}, {"w": "acceleration)", "b": [0.6828, 0.2515, 0.8131, 0.2712]}, {"w": "but", "b": [0.8194, 0.2515, 0.8517, 0.2712]}, {"w": "also", "b": [0.1294, 0.272, 0.1701, 0.2917]}, {"w": "on", "b": [0.1764, 0.272, 0.2016, 0.2917]}, {"w": "the", "b": [0.2079, 0.272, 0.2387, 0.2917]}, {"w": "current", "b": [0.245, 0.272, 0.3165, 0.2917]}, {"w": "velocity", "b": [0.3228, 0.272, 0.404, 0.2917]}, {"w": "(resulting", "b": [0.4104, 0.272, 0.507, 0.2917]}, {"w": "from", "b": [0.5133, 0.272, 0.5624, 0.2917]}, {"w": "past", "b": [0.5687, 0.272, 0.6093, 0.2917]}, {"w": "acceleration).", "b": [0.6156, 0.272, 0.7522, 0.2917]}, {"w": "In", "b": [0.7585, 0.272, 0.7795, 0.2917]}, {"w": "practice,", "b": [0.1294, 0.2925, 0.2156, 0.3122]}, {"w": "this", "b": [0.2219, 0.2925, 0.2583, 0.3122]}, {"w": "means", "b": [0.2646, 0.2925, 0.3291, 0.3122]}, {"w": "updating", "b": [0.3354, 0.2925, 0.4237, 0.3122]}, {"w": "the", "b": [0.43, 0.2925, 0.4608, 0.3122]}, {"w": "parameter", "b": [0.4671, 0.2925, 0.568, 0.3122]}, {"w": "w", "b": [0.5742, 0.2935, 0.5893, 0.3137]}, {"w": "based", "b": [0.5956, 0.2925, 0.6531, 0.3122]}, {"w": "not", "b": [0.6594, 0.2925, 0.6916, 0.3122]}, {"w": "only", "b": [0.6979, 0.2925, 0.7428, 0.3122]}, {"w": "on", "b": [0.7491, 0.2925, 0.7743, 0.3122]}, {"w": "the", "b": [0.7806, 0.2925, 0.8114, 0.3122]}, {"w": "current", "b": [0.1294, 0.3139, 0.2009, 0.3336]}, {"w": "gradient", "b": [0.2072, 0.3139, 0.2898, 0.3336]}, {"w": "value", "b": [0.2961, 0.3139, 0.3508, 0.3336]}, {"w": "but", "b": [0.3571, 0.3139, 0.3893, 0.3336]}, {"w": "also", "b": [0.3956, 0.3139, 0.4363, 0.3336]}, {"w": "on", "b": [0.4426, 0.3139, 0.4678, 0.3336]}, {"w": "the", "b": [0.4741, 0.3139, 0.5049, 0.3336]}, {"w": "previous", "b": [0.5112, 0.3139, 0.5981, 0.3336]}, {"w": "parameter", "b": [0.6044, 0.3139, 0.7053, 0.3336]}, {"w": "update,", "b": [0.7116, 0.3139, 0.7851, 0.3336]}, {"w": "such", "b": [0.7914, 0.3139, 0.8377, 0.3336]}, {"w": "as", "b": [0.844, 0.3139, 0.865, 0.3336]}, {"w": "in", "b": [0.1294, 0.3344, 0.149, 0.3541]}, {"w": "this", "b": [0.1553, 0.3344, 0.1918, 0.3541]}, {"w": "naive", "b": [0.1981, 0.3344, 0.2527, 0.3541]}, {"w": "implementation:", "b": [0.259, 0.3344, 0.4244, 0.3541]}]}, {"id": "b_2", "type": "paragraph", "text": "past_velocity = 0. momentum = 0.1 1 while loss > 0.01: 2 w, loss, gradient = get_current_parameters() velocity = past_velocity * momentum + learning_rate * gradient w = w + momentum * velocity - learning_rate * gradient past_velocity = velocity update_parameter(w)", "words": [{"w": "past_velocity", "b": [0.1357, 0.3721, 0.2833, 0.3872]}, {"w": "=", "b": [0.2946, 0.3721, 0.306, 0.3872]}, {"w": "0.", "b": [0.3173, 0.3721, 0.34, 0.3872]}, {"w": "momentum", "b": [0.1357, 0.3872, 0.2265, 0.4024]}, {"w": "=", "b": [0.2379, 0.3872, 0.2492, 0.4024]}, {"w": "0.1", "b": [0.2606, 0.3872, 0.2946, 0.4024]}, {"w": "1", "b": [0.1357, 0.4024, 0.1471, 0.4175]}, {"w": "while", "b": [0.1357, 0.4175, 0.1925, 0.4327]}, {"w": "loss", "b": [0.2038, 0.4175, 0.2492, 0.4327]}, {"w": ">", "b": [0.2606, 0.4175, 0.2719, 0.4327]}, {"w": "0.01:", "b": [0.2833, 0.4175, 0.34, 0.4327]}, {"w": "2", "b": [0.1357, 0.4327, 0.1471, 0.4478]}, {"w": "w,", "b": [0.1811, 0.4478, 0.2038, 0.463]}, {"w": "loss,", "b": [0.2152, 0.4478, 0.2719, 0.463]}, {"w": "gradient", "b": [0.2833, 0.4478, 0.3741, 0.463]}, {"w": "=", "b": [0.3855, 0.4478, 0.3968, 0.463]}, {"w": "get_current_parameters()", "b": [0.4082, 0.4478, 0.6806, 0.463]}, {"w": "velocity", "b": [0.1811, 0.463, 0.2719, 0.4781]}, {"w": "=", "b": [0.2833, 0.463, 0.2946, 0.4781]}, {"w": "past_velocity", "b": [0.306, 0.463, 0.4536, 0.4781]}, {"w": "*", "b": [0.4649, 0.463, 0.4763, 0.4781]}, {"w": "momentum", "b": [0.4876, 0.463, 0.5784, 0.4781]}, {"w": "+", "b": [0.5898, 0.463, 0.6011, 0.4781]}, {"w": "learning_rate", "b": [0.6125, 0.463, 0.7601, 0.4781]}, {"w": "*", "b": [0.7714, 0.463, 0.7828, 0.4781]}, {"w": "gradient", "b": [0.1357, 0.4782, 0.2265, 0.4933]}, {"w": "w", "b": [0.1811, 0.4933, 0.1925, 0.5085]}, {"w": "=", "b": [0.2038, 0.4933, 0.2152, 0.5085]}, {"w": "w", "b": [0.2265, 0.4933, 0.2379, 0.5085]}, {"w": "+", "b": [0.2492, 0.4933, 0.2606, 0.5085]}, {"w": "momentum", "b": [0.2719, 0.4933, 0.3628, 0.5085]}, {"w": "*", "b": [0.3741, 0.4933, 0.3855, 0.5085]}, {"w": "velocity", "b": [0.3968, 0.4933, 0.4876, 0.5085]}, {"w": "-", "b": [0.499, 0.4933, 0.5103, 0.5085]}, {"w": "learning_rate", "b": [0.5217, 0.4933, 0.6692, 0.5085]}, {"w": "*", "b": [0.6806, 0.4933, 0.6919, 0.5085]}, {"w": "gradient", "b": [0.7033, 0.4933, 0.7941, 0.5085]}, {"w": "past_velocity", "b": [0.1811, 0.5085, 0.3287, 0.5236]}, {"w": "=", "b": [0.34, 0.5085, 0.3514, 0.5236]}, {"w": "velocity", "b": [0.3628, 0.5085, 0.4536, 0.5236]}, {"w": "update_parameter(w)", "b": [0.1811, 0.5236, 0.3968, 0.5388]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Constant momentum factor 2 Optimization loop", "words": [{"w": "1", "b": [0.1799, 0.5572, 0.1925, 0.5769]}, {"w": "Constant", "b": [0.1988, 0.5572, 0.2969, 0.5769]}, {"w": "momentum", "b": [0.3032, 0.5572, 0.4265, 0.5769]}, {"w": "factor", "b": [0.4328, 0.5572, 0.4972, 0.5769]}, {"w": "2", "b": [0.1799, 0.5777, 0.1925, 0.5974]}, {"w": "Optimization", "b": [0.1988, 0.5777, 0.3417, 0.5974]}, {"w": "loop", "b": [0.348, 0.5777, 0.3943, 0.5974]}]}, {"id": "b_4", "type": "paragraph", "text": "2.4.4. Chaining derivatives: the Backpropagation algorithm", "words": [{"w": "2.4.4.", "b": [0.1294, 0.6249, 0.1862, 0.6447]}, {"w": "Chaining", "b": [0.1925, 0.6249, 0.292, 0.6447]}, {"w": "derivatives:", "b": [0.2983, 0.6249, 0.4244, 0.6447]}, {"w": "the", "b": [0.4307, 0.6249, 0.4644, 0.6447]}, {"w": "Backpropagation", "b": [0.4707, 0.6249, 0.6566, 0.6447]}, {"w": "algorithm", "b": [0.6629, 0.6249, 0.7694, 0.6447]}]}, {"id": "b_5", "type": "paragraph", "text": "In the previous algorithm, we casually assumed that because a function is differentiable, we can explicitly compute its derivative. In practice, a neural network function consists of many tensor operations chained together, each of which has a simple, known derivative. For instance, this is a network f composed of three tensor operations, a, b, and c, with weight matrices W1, W2, and W3:", "words": [{"w": "In", "b": [0.1294, 0.6677, 0.1504, 0.6874]}, {"w": "the", "b": [0.1567, 0.6677, 0.1876, 0.6874]}, {"w": "previous", "b": [0.1939, 0.6677, 0.2807, 0.6874]}, {"w": "algorithm,", "b": [0.287, 0.6677, 0.3915, 0.6874]}, {"w": "we", "b": [0.3978, 0.6677, 0.4272, 0.6874]}, {"w": "casually", "b": [0.4335, 0.6677, 0.5161, 0.6874]}, {"w": "assumed", "b": [0.5225, 0.6677, 0.6093, 0.6874]}, {"w": "that", "b": [0.6156, 0.6677, 0.6535, 0.6874]}, {"w": "because", "b": [0.6598, 0.6677, 0.7396, 0.6874]}, {"w": "a", "b": [0.7459, 0.6677, 0.7571, 0.6874]}, {"w": "function", "b": [0.7634, 0.6677, 0.8475, 0.6874]}, {"w": "is", "b": [0.8538, 0.6677, 0.8706, 0.6874]}, {"w": "differentiable,", "b": [0.1294, 0.6882, 0.2711, 0.7079]}, {"w": "we", "b": [0.2775, 0.6882, 0.3069, 0.7079]}, {"w": "can", "b": [0.3132, 0.6882, 0.3482, 0.7079]}, {"w": "explicitly", "b": [0.3545, 0.6882, 0.4498, 0.7079]}, {"w": "compute", "b": [0.4561, 0.6882, 0.543, 0.7079]}, {"w": "its", "b": [0.5493, 0.6882, 0.5731, 0.7079]}, {"w": "derivative.", "b": [0.5794, 0.6882, 0.6866, 0.7079]}, {"w": "In", "b": [0.6928, 0.6882, 0.7138, 0.7079]}, {"w": "practice,", "b": [0.7201, 0.6882, 0.8063, 0.7079]}, {"w": "a", "b": [0.8126, 0.6882, 0.8238, 0.7079]}, {"w": "neural", "b": [0.1294, 0.7087, 0.1925, 0.7284]}, {"w": "network", "b": [0.1988, 0.7087, 0.2814, 0.7284]}, {"w": "function", "b": [0.2877, 0.7087, 0.3718, 0.7284]}, {"w": "consists", "b": [0.3781, 0.7087, 0.458, 0.7284]}, {"w": "of", "b": [0.4643, 0.7087, 0.4853, 0.7284]}, {"w": "many", "b": [0.4916, 0.7087, 0.5477, 0.7284]}, {"w": "tensor", "b": [0.554, 0.7087, 0.6156, 0.7284]}, {"w": "operations", "b": [0.6219, 0.7087, 0.727, 0.7284]}, {"w": "chained", "b": [0.7333, 0.7087, 0.8118, 0.7284]}, {"w": "together,", "b": [0.1294, 0.7292, 0.2174, 0.7489]}, {"w": "each", "b": [0.2237, 0.7292, 0.2699, 0.7489]}, {"w": "of", "b": [0.2762, 0.7292, 0.2972, 0.7489]}, {"w": "which", "b": [0.3035, 0.7292, 0.3652, 0.7489]}, {"w": "has", "b": [0.3715, 0.7292, 0.4051, 0.7489]}, {"w": "a", "b": [0.4114, 0.7292, 0.4226, 0.7489]}, {"w": "simple,", "b": [0.4289, 0.7292, 0.5025, 0.7489]}, {"w": "known", "b": [0.5088, 0.7292, 0.5775, 0.7489]}, {"w": "derivative.", "b": [0.5837, 0.7292, 0.6909, 0.7489]}, {"w": "For", "b": [0.6972, 0.7292, 0.7323, 0.7489]}, {"w": "instance,", "b": [0.7386, 0.7292, 0.8275, 0.7489]}, {"w": "this", "b": [0.8338, 0.7292, 0.8703, 0.7489]}, {"w": "is", "b": [0.1294, 0.7497, 0.1462, 0.7694]}, {"w": "a", "b": [0.1525, 0.7497, 0.1637, 0.7694]}, {"w": "network", "b": [0.1701, 0.7497, 0.2527, 0.7694]}, {"w": "f", "b": [0.259, 0.7508, 0.2741, 0.7709]}, {"w": "composed", "b": [0.2805, 0.7497, 0.3827, 0.7694]}, {"w": "of", "b": [0.389, 0.7497, 0.4101, 0.7694]}, {"w": "three", "b": [0.4164, 0.7497, 0.4668, 0.7694]}, {"w": "tensor", "b": [0.4731, 0.7497, 0.5348, 0.7694]}, {"w": "operations,", "b": [0.5411, 0.7497, 0.6525, 0.7694]}, {"w": "a,", "b": [0.6587, 0.7497, 0.6802, 0.7709]}, {"w": "b,", "b": [0.6865, 0.7497, 0.7079, 0.7709]}, {"w": "and", "b": [0.7142, 0.7497, 0.7506, 0.7694]}, {"w": "c,", "b": [0.7569, 0.7497, 0.7784, 0.7709]}, {"w": "with", "b": [0.7847, 0.7497, 0.8295, 0.7694]}, {"w": "weight", "b": [0.1294, 0.7711, 0.1981, 0.7908]}, {"w": "matrices", "b": [0.2044, 0.7711, 0.2898, 0.7908]}, {"w": "W1,", "b": [0.2961, 0.7711, 0.3327, 0.7923]}, {"w": "W2,", "b": [0.339, 0.7711, 0.3756, 0.7923]}, {"w": "and", "b": [0.3819, 0.7711, 0.4183, 0.7908]}, {"w": "W3:", "b": [0.4246, 0.7711, 0.4619, 0.7923]}]}, {"id": "b_6", "type": "equation", "text": "f(W1, W2, W3) = a(W1, b(W2, c(W3)))", "words": [{"w": "f(W1,", "b": [0.1357, 0.8097, 0.1925, 0.8249]}, {"w": "W2,", "b": [0.2038, 0.8097, 0.2379, 0.8249]}, {"w": "W3)", "b": [0.2492, 0.8097, 0.2833, 0.8249]}, {"w": "=", "b": [0.2946, 0.8097, 0.306, 0.8249]}, {"w": "a(W1,", "b": [0.3173, 0.8097, 0.3741, 0.8249]}, {"w": "b(W2,", "b": [0.3855, 0.8097, 0.4422, 0.8249]}, {"w": "c(W3)))", "b": [0.4536, 0.8097, 0.533, 0.8249]}]}, {"id": "b_7", "type": "paragraph", "text": "Calculus tells us that such a chain of functions can be derived using the following identity, called the chain rule: f(g(x)) = f'(g(x)) * g'(x). Applying the chain rule to the computation of the gradient", "words": [{"w": "Calculus", "b": [0.1294, 0.8477, 0.2177, 0.8675]}, {"w": "tells", "b": [0.224, 0.8477, 0.2661, 0.8675]}, {"w": "us", "b": [0.2724, 0.8477, 0.2948, 0.8675]}, {"w": "that", "b": [0.3011, 0.8477, 0.3389, 0.8675]}, {"w": "such", "b": [0.3452, 0.8477, 0.3915, 0.8675]}, {"w": "a", "b": [0.3978, 0.8477, 0.409, 0.8675]}, {"w": "chain", "b": [0.4153, 0.8477, 0.4699, 0.8675]}, {"w": "of", "b": [0.4762, 0.8477, 0.4973, 0.8675]}, {"w": "functions", "b": [0.5036, 0.8477, 0.5975, 0.8675]}, {"w": "can", "b": [0.6038, 0.8477, 0.6388, 0.8675]}, {"w": "be", "b": [0.6451, 0.8477, 0.6689, 0.8675]}, {"w": "derived", "b": [0.6752, 0.8477, 0.7508, 0.8675]}, {"w": "using", "b": [0.7572, 0.8477, 0.8118, 0.8675]}, {"w": "the", "b": [0.8181, 0.8477, 0.849, 0.8675]}, {"w": "following", "b": [0.1294, 0.8682, 0.2275, 0.888]}, {"w": "identity,", "b": [0.2338, 0.8682, 0.3156, 0.888]}, {"w": "called", "b": [0.3219, 0.8682, 0.3821, 0.888]}, {"w": "the", "b": [0.3884, 0.8682, 0.4192, 0.888]}, {"w": "chain", "b": [0.4255, 0.8682, 0.4816, 0.888]}, {"w": "rule:", "b": [0.4879, 0.8682, 0.5355, 0.888]}, {"w": "f(g(x))", "b": [0.5418, 0.8693, 0.6477, 0.8895]}, {"w": "=", "b": [0.6629, 0.8693, 0.678, 0.8895]}, {"w": "f'(g(x))", "b": [0.6931, 0.8693, 0.8142, 0.8895]}, {"w": "*", "b": [0.8293, 0.8693, 0.8445, 0.8895]}, {"w": "g'(x).", "b": [0.1294, 0.8896, 0.2114, 0.9109]}, {"w": "Applying", "b": [0.2177, 0.8896, 0.313, 0.9094]}, {"w": "the", "b": [0.3193, 0.8896, 0.3501, 0.9094]}, {"w": "chain", "b": [0.3564, 0.8896, 0.4111, 0.9094]}, {"w": "rule", "b": [0.4174, 0.8896, 0.4566, 0.9094]}, {"w": "to", "b": [0.4629, 0.8896, 0.4825, 0.9094]}, {"w": "the", "b": [0.4889, 0.8896, 0.5197, 0.9094]}, {"w": "computation", "b": [0.526, 0.8896, 0.6521, 0.9094]}, {"w": "of", "b": [0.6584, 0.8896, 0.6794, 0.9094]}, {"w": "the", "b": [0.6857, 0.8896, 0.7166, 0.9094]}, {"w": "gradient", "b": [0.7229, 0.8896, 0.8055, 0.9094]}]}]}, {"page": 91, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "values of a neural network gives rise to an algorithm called Backpropagation (also sometimes called reverse-mode differentiation). Backpropagation starts with the final loss value and works backward from the top layers to the bottom layers, applying the chain rule to compute the contribution that each parameter had in the loss value.", "words": [{"w": "values", "b": [0.1294, 0.0857, 0.1939, 0.1054]}, {"w": "of", "b": [0.2002, 0.0857, 0.2212, 0.1054]}, {"w": "a", "b": [0.2275, 0.0857, 0.2387, 0.1054]}, {"w": "neural", "b": [0.245, 0.0857, 0.308, 0.1054]}, {"w": "network", "b": [0.3143, 0.0857, 0.397, 0.1054]}, {"w": "gives", "b": [0.4033, 0.0857, 0.4566, 0.1054]}, {"w": "rise", "b": [0.4629, 0.0857, 0.4993, 0.1054]}, {"w": "to", "b": [0.5056, 0.0857, 0.5252, 0.1054]}, {"w": "an", "b": [0.5315, 0.0857, 0.5553, 0.1054]}, {"w": "algorithm", "b": [0.5617, 0.0857, 0.6598, 0.1054]}, {"w": "called", "b": [0.6661, 0.0857, 0.7263, 0.1054]}, {"w": "Backpropagation", "b": [0.1294, 0.1062, 0.3036, 0.1259]}, {"w": "(also", "b": [0.3099, 0.1062, 0.359, 0.1259]}, {"w": "sometimes", "b": [0.3653, 0.1062, 0.4732, 0.1259]}, {"w": "called", "b": [0.4795, 0.1062, 0.5397, 0.1259]}, {"w": "reverse-mode", "b": [0.546, 0.1062, 0.6823, 0.1259]}, {"w": "differentiation).", "b": [0.6886, 0.1062, 0.8467, 0.1259]}, {"w": "Backpropagation", "b": [0.1294, 0.1267, 0.3018, 0.1464]}, {"w": "starts", "b": [0.3081, 0.1267, 0.3613, 0.1464]}, {"w": "with", "b": [0.3676, 0.1267, 0.4125, 0.1464]}, {"w": "the", "b": [0.4188, 0.1267, 0.4496, 0.1464]}, {"w": "final", "b": [0.4559, 0.1267, 0.5021, 0.1464]}, {"w": "loss", "b": [0.5085, 0.1267, 0.5477, 0.1464]}, {"w": "value", "b": [0.554, 0.1267, 0.6087, 0.1464]}, {"w": "and", "b": [0.615, 0.1267, 0.6514, 0.1464]}, {"w": "works", "b": [0.6577, 0.1267, 0.7193, 0.1464]}, {"w": "backward", "b": [0.7256, 0.1267, 0.8237, 0.1464]}, {"w": "from", "b": [0.1294, 0.1472, 0.1785, 0.1669]}, {"w": "the", "b": [0.1848, 0.1472, 0.2156, 0.1669]}, {"w": "top", "b": [0.2219, 0.1472, 0.2541, 0.1669]}, {"w": "layers", "b": [0.2604, 0.1472, 0.3207, 0.1669]}, {"w": "to", "b": [0.327, 0.1472, 0.3466, 0.1669]}, {"w": "the", "b": [0.3529, 0.1472, 0.3837, 0.1669]}, {"w": "bottom", "b": [0.39, 0.1472, 0.4615, 0.1669]}, {"w": "layers,", "b": [0.4678, 0.1472, 0.5344, 0.1669]}, {"w": "applying", "b": [0.5407, 0.1472, 0.629, 0.1669]}, {"w": "the", "b": [0.6352, 0.1472, 0.666, 0.1669]}, {"w": "chain", "b": [0.6723, 0.1472, 0.727, 0.1669]}, {"w": "rule", "b": [0.7333, 0.1472, 0.7725, 0.1669]}, {"w": "to", "b": [0.7788, 0.1472, 0.7984, 0.1669]}, {"w": "compute", "b": [0.1294, 0.1677, 0.2163, 0.1874]}, {"w": "the", "b": [0.2226, 0.1677, 0.2534, 0.1874]}, {"w": "contribution", "b": [0.2597, 0.1677, 0.3831, 0.1874]}, {"w": "that", "b": [0.3894, 0.1677, 0.4272, 0.1874]}, {"w": "each", "b": [0.4335, 0.1677, 0.4797, 0.1874]}, {"w": "parameter", "b": [0.486, 0.1677, 0.5869, 0.1874]}, {"w": "had", "b": [0.5932, 0.1677, 0.6296, 0.1874]}, {"w": "in", "b": [0.6359, 0.1677, 0.6555, 0.1874]}, {"w": "the", "b": [0.6619, 0.1677, 0.6927, 0.1874]}, {"w": "loss", "b": [0.699, 0.1677, 0.7382, 0.1874]}, {"w": "value.", "b": [0.7445, 0.1677, 0.8055, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Nowadays, and for years to come, people will implement networks in modern frameworks that are capable of symbolic differentiation, such as TensorFlow. This means that, given a chain of operations with a known derivative, they can compute a gradient function for the chain (by applying the chain rule) that maps network parameter values to gradient values. When you have access to such a function, the backward pass is reduced to a call to this gradient function. Thanks to symbolic differentiation, you’ll never have to implement the Backpropagation algorithm by hand. For this reason, we won’t waste your time and your focus on deriving the exact formulation of the Backpropagation algorithm in these pages. All you need is a good understanding of how gradient-based optimization works.", "words": [{"w": "Nowadays,", "b": [0.1294, 0.2105, 0.2422, 0.2302]}, {"w": "and", "b": [0.2485, 0.2105, 0.2849, 0.2302]}, {"w": "for", "b": [0.2912, 0.2105, 0.3206, 0.2302]}, {"w": "years", "b": [0.327, 0.2105, 0.3802, 0.2302]}, {"w": "to", "b": [0.3865, 0.2105, 0.4061, 0.2302]}, {"w": "come,", "b": [0.4124, 0.2105, 0.4734, 0.2302]}, {"w": "people", "b": [0.4797, 0.2105, 0.5469, 0.2302]}, {"w": "will", "b": [0.5532, 0.2105, 0.5925, 0.2302]}, {"w": "implement", "b": [0.5988, 0.2105, 0.7067, 0.2302]}, {"w": "networks", "b": [0.713, 0.2105, 0.8055, 0.2302]}, {"w": "in", "b": [0.8118, 0.2105, 0.8314, 0.2302]}, {"w": "modern", "b": [0.1294, 0.231, 0.2065, 0.2507]}, {"w": "frameworks", "b": [0.2128, 0.231, 0.3333, 0.2507]}, {"w": "that", "b": [0.3396, 0.231, 0.3774, 0.2507]}, {"w": "are", "b": [0.3837, 0.231, 0.4145, 0.2507]}, {"w": "capable", "b": [0.4208, 0.231, 0.4979, 0.2507]}, {"w": "of", "b": [0.5042, 0.231, 0.5252, 0.2507]}, {"w": "symbolic", "b": [0.5314, 0.231, 0.6211, 0.2507]}, {"w": "differentiation,", "b": [0.6274, 0.231, 0.7771, 0.2507]}, {"w": "such", "b": [0.7834, 0.231, 0.8296, 0.2507]}, {"w": "as", "b": [0.836, 0.231, 0.857, 0.2507]}, {"w": "TensorFlow.", "b": [0.1294, 0.2515, 0.2542, 0.2712]}, {"w": "This", "b": [0.2605, 0.2515, 0.3054, 0.2712]}, {"w": "means", "b": [0.3117, 0.2515, 0.3762, 0.2712]}, {"w": "that,", "b": [0.3825, 0.2515, 0.4266, 0.2712]}, {"w": "given", "b": [0.4329, 0.2515, 0.489, 0.2712]}, {"w": "a", "b": [0.4953, 0.2515, 0.5065, 0.2712]}, {"w": "chain", "b": [0.5128, 0.2515, 0.5674, 0.2712]}, {"w": "of", "b": [0.5737, 0.2515, 0.5947, 0.2712]}, {"w": "operations", "b": [0.601, 0.2515, 0.7061, 0.2712]}, {"w": "with", "b": [0.7124, 0.2515, 0.7573, 0.2712]}, {"w": "a", "b": [0.7636, 0.2515, 0.7748, 0.2712]}, {"w": "known", "b": [0.7811, 0.2515, 0.8498, 0.2712]}, {"w": "derivative,", "b": [0.1294, 0.272, 0.2366, 0.2917]}, {"w": "they", "b": [0.2429, 0.272, 0.2863, 0.2917]}, {"w": "can", "b": [0.2926, 0.272, 0.3277, 0.2917]}, {"w": "compute", "b": [0.334, 0.272, 0.4208, 0.2917]}, {"w": "a", "b": [0.4272, 0.272, 0.4384, 0.2917]}, {"w": "gradient", "b": [0.4447, 0.272, 0.5273, 0.2917]}, {"w": "function", "b": [0.5335, 0.272, 0.6162, 0.2917]}, {"w": "for", "b": [0.6225, 0.272, 0.6519, 0.2917]}, {"w": "the", "b": [0.6582, 0.272, 0.6891, 0.2917]}, {"w": "chain", "b": [0.6954, 0.272, 0.75, 0.2917]}, {"w": "(by", "b": [0.7563, 0.272, 0.7899, 0.2917]}, {"w": "applying", "b": [0.1294, 0.2925, 0.2177, 0.3122]}, {"w": "the", "b": [0.224, 0.2925, 0.2548, 0.3122]}, {"w": "chain", "b": [0.2611, 0.2925, 0.3158, 0.3122]}, {"w": "rule)", "b": [0.3221, 0.2925, 0.3697, 0.3122]}, {"w": "that", "b": [0.376, 0.2925, 0.4139, 0.3122]}, {"w": "maps", "b": [0.4202, 0.2925, 0.4734, 0.3122]}, {"w": "network", "b": [0.4797, 0.2925, 0.5624, 0.3122]}, {"w": "parameter", "b": [0.5687, 0.2925, 0.6695, 0.3122]}, {"w": "values", "b": [0.6759, 0.2925, 0.7403, 0.3122]}, {"w": "to", "b": [0.7466, 0.2925, 0.7662, 0.3122]}, {"w": "gradient", "b": [0.7725, 0.2925, 0.8552, 0.3122]}, {"w": "values.", "b": [0.1294, 0.313, 0.2002, 0.3327]}, {"w": "When", "b": [0.2065, 0.313, 0.2667, 0.3327]}, {"w": "you", "b": [0.273, 0.313, 0.3109, 0.3327]}, {"w": "have", "b": [0.3172, 0.313, 0.3648, 0.3327]}, {"w": "access", "b": [0.3711, 0.313, 0.4355, 0.3327]}, {"w": "to", "b": [0.4418, 0.313, 0.4615, 0.3327]}, {"w": "such", "b": [0.4677, 0.313, 0.514, 0.3327]}, {"w": "a", "b": [0.5203, 0.313, 0.5315, 0.3327]}, {"w": "function,", "b": [0.5378, 0.313, 0.6281, 0.3327]}, {"w": "the", "b": [0.6345, 0.313, 0.6653, 0.3327]}, {"w": "backward", "b": [0.6716, 0.313, 0.7696, 0.3327]}, {"w": "pass", "b": [0.7759, 0.313, 0.8194, 0.3327]}, {"w": "is", "b": [0.8257, 0.313, 0.8425, 0.3327]}, {"w": "reduced", "b": [0.1294, 0.3335, 0.2093, 0.3532]}, {"w": "to", "b": [0.2156, 0.3335, 0.2352, 0.3532]}, {"w": "a", "b": [0.2415, 0.3335, 0.2527, 0.3532]}, {"w": "call", "b": [0.259, 0.3335, 0.2954, 0.3532]}, {"w": "to", "b": [0.3017, 0.3335, 0.3214, 0.3532]}, {"w": "this", "b": [0.3277, 0.3335, 0.3641, 0.3532]}, {"w": "gradient", "b": [0.3704, 0.3335, 0.4531, 0.3532]}, {"w": "function.", "b": [0.4594, 0.3335, 0.5498, 0.3532]}, {"w": "Thanks", "b": [0.5561, 0.3335, 0.6303, 0.3532]}, {"w": "to", "b": [0.6367, 0.3335, 0.6563, 0.3532]}, {"w": "symbolic", "b": [0.6626, 0.3335, 0.7551, 0.3532]}, {"w": "differentiation,", "b": [0.1294, 0.354, 0.2796, 0.3737]}, {"w": "you’ll", "b": [0.2859, 0.354, 0.3461, 0.3737]}, {"w": "never", "b": [0.3524, 0.354, 0.4084, 0.3737]}, {"w": "have", "b": [0.4147, 0.354, 0.4624, 0.3737]}, {"w": "to", "b": [0.4687, 0.354, 0.4883, 0.3737]}, {"w": "implement", "b": [0.4946, 0.354, 0.6025, 0.3737]}, {"w": "the", "b": [0.6088, 0.354, 0.6396, 0.3737]}, {"w": "Backpropagation", "b": [0.646, 0.354, 0.8183, 0.3737]}, {"w": "algorithm", "b": [0.1294, 0.3745, 0.2275, 0.3942]}, {"w": "by", "b": [0.2338, 0.3745, 0.259, 0.3942]}, {"w": "hand.", "b": [0.2654, 0.3745, 0.3207, 0.3942]}, {"w": "For", "b": [0.327, 0.3745, 0.362, 0.3942]}, {"w": "this", "b": [0.3684, 0.3745, 0.4048, 0.3942]}, {"w": "reason,", "b": [0.4111, 0.3745, 0.4833, 0.3942]}, {"w": "we", "b": [0.4896, 0.3745, 0.519, 0.3942]}, {"w": "won’t", "b": [0.5253, 0.3745, 0.5837, 0.3942]}, {"w": "waste", "b": [0.59, 0.3745, 0.6474, 0.3942]}, {"w": "your", "b": [0.6537, 0.3745, 0.6999, 0.3942]}, {"w": "time", "b": [0.7062, 0.3745, 0.7511, 0.3942]}, {"w": "and", "b": [0.7574, 0.3745, 0.7938, 0.3942]}, {"w": "your", "b": [0.8001, 0.3745, 0.8464, 0.3942]}, {"w": "focus", "b": [0.1294, 0.395, 0.1841, 0.4147]}, {"w": "on", "b": [0.1904, 0.395, 0.2156, 0.4147]}, {"w": "deriving", "b": [0.2219, 0.395, 0.306, 0.4147]}, {"w": "the", "b": [0.3123, 0.395, 0.3431, 0.4147]}, {"w": "exact", "b": [0.3494, 0.395, 0.4026, 0.4147]}, {"w": "formulation", "b": [0.4089, 0.395, 0.528, 0.4147]}, {"w": "of", "b": [0.5344, 0.395, 0.5554, 0.4147]}, {"w": "the", "b": [0.5617, 0.395, 0.5925, 0.4147]}, {"w": "Backpropagation", "b": [0.5988, 0.395, 0.7711, 0.4147]}, {"w": "algorithm", "b": [0.1294, 0.4155, 0.2275, 0.4352]}, {"w": "in", "b": [0.2338, 0.4155, 0.2534, 0.4352]}, {"w": "these", "b": [0.2598, 0.4155, 0.3116, 0.4352]}, {"w": "pages.", "b": [0.3179, 0.4155, 0.3816, 0.4352]}, {"w": "All", "b": [0.388, 0.4155, 0.4202, 0.4352]}, {"w": "you", "b": [0.4265, 0.4155, 0.4643, 0.4352]}, {"w": "need", "b": [0.4706, 0.4155, 0.5183, 0.4352]}, {"w": "is", "b": [0.5246, 0.4155, 0.5414, 0.4352]}, {"w": "a", "b": [0.5477, 0.4155, 0.5589, 0.4352]}, {"w": "good", "b": [0.5652, 0.4155, 0.6157, 0.4352]}, {"w": "understanding", "b": [0.622, 0.4155, 0.7649, 0.4352]}, {"w": "of", "b": [0.7712, 0.4155, 0.7922, 0.4352]}, {"w": "how", "b": [0.7985, 0.4155, 0.842, 0.4352]}, {"w": "gradient-based", "b": [0.1294, 0.436, 0.2779, 0.4557]}, {"w": "optimization", "b": [0.2842, 0.436, 0.4118, 0.4557]}, {"w": "works.", "b": [0.4181, 0.436, 0.486, 0.4557]}]}, {"id": "b_2", "type": "paragraph", "text": "2.5. Looking back at our first example", "words": [{"w": "2.5.", "b": [0.1294, 0.4928, 0.172, 0.515]}, {"w": "Looking", "b": [0.1791, 0.4928, 0.28, 0.515]}, {"w": "back", "b": [0.2871, 0.4928, 0.3455, 0.515]}, {"w": "at", "b": [0.3526, 0.4928, 0.3762, 0.515]}, {"w": "our", "b": [0.3833, 0.4928, 0.4259, 0.515]}, {"w": "first", "b": [0.433, 0.4928, 0.4834, 0.515]}, {"w": "example", "b": [0.4905, 0.4928, 0.5914, 0.515]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ve reached the end of this chapter, and you should now have a general understanding of what’s going on behind the scenes in a neural network. Let’s go back to the first example and review each piece of it in the light of what you’ve learned in the previous three sections.", "words": [{"w": "You’ve", "b": [0.1294, 0.5385, 0.2025, 0.5582]}, {"w": "reached", "b": [0.2088, 0.5385, 0.2873, 0.5582]}, {"w": "the", "b": [0.2936, 0.5385, 0.3244, 0.5582]}, {"w": "end", "b": [0.3307, 0.5385, 0.3671, 0.5582]}, {"w": "of", "b": [0.3734, 0.5385, 0.3945, 0.5582]}, {"w": "this", "b": [0.4008, 0.5385, 0.4372, 0.5582]}, {"w": "chapter,", "b": [0.4435, 0.5385, 0.523, 0.5582]}, {"w": "and", "b": [0.5293, 0.5385, 0.5657, 0.5582]}, {"w": "you", "b": [0.572, 0.5385, 0.6099, 0.5582]}, {"w": "should", "b": [0.6162, 0.5385, 0.6835, 0.5582]}, {"w": "now", "b": [0.6898, 0.5385, 0.7332, 0.5582]}, {"w": "have", "b": [0.7395, 0.5385, 0.7871, 0.5582]}, {"w": "a", "b": [0.7935, 0.5385, 0.8047, 0.5582]}, {"w": "general", "b": [0.1294, 0.559, 0.2037, 0.5787]}, {"w": "understanding", "b": [0.21, 0.559, 0.3529, 0.5787]}, {"w": "of", "b": [0.3592, 0.559, 0.3802, 0.5787]}, {"w": "what’s", "b": [0.3865, 0.559, 0.4523, 0.5787]}, {"w": "going", "b": [0.4586, 0.559, 0.5161, 0.5787]}, {"w": "on", "b": [0.5224, 0.559, 0.5476, 0.5787]}, {"w": "behind", "b": [0.554, 0.559, 0.6226, 0.5787]}, {"w": "the", "b": [0.6289, 0.559, 0.6597, 0.5787]}, {"w": "scenes", "b": [0.6661, 0.559, 0.7319, 0.5787]}, {"w": "in", "b": [0.7382, 0.559, 0.7578, 0.5787]}, {"w": "a", "b": [0.7641, 0.559, 0.7753, 0.5787]}, {"w": "neural", "b": [0.7816, 0.559, 0.8447, 0.5787]}, {"w": "network.", "b": [0.1294, 0.5795, 0.2184, 0.5992]}, {"w": "Let’s", "b": [0.2247, 0.5795, 0.2751, 0.5992]}, {"w": "go", "b": [0.2814, 0.5795, 0.3067, 0.5992]}, {"w": "back", "b": [0.313, 0.5795, 0.3606, 0.5992]}, {"w": "to", "b": [0.3669, 0.5795, 0.3865, 0.5992]}, {"w": "the", "b": [0.3928, 0.5795, 0.4237, 0.5992]}, {"w": "first", "b": [0.43, 0.5795, 0.4706, 0.5992]}, {"w": "example", "b": [0.4769, 0.5795, 0.5624, 0.5992]}, {"w": "and", "b": [0.5687, 0.5795, 0.6051, 0.5992]}, {"w": "review", "b": [0.6114, 0.5795, 0.68, 0.5992]}, {"w": "each", "b": [0.6864, 0.5795, 0.7326, 0.5992]}, {"w": "piece", "b": [0.7389, 0.5795, 0.7921, 0.5992]}, {"w": "of", "b": [0.7984, 0.5795, 0.8194, 0.5992]}, {"w": "it", "b": [0.8257, 0.5795, 0.8397, 0.5992]}, {"w": "in", "b": [0.8461, 0.5795, 0.8657, 0.5992]}, {"w": "the", "b": [0.1294, 0.6, 0.1602, 0.6197]}, {"w": "light", "b": [0.1665, 0.6, 0.2128, 0.6197]}, {"w": "of", "b": [0.2191, 0.6, 0.2401, 0.6197]}, {"w": "what", "b": [0.2464, 0.6, 0.2955, 0.6197]}, {"w": "you’ve", "b": [0.3018, 0.6, 0.3718, 0.6197]}, {"w": "learned", "b": [0.3781, 0.6, 0.4524, 0.6197]}, {"w": "in", "b": [0.4587, 0.6, 0.4783, 0.6197]}, {"w": "the", "b": [0.4846, 0.6, 0.5154, 0.6197]}, {"w": "previous", "b": [0.5217, 0.6, 0.6086, 0.6197]}, {"w": "three", "b": [0.6149, 0.6, 0.6653, 0.6197]}, {"w": "sections.", "b": [0.6716, 0.6, 0.7592, 0.6197]}]}, {"id": "b_4", "type": "paragraph", "text": "This was the input data:", "words": [{"w": "This", "b": [0.1294, 0.6427, 0.1743, 0.6625]}, {"w": "was", "b": [0.1806, 0.6427, 0.2198, 0.6625]}, {"w": "the", "b": [0.2261, 0.6427, 0.2569, 0.6625]}, {"w": "input", "b": [0.2632, 0.6427, 0.3151, 0.6625]}, {"w": "data:", "b": [0.3214, 0.6427, 0.3704, 0.6625]}]}, {"id": "b_5", "type": "paragraph", "text": "(train_images, train_labels), (test_images, test_labels) = mnist.load_data() train_images = train_images.reshape((60000, 28 * 28)) train_images = train_images.astype('float32') / 255 test_images = test_images.reshape((10000, 28 * 28)) test_images = test_images.astype('float32') / 255", "words": [{"w": "(train_images,", "b": [0.1357, 0.6805, 0.2946, 0.6956]}, {"w": "train_labels),", "b": [0.306, 0.6805, 0.4649, 0.6956]}, {"w": "(test_images,", "b": [0.4763, 0.6805, 0.6238, 0.6956]}, {"w": "test_labels)", "b": [0.6352, 0.6805, 0.7714, 0.6956]}, {"w": "=", "b": [0.7828, 0.6805, 0.7941, 0.6956]}, {"w": "mnist.load_data()", "b": [0.1357, 0.6956, 0.3287, 0.7108]}, {"w": "train_images", "b": [0.1357, 0.7259, 0.2719, 0.7411]}, {"w": "=", "b": [0.2833, 0.7259, 0.2946, 0.7411]}, {"w": "train_images.reshape((60000,", "b": [0.306, 0.7259, 0.6238, 0.7411]}, {"w": "28", "b": [0.6352, 0.7259, 0.6579, 0.7411]}, {"w": "*", "b": [0.6692, 0.7259, 0.6806, 0.7411]}, {"w": "28))", "b": [0.6919, 0.7259, 0.7374, 0.7411]}, {"w": "train_images", "b": [0.1357, 0.7411, 0.2719, 0.7562]}, {"w": "=", "b": [0.2833, 0.7411, 0.2946, 0.7562]}, {"w": "train_images.astype('float32')", "b": [0.306, 0.7411, 0.6465, 0.7562]}, {"w": "/", "b": [0.6579, 0.7411, 0.6692, 0.7562]}, {"w": "255", "b": [0.6806, 0.7411, 0.7146, 0.7562]}, {"w": "test_images", "b": [0.1357, 0.7714, 0.2606, 0.7865]}, {"w": "=", "b": [0.2719, 0.7714, 0.2833, 0.7865]}, {"w": "test_images.reshape((10000,", "b": [0.2946, 0.7714, 0.6011, 0.7865]}, {"w": "28", "b": [0.6125, 0.7714, 0.6352, 0.7865]}, {"w": "*", "b": [0.6465, 0.7714, 0.6579, 0.7865]}, {"w": "28))", "b": [0.6692, 0.7714, 0.7146, 0.7865]}, {"w": "test_images", "b": [0.1357, 0.7866, 0.2606, 0.8017]}, {"w": "=", "b": [0.2719, 0.7866, 0.2833, 0.8017]}, {"w": "test_images.astype('float32')", "b": [0.2946, 0.7866, 0.6238, 0.8017]}, {"w": "/", "b": [0.6352, 0.7866, 0.6465, 0.8017]}, {"w": "255", "b": [0.6579, 0.7866, 0.6919, 0.8017]}]}, {"id": "b_6", "type": "paragraph", "text": "Now you understand that the input images are stored in Numpy tensors, which are here formatted as float32 tensors of shape (60000, 784) (training data) and (10000, 784) (test data), respectively.", "words": [{"w": "Now", "b": [0.1294, 0.8246, 0.1785, 0.8443]}, {"w": "you", "b": [0.1848, 0.8246, 0.2226, 0.8443]}, {"w": "understand", "b": [0.2289, 0.8246, 0.3396, 0.8443]}, {"w": "that", "b": [0.3459, 0.8246, 0.3837, 0.8443]}, {"w": "the", "b": [0.39, 0.8246, 0.4209, 0.8443]}, {"w": "input", "b": [0.4272, 0.8246, 0.479, 0.8443]}, {"w": "images", "b": [0.4853, 0.8246, 0.5568, 0.8443]}, {"w": "are", "b": [0.5631, 0.8246, 0.5939, 0.8443]}, {"w": "stored", "b": [0.6002, 0.8246, 0.6619, 0.8443]}, {"w": "in", "b": [0.6682, 0.8246, 0.6878, 0.8443]}, {"w": "Numpy", "b": [0.6941, 0.8246, 0.7698, 0.8443]}, {"w": "tensors,", "b": [0.7761, 0.8246, 0.8539, 0.8443]}, {"w": "which", "b": [0.1294, 0.8451, 0.1911, 0.8648]}, {"w": "are", "b": [0.1974, 0.8451, 0.2282, 0.8648]}, {"w": "here", "b": [0.2345, 0.8451, 0.2779, 0.8648]}, {"w": "formatted", "b": [0.2842, 0.8451, 0.3823, 0.8648]}, {"w": "as", "b": [0.3886, 0.8451, 0.4096, 0.8648]}, {"w": "float32", "b": [0.4159, 0.8461, 0.5218, 0.8663]}, {"w": "tensors", "b": [0.5281, 0.8451, 0.5996, 0.8648]}, {"w": "of", "b": [0.6059, 0.8451, 0.6269, 0.8648]}, {"w": "shape", "b": [0.6332, 0.8451, 0.6906, 0.8648]}, {"w": "(60000,", "b": [0.6969, 0.8461, 0.8029, 0.8663]}, {"w": "784)", "b": [0.1294, 0.8675, 0.19, 0.8877]}, {"w": "(training", "b": [0.1963, 0.8665, 0.2831, 0.8862]}, {"w": "data)", "b": [0.2894, 0.8665, 0.3399, 0.8862]}, {"w": "and", "b": [0.3462, 0.8665, 0.3826, 0.8862]}, {"w": "(10000,", "b": [0.3889, 0.8675, 0.4948, 0.8877]}, {"w": "784)", "b": [0.5099, 0.8675, 0.5705, 0.8877]}, {"w": "(test", "b": [0.5768, 0.8665, 0.6203, 0.8862]}, {"w": "data),", "b": [0.6266, 0.8665, 0.6833, 0.8862]}, {"w": "respectively.", "b": [0.6896, 0.8665, 0.8161, 0.8862]}]}]}, {"page": 92, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This was our network:", "words": [{"w": "This", "b": [0.1294, 0.0857, 0.1743, 0.1054]}, {"w": "was", "b": [0.1806, 0.0857, 0.2198, 0.1054]}, {"w": "our", "b": [0.2261, 0.0857, 0.2597, 0.1054]}, {"w": "network:", "b": [0.266, 0.0857, 0.3557, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "network = models.Sequential() network.add(layers.Dense(512, activation='relu', input_shape=(28 * 28,))) network.add(layers.Dense(10, activation='softmax'))", "words": [{"w": "network", "b": [0.1357, 0.1234, 0.2152, 0.1386]}, {"w": "=", "b": [0.2265, 0.1234, 0.2379, 0.1386]}, {"w": "models.Sequential()", "b": [0.2492, 0.1234, 0.4649, 0.1386]}, {"w": "network.add(layers.Dense(512,", "b": [0.1357, 0.1386, 0.4649, 0.1537]}, {"w": "activation='relu',", "b": [0.4763, 0.1386, 0.6806, 0.1537]}, {"w": "input_shape=(28", "b": [0.6919, 0.1386, 0.8622, 0.1537]}, {"w": "*", "b": [0.1357, 0.1537, 0.1471, 0.1689]}, {"w": "28,)))", "b": [0.1584, 0.1537, 0.2265, 0.1689]}, {"w": "network.add(layers.Dense(10,", "b": [0.1357, 0.1689, 0.4536, 0.184]}, {"w": "activation='softmax'))", "b": [0.4649, 0.1689, 0.7146, 0.184]}]}, {"id": "b_2", "type": "paragraph", "text": "Now you understand that this network consists of a chain of two Dense layers, that each layer applies a few simple tensor operations to the input data, and that these operations involve weight tensors. Weight tensors, which are attributes of the layers, are where the knowledge of the network persists.", "words": [{"w": "Now", "b": [0.1294, 0.2069, 0.1785, 0.2266]}, {"w": "you", "b": [0.1848, 0.2069, 0.2226, 0.2266]}, {"w": "understand", "b": [0.2289, 0.2069, 0.3396, 0.2266]}, {"w": "that", "b": [0.3459, 0.2069, 0.3837, 0.2266]}, {"w": "this", "b": [0.39, 0.2069, 0.4265, 0.2266]}, {"w": "network", "b": [0.4328, 0.2069, 0.5155, 0.2266]}, {"w": "consists", "b": [0.5218, 0.2069, 0.6017, 0.2266]}, {"w": "of", "b": [0.608, 0.2069, 0.629, 0.2266]}, {"w": "a", "b": [0.6353, 0.2069, 0.6465, 0.2266]}, {"w": "chain", "b": [0.6528, 0.2069, 0.7074, 0.2266]}, {"w": "of", "b": [0.7137, 0.2069, 0.7348, 0.2266]}, {"w": "two", "b": [0.7411, 0.2069, 0.7789, 0.2266]}, {"w": "Dense", "b": [0.7852, 0.2079, 0.8608, 0.2281]}, {"w": "layers,", "b": [0.1294, 0.2283, 0.196, 0.248]}, {"w": "that", "b": [0.2023, 0.2283, 0.2401, 0.248]}, {"w": "each", "b": [0.2464, 0.2283, 0.2926, 0.248]}, {"w": "layer", "b": [0.2989, 0.2283, 0.3494, 0.248]}, {"w": "applies", "b": [0.3557, 0.2283, 0.4271, 0.248]}, {"w": "a", "b": [0.4334, 0.2283, 0.4446, 0.248]}, {"w": "few", "b": [0.4509, 0.2283, 0.4888, 0.248]}, {"w": "simple", "b": [0.4951, 0.2283, 0.5623, 0.248]}, {"w": "tensor", "b": [0.5686, 0.2283, 0.6303, 0.248]}, {"w": "operations", "b": [0.6366, 0.2283, 0.7417, 0.248]}, {"w": "to", "b": [0.748, 0.2283, 0.7676, 0.248]}, {"w": "the", "b": [0.7739, 0.2283, 0.8048, 0.248]}, {"w": "input", "b": [0.8111, 0.2283, 0.8629, 0.248]}, {"w": "data,", "b": [0.1294, 0.2488, 0.1777, 0.2685]}, {"w": "and", "b": [0.1841, 0.2488, 0.2205, 0.2685]}, {"w": "that", "b": [0.2268, 0.2488, 0.2646, 0.2685]}, {"w": "these", "b": [0.2709, 0.2488, 0.3228, 0.2685]}, {"w": "operations", "b": [0.3291, 0.2488, 0.4342, 0.2685]}, {"w": "involve", "b": [0.4405, 0.2488, 0.5161, 0.2685]}, {"w": "weight", "b": [0.5225, 0.2488, 0.5911, 0.2685]}, {"w": "tensors.", "b": [0.5973, 0.2488, 0.6751, 0.2685]}, {"w": "Weight", "b": [0.6814, 0.2488, 0.7537, 0.2685]}, {"w": "tensors,", "b": [0.76, 0.2488, 0.8377, 0.2685]}, {"w": "which", "b": [0.1294, 0.2693, 0.1911, 0.289]}, {"w": "are", "b": [0.1974, 0.2693, 0.2282, 0.289]}, {"w": "attributes", "b": [0.2345, 0.2693, 0.3284, 0.289]}, {"w": "of", "b": [0.3347, 0.2693, 0.3557, 0.289]}, {"w": "the", "b": [0.362, 0.2693, 0.3928, 0.289]}, {"w": "layers,", "b": [0.3991, 0.2693, 0.4657, 0.289]}, {"w": "are", "b": [0.472, 0.2693, 0.5028, 0.289]}, {"w": "where", "b": [0.5091, 0.2693, 0.5707, 0.289]}, {"w": "the", "b": [0.577, 0.2693, 0.6078, 0.289]}, {"w": "knowledge", "b": [0.6141, 0.2693, 0.722, 0.289]}, {"w": "of", "b": [0.7282, 0.2693, 0.7493, 0.289]}, {"w": "the", "b": [0.7556, 0.2693, 0.7864, 0.289]}, {"w": "network", "b": [0.1294, 0.2898, 0.2121, 0.3095]}, {"w": "persists.", "b": [0.2184, 0.2898, 0.3004, 0.3095]}]}, {"id": "b_3", "type": "equation", "text": "This was the network-compilation step:", "words": [{"w": "This", "b": [0.1294, 0.3326, 0.1743, 0.3523]}, {"w": "was", "b": [0.1806, 0.3326, 0.2198, 0.3523]}, {"w": "the", "b": [0.2261, 0.3326, 0.2569, 0.3523]}, {"w": "network-compilation", "b": [0.2632, 0.3326, 0.4748, 0.3523]}, {"w": "step:", "b": [0.4811, 0.3326, 0.5288, 0.3523]}]}, {"id": "b_4", "type": "paragraph", "text": "network.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])", "words": [{"w": "network.compile(optimizer='rmsprop',", "b": [0.1357, 0.3703, 0.5444, 0.3855]}, {"w": "loss='categorical_crossentropy',", "b": [0.3173, 0.3855, 0.6806, 0.4006]}, {"w": "metrics=['accuracy'])", "b": [0.3173, 0.4006, 0.5557, 0.4158]}]}, {"id": "b_5", "type": "paragraph", "text": "Now you understand that categorical_crossentropy is the loss function that’s used as a feedback signal for learning the weight tensors, and which the training phase will attempt to minimize. You also know that this reduction of the loss happens via mini-batch stochastic gradient descent. The exact rules governing a specific use of gradient descent are defined by the rmsprop optimizer passed as the first argument.", "words": [{"w": "Now", "b": [0.1294, 0.4386, 0.1785, 0.4584]}, {"w": "you", "b": [0.1848, 0.4386, 0.2226, 0.4584]}, {"w": "understand", "b": [0.2289, 0.4386, 0.3396, 0.4584]}, {"w": "that", "b": [0.3459, 0.4386, 0.3837, 0.4584]}, {"w": "categorical_crossentropy", "b": [0.39, 0.4397, 0.7533, 0.4599]}, {"w": "is", "b": [0.7596, 0.4386, 0.7765, 0.4584]}, {"w": "the", "b": [0.7828, 0.4386, 0.8136, 0.4584]}, {"w": "loss", "b": [0.8199, 0.4386, 0.8592, 0.4584]}, {"w": "function", "b": [0.1294, 0.46, 0.2135, 0.4798]}, {"w": "that’s", "b": [0.2198, 0.46, 0.2744, 0.4798]}, {"w": "used", "b": [0.2807, 0.46, 0.327, 0.4798]}, {"w": "as", "b": [0.3333, 0.46, 0.3543, 0.4798]}, {"w": "a", "b": [0.3606, 0.46, 0.3718, 0.4798]}, {"w": "feedback", "b": [0.3781, 0.46, 0.4691, 0.4798]}, {"w": "signal", "b": [0.4755, 0.46, 0.5357, 0.4798]}, {"w": "for", "b": [0.542, 0.46, 0.5714, 0.4798]}, {"w": "learning", "b": [0.5777, 0.46, 0.6604, 0.4798]}, {"w": "the", "b": [0.6667, 0.46, 0.6975, 0.4798]}, {"w": "weight", "b": [0.7038, 0.46, 0.7725, 0.4798]}, {"w": "tensors,", "b": [0.7788, 0.46, 0.8566, 0.4798]}, {"w": "and", "b": [0.1294, 0.4805, 0.1658, 0.5003]}, {"w": "which", "b": [0.1721, 0.4805, 0.2338, 0.5003]}, {"w": "the", "b": [0.2401, 0.4805, 0.2709, 0.5003]}, {"w": "training", "b": [0.2772, 0.4805, 0.3557, 0.5003]}, {"w": "phase", "b": [0.362, 0.4805, 0.4195, 0.5003]}, {"w": "will", "b": [0.4258, 0.4805, 0.465, 0.5003]}, {"w": "attempt", "b": [0.4713, 0.4805, 0.5469, 0.5003]}, {"w": "to", "b": [0.5532, 0.4805, 0.5729, 0.5003]}, {"w": "minimize.", "b": [0.5792, 0.4805, 0.6808, 0.5003]}, {"w": "You", "b": [0.6871, 0.4805, 0.728, 0.5003]}, {"w": "also", "b": [0.7343, 0.4805, 0.7749, 0.5003]}, {"w": "know", "b": [0.7812, 0.4805, 0.8373, 0.5003]}, {"w": "that", "b": [0.1294, 0.501, 0.1673, 0.5208]}, {"w": "this", "b": [0.1736, 0.501, 0.21, 0.5208]}, {"w": "reduction", "b": [0.2163, 0.501, 0.3116, 0.5208]}, {"w": "of", "b": [0.3179, 0.501, 0.3389, 0.5208]}, {"w": "the", "b": [0.3452, 0.501, 0.376, 0.5208]}, {"w": "loss", "b": [0.3824, 0.501, 0.4216, 0.5208]}, {"w": "happens", "b": [0.4279, 0.501, 0.5106, 0.5208]}, {"w": "via", "b": [0.5169, 0.501, 0.5477, 0.5208]}, {"w": "mini-batch", "b": [0.554, 0.501, 0.6633, 0.5208]}, {"w": "stochastic", "b": [0.6696, 0.501, 0.7691, 0.5208]}, {"w": "gradient", "b": [0.7754, 0.501, 0.8581, 0.5208]}, {"w": "descent.", "b": [0.1294, 0.5215, 0.2114, 0.5413]}, {"w": "The", "b": [0.2177, 0.5215, 0.2569, 0.5413]}, {"w": "exact", "b": [0.2632, 0.5215, 0.3164, 0.5413]}, {"w": "rules", "b": [0.3227, 0.5215, 0.3718, 0.5413]}, {"w": "governing", "b": [0.3781, 0.5215, 0.4804, 0.5413]}, {"w": "a", "b": [0.4867, 0.5215, 0.4979, 0.5413]}, {"w": "specific", "b": [0.5042, 0.5215, 0.5826, 0.5413]}, {"w": "use", "b": [0.5889, 0.5215, 0.6226, 0.5413]}, {"w": "of", "b": [0.6289, 0.5215, 0.6499, 0.5413]}, {"w": "gradient", "b": [0.6562, 0.5215, 0.7388, 0.5413]}, {"w": "descent", "b": [0.7452, 0.5215, 0.8208, 0.5413]}, {"w": "are", "b": [0.8271, 0.5215, 0.8579, 0.5413]}, {"w": "defined", "b": [0.1294, 0.542, 0.2051, 0.5618]}, {"w": "by", "b": [0.2114, 0.542, 0.2366, 0.5618]}, {"w": "the", "b": [0.2429, 0.542, 0.2737, 0.5618]}, {"w": "rmsprop", "b": [0.28, 0.5431, 0.3859, 0.5633]}, {"w": "optimizer", "b": [0.3923, 0.542, 0.4889, 0.5618]}, {"w": "passed", "b": [0.4952, 0.542, 0.5625, 0.5618]}, {"w": "as", "b": [0.5688, 0.542, 0.5898, 0.5618]}, {"w": "the", "b": [0.5961, 0.542, 0.627, 0.5618]}, {"w": "first", "b": [0.6333, 0.542, 0.6739, 0.5618]}, {"w": "argument.", "b": [0.6802, 0.542, 0.7813, 0.5618]}]}, {"id": "b_6", "type": "paragraph", "text": "Finally, this was the training loop:", "words": [{"w": "Finally,", "b": [0.1294, 0.5857, 0.2056, 0.6054]}, {"w": "this", "b": [0.2119, 0.5857, 0.2483, 0.6054]}, {"w": "was", "b": [0.2546, 0.5857, 0.2938, 0.6054]}, {"w": "the", "b": [0.3002, 0.5857, 0.331, 0.6054]}, {"w": "training", "b": [0.3373, 0.5857, 0.4158, 0.6054]}, {"w": "loop:", "b": [0.4221, 0.5857, 0.4739, 0.6054]}]}, {"id": "b_7", "type": "equation", "text": "network.fit(train_images, train_labels, epochs=5, batch_size=128)", "words": [{"w": "network.fit(train_images,", "b": [0.1357, 0.6234, 0.4195, 0.6386]}, {"w": "train_labels,", "b": [0.4309, 0.6234, 0.5784, 0.6386]}, {"w": "epochs=5,", "b": [0.5898, 0.6234, 0.6919, 0.6386]}, {"w": "batch_size=128)", "b": [0.1357, 0.6386, 0.306, 0.6537]}]}, {"id": "b_8", "type": "paragraph", "text": "Now you understand what happens when you call fit: the network will start to iterate on the training data in mini-batches of 128 samples, 5 times over (each iteration over all the training data is called an epoch). At each iteration, the network will compute the gradients of the weights with regard to the loss on the batch, and update the weights accordingly. After these 5 epochs, the network will have performed 2,345 gradient updates (469 per epoch), and the loss of the network will be sufficiently low that the network will be capable of classifying handwritten digits with high accuracy.", "words": [{"w": "Now", "b": [0.1294, 0.6766, 0.1785, 0.6964]}, {"w": "you", "b": [0.1848, 0.6766, 0.2226, 0.6964]}, {"w": "understand", "b": [0.2289, 0.6766, 0.3396, 0.6964]}, {"w": "what", "b": [0.3459, 0.6766, 0.3949, 0.6964]}, {"w": "happens", "b": [0.4012, 0.6766, 0.4839, 0.6964]}, {"w": "when", "b": [0.4902, 0.6766, 0.5449, 0.6964]}, {"w": "you", "b": [0.5512, 0.6766, 0.589, 0.6964]}, {"w": "call", "b": [0.5953, 0.6766, 0.6317, 0.6964]}, {"w": "fit:", "b": [0.638, 0.6766, 0.6904, 0.6979]}, {"w": "the", "b": [0.6967, 0.6766, 0.7276, 0.6964]}, {"w": "network", "b": [0.7339, 0.6766, 0.8165, 0.6964]}, {"w": "will", "b": [0.8228, 0.6766, 0.8621, 0.6964]}, {"w": "start", "b": [0.1294, 0.698, 0.1729, 0.7178]}, {"w": "to", "b": [0.1792, 0.698, 0.1988, 0.7178]}, {"w": "iterate", "b": [0.2051, 0.698, 0.2681, 0.7178]}, {"w": "on", "b": [0.2744, 0.698, 0.2997, 0.7178]}, {"w": "the", "b": [0.306, 0.698, 0.3368, 0.7178]}, {"w": "training", "b": [0.3431, 0.698, 0.4216, 0.7178]}, {"w": "data", "b": [0.4279, 0.698, 0.4699, 0.7178]}, {"w": "in", "b": [0.4762, 0.698, 0.4958, 0.7178]}, {"w": "mini-batches", "b": [0.5021, 0.698, 0.6325, 0.7178]}, {"w": "of", "b": [0.6388, 0.698, 0.6598, 0.7178]}, {"w": "128", "b": [0.6661, 0.698, 0.7039, 0.7178]}, {"w": "samples,", "b": [0.7102, 0.698, 0.7978, 0.7178]}, {"w": "5", "b": [0.8041, 0.698, 0.8167, 0.7178]}, {"w": "times", "b": [0.1294, 0.7185, 0.1841, 0.7383]}, {"w": "over", "b": [0.1904, 0.7185, 0.2352, 0.7383]}, {"w": "(each", "b": [0.2415, 0.7185, 0.2961, 0.7383]}, {"w": "iteration", "b": [0.3024, 0.7185, 0.3865, 0.7383]}, {"w": "over", "b": [0.3928, 0.7185, 0.4376, 0.7383]}, {"w": "all", "b": [0.4439, 0.7185, 0.4691, 0.7383]}, {"w": "the", "b": [0.4754, 0.7185, 0.5062, 0.7383]}, {"w": "training", "b": [0.5126, 0.7185, 0.591, 0.7383]}, {"w": "data", "b": [0.5973, 0.7185, 0.6394, 0.7383]}, {"w": "is", "b": [0.6457, 0.7185, 0.6625, 0.7383]}, {"w": "called", "b": [0.6688, 0.7185, 0.729, 0.7383]}, {"w": "an", "b": [0.7353, 0.7185, 0.7592, 0.7383]}, {"w": "epoch).", "b": [0.7654, 0.7185, 0.8403, 0.7383]}, {"w": "At", "b": [0.1294, 0.739, 0.1546, 0.7588]}, {"w": "each", "b": [0.1609, 0.739, 0.2072, 0.7588]}, {"w": "iteration,", "b": [0.2135, 0.739, 0.3038, 0.7588]}, {"w": "the", "b": [0.3102, 0.739, 0.341, 0.7588]}, {"w": "network", "b": [0.3473, 0.739, 0.43, 0.7588]}, {"w": "will", "b": [0.4363, 0.739, 0.4755, 0.7588]}, {"w": "compute", "b": [0.4818, 0.739, 0.5687, 0.7588]}, {"w": "the", "b": [0.575, 0.739, 0.6058, 0.7588]}, {"w": "gradients", "b": [0.6121, 0.739, 0.7046, 0.7588]}, {"w": "of", "b": [0.7109, 0.739, 0.7319, 0.7588]}, {"w": "the", "b": [0.7382, 0.739, 0.7691, 0.7588]}, {"w": "weights", "b": [0.7754, 0.739, 0.8538, 0.7588]}, {"w": "with", "b": [0.1294, 0.7595, 0.1743, 0.7793]}, {"w": "regard", "b": [0.1806, 0.7595, 0.245, 0.7793]}, {"w": "to", "b": [0.2513, 0.7595, 0.2709, 0.7793]}, {"w": "the", "b": [0.2772, 0.7595, 0.3081, 0.7793]}, {"w": "loss", "b": [0.3144, 0.7595, 0.3536, 0.7793]}, {"w": "on", "b": [0.3599, 0.7595, 0.3852, 0.7793]}, {"w": "the", "b": [0.3915, 0.7595, 0.4223, 0.7793]}, {"w": "batch,", "b": [0.4286, 0.7595, 0.4895, 0.7793]}, {"w": "and", "b": [0.4958, 0.7595, 0.5323, 0.7793]}, {"w": "update", "b": [0.5386, 0.7595, 0.6058, 0.7793]}, {"w": "the", "b": [0.6121, 0.7595, 0.6429, 0.7793]}, {"w": "weights", "b": [0.6492, 0.7595, 0.7277, 0.7793]}, {"w": "accordingly.", "b": [0.734, 0.7595, 0.8577, 0.7793]}, {"w": "After", "b": [0.1294, 0.78, 0.1826, 0.7998]}, {"w": "these", "b": [0.1889, 0.78, 0.2408, 0.7998]}, {"w": "5", "b": [0.2471, 0.78, 0.2597, 0.7998]}, {"w": "epochs,", "b": [0.266, 0.78, 0.3424, 0.7998]}, {"w": "the", "b": [0.3487, 0.78, 0.3795, 0.7998]}, {"w": "network", "b": [0.3858, 0.78, 0.4685, 0.7998]}, {"w": "will", "b": [0.4748, 0.78, 0.514, 0.7998]}, {"w": "have", "b": [0.5203, 0.78, 0.568, 0.7998]}, {"w": "performed", "b": [0.5743, 0.78, 0.6793, 0.7998]}, {"w": "2,345", "b": [0.6856, 0.78, 0.7424, 0.7998]}, {"w": "gradient", "b": [0.7487, 0.78, 0.8314, 0.7998]}, {"w": "updates", "b": [0.1294, 0.8005, 0.2065, 0.8203]}, {"w": "(469", "b": [0.2128, 0.8005, 0.259, 0.8203]}, {"w": "per", "b": [0.2653, 0.8005, 0.2975, 0.8203]}, {"w": "epoch),", "b": [0.3038, 0.8005, 0.3788, 0.8203]}, {"w": "and", "b": [0.3851, 0.8005, 0.4215, 0.8203]}, {"w": "the", "b": [0.4278, 0.8005, 0.4586, 0.8203]}, {"w": "loss", "b": [0.4649, 0.8005, 0.5042, 0.8203]}, {"w": "of", "b": [0.5105, 0.8005, 0.5315, 0.8203]}, {"w": "the", "b": [0.5378, 0.8005, 0.5686, 0.8203]}, {"w": "network", "b": [0.5749, 0.8005, 0.6576, 0.8203]}, {"w": "will", "b": [0.6639, 0.8005, 0.7032, 0.8203]}, {"w": "be", "b": [0.7095, 0.8005, 0.7333, 0.8203]}, {"w": "sufficiently", "b": [0.7396, 0.8005, 0.854, 0.8203]}, {"w": "low", "b": [0.1294, 0.821, 0.1673, 0.8408]}, {"w": "that", "b": [0.1736, 0.821, 0.2114, 0.8408]}, {"w": "the", "b": [0.2177, 0.821, 0.2485, 0.8408]}, {"w": "network", "b": [0.2548, 0.821, 0.3375, 0.8408]}, {"w": "will", "b": [0.3438, 0.821, 0.3831, 0.8408]}, {"w": "be", "b": [0.3894, 0.821, 0.4132, 0.8408]}, {"w": "capable", "b": [0.4195, 0.821, 0.4965, 0.8408]}, {"w": "of", "b": [0.5028, 0.821, 0.5238, 0.8408]}, {"w": "classifying", "b": [0.5301, 0.821, 0.6395, 0.8408]}, {"w": "handwritten", "b": [0.6458, 0.821, 0.7663, 0.8408]}, {"w": "digits", "b": [0.7726, 0.821, 0.8286, 0.8408]}, {"w": "with", "b": [0.1294, 0.8415, 0.1743, 0.8613]}, {"w": "high", "b": [0.1806, 0.8415, 0.2254, 0.8613]}, {"w": "accuracy.", "b": [0.2317, 0.8415, 0.326, 0.8613]}]}]}, {"page": 93, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "At this point, you already know most of what there is to know about neural networks.", "words": [{"w": "At", "b": [0.1294, 0.0857, 0.1546, 0.1054]}, {"w": "this", "b": [0.1609, 0.0857, 0.1974, 0.1054]}, {"w": "point,", "b": [0.2037, 0.0857, 0.2619, 0.1054]}, {"w": "you", "b": [0.2682, 0.0857, 0.306, 0.1054]}, {"w": "already", "b": [0.3123, 0.0857, 0.3866, 0.1054]}, {"w": "know", "b": [0.3929, 0.0857, 0.4489, 0.1054]}, {"w": "most", "b": [0.4552, 0.0857, 0.5043, 0.1054]}, {"w": "of", "b": [0.5106, 0.0857, 0.5316, 0.1054]}, {"w": "what", "b": [0.5379, 0.0857, 0.587, 0.1054]}, {"w": "there", "b": [0.5933, 0.0857, 0.6437, 0.1054]}, {"w": "is", "b": [0.65, 0.0857, 0.6668, 0.1054]}, {"w": "to", "b": [0.6731, 0.0857, 0.6928, 0.1054]}, {"w": "know", "b": [0.6991, 0.0857, 0.7551, 0.1054]}, {"w": "about", "b": [0.7614, 0.0857, 0.8175, 0.1054]}, {"w": "neural", "b": [0.1294, 0.1062, 0.1925, 0.1259]}, {"w": "networks.", "b": [0.1988, 0.1062, 0.2975, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1294, 0.1579, 0.2191, 0.1776]}, {"w": "summary", "b": [0.2254, 0.1579, 0.3277, 0.1776]}]}, {"id": "b_2", "type": "paragraph", "text": "Learning means finding a combination of model parameters that minimizes a loss function for a given set of training data samples and their corresponding targets. Learning happens by drawing random batches of data samples and their targets, and computing the gradient of the network parameters with respect to the loss on the batch. The network parameters are then moved a bit (the magnitude of the move is defined by the learning rate) in the opposite direction from the gradient. The entire learning process is made possible by the fact that neural networks are chains of differentiable tensor operations, and thus it’s possible to apply the chain rule of derivation to find the gradient function mapping the current parameters and current batch of data to a gradient value. Two key concepts you’ll see frequently in future chapters are loss and optimizers. These are the two things you need to define before you begin feeding data into a network. The loss is the quantity you’ll attempt to minimize during training, so it should represent a measure of success for the task you’re trying to solve. The optimizer specifies the exact way in which the gradient of the loss will be used to update parameters: for instance, it could be the RMSProp optimizer, SGD with momentum, and so on.", "words": [{"w": "Learning", "b": [0.1799, 0.1962, 0.2724, 0.2159]}, {"w": "means", "b": [0.2787, 0.1962, 0.3431, 0.2159]}, {"w": "finding", "b": [0.3494, 0.1962, 0.4223, 0.2159]}, {"w": "a", "b": [0.4286, 0.1962, 0.4398, 0.2159]}, {"w": "combination", "b": [0.4461, 0.1962, 0.5722, 0.2159]}, {"w": "of", "b": [0.5785, 0.1962, 0.5996, 0.2159]}, {"w": "model", "b": [0.6059, 0.1962, 0.6689, 0.2159]}, {"w": "parameters", "b": [0.6752, 0.1962, 0.7859, 0.2159]}, {"w": "that", "b": [0.7922, 0.1962, 0.83, 0.2159]}, {"w": "minimizes", "b": [0.1799, 0.2167, 0.285, 0.2364]}, {"w": "a", "b": [0.2913, 0.2167, 0.3025, 0.2364]}, {"w": "loss", "b": [0.3088, 0.2167, 0.348, 0.2364]}, {"w": "function", "b": [0.3544, 0.2167, 0.4384, 0.2364]}, {"w": "for", "b": [0.4447, 0.2167, 0.4741, 0.2364]}, {"w": "a", "b": [0.4805, 0.2167, 0.4917, 0.2364]}, {"w": "given", "b": [0.498, 0.2167, 0.554, 0.2364]}, {"w": "set", "b": [0.5603, 0.2167, 0.5883, 0.2364]}, {"w": "of", "b": [0.5947, 0.2167, 0.6157, 0.2364]}, {"w": "training", "b": [0.622, 0.2167, 0.7004, 0.2364]}, {"w": "data", "b": [0.7068, 0.2167, 0.7488, 0.2364]}, {"w": "samples", "b": [0.7551, 0.2167, 0.8364, 0.2364]}, {"w": "and", "b": [0.1799, 0.2372, 0.2163, 0.2569]}, {"w": "their", "b": [0.2226, 0.2372, 0.2688, 0.2569]}, {"w": "corresponding", "b": [0.2751, 0.2372, 0.4195, 0.2569]}, {"w": "targets.", "b": [0.4258, 0.2372, 0.4988, 0.2569]}, {"w": "Learning", "b": [0.1799, 0.2577, 0.2709, 0.2774]}, {"w": "happens", "b": [0.2772, 0.2577, 0.3599, 0.2774]}, {"w": "by", "b": [0.3662, 0.2577, 0.3914, 0.2774]}, {"w": "drawing", "b": [0.3977, 0.2577, 0.4804, 0.2774]}, {"w": "random", "b": [0.4867, 0.2577, 0.5638, 0.2774]}, {"w": "batches", "b": [0.5701, 0.2577, 0.6457, 0.2774]}, {"w": "of", "b": [0.652, 0.2577, 0.6731, 0.2774]}, {"w": "data", "b": [0.6794, 0.2577, 0.7214, 0.2774]}, {"w": "samples", "b": [0.7277, 0.2577, 0.809, 0.2774]}, {"w": "and", "b": [0.8153, 0.2577, 0.8517, 0.2774]}, {"w": "their", "b": [0.1799, 0.2782, 0.2261, 0.2979]}, {"w": "targets,", "b": [0.2324, 0.2782, 0.3055, 0.2979]}, {"w": "and", "b": [0.3118, 0.2782, 0.3482, 0.2979]}, {"w": "computing", "b": [0.3545, 0.2782, 0.4624, 0.2979]}, {"w": "the", "b": [0.4688, 0.2782, 0.4996, 0.2979]}, {"w": "gradient", "b": [0.5059, 0.2782, 0.5885, 0.2979]}, {"w": "of", "b": [0.5949, 0.2782, 0.6159, 0.2979]}, {"w": "the", "b": [0.6222, 0.2782, 0.653, 0.2979]}, {"w": "network", "b": [0.6593, 0.2782, 0.742, 0.2979]}, {"w": "parameters", "b": [0.7483, 0.2782, 0.8589, 0.2979]}, {"w": "with", "b": [0.1799, 0.2987, 0.2247, 0.3184]}, {"w": "respect", "b": [0.231, 0.2987, 0.3025, 0.3184]}, {"w": "to", "b": [0.3088, 0.2987, 0.3284, 0.3184]}, {"w": "the", "b": [0.3347, 0.2987, 0.3655, 0.3184]}, {"w": "loss", "b": [0.3718, 0.2987, 0.4111, 0.3184]}, {"w": "on", "b": [0.4174, 0.2987, 0.4426, 0.3184]}, {"w": "the", "b": [0.4489, 0.2987, 0.4797, 0.3184]}, {"w": "batch.", "b": [0.4861, 0.2987, 0.547, 0.3184]}, {"w": "The", "b": [0.5533, 0.2987, 0.5925, 0.3184]}, {"w": "network", "b": [0.5988, 0.2987, 0.6815, 0.3184]}, {"w": "parameters", "b": [0.6878, 0.2987, 0.7985, 0.3184]}, {"w": "are", "b": [0.8048, 0.2987, 0.8356, 0.3184]}, {"w": "then", "b": [0.1799, 0.3192, 0.2233, 0.3389]}, {"w": "moved", "b": [0.2296, 0.3192, 0.2983, 0.3389]}, {"w": "a", "b": [0.3046, 0.3192, 0.3158, 0.3389]}, {"w": "bit", "b": [0.3221, 0.3192, 0.3487, 0.3389]}, {"w": "(the", "b": [0.355, 0.3192, 0.3943, 0.3389]}, {"w": "magnitude", "b": [0.4006, 0.3192, 0.5071, 0.3389]}, {"w": "of", "b": [0.5134, 0.3192, 0.5344, 0.3389]}, {"w": "the", "b": [0.5407, 0.3192, 0.5715, 0.3389]}, {"w": "move", "b": [0.5778, 0.3192, 0.6339, 0.3389]}, {"w": "is", "b": [0.6402, 0.3192, 0.657, 0.3389]}, {"w": "defined", "b": [0.6633, 0.3192, 0.739, 0.3389]}, {"w": "by", "b": [0.7453, 0.3192, 0.7705, 0.3389]}, {"w": "the", "b": [0.7767, 0.3192, 0.8075, 0.3389]}, {"w": "learning", "b": [0.1799, 0.3397, 0.2625, 0.3594]}, {"w": "rate)", "b": [0.2688, 0.3397, 0.315, 0.3594]}, {"w": "in", "b": [0.3214, 0.3397, 0.341, 0.3594]}, {"w": "the", "b": [0.3473, 0.3397, 0.3781, 0.3594]}, {"w": "opposite", "b": [0.3844, 0.3397, 0.4699, 0.3594]}, {"w": "direction", "b": [0.4762, 0.3397, 0.5659, 0.3594]}, {"w": "from", "b": [0.5722, 0.3397, 0.6212, 0.3594]}, {"w": "the", "b": [0.6275, 0.3397, 0.6584, 0.3594]}, {"w": "gradient.", "b": [0.6647, 0.3397, 0.7536, 0.3594]}, {"w": "The", "b": [0.1799, 0.3602, 0.2191, 0.3799]}, {"w": "entire", "b": [0.2254, 0.3602, 0.2828, 0.3799]}, {"w": "learning", "b": [0.2891, 0.3602, 0.3718, 0.3799]}, {"w": "process", "b": [0.3781, 0.3602, 0.4538, 0.3799]}, {"w": "is", "b": [0.4601, 0.3602, 0.4769, 0.3799]}, {"w": "made", "b": [0.4832, 0.3602, 0.5378, 0.3799]}, {"w": "possible", "b": [0.5441, 0.3602, 0.6268, 0.3799]}, {"w": "by", "b": [0.6331, 0.3602, 0.6584, 0.3799]}, {"w": "the", "b": [0.6647, 0.3602, 0.6955, 0.3799]}, {"w": "fact", "b": [0.7018, 0.3602, 0.7396, 0.3799]}, {"w": "that", "b": [0.7459, 0.3602, 0.7838, 0.3799]}, {"w": "neural", "b": [0.7901, 0.3602, 0.8531, 0.3799]}, {"w": "networks", "b": [0.1799, 0.3807, 0.2723, 0.4004]}, {"w": "are", "b": [0.2786, 0.3807, 0.3094, 0.4004]}, {"w": "chains", "b": [0.3158, 0.3807, 0.3802, 0.4004]}, {"w": "of", "b": [0.3865, 0.3807, 0.4075, 0.4004]}, {"w": "differentiable", "b": [0.4138, 0.3807, 0.5492, 0.4004]}, {"w": "tensor", "b": [0.5556, 0.3807, 0.6172, 0.4004]}, {"w": "operations,", "b": [0.6235, 0.3807, 0.7349, 0.4004]}, {"w": "and", "b": [0.7412, 0.3807, 0.7776, 0.4004]}, {"w": "thus", "b": [0.7839, 0.3807, 0.8259, 0.4004]}, {"w": "it’s", "b": [0.8322, 0.3807, 0.8631, 0.4004]}, {"w": "possible", "b": [0.1799, 0.4012, 0.2626, 0.4209]}, {"w": "to", "b": [0.2689, 0.4012, 0.2885, 0.4209]}, {"w": "apply", "b": [0.2948, 0.4012, 0.3508, 0.4209]}, {"w": "the", "b": [0.3572, 0.4012, 0.388, 0.4209]}, {"w": "chain", "b": [0.3943, 0.4012, 0.4489, 0.4209]}, {"w": "rule", "b": [0.4552, 0.4012, 0.4945, 0.4209]}, {"w": "of", "b": [0.5008, 0.4012, 0.5218, 0.4209]}, {"w": "derivation", "b": [0.5281, 0.4012, 0.6304, 0.4209]}, {"w": "to", "b": [0.6367, 0.4012, 0.6563, 0.4209]}, {"w": "find", "b": [0.6626, 0.4012, 0.7032, 0.4209]}, {"w": "the", "b": [0.7096, 0.4012, 0.7404, 0.4209]}, {"w": "gradient", "b": [0.7467, 0.4012, 0.8294, 0.4209]}, {"w": "function", "b": [0.1799, 0.4217, 0.2639, 0.4414]}, {"w": "mapping", "b": [0.2702, 0.4217, 0.3585, 0.4414]}, {"w": "the", "b": [0.3648, 0.4217, 0.3957, 0.4414]}, {"w": "current", "b": [0.402, 0.4217, 0.4734, 0.4414]}, {"w": "parameters", "b": [0.4797, 0.4217, 0.5904, 0.4414]}, {"w": "and", "b": [0.5966, 0.4217, 0.633, 0.4414]}, {"w": "current", "b": [0.6394, 0.4217, 0.7108, 0.4414]}, {"w": "batch", "b": [0.7171, 0.4217, 0.7717, 0.4414]}, {"w": "of", "b": [0.778, 0.4217, 0.7991, 0.4414]}, {"w": "data", "b": [0.8054, 0.4217, 0.8474, 0.4414]}, {"w": "to", "b": [0.1799, 0.4422, 0.1995, 0.4619]}, {"w": "a", "b": [0.2058, 0.4422, 0.217, 0.4619]}, {"w": "gradient", "b": [0.2233, 0.4422, 0.306, 0.4619]}, {"w": "value.", "b": [0.3123, 0.4422, 0.3732, 0.4619]}, {"w": "Two", "b": [0.1799, 0.4627, 0.2243, 0.4824]}, {"w": "key", "b": [0.2306, 0.4627, 0.2671, 0.4824]}, {"w": "concepts", "b": [0.2734, 0.4627, 0.3616, 0.4824]}, {"w": "you’ll", "b": [0.3679, 0.4627, 0.4282, 0.4824]}, {"w": "see", "b": [0.4345, 0.4627, 0.4667, 0.4824]}, {"w": "frequently", "b": [0.473, 0.4627, 0.5767, 0.4824]}, {"w": "in", "b": [0.583, 0.4627, 0.6026, 0.4824]}, {"w": "future", "b": [0.609, 0.4627, 0.6692, 0.4824]}, {"w": "chapters", "b": [0.6755, 0.4627, 0.7596, 0.4824]}, {"w": "are", "b": [0.7659, 0.4627, 0.7967, 0.4824]}, {"w": "loss", "b": [0.8029, 0.4627, 0.8421, 0.4824]}, {"w": "and", "b": [0.1799, 0.4832, 0.2163, 0.5029]}, {"w": "optimizers.", "b": [0.2226, 0.4832, 0.334, 0.5029]}, {"w": "These", "b": [0.3403, 0.4832, 0.4005, 0.5029]}, {"w": "are", "b": [0.4068, 0.4832, 0.4376, 0.5029]}, {"w": "the", "b": [0.444, 0.4832, 0.4748, 0.5029]}, {"w": "two", "b": [0.4811, 0.4832, 0.5189, 0.5029]}, {"w": "things", "b": [0.5252, 0.4832, 0.5869, 0.5029]}, {"w": "you", "b": [0.5932, 0.4832, 0.6311, 0.5029]}, {"w": "need", "b": [0.6374, 0.4832, 0.685, 0.5029]}, {"w": "to", "b": [0.6913, 0.4832, 0.7109, 0.5029]}, {"w": "define", "b": [0.7172, 0.4832, 0.7803, 0.5029]}, {"w": "before", "b": [0.7866, 0.4832, 0.851, 0.5029]}, {"w": "you", "b": [0.1799, 0.5037, 0.2177, 0.5234]}, {"w": "begin", "b": [0.224, 0.5037, 0.2801, 0.5234]}, {"w": "feeding", "b": [0.2864, 0.5037, 0.362, 0.5234]}, {"w": "data", "b": [0.3683, 0.5037, 0.4104, 0.5234]}, {"w": "into", "b": [0.4167, 0.5037, 0.4559, 0.5234]}, {"w": "a", "b": [0.4622, 0.5037, 0.4734, 0.5234]}, {"w": "network.", "b": [0.4797, 0.5037, 0.5687, 0.5234]}, {"w": "The", "b": [0.1799, 0.5242, 0.2191, 0.5439]}, {"w": "loss", "b": [0.2254, 0.5242, 0.2646, 0.5439]}, {"w": "is", "b": [0.2709, 0.5242, 0.2878, 0.5439]}, {"w": "the", "b": [0.2941, 0.5242, 0.3249, 0.5439]}, {"w": "quantity", "b": [0.3312, 0.5242, 0.4139, 0.5439]}, {"w": "you’ll", "b": [0.4202, 0.5242, 0.4805, 0.5439]}, {"w": "attempt", "b": [0.4868, 0.5242, 0.5624, 0.5439]}, {"w": "to", "b": [0.5687, 0.5242, 0.5884, 0.5439]}, {"w": "minimize", "b": [0.5947, 0.5242, 0.69, 0.5439]}, {"w": "during", "b": [0.6963, 0.5242, 0.7622, 0.5439]}, {"w": "training,", "b": [0.7685, 0.5242, 0.8532, 0.5439]}, {"w": "so", "b": [0.1799, 0.5447, 0.2023, 0.5644]}, {"w": "it", "b": [0.2086, 0.5447, 0.2226, 0.5644]}, {"w": "should", "b": [0.2289, 0.5447, 0.2962, 0.5644]}, {"w": "represent", "b": [0.3025, 0.5447, 0.395, 0.5644]}, {"w": "a", "b": [0.4013, 0.5447, 0.4125, 0.5644]}, {"w": "measure", "b": [0.4188, 0.5447, 0.5028, 0.5644]}, {"w": "of", "b": [0.5091, 0.5447, 0.5301, 0.5644]}, {"w": "success", "b": [0.5365, 0.5447, 0.6121, 0.5644]}, {"w": "for", "b": [0.6184, 0.5447, 0.6478, 0.5644]}, {"w": "the", "b": [0.6541, 0.5447, 0.685, 0.5644]}, {"w": "task", "b": [0.6913, 0.5447, 0.7319, 0.5644]}, {"w": "you’re", "b": [0.7382, 0.5447, 0.804, 0.5644]}, {"w": "trying", "b": [0.8103, 0.5447, 0.8706, 0.5644]}, {"w": "to", "b": [0.1799, 0.5652, 0.1995, 0.5849]}, {"w": "solve.", "b": [0.2058, 0.5652, 0.2654, 0.5849]}, {"w": "The", "b": [0.1799, 0.5857, 0.2191, 0.6054]}, {"w": "optimizer", "b": [0.2254, 0.5857, 0.3207, 0.6054]}, {"w": "specifies", "b": [0.327, 0.5857, 0.4152, 0.6054]}, {"w": "the", "b": [0.4216, 0.5857, 0.4524, 0.6054]}, {"w": "exact", "b": [0.4587, 0.5857, 0.5119, 0.6054]}, {"w": "way", "b": [0.5182, 0.5857, 0.5602, 0.6054]}, {"w": "in", "b": [0.5666, 0.5857, 0.5862, 0.6054]}, {"w": "which", "b": [0.5925, 0.5857, 0.6541, 0.6054]}, {"w": "the", "b": [0.6604, 0.5857, 0.6913, 0.6054]}, {"w": "gradient", "b": [0.6976, 0.5857, 0.7802, 0.6054]}, {"w": "of", "b": [0.7865, 0.5857, 0.8076, 0.6054]}, {"w": "the", "b": [0.8139, 0.5857, 0.8447, 0.6054]}, {"w": "loss", "b": [0.1799, 0.6062, 0.2191, 0.6259]}, {"w": "will", "b": [0.2254, 0.6062, 0.2647, 0.6259]}, {"w": "be", "b": [0.271, 0.6062, 0.2948, 0.6259]}, {"w": "used", "b": [0.3011, 0.6062, 0.3473, 0.6259]}, {"w": "to", "b": [0.3536, 0.6062, 0.3733, 0.6259]}, {"w": "update", "b": [0.3796, 0.6062, 0.4468, 0.6259]}, {"w": "parameters:", "b": [0.4531, 0.6062, 0.5708, 0.6259]}, {"w": "for", "b": [0.5771, 0.6062, 0.6065, 0.6259]}, {"w": "instance,", "b": [0.6128, 0.6062, 0.7018, 0.6259]}, {"w": "it", "b": [0.7081, 0.6062, 0.7221, 0.6259]}, {"w": "could", "b": [0.7284, 0.6062, 0.7845, 0.6259]}, {"w": "be", "b": [0.7908, 0.6062, 0.8146, 0.6259]}, {"w": "the", "b": [0.8209, 0.6062, 0.8518, 0.6259]}, {"w": "RMSProp", "b": [0.1799, 0.6267, 0.2808, 0.6464]}, {"w": "optimizer,", "b": [0.2871, 0.6267, 0.3891, 0.6464]}, {"w": "SGD", "b": [0.3954, 0.6267, 0.4458, 0.6464]}, {"w": "with", "b": [0.4521, 0.6267, 0.497, 0.6464]}, {"w": "momentum,", "b": [0.5033, 0.6267, 0.6245, 0.6464]}, {"w": "and", "b": [0.6308, 0.6267, 0.6673, 0.6464]}, {"w": "so", "b": [0.6736, 0.6267, 0.696, 0.6464]}, {"w": "on.", "b": [0.7023, 0.6267, 0.7338, 0.6464]}]}]}, {"page": 94, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 3. Getting started with neural networks", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "3.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Getting", "b": [0.3011, 0.1076, 0.4162, 0.1355]}, {"w": "started", "b": [0.4251, 0.1076, 0.5323, 0.1355]}, {"w": "with", "b": [0.5412, 0.1076, 0.6087, 0.1355]}, {"w": "neural", "b": [0.6176, 0.1076, 0.7169, 0.1355]}, {"w": "networks", "b": [0.7258, 0.1076, 0.8668, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1729, 0.1785]}, {"w": "chapter", "b": [0.1792, 0.1588, 0.2562, 0.1785]}, {"w": "covers", "b": [0.2626, 0.1588, 0.3284, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Core components of neural networks An introduction to Keras Setting up a deep-learning workstation Using neural networks to solve basic classification and regression problems", "words": [{"w": "Core", "b": [0.1799, 0.1971, 0.2289, 0.2168]}, {"w": "components", "b": [0.2352, 0.1971, 0.3571, 0.2168]}, {"w": "of", "b": [0.3634, 0.1971, 0.3844, 0.2168]}, {"w": "neural", "b": [0.3908, 0.1971, 0.4538, 0.2168]}, {"w": "networks", "b": [0.4601, 0.1971, 0.5526, 0.2168]}, {"w": "An", "b": [0.1799, 0.2176, 0.2107, 0.2373]}, {"w": "introduction", "b": [0.217, 0.2176, 0.3403, 0.2373]}, {"w": "to", "b": [0.3466, 0.2176, 0.3663, 0.2373]}, {"w": "Keras", "b": [0.3726, 0.2176, 0.4314, 0.2373]}, {"w": "Setting", "b": [0.1799, 0.2381, 0.2514, 0.2578]}, {"w": "up", "b": [0.2577, 0.2381, 0.2829, 0.2578]}, {"w": "a", "b": [0.2892, 0.2381, 0.3004, 0.2578]}, {"w": "deep-learning", "b": [0.3067, 0.2381, 0.4454, 0.2578]}, {"w": "workstation", "b": [0.4517, 0.2381, 0.5708, 0.2578]}, {"w": "Using", "b": [0.1799, 0.2586, 0.2401, 0.2783]}, {"w": "neural", "b": [0.2464, 0.2586, 0.3095, 0.2783]}, {"w": "networks", "b": [0.3158, 0.2586, 0.4083, 0.2783]}, {"w": "to", "b": [0.4146, 0.2586, 0.4342, 0.2783]}, {"w": "solve", "b": [0.4405, 0.2586, 0.4937, 0.2783]}, {"w": "basic", "b": [0.5001, 0.2586, 0.5519, 0.2783]}, {"w": "classification", "b": [0.5582, 0.2586, 0.6913, 0.2783]}, {"w": "and", "b": [0.6976, 0.2586, 0.734, 0.2783]}, {"w": "regression", "b": [0.7404, 0.2586, 0.844, 0.2783]}, {"w": "problems", "b": [0.1799, 0.2791, 0.2738, 0.2988]}]}, {"id": "b_3", "type": "paragraph", "text": "This chapter is designed to get you started with using neural networks to solve real problems. You’ll consolidate the knowledge you gained from our first practical example in chapter 2, and you’ll apply what you’ve learned to three new problems covering the three most common use cases of neural networks: binary classification, multiclass classification, and scalar regression.", "words": [{"w": "This", "b": [0.1294, 0.3219, 0.1743, 0.3416]}, {"w": "chapter", "b": [0.1806, 0.3219, 0.2548, 0.3416]}, {"w": "is", "b": [0.2611, 0.3219, 0.2779, 0.3416]}, {"w": "designed", "b": [0.2842, 0.3219, 0.3739, 0.3416]}, {"w": "to", "b": [0.3802, 0.3219, 0.3999, 0.3416]}, {"w": "get", "b": [0.4062, 0.3219, 0.437, 0.3416]}, {"w": "you", "b": [0.4433, 0.3219, 0.4811, 0.3416]}, {"w": "started", "b": [0.4874, 0.3219, 0.5547, 0.3416]}, {"w": "with", "b": [0.561, 0.3219, 0.6059, 0.3416]}, {"w": "using", "b": [0.6122, 0.3219, 0.6668, 0.3416]}, {"w": "neural", "b": [0.6731, 0.3219, 0.7362, 0.3416]}, {"w": "networks", "b": [0.7425, 0.3219, 0.835, 0.3416]}, {"w": "to", "b": [0.8413, 0.3219, 0.8609, 0.3416]}, {"w": "solve", "b": [0.1294, 0.3424, 0.1827, 0.3621]}, {"w": "real", "b": [0.189, 0.3424, 0.2268, 0.3621]}, {"w": "problems.", "b": [0.2331, 0.3424, 0.3333, 0.3621]}, {"w": "You’ll", "b": [0.3396, 0.3424, 0.4029, 0.3621]}, {"w": "consolidate", "b": [0.4092, 0.3424, 0.5241, 0.3621]}, {"w": "the", "b": [0.5304, 0.3424, 0.5613, 0.3621]}, {"w": "knowledge", "b": [0.5676, 0.3424, 0.6783, 0.3621]}, {"w": "you", "b": [0.6845, 0.3424, 0.7223, 0.3621]}, {"w": "gained", "b": [0.7286, 0.3424, 0.7959, 0.3621]}, {"w": "from", "b": [0.8022, 0.3424, 0.8512, 0.3621]}, {"w": "our", "b": [0.1294, 0.3629, 0.163, 0.3826]}, {"w": "first", "b": [0.1693, 0.3629, 0.21, 0.3826]}, {"w": "practical", "b": [0.2163, 0.3629, 0.3031, 0.3826]}, {"w": "example", "b": [0.3094, 0.3629, 0.3949, 0.3826]}, {"w": "in", "b": [0.4012, 0.3629, 0.4208, 0.3826]}, {"w": "chapter", "b": [0.4271, 0.3629, 0.5013, 0.3826]}, {"w": "2,", "b": [0.5076, 0.3629, 0.5265, 0.3826]}, {"w": "and", "b": [0.5328, 0.3629, 0.5693, 0.3826]}, {"w": "you’ll", "b": [0.5756, 0.3629, 0.6358, 0.3826]}, {"w": "apply", "b": [0.6422, 0.3629, 0.6982, 0.3826]}, {"w": "what", "b": [0.7045, 0.3629, 0.7535, 0.3826]}, {"w": "you’ve", "b": [0.7599, 0.3629, 0.8299, 0.3826]}, {"w": "learned", "b": [0.1294, 0.3834, 0.2037, 0.4031]}, {"w": "to", "b": [0.21, 0.3834, 0.2296, 0.4031]}, {"w": "three", "b": [0.2359, 0.3834, 0.2863, 0.4031]}, {"w": "new", "b": [0.2926, 0.3834, 0.3346, 0.4031]}, {"w": "problems", "b": [0.341, 0.3834, 0.4348, 0.4031]}, {"w": "covering", "b": [0.4412, 0.3834, 0.5294, 0.4031]}, {"w": "the", "b": [0.5357, 0.3834, 0.5665, 0.4031]}, {"w": "three", "b": [0.5729, 0.3834, 0.6233, 0.4031]}, {"w": "most", "b": [0.6296, 0.3834, 0.6787, 0.4031]}, {"w": "common", "b": [0.685, 0.3834, 0.7732, 0.4031]}, {"w": "use", "b": [0.7796, 0.3834, 0.8132, 0.4031]}, {"w": "cases", "b": [0.1294, 0.4039, 0.1826, 0.4236]}, {"w": "of", "b": [0.1889, 0.4039, 0.21, 0.4236]}, {"w": "neural", "b": [0.2163, 0.4039, 0.2793, 0.4236]}, {"w": "networks:", "b": [0.2856, 0.4039, 0.3851, 0.4236]}, {"w": "binary", "b": [0.3914, 0.4039, 0.4558, 0.4236]}, {"w": "classification,", "b": [0.4621, 0.4039, 0.6016, 0.4236]}, {"w": "multiclass", "b": [0.6079, 0.4039, 0.7102, 0.4236]}, {"w": "classification,", "b": [0.7165, 0.4039, 0.8559, 0.4236]}, {"w": "and", "b": [0.1294, 0.4244, 0.1658, 0.4441]}, {"w": "scalar", "b": [0.1721, 0.4244, 0.231, 0.4441]}, {"w": "regression.", "b": [0.2373, 0.4244, 0.3473, 0.4441]}]}, {"id": "b_4", "type": "paragraph", "text": "In this chapter, we’ll take a closer look at the core components of neural networks that we introduced in chapter 2: layers, networks, objective functions, and optimizers. We’ll give you a quick introduction to Keras, the Python deep-learning library that we’ll use throughout the book. You’ll set up a deep-learning workstation, with TensorFlow, Keras, and GPU support. We’ll dive into three introductory examples of how to use neural networks to address real problems:", "words": [{"w": "In", "b": [0.1294, 0.4672, 0.1504, 0.4869]}, {"w": "this", "b": [0.1567, 0.4672, 0.1932, 0.4869]}, {"w": "chapter,", "b": [0.1995, 0.4672, 0.279, 0.4869]}, {"w": "we’ll", "b": [0.2853, 0.4672, 0.3372, 0.4869]}, {"w": "take", "b": [0.3435, 0.4672, 0.3855, 0.4869]}, {"w": "a", "b": [0.3918, 0.4672, 0.403, 0.4869]}, {"w": "closer", "b": [0.4093, 0.4672, 0.4695, 0.4869]}, {"w": "look", "b": [0.4758, 0.4672, 0.5207, 0.4869]}, {"w": "at", "b": [0.527, 0.4672, 0.5452, 0.4869]}, {"w": "the", "b": [0.5515, 0.4672, 0.5823, 0.4869]}, {"w": "core", "b": [0.5887, 0.4672, 0.6321, 0.4869]}, {"w": "components", "b": [0.6384, 0.4672, 0.7603, 0.4869]}, {"w": "of", "b": [0.7666, 0.4672, 0.7876, 0.4869]}, {"w": "neural", "b": [0.7939, 0.4672, 0.857, 0.4869]}, {"w": "networks", "b": [0.1294, 0.4877, 0.2219, 0.5074]}, {"w": "that", "b": [0.2282, 0.4877, 0.266, 0.5074]}, {"w": "we", "b": [0.2723, 0.4877, 0.3018, 0.5074]}, {"w": "introduced", "b": [0.3081, 0.4877, 0.416, 0.5074]}, {"w": "in", "b": [0.4223, 0.4877, 0.4419, 0.5074]}, {"w": "chapter", "b": [0.4481, 0.4877, 0.5224, 0.5074]}, {"w": "2:", "b": [0.5287, 0.4877, 0.5483, 0.5074]}, {"w": "layers,", "b": [0.5546, 0.4877, 0.6211, 0.5074]}, {"w": "networks,", "b": [0.6275, 0.4877, 0.7262, 0.5074]}, {"w": "objective", "b": [0.7325, 0.4877, 0.825, 0.5074]}, {"w": "functions,", "b": [0.1294, 0.5082, 0.2296, 0.5279]}, {"w": "and", "b": [0.2359, 0.5082, 0.2723, 0.5279]}, {"w": "optimizers.", "b": [0.2786, 0.5082, 0.3915, 0.5279]}, {"w": "We’ll", "b": [0.3978, 0.5082, 0.4531, 0.5279]}, {"w": "give", "b": [0.4595, 0.5082, 0.5029, 0.5279]}, {"w": "you", "b": [0.5092, 0.5082, 0.547, 0.5279]}, {"w": "a", "b": [0.5533, 0.5082, 0.5645, 0.5279]}, {"w": "quick", "b": [0.5708, 0.5082, 0.6269, 0.5279]}, {"w": "introduction", "b": [0.6332, 0.5082, 0.7565, 0.5279]}, {"w": "to", "b": [0.7628, 0.5082, 0.7825, 0.5279]}, {"w": "Keras,", "b": [0.7888, 0.5082, 0.8539, 0.5279]}, {"w": "the", "b": [0.1294, 0.5287, 0.1602, 0.5484]}, {"w": "Python", "b": [0.1665, 0.5287, 0.238, 0.5484]}, {"w": "deep-learning", "b": [0.2443, 0.5287, 0.383, 0.5484]}, {"w": "library", "b": [0.3893, 0.5287, 0.4565, 0.5484]}, {"w": "that", "b": [0.4629, 0.5287, 0.5007, 0.5484]}, {"w": "we’ll", "b": [0.507, 0.5287, 0.5588, 0.5484]}, {"w": "use", "b": [0.5651, 0.5287, 0.5988, 0.5484]}, {"w": "throughout", "b": [0.6051, 0.5287, 0.7158, 0.5484]}, {"w": "the", "b": [0.7221, 0.5287, 0.7529, 0.5484]}, {"w": "book.", "b": [0.7592, 0.5287, 0.816, 0.5484]}, {"w": "You’ll", "b": [0.1294, 0.5492, 0.1928, 0.5689]}, {"w": "set", "b": [0.1991, 0.5492, 0.2271, 0.5689]}, {"w": "up", "b": [0.2334, 0.5492, 0.2586, 0.5689]}, {"w": "a", "b": [0.2649, 0.5492, 0.2761, 0.5689]}, {"w": "deep-learning", "b": [0.2824, 0.5492, 0.4211, 0.5689]}, {"w": "workstation,", "b": [0.4274, 0.5492, 0.5529, 0.5689]}, {"w": "with", "b": [0.5592, 0.5492, 0.604, 0.5689]}, {"w": "TensorFlow,", "b": [0.6103, 0.5492, 0.7351, 0.5689]}, {"w": "Keras,", "b": [0.7414, 0.5492, 0.8065, 0.5689]}, {"w": "and", "b": [0.8128, 0.5492, 0.8493, 0.5689]}, {"w": "GPU", "b": [0.1294, 0.5697, 0.1799, 0.5894]}, {"w": "support.", "b": [0.1862, 0.5697, 0.2682, 0.5894]}, {"w": "We’ll", "b": [0.2745, 0.5697, 0.3299, 0.5894]}, {"w": "dive", "b": [0.3362, 0.5697, 0.3796, 0.5894]}, {"w": "into", "b": [0.3859, 0.5697, 0.4252, 0.5894]}, {"w": "three", "b": [0.4315, 0.5697, 0.4819, 0.5894]}, {"w": "introductory", "b": [0.4882, 0.5697, 0.6129, 0.5894]}, {"w": "examples", "b": [0.6192, 0.5697, 0.7145, 0.5894]}, {"w": "of", "b": [0.7208, 0.5697, 0.7418, 0.5894]}, {"w": "how", "b": [0.7481, 0.5697, 0.7916, 0.5894]}, {"w": "to", "b": [0.7979, 0.5697, 0.8175, 0.5894]}, {"w": "use", "b": [0.8238, 0.5697, 0.8574, 0.5894]}, {"w": "neural", "b": [0.1294, 0.5902, 0.1925, 0.6099]}, {"w": "networks", "b": [0.1988, 0.5902, 0.2912, 0.6099]}, {"w": "to", "b": [0.2975, 0.5902, 0.3172, 0.6099]}, {"w": "address", "b": [0.3235, 0.5902, 0.3991, 0.6099]}, {"w": "real", "b": [0.4054, 0.5902, 0.4432, 0.6099]}, {"w": "problems:", "b": [0.4496, 0.5902, 0.5505, 0.6099]}]}, {"id": "b_5", "type": "paragraph", "text": "Classifying movie reviews as positive or negative (binary classification) Classifying news wires by topic (multiclass classification) Estimating the price of a house, given real-estate data (regression)", "words": [{"w": "Classifying", "b": [0.1799, 0.6285, 0.2948, 0.6482]}, {"w": "movie", "b": [0.3011, 0.6285, 0.3642, 0.6482]}, {"w": "reviews", "b": [0.3705, 0.6285, 0.4489, 0.6482]}, {"w": "as", "b": [0.4552, 0.6285, 0.4762, 0.6482]}, {"w": "positive", "b": [0.4825, 0.6285, 0.5624, 0.6482]}, {"w": "or", "b": [0.5687, 0.6285, 0.5898, 0.6482]}, {"w": "negative", "b": [0.5961, 0.6285, 0.6815, 0.6482]}, {"w": "(binary", "b": [0.6878, 0.6285, 0.7607, 0.6482]}, {"w": "classification)", "b": [0.1799, 0.649, 0.3214, 0.6687]}, {"w": "Classifying", "b": [0.1799, 0.6695, 0.2948, 0.6892]}, {"w": "news", "b": [0.3011, 0.6695, 0.3529, 0.6892]}, {"w": "wires", "b": [0.3592, 0.6695, 0.4139, 0.6892]}, {"w": "by", "b": [0.4202, 0.6695, 0.4454, 0.6892]}, {"w": "topic", "b": [0.4517, 0.6695, 0.5022, 0.6892]}, {"w": "(multiclass", "b": [0.5085, 0.6695, 0.6192, 0.6892]}, {"w": "classification)", "b": [0.6255, 0.6695, 0.767, 0.6892]}, {"w": "Estimating", "b": [0.1799, 0.69, 0.2892, 0.7097]}, {"w": "the", "b": [0.2955, 0.69, 0.3263, 0.7097]}, {"w": "price", "b": [0.3326, 0.69, 0.3831, 0.7097]}, {"w": "of", "b": [0.3894, 0.69, 0.4104, 0.7097]}, {"w": "a", "b": [0.4167, 0.69, 0.4279, 0.7097]}, {"w": "house,", "b": [0.4342, 0.69, 0.4993, 0.7097]}, {"w": "given", "b": [0.5057, 0.69, 0.5617, 0.7097]}, {"w": "real-estate", "b": [0.568, 0.69, 0.6717, 0.7097]}, {"w": "data", "b": [0.678, 0.69, 0.72, 0.7097]}, {"w": "(regression)", "b": [0.7263, 0.69, 0.8468, 0.7097]}]}, {"id": "b_6", "type": "paragraph", "text": "By the end of this chapter, you’ll be able to use neural networks to solve simple machine problems such as classification and regression over vector data. You’ll then be ready to start building a more principled, theory-driven understanding of machine learning in chapter 4.", "words": [{"w": "By", "b": [0.1294, 0.7328, 0.1589, 0.7525]}, {"w": "the", "b": [0.1652, 0.7328, 0.196, 0.7525]}, {"w": "end", "b": [0.2023, 0.7328, 0.2387, 0.7525]}, {"w": "of", "b": [0.245, 0.7328, 0.266, 0.7525]}, {"w": "this", "b": [0.2723, 0.7328, 0.3088, 0.7525]}, {"w": "chapter,", "b": [0.3151, 0.7328, 0.3946, 0.7525]}, {"w": "you’ll", "b": [0.4009, 0.7328, 0.4612, 0.7525]}, {"w": "be", "b": [0.4675, 0.7328, 0.4913, 0.7525]}, {"w": "able", "b": [0.4976, 0.7328, 0.5396, 0.7525]}, {"w": "to", "b": [0.5459, 0.7328, 0.5656, 0.7525]}, {"w": "use", "b": [0.5719, 0.7328, 0.6055, 0.7525]}, {"w": "neural", "b": [0.6118, 0.7328, 0.6748, 0.7525]}, {"w": "networks", "b": [0.6811, 0.7328, 0.7736, 0.7525]}, {"w": "to", "b": [0.7799, 0.7328, 0.7996, 0.7525]}, {"w": "solve", "b": [0.8059, 0.7328, 0.8591, 0.7525]}, {"w": "simple", "b": [0.1294, 0.7533, 0.1967, 0.773]}, {"w": "machine", "b": [0.203, 0.7533, 0.2885, 0.773]}, {"w": "problems", "b": [0.2948, 0.7533, 0.3887, 0.773]}, {"w": "such", "b": [0.395, 0.7533, 0.4412, 0.773]}, {"w": "as", "b": [0.4475, 0.7533, 0.4685, 0.773]}, {"w": "classification", "b": [0.4748, 0.7533, 0.6079, 0.773]}, {"w": "and", "b": [0.6142, 0.7533, 0.6506, 0.773]}, {"w": "regression", "b": [0.6569, 0.7533, 0.7606, 0.773]}, {"w": "over", "b": [0.7669, 0.7533, 0.8117, 0.773]}, {"w": "vector", "b": [0.1294, 0.7738, 0.1925, 0.7935]}, {"w": "data.", "b": [0.1988, 0.7738, 0.2471, 0.7935]}, {"w": "You’ll", "b": [0.2534, 0.7738, 0.3167, 0.7935]}, {"w": "then", "b": [0.323, 0.7738, 0.3665, 0.7935]}, {"w": "be", "b": [0.3728, 0.7738, 0.3966, 0.7935]}, {"w": "ready", "b": [0.4029, 0.7738, 0.4589, 0.7935]}, {"w": "to", "b": [0.4652, 0.7738, 0.4848, 0.7935]}, {"w": "start", "b": [0.4912, 0.7738, 0.5346, 0.7935]}, {"w": "building", "b": [0.5409, 0.7738, 0.625, 0.7935]}, {"w": "a", "b": [0.6313, 0.7738, 0.6425, 0.7935]}, {"w": "more", "b": [0.6488, 0.7738, 0.7007, 0.7935]}, {"w": "principled,", "b": [0.707, 0.7738, 0.8156, 0.7935]}, {"w": "theory-driven", "b": [0.1294, 0.7943, 0.2667, 0.814]}, {"w": "understanding", "b": [0.273, 0.7943, 0.416, 0.814]}, {"w": "of", "b": [0.4223, 0.7943, 0.4433, 0.814]}, {"w": "machine", "b": [0.4495, 0.7943, 0.535, 0.814]}, {"w": "learning", "b": [0.5413, 0.7943, 0.624, 0.814]}, {"w": "in", "b": [0.6303, 0.7943, 0.6499, 0.814]}, {"w": "chapter", "b": [0.6562, 0.7943, 0.7304, 0.814]}, {"w": "4.", "b": [0.7367, 0.7943, 0.7556, 0.814]}]}, {"id": "b_7", "type": "paragraph", "text": "3.1. Anatomy of a neural network", "words": [{"w": "3.1.", "b": [0.1294, 0.8511, 0.172, 0.8733]}, {"w": "Anatomy", "b": [0.1791, 0.8511, 0.291, 0.8733]}, {"w": "of", "b": [0.2981, 0.8511, 0.3217, 0.8733]}, {"w": "a", "b": [0.3288, 0.8511, 0.343, 0.8733]}, {"w": "neural", "b": [0.3501, 0.8511, 0.429, 0.8733]}, {"w": "network", "b": [0.436, 0.8511, 0.5369, 0.8733]}]}]}, {"page": 95, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As you saw in the previous chapters, training a neural network revolves around the following objects:", "words": [{"w": "As", "b": [0.1294, 0.0857, 0.1574, 0.1054]}, {"w": "you", "b": [0.1637, 0.0857, 0.2016, 0.1054]}, {"w": "saw", "b": [0.2079, 0.0857, 0.2471, 0.1054]}, {"w": "in", "b": [0.2534, 0.0857, 0.273, 0.1054]}, {"w": "the", "b": [0.2794, 0.0857, 0.3102, 0.1054]}, {"w": "previous", "b": [0.3165, 0.0857, 0.4034, 0.1054]}, {"w": "chapters,", "b": [0.4097, 0.0857, 0.5, 0.1054]}, {"w": "training", "b": [0.5063, 0.0857, 0.5848, 0.1054]}, {"w": "a", "b": [0.5911, 0.0857, 0.6023, 0.1054]}, {"w": "neural", "b": [0.6086, 0.0857, 0.6717, 0.1054]}, {"w": "network", "b": [0.678, 0.0857, 0.7606, 0.1054]}, {"w": "revolves", "b": [0.7669, 0.0857, 0.8524, 0.1054]}, {"w": "around", "b": [0.1294, 0.1062, 0.1995, 0.1259]}, {"w": "the", "b": [0.2058, 0.1062, 0.2366, 0.1259]}, {"w": "following", "b": [0.2429, 0.1062, 0.341, 0.1259]}, {"w": "objects:", "b": [0.3473, 0.1062, 0.4258, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Layers, which are combined into a network (or model) The input data and corresponding targets The loss function, which defines the feedback signal used for learning The optimizer, which determines how learning proceeds", "words": [{"w": "Layers,", "b": [0.1799, 0.1445, 0.2548, 0.1642]}, {"w": "which", "b": [0.2611, 0.1445, 0.3228, 0.1642]}, {"w": "are", "b": [0.3291, 0.1445, 0.3599, 0.1642]}, {"w": "combined", "b": [0.3662, 0.1445, 0.4657, 0.1642]}, {"w": "into", "b": [0.472, 0.1445, 0.5113, 0.1642]}, {"w": "a", "b": [0.5176, 0.1445, 0.5288, 0.1642]}, {"w": "network", "b": [0.535, 0.1445, 0.6163, 0.1642]}, {"w": "(or", "b": [0.6226, 0.1445, 0.652, 0.1642]}, {"w": "model)", "b": [0.6583, 0.1445, 0.7283, 0.1642]}, {"w": "The", "b": [0.1799, 0.165, 0.2191, 0.1847]}, {"w": "input", "b": [0.2254, 0.165, 0.2773, 0.1847]}, {"w": "data", "b": [0.2836, 0.165, 0.3284, 0.1847]}, {"w": "and", "b": [0.3347, 0.165, 0.3711, 0.1847]}, {"w": "corresponding", "b": [0.3774, 0.165, 0.5217, 0.1847]}, {"w": "targets", "b": [0.528, 0.165, 0.5972, 0.1847]}, {"w": "The", "b": [0.1799, 0.1855, 0.2191, 0.2052]}, {"w": "loss", "b": [0.2254, 0.1855, 0.2646, 0.2052]}, {"w": "function,", "b": [0.2709, 0.1855, 0.3599, 0.2052]}, {"w": "which", "b": [0.3662, 0.1855, 0.4279, 0.2052]}, {"w": "defines", "b": [0.4342, 0.1855, 0.507, 0.2052]}, {"w": "the", "b": [0.5133, 0.1855, 0.5442, 0.2052]}, {"w": "feedback", "b": [0.5505, 0.1855, 0.6415, 0.2052]}, {"w": "signal", "b": [0.6478, 0.1855, 0.7081, 0.2052]}, {"w": "used", "b": [0.7144, 0.1855, 0.7606, 0.2052]}, {"w": "for", "b": [0.7669, 0.1855, 0.7963, 0.2052]}, {"w": "learning", "b": [0.1799, 0.206, 0.2625, 0.2257]}, {"w": "The", "b": [0.1799, 0.2265, 0.2191, 0.2462]}, {"w": "optimizer,", "b": [0.2254, 0.2265, 0.327, 0.2462]}, {"w": "which", "b": [0.3333, 0.2265, 0.3949, 0.2462]}, {"w": "determines", "b": [0.4012, 0.2265, 0.5119, 0.2462]}, {"w": "how", "b": [0.5182, 0.2265, 0.5617, 0.2462]}, {"w": "learning", "b": [0.568, 0.2265, 0.6507, 0.2462]}, {"w": "proceeds", "b": [0.657, 0.2265, 0.7466, 0.2462]}]}, {"id": "b_2", "type": "paragraph", "text": "You can visualize their interaction as illustrated in figure 3.1: the network, composed of layers that are chained together, maps the input data to predictions. The loss function then compares these predictions to the targets, producing a loss value: a measure of how well the network’s predictions match what was expected. The optimizer uses this loss value to update the network’s weights.", "words": [{"w": "You", "b": [0.1294, 0.2693, 0.1703, 0.289]}, {"w": "can", "b": [0.1766, 0.2693, 0.2116, 0.289]}, {"w": "visualize", "b": [0.218, 0.2693, 0.3076, 0.289]}, {"w": "their", "b": [0.3139, 0.2693, 0.3602, 0.289]}, {"w": "interaction", "b": [0.3665, 0.2693, 0.4744, 0.289]}, {"w": "as", "b": [0.4807, 0.2693, 0.5017, 0.289]}, {"w": "illustrated", "b": [0.508, 0.2693, 0.6089, 0.289]}, {"w": "in", "b": [0.6152, 0.2693, 0.6348, 0.289]}, {"w": "figure", "b": [0.641, 0.2693, 0.7013, 0.289]}, {"w": "3.1:", "b": [0.7076, 0.2693, 0.7461, 0.289]}, {"w": "the", "b": [0.7524, 0.2693, 0.7833, 0.289]}, {"w": "network,", "b": [0.1294, 0.2898, 0.2184, 0.3095]}, {"w": "composed", "b": [0.2247, 0.2898, 0.327, 0.3095]}, {"w": "of", "b": [0.3333, 0.2898, 0.3543, 0.3095]}, {"w": "layers", "b": [0.3606, 0.2898, 0.4208, 0.3095]}, {"w": "that", "b": [0.4272, 0.2898, 0.465, 0.3095]}, {"w": "are", "b": [0.4713, 0.2898, 0.5021, 0.3095]}, {"w": "chained", "b": [0.5084, 0.2898, 0.5869, 0.3095]}, {"w": "together,", "b": [0.5932, 0.2898, 0.6811, 0.3095]}, {"w": "maps", "b": [0.6874, 0.2898, 0.7406, 0.3095]}, {"w": "the", "b": [0.7469, 0.2898, 0.7777, 0.3095]}, {"w": "input", "b": [0.784, 0.2898, 0.8359, 0.3095]}, {"w": "data", "b": [0.1294, 0.3103, 0.1714, 0.33]}, {"w": "to", "b": [0.1777, 0.3103, 0.1974, 0.33]}, {"w": "predictions.", "b": [0.2037, 0.3103, 0.3221, 0.33]}, {"w": "The", "b": [0.3284, 0.3103, 0.3676, 0.33]}, {"w": "loss", "b": [0.3739, 0.3103, 0.4132, 0.33]}, {"w": "function", "b": [0.4195, 0.3103, 0.5036, 0.33]}, {"w": "then", "b": [0.5099, 0.3103, 0.5533, 0.33]}, {"w": "compares", "b": [0.5596, 0.3103, 0.6563, 0.33]}, {"w": "these", "b": [0.6625, 0.3103, 0.7143, 0.33]}, {"w": "predictions", "b": [0.7206, 0.3103, 0.8328, 0.33]}, {"w": "to", "b": [0.8391, 0.3103, 0.8587, 0.33]}, {"w": "the", "b": [0.1294, 0.3308, 0.1602, 0.3505]}, {"w": "targets,", "b": [0.1665, 0.3308, 0.2396, 0.3505]}, {"w": "producing", "b": [0.2459, 0.3308, 0.3482, 0.3505]}, {"w": "a", "b": [0.3545, 0.3308, 0.3657, 0.3505]}, {"w": "loss", "b": [0.372, 0.3308, 0.4113, 0.3505]}, {"w": "value:", "b": [0.4176, 0.3308, 0.4793, 0.3505]}, {"w": "a", "b": [0.4856, 0.3308, 0.4968, 0.3505]}, {"w": "measure", "b": [0.5031, 0.3308, 0.5871, 0.3505]}, {"w": "of", "b": [0.5934, 0.3308, 0.6144, 0.3505]}, {"w": "how", "b": [0.6207, 0.3308, 0.6642, 0.3505]}, {"w": "well", "b": [0.6705, 0.3308, 0.7139, 0.3505]}, {"w": "the", "b": [0.7202, 0.3308, 0.7511, 0.3505]}, {"w": "network’s", "b": [0.7574, 0.3308, 0.8568, 0.3505]}, {"w": "predictions", "b": [0.1294, 0.3513, 0.2415, 0.371]}, {"w": "match", "b": [0.2478, 0.3513, 0.3095, 0.371]}, {"w": "what", "b": [0.3158, 0.3513, 0.3648, 0.371]}, {"w": "was", "b": [0.3711, 0.3513, 0.4104, 0.371]}, {"w": "expected.", "b": [0.4167, 0.3513, 0.5126, 0.371]}, {"w": "The", "b": [0.5189, 0.3513, 0.5581, 0.371]}, {"w": "optimizer", "b": [0.5644, 0.3513, 0.6611, 0.371]}, {"w": "uses", "b": [0.6674, 0.3513, 0.7108, 0.371]}, {"w": "this", "b": [0.7171, 0.3513, 0.7536, 0.371]}, {"w": "loss", "b": [0.7599, 0.3513, 0.7991, 0.371]}, {"w": "value", "b": [0.8054, 0.3513, 0.8601, 0.371]}, {"w": "to", "b": [0.1294, 0.3718, 0.149, 0.3915]}, {"w": "update", "b": [0.1553, 0.3718, 0.2226, 0.3915]}, {"w": "the", "b": [0.2289, 0.3718, 0.2597, 0.3915]}, {"w": "network’s", "b": [0.266, 0.3718, 0.3655, 0.3915]}, {"w": "weights.", "b": [0.3718, 0.3718, 0.4566, 0.3915]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 3.1. Relationship between the network, layers, loss function, and optimizer", "words": [{"w": "Figure", "b": [0.1294, 0.4096, 0.1827, 0.4244]}, {"w": "3.1.", "b": [0.1874, 0.4096, 0.2158, 0.4244]}, {"w": "Relationship", "b": [0.2205, 0.4096, 0.3225, 0.4244]}, {"w": "between", "b": [0.3272, 0.4096, 0.3934, 0.4244]}, {"w": "the", "b": [0.3981, 0.4096, 0.4233, 0.4244]}, {"w": "network,", "b": [0.4281, 0.4096, 0.5001, 0.4244]}, {"w": "layers,", "b": [0.5048, 0.4096, 0.5579, 0.4244]}, {"w": "loss", "b": [0.5626, 0.4096, 0.592, 0.4244]}, {"w": "function,", "b": [0.5967, 0.4096, 0.6688, 0.4244]}, {"w": "and", "b": [0.6735, 0.4096, 0.704, 0.4244]}, {"w": "optimizer", "b": [0.7087, 0.4096, 0.7865, 0.4244]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s take a closer look at layers, networks, loss functions, and optimizers.", "words": [{"w": "Let’s", "b": [0.1294, 0.7328, 0.1798, 0.7525]}, {"w": "take", "b": [0.1862, 0.7328, 0.2282, 0.7525]}, {"w": "a", "b": [0.2345, 0.7328, 0.2457, 0.7525]}, {"w": "closer", "b": [0.252, 0.7328, 0.3122, 0.7525]}, {"w": "look", "b": [0.3185, 0.7328, 0.3634, 0.7525]}, {"w": "at", "b": [0.3697, 0.7328, 0.3879, 0.7525]}, {"w": "layers,", "b": [0.3942, 0.7328, 0.4608, 0.7525]}, {"w": "networks,", "b": [0.4671, 0.7328, 0.5659, 0.7525]}, {"w": "loss", "b": [0.5722, 0.7328, 0.6114, 0.7525]}, {"w": "functions,", "b": [0.6177, 0.7328, 0.7179, 0.7525]}, {"w": "and", "b": [0.7242, 0.7328, 0.7606, 0.7525]}, {"w": "optimizers.", "b": [0.1294, 0.7533, 0.2422, 0.773]}]}, {"id": "b_5", "type": "paragraph", "text": "3.1.1. Layers: the building blocks of deep learning", "words": [{"w": "3.1.1.", "b": [0.1294, 0.8005, 0.1862, 0.8203]}, {"w": "Layers:", "b": [0.1925, 0.8005, 0.2751, 0.8203]}, {"w": "the", "b": [0.2814, 0.8005, 0.3151, 0.8203]}, {"w": "building", "b": [0.3214, 0.8005, 0.4111, 0.8203]}, {"w": "blocks", "b": [0.4174, 0.8005, 0.4861, 0.8203]}, {"w": "of", "b": [0.4924, 0.8005, 0.5134, 0.8203]}, {"w": "deep", "b": [0.5198, 0.8005, 0.5702, 0.8203]}, {"w": "learning", "b": [0.5765, 0.8005, 0.6662, 0.8203]}]}, {"id": "b_6", "type": "paragraph", "text": "The fundamental data structure in neural networks is the layer, to which you were introduced in chapter 2. A layer is a data-processing module that takes as input one or more tensors and that outputs one or more", "words": [{"w": "The", "b": [0.1294, 0.8433, 0.1686, 0.863]}, {"w": "fundamental", "b": [0.1749, 0.8433, 0.301, 0.863]}, {"w": "data", "b": [0.3074, 0.8433, 0.3494, 0.863]}, {"w": "structure", "b": [0.3557, 0.8433, 0.444, 0.863]}, {"w": "in", "b": [0.4503, 0.8433, 0.4699, 0.863]}, {"w": "neural", "b": [0.4762, 0.8433, 0.5392, 0.863]}, {"w": "networks", "b": [0.5455, 0.8433, 0.638, 0.863]}, {"w": "is", "b": [0.6443, 0.8433, 0.6611, 0.863]}, {"w": "the", "b": [0.6675, 0.8433, 0.6983, 0.863]}, {"w": "layer,", "b": [0.7045, 0.8433, 0.7626, 0.863]}, {"w": "to", "b": [0.7689, 0.8433, 0.7886, 0.863]}, {"w": "which", "b": [0.7949, 0.8433, 0.8565, 0.863]}, {"w": "you", "b": [0.1294, 0.8638, 0.1673, 0.8835]}, {"w": "were", "b": [0.1736, 0.8638, 0.2226, 0.8835]}, {"w": "introduced", "b": [0.2289, 0.8638, 0.3368, 0.8835]}, {"w": "in", "b": [0.3431, 0.8638, 0.3627, 0.8835]}, {"w": "chapter", "b": [0.369, 0.8638, 0.4432, 0.8835]}, {"w": "2.", "b": [0.4495, 0.8638, 0.4684, 0.8835]}, {"w": "A", "b": [0.4747, 0.8638, 0.4929, 0.8835]}, {"w": "layer", "b": [0.4992, 0.8638, 0.5497, 0.8835]}, {"w": "is", "b": [0.556, 0.8638, 0.5728, 0.8835]}, {"w": "a", "b": [0.5791, 0.8638, 0.5903, 0.8835]}, {"w": "data-processing", "b": [0.5966, 0.8638, 0.7549, 0.8835]}, {"w": "module", "b": [0.7612, 0.8638, 0.8369, 0.8835]}, {"w": "that", "b": [0.1294, 0.8843, 0.1673, 0.904]}, {"w": "takes", "b": [0.1736, 0.8843, 0.2254, 0.904]}, {"w": "as", "b": [0.2317, 0.8843, 0.2527, 0.904]}, {"w": "input", "b": [0.259, 0.8843, 0.3109, 0.904]}, {"w": "one", "b": [0.3172, 0.8843, 0.3536, 0.904]}, {"w": "or", "b": [0.3599, 0.8843, 0.3809, 0.904]}, {"w": "more", "b": [0.3872, 0.8843, 0.4391, 0.904]}, {"w": "tensors", "b": [0.4454, 0.8843, 0.5169, 0.904]}, {"w": "and", "b": [0.5232, 0.8843, 0.5596, 0.904]}, {"w": "that", "b": [0.5659, 0.8843, 0.6037, 0.904]}, {"w": "outputs", "b": [0.61, 0.8843, 0.6843, 0.904]}, {"w": "one", "b": [0.6906, 0.8843, 0.7271, 0.904]}, {"w": "or", "b": [0.7334, 0.8843, 0.7544, 0.904]}, {"w": "more", "b": [0.7607, 0.8843, 0.8125, 0.904]}]}]}, {"page": 96, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "tensors. Some layers are stateless, but more frequently layers have a state: the layer’s weights, one or several tensors learned with stochastic gradient descent, which together contain the network’s knowledge.", "words": [{"w": "tensors.", "b": [0.1294, 0.0857, 0.2072, 0.1054]}, {"w": "Some", "b": [0.2135, 0.0857, 0.271, 0.1054]}, {"w": "layers", "b": [0.2773, 0.0857, 0.3375, 0.1054]}, {"w": "are", "b": [0.3438, 0.0857, 0.3746, 0.1054]}, {"w": "stateless,", "b": [0.3809, 0.0857, 0.4713, 0.1054]}, {"w": "but", "b": [0.4776, 0.0857, 0.5098, 0.1054]}, {"w": "more", "b": [0.5161, 0.0857, 0.568, 0.1054]}, {"w": "frequently", "b": [0.5743, 0.0857, 0.678, 0.1054]}, {"w": "layers", "b": [0.6843, 0.0857, 0.7445, 0.1054]}, {"w": "have", "b": [0.7508, 0.0857, 0.7984, 0.1054]}, {"w": "a", "b": [0.8047, 0.0857, 0.8159, 0.1054]}, {"w": "state:", "b": [0.1294, 0.1062, 0.1827, 0.1259]}, {"w": "the", "b": [0.189, 0.1062, 0.2198, 0.1259]}, {"w": "layer’s", "b": [0.2261, 0.1062, 0.2942, 0.1259]}, {"w": "weights,", "b": [0.3006, 0.1062, 0.3839, 0.1259]}, {"w": "one", "b": [0.3902, 0.1062, 0.4267, 0.1259]}, {"w": "or", "b": [0.433, 0.1062, 0.454, 0.1259]}, {"w": "several", "b": [0.4603, 0.1062, 0.5317, 0.1259]}, {"w": "tensors", "b": [0.538, 0.1062, 0.6095, 0.1259]}, {"w": "learned", "b": [0.6158, 0.1062, 0.6901, 0.1259]}, {"w": "with", "b": [0.6964, 0.1062, 0.7412, 0.1259]}, {"w": "stochastic", "b": [0.7475, 0.1062, 0.847, 0.1259]}, {"w": "gradient", "b": [0.1294, 0.1267, 0.2121, 0.1464]}, {"w": "descent,", "b": [0.2184, 0.1267, 0.3003, 0.1464]}, {"w": "which", "b": [0.3066, 0.1267, 0.3683, 0.1464]}, {"w": "together", "b": [0.3746, 0.1267, 0.4573, 0.1464]}, {"w": "contain", "b": [0.4636, 0.1267, 0.5378, 0.1464]}, {"w": "the", "b": [0.5441, 0.1267, 0.575, 0.1464]}, {"w": "network’s", "b": [0.5813, 0.1267, 0.6807, 0.1464]}, {"w": "knowledge.", "b": [0.687, 0.1267, 0.8012, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "Different layers are appropriate for different tensor formats and different types of data processing. For instance, simple vector data, stored in 2D tensors of shape (samples, features), is often processed by densely connected layers, also called fully connected or dense layers (the Dense class in Keras). Sequence data, stored in 3D tensors of shape (samples, timesteps, features), is typically processed by recurrent layers such as an LSTM layer. Image data, stored in 4D tensors, is usually processed by 2D convolution layers (Conv2D).", "words": [{"w": "Different", "b": [0.1294, 0.1695, 0.2214, 0.1892]}, {"w": "layers", "b": [0.2277, 0.1695, 0.288, 0.1892]}, {"w": "are", "b": [0.2943, 0.1695, 0.3251, 0.1892]}, {"w": "appropriate", "b": [0.3314, 0.1695, 0.4462, 0.1892]}, {"w": "for", "b": [0.4526, 0.1695, 0.482, 0.1892]}, {"w": "different", "b": [0.4883, 0.1695, 0.5746, 0.1892]}, {"w": "tensor", "b": [0.5809, 0.1695, 0.6426, 0.1892]}, {"w": "formats", "b": [0.6489, 0.1695, 0.7259, 0.1892]}, {"w": "and", "b": [0.7323, 0.1695, 0.7687, 0.1892]}, {"w": "different", "b": [0.775, 0.1695, 0.8614, 0.1892]}, {"w": "types", "b": [0.1294, 0.19, 0.1827, 0.2097]}, {"w": "of", "b": [0.189, 0.19, 0.21, 0.2097]}, {"w": "data", "b": [0.2163, 0.19, 0.2583, 0.2097]}, {"w": "processing.", "b": [0.2646, 0.19, 0.3788, 0.2097]}, {"w": "For", "b": [0.3851, 0.19, 0.4202, 0.2097]}, {"w": "instance,", "b": [0.4265, 0.19, 0.5154, 0.2097]}, {"w": "simple", "b": [0.5217, 0.19, 0.589, 0.2097]}, {"w": "vector", "b": [0.5953, 0.19, 0.6583, 0.2097]}, {"w": "data,", "b": [0.6646, 0.19, 0.713, 0.2097]}, {"w": "stored", "b": [0.7193, 0.19, 0.7809, 0.2097]}, {"w": "in", "b": [0.7872, 0.19, 0.8068, 0.2097]}, {"w": "2D", "b": [0.8132, 0.19, 0.844, 0.2097]}, {"w": "tensors", "b": [0.1294, 0.2105, 0.2009, 0.2302]}, {"w": "of", "b": [0.2072, 0.2105, 0.2282, 0.2302]}, {"w": "shape", "b": [0.2345, 0.2105, 0.2919, 0.2302]}, {"w": "(samples,", "b": [0.2982, 0.2115, 0.4344, 0.2317]}, {"w": "features),", "b": [0.4408, 0.2105, 0.5833, 0.2317]}, {"w": "is", "b": [0.5896, 0.2105, 0.6065, 0.2302]}, {"w": "often", "b": [0.6128, 0.2105, 0.6646, 0.2302]}, {"w": "processed", "b": [0.6709, 0.2105, 0.7704, 0.2302]}, {"w": "by", "b": [0.7767, 0.2105, 0.8019, 0.2302]}, {"w": "densely", "b": [0.1294, 0.2319, 0.2051, 0.2516]}, {"w": "connected", "b": [0.2114, 0.2319, 0.3136, 0.2516]}, {"w": "layers,", "b": [0.3199, 0.2319, 0.3865, 0.2516]}, {"w": "also", "b": [0.3928, 0.2319, 0.4334, 0.2516]}, {"w": "called", "b": [0.4397, 0.2319, 0.4999, 0.2516]}, {"w": "fully", "b": [0.5062, 0.2319, 0.5511, 0.2516]}, {"w": "connected", "b": [0.5574, 0.2319, 0.6596, 0.2516]}, {"w": "or", "b": [0.6659, 0.2319, 0.6869, 0.2516]}, {"w": "dense", "b": [0.6932, 0.2319, 0.7506, 0.2516]}, {"w": "layers", "b": [0.7569, 0.2319, 0.8172, 0.2516]}, {"w": "(the", "b": [0.8235, 0.2319, 0.8627, 0.2516]}, {"w": "Dense", "b": [0.1294, 0.2534, 0.2051, 0.2736]}, {"w": "class", "b": [0.2114, 0.2524, 0.2604, 0.2721]}, {"w": "in", "b": [0.2667, 0.2524, 0.2864, 0.2721]}, {"w": "Keras).", "b": [0.2927, 0.2524, 0.3662, 0.2721]}, {"w": "Sequence", "b": [0.3725, 0.2524, 0.4692, 0.2721]}, {"w": "data,", "b": [0.4755, 0.2524, 0.5238, 0.2721]}, {"w": "stored", "b": [0.5301, 0.2524, 0.5918, 0.2721]}, {"w": "in", "b": [0.5981, 0.2524, 0.6177, 0.2721]}, {"w": "3D", "b": [0.624, 0.2524, 0.6548, 0.2721]}, {"w": "tensors", "b": [0.6611, 0.2524, 0.7326, 0.2721]}, {"w": "of", "b": [0.7389, 0.2524, 0.7599, 0.2721]}, {"w": "shape", "b": [0.7662, 0.2524, 0.8237, 0.2721]}, {"w": "(samples,", "b": [0.1294, 0.2748, 0.2656, 0.295]}, {"w": "timesteps,", "b": [0.2808, 0.2748, 0.4321, 0.295]}, {"w": "features),", "b": [0.4473, 0.2737, 0.5898, 0.295]}, {"w": "is", "b": [0.5961, 0.2737, 0.613, 0.2935]}, {"w": "typically", "b": [0.6193, 0.2737, 0.7076, 0.2935]}, {"w": "processed", "b": [0.7139, 0.2737, 0.8133, 0.2935]}, {"w": "by", "b": [0.8196, 0.2737, 0.8449, 0.2935]}, {"w": "recurrent", "b": [0.1294, 0.2951, 0.2228, 0.3149]}, {"w": "layers", "b": [0.2291, 0.2951, 0.2894, 0.3149]}, {"w": "such", "b": [0.2957, 0.2951, 0.3419, 0.3149]}, {"w": "as", "b": [0.3482, 0.2951, 0.3692, 0.3149]}, {"w": "an", "b": [0.3755, 0.2951, 0.3993, 0.3149]}, {"w": "LSTM", "b": [0.4056, 0.2962, 0.4662, 0.3164]}, {"w": "layer.", "b": [0.4725, 0.2951, 0.5278, 0.3149]}, {"w": "Image", "b": [0.5341, 0.2951, 0.5971, 0.3149]}, {"w": "data,", "b": [0.6034, 0.2951, 0.6518, 0.3149]}, {"w": "stored", "b": [0.6581, 0.2951, 0.7197, 0.3149]}, {"w": "in", "b": [0.726, 0.2951, 0.7457, 0.3149]}, {"w": "4D", "b": [0.752, 0.2951, 0.7828, 0.3149]}, {"w": "tensors,", "b": [0.7891, 0.2951, 0.8669, 0.3149]}, {"w": "is", "b": [0.1294, 0.3165, 0.1462, 0.3363]}, {"w": "usually", "b": [0.1525, 0.3165, 0.2254, 0.3363]}, {"w": "processed", "b": [0.2317, 0.3165, 0.3312, 0.3363]}, {"w": "by", "b": [0.3375, 0.3165, 0.3627, 0.3363]}, {"w": "2D", "b": [0.369, 0.3165, 0.3999, 0.3363]}, {"w": "convolution", "b": [0.4062, 0.3165, 0.5267, 0.3363]}, {"w": "layers", "b": [0.533, 0.3165, 0.5932, 0.3363]}, {"w": "(Conv2D).", "b": [0.5995, 0.3165, 0.7134, 0.3378]}]}, {"id": "b_2", "type": "paragraph", "text": "You can think of layers as the LEGO bricks of deep learning, a metaphor that is made explicit by frameworks like Keras. Building deep-learning models in Keras is done by clipping together compatible layers to form useful data-transformation pipelines. The notion of layer compatibility here refers specifically to the fact that every layer will only accept input tensors of a certain shape and will return output tensors of a certain shape. Consider the following example:", "words": [{"w": "You", "b": [0.1294, 0.3602, 0.1703, 0.3799]}, {"w": "can", "b": [0.1766, 0.3602, 0.2116, 0.3799]}, {"w": "think", "b": [0.218, 0.3602, 0.2698, 0.3799]}, {"w": "of", "b": [0.2761, 0.3602, 0.2971, 0.3799]}, {"w": "layers", "b": [0.3034, 0.3602, 0.3637, 0.3799]}, {"w": "as", "b": [0.37, 0.3602, 0.391, 0.3799]}, {"w": "the", "b": [0.3973, 0.3602, 0.4281, 0.3799]}, {"w": "LEGO", "b": [0.4344, 0.3602, 0.5017, 0.3799]}, {"w": "bricks", "b": [0.508, 0.3602, 0.5697, 0.3799]}, {"w": "of", "b": [0.576, 0.3602, 0.597, 0.3799]}, {"w": "deep", "b": [0.6033, 0.3602, 0.6509, 0.3799]}, {"w": "learning,", "b": [0.6572, 0.3602, 0.7462, 0.3799]}, {"w": "a", "b": [0.7525, 0.3602, 0.7637, 0.3799]}, {"w": "metaphor", "b": [0.77, 0.3602, 0.8653, 0.3799]}, {"w": "that", "b": [0.1294, 0.3807, 0.1673, 0.4004]}, {"w": "is", "b": [0.1736, 0.3807, 0.1904, 0.4004]}, {"w": "made", "b": [0.1967, 0.3807, 0.2513, 0.4004]}, {"w": "explicit", "b": [0.2576, 0.3807, 0.3333, 0.4004]}, {"w": "by", "b": [0.3396, 0.3807, 0.3648, 0.4004]}, {"w": "frameworks", "b": [0.3712, 0.3807, 0.4916, 0.4004]}, {"w": "like", "b": [0.4979, 0.3807, 0.5358, 0.4004]}, {"w": "Keras.", "b": [0.5421, 0.3807, 0.6072, 0.4004]}, {"w": "Building", "b": [0.6135, 0.3807, 0.7018, 0.4004]}, {"w": "deep-learning", "b": [0.708, 0.3807, 0.8467, 0.4004]}, {"w": "models", "b": [0.1294, 0.4012, 0.2023, 0.4209]}, {"w": "in", "b": [0.2086, 0.4012, 0.2282, 0.4209]}, {"w": "Keras", "b": [0.2345, 0.4012, 0.2934, 0.4209]}, {"w": "is", "b": [0.2997, 0.4012, 0.3165, 0.4209]}, {"w": "done", "b": [0.3228, 0.4012, 0.3718, 0.4209]}, {"w": "by", "b": [0.3781, 0.4012, 0.4034, 0.4209]}, {"w": "clipping", "b": [0.4097, 0.4012, 0.4924, 0.4209]}, {"w": "together", "b": [0.4987, 0.4012, 0.5813, 0.4209]}, {"w": "compatible", "b": [0.5876, 0.4012, 0.6997, 0.4209]}, {"w": "layers", "b": [0.706, 0.4012, 0.7663, 0.4209]}, {"w": "to", "b": [0.7726, 0.4012, 0.7922, 0.4209]}, {"w": "form", "b": [0.7985, 0.4012, 0.8476, 0.4209]}, {"w": "useful", "b": [0.1294, 0.4217, 0.1911, 0.4414]}, {"w": "data-transformation", "b": [0.1974, 0.4217, 0.3963, 0.4414]}, {"w": "pipelines.", "b": [0.4026, 0.4217, 0.5, 0.4414]}, {"w": "The", "b": [0.5063, 0.4217, 0.5455, 0.4414]}, {"w": "notion", "b": [0.5518, 0.4217, 0.6163, 0.4414]}, {"w": "of", "b": [0.6226, 0.4217, 0.6436, 0.4414]}, {"w": "layer", "b": [0.6499, 0.4217, 0.7017, 0.4414]}, {"w": "compatibility", "b": [0.708, 0.4217, 0.8412, 0.4414]}, {"w": "here", "b": [0.1294, 0.4422, 0.1728, 0.4619]}, {"w": "refers", "b": [0.1791, 0.4422, 0.2365, 0.4619]}, {"w": "specifically", "b": [0.2429, 0.4422, 0.3591, 0.4619]}, {"w": "to", "b": [0.3654, 0.4422, 0.3851, 0.4619]}, {"w": "the", "b": [0.3914, 0.4422, 0.4222, 0.4619]}, {"w": "fact", "b": [0.4285, 0.4422, 0.4663, 0.4619]}, {"w": "that", "b": [0.4726, 0.4422, 0.5105, 0.4619]}, {"w": "every", "b": [0.5168, 0.4422, 0.5728, 0.4619]}, {"w": "layer", "b": [0.5791, 0.4422, 0.6295, 0.4619]}, {"w": "will", "b": [0.6358, 0.4422, 0.6751, 0.4619]}, {"w": "only", "b": [0.6814, 0.4422, 0.7263, 0.4619]}, {"w": "accept", "b": [0.7326, 0.4422, 0.797, 0.4619]}, {"w": "input", "b": [0.8033, 0.4422, 0.8552, 0.4619]}, {"w": "tensors", "b": [0.1294, 0.4627, 0.2009, 0.4824]}, {"w": "of", "b": [0.2072, 0.4627, 0.2282, 0.4824]}, {"w": "a", "b": [0.2345, 0.4627, 0.2457, 0.4824]}, {"w": "certain", "b": [0.252, 0.4627, 0.3206, 0.4824]}, {"w": "shape", "b": [0.327, 0.4627, 0.3844, 0.4824]}, {"w": "and", "b": [0.3907, 0.4627, 0.4271, 0.4824]}, {"w": "will", "b": [0.4334, 0.4627, 0.4727, 0.4824]}, {"w": "return", "b": [0.479, 0.4627, 0.5392, 0.4824]}, {"w": "output", "b": [0.5455, 0.4627, 0.61, 0.4824]}, {"w": "tensors", "b": [0.6162, 0.4627, 0.6877, 0.4824]}, {"w": "of", "b": [0.694, 0.4627, 0.715, 0.4824]}, {"w": "a", "b": [0.7213, 0.4627, 0.7325, 0.4824]}, {"w": "certain", "b": [0.7388, 0.4627, 0.8075, 0.4824]}, {"w": "shape.", "b": [0.1294, 0.4832, 0.1932, 0.5029]}, {"w": "Consider", "b": [0.1995, 0.4832, 0.2906, 0.5029]}, {"w": "the", "b": [0.2969, 0.4832, 0.3277, 0.5029]}, {"w": "following", "b": [0.334, 0.4832, 0.4321, 0.5029]}, {"w": "example:", "b": [0.4384, 0.4832, 0.5309, 0.5029]}]}, {"id": "b_3", "type": "equation", "text": "from keras import layers layer = layers.Dense(32, input_shape=(784,)) 1", "words": [{"w": "from", "b": [0.1357, 0.5209, 0.1811, 0.5361]}, {"w": "keras", "b": [0.1925, 0.5209, 0.2492, 0.5361]}, {"w": "import", "b": [0.2606, 0.5209, 0.3287, 0.5361]}, {"w": "layers", "b": [0.34, 0.5209, 0.4082, 0.5361]}, {"w": "layer", "b": [0.1357, 0.5512, 0.1925, 0.5664]}, {"w": "=", "b": [0.2038, 0.5512, 0.2152, 0.5664]}, {"w": "layers.Dense(32,", "b": [0.2265, 0.5512, 0.4082, 0.5664]}, {"w": "input_shape=(784,))", "b": [0.4195, 0.5512, 0.6352, 0.5664]}, {"w": "1", "b": [0.6807, 0.5512, 0.692, 0.5664]}]}, {"id": "b_4", "type": "paragraph", "text": "1 A dense layer with 32 output units", "words": [{"w": "1", "b": [0.1799, 0.5848, 0.1925, 0.6046]}, {"w": "A", "b": [0.1988, 0.5848, 0.217, 0.6046]}, {"w": "dense", "b": [0.2233, 0.5848, 0.2836, 0.6046]}, {"w": "layer", "b": [0.2899, 0.5848, 0.3445, 0.6046]}, {"w": "with", "b": [0.3508, 0.5848, 0.3985, 0.6046]}, {"w": "32", "b": [0.4048, 0.5848, 0.43, 0.6046]}, {"w": "output", "b": [0.4363, 0.5848, 0.5078, 0.6046]}, {"w": "units", "b": [0.5141, 0.5848, 0.5674, 0.6046]}]}, {"id": "b_5", "type": "paragraph", "text": "We’re creating a layer that will only accept as input 2D tensors where the first dimension is 784 (axis 0, the batch dimension, is unspecified, and thus any value would be accepted). This layer will return a tensor where the first dimension has been transformed to be 32.", "words": [{"w": "We’re", "b": [0.1294, 0.6276, 0.1904, 0.6473]}, {"w": "creating", "b": [0.1967, 0.6276, 0.278, 0.6473]}, {"w": "a", "b": [0.2843, 0.6276, 0.2955, 0.6473]}, {"w": "layer", "b": [0.3018, 0.6276, 0.3522, 0.6473]}, {"w": "that", "b": [0.3585, 0.6276, 0.3963, 0.6473]}, {"w": "will", "b": [0.4027, 0.6276, 0.4419, 0.6473]}, {"w": "only", "b": [0.4482, 0.6276, 0.4931, 0.6473]}, {"w": "accept", "b": [0.4994, 0.6276, 0.5638, 0.6473]}, {"w": "as", "b": [0.5701, 0.6276, 0.5911, 0.6473]}, {"w": "input", "b": [0.5974, 0.6276, 0.6493, 0.6473]}, {"w": "2D", "b": [0.6556, 0.6276, 0.6864, 0.6473]}, {"w": "tensors", "b": [0.6927, 0.6276, 0.7642, 0.6473]}, {"w": "where", "b": [0.7705, 0.6276, 0.8321, 0.6473]}, {"w": "the", "b": [0.8384, 0.6276, 0.8693, 0.6473]}, {"w": "first", "b": [0.1294, 0.6481, 0.1701, 0.6678]}, {"w": "dimension", "b": [0.1764, 0.6481, 0.2815, 0.6678]}, {"w": "is", "b": [0.2878, 0.6481, 0.3046, 0.6678]}, {"w": "784", "b": [0.3109, 0.6481, 0.3488, 0.6678]}, {"w": "(axis", "b": [0.3551, 0.6481, 0.4041, 0.6678]}, {"w": "0,", "b": [0.4104, 0.6481, 0.4293, 0.6678]}, {"w": "the", "b": [0.4356, 0.6481, 0.4665, 0.6678]}, {"w": "batch", "b": [0.4728, 0.6481, 0.5274, 0.6678]}, {"w": "dimension,", "b": [0.5337, 0.6481, 0.6451, 0.6678]}, {"w": "is", "b": [0.6514, 0.6481, 0.6682, 0.6678]}, {"w": "unspecified,", "b": [0.6745, 0.6481, 0.7971, 0.6678]}, {"w": "and", "b": [0.8034, 0.6481, 0.8398, 0.6678]}, {"w": "thus", "b": [0.1294, 0.6686, 0.1715, 0.6883]}, {"w": "any", "b": [0.1778, 0.6686, 0.2142, 0.6883]}, {"w": "value", "b": [0.2205, 0.6686, 0.2751, 0.6883]}, {"w": "would", "b": [0.2814, 0.6686, 0.3445, 0.6883]}, {"w": "be", "b": [0.3508, 0.6686, 0.3746, 0.6883]}, {"w": "accepted).", "b": [0.3809, 0.6686, 0.4839, 0.6883]}, {"w": "This", "b": [0.4902, 0.6686, 0.535, 0.6883]}, {"w": "layer", "b": [0.5413, 0.6686, 0.5918, 0.6883]}, {"w": "will", "b": [0.5981, 0.6686, 0.6373, 0.6883]}, {"w": "return", "b": [0.6436, 0.6686, 0.7039, 0.6883]}, {"w": "a", "b": [0.7102, 0.6686, 0.7214, 0.6883]}, {"w": "tensor", "b": [0.7277, 0.6686, 0.7893, 0.6883]}, {"w": "where", "b": [0.7956, 0.6686, 0.8573, 0.6883]}, {"w": "the", "b": [0.1294, 0.6891, 0.1602, 0.7088]}, {"w": "first", "b": [0.1665, 0.6891, 0.2072, 0.7088]}, {"w": "dimension", "b": [0.2135, 0.6891, 0.3186, 0.7088]}, {"w": "has", "b": [0.3249, 0.6891, 0.3585, 0.7088]}, {"w": "been", "b": [0.3648, 0.6891, 0.4125, 0.7088]}, {"w": "transformed", "b": [0.4187, 0.6891, 0.5406, 0.7088]}, {"w": "to", "b": [0.5469, 0.6891, 0.5666, 0.7088]}, {"w": "be", "b": [0.5729, 0.6891, 0.5967, 0.7088]}, {"w": "32.", "b": [0.603, 0.6891, 0.6345, 0.7088]}]}, {"id": "b_6", "type": "paragraph", "text": "Thus this layer can only be connected to a downstream layer that expects 32-dimensional vectors as its input. When using Keras, you don’t have to worry about compatibility, because the layers you add to your models are dynamically built to match the shape of the incoming layer. For instance, suppose you write the following:", "words": [{"w": "Thus", "b": [0.1294, 0.7319, 0.1799, 0.7516]}, {"w": "this", "b": [0.1862, 0.7319, 0.2226, 0.7516]}, {"w": "layer", "b": [0.2289, 0.7319, 0.2794, 0.7516]}, {"w": "can", "b": [0.2857, 0.7319, 0.3207, 0.7516]}, {"w": "only", "b": [0.327, 0.7319, 0.3718, 0.7516]}, {"w": "be", "b": [0.3781, 0.7319, 0.402, 0.7516]}, {"w": "connected", "b": [0.4083, 0.7319, 0.5105, 0.7516]}, {"w": "to", "b": [0.5168, 0.7319, 0.5365, 0.7516]}, {"w": "a", "b": [0.5428, 0.7319, 0.554, 0.7516]}, {"w": "downstream", "b": [0.5603, 0.7319, 0.6836, 0.7516]}, {"w": "layer", "b": [0.6899, 0.7319, 0.7403, 0.7516]}, {"w": "that", "b": [0.7466, 0.7319, 0.7844, 0.7516]}, {"w": "expects", "b": [0.7908, 0.7319, 0.8664, 0.7516]}, {"w": "32-dimensional", "b": [0.1294, 0.7524, 0.2864, 0.7721]}, {"w": "vectors", "b": [0.2927, 0.7524, 0.3655, 0.7721]}, {"w": "as", "b": [0.3718, 0.7524, 0.3928, 0.7721]}, {"w": "its", "b": [0.3992, 0.7524, 0.423, 0.7721]}, {"w": "input.", "b": [0.4293, 0.7524, 0.4875, 0.7721]}, {"w": "When", "b": [0.4938, 0.7524, 0.554, 0.7721]}, {"w": "using", "b": [0.5603, 0.7524, 0.615, 0.7721]}, {"w": "Keras,", "b": [0.6213, 0.7524, 0.6864, 0.7721]}, {"w": "you", "b": [0.6927, 0.7524, 0.7305, 0.7721]}, {"w": "don’t", "b": [0.7368, 0.7524, 0.7896, 0.7721]}, {"w": "have", "b": [0.7959, 0.7524, 0.8435, 0.7721]}, {"w": "to", "b": [0.8499, 0.7524, 0.8695, 0.7721]}, {"w": "worry", "b": [0.1294, 0.7729, 0.1897, 0.7926]}, {"w": "about", "b": [0.196, 0.7729, 0.252, 0.7926]}, {"w": "compatibility,", "b": [0.2583, 0.7729, 0.3975, 0.7926]}, {"w": "because", "b": [0.4038, 0.7729, 0.4836, 0.7926]}, {"w": "the", "b": [0.4899, 0.7729, 0.5208, 0.7926]}, {"w": "layers", "b": [0.5271, 0.7729, 0.5873, 0.7926]}, {"w": "you", "b": [0.5936, 0.7729, 0.6315, 0.7926]}, {"w": "add", "b": [0.6378, 0.7729, 0.6742, 0.7926]}, {"w": "to", "b": [0.6805, 0.7729, 0.7001, 0.7926]}, {"w": "your", "b": [0.7064, 0.7729, 0.7527, 0.7926]}, {"w": "models", "b": [0.759, 0.7729, 0.8319, 0.7926]}, {"w": "are", "b": [0.8382, 0.7729, 0.869, 0.7926]}, {"w": "dynamically", "b": [0.1294, 0.7934, 0.2541, 0.8131]}, {"w": "built", "b": [0.2604, 0.7934, 0.3067, 0.8131]}, {"w": "to", "b": [0.313, 0.7934, 0.3326, 0.8131]}, {"w": "match", "b": [0.3389, 0.7934, 0.4006, 0.8131]}, {"w": "the", "b": [0.4069, 0.7934, 0.4377, 0.8131]}, {"w": "shape", "b": [0.4439, 0.7934, 0.5014, 0.8131]}, {"w": "of", "b": [0.5077, 0.7934, 0.5287, 0.8131]}, {"w": "the", "b": [0.535, 0.7934, 0.5658, 0.8131]}, {"w": "incoming", "b": [0.5721, 0.7934, 0.6674, 0.8131]}, {"w": "layer.", "b": [0.6738, 0.7934, 0.7291, 0.8131]}, {"w": "For", "b": [0.7354, 0.7934, 0.7704, 0.8131]}, {"w": "instance,", "b": [0.7767, 0.7934, 0.8657, 0.8131]}, {"w": "suppose", "b": [0.1294, 0.8139, 0.2107, 0.8336]}, {"w": "you", "b": [0.217, 0.8139, 0.2548, 0.8336]}, {"w": "write", "b": [0.2611, 0.8139, 0.313, 0.8336]}, {"w": "the", "b": [0.3193, 0.8139, 0.3501, 0.8336]}, {"w": "following:", "b": [0.3564, 0.8139, 0.4615, 0.8336]}]}, {"id": "b_7", "type": "equation", "text": "from keras import models from keras import layers model = models.Sequential()", "words": [{"w": "from", "b": [0.1357, 0.8516, 0.1811, 0.8668]}, {"w": "keras", "b": [0.1925, 0.8516, 0.2492, 0.8668]}, {"w": "import", "b": [0.2606, 0.8516, 0.3287, 0.8668]}, {"w": "models", "b": [0.34, 0.8516, 0.4082, 0.8668]}, {"w": "from", "b": [0.1357, 0.8668, 0.1811, 0.8819]}, {"w": "keras", "b": [0.1925, 0.8668, 0.2492, 0.8819]}, {"w": "import", "b": [0.2606, 0.8668, 0.3287, 0.8819]}, {"w": "layers", "b": [0.34, 0.8668, 0.4082, 0.8819]}, {"w": "model", "b": [0.1357, 0.8971, 0.1925, 0.9122]}, {"w": "=", "b": [0.2038, 0.8971, 0.2152, 0.9122]}, {"w": "models.Sequential()", "b": [0.2265, 0.8971, 0.4422, 0.9122]}]}]}, {"page": 97, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "model.add(layers.Dense(32, input_shape=(784,))) model.add(layers.Dense(32))", "words": [{"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.0851, 0.4309, 0.1002]}, {"w": "input_shape=(784,)))", "b": [0.4422, 0.0851, 0.6692, 0.1002]}, {"w": "model.add(layers.Dense(32))", "b": [0.1357, 0.1002, 0.4422, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "The second layer didn’t receive an input shape argument—instead, it automatically inferred its input shape as being the output shape of the layer that came before.", "words": [{"w": "The", "b": [0.1294, 0.1383, 0.1686, 0.158]}, {"w": "second", "b": [0.1749, 0.1383, 0.245, 0.158]}, {"w": "layer", "b": [0.2513, 0.1383, 0.3017, 0.158]}, {"w": "didn’t", "b": [0.308, 0.1383, 0.3678, 0.158]}, {"w": "receive", "b": [0.3741, 0.1383, 0.447, 0.158]}, {"w": "an", "b": [0.4533, 0.1383, 0.4771, 0.158]}, {"w": "input", "b": [0.4834, 0.1383, 0.5352, 0.158]}, {"w": "shape", "b": [0.5415, 0.1383, 0.599, 0.158]}, {"w": "argument—instead,", "b": [0.6053, 0.1383, 0.8031, 0.158]}, {"w": "it", "b": [0.8094, 0.1383, 0.8234, 0.158]}, {"w": "automatically", "b": [0.1294, 0.1588, 0.2667, 0.1785]}, {"w": "inferred", "b": [0.273, 0.1588, 0.3529, 0.1785]}, {"w": "its", "b": [0.3592, 0.1588, 0.383, 0.1785]}, {"w": "input", "b": [0.3893, 0.1588, 0.4412, 0.1785]}, {"w": "shape", "b": [0.4475, 0.1588, 0.5049, 0.1785]}, {"w": "as", "b": [0.5113, 0.1588, 0.5323, 0.1785]}, {"w": "being", "b": [0.5386, 0.1588, 0.5946, 0.1785]}, {"w": "the", "b": [0.6009, 0.1588, 0.6318, 0.1785]}, {"w": "output", "b": [0.6381, 0.1588, 0.7025, 0.1785]}, {"w": "shape", "b": [0.7087, 0.1588, 0.7662, 0.1785]}, {"w": "of", "b": [0.7725, 0.1588, 0.7935, 0.1785]}, {"w": "the", "b": [0.7998, 0.1588, 0.8306, 0.1785]}, {"w": "layer", "b": [0.1294, 0.1793, 0.1798, 0.199]}, {"w": "that", "b": [0.1861, 0.1793, 0.224, 0.199]}, {"w": "came", "b": [0.2303, 0.1793, 0.2835, 0.199]}, {"w": "before.", "b": [0.2898, 0.1793, 0.3606, 0.199]}]}, {"id": "b_2", "type": "paragraph", "text": "3.1.2. Models: networks of layers", "words": [{"w": "3.1.2.", "b": [0.1294, 0.2265, 0.1862, 0.2462]}, {"w": "Models:", "b": [0.1925, 0.2265, 0.2794, 0.2462]}, {"w": "networks", "b": [0.2857, 0.2265, 0.3852, 0.2462]}, {"w": "of", "b": [0.3915, 0.2265, 0.4125, 0.2462]}, {"w": "layers", "b": [0.4188, 0.2265, 0.4832, 0.2462]}]}, {"id": "b_3", "type": "paragraph", "text": "A deep-learning model is a directed, acyclic graph of layers. The most common instance is a linear stack of layers, mapping a single input to a single output.", "words": [{"w": "A", "b": [0.1294, 0.2693, 0.1476, 0.289]}, {"w": "deep-learning", "b": [0.1539, 0.2693, 0.2926, 0.289]}, {"w": "model", "b": [0.2989, 0.2693, 0.362, 0.289]}, {"w": "is", "b": [0.3683, 0.2693, 0.3851, 0.289]}, {"w": "a", "b": [0.3914, 0.2693, 0.4026, 0.289]}, {"w": "directed,", "b": [0.4089, 0.2693, 0.4965, 0.289]}, {"w": "acyclic", "b": [0.5028, 0.2693, 0.5742, 0.289]}, {"w": "graph", "b": [0.5805, 0.2693, 0.638, 0.289]}, {"w": "of", "b": [0.6443, 0.2693, 0.6653, 0.289]}, {"w": "layers.", "b": [0.6716, 0.2693, 0.7382, 0.289]}, {"w": "The", "b": [0.7445, 0.2693, 0.7837, 0.289]}, {"w": "most", "b": [0.79, 0.2693, 0.8391, 0.289]}, {"w": "common", "b": [0.1294, 0.2898, 0.2177, 0.3095]}, {"w": "instance", "b": [0.224, 0.2898, 0.3067, 0.3095]}, {"w": "is", "b": [0.313, 0.2898, 0.3298, 0.3095]}, {"w": "a", "b": [0.3361, 0.2898, 0.3473, 0.3095]}, {"w": "linear", "b": [0.3536, 0.2898, 0.4111, 0.3095]}, {"w": "stack", "b": [0.4174, 0.2898, 0.4692, 0.3095]}, {"w": "of", "b": [0.4755, 0.2898, 0.4965, 0.3095]}, {"w": "layers,", "b": [0.5028, 0.2898, 0.5694, 0.3095]}, {"w": "mapping", "b": [0.5757, 0.2898, 0.664, 0.3095]}, {"w": "a", "b": [0.6702, 0.2898, 0.6814, 0.3095]}, {"w": "single", "b": [0.6877, 0.2898, 0.748, 0.3095]}, {"w": "input", "b": [0.7543, 0.2898, 0.8061, 0.3095]}, {"w": "to", "b": [0.8124, 0.2898, 0.8321, 0.3095]}, {"w": "a", "b": [0.8384, 0.2898, 0.8496, 0.3095]}, {"w": "single", "b": [0.1294, 0.3103, 0.1897, 0.33]}, {"w": "output.", "b": [0.196, 0.3103, 0.2668, 0.33]}]}, {"id": "b_4", "type": "paragraph", "text": "But as you move forward, you’ll be exposed to a much broader variety of network topologies. Some common ones include the following:", "words": [{"w": "But", "b": [0.1294, 0.3531, 0.1659, 0.3728]}, {"w": "as", "b": [0.1722, 0.3531, 0.1932, 0.3728]}, {"w": "you", "b": [0.1995, 0.3531, 0.2373, 0.3728]}, {"w": "move", "b": [0.2436, 0.3531, 0.2997, 0.3728]}, {"w": "forward,", "b": [0.306, 0.3531, 0.3921, 0.3728]}, {"w": "you’ll", "b": [0.3984, 0.3531, 0.4587, 0.3728]}, {"w": "be", "b": [0.465, 0.3531, 0.4888, 0.3728]}, {"w": "exposed", "b": [0.4951, 0.3531, 0.5778, 0.3728]}, {"w": "to", "b": [0.5841, 0.3531, 0.6037, 0.3728]}, {"w": "a", "b": [0.61, 0.3531, 0.6212, 0.3728]}, {"w": "much", "b": [0.6275, 0.3531, 0.6836, 0.3728]}, {"w": "broader", "b": [0.6899, 0.3531, 0.7669, 0.3728]}, {"w": "variety", "b": [0.7732, 0.3531, 0.8433, 0.3728]}, {"w": "of", "b": [0.8496, 0.3531, 0.8706, 0.3728]}, {"w": "network", "b": [0.1294, 0.3736, 0.2121, 0.3933]}, {"w": "topologies.", "b": [0.2184, 0.3736, 0.3298, 0.3933]}, {"w": "Some", "b": [0.3361, 0.3736, 0.3936, 0.3933]}, {"w": "common", "b": [0.3999, 0.3736, 0.4882, 0.3933]}, {"w": "ones", "b": [0.4945, 0.3736, 0.5407, 0.3933]}, {"w": "include", "b": [0.547, 0.3736, 0.6213, 0.3933]}, {"w": "the", "b": [0.6276, 0.3736, 0.6584, 0.3933]}, {"w": "following:", "b": [0.6647, 0.3736, 0.7698, 0.3933]}]}, {"id": "b_5", "type": "equation", "text": "Two-branch networks Multihead networks Inception blocks", "words": [{"w": "Two-branch", "b": [0.1799, 0.4119, 0.3014, 0.4316]}, {"w": "networks", "b": [0.3077, 0.4119, 0.4002, 0.4316]}, {"w": "Multihead", "b": [0.1799, 0.4324, 0.2836, 0.4521]}, {"w": "networks", "b": [0.2899, 0.4324, 0.3824, 0.4521]}, {"w": "Inception", "b": [0.1799, 0.4529, 0.2751, 0.4726]}, {"w": "blocks", "b": [0.2814, 0.4529, 0.3473, 0.4726]}]}, {"id": "b_6", "type": "paragraph", "text": "The topology of a network defines a hypothesis space. You may remember that in chapter 1, we defined machine learning as “searching for useful representations of some input data, within a predefined space of possibilities, using guidance from a feedback signal.” By choosing a network topology, you constrain your space of possibilities (hypothesis space) to a specific series of tensor operations, mapping input data to output data. What you’ll then be searching for is a good set of values for the weight tensors involved in these tensor operations.", "words": [{"w": "The", "b": [0.1294, 0.4957, 0.1686, 0.5154]}, {"w": "topology", "b": [0.1749, 0.4957, 0.2646, 0.5154]}, {"w": "of", "b": [0.271, 0.4957, 0.292, 0.5154]}, {"w": "a", "b": [0.2983, 0.4957, 0.3095, 0.5154]}, {"w": "network", "b": [0.3158, 0.4957, 0.3984, 0.5154]}, {"w": "defines", "b": [0.4048, 0.4957, 0.4776, 0.5154]}, {"w": "a", "b": [0.4839, 0.4957, 0.4951, 0.5154]}, {"w": "hypothesis", "b": [0.5014, 0.4957, 0.6079, 0.5154]}, {"w": "space.", "b": [0.6142, 0.4957, 0.6779, 0.5154]}, {"w": "You", "b": [0.6842, 0.4957, 0.7251, 0.5154]}, {"w": "may", "b": [0.7314, 0.4957, 0.7749, 0.5154]}, {"w": "remember", "b": [0.1294, 0.5162, 0.2317, 0.5359]}, {"w": "that", "b": [0.238, 0.5162, 0.2758, 0.5359]}, {"w": "in", "b": [0.2821, 0.5162, 0.3018, 0.5359]}, {"w": "chapter", "b": [0.308, 0.5162, 0.3823, 0.5359]}, {"w": "1,", "b": [0.3886, 0.5162, 0.4075, 0.5359]}, {"w": "we", "b": [0.4138, 0.5162, 0.4432, 0.5359]}, {"w": "defined", "b": [0.4495, 0.5162, 0.5251, 0.5359]}, {"w": "machine", "b": [0.5315, 0.5162, 0.6169, 0.5359]}, {"w": "learning", "b": [0.6232, 0.5162, 0.7059, 0.5359]}, {"w": "as", "b": [0.7122, 0.5162, 0.7332, 0.5359]}, {"w": "“searching", "b": [0.7395, 0.5162, 0.8474, 0.5359]}, {"w": "for", "b": [0.1294, 0.5367, 0.1588, 0.5564]}, {"w": "useful", "b": [0.1651, 0.5367, 0.2268, 0.5564]}, {"w": "representations", "b": [0.2331, 0.5367, 0.3858, 0.5564]}, {"w": "of", "b": [0.3921, 0.5367, 0.4131, 0.5564]}, {"w": "some", "b": [0.4194, 0.5367, 0.4727, 0.5564]}, {"w": "input", "b": [0.479, 0.5367, 0.5309, 0.5564]}, {"w": "data,", "b": [0.5372, 0.5367, 0.5855, 0.5564]}, {"w": "within", "b": [0.5918, 0.5367, 0.6563, 0.5564]}, {"w": "a", "b": [0.6626, 0.5367, 0.6738, 0.5564]}, {"w": "predefined", "b": [0.6801, 0.5367, 0.788, 0.5564]}, {"w": "space", "b": [0.7943, 0.5367, 0.8503, 0.5564]}, {"w": "of", "b": [0.1294, 0.5572, 0.1504, 0.5769]}, {"w": "possibilities,", "b": [0.1567, 0.5572, 0.2836, 0.5769]}, {"w": "using", "b": [0.2899, 0.5572, 0.3445, 0.5769]}, {"w": "guidance", "b": [0.3508, 0.5572, 0.4419, 0.5769]}, {"w": "from", "b": [0.4482, 0.5572, 0.4973, 0.5769]}, {"w": "a", "b": [0.5036, 0.5572, 0.5148, 0.5769]}, {"w": "feedback", "b": [0.5211, 0.5572, 0.6121, 0.5769]}, {"w": "signal.”", "b": [0.6184, 0.5572, 0.6962, 0.5769]}, {"w": "By", "b": [0.7025, 0.5572, 0.7319, 0.5769]}, {"w": "choosing", "b": [0.7382, 0.5572, 0.8293, 0.5769]}, {"w": "a", "b": [0.8356, 0.5572, 0.8468, 0.5769]}, {"w": "network", "b": [0.1294, 0.5777, 0.2121, 0.5974]}, {"w": "topology,", "b": [0.2184, 0.5777, 0.3127, 0.5974]}, {"w": "you", "b": [0.319, 0.5777, 0.3569, 0.5974]}, {"w": "constrain", "b": [0.3632, 0.5777, 0.4557, 0.5974]}, {"w": "your", "b": [0.462, 0.5777, 0.5082, 0.5974]}, {"w": "space", "b": [0.5145, 0.5777, 0.5719, 0.5974]}, {"w": "of", "b": [0.5782, 0.5777, 0.5979, 0.5974]}, {"w": "possibilities", "b": [0.6042, 0.5777, 0.7247, 0.5974]}, {"w": "(hypothesis", "b": [0.731, 0.5777, 0.8473, 0.5974]}, {"w": "space)", "b": [0.1294, 0.5982, 0.1938, 0.6179]}, {"w": "to", "b": [0.2001, 0.5982, 0.2198, 0.6179]}, {"w": "a", "b": [0.2261, 0.5982, 0.2373, 0.6179]}, {"w": "specific", "b": [0.2436, 0.5982, 0.322, 0.6179]}, {"w": "series", "b": [0.3283, 0.5982, 0.3858, 0.6179]}, {"w": "of", "b": [0.3921, 0.5982, 0.4131, 0.6179]}, {"w": "tensor", "b": [0.4194, 0.5982, 0.4811, 0.6179]}, {"w": "operations,", "b": [0.4874, 0.5982, 0.5988, 0.6179]}, {"w": "mapping", "b": [0.6051, 0.5982, 0.6934, 0.6179]}, {"w": "input", "b": [0.6997, 0.5982, 0.7515, 0.6179]}, {"w": "data", "b": [0.7578, 0.5982, 0.7999, 0.6179]}, {"w": "to", "b": [0.8062, 0.5982, 0.8258, 0.6179]}, {"w": "output", "b": [0.1294, 0.6187, 0.1939, 0.6384]}, {"w": "data.", "b": [0.2002, 0.6187, 0.2485, 0.6384]}, {"w": "What", "b": [0.2548, 0.6187, 0.3095, 0.6384]}, {"w": "you’ll", "b": [0.3158, 0.6187, 0.376, 0.6384]}, {"w": "then", "b": [0.3824, 0.6187, 0.4258, 0.6384]}, {"w": "be", "b": [0.4321, 0.6187, 0.4559, 0.6384]}, {"w": "searching", "b": [0.4622, 0.6187, 0.5589, 0.6384]}, {"w": "for", "b": [0.5652, 0.6187, 0.5946, 0.6384]}, {"w": "is", "b": [0.6009, 0.6187, 0.6177, 0.6384]}, {"w": "a", "b": [0.624, 0.6187, 0.6352, 0.6384]}, {"w": "good", "b": [0.6415, 0.6187, 0.692, 0.6384]}, {"w": "set", "b": [0.6983, 0.6187, 0.7263, 0.6384]}, {"w": "of", "b": [0.7326, 0.6187, 0.7536, 0.6384]}, {"w": "values", "b": [0.76, 0.6187, 0.8244, 0.6384]}, {"w": "for", "b": [0.8307, 0.6187, 0.8601, 0.6384]}, {"w": "the", "b": [0.1294, 0.6392, 0.1602, 0.6589]}, {"w": "weight", "b": [0.1665, 0.6392, 0.2352, 0.6589]}, {"w": "tensors", "b": [0.2415, 0.6392, 0.313, 0.6589]}, {"w": "involved", "b": [0.3193, 0.6392, 0.4076, 0.6589]}, {"w": "in", "b": [0.4139, 0.6392, 0.4335, 0.6589]}, {"w": "these", "b": [0.4398, 0.6392, 0.4917, 0.6589]}, {"w": "tensor", "b": [0.498, 0.6392, 0.5596, 0.6589]}, {"w": "operations.", "b": [0.5659, 0.6392, 0.6773, 0.6589]}]}, {"id": "b_7", "type": "paragraph", "text": "Picking the right network architecture is more an art than a science; and although there are some best practices and principles you can rely on, only practice can help you become a proper neural-network architect. The next few chapters will both teach you explicit principles for building neural networks and help you develop intuition as to what works or doesn’t work for specific problems.", "words": [{"w": "Picking", "b": [0.1294, 0.682, 0.2065, 0.7017]}, {"w": "the", "b": [0.2128, 0.682, 0.2436, 0.7017]}, {"w": "right", "b": [0.2499, 0.682, 0.2976, 0.7017]}, {"w": "network", "b": [0.3039, 0.682, 0.3866, 0.7017]}, {"w": "architecture", "b": [0.3929, 0.682, 0.5119, 0.7017]}, {"w": "is", "b": [0.5182, 0.682, 0.5351, 0.7017]}, {"w": "more", "b": [0.5414, 0.682, 0.5932, 0.7017]}, {"w": "an", "b": [0.5995, 0.682, 0.6233, 0.7017]}, {"w": "art", "b": [0.6296, 0.682, 0.6563, 0.7017]}, {"w": "than", "b": [0.6626, 0.682, 0.706, 0.7017]}, {"w": "a", "b": [0.7123, 0.682, 0.7235, 0.7017]}, {"w": "science;", "b": [0.7298, 0.682, 0.8111, 0.7017]}, {"w": "and", "b": [0.8174, 0.682, 0.8538, 0.7017]}, {"w": "although", "b": [0.1294, 0.7025, 0.2177, 0.7222]}, {"w": "there", "b": [0.224, 0.7025, 0.2744, 0.7222]}, {"w": "are", "b": [0.2807, 0.7025, 0.3115, 0.7222]}, {"w": "some", "b": [0.3178, 0.7025, 0.3711, 0.7222]}, {"w": "best", "b": [0.3774, 0.7025, 0.418, 0.7222]}, {"w": "practices", "b": [0.4244, 0.7025, 0.514, 0.7222]}, {"w": "and", "b": [0.5203, 0.7025, 0.5567, 0.7222]}, {"w": "principles", "b": [0.563, 0.7025, 0.6625, 0.7222]}, {"w": "you", "b": [0.6688, 0.7025, 0.7066, 0.7222]}, {"w": "can", "b": [0.7129, 0.7025, 0.7479, 0.7222]}, {"w": "rely", "b": [0.7542, 0.7025, 0.7934, 0.7222]}, {"w": "on,", "b": [0.7997, 0.7025, 0.8313, 0.7222]}, {"w": "only", "b": [0.1294, 0.723, 0.1743, 0.7427]}, {"w": "practice", "b": [0.1806, 0.723, 0.2604, 0.7427]}, {"w": "can", "b": [0.2667, 0.723, 0.3017, 0.7427]}, {"w": "help", "b": [0.308, 0.723, 0.3515, 0.7427]}, {"w": "you", "b": [0.3578, 0.723, 0.3956, 0.7427]}, {"w": "become", "b": [0.4019, 0.723, 0.4804, 0.7427]}, {"w": "a", "b": [0.4867, 0.723, 0.4979, 0.7427]}, {"w": "proper", "b": [0.5042, 0.723, 0.57, 0.7427]}, {"w": "neural-network", "b": [0.5763, 0.723, 0.7304, 0.7427]}, {"w": "architect.", "b": [0.7367, 0.723, 0.8299, 0.7427]}, {"w": "The", "b": [0.1294, 0.7435, 0.1686, 0.7632]}, {"w": "next", "b": [0.1749, 0.7435, 0.2184, 0.7632]}, {"w": "few", "b": [0.2247, 0.7435, 0.2625, 0.7632]}, {"w": "chapters", "b": [0.2688, 0.7435, 0.3529, 0.7632]}, {"w": "will", "b": [0.3592, 0.7435, 0.3984, 0.7632]}, {"w": "both", "b": [0.4047, 0.7435, 0.4496, 0.7632]}, {"w": "teach", "b": [0.4559, 0.7435, 0.5091, 0.7632]}, {"w": "you", "b": [0.5153, 0.7435, 0.5532, 0.7632]}, {"w": "explicit", "b": [0.5595, 0.7435, 0.6352, 0.7632]}, {"w": "principles", "b": [0.6415, 0.7435, 0.741, 0.7632]}, {"w": "for", "b": [0.7473, 0.7435, 0.7767, 0.7632]}, {"w": "building", "b": [0.783, 0.7435, 0.8671, 0.7632]}, {"w": "neural", "b": [0.1294, 0.764, 0.1925, 0.7837]}, {"w": "networks", "b": [0.1988, 0.764, 0.2912, 0.7837]}, {"w": "and", "b": [0.2975, 0.764, 0.334, 0.7837]}, {"w": "help", "b": [0.3403, 0.764, 0.3837, 0.7837]}, {"w": "you", "b": [0.39, 0.764, 0.4279, 0.7837]}, {"w": "develop", "b": [0.4342, 0.764, 0.514, 0.7837]}, {"w": "intuition", "b": [0.5203, 0.764, 0.6059, 0.7837]}, {"w": "as", "b": [0.6122, 0.764, 0.6332, 0.7837]}, {"w": "to", "b": [0.6395, 0.764, 0.6591, 0.7837]}, {"w": "what", "b": [0.6654, 0.764, 0.7144, 0.7837]}, {"w": "works", "b": [0.7208, 0.764, 0.7824, 0.7837]}, {"w": "or", "b": [0.7887, 0.764, 0.8097, 0.7837]}, {"w": "doesn’t", "b": [0.1294, 0.7845, 0.2032, 0.8042]}, {"w": "work", "b": [0.2095, 0.7845, 0.2614, 0.8042]}, {"w": "for", "b": [0.2677, 0.7845, 0.2971, 0.8042]}, {"w": "specific", "b": [0.3034, 0.7845, 0.3818, 0.8042]}, {"w": "problems.", "b": [0.3881, 0.7845, 0.4883, 0.8042]}]}, {"id": "b_8", "type": "paragraph", "text": "3.1.3. Loss functions and optimizers: keys to configuring the learning process", "words": [{"w": "3.1.3.", "b": [0.1294, 0.8317, 0.1862, 0.8514]}, {"w": "Loss", "b": [0.1925, 0.8317, 0.2415, 0.8514]}, {"w": "functions", "b": [0.2478, 0.8317, 0.3474, 0.8514]}, {"w": "and", "b": [0.3537, 0.8317, 0.3943, 0.8514]}, {"w": "optimizers:", "b": [0.4006, 0.8317, 0.5225, 0.8514]}, {"w": "keys", "b": [0.5288, 0.8317, 0.5765, 0.8514]}, {"w": "to", "b": [0.5828, 0.8317, 0.6038, 0.8514]}, {"w": "configuring", "b": [0.6101, 0.8317, 0.7349, 0.8514]}, {"w": "the", "b": [0.7412, 0.8317, 0.7748, 0.8514]}, {"w": "learning", "b": [0.1294, 0.8522, 0.2191, 0.8719]}, {"w": "process", "b": [0.2254, 0.8522, 0.3048, 0.8719]}]}]}, {"page": 98, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Once the network architecture is defined, you still have to choose two more things:", "words": [{"w": "Once", "b": [0.1294, 0.0857, 0.1826, 0.1054]}, {"w": "the", "b": [0.1889, 0.0857, 0.2198, 0.1054]}, {"w": "network", "b": [0.2261, 0.0857, 0.3087, 0.1054]}, {"w": "architecture", "b": [0.315, 0.0857, 0.4341, 0.1054]}, {"w": "is", "b": [0.4404, 0.0857, 0.4572, 0.1054]}, {"w": "defined,", "b": [0.4636, 0.0857, 0.5455, 0.1054]}, {"w": "you", "b": [0.5518, 0.0857, 0.5897, 0.1054]}, {"w": "still", "b": [0.596, 0.0857, 0.6338, 0.1054]}, {"w": "have", "b": [0.6401, 0.0857, 0.6878, 0.1054]}, {"w": "to", "b": [0.6941, 0.0857, 0.7137, 0.1054]}, {"w": "choose", "b": [0.72, 0.0857, 0.79, 0.1054]}, {"w": "two", "b": [0.7964, 0.0857, 0.8342, 0.1054]}, {"w": "more", "b": [0.1294, 0.1062, 0.1813, 0.1259]}, {"w": "things:", "b": [0.1876, 0.1062, 0.2562, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Loss function (objective function)— The quantity that will be minimized during training. It represents a measure of success for the task at hand. Optimizer— Determines how the network will be updated based on the loss function. It implements a specific variant of stochastic gradient descent (SGD).", "words": [{"w": "Loss", "b": [0.1799, 0.1445, 0.2275, 0.1642]}, {"w": "function", "b": [0.2338, 0.1445, 0.3221, 0.1642]}, {"w": "(objective", "b": [0.3284, 0.1445, 0.4279, 0.1642]}, {"w": "function)—", "b": [0.4342, 0.1445, 0.5562, 0.1642]}, {"w": "The", "b": [0.5624, 0.1445, 0.6017, 0.1642]}, {"w": "quantity", "b": [0.608, 0.1445, 0.6907, 0.1642]}, {"w": "that", "b": [0.697, 0.1445, 0.7348, 0.1642]}, {"w": "will", "b": [0.7411, 0.1445, 0.7804, 0.1642]}, {"w": "be", "b": [0.7867, 0.1445, 0.8105, 0.1642]}, {"w": "minimized", "b": [0.1799, 0.165, 0.2878, 0.1847]}, {"w": "during", "b": [0.2941, 0.165, 0.36, 0.1847]}, {"w": "training.", "b": [0.3663, 0.165, 0.451, 0.1847]}, {"w": "It", "b": [0.4573, 0.165, 0.4728, 0.1847]}, {"w": "represents", "b": [0.4791, 0.165, 0.5813, 0.1847]}, {"w": "a", "b": [0.5876, 0.165, 0.5988, 0.1847]}, {"w": "measure", "b": [0.6051, 0.165, 0.6892, 0.1847]}, {"w": "of", "b": [0.6955, 0.165, 0.7165, 0.1847]}, {"w": "success", "b": [0.7228, 0.165, 0.7985, 0.1847]}, {"w": "for", "b": [0.8048, 0.165, 0.8342, 0.1847]}, {"w": "the", "b": [0.1799, 0.1855, 0.2107, 0.2052]}, {"w": "task", "b": [0.217, 0.1855, 0.2576, 0.2052]}, {"w": "at", "b": [0.2639, 0.1855, 0.2822, 0.2052]}, {"w": "hand.", "b": [0.2885, 0.1855, 0.3438, 0.2052]}, {"w": "Optimizer—", "b": [0.1799, 0.206, 0.3074, 0.2257]}, {"w": "Determines", "b": [0.3137, 0.206, 0.43, 0.2257]}, {"w": "how", "b": [0.4363, 0.206, 0.4797, 0.2257]}, {"w": "the", "b": [0.486, 0.206, 0.5169, 0.2257]}, {"w": "network", "b": [0.5232, 0.206, 0.6058, 0.2257]}, {"w": "will", "b": [0.6121, 0.206, 0.6514, 0.2257]}, {"w": "be", "b": [0.6577, 0.206, 0.6815, 0.2257]}, {"w": "updated", "b": [0.6878, 0.206, 0.7677, 0.2257]}, {"w": "based", "b": [0.774, 0.206, 0.8314, 0.2257]}, {"w": "on", "b": [0.8377, 0.206, 0.863, 0.2257]}, {"w": "the", "b": [0.1799, 0.2265, 0.2107, 0.2462]}, {"w": "loss", "b": [0.217, 0.2265, 0.2562, 0.2462]}, {"w": "function.", "b": [0.2626, 0.2265, 0.3529, 0.2462]}, {"w": "It", "b": [0.3592, 0.2265, 0.3747, 0.2462]}, {"w": "implements", "b": [0.381, 0.2265, 0.4987, 0.2462]}, {"w": "a", "b": [0.505, 0.2265, 0.5162, 0.2462]}, {"w": "specific", "b": [0.5225, 0.2265, 0.601, 0.2462]}, {"w": "variant", "b": [0.6073, 0.2265, 0.6773, 0.2462]}, {"w": "of", "b": [0.6836, 0.2265, 0.7046, 0.2462]}, {"w": "stochastic", "b": [0.7109, 0.2265, 0.8104, 0.2462]}, {"w": "gradient", "b": [0.1799, 0.247, 0.2625, 0.2667]}, {"w": "descent", "b": [0.2688, 0.247, 0.3445, 0.2667]}, {"w": "(SGD).", "b": [0.3508, 0.247, 0.4243, 0.2667]}]}, {"id": "b_2", "type": "paragraph", "text": "A neural network that has multiple outputs may have multiple loss functions (one per output). But the gradient-descent process must be based on a single scalar loss value; so, for multiloss networks, all losses are combined (via averaging) into a single scalar quantity.", "words": [{"w": "A", "b": [0.1294, 0.2898, 0.1476, 0.3095]}, {"w": "neural", "b": [0.1539, 0.2898, 0.217, 0.3095]}, {"w": "network", "b": [0.2233, 0.2898, 0.3059, 0.3095]}, {"w": "that", "b": [0.3122, 0.2898, 0.3501, 0.3095]}, {"w": "has", "b": [0.3564, 0.2898, 0.39, 0.3095]}, {"w": "multiple", "b": [0.3963, 0.2898, 0.4804, 0.3095]}, {"w": "outputs", "b": [0.4867, 0.2898, 0.561, 0.3095]}, {"w": "may", "b": [0.5673, 0.2898, 0.6108, 0.3095]}, {"w": "have", "b": [0.6171, 0.2898, 0.6647, 0.3095]}, {"w": "multiple", "b": [0.671, 0.2898, 0.7551, 0.3095]}, {"w": "loss", "b": [0.7614, 0.2898, 0.8007, 0.3095]}, {"w": "functions", "b": [0.1294, 0.3103, 0.2233, 0.33]}, {"w": "(one", "b": [0.2296, 0.3103, 0.2744, 0.33]}, {"w": "per", "b": [0.2807, 0.3103, 0.313, 0.33]}, {"w": "output).", "b": [0.3193, 0.3103, 0.3984, 0.33]}, {"w": "But", "b": [0.4048, 0.3103, 0.4412, 0.33]}, {"w": "the", "b": [0.4475, 0.3103, 0.4783, 0.33]}, {"w": "gradient-descent", "b": [0.4846, 0.3103, 0.6514, 0.33]}, {"w": "process", "b": [0.6577, 0.3103, 0.7333, 0.33]}, {"w": "must", "b": [0.7396, 0.3103, 0.7886, 0.33]}, {"w": "be", "b": [0.7949, 0.3103, 0.8187, 0.33]}, {"w": "based", "b": [0.1294, 0.3308, 0.1869, 0.3505]}, {"w": "on", "b": [0.1932, 0.3308, 0.2184, 0.3505]}, {"w": "a", "b": [0.2247, 0.3308, 0.2359, 0.3505]}, {"w": "single", "b": [0.2422, 0.3308, 0.3024, 0.3505]}, {"w": "scalar", "b": [0.3087, 0.3308, 0.3676, 0.3505]}, {"w": "loss", "b": [0.3739, 0.3308, 0.4131, 0.3505]}, {"w": "value;", "b": [0.4194, 0.3308, 0.4811, 0.3505]}, {"w": "so,", "b": [0.4874, 0.3308, 0.5161, 0.3505]}, {"w": "for", "b": [0.5224, 0.3308, 0.5518, 0.3505]}, {"w": "multiloss", "b": [0.5581, 0.3308, 0.6507, 0.3505]}, {"w": "networks,", "b": [0.657, 0.3308, 0.7558, 0.3505]}, {"w": "all", "b": [0.7621, 0.3308, 0.7873, 0.3505]}, {"w": "losses", "b": [0.7936, 0.3308, 0.8539, 0.3505]}, {"w": "are", "b": [0.1294, 0.3513, 0.1602, 0.371]}, {"w": "combined", "b": [0.1665, 0.3513, 0.266, 0.371]}, {"w": "(via", "b": [0.2723, 0.3513, 0.3115, 0.371]}, {"w": "averaging)", "b": [0.3178, 0.3513, 0.4257, 0.371]}, {"w": "into", "b": [0.432, 0.3513, 0.4713, 0.371]}, {"w": "a", "b": [0.4776, 0.3513, 0.4888, 0.371]}, {"w": "single", "b": [0.4951, 0.3513, 0.5553, 0.371]}, {"w": "scalar", "b": [0.5617, 0.3513, 0.6205, 0.371]}, {"w": "quantity.", "b": [0.6268, 0.3513, 0.7141, 0.371]}]}, {"id": "b_3", "type": "paragraph", "text": "Choosing the right objective function for the right problem is extremely important: your network will take any shortcut it can, to minimize the loss; so if the objective doesn’t fully correlate with success for the task at hand, your network will end up doing things you may not have wanted. Imagine a stupid, omnipotent AI trained via SGD, with this poorly chosen objective function: “maximizing the average well-being of all humans alive.” To make its job easier, this AI might choose to kill all humans except a few and focus on the well-being of the remaining ones —because average well-being isn’t affected by how many humans are left. That might not be what you intended! Just remember that all neural networks you build will be just as ruthless in lowering their loss function —so choose the objective wisely, or you’ll have to face unintended side effects.", "words": [{"w": "Choosing", "b": [0.1294, 0.3941, 0.2261, 0.4138]}, {"w": "the", "b": [0.2324, 0.3941, 0.2633, 0.4138]}, {"w": "right", "b": [0.2696, 0.3941, 0.3172, 0.4138]}, {"w": "objective", "b": [0.3235, 0.3941, 0.416, 0.4138]}, {"w": "function", "b": [0.4223, 0.3941, 0.5064, 0.4138]}, {"w": "for", "b": [0.5127, 0.3941, 0.5421, 0.4138]}, {"w": "the", "b": [0.5484, 0.3941, 0.5792, 0.4138]}, {"w": "right", "b": [0.5855, 0.3941, 0.6332, 0.4138]}, {"w": "problem", "b": [0.6395, 0.3941, 0.7236, 0.4138]}, {"w": "is", "b": [0.7299, 0.3941, 0.7467, 0.4138]}, {"w": "extremely", "b": [0.753, 0.3941, 0.8539, 0.4138]}, {"w": "important:", "b": [0.1294, 0.4146, 0.2345, 0.4343]}, {"w": "your", "b": [0.2408, 0.4146, 0.2871, 0.4343]}, {"w": "network", "b": [0.2934, 0.4146, 0.376, 0.4343]}, {"w": "will", "b": [0.3824, 0.4146, 0.4216, 0.4343]}, {"w": "take", "b": [0.4279, 0.4146, 0.4699, 0.4343]}, {"w": "any", "b": [0.4762, 0.4146, 0.5127, 0.4343]}, {"w": "shortcut", "b": [0.519, 0.4146, 0.6003, 0.4343]}, {"w": "it", "b": [0.6066, 0.4146, 0.6206, 0.4343]}, {"w": "can,", "b": [0.6268, 0.4146, 0.6681, 0.4343]}, {"w": "to", "b": [0.6744, 0.4146, 0.6941, 0.4343]}, {"w": "minimize", "b": [0.7004, 0.4146, 0.7957, 0.4343]}, {"w": "the", "b": [0.802, 0.4146, 0.8328, 0.4343]}, {"w": "loss;", "b": [0.1294, 0.4351, 0.1757, 0.4548]}, {"w": "so", "b": [0.182, 0.4351, 0.2044, 0.4548]}, {"w": "if", "b": [0.2107, 0.4351, 0.2261, 0.4548]}, {"w": "the", "b": [0.2324, 0.4351, 0.2633, 0.4548]}, {"w": "objective", "b": [0.2696, 0.4351, 0.362, 0.4548]}, {"w": "doesn’t", "b": [0.3684, 0.4351, 0.4421, 0.4548]}, {"w": "fully", "b": [0.4484, 0.4351, 0.4961, 0.4548]}, {"w": "correlate", "b": [0.5024, 0.4351, 0.5906, 0.4548]}, {"w": "with", "b": [0.5969, 0.4351, 0.6418, 0.4548]}, {"w": "success", "b": [0.6481, 0.4351, 0.7237, 0.4548]}, {"w": "for", "b": [0.7301, 0.4351, 0.7595, 0.4548]}, {"w": "the", "b": [0.7658, 0.4351, 0.7966, 0.4548]}, {"w": "task", "b": [0.8029, 0.4351, 0.8435, 0.4548]}, {"w": "at", "b": [0.8499, 0.4351, 0.8681, 0.4548]}, {"w": "hand,", "b": [0.1294, 0.4556, 0.1848, 0.4753]}, {"w": "your", "b": [0.1911, 0.4556, 0.2373, 0.4753]}, {"w": "network", "b": [0.2436, 0.4556, 0.3263, 0.4753]}, {"w": "will", "b": [0.3326, 0.4556, 0.3718, 0.4753]}, {"w": "end", "b": [0.3781, 0.4556, 0.4145, 0.4753]}, {"w": "up", "b": [0.4209, 0.4556, 0.4461, 0.4753]}, {"w": "doing", "b": [0.4524, 0.4556, 0.5099, 0.4753]}, {"w": "things", "b": [0.5162, 0.4556, 0.5778, 0.4753]}, {"w": "you", "b": [0.5841, 0.4556, 0.622, 0.4753]}, {"w": "may", "b": [0.6283, 0.4556, 0.6717, 0.4753]}, {"w": "not", "b": [0.678, 0.4556, 0.7103, 0.4753]}, {"w": "have", "b": [0.7166, 0.4556, 0.7642, 0.4753]}, {"w": "wanted.", "b": [0.7705, 0.4556, 0.8497, 0.4753]}, {"w": "Imagine", "b": [0.1294, 0.4761, 0.2121, 0.4958]}, {"w": "a", "b": [0.2184, 0.4761, 0.2296, 0.4958]}, {"w": "stupid,", "b": [0.2359, 0.4761, 0.3039, 0.4958]}, {"w": "omnipotent", "b": [0.3102, 0.4761, 0.4251, 0.4958]}, {"w": "AI", "b": [0.4314, 0.4761, 0.458, 0.4958]}, {"w": "trained", "b": [0.4643, 0.4761, 0.5344, 0.4958]}, {"w": "via", "b": [0.5407, 0.4761, 0.5715, 0.4958]}, {"w": "SGD,", "b": [0.5778, 0.4761, 0.6346, 0.4958]}, {"w": "with", "b": [0.6409, 0.4761, 0.6857, 0.4958]}, {"w": "this", "b": [0.692, 0.4761, 0.7285, 0.4958]}, {"w": "poorly", "b": [0.7348, 0.4761, 0.8007, 0.4958]}, {"w": "chosen", "b": [0.1294, 0.4966, 0.1995, 0.5163]}, {"w": "objective", "b": [0.2058, 0.4966, 0.2982, 0.5163]}, {"w": "function:", "b": [0.3045, 0.4966, 0.3956, 0.5163]}, {"w": "“maximizing", "b": [0.4019, 0.4966, 0.5336, 0.5163]}, {"w": "the", "b": [0.5399, 0.4966, 0.5708, 0.5163]}, {"w": "average", "b": [0.5771, 0.4966, 0.6555, 0.5163]}, {"w": "well-being", "b": [0.6618, 0.4966, 0.7697, 0.5163]}, {"w": "of", "b": [0.776, 0.4966, 0.797, 0.5163]}, {"w": "all", "b": [0.8033, 0.4966, 0.8286, 0.5163]}, {"w": "humans", "b": [0.1294, 0.5171, 0.2079, 0.5368]}, {"w": "alive.”", "b": [0.2142, 0.5171, 0.2807, 0.5368]}, {"w": "To", "b": [0.287, 0.5171, 0.3133, 0.5368]}, {"w": "make", "b": [0.3196, 0.5171, 0.3742, 0.5368]}, {"w": "its", "b": [0.3805, 0.5171, 0.4044, 0.5368]}, {"w": "job", "b": [0.4107, 0.5171, 0.4429, 0.5368]}, {"w": "easier,", "b": [0.4492, 0.5171, 0.5133, 0.5368]}, {"w": "this", "b": [0.5196, 0.5171, 0.5561, 0.5368]}, {"w": "AI", "b": [0.5624, 0.5171, 0.589, 0.5368]}, {"w": "might", "b": [0.5953, 0.5171, 0.6542, 0.5368]}, {"w": "choose", "b": [0.6605, 0.5171, 0.7305, 0.5368]}, {"w": "to", "b": [0.7368, 0.5171, 0.7565, 0.5368]}, {"w": "kill", "b": [0.7628, 0.5171, 0.7964, 0.5368]}, {"w": "all", "b": [0.8027, 0.5171, 0.828, 0.5368]}, {"w": "humans", "b": [0.1294, 0.5376, 0.2079, 0.5573]}, {"w": "except", "b": [0.2142, 0.5376, 0.28, 0.5573]}, {"w": "a", "b": [0.2863, 0.5376, 0.2975, 0.5573]}, {"w": "few", "b": [0.3038, 0.5376, 0.3417, 0.5573]}, {"w": "and", "b": [0.348, 0.5376, 0.3844, 0.5573]}, {"w": "focus", "b": [0.3907, 0.5376, 0.4453, 0.5573]}, {"w": "on", "b": [0.4516, 0.5376, 0.4769, 0.5573]}, {"w": "the", "b": [0.4832, 0.5376, 0.514, 0.5573]}, {"w": "well-being", "b": [0.5203, 0.5376, 0.6282, 0.5573]}, {"w": "of", "b": [0.6345, 0.5376, 0.6555, 0.5573]}, {"w": "the", "b": [0.6618, 0.5376, 0.6927, 0.5573]}, {"w": "remaining", "b": [0.699, 0.5376, 0.8012, 0.5573]}, {"w": "ones", "b": [0.8076, 0.5376, 0.8538, 0.5573]}, {"w": "—because", "b": [0.1294, 0.5581, 0.2345, 0.5778]}, {"w": "average", "b": [0.2408, 0.5581, 0.3192, 0.5778]}, {"w": "well-being", "b": [0.3255, 0.5581, 0.4334, 0.5778]}, {"w": "isn’t", "b": [0.4397, 0.5581, 0.4841, 0.5778]}, {"w": "affected", "b": [0.4904, 0.5581, 0.5711, 0.5778]}, {"w": "by", "b": [0.5774, 0.5581, 0.6027, 0.5778]}, {"w": "how", "b": [0.609, 0.5581, 0.6524, 0.5778]}, {"w": "many", "b": [0.6587, 0.5581, 0.7148, 0.5778]}, {"w": "humans", "b": [0.7211, 0.5581, 0.7995, 0.5778]}, {"w": "are", "b": [0.8058, 0.5581, 0.8366, 0.5778]}, {"w": "left.", "b": [0.1294, 0.5786, 0.1693, 0.5983]}, {"w": "That", "b": [0.1757, 0.5786, 0.2219, 0.5983]}, {"w": "might", "b": [0.2282, 0.5786, 0.2871, 0.5983]}, {"w": "not", "b": [0.2934, 0.5786, 0.3256, 0.5983]}, {"w": "be", "b": [0.3319, 0.5786, 0.3557, 0.5983]}, {"w": "what", "b": [0.362, 0.5786, 0.4111, 0.5983]}, {"w": "you", "b": [0.4174, 0.5786, 0.4552, 0.5983]}, {"w": "intended!", "b": [0.4615, 0.5786, 0.5568, 0.5983]}, {"w": "Just", "b": [0.5631, 0.5786, 0.6024, 0.5983]}, {"w": "remember", "b": [0.6087, 0.5786, 0.7109, 0.5983]}, {"w": "that", "b": [0.7172, 0.5786, 0.7551, 0.5983]}, {"w": "all", "b": [0.7614, 0.5786, 0.7866, 0.5983]}, {"w": "neural", "b": [0.7929, 0.5786, 0.856, 0.5983]}, {"w": "networks", "b": [0.1294, 0.5991, 0.2219, 0.6188]}, {"w": "you", "b": [0.2282, 0.5991, 0.266, 0.6188]}, {"w": "build", "b": [0.2723, 0.5991, 0.3242, 0.6188]}, {"w": "will", "b": [0.3305, 0.5991, 0.3698, 0.6188]}, {"w": "be", "b": [0.3761, 0.5991, 0.3999, 0.6188]}, {"w": "just", "b": [0.4062, 0.5991, 0.4426, 0.6188]}, {"w": "as", "b": [0.4489, 0.5991, 0.47, 0.6188]}, {"w": "ruthless", "b": [0.4763, 0.5991, 0.5547, 0.6188]}, {"w": "in", "b": [0.561, 0.5991, 0.5806, 0.6188]}, {"w": "lowering", "b": [0.5869, 0.5991, 0.6766, 0.6188]}, {"w": "their", "b": [0.6829, 0.5991, 0.7292, 0.6188]}, {"w": "loss", "b": [0.7355, 0.5991, 0.7747, 0.6188]}, {"w": "function", "b": [0.781, 0.5991, 0.8651, 0.6188]}, {"w": "—so", "b": [0.1294, 0.6196, 0.1771, 0.6393]}, {"w": "choose", "b": [0.1834, 0.6196, 0.2534, 0.6393]}, {"w": "the", "b": [0.2597, 0.6196, 0.2906, 0.6393]}, {"w": "objective", "b": [0.2969, 0.6196, 0.3893, 0.6393]}, {"w": "wisely,", "b": [0.3956, 0.6196, 0.4661, 0.6393]}, {"w": "or", "b": [0.4724, 0.6196, 0.4935, 0.6393]}, {"w": "you’ll", "b": [0.4998, 0.6196, 0.56, 0.6393]}, {"w": "have", "b": [0.5663, 0.6196, 0.614, 0.6393]}, {"w": "to", "b": [0.6203, 0.6196, 0.6399, 0.6393]}, {"w": "face", "b": [0.6462, 0.6196, 0.6882, 0.6393]}, {"w": "unintended", "b": [0.6945, 0.6196, 0.8066, 0.6393]}, {"w": "side", "b": [0.8129, 0.6196, 0.8536, 0.6393]}, {"w": "effects.", "b": [0.1294, 0.6401, 0.2025, 0.6598]}]}, {"id": "b_4", "type": "paragraph", "text": "Fortunately, when it comes to common problems such as classification, regression, and sequence prediction, there are simple guidelines you can follow to choose the correct loss. For instance, you’ll use binary crossentropy for a two-class classification problem, categorical crossentropy for a many-class classification problem, mean-squared error for a regression problem, connectionist temporal classification (CTC) for a sequence-learning problem, and so on. Only when you’re working on truly new research problems will you have to develop your own objective functions. In the next few chapters, we’ll detail explicitly which loss functions to choose for a wide range of common tasks.", "words": [{"w": "Fortunately,", "b": [0.1294, 0.6829, 0.2504, 0.7026]}, {"w": "when", "b": [0.2567, 0.6829, 0.3113, 0.7026]}, {"w": "it", "b": [0.3176, 0.6829, 0.3317, 0.7026]}, {"w": "comes", "b": [0.338, 0.6829, 0.4024, 0.7026]}, {"w": "to", "b": [0.4087, 0.6829, 0.4283, 0.7026]}, {"w": "common", "b": [0.4347, 0.6829, 0.5229, 0.7026]}, {"w": "problems", "b": [0.5293, 0.6829, 0.6231, 0.7026]}, {"w": "such", "b": [0.6294, 0.6829, 0.6757, 0.7026]}, {"w": "as", "b": [0.682, 0.6829, 0.703, 0.7026]}, {"w": "classification,", "b": [0.7093, 0.6829, 0.8487, 0.7026]}, {"w": "regression,", "b": [0.1294, 0.7034, 0.2394, 0.7231]}, {"w": "and", "b": [0.2457, 0.7034, 0.2821, 0.7231]}, {"w": "sequence", "b": [0.2884, 0.7034, 0.3809, 0.7231]}, {"w": "prediction,", "b": [0.3872, 0.7034, 0.4958, 0.7231]}, {"w": "there", "b": [0.5021, 0.7034, 0.5525, 0.7231]}, {"w": "are", "b": [0.5588, 0.7034, 0.5896, 0.7231]}, {"w": "simple", "b": [0.5959, 0.7034, 0.6632, 0.7231]}, {"w": "guidelines", "b": [0.6694, 0.7034, 0.7731, 0.7231]}, {"w": "you", "b": [0.7794, 0.7034, 0.8173, 0.7231]}, {"w": "can", "b": [0.8236, 0.7034, 0.8586, 0.7231]}, {"w": "follow", "b": [0.1294, 0.7239, 0.1953, 0.7436]}, {"w": "to", "b": [0.2016, 0.7239, 0.2212, 0.7436]}, {"w": "choose", "b": [0.2275, 0.7239, 0.2976, 0.7436]}, {"w": "the", "b": [0.3039, 0.7239, 0.3347, 0.7436]}, {"w": "correct", "b": [0.341, 0.7239, 0.411, 0.7436]}, {"w": "loss.", "b": [0.4173, 0.7239, 0.4629, 0.7436]}, {"w": "For", "b": [0.4692, 0.7239, 0.5042, 0.7436]}, {"w": "instance,", "b": [0.5105, 0.7239, 0.5995, 0.7436]}, {"w": "you’ll", "b": [0.6058, 0.7239, 0.6661, 0.7436]}, {"w": "use", "b": [0.6724, 0.7239, 0.706, 0.7436]}, {"w": "binary", "b": [0.7123, 0.7239, 0.7768, 0.7436]}, {"w": "crossentropy", "b": [0.1294, 0.7444, 0.2583, 0.7641]}, {"w": "for", "b": [0.2646, 0.7444, 0.294, 0.7641]}, {"w": "a", "b": [0.3003, 0.7444, 0.3115, 0.7641]}, {"w": "two-class", "b": [0.3178, 0.7444, 0.4131, 0.7641]}, {"w": "classification", "b": [0.4194, 0.7444, 0.5525, 0.7641]}, {"w": "problem,", "b": [0.5588, 0.7444, 0.6492, 0.7641]}, {"w": "categorical", "b": [0.6555, 0.7444, 0.7662, 0.7641]}, {"w": "crossentropy", "b": [0.1294, 0.7649, 0.2583, 0.7846]}, {"w": "for", "b": [0.2646, 0.7649, 0.294, 0.7846]}, {"w": "a", "b": [0.3003, 0.7649, 0.3115, 0.7846]}, {"w": "many-class", "b": [0.3178, 0.7649, 0.4313, 0.7846]}, {"w": "classification", "b": [0.4376, 0.7649, 0.5708, 0.7846]}, {"w": "problem,", "b": [0.5771, 0.7649, 0.6675, 0.7846]}, {"w": "mean-squared", "b": [0.6738, 0.7649, 0.8152, 0.7846]}, {"w": "error", "b": [0.8216, 0.7649, 0.8706, 0.7846]}, {"w": "for", "b": [0.1294, 0.7854, 0.1588, 0.8051]}, {"w": "a", "b": [0.1651, 0.7854, 0.1763, 0.8051]}, {"w": "regression", "b": [0.1826, 0.7854, 0.2863, 0.8051]}, {"w": "problem,", "b": [0.2926, 0.7854, 0.383, 0.8051]}, {"w": "connectionist", "b": [0.3893, 0.7854, 0.5238, 0.8051]}, {"w": "temporal", "b": [0.5301, 0.7854, 0.6198, 0.8051]}, {"w": "classification", "b": [0.6261, 0.7854, 0.7592, 0.8051]}, {"w": "(CTC)", "b": [0.7655, 0.7854, 0.8314, 0.8051]}, {"w": "for", "b": [0.8377, 0.7854, 0.8671, 0.8051]}, {"w": "a", "b": [0.1294, 0.8059, 0.1406, 0.8256]}, {"w": "sequence-learning", "b": [0.1469, 0.8059, 0.3304, 0.8256]}, {"w": "problem,", "b": [0.3367, 0.8059, 0.4271, 0.8256]}, {"w": "and", "b": [0.4334, 0.8059, 0.4699, 0.8256]}, {"w": "so", "b": [0.4762, 0.8059, 0.4986, 0.8256]}, {"w": "on.", "b": [0.5049, 0.8059, 0.5364, 0.8256]}, {"w": "Only", "b": [0.5427, 0.8059, 0.5932, 0.8256]}, {"w": "when", "b": [0.5995, 0.8059, 0.6541, 0.8256]}, {"w": "you’re", "b": [0.6604, 0.8059, 0.7263, 0.8256]}, {"w": "working", "b": [0.7326, 0.8059, 0.8167, 0.8256]}, {"w": "on", "b": [0.823, 0.8059, 0.8482, 0.8256]}, {"w": "truly", "b": [0.1294, 0.8264, 0.1771, 0.8461]}, {"w": "new", "b": [0.1834, 0.8264, 0.2254, 0.8461]}, {"w": "research", "b": [0.2317, 0.8264, 0.3157, 0.8461]}, {"w": "problems", "b": [0.322, 0.8264, 0.4159, 0.8461]}, {"w": "will", "b": [0.4222, 0.8264, 0.4614, 0.8461]}, {"w": "you", "b": [0.4677, 0.8264, 0.5056, 0.8461]}, {"w": "have", "b": [0.5119, 0.8264, 0.5595, 0.8461]}, {"w": "to", "b": [0.5658, 0.8264, 0.5854, 0.8461]}, {"w": "develop", "b": [0.5918, 0.8264, 0.6716, 0.8461]}, {"w": "your", "b": [0.6779, 0.8264, 0.7242, 0.8461]}, {"w": "own", "b": [0.7305, 0.8264, 0.7739, 0.8461]}, {"w": "objective", "b": [0.1294, 0.8469, 0.2219, 0.8666]}, {"w": "functions.", "b": [0.2282, 0.8469, 0.3284, 0.8666]}, {"w": "In", "b": [0.3347, 0.8469, 0.3557, 0.8666]}, {"w": "the", "b": [0.362, 0.8469, 0.3928, 0.8666]}, {"w": "next", "b": [0.3992, 0.8469, 0.4426, 0.8666]}, {"w": "few", "b": [0.4489, 0.8469, 0.4867, 0.8666]}, {"w": "chapters,", "b": [0.493, 0.8469, 0.5834, 0.8666]}, {"w": "we’ll", "b": [0.5897, 0.8469, 0.6415, 0.8666]}, {"w": "detail", "b": [0.6478, 0.8469, 0.7039, 0.8666]}, {"w": "explicitly", "b": [0.7102, 0.8469, 0.8055, 0.8666]}, {"w": "which", "b": [0.1294, 0.8674, 0.1911, 0.8871]}, {"w": "loss", "b": [0.1974, 0.8674, 0.2366, 0.8871]}, {"w": "functions", "b": [0.2429, 0.8674, 0.3368, 0.8871]}, {"w": "to", "b": [0.3431, 0.8674, 0.3627, 0.8871]}, {"w": "choose", "b": [0.369, 0.8674, 0.4391, 0.8871]}, {"w": "for", "b": [0.4454, 0.8674, 0.4748, 0.8871]}, {"w": "a", "b": [0.4811, 0.8674, 0.4923, 0.8871]}, {"w": "wide", "b": [0.4986, 0.8674, 0.5477, 0.8871]}, {"w": "range", "b": [0.554, 0.8674, 0.61, 0.8871]}, {"w": "of", "b": [0.6163, 0.8674, 0.6373, 0.8871]}, {"w": "common", "b": [0.6436, 0.8674, 0.7319, 0.8871]}, {"w": "tasks.", "b": [0.7382, 0.8674, 0.795, 0.8871]}]}]}, {"page": 99, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3.2. Introduction to Keras", "words": [{"w": "3.2.", "b": [0.1294, 0.0864, 0.172, 0.1086]}, {"w": "Introduction", "b": [0.1791, 0.0864, 0.3331, 0.1086]}, {"w": "to", "b": [0.3402, 0.0864, 0.3638, 0.1086]}, {"w": "Keras", "b": [0.3709, 0.0864, 0.4434, 0.1086]}]}, {"id": "b_1", "type": "paragraph", "text": "Throughout this book, the code examples use Keras (https://keras.io). Keras is a deep-learning framework for Python that provides a convenient way to define and train almost any kind of deep-learning model. Keras was initially developed for researchers, with the aim of enabling fast experimentation.", "words": [{"w": "Throughout", "b": [0.1294, 0.132, 0.2485, 0.1518]}, {"w": "this", "b": [0.2548, 0.132, 0.2913, 0.1518]}, {"w": "book,", "b": [0.2976, 0.132, 0.3544, 0.1518]}, {"w": "the", "b": [0.3607, 0.132, 0.3915, 0.1518]}, {"w": "code", "b": [0.3978, 0.132, 0.4454, 0.1518]}, {"w": "examples", "b": [0.4517, 0.132, 0.547, 0.1518]}, {"w": "use", "b": [0.5533, 0.132, 0.5869, 0.1518]}, {"w": "Keras", "b": [0.5932, 0.132, 0.6521, 0.1518]}, {"w": "(https://keras.io).", "b": [0.6584, 0.132, 0.8307, 0.1518]}, {"w": "Keras", "b": [0.1294, 0.1525, 0.1882, 0.1723]}, {"w": "is", "b": [0.1945, 0.1525, 0.2114, 0.1723]}, {"w": "a", "b": [0.2177, 0.1525, 0.2289, 0.1723]}, {"w": "deep-learning", "b": [0.2352, 0.1525, 0.3739, 0.1723]}, {"w": "framework", "b": [0.3802, 0.1525, 0.4908, 0.1723]}, {"w": "for", "b": [0.4972, 0.1525, 0.5266, 0.1723]}, {"w": "Python", "b": [0.5329, 0.1525, 0.6044, 0.1723]}, {"w": "that", "b": [0.6107, 0.1525, 0.6485, 0.1723]}, {"w": "provides", "b": [0.6548, 0.1525, 0.7417, 0.1723]}, {"w": "a", "b": [0.748, 0.1525, 0.7592, 0.1723]}, {"w": "convenient", "b": [0.1294, 0.173, 0.2401, 0.1928]}, {"w": "way", "b": [0.2464, 0.173, 0.2884, 0.1928]}, {"w": "to", "b": [0.2947, 0.173, 0.3144, 0.1928]}, {"w": "define", "b": [0.3207, 0.173, 0.3837, 0.1928]}, {"w": "and", "b": [0.39, 0.173, 0.4264, 0.1928]}, {"w": "train", "b": [0.4328, 0.173, 0.479, 0.1928]}, {"w": "almost", "b": [0.4853, 0.173, 0.5526, 0.1928]}, {"w": "any", "b": [0.5589, 0.173, 0.5953, 0.1928]}, {"w": "kind", "b": [0.6016, 0.173, 0.6465, 0.1928]}, {"w": "of", "b": [0.6528, 0.173, 0.6738, 0.1928]}, {"w": "deep-learning", "b": [0.6801, 0.173, 0.8188, 0.1928]}, {"w": "model.", "b": [0.1294, 0.1935, 0.1988, 0.2133]}, {"w": "Keras", "b": [0.2051, 0.1935, 0.2639, 0.2133]}, {"w": "was", "b": [0.2702, 0.1935, 0.3094, 0.2133]}, {"w": "initially", "b": [0.3158, 0.1935, 0.3943, 0.2133]}, {"w": "developed", "b": [0.4006, 0.1935, 0.5042, 0.2133]}, {"w": "for", "b": [0.5105, 0.1935, 0.54, 0.2133]}, {"w": "researchers,", "b": [0.5463, 0.1935, 0.666, 0.2133]}, {"w": "with", "b": [0.6723, 0.1935, 0.7172, 0.2133]}, {"w": "the", "b": [0.7235, 0.1935, 0.7543, 0.2133]}, {"w": "aim", "b": [0.7606, 0.1935, 0.7984, 0.2133]}, {"w": "of", "b": [0.8048, 0.1935, 0.8258, 0.2133]}, {"w": "enabling", "b": [0.1294, 0.214, 0.2163, 0.2338]}, {"w": "fast", "b": [0.2226, 0.214, 0.259, 0.2338]}, {"w": "experimentation.", "b": [0.2653, 0.214, 0.4356, 0.2338]}]}, {"id": "b_2", "type": "paragraph", "text": "Keras has the following key features:", "words": [{"w": "Keras", "b": [0.1294, 0.2568, 0.1882, 0.2766]}, {"w": "has", "b": [0.1945, 0.2568, 0.2282, 0.2766]}, {"w": "the", "b": [0.2345, 0.2568, 0.2653, 0.2766]}, {"w": "following", "b": [0.2716, 0.2568, 0.3697, 0.2766]}, {"w": "key", "b": [0.376, 0.2568, 0.4124, 0.2766]}, {"w": "features:", "b": [0.4188, 0.2568, 0.5056, 0.2766]}]}, {"id": "b_3", "type": "paragraph", "text": "It allows the same code to run seamlessly on CPU or GPU. It has a user-friendly API that makes it easy to quickly prototype deep-learning models. It has built-in support for convolutional networks (for computer vision), recurrent networks (for sequence processing), and any combination of both. It supports arbitrary network architectures: multi-input or multi- output models, layer sharing, model sharing, and so on. This means Keras is appropriate for building essentially any deep-learning model, from a generative adversarial network to a neural Turing machine.", "words": [{"w": "It", "b": [0.1799, 0.2951, 0.1953, 0.3149]}, {"w": "allows", "b": [0.2016, 0.2951, 0.2674, 0.3149]}, {"w": "the", "b": [0.2738, 0.2951, 0.3046, 0.3149]}, {"w": "same", "b": [0.3109, 0.2951, 0.3627, 0.3149]}, {"w": "code", "b": [0.369, 0.2951, 0.4167, 0.3149]}, {"w": "to", "b": [0.423, 0.2951, 0.4426, 0.3149]}, {"w": "run", "b": [0.4489, 0.2951, 0.4825, 0.3149]}, {"w": "seamlessly", "b": [0.4888, 0.2951, 0.5981, 0.3149]}, {"w": "on", "b": [0.6044, 0.2951, 0.6297, 0.3149]}, {"w": "CPU", "b": [0.636, 0.2951, 0.685, 0.3149]}, {"w": "or", "b": [0.6913, 0.2951, 0.7124, 0.3149]}, {"w": "GPU.", "b": [0.7187, 0.2951, 0.7754, 0.3149]}, {"w": "It", "b": [0.1799, 0.3156, 0.1953, 0.3354]}, {"w": "has", "b": [0.2016, 0.3156, 0.2352, 0.3354]}, {"w": "a", "b": [0.2415, 0.3156, 0.2527, 0.3354]}, {"w": "user-friendly", "b": [0.259, 0.3156, 0.3888, 0.3354]}, {"w": "API", "b": [0.3951, 0.3156, 0.4357, 0.3354]}, {"w": "that", "b": [0.4421, 0.3156, 0.4799, 0.3354]}, {"w": "makes", "b": [0.4862, 0.3156, 0.5506, 0.3354]}, {"w": "it", "b": [0.557, 0.3156, 0.571, 0.3354]}, {"w": "easy", "b": [0.5773, 0.3156, 0.6221, 0.3354]}, {"w": "to", "b": [0.6284, 0.3156, 0.648, 0.3354]}, {"w": "quickly", "b": [0.6544, 0.3156, 0.73, 0.3354]}, {"w": "prototype", "b": [0.7363, 0.3156, 0.833, 0.3354]}, {"w": "deep-learning", "b": [0.1799, 0.3361, 0.3186, 0.3559]}, {"w": "models.", "b": [0.3249, 0.3361, 0.404, 0.3559]}, {"w": "It", "b": [0.1799, 0.3566, 0.1953, 0.3764]}, {"w": "has", "b": [0.2016, 0.3566, 0.2352, 0.3764]}, {"w": "built-in", "b": [0.2415, 0.3566, 0.3158, 0.3764]}, {"w": "support", "b": [0.3221, 0.3566, 0.3978, 0.3764]}, {"w": "for", "b": [0.4041, 0.3566, 0.4335, 0.3764]}, {"w": "convolutional", "b": [0.4398, 0.3566, 0.5786, 0.3764]}, {"w": "networks", "b": [0.5849, 0.3566, 0.6773, 0.3764]}, {"w": "(for", "b": [0.6836, 0.3566, 0.7215, 0.3764]}, {"w": "computer", "b": [0.7278, 0.3566, 0.823, 0.3764]}, {"w": "vision),", "b": [0.1799, 0.3771, 0.2562, 0.3969]}, {"w": "recurrent", "b": [0.2626, 0.3771, 0.3536, 0.3969]}, {"w": "networks", "b": [0.3599, 0.3771, 0.4524, 0.3969]}, {"w": "(for", "b": [0.4587, 0.3771, 0.4965, 0.3969]}, {"w": "sequence", "b": [0.5028, 0.3771, 0.5953, 0.3969]}, {"w": "processing),", "b": [0.6016, 0.3771, 0.7242, 0.3969]}, {"w": "and", "b": [0.7305, 0.3771, 0.7669, 0.3969]}, {"w": "any", "b": [0.7732, 0.3771, 0.8096, 0.3969]}, {"w": "combination", "b": [0.1799, 0.3976, 0.306, 0.4174]}, {"w": "of", "b": [0.3123, 0.3976, 0.3333, 0.4174]}, {"w": "both.", "b": [0.3396, 0.3976, 0.3908, 0.4174]}, {"w": "It", "b": [0.1799, 0.4181, 0.1953, 0.4379]}, {"w": "supports", "b": [0.2016, 0.4181, 0.2871, 0.4379]}, {"w": "arbitrary", "b": [0.2934, 0.4181, 0.3802, 0.4379]}, {"w": "network", "b": [0.3865, 0.4181, 0.4692, 0.4379]}, {"w": "architectures:", "b": [0.4755, 0.4181, 0.6114, 0.4379]}, {"w": "multi-input", "b": [0.6177, 0.4181, 0.7312, 0.4379]}, {"w": "or", "b": [0.7376, 0.4181, 0.7586, 0.4379]}, {"w": "multi-", "b": [0.7649, 0.4181, 0.8266, 0.4379]}, {"w": "output", "b": [0.1799, 0.4386, 0.2443, 0.4584]}, {"w": "models,", "b": [0.2506, 0.4386, 0.3298, 0.4584]}, {"w": "layer", "b": [0.3361, 0.4386, 0.3866, 0.4584]}, {"w": "sharing,", "b": [0.3929, 0.4386, 0.4734, 0.4584]}, {"w": "model", "b": [0.4797, 0.4386, 0.5428, 0.4584]}, {"w": "sharing,", "b": [0.5491, 0.4386, 0.6297, 0.4584]}, {"w": "and", "b": [0.636, 0.4386, 0.6724, 0.4584]}, {"w": "so", "b": [0.6787, 0.4386, 0.7012, 0.4584]}, {"w": "on.", "b": [0.7075, 0.4386, 0.739, 0.4584]}, {"w": "This", "b": [0.7452, 0.4386, 0.7901, 0.4584]}, {"w": "means", "b": [0.7964, 0.4386, 0.8608, 0.4584]}, {"w": "Keras", "b": [0.1799, 0.4591, 0.2387, 0.4789]}, {"w": "is", "b": [0.245, 0.4591, 0.2618, 0.4789]}, {"w": "appropriate", "b": [0.2681, 0.4591, 0.383, 0.4789]}, {"w": "for", "b": [0.3893, 0.4591, 0.4187, 0.4789]}, {"w": "building", "b": [0.425, 0.4591, 0.5091, 0.4789]}, {"w": "essentially", "b": [0.5154, 0.4591, 0.6219, 0.4789]}, {"w": "any", "b": [0.6283, 0.4591, 0.6647, 0.4789]}, {"w": "deep-learning", "b": [0.671, 0.4591, 0.8097, 0.4789]}, {"w": "model,", "b": [0.1799, 0.4796, 0.2492, 0.4994]}, {"w": "from", "b": [0.2555, 0.4796, 0.3046, 0.4994]}, {"w": "a", "b": [0.3109, 0.4796, 0.3221, 0.4994]}, {"w": "generative", "b": [0.3284, 0.4796, 0.4335, 0.4994]}, {"w": "adversarial", "b": [0.4398, 0.4796, 0.5504, 0.4994]}, {"w": "network", "b": [0.5567, 0.4796, 0.6394, 0.4994]}, {"w": "to", "b": [0.6457, 0.4796, 0.6653, 0.4994]}, {"w": "a", "b": [0.6716, 0.4796, 0.6828, 0.4994]}, {"w": "neural", "b": [0.6891, 0.4796, 0.7521, 0.4994]}, {"w": "Turing", "b": [0.7584, 0.4796, 0.8262, 0.4994]}, {"w": "machine.", "b": [0.1799, 0.5001, 0.2716, 0.5199]}]}, {"id": "b_4", "type": "paragraph", "text": "Keras is distributed under the permissive MIT license, which means it can be freely used in commercial projects. It’s compatible with any version of Python from 2.7 to 3.6 (as of mid-2017).", "words": [{"w": "Keras", "b": [0.1294, 0.5429, 0.1882, 0.5627]}, {"w": "is", "b": [0.1945, 0.5429, 0.2114, 0.5627]}, {"w": "distributed", "b": [0.2177, 0.5429, 0.3256, 0.5627]}, {"w": "under", "b": [0.3319, 0.5429, 0.3893, 0.5627]}, {"w": "the", "b": [0.3956, 0.5429, 0.4265, 0.5627]}, {"w": "permissive", "b": [0.4328, 0.5429, 0.5421, 0.5627]}, {"w": "MIT", "b": [0.5484, 0.5429, 0.5946, 0.5627]}, {"w": "license,", "b": [0.6009, 0.5429, 0.6773, 0.5627]}, {"w": "which", "b": [0.6836, 0.5429, 0.7452, 0.5627]}, {"w": "means", "b": [0.7516, 0.5429, 0.816, 0.5627]}, {"w": "it", "b": [0.8223, 0.5429, 0.8363, 0.5627]}, {"w": "can", "b": [0.1294, 0.5634, 0.1644, 0.5832]}, {"w": "be", "b": [0.1707, 0.5634, 0.1945, 0.5832]}, {"w": "freely", "b": [0.2009, 0.5634, 0.2597, 0.5832]}, {"w": "used", "b": [0.266, 0.5634, 0.3122, 0.5832]}, {"w": "in", "b": [0.3185, 0.5634, 0.3382, 0.5832]}, {"w": "commercial", "b": [0.3445, 0.5634, 0.4636, 0.5832]}, {"w": "projects.", "b": [0.4699, 0.5634, 0.556, 0.5832]}, {"w": "It’s", "b": [0.5623, 0.5634, 0.5945, 0.5832]}, {"w": "compatible", "b": [0.6008, 0.5634, 0.7129, 0.5832]}, {"w": "with", "b": [0.7192, 0.5634, 0.764, 0.5832]}, {"w": "any", "b": [0.7703, 0.5634, 0.8068, 0.5832]}, {"w": "version", "b": [0.1294, 0.5839, 0.2037, 0.6037]}, {"w": "of", "b": [0.21, 0.5839, 0.231, 0.6037]}, {"w": "Python", "b": [0.2373, 0.5839, 0.3088, 0.6037]}, {"w": "from", "b": [0.3151, 0.5839, 0.3641, 0.6037]}, {"w": "2.7", "b": [0.3704, 0.5839, 0.402, 0.6037]}, {"w": "to", "b": [0.4083, 0.5839, 0.4279, 0.6037]}, {"w": "3.6", "b": [0.4342, 0.5839, 0.4657, 0.6037]}, {"w": "(as", "b": [0.4721, 0.5839, 0.5015, 0.6037]}, {"w": "of", "b": [0.5078, 0.5839, 0.5288, 0.6037]}, {"w": "mid-2017).", "b": [0.5351, 0.5839, 0.6479, 0.6037]}]}, {"id": "b_5", "type": "paragraph", "text": "Keras has well over 200,000 users, ranging from academic researchers and engineers at both startups and large companies to graduate students and hobbyists. Keras is used at Google, Netflix, Uber, CERN, Yelp, Square, and hundreds of startups working on a wide range of problems. Keras is also a popular framework on Kaggle, the machine-learning competition website, where almost every recent deep-learning competition has been won using Keras models.", "words": [{"w": "Keras", "b": [0.1294, 0.6267, 0.1882, 0.6464]}, {"w": "has", "b": [0.1945, 0.6267, 0.2282, 0.6464]}, {"w": "well", "b": [0.2345, 0.6267, 0.2779, 0.6464]}, {"w": "over", "b": [0.2842, 0.6267, 0.329, 0.6464]}, {"w": "200,000", "b": [0.3354, 0.6267, 0.4173, 0.6464]}, {"w": "users,", "b": [0.4236, 0.6267, 0.4818, 0.6464]}, {"w": "ranging", "b": [0.4881, 0.6267, 0.5652, 0.6464]}, {"w": "from", "b": [0.5715, 0.6267, 0.6205, 0.6464]}, {"w": "academic", "b": [0.6268, 0.6267, 0.7221, 0.6464]}, {"w": "researchers", "b": [0.7284, 0.6267, 0.8418, 0.6464]}, {"w": "and", "b": [0.1294, 0.6472, 0.1658, 0.6669]}, {"w": "engineers", "b": [0.1721, 0.6472, 0.2688, 0.6669]}, {"w": "at", "b": [0.2751, 0.6472, 0.2933, 0.6669]}, {"w": "both", "b": [0.2996, 0.6472, 0.3445, 0.6669]}, {"w": "startups", "b": [0.3508, 0.6472, 0.4293, 0.6669]}, {"w": "and", "b": [0.4356, 0.6472, 0.472, 0.6669]}, {"w": "large", "b": [0.4783, 0.6472, 0.5282, 0.6669]}, {"w": "companies", "b": [0.5345, 0.6472, 0.6424, 0.6669]}, {"w": "to", "b": [0.6487, 0.6472, 0.6684, 0.6669]}, {"w": "graduate", "b": [0.6746, 0.6472, 0.7615, 0.6669]}, {"w": "students", "b": [0.7678, 0.6472, 0.8505, 0.6669]}, {"w": "and", "b": [0.1294, 0.6677, 0.1658, 0.6874]}, {"w": "hobbyists.", "b": [0.1721, 0.6677, 0.2752, 0.6874]}, {"w": "Keras", "b": [0.2815, 0.6677, 0.3403, 0.6874]}, {"w": "is", "b": [0.3466, 0.6677, 0.3634, 0.6874]}, {"w": "used", "b": [0.3697, 0.6677, 0.416, 0.6874]}, {"w": "at", "b": [0.4223, 0.6677, 0.4405, 0.6874]}, {"w": "Google,", "b": [0.4468, 0.6677, 0.5274, 0.6874]}, {"w": "Netflix,", "b": [0.5337, 0.6677, 0.6115, 0.6874]}, {"w": "Uber,", "b": [0.6178, 0.6677, 0.6735, 0.6874]}, {"w": "CERN,", "b": [0.6798, 0.6677, 0.7533, 0.6874]}, {"w": "Yelp,", "b": [0.7596, 0.6677, 0.8125, 0.6874]}, {"w": "Square,", "b": [0.1294, 0.6882, 0.2058, 0.7079]}, {"w": "and", "b": [0.2121, 0.6882, 0.2485, 0.7079]}, {"w": "hundreds", "b": [0.2548, 0.6882, 0.3473, 0.7079]}, {"w": "of", "b": [0.3536, 0.6882, 0.3746, 0.7079]}, {"w": "startups", "b": [0.3809, 0.6882, 0.4594, 0.7079]}, {"w": "working", "b": [0.4657, 0.6882, 0.5498, 0.7079]}, {"w": "on", "b": [0.5561, 0.6882, 0.5813, 0.7079]}, {"w": "a", "b": [0.5876, 0.6882, 0.5988, 0.7079]}, {"w": "wide", "b": [0.6051, 0.6882, 0.6541, 0.7079]}, {"w": "range", "b": [0.6604, 0.6882, 0.7165, 0.7079]}, {"w": "of", "b": [0.7228, 0.6882, 0.7438, 0.7079]}, {"w": "problems.", "b": [0.7501, 0.6882, 0.8503, 0.7079]}, {"w": "Keras", "b": [0.1294, 0.7087, 0.1882, 0.7284]}, {"w": "is", "b": [0.1945, 0.7087, 0.2114, 0.7284]}, {"w": "also", "b": [0.2177, 0.7087, 0.2583, 0.7284]}, {"w": "a", "b": [0.2646, 0.7087, 0.2758, 0.7284]}, {"w": "popular", "b": [0.2821, 0.7087, 0.3592, 0.7284]}, {"w": "framework", "b": [0.3655, 0.7087, 0.4762, 0.7284]}, {"w": "on", "b": [0.4825, 0.7087, 0.5077, 0.7284]}, {"w": "Kaggle,", "b": [0.514, 0.7087, 0.5932, 0.7284]}, {"w": "the", "b": [0.5995, 0.7087, 0.6303, 0.7284]}, {"w": "machine-learning", "b": [0.6366, 0.7087, 0.8131, 0.7284]}, {"w": "competition", "b": [0.1294, 0.7292, 0.2499, 0.7489]}, {"w": "website,", "b": [0.2562, 0.7292, 0.3396, 0.7489]}, {"w": "where", "b": [0.3459, 0.7292, 0.4076, 0.7489]}, {"w": "almost", "b": [0.4138, 0.7292, 0.4811, 0.7489]}, {"w": "every", "b": [0.4874, 0.7292, 0.5434, 0.7489]}, {"w": "recent", "b": [0.5497, 0.7292, 0.6114, 0.7489]}, {"w": "deep-learning", "b": [0.6177, 0.7292, 0.7564, 0.7489]}, {"w": "competition", "b": [0.1294, 0.7497, 0.2499, 0.7694]}, {"w": "has", "b": [0.2562, 0.7497, 0.2899, 0.7694]}, {"w": "been", "b": [0.2962, 0.7497, 0.3438, 0.7694]}, {"w": "won", "b": [0.3501, 0.7497, 0.3936, 0.7694]}, {"w": "using", "b": [0.3999, 0.7497, 0.4545, 0.7694]}, {"w": "Keras", "b": [0.4608, 0.7497, 0.5197, 0.7694]}, {"w": "models.", "b": [0.526, 0.7497, 0.6051, 0.7694]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 3.2. Google web search interest for different deep-learning frameworks over time", "words": [{"w": "Figure", "b": [0.1294, 0.7875, 0.1827, 0.8024]}, {"w": "3.2.", "b": [0.1874, 0.7875, 0.2158, 0.8024]}, {"w": "Google", "b": [0.2205, 0.7875, 0.2772, 0.8024]}, {"w": "web", "b": [0.282, 0.7875, 0.3145, 0.8024]}, {"w": "search", "b": [0.3193, 0.7875, 0.3715, 0.8024]}, {"w": "interest", "b": [0.3762, 0.7875, 0.4368, 0.8024]}, {"w": "for", "b": [0.4415, 0.7875, 0.4657, 0.8024]}, {"w": "different", "b": [0.4704, 0.7875, 0.5405, 0.8024]}, {"w": "deep-learning", "b": [0.5452, 0.7875, 0.6566, 0.8024]}, {"w": "frameworks", "b": [0.6613, 0.7875, 0.759, 0.8024]}, {"w": "over", "b": [0.7638, 0.7875, 0.7995, 0.8024]}, {"w": "time", "b": [0.8042, 0.7875, 0.8399, 0.8024]}]}]}, {"page": 100, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3.2.1. Keras, TensorFlow, Theano, and CNTK", "words": [{"w": "3.2.1.", "b": [0.1294, 0.4137, 0.1862, 0.4334]}, {"w": "Keras,", "b": [0.1925, 0.4137, 0.2632, 0.4334]}, {"w": "TensorFlow,", "b": [0.2695, 0.4137, 0.4011, 0.4334]}, {"w": "Theano,", "b": [0.4074, 0.4137, 0.495, 0.4334]}, {"w": "and", "b": [0.5013, 0.4137, 0.5419, 0.4334]}, {"w": "CNTK", "b": [0.5482, 0.4137, 0.6211, 0.4334]}]}, {"id": "b_1", "type": "paragraph", "text": "Keras is a model-level library, providing high-level building blocks for developing deep-learning models. It doesn’t handle low-level operations such as tensor manipulation and differentiation. Instead, it relies on a specialized, well-optimized tensor library to do so, serving as the backend engine of Keras. Rather than choosing a single tensor library and tying the implementation of Keras to that library, Keras handles the problem in a modular way (see figure 3.3); thus several different backend engines can be plugged seamlessly into Keras. Currently, the three existing backend implementations are the TensorFlow backend, the Theano backend, and the Microsoft Cognitive Toolkit (CNTK) backend. In the future, it’s likely that Keras will be extended to work with even more deep-learning execution engines.", "words": [{"w": "Keras", "b": [0.1294, 0.4565, 0.1882, 0.4762]}, {"w": "is", "b": [0.1945, 0.4565, 0.2114, 0.4762]}, {"w": "a", "b": [0.2177, 0.4565, 0.2289, 0.4762]}, {"w": "model-level", "b": [0.2352, 0.4565, 0.3557, 0.4762]}, {"w": "library,", "b": [0.362, 0.4565, 0.4339, 0.4762]}, {"w": "providing", "b": [0.4402, 0.4565, 0.5383, 0.4762]}, {"w": "high-level", "b": [0.5446, 0.4565, 0.6469, 0.4762]}, {"w": "building", "b": [0.6532, 0.4565, 0.7373, 0.4762]}, {"w": "blocks", "b": [0.7436, 0.4565, 0.8095, 0.4762]}, {"w": "for", "b": [0.8158, 0.4565, 0.8452, 0.4762]}, {"w": "developing", "b": [0.1294, 0.477, 0.2415, 0.4967]}, {"w": "deep-learning", "b": [0.2478, 0.477, 0.3865, 0.4967]}, {"w": "models.", "b": [0.3928, 0.477, 0.472, 0.4967]}, {"w": "It", "b": [0.4783, 0.477, 0.4937, 0.4967]}, {"w": "doesn’t", "b": [0.5, 0.477, 0.5738, 0.4967]}, {"w": "handle", "b": [0.5801, 0.477, 0.6473, 0.4967]}, {"w": "low-level", "b": [0.6536, 0.477, 0.7489, 0.4967]}, {"w": "operations", "b": [0.7552, 0.477, 0.8603, 0.4967]}, {"w": "such", "b": [0.1294, 0.4975, 0.1757, 0.5172]}, {"w": "as", "b": [0.182, 0.4975, 0.203, 0.5172]}, {"w": "tensor", "b": [0.2093, 0.4975, 0.2709, 0.5172]}, {"w": "manipulation", "b": [0.2772, 0.4975, 0.4104, 0.5172]}, {"w": "and", "b": [0.4167, 0.4975, 0.4531, 0.5172]}, {"w": "differentiation.", "b": [0.4594, 0.4975, 0.6095, 0.5172]}, {"w": "Instead,", "b": [0.6158, 0.4975, 0.695, 0.5172]}, {"w": "it", "b": [0.7013, 0.4975, 0.7153, 0.5172]}, {"w": "relies", "b": [0.7216, 0.4975, 0.7763, 0.5172]}, {"w": "on", "b": [0.7826, 0.4975, 0.8078, 0.5172]}, {"w": "a", "b": [0.8141, 0.4975, 0.8253, 0.5172]}, {"w": "specialized,", "b": [0.1294, 0.518, 0.2478, 0.5377]}, {"w": "well-optimized", "b": [0.2541, 0.518, 0.4068, 0.5377]}, {"w": "tensor", "b": [0.4131, 0.518, 0.4747, 0.5377]}, {"w": "library", "b": [0.481, 0.518, 0.5483, 0.5377]}, {"w": "to", "b": [0.5546, 0.518, 0.5742, 0.5377]}, {"w": "do", "b": [0.5805, 0.518, 0.6058, 0.5377]}, {"w": "so,", "b": [0.6121, 0.518, 0.6408, 0.5377]}, {"w": "serving", "b": [0.6471, 0.518, 0.7214, 0.5377]}, {"w": "as", "b": [0.7277, 0.518, 0.7487, 0.5377]}, {"w": "the", "b": [0.755, 0.518, 0.7858, 0.5377]}, {"w": "backend", "b": [0.1294, 0.5385, 0.2135, 0.5582]}, {"w": "engine", "b": [0.2198, 0.5385, 0.287, 0.5582]}, {"w": "of", "b": [0.2933, 0.5385, 0.3143, 0.5582]}, {"w": "Keras.", "b": [0.3206, 0.5385, 0.3858, 0.5582]}, {"w": "Rather", "b": [0.3921, 0.5385, 0.4593, 0.5582]}, {"w": "than", "b": [0.4656, 0.5385, 0.5091, 0.5582]}, {"w": "choosing", "b": [0.5154, 0.5385, 0.6065, 0.5582]}, {"w": "a", "b": [0.6128, 0.5385, 0.624, 0.5582]}, {"w": "single", "b": [0.6303, 0.5385, 0.6905, 0.5582]}, {"w": "tensor", "b": [0.6968, 0.5385, 0.7585, 0.5582]}, {"w": "library", "b": [0.7648, 0.5385, 0.832, 0.5582]}, {"w": "and", "b": [0.1294, 0.559, 0.1658, 0.5787]}, {"w": "tying", "b": [0.1721, 0.559, 0.224, 0.5787]}, {"w": "the", "b": [0.2303, 0.559, 0.2611, 0.5787]}, {"w": "implementation", "b": [0.2674, 0.559, 0.4258, 0.5787]}, {"w": "of", "b": [0.4321, 0.559, 0.4531, 0.5787]}, {"w": "Keras", "b": [0.4594, 0.559, 0.5183, 0.5787]}, {"w": "to", "b": [0.5246, 0.559, 0.5442, 0.5787]}, {"w": "that", "b": [0.5505, 0.559, 0.5883, 0.5787]}, {"w": "library,", "b": [0.5947, 0.559, 0.6665, 0.5787]}, {"w": "Keras", "b": [0.6728, 0.559, 0.7316, 0.5787]}, {"w": "handles", "b": [0.7379, 0.559, 0.815, 0.5787]}, {"w": "the", "b": [0.8213, 0.559, 0.8521, 0.5787]}, {"w": "problem", "b": [0.1294, 0.5795, 0.2135, 0.5992]}, {"w": "in", "b": [0.2198, 0.5795, 0.2394, 0.5992]}, {"w": "a", "b": [0.2457, 0.5795, 0.2569, 0.5992]}, {"w": "modular", "b": [0.2632, 0.5795, 0.3473, 0.5992]}, {"w": "way", "b": [0.3536, 0.5795, 0.3956, 0.5992]}, {"w": "(see", "b": [0.402, 0.5795, 0.4426, 0.5992]}, {"w": "figure", "b": [0.4488, 0.5795, 0.5091, 0.5992]}, {"w": "3.3);", "b": [0.5154, 0.5795, 0.5623, 0.5992]}, {"w": "thus", "b": [0.5686, 0.5795, 0.6107, 0.5992]}, {"w": "several", "b": [0.617, 0.5795, 0.6884, 0.5992]}, {"w": "different", "b": [0.6947, 0.5795, 0.7811, 0.5992]}, {"w": "backend", "b": [0.1294, 0.6, 0.2135, 0.6197]}, {"w": "engines", "b": [0.2198, 0.6, 0.2968, 0.6197]}, {"w": "can", "b": [0.3031, 0.6, 0.3382, 0.6197]}, {"w": "be", "b": [0.3445, 0.6, 0.3683, 0.6197]}, {"w": "plugged", "b": [0.3746, 0.6, 0.4559, 0.6197]}, {"w": "seamlessly", "b": [0.4622, 0.6, 0.5715, 0.6197]}, {"w": "into", "b": [0.5778, 0.6, 0.617, 0.6197]}, {"w": "Keras.", "b": [0.6233, 0.6, 0.6885, 0.6197]}, {"w": "Currently,", "b": [0.6948, 0.6, 0.7961, 0.6197]}, {"w": "the", "b": [0.8024, 0.6, 0.8332, 0.6197]}, {"w": "three", "b": [0.1294, 0.6205, 0.1798, 0.6402]}, {"w": "existing", "b": [0.1861, 0.6205, 0.266, 0.6402]}, {"w": "backend", "b": [0.2723, 0.6205, 0.3564, 0.6402]}, {"w": "implementations", "b": [0.3627, 0.6205, 0.5309, 0.6402]}, {"w": "are", "b": [0.5371, 0.6205, 0.5679, 0.6402]}, {"w": "the", "b": [0.5742, 0.6205, 0.605, 0.6402]}, {"w": "TensorFlow", "b": [0.6113, 0.6205, 0.7315, 0.6402]}, {"w": "backend,", "b": [0.7378, 0.6205, 0.8281, 0.6402]}, {"w": "the", "b": [0.8344, 0.6205, 0.8653, 0.6402]}, {"w": "Theano", "b": [0.1294, 0.641, 0.2051, 0.6607]}, {"w": "backend,", "b": [0.2114, 0.641, 0.3017, 0.6607]}, {"w": "and", "b": [0.308, 0.641, 0.3445, 0.6607]}, {"w": "the", "b": [0.3508, 0.641, 0.3816, 0.6607]}, {"w": "Microsoft", "b": [0.3879, 0.641, 0.4874, 0.6607]}, {"w": "Cognitive", "b": [0.4937, 0.641, 0.5932, 0.6607]}, {"w": "Toolkit", "b": [0.5995, 0.641, 0.672, 0.6607]}, {"w": "(CNTK)", "b": [0.6783, 0.641, 0.7638, 0.6607]}, {"w": "backend.", "b": [0.7701, 0.641, 0.8604, 0.6607]}, {"w": "In", "b": [0.1294, 0.6615, 0.1504, 0.6812]}, {"w": "the", "b": [0.1567, 0.6615, 0.1876, 0.6812]}, {"w": "future,", "b": [0.1939, 0.6615, 0.2604, 0.6812]}, {"w": "it’s", "b": [0.2667, 0.6615, 0.2975, 0.6812]}, {"w": "likely", "b": [0.3038, 0.6615, 0.3613, 0.6812]}, {"w": "that", "b": [0.3676, 0.6615, 0.4054, 0.6812]}, {"w": "Keras", "b": [0.4117, 0.6615, 0.4706, 0.6812]}, {"w": "will", "b": [0.4769, 0.6615, 0.5161, 0.6812]}, {"w": "be", "b": [0.5224, 0.6615, 0.5462, 0.6812]}, {"w": "extended", "b": [0.5526, 0.6615, 0.6436, 0.6812]}, {"w": "to", "b": [0.6499, 0.6615, 0.6696, 0.6812]}, {"w": "work", "b": [0.6759, 0.6615, 0.7277, 0.6812]}, {"w": "with", "b": [0.734, 0.6615, 0.7789, 0.6812]}, {"w": "even", "b": [0.7852, 0.6615, 0.8328, 0.6812]}, {"w": "more", "b": [0.1294, 0.682, 0.1813, 0.7017]}, {"w": "deep-learning", "b": [0.1876, 0.682, 0.3262, 0.7017]}, {"w": "execution", "b": [0.3326, 0.682, 0.4306, 0.7017]}, {"w": "engines.", "b": [0.4369, 0.682, 0.5203, 0.7017]}]}, {"id": "b_2", "type": "equation", "text": "Figure 3.3. The deep-learning software and hardware stack", "words": [{"w": "Figure", "b": [0.1294, 0.7198, 0.1827, 0.7346]}, {"w": "3.3.", "b": [0.1874, 0.7198, 0.2158, 0.7346]}, {"w": "The", "b": [0.2205, 0.7198, 0.252, 0.7346]}, {"w": "deep-learning", "b": [0.2567, 0.7198, 0.3682, 0.7346]}, {"w": "software", "b": [0.3729, 0.7198, 0.4419, 0.7346]}, {"w": "and", "b": [0.4466, 0.7198, 0.4771, 0.7346]}, {"w": "hardware", "b": [0.4818, 0.7198, 0.5603, 0.7346]}, {"w": "stack", "b": [0.5651, 0.7198, 0.6071, 0.7346]}]}]}, {"page": 101, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "TensorFlow, CNTK, and Theano are some of the primary platforms for deep learning today. Theano (http://deeplearning.net/software/theano) is developed by the MILA lab at Université de Montréal, TensorFlow (www.tensorflow.org) is developed by Google, and CNTK (https://github.com/Microsoft/CNTK) is developed by Microsoft. Any piece of code that you write with Keras can be run with any of these backends without having to change anything in the code: you can seamlessly switch between the two during development, which often proves useful—for instance, if one of these backends proves to be faster for a specific task. We recommend using the TensorFlow backend as the default for most of your deep-learning needs, because it’s the most widely adopted, scalable, and production ready.", "words": [{"w": "TensorFlow,", "b": [0.1294, 0.0857, 0.2542, 0.1054]}, {"w": "CNTK,", "b": [0.2605, 0.0857, 0.3355, 0.1054]}, {"w": "and", "b": [0.3418, 0.0857, 0.3782, 0.1054]}, {"w": "Theano", "b": [0.3846, 0.0857, 0.4602, 0.1054]}, {"w": "are", "b": [0.4665, 0.0857, 0.4973, 0.1054]}, {"w": "some", "b": [0.5036, 0.0857, 0.5569, 0.1054]}, {"w": "of", "b": [0.5632, 0.0857, 0.5842, 0.1054]}, {"w": "the", "b": [0.5905, 0.0857, 0.6213, 0.1054]}, {"w": "primary", "b": [0.6276, 0.0857, 0.7075, 0.1054]}, {"w": "platforms", "b": [0.7138, 0.0857, 0.8105, 0.1054]}, {"w": "for", "b": [0.8168, 0.0857, 0.8462, 0.1054]}, {"w": "deep", "b": [0.1294, 0.1062, 0.177, 0.1259]}, {"w": "learning", "b": [0.1833, 0.1062, 0.266, 0.1259]}, {"w": "today.", "b": [0.2723, 0.1062, 0.333, 0.1259]}, {"w": "Theano", "b": [0.3393, 0.1062, 0.415, 0.1259]}, {"w": "(http://deeplearning.net/software/theano)", "b": [0.4213, 0.1062, 0.8338, 0.1259]}, {"w": "is", "b": [0.8401, 0.1062, 0.8569, 0.1259]}, {"w": "developed", "b": [0.1294, 0.1267, 0.2331, 0.1464]}, {"w": "by", "b": [0.2394, 0.1267, 0.2646, 0.1464]}, {"w": "the", "b": [0.2709, 0.1267, 0.3018, 0.1464]}, {"w": "MILA", "b": [0.3081, 0.1267, 0.3725, 0.1464]}, {"w": "lab", "b": [0.3788, 0.1267, 0.4096, 0.1464]}, {"w": "at", "b": [0.416, 0.1267, 0.4342, 0.1464]}, {"w": "Université", "b": [0.4404, 0.1267, 0.5455, 0.1464]}, {"w": "de", "b": [0.5518, 0.1267, 0.5756, 0.1464]}, {"w": "Montréal,", "b": [0.5819, 0.1267, 0.6821, 0.1464]}, {"w": "TensorFlow", "b": [0.6884, 0.1267, 0.8085, 0.1464]}, {"w": "(www.tensorflow.org)", "b": [0.1294, 0.1472, 0.3512, 0.1669]}, {"w": "is", "b": [0.3576, 0.1472, 0.3744, 0.1669]}, {"w": "developed", "b": [0.3807, 0.1472, 0.4844, 0.1669]}, {"w": "by", "b": [0.4907, 0.1472, 0.5159, 0.1669]}, {"w": "Google,", "b": [0.5222, 0.1472, 0.6028, 0.1669]}, {"w": "and", "b": [0.6091, 0.1472, 0.6455, 0.1669]}, {"w": "CNTK", "b": [0.6518, 0.1472, 0.7205, 0.1669]}, {"w": "(https://github.com/Microsoft/CNTK)", "b": [0.1294, 0.1677, 0.5127, 0.1874]}, {"w": "is", "b": [0.519, 0.1677, 0.5358, 0.1874]}, {"w": "developed", "b": [0.5421, 0.1677, 0.6458, 0.1874]}, {"w": "by", "b": [0.6521, 0.1677, 0.6773, 0.1874]}, {"w": "Microsoft.", "b": [0.6836, 0.1677, 0.7894, 0.1874]}, {"w": "Any", "b": [0.7957, 0.1677, 0.8392, 0.1874]}, {"w": "piece", "b": [0.1294, 0.1882, 0.1826, 0.2079]}, {"w": "of", "b": [0.1889, 0.1882, 0.21, 0.2079]}, {"w": "code", "b": [0.2163, 0.1882, 0.2639, 0.2079]}, {"w": "that", "b": [0.2702, 0.1882, 0.308, 0.2079]}, {"w": "you", "b": [0.3143, 0.1882, 0.3522, 0.2079]}, {"w": "write", "b": [0.3585, 0.1882, 0.4103, 0.2079]}, {"w": "with", "b": [0.4166, 0.1882, 0.4615, 0.2079]}, {"w": "Keras", "b": [0.4678, 0.1882, 0.5266, 0.2079]}, {"w": "can", "b": [0.5329, 0.1882, 0.5679, 0.2079]}, {"w": "be", "b": [0.5742, 0.1882, 0.5981, 0.2079]}, {"w": "run", "b": [0.6044, 0.1882, 0.638, 0.2079]}, {"w": "with", "b": [0.6443, 0.1882, 0.6891, 0.2079]}, {"w": "any", "b": [0.6955, 0.1882, 0.7319, 0.2079]}, {"w": "of", "b": [0.7382, 0.1882, 0.7592, 0.2079]}, {"w": "these", "b": [0.7655, 0.1882, 0.8173, 0.2079]}, {"w": "backends", "b": [0.1294, 0.2087, 0.2233, 0.2284]}, {"w": "without", "b": [0.2296, 0.2087, 0.3067, 0.2284]}, {"w": "having", "b": [0.313, 0.2087, 0.3816, 0.2284]}, {"w": "to", "b": [0.3879, 0.2087, 0.4075, 0.2284]}, {"w": "change", "b": [0.4138, 0.2087, 0.4853, 0.2284]}, {"w": "anything", "b": [0.4916, 0.2087, 0.5799, 0.2284]}, {"w": "in", "b": [0.5862, 0.2087, 0.6058, 0.2284]}, {"w": "the", "b": [0.6121, 0.2087, 0.6429, 0.2284]}, {"w": "code:", "b": [0.6493, 0.2087, 0.7039, 0.2284]}, {"w": "you", "b": [0.7102, 0.2087, 0.748, 0.2284]}, {"w": "can", "b": [0.7543, 0.2087, 0.7894, 0.2284]}, {"w": "seamlessly", "b": [0.1294, 0.2292, 0.2387, 0.2489]}, {"w": "switch", "b": [0.245, 0.2292, 0.3109, 0.2489]}, {"w": "between", "b": [0.3172, 0.2292, 0.4012, 0.2489]}, {"w": "the", "b": [0.4076, 0.2292, 0.4384, 0.2489]}, {"w": "two", "b": [0.4447, 0.2292, 0.4825, 0.2489]}, {"w": "during", "b": [0.4888, 0.2292, 0.5547, 0.2489]}, {"w": "development,", "b": [0.561, 0.2292, 0.6976, 0.2489]}, {"w": "which", "b": [0.7039, 0.2292, 0.7656, 0.2489]}, {"w": "often", "b": [0.7719, 0.2292, 0.8237, 0.2489]}, {"w": "proves", "b": [0.1294, 0.2497, 0.1967, 0.2694]}, {"w": "useful—for", "b": [0.203, 0.2497, 0.3193, 0.2694]}, {"w": "instance,", "b": [0.3256, 0.2497, 0.4145, 0.2694]}, {"w": "if", "b": [0.4208, 0.2497, 0.4363, 0.2694]}, {"w": "one", "b": [0.4426, 0.2497, 0.479, 0.2694]}, {"w": "of", "b": [0.4853, 0.2497, 0.5063, 0.2694]}, {"w": "these", "b": [0.5126, 0.2497, 0.5645, 0.2694]}, {"w": "backends", "b": [0.5708, 0.2497, 0.6646, 0.2694]}, {"w": "proves", "b": [0.6709, 0.2497, 0.7382, 0.2694]}, {"w": "to", "b": [0.7445, 0.2497, 0.7641, 0.2694]}, {"w": "be", "b": [0.7704, 0.2497, 0.7942, 0.2694]}, {"w": "faster", "b": [0.8005, 0.2497, 0.8566, 0.2694]}, {"w": "for", "b": [0.1294, 0.2702, 0.1588, 0.2899]}, {"w": "a", "b": [0.1651, 0.2702, 0.1763, 0.2899]}, {"w": "specific", "b": [0.1826, 0.2702, 0.2611, 0.2899]}, {"w": "task.", "b": [0.2674, 0.2702, 0.3143, 0.2899]}, {"w": "We", "b": [0.3206, 0.2702, 0.3536, 0.2899]}, {"w": "recommend", "b": [0.3599, 0.2702, 0.479, 0.2899]}, {"w": "using", "b": [0.4853, 0.2702, 0.54, 0.2899]}, {"w": "the", "b": [0.5463, 0.2702, 0.5771, 0.2899]}, {"w": "TensorFlow", "b": [0.5834, 0.2702, 0.7035, 0.2899]}, {"w": "backend", "b": [0.7098, 0.2702, 0.7939, 0.2899]}, {"w": "as", "b": [0.8002, 0.2702, 0.8212, 0.2899]}, {"w": "the", "b": [0.8275, 0.2702, 0.8584, 0.2899]}, {"w": "default", "b": [0.1294, 0.2907, 0.1995, 0.3104]}, {"w": "for", "b": [0.2058, 0.2907, 0.2352, 0.3104]}, {"w": "most", "b": [0.2415, 0.2907, 0.2906, 0.3104]}, {"w": "of", "b": [0.2969, 0.2907, 0.3179, 0.3104]}, {"w": "your", "b": [0.3242, 0.2907, 0.3704, 0.3104]}, {"w": "deep-learning", "b": [0.3767, 0.2907, 0.5154, 0.3104]}, {"w": "needs,", "b": [0.5217, 0.2907, 0.5855, 0.3104]}, {"w": "because", "b": [0.5918, 0.2907, 0.6716, 0.3104]}, {"w": "it’s", "b": [0.6779, 0.2907, 0.7087, 0.3104]}, {"w": "the", "b": [0.715, 0.2907, 0.7458, 0.3104]}, {"w": "most", "b": [0.7521, 0.2907, 0.8012, 0.3104]}, {"w": "widely", "b": [0.1294, 0.3112, 0.1981, 0.3309]}, {"w": "adopted,", "b": [0.2044, 0.3112, 0.2906, 0.3309]}, {"w": "scalable,", "b": [0.2969, 0.3112, 0.3844, 0.3309]}, {"w": "and", "b": [0.3907, 0.3112, 0.4272, 0.3309]}, {"w": "production", "b": [0.4335, 0.3112, 0.5428, 0.3309]}, {"w": "ready.", "b": [0.5491, 0.3112, 0.6097, 0.3309]}]}, {"id": "b_1", "type": "paragraph", "text": "Via TensorFlow (or Theano, or CNTK), Keras is able to run seamlessly on both CPUs and GPUs. When running on CPU, TensorFlow is itself wrapping a low-level library for tensor operations called Eigen (http://eigen.tuxfamily.org). On GPU, Tensor-Flow wraps a library of well-optimized deep-learning operations called the NVIDIA CUDA Deep Neural Network library (cuDNN).", "words": [{"w": "Via", "b": [0.1294, 0.354, 0.1643, 0.3737]}, {"w": "TensorFlow", "b": [0.1706, 0.354, 0.2908, 0.3737]}, {"w": "(or", "b": [0.2971, 0.354, 0.3265, 0.3737]}, {"w": "Theano,", "b": [0.3328, 0.354, 0.4148, 0.3737]}, {"w": "or", "b": [0.4211, 0.354, 0.4421, 0.3737]}, {"w": "CNTK),", "b": [0.4484, 0.354, 0.5318, 0.3737]}, {"w": "Keras", "b": [0.5381, 0.354, 0.5969, 0.3737]}, {"w": "is", "b": [0.6032, 0.354, 0.62, 0.3737]}, {"w": "able", "b": [0.6263, 0.354, 0.6684, 0.3737]}, {"w": "to", "b": [0.6747, 0.354, 0.6943, 0.3737]}, {"w": "run", "b": [0.7006, 0.354, 0.7342, 0.3737]}, {"w": "seamlessly", "b": [0.7405, 0.354, 0.8498, 0.3737]}, {"w": "on", "b": [0.1294, 0.3745, 0.1546, 0.3942]}, {"w": "both", "b": [0.1609, 0.3745, 0.2058, 0.3942]}, {"w": "CPUs", "b": [0.2121, 0.3745, 0.271, 0.3942]}, {"w": "and", "b": [0.2773, 0.3745, 0.3137, 0.3942]}, {"w": "GPUs.", "b": [0.32, 0.3745, 0.3866, 0.3942]}, {"w": "When", "b": [0.3929, 0.3745, 0.4531, 0.3942]}, {"w": "running", "b": [0.4594, 0.3745, 0.5379, 0.3942]}, {"w": "on", "b": [0.5442, 0.3745, 0.5695, 0.3942]}, {"w": "CPU,", "b": [0.5758, 0.3745, 0.6311, 0.3942]}, {"w": "TensorFlow", "b": [0.6374, 0.3745, 0.7576, 0.3942]}, {"w": "is", "b": [0.7639, 0.3745, 0.7807, 0.3942]}, {"w": "itself", "b": [0.787, 0.3745, 0.8375, 0.3942]}, {"w": "wrapping", "b": [0.1294, 0.395, 0.2247, 0.4147]}, {"w": "a", "b": [0.231, 0.395, 0.2422, 0.4147]}, {"w": "low-level", "b": [0.2485, 0.395, 0.3438, 0.4147]}, {"w": "library", "b": [0.3501, 0.395, 0.4173, 0.4147]}, {"w": "for", "b": [0.4236, 0.395, 0.4531, 0.4147]}, {"w": "tensor", "b": [0.4594, 0.395, 0.521, 0.4147]}, {"w": "operations", "b": [0.5273, 0.395, 0.6324, 0.4147]}, {"w": "called", "b": [0.6387, 0.395, 0.699, 0.4147]}, {"w": "Eigen", "b": [0.7053, 0.395, 0.7641, 0.4147]}, {"w": "(http://eigen.tuxfamily.org).", "b": [0.1294, 0.4155, 0.4096, 0.4352]}, {"w": "On", "b": [0.4159, 0.4155, 0.4468, 0.4352]}, {"w": "GPU,", "b": [0.4531, 0.4155, 0.5098, 0.4352]}, {"w": "Tensor-Flow", "b": [0.5161, 0.4155, 0.6442, 0.4352]}, {"w": "wraps", "b": [0.6505, 0.4155, 0.7107, 0.4352]}, {"w": "a", "b": [0.717, 0.4155, 0.7282, 0.4352]}, {"w": "library", "b": [0.7345, 0.4155, 0.8018, 0.4352]}, {"w": "of", "b": [0.8081, 0.4155, 0.8291, 0.4352]}, {"w": "well-optimized", "b": [0.1294, 0.436, 0.2822, 0.4557]}, {"w": "deep-learning", "b": [0.2885, 0.436, 0.4272, 0.4557]}, {"w": "operations", "b": [0.4335, 0.436, 0.5385, 0.4557]}, {"w": "called", "b": [0.5449, 0.436, 0.6051, 0.4557]}, {"w": "the", "b": [0.6114, 0.436, 0.6422, 0.4557]}, {"w": "NVIDIA", "b": [0.6485, 0.436, 0.7382, 0.4557]}, {"w": "CUDA", "b": [0.7445, 0.436, 0.816, 0.4557]}, {"w": "Deep", "b": [0.1294, 0.4565, 0.1826, 0.4762]}, {"w": "Neural", "b": [0.1889, 0.4565, 0.2576, 0.4762]}, {"w": "Network", "b": [0.2639, 0.4565, 0.3522, 0.4762]}, {"w": "library", "b": [0.3584, 0.4565, 0.4257, 0.4762]}, {"w": "(cuDNN).", "b": [0.432, 0.4565, 0.5336, 0.4762]}]}, {"id": "b_2", "type": "paragraph", "text": "3.2.2. Developing with Keras: a quick overview", "words": [{"w": "3.2.2.", "b": [0.1294, 0.5037, 0.1862, 0.5234]}, {"w": "Developing", "b": [0.1925, 0.5037, 0.313, 0.5234]}, {"w": "with", "b": [0.3193, 0.5037, 0.367, 0.5234]}, {"w": "Keras:", "b": [0.3733, 0.5037, 0.4461, 0.5234]}, {"w": "a", "b": [0.4524, 0.5037, 0.465, 0.5234]}, {"w": "quick", "b": [0.4713, 0.5037, 0.5316, 0.5234]}, {"w": "overview", "b": [0.5379, 0.5037, 0.6346, 0.5234]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ve already seen one example of a Keras model: the MNIST example. The typical Keras workflow looks just like that example:", "words": [{"w": "You’ve", "b": [0.1294, 0.5465, 0.2025, 0.5662]}, {"w": "already", "b": [0.2088, 0.5465, 0.2831, 0.5662]}, {"w": "seen", "b": [0.2894, 0.5465, 0.3342, 0.5662]}, {"w": "one", "b": [0.3405, 0.5465, 0.377, 0.5662]}, {"w": "example", "b": [0.3833, 0.5465, 0.4687, 0.5662]}, {"w": "of", "b": [0.475, 0.5465, 0.496, 0.5662]}, {"w": "a", "b": [0.5024, 0.5465, 0.5136, 0.5662]}, {"w": "Keras", "b": [0.5199, 0.5465, 0.5787, 0.5662]}, {"w": "model:", "b": [0.585, 0.5465, 0.6551, 0.5662]}, {"w": "the", "b": [0.6614, 0.5465, 0.6922, 0.5662]}, {"w": "MNIST", "b": [0.6985, 0.5465, 0.777, 0.5662]}, {"w": "example.", "b": [0.1294, 0.567, 0.2212, 0.5867]}, {"w": "The", "b": [0.2275, 0.567, 0.2667, 0.5867]}, {"w": "typical", "b": [0.273, 0.567, 0.3417, 0.5867]}, {"w": "Keras", "b": [0.348, 0.567, 0.4068, 0.5867]}, {"w": "workflow", "b": [0.4131, 0.567, 0.5112, 0.5867]}, {"w": "looks", "b": [0.5175, 0.567, 0.5722, 0.5867]}, {"w": "just", "b": [0.5785, 0.567, 0.6149, 0.5867]}, {"w": "like", "b": [0.6212, 0.567, 0.6591, 0.5867]}, {"w": "that", "b": [0.6654, 0.567, 0.7032, 0.5867]}, {"w": "example:", "b": [0.7095, 0.567, 0.802, 0.5867]}]}, {"id": "b_4", "type": "paragraph", "text": "1. Define your training data: input tensors and target tensors. 2. Define a network of layers (or model) that maps your inputs to your targets. 3. Configure the learning process by choosing a loss function, an optimizer, and some metrics to monitor. 4. Iterate on your training data by calling the fit() method of your model.", "words": [{"w": "1.", "b": [0.1551, 0.6053, 0.174, 0.6251]}, {"w": "Define", "b": [0.1799, 0.6053, 0.2485, 0.6251]}, {"w": "your", "b": [0.2548, 0.6053, 0.301, 0.6251]}, {"w": "training", "b": [0.3074, 0.6053, 0.3858, 0.6251]}, {"w": "data:", "b": [0.3921, 0.6053, 0.4412, 0.6251]}, {"w": "input", "b": [0.4475, 0.6053, 0.4993, 0.6251]}, {"w": "tensors", "b": [0.5057, 0.6053, 0.5771, 0.6251]}, {"w": "and", "b": [0.5834, 0.6053, 0.6199, 0.6251]}, {"w": "target", "b": [0.6262, 0.6053, 0.6831, 0.6251]}, {"w": "tensors.", "b": [0.6894, 0.6053, 0.7672, 0.6251]}, {"w": "2.", "b": [0.1551, 0.6258, 0.174, 0.6456]}, {"w": "Define", "b": [0.1799, 0.6258, 0.2485, 0.6456]}, {"w": "a", "b": [0.2548, 0.6258, 0.266, 0.6456]}, {"w": "network", "b": [0.2723, 0.6258, 0.355, 0.6456]}, {"w": "of", "b": [0.3613, 0.6258, 0.3823, 0.6456]}, {"w": "layers", "b": [0.3886, 0.6258, 0.4488, 0.6456]}, {"w": "(or", "b": [0.4552, 0.6258, 0.4846, 0.6456]}, {"w": "model)", "b": [0.4908, 0.6258, 0.5609, 0.6456]}, {"w": "that", "b": [0.5672, 0.6258, 0.605, 0.6456]}, {"w": "maps", "b": [0.6113, 0.6258, 0.6646, 0.6456]}, {"w": "your", "b": [0.6709, 0.6258, 0.7171, 0.6456]}, {"w": "inputs", "b": [0.7235, 0.6258, 0.7851, 0.6456]}, {"w": "to", "b": [0.7914, 0.6258, 0.8111, 0.6456]}, {"w": "your", "b": [0.8174, 0.6258, 0.8636, 0.6456]}, {"w": "targets.", "b": [0.1799, 0.6463, 0.253, 0.6661]}, {"w": "3.", "b": [0.1551, 0.6668, 0.174, 0.6866]}, {"w": "Configure", "b": [0.1799, 0.6668, 0.2822, 0.6866]}, {"w": "the", "b": [0.2885, 0.6668, 0.3193, 0.6866]}, {"w": "learning", "b": [0.3256, 0.6668, 0.4083, 0.6866]}, {"w": "process", "b": [0.4146, 0.6668, 0.4902, 0.6866]}, {"w": "by", "b": [0.4965, 0.6668, 0.5217, 0.6866]}, {"w": "choosing", "b": [0.5281, 0.6668, 0.6191, 0.6866]}, {"w": "a", "b": [0.6255, 0.6668, 0.6367, 0.6866]}, {"w": "loss", "b": [0.643, 0.6668, 0.6822, 0.6866]}, {"w": "function,", "b": [0.6885, 0.6668, 0.7789, 0.6866]}, {"w": "an", "b": [0.7852, 0.6668, 0.809, 0.6866]}, {"w": "optimizer,", "b": [0.1799, 0.6873, 0.2818, 0.7071]}, {"w": "and", "b": [0.2881, 0.6873, 0.3246, 0.7071]}, {"w": "some", "b": [0.3309, 0.6873, 0.3841, 0.7071]}, {"w": "metrics", "b": [0.3904, 0.6873, 0.4647, 0.7071]}, {"w": "to", "b": [0.471, 0.6873, 0.4906, 0.7071]}, {"w": "monitor.", "b": [0.4969, 0.6873, 0.5817, 0.7071]}, {"w": "4.", "b": [0.1551, 0.7078, 0.174, 0.7276]}, {"w": "Iterate", "b": [0.1799, 0.7078, 0.2443, 0.7276]}, {"w": "on", "b": [0.2506, 0.7078, 0.2758, 0.7276]}, {"w": "your", "b": [0.2821, 0.7078, 0.3284, 0.7276]}, {"w": "training", "b": [0.3347, 0.7078, 0.4132, 0.7276]}, {"w": "data", "b": [0.4195, 0.7078, 0.4615, 0.7276]}, {"w": "by", "b": [0.4678, 0.7078, 0.493, 0.7276]}, {"w": "calling", "b": [0.4993, 0.7078, 0.568, 0.7276]}, {"w": "the", "b": [0.5743, 0.7078, 0.6051, 0.7276]}, {"w": "fit()", "b": [0.6113, 0.7089, 0.687, 0.7291]}, {"w": "method", "b": [0.6933, 0.7078, 0.769, 0.7276]}, {"w": "of", "b": [0.7753, 0.7078, 0.7963, 0.7276]}, {"w": "your", "b": [0.8026, 0.7078, 0.8489, 0.7276]}, {"w": "model.", "b": [0.1799, 0.7292, 0.2492, 0.7489]}]}, {"id": "b_5", "type": "paragraph", "text": "There are two ways to define a model: using the Sequential class (only for linear stacks of layers, which is the most common network architecture by far) or the functional API (for directed acyclic graphs of layers, which lets you build completely arbitrary architectures).", "words": [{"w": "There", "b": [0.1294, 0.772, 0.1882, 0.7917]}, {"w": "are", "b": [0.1945, 0.772, 0.2253, 0.7917]}, {"w": "two", "b": [0.2317, 0.772, 0.2695, 0.7917]}, {"w": "ways", "b": [0.2758, 0.772, 0.3276, 0.7917]}, {"w": "to", "b": [0.3339, 0.772, 0.3536, 0.7917]}, {"w": "define", "b": [0.3599, 0.772, 0.4229, 0.7917]}, {"w": "a", "b": [0.4292, 0.772, 0.4404, 0.7917]}, {"w": "model:", "b": [0.4467, 0.772, 0.5168, 0.7917]}, {"w": "using", "b": [0.5231, 0.772, 0.5778, 0.7917]}, {"w": "the", "b": [0.5841, 0.772, 0.6149, 0.7917]}, {"w": "Sequential", "b": [0.6211, 0.773, 0.7725, 0.7932]}, {"w": "class", "b": [0.7788, 0.772, 0.8279, 0.7917]}, {"w": "(only", "b": [0.1294, 0.7934, 0.1827, 0.8131]}, {"w": "for", "b": [0.189, 0.7934, 0.2184, 0.8131]}, {"w": "linear", "b": [0.2247, 0.7934, 0.2821, 0.8131]}, {"w": "stacks", "b": [0.2884, 0.7934, 0.3501, 0.8131]}, {"w": "of", "b": [0.3564, 0.7934, 0.3774, 0.8131]}, {"w": "layers,", "b": [0.3837, 0.7934, 0.4503, 0.8131]}, {"w": "which", "b": [0.4566, 0.7934, 0.5182, 0.8131]}, {"w": "is", "b": [0.5245, 0.7934, 0.5413, 0.8131]}, {"w": "the", "b": [0.5477, 0.7934, 0.5785, 0.8131]}, {"w": "most", "b": [0.5848, 0.7934, 0.6339, 0.8131]}, {"w": "common", "b": [0.6402, 0.7934, 0.7284, 0.8131]}, {"w": "network", "b": [0.7348, 0.7934, 0.8174, 0.8131]}, {"w": "architecture", "b": [0.1294, 0.8139, 0.2485, 0.8336]}, {"w": "by", "b": [0.2548, 0.8139, 0.28, 0.8336]}, {"w": "far)", "b": [0.2863, 0.8139, 0.3227, 0.8336]}, {"w": "or", "b": [0.329, 0.8139, 0.35, 0.8336]}, {"w": "the", "b": [0.3563, 0.8139, 0.3872, 0.8336]}, {"w": "functional", "b": [0.3934, 0.8139, 0.4957, 0.8336]}, {"w": "API", "b": [0.502, 0.8139, 0.5413, 0.8336]}, {"w": "(for", "b": [0.5475, 0.8139, 0.5853, 0.8336]}, {"w": "directed", "b": [0.5916, 0.8139, 0.6729, 0.8336]}, {"w": "acyclic", "b": [0.6792, 0.8139, 0.7506, 0.8336]}, {"w": "graphs", "b": [0.757, 0.8139, 0.8242, 0.8336]}, {"w": "of", "b": [0.8305, 0.8139, 0.8515, 0.8336]}, {"w": "layers,", "b": [0.1294, 0.8344, 0.196, 0.8541]}, {"w": "which", "b": [0.2023, 0.8344, 0.2639, 0.8541]}, {"w": "lets", "b": [0.2702, 0.8344, 0.3053, 0.8541]}, {"w": "you", "b": [0.3116, 0.8344, 0.3494, 0.8541]}, {"w": "build", "b": [0.3557, 0.8344, 0.4076, 0.8541]}, {"w": "completely", "b": [0.4139, 0.8344, 0.526, 0.8541]}, {"w": "arbitrary", "b": [0.5323, 0.8344, 0.6191, 0.8541]}, {"w": "architectures).", "b": [0.6255, 0.8344, 0.769, 0.8541]}]}]}, {"page": 102, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As a refresher, here’s a two-layer model defined using the Sequential class (note that we’re passing the expected shape of the input data to the first layer):", "words": [{"w": "As", "b": [0.1294, 0.0857, 0.1574, 0.1054]}, {"w": "a", "b": [0.1637, 0.0857, 0.1749, 0.1054]}, {"w": "refresher,", "b": [0.1813, 0.0857, 0.2762, 0.1054]}, {"w": "here’s", "b": [0.2825, 0.0857, 0.3427, 0.1054]}, {"w": "a", "b": [0.349, 0.0857, 0.3602, 0.1054]}, {"w": "two-layer", "b": [0.3665, 0.0857, 0.4632, 0.1054]}, {"w": "model", "b": [0.4695, 0.0857, 0.5326, 0.1054]}, {"w": "defined", "b": [0.5389, 0.0857, 0.6145, 0.1054]}, {"w": "using", "b": [0.6208, 0.0857, 0.6755, 0.1054]}, {"w": "the", "b": [0.6818, 0.0857, 0.7126, 0.1054]}, {"w": "Sequential", "b": [0.7189, 0.0867, 0.8702, 0.1069]}, {"w": "class", "b": [0.1294, 0.1071, 0.1785, 0.1268]}, {"w": "(note", "b": [0.1848, 0.1071, 0.2366, 0.1268]}, {"w": "that", "b": [0.2429, 0.1071, 0.2807, 0.1268]}, {"w": "we’re", "b": [0.287, 0.1071, 0.3445, 0.1268]}, {"w": "passing", "b": [0.3508, 0.1071, 0.4264, 0.1268]}, {"w": "the", "b": [0.4328, 0.1071, 0.4636, 0.1268]}, {"w": "expected", "b": [0.4699, 0.1071, 0.5595, 0.1268]}, {"w": "shape", "b": [0.5658, 0.1071, 0.6233, 0.1268]}, {"w": "of", "b": [0.6296, 0.1071, 0.6506, 0.1268]}, {"w": "the", "b": [0.6569, 0.1071, 0.6877, 0.1268]}, {"w": "input", "b": [0.694, 0.1071, 0.7459, 0.1268]}, {"w": "data", "b": [0.7522, 0.1071, 0.7942, 0.1268]}, {"w": "to", "b": [0.8005, 0.1071, 0.8202, 0.1268]}, {"w": "the", "b": [0.8265, 0.1071, 0.8573, 0.1268]}, {"w": "first", "b": [0.1294, 0.1276, 0.1701, 0.1473]}, {"w": "layer):", "b": [0.1764, 0.1276, 0.2422, 0.1473]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras import models from keras import layers model = models.Sequential() model.add(layers.Dense(32, activation='relu', input_shape= (784,))) model.add(layers.Dense(10, activation='softmax'))", "words": [{"w": "from", "b": [0.1357, 0.1653, 0.1811, 0.1804]}, {"w": "keras", "b": [0.1925, 0.1653, 0.2492, 0.1804]}, {"w": "import", "b": [0.2606, 0.1653, 0.3287, 0.1804]}, {"w": "models", "b": [0.34, 0.1653, 0.4082, 0.1804]}, {"w": "from", "b": [0.1357, 0.1805, 0.1811, 0.1956]}, {"w": "keras", "b": [0.1925, 0.1805, 0.2492, 0.1956]}, {"w": "import", "b": [0.2606, 0.1805, 0.3287, 0.1956]}, {"w": "layers", "b": [0.34, 0.1805, 0.4082, 0.1956]}, {"w": "model", "b": [0.1357, 0.2108, 0.1925, 0.2259]}, {"w": "=", "b": [0.2038, 0.2108, 0.2152, 0.2259]}, {"w": "models.Sequential()", "b": [0.2265, 0.2108, 0.4422, 0.2259]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.2259, 0.4309, 0.2411]}, {"w": "activation='relu',", "b": [0.4422, 0.2259, 0.6465, 0.2411]}, {"w": "input_shape=", "b": [0.6579, 0.2259, 0.7941, 0.2411]}, {"w": "(784,)))", "b": [0.1357, 0.2411, 0.2265, 0.2562]}, {"w": "model.add(layers.Dense(10,", "b": [0.1357, 0.2562, 0.4309, 0.2714]}, {"w": "activation='softmax'))", "b": [0.4422, 0.2562, 0.6919, 0.2714]}]}, {"id": "b_2", "type": "paragraph", "text": "And here’s the same model defined using the functional API:", "words": [{"w": "And", "b": [0.1294, 0.2942, 0.1729, 0.314]}, {"w": "here’s", "b": [0.1792, 0.2942, 0.2394, 0.314]}, {"w": "the", "b": [0.2457, 0.2942, 0.2765, 0.314]}, {"w": "same", "b": [0.2828, 0.2942, 0.3347, 0.314]}, {"w": "model", "b": [0.341, 0.2942, 0.404, 0.314]}, {"w": "defined", "b": [0.4103, 0.2942, 0.486, 0.314]}, {"w": "using", "b": [0.4923, 0.2942, 0.547, 0.314]}, {"w": "the", "b": [0.5533, 0.2942, 0.5841, 0.314]}, {"w": "functional", "b": [0.5904, 0.2942, 0.6927, 0.314]}, {"w": "API:", "b": [0.699, 0.2942, 0.7467, 0.314]}]}, {"id": "b_3", "type": "paragraph", "text": "input_tensor = layers.Input(shape=(784,)) x = layers.Dense(32, activation='relu')(input_tensor) output_tensor = layers.Dense(10, activation='softmax')(x) model = models.Model(inputs=input_tensor, outputs=output_tensor)", "words": [{"w": "input_tensor", "b": [0.1357, 0.332, 0.2719, 0.3471]}, {"w": "=", "b": [0.2833, 0.332, 0.2946, 0.3471]}, {"w": "layers.Input(shape=(784,))", "b": [0.306, 0.332, 0.6011, 0.3471]}, {"w": "x", "b": [0.1357, 0.3471, 0.1471, 0.3623]}, {"w": "=", "b": [0.1584, 0.3471, 0.1698, 0.3623]}, {"w": "layers.Dense(32,", "b": [0.1811, 0.3471, 0.3628, 0.3623]}, {"w": "activation='relu')(input_tensor)", "b": [0.3741, 0.3471, 0.7374, 0.3623]}, {"w": "output_tensor", "b": [0.1357, 0.3623, 0.2833, 0.3774]}, {"w": "=", "b": [0.2946, 0.3623, 0.306, 0.3774]}, {"w": "layers.Dense(10,", "b": [0.3173, 0.3623, 0.499, 0.3774]}, {"w": "activation='softmax')(x)", "b": [0.5103, 0.3623, 0.7828, 0.3774]}, {"w": "model", "b": [0.1357, 0.3926, 0.1925, 0.4077]}, {"w": "=", "b": [0.2038, 0.3926, 0.2152, 0.4077]}, {"w": "models.Model(inputs=input_tensor,", "b": [0.2265, 0.3926, 0.6011, 0.4077]}, {"w": "outputs=output_tensor)", "b": [0.6125, 0.3926, 0.8622, 0.4077]}]}, {"id": "b_4", "type": "paragraph", "text": "With the functional API, you’re manipulating the data tensors that the model processes and applying layers to this tensor as if they were functions.", "words": [{"w": "With", "b": [0.1294, 0.4306, 0.1788, 0.4504]}, {"w": "the", "b": [0.1852, 0.4306, 0.216, 0.4504]}, {"w": "functional", "b": [0.2223, 0.4306, 0.3246, 0.4504]}, {"w": "API,", "b": [0.3309, 0.4306, 0.3778, 0.4504]}, {"w": "you’re", "b": [0.3841, 0.4306, 0.45, 0.4504]}, {"w": "manipulating", "b": [0.4563, 0.4306, 0.5894, 0.4504]}, {"w": "the", "b": [0.5957, 0.4306, 0.6266, 0.4504]}, {"w": "data", "b": [0.6329, 0.4306, 0.6749, 0.4504]}, {"w": "tensors", "b": [0.6812, 0.4306, 0.7527, 0.4504]}, {"w": "that", "b": [0.759, 0.4306, 0.7968, 0.4504]}, {"w": "the", "b": [0.8031, 0.4306, 0.8339, 0.4504]}, {"w": "model", "b": [0.1294, 0.4511, 0.1925, 0.4709]}, {"w": "processes", "b": [0.1988, 0.4511, 0.2954, 0.4709]}, {"w": "and", "b": [0.3018, 0.4511, 0.3382, 0.4709]}, {"w": "applying", "b": [0.3445, 0.4511, 0.4328, 0.4709]}, {"w": "layers", "b": [0.4391, 0.4511, 0.4993, 0.4709]}, {"w": "to", "b": [0.5056, 0.4511, 0.5253, 0.4709]}, {"w": "this", "b": [0.5316, 0.4511, 0.568, 0.4709]}, {"w": "tensor", "b": [0.5743, 0.4511, 0.636, 0.4709]}, {"w": "as", "b": [0.6422, 0.4511, 0.6632, 0.4709]}, {"w": "if", "b": [0.6695, 0.4511, 0.685, 0.4709]}, {"w": "they", "b": [0.6913, 0.4511, 0.7347, 0.4709]}, {"w": "were", "b": [0.741, 0.4511, 0.79, 0.4709]}, {"w": "functions.", "b": [0.1294, 0.4716, 0.2296, 0.4914]}]}, {"id": "b_5", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.5202, 0.1672, 0.535]}]}, {"id": "b_6", "type": "paragraph", "text": "A detailed guide to what you can do with the functional API can be found in chapter 7. Until chapter 7, we’ll only be using the Sequential class in our code examples.", "words": [{"w": "A", "b": [0.1294, 0.5536, 0.1476, 0.5734]}, {"w": "detailed", "b": [0.1539, 0.5536, 0.2338, 0.5734]}, {"w": "guide", "b": [0.2401, 0.5536, 0.2962, 0.5734]}, {"w": "to", "b": [0.3025, 0.5536, 0.3221, 0.5734]}, {"w": "what", "b": [0.3284, 0.5536, 0.3774, 0.5734]}, {"w": "you", "b": [0.3837, 0.5536, 0.4216, 0.5734]}, {"w": "can", "b": [0.4279, 0.5536, 0.4629, 0.5734]}, {"w": "do", "b": [0.4692, 0.5536, 0.4944, 0.5734]}, {"w": "with", "b": [0.5007, 0.5536, 0.5456, 0.5734]}, {"w": "the", "b": [0.5519, 0.5536, 0.5827, 0.5734]}, {"w": "functional", "b": [0.589, 0.5536, 0.6913, 0.5734]}, {"w": "API", "b": [0.6976, 0.5536, 0.7383, 0.5734]}, {"w": "can", "b": [0.7446, 0.5536, 0.7796, 0.5734]}, {"w": "be", "b": [0.7859, 0.5536, 0.8097, 0.5734]}, {"w": "found", "b": [0.1294, 0.5741, 0.1883, 0.5939]}, {"w": "in", "b": [0.1946, 0.5741, 0.2142, 0.5939]}, {"w": "chapter", "b": [0.2205, 0.5741, 0.2947, 0.5939]}, {"w": "7.", "b": [0.301, 0.5741, 0.3199, 0.5939]}, {"w": "Until", "b": [0.3262, 0.5741, 0.3781, 0.5939]}, {"w": "chapter", "b": [0.3844, 0.5741, 0.4586, 0.5939]}, {"w": "7,", "b": [0.4649, 0.5741, 0.4838, 0.5939]}, {"w": "we’ll", "b": [0.4901, 0.5741, 0.542, 0.5939]}, {"w": "only", "b": [0.5483, 0.5741, 0.5931, 0.5939]}, {"w": "be", "b": [0.5994, 0.5741, 0.6233, 0.5939]}, {"w": "using", "b": [0.6296, 0.5741, 0.6842, 0.5939]}, {"w": "the", "b": [0.6905, 0.5741, 0.7214, 0.5939]}, {"w": "Sequential", "b": [0.1294, 0.5957, 0.2808, 0.6159]}, {"w": "class", "b": [0.2871, 0.5946, 0.3361, 0.6144]}, {"w": "in", "b": [0.3424, 0.5946, 0.3621, 0.6144]}, {"w": "our", "b": [0.3684, 0.5946, 0.402, 0.6144]}, {"w": "code", "b": [0.4083, 0.5946, 0.4559, 0.6144]}, {"w": "examples.", "b": [0.4622, 0.5946, 0.5638, 0.6144]}]}, {"id": "b_7", "type": "paragraph", "text": "Once your model architecture is defined, it doesn’t matter whether you used a Sequential model or the functional API. All of the following steps are the same.", "words": [{"w": "Once", "b": [0.1294, 0.665, 0.1826, 0.6848]}, {"w": "your", "b": [0.1889, 0.665, 0.2352, 0.6848]}, {"w": "model", "b": [0.2415, 0.665, 0.3046, 0.6848]}, {"w": "architecture", "b": [0.3109, 0.665, 0.4299, 0.6848]}, {"w": "is", "b": [0.4362, 0.665, 0.4531, 0.6848]}, {"w": "defined,", "b": [0.4594, 0.665, 0.5413, 0.6848]}, {"w": "it", "b": [0.5476, 0.665, 0.5617, 0.6848]}, {"w": "doesn’t", "b": [0.568, 0.665, 0.6417, 0.6848]}, {"w": "matter", "b": [0.648, 0.665, 0.7125, 0.6848]}, {"w": "whether", "b": [0.7188, 0.665, 0.8, 0.6848]}, {"w": "you", "b": [0.8063, 0.665, 0.8442, 0.6848]}, {"w": "used", "b": [0.1294, 0.6855, 0.1757, 0.7053]}, {"w": "a", "b": [0.182, 0.6855, 0.1932, 0.7053]}, {"w": "Sequential", "b": [0.1995, 0.6866, 0.3508, 0.7068]}, {"w": "model", "b": [0.3571, 0.6855, 0.4202, 0.7053]}, {"w": "or", "b": [0.4265, 0.6855, 0.4475, 0.7053]}, {"w": "the", "b": [0.4538, 0.6855, 0.4846, 0.7053]}, {"w": "functional", "b": [0.491, 0.6855, 0.5932, 0.7053]}, {"w": "API.", "b": [0.5996, 0.6855, 0.6465, 0.7053]}, {"w": "All", "b": [0.6528, 0.6855, 0.685, 0.7053]}, {"w": "of", "b": [0.6913, 0.6855, 0.7124, 0.7053]}, {"w": "the", "b": [0.7187, 0.6855, 0.7495, 0.7053]}, {"w": "following", "b": [0.7558, 0.6855, 0.8539, 0.7053]}, {"w": "steps", "b": [0.1294, 0.7069, 0.1799, 0.7267]}, {"w": "are", "b": [0.1862, 0.7069, 0.217, 0.7267]}, {"w": "the", "b": [0.2233, 0.7069, 0.2541, 0.7267]}, {"w": "same.", "b": [0.2604, 0.7069, 0.3186, 0.7267]}]}, {"id": "b_8", "type": "paragraph", "text": "The learning process is configured in the compilation step, where you specify the optimizer and loss function(s) that the model should use, as well as the metrics you want to monitor during training. Here’s an example with a single loss function, which is by far the most common case:", "words": [{"w": "The", "b": [0.1294, 0.7497, 0.1686, 0.7694]}, {"w": "learning", "b": [0.1749, 0.7497, 0.2576, 0.7694]}, {"w": "process", "b": [0.2639, 0.7497, 0.3396, 0.7694]}, {"w": "is", "b": [0.3459, 0.7497, 0.3627, 0.7694]}, {"w": "configured", "b": [0.369, 0.7497, 0.4783, 0.7694]}, {"w": "in", "b": [0.4846, 0.7497, 0.5042, 0.7694]}, {"w": "the", "b": [0.5105, 0.7497, 0.5413, 0.7694]}, {"w": "compilation", "b": [0.5477, 0.7497, 0.6682, 0.7694]}, {"w": "step,", "b": [0.6745, 0.7497, 0.7214, 0.7694]}, {"w": "where", "b": [0.7277, 0.7497, 0.7894, 0.7694]}, {"w": "you", "b": [0.7957, 0.7497, 0.8335, 0.7694]}, {"w": "specify", "b": [0.1294, 0.7702, 0.2023, 0.7899]}, {"w": "the", "b": [0.2086, 0.7702, 0.2394, 0.7899]}, {"w": "optimizer", "b": [0.2457, 0.7702, 0.3424, 0.7899]}, {"w": "and", "b": [0.3487, 0.7702, 0.3851, 0.7899]}, {"w": "loss", "b": [0.3914, 0.7702, 0.4307, 0.7899]}, {"w": "function(s)", "b": [0.437, 0.7702, 0.5477, 0.7899]}, {"w": "that", "b": [0.554, 0.7702, 0.5918, 0.7899]}, {"w": "the", "b": [0.5981, 0.7702, 0.629, 0.7899]}, {"w": "model", "b": [0.6352, 0.7702, 0.6983, 0.7899]}, {"w": "should", "b": [0.7046, 0.7702, 0.7718, 0.7899]}, {"w": "use,", "b": [0.7781, 0.7702, 0.8181, 0.7899]}, {"w": "as", "b": [0.8244, 0.7702, 0.8454, 0.7899]}, {"w": "well", "b": [0.1294, 0.7907, 0.1729, 0.8104]}, {"w": "as", "b": [0.1792, 0.7907, 0.2002, 0.8104]}, {"w": "the", "b": [0.2065, 0.7907, 0.2373, 0.8104]}, {"w": "metrics", "b": [0.2436, 0.7907, 0.3179, 0.8104]}, {"w": "you", "b": [0.3242, 0.7907, 0.362, 0.8104]}, {"w": "want", "b": [0.3683, 0.7907, 0.4174, 0.8104]}, {"w": "to", "b": [0.4237, 0.7907, 0.4433, 0.8104]}, {"w": "monitor", "b": [0.4496, 0.7907, 0.5295, 0.8104]}, {"w": "during", "b": [0.5358, 0.7907, 0.6017, 0.8104]}, {"w": "training.", "b": [0.608, 0.7907, 0.6928, 0.8104]}, {"w": "Here’s", "b": [0.6991, 0.7907, 0.7648, 0.8104]}, {"w": "an", "b": [0.7711, 0.7907, 0.7949, 0.8104]}, {"w": "example", "b": [0.1294, 0.8112, 0.2149, 0.8309]}, {"w": "with", "b": [0.2212, 0.8112, 0.266, 0.8309]}, {"w": "a", "b": [0.2723, 0.8112, 0.2835, 0.8309]}, {"w": "single", "b": [0.2898, 0.8112, 0.3501, 0.8309]}, {"w": "loss", "b": [0.3564, 0.8112, 0.3957, 0.8309]}, {"w": "function,", "b": [0.402, 0.8112, 0.4924, 0.8309]}, {"w": "which", "b": [0.4986, 0.8112, 0.5603, 0.8309]}, {"w": "is", "b": [0.5666, 0.8112, 0.5834, 0.8309]}, {"w": "by", "b": [0.5897, 0.8112, 0.6149, 0.8309]}, {"w": "far", "b": [0.6212, 0.8112, 0.6492, 0.8309]}, {"w": "the", "b": [0.6555, 0.8112, 0.6864, 0.8309]}, {"w": "most", "b": [0.6927, 0.8112, 0.7417, 0.8309]}, {"w": "common", "b": [0.748, 0.8112, 0.8363, 0.8309]}, {"w": "case:", "b": [0.1294, 0.8317, 0.1798, 0.8514]}]}, {"id": "b_9", "type": "paragraph", "text": "from keras import optimizers", "words": [{"w": "from", "b": [0.1357, 0.8694, 0.1811, 0.8846]}, {"w": "keras", "b": [0.1925, 0.8694, 0.2492, 0.8846]}, {"w": "import", "b": [0.2606, 0.8694, 0.3287, 0.8846]}, {"w": "optimizers", "b": [0.34, 0.8694, 0.4536, 0.8846]}]}]}, {"page": 103, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.compile(optimizer=optimizers.RMSprop(lr=0.001), loss='mse', metrics=['accuracy'])", "words": [{"w": "model.compile(optimizer=optimizers.RMSprop(lr=0.001),", "b": [0.1357, 0.0851, 0.7374, 0.1002]}, {"w": "loss='mse',", "b": [0.2946, 0.1002, 0.4195, 0.1154]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.1154, 0.533, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "Finally, the learning process consists of passing Numpy arrays of input data (and the corresponding target data) to the model via the fit() method, similar to what you would do in Scikit-Learn and several other machine-learning libraries:", "words": [{"w": "Finally,", "b": [0.1294, 0.1534, 0.2056, 0.1732]}, {"w": "the", "b": [0.2119, 0.1534, 0.2427, 0.1732]}, {"w": "learning", "b": [0.249, 0.1534, 0.3317, 0.1732]}, {"w": "process", "b": [0.338, 0.1534, 0.4136, 0.1732]}, {"w": "consists", "b": [0.4199, 0.1534, 0.4998, 0.1732]}, {"w": "of", "b": [0.5061, 0.1534, 0.5271, 0.1732]}, {"w": "passing", "b": [0.5334, 0.1534, 0.6091, 0.1732]}, {"w": "Numpy", "b": [0.6154, 0.1534, 0.6911, 0.1732]}, {"w": "arrays", "b": [0.6974, 0.1534, 0.759, 0.1732]}, {"w": "of", "b": [0.7653, 0.1534, 0.7864, 0.1732]}, {"w": "input", "b": [0.7927, 0.1534, 0.8445, 0.1732]}, {"w": "data", "b": [0.1294, 0.1739, 0.1714, 0.1937]}, {"w": "(and", "b": [0.1777, 0.1739, 0.2226, 0.1937]}, {"w": "the", "b": [0.2289, 0.1739, 0.2597, 0.1937]}, {"w": "corresponding", "b": [0.266, 0.1739, 0.4103, 0.1937]}, {"w": "target", "b": [0.4166, 0.1739, 0.4736, 0.1937]}, {"w": "data)", "b": [0.4799, 0.1739, 0.5303, 0.1937]}, {"w": "to", "b": [0.5366, 0.1739, 0.5562, 0.1937]}, {"w": "the", "b": [0.5625, 0.1739, 0.5934, 0.1937]}, {"w": "model", "b": [0.5997, 0.1739, 0.6627, 0.1937]}, {"w": "via", "b": [0.669, 0.1739, 0.6998, 0.1937]}, {"w": "the", "b": [0.7061, 0.1739, 0.737, 0.1937]}, {"w": "fit()", "b": [0.7432, 0.175, 0.8189, 0.1952]}, {"w": "method,", "b": [0.1294, 0.1953, 0.2114, 0.215]}, {"w": "similar", "b": [0.2177, 0.1953, 0.2878, 0.215]}, {"w": "to", "b": [0.2941, 0.1953, 0.3137, 0.215]}, {"w": "what", "b": [0.32, 0.1953, 0.3691, 0.215]}, {"w": "you", "b": [0.3754, 0.1953, 0.4132, 0.215]}, {"w": "would", "b": [0.4195, 0.1953, 0.4826, 0.215]}, {"w": "do", "b": [0.4889, 0.1953, 0.5141, 0.215]}, {"w": "in", "b": [0.5204, 0.1953, 0.54, 0.215]}, {"w": "Scikit-Learn", "b": [0.5463, 0.1953, 0.6724, 0.215]}, {"w": "and", "b": [0.6788, 0.1953, 0.7152, 0.215]}, {"w": "several", "b": [0.7215, 0.1953, 0.7929, 0.215]}, {"w": "other", "b": [0.7992, 0.1953, 0.8511, 0.215]}, {"w": "machine-learning", "b": [0.1294, 0.2158, 0.3059, 0.2355]}, {"w": "libraries:", "b": [0.3122, 0.2158, 0.4019, 0.2355]}]}, {"id": "b_2", "type": "equation", "text": "model.fit(input_tensor, target_tensor, batch_size=128, epochs=10)", "words": [{"w": "model.fit(input_tensor,", "b": [0.1357, 0.2535, 0.3968, 0.2687]}, {"w": "target_tensor,", "b": [0.4082, 0.2535, 0.5671, 0.2687]}, {"w": "batch_size=128,", "b": [0.5784, 0.2535, 0.7487, 0.2687]}, {"w": "epochs=10)", "b": [0.1357, 0.2687, 0.2492, 0.2838]}]}, {"id": "b_3", "type": "paragraph", "text": "Over the next few chapters, you’ll build a solid intuition about what type of network architectures work for different kinds of problems, how to pick the right learning configuration, and how to tweak a model until it gives the results you want to see. We’ll look at three basic examples in sections 3.4, 3.5, and 3.6: a two-class classification example, a many- class classification example, and a regression example.", "words": [{"w": "Over", "b": [0.1294, 0.3067, 0.1798, 0.3265]}, {"w": "the", "b": [0.1861, 0.3067, 0.217, 0.3265]}, {"w": "next", "b": [0.2233, 0.3067, 0.2667, 0.3265]}, {"w": "few", "b": [0.273, 0.3067, 0.3108, 0.3265]}, {"w": "chapters,", "b": [0.3171, 0.3067, 0.4075, 0.3265]}, {"w": "you’ll", "b": [0.4138, 0.3067, 0.4741, 0.3265]}, {"w": "build", "b": [0.4804, 0.3067, 0.5322, 0.3265]}, {"w": "a", "b": [0.5385, 0.3067, 0.5497, 0.3265]}, {"w": "solid", "b": [0.5561, 0.3067, 0.6051, 0.3265]}, {"w": "intuition", "b": [0.6114, 0.3067, 0.6969, 0.3265]}, {"w": "about", "b": [0.7032, 0.3067, 0.7593, 0.3265]}, {"w": "what", "b": [0.7656, 0.3067, 0.8146, 0.3265]}, {"w": "type", "b": [0.821, 0.3067, 0.8644, 0.3265]}, {"w": "of", "b": [0.1294, 0.3272, 0.1504, 0.347]}, {"w": "network", "b": [0.1567, 0.3272, 0.2394, 0.347]}, {"w": "architectures", "b": [0.2457, 0.3272, 0.3746, 0.347]}, {"w": "work", "b": [0.3809, 0.3272, 0.4327, 0.347]}, {"w": "for", "b": [0.439, 0.3272, 0.4684, 0.347]}, {"w": "different", "b": [0.4748, 0.3272, 0.5611, 0.347]}, {"w": "kinds", "b": [0.5674, 0.3272, 0.6221, 0.347]}, {"w": "of", "b": [0.6284, 0.3272, 0.6494, 0.347]}, {"w": "problems,", "b": [0.6557, 0.3272, 0.7559, 0.347]}, {"w": "how", "b": [0.7622, 0.3272, 0.8056, 0.347]}, {"w": "to", "b": [0.8119, 0.3272, 0.8316, 0.347]}, {"w": "pick", "b": [0.1294, 0.3477, 0.1729, 0.3675]}, {"w": "the", "b": [0.1792, 0.3477, 0.21, 0.3675]}, {"w": "right", "b": [0.2163, 0.3477, 0.2639, 0.3675]}, {"w": "learning", "b": [0.2702, 0.3477, 0.3529, 0.3675]}, {"w": "configuration,", "b": [0.3592, 0.3477, 0.5014, 0.3675]}, {"w": "and", "b": [0.5077, 0.3477, 0.5442, 0.3675]}, {"w": "how", "b": [0.5505, 0.3477, 0.5939, 0.3675]}, {"w": "to", "b": [0.6002, 0.3477, 0.6199, 0.3675]}, {"w": "tweak", "b": [0.6262, 0.3477, 0.6864, 0.3675]}, {"w": "a", "b": [0.6927, 0.3477, 0.7039, 0.3675]}, {"w": "model", "b": [0.7102, 0.3477, 0.7733, 0.3675]}, {"w": "until", "b": [0.7796, 0.3477, 0.8258, 0.3675]}, {"w": "it", "b": [0.8322, 0.3477, 0.8462, 0.3675]}, {"w": "gives", "b": [0.1294, 0.3682, 0.1827, 0.388]}, {"w": "the", "b": [0.189, 0.3682, 0.2198, 0.388]}, {"w": "results", "b": [0.2261, 0.3682, 0.292, 0.388]}, {"w": "you", "b": [0.2983, 0.3682, 0.3361, 0.388]}, {"w": "want", "b": [0.3424, 0.3682, 0.3915, 0.388]}, {"w": "to", "b": [0.3978, 0.3682, 0.4174, 0.388]}, {"w": "see.", "b": [0.4237, 0.3682, 0.4622, 0.388]}, {"w": "We’ll", "b": [0.4685, 0.3682, 0.5239, 0.388]}, {"w": "look", "b": [0.5302, 0.3682, 0.5751, 0.388]}, {"w": "at", "b": [0.5814, 0.3682, 0.5996, 0.388]}, {"w": "three", "b": [0.6059, 0.3682, 0.6563, 0.388]}, {"w": "basic", "b": [0.6626, 0.3682, 0.7145, 0.388]}, {"w": "examples", "b": [0.7208, 0.3682, 0.816, 0.388]}, {"w": "in", "b": [0.8224, 0.3682, 0.842, 0.388]}, {"w": "sections", "b": [0.1294, 0.3887, 0.2107, 0.4085]}, {"w": "3.4,", "b": [0.217, 0.3887, 0.2548, 0.4085]}, {"w": "3.5,", "b": [0.2611, 0.3887, 0.299, 0.4085]}, {"w": "and", "b": [0.3053, 0.3887, 0.3417, 0.4085]}, {"w": "3.6:", "b": [0.348, 0.3887, 0.3865, 0.4085]}, {"w": "a", "b": [0.3928, 0.3887, 0.404, 0.4085]}, {"w": "two-class", "b": [0.4103, 0.3887, 0.5056, 0.4085]}, {"w": "classification", "b": [0.5119, 0.3887, 0.645, 0.4085]}, {"w": "example,", "b": [0.6514, 0.3887, 0.7431, 0.4085]}, {"w": "a", "b": [0.7494, 0.3887, 0.7606, 0.4085]}, {"w": "many-", "b": [0.7669, 0.3887, 0.8314, 0.4085]}, {"w": "class", "b": [0.1294, 0.4092, 0.1785, 0.429]}, {"w": "classification", "b": [0.1848, 0.4092, 0.3179, 0.429]}, {"w": "example,", "b": [0.3242, 0.4092, 0.416, 0.429]}, {"w": "and", "b": [0.4223, 0.4092, 0.4587, 0.429]}, {"w": "a", "b": [0.465, 0.4092, 0.4762, 0.429]}, {"w": "regression", "b": [0.4825, 0.4092, 0.5862, 0.429]}, {"w": "example.", "b": [0.5925, 0.4092, 0.6843, 0.429]}]}, {"id": "b_4", "type": "equation", "text": "3.3. Setting up a deep-learning workstation", "words": [{"w": "3.3.", "b": [0.1294, 0.4661, 0.172, 0.4883]}, {"w": "Setting", "b": [0.1791, 0.4661, 0.2642, 0.4883]}, {"w": "up", "b": [0.2713, 0.4661, 0.3029, 0.4883]}, {"w": "a", "b": [0.31, 0.4661, 0.3241, 0.4883]}, {"w": "deep-learning", "b": [0.3312, 0.4661, 0.4984, 0.4883]}, {"w": "workstation", "b": [0.5055, 0.4661, 0.6505, 0.4883]}]}, {"id": "b_5", "type": "paragraph", "text": "Before you can get started developing deep-learning applications, you need to set up your workstation. It’s highly recommended, although not strictly necessary, that you run deep-learning code on a modern NVIDIA GPU. Some applications—in particular, image processing with convolutional networks and sequence processing with recurrent neural networks—will be excruciatingly slow on CPU, even a fast multicore CPU. And even for applications that can realistically be run on CPU, you’ll generally see speed increase by a factor or 5 or 10 by using a modern GPU. If you don’t want to install a GPU on your machine, you can alternatively consider running your experiments on an AWS EC2 GPU instance or on Google Cloud Platform. But note that cloud GPU instances can become expensive over time.", "words": [{"w": "Before", "b": [0.1294, 0.5117, 0.1981, 0.5315]}, {"w": "you", "b": [0.2044, 0.5117, 0.2422, 0.5315]}, {"w": "can", "b": [0.2485, 0.5117, 0.2835, 0.5315]}, {"w": "get", "b": [0.2898, 0.5117, 0.3206, 0.5315]}, {"w": "started", "b": [0.327, 0.5117, 0.3942, 0.5315]}, {"w": "developing", "b": [0.4005, 0.5117, 0.5126, 0.5315]}, {"w": "deep-learning", "b": [0.5189, 0.5117, 0.6576, 0.5315]}, {"w": "applications,", "b": [0.6639, 0.5117, 0.7921, 0.5315]}, {"w": "you", "b": [0.7984, 0.5117, 0.8363, 0.5315]}, {"w": "need", "b": [0.1294, 0.5322, 0.177, 0.552]}, {"w": "to", "b": [0.1833, 0.5322, 0.203, 0.552]}, {"w": "set", "b": [0.2093, 0.5322, 0.2373, 0.552]}, {"w": "up", "b": [0.2436, 0.5322, 0.2688, 0.552]}, {"w": "your", "b": [0.2751, 0.5322, 0.3214, 0.552]}, {"w": "workstation.", "b": [0.3277, 0.5322, 0.4531, 0.552]}, {"w": "It’s", "b": [0.4594, 0.5322, 0.4916, 0.552]}, {"w": "highly", "b": [0.4979, 0.5322, 0.5624, 0.552]}, {"w": "recommended,", "b": [0.5687, 0.5322, 0.7179, 0.552]}, {"w": "although", "b": [0.7242, 0.5322, 0.8125, 0.552]}, {"w": "not", "b": [0.8188, 0.5322, 0.851, 0.552]}, {"w": "strictly", "b": [0.1294, 0.5527, 0.1995, 0.5725]}, {"w": "necessary,", "b": [0.2058, 0.5527, 0.3085, 0.5725]}, {"w": "that", "b": [0.3148, 0.5527, 0.3526, 0.5725]}, {"w": "you", "b": [0.3589, 0.5527, 0.3968, 0.5725]}, {"w": "run", "b": [0.4031, 0.5527, 0.4367, 0.5725]}, {"w": "deep-learning", "b": [0.443, 0.5527, 0.5817, 0.5725]}, {"w": "code", "b": [0.588, 0.5527, 0.6356, 0.5725]}, {"w": "on", "b": [0.642, 0.5527, 0.6672, 0.5725]}, {"w": "a", "b": [0.6735, 0.5527, 0.6847, 0.5725]}, {"w": "modern", "b": [0.691, 0.5527, 0.7681, 0.5725]}, {"w": "NVIDIA", "b": [0.7744, 0.5527, 0.864, 0.5725]}, {"w": "GPU.", "b": [0.1294, 0.5732, 0.1862, 0.593]}, {"w": "Some", "b": [0.1925, 0.5732, 0.2499, 0.593]}, {"w": "applications—in", "b": [0.2562, 0.5732, 0.423, 0.593]}, {"w": "particular,", "b": [0.4293, 0.5732, 0.5312, 0.593]}, {"w": "image", "b": [0.5375, 0.5732, 0.5992, 0.593]}, {"w": "processing", "b": [0.6055, 0.5732, 0.7134, 0.593]}, {"w": "with", "b": [0.7197, 0.5732, 0.7645, 0.593]}, {"w": "convolutional", "b": [0.1294, 0.5937, 0.2682, 0.6135]}, {"w": "networks", "b": [0.2745, 0.5937, 0.3669, 0.6135]}, {"w": "and", "b": [0.3732, 0.5937, 0.4097, 0.6135]}, {"w": "sequence", "b": [0.416, 0.5937, 0.5084, 0.6135]}, {"w": "processing", "b": [0.5147, 0.5937, 0.6226, 0.6135]}, {"w": "with", "b": [0.6289, 0.5937, 0.6738, 0.6135]}, {"w": "recurrent", "b": [0.6801, 0.5937, 0.7711, 0.6135]}, {"w": "neural", "b": [0.7774, 0.5937, 0.8405, 0.6135]}, {"w": "networks—will", "b": [0.1294, 0.6142, 0.2864, 0.634]}, {"w": "be", "b": [0.2927, 0.6142, 0.3165, 0.634]}, {"w": "excruciatingly", "b": [0.3228, 0.6142, 0.4671, 0.634]}, {"w": "slow", "b": [0.4734, 0.6142, 0.521, 0.634]}, {"w": "on", "b": [0.5273, 0.6142, 0.5526, 0.634]}, {"w": "CPU,", "b": [0.5589, 0.6142, 0.6142, 0.634]}, {"w": "even", "b": [0.6205, 0.6142, 0.6682, 0.634]}, {"w": "a", "b": [0.6745, 0.6142, 0.6857, 0.634]}, {"w": "fast", "b": [0.692, 0.6142, 0.7284, 0.634]}, {"w": "multicore", "b": [0.7347, 0.6142, 0.8314, 0.634]}, {"w": "CPU.", "b": [0.1294, 0.6347, 0.1848, 0.6545]}, {"w": "And", "b": [0.1911, 0.6347, 0.2345, 0.6545]}, {"w": "even", "b": [0.2408, 0.6347, 0.2885, 0.6545]}, {"w": "for", "b": [0.2948, 0.6347, 0.3242, 0.6545]}, {"w": "applications", "b": [0.3305, 0.6347, 0.4524, 0.6545]}, {"w": "that", "b": [0.4587, 0.6347, 0.4965, 0.6545]}, {"w": "can", "b": [0.5029, 0.6347, 0.5379, 0.6545]}, {"w": "realistically", "b": [0.5442, 0.6347, 0.6619, 0.6545]}, {"w": "be", "b": [0.6682, 0.6347, 0.692, 0.6545]}, {"w": "run", "b": [0.6983, 0.6347, 0.7319, 0.6545]}, {"w": "on", "b": [0.7382, 0.6347, 0.7635, 0.6545]}, {"w": "CPU,", "b": [0.7698, 0.6347, 0.8251, 0.6545]}, {"w": "you’ll", "b": [0.1294, 0.6552, 0.1897, 0.675]}, {"w": "generally", "b": [0.196, 0.6552, 0.2898, 0.675]}, {"w": "see", "b": [0.2962, 0.6552, 0.3284, 0.675]}, {"w": "speed", "b": [0.3346, 0.6552, 0.3921, 0.675]}, {"w": "increase", "b": [0.3984, 0.6552, 0.481, 0.675]}, {"w": "by", "b": [0.4873, 0.6552, 0.5125, 0.675]}, {"w": "a", "b": [0.5189, 0.6552, 0.5301, 0.675]}, {"w": "factor", "b": [0.5364, 0.6552, 0.5952, 0.675]}, {"w": "or", "b": [0.6015, 0.6552, 0.6225, 0.675]}, {"w": "5", "b": [0.6288, 0.6552, 0.6414, 0.675]}, {"w": "or", "b": [0.6477, 0.6552, 0.6687, 0.675]}, {"w": "10", "b": [0.675, 0.6552, 0.7003, 0.675]}, {"w": "by", "b": [0.7066, 0.6552, 0.7318, 0.675]}, {"w": "using", "b": [0.7381, 0.6552, 0.7928, 0.675]}, {"w": "a", "b": [0.7991, 0.6552, 0.8103, 0.675]}, {"w": "modern", "b": [0.1294, 0.6757, 0.2065, 0.6955]}, {"w": "GPU.", "b": [0.2128, 0.6757, 0.2695, 0.6955]}, {"w": "If", "b": [0.2758, 0.6757, 0.2926, 0.6955]}, {"w": "you", "b": [0.299, 0.6757, 0.3368, 0.6955]}, {"w": "don’t", "b": [0.3431, 0.6757, 0.3959, 0.6955]}, {"w": "want", "b": [0.4022, 0.6757, 0.4512, 0.6955]}, {"w": "to", "b": [0.4576, 0.6757, 0.4772, 0.6955]}, {"w": "install", "b": [0.4835, 0.6757, 0.5452, 0.6955]}, {"w": "a", "b": [0.5515, 0.6757, 0.5627, 0.6955]}, {"w": "GPU", "b": [0.569, 0.6757, 0.6194, 0.6955]}, {"w": "on", "b": [0.6257, 0.6757, 0.651, 0.6955]}, {"w": "your", "b": [0.6573, 0.6757, 0.7035, 0.6955]}, {"w": "machine,", "b": [0.7098, 0.6757, 0.8016, 0.6955]}, {"w": "you", "b": [0.8079, 0.6757, 0.8457, 0.6955]}, {"w": "can", "b": [0.1294, 0.6962, 0.1644, 0.716]}, {"w": "alternatively", "b": [0.1707, 0.6962, 0.2968, 0.716]}, {"w": "consider", "b": [0.3031, 0.6962, 0.3886, 0.716]}, {"w": "running", "b": [0.3949, 0.6962, 0.4733, 0.716]}, {"w": "your", "b": [0.4797, 0.6962, 0.5259, 0.716]}, {"w": "experiments", "b": [0.5322, 0.6962, 0.6555, 0.716]}, {"w": "on", "b": [0.6618, 0.6962, 0.687, 0.716]}, {"w": "an", "b": [0.6933, 0.6962, 0.7172, 0.716]}, {"w": "AWS", "b": [0.7235, 0.6962, 0.7775, 0.716]}, {"w": "EC2", "b": [0.7838, 0.6962, 0.8286, 0.716]}, {"w": "GPU", "b": [0.1294, 0.7167, 0.1799, 0.7365]}, {"w": "instance", "b": [0.1862, 0.7167, 0.2688, 0.7365]}, {"w": "or", "b": [0.2751, 0.7167, 0.2962, 0.7365]}, {"w": "on", "b": [0.3025, 0.7167, 0.3277, 0.7365]}, {"w": "Google", "b": [0.334, 0.7167, 0.4083, 0.7365]}, {"w": "Cloud", "b": [0.4146, 0.7167, 0.4762, 0.7365]}, {"w": "Platform.", "b": [0.4825, 0.7167, 0.5771, 0.7365]}, {"w": "But", "b": [0.5835, 0.7167, 0.6199, 0.7365]}, {"w": "note", "b": [0.6262, 0.7167, 0.6696, 0.7365]}, {"w": "that", "b": [0.676, 0.7167, 0.7138, 0.7365]}, {"w": "cloud", "b": [0.7201, 0.7167, 0.7762, 0.7365]}, {"w": "GPU", "b": [0.7825, 0.7167, 0.8329, 0.7365]}, {"w": "instances", "b": [0.1294, 0.7372, 0.2219, 0.757]}, {"w": "can", "b": [0.2282, 0.7372, 0.2632, 0.757]}, {"w": "become", "b": [0.2695, 0.7372, 0.3479, 0.757]}, {"w": "expensive", "b": [0.3542, 0.7372, 0.4551, 0.757]}, {"w": "over", "b": [0.4614, 0.7372, 0.5063, 0.757]}, {"w": "time.", "b": [0.5126, 0.7372, 0.5637, 0.757]}]}, {"id": "b_6", "type": "paragraph", "text": "Whether you’re running locally or in the cloud, it’s better to be using a Unix workstation. Although it’s technically possible to use Keras on Windows (all three Keras backends support Windows), We don’t recommend it. In the installation instructions in appendix A, we’ll consider an Ubuntu machine. If you’re a Windows user, the simplest solution to get everything running is to set up an Ubuntu dual boot on", "words": [{"w": "Whether", "b": [0.1294, 0.78, 0.2163, 0.7998]}, {"w": "you’re", "b": [0.2226, 0.78, 0.2884, 0.7998]}, {"w": "running", "b": [0.2947, 0.78, 0.3732, 0.7998]}, {"w": "locally", "b": [0.3795, 0.78, 0.4482, 0.7998]}, {"w": "or", "b": [0.4545, 0.78, 0.4755, 0.7998]}, {"w": "in", "b": [0.4818, 0.78, 0.5014, 0.7998]}, {"w": "the", "b": [0.5077, 0.78, 0.5385, 0.7998]}, {"w": "cloud,", "b": [0.5449, 0.78, 0.6072, 0.7998]}, {"w": "it’s", "b": [0.6135, 0.78, 0.6443, 0.7998]}, {"w": "better", "b": [0.6506, 0.78, 0.708, 0.7998]}, {"w": "to", "b": [0.7143, 0.78, 0.734, 0.7998]}, {"w": "be", "b": [0.7403, 0.78, 0.7641, 0.7998]}, {"w": "using", "b": [0.7704, 0.78, 0.8251, 0.7998]}, {"w": "a", "b": [0.8314, 0.78, 0.8426, 0.7998]}, {"w": "Unix", "b": [0.1294, 0.8005, 0.1799, 0.8203]}, {"w": "workstation.", "b": [0.1862, 0.8005, 0.3116, 0.8203]}, {"w": "Although", "b": [0.3179, 0.8005, 0.4132, 0.8203]}, {"w": "it’s", "b": [0.4195, 0.8005, 0.4503, 0.8203]}, {"w": "technically", "b": [0.4566, 0.8005, 0.5673, 0.8203]}, {"w": "possible", "b": [0.5736, 0.8005, 0.6563, 0.8203]}, {"w": "to", "b": [0.6626, 0.8005, 0.6822, 0.8203]}, {"w": "use", "b": [0.6885, 0.8005, 0.7222, 0.8203]}, {"w": "Keras", "b": [0.7285, 0.8005, 0.7873, 0.8203]}, {"w": "on", "b": [0.7936, 0.8005, 0.8188, 0.8203]}, {"w": "Windows", "b": [0.1294, 0.821, 0.2251, 0.8408]}, {"w": "(all", "b": [0.2314, 0.821, 0.265, 0.8408]}, {"w": "three", "b": [0.2713, 0.821, 0.3218, 0.8408]}, {"w": "Keras", "b": [0.3281, 0.821, 0.3869, 0.8408]}, {"w": "backends", "b": [0.3932, 0.821, 0.4871, 0.8408]}, {"w": "support", "b": [0.4934, 0.821, 0.569, 0.8408]}, {"w": "Windows),", "b": [0.5753, 0.821, 0.6857, 0.8408]}, {"w": "We", "b": [0.692, 0.821, 0.725, 0.8408]}, {"w": "don’t", "b": [0.7313, 0.821, 0.7841, 0.8408]}, {"w": "recommend", "b": [0.1294, 0.8415, 0.2485, 0.8613]}, {"w": "it.", "b": [0.2548, 0.8415, 0.2751, 0.8613]}, {"w": "In", "b": [0.2814, 0.8415, 0.3025, 0.8613]}, {"w": "the", "b": [0.3088, 0.8415, 0.3396, 0.8613]}, {"w": "installation", "b": [0.3459, 0.8415, 0.458, 0.8613]}, {"w": "instructions", "b": [0.4643, 0.8415, 0.5821, 0.8613]}, {"w": "in", "b": [0.5883, 0.8415, 0.6079, 0.8613]}, {"w": "appendix", "b": [0.6142, 0.8415, 0.7067, 0.8613]}, {"w": "A,", "b": [0.713, 0.8415, 0.7375, 0.8613]}, {"w": "we’ll", "b": [0.7438, 0.8415, 0.7956, 0.8613]}, {"w": "consider", "b": [0.1294, 0.862, 0.2149, 0.8818]}, {"w": "an", "b": [0.2212, 0.862, 0.245, 0.8818]}, {"w": "Ubuntu", "b": [0.2513, 0.862, 0.327, 0.8818]}, {"w": "machine.", "b": [0.3333, 0.862, 0.4251, 0.8818]}, {"w": "If", "b": [0.4314, 0.862, 0.4482, 0.8818]}, {"w": "you’re", "b": [0.4545, 0.862, 0.5203, 0.8818]}, {"w": "a", "b": [0.5266, 0.862, 0.5378, 0.8818]}, {"w": "Windows", "b": [0.5441, 0.862, 0.6398, 0.8818]}, {"w": "user,", "b": [0.6461, 0.862, 0.6934, 0.8818]}, {"w": "the", "b": [0.6997, 0.862, 0.7305, 0.8818]}, {"w": "simplest", "b": [0.7368, 0.862, 0.8209, 0.8818]}, {"w": "solution", "b": [0.1294, 0.8825, 0.2107, 0.9023]}, {"w": "to", "b": [0.217, 0.8825, 0.2366, 0.9023]}, {"w": "get", "b": [0.243, 0.8825, 0.2738, 0.9023]}, {"w": "everything", "b": [0.2801, 0.8825, 0.388, 0.9023]}, {"w": "running", "b": [0.3943, 0.8825, 0.4728, 0.9023]}, {"w": "is", "b": [0.4791, 0.8825, 0.4959, 0.9023]}, {"w": "to", "b": [0.5022, 0.8825, 0.5218, 0.9023]}, {"w": "set", "b": [0.5281, 0.8825, 0.5562, 0.9023]}, {"w": "up", "b": [0.5625, 0.8825, 0.5877, 0.9023]}, {"w": "an", "b": [0.5939, 0.8825, 0.6178, 0.9023]}, {"w": "Ubuntu", "b": [0.6241, 0.8825, 0.6997, 0.9023]}, {"w": "dual", "b": [0.706, 0.8825, 0.7495, 0.9023]}, {"w": "boot", "b": [0.7558, 0.8825, 0.8006, 0.9023]}, {"w": "on", "b": [0.8069, 0.8825, 0.8322, 0.9023]}]}]}, {"page": 104, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "your machine. It may seem like a hassle, but using Ubuntu will save you a lot of time and trouble in the long run.", "words": [{"w": "your", "b": [0.1294, 0.0857, 0.1757, 0.1054]}, {"w": "machine.", "b": [0.182, 0.0857, 0.2737, 0.1054]}, {"w": "It", "b": [0.28, 0.0857, 0.2954, 0.1054]}, {"w": "may", "b": [0.3018, 0.0857, 0.3452, 0.1054]}, {"w": "seem", "b": [0.3515, 0.0857, 0.4033, 0.1054]}, {"w": "like", "b": [0.4096, 0.0857, 0.4475, 0.1054]}, {"w": "a", "b": [0.4538, 0.0857, 0.465, 0.1054]}, {"w": "hassle,", "b": [0.4713, 0.0857, 0.5393, 0.1054]}, {"w": "but", "b": [0.5456, 0.0857, 0.5778, 0.1054]}, {"w": "using", "b": [0.5841, 0.0857, 0.6388, 0.1054]}, {"w": "Ubuntu", "b": [0.6451, 0.0857, 0.7208, 0.1054]}, {"w": "will", "b": [0.7271, 0.0857, 0.7663, 0.1054]}, {"w": "save", "b": [0.7726, 0.0857, 0.8174, 0.1054]}, {"w": "you", "b": [0.8238, 0.0857, 0.8616, 0.1054]}, {"w": "a", "b": [0.1294, 0.1062, 0.1406, 0.1259]}, {"w": "lot", "b": [0.1469, 0.1062, 0.1736, 0.1259]}, {"w": "of", "b": [0.1799, 0.1062, 0.2009, 0.1259]}, {"w": "time", "b": [0.2072, 0.1062, 0.252, 0.1259]}, {"w": "and", "b": [0.2583, 0.1062, 0.2948, 0.1259]}, {"w": "trouble", "b": [0.3011, 0.1062, 0.3725, 0.1259]}, {"w": "in", "b": [0.3788, 0.1062, 0.3985, 0.1259]}, {"w": "the", "b": [0.4047, 0.1062, 0.4356, 0.1259]}, {"w": "long", "b": [0.4419, 0.1062, 0.4867, 0.1259]}, {"w": "run.", "b": [0.493, 0.1062, 0.533, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Note that in order to use Keras, you need to install TensorFlow or CNTK or Theano (or all of them, if you want to be able to switch back and forth among the three backends). In this book, we’ll focus on TensorFlow, with some light instructions relative to Theano. We won’t cover CNTK.", "words": [{"w": "Note", "b": [0.1294, 0.149, 0.1785, 0.1687]}, {"w": "that", "b": [0.1848, 0.149, 0.2226, 0.1687]}, {"w": "in", "b": [0.2289, 0.149, 0.2485, 0.1687]}, {"w": "order", "b": [0.2548, 0.149, 0.3081, 0.1687]}, {"w": "to", "b": [0.3144, 0.149, 0.334, 0.1687]}, {"w": "use", "b": [0.3403, 0.149, 0.3739, 0.1687]}, {"w": "Keras,", "b": [0.3802, 0.149, 0.4454, 0.1687]}, {"w": "you", "b": [0.4517, 0.149, 0.4895, 0.1687]}, {"w": "need", "b": [0.4958, 0.149, 0.5434, 0.1687]}, {"w": "to", "b": [0.5497, 0.149, 0.5694, 0.1687]}, {"w": "install", "b": [0.5757, 0.149, 0.6374, 0.1687]}, {"w": "TensorFlow", "b": [0.6437, 0.149, 0.7638, 0.1687]}, {"w": "or", "b": [0.7701, 0.149, 0.7925, 0.1687]}, {"w": "CNTK", "b": [0.7988, 0.149, 0.8675, 0.1687]}, {"w": "or", "b": [0.1294, 0.1695, 0.1518, 0.1892]}, {"w": "Theano", "b": [0.1581, 0.1695, 0.2338, 0.1892]}, {"w": "(or", "b": [0.2401, 0.1695, 0.2695, 0.1892]}, {"w": "all", "b": [0.2758, 0.1695, 0.301, 0.1892]}, {"w": "of", "b": [0.3074, 0.1695, 0.3284, 0.1892]}, {"w": "them,", "b": [0.3347, 0.1695, 0.3914, 0.1892]}, {"w": "if", "b": [0.3977, 0.1695, 0.4132, 0.1892]}, {"w": "you", "b": [0.4195, 0.1695, 0.4573, 0.1892]}, {"w": "want", "b": [0.4636, 0.1695, 0.5126, 0.1892]}, {"w": "to", "b": [0.5189, 0.1695, 0.5386, 0.1892]}, {"w": "be", "b": [0.5449, 0.1695, 0.5687, 0.1892]}, {"w": "able", "b": [0.575, 0.1695, 0.617, 0.1892]}, {"w": "to", "b": [0.6233, 0.1695, 0.643, 0.1892]}, {"w": "switch", "b": [0.6493, 0.1695, 0.7151, 0.1892]}, {"w": "back", "b": [0.7214, 0.1695, 0.7691, 0.1892]}, {"w": "and", "b": [0.7754, 0.1695, 0.8118, 0.1892]}, {"w": "forth", "b": [0.8181, 0.1695, 0.8671, 0.1892]}, {"w": "among", "b": [0.1294, 0.19, 0.1981, 0.2097]}, {"w": "the", "b": [0.2044, 0.19, 0.2352, 0.2097]}, {"w": "three", "b": [0.2415, 0.19, 0.2919, 0.2097]}, {"w": "backends).", "b": [0.2982, 0.19, 0.4068, 0.2097]}, {"w": "In", "b": [0.4131, 0.19, 0.4341, 0.2097]}, {"w": "this", "b": [0.4404, 0.19, 0.4769, 0.2097]}, {"w": "book,", "b": [0.4832, 0.19, 0.54, 0.2097]}, {"w": "we’ll", "b": [0.5463, 0.19, 0.5981, 0.2097]}, {"w": "focus", "b": [0.6044, 0.19, 0.6591, 0.2097]}, {"w": "on", "b": [0.6653, 0.19, 0.6905, 0.2097]}, {"w": "TensorFlow,", "b": [0.6968, 0.19, 0.8217, 0.2097]}, {"w": "with", "b": [0.1294, 0.2105, 0.1743, 0.2302]}, {"w": "some", "b": [0.1806, 0.2105, 0.2338, 0.2302]}, {"w": "light", "b": [0.2401, 0.2105, 0.2864, 0.2302]}, {"w": "instructions", "b": [0.2927, 0.2105, 0.4104, 0.2302]}, {"w": "relative", "b": [0.4167, 0.2105, 0.4924, 0.2302]}, {"w": "to", "b": [0.4987, 0.2105, 0.5183, 0.2302]}, {"w": "Theano.", "b": [0.5246, 0.2105, 0.6066, 0.2302]}, {"w": "We", "b": [0.6129, 0.2105, 0.6458, 0.2302]}, {"w": "won’t", "b": [0.6521, 0.2105, 0.7105, 0.2302]}, {"w": "cover", "b": [0.7168, 0.2105, 0.7728, 0.2302]}, {"w": "CNTK.", "b": [0.7791, 0.2105, 0.8541, 0.2302]}]}, {"id": "b_2", "type": "equation", "text": "3.3.1. Jupyter notebooks: the preferred way to run deep-learning experiments", "words": [{"w": "3.3.1.", "b": [0.1294, 0.2577, 0.1862, 0.2774]}, {"w": "Jupyter", "b": [0.1925, 0.2577, 0.2766, 0.2774]}, {"w": "notebooks:", "b": [0.2829, 0.2577, 0.4006, 0.2774]}, {"w": "the", "b": [0.4069, 0.2577, 0.4405, 0.2774]}, {"w": "preferred", "b": [0.4468, 0.2577, 0.5496, 0.2774]}, {"w": "way", "b": [0.5559, 0.2577, 0.5993, 0.2774]}, {"w": "to", "b": [0.6056, 0.2577, 0.6266, 0.2774]}, {"w": "run", "b": [0.6329, 0.2577, 0.6722, 0.2774]}, {"w": "deep-learning", "b": [0.6785, 0.2577, 0.827, 0.2774]}, {"w": "experiments", "b": [0.1294, 0.2782, 0.2611, 0.2979]}]}, {"id": "b_3", "type": "paragraph", "text": "Jupyter notebooks are a great way to run deep-learning experiments—in particular, the many code examples in this book. They’re widely used in the data-science and machine-learning communities. A notebook is a file generated by the Jupyter Notebook app (https://jupyter.org), which you can edit in your browser. It mixes the ability to execute Python code with rich text-editing capabilities for annotating what you’re doing. A notebook also allows you to break up long experiments into smaller pieces that can be executed independently, which makes development interactive and means you don’t have to rerun all of your previous code if something goes wrong late in an experiment.", "words": [{"w": "Jupyter", "b": [0.1294, 0.321, 0.2037, 0.3407]}, {"w": "notebooks", "b": [0.21, 0.321, 0.3137, 0.3407]}, {"w": "are", "b": [0.32, 0.321, 0.3508, 0.3407]}, {"w": "a", "b": [0.3571, 0.321, 0.3683, 0.3407]}, {"w": "great", "b": [0.3746, 0.321, 0.425, 0.3407]}, {"w": "way", "b": [0.4313, 0.321, 0.4734, 0.3407]}, {"w": "to", "b": [0.4797, 0.321, 0.4993, 0.3407]}, {"w": "run", "b": [0.5056, 0.321, 0.5392, 0.3407]}, {"w": "deep-learning", "b": [0.5455, 0.321, 0.6842, 0.3407]}, {"w": "experiments—in", "b": [0.6905, 0.321, 0.8587, 0.3407]}, {"w": "particular,", "b": [0.1294, 0.3415, 0.2313, 0.3612]}, {"w": "the", "b": [0.2377, 0.3415, 0.2685, 0.3612]}, {"w": "many", "b": [0.2748, 0.3415, 0.3308, 0.3612]}, {"w": "code", "b": [0.3371, 0.3415, 0.3848, 0.3612]}, {"w": "examples", "b": [0.3911, 0.3415, 0.4864, 0.3612]}, {"w": "in", "b": [0.4927, 0.3415, 0.5123, 0.3612]}, {"w": "this", "b": [0.5186, 0.3415, 0.555, 0.3612]}, {"w": "book.", "b": [0.5614, 0.3415, 0.6181, 0.3612]}, {"w": "They’re", "b": [0.6244, 0.3415, 0.7043, 0.3612]}, {"w": "widely", "b": [0.7105, 0.3415, 0.7792, 0.3612]}, {"w": "used", "b": [0.7855, 0.3415, 0.8317, 0.3612]}, {"w": "in", "b": [0.838, 0.3415, 0.8576, 0.3612]}, {"w": "the", "b": [0.1294, 0.362, 0.1602, 0.3817]}, {"w": "data-science", "b": [0.1665, 0.362, 0.2912, 0.3817]}, {"w": "and", "b": [0.2975, 0.362, 0.3339, 0.3817]}, {"w": "machine-learning", "b": [0.3402, 0.362, 0.5168, 0.3817]}, {"w": "communities.", "b": [0.5231, 0.362, 0.6597, 0.3817]}, {"w": "A", "b": [0.666, 0.362, 0.6843, 0.3817]}, {"w": "notebook", "b": [0.6904, 0.362, 0.7829, 0.3817]}, {"w": "is", "b": [0.7892, 0.362, 0.806, 0.3817]}, {"w": "a", "b": [0.8123, 0.362, 0.8235, 0.3817]}, {"w": "file", "b": [0.8298, 0.362, 0.8635, 0.3817]}, {"w": "generated", "b": [0.1294, 0.3825, 0.2275, 0.4022]}, {"w": "by", "b": [0.2338, 0.3825, 0.259, 0.4022]}, {"w": "the", "b": [0.2653, 0.3825, 0.2961, 0.4022]}, {"w": "Jupyter", "b": [0.3024, 0.3825, 0.3767, 0.4022]}, {"w": "Notebook", "b": [0.383, 0.3825, 0.4825, 0.4022]}, {"w": "app", "b": [0.4888, 0.3825, 0.5252, 0.4022]}, {"w": "(https://jupyter.org),", "b": [0.5315, 0.3825, 0.7342, 0.4022]}, {"w": "which", "b": [0.7405, 0.3825, 0.8022, 0.4022]}, {"w": "you", "b": [0.8085, 0.3825, 0.8463, 0.4022]}, {"w": "can", "b": [0.1294, 0.403, 0.1644, 0.4227]}, {"w": "edit", "b": [0.1707, 0.403, 0.2086, 0.4227]}, {"w": "in", "b": [0.2149, 0.403, 0.2345, 0.4227]}, {"w": "your", "b": [0.2408, 0.403, 0.287, 0.4227]}, {"w": "browser.", "b": [0.2934, 0.403, 0.3795, 0.4227]}, {"w": "It", "b": [0.3858, 0.403, 0.4012, 0.4227]}, {"w": "mixes", "b": [0.4075, 0.403, 0.4678, 0.4227]}, {"w": "the", "b": [0.4741, 0.403, 0.5049, 0.4227]}, {"w": "ability", "b": [0.5112, 0.403, 0.5757, 0.4227]}, {"w": "to", "b": [0.582, 0.403, 0.6016, 0.4227]}, {"w": "execute", "b": [0.6079, 0.403, 0.685, 0.4227]}, {"w": "Python", "b": [0.6913, 0.403, 0.7628, 0.4227]}, {"w": "code", "b": [0.7691, 0.403, 0.8167, 0.4227]}, {"w": "with", "b": [0.823, 0.403, 0.8679, 0.4227]}, {"w": "rich", "b": [0.1294, 0.4235, 0.1686, 0.4432]}, {"w": "text-editing", "b": [0.1749, 0.4235, 0.2913, 0.4432]}, {"w": "capabilities", "b": [0.2976, 0.4235, 0.4125, 0.4432]}, {"w": "for", "b": [0.4188, 0.4235, 0.4482, 0.4432]}, {"w": "annotating", "b": [0.4544, 0.4235, 0.5609, 0.4432]}, {"w": "what", "b": [0.5672, 0.4235, 0.6163, 0.4432]}, {"w": "you’re", "b": [0.6226, 0.4235, 0.6884, 0.4432]}, {"w": "doing.", "b": [0.6947, 0.4235, 0.7585, 0.4432]}, {"w": "A", "b": [0.7648, 0.4235, 0.783, 0.4432]}, {"w": "notebook", "b": [0.1294, 0.444, 0.2233, 0.4637]}, {"w": "also", "b": [0.2296, 0.444, 0.2702, 0.4637]}, {"w": "allows", "b": [0.2766, 0.444, 0.3424, 0.4637]}, {"w": "you", "b": [0.3487, 0.444, 0.3866, 0.4637]}, {"w": "to", "b": [0.3929, 0.444, 0.4125, 0.4637]}, {"w": "break", "b": [0.4188, 0.444, 0.4748, 0.4637]}, {"w": "up", "b": [0.4811, 0.444, 0.5064, 0.4637]}, {"w": "long", "b": [0.5127, 0.444, 0.5575, 0.4637]}, {"w": "experiments", "b": [0.5638, 0.444, 0.6871, 0.4637]}, {"w": "into", "b": [0.6934, 0.444, 0.7327, 0.4637]}, {"w": "smaller", "b": [0.739, 0.444, 0.8133, 0.4637]}, {"w": "pieces", "b": [0.1294, 0.4645, 0.1925, 0.4842]}, {"w": "that", "b": [0.1988, 0.4645, 0.2366, 0.4842]}, {"w": "can", "b": [0.2429, 0.4645, 0.2779, 0.4842]}, {"w": "be", "b": [0.2842, 0.4645, 0.308, 0.4842]}, {"w": "executed", "b": [0.3143, 0.4645, 0.404, 0.4842]}, {"w": "independently,", "b": [0.4102, 0.4645, 0.5578, 0.4842]}, {"w": "which", "b": [0.5641, 0.4645, 0.6258, 0.4842]}, {"w": "makes", "b": [0.6321, 0.4645, 0.6965, 0.4842]}, {"w": "development", "b": [0.7028, 0.4645, 0.8332, 0.4842]}, {"w": "interactive", "b": [0.1294, 0.485, 0.2359, 0.5047]}, {"w": "and", "b": [0.2422, 0.485, 0.2786, 0.5047]}, {"w": "means", "b": [0.2849, 0.485, 0.3494, 0.5047]}, {"w": "you", "b": [0.3557, 0.485, 0.3935, 0.5047]}, {"w": "don’t", "b": [0.3998, 0.485, 0.4526, 0.5047]}, {"w": "have", "b": [0.4589, 0.485, 0.5065, 0.5047]}, {"w": "to", "b": [0.5128, 0.485, 0.5324, 0.5047]}, {"w": "rerun", "b": [0.5388, 0.485, 0.592, 0.5047]}, {"w": "all", "b": [0.5983, 0.485, 0.6235, 0.5047]}, {"w": "of", "b": [0.6298, 0.485, 0.6508, 0.5047]}, {"w": "your", "b": [0.6571, 0.485, 0.7034, 0.5047]}, {"w": "previous", "b": [0.7097, 0.485, 0.7966, 0.5047]}, {"w": "code", "b": [0.8029, 0.485, 0.8505, 0.5047]}, {"w": "if", "b": [0.1294, 0.5055, 0.1448, 0.5252]}, {"w": "something", "b": [0.1511, 0.5055, 0.2562, 0.5252]}, {"w": "goes", "b": [0.2625, 0.5055, 0.3088, 0.5252]}, {"w": "wrong", "b": [0.3151, 0.5055, 0.3795, 0.5252]}, {"w": "late", "b": [0.3858, 0.5055, 0.4223, 0.5252]}, {"w": "in", "b": [0.4286, 0.5055, 0.4482, 0.5252]}, {"w": "an", "b": [0.4545, 0.5055, 0.4783, 0.5252]}, {"w": "experiment.", "b": [0.4846, 0.5055, 0.6044, 0.5252]}]}, {"id": "b_4", "type": "paragraph", "text": "We recommend using Jupyter notebooks to get started with Keras, although that isn’t a requirement: you can also run standalone Python scripts or run code from within an IDE such as PyCharm. All the code examples in this book are available as open source notebooks; you can download them from the book’s website at www.manning.com/books/deep-learning-with-python.", "words": [{"w": "We", "b": [0.1294, 0.5483, 0.1624, 0.568]}, {"w": "recommend", "b": [0.1687, 0.5483, 0.2878, 0.568]}, {"w": "using", "b": [0.2941, 0.5483, 0.3488, 0.568]}, {"w": "Jupyter", "b": [0.3551, 0.5483, 0.4293, 0.568]}, {"w": "notebooks", "b": [0.4356, 0.5483, 0.5394, 0.568]}, {"w": "to", "b": [0.5457, 0.5483, 0.5653, 0.568]}, {"w": "get", "b": [0.5716, 0.5483, 0.6024, 0.568]}, {"w": "started", "b": [0.6087, 0.5483, 0.676, 0.568]}, {"w": "with", "b": [0.6823, 0.5483, 0.7271, 0.568]}, {"w": "Keras,", "b": [0.7334, 0.5483, 0.7986, 0.568]}, {"w": "although", "b": [0.1294, 0.5688, 0.2177, 0.5885]}, {"w": "that", "b": [0.224, 0.5688, 0.2618, 0.5885]}, {"w": "isn’t", "b": [0.2682, 0.5688, 0.3125, 0.5885]}, {"w": "a", "b": [0.3188, 0.5688, 0.33, 0.5885]}, {"w": "requirement:", "b": [0.3363, 0.5688, 0.4652, 0.5885]}, {"w": "you", "b": [0.4715, 0.5688, 0.5094, 0.5885]}, {"w": "can", "b": [0.5157, 0.5688, 0.5507, 0.5885]}, {"w": "also", "b": [0.557, 0.5688, 0.5977, 0.5885]}, {"w": "run", "b": [0.604, 0.5688, 0.6376, 0.5885]}, {"w": "standalone", "b": [0.6439, 0.5688, 0.7518, 0.5885]}, {"w": "Python", "b": [0.758, 0.5688, 0.8295, 0.5885]}, {"w": "scripts", "b": [0.1294, 0.5893, 0.1953, 0.609]}, {"w": "or", "b": [0.2016, 0.5893, 0.2226, 0.609]}, {"w": "run", "b": [0.2289, 0.5893, 0.2625, 0.609]}, {"w": "code", "b": [0.2688, 0.5893, 0.3165, 0.609]}, {"w": "from", "b": [0.3228, 0.5893, 0.3718, 0.609]}, {"w": "within", "b": [0.3781, 0.5893, 0.4426, 0.609]}, {"w": "an", "b": [0.4489, 0.5893, 0.4727, 0.609]}, {"w": "IDE", "b": [0.479, 0.5893, 0.521, 0.609]}, {"w": "such", "b": [0.5273, 0.5893, 0.5736, 0.609]}, {"w": "as", "b": [0.5799, 0.5893, 0.6009, 0.609]}, {"w": "PyCharm.", "b": [0.6072, 0.5893, 0.7088, 0.609]}, {"w": "All", "b": [0.7151, 0.5893, 0.7474, 0.609]}, {"w": "the", "b": [0.7537, 0.5893, 0.7845, 0.609]}, {"w": "code", "b": [0.7908, 0.5893, 0.8384, 0.609]}, {"w": "examples", "b": [0.1294, 0.6098, 0.2247, 0.6295]}, {"w": "in", "b": [0.231, 0.6098, 0.2506, 0.6295]}, {"w": "this", "b": [0.2569, 0.6098, 0.2934, 0.6295]}, {"w": "book", "b": [0.2997, 0.6098, 0.3501, 0.6295]}, {"w": "are", "b": [0.3564, 0.6098, 0.3872, 0.6295]}, {"w": "available", "b": [0.3936, 0.6098, 0.4846, 0.6295]}, {"w": "as", "b": [0.4909, 0.6098, 0.5119, 0.6295]}, {"w": "open", "b": [0.5182, 0.6098, 0.5673, 0.6295]}, {"w": "source", "b": [0.5736, 0.6098, 0.6394, 0.6295]}, {"w": "notebooks;", "b": [0.6457, 0.6098, 0.7564, 0.6295]}, {"w": "you", "b": [0.7627, 0.6098, 0.8005, 0.6295]}, {"w": "can", "b": [0.8068, 0.6098, 0.8418, 0.6295]}, {"w": "download", "b": [0.1294, 0.6303, 0.2289, 0.65]}, {"w": "them", "b": [0.2352, 0.6303, 0.2857, 0.65]}, {"w": "from", "b": [0.292, 0.6303, 0.341, 0.65]}, {"w": "the", "b": [0.3473, 0.6303, 0.3781, 0.65]}, {"w": "book’s", "b": [0.3844, 0.6303, 0.4517, 0.65]}, {"w": "website", "b": [0.458, 0.6303, 0.5351, 0.65]}, {"w": "at", "b": [0.5414, 0.6303, 0.5596, 0.65]}, {"w": "www.manning.com/books/deep-learning-with-python.", "b": [0.1294, 0.6508, 0.6777, 0.6705]}]}, {"id": "b_5", "type": "paragraph", "text": "3.3.2. Getting Keras running: two options", "words": [{"w": "3.3.2.", "b": [0.1294, 0.698, 0.1862, 0.7178]}, {"w": "Getting", "b": [0.1925, 0.698, 0.2738, 0.7178]}, {"w": "Keras", "b": [0.2801, 0.698, 0.3445, 0.7178]}, {"w": "running:", "b": [0.3508, 0.698, 0.4461, 0.7178]}, {"w": "two", "b": [0.4525, 0.698, 0.4917, 0.7178]}, {"w": "options", "b": [0.498, 0.698, 0.5765, 0.7178]}]}, {"id": "b_6", "type": "paragraph", "text": "To get started in practice, we recommend one of the following two options:", "words": [{"w": "To", "b": [0.1294, 0.7408, 0.1557, 0.7605]}, {"w": "get", "b": [0.162, 0.7408, 0.1928, 0.7605]}, {"w": "started", "b": [0.1991, 0.7408, 0.2664, 0.7605]}, {"w": "in", "b": [0.2727, 0.7408, 0.2923, 0.7605]}, {"w": "practice,", "b": [0.2986, 0.7408, 0.3847, 0.7605]}, {"w": "we", "b": [0.3911, 0.7408, 0.4205, 0.7605]}, {"w": "recommend", "b": [0.4268, 0.7408, 0.5459, 0.7605]}, {"w": "one", "b": [0.5522, 0.7408, 0.5886, 0.7605]}, {"w": "of", "b": [0.5949, 0.7408, 0.6159, 0.7605]}, {"w": "the", "b": [0.6222, 0.7408, 0.653, 0.7605]}, {"w": "following", "b": [0.6594, 0.7408, 0.7575, 0.7605]}, {"w": "two", "b": [0.7638, 0.7408, 0.8016, 0.7605]}, {"w": "options:", "b": [0.1294, 0.7613, 0.2107, 0.781]}]}, {"id": "b_7", "type": "paragraph", "text": "Use the official EC2 Deep Learning AMI (https://aws.amazon.com/amazon-ai/amis), and run Keras experiments as Jupyter notebooks on EC2. Do this if you don’t already have a GPU on your local machine. Appendix B provides a step-by-step guide.", "words": [{"w": "Use", "b": [0.1799, 0.7996, 0.2191, 0.8194]}, {"w": "the", "b": [0.2254, 0.7996, 0.2562, 0.8194]}, {"w": "official", "b": [0.2625, 0.7996, 0.3349, 0.8194]}, {"w": "EC2", "b": [0.3412, 0.7996, 0.3861, 0.8194]}, {"w": "Deep", "b": [0.3924, 0.7996, 0.4456, 0.8194]}, {"w": "Learning", "b": [0.4519, 0.7996, 0.543, 0.8194]}, {"w": "AMI", "b": [0.5493, 0.7996, 0.5983, 0.8194]}, {"w": "(https://aws.amazon.com/amazon-ai/amis),", "b": [0.1799, 0.8201, 0.6135, 0.8399]}, {"w": "and", "b": [0.6198, 0.8201, 0.6562, 0.8399]}, {"w": "run", "b": [0.6625, 0.8201, 0.6961, 0.8399]}, {"w": "Keras", "b": [0.7024, 0.8201, 0.7613, 0.8399]}, {"w": "experiments", "b": [0.1799, 0.8406, 0.3032, 0.8604]}, {"w": "as", "b": [0.3095, 0.8406, 0.3305, 0.8604]}, {"w": "Jupyter", "b": [0.3368, 0.8406, 0.4111, 0.8604]}, {"w": "notebooks", "b": [0.4174, 0.8406, 0.5211, 0.8604]}, {"w": "on", "b": [0.5274, 0.8406, 0.5526, 0.8604]}, {"w": "EC2.", "b": [0.5589, 0.8406, 0.6101, 0.8604]}, {"w": "Do", "b": [0.6164, 0.8406, 0.6472, 0.8604]}, {"w": "this", "b": [0.6535, 0.8406, 0.69, 0.8604]}, {"w": "if", "b": [0.6963, 0.8406, 0.7117, 0.8604]}, {"w": "you", "b": [0.718, 0.8406, 0.7558, 0.8604]}, {"w": "don’t", "b": [0.7621, 0.8406, 0.8149, 0.8604]}, {"w": "already", "b": [0.1799, 0.8611, 0.2541, 0.8809]}, {"w": "have", "b": [0.2604, 0.8611, 0.308, 0.8809]}, {"w": "a", "b": [0.3143, 0.8611, 0.3255, 0.8809]}, {"w": "GPU", "b": [0.3318, 0.8611, 0.3823, 0.8809]}, {"w": "on", "b": [0.3886, 0.8611, 0.4138, 0.8809]}, {"w": "your", "b": [0.4201, 0.8611, 0.4664, 0.8809]}, {"w": "local", "b": [0.4727, 0.8611, 0.5217, 0.8809]}, {"w": "machine.", "b": [0.528, 0.8611, 0.6198, 0.8809]}, {"w": "Appendix", "b": [0.626, 0.8611, 0.7255, 0.8809]}, {"w": "B", "b": [0.7318, 0.8611, 0.7487, 0.8809]}, {"w": "provides", "b": [0.755, 0.8611, 0.8418, 0.8809]}, {"w": "a", "b": [0.8481, 0.8611, 0.8593, 0.8809]}, {"w": "step-by-step", "b": [0.1799, 0.8816, 0.3032, 0.9014]}, {"w": "guide.", "b": [0.3095, 0.8816, 0.3718, 0.9014]}]}]}, {"page": 105, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Install everything from scratch on a local Unix workstation. You can then run either local Jupyter notebooks or a regular Python codebase. Do this if you already have a high-end NVIDIA GPU. Appendix A provides an Ubuntu-specific, step-by-step guide.", "words": [{"w": "Install", "b": [0.1799, 0.0857, 0.2429, 0.1054]}, {"w": "everything", "b": [0.2492, 0.0857, 0.3571, 0.1054]}, {"w": "from", "b": [0.3634, 0.0857, 0.4125, 0.1054]}, {"w": "scratch", "b": [0.4188, 0.0857, 0.4902, 0.1054]}, {"w": "on", "b": [0.4965, 0.0857, 0.5217, 0.1054]}, {"w": "a", "b": [0.5281, 0.0857, 0.5393, 0.1054]}, {"w": "local", "b": [0.5456, 0.0857, 0.5946, 0.1054]}, {"w": "Unix", "b": [0.6009, 0.0857, 0.6514, 0.1054]}, {"w": "workstation.", "b": [0.6577, 0.0857, 0.7831, 0.1054]}, {"w": "You", "b": [0.7894, 0.0857, 0.8302, 0.1054]}, {"w": "can", "b": [0.1799, 0.1062, 0.2149, 0.1259]}, {"w": "then", "b": [0.2212, 0.1062, 0.2646, 0.1259]}, {"w": "run", "b": [0.2709, 0.1062, 0.3046, 0.1259]}, {"w": "either", "b": [0.3109, 0.1062, 0.3683, 0.1259]}, {"w": "local", "b": [0.3746, 0.1062, 0.4236, 0.1259]}, {"w": "Jupyter", "b": [0.43, 0.1062, 0.5042, 0.1259]}, {"w": "notebooks", "b": [0.5105, 0.1062, 0.6142, 0.1259]}, {"w": "or", "b": [0.6205, 0.1062, 0.6415, 0.1259]}, {"w": "a", "b": [0.6479, 0.1062, 0.6591, 0.1259]}, {"w": "regular", "b": [0.6654, 0.1062, 0.7368, 0.1259]}, {"w": "Python", "b": [0.743, 0.1062, 0.8145, 0.1259]}, {"w": "codebase.", "b": [0.1799, 0.1267, 0.2786, 0.1464]}, {"w": "Do", "b": [0.2849, 0.1267, 0.3158, 0.1464]}, {"w": "this", "b": [0.3221, 0.1267, 0.3585, 0.1464]}, {"w": "if", "b": [0.3648, 0.1267, 0.3802, 0.1464]}, {"w": "you", "b": [0.3865, 0.1267, 0.4244, 0.1464]}, {"w": "already", "b": [0.4307, 0.1267, 0.5049, 0.1464]}, {"w": "have", "b": [0.5112, 0.1267, 0.5589, 0.1464]}, {"w": "a", "b": [0.5652, 0.1267, 0.5764, 0.1464]}, {"w": "high-end", "b": [0.5827, 0.1267, 0.6723, 0.1464]}, {"w": "NVIDIA", "b": [0.6787, 0.1267, 0.7683, 0.1464]}, {"w": "GPU.", "b": [0.7746, 0.1267, 0.8314, 0.1464]}, {"w": "Appendix", "b": [0.1799, 0.1472, 0.2794, 0.1669]}, {"w": "A", "b": [0.2857, 0.1472, 0.3039, 0.1669]}, {"w": "provides", "b": [0.3102, 0.1472, 0.397, 0.1669]}, {"w": "an", "b": [0.4034, 0.1472, 0.4272, 0.1669]}, {"w": "Ubuntu-specific,", "b": [0.4335, 0.1472, 0.6023, 0.1669]}, {"w": "step-by-step", "b": [0.6086, 0.1472, 0.7319, 0.1669]}, {"w": "guide.", "b": [0.7382, 0.1472, 0.8006, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s take a closer look at some of the compromises involved in picking one option over the other.", "words": [{"w": "Let’s", "b": [0.1294, 0.19, 0.1798, 0.2097]}, {"w": "take", "b": [0.1862, 0.19, 0.2282, 0.2097]}, {"w": "a", "b": [0.2345, 0.19, 0.2457, 0.2097]}, {"w": "closer", "b": [0.252, 0.19, 0.3122, 0.2097]}, {"w": "look", "b": [0.3185, 0.19, 0.3634, 0.2097]}, {"w": "at", "b": [0.3697, 0.19, 0.3879, 0.2097]}, {"w": "some", "b": [0.3942, 0.19, 0.4475, 0.2097]}, {"w": "of", "b": [0.4538, 0.19, 0.4748, 0.2097]}, {"w": "the", "b": [0.4811, 0.19, 0.5119, 0.2097]}, {"w": "compromises", "b": [0.5182, 0.19, 0.6528, 0.2097]}, {"w": "involved", "b": [0.6591, 0.19, 0.7474, 0.2097]}, {"w": "in", "b": [0.7537, 0.19, 0.7733, 0.2097]}, {"w": "picking", "b": [0.7796, 0.19, 0.8553, 0.2097]}, {"w": "one", "b": [0.1294, 0.2105, 0.1658, 0.2302]}, {"w": "option", "b": [0.1721, 0.2105, 0.2366, 0.2302]}, {"w": "over", "b": [0.2429, 0.2105, 0.2878, 0.2302]}, {"w": "the", "b": [0.2941, 0.2105, 0.3249, 0.2302]}, {"w": "other.", "b": [0.3312, 0.2105, 0.3879, 0.2302]}]}, {"id": "b_2", "type": "equation", "text": "3.3.3. Running deep-learning jobs in the cloud: pros and cons", "words": [{"w": "3.3.3.", "b": [0.1294, 0.2577, 0.1862, 0.2774]}, {"w": "Running", "b": [0.1925, 0.2577, 0.2864, 0.2774]}, {"w": "deep-learning", "b": [0.2927, 0.2577, 0.4413, 0.2774]}, {"w": "jobs", "b": [0.4476, 0.2577, 0.4924, 0.2774]}, {"w": "in", "b": [0.4987, 0.2577, 0.5198, 0.2774]}, {"w": "the", "b": [0.5261, 0.2577, 0.5597, 0.2774]}, {"w": "cloud:", "b": [0.566, 0.2577, 0.6333, 0.2774]}, {"w": "pros", "b": [0.6396, 0.2577, 0.6868, 0.2774]}, {"w": "and", "b": [0.6931, 0.2577, 0.7338, 0.2774]}, {"w": "cons", "b": [0.7401, 0.2577, 0.7877, 0.2774]}]}, {"id": "b_3", "type": "paragraph", "text": "If you don’t already have a GPU that you can use for deep learning (a recent, high-end NVIDIA GPU), then running deep-learning experiments in the cloud is a simple, low-cost way for you to get started without having to buy any additional hardware. If you’re using Jupyter notebooks, the experience of running in the cloud is no different from running locally. As of mid-2017, the cloud offering that makes it easiest to get started with deep learning is definitely AWS EC2. Appendix B provides a step-by-step guide to running Jupyter notebooks on a EC2 GPU instance.", "words": [{"w": "If", "b": [0.1294, 0.3005, 0.1462, 0.3202]}, {"w": "you", "b": [0.1525, 0.3005, 0.1904, 0.3202]}, {"w": "don’t", "b": [0.1967, 0.3005, 0.2495, 0.3202]}, {"w": "already", "b": [0.2558, 0.3005, 0.33, 0.3202]}, {"w": "have", "b": [0.3363, 0.3005, 0.3839, 0.3202]}, {"w": "a", "b": [0.3902, 0.3005, 0.4014, 0.3202]}, {"w": "GPU", "b": [0.4078, 0.3005, 0.4582, 0.3202]}, {"w": "that", "b": [0.4645, 0.3005, 0.5023, 0.3202]}, {"w": "you", "b": [0.5087, 0.3005, 0.5465, 0.3202]}, {"w": "can", "b": [0.5528, 0.3005, 0.5878, 0.3202]}, {"w": "use", "b": [0.5941, 0.3005, 0.6277, 0.3202]}, {"w": "for", "b": [0.6341, 0.3005, 0.6635, 0.3202]}, {"w": "deep", "b": [0.6698, 0.3005, 0.7174, 0.3202]}, {"w": "learning", "b": [0.7237, 0.3005, 0.8064, 0.3202]}, {"w": "(a", "b": [0.8127, 0.3005, 0.8323, 0.3202]}, {"w": "recent,", "b": [0.1294, 0.321, 0.1973, 0.3407]}, {"w": "high-end", "b": [0.2037, 0.321, 0.2933, 0.3407]}, {"w": "NVIDIA", "b": [0.2996, 0.321, 0.3893, 0.3407]}, {"w": "GPU),", "b": [0.3956, 0.321, 0.4608, 0.3407]}, {"w": "then", "b": [0.4671, 0.321, 0.5105, 0.3407]}, {"w": "running", "b": [0.5168, 0.321, 0.5953, 0.3407]}, {"w": "deep-learning", "b": [0.6016, 0.321, 0.7403, 0.3407]}, {"w": "experiments", "b": [0.7466, 0.321, 0.8699, 0.3407]}, {"w": "in", "b": [0.1294, 0.3415, 0.149, 0.3612]}, {"w": "the", "b": [0.1553, 0.3415, 0.1862, 0.3612]}, {"w": "cloud", "b": [0.1925, 0.3415, 0.2485, 0.3612]}, {"w": "is", "b": [0.2548, 0.3415, 0.2717, 0.3612]}, {"w": "a", "b": [0.278, 0.3415, 0.2892, 0.3612]}, {"w": "simple,", "b": [0.2955, 0.3415, 0.3691, 0.3612]}, {"w": "low-cost", "b": [0.3754, 0.3415, 0.4622, 0.3612]}, {"w": "way", "b": [0.4685, 0.3415, 0.5106, 0.3612]}, {"w": "for", "b": [0.5169, 0.3415, 0.5463, 0.3612]}, {"w": "you", "b": [0.5526, 0.3415, 0.5904, 0.3612]}, {"w": "to", "b": [0.5967, 0.3415, 0.6164, 0.3612]}, {"w": "get", "b": [0.6227, 0.3415, 0.6535, 0.3612]}, {"w": "started", "b": [0.6598, 0.3415, 0.7271, 0.3612]}, {"w": "without", "b": [0.7334, 0.3415, 0.8105, 0.3612]}, {"w": "having", "b": [0.1294, 0.362, 0.1981, 0.3817]}, {"w": "to", "b": [0.2044, 0.362, 0.224, 0.3817]}, {"w": "buy", "b": [0.2303, 0.362, 0.2682, 0.3817]}, {"w": "any", "b": [0.2745, 0.362, 0.3109, 0.3817]}, {"w": "additional", "b": [0.3172, 0.362, 0.4181, 0.3817]}, {"w": "hardware.", "b": [0.4244, 0.362, 0.5245, 0.3817]}, {"w": "If", "b": [0.5309, 0.362, 0.5477, 0.3817]}, {"w": "you’re", "b": [0.5539, 0.362, 0.6198, 0.3817]}, {"w": "using", "b": [0.6261, 0.362, 0.6807, 0.3817]}, {"w": "Jupyter", "b": [0.687, 0.362, 0.7613, 0.3817]}, {"w": "notebooks,", "b": [0.1294, 0.3825, 0.2394, 0.4022]}, {"w": "the", "b": [0.2457, 0.3825, 0.2766, 0.4022]}, {"w": "experience", "b": [0.2829, 0.3825, 0.3921, 0.4022]}, {"w": "of", "b": [0.3984, 0.3825, 0.4194, 0.4022]}, {"w": "running", "b": [0.4257, 0.3825, 0.5042, 0.4022]}, {"w": "in", "b": [0.5105, 0.3825, 0.5301, 0.4022]}, {"w": "the", "b": [0.5365, 0.3825, 0.5673, 0.4022]}, {"w": "cloud", "b": [0.5736, 0.3825, 0.6296, 0.4022]}, {"w": "is", "b": [0.6359, 0.3825, 0.6528, 0.4022]}, {"w": "no", "b": [0.6591, 0.3825, 0.6843, 0.4022]}, {"w": "different", "b": [0.6906, 0.3825, 0.7769, 0.4022]}, {"w": "from", "b": [0.7832, 0.3825, 0.8323, 0.4022]}, {"w": "running", "b": [0.1294, 0.403, 0.2079, 0.4227]}, {"w": "locally.", "b": [0.2142, 0.403, 0.2875, 0.4227]}, {"w": "As", "b": [0.2938, 0.403, 0.3218, 0.4227]}, {"w": "of", "b": [0.3281, 0.403, 0.3492, 0.4227]}, {"w": "mid-2017,", "b": [0.3555, 0.403, 0.4599, 0.4227]}, {"w": "the", "b": [0.4662, 0.403, 0.497, 0.4227]}, {"w": "cloud", "b": [0.5033, 0.403, 0.5594, 0.4227]}, {"w": "offering", "b": [0.5657, 0.403, 0.6464, 0.4227]}, {"w": "that", "b": [0.6528, 0.403, 0.6906, 0.4227]}, {"w": "makes", "b": [0.6969, 0.403, 0.7614, 0.4227]}, {"w": "it", "b": [0.7677, 0.403, 0.7817, 0.4227]}, {"w": "easiest", "b": [0.788, 0.403, 0.8552, 0.4227]}, {"w": "to", "b": [0.1294, 0.4235, 0.149, 0.4432]}, {"w": "get", "b": [0.1553, 0.4235, 0.1862, 0.4432]}, {"w": "started", "b": [0.1925, 0.4235, 0.2597, 0.4432]}, {"w": "with", "b": [0.266, 0.4235, 0.3109, 0.4432]}, {"w": "deep", "b": [0.3172, 0.4235, 0.3648, 0.4432]}, {"w": "learning", "b": [0.3711, 0.4235, 0.4538, 0.4432]}, {"w": "is", "b": [0.4601, 0.4235, 0.4769, 0.4432]}, {"w": "definitely", "b": [0.4832, 0.4235, 0.5799, 0.4432]}, {"w": "AWS", "b": [0.5862, 0.4235, 0.6402, 0.4432]}, {"w": "EC2.", "b": [0.6465, 0.4235, 0.6976, 0.4432]}, {"w": "Appendix", "b": [0.7039, 0.4235, 0.8034, 0.4432]}, {"w": "B", "b": [0.8097, 0.4235, 0.8266, 0.4432]}, {"w": "provides", "b": [0.1294, 0.444, 0.2163, 0.4637]}, {"w": "a", "b": [0.2226, 0.444, 0.2338, 0.4637]}, {"w": "step-by-step", "b": [0.2401, 0.444, 0.3634, 0.4637]}, {"w": "guide", "b": [0.3697, 0.444, 0.4258, 0.4637]}, {"w": "to", "b": [0.4321, 0.444, 0.4517, 0.4637]}, {"w": "running", "b": [0.458, 0.444, 0.5365, 0.4637]}, {"w": "Jupyter", "b": [0.5428, 0.444, 0.6171, 0.4637]}, {"w": "notebooks", "b": [0.6234, 0.444, 0.7271, 0.4637]}, {"w": "on", "b": [0.7334, 0.444, 0.7586, 0.4637]}, {"w": "a", "b": [0.7649, 0.444, 0.7761, 0.4637]}, {"w": "EC2", "b": [0.7824, 0.444, 0.8273, 0.4637]}, {"w": "GPU", "b": [0.1294, 0.4645, 0.1799, 0.4842]}, {"w": "instance.", "b": [0.1862, 0.4645, 0.2751, 0.4842]}]}, {"id": "b_4", "type": "paragraph", "text": "But if you’re a heavy user of deep learning, this setup isn’t sustainable in the long term—or even for more than a few weeks. EC2 instances are expensive: the instance type recommended in appendix B (the p2.xlarge instance, which won’t provide you with much power) costs $0.90 per hour as of mid-2017. Meanwhile, a solid consumer-class GPU will cost you somewhere between $1,000 and $1,500—a price that has been fairly stable over time, even as the specs of these GPUs keep improving. If you’re serious about deep learning, you should set up a local workstation with one or more GPUs.", "words": [{"w": "But", "b": [0.1294, 0.5073, 0.1659, 0.527]}, {"w": "if", "b": [0.1722, 0.5073, 0.1876, 0.527]}, {"w": "you’re", "b": [0.1939, 0.5073, 0.2597, 0.527]}, {"w": "a", "b": [0.266, 0.5073, 0.2772, 0.527]}, {"w": "heavy", "b": [0.2835, 0.5073, 0.3438, 0.527]}, {"w": "user", "b": [0.3501, 0.5073, 0.3921, 0.527]}, {"w": "of", "b": [0.3984, 0.5073, 0.4194, 0.527]}, {"w": "deep", "b": [0.4257, 0.5073, 0.4734, 0.527]}, {"w": "learning,", "b": [0.4797, 0.5073, 0.5686, 0.527]}, {"w": "this", "b": [0.5749, 0.5073, 0.6114, 0.527]}, {"w": "setup", "b": [0.6177, 0.5073, 0.671, 0.527]}, {"w": "isn’t", "b": [0.6773, 0.5073, 0.7216, 0.527]}, {"w": "sustainable", "b": [0.7279, 0.5073, 0.84, 0.527]}, {"w": "in", "b": [0.8463, 0.5073, 0.8659, 0.527]}, {"w": "the", "b": [0.1294, 0.5278, 0.1602, 0.5475]}, {"w": "long", "b": [0.1665, 0.5278, 0.2114, 0.5475]}, {"w": "term—or", "b": [0.2177, 0.5278, 0.3102, 0.5475]}, {"w": "even", "b": [0.3165, 0.5278, 0.3641, 0.5475]}, {"w": "for", "b": [0.3704, 0.5278, 0.3998, 0.5475]}, {"w": "more", "b": [0.4061, 0.5278, 0.458, 0.5475]}, {"w": "than", "b": [0.4643, 0.5278, 0.5077, 0.5475]}, {"w": "a", "b": [0.514, 0.5278, 0.5252, 0.5475]}, {"w": "few", "b": [0.5315, 0.5278, 0.5693, 0.5475]}, {"w": "weeks.", "b": [0.5757, 0.5278, 0.645, 0.5475]}, {"w": "EC2", "b": [0.6513, 0.5278, 0.6961, 0.5475]}, {"w": "instances", "b": [0.7024, 0.5278, 0.7949, 0.5475]}, {"w": "are", "b": [0.8012, 0.5278, 0.832, 0.5475]}, {"w": "expensive:", "b": [0.1294, 0.5483, 0.2373, 0.568]}, {"w": "the", "b": [0.2436, 0.5483, 0.2744, 0.568]}, {"w": "instance", "b": [0.2807, 0.5483, 0.3634, 0.568]}, {"w": "type", "b": [0.3697, 0.5483, 0.4132, 0.568]}, {"w": "recommended", "b": [0.4195, 0.5483, 0.5624, 0.568]}, {"w": "in", "b": [0.5687, 0.5483, 0.5883, 0.568]}, {"w": "appendix", "b": [0.5945, 0.5483, 0.687, 0.568]}, {"w": "B", "b": [0.6933, 0.5483, 0.7101, 0.568]}, {"w": "(the", "b": [0.7164, 0.5483, 0.7556, 0.568]}, {"w": "p2.xlarge", "b": [0.1294, 0.5698, 0.2656, 0.59]}, {"w": "instance,", "b": [0.272, 0.5688, 0.3609, 0.5885]}, {"w": "which", "b": [0.3672, 0.5688, 0.4289, 0.5885]}, {"w": "won’t", "b": [0.4352, 0.5688, 0.4936, 0.5885]}, {"w": "provide", "b": [0.4999, 0.5688, 0.5769, 0.5885]}, {"w": "you", "b": [0.5833, 0.5688, 0.6211, 0.5885]}, {"w": "with", "b": [0.6274, 0.5688, 0.6722, 0.5885]}, {"w": "much", "b": [0.6786, 0.5688, 0.7346, 0.5885]}, {"w": "power)", "b": [0.7409, 0.5688, 0.8124, 0.5885]}, {"w": "costs", "b": [0.8187, 0.5688, 0.8691, 0.5885]}, {"w": "$0.90", "b": [0.1294, 0.5902, 0.1862, 0.6099]}, {"w": "per", "b": [0.1925, 0.5902, 0.2247, 0.6099]}, {"w": "hour", "b": [0.231, 0.5902, 0.2772, 0.6099]}, {"w": "as", "b": [0.2835, 0.5902, 0.3046, 0.6099]}, {"w": "of", "b": [0.3109, 0.5902, 0.3319, 0.6099]}, {"w": "mid-2017.", "b": [0.3382, 0.5902, 0.4426, 0.6099]}, {"w": "Meanwhile,", "b": [0.4489, 0.5902, 0.5687, 0.6099]}, {"w": "a", "b": [0.575, 0.5902, 0.5862, 0.6099]}, {"w": "solid", "b": [0.5925, 0.5902, 0.6416, 0.6099]}, {"w": "consumer-class", "b": [0.6479, 0.5902, 0.8028, 0.6099]}, {"w": "GPU", "b": [0.8091, 0.5902, 0.8596, 0.6099]}, {"w": "will", "b": [0.1294, 0.6107, 0.1687, 0.6304]}, {"w": "cost", "b": [0.175, 0.6107, 0.2156, 0.6304]}, {"w": "you", "b": [0.2219, 0.6107, 0.2598, 0.6304]}, {"w": "somewhere", "b": [0.2661, 0.6107, 0.3809, 0.6304]}, {"w": "between", "b": [0.3872, 0.6107, 0.4713, 0.6304]}, {"w": "$1,000", "b": [0.4776, 0.6107, 0.547, 0.6304]}, {"w": "and", "b": [0.5533, 0.6107, 0.5897, 0.6304]}, {"w": "$1,500—a", "b": [0.596, 0.6107, 0.7018, 0.6304]}, {"w": "price", "b": [0.7081, 0.6107, 0.7585, 0.6304]}, {"w": "that", "b": [0.7648, 0.6107, 0.8027, 0.6304]}, {"w": "has", "b": [0.809, 0.6107, 0.8426, 0.6304]}, {"w": "been", "b": [0.1294, 0.6312, 0.177, 0.6509]}, {"w": "fairly", "b": [0.1833, 0.6312, 0.238, 0.6509]}, {"w": "stable", "b": [0.2443, 0.6312, 0.3031, 0.6509]}, {"w": "over", "b": [0.3094, 0.6312, 0.3543, 0.6509]}, {"w": "time,", "b": [0.3606, 0.6312, 0.4117, 0.6509]}, {"w": "even", "b": [0.418, 0.6312, 0.4657, 0.6509]}, {"w": "as", "b": [0.472, 0.6312, 0.493, 0.6509]}, {"w": "the", "b": [0.4993, 0.6312, 0.5301, 0.6509]}, {"w": "specs", "b": [0.5364, 0.6312, 0.5911, 0.6509]}, {"w": "of", "b": [0.5974, 0.6312, 0.6184, 0.6509]}, {"w": "these", "b": [0.6246, 0.6312, 0.6765, 0.6509]}, {"w": "GPUs", "b": [0.6828, 0.6312, 0.743, 0.6509]}, {"w": "keep", "b": [0.7493, 0.6312, 0.797, 0.6509]}, {"w": "improving.", "b": [0.1294, 0.6517, 0.2408, 0.6714]}, {"w": "If", "b": [0.2471, 0.6517, 0.2639, 0.6714]}, {"w": "you’re", "b": [0.2702, 0.6517, 0.3361, 0.6714]}, {"w": "serious", "b": [0.3424, 0.6517, 0.4139, 0.6714]}, {"w": "about", "b": [0.4202, 0.6517, 0.4762, 0.6714]}, {"w": "deep", "b": [0.4825, 0.6517, 0.5301, 0.6714]}, {"w": "learning,", "b": [0.5365, 0.6517, 0.6254, 0.6714]}, {"w": "you", "b": [0.6317, 0.6517, 0.6696, 0.6714]}, {"w": "should", "b": [0.6759, 0.6517, 0.7432, 0.6714]}, {"w": "set", "b": [0.7495, 0.6517, 0.7775, 0.6714]}, {"w": "up", "b": [0.7838, 0.6517, 0.809, 0.6714]}, {"w": "a", "b": [0.8153, 0.6517, 0.8265, 0.6714]}, {"w": "local", "b": [0.1294, 0.6722, 0.1785, 0.6919]}, {"w": "workstation", "b": [0.1848, 0.6722, 0.3039, 0.6919]}, {"w": "with", "b": [0.3102, 0.6722, 0.355, 0.6919]}, {"w": "one", "b": [0.3613, 0.6722, 0.3978, 0.6919]}, {"w": "or", "b": [0.4041, 0.6722, 0.4251, 0.6919]}, {"w": "more", "b": [0.4314, 0.6722, 0.4832, 0.6919]}, {"w": "GPUs.", "b": [0.4895, 0.6722, 0.5561, 0.6919]}]}, {"id": "b_5", "type": "paragraph", "text": "In short, EC2 is a great way to get started. You could follow the code examples in this book entirely on an EC2 GPU instance. But if you’re going to be a power user of deep learning, get your own GPUs.", "words": [{"w": "In", "b": [0.1294, 0.7149, 0.1504, 0.7347]}, {"w": "short,", "b": [0.1567, 0.7149, 0.2135, 0.7347]}, {"w": "EC2", "b": [0.2198, 0.7149, 0.2646, 0.7347]}, {"w": "is", "b": [0.271, 0.7149, 0.2878, 0.7347]}, {"w": "a", "b": [0.2941, 0.7149, 0.3053, 0.7347]}, {"w": "great", "b": [0.3116, 0.7149, 0.362, 0.7347]}, {"w": "way", "b": [0.3683, 0.7149, 0.4104, 0.7347]}, {"w": "to", "b": [0.4167, 0.7149, 0.4363, 0.7347]}, {"w": "get", "b": [0.4426, 0.7149, 0.4734, 0.7347]}, {"w": "started.", "b": [0.4797, 0.7149, 0.5533, 0.7347]}, {"w": "You", "b": [0.5596, 0.7149, 0.6005, 0.7347]}, {"w": "could", "b": [0.6068, 0.7149, 0.6628, 0.7347]}, {"w": "follow", "b": [0.6691, 0.7149, 0.735, 0.7347]}, {"w": "the", "b": [0.7413, 0.7149, 0.7721, 0.7347]}, {"w": "code", "b": [0.7784, 0.7149, 0.8261, 0.7347]}, {"w": "examples", "b": [0.1294, 0.7354, 0.2247, 0.7552]}, {"w": "in", "b": [0.231, 0.7354, 0.2506, 0.7552]}, {"w": "this", "b": [0.2569, 0.7354, 0.2934, 0.7552]}, {"w": "book", "b": [0.2997, 0.7354, 0.3501, 0.7552]}, {"w": "entirely", "b": [0.3564, 0.7354, 0.4335, 0.7552]}, {"w": "on", "b": [0.4398, 0.7354, 0.465, 0.7552]}, {"w": "an", "b": [0.4713, 0.7354, 0.4952, 0.7552]}, {"w": "EC2", "b": [0.5015, 0.7354, 0.5463, 0.7552]}, {"w": "GPU", "b": [0.5526, 0.7354, 0.6031, 0.7552]}, {"w": "instance.", "b": [0.6094, 0.7354, 0.6984, 0.7552]}, {"w": "But", "b": [0.7046, 0.7354, 0.7411, 0.7552]}, {"w": "if", "b": [0.7474, 0.7354, 0.7628, 0.7552]}, {"w": "you’re", "b": [0.7691, 0.7354, 0.8349, 0.7552]}, {"w": "going", "b": [0.1294, 0.7559, 0.1869, 0.7757]}, {"w": "to", "b": [0.1932, 0.7559, 0.2128, 0.7757]}, {"w": "be", "b": [0.2191, 0.7559, 0.2429, 0.7757]}, {"w": "a", "b": [0.2492, 0.7559, 0.2604, 0.7757]}, {"w": "power", "b": [0.2667, 0.7559, 0.3298, 0.7757]}, {"w": "user", "b": [0.3361, 0.7559, 0.3781, 0.7757]}, {"w": "of", "b": [0.3844, 0.7559, 0.4054, 0.7757]}, {"w": "deep", "b": [0.4117, 0.7559, 0.4594, 0.7757]}, {"w": "learning,", "b": [0.4657, 0.7559, 0.5546, 0.7757]}, {"w": "get", "b": [0.5609, 0.7559, 0.5918, 0.7757]}, {"w": "your", "b": [0.5981, 0.7559, 0.6443, 0.7757]}, {"w": "own", "b": [0.6506, 0.7559, 0.6941, 0.7757]}, {"w": "GPUs.", "b": [0.7004, 0.7559, 0.7669, 0.7757]}]}, {"id": "b_6", "type": "paragraph", "text": "3.3.4. What is the best GPU for deep learning?", "words": [{"w": "3.3.4.", "b": [0.1294, 0.8032, 0.1862, 0.8229]}, {"w": "What", "b": [0.1925, 0.8032, 0.2527, 0.8229]}, {"w": "is", "b": [0.259, 0.8032, 0.2759, 0.8229]}, {"w": "the", "b": [0.2822, 0.8032, 0.3158, 0.8229]}, {"w": "best", "b": [0.3221, 0.8032, 0.3656, 0.8229]}, {"w": "GPU", "b": [0.3719, 0.8032, 0.4251, 0.8229]}, {"w": "for", "b": [0.4314, 0.8032, 0.4636, 0.8229]}, {"w": "deep", "b": [0.4699, 0.8032, 0.5204, 0.8229]}, {"w": "learning?", "b": [0.5267, 0.8032, 0.629, 0.8229]}]}, {"id": "b_7", "type": "paragraph", "text": "If you’re going to buy a GPU, which one should you choose? The first thing to note is that it must be an NVIDIA GPU. NVIDIA is the only graphics computing company that has invested heavily in deep learning", "words": [{"w": "If", "b": [0.1294, 0.846, 0.1462, 0.8657]}, {"w": "you’re", "b": [0.1525, 0.846, 0.2184, 0.8657]}, {"w": "going", "b": [0.2247, 0.846, 0.2821, 0.8657]}, {"w": "to", "b": [0.2884, 0.846, 0.3081, 0.8657]}, {"w": "buy", "b": [0.3144, 0.846, 0.3522, 0.8657]}, {"w": "a", "b": [0.3585, 0.846, 0.3697, 0.8657]}, {"w": "GPU,", "b": [0.376, 0.846, 0.4328, 0.8657]}, {"w": "which", "b": [0.4391, 0.846, 0.5007, 0.8657]}, {"w": "one", "b": [0.507, 0.846, 0.5435, 0.8657]}, {"w": "should", "b": [0.5498, 0.846, 0.6171, 0.8657]}, {"w": "you", "b": [0.6234, 0.846, 0.6612, 0.8657]}, {"w": "choose?", "b": [0.6675, 0.846, 0.7488, 0.8657]}, {"w": "The", "b": [0.7551, 0.846, 0.7943, 0.8657]}, {"w": "first", "b": [0.8006, 0.846, 0.8412, 0.8657]}, {"w": "thing", "b": [0.1294, 0.8665, 0.1813, 0.8862]}, {"w": "to", "b": [0.1876, 0.8665, 0.2072, 0.8862]}, {"w": "note", "b": [0.2135, 0.8665, 0.257, 0.8862]}, {"w": "is", "b": [0.2633, 0.8665, 0.2801, 0.8862]}, {"w": "that", "b": [0.2864, 0.8665, 0.3242, 0.8862]}, {"w": "it", "b": [0.3305, 0.8665, 0.3446, 0.8862]}, {"w": "must", "b": [0.3509, 0.8665, 0.3999, 0.8862]}, {"w": "be", "b": [0.4062, 0.8665, 0.4301, 0.8862]}, {"w": "an", "b": [0.4364, 0.8665, 0.4602, 0.8862]}, {"w": "NVIDIA", "b": [0.4665, 0.8665, 0.5561, 0.8862]}, {"w": "GPU.", "b": [0.5624, 0.8665, 0.6192, 0.8862]}, {"w": "NVIDIA", "b": [0.6255, 0.8665, 0.7152, 0.8862]}, {"w": "is", "b": [0.72, 0.8665, 0.7369, 0.8862]}, {"w": "the", "b": [0.7432, 0.8665, 0.774, 0.8862]}, {"w": "only", "b": [0.7803, 0.8665, 0.8252, 0.8862]}, {"w": "graphics", "b": [0.1294, 0.887, 0.2149, 0.9067]}, {"w": "computing", "b": [0.2212, 0.887, 0.3291, 0.9067]}, {"w": "company", "b": [0.3354, 0.887, 0.4279, 0.9067]}, {"w": "that", "b": [0.4342, 0.887, 0.472, 0.9067]}, {"w": "has", "b": [0.4783, 0.887, 0.512, 0.9067]}, {"w": "invested", "b": [0.5183, 0.887, 0.6023, 0.9067]}, {"w": "heavily", "b": [0.6087, 0.887, 0.6829, 0.9067]}, {"w": "in", "b": [0.6892, 0.887, 0.7088, 0.9067]}, {"w": "deep", "b": [0.7152, 0.887, 0.7628, 0.9067]}, {"w": "learning", "b": [0.7691, 0.887, 0.8518, 0.9067]}]}]}, {"page": 106, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "so far, and modern deep-learning frameworks can only run on NVIDIA cards.", "words": [{"w": "so", "b": [0.1294, 0.0857, 0.1518, 0.1054]}, {"w": "far,", "b": [0.1581, 0.0857, 0.1914, 0.1054]}, {"w": "and", "b": [0.1977, 0.0857, 0.2342, 0.1054]}, {"w": "modern", "b": [0.2405, 0.0857, 0.3175, 0.1054]}, {"w": "deep-learning", "b": [0.3239, 0.0857, 0.4625, 0.1054]}, {"w": "frameworks", "b": [0.4688, 0.0857, 0.5893, 0.1054]}, {"w": "can", "b": [0.5956, 0.0857, 0.6306, 0.1054]}, {"w": "only", "b": [0.6369, 0.0857, 0.6818, 0.1054]}, {"w": "run", "b": [0.6881, 0.0857, 0.7217, 0.1054]}, {"w": "on", "b": [0.728, 0.0857, 0.7532, 0.1054]}, {"w": "NVIDIA", "b": [0.7595, 0.0857, 0.8492, 0.1054]}, {"w": "cards.", "b": [0.1294, 0.1062, 0.1889, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "As of mid-2017, we recommend the NVIDIA TITAN Xp as the best card on the market for deep learning. For lower budgets, you may want to consider the GTX 1060. If you’re reading these pages in 2018 or later, take the time to look online for fresher recommendations, because new models come out every year.", "words": [{"w": "As", "b": [0.1294, 0.149, 0.1574, 0.1687]}, {"w": "of", "b": [0.1637, 0.149, 0.1848, 0.1687]}, {"w": "mid-2017,", "b": [0.1911, 0.149, 0.2955, 0.1687]}, {"w": "we", "b": [0.3018, 0.149, 0.3312, 0.1687]}, {"w": "recommend", "b": [0.3375, 0.149, 0.4566, 0.1687]}, {"w": "the", "b": [0.4629, 0.149, 0.4937, 0.1687]}, {"w": "NVIDIA", "b": [0.5, 0.149, 0.5897, 0.1687]}, {"w": "TITAN", "b": [0.596, 0.149, 0.6696, 0.1687]}, {"w": "Xp", "b": [0.6759, 0.149, 0.7067, 0.1687]}, {"w": "as", "b": [0.713, 0.149, 0.7341, 0.1687]}, {"w": "the", "b": [0.7404, 0.149, 0.7712, 0.1687]}, {"w": "best", "b": [0.7775, 0.149, 0.8181, 0.1687]}, {"w": "card", "b": [0.8244, 0.149, 0.8679, 0.1687]}, {"w": "on", "b": [0.1294, 0.1695, 0.1546, 0.1892]}, {"w": "the", "b": [0.1609, 0.1695, 0.1918, 0.1892]}, {"w": "market", "b": [0.1981, 0.1695, 0.2681, 0.1892]}, {"w": "for", "b": [0.2744, 0.1695, 0.3038, 0.1892]}, {"w": "deep", "b": [0.3102, 0.1695, 0.3578, 0.1892]}, {"w": "learning.", "b": [0.3641, 0.1695, 0.4531, 0.1892]}, {"w": "For", "b": [0.4594, 0.1695, 0.4944, 0.1892]}, {"w": "lower", "b": [0.5007, 0.1695, 0.5581, 0.1892]}, {"w": "budgets,", "b": [0.5645, 0.1695, 0.6492, 0.1892]}, {"w": "you", "b": [0.6555, 0.1695, 0.6934, 0.1892]}, {"w": "may", "b": [0.6996, 0.1695, 0.7431, 0.1892]}, {"w": "want", "b": [0.7494, 0.1695, 0.7984, 0.1892]}, {"w": "to", "b": [0.8047, 0.1695, 0.8243, 0.1892]}, {"w": "consider", "b": [0.1294, 0.19, 0.2149, 0.2097]}, {"w": "the", "b": [0.2212, 0.19, 0.252, 0.2097]}, {"w": "GTX", "b": [0.2583, 0.19, 0.3102, 0.2097]}, {"w": "1060.", "b": [0.3165, 0.19, 0.3732, 0.2097]}, {"w": "If", "b": [0.3795, 0.19, 0.3963, 0.2097]}, {"w": "you’re", "b": [0.4026, 0.19, 0.4685, 0.2097]}, {"w": "reading", "b": [0.4748, 0.19, 0.5504, 0.2097]}, {"w": "these", "b": [0.5567, 0.19, 0.6086, 0.2097]}, {"w": "pages", "b": [0.6149, 0.19, 0.6723, 0.2097]}, {"w": "in", "b": [0.6786, 0.19, 0.6983, 0.2097]}, {"w": "2018", "b": [0.7046, 0.19, 0.755, 0.2097]}, {"w": "or", "b": [0.7613, 0.19, 0.7823, 0.2097]}, {"w": "later,", "b": [0.7886, 0.19, 0.8387, 0.2097]}, {"w": "take", "b": [0.1294, 0.2105, 0.1714, 0.2302]}, {"w": "the", "b": [0.1777, 0.2105, 0.2086, 0.2302]}, {"w": "time", "b": [0.2149, 0.2105, 0.2597, 0.2302]}, {"w": "to", "b": [0.266, 0.2105, 0.2857, 0.2302]}, {"w": "look", "b": [0.292, 0.2105, 0.3368, 0.2302]}, {"w": "online", "b": [0.3431, 0.2105, 0.4062, 0.2302]}, {"w": "for", "b": [0.4125, 0.2105, 0.4419, 0.2302]}, {"w": "fresher", "b": [0.4482, 0.2105, 0.5182, 0.2302]}, {"w": "recommendations,", "b": [0.5245, 0.2105, 0.7101, 0.2302]}, {"w": "because", "b": [0.7164, 0.2105, 0.7963, 0.2302]}, {"w": "new", "b": [0.8026, 0.2105, 0.8446, 0.2302]}, {"w": "models", "b": [0.1294, 0.231, 0.2023, 0.2507]}, {"w": "come", "b": [0.2086, 0.231, 0.2632, 0.2507]}, {"w": "out", "b": [0.2695, 0.231, 0.3018, 0.2507]}, {"w": "every", "b": [0.3081, 0.231, 0.3641, 0.2507]}, {"w": "year.", "b": [0.3704, 0.231, 0.4187, 0.2507]}]}, {"id": "b_2", "type": "paragraph", "text": "From this section onward, we’ll assume that you have access to a machine with Keras and its dependencies installed—preferably with GPU support. Make sure you finish this step before you proceed. Go through the step-by-step guides in the appendixes, and look online if you need further help. There is no shortage of tutorials on how to install Keras and common deep-learning dependencies.", "words": [{"w": "From", "b": [0.1294, 0.2737, 0.1841, 0.2935]}, {"w": "this", "b": [0.1904, 0.2737, 0.2268, 0.2935]}, {"w": "section", "b": [0.2331, 0.2737, 0.3046, 0.2935]}, {"w": "onward,", "b": [0.3109, 0.2737, 0.3929, 0.2935]}, {"w": "we’ll", "b": [0.3992, 0.2737, 0.451, 0.2935]}, {"w": "assume", "b": [0.4573, 0.2737, 0.5316, 0.2935]}, {"w": "that", "b": [0.5379, 0.2737, 0.5757, 0.2935]}, {"w": "you", "b": [0.582, 0.2737, 0.6199, 0.2935]}, {"w": "have", "b": [0.6262, 0.2737, 0.6738, 0.2935]}, {"w": "access", "b": [0.6801, 0.2737, 0.7445, 0.2935]}, {"w": "to", "b": [0.7508, 0.2737, 0.7705, 0.2935]}, {"w": "a", "b": [0.7768, 0.2737, 0.788, 0.2935]}, {"w": "machine", "b": [0.1294, 0.2942, 0.2149, 0.314]}, {"w": "with", "b": [0.2212, 0.2942, 0.266, 0.314]}, {"w": "Keras", "b": [0.2723, 0.2942, 0.3312, 0.314]}, {"w": "and", "b": [0.3375, 0.2942, 0.3739, 0.314]}, {"w": "its", "b": [0.3802, 0.2942, 0.404, 0.314]}, {"w": "dependencies", "b": [0.4104, 0.2942, 0.5462, 0.314]}, {"w": "installed—preferably", "b": [0.5525, 0.2942, 0.7669, 0.314]}, {"w": "with", "b": [0.7731, 0.2942, 0.818, 0.314]}, {"w": "GPU", "b": [0.1294, 0.3147, 0.1799, 0.3345]}, {"w": "support.", "b": [0.1862, 0.3147, 0.2682, 0.3345]}, {"w": "Make", "b": [0.2745, 0.3147, 0.3319, 0.3345]}, {"w": "sure", "b": [0.3382, 0.3147, 0.3802, 0.3345]}, {"w": "you", "b": [0.3865, 0.3147, 0.4244, 0.3345]}, {"w": "finish", "b": [0.4307, 0.3147, 0.4881, 0.3345]}, {"w": "this", "b": [0.4945, 0.3147, 0.5309, 0.3345]}, {"w": "step", "b": [0.5372, 0.3147, 0.5779, 0.3345]}, {"w": "before", "b": [0.5842, 0.3147, 0.6486, 0.3345]}, {"w": "you", "b": [0.6549, 0.3147, 0.6927, 0.3345]}, {"w": "proceed.", "b": [0.699, 0.3147, 0.7852, 0.3345]}, {"w": "Go", "b": [0.7915, 0.3147, 0.8223, 0.3345]}, {"w": "through", "b": [0.1294, 0.3352, 0.2079, 0.355]}, {"w": "the", "b": [0.2142, 0.3352, 0.245, 0.355]}, {"w": "step-by-step", "b": [0.2513, 0.3352, 0.3746, 0.355]}, {"w": "guides", "b": [0.3809, 0.3352, 0.4468, 0.355]}, {"w": "in", "b": [0.4531, 0.3352, 0.4727, 0.355]}, {"w": "the", "b": [0.479, 0.3352, 0.5099, 0.355]}, {"w": "appendixes,", "b": [0.5162, 0.3352, 0.636, 0.355]}, {"w": "and", "b": [0.6422, 0.3352, 0.6787, 0.355]}, {"w": "look", "b": [0.685, 0.3352, 0.7298, 0.355]}, {"w": "online", "b": [0.7361, 0.3352, 0.7992, 0.355]}, {"w": "if", "b": [0.8055, 0.3352, 0.8209, 0.355]}, {"w": "you", "b": [0.8272, 0.3352, 0.865, 0.355]}, {"w": "need", "b": [0.1294, 0.3557, 0.177, 0.3755]}, {"w": "further", "b": [0.1833, 0.3557, 0.252, 0.3755]}, {"w": "help.", "b": [0.2583, 0.3557, 0.308, 0.3755]}, {"w": "There", "b": [0.3143, 0.3557, 0.3732, 0.3755]}, {"w": "is", "b": [0.3795, 0.3557, 0.3963, 0.3755]}, {"w": "no", "b": [0.4026, 0.3557, 0.4278, 0.3755]}, {"w": "shortage", "b": [0.4341, 0.3557, 0.5196, 0.3755]}, {"w": "of", "b": [0.5259, 0.3557, 0.5469, 0.3755]}, {"w": "tutorials", "b": [0.5532, 0.3557, 0.6359, 0.3755]}, {"w": "on", "b": [0.6422, 0.3557, 0.6675, 0.3755]}, {"w": "how", "b": [0.6738, 0.3557, 0.7172, 0.3755]}, {"w": "to", "b": [0.7235, 0.3557, 0.7431, 0.3755]}, {"w": "install", "b": [0.7494, 0.3557, 0.8111, 0.3755]}, {"w": "Keras", "b": [0.1294, 0.3762, 0.1882, 0.396]}, {"w": "and", "b": [0.1945, 0.3762, 0.231, 0.396]}, {"w": "common", "b": [0.2373, 0.3762, 0.3256, 0.396]}, {"w": "deep-learning", "b": [0.3319, 0.3762, 0.4706, 0.396]}, {"w": "dependencies.", "b": [0.4768, 0.3762, 0.619, 0.396]}]}, {"id": "b_3", "type": "paragraph", "text": "We can now dive into practical Keras examples.", "words": [{"w": "We", "b": [0.1294, 0.419, 0.1624, 0.4388]}, {"w": "can", "b": [0.1687, 0.419, 0.2037, 0.4388]}, {"w": "now", "b": [0.21, 0.419, 0.2535, 0.4388]}, {"w": "dive", "b": [0.2598, 0.419, 0.3032, 0.4388]}, {"w": "into", "b": [0.3095, 0.419, 0.3488, 0.4388]}, {"w": "practical", "b": [0.3551, 0.419, 0.4419, 0.4388]}, {"w": "Keras", "b": [0.4482, 0.419, 0.5071, 0.4388]}, {"w": "examples.", "b": [0.5134, 0.419, 0.615, 0.4388]}]}, {"id": "b_4", "type": "paragraph", "text": "3.4. Classifying movie reviews: a binary classification example", "words": [{"w": "3.4.", "b": [0.1294, 0.4759, 0.172, 0.4981]}, {"w": "Classifying", "b": [0.1791, 0.4759, 0.3131, 0.4981]}, {"w": "movie", "b": [0.3202, 0.4759, 0.3927, 0.4981]}, {"w": "reviews:", "b": [0.3998, 0.4759, 0.5001, 0.4981]}, {"w": "a", "b": [0.5072, 0.4759, 0.5214, 0.4981]}, {"w": "binary", "b": [0.5285, 0.4759, 0.6089, 0.4981]}, {"w": "classification", "b": [0.616, 0.4759, 0.7721, 0.4981]}, {"w": "example", "b": [0.1294, 0.4999, 0.2303, 0.5221]}]}, {"id": "b_5", "type": "paragraph", "text": "Two-class classification, or binary classification, may be the most widely applied kind of machine-learning problem. In this example, you’ll learn to classify movie reviews as positive or negative, based on the text content of the reviews.", "words": [{"w": "Two-class", "b": [0.1294, 0.5456, 0.2313, 0.5653]}, {"w": "classification,", "b": [0.2376, 0.5456, 0.3771, 0.5653]}, {"w": "or", "b": [0.3834, 0.5456, 0.4044, 0.5653]}, {"w": "binary", "b": [0.4107, 0.5456, 0.4751, 0.5653]}, {"w": "classification,", "b": [0.4814, 0.5456, 0.6209, 0.5653]}, {"w": "may", "b": [0.6272, 0.5456, 0.6706, 0.5653]}, {"w": "be", "b": [0.6769, 0.5456, 0.7007, 0.5653]}, {"w": "the", "b": [0.707, 0.5456, 0.7379, 0.5653]}, {"w": "most", "b": [0.7442, 0.5456, 0.7932, 0.5653]}, {"w": "widely", "b": [0.7995, 0.5456, 0.8682, 0.5653]}, {"w": "applied", "b": [0.1294, 0.5661, 0.2037, 0.5858]}, {"w": "kind", "b": [0.21, 0.5661, 0.2548, 0.5858]}, {"w": "of", "b": [0.2611, 0.5661, 0.2822, 0.5858]}, {"w": "machine-learning", "b": [0.2885, 0.5661, 0.465, 0.5858]}, {"w": "problem.", "b": [0.4713, 0.5661, 0.5617, 0.5858]}, {"w": "In", "b": [0.568, 0.5661, 0.589, 0.5858]}, {"w": "this", "b": [0.5953, 0.5661, 0.6318, 0.5858]}, {"w": "example,", "b": [0.638, 0.5661, 0.7298, 0.5858]}, {"w": "you’ll", "b": [0.7361, 0.5661, 0.7963, 0.5858]}, {"w": "learn", "b": [0.8026, 0.5661, 0.8531, 0.5858]}, {"w": "to", "b": [0.1294, 0.5866, 0.149, 0.6063]}, {"w": "classify", "b": [0.1553, 0.5866, 0.2324, 0.6063]}, {"w": "movie", "b": [0.2387, 0.5866, 0.3018, 0.6063]}, {"w": "reviews", "b": [0.3081, 0.5866, 0.3865, 0.6063]}, {"w": "as", "b": [0.3928, 0.5866, 0.4139, 0.6063]}, {"w": "positive", "b": [0.4202, 0.5866, 0.5001, 0.6063]}, {"w": "or", "b": [0.5064, 0.5866, 0.5274, 0.6063]}, {"w": "negative,", "b": [0.5337, 0.5866, 0.6255, 0.6063]}, {"w": "based", "b": [0.6318, 0.5866, 0.6892, 0.6063]}, {"w": "on", "b": [0.6955, 0.5866, 0.7207, 0.6063]}, {"w": "the", "b": [0.727, 0.5866, 0.7579, 0.6063]}, {"w": "text", "b": [0.7642, 0.5866, 0.802, 0.6063]}, {"w": "content", "b": [0.1294, 0.6071, 0.2037, 0.6268]}, {"w": "of", "b": [0.21, 0.6071, 0.231, 0.6268]}, {"w": "the", "b": [0.2373, 0.6071, 0.2681, 0.6268]}, {"w": "reviews.", "b": [0.2744, 0.6071, 0.3592, 0.6268]}]}, {"id": "b_6", "type": "paragraph", "text": "3.4.1. The IMDB dataset", "words": [{"w": "3.4.1.", "b": [0.1294, 0.6543, 0.1862, 0.6741]}, {"w": "The", "b": [0.1925, 0.6543, 0.2345, 0.6741]}, {"w": "IMDB", "b": [0.2408, 0.6543, 0.3095, 0.6741]}, {"w": "dataset", "b": [0.3158, 0.6543, 0.3929, 0.6741]}]}, {"id": "b_7", "type": "paragraph", "text": "You’ll work with the IMDB dataset: a set of 50,000 highly polarized reviews from the Internet Movie Database. They’re split into 25,000 reviews for training and 25,000 reviews for testing, each set consisting of 50% negative and 50% positive reviews.", "words": [{"w": "You’ll", "b": [0.1294, 0.6971, 0.1928, 0.7169]}, {"w": "work", "b": [0.1991, 0.6971, 0.2509, 0.7169]}, {"w": "with", "b": [0.2572, 0.6971, 0.3021, 0.7169]}, {"w": "the", "b": [0.3084, 0.6971, 0.3392, 0.7169]}, {"w": "IMDB", "b": [0.3455, 0.6971, 0.4114, 0.7169]}, {"w": "dataset:", "b": [0.4177, 0.6971, 0.4947, 0.7169]}, {"w": "a", "b": [0.501, 0.6971, 0.5122, 0.7169]}, {"w": "set", "b": [0.5185, 0.6971, 0.5466, 0.7169]}, {"w": "of", "b": [0.5529, 0.6971, 0.5739, 0.7169]}, {"w": "50,000", "b": [0.5802, 0.6971, 0.6496, 0.7169]}, {"w": "highly", "b": [0.6559, 0.6971, 0.7204, 0.7169]}, {"w": "polarized", "b": [0.7267, 0.6971, 0.8205, 0.7169]}, {"w": "reviews", "b": [0.1294, 0.7176, 0.2079, 0.7374]}, {"w": "from", "b": [0.2142, 0.7176, 0.2632, 0.7374]}, {"w": "the", "b": [0.2695, 0.7176, 0.3003, 0.7374]}, {"w": "Internet", "b": [0.3066, 0.7176, 0.3851, 0.7374]}, {"w": "Movie", "b": [0.3914, 0.7176, 0.4573, 0.7374]}, {"w": "Database.", "b": [0.4636, 0.7176, 0.5623, 0.7374]}, {"w": "They’re", "b": [0.5686, 0.7176, 0.6485, 0.7374]}, {"w": "split", "b": [0.6548, 0.7176, 0.6983, 0.7374]}, {"w": "into", "b": [0.7045, 0.7176, 0.7437, 0.7374]}, {"w": "25,000", "b": [0.75, 0.7176, 0.8194, 0.7374]}, {"w": "reviews", "b": [0.1294, 0.7381, 0.2079, 0.7579]}, {"w": "for", "b": [0.2142, 0.7381, 0.2436, 0.7579]}, {"w": "training", "b": [0.2499, 0.7381, 0.3284, 0.7579]}, {"w": "and", "b": [0.3347, 0.7381, 0.3711, 0.7579]}, {"w": "25,000", "b": [0.3774, 0.7381, 0.4468, 0.7579]}, {"w": "reviews", "b": [0.4531, 0.7381, 0.5315, 0.7579]}, {"w": "for", "b": [0.5378, 0.7381, 0.5673, 0.7579]}, {"w": "testing,", "b": [0.5736, 0.7381, 0.6471, 0.7579]}, {"w": "each", "b": [0.6535, 0.7381, 0.6997, 0.7579]}, {"w": "set", "b": [0.706, 0.7381, 0.734, 0.7579]}, {"w": "consisting", "b": [0.7403, 0.7381, 0.8426, 0.7579]}, {"w": "of", "b": [0.8489, 0.7381, 0.8699, 0.7579]}, {"w": "50%", "b": [0.1294, 0.7586, 0.1757, 0.7784]}, {"w": "negative", "b": [0.182, 0.7586, 0.2674, 0.7784]}, {"w": "and", "b": [0.2737, 0.7586, 0.3102, 0.7784]}, {"w": "50%", "b": [0.3165, 0.7586, 0.3627, 0.7784]}, {"w": "positive", "b": [0.369, 0.7586, 0.4489, 0.7784]}, {"w": "reviews.", "b": [0.4552, 0.7586, 0.54, 0.7784]}]}, {"id": "b_8", "type": "paragraph", "text": "Why use separate training and test sets? Because you should never test a machine-learning model on the same data that you used to train it! Just because a model performs well on its training data doesn’t mean it will perform well on data it has never seen; and what you care about is your model’s performance on new data (because you already know the labels", "words": [{"w": "Why", "b": [0.1294, 0.8014, 0.1785, 0.8211]}, {"w": "use", "b": [0.1848, 0.8014, 0.2184, 0.8211]}, {"w": "separate", "b": [0.2247, 0.8014, 0.3073, 0.8211]}, {"w": "training", "b": [0.3136, 0.8014, 0.3921, 0.8211]}, {"w": "and", "b": [0.3984, 0.8014, 0.4348, 0.8211]}, {"w": "test", "b": [0.4412, 0.8014, 0.4762, 0.8211]}, {"w": "sets?", "b": [0.4825, 0.8014, 0.5315, 0.8211]}, {"w": "Because", "b": [0.5378, 0.8014, 0.6219, 0.8211]}, {"w": "you", "b": [0.6282, 0.8014, 0.666, 0.8211]}, {"w": "should", "b": [0.6723, 0.8014, 0.7396, 0.8211]}, {"w": "never", "b": [0.7459, 0.8014, 0.802, 0.8211]}, {"w": "test", "b": [0.8083, 0.8014, 0.8433, 0.8211]}, {"w": "a", "b": [0.8496, 0.8014, 0.8608, 0.8211]}, {"w": "machine-learning", "b": [0.1294, 0.8219, 0.3059, 0.8416]}, {"w": "model", "b": [0.3122, 0.8219, 0.3753, 0.8416]}, {"w": "on", "b": [0.3816, 0.8219, 0.4068, 0.8416]}, {"w": "the", "b": [0.4132, 0.8219, 0.444, 0.8416]}, {"w": "same", "b": [0.4503, 0.8219, 0.5021, 0.8416]}, {"w": "data", "b": [0.5084, 0.8219, 0.5505, 0.8416]}, {"w": "that", "b": [0.5568, 0.8219, 0.5946, 0.8416]}, {"w": "you", "b": [0.6009, 0.8219, 0.6387, 0.8416]}, {"w": "used", "b": [0.645, 0.8219, 0.6912, 0.8416]}, {"w": "to", "b": [0.6975, 0.8219, 0.7171, 0.8416]}, {"w": "train", "b": [0.7234, 0.8219, 0.7697, 0.8416]}, {"w": "it!", "b": [0.776, 0.8219, 0.7984, 0.8416]}, {"w": "Just", "b": [0.8047, 0.8219, 0.844, 0.8416]}, {"w": "because", "b": [0.1294, 0.8424, 0.2093, 0.8621]}, {"w": "a", "b": [0.2156, 0.8424, 0.2268, 0.8621]}, {"w": "model", "b": [0.2331, 0.8424, 0.2961, 0.8621]}, {"w": "performs", "b": [0.3024, 0.8424, 0.3935, 0.8621]}, {"w": "well", "b": [0.3998, 0.8424, 0.4432, 0.8621]}, {"w": "on", "b": [0.4496, 0.8424, 0.4748, 0.8621]}, {"w": "its", "b": [0.4811, 0.8424, 0.5049, 0.8621]}, {"w": "training", "b": [0.5112, 0.8424, 0.5897, 0.8621]}, {"w": "data", "b": [0.596, 0.8424, 0.638, 0.8621]}, {"w": "doesn’t", "b": [0.6443, 0.8424, 0.7181, 0.8621]}, {"w": "mean", "b": [0.7244, 0.8424, 0.779, 0.8621]}, {"w": "it", "b": [0.7853, 0.8424, 0.7994, 0.8621]}, {"w": "will", "b": [0.8057, 0.8424, 0.8449, 0.8621]}, {"w": "perform", "b": [0.1294, 0.8629, 0.2107, 0.8826]}, {"w": "well", "b": [0.217, 0.8629, 0.2604, 0.8826]}, {"w": "on", "b": [0.2667, 0.8629, 0.2919, 0.8826]}, {"w": "data", "b": [0.2982, 0.8629, 0.3403, 0.8826]}, {"w": "it", "b": [0.3466, 0.8629, 0.3606, 0.8826]}, {"w": "has", "b": [0.3669, 0.8629, 0.4005, 0.8826]}, {"w": "never", "b": [0.4068, 0.8629, 0.4628, 0.8826]}, {"w": "seen;", "b": [0.4691, 0.8629, 0.521, 0.8826]}, {"w": "and", "b": [0.5273, 0.8629, 0.5637, 0.8826]}, {"w": "what", "b": [0.57, 0.8629, 0.619, 0.8826]}, {"w": "you", "b": [0.6254, 0.8629, 0.6632, 0.8826]}, {"w": "care", "b": [0.6695, 0.8629, 0.7115, 0.8826]}, {"w": "about", "b": [0.7178, 0.8629, 0.7739, 0.8826]}, {"w": "is", "b": [0.7802, 0.8629, 0.797, 0.8826]}, {"w": "your", "b": [0.8033, 0.8629, 0.8495, 0.8826]}, {"w": "model’s", "b": [0.1294, 0.8834, 0.2093, 0.9031]}, {"w": "performance", "b": [0.2156, 0.8834, 0.3431, 0.9031]}, {"w": "on", "b": [0.3494, 0.8834, 0.3746, 0.9031]}, {"w": "new", "b": [0.3809, 0.8834, 0.4229, 0.9031]}, {"w": "data", "b": [0.4292, 0.8834, 0.4713, 0.9031]}, {"w": "(because", "b": [0.4776, 0.8834, 0.5658, 0.9031]}, {"w": "you", "b": [0.5721, 0.8834, 0.6099, 0.9031]}, {"w": "already", "b": [0.6163, 0.8834, 0.6905, 0.9031]}, {"w": "know", "b": [0.6968, 0.8834, 0.7529, 0.9031]}, {"w": "the", "b": [0.7592, 0.8834, 0.79, 0.9031]}, {"w": "labels", "b": [0.7963, 0.8834, 0.8551, 0.9031]}]}]}, {"page": 107, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "of your training data—obviously you don’t need your model to predict those). For instance, it’s possible that your model could end up merely memorizing a mapping between your training samples and their targets, which would be useless for the task of predicting targets for data the model has never seen before. We’ll go over this point in much more detail in the next chapter.", "words": [{"w": "of", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "your", "b": [0.1567, 0.0857, 0.203, 0.1054]}, {"w": "training", "b": [0.2093, 0.0857, 0.2878, 0.1054]}, {"w": "data—obviously", "b": [0.294, 0.0857, 0.4608, 0.1054]}, {"w": "you", "b": [0.4671, 0.0857, 0.5049, 0.1054]}, {"w": "don’t", "b": [0.5112, 0.0857, 0.564, 0.1054]}, {"w": "need", "b": [0.5703, 0.0857, 0.618, 0.1054]}, {"w": "your", "b": [0.6243, 0.0857, 0.6705, 0.1054]}, {"w": "model", "b": [0.6768, 0.0857, 0.7399, 0.1054]}, {"w": "to", "b": [0.7462, 0.0857, 0.7658, 0.1054]}, {"w": "predict", "b": [0.7721, 0.0857, 0.8422, 0.1054]}, {"w": "those).", "b": [0.1294, 0.1062, 0.1974, 0.1259]}, {"w": "For", "b": [0.2037, 0.1062, 0.2387, 0.1259]}, {"w": "instance,", "b": [0.245, 0.1062, 0.334, 0.1259]}, {"w": "it’s", "b": [0.3403, 0.1062, 0.3711, 0.1259]}, {"w": "possible", "b": [0.3774, 0.1062, 0.4601, 0.1259]}, {"w": "that", "b": [0.4664, 0.1062, 0.5043, 0.1259]}, {"w": "your", "b": [0.5106, 0.1062, 0.5568, 0.1259]}, {"w": "model", "b": [0.5631, 0.1062, 0.6262, 0.1259]}, {"w": "could", "b": [0.6325, 0.1062, 0.6885, 0.1259]}, {"w": "end", "b": [0.6948, 0.1062, 0.7313, 0.1259]}, {"w": "up", "b": [0.7376, 0.1062, 0.7628, 0.1259]}, {"w": "merely", "b": [0.7691, 0.1062, 0.8392, 0.1259]}, {"w": "memorizing", "b": [0.1294, 0.1267, 0.2485, 0.1464]}, {"w": "a", "b": [0.2548, 0.1267, 0.266, 0.1464]}, {"w": "mapping", "b": [0.2723, 0.1267, 0.3606, 0.1464]}, {"w": "between", "b": [0.3669, 0.1267, 0.451, 0.1464]}, {"w": "your", "b": [0.4573, 0.1267, 0.5035, 0.1464]}, {"w": "training", "b": [0.5098, 0.1267, 0.5883, 0.1464]}, {"w": "samples", "b": [0.5946, 0.1267, 0.6759, 0.1464]}, {"w": "and", "b": [0.6822, 0.1267, 0.7186, 0.1464]}, {"w": "their", "b": [0.7249, 0.1267, 0.7712, 0.1464]}, {"w": "targets,", "b": [0.7775, 0.1267, 0.8505, 0.1464]}, {"w": "which", "b": [0.1294, 0.1472, 0.1911, 0.1669]}, {"w": "would", "b": [0.1974, 0.1472, 0.2604, 0.1669]}, {"w": "be", "b": [0.2667, 0.1472, 0.2906, 0.1669]}, {"w": "useless", "b": [0.2969, 0.1472, 0.3683, 0.1669]}, {"w": "for", "b": [0.3746, 0.1472, 0.404, 0.1669]}, {"w": "the", "b": [0.4104, 0.1472, 0.4412, 0.1669]}, {"w": "task", "b": [0.4475, 0.1472, 0.4881, 0.1669]}, {"w": "of", "b": [0.4944, 0.1472, 0.5154, 0.1669]}, {"w": "predicting", "b": [0.5217, 0.1472, 0.624, 0.1669]}, {"w": "targets", "b": [0.6303, 0.1472, 0.6971, 0.1669]}, {"w": "for", "b": [0.7034, 0.1472, 0.7328, 0.1669]}, {"w": "data", "b": [0.7391, 0.1472, 0.7811, 0.1669]}, {"w": "the", "b": [0.7874, 0.1472, 0.8183, 0.1669]}, {"w": "model", "b": [0.1294, 0.1677, 0.1925, 0.1874]}, {"w": "has", "b": [0.1988, 0.1677, 0.2324, 0.1874]}, {"w": "never", "b": [0.2387, 0.1677, 0.2947, 0.1874]}, {"w": "seen", "b": [0.301, 0.1677, 0.3459, 0.1874]}, {"w": "before.", "b": [0.3522, 0.1677, 0.4229, 0.1874]}, {"w": "We’ll", "b": [0.4292, 0.1677, 0.4846, 0.1874]}, {"w": "go", "b": [0.4909, 0.1677, 0.5161, 0.1874]}, {"w": "over", "b": [0.5224, 0.1677, 0.5673, 0.1874]}, {"w": "this", "b": [0.5736, 0.1677, 0.61, 0.1874]}, {"w": "point", "b": [0.6163, 0.1677, 0.6682, 0.1874]}, {"w": "in", "b": [0.6745, 0.1677, 0.6941, 0.1874]}, {"w": "much", "b": [0.7004, 0.1677, 0.7565, 0.1874]}, {"w": "more", "b": [0.7628, 0.1677, 0.8146, 0.1874]}, {"w": "detail", "b": [0.1294, 0.1882, 0.1855, 0.2079]}, {"w": "in", "b": [0.1918, 0.1882, 0.2114, 0.2079]}, {"w": "the", "b": [0.2177, 0.1882, 0.2485, 0.2079]}, {"w": "next", "b": [0.2548, 0.1882, 0.2983, 0.2079]}, {"w": "chapter.", "b": [0.3046, 0.1882, 0.3837, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "Just like the MNIST dataset, the IMDB dataset comes packaged with Keras. It has already been preprocessed: the reviews (sequences of words) have been turned into sequences of integers, where each integer stands for a specific word in a dictionary.", "words": [{"w": "Just", "b": [0.1294, 0.231, 0.1687, 0.2507]}, {"w": "like", "b": [0.175, 0.231, 0.2128, 0.2507]}, {"w": "the", "b": [0.2191, 0.231, 0.2499, 0.2507]}, {"w": "MNIST", "b": [0.2562, 0.231, 0.3347, 0.2507]}, {"w": "dataset,", "b": [0.341, 0.231, 0.4174, 0.2507]}, {"w": "the", "b": [0.4237, 0.231, 0.4545, 0.2507]}, {"w": "IMDB", "b": [0.4608, 0.231, 0.5267, 0.2507]}, {"w": "dataset", "b": [0.533, 0.231, 0.6031, 0.2507]}, {"w": "comes", "b": [0.6094, 0.231, 0.6738, 0.2507]}, {"w": "packaged", "b": [0.6801, 0.231, 0.7754, 0.2507]}, {"w": "with", "b": [0.7817, 0.231, 0.8265, 0.2507]}, {"w": "Keras.", "b": [0.1294, 0.2515, 0.1945, 0.2712]}, {"w": "It", "b": [0.2009, 0.2515, 0.2163, 0.2712]}, {"w": "has", "b": [0.2226, 0.2515, 0.2562, 0.2712]}, {"w": "already", "b": [0.2625, 0.2515, 0.3367, 0.2712]}, {"w": "been", "b": [0.343, 0.2515, 0.3907, 0.2712]}, {"w": "preprocessed:", "b": [0.397, 0.2515, 0.5357, 0.2712]}, {"w": "the", "b": [0.542, 0.2515, 0.5728, 0.2712]}, {"w": "reviews", "b": [0.5791, 0.2515, 0.6576, 0.2712]}, {"w": "(sequences", "b": [0.6639, 0.2515, 0.7745, 0.2712]}, {"w": "of", "b": [0.7808, 0.2515, 0.8018, 0.2712]}, {"w": "words)", "b": [0.1294, 0.272, 0.1995, 0.2917]}, {"w": "have", "b": [0.2058, 0.272, 0.2534, 0.2917]}, {"w": "been", "b": [0.2597, 0.272, 0.3073, 0.2917]}, {"w": "turned", "b": [0.3136, 0.272, 0.3781, 0.2917]}, {"w": "into", "b": [0.3844, 0.272, 0.4236, 0.2917]}, {"w": "sequences", "b": [0.43, 0.272, 0.5322, 0.2917]}, {"w": "of", "b": [0.5385, 0.272, 0.5595, 0.2917]}, {"w": "integers,", "b": [0.5658, 0.272, 0.652, 0.2917]}, {"w": "where", "b": [0.6583, 0.272, 0.7199, 0.2917]}, {"w": "each", "b": [0.7263, 0.272, 0.7725, 0.2917]}, {"w": "integer", "b": [0.7788, 0.272, 0.8488, 0.2917]}, {"w": "stands", "b": [0.1294, 0.2925, 0.1925, 0.3122]}, {"w": "for", "b": [0.1988, 0.2925, 0.2282, 0.3122]}, {"w": "a", "b": [0.2345, 0.2925, 0.2457, 0.3122]}, {"w": "specific", "b": [0.252, 0.2925, 0.3305, 0.3122]}, {"w": "word", "b": [0.3368, 0.2925, 0.3886, 0.3122]}, {"w": "in", "b": [0.3949, 0.2925, 0.4145, 0.3122]}, {"w": "a", "b": [0.4208, 0.2925, 0.432, 0.3122]}, {"w": "dictionary.", "b": [0.4384, 0.2925, 0.5453, 0.3122]}]}, {"id": "b_2", "type": "paragraph", "text": "The following code will load the dataset (when you run it the first time, about 80 MB of data will be downloaded to your machine).", "words": [{"w": "The", "b": [0.1294, 0.3352, 0.1686, 0.355]}, {"w": "following", "b": [0.1749, 0.3352, 0.273, 0.355]}, {"w": "code", "b": [0.2794, 0.3352, 0.327, 0.355]}, {"w": "will", "b": [0.3333, 0.3352, 0.3725, 0.355]}, {"w": "load", "b": [0.3788, 0.3352, 0.4223, 0.355]}, {"w": "the", "b": [0.4286, 0.3352, 0.4594, 0.355]}, {"w": "dataset", "b": [0.4657, 0.3352, 0.5358, 0.355]}, {"w": "(when", "b": [0.5421, 0.3352, 0.6051, 0.355]}, {"w": "you", "b": [0.6114, 0.3352, 0.6493, 0.355]}, {"w": "run", "b": [0.6556, 0.3352, 0.6892, 0.355]}, {"w": "it", "b": [0.6955, 0.3352, 0.7095, 0.355]}, {"w": "the", "b": [0.7158, 0.3352, 0.7467, 0.355]}, {"w": "first", "b": [0.753, 0.3352, 0.7936, 0.355]}, {"w": "time,", "b": [0.7999, 0.3352, 0.8511, 0.355]}, {"w": "about", "b": [0.1294, 0.3557, 0.1855, 0.3755]}, {"w": "80", "b": [0.1918, 0.3557, 0.217, 0.3755]}, {"w": "MB", "b": [0.2233, 0.3557, 0.2626, 0.3755]}, {"w": "of", "b": [0.2689, 0.3557, 0.2899, 0.3755]}, {"w": "data", "b": [0.2962, 0.3557, 0.3382, 0.3755]}, {"w": "will", "b": [0.3445, 0.3557, 0.3838, 0.3755]}, {"w": "be", "b": [0.3901, 0.3557, 0.4139, 0.3755]}, {"w": "downloaded", "b": [0.4202, 0.3557, 0.5435, 0.3755]}, {"w": "to", "b": [0.5498, 0.3557, 0.5694, 0.3755]}, {"w": "your", "b": [0.5757, 0.3557, 0.622, 0.3755]}, {"w": "machine).", "b": [0.6283, 0.3557, 0.7284, 0.3755]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 3.1. Loading the IMDB dataset", "words": [{"w": "Listing", "b": [0.1294, 0.3936, 0.1862, 0.4084]}, {"w": "3.1.", "b": [0.1909, 0.3936, 0.2193, 0.4084]}, {"w": "Loading", "b": [0.224, 0.3936, 0.2913, 0.4084]}, {"w": "the", "b": [0.296, 0.3936, 0.3213, 0.4084]}, {"w": "IMDB", "b": [0.326, 0.3936, 0.3775, 0.4084]}, {"w": "dataset", "b": [0.3822, 0.3936, 0.44, 0.4084]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.datasets import imdb (train_data, train_labels), (test_data, test_labels) = imdb.load_data( num_words=10000)", "words": [{"w": "from", "b": [0.1357, 0.422, 0.1811, 0.4371]}, {"w": "keras.datasets", "b": [0.1925, 0.422, 0.3514, 0.4371]}, {"w": "import", "b": [0.3628, 0.422, 0.4309, 0.4371]}, {"w": "imdb", "b": [0.4422, 0.422, 0.4876, 0.4371]}, {"w": "(train_data,", "b": [0.1357, 0.4523, 0.2719, 0.4675]}, {"w": "train_labels),", "b": [0.2833, 0.4523, 0.4422, 0.4675]}, {"w": "(test_data,", "b": [0.4536, 0.4523, 0.5784, 0.4675]}, {"w": "test_labels)", "b": [0.5898, 0.4523, 0.726, 0.4675]}, {"w": "=", "b": [0.7374, 0.4523, 0.7487, 0.4675]}, {"w": "imdb.load_data(", "b": [0.1357, 0.4675, 0.306, 0.4826]}, {"w": "num_words=10000)", "b": [0.1811, 0.4826, 0.3628, 0.4978]}]}, {"id": "b_5", "type": "paragraph", "text": "The argument num_words=10000 means you’ll only keep the top 10,000 most frequently occurring words in the training data. Rare words will be discarded. This allows you to work with vector data of manageable size.", "words": [{"w": "The", "b": [0.1294, 0.5206, 0.1686, 0.5404]}, {"w": "argument", "b": [0.1749, 0.5206, 0.2698, 0.5404]}, {"w": "num_words=10000", "b": [0.276, 0.5217, 0.5031, 0.5419]}, {"w": "means", "b": [0.5094, 0.5206, 0.5738, 0.5404]}, {"w": "you’ll", "b": [0.5802, 0.5206, 0.6404, 0.5404]}, {"w": "only", "b": [0.6467, 0.5206, 0.6916, 0.5404]}, {"w": "keep", "b": [0.6979, 0.5206, 0.7455, 0.5404]}, {"w": "the", "b": [0.7518, 0.5206, 0.7826, 0.5404]}, {"w": "top", "b": [0.7889, 0.5206, 0.8212, 0.5404]}, {"w": "10,000", "b": [0.1294, 0.542, 0.1988, 0.5618]}, {"w": "most", "b": [0.2051, 0.542, 0.2542, 0.5618]}, {"w": "frequently", "b": [0.2605, 0.542, 0.3641, 0.5618]}, {"w": "occurring", "b": [0.3704, 0.542, 0.4671, 0.5618]}, {"w": "words", "b": [0.4734, 0.542, 0.5351, 0.5618]}, {"w": "in", "b": [0.5414, 0.542, 0.561, 0.5618]}, {"w": "the", "b": [0.5673, 0.542, 0.5981, 0.5618]}, {"w": "training", "b": [0.6044, 0.542, 0.6829, 0.5618]}, {"w": "data.", "b": [0.6892, 0.542, 0.7376, 0.5618]}, {"w": "Rare", "b": [0.7439, 0.542, 0.7915, 0.5618]}, {"w": "words", "b": [0.7978, 0.542, 0.8594, 0.5618]}, {"w": "will", "b": [0.1294, 0.5625, 0.1687, 0.5823]}, {"w": "be", "b": [0.175, 0.5625, 0.1988, 0.5823]}, {"w": "discarded.", "b": [0.2051, 0.5625, 0.3081, 0.5823]}, {"w": "This", "b": [0.3143, 0.5625, 0.3592, 0.5823]}, {"w": "allows", "b": [0.3655, 0.5625, 0.4314, 0.5823]}, {"w": "you", "b": [0.4377, 0.5625, 0.4755, 0.5823]}, {"w": "to", "b": [0.4818, 0.5625, 0.5014, 0.5823]}, {"w": "work", "b": [0.5077, 0.5625, 0.5596, 0.5823]}, {"w": "with", "b": [0.5659, 0.5625, 0.6107, 0.5823]}, {"w": "vector", "b": [0.617, 0.5625, 0.6801, 0.5823]}, {"w": "data", "b": [0.6864, 0.5625, 0.7284, 0.5823]}, {"w": "of", "b": [0.7347, 0.5625, 0.7557, 0.5823]}, {"w": "manageable", "b": [0.1294, 0.583, 0.2499, 0.6028]}, {"w": "size.", "b": [0.2562, 0.583, 0.3017, 0.6028]}]}, {"id": "b_6", "type": "paragraph", "text": "The variables train_data and test_data are lists of reviews; each review is a list of word indices (encoding a sequence of words). train_labels and test_labels are lists of 0s and 1s, where 0 stands for negative and 1 stands for positive:", "words": [{"w": "The", "b": [0.1294, 0.6258, 0.1686, 0.6456]}, {"w": "variables", "b": [0.1749, 0.6258, 0.266, 0.6456]}, {"w": "train_data", "b": [0.2723, 0.6269, 0.4236, 0.6471]}, {"w": "and", "b": [0.43, 0.6258, 0.4664, 0.6456]}, {"w": "test_data", "b": [0.4727, 0.6269, 0.6089, 0.6471]}, {"w": "are", "b": [0.6152, 0.6258, 0.646, 0.6456]}, {"w": "lists", "b": [0.6524, 0.6258, 0.693, 0.6456]}, {"w": "of", "b": [0.6993, 0.6258, 0.7203, 0.6456]}, {"w": "reviews;", "b": [0.7266, 0.6258, 0.8121, 0.6456]}, {"w": "each", "b": [0.8184, 0.6258, 0.8646, 0.6456]}, {"w": "review", "b": [0.1294, 0.6472, 0.1981, 0.6669]}, {"w": "is", "b": [0.2044, 0.6472, 0.2212, 0.6669]}, {"w": "a", "b": [0.2275, 0.6472, 0.2387, 0.6669]}, {"w": "list", "b": [0.245, 0.6472, 0.2758, 0.6669]}, {"w": "of", "b": [0.2822, 0.6472, 0.3032, 0.6669]}, {"w": "word", "b": [0.3095, 0.6472, 0.3613, 0.6669]}, {"w": "indices", "b": [0.3676, 0.6472, 0.4391, 0.6669]}, {"w": "(encoding", "b": [0.4454, 0.6472, 0.5463, 0.6669]}, {"w": "a", "b": [0.5526, 0.6472, 0.5638, 0.6669]}, {"w": "sequence", "b": [0.5701, 0.6472, 0.6625, 0.6669]}, {"w": "of", "b": [0.6688, 0.6472, 0.6899, 0.6669]}, {"w": "words).", "b": [0.6962, 0.6472, 0.7725, 0.6669]}, {"w": "train_labels", "b": [0.1294, 0.6688, 0.311, 0.6889]}, {"w": "and", "b": [0.3174, 0.6677, 0.3538, 0.6874]}, {"w": "test_labels", "b": [0.3601, 0.6688, 0.5266, 0.6889]}, {"w": "are", "b": [0.5329, 0.6677, 0.5637, 0.6874]}, {"w": "lists", "b": [0.57, 0.6677, 0.6107, 0.6874]}, {"w": "of", "b": [0.617, 0.6677, 0.638, 0.6874]}, {"w": "0s", "b": [0.6443, 0.6677, 0.6667, 0.6874]}, {"w": "and", "b": [0.673, 0.6677, 0.7095, 0.6874]}, {"w": "1s,", "b": [0.7158, 0.6677, 0.7445, 0.6874]}, {"w": "where", "b": [0.7508, 0.6677, 0.8124, 0.6874]}, {"w": "0", "b": [0.8187, 0.6677, 0.8314, 0.6874]}, {"w": "stands", "b": [0.1294, 0.6891, 0.1925, 0.7088]}, {"w": "for", "b": [0.1988, 0.6891, 0.2282, 0.7088]}, {"w": "negative", "b": [0.2345, 0.6891, 0.32, 0.7088]}, {"w": "and", "b": [0.3262, 0.6891, 0.3627, 0.7088]}, {"w": "1", "b": [0.369, 0.6891, 0.3816, 0.7088]}, {"w": "stands", "b": [0.3879, 0.6891, 0.4509, 0.7088]}, {"w": "for", "b": [0.4573, 0.6891, 0.4867, 0.7088]}, {"w": "positive:", "b": [0.493, 0.6891, 0.5784, 0.7088]}]}, {"id": "b_7", "type": "equation", "text": ">>> train_data[0] [1, 14, 22, 16, ... 178, 32] >>> train_labels[0] 1", "words": [{"w": ">>>", "b": [0.1357, 0.7268, 0.1698, 0.742]}, {"w": "train_data[0]", "b": [0.1811, 0.7268, 0.3287, 0.742]}, {"w": "[1,", "b": [0.1357, 0.742, 0.1698, 0.7571]}, {"w": "14,", "b": [0.1811, 0.742, 0.2152, 0.7571]}, {"w": "22,", "b": [0.2265, 0.742, 0.2606, 0.7571]}, {"w": "16,", "b": [0.2719, 0.742, 0.306, 0.7571]}, {"w": "...", "b": [0.3173, 0.742, 0.3514, 0.7571]}, {"w": "178,", "b": [0.3628, 0.742, 0.4082, 0.7571]}, {"w": "32]", "b": [0.4195, 0.742, 0.4536, 0.7571]}, {"w": ">>>", "b": [0.1357, 0.7723, 0.1698, 0.7874]}, {"w": "train_labels[0]", "b": [0.1811, 0.7723, 0.3514, 0.7874]}, {"w": "1", "b": [0.1357, 0.7874, 0.1471, 0.8026]}]}, {"id": "b_8", "type": "paragraph", "text": "Because you’re restricting yourself to the top 10,000 most frequent words, no word index will exceed 10,000:", "words": [{"w": "Because", "b": [0.1294, 0.8255, 0.2135, 0.8452]}, {"w": "you’re", "b": [0.2198, 0.8255, 0.2856, 0.8452]}, {"w": "restricting", "b": [0.2919, 0.8255, 0.3942, 0.8452]}, {"w": "yourself", "b": [0.4005, 0.8255, 0.4832, 0.8452]}, {"w": "to", "b": [0.4895, 0.8255, 0.5091, 0.8452]}, {"w": "the", "b": [0.5154, 0.8255, 0.5462, 0.8452]}, {"w": "top", "b": [0.5525, 0.8255, 0.5848, 0.8452]}, {"w": "10,000", "b": [0.5911, 0.8255, 0.6605, 0.8452]}, {"w": "most", "b": [0.6668, 0.8255, 0.7158, 0.8452]}, {"w": "frequent", "b": [0.7221, 0.8255, 0.8062, 0.8452]}, {"w": "words,", "b": [0.1294, 0.846, 0.1974, 0.8657]}, {"w": "no", "b": [0.2037, 0.846, 0.2289, 0.8657]}, {"w": "word", "b": [0.2352, 0.846, 0.287, 0.8657]}, {"w": "index", "b": [0.2934, 0.846, 0.3494, 0.8657]}, {"w": "will", "b": [0.3557, 0.846, 0.395, 0.8657]}, {"w": "exceed", "b": [0.4013, 0.846, 0.4713, 0.8657]}, {"w": "10,000:", "b": [0.4776, 0.846, 0.554, 0.8657]}]}, {"id": "b_9", "type": "equation", "text": ">>> max([max(sequence) for sequence in train_data]) 9999", "words": [{"w": ">>>", "b": [0.1357, 0.8837, 0.1698, 0.8988]}, {"w": "max([max(sequence)", "b": [0.1811, 0.8837, 0.3855, 0.8988]}, {"w": "for", "b": [0.3968, 0.8837, 0.4309, 0.8988]}, {"w": "sequence", "b": [0.4422, 0.8837, 0.533, 0.8988]}, {"w": "in", "b": [0.5444, 0.8837, 0.5671, 0.8988]}, {"w": "train_data])", "b": [0.5784, 0.8837, 0.7146, 0.8988]}, {"w": "9999", "b": [0.1357, 0.8989, 0.1811, 0.914]}]}]}, {"page": 108, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "For kicks, here’s how you can quickly decode one of these reviews back to English words:", "words": [{"w": "For", "b": [0.1294, 0.0857, 0.1645, 0.1054]}, {"w": "kicks,", "b": [0.1708, 0.0857, 0.2303, 0.1054]}, {"w": "here’s", "b": [0.2366, 0.0857, 0.2968, 0.1054]}, {"w": "how", "b": [0.3032, 0.0857, 0.3466, 0.1054]}, {"w": "you", "b": [0.3529, 0.0857, 0.3907, 0.1054]}, {"w": "can", "b": [0.397, 0.0857, 0.4321, 0.1054]}, {"w": "quickly", "b": [0.4384, 0.0857, 0.514, 0.1054]}, {"w": "decode", "b": [0.5203, 0.0857, 0.5918, 0.1054]}, {"w": "one", "b": [0.5981, 0.0857, 0.6345, 0.1054]}, {"w": "of", "b": [0.6408, 0.0857, 0.6618, 0.1054]}, {"w": "these", "b": [0.6681, 0.0857, 0.72, 0.1054]}, {"w": "reviews", "b": [0.7263, 0.0857, 0.8047, 0.1054]}, {"w": "back", "b": [0.8111, 0.0857, 0.8587, 0.1054]}, {"w": "to", "b": [0.1294, 0.1062, 0.149, 0.1259]}, {"w": "English", "b": [0.1553, 0.1062, 0.2324, 0.1259]}, {"w": "words:", "b": [0.2387, 0.1062, 0.3074, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "word_index = imdb.get_word_index() 1 reverse_word_index = dict( [(value, key) for (key, value) in word_index.items()]) 2 decoded_review = ' '.join( [reverse_word_index.get(i - 3, '?') for i in train_data[0]]) 3", "words": [{"w": "word_index", "b": [0.1357, 0.1439, 0.2492, 0.1591]}, {"w": "=", "b": [0.2606, 0.1439, 0.2719, 0.1591]}, {"w": "imdb.get_word_index()", "b": [0.2833, 0.1439, 0.5217, 0.1591]}, {"w": "1", "b": [0.1357, 0.1591, 0.1471, 0.1742]}, {"w": "reverse_word_index", "b": [0.1357, 0.1742, 0.34, 0.1894]}, {"w": "=", "b": [0.3514, 0.1742, 0.3628, 0.1894]}, {"w": "dict(", "b": [0.3741, 0.1742, 0.4309, 0.1894]}, {"w": "[(value,", "b": [0.1811, 0.1894, 0.2719, 0.2045]}, {"w": "key)", "b": [0.2833, 0.1894, 0.3287, 0.2045]}, {"w": "for", "b": [0.34, 0.1894, 0.3741, 0.2045]}, {"w": "(key,", "b": [0.3855, 0.1894, 0.4422, 0.2045]}, {"w": "value)", "b": [0.4536, 0.1894, 0.5217, 0.2045]}, {"w": "in", "b": [0.533, 0.1894, 0.5557, 0.2045]}, {"w": "word_index.items()])", "b": [0.5671, 0.1894, 0.7941, 0.2045]}, {"w": "2", "b": [0.1357, 0.2045, 0.1471, 0.2197]}, {"w": "decoded_review", "b": [0.1357, 0.2197, 0.2946, 0.2348]}, {"w": "=", "b": [0.306, 0.2197, 0.3173, 0.2348]}, {"w": "'", "b": [0.3287, 0.2197, 0.34, 0.2348]}, {"w": "'.join(", "b": [0.3514, 0.2197, 0.4309, 0.2348]}, {"w": "[reverse_word_index.get(i", "b": [0.1811, 0.2348, 0.4649, 0.25]}, {"w": "-", "b": [0.4763, 0.2348, 0.4876, 0.25]}, {"w": "3,", "b": [0.499, 0.2348, 0.5217, 0.25]}, {"w": "'?')", "b": [0.533, 0.2348, 0.5784, 0.25]}, {"w": "for", "b": [0.5898, 0.2348, 0.6238, 0.25]}, {"w": "i", "b": [0.6352, 0.2348, 0.6465, 0.25]}, {"w": "in", "b": [0.6579, 0.2348, 0.6806, 0.25]}, {"w": "train_data[0]])", "b": [0.6919, 0.2348, 0.8622, 0.25]}, {"w": "3", "b": [0.1357, 0.25, 0.1471, 0.2651]}]}, {"id": "b_2", "type": "paragraph", "text": "1 word_index is a dictionary mapping words to an integer index. 2 Reverses it, mapping integer indices to words 3 Decodes the review. Note that the indices are offset by 3 because 0, 1, and 2 are reserved indices for “padding,” “start of sequence,” and “unknown.”", "words": [{"w": "1", "b": [0.1799, 0.2835, 0.1925, 0.3033]}, {"w": "word_index", "b": [0.1988, 0.2835, 0.3263, 0.3033]}, {"w": "is", "b": [0.3326, 0.2835, 0.3495, 0.3033]}, {"w": "a", "b": [0.3558, 0.2835, 0.3684, 0.3033]}, {"w": "dictionary", "b": [0.3747, 0.2835, 0.4854, 0.3033]}, {"w": "mapping", "b": [0.4917, 0.2835, 0.587, 0.3033]}, {"w": "words", "b": [0.5933, 0.2835, 0.6592, 0.3033]}, {"w": "to", "b": [0.6655, 0.2835, 0.6865, 0.3033]}, {"w": "an", "b": [0.6928, 0.2835, 0.7195, 0.3033]}, {"w": "integer", "b": [0.7258, 0.2835, 0.8014, 0.3033]}, {"w": "index.", "b": [0.1799, 0.304, 0.245, 0.3238]}, {"w": "2", "b": [0.1799, 0.3245, 0.1925, 0.3443]}, {"w": "Reverses", "b": [0.1988, 0.3245, 0.294, 0.3443]}, {"w": "it,", "b": [0.3003, 0.3245, 0.3221, 0.3443]}, {"w": "mapping", "b": [0.3284, 0.3245, 0.4237, 0.3443]}, {"w": "integer", "b": [0.43, 0.3245, 0.5057, 0.3443]}, {"w": "indices", "b": [0.512, 0.3245, 0.5863, 0.3443]}, {"w": "to", "b": [0.5926, 0.3245, 0.6136, 0.3443]}, {"w": "words", "b": [0.6199, 0.3245, 0.6857, 0.3443]}, {"w": "3", "b": [0.1799, 0.345, 0.1925, 0.3648]}, {"w": "Decodes", "b": [0.1988, 0.345, 0.287, 0.3648]}, {"w": "the", "b": [0.2934, 0.345, 0.327, 0.3648]}, {"w": "review.", "b": [0.3333, 0.345, 0.4092, 0.3648]}, {"w": "Note", "b": [0.4155, 0.345, 0.4659, 0.3648]}, {"w": "that", "b": [0.4722, 0.345, 0.5157, 0.3648]}, {"w": "the", "b": [0.522, 0.345, 0.5556, 0.3648]}, {"w": "indices", "b": [0.5619, 0.345, 0.6362, 0.3648]}, {"w": "are", "b": [0.6425, 0.345, 0.677, 0.3648]}, {"w": "offset", "b": [0.6833, 0.345, 0.7422, 0.3648]}, {"w": "by", "b": [0.7485, 0.345, 0.7751, 0.3648]}, {"w": "3", "b": [0.7814, 0.345, 0.794, 0.3648]}, {"w": "because", "b": [0.1799, 0.3655, 0.2639, 0.3853]}, {"w": "0,", "b": [0.2702, 0.3655, 0.2892, 0.3853]}, {"w": "1,", "b": [0.2955, 0.3655, 0.3144, 0.3853]}, {"w": "and", "b": [0.3207, 0.3655, 0.3614, 0.3853]}, {"w": "2", "b": [0.3677, 0.3655, 0.3803, 0.3853]}, {"w": "are", "b": [0.3866, 0.3655, 0.4212, 0.3853]}, {"w": "reserved", "b": [0.4275, 0.3655, 0.5194, 0.3853]}, {"w": "indices", "b": [0.5258, 0.3655, 0.6, 0.3853]}, {"w": "for", "b": [0.6063, 0.3655, 0.6386, 0.3853]}, {"w": "“padding,”", "b": [0.6449, 0.3655, 0.7647, 0.3853]}, {"w": "“start", "b": [0.771, 0.3655, 0.8341, 0.3853]}, {"w": "of", "b": [0.8404, 0.3655, 0.8614, 0.3853]}, {"w": "sequence,”", "b": [0.1799, 0.386, 0.2955, 0.4058]}, {"w": "and", "b": [0.3018, 0.386, 0.3424, 0.4058]}, {"w": "“unknown.”", "b": [0.3487, 0.386, 0.4812, 0.4058]}]}, {"id": "b_3", "type": "paragraph", "text": "3.4.2. Preparing the data", "words": [{"w": "3.4.2.", "b": [0.1294, 0.4333, 0.1862, 0.453]}, {"w": "Preparing", "b": [0.1925, 0.4333, 0.3013, 0.453]}, {"w": "the", "b": [0.3076, 0.4333, 0.3412, 0.453]}, {"w": "data", "b": [0.3476, 0.4333, 0.3952, 0.453]}]}, {"id": "b_4", "type": "paragraph", "text": "You can’t feed lists of integers into a neural network. You have to turn your lists into tensors. There are two ways to do that:", "words": [{"w": "You", "b": [0.1294, 0.4761, 0.1703, 0.4958]}, {"w": "can’t", "b": [0.1766, 0.4761, 0.2266, 0.4958]}, {"w": "feed", "b": [0.2329, 0.4761, 0.2763, 0.4958]}, {"w": "lists", "b": [0.2826, 0.4761, 0.3233, 0.4958]}, {"w": "of", "b": [0.3296, 0.4761, 0.3506, 0.4958]}, {"w": "integers", "b": [0.3569, 0.4761, 0.4368, 0.4958]}, {"w": "into", "b": [0.4431, 0.4761, 0.4823, 0.4958]}, {"w": "a", "b": [0.4886, 0.4761, 0.4998, 0.4958]}, {"w": "neural", "b": [0.5062, 0.4761, 0.5692, 0.4958]}, {"w": "network.", "b": [0.5755, 0.4761, 0.6645, 0.4958]}, {"w": "You", "b": [0.6708, 0.4761, 0.7116, 0.4958]}, {"w": "have", "b": [0.7179, 0.4761, 0.7656, 0.4958]}, {"w": "to", "b": [0.7719, 0.4761, 0.7915, 0.4958]}, {"w": "turn", "b": [0.7978, 0.4761, 0.8384, 0.4958]}, {"w": "your", "b": [0.1294, 0.4966, 0.1757, 0.5163]}, {"w": "lists", "b": [0.182, 0.4966, 0.2226, 0.5163]}, {"w": "into", "b": [0.2289, 0.4966, 0.2682, 0.5163]}, {"w": "tensors.", "b": [0.2745, 0.4966, 0.3523, 0.5163]}, {"w": "There", "b": [0.3586, 0.4966, 0.4174, 0.5163]}, {"w": "are", "b": [0.4237, 0.4966, 0.4545, 0.5163]}, {"w": "two", "b": [0.4608, 0.4966, 0.4986, 0.5163]}, {"w": "ways", "b": [0.5049, 0.4966, 0.5568, 0.5163]}, {"w": "to", "b": [0.5631, 0.4966, 0.5827, 0.5163]}, {"w": "do", "b": [0.589, 0.4966, 0.6143, 0.5163]}, {"w": "that:", "b": [0.6205, 0.4966, 0.6654, 0.5163]}]}, {"id": "b_5", "type": "paragraph", "text": "Pad your lists so that they all have the same length, turn them into an integer tensor of shape (samples, word_indices), and then use as the first layer in your network a layer capable of handling such integer tensors (the Embedding layer, which we’ll cover in detail later in the book). One-hot encode your lists to turn them into vectors of 0s and 1s. This would mean, for instance, turning the sequence [3, 5] into a 10,000-dimensional vector that would be all 0s except for indices 3 and 5, which would be 1s. Then you could use as the first layer in your network a Dense layer, capable of handling floating-point vector data.", "words": [{"w": "Pad", "b": [0.1799, 0.5349, 0.2177, 0.5546]}, {"w": "your", "b": [0.224, 0.5349, 0.2702, 0.5546]}, {"w": "lists", "b": [0.2766, 0.5349, 0.3172, 0.5546]}, {"w": "so", "b": [0.3235, 0.5349, 0.3459, 0.5546]}, {"w": "that", "b": [0.3523, 0.5349, 0.3901, 0.5546]}, {"w": "they", "b": [0.3964, 0.5349, 0.4398, 0.5546]}, {"w": "all", "b": [0.4461, 0.5349, 0.4714, 0.5546]}, {"w": "have", "b": [0.4777, 0.5349, 0.5253, 0.5546]}, {"w": "the", "b": [0.5316, 0.5349, 0.5624, 0.5546]}, {"w": "same", "b": [0.5687, 0.5349, 0.6206, 0.5546]}, {"w": "length,", "b": [0.6269, 0.5349, 0.6963, 0.5546]}, {"w": "turn", "b": [0.7026, 0.5349, 0.7432, 0.5546]}, {"w": "them", "b": [0.7495, 0.5349, 0.8, 0.5546]}, {"w": "into", "b": [0.8063, 0.5349, 0.8455, 0.5546]}, {"w": "an", "b": [0.1799, 0.5554, 0.2037, 0.5751]}, {"w": "integer", "b": [0.21, 0.5554, 0.28, 0.5751]}, {"w": "tensor", "b": [0.2863, 0.5554, 0.348, 0.5751]}, {"w": "of", "b": [0.3543, 0.5554, 0.3753, 0.5751]}, {"w": "shape", "b": [0.3816, 0.5554, 0.4391, 0.5751]}, {"w": "(samples,", "b": [0.4453, 0.5564, 0.5815, 0.5766]}, {"w": "word_indices),", "b": [0.5967, 0.5554, 0.7998, 0.5766]}, {"w": "and", "b": [0.8061, 0.5554, 0.8425, 0.5751]}, {"w": "then", "b": [0.1799, 0.5768, 0.2233, 0.5965]}, {"w": "use", "b": [0.2296, 0.5768, 0.2632, 0.5965]}, {"w": "as", "b": [0.2695, 0.5768, 0.2906, 0.5965]}, {"w": "the", "b": [0.2969, 0.5768, 0.3277, 0.5965]}, {"w": "first", "b": [0.334, 0.5768, 0.3746, 0.5965]}, {"w": "layer", "b": [0.3809, 0.5768, 0.4314, 0.5965]}, {"w": "in", "b": [0.4377, 0.5768, 0.4573, 0.5965]}, {"w": "your", "b": [0.4636, 0.5768, 0.5098, 0.5965]}, {"w": "network", "b": [0.5161, 0.5768, 0.5988, 0.5965]}, {"w": "a", "b": [0.6051, 0.5768, 0.6163, 0.5965]}, {"w": "layer", "b": [0.6226, 0.5768, 0.6731, 0.5965]}, {"w": "capable", "b": [0.6794, 0.5768, 0.7564, 0.5965]}, {"w": "of", "b": [0.7627, 0.5768, 0.7837, 0.5965]}, {"w": "handling", "b": [0.1799, 0.5973, 0.2682, 0.617]}, {"w": "such", "b": [0.2745, 0.5973, 0.3207, 0.617]}, {"w": "integer", "b": [0.327, 0.5973, 0.3971, 0.617]}, {"w": "tensors", "b": [0.4034, 0.5973, 0.4748, 0.617]}, {"w": "(the", "b": [0.4811, 0.5973, 0.5204, 0.617]}, {"w": "Embedding", "b": [0.5266, 0.5983, 0.6628, 0.6185]}, {"w": "layer,", "b": [0.6692, 0.5973, 0.7249, 0.617]}, {"w": "which", "b": [0.7312, 0.5973, 0.7928, 0.617]}, {"w": "we’ll", "b": [0.7991, 0.5973, 0.851, 0.617]}, {"w": "cover", "b": [0.1799, 0.6187, 0.2359, 0.6384]}, {"w": "in", "b": [0.2422, 0.6187, 0.2618, 0.6384]}, {"w": "detail", "b": [0.2681, 0.6187, 0.3242, 0.6384]}, {"w": "later", "b": [0.3305, 0.6187, 0.3753, 0.6384]}, {"w": "in", "b": [0.3816, 0.6187, 0.4012, 0.6384]}, {"w": "the", "b": [0.4076, 0.6187, 0.4384, 0.6384]}, {"w": "book).", "b": [0.4447, 0.6187, 0.5098, 0.6384]}, {"w": "One-hot", "b": [0.1799, 0.6392, 0.2625, 0.6589]}, {"w": "encode", "b": [0.2688, 0.6392, 0.3403, 0.6589]}, {"w": "your", "b": [0.3466, 0.6392, 0.3928, 0.6589]}, {"w": "lists", "b": [0.3991, 0.6392, 0.4398, 0.6589]}, {"w": "to", "b": [0.4461, 0.6392, 0.4657, 0.6589]}, {"w": "turn", "b": [0.472, 0.6392, 0.5127, 0.6589]}, {"w": "them", "b": [0.519, 0.6392, 0.5694, 0.6589]}, {"w": "into", "b": [0.5757, 0.6392, 0.615, 0.6589]}, {"w": "vectors", "b": [0.6213, 0.6392, 0.6941, 0.6589]}, {"w": "of", "b": [0.7004, 0.6392, 0.7215, 0.6589]}, {"w": "0s", "b": [0.7278, 0.6392, 0.7502, 0.6589]}, {"w": "and", "b": [0.7565, 0.6392, 0.7929, 0.6589]}, {"w": "1s.", "b": [0.7992, 0.6392, 0.828, 0.6589]}, {"w": "This", "b": [0.1799, 0.6597, 0.2247, 0.6794]}, {"w": "would", "b": [0.231, 0.6597, 0.2941, 0.6794]}, {"w": "mean,", "b": [0.3004, 0.6597, 0.3613, 0.6794]}, {"w": "for", "b": [0.3676, 0.6597, 0.3971, 0.6794]}, {"w": "instance,", "b": [0.4034, 0.6597, 0.4923, 0.6794]}, {"w": "turning", "b": [0.4986, 0.6597, 0.5715, 0.6794]}, {"w": "the", "b": [0.5778, 0.6597, 0.6087, 0.6794]}, {"w": "sequence", "b": [0.615, 0.6597, 0.7074, 0.6794]}, {"w": "[3,", "b": [0.7136, 0.6607, 0.7591, 0.6809]}, {"w": "5]", "b": [0.7742, 0.6607, 0.8045, 0.6809]}, {"w": "into", "b": [0.8108, 0.6597, 0.85, 0.6794]}, {"w": "a", "b": [0.8563, 0.6597, 0.8675, 0.6794]}, {"w": "10,000-dimensional", "b": [0.1799, 0.6811, 0.381, 0.7008]}, {"w": "vector", "b": [0.3873, 0.6811, 0.4503, 0.7008]}, {"w": "that", "b": [0.4566, 0.6811, 0.4945, 0.7008]}, {"w": "would", "b": [0.5008, 0.6811, 0.5638, 0.7008]}, {"w": "be", "b": [0.5701, 0.6811, 0.5939, 0.7008]}, {"w": "all", "b": [0.6003, 0.6811, 0.6255, 0.7008]}, {"w": "0s", "b": [0.6318, 0.6811, 0.6542, 0.7008]}, {"w": "except", "b": [0.6605, 0.6811, 0.7264, 0.7008]}, {"w": "for", "b": [0.7327, 0.6811, 0.7621, 0.7008]}, {"w": "indices", "b": [0.7684, 0.6811, 0.8398, 0.7008]}, {"w": "3", "b": [0.8462, 0.6811, 0.8588, 0.7008]}, {"w": "and", "b": [0.1799, 0.7016, 0.2163, 0.7213]}, {"w": "5,", "b": [0.2226, 0.7016, 0.2415, 0.7213]}, {"w": "which", "b": [0.2478, 0.7016, 0.3095, 0.7213]}, {"w": "would", "b": [0.3158, 0.7016, 0.3788, 0.7213]}, {"w": "be", "b": [0.3852, 0.7016, 0.409, 0.7213]}, {"w": "1s.", "b": [0.4153, 0.7016, 0.444, 0.7213]}, {"w": "Then", "b": [0.4503, 0.7016, 0.5021, 0.7213]}, {"w": "you", "b": [0.5085, 0.7016, 0.5463, 0.7213]}, {"w": "could", "b": [0.5526, 0.7016, 0.6087, 0.7213]}, {"w": "use", "b": [0.615, 0.7016, 0.6486, 0.7213]}, {"w": "as", "b": [0.6549, 0.7016, 0.6759, 0.7213]}, {"w": "the", "b": [0.6822, 0.7016, 0.713, 0.7213]}, {"w": "first", "b": [0.7193, 0.7016, 0.7599, 0.7213]}, {"w": "layer", "b": [0.7662, 0.7016, 0.8167, 0.7213]}, {"w": "in", "b": [0.823, 0.7016, 0.8426, 0.7213]}, {"w": "your", "b": [0.1799, 0.7221, 0.2261, 0.7418]}, {"w": "network", "b": [0.2324, 0.7221, 0.3151, 0.7418]}, {"w": "a", "b": [0.3214, 0.7221, 0.3326, 0.7418]}, {"w": "Dense", "b": [0.3389, 0.7231, 0.4145, 0.7433]}, {"w": "layer,", "b": [0.4208, 0.7221, 0.4766, 0.7418]}, {"w": "capable", "b": [0.4829, 0.7221, 0.5599, 0.7418]}, {"w": "of", "b": [0.5662, 0.7221, 0.5872, 0.7418]}, {"w": "handling", "b": [0.5935, 0.7221, 0.6818, 0.7418]}, {"w": "floating-point", "b": [0.6881, 0.7221, 0.8269, 0.7418]}, {"w": "vector", "b": [0.1799, 0.7435, 0.2429, 0.7632]}, {"w": "data.", "b": [0.2492, 0.7435, 0.2975, 0.7632]}]}, {"id": "b_6", "type": "paragraph", "text": "Let’s go with the latter solution to vectorize the data, which you’ll do manually for maximum clarity.", "words": [{"w": "Let’s", "b": [0.1294, 0.7863, 0.1798, 0.806]}, {"w": "go", "b": [0.1862, 0.7863, 0.2114, 0.806]}, {"w": "with", "b": [0.2177, 0.7863, 0.2625, 0.806]}, {"w": "the", "b": [0.2688, 0.7863, 0.2997, 0.806]}, {"w": "latter", "b": [0.306, 0.7863, 0.3578, 0.806]}, {"w": "solution", "b": [0.3641, 0.7863, 0.4454, 0.806]}, {"w": "to", "b": [0.4517, 0.7863, 0.4714, 0.806]}, {"w": "vectorize", "b": [0.4777, 0.7863, 0.5701, 0.806]}, {"w": "the", "b": [0.5764, 0.7863, 0.6072, 0.806]}, {"w": "data,", "b": [0.6136, 0.7863, 0.6619, 0.806]}, {"w": "which", "b": [0.6682, 0.7863, 0.7298, 0.806]}, {"w": "you’ll", "b": [0.7362, 0.7863, 0.7964, 0.806]}, {"w": "do", "b": [0.8027, 0.7863, 0.8279, 0.806]}, {"w": "manually", "b": [0.1294, 0.8067, 0.2233, 0.8265]}, {"w": "for", "b": [0.2296, 0.8067, 0.259, 0.8265]}, {"w": "maximum", "b": [0.2653, 0.8067, 0.3676, 0.8265]}, {"w": "clarity.", "b": [0.374, 0.8067, 0.443, 0.8265]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 3.2. Encoding the integer sequences into a binary matrix", "words": [{"w": "Listing", "b": [0.1294, 0.8446, 0.1862, 0.8594]}, {"w": "3.2.", "b": [0.1909, 0.8446, 0.2193, 0.8594]}, {"w": "Encoding", "b": [0.224, 0.8446, 0.3008, 0.8594]}, {"w": "the", "b": [0.3055, 0.8446, 0.3307, 0.8594]}, {"w": "integer", "b": [0.3354, 0.8446, 0.3922, 0.8594]}, {"w": "sequences", "b": [0.3969, 0.8446, 0.4768, 0.8594]}, {"w": "into", "b": [0.4815, 0.8446, 0.5131, 0.8594]}, {"w": "a", "b": [0.5178, 0.8446, 0.5272, 0.8594]}, {"w": "binary", "b": [0.532, 0.8446, 0.5856, 0.8594]}, {"w": "matrix", "b": [0.5903, 0.8446, 0.645, 0.8594]}]}, {"id": "b_8", "type": "paragraph", "text": "import numpy as np", "words": [{"w": "import", "b": [0.1357, 0.873, 0.2038, 0.8882]}, {"w": "numpy", "b": [0.2152, 0.873, 0.2719, 0.8882]}, {"w": "as", "b": [0.2833, 0.873, 0.306, 0.8882]}, {"w": "np", "b": [0.3173, 0.873, 0.34, 0.8882]}]}]}, {"page": 109, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "def vectorize_sequences(sequences, dimension=10000): results = np.zeros((len(sequences), dimension)) 1 for i, sequence in enumerate(sequences): results[i, sequence] = 1. 2 return results x_train = vectorize_sequences(train_data) 3 x_test = vectorize_sequences(test_data) 4", "words": [{"w": "def", "b": [0.1357, 0.0851, 0.1698, 0.1002]}, {"w": "vectorize_sequences(sequences,", "b": [0.1811, 0.0851, 0.5217, 0.1002]}, {"w": "dimension=10000):", "b": [0.533, 0.0851, 0.726, 0.1002]}, {"w": "results", "b": [0.1811, 0.1002, 0.2606, 0.1154]}, {"w": "=", "b": [0.2719, 0.1002, 0.2833, 0.1154]}, {"w": "np.zeros((len(sequences),", "b": [0.2946, 0.1002, 0.5784, 0.1154]}, {"w": "dimension))", "b": [0.5898, 0.1002, 0.7146, 0.1154]}, {"w": "1", "b": [0.8056, 0.1002, 0.8169, 0.1154]}, {"w": "for", "b": [0.1811, 0.1154, 0.2152, 0.1305]}, {"w": "i,", "b": [0.2265, 0.1154, 0.2492, 0.1305]}, {"w": "sequence", "b": [0.2606, 0.1154, 0.3514, 0.1305]}, {"w": "in", "b": [0.3628, 0.1154, 0.3855, 0.1305]}, {"w": "enumerate(sequences):", "b": [0.3968, 0.1154, 0.6352, 0.1305]}, {"w": "results[i,", "b": [0.2265, 0.1305, 0.34, 0.1457]}, {"w": "sequence]", "b": [0.3514, 0.1305, 0.4536, 0.1457]}, {"w": "=", "b": [0.4649, 0.1305, 0.4763, 0.1457]}, {"w": "1.", "b": [0.4876, 0.1305, 0.5103, 0.1457]}, {"w": "2", "b": [0.8056, 0.1305, 0.8169, 0.1457]}, {"w": "return", "b": [0.1811, 0.1457, 0.2492, 0.1608]}, {"w": "results", "b": [0.2606, 0.1457, 0.34, 0.1608]}, {"w": "x_train", "b": [0.1357, 0.176, 0.2152, 0.1911]}, {"w": "=", "b": [0.2265, 0.176, 0.2379, 0.1911]}, {"w": "vectorize_sequences(train_data)", "b": [0.2492, 0.176, 0.6011, 0.1911]}, {"w": "3", "b": [0.8056, 0.176, 0.8169, 0.1911]}, {"w": "x_test", "b": [0.1357, 0.1912, 0.2038, 0.2063]}, {"w": "=", "b": [0.2152, 0.1912, 0.2265, 0.2063]}, {"w": "vectorize_sequences(test_data)", "b": [0.2379, 0.1912, 0.5784, 0.2063]}, {"w": "4", "b": [0.8056, 0.1912, 0.8169, 0.2063]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Creates an all-zero matrix of shape (len(sequences), dimension) 2 Sets specific indices of results[i] to 1s 3 Vectorized training data 4 Vectorized test data", "words": [{"w": "1", "b": [0.1799, 0.2247, 0.1925, 0.2445]}, {"w": "Creates", "b": [0.1988, 0.2247, 0.281, 0.2445]}, {"w": "an", "b": [0.2873, 0.2247, 0.3139, 0.2445]}, {"w": "all-zero", "b": [0.3202, 0.2247, 0.401, 0.2445]}, {"w": "matrix", "b": [0.4073, 0.2247, 0.4802, 0.2445]}, {"w": "of", "b": [0.4865, 0.2247, 0.5075, 0.2445]}, {"w": "shape", "b": [0.5138, 0.2247, 0.5755, 0.2445]}, {"w": "(len(sequences),", "b": [0.5818, 0.2247, 0.752, 0.2445]}, {"w": "dimension)", "b": [0.1799, 0.2452, 0.299, 0.265]}, {"w": "2", "b": [0.1799, 0.2657, 0.1925, 0.2855]}, {"w": "Sets", "b": [0.1988, 0.2657, 0.2422, 0.2855]}, {"w": "specific", "b": [0.2485, 0.2657, 0.3284, 0.2855]}, {"w": "indices", "b": [0.3347, 0.2657, 0.409, 0.2855]}, {"w": "of", "b": [0.4153, 0.2657, 0.4363, 0.2855]}, {"w": "results[i]", "b": [0.4426, 0.2657, 0.5374, 0.2855]}, {"w": "to", "b": [0.5437, 0.2657, 0.5647, 0.2855]}, {"w": "1s", "b": [0.571, 0.2657, 0.5935, 0.2855]}, {"w": "3", "b": [0.1799, 0.2862, 0.1925, 0.306]}, {"w": "Vectorized", "b": [0.1988, 0.2862, 0.3127, 0.306]}, {"w": "training", "b": [0.319, 0.2862, 0.4059, 0.306]}, {"w": "data", "b": [0.4123, 0.2862, 0.4599, 0.306]}, {"w": "4", "b": [0.1799, 0.3067, 0.1925, 0.3265]}, {"w": "Vectorized", "b": [0.1988, 0.3067, 0.3127, 0.3265]}, {"w": "test", "b": [0.319, 0.3067, 0.3569, 0.3265]}, {"w": "data", "b": [0.3632, 0.3067, 0.4108, 0.3265]}]}, {"id": "b_2", "type": "paragraph", "text": "Here’s what the samples look like now:", "words": [{"w": "Here’s", "b": [0.1294, 0.3495, 0.1952, 0.3692]}, {"w": "what", "b": [0.2016, 0.3495, 0.2506, 0.3692]}, {"w": "the", "b": [0.2569, 0.3495, 0.2877, 0.3692]}, {"w": "samples", "b": [0.294, 0.3495, 0.3753, 0.3692]}, {"w": "look", "b": [0.3816, 0.3495, 0.4265, 0.3692]}, {"w": "like", "b": [0.4328, 0.3495, 0.4706, 0.3692]}, {"w": "now:", "b": [0.4769, 0.3495, 0.5274, 0.3692]}]}, {"id": "b_3", "type": "equation", "text": ">>> x_train[0] array([ 0., 1., 1., ..., 0., 0., 0.])", "words": [{"w": ">>>", "b": [0.1357, 0.3872, 0.1698, 0.4024]}, {"w": "x_train[0]", "b": [0.1811, 0.3872, 0.2946, 0.4024]}, {"w": "array([", "b": [0.1357, 0.4024, 0.2152, 0.4175]}, {"w": "0.,", "b": [0.2265, 0.4024, 0.2606, 0.4175]}, {"w": "1.,", "b": [0.2833, 0.4024, 0.3173, 0.4175]}, {"w": "1.,", "b": [0.34, 0.4024, 0.3741, 0.4175]}, {"w": "...,", "b": [0.3855, 0.4024, 0.4309, 0.4175]}, {"w": "0.,", "b": [0.4536, 0.4024, 0.4876, 0.4175]}, {"w": "0.,", "b": [0.5103, 0.4024, 0.5444, 0.4175]}, {"w": "0.])", "b": [0.5671, 0.4024, 0.6125, 0.4175]}]}, {"id": "b_4", "type": "paragraph", "text": "You should also vectorize your labels, which is straightforward:", "words": [{"w": "You", "b": [0.1294, 0.4404, 0.1703, 0.4602]}, {"w": "should", "b": [0.1766, 0.4404, 0.2439, 0.4602]}, {"w": "also", "b": [0.2502, 0.4404, 0.2909, 0.4602]}, {"w": "vectorize", "b": [0.2972, 0.4404, 0.3896, 0.4602]}, {"w": "your", "b": [0.3959, 0.4404, 0.4422, 0.4602]}, {"w": "labels,", "b": [0.4485, 0.4404, 0.5136, 0.4602]}, {"w": "which", "b": [0.5199, 0.4404, 0.5816, 0.4602]}, {"w": "is", "b": [0.5879, 0.4404, 0.6047, 0.4602]}, {"w": "straightforward:", "b": [0.611, 0.4404, 0.7736, 0.4602]}]}, {"id": "b_5", "type": "paragraph", "text": "y_train = np.asarray(train_labels).astype('float32') y_test = np.asarray(test_labels).astype('float32')", "words": [{"w": "y_train", "b": [0.1357, 0.4782, 0.2152, 0.4933]}, {"w": "=", "b": [0.2265, 0.4782, 0.2379, 0.4933]}, {"w": "np.asarray(train_labels).astype('float32')", "b": [0.2492, 0.4782, 0.726, 0.4933]}, {"w": "y_test", "b": [0.1357, 0.4933, 0.2038, 0.5085]}, {"w": "=", "b": [0.2152, 0.4933, 0.2265, 0.5085]}, {"w": "np.asarray(test_labels).astype('float32')", "b": [0.2379, 0.4933, 0.7033, 0.5085]}]}, {"id": "b_6", "type": "paragraph", "text": "Now the data is ready to be fed into a neural network.", "words": [{"w": "Now", "b": [0.1294, 0.5313, 0.1785, 0.5511]}, {"w": "the", "b": [0.1848, 0.5313, 0.2156, 0.5511]}, {"w": "data", "b": [0.2219, 0.5313, 0.2639, 0.5511]}, {"w": "is", "b": [0.2702, 0.5313, 0.287, 0.5511]}, {"w": "ready", "b": [0.2934, 0.5313, 0.3494, 0.5511]}, {"w": "to", "b": [0.3557, 0.5313, 0.3753, 0.5511]}, {"w": "be", "b": [0.3816, 0.5313, 0.4054, 0.5511]}, {"w": "fed", "b": [0.4117, 0.5313, 0.444, 0.5511]}, {"w": "into", "b": [0.4503, 0.5313, 0.4895, 0.5511]}, {"w": "a", "b": [0.4958, 0.5313, 0.507, 0.5511]}, {"w": "neural", "b": [0.5133, 0.5313, 0.5764, 0.5511]}, {"w": "network.", "b": [0.5827, 0.5313, 0.6716, 0.5511]}]}, {"id": "b_7", "type": "paragraph", "text": "3.4.3. Building your network", "words": [{"w": "3.4.3.", "b": [0.1294, 0.5786, 0.1862, 0.5983]}, {"w": "Building", "b": [0.1925, 0.5786, 0.285, 0.5983]}, {"w": "your", "b": [0.2913, 0.5786, 0.3418, 0.5983]}, {"w": "network", "b": [0.3481, 0.5786, 0.4378, 0.5983]}]}, {"id": "b_8", "type": "paragraph", "text": "The input data is vectors, and the labels are scalars (1s and 0s): this is the easiest setup you’ll ever encounter. A type of network that performs well on such a problem is a simple stack of fully connected (Dense) layers with relu activations: Dense(16, activation='relu').", "words": [{"w": "The", "b": [0.1294, 0.6214, 0.1686, 0.6411]}, {"w": "input", "b": [0.1749, 0.6214, 0.2268, 0.6411]}, {"w": "data", "b": [0.2331, 0.6214, 0.2751, 0.6411]}, {"w": "is", "b": [0.2814, 0.6214, 0.2983, 0.6411]}, {"w": "vectors,", "b": [0.3046, 0.6214, 0.3837, 0.6411]}, {"w": "and", "b": [0.39, 0.6214, 0.4265, 0.6411]}, {"w": "the", "b": [0.4328, 0.6214, 0.4636, 0.6411]}, {"w": "labels", "b": [0.4699, 0.6214, 0.5288, 0.6411]}, {"w": "are", "b": [0.5351, 0.6214, 0.5659, 0.6411]}, {"w": "scalars", "b": [0.5722, 0.6214, 0.6408, 0.6411]}, {"w": "(1s", "b": [0.6471, 0.6214, 0.6779, 0.6411]}, {"w": "and", "b": [0.6843, 0.6214, 0.7207, 0.6411]}, {"w": "0s):", "b": [0.727, 0.6214, 0.7648, 0.6411]}, {"w": "this", "b": [0.7711, 0.6214, 0.8076, 0.6411]}, {"w": "is", "b": [0.8139, 0.6214, 0.8307, 0.6411]}, {"w": "the", "b": [0.837, 0.6214, 0.8678, 0.6411]}, {"w": "easiest", "b": [0.1294, 0.6419, 0.1967, 0.6616]}, {"w": "setup", "b": [0.203, 0.6419, 0.2562, 0.6616]}, {"w": "you’ll", "b": [0.2625, 0.6419, 0.3228, 0.6616]}, {"w": "ever", "b": [0.3291, 0.6419, 0.3725, 0.6616]}, {"w": "encounter.", "b": [0.3788, 0.6419, 0.4832, 0.6616]}, {"w": "A", "b": [0.4895, 0.6419, 0.5077, 0.6616]}, {"w": "type", "b": [0.514, 0.6419, 0.5574, 0.6616]}, {"w": "of", "b": [0.5637, 0.6419, 0.5847, 0.6616]}, {"w": "network", "b": [0.591, 0.6419, 0.6737, 0.6616]}, {"w": "that", "b": [0.68, 0.6419, 0.7178, 0.6616]}, {"w": "performs", "b": [0.7241, 0.6419, 0.8152, 0.6616]}, {"w": "well", "b": [0.8215, 0.6419, 0.865, 0.6616]}, {"w": "on", "b": [0.1294, 0.6624, 0.1546, 0.6821]}, {"w": "such", "b": [0.1609, 0.6624, 0.2072, 0.6821]}, {"w": "a", "b": [0.2135, 0.6624, 0.2247, 0.6821]}, {"w": "problem", "b": [0.231, 0.6624, 0.3151, 0.6821]}, {"w": "is", "b": [0.3214, 0.6624, 0.3382, 0.6821]}, {"w": "a", "b": [0.3445, 0.6624, 0.3557, 0.6821]}, {"w": "simple", "b": [0.362, 0.6624, 0.4293, 0.6821]}, {"w": "stack", "b": [0.4356, 0.6624, 0.4874, 0.6821]}, {"w": "of", "b": [0.4937, 0.6624, 0.5148, 0.6821]}, {"w": "fully", "b": [0.5211, 0.6624, 0.5687, 0.6821]}, {"w": "connected", "b": [0.575, 0.6624, 0.6773, 0.6821]}, {"w": "(Dense)", "b": [0.6836, 0.6624, 0.776, 0.6836]}, {"w": "layers", "b": [0.7823, 0.6624, 0.8425, 0.6821]}, {"w": "with", "b": [0.1294, 0.6838, 0.1743, 0.7035]}, {"w": "relu", "b": [0.1806, 0.6848, 0.2411, 0.705]}, {"w": "activations:", "b": [0.2474, 0.6838, 0.3637, 0.7035]}, {"w": "Dense(16,", "b": [0.37, 0.6848, 0.5062, 0.705]}, {"w": "activation='relu').", "b": [0.5125, 0.6838, 0.7913, 0.705]}]}, {"id": "b_9", "type": "paragraph", "text": "The argument being passed to each Dense layer (16) is the number of hidden units of the layer. A hidden unit is a dimension in the representation space of the layer. You may remember from chapter 2 that each such Dense layer with a relu activation implements the following chain of tensor operations:", "words": [{"w": "The", "b": [0.1294, 0.7274, 0.1686, 0.7472]}, {"w": "argument", "b": [0.1749, 0.7274, 0.2698, 0.7472]}, {"w": "being", "b": [0.2761, 0.7274, 0.3321, 0.7472]}, {"w": "passed", "b": [0.3384, 0.7274, 0.4057, 0.7472]}, {"w": "to", "b": [0.412, 0.7274, 0.4316, 0.7472]}, {"w": "each", "b": [0.4379, 0.7274, 0.4841, 0.7472]}, {"w": "Dense", "b": [0.4904, 0.7285, 0.5661, 0.7487]}, {"w": "layer", "b": [0.5724, 0.7274, 0.6228, 0.7472]}, {"w": "(16)", "b": [0.6291, 0.7274, 0.6711, 0.7472]}, {"w": "is", "b": [0.6774, 0.7274, 0.6943, 0.7472]}, {"w": "the", "b": [0.7006, 0.7274, 0.7314, 0.7472]}, {"w": "number", "b": [0.7377, 0.7274, 0.8148, 0.7472]}, {"w": "of", "b": [0.8211, 0.7274, 0.8421, 0.7472]}, {"w": "hidden", "b": [0.1294, 0.7488, 0.1981, 0.7686]}, {"w": "units", "b": [0.2044, 0.7488, 0.2534, 0.7686]}, {"w": "of", "b": [0.2598, 0.7488, 0.2808, 0.7686]}, {"w": "the", "b": [0.2871, 0.7488, 0.3179, 0.7686]}, {"w": "layer.", "b": [0.3242, 0.7488, 0.3795, 0.7686]}, {"w": "A", "b": [0.3858, 0.7488, 0.404, 0.7686]}, {"w": "hidden", "b": [0.4103, 0.7488, 0.479, 0.7686]}, {"w": "unit", "b": [0.4853, 0.7488, 0.5246, 0.7686]}, {"w": "is", "b": [0.5309, 0.7488, 0.5477, 0.7686]}, {"w": "a", "b": [0.554, 0.7488, 0.5652, 0.7686]}, {"w": "dimension", "b": [0.5715, 0.7488, 0.6766, 0.7686]}, {"w": "in", "b": [0.6829, 0.7488, 0.7025, 0.7686]}, {"w": "the", "b": [0.7088, 0.7488, 0.7397, 0.7686]}, {"w": "representation", "b": [0.1294, 0.7693, 0.2723, 0.7891]}, {"w": "space", "b": [0.2786, 0.7693, 0.3346, 0.7891]}, {"w": "of", "b": [0.341, 0.7693, 0.362, 0.7891]}, {"w": "the", "b": [0.3683, 0.7693, 0.3991, 0.7891]}, {"w": "layer.", "b": [0.4054, 0.7693, 0.4607, 0.7891]}, {"w": "You", "b": [0.467, 0.7693, 0.5079, 0.7891]}, {"w": "may", "b": [0.5142, 0.7693, 0.5577, 0.7891]}, {"w": "remember", "b": [0.564, 0.7693, 0.6662, 0.7891]}, {"w": "from", "b": [0.6725, 0.7693, 0.7216, 0.7891]}, {"w": "chapter", "b": [0.7279, 0.7693, 0.8021, 0.7891]}, {"w": "2", "b": [0.8084, 0.7693, 0.821, 0.7891]}, {"w": "that", "b": [0.8273, 0.7693, 0.8651, 0.7891]}, {"w": "each", "b": [0.1294, 0.7898, 0.1756, 0.8096]}, {"w": "such", "b": [0.1819, 0.7898, 0.2282, 0.8096]}, {"w": "Dense", "b": [0.2345, 0.7909, 0.3101, 0.8111]}, {"w": "layer", "b": [0.3164, 0.7898, 0.3669, 0.8096]}, {"w": "with", "b": [0.3732, 0.7898, 0.418, 0.8096]}, {"w": "a", "b": [0.4243, 0.7898, 0.4355, 0.8096]}, {"w": "relu", "b": [0.4418, 0.7909, 0.5023, 0.8111]}, {"w": "activation", "b": [0.5086, 0.7898, 0.6081, 0.8096]}, {"w": "implements", "b": [0.6144, 0.7898, 0.7322, 0.8096]}, {"w": "the", "b": [0.7385, 0.7898, 0.7693, 0.8096]}, {"w": "following", "b": [0.1294, 0.8112, 0.2275, 0.8309]}, {"w": "chain", "b": [0.2338, 0.8112, 0.2885, 0.8309]}, {"w": "of", "b": [0.2948, 0.8112, 0.3158, 0.8309]}, {"w": "tensor", "b": [0.3221, 0.8112, 0.3837, 0.8309]}, {"w": "operations:", "b": [0.39, 0.8112, 0.5021, 0.8309]}]}, {"id": "b_10", "type": "equation", "text": "output = relu(dot(W, input) + b)", "words": [{"w": "output", "b": [0.1357, 0.8489, 0.2038, 0.8641]}, {"w": "=", "b": [0.2152, 0.8489, 0.2265, 0.8641]}, {"w": "relu(dot(W,", "b": [0.2379, 0.8489, 0.3628, 0.8641]}, {"w": "input)", "b": [0.3741, 0.8489, 0.4422, 0.8641]}, {"w": "+", "b": [0.4536, 0.8489, 0.4649, 0.8641]}, {"w": "b)", "b": [0.4763, 0.8489, 0.499, 0.8641]}]}]}, {"page": 110, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Having 16 hidden units means the weight matrix W will have shape (input_dimension, 16): the dot product with W will project the input data onto a 16-dimensional representation space (and then you’ll add the bias vector b and apply the relu operation). You can intuitively understand the dimensionality of your representation space as “how much freedom you’re allowing the network to have when learning internal representations.” Having more hidden units (a higher- dimensional representation space) allows your network to learn more- complex representations, but it makes the network more computationally expensive and may lead to learning unwanted patterns (patterns that will improve performance on the training data but not on the test data).", "words": [{"w": "Having", "b": [0.1294, 0.0857, 0.2037, 0.1054]}, {"w": "16", "b": [0.21, 0.0857, 0.2352, 0.1054]}, {"w": "hidden", "b": [0.2415, 0.0857, 0.3102, 0.1054]}, {"w": "units", "b": [0.3165, 0.0857, 0.3656, 0.1054]}, {"w": "means", "b": [0.3719, 0.0857, 0.4363, 0.1054]}, {"w": "the", "b": [0.4426, 0.0857, 0.4734, 0.1054]}, {"w": "weight", "b": [0.4797, 0.0857, 0.5484, 0.1054]}, {"w": "matrix", "b": [0.5547, 0.0857, 0.6206, 0.1054]}, {"w": "W", "b": [0.6268, 0.0867, 0.642, 0.1069]}, {"w": "will", "b": [0.6483, 0.0857, 0.6875, 0.1054]}, {"w": "have", "b": [0.6938, 0.0857, 0.7415, 0.1054]}, {"w": "shape", "b": [0.7478, 0.0857, 0.8052, 0.1054]}, {"w": "(input_dimension,", "b": [0.1294, 0.1081, 0.3867, 0.1283]}, {"w": "16):", "b": [0.4019, 0.1071, 0.4543, 0.1283]}, {"w": "the", "b": [0.4606, 0.1071, 0.4914, 0.1268]}, {"w": "dot", "b": [0.4977, 0.1071, 0.53, 0.1268]}, {"w": "product", "b": [0.5363, 0.1071, 0.6134, 0.1268]}, {"w": "with", "b": [0.6197, 0.1071, 0.6645, 0.1268]}, {"w": "W", "b": [0.6708, 0.1081, 0.6859, 0.1283]}, {"w": "will", "b": [0.6922, 0.1071, 0.7315, 0.1268]}, {"w": "project", "b": [0.7378, 0.1071, 0.8078, 0.1268]}, {"w": "the", "b": [0.8141, 0.1071, 0.845, 0.1268]}, {"w": "input", "b": [0.1294, 0.1285, 0.1813, 0.1482]}, {"w": "data", "b": [0.1876, 0.1285, 0.2296, 0.1482]}, {"w": "onto", "b": [0.2359, 0.1285, 0.2808, 0.1482]}, {"w": "a", "b": [0.2871, 0.1285, 0.2983, 0.1482]}, {"w": "16-dimensional", "b": [0.3046, 0.1285, 0.4615, 0.1482]}, {"w": "representation", "b": [0.4678, 0.1285, 0.6107, 0.1482]}, {"w": "space", "b": [0.6171, 0.1285, 0.6731, 0.1482]}, {"w": "(and", "b": [0.6794, 0.1285, 0.7242, 0.1482]}, {"w": "then", "b": [0.7305, 0.1285, 0.774, 0.1482]}, {"w": "you’ll", "b": [0.7803, 0.1285, 0.8405, 0.1482]}, {"w": "add", "b": [0.1294, 0.149, 0.1658, 0.1687]}, {"w": "the", "b": [0.1721, 0.149, 0.203, 0.1687]}, {"w": "bias", "b": [0.2093, 0.149, 0.2499, 0.1687]}, {"w": "vector", "b": [0.2562, 0.149, 0.3193, 0.1687]}, {"w": "b", "b": [0.3255, 0.15, 0.3407, 0.1702]}, {"w": "and", "b": [0.347, 0.149, 0.3834, 0.1687]}, {"w": "apply", "b": [0.3897, 0.149, 0.4457, 0.1687]}, {"w": "the", "b": [0.4521, 0.149, 0.4829, 0.1687]}, {"w": "relu", "b": [0.4892, 0.15, 0.5497, 0.1702]}, {"w": "operation).", "b": [0.556, 0.149, 0.666, 0.1687]}, {"w": "You", "b": [0.6723, 0.149, 0.7132, 0.1687]}, {"w": "can", "b": [0.7195, 0.149, 0.7545, 0.1687]}, {"w": "intuitively", "b": [0.7608, 0.149, 0.8646, 0.1687]}, {"w": "understand", "b": [0.1294, 0.1704, 0.2401, 0.1901]}, {"w": "the", "b": [0.2464, 0.1704, 0.2772, 0.1901]}, {"w": "dimensionality", "b": [0.2835, 0.1704, 0.4335, 0.1901]}, {"w": "of", "b": [0.4398, 0.1704, 0.4608, 0.1901]}, {"w": "your", "b": [0.4671, 0.1704, 0.5134, 0.1901]}, {"w": "representation", "b": [0.5197, 0.1704, 0.6626, 0.1901]}, {"w": "space", "b": [0.6689, 0.1704, 0.7249, 0.1901]}, {"w": "as", "b": [0.7312, 0.1704, 0.7522, 0.1901]}, {"w": "“how", "b": [0.7585, 0.1704, 0.8132, 0.1901]}, {"w": "much", "b": [0.1294, 0.1909, 0.1855, 0.2106]}, {"w": "freedom", "b": [0.1918, 0.1909, 0.2758, 0.2106]}, {"w": "you’re", "b": [0.2821, 0.1909, 0.348, 0.2106]}, {"w": "allowing", "b": [0.3543, 0.1909, 0.4426, 0.2106]}, {"w": "the", "b": [0.4488, 0.1909, 0.4797, 0.2106]}, {"w": "network", "b": [0.486, 0.1909, 0.5686, 0.2106]}, {"w": "to", "b": [0.5749, 0.1909, 0.5946, 0.2106]}, {"w": "have", "b": [0.6009, 0.1909, 0.6485, 0.2106]}, {"w": "when", "b": [0.6548, 0.1909, 0.7094, 0.2106]}, {"w": "learning", "b": [0.7157, 0.1909, 0.7984, 0.2106]}, {"w": "internal", "b": [0.1294, 0.2114, 0.2065, 0.2311]}, {"w": "representations.”", "b": [0.2128, 0.2114, 0.383, 0.2311]}, {"w": "Having", "b": [0.3893, 0.2114, 0.4636, 0.2311]}, {"w": "more", "b": [0.4699, 0.2114, 0.5217, 0.2311]}, {"w": "hidden", "b": [0.528, 0.2114, 0.5967, 0.2311]}, {"w": "units", "b": [0.603, 0.2114, 0.6521, 0.2311]}, {"w": "(a", "b": [0.6584, 0.2114, 0.678, 0.2311]}, {"w": "higher-", "b": [0.6843, 0.2114, 0.7565, 0.2311]}, {"w": "dimensional", "b": [0.1294, 0.2319, 0.2527, 0.2516]}, {"w": "representation", "b": [0.259, 0.2319, 0.402, 0.2516]}, {"w": "space)", "b": [0.4082, 0.2319, 0.4726, 0.2516]}, {"w": "allows", "b": [0.4789, 0.2319, 0.5448, 0.2516]}, {"w": "your", "b": [0.5511, 0.2319, 0.5973, 0.2516]}, {"w": "network", "b": [0.6036, 0.2319, 0.6863, 0.2516]}, {"w": "to", "b": [0.6926, 0.2319, 0.7122, 0.2516]}, {"w": "learn", "b": [0.7185, 0.2319, 0.769, 0.2516]}, {"w": "more-", "b": [0.7753, 0.2319, 0.8355, 0.2516]}, {"w": "complex", "b": [0.1294, 0.2524, 0.2163, 0.2721]}, {"w": "representations,", "b": [0.2226, 0.2524, 0.3816, 0.2721]}, {"w": "but", "b": [0.3879, 0.2524, 0.4202, 0.2721]}, {"w": "it", "b": [0.4265, 0.2524, 0.4405, 0.2721]}, {"w": "makes", "b": [0.4468, 0.2524, 0.5113, 0.2721]}, {"w": "the", "b": [0.5176, 0.2524, 0.5484, 0.2721]}, {"w": "network", "b": [0.5547, 0.2524, 0.6374, 0.2721]}, {"w": "more", "b": [0.6437, 0.2524, 0.6955, 0.2721]}, {"w": "computationally", "b": [0.7018, 0.2524, 0.8658, 0.2721]}, {"w": "expensive", "b": [0.1294, 0.2729, 0.2303, 0.2926]}, {"w": "and", "b": [0.2366, 0.2729, 0.273, 0.2926]}, {"w": "may", "b": [0.2793, 0.2729, 0.3228, 0.2926]}, {"w": "lead", "b": [0.3291, 0.2729, 0.3711, 0.2926]}, {"w": "to", "b": [0.3774, 0.2729, 0.397, 0.2926]}, {"w": "learning", "b": [0.4033, 0.2729, 0.486, 0.2926]}, {"w": "unwanted", "b": [0.4923, 0.2729, 0.5904, 0.2926]}, {"w": "patterns", "b": [0.5967, 0.2729, 0.6765, 0.2926]}, {"w": "(patterns", "b": [0.6829, 0.2729, 0.7711, 0.2926]}, {"w": "that", "b": [0.7774, 0.2729, 0.8153, 0.2926]}, {"w": "will", "b": [0.8216, 0.2729, 0.8608, 0.2926]}, {"w": "improve", "b": [0.1294, 0.2934, 0.2135, 0.3131]}, {"w": "performance", "b": [0.2198, 0.2934, 0.3473, 0.3131]}, {"w": "on", "b": [0.3536, 0.2934, 0.3788, 0.3131]}, {"w": "the", "b": [0.3851, 0.2934, 0.4159, 0.3131]}, {"w": "training", "b": [0.4222, 0.2934, 0.5007, 0.3131]}, {"w": "data", "b": [0.507, 0.2934, 0.549, 0.3131]}, {"w": "but", "b": [0.5553, 0.2934, 0.5876, 0.3131]}, {"w": "not", "b": [0.5939, 0.2934, 0.6261, 0.3131]}, {"w": "on", "b": [0.6324, 0.2934, 0.6577, 0.3131]}, {"w": "the", "b": [0.664, 0.2934, 0.6948, 0.3131]}, {"w": "test", "b": [0.7011, 0.2934, 0.7361, 0.3131]}, {"w": "data).", "b": [0.7423, 0.2934, 0.7991, 0.3131]}]}, {"id": "b_1", "type": "paragraph", "text": "There are two key architecture decisions to be made about such a stack of Dense layers:", "words": [{"w": "There", "b": [0.1294, 0.3361, 0.1882, 0.3559]}, {"w": "are", "b": [0.1945, 0.3361, 0.2253, 0.3559]}, {"w": "two", "b": [0.2317, 0.3361, 0.2695, 0.3559]}, {"w": "key", "b": [0.2758, 0.3361, 0.3122, 0.3559]}, {"w": "architecture", "b": [0.3185, 0.3361, 0.4376, 0.3559]}, {"w": "decisions", "b": [0.4439, 0.3361, 0.5378, 0.3559]}, {"w": "to", "b": [0.5441, 0.3361, 0.5637, 0.3559]}, {"w": "be", "b": [0.57, 0.3361, 0.5938, 0.3559]}, {"w": "made", "b": [0.6001, 0.3361, 0.6548, 0.3559]}, {"w": "about", "b": [0.6611, 0.3361, 0.7171, 0.3559]}, {"w": "such", "b": [0.7235, 0.3361, 0.7697, 0.3559]}, {"w": "a", "b": [0.776, 0.3361, 0.7872, 0.3559]}, {"w": "stack", "b": [0.7935, 0.3361, 0.8453, 0.3559]}, {"w": "of", "b": [0.1294, 0.3566, 0.1504, 0.3764]}, {"w": "Dense", "b": [0.1567, 0.3577, 0.2324, 0.3779]}, {"w": "layers:", "b": [0.2387, 0.3566, 0.306, 0.3764]}]}, {"id": "b_2", "type": "paragraph", "text": "How many layers to use How many hidden units to choose for each layer", "words": [{"w": "How", "b": [0.1799, 0.3959, 0.2289, 0.4156]}, {"w": "many", "b": [0.2352, 0.3959, 0.2913, 0.4156]}, {"w": "layers", "b": [0.2976, 0.3959, 0.3578, 0.4156]}, {"w": "to", "b": [0.3641, 0.3959, 0.3837, 0.4156]}, {"w": "use", "b": [0.39, 0.3959, 0.4237, 0.4156]}, {"w": "How", "b": [0.1799, 0.4164, 0.2289, 0.4361]}, {"w": "many", "b": [0.2352, 0.4164, 0.2913, 0.4361]}, {"w": "hidden", "b": [0.2976, 0.4164, 0.3662, 0.4361]}, {"w": "units", "b": [0.3725, 0.4164, 0.4216, 0.4361]}, {"w": "to", "b": [0.4279, 0.4164, 0.4475, 0.4361]}, {"w": "choose", "b": [0.4538, 0.4164, 0.5239, 0.4361]}, {"w": "for", "b": [0.5302, 0.4164, 0.5596, 0.4361]}, {"w": "each", "b": [0.5659, 0.4164, 0.6121, 0.4361]}, {"w": "layer", "b": [0.6184, 0.4164, 0.6689, 0.4361]}]}, {"id": "b_3", "type": "paragraph", "text": "In chapter 4, you’ll learn formal principles to guide you in making these choices. For the time being, you’ll have to trust me with the following architecture choice:", "words": [{"w": "In", "b": [0.1294, 0.4591, 0.1504, 0.4789]}, {"w": "chapter", "b": [0.1567, 0.4591, 0.231, 0.4789]}, {"w": "4,", "b": [0.2373, 0.4591, 0.2562, 0.4789]}, {"w": "you’ll", "b": [0.2625, 0.4591, 0.3227, 0.4789]}, {"w": "learn", "b": [0.329, 0.4591, 0.3795, 0.4789]}, {"w": "formal", "b": [0.3858, 0.4591, 0.453, 0.4789]}, {"w": "principles", "b": [0.4593, 0.4591, 0.5588, 0.4789]}, {"w": "to", "b": [0.5651, 0.4591, 0.5848, 0.4789]}, {"w": "guide", "b": [0.5911, 0.4591, 0.6471, 0.4789]}, {"w": "you", "b": [0.6534, 0.4591, 0.6913, 0.4789]}, {"w": "in", "b": [0.6976, 0.4591, 0.7172, 0.4789]}, {"w": "making", "b": [0.7235, 0.4591, 0.7992, 0.4789]}, {"w": "these", "b": [0.8055, 0.4591, 0.8573, 0.4789]}, {"w": "choices.", "b": [0.1294, 0.4796, 0.2114, 0.4994]}, {"w": "For", "b": [0.2177, 0.4796, 0.2527, 0.4994]}, {"w": "the", "b": [0.259, 0.4796, 0.2898, 0.4994]}, {"w": "time", "b": [0.2962, 0.4796, 0.341, 0.4994]}, {"w": "being,", "b": [0.3473, 0.4796, 0.4097, 0.4994]}, {"w": "you’ll", "b": [0.416, 0.4796, 0.4762, 0.4994]}, {"w": "have", "b": [0.4825, 0.4796, 0.5302, 0.4994]}, {"w": "to", "b": [0.5365, 0.4796, 0.5561, 0.4994]}, {"w": "trust", "b": [0.5624, 0.4796, 0.6073, 0.4994]}, {"w": "me", "b": [0.6136, 0.4796, 0.6444, 0.4994]}, {"w": "with", "b": [0.6507, 0.4796, 0.6956, 0.4994]}, {"w": "the", "b": [0.7019, 0.4796, 0.7327, 0.4994]}, {"w": "following", "b": [0.7389, 0.4796, 0.837, 0.4994]}, {"w": "architecture", "b": [0.1294, 0.5001, 0.2485, 0.5199]}, {"w": "choice:", "b": [0.2548, 0.5001, 0.3276, 0.5199]}]}, {"id": "b_4", "type": "paragraph", "text": "Two intermediate layers with 16 hidden units each A third layer that will output the scalar prediction regarding the sentiment of the current review", "words": [{"w": "Two", "b": [0.1799, 0.5385, 0.2243, 0.5582]}, {"w": "intermediate", "b": [0.2306, 0.5385, 0.3567, 0.5582]}, {"w": "layers", "b": [0.3631, 0.5385, 0.4233, 0.5582]}, {"w": "with", "b": [0.4296, 0.5385, 0.4745, 0.5582]}, {"w": "16", "b": [0.4808, 0.5385, 0.506, 0.5582]}, {"w": "hidden", "b": [0.5123, 0.5385, 0.581, 0.5582]}, {"w": "units", "b": [0.5873, 0.5385, 0.6363, 0.5582]}, {"w": "each", "b": [0.6426, 0.5385, 0.6888, 0.5582]}, {"w": "A", "b": [0.1799, 0.559, 0.1981, 0.5787]}, {"w": "third", "b": [0.2044, 0.559, 0.252, 0.5787]}, {"w": "layer", "b": [0.2583, 0.559, 0.3088, 0.5787]}, {"w": "that", "b": [0.3151, 0.559, 0.3529, 0.5787]}, {"w": "will", "b": [0.3592, 0.559, 0.3985, 0.5787]}, {"w": "output", "b": [0.4048, 0.559, 0.4693, 0.5787]}, {"w": "the", "b": [0.4756, 0.559, 0.5064, 0.5787]}, {"w": "scalar", "b": [0.5127, 0.559, 0.5715, 0.5787]}, {"w": "prediction", "b": [0.5778, 0.559, 0.6801, 0.5787]}, {"w": "regarding", "b": [0.6864, 0.559, 0.7831, 0.5787]}, {"w": "the", "b": [0.7894, 0.559, 0.8202, 0.5787]}, {"w": "sentiment", "b": [0.1799, 0.5795, 0.278, 0.5992]}, {"w": "of", "b": [0.2843, 0.5795, 0.3053, 0.5992]}, {"w": "the", "b": [0.3116, 0.5795, 0.3424, 0.5992]}, {"w": "current", "b": [0.3487, 0.5795, 0.4202, 0.5992]}, {"w": "review", "b": [0.4265, 0.5795, 0.4951, 0.5992]}]}, {"id": "b_5", "type": "paragraph", "text": "The intermediate layers will use relu as their activation function, and the final layer will use a sigmoid activation so as to output a probability (a score between 0 and 1, indicating how likely the sample is to have the target “1”: how likely the review is to be positive). A relu (rectified linear unit) is a function meant to zero out negative values (see figure 3.4), whereas a sigmoid “squashes” arbitrary values into the [0, 1] interval (see figure 3.5), outputting something that can be interpreted as a probability.", "words": [{"w": "The", "b": [0.1294, 0.6222, 0.1686, 0.642]}, {"w": "intermediate", "b": [0.1749, 0.6222, 0.301, 0.642]}, {"w": "layers", "b": [0.3074, 0.6222, 0.3676, 0.642]}, {"w": "will", "b": [0.3739, 0.6222, 0.4132, 0.642]}, {"w": "use", "b": [0.4195, 0.6222, 0.4531, 0.642]}, {"w": "relu", "b": [0.4593, 0.6233, 0.5199, 0.6435]}, {"w": "as", "b": [0.5262, 0.6222, 0.5472, 0.642]}, {"w": "their", "b": [0.5535, 0.6222, 0.5997, 0.642]}, {"w": "activation", "b": [0.606, 0.6222, 0.7055, 0.642]}, {"w": "function,", "b": [0.7118, 0.6222, 0.8022, 0.642]}, {"w": "and", "b": [0.8085, 0.6222, 0.8449, 0.642]}, {"w": "the", "b": [0.1294, 0.6436, 0.1602, 0.6634]}, {"w": "final", "b": [0.1665, 0.6436, 0.2128, 0.6634]}, {"w": "layer", "b": [0.2191, 0.6436, 0.2695, 0.6634]}, {"w": "will", "b": [0.2758, 0.6436, 0.3151, 0.6634]}, {"w": "use", "b": [0.3214, 0.6436, 0.355, 0.6634]}, {"w": "a", "b": [0.3613, 0.6436, 0.3725, 0.6634]}, {"w": "sigmoid", "b": [0.3788, 0.6436, 0.4601, 0.6634]}, {"w": "activation", "b": [0.4664, 0.6436, 0.5659, 0.6634]}, {"w": "so", "b": [0.5722, 0.6436, 0.5947, 0.6634]}, {"w": "as", "b": [0.601, 0.6436, 0.622, 0.6634]}, {"w": "to", "b": [0.6283, 0.6436, 0.6479, 0.6634]}, {"w": "output", "b": [0.6542, 0.6436, 0.7187, 0.6634]}, {"w": "a", "b": [0.725, 0.6436, 0.7362, 0.6634]}, {"w": "probability", "b": [0.7425, 0.6436, 0.8532, 0.6634]}, {"w": "(a", "b": [0.1294, 0.6641, 0.149, 0.6839]}, {"w": "score", "b": [0.1553, 0.6641, 0.2085, 0.6839]}, {"w": "between", "b": [0.2149, 0.6641, 0.2989, 0.6839]}, {"w": "0", "b": [0.3052, 0.6641, 0.3178, 0.6839]}, {"w": "and", "b": [0.3241, 0.6641, 0.3605, 0.6839]}, {"w": "1,", "b": [0.3668, 0.6641, 0.3858, 0.6839]}, {"w": "indicating", "b": [0.3921, 0.6641, 0.493, 0.6839]}, {"w": "how", "b": [0.4993, 0.6641, 0.5427, 0.6839]}, {"w": "likely", "b": [0.549, 0.6641, 0.6065, 0.6839]}, {"w": "the", "b": [0.6128, 0.6641, 0.6436, 0.6839]}, {"w": "sample", "b": [0.6499, 0.6641, 0.7214, 0.6839]}, {"w": "is", "b": [0.7277, 0.6641, 0.7445, 0.6839]}, {"w": "to", "b": [0.7508, 0.6641, 0.7704, 0.6839]}, {"w": "have", "b": [0.7768, 0.6641, 0.8244, 0.6839]}, {"w": "the", "b": [0.8307, 0.6641, 0.8615, 0.6839]}, {"w": "target", "b": [0.1294, 0.6846, 0.1864, 0.7044]}, {"w": "“1”:", "b": [0.1927, 0.6846, 0.2347, 0.7044]}, {"w": "how", "b": [0.241, 0.6846, 0.2845, 0.7044]}, {"w": "likely", "b": [0.2908, 0.6846, 0.3482, 0.7044]}, {"w": "the", "b": [0.3545, 0.6846, 0.3854, 0.7044]}, {"w": "review", "b": [0.3917, 0.6846, 0.4603, 0.7044]}, {"w": "is", "b": [0.4666, 0.6846, 0.4834, 0.7044]}, {"w": "to", "b": [0.4898, 0.6846, 0.5094, 0.7044]}, {"w": "be", "b": [0.5157, 0.6846, 0.5395, 0.7044]}, {"w": "positive).", "b": [0.5458, 0.6846, 0.6404, 0.7044]}, {"w": "A", "b": [0.6467, 0.6846, 0.6649, 0.7044]}, {"w": "relu", "b": [0.6712, 0.6857, 0.7317, 0.7059]}, {"w": "(rectified", "b": [0.738, 0.6846, 0.8305, 0.7044]}, {"w": "linear", "b": [0.1294, 0.706, 0.1869, 0.7258]}, {"w": "unit)", "b": [0.1932, 0.706, 0.2408, 0.7258]}, {"w": "is", "b": [0.2471, 0.706, 0.2639, 0.7258]}, {"w": "a", "b": [0.2702, 0.706, 0.2814, 0.7258]}, {"w": "function", "b": [0.2878, 0.706, 0.3718, 0.7258]}, {"w": "meant", "b": [0.3781, 0.706, 0.4398, 0.7258]}, {"w": "to", "b": [0.4461, 0.706, 0.4657, 0.7258]}, {"w": "zero", "b": [0.472, 0.706, 0.5154, 0.7258]}, {"w": "out", "b": [0.5217, 0.706, 0.554, 0.7258]}, {"w": "negative", "b": [0.5603, 0.706, 0.6458, 0.7258]}, {"w": "values", "b": [0.6521, 0.706, 0.7165, 0.7258]}, {"w": "(see", "b": [0.7228, 0.706, 0.7634, 0.7258]}, {"w": "figure", "b": [0.7696, 0.706, 0.8299, 0.7258]}, {"w": "3.4),", "b": [0.1294, 0.7265, 0.1757, 0.7463]}, {"w": "whereas", "b": [0.182, 0.7265, 0.2646, 0.7463]}, {"w": "a", "b": [0.2709, 0.7265, 0.2821, 0.7463]}, {"w": "sigmoid", "b": [0.2884, 0.7265, 0.3697, 0.7463]}, {"w": "“squashes”", "b": [0.376, 0.7265, 0.4881, 0.7463]}, {"w": "arbitrary", "b": [0.4944, 0.7265, 0.5813, 0.7463]}, {"w": "values", "b": [0.5876, 0.7265, 0.652, 0.7463]}, {"w": "into", "b": [0.6583, 0.7265, 0.6976, 0.7463]}, {"w": "the", "b": [0.7039, 0.7265, 0.7347, 0.7463]}, {"w": "[0,", "b": [0.7409, 0.7276, 0.7863, 0.7478]}, {"w": "1]", "b": [0.8015, 0.7276, 0.8318, 0.7478]}, {"w": "interval", "b": [0.1294, 0.7479, 0.2065, 0.7677]}, {"w": "(see", "b": [0.2128, 0.7479, 0.2534, 0.7677]}, {"w": "figure", "b": [0.2597, 0.7479, 0.3199, 0.7677]}, {"w": "3.5),", "b": [0.3262, 0.7479, 0.3725, 0.7677]}, {"w": "outputting", "b": [0.3788, 0.7479, 0.4825, 0.7677]}, {"w": "something", "b": [0.4888, 0.7479, 0.5939, 0.7677]}, {"w": "that", "b": [0.6002, 0.7479, 0.6381, 0.7677]}, {"w": "can", "b": [0.6444, 0.7479, 0.6794, 0.7677]}, {"w": "be", "b": [0.6857, 0.7479, 0.7095, 0.7677]}, {"w": "interpreted", "b": [0.7158, 0.7479, 0.8251, 0.7677]}, {"w": "as", "b": [0.8314, 0.7479, 0.8524, 0.7677]}, {"w": "a", "b": [0.8587, 0.7479, 0.8699, 0.7677]}, {"w": "probability.", "b": [0.1294, 0.7684, 0.2448, 0.7882]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 3.4. The rectified linear unit function", "words": [{"w": "Figure", "b": [0.1294, 0.8063, 0.1827, 0.8211]}, {"w": "3.4.", "b": [0.1874, 0.8063, 0.2158, 0.8211]}, {"w": "The", "b": [0.2205, 0.8063, 0.252, 0.8211]}, {"w": "rectified", "b": [0.2567, 0.8063, 0.3236, 0.8211]}, {"w": "linear", "b": [0.3284, 0.8063, 0.3757, 0.8211]}, {"w": "unit", "b": [0.3804, 0.8063, 0.413, 0.8211]}, {"w": "function", "b": [0.4177, 0.8063, 0.485, 0.8211]}]}]}, {"page": 111, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 3.5. The sigmoid function", "words": [{"w": "Figure", "b": [0.1294, 0.5121, 0.1827, 0.5269]}, {"w": "3.5.", "b": [0.1874, 0.5121, 0.2158, 0.5269]}, {"w": "The", "b": [0.2205, 0.5121, 0.252, 0.5269]}, {"w": "sigmoid", "b": [0.2567, 0.5121, 0.3198, 0.5269]}, {"w": "function", "b": [0.3246, 0.5121, 0.3918, 0.5269]}]}]}, {"page": 112, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 3.6 shows what the network looks like. And here’s the Keras implementation, similar to the MNIST example you saw previously.", "words": [{"w": "Figure", "b": [0.1294, 0.5046, 0.1953, 0.5243]}, {"w": "3.6", "b": [0.2016, 0.5046, 0.2331, 0.5243]}, {"w": "shows", "b": [0.2394, 0.5046, 0.3025, 0.5243]}, {"w": "what", "b": [0.3088, 0.5046, 0.3578, 0.5243]}, {"w": "the", "b": [0.3641, 0.5046, 0.3949, 0.5243]}, {"w": "network", "b": [0.4012, 0.5046, 0.4839, 0.5243]}, {"w": "looks", "b": [0.4902, 0.5046, 0.5449, 0.5243]}, {"w": "like.", "b": [0.5512, 0.5046, 0.5953, 0.5243]}, {"w": "And", "b": [0.6016, 0.5046, 0.6451, 0.5243]}, {"w": "here’s", "b": [0.6514, 0.5046, 0.7116, 0.5243]}, {"w": "the", "b": [0.7179, 0.5046, 0.7487, 0.5243]}, {"w": "Keras", "b": [0.755, 0.5046, 0.8139, 0.5243]}, {"w": "implementation,", "b": [0.1294, 0.5251, 0.2941, 0.5448]}, {"w": "similar", "b": [0.3004, 0.5251, 0.3705, 0.5448]}, {"w": "to", "b": [0.3768, 0.5251, 0.3964, 0.5448]}, {"w": "the", "b": [0.4027, 0.5251, 0.4335, 0.5448]}, {"w": "MNIST", "b": [0.4398, 0.5251, 0.5183, 0.5448]}, {"w": "example", "b": [0.5246, 0.5251, 0.6101, 0.5448]}, {"w": "you", "b": [0.6164, 0.5251, 0.6542, 0.5448]}, {"w": "saw", "b": [0.6605, 0.5251, 0.6998, 0.5448]}, {"w": "previously.", "b": [0.7061, 0.5251, 0.8172, 0.5448]}]}, {"id": "b_1", "type": "equation", "text": "Figure 3.6. The three-layer network", "words": [{"w": "Figure", "b": [0.1294, 0.5629, 0.1827, 0.5777]}, {"w": "3.6.", "b": [0.1874, 0.5629, 0.2158, 0.5777]}, {"w": "The", "b": [0.2205, 0.5629, 0.252, 0.5777]}, {"w": "three-layer", "b": [0.2567, 0.5629, 0.3457, 0.5777]}, {"w": "network", "b": [0.3504, 0.5629, 0.4177, 0.5777]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.3. The model definition", "words": [{"w": "Listing", "b": [0.1294, 0.833, 0.1862, 0.8478]}, {"w": "3.3.", "b": [0.1909, 0.833, 0.2193, 0.8478]}, {"w": "The", "b": [0.224, 0.833, 0.2555, 0.8478]}, {"w": "model", "b": [0.2603, 0.833, 0.3097, 0.8478]}, {"w": "definition", "b": [0.3144, 0.833, 0.3922, 0.8478]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras import models from keras import layers", "words": [{"w": "from", "b": [0.1357, 0.8614, 0.1811, 0.8766]}, {"w": "keras", "b": [0.1925, 0.8614, 0.2492, 0.8766]}, {"w": "import", "b": [0.2606, 0.8614, 0.3287, 0.8766]}, {"w": "models", "b": [0.34, 0.8614, 0.4082, 0.8766]}, {"w": "from", "b": [0.1357, 0.8766, 0.1811, 0.8917]}, {"w": "keras", "b": [0.1925, 0.8766, 0.2492, 0.8917]}, {"w": "import", "b": [0.2606, 0.8766, 0.3287, 0.8917]}, {"w": "layers", "b": [0.34, 0.8766, 0.4082, 0.8917]}]}]}, {"page": 113, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(16, activation='relu', input_shape= (10000,))) model.add(layers.Dense(16, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "model", "b": [0.1357, 0.0851, 0.1925, 0.1002]}, {"w": "=", "b": [0.2038, 0.0851, 0.2152, 0.1002]}, {"w": "models.Sequential()", "b": [0.2265, 0.0851, 0.4422, 0.1002]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.1002, 0.4309, 0.1154]}, {"w": "activation='relu',", "b": [0.4422, 0.1002, 0.6465, 0.1154]}, {"w": "input_shape=", "b": [0.6579, 0.1002, 0.7941, 0.1154]}, {"w": "(10000,)))", "b": [0.1357, 0.1154, 0.2492, 0.1305]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.1305, 0.4309, 0.1457]}, {"w": "activation='relu'))", "b": [0.4422, 0.1305, 0.6579, 0.1457]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.1457, 0.4195, 0.1608]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.1457, 0.6806, 0.1608]}]}, {"id": "b_1", "type": "paragraph", "text": "What are activation functions, and why are they necessary?", "words": [{"w": "What", "b": [0.1294, 0.1837, 0.1897, 0.2035]}, {"w": "are", "b": [0.196, 0.1837, 0.2305, 0.2035]}, {"w": "activation", "b": [0.2368, 0.1837, 0.3434, 0.2035]}, {"w": "functions,", "b": [0.3497, 0.1837, 0.4555, 0.2035]}, {"w": "and", "b": [0.4618, 0.1837, 0.5024, 0.2035]}, {"w": "why", "b": [0.5088, 0.1837, 0.5536, 0.2035]}, {"w": "are", "b": [0.5599, 0.1837, 0.5945, 0.2035]}, {"w": "they", "b": [0.6008, 0.1837, 0.647, 0.2035]}, {"w": "necessary?", "b": [0.6533, 0.1837, 0.7696, 0.2035]}]}, {"id": "b_2", "type": "paragraph", "text": "Without an activation function like relu (also called a non-linearity), the Dense layer would consist of two linear operations—a dot product and an addition:", "words": [{"w": "Without", "b": [0.1294, 0.2265, 0.2111, 0.2462]}, {"w": "an", "b": [0.2174, 0.2265, 0.2412, 0.2462]}, {"w": "activation", "b": [0.2475, 0.2265, 0.347, 0.2462]}, {"w": "function", "b": [0.3533, 0.2265, 0.4374, 0.2462]}, {"w": "like", "b": [0.4437, 0.2265, 0.4815, 0.2462]}, {"w": "relu", "b": [0.4878, 0.2275, 0.5483, 0.2477]}, {"w": "(also", "b": [0.5546, 0.2265, 0.6036, 0.2462]}, {"w": "called", "b": [0.6099, 0.2265, 0.6702, 0.2462]}, {"w": "a", "b": [0.6765, 0.2265, 0.6877, 0.2462]}, {"w": "non-linearity),", "b": [0.694, 0.2265, 0.8404, 0.2462]}, {"w": "the", "b": [0.1294, 0.2479, 0.1602, 0.2676]}, {"w": "Dense", "b": [0.1665, 0.2489, 0.2422, 0.2691]}, {"w": "layer", "b": [0.2485, 0.2479, 0.2989, 0.2676]}, {"w": "would", "b": [0.3052, 0.2479, 0.3683, 0.2676]}, {"w": "consist", "b": [0.3746, 0.2479, 0.4447, 0.2676]}, {"w": "of", "b": [0.451, 0.2479, 0.472, 0.2676]}, {"w": "two", "b": [0.4783, 0.2479, 0.5162, 0.2676]}, {"w": "linear", "b": [0.5225, 0.2479, 0.5799, 0.2676]}, {"w": "operations—a", "b": [0.5862, 0.2479, 0.7277, 0.2676]}, {"w": "dot", "b": [0.734, 0.2479, 0.7663, 0.2676]}, {"w": "product", "b": [0.7726, 0.2479, 0.8496, 0.2676]}, {"w": "and", "b": [0.1294, 0.2693, 0.1658, 0.289]}, {"w": "an", "b": [0.1721, 0.2693, 0.196, 0.289]}, {"w": "addition:", "b": [0.2023, 0.2693, 0.292, 0.289]}]}, {"id": "b_3", "type": "equation", "text": "output = dot(W, input) + b", "words": [{"w": "output", "b": [0.1357, 0.307, 0.2038, 0.3222]}, {"w": "=", "b": [0.2152, 0.307, 0.2265, 0.3222]}, {"w": "dot(W,", "b": [0.2379, 0.307, 0.306, 0.3222]}, {"w": "input)", "b": [0.3173, 0.307, 0.3855, 0.3222]}, {"w": "+", "b": [0.3968, 0.307, 0.4082, 0.3222]}, {"w": "b", "b": [0.4195, 0.307, 0.4309, 0.3222]}]}, {"id": "b_4", "type": "paragraph", "text": "So the layer could only learn linear transformations (affine transformations) of the input data: the hypothesis space of the layer would be the set of all possible linear transformations of the input data into a 16-dimensional space. Such a hypothesis space is too restricted and wouldn’t benefit from multiple layers of representations, because a deep stack of linear layers would still implement a linear operation: adding more layers wouldn’t extend the hypothesis space.", "words": [{"w": "So", "b": [0.1294, 0.345, 0.1561, 0.3648]}, {"w": "the", "b": [0.1624, 0.345, 0.1932, 0.3648]}, {"w": "layer", "b": [0.1995, 0.345, 0.2499, 0.3648]}, {"w": "could", "b": [0.2562, 0.345, 0.3123, 0.3648]}, {"w": "only", "b": [0.3186, 0.345, 0.3634, 0.3648]}, {"w": "learn", "b": [0.3697, 0.345, 0.4202, 0.3648]}, {"w": "linear", "b": [0.4264, 0.345, 0.4867, 0.3648]}, {"w": "transformations", "b": [0.493, 0.345, 0.6542, 0.3648]}, {"w": "(affine", "b": [0.6605, 0.345, 0.7272, 0.3648]}, {"w": "transformations)", "b": [0.1294, 0.3655, 0.2962, 0.3853]}, {"w": "of", "b": [0.3025, 0.3655, 0.3235, 0.3853]}, {"w": "the", "b": [0.3298, 0.3655, 0.3606, 0.3853]}, {"w": "input", "b": [0.3669, 0.3655, 0.4188, 0.3853]}, {"w": "data:", "b": [0.4251, 0.3655, 0.4741, 0.3853]}, {"w": "the", "b": [0.4804, 0.3655, 0.5113, 0.3853]}, {"w": "hypothesis", "b": [0.5175, 0.3655, 0.624, 0.3853]}, {"w": "space", "b": [0.6303, 0.3655, 0.6877, 0.3853]}, {"w": "of", "b": [0.694, 0.3655, 0.715, 0.3853]}, {"w": "the", "b": [0.7214, 0.3655, 0.7522, 0.3853]}, {"w": "layer", "b": [0.7585, 0.3655, 0.8089, 0.3853]}, {"w": "would", "b": [0.1294, 0.3861, 0.1925, 0.4058]}, {"w": "be", "b": [0.1988, 0.3861, 0.2226, 0.4058]}, {"w": "the", "b": [0.2289, 0.3861, 0.2597, 0.4058]}, {"w": "set", "b": [0.266, 0.3861, 0.2941, 0.4058]}, {"w": "of", "b": [0.3004, 0.3861, 0.3214, 0.4058]}, {"w": "all", "b": [0.3277, 0.3861, 0.3529, 0.4058]}, {"w": "possible", "b": [0.3592, 0.3861, 0.4419, 0.4058]}, {"w": "linear", "b": [0.4482, 0.3861, 0.5057, 0.4058]}, {"w": "transformations", "b": [0.512, 0.3861, 0.6703, 0.4058]}, {"w": "of", "b": [0.6766, 0.3861, 0.6976, 0.4058]}, {"w": "the", "b": [0.7039, 0.3861, 0.7348, 0.4058]}, {"w": "input", "b": [0.7411, 0.3861, 0.7929, 0.4058]}, {"w": "data", "b": [0.7992, 0.3861, 0.8413, 0.4058]}, {"w": "into", "b": [0.1294, 0.4066, 0.1687, 0.4263]}, {"w": "a", "b": [0.175, 0.4066, 0.1862, 0.4263]}, {"w": "16-dimensional", "b": [0.1925, 0.4066, 0.3494, 0.4263]}, {"w": "space.", "b": [0.3557, 0.4066, 0.4181, 0.4263]}, {"w": "Such", "b": [0.4244, 0.4066, 0.4748, 0.4263]}, {"w": "a", "b": [0.4811, 0.4066, 0.4923, 0.4263]}, {"w": "hypothesis", "b": [0.4986, 0.4066, 0.6065, 0.4263]}, {"w": "space", "b": [0.6128, 0.4066, 0.6688, 0.4263]}, {"w": "is", "b": [0.6752, 0.4066, 0.692, 0.4263]}, {"w": "too", "b": [0.6983, 0.4066, 0.7305, 0.4263]}, {"w": "restricted", "b": [0.7368, 0.4066, 0.8307, 0.4263]}, {"w": "and", "b": [0.1294, 0.427, 0.1658, 0.4468]}, {"w": "wouldn’t", "b": [0.1721, 0.427, 0.2628, 0.4468]}, {"w": "benefit", "b": [0.2691, 0.427, 0.3391, 0.4468]}, {"w": "from", "b": [0.3454, 0.427, 0.3945, 0.4468]}, {"w": "multiple", "b": [0.4008, 0.427, 0.4849, 0.4468]}, {"w": "layers", "b": [0.4912, 0.427, 0.5514, 0.4468]}, {"w": "of", "b": [0.5577, 0.427, 0.5788, 0.4468]}, {"w": "representations,", "b": [0.5851, 0.427, 0.7441, 0.4468]}, {"w": "because", "b": [0.7504, 0.427, 0.8302, 0.4468]}, {"w": "a", "b": [0.8365, 0.427, 0.8477, 0.4468]}, {"w": "deep", "b": [0.1294, 0.4476, 0.177, 0.4673]}, {"w": "stack", "b": [0.1833, 0.4476, 0.2352, 0.4673]}, {"w": "of", "b": [0.2415, 0.4476, 0.2625, 0.4673]}, {"w": "linear", "b": [0.2688, 0.4476, 0.3262, 0.4673]}, {"w": "layers", "b": [0.3325, 0.4476, 0.3928, 0.4673]}, {"w": "would", "b": [0.3991, 0.4476, 0.4621, 0.4673]}, {"w": "still", "b": [0.4684, 0.4476, 0.5063, 0.4673]}, {"w": "implement", "b": [0.5126, 0.4476, 0.6205, 0.4673]}, {"w": "a", "b": [0.6268, 0.4476, 0.638, 0.4673]}, {"w": "linear", "b": [0.6443, 0.4476, 0.7018, 0.4673]}, {"w": "operation:", "b": [0.7081, 0.4476, 0.8104, 0.4673]}, {"w": "adding", "b": [0.1294, 0.4681, 0.1981, 0.4878]}, {"w": "more", "b": [0.2044, 0.4681, 0.2562, 0.4878]}, {"w": "layers", "b": [0.2625, 0.4681, 0.3228, 0.4878]}, {"w": "wouldn’t", "b": [0.3291, 0.4681, 0.4197, 0.4878]}, {"w": "extend", "b": [0.426, 0.4681, 0.4932, 0.4878]}, {"w": "the", "b": [0.4995, 0.4681, 0.5304, 0.4878]}, {"w": "hypothesis", "b": [0.5367, 0.4681, 0.6446, 0.4878]}, {"w": "space.", "b": [0.6509, 0.4681, 0.7132, 0.4878]}]}, {"id": "b_5", "type": "paragraph", "text": "In order to get access to a much richer hypothesis space that would benefit from deep representations, you need a non-linearity, or activation function. relu is the most popular activation function in deep learning, but there are many other candidates, which all come with similarly strange names: prelu, elu, and so on.", "words": [{"w": "In", "b": [0.1294, 0.5108, 0.1504, 0.5306]}, {"w": "order", "b": [0.1567, 0.5108, 0.21, 0.5306]}, {"w": "to", "b": [0.2163, 0.5108, 0.2359, 0.5306]}, {"w": "get", "b": [0.2422, 0.5108, 0.273, 0.5306]}, {"w": "access", "b": [0.2793, 0.5108, 0.3438, 0.5306]}, {"w": "to", "b": [0.3501, 0.5108, 0.3697, 0.5306]}, {"w": "a", "b": [0.376, 0.5108, 0.3872, 0.5306]}, {"w": "much", "b": [0.3935, 0.5108, 0.4496, 0.5306]}, {"w": "richer", "b": [0.4559, 0.5108, 0.5147, 0.5306]}, {"w": "hypothesis", "b": [0.521, 0.5108, 0.6289, 0.5306]}, {"w": "space", "b": [0.6352, 0.5108, 0.6912, 0.5306]}, {"w": "that", "b": [0.6975, 0.5108, 0.7354, 0.5306]}, {"w": "would", "b": [0.7417, 0.5108, 0.8048, 0.5306]}, {"w": "benefit", "b": [0.1294, 0.5313, 0.1995, 0.5511]}, {"w": "from", "b": [0.2058, 0.5313, 0.2548, 0.5511]}, {"w": "deep", "b": [0.2611, 0.5313, 0.3087, 0.5511]}, {"w": "representations,", "b": [0.315, 0.5313, 0.4741, 0.5511]}, {"w": "you", "b": [0.4804, 0.5313, 0.5182, 0.5511]}, {"w": "need", "b": [0.5245, 0.5313, 0.5721, 0.5511]}, {"w": "a", "b": [0.5785, 0.5313, 0.5897, 0.5511]}, {"w": "non-linearity,", "b": [0.596, 0.5313, 0.7309, 0.5511]}, {"w": "or", "b": [0.7372, 0.5313, 0.7582, 0.5511]}, {"w": "activation", "b": [0.7645, 0.5313, 0.864, 0.5511]}, {"w": "function.", "b": [0.1294, 0.5518, 0.2198, 0.5716]}, {"w": "relu", "b": [0.2261, 0.5529, 0.2866, 0.5731]}, {"w": "is", "b": [0.2929, 0.5518, 0.3098, 0.5716]}, {"w": "the", "b": [0.3161, 0.5518, 0.3469, 0.5716]}, {"w": "most", "b": [0.3532, 0.5518, 0.4023, 0.5716]}, {"w": "popular", "b": [0.4086, 0.5518, 0.4856, 0.5716]}, {"w": "activation", "b": [0.4919, 0.5518, 0.5914, 0.5716]}, {"w": "function", "b": [0.5977, 0.5518, 0.6818, 0.5716]}, {"w": "in", "b": [0.6881, 0.5518, 0.7077, 0.5716]}, {"w": "deep", "b": [0.714, 0.5518, 0.7617, 0.5716]}, {"w": "learning,", "b": [0.768, 0.5518, 0.8569, 0.5716]}, {"w": "but", "b": [0.1294, 0.5732, 0.1617, 0.593]}, {"w": "there", "b": [0.168, 0.5732, 0.2184, 0.593]}, {"w": "are", "b": [0.2247, 0.5732, 0.2555, 0.593]}, {"w": "many", "b": [0.2618, 0.5732, 0.3178, 0.593]}, {"w": "other", "b": [0.3242, 0.5732, 0.376, 0.593]}, {"w": "candidates,", "b": [0.3823, 0.5732, 0.4951, 0.593]}, {"w": "which", "b": [0.5014, 0.5732, 0.563, 0.593]}, {"w": "all", "b": [0.5693, 0.5732, 0.5946, 0.593]}, {"w": "come", "b": [0.6009, 0.5732, 0.6555, 0.593]}, {"w": "with", "b": [0.6618, 0.5732, 0.7067, 0.593]}, {"w": "similarly", "b": [0.713, 0.5732, 0.8027, 0.593]}, {"w": "strange", "b": [0.1294, 0.5937, 0.2023, 0.6135]}, {"w": "names:", "b": [0.2086, 0.5937, 0.28, 0.6135]}, {"w": "prelu,", "b": [0.2863, 0.5937, 0.3683, 0.615]}, {"w": "elu,", "b": [0.3746, 0.5937, 0.4263, 0.615]}, {"w": "and", "b": [0.4326, 0.5937, 0.469, 0.6135]}, {"w": "so", "b": [0.4753, 0.5937, 0.4978, 0.6135]}, {"w": "on.", "b": [0.5041, 0.5937, 0.5356, 0.6135]}]}, {"id": "b_6", "type": "paragraph", "text": "Finally, you need to choose a loss function and an optimizer. Because you’re facing a binary classification problem and the output of your network is a probability (you end your network with a single-unit layer with a sigmoid activation), it’s best to use the binary_crossentropy loss. It isn’t the only viable choice: you could use, for instance, mean_squared_error. But crossentropy is usually the best choice when you’re dealing with models that output probabilities. Crossentropy is a quantity from the field of Information Theory that measures the distance between probability distributions or, in this case, between the ground-truth distribution and your predictions.", "words": [{"w": "Finally,", "b": [0.1294, 0.6641, 0.2056, 0.6839]}, {"w": "you", "b": [0.2119, 0.6641, 0.2497, 0.6839]}, {"w": "need", "b": [0.256, 0.6641, 0.3036, 0.6839]}, {"w": "to", "b": [0.3099, 0.6641, 0.3296, 0.6839]}, {"w": "choose", "b": [0.3359, 0.6641, 0.4059, 0.6839]}, {"w": "a", "b": [0.4122, 0.6641, 0.4234, 0.6839]}, {"w": "loss", "b": [0.4297, 0.6641, 0.469, 0.6839]}, {"w": "function", "b": [0.4753, 0.6641, 0.5594, 0.6839]}, {"w": "and", "b": [0.5657, 0.6641, 0.6021, 0.6839]}, {"w": "an", "b": [0.6084, 0.6641, 0.6322, 0.6839]}, {"w": "optimizer.", "b": [0.6385, 0.6641, 0.7401, 0.6839]}, {"w": "Because", "b": [0.7464, 0.6641, 0.8304, 0.6839]}, {"w": "you’re", "b": [0.1294, 0.6846, 0.1953, 0.7044]}, {"w": "facing", "b": [0.2016, 0.6846, 0.2646, 0.7044]}, {"w": "a", "b": [0.2709, 0.6846, 0.2821, 0.7044]}, {"w": "binary", "b": [0.2884, 0.6846, 0.3529, 0.7044]}, {"w": "classification", "b": [0.3592, 0.6846, 0.4923, 0.7044]}, {"w": "problem", "b": [0.4986, 0.6846, 0.5827, 0.7044]}, {"w": "and", "b": [0.589, 0.6846, 0.6254, 0.7044]}, {"w": "the", "b": [0.6317, 0.6846, 0.6625, 0.7044]}, {"w": "output", "b": [0.6688, 0.6846, 0.7332, 0.7044]}, {"w": "of", "b": [0.7395, 0.6846, 0.7605, 0.7044]}, {"w": "your", "b": [0.7669, 0.6846, 0.8131, 0.7044]}, {"w": "network", "b": [0.1294, 0.7051, 0.2121, 0.7249]}, {"w": "is", "b": [0.2184, 0.7051, 0.2352, 0.7249]}, {"w": "a", "b": [0.2415, 0.7051, 0.2527, 0.7249]}, {"w": "probability", "b": [0.259, 0.7051, 0.3697, 0.7249]}, {"w": "(you", "b": [0.376, 0.7051, 0.4223, 0.7249]}, {"w": "end", "b": [0.4286, 0.7051, 0.465, 0.7249]}, {"w": "your", "b": [0.4713, 0.7051, 0.5176, 0.7249]}, {"w": "network", "b": [0.5239, 0.7051, 0.6065, 0.7249]}, {"w": "with", "b": [0.6128, 0.7051, 0.6577, 0.7249]}, {"w": "a", "b": [0.664, 0.7051, 0.6752, 0.7249]}, {"w": "single-unit", "b": [0.6815, 0.7051, 0.7894, 0.7249]}, {"w": "layer", "b": [0.7957, 0.7051, 0.8462, 0.7249]}, {"w": "with", "b": [0.1294, 0.7256, 0.1743, 0.7454]}, {"w": "a", "b": [0.1806, 0.7256, 0.1918, 0.7454]}, {"w": "sigmoid", "b": [0.1981, 0.7256, 0.2794, 0.7454]}, {"w": "activation),", "b": [0.2857, 0.7256, 0.3999, 0.7454]}, {"w": "it’s", "b": [0.4062, 0.7256, 0.437, 0.7454]}, {"w": "best", "b": [0.4433, 0.7256, 0.4839, 0.7454]}, {"w": "to", "b": [0.4902, 0.7256, 0.5098, 0.7454]}, {"w": "use", "b": [0.5162, 0.7256, 0.5498, 0.7454]}, {"w": "the", "b": [0.5561, 0.7256, 0.5869, 0.7454]}, {"w": "binary_crossentropy", "b": [0.1294, 0.7472, 0.417, 0.7674]}, {"w": "loss.", "b": [0.4233, 0.7461, 0.4689, 0.7659]}, {"w": "It", "b": [0.4752, 0.7461, 0.4906, 0.7659]}, {"w": "isn’t", "b": [0.4969, 0.7461, 0.5413, 0.7659]}, {"w": "the", "b": [0.5476, 0.7461, 0.5784, 0.7659]}, {"w": "only", "b": [0.5847, 0.7461, 0.6296, 0.7659]}, {"w": "viable", "b": [0.6359, 0.7461, 0.6976, 0.7659]}, {"w": "choice:", "b": [0.7039, 0.7461, 0.7767, 0.7659]}, {"w": "you", "b": [0.783, 0.7461, 0.8209, 0.7659]}, {"w": "could", "b": [0.1294, 0.7675, 0.1855, 0.7873]}, {"w": "use,", "b": [0.1918, 0.7675, 0.2317, 0.7873]}, {"w": "for", "b": [0.238, 0.7675, 0.2674, 0.7873]}, {"w": "instance,", "b": [0.2737, 0.7675, 0.3627, 0.7873]}, {"w": "mean_squared_error.", "b": [0.369, 0.7675, 0.6478, 0.7888]}, {"w": "But", "b": [0.6541, 0.7675, 0.6905, 0.7873]}, {"w": "crossentropy", "b": [0.6968, 0.7675, 0.8257, 0.7873]}, {"w": "is", "b": [0.832, 0.7675, 0.8489, 0.7873]}, {"w": "usually", "b": [0.1294, 0.7889, 0.2023, 0.8087]}, {"w": "the", "b": [0.2086, 0.7889, 0.2394, 0.8087]}, {"w": "best", "b": [0.2457, 0.7889, 0.2864, 0.8087]}, {"w": "choice", "b": [0.2927, 0.7889, 0.3585, 0.8087]}, {"w": "when", "b": [0.3648, 0.7889, 0.4195, 0.8087]}, {"w": "you’re", "b": [0.4258, 0.7889, 0.4916, 0.8087]}, {"w": "dealing", "b": [0.4979, 0.7889, 0.5722, 0.8087]}, {"w": "with", "b": [0.5785, 0.7889, 0.6233, 0.8087]}, {"w": "models", "b": [0.6296, 0.7889, 0.7025, 0.8087]}, {"w": "that", "b": [0.7088, 0.7889, 0.7467, 0.8087]}, {"w": "output", "b": [0.753, 0.7889, 0.8174, 0.8087]}, {"w": "probabilities.", "b": [0.1294, 0.8094, 0.2618, 0.8292]}, {"w": "Crossentropy", "b": [0.2681, 0.8094, 0.4022, 0.8292]}, {"w": "is", "b": [0.4085, 0.8094, 0.4253, 0.8292]}, {"w": "a", "b": [0.4316, 0.8094, 0.4428, 0.8292]}, {"w": "quantity", "b": [0.4491, 0.8094, 0.5318, 0.8292]}, {"w": "from", "b": [0.5381, 0.8094, 0.5872, 0.8292]}, {"w": "the", "b": [0.5935, 0.8094, 0.6243, 0.8292]}, {"w": "field", "b": [0.6306, 0.8094, 0.6768, 0.8292]}, {"w": "of", "b": [0.6831, 0.8094, 0.7042, 0.8292]}, {"w": "Information", "b": [0.7105, 0.8094, 0.831, 0.8292]}, {"w": "Theory", "b": [0.1294, 0.8299, 0.2023, 0.8497]}, {"w": "that", "b": [0.2086, 0.8299, 0.2464, 0.8497]}, {"w": "measures", "b": [0.2527, 0.8299, 0.3466, 0.8497]}, {"w": "the", "b": [0.3529, 0.8299, 0.3837, 0.8497]}, {"w": "distance", "b": [0.39, 0.8299, 0.4727, 0.8497]}, {"w": "between", "b": [0.479, 0.8299, 0.563, 0.8497]}, {"w": "probability", "b": [0.5693, 0.8299, 0.6801, 0.8497]}, {"w": "distributions", "b": [0.6864, 0.8299, 0.8125, 0.8497]}, {"w": "or,", "b": [0.8188, 0.8299, 0.845, 0.8497]}, {"w": "in", "b": [0.1294, 0.8504, 0.149, 0.8702]}, {"w": "this", "b": [0.1553, 0.8504, 0.1918, 0.8702]}, {"w": "case,", "b": [0.1981, 0.8504, 0.2478, 0.8702]}, {"w": "between", "b": [0.2541, 0.8504, 0.3382, 0.8702]}, {"w": "the", "b": [0.3445, 0.8504, 0.3753, 0.8702]}, {"w": "ground-truth", "b": [0.3816, 0.8504, 0.5091, 0.8702]}, {"w": "distribution", "b": [0.5154, 0.8504, 0.6318, 0.8702]}, {"w": "and", "b": [0.6381, 0.8504, 0.6745, 0.8702]}, {"w": "your", "b": [0.6808, 0.8504, 0.7271, 0.8702]}, {"w": "predictions.", "b": [0.7334, 0.8504, 0.8518, 0.8702]}]}]}, {"page": 114, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Here’s the step where you configure the model with the rmsprop optimizer and the binary_crossentropy loss function. Note that you’ll also monitor accuracy during training.", "words": [{"w": "Here’s", "b": [0.1294, 0.0857, 0.1952, 0.1054]}, {"w": "the", "b": [0.2016, 0.0857, 0.2324, 0.1054]}, {"w": "step", "b": [0.2387, 0.0857, 0.2793, 0.1054]}, {"w": "where", "b": [0.2856, 0.0857, 0.3473, 0.1054]}, {"w": "you", "b": [0.3536, 0.0857, 0.3914, 0.1054]}, {"w": "configure", "b": [0.3977, 0.0857, 0.4944, 0.1054]}, {"w": "the", "b": [0.5007, 0.0857, 0.5315, 0.1054]}, {"w": "model", "b": [0.5378, 0.0857, 0.6009, 0.1054]}, {"w": "with", "b": [0.6072, 0.0857, 0.652, 0.1054]}, {"w": "the", "b": [0.6583, 0.0857, 0.6892, 0.1054]}, {"w": "rmsprop", "b": [0.6954, 0.0867, 0.8014, 0.1069]}, {"w": "optimizer", "b": [0.1294, 0.1071, 0.2261, 0.1268]}, {"w": "and", "b": [0.2324, 0.1071, 0.2688, 0.1268]}, {"w": "the", "b": [0.2751, 0.1071, 0.306, 0.1268]}, {"w": "binary_crossentropy", "b": [0.3122, 0.1081, 0.5998, 0.1283]}, {"w": "loss", "b": [0.6061, 0.1071, 0.6454, 0.1268]}, {"w": "function.", "b": [0.6517, 0.1071, 0.7421, 0.1268]}, {"w": "Note", "b": [0.7484, 0.1071, 0.7974, 0.1268]}, {"w": "that", "b": [0.8037, 0.1071, 0.8416, 0.1268]}, {"w": "you’ll", "b": [0.1294, 0.1285, 0.1897, 0.1482]}, {"w": "also", "b": [0.196, 0.1285, 0.2366, 0.1482]}, {"w": "monitor", "b": [0.2429, 0.1285, 0.3228, 0.1482]}, {"w": "accuracy", "b": [0.3291, 0.1285, 0.4188, 0.1482]}, {"w": "during", "b": [0.4251, 0.1285, 0.4909, 0.1482]}, {"w": "training.", "b": [0.4972, 0.1285, 0.582, 0.1482]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.4. Compiling the model", "words": [{"w": "Listing", "b": [0.1294, 0.1663, 0.1862, 0.1811]}, {"w": "3.4.", "b": [0.1909, 0.1663, 0.2193, 0.1811]}, {"w": "Compiling", "b": [0.224, 0.1663, 0.3092, 0.1811]}, {"w": "the", "b": [0.3139, 0.1663, 0.3391, 0.1811]}, {"w": "model", "b": [0.3438, 0.1663, 0.3932, 0.1811]}]}, {"id": "b_2", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['accuracy'])", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.1947, 0.5217, 0.2099]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.2099, 0.6011, 0.225]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.225, 0.533, 0.2402]}]}, {"id": "b_3", "type": "paragraph", "text": "You’re passing your optimizer, loss function, and metrics as strings, which is possible because rmsprop, binary_crossentropy, and accuracy are packaged as part of Keras. Sometimes you may want to configure the parameters of your optimizer or pass a custom loss function or metric function. The former can be done by passing an optimizer class instance as the optimizer argument, as shown in listing 3.5; the latter can be done by passing function objects as the loss and/or metrics arguments, as shown in listing 3.6.", "words": [{"w": "You’re", "b": [0.1294, 0.263, 0.1983, 0.2828]}, {"w": "passing", "b": [0.2046, 0.263, 0.2803, 0.2828]}, {"w": "your", "b": [0.2866, 0.263, 0.3329, 0.2828]}, {"w": "optimizer,", "b": [0.3392, 0.263, 0.4411, 0.2828]}, {"w": "loss", "b": [0.4474, 0.263, 0.4867, 0.2828]}, {"w": "function,", "b": [0.493, 0.263, 0.5834, 0.2828]}, {"w": "and", "b": [0.5897, 0.263, 0.6261, 0.2828]}, {"w": "metrics", "b": [0.6324, 0.263, 0.7067, 0.2828]}, {"w": "as", "b": [0.713, 0.263, 0.734, 0.2828]}, {"w": "strings,", "b": [0.7403, 0.263, 0.8139, 0.2828]}, {"w": "which", "b": [0.1294, 0.2835, 0.1911, 0.3033]}, {"w": "is", "b": [0.1974, 0.2835, 0.2142, 0.3033]}, {"w": "possible", "b": [0.2205, 0.2835, 0.3032, 0.3033]}, {"w": "because", "b": [0.3095, 0.2835, 0.3893, 0.3033]}, {"w": "rmsprop,", "b": [0.3956, 0.2835, 0.5079, 0.3048]}, {"w": "binary_crossentropy,", "b": [0.5142, 0.2835, 0.8081, 0.3048]}, {"w": "and", "b": [0.8144, 0.2835, 0.8508, 0.3033]}, {"w": "accuracy", "b": [0.1294, 0.306, 0.2505, 0.3262]}, {"w": "are", "b": [0.2568, 0.3049, 0.2876, 0.3247]}, {"w": "packaged", "b": [0.2939, 0.3049, 0.3892, 0.3247]}, {"w": "as", "b": [0.3955, 0.3049, 0.4165, 0.3247]}, {"w": "part", "b": [0.4228, 0.3049, 0.462, 0.3247]}, {"w": "of", "b": [0.4683, 0.3049, 0.4894, 0.3247]}, {"w": "Keras.", "b": [0.4957, 0.3049, 0.5608, 0.3247]}, {"w": "Sometimes", "b": [0.5671, 0.3049, 0.6792, 0.3247]}, {"w": "you", "b": [0.6855, 0.3049, 0.7234, 0.3247]}, {"w": "may", "b": [0.7297, 0.3049, 0.7731, 0.3247]}, {"w": "want", "b": [0.7794, 0.3049, 0.8285, 0.3247]}, {"w": "to", "b": [0.8348, 0.3049, 0.8544, 0.3247]}, {"w": "configure", "b": [0.1294, 0.3263, 0.2261, 0.3461]}, {"w": "the", "b": [0.2324, 0.3263, 0.2632, 0.3461]}, {"w": "parameters", "b": [0.2695, 0.3263, 0.3802, 0.3461]}, {"w": "of", "b": [0.3865, 0.3263, 0.4075, 0.3461]}, {"w": "your", "b": [0.4138, 0.3263, 0.46, 0.3461]}, {"w": "optimizer", "b": [0.4664, 0.3263, 0.563, 0.3461]}, {"w": "or", "b": [0.5693, 0.3263, 0.5904, 0.3461]}, {"w": "pass", "b": [0.5967, 0.3263, 0.6401, 0.3461]}, {"w": "a", "b": [0.6464, 0.3263, 0.6576, 0.3461]}, {"w": "custom", "b": [0.6639, 0.3263, 0.7368, 0.3461]}, {"w": "loss", "b": [0.7431, 0.3263, 0.7824, 0.3461]}, {"w": "function", "b": [0.1294, 0.3468, 0.2135, 0.3666]}, {"w": "or", "b": [0.2198, 0.3468, 0.2408, 0.3666]}, {"w": "metric", "b": [0.2471, 0.3468, 0.3116, 0.3666]}, {"w": "function.", "b": [0.3179, 0.3468, 0.4083, 0.3666]}, {"w": "The", "b": [0.4146, 0.3468, 0.4538, 0.3666]}, {"w": "former", "b": [0.4601, 0.3468, 0.5287, 0.3666]}, {"w": "can", "b": [0.535, 0.3468, 0.5701, 0.3666]}, {"w": "be", "b": [0.5764, 0.3468, 0.6002, 0.3666]}, {"w": "done", "b": [0.6065, 0.3468, 0.6555, 0.3666]}, {"w": "by", "b": [0.6618, 0.3468, 0.6871, 0.3666]}, {"w": "passing", "b": [0.6934, 0.3468, 0.769, 0.3666]}, {"w": "an", "b": [0.7753, 0.3468, 0.7992, 0.3666]}, {"w": "optimizer", "b": [0.1294, 0.3673, 0.2261, 0.3871]}, {"w": "class", "b": [0.2324, 0.3673, 0.2814, 0.3871]}, {"w": "instance", "b": [0.2878, 0.3673, 0.3704, 0.3871]}, {"w": "as", "b": [0.3767, 0.3673, 0.3977, 0.3871]}, {"w": "the", "b": [0.404, 0.3673, 0.4349, 0.3871]}, {"w": "optimizer", "b": [0.4411, 0.3684, 0.5773, 0.3886]}, {"w": "argument,", "b": [0.5837, 0.3673, 0.6848, 0.3871]}, {"w": "as", "b": [0.6911, 0.3673, 0.7121, 0.3871]}, {"w": "shown", "b": [0.7184, 0.3673, 0.7843, 0.3871]}, {"w": "in", "b": [0.7906, 0.3673, 0.8102, 0.3871]}, {"w": "listing", "b": [0.1294, 0.3887, 0.1925, 0.4085]}, {"w": "3.5;", "b": [0.1988, 0.3887, 0.2373, 0.4085]}, {"w": "the", "b": [0.2436, 0.3887, 0.2745, 0.4085]}, {"w": "latter", "b": [0.2808, 0.3887, 0.3326, 0.4085]}, {"w": "can", "b": [0.3389, 0.3887, 0.3739, 0.4085]}, {"w": "be", "b": [0.3802, 0.3887, 0.404, 0.4085]}, {"w": "done", "b": [0.4104, 0.3887, 0.4594, 0.4085]}, {"w": "by", "b": [0.4657, 0.3887, 0.4909, 0.4085]}, {"w": "passing", "b": [0.4972, 0.3887, 0.5729, 0.4085]}, {"w": "function", "b": [0.5792, 0.3887, 0.6633, 0.4085]}, {"w": "objects", "b": [0.6696, 0.3887, 0.7411, 0.4085]}, {"w": "as", "b": [0.7474, 0.3887, 0.7684, 0.4085]}, {"w": "the", "b": [0.7747, 0.3887, 0.8055, 0.4085]}, {"w": "loss", "b": [0.1294, 0.4103, 0.19, 0.4305]}, {"w": "and/or", "b": [0.1963, 0.4092, 0.2607, 0.429]}, {"w": "metrics", "b": [0.267, 0.4103, 0.373, 0.4305]}, {"w": "arguments,", "b": [0.3793, 0.4092, 0.4902, 0.429]}, {"w": "as", "b": [0.4965, 0.4092, 0.5175, 0.429]}, {"w": "shown", "b": [0.5238, 0.4092, 0.5897, 0.429]}, {"w": "in", "b": [0.596, 0.4092, 0.6156, 0.429]}, {"w": "listing", "b": [0.6219, 0.4092, 0.685, 0.429]}, {"w": "3.6.", "b": [0.6913, 0.4092, 0.7291, 0.429]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 3.5. Configuring the optimizer", "words": [{"w": "Listing", "b": [0.1294, 0.448, 0.1862, 0.4628]}, {"w": "3.5.", "b": [0.1909, 0.448, 0.2193, 0.4628]}, {"w": "Configuring", "b": [0.224, 0.448, 0.3228, 0.4628]}, {"w": "the", "b": [0.3276, 0.448, 0.3528, 0.4628]}, {"w": "optimizer", "b": [0.3575, 0.448, 0.4353, 0.4628]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras import optimizers model.compile(optimizer=optimizers.RMSprop(lr=0.001), loss='binary_crossentropy', metrics=['accuracy'])", "words": [{"w": "from", "b": [0.1357, 0.4764, 0.1811, 0.4915]}, {"w": "keras", "b": [0.1925, 0.4764, 0.2492, 0.4915]}, {"w": "import", "b": [0.2606, 0.4764, 0.3287, 0.4915]}, {"w": "optimizers", "b": [0.34, 0.4764, 0.4536, 0.4915]}, {"w": "model.compile(optimizer=optimizers.RMSprop(lr=0.001),", "b": [0.1357, 0.5067, 0.7374, 0.5218]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.5218, 0.6011, 0.537]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.537, 0.533, 0.5521]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 3.6. Using custom losses and metrics", "words": [{"w": "Listing", "b": [0.1294, 0.5656, 0.1862, 0.5804]}, {"w": "3.6.", "b": [0.1909, 0.5656, 0.2193, 0.5804]}, {"w": "Using", "b": [0.224, 0.5656, 0.2703, 0.5804]}, {"w": "custom", "b": [0.275, 0.5656, 0.3328, 0.5804]}, {"w": "losses", "b": [0.3375, 0.5656, 0.3827, 0.5804]}, {"w": "and", "b": [0.3875, 0.5656, 0.418, 0.5804]}, {"w": "metrics", "b": [0.4227, 0.5656, 0.4826, 0.5804]}]}, {"id": "b_7", "type": "paragraph", "text": "from keras import losses from keras import metrics model.compile(optimizer=optimizers.RMSprop(lr=0.001), loss=losses.binary_crossentropy, metrics=[metrics.binary_accuracy])", "words": [{"w": "from", "b": [0.1357, 0.594, 0.1811, 0.6092]}, {"w": "keras", "b": [0.1925, 0.594, 0.2492, 0.6092]}, {"w": "import", "b": [0.2606, 0.594, 0.3287, 0.6092]}, {"w": "losses", "b": [0.34, 0.594, 0.4082, 0.6092]}, {"w": "from", "b": [0.1357, 0.6092, 0.1811, 0.6243]}, {"w": "keras", "b": [0.1925, 0.6092, 0.2492, 0.6243]}, {"w": "import", "b": [0.2606, 0.6092, 0.3287, 0.6243]}, {"w": "metrics", "b": [0.34, 0.6092, 0.4195, 0.6243]}, {"w": "model.compile(optimizer=optimizers.RMSprop(lr=0.001),", "b": [0.1357, 0.6395, 0.7374, 0.6546]}, {"w": "loss=losses.binary_crossentropy,", "b": [0.2946, 0.6546, 0.6579, 0.6698]}, {"w": "metrics=[metrics.binary_accuracy])", "b": [0.2946, 0.6698, 0.6806, 0.6849]}]}, {"id": "b_8", "type": "paragraph", "text": "3.4.4. Validating your approach", "words": [{"w": "3.4.4.", "b": [0.1294, 0.7123, 0.1862, 0.732]}, {"w": "Validating", "b": [0.1925, 0.7123, 0.3037, 0.732]}, {"w": "your", "b": [0.31, 0.7123, 0.3605, 0.732]}, {"w": "approach", "b": [0.3668, 0.7123, 0.4686, 0.732]}]}, {"id": "b_9", "type": "paragraph", "text": "In order to monitor during training the accuracy of the model on data it has never seen before, you’ll create a validation set by setting apart 10,000 samples from the original training data.", "words": [{"w": "In", "b": [0.1294, 0.7551, 0.1504, 0.7748]}, {"w": "order", "b": [0.1567, 0.7551, 0.21, 0.7748]}, {"w": "to", "b": [0.2163, 0.7551, 0.2359, 0.7748]}, {"w": "monitor", "b": [0.2422, 0.7551, 0.3221, 0.7748]}, {"w": "during", "b": [0.3284, 0.7551, 0.3943, 0.7748]}, {"w": "training", "b": [0.4006, 0.7551, 0.479, 0.7748]}, {"w": "the", "b": [0.4853, 0.7551, 0.5162, 0.7748]}, {"w": "accuracy", "b": [0.5225, 0.7551, 0.6121, 0.7748]}, {"w": "of", "b": [0.6184, 0.7551, 0.6394, 0.7748]}, {"w": "the", "b": [0.6457, 0.7551, 0.6766, 0.7748]}, {"w": "model", "b": [0.6829, 0.7551, 0.7459, 0.7748]}, {"w": "on", "b": [0.7522, 0.7551, 0.7775, 0.7748]}, {"w": "data", "b": [0.7838, 0.7551, 0.8258, 0.7748]}, {"w": "it", "b": [0.8321, 0.7551, 0.8461, 0.7748]}, {"w": "has", "b": [0.1294, 0.7756, 0.163, 0.7953]}, {"w": "never", "b": [0.1693, 0.7756, 0.2254, 0.7953]}, {"w": "seen", "b": [0.2317, 0.7756, 0.2765, 0.7953]}, {"w": "before,", "b": [0.2828, 0.7756, 0.3535, 0.7953]}, {"w": "you’ll", "b": [0.3598, 0.7756, 0.4201, 0.7953]}, {"w": "create", "b": [0.4264, 0.7756, 0.4866, 0.7953]}, {"w": "a", "b": [0.4929, 0.7756, 0.5041, 0.7953]}, {"w": "validation", "b": [0.5104, 0.7756, 0.6114, 0.7953]}, {"w": "set", "b": [0.6176, 0.7756, 0.6456, 0.7953]}, {"w": "by", "b": [0.6519, 0.7756, 0.6771, 0.7953]}, {"w": "setting", "b": [0.6834, 0.7756, 0.7507, 0.7953]}, {"w": "apart", "b": [0.757, 0.7756, 0.8074, 0.7953]}, {"w": "10,000", "b": [0.1294, 0.7961, 0.1988, 0.8158]}, {"w": "samples", "b": [0.2051, 0.7961, 0.2864, 0.8158]}, {"w": "from", "b": [0.2927, 0.7961, 0.3417, 0.8158]}, {"w": "the", "b": [0.348, 0.7961, 0.3788, 0.8158]}, {"w": "original", "b": [0.3852, 0.7961, 0.4636, 0.8158]}, {"w": "training", "b": [0.4699, 0.7961, 0.5484, 0.8158]}, {"w": "data.", "b": [0.5547, 0.7961, 0.6031, 0.8158]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 3.7. Setting aside a validation set", "words": [{"w": "Listing", "b": [0.1294, 0.8339, 0.1862, 0.8487]}, {"w": "3.7.", "b": [0.1909, 0.8339, 0.2193, 0.8487]}, {"w": "Setting", "b": [0.224, 0.8339, 0.2808, 0.8487]}, {"w": "aside", "b": [0.2855, 0.8339, 0.3265, 0.8487]}, {"w": "a", "b": [0.3312, 0.8339, 0.3407, 0.8487]}, {"w": "validation", "b": [0.3454, 0.8339, 0.4264, 0.8487]}, {"w": "set", "b": [0.4311, 0.8339, 0.4532, 0.8487]}]}, {"id": "b_11", "type": "equation", "text": "x_val = x_train[:10000] partial_x_train = x_train[10000:]", "words": [{"w": "x_val", "b": [0.1357, 0.8623, 0.1925, 0.8775]}, {"w": "=", "b": [0.2038, 0.8623, 0.2152, 0.8775]}, {"w": "x_train[:10000]", "b": [0.2265, 0.8623, 0.3968, 0.8775]}, {"w": "partial_x_train", "b": [0.1357, 0.8775, 0.306, 0.8926]}, {"w": "=", "b": [0.3173, 0.8775, 0.3287, 0.8926]}, {"w": "x_train[10000:]", "b": [0.34, 0.8775, 0.5103, 0.8926]}]}]}, {"page": 115, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "y_val = y_train[:10000] partial_y_train = y_train[10000:]", "words": [{"w": "y_val", "b": [0.1357, 0.0851, 0.1925, 0.1002]}, {"w": "=", "b": [0.2038, 0.0851, 0.2152, 0.1002]}, {"w": "y_train[:10000]", "b": [0.2265, 0.0851, 0.3968, 0.1002]}, {"w": "partial_y_train", "b": [0.1357, 0.1002, 0.306, 0.1154]}, {"w": "=", "b": [0.3173, 0.1002, 0.3287, 0.1154]}, {"w": "y_train[10000:]", "b": [0.34, 0.1002, 0.5103, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "You’ll now train the model for 20 epochs (20 iterations over all samples in the x_train and y_train tensors), in mini-batches of 512 samples. At the same time, you’ll monitor loss and accuracy on the 10,000 samples that you set apart. You do so by passing the validation data as the validation_data argument.", "words": [{"w": "You’ll", "b": [0.1294, 0.1383, 0.1928, 0.158]}, {"w": "now", "b": [0.1991, 0.1383, 0.2425, 0.158]}, {"w": "train", "b": [0.2488, 0.1383, 0.295, 0.158]}, {"w": "the", "b": [0.3014, 0.1383, 0.3322, 0.158]}, {"w": "model", "b": [0.3385, 0.1383, 0.4015, 0.158]}, {"w": "for", "b": [0.4079, 0.1383, 0.4373, 0.158]}, {"w": "20", "b": [0.4436, 0.1383, 0.4688, 0.158]}, {"w": "epochs", "b": [0.4751, 0.1383, 0.5452, 0.158]}, {"w": "(20", "b": [0.5515, 0.1383, 0.5851, 0.158]}, {"w": "iterations", "b": [0.5914, 0.1383, 0.6853, 0.158]}, {"w": "over", "b": [0.6916, 0.1383, 0.7364, 0.158]}, {"w": "all", "b": [0.7427, 0.1383, 0.768, 0.158]}, {"w": "samples", "b": [0.7743, 0.1383, 0.8555, 0.158]}, {"w": "in", "b": [0.1294, 0.1588, 0.149, 0.1785]}, {"w": "the", "b": [0.1553, 0.1588, 0.1862, 0.1785]}, {"w": "x_train", "b": [0.1925, 0.1598, 0.2984, 0.18]}, {"w": "and", "b": [0.3047, 0.1588, 0.3411, 0.1785]}, {"w": "y_train", "b": [0.3474, 0.1598, 0.4534, 0.18]}, {"w": "tensors),", "b": [0.4597, 0.1588, 0.5459, 0.1785]}, {"w": "in", "b": [0.5522, 0.1588, 0.5718, 0.1785]}, {"w": "mini-batches", "b": [0.5781, 0.1588, 0.7084, 0.1785]}, {"w": "of", "b": [0.7147, 0.1588, 0.7357, 0.1785]}, {"w": "512", "b": [0.742, 0.1588, 0.7799, 0.1785]}, {"w": "samples.", "b": [0.1294, 0.1802, 0.217, 0.1999]}, {"w": "At", "b": [0.2233, 0.1802, 0.2485, 0.1999]}, {"w": "the", "b": [0.2548, 0.1802, 0.2857, 0.1999]}, {"w": "same", "b": [0.292, 0.1802, 0.3438, 0.1999]}, {"w": "time,", "b": [0.3501, 0.1802, 0.4013, 0.1999]}, {"w": "you’ll", "b": [0.4076, 0.1802, 0.4678, 0.1999]}, {"w": "monitor", "b": [0.4741, 0.1802, 0.554, 0.1999]}, {"w": "loss", "b": [0.5603, 0.1802, 0.5996, 0.1999]}, {"w": "and", "b": [0.6059, 0.1802, 0.6423, 0.1999]}, {"w": "accuracy", "b": [0.6486, 0.1802, 0.7383, 0.1999]}, {"w": "on", "b": [0.7446, 0.1802, 0.7698, 0.1999]}, {"w": "the", "b": [0.7761, 0.1802, 0.8069, 0.1999]}, {"w": "10,000", "b": [0.1294, 0.2007, 0.1988, 0.2204]}, {"w": "samples", "b": [0.2051, 0.2007, 0.2864, 0.2204]}, {"w": "that", "b": [0.2927, 0.2007, 0.3305, 0.2204]}, {"w": "you", "b": [0.3368, 0.2007, 0.3747, 0.2204]}, {"w": "set", "b": [0.3809, 0.2007, 0.409, 0.2204]}, {"w": "apart.", "b": [0.4153, 0.2007, 0.472, 0.2204]}, {"w": "You", "b": [0.4783, 0.2007, 0.5192, 0.2204]}, {"w": "do", "b": [0.5255, 0.2007, 0.5507, 0.2204]}, {"w": "so", "b": [0.5571, 0.2007, 0.5795, 0.2204]}, {"w": "by", "b": [0.5858, 0.2007, 0.611, 0.2204]}, {"w": "passing", "b": [0.6173, 0.2007, 0.693, 0.2204]}, {"w": "the", "b": [0.6993, 0.2007, 0.7301, 0.2204]}, {"w": "validation", "b": [0.7364, 0.2007, 0.8373, 0.2204]}, {"w": "data", "b": [0.1294, 0.2212, 0.1714, 0.2409]}, {"w": "as", "b": [0.1777, 0.2212, 0.1988, 0.2409]}, {"w": "the", "b": [0.2051, 0.2212, 0.2359, 0.2409]}, {"w": "validation_data", "b": [0.2422, 0.2222, 0.4692, 0.2424]}, {"w": "argument.", "b": [0.4755, 0.2212, 0.5766, 0.2409]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.8. Training your model", "words": [{"w": "Listing", "b": [0.1294, 0.2599, 0.1862, 0.2747]}, {"w": "3.8.", "b": [0.1909, 0.2599, 0.2193, 0.2747]}, {"w": "Training", "b": [0.224, 0.2599, 0.2941, 0.2747]}, {"w": "your", "b": [0.2988, 0.2599, 0.3367, 0.2747]}, {"w": "model", "b": [0.3414, 0.2599, 0.3908, 0.2747]}]}, {"id": "b_3", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(partial_x_train, partial_y_train, epochs=20, batch_size=512, validation_data=(x_val, y_val))", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.2883, 0.5217, 0.3034]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.3035, 0.6011, 0.3186]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.3186, 0.4763, 0.3338]}, {"w": "history", "b": [0.1357, 0.3489, 0.2152, 0.3641]}, {"w": "=", "b": [0.2265, 0.3489, 0.2379, 0.3641]}, {"w": "model.fit(partial_x_train,", "b": [0.2492, 0.3489, 0.5444, 0.3641]}, {"w": "partial_y_train,", "b": [0.3628, 0.3641, 0.5444, 0.3792]}, {"w": "epochs=20,", "b": [0.3628, 0.3792, 0.4763, 0.3944]}, {"w": "batch_size=512,", "b": [0.3628, 0.3944, 0.533, 0.4095]}, {"w": "validation_data=(x_val,", "b": [0.3628, 0.4095, 0.6238, 0.4247]}, {"w": "y_val))", "b": [0.6352, 0.4095, 0.7146, 0.4247]}]}, {"id": "b_4", "type": "paragraph", "text": "On CPU, this will take less than 2 seconds per epoch—training is over in 20 seconds. At the end of every epoch, there is a slight pause as the model computes its loss and accuracy on the 10,000 samples of the validation data.", "words": [{"w": "On", "b": [0.1294, 0.4476, 0.1602, 0.4673]}, {"w": "CPU,", "b": [0.1665, 0.4476, 0.2219, 0.4673]}, {"w": "this", "b": [0.2282, 0.4476, 0.2647, 0.4673]}, {"w": "will", "b": [0.271, 0.4476, 0.3102, 0.4673]}, {"w": "take", "b": [0.3165, 0.4476, 0.3586, 0.4673]}, {"w": "less", "b": [0.3649, 0.4476, 0.4027, 0.4673]}, {"w": "than", "b": [0.409, 0.4476, 0.4525, 0.4673]}, {"w": "2", "b": [0.4588, 0.4476, 0.4714, 0.4673]}, {"w": "seconds", "b": [0.4777, 0.4476, 0.5575, 0.4673]}, {"w": "per", "b": [0.5639, 0.4476, 0.5961, 0.4673]}, {"w": "epoch—training", "b": [0.6024, 0.4476, 0.7663, 0.4673]}, {"w": "is", "b": [0.7726, 0.4476, 0.7894, 0.4673]}, {"w": "over", "b": [0.7958, 0.4476, 0.8406, 0.4673]}, {"w": "in", "b": [0.8469, 0.4476, 0.8665, 0.4673]}, {"w": "20", "b": [0.1294, 0.4681, 0.1546, 0.4878]}, {"w": "seconds.", "b": [0.1609, 0.4681, 0.2471, 0.4878]}, {"w": "At", "b": [0.2534, 0.4681, 0.2786, 0.4878]}, {"w": "the", "b": [0.285, 0.4681, 0.3158, 0.4878]}, {"w": "end", "b": [0.3221, 0.4681, 0.3585, 0.4878]}, {"w": "of", "b": [0.3648, 0.4681, 0.3858, 0.4878]}, {"w": "every", "b": [0.3921, 0.4681, 0.4482, 0.4878]}, {"w": "epoch,", "b": [0.4545, 0.4681, 0.521, 0.4878]}, {"w": "there", "b": [0.5273, 0.4681, 0.5777, 0.4878]}, {"w": "is", "b": [0.5841, 0.4681, 0.6009, 0.4878]}, {"w": "a", "b": [0.6072, 0.4681, 0.6184, 0.4878]}, {"w": "slight", "b": [0.6246, 0.4681, 0.6807, 0.4878]}, {"w": "pause", "b": [0.687, 0.4681, 0.7445, 0.4878]}, {"w": "as", "b": [0.7508, 0.4681, 0.7718, 0.4878]}, {"w": "the", "b": [0.7781, 0.4681, 0.8089, 0.4878]}, {"w": "model", "b": [0.1294, 0.4886, 0.1925, 0.5083]}, {"w": "computes", "b": [0.1988, 0.4886, 0.2955, 0.5083]}, {"w": "its", "b": [0.3018, 0.4886, 0.3256, 0.5083]}, {"w": "loss", "b": [0.3319, 0.4886, 0.3712, 0.5083]}, {"w": "and", "b": [0.3775, 0.4886, 0.4139, 0.5083]}, {"w": "accuracy", "b": [0.4202, 0.4886, 0.5098, 0.5083]}, {"w": "on", "b": [0.5161, 0.4886, 0.5414, 0.5083]}, {"w": "the", "b": [0.5477, 0.4886, 0.5785, 0.5083]}, {"w": "10,000", "b": [0.5848, 0.4886, 0.6542, 0.5083]}, {"w": "samples", "b": [0.6605, 0.4886, 0.7418, 0.5083]}, {"w": "of", "b": [0.7481, 0.4886, 0.7691, 0.5083]}, {"w": "the", "b": [0.7754, 0.4886, 0.8062, 0.5083]}, {"w": "validation", "b": [0.1294, 0.5091, 0.2303, 0.5288]}, {"w": "data.", "b": [0.2366, 0.5091, 0.285, 0.5288]}]}, {"id": "b_5", "type": "paragraph", "text": "Note that the call to model.fit() returns a History object. This object has a member history, which is a dictionary containing data about everything that happened during training. Let’s look at it:", "words": [{"w": "Note", "b": [0.1294, 0.5518, 0.1785, 0.5716]}, {"w": "that", "b": [0.1848, 0.5518, 0.2226, 0.5716]}, {"w": "the", "b": [0.2289, 0.5518, 0.2597, 0.5716]}, {"w": "call", "b": [0.266, 0.5518, 0.3025, 0.5716]}, {"w": "to", "b": [0.3088, 0.5518, 0.3284, 0.5716]}, {"w": "model.fit()", "b": [0.3346, 0.5529, 0.5011, 0.5731]}, {"w": "returns", "b": [0.5075, 0.5518, 0.5775, 0.5716]}, {"w": "a", "b": [0.5838, 0.5518, 0.595, 0.5716]}, {"w": "History", "b": [0.6013, 0.5529, 0.7073, 0.5731]}, {"w": "object.", "b": [0.7136, 0.5518, 0.7815, 0.5716]}, {"w": "This", "b": [0.7878, 0.5518, 0.8327, 0.5716]}, {"w": "object", "b": [0.1294, 0.5732, 0.1911, 0.593]}, {"w": "has", "b": [0.1974, 0.5732, 0.231, 0.593]}, {"w": "a", "b": [0.2373, 0.5732, 0.2485, 0.593]}, {"w": "member", "b": [0.2548, 0.5732, 0.3375, 0.593]}, {"w": "history,", "b": [0.3437, 0.5732, 0.456, 0.5945]}, {"w": "which", "b": [0.4623, 0.5732, 0.5239, 0.593]}, {"w": "is", "b": [0.5303, 0.5732, 0.5471, 0.593]}, {"w": "a", "b": [0.5534, 0.5732, 0.5646, 0.593]}, {"w": "dictionary", "b": [0.5709, 0.5732, 0.6732, 0.593]}, {"w": "containing", "b": [0.6795, 0.5732, 0.786, 0.593]}, {"w": "data", "b": [0.7923, 0.5732, 0.8343, 0.593]}, {"w": "about", "b": [0.1294, 0.5946, 0.1855, 0.6144]}, {"w": "everything", "b": [0.1918, 0.5946, 0.2997, 0.6144]}, {"w": "that", "b": [0.306, 0.5946, 0.3438, 0.6144]}, {"w": "happened", "b": [0.3501, 0.5946, 0.4468, 0.6144]}, {"w": "during", "b": [0.4531, 0.5946, 0.5189, 0.6144]}, {"w": "training.", "b": [0.5253, 0.5946, 0.61, 0.6144]}, {"w": "Let’s", "b": [0.6163, 0.5946, 0.6667, 0.6144]}, {"w": "look", "b": [0.673, 0.5946, 0.7179, 0.6144]}, {"w": "at", "b": [0.7242, 0.5946, 0.7424, 0.6144]}, {"w": "it:", "b": [0.7487, 0.5946, 0.7697, 0.6144]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> history_dict = history.history >>> history_dict.keys() [u'acc', u'loss', u'val_acc', u'val_loss']", "words": [{"w": ">>>", "b": [0.1357, 0.6324, 0.1698, 0.6475]}, {"w": "history_dict", "b": [0.1811, 0.6324, 0.3173, 0.6475]}, {"w": "=", "b": [0.3287, 0.6324, 0.34, 0.6475]}, {"w": "history.history", "b": [0.3514, 0.6324, 0.5217, 0.6475]}, {"w": ">>>", "b": [0.1357, 0.6475, 0.1698, 0.6626]}, {"w": "history_dict.keys()", "b": [0.1811, 0.6475, 0.3968, 0.6626]}, {"w": "[u'acc',", "b": [0.1357, 0.6627, 0.2265, 0.6778]}, {"w": "u'loss',", "b": [0.2379, 0.6627, 0.3287, 0.6778]}, {"w": "u'val_acc',", "b": [0.34, 0.6627, 0.4649, 0.6778]}, {"w": "u'val_loss']", "b": [0.4763, 0.6627, 0.6125, 0.6778]}]}, {"id": "b_7", "type": "paragraph", "text": "The dictionary contains four entries: one per metric that was being monitored during training and during validation. In the following two listing, let’s use Matplotlib to plot the training and validation loss side by side (see figure 3.7), as well as the training and validation accuracy (see figure 3.8). Note that your own results may vary slightly due to a different random initialization of your network.", "words": [{"w": "The", "b": [0.1294, 0.7007, 0.1686, 0.7204]}, {"w": "dictionary", "b": [0.1749, 0.7007, 0.2772, 0.7204]}, {"w": "contains", "b": [0.2835, 0.7007, 0.3676, 0.7204]}, {"w": "four", "b": [0.3739, 0.7007, 0.416, 0.7204]}, {"w": "entries:", "b": [0.4223, 0.7007, 0.4965, 0.7204]}, {"w": "one", "b": [0.5028, 0.7007, 0.5393, 0.7204]}, {"w": "per", "b": [0.5456, 0.7007, 0.5778, 0.7204]}, {"w": "metric", "b": [0.5841, 0.7007, 0.6485, 0.7204]}, {"w": "that", "b": [0.6548, 0.7007, 0.6927, 0.7204]}, {"w": "was", "b": [0.699, 0.7007, 0.7382, 0.7204]}, {"w": "being", "b": [0.7445, 0.7007, 0.8006, 0.7204]}, {"w": "monitored", "b": [0.1294, 0.7212, 0.2331, 0.7409]}, {"w": "during", "b": [0.2394, 0.7212, 0.3053, 0.7409]}, {"w": "training", "b": [0.3116, 0.7212, 0.3901, 0.7409]}, {"w": "and", "b": [0.3964, 0.7212, 0.4328, 0.7409]}, {"w": "during", "b": [0.4391, 0.7212, 0.505, 0.7409]}, {"w": "validation.", "b": [0.5113, 0.7212, 0.6185, 0.7409]}, {"w": "In", "b": [0.6248, 0.7212, 0.6458, 0.7409]}, {"w": "the", "b": [0.6521, 0.7212, 0.6829, 0.7409]}, {"w": "following", "b": [0.6892, 0.7212, 0.7873, 0.7409]}, {"w": "two", "b": [0.7936, 0.7212, 0.8314, 0.7409]}, {"w": "listing,", "b": [0.1294, 0.7417, 0.1988, 0.7614]}, {"w": "let’s", "b": [0.2051, 0.7417, 0.2471, 0.7614]}, {"w": "use", "b": [0.2534, 0.7417, 0.2871, 0.7614]}, {"w": "Matplotlib", "b": [0.2934, 0.7417, 0.3999, 0.7614]}, {"w": "to", "b": [0.4062, 0.7417, 0.4258, 0.7614]}, {"w": "plot", "b": [0.4321, 0.7417, 0.4714, 0.7614]}, {"w": "the", "b": [0.4777, 0.7417, 0.5085, 0.7614]}, {"w": "training", "b": [0.5148, 0.7417, 0.5933, 0.7614]}, {"w": "and", "b": [0.5996, 0.7417, 0.636, 0.7614]}, {"w": "validation", "b": [0.6423, 0.7417, 0.7433, 0.7614]}, {"w": "loss", "b": [0.7496, 0.7417, 0.7888, 0.7614]}, {"w": "side", "b": [0.7951, 0.7417, 0.8358, 0.7614]}, {"w": "by", "b": [0.8421, 0.7417, 0.8673, 0.7614]}, {"w": "side", "b": [0.1294, 0.7622, 0.1701, 0.7819]}, {"w": "(see", "b": [0.1764, 0.7622, 0.217, 0.7819]}, {"w": "figure", "b": [0.2233, 0.7622, 0.2835, 0.7819]}, {"w": "3.7),", "b": [0.2898, 0.7622, 0.336, 0.7819]}, {"w": "as", "b": [0.3423, 0.7622, 0.3634, 0.7819]}, {"w": "well", "b": [0.3697, 0.7622, 0.4131, 0.7819]}, {"w": "as", "b": [0.4194, 0.7622, 0.4404, 0.7819]}, {"w": "the", "b": [0.4467, 0.7622, 0.4775, 0.7819]}, {"w": "training", "b": [0.4839, 0.7622, 0.5623, 0.7819]}, {"w": "and", "b": [0.5686, 0.7622, 0.6051, 0.7819]}, {"w": "validation", "b": [0.6114, 0.7622, 0.7123, 0.7819]}, {"w": "accuracy", "b": [0.7186, 0.7622, 0.8082, 0.7819]}, {"w": "(see", "b": [0.8145, 0.7622, 0.8551, 0.7819]}, {"w": "figure", "b": [0.1294, 0.7827, 0.1897, 0.8024]}, {"w": "3.8).", "b": [0.196, 0.7827, 0.2422, 0.8024]}, {"w": "Note", "b": [0.2485, 0.7827, 0.2975, 0.8024]}, {"w": "that", "b": [0.3038, 0.7827, 0.3417, 0.8024]}, {"w": "your", "b": [0.348, 0.7827, 0.3942, 0.8024]}, {"w": "own", "b": [0.4005, 0.7827, 0.444, 0.8024]}, {"w": "results", "b": [0.4503, 0.7827, 0.5161, 0.8024]}, {"w": "may", "b": [0.5224, 0.7827, 0.5659, 0.8024]}, {"w": "vary", "b": [0.5722, 0.7827, 0.617, 0.8024]}, {"w": "slightly", "b": [0.6233, 0.7827, 0.699, 0.8024]}, {"w": "due", "b": [0.7053, 0.7827, 0.7418, 0.8024]}, {"w": "to", "b": [0.7481, 0.7827, 0.7677, 0.8024]}, {"w": "a", "b": [0.774, 0.7827, 0.7852, 0.8024]}, {"w": "different", "b": [0.1294, 0.8032, 0.2158, 0.8229]}, {"w": "random", "b": [0.2221, 0.8032, 0.2992, 0.8229]}, {"w": "initialization", "b": [0.3055, 0.8032, 0.433, 0.8229]}, {"w": "of", "b": [0.4393, 0.8032, 0.4603, 0.8229]}, {"w": "your", "b": [0.4666, 0.8032, 0.5129, 0.8229]}, {"w": "network.", "b": [0.5192, 0.8032, 0.6082, 0.8229]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 3.7. Training and validation loss", "words": [{"w": "Figure", "b": [0.1294, 0.841, 0.1827, 0.8558]}, {"w": "3.7.", "b": [0.1874, 0.841, 0.2158, 0.8558]}, {"w": "Training", "b": [0.2205, 0.841, 0.2906, 0.8558]}, {"w": "and", "b": [0.2953, 0.841, 0.3258, 0.8558]}, {"w": "validation", "b": [0.3305, 0.841, 0.4115, 0.8558]}, {"w": "loss", "b": [0.4162, 0.841, 0.4457, 0.8558]}]}]}, {"page": 116, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 3.8. Training and validation accuracy", "words": [{"w": "Figure", "b": [0.1294, 0.357, 0.1827, 0.3718]}, {"w": "3.8.", "b": [0.1874, 0.357, 0.2158, 0.3718]}, {"w": "Training", "b": [0.2205, 0.357, 0.2906, 0.3718]}, {"w": "and", "b": [0.2953, 0.357, 0.3258, 0.3718]}, {"w": "validation", "b": [0.3305, 0.357, 0.4115, 0.3718]}, {"w": "accuracy", "b": [0.4162, 0.357, 0.4887, 0.3718]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.9. Plotting the training and validation loss", "words": [{"w": "Listing", "b": [0.1294, 0.6574, 0.1862, 0.6722]}, {"w": "3.9.", "b": [0.1909, 0.6574, 0.2193, 0.6722]}, {"w": "Plotting", "b": [0.224, 0.6574, 0.2881, 0.6722]}, {"w": "the", "b": [0.2929, 0.6574, 0.3181, 0.6722]}, {"w": "training", "b": [0.3228, 0.6574, 0.388, 0.6722]}, {"w": "and", "b": [0.3927, 0.6574, 0.4232, 0.6722]}, {"w": "validation", "b": [0.4279, 0.6574, 0.5089, 0.6722]}, {"w": "loss", "b": [0.5136, 0.6574, 0.5431, 0.6722]}]}, {"id": "b_2", "type": "paragraph", "text": "import matplotlib.pyplot as plt history_dict = history.history loss_values = history_dict['loss'] val_loss_values = history_dict['val_loss'] epochs = range(1, len(acc) + 1) plt.plot(epochs, loss_values, 'bo', label='Training loss') 1 plt.plot(epochs, val_loss_values, 'b', label='Validation loss') 2 plt.title('Training and validation loss') plt.xlabel('Epochs') plt.ylabel('Loss')", "words": [{"w": "import", "b": [0.1357, 0.6858, 0.2038, 0.701]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.6858, 0.4082, 0.701]}, {"w": "as", "b": [0.4195, 0.6858, 0.4422, 0.701]}, {"w": "plt", "b": [0.4536, 0.6858, 0.4876, 0.701]}, {"w": "history_dict", "b": [0.1357, 0.7161, 0.2719, 0.7313]}, {"w": "=", "b": [0.2833, 0.7161, 0.2946, 0.7313]}, {"w": "history.history", "b": [0.306, 0.7161, 0.4763, 0.7313]}, {"w": "loss_values", "b": [0.1357, 0.7313, 0.2606, 0.7464]}, {"w": "=", "b": [0.2719, 0.7313, 0.2833, 0.7464]}, {"w": "history_dict['loss']", "b": [0.2946, 0.7313, 0.5217, 0.7464]}, {"w": "val_loss_values", "b": [0.1357, 0.7464, 0.306, 0.7616]}, {"w": "=", "b": [0.3173, 0.7464, 0.3287, 0.7616]}, {"w": "history_dict['val_loss']", "b": [0.34, 0.7464, 0.6125, 0.7616]}, {"w": "epochs", "b": [0.1357, 0.7767, 0.2038, 0.7919]}, {"w": "=", "b": [0.2152, 0.7767, 0.2265, 0.7919]}, {"w": "range(1,", "b": [0.2379, 0.7767, 0.3287, 0.7919]}, {"w": "len(acc)", "b": [0.34, 0.7767, 0.4309, 0.7919]}, {"w": "+", "b": [0.4422, 0.7767, 0.4536, 0.7919]}, {"w": "1)", "b": [0.4649, 0.7767, 0.4876, 0.7919]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.807, 0.3173, 0.8222]}, {"w": "loss_values,", "b": [0.3287, 0.807, 0.4649, 0.8222]}, {"w": "'bo',", "b": [0.4763, 0.807, 0.533, 0.8222]}, {"w": "label='Training", "b": [0.5444, 0.807, 0.7146, 0.8222]}, {"w": "loss')", "b": [0.726, 0.807, 0.7941, 0.8222]}, {"w": "1", "b": [0.1357, 0.8222, 0.1471, 0.8373]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.8374, 0.3173, 0.8525]}, {"w": "val_loss_values,", "b": [0.3287, 0.8374, 0.5103, 0.8525]}, {"w": "'b',", "b": [0.5217, 0.8374, 0.5671, 0.8525]}, {"w": "label='Validation", "b": [0.5784, 0.8374, 0.7714, 0.8525]}, {"w": "loss')", "b": [0.7828, 0.8374, 0.8509, 0.8525]}, {"w": "2", "b": [0.1357, 0.8525, 0.1471, 0.8677]}, {"w": "plt.title('Training", "b": [0.1357, 0.8677, 0.3514, 0.8828]}, {"w": "and", "b": [0.3628, 0.8677, 0.3968, 0.8828]}, {"w": "validation", "b": [0.4082, 0.8677, 0.5217, 0.8828]}, {"w": "loss')", "b": [0.533, 0.8677, 0.6011, 0.8828]}, {"w": "plt.xlabel('Epochs')", "b": [0.1357, 0.8828, 0.3628, 0.898]}, {"w": "plt.ylabel('Loss')", "b": [0.1357, 0.898, 0.34, 0.9131]}]}]}, {"page": 117, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "plt.legend() plt.show()", "words": [{"w": "plt.legend()", "b": [0.1357, 0.0851, 0.2719, 0.1002]}, {"w": "plt.show()", "b": [0.1357, 0.1154, 0.2492, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "1 “bo” is for “blue dot.” 2 “b” is for “solid blue line.”", "words": [{"w": "1", "b": [0.1799, 0.149, 0.1925, 0.1687]}, {"w": "“bo”", "b": [0.1988, 0.149, 0.2506, 0.1687]}, {"w": "is", "b": [0.257, 0.149, 0.2738, 0.1687]}, {"w": "for", "b": [0.2801, 0.149, 0.3123, 0.1687]}, {"w": "“blue", "b": [0.3186, 0.149, 0.3775, 0.1687]}, {"w": "dot.”", "b": [0.3838, 0.149, 0.4377, 0.1687]}, {"w": "2", "b": [0.1799, 0.1695, 0.1925, 0.1892]}, {"w": "“b”", "b": [0.1988, 0.1695, 0.238, 0.1892]}, {"w": "is", "b": [0.2443, 0.1695, 0.2612, 0.1892]}, {"w": "for", "b": [0.2675, 0.1695, 0.2997, 0.1892]}, {"w": "“solid", "b": [0.306, 0.1695, 0.3691, 0.1892]}, {"w": "blue", "b": [0.3754, 0.1695, 0.4217, 0.1892]}, {"w": "line.”", "b": [0.428, 0.1695, 0.4861, 0.1892]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.10. Plotting the training and validation accuracy", "words": [{"w": "Listing", "b": [0.1294, 0.2073, 0.1862, 0.2221]}, {"w": "3.10.", "b": [0.1909, 0.2073, 0.2288, 0.2221]}, {"w": "Plotting", "b": [0.2335, 0.2073, 0.2976, 0.2221]}, {"w": "the", "b": [0.3023, 0.2073, 0.3275, 0.2221]}, {"w": "training", "b": [0.3323, 0.2073, 0.3974, 0.2221]}, {"w": "and", "b": [0.4022, 0.2073, 0.4327, 0.2221]}, {"w": "validation", "b": [0.4374, 0.2073, 0.5184, 0.2221]}, {"w": "accuracy", "b": [0.5231, 0.2073, 0.5956, 0.2221]}]}, {"id": "b_3", "type": "paragraph", "text": "plt.clf() 1 acc_values = history_dict['acc'] val_acc_values = history_dict['val_acc'] plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.xlabel('Epochs') plt.ylabel('Loss') plt.legend() plt.show()", "words": [{"w": "plt.clf()", "b": [0.1357, 0.2357, 0.2379, 0.2509]}, {"w": "1", "b": [0.6693, 0.2357, 0.6807, 0.2509]}, {"w": "acc_values", "b": [0.1357, 0.2509, 0.2492, 0.266]}, {"w": "=", "b": [0.2606, 0.2509, 0.2719, 0.266]}, {"w": "history_dict['acc']", "b": [0.2833, 0.2509, 0.499, 0.266]}, {"w": "val_acc_values", "b": [0.1357, 0.266, 0.2946, 0.2812]}, {"w": "=", "b": [0.306, 0.266, 0.3173, 0.2812]}, {"w": "history_dict['val_acc']", "b": [0.3287, 0.266, 0.5898, 0.2812]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.2963, 0.3173, 0.3115]}, {"w": "acc,", "b": [0.3287, 0.2963, 0.3741, 0.3115]}, {"w": "'bo',", "b": [0.3855, 0.2963, 0.4422, 0.3115]}, {"w": "label='Training", "b": [0.4536, 0.2963, 0.6238, 0.3115]}, {"w": "acc')", "b": [0.6352, 0.2963, 0.6919, 0.3115]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.3115, 0.3173, 0.3266]}, {"w": "val_acc,", "b": [0.3287, 0.3115, 0.4195, 0.3266]}, {"w": "'b',", "b": [0.4309, 0.3115, 0.4763, 0.3266]}, {"w": "label='Validation", "b": [0.4876, 0.3115, 0.6806, 0.3266]}, {"w": "acc')", "b": [0.6919, 0.3115, 0.7487, 0.3266]}, {"w": "plt.title('Training", "b": [0.1357, 0.3266, 0.3514, 0.3418]}, {"w": "and", "b": [0.3628, 0.3266, 0.3968, 0.3418]}, {"w": "validation", "b": [0.4082, 0.3266, 0.5217, 0.3418]}, {"w": "accuracy')", "b": [0.533, 0.3266, 0.6465, 0.3418]}, {"w": "plt.xlabel('Epochs')", "b": [0.1357, 0.3418, 0.3628, 0.3569]}, {"w": "plt.ylabel('Loss')", "b": [0.1357, 0.3569, 0.34, 0.3721]}, {"w": "plt.legend()", "b": [0.1357, 0.3721, 0.2719, 0.3872]}, {"w": "plt.show()", "b": [0.1357, 0.4024, 0.2492, 0.4175]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Clears the figure", "words": [{"w": "1", "b": [0.1799, 0.436, 0.1925, 0.4557]}, {"w": "Clears", "b": [0.1988, 0.436, 0.2688, 0.4557]}, {"w": "the", "b": [0.2751, 0.436, 0.3088, 0.4557]}, {"w": "figure", "b": [0.3151, 0.436, 0.3791, 0.4557]}]}, {"id": "b_5", "type": "paragraph", "text": "As you can see, the training loss decreases with every epoch, and the training accuracy increases with every epoch. That’s what you would expect when running gradient-descent optimization—the quantity you’re trying to minimize should be less with every iteration. But that isn’t the case for the validation loss and accuracy: they seem to peak at the fourth epoch. This is an example of what we warned against earlier: a model that performs better on the training data isn’t necessarily a model that will do better on data it has never seen before. In precise terms, what you’re seeing is overfitting: after the second epoch, you’re overoptimizing on the training data, and you end up learning representations that are specific to the training data and don’t generalize to data outside of the training set.", "words": [{"w": "As", "b": [0.1294, 0.4787, 0.1574, 0.4985]}, {"w": "you", "b": [0.1637, 0.4787, 0.2016, 0.4985]}, {"w": "can", "b": [0.2079, 0.4787, 0.2429, 0.4985]}, {"w": "see,", "b": [0.2492, 0.4787, 0.2877, 0.4985]}, {"w": "the", "b": [0.294, 0.4787, 0.3249, 0.4985]}, {"w": "training", "b": [0.3312, 0.4787, 0.4096, 0.4985]}, {"w": "loss", "b": [0.416, 0.4787, 0.4552, 0.4985]}, {"w": "decreases", "b": [0.4615, 0.4787, 0.5581, 0.4985]}, {"w": "with", "b": [0.5645, 0.4787, 0.6093, 0.4985]}, {"w": "every", "b": [0.6156, 0.4787, 0.6716, 0.4985]}, {"w": "epoch,", "b": [0.6779, 0.4787, 0.7445, 0.4985]}, {"w": "and", "b": [0.7508, 0.4787, 0.7872, 0.4985]}, {"w": "the", "b": [0.7935, 0.4787, 0.8244, 0.4985]}, {"w": "training", "b": [0.1294, 0.4992, 0.2079, 0.519]}, {"w": "accuracy", "b": [0.2142, 0.4992, 0.3038, 0.519]}, {"w": "increases", "b": [0.3101, 0.4992, 0.4026, 0.519]}, {"w": "with", "b": [0.4089, 0.4992, 0.4537, 0.519]}, {"w": "every", "b": [0.46, 0.4992, 0.5161, 0.519]}, {"w": "epoch.", "b": [0.5224, 0.4992, 0.5889, 0.519]}, {"w": "That’s", "b": [0.5952, 0.4992, 0.6582, 0.519]}, {"w": "what", "b": [0.6645, 0.4992, 0.7136, 0.519]}, {"w": "you", "b": [0.7199, 0.4992, 0.7577, 0.519]}, {"w": "would", "b": [0.764, 0.4992, 0.8271, 0.519]}, {"w": "expect", "b": [0.1294, 0.5197, 0.1953, 0.5395]}, {"w": "when", "b": [0.2016, 0.5197, 0.2562, 0.5395]}, {"w": "running", "b": [0.2625, 0.5197, 0.341, 0.5395]}, {"w": "gradient-descent", "b": [0.3473, 0.5197, 0.514, 0.5395]}, {"w": "optimization—the", "b": [0.5203, 0.5197, 0.7039, 0.5395]}, {"w": "quantity", "b": [0.7102, 0.5197, 0.7929, 0.5395]}, {"w": "you’re", "b": [0.7992, 0.5197, 0.865, 0.5395]}, {"w": "trying", "b": [0.1294, 0.5402, 0.1897, 0.56]}, {"w": "to", "b": [0.196, 0.5402, 0.2156, 0.56]}, {"w": "minimize", "b": [0.2219, 0.5402, 0.3172, 0.56]}, {"w": "should", "b": [0.3235, 0.5402, 0.3908, 0.56]}, {"w": "be", "b": [0.3971, 0.5402, 0.4209, 0.56]}, {"w": "less", "b": [0.4272, 0.5402, 0.4651, 0.56]}, {"w": "with", "b": [0.4714, 0.5402, 0.5162, 0.56]}, {"w": "every", "b": [0.5225, 0.5402, 0.5785, 0.56]}, {"w": "iteration.", "b": [0.5848, 0.5402, 0.6752, 0.56]}, {"w": "But", "b": [0.6815, 0.5402, 0.718, 0.56]}, {"w": "that", "b": [0.7243, 0.5402, 0.7621, 0.56]}, {"w": "isn’t", "b": [0.7684, 0.5402, 0.8128, 0.56]}, {"w": "the", "b": [0.8191, 0.5402, 0.8499, 0.56]}, {"w": "case", "b": [0.1294, 0.5607, 0.1728, 0.5805]}, {"w": "for", "b": [0.1791, 0.5607, 0.2085, 0.5805]}, {"w": "the", "b": [0.2149, 0.5607, 0.2457, 0.5805]}, {"w": "validation", "b": [0.252, 0.5607, 0.3529, 0.5805]}, {"w": "loss", "b": [0.3592, 0.5607, 0.3984, 0.5805]}, {"w": "and", "b": [0.4048, 0.5607, 0.4412, 0.5805]}, {"w": "accuracy:", "b": [0.4475, 0.5607, 0.5441, 0.5805]}, {"w": "they", "b": [0.5504, 0.5607, 0.5939, 0.5805]}, {"w": "seem", "b": [0.6002, 0.5607, 0.652, 0.5805]}, {"w": "to", "b": [0.6583, 0.5607, 0.6779, 0.5805]}, {"w": "peak", "b": [0.6843, 0.5607, 0.7319, 0.5805]}, {"w": "at", "b": [0.7382, 0.5607, 0.7564, 0.5805]}, {"w": "the", "b": [0.7627, 0.5607, 0.7935, 0.5805]}, {"w": "fourth", "b": [0.7998, 0.5607, 0.8615, 0.5805]}, {"w": "epoch.", "b": [0.1294, 0.5812, 0.196, 0.601]}, {"w": "This", "b": [0.2023, 0.5812, 0.2471, 0.601]}, {"w": "is", "b": [0.2534, 0.5812, 0.2702, 0.601]}, {"w": "an", "b": [0.2765, 0.5812, 0.3003, 0.601]}, {"w": "example", "b": [0.3066, 0.5812, 0.3921, 0.601]}, {"w": "of", "b": [0.3984, 0.5812, 0.4194, 0.601]}, {"w": "what", "b": [0.4257, 0.5812, 0.4748, 0.601]}, {"w": "we", "b": [0.4811, 0.5812, 0.5105, 0.601]}, {"w": "warned", "b": [0.5168, 0.5812, 0.591, 0.601]}, {"w": "against", "b": [0.5973, 0.5812, 0.6688, 0.601]}, {"w": "earlier:", "b": [0.6751, 0.5812, 0.7466, 0.601]}, {"w": "a", "b": [0.7529, 0.5812, 0.7641, 0.601]}, {"w": "model", "b": [0.7704, 0.5812, 0.8334, 0.601]}, {"w": "that", "b": [0.1294, 0.6017, 0.1673, 0.6215]}, {"w": "performs", "b": [0.1736, 0.6017, 0.2646, 0.6215]}, {"w": "better", "b": [0.2709, 0.6017, 0.3284, 0.6215]}, {"w": "on", "b": [0.3347, 0.6017, 0.3599, 0.6215]}, {"w": "the", "b": [0.3662, 0.6017, 0.397, 0.6215]}, {"w": "training", "b": [0.4033, 0.6017, 0.4818, 0.6215]}, {"w": "data", "b": [0.4881, 0.6017, 0.5301, 0.6215]}, {"w": "isn’t", "b": [0.5365, 0.6017, 0.5808, 0.6215]}, {"w": "necessarily", "b": [0.5871, 0.6017, 0.6992, 0.6215]}, {"w": "a", "b": [0.7055, 0.6017, 0.7167, 0.6215]}, {"w": "model", "b": [0.723, 0.6017, 0.786, 0.6215]}, {"w": "that", "b": [0.7923, 0.6017, 0.8301, 0.6215]}, {"w": "will", "b": [0.1294, 0.6222, 0.1687, 0.642]}, {"w": "do", "b": [0.175, 0.6222, 0.2002, 0.642]}, {"w": "better", "b": [0.2065, 0.6222, 0.2639, 0.642]}, {"w": "on", "b": [0.2702, 0.6222, 0.2955, 0.642]}, {"w": "data", "b": [0.3018, 0.6222, 0.3438, 0.642]}, {"w": "it", "b": [0.3501, 0.6222, 0.3641, 0.642]}, {"w": "has", "b": [0.3704, 0.6222, 0.4041, 0.642]}, {"w": "never", "b": [0.4104, 0.6222, 0.4664, 0.642]}, {"w": "seen", "b": [0.4727, 0.6222, 0.5175, 0.642]}, {"w": "before.", "b": [0.5238, 0.6222, 0.5946, 0.642]}, {"w": "In", "b": [0.6009, 0.6222, 0.6219, 0.642]}, {"w": "precise", "b": [0.6282, 0.6222, 0.6996, 0.642]}, {"w": "terms,", "b": [0.7059, 0.6222, 0.7683, 0.642]}, {"w": "what", "b": [0.7746, 0.6222, 0.8237, 0.642]}, {"w": "you’re", "b": [0.1294, 0.6427, 0.1953, 0.6625]}, {"w": "seeing", "b": [0.2016, 0.6427, 0.266, 0.6625]}, {"w": "is", "b": [0.2723, 0.6427, 0.2891, 0.6625]}, {"w": "overfitting:", "b": [0.2954, 0.6427, 0.4075, 0.6625]}, {"w": "after", "b": [0.4138, 0.6427, 0.46, 0.6625]}, {"w": "the", "b": [0.4663, 0.6427, 0.4972, 0.6625]}, {"w": "second", "b": [0.5035, 0.6427, 0.5735, 0.6625]}, {"w": "epoch,", "b": [0.5798, 0.6427, 0.6464, 0.6625]}, {"w": "you’re", "b": [0.6527, 0.6427, 0.7185, 0.6625]}, {"w": "overoptimizing", "b": [0.1294, 0.6632, 0.2836, 0.683]}, {"w": "on", "b": [0.2899, 0.6632, 0.3151, 0.683]}, {"w": "the", "b": [0.3214, 0.6632, 0.3522, 0.683]}, {"w": "training", "b": [0.3585, 0.6632, 0.437, 0.683]}, {"w": "data,", "b": [0.4433, 0.6632, 0.4917, 0.683]}, {"w": "and", "b": [0.498, 0.6632, 0.5344, 0.683]}, {"w": "you", "b": [0.5407, 0.6632, 0.5785, 0.683]}, {"w": "end", "b": [0.5848, 0.6632, 0.6213, 0.683]}, {"w": "up", "b": [0.6276, 0.6632, 0.6528, 0.683]}, {"w": "learning", "b": [0.6591, 0.6632, 0.7418, 0.683]}, {"w": "representations", "b": [0.1294, 0.6838, 0.2821, 0.7035]}, {"w": "that", "b": [0.2884, 0.6838, 0.3263, 0.7035]}, {"w": "are", "b": [0.3326, 0.6838, 0.3634, 0.7035]}, {"w": "specific", "b": [0.3697, 0.6838, 0.4481, 0.7035]}, {"w": "to", "b": [0.4544, 0.6838, 0.474, 0.7035]}, {"w": "the", "b": [0.4803, 0.6838, 0.5111, 0.7035]}, {"w": "training", "b": [0.5175, 0.6838, 0.5959, 0.7035]}, {"w": "data", "b": [0.6022, 0.6838, 0.6443, 0.7035]}, {"w": "and", "b": [0.6506, 0.6838, 0.687, 0.7035]}, {"w": "don’t", "b": [0.6933, 0.6838, 0.7461, 0.7035]}, {"w": "generalize", "b": [0.7524, 0.6838, 0.856, 0.7035]}, {"w": "to", "b": [0.1294, 0.7043, 0.149, 0.724]}, {"w": "data", "b": [0.1553, 0.7043, 0.1974, 0.724]}, {"w": "outside", "b": [0.2037, 0.7043, 0.2766, 0.724]}, {"w": "of", "b": [0.2829, 0.7043, 0.3039, 0.724]}, {"w": "the", "b": [0.3102, 0.7043, 0.341, 0.724]}, {"w": "training", "b": [0.3473, 0.7043, 0.4258, 0.724]}, {"w": "set.", "b": [0.4321, 0.7043, 0.4664, 0.724]}]}, {"id": "b_6", "type": "paragraph", "text": "In this case, to prevent overfitting, you could stop training after three epochs. In general, you can use a range of techniques to mitigate overfitting, which we’ll cover in chapter 4.", "words": [{"w": "In", "b": [0.1294, 0.747, 0.1504, 0.7668]}, {"w": "this", "b": [0.1567, 0.747, 0.1932, 0.7668]}, {"w": "case,", "b": [0.1995, 0.747, 0.2492, 0.7668]}, {"w": "to", "b": [0.2555, 0.747, 0.2751, 0.7668]}, {"w": "prevent", "b": [0.2814, 0.747, 0.3571, 0.7668]}, {"w": "overfitting,", "b": [0.3634, 0.747, 0.4762, 0.7668]}, {"w": "you", "b": [0.4825, 0.747, 0.5204, 0.7668]}, {"w": "could", "b": [0.5267, 0.747, 0.5827, 0.7668]}, {"w": "stop", "b": [0.589, 0.747, 0.6311, 0.7668]}, {"w": "training", "b": [0.6374, 0.747, 0.7159, 0.7668]}, {"w": "after", "b": [0.7222, 0.747, 0.7684, 0.7668]}, {"w": "three", "b": [0.7747, 0.747, 0.8251, 0.7668]}, {"w": "epochs.", "b": [0.1294, 0.7675, 0.2058, 0.7873]}, {"w": "In", "b": [0.2121, 0.7675, 0.2331, 0.7873]}, {"w": "general,", "b": [0.2394, 0.7675, 0.3199, 0.7873]}, {"w": "you", "b": [0.3262, 0.7675, 0.3641, 0.7873]}, {"w": "can", "b": [0.3704, 0.7675, 0.4054, 0.7873]}, {"w": "use", "b": [0.4117, 0.7675, 0.4453, 0.7873]}, {"w": "a", "b": [0.4516, 0.7675, 0.4628, 0.7873]}, {"w": "range", "b": [0.4692, 0.7675, 0.5252, 0.7873]}, {"w": "of", "b": [0.5315, 0.7675, 0.5525, 0.7873]}, {"w": "techniques", "b": [0.5588, 0.7675, 0.6667, 0.7873]}, {"w": "to", "b": [0.6729, 0.7675, 0.6926, 0.7873]}, {"w": "mitigate", "b": [0.6989, 0.7675, 0.7816, 0.7873]}, {"w": "overfitting,", "b": [0.1294, 0.788, 0.2422, 0.8078]}, {"w": "which", "b": [0.2485, 0.788, 0.3102, 0.8078]}, {"w": "we’ll", "b": [0.3165, 0.788, 0.3683, 0.8078]}, {"w": "cover", "b": [0.3746, 0.788, 0.4307, 0.8078]}, {"w": "in", "b": [0.437, 0.788, 0.4566, 0.8078]}, {"w": "chapter", "b": [0.4628, 0.788, 0.5371, 0.8078]}, {"w": "4.", "b": [0.5434, 0.788, 0.5623, 0.8078]}]}, {"id": "b_7", "type": "paragraph", "text": "Let’s train a new network from scratch for four epochs and then evaluate it on the test data.", "words": [{"w": "Let’s", "b": [0.1294, 0.8308, 0.1798, 0.8506]}, {"w": "train", "b": [0.1862, 0.8308, 0.2324, 0.8506]}, {"w": "a", "b": [0.2387, 0.8308, 0.2499, 0.8506]}, {"w": "new", "b": [0.2562, 0.8308, 0.2982, 0.8506]}, {"w": "network", "b": [0.3045, 0.8308, 0.3872, 0.8506]}, {"w": "from", "b": [0.3935, 0.8308, 0.4425, 0.8506]}, {"w": "scratch", "b": [0.4489, 0.8308, 0.5203, 0.8506]}, {"w": "for", "b": [0.5266, 0.8308, 0.556, 0.8506]}, {"w": "four", "b": [0.5623, 0.8308, 0.6043, 0.8506]}, {"w": "epochs", "b": [0.6107, 0.8308, 0.6807, 0.8506]}, {"w": "and", "b": [0.687, 0.8308, 0.7234, 0.8506]}, {"w": "then", "b": [0.7297, 0.8308, 0.7732, 0.8506]}, {"w": "evaluate", "b": [0.7795, 0.8308, 0.8635, 0.8506]}, {"w": "it", "b": [0.1294, 0.8513, 0.1434, 0.8711]}, {"w": "on", "b": [0.1497, 0.8513, 0.175, 0.8711]}, {"w": "the", "b": [0.1813, 0.8513, 0.2121, 0.8711]}, {"w": "test", "b": [0.2184, 0.8513, 0.2534, 0.8711]}, {"w": "data.", "b": [0.2598, 0.8513, 0.3081, 0.8711]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 3.11. Retraining a model from scratch", "words": [{"w": "Listing", "b": [0.1294, 0.8892, 0.1862, 0.904]}, {"w": "3.11.", "b": [0.1909, 0.8892, 0.2277, 0.904]}, {"w": "Retraining", "b": [0.2324, 0.8892, 0.3197, 0.904]}, {"w": "a", "b": [0.3244, 0.8892, 0.3339, 0.904]}, {"w": "model", "b": [0.3386, 0.8892, 0.388, 0.904]}, {"w": "from", "b": [0.3927, 0.8892, 0.4323, 0.904]}, {"w": "scratch", "b": [0.437, 0.8892, 0.4958, 0.904]}]}]}, {"page": 118, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(16, activation='relu', input_shape= (10000,))) model.add(layers.Dense(16, activation='relu')) model.add(layers.Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['accuracy']) model.fit(x_train, y_train, epochs=4, batch_size=512) results = model.evaluate(x_test, y_test)", "words": [{"w": "model", "b": [0.1357, 0.0851, 0.1925, 0.1002]}, {"w": "=", "b": [0.2038, 0.0851, 0.2152, 0.1002]}, {"w": "models.Sequential()", "b": [0.2265, 0.0851, 0.4422, 0.1002]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.1002, 0.4309, 0.1154]}, {"w": "activation='relu',", "b": [0.4422, 0.1002, 0.6465, 0.1154]}, {"w": "input_shape=", "b": [0.6579, 0.1002, 0.7941, 0.1154]}, {"w": "(10000,)))", "b": [0.1357, 0.1154, 0.2492, 0.1305]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.1305, 0.4309, 0.1457]}, {"w": "activation='relu'))", "b": [0.4422, 0.1305, 0.6579, 0.1457]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.1457, 0.4195, 0.1608]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.1457, 0.6806, 0.1608]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.176, 0.5217, 0.1911]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.1911, 0.6011, 0.2063]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.2063, 0.533, 0.2214]}, {"w": "model.fit(x_train,", "b": [0.1357, 0.2366, 0.34, 0.2518]}, {"w": "y_train,", "b": [0.3514, 0.2366, 0.4422, 0.2518]}, {"w": "epochs=4,", "b": [0.4536, 0.2366, 0.5557, 0.2518]}, {"w": "batch_size=512)", "b": [0.5671, 0.2366, 0.7374, 0.2518]}, {"w": "results", "b": [0.1357, 0.2518, 0.2152, 0.2669]}, {"w": "=", "b": [0.2265, 0.2518, 0.2379, 0.2669]}, {"w": "model.evaluate(x_test,", "b": [0.2492, 0.2518, 0.499, 0.2669]}, {"w": "y_test)", "b": [0.5103, 0.2518, 0.5898, 0.2669]}]}, {"id": "b_1", "type": "paragraph", "text": "The final results are as follows:", "words": [{"w": "The", "b": [0.1294, 0.2898, 0.1686, 0.3095]}, {"w": "final", "b": [0.1749, 0.2898, 0.2212, 0.3095]}, {"w": "results", "b": [0.2275, 0.2898, 0.2934, 0.3095]}, {"w": "are", "b": [0.2997, 0.2898, 0.3305, 0.3095]}, {"w": "as", "b": [0.3368, 0.2898, 0.3578, 0.3095]}, {"w": "follows:", "b": [0.3641, 0.2898, 0.4468, 0.3095]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> results [0.2929924130630493, 0.88327999999999995]", "words": [{"w": ">>>", "b": [0.1357, 0.3275, 0.1698, 0.3427]}, {"w": "results", "b": [0.1811, 0.3275, 0.2606, 0.3427]}, {"w": "[0.2929924130630493,", "b": [0.1357, 0.3427, 0.3628, 0.3578]}, {"w": "0.88327999999999995]", "b": [0.3741, 0.3427, 0.6011, 0.3578]}]}, {"id": "b_3", "type": "paragraph", "text": "This fairly naive approach achieves an accuracy of 88%. With state-of- the-art approaches, you should be able to get close to 95%.", "words": [{"w": "This", "b": [0.1294, 0.3807, 0.1743, 0.4004]}, {"w": "fairly", "b": [0.1806, 0.3807, 0.2352, 0.4004]}, {"w": "naive", "b": [0.2415, 0.3807, 0.2962, 0.4004]}, {"w": "approach", "b": [0.3025, 0.3807, 0.3949, 0.4004]}, {"w": "achieves", "b": [0.4012, 0.3807, 0.4881, 0.4004]}, {"w": "an", "b": [0.4944, 0.3807, 0.5182, 0.4004]}, {"w": "accuracy", "b": [0.5245, 0.3807, 0.6141, 0.4004]}, {"w": "of", "b": [0.6204, 0.3807, 0.6414, 0.4004]}, {"w": "88%.", "b": [0.6478, 0.3807, 0.7003, 0.4004]}, {"w": "With", "b": [0.7066, 0.3807, 0.756, 0.4004]}, {"w": "state-of-", "b": [0.7623, 0.3807, 0.8463, 0.4004]}, {"w": "the-art", "b": [0.1294, 0.4012, 0.1953, 0.4209]}, {"w": "approaches,", "b": [0.2016, 0.4012, 0.3213, 0.4209]}, {"w": "you", "b": [0.3276, 0.4012, 0.3655, 0.4209]}, {"w": "should", "b": [0.3718, 0.4012, 0.4391, 0.4209]}, {"w": "be", "b": [0.4454, 0.4012, 0.4692, 0.4209]}, {"w": "able", "b": [0.4755, 0.4012, 0.5175, 0.4209]}, {"w": "to", "b": [0.5238, 0.4012, 0.5434, 0.4209]}, {"w": "get", "b": [0.5497, 0.4012, 0.5806, 0.4209]}, {"w": "close", "b": [0.5869, 0.4012, 0.6387, 0.4209]}, {"w": "to", "b": [0.645, 0.4012, 0.6646, 0.4209]}, {"w": "95%.", "b": [0.6709, 0.4012, 0.7234, 0.4209]}]}, {"id": "b_4", "type": "paragraph", "text": "3.4.5. Using a trained network to generate predictions on new data", "words": [{"w": "3.4.5.", "b": [0.1294, 0.4484, 0.1862, 0.4682]}, {"w": "Using", "b": [0.1925, 0.4484, 0.2542, 0.4682]}, {"w": "a", "b": [0.2605, 0.4484, 0.2731, 0.4682]}, {"w": "trained", "b": [0.2794, 0.4484, 0.3579, 0.4682]}, {"w": "network", "b": [0.3642, 0.4484, 0.4538, 0.4682]}, {"w": "to", "b": [0.4601, 0.4484, 0.4812, 0.4682]}, {"w": "generate", "b": [0.4875, 0.4484, 0.5799, 0.4682]}, {"w": "predictions", "b": [0.5862, 0.4484, 0.7063, 0.4682]}, {"w": "on", "b": [0.7126, 0.4484, 0.7392, 0.4682]}, {"w": "new", "b": [0.7455, 0.4484, 0.789, 0.4682]}, {"w": "data", "b": [0.7953, 0.4484, 0.8429, 0.4682]}]}, {"id": "b_5", "type": "paragraph", "text": "After having trained a network, you’ll want to use it in a practical setting. You can generate the likelihood of reviews being positive by using the predict method:", "words": [{"w": "After", "b": [0.1294, 0.4912, 0.1826, 0.511]}, {"w": "having", "b": [0.1889, 0.4912, 0.2576, 0.511]}, {"w": "trained", "b": [0.2639, 0.4912, 0.334, 0.511]}, {"w": "a", "b": [0.3403, 0.4912, 0.3515, 0.511]}, {"w": "network,", "b": [0.3578, 0.4912, 0.4468, 0.511]}, {"w": "you’ll", "b": [0.4531, 0.4912, 0.5133, 0.511]}, {"w": "want", "b": [0.5196, 0.4912, 0.5687, 0.511]}, {"w": "to", "b": [0.575, 0.4912, 0.5946, 0.511]}, {"w": "use", "b": [0.6009, 0.4912, 0.6345, 0.511]}, {"w": "it", "b": [0.6408, 0.4912, 0.6549, 0.511]}, {"w": "in", "b": [0.6612, 0.4912, 0.6808, 0.511]}, {"w": "a", "b": [0.6871, 0.4912, 0.6983, 0.511]}, {"w": "practical", "b": [0.7046, 0.4912, 0.7915, 0.511]}, {"w": "setting.", "b": [0.1294, 0.5117, 0.203, 0.5315]}, {"w": "You", "b": [0.2093, 0.5117, 0.2502, 0.5315]}, {"w": "can", "b": [0.2565, 0.5117, 0.2915, 0.5315]}, {"w": "generate", "b": [0.2978, 0.5117, 0.3833, 0.5315]}, {"w": "the", "b": [0.3896, 0.5117, 0.4204, 0.5315]}, {"w": "likelihood", "b": [0.4267, 0.5117, 0.529, 0.5315]}, {"w": "of", "b": [0.5353, 0.5117, 0.5563, 0.5315]}, {"w": "reviews", "b": [0.5627, 0.5117, 0.6411, 0.5315]}, {"w": "being", "b": [0.6474, 0.5117, 0.7035, 0.5315]}, {"w": "positive", "b": [0.7097, 0.5117, 0.7896, 0.5315]}, {"w": "by", "b": [0.7959, 0.5117, 0.8211, 0.5315]}, {"w": "using", "b": [0.1294, 0.5322, 0.1841, 0.552]}, {"w": "the", "b": [0.1904, 0.5322, 0.2212, 0.552]}, {"w": "predict", "b": [0.2275, 0.5333, 0.3334, 0.5535]}, {"w": "method:", "b": [0.3398, 0.5322, 0.4224, 0.552]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> model.predict(x_test) array([[ 0.98006207] [ 0.99758697] [ 0.99975556] ..., [ 0.82167041] [ 0.02885115] [ 0.65371346]], dtype=float32)", "words": [{"w": ">>>", "b": [0.1357, 0.5708, 0.1698, 0.586]}, {"w": "model.predict(x_test)", "b": [0.1811, 0.5708, 0.4195, 0.586]}, {"w": "array([[", "b": [0.1357, 0.586, 0.2265, 0.6011]}, {"w": "0.98006207]", "b": [0.2379, 0.586, 0.3628, 0.6011]}, {"w": "[", "b": [0.2152, 0.6012, 0.2265, 0.6163]}, {"w": "0.99758697]", "b": [0.2379, 0.6012, 0.3628, 0.6163]}, {"w": "[", "b": [0.2152, 0.6163, 0.2265, 0.6315]}, {"w": "0.99975556]", "b": [0.2379, 0.6163, 0.3628, 0.6315]}, {"w": "...,", "b": [0.2152, 0.6315, 0.2606, 0.6466]}, {"w": "[", "b": [0.2152, 0.6466, 0.2265, 0.6618]}, {"w": "0.82167041]", "b": [0.2379, 0.6466, 0.3628, 0.6618]}, {"w": "[", "b": [0.2152, 0.6618, 0.2265, 0.6769]}, {"w": "0.02885115]", "b": [0.2379, 0.6618, 0.3628, 0.6769]}, {"w": "[", "b": [0.2152, 0.6769, 0.2265, 0.6921]}, {"w": "0.65371346]],", "b": [0.2379, 0.6769, 0.3855, 0.6921]}, {"w": "dtype=float32)", "b": [0.3968, 0.6769, 0.5557, 0.6921]}]}, {"id": "b_7", "type": "paragraph", "text": "As you can see, the network is confident for some samples (0.99 or more, or 0.01 or less) but less confident for others (0.6, 0.4).", "words": [{"w": "As", "b": [0.1294, 0.7149, 0.1574, 0.7347]}, {"w": "you", "b": [0.1637, 0.7149, 0.2016, 0.7347]}, {"w": "can", "b": [0.2079, 0.7149, 0.2429, 0.7347]}, {"w": "see,", "b": [0.2492, 0.7149, 0.2877, 0.7347]}, {"w": "the", "b": [0.294, 0.7149, 0.3249, 0.7347]}, {"w": "network", "b": [0.3312, 0.7149, 0.4138, 0.7347]}, {"w": "is", "b": [0.4201, 0.7149, 0.437, 0.7347]}, {"w": "confident", "b": [0.4433, 0.7149, 0.5385, 0.7347]}, {"w": "for", "b": [0.5449, 0.7149, 0.5743, 0.7347]}, {"w": "some", "b": [0.5806, 0.7149, 0.6338, 0.7347]}, {"w": "samples", "b": [0.6401, 0.7149, 0.7214, 0.7347]}, {"w": "(0.99", "b": [0.7277, 0.7149, 0.7803, 0.7347]}, {"w": "or", "b": [0.7866, 0.7149, 0.8076, 0.7347]}, {"w": "more,", "b": [0.1294, 0.7354, 0.1876, 0.7552]}, {"w": "or", "b": [0.1939, 0.7354, 0.2149, 0.7552]}, {"w": "0.01", "b": [0.2212, 0.7354, 0.2653, 0.7552]}, {"w": "or", "b": [0.2716, 0.7354, 0.2926, 0.7552]}, {"w": "less)", "b": [0.299, 0.7354, 0.3452, 0.7552]}, {"w": "but", "b": [0.3515, 0.7354, 0.3837, 0.7552]}, {"w": "less", "b": [0.39, 0.7354, 0.4279, 0.7552]}, {"w": "confident", "b": [0.4342, 0.7354, 0.5295, 0.7552]}, {"w": "for", "b": [0.5358, 0.7354, 0.5652, 0.7552]}, {"w": "others", "b": [0.5715, 0.7354, 0.6331, 0.7552]}, {"w": "(0.6,", "b": [0.6395, 0.7354, 0.6857, 0.7552]}, {"w": "0.4).", "b": [0.692, 0.7354, 0.7382, 0.7552]}]}, {"id": "b_8", "type": "paragraph", "text": "3.4.6. Further experiments", "words": [{"w": "3.4.6.", "b": [0.1294, 0.7827, 0.1862, 0.8024]}, {"w": "Further", "b": [0.1925, 0.7827, 0.2779, 0.8024]}, {"w": "experiments", "b": [0.2842, 0.7827, 0.416, 0.8024]}]}, {"id": "b_9", "type": "paragraph", "text": "The following experiments will help convince you that the architecture choices you’ve made are all fairly reasonable, although there’s still room for improvement:", "words": [{"w": "The", "b": [0.1294, 0.8255, 0.1686, 0.8452]}, {"w": "following", "b": [0.1749, 0.8255, 0.273, 0.8452]}, {"w": "experiments", "b": [0.2794, 0.8255, 0.4027, 0.8452]}, {"w": "will", "b": [0.409, 0.8255, 0.4482, 0.8452]}, {"w": "help", "b": [0.4545, 0.8255, 0.498, 0.8452]}, {"w": "convince", "b": [0.5043, 0.8255, 0.5953, 0.8452]}, {"w": "you", "b": [0.6016, 0.8255, 0.6395, 0.8452]}, {"w": "that", "b": [0.6458, 0.8255, 0.6836, 0.8452]}, {"w": "the", "b": [0.6899, 0.8255, 0.7208, 0.8452]}, {"w": "architecture", "b": [0.7271, 0.8255, 0.8461, 0.8452]}, {"w": "choices", "b": [0.1294, 0.846, 0.2051, 0.8657]}, {"w": "you’ve", "b": [0.2114, 0.846, 0.2814, 0.8657]}, {"w": "made", "b": [0.2877, 0.846, 0.3424, 0.8657]}, {"w": "are", "b": [0.3487, 0.846, 0.3795, 0.8657]}, {"w": "all", "b": [0.3858, 0.846, 0.411, 0.8657]}, {"w": "fairly", "b": [0.4173, 0.846, 0.472, 0.8657]}, {"w": "reasonable,", "b": [0.4783, 0.846, 0.5924, 0.8657]}, {"w": "although", "b": [0.5987, 0.846, 0.687, 0.8657]}, {"w": "there’s", "b": [0.6932, 0.846, 0.7605, 0.8657]}, {"w": "still", "b": [0.7668, 0.846, 0.8047, 0.8657]}, {"w": "room", "b": [0.811, 0.846, 0.8642, 0.8657]}, {"w": "for", "b": [0.1294, 0.8665, 0.1588, 0.8862]}, {"w": "improvement:", "b": [0.1651, 0.8665, 0.3067, 0.8862]}]}]}, {"page": 119, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You used two hidden layers. Try using one or three hidden layers, and see how doing so affects validation and test accuracy. Try using layers with more hidden units or fewer hidden units: 32 units, 64 units, and so on. Try using the mse loss function instead of binary_crossentropy. Try using the tanh activation (an activation that was popular in the early days of neural networks) instead of relu.", "words": [{"w": "You", "b": [0.1799, 0.0857, 0.2208, 0.1054]}, {"w": "used", "b": [0.2271, 0.0857, 0.2733, 0.1054]}, {"w": "two", "b": [0.2796, 0.0857, 0.3175, 0.1054]}, {"w": "hidden", "b": [0.3238, 0.0857, 0.3924, 0.1054]}, {"w": "layers.", "b": [0.3987, 0.0857, 0.4653, 0.1054]}, {"w": "Try", "b": [0.4716, 0.0857, 0.5071, 0.1054]}, {"w": "using", "b": [0.5134, 0.0857, 0.5681, 0.1054]}, {"w": "one", "b": [0.5744, 0.0857, 0.6108, 0.1054]}, {"w": "or", "b": [0.6171, 0.0857, 0.6381, 0.1054]}, {"w": "three", "b": [0.6444, 0.0857, 0.6949, 0.1054]}, {"w": "hidden", "b": [0.7012, 0.0857, 0.7698, 0.1054]}, {"w": "layers,", "b": [0.7762, 0.0857, 0.8427, 0.1054]}, {"w": "and", "b": [0.1799, 0.1062, 0.2163, 0.1259]}, {"w": "see", "b": [0.2226, 0.1062, 0.2548, 0.1259]}, {"w": "how", "b": [0.2611, 0.1062, 0.3046, 0.1259]}, {"w": "doing", "b": [0.3109, 0.1062, 0.3683, 0.1259]}, {"w": "so", "b": [0.3746, 0.1062, 0.3971, 0.1259]}, {"w": "affects", "b": [0.4034, 0.1062, 0.4701, 0.1259]}, {"w": "validation", "b": [0.4764, 0.1062, 0.5773, 0.1259]}, {"w": "and", "b": [0.5836, 0.1062, 0.6201, 0.1259]}, {"w": "test", "b": [0.6264, 0.1062, 0.6614, 0.1259]}, {"w": "accuracy.", "b": [0.6677, 0.1062, 0.762, 0.1259]}, {"w": "Try", "b": [0.1799, 0.1267, 0.2154, 0.1464]}, {"w": "using", "b": [0.2217, 0.1267, 0.2764, 0.1464]}, {"w": "layers", "b": [0.2827, 0.1267, 0.3429, 0.1464]}, {"w": "with", "b": [0.3492, 0.1267, 0.3941, 0.1464]}, {"w": "more", "b": [0.4004, 0.1267, 0.4522, 0.1464]}, {"w": "hidden", "b": [0.4585, 0.1267, 0.5272, 0.1464]}, {"w": "units", "b": [0.5335, 0.1267, 0.5826, 0.1464]}, {"w": "or", "b": [0.5889, 0.1267, 0.6099, 0.1464]}, {"w": "fewer", "b": [0.6162, 0.1267, 0.6736, 0.1464]}, {"w": "hidden", "b": [0.6799, 0.1267, 0.7486, 0.1464]}, {"w": "units:", "b": [0.7549, 0.1267, 0.811, 0.1464]}, {"w": "32", "b": [0.8173, 0.1267, 0.8425, 0.1464]}, {"w": "units,", "b": [0.1799, 0.1472, 0.2352, 0.1669]}, {"w": "64", "b": [0.2415, 0.1472, 0.2668, 0.1669]}, {"w": "units,", "b": [0.2731, 0.1472, 0.3284, 0.1669]}, {"w": "and", "b": [0.3347, 0.1472, 0.3712, 0.1669]}, {"w": "so", "b": [0.3775, 0.1472, 0.3999, 0.1669]}, {"w": "on.", "b": [0.4062, 0.1472, 0.4377, 0.1669]}, {"w": "Try", "b": [0.1799, 0.1677, 0.2154, 0.1874]}, {"w": "using", "b": [0.2217, 0.1677, 0.2764, 0.1874]}, {"w": "the", "b": [0.2827, 0.1677, 0.3135, 0.1874]}, {"w": "mse", "b": [0.3198, 0.1687, 0.3652, 0.1889]}, {"w": "loss", "b": [0.3715, 0.1677, 0.4108, 0.1874]}, {"w": "function", "b": [0.4171, 0.1677, 0.5011, 0.1874]}, {"w": "instead", "b": [0.5074, 0.1677, 0.5789, 0.1874]}, {"w": "of", "b": [0.5852, 0.1677, 0.6062, 0.1874]}, {"w": "binary_crossentropy.", "b": [0.1799, 0.1891, 0.4738, 0.2103]}, {"w": "Try", "b": [0.1799, 0.2105, 0.2154, 0.2302]}, {"w": "using", "b": [0.2217, 0.2105, 0.2764, 0.2302]}, {"w": "the", "b": [0.2827, 0.2105, 0.3135, 0.2302]}, {"w": "tanh", "b": [0.3198, 0.2115, 0.3803, 0.2317]}, {"w": "activation", "b": [0.3866, 0.2105, 0.4861, 0.2302]}, {"w": "(an", "b": [0.4924, 0.2105, 0.5246, 0.2302]}, {"w": "activation", "b": [0.531, 0.2105, 0.6304, 0.2302]}, {"w": "that", "b": [0.6367, 0.2105, 0.6746, 0.2302]}, {"w": "was", "b": [0.6809, 0.2105, 0.7201, 0.2302]}, {"w": "popular", "b": [0.7264, 0.2105, 0.8035, 0.2302]}, {"w": "in", "b": [0.8098, 0.2105, 0.8294, 0.2302]}, {"w": "the", "b": [0.8357, 0.2105, 0.8666, 0.2302]}, {"w": "early", "b": [0.1799, 0.2319, 0.2303, 0.2516]}, {"w": "days", "b": [0.2366, 0.2319, 0.2828, 0.2516]}, {"w": "of", "b": [0.2891, 0.2319, 0.3102, 0.2516]}, {"w": "neural", "b": [0.3165, 0.2319, 0.3795, 0.2516]}, {"w": "networks)", "b": [0.3858, 0.2319, 0.4867, 0.2516]}, {"w": "instead", "b": [0.493, 0.2319, 0.5645, 0.2516]}, {"w": "of", "b": [0.5708, 0.2319, 0.5918, 0.2516]}, {"w": "relu.", "b": [0.598, 0.2319, 0.6649, 0.2531]}]}, {"id": "b_1", "type": "paragraph", "text": "3.4.7. Wrapping up", "words": [{"w": "3.4.7.", "b": [0.1294, 0.28, 0.1862, 0.2997]}, {"w": "Wrapping", "b": [0.1925, 0.28, 0.3028, 0.2997]}, {"w": "up", "b": [0.3091, 0.28, 0.3371, 0.2997]}]}, {"id": "b_2", "type": "paragraph", "text": "Here’s what you should take away from this example:", "words": [{"w": "Here’s", "b": [0.1294, 0.3228, 0.1952, 0.3425]}, {"w": "what", "b": [0.2016, 0.3228, 0.2506, 0.3425]}, {"w": "you", "b": [0.2569, 0.3228, 0.2947, 0.3425]}, {"w": "should", "b": [0.301, 0.3228, 0.3683, 0.3425]}, {"w": "take", "b": [0.3746, 0.3228, 0.4167, 0.3425]}, {"w": "away", "b": [0.423, 0.3228, 0.4762, 0.3425]}, {"w": "from", "b": [0.4825, 0.3228, 0.5315, 0.3425]}, {"w": "this", "b": [0.5378, 0.3228, 0.5743, 0.3425]}, {"w": "example:", "b": [0.5806, 0.3228, 0.6731, 0.3425]}]}, {"id": "b_3", "type": "paragraph", "text": "You usually need to do quite a bit of preprocessing on your raw data in order to be able to feed it—as tensors—into a neural network. Sequences of words can be encoded as binary vectors, but there are other encoding options, too. Stacks of Dense layers with relu activations can solve a wide range of problems (including sentiment classification), and you’ll likely use them frequently. In a binary classification problem (two output classes), your network should end with a Dense layer with one unit and a sigmoid activation: the output of your network should be a scalar between 0 and 1, encoding a probability. With such a scalar sigmoid output on a binary classification problem, the loss function you should use is binary_crossentropy. The rmsprop optimizer is generally a good enough choice, whatever your problem. That’s one less thing for you to worry about. As they get better on their training data, neural networks eventually start overfitting and end up obtaining increasingly worse results on data they’ve never seen before. Be sure to always monitor performance on data that is outside of the training set.", "words": [{"w": "You", "b": [0.1799, 0.3611, 0.2208, 0.3808]}, {"w": "usually", "b": [0.2271, 0.3611, 0.3, 0.3808]}, {"w": "need", "b": [0.3063, 0.3611, 0.3539, 0.3808]}, {"w": "to", "b": [0.3602, 0.3611, 0.3798, 0.3808]}, {"w": "do", "b": [0.3861, 0.3611, 0.4114, 0.3808]}, {"w": "quite", "b": [0.4177, 0.3611, 0.4681, 0.3808]}, {"w": "a", "b": [0.4744, 0.3611, 0.4856, 0.3808]}, {"w": "bit", "b": [0.4919, 0.3611, 0.5186, 0.3808]}, {"w": "of", "b": [0.5249, 0.3611, 0.5459, 0.3808]}, {"w": "preprocessing", "b": [0.5522, 0.3611, 0.6923, 0.3808]}, {"w": "on", "b": [0.6986, 0.3611, 0.7238, 0.3808]}, {"w": "your", "b": [0.7301, 0.3611, 0.7764, 0.3808]}, {"w": "raw", "b": [0.7827, 0.3611, 0.8205, 0.3808]}, {"w": "data", "b": [0.8268, 0.3611, 0.8688, 0.3808]}, {"w": "in", "b": [0.1799, 0.3816, 0.1995, 0.4013]}, {"w": "order", "b": [0.2058, 0.3816, 0.259, 0.4013]}, {"w": "to", "b": [0.2653, 0.3816, 0.285, 0.4013]}, {"w": "be", "b": [0.2913, 0.3816, 0.3151, 0.4013]}, {"w": "able", "b": [0.3214, 0.3816, 0.3634, 0.4013]}, {"w": "to", "b": [0.3697, 0.3816, 0.3893, 0.4013]}, {"w": "feed", "b": [0.3956, 0.3816, 0.4391, 0.4013]}, {"w": "it—as", "b": [0.4454, 0.3816, 0.5056, 0.4013]}, {"w": "tensors—into", "b": [0.5119, 0.3816, 0.6479, 0.4013]}, {"w": "a", "b": [0.6542, 0.3816, 0.6654, 0.4013]}, {"w": "neural", "b": [0.6717, 0.3816, 0.7347, 0.4013]}, {"w": "network.", "b": [0.741, 0.3816, 0.8299, 0.4013]}, {"w": "Sequences", "b": [0.1799, 0.4021, 0.2863, 0.4218]}, {"w": "of", "b": [0.2926, 0.4021, 0.3137, 0.4218]}, {"w": "words", "b": [0.32, 0.4021, 0.3816, 0.4218]}, {"w": "can", "b": [0.3879, 0.4021, 0.4229, 0.4218]}, {"w": "be", "b": [0.4292, 0.4021, 0.4531, 0.4218]}, {"w": "encoded", "b": [0.4594, 0.4021, 0.5434, 0.4218]}, {"w": "as", "b": [0.5497, 0.4021, 0.5707, 0.4218]}, {"w": "binary", "b": [0.577, 0.4021, 0.6415, 0.4218]}, {"w": "vectors,", "b": [0.6478, 0.4021, 0.727, 0.4218]}, {"w": "but", "b": [0.7333, 0.4021, 0.7655, 0.4218]}, {"w": "there", "b": [0.7718, 0.4021, 0.8222, 0.4218]}, {"w": "are", "b": [0.8285, 0.4021, 0.8593, 0.4218]}, {"w": "other", "b": [0.1799, 0.4226, 0.2317, 0.4423]}, {"w": "encoding", "b": [0.238, 0.4226, 0.3305, 0.4423]}, {"w": "options,", "b": [0.3368, 0.4226, 0.4174, 0.4423]}, {"w": "too.", "b": [0.4237, 0.4226, 0.4622, 0.4423]}, {"w": "Stacks", "b": [0.1799, 0.4431, 0.2457, 0.4628]}, {"w": "of", "b": [0.252, 0.4431, 0.273, 0.4628]}, {"w": "Dense", "b": [0.2793, 0.4441, 0.355, 0.4643]}, {"w": "layers", "b": [0.3613, 0.4431, 0.4216, 0.4628]}, {"w": "with", "b": [0.4279, 0.4431, 0.4727, 0.4628]}, {"w": "relu", "b": [0.479, 0.4441, 0.5395, 0.4643]}, {"w": "activations", "b": [0.5459, 0.4431, 0.6552, 0.4628]}, {"w": "can", "b": [0.6615, 0.4431, 0.6965, 0.4628]}, {"w": "solve", "b": [0.7028, 0.4431, 0.756, 0.4628]}, {"w": "a", "b": [0.7623, 0.4431, 0.7735, 0.4628]}, {"w": "wide", "b": [0.7798, 0.4431, 0.8289, 0.4628]}, {"w": "range", "b": [0.1799, 0.4645, 0.2359, 0.4842]}, {"w": "of", "b": [0.2422, 0.4645, 0.2632, 0.4842]}, {"w": "problems", "b": [0.2695, 0.4645, 0.3634, 0.4842]}, {"w": "(including", "b": [0.3697, 0.4645, 0.4734, 0.4842]}, {"w": "sentiment", "b": [0.4797, 0.4645, 0.5778, 0.4842]}, {"w": "classification),", "b": [0.5841, 0.4645, 0.732, 0.4842]}, {"w": "and", "b": [0.7383, 0.4645, 0.7747, 0.4842]}, {"w": "you’ll", "b": [0.781, 0.4645, 0.8413, 0.4842]}, {"w": "likely", "b": [0.1799, 0.485, 0.2373, 0.5047]}, {"w": "use", "b": [0.2436, 0.485, 0.2773, 0.5047]}, {"w": "them", "b": [0.2836, 0.485, 0.334, 0.5047]}, {"w": "frequently.", "b": [0.3403, 0.485, 0.4486, 0.5047]}, {"w": "In", "b": [0.1799, 0.5055, 0.2009, 0.5252]}, {"w": "a", "b": [0.2072, 0.5055, 0.2184, 0.5252]}, {"w": "binary", "b": [0.2247, 0.5055, 0.2891, 0.5252]}, {"w": "classification", "b": [0.2954, 0.5055, 0.4286, 0.5252]}, {"w": "problem", "b": [0.4349, 0.5055, 0.5189, 0.5252]}, {"w": "(two", "b": [0.5253, 0.5055, 0.5715, 0.5252]}, {"w": "output", "b": [0.5778, 0.5055, 0.6423, 0.5252]}, {"w": "classes),", "b": [0.6486, 0.5055, 0.7333, 0.5252]}, {"w": "your", "b": [0.7396, 0.5055, 0.7859, 0.5252]}, {"w": "network", "b": [0.1799, 0.526, 0.2625, 0.5457]}, {"w": "should", "b": [0.2688, 0.526, 0.3361, 0.5457]}, {"w": "end", "b": [0.3424, 0.526, 0.3788, 0.5457]}, {"w": "with", "b": [0.3852, 0.526, 0.43, 0.5457]}, {"w": "a", "b": [0.4363, 0.526, 0.4475, 0.5457]}, {"w": "Dense", "b": [0.4538, 0.527, 0.5295, 0.5472]}, {"w": "layer", "b": [0.5358, 0.526, 0.5862, 0.5457]}, {"w": "with", "b": [0.5925, 0.526, 0.6374, 0.5457]}, {"w": "one", "b": [0.6437, 0.526, 0.6801, 0.5457]}, {"w": "unit", "b": [0.6864, 0.526, 0.7257, 0.5457]}, {"w": "and", "b": [0.732, 0.526, 0.7684, 0.5457]}, {"w": "a", "b": [0.7747, 0.526, 0.7859, 0.5457]}, {"w": "sigmoid", "b": [0.1799, 0.5484, 0.2858, 0.5686]}, {"w": "activation:", "b": [0.2921, 0.5474, 0.3986, 0.5671]}, {"w": "the", "b": [0.4049, 0.5474, 0.4358, 0.5671]}, {"w": "output", "b": [0.4421, 0.5474, 0.5065, 0.5671]}, {"w": "of", "b": [0.5128, 0.5474, 0.5339, 0.5671]}, {"w": "your", "b": [0.5402, 0.5474, 0.5864, 0.5671]}, {"w": "network", "b": [0.5927, 0.5474, 0.6754, 0.5671]}, {"w": "should", "b": [0.6817, 0.5474, 0.749, 0.5671]}, {"w": "be", "b": [0.7553, 0.5474, 0.7791, 0.5671]}, {"w": "a", "b": [0.7854, 0.5474, 0.7966, 0.5671]}, {"w": "scalar", "b": [0.8029, 0.5474, 0.8617, 0.5671]}, {"w": "between", "b": [0.1799, 0.5688, 0.2639, 0.5885]}, {"w": "0", "b": [0.2702, 0.5688, 0.2828, 0.5885]}, {"w": "and", "b": [0.2891, 0.5688, 0.3256, 0.5885]}, {"w": "1,", "b": [0.3319, 0.5688, 0.3508, 0.5885]}, {"w": "encoding", "b": [0.3571, 0.5688, 0.4496, 0.5885]}, {"w": "a", "b": [0.4559, 0.5688, 0.4671, 0.5885]}, {"w": "probability.", "b": [0.4734, 0.5688, 0.5887, 0.5885]}, {"w": "With", "b": [0.1799, 0.5893, 0.2293, 0.609]}, {"w": "such", "b": [0.2356, 0.5893, 0.2818, 0.609]}, {"w": "a", "b": [0.2882, 0.5893, 0.2994, 0.609]}, {"w": "scalar", "b": [0.3057, 0.5893, 0.3645, 0.609]}, {"w": "sigmoid", "b": [0.3708, 0.5893, 0.4521, 0.609]}, {"w": "output", "b": [0.4584, 0.5893, 0.5229, 0.609]}, {"w": "on", "b": [0.5292, 0.5893, 0.5544, 0.609]}, {"w": "a", "b": [0.5607, 0.5893, 0.5719, 0.609]}, {"w": "binary", "b": [0.5782, 0.5893, 0.6427, 0.609]}, {"w": "classification", "b": [0.649, 0.5893, 0.7821, 0.609]}, {"w": "problem,", "b": [0.1799, 0.6098, 0.2702, 0.6295]}, {"w": "the", "b": [0.2766, 0.6098, 0.3074, 0.6295]}, {"w": "loss", "b": [0.3137, 0.6098, 0.3529, 0.6295]}, {"w": "function", "b": [0.3592, 0.6098, 0.4433, 0.6295]}, {"w": "you", "b": [0.4496, 0.6098, 0.4875, 0.6295]}, {"w": "should", "b": [0.4938, 0.6098, 0.5611, 0.6295]}, {"w": "use", "b": [0.5674, 0.6098, 0.601, 0.6295]}, {"w": "is", "b": [0.6073, 0.6098, 0.6241, 0.6295]}, {"w": "binary_crossentropy.", "b": [0.1799, 0.6303, 0.4738, 0.6515]}, {"w": "The", "b": [0.1799, 0.6517, 0.2191, 0.6714]}, {"w": "rmsprop", "b": [0.2254, 0.6527, 0.3313, 0.6729]}, {"w": "optimizer", "b": [0.3376, 0.6517, 0.4343, 0.6714]}, {"w": "is", "b": [0.4406, 0.6517, 0.4575, 0.6714]}, {"w": "generally", "b": [0.4638, 0.6517, 0.5576, 0.6714]}, {"w": "a", "b": [0.5639, 0.6517, 0.5751, 0.6714]}, {"w": "good", "b": [0.5814, 0.6517, 0.6319, 0.6714]}, {"w": "enough", "b": [0.6382, 0.6517, 0.7125, 0.6714]}, {"w": "choice,", "b": [0.7188, 0.6517, 0.7909, 0.6714]}, {"w": "whatever", "b": [0.1799, 0.6731, 0.2723, 0.6928]}, {"w": "your", "b": [0.2786, 0.6731, 0.3249, 0.6928]}, {"w": "problem.", "b": [0.3312, 0.6731, 0.4216, 0.6928]}, {"w": "That’s", "b": [0.4279, 0.6731, 0.4909, 0.6928]}, {"w": "one", "b": [0.4972, 0.6731, 0.5336, 0.6928]}, {"w": "less", "b": [0.5399, 0.6731, 0.5778, 0.6928]}, {"w": "thing", "b": [0.5841, 0.6731, 0.6359, 0.6928]}, {"w": "for", "b": [0.6422, 0.6731, 0.6717, 0.6928]}, {"w": "you", "b": [0.678, 0.6731, 0.7158, 0.6928]}, {"w": "to", "b": [0.7221, 0.6731, 0.7417, 0.6928]}, {"w": "worry", "b": [0.748, 0.6731, 0.8083, 0.6928]}, {"w": "about.", "b": [0.1799, 0.6936, 0.2422, 0.7133]}, {"w": "As", "b": [0.1799, 0.7141, 0.2079, 0.7338]}, {"w": "they", "b": [0.2142, 0.7141, 0.2576, 0.7338]}, {"w": "get", "b": [0.2639, 0.7141, 0.2948, 0.7338]}, {"w": "better", "b": [0.3011, 0.7141, 0.3585, 0.7338]}, {"w": "on", "b": [0.3648, 0.7141, 0.39, 0.7338]}, {"w": "their", "b": [0.3964, 0.7141, 0.4426, 0.7338]}, {"w": "training", "b": [0.4489, 0.7141, 0.5274, 0.7338]}, {"w": "data,", "b": [0.5337, 0.7141, 0.582, 0.7338]}, {"w": "neural", "b": [0.5883, 0.7141, 0.6514, 0.7338]}, {"w": "networks", "b": [0.6577, 0.7141, 0.7501, 0.7338]}, {"w": "eventually", "b": [0.7564, 0.7141, 0.8615, 0.7338]}, {"w": "start", "b": [0.1799, 0.7346, 0.2233, 0.7543]}, {"w": "overfitting", "b": [0.2296, 0.7346, 0.3361, 0.7543]}, {"w": "and", "b": [0.3424, 0.7346, 0.3788, 0.7543]}, {"w": "end", "b": [0.3852, 0.7346, 0.4216, 0.7543]}, {"w": "up", "b": [0.4279, 0.7346, 0.4531, 0.7543]}, {"w": "obtaining", "b": [0.4594, 0.7346, 0.5547, 0.7543]}, {"w": "increasingly", "b": [0.561, 0.7346, 0.6843, 0.7543]}, {"w": "worse", "b": [0.6905, 0.7346, 0.7508, 0.7543]}, {"w": "results", "b": [0.7571, 0.7346, 0.823, 0.7543]}, {"w": "on", "b": [0.8293, 0.7346, 0.8545, 0.7543]}, {"w": "data", "b": [0.1799, 0.7551, 0.2219, 0.7748]}, {"w": "they’ve", "b": [0.2282, 0.7551, 0.3038, 0.7748]}, {"w": "never", "b": [0.3102, 0.7551, 0.3662, 0.7748]}, {"w": "seen", "b": [0.3725, 0.7551, 0.4173, 0.7748]}, {"w": "before.", "b": [0.4236, 0.7551, 0.4944, 0.7748]}, {"w": "Be", "b": [0.5007, 0.7551, 0.5287, 0.7748]}, {"w": "sure", "b": [0.535, 0.7551, 0.577, 0.7748]}, {"w": "to", "b": [0.5833, 0.7551, 0.603, 0.7748]}, {"w": "always", "b": [0.6093, 0.7551, 0.6793, 0.7748]}, {"w": "monitor", "b": [0.6856, 0.7551, 0.7655, 0.7748]}, {"w": "performance", "b": [0.1799, 0.7756, 0.3073, 0.7953]}, {"w": "on", "b": [0.3136, 0.7756, 0.3389, 0.7953]}, {"w": "data", "b": [0.3452, 0.7756, 0.3872, 0.7953]}, {"w": "that", "b": [0.3935, 0.7756, 0.4313, 0.7953]}, {"w": "is", "b": [0.4376, 0.7756, 0.4545, 0.7953]}, {"w": "outside", "b": [0.4608, 0.7756, 0.5337, 0.7953]}, {"w": "of", "b": [0.54, 0.7756, 0.561, 0.7953]}, {"w": "the", "b": [0.5673, 0.7756, 0.5981, 0.7953]}, {"w": "training", "b": [0.6044, 0.7756, 0.6829, 0.7953]}, {"w": "set.", "b": [0.6891, 0.7756, 0.7234, 0.7953]}]}, {"id": "b_4", "type": "paragraph", "text": "3.5. Classifying newswires: a multiclass classification example", "words": [{"w": "3.5.", "b": [0.1294, 0.8324, 0.172, 0.8546]}, {"w": "Classifying", "b": [0.1791, 0.8324, 0.3131, 0.8546]}, {"w": "newswires:", "b": [0.3202, 0.8324, 0.4537, 0.8546]}, {"w": "a", "b": [0.4608, 0.8324, 0.475, 0.8546]}, {"w": "multiclass", "b": [0.4821, 0.8324, 0.6035, 0.8546]}, {"w": "classification", "b": [0.6106, 0.8324, 0.7666, 0.8546]}, {"w": "example", "b": [0.1294, 0.8565, 0.2303, 0.8787]}]}]}, {"page": 120, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In the previous section, you saw how to classify vector inputs into two mutually exclusive classes using a densely connected neural network. But what happens when you have more than two classes?", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "the", "b": [0.1567, 0.0857, 0.1876, 0.1054]}, {"w": "previous", "b": [0.1939, 0.0857, 0.2807, 0.1054]}, {"w": "section,", "b": [0.287, 0.0857, 0.3648, 0.1054]}, {"w": "you", "b": [0.3711, 0.0857, 0.409, 0.1054]}, {"w": "saw", "b": [0.4153, 0.0857, 0.4545, 0.1054]}, {"w": "how", "b": [0.4608, 0.0857, 0.5042, 0.1054]}, {"w": "to", "b": [0.5105, 0.0857, 0.5302, 0.1054]}, {"w": "classify", "b": [0.5365, 0.0857, 0.6135, 0.1054]}, {"w": "vector", "b": [0.6199, 0.0857, 0.6829, 0.1054]}, {"w": "inputs", "b": [0.6892, 0.0857, 0.7509, 0.1054]}, {"w": "into", "b": [0.7572, 0.0857, 0.7964, 0.1054]}, {"w": "two", "b": [0.8027, 0.0857, 0.8406, 0.1054]}, {"w": "mutually", "b": [0.1294, 0.1062, 0.2191, 0.1259]}, {"w": "exclusive", "b": [0.2254, 0.1062, 0.3207, 0.1259]}, {"w": "classes", "b": [0.327, 0.1062, 0.3971, 0.1259]}, {"w": "using", "b": [0.4034, 0.1062, 0.458, 0.1259]}, {"w": "a", "b": [0.4643, 0.1062, 0.4755, 0.1259]}, {"w": "densely", "b": [0.4818, 0.1062, 0.5589, 0.1259]}, {"w": "connected", "b": [0.5652, 0.1062, 0.6675, 0.1259]}, {"w": "neural", "b": [0.6737, 0.1062, 0.7367, 0.1259]}, {"w": "network.", "b": [0.743, 0.1062, 0.832, 0.1259]}, {"w": "But", "b": [0.1294, 0.1267, 0.1659, 0.1464]}, {"w": "what", "b": [0.1722, 0.1267, 0.2212, 0.1464]}, {"w": "happens", "b": [0.2275, 0.1267, 0.3102, 0.1464]}, {"w": "when", "b": [0.3165, 0.1267, 0.3711, 0.1464]}, {"w": "you", "b": [0.3774, 0.1267, 0.4153, 0.1464]}, {"w": "have", "b": [0.4216, 0.1267, 0.4692, 0.1464]}, {"w": "more", "b": [0.4755, 0.1267, 0.5273, 0.1464]}, {"w": "than", "b": [0.5337, 0.1267, 0.5771, 0.1464]}, {"w": "two", "b": [0.5834, 0.1267, 0.6212, 0.1464]}, {"w": "classes?", "b": [0.6275, 0.1267, 0.7088, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "In this section, you’ll build a network to classify Reuters newswires into 46 mutually exclusive topics. Because you have many classes, this problem is an instance of multiclass classification; and because each data point should be classified into only one category, the problem is more specifically an instance of single-label, multiclass classification. If each data point could belong to multiple categories (in this case, topics), you’d be facing a multilabel, multiclass classification problem.", "words": [{"w": "In", "b": [0.1294, 0.1695, 0.1504, 0.1892]}, {"w": "this", "b": [0.1567, 0.1695, 0.1932, 0.1892]}, {"w": "section,", "b": [0.1995, 0.1695, 0.2773, 0.1892]}, {"w": "you’ll", "b": [0.2836, 0.1695, 0.3438, 0.1892]}, {"w": "build", "b": [0.3501, 0.1695, 0.402, 0.1892]}, {"w": "a", "b": [0.4083, 0.1695, 0.4195, 0.1892]}, {"w": "network", "b": [0.4258, 0.1695, 0.5085, 0.1892]}, {"w": "to", "b": [0.5148, 0.1695, 0.5344, 0.1892]}, {"w": "classify", "b": [0.5407, 0.1695, 0.6178, 0.1892]}, {"w": "Reuters", "b": [0.6241, 0.1695, 0.7012, 0.1892]}, {"w": "newswires", "b": [0.7075, 0.1695, 0.8139, 0.1892]}, {"w": "into", "b": [0.8202, 0.1695, 0.8595, 0.1892]}, {"w": "46", "b": [0.1294, 0.19, 0.1546, 0.2097]}, {"w": "mutually", "b": [0.1609, 0.19, 0.2506, 0.2097]}, {"w": "exclusive", "b": [0.257, 0.19, 0.3522, 0.2097]}, {"w": "topics.", "b": [0.3585, 0.19, 0.4251, 0.2097]}, {"w": "Because", "b": [0.4314, 0.19, 0.5155, 0.2097]}, {"w": "you", "b": [0.5218, 0.19, 0.5596, 0.2097]}, {"w": "have", "b": [0.5659, 0.19, 0.6135, 0.2097]}, {"w": "many", "b": [0.6198, 0.19, 0.6758, 0.2097]}, {"w": "classes,", "b": [0.6821, 0.19, 0.7585, 0.2097]}, {"w": "this", "b": [0.7648, 0.19, 0.8013, 0.2097]}, {"w": "problem", "b": [0.1294, 0.2105, 0.2135, 0.2302]}, {"w": "is", "b": [0.2198, 0.2105, 0.2366, 0.2302]}, {"w": "an", "b": [0.2429, 0.2105, 0.2667, 0.2302]}, {"w": "instance", "b": [0.273, 0.2105, 0.3557, 0.2302]}, {"w": "of", "b": [0.362, 0.2105, 0.383, 0.2302]}, {"w": "multiclass", "b": [0.3893, 0.2105, 0.4916, 0.2302]}, {"w": "classification;", "b": [0.4979, 0.2105, 0.6394, 0.2302]}, {"w": "and", "b": [0.6457, 0.2105, 0.6822, 0.2302]}, {"w": "because", "b": [0.6885, 0.2105, 0.7683, 0.2302]}, {"w": "each", "b": [0.7746, 0.2105, 0.8208, 0.2302]}, {"w": "data", "b": [0.8271, 0.2105, 0.8692, 0.2302]}, {"w": "point", "b": [0.1294, 0.231, 0.1813, 0.2507]}, {"w": "should", "b": [0.1876, 0.231, 0.2549, 0.2507]}, {"w": "be", "b": [0.2612, 0.231, 0.285, 0.2507]}, {"w": "classified", "b": [0.2913, 0.231, 0.3866, 0.2507]}, {"w": "into", "b": [0.3929, 0.231, 0.4321, 0.2507]}, {"w": "only", "b": [0.4384, 0.231, 0.4833, 0.2507]}, {"w": "one", "b": [0.4896, 0.231, 0.526, 0.2507]}, {"w": "category,", "b": [0.5323, 0.231, 0.6238, 0.2507]}, {"w": "the", "b": [0.6301, 0.231, 0.6609, 0.2507]}, {"w": "problem", "b": [0.6672, 0.231, 0.7513, 0.2507]}, {"w": "is", "b": [0.7576, 0.231, 0.7744, 0.2507]}, {"w": "more", "b": [0.7807, 0.231, 0.8326, 0.2507]}, {"w": "specifically", "b": [0.1294, 0.2515, 0.2457, 0.2712]}, {"w": "an", "b": [0.252, 0.2515, 0.2758, 0.2712]}, {"w": "instance", "b": [0.2821, 0.2515, 0.3648, 0.2712]}, {"w": "of", "b": [0.3711, 0.2515, 0.3921, 0.2712]}, {"w": "single-label,", "b": [0.3984, 0.2515, 0.5238, 0.2712]}, {"w": "multiclass", "b": [0.5301, 0.2515, 0.6324, 0.2712]}, {"w": "classification.", "b": [0.6387, 0.2515, 0.7795, 0.2712]}, {"w": "If", "b": [0.7858, 0.2515, 0.8026, 0.2712]}, {"w": "each", "b": [0.8089, 0.2515, 0.8551, 0.2712]}, {"w": "data", "b": [0.1294, 0.272, 0.1714, 0.2917]}, {"w": "point", "b": [0.1777, 0.272, 0.2296, 0.2917]}, {"w": "could", "b": [0.2359, 0.272, 0.292, 0.2917]}, {"w": "belong", "b": [0.2983, 0.272, 0.3669, 0.2917]}, {"w": "to", "b": [0.3732, 0.272, 0.3929, 0.2917]}, {"w": "multiple", "b": [0.3992, 0.272, 0.4833, 0.2917]}, {"w": "categories", "b": [0.4896, 0.272, 0.5919, 0.2917]}, {"w": "(in", "b": [0.5982, 0.272, 0.6262, 0.2917]}, {"w": "this", "b": [0.6325, 0.272, 0.6689, 0.2917]}, {"w": "case,", "b": [0.6752, 0.272, 0.725, 0.2917]}, {"w": "topics),", "b": [0.7313, 0.272, 0.8062, 0.2917]}, {"w": "you’d", "b": [0.1294, 0.2925, 0.1883, 0.3122]}, {"w": "be", "b": [0.1946, 0.2925, 0.2184, 0.3122]}, {"w": "facing", "b": [0.2247, 0.2925, 0.2877, 0.3122]}, {"w": "a", "b": [0.294, 0.2925, 0.3052, 0.3122]}, {"w": "multilabel,", "b": [0.3115, 0.2925, 0.4201, 0.3122]}, {"w": "multiclass", "b": [0.4264, 0.2925, 0.5288, 0.3122]}, {"w": "classification", "b": [0.5351, 0.2925, 0.6696, 0.3122]}, {"w": "problem.", "b": [0.6759, 0.2925, 0.7662, 0.3122]}]}, {"id": "b_2", "type": "paragraph", "text": "3.5.1. The Reuters dataset", "words": [{"w": "3.5.1.", "b": [0.1294, 0.3397, 0.1862, 0.3594]}, {"w": "The", "b": [0.1925, 0.3397, 0.2345, 0.3594]}, {"w": "Reuters", "b": [0.2408, 0.3397, 0.3249, 0.3594]}, {"w": "dataset", "b": [0.3312, 0.3397, 0.4083, 0.3594]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ll work with the Reuters dataset, a set of short newswires and their topics, published by Reuters in 1986. It’s a simple, widely used toy dataset for text classification. There are 46 different topics; some topics are more represented than others, but each topic has at least 10 examples in the training set.", "words": [{"w": "You’ll", "b": [0.1294, 0.3825, 0.1928, 0.4022]}, {"w": "work", "b": [0.1991, 0.3825, 0.2509, 0.4022]}, {"w": "with", "b": [0.2572, 0.3825, 0.3021, 0.4022]}, {"w": "the", "b": [0.3084, 0.3825, 0.3392, 0.4022]}, {"w": "Reuters", "b": [0.3455, 0.3825, 0.4225, 0.4022]}, {"w": "dataset,", "b": [0.4288, 0.3825, 0.508, 0.4022]}, {"w": "a", "b": [0.5143, 0.3825, 0.5255, 0.4022]}, {"w": "set", "b": [0.5318, 0.3825, 0.5598, 0.4022]}, {"w": "of", "b": [0.5661, 0.3825, 0.5872, 0.4022]}, {"w": "short", "b": [0.5935, 0.3825, 0.6439, 0.4022]}, {"w": "newswires", "b": [0.6502, 0.3825, 0.7567, 0.4022]}, {"w": "and", "b": [0.763, 0.3825, 0.7994, 0.4022]}, {"w": "their", "b": [0.8057, 0.3825, 0.852, 0.4022]}, {"w": "topics,", "b": [0.1294, 0.403, 0.196, 0.4227]}, {"w": "published", "b": [0.2023, 0.403, 0.3004, 0.4227]}, {"w": "by", "b": [0.3067, 0.403, 0.3319, 0.4227]}, {"w": "Reuters", "b": [0.3382, 0.403, 0.4153, 0.4227]}, {"w": "in", "b": [0.4216, 0.403, 0.4412, 0.4227]}, {"w": "1986.", "b": [0.4475, 0.403, 0.5043, 0.4227]}, {"w": "It’s", "b": [0.5106, 0.403, 0.5428, 0.4227]}, {"w": "a", "b": [0.5491, 0.403, 0.5603, 0.4227]}, {"w": "simple,", "b": [0.5666, 0.403, 0.6402, 0.4227]}, {"w": "widely", "b": [0.6465, 0.403, 0.7152, 0.4227]}, {"w": "used", "b": [0.7215, 0.403, 0.7677, 0.4227]}, {"w": "toy", "b": [0.774, 0.403, 0.8063, 0.4227]}, {"w": "dataset", "b": [0.1294, 0.4235, 0.1995, 0.4432]}, {"w": "for", "b": [0.2058, 0.4235, 0.2352, 0.4432]}, {"w": "text", "b": [0.2415, 0.4235, 0.2793, 0.4432]}, {"w": "classification.", "b": [0.2856, 0.4235, 0.425, 0.4432]}, {"w": "There", "b": [0.4313, 0.4235, 0.4902, 0.4432]}, {"w": "are", "b": [0.4965, 0.4235, 0.5273, 0.4432]}, {"w": "46", "b": [0.5336, 0.4235, 0.5588, 0.4432]}, {"w": "different", "b": [0.5651, 0.4235, 0.6514, 0.4432]}, {"w": "topics;", "b": [0.6577, 0.4235, 0.725, 0.4432]}, {"w": "some", "b": [0.7313, 0.4235, 0.7846, 0.4432]}, {"w": "topics", "b": [0.7909, 0.4235, 0.8512, 0.4432]}, {"w": "are", "b": [0.1294, 0.444, 0.1602, 0.4637]}, {"w": "more", "b": [0.1665, 0.444, 0.2184, 0.4637]}, {"w": "represented", "b": [0.2247, 0.444, 0.3409, 0.4637]}, {"w": "than", "b": [0.3472, 0.444, 0.3907, 0.4637]}, {"w": "others,", "b": [0.397, 0.444, 0.4649, 0.4637]}, {"w": "but", "b": [0.4712, 0.444, 0.5035, 0.4637]}, {"w": "each", "b": [0.5098, 0.444, 0.556, 0.4637]}, {"w": "topic", "b": [0.5623, 0.444, 0.6128, 0.4637]}, {"w": "has", "b": [0.6191, 0.444, 0.6527, 0.4637]}, {"w": "at", "b": [0.659, 0.444, 0.6772, 0.4637]}, {"w": "least", "b": [0.6835, 0.444, 0.7298, 0.4637]}, {"w": "10", "b": [0.7361, 0.444, 0.7613, 0.4637]}, {"w": "examples", "b": [0.7675, 0.444, 0.8628, 0.4637]}, {"w": "in", "b": [0.1294, 0.4645, 0.149, 0.4842]}, {"w": "the", "b": [0.1553, 0.4645, 0.1862, 0.4842]}, {"w": "training", "b": [0.1925, 0.4645, 0.271, 0.4842]}, {"w": "set.", "b": [0.2773, 0.4645, 0.3116, 0.4842]}]}, {"id": "b_4", "type": "paragraph", "text": "Like IMDB and MNIST, the Reuters dataset comes packaged as part of Keras. Let’s take a look.", "words": [{"w": "Like", "b": [0.1294, 0.5073, 0.1757, 0.527]}, {"w": "IMDB", "b": [0.182, 0.5073, 0.2478, 0.527]}, {"w": "and", "b": [0.2541, 0.5073, 0.2906, 0.527]}, {"w": "MNIST,", "b": [0.2969, 0.5073, 0.3798, 0.527]}, {"w": "the", "b": [0.3861, 0.5073, 0.4169, 0.527]}, {"w": "Reuters", "b": [0.4232, 0.5073, 0.5003, 0.527]}, {"w": "dataset", "b": [0.5066, 0.5073, 0.5766, 0.527]}, {"w": "comes", "b": [0.5829, 0.5073, 0.6474, 0.527]}, {"w": "packaged", "b": [0.6537, 0.5073, 0.749, 0.527]}, {"w": "as", "b": [0.7553, 0.5073, 0.7763, 0.527]}, {"w": "part", "b": [0.7826, 0.5073, 0.8218, 0.527]}, {"w": "of", "b": [0.8281, 0.5073, 0.8491, 0.527]}, {"w": "Keras.", "b": [0.1294, 0.5278, 0.1945, 0.5475]}, {"w": "Let’s", "b": [0.2009, 0.5278, 0.2513, 0.5475]}, {"w": "take", "b": [0.2576, 0.5278, 0.2996, 0.5475]}, {"w": "a", "b": [0.3059, 0.5278, 0.3171, 0.5475]}, {"w": "look.", "b": [0.3234, 0.5278, 0.3746, 0.5475]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 3.12. Loading the Reuters dataset", "words": [{"w": "Listing", "b": [0.1294, 0.5656, 0.1862, 0.5804]}, {"w": "3.12.", "b": [0.1909, 0.5656, 0.2288, 0.5804]}, {"w": "Loading", "b": [0.2335, 0.5656, 0.3008, 0.5804]}, {"w": "the", "b": [0.3055, 0.5656, 0.3307, 0.5804]}, {"w": "Reuters", "b": [0.3354, 0.5656, 0.3985, 0.5804]}, {"w": "dataset", "b": [0.4032, 0.5656, 0.461, 0.5804]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras.datasets import reuters (train_data, train_labels), (test_data, test_labels) = reuters.load_data( num_words=10000)", "words": [{"w": "from", "b": [0.1357, 0.594, 0.1811, 0.6092]}, {"w": "keras.datasets", "b": [0.1925, 0.594, 0.3514, 0.6092]}, {"w": "import", "b": [0.3628, 0.594, 0.4309, 0.6092]}, {"w": "reuters", "b": [0.4422, 0.594, 0.5217, 0.6092]}, {"w": "(train_data,", "b": [0.1357, 0.6243, 0.2719, 0.6395]}, {"w": "train_labels),", "b": [0.2833, 0.6243, 0.4422, 0.6395]}, {"w": "(test_data,", "b": [0.4536, 0.6243, 0.5784, 0.6395]}, {"w": "test_labels)", "b": [0.5898, 0.6243, 0.726, 0.6395]}, {"w": "=", "b": [0.7374, 0.6243, 0.7487, 0.6395]}, {"w": "reuters.load_data(", "b": [0.1357, 0.6395, 0.34, 0.6546]}, {"w": "num_words=10000)", "b": [0.1811, 0.6546, 0.3628, 0.6698]}]}, {"id": "b_7", "type": "paragraph", "text": "As with the IMDB dataset, the argument num_words=10000 restricts the data to the 10,000 most frequently occurring words found in the data.", "words": [{"w": "As", "b": [0.1294, 0.6927, 0.1574, 0.7124]}, {"w": "with", "b": [0.1637, 0.6927, 0.2086, 0.7124]}, {"w": "the", "b": [0.2149, 0.6927, 0.2457, 0.7124]}, {"w": "IMDB", "b": [0.252, 0.6927, 0.3179, 0.7124]}, {"w": "dataset,", "b": [0.3242, 0.6927, 0.4006, 0.7124]}, {"w": "the", "b": [0.4069, 0.6927, 0.4377, 0.7124]}, {"w": "argument", "b": [0.444, 0.6927, 0.5388, 0.7124]}, {"w": "num_words=10000", "b": [0.5451, 0.6937, 0.7721, 0.7139]}, {"w": "restricts", "b": [0.7784, 0.6927, 0.8583, 0.7124]}, {"w": "the", "b": [0.1294, 0.7141, 0.1602, 0.7338]}, {"w": "data", "b": [0.1665, 0.7141, 0.2086, 0.7338]}, {"w": "to", "b": [0.2149, 0.7141, 0.2345, 0.7338]}, {"w": "the", "b": [0.2408, 0.7141, 0.2716, 0.7338]}, {"w": "10,000", "b": [0.2779, 0.7141, 0.3473, 0.7338]}, {"w": "most", "b": [0.3536, 0.7141, 0.4027, 0.7338]}, {"w": "frequently", "b": [0.409, 0.7141, 0.5127, 0.7338]}, {"w": "occurring", "b": [0.519, 0.7141, 0.6156, 0.7338]}, {"w": "words", "b": [0.6219, 0.7141, 0.6836, 0.7338]}, {"w": "found", "b": [0.6899, 0.7141, 0.7488, 0.7338]}, {"w": "in", "b": [0.7551, 0.7141, 0.7747, 0.7338]}, {"w": "the", "b": [0.781, 0.7141, 0.8118, 0.7338]}, {"w": "data.", "b": [0.8181, 0.7141, 0.8665, 0.7338]}]}, {"id": "b_8", "type": "paragraph", "text": "You have 8,982 training examples and 2,246 test examples:", "words": [{"w": "You", "b": [0.1294, 0.7568, 0.1703, 0.7766]}, {"w": "have", "b": [0.1766, 0.7568, 0.2243, 0.7766]}, {"w": "8,982", "b": [0.2306, 0.7568, 0.2873, 0.7766]}, {"w": "training", "b": [0.2936, 0.7568, 0.3721, 0.7766]}, {"w": "examples", "b": [0.3784, 0.7568, 0.4737, 0.7766]}, {"w": "and", "b": [0.48, 0.7568, 0.5164, 0.7766]}, {"w": "2,246", "b": [0.5227, 0.7568, 0.5795, 0.7766]}, {"w": "test", "b": [0.5858, 0.7568, 0.6208, 0.7766]}, {"w": "examples:", "b": [0.6271, 0.7568, 0.7294, 0.7766]}]}, {"id": "b_9", "type": "equation", "text": ">>> len(train_data) 8982 >>> len(test_data) 2246", "words": [{"w": ">>>", "b": [0.1357, 0.7946, 0.1698, 0.8097]}, {"w": "len(train_data)", "b": [0.1811, 0.7946, 0.3514, 0.8097]}, {"w": "8982", "b": [0.1357, 0.8097, 0.1811, 0.8249]}, {"w": ">>>", "b": [0.1357, 0.8249, 0.1698, 0.84]}, {"w": "len(test_data)", "b": [0.1811, 0.8249, 0.34, 0.84]}, {"w": "2246", "b": [0.1357, 0.84, 0.1811, 0.8552]}]}]}, {"page": 121, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As with the IMDB reviews, each example is a list of integers (word indices):", "words": [{"w": "As", "b": [0.1294, 0.0857, 0.1574, 0.1054]}, {"w": "with", "b": [0.1637, 0.0857, 0.2086, 0.1054]}, {"w": "the", "b": [0.2149, 0.0857, 0.2457, 0.1054]}, {"w": "IMDB", "b": [0.252, 0.0857, 0.3179, 0.1054]}, {"w": "reviews,", "b": [0.3242, 0.0857, 0.409, 0.1054]}, {"w": "each", "b": [0.4153, 0.0857, 0.4615, 0.1054]}, {"w": "example", "b": [0.4678, 0.0857, 0.5533, 0.1054]}, {"w": "is", "b": [0.5596, 0.0857, 0.5764, 0.1054]}, {"w": "a", "b": [0.5827, 0.0857, 0.5939, 0.1054]}, {"w": "list", "b": [0.6002, 0.0857, 0.6311, 0.1054]}, {"w": "of", "b": [0.6374, 0.0857, 0.6584, 0.1054]}, {"w": "integers", "b": [0.6647, 0.0857, 0.7445, 0.1054]}, {"w": "(word", "b": [0.7508, 0.0857, 0.8111, 0.1054]}, {"w": "indices):", "b": [0.1294, 0.1062, 0.2163, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": ">>> train_data[10] [1, 245, 273, 207, 156, 53, 74, 160, 26, 14, 46, 296, 26, 39, 74, 2979, 3554, 14, 46, 4689, 4329, 86, 61, 3499, 4795, 14, 61, 451, 4329, 17, 12]", "words": [{"w": ">>>", "b": [0.1357, 0.1439, 0.1698, 0.1591]}, {"w": "train_data[10]", "b": [0.1811, 0.1439, 0.34, 0.1591]}, {"w": "[1,", "b": [0.1357, 0.1591, 0.1698, 0.1742]}, {"w": "245,", "b": [0.1811, 0.1591, 0.2265, 0.1742]}, {"w": "273,", "b": [0.2379, 0.1591, 0.2833, 0.1742]}, {"w": "207,", "b": [0.2946, 0.1591, 0.34, 0.1742]}, {"w": "156,", "b": [0.3514, 0.1591, 0.3968, 0.1742]}, {"w": "53,", "b": [0.4082, 0.1591, 0.4422, 0.1742]}, {"w": "74,", "b": [0.4536, 0.1591, 0.4876, 0.1742]}, {"w": "160,", "b": [0.499, 0.1591, 0.5444, 0.1742]}, {"w": "26,", "b": [0.5557, 0.1591, 0.5898, 0.1742]}, {"w": "14,", "b": [0.6011, 0.1591, 0.6352, 0.1742]}, {"w": "46,", "b": [0.6465, 0.1591, 0.6806, 0.1742]}, {"w": "296,", "b": [0.6919, 0.1591, 0.7374, 0.1742]}, {"w": "26,", "b": [0.7487, 0.1591, 0.7828, 0.1742]}, {"w": "39,", "b": [0.7941, 0.1591, 0.8282, 0.1742]}, {"w": "74,", "b": [0.1357, 0.1742, 0.1698, 0.1894]}, {"w": "2979,", "b": [0.1811, 0.1742, 0.2379, 0.1894]}, {"w": "3554,", "b": [0.1357, 0.1894, 0.1925, 0.2045]}, {"w": "14,", "b": [0.2038, 0.1894, 0.2379, 0.2045]}, {"w": "46,", "b": [0.2492, 0.1894, 0.2833, 0.2045]}, {"w": "4689,", "b": [0.2946, 0.1894, 0.3514, 0.2045]}, {"w": "4329,", "b": [0.3628, 0.1894, 0.4195, 0.2045]}, {"w": "86,", "b": [0.4309, 0.1894, 0.4649, 0.2045]}, {"w": "61,", "b": [0.4763, 0.1894, 0.5103, 0.2045]}, {"w": "3499,", "b": [0.5217, 0.1894, 0.5784, 0.2045]}, {"w": "4795,", "b": [0.5898, 0.1894, 0.6465, 0.2045]}, {"w": "14,", "b": [0.6579, 0.1894, 0.6919, 0.2045]}, {"w": "61,", "b": [0.7033, 0.1894, 0.7374, 0.2045]}, {"w": "451,", "b": [0.7487, 0.1894, 0.7941, 0.2045]}, {"w": "4329,", "b": [0.8055, 0.1894, 0.8622, 0.2045]}, {"w": "17,", "b": [0.1357, 0.2045, 0.1698, 0.2197]}, {"w": "12]", "b": [0.1811, 0.2045, 0.2152, 0.2197]}]}, {"id": "b_2", "type": "paragraph", "text": "Here’s how you can decode it back to words, in case you’re curious.", "words": [{"w": "Here’s", "b": [0.1294, 0.2426, 0.1952, 0.2623]}, {"w": "how", "b": [0.2016, 0.2426, 0.245, 0.2623]}, {"w": "you", "b": [0.2513, 0.2426, 0.2891, 0.2623]}, {"w": "can", "b": [0.2954, 0.2426, 0.3305, 0.2623]}, {"w": "decode", "b": [0.3368, 0.2426, 0.4082, 0.2623]}, {"w": "it", "b": [0.4145, 0.2426, 0.4285, 0.2623]}, {"w": "back", "b": [0.4348, 0.2426, 0.4825, 0.2623]}, {"w": "to", "b": [0.4888, 0.2426, 0.5084, 0.2623]}, {"w": "words,", "b": [0.5147, 0.2426, 0.5827, 0.2623]}, {"w": "in", "b": [0.589, 0.2426, 0.6086, 0.2623]}, {"w": "case", "b": [0.6149, 0.2426, 0.6583, 0.2623]}, {"w": "you’re", "b": [0.6646, 0.2426, 0.7305, 0.2623]}, {"w": "curious.", "b": [0.7368, 0.2426, 0.8173, 0.2623]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 3.13. Decoding newswires back to text", "words": [{"w": "Listing", "b": [0.1294, 0.2804, 0.1862, 0.2952]}, {"w": "3.13.", "b": [0.1909, 0.2804, 0.2288, 0.2952]}, {"w": "Decoding", "b": [0.2335, 0.2804, 0.3091, 0.2952]}, {"w": "newswires", "b": [0.3139, 0.2804, 0.3966, 0.2952]}, {"w": "back", "b": [0.4013, 0.2804, 0.4402, 0.2952]}, {"w": "to", "b": [0.4449, 0.2804, 0.4607, 0.2952]}, {"w": "text", "b": [0.4654, 0.2804, 0.4959, 0.2952]}]}, {"id": "b_4", "type": "paragraph", "text": "word_index = reuters.get_word_index() reverse_word_index = dict([(value, key) for (key, value) in word_index.items()]) decoded_newswire = ' '.join([reverse_word_index.get(i - 3, '?') for i in train_data[0]]) 1", "words": [{"w": "word_index", "b": [0.1357, 0.3088, 0.2492, 0.3239]}, {"w": "=", "b": [0.2606, 0.3088, 0.2719, 0.3239]}, {"w": "reuters.get_word_index()", "b": [0.2833, 0.3088, 0.5557, 0.3239]}, {"w": "reverse_word_index", "b": [0.1357, 0.324, 0.34, 0.3391]}, {"w": "=", "b": [0.3514, 0.324, 0.3628, 0.3391]}, {"w": "dict([(value,", "b": [0.3741, 0.324, 0.5217, 0.3391]}, {"w": "key)", "b": [0.533, 0.324, 0.5784, 0.3391]}, {"w": "for", "b": [0.5898, 0.324, 0.6238, 0.3391]}, {"w": "(key,", "b": [0.6352, 0.324, 0.6919, 0.3391]}, {"w": "value)", "b": [0.7033, 0.324, 0.7714, 0.3391]}, {"w": "in", "b": [0.7828, 0.324, 0.8055, 0.3391]}, {"w": "word_index.items()])", "b": [0.1357, 0.3391, 0.3628, 0.3543]}, {"w": "decoded_newswire", "b": [0.1357, 0.3543, 0.3173, 0.3694]}, {"w": "=", "b": [0.3287, 0.3543, 0.34, 0.3694]}, {"w": "'", "b": [0.3514, 0.3543, 0.3628, 0.3694]}, {"w": "'.join([reverse_word_index.get(i", "b": [0.3741, 0.3543, 0.7374, 0.3694]}, {"w": "-", "b": [0.7487, 0.3543, 0.7601, 0.3694]}, {"w": "3,", "b": [0.7714, 0.3543, 0.7941, 0.3694]}, {"w": "'?')", "b": [0.8055, 0.3543, 0.8509, 0.3694]}, {"w": "for", "b": [0.1357, 0.3694, 0.1698, 0.3846]}, {"w": "i", "b": [0.1811, 0.3694, 0.1925, 0.3846]}, {"w": "in", "b": [0.2038, 0.3694, 0.2265, 0.3846]}, {"w": "train_data[0]])", "b": [0.1811, 0.3846, 0.3514, 0.3997]}, {"w": "1", "b": [0.1357, 0.3997, 0.1471, 0.4149]}]}, {"id": "b_5", "type": "paragraph", "text": "1 Note that the indices are offset by 3 because 0, 1, and 2 are reserved indices for “padding,” “start of sequence,” and “unknown.”", "words": [{"w": "1", "b": [0.1799, 0.4333, 0.1925, 0.453]}, {"w": "Note", "b": [0.1988, 0.4333, 0.2492, 0.453]}, {"w": "that", "b": [0.2555, 0.4333, 0.299, 0.453]}, {"w": "the", "b": [0.3053, 0.4333, 0.3389, 0.453]}, {"w": "indices", "b": [0.3452, 0.4333, 0.4195, 0.453]}, {"w": "are", "b": [0.4258, 0.4333, 0.4603, 0.453]}, {"w": "offset", "b": [0.4667, 0.4333, 0.5255, 0.453]}, {"w": "by", "b": [0.5318, 0.4333, 0.5584, 0.453]}, {"w": "3", "b": [0.5647, 0.4333, 0.5773, 0.453]}, {"w": "because", "b": [0.5836, 0.4333, 0.6677, 0.453]}, {"w": "0,", "b": [0.674, 0.4333, 0.693, 0.453]}, {"w": "1,", "b": [0.6993, 0.4333, 0.7182, 0.453]}, {"w": "and", "b": [0.7245, 0.4333, 0.7651, 0.453]}, {"w": "2", "b": [0.7715, 0.4333, 0.7841, 0.453]}, {"w": "are", "b": [0.7904, 0.4333, 0.8249, 0.453]}, {"w": "reserved", "b": [0.1799, 0.4538, 0.2719, 0.4735]}, {"w": "indices", "b": [0.2782, 0.4538, 0.3525, 0.4735]}, {"w": "for", "b": [0.3588, 0.4538, 0.391, 0.4735]}, {"w": "“padding,”", "b": [0.3973, 0.4538, 0.5172, 0.4735]}, {"w": "“start", "b": [0.5235, 0.4538, 0.5865, 0.4735]}, {"w": "of", "b": [0.5928, 0.4538, 0.6138, 0.4735]}, {"w": "sequence,”", "b": [0.6201, 0.4538, 0.7357, 0.4735]}, {"w": "and", "b": [0.742, 0.4538, 0.7827, 0.4735]}, {"w": "“unknown.”", "b": [0.1799, 0.4743, 0.3123, 0.494]}]}, {"id": "b_6", "type": "paragraph", "text": "The label associated with an example is an integer between 0 and 45—a topic index:", "words": [{"w": "The", "b": [0.1294, 0.5171, 0.1686, 0.5368]}, {"w": "label", "b": [0.1749, 0.5171, 0.224, 0.5368]}, {"w": "associated", "b": [0.2303, 0.5171, 0.334, 0.5368]}, {"w": "with", "b": [0.3403, 0.5171, 0.3851, 0.5368]}, {"w": "an", "b": [0.3914, 0.5171, 0.4152, 0.5368]}, {"w": "example", "b": [0.4216, 0.5171, 0.507, 0.5368]}, {"w": "is", "b": [0.5133, 0.5171, 0.5301, 0.5368]}, {"w": "an", "b": [0.5365, 0.5171, 0.5603, 0.5368]}, {"w": "integer", "b": [0.5666, 0.5171, 0.6366, 0.5368]}, {"w": "between", "b": [0.6429, 0.5171, 0.727, 0.5368]}, {"w": "0", "b": [0.7333, 0.5171, 0.7459, 0.5368]}, {"w": "and", "b": [0.7522, 0.5171, 0.7886, 0.5368]}, {"w": "45—a", "b": [0.7949, 0.5171, 0.8566, 0.5368]}, {"w": "topic", "b": [0.1294, 0.5376, 0.1799, 0.5573]}, {"w": "index:", "b": [0.1862, 0.5376, 0.2492, 0.5573]}]}, {"id": "b_7", "type": "equation", "text": ">>> train_labels[10] 3", "words": [{"w": ">>>", "b": [0.1357, 0.5753, 0.1698, 0.5905]}, {"w": "train_labels[10]", "b": [0.1811, 0.5753, 0.3628, 0.5905]}, {"w": "3", "b": [0.1357, 0.5905, 0.1471, 0.6056]}]}, {"id": "b_8", "type": "paragraph", "text": "3.5.2. Preparing the data", "words": [{"w": "3.5.2.", "b": [0.1294, 0.6329, 0.1862, 0.6527]}, {"w": "Preparing", "b": [0.1925, 0.6329, 0.3013, 0.6527]}, {"w": "the", "b": [0.3076, 0.6329, 0.3412, 0.6527]}, {"w": "data", "b": [0.3476, 0.6329, 0.3952, 0.6527]}]}, {"id": "b_9", "type": "paragraph", "text": "You can vectorize the data with the exact same code as in the previous example.", "words": [{"w": "You", "b": [0.1294, 0.6757, 0.1703, 0.6955]}, {"w": "can", "b": [0.1766, 0.6757, 0.2116, 0.6955]}, {"w": "vectorize", "b": [0.218, 0.6757, 0.3104, 0.6955]}, {"w": "the", "b": [0.3167, 0.6757, 0.3475, 0.6955]}, {"w": "data", "b": [0.3538, 0.6757, 0.3959, 0.6955]}, {"w": "with", "b": [0.4022, 0.6757, 0.447, 0.6955]}, {"w": "the", "b": [0.4533, 0.6757, 0.4842, 0.6955]}, {"w": "exact", "b": [0.4905, 0.6757, 0.5437, 0.6955]}, {"w": "same", "b": [0.55, 0.6757, 0.6018, 0.6955]}, {"w": "code", "b": [0.6081, 0.6757, 0.6558, 0.6955]}, {"w": "as", "b": [0.6621, 0.6757, 0.6831, 0.6955]}, {"w": "in", "b": [0.6894, 0.6757, 0.709, 0.6955]}, {"w": "the", "b": [0.7153, 0.6757, 0.7462, 0.6955]}, {"w": "previous", "b": [0.7525, 0.6757, 0.8393, 0.6955]}, {"w": "example.", "b": [0.1294, 0.6962, 0.2212, 0.716]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 3.14. Encoding the data", "words": [{"w": "Listing", "b": [0.1294, 0.7341, 0.1862, 0.7489]}, {"w": "3.14.", "b": [0.1909, 0.7341, 0.2288, 0.7489]}, {"w": "Encoding", "b": [0.2335, 0.7341, 0.3102, 0.7489]}, {"w": "the", "b": [0.315, 0.7341, 0.3402, 0.7489]}, {"w": "data", "b": [0.3449, 0.7341, 0.3806, 0.7489]}]}, {"id": "b_11", "type": "paragraph", "text": "import numpy as np def vectorize_sequences(sequences, dimension=10000): results = np.zeros((len(sequences), dimension)) for i, sequence in enumerate(sequences): results[i, sequence] = 1. return results x_train = vectorize_sequences(train_data) 1 x_test = vectorize_sequences(test_data) 2", "words": [{"w": "import", "b": [0.1357, 0.7625, 0.2038, 0.7776]}, {"w": "numpy", "b": [0.2152, 0.7625, 0.2719, 0.7776]}, {"w": "as", "b": [0.2833, 0.7625, 0.306, 0.7776]}, {"w": "np", "b": [0.3173, 0.7625, 0.34, 0.7776]}, {"w": "def", "b": [0.1357, 0.7928, 0.1698, 0.8079]}, {"w": "vectorize_sequences(sequences,", "b": [0.1811, 0.7928, 0.5217, 0.8079]}, {"w": "dimension=10000):", "b": [0.533, 0.7928, 0.726, 0.8079]}, {"w": "results", "b": [0.1811, 0.8079, 0.2606, 0.8231]}, {"w": "=", "b": [0.2719, 0.8079, 0.2833, 0.8231]}, {"w": "np.zeros((len(sequences),", "b": [0.2946, 0.8079, 0.5784, 0.8231]}, {"w": "dimension))", "b": [0.5898, 0.8079, 0.7146, 0.8231]}, {"w": "for", "b": [0.1811, 0.8231, 0.2152, 0.8382]}, {"w": "i,", "b": [0.2265, 0.8231, 0.2492, 0.8382]}, {"w": "sequence", "b": [0.2606, 0.8231, 0.3514, 0.8382]}, {"w": "in", "b": [0.3628, 0.8231, 0.3855, 0.8382]}, {"w": "enumerate(sequences):", "b": [0.3968, 0.8231, 0.6352, 0.8382]}, {"w": "results[i,", "b": [0.2265, 0.8382, 0.34, 0.8534]}, {"w": "sequence]", "b": [0.3514, 0.8382, 0.4536, 0.8534]}, {"w": "=", "b": [0.4649, 0.8382, 0.4763, 0.8534]}, {"w": "1.", "b": [0.4876, 0.8382, 0.5103, 0.8534]}, {"w": "return", "b": [0.1811, 0.8534, 0.2492, 0.8685]}, {"w": "results", "b": [0.2606, 0.8534, 0.34, 0.8685]}, {"w": "x_train", "b": [0.1357, 0.8837, 0.2152, 0.8988]}, {"w": "=", "b": [0.2265, 0.8837, 0.2379, 0.8988]}, {"w": "vectorize_sequences(train_data)", "b": [0.2492, 0.8837, 0.6011, 0.8988]}, {"w": "1", "b": [0.7374, 0.8837, 0.7488, 0.8988]}, {"w": "x_test", "b": [0.1357, 0.8989, 0.2038, 0.914]}, {"w": "=", "b": [0.2152, 0.8989, 0.2265, 0.914]}, {"w": "vectorize_sequences(test_data)", "b": [0.2379, 0.8989, 0.5784, 0.914]}, {"w": "2", "b": [0.7374, 0.8989, 0.7488, 0.914]}]}]}, {"page": 122, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1 Vectorized training data 2 Vectorized test data", "words": [{"w": "1", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Vectorized", "b": [0.1988, 0.0857, 0.3127, 0.1054]}, {"w": "training", "b": [0.319, 0.0857, 0.4059, 0.1054]}, {"w": "data", "b": [0.4123, 0.0857, 0.4599, 0.1054]}, {"w": "2", "b": [0.1799, 0.1062, 0.1925, 0.1259]}, {"w": "Vectorized", "b": [0.1988, 0.1062, 0.3127, 0.1259]}, {"w": "test", "b": [0.319, 0.1062, 0.3569, 0.1259]}, {"w": "data", "b": [0.3632, 0.1062, 0.4108, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "To vectorize the labels, there are two possibilities: you can cast the label list as an integer tensor, or you can use one-hot encoding. One-hot encoding is a widely used format for categorical data, also called categorical encoding. For a more detailed explanation of one-hot encoding, see section 6.1. In this case, one-hot encoding of the labels consists of embedding each label as an all-zero vector with a 1 in the place of the label index. Here’s an example:", "words": [{"w": "To", "b": [0.1294, 0.149, 0.1557, 0.1687]}, {"w": "vectorize", "b": [0.162, 0.149, 0.2544, 0.1687]}, {"w": "the", "b": [0.2607, 0.149, 0.2916, 0.1687]}, {"w": "labels,", "b": [0.2979, 0.149, 0.363, 0.1687]}, {"w": "there", "b": [0.3693, 0.149, 0.4198, 0.1687]}, {"w": "are", "b": [0.4261, 0.149, 0.4569, 0.1687]}, {"w": "two", "b": [0.4632, 0.149, 0.501, 0.1687]}, {"w": "possibilities:", "b": [0.5073, 0.149, 0.6349, 0.1687]}, {"w": "you", "b": [0.6412, 0.149, 0.679, 0.1687]}, {"w": "can", "b": [0.6853, 0.149, 0.7204, 0.1687]}, {"w": "cast", "b": [0.7267, 0.149, 0.7659, 0.1687]}, {"w": "the", "b": [0.7722, 0.149, 0.803, 0.1687]}, {"w": "label", "b": [0.8093, 0.149, 0.8584, 0.1687]}, {"w": "list", "b": [0.1294, 0.1695, 0.1603, 0.1892]}, {"w": "as", "b": [0.1666, 0.1695, 0.1876, 0.1892]}, {"w": "an", "b": [0.1939, 0.1695, 0.2177, 0.1892]}, {"w": "integer", "b": [0.224, 0.1695, 0.2941, 0.1892]}, {"w": "tensor,", "b": [0.3004, 0.1695, 0.3673, 0.1892]}, {"w": "or", "b": [0.3736, 0.1695, 0.3946, 0.1892]}, {"w": "you", "b": [0.4009, 0.1695, 0.4387, 0.1892]}, {"w": "can", "b": [0.4451, 0.1695, 0.4801, 0.1892]}, {"w": "use", "b": [0.4864, 0.1695, 0.52, 0.1892]}, {"w": "one-hot", "b": [0.5263, 0.1695, 0.6034, 0.1892]}, {"w": "encoding.", "b": [0.6096, 0.1695, 0.7084, 0.1892]}, {"w": "One-hot", "b": [0.7147, 0.1695, 0.7974, 0.1892]}, {"w": "encoding", "b": [0.1294, 0.19, 0.2219, 0.2097]}, {"w": "is", "b": [0.2282, 0.19, 0.245, 0.2097]}, {"w": "a", "b": [0.2513, 0.19, 0.2625, 0.2097]}, {"w": "widely", "b": [0.2688, 0.19, 0.3375, 0.2097]}, {"w": "used", "b": [0.3438, 0.19, 0.39, 0.2097]}, {"w": "format", "b": [0.3964, 0.19, 0.4636, 0.2097]}, {"w": "for", "b": [0.4699, 0.19, 0.4993, 0.2097]}, {"w": "categorical", "b": [0.5056, 0.19, 0.6163, 0.2097]}, {"w": "data,", "b": [0.6226, 0.19, 0.6709, 0.2097]}, {"w": "also", "b": [0.6772, 0.19, 0.7179, 0.2097]}, {"w": "called", "b": [0.7242, 0.19, 0.7844, 0.2097]}, {"w": "categorical", "b": [0.1294, 0.2105, 0.2443, 0.2302]}, {"w": "encoding.", "b": [0.2506, 0.2105, 0.3494, 0.2302]}, {"w": "For", "b": [0.3557, 0.2105, 0.3907, 0.2302]}, {"w": "a", "b": [0.397, 0.2105, 0.4082, 0.2302]}, {"w": "more", "b": [0.4145, 0.2105, 0.4664, 0.2302]}, {"w": "detailed", "b": [0.4727, 0.2105, 0.5525, 0.2302]}, {"w": "explanation", "b": [0.5588, 0.2105, 0.6765, 0.2302]}, {"w": "of", "b": [0.6829, 0.2105, 0.7039, 0.2302]}, {"w": "one-hot", "b": [0.7102, 0.2105, 0.7872, 0.2302]}, {"w": "encoding,", "b": [0.1294, 0.231, 0.2282, 0.2507]}, {"w": "see", "b": [0.2345, 0.231, 0.2667, 0.2507]}, {"w": "section", "b": [0.273, 0.231, 0.3445, 0.2507]}, {"w": "6.1.", "b": [0.3508, 0.231, 0.3886, 0.2507]}, {"w": "In", "b": [0.3949, 0.231, 0.4159, 0.2507]}, {"w": "this", "b": [0.4222, 0.231, 0.4587, 0.2507]}, {"w": "case,", "b": [0.465, 0.231, 0.5147, 0.2507]}, {"w": "one-hot", "b": [0.521, 0.231, 0.5981, 0.2507]}, {"w": "encoding", "b": [0.6044, 0.231, 0.6968, 0.2507]}, {"w": "of", "b": [0.7032, 0.231, 0.7242, 0.2507]}, {"w": "the", "b": [0.7305, 0.231, 0.7613, 0.2507]}, {"w": "labels", "b": [0.7676, 0.231, 0.8265, 0.2507]}, {"w": "consists", "b": [0.1294, 0.2515, 0.2093, 0.2712]}, {"w": "of", "b": [0.2156, 0.2515, 0.2366, 0.2712]}, {"w": "embedding", "b": [0.2429, 0.2515, 0.355, 0.2712]}, {"w": "each", "b": [0.3613, 0.2515, 0.4076, 0.2712]}, {"w": "label", "b": [0.4139, 0.2515, 0.4629, 0.2712]}, {"w": "as", "b": [0.4692, 0.2515, 0.4902, 0.2712]}, {"w": "an", "b": [0.4965, 0.2515, 0.5203, 0.2712]}, {"w": "all-zero", "b": [0.5266, 0.2515, 0.6037, 0.2712]}, {"w": "vector", "b": [0.61, 0.2515, 0.673, 0.2712]}, {"w": "with", "b": [0.6793, 0.2515, 0.7242, 0.2712]}, {"w": "a", "b": [0.7305, 0.2515, 0.7417, 0.2712]}, {"w": "1", "b": [0.748, 0.2515, 0.7606, 0.2712]}, {"w": "in", "b": [0.7669, 0.2515, 0.7865, 0.2712]}, {"w": "the", "b": [0.7928, 0.2515, 0.8237, 0.2712]}, {"w": "place", "b": [0.1294, 0.272, 0.1826, 0.2917]}, {"w": "of", "b": [0.1889, 0.272, 0.2099, 0.2917]}, {"w": "the", "b": [0.2162, 0.272, 0.2471, 0.2917]}, {"w": "label", "b": [0.2534, 0.272, 0.3024, 0.2917]}, {"w": "index.", "b": [0.3087, 0.272, 0.3711, 0.2917]}, {"w": "Here’s", "b": [0.3774, 0.272, 0.4432, 0.2917]}, {"w": "an", "b": [0.4495, 0.272, 0.4733, 0.2917]}, {"w": "example:", "b": [0.4796, 0.272, 0.5721, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "def to_one_hot(labels, dimension=46): results = np.zeros((len(labels), dimension)) for i, label in enumerate(labels): results[i, label] = 1. return results one_hot_train_labels = to_one_hot(train_labels) 1 one_hot_test_labels = to_one_hot(test_labels) 2", "words": [{"w": "def", "b": [0.1357, 0.3097, 0.1698, 0.3248]}, {"w": "to_one_hot(labels,", "b": [0.1811, 0.3097, 0.3855, 0.3248]}, {"w": "dimension=46):", "b": [0.3968, 0.3097, 0.5557, 0.3248]}, {"w": "results", "b": [0.1811, 0.3248, 0.2606, 0.34]}, {"w": "=", "b": [0.2719, 0.3248, 0.2833, 0.34]}, {"w": "np.zeros((len(labels),", "b": [0.2946, 0.3248, 0.5444, 0.34]}, {"w": "dimension))", "b": [0.5557, 0.3248, 0.6806, 0.34]}, {"w": "for", "b": [0.1811, 0.34, 0.2152, 0.3551]}, {"w": "i,", "b": [0.2265, 0.34, 0.2492, 0.3551]}, {"w": "label", "b": [0.2606, 0.34, 0.3173, 0.3551]}, {"w": "in", "b": [0.3287, 0.34, 0.3514, 0.3551]}, {"w": "enumerate(labels):", "b": [0.3628, 0.34, 0.5671, 0.3551]}, {"w": "results[i,", "b": [0.2265, 0.3551, 0.34, 0.3703]}, {"w": "label]", "b": [0.3514, 0.3551, 0.4195, 0.3703]}, {"w": "=", "b": [0.4309, 0.3551, 0.4422, 0.3703]}, {"w": "1.", "b": [0.4536, 0.3551, 0.4763, 0.3703]}, {"w": "return", "b": [0.1811, 0.3703, 0.2492, 0.3854]}, {"w": "results", "b": [0.2606, 0.3703, 0.34, 0.3854]}, {"w": "one_hot_train_labels", "b": [0.1357, 0.4006, 0.3628, 0.4158]}, {"w": "=", "b": [0.3741, 0.4006, 0.3855, 0.4158]}, {"w": "to_one_hot(train_labels)", "b": [0.3968, 0.4006, 0.6692, 0.4158]}, {"w": "1", "b": [0.7602, 0.4006, 0.7715, 0.4158]}, {"w": "one_hot_test_labels", "b": [0.1357, 0.4158, 0.3514, 0.4309]}, {"w": "=", "b": [0.3628, 0.4158, 0.3741, 0.4309]}, {"w": "to_one_hot(test_labels)", "b": [0.3855, 0.4158, 0.6465, 0.4309]}, {"w": "2", "b": [0.7602, 0.4158, 0.7715, 0.4309]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Vectorized training labels 2 Vectorized test labels", "words": [{"w": "1", "b": [0.1799, 0.4493, 0.1925, 0.4691]}, {"w": "Vectorized", "b": [0.1988, 0.4493, 0.3127, 0.4691]}, {"w": "training", "b": [0.319, 0.4493, 0.4059, 0.4691]}, {"w": "labels", "b": [0.4123, 0.4493, 0.4739, 0.4691]}, {"w": "2", "b": [0.1799, 0.4698, 0.1925, 0.4896]}, {"w": "Vectorized", "b": [0.1988, 0.4698, 0.3127, 0.4896]}, {"w": "test", "b": [0.319, 0.4698, 0.3569, 0.4896]}, {"w": "labels", "b": [0.3632, 0.4698, 0.4248, 0.4896]}]}, {"id": "b_4", "type": "paragraph", "text": "Note that there is a built-in way to do this in Keras, which you’ve already seen in action in the MNIST example:", "words": [{"w": "Note", "b": [0.1294, 0.5126, 0.1785, 0.5324]}, {"w": "that", "b": [0.1848, 0.5126, 0.2226, 0.5324]}, {"w": "there", "b": [0.2289, 0.5126, 0.2793, 0.5324]}, {"w": "is", "b": [0.2856, 0.5126, 0.3025, 0.5324]}, {"w": "a", "b": [0.3088, 0.5126, 0.32, 0.5324]}, {"w": "built-in", "b": [0.3263, 0.5126, 0.4006, 0.5324]}, {"w": "way", "b": [0.4069, 0.5126, 0.4489, 0.5324]}, {"w": "to", "b": [0.4552, 0.5126, 0.4748, 0.5324]}, {"w": "do", "b": [0.4811, 0.5126, 0.5064, 0.5324]}, {"w": "this", "b": [0.5127, 0.5126, 0.5491, 0.5324]}, {"w": "in", "b": [0.5554, 0.5126, 0.5751, 0.5324]}, {"w": "Keras,", "b": [0.5814, 0.5126, 0.6465, 0.5324]}, {"w": "which", "b": [0.6528, 0.5126, 0.7144, 0.5324]}, {"w": "you’ve", "b": [0.7208, 0.5126, 0.7908, 0.5324]}, {"w": "already", "b": [0.1294, 0.5331, 0.2037, 0.5529]}, {"w": "seen", "b": [0.21, 0.5331, 0.2548, 0.5529]}, {"w": "in", "b": [0.2611, 0.5331, 0.2807, 0.5529]}, {"w": "action", "b": [0.287, 0.5331, 0.3487, 0.5529]}, {"w": "in", "b": [0.355, 0.5331, 0.3746, 0.5529]}, {"w": "the", "b": [0.3809, 0.5331, 0.4117, 0.5529]}, {"w": "MNIST", "b": [0.418, 0.5331, 0.4965, 0.5529]}, {"w": "example:", "b": [0.5028, 0.5331, 0.5953, 0.5529]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras.utils.np_utils import to_categorical one_hot_train_labels = to_categorical(train_labels) one_hot_test_labels = to_categorical(test_labels)", "words": [{"w": "from", "b": [0.1357, 0.5708, 0.1811, 0.586]}, {"w": "keras.utils.np_utils", "b": [0.1925, 0.5708, 0.4195, 0.586]}, {"w": "import", "b": [0.4309, 0.5708, 0.499, 0.586]}, {"w": "to_categorical", "b": [0.5103, 0.5708, 0.6692, 0.586]}, {"w": "one_hot_train_labels", "b": [0.1357, 0.6012, 0.3628, 0.6163]}, {"w": "=", "b": [0.3741, 0.6012, 0.3855, 0.6163]}, {"w": "to_categorical(train_labels)", "b": [0.3968, 0.6012, 0.7146, 0.6163]}, {"w": "one_hot_test_labels", "b": [0.1357, 0.6163, 0.3514, 0.6315]}, {"w": "=", "b": [0.3628, 0.6163, 0.3741, 0.6315]}, {"w": "to_categorical(test_labels)", "b": [0.3855, 0.6163, 0.6919, 0.6315]}]}, {"id": "b_6", "type": "paragraph", "text": "3.5.3. Building your network", "words": [{"w": "3.5.3.", "b": [0.1294, 0.6588, 0.1862, 0.6785]}, {"w": "Building", "b": [0.1925, 0.6588, 0.285, 0.6785]}, {"w": "your", "b": [0.2913, 0.6588, 0.3418, 0.6785]}, {"w": "network", "b": [0.3481, 0.6588, 0.4378, 0.6785]}]}, {"id": "b_7", "type": "paragraph", "text": "This topic-classification problem looks similar to the previous movie- review classification problem: in both cases, you’re trying to classify short snippets of text. But there is a new constraint here: the number of output classes has gone from 2 to 46. The dimensionality of the output space is much larger.", "words": [{"w": "This", "b": [0.1294, 0.7016, 0.1743, 0.7213]}, {"w": "topic-classification", "b": [0.1806, 0.7016, 0.3725, 0.7213]}, {"w": "problem", "b": [0.3788, 0.7016, 0.4629, 0.7213]}, {"w": "looks", "b": [0.4692, 0.7016, 0.5239, 0.7213]}, {"w": "similar", "b": [0.5302, 0.7016, 0.6003, 0.7213]}, {"w": "to", "b": [0.6066, 0.7016, 0.6262, 0.7213]}, {"w": "the", "b": [0.6325, 0.7016, 0.6633, 0.7213]}, {"w": "previous", "b": [0.6696, 0.7016, 0.7565, 0.7213]}, {"w": "movie-", "b": [0.7628, 0.7016, 0.8343, 0.7213]}, {"w": "review", "b": [0.1294, 0.7221, 0.1981, 0.7418]}, {"w": "classification", "b": [0.2044, 0.7221, 0.3375, 0.7418]}, {"w": "problem:", "b": [0.3438, 0.7221, 0.4349, 0.7418]}, {"w": "in", "b": [0.4412, 0.7221, 0.4608, 0.7418]}, {"w": "both", "b": [0.4671, 0.7221, 0.512, 0.7418]}, {"w": "cases,", "b": [0.5183, 0.7221, 0.5778, 0.7418]}, {"w": "you’re", "b": [0.5841, 0.7221, 0.6499, 0.7418]}, {"w": "trying", "b": [0.6562, 0.7221, 0.7164, 0.7418]}, {"w": "to", "b": [0.7227, 0.7221, 0.7424, 0.7418]}, {"w": "classify", "b": [0.7487, 0.7221, 0.8257, 0.7418]}, {"w": "short", "b": [0.1294, 0.7426, 0.1799, 0.7623]}, {"w": "snippets", "b": [0.1862, 0.7426, 0.2689, 0.7623]}, {"w": "of", "b": [0.2752, 0.7426, 0.2962, 0.7623]}, {"w": "text.", "b": [0.3025, 0.7426, 0.3466, 0.7623]}, {"w": "But", "b": [0.3529, 0.7426, 0.3894, 0.7623]}, {"w": "there", "b": [0.3957, 0.7426, 0.4461, 0.7623]}, {"w": "is", "b": [0.4524, 0.7426, 0.4693, 0.7623]}, {"w": "a", "b": [0.4756, 0.7426, 0.4868, 0.7623]}, {"w": "new", "b": [0.4931, 0.7426, 0.5351, 0.7623]}, {"w": "constraint", "b": [0.5414, 0.7426, 0.6409, 0.7623]}, {"w": "here:", "b": [0.6472, 0.7426, 0.6976, 0.7623]}, {"w": "the", "b": [0.7039, 0.7426, 0.7348, 0.7623]}, {"w": "number", "b": [0.7411, 0.7426, 0.8181, 0.7623]}, {"w": "of", "b": [0.8244, 0.7426, 0.8454, 0.7623]}, {"w": "output", "b": [0.1294, 0.7631, 0.1939, 0.7828]}, {"w": "classes", "b": [0.2002, 0.7631, 0.2702, 0.7828]}, {"w": "has", "b": [0.2766, 0.7631, 0.3102, 0.7828]}, {"w": "gone", "b": [0.3165, 0.7631, 0.3655, 0.7828]}, {"w": "from", "b": [0.3718, 0.7631, 0.4209, 0.7828]}, {"w": "2", "b": [0.4272, 0.7631, 0.4398, 0.7828]}, {"w": "to", "b": [0.4461, 0.7631, 0.4657, 0.7828]}, {"w": "46.", "b": [0.472, 0.7631, 0.5035, 0.7828]}, {"w": "The", "b": [0.5098, 0.7631, 0.5491, 0.7828]}, {"w": "dimensionality", "b": [0.5554, 0.7631, 0.7053, 0.7828]}, {"w": "of", "b": [0.7117, 0.7631, 0.7327, 0.7828]}, {"w": "the", "b": [0.739, 0.7631, 0.7698, 0.7828]}, {"w": "output", "b": [0.7761, 0.7631, 0.8406, 0.7828]}, {"w": "space", "b": [0.1294, 0.7836, 0.1854, 0.8033]}, {"w": "is", "b": [0.1917, 0.7836, 0.2086, 0.8033]}, {"w": "much", "b": [0.2149, 0.7836, 0.2709, 0.8033]}, {"w": "larger.", "b": [0.2772, 0.7836, 0.3405, 0.8033]}]}, {"id": "b_8", "type": "paragraph", "text": "In a stack of Dense layers like that you’ve been using, each layer can only access information present in the output of the previous layer. If one layer drops some information relevant to the classification problem, this information can never be recovered by later layers: each layer can", "words": [{"w": "In", "b": [0.1294, 0.8264, 0.1504, 0.8461]}, {"w": "a", "b": [0.1567, 0.8264, 0.1679, 0.8461]}, {"w": "stack", "b": [0.1742, 0.8264, 0.2261, 0.8461]}, {"w": "of", "b": [0.2324, 0.8264, 0.2534, 0.8461]}, {"w": "Dense", "b": [0.2597, 0.8274, 0.3354, 0.8476]}, {"w": "layers", "b": [0.3417, 0.8264, 0.4019, 0.8461]}, {"w": "like", "b": [0.4082, 0.8264, 0.446, 0.8461]}, {"w": "that", "b": [0.4524, 0.8264, 0.4902, 0.8461]}, {"w": "you’ve", "b": [0.4965, 0.8264, 0.5666, 0.8461]}, {"w": "been", "b": [0.5729, 0.8264, 0.6205, 0.8461]}, {"w": "using,", "b": [0.6268, 0.8264, 0.6878, 0.8461]}, {"w": "each", "b": [0.6941, 0.8264, 0.7403, 0.8461]}, {"w": "layer", "b": [0.7466, 0.8264, 0.797, 0.8461]}, {"w": "can", "b": [0.8033, 0.8264, 0.8383, 0.8461]}, {"w": "only", "b": [0.1294, 0.8477, 0.1743, 0.8675]}, {"w": "access", "b": [0.1806, 0.8477, 0.245, 0.8675]}, {"w": "information", "b": [0.2513, 0.8477, 0.3704, 0.8675]}, {"w": "present", "b": [0.3767, 0.8477, 0.4496, 0.8675]}, {"w": "in", "b": [0.4559, 0.8477, 0.4755, 0.8675]}, {"w": "the", "b": [0.4818, 0.8477, 0.5126, 0.8675]}, {"w": "output", "b": [0.5189, 0.8477, 0.5834, 0.8675]}, {"w": "of", "b": [0.5897, 0.8477, 0.6107, 0.8675]}, {"w": "the", "b": [0.6171, 0.8477, 0.6479, 0.8675]}, {"w": "previous", "b": [0.6542, 0.8477, 0.7411, 0.8675]}, {"w": "layer.", "b": [0.7474, 0.8477, 0.8026, 0.8675]}, {"w": "If", "b": [0.8089, 0.8477, 0.8257, 0.8675]}, {"w": "one", "b": [0.832, 0.8477, 0.8685, 0.8675]}, {"w": "layer", "b": [0.1294, 0.8682, 0.1798, 0.888]}, {"w": "drops", "b": [0.1861, 0.8682, 0.2422, 0.888]}, {"w": "some", "b": [0.2485, 0.8682, 0.3018, 0.888]}, {"w": "information", "b": [0.3081, 0.8682, 0.4272, 0.888]}, {"w": "relevant", "b": [0.4335, 0.8682, 0.5147, 0.888]}, {"w": "to", "b": [0.521, 0.8682, 0.5407, 0.888]}, {"w": "the", "b": [0.547, 0.8682, 0.5778, 0.888]}, {"w": "classification", "b": [0.5841, 0.8682, 0.7172, 0.888]}, {"w": "problem,", "b": [0.7235, 0.8682, 0.8139, 0.888]}, {"w": "this", "b": [0.8202, 0.8682, 0.8567, 0.888]}, {"w": "information", "b": [0.1294, 0.8888, 0.2485, 0.9085]}, {"w": "can", "b": [0.2548, 0.8888, 0.2898, 0.9085]}, {"w": "never", "b": [0.2962, 0.8888, 0.3522, 0.9085]}, {"w": "be", "b": [0.3585, 0.8888, 0.3823, 0.9085]}, {"w": "recovered", "b": [0.3886, 0.8888, 0.488, 0.9085]}, {"w": "by", "b": [0.4944, 0.8888, 0.5196, 0.9085]}, {"w": "later", "b": [0.5259, 0.8888, 0.5707, 0.9085]}, {"w": "layers:", "b": [0.5769, 0.8888, 0.6442, 0.9085]}, {"w": "each", "b": [0.6505, 0.8888, 0.6967, 0.9085]}, {"w": "layer", "b": [0.703, 0.8888, 0.7534, 0.9085]}, {"w": "can", "b": [0.7597, 0.8888, 0.7948, 0.9085]}]}]}, {"page": 123, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "potentially become an information bottleneck. In the previous example, you used 16-dimensional intermediate layers, but a 16-dimensional space may be too limited to learn to separate 46 different classes: such small layers may act as information bottlenecks, permanently dropping relevant information.", "words": [{"w": "potentially", "b": [0.1294, 0.0857, 0.2373, 0.1054]}, {"w": "become", "b": [0.2436, 0.0857, 0.3221, 0.1054]}, {"w": "an", "b": [0.3284, 0.0857, 0.3522, 0.1054]}, {"w": "information", "b": [0.3585, 0.0857, 0.4776, 0.1054]}, {"w": "bottleneck.", "b": [0.4839, 0.0857, 0.5953, 0.1054]}, {"w": "In", "b": [0.6016, 0.0857, 0.6227, 0.1054]}, {"w": "the", "b": [0.629, 0.0857, 0.6598, 0.1054]}, {"w": "previous", "b": [0.6661, 0.0857, 0.753, 0.1054]}, {"w": "example,", "b": [0.7593, 0.0857, 0.851, 0.1054]}, {"w": "you", "b": [0.1294, 0.1062, 0.1673, 0.1259]}, {"w": "used", "b": [0.1736, 0.1062, 0.2198, 0.1259]}, {"w": "16-dimensional", "b": [0.2261, 0.1062, 0.3831, 0.1259]}, {"w": "intermediate", "b": [0.3894, 0.1062, 0.5155, 0.1259]}, {"w": "layers,", "b": [0.5217, 0.1062, 0.5883, 0.1259]}, {"w": "but", "b": [0.5946, 0.1062, 0.6268, 0.1259]}, {"w": "a", "b": [0.6331, 0.1062, 0.6443, 0.1259]}, {"w": "16-dimensional", "b": [0.6506, 0.1062, 0.8076, 0.1259]}, {"w": "space", "b": [0.8139, 0.1062, 0.8699, 0.1259]}, {"w": "may", "b": [0.1294, 0.1267, 0.1729, 0.1464]}, {"w": "be", "b": [0.1792, 0.1267, 0.203, 0.1464]}, {"w": "too", "b": [0.2093, 0.1267, 0.2415, 0.1464]}, {"w": "limited", "b": [0.2478, 0.1267, 0.3193, 0.1464]}, {"w": "to", "b": [0.3256, 0.1267, 0.3452, 0.1464]}, {"w": "learn", "b": [0.3516, 0.1267, 0.402, 0.1464]}, {"w": "to", "b": [0.4083, 0.1267, 0.4279, 0.1464]}, {"w": "separate", "b": [0.4342, 0.1267, 0.5169, 0.1464]}, {"w": "46", "b": [0.5232, 0.1267, 0.5484, 0.1464]}, {"w": "different", "b": [0.5547, 0.1267, 0.641, 0.1464]}, {"w": "classes:", "b": [0.6473, 0.1267, 0.7244, 0.1464]}, {"w": "such", "b": [0.7307, 0.1267, 0.7769, 0.1464]}, {"w": "small", "b": [0.7832, 0.1267, 0.8379, 0.1464]}, {"w": "layers", "b": [0.1294, 0.1472, 0.1897, 0.1669]}, {"w": "may", "b": [0.196, 0.1472, 0.2394, 0.1669]}, {"w": "act", "b": [0.2457, 0.1472, 0.2751, 0.1669]}, {"w": "as", "b": [0.2814, 0.1472, 0.3024, 0.1669]}, {"w": "information", "b": [0.3087, 0.1472, 0.4278, 0.1669]}, {"w": "bottlenecks,", "b": [0.4341, 0.1472, 0.5553, 0.1669]}, {"w": "permanently", "b": [0.5616, 0.1472, 0.6877, 0.1669]}, {"w": "dropping", "b": [0.694, 0.1472, 0.7851, 0.1669]}, {"w": "relevant", "b": [0.1294, 0.1677, 0.2107, 0.1874]}, {"w": "information.", "b": [0.217, 0.1677, 0.3424, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "For this reason you’ll use larger layers. Let’s go with 64 units.", "words": [{"w": "For", "b": [0.1294, 0.2105, 0.1645, 0.2302]}, {"w": "this", "b": [0.1708, 0.2105, 0.2072, 0.2302]}, {"w": "reason", "b": [0.2135, 0.2105, 0.2794, 0.2302]}, {"w": "you’ll", "b": [0.2857, 0.2105, 0.3459, 0.2302]}, {"w": "use", "b": [0.3522, 0.2105, 0.3859, 0.2302]}, {"w": "larger", "b": [0.3922, 0.2105, 0.4505, 0.2302]}, {"w": "layers.", "b": [0.4568, 0.2105, 0.5234, 0.2302]}, {"w": "Let’s", "b": [0.5297, 0.2105, 0.5801, 0.2302]}, {"w": "go", "b": [0.5864, 0.2105, 0.6116, 0.2302]}, {"w": "with", "b": [0.6179, 0.2105, 0.6628, 0.2302]}, {"w": "64", "b": [0.6691, 0.2105, 0.6943, 0.2302]}, {"w": "units.", "b": [0.7006, 0.2105, 0.756, 0.2302]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.15. Model definition", "words": [{"w": "Listing", "b": [0.1294, 0.2483, 0.1862, 0.2631]}, {"w": "3.15.", "b": [0.1909, 0.2483, 0.2288, 0.2631]}, {"w": "Model", "b": [0.2335, 0.2483, 0.285, 0.2631]}, {"w": "definition", "b": [0.2897, 0.2483, 0.3675, 0.2631]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras import models from keras import layers model = models.Sequential() model.add(layers.Dense(64, activation='relu', input_shape= (10000,))) model.add(layers.Dense(64, activation='relu')) model.add(layers.Dense(46, activation='softmax'))", "words": [{"w": "from", "b": [0.1357, 0.2767, 0.1811, 0.2919]}, {"w": "keras", "b": [0.1925, 0.2767, 0.2492, 0.2919]}, {"w": "import", "b": [0.2606, 0.2767, 0.3287, 0.2919]}, {"w": "models", "b": [0.34, 0.2767, 0.4082, 0.2919]}, {"w": "from", "b": [0.1357, 0.2919, 0.1811, 0.307]}, {"w": "keras", "b": [0.1925, 0.2919, 0.2492, 0.307]}, {"w": "import", "b": [0.2606, 0.2919, 0.3287, 0.307]}, {"w": "layers", "b": [0.34, 0.2919, 0.4082, 0.307]}, {"w": "model", "b": [0.1357, 0.3222, 0.1925, 0.3373]}, {"w": "=", "b": [0.2038, 0.3222, 0.2152, 0.3373]}, {"w": "models.Sequential()", "b": [0.2265, 0.3222, 0.4422, 0.3373]}, {"w": "model.add(layers.Dense(64,", "b": [0.1357, 0.3373, 0.4309, 0.3525]}, {"w": "activation='relu',", "b": [0.4422, 0.3373, 0.6465, 0.3525]}, {"w": "input_shape=", "b": [0.6579, 0.3373, 0.7941, 0.3525]}, {"w": "(10000,)))", "b": [0.1357, 0.3525, 0.2492, 0.3676]}, {"w": "model.add(layers.Dense(64,", "b": [0.1357, 0.3676, 0.4309, 0.3828]}, {"w": "activation='relu'))", "b": [0.4422, 0.3676, 0.6579, 0.3828]}, {"w": "model.add(layers.Dense(46,", "b": [0.1357, 0.3828, 0.4309, 0.3979]}, {"w": "activation='softmax'))", "b": [0.4422, 0.3828, 0.6919, 0.3979]}]}, {"id": "b_4", "type": "paragraph", "text": "There are two other things you should note about this architecture:", "words": [{"w": "There", "b": [0.1294, 0.4208, 0.1882, 0.4406]}, {"w": "are", "b": [0.1945, 0.4208, 0.2253, 0.4406]}, {"w": "two", "b": [0.2317, 0.4208, 0.2695, 0.4406]}, {"w": "other", "b": [0.2758, 0.4208, 0.3276, 0.4406]}, {"w": "things", "b": [0.3339, 0.4208, 0.3956, 0.4406]}, {"w": "you", "b": [0.4019, 0.4208, 0.4398, 0.4406]}, {"w": "should", "b": [0.4461, 0.4208, 0.5133, 0.4406]}, {"w": "note", "b": [0.5197, 0.4208, 0.5631, 0.4406]}, {"w": "about", "b": [0.5694, 0.4208, 0.6255, 0.4406]}, {"w": "this", "b": [0.6318, 0.4208, 0.6682, 0.4406]}, {"w": "architecture:", "b": [0.6745, 0.4208, 0.8006, 0.4406]}]}, {"id": "b_5", "type": "paragraph", "text": "You end the network with a Dense layer of size 46. This means for each input sample, the network will output a 46-dimensional vector. Each entry in this vector (each dimension) will encode a different output class. The last layer uses a softmax activation. You saw this pattern in the MNIST example. It means the network will output a probability distribution over the 46 different output classes—for every input sample, the network will produce a 46-dimensional output vector, where output[i] is the probability that the sample belongs to class i. The 46 scores will sum to 1.", "words": [{"w": "You", "b": [0.1799, 0.4591, 0.2208, 0.4789]}, {"w": "end", "b": [0.2271, 0.4591, 0.2635, 0.4789]}, {"w": "the", "b": [0.2698, 0.4591, 0.3006, 0.4789]}, {"w": "network", "b": [0.307, 0.4591, 0.3896, 0.4789]}, {"w": "with", "b": [0.3959, 0.4591, 0.4408, 0.4789]}, {"w": "a", "b": [0.4471, 0.4591, 0.4583, 0.4789]}, {"w": "Dense", "b": [0.4646, 0.4602, 0.5402, 0.4804]}, {"w": "layer", "b": [0.5465, 0.4591, 0.597, 0.4789]}, {"w": "of", "b": [0.6033, 0.4591, 0.6243, 0.4789]}, {"w": "size", "b": [0.6306, 0.4591, 0.6698, 0.4789]}, {"w": "46.", "b": [0.6761, 0.4591, 0.7077, 0.4789]}, {"w": "This", "b": [0.714, 0.4591, 0.7588, 0.4789]}, {"w": "means", "b": [0.7651, 0.4591, 0.8296, 0.4789]}, {"w": "for", "b": [0.8359, 0.4591, 0.8653, 0.4789]}, {"w": "each", "b": [0.1799, 0.4805, 0.2261, 0.5003]}, {"w": "input", "b": [0.2324, 0.4805, 0.2842, 0.5003]}, {"w": "sample,", "b": [0.2906, 0.4805, 0.3683, 0.5003]}, {"w": "the", "b": [0.3746, 0.4805, 0.4055, 0.5003]}, {"w": "network", "b": [0.4118, 0.4805, 0.4944, 0.5003]}, {"w": "will", "b": [0.5007, 0.4805, 0.54, 0.5003]}, {"w": "output", "b": [0.5463, 0.4805, 0.6108, 0.5003]}, {"w": "a", "b": [0.6171, 0.4805, 0.6283, 0.5003]}, {"w": "46-dimensional", "b": [0.6346, 0.4805, 0.7915, 0.5003]}, {"w": "vector.", "b": [0.7978, 0.4805, 0.8657, 0.5003]}, {"w": "Each", "b": [0.1799, 0.501, 0.2303, 0.5208]}, {"w": "entry", "b": [0.2366, 0.501, 0.2884, 0.5208]}, {"w": "in", "b": [0.2947, 0.501, 0.3144, 0.5208]}, {"w": "this", "b": [0.3207, 0.501, 0.3571, 0.5208]}, {"w": "vector", "b": [0.3634, 0.501, 0.4265, 0.5208]}, {"w": "(each", "b": [0.4327, 0.501, 0.4873, 0.5208]}, {"w": "dimension)", "b": [0.4937, 0.501, 0.6072, 0.5208]}, {"w": "will", "b": [0.6135, 0.501, 0.6527, 0.5208]}, {"w": "encode", "b": [0.659, 0.501, 0.7305, 0.5208]}, {"w": "a", "b": [0.7368, 0.501, 0.748, 0.5208]}, {"w": "different", "b": [0.7543, 0.501, 0.8406, 0.5208]}, {"w": "output", "b": [0.1799, 0.5215, 0.2443, 0.5413]}, {"w": "class.", "b": [0.2506, 0.5215, 0.306, 0.5413]}, {"w": "The", "b": [0.1799, 0.542, 0.2191, 0.5618]}, {"w": "last", "b": [0.2254, 0.542, 0.2604, 0.5618]}, {"w": "layer", "b": [0.2667, 0.542, 0.3172, 0.5618]}, {"w": "uses", "b": [0.3235, 0.542, 0.3669, 0.5618]}, {"w": "a", "b": [0.3732, 0.542, 0.3844, 0.5618]}, {"w": "softmax", "b": [0.3907, 0.5431, 0.4966, 0.5633]}, {"w": "activation.", "b": [0.503, 0.542, 0.6087, 0.5618]}, {"w": "You", "b": [0.6151, 0.542, 0.6559, 0.5618]}, {"w": "saw", "b": [0.6622, 0.542, 0.7015, 0.5618]}, {"w": "this", "b": [0.7078, 0.542, 0.7442, 0.5618]}, {"w": "pattern", "b": [0.7505, 0.542, 0.8206, 0.5618]}, {"w": "in", "b": [0.8269, 0.542, 0.8465, 0.5618]}, {"w": "the", "b": [0.1799, 0.5634, 0.2107, 0.5832]}, {"w": "MNIST", "b": [0.217, 0.5634, 0.2955, 0.5832]}, {"w": "example.", "b": [0.3018, 0.5634, 0.3936, 0.5832]}, {"w": "It", "b": [0.3999, 0.5634, 0.4153, 0.5832]}, {"w": "means", "b": [0.4216, 0.5634, 0.486, 0.5832]}, {"w": "the", "b": [0.4923, 0.5634, 0.5232, 0.5832]}, {"w": "network", "b": [0.5295, 0.5634, 0.6121, 0.5832]}, {"w": "will", "b": [0.6184, 0.5634, 0.6577, 0.5832]}, {"w": "output", "b": [0.664, 0.5634, 0.7285, 0.5832]}, {"w": "a", "b": [0.7348, 0.5634, 0.746, 0.5832]}, {"w": "probability", "b": [0.7522, 0.5634, 0.8634, 0.5832]}, {"w": "distribution", "b": [0.1799, 0.5839, 0.2976, 0.6037]}, {"w": "over", "b": [0.3039, 0.5839, 0.3487, 0.6037]}, {"w": "the", "b": [0.355, 0.5839, 0.3859, 0.6037]}, {"w": "46", "b": [0.3922, 0.5839, 0.4174, 0.6037]}, {"w": "different", "b": [0.4237, 0.5839, 0.5101, 0.6037]}, {"w": "output", "b": [0.5164, 0.5839, 0.5809, 0.6037]}, {"w": "classes—for", "b": [0.5872, 0.5839, 0.7119, 0.6037]}, {"w": "every", "b": [0.7182, 0.5839, 0.7742, 0.6037]}, {"w": "input", "b": [0.7805, 0.5839, 0.8324, 0.6037]}, {"w": "sample,", "b": [0.1799, 0.6044, 0.2576, 0.6242]}, {"w": "the", "b": [0.2639, 0.6044, 0.2948, 0.6242]}, {"w": "network", "b": [0.3011, 0.6044, 0.3837, 0.6242]}, {"w": "will", "b": [0.39, 0.6044, 0.4293, 0.6242]}, {"w": "produce", "b": [0.4356, 0.6044, 0.5169, 0.6242]}, {"w": "a", "b": [0.5232, 0.6044, 0.5344, 0.6242]}, {"w": "46-dimensional", "b": [0.5407, 0.6044, 0.6976, 0.6242]}, {"w": "output", "b": [0.7039, 0.6044, 0.7684, 0.6242]}, {"w": "vector,", "b": [0.7747, 0.6044, 0.843, 0.6242]}, {"w": "where", "b": [0.1799, 0.6249, 0.2415, 0.6447]}, {"w": "output[i]", "b": [0.2478, 0.626, 0.384, 0.6462]}, {"w": "is", "b": [0.3903, 0.6249, 0.4071, 0.6447]}, {"w": "the", "b": [0.4135, 0.6249, 0.4443, 0.6447]}, {"w": "probability", "b": [0.4506, 0.6249, 0.5613, 0.6447]}, {"w": "that", "b": [0.5676, 0.6249, 0.6054, 0.6447]}, {"w": "the", "b": [0.6118, 0.6249, 0.6426, 0.6447]}, {"w": "sample", "b": [0.6489, 0.6249, 0.7203, 0.6447]}, {"w": "belongs", "b": [0.7267, 0.6249, 0.8051, 0.6447]}, {"w": "to", "b": [0.8114, 0.6249, 0.8311, 0.6447]}, {"w": "class", "b": [0.1799, 0.6463, 0.2289, 0.6661]}, {"w": "i.", "b": [0.2352, 0.6463, 0.2566, 0.6676]}, {"w": "The", "b": [0.263, 0.6463, 0.3022, 0.6661]}, {"w": "46", "b": [0.3085, 0.6463, 0.3337, 0.6661]}, {"w": "scores", "b": [0.34, 0.6463, 0.4031, 0.6661]}, {"w": "will", "b": [0.4094, 0.6463, 0.4486, 0.6661]}, {"w": "sum", "b": [0.4549, 0.6463, 0.497, 0.6661]}, {"w": "to", "b": [0.5033, 0.6463, 0.5229, 0.6661]}, {"w": "1.", "b": [0.5292, 0.6463, 0.5481, 0.6661]}]}, {"id": "b_6", "type": "paragraph", "text": "The best loss function to use in this case is categorical_crossentropy. It measures the distance between two probability distributions: here, between the probability distribution output by the network and the true distribution of the labels. By minimizing the distance between these two distributions, you train the network to output something as close as possible to the true labels.", "words": [{"w": "The", "b": [0.1294, 0.69, 0.1686, 0.7097]}, {"w": "best", "b": [0.1749, 0.69, 0.2156, 0.7097]}, {"w": "loss", "b": [0.2219, 0.69, 0.2611, 0.7097]}, {"w": "function", "b": [0.2674, 0.69, 0.3515, 0.7097]}, {"w": "to", "b": [0.3578, 0.69, 0.3775, 0.7097]}, {"w": "use", "b": [0.3838, 0.69, 0.4174, 0.7097]}, {"w": "in", "b": [0.4237, 0.69, 0.4433, 0.7097]}, {"w": "this", "b": [0.4496, 0.69, 0.4861, 0.7097]}, {"w": "case", "b": [0.4924, 0.69, 0.5358, 0.7097]}, {"w": "is", "b": [0.5421, 0.69, 0.5589, 0.7097]}, {"w": "categorical_crossentropy.", "b": [0.1294, 0.7105, 0.499, 0.7317]}, {"w": "It", "b": [0.5053, 0.7105, 0.5207, 0.7302]}, {"w": "measures", "b": [0.5271, 0.7105, 0.6209, 0.7302]}, {"w": "the", "b": [0.6272, 0.7105, 0.6581, 0.7302]}, {"w": "distance", "b": [0.6644, 0.7105, 0.747, 0.7302]}, {"w": "between", "b": [0.7533, 0.7105, 0.8374, 0.7302]}, {"w": "two", "b": [0.1294, 0.7319, 0.1673, 0.7516]}, {"w": "probability", "b": [0.1736, 0.7319, 0.2843, 0.7516]}, {"w": "distributions:", "b": [0.2906, 0.7319, 0.4237, 0.7516]}, {"w": "here,", "b": [0.4301, 0.7319, 0.4798, 0.7516]}, {"w": "between", "b": [0.4861, 0.7319, 0.5701, 0.7516]}, {"w": "the", "b": [0.5764, 0.7319, 0.6073, 0.7516]}, {"w": "probability", "b": [0.6136, 0.7319, 0.7243, 0.7516]}, {"w": "distribution", "b": [0.7306, 0.7319, 0.8469, 0.7516]}, {"w": "output", "b": [0.1294, 0.7524, 0.1939, 0.7721]}, {"w": "by", "b": [0.2002, 0.7524, 0.2254, 0.7721]}, {"w": "the", "b": [0.2317, 0.7524, 0.2626, 0.7721]}, {"w": "network", "b": [0.2688, 0.7524, 0.3515, 0.7721]}, {"w": "and", "b": [0.3578, 0.7524, 0.3942, 0.7721]}, {"w": "the", "b": [0.4005, 0.7524, 0.4314, 0.7721]}, {"w": "true", "b": [0.4377, 0.7524, 0.4769, 0.7721]}, {"w": "distribution", "b": [0.4832, 0.7524, 0.5996, 0.7721]}, {"w": "of", "b": [0.6059, 0.7524, 0.6269, 0.7721]}, {"w": "the", "b": [0.6332, 0.7524, 0.664, 0.7721]}, {"w": "labels.", "b": [0.6703, 0.7524, 0.7355, 0.7721]}, {"w": "By", "b": [0.7418, 0.7524, 0.7712, 0.7721]}, {"w": "minimizing", "b": [0.1294, 0.7729, 0.2458, 0.7926]}, {"w": "the", "b": [0.2521, 0.7729, 0.2829, 0.7926]}, {"w": "distance", "b": [0.2892, 0.7729, 0.3719, 0.7926]}, {"w": "between", "b": [0.3782, 0.7729, 0.4622, 0.7926]}, {"w": "these", "b": [0.4685, 0.7729, 0.5204, 0.7926]}, {"w": "two", "b": [0.5267, 0.7729, 0.5645, 0.7926]}, {"w": "distributions,", "b": [0.5708, 0.7729, 0.7033, 0.7926]}, {"w": "you", "b": [0.7096, 0.7729, 0.7474, 0.7926]}, {"w": "train", "b": [0.7537, 0.7729, 0.8, 0.7926]}, {"w": "the", "b": [0.8063, 0.7729, 0.8371, 0.7926]}, {"w": "network", "b": [0.1294, 0.7934, 0.2121, 0.8131]}, {"w": "to", "b": [0.2184, 0.7934, 0.238, 0.8131]}, {"w": "output", "b": [0.2443, 0.7934, 0.3088, 0.8131]}, {"w": "something", "b": [0.3151, 0.7934, 0.4202, 0.8131]}, {"w": "as", "b": [0.4265, 0.7934, 0.4475, 0.8131]}, {"w": "close", "b": [0.4538, 0.7934, 0.5057, 0.8131]}, {"w": "as", "b": [0.512, 0.7934, 0.533, 0.8131]}, {"w": "possible", "b": [0.5393, 0.7934, 0.622, 0.8131]}, {"w": "to", "b": [0.6283, 0.7934, 0.6479, 0.8131]}, {"w": "the", "b": [0.6542, 0.7934, 0.6851, 0.8131]}, {"w": "true", "b": [0.6914, 0.7934, 0.7306, 0.8131]}, {"w": "labels.", "b": [0.7369, 0.7934, 0.8021, 0.8131]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 3.16. Compiling the model", "words": [{"w": "Listing", "b": [0.1294, 0.8312, 0.1862, 0.846]}, {"w": "3.16.", "b": [0.1909, 0.8312, 0.2288, 0.846]}, {"w": "Compiling", "b": [0.2335, 0.8312, 0.3186, 0.846]}, {"w": "the", "b": [0.3234, 0.8312, 0.3486, 0.846]}, {"w": "model", "b": [0.3533, 0.8312, 0.4027, 0.846]}]}, {"id": "b_8", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.8596, 0.5217, 0.8748]}, {"w": "loss='categorical_crossentropy',", "b": [0.2946, 0.8748, 0.6579, 0.8899]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.8899, 0.533, 0.9051]}]}]}, {"page": 124, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3.5.4. Validating your approach", "words": [{"w": "3.5.4.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Validating", "b": [0.1925, 0.0857, 0.3037, 0.1054]}, {"w": "your", "b": [0.31, 0.0857, 0.3605, 0.1054]}, {"w": "approach", "b": [0.3668, 0.0857, 0.4686, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s set apart 1,000 samples in the training data to use as a validation set.", "words": [{"w": "Let’s", "b": [0.1294, 0.1285, 0.1798, 0.1482]}, {"w": "set", "b": [0.1862, 0.1285, 0.2142, 0.1482]}, {"w": "apart", "b": [0.2205, 0.1285, 0.2709, 0.1482]}, {"w": "1,000", "b": [0.2772, 0.1285, 0.334, 0.1482]}, {"w": "samples", "b": [0.3403, 0.1285, 0.4216, 0.1482]}, {"w": "in", "b": [0.4279, 0.1285, 0.4475, 0.1482]}, {"w": "the", "b": [0.4538, 0.1285, 0.4846, 0.1482]}, {"w": "training", "b": [0.4909, 0.1285, 0.5694, 0.1482]}, {"w": "data", "b": [0.5757, 0.1285, 0.6177, 0.1482]}, {"w": "to", "b": [0.624, 0.1285, 0.6437, 0.1482]}, {"w": "use", "b": [0.65, 0.1285, 0.6836, 0.1482]}, {"w": "as", "b": [0.6899, 0.1285, 0.7109, 0.1482]}, {"w": "a", "b": [0.7172, 0.1285, 0.7284, 0.1482]}, {"w": "validation", "b": [0.7347, 0.1285, 0.8356, 0.1482]}, {"w": "set.", "b": [0.1294, 0.149, 0.1637, 0.1687]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.17. Setting aside a validation set", "words": [{"w": "Listing", "b": [0.1294, 0.1868, 0.1862, 0.2016]}, {"w": "3.17.", "b": [0.1909, 0.1868, 0.2288, 0.2016]}, {"w": "Setting", "b": [0.2335, 0.1868, 0.2902, 0.2016]}, {"w": "aside", "b": [0.295, 0.1868, 0.336, 0.2016]}, {"w": "a", "b": [0.3407, 0.1868, 0.3501, 0.2016]}, {"w": "validation", "b": [0.3549, 0.1868, 0.4358, 0.2016]}, {"w": "set", "b": [0.4406, 0.1868, 0.4626, 0.2016]}]}, {"id": "b_3", "type": "paragraph", "text": "x_val = x_train[:1000] partial_x_train = x_train[1000:] y_val = one_hot_train_labels[:1000] partial_y_train = one_hot_train_labels[1000:]", "words": [{"w": "x_val", "b": [0.1357, 0.2152, 0.1925, 0.2304]}, {"w": "=", "b": [0.2038, 0.2152, 0.2152, 0.2304]}, {"w": "x_train[:1000]", "b": [0.2265, 0.2152, 0.3855, 0.2304]}, {"w": "partial_x_train", "b": [0.1357, 0.2304, 0.306, 0.2455]}, {"w": "=", "b": [0.3173, 0.2304, 0.3287, 0.2455]}, {"w": "x_train[1000:]", "b": [0.34, 0.2304, 0.499, 0.2455]}, {"w": "y_val", "b": [0.1357, 0.2607, 0.1925, 0.2758]}, {"w": "=", "b": [0.2038, 0.2607, 0.2152, 0.2758]}, {"w": "one_hot_train_labels[:1000]", "b": [0.2265, 0.2607, 0.533, 0.2758]}, {"w": "partial_y_train", "b": [0.1357, 0.2758, 0.306, 0.291]}, {"w": "=", "b": [0.3173, 0.2758, 0.3287, 0.291]}, {"w": "one_hot_train_labels[1000:]", "b": [0.34, 0.2758, 0.6465, 0.291]}]}, {"id": "b_4", "type": "paragraph", "text": "Now, let’s train the network for 20 epochs.", "words": [{"w": "Now,", "b": [0.1294, 0.3139, 0.1831, 0.3336]}, {"w": "let’s", "b": [0.1894, 0.3139, 0.2315, 0.3336]}, {"w": "train", "b": [0.2378, 0.3139, 0.284, 0.3336]}, {"w": "the", "b": [0.2903, 0.3139, 0.3211, 0.3336]}, {"w": "network", "b": [0.3275, 0.3139, 0.4101, 0.3336]}, {"w": "for", "b": [0.4164, 0.3139, 0.4458, 0.3336]}, {"w": "20", "b": [0.4521, 0.3139, 0.4774, 0.3336]}, {"w": "epochs.", "b": [0.4837, 0.3139, 0.56, 0.3336]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 3.18. Training the model", "words": [{"w": "Listing", "b": [0.1294, 0.3517, 0.1862, 0.3665]}, {"w": "3.18.", "b": [0.1909, 0.3517, 0.2288, 0.3665]}, {"w": "Training", "b": [0.2335, 0.3517, 0.3036, 0.3665]}, {"w": "the", "b": [0.3083, 0.3517, 0.3335, 0.3665]}, {"w": "model", "b": [0.3382, 0.3517, 0.3876, 0.3665]}]}, {"id": "b_6", "type": "paragraph", "text": "history = model.fit(partial_x_train, partial_y_train, epochs=20, batch_size=512, validation_data=(x_val, y_val))", "words": [{"w": "history", "b": [0.1357, 0.3801, 0.2152, 0.3953]}, {"w": "=", "b": [0.2265, 0.3801, 0.2379, 0.3953]}, {"w": "model.fit(partial_x_train,", "b": [0.2492, 0.3801, 0.5444, 0.3953]}, {"w": "partial_y_train,", "b": [0.3628, 0.3953, 0.5444, 0.4104]}, {"w": "epochs=20,", "b": [0.3628, 0.4104, 0.4763, 0.4256]}, {"w": "batch_size=512,", "b": [0.3628, 0.4256, 0.533, 0.4407]}, {"w": "validation_data=(x_val,", "b": [0.3628, 0.4407, 0.6238, 0.4559]}, {"w": "y_val))", "b": [0.6352, 0.4407, 0.7146, 0.4559]}]}, {"id": "b_7", "type": "paragraph", "text": "And finally, let’s display its loss and accuracy curves (see figures 3.9 and 3.10).", "words": [{"w": "And", "b": [0.1294, 0.4787, 0.1729, 0.4985]}, {"w": "finally,", "b": [0.1792, 0.4787, 0.2497, 0.4985]}, {"w": "let’s", "b": [0.256, 0.4787, 0.298, 0.4985]}, {"w": "display", "b": [0.3043, 0.4787, 0.3772, 0.4985]}, {"w": "its", "b": [0.3835, 0.4787, 0.4073, 0.4985]}, {"w": "loss", "b": [0.4137, 0.4787, 0.4529, 0.4985]}, {"w": "and", "b": [0.4592, 0.4787, 0.4956, 0.4985]}, {"w": "accuracy", "b": [0.5019, 0.4787, 0.5916, 0.4985]}, {"w": "curves", "b": [0.5979, 0.4787, 0.6637, 0.4985]}, {"w": "(see", "b": [0.67, 0.4787, 0.7106, 0.4985]}, {"w": "figures", "b": [0.7169, 0.4787, 0.7869, 0.4985]}, {"w": "3.9", "b": [0.7933, 0.4787, 0.8248, 0.4985]}, {"w": "and", "b": [0.8311, 0.4787, 0.8675, 0.4985]}, {"w": "3.10).", "b": [0.1294, 0.4992, 0.1883, 0.519]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 3.9. Training and validation loss", "words": [{"w": "Figure", "b": [0.1294, 0.5371, 0.1827, 0.5519]}, {"w": "3.9.", "b": [0.1874, 0.5371, 0.2158, 0.5519]}, {"w": "Training", "b": [0.2205, 0.5371, 0.2906, 0.5519]}, {"w": "and", "b": [0.2953, 0.5371, 0.3258, 0.5519]}, {"w": "validation", "b": [0.3305, 0.5371, 0.4115, 0.5519]}, {"w": "loss", "b": [0.4162, 0.5371, 0.4457, 0.5519]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure 3.10. Training and validation accuracy", "words": [{"w": "Figure", "b": [0.1294, 0.8312, 0.1827, 0.846]}, {"w": "3.10.", "b": [0.1874, 0.8312, 0.2252, 0.846]}, {"w": "Training", "b": [0.2299, 0.8312, 0.3, 0.846]}, {"w": "and", "b": [0.3048, 0.8312, 0.3353, 0.846]}, {"w": "validation", "b": [0.34, 0.8312, 0.4209, 0.846]}, {"w": "accuracy", "b": [0.4257, 0.8312, 0.4982, 0.846]}]}]}, {"page": 125, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 3.19. Plotting the training and validation loss", "words": [{"w": "Listing", "b": [0.1294, 0.3526, 0.1862, 0.3674]}, {"w": "3.19.", "b": [0.1909, 0.3526, 0.2288, 0.3674]}, {"w": "Plotting", "b": [0.2335, 0.3526, 0.2976, 0.3674]}, {"w": "the", "b": [0.3023, 0.3526, 0.3275, 0.3674]}, {"w": "training", "b": [0.3323, 0.3526, 0.3974, 0.3674]}, {"w": "and", "b": [0.4022, 0.3526, 0.4327, 0.3674]}, {"w": "validation", "b": [0.4374, 0.3526, 0.5184, 0.3674]}, {"w": "loss", "b": [0.5231, 0.3526, 0.5525, 0.3674]}]}, {"id": "b_1", "type": "paragraph", "text": "import matplotlib.pyplot as plt loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(1, len(loss) + 1) plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.xlabel('Epochs') plt.ylabel('Loss') plt.legend() plt.show()", "words": [{"w": "import", "b": [0.1357, 0.381, 0.2038, 0.3961]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.381, 0.4082, 0.3961]}, {"w": "as", "b": [0.4195, 0.381, 0.4422, 0.3961]}, {"w": "plt", "b": [0.4536, 0.381, 0.4876, 0.3961]}, {"w": "loss", "b": [0.1357, 0.4113, 0.1811, 0.4265]}, {"w": "=", "b": [0.1925, 0.4113, 0.2038, 0.4265]}, {"w": "history.history['loss']", "b": [0.2152, 0.4113, 0.4763, 0.4265]}, {"w": "val_loss", "b": [0.1357, 0.4265, 0.2265, 0.4416]}, {"w": "=", "b": [0.2379, 0.4265, 0.2492, 0.4416]}, {"w": "history.history['val_loss']", "b": [0.2606, 0.4265, 0.5671, 0.4416]}, {"w": "epochs", "b": [0.1357, 0.4568, 0.2038, 0.4719]}, {"w": "=", "b": [0.2152, 0.4568, 0.2265, 0.4719]}, {"w": "range(1,", "b": [0.2379, 0.4568, 0.3287, 0.4719]}, {"w": "len(loss)", "b": [0.34, 0.4568, 0.4422, 0.4719]}, {"w": "+", "b": [0.4536, 0.4568, 0.4649, 0.4719]}, {"w": "1)", "b": [0.4763, 0.4568, 0.499, 0.4719]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.4871, 0.3173, 0.5022]}, {"w": "loss,", "b": [0.3287, 0.4871, 0.3855, 0.5022]}, {"w": "'bo',", "b": [0.3968, 0.4871, 0.4536, 0.5022]}, {"w": "label='Training", "b": [0.4649, 0.4871, 0.6352, 0.5022]}, {"w": "loss')", "b": [0.6465, 0.4871, 0.7146, 0.5022]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.5022, 0.3173, 0.5174]}, {"w": "val_loss,", "b": [0.3287, 0.5022, 0.4309, 0.5174]}, {"w": "'b',", "b": [0.4422, 0.5022, 0.4876, 0.5174]}, {"w": "label='Validation", "b": [0.499, 0.5022, 0.6919, 0.5174]}, {"w": "loss')", "b": [0.7033, 0.5022, 0.7714, 0.5174]}, {"w": "plt.title('Training", "b": [0.1357, 0.5174, 0.3514, 0.5325]}, {"w": "and", "b": [0.3628, 0.5174, 0.3968, 0.5325]}, {"w": "validation", "b": [0.4082, 0.5174, 0.5217, 0.5325]}, {"w": "loss')", "b": [0.533, 0.5174, 0.6011, 0.5325]}, {"w": "plt.xlabel('Epochs')", "b": [0.1357, 0.5325, 0.3628, 0.5477]}, {"w": "plt.ylabel('Loss')", "b": [0.1357, 0.5477, 0.34, 0.5628]}, {"w": "plt.legend()", "b": [0.1357, 0.5628, 0.2719, 0.578]}, {"w": "plt.show()", "b": [0.1357, 0.5931, 0.2492, 0.6083]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.20. Plotting the training and validation accuracy", "words": [{"w": "Listing", "b": [0.1294, 0.6218, 0.1862, 0.6366]}, {"w": "3.20.", "b": [0.1909, 0.6218, 0.2288, 0.6366]}, {"w": "Plotting", "b": [0.2335, 0.6218, 0.2976, 0.6366]}, {"w": "the", "b": [0.3023, 0.6218, 0.3275, 0.6366]}, {"w": "training", "b": [0.3323, 0.6218, 0.3974, 0.6366]}, {"w": "and", "b": [0.4022, 0.6218, 0.4327, 0.6366]}, {"w": "validation", "b": [0.4374, 0.6218, 0.5184, 0.6366]}, {"w": "accuracy", "b": [0.5231, 0.6218, 0.5956, 0.6366]}]}, {"id": "b_3", "type": "paragraph", "text": "plt.clf() 1 acc = history.history['acc'] val_acc = history.history['val_acc'] plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.xlabel('Epochs') plt.ylabel('Loss') plt.legend() plt.show()", "words": [{"w": "plt.clf()", "b": [0.1357, 0.6502, 0.2379, 0.6653]}, {"w": "1", "b": [0.7829, 0.6502, 0.7942, 0.6653]}, {"w": "acc", "b": [0.1357, 0.6805, 0.1698, 0.6956]}, {"w": "=", "b": [0.1811, 0.6805, 0.1925, 0.6956]}, {"w": "history.history['acc']", "b": [0.2038, 0.6805, 0.4536, 0.6956]}, {"w": "val_acc", "b": [0.1357, 0.6956, 0.2152, 0.7108]}, {"w": "=", "b": [0.2265, 0.6956, 0.2379, 0.7108]}, {"w": "history.history['val_acc']", "b": [0.2492, 0.6956, 0.5444, 0.7108]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.7259, 0.3173, 0.7411]}, {"w": "acc,", "b": [0.3287, 0.7259, 0.3741, 0.7411]}, {"w": "'bo',", "b": [0.3855, 0.7259, 0.4422, 0.7411]}, {"w": "label='Training", "b": [0.4536, 0.7259, 0.6238, 0.7411]}, {"w": "acc')", "b": [0.6352, 0.7259, 0.6919, 0.7411]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.7411, 0.3173, 0.7562]}, {"w": "val_acc,", "b": [0.3287, 0.7411, 0.4195, 0.7562]}, {"w": "'b',", "b": [0.4309, 0.7411, 0.4763, 0.7562]}, {"w": "label='Validation", "b": [0.4876, 0.7411, 0.6806, 0.7562]}, {"w": "acc')", "b": [0.6919, 0.7411, 0.7487, 0.7562]}, {"w": "plt.title('Training", "b": [0.1357, 0.7562, 0.3514, 0.7714]}, {"w": "and", "b": [0.3628, 0.7562, 0.3968, 0.7714]}, {"w": "validation", "b": [0.4082, 0.7562, 0.5217, 0.7714]}, {"w": "accuracy')", "b": [0.533, 0.7562, 0.6465, 0.7714]}, {"w": "plt.xlabel('Epochs')", "b": [0.1357, 0.7714, 0.3628, 0.7865]}, {"w": "plt.ylabel('Loss')", "b": [0.1357, 0.7866, 0.34, 0.8017]}, {"w": "plt.legend()", "b": [0.1357, 0.8017, 0.2719, 0.8168]}, {"w": "plt.show()", "b": [0.1357, 0.832, 0.2492, 0.8472]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Clears the figure", "words": [{"w": "1", "b": [0.1799, 0.8656, 0.1925, 0.8853]}, {"w": "Clears", "b": [0.1988, 0.8656, 0.2688, 0.8853]}, {"w": "the", "b": [0.2751, 0.8656, 0.3088, 0.8853]}, {"w": "figure", "b": [0.3151, 0.8656, 0.3791, 0.8853]}]}]}, {"page": 126, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The network begins to overfit after nine epochs. Let’s train a new network from scratch for nine epochs and then evaluate it on the test set.", "words": [{"w": "The", "b": [0.1294, 0.0857, 0.1686, 0.1054]}, {"w": "network", "b": [0.1749, 0.0857, 0.2576, 0.1054]}, {"w": "begins", "b": [0.2639, 0.0857, 0.3298, 0.1054]}, {"w": "to", "b": [0.3361, 0.0857, 0.3557, 0.1054]}, {"w": "overfit", "b": [0.362, 0.0857, 0.4293, 0.1054]}, {"w": "after", "b": [0.4356, 0.0857, 0.4818, 0.1054]}, {"w": "nine", "b": [0.4881, 0.0857, 0.5315, 0.1054]}, {"w": "epochs.", "b": [0.5378, 0.0857, 0.6142, 0.1054]}, {"w": "Let’s", "b": [0.6205, 0.0857, 0.6709, 0.1054]}, {"w": "train", "b": [0.6772, 0.0857, 0.7234, 0.1054]}, {"w": "a", "b": [0.7297, 0.0857, 0.7409, 0.1054]}, {"w": "new", "b": [0.7472, 0.0857, 0.7893, 0.1054]}, {"w": "network", "b": [0.1294, 0.1062, 0.2121, 0.1259]}, {"w": "from", "b": [0.2184, 0.1062, 0.2674, 0.1259]}, {"w": "scratch", "b": [0.2737, 0.1062, 0.3452, 0.1259]}, {"w": "for", "b": [0.3515, 0.1062, 0.3809, 0.1259]}, {"w": "nine", "b": [0.3872, 0.1062, 0.4306, 0.1259]}, {"w": "epochs", "b": [0.4369, 0.1062, 0.507, 0.1259]}, {"w": "and", "b": [0.5133, 0.1062, 0.5497, 0.1259]}, {"w": "then", "b": [0.556, 0.1062, 0.5995, 0.1259]}, {"w": "evaluate", "b": [0.6058, 0.1062, 0.6898, 0.1259]}, {"w": "it", "b": [0.6961, 0.1062, 0.7101, 0.1259]}, {"w": "on", "b": [0.7164, 0.1062, 0.7416, 0.1259]}, {"w": "the", "b": [0.7479, 0.1062, 0.7788, 0.1259]}, {"w": "test", "b": [0.7851, 0.1062, 0.8201, 0.1259]}, {"w": "set.", "b": [0.8264, 0.1062, 0.8607, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.21. Retraining a model from scratch", "words": [{"w": "Listing", "b": [0.1294, 0.144, 0.1862, 0.1588]}, {"w": "3.21.", "b": [0.1909, 0.144, 0.2288, 0.1588]}, {"w": "Retraining", "b": [0.2335, 0.144, 0.3207, 0.1588]}, {"w": "a", "b": [0.3254, 0.144, 0.3349, 0.1588]}, {"w": "model", "b": [0.3396, 0.144, 0.389, 0.1588]}, {"w": "from", "b": [0.3938, 0.144, 0.4333, 0.1588]}, {"w": "scratch", "b": [0.4381, 0.144, 0.4969, 0.1588]}]}, {"id": "b_2", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(64, activation='relu', input_shape= (10000,))) model.add(layers.Dense(64, activation='relu')) model.add(layers.Dense(46, activation='softmax')) model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy']) model.fit(partial_x_train, partial_y_train, epochs=9, batch_size=512, validation_data=(x_val, y_val)) results = model.evaluate(x_test, one_hot_test_labels)", "words": [{"w": "model", "b": [0.1357, 0.1724, 0.1925, 0.1876]}, {"w": "=", "b": [0.2038, 0.1724, 0.2152, 0.1876]}, {"w": "models.Sequential()", "b": [0.2265, 0.1724, 0.4422, 0.1876]}, {"w": "model.add(layers.Dense(64,", "b": [0.1357, 0.1876, 0.4309, 0.2027]}, {"w": "activation='relu',", "b": [0.4422, 0.1876, 0.6465, 0.2027]}, {"w": "input_shape=", "b": [0.6579, 0.1876, 0.7941, 0.2027]}, {"w": "(10000,)))", "b": [0.1357, 0.2027, 0.2492, 0.2179]}, {"w": "model.add(layers.Dense(64,", "b": [0.1357, 0.2179, 0.4309, 0.233]}, {"w": "activation='relu'))", "b": [0.4422, 0.2179, 0.6579, 0.233]}, {"w": "model.add(layers.Dense(46,", "b": [0.1357, 0.233, 0.4309, 0.2482]}, {"w": "activation='softmax'))", "b": [0.4422, 0.233, 0.6919, 0.2482]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.2633, 0.5217, 0.2785]}, {"w": "loss='categorical_crossentropy',", "b": [0.2946, 0.2785, 0.6579, 0.2936]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.2937, 0.533, 0.3088]}, {"w": "model.fit(partial_x_train,", "b": [0.1357, 0.3088, 0.4309, 0.3239]}, {"w": "partial_y_train,", "b": [0.2492, 0.324, 0.4309, 0.3391]}, {"w": "epochs=9,", "b": [0.2492, 0.3391, 0.3514, 0.3543]}, {"w": "batch_size=512,", "b": [0.2492, 0.3543, 0.4195, 0.3694]}, {"w": "validation_data=(x_val,", "b": [0.2492, 0.3694, 0.5103, 0.3846]}, {"w": "y_val))", "b": [0.5217, 0.3694, 0.6011, 0.3846]}, {"w": "results", "b": [0.1357, 0.3846, 0.2152, 0.3997]}, {"w": "=", "b": [0.2265, 0.3846, 0.2379, 0.3997]}, {"w": "model.evaluate(x_test,", "b": [0.2492, 0.3846, 0.499, 0.3997]}, {"w": "one_hot_test_labels)", "b": [0.5103, 0.3846, 0.7374, 0.3997]}]}, {"id": "b_3", "type": "paragraph", "text": "Here are the final results:", "words": [{"w": "Here", "b": [0.1294, 0.4226, 0.1784, 0.4423]}, {"w": "are", "b": [0.1847, 0.4226, 0.2155, 0.4423]}, {"w": "the", "b": [0.2218, 0.4226, 0.2527, 0.4423]}, {"w": "final", "b": [0.259, 0.4226, 0.3052, 0.4423]}, {"w": "results:", "b": [0.3115, 0.4226, 0.3844, 0.4423]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> results [0.9565213431445807, 0.79697239536954589]", "words": [{"w": ">>>", "b": [0.1357, 0.4603, 0.1698, 0.4755]}, {"w": "results", "b": [0.1811, 0.4603, 0.2606, 0.4755]}, {"w": "[0.9565213431445807,", "b": [0.1357, 0.4755, 0.3628, 0.4906]}, {"w": "0.79697239536954589]", "b": [0.3741, 0.4755, 0.6011, 0.4906]}]}, {"id": "b_5", "type": "paragraph", "text": "This approach reaches an accuracy of ~80%. With a balanced binary classification problem, the accuracy reached by a purely random classifier would be 50%. But in this case it’s closer to 19%, so the results seem pretty good, at least when compared to a random baseline:", "words": [{"w": "This", "b": [0.1294, 0.5135, 0.1743, 0.5332]}, {"w": "approach", "b": [0.1806, 0.5135, 0.273, 0.5332]}, {"w": "reaches", "b": [0.2793, 0.5135, 0.355, 0.5332]}, {"w": "an", "b": [0.3613, 0.5135, 0.3851, 0.5332]}, {"w": "accuracy", "b": [0.3914, 0.5135, 0.481, 0.5332]}, {"w": "of", "b": [0.4873, 0.5135, 0.5083, 0.5332]}, {"w": "~80%.", "b": [0.5146, 0.5135, 0.5808, 0.5332]}, {"w": "With", "b": [0.5871, 0.5135, 0.6365, 0.5332]}, {"w": "a", "b": [0.6428, 0.5135, 0.654, 0.5332]}, {"w": "balanced", "b": [0.6603, 0.5135, 0.75, 0.5332]}, {"w": "binary", "b": [0.7563, 0.5135, 0.8207, 0.5332]}, {"w": "classification", "b": [0.1294, 0.534, 0.2625, 0.5537]}, {"w": "problem,", "b": [0.2688, 0.534, 0.3592, 0.5537]}, {"w": "the", "b": [0.3655, 0.534, 0.3964, 0.5537]}, {"w": "accuracy", "b": [0.4027, 0.534, 0.4923, 0.5537]}, {"w": "reached", "b": [0.4986, 0.534, 0.577, 0.5537]}, {"w": "by", "b": [0.5833, 0.534, 0.6086, 0.5537]}, {"w": "a", "b": [0.6149, 0.534, 0.6261, 0.5537]}, {"w": "purely", "b": [0.6324, 0.534, 0.6968, 0.5537]}, {"w": "random", "b": [0.703, 0.534, 0.7801, 0.5537]}, {"w": "classifier", "b": [0.1294, 0.5545, 0.2205, 0.5742]}, {"w": "would", "b": [0.2268, 0.5545, 0.2898, 0.5742]}, {"w": "be", "b": [0.2962, 0.5545, 0.32, 0.5742]}, {"w": "50%.", "b": [0.3263, 0.5545, 0.3788, 0.5742]}, {"w": "But", "b": [0.3851, 0.5545, 0.4216, 0.5742]}, {"w": "in", "b": [0.4279, 0.5545, 0.4475, 0.5742]}, {"w": "this", "b": [0.4538, 0.5545, 0.4903, 0.5742]}, {"w": "case", "b": [0.4966, 0.5545, 0.54, 0.5742]}, {"w": "it’s", "b": [0.5463, 0.5545, 0.5771, 0.5742]}, {"w": "closer", "b": [0.5834, 0.5545, 0.6436, 0.5742]}, {"w": "to", "b": [0.6499, 0.5545, 0.6696, 0.5742]}, {"w": "19%,", "b": [0.6759, 0.5545, 0.7284, 0.5742]}, {"w": "so", "b": [0.7347, 0.5545, 0.7572, 0.5742]}, {"w": "the", "b": [0.7635, 0.5545, 0.7943, 0.5742]}, {"w": "results", "b": [0.8006, 0.5545, 0.8665, 0.5742]}, {"w": "seem", "b": [0.1294, 0.575, 0.1813, 0.5947]}, {"w": "pretty", "b": [0.1876, 0.575, 0.2464, 0.5947]}, {"w": "good,", "b": [0.2527, 0.575, 0.3095, 0.5947]}, {"w": "at", "b": [0.3158, 0.575, 0.334, 0.5947]}, {"w": "least", "b": [0.3403, 0.575, 0.3865, 0.5947]}, {"w": "when", "b": [0.3928, 0.575, 0.4475, 0.5947]}, {"w": "compared", "b": [0.4538, 0.575, 0.5533, 0.5947]}, {"w": "to", "b": [0.5595, 0.575, 0.5791, 0.5947]}, {"w": "a", "b": [0.5854, 0.575, 0.5966, 0.5947]}, {"w": "random", "b": [0.6029, 0.575, 0.68, 0.5947]}, {"w": "baseline:", "b": [0.6863, 0.575, 0.776, 0.5947]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> import copy >>> test_labels_copy = copy.copy(test_labels) >>> np.random.shuffle(test_labels_copy) >>> hits_array = np.array(test_labels) == np.array(test_labels_copy) >>> float(np.sum(hits_array)) / len(test_labels) 0.18655387355298308", "words": [{"w": ">>>", "b": [0.1357, 0.6127, 0.1698, 0.6279]}, {"w": "import", "b": [0.1811, 0.6127, 0.2492, 0.6279]}, {"w": "copy", "b": [0.2606, 0.6127, 0.306, 0.6279]}, {"w": ">>>", "b": [0.1357, 0.6279, 0.1698, 0.643]}, {"w": "test_labels_copy", "b": [0.1811, 0.6279, 0.3628, 0.643]}, {"w": "=", "b": [0.3741, 0.6279, 0.3855, 0.643]}, {"w": "copy.copy(test_labels)", "b": [0.3968, 0.6279, 0.6465, 0.643]}, {"w": ">>>", "b": [0.1357, 0.643, 0.1698, 0.6582]}, {"w": "np.random.shuffle(test_labels_copy)", "b": [0.1811, 0.643, 0.5784, 0.6582]}, {"w": ">>>", "b": [0.1357, 0.6582, 0.1698, 0.6733]}, {"w": "hits_array", "b": [0.1811, 0.6582, 0.2946, 0.6733]}, {"w": "=", "b": [0.306, 0.6582, 0.3173, 0.6733]}, {"w": "np.array(test_labels)", "b": [0.3287, 0.6582, 0.5671, 0.6733]}, {"w": "==", "b": [0.5784, 0.6582, 0.6011, 0.6733]}, {"w": "np.array(test_labels_copy)", "b": [0.1357, 0.6734, 0.4309, 0.6885]}, {"w": ">>>", "b": [0.1357, 0.6885, 0.1698, 0.7036]}, {"w": "float(np.sum(hits_array))", "b": [0.1811, 0.6885, 0.4649, 0.7036]}, {"w": "/", "b": [0.4763, 0.6885, 0.4876, 0.7036]}, {"w": "len(test_labels)", "b": [0.499, 0.6885, 0.6806, 0.7036]}, {"w": "0.18655387355298308", "b": [0.1357, 0.7037, 0.3514, 0.7188]}]}, {"id": "b_7", "type": "paragraph", "text": "3.5.5. Generating predictions on new data", "words": [{"w": "3.5.5.", "b": [0.1294, 0.7461, 0.1862, 0.7659]}, {"w": "Generating", "b": [0.1925, 0.7461, 0.3144, 0.7659]}, {"w": "predictions", "b": [0.3207, 0.7461, 0.4408, 0.7659]}, {"w": "on", "b": [0.4471, 0.7461, 0.4737, 0.7659]}, {"w": "new", "b": [0.48, 0.7461, 0.5234, 0.7659]}, {"w": "data", "b": [0.5298, 0.7461, 0.5774, 0.7659]}]}, {"id": "b_8", "type": "paragraph", "text": "You can verify that the predict method of the model instance returns a probability distribution over all 46 topics. Let’s generate topic predictions for all of the test data.", "words": [{"w": "You", "b": [0.1294, 0.7889, 0.1703, 0.8087]}, {"w": "can", "b": [0.1766, 0.7889, 0.2116, 0.8087]}, {"w": "verify", "b": [0.218, 0.7889, 0.2782, 0.8087]}, {"w": "that", "b": [0.2845, 0.7889, 0.3223, 0.8087]}, {"w": "the", "b": [0.3286, 0.7889, 0.3595, 0.8087]}, {"w": "predict", "b": [0.3657, 0.79, 0.4717, 0.8102]}, {"w": "method", "b": [0.478, 0.7889, 0.5537, 0.8087]}, {"w": "of", "b": [0.56, 0.7889, 0.581, 0.8087]}, {"w": "the", "b": [0.5873, 0.7889, 0.6181, 0.8087]}, {"w": "model", "b": [0.6244, 0.7889, 0.6875, 0.8087]}, {"w": "instance", "b": [0.6938, 0.7889, 0.7765, 0.8087]}, {"w": "returns", "b": [0.7828, 0.7889, 0.8528, 0.8087]}, {"w": "a", "b": [0.8591, 0.7889, 0.8703, 0.8087]}, {"w": "probability", "b": [0.1294, 0.8103, 0.2401, 0.8301]}, {"w": "distribution", "b": [0.2464, 0.8103, 0.3628, 0.8301]}, {"w": "over", "b": [0.3691, 0.8103, 0.4139, 0.8301]}, {"w": "all", "b": [0.4202, 0.8103, 0.4454, 0.8301]}, {"w": "46", "b": [0.4517, 0.8103, 0.477, 0.8301]}, {"w": "topics.", "b": [0.4833, 0.8103, 0.5498, 0.8301]}, {"w": "Let’s", "b": [0.5562, 0.8103, 0.6065, 0.8301]}, {"w": "generate", "b": [0.6128, 0.8103, 0.6983, 0.8301]}, {"w": "topic", "b": [0.7046, 0.8103, 0.755, 0.8301]}, {"w": "predictions", "b": [0.1294, 0.8308, 0.2415, 0.8506]}, {"w": "for", "b": [0.2478, 0.8308, 0.2772, 0.8506]}, {"w": "all", "b": [0.2835, 0.8308, 0.3088, 0.8506]}, {"w": "of", "b": [0.3151, 0.8308, 0.3361, 0.8506]}, {"w": "the", "b": [0.3424, 0.8308, 0.3732, 0.8506]}, {"w": "test", "b": [0.3795, 0.8308, 0.4145, 0.8506]}, {"w": "data.", "b": [0.4209, 0.8308, 0.4692, 0.8506]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 3.22. Generating predictions for new data", "words": [{"w": "Listing", "b": [0.1294, 0.8687, 0.1862, 0.8835]}, {"w": "3.22.", "b": [0.1909, 0.8687, 0.2288, 0.8835]}, {"w": "Generating", "b": [0.2335, 0.8687, 0.3249, 0.8835]}, {"w": "predictions", "b": [0.3296, 0.8687, 0.4197, 0.8835]}, {"w": "for", "b": [0.4244, 0.8687, 0.4486, 0.8835]}, {"w": "new", "b": [0.4533, 0.8687, 0.4859, 0.8835]}, {"w": "data", "b": [0.4906, 0.8687, 0.5263, 0.8835]}]}, {"id": "b_10", "type": "equation", "text": "predictions = model.predict(x_test)", "words": [{"w": "predictions", "b": [0.1357, 0.8971, 0.2606, 0.9122]}, {"w": "=", "b": [0.2719, 0.8971, 0.2833, 0.9122]}, {"w": "model.predict(x_test)", "b": [0.2946, 0.8971, 0.533, 0.9122]}]}]}, {"page": 127, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Each entry in predictions is a vector of length 46:", "words": [{"w": "Each", "b": [0.1294, 0.0857, 0.1798, 0.1054]}, {"w": "entry", "b": [0.1861, 0.0857, 0.238, 0.1054]}, {"w": "in", "b": [0.2443, 0.0857, 0.2639, 0.1054]}, {"w": "predictions", "b": [0.2702, 0.0867, 0.4367, 0.1069]}, {"w": "is", "b": [0.443, 0.0857, 0.4598, 0.1054]}, {"w": "a", "b": [0.4661, 0.0857, 0.4773, 0.1054]}, {"w": "vector", "b": [0.4836, 0.0857, 0.5467, 0.1054]}, {"w": "of", "b": [0.553, 0.0857, 0.574, 0.1054]}, {"w": "length", "b": [0.5803, 0.0857, 0.6434, 0.1054]}, {"w": "46:", "b": [0.6497, 0.0857, 0.6819, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": ">>> predictions[0].shape (46,)", "words": [{"w": ">>>", "b": [0.1357, 0.1243, 0.1698, 0.1394]}, {"w": "predictions[0].shape", "b": [0.1811, 0.1243, 0.4082, 0.1394]}, {"w": "(46,)", "b": [0.1357, 0.1395, 0.1925, 0.1546]}]}, {"id": "b_2", "type": "paragraph", "text": "The coefficients in this vector sum to 1:", "words": [{"w": "The", "b": [0.1294, 0.1775, 0.1686, 0.1972]}, {"w": "coefficients", "b": [0.1749, 0.1775, 0.2922, 0.1972]}, {"w": "in", "b": [0.2985, 0.1775, 0.3181, 0.1972]}, {"w": "this", "b": [0.3244, 0.1775, 0.3608, 0.1972]}, {"w": "vector", "b": [0.3671, 0.1775, 0.4302, 0.1972]}, {"w": "sum", "b": [0.4365, 0.1775, 0.4785, 0.1972]}, {"w": "to", "b": [0.4849, 0.1775, 0.5045, 0.1972]}, {"w": "1:", "b": [0.5108, 0.1775, 0.5304, 0.1972]}]}, {"id": "b_3", "type": "paragraph", "text": ">>> np.sum(predictions[0]) 1.0", "words": [{"w": ">>>", "b": [0.1357, 0.2152, 0.1698, 0.2304]}, {"w": "np.sum(predictions[0])", "b": [0.1811, 0.2152, 0.4309, 0.2304]}, {"w": "1.0", "b": [0.1357, 0.2304, 0.1698, 0.2455]}]}, {"id": "b_4", "type": "paragraph", "text": "The largest entry is the predicted class—the class with the highest probability:", "words": [{"w": "The", "b": [0.1294, 0.2684, 0.1686, 0.2881]}, {"w": "largest", "b": [0.1749, 0.2684, 0.2417, 0.2881]}, {"w": "entry", "b": [0.248, 0.2684, 0.2999, 0.2881]}, {"w": "is", "b": [0.3062, 0.2684, 0.323, 0.2881]}, {"w": "the", "b": [0.3293, 0.2684, 0.3601, 0.2881]}, {"w": "predicted", "b": [0.3664, 0.2684, 0.4603, 0.2881]}, {"w": "class—the", "b": [0.4666, 0.2684, 0.5717, 0.2881]}, {"w": "class", "b": [0.578, 0.2684, 0.627, 0.2881]}, {"w": "with", "b": [0.6334, 0.2684, 0.6782, 0.2881]}, {"w": "the", "b": [0.6845, 0.2684, 0.7153, 0.2881]}, {"w": "highest", "b": [0.7216, 0.2684, 0.7945, 0.2881]}, {"w": "probability:", "b": [0.1294, 0.2889, 0.2471, 0.3086]}]}, {"id": "b_5", "type": "paragraph", "text": ">>> np.argmax(predictions[0]) 4", "words": [{"w": ">>>", "b": [0.1357, 0.3266, 0.1698, 0.3418]}, {"w": "np.argmax(predictions[0])", "b": [0.1811, 0.3266, 0.4649, 0.3418]}, {"w": "4", "b": [0.1357, 0.3418, 0.1471, 0.3569]}]}, {"id": "b_6", "type": "paragraph", "text": "3.5.6. A different way to handle the labels and the loss", "words": [{"w": "3.5.6.", "b": [0.1294, 0.3843, 0.1862, 0.404]}, {"w": "A", "b": [0.1925, 0.3843, 0.2107, 0.404]}, {"w": "different", "b": [0.217, 0.3843, 0.3104, 0.404]}, {"w": "way", "b": [0.3167, 0.3843, 0.3601, 0.404]}, {"w": "to", "b": [0.3665, 0.3843, 0.3875, 0.404]}, {"w": "handle", "b": [0.3938, 0.3843, 0.4667, 0.404]}, {"w": "the", "b": [0.473, 0.3843, 0.5066, 0.404]}, {"w": "labels", "b": [0.5129, 0.3843, 0.5746, 0.404]}, {"w": "and", "b": [0.5809, 0.3843, 0.6216, 0.404]}, {"w": "the", "b": [0.6279, 0.3843, 0.6615, 0.404]}, {"w": "loss", "b": [0.6678, 0.3843, 0.7071, 0.404]}]}, {"id": "b_7", "type": "paragraph", "text": "We mentioned earlier that another way to encode the labels would be to cast them as an integer tensor, like this:", "words": [{"w": "We", "b": [0.1294, 0.4271, 0.1624, 0.4468]}, {"w": "mentioned", "b": [0.1687, 0.4271, 0.2752, 0.4468]}, {"w": "earlier", "b": [0.2815, 0.4271, 0.3459, 0.4468]}, {"w": "that", "b": [0.3523, 0.4271, 0.3901, 0.4468]}, {"w": "another", "b": [0.3964, 0.4271, 0.472, 0.4468]}, {"w": "way", "b": [0.4784, 0.4271, 0.5204, 0.4468]}, {"w": "to", "b": [0.5267, 0.4271, 0.5463, 0.4468]}, {"w": "encode", "b": [0.5526, 0.4271, 0.6241, 0.4468]}, {"w": "the", "b": [0.6304, 0.4271, 0.6612, 0.4468]}, {"w": "labels", "b": [0.6675, 0.4271, 0.7263, 0.4468]}, {"w": "would", "b": [0.7327, 0.4271, 0.7957, 0.4468]}, {"w": "be", "b": [0.802, 0.4271, 0.8258, 0.4468]}, {"w": "to", "b": [0.8321, 0.4271, 0.8518, 0.4468]}, {"w": "cast", "b": [0.1294, 0.4476, 0.1686, 0.4673]}, {"w": "them", "b": [0.1749, 0.4476, 0.2254, 0.4673]}, {"w": "as", "b": [0.2317, 0.4476, 0.2527, 0.4673]}, {"w": "an", "b": [0.259, 0.4476, 0.2828, 0.4673]}, {"w": "integer", "b": [0.2891, 0.4476, 0.3592, 0.4673]}, {"w": "tensor,", "b": [0.3655, 0.4476, 0.4324, 0.4673]}, {"w": "like", "b": [0.4387, 0.4476, 0.4765, 0.4673]}, {"w": "this:", "b": [0.4829, 0.4476, 0.5263, 0.4673]}]}, {"id": "b_8", "type": "equation", "text": "y_train = np.array(train_labels) y_test = np.array(test_labels)", "words": [{"w": "y_train", "b": [0.1357, 0.4853, 0.2152, 0.5004]}, {"w": "=", "b": [0.2265, 0.4853, 0.2379, 0.5004]}, {"w": "np.array(train_labels)", "b": [0.2492, 0.4853, 0.499, 0.5004]}, {"w": "y_test", "b": [0.1357, 0.5004, 0.2038, 0.5156]}, {"w": "=", "b": [0.2152, 0.5004, 0.2265, 0.5156]}, {"w": "np.array(test_labels)", "b": [0.2379, 0.5004, 0.4763, 0.5156]}]}, {"id": "b_9", "type": "paragraph", "text": "The only thing this approach would change is the choice of the loss function. The loss function used in listing 3.21, categorical_crossentropy, expects the labels to follow a categorical encoding. With integer labels, you should use sparse_categorical_crossentropy:", "words": [{"w": "The", "b": [0.1294, 0.5385, 0.1686, 0.5582]}, {"w": "only", "b": [0.1749, 0.5385, 0.2198, 0.5582]}, {"w": "thing", "b": [0.2261, 0.5385, 0.278, 0.5582]}, {"w": "this", "b": [0.2843, 0.5385, 0.3207, 0.5582]}, {"w": "approach", "b": [0.327, 0.5385, 0.4195, 0.5582]}, {"w": "would", "b": [0.4258, 0.5385, 0.4889, 0.5582]}, {"w": "change", "b": [0.4952, 0.5385, 0.5666, 0.5582]}, {"w": "is", "b": [0.5729, 0.5385, 0.5897, 0.5582]}, {"w": "the", "b": [0.596, 0.5385, 0.6269, 0.5582]}, {"w": "choice", "b": [0.6332, 0.5385, 0.699, 0.5582]}, {"w": "of", "b": [0.7053, 0.5385, 0.7263, 0.5582]}, {"w": "the", "b": [0.7326, 0.5385, 0.7635, 0.5582]}, {"w": "loss", "b": [0.7698, 0.5385, 0.809, 0.5582]}, {"w": "function.", "b": [0.1294, 0.559, 0.2198, 0.5787]}, {"w": "The", "b": [0.2261, 0.559, 0.2653, 0.5787]}, {"w": "loss", "b": [0.2716, 0.559, 0.3109, 0.5787]}, {"w": "function", "b": [0.3172, 0.559, 0.4013, 0.5787]}, {"w": "used", "b": [0.4076, 0.559, 0.4538, 0.5787]}, {"w": "in", "b": [0.4601, 0.559, 0.4797, 0.5787]}, {"w": "listing", "b": [0.486, 0.559, 0.5491, 0.5787]}, {"w": "3.21,", "b": [0.5554, 0.559, 0.6058, 0.5787]}, {"w": "categorical_crossentropy,", "b": [0.1294, 0.5795, 0.499, 0.6007]}, {"w": "expects", "b": [0.5053, 0.5795, 0.581, 0.5992]}, {"w": "the", "b": [0.5873, 0.5795, 0.6181, 0.5992]}, {"w": "labels", "b": [0.6244, 0.5795, 0.6833, 0.5992]}, {"w": "to", "b": [0.6896, 0.5795, 0.7092, 0.5992]}, {"w": "follow", "b": [0.7155, 0.5795, 0.7814, 0.5992]}, {"w": "a", "b": [0.7877, 0.5795, 0.7989, 0.5992]}, {"w": "categorical", "b": [0.1294, 0.6009, 0.2401, 0.6206]}, {"w": "encoding.", "b": [0.2464, 0.6009, 0.3452, 0.6206]}, {"w": "With", "b": [0.3515, 0.6009, 0.4009, 0.6206]}, {"w": "integer", "b": [0.4072, 0.6009, 0.4772, 0.6206]}, {"w": "labels,", "b": [0.4835, 0.6009, 0.5487, 0.6206]}, {"w": "you", "b": [0.555, 0.6009, 0.5928, 0.6206]}, {"w": "should", "b": [0.5991, 0.6009, 0.6664, 0.6206]}, {"w": "use", "b": [0.6727, 0.6009, 0.7064, 0.6206]}, {"w": "sparse_categorical_crossentropy:", "b": [0.1294, 0.6214, 0.6057, 0.6426]}]}, {"id": "b_10", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss='sparse_categorical_crossentropy', metrics=['acc'])", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.66, 0.5217, 0.6751]}, {"w": "loss='sparse_categorical_crossentropy',", "b": [0.2946, 0.6751, 0.7374, 0.6903]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.6903, 0.4763, 0.7054]}]}, {"id": "b_11", "type": "paragraph", "text": "This new loss function is still mathematically the same as categorical_crossentropy; it just has a different interface.", "words": [{"w": "This", "b": [0.1294, 0.7283, 0.1743, 0.7481]}, {"w": "new", "b": [0.1806, 0.7283, 0.2226, 0.7481]}, {"w": "loss", "b": [0.2289, 0.7283, 0.2682, 0.7481]}, {"w": "function", "b": [0.2745, 0.7283, 0.3585, 0.7481]}, {"w": "is", "b": [0.3648, 0.7283, 0.3817, 0.7481]}, {"w": "still", "b": [0.388, 0.7283, 0.4258, 0.7481]}, {"w": "mathematically", "b": [0.4321, 0.7283, 0.5877, 0.7481]}, {"w": "the", "b": [0.594, 0.7283, 0.6248, 0.7481]}, {"w": "same", "b": [0.6311, 0.7283, 0.683, 0.7481]}, {"w": "as", "b": [0.6893, 0.7283, 0.7103, 0.7481]}, {"w": "categorical_crossentropy;", "b": [0.1294, 0.7488, 0.4997, 0.7701]}, {"w": "it", "b": [0.506, 0.7488, 0.5201, 0.7686]}, {"w": "just", "b": [0.5264, 0.7488, 0.5628, 0.7686]}, {"w": "has", "b": [0.5691, 0.7488, 0.6028, 0.7686]}, {"w": "a", "b": [0.6091, 0.7488, 0.6203, 0.7686]}, {"w": "different", "b": [0.6266, 0.7488, 0.7129, 0.7686]}, {"w": "interface.", "b": [0.7192, 0.7488, 0.8138, 0.7686]}]}, {"id": "b_12", "type": "paragraph", "text": "3.5.7. The importance of having sufficiently large intermediate layers", "words": [{"w": "3.5.7.", "b": [0.1294, 0.7969, 0.1862, 0.8167]}, {"w": "The", "b": [0.1925, 0.7969, 0.2345, 0.8167]}, {"w": "importance", "b": [0.2408, 0.7969, 0.3641, 0.8167]}, {"w": "of", "b": [0.3704, 0.7969, 0.3915, 0.8167]}, {"w": "having", "b": [0.3978, 0.7969, 0.4707, 0.8167]}, {"w": "sufficiently", "b": [0.477, 0.7969, 0.5961, 0.8167]}, {"w": "large", "b": [0.6024, 0.7969, 0.657, 0.8167]}, {"w": "intermediate", "b": [0.6633, 0.7969, 0.8006, 0.8167]}, {"w": "layers", "b": [0.1294, 0.8174, 0.1939, 0.8372]}]}, {"id": "b_13", "type": "paragraph", "text": "We mentioned earlier that because the final outputs are 46-dimensional, you should avoid intermediate layers with many fewer than 46 hidden", "words": [{"w": "We", "b": [0.1294, 0.8602, 0.1624, 0.88]}, {"w": "mentioned", "b": [0.1687, 0.8602, 0.2752, 0.88]}, {"w": "earlier", "b": [0.2815, 0.8602, 0.3459, 0.88]}, {"w": "that", "b": [0.3523, 0.8602, 0.3901, 0.88]}, {"w": "because", "b": [0.3964, 0.8602, 0.4762, 0.88]}, {"w": "the", "b": [0.4825, 0.8602, 0.5134, 0.88]}, {"w": "final", "b": [0.5197, 0.8602, 0.5659, 0.88]}, {"w": "outputs", "b": [0.5722, 0.8602, 0.6465, 0.88]}, {"w": "are", "b": [0.6528, 0.8602, 0.6836, 0.88]}, {"w": "46-dimensional,", "b": [0.6899, 0.8602, 0.8532, 0.88]}, {"w": "you", "b": [0.1294, 0.8807, 0.1673, 0.9005]}, {"w": "should", "b": [0.1736, 0.8807, 0.2408, 0.9005]}, {"w": "avoid", "b": [0.2471, 0.8807, 0.3032, 0.9005]}, {"w": "intermediate", "b": [0.3095, 0.8807, 0.4356, 0.9005]}, {"w": "layers", "b": [0.4419, 0.8807, 0.5021, 0.9005]}, {"w": "with", "b": [0.5085, 0.8807, 0.5533, 0.9005]}, {"w": "many", "b": [0.5596, 0.8807, 0.6157, 0.9005]}, {"w": "fewer", "b": [0.622, 0.8807, 0.6794, 0.9005]}, {"w": "than", "b": [0.6856, 0.8807, 0.7291, 0.9005]}, {"w": "46", "b": [0.7354, 0.8807, 0.7606, 0.9005]}, {"w": "hidden", "b": [0.7669, 0.8807, 0.8356, 0.9005]}]}]}, {"page": 128, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "units. Now let’s see what happens when you introduce an information bottleneck by having intermediate layers that are significantly less than 46-dimensional: for example, 4-dimensional.", "words": [{"w": "units.", "b": [0.1294, 0.0857, 0.1848, 0.1054]}, {"w": "Now", "b": [0.1911, 0.0857, 0.2401, 0.1054]}, {"w": "let’s", "b": [0.2464, 0.0857, 0.2885, 0.1054]}, {"w": "see", "b": [0.2948, 0.0857, 0.327, 0.1054]}, {"w": "what", "b": [0.3333, 0.0857, 0.3823, 0.1054]}, {"w": "happens", "b": [0.3886, 0.0857, 0.4713, 0.1054]}, {"w": "when", "b": [0.4776, 0.0857, 0.5323, 0.1054]}, {"w": "you", "b": [0.5386, 0.0857, 0.5764, 0.1054]}, {"w": "introduce", "b": [0.5827, 0.0857, 0.678, 0.1054]}, {"w": "an", "b": [0.6843, 0.0857, 0.7081, 0.1054]}, {"w": "information", "b": [0.7144, 0.0857, 0.8335, 0.1054]}, {"w": "bottleneck", "b": [0.1294, 0.1062, 0.2345, 0.1259]}, {"w": "by", "b": [0.2408, 0.1062, 0.266, 0.1259]}, {"w": "having", "b": [0.2723, 0.1062, 0.341, 0.1259]}, {"w": "intermediate", "b": [0.3473, 0.1062, 0.4734, 0.1259]}, {"w": "layers", "b": [0.4797, 0.1062, 0.54, 0.1259]}, {"w": "that", "b": [0.5462, 0.1062, 0.584, 0.1259]}, {"w": "are", "b": [0.5903, 0.1062, 0.6211, 0.1259]}, {"w": "significantly", "b": [0.6274, 0.1062, 0.7536, 0.1259]}, {"w": "less", "b": [0.7599, 0.1062, 0.7977, 0.1259]}, {"w": "than", "b": [0.804, 0.1062, 0.8475, 0.1259]}, {"w": "46-dimensional:", "b": [0.1294, 0.1267, 0.2934, 0.1464]}, {"w": "for", "b": [0.2997, 0.1267, 0.3291, 0.1464]}, {"w": "example,", "b": [0.3354, 0.1267, 0.4272, 0.1464]}, {"w": "4-dimensional.", "b": [0.4335, 0.1267, 0.5841, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.23. A model with an information bottleneck", "words": [{"w": "Listing", "b": [0.1294, 0.1645, 0.1862, 0.1793]}, {"w": "3.23.", "b": [0.1909, 0.1645, 0.2288, 0.1793]}, {"w": "A", "b": [0.2335, 0.1645, 0.2471, 0.1793]}, {"w": "model", "b": [0.2519, 0.1645, 0.3013, 0.1793]}, {"w": "with", "b": [0.306, 0.1645, 0.3417, 0.1793]}, {"w": "an", "b": [0.3465, 0.1645, 0.3664, 0.1793]}, {"w": "information", "b": [0.3712, 0.1645, 0.4679, 0.1793]}, {"w": "bottleneck", "b": [0.4726, 0.1645, 0.5567, 0.1793]}]}, {"id": "b_2", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(64, activation='relu', input_shape= (10000,))) model.add(layers.Dense(4, activation='relu')) model.add(layers.Dense(46, activation='softmax')) model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy']) model.fit(partial_x_train, partial_y_train, epochs=20, batch_size=128, validation_data=(x_val, y_val))", "words": [{"w": "model", "b": [0.1357, 0.1929, 0.1925, 0.2081]}, {"w": "=", "b": [0.2038, 0.1929, 0.2152, 0.2081]}, {"w": "models.Sequential()", "b": [0.2265, 0.1929, 0.4422, 0.2081]}, {"w": "model.add(layers.Dense(64,", "b": [0.1357, 0.2081, 0.4309, 0.2232]}, {"w": "activation='relu',", "b": [0.4422, 0.2081, 0.6465, 0.2232]}, {"w": "input_shape=", "b": [0.6579, 0.2081, 0.7941, 0.2232]}, {"w": "(10000,)))", "b": [0.1357, 0.2232, 0.2492, 0.2384]}, {"w": "model.add(layers.Dense(4,", "b": [0.1357, 0.2384, 0.4195, 0.2535]}, {"w": "activation='relu'))", "b": [0.4309, 0.2384, 0.6465, 0.2535]}, {"w": "model.add(layers.Dense(46,", "b": [0.1357, 0.2535, 0.4309, 0.2687]}, {"w": "activation='softmax'))", "b": [0.4422, 0.2535, 0.6919, 0.2687]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.2838, 0.5217, 0.299]}, {"w": "loss='categorical_crossentropy',", "b": [0.2946, 0.299, 0.6579, 0.3141]}, {"w": "metrics=['accuracy'])", "b": [0.2946, 0.3142, 0.533, 0.3293]}, {"w": "model.fit(partial_x_train,", "b": [0.1357, 0.3293, 0.4309, 0.3444]}, {"w": "partial_y_train,", "b": [0.2492, 0.3445, 0.4309, 0.3596]}, {"w": "epochs=20,", "b": [0.2492, 0.3596, 0.3628, 0.3748]}, {"w": "batch_size=128,", "b": [0.2492, 0.3748, 0.4195, 0.3899]}, {"w": "validation_data=(x_val,", "b": [0.2492, 0.3899, 0.5103, 0.4051]}, {"w": "y_val))", "b": [0.5217, 0.3899, 0.6011, 0.4051]}]}, {"id": "b_3", "type": "paragraph", "text": "The network now peaks at ~71% validation accuracy, an 8% absolute drop. This drop is mostly due to the fact that you’re trying to compress a lot of information (enough information to recover the separation hyperplanes of 46 classes) into an intermediate space that is too low- dimensional. The network is able to cram most of the necessary information into these eight-dimensional representations, but not all of it.", "words": [{"w": "The", "b": [0.1294, 0.4279, 0.1686, 0.4477]}, {"w": "network", "b": [0.1749, 0.4279, 0.2576, 0.4477]}, {"w": "now", "b": [0.2639, 0.4279, 0.3074, 0.4477]}, {"w": "peaks", "b": [0.3137, 0.4279, 0.3711, 0.4477]}, {"w": "at", "b": [0.3774, 0.4279, 0.3956, 0.4477]}, {"w": "~71%", "b": [0.4019, 0.4279, 0.4618, 0.4477]}, {"w": "validation", "b": [0.4681, 0.4279, 0.569, 0.4477]}, {"w": "accuracy,", "b": [0.5753, 0.4279, 0.6696, 0.4477]}, {"w": "an", "b": [0.6759, 0.4279, 0.6997, 0.4477]}, {"w": "8%", "b": [0.706, 0.4279, 0.7396, 0.4477]}, {"w": "absolute", "b": [0.7459, 0.4279, 0.83, 0.4477]}, {"w": "drop.", "b": [0.1294, 0.4484, 0.182, 0.4682]}, {"w": "This", "b": [0.1883, 0.4484, 0.2331, 0.4682]}, {"w": "drop", "b": [0.2394, 0.4484, 0.2857, 0.4682]}, {"w": "is", "b": [0.292, 0.4484, 0.3088, 0.4682]}, {"w": "mostly", "b": [0.3151, 0.4484, 0.3838, 0.4682]}, {"w": "due", "b": [0.3901, 0.4484, 0.4265, 0.4682]}, {"w": "to", "b": [0.4328, 0.4484, 0.4525, 0.4682]}, {"w": "the", "b": [0.4588, 0.4484, 0.4896, 0.4682]}, {"w": "fact", "b": [0.4959, 0.4484, 0.5337, 0.4682]}, {"w": "that", "b": [0.54, 0.4484, 0.5779, 0.4682]}, {"w": "you’re", "b": [0.5842, 0.4484, 0.65, 0.4682]}, {"w": "trying", "b": [0.6563, 0.4484, 0.7166, 0.4682]}, {"w": "to", "b": [0.7228, 0.4484, 0.7424, 0.4682]}, {"w": "compress", "b": [0.7487, 0.4484, 0.844, 0.4682]}, {"w": "a", "b": [0.8503, 0.4484, 0.8615, 0.4682]}, {"w": "lot", "b": [0.1294, 0.4689, 0.1561, 0.4887]}, {"w": "of", "b": [0.1624, 0.4689, 0.1834, 0.4887]}, {"w": "information", "b": [0.1897, 0.4689, 0.3088, 0.4887]}, {"w": "(enough", "b": [0.3151, 0.4689, 0.3978, 0.4887]}, {"w": "information", "b": [0.4041, 0.4689, 0.5232, 0.4887]}, {"w": "to", "b": [0.5295, 0.4689, 0.5491, 0.4887]}, {"w": "recover", "b": [0.5554, 0.4689, 0.6311, 0.4887]}, {"w": "the", "b": [0.6374, 0.4689, 0.6682, 0.4887]}, {"w": "separation", "b": [0.6745, 0.4689, 0.7782, 0.4887]}, {"w": "hyperplanes", "b": [0.1294, 0.4894, 0.2513, 0.5092]}, {"w": "of", "b": [0.2576, 0.4894, 0.2786, 0.5092]}, {"w": "46", "b": [0.2849, 0.4894, 0.3102, 0.5092]}, {"w": "classes)", "b": [0.3165, 0.4894, 0.3949, 0.5092]}, {"w": "into", "b": [0.4012, 0.4894, 0.4405, 0.5092]}, {"w": "an", "b": [0.4468, 0.4894, 0.4706, 0.5092]}, {"w": "intermediate", "b": [0.4769, 0.4894, 0.603, 0.5092]}, {"w": "space", "b": [0.6092, 0.4894, 0.6653, 0.5092]}, {"w": "that", "b": [0.6716, 0.4894, 0.7094, 0.5092]}, {"w": "is", "b": [0.7157, 0.4894, 0.7325, 0.5092]}, {"w": "too", "b": [0.7388, 0.4894, 0.7711, 0.5092]}, {"w": "low-", "b": [0.7774, 0.4894, 0.8236, 0.5092]}, {"w": "dimensional.", "b": [0.1294, 0.5099, 0.259, 0.5297]}, {"w": "The", "b": [0.2654, 0.5099, 0.3046, 0.5297]}, {"w": "network", "b": [0.3109, 0.5099, 0.3936, 0.5297]}, {"w": "is", "b": [0.3999, 0.5099, 0.4167, 0.5297]}, {"w": "able", "b": [0.423, 0.5099, 0.465, 0.5297]}, {"w": "to", "b": [0.4713, 0.5099, 0.4909, 0.5297]}, {"w": "cram", "b": [0.4973, 0.5099, 0.5477, 0.5297]}, {"w": "most", "b": [0.5539, 0.5099, 0.6016, 0.5297]}, {"w": "of", "b": [0.6079, 0.5099, 0.6289, 0.5297]}, {"w": "the", "b": [0.6352, 0.5099, 0.666, 0.5297]}, {"w": "necessary", "b": [0.6723, 0.5099, 0.7704, 0.5297]}, {"w": "information", "b": [0.1294, 0.5304, 0.2485, 0.5502]}, {"w": "into", "b": [0.2548, 0.5304, 0.2941, 0.5502]}, {"w": "these", "b": [0.3004, 0.5304, 0.3522, 0.5502]}, {"w": "eight-dimensional", "b": [0.3585, 0.5304, 0.5407, 0.5502]}, {"w": "representations,", "b": [0.547, 0.5304, 0.706, 0.5502]}, {"w": "but", "b": [0.7124, 0.5304, 0.7446, 0.5502]}, {"w": "not", "b": [0.7509, 0.5304, 0.7831, 0.5502]}, {"w": "all", "b": [0.7894, 0.5304, 0.8147, 0.5502]}, {"w": "of", "b": [0.821, 0.5304, 0.842, 0.5502]}, {"w": "it.", "b": [0.8483, 0.5304, 0.8686, 0.5502]}]}, {"id": "b_4", "type": "paragraph", "text": "3.5.8. Further experiments", "words": [{"w": "3.5.8.", "b": [0.1294, 0.5777, 0.1862, 0.5974]}, {"w": "Further", "b": [0.1925, 0.5777, 0.2779, 0.5974]}, {"w": "experiments", "b": [0.2842, 0.5777, 0.416, 0.5974]}]}, {"id": "b_5", "type": "paragraph", "text": "Try using larger or smaller layers: 32 units, 128 units, and so on. You used two hidden layers. Now try using a single hidden layer, or three hidden layers.", "words": [{"w": "Try", "b": [0.1799, 0.616, 0.2154, 0.6358]}, {"w": "using", "b": [0.2217, 0.616, 0.2764, 0.6358]}, {"w": "larger", "b": [0.2827, 0.616, 0.341, 0.6358]}, {"w": "or", "b": [0.3473, 0.616, 0.3684, 0.6358]}, {"w": "smaller", "b": [0.3747, 0.616, 0.4489, 0.6358]}, {"w": "layers:", "b": [0.4552, 0.616, 0.5225, 0.6358]}, {"w": "32", "b": [0.5288, 0.616, 0.554, 0.6358]}, {"w": "units,", "b": [0.5603, 0.616, 0.6157, 0.6358]}, {"w": "128", "b": [0.622, 0.616, 0.6598, 0.6358]}, {"w": "units,", "b": [0.6661, 0.616, 0.7215, 0.6358]}, {"w": "and", "b": [0.7278, 0.616, 0.7643, 0.6358]}, {"w": "so", "b": [0.7706, 0.616, 0.793, 0.6358]}, {"w": "on.", "b": [0.7993, 0.616, 0.8308, 0.6358]}, {"w": "You", "b": [0.1799, 0.6365, 0.2208, 0.6563]}, {"w": "used", "b": [0.2271, 0.6365, 0.2733, 0.6563]}, {"w": "two", "b": [0.2796, 0.6365, 0.3175, 0.6563]}, {"w": "hidden", "b": [0.3238, 0.6365, 0.3924, 0.6563]}, {"w": "layers.", "b": [0.3987, 0.6365, 0.4653, 0.6563]}, {"w": "Now", "b": [0.4716, 0.6365, 0.5206, 0.6563]}, {"w": "try", "b": [0.5269, 0.6365, 0.555, 0.6563]}, {"w": "using", "b": [0.5613, 0.6365, 0.6159, 0.6563]}, {"w": "a", "b": [0.6222, 0.6365, 0.6334, 0.6563]}, {"w": "single", "b": [0.6398, 0.6365, 0.7, 0.6563]}, {"w": "hidden", "b": [0.7063, 0.6365, 0.775, 0.6563]}, {"w": "layer,", "b": [0.7813, 0.6365, 0.837, 0.6563]}, {"w": "or", "b": [0.8433, 0.6365, 0.8643, 0.6563]}, {"w": "three", "b": [0.1799, 0.657, 0.2303, 0.6768]}, {"w": "hidden", "b": [0.2366, 0.657, 0.3053, 0.6768]}, {"w": "layers.", "b": [0.3116, 0.657, 0.3781, 0.6768]}]}, {"id": "b_6", "type": "paragraph", "text": "3.5.9. Wrapping up", "words": [{"w": "3.5.9.", "b": [0.1294, 0.7043, 0.1862, 0.724]}, {"w": "Wrapping", "b": [0.1925, 0.7043, 0.3028, 0.724]}, {"w": "up", "b": [0.3091, 0.7043, 0.3371, 0.724]}]}, {"id": "b_7", "type": "paragraph", "text": "Here’s what you should take away from this example:", "words": [{"w": "Here’s", "b": [0.1294, 0.747, 0.1952, 0.7668]}, {"w": "what", "b": [0.2016, 0.747, 0.2506, 0.7668]}, {"w": "you", "b": [0.2569, 0.747, 0.2947, 0.7668]}, {"w": "should", "b": [0.301, 0.747, 0.3683, 0.7668]}, {"w": "take", "b": [0.3746, 0.747, 0.4167, 0.7668]}, {"w": "away", "b": [0.423, 0.747, 0.4762, 0.7668]}, {"w": "from", "b": [0.4825, 0.747, 0.5315, 0.7668]}, {"w": "this", "b": [0.5378, 0.747, 0.5743, 0.7668]}, {"w": "example:", "b": [0.5806, 0.747, 0.6731, 0.7668]}]}, {"id": "b_8", "type": "paragraph", "text": "If you’re trying to classify data points among N classes, your network should end with a Dense layer of size N. In a single-label, multiclass classification problem, your network should end with a softmax activation so that it will output a probability distribution over the N output classes.", "words": [{"w": "If", "b": [0.1799, 0.7854, 0.1967, 0.8051]}, {"w": "you’re", "b": [0.203, 0.7854, 0.2688, 0.8051]}, {"w": "trying", "b": [0.2751, 0.7854, 0.3354, 0.8051]}, {"w": "to", "b": [0.3417, 0.7854, 0.3613, 0.8051]}, {"w": "classify", "b": [0.3676, 0.7854, 0.4447, 0.8051]}, {"w": "data", "b": [0.451, 0.7854, 0.493, 0.8051]}, {"w": "points", "b": [0.4993, 0.7854, 0.561, 0.8051]}, {"w": "among", "b": [0.5673, 0.7854, 0.636, 0.8051]}, {"w": "N", "b": [0.6422, 0.7854, 0.659, 0.8051]}, {"w": "classes,", "b": [0.6653, 0.7854, 0.7417, 0.8051]}, {"w": "your", "b": [0.748, 0.7854, 0.7942, 0.8051]}, {"w": "network", "b": [0.1799, 0.8059, 0.2625, 0.8256]}, {"w": "should", "b": [0.2688, 0.8059, 0.3361, 0.8256]}, {"w": "end", "b": [0.3424, 0.8059, 0.3788, 0.8256]}, {"w": "with", "b": [0.3852, 0.8059, 0.43, 0.8256]}, {"w": "a", "b": [0.4363, 0.8059, 0.4475, 0.8256]}, {"w": "Dense", "b": [0.4538, 0.8069, 0.5295, 0.8271]}, {"w": "layer", "b": [0.5358, 0.8059, 0.5862, 0.8256]}, {"w": "of", "b": [0.5925, 0.8059, 0.6135, 0.8256]}, {"w": "size", "b": [0.6198, 0.8059, 0.6591, 0.8256]}, {"w": "N.", "b": [0.6653, 0.8059, 0.6885, 0.8256]}, {"w": "In", "b": [0.1799, 0.8273, 0.2009, 0.847]}, {"w": "a", "b": [0.2072, 0.8273, 0.2184, 0.847]}, {"w": "single-label,", "b": [0.2247, 0.8273, 0.3487, 0.847]}, {"w": "multiclass", "b": [0.355, 0.8273, 0.4573, 0.847]}, {"w": "classification", "b": [0.4636, 0.8273, 0.5967, 0.847]}, {"w": "problem,", "b": [0.6031, 0.8273, 0.6934, 0.847]}, {"w": "your", "b": [0.6997, 0.8273, 0.746, 0.847]}, {"w": "network", "b": [0.7523, 0.8273, 0.835, 0.847]}, {"w": "should", "b": [0.1799, 0.8478, 0.2471, 0.8675]}, {"w": "end", "b": [0.2534, 0.8478, 0.2899, 0.8675]}, {"w": "with", "b": [0.2962, 0.8478, 0.341, 0.8675]}, {"w": "a", "b": [0.3473, 0.8478, 0.3585, 0.8675]}, {"w": "softmax", "b": [0.3648, 0.8488, 0.4708, 0.869]}, {"w": "activation", "b": [0.4771, 0.8478, 0.5766, 0.8675]}, {"w": "so", "b": [0.5829, 0.8478, 0.6053, 0.8675]}, {"w": "that", "b": [0.6116, 0.8478, 0.6494, 0.8675]}, {"w": "it", "b": [0.6557, 0.8478, 0.6698, 0.8675]}, {"w": "will", "b": [0.6761, 0.8478, 0.7153, 0.8675]}, {"w": "output", "b": [0.7216, 0.8478, 0.7861, 0.8675]}, {"w": "a", "b": [0.7924, 0.8478, 0.8036, 0.8675]}, {"w": "probability", "b": [0.1799, 0.8691, 0.2906, 0.8889]}, {"w": "distribution", "b": [0.2969, 0.8691, 0.4132, 0.8889]}, {"w": "over", "b": [0.4195, 0.8691, 0.4644, 0.8889]}, {"w": "the", "b": [0.4707, 0.8691, 0.5015, 0.8889]}, {"w": "N", "b": [0.5077, 0.8691, 0.5246, 0.8889]}, {"w": "output", "b": [0.5309, 0.8691, 0.5953, 0.8889]}, {"w": "classes.", "b": [0.6016, 0.8691, 0.678, 0.8889]}]}]}, {"page": 129, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Categorical crossentropy is almost always the loss function you should use for such problems. It minimizes the distance between the probability distributions output by the network and the true distribution of the targets. There are two ways to handle labels in multiclass classification:", "words": [{"w": "Categorical", "b": [0.1799, 0.0857, 0.2962, 0.1054]}, {"w": "crossentropy", "b": [0.3025, 0.0857, 0.4314, 0.1054]}, {"w": "is", "b": [0.4377, 0.0857, 0.4545, 0.1054]}, {"w": "almost", "b": [0.4608, 0.0857, 0.5281, 0.1054]}, {"w": "always", "b": [0.5344, 0.0857, 0.6044, 0.1054]}, {"w": "the", "b": [0.6107, 0.0857, 0.6416, 0.1054]}, {"w": "loss", "b": [0.6479, 0.0857, 0.6871, 0.1054]}, {"w": "function", "b": [0.6934, 0.0857, 0.7775, 0.1054]}, {"w": "you", "b": [0.7838, 0.0857, 0.8217, 0.1054]}, {"w": "should", "b": [0.1799, 0.1062, 0.2471, 0.1259]}, {"w": "use", "b": [0.2534, 0.1062, 0.2871, 0.1259]}, {"w": "for", "b": [0.2934, 0.1062, 0.3228, 0.1259]}, {"w": "such", "b": [0.3291, 0.1062, 0.3753, 0.1259]}, {"w": "problems.", "b": [0.3816, 0.1062, 0.4818, 0.1259]}, {"w": "It", "b": [0.4881, 0.1062, 0.5036, 0.1259]}, {"w": "minimizes", "b": [0.5099, 0.1062, 0.615, 0.1259]}, {"w": "the", "b": [0.6213, 0.1062, 0.6521, 0.1259]}, {"w": "distance", "b": [0.6584, 0.1062, 0.7411, 0.1259]}, {"w": "between", "b": [0.7474, 0.1062, 0.8314, 0.1259]}, {"w": "the", "b": [0.8377, 0.1062, 0.8685, 0.1259]}, {"w": "probability", "b": [0.1799, 0.1267, 0.2906, 0.1464]}, {"w": "distributions", "b": [0.2969, 0.1267, 0.423, 0.1464]}, {"w": "output", "b": [0.4293, 0.1267, 0.4938, 0.1464]}, {"w": "by", "b": [0.5001, 0.1267, 0.5254, 0.1464]}, {"w": "the", "b": [0.5317, 0.1267, 0.5625, 0.1464]}, {"w": "network", "b": [0.5688, 0.1267, 0.6515, 0.1464]}, {"w": "and", "b": [0.6578, 0.1267, 0.6942, 0.1464]}, {"w": "the", "b": [0.7005, 0.1267, 0.7313, 0.1464]}, {"w": "true", "b": [0.7376, 0.1267, 0.7769, 0.1464]}, {"w": "distribution", "b": [0.1799, 0.1472, 0.2962, 0.1669]}, {"w": "of", "b": [0.3025, 0.1472, 0.3235, 0.1669]}, {"w": "the", "b": [0.3298, 0.1472, 0.3607, 0.1669]}, {"w": "targets.", "b": [0.367, 0.1472, 0.44, 0.1669]}, {"w": "There", "b": [0.1799, 0.1677, 0.2387, 0.1874]}, {"w": "are", "b": [0.245, 0.1677, 0.2758, 0.1874]}, {"w": "two", "b": [0.2821, 0.1677, 0.3199, 0.1874]}, {"w": "ways", "b": [0.3262, 0.1677, 0.3781, 0.1874]}, {"w": "to", "b": [0.3844, 0.1677, 0.404, 0.1874]}, {"w": "handle", "b": [0.4103, 0.1677, 0.4776, 0.1874]}, {"w": "labels", "b": [0.4839, 0.1677, 0.5427, 0.1874]}, {"w": "in", "b": [0.549, 0.1677, 0.5687, 0.1874]}, {"w": "multiclass", "b": [0.575, 0.1677, 0.6773, 0.1874]}, {"w": "classification:", "b": [0.6836, 0.1677, 0.8237, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Encoding the labels via categorical encoding (also known as one-hot encoding) and using categorical_crossentropy as a loss function Encoding the labels as integers and using the sparse_categorical_-crossentropy loss function If you need to classify data into a large number of categories, you should avoid creating information bottlenecks in your network due to intermediate layers that are too small.", "words": [{"w": "Encoding", "b": [0.2303, 0.206, 0.327, 0.2257]}, {"w": "the", "b": [0.3333, 0.206, 0.3641, 0.2257]}, {"w": "labels", "b": [0.3704, 0.206, 0.4293, 0.2257]}, {"w": "via", "b": [0.4356, 0.206, 0.4664, 0.2257]}, {"w": "categorical", "b": [0.4727, 0.206, 0.5834, 0.2257]}, {"w": "encoding", "b": [0.5897, 0.206, 0.6822, 0.2257]}, {"w": "(also", "b": [0.6885, 0.206, 0.7375, 0.2257]}, {"w": "known", "b": [0.7438, 0.206, 0.8125, 0.2257]}, {"w": "as", "b": [0.8188, 0.206, 0.8398, 0.2257]}, {"w": "one-hot", "b": [0.2303, 0.2265, 0.3074, 0.2462]}, {"w": "encoding)", "b": [0.3137, 0.2265, 0.4146, 0.2462]}, {"w": "and", "b": [0.4209, 0.2265, 0.4573, 0.2462]}, {"w": "using", "b": [0.4636, 0.2265, 0.5183, 0.2462]}, {"w": "categorical_crossentropy", "b": [0.2303, 0.248, 0.5936, 0.2682]}, {"w": "as", "b": [0.5999, 0.247, 0.6209, 0.2667]}, {"w": "a", "b": [0.6273, 0.247, 0.6385, 0.2667]}, {"w": "loss", "b": [0.6448, 0.247, 0.684, 0.2667]}, {"w": "function", "b": [0.6903, 0.247, 0.7744, 0.2667]}, {"w": "Encoding", "b": [0.2303, 0.2684, 0.327, 0.2881]}, {"w": "the", "b": [0.3333, 0.2684, 0.3641, 0.2881]}, {"w": "labels", "b": [0.3704, 0.2684, 0.4293, 0.2881]}, {"w": "as", "b": [0.4356, 0.2684, 0.4566, 0.2881]}, {"w": "integers", "b": [0.4629, 0.2684, 0.5428, 0.2881]}, {"w": "and", "b": [0.5491, 0.2684, 0.5855, 0.2881]}, {"w": "using", "b": [0.5918, 0.2684, 0.6465, 0.2881]}, {"w": "the", "b": [0.6528, 0.2684, 0.6836, 0.2881]}, {"w": "sparse_categorical_-crossentropy", "b": [0.2303, 0.2899, 0.7146, 0.3101]}, {"w": "loss", "b": [0.721, 0.2889, 0.7603, 0.3086]}, {"w": "function", "b": [0.7666, 0.2889, 0.8507, 0.3086]}, {"w": "If", "b": [0.1799, 0.3103, 0.1967, 0.33]}, {"w": "you", "b": [0.203, 0.3103, 0.2408, 0.33]}, {"w": "need", "b": [0.2471, 0.3103, 0.2947, 0.33]}, {"w": "to", "b": [0.301, 0.3103, 0.3207, 0.33]}, {"w": "classify", "b": [0.327, 0.3103, 0.404, 0.33]}, {"w": "data", "b": [0.4104, 0.3103, 0.4524, 0.33]}, {"w": "into", "b": [0.4587, 0.3103, 0.4979, 0.33]}, {"w": "a", "b": [0.5042, 0.3103, 0.5154, 0.33]}, {"w": "large", "b": [0.5217, 0.3103, 0.5717, 0.33]}, {"w": "number", "b": [0.578, 0.3103, 0.655, 0.33]}, {"w": "of", "b": [0.6613, 0.3103, 0.6824, 0.33]}, {"w": "categories,", "b": [0.6887, 0.3103, 0.7972, 0.33]}, {"w": "you", "b": [0.8035, 0.3103, 0.8414, 0.33]}, {"w": "should", "b": [0.1799, 0.3308, 0.2471, 0.3505]}, {"w": "avoid", "b": [0.2534, 0.3308, 0.3095, 0.3505]}, {"w": "creating", "b": [0.3158, 0.3308, 0.3971, 0.3505]}, {"w": "information", "b": [0.4034, 0.3308, 0.5225, 0.3505]}, {"w": "bottlenecks", "b": [0.5288, 0.3308, 0.6437, 0.3505]}, {"w": "in", "b": [0.65, 0.3308, 0.6696, 0.3505]}, {"w": "your", "b": [0.6759, 0.3308, 0.7222, 0.3505]}, {"w": "network", "b": [0.7284, 0.3308, 0.8111, 0.3505]}, {"w": "due", "b": [0.8174, 0.3308, 0.8538, 0.3505]}, {"w": "to", "b": [0.1799, 0.3513, 0.1995, 0.371]}, {"w": "intermediate", "b": [0.2058, 0.3513, 0.3319, 0.371]}, {"w": "layers", "b": [0.3382, 0.3513, 0.3984, 0.371]}, {"w": "that", "b": [0.4048, 0.3513, 0.4426, 0.371]}, {"w": "are", "b": [0.4489, 0.3513, 0.4797, 0.371]}, {"w": "too", "b": [0.486, 0.3513, 0.5182, 0.371]}, {"w": "small.", "b": [0.5245, 0.3513, 0.5855, 0.371]}]}, {"id": "b_2", "type": "paragraph", "text": "3.6. Predicting house prices: a regression example", "words": [{"w": "3.6.", "b": [0.1294, 0.4081, 0.172, 0.4303]}, {"w": "Predicting", "b": [0.1791, 0.4081, 0.3047, 0.4303]}, {"w": "house", "b": [0.3118, 0.4081, 0.3812, 0.4303]}, {"w": "prices:", "b": [0.3882, 0.4081, 0.4702, 0.4303]}, {"w": "a", "b": [0.4773, 0.4081, 0.4915, 0.4303]}, {"w": "regression", "b": [0.4986, 0.4081, 0.6221, 0.4303]}, {"w": "example", "b": [0.6292, 0.4081, 0.73, 0.4303]}]}, {"id": "b_3", "type": "paragraph", "text": "The two previous examples were considered classification problems, where the goal was to predict a single discrete label of an input data point. Another common type of machine-learning problem is regression, which consists of predicting a continuous value instead of a discrete label: for instance, predicting the temperature tomorrow, given meteorological data; or predicting the time that a software project will take to complete, given its specifications.", "words": [{"w": "The", "b": [0.1294, 0.4538, 0.1686, 0.4735]}, {"w": "two", "b": [0.1749, 0.4538, 0.2128, 0.4735]}, {"w": "previous", "b": [0.2191, 0.4538, 0.306, 0.4735]}, {"w": "examples", "b": [0.3123, 0.4538, 0.4076, 0.4735]}, {"w": "were", "b": [0.4139, 0.4538, 0.4629, 0.4735]}, {"w": "considered", "b": [0.4692, 0.4538, 0.5785, 0.4735]}, {"w": "classification", "b": [0.5848, 0.4538, 0.7179, 0.4735]}, {"w": "problems,", "b": [0.7242, 0.4538, 0.8244, 0.4735]}, {"w": "where", "b": [0.1294, 0.4743, 0.191, 0.494]}, {"w": "the", "b": [0.1973, 0.4743, 0.2282, 0.494]}, {"w": "goal", "b": [0.2345, 0.4743, 0.2779, 0.494]}, {"w": "was", "b": [0.2842, 0.4743, 0.3234, 0.494]}, {"w": "to", "b": [0.3298, 0.4743, 0.3494, 0.494]}, {"w": "predict", "b": [0.3557, 0.4743, 0.4257, 0.494]}, {"w": "a", "b": [0.432, 0.4743, 0.4432, 0.494]}, {"w": "single", "b": [0.4496, 0.4743, 0.5098, 0.494]}, {"w": "discrete", "b": [0.5161, 0.4743, 0.5946, 0.494]}, {"w": "label", "b": [0.6009, 0.4743, 0.6499, 0.494]}, {"w": "of", "b": [0.6562, 0.4743, 0.6772, 0.494]}, {"w": "an", "b": [0.6835, 0.4743, 0.7073, 0.494]}, {"w": "input", "b": [0.7136, 0.4743, 0.7654, 0.494]}, {"w": "data", "b": [0.7717, 0.4743, 0.8138, 0.494]}, {"w": "point.", "b": [0.1294, 0.4948, 0.1876, 0.5145]}, {"w": "Another", "b": [0.1939, 0.4948, 0.2766, 0.5145]}, {"w": "common", "b": [0.2829, 0.4948, 0.3712, 0.5145]}, {"w": "type", "b": [0.3775, 0.4948, 0.4209, 0.5145]}, {"w": "of", "b": [0.4272, 0.4948, 0.4482, 0.5145]}, {"w": "machine-learning", "b": [0.4545, 0.4948, 0.6311, 0.5145]}, {"w": "problem", "b": [0.6374, 0.4948, 0.7214, 0.5145]}, {"w": "is", "b": [0.7277, 0.4948, 0.7446, 0.5145]}, {"w": "regression,", "b": [0.7508, 0.4948, 0.8617, 0.5145]}, {"w": "which", "b": [0.1294, 0.5153, 0.1911, 0.535]}, {"w": "consists", "b": [0.1974, 0.5153, 0.2773, 0.535]}, {"w": "of", "b": [0.2836, 0.5153, 0.3046, 0.535]}, {"w": "predicting", "b": [0.3109, 0.5153, 0.4132, 0.535]}, {"w": "a", "b": [0.4195, 0.5153, 0.4307, 0.535]}, {"w": "continuous", "b": [0.437, 0.5153, 0.5477, 0.535]}, {"w": "value", "b": [0.554, 0.5153, 0.6087, 0.535]}, {"w": "instead", "b": [0.615, 0.5153, 0.6864, 0.535]}, {"w": "of", "b": [0.6927, 0.5153, 0.7137, 0.535]}, {"w": "a", "b": [0.72, 0.5153, 0.7312, 0.535]}, {"w": "discrete", "b": [0.7376, 0.5153, 0.816, 0.535]}, {"w": "label:", "b": [0.1294, 0.5358, 0.1855, 0.5555]}, {"w": "for", "b": [0.1918, 0.5358, 0.2212, 0.5555]}, {"w": "instance,", "b": [0.2275, 0.5358, 0.3165, 0.5555]}, {"w": "predicting", "b": [0.3228, 0.5358, 0.4251, 0.5555]}, {"w": "the", "b": [0.4314, 0.5358, 0.4622, 0.5555]}, {"w": "temperature", "b": [0.4685, 0.5358, 0.589, 0.5555]}, {"w": "tomorrow,", "b": [0.5953, 0.5358, 0.6993, 0.5555]}, {"w": "given", "b": [0.7056, 0.5358, 0.7617, 0.5555]}, {"w": "meteorological", "b": [0.1294, 0.5563, 0.2807, 0.576]}, {"w": "data;", "b": [0.287, 0.5563, 0.3361, 0.576]}, {"w": "or", "b": [0.3424, 0.5563, 0.3634, 0.576]}, {"w": "predicting", "b": [0.3697, 0.5563, 0.472, 0.576]}, {"w": "the", "b": [0.4783, 0.5563, 0.5091, 0.576]}, {"w": "time", "b": [0.5154, 0.5563, 0.5603, 0.576]}, {"w": "that", "b": [0.5666, 0.5563, 0.6044, 0.576]}, {"w": "a", "b": [0.6107, 0.5563, 0.6219, 0.576]}, {"w": "software", "b": [0.6283, 0.5563, 0.7151, 0.576]}, {"w": "project", "b": [0.7214, 0.5563, 0.7915, 0.576]}, {"w": "will", "b": [0.7978, 0.5563, 0.837, 0.576]}, {"w": "take", "b": [0.1294, 0.5768, 0.1714, 0.5965]}, {"w": "to", "b": [0.1777, 0.5768, 0.1974, 0.5965]}, {"w": "complete,", "b": [0.2037, 0.5768, 0.3025, 0.5965]}, {"w": "given", "b": [0.3088, 0.5768, 0.3648, 0.5965]}, {"w": "its", "b": [0.3711, 0.5768, 0.395, 0.5965]}, {"w": "specifications.", "b": [0.4013, 0.5768, 0.5463, 0.5965]}]}, {"id": "b_4", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.6253, 0.1672, 0.6401]}]}, {"id": "b_5", "type": "paragraph", "text": "Don’t confuse regression and the algorithm logistic regression. Confusingly, logistic regression isn’t a regression algorithm—it’s a classification algorithm.", "words": [{"w": "Don’t", "b": [0.1294, 0.6588, 0.1878, 0.6785]}, {"w": "confuse", "b": [0.1941, 0.6588, 0.2726, 0.6785]}, {"w": "regression", "b": [0.2789, 0.6588, 0.3835, 0.6785]}, {"w": "and", "b": [0.3898, 0.6588, 0.4262, 0.6785]}, {"w": "the", "b": [0.4325, 0.6588, 0.4633, 0.6785]}, {"w": "algorithm", "b": [0.4697, 0.6588, 0.5678, 0.6785]}, {"w": "logistic", "b": [0.574, 0.6588, 0.6483, 0.6785]}, {"w": "regression.", "b": [0.6546, 0.6588, 0.7655, 0.6785]}, {"w": "Confusingly,", "b": [0.1294, 0.6793, 0.2588, 0.699]}, {"w": "logistic", "b": [0.2651, 0.6793, 0.3394, 0.699]}, {"w": "regression", "b": [0.3457, 0.6793, 0.4494, 0.699]}, {"w": "isn’t", "b": [0.4557, 0.6793, 0.5001, 0.699]}, {"w": "a", "b": [0.5064, 0.6793, 0.5176, 0.699]}, {"w": "regression", "b": [0.5239, 0.6793, 0.6276, 0.699]}, {"w": "algorithm—it’s", "b": [0.6339, 0.6793, 0.788, 0.699]}, {"w": "a", "b": [0.7943, 0.6793, 0.8055, 0.699]}, {"w": "classification", "b": [0.1294, 0.6998, 0.2625, 0.7195]}, {"w": "algorithm.", "b": [0.2688, 0.6998, 0.3732, 0.7195]}]}, {"id": "b_6", "type": "paragraph", "text": "3.6.1. The Boston Housing Price dataset", "words": [{"w": "3.6.1.", "b": [0.1294, 0.7738, 0.1862, 0.7935]}, {"w": "The", "b": [0.1925, 0.7738, 0.2345, 0.7935]}, {"w": "Boston", "b": [0.2408, 0.7738, 0.3151, 0.7935]}, {"w": "Housing", "b": [0.3214, 0.7738, 0.4112, 0.7935]}, {"w": "Price", "b": [0.4175, 0.7738, 0.4735, 0.7935]}, {"w": "dataset", "b": [0.4798, 0.7738, 0.5569, 0.7935]}]}, {"id": "b_7", "type": "paragraph", "text": "You’ll attempt to predict the median price of homes in a given Boston suburb in the mid-1970s, given data points about the suburb at the time, such as the crime rate, the local property tax rate, and so on. The dataset you’ll use has an interesting difference from the two previous examples.", "words": [{"w": "You’ll", "b": [0.1294, 0.8166, 0.1928, 0.8363]}, {"w": "attempt", "b": [0.1991, 0.8166, 0.2747, 0.8363]}, {"w": "to", "b": [0.281, 0.8166, 0.3007, 0.8363]}, {"w": "predict", "b": [0.307, 0.8166, 0.377, 0.8363]}, {"w": "the", "b": [0.3833, 0.8166, 0.4142, 0.8363]}, {"w": "median", "b": [0.4205, 0.8166, 0.4947, 0.8363]}, {"w": "price", "b": [0.501, 0.8166, 0.5515, 0.8363]}, {"w": "of", "b": [0.5578, 0.8166, 0.5788, 0.8363]}, {"w": "homes", "b": [0.5851, 0.8166, 0.651, 0.8363]}, {"w": "in", "b": [0.6573, 0.8166, 0.6769, 0.8363]}, {"w": "a", "b": [0.6832, 0.8166, 0.6944, 0.8363]}, {"w": "given", "b": [0.7007, 0.8166, 0.7568, 0.8363]}, {"w": "Boston", "b": [0.7631, 0.8166, 0.8345, 0.8363]}, {"w": "suburb", "b": [0.1294, 0.8371, 0.1981, 0.8568]}, {"w": "in", "b": [0.2044, 0.8371, 0.224, 0.8568]}, {"w": "the", "b": [0.2303, 0.8371, 0.2611, 0.8568]}, {"w": "mid-1970s,", "b": [0.2674, 0.8371, 0.3817, 0.8568]}, {"w": "given", "b": [0.388, 0.8371, 0.444, 0.8568]}, {"w": "data", "b": [0.4503, 0.8371, 0.4924, 0.8568]}, {"w": "points", "b": [0.4987, 0.8371, 0.5603, 0.8568]}, {"w": "about", "b": [0.5667, 0.8371, 0.6227, 0.8568]}, {"w": "the", "b": [0.629, 0.8371, 0.6598, 0.8568]}, {"w": "suburb", "b": [0.6661, 0.8371, 0.7347, 0.8568]}, {"w": "at", "b": [0.741, 0.8371, 0.7593, 0.8568]}, {"w": "the", "b": [0.7656, 0.8371, 0.7964, 0.8568]}, {"w": "time,", "b": [0.8027, 0.8371, 0.8539, 0.8568]}, {"w": "such", "b": [0.1294, 0.8576, 0.1757, 0.8773]}, {"w": "as", "b": [0.182, 0.8576, 0.203, 0.8773]}, {"w": "the", "b": [0.2093, 0.8576, 0.2401, 0.8773]}, {"w": "crime", "b": [0.2464, 0.8576, 0.3038, 0.8773]}, {"w": "rate,", "b": [0.3102, 0.8576, 0.3543, 0.8773]}, {"w": "the", "b": [0.3606, 0.8576, 0.3914, 0.8773]}, {"w": "local", "b": [0.3977, 0.8576, 0.4468, 0.8773]}, {"w": "property", "b": [0.4531, 0.8576, 0.5385, 0.8773]}, {"w": "tax", "b": [0.5448, 0.8576, 0.5757, 0.8773]}, {"w": "rate,", "b": [0.582, 0.8576, 0.6261, 0.8773]}, {"w": "and", "b": [0.6324, 0.8576, 0.6688, 0.8773]}, {"w": "so", "b": [0.6751, 0.8576, 0.6975, 0.8773]}, {"w": "on.", "b": [0.7039, 0.8576, 0.7354, 0.8773]}, {"w": "The", "b": [0.7417, 0.8576, 0.7809, 0.8773]}, {"w": "dataset", "b": [0.7872, 0.8576, 0.8573, 0.8773]}, {"w": "you’ll", "b": [0.1294, 0.8781, 0.1897, 0.8978]}, {"w": "use", "b": [0.196, 0.8781, 0.2296, 0.8978]}, {"w": "has", "b": [0.2359, 0.8781, 0.2695, 0.8978]}, {"w": "an", "b": [0.2758, 0.8781, 0.2997, 0.8978]}, {"w": "interesting", "b": [0.306, 0.8781, 0.4125, 0.8978]}, {"w": "difference", "b": [0.4187, 0.8781, 0.5205, 0.8978]}, {"w": "from", "b": [0.5268, 0.8781, 0.5759, 0.8978]}, {"w": "the", "b": [0.5822, 0.8781, 0.613, 0.8978]}, {"w": "two", "b": [0.6193, 0.8781, 0.6571, 0.8978]}, {"w": "previous", "b": [0.6634, 0.8781, 0.7503, 0.8978]}, {"w": "examples.", "b": [0.7566, 0.8781, 0.8582, 0.8978]}]}]}, {"page": 130, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "It has relatively few data points: only 506, split between 404 training samples and 102 test samples. And each feature in the input data (for example, the crime rate) has a different scale. For instance, some values are proportions, which take values between 0 and 1; others take values between 1 and 12, others between 0 and 100, and so on.", "words": [{"w": "It", "b": [0.1294, 0.0857, 0.1448, 0.1054]}, {"w": "has", "b": [0.1511, 0.0857, 0.1848, 0.1054]}, {"w": "relatively", "b": [0.1911, 0.0857, 0.2863, 0.1054]}, {"w": "few", "b": [0.2926, 0.0857, 0.3305, 0.1054]}, {"w": "data", "b": [0.3368, 0.0857, 0.3788, 0.1054]}, {"w": "points:", "b": [0.3851, 0.0857, 0.4538, 0.1054]}, {"w": "only", "b": [0.4601, 0.0857, 0.5049, 0.1054]}, {"w": "506,", "b": [0.5113, 0.0857, 0.5554, 0.1054]}, {"w": "split", "b": [0.5617, 0.0857, 0.6052, 0.1054]}, {"w": "between", "b": [0.6115, 0.0857, 0.6955, 0.1054]}, {"w": "404", "b": [0.7018, 0.0857, 0.7397, 0.1054]}, {"w": "training", "b": [0.746, 0.0857, 0.8245, 0.1054]}, {"w": "samples", "b": [0.1294, 0.1062, 0.2107, 0.1259]}, {"w": "and", "b": [0.217, 0.1062, 0.2534, 0.1259]}, {"w": "102", "b": [0.2597, 0.1062, 0.2975, 0.1259]}, {"w": "test", "b": [0.3039, 0.1062, 0.3389, 0.1259]}, {"w": "samples.", "b": [0.3452, 0.1062, 0.4328, 0.1259]}, {"w": "And", "b": [0.4391, 0.1062, 0.4825, 0.1259]}, {"w": "each", "b": [0.4888, 0.1062, 0.535, 0.1259]}, {"w": "feature", "b": [0.5413, 0.1062, 0.6118, 0.1259]}, {"w": "in", "b": [0.6181, 0.1062, 0.6378, 0.1259]}, {"w": "the", "b": [0.6441, 0.1062, 0.6749, 0.1259]}, {"w": "input", "b": [0.6812, 0.1062, 0.7331, 0.1259]}, {"w": "data", "b": [0.7394, 0.1062, 0.7814, 0.1259]}, {"w": "(for", "b": [0.7877, 0.1062, 0.8255, 0.1259]}, {"w": "example,", "b": [0.1294, 0.1267, 0.2212, 0.1464]}, {"w": "the", "b": [0.2275, 0.1267, 0.2583, 0.1464]}, {"w": "crime", "b": [0.2646, 0.1267, 0.3221, 0.1464]}, {"w": "rate)", "b": [0.3284, 0.1267, 0.3746, 0.1464]}, {"w": "has", "b": [0.3809, 0.1267, 0.4145, 0.1464]}, {"w": "a", "b": [0.4208, 0.1267, 0.432, 0.1464]}, {"w": "different", "b": [0.4383, 0.1267, 0.5247, 0.1464]}, {"w": "scale.", "b": [0.531, 0.1267, 0.5877, 0.1464]}, {"w": "For", "b": [0.594, 0.1267, 0.629, 0.1464]}, {"w": "instance,", "b": [0.6354, 0.1267, 0.7243, 0.1464]}, {"w": "some", "b": [0.7306, 0.1267, 0.7839, 0.1464]}, {"w": "values", "b": [0.7902, 0.1267, 0.8546, 0.1464]}, {"w": "are", "b": [0.1294, 0.1472, 0.1602, 0.1669]}, {"w": "proportions,", "b": [0.1665, 0.1472, 0.2891, 0.1669]}, {"w": "which", "b": [0.2954, 0.1472, 0.3571, 0.1669]}, {"w": "take", "b": [0.3634, 0.1472, 0.4054, 0.1669]}, {"w": "values", "b": [0.4117, 0.1472, 0.4762, 0.1669]}, {"w": "between", "b": [0.4825, 0.1472, 0.5665, 0.1669]}, {"w": "0", "b": [0.5728, 0.1472, 0.5854, 0.1669]}, {"w": "and", "b": [0.5917, 0.1472, 0.6282, 0.1669]}, {"w": "1;", "b": [0.6345, 0.1472, 0.6541, 0.1669]}, {"w": "others", "b": [0.6604, 0.1472, 0.7221, 0.1669]}, {"w": "take", "b": [0.7284, 0.1472, 0.7704, 0.1669]}, {"w": "values", "b": [0.7767, 0.1472, 0.8411, 0.1669]}, {"w": "between", "b": [0.1294, 0.1677, 0.2135, 0.1874]}, {"w": "1", "b": [0.2198, 0.1677, 0.2324, 0.1874]}, {"w": "and", "b": [0.2387, 0.1677, 0.2751, 0.1874]}, {"w": "12,", "b": [0.2814, 0.1677, 0.313, 0.1874]}, {"w": "others", "b": [0.3193, 0.1677, 0.3809, 0.1874]}, {"w": "between", "b": [0.3872, 0.1677, 0.4713, 0.1874]}, {"w": "0", "b": [0.4776, 0.1677, 0.4902, 0.1874]}, {"w": "and", "b": [0.4965, 0.1677, 0.5329, 0.1874]}, {"w": "100,", "b": [0.5392, 0.1677, 0.5834, 0.1874]}, {"w": "and", "b": [0.5897, 0.1677, 0.6261, 0.1874]}, {"w": "so", "b": [0.6324, 0.1677, 0.6548, 0.1874]}, {"w": "on.", "b": [0.6611, 0.1677, 0.6927, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.24. Loading the Boston housing dataset", "words": [{"w": "Listing", "b": [0.1294, 0.2055, 0.1862, 0.2203]}, {"w": "3.24.", "b": [0.1909, 0.2055, 0.2288, 0.2203]}, {"w": "Loading", "b": [0.2335, 0.2055, 0.3008, 0.2203]}, {"w": "the", "b": [0.3055, 0.2055, 0.3307, 0.2203]}, {"w": "Boston", "b": [0.3354, 0.2055, 0.3912, 0.2203]}, {"w": "housing", "b": [0.3959, 0.2055, 0.459, 0.2203]}, {"w": "dataset", "b": [0.4637, 0.2055, 0.5215, 0.2203]}]}, {"id": "b_2", "type": "paragraph", "text": "from keras.datasets import boston_housing (train_data, train_targets), (test_data, test_targets) =", "words": [{"w": "from", "b": [0.1357, 0.2339, 0.1811, 0.2491]}, {"w": "keras.datasets", "b": [0.1925, 0.2339, 0.3514, 0.2491]}, {"w": "import", "b": [0.3628, 0.2339, 0.4309, 0.2491]}, {"w": "boston_housing", "b": [0.4422, 0.2339, 0.6011, 0.2491]}, {"w": "(train_data,", "b": [0.1357, 0.2642, 0.2719, 0.2794]}, {"w": "train_targets),", "b": [0.2833, 0.2642, 0.4536, 0.2794]}, {"w": "(test_data,", "b": [0.4649, 0.2642, 0.5898, 0.2794]}, {"w": "test_targets)", "b": [0.6011, 0.2642, 0.7487, 0.2794]}, {"w": "=", "b": [0.7601, 0.2642, 0.7714, 0.2794]}]}, {"id": "b_3", "type": "equation", "text": "boston_housing.load_data()", "words": [{"w": "boston_housing.load_data()", "b": [0.1647, 0.2812, 0.4599, 0.2963]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s look at the data:", "words": [{"w": "Let’s", "b": [0.1294, 0.3192, 0.1798, 0.3389]}, {"w": "look", "b": [0.1862, 0.3192, 0.231, 0.3389]}, {"w": "at", "b": [0.2373, 0.3192, 0.2555, 0.3389]}, {"w": "the", "b": [0.2618, 0.3192, 0.2927, 0.3389]}, {"w": "data:", "b": [0.299, 0.3192, 0.348, 0.3389]}]}, {"id": "b_5", "type": "equation", "text": ">>> train_data.shape (404, 13) >>> test_data.shape (102, 13)", "words": [{"w": ">>>", "b": [0.1357, 0.3569, 0.1698, 0.3721]}, {"w": "train_data.shape", "b": [0.1811, 0.3569, 0.3628, 0.3721]}, {"w": "(404,", "b": [0.1357, 0.3721, 0.1925, 0.3872]}, {"w": "13)", "b": [0.2038, 0.3721, 0.2379, 0.3872]}, {"w": ">>>", "b": [0.1357, 0.3872, 0.1698, 0.4024]}, {"w": "test_data.shape", "b": [0.1811, 0.3872, 0.3514, 0.4024]}, {"w": "(102,", "b": [0.1357, 0.4024, 0.1925, 0.4175]}, {"w": "13)", "b": [0.2038, 0.4024, 0.2379, 0.4175]}]}, {"id": "b_6", "type": "paragraph", "text": "As you can see, you have 404 training samples and 102 test samples, each with 13 numerical features, such as per capita crime rate, average number of rooms per dwelling, accessibility to highways, and so on.", "words": [{"w": "As", "b": [0.1294, 0.4404, 0.1574, 0.4602]}, {"w": "you", "b": [0.1637, 0.4404, 0.2016, 0.4602]}, {"w": "can", "b": [0.2079, 0.4404, 0.2429, 0.4602]}, {"w": "see,", "b": [0.2492, 0.4404, 0.2877, 0.4602]}, {"w": "you", "b": [0.294, 0.4404, 0.3319, 0.4602]}, {"w": "have", "b": [0.3382, 0.4404, 0.3858, 0.4602]}, {"w": "404", "b": [0.3921, 0.4404, 0.43, 0.4602]}, {"w": "training", "b": [0.4363, 0.4404, 0.5147, 0.4602]}, {"w": "samples", "b": [0.521, 0.4404, 0.6023, 0.4602]}, {"w": "and", "b": [0.6086, 0.4404, 0.6451, 0.4602]}, {"w": "102", "b": [0.6514, 0.4404, 0.6892, 0.4602]}, {"w": "test", "b": [0.6955, 0.4404, 0.7305, 0.4602]}, {"w": "samples,", "b": [0.7368, 0.4404, 0.8244, 0.4602]}, {"w": "each", "b": [0.1294, 0.4609, 0.1756, 0.4807]}, {"w": "with", "b": [0.1819, 0.4609, 0.2268, 0.4807]}, {"w": "13", "b": [0.2331, 0.4609, 0.2583, 0.4807]}, {"w": "numerical", "b": [0.2646, 0.4609, 0.3655, 0.4807]}, {"w": "features,", "b": [0.3718, 0.4609, 0.458, 0.4807]}, {"w": "such", "b": [0.4643, 0.4609, 0.5105, 0.4807]}, {"w": "as", "b": [0.5168, 0.4609, 0.5378, 0.4807]}, {"w": "per", "b": [0.5441, 0.4609, 0.5763, 0.4807]}, {"w": "capita", "b": [0.5826, 0.4609, 0.6429, 0.4807]}, {"w": "crime", "b": [0.6492, 0.4609, 0.7066, 0.4807]}, {"w": "rate,", "b": [0.7128, 0.4609, 0.757, 0.4807]}, {"w": "average", "b": [0.7633, 0.4609, 0.8417, 0.4807]}, {"w": "number", "b": [0.1294, 0.4814, 0.2065, 0.5012]}, {"w": "of", "b": [0.2128, 0.4814, 0.2338, 0.5012]}, {"w": "rooms", "b": [0.2401, 0.4814, 0.3032, 0.5012]}, {"w": "per", "b": [0.3095, 0.4814, 0.3417, 0.5012]}, {"w": "dwelling,", "b": [0.348, 0.4814, 0.4426, 0.5012]}, {"w": "accessibility", "b": [0.4489, 0.4814, 0.5736, 0.5012]}, {"w": "to", "b": [0.5799, 0.4814, 0.5995, 0.5012]}, {"w": "highways,", "b": [0.6059, 0.4814, 0.7088, 0.5012]}, {"w": "and", "b": [0.7152, 0.4814, 0.7516, 0.5012]}, {"w": "so", "b": [0.7579, 0.4814, 0.7803, 0.5012]}, {"w": "on.", "b": [0.7866, 0.4814, 0.8182, 0.5012]}]}, {"id": "b_7", "type": "paragraph", "text": "The targets are the median values of owner-occupied homes, in thousands of dollars:", "words": [{"w": "The", "b": [0.1294, 0.5242, 0.1686, 0.5439]}, {"w": "targets", "b": [0.1749, 0.5242, 0.2417, 0.5439]}, {"w": "are", "b": [0.248, 0.5242, 0.2788, 0.5439]}, {"w": "the", "b": [0.2851, 0.5242, 0.316, 0.5439]}, {"w": "median", "b": [0.3223, 0.5242, 0.3965, 0.5439]}, {"w": "values", "b": [0.4028, 0.5242, 0.4673, 0.5439]}, {"w": "of", "b": [0.4736, 0.5242, 0.4946, 0.5439]}, {"w": "owner-occupied", "b": [0.5009, 0.5242, 0.6629, 0.5439]}, {"w": "homes,", "b": [0.6692, 0.5242, 0.7414, 0.5439]}, {"w": "in", "b": [0.7477, 0.5242, 0.7673, 0.5439]}, {"w": "thousands", "b": [0.1294, 0.5447, 0.2303, 0.5644]}, {"w": "of", "b": [0.2366, 0.5447, 0.2576, 0.5644]}, {"w": "dollars:", "b": [0.2639, 0.5447, 0.3396, 0.5644]}]}, {"id": "b_8", "type": "equation", "text": ">>> train_targets [ 15.2, 42.3, 50. ... 19.4, 19.4, 29.1]", "words": [{"w": ">>>", "b": [0.1357, 0.5824, 0.1698, 0.5976]}, {"w": "train_targets", "b": [0.1811, 0.5824, 0.3287, 0.5976]}, {"w": "[", "b": [0.1357, 0.5976, 0.1471, 0.6127]}, {"w": "15.2,", "b": [0.1584, 0.5976, 0.2152, 0.6127]}, {"w": "42.3,", "b": [0.2379, 0.5976, 0.2946, 0.6127]}, {"w": "50.", "b": [0.3173, 0.5976, 0.3514, 0.6127]}, {"w": "...", "b": [0.3628, 0.5976, 0.3968, 0.6127]}, {"w": "19.4,", "b": [0.4195, 0.5976, 0.4763, 0.6127]}, {"w": "19.4,", "b": [0.499, 0.5976, 0.5557, 0.6127]}, {"w": "29.1]", "b": [0.5784, 0.5976, 0.6352, 0.6127]}]}, {"id": "b_9", "type": "paragraph", "text": "The prices are typically between $10,000 and $50,000. If that sounds cheap, remember that this was the mid-1970s, and these prices aren’t adjusted for inflation.", "words": [{"w": "The", "b": [0.1294, 0.6356, 0.1686, 0.6554]}, {"w": "prices", "b": [0.1749, 0.6356, 0.2352, 0.6554]}, {"w": "are", "b": [0.2415, 0.6356, 0.2723, 0.6554]}, {"w": "typically", "b": [0.2786, 0.6356, 0.3669, 0.6554]}, {"w": "between", "b": [0.3732, 0.6356, 0.4572, 0.6554]}, {"w": "$10,000", "b": [0.4636, 0.6356, 0.5455, 0.6554]}, {"w": "and", "b": [0.5518, 0.6356, 0.5883, 0.6554]}, {"w": "$50,000.", "b": [0.5946, 0.6356, 0.6829, 0.6554]}, {"w": "If", "b": [0.6892, 0.6356, 0.706, 0.6554]}, {"w": "that", "b": [0.7123, 0.6356, 0.7501, 0.6554]}, {"w": "sounds", "b": [0.7564, 0.6356, 0.8265, 0.6554]}, {"w": "cheap,", "b": [0.1294, 0.6561, 0.1945, 0.6759]}, {"w": "remember", "b": [0.2009, 0.6561, 0.3031, 0.6759]}, {"w": "that", "b": [0.3094, 0.6561, 0.3473, 0.6759]}, {"w": "this", "b": [0.3536, 0.6561, 0.39, 0.6759]}, {"w": "was", "b": [0.3963, 0.6561, 0.4356, 0.6759]}, {"w": "the", "b": [0.4419, 0.6561, 0.4727, 0.6759]}, {"w": "mid-1970s,", "b": [0.479, 0.6561, 0.5932, 0.6759]}, {"w": "and", "b": [0.5995, 0.6561, 0.6359, 0.6759]}, {"w": "these", "b": [0.6423, 0.6561, 0.6941, 0.6759]}, {"w": "prices", "b": [0.7003, 0.6561, 0.7606, 0.6759]}, {"w": "aren’t", "b": [0.7669, 0.6561, 0.8252, 0.6759]}, {"w": "adjusted", "b": [0.1294, 0.6766, 0.2135, 0.6964]}, {"w": "for", "b": [0.2198, 0.6766, 0.2492, 0.6964]}, {"w": "inflation.", "b": [0.2555, 0.6766, 0.3473, 0.6964]}]}, {"id": "b_10", "type": "paragraph", "text": "3.6.2. Preparing the data", "words": [{"w": "3.6.2.", "b": [0.1294, 0.7239, 0.1862, 0.7436]}, {"w": "Preparing", "b": [0.1925, 0.7239, 0.3013, 0.7436]}, {"w": "the", "b": [0.3076, 0.7239, 0.3412, 0.7436]}, {"w": "data", "b": [0.3476, 0.7239, 0.3952, 0.7436]}]}, {"id": "b_11", "type": "paragraph", "text": "It would be problematic to feed into a neural network values that all take wildly different ranges. The network might be able to automatically adapt to such heterogeneous data, but it would definitely make learning more difficult. A widespread best practice to deal with such data is to do feature-wise normalization: for each feature in the input data (a column in the input data matrix), you subtract the mean of the feature and divide", "words": [{"w": "It", "b": [0.1294, 0.7666, 0.1448, 0.7864]}, {"w": "would", "b": [0.1511, 0.7666, 0.2142, 0.7864]}, {"w": "be", "b": [0.2205, 0.7666, 0.2443, 0.7864]}, {"w": "problematic", "b": [0.2506, 0.7666, 0.3711, 0.7864]}, {"w": "to", "b": [0.3774, 0.7666, 0.3971, 0.7864]}, {"w": "feed", "b": [0.4034, 0.7666, 0.4468, 0.7864]}, {"w": "into", "b": [0.4531, 0.7666, 0.4923, 0.7864]}, {"w": "a", "b": [0.4986, 0.7666, 0.5098, 0.7864]}, {"w": "neural", "b": [0.5161, 0.7666, 0.5792, 0.7864]}, {"w": "network", "b": [0.5855, 0.7666, 0.6682, 0.7864]}, {"w": "values", "b": [0.6745, 0.7666, 0.7389, 0.7864]}, {"w": "that", "b": [0.7452, 0.7666, 0.7831, 0.7864]}, {"w": "all", "b": [0.7894, 0.7666, 0.8146, 0.7864]}, {"w": "take", "b": [0.8209, 0.7666, 0.8629, 0.7864]}, {"w": "wildly", "b": [0.1294, 0.7871, 0.1939, 0.8069]}, {"w": "different", "b": [0.2002, 0.7871, 0.2866, 0.8069]}, {"w": "ranges.", "b": [0.2929, 0.7871, 0.365, 0.8069]}, {"w": "The", "b": [0.3713, 0.7871, 0.4106, 0.8069]}, {"w": "network", "b": [0.4169, 0.7871, 0.4995, 0.8069]}, {"w": "might", "b": [0.5058, 0.7871, 0.5647, 0.8069]}, {"w": "be", "b": [0.571, 0.7871, 0.5948, 0.8069]}, {"w": "able", "b": [0.6011, 0.7871, 0.6432, 0.8069]}, {"w": "to", "b": [0.6494, 0.7871, 0.669, 0.8069]}, {"w": "automatically", "b": [0.6753, 0.7871, 0.8127, 0.8069]}, {"w": "adapt", "b": [0.1294, 0.8076, 0.1841, 0.8274]}, {"w": "to", "b": [0.1904, 0.8076, 0.21, 0.8274]}, {"w": "such", "b": [0.2163, 0.8076, 0.2625, 0.8274]}, {"w": "heterogeneous", "b": [0.2688, 0.8076, 0.4145, 0.8274]}, {"w": "data,", "b": [0.4208, 0.8076, 0.4692, 0.8274]}, {"w": "but", "b": [0.4755, 0.8076, 0.5077, 0.8274]}, {"w": "it", "b": [0.514, 0.8076, 0.5281, 0.8274]}, {"w": "would", "b": [0.5344, 0.8076, 0.5974, 0.8274]}, {"w": "definitely", "b": [0.6037, 0.8076, 0.7004, 0.8274]}, {"w": "make", "b": [0.7067, 0.8076, 0.7614, 0.8274]}, {"w": "learning", "b": [0.7677, 0.8076, 0.8503, 0.8274]}, {"w": "more", "b": [0.1294, 0.8281, 0.1813, 0.8479]}, {"w": "difficult.", "b": [0.1876, 0.8281, 0.2747, 0.8479]}, {"w": "A", "b": [0.281, 0.8281, 0.2992, 0.8479]}, {"w": "widespread", "b": [0.3055, 0.8281, 0.4204, 0.8479]}, {"w": "best", "b": [0.4267, 0.8281, 0.4673, 0.8479]}, {"w": "practice", "b": [0.4736, 0.8281, 0.5534, 0.8479]}, {"w": "to", "b": [0.5598, 0.8281, 0.5794, 0.8479]}, {"w": "deal", "b": [0.5857, 0.8281, 0.6277, 0.8479]}, {"w": "with", "b": [0.634, 0.8281, 0.6789, 0.8479]}, {"w": "such", "b": [0.6852, 0.8281, 0.7314, 0.8479]}, {"w": "data", "b": [0.7377, 0.8281, 0.7797, 0.8479]}, {"w": "is", "b": [0.7861, 0.8281, 0.8029, 0.8479]}, {"w": "to", "b": [0.8092, 0.8281, 0.8288, 0.8479]}, {"w": "do", "b": [0.8351, 0.8281, 0.8603, 0.8479]}, {"w": "feature-wise", "b": [0.1294, 0.8486, 0.2541, 0.8684]}, {"w": "normalization:", "b": [0.2604, 0.8486, 0.4075, 0.8684]}, {"w": "for", "b": [0.4138, 0.8486, 0.4432, 0.8684]}, {"w": "each", "b": [0.4496, 0.8486, 0.4958, 0.8684]}, {"w": "feature", "b": [0.5021, 0.8486, 0.5721, 0.8684]}, {"w": "in", "b": [0.5784, 0.8486, 0.598, 0.8684]}, {"w": "the", "b": [0.6043, 0.8486, 0.6352, 0.8684]}, {"w": "input", "b": [0.6415, 0.8486, 0.6933, 0.8684]}, {"w": "data", "b": [0.6996, 0.8486, 0.7417, 0.8684]}, {"w": "(a", "b": [0.748, 0.8486, 0.7676, 0.8684]}, {"w": "column", "b": [0.7739, 0.8486, 0.8496, 0.8684]}, {"w": "in", "b": [0.1294, 0.8691, 0.149, 0.8889]}, {"w": "the", "b": [0.1553, 0.8691, 0.1862, 0.8889]}, {"w": "input", "b": [0.1925, 0.8691, 0.2443, 0.8889]}, {"w": "data", "b": [0.2506, 0.8691, 0.2926, 0.8889]}, {"w": "matrix),", "b": [0.2989, 0.8691, 0.3795, 0.8889]}, {"w": "you", "b": [0.3858, 0.8691, 0.4237, 0.8889]}, {"w": "subtract", "b": [0.43, 0.8691, 0.5098, 0.8889]}, {"w": "the", "b": [0.5161, 0.8691, 0.547, 0.8889]}, {"w": "mean", "b": [0.5533, 0.8691, 0.6079, 0.8889]}, {"w": "of", "b": [0.6142, 0.8691, 0.6352, 0.8889]}, {"w": "the", "b": [0.6415, 0.8691, 0.6724, 0.8889]}, {"w": "feature", "b": [0.6787, 0.8691, 0.7487, 0.8889]}, {"w": "and", "b": [0.755, 0.8691, 0.7914, 0.8889]}, {"w": "divide", "b": [0.7977, 0.8691, 0.8608, 0.8889]}]}]}, {"page": 131, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "by the standard deviation, so that the feature is centered around 0 and has a unit standard deviation. This is easily done in Numpy.", "words": [{"w": "by", "b": [0.1294, 0.0857, 0.1546, 0.1054]}, {"w": "the", "b": [0.1609, 0.0857, 0.1918, 0.1054]}, {"w": "standard", "b": [0.1981, 0.0857, 0.2835, 0.1054]}, {"w": "deviation,", "b": [0.2898, 0.0857, 0.39, 0.1054]}, {"w": "so", "b": [0.3964, 0.0857, 0.4188, 0.1054]}, {"w": "that", "b": [0.4251, 0.0857, 0.4629, 0.1054]}, {"w": "the", "b": [0.4692, 0.0857, 0.5001, 0.1054]}, {"w": "feature", "b": [0.5064, 0.0857, 0.5764, 0.1054]}, {"w": "is", "b": [0.5827, 0.0857, 0.5995, 0.1054]}, {"w": "centered", "b": [0.6058, 0.0857, 0.6913, 0.1054]}, {"w": "around", "b": [0.6976, 0.0857, 0.7676, 0.1054]}, {"w": "0", "b": [0.7738, 0.0857, 0.7864, 0.1054]}, {"w": "and", "b": [0.7928, 0.0857, 0.8292, 0.1054]}, {"w": "has", "b": [0.8355, 0.0857, 0.8691, 0.1054]}, {"w": "a", "b": [0.1294, 0.1062, 0.1406, 0.1259]}, {"w": "unit", "b": [0.1469, 0.1062, 0.1862, 0.1259]}, {"w": "standard", "b": [0.1925, 0.1062, 0.2779, 0.1259]}, {"w": "deviation.", "b": [0.2842, 0.1062, 0.3844, 0.1259]}, {"w": "This", "b": [0.3908, 0.1062, 0.4356, 0.1259]}, {"w": "is", "b": [0.4419, 0.1062, 0.4587, 0.1259]}, {"w": "easily", "b": [0.465, 0.1062, 0.5239, 0.1259]}, {"w": "done", "b": [0.5302, 0.1062, 0.5792, 0.1259]}, {"w": "in", "b": [0.5855, 0.1062, 0.6052, 0.1259]}, {"w": "Numpy.", "b": [0.6115, 0.1062, 0.6918, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.25. Normalizing the data", "words": [{"w": "Listing", "b": [0.1294, 0.144, 0.1862, 0.1588]}, {"w": "3.25.", "b": [0.1909, 0.144, 0.2288, 0.1588]}, {"w": "Normalizing", "b": [0.2335, 0.144, 0.3344, 0.1588]}, {"w": "the", "b": [0.3391, 0.144, 0.3643, 0.1588]}, {"w": "data", "b": [0.369, 0.144, 0.4048, 0.1588]}]}, {"id": "b_2", "type": "paragraph", "text": "mean = train_data.mean(axis=0) train_data -= mean std = train_data.std(axis=0) train_data /= std test_data -= mean test_data /= std", "words": [{"w": "mean", "b": [0.1357, 0.1724, 0.1811, 0.1876]}, {"w": "=", "b": [0.1925, 0.1724, 0.2038, 0.1876]}, {"w": "train_data.mean(axis=0)", "b": [0.2152, 0.1724, 0.4763, 0.1876]}, {"w": "train_data", "b": [0.1357, 0.1876, 0.2492, 0.2027]}, {"w": "-=", "b": [0.2606, 0.1876, 0.2833, 0.2027]}, {"w": "mean", "b": [0.2946, 0.1876, 0.34, 0.2027]}, {"w": "std", "b": [0.1357, 0.2027, 0.1698, 0.2179]}, {"w": "=", "b": [0.1811, 0.2027, 0.1925, 0.2179]}, {"w": "train_data.std(axis=0)", "b": [0.2038, 0.2027, 0.4536, 0.2179]}, {"w": "train_data", "b": [0.1357, 0.2179, 0.2492, 0.233]}, {"w": "/=", "b": [0.2606, 0.2179, 0.2833, 0.233]}, {"w": "std", "b": [0.2946, 0.2179, 0.3287, 0.233]}, {"w": "test_data", "b": [0.1357, 0.2482, 0.2379, 0.2633]}, {"w": "-=", "b": [0.2492, 0.2482, 0.2719, 0.2633]}, {"w": "mean", "b": [0.2833, 0.2482, 0.3287, 0.2633]}, {"w": "test_data", "b": [0.1357, 0.2633, 0.2379, 0.2785]}, {"w": "/=", "b": [0.2492, 0.2633, 0.2719, 0.2785]}, {"w": "std", "b": [0.2833, 0.2633, 0.3173, 0.2785]}]}, {"id": "b_3", "type": "paragraph", "text": "Note that the quantities used for normalizing the test data are computed using the training data. You should never use in your workflow any quantity computed on the test data, even for something as simple as data normalization.", "words": [{"w": "Note", "b": [0.1294, 0.3014, 0.1785, 0.3211]}, {"w": "that", "b": [0.1848, 0.3014, 0.2226, 0.3211]}, {"w": "the", "b": [0.2289, 0.3014, 0.2597, 0.3211]}, {"w": "quantities", "b": [0.266, 0.3014, 0.3641, 0.3211]}, {"w": "used", "b": [0.3704, 0.3014, 0.4167, 0.3211]}, {"w": "for", "b": [0.423, 0.3014, 0.4524, 0.3211]}, {"w": "normalizing", "b": [0.4587, 0.3014, 0.5806, 0.3211]}, {"w": "the", "b": [0.5869, 0.3014, 0.6178, 0.3211]}, {"w": "test", "b": [0.6241, 0.3014, 0.6591, 0.3211]}, {"w": "data", "b": [0.6654, 0.3014, 0.7074, 0.3211]}, {"w": "are", "b": [0.7137, 0.3014, 0.7445, 0.3211]}, {"w": "computed", "b": [0.7508, 0.3014, 0.8503, 0.3211]}, {"w": "using", "b": [0.1294, 0.3219, 0.1841, 0.3416]}, {"w": "the", "b": [0.1904, 0.3219, 0.2212, 0.3416]}, {"w": "training", "b": [0.2275, 0.3219, 0.306, 0.3416]}, {"w": "data.", "b": [0.3123, 0.3219, 0.3606, 0.3416]}, {"w": "You", "b": [0.3669, 0.3219, 0.4078, 0.3416]}, {"w": "should", "b": [0.4141, 0.3219, 0.4814, 0.3416]}, {"w": "never", "b": [0.4877, 0.3219, 0.5437, 0.3416]}, {"w": "use", "b": [0.55, 0.3219, 0.5837, 0.3416]}, {"w": "in", "b": [0.59, 0.3219, 0.6096, 0.3416]}, {"w": "your", "b": [0.6159, 0.3219, 0.6621, 0.3416]}, {"w": "workflow", "b": [0.6684, 0.3219, 0.7665, 0.3416]}, {"w": "any", "b": [0.7728, 0.3219, 0.8093, 0.3416]}, {"w": "quantity", "b": [0.1294, 0.3424, 0.2121, 0.3621]}, {"w": "computed", "b": [0.2184, 0.3424, 0.3179, 0.3621]}, {"w": "on", "b": [0.3242, 0.3424, 0.3494, 0.3621]}, {"w": "the", "b": [0.3557, 0.3424, 0.3866, 0.3621]}, {"w": "test", "b": [0.3929, 0.3424, 0.4279, 0.3621]}, {"w": "data,", "b": [0.4342, 0.3424, 0.4825, 0.3621]}, {"w": "even", "b": [0.4889, 0.3424, 0.5365, 0.3621]}, {"w": "for", "b": [0.5428, 0.3424, 0.5722, 0.3621]}, {"w": "something", "b": [0.5785, 0.3424, 0.6836, 0.3621]}, {"w": "as", "b": [0.6899, 0.3424, 0.7109, 0.3621]}, {"w": "simple", "b": [0.7172, 0.3424, 0.7845, 0.3621]}, {"w": "as", "b": [0.7908, 0.3424, 0.8118, 0.3621]}, {"w": "data", "b": [0.8182, 0.3424, 0.8602, 0.3621]}, {"w": "normalization.", "b": [0.1294, 0.3629, 0.2758, 0.3826]}]}, {"id": "b_4", "type": "paragraph", "text": "3.6.3. Building your network", "words": [{"w": "3.6.3.", "b": [0.1294, 0.4101, 0.1862, 0.4299]}, {"w": "Building", "b": [0.1925, 0.4101, 0.285, 0.4299]}, {"w": "your", "b": [0.2913, 0.4101, 0.3418, 0.4299]}, {"w": "network", "b": [0.3481, 0.4101, 0.4378, 0.4299]}]}, {"id": "b_5", "type": "paragraph", "text": "Because so few samples are available, you’ll use a very small network with two hidden layers, each with 64 units. In general, the less training data you have, the worse overfitting will be, and using a small network is one way to mitigate overfitting.", "words": [{"w": "Because", "b": [0.1294, 0.4529, 0.2135, 0.4726]}, {"w": "so", "b": [0.2198, 0.4529, 0.2422, 0.4726]}, {"w": "few", "b": [0.2485, 0.4529, 0.2863, 0.4726]}, {"w": "samples", "b": [0.2926, 0.4529, 0.3739, 0.4726]}, {"w": "are", "b": [0.3802, 0.4529, 0.411, 0.4726]}, {"w": "available,", "b": [0.4173, 0.4529, 0.5147, 0.4726]}, {"w": "you’ll", "b": [0.521, 0.4529, 0.5813, 0.4726]}, {"w": "use", "b": [0.5876, 0.4529, 0.6212, 0.4726]}, {"w": "a", "b": [0.6275, 0.4529, 0.6387, 0.4726]}, {"w": "very", "b": [0.645, 0.4529, 0.6898, 0.4726]}, {"w": "small", "b": [0.6961, 0.4529, 0.7508, 0.4726]}, {"w": "network", "b": [0.7571, 0.4529, 0.8398, 0.4726]}, {"w": "with", "b": [0.1294, 0.4734, 0.1743, 0.4931]}, {"w": "two", "b": [0.1806, 0.4734, 0.2184, 0.4931]}, {"w": "hidden", "b": [0.2247, 0.4734, 0.2934, 0.4931]}, {"w": "layers,", "b": [0.2997, 0.4734, 0.3662, 0.4931]}, {"w": "each", "b": [0.3725, 0.4734, 0.4188, 0.4931]}, {"w": "with", "b": [0.4251, 0.4734, 0.4699, 0.4931]}, {"w": "64", "b": [0.4762, 0.4734, 0.5014, 0.4931]}, {"w": "units.", "b": [0.5077, 0.4734, 0.5631, 0.4931]}, {"w": "In", "b": [0.5694, 0.4734, 0.5904, 0.4931]}, {"w": "general,", "b": [0.5967, 0.4734, 0.6773, 0.4931]}, {"w": "the", "b": [0.6835, 0.4734, 0.7144, 0.4931]}, {"w": "less", "b": [0.7207, 0.4734, 0.7585, 0.4931]}, {"w": "training", "b": [0.7648, 0.4734, 0.8433, 0.4931]}, {"w": "data", "b": [0.1294, 0.4939, 0.1714, 0.5136]}, {"w": "you", "b": [0.1777, 0.4939, 0.2156, 0.5136]}, {"w": "have,", "b": [0.2219, 0.4939, 0.2758, 0.5136]}, {"w": "the", "b": [0.2821, 0.4939, 0.313, 0.5136]}, {"w": "worse", "b": [0.3193, 0.4939, 0.3795, 0.5136]}, {"w": "overfitting", "b": [0.3858, 0.4939, 0.4923, 0.5136]}, {"w": "will", "b": [0.4986, 0.4939, 0.5379, 0.5136]}, {"w": "be,", "b": [0.5442, 0.4939, 0.5743, 0.5136]}, {"w": "and", "b": [0.5806, 0.4939, 0.617, 0.5136]}, {"w": "using", "b": [0.6233, 0.4939, 0.678, 0.5136]}, {"w": "a", "b": [0.6843, 0.4939, 0.6955, 0.5136]}, {"w": "small", "b": [0.7018, 0.4939, 0.7565, 0.5136]}, {"w": "network", "b": [0.7628, 0.4939, 0.8454, 0.5136]}, {"w": "is", "b": [0.8518, 0.4939, 0.8686, 0.5136]}, {"w": "one", "b": [0.1294, 0.5144, 0.1658, 0.5341]}, {"w": "way", "b": [0.1721, 0.5144, 0.2142, 0.5341]}, {"w": "to", "b": [0.2205, 0.5144, 0.2401, 0.5341]}, {"w": "mitigate", "b": [0.2464, 0.5144, 0.3291, 0.5341]}, {"w": "overfitting.", "b": [0.3354, 0.5144, 0.4482, 0.5341]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 3.26. Model definition", "words": [{"w": "Listing", "b": [0.1294, 0.5522, 0.1862, 0.567]}, {"w": "3.26.", "b": [0.1909, 0.5522, 0.2288, 0.567]}, {"w": "Model", "b": [0.2335, 0.5522, 0.285, 0.567]}, {"w": "definition", "b": [0.2897, 0.5522, 0.3675, 0.567]}]}, {"id": "b_7", "type": "paragraph", "text": "from keras import models from keras import layers def build_model(): model = models.Sequential() 1 model.add(layers.Dense(64, activation='relu', input_shape=(train_data.shape[1],))) model.add(layers.Dense(64, activation='relu')) model.add(layers.Dense(1)) model.compile(optimizer='rmsprop', loss='mse', metrics= ['mae']) return model", "words": [{"w": "from", "b": [0.1357, 0.5807, 0.1811, 0.5958]}, {"w": "keras", "b": [0.1925, 0.5807, 0.2492, 0.5958]}, {"w": "import", "b": [0.2606, 0.5807, 0.3287, 0.5958]}, {"w": "models", "b": [0.34, 0.5807, 0.4082, 0.5958]}, {"w": "from", "b": [0.1357, 0.5958, 0.1811, 0.611]}, {"w": "keras", "b": [0.1925, 0.5958, 0.2492, 0.611]}, {"w": "import", "b": [0.2606, 0.5958, 0.3287, 0.611]}, {"w": "layers", "b": [0.34, 0.5958, 0.4082, 0.611]}, {"w": "def", "b": [0.1357, 0.6261, 0.1698, 0.6413]}, {"w": "build_model():", "b": [0.1811, 0.6261, 0.34, 0.6413]}, {"w": "model", "b": [0.1811, 0.6413, 0.2379, 0.6564]}, {"w": "=", "b": [0.2492, 0.6413, 0.2606, 0.6564]}, {"w": "models.Sequential()", "b": [0.2719, 0.6413, 0.4876, 0.6564]}, {"w": "1", "b": [0.1357, 0.6564, 0.1471, 0.6716]}, {"w": "model.add(layers.Dense(64,", "b": [0.1811, 0.6716, 0.4763, 0.6867]}, {"w": "activation='relu',", "b": [0.4876, 0.6716, 0.6919, 0.6867]}, {"w": "input_shape=(train_data.shape[1],)))", "b": [0.4422, 0.6867, 0.8509, 0.7019]}, {"w": "model.add(layers.Dense(64,", "b": [0.1811, 0.7019, 0.4763, 0.717]}, {"w": "activation='relu'))", "b": [0.4876, 0.7019, 0.7033, 0.717]}, {"w": "model.add(layers.Dense(1))", "b": [0.1811, 0.717, 0.4763, 0.7322]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1811, 0.7322, 0.5671, 0.7473]}, {"w": "loss='mse',", "b": [0.5784, 0.7322, 0.7033, 0.7473]}, {"w": "metrics=", "b": [0.7146, 0.7322, 0.8055, 0.7473]}, {"w": "['mae'])", "b": [0.1357, 0.7473, 0.2265, 0.7625]}, {"w": "return", "b": [0.1811, 0.7625, 0.2492, 0.7776]}, {"w": "model", "b": [0.2606, 0.7625, 0.3173, 0.7776]}]}, {"id": "b_8", "type": "paragraph", "text": "1 Because you’ll need to instantiate the same model multiple times, you use a function to construct it.", "words": [{"w": "1", "b": [0.1799, 0.7961, 0.1925, 0.8158]}, {"w": "Because", "b": [0.1988, 0.7961, 0.2857, 0.8158]}, {"w": "you’ll", "b": [0.292, 0.7961, 0.3536, 0.8158]}, {"w": "need", "b": [0.36, 0.7961, 0.4104, 0.8158]}, {"w": "to", "b": [0.4167, 0.7961, 0.4377, 0.8158]}, {"w": "instantiate", "b": [0.444, 0.7961, 0.5575, 0.8158]}, {"w": "the", "b": [0.5639, 0.7961, 0.5975, 0.8158]}, {"w": "same", "b": [0.6038, 0.7961, 0.6584, 0.8158]}, {"w": "model", "b": [0.6647, 0.7961, 0.7306, 0.8158]}, {"w": "multiple", "b": [0.7369, 0.7961, 0.8266, 0.8158]}, {"w": "times,", "b": [0.1799, 0.8166, 0.2436, 0.8363]}, {"w": "you", "b": [0.2499, 0.8166, 0.2892, 0.8363]}, {"w": "use", "b": [0.2955, 0.8166, 0.3305, 0.8363]}, {"w": "a", "b": [0.3368, 0.8166, 0.3494, 0.8363]}, {"w": "function", "b": [0.3557, 0.8166, 0.4454, 0.8363]}, {"w": "to", "b": [0.4517, 0.8166, 0.4728, 0.8363]}, {"w": "construct", "b": [0.4791, 0.8166, 0.5799, 0.8363]}, {"w": "it.", "b": [0.5863, 0.8166, 0.608, 0.8363]}]}, {"id": "b_9", "type": "paragraph", "text": "The network ends with a single unit and no activation (it will be a linear layer). This is a typical setup for scalar regression (a regression where", "words": [{"w": "The", "b": [0.1294, 0.8593, 0.1686, 0.8791]}, {"w": "network", "b": [0.1749, 0.8593, 0.2576, 0.8791]}, {"w": "ends", "b": [0.2639, 0.8593, 0.3102, 0.8791]}, {"w": "with", "b": [0.3165, 0.8593, 0.3613, 0.8791]}, {"w": "a", "b": [0.3676, 0.8593, 0.3788, 0.8791]}, {"w": "single", "b": [0.3851, 0.8593, 0.4454, 0.8791]}, {"w": "unit", "b": [0.4517, 0.8593, 0.4909, 0.8791]}, {"w": "and", "b": [0.4973, 0.8593, 0.5337, 0.8791]}, {"w": "no", "b": [0.54, 0.8593, 0.5652, 0.8791]}, {"w": "activation", "b": [0.5715, 0.8593, 0.671, 0.8791]}, {"w": "(it", "b": [0.6773, 0.8593, 0.6997, 0.8791]}, {"w": "will", "b": [0.706, 0.8593, 0.7453, 0.8791]}, {"w": "be", "b": [0.7516, 0.8593, 0.7754, 0.8791]}, {"w": "a", "b": [0.7817, 0.8593, 0.7929, 0.8791]}, {"w": "linear", "b": [0.7992, 0.8593, 0.8567, 0.8791]}, {"w": "layer).", "b": [0.1294, 0.8798, 0.1945, 0.8996]}, {"w": "This", "b": [0.2009, 0.8798, 0.2457, 0.8996]}, {"w": "is", "b": [0.252, 0.8798, 0.2688, 0.8996]}, {"w": "a", "b": [0.2751, 0.8798, 0.2863, 0.8996]}, {"w": "typical", "b": [0.2926, 0.8798, 0.3613, 0.8996]}, {"w": "setup", "b": [0.3676, 0.8798, 0.4209, 0.8996]}, {"w": "for", "b": [0.4272, 0.8798, 0.4566, 0.8996]}, {"w": "scalar", "b": [0.4629, 0.8798, 0.5217, 0.8996]}, {"w": "regression", "b": [0.528, 0.8798, 0.6317, 0.8996]}, {"w": "(a", "b": [0.6379, 0.8798, 0.6575, 0.8996]}, {"w": "regression", "b": [0.6639, 0.8798, 0.7675, 0.8996]}, {"w": "where", "b": [0.7738, 0.8798, 0.8355, 0.8996]}]}]}, {"page": 132, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "you’re trying to predict a single continuous value). Applying an activation function would constrain the range the output can take; for instance, if you applied a sigmoid activation function to the last layer, the network could only learn to predict values between 0 and 1. Here, because the last layer is purely linear, the network is free to learn to predict values in any range.", "words": [{"w": "you’re", "b": [0.1294, 0.0857, 0.1953, 0.1054]}, {"w": "trying", "b": [0.2016, 0.0857, 0.2618, 0.1054]}, {"w": "to", "b": [0.2681, 0.0857, 0.2878, 0.1054]}, {"w": "predict", "b": [0.2941, 0.0857, 0.3641, 0.1054]}, {"w": "a", "b": [0.3704, 0.0857, 0.3816, 0.1054]}, {"w": "single", "b": [0.3879, 0.0857, 0.4482, 0.1054]}, {"w": "continuous", "b": [0.4545, 0.0857, 0.5652, 0.1054]}, {"w": "value).", "b": [0.5715, 0.0857, 0.6409, 0.1054]}, {"w": "Applying", "b": [0.6472, 0.0857, 0.7425, 0.1054]}, {"w": "an", "b": [0.7488, 0.0857, 0.7726, 0.1054]}, {"w": "activation", "b": [0.1294, 0.1062, 0.2289, 0.1259]}, {"w": "function", "b": [0.2352, 0.1062, 0.3193, 0.1259]}, {"w": "would", "b": [0.3256, 0.1062, 0.3887, 0.1259]}, {"w": "constrain", "b": [0.395, 0.1062, 0.4874, 0.1259]}, {"w": "the", "b": [0.4937, 0.1062, 0.5246, 0.1259]}, {"w": "range", "b": [0.5308, 0.1062, 0.5868, 0.1259]}, {"w": "the", "b": [0.5931, 0.1062, 0.624, 0.1259]}, {"w": "output", "b": [0.6303, 0.1062, 0.6948, 0.1259]}, {"w": "can", "b": [0.7011, 0.1062, 0.7361, 0.1259]}, {"w": "take;", "b": [0.7424, 0.1062, 0.7914, 0.1259]}, {"w": "for", "b": [0.7977, 0.1062, 0.8271, 0.1259]}, {"w": "instance,", "b": [0.1294, 0.1267, 0.2184, 0.1464]}, {"w": "if", "b": [0.2247, 0.1267, 0.2401, 0.1464]}, {"w": "you", "b": [0.2464, 0.1267, 0.2842, 0.1464]}, {"w": "applied", "b": [0.2906, 0.1267, 0.3648, 0.1464]}, {"w": "a", "b": [0.3711, 0.1267, 0.3823, 0.1464]}, {"w": "sigmoid", "b": [0.3886, 0.1277, 0.4945, 0.1479]}, {"w": "activation", "b": [0.5008, 0.1267, 0.6003, 0.1464]}, {"w": "function", "b": [0.6066, 0.1267, 0.6907, 0.1464]}, {"w": "to", "b": [0.697, 0.1267, 0.7166, 0.1464]}, {"w": "the", "b": [0.723, 0.1267, 0.7538, 0.1464]}, {"w": "last", "b": [0.7601, 0.1267, 0.7951, 0.1464]}, {"w": "layer,", "b": [0.8014, 0.1267, 0.8571, 0.1464]}, {"w": "the", "b": [0.1294, 0.1481, 0.1602, 0.1678]}, {"w": "network", "b": [0.1665, 0.1481, 0.2492, 0.1678]}, {"w": "could", "b": [0.2555, 0.1481, 0.3116, 0.1678]}, {"w": "only", "b": [0.3179, 0.1481, 0.3627, 0.1678]}, {"w": "learn", "b": [0.369, 0.1481, 0.4195, 0.1678]}, {"w": "to", "b": [0.4258, 0.1481, 0.4454, 0.1678]}, {"w": "predict", "b": [0.4517, 0.1481, 0.5217, 0.1678]}, {"w": "values", "b": [0.5281, 0.1481, 0.5925, 0.1678]}, {"w": "between", "b": [0.5988, 0.1481, 0.6829, 0.1678]}, {"w": "0", "b": [0.6892, 0.1481, 0.7018, 0.1678]}, {"w": "and", "b": [0.7081, 0.1481, 0.7445, 0.1678]}, {"w": "1.", "b": [0.7508, 0.1481, 0.7697, 0.1678]}, {"w": "Here,", "b": [0.776, 0.1481, 0.8314, 0.1678]}, {"w": "because", "b": [0.1294, 0.1686, 0.2093, 0.1883]}, {"w": "the", "b": [0.2156, 0.1686, 0.2464, 0.1883]}, {"w": "last", "b": [0.2527, 0.1686, 0.2877, 0.1883]}, {"w": "layer", "b": [0.294, 0.1686, 0.3444, 0.1883]}, {"w": "is", "b": [0.3507, 0.1686, 0.3676, 0.1883]}, {"w": "purely", "b": [0.3739, 0.1686, 0.4383, 0.1883]}, {"w": "linear,", "b": [0.4446, 0.1686, 0.5073, 0.1883]}, {"w": "the", "b": [0.5136, 0.1686, 0.5445, 0.1883]}, {"w": "network", "b": [0.5508, 0.1686, 0.6334, 0.1883]}, {"w": "is", "b": [0.6397, 0.1686, 0.6566, 0.1883]}, {"w": "free", "b": [0.6629, 0.1686, 0.7021, 0.1883]}, {"w": "to", "b": [0.7084, 0.1686, 0.728, 0.1883]}, {"w": "learn", "b": [0.7343, 0.1686, 0.7847, 0.1883]}, {"w": "to", "b": [0.791, 0.1686, 0.8107, 0.1883]}, {"w": "predict", "b": [0.1294, 0.1891, 0.1995, 0.2088]}, {"w": "values", "b": [0.2058, 0.1891, 0.2702, 0.2088]}, {"w": "in", "b": [0.2765, 0.1891, 0.2962, 0.2088]}, {"w": "any", "b": [0.3025, 0.1891, 0.3389, 0.2088]}, {"w": "range.", "b": [0.3452, 0.1891, 0.4075, 0.2088]}]}, {"id": "b_1", "type": "paragraph", "text": "Note that you compile the network with the mse loss function—mean squared error, the square of the difference between the predictions and the targets. This is a widely used loss function for regression problems.", "words": [{"w": "Note", "b": [0.1294, 0.2319, 0.1785, 0.2516]}, {"w": "that", "b": [0.1848, 0.2319, 0.2226, 0.2516]}, {"w": "you", "b": [0.2289, 0.2319, 0.2667, 0.2516]}, {"w": "compile", "b": [0.273, 0.2319, 0.3543, 0.2516]}, {"w": "the", "b": [0.3606, 0.2319, 0.3915, 0.2516]}, {"w": "network", "b": [0.3978, 0.2319, 0.4804, 0.2516]}, {"w": "with", "b": [0.4867, 0.2319, 0.5316, 0.2516]}, {"w": "the", "b": [0.5379, 0.2319, 0.5687, 0.2516]}, {"w": "mse", "b": [0.575, 0.2329, 0.6204, 0.2531]}, {"w": "loss", "b": [0.6267, 0.2319, 0.6659, 0.2516]}, {"w": "function—mean", "b": [0.6722, 0.2319, 0.8362, 0.2516]}, {"w": "squared", "b": [0.1294, 0.2532, 0.2098, 0.273]}, {"w": "error,", "b": [0.2161, 0.2532, 0.2747, 0.273]}, {"w": "the", "b": [0.281, 0.2532, 0.3118, 0.273]}, {"w": "square", "b": [0.3181, 0.2532, 0.384, 0.273]}, {"w": "of", "b": [0.3903, 0.2532, 0.4113, 0.273]}, {"w": "the", "b": [0.4176, 0.2532, 0.4484, 0.273]}, {"w": "difference", "b": [0.4547, 0.2532, 0.5565, 0.273]}, {"w": "between", "b": [0.5628, 0.2532, 0.6468, 0.273]}, {"w": "the", "b": [0.6531, 0.2532, 0.684, 0.273]}, {"w": "predictions", "b": [0.6903, 0.2532, 0.8024, 0.273]}, {"w": "and", "b": [0.8087, 0.2532, 0.8451, 0.273]}, {"w": "the", "b": [0.1294, 0.2737, 0.1602, 0.2935]}, {"w": "targets.", "b": [0.1665, 0.2737, 0.2396, 0.2935]}, {"w": "This", "b": [0.2459, 0.2737, 0.2908, 0.2935]}, {"w": "is", "b": [0.2971, 0.2737, 0.3139, 0.2935]}, {"w": "a", "b": [0.3202, 0.2737, 0.3314, 0.2935]}, {"w": "widely", "b": [0.3377, 0.2737, 0.4064, 0.2935]}, {"w": "used", "b": [0.4127, 0.2737, 0.4589, 0.2935]}, {"w": "loss", "b": [0.4653, 0.2737, 0.5045, 0.2935]}, {"w": "function", "b": [0.5108, 0.2737, 0.5949, 0.2935]}, {"w": "for", "b": [0.6012, 0.2737, 0.6306, 0.2935]}, {"w": "regression", "b": [0.6369, 0.2737, 0.7406, 0.2935]}, {"w": "problems.", "b": [0.7469, 0.2737, 0.847, 0.2935]}]}, {"id": "b_2", "type": "paragraph", "text": "You’re also monitoring a new metric during training: mean absolute error (MAE). It’s the absolute value of the difference between the predictions and the targets. For instance, an MAE of 0.5 on this problem would mean your predictions are off by $500 on average.", "words": [{"w": "You’re", "b": [0.1294, 0.3165, 0.1983, 0.3363]}, {"w": "also", "b": [0.2046, 0.3165, 0.2453, 0.3363]}, {"w": "monitoring", "b": [0.2516, 0.3165, 0.3637, 0.3363]}, {"w": "a", "b": [0.37, 0.3165, 0.3812, 0.3363]}, {"w": "new", "b": [0.3875, 0.3165, 0.4295, 0.3363]}, {"w": "metric", "b": [0.4359, 0.3165, 0.5003, 0.3363]}, {"w": "during", "b": [0.5066, 0.3165, 0.5725, 0.3363]}, {"w": "training:", "b": [0.5788, 0.3165, 0.6643, 0.3363]}, {"w": "mean", "b": [0.6705, 0.3165, 0.7251, 0.3363]}, {"w": "absolute", "b": [0.7315, 0.3165, 0.8169, 0.3363]}, {"w": "error", "b": [0.1294, 0.337, 0.1817, 0.3568]}, {"w": "(MAE).", "b": [0.188, 0.337, 0.2672, 0.3568]}, {"w": "It’s", "b": [0.2735, 0.337, 0.3057, 0.3568]}, {"w": "the", "b": [0.312, 0.337, 0.3429, 0.3568]}, {"w": "absolute", "b": [0.3492, 0.337, 0.4333, 0.3568]}, {"w": "value", "b": [0.4396, 0.337, 0.4942, 0.3568]}, {"w": "of", "b": [0.5005, 0.337, 0.5215, 0.3568]}, {"w": "the", "b": [0.5278, 0.337, 0.5587, 0.3568]}, {"w": "difference", "b": [0.565, 0.337, 0.6667, 0.3568]}, {"w": "between", "b": [0.673, 0.337, 0.7571, 0.3568]}, {"w": "the", "b": [0.7634, 0.337, 0.7942, 0.3568]}, {"w": "predictions", "b": [0.1294, 0.3575, 0.2415, 0.3773]}, {"w": "and", "b": [0.2478, 0.3575, 0.2842, 0.3773]}, {"w": "the", "b": [0.2906, 0.3575, 0.3214, 0.3773]}, {"w": "targets.", "b": [0.3277, 0.3575, 0.4008, 0.3773]}, {"w": "For", "b": [0.4071, 0.3575, 0.4421, 0.3773]}, {"w": "instance,", "b": [0.4484, 0.3575, 0.5374, 0.3773]}, {"w": "an", "b": [0.5437, 0.3575, 0.5675, 0.3773]}, {"w": "MAE", "b": [0.5738, 0.3575, 0.6299, 0.3773]}, {"w": "of", "b": [0.6362, 0.3575, 0.6572, 0.3773]}, {"w": "0.5", "b": [0.6635, 0.3575, 0.695, 0.3773]}, {"w": "on", "b": [0.7013, 0.3575, 0.7265, 0.3773]}, {"w": "this", "b": [0.7328, 0.3575, 0.7693, 0.3773]}, {"w": "problem", "b": [0.7756, 0.3575, 0.8597, 0.3773]}, {"w": "would", "b": [0.1294, 0.378, 0.1925, 0.3978]}, {"w": "mean", "b": [0.1988, 0.378, 0.2534, 0.3978]}, {"w": "your", "b": [0.2597, 0.378, 0.306, 0.3978]}, {"w": "predictions", "b": [0.3123, 0.378, 0.4244, 0.3978]}, {"w": "are", "b": [0.4307, 0.378, 0.4615, 0.3978]}, {"w": "off", "b": [0.4678, 0.378, 0.4967, 0.3978]}, {"w": "by", "b": [0.503, 0.378, 0.5282, 0.3978]}, {"w": "$500", "b": [0.5346, 0.378, 0.585, 0.3978]}, {"w": "on", "b": [0.5913, 0.378, 0.6165, 0.3978]}, {"w": "average.", "b": [0.6228, 0.378, 0.7076, 0.3978]}]}, {"id": "b_3", "type": "equation", "text": "3.6.4. Validating your approach using K-fold validation", "words": [{"w": "3.6.4.", "b": [0.1294, 0.4253, 0.1862, 0.445]}, {"w": "Validating", "b": [0.1925, 0.4253, 0.3037, 0.445]}, {"w": "your", "b": [0.31, 0.4253, 0.3605, 0.445]}, {"w": "approach", "b": [0.3668, 0.4253, 0.4686, 0.445]}, {"w": "using", "b": [0.4749, 0.4253, 0.5324, 0.445]}, {"w": "K-fold", "b": [0.5387, 0.4253, 0.6088, 0.445]}, {"w": "validation", "b": [0.6151, 0.4253, 0.7231, 0.445]}]}, {"id": "b_4", "type": "paragraph", "text": "To evaluate your network while you keep adjusting its parameters (such as the number of epochs used for training), you could split the data into a training set and a validation set, as you did in the previous examples. But because you have so few data points, the validation set would end up being very small (for instance, about 100 examples). As a consequence, the validation scores might change a lot depending on which data points you chose to use for validation and which you chose for training: the validation scores might have a high variance with regard to the validation split. This would prevent you from reliably evaluating your model.", "words": [{"w": "To", "b": [0.1294, 0.4681, 0.1557, 0.4878]}, {"w": "evaluate", "b": [0.162, 0.4681, 0.246, 0.4878]}, {"w": "your", "b": [0.2523, 0.4681, 0.2986, 0.4878]}, {"w": "network", "b": [0.3049, 0.4681, 0.3875, 0.4878]}, {"w": "while", "b": [0.3939, 0.4681, 0.4499, 0.4878]}, {"w": "you", "b": [0.4562, 0.4681, 0.4941, 0.4878]}, {"w": "keep", "b": [0.5004, 0.4681, 0.548, 0.4878]}, {"w": "adjusting", "b": [0.5543, 0.4681, 0.6468, 0.4878]}, {"w": "its", "b": [0.6531, 0.4681, 0.6769, 0.4878]}, {"w": "parameters", "b": [0.6832, 0.4681, 0.7939, 0.4878]}, {"w": "(such", "b": [0.8002, 0.4681, 0.8549, 0.4878]}, {"w": "as", "b": [0.1294, 0.4886, 0.1504, 0.5083]}, {"w": "the", "b": [0.1567, 0.4886, 0.1876, 0.5083]}, {"w": "number", "b": [0.1939, 0.4886, 0.2709, 0.5083]}, {"w": "of", "b": [0.2772, 0.4886, 0.2982, 0.5083]}, {"w": "epochs", "b": [0.3046, 0.4886, 0.3746, 0.5083]}, {"w": "used", "b": [0.3809, 0.4886, 0.4272, 0.5083]}, {"w": "for", "b": [0.4335, 0.4886, 0.4629, 0.5083]}, {"w": "training),", "b": [0.4692, 0.4886, 0.5624, 0.5083]}, {"w": "you", "b": [0.5687, 0.4886, 0.6065, 0.5083]}, {"w": "could", "b": [0.6128, 0.4886, 0.6689, 0.5083]}, {"w": "split", "b": [0.6751, 0.4886, 0.7186, 0.5083]}, {"w": "the", "b": [0.7249, 0.4886, 0.7557, 0.5083]}, {"w": "data", "b": [0.762, 0.4886, 0.804, 0.5083]}, {"w": "into", "b": [0.8104, 0.4886, 0.8496, 0.5083]}, {"w": "a", "b": [0.8559, 0.4886, 0.8671, 0.5083]}, {"w": "training", "b": [0.1294, 0.5091, 0.2079, 0.5288]}, {"w": "set", "b": [0.2142, 0.5091, 0.2422, 0.5288]}, {"w": "and", "b": [0.2485, 0.5091, 0.285, 0.5288]}, {"w": "a", "b": [0.2913, 0.5091, 0.3025, 0.5288]}, {"w": "validation", "b": [0.3088, 0.5091, 0.4097, 0.5288]}, {"w": "set,", "b": [0.416, 0.5091, 0.4503, 0.5288]}, {"w": "as", "b": [0.4566, 0.5091, 0.4776, 0.5288]}, {"w": "you", "b": [0.4839, 0.5091, 0.5218, 0.5288]}, {"w": "did", "b": [0.5281, 0.5091, 0.5603, 0.5288]}, {"w": "in", "b": [0.5666, 0.5091, 0.5863, 0.5288]}, {"w": "the", "b": [0.5926, 0.5091, 0.6234, 0.5288]}, {"w": "previous", "b": [0.6297, 0.5091, 0.7166, 0.5288]}, {"w": "examples.", "b": [0.7229, 0.5091, 0.8245, 0.5288]}, {"w": "But", "b": [0.8308, 0.5091, 0.8672, 0.5288]}, {"w": "because", "b": [0.1294, 0.5296, 0.2093, 0.5493]}, {"w": "you", "b": [0.2156, 0.5296, 0.2534, 0.5493]}, {"w": "have", "b": [0.2597, 0.5296, 0.3073, 0.5493]}, {"w": "so", "b": [0.3136, 0.5296, 0.3361, 0.5493]}, {"w": "few", "b": [0.3424, 0.5296, 0.3802, 0.5493]}, {"w": "data", "b": [0.3865, 0.5296, 0.4285, 0.5493]}, {"w": "points,", "b": [0.4348, 0.5296, 0.5028, 0.5493]}, {"w": "the", "b": [0.5091, 0.5296, 0.5399, 0.5493]}, {"w": "validation", "b": [0.5462, 0.5296, 0.6471, 0.5493]}, {"w": "set", "b": [0.6534, 0.5296, 0.6814, 0.5493]}, {"w": "would", "b": [0.6878, 0.5296, 0.7508, 0.5493]}, {"w": "end", "b": [0.7571, 0.5296, 0.7936, 0.5493]}, {"w": "up", "b": [0.7999, 0.5296, 0.8251, 0.5493]}, {"w": "being", "b": [0.1294, 0.5501, 0.1855, 0.5698]}, {"w": "very", "b": [0.1918, 0.5501, 0.2366, 0.5698]}, {"w": "small", "b": [0.2429, 0.5501, 0.2976, 0.5698]}, {"w": "(for", "b": [0.3039, 0.5501, 0.3417, 0.5698]}, {"w": "instance,", "b": [0.348, 0.5501, 0.437, 0.5698]}, {"w": "about", "b": [0.4433, 0.5501, 0.4993, 0.5698]}, {"w": "100", "b": [0.5056, 0.5501, 0.5435, 0.5698]}, {"w": "examples).", "b": [0.5498, 0.5501, 0.6598, 0.5698]}, {"w": "As", "b": [0.6661, 0.5501, 0.6941, 0.5698]}, {"w": "a", "b": [0.7004, 0.5501, 0.7116, 0.5698]}, {"w": "consequence,", "b": [0.7179, 0.5501, 0.8531, 0.5698]}, {"w": "the", "b": [0.1294, 0.5706, 0.1602, 0.5903]}, {"w": "validation", "b": [0.1665, 0.5706, 0.2674, 0.5903]}, {"w": "scores", "b": [0.2737, 0.5706, 0.3368, 0.5903]}, {"w": "might", "b": [0.3431, 0.5706, 0.4019, 0.5903]}, {"w": "change", "b": [0.4082, 0.5706, 0.4797, 0.5903]}, {"w": "a", "b": [0.486, 0.5706, 0.4972, 0.5903]}, {"w": "lot", "b": [0.5035, 0.5706, 0.5301, 0.5903]}, {"w": "depending", "b": [0.5364, 0.5706, 0.6415, 0.5903]}, {"w": "on", "b": [0.6478, 0.5706, 0.6731, 0.5903]}, {"w": "which", "b": [0.6794, 0.5706, 0.741, 0.5903]}, {"w": "data", "b": [0.7473, 0.5706, 0.7894, 0.5903]}, {"w": "points", "b": [0.7957, 0.5706, 0.8573, 0.5903]}, {"w": "you", "b": [0.1294, 0.5911, 0.1673, 0.6108]}, {"w": "chose", "b": [0.1736, 0.5911, 0.231, 0.6108]}, {"w": "to", "b": [0.2373, 0.5911, 0.2569, 0.6108]}, {"w": "use", "b": [0.2632, 0.5911, 0.2969, 0.6108]}, {"w": "for", "b": [0.3032, 0.5911, 0.3326, 0.6108]}, {"w": "validation", "b": [0.3389, 0.5911, 0.4398, 0.6108]}, {"w": "and", "b": [0.4461, 0.5911, 0.4825, 0.6108]}, {"w": "which", "b": [0.4888, 0.5911, 0.5505, 0.6108]}, {"w": "you", "b": [0.5568, 0.5911, 0.5946, 0.6108]}, {"w": "chose", "b": [0.6009, 0.5911, 0.6584, 0.6108]}, {"w": "for", "b": [0.6647, 0.5911, 0.6941, 0.6108]}, {"w": "training:", "b": [0.7004, 0.5911, 0.7859, 0.6108]}, {"w": "the", "b": [0.7921, 0.5911, 0.8229, 0.6108]}, {"w": "validation", "b": [0.1294, 0.6116, 0.2303, 0.6313]}, {"w": "scores", "b": [0.2366, 0.6116, 0.2997, 0.6313]}, {"w": "might", "b": [0.306, 0.6116, 0.3648, 0.6313]}, {"w": "have", "b": [0.3712, 0.6116, 0.4188, 0.6313]}, {"w": "a", "b": [0.4251, 0.6116, 0.4363, 0.6313]}, {"w": "high", "b": [0.4426, 0.6116, 0.4874, 0.6313]}, {"w": "variance", "b": [0.4937, 0.6116, 0.582, 0.6313]}, {"w": "with", "b": [0.5882, 0.6116, 0.6331, 0.6313]}, {"w": "regard", "b": [0.6394, 0.6116, 0.7038, 0.6313]}, {"w": "to", "b": [0.7101, 0.6116, 0.7298, 0.6313]}, {"w": "the", "b": [0.7361, 0.6116, 0.7669, 0.6313]}, {"w": "validation", "b": [0.1294, 0.6321, 0.2303, 0.6518]}, {"w": "split.", "b": [0.2366, 0.6321, 0.2864, 0.6518]}, {"w": "This", "b": [0.2927, 0.6321, 0.3375, 0.6518]}, {"w": "would", "b": [0.3439, 0.6321, 0.4069, 0.6518]}, {"w": "prevent", "b": [0.4132, 0.6321, 0.4889, 0.6518]}, {"w": "you", "b": [0.4952, 0.6321, 0.533, 0.6518]}, {"w": "from", "b": [0.5393, 0.6321, 0.5884, 0.6518]}, {"w": "reliably", "b": [0.5947, 0.6321, 0.6717, 0.6518]}, {"w": "evaluating", "b": [0.678, 0.6321, 0.7831, 0.6518]}, {"w": "your", "b": [0.7894, 0.6321, 0.8357, 0.6518]}, {"w": "model.", "b": [0.1294, 0.6526, 0.1988, 0.6723]}]}, {"id": "b_5", "type": "paragraph", "text": "The best practice in such situations is to use K-fold cross-validation (see figure 3.11). It consists of splitting the available data into K partitions (typically K = 4 or 5), instantiating K identical models, and training each one on K – 1 partitions while evaluating on the remaining partition. The validation score for the model used is then the average of the K validation scores obtained. In terms of code, this is straightforward.", "words": [{"w": "The", "b": [0.1294, 0.6953, 0.1686, 0.7151]}, {"w": "best", "b": [0.1749, 0.6953, 0.2156, 0.7151]}, {"w": "practice", "b": [0.2219, 0.6953, 0.3017, 0.7151]}, {"w": "in", "b": [0.308, 0.6953, 0.3277, 0.7151]}, {"w": "such", "b": [0.334, 0.6953, 0.3802, 0.7151]}, {"w": "situations", "b": [0.3865, 0.6953, 0.4832, 0.7151]}, {"w": "is", "b": [0.4895, 0.6953, 0.5064, 0.7151]}, {"w": "to", "b": [0.5127, 0.6953, 0.5323, 0.7151]}, {"w": "use", "b": [0.5386, 0.6953, 0.5722, 0.7151]}, {"w": "K-fold", "b": [0.5785, 0.6953, 0.6429, 0.7151]}, {"w": "cross-validation", "b": [0.6492, 0.6953, 0.8104, 0.7151]}, {"w": "(see", "b": [0.8167, 0.6953, 0.8573, 0.7151]}, {"w": "figure", "b": [0.1294, 0.7158, 0.1897, 0.7356]}, {"w": "3.11).", "b": [0.196, 0.7158, 0.2539, 0.7356]}, {"w": "It", "b": [0.2602, 0.7158, 0.2756, 0.7356]}, {"w": "consists", "b": [0.2819, 0.7158, 0.3618, 0.7356]}, {"w": "of", "b": [0.3681, 0.7158, 0.3891, 0.7356]}, {"w": "splitting", "b": [0.3954, 0.7158, 0.4781, 0.7356]}, {"w": "the", "b": [0.4844, 0.7158, 0.5152, 0.7356]}, {"w": "available", "b": [0.5215, 0.7158, 0.6126, 0.7356]}, {"w": "data", "b": [0.6189, 0.7158, 0.6609, 0.7356]}, {"w": "into", "b": [0.6673, 0.7158, 0.7065, 0.7356]}, {"w": "K", "b": [0.7127, 0.7158, 0.7295, 0.7356]}, {"w": "partitions", "b": [0.7358, 0.7158, 0.8311, 0.7356]}, {"w": "(typically", "b": [0.1294, 0.7363, 0.2261, 0.7561]}, {"w": "K", "b": [0.2324, 0.7363, 0.2492, 0.7561]}, {"w": "=", "b": [0.2555, 0.7363, 0.2697, 0.7561]}, {"w": "4", "b": [0.276, 0.7363, 0.2886, 0.7561]}, {"w": "or", "b": [0.295, 0.7363, 0.316, 0.7561]}, {"w": "5),", "b": [0.3223, 0.7363, 0.3496, 0.7561]}, {"w": "instantiating", "b": [0.3559, 0.7363, 0.4806, 0.7561]}, {"w": "K", "b": [0.4869, 0.7363, 0.5037, 0.7561]}, {"w": "identical", "b": [0.51, 0.7363, 0.5969, 0.7561]}, {"w": "models,", "b": [0.6032, 0.7363, 0.6824, 0.7561]}, {"w": "and", "b": [0.6887, 0.7363, 0.7251, 0.7561]}, {"w": "training", "b": [0.7314, 0.7363, 0.8099, 0.7561]}, {"w": "each", "b": [0.8162, 0.7363, 0.8624, 0.7561]}, {"w": "one", "b": [0.1294, 0.7568, 0.1658, 0.7766]}, {"w": "on", "b": [0.1721, 0.7568, 0.1974, 0.7766]}, {"w": "K", "b": [0.2037, 0.7568, 0.2205, 0.7766]}, {"w": "–", "b": [0.2268, 0.7568, 0.2394, 0.7766]}, {"w": "1", "b": [0.2457, 0.7568, 0.2583, 0.7766]}, {"w": "partitions", "b": [0.2646, 0.7568, 0.3599, 0.7766]}, {"w": "while", "b": [0.3662, 0.7568, 0.4223, 0.7766]}, {"w": "evaluating", "b": [0.4286, 0.7568, 0.5337, 0.7766]}, {"w": "on", "b": [0.54, 0.7568, 0.5652, 0.7766]}, {"w": "the", "b": [0.5715, 0.7568, 0.6023, 0.7766]}, {"w": "remaining", "b": [0.6087, 0.7568, 0.7109, 0.7766]}, {"w": "partition.", "b": [0.7173, 0.7568, 0.809, 0.7766]}, {"w": "The", "b": [0.8154, 0.7568, 0.8546, 0.7766]}, {"w": "validation", "b": [0.1294, 0.7773, 0.2303, 0.7971]}, {"w": "score", "b": [0.2366, 0.7773, 0.2898, 0.7971]}, {"w": "for", "b": [0.2962, 0.7773, 0.3256, 0.7971]}, {"w": "the", "b": [0.3319, 0.7773, 0.3627, 0.7971]}, {"w": "model", "b": [0.369, 0.7773, 0.4321, 0.7971]}, {"w": "used", "b": [0.4384, 0.7773, 0.4846, 0.7971]}, {"w": "is", "b": [0.4909, 0.7773, 0.5077, 0.7971]}, {"w": "then", "b": [0.5141, 0.7773, 0.5575, 0.7971]}, {"w": "the", "b": [0.5638, 0.7773, 0.5946, 0.7971]}, {"w": "average", "b": [0.6009, 0.7773, 0.6794, 0.7971]}, {"w": "of", "b": [0.6857, 0.7773, 0.7067, 0.7971]}, {"w": "the", "b": [0.7129, 0.7773, 0.7437, 0.7971]}, {"w": "K", "b": [0.75, 0.7773, 0.7668, 0.7971]}, {"w": "validation", "b": [0.1294, 0.7978, 0.2303, 0.8176]}, {"w": "scores", "b": [0.2366, 0.7978, 0.2997, 0.8176]}, {"w": "obtained.", "b": [0.306, 0.7978, 0.3992, 0.8176]}, {"w": "In", "b": [0.4055, 0.7978, 0.4265, 0.8176]}, {"w": "terms", "b": [0.4328, 0.7978, 0.4888, 0.8176]}, {"w": "of", "b": [0.4951, 0.7978, 0.5161, 0.8176]}, {"w": "code,", "b": [0.5225, 0.7978, 0.5764, 0.8176]}, {"w": "this", "b": [0.5827, 0.7978, 0.6191, 0.8176]}, {"w": "is", "b": [0.6255, 0.7978, 0.6423, 0.8176]}, {"w": "straightforward.", "b": [0.6486, 0.7978, 0.8104, 0.8176]}]}, {"id": "b_6", "type": "equation", "text": "Figure 3.11. 3-fold cross-validation", "words": [{"w": "Figure", "b": [0.1294, 0.8357, 0.1827, 0.8505]}, {"w": "3.11.", "b": [0.1874, 0.8357, 0.2242, 0.8505]}, {"w": "3-fold", "b": [0.2289, 0.8357, 0.2762, 0.8505]}, {"w": "cross-validation", "b": [0.2809, 0.8357, 0.4088, 0.8505]}]}]}, {"page": 133, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Listing 3.27. K-fold validation", "words": [{"w": "Listing", "b": [0.1294, 0.3089, 0.1862, 0.3237]}, {"w": "3.27.", "b": [0.1909, 0.3089, 0.2288, 0.3237]}, {"w": "K-fold", "b": [0.2335, 0.3089, 0.286, 0.3237]}, {"w": "validation", "b": [0.2908, 0.3089, 0.3717, 0.3237]}]}, {"id": "b_1", "type": "paragraph", "text": "import numpy as np k = 4 num_val_samples = len(train_data) // k num_epochs = 100 all_scores = [] for i in range(k): print('processing fold #', i) val_data = train_data[i * num_val_samples: (i + 1) * num_val_samples] 1 val_targets = train_targets[i * num_val_samples: (i + 1) * num_val_samples] partial_train_data = np.concatenate( 2 [train_data[:i * num_val_samples], train_data[(i + 1) * num_val_samples:]], axis=0) partial_train_targets = np.concatenate( [train_targets[:i * num_val_samples], train_targets[(i + 1) * num_val_samples:]], axis=0) model = build_model() 3 model.fit(partial_train_data, partial_train_targets, 4 epochs=num_epochs, batch_size=1, verbose=0) val_mse, val_mae = model.evaluate(val_data, val_targets, verbose=0) 5 all_scores.append(val_mae)", "words": [{"w": "import", "b": [0.1357, 0.3373, 0.2038, 0.3525]}, {"w": "numpy", "b": [0.2152, 0.3373, 0.2719, 0.3525]}, {"w": "as", "b": [0.2833, 0.3373, 0.306, 0.3525]}, {"w": "np", "b": [0.3173, 0.3373, 0.34, 0.3525]}, {"w": "k", "b": [0.1357, 0.3676, 0.1471, 0.3828]}, {"w": "=", "b": [0.1584, 0.3676, 0.1698, 0.3828]}, {"w": "4", "b": [0.1811, 0.3676, 0.1925, 0.3828]}, {"w": "num_val_samples", "b": [0.1357, 0.3828, 0.306, 0.3979]}, {"w": "=", "b": [0.3173, 0.3828, 0.3287, 0.3979]}, {"w": "len(train_data)", "b": [0.34, 0.3828, 0.5103, 0.3979]}, {"w": "//", "b": [0.5217, 0.3828, 0.5444, 0.3979]}, {"w": "k", "b": [0.5557, 0.3828, 0.5671, 0.3979]}, {"w": "num_epochs", "b": [0.1357, 0.3979, 0.2492, 0.4131]}, {"w": "=", "b": [0.2606, 0.3979, 0.2719, 0.4131]}, {"w": "100", "b": [0.2833, 0.3979, 0.3173, 0.4131]}, {"w": "all_scores", "b": [0.1357, 0.4131, 0.2492, 0.4282]}, {"w": "=", "b": [0.2606, 0.4131, 0.2719, 0.4282]}, {"w": "[]", "b": [0.2833, 0.4131, 0.306, 0.4282]}, {"w": "for", "b": [0.1357, 0.4282, 0.1698, 0.4434]}, {"w": "i", "b": [0.1811, 0.4282, 0.1925, 0.4434]}, {"w": "in", "b": [0.2038, 0.4282, 0.2265, 0.4434]}, {"w": "range(k):", "b": [0.2379, 0.4282, 0.34, 0.4434]}, {"w": "print('processing", "b": [0.1811, 0.4434, 0.3741, 0.4585]}, {"w": "fold", "b": [0.3855, 0.4434, 0.4309, 0.4585]}, {"w": "#',", "b": [0.4422, 0.4434, 0.4763, 0.4585]}, {"w": "i)", "b": [0.4876, 0.4434, 0.5103, 0.4585]}, {"w": "val_data", "b": [0.1811, 0.4585, 0.2719, 0.4737]}, {"w": "=", "b": [0.2833, 0.4585, 0.2946, 0.4737]}, {"w": "train_data[i", "b": [0.306, 0.4585, 0.4422, 0.4737]}, {"w": "*", "b": [0.4536, 0.4585, 0.4649, 0.4737]}, {"w": "num_val_samples:", "b": [0.4763, 0.4585, 0.6579, 0.4737]}, {"w": "(i", "b": [0.6692, 0.4585, 0.6919, 0.4737]}, {"w": "+", "b": [0.7033, 0.4585, 0.7146, 0.4737]}, {"w": "1)", "b": [0.726, 0.4585, 0.7487, 0.4737]}, {"w": "*", "b": [0.7601, 0.4585, 0.7714, 0.4737]}, {"w": "num_val_samples]", "b": [0.1357, 0.4737, 0.3173, 0.4888]}, {"w": "1", "b": [0.3628, 0.4737, 0.3741, 0.4888]}, {"w": "val_targets", "b": [0.1811, 0.4888, 0.306, 0.504]}, {"w": "=", "b": [0.3173, 0.4888, 0.3287, 0.504]}, {"w": "train_targets[i", "b": [0.34, 0.4888, 0.5103, 0.504]}, {"w": "*", "b": [0.5217, 0.4888, 0.533, 0.504]}, {"w": "num_val_samples:", "b": [0.5444, 0.4888, 0.726, 0.504]}, {"w": "(i", "b": [0.7374, 0.4888, 0.7601, 0.504]}, {"w": "+", "b": [0.7714, 0.4888, 0.7828, 0.504]}, {"w": "1)", "b": [0.7941, 0.4888, 0.8168, 0.504]}, {"w": "*", "b": [0.8282, 0.4888, 0.8395, 0.504]}, {"w": "num_val_samples]", "b": [0.1357, 0.504, 0.3173, 0.5191]}, {"w": "partial_train_data", "b": [0.1811, 0.5343, 0.3855, 0.5495]}, {"w": "=", "b": [0.3968, 0.5343, 0.4082, 0.5495]}, {"w": "np.concatenate(", "b": [0.4195, 0.5343, 0.5898, 0.5495]}, {"w": "2", "b": [0.1357, 0.5495, 0.1471, 0.5646]}, {"w": "[train_data[:i", "b": [0.2265, 0.5646, 0.3855, 0.5798]}, {"w": "*", "b": [0.3968, 0.5646, 0.4082, 0.5798]}, {"w": "num_val_samples],", "b": [0.4195, 0.5646, 0.6125, 0.5798]}, {"w": "train_data[(i", "b": [0.2379, 0.5798, 0.3855, 0.5949]}, {"w": "+", "b": [0.3968, 0.5798, 0.4082, 0.5949]}, {"w": "1)", "b": [0.4195, 0.5798, 0.4422, 0.5949]}, {"w": "*", "b": [0.4536, 0.5798, 0.4649, 0.5949]}, {"w": "num_val_samples:]],", "b": [0.4763, 0.5798, 0.6919, 0.5949]}, {"w": "axis=0)", "b": [0.2265, 0.5949, 0.306, 0.6101]}, {"w": "partial_train_targets", "b": [0.1811, 0.6101, 0.4195, 0.6252]}, {"w": "=", "b": [0.4309, 0.6101, 0.4422, 0.6252]}, {"w": "np.concatenate(", "b": [0.4536, 0.6101, 0.6238, 0.6252]}, {"w": "[train_targets[:i", "b": [0.2265, 0.6252, 0.4195, 0.6404]}, {"w": "*", "b": [0.4309, 0.6252, 0.4422, 0.6404]}, {"w": "num_val_samples],", "b": [0.4536, 0.6252, 0.6465, 0.6404]}, {"w": "train_targets[(i", "b": [0.2379, 0.6404, 0.4195, 0.6555]}, {"w": "+", "b": [0.4309, 0.6404, 0.4422, 0.6555]}, {"w": "1)", "b": [0.4536, 0.6404, 0.4763, 0.6555]}, {"w": "*", "b": [0.4876, 0.6404, 0.499, 0.6555]}, {"w": "num_val_samples:]],", "b": [0.5103, 0.6404, 0.726, 0.6555]}, {"w": "axis=0)", "b": [0.2265, 0.6555, 0.306, 0.6707]}, {"w": "model", "b": [0.1811, 0.6858, 0.2379, 0.701]}, {"w": "=", "b": [0.2492, 0.6858, 0.2606, 0.701]}, {"w": "build_model()", "b": [0.2719, 0.6858, 0.4195, 0.701]}, {"w": "3", "b": [0.1357, 0.701, 0.1471, 0.7161]}, {"w": "model.fit(partial_train_data,", "b": [0.1811, 0.7161, 0.5103, 0.7313]}, {"w": "partial_train_targets,", "b": [0.5217, 0.7161, 0.7714, 0.7313]}, {"w": "4", "b": [0.1357, 0.7313, 0.1471, 0.7464]}, {"w": "epochs=num_epochs,", "b": [0.2946, 0.7464, 0.499, 0.7616]}, {"w": "batch_size=1,", "b": [0.5103, 0.7464, 0.6579, 0.7616]}, {"w": "verbose=0)", "b": [0.6692, 0.7464, 0.7828, 0.7616]}, {"w": "val_mse,", "b": [0.1811, 0.7616, 0.2719, 0.7767]}, {"w": "val_mae", "b": [0.2833, 0.7616, 0.3628, 0.7767]}, {"w": "=", "b": [0.3741, 0.7616, 0.3855, 0.7767]}, {"w": "model.evaluate(val_data,", "b": [0.3968, 0.7616, 0.6692, 0.7767]}, {"w": "val_targets,", "b": [0.6806, 0.7616, 0.8168, 0.7767]}, {"w": "verbose=0)", "b": [0.1357, 0.7767, 0.2492, 0.7919]}, {"w": "5", "b": [0.3174, 0.7767, 0.3287, 0.7919]}, {"w": "all_scores.append(val_mae)", "b": [0.1811, 0.7919, 0.4763, 0.807]}]}, {"id": "b_2", "type": "paragraph", "text": "1 Prepares the validation data: data from partition #k 2 Prepares the training data: data from all other partitions 3 Builds the Keras model (already compiled) 4 Trains the model (in silent mode, verbose = 0)", "words": [{"w": "1", "b": [0.1799, 0.8255, 0.1925, 0.8452]}, {"w": "Prepares", "b": [0.1988, 0.8255, 0.2945, 0.8452]}, {"w": "the", "b": [0.3008, 0.8255, 0.3345, 0.8452]}, {"w": "validation", "b": [0.3408, 0.8255, 0.4487, 0.8452]}, {"w": "data:", "b": [0.455, 0.8255, 0.5111, 0.8452]}, {"w": "data", "b": [0.5174, 0.8255, 0.565, 0.8452]}, {"w": "from", "b": [0.5713, 0.8255, 0.6241, 0.8452]}, {"w": "partition", "b": [0.6304, 0.8255, 0.7257, 0.8452]}, {"w": "#k", "b": [0.732, 0.8255, 0.7587, 0.8452]}, {"w": "2", "b": [0.1799, 0.846, 0.1925, 0.8657]}, {"w": "Prepares", "b": [0.1988, 0.846, 0.2945, 0.8657]}, {"w": "the", "b": [0.3008, 0.846, 0.3345, 0.8657]}, {"w": "training", "b": [0.3408, 0.846, 0.4277, 0.8657]}, {"w": "data:", "b": [0.434, 0.846, 0.49, 0.8657]}, {"w": "data", "b": [0.4963, 0.846, 0.544, 0.8657]}, {"w": "from", "b": [0.5503, 0.846, 0.6031, 0.8657]}, {"w": "all", "b": [0.6094, 0.846, 0.636, 0.8657]}, {"w": "other", "b": [0.6423, 0.846, 0.6998, 0.8657]}, {"w": "partitions", "b": [0.7061, 0.846, 0.8112, 0.8657]}, {"w": "3", "b": [0.1799, 0.8665, 0.1925, 0.8862]}, {"w": "Builds", "b": [0.1988, 0.8665, 0.2675, 0.8862]}, {"w": "the", "b": [0.2738, 0.8665, 0.3074, 0.8862]}, {"w": "Keras", "b": [0.3137, 0.8665, 0.3782, 0.8862]}, {"w": "model", "b": [0.3845, 0.8665, 0.4504, 0.8862]}, {"w": "(already", "b": [0.4567, 0.8665, 0.5459, 0.8862]}, {"w": "compiled)", "b": [0.5522, 0.8665, 0.6587, 0.8862]}, {"w": "4", "b": [0.1799, 0.887, 0.1925, 0.9067]}, {"w": "Trains", "b": [0.1988, 0.887, 0.2684, 0.9067]}, {"w": "the", "b": [0.2747, 0.887, 0.3083, 0.9067]}, {"w": "model", "b": [0.3146, 0.887, 0.3805, 0.9067]}, {"w": "(in", "b": [0.3868, 0.887, 0.4162, 0.9067]}, {"w": "silent", "b": [0.4226, 0.887, 0.48, 0.9067]}, {"w": "mode,", "b": [0.4863, 0.887, 0.5515, 0.9067]}, {"w": "verbose", "b": [0.5578, 0.887, 0.6405, 0.9067]}, {"w": "=", "b": [0.6468, 0.887, 0.6611, 0.9067]}, {"w": "0)", "b": [0.6674, 0.887, 0.6885, 0.9067]}]}]}, {"page": 134, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "5 Evaluates the model on the validation data", "words": [{"w": "5", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Evaluates", "b": [0.1988, 0.0857, 0.3039, 0.1054]}, {"w": "the", "b": [0.3102, 0.0857, 0.3438, 0.1054]}, {"w": "model", "b": [0.3501, 0.0857, 0.416, 0.1054]}, {"w": "on", "b": [0.4223, 0.0857, 0.4489, 0.1054]}, {"w": "the", "b": [0.4553, 0.0857, 0.4889, 0.1054]}, {"w": "validation", "b": [0.4952, 0.0857, 0.6031, 0.1054]}, {"w": "data", "b": [0.6094, 0.0857, 0.6571, 0.1054]}]}, {"id": "b_1", "type": "equation", "text": "Running this with num_epochs = 100 yields the following results:", "words": [{"w": "Running", "b": [0.1294, 0.1285, 0.2163, 0.1482]}, {"w": "this", "b": [0.2226, 0.1285, 0.2591, 0.1482]}, {"w": "with", "b": [0.2654, 0.1285, 0.3102, 0.1482]}, {"w": "num_epochs", "b": [0.3165, 0.1295, 0.4679, 0.1497]}, {"w": "=", "b": [0.483, 0.1295, 0.4981, 0.1497]}, {"w": "100", "b": [0.5133, 0.1295, 0.5587, 0.1497]}, {"w": "yields", "b": [0.565, 0.1285, 0.6253, 0.1482]}, {"w": "the", "b": [0.6316, 0.1285, 0.6624, 0.1482]}, {"w": "following", "b": [0.6687, 0.1285, 0.7668, 0.1482]}, {"w": "results:", "b": [0.7731, 0.1285, 0.846, 0.1482]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> all_scores [2.588258957792037, 3.1289568449719116, 3.1856116051248984, 3.0763342615401386] >>> np.mean(all_scores) 2.9947904173572462", "words": [{"w": ">>>", "b": [0.1357, 0.1671, 0.1698, 0.1822]}, {"w": "all_scores", "b": [0.1811, 0.1671, 0.2946, 0.1822]}, {"w": "[2.588258957792037,", "b": [0.1357, 0.1822, 0.3514, 0.1974]}, {"w": "3.1289568449719116,", "b": [0.3628, 0.1822, 0.5784, 0.1974]}, {"w": "3.1856116051248984,", "b": [0.5898, 0.1822, 0.8055, 0.1974]}, {"w": "3.0763342615401386]", "b": [0.1357, 0.1974, 0.3514, 0.2125]}, {"w": ">>>", "b": [0.1357, 0.2125, 0.1698, 0.2277]}, {"w": "np.mean(all_scores)", "b": [0.1811, 0.2125, 0.3968, 0.2277]}, {"w": "2.9947904173572462", "b": [0.1357, 0.2277, 0.34, 0.2428]}]}, {"id": "b_3", "type": "paragraph", "text": "The different runs do indeed show rather different validation scores, from 2.6 to 3.2. The average (3.0) is a much more reliable metric than any single score—that’s the entire point of K-fold cross-validation. In this case, you’re off by $3,000 on average, which is significant considering that the prices range from $10,000 to $50,000.", "words": [{"w": "The", "b": [0.1294, 0.2657, 0.1686, 0.2855]}, {"w": "different", "b": [0.1749, 0.2657, 0.2613, 0.2855]}, {"w": "runs", "b": [0.2676, 0.2657, 0.3111, 0.2855]}, {"w": "do", "b": [0.3174, 0.2657, 0.3426, 0.2855]}, {"w": "indeed", "b": [0.3489, 0.2657, 0.4162, 0.2855]}, {"w": "show", "b": [0.4225, 0.2657, 0.4757, 0.2855]}, {"w": "rather", "b": [0.482, 0.2657, 0.5409, 0.2855]}, {"w": "different", "b": [0.5472, 0.2657, 0.6335, 0.2855]}, {"w": "validation", "b": [0.6398, 0.2657, 0.7407, 0.2855]}, {"w": "scores,", "b": [0.747, 0.2657, 0.8164, 0.2855]}, {"w": "from", "b": [0.1294, 0.2862, 0.1785, 0.306]}, {"w": "2.6", "b": [0.1848, 0.2862, 0.2163, 0.306]}, {"w": "to", "b": [0.2226, 0.2862, 0.2422, 0.306]}, {"w": "3.2.", "b": [0.2485, 0.2862, 0.2864, 0.306]}, {"w": "The", "b": [0.2927, 0.2862, 0.3319, 0.306]}, {"w": "average", "b": [0.3382, 0.2862, 0.4166, 0.306]}, {"w": "(3.0)", "b": [0.4229, 0.2862, 0.4713, 0.306]}, {"w": "is", "b": [0.4776, 0.2862, 0.4944, 0.306]}, {"w": "a", "b": [0.5007, 0.2862, 0.5119, 0.306]}, {"w": "much", "b": [0.5182, 0.2862, 0.5743, 0.306]}, {"w": "more", "b": [0.5806, 0.2862, 0.6324, 0.306]}, {"w": "reliable", "b": [0.6387, 0.2862, 0.7144, 0.306]}, {"w": "metric", "b": [0.7206, 0.2862, 0.7851, 0.306]}, {"w": "than", "b": [0.7914, 0.2862, 0.8348, 0.306]}, {"w": "any", "b": [0.1294, 0.3067, 0.1658, 0.3265]}, {"w": "single", "b": [0.1721, 0.3067, 0.2324, 0.3265]}, {"w": "score—that’s", "b": [0.2387, 0.3067, 0.3718, 0.3265]}, {"w": "the", "b": [0.3781, 0.3067, 0.4089, 0.3265]}, {"w": "entire", "b": [0.4152, 0.3067, 0.4727, 0.3265]}, {"w": "point", "b": [0.479, 0.3067, 0.5308, 0.3265]}, {"w": "of", "b": [0.5372, 0.3067, 0.5582, 0.3265]}, {"w": "K-fold", "b": [0.5645, 0.3067, 0.6317, 0.3265]}, {"w": "cross-validation.", "b": [0.638, 0.3067, 0.8055, 0.3265]}, {"w": "In", "b": [0.8118, 0.3067, 0.8328, 0.3265]}, {"w": "this", "b": [0.1294, 0.3272, 0.1659, 0.347]}, {"w": "case,", "b": [0.1722, 0.3272, 0.2219, 0.347]}, {"w": "you’re", "b": [0.2282, 0.3272, 0.294, 0.347]}, {"w": "off", "b": [0.3003, 0.3272, 0.3293, 0.347]}, {"w": "by", "b": [0.3356, 0.3272, 0.3608, 0.347]}, {"w": "$3,000", "b": [0.3671, 0.3272, 0.4365, 0.347]}, {"w": "on", "b": [0.4428, 0.3272, 0.468, 0.347]}, {"w": "average,", "b": [0.4743, 0.3272, 0.5591, 0.347]}, {"w": "which", "b": [0.5653, 0.3272, 0.627, 0.347]}, {"w": "is", "b": [0.6333, 0.3272, 0.6501, 0.347]}, {"w": "significant", "b": [0.6564, 0.3272, 0.7629, 0.347]}, {"w": "considering", "b": [0.1294, 0.3477, 0.2471, 0.3675]}, {"w": "that", "b": [0.2534, 0.3477, 0.2913, 0.3675]}, {"w": "the", "b": [0.2976, 0.3477, 0.3284, 0.3675]}, {"w": "prices", "b": [0.3347, 0.3477, 0.3949, 0.3675]}, {"w": "range", "b": [0.4012, 0.3477, 0.4573, 0.3675]}, {"w": "from", "b": [0.4636, 0.3477, 0.5126, 0.3675]}, {"w": "$10,000", "b": [0.5189, 0.3477, 0.6009, 0.3675]}, {"w": "to", "b": [0.6072, 0.3477, 0.6268, 0.3675]}, {"w": "$50,000.", "b": [0.6331, 0.3477, 0.7214, 0.3675]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s try training the network a bit longer: 500 epochs. To keep a record of how well the model does at each epoch, you’ll modify the training loop to save the per-epoch validation score log.", "words": [{"w": "Let’s", "b": [0.1294, 0.3905, 0.1798, 0.4102]}, {"w": "try", "b": [0.1862, 0.3905, 0.2142, 0.4102]}, {"w": "training", "b": [0.2205, 0.3905, 0.299, 0.4102]}, {"w": "the", "b": [0.3053, 0.3905, 0.3361, 0.4102]}, {"w": "network", "b": [0.3424, 0.3905, 0.4251, 0.4102]}, {"w": "a", "b": [0.4314, 0.3905, 0.4426, 0.4102]}, {"w": "bit", "b": [0.4489, 0.3905, 0.4755, 0.4102]}, {"w": "longer:", "b": [0.4818, 0.3905, 0.5533, 0.4102]}, {"w": "500", "b": [0.5596, 0.3905, 0.5974, 0.4102]}, {"w": "epochs.", "b": [0.6037, 0.3905, 0.6801, 0.4102]}, {"w": "To", "b": [0.6864, 0.3905, 0.7126, 0.4102]}, {"w": "keep", "b": [0.7189, 0.3905, 0.7665, 0.4102]}, {"w": "a", "b": [0.7728, 0.3905, 0.784, 0.4102]}, {"w": "record", "b": [0.7904, 0.3905, 0.8548, 0.4102]}, {"w": "of", "b": [0.1294, 0.411, 0.1504, 0.4307]}, {"w": "how", "b": [0.1567, 0.411, 0.2002, 0.4307]}, {"w": "well", "b": [0.2065, 0.411, 0.2499, 0.4307]}, {"w": "the", "b": [0.2562, 0.411, 0.287, 0.4307]}, {"w": "model", "b": [0.2934, 0.411, 0.3564, 0.4307]}, {"w": "does", "b": [0.3627, 0.411, 0.409, 0.4307]}, {"w": "at", "b": [0.4153, 0.411, 0.4335, 0.4307]}, {"w": "each", "b": [0.4398, 0.411, 0.486, 0.4307]}, {"w": "epoch,", "b": [0.4923, 0.411, 0.5589, 0.4307]}, {"w": "you’ll", "b": [0.5652, 0.411, 0.6254, 0.4307]}, {"w": "modify", "b": [0.6317, 0.411, 0.7045, 0.4307]}, {"w": "the", "b": [0.7108, 0.411, 0.7417, 0.4307]}, {"w": "training", "b": [0.748, 0.411, 0.8265, 0.4307]}, {"w": "loop", "b": [0.1294, 0.4315, 0.1743, 0.4512]}, {"w": "to", "b": [0.1806, 0.4315, 0.2002, 0.4512]}, {"w": "save", "b": [0.2065, 0.4315, 0.2513, 0.4512]}, {"w": "the", "b": [0.2576, 0.4315, 0.2885, 0.4512]}, {"w": "per-epoch", "b": [0.2948, 0.4315, 0.3951, 0.4512]}, {"w": "validation", "b": [0.4014, 0.4315, 0.5023, 0.4512]}, {"w": "score", "b": [0.5086, 0.4315, 0.5618, 0.4512]}, {"w": "log.", "b": [0.5681, 0.4315, 0.6067, 0.4512]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 3.28. Saving the validation logs at each fold", "words": [{"w": "Listing", "b": [0.1294, 0.4693, 0.1862, 0.4842]}, {"w": "3.28.", "b": [0.1909, 0.4693, 0.2288, 0.4842]}, {"w": "Saving", "b": [0.2335, 0.4693, 0.2881, 0.4842]}, {"w": "the", "b": [0.2929, 0.4693, 0.3181, 0.4842]}, {"w": "validation", "b": [0.3228, 0.4693, 0.4038, 0.4842]}, {"w": "logs", "b": [0.4085, 0.4693, 0.44, 0.4842]}, {"w": "at", "b": [0.4448, 0.4693, 0.4605, 0.4842]}, {"w": "each", "b": [0.4653, 0.4693, 0.502, 0.4842]}, {"w": "fold", "b": [0.5068, 0.4693, 0.5383, 0.4842]}]}, {"id": "b_6", "type": "paragraph", "text": "num_epochs = 500 all_mae_histories = [] for i in range(k): print('processing fold #', i) val_data = train_data[i * num_val_samples: (i + 1) * num_val_samples] 1 val_targets = train_targets[i * num_val_samples: (i + 1) * num_val_samples] partial_train_data = np.concatenate( 2 [train_data[:i * num_val_samples], train_data[(i + 1) * num_val_samples:]], axis=0) partial_train_targets = np.concatenate( [train_targets[:i * num_val_samples], train_targets[(i + 1) * num_val_samples:]], axis=0) model = build_model() 3 history = model.fit(partial_train_data, partial_train_targets, 4 validation_data=(val_data, val_targets), epochs=num_epochs, batch_size=1, verbose=0) mae_history = history.history['val_mean_absolute_error'] all_mae_histories.append(mae_history)", "words": [{"w": "num_epochs", "b": [0.1357, 0.4978, 0.2492, 0.5129]}, {"w": "=", "b": [0.2606, 0.4978, 0.2719, 0.5129]}, {"w": "500", "b": [0.2833, 0.4978, 0.3173, 0.5129]}, {"w": "all_mae_histories", "b": [0.1357, 0.5129, 0.3287, 0.5281]}, {"w": "=", "b": [0.34, 0.5129, 0.3514, 0.5281]}, {"w": "[]", "b": [0.3628, 0.5129, 0.3855, 0.5281]}, {"w": "for", "b": [0.1357, 0.5281, 0.1698, 0.5432]}, {"w": "i", "b": [0.1811, 0.5281, 0.1925, 0.5432]}, {"w": "in", "b": [0.2038, 0.5281, 0.2265, 0.5432]}, {"w": "range(k):", "b": [0.2379, 0.5281, 0.34, 0.5432]}, {"w": "print('processing", "b": [0.1811, 0.5432, 0.3741, 0.5584]}, {"w": "fold", "b": [0.3855, 0.5432, 0.4309, 0.5584]}, {"w": "#',", "b": [0.4422, 0.5432, 0.4763, 0.5584]}, {"w": "i)", "b": [0.4876, 0.5432, 0.5103, 0.5584]}, {"w": "val_data", "b": [0.1811, 0.5584, 0.2719, 0.5735]}, {"w": "=", "b": [0.2833, 0.5584, 0.2946, 0.5735]}, {"w": "train_data[i", "b": [0.306, 0.5584, 0.4422, 0.5735]}, {"w": "*", "b": [0.4536, 0.5584, 0.4649, 0.5735]}, {"w": "num_val_samples:", "b": [0.4763, 0.5584, 0.6579, 0.5735]}, {"w": "(i", "b": [0.6692, 0.5584, 0.6919, 0.5735]}, {"w": "+", "b": [0.7033, 0.5584, 0.7146, 0.5735]}, {"w": "1)", "b": [0.726, 0.5584, 0.7487, 0.5735]}, {"w": "*", "b": [0.7601, 0.5584, 0.7714, 0.5735]}, {"w": "num_val_samples]", "b": [0.1357, 0.5735, 0.3173, 0.5887]}, {"w": "1", "b": [0.3628, 0.5735, 0.3741, 0.5887]}, {"w": "val_targets", "b": [0.1811, 0.5887, 0.306, 0.6038]}, {"w": "=", "b": [0.3173, 0.5887, 0.3287, 0.6038]}, {"w": "train_targets[i", "b": [0.34, 0.5887, 0.5103, 0.6038]}, {"w": "*", "b": [0.5217, 0.5887, 0.533, 0.6038]}, {"w": "num_val_samples:", "b": [0.5444, 0.5887, 0.726, 0.6038]}, {"w": "(i", "b": [0.7374, 0.5887, 0.7601, 0.6038]}, {"w": "+", "b": [0.7714, 0.5887, 0.7828, 0.6038]}, {"w": "1)", "b": [0.7941, 0.5887, 0.8168, 0.6038]}, {"w": "*", "b": [0.8282, 0.5887, 0.8395, 0.6038]}, {"w": "num_val_samples]", "b": [0.1357, 0.6038, 0.3173, 0.619]}, {"w": "partial_train_data", "b": [0.1811, 0.619, 0.3855, 0.6341]}, {"w": "=", "b": [0.3968, 0.619, 0.4082, 0.6341]}, {"w": "np.concatenate(", "b": [0.4195, 0.619, 0.5898, 0.6341]}, {"w": "2", "b": [0.1357, 0.6341, 0.1471, 0.6493]}, {"w": "[train_data[:i", "b": [0.2265, 0.6493, 0.3855, 0.6644]}, {"w": "*", "b": [0.3968, 0.6493, 0.4082, 0.6644]}, {"w": "num_val_samples],", "b": [0.4195, 0.6493, 0.6125, 0.6644]}, {"w": "train_data[(i", "b": [0.2379, 0.6644, 0.3855, 0.6796]}, {"w": "+", "b": [0.3968, 0.6644, 0.4082, 0.6796]}, {"w": "1)", "b": [0.4195, 0.6644, 0.4422, 0.6796]}, {"w": "*", "b": [0.4536, 0.6644, 0.4649, 0.6796]}, {"w": "num_val_samples:]],", "b": [0.4763, 0.6644, 0.6919, 0.6796]}, {"w": "axis=0)", "b": [0.2265, 0.6796, 0.306, 0.6947]}, {"w": "partial_train_targets", "b": [0.1811, 0.6947, 0.4195, 0.7099]}, {"w": "=", "b": [0.4309, 0.6947, 0.4422, 0.7099]}, {"w": "np.concatenate(", "b": [0.4536, 0.6947, 0.6238, 0.7099]}, {"w": "[train_targets[:i", "b": [0.2265, 0.7099, 0.4195, 0.725]}, {"w": "*", "b": [0.4309, 0.7099, 0.4422, 0.725]}, {"w": "num_val_samples],", "b": [0.4536, 0.7099, 0.6465, 0.725]}, {"w": "train_targets[(i", "b": [0.2379, 0.725, 0.4195, 0.7402]}, {"w": "+", "b": [0.4309, 0.725, 0.4422, 0.7402]}, {"w": "1)", "b": [0.4536, 0.725, 0.4763, 0.7402]}, {"w": "*", "b": [0.4876, 0.725, 0.499, 0.7402]}, {"w": "num_val_samples:]],", "b": [0.5103, 0.725, 0.726, 0.7402]}, {"w": "axis=0)", "b": [0.2265, 0.7402, 0.306, 0.7553]}, {"w": "model", "b": [0.1811, 0.7705, 0.2379, 0.7856]}, {"w": "=", "b": [0.2492, 0.7705, 0.2606, 0.7856]}, {"w": "build_model()", "b": [0.2719, 0.7705, 0.4195, 0.7856]}, {"w": "3", "b": [0.1357, 0.7857, 0.1471, 0.8008]}, {"w": "history", "b": [0.1811, 0.8008, 0.2606, 0.816]}, {"w": "=", "b": [0.2719, 0.8008, 0.2833, 0.816]}, {"w": "model.fit(partial_train_data,", "b": [0.2946, 0.8008, 0.6238, 0.816]}, {"w": "partial_train_targets,", "b": [0.1357, 0.816, 0.3855, 0.8311]}, {"w": "4", "b": [0.5104, 0.816, 0.5217, 0.8311]}, {"w": "validation_data=(val_data,", "b": [0.4082, 0.8311, 0.7033, 0.8463]}, {"w": "val_targets),", "b": [0.7146, 0.8311, 0.8622, 0.8463]}, {"w": "epochs=num_epochs,", "b": [0.4082, 0.8463, 0.6125, 0.8614]}, {"w": "batch_size=1,", "b": [0.6238, 0.8463, 0.7714, 0.8614]}, {"w": "verbose=0)", "b": [0.1357, 0.8614, 0.2492, 0.8766]}, {"w": "mae_history", "b": [0.1811, 0.8766, 0.306, 0.8917]}, {"w": "=", "b": [0.3173, 0.8766, 0.3287, 0.8917]}, {"w": "history.history['val_mean_absolute_error']", "b": [0.34, 0.8766, 0.8168, 0.8917]}, {"w": "all_mae_histories.append(mae_history)", "b": [0.1811, 0.8917, 0.6011, 0.9069]}]}]}, {"page": 135, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1 Prepares the validation data: data from partition #k 2 Prepares the training data: data from all other partitions 3 Builds the Keras model (already compiled) 4 Trains the model (in silent mode, verbose=0)", "words": [{"w": "1", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Prepares", "b": [0.1988, 0.0857, 0.2945, 0.1054]}, {"w": "the", "b": [0.3008, 0.0857, 0.3345, 0.1054]}, {"w": "validation", "b": [0.3408, 0.0857, 0.4487, 0.1054]}, {"w": "data:", "b": [0.455, 0.0857, 0.5111, 0.1054]}, {"w": "data", "b": [0.5174, 0.0857, 0.565, 0.1054]}, {"w": "from", "b": [0.5713, 0.0857, 0.6241, 0.1054]}, {"w": "partition", "b": [0.6304, 0.0857, 0.7257, 0.1054]}, {"w": "#k", "b": [0.732, 0.0857, 0.7587, 0.1054]}, {"w": "2", "b": [0.1799, 0.1062, 0.1925, 0.1259]}, {"w": "Prepares", "b": [0.1988, 0.1062, 0.2945, 0.1259]}, {"w": "the", "b": [0.3008, 0.1062, 0.3345, 0.1259]}, {"w": "training", "b": [0.3408, 0.1062, 0.4277, 0.1259]}, {"w": "data:", "b": [0.434, 0.1062, 0.49, 0.1259]}, {"w": "data", "b": [0.4963, 0.1062, 0.544, 0.1259]}, {"w": "from", "b": [0.5503, 0.1062, 0.6031, 0.1259]}, {"w": "all", "b": [0.6094, 0.1062, 0.636, 0.1259]}, {"w": "other", "b": [0.6423, 0.1062, 0.6998, 0.1259]}, {"w": "partitions", "b": [0.7061, 0.1062, 0.8112, 0.1259]}, {"w": "3", "b": [0.1799, 0.1267, 0.1925, 0.1464]}, {"w": "Builds", "b": [0.1988, 0.1267, 0.2675, 0.1464]}, {"w": "the", "b": [0.2738, 0.1267, 0.3074, 0.1464]}, {"w": "Keras", "b": [0.3137, 0.1267, 0.3782, 0.1464]}, {"w": "model", "b": [0.3845, 0.1267, 0.4504, 0.1464]}, {"w": "(already", "b": [0.4567, 0.1267, 0.5459, 0.1464]}, {"w": "compiled)", "b": [0.5522, 0.1267, 0.6587, 0.1464]}, {"w": "4", "b": [0.1799, 0.1472, 0.1925, 0.1669]}, {"w": "Trains", "b": [0.1988, 0.1472, 0.2684, 0.1669]}, {"w": "the", "b": [0.2747, 0.1472, 0.3083, 0.1669]}, {"w": "model", "b": [0.3146, 0.1472, 0.3805, 0.1669]}, {"w": "(in", "b": [0.3868, 0.1472, 0.4162, 0.1669]}, {"w": "silent", "b": [0.4226, 0.1472, 0.48, 0.1669]}, {"w": "mode,", "b": [0.4863, 0.1472, 0.5515, 0.1669]}, {"w": "verbose=0)", "b": [0.5578, 0.1472, 0.6758, 0.1669]}]}, {"id": "b_1", "type": "equation", "text": "You can then compute the average of the per-epoch MAE scores for all folds.", "words": [{"w": "You", "b": [0.1294, 0.19, 0.1703, 0.2097]}, {"w": "can", "b": [0.1766, 0.19, 0.2116, 0.2097]}, {"w": "then", "b": [0.218, 0.19, 0.2614, 0.2097]}, {"w": "compute", "b": [0.2677, 0.19, 0.3546, 0.2097]}, {"w": "the", "b": [0.3609, 0.19, 0.3917, 0.2097]}, {"w": "average", "b": [0.398, 0.19, 0.4764, 0.2097]}, {"w": "of", "b": [0.4828, 0.19, 0.5038, 0.2097]}, {"w": "the", "b": [0.5101, 0.19, 0.5409, 0.2097]}, {"w": "per-epoch", "b": [0.5472, 0.19, 0.6475, 0.2097]}, {"w": "MAE", "b": [0.6538, 0.19, 0.7098, 0.2097]}, {"w": "scores", "b": [0.7161, 0.19, 0.7792, 0.2097]}, {"w": "for", "b": [0.7855, 0.19, 0.8149, 0.2097]}, {"w": "all", "b": [0.8212, 0.19, 0.8464, 0.2097]}, {"w": "folds.", "b": [0.1294, 0.2105, 0.1862, 0.2302]}]}, {"id": "b_2", "type": "equation", "text": "Listing 3.29. Building the history of successive mean K-fold validation scores", "words": [{"w": "Listing", "b": [0.1294, 0.2483, 0.1862, 0.2631]}, {"w": "3.29.", "b": [0.1909, 0.2483, 0.2288, 0.2631]}, {"w": "Building", "b": [0.2335, 0.2483, 0.3029, 0.2631]}, {"w": "the", "b": [0.3076, 0.2483, 0.3328, 0.2631]}, {"w": "history", "b": [0.3376, 0.2483, 0.3943, 0.2631]}, {"w": "of", "b": [0.3991, 0.2483, 0.4148, 0.2631]}, {"w": "successive", "b": [0.4195, 0.2483, 0.5005, 0.2631]}, {"w": "mean", "b": [0.5052, 0.2483, 0.5493, 0.2631]}, {"w": "K-fold", "b": [0.5541, 0.2483, 0.6066, 0.2631]}, {"w": "validation", "b": [0.6113, 0.2483, 0.6923, 0.2631]}, {"w": "scores", "b": [0.697, 0.2483, 0.7461, 0.2631]}]}, {"id": "b_3", "type": "paragraph", "text": "average_mae_history = [ np.mean([x[i] for x in all_mae_histories]) for i in range(num_epochs)]", "words": [{"w": "average_mae_history", "b": [0.1357, 0.2767, 0.3514, 0.2919]}, {"w": "=", "b": [0.3628, 0.2767, 0.3741, 0.2919]}, {"w": "[", "b": [0.3855, 0.2767, 0.3968, 0.2919]}, {"w": "np.mean([x[i]", "b": [0.1811, 0.2919, 0.3287, 0.307]}, {"w": "for", "b": [0.34, 0.2919, 0.3741, 0.307]}, {"w": "x", "b": [0.3855, 0.2919, 0.3968, 0.307]}, {"w": "in", "b": [0.4082, 0.2919, 0.4309, 0.307]}, {"w": "all_mae_histories])", "b": [0.4422, 0.2919, 0.6579, 0.307]}, {"w": "for", "b": [0.6692, 0.2919, 0.7033, 0.307]}, {"w": "i", "b": [0.7146, 0.2919, 0.726, 0.307]}, {"w": "in", "b": [0.7374, 0.2919, 0.7601, 0.307]}, {"w": "range(num_epochs)]", "b": [0.1357, 0.307, 0.34, 0.3222]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s plot this; see figure 3.12.", "words": [{"w": "Let’s", "b": [0.1294, 0.3451, 0.1798, 0.3648]}, {"w": "plot", "b": [0.1862, 0.3451, 0.2254, 0.3648]}, {"w": "this;", "b": [0.2317, 0.3451, 0.2752, 0.3648]}, {"w": "see", "b": [0.2815, 0.3451, 0.3137, 0.3648]}, {"w": "figure", "b": [0.32, 0.3451, 0.3802, 0.3648]}, {"w": "3.12.", "b": [0.3865, 0.3451, 0.437, 0.3648]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 3.12. Validation MAE by epoch", "words": [{"w": "Figure", "b": [0.1294, 0.3829, 0.1827, 0.3977]}, {"w": "3.12.", "b": [0.1874, 0.3829, 0.2252, 0.3977]}, {"w": "Validation", "b": [0.2299, 0.3829, 0.3134, 0.3977]}, {"w": "MAE", "b": [0.3181, 0.3829, 0.3622, 0.3977]}, {"w": "by", "b": [0.367, 0.3829, 0.3869, 0.3977]}, {"w": "epoch", "b": [0.3917, 0.3829, 0.439, 0.3977]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 3.30. Plotting validation scores", "words": [{"w": "Listing", "b": [0.1294, 0.6833, 0.1862, 0.6981]}, {"w": "3.30.", "b": [0.1909, 0.6833, 0.2288, 0.6981]}, {"w": "Plotting", "b": [0.2335, 0.6833, 0.2976, 0.6981]}, {"w": "validation", "b": [0.3023, 0.6833, 0.3833, 0.6981]}, {"w": "scores", "b": [0.388, 0.6833, 0.437, 0.6981]}]}, {"id": "b_7", "type": "paragraph", "text": "import matplotlib.pyplot as plt plt.plot(range(1, len(average_mae_history) + 1), average_mae_history) plt.xlabel('Epochs') plt.ylabel('Validation MAE') plt.show()", "words": [{"w": "import", "b": [0.1357, 0.7117, 0.2038, 0.7268]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.7117, 0.4082, 0.7268]}, {"w": "as", "b": [0.4195, 0.7117, 0.4422, 0.7268]}, {"w": "plt", "b": [0.4536, 0.7117, 0.4876, 0.7268]}, {"w": "plt.plot(range(1,", "b": [0.1357, 0.742, 0.3287, 0.7571]}, {"w": "len(average_mae_history)", "b": [0.34, 0.742, 0.6125, 0.7571]}, {"w": "+", "b": [0.6238, 0.742, 0.6352, 0.7571]}, {"w": "1),", "b": [0.6465, 0.742, 0.6806, 0.7571]}, {"w": "average_mae_history)", "b": [0.1357, 0.7571, 0.3628, 0.7723]}, {"w": "plt.xlabel('Epochs')", "b": [0.1357, 0.7723, 0.3628, 0.7874]}, {"w": "plt.ylabel('Validation", "b": [0.1357, 0.7874, 0.3855, 0.8026]}, {"w": "MAE')", "b": [0.3968, 0.7874, 0.4536, 0.8026]}, {"w": "plt.show()", "b": [0.1357, 0.8026, 0.2492, 0.8177]}]}, {"id": "b_8", "type": "paragraph", "text": "It may be a little difficult to see the plot, due to scaling issues and relatively high variance. Let’s do the following:", "words": [{"w": "It", "b": [0.1294, 0.8406, 0.1448, 0.8604]}, {"w": "may", "b": [0.1511, 0.8406, 0.1946, 0.8604]}, {"w": "be", "b": [0.2009, 0.8406, 0.2247, 0.8604]}, {"w": "a", "b": [0.231, 0.8406, 0.2422, 0.8604]}, {"w": "little", "b": [0.2485, 0.8406, 0.2948, 0.8604]}, {"w": "difficult", "b": [0.3011, 0.8406, 0.3818, 0.8604]}, {"w": "to", "b": [0.3882, 0.8406, 0.4078, 0.8604]}, {"w": "see", "b": [0.4141, 0.8406, 0.4463, 0.8604]}, {"w": "the", "b": [0.4526, 0.8406, 0.4834, 0.8604]}, {"w": "plot,", "b": [0.4897, 0.8406, 0.5353, 0.8604]}, {"w": "due", "b": [0.5416, 0.8406, 0.578, 0.8604]}, {"w": "to", "b": [0.5843, 0.8406, 0.604, 0.8604]}, {"w": "scaling", "b": [0.6103, 0.8406, 0.6817, 0.8604]}, {"w": "issues", "b": [0.688, 0.8406, 0.7483, 0.8604]}, {"w": "and", "b": [0.7546, 0.8406, 0.791, 0.8604]}, {"w": "relatively", "b": [0.1294, 0.8611, 0.2247, 0.8809]}, {"w": "high", "b": [0.231, 0.8611, 0.2758, 0.8809]}, {"w": "variance.", "b": [0.2822, 0.8611, 0.3739, 0.8809]}, {"w": "Let’s", "b": [0.3802, 0.8611, 0.4306, 0.8809]}, {"w": "do", "b": [0.4369, 0.8611, 0.4621, 0.8809]}, {"w": "the", "b": [0.4684, 0.8611, 0.4993, 0.8809]}, {"w": "following:", "b": [0.5056, 0.8611, 0.6107, 0.8809]}]}]}, {"page": 136, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Omit the first 10 data points, which are on a different scale than the rest of the curve. Replace each point with an exponential moving average of the previous points, to obtain a smooth curve.", "words": [{"w": "Omit", "b": [0.1799, 0.0857, 0.2317, 0.1054]}, {"w": "the", "b": [0.238, 0.0857, 0.2689, 0.1054]}, {"w": "first", "b": [0.2752, 0.0857, 0.3158, 0.1054]}, {"w": "10", "b": [0.3221, 0.0857, 0.3473, 0.1054]}, {"w": "data", "b": [0.3536, 0.0857, 0.3957, 0.1054]}, {"w": "points,", "b": [0.402, 0.0857, 0.47, 0.1054]}, {"w": "which", "b": [0.4763, 0.0857, 0.5379, 0.1054]}, {"w": "are", "b": [0.5442, 0.0857, 0.575, 0.1054]}, {"w": "on", "b": [0.5813, 0.0857, 0.6066, 0.1054]}, {"w": "a", "b": [0.6129, 0.0857, 0.6241, 0.1054]}, {"w": "different", "b": [0.6304, 0.0857, 0.7167, 0.1054]}, {"w": "scale", "b": [0.723, 0.0857, 0.7734, 0.1054]}, {"w": "than", "b": [0.7797, 0.0857, 0.8232, 0.1054]}, {"w": "the", "b": [0.8295, 0.0857, 0.8603, 0.1054]}, {"w": "rest", "b": [0.1799, 0.1062, 0.2163, 0.1259]}, {"w": "of", "b": [0.2226, 0.1062, 0.2436, 0.1259]}, {"w": "the", "b": [0.2499, 0.1062, 0.2807, 0.1259]}, {"w": "curve.", "b": [0.287, 0.1062, 0.3494, 0.1259]}, {"w": "Replace", "b": [0.1799, 0.1267, 0.2611, 0.1464]}, {"w": "each", "b": [0.2674, 0.1267, 0.3136, 0.1464]}, {"w": "point", "b": [0.3199, 0.1267, 0.3718, 0.1464]}, {"w": "with", "b": [0.3781, 0.1267, 0.423, 0.1464]}, {"w": "an", "b": [0.4293, 0.1267, 0.4531, 0.1464]}, {"w": "exponential", "b": [0.4594, 0.1267, 0.5771, 0.1464]}, {"w": "moving", "b": [0.5834, 0.1267, 0.6605, 0.1464]}, {"w": "average", "b": [0.6668, 0.1267, 0.7452, 0.1464]}, {"w": "of", "b": [0.7515, 0.1267, 0.7725, 0.1464]}, {"w": "the", "b": [0.7788, 0.1267, 0.8097, 0.1464]}, {"w": "previous", "b": [0.1799, 0.1472, 0.2667, 0.1669]}, {"w": "points,", "b": [0.273, 0.1472, 0.341, 0.1669]}, {"w": "to", "b": [0.3473, 0.1472, 0.367, 0.1669]}, {"w": "obtain", "b": [0.3733, 0.1472, 0.4363, 0.1669]}, {"w": "a", "b": [0.4426, 0.1472, 0.4538, 0.1669]}, {"w": "smooth", "b": [0.4601, 0.1472, 0.5344, 0.1669]}, {"w": "curve.", "b": [0.5407, 0.1472, 0.6031, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "The result is shown in figure 3.13.", "words": [{"w": "The", "b": [0.1294, 0.19, 0.1686, 0.2097]}, {"w": "result", "b": [0.1749, 0.19, 0.231, 0.2097]}, {"w": "is", "b": [0.2373, 0.19, 0.2541, 0.2097]}, {"w": "shown", "b": [0.2604, 0.19, 0.3263, 0.2097]}, {"w": "in", "b": [0.3326, 0.19, 0.3522, 0.2097]}, {"w": "figure", "b": [0.3585, 0.19, 0.4188, 0.2097]}, {"w": "3.13.", "b": [0.4251, 0.19, 0.4755, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 3.13. Validation MAE by epoch, excluding the first 10 data points", "words": [{"w": "Figure", "b": [0.1294, 0.2278, 0.1827, 0.2426]}, {"w": "3.13.", "b": [0.1874, 0.2278, 0.2252, 0.2426]}, {"w": "Validation", "b": [0.2299, 0.2278, 0.3134, 0.2426]}, {"w": "MAE", "b": [0.3181, 0.2278, 0.3622, 0.2426]}, {"w": "by", "b": [0.367, 0.2278, 0.3869, 0.2426]}, {"w": "epoch,", "b": [0.3917, 0.2278, 0.4437, 0.2426]}, {"w": "excluding", "b": [0.4484, 0.2278, 0.5262, 0.2426]}, {"w": "the", "b": [0.531, 0.2278, 0.5562, 0.2426]}, {"w": "first", "b": [0.5609, 0.2278, 0.5945, 0.2426]}, {"w": "10", "b": [0.5993, 0.2278, 0.6182, 0.2426]}, {"w": "data", "b": [0.6229, 0.2278, 0.6586, 0.2426]}, {"w": "points", "b": [0.6634, 0.2278, 0.7128, 0.2426]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 3.31. Plotting validation scores, excluding the first 10 data points", "words": [{"w": "Listing", "b": [0.1294, 0.5282, 0.1862, 0.543]}, {"w": "3.31.", "b": [0.1909, 0.5282, 0.2288, 0.543]}, {"w": "Plotting", "b": [0.2335, 0.5282, 0.2976, 0.543]}, {"w": "validation", "b": [0.3023, 0.5282, 0.3833, 0.543]}, {"w": "scores,", "b": [0.388, 0.5282, 0.4418, 0.543]}, {"w": "excluding", "b": [0.4465, 0.5282, 0.5243, 0.543]}, {"w": "the", "b": [0.529, 0.5282, 0.5542, 0.543]}, {"w": "first", "b": [0.559, 0.5282, 0.5926, 0.543]}, {"w": "10", "b": [0.5973, 0.5282, 0.6162, 0.543]}, {"w": "data", "b": [0.621, 0.5282, 0.6567, 0.543]}, {"w": "points", "b": [0.6614, 0.5282, 0.7108, 0.543]}]}, {"id": "b_4", "type": "paragraph", "text": "def smooth_curve(points, factor=0.9): smoothed_points = [] for point in points: if smoothed_points: previous = smoothed_points[-1] smoothed_points.append(previous * factor + point * (1 - factor)) else: smoothed_points.append(point) return smoothed_points smooth_mae_history = smooth_curve(average_mae_history[10:]) plt.plot(range(1, len(smooth_mae_history) + 1), smooth_mae_history) plt.xlabel('Epochs') plt.ylabel('Validation MAE') plt.show()", "words": [{"w": "def", "b": [0.1357, 0.5566, 0.1698, 0.5717]}, {"w": "smooth_curve(points,", "b": [0.1811, 0.5566, 0.4082, 0.5717]}, {"w": "factor=0.9):", "b": [0.4195, 0.5566, 0.5557, 0.5717]}, {"w": "smoothed_points", "b": [0.1584, 0.5717, 0.3287, 0.5869]}, {"w": "=", "b": [0.34, 0.5717, 0.3514, 0.5869]}, {"w": "[]", "b": [0.3628, 0.5717, 0.3855, 0.5869]}, {"w": "for", "b": [0.1584, 0.5869, 0.1925, 0.602]}, {"w": "point", "b": [0.2038, 0.5869, 0.2606, 0.602]}, {"w": "in", "b": [0.2719, 0.5869, 0.2946, 0.602]}, {"w": "points:", "b": [0.306, 0.5869, 0.3855, 0.602]}, {"w": "if", "b": [0.1811, 0.602, 0.2038, 0.6172]}, {"w": "smoothed_points:", "b": [0.2152, 0.602, 0.3968, 0.6172]}, {"w": "previous", "b": [0.2038, 0.6172, 0.2946, 0.6323]}, {"w": "=", "b": [0.306, 0.6172, 0.3173, 0.6323]}, {"w": "smoothed_points[-1]", "b": [0.3287, 0.6172, 0.5444, 0.6323]}, {"w": "smoothed_points.append(previous", "b": [0.2038, 0.6324, 0.5557, 0.6475]}, {"w": "*", "b": [0.5671, 0.6324, 0.5784, 0.6475]}, {"w": "factor", "b": [0.5898, 0.6324, 0.6579, 0.6475]}, {"w": "+", "b": [0.6692, 0.6324, 0.6806, 0.6475]}, {"w": "point", "b": [0.6919, 0.6324, 0.7487, 0.6475]}, {"w": "*", "b": [0.7601, 0.6324, 0.7714, 0.6475]}, {"w": "(1", "b": [0.7828, 0.6324, 0.8055, 0.6475]}, {"w": "-", "b": [0.8168, 0.6324, 0.8282, 0.6475]}, {"w": "factor))", "b": [0.1357, 0.6475, 0.2265, 0.6626]}, {"w": "else:", "b": [0.1811, 0.6627, 0.2379, 0.6778]}, {"w": "smoothed_points.append(point)", "b": [0.2038, 0.6778, 0.533, 0.693]}, {"w": "return", "b": [0.1584, 0.693, 0.2265, 0.7081]}, {"w": "smoothed_points", "b": [0.2379, 0.693, 0.4082, 0.7081]}, {"w": "smooth_mae_history", "b": [0.1357, 0.7233, 0.34, 0.7384]}, {"w": "=", "b": [0.3514, 0.7233, 0.3628, 0.7384]}, {"w": "smooth_curve(average_mae_history[10:])", "b": [0.3741, 0.7233, 0.8055, 0.7384]}, {"w": "plt.plot(range(1,", "b": [0.1357, 0.7536, 0.3287, 0.7687]}, {"w": "len(smooth_mae_history)", "b": [0.34, 0.7536, 0.6011, 0.7687]}, {"w": "+", "b": [0.6125, 0.7536, 0.6238, 0.7687]}, {"w": "1),", "b": [0.6352, 0.7536, 0.6692, 0.7687]}, {"w": "smooth_mae_history)", "b": [0.1357, 0.7687, 0.3514, 0.7839]}, {"w": "plt.xlabel('Epochs')", "b": [0.1357, 0.7839, 0.3628, 0.799]}, {"w": "plt.ylabel('Validation", "b": [0.1357, 0.799, 0.3855, 0.8142]}, {"w": "MAE')", "b": [0.3968, 0.799, 0.4536, 0.8142]}, {"w": "plt.show()", "b": [0.1357, 0.8142, 0.2492, 0.8293]}]}, {"id": "b_5", "type": "paragraph", "text": "According to this plot, validation MAE stops improving significantly after 80 epochs. Past that point, you start overfitting.", "words": [{"w": "According", "b": [0.1294, 0.8522, 0.2359, 0.8719]}, {"w": "to", "b": [0.2422, 0.8522, 0.2618, 0.8719]}, {"w": "this", "b": [0.2681, 0.8522, 0.3046, 0.8719]}, {"w": "plot,", "b": [0.3109, 0.8522, 0.3564, 0.8719]}, {"w": "validation", "b": [0.3628, 0.8522, 0.4637, 0.8719]}, {"w": "MAE", "b": [0.47, 0.8522, 0.526, 0.8719]}, {"w": "stops", "b": [0.5323, 0.8522, 0.5842, 0.8719]}, {"w": "improving", "b": [0.5905, 0.8522, 0.6956, 0.8719]}, {"w": "significantly", "b": [0.7019, 0.8522, 0.828, 0.8719]}, {"w": "after", "b": [0.1294, 0.8727, 0.1756, 0.8924]}, {"w": "80", "b": [0.1819, 0.8727, 0.2072, 0.8924]}, {"w": "epochs.", "b": [0.2135, 0.8727, 0.2898, 0.8924]}, {"w": "Past", "b": [0.2961, 0.8727, 0.3382, 0.8924]}, {"w": "that", "b": [0.3445, 0.8727, 0.3823, 0.8924]}, {"w": "point,", "b": [0.3886, 0.8727, 0.4468, 0.8924]}, {"w": "you", "b": [0.4531, 0.8727, 0.4909, 0.8924]}, {"w": "start", "b": [0.4973, 0.8727, 0.5407, 0.8924]}, {"w": "overfitting.", "b": [0.547, 0.8727, 0.6598, 0.8924]}]}]}, {"page": 137, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Once you’re finished tuning other parameters of the model (in addition to the number of epochs, you could also adjust the size of the hidden layers), you can train a final production model on all of the training data, with the best parameters, and then look at its performance on the test data.", "words": [{"w": "Once", "b": [0.1294, 0.0857, 0.1826, 0.1054]}, {"w": "you’re", "b": [0.1889, 0.0857, 0.2548, 0.1054]}, {"w": "finished", "b": [0.2611, 0.0857, 0.3424, 0.1054]}, {"w": "tuning", "b": [0.3487, 0.0857, 0.4132, 0.1054]}, {"w": "other", "b": [0.4195, 0.0857, 0.4713, 0.1054]}, {"w": "parameters", "b": [0.4776, 0.0857, 0.5883, 0.1054]}, {"w": "of", "b": [0.5946, 0.0857, 0.6156, 0.1054]}, {"w": "the", "b": [0.6219, 0.0857, 0.6527, 0.1054]}, {"w": "model", "b": [0.659, 0.0857, 0.7221, 0.1054]}, {"w": "(in", "b": [0.7284, 0.0857, 0.7564, 0.1054]}, {"w": "addition", "b": [0.7627, 0.0857, 0.8454, 0.1054]}, {"w": "to", "b": [0.1294, 0.1062, 0.149, 0.1259]}, {"w": "the", "b": [0.1553, 0.1062, 0.1862, 0.1259]}, {"w": "number", "b": [0.1925, 0.1062, 0.2695, 0.1259]}, {"w": "of", "b": [0.2758, 0.1062, 0.2969, 0.1259]}, {"w": "epochs,", "b": [0.3032, 0.1062, 0.3795, 0.1259]}, {"w": "you", "b": [0.3858, 0.1062, 0.4237, 0.1259]}, {"w": "could", "b": [0.43, 0.1062, 0.486, 0.1259]}, {"w": "also", "b": [0.4923, 0.1062, 0.533, 0.1259]}, {"w": "adjust", "b": [0.5393, 0.1062, 0.5995, 0.1259]}, {"w": "the", "b": [0.6059, 0.1062, 0.6367, 0.1259]}, {"w": "size", "b": [0.6429, 0.1062, 0.6821, 0.1259]}, {"w": "of", "b": [0.6884, 0.1062, 0.7095, 0.1259]}, {"w": "the", "b": [0.7158, 0.1062, 0.7466, 0.1259]}, {"w": "hidden", "b": [0.7529, 0.1062, 0.8216, 0.1259]}, {"w": "layers),", "b": [0.1294, 0.1267, 0.2044, 0.1464]}, {"w": "you", "b": [0.2107, 0.1267, 0.2485, 0.1464]}, {"w": "can", "b": [0.2548, 0.1267, 0.2898, 0.1464]}, {"w": "train", "b": [0.2961, 0.1267, 0.3424, 0.1464]}, {"w": "a", "b": [0.3487, 0.1267, 0.3599, 0.1464]}, {"w": "final", "b": [0.3662, 0.1267, 0.4124, 0.1464]}, {"w": "production", "b": [0.4187, 0.1267, 0.528, 0.1464]}, {"w": "model", "b": [0.5343, 0.1267, 0.5974, 0.1464]}, {"w": "on", "b": [0.6037, 0.1267, 0.6289, 0.1464]}, {"w": "all", "b": [0.6352, 0.1267, 0.6605, 0.1464]}, {"w": "of", "b": [0.6668, 0.1267, 0.6878, 0.1464]}, {"w": "the", "b": [0.6941, 0.1267, 0.7249, 0.1464]}, {"w": "training", "b": [0.7312, 0.1267, 0.8097, 0.1464]}, {"w": "data,", "b": [0.816, 0.1267, 0.8643, 0.1464]}, {"w": "with", "b": [0.1294, 0.1472, 0.1743, 0.1669]}, {"w": "the", "b": [0.1806, 0.1472, 0.2114, 0.1669]}, {"w": "best", "b": [0.2177, 0.1472, 0.2583, 0.1669]}, {"w": "parameters,", "b": [0.2646, 0.1472, 0.3816, 0.1669]}, {"w": "and", "b": [0.3879, 0.1472, 0.4243, 0.1669]}, {"w": "then", "b": [0.4306, 0.1472, 0.474, 0.1669]}, {"w": "look", "b": [0.4804, 0.1472, 0.5252, 0.1669]}, {"w": "at", "b": [0.5315, 0.1472, 0.5497, 0.1669]}, {"w": "its", "b": [0.556, 0.1472, 0.5799, 0.1669]}, {"w": "performance", "b": [0.5862, 0.1472, 0.7136, 0.1669]}, {"w": "on", "b": [0.7199, 0.1472, 0.7452, 0.1669]}, {"w": "the", "b": [0.7515, 0.1472, 0.7823, 0.1669]}, {"w": "test", "b": [0.7886, 0.1472, 0.8237, 0.1669]}, {"w": "data.", "b": [0.1294, 0.1677, 0.1777, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.32. Training the final model", "words": [{"w": "Listing", "b": [0.1294, 0.2055, 0.1862, 0.2203]}, {"w": "3.32.", "b": [0.1909, 0.2055, 0.2288, 0.2203]}, {"w": "Training", "b": [0.2335, 0.2055, 0.3036, 0.2203]}, {"w": "the", "b": [0.3083, 0.2055, 0.3335, 0.2203]}, {"w": "final", "b": [0.3382, 0.2055, 0.375, 0.2203]}, {"w": "model", "b": [0.3798, 0.2055, 0.4292, 0.2203]}]}, {"id": "b_2", "type": "paragraph", "text": "model = build_model() 1 model.fit(train_data, train_targets, 2 epochs=80, batch_size=16, verbose=0) test_mse_score, test_mae_score = model.evaluate(test_data, test_targets)", "words": [{"w": "model", "b": [0.1357, 0.2339, 0.1925, 0.2491]}, {"w": "=", "b": [0.2038, 0.2339, 0.2152, 0.2491]}, {"w": "build_model()", "b": [0.2265, 0.2339, 0.3741, 0.2491]}, {"w": "1", "b": [0.1357, 0.2491, 0.1471, 0.2642]}, {"w": "model.fit(train_data,", "b": [0.1357, 0.2642, 0.3741, 0.2794]}, {"w": "train_targets,", "b": [0.3855, 0.2642, 0.5444, 0.2794]}, {"w": "2", "b": [0.1357, 0.2794, 0.1471, 0.2945]}, {"w": "epochs=80,", "b": [0.2492, 0.2945, 0.3628, 0.3097]}, {"w": "batch_size=16,", "b": [0.3741, 0.2945, 0.533, 0.3097]}, {"w": "verbose=0)", "b": [0.5444, 0.2945, 0.6579, 0.3097]}, {"w": "test_mse_score,", "b": [0.1357, 0.3097, 0.306, 0.3248]}, {"w": "test_mae_score", "b": [0.3173, 0.3097, 0.4763, 0.3248]}, {"w": "=", "b": [0.4876, 0.3097, 0.499, 0.3248]}, {"w": "model.evaluate(test_data,", "b": [0.5103, 0.3097, 0.7941, 0.3248]}, {"w": "test_targets)", "b": [0.1357, 0.3248, 0.2833, 0.34]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Gets a fresh, compiled model 2 Trains it on the entirety of the data", "words": [{"w": "1", "b": [0.1799, 0.3584, 0.1925, 0.3782]}, {"w": "Gets", "b": [0.1988, 0.3584, 0.2478, 0.3782]}, {"w": "a", "b": [0.2541, 0.3584, 0.2667, 0.3782]}, {"w": "fresh,", "b": [0.273, 0.3584, 0.3335, 0.3782]}, {"w": "compiled", "b": [0.3398, 0.3584, 0.4379, 0.3782]}, {"w": "model", "b": [0.4442, 0.3584, 0.5101, 0.3782]}, {"w": "2", "b": [0.1799, 0.3789, 0.1925, 0.3987]}, {"w": "Trains", "b": [0.1988, 0.3789, 0.2684, 0.3987]}, {"w": "it", "b": [0.2747, 0.3789, 0.2901, 0.3987]}, {"w": "on", "b": [0.2964, 0.3789, 0.3231, 0.3987]}, {"w": "the", "b": [0.3294, 0.3789, 0.363, 0.3987]}, {"w": "entirety", "b": [0.3693, 0.3789, 0.4529, 0.3987]}, {"w": "of", "b": [0.4592, 0.3789, 0.4802, 0.3987]}, {"w": "the", "b": [0.4865, 0.3789, 0.5201, 0.3987]}, {"w": "data", "b": [0.5265, 0.3789, 0.5741, 0.3987]}]}, {"id": "b_4", "type": "paragraph", "text": "Here’s the final result:", "words": [{"w": "Here’s", "b": [0.1294, 0.4217, 0.1952, 0.4414]}, {"w": "the", "b": [0.2016, 0.4217, 0.2324, 0.4414]}, {"w": "final", "b": [0.2387, 0.4217, 0.2849, 0.4414]}, {"w": "result:", "b": [0.2912, 0.4217, 0.3543, 0.4414]}]}, {"id": "b_5", "type": "equation", "text": ">>> test_mae_score 2.5532484335057877", "words": [{"w": ">>>", "b": [0.1357, 0.4594, 0.1698, 0.4746]}, {"w": "test_mae_score", "b": [0.1811, 0.4594, 0.34, 0.4746]}, {"w": "2.5532484335057877", "b": [0.1357, 0.4746, 0.34, 0.4897]}]}, {"id": "b_6", "type": "paragraph", "text": "You’re still off by about $2,550.", "words": [{"w": "You’re", "b": [0.1294, 0.5126, 0.1983, 0.5324]}, {"w": "still", "b": [0.2046, 0.5126, 0.2425, 0.5324]}, {"w": "off", "b": [0.2488, 0.5126, 0.2777, 0.5324]}, {"w": "by", "b": [0.2841, 0.5126, 0.3093, 0.5324]}, {"w": "about", "b": [0.3156, 0.5126, 0.3716, 0.5324]}, {"w": "$2,550.", "b": [0.3779, 0.5126, 0.4536, 0.5324]}]}, {"id": "b_7", "type": "paragraph", "text": "3.6.5. Wrapping up", "words": [{"w": "3.6.5.", "b": [0.1294, 0.5599, 0.1862, 0.5796]}, {"w": "Wrapping", "b": [0.1925, 0.5599, 0.3028, 0.5796]}, {"w": "up", "b": [0.3091, 0.5599, 0.3371, 0.5796]}]}, {"id": "b_8", "type": "paragraph", "text": "Here’s what you should take away from this example:", "words": [{"w": "Here’s", "b": [0.1294, 0.6026, 0.1952, 0.6224]}, {"w": "what", "b": [0.2016, 0.6026, 0.2506, 0.6224]}, {"w": "you", "b": [0.2569, 0.6026, 0.2947, 0.6224]}, {"w": "should", "b": [0.301, 0.6026, 0.3683, 0.6224]}, {"w": "take", "b": [0.3746, 0.6026, 0.4167, 0.6224]}, {"w": "away", "b": [0.423, 0.6026, 0.4762, 0.6224]}, {"w": "from", "b": [0.4825, 0.6026, 0.5315, 0.6224]}, {"w": "this", "b": [0.5378, 0.6026, 0.5743, 0.6224]}, {"w": "example:", "b": [0.5806, 0.6026, 0.6731, 0.6224]}]}, {"id": "b_9", "type": "paragraph", "text": "Regression is done using different loss functions than what we used for classification. Mean squared error (MSE) is a loss function commonly used for regression. Similarly, evaluation metrics to be used for regression differ from those used for classification; naturally, the concept of accuracy doesn’t apply for regression. A common regression metric is mean absolute error (MAE). When features in the input data have values in different ranges, each feature should be scaled independently as a preprocessing step. When there is little data available, using K-fold validation is a great way to reliably evaluate a model. When little training data is available, it’s preferable to use a small network with few hidden layers (typically only one or two), in order", "words": [{"w": "Regression", "b": [0.1799, 0.641, 0.292, 0.6607]}, {"w": "is", "b": [0.2983, 0.641, 0.3151, 0.6607]}, {"w": "done", "b": [0.3214, 0.641, 0.3704, 0.6607]}, {"w": "using", "b": [0.3768, 0.641, 0.4314, 0.6607]}, {"w": "different", "b": [0.4377, 0.641, 0.5241, 0.6607]}, {"w": "loss", "b": [0.5304, 0.641, 0.5697, 0.6607]}, {"w": "functions", "b": [0.576, 0.641, 0.6699, 0.6607]}, {"w": "than", "b": [0.6762, 0.641, 0.7196, 0.6607]}, {"w": "what", "b": [0.7259, 0.641, 0.775, 0.6607]}, {"w": "we", "b": [0.7813, 0.641, 0.8107, 0.6607]}, {"w": "used", "b": [0.817, 0.641, 0.8632, 0.6607]}, {"w": "for", "b": [0.1799, 0.6615, 0.2093, 0.6812]}, {"w": "classification.", "b": [0.2156, 0.6615, 0.355, 0.6812]}, {"w": "Mean", "b": [0.3613, 0.6615, 0.4188, 0.6812]}, {"w": "squared", "b": [0.4251, 0.6615, 0.5035, 0.6812]}, {"w": "error", "b": [0.5098, 0.6615, 0.5588, 0.6812]}, {"w": "(MSE)", "b": [0.5651, 0.6615, 0.6338, 0.6812]}, {"w": "is", "b": [0.6401, 0.6615, 0.6569, 0.6812]}, {"w": "a", "b": [0.6632, 0.6615, 0.6744, 0.6812]}, {"w": "loss", "b": [0.6807, 0.6615, 0.72, 0.6812]}, {"w": "function", "b": [0.7263, 0.6615, 0.8103, 0.6812]}, {"w": "commonly", "b": [0.1799, 0.682, 0.2878, 0.7017]}, {"w": "used", "b": [0.2941, 0.682, 0.3403, 0.7017]}, {"w": "for", "b": [0.3466, 0.682, 0.376, 0.7017]}, {"w": "regression.", "b": [0.3824, 0.682, 0.4923, 0.7017]}, {"w": "Similarly,", "b": [0.1799, 0.7025, 0.2784, 0.7222]}, {"w": "evaluation", "b": [0.2847, 0.7025, 0.3898, 0.7222]}, {"w": "metrics", "b": [0.3961, 0.7025, 0.4704, 0.7222]}, {"w": "to", "b": [0.4767, 0.7025, 0.4963, 0.7222]}, {"w": "be", "b": [0.5026, 0.7025, 0.5264, 0.7222]}, {"w": "used", "b": [0.5328, 0.7025, 0.579, 0.7222]}, {"w": "for", "b": [0.5853, 0.7025, 0.6147, 0.7222]}, {"w": "regression", "b": [0.621, 0.7025, 0.7247, 0.7222]}, {"w": "differ", "b": [0.731, 0.7025, 0.7865, 0.7222]}, {"w": "from", "b": [0.7928, 0.7025, 0.8419, 0.7222]}, {"w": "those", "b": [0.1799, 0.723, 0.2331, 0.7427]}, {"w": "used", "b": [0.2394, 0.723, 0.2857, 0.7427]}, {"w": "for", "b": [0.292, 0.723, 0.3214, 0.7427]}, {"w": "classification;", "b": [0.3277, 0.723, 0.4678, 0.7427]}, {"w": "naturally,", "b": [0.4741, 0.723, 0.5684, 0.7427]}, {"w": "the", "b": [0.5747, 0.723, 0.6055, 0.7427]}, {"w": "concept", "b": [0.6119, 0.723, 0.6903, 0.7427]}, {"w": "of", "b": [0.6966, 0.723, 0.7176, 0.7427]}, {"w": "accuracy", "b": [0.7239, 0.723, 0.8135, 0.7427]}, {"w": "doesn’t", "b": [0.1799, 0.7435, 0.2537, 0.7632]}, {"w": "apply", "b": [0.26, 0.7435, 0.316, 0.7632]}, {"w": "for", "b": [0.3223, 0.7435, 0.3518, 0.7632]}, {"w": "regression.", "b": [0.3581, 0.7435, 0.468, 0.7632]}, {"w": "A", "b": [0.4743, 0.7435, 0.4926, 0.7632]}, {"w": "common", "b": [0.4989, 0.7435, 0.5872, 0.7632]}, {"w": "regression", "b": [0.5935, 0.7435, 0.6971, 0.7632]}, {"w": "metric", "b": [0.7034, 0.7435, 0.7679, 0.7632]}, {"w": "is", "b": [0.7742, 0.7435, 0.791, 0.7632]}, {"w": "mean", "b": [0.7973, 0.7435, 0.852, 0.7632]}, {"w": "absolute", "b": [0.1799, 0.764, 0.2639, 0.7837]}, {"w": "error", "b": [0.2702, 0.764, 0.3193, 0.7837]}, {"w": "(MAE).", "b": [0.3256, 0.764, 0.4047, 0.7837]}, {"w": "When", "b": [0.1799, 0.7845, 0.2401, 0.8042]}, {"w": "features", "b": [0.2464, 0.7845, 0.3262, 0.8042]}, {"w": "in", "b": [0.3326, 0.7845, 0.3522, 0.8042]}, {"w": "the", "b": [0.3585, 0.7845, 0.3893, 0.8042]}, {"w": "input", "b": [0.3956, 0.7845, 0.4475, 0.8042]}, {"w": "data", "b": [0.4538, 0.7845, 0.4958, 0.8042]}, {"w": "have", "b": [0.5021, 0.7845, 0.5497, 0.8042]}, {"w": "values", "b": [0.5561, 0.7845, 0.6205, 0.8042]}, {"w": "in", "b": [0.6268, 0.7845, 0.6464, 0.8042]}, {"w": "different", "b": [0.6527, 0.7845, 0.7391, 0.8042]}, {"w": "ranges,", "b": [0.7454, 0.7845, 0.8175, 0.8042]}, {"w": "each", "b": [0.8238, 0.7845, 0.87, 0.8042]}, {"w": "feature", "b": [0.1799, 0.805, 0.2499, 0.8247]}, {"w": "should", "b": [0.2562, 0.805, 0.3235, 0.8247]}, {"w": "be", "b": [0.3298, 0.805, 0.3536, 0.8247]}, {"w": "scaled", "b": [0.3599, 0.805, 0.4229, 0.8247]}, {"w": "independently", "b": [0.4292, 0.805, 0.5722, 0.8247]}, {"w": "as", "b": [0.5785, 0.805, 0.5995, 0.8247]}, {"w": "a", "b": [0.6058, 0.805, 0.617, 0.8247]}, {"w": "preprocessing", "b": [0.6233, 0.805, 0.7634, 0.8247]}, {"w": "step.", "b": [0.7696, 0.805, 0.8166, 0.8247]}, {"w": "When", "b": [0.1799, 0.8255, 0.2401, 0.8452]}, {"w": "there", "b": [0.2464, 0.8255, 0.2968, 0.8452]}, {"w": "is", "b": [0.3031, 0.8255, 0.32, 0.8452]}, {"w": "little", "b": [0.3263, 0.8255, 0.3725, 0.8452]}, {"w": "data", "b": [0.3788, 0.8255, 0.4209, 0.8452]}, {"w": "available,", "b": [0.4272, 0.8255, 0.5245, 0.8452]}, {"w": "using", "b": [0.5309, 0.8255, 0.5855, 0.8452]}, {"w": "K-fold", "b": [0.5918, 0.8255, 0.6591, 0.8452]}, {"w": "validation", "b": [0.6654, 0.8255, 0.7663, 0.8452]}, {"w": "is", "b": [0.7726, 0.8255, 0.7894, 0.8452]}, {"w": "a", "b": [0.7957, 0.8255, 0.8069, 0.8452]}, {"w": "great", "b": [0.8132, 0.8255, 0.8637, 0.8452]}, {"w": "way", "b": [0.1799, 0.846, 0.2219, 0.8657]}, {"w": "to", "b": [0.2282, 0.846, 0.2478, 0.8657]}, {"w": "reliably", "b": [0.2541, 0.846, 0.3312, 0.8657]}, {"w": "evaluate", "b": [0.3375, 0.846, 0.4216, 0.8657]}, {"w": "a", "b": [0.4279, 0.846, 0.4391, 0.8657]}, {"w": "model.", "b": [0.4454, 0.846, 0.5147, 0.8657]}, {"w": "When", "b": [0.1799, 0.8665, 0.2401, 0.8862]}, {"w": "little", "b": [0.2464, 0.8665, 0.2927, 0.8862]}, {"w": "training", "b": [0.299, 0.8665, 0.3775, 0.8862]}, {"w": "data", "b": [0.3838, 0.8665, 0.4258, 0.8862]}, {"w": "is", "b": [0.4321, 0.8665, 0.4489, 0.8862]}, {"w": "available,", "b": [0.4552, 0.8665, 0.5526, 0.8862]}, {"w": "it’s", "b": [0.5589, 0.8665, 0.5897, 0.8862]}, {"w": "preferable", "b": [0.596, 0.8665, 0.6982, 0.8862]}, {"w": "to", "b": [0.7045, 0.8665, 0.7241, 0.8862]}, {"w": "use", "b": [0.7304, 0.8665, 0.7641, 0.8862]}, {"w": "a", "b": [0.7704, 0.8665, 0.7816, 0.8862]}, {"w": "small", "b": [0.7879, 0.8665, 0.8425, 0.8862]}, {"w": "network", "b": [0.1799, 0.887, 0.2625, 0.9067]}, {"w": "with", "b": [0.2688, 0.887, 0.3137, 0.9067]}, {"w": "few", "b": [0.32, 0.887, 0.3578, 0.9067]}, {"w": "hidden", "b": [0.3641, 0.887, 0.4328, 0.9067]}, {"w": "layers", "b": [0.4391, 0.887, 0.4993, 0.9067]}, {"w": "(typically", "b": [0.5056, 0.887, 0.6023, 0.9067]}, {"w": "only", "b": [0.6086, 0.887, 0.6535, 0.9067]}, {"w": "one", "b": [0.6598, 0.887, 0.6962, 0.9067]}, {"w": "or", "b": [0.7025, 0.887, 0.7235, 0.9067]}, {"w": "two),", "b": [0.7298, 0.887, 0.7823, 0.9067]}, {"w": "in", "b": [0.7886, 0.887, 0.8082, 0.9067]}, {"w": "order", "b": [0.8146, 0.887, 0.8678, 0.9067]}]}]}, {"page": 138, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "to avoid severe overfitting.", "words": [{"w": "to", "b": [0.1799, 0.0857, 0.1995, 0.1054]}, {"w": "avoid", "b": [0.2058, 0.0857, 0.2618, 0.1054]}, {"w": "severe", "b": [0.2682, 0.0857, 0.3326, 0.1054]}, {"w": "overfitting.", "b": [0.3389, 0.0857, 0.4517, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1294, 0.1374, 0.2191, 0.1571]}, {"w": "summary", "b": [0.2254, 0.1374, 0.3277, 0.1571]}]}, {"id": "b_2", "type": "paragraph", "text": "You’re now able to handle the most common kinds of machine- learning tasks on vector data: binary classification, multiclass classification, and scalar regression. The “Wrapping up” sections earlier in the chapter summarize the important points you’ve learned regarding these types of tasks. You’ll usually need to preprocess raw data before feeding it into a neural network. When your data has features with different ranges, scale each feature independently as part of preprocessing. As training progresses, neural networks eventually begin to overfit and obtain worse results on never-before-seen data. If you don’t have much training data, use a small network with only one or two hidden layers, to avoid severe overfitting. If your data is divided into many categories, you may cause information bottlenecks if you make the intermediate layers too small. Regression uses different loss functions and different evaluation metrics than classification. When you’re working with little data, K-fold validation can help reliably evaluate your model.", "words": [{"w": "You’re", "b": [0.1799, 0.1757, 0.2488, 0.1954]}, {"w": "now", "b": [0.2551, 0.1757, 0.2985, 0.1954]}, {"w": "able", "b": [0.3048, 0.1757, 0.3469, 0.1954]}, {"w": "to", "b": [0.3532, 0.1757, 0.3728, 0.1954]}, {"w": "handle", "b": [0.3791, 0.1757, 0.4464, 0.1954]}, {"w": "the", "b": [0.4527, 0.1757, 0.4835, 0.1954]}, {"w": "most", "b": [0.4898, 0.1757, 0.5389, 0.1954]}, {"w": "common", "b": [0.5452, 0.1757, 0.6334, 0.1954]}, {"w": "kinds", "b": [0.6398, 0.1757, 0.6944, 0.1954]}, {"w": "of", "b": [0.7007, 0.1757, 0.7217, 0.1954]}, {"w": "machine-", "b": [0.728, 0.1757, 0.8219, 0.1954]}, {"w": "learning", "b": [0.1799, 0.1962, 0.2625, 0.2159]}, {"w": "tasks", "b": [0.2688, 0.1962, 0.3193, 0.2159]}, {"w": "on", "b": [0.3256, 0.1962, 0.3508, 0.2159]}, {"w": "vector", "b": [0.3571, 0.1962, 0.4202, 0.2159]}, {"w": "data:", "b": [0.4265, 0.1962, 0.4755, 0.2159]}, {"w": "binary", "b": [0.4818, 0.1962, 0.5463, 0.2159]}, {"w": "classification,", "b": [0.5526, 0.1962, 0.692, 0.2159]}, {"w": "multiclass", "b": [0.6983, 0.1962, 0.8006, 0.2159]}, {"w": "classification,", "b": [0.1799, 0.2167, 0.3193, 0.2364]}, {"w": "and", "b": [0.3256, 0.2167, 0.362, 0.2364]}, {"w": "scalar", "b": [0.3683, 0.2167, 0.4272, 0.2364]}, {"w": "regression.", "b": [0.4335, 0.2167, 0.5434, 0.2364]}, {"w": "The", "b": [0.5497, 0.2167, 0.589, 0.2364]}, {"w": "“Wrapping", "b": [0.5953, 0.2167, 0.7063, 0.2364]}, {"w": "up”", "b": [0.7126, 0.2167, 0.749, 0.2364]}, {"w": "sections", "b": [0.7553, 0.2167, 0.8366, 0.2364]}, {"w": "earlier", "b": [0.1799, 0.2372, 0.2443, 0.2569]}, {"w": "in", "b": [0.2506, 0.2372, 0.2702, 0.2569]}, {"w": "the", "b": [0.2765, 0.2372, 0.3074, 0.2569]}, {"w": "chapter", "b": [0.3137, 0.2372, 0.3879, 0.2569]}, {"w": "summarize", "b": [0.3942, 0.2372, 0.5049, 0.2569]}, {"w": "the", "b": [0.5112, 0.2372, 0.542, 0.2569]}, {"w": "important", "b": [0.5483, 0.2372, 0.6464, 0.2569]}, {"w": "points", "b": [0.6527, 0.2372, 0.7144, 0.2569]}, {"w": "you’ve", "b": [0.7207, 0.2372, 0.7908, 0.2569]}, {"w": "learned", "b": [0.1799, 0.2577, 0.2541, 0.2774]}, {"w": "regarding", "b": [0.2604, 0.2577, 0.3571, 0.2774]}, {"w": "these", "b": [0.3634, 0.2577, 0.4152, 0.2774]}, {"w": "types", "b": [0.4215, 0.2577, 0.4748, 0.2774]}, {"w": "of", "b": [0.4811, 0.2577, 0.5021, 0.2774]}, {"w": "tasks.", "b": [0.5084, 0.2577, 0.5652, 0.2774]}, {"w": "You’ll", "b": [0.1799, 0.2782, 0.2432, 0.2979]}, {"w": "usually", "b": [0.2495, 0.2782, 0.3224, 0.2979]}, {"w": "need", "b": [0.3287, 0.2782, 0.3763, 0.2979]}, {"w": "to", "b": [0.3826, 0.2782, 0.4023, 0.2979]}, {"w": "preprocess", "b": [0.4086, 0.2782, 0.5164, 0.2979]}, {"w": "raw", "b": [0.5227, 0.2782, 0.5605, 0.2979]}, {"w": "data", "b": [0.5669, 0.2782, 0.6089, 0.2979]}, {"w": "before", "b": [0.6152, 0.2782, 0.6796, 0.2979]}, {"w": "feeding", "b": [0.6859, 0.2782, 0.7616, 0.2979]}, {"w": "it", "b": [0.7679, 0.2782, 0.7819, 0.2979]}, {"w": "into", "b": [0.7882, 0.2782, 0.8275, 0.2979]}, {"w": "a", "b": [0.8338, 0.2782, 0.845, 0.2979]}, {"w": "neural", "b": [0.1799, 0.2987, 0.2429, 0.3184]}, {"w": "network.", "b": [0.2492, 0.2987, 0.3382, 0.3184]}, {"w": "When", "b": [0.1799, 0.3192, 0.2401, 0.3389]}, {"w": "your", "b": [0.2464, 0.3192, 0.2926, 0.3389]}, {"w": "data", "b": [0.299, 0.3192, 0.341, 0.3389]}, {"w": "has", "b": [0.3473, 0.3192, 0.3809, 0.3389]}, {"w": "features", "b": [0.3872, 0.3192, 0.4671, 0.3389]}, {"w": "with", "b": [0.4734, 0.3192, 0.5182, 0.3389]}, {"w": "different", "b": [0.5245, 0.3192, 0.6109, 0.3389]}, {"w": "ranges,", "b": [0.6172, 0.3192, 0.6893, 0.3389]}, {"w": "scale", "b": [0.6956, 0.3192, 0.7461, 0.3389]}, {"w": "each", "b": [0.7524, 0.3192, 0.7986, 0.3389]}, {"w": "feature", "b": [0.1799, 0.3397, 0.2499, 0.3594]}, {"w": "independently", "b": [0.2562, 0.3397, 0.3991, 0.3594]}, {"w": "as", "b": [0.4054, 0.3397, 0.4264, 0.3594]}, {"w": "part", "b": [0.4328, 0.3397, 0.472, 0.3594]}, {"w": "of", "b": [0.4783, 0.3397, 0.4993, 0.3594]}, {"w": "preprocessing.", "b": [0.5056, 0.3397, 0.652, 0.3594]}, {"w": "As", "b": [0.1799, 0.3602, 0.2079, 0.3799]}, {"w": "training", "b": [0.2142, 0.3602, 0.2927, 0.3799]}, {"w": "progresses,", "b": [0.299, 0.3602, 0.4118, 0.3799]}, {"w": "neural", "b": [0.4181, 0.3602, 0.4811, 0.3799]}, {"w": "networks", "b": [0.4874, 0.3602, 0.5799, 0.3799]}, {"w": "eventually", "b": [0.5862, 0.3602, 0.6913, 0.3799]}, {"w": "begin", "b": [0.6976, 0.3602, 0.7536, 0.3799]}, {"w": "to", "b": [0.76, 0.3602, 0.7796, 0.3799]}, {"w": "overfit", "b": [0.7859, 0.3602, 0.8531, 0.3799]}, {"w": "and", "b": [0.1799, 0.3807, 0.2163, 0.4004]}, {"w": "obtain", "b": [0.2226, 0.3807, 0.2857, 0.4004]}, {"w": "worse", "b": [0.292, 0.3807, 0.3522, 0.4004]}, {"w": "results", "b": [0.3585, 0.3807, 0.4244, 0.4004]}, {"w": "on", "b": [0.4307, 0.3807, 0.4559, 0.4004]}, {"w": "never-before-seen", "b": [0.4622, 0.3807, 0.6438, 0.4004]}, {"w": "data.", "b": [0.6501, 0.3807, 0.6984, 0.4004]}, {"w": "If", "b": [0.1799, 0.4012, 0.1967, 0.4209]}, {"w": "you", "b": [0.203, 0.4012, 0.2408, 0.4209]}, {"w": "don’t", "b": [0.2471, 0.4012, 0.2999, 0.4209]}, {"w": "have", "b": [0.3062, 0.4012, 0.3538, 0.4209]}, {"w": "much", "b": [0.3602, 0.4012, 0.4162, 0.4209]}, {"w": "training", "b": [0.4225, 0.4012, 0.501, 0.4209]}, {"w": "data,", "b": [0.5073, 0.4012, 0.5556, 0.4209]}, {"w": "use", "b": [0.5619, 0.4012, 0.5956, 0.4209]}, {"w": "a", "b": [0.6019, 0.4012, 0.6131, 0.4209]}, {"w": "small", "b": [0.6194, 0.4012, 0.674, 0.4209]}, {"w": "network", "b": [0.6803, 0.4012, 0.763, 0.4209]}, {"w": "with", "b": [0.7693, 0.4012, 0.8142, 0.4209]}, {"w": "only", "b": [0.8205, 0.4012, 0.8653, 0.4209]}, {"w": "one", "b": [0.1799, 0.4217, 0.2163, 0.4414]}, {"w": "or", "b": [0.2226, 0.4217, 0.2436, 0.4414]}, {"w": "two", "b": [0.2499, 0.4217, 0.2878, 0.4414]}, {"w": "hidden", "b": [0.2941, 0.4217, 0.3627, 0.4414]}, {"w": "layers,", "b": [0.369, 0.4217, 0.4356, 0.4414]}, {"w": "to", "b": [0.4419, 0.4217, 0.4615, 0.4414]}, {"w": "avoid", "b": [0.4678, 0.4217, 0.5239, 0.4414]}, {"w": "severe", "b": [0.5302, 0.4217, 0.5946, 0.4414]}, {"w": "overfitting.", "b": [0.6009, 0.4217, 0.7137, 0.4414]}, {"w": "If", "b": [0.1799, 0.4422, 0.1967, 0.4619]}, {"w": "your", "b": [0.203, 0.4422, 0.2492, 0.4619]}, {"w": "data", "b": [0.2555, 0.4422, 0.2975, 0.4619]}, {"w": "is", "b": [0.3038, 0.4422, 0.3207, 0.4619]}, {"w": "divided", "b": [0.327, 0.4422, 0.4027, 0.4619]}, {"w": "into", "b": [0.409, 0.4422, 0.4482, 0.4619]}, {"w": "many", "b": [0.4545, 0.4422, 0.5106, 0.4619]}, {"w": "categories,", "b": [0.5169, 0.4422, 0.6255, 0.4619]}, {"w": "you", "b": [0.6318, 0.4422, 0.6696, 0.4619]}, {"w": "may", "b": [0.6759, 0.4422, 0.7193, 0.4619]}, {"w": "cause", "b": [0.7256, 0.4422, 0.7817, 0.4619]}, {"w": "information", "b": [0.1799, 0.4627, 0.299, 0.4824]}, {"w": "bottlenecks", "b": [0.3053, 0.4627, 0.4202, 0.4824]}, {"w": "if", "b": [0.4265, 0.4627, 0.4419, 0.4824]}, {"w": "you", "b": [0.4482, 0.4627, 0.4861, 0.4824]}, {"w": "make", "b": [0.4924, 0.4627, 0.547, 0.4824]}, {"w": "the", "b": [0.5533, 0.4627, 0.5841, 0.4824]}, {"w": "intermediate", "b": [0.5904, 0.4627, 0.7165, 0.4824]}, {"w": "layers", "b": [0.7228, 0.4627, 0.7831, 0.4824]}, {"w": "too", "b": [0.7894, 0.4627, 0.8216, 0.4824]}, {"w": "small.", "b": [0.1799, 0.4832, 0.2408, 0.5029]}, {"w": "Regression", "b": [0.1799, 0.5037, 0.292, 0.5234]}, {"w": "uses", "b": [0.2983, 0.5037, 0.3417, 0.5234]}, {"w": "different", "b": [0.348, 0.5037, 0.4344, 0.5234]}, {"w": "loss", "b": [0.4407, 0.5037, 0.48, 0.5234]}, {"w": "functions", "b": [0.4863, 0.5037, 0.5802, 0.5234]}, {"w": "and", "b": [0.5865, 0.5037, 0.6229, 0.5234]}, {"w": "different", "b": [0.6292, 0.5037, 0.7156, 0.5234]}, {"w": "evaluation", "b": [0.7219, 0.5037, 0.827, 0.5234]}, {"w": "metrics", "b": [0.1799, 0.5242, 0.2541, 0.5439]}, {"w": "than", "b": [0.2604, 0.5242, 0.3039, 0.5439]}, {"w": "classification.", "b": [0.3102, 0.5242, 0.4496, 0.5439]}, {"w": "When", "b": [0.1799, 0.5447, 0.2401, 0.5644]}, {"w": "you’re", "b": [0.2464, 0.5447, 0.3122, 0.5644]}, {"w": "working", "b": [0.3186, 0.5447, 0.4026, 0.5644]}, {"w": "with", "b": [0.4089, 0.5447, 0.4538, 0.5644]}, {"w": "little", "b": [0.4601, 0.5447, 0.5064, 0.5644]}, {"w": "data,", "b": [0.5127, 0.5447, 0.561, 0.5644]}, {"w": "K-fold", "b": [0.5673, 0.5447, 0.6346, 0.5644]}, {"w": "validation", "b": [0.6409, 0.5447, 0.7418, 0.5644]}, {"w": "can", "b": [0.7481, 0.5447, 0.7831, 0.5644]}, {"w": "help", "b": [0.7894, 0.5447, 0.8328, 0.5644]}, {"w": "reliably", "b": [0.1799, 0.5652, 0.2569, 0.5849]}, {"w": "evaluate", "b": [0.2632, 0.5652, 0.3473, 0.5849]}, {"w": "your", "b": [0.3536, 0.5652, 0.3998, 0.5849]}, {"w": "model.", "b": [0.4061, 0.5652, 0.4755, 0.5849]}]}]}, {"page": 139, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 4. Fundamentals of machine learning", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "4.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Fundamentals", "b": [0.3011, 0.1076, 0.5195, 0.1355]}, {"w": "of", "b": [0.5284, 0.1076, 0.5582, 0.1355]}, {"w": "machine", "b": [0.5671, 0.1076, 0.6961, 0.1355]}, {"w": "learning", "b": [0.7051, 0.1076, 0.8321, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1729, 0.1785]}, {"w": "chapter", "b": [0.1792, 0.1588, 0.2562, 0.1785]}, {"w": "covers", "b": [0.2626, 0.1588, 0.3284, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Forms of machine learning beyond classification and regression Formal evaluation procedures for machine-learning models Preparing data for deep learning Feature engineering Tackling overfitting The universal workflow for approaching machine-learning problems", "words": [{"w": "Forms", "b": [0.1799, 0.1971, 0.2443, 0.2168]}, {"w": "of", "b": [0.2506, 0.1971, 0.2717, 0.2168]}, {"w": "machine", "b": [0.278, 0.1971, 0.3634, 0.2168]}, {"w": "learning", "b": [0.3697, 0.1971, 0.4524, 0.2168]}, {"w": "beyond", "b": [0.4587, 0.1971, 0.533, 0.2168]}, {"w": "classification", "b": [0.5393, 0.1971, 0.6724, 0.2168]}, {"w": "and", "b": [0.6787, 0.1971, 0.7151, 0.2168]}, {"w": "regression", "b": [0.7214, 0.1971, 0.8251, 0.2168]}, {"w": "Formal", "b": [0.1799, 0.2176, 0.2527, 0.2373]}, {"w": "evaluation", "b": [0.259, 0.2176, 0.3641, 0.2373]}, {"w": "procedures", "b": [0.3704, 0.2176, 0.4811, 0.2373]}, {"w": "for", "b": [0.4874, 0.2176, 0.5168, 0.2373]}, {"w": "machine-learning", "b": [0.5231, 0.2176, 0.6997, 0.2373]}, {"w": "models", "b": [0.706, 0.2176, 0.7788, 0.2373]}, {"w": "Preparing", "b": [0.1799, 0.2381, 0.2779, 0.2578]}, {"w": "data", "b": [0.2842, 0.2381, 0.3263, 0.2578]}, {"w": "for", "b": [0.3326, 0.2381, 0.362, 0.2578]}, {"w": "deep", "b": [0.3683, 0.2381, 0.4159, 0.2578]}, {"w": "learning", "b": [0.4222, 0.2381, 0.5049, 0.2578]}, {"w": "Feature", "b": [0.1799, 0.2586, 0.2555, 0.2783]}, {"w": "engineering", "b": [0.2618, 0.2586, 0.3809, 0.2783]}, {"w": "Tackling", "b": [0.1799, 0.2791, 0.2678, 0.2988]}, {"w": "overfitting", "b": [0.2741, 0.2791, 0.3806, 0.2988]}, {"w": "The", "b": [0.1799, 0.2996, 0.2191, 0.3193]}, {"w": "universal", "b": [0.2254, 0.2996, 0.3179, 0.3193]}, {"w": "workflow", "b": [0.3242, 0.2996, 0.4223, 0.3193]}, {"w": "for", "b": [0.4286, 0.2996, 0.458, 0.3193]}, {"w": "approaching", "b": [0.4643, 0.2996, 0.589, 0.3193]}, {"w": "machine-learning", "b": [0.5953, 0.2996, 0.7718, 0.3193]}, {"w": "problems", "b": [0.1799, 0.3201, 0.2738, 0.3398]}]}, {"id": "b_3", "type": "paragraph", "text": "After the three practical examples in chapter 3, you should be starting to feel familiar with how to approach classification and regression problems using neural networks, and you’ve witnessed the central problem of machine learning: overfitting. This chapter will formalize some of your new intuition into a solid conceptual framework for attacking and solving deep-learning problems. We’ll consolidate all of these concepts—model evaluation, data preprocessing and feature engineering, and tackling overfitting—into a detailed seven-step workflow for tackling any machine-learning task.", "words": [{"w": "After", "b": [0.1294, 0.3629, 0.1826, 0.3826]}, {"w": "the", "b": [0.1889, 0.3629, 0.2198, 0.3826]}, {"w": "three", "b": [0.2261, 0.3629, 0.2765, 0.3826]}, {"w": "practical", "b": [0.2828, 0.3629, 0.3697, 0.3826]}, {"w": "examples", "b": [0.376, 0.3629, 0.4712, 0.3826]}, {"w": "in", "b": [0.4776, 0.3629, 0.4972, 0.3826]}, {"w": "chapter", "b": [0.5034, 0.3629, 0.5776, 0.3826]}, {"w": "3,", "b": [0.5839, 0.3629, 0.6028, 0.3826]}, {"w": "you", "b": [0.6092, 0.3629, 0.647, 0.3826]}, {"w": "should", "b": [0.6533, 0.3629, 0.7206, 0.3826]}, {"w": "be", "b": [0.7269, 0.3629, 0.7507, 0.3826]}, {"w": "starting", "b": [0.757, 0.3629, 0.8327, 0.3826]}, {"w": "to", "b": [0.839, 0.3629, 0.8586, 0.3826]}, {"w": "feel", "b": [0.1294, 0.3834, 0.1672, 0.4031]}, {"w": "familiar", "b": [0.1735, 0.3834, 0.2534, 0.4031]}, {"w": "with", "b": [0.2597, 0.3834, 0.3046, 0.4031]}, {"w": "how", "b": [0.3109, 0.3834, 0.3543, 0.4031]}, {"w": "to", "b": [0.3606, 0.3834, 0.3802, 0.4031]}, {"w": "approach", "b": [0.3865, 0.3834, 0.479, 0.4031]}, {"w": "classification", "b": [0.4853, 0.3834, 0.6184, 0.4031]}, {"w": "and", "b": [0.6247, 0.3834, 0.6611, 0.4031]}, {"w": "regression", "b": [0.6675, 0.3834, 0.7711, 0.4031]}, {"w": "problems", "b": [0.1294, 0.4039, 0.2233, 0.4236]}, {"w": "using", "b": [0.2296, 0.4039, 0.2843, 0.4236]}, {"w": "neural", "b": [0.2906, 0.4039, 0.3536, 0.4236]}, {"w": "networks,", "b": [0.3599, 0.4039, 0.4587, 0.4236]}, {"w": "and", "b": [0.465, 0.4039, 0.5014, 0.4236]}, {"w": "you’ve", "b": [0.5077, 0.4039, 0.5778, 0.4236]}, {"w": "witnessed", "b": [0.5841, 0.4039, 0.6836, 0.4236]}, {"w": "the", "b": [0.6899, 0.4039, 0.7207, 0.4236]}, {"w": "central", "b": [0.727, 0.4039, 0.7957, 0.4236]}, {"w": "problem", "b": [0.1294, 0.4244, 0.2135, 0.4441]}, {"w": "of", "b": [0.2198, 0.4244, 0.2408, 0.4441]}, {"w": "machine", "b": [0.2471, 0.4244, 0.3326, 0.4441]}, {"w": "learning:", "b": [0.3389, 0.4244, 0.4286, 0.4441]}, {"w": "overfitting.", "b": [0.4349, 0.4244, 0.5477, 0.4441]}, {"w": "This", "b": [0.554, 0.4244, 0.5988, 0.4441]}, {"w": "chapter", "b": [0.6051, 0.4244, 0.6794, 0.4441]}, {"w": "will", "b": [0.6857, 0.4244, 0.7249, 0.4441]}, {"w": "formalize", "b": [0.7312, 0.4244, 0.8279, 0.4441]}, {"w": "some", "b": [0.1294, 0.4449, 0.1827, 0.4646]}, {"w": "of", "b": [0.189, 0.4449, 0.21, 0.4646]}, {"w": "your", "b": [0.2163, 0.4449, 0.2625, 0.4646]}, {"w": "new", "b": [0.2688, 0.4449, 0.3109, 0.4646]}, {"w": "intuition", "b": [0.3172, 0.4449, 0.4027, 0.4646]}, {"w": "into", "b": [0.409, 0.4449, 0.4482, 0.4646]}, {"w": "a", "b": [0.4545, 0.4449, 0.4657, 0.4646]}, {"w": "solid", "b": [0.472, 0.4449, 0.5211, 0.4646]}, {"w": "conceptual", "b": [0.5274, 0.4449, 0.6367, 0.4646]}, {"w": "framework", "b": [0.643, 0.4449, 0.7536, 0.4646]}, {"w": "for", "b": [0.76, 0.4449, 0.7894, 0.4646]}, {"w": "attacking", "b": [0.1294, 0.4654, 0.2219, 0.4851]}, {"w": "and", "b": [0.2282, 0.4654, 0.2646, 0.4851]}, {"w": "solving", "b": [0.2709, 0.4654, 0.3452, 0.4851]}, {"w": "deep-learning", "b": [0.3515, 0.4654, 0.4902, 0.4851]}, {"w": "problems.", "b": [0.4965, 0.4654, 0.5967, 0.4851]}, {"w": "We’ll", "b": [0.603, 0.4654, 0.6584, 0.4851]}, {"w": "consolidate", "b": [0.6647, 0.4654, 0.7796, 0.4851]}, {"w": "all", "b": [0.7859, 0.4654, 0.8111, 0.4851]}, {"w": "of", "b": [0.8174, 0.4654, 0.8384, 0.4851]}, {"w": "these", "b": [0.1294, 0.4859, 0.1813, 0.5056]}, {"w": "concepts—model", "b": [0.1876, 0.4859, 0.3641, 0.5056]}, {"w": "evaluation,", "b": [0.3704, 0.4859, 0.4818, 0.5056]}, {"w": "data", "b": [0.4881, 0.4859, 0.5301, 0.5056]}, {"w": "preprocessing", "b": [0.5364, 0.4859, 0.6765, 0.5056]}, {"w": "and", "b": [0.6828, 0.4859, 0.7192, 0.5056]}, {"w": "feature", "b": [0.7256, 0.4859, 0.7956, 0.5056]}, {"w": "engineering,", "b": [0.1294, 0.5064, 0.2548, 0.5261]}, {"w": "and", "b": [0.2611, 0.5064, 0.2975, 0.5261]}, {"w": "tackling", "b": [0.3038, 0.5064, 0.3851, 0.5261]}, {"w": "overfitting—into", "b": [0.3914, 0.5064, 0.5624, 0.5261]}, {"w": "a", "b": [0.5687, 0.5064, 0.5799, 0.5261]}, {"w": "detailed", "b": [0.5862, 0.5064, 0.6661, 0.5261]}, {"w": "seven-step", "b": [0.6724, 0.5064, 0.7789, 0.5261]}, {"w": "workflow", "b": [0.1294, 0.5269, 0.2275, 0.5466]}, {"w": "for", "b": [0.2338, 0.5269, 0.2632, 0.5466]}, {"w": "tackling", "b": [0.2695, 0.5269, 0.3508, 0.5466]}, {"w": "any", "b": [0.3571, 0.5269, 0.3935, 0.5466]}, {"w": "machine-learning", "b": [0.3998, 0.5269, 0.5763, 0.5466]}, {"w": "task.", "b": [0.5826, 0.5269, 0.6296, 0.5466]}]}, {"id": "b_4", "type": "paragraph", "text": "4.1. Four branches of machine learning", "words": [{"w": "4.1.", "b": [0.1294, 0.5837, 0.172, 0.6059]}, {"w": "Four", "b": [0.1791, 0.5837, 0.239, 0.6059]}, {"w": "branches", "b": [0.2461, 0.5837, 0.3564, 0.6059]}, {"w": "of", "b": [0.3635, 0.5837, 0.3872, 0.6059]}, {"w": "machine", "b": [0.3943, 0.5837, 0.4967, 0.6059]}, {"w": "learning", "b": [0.5038, 0.5837, 0.6048, 0.6059]}]}, {"id": "b_5", "type": "paragraph", "text": "In our previous examples, you’ve become familiar with three specific types of machine-learning problems: binary classification, multiclass classification, and scalar regression. All three are instances of supervised learning, where the goal is to learn the relationship between training inputs and training targets.", "words": [{"w": "In", "b": [0.1294, 0.6294, 0.1504, 0.6491]}, {"w": "our", "b": [0.1567, 0.6294, 0.1904, 0.6491]}, {"w": "previous", "b": [0.1967, 0.6294, 0.2835, 0.6491]}, {"w": "examples,", "b": [0.2898, 0.6294, 0.3914, 0.6491]}, {"w": "you’ve", "b": [0.3977, 0.6294, 0.4678, 0.6491]}, {"w": "become", "b": [0.4741, 0.6294, 0.5525, 0.6491]}, {"w": "familiar", "b": [0.5589, 0.6294, 0.6387, 0.6491]}, {"w": "with", "b": [0.645, 0.6294, 0.6899, 0.6491]}, {"w": "three", "b": [0.6962, 0.6294, 0.7466, 0.6491]}, {"w": "specific", "b": [0.7529, 0.6294, 0.8314, 0.6491]}, {"w": "types", "b": [0.1294, 0.6499, 0.1827, 0.6696]}, {"w": "of", "b": [0.189, 0.6499, 0.21, 0.6696]}, {"w": "machine-learning", "b": [0.2163, 0.6499, 0.3928, 0.6696]}, {"w": "problems:", "b": [0.3991, 0.6499, 0.5, 0.6696]}, {"w": "binary", "b": [0.5063, 0.6499, 0.5708, 0.6696]}, {"w": "classification,", "b": [0.5771, 0.6499, 0.7165, 0.6696]}, {"w": "multiclass", "b": [0.7227, 0.6499, 0.825, 0.6696]}, {"w": "classification,", "b": [0.1294, 0.6704, 0.2688, 0.6901]}, {"w": "and", "b": [0.2751, 0.6704, 0.3116, 0.6901]}, {"w": "scalar", "b": [0.3179, 0.6704, 0.3767, 0.6901]}, {"w": "regression.", "b": [0.383, 0.6704, 0.493, 0.6901]}, {"w": "All", "b": [0.4993, 0.6704, 0.5315, 0.6901]}, {"w": "three", "b": [0.5378, 0.6704, 0.5883, 0.6901]}, {"w": "are", "b": [0.5946, 0.6704, 0.6254, 0.6901]}, {"w": "instances", "b": [0.6317, 0.6704, 0.7242, 0.6901]}, {"w": "of", "b": [0.7305, 0.6704, 0.7515, 0.6901]}, {"w": "supervised", "b": [0.7577, 0.6704, 0.8656, 0.6901]}, {"w": "learning,", "b": [0.1294, 0.6909, 0.2212, 0.7106]}, {"w": "where", "b": [0.2275, 0.6909, 0.2891, 0.7106]}, {"w": "the", "b": [0.2954, 0.6909, 0.3263, 0.7106]}, {"w": "goal", "b": [0.3326, 0.6909, 0.376, 0.7106]}, {"w": "is", "b": [0.3823, 0.6909, 0.3991, 0.7106]}, {"w": "to", "b": [0.4054, 0.6909, 0.4251, 0.7106]}, {"w": "learn", "b": [0.4314, 0.6909, 0.4818, 0.7106]}, {"w": "the", "b": [0.4881, 0.6909, 0.5189, 0.7106]}, {"w": "relationship", "b": [0.5252, 0.6909, 0.6444, 0.7106]}, {"w": "between", "b": [0.6507, 0.6909, 0.7347, 0.7106]}, {"w": "training", "b": [0.741, 0.6909, 0.8195, 0.7106]}, {"w": "inputs", "b": [0.1294, 0.7114, 0.1911, 0.7311]}, {"w": "and", "b": [0.1974, 0.7114, 0.2338, 0.7311]}, {"w": "training", "b": [0.2401, 0.7114, 0.3186, 0.7311]}, {"w": "targets.", "b": [0.3249, 0.7114, 0.398, 0.7311]}]}, {"id": "b_6", "type": "paragraph", "text": "Supervised learning is just the tip of the iceberg—machine learning is a vast field with a complex subfield taxonomy. Machine-learning algorithms generally fall into four broad categories, described in the following sections.", "words": [{"w": "Supervised", "b": [0.1294, 0.7542, 0.2415, 0.7739]}, {"w": "learning", "b": [0.2478, 0.7542, 0.3305, 0.7739]}, {"w": "is", "b": [0.3368, 0.7542, 0.3536, 0.7739]}, {"w": "just", "b": [0.3599, 0.7542, 0.3964, 0.7739]}, {"w": "the", "b": [0.4027, 0.7542, 0.4335, 0.7739]}, {"w": "tip", "b": [0.4398, 0.7542, 0.4665, 0.7739]}, {"w": "of", "b": [0.4728, 0.7542, 0.4938, 0.7739]}, {"w": "the", "b": [0.5001, 0.7542, 0.5309, 0.7739]}, {"w": "iceberg—machine", "b": [0.5372, 0.7542, 0.7216, 0.7739]}, {"w": "learning", "b": [0.7279, 0.7542, 0.8106, 0.7739]}, {"w": "is", "b": [0.8169, 0.7542, 0.8337, 0.7739]}, {"w": "a", "b": [0.84, 0.7542, 0.8512, 0.7739]}, {"w": "vast", "b": [0.1294, 0.7747, 0.1701, 0.7944]}, {"w": "field", "b": [0.1764, 0.7747, 0.2226, 0.7944]}, {"w": "with", "b": [0.2289, 0.7747, 0.2738, 0.7944]}, {"w": "a", "b": [0.2801, 0.7747, 0.2913, 0.7944]}, {"w": "complex", "b": [0.2976, 0.7747, 0.3844, 0.7944]}, {"w": "subfield", "b": [0.3908, 0.7747, 0.472, 0.7944]}, {"w": "taxonomy.", "b": [0.4783, 0.7747, 0.5838, 0.7944]}, {"w": "Machine-learning", "b": [0.5902, 0.7747, 0.7695, 0.7944]}, {"w": "algorithms", "b": [0.1294, 0.7952, 0.2373, 0.8149]}, {"w": "generally", "b": [0.2436, 0.7952, 0.3375, 0.8149]}, {"w": "fall", "b": [0.3438, 0.7952, 0.3774, 0.8149]}, {"w": "into", "b": [0.3837, 0.7952, 0.423, 0.8149]}, {"w": "four", "b": [0.4293, 0.7952, 0.4713, 0.8149]}, {"w": "broad", "b": [0.4776, 0.7952, 0.5351, 0.8149]}, {"w": "categories,", "b": [0.5414, 0.7952, 0.6499, 0.8149]}, {"w": "described", "b": [0.6563, 0.7952, 0.7529, 0.8149]}, {"w": "in", "b": [0.7592, 0.7952, 0.7788, 0.8149]}, {"w": "the", "b": [0.7852, 0.7952, 0.816, 0.8149]}, {"w": "following", "b": [0.1294, 0.8157, 0.2275, 0.8354]}, {"w": "sections.", "b": [0.2338, 0.8157, 0.3214, 0.8354]}]}, {"id": "b_7", "type": "paragraph", "text": "4.1.1. Supervised learning", "words": [{"w": "4.1.1.", "b": [0.1294, 0.8629, 0.1862, 0.8826]}, {"w": "Supervised", "b": [0.1925, 0.8629, 0.3116, 0.8826]}, {"w": "learning", "b": [0.3179, 0.8629, 0.4076, 0.8826]}]}]}, {"page": 140, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This is by far the most common case. It consists of learning to map input data to known targets (also called annotations), given a set of examples (often annotated by humans). All four examples you’ve encountered in this book so far were canonical examples of supervised learning. Generally, almost all applications of deep learning that are in the spotlight these days belong in this category, such as optical character recognition, speech recognition, image classification, and language translation.", "words": [{"w": "This", "b": [0.1294, 0.0857, 0.1743, 0.1054]}, {"w": "is", "b": [0.1806, 0.0857, 0.1974, 0.1054]}, {"w": "by", "b": [0.2037, 0.0857, 0.2289, 0.1054]}, {"w": "far", "b": [0.2352, 0.0857, 0.2632, 0.1054]}, {"w": "the", "b": [0.2695, 0.0857, 0.3004, 0.1054]}, {"w": "most", "b": [0.3067, 0.0857, 0.3557, 0.1054]}, {"w": "common", "b": [0.362, 0.0857, 0.4503, 0.1054]}, {"w": "case.", "b": [0.4566, 0.0857, 0.5064, 0.1054]}, {"w": "It", "b": [0.5127, 0.0857, 0.5281, 0.1054]}, {"w": "consists", "b": [0.5344, 0.0857, 0.6143, 0.1054]}, {"w": "of", "b": [0.6206, 0.0857, 0.6416, 0.1054]}, {"w": "learning", "b": [0.6479, 0.0857, 0.7306, 0.1054]}, {"w": "to", "b": [0.7369, 0.0857, 0.7565, 0.1054]}, {"w": "map", "b": [0.7628, 0.0857, 0.8062, 0.1054]}, {"w": "input", "b": [0.8126, 0.0857, 0.8644, 0.1054]}, {"w": "data", "b": [0.1294, 0.1062, 0.1714, 0.1259]}, {"w": "to", "b": [0.1777, 0.1062, 0.1974, 0.1259]}, {"w": "known", "b": [0.2037, 0.1062, 0.2723, 0.1259]}, {"w": "targets", "b": [0.2786, 0.1062, 0.3454, 0.1259]}, {"w": "(also", "b": [0.3517, 0.1062, 0.4008, 0.1259]}, {"w": "called", "b": [0.4071, 0.1062, 0.4673, 0.1259]}, {"w": "annotations),", "b": [0.4736, 0.1062, 0.6074, 0.1259]}, {"w": "given", "b": [0.6137, 0.1062, 0.6698, 0.1259]}, {"w": "a", "b": [0.6761, 0.1062, 0.6873, 0.1259]}, {"w": "set", "b": [0.6936, 0.1062, 0.7216, 0.1259]}, {"w": "of", "b": [0.7279, 0.1062, 0.7489, 0.1259]}, {"w": "examples", "b": [0.7552, 0.1062, 0.8505, 0.1259]}, {"w": "(often", "b": [0.1294, 0.1267, 0.1897, 0.1464]}, {"w": "annotated", "b": [0.196, 0.1267, 0.294, 0.1464]}, {"w": "by", "b": [0.3003, 0.1267, 0.3256, 0.1464]}, {"w": "humans).", "b": [0.3319, 0.1267, 0.4251, 0.1464]}, {"w": "All", "b": [0.4314, 0.1267, 0.4636, 0.1464]}, {"w": "four", "b": [0.4699, 0.1267, 0.5119, 0.1464]}, {"w": "examples", "b": [0.5182, 0.1267, 0.6135, 0.1464]}, {"w": "you’ve", "b": [0.6198, 0.1267, 0.6899, 0.1464]}, {"w": "encountered", "b": [0.6962, 0.1267, 0.8195, 0.1464]}, {"w": "in", "b": [0.8258, 0.1267, 0.8454, 0.1464]}, {"w": "this", "b": [0.1294, 0.1472, 0.1659, 0.1669]}, {"w": "book", "b": [0.1722, 0.1472, 0.2226, 0.1669]}, {"w": "so", "b": [0.2289, 0.1472, 0.2514, 0.1669]}, {"w": "far", "b": [0.2577, 0.1472, 0.2857, 0.1669]}, {"w": "were", "b": [0.292, 0.1472, 0.341, 0.1669]}, {"w": "canonical", "b": [0.3473, 0.1472, 0.444, 0.1669]}, {"w": "examples", "b": [0.4502, 0.1472, 0.5455, 0.1669]}, {"w": "of", "b": [0.5518, 0.1472, 0.5728, 0.1669]}, {"w": "supervised", "b": [0.5791, 0.1472, 0.687, 0.1669]}, {"w": "learning.", "b": [0.6933, 0.1472, 0.7823, 0.1669]}, {"w": "Generally,", "b": [0.1294, 0.1677, 0.2335, 0.1874]}, {"w": "almost", "b": [0.2398, 0.1677, 0.3071, 0.1874]}, {"w": "all", "b": [0.3134, 0.1677, 0.3386, 0.1874]}, {"w": "applications", "b": [0.345, 0.1677, 0.4669, 0.1874]}, {"w": "of", "b": [0.4732, 0.1677, 0.4942, 0.1874]}, {"w": "deep", "b": [0.5005, 0.1677, 0.5481, 0.1874]}, {"w": "learning", "b": [0.5544, 0.1677, 0.6371, 0.1874]}, {"w": "that", "b": [0.6434, 0.1677, 0.6812, 0.1874]}, {"w": "are", "b": [0.6875, 0.1677, 0.7183, 0.1874]}, {"w": "in", "b": [0.7247, 0.1677, 0.7443, 0.1874]}, {"w": "the", "b": [0.7506, 0.1677, 0.7814, 0.1874]}, {"w": "spotlight", "b": [0.1294, 0.1882, 0.2177, 0.2079]}, {"w": "these", "b": [0.224, 0.1882, 0.2759, 0.2079]}, {"w": "days", "b": [0.2822, 0.1882, 0.3284, 0.2079]}, {"w": "belong", "b": [0.3347, 0.1882, 0.4034, 0.2079]}, {"w": "in", "b": [0.4097, 0.1882, 0.4293, 0.2079]}, {"w": "this", "b": [0.4356, 0.1882, 0.472, 0.2079]}, {"w": "category,", "b": [0.4783, 0.1882, 0.5698, 0.2079]}, {"w": "such", "b": [0.5761, 0.1882, 0.6224, 0.2079]}, {"w": "as", "b": [0.6287, 0.1882, 0.6497, 0.2079]}, {"w": "optical", "b": [0.656, 0.1882, 0.7247, 0.2079]}, {"w": "character", "b": [0.731, 0.1882, 0.8234, 0.2079]}, {"w": "recognition,", "b": [0.1294, 0.2087, 0.2506, 0.2284]}, {"w": "speech", "b": [0.2569, 0.2087, 0.3256, 0.2284]}, {"w": "recognition,", "b": [0.3319, 0.2087, 0.4531, 0.2284]}, {"w": "image", "b": [0.4594, 0.2087, 0.521, 0.2284]}, {"w": "classification,", "b": [0.5273, 0.2087, 0.6668, 0.2284]}, {"w": "and", "b": [0.6731, 0.2087, 0.7095, 0.2284]}, {"w": "language", "b": [0.7158, 0.2087, 0.8069, 0.2284]}, {"w": "translation.", "b": [0.1294, 0.2292, 0.2422, 0.2489]}]}, {"id": "b_1", "type": "paragraph", "text": "Although supervised learning mostly consists of classification and regression, there are more exotic variants as well, including the following (with examples):", "words": [{"w": "Although", "b": [0.1294, 0.272, 0.2247, 0.2917]}, {"w": "supervised", "b": [0.231, 0.272, 0.3389, 0.2917]}, {"w": "learning", "b": [0.3452, 0.272, 0.4279, 0.2917]}, {"w": "mostly", "b": [0.4342, 0.272, 0.5029, 0.2917]}, {"w": "consists", "b": [0.5092, 0.272, 0.5891, 0.2917]}, {"w": "of", "b": [0.5954, 0.272, 0.6164, 0.2917]}, {"w": "classification", "b": [0.6227, 0.272, 0.7558, 0.2917]}, {"w": "and", "b": [0.7621, 0.272, 0.7986, 0.2917]}, {"w": "regression,", "b": [0.1294, 0.2925, 0.2394, 0.3122]}, {"w": "there", "b": [0.2457, 0.2925, 0.2961, 0.3122]}, {"w": "are", "b": [0.3024, 0.2925, 0.3332, 0.3122]}, {"w": "more", "b": [0.3395, 0.2925, 0.3914, 0.3122]}, {"w": "exotic", "b": [0.3977, 0.2925, 0.4593, 0.3122]}, {"w": "variants", "b": [0.4656, 0.2925, 0.5455, 0.3122]}, {"w": "as", "b": [0.5518, 0.2925, 0.5728, 0.3122]}, {"w": "well,", "b": [0.5791, 0.2925, 0.6289, 0.3122]}, {"w": "including", "b": [0.6352, 0.2925, 0.7305, 0.3122]}, {"w": "the", "b": [0.7367, 0.2925, 0.7675, 0.3122]}, {"w": "following", "b": [0.1294, 0.313, 0.2275, 0.3327]}, {"w": "(with", "b": [0.2338, 0.313, 0.2871, 0.3327]}, {"w": "examples):", "b": [0.2934, 0.313, 0.4041, 0.3327]}]}, {"id": "b_2", "type": "paragraph", "text": "Sequence generation— Given a picture, predict a caption describing it. Sequence generation can sometimes be reformulated as a series of classification problems (such as repeatedly predicting a word or token in a sequence). Syntax tree prediction— Given a sentence, predict its decomposition into a syntax tree. Object detection— Given a picture, draw a bounding box around certain objects inside the picture. This can also be expressed as a classification problem (given many candidate bounding boxes, classify the contents of each one) or as a joint classification and regression problem, where the bounding-box coordinates are predicted via vector regression. Image segmentation— Given a picture, draw a pixel-level mask on a specific object.", "words": [{"w": "Sequence", "b": [0.1799, 0.3513, 0.2794, 0.371]}, {"w": "generation—", "b": [0.2857, 0.3513, 0.423, 0.371]}, {"w": "Given", "b": [0.4293, 0.3513, 0.491, 0.371]}, {"w": "a", "b": [0.4973, 0.3513, 0.5085, 0.371]}, {"w": "picture,", "b": [0.5148, 0.3513, 0.5911, 0.371]}, {"w": "predict", "b": [0.5974, 0.3513, 0.6675, 0.371]}, {"w": "a", "b": [0.6738, 0.3513, 0.685, 0.371]}, {"w": "caption", "b": [0.6913, 0.3513, 0.7656, 0.371]}, {"w": "describing", "b": [0.1799, 0.3718, 0.285, 0.3915]}, {"w": "it.", "b": [0.2913, 0.3718, 0.3116, 0.3915]}, {"w": "Sequence", "b": [0.3179, 0.3718, 0.4146, 0.3915]}, {"w": "generation", "b": [0.4209, 0.3718, 0.5273, 0.3915]}, {"w": "can", "b": [0.5337, 0.3718, 0.5687, 0.3915]}, {"w": "sometimes", "b": [0.575, 0.3718, 0.6829, 0.3915]}, {"w": "be", "b": [0.6892, 0.3718, 0.713, 0.3915]}, {"w": "reformulated", "b": [0.7193, 0.3718, 0.8496, 0.3915]}, {"w": "as", "b": [0.1799, 0.3923, 0.2009, 0.412]}, {"w": "a", "b": [0.2072, 0.3923, 0.2184, 0.412]}, {"w": "series", "b": [0.2247, 0.3923, 0.2821, 0.412]}, {"w": "of", "b": [0.2884, 0.3923, 0.3094, 0.412]}, {"w": "classification", "b": [0.3158, 0.3923, 0.4489, 0.412]}, {"w": "problems", "b": [0.4551, 0.3923, 0.549, 0.412]}, {"w": "(such", "b": [0.5553, 0.3923, 0.61, 0.412]}, {"w": "as", "b": [0.6163, 0.3923, 0.6373, 0.412]}, {"w": "repeatedly", "b": [0.6436, 0.3923, 0.7487, 0.412]}, {"w": "predicting", "b": [0.755, 0.3923, 0.8573, 0.412]}, {"w": "a", "b": [0.1799, 0.4128, 0.1911, 0.4325]}, {"w": "word", "b": [0.1974, 0.4128, 0.2492, 0.4325]}, {"w": "or", "b": [0.2555, 0.4128, 0.2765, 0.4325]}, {"w": "token", "b": [0.2828, 0.4128, 0.3389, 0.4325]}, {"w": "in", "b": [0.3452, 0.4128, 0.3648, 0.4325]}, {"w": "a", "b": [0.3711, 0.4128, 0.3823, 0.4325]}, {"w": "sequence).", "b": [0.3886, 0.4128, 0.4958, 0.4325]}, {"w": "Syntax", "b": [0.1799, 0.4333, 0.2514, 0.453]}, {"w": "tree", "b": [0.2577, 0.4333, 0.2969, 0.453]}, {"w": "prediction—", "b": [0.3032, 0.4333, 0.4335, 0.453]}, {"w": "Given", "b": [0.4398, 0.4333, 0.5015, 0.453]}, {"w": "a", "b": [0.5078, 0.4333, 0.519, 0.453]}, {"w": "sentence,", "b": [0.5253, 0.4333, 0.6184, 0.453]}, {"w": "predict", "b": [0.6247, 0.4333, 0.6948, 0.453]}, {"w": "its", "b": [0.7011, 0.4333, 0.7249, 0.453]}, {"w": "decomposition", "b": [0.1799, 0.4538, 0.3284, 0.4735]}, {"w": "into", "b": [0.3347, 0.4538, 0.374, 0.4735]}, {"w": "a", "b": [0.3803, 0.4538, 0.3915, 0.4735]}, {"w": "syntax", "b": [0.3978, 0.4538, 0.4637, 0.4735]}, {"w": "tree.", "b": [0.47, 0.4538, 0.5141, 0.4735]}, {"w": "Object", "b": [0.1799, 0.4743, 0.2471, 0.494]}, {"w": "detection—", "b": [0.2534, 0.4743, 0.3725, 0.494]}, {"w": "Given", "b": [0.3788, 0.4743, 0.4405, 0.494]}, {"w": "a", "b": [0.4468, 0.4743, 0.458, 0.494]}, {"w": "picture,", "b": [0.4643, 0.4743, 0.5406, 0.494]}, {"w": "draw", "b": [0.5469, 0.4743, 0.5974, 0.494]}, {"w": "a", "b": [0.6037, 0.4743, 0.6149, 0.494]}, {"w": "bounding", "b": [0.6212, 0.4743, 0.7165, 0.494]}, {"w": "box", "b": [0.7228, 0.4743, 0.7606, 0.494]}, {"w": "around", "b": [0.7669, 0.4743, 0.837, 0.494]}, {"w": "certain", "b": [0.1799, 0.4948, 0.2485, 0.5145]}, {"w": "objects", "b": [0.2548, 0.4948, 0.3263, 0.5145]}, {"w": "inside", "b": [0.3326, 0.4948, 0.3928, 0.5145]}, {"w": "the", "b": [0.3992, 0.4948, 0.43, 0.5145]}, {"w": "picture.", "b": [0.4363, 0.4948, 0.5126, 0.5145]}, {"w": "This", "b": [0.5189, 0.4948, 0.5638, 0.5145]}, {"w": "can", "b": [0.5701, 0.4948, 0.6051, 0.5145]}, {"w": "also", "b": [0.6114, 0.4948, 0.6521, 0.5145]}, {"w": "be", "b": [0.6584, 0.4948, 0.6822, 0.5145]}, {"w": "expressed", "b": [0.6885, 0.4948, 0.788, 0.5145]}, {"w": "as", "b": [0.7943, 0.4948, 0.8153, 0.5145]}, {"w": "a", "b": [0.8216, 0.4948, 0.8328, 0.5145]}, {"w": "classification", "b": [0.1799, 0.5153, 0.313, 0.535]}, {"w": "problem", "b": [0.3193, 0.5153, 0.4033, 0.535]}, {"w": "(given", "b": [0.4096, 0.5153, 0.4741, 0.535]}, {"w": "many", "b": [0.4804, 0.5153, 0.5364, 0.535]}, {"w": "candidate", "b": [0.5428, 0.5153, 0.6394, 0.535]}, {"w": "bounding", "b": [0.6457, 0.5153, 0.741, 0.535]}, {"w": "boxes,", "b": [0.7473, 0.5153, 0.8125, 0.535]}, {"w": "classify", "b": [0.1799, 0.5358, 0.2569, 0.5555]}, {"w": "the", "b": [0.2632, 0.5358, 0.2941, 0.5555]}, {"w": "contents", "b": [0.3004, 0.5358, 0.3844, 0.5555]}, {"w": "of", "b": [0.3908, 0.5358, 0.4118, 0.5555]}, {"w": "each", "b": [0.4181, 0.5358, 0.4643, 0.5555]}, {"w": "one)", "b": [0.4706, 0.5358, 0.5154, 0.5555]}, {"w": "or", "b": [0.5217, 0.5358, 0.5427, 0.5555]}, {"w": "as", "b": [0.549, 0.5358, 0.5701, 0.5555]}, {"w": "a", "b": [0.5764, 0.5358, 0.5876, 0.5555]}, {"w": "joint", "b": [0.5939, 0.5358, 0.6401, 0.5555]}, {"w": "classification", "b": [0.6464, 0.5358, 0.7796, 0.5555]}, {"w": "and", "b": [0.7859, 0.5358, 0.8223, 0.5555]}, {"w": "regression", "b": [0.1799, 0.5563, 0.2835, 0.576]}, {"w": "problem,", "b": [0.2898, 0.5563, 0.3802, 0.576]}, {"w": "where", "b": [0.3865, 0.5563, 0.4481, 0.576]}, {"w": "the", "b": [0.4545, 0.5563, 0.4853, 0.576]}, {"w": "bounding-box", "b": [0.4916, 0.5563, 0.6331, 0.576]}, {"w": "coordinates", "b": [0.6394, 0.5563, 0.7557, 0.576]}, {"w": "are", "b": [0.762, 0.5563, 0.7928, 0.576]}, {"w": "predicted", "b": [0.1799, 0.5768, 0.2737, 0.5965]}, {"w": "via", "b": [0.28, 0.5768, 0.3109, 0.5965]}, {"w": "vector", "b": [0.3172, 0.5768, 0.3802, 0.5965]}, {"w": "regression.", "b": [0.3865, 0.5768, 0.4965, 0.5965]}, {"w": "Image", "b": [0.1799, 0.5973, 0.2457, 0.617]}, {"w": "segmentation—", "b": [0.252, 0.5973, 0.416, 0.617]}, {"w": "Given", "b": [0.4223, 0.5973, 0.484, 0.617]}, {"w": "a", "b": [0.4903, 0.5973, 0.5015, 0.617]}, {"w": "picture,", "b": [0.5078, 0.5973, 0.5841, 0.617]}, {"w": "draw", "b": [0.5904, 0.5973, 0.6409, 0.617]}, {"w": "a", "b": [0.6472, 0.5973, 0.6584, 0.617]}, {"w": "pixel-level", "b": [0.6647, 0.5973, 0.7726, 0.617]}, {"w": "mask", "b": [0.7789, 0.5973, 0.8321, 0.617]}, {"w": "on", "b": [0.8384, 0.5973, 0.8637, 0.617]}, {"w": "a", "b": [0.1799, 0.6178, 0.1911, 0.6375]}, {"w": "specific", "b": [0.1974, 0.6178, 0.2758, 0.6375]}, {"w": "object.", "b": [0.2821, 0.6178, 0.3501, 0.6375]}]}, {"id": "b_3", "type": "paragraph", "text": "4.1.2. Unsupervised learning", "words": [{"w": "4.1.2.", "b": [0.1294, 0.665, 0.1862, 0.6848]}, {"w": "Unsupervised", "b": [0.1925, 0.665, 0.3396, 0.6848]}, {"w": "learning", "b": [0.3459, 0.665, 0.4357, 0.6848]}]}, {"id": "b_4", "type": "paragraph", "text": "This branch of machine learning consists of finding interesting transformations of the input data without the help of any targets, for the purposes of data visualization, data compression, or data denoising, or to better understand the correlations present in the data at hand. Unsupervised learning is the bread and butter of data analytics, and it’s often a necessary step in better understanding a dataset before attempting to solve a supervised-learning problem. Dimensionality reduction and clustering are well-known categories of unsupervised learning.", "words": [{"w": "This", "b": [0.1294, 0.7078, 0.1743, 0.7276]}, {"w": "branch", "b": [0.1806, 0.7078, 0.2492, 0.7276]}, {"w": "of", "b": [0.2555, 0.7078, 0.2765, 0.7276]}, {"w": "machine", "b": [0.2828, 0.7078, 0.3683, 0.7276]}, {"w": "learning", "b": [0.3746, 0.7078, 0.4573, 0.7276]}, {"w": "consists", "b": [0.4636, 0.7078, 0.5435, 0.7276]}, {"w": "of", "b": [0.5498, 0.7078, 0.5708, 0.7276]}, {"w": "finding", "b": [0.5771, 0.7078, 0.65, 0.7276]}, {"w": "interesting", "b": [0.6563, 0.7078, 0.7628, 0.7276]}, {"w": "transformations", "b": [0.1294, 0.7283, 0.2878, 0.7481]}, {"w": "of", "b": [0.2941, 0.7283, 0.3151, 0.7481]}, {"w": "the", "b": [0.3214, 0.7283, 0.3522, 0.7481]}, {"w": "input", "b": [0.3585, 0.7283, 0.4104, 0.7481]}, {"w": "data", "b": [0.4167, 0.7283, 0.4587, 0.7481]}, {"w": "without", "b": [0.465, 0.7283, 0.5421, 0.7481]}, {"w": "the", "b": [0.5484, 0.7283, 0.5792, 0.7481]}, {"w": "help", "b": [0.5855, 0.7283, 0.629, 0.7481]}, {"w": "of", "b": [0.6353, 0.7283, 0.6563, 0.7481]}, {"w": "any", "b": [0.6626, 0.7283, 0.699, 0.7481]}, {"w": "targets,", "b": [0.7053, 0.7283, 0.7784, 0.7481]}, {"w": "for", "b": [0.7847, 0.7283, 0.8141, 0.7481]}, {"w": "the", "b": [0.8204, 0.7283, 0.8512, 0.7481]}, {"w": "purposes", "b": [0.1294, 0.7488, 0.2191, 0.7686]}, {"w": "of", "b": [0.2254, 0.7488, 0.2464, 0.7686]}, {"w": "data", "b": [0.2527, 0.7488, 0.2947, 0.7686]}, {"w": "visualization,", "b": [0.301, 0.7488, 0.4363, 0.7686]}, {"w": "data", "b": [0.4426, 0.7488, 0.4846, 0.7686]}, {"w": "compression,", "b": [0.4909, 0.7488, 0.6247, 0.7686]}, {"w": "or", "b": [0.6311, 0.7488, 0.6521, 0.7686]}, {"w": "data", "b": [0.6584, 0.7488, 0.7004, 0.7686]}, {"w": "denoising,", "b": [0.7067, 0.7488, 0.8111, 0.7686]}, {"w": "or", "b": [0.8174, 0.7488, 0.8384, 0.7686]}, {"w": "to", "b": [0.8447, 0.7488, 0.8644, 0.7686]}, {"w": "better", "b": [0.1294, 0.7693, 0.1869, 0.7891]}, {"w": "understand", "b": [0.1932, 0.7693, 0.3038, 0.7891]}, {"w": "the", "b": [0.3102, 0.7693, 0.341, 0.7891]}, {"w": "correlations", "b": [0.3473, 0.7693, 0.4664, 0.7891]}, {"w": "present", "b": [0.4726, 0.7693, 0.5455, 0.7891]}, {"w": "in", "b": [0.5518, 0.7693, 0.5714, 0.7891]}, {"w": "the", "b": [0.5777, 0.7693, 0.6085, 0.7891]}, {"w": "data", "b": [0.6148, 0.7693, 0.6569, 0.7891]}, {"w": "at", "b": [0.6632, 0.7693, 0.6814, 0.7891]}, {"w": "hand.", "b": [0.6877, 0.7693, 0.743, 0.7891]}, {"w": "Unsupervised", "b": [0.1294, 0.7898, 0.2681, 0.8096]}, {"w": "learning", "b": [0.2744, 0.7898, 0.3571, 0.8096]}, {"w": "is", "b": [0.3634, 0.7898, 0.3802, 0.8096]}, {"w": "the", "b": [0.3865, 0.7898, 0.4174, 0.8096]}, {"w": "bread", "b": [0.4237, 0.7898, 0.4797, 0.8096]}, {"w": "and", "b": [0.486, 0.7898, 0.5224, 0.8096]}, {"w": "butter", "b": [0.5287, 0.7898, 0.5876, 0.8096]}, {"w": "of", "b": [0.5939, 0.7898, 0.6149, 0.8096]}, {"w": "data", "b": [0.6212, 0.7898, 0.6632, 0.8096]}, {"w": "analytics,", "b": [0.6695, 0.7898, 0.7655, 0.8096]}, {"w": "and", "b": [0.7718, 0.7898, 0.8083, 0.8096]}, {"w": "it’s", "b": [0.8146, 0.7898, 0.8453, 0.8096]}, {"w": "often", "b": [0.1294, 0.8103, 0.1813, 0.8301]}, {"w": "a", "b": [0.1876, 0.8103, 0.1988, 0.8301]}, {"w": "necessary", "b": [0.2051, 0.8103, 0.3031, 0.8301]}, {"w": "step", "b": [0.3094, 0.8103, 0.3501, 0.8301]}, {"w": "in", "b": [0.3563, 0.8103, 0.376, 0.8301]}, {"w": "better", "b": [0.3823, 0.8103, 0.4397, 0.8301]}, {"w": "understanding", "b": [0.446, 0.8103, 0.589, 0.8301]}, {"w": "a", "b": [0.5953, 0.8103, 0.6065, 0.8301]}, {"w": "dataset", "b": [0.6128, 0.8103, 0.6828, 0.8301]}, {"w": "before", "b": [0.6891, 0.8103, 0.7536, 0.8301]}, {"w": "attempting", "b": [0.7599, 0.8103, 0.8678, 0.8301]}, {"w": "to", "b": [0.1294, 0.8308, 0.149, 0.8506]}, {"w": "solve", "b": [0.1553, 0.8308, 0.2086, 0.8506]}, {"w": "a", "b": [0.2149, 0.8308, 0.2261, 0.8506]}, {"w": "supervised-learning", "b": [0.2324, 0.8308, 0.4314, 0.8506]}, {"w": "problem.", "b": [0.4377, 0.8308, 0.5281, 0.8506]}, {"w": "Dimensionality", "b": [0.5343, 0.8308, 0.6885, 0.8506]}, {"w": "reduction", "b": [0.6948, 0.8308, 0.7905, 0.8506]}, {"w": "and", "b": [0.7968, 0.8308, 0.8332, 0.8506]}, {"w": "clustering", "b": [0.1294, 0.8513, 0.2303, 0.8711]}, {"w": "are", "b": [0.2366, 0.8513, 0.2674, 0.8711]}, {"w": "well-known", "b": [0.2737, 0.8513, 0.3942, 0.8711]}, {"w": "categories", "b": [0.4005, 0.8513, 0.5028, 0.8711]}, {"w": "of", "b": [0.5091, 0.8513, 0.5301, 0.8711]}, {"w": "unsupervised", "b": [0.5364, 0.8513, 0.6695, 0.8711]}, {"w": "learning.", "b": [0.6758, 0.8513, 0.7648, 0.8711]}]}]}, {"page": 141, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "4.1.3. Self-supervised learning", "words": [{"w": "4.1.3.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Self-supervised", "b": [0.1925, 0.0857, 0.3564, 0.1054]}, {"w": "learning", "b": [0.3628, 0.0857, 0.4525, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "This is a specific instance of supervised learning, but it’s different enough that it deserves its own category. Self-supervised learning is supervised learning without human-annotated labels—you can think of it as supervised learning without any humans in the loop. There are still labels involved (because the learning has to be supervised by something), but they’re generated from the input data, typically using a heuristic algorithm.", "words": [{"w": "This", "b": [0.1294, 0.1285, 0.1743, 0.1482]}, {"w": "is", "b": [0.1806, 0.1285, 0.1974, 0.1482]}, {"w": "a", "b": [0.2037, 0.1285, 0.2149, 0.1482]}, {"w": "specific", "b": [0.2212, 0.1285, 0.2997, 0.1482]}, {"w": "instance", "b": [0.306, 0.1285, 0.3886, 0.1482]}, {"w": "of", "b": [0.3949, 0.1285, 0.416, 0.1482]}, {"w": "supervised", "b": [0.4223, 0.1285, 0.5301, 0.1482]}, {"w": "learning,", "b": [0.5365, 0.1285, 0.6254, 0.1482]}, {"w": "but", "b": [0.6317, 0.1285, 0.664, 0.1482]}, {"w": "it’s", "b": [0.6703, 0.1285, 0.7011, 0.1482]}, {"w": "different", "b": [0.7074, 0.1285, 0.7938, 0.1482]}, {"w": "enough", "b": [0.1294, 0.149, 0.2037, 0.1687]}, {"w": "that", "b": [0.21, 0.149, 0.2478, 0.1687]}, {"w": "it", "b": [0.2541, 0.149, 0.2682, 0.1687]}, {"w": "deserves", "b": [0.2745, 0.149, 0.3613, 0.1687]}, {"w": "its", "b": [0.3676, 0.149, 0.3915, 0.1687]}, {"w": "own", "b": [0.3978, 0.149, 0.4412, 0.1687]}, {"w": "category.", "b": [0.4475, 0.149, 0.539, 0.1687]}, {"w": "Self-supervised", "b": [0.5453, 0.149, 0.7022, 0.1687]}, {"w": "learning", "b": [0.7085, 0.149, 0.7912, 0.1687]}, {"w": "is", "b": [0.7975, 0.149, 0.8143, 0.1687]}, {"w": "supervised", "b": [0.1294, 0.1695, 0.2373, 0.1892]}, {"w": "learning", "b": [0.2436, 0.1695, 0.3263, 0.1892]}, {"w": "without", "b": [0.3326, 0.1695, 0.4097, 0.1892]}, {"w": "human-annotated", "b": [0.4159, 0.1695, 0.5911, 0.1892]}, {"w": "labels—you", "b": [0.5974, 0.1695, 0.7193, 0.1892]}, {"w": "can", "b": [0.7256, 0.1695, 0.7606, 0.1892]}, {"w": "think", "b": [0.7669, 0.1695, 0.8188, 0.1892]}, {"w": "of", "b": [0.8251, 0.1695, 0.8461, 0.1892]}, {"w": "it", "b": [0.8524, 0.1695, 0.8664, 0.1892]}, {"w": "as", "b": [0.1294, 0.19, 0.1504, 0.2097]}, {"w": "supervised", "b": [0.1567, 0.19, 0.2646, 0.2097]}, {"w": "learning", "b": [0.2709, 0.19, 0.3536, 0.2097]}, {"w": "without", "b": [0.3599, 0.19, 0.437, 0.2097]}, {"w": "any", "b": [0.4433, 0.19, 0.4797, 0.2097]}, {"w": "humans", "b": [0.486, 0.19, 0.5645, 0.2097]}, {"w": "in", "b": [0.5708, 0.19, 0.5904, 0.2097]}, {"w": "the", "b": [0.5967, 0.19, 0.6276, 0.2097]}, {"w": "loop.", "b": [0.6339, 0.19, 0.685, 0.2097]}, {"w": "There", "b": [0.6913, 0.19, 0.7502, 0.2097]}, {"w": "are", "b": [0.7565, 0.19, 0.7873, 0.2097]}, {"w": "still", "b": [0.7936, 0.19, 0.8314, 0.2097]}, {"w": "labels", "b": [0.1294, 0.2105, 0.1883, 0.2302]}, {"w": "involved", "b": [0.1946, 0.2105, 0.2829, 0.2302]}, {"w": "(because", "b": [0.2891, 0.2105, 0.3774, 0.2302]}, {"w": "the", "b": [0.3837, 0.2105, 0.4145, 0.2302]}, {"w": "learning", "b": [0.4208, 0.2105, 0.5035, 0.2302]}, {"w": "has", "b": [0.5098, 0.2105, 0.5434, 0.2302]}, {"w": "to", "b": [0.5497, 0.2105, 0.5694, 0.2302]}, {"w": "be", "b": [0.5757, 0.2105, 0.5995, 0.2302]}, {"w": "supervised", "b": [0.6058, 0.2105, 0.7137, 0.2302]}, {"w": "by", "b": [0.72, 0.2105, 0.7452, 0.2302]}, {"w": "something),", "b": [0.1294, 0.231, 0.2492, 0.2507]}, {"w": "but", "b": [0.2555, 0.231, 0.2878, 0.2507]}, {"w": "they’re", "b": [0.2941, 0.231, 0.3655, 0.2507]}, {"w": "generated", "b": [0.3718, 0.231, 0.4699, 0.2507]}, {"w": "from", "b": [0.4762, 0.231, 0.5252, 0.2507]}, {"w": "the", "b": [0.5315, 0.231, 0.5624, 0.2507]}, {"w": "input", "b": [0.5687, 0.231, 0.6205, 0.2507]}, {"w": "data,", "b": [0.6268, 0.231, 0.6752, 0.2507]}, {"w": "typically", "b": [0.6815, 0.231, 0.7698, 0.2507]}, {"w": "using", "b": [0.7761, 0.231, 0.8307, 0.2507]}, {"w": "a", "b": [0.837, 0.231, 0.8482, 0.2507]}, {"w": "heuristic", "b": [0.1294, 0.2515, 0.2163, 0.2712]}, {"w": "algorithm.", "b": [0.2226, 0.2515, 0.327, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "For instance, autoencoders are a well-known instance of self-supervised learning, where the generated targets are the input, unmodified. In the same way, trying to predict the next frame in a video, given past frames, or the next word in a text, given previous words, are instances of self- supervised learning (temporally supervised learning, in this case: supervision comes from future input data). Note that the distinction between supervised, self-supervised, and unsupervised learning can be blurry sometimes—these categories are more of a continuum without solid borders. Self-supervised learning can be reinterpreted as either supervised or unsupervised learning, depending on whether you pay attention to the learning mechanism or to the context of its application.", "words": [{"w": "For", "b": [0.1294, 0.2942, 0.1645, 0.314]}, {"w": "instance,", "b": [0.1708, 0.2942, 0.2597, 0.314]}, {"w": "autoencoders", "b": [0.266, 0.2942, 0.4019, 0.314]}, {"w": "are", "b": [0.4082, 0.2942, 0.439, 0.314]}, {"w": "a", "b": [0.4453, 0.2942, 0.4565, 0.314]}, {"w": "well-known", "b": [0.4628, 0.2942, 0.5833, 0.314]}, {"w": "instance", "b": [0.5896, 0.2942, 0.6723, 0.314]}, {"w": "of", "b": [0.6786, 0.2942, 0.6996, 0.314]}, {"w": "self-supervised", "b": [0.7059, 0.2942, 0.8586, 0.314]}, {"w": "learning,", "b": [0.1294, 0.3147, 0.2184, 0.3345]}, {"w": "where", "b": [0.2247, 0.3147, 0.2863, 0.3345]}, {"w": "the", "b": [0.2926, 0.3147, 0.3234, 0.3345]}, {"w": "generated", "b": [0.3298, 0.3147, 0.4278, 0.3345]}, {"w": "targets", "b": [0.4341, 0.3147, 0.5009, 0.3345]}, {"w": "are", "b": [0.5072, 0.3147, 0.538, 0.3345]}, {"w": "the", "b": [0.5443, 0.3147, 0.5751, 0.3345]}, {"w": "input,", "b": [0.5814, 0.3147, 0.6396, 0.3345]}, {"w": "unmodified.", "b": [0.6459, 0.3147, 0.7685, 0.3345]}, {"w": "In", "b": [0.7748, 0.3147, 0.7958, 0.3345]}, {"w": "the", "b": [0.8021, 0.3147, 0.833, 0.3345]}, {"w": "same", "b": [0.1294, 0.3352, 0.1813, 0.355]}, {"w": "way,", "b": [0.1875, 0.3352, 0.2342, 0.355]}, {"w": "trying", "b": [0.2406, 0.3352, 0.3008, 0.355]}, {"w": "to", "b": [0.3071, 0.3352, 0.3267, 0.355]}, {"w": "predict", "b": [0.3331, 0.3352, 0.4031, 0.355]}, {"w": "the", "b": [0.4094, 0.3352, 0.4402, 0.355]}, {"w": "next", "b": [0.4465, 0.3352, 0.49, 0.355]}, {"w": "frame", "b": [0.4963, 0.3352, 0.5551, 0.355]}, {"w": "in", "b": [0.5614, 0.3352, 0.581, 0.355]}, {"w": "a", "b": [0.5874, 0.3352, 0.5986, 0.355]}, {"w": "video,", "b": [0.6049, 0.3352, 0.6672, 0.355]}, {"w": "given", "b": [0.6735, 0.3352, 0.7296, 0.355]}, {"w": "past", "b": [0.7359, 0.3352, 0.7765, 0.355]}, {"w": "frames,", "b": [0.7828, 0.3352, 0.8578, 0.355]}, {"w": "or", "b": [0.1294, 0.3557, 0.1504, 0.3755]}, {"w": "the", "b": [0.1567, 0.3557, 0.1876, 0.3755]}, {"w": "next", "b": [0.1939, 0.3557, 0.2373, 0.3755]}, {"w": "word", "b": [0.2436, 0.3557, 0.2954, 0.3755]}, {"w": "in", "b": [0.3018, 0.3557, 0.3214, 0.3755]}, {"w": "a", "b": [0.3277, 0.3557, 0.3389, 0.3755]}, {"w": "text,", "b": [0.3452, 0.3557, 0.3893, 0.3755]}, {"w": "given", "b": [0.3956, 0.3557, 0.4517, 0.3755]}, {"w": "previous", "b": [0.458, 0.3557, 0.5449, 0.3755]}, {"w": "words,", "b": [0.5512, 0.3557, 0.6191, 0.3755]}, {"w": "are", "b": [0.6255, 0.3557, 0.6563, 0.3755]}, {"w": "instances", "b": [0.6625, 0.3557, 0.755, 0.3755]}, {"w": "of", "b": [0.7613, 0.3557, 0.7823, 0.3755]}, {"w": "self-", "b": [0.7886, 0.3557, 0.8334, 0.3755]}, {"w": "supervised", "b": [0.1294, 0.3762, 0.2373, 0.396]}, {"w": "learning", "b": [0.2436, 0.3762, 0.3263, 0.396]}, {"w": "(temporally", "b": [0.3326, 0.3762, 0.4503, 0.396]}, {"w": "supervised", "b": [0.4566, 0.3762, 0.5645, 0.396]}, {"w": "learning,", "b": [0.5708, 0.3762, 0.6625, 0.396]}, {"w": "in", "b": [0.6688, 0.3762, 0.6885, 0.396]}, {"w": "this", "b": [0.6948, 0.3762, 0.7312, 0.396]}, {"w": "case:", "b": [0.7375, 0.3762, 0.7879, 0.396]}, {"w": "supervision", "b": [0.1294, 0.3967, 0.2457, 0.4165]}, {"w": "comes", "b": [0.252, 0.3967, 0.3165, 0.4165]}, {"w": "from", "b": [0.3228, 0.3967, 0.3718, 0.4165]}, {"w": "future", "b": [0.3781, 0.3967, 0.4384, 0.4165]}, {"w": "input", "b": [0.4447, 0.3967, 0.4965, 0.4165]}, {"w": "data).", "b": [0.5029, 0.3967, 0.5596, 0.4165]}, {"w": "Note", "b": [0.5659, 0.3967, 0.6149, 0.4165]}, {"w": "that", "b": [0.6212, 0.3967, 0.6591, 0.4165]}, {"w": "the", "b": [0.6654, 0.3967, 0.6962, 0.4165]}, {"w": "distinction", "b": [0.7025, 0.3967, 0.809, 0.4165]}, {"w": "between", "b": [0.1294, 0.4172, 0.2135, 0.437]}, {"w": "supervised,", "b": [0.2198, 0.4172, 0.334, 0.437]}, {"w": "self-supervised,", "b": [0.3403, 0.4172, 0.4993, 0.437]}, {"w": "and", "b": [0.5056, 0.4172, 0.542, 0.437]}, {"w": "unsupervised", "b": [0.5483, 0.4172, 0.6814, 0.437]}, {"w": "learning", "b": [0.6877, 0.4172, 0.7704, 0.437]}, {"w": "can", "b": [0.7767, 0.4172, 0.8117, 0.437]}, {"w": "be", "b": [0.818, 0.4172, 0.8418, 0.437]}, {"w": "blurry", "b": [0.1294, 0.4377, 0.1911, 0.4575]}, {"w": "sometimes—these", "b": [0.1974, 0.4377, 0.3824, 0.4575]}, {"w": "categories", "b": [0.3887, 0.4377, 0.4909, 0.4575]}, {"w": "are", "b": [0.4972, 0.4377, 0.528, 0.4575]}, {"w": "more", "b": [0.5343, 0.4377, 0.5862, 0.4575]}, {"w": "of", "b": [0.5925, 0.4377, 0.6135, 0.4575]}, {"w": "a", "b": [0.6198, 0.4377, 0.631, 0.4575]}, {"w": "continuum", "b": [0.6373, 0.4377, 0.7452, 0.4575]}, {"w": "without", "b": [0.7515, 0.4377, 0.8286, 0.4575]}, {"w": "solid", "b": [0.1294, 0.4582, 0.1785, 0.478]}, {"w": "borders.", "b": [0.1848, 0.4582, 0.2667, 0.478]}, {"w": "Self-supervised", "b": [0.273, 0.4582, 0.43, 0.478]}, {"w": "learning", "b": [0.4363, 0.4582, 0.5189, 0.478]}, {"w": "can", "b": [0.5252, 0.4582, 0.5602, 0.478]}, {"w": "be", "b": [0.5666, 0.4582, 0.5904, 0.478]}, {"w": "reinterpreted", "b": [0.5967, 0.4582, 0.7255, 0.478]}, {"w": "as", "b": [0.7319, 0.4582, 0.7529, 0.478]}, {"w": "either", "b": [0.7592, 0.4582, 0.8166, 0.478]}, {"w": "supervised", "b": [0.1294, 0.4787, 0.2373, 0.4985]}, {"w": "or", "b": [0.2436, 0.4787, 0.2646, 0.4985]}, {"w": "unsupervised", "b": [0.2709, 0.4787, 0.404, 0.4985]}, {"w": "learning,", "b": [0.4104, 0.4787, 0.4993, 0.4985]}, {"w": "depending", "b": [0.5056, 0.4787, 0.6107, 0.4985]}, {"w": "on", "b": [0.617, 0.4787, 0.6423, 0.4985]}, {"w": "whether", "b": [0.6486, 0.4787, 0.7298, 0.4985]}, {"w": "you", "b": [0.7361, 0.4787, 0.774, 0.4985]}, {"w": "pay", "b": [0.7803, 0.4787, 0.8167, 0.4985]}, {"w": "attention", "b": [0.1294, 0.4992, 0.2177, 0.519]}, {"w": "to", "b": [0.224, 0.4992, 0.2436, 0.519]}, {"w": "the", "b": [0.2499, 0.4992, 0.2808, 0.519]}, {"w": "learning", "b": [0.287, 0.4992, 0.3697, 0.519]}, {"w": "mechanism", "b": [0.376, 0.4992, 0.4909, 0.519]}, {"w": "or", "b": [0.4972, 0.4992, 0.5182, 0.519]}, {"w": "to", "b": [0.5245, 0.4992, 0.5442, 0.519]}, {"w": "the", "b": [0.5505, 0.4992, 0.5813, 0.519]}, {"w": "context", "b": [0.5876, 0.4992, 0.6619, 0.519]}, {"w": "of", "b": [0.6682, 0.4992, 0.6892, 0.519]}, {"w": "its", "b": [0.6955, 0.4992, 0.7193, 0.519]}, {"w": "application.", "b": [0.7256, 0.4992, 0.844, 0.519]}]}, {"id": "b_3", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.5478, 0.1672, 0.5626]}]}, {"id": "b_4", "type": "paragraph", "text": "In this book, we’ll focus specifically on supervised learning, because it’s by far the dominant form of deep learning today, with a wide range of industry applications. We’ll also take a briefer look at self-supervised learning in later chapters.", "words": [{"w": "In", "b": [0.1294, 0.5812, 0.1504, 0.601]}, {"w": "this", "b": [0.1567, 0.5812, 0.1932, 0.601]}, {"w": "book,", "b": [0.1995, 0.5812, 0.2562, 0.601]}, {"w": "we’ll", "b": [0.2626, 0.5812, 0.3144, 0.601]}, {"w": "focus", "b": [0.3207, 0.5812, 0.3753, 0.601]}, {"w": "specifically", "b": [0.3816, 0.5812, 0.4979, 0.601]}, {"w": "on", "b": [0.5042, 0.5812, 0.5295, 0.601]}, {"w": "supervised", "b": [0.5358, 0.5812, 0.6437, 0.601]}, {"w": "learning,", "b": [0.65, 0.5812, 0.7389, 0.601]}, {"w": "because", "b": [0.7452, 0.5812, 0.8251, 0.601]}, {"w": "it’s", "b": [0.8314, 0.5812, 0.8622, 0.601]}, {"w": "by", "b": [0.1294, 0.6017, 0.1546, 0.6215]}, {"w": "far", "b": [0.1609, 0.6017, 0.1889, 0.6215]}, {"w": "the", "b": [0.1953, 0.6017, 0.2261, 0.6215]}, {"w": "dominant", "b": [0.2324, 0.6017, 0.3277, 0.6215]}, {"w": "form", "b": [0.334, 0.6017, 0.383, 0.6215]}, {"w": "of", "b": [0.3893, 0.6017, 0.4104, 0.6215]}, {"w": "deep", "b": [0.4167, 0.6017, 0.4643, 0.6215]}, {"w": "learning", "b": [0.4706, 0.6017, 0.5533, 0.6215]}, {"w": "today,", "b": [0.5596, 0.6017, 0.6202, 0.6215]}, {"w": "with", "b": [0.6265, 0.6017, 0.6714, 0.6215]}, {"w": "a", "b": [0.6777, 0.6017, 0.6889, 0.6215]}, {"w": "wide", "b": [0.6952, 0.6017, 0.7442, 0.6215]}, {"w": "range", "b": [0.7505, 0.6017, 0.8066, 0.6215]}, {"w": "of", "b": [0.8129, 0.6017, 0.8339, 0.6215]}, {"w": "industry", "b": [0.1294, 0.6222, 0.2121, 0.642]}, {"w": "applications.", "b": [0.2184, 0.6222, 0.3466, 0.642]}, {"w": "We’ll", "b": [0.3529, 0.6222, 0.4083, 0.642]}, {"w": "also", "b": [0.4146, 0.6222, 0.4553, 0.642]}, {"w": "take", "b": [0.4616, 0.6222, 0.5036, 0.642]}, {"w": "a", "b": [0.5099, 0.6222, 0.5211, 0.642]}, {"w": "briefer", "b": [0.5274, 0.6222, 0.5946, 0.642]}, {"w": "look", "b": [0.6009, 0.6222, 0.6458, 0.642]}, {"w": "at", "b": [0.6521, 0.6222, 0.6703, 0.642]}, {"w": "self-supervised", "b": [0.6766, 0.6222, 0.8293, 0.642]}, {"w": "learning", "b": [0.1294, 0.6427, 0.2121, 0.6625]}, {"w": "in", "b": [0.2184, 0.6427, 0.238, 0.6625]}, {"w": "later", "b": [0.2443, 0.6427, 0.2891, 0.6625]}, {"w": "chapters.", "b": [0.2954, 0.6427, 0.3858, 0.6625]}]}, {"id": "b_5", "type": "paragraph", "text": "4.1.4. Reinforcement learning", "words": [{"w": "4.1.4.", "b": [0.1294, 0.7167, 0.1862, 0.7365]}, {"w": "Reinforcement", "b": [0.1925, 0.7167, 0.3517, 0.7365]}, {"w": "learning", "b": [0.358, 0.7167, 0.4477, 0.7365]}]}, {"id": "b_6", "type": "paragraph", "text": "Long overlooked, this branch of machine learning recently started to get a lot of attention after Google DeepMind successfully applied it to learning to play Atari games (and, later, learning to play Go at the highest level). In reinforcement learning, an agent receives information about its environment and learns to choose actions that will maximize some reward. For instance, a neural network that “looks” at a video-", "words": [{"w": "Long", "b": [0.1294, 0.7595, 0.1827, 0.7793]}, {"w": "overlooked,", "b": [0.189, 0.7595, 0.3088, 0.7793]}, {"w": "this", "b": [0.3151, 0.7595, 0.3515, 0.7793]}, {"w": "branch", "b": [0.3578, 0.7595, 0.4265, 0.7793]}, {"w": "of", "b": [0.4328, 0.7595, 0.4538, 0.7793]}, {"w": "machine", "b": [0.4601, 0.7595, 0.5456, 0.7793]}, {"w": "learning", "b": [0.5519, 0.7595, 0.6345, 0.7793]}, {"w": "recently", "b": [0.6408, 0.7595, 0.7221, 0.7793]}, {"w": "started", "b": [0.7284, 0.7595, 0.7956, 0.7793]}, {"w": "to", "b": [0.802, 0.7595, 0.8216, 0.7793]}, {"w": "get", "b": [0.8279, 0.7595, 0.8587, 0.7793]}, {"w": "a", "b": [0.1294, 0.78, 0.1406, 0.7998]}, {"w": "lot", "b": [0.1469, 0.78, 0.1736, 0.7998]}, {"w": "of", "b": [0.1799, 0.78, 0.2009, 0.7998]}, {"w": "attention", "b": [0.2072, 0.78, 0.2955, 0.7998]}, {"w": "after", "b": [0.3018, 0.78, 0.348, 0.7998]}, {"w": "Google", "b": [0.3543, 0.78, 0.4286, 0.7998]}, {"w": "DeepMind", "b": [0.4349, 0.78, 0.5428, 0.7998]}, {"w": "successfully", "b": [0.5491, 0.78, 0.6724, 0.7998]}, {"w": "applied", "b": [0.6786, 0.78, 0.7529, 0.7998]}, {"w": "it", "b": [0.7592, 0.78, 0.7732, 0.7998]}, {"w": "to", "b": [0.7795, 0.78, 0.7991, 0.7998]}, {"w": "learning", "b": [0.1294, 0.8005, 0.2121, 0.8203]}, {"w": "to", "b": [0.2184, 0.8005, 0.238, 0.8203]}, {"w": "play", "b": [0.2443, 0.8005, 0.2878, 0.8203]}, {"w": "Atari", "b": [0.2941, 0.8005, 0.3459, 0.8203]}, {"w": "games", "b": [0.3522, 0.8005, 0.4167, 0.8203]}, {"w": "(and,", "b": [0.423, 0.8005, 0.4741, 0.8203]}, {"w": "later,", "b": [0.4804, 0.8005, 0.5305, 0.8203]}, {"w": "learning", "b": [0.5368, 0.8005, 0.6194, 0.8203]}, {"w": "to", "b": [0.6257, 0.8005, 0.6454, 0.8203]}, {"w": "play", "b": [0.6517, 0.8005, 0.6951, 0.8203]}, {"w": "Go", "b": [0.7014, 0.8005, 0.7322, 0.8203]}, {"w": "at", "b": [0.7385, 0.8005, 0.7568, 0.8203]}, {"w": "the", "b": [0.7631, 0.8005, 0.7939, 0.8203]}, {"w": "highest", "b": [0.1294, 0.821, 0.2023, 0.8408]}, {"w": "level).", "b": [0.2086, 0.821, 0.2723, 0.8408]}, {"w": "In", "b": [0.2786, 0.821, 0.2997, 0.8408]}, {"w": "reinforcement", "b": [0.306, 0.821, 0.4475, 0.8408]}, {"w": "learning,", "b": [0.4538, 0.821, 0.5427, 0.8408]}, {"w": "an", "b": [0.549, 0.821, 0.5728, 0.8408]}, {"w": "agent", "b": [0.5791, 0.821, 0.6351, 0.8408]}, {"w": "receives", "b": [0.6414, 0.821, 0.7241, 0.8408]}, {"w": "information", "b": [0.7304, 0.821, 0.8495, 0.8408]}, {"w": "about", "b": [0.1294, 0.8415, 0.1855, 0.8613]}, {"w": "its", "b": [0.1918, 0.8415, 0.2156, 0.8613]}, {"w": "environment", "b": [0.2219, 0.8415, 0.3494, 0.8613]}, {"w": "and", "b": [0.3557, 0.8415, 0.3922, 0.8613]}, {"w": "learns", "b": [0.3985, 0.8415, 0.4587, 0.8613]}, {"w": "to", "b": [0.465, 0.8415, 0.4846, 0.8613]}, {"w": "choose", "b": [0.4909, 0.8415, 0.561, 0.8613]}, {"w": "actions", "b": [0.5673, 0.8415, 0.6388, 0.8613]}, {"w": "that", "b": [0.6451, 0.8415, 0.6829, 0.8613]}, {"w": "will", "b": [0.6892, 0.8415, 0.7285, 0.8613]}, {"w": "maximize", "b": [0.7348, 0.8415, 0.8343, 0.8613]}, {"w": "some", "b": [0.1294, 0.862, 0.1827, 0.8818]}, {"w": "reward.", "b": [0.189, 0.862, 0.2653, 0.8818]}, {"w": "For", "b": [0.2716, 0.862, 0.3066, 0.8818]}, {"w": "instance,", "b": [0.313, 0.862, 0.4019, 0.8818]}, {"w": "a", "b": [0.4082, 0.862, 0.4194, 0.8818]}, {"w": "neural", "b": [0.4257, 0.862, 0.4888, 0.8818]}, {"w": "network", "b": [0.495, 0.862, 0.5777, 0.8818]}, {"w": "that", "b": [0.584, 0.862, 0.6219, 0.8818]}, {"w": "“looks”", "b": [0.6282, 0.862, 0.7052, 0.8818]}, {"w": "at", "b": [0.7115, 0.862, 0.7297, 0.8818]}, {"w": "a", "b": [0.7361, 0.862, 0.7473, 0.8818]}, {"w": "video-", "b": [0.7536, 0.862, 0.818, 0.8818]}]}]}, {"page": 142, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "game screen and outputs game actions in order to maximize its score can be trained via reinforcement learning.", "words": [{"w": "game", "b": [0.1294, 0.0857, 0.1841, 0.1054]}, {"w": "screen", "b": [0.1904, 0.0857, 0.2548, 0.1054]}, {"w": "and", "b": [0.2611, 0.0857, 0.2975, 0.1054]}, {"w": "outputs", "b": [0.3038, 0.0857, 0.3781, 0.1054]}, {"w": "game", "b": [0.3844, 0.0857, 0.4391, 0.1054]}, {"w": "actions", "b": [0.4454, 0.0857, 0.5168, 0.1054]}, {"w": "in", "b": [0.5231, 0.0857, 0.5428, 0.1054]}, {"w": "order", "b": [0.5491, 0.0857, 0.6023, 0.1054]}, {"w": "to", "b": [0.6086, 0.0857, 0.6282, 0.1054]}, {"w": "maximize", "b": [0.6345, 0.0857, 0.734, 0.1054]}, {"w": "its", "b": [0.7403, 0.0857, 0.7642, 0.1054]}, {"w": "score", "b": [0.7705, 0.0857, 0.8237, 0.1054]}, {"w": "can", "b": [0.83, 0.0857, 0.865, 0.1054]}, {"w": "be", "b": [0.1294, 0.1062, 0.1532, 0.1259]}, {"w": "trained", "b": [0.1595, 0.1062, 0.2296, 0.1259]}, {"w": "via", "b": [0.2359, 0.1062, 0.2667, 0.1259]}, {"w": "reinforcement", "b": [0.273, 0.1062, 0.4145, 0.1259]}, {"w": "learning.", "b": [0.4207, 0.1062, 0.5097, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Currently, reinforcement learning is mostly a research area and hasn’t yet had significant practical successes beyond games. In time, however, we expect to see reinforcement learning take over an increasingly large range of real-world applications: self-driving cars, robotics, resource management, education, and so on. It’s an idea whose time has come, or will come soon.", "words": [{"w": "Currently,", "b": [0.1294, 0.149, 0.2308, 0.1687]}, {"w": "reinforcement", "b": [0.2371, 0.149, 0.3786, 0.1687]}, {"w": "learning", "b": [0.3849, 0.149, 0.4675, 0.1687]}, {"w": "is", "b": [0.4738, 0.149, 0.4907, 0.1687]}, {"w": "mostly", "b": [0.497, 0.149, 0.5657, 0.1687]}, {"w": "a", "b": [0.572, 0.149, 0.5832, 0.1687]}, {"w": "research", "b": [0.5895, 0.149, 0.6735, 0.1687]}, {"w": "area", "b": [0.6798, 0.149, 0.7218, 0.1687]}, {"w": "and", "b": [0.7281, 0.149, 0.7645, 0.1687]}, {"w": "hasn’t", "b": [0.7708, 0.149, 0.832, 0.1687]}, {"w": "yet", "b": [0.8383, 0.149, 0.8691, 0.1687]}, {"w": "had", "b": [0.1294, 0.1695, 0.1658, 0.1892]}, {"w": "significant", "b": [0.1721, 0.1695, 0.2786, 0.1892]}, {"w": "practical", "b": [0.285, 0.1695, 0.3718, 0.1892]}, {"w": "successes", "b": [0.3781, 0.1695, 0.4748, 0.1892]}, {"w": "beyond", "b": [0.4811, 0.1695, 0.5553, 0.1892]}, {"w": "games.", "b": [0.5617, 0.1695, 0.6324, 0.1892]}, {"w": "In", "b": [0.6387, 0.1695, 0.6597, 0.1892]}, {"w": "time,", "b": [0.666, 0.1695, 0.7171, 0.1892]}, {"w": "however,", "b": [0.7234, 0.1695, 0.8156, 0.1892]}, {"w": "we", "b": [0.8219, 0.1695, 0.8513, 0.1892]}, {"w": "expect", "b": [0.1294, 0.19, 0.1953, 0.2097]}, {"w": "to", "b": [0.2016, 0.19, 0.2212, 0.2097]}, {"w": "see", "b": [0.2275, 0.19, 0.2597, 0.2097]}, {"w": "reinforcement", "b": [0.266, 0.19, 0.4075, 0.2097]}, {"w": "learning", "b": [0.4138, 0.19, 0.4965, 0.2097]}, {"w": "take", "b": [0.5028, 0.19, 0.5448, 0.2097]}, {"w": "over", "b": [0.5511, 0.19, 0.5959, 0.2097]}, {"w": "an", "b": [0.6022, 0.19, 0.6261, 0.2097]}, {"w": "increasingly", "b": [0.6324, 0.19, 0.7557, 0.2097]}, {"w": "large", "b": [0.762, 0.19, 0.8118, 0.2097]}, {"w": "range", "b": [0.1294, 0.2105, 0.1854, 0.2302]}, {"w": "of", "b": [0.1917, 0.2105, 0.2128, 0.2302]}, {"w": "real-world", "b": [0.2191, 0.2105, 0.3241, 0.2302]}, {"w": "applications:", "b": [0.3304, 0.2105, 0.4594, 0.2302]}, {"w": "self-driving", "b": [0.4656, 0.2105, 0.5833, 0.2302]}, {"w": "cars,", "b": [0.5896, 0.2105, 0.6366, 0.2302]}, {"w": "robotics,", "b": [0.6429, 0.2105, 0.7304, 0.2302]}, {"w": "resource", "b": [0.7368, 0.2105, 0.8222, 0.2302]}, {"w": "management,", "b": [0.1294, 0.231, 0.2646, 0.2507]}, {"w": "education,", "b": [0.2709, 0.231, 0.3753, 0.2507]}, {"w": "and", "b": [0.3816, 0.231, 0.418, 0.2507]}, {"w": "so", "b": [0.4244, 0.231, 0.4468, 0.2507]}, {"w": "on.", "b": [0.4531, 0.231, 0.4846, 0.2507]}, {"w": "It’s", "b": [0.4909, 0.231, 0.5231, 0.2507]}, {"w": "an", "b": [0.5294, 0.231, 0.5532, 0.2507]}, {"w": "idea", "b": [0.5595, 0.231, 0.6016, 0.2507]}, {"w": "whose", "b": [0.6079, 0.231, 0.6723, 0.2507]}, {"w": "time", "b": [0.6786, 0.231, 0.7235, 0.2507]}, {"w": "has", "b": [0.7298, 0.231, 0.7634, 0.2507]}, {"w": "come,", "b": [0.7697, 0.231, 0.8307, 0.2507]}, {"w": "or", "b": [0.837, 0.231, 0.858, 0.2507]}, {"w": "will", "b": [0.1294, 0.2515, 0.1687, 0.2712]}, {"w": "come", "b": [0.175, 0.2515, 0.2296, 0.2712]}, {"w": "soon.", "b": [0.2359, 0.2515, 0.2899, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "Classification and regression glossary", "words": [{"w": "Classification", "b": [0.1294, 0.2987, 0.2752, 0.3184]}, {"w": "and", "b": [0.2815, 0.2987, 0.3221, 0.3184]}, {"w": "regression", "b": [0.3284, 0.2987, 0.4382, 0.3184]}, {"w": "glossary", "b": [0.4445, 0.2987, 0.5328, 0.3184]}]}, {"id": "b_3", "type": "paragraph", "text": "Classification and regression involve many specialized terms. You’ve come across some of them in earlier examples, and you’ll see more of them in future chapters. They have precise, machine-learning-specific definitions, and you should be familiar with them:", "words": [{"w": "Classification", "b": [0.1294, 0.3415, 0.2682, 0.3612]}, {"w": "and", "b": [0.2745, 0.3415, 0.3109, 0.3612]}, {"w": "regression", "b": [0.3172, 0.3415, 0.4209, 0.3612]}, {"w": "involve", "b": [0.4272, 0.3415, 0.5029, 0.3612]}, {"w": "many", "b": [0.5092, 0.3415, 0.5652, 0.3612]}, {"w": "specialized", "b": [0.5715, 0.3415, 0.6836, 0.3612]}, {"w": "terms.", "b": [0.6899, 0.3415, 0.7523, 0.3612]}, {"w": "You’ve", "b": [0.7586, 0.3415, 0.8316, 0.3612]}, {"w": "come", "b": [0.1294, 0.362, 0.1841, 0.3817]}, {"w": "across", "b": [0.1904, 0.362, 0.2534, 0.3817]}, {"w": "some", "b": [0.2597, 0.362, 0.313, 0.3817]}, {"w": "of", "b": [0.3193, 0.362, 0.3403, 0.3817]}, {"w": "them", "b": [0.3466, 0.362, 0.397, 0.3817]}, {"w": "in", "b": [0.4033, 0.362, 0.423, 0.3817]}, {"w": "earlier", "b": [0.4293, 0.362, 0.4937, 0.3817]}, {"w": "examples,", "b": [0.5, 0.362, 0.6016, 0.3817]}, {"w": "and", "b": [0.6079, 0.362, 0.6443, 0.3817]}, {"w": "you’ll", "b": [0.6506, 0.362, 0.7109, 0.3817]}, {"w": "see", "b": [0.7171, 0.362, 0.7493, 0.3817]}, {"w": "more", "b": [0.7556, 0.362, 0.8075, 0.3817]}, {"w": "of", "b": [0.8138, 0.362, 0.8348, 0.3817]}, {"w": "them", "b": [0.1294, 0.3825, 0.1799, 0.4022]}, {"w": "in", "b": [0.1862, 0.3825, 0.2058, 0.4022]}, {"w": "future", "b": [0.2121, 0.3825, 0.2723, 0.4022]}, {"w": "chapters.", "b": [0.2786, 0.3825, 0.369, 0.4022]}, {"w": "They", "b": [0.3753, 0.3825, 0.4272, 0.4022]}, {"w": "have", "b": [0.4335, 0.3825, 0.4811, 0.4022]}, {"w": "precise,", "b": [0.4874, 0.3825, 0.5651, 0.4022]}, {"w": "machine-learning-specific", "b": [0.5714, 0.3825, 0.8348, 0.4022]}, {"w": "definitions,", "b": [0.1294, 0.403, 0.2436, 0.4227]}, {"w": "and", "b": [0.2499, 0.403, 0.2864, 0.4227]}, {"w": "you", "b": [0.2927, 0.403, 0.3305, 0.4227]}, {"w": "should", "b": [0.3368, 0.403, 0.4041, 0.4227]}, {"w": "be", "b": [0.4104, 0.403, 0.4342, 0.4227]}, {"w": "familiar", "b": [0.4405, 0.403, 0.5204, 0.4227]}, {"w": "with", "b": [0.5266, 0.403, 0.5715, 0.4227]}, {"w": "them:", "b": [0.5778, 0.403, 0.6353, 0.4227]}]}, {"id": "b_4", "type": "paragraph", "text": "Sample or input—One data point that goes into your model. Prediction or output—What comes out of your model. Target— The truth. What your model should ideally have predicted, according to an external source of data. Prediction error or loss value—A measure of the distance between your model’s prediction and the target. Classes— A set of possible labels to choose from in a classification problem. For example, when classifying cat and dog pictures, “dog” and “cat” are the two classes. Label— A specific instance of a class annotation in a classification problem. For instance, if picture #1234 is annotated as containing the class “dog,” then “dog” is a label of picture #1234. Ground-truth or annotations—All targets for a dataset, typically collected by humans. Binary classification— A classification task where each input sample should be categorized into two exclusive categories. Multiclass classification— A classification task where each input sample should be categorized into more than two categories: for instance, classifying handwritten digits. Multilabel classification— A classification task where each input sample can be assigned multiple labels. For instance, a given image may contain both a cat and a dog and should be annotated both with", "words": [{"w": "Sample", "b": [0.1799, 0.4413, 0.2541, 0.4611]}, {"w": "or", "b": [0.2604, 0.4413, 0.2814, 0.4611]}, {"w": "input—One", "b": [0.2877, 0.4413, 0.4068, 0.4611]}, {"w": "data", "b": [0.4132, 0.4413, 0.4552, 0.4611]}, {"w": "point", "b": [0.4615, 0.4413, 0.5133, 0.4611]}, {"w": "that", "b": [0.5197, 0.4413, 0.5575, 0.4611]}, {"w": "goes", "b": [0.5638, 0.4413, 0.61, 0.4611]}, {"w": "into", "b": [0.6163, 0.4413, 0.6556, 0.4611]}, {"w": "your", "b": [0.6619, 0.4413, 0.7081, 0.4611]}, {"w": "model.", "b": [0.7144, 0.4413, 0.7838, 0.4611]}, {"w": "Prediction", "b": [0.1799, 0.4618, 0.2854, 0.4816]}, {"w": "or", "b": [0.2917, 0.4618, 0.3127, 0.4816]}, {"w": "output—What", "b": [0.319, 0.4618, 0.4633, 0.4816]}, {"w": "comes", "b": [0.4697, 0.4618, 0.5341, 0.4816]}, {"w": "out", "b": [0.5404, 0.4618, 0.5727, 0.4816]}, {"w": "of", "b": [0.579, 0.4618, 0.6, 0.4816]}, {"w": "your", "b": [0.6063, 0.4618, 0.6525, 0.4816]}, {"w": "model.", "b": [0.6588, 0.4618, 0.7282, 0.4816]}, {"w": "Target—", "b": [0.1799, 0.4823, 0.2714, 0.5021]}, {"w": "The", "b": [0.2777, 0.4823, 0.317, 0.5021]}, {"w": "truth.", "b": [0.3233, 0.4823, 0.3772, 0.5021]}, {"w": "What", "b": [0.3835, 0.4823, 0.4382, 0.5021]}, {"w": "your", "b": [0.4445, 0.4823, 0.4907, 0.5021]}, {"w": "model", "b": [0.497, 0.4823, 0.5601, 0.5021]}, {"w": "should", "b": [0.5664, 0.4823, 0.6337, 0.5021]}, {"w": "ideally", "b": [0.64, 0.4823, 0.7086, 0.5021]}, {"w": "have", "b": [0.7149, 0.4823, 0.7626, 0.5021]}, {"w": "predicted,", "b": [0.7689, 0.4823, 0.869, 0.5021]}, {"w": "according", "b": [0.1799, 0.5028, 0.2793, 0.5226]}, {"w": "to", "b": [0.2856, 0.5028, 0.3053, 0.5226]}, {"w": "an", "b": [0.3116, 0.5028, 0.3354, 0.5226]}, {"w": "external", "b": [0.3417, 0.5028, 0.4229, 0.5226]}, {"w": "source", "b": [0.4292, 0.5028, 0.4951, 0.5226]}, {"w": "of", "b": [0.5014, 0.5028, 0.5224, 0.5226]}, {"w": "data.", "b": [0.5287, 0.5028, 0.577, 0.5226]}, {"w": "Prediction", "b": [0.1799, 0.5233, 0.2854, 0.5431]}, {"w": "error", "b": [0.2917, 0.5233, 0.344, 0.5431]}, {"w": "or", "b": [0.3503, 0.5233, 0.3713, 0.5431]}, {"w": "loss", "b": [0.3776, 0.5233, 0.4169, 0.5431]}, {"w": "value—A", "b": [0.4232, 0.5233, 0.5213, 0.5431]}, {"w": "measure", "b": [0.5276, 0.5233, 0.6116, 0.5431]}, {"w": "of", "b": [0.6179, 0.5233, 0.6389, 0.5431]}, {"w": "the", "b": [0.6452, 0.5233, 0.6761, 0.5431]}, {"w": "distance", "b": [0.6824, 0.5233, 0.765, 0.5431]}, {"w": "between", "b": [0.7714, 0.5233, 0.8554, 0.5431]}, {"w": "your", "b": [0.1799, 0.5438, 0.2261, 0.5636]}, {"w": "model’s", "b": [0.2324, 0.5438, 0.3123, 0.5636]}, {"w": "prediction", "b": [0.3186, 0.5438, 0.4209, 0.5636]}, {"w": "and", "b": [0.4272, 0.5438, 0.4636, 0.5636]}, {"w": "the", "b": [0.4699, 0.5438, 0.5007, 0.5636]}, {"w": "target.", "b": [0.5071, 0.5438, 0.5703, 0.5636]}, {"w": "Classes—", "b": [0.1799, 0.5643, 0.2822, 0.5841]}, {"w": "A", "b": [0.2885, 0.5643, 0.3067, 0.5841]}, {"w": "set", "b": [0.313, 0.5643, 0.341, 0.5841]}, {"w": "of", "b": [0.3473, 0.5643, 0.3683, 0.5841]}, {"w": "possible", "b": [0.3746, 0.5643, 0.4573, 0.5841]}, {"w": "labels", "b": [0.4636, 0.5643, 0.5225, 0.5841]}, {"w": "to", "b": [0.5288, 0.5643, 0.5484, 0.5841]}, {"w": "choose", "b": [0.5547, 0.5643, 0.6248, 0.5841]}, {"w": "from", "b": [0.6311, 0.5643, 0.6801, 0.5841]}, {"w": "in", "b": [0.6864, 0.5643, 0.7061, 0.5841]}, {"w": "a", "b": [0.7124, 0.5643, 0.7236, 0.5841]}, {"w": "classification", "b": [0.7299, 0.5643, 0.863, 0.5841]}, {"w": "problem.", "b": [0.1799, 0.5848, 0.2702, 0.6046]}, {"w": "For", "b": [0.2765, 0.5848, 0.3116, 0.6046]}, {"w": "example,", "b": [0.3179, 0.5848, 0.4096, 0.6046]}, {"w": "when", "b": [0.416, 0.5848, 0.4706, 0.6046]}, {"w": "classifying", "b": [0.4769, 0.5848, 0.5862, 0.6046]}, {"w": "cat", "b": [0.5925, 0.5848, 0.6219, 0.6046]}, {"w": "and", "b": [0.6282, 0.5848, 0.6647, 0.6046]}, {"w": "dog", "b": [0.671, 0.5848, 0.7088, 0.6046]}, {"w": "pictures,", "b": [0.7151, 0.5848, 0.8013, 0.6046]}, {"w": "“dog”", "b": [0.8076, 0.5848, 0.8678, 0.6046]}, {"w": "and", "b": [0.1799, 0.6053, 0.2163, 0.6251]}, {"w": "“cat”", "b": [0.2226, 0.6053, 0.2744, 0.6251]}, {"w": "are", "b": [0.2807, 0.6053, 0.3115, 0.6251]}, {"w": "the", "b": [0.3178, 0.6053, 0.3486, 0.6251]}, {"w": "two", "b": [0.355, 0.6053, 0.3928, 0.6251]}, {"w": "classes.", "b": [0.3991, 0.6053, 0.4755, 0.6251]}, {"w": "Label—", "b": [0.1799, 0.6258, 0.2639, 0.6456]}, {"w": "A", "b": [0.2702, 0.6258, 0.2884, 0.6456]}, {"w": "specific", "b": [0.2947, 0.6258, 0.3732, 0.6456]}, {"w": "instance", "b": [0.3795, 0.6258, 0.4622, 0.6456]}, {"w": "of", "b": [0.4685, 0.6258, 0.4895, 0.6456]}, {"w": "a", "b": [0.4958, 0.6258, 0.507, 0.6456]}, {"w": "class", "b": [0.5133, 0.6258, 0.5623, 0.6456]}, {"w": "annotation", "b": [0.5686, 0.6258, 0.6751, 0.6456]}, {"w": "in", "b": [0.6815, 0.6258, 0.7011, 0.6456]}, {"w": "a", "b": [0.7074, 0.6258, 0.7186, 0.6456]}, {"w": "classification", "b": [0.7249, 0.6258, 0.858, 0.6456]}, {"w": "problem.", "b": [0.1799, 0.6463, 0.2702, 0.6661]}, {"w": "For", "b": [0.2765, 0.6463, 0.3116, 0.6661]}, {"w": "instance,", "b": [0.3179, 0.6463, 0.4068, 0.6661]}, {"w": "if", "b": [0.4132, 0.6463, 0.4286, 0.6661]}, {"w": "picture", "b": [0.4349, 0.6463, 0.5049, 0.6661]}, {"w": "#1234", "b": [0.5112, 0.6463, 0.5743, 0.6661]}, {"w": "is", "b": [0.5806, 0.6463, 0.5974, 0.6661]}, {"w": "annotated", "b": [0.6037, 0.6463, 0.7018, 0.6661]}, {"w": "as", "b": [0.7081, 0.6463, 0.7291, 0.6661]}, {"w": "containing", "b": [0.7354, 0.6463, 0.8419, 0.6661]}, {"w": "the", "b": [0.1799, 0.6668, 0.2107, 0.6866]}, {"w": "class", "b": [0.217, 0.6668, 0.266, 0.6866]}, {"w": "“dog,”", "b": [0.2723, 0.6668, 0.3389, 0.6866]}, {"w": "then", "b": [0.3452, 0.6668, 0.3886, 0.6866]}, {"w": "“dog”", "b": [0.3949, 0.6668, 0.4552, 0.6866]}, {"w": "is", "b": [0.4615, 0.6668, 0.4783, 0.6866]}, {"w": "a", "b": [0.4846, 0.6668, 0.4958, 0.6866]}, {"w": "label", "b": [0.5021, 0.6668, 0.5512, 0.6866]}, {"w": "of", "b": [0.5575, 0.6668, 0.5785, 0.6866]}, {"w": "picture", "b": [0.5848, 0.6668, 0.6548, 0.6866]}, {"w": "#1234.", "b": [0.6611, 0.6668, 0.7305, 0.6866]}, {"w": "Ground-truth", "b": [0.1799, 0.6873, 0.3149, 0.7071]}, {"w": "or", "b": [0.3212, 0.6873, 0.3422, 0.7071]}, {"w": "annotations—All", "b": [0.3485, 0.6873, 0.5251, 0.7071]}, {"w": "targets", "b": [0.5314, 0.6873, 0.5982, 0.7071]}, {"w": "for", "b": [0.6045, 0.6873, 0.6339, 0.7071]}, {"w": "a", "b": [0.6402, 0.6873, 0.6514, 0.7071]}, {"w": "dataset,", "b": [0.6577, 0.6873, 0.7341, 0.7071]}, {"w": "typically", "b": [0.7404, 0.6873, 0.8287, 0.7071]}, {"w": "collected", "b": [0.1799, 0.7078, 0.2709, 0.7276]}, {"w": "by", "b": [0.2772, 0.7078, 0.3025, 0.7276]}, {"w": "humans.", "b": [0.3088, 0.7078, 0.3936, 0.7276]}, {"w": "Binary", "b": [0.1799, 0.7283, 0.2514, 0.7481]}, {"w": "classification—", "b": [0.2577, 0.7283, 0.4202, 0.7481]}, {"w": "A", "b": [0.4265, 0.7283, 0.4447, 0.7481]}, {"w": "classification", "b": [0.451, 0.7283, 0.5842, 0.7481]}, {"w": "task", "b": [0.5905, 0.7283, 0.6311, 0.7481]}, {"w": "where", "b": [0.6374, 0.7283, 0.699, 0.7481]}, {"w": "each", "b": [0.7053, 0.7283, 0.7516, 0.7481]}, {"w": "input", "b": [0.7579, 0.7283, 0.8097, 0.7481]}, {"w": "sample", "b": [0.1799, 0.7488, 0.2513, 0.7686]}, {"w": "should", "b": [0.2576, 0.7488, 0.3249, 0.7686]}, {"w": "be", "b": [0.3312, 0.7488, 0.355, 0.7686]}, {"w": "categorized", "b": [0.3613, 0.7488, 0.4776, 0.7686]}, {"w": "into", "b": [0.4839, 0.7488, 0.5232, 0.7686]}, {"w": "two", "b": [0.5295, 0.7488, 0.5673, 0.7686]}, {"w": "exclusive", "b": [0.5736, 0.7488, 0.6689, 0.7686]}, {"w": "categories.", "b": [0.6752, 0.7488, 0.7838, 0.7686]}, {"w": "Multiclass", "b": [0.1799, 0.7693, 0.2878, 0.7891]}, {"w": "classification—", "b": [0.2941, 0.7693, 0.4567, 0.7891]}, {"w": "A", "b": [0.463, 0.7693, 0.4812, 0.7891]}, {"w": "classification", "b": [0.4875, 0.7693, 0.6206, 0.7891]}, {"w": "task", "b": [0.6269, 0.7693, 0.6675, 0.7891]}, {"w": "where", "b": [0.6739, 0.7693, 0.7355, 0.7891]}, {"w": "each", "b": [0.7418, 0.7693, 0.788, 0.7891]}, {"w": "input", "b": [0.7943, 0.7693, 0.8462, 0.7891]}, {"w": "sample", "b": [0.1799, 0.7898, 0.2513, 0.8096]}, {"w": "should", "b": [0.2576, 0.7898, 0.3249, 0.8096]}, {"w": "be", "b": [0.3312, 0.7898, 0.355, 0.8096]}, {"w": "categorized", "b": [0.3613, 0.7898, 0.4776, 0.8096]}, {"w": "into", "b": [0.4839, 0.7898, 0.5232, 0.8096]}, {"w": "more", "b": [0.5295, 0.7898, 0.5813, 0.8096]}, {"w": "than", "b": [0.5876, 0.7898, 0.6311, 0.8096]}, {"w": "two", "b": [0.6374, 0.7898, 0.6752, 0.8096]}, {"w": "categories:", "b": [0.6815, 0.7898, 0.7908, 0.8096]}, {"w": "for", "b": [0.7971, 0.7898, 0.8265, 0.8096]}, {"w": "instance,", "b": [0.1799, 0.8103, 0.2688, 0.8301]}, {"w": "classifying", "b": [0.2751, 0.8103, 0.3844, 0.8301]}, {"w": "handwritten", "b": [0.3907, 0.8103, 0.5112, 0.8301]}, {"w": "digits.", "b": [0.5175, 0.8103, 0.5799, 0.8301]}, {"w": "Multilabel", "b": [0.1799, 0.8308, 0.2878, 0.8506]}, {"w": "classification—", "b": [0.2941, 0.8308, 0.4567, 0.8506]}, {"w": "A", "b": [0.463, 0.8308, 0.4812, 0.8506]}, {"w": "classification", "b": [0.4875, 0.8308, 0.6206, 0.8506]}, {"w": "task", "b": [0.6269, 0.8308, 0.6675, 0.8506]}, {"w": "where", "b": [0.6739, 0.8308, 0.7355, 0.8506]}, {"w": "each", "b": [0.7418, 0.8308, 0.788, 0.8506]}, {"w": "input", "b": [0.7943, 0.8308, 0.8462, 0.8506]}, {"w": "sample", "b": [0.1799, 0.8513, 0.2513, 0.8711]}, {"w": "can", "b": [0.2576, 0.8513, 0.2926, 0.8711]}, {"w": "be", "b": [0.299, 0.8513, 0.3228, 0.8711]}, {"w": "assigned", "b": [0.3291, 0.8513, 0.416, 0.8711]}, {"w": "multiple", "b": [0.4223, 0.8513, 0.5064, 0.8711]}, {"w": "labels.", "b": [0.5127, 0.8513, 0.5778, 0.8711]}, {"w": "For", "b": [0.5841, 0.8513, 0.6192, 0.8711]}, {"w": "instance,", "b": [0.6255, 0.8513, 0.7144, 0.8711]}, {"w": "a", "b": [0.7208, 0.8513, 0.732, 0.8711]}, {"w": "given", "b": [0.7383, 0.8513, 0.7943, 0.8711]}, {"w": "image", "b": [0.8006, 0.8513, 0.8623, 0.8711]}, {"w": "may", "b": [0.1799, 0.8718, 0.2233, 0.8916]}, {"w": "contain", "b": [0.2296, 0.8718, 0.3039, 0.8916]}, {"w": "both", "b": [0.3102, 0.8718, 0.355, 0.8916]}, {"w": "a", "b": [0.3613, 0.8718, 0.3725, 0.8916]}, {"w": "cat", "b": [0.3788, 0.8718, 0.4082, 0.8916]}, {"w": "and", "b": [0.4145, 0.8718, 0.4509, 0.8916]}, {"w": "a", "b": [0.4573, 0.8718, 0.4685, 0.8916]}, {"w": "dog", "b": [0.4748, 0.8718, 0.5126, 0.8916]}, {"w": "and", "b": [0.5189, 0.8718, 0.5553, 0.8916]}, {"w": "should", "b": [0.5616, 0.8718, 0.6289, 0.8916]}, {"w": "be", "b": [0.6352, 0.8718, 0.659, 0.8916]}, {"w": "annotated", "b": [0.6653, 0.8718, 0.7634, 0.8916]}, {"w": "both", "b": [0.7697, 0.8718, 0.8146, 0.8916]}, {"w": "with", "b": [0.8209, 0.8718, 0.8657, 0.8916]}]}]}, {"page": 143, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the “cat” label and the “dog” label. The number of labels per image is usually variable. Scalar regression— A task where the target is a continuous scalar value. Predicting house prices is a good example: the different target prices form a continuous space. Vector regression— A task where the target is a set of continuous values: for example, a continuous vector. If you’re doing regression against multiple values (such as the coordinates of a bounding box in an image), then you’re doing vector regression. Mini-batch or batch—A small set of samples (typically between 8 and 128) that are processed simultaneously by the model. The number of samples is often a power of 2, to facilitate memory allocation on GPU. When training, a mini-batch is used to compute a single gradient-descent update applied to the weights of the model.", "words": [{"w": "the", "b": [0.1799, 0.0857, 0.2107, 0.1054]}, {"w": "“cat”", "b": [0.217, 0.0857, 0.2688, 0.1054]}, {"w": "label", "b": [0.2751, 0.0857, 0.3242, 0.1054]}, {"w": "and", "b": [0.3305, 0.0857, 0.3669, 0.1054]}, {"w": "the", "b": [0.3732, 0.0857, 0.404, 0.1054]}, {"w": "“dog”", "b": [0.4103, 0.0857, 0.4706, 0.1054]}, {"w": "label.", "b": [0.4769, 0.0857, 0.5322, 0.1054]}, {"w": "The", "b": [0.5385, 0.0857, 0.5777, 0.1054]}, {"w": "number", "b": [0.5841, 0.0857, 0.6611, 0.1054]}, {"w": "of", "b": [0.6674, 0.0857, 0.6884, 0.1054]}, {"w": "labels", "b": [0.6947, 0.0857, 0.7536, 0.1054]}, {"w": "per", "b": [0.7599, 0.0857, 0.7921, 0.1054]}, {"w": "image", "b": [0.7984, 0.0857, 0.8601, 0.1054]}, {"w": "is", "b": [0.1799, 0.1062, 0.1967, 0.1259]}, {"w": "usually", "b": [0.203, 0.1062, 0.2759, 0.1259]}, {"w": "variable.", "b": [0.2822, 0.1062, 0.3697, 0.1259]}, {"w": "Scalar", "b": [0.1799, 0.1267, 0.2471, 0.1464]}, {"w": "regression—", "b": [0.2534, 0.1267, 0.3866, 0.1464]}, {"w": "A", "b": [0.3929, 0.1267, 0.4111, 0.1464]}, {"w": "task", "b": [0.4174, 0.1267, 0.4581, 0.1464]}, {"w": "where", "b": [0.4644, 0.1267, 0.526, 0.1464]}, {"w": "the", "b": [0.5323, 0.1267, 0.5631, 0.1464]}, {"w": "target", "b": [0.5694, 0.1267, 0.6264, 0.1464]}, {"w": "is", "b": [0.6327, 0.1267, 0.6495, 0.1464]}, {"w": "a", "b": [0.6558, 0.1267, 0.667, 0.1464]}, {"w": "continuous", "b": [0.6733, 0.1267, 0.7841, 0.1464]}, {"w": "scalar", "b": [0.7904, 0.1267, 0.8492, 0.1464]}, {"w": "value.", "b": [0.1799, 0.1472, 0.2408, 0.1669]}, {"w": "Predicting", "b": [0.2471, 0.1472, 0.3508, 0.1669]}, {"w": "house", "b": [0.3571, 0.1472, 0.416, 0.1669]}, {"w": "prices", "b": [0.4223, 0.1472, 0.4825, 0.1669]}, {"w": "is", "b": [0.4888, 0.1472, 0.5057, 0.1669]}, {"w": "a", "b": [0.512, 0.1472, 0.5232, 0.1669]}, {"w": "good", "b": [0.5295, 0.1472, 0.5799, 0.1669]}, {"w": "example:", "b": [0.5862, 0.1472, 0.6787, 0.1669]}, {"w": "the", "b": [0.685, 0.1472, 0.7158, 0.1669]}, {"w": "different", "b": [0.7221, 0.1472, 0.8085, 0.1669]}, {"w": "target", "b": [0.1799, 0.1677, 0.2368, 0.1874]}, {"w": "prices", "b": [0.2431, 0.1677, 0.3034, 0.1874]}, {"w": "form", "b": [0.3097, 0.1677, 0.3587, 0.1874]}, {"w": "a", "b": [0.365, 0.1677, 0.3762, 0.1874]}, {"w": "continuous", "b": [0.3825, 0.1677, 0.4932, 0.1874]}, {"w": "space.", "b": [0.4995, 0.1677, 0.5619, 0.1874]}, {"w": "Vector", "b": [0.1799, 0.1882, 0.2457, 0.2079]}, {"w": "regression—", "b": [0.252, 0.1882, 0.3852, 0.2079]}, {"w": "A", "b": [0.3915, 0.1882, 0.4097, 0.2079]}, {"w": "task", "b": [0.416, 0.1882, 0.4566, 0.2079]}, {"w": "where", "b": [0.4629, 0.1882, 0.5246, 0.2079]}, {"w": "the", "b": [0.5309, 0.1882, 0.5617, 0.2079]}, {"w": "target", "b": [0.568, 0.1882, 0.625, 0.2079]}, {"w": "is", "b": [0.6313, 0.1882, 0.6481, 0.2079]}, {"w": "a", "b": [0.6544, 0.1882, 0.6656, 0.2079]}, {"w": "set", "b": [0.6719, 0.1882, 0.6999, 0.2079]}, {"w": "of", "b": [0.7063, 0.1882, 0.7273, 0.2079]}, {"w": "continuous", "b": [0.7336, 0.1882, 0.8443, 0.2079]}, {"w": "values:", "b": [0.1799, 0.2087, 0.2513, 0.2284]}, {"w": "for", "b": [0.2576, 0.2087, 0.287, 0.2284]}, {"w": "example,", "b": [0.2934, 0.2087, 0.3851, 0.2284]}, {"w": "a", "b": [0.3914, 0.2087, 0.4026, 0.2284]}, {"w": "continuous", "b": [0.4089, 0.2087, 0.5197, 0.2284]}, {"w": "vector.", "b": [0.526, 0.2087, 0.5939, 0.2284]}, {"w": "If", "b": [0.6002, 0.2087, 0.617, 0.2284]}, {"w": "you’re", "b": [0.6233, 0.2087, 0.6891, 0.2284]}, {"w": "doing", "b": [0.6954, 0.2087, 0.7529, 0.2284]}, {"w": "regression", "b": [0.7592, 0.2087, 0.8629, 0.2284]}, {"w": "against", "b": [0.1799, 0.2292, 0.2513, 0.2489]}, {"w": "multiple", "b": [0.2576, 0.2292, 0.3417, 0.2489]}, {"w": "values", "b": [0.348, 0.2292, 0.4125, 0.2489]}, {"w": "(such", "b": [0.4188, 0.2292, 0.4734, 0.2489]}, {"w": "as", "b": [0.4797, 0.2292, 0.5007, 0.2489]}, {"w": "the", "b": [0.507, 0.2292, 0.5379, 0.2489]}, {"w": "coordinates", "b": [0.5442, 0.2292, 0.6605, 0.2489]}, {"w": "of", "b": [0.6668, 0.2292, 0.6878, 0.2489]}, {"w": "a", "b": [0.6941, 0.2292, 0.7053, 0.2489]}, {"w": "bounding", "b": [0.7116, 0.2292, 0.8069, 0.2489]}, {"w": "box", "b": [0.8132, 0.2292, 0.851, 0.2489]}, {"w": "in", "b": [0.1799, 0.2497, 0.1995, 0.2694]}, {"w": "an", "b": [0.2058, 0.2497, 0.2296, 0.2694]}, {"w": "image),", "b": [0.2359, 0.2497, 0.3123, 0.2694]}, {"w": "then", "b": [0.3186, 0.2497, 0.362, 0.2694]}, {"w": "you’re", "b": [0.3683, 0.2497, 0.4342, 0.2694]}, {"w": "doing", "b": [0.4405, 0.2497, 0.4979, 0.2694]}, {"w": "vector", "b": [0.5042, 0.2497, 0.5673, 0.2694]}, {"w": "regression.", "b": [0.5736, 0.2497, 0.6836, 0.2694]}, {"w": "Mini-batch", "b": [0.1799, 0.2702, 0.292, 0.2899]}, {"w": "or", "b": [0.2982, 0.2702, 0.3193, 0.2899]}, {"w": "batch—A", "b": [0.3256, 0.2702, 0.425, 0.2899]}, {"w": "small", "b": [0.4313, 0.2702, 0.486, 0.2899]}, {"w": "set", "b": [0.4923, 0.2702, 0.5203, 0.2899]}, {"w": "of", "b": [0.5266, 0.2702, 0.5477, 0.2899]}, {"w": "samples", "b": [0.554, 0.2702, 0.6352, 0.2899]}, {"w": "(typically", "b": [0.6415, 0.2702, 0.7382, 0.2899]}, {"w": "between", "b": [0.7445, 0.2702, 0.8286, 0.2899]}, {"w": "8", "b": [0.8349, 0.2702, 0.8475, 0.2899]}, {"w": "and", "b": [0.1799, 0.2907, 0.2163, 0.3104]}, {"w": "128)", "b": [0.2226, 0.2907, 0.2688, 0.3104]}, {"w": "that", "b": [0.2751, 0.2907, 0.313, 0.3104]}, {"w": "are", "b": [0.3193, 0.2907, 0.3501, 0.3104]}, {"w": "processed", "b": [0.3564, 0.2907, 0.4559, 0.3104]}, {"w": "simultaneously", "b": [0.4622, 0.2907, 0.6149, 0.3104]}, {"w": "by", "b": [0.6212, 0.2907, 0.6465, 0.3104]}, {"w": "the", "b": [0.6528, 0.2907, 0.6836, 0.3104]}, {"w": "model.", "b": [0.6899, 0.2907, 0.7593, 0.3104]}, {"w": "The", "b": [0.7656, 0.2907, 0.8048, 0.3104]}, {"w": "number", "b": [0.1799, 0.3112, 0.2569, 0.3309]}, {"w": "of", "b": [0.2632, 0.3112, 0.2842, 0.3309]}, {"w": "samples", "b": [0.2906, 0.3112, 0.3718, 0.3309]}, {"w": "is", "b": [0.3781, 0.3112, 0.3949, 0.3309]}, {"w": "often", "b": [0.4013, 0.3112, 0.4531, 0.3309]}, {"w": "a", "b": [0.4594, 0.3112, 0.4706, 0.3309]}, {"w": "power", "b": [0.4769, 0.3112, 0.5399, 0.3309]}, {"w": "of", "b": [0.5463, 0.3112, 0.5673, 0.3309]}, {"w": "2,", "b": [0.5736, 0.3112, 0.5925, 0.3309]}, {"w": "to", "b": [0.5988, 0.3112, 0.6184, 0.3309]}, {"w": "facilitate", "b": [0.6247, 0.3112, 0.713, 0.3309]}, {"w": "memory", "b": [0.7193, 0.3112, 0.8034, 0.3309]}, {"w": "allocation", "b": [0.1799, 0.3317, 0.2794, 0.3514]}, {"w": "on", "b": [0.2857, 0.3317, 0.3109, 0.3514]}, {"w": "GPU.", "b": [0.3172, 0.3317, 0.374, 0.3514]}, {"w": "When", "b": [0.3803, 0.3317, 0.4405, 0.3514]}, {"w": "training,", "b": [0.4468, 0.3317, 0.5316, 0.3514]}, {"w": "a", "b": [0.5379, 0.3317, 0.5491, 0.3514]}, {"w": "mini-batch", "b": [0.5554, 0.3317, 0.6647, 0.3514]}, {"w": "is", "b": [0.671, 0.3317, 0.6878, 0.3514]}, {"w": "used", "b": [0.6941, 0.3317, 0.7404, 0.3514]}, {"w": "to", "b": [0.7467, 0.3317, 0.7663, 0.3514]}, {"w": "compute", "b": [0.7726, 0.3317, 0.8595, 0.3514]}, {"w": "a", "b": [0.1799, 0.3522, 0.1911, 0.3719]}, {"w": "single", "b": [0.1974, 0.3522, 0.2576, 0.3719]}, {"w": "gradient-descent", "b": [0.2639, 0.3522, 0.4307, 0.3719]}, {"w": "update", "b": [0.4369, 0.3522, 0.5042, 0.3719]}, {"w": "applied", "b": [0.5105, 0.3522, 0.5847, 0.3719]}, {"w": "to", "b": [0.591, 0.3522, 0.6107, 0.3719]}, {"w": "the", "b": [0.617, 0.3522, 0.6478, 0.3719]}, {"w": "weights", "b": [0.6541, 0.3522, 0.7326, 0.3719]}, {"w": "of", "b": [0.7389, 0.3522, 0.7599, 0.3719]}, {"w": "the", "b": [0.7662, 0.3522, 0.797, 0.3719]}, {"w": "model.", "b": [0.1799, 0.3727, 0.2492, 0.3924]}]}, {"id": "b_1", "type": "equation", "text": "4.2. Evaluating machine-learning models", "words": [{"w": "4.2.", "b": [0.1294, 0.4563, 0.172, 0.4785]}, {"w": "Evaluating", "b": [0.1791, 0.4563, 0.3115, 0.4785]}, {"w": "machine-learning", "b": [0.3186, 0.4563, 0.5315, 0.4785]}, {"w": "models", "b": [0.5386, 0.4563, 0.6237, 0.4785]}]}, {"id": "b_2", "type": "paragraph", "text": "In the three examples presented in chapter 3, we split the data into a training set, a validation set, and a test set. The reason not to evaluate the models on the same data they were trained on quickly became evident: after just a few epochs, all three models began to overfit. That is, their performance on never-before-seen data started stalling (or worsening) compared to their performance on the training data—which always improves as training progresses.", "words": [{"w": "In", "b": [0.1294, 0.5019, 0.1504, 0.5217]}, {"w": "the", "b": [0.1567, 0.5019, 0.1876, 0.5217]}, {"w": "three", "b": [0.1939, 0.5019, 0.2443, 0.5217]}, {"w": "examples", "b": [0.2506, 0.5019, 0.3459, 0.5217]}, {"w": "presented", "b": [0.3522, 0.5019, 0.4488, 0.5217]}, {"w": "in", "b": [0.4552, 0.5019, 0.4748, 0.5217]}, {"w": "chapter", "b": [0.481, 0.5019, 0.5553, 0.5217]}, {"w": "3,", "b": [0.5616, 0.5019, 0.5805, 0.5217]}, {"w": "we", "b": [0.5868, 0.5019, 0.6162, 0.5217]}, {"w": "split", "b": [0.6225, 0.5019, 0.666, 0.5217]}, {"w": "the", "b": [0.6723, 0.5019, 0.7031, 0.5217]}, {"w": "data", "b": [0.7094, 0.5019, 0.7514, 0.5217]}, {"w": "into", "b": [0.7577, 0.5019, 0.797, 0.5217]}, {"w": "a", "b": [0.8033, 0.5019, 0.8145, 0.5217]}, {"w": "training", "b": [0.1294, 0.5224, 0.2079, 0.5422]}, {"w": "set,", "b": [0.2142, 0.5224, 0.2485, 0.5422]}, {"w": "a", "b": [0.2548, 0.5224, 0.266, 0.5422]}, {"w": "validation", "b": [0.2723, 0.5224, 0.3732, 0.5422]}, {"w": "set,", "b": [0.3796, 0.5224, 0.4139, 0.5422]}, {"w": "and", "b": [0.4202, 0.5224, 0.4566, 0.5422]}, {"w": "a", "b": [0.4629, 0.5224, 0.4741, 0.5422]}, {"w": "test", "b": [0.4804, 0.5224, 0.5155, 0.5422]}, {"w": "set.", "b": [0.5218, 0.5224, 0.5561, 0.5422]}, {"w": "The", "b": [0.5624, 0.5224, 0.6016, 0.5422]}, {"w": "reason", "b": [0.6079, 0.5224, 0.6738, 0.5422]}, {"w": "not", "b": [0.6801, 0.5224, 0.7123, 0.5422]}, {"w": "to", "b": [0.7186, 0.5224, 0.7383, 0.5422]}, {"w": "evaluate", "b": [0.7446, 0.5224, 0.8286, 0.5422]}, {"w": "the", "b": [0.8349, 0.5224, 0.8658, 0.5422]}, {"w": "models", "b": [0.1294, 0.5429, 0.2023, 0.5627]}, {"w": "on", "b": [0.2086, 0.5429, 0.2338, 0.5627]}, {"w": "the", "b": [0.2401, 0.5429, 0.271, 0.5627]}, {"w": "same", "b": [0.2773, 0.5429, 0.3291, 0.5627]}, {"w": "data", "b": [0.3354, 0.5429, 0.3774, 0.5627]}, {"w": "they", "b": [0.3837, 0.5429, 0.4271, 0.5627]}, {"w": "were", "b": [0.4335, 0.5429, 0.4825, 0.5627]}, {"w": "trained", "b": [0.4888, 0.5429, 0.5588, 0.5627]}, {"w": "on", "b": [0.5651, 0.5429, 0.5904, 0.5627]}, {"w": "quickly", "b": [0.5967, 0.5429, 0.6723, 0.5627]}, {"w": "became", "b": [0.6786, 0.5429, 0.7557, 0.5627]}, {"w": "evident:", "b": [0.762, 0.5429, 0.8433, 0.5627]}, {"w": "after", "b": [0.1294, 0.5634, 0.1756, 0.5832]}, {"w": "just", "b": [0.1819, 0.5634, 0.2184, 0.5832]}, {"w": "a", "b": [0.2247, 0.5634, 0.2359, 0.5832]}, {"w": "few", "b": [0.2422, 0.5634, 0.28, 0.5832]}, {"w": "epochs,", "b": [0.2863, 0.5634, 0.3627, 0.5832]}, {"w": "all", "b": [0.369, 0.5634, 0.3942, 0.5832]}, {"w": "three", "b": [0.4005, 0.5634, 0.4509, 0.5832]}, {"w": "models", "b": [0.4572, 0.5634, 0.5301, 0.5832]}, {"w": "began", "b": [0.5364, 0.5634, 0.5967, 0.5832]}, {"w": "to", "b": [0.603, 0.5634, 0.6226, 0.5832]}, {"w": "overfit.", "b": [0.6288, 0.5634, 0.701, 0.5832]}, {"w": "That", "b": [0.7073, 0.5634, 0.7535, 0.5832]}, {"w": "is,", "b": [0.7598, 0.5634, 0.783, 0.5832]}, {"w": "their", "b": [0.7893, 0.5634, 0.8355, 0.5832]}, {"w": "performance", "b": [0.1294, 0.5839, 0.2569, 0.6037]}, {"w": "on", "b": [0.2632, 0.5839, 0.2884, 0.6037]}, {"w": "never-before-seen", "b": [0.2947, 0.5839, 0.4763, 0.6037]}, {"w": "data", "b": [0.4826, 0.5839, 0.5246, 0.6037]}, {"w": "started", "b": [0.5309, 0.5839, 0.5982, 0.6037]}, {"w": "stalling", "b": [0.6045, 0.5839, 0.6788, 0.6037]}, {"w": "(or", "b": [0.6851, 0.5839, 0.7145, 0.6037]}, {"w": "worsening)", "b": [0.7208, 0.5839, 0.8343, 0.6037]}, {"w": "compared", "b": [0.1294, 0.6044, 0.2289, 0.6242]}, {"w": "to", "b": [0.2352, 0.6044, 0.2548, 0.6242]}, {"w": "their", "b": [0.2611, 0.6044, 0.3074, 0.6242]}, {"w": "performance", "b": [0.3137, 0.6044, 0.4411, 0.6242]}, {"w": "on", "b": [0.4474, 0.6044, 0.4727, 0.6242]}, {"w": "the", "b": [0.479, 0.6044, 0.5098, 0.6242]}, {"w": "training", "b": [0.516, 0.6044, 0.5945, 0.6242]}, {"w": "data—which", "b": [0.6008, 0.6044, 0.7297, 0.6242]}, {"w": "always", "b": [0.736, 0.6044, 0.8061, 0.6242]}, {"w": "improves", "b": [0.1294, 0.6249, 0.2233, 0.6447]}, {"w": "as", "b": [0.2296, 0.6249, 0.2506, 0.6447]}, {"w": "training", "b": [0.2569, 0.6249, 0.3354, 0.6447]}, {"w": "progresses.", "b": [0.3417, 0.6249, 0.4545, 0.6447]}]}, {"id": "b_3", "type": "paragraph", "text": "In machine learning, the goal is to achieve models that generalize—that perform well on never-before-seen data—and overfitting is the central obstacle. You can only control that which you can observe, so it’s crucial to be able to reliably measure the generalization power of your model. The following sections look at strategies for mitigating overfitting and maximizing generalization. In this section, we’ll focus on how to measure generalization: how to evaluate machine-learning models.", "words": [{"w": "In", "b": [0.1294, 0.6677, 0.1504, 0.6874]}, {"w": "machine", "b": [0.1567, 0.6677, 0.2422, 0.6874]}, {"w": "learning,", "b": [0.2485, 0.6677, 0.3375, 0.6874]}, {"w": "the", "b": [0.3438, 0.6677, 0.3746, 0.6874]}, {"w": "goal", "b": [0.3809, 0.6677, 0.4244, 0.6874]}, {"w": "is", "b": [0.4307, 0.6677, 0.4475, 0.6874]}, {"w": "to", "b": [0.4538, 0.6677, 0.4734, 0.6874]}, {"w": "achieve", "b": [0.4797, 0.6677, 0.5568, 0.6874]}, {"w": "models", "b": [0.5631, 0.6677, 0.6359, 0.6874]}, {"w": "that", "b": [0.6423, 0.6677, 0.6801, 0.6874]}, {"w": "generalize—that", "b": [0.6863, 0.6677, 0.8544, 0.6874]}, {"w": "perform", "b": [0.1294, 0.6882, 0.2107, 0.7079]}, {"w": "well", "b": [0.217, 0.6882, 0.2604, 0.7079]}, {"w": "on", "b": [0.2667, 0.6882, 0.2919, 0.7079]}, {"w": "never-before-seen", "b": [0.2982, 0.6882, 0.4798, 0.7079]}, {"w": "data—and", "b": [0.4861, 0.6882, 0.5898, 0.7079]}, {"w": "overfitting", "b": [0.5961, 0.6882, 0.7026, 0.7079]}, {"w": "is", "b": [0.7089, 0.6882, 0.7257, 0.7079]}, {"w": "the", "b": [0.732, 0.6882, 0.7629, 0.7079]}, {"w": "central", "b": [0.7692, 0.6882, 0.8378, 0.7079]}, {"w": "obstacle.", "b": [0.1294, 0.7087, 0.2184, 0.7284]}, {"w": "You", "b": [0.2247, 0.7087, 0.2656, 0.7284]}, {"w": "can", "b": [0.2719, 0.7087, 0.3069, 0.7284]}, {"w": "only", "b": [0.3132, 0.7087, 0.3581, 0.7284]}, {"w": "control", "b": [0.3644, 0.7087, 0.4358, 0.7284]}, {"w": "that", "b": [0.4421, 0.7087, 0.48, 0.7284]}, {"w": "which", "b": [0.4863, 0.7087, 0.5479, 0.7284]}, {"w": "you", "b": [0.5543, 0.7087, 0.5921, 0.7284]}, {"w": "can", "b": [0.5984, 0.7087, 0.6334, 0.7284]}, {"w": "observe,", "b": [0.6397, 0.7087, 0.7244, 0.7284]}, {"w": "so", "b": [0.7307, 0.7087, 0.7532, 0.7284]}, {"w": "it’s", "b": [0.7595, 0.7087, 0.7903, 0.7284]}, {"w": "crucial", "b": [0.7966, 0.7087, 0.8652, 0.7284]}, {"w": "to", "b": [0.1294, 0.7292, 0.149, 0.7489]}, {"w": "be", "b": [0.1553, 0.7292, 0.1792, 0.7489]}, {"w": "able", "b": [0.1855, 0.7292, 0.2275, 0.7489]}, {"w": "to", "b": [0.2338, 0.7292, 0.2534, 0.7489]}, {"w": "reliably", "b": [0.2597, 0.7292, 0.3368, 0.7489]}, {"w": "measure", "b": [0.3431, 0.7292, 0.4272, 0.7489]}, {"w": "the", "b": [0.4335, 0.7292, 0.4643, 0.7489]}, {"w": "generalization", "b": [0.4706, 0.7292, 0.6135, 0.7489]}, {"w": "power", "b": [0.6198, 0.7292, 0.6828, 0.7489]}, {"w": "of", "b": [0.6891, 0.7292, 0.7102, 0.7489]}, {"w": "your", "b": [0.7165, 0.7292, 0.7627, 0.7489]}, {"w": "model.", "b": [0.769, 0.7292, 0.8384, 0.7489]}, {"w": "The", "b": [0.1294, 0.7497, 0.1686, 0.7694]}, {"w": "following", "b": [0.1749, 0.7497, 0.273, 0.7694]}, {"w": "sections", "b": [0.2794, 0.7497, 0.3606, 0.7694]}, {"w": "look", "b": [0.3669, 0.7497, 0.4118, 0.7694]}, {"w": "at", "b": [0.4181, 0.7497, 0.4363, 0.7694]}, {"w": "strategies", "b": [0.4426, 0.7497, 0.5379, 0.7694]}, {"w": "for", "b": [0.5442, 0.7497, 0.5736, 0.7694]}, {"w": "mitigating", "b": [0.5799, 0.7497, 0.6836, 0.7694]}, {"w": "overfitting", "b": [0.6899, 0.7497, 0.7964, 0.7694]}, {"w": "and", "b": [0.8027, 0.7497, 0.8392, 0.7694]}, {"w": "maximizing", "b": [0.1294, 0.7702, 0.2499, 0.7899]}, {"w": "generalization.", "b": [0.2562, 0.7702, 0.4055, 0.7899]}, {"w": "In", "b": [0.4118, 0.7702, 0.4328, 0.7899]}, {"w": "this", "b": [0.4391, 0.7702, 0.4755, 0.7899]}, {"w": "section,", "b": [0.4818, 0.7702, 0.5596, 0.7899]}, {"w": "we’ll", "b": [0.5659, 0.7702, 0.6178, 0.7899]}, {"w": "focus", "b": [0.6241, 0.7702, 0.6787, 0.7899]}, {"w": "on", "b": [0.685, 0.7702, 0.7102, 0.7899]}, {"w": "how", "b": [0.7165, 0.7702, 0.76, 0.7899]}, {"w": "to", "b": [0.7663, 0.7702, 0.7859, 0.7899]}, {"w": "measure", "b": [0.1294, 0.7907, 0.2135, 0.8104]}, {"w": "generalization:", "b": [0.2198, 0.7907, 0.3697, 0.8104]}, {"w": "how", "b": [0.376, 0.7907, 0.4194, 0.8104]}, {"w": "to", "b": [0.4257, 0.7907, 0.4453, 0.8104]}, {"w": "evaluate", "b": [0.4517, 0.7907, 0.5357, 0.8104]}, {"w": "machine-learning", "b": [0.542, 0.7907, 0.7185, 0.8104]}, {"w": "models.", "b": [0.7248, 0.7907, 0.804, 0.8104]}]}, {"id": "b_4", "type": "paragraph", "text": "4.2.1. Training, validation, and test sets", "words": [{"w": "4.2.1.", "b": [0.1294, 0.8379, 0.1862, 0.8577]}, {"w": "Training,", "b": [0.1925, 0.8379, 0.2922, 0.8577]}, {"w": "validation,", "b": [0.2985, 0.8379, 0.4128, 0.8577]}, {"w": "and", "b": [0.4191, 0.8379, 0.4598, 0.8577]}, {"w": "test", "b": [0.4661, 0.8379, 0.5039, 0.8577]}, {"w": "sets", "b": [0.5102, 0.8379, 0.5494, 0.8577]}]}]}, {"page": 144, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Evaluating a model always boils down to splitting the available data into three sets: training, validation, and test. You train on the training data and evaluate your model on the validation data. Once your model is ready for prime time, you test it one final time on the test data.", "words": [{"w": "Evaluating", "b": [0.1294, 0.0857, 0.2387, 0.1054]}, {"w": "a", "b": [0.245, 0.0857, 0.2562, 0.1054]}, {"w": "model", "b": [0.2625, 0.0857, 0.3256, 0.1054]}, {"w": "always", "b": [0.3319, 0.0857, 0.402, 0.1054]}, {"w": "boils", "b": [0.4083, 0.0857, 0.4573, 0.1054]}, {"w": "down", "b": [0.4636, 0.0857, 0.5197, 0.1054]}, {"w": "to", "b": [0.526, 0.0857, 0.5456, 0.1054]}, {"w": "splitting", "b": [0.5519, 0.0857, 0.6346, 0.1054]}, {"w": "the", "b": [0.6409, 0.0857, 0.6718, 0.1054]}, {"w": "available", "b": [0.6781, 0.0857, 0.7691, 0.1054]}, {"w": "data", "b": [0.7754, 0.0857, 0.8175, 0.1054]}, {"w": "into", "b": [0.8238, 0.0857, 0.863, 0.1054]}, {"w": "three", "b": [0.1294, 0.1062, 0.1798, 0.1259]}, {"w": "sets:", "b": [0.1861, 0.1062, 0.231, 0.1259]}, {"w": "training,", "b": [0.2373, 0.1062, 0.3221, 0.1259]}, {"w": "validation,", "b": [0.3284, 0.1062, 0.4356, 0.1259]}, {"w": "and", "b": [0.4419, 0.1062, 0.4783, 0.1259]}, {"w": "test.", "b": [0.4846, 0.1062, 0.526, 0.1259]}, {"w": "You", "b": [0.5323, 0.1062, 0.5731, 0.1259]}, {"w": "train", "b": [0.5794, 0.1062, 0.6257, 0.1259]}, {"w": "on", "b": [0.632, 0.1062, 0.6572, 0.1259]}, {"w": "the", "b": [0.6635, 0.1062, 0.6943, 0.1259]}, {"w": "training", "b": [0.7006, 0.1062, 0.7791, 0.1259]}, {"w": "data", "b": [0.7854, 0.1062, 0.8275, 0.1259]}, {"w": "and", "b": [0.8338, 0.1062, 0.8702, 0.1259]}, {"w": "evaluate", "b": [0.1294, 0.1267, 0.2135, 0.1464]}, {"w": "your", "b": [0.2198, 0.1267, 0.266, 0.1464]}, {"w": "model", "b": [0.2723, 0.1267, 0.3354, 0.1464]}, {"w": "on", "b": [0.3417, 0.1267, 0.3669, 0.1464]}, {"w": "the", "b": [0.3732, 0.1267, 0.404, 0.1464]}, {"w": "validation", "b": [0.4104, 0.1267, 0.5113, 0.1464]}, {"w": "data.", "b": [0.5176, 0.1267, 0.5659, 0.1464]}, {"w": "Once", "b": [0.5722, 0.1267, 0.6254, 0.1464]}, {"w": "your", "b": [0.6317, 0.1267, 0.678, 0.1464]}, {"w": "model", "b": [0.6843, 0.1267, 0.7473, 0.1464]}, {"w": "is", "b": [0.7536, 0.1267, 0.7705, 0.1464]}, {"w": "ready", "b": [0.7768, 0.1267, 0.8328, 0.1464]}, {"w": "for", "b": [0.8391, 0.1267, 0.8685, 0.1464]}, {"w": "prime", "b": [0.1294, 0.1472, 0.1883, 0.1669]}, {"w": "time,", "b": [0.1946, 0.1472, 0.2457, 0.1669]}, {"w": "you", "b": [0.252, 0.1472, 0.2899, 0.1669]}, {"w": "test", "b": [0.2962, 0.1472, 0.3312, 0.1669]}, {"w": "it", "b": [0.3375, 0.1472, 0.3515, 0.1669]}, {"w": "one", "b": [0.3578, 0.1472, 0.3942, 0.1669]}, {"w": "final", "b": [0.4005, 0.1472, 0.4468, 0.1669]}, {"w": "time", "b": [0.4531, 0.1472, 0.4979, 0.1669]}, {"w": "on", "b": [0.5043, 0.1472, 0.5295, 0.1669]}, {"w": "the", "b": [0.5358, 0.1472, 0.5666, 0.1669]}, {"w": "test", "b": [0.5729, 0.1472, 0.608, 0.1669]}, {"w": "data.", "b": [0.6143, 0.1472, 0.6626, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "You may ask, why not have two sets: a training set and a test set? You’d train on the training data and evaluate on the test data. Much simpler!", "words": [{"w": "You", "b": [0.1294, 0.19, 0.1703, 0.2097]}, {"w": "may", "b": [0.1766, 0.19, 0.2201, 0.2097]}, {"w": "ask,", "b": [0.2264, 0.19, 0.2663, 0.2097]}, {"w": "why", "b": [0.2726, 0.19, 0.3161, 0.2097]}, {"w": "not", "b": [0.3224, 0.19, 0.3546, 0.2097]}, {"w": "have", "b": [0.3609, 0.19, 0.4085, 0.2097]}, {"w": "two", "b": [0.4148, 0.19, 0.4527, 0.2097]}, {"w": "sets:", "b": [0.459, 0.19, 0.5038, 0.2097]}, {"w": "a", "b": [0.5101, 0.19, 0.5213, 0.2097]}, {"w": "training", "b": [0.5277, 0.19, 0.6061, 0.2097]}, {"w": "set", "b": [0.6124, 0.19, 0.6405, 0.2097]}, {"w": "and", "b": [0.6468, 0.19, 0.6832, 0.2097]}, {"w": "a", "b": [0.6895, 0.19, 0.7007, 0.2097]}, {"w": "test", "b": [0.707, 0.19, 0.742, 0.2097]}, {"w": "set?", "b": [0.7484, 0.19, 0.7876, 0.2097]}, {"w": "You’d", "b": [0.7939, 0.19, 0.8557, 0.2097]}, {"w": "train", "b": [0.1294, 0.2105, 0.1757, 0.2302]}, {"w": "on", "b": [0.182, 0.2105, 0.2072, 0.2302]}, {"w": "the", "b": [0.2135, 0.2105, 0.2443, 0.2302]}, {"w": "training", "b": [0.2506, 0.2105, 0.3291, 0.2302]}, {"w": "data", "b": [0.3354, 0.2105, 0.3774, 0.2302]}, {"w": "and", "b": [0.3837, 0.2105, 0.4202, 0.2302]}, {"w": "evaluate", "b": [0.4265, 0.2105, 0.5105, 0.2302]}, {"w": "on", "b": [0.5168, 0.2105, 0.5421, 0.2302]}, {"w": "the", "b": [0.5484, 0.2105, 0.5792, 0.2302]}, {"w": "test", "b": [0.5855, 0.2105, 0.6205, 0.2302]}, {"w": "data.", "b": [0.6267, 0.2105, 0.6751, 0.2302]}, {"w": "Much", "b": [0.6814, 0.2105, 0.7402, 0.2302]}, {"w": "simpler!", "b": [0.7465, 0.2105, 0.8306, 0.2302]}]}, {"id": "b_2", "type": "paragraph", "text": "The reason is that developing a model always involves tuning its configuration: for example, choosing the number of layers or the size of the layers (called the hyper-parameters of the model, to distinguish them from the parameters, which are the network’s weights). You do this tuning by using as a feedback signal the performance of the model on the validation data. In essence, this tuning is a form of learning: a search for a good configuration in some parameter space. As a result, tuning the configuration of the model based on its performance on the validation set can quickly result in overfitting to the validation set, even though your model is never directly trained on it.", "words": [{"w": "The", "b": [0.1294, 0.2532, 0.1686, 0.273]}, {"w": "reason", "b": [0.1749, 0.2532, 0.2408, 0.273]}, {"w": "is", "b": [0.2471, 0.2532, 0.2639, 0.273]}, {"w": "that", "b": [0.2702, 0.2532, 0.3081, 0.273]}, {"w": "developing", "b": [0.3144, 0.2532, 0.4265, 0.273]}, {"w": "a", "b": [0.4328, 0.2532, 0.444, 0.273]}, {"w": "model", "b": [0.4503, 0.2532, 0.5133, 0.273]}, {"w": "always", "b": [0.5197, 0.2532, 0.5897, 0.273]}, {"w": "involves", "b": [0.596, 0.2532, 0.6815, 0.273]}, {"w": "tuning", "b": [0.6878, 0.2532, 0.7523, 0.273]}, {"w": "its", "b": [0.7586, 0.2532, 0.7824, 0.273]}, {"w": "configuration:", "b": [0.1294, 0.2737, 0.2723, 0.2935]}, {"w": "for", "b": [0.2786, 0.2737, 0.3081, 0.2935]}, {"w": "example,", "b": [0.3144, 0.2737, 0.4061, 0.2935]}, {"w": "choosing", "b": [0.4124, 0.2737, 0.5035, 0.2935]}, {"w": "the", "b": [0.5098, 0.2737, 0.5407, 0.2935]}, {"w": "number", "b": [0.547, 0.2737, 0.624, 0.2935]}, {"w": "of", "b": [0.6303, 0.2737, 0.6514, 0.2935]}, {"w": "layers", "b": [0.6577, 0.2737, 0.7179, 0.2935]}, {"w": "or", "b": [0.7241, 0.2737, 0.7451, 0.2935]}, {"w": "the", "b": [0.7514, 0.2737, 0.7823, 0.2935]}, {"w": "size", "b": [0.7886, 0.2737, 0.8278, 0.2935]}, {"w": "of", "b": [0.8341, 0.2737, 0.8551, 0.2935]}, {"w": "the", "b": [0.1294, 0.2942, 0.1602, 0.314]}, {"w": "layers", "b": [0.1665, 0.2942, 0.2268, 0.314]}, {"w": "(called", "b": [0.2331, 0.2942, 0.3017, 0.314]}, {"w": "the", "b": [0.308, 0.2942, 0.3389, 0.314]}, {"w": "hyper-parameters", "b": [0.3451, 0.2942, 0.5253, 0.314]}, {"w": "of", "b": [0.5316, 0.2942, 0.5527, 0.314]}, {"w": "the", "b": [0.559, 0.2942, 0.5898, 0.314]}, {"w": "model,", "b": [0.5961, 0.2942, 0.6655, 0.314]}, {"w": "to", "b": [0.6718, 0.2942, 0.6914, 0.314]}, {"w": "distinguish", "b": [0.6977, 0.2942, 0.8084, 0.314]}, {"w": "them", "b": [0.8148, 0.2942, 0.8652, 0.314]}, {"w": "from", "b": [0.1294, 0.3147, 0.1785, 0.3345]}, {"w": "the", "b": [0.1848, 0.3147, 0.2156, 0.3345]}, {"w": "parameters,", "b": [0.2219, 0.3147, 0.3431, 0.3345]}, {"w": "which", "b": [0.3494, 0.3147, 0.411, 0.3345]}, {"w": "are", "b": [0.4173, 0.3147, 0.4481, 0.3345]}, {"w": "the", "b": [0.4544, 0.3147, 0.4853, 0.3345]}, {"w": "network’s", "b": [0.4916, 0.3147, 0.591, 0.3345]}, {"w": "weights).", "b": [0.5973, 0.3147, 0.6905, 0.3345]}, {"w": "You", "b": [0.6968, 0.3147, 0.7377, 0.3345]}, {"w": "do", "b": [0.7441, 0.3147, 0.7693, 0.3345]}, {"w": "this", "b": [0.7756, 0.3147, 0.812, 0.3345]}, {"w": "tuning", "b": [0.1294, 0.3352, 0.1939, 0.355]}, {"w": "by", "b": [0.2002, 0.3352, 0.2254, 0.355]}, {"w": "using", "b": [0.2317, 0.3352, 0.2864, 0.355]}, {"w": "as", "b": [0.2927, 0.3352, 0.3137, 0.355]}, {"w": "a", "b": [0.32, 0.3352, 0.3312, 0.355]}, {"w": "feedback", "b": [0.3375, 0.3352, 0.4286, 0.355]}, {"w": "signal", "b": [0.4349, 0.3352, 0.4951, 0.355]}, {"w": "the", "b": [0.5014, 0.3352, 0.5323, 0.355]}, {"w": "performance", "b": [0.5386, 0.3352, 0.666, 0.355]}, {"w": "of", "b": [0.6723, 0.3352, 0.6934, 0.355]}, {"w": "the", "b": [0.6997, 0.3352, 0.7305, 0.355]}, {"w": "model", "b": [0.7368, 0.3352, 0.7999, 0.355]}, {"w": "on", "b": [0.8062, 0.3352, 0.8314, 0.355]}, {"w": "the", "b": [0.8377, 0.3352, 0.8685, 0.355]}, {"w": "validation", "b": [0.1294, 0.3557, 0.2303, 0.3755]}, {"w": "data.", "b": [0.2366, 0.3557, 0.2849, 0.3755]}, {"w": "In", "b": [0.2912, 0.3557, 0.3122, 0.3755]}, {"w": "essence,", "b": [0.3185, 0.3557, 0.4019, 0.3755]}, {"w": "this", "b": [0.4082, 0.3557, 0.4446, 0.3755]}, {"w": "tuning", "b": [0.451, 0.3557, 0.5154, 0.3755]}, {"w": "is", "b": [0.5217, 0.3557, 0.5386, 0.3755]}, {"w": "a", "b": [0.5449, 0.3557, 0.5561, 0.3755]}, {"w": "form", "b": [0.5624, 0.3557, 0.6114, 0.3755]}, {"w": "of", "b": [0.6177, 0.3557, 0.6387, 0.3755]}, {"w": "learning:", "b": [0.645, 0.3557, 0.7375, 0.3755]}, {"w": "a", "b": [0.7438, 0.3557, 0.755, 0.3755]}, {"w": "search", "b": [0.7613, 0.3557, 0.8257, 0.3755]}, {"w": "for", "b": [0.832, 0.3557, 0.8614, 0.3755]}, {"w": "a", "b": [0.1294, 0.3762, 0.1406, 0.396]}, {"w": "good", "b": [0.1469, 0.3762, 0.1974, 0.396]}, {"w": "configuration", "b": [0.2037, 0.3762, 0.3396, 0.396]}, {"w": "in", "b": [0.3459, 0.3762, 0.3655, 0.396]}, {"w": "some", "b": [0.3718, 0.3762, 0.4251, 0.396]}, {"w": "parameter", "b": [0.4314, 0.3762, 0.5322, 0.396]}, {"w": "space.", "b": [0.5385, 0.3762, 0.6009, 0.396]}, {"w": "As", "b": [0.6072, 0.3762, 0.6352, 0.396]}, {"w": "a", "b": [0.6415, 0.3762, 0.6527, 0.396]}, {"w": "result,", "b": [0.659, 0.3762, 0.7214, 0.396]}, {"w": "tuning", "b": [0.7277, 0.3762, 0.7922, 0.396]}, {"w": "the", "b": [0.7985, 0.3762, 0.8293, 0.396]}, {"w": "configuration", "b": [0.1294, 0.3967, 0.2653, 0.4165]}, {"w": "of", "b": [0.2716, 0.3967, 0.2926, 0.4165]}, {"w": "the", "b": [0.299, 0.3967, 0.3298, 0.4165]}, {"w": "model", "b": [0.3361, 0.3967, 0.3992, 0.4165]}, {"w": "based", "b": [0.4055, 0.3967, 0.4629, 0.4165]}, {"w": "on", "b": [0.4692, 0.3967, 0.4944, 0.4165]}, {"w": "its", "b": [0.5007, 0.3967, 0.5246, 0.4165]}, {"w": "performance", "b": [0.5308, 0.3967, 0.6583, 0.4165]}, {"w": "on", "b": [0.6646, 0.3967, 0.6898, 0.4165]}, {"w": "the", "b": [0.6961, 0.3967, 0.7269, 0.4165]}, {"w": "validation", "b": [0.7333, 0.3967, 0.8342, 0.4165]}, {"w": "set", "b": [0.8405, 0.3967, 0.8685, 0.4165]}, {"w": "can", "b": [0.1294, 0.4172, 0.1644, 0.437]}, {"w": "quickly", "b": [0.1707, 0.4172, 0.2464, 0.437]}, {"w": "result", "b": [0.2527, 0.4172, 0.3088, 0.437]}, {"w": "in", "b": [0.3151, 0.4172, 0.3347, 0.437]}, {"w": "overfitting", "b": [0.341, 0.4172, 0.4461, 0.437]}, {"w": "to", "b": [0.4524, 0.4172, 0.472, 0.437]}, {"w": "the", "b": [0.4783, 0.4172, 0.5092, 0.437]}, {"w": "validation", "b": [0.5155, 0.4172, 0.6178, 0.437]}, {"w": "set,", "b": [0.6241, 0.4172, 0.6583, 0.437]}, {"w": "even", "b": [0.6647, 0.4172, 0.7123, 0.437]}, {"w": "though", "b": [0.7186, 0.4172, 0.7887, 0.437]}, {"w": "your", "b": [0.795, 0.4172, 0.8412, 0.437]}, {"w": "model", "b": [0.1294, 0.4377, 0.1925, 0.4575]}, {"w": "is", "b": [0.1988, 0.4377, 0.2156, 0.4575]}, {"w": "never", "b": [0.2219, 0.4377, 0.2779, 0.4575]}, {"w": "directly", "b": [0.2842, 0.4377, 0.3613, 0.4575]}, {"w": "trained", "b": [0.3676, 0.4377, 0.4377, 0.4575]}, {"w": "on", "b": [0.444, 0.4377, 0.4692, 0.4575]}, {"w": "it.", "b": [0.4755, 0.4377, 0.4958, 0.4575]}]}, {"id": "b_3", "type": "paragraph", "text": "Central to this phenomenon is the notion of information leaks. Every time you tune a hyperparameter of your model based on the model’s performance on the validation set, some information about the validation data leaks into the model. If you do this only once, for one parameter, then very few bits of information will leak, and your validation set will remain reliable to evaluate the model. But if you repeat this many times —running one experiment, evaluating on the validation set, and modifying your model as a result—then you’ll leak an increasingly significant amount of information about the validation set into the model.", "words": [{"w": "Central", "b": [0.1294, 0.4805, 0.2037, 0.5003]}, {"w": "to", "b": [0.21, 0.4805, 0.2296, 0.5003]}, {"w": "this", "b": [0.2359, 0.4805, 0.2724, 0.5003]}, {"w": "phenomenon", "b": [0.2787, 0.4805, 0.409, 0.5003]}, {"w": "is", "b": [0.4153, 0.4805, 0.4321, 0.5003]}, {"w": "the", "b": [0.4384, 0.4805, 0.4693, 0.5003]}, {"w": "notion", "b": [0.4756, 0.4805, 0.54, 0.5003]}, {"w": "of", "b": [0.5463, 0.4805, 0.5674, 0.5003]}, {"w": "information", "b": [0.5736, 0.4805, 0.6927, 0.5003]}, {"w": "leaks.", "b": [0.699, 0.4805, 0.7572, 0.5003]}, {"w": "Every", "b": [0.7635, 0.4805, 0.8237, 0.5003]}, {"w": "time", "b": [0.1294, 0.501, 0.1743, 0.5208]}, {"w": "you", "b": [0.1806, 0.501, 0.2184, 0.5208]}, {"w": "tune", "b": [0.2247, 0.501, 0.2682, 0.5208]}, {"w": "a", "b": [0.2745, 0.501, 0.2857, 0.5208]}, {"w": "hyperparameter", "b": [0.292, 0.501, 0.4503, 0.5208]}, {"w": "of", "b": [0.4566, 0.501, 0.4776, 0.5208]}, {"w": "your", "b": [0.4839, 0.501, 0.5301, 0.5208]}, {"w": "model", "b": [0.5364, 0.501, 0.5995, 0.5208]}, {"w": "based", "b": [0.6058, 0.501, 0.6632, 0.5208]}, {"w": "on", "b": [0.6695, 0.501, 0.6948, 0.5208]}, {"w": "the", "b": [0.7011, 0.501, 0.7319, 0.5208]}, {"w": "model’s", "b": [0.7382, 0.501, 0.818, 0.5208]}, {"w": "performance", "b": [0.1294, 0.5215, 0.2569, 0.5413]}, {"w": "on", "b": [0.2632, 0.5215, 0.2884, 0.5413]}, {"w": "the", "b": [0.2947, 0.5215, 0.3255, 0.5413]}, {"w": "validation", "b": [0.3318, 0.5215, 0.4328, 0.5413]}, {"w": "set,", "b": [0.4391, 0.5215, 0.4734, 0.5413]}, {"w": "some", "b": [0.4797, 0.5215, 0.5329, 0.5413]}, {"w": "information", "b": [0.5393, 0.5215, 0.6584, 0.5413]}, {"w": "about", "b": [0.6646, 0.5215, 0.7206, 0.5413]}, {"w": "the", "b": [0.727, 0.5215, 0.7578, 0.5413]}, {"w": "validation", "b": [0.7641, 0.5215, 0.865, 0.5413]}, {"w": "data", "b": [0.1294, 0.542, 0.1714, 0.5618]}, {"w": "leaks", "b": [0.1777, 0.542, 0.2296, 0.5618]}, {"w": "into", "b": [0.2359, 0.542, 0.2751, 0.5618]}, {"w": "the", "b": [0.2814, 0.542, 0.3123, 0.5618]}, {"w": "model.", "b": [0.3186, 0.542, 0.388, 0.5618]}, {"w": "If", "b": [0.3943, 0.542, 0.4111, 0.5618]}, {"w": "you", "b": [0.4174, 0.542, 0.4552, 0.5618]}, {"w": "do", "b": [0.4615, 0.542, 0.4867, 0.5618]}, {"w": "this", "b": [0.493, 0.542, 0.5295, 0.5618]}, {"w": "only", "b": [0.5358, 0.542, 0.5807, 0.5618]}, {"w": "once,", "b": [0.587, 0.542, 0.6409, 0.5618]}, {"w": "for", "b": [0.6472, 0.542, 0.6766, 0.5618]}, {"w": "one", "b": [0.6829, 0.542, 0.7193, 0.5618]}, {"w": "parameter,", "b": [0.7256, 0.542, 0.8317, 0.5618]}, {"w": "then", "b": [0.1294, 0.5625, 0.1729, 0.5823]}, {"w": "very", "b": [0.1792, 0.5625, 0.224, 0.5823]}, {"w": "few", "b": [0.2303, 0.5625, 0.2681, 0.5823]}, {"w": "bits", "b": [0.2744, 0.5625, 0.3109, 0.5823]}, {"w": "of", "b": [0.3172, 0.5625, 0.3382, 0.5823]}, {"w": "information", "b": [0.3445, 0.5625, 0.4636, 0.5823]}, {"w": "will", "b": [0.4699, 0.5625, 0.5091, 0.5823]}, {"w": "leak,", "b": [0.5154, 0.5625, 0.5638, 0.5823]}, {"w": "and", "b": [0.5701, 0.5625, 0.6065, 0.5823]}, {"w": "your", "b": [0.6128, 0.5625, 0.659, 0.5823]}, {"w": "validation", "b": [0.6653, 0.5625, 0.7662, 0.5823]}, {"w": "set", "b": [0.7725, 0.5625, 0.8006, 0.5823]}, {"w": "will", "b": [0.8069, 0.5625, 0.8461, 0.5823]}, {"w": "remain", "b": [0.1294, 0.583, 0.1995, 0.6028]}, {"w": "reliable", "b": [0.2058, 0.583, 0.2814, 0.6028]}, {"w": "to", "b": [0.2877, 0.583, 0.3074, 0.6028]}, {"w": "evaluate", "b": [0.3137, 0.583, 0.3977, 0.6028]}, {"w": "the", "b": [0.404, 0.583, 0.4348, 0.6028]}, {"w": "model.", "b": [0.4412, 0.583, 0.5105, 0.6028]}, {"w": "But", "b": [0.5168, 0.583, 0.5533, 0.6028]}, {"w": "if", "b": [0.5596, 0.583, 0.575, 0.6028]}, {"w": "you", "b": [0.5813, 0.583, 0.6191, 0.6028]}, {"w": "repeat", "b": [0.6255, 0.583, 0.6871, 0.6028]}, {"w": "this", "b": [0.6934, 0.583, 0.7298, 0.6028]}, {"w": "many", "b": [0.7361, 0.583, 0.7922, 0.6028]}, {"w": "times", "b": [0.7985, 0.583, 0.8532, 0.6028]}, {"w": "—running", "b": [0.1294, 0.6035, 0.2331, 0.6233]}, {"w": "one", "b": [0.2394, 0.6035, 0.2758, 0.6233]}, {"w": "experiment,", "b": [0.2821, 0.6035, 0.4019, 0.6233]}, {"w": "evaluating", "b": [0.4082, 0.6035, 0.5133, 0.6233]}, {"w": "on", "b": [0.5196, 0.6035, 0.5449, 0.6233]}, {"w": "the", "b": [0.5512, 0.6035, 0.582, 0.6233]}, {"w": "validation", "b": [0.5883, 0.6035, 0.6892, 0.6233]}, {"w": "set,", "b": [0.6955, 0.6035, 0.7299, 0.6233]}, {"w": "and", "b": [0.7362, 0.6035, 0.7726, 0.6233]}, {"w": "modifying", "b": [0.1294, 0.624, 0.2345, 0.6438]}, {"w": "your", "b": [0.2408, 0.624, 0.2871, 0.6438]}, {"w": "model", "b": [0.2934, 0.624, 0.3564, 0.6438]}, {"w": "as", "b": [0.3628, 0.624, 0.3838, 0.6438]}, {"w": "a", "b": [0.3901, 0.624, 0.4013, 0.6438]}, {"w": "result—then", "b": [0.4076, 0.624, 0.5323, 0.6438]}, {"w": "you’ll", "b": [0.5386, 0.624, 0.5989, 0.6438]}, {"w": "leak", "b": [0.6052, 0.624, 0.6472, 0.6438]}, {"w": "an", "b": [0.6535, 0.624, 0.6773, 0.6438]}, {"w": "increasingly", "b": [0.6836, 0.624, 0.8069, 0.6438]}, {"w": "significant", "b": [0.1294, 0.6445, 0.2359, 0.6643]}, {"w": "amount", "b": [0.2422, 0.6445, 0.3179, 0.6643]}, {"w": "of", "b": [0.3242, 0.6445, 0.3452, 0.6643]}, {"w": "information", "b": [0.3515, 0.6445, 0.4706, 0.6643]}, {"w": "about", "b": [0.4769, 0.6445, 0.533, 0.6643]}, {"w": "the", "b": [0.5393, 0.6445, 0.5701, 0.6643]}, {"w": "validation", "b": [0.5764, 0.6445, 0.6773, 0.6643]}, {"w": "set", "b": [0.6836, 0.6445, 0.7117, 0.6643]}, {"w": "into", "b": [0.718, 0.6445, 0.7572, 0.6643]}, {"w": "the", "b": [0.7635, 0.6445, 0.7943, 0.6643]}, {"w": "model.", "b": [0.8006, 0.6445, 0.87, 0.6643]}]}, {"id": "b_4", "type": "paragraph", "text": "At the end of the day, you’ll end up with a model that performs artificially well on the validation data, because that’s what you optimized it for. You care about performance on completely new data, not the validation data, so you need to use a completely different, never-before- seen dataset to evaluate the model: the test dataset. Your model shouldn’t have had access to any information about the test set, even indirectly. If anything about the model has been tuned based on test set performance, then your measure of generalization will be flawed.", "words": [{"w": "At", "b": [0.1294, 0.6873, 0.1546, 0.7071]}, {"w": "the", "b": [0.1609, 0.6873, 0.1918, 0.7071]}, {"w": "end", "b": [0.1981, 0.6873, 0.2345, 0.7071]}, {"w": "of", "b": [0.2408, 0.6873, 0.2618, 0.7071]}, {"w": "the", "b": [0.2681, 0.6873, 0.299, 0.7071]}, {"w": "day,", "b": [0.3053, 0.6873, 0.3463, 0.7071]}, {"w": "you’ll", "b": [0.3526, 0.6873, 0.4129, 0.7071]}, {"w": "end", "b": [0.4192, 0.6873, 0.4556, 0.7071]}, {"w": "up", "b": [0.4619, 0.6873, 0.4872, 0.7071]}, {"w": "with", "b": [0.4935, 0.6873, 0.5383, 0.7071]}, {"w": "a", "b": [0.5446, 0.6873, 0.5558, 0.7071]}, {"w": "model", "b": [0.5621, 0.6873, 0.6252, 0.7071]}, {"w": "that", "b": [0.6315, 0.6873, 0.6693, 0.7071]}, {"w": "performs", "b": [0.6757, 0.6873, 0.7667, 0.7071]}, {"w": "artificially", "b": [0.1294, 0.7078, 0.2345, 0.7276]}, {"w": "well", "b": [0.2408, 0.7078, 0.2842, 0.7276]}, {"w": "on", "b": [0.2906, 0.7078, 0.3158, 0.7276]}, {"w": "the", "b": [0.3221, 0.7078, 0.3529, 0.7276]}, {"w": "validation", "b": [0.3592, 0.7078, 0.4601, 0.7276]}, {"w": "data,", "b": [0.4664, 0.7078, 0.5148, 0.7276]}, {"w": "because", "b": [0.5211, 0.7078, 0.6009, 0.7276]}, {"w": "that’s", "b": [0.6072, 0.7078, 0.6618, 0.7276]}, {"w": "what", "b": [0.6681, 0.7078, 0.7171, 0.7276]}, {"w": "you", "b": [0.7234, 0.7078, 0.7612, 0.7276]}, {"w": "optimized", "b": [0.7675, 0.7078, 0.8684, 0.7276]}, {"w": "it", "b": [0.1294, 0.7283, 0.1434, 0.7481]}, {"w": "for.", "b": [0.1497, 0.7283, 0.1841, 0.7481]}, {"w": "You", "b": [0.1904, 0.7283, 0.2313, 0.7481]}, {"w": "care", "b": [0.2376, 0.7283, 0.2796, 0.7481]}, {"w": "about", "b": [0.2859, 0.7283, 0.342, 0.7481]}, {"w": "performance", "b": [0.3483, 0.7283, 0.4757, 0.7481]}, {"w": "on", "b": [0.482, 0.7283, 0.5073, 0.7481]}, {"w": "completely", "b": [0.5136, 0.7283, 0.6257, 0.7481]}, {"w": "new", "b": [0.632, 0.7283, 0.674, 0.7481]}, {"w": "data,", "b": [0.6803, 0.7283, 0.7286, 0.7481]}, {"w": "not", "b": [0.7349, 0.7283, 0.7672, 0.7481]}, {"w": "the", "b": [0.7735, 0.7283, 0.8043, 0.7481]}, {"w": "validation", "b": [0.1294, 0.7488, 0.2303, 0.7686]}, {"w": "data,", "b": [0.2366, 0.7488, 0.285, 0.7686]}, {"w": "so", "b": [0.2913, 0.7488, 0.3137, 0.7686]}, {"w": "you", "b": [0.32, 0.7488, 0.3578, 0.7686]}, {"w": "need", "b": [0.3641, 0.7488, 0.4118, 0.7686]}, {"w": "to", "b": [0.4181, 0.7488, 0.4377, 0.7686]}, {"w": "use", "b": [0.444, 0.7488, 0.4776, 0.7686]}, {"w": "a", "b": [0.4839, 0.7488, 0.4951, 0.7686]}, {"w": "completely", "b": [0.5014, 0.7488, 0.6135, 0.7686]}, {"w": "different,", "b": [0.6198, 0.7488, 0.7125, 0.7686]}, {"w": "never-before-", "b": [0.7188, 0.7488, 0.8555, 0.7686]}, {"w": "seen", "b": [0.1294, 0.7693, 0.1742, 0.7891]}, {"w": "dataset", "b": [0.1805, 0.7693, 0.2506, 0.7891]}, {"w": "to", "b": [0.2569, 0.7693, 0.2765, 0.7891]}, {"w": "evaluate", "b": [0.2828, 0.7693, 0.3669, 0.7891]}, {"w": "the", "b": [0.3732, 0.7693, 0.404, 0.7891]}, {"w": "model:", "b": [0.4103, 0.7693, 0.4804, 0.7891]}, {"w": "the", "b": [0.4867, 0.7693, 0.5175, 0.7891]}, {"w": "test", "b": [0.5238, 0.7693, 0.5589, 0.7891]}, {"w": "dataset.", "b": [0.5652, 0.7693, 0.6415, 0.7891]}, {"w": "Your", "b": [0.6479, 0.7693, 0.6971, 0.7891]}, {"w": "model", "b": [0.7034, 0.7693, 0.7664, 0.7891]}, {"w": "shouldn’t", "b": [0.7727, 0.7693, 0.8676, 0.7891]}, {"w": "have", "b": [0.1294, 0.7898, 0.177, 0.8096]}, {"w": "had", "b": [0.1833, 0.7898, 0.2198, 0.8096]}, {"w": "access", "b": [0.2261, 0.7898, 0.2905, 0.8096]}, {"w": "to", "b": [0.2968, 0.7898, 0.3164, 0.8096]}, {"w": "any", "b": [0.3227, 0.7898, 0.3591, 0.8096]}, {"w": "information", "b": [0.3654, 0.7898, 0.4845, 0.8096]}, {"w": "about", "b": [0.4909, 0.7898, 0.5469, 0.8096]}, {"w": "the", "b": [0.5532, 0.7898, 0.584, 0.8096]}, {"w": "test", "b": [0.5903, 0.7898, 0.6254, 0.8096]}, {"w": "set,", "b": [0.6317, 0.7898, 0.666, 0.8096]}, {"w": "even", "b": [0.6723, 0.7898, 0.72, 0.8096]}, {"w": "indirectly.", "b": [0.7263, 0.7898, 0.8275, 0.8096]}, {"w": "If", "b": [0.8338, 0.7898, 0.8506, 0.8096]}, {"w": "anything", "b": [0.1294, 0.8103, 0.2177, 0.8301]}, {"w": "about", "b": [0.224, 0.8103, 0.2801, 0.8301]}, {"w": "the", "b": [0.2864, 0.8103, 0.3172, 0.8301]}, {"w": "model", "b": [0.3235, 0.8103, 0.3866, 0.8301]}, {"w": "has", "b": [0.3929, 0.8103, 0.4265, 0.8301]}, {"w": "been", "b": [0.4328, 0.8103, 0.4804, 0.8301]}, {"w": "tuned", "b": [0.4867, 0.8103, 0.5428, 0.8301]}, {"w": "based", "b": [0.5491, 0.8103, 0.6065, 0.8301]}, {"w": "on", "b": [0.6128, 0.8103, 0.6381, 0.8301]}, {"w": "test", "b": [0.6444, 0.8103, 0.6794, 0.8301]}, {"w": "set", "b": [0.6857, 0.8103, 0.7137, 0.8301]}, {"w": "performance,", "b": [0.72, 0.8103, 0.8538, 0.8301]}, {"w": "then", "b": [0.1294, 0.8308, 0.1729, 0.8506]}, {"w": "your", "b": [0.1792, 0.8308, 0.2254, 0.8506]}, {"w": "measure", "b": [0.2317, 0.8308, 0.3158, 0.8506]}, {"w": "of", "b": [0.3221, 0.8308, 0.3431, 0.8506]}, {"w": "generalization", "b": [0.3494, 0.8308, 0.4923, 0.8506]}, {"w": "will", "b": [0.4986, 0.8308, 0.5378, 0.8506]}, {"w": "be", "b": [0.5441, 0.8308, 0.568, 0.8506]}, {"w": "flawed.", "b": [0.5743, 0.8308, 0.6492, 0.8506]}]}, {"id": "b_5", "type": "paragraph", "text": "Splitting your data into training, validation, and test sets may seem straightforward, but there are a few advanced ways to do it that can come", "words": [{"w": "Splitting", "b": [0.1294, 0.8736, 0.2163, 0.8933]}, {"w": "your", "b": [0.2226, 0.8736, 0.2689, 0.8933]}, {"w": "data", "b": [0.2752, 0.8736, 0.3172, 0.8933]}, {"w": "into", "b": [0.3235, 0.8736, 0.3628, 0.8933]}, {"w": "training,", "b": [0.3691, 0.8736, 0.4539, 0.8933]}, {"w": "validation,", "b": [0.4602, 0.8736, 0.5674, 0.8933]}, {"w": "and", "b": [0.5737, 0.8736, 0.6101, 0.8933]}, {"w": "test", "b": [0.6164, 0.8736, 0.6515, 0.8933]}, {"w": "sets", "b": [0.6578, 0.8736, 0.6956, 0.8933]}, {"w": "may", "b": [0.7019, 0.8736, 0.7453, 0.8933]}, {"w": "seem", "b": [0.7517, 0.8736, 0.8035, 0.8933]}, {"w": "straightforward,", "b": [0.1294, 0.8941, 0.2912, 0.9138]}, {"w": "but", "b": [0.2975, 0.8941, 0.3298, 0.9138]}, {"w": "there", "b": [0.3361, 0.8941, 0.3865, 0.9138]}, {"w": "are", "b": [0.3928, 0.8941, 0.4236, 0.9138]}, {"w": "a", "b": [0.4299, 0.8941, 0.4411, 0.9138]}, {"w": "few", "b": [0.4474, 0.8941, 0.4852, 0.9138]}, {"w": "advanced", "b": [0.4916, 0.8941, 0.5868, 0.9138]}, {"w": "ways", "b": [0.5931, 0.8941, 0.645, 0.9138]}, {"w": "to", "b": [0.6513, 0.8941, 0.6709, 0.9138]}, {"w": "do", "b": [0.6771, 0.8941, 0.7024, 0.9138]}, {"w": "it", "b": [0.7087, 0.8941, 0.7227, 0.9138]}, {"w": "that", "b": [0.729, 0.8941, 0.7668, 0.9138]}, {"w": "can", "b": [0.7731, 0.8941, 0.8081, 0.9138]}, {"w": "come", "b": [0.8145, 0.8941, 0.8691, 0.9138]}]}]}, {"page": 145, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "in handy when little data is available. Let’s review three classic evaluation recipes: simple hold-out validation, K-fold validation, and iterated K-fold validation with shuffling.", "words": [{"w": "in", "b": [0.1294, 0.0857, 0.149, 0.1054]}, {"w": "handy", "b": [0.1553, 0.0857, 0.217, 0.1054]}, {"w": "when", "b": [0.2233, 0.0857, 0.2779, 0.1054]}, {"w": "little", "b": [0.2842, 0.0857, 0.3305, 0.1054]}, {"w": "data", "b": [0.3368, 0.0857, 0.3788, 0.1054]}, {"w": "is", "b": [0.3852, 0.0857, 0.402, 0.1054]}, {"w": "available.", "b": [0.4083, 0.0857, 0.5057, 0.1054]}, {"w": "Let’s", "b": [0.512, 0.0857, 0.5623, 0.1054]}, {"w": "review", "b": [0.5686, 0.0857, 0.6373, 0.1054]}, {"w": "three", "b": [0.6436, 0.0857, 0.694, 0.1054]}, {"w": "classic", "b": [0.7003, 0.0857, 0.7676, 0.1054]}, {"w": "evaluation", "b": [0.1294, 0.1062, 0.2345, 0.1259]}, {"w": "recipes:", "b": [0.2408, 0.1062, 0.3193, 0.1259]}, {"w": "simple", "b": [0.3256, 0.1062, 0.3928, 0.1259]}, {"w": "hold-out", "b": [0.3992, 0.1062, 0.4846, 0.1259]}, {"w": "validation,", "b": [0.4909, 0.1062, 0.5981, 0.1259]}, {"w": "K-fold", "b": [0.6044, 0.1062, 0.6716, 0.1259]}, {"w": "validation,", "b": [0.6779, 0.1062, 0.7852, 0.1259]}, {"w": "and", "b": [0.7915, 0.1062, 0.8279, 0.1259]}, {"w": "iterated", "b": [0.1294, 0.1267, 0.2051, 0.1464]}, {"w": "K-fold", "b": [0.2114, 0.1267, 0.2786, 0.1464]}, {"w": "validation", "b": [0.2849, 0.1267, 0.3858, 0.1464]}, {"w": "with", "b": [0.3921, 0.1267, 0.437, 0.1464]}, {"w": "shuffling.", "b": [0.4433, 0.1267, 0.5402, 0.1464]}]}, {"id": "b_1", "type": "equation", "text": "Simple hold-out validation", "words": [{"w": "Simple", "b": [0.1294, 0.1645, 0.1851, 0.1793]}, {"w": "hold-out", "b": [0.1899, 0.1645, 0.2582, 0.1793]}, {"w": "validation", "b": [0.2629, 0.1645, 0.3439, 0.1793]}]}, {"id": "b_2", "type": "paragraph", "text": "Set apart some fraction of your data as your test set. Train on the remaining data, and evaluate on the test set. As you saw in the previous sections, in order to prevent information leaks, you shouldn’t tune your model based on the test set, and therefore you should also reserve a validation set.", "words": [{"w": "Set", "b": [0.1294, 0.2024, 0.1617, 0.2222]}, {"w": "apart", "b": [0.168, 0.2024, 0.2184, 0.2222]}, {"w": "some", "b": [0.2247, 0.2024, 0.2779, 0.2222]}, {"w": "fraction", "b": [0.2842, 0.2024, 0.3627, 0.2222]}, {"w": "of", "b": [0.369, 0.2024, 0.39, 0.2222]}, {"w": "your", "b": [0.3963, 0.2024, 0.4426, 0.2222]}, {"w": "data", "b": [0.4489, 0.2024, 0.4909, 0.2222]}, {"w": "as", "b": [0.4972, 0.2024, 0.5182, 0.2222]}, {"w": "your", "b": [0.5245, 0.2024, 0.5708, 0.2222]}, {"w": "test", "b": [0.5771, 0.2024, 0.6121, 0.2222]}, {"w": "set.", "b": [0.6184, 0.2024, 0.6527, 0.2222]}, {"w": "Train", "b": [0.6591, 0.2024, 0.7127, 0.2222]}, {"w": "on", "b": [0.719, 0.2024, 0.7443, 0.2222]}, {"w": "the", "b": [0.7506, 0.2024, 0.7814, 0.2222]}, {"w": "remaining", "b": [0.1294, 0.2229, 0.2317, 0.2427]}, {"w": "data,", "b": [0.238, 0.2229, 0.2863, 0.2427]}, {"w": "and", "b": [0.2926, 0.2229, 0.3291, 0.2427]}, {"w": "evaluate", "b": [0.3354, 0.2229, 0.4194, 0.2427]}, {"w": "on", "b": [0.4257, 0.2229, 0.451, 0.2427]}, {"w": "the", "b": [0.4573, 0.2229, 0.4881, 0.2427]}, {"w": "test", "b": [0.4944, 0.2229, 0.5294, 0.2427]}, {"w": "set.", "b": [0.5357, 0.2229, 0.5701, 0.2427]}, {"w": "As", "b": [0.5764, 0.2229, 0.6044, 0.2427]}, {"w": "you", "b": [0.6107, 0.2229, 0.6486, 0.2427]}, {"w": "saw", "b": [0.6549, 0.2229, 0.6941, 0.2427]}, {"w": "in", "b": [0.7003, 0.2229, 0.7199, 0.2427]}, {"w": "the", "b": [0.7263, 0.2229, 0.7571, 0.2427]}, {"w": "previous", "b": [0.7634, 0.2229, 0.8503, 0.2427]}, {"w": "sections,", "b": [0.1294, 0.2434, 0.217, 0.2632]}, {"w": "in", "b": [0.2233, 0.2434, 0.2429, 0.2632]}, {"w": "order", "b": [0.2492, 0.2434, 0.3025, 0.2632]}, {"w": "to", "b": [0.3088, 0.2434, 0.3284, 0.2632]}, {"w": "prevent", "b": [0.3347, 0.2434, 0.4104, 0.2632]}, {"w": "information", "b": [0.4167, 0.2434, 0.5358, 0.2632]}, {"w": "leaks,", "b": [0.5421, 0.2434, 0.6002, 0.2632]}, {"w": "you", "b": [0.6065, 0.2434, 0.6444, 0.2632]}, {"w": "shouldn’t", "b": [0.6507, 0.2434, 0.7455, 0.2632]}, {"w": "tune", "b": [0.7518, 0.2434, 0.7952, 0.2632]}, {"w": "your", "b": [0.8015, 0.2434, 0.8478, 0.2632]}, {"w": "model", "b": [0.1294, 0.2639, 0.1925, 0.2837]}, {"w": "based", "b": [0.1988, 0.2639, 0.2562, 0.2837]}, {"w": "on", "b": [0.2625, 0.2639, 0.2878, 0.2837]}, {"w": "the", "b": [0.2941, 0.2639, 0.3249, 0.2837]}, {"w": "test", "b": [0.3312, 0.2639, 0.3662, 0.2837]}, {"w": "set,", "b": [0.3725, 0.2639, 0.4069, 0.2837]}, {"w": "and", "b": [0.4132, 0.2639, 0.4496, 0.2837]}, {"w": "therefore", "b": [0.4559, 0.2639, 0.5469, 0.2837]}, {"w": "you", "b": [0.5532, 0.2639, 0.5911, 0.2837]}, {"w": "should", "b": [0.5974, 0.2639, 0.6646, 0.2837]}, {"w": "also", "b": [0.6709, 0.2639, 0.713, 0.2837]}, {"w": "reserve", "b": [0.7193, 0.2639, 0.7921, 0.2837]}, {"w": "a", "b": [0.7984, 0.2639, 0.8096, 0.2837]}, {"w": "validation", "b": [0.1294, 0.2844, 0.2303, 0.3042]}, {"w": "set.", "b": [0.2366, 0.2844, 0.271, 0.3042]}]}, {"id": "b_3", "type": "paragraph", "text": "Schematically, hold-out validation looks like figure 4.1. The following listing shows a simple implementation.", "words": [{"w": "Schematically,", "b": [0.1294, 0.3272, 0.277, 0.347]}, {"w": "hold-out", "b": [0.2833, 0.3272, 0.3688, 0.347]}, {"w": "validation", "b": [0.3751, 0.3272, 0.476, 0.347]}, {"w": "looks", "b": [0.4823, 0.3272, 0.5369, 0.347]}, {"w": "like", "b": [0.5433, 0.3272, 0.5811, 0.347]}, {"w": "figure", "b": [0.5873, 0.3272, 0.6476, 0.347]}, {"w": "4.1.", "b": [0.6539, 0.3272, 0.6917, 0.347]}, {"w": "The", "b": [0.698, 0.3272, 0.7372, 0.347]}, {"w": "following", "b": [0.7435, 0.3272, 0.8417, 0.347]}, {"w": "listing", "b": [0.1294, 0.3477, 0.1925, 0.3675]}, {"w": "shows", "b": [0.1988, 0.3477, 0.2619, 0.3675]}, {"w": "a", "b": [0.2682, 0.3477, 0.2794, 0.3675]}, {"w": "simple", "b": [0.2857, 0.3477, 0.353, 0.3675]}, {"w": "implementation.", "b": [0.3593, 0.3477, 0.5239, 0.3675]}]}, {"id": "b_4", "type": "equation", "text": "Figure 4.1. Simple hold-out validation split", "words": [{"w": "Figure", "b": [0.1294, 0.3856, 0.1827, 0.4004]}, {"w": "4.1.", "b": [0.1874, 0.3856, 0.2158, 0.4004]}, {"w": "Simple", "b": [0.2205, 0.3856, 0.2762, 0.4004]}, {"w": "hold-out", "b": [0.2809, 0.3856, 0.3493, 0.4004]}, {"w": "validation", "b": [0.354, 0.3856, 0.435, 0.4004]}, {"w": "split", "b": [0.4397, 0.3856, 0.4744, 0.4004]}]}, {"id": "b_5", "type": "equation", "text": "Listing 4.1. Hold-out validation", "words": [{"w": "Listing", "b": [0.1294, 0.5932, 0.1862, 0.608]}, {"w": "4.1.", "b": [0.1909, 0.5932, 0.2193, 0.608]}, {"w": "Hold-out", "b": [0.224, 0.5932, 0.2965, 0.608]}, {"w": "validation", "b": [0.3013, 0.5932, 0.3822, 0.608]}]}, {"id": "b_6", "type": "paragraph", "text": "num_validation_samples = 10000 np.random.shuffle(data) 1 validation_data = data[:num_validation_samples] 2 data = data[num_validation_samples:] training_data = data[:] 3 model = get_model() 4 model.train(training_data) 4 validation_score = model.evaluate(validation_data) 4 # At this point you can tune your model, # retrain it, evaluate it, tune it again... model = get_model() 5 model.train(np.concatenate([training_data, 5", "words": [{"w": "num_validation_samples", "b": [0.1357, 0.6217, 0.3855, 0.6368]}, {"w": "=", "b": [0.3968, 0.6217, 0.4082, 0.6368]}, {"w": "10000", "b": [0.4195, 0.6217, 0.4763, 0.6368]}, {"w": "np.random.shuffle(data)", "b": [0.1357, 0.652, 0.3968, 0.6671]}, {"w": "1", "b": [0.8056, 0.652, 0.8169, 0.6671]}, {"w": "validation_data", "b": [0.1357, 0.6823, 0.306, 0.6974]}, {"w": "=", "b": [0.3173, 0.6823, 0.3287, 0.6974]}, {"w": "data[:num_validation_samples]", "b": [0.34, 0.6823, 0.6692, 0.6974]}, {"w": "2", "b": [0.8056, 0.6823, 0.8169, 0.6974]}, {"w": "data", "b": [0.1357, 0.6974, 0.1811, 0.7126]}, {"w": "=", "b": [0.1925, 0.6974, 0.2038, 0.7126]}, {"w": "data[num_validation_samples:]", "b": [0.2152, 0.6974, 0.5444, 0.7126]}, {"w": "training_data", "b": [0.1357, 0.7277, 0.2833, 0.7429]}, {"w": "=", "b": [0.2946, 0.7277, 0.306, 0.7429]}, {"w": "data[:]", "b": [0.3173, 0.7277, 0.3968, 0.7429]}, {"w": "3", "b": [0.8056, 0.7277, 0.8169, 0.7429]}, {"w": "model", "b": [0.1357, 0.758, 0.1925, 0.7732]}, {"w": "=", "b": [0.2038, 0.758, 0.2152, 0.7732]}, {"w": "get_model()", "b": [0.2265, 0.758, 0.3514, 0.7732]}, {"w": "4", "b": [0.8056, 0.758, 0.8169, 0.7732]}, {"w": "model.train(training_data)", "b": [0.1357, 0.7732, 0.4309, 0.7883]}, {"w": "4", "b": [0.8056, 0.7732, 0.8169, 0.7883]}, {"w": "validation_score", "b": [0.1357, 0.7883, 0.3173, 0.8035]}, {"w": "=", "b": [0.3287, 0.7883, 0.34, 0.8035]}, {"w": "model.evaluate(validation_data)", "b": [0.3514, 0.7883, 0.7033, 0.8035]}, {"w": "4", "b": [0.8056, 0.7883, 0.8169, 0.8035]}, {"w": "#", "b": [0.1357, 0.8186, 0.1471, 0.8338]}, {"w": "At", "b": [0.1584, 0.8186, 0.1811, 0.8338]}, {"w": "this", "b": [0.1925, 0.8186, 0.2379, 0.8338]}, {"w": "point", "b": [0.2492, 0.8186, 0.306, 0.8338]}, {"w": "you", "b": [0.3173, 0.8186, 0.3514, 0.8338]}, {"w": "can", "b": [0.3628, 0.8186, 0.3968, 0.8338]}, {"w": "tune", "b": [0.4082, 0.8186, 0.4536, 0.8338]}, {"w": "your", "b": [0.4649, 0.8186, 0.5103, 0.8338]}, {"w": "model,", "b": [0.5217, 0.8186, 0.5898, 0.8338]}, {"w": "#", "b": [0.1357, 0.8338, 0.1471, 0.8489]}, {"w": "retrain", "b": [0.1584, 0.8338, 0.2379, 0.8489]}, {"w": "it,", "b": [0.2492, 0.8338, 0.2833, 0.8489]}, {"w": "evaluate", "b": [0.2946, 0.8338, 0.3855, 0.8489]}, {"w": "it,", "b": [0.3968, 0.8338, 0.4309, 0.8489]}, {"w": "tune", "b": [0.4422, 0.8338, 0.4876, 0.8489]}, {"w": "it", "b": [0.499, 0.8338, 0.5217, 0.8489]}, {"w": "again...", "b": [0.533, 0.8338, 0.6238, 0.8489]}, {"w": "model", "b": [0.1357, 0.8641, 0.1925, 0.8792]}, {"w": "=", "b": [0.2038, 0.8641, 0.2152, 0.8792]}, {"w": "get_model()", "b": [0.2265, 0.8641, 0.3514, 0.8792]}, {"w": "5", "b": [0.8056, 0.8641, 0.8169, 0.8792]}, {"w": "model.train(np.concatenate([training_data,", "b": [0.1357, 0.8792, 0.6125, 0.8944]}, {"w": "5", "b": [0.8056, 0.8792, 0.8169, 0.8944]}]}]}, {"page": 146, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "validation_data])) 5 test_score = model.evaluate(test_data) 5", "words": [{"w": "validation_data]))", "b": [0.4536, 0.0851, 0.6579, 0.1002]}, {"w": "5", "b": [0.8056, 0.0851, 0.8169, 0.1002]}, {"w": "test_score", "b": [0.1357, 0.1002, 0.2492, 0.1154]}, {"w": "=", "b": [0.2606, 0.1002, 0.2719, 0.1154]}, {"w": "model.evaluate(test_data)", "b": [0.2833, 0.1002, 0.5671, 0.1154]}, {"w": "5", "b": [0.8056, 0.1002, 0.8169, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Shuffling the data is usually appropriate. 2 Defines the validation set 3 Defines the training set 4 Trains a model on the training data, and evaluates it on the validation data 5 Once you’ve tuned your hyperparameters, it’s common to train your final model from scratch on all non-test data available.", "words": [{"w": "1", "b": [0.1799, 0.1338, 0.1925, 0.1535]}, {"w": "Shuffling", "b": [0.1988, 0.1338, 0.2983, 0.1535]}, {"w": "the", "b": [0.3046, 0.1338, 0.3383, 0.1535]}, {"w": "data", "b": [0.3446, 0.1338, 0.3922, 0.1535]}, {"w": "is", "b": [0.3985, 0.1338, 0.4153, 0.1535]}, {"w": "usually", "b": [0.4217, 0.1338, 0.4988, 0.1535]}, {"w": "appropriate.", "b": [0.5051, 0.1338, 0.6399, 0.1535]}, {"w": "2", "b": [0.1799, 0.1543, 0.1925, 0.174]}, {"w": "Defines", "b": [0.1988, 0.1543, 0.2786, 0.174]}, {"w": "the", "b": [0.285, 0.1543, 0.3186, 0.174]}, {"w": "validation", "b": [0.3249, 0.1543, 0.4328, 0.174]}, {"w": "set", "b": [0.4391, 0.1543, 0.4685, 0.174]}, {"w": "3", "b": [0.1799, 0.1748, 0.1925, 0.1945]}, {"w": "Defines", "b": [0.1988, 0.1748, 0.2786, 0.1945]}, {"w": "the", "b": [0.285, 0.1748, 0.3186, 0.1945]}, {"w": "training", "b": [0.3249, 0.1748, 0.4118, 0.1945]}, {"w": "set", "b": [0.4181, 0.1748, 0.4475, 0.1945]}, {"w": "4", "b": [0.1799, 0.1953, 0.1925, 0.215]}, {"w": "Trains", "b": [0.1988, 0.1953, 0.2684, 0.215]}, {"w": "a", "b": [0.2747, 0.1953, 0.2873, 0.215]}, {"w": "model", "b": [0.2936, 0.1953, 0.3595, 0.215]}, {"w": "on", "b": [0.3658, 0.1953, 0.3924, 0.215]}, {"w": "the", "b": [0.3987, 0.1953, 0.4324, 0.215]}, {"w": "training", "b": [0.4387, 0.1953, 0.5256, 0.215]}, {"w": "data,", "b": [0.5319, 0.1953, 0.5858, 0.215]}, {"w": "and", "b": [0.5921, 0.1953, 0.6328, 0.215]}, {"w": "evaluates", "b": [0.6391, 0.1953, 0.7386, 0.215]}, {"w": "it", "b": [0.7449, 0.1953, 0.7603, 0.215]}, {"w": "on", "b": [0.7666, 0.1953, 0.7933, 0.215]}, {"w": "the", "b": [0.7996, 0.1953, 0.8332, 0.215]}, {"w": "validation", "b": [0.1799, 0.2158, 0.2878, 0.2356]}, {"w": "data", "b": [0.2941, 0.2158, 0.3418, 0.2356]}, {"w": "5", "b": [0.1799, 0.2363, 0.1925, 0.2561]}, {"w": "Once", "b": [0.1988, 0.2363, 0.2548, 0.2561]}, {"w": "you’ve", "b": [0.2611, 0.2363, 0.3326, 0.2561]}, {"w": "tuned", "b": [0.3389, 0.2363, 0.4006, 0.2561]}, {"w": "your", "b": [0.4069, 0.2363, 0.4573, 0.2561]}, {"w": "hyperparameters,", "b": [0.4637, 0.2363, 0.6563, 0.2561]}, {"w": "it’s", "b": [0.6626, 0.2363, 0.6953, 0.2561]}, {"w": "common", "b": [0.7016, 0.2363, 0.7941, 0.2561]}, {"w": "to", "b": [0.8004, 0.2363, 0.8214, 0.2561]}, {"w": "train", "b": [0.1799, 0.2568, 0.2331, 0.2766]}, {"w": "your", "b": [0.2394, 0.2568, 0.2899, 0.2766]}, {"w": "final", "b": [0.2962, 0.2568, 0.3452, 0.2766]}, {"w": "model", "b": [0.3516, 0.2568, 0.4174, 0.2766]}, {"w": "from", "b": [0.4237, 0.2568, 0.4765, 0.2766]}, {"w": "scratch", "b": [0.4828, 0.2568, 0.5612, 0.2766]}, {"w": "on", "b": [0.5675, 0.2568, 0.5942, 0.2766]}, {"w": "all", "b": [0.6005, 0.2568, 0.6271, 0.2766]}, {"w": "non-test", "b": [0.6334, 0.2568, 0.7203, 0.2766]}, {"w": "data", "b": [0.7266, 0.2568, 0.7743, 0.2766]}, {"w": "available.", "b": [0.1799, 0.2773, 0.2829, 0.2971]}]}, {"id": "b_2", "type": "paragraph", "text": "This is the simplest evaluation protocol, and it suffers from one flaw: if little data is available, then your validation and test sets may contain too few samples to be statistically representative of the data at hand. This is easy to recognize: if different random shuffling rounds of the data before splitting end up yielding very different measures of model performance, then you’re having this issue. K-fold validation and iterated K-fold validation are two ways to address this, as discussed next.", "words": [{"w": "This", "b": [0.1294, 0.3201, 0.1743, 0.3398]}, {"w": "is", "b": [0.1806, 0.3201, 0.1974, 0.3398]}, {"w": "the", "b": [0.2037, 0.3201, 0.2345, 0.3398]}, {"w": "simplest", "b": [0.2408, 0.3201, 0.3249, 0.3398]}, {"w": "evaluation", "b": [0.3312, 0.3201, 0.4363, 0.3398]}, {"w": "protocol,", "b": [0.4426, 0.3201, 0.533, 0.3398]}, {"w": "and", "b": [0.5393, 0.3201, 0.5758, 0.3398]}, {"w": "it", "b": [0.5821, 0.3201, 0.5961, 0.3398]}, {"w": "suffers", "b": [0.6024, 0.3201, 0.6705, 0.3398]}, {"w": "from", "b": [0.6768, 0.3201, 0.7259, 0.3398]}, {"w": "one", "b": [0.7322, 0.3201, 0.7686, 0.3398]}, {"w": "flaw:", "b": [0.7749, 0.3201, 0.8267, 0.3398]}, {"w": "if", "b": [0.833, 0.3201, 0.8485, 0.3398]}, {"w": "little", "b": [0.1294, 0.3406, 0.1757, 0.3603]}, {"w": "data", "b": [0.182, 0.3406, 0.224, 0.3603]}, {"w": "is", "b": [0.2303, 0.3406, 0.2471, 0.3603]}, {"w": "available,", "b": [0.2534, 0.3406, 0.3508, 0.3603]}, {"w": "then", "b": [0.3571, 0.3406, 0.4006, 0.3603]}, {"w": "your", "b": [0.4069, 0.3406, 0.4531, 0.3603]}, {"w": "validation", "b": [0.4594, 0.3406, 0.5603, 0.3603]}, {"w": "and", "b": [0.5665, 0.3406, 0.603, 0.3603]}, {"w": "test", "b": [0.6093, 0.3406, 0.6443, 0.3603]}, {"w": "sets", "b": [0.6506, 0.3406, 0.6884, 0.3603]}, {"w": "may", "b": [0.6947, 0.3406, 0.7382, 0.3603]}, {"w": "contain", "b": [0.7445, 0.3406, 0.8188, 0.3603]}, {"w": "too", "b": [0.8251, 0.3406, 0.8573, 0.3603]}, {"w": "few", "b": [0.1294, 0.3611, 0.1672, 0.3808]}, {"w": "samples", "b": [0.1735, 0.3611, 0.2548, 0.3808]}, {"w": "to", "b": [0.2611, 0.3611, 0.2807, 0.3808]}, {"w": "be", "b": [0.287, 0.3611, 0.3109, 0.3808]}, {"w": "statistically", "b": [0.3172, 0.3611, 0.4321, 0.3808]}, {"w": "representative", "b": [0.4384, 0.3611, 0.5799, 0.3808]}, {"w": "of", "b": [0.5862, 0.3611, 0.6072, 0.3808]}, {"w": "the", "b": [0.6135, 0.3611, 0.6443, 0.3808]}, {"w": "data", "b": [0.6507, 0.3611, 0.6927, 0.3808]}, {"w": "at", "b": [0.699, 0.3611, 0.7172, 0.3808]}, {"w": "hand.", "b": [0.7235, 0.3611, 0.7788, 0.3808]}, {"w": "This", "b": [0.7852, 0.3611, 0.83, 0.3808]}, {"w": "is", "b": [0.8363, 0.3611, 0.8531, 0.3808]}, {"w": "easy", "b": [0.1294, 0.3816, 0.1742, 0.4013]}, {"w": "to", "b": [0.1805, 0.3816, 0.2002, 0.4013]}, {"w": "recognize:", "b": [0.2065, 0.3816, 0.3115, 0.4013]}, {"w": "if", "b": [0.3178, 0.3816, 0.3332, 0.4013]}, {"w": "different", "b": [0.3395, 0.3816, 0.4259, 0.4013]}, {"w": "random", "b": [0.4322, 0.3816, 0.5093, 0.4013]}, {"w": "shuffling", "b": [0.5156, 0.3816, 0.6062, 0.4013]}, {"w": "rounds", "b": [0.6125, 0.3816, 0.6812, 0.4013]}, {"w": "of", "b": [0.6875, 0.3816, 0.7085, 0.4013]}, {"w": "the", "b": [0.7148, 0.3816, 0.7456, 0.4013]}, {"w": "data", "b": [0.752, 0.3816, 0.794, 0.4013]}, {"w": "before", "b": [0.8003, 0.3816, 0.8647, 0.4013]}, {"w": "splitting", "b": [0.1294, 0.4021, 0.2121, 0.4218]}, {"w": "end", "b": [0.2184, 0.4021, 0.2549, 0.4218]}, {"w": "up", "b": [0.2612, 0.4021, 0.2864, 0.4218]}, {"w": "yielding", "b": [0.2927, 0.4021, 0.3754, 0.4218]}, {"w": "very", "b": [0.3817, 0.4021, 0.4265, 0.4218]}, {"w": "different", "b": [0.4328, 0.4021, 0.5192, 0.4218]}, {"w": "measures", "b": [0.5255, 0.4021, 0.6194, 0.4218]}, {"w": "of", "b": [0.6257, 0.4021, 0.6467, 0.4218]}, {"w": "model", "b": [0.653, 0.4021, 0.716, 0.4218]}, {"w": "performance,", "b": [0.7223, 0.4021, 0.8561, 0.4218]}, {"w": "then", "b": [0.1294, 0.4226, 0.1729, 0.4423]}, {"w": "you’re", "b": [0.1792, 0.4226, 0.245, 0.4423]}, {"w": "having", "b": [0.2513, 0.4226, 0.32, 0.4423]}, {"w": "this", "b": [0.3263, 0.4226, 0.3627, 0.4423]}, {"w": "issue.", "b": [0.369, 0.4226, 0.4258, 0.4423]}, {"w": "K-fold", "b": [0.4321, 0.4226, 0.4993, 0.4423]}, {"w": "validation", "b": [0.5057, 0.4226, 0.6066, 0.4423]}, {"w": "and", "b": [0.6129, 0.4226, 0.6493, 0.4423]}, {"w": "iterated", "b": [0.6556, 0.4226, 0.7312, 0.4423]}, {"w": "K-fold", "b": [0.7376, 0.4226, 0.8048, 0.4423]}, {"w": "validation", "b": [0.1294, 0.4431, 0.2303, 0.4628]}, {"w": "are", "b": [0.2366, 0.4431, 0.2674, 0.4628]}, {"w": "two", "b": [0.2737, 0.4431, 0.3116, 0.4628]}, {"w": "ways", "b": [0.3179, 0.4431, 0.3697, 0.4628]}, {"w": "to", "b": [0.376, 0.4431, 0.3956, 0.4628]}, {"w": "address", "b": [0.402, 0.4431, 0.4776, 0.4628]}, {"w": "this,", "b": [0.4839, 0.4431, 0.5267, 0.4628]}, {"w": "as", "b": [0.533, 0.4431, 0.554, 0.4628]}, {"w": "discussed", "b": [0.5603, 0.4431, 0.657, 0.4628]}, {"w": "next.", "b": [0.6633, 0.4431, 0.713, 0.4628]}]}, {"id": "b_3", "type": "equation", "text": "K-fold validation", "words": [{"w": "K-fold", "b": [0.1294, 0.4809, 0.182, 0.4957]}, {"w": "validation", "b": [0.1867, 0.4809, 0.2677, 0.4957]}]}, {"id": "b_4", "type": "paragraph", "text": "With this approach, you split your data into K partitions of equal size. For each partition i, train a model on the remaining K – 1 partitions, and evaluate it on partition i. Your final score is then the averages of the K scores obtained. This method is helpful when the performance of your model shows significant variance based on your train-test split. Like hold-out validation, this method doesn’t exempt you from using a distinct validation set for model calibration.", "words": [{"w": "With", "b": [0.1294, 0.5189, 0.1788, 0.5386]}, {"w": "this", "b": [0.1852, 0.5189, 0.2216, 0.5386]}, {"w": "approach,", "b": [0.2279, 0.5189, 0.3267, 0.5386]}, {"w": "you", "b": [0.333, 0.5189, 0.3708, 0.5386]}, {"w": "split", "b": [0.3771, 0.5189, 0.4206, 0.5386]}, {"w": "your", "b": [0.4269, 0.5189, 0.4731, 0.5386]}, {"w": "data", "b": [0.4794, 0.5189, 0.5215, 0.5386]}, {"w": "into", "b": [0.5278, 0.5189, 0.567, 0.5386]}, {"w": "K", "b": [0.5733, 0.5189, 0.5901, 0.5386]}, {"w": "partitions", "b": [0.5964, 0.5189, 0.6917, 0.5386]}, {"w": "of", "b": [0.698, 0.5189, 0.719, 0.5386]}, {"w": "equal", "b": [0.7253, 0.5189, 0.78, 0.5386]}, {"w": "size.", "b": [0.7863, 0.5189, 0.8318, 0.5386]}, {"w": "For", "b": [0.1294, 0.5394, 0.1645, 0.5591]}, {"w": "each", "b": [0.1708, 0.5394, 0.217, 0.5591]}, {"w": "partition", "b": [0.2233, 0.5394, 0.3088, 0.5591]}, {"w": "i,", "b": [0.315, 0.5394, 0.3365, 0.5606]}, {"w": "train", "b": [0.3428, 0.5394, 0.389, 0.5591]}, {"w": "a", "b": [0.3953, 0.5394, 0.4065, 0.5591]}, {"w": "model", "b": [0.4128, 0.5394, 0.4759, 0.5591]}, {"w": "on", "b": [0.4822, 0.5394, 0.5074, 0.5591]}, {"w": "the", "b": [0.5137, 0.5394, 0.5446, 0.5591]}, {"w": "remaining", "b": [0.5509, 0.5394, 0.6532, 0.5591]}, {"w": "K", "b": [0.6594, 0.5394, 0.6762, 0.5591]}, {"w": "–", "b": [0.6825, 0.5394, 0.6951, 0.5591]}, {"w": "1", "b": [0.7014, 0.5394, 0.7141, 0.5591]}, {"w": "partitions,", "b": [0.7204, 0.5394, 0.822, 0.5591]}, {"w": "and", "b": [0.8283, 0.5394, 0.8647, 0.5591]}, {"w": "evaluate", "b": [0.1294, 0.5607, 0.2135, 0.5805]}, {"w": "it", "b": [0.2198, 0.5607, 0.2338, 0.5805]}, {"w": "on", "b": [0.2401, 0.5607, 0.2653, 0.5805]}, {"w": "partition", "b": [0.2716, 0.5607, 0.3571, 0.5805]}, {"w": "i.", "b": [0.3634, 0.5607, 0.3848, 0.582]}, {"w": "Your", "b": [0.3911, 0.5607, 0.4404, 0.5805]}, {"w": "final", "b": [0.4467, 0.5607, 0.493, 0.5805]}, {"w": "score", "b": [0.4993, 0.5607, 0.5525, 0.5805]}, {"w": "is", "b": [0.5588, 0.5607, 0.5756, 0.5805]}, {"w": "then", "b": [0.5819, 0.5607, 0.6254, 0.5805]}, {"w": "the", "b": [0.6317, 0.5607, 0.6625, 0.5805]}, {"w": "averages", "b": [0.6688, 0.5607, 0.7571, 0.5805]}, {"w": "of", "b": [0.7634, 0.5607, 0.7844, 0.5805]}, {"w": "the", "b": [0.7907, 0.5607, 0.8215, 0.5805]}, {"w": "K", "b": [0.8278, 0.5607, 0.8446, 0.5805]}, {"w": "scores", "b": [0.1294, 0.5821, 0.1925, 0.6019]}, {"w": "obtained.", "b": [0.1988, 0.5821, 0.2919, 0.6019]}, {"w": "This", "b": [0.2982, 0.5821, 0.3431, 0.6019]}, {"w": "method", "b": [0.3494, 0.5821, 0.4251, 0.6019]}, {"w": "is", "b": [0.4314, 0.5821, 0.4482, 0.6019]}, {"w": "helpful", "b": [0.4545, 0.5821, 0.526, 0.6019]}, {"w": "when", "b": [0.5323, 0.5821, 0.5869, 0.6019]}, {"w": "the", "b": [0.5932, 0.5821, 0.6241, 0.6019]}, {"w": "performance", "b": [0.6304, 0.5821, 0.7578, 0.6019]}, {"w": "of", "b": [0.7641, 0.5821, 0.7852, 0.6019]}, {"w": "your", "b": [0.7915, 0.5821, 0.8377, 0.6019]}, {"w": "model", "b": [0.1294, 0.6026, 0.1925, 0.6224]}, {"w": "shows", "b": [0.1988, 0.6026, 0.2618, 0.6224]}, {"w": "significant", "b": [0.2682, 0.6026, 0.3747, 0.6224]}, {"w": "variance", "b": [0.381, 0.6026, 0.4664, 0.6224]}, {"w": "based", "b": [0.4727, 0.6026, 0.5301, 0.6224]}, {"w": "on", "b": [0.5365, 0.6026, 0.5617, 0.6224]}, {"w": "your", "b": [0.568, 0.6026, 0.6142, 0.6224]}, {"w": "train-test", "b": [0.6205, 0.6026, 0.7102, 0.6224]}, {"w": "split.", "b": [0.7164, 0.6026, 0.7662, 0.6224]}, {"w": "Like", "b": [0.7725, 0.6026, 0.8188, 0.6224]}, {"w": "hold-out", "b": [0.1294, 0.6231, 0.2149, 0.6429]}, {"w": "validation,", "b": [0.2212, 0.6231, 0.3284, 0.6429]}, {"w": "this", "b": [0.3347, 0.6231, 0.3712, 0.6429]}, {"w": "method", "b": [0.3775, 0.6231, 0.4532, 0.6429]}, {"w": "doesn’t", "b": [0.4595, 0.6231, 0.5332, 0.6429]}, {"w": "exempt", "b": [0.5395, 0.6231, 0.6138, 0.6429]}, {"w": "you", "b": [0.6201, 0.6231, 0.6579, 0.6429]}, {"w": "from", "b": [0.6642, 0.6231, 0.7133, 0.6429]}, {"w": "using", "b": [0.7196, 0.6231, 0.7743, 0.6429]}, {"w": "a", "b": [0.7806, 0.6231, 0.7918, 0.6429]}, {"w": "distinct", "b": [0.1294, 0.6436, 0.2037, 0.6634]}, {"w": "validation", "b": [0.21, 0.6436, 0.3109, 0.6634]}, {"w": "set", "b": [0.3172, 0.6436, 0.3452, 0.6634]}, {"w": "for", "b": [0.3516, 0.6436, 0.381, 0.6634]}, {"w": "model", "b": [0.3873, 0.6436, 0.4503, 0.6634]}, {"w": "calibration.", "b": [0.4566, 0.6436, 0.5708, 0.6634]}]}, {"id": "b_5", "type": "paragraph", "text": "Schematically, K-fold cross-validation looks like figure 4.2. Listing 4.2 shows a simple implementation.", "words": [{"w": "Schematically,", "b": [0.1294, 0.6864, 0.277, 0.7062]}, {"w": "K-fold", "b": [0.2833, 0.6864, 0.3505, 0.7062]}, {"w": "cross-validation", "b": [0.3568, 0.6864, 0.518, 0.7062]}, {"w": "looks", "b": [0.5243, 0.6864, 0.579, 0.7062]}, {"w": "like", "b": [0.5853, 0.6864, 0.6231, 0.7062]}, {"w": "figure", "b": [0.6294, 0.6864, 0.6896, 0.7062]}, {"w": "4.2.", "b": [0.6959, 0.6864, 0.7337, 0.7062]}, {"w": "Listing", "b": [0.74, 0.6864, 0.8115, 0.7062]}, {"w": "4.2", "b": [0.8178, 0.6864, 0.8494, 0.7062]}, {"w": "shows", "b": [0.1294, 0.7069, 0.1925, 0.7267]}, {"w": "a", "b": [0.1988, 0.7069, 0.21, 0.7267]}, {"w": "simple", "b": [0.2163, 0.7069, 0.2836, 0.7267]}, {"w": "implementation.", "b": [0.2899, 0.7069, 0.4545, 0.7267]}]}, {"id": "b_6", "type": "equation", "text": "Figure 4.2. Three-fold validation", "words": [{"w": "Figure", "b": [0.1294, 0.7448, 0.1827, 0.7596]}, {"w": "4.2.", "b": [0.1874, 0.7448, 0.2158, 0.7596]}, {"w": "Three-fold", "b": [0.2205, 0.7448, 0.3063, 0.7596]}, {"w": "validation", "b": [0.311, 0.7448, 0.392, 0.7596]}]}]}, {"page": 147, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Listing 4.2. K-fold cross-validation", "words": [{"w": "Listing", "b": [0.1294, 0.3089, 0.1862, 0.3237]}, {"w": "4.2.", "b": [0.1909, 0.3089, 0.2193, 0.3237]}, {"w": "K-fold", "b": [0.224, 0.3089, 0.2766, 0.3237]}, {"w": "cross-validation", "b": [0.2813, 0.3089, 0.4092, 0.3237]}]}, {"id": "b_1", "type": "paragraph", "text": "k = 4 num_validation_samples = len(data) // k np.random.shuffle(data) validation_scores = [] for fold in range(k): validation_data = data[num_validation_samples * fold: 1 num_validation_samples * (fold + 1)] 1 training_data = data[:num_validation_samples * fold] + 2 data[num_validation_samples * (fold + 1):] 2 model = get_model() 3 model.train(training_data) validation_score = model.evaluate(validation_data) validation_scores.append(validation_score) validation_score = np.average(validation_scores) 4 model = get_model() 5 model.train(data) 5 test_score = model.evaluate(test_data) 5", "words": [{"w": "k", "b": [0.1357, 0.3373, 0.1471, 0.3525]}, {"w": "=", "b": [0.1584, 0.3373, 0.1698, 0.3525]}, {"w": "4", "b": [0.1811, 0.3373, 0.1925, 0.3525]}, {"w": "num_validation_samples", "b": [0.1357, 0.3525, 0.3855, 0.3676]}, {"w": "=", "b": [0.3968, 0.3525, 0.4082, 0.3676]}, {"w": "len(data)", "b": [0.4195, 0.3525, 0.5217, 0.3676]}, {"w": "//", "b": [0.533, 0.3525, 0.5557, 0.3676]}, {"w": "k", "b": [0.5671, 0.3525, 0.5784, 0.3676]}, {"w": "np.random.shuffle(data)", "b": [0.1357, 0.3828, 0.3968, 0.3979]}, {"w": "validation_scores", "b": [0.1357, 0.4131, 0.3287, 0.4282]}, {"w": "=", "b": [0.34, 0.4131, 0.3514, 0.4282]}, {"w": "[]", "b": [0.3628, 0.4131, 0.3855, 0.4282]}, {"w": "for", "b": [0.1357, 0.4282, 0.1698, 0.4434]}, {"w": "fold", "b": [0.1811, 0.4282, 0.2265, 0.4434]}, {"w": "in", "b": [0.2379, 0.4282, 0.2606, 0.4434]}, {"w": "range(k):", "b": [0.2719, 0.4282, 0.3741, 0.4434]}, {"w": "validation_data", "b": [0.1811, 0.4434, 0.3514, 0.4585]}, {"w": "=", "b": [0.3628, 0.4434, 0.3741, 0.4585]}, {"w": "data[num_validation_samples", "b": [0.3855, 0.4434, 0.6919, 0.4585]}, {"w": "*", "b": [0.7033, 0.4434, 0.7146, 0.4585]}, {"w": "fold:", "b": [0.726, 0.4434, 0.7828, 0.4585]}, {"w": "1", "b": [0.1357, 0.4585, 0.1471, 0.4737]}, {"w": "num_validation_samples", "b": [0.1925, 0.4737, 0.4422, 0.4888]}, {"w": "*", "b": [0.4536, 0.4737, 0.4649, 0.4888]}, {"w": "(fold", "b": [0.4763, 0.4737, 0.533, 0.4888]}, {"w": "+", "b": [0.5444, 0.4737, 0.5557, 0.4888]}, {"w": "1)]", "b": [0.5671, 0.4737, 0.6011, 0.4888]}, {"w": "1", "b": [0.1357, 0.4888, 0.1471, 0.504]}, {"w": "training_data", "b": [0.1811, 0.504, 0.3287, 0.5191]}, {"w": "=", "b": [0.34, 0.504, 0.3514, 0.5191]}, {"w": "data[:num_validation_samples", "b": [0.3628, 0.504, 0.6806, 0.5191]}, {"w": "*", "b": [0.6919, 0.504, 0.7033, 0.5191]}, {"w": "fold]", "b": [0.7146, 0.504, 0.7714, 0.5191]}, {"w": "+", "b": [0.7828, 0.504, 0.7941, 0.5191]}, {"w": "2", "b": [0.1357, 0.5192, 0.1471, 0.5343]}, {"w": "data[num_validation_samples", "b": [0.1925, 0.5343, 0.499, 0.5495]}, {"w": "*", "b": [0.5103, 0.5343, 0.5217, 0.5495]}, {"w": "(fold", "b": [0.533, 0.5343, 0.5898, 0.5495]}, {"w": "+", "b": [0.6011, 0.5343, 0.6125, 0.5495]}, {"w": "1):]", "b": [0.6238, 0.5343, 0.6692, 0.5495]}, {"w": "2", "b": [0.1357, 0.5495, 0.1471, 0.5646]}, {"w": "model", "b": [0.1811, 0.5646, 0.2379, 0.5798]}, {"w": "=", "b": [0.2492, 0.5646, 0.2606, 0.5798]}, {"w": "get_model()", "b": [0.2719, 0.5646, 0.3968, 0.5798]}, {"w": "3", "b": [0.1357, 0.5798, 0.1471, 0.5949]}, {"w": "model.train(training_data)", "b": [0.1811, 0.5949, 0.4763, 0.6101]}, {"w": "validation_score", "b": [0.1811, 0.6101, 0.3628, 0.6252]}, {"w": "=", "b": [0.3741, 0.6101, 0.3855, 0.6252]}, {"w": "model.evaluate(validation_data)", "b": [0.3968, 0.6101, 0.7487, 0.6252]}, {"w": "validation_scores.append(validation_score)", "b": [0.1811, 0.6252, 0.6579, 0.6404]}, {"w": "validation_score", "b": [0.1357, 0.6555, 0.3173, 0.6707]}, {"w": "=", "b": [0.3287, 0.6555, 0.34, 0.6707]}, {"w": "np.average(validation_scores)", "b": [0.3514, 0.6555, 0.6806, 0.6707]}, {"w": "4", "b": [0.1357, 0.6707, 0.1471, 0.6858]}, {"w": "model", "b": [0.1357, 0.701, 0.1925, 0.7161]}, {"w": "=", "b": [0.2038, 0.701, 0.2152, 0.7161]}, {"w": "get_model()", "b": [0.2265, 0.701, 0.3514, 0.7161]}, {"w": "5", "b": [0.1357, 0.7161, 0.1471, 0.7313]}, {"w": "model.train(data)", "b": [0.1357, 0.7313, 0.3287, 0.7464]}, {"w": "5", "b": [0.1357, 0.7464, 0.1471, 0.7616]}, {"w": "test_score", "b": [0.1357, 0.7616, 0.2492, 0.7767]}, {"w": "=", "b": [0.2606, 0.7616, 0.2719, 0.7767]}, {"w": "model.evaluate(test_data)", "b": [0.2833, 0.7616, 0.5671, 0.7767]}, {"w": "5", "b": [0.1357, 0.7767, 0.1471, 0.7919]}]}, {"id": "b_2", "type": "paragraph", "text": "1 Selects the validation-data partition 2 Uses the remainder of the data as training data. Note that the + operator is list concatenation, not summation. 3 Creates a brand-new instance of the model (untrained) 4 Validation score: average of the validation scores of the k folds", "words": [{"w": "1", "b": [0.1799, 0.8103, 0.1925, 0.8301]}, {"w": "Selects", "b": [0.1988, 0.8103, 0.2716, 0.8301]}, {"w": "the", "b": [0.2779, 0.8103, 0.3116, 0.8301]}, {"w": "validation-data", "b": [0.3179, 0.8103, 0.4819, 0.8301]}, {"w": "partition", "b": [0.4882, 0.8103, 0.5835, 0.8301]}, {"w": "2", "b": [0.1799, 0.8308, 0.1925, 0.8506]}, {"w": "Uses", "b": [0.1988, 0.8308, 0.2478, 0.8506]}, {"w": "the", "b": [0.2541, 0.8308, 0.2878, 0.8506]}, {"w": "remainder", "b": [0.2941, 0.8308, 0.4071, 0.8506]}, {"w": "of", "b": [0.4134, 0.8308, 0.4344, 0.8506]}, {"w": "the", "b": [0.4407, 0.8308, 0.4744, 0.8506]}, {"w": "data", "b": [0.4807, 0.8308, 0.5283, 0.8506]}, {"w": "as", "b": [0.5346, 0.8308, 0.557, 0.8506]}, {"w": "training", "b": [0.5633, 0.8308, 0.6503, 0.8506]}, {"w": "data.", "b": [0.6566, 0.8308, 0.7105, 0.8506]}, {"w": "Note", "b": [0.7168, 0.8308, 0.7672, 0.8506]}, {"w": "that", "b": [0.7736, 0.8308, 0.817, 0.8506]}, {"w": "the", "b": [0.8233, 0.8308, 0.8569, 0.8506]}, {"w": "+", "b": [0.1799, 0.8513, 0.1942, 0.8711]}, {"w": "operator", "b": [0.2005, 0.8513, 0.2944, 0.8711]}, {"w": "is", "b": [0.3007, 0.8513, 0.3175, 0.8711]}, {"w": "list", "b": [0.3239, 0.8513, 0.3561, 0.8711]}, {"w": "concatenation,", "b": [0.3624, 0.8513, 0.5186, 0.8711]}, {"w": "not", "b": [0.525, 0.8513, 0.56, 0.8711]}, {"w": "summation.", "b": [0.5663, 0.8513, 0.6931, 0.8711]}, {"w": "3", "b": [0.1799, 0.8718, 0.1925, 0.8916]}, {"w": "Creates", "b": [0.1988, 0.8718, 0.281, 0.8916]}, {"w": "a", "b": [0.2873, 0.8718, 0.2999, 0.8916]}, {"w": "brand-new", "b": [0.3062, 0.8718, 0.4239, 0.8916]}, {"w": "instance", "b": [0.4302, 0.8718, 0.5185, 0.8916]}, {"w": "of", "b": [0.5248, 0.8718, 0.5458, 0.8916]}, {"w": "the", "b": [0.5521, 0.8718, 0.5858, 0.8916]}, {"w": "model", "b": [0.5921, 0.8718, 0.6579, 0.8916]}, {"w": "(untrained)", "b": [0.6642, 0.8718, 0.7876, 0.8916]}, {"w": "4", "b": [0.1799, 0.8923, 0.1925, 0.9121]}, {"w": "Validation", "b": [0.1988, 0.8923, 0.31, 0.9121]}, {"w": "score:", "b": [0.3163, 0.8923, 0.3803, 0.9121]}, {"w": "average", "b": [0.3866, 0.8923, 0.4706, 0.9121]}, {"w": "of", "b": [0.4769, 0.8923, 0.498, 0.9121]}, {"w": "the", "b": [0.5043, 0.8923, 0.5379, 0.9121]}, {"w": "validation", "b": [0.5442, 0.8923, 0.6521, 0.9121]}, {"w": "scores", "b": [0.6584, 0.8923, 0.7238, 0.9121]}, {"w": "of", "b": [0.7301, 0.8923, 0.7511, 0.9121]}, {"w": "the", "b": [0.7574, 0.8923, 0.7911, 0.9121]}, {"w": "k", "b": [0.7974, 0.8923, 0.8114, 0.9121]}, {"w": "folds", "b": [0.8177, 0.8923, 0.8696, 0.9121]}]}]}, {"page": 148, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "5 Trains the final model on all non-test data available", "words": [{"w": "5", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Trains", "b": [0.1988, 0.0857, 0.2684, 0.1054]}, {"w": "the", "b": [0.2747, 0.0857, 0.3083, 0.1054]}, {"w": "final", "b": [0.3146, 0.0857, 0.3637, 0.1054]}, {"w": "model", "b": [0.37, 0.0857, 0.4359, 0.1054]}, {"w": "on", "b": [0.4422, 0.0857, 0.4688, 0.1054]}, {"w": "all", "b": [0.4751, 0.0857, 0.5018, 0.1054]}, {"w": "non-test", "b": [0.5081, 0.0857, 0.5949, 0.1054]}, {"w": "data", "b": [0.6013, 0.0857, 0.6489, 0.1054]}, {"w": "available", "b": [0.6552, 0.0857, 0.7519, 0.1054]}]}, {"id": "b_1", "type": "equation", "text": "Iterated K-fold validation with shuffling", "words": [{"w": "Iterated", "b": [0.1294, 0.1235, 0.1946, 0.1383]}, {"w": "K-fold", "b": [0.1993, 0.1235, 0.2518, 0.1383]}, {"w": "validation", "b": [0.2566, 0.1235, 0.3375, 0.1383]}, {"w": "with", "b": [0.3423, 0.1235, 0.378, 0.1383]}, {"w": "shuffling", "b": [0.3827, 0.1235, 0.4542, 0.1383]}]}, {"id": "b_2", "type": "paragraph", "text": "This one is for situations in which you have relatively little data available and you need to evaluate your model as precisely as possible. I’ve found it to be extremely helpful in Kaggle competitions. It consists of applying K-fold validation multiple times, shuffling the data every time before splitting it K ways. The final score is the average of the scores obtained at each run of K-fold validation. Note that you end up training and evaluating P × K models (where P is the number of iterations you use), which can very expensive.", "words": [{"w": "This", "b": [0.1294, 0.1614, 0.1743, 0.1812]}, {"w": "one", "b": [0.1806, 0.1614, 0.217, 0.1812]}, {"w": "is", "b": [0.2233, 0.1614, 0.2401, 0.1812]}, {"w": "for", "b": [0.2464, 0.1614, 0.2758, 0.1812]}, {"w": "situations", "b": [0.2822, 0.1614, 0.3789, 0.1812]}, {"w": "in", "b": [0.3852, 0.1614, 0.4048, 0.1812]}, {"w": "which", "b": [0.4111, 0.1614, 0.4728, 0.1812]}, {"w": "you", "b": [0.4791, 0.1614, 0.5169, 0.1812]}, {"w": "have", "b": [0.5232, 0.1614, 0.5708, 0.1812]}, {"w": "relatively", "b": [0.5771, 0.1614, 0.6724, 0.1812]}, {"w": "little", "b": [0.6787, 0.1614, 0.725, 0.1812]}, {"w": "data", "b": [0.7313, 0.1614, 0.7733, 0.1812]}, {"w": "available", "b": [0.7796, 0.1614, 0.8707, 0.1812]}, {"w": "and", "b": [0.1294, 0.1819, 0.1658, 0.2017]}, {"w": "you", "b": [0.1721, 0.1819, 0.21, 0.2017]}, {"w": "need", "b": [0.2163, 0.1819, 0.2639, 0.2017]}, {"w": "to", "b": [0.2702, 0.1819, 0.2898, 0.2017]}, {"w": "evaluate", "b": [0.2962, 0.1819, 0.3802, 0.2017]}, {"w": "your", "b": [0.3865, 0.1819, 0.4328, 0.2017]}, {"w": "model", "b": [0.4391, 0.1819, 0.5021, 0.2017]}, {"w": "as", "b": [0.5084, 0.1819, 0.5294, 0.2017]}, {"w": "precisely", "b": [0.5357, 0.1819, 0.6268, 0.2017]}, {"w": "as", "b": [0.633, 0.1819, 0.6541, 0.2017]}, {"w": "possible.", "b": [0.6604, 0.1819, 0.7494, 0.2017]}, {"w": "I’ve", "b": [0.7557, 0.1819, 0.7963, 0.2017]}, {"w": "found", "b": [0.8026, 0.1819, 0.8614, 0.2017]}, {"w": "it", "b": [0.1294, 0.2024, 0.1434, 0.2222]}, {"w": "to", "b": [0.1497, 0.2024, 0.1694, 0.2222]}, {"w": "be", "b": [0.1757, 0.2024, 0.1995, 0.2222]}, {"w": "extremely", "b": [0.2058, 0.2024, 0.3067, 0.2222]}, {"w": "helpful", "b": [0.313, 0.2024, 0.3844, 0.2222]}, {"w": "in", "b": [0.3908, 0.2024, 0.4104, 0.2222]}, {"w": "Kaggle", "b": [0.4167, 0.2024, 0.4895, 0.2222]}, {"w": "competitions.", "b": [0.4958, 0.2024, 0.6325, 0.2222]}, {"w": "It", "b": [0.6388, 0.2024, 0.6542, 0.2222]}, {"w": "consists", "b": [0.6605, 0.2024, 0.7404, 0.2222]}, {"w": "of", "b": [0.7467, 0.2024, 0.7677, 0.2222]}, {"w": "applying", "b": [0.774, 0.2024, 0.8623, 0.2222]}, {"w": "K-fold", "b": [0.1294, 0.2229, 0.1967, 0.2427]}, {"w": "validation", "b": [0.203, 0.2229, 0.3039, 0.2427]}, {"w": "multiple", "b": [0.3102, 0.2229, 0.3943, 0.2427]}, {"w": "times,", "b": [0.4005, 0.2229, 0.4615, 0.2427]}, {"w": "shuffling", "b": [0.4678, 0.2229, 0.5584, 0.2427]}, {"w": "the", "b": [0.5647, 0.2229, 0.5956, 0.2427]}, {"w": "data", "b": [0.6019, 0.2229, 0.6439, 0.2427]}, {"w": "every", "b": [0.6502, 0.2229, 0.7062, 0.2427]}, {"w": "time", "b": [0.7125, 0.2229, 0.7574, 0.2427]}, {"w": "before", "b": [0.7637, 0.2229, 0.8281, 0.2427]}, {"w": "splitting", "b": [0.1294, 0.2434, 0.2121, 0.2632]}, {"w": "it", "b": [0.2184, 0.2434, 0.2325, 0.2632]}, {"w": "K", "b": [0.2387, 0.2434, 0.2556, 0.2632]}, {"w": "ways.", "b": [0.2618, 0.2434, 0.32, 0.2632]}, {"w": "The", "b": [0.3263, 0.2434, 0.3655, 0.2632]}, {"w": "final", "b": [0.3718, 0.2434, 0.4181, 0.2632]}, {"w": "score", "b": [0.4244, 0.2434, 0.4776, 0.2632]}, {"w": "is", "b": [0.4839, 0.2434, 0.5007, 0.2632]}, {"w": "the", "b": [0.507, 0.2434, 0.5379, 0.2632]}, {"w": "average", "b": [0.5442, 0.2434, 0.6226, 0.2632]}, {"w": "of", "b": [0.6289, 0.2434, 0.6499, 0.2632]}, {"w": "the", "b": [0.6562, 0.2434, 0.6871, 0.2632]}, {"w": "scores", "b": [0.6934, 0.2434, 0.7564, 0.2632]}, {"w": "obtained", "b": [0.7627, 0.2434, 0.8496, 0.2632]}, {"w": "at", "b": [0.1294, 0.2639, 0.1476, 0.2837]}, {"w": "each", "b": [0.1539, 0.2639, 0.2001, 0.2837]}, {"w": "run", "b": [0.2065, 0.2639, 0.2401, 0.2837]}, {"w": "of", "b": [0.2464, 0.2639, 0.2674, 0.2837]}, {"w": "K-fold", "b": [0.2737, 0.2639, 0.341, 0.2837]}, {"w": "validation.", "b": [0.3473, 0.2639, 0.4545, 0.2837]}, {"w": "Note", "b": [0.4608, 0.2639, 0.5098, 0.2837]}, {"w": "that", "b": [0.5161, 0.2639, 0.554, 0.2837]}, {"w": "you", "b": [0.5603, 0.2639, 0.5981, 0.2837]}, {"w": "end", "b": [0.6044, 0.2639, 0.6408, 0.2837]}, {"w": "up", "b": [0.6471, 0.2639, 0.6724, 0.2837]}, {"w": "training", "b": [0.6787, 0.2639, 0.7572, 0.2837]}, {"w": "and", "b": [0.7634, 0.2639, 0.7998, 0.2837]}, {"w": "evaluating", "b": [0.1294, 0.2844, 0.2345, 0.3042]}, {"w": "P", "b": [0.2408, 0.2844, 0.2562, 0.3042]}, {"w": "×", "b": [0.2625, 0.2844, 0.2767, 0.3042]}, {"w": "K", "b": [0.283, 0.2844, 0.2998, 0.3042]}, {"w": "models", "b": [0.3061, 0.2844, 0.379, 0.3042]}, {"w": "(where", "b": [0.3853, 0.2844, 0.4553, 0.3042]}, {"w": "P", "b": [0.4616, 0.2844, 0.477, 0.3042]}, {"w": "is", "b": [0.4833, 0.2844, 0.5001, 0.3042]}, {"w": "the", "b": [0.5064, 0.2844, 0.5373, 0.3042]}, {"w": "number", "b": [0.5436, 0.2844, 0.6206, 0.3042]}, {"w": "of", "b": [0.6269, 0.2844, 0.648, 0.3042]}, {"w": "iterations", "b": [0.6543, 0.2844, 0.7481, 0.3042]}, {"w": "you", "b": [0.7545, 0.2844, 0.7923, 0.3042]}, {"w": "use),", "b": [0.7986, 0.2844, 0.8469, 0.3042]}, {"w": "which", "b": [0.1294, 0.3049, 0.1911, 0.3247]}, {"w": "can", "b": [0.1974, 0.3049, 0.2324, 0.3247]}, {"w": "very", "b": [0.2387, 0.3049, 0.2835, 0.3247]}, {"w": "expensive.", "b": [0.2898, 0.3049, 0.397, 0.3247]}]}, {"id": "b_3", "type": "paragraph", "text": "4.2.2. Things to keep in mind", "words": [{"w": "4.2.2.", "b": [0.1294, 0.3522, 0.1862, 0.3719]}, {"w": "Things", "b": [0.1925, 0.3522, 0.2668, 0.3719]}, {"w": "to", "b": [0.2731, 0.3522, 0.2941, 0.3719]}, {"w": "keep", "b": [0.3004, 0.3522, 0.3509, 0.3719]}, {"w": "in", "b": [0.3572, 0.3522, 0.3782, 0.3719]}, {"w": "mind", "b": [0.3845, 0.3522, 0.4406, 0.3719]}]}, {"id": "b_4", "type": "paragraph", "text": "Keep an eye out for the following when you’re choosing an evaluation protocol:", "words": [{"w": "Keep", "b": [0.1294, 0.395, 0.1826, 0.4147]}, {"w": "an", "b": [0.1889, 0.395, 0.2128, 0.4147]}, {"w": "eye", "b": [0.2191, 0.395, 0.2541, 0.4147]}, {"w": "out", "b": [0.2604, 0.395, 0.2926, 0.4147]}, {"w": "for", "b": [0.2989, 0.395, 0.3283, 0.4147]}, {"w": "the", "b": [0.3346, 0.395, 0.3655, 0.4147]}, {"w": "following", "b": [0.3718, 0.395, 0.4699, 0.4147]}, {"w": "when", "b": [0.4762, 0.395, 0.5308, 0.4147]}, {"w": "you’re", "b": [0.5371, 0.395, 0.603, 0.4147]}, {"w": "choosing", "b": [0.6093, 0.395, 0.7004, 0.4147]}, {"w": "an", "b": [0.7067, 0.395, 0.7305, 0.4147]}, {"w": "evaluation", "b": [0.7368, 0.395, 0.8419, 0.4147]}, {"w": "protocol:", "b": [0.1294, 0.4155, 0.2205, 0.4352]}]}, {"id": "b_5", "type": "paragraph", "text": "Data representativeness— You want both your training set and test set to be representative of the data at hand. For instance, if you’re trying to classify images of digits, and you’re starting from an array of samples where the samples are ordered by their class, taking the first 80% of the array as your training set and the remaining 20% as your test set will result in your training set containing only classes 0–7, whereas your test set contains only classes 8–9. This seems like a ridiculous mistake, but it’s surprisingly common. For this reason, you usually should randomly shuffle your data before splitting it into training and test sets. The arrow of time— If you’re trying to predict the future given the past (for example, tomorrow’s weather, stock movements, and so on), you should not randomly shuffle your data before splitting it, because doing so will create a temporal leak: your model will effectively be trained on data from the future. In such situations, you should always make sure all data in your test set is posterior to the data in the training set. Redundancy in your data— If some data points in your data appear twice (fairly common with real-world data), then shuffling the data and splitting it into a training set and a validation set will result in redundancy between the training and validation sets. In effect, you’ll be testing on part of your training data, which is the worst", "words": [{"w": "Data", "b": [0.1799, 0.4538, 0.2303, 0.4735]}, {"w": "representativeness—", "b": [0.2366, 0.4538, 0.4524, 0.4735]}, {"w": "You", "b": [0.4587, 0.4538, 0.4996, 0.4735]}, {"w": "want", "b": [0.506, 0.4538, 0.555, 0.4735]}, {"w": "both", "b": [0.5613, 0.4538, 0.6061, 0.4735]}, {"w": "your", "b": [0.6125, 0.4538, 0.6587, 0.4735]}, {"w": "training", "b": [0.665, 0.4538, 0.7435, 0.4735]}, {"w": "set", "b": [0.7498, 0.4538, 0.7778, 0.4735]}, {"w": "and", "b": [0.7841, 0.4538, 0.8205, 0.4735]}, {"w": "test", "b": [0.8268, 0.4538, 0.8619, 0.4735]}, {"w": "set", "b": [0.1799, 0.4743, 0.2079, 0.494]}, {"w": "to", "b": [0.2142, 0.4743, 0.2338, 0.494]}, {"w": "be", "b": [0.2401, 0.4743, 0.2639, 0.494]}, {"w": "representative", "b": [0.2702, 0.4743, 0.4117, 0.494]}, {"w": "of", "b": [0.418, 0.4743, 0.4391, 0.494]}, {"w": "the", "b": [0.4454, 0.4743, 0.4762, 0.494]}, {"w": "data", "b": [0.4825, 0.4743, 0.5245, 0.494]}, {"w": "at", "b": [0.5308, 0.4743, 0.549, 0.494]}, {"w": "hand.", "b": [0.5553, 0.4743, 0.6107, 0.494]}, {"w": "For", "b": [0.617, 0.4743, 0.652, 0.494]}, {"w": "instance,", "b": [0.6583, 0.4743, 0.7473, 0.494]}, {"w": "if", "b": [0.7536, 0.4743, 0.769, 0.494]}, {"w": "you’re", "b": [0.7753, 0.4743, 0.8412, 0.494]}, {"w": "trying", "b": [0.1799, 0.4948, 0.2401, 0.5145]}, {"w": "to", "b": [0.2464, 0.4948, 0.2661, 0.5145]}, {"w": "classify", "b": [0.2724, 0.4948, 0.3494, 0.5145]}, {"w": "images", "b": [0.3557, 0.4948, 0.4272, 0.5145]}, {"w": "of", "b": [0.4335, 0.4948, 0.4545, 0.5145]}, {"w": "digits,", "b": [0.4608, 0.4948, 0.5232, 0.5145]}, {"w": "and", "b": [0.5295, 0.4948, 0.5659, 0.5145]}, {"w": "you’re", "b": [0.5722, 0.4948, 0.6381, 0.5145]}, {"w": "starting", "b": [0.6444, 0.4948, 0.7201, 0.5145]}, {"w": "from", "b": [0.7264, 0.4948, 0.7754, 0.5145]}, {"w": "an", "b": [0.7817, 0.4948, 0.8055, 0.5145]}, {"w": "array", "b": [0.8118, 0.4948, 0.8636, 0.5145]}, {"w": "of", "b": [0.1799, 0.5153, 0.2009, 0.535]}, {"w": "samples", "b": [0.2072, 0.5153, 0.2885, 0.535]}, {"w": "where", "b": [0.2948, 0.5153, 0.3564, 0.535]}, {"w": "the", "b": [0.3627, 0.5153, 0.3935, 0.535]}, {"w": "samples", "b": [0.3998, 0.5153, 0.4811, 0.535]}, {"w": "are", "b": [0.4874, 0.5153, 0.5182, 0.535]}, {"w": "ordered", "b": [0.5245, 0.5153, 0.6016, 0.535]}, {"w": "by", "b": [0.6079, 0.5153, 0.6331, 0.535]}, {"w": "their", "b": [0.6394, 0.5153, 0.6856, 0.535]}, {"w": "class,", "b": [0.6919, 0.5153, 0.7473, 0.535]}, {"w": "taking", "b": [0.7536, 0.5153, 0.8167, 0.535]}, {"w": "the", "b": [0.823, 0.5153, 0.8538, 0.535]}, {"w": "first", "b": [0.1799, 0.5358, 0.2205, 0.5555]}, {"w": "80%", "b": [0.2268, 0.5358, 0.273, 0.5555]}, {"w": "of", "b": [0.2793, 0.5358, 0.3003, 0.5555]}, {"w": "the", "b": [0.3067, 0.5358, 0.3375, 0.5555]}, {"w": "array", "b": [0.3438, 0.5358, 0.3956, 0.5555]}, {"w": "as", "b": [0.4019, 0.5358, 0.4229, 0.5555]}, {"w": "your", "b": [0.4292, 0.5358, 0.4755, 0.5555]}, {"w": "training", "b": [0.4818, 0.5358, 0.5602, 0.5555]}, {"w": "set", "b": [0.5666, 0.5358, 0.5946, 0.5555]}, {"w": "and", "b": [0.6009, 0.5358, 0.6373, 0.5555]}, {"w": "the", "b": [0.6436, 0.5358, 0.6744, 0.5555]}, {"w": "remaining", "b": [0.6808, 0.5358, 0.783, 0.5555]}, {"w": "20%", "b": [0.7893, 0.5358, 0.8356, 0.5555]}, {"w": "as", "b": [0.8419, 0.5358, 0.8629, 0.5555]}, {"w": "your", "b": [0.1799, 0.5563, 0.2261, 0.576]}, {"w": "test", "b": [0.2324, 0.5563, 0.2674, 0.576]}, {"w": "set", "b": [0.2738, 0.5563, 0.3018, 0.576]}, {"w": "will", "b": [0.3081, 0.5563, 0.3473, 0.576]}, {"w": "result", "b": [0.3536, 0.5563, 0.4097, 0.576]}, {"w": "in", "b": [0.416, 0.5563, 0.4356, 0.576]}, {"w": "your", "b": [0.4419, 0.5563, 0.4882, 0.576]}, {"w": "training", "b": [0.4945, 0.5563, 0.573, 0.576]}, {"w": "set", "b": [0.5793, 0.5563, 0.6073, 0.576]}, {"w": "containing", "b": [0.6136, 0.5563, 0.7201, 0.576]}, {"w": "only", "b": [0.7264, 0.5563, 0.7713, 0.576]}, {"w": "classes", "b": [0.7775, 0.5563, 0.8475, 0.576]}, {"w": "0–7,", "b": [0.1799, 0.5768, 0.224, 0.5965]}, {"w": "whereas", "b": [0.2303, 0.5768, 0.313, 0.5965]}, {"w": "your", "b": [0.3193, 0.5768, 0.3655, 0.5965]}, {"w": "test", "b": [0.3718, 0.5768, 0.4068, 0.5965]}, {"w": "set", "b": [0.4132, 0.5768, 0.4412, 0.5965]}, {"w": "contains", "b": [0.4475, 0.5768, 0.5316, 0.5965]}, {"w": "only", "b": [0.5379, 0.5768, 0.5827, 0.5965]}, {"w": "classes", "b": [0.589, 0.5768, 0.6591, 0.5965]}, {"w": "8–9.", "b": [0.6654, 0.5768, 0.7095, 0.5965]}, {"w": "This", "b": [0.7158, 0.5768, 0.7607, 0.5965]}, {"w": "seems", "b": [0.767, 0.5768, 0.8286, 0.5965]}, {"w": "like", "b": [0.1799, 0.5973, 0.2177, 0.617]}, {"w": "a", "b": [0.224, 0.5973, 0.2352, 0.617]}, {"w": "ridiculous", "b": [0.2415, 0.5973, 0.3424, 0.617]}, {"w": "mistake,", "b": [0.3487, 0.5973, 0.4335, 0.617]}, {"w": "but", "b": [0.4398, 0.5973, 0.4721, 0.617]}, {"w": "it’s", "b": [0.4784, 0.5973, 0.5091, 0.617]}, {"w": "surprisingly", "b": [0.5155, 0.5973, 0.636, 0.617]}, {"w": "common.", "b": [0.6423, 0.5973, 0.7369, 0.617]}, {"w": "For", "b": [0.7432, 0.5973, 0.7782, 0.617]}, {"w": "this", "b": [0.7845, 0.5973, 0.821, 0.617]}, {"w": "reason,", "b": [0.1799, 0.6178, 0.252, 0.6375]}, {"w": "you", "b": [0.2583, 0.6178, 0.2962, 0.6375]}, {"w": "usually", "b": [0.3025, 0.6178, 0.3753, 0.6375]}, {"w": "should", "b": [0.3816, 0.6178, 0.4489, 0.6375]}, {"w": "randomly", "b": [0.4552, 0.6178, 0.5519, 0.6375]}, {"w": "shuffle", "b": [0.5582, 0.6178, 0.6255, 0.6375]}, {"w": "your", "b": [0.6318, 0.6178, 0.678, 0.6375]}, {"w": "data", "b": [0.6843, 0.6178, 0.7263, 0.6375]}, {"w": "before", "b": [0.7326, 0.6178, 0.7971, 0.6375]}, {"w": "splitting", "b": [0.1799, 0.6383, 0.2626, 0.658]}, {"w": "it", "b": [0.2689, 0.6383, 0.2829, 0.658]}, {"w": "into", "b": [0.2892, 0.6383, 0.3285, 0.658]}, {"w": "training", "b": [0.3348, 0.6383, 0.4133, 0.658]}, {"w": "and", "b": [0.4196, 0.6383, 0.456, 0.658]}, {"w": "test", "b": [0.4623, 0.6383, 0.4973, 0.658]}, {"w": "sets.", "b": [0.5036, 0.6383, 0.5478, 0.658]}, {"w": "The", "b": [0.1799, 0.6588, 0.2205, 0.6785]}, {"w": "arrow", "b": [0.2268, 0.6588, 0.2885, 0.6785]}, {"w": "of", "b": [0.2948, 0.6588, 0.3158, 0.6785]}, {"w": "time—", "b": [0.3221, 0.6588, 0.3922, 0.6785]}, {"w": "If", "b": [0.3985, 0.6588, 0.4153, 0.6785]}, {"w": "you’re", "b": [0.4216, 0.6588, 0.4874, 0.6785]}, {"w": "trying", "b": [0.4937, 0.6588, 0.554, 0.6785]}, {"w": "to", "b": [0.5603, 0.6588, 0.5799, 0.6785]}, {"w": "predict", "b": [0.5862, 0.6588, 0.6563, 0.6785]}, {"w": "the", "b": [0.6626, 0.6588, 0.6934, 0.6785]}, {"w": "future", "b": [0.6997, 0.6588, 0.76, 0.6785]}, {"w": "given", "b": [0.7663, 0.6588, 0.8223, 0.6785]}, {"w": "the", "b": [0.8286, 0.6588, 0.8595, 0.6785]}, {"w": "past", "b": [0.1799, 0.6793, 0.2205, 0.699]}, {"w": "(for", "b": [0.2268, 0.6793, 0.2646, 0.699]}, {"w": "example,", "b": [0.2709, 0.6793, 0.3627, 0.699]}, {"w": "tomorrow’s", "b": [0.369, 0.6793, 0.4853, 0.699]}, {"w": "weather,", "b": [0.4916, 0.6793, 0.5767, 0.699]}, {"w": "stock", "b": [0.583, 0.6793, 0.6363, 0.699]}, {"w": "movements,", "b": [0.6426, 0.6793, 0.7652, 0.699]}, {"w": "and", "b": [0.7715, 0.6793, 0.8079, 0.699]}, {"w": "so", "b": [0.8143, 0.6793, 0.8367, 0.699]}, {"w": "on),", "b": [0.1799, 0.6998, 0.2198, 0.7195]}, {"w": "you", "b": [0.2261, 0.6998, 0.2639, 0.7195]}, {"w": "should", "b": [0.2702, 0.6998, 0.3375, 0.7195]}, {"w": "not", "b": [0.3438, 0.6998, 0.3761, 0.7195]}, {"w": "randomly", "b": [0.3824, 0.6998, 0.479, 0.7195]}, {"w": "shuffle", "b": [0.4854, 0.6998, 0.5549, 0.7195]}, {"w": "your", "b": [0.5613, 0.6998, 0.6075, 0.7195]}, {"w": "data", "b": [0.6138, 0.6998, 0.6558, 0.7195]}, {"w": "before", "b": [0.6621, 0.6998, 0.7266, 0.7195]}, {"w": "splitting", "b": [0.7329, 0.6998, 0.8156, 0.7195]}, {"w": "it,", "b": [0.8219, 0.6998, 0.8422, 0.7195]}, {"w": "because", "b": [0.1799, 0.7203, 0.2597, 0.74]}, {"w": "doing", "b": [0.266, 0.7203, 0.3235, 0.74]}, {"w": "so", "b": [0.3298, 0.7203, 0.3522, 0.74]}, {"w": "will", "b": [0.3585, 0.7203, 0.3978, 0.74]}, {"w": "create", "b": [0.4041, 0.7203, 0.4643, 0.74]}, {"w": "a", "b": [0.4706, 0.7203, 0.4818, 0.74]}, {"w": "temporal", "b": [0.4881, 0.7203, 0.5791, 0.74]}, {"w": "leak:", "b": [0.5854, 0.7203, 0.6345, 0.74]}, {"w": "your", "b": [0.6408, 0.7203, 0.687, 0.74]}, {"w": "model", "b": [0.6933, 0.7203, 0.7564, 0.74]}, {"w": "will", "b": [0.7627, 0.7203, 0.8019, 0.74]}, {"w": "effectively", "b": [0.1799, 0.7408, 0.2873, 0.7605]}, {"w": "be", "b": [0.2936, 0.7408, 0.3174, 0.7605]}, {"w": "trained", "b": [0.3237, 0.7408, 0.3937, 0.7605]}, {"w": "on", "b": [0.4001, 0.7408, 0.4253, 0.7605]}, {"w": "data", "b": [0.4316, 0.7408, 0.4736, 0.7605]}, {"w": "from", "b": [0.4799, 0.7408, 0.529, 0.7605]}, {"w": "the", "b": [0.5353, 0.7408, 0.5661, 0.7605]}, {"w": "future.", "b": [0.5724, 0.7408, 0.6389, 0.7605]}, {"w": "In", "b": [0.6452, 0.7408, 0.6663, 0.7605]}, {"w": "such", "b": [0.6726, 0.7408, 0.7188, 0.7605]}, {"w": "situations,", "b": [0.7251, 0.7408, 0.8281, 0.7605]}, {"w": "you", "b": [0.1799, 0.7613, 0.2177, 0.781]}, {"w": "should", "b": [0.224, 0.7613, 0.2913, 0.781]}, {"w": "always", "b": [0.2976, 0.7613, 0.3676, 0.781]}, {"w": "make", "b": [0.374, 0.7613, 0.4286, 0.781]}, {"w": "sure", "b": [0.4349, 0.7613, 0.4769, 0.781]}, {"w": "all", "b": [0.4832, 0.7613, 0.5085, 0.781]}, {"w": "data", "b": [0.5148, 0.7613, 0.5568, 0.781]}, {"w": "in", "b": [0.563, 0.7613, 0.5827, 0.781]}, {"w": "your", "b": [0.589, 0.7613, 0.6352, 0.781]}, {"w": "test", "b": [0.6415, 0.7613, 0.6766, 0.781]}, {"w": "set", "b": [0.6829, 0.7613, 0.7109, 0.781]}, {"w": "is", "b": [0.7172, 0.7613, 0.734, 0.781]}, {"w": "posterior", "b": [0.7403, 0.7613, 0.8328, 0.781]}, {"w": "to", "b": [0.8391, 0.7613, 0.8587, 0.781]}, {"w": "the", "b": [0.1799, 0.7818, 0.2107, 0.8015]}, {"w": "data", "b": [0.217, 0.7818, 0.259, 0.8015]}, {"w": "in", "b": [0.2653, 0.7818, 0.285, 0.8015]}, {"w": "the", "b": [0.2913, 0.7818, 0.3221, 0.8015]}, {"w": "training", "b": [0.3284, 0.7818, 0.4069, 0.8015]}, {"w": "set.", "b": [0.4132, 0.7818, 0.4475, 0.8015]}, {"w": "Redundancy", "b": [0.1799, 0.8023, 0.3102, 0.822]}, {"w": "in", "b": [0.3165, 0.8023, 0.3375, 0.822]}, {"w": "your", "b": [0.3439, 0.8023, 0.3915, 0.822]}, {"w": "data—", "b": [0.3978, 0.8023, 0.4679, 0.822]}, {"w": "If", "b": [0.4742, 0.8023, 0.491, 0.822]}, {"w": "some", "b": [0.4973, 0.8023, 0.5506, 0.822]}, {"w": "data", "b": [0.5569, 0.8023, 0.5989, 0.822]}, {"w": "points", "b": [0.6052, 0.8023, 0.6669, 0.822]}, {"w": "in", "b": [0.6732, 0.8023, 0.6928, 0.822]}, {"w": "your", "b": [0.6991, 0.8023, 0.7453, 0.822]}, {"w": "data", "b": [0.7517, 0.8023, 0.7937, 0.822]}, {"w": "appear", "b": [0.8, 0.8023, 0.8672, 0.822]}, {"w": "twice", "b": [0.1799, 0.8228, 0.2345, 0.8425]}, {"w": "(fairly", "b": [0.2408, 0.8228, 0.3038, 0.8425]}, {"w": "common", "b": [0.3102, 0.8228, 0.3984, 0.8425]}, {"w": "with", "b": [0.4048, 0.8228, 0.4496, 0.8425]}, {"w": "real-world", "b": [0.4559, 0.8228, 0.561, 0.8425]}, {"w": "data),", "b": [0.5673, 0.8228, 0.624, 0.8425]}, {"w": "then", "b": [0.6303, 0.8228, 0.6738, 0.8425]}, {"w": "shuffling", "b": [0.6801, 0.8228, 0.7706, 0.8425]}, {"w": "the", "b": [0.7769, 0.8228, 0.8078, 0.8425]}, {"w": "data", "b": [0.8141, 0.8228, 0.8561, 0.8425]}, {"w": "and", "b": [0.1799, 0.8433, 0.2163, 0.863]}, {"w": "splitting", "b": [0.2226, 0.8433, 0.3053, 0.863]}, {"w": "it", "b": [0.3116, 0.8433, 0.3256, 0.863]}, {"w": "into", "b": [0.3319, 0.8433, 0.3712, 0.863]}, {"w": "a", "b": [0.3775, 0.8433, 0.3887, 0.863]}, {"w": "training", "b": [0.395, 0.8433, 0.4735, 0.863]}, {"w": "set", "b": [0.4798, 0.8433, 0.5078, 0.863]}, {"w": "and", "b": [0.5141, 0.8433, 0.5505, 0.863]}, {"w": "a", "b": [0.5568, 0.8433, 0.568, 0.863]}, {"w": "validation", "b": [0.5743, 0.8433, 0.6752, 0.863]}, {"w": "set", "b": [0.6816, 0.8433, 0.7096, 0.863]}, {"w": "will", "b": [0.7159, 0.8433, 0.7551, 0.863]}, {"w": "result", "b": [0.7614, 0.8433, 0.8175, 0.863]}, {"w": "in", "b": [0.8238, 0.8433, 0.8434, 0.863]}, {"w": "redundancy", "b": [0.1799, 0.8638, 0.2975, 0.8835]}, {"w": "between", "b": [0.3038, 0.8638, 0.3879, 0.8835]}, {"w": "the", "b": [0.3942, 0.8638, 0.425, 0.8835]}, {"w": "training", "b": [0.4313, 0.8638, 0.5098, 0.8835]}, {"w": "and", "b": [0.5161, 0.8638, 0.5525, 0.8835]}, {"w": "validation", "b": [0.5589, 0.8638, 0.6598, 0.8835]}, {"w": "sets.", "b": [0.6661, 0.8638, 0.7102, 0.8835]}, {"w": "In", "b": [0.7165, 0.8638, 0.7375, 0.8835]}, {"w": "effect,", "b": [0.7438, 0.8638, 0.807, 0.8835]}, {"w": "you’ll", "b": [0.1799, 0.8843, 0.2401, 0.904]}, {"w": "be", "b": [0.2464, 0.8843, 0.2702, 0.904]}, {"w": "testing", "b": [0.2766, 0.8843, 0.3438, 0.904]}, {"w": "on", "b": [0.3501, 0.8843, 0.3754, 0.904]}, {"w": "part", "b": [0.3817, 0.8843, 0.4209, 0.904]}, {"w": "of", "b": [0.4272, 0.8843, 0.4482, 0.904]}, {"w": "your", "b": [0.4545, 0.8843, 0.5008, 0.904]}, {"w": "training", "b": [0.5071, 0.8843, 0.5855, 0.904]}, {"w": "data,", "b": [0.5919, 0.8843, 0.6402, 0.904]}, {"w": "which", "b": [0.6465, 0.8843, 0.7081, 0.904]}, {"w": "is", "b": [0.7144, 0.8843, 0.7313, 0.904]}, {"w": "the", "b": [0.7376, 0.8843, 0.7684, 0.904]}, {"w": "worst", "b": [0.7747, 0.8843, 0.8308, 0.904]}]}]}, {"page": 149, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "thing you can do! Make sure your training set and validation set are disjoint.", "words": [{"w": "thing", "b": [0.1799, 0.0857, 0.2317, 0.1054]}, {"w": "you", "b": [0.238, 0.0857, 0.2759, 0.1054]}, {"w": "can", "b": [0.2822, 0.0857, 0.3172, 0.1054]}, {"w": "do!", "b": [0.3235, 0.0857, 0.3571, 0.1054]}, {"w": "Make", "b": [0.3634, 0.0857, 0.4209, 0.1054]}, {"w": "sure", "b": [0.4272, 0.0857, 0.4692, 0.1054]}, {"w": "your", "b": [0.4755, 0.0857, 0.5217, 0.1054]}, {"w": "training", "b": [0.5281, 0.0857, 0.6065, 0.1054]}, {"w": "set", "b": [0.6128, 0.0857, 0.6409, 0.1054]}, {"w": "and", "b": [0.6472, 0.0857, 0.6836, 0.1054]}, {"w": "validation", "b": [0.6899, 0.0857, 0.7908, 0.1054]}, {"w": "set", "b": [0.797, 0.0857, 0.8251, 0.1054]}, {"w": "are", "b": [0.8314, 0.0857, 0.8622, 0.1054]}, {"w": "disjoint.", "b": [0.1799, 0.1062, 0.2619, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "4.3. Data preprocessing, feature engineering, and feature learning", "words": [{"w": "4.3.", "b": [0.1294, 0.163, 0.172, 0.1852]}, {"w": "Data", "b": [0.1791, 0.163, 0.2374, 0.1852]}, {"w": "preprocessing,", "b": [0.2445, 0.163, 0.4192, 0.1852]}, {"w": "feature", "b": [0.4263, 0.163, 0.5125, 0.1852]}, {"w": "engineering,", "b": [0.5196, 0.163, 0.6686, 0.1852]}, {"w": "and", "b": [0.6757, 0.163, 0.7214, 0.1852]}, {"w": "feature", "b": [0.7285, 0.163, 0.8147, 0.1852]}, {"w": "learning", "b": [0.1294, 0.1871, 0.2303, 0.2093]}]}, {"id": "b_2", "type": "paragraph", "text": "In addition to model evaluation, an important question we must tackle before we dive deeper into model development is the following: how do you prepare the input data and targets before feeding them into a neural network? Many data-preprocessing and feature-engineering techniques are domain specific (for example, specific to text data or image data); we’ll cover those in the following chapters as we encounter them in practical examples. For now, we’ll review the basics that are common to all data domains.", "words": [{"w": "In", "b": [0.1294, 0.2327, 0.1504, 0.2525]}, {"w": "addition", "b": [0.1567, 0.2327, 0.2394, 0.2525]}, {"w": "to", "b": [0.2457, 0.2327, 0.2654, 0.2525]}, {"w": "model", "b": [0.2717, 0.2327, 0.3347, 0.2525]}, {"w": "evaluation,", "b": [0.341, 0.2327, 0.4524, 0.2525]}, {"w": "an", "b": [0.4587, 0.2327, 0.4825, 0.2525]}, {"w": "important", "b": [0.4889, 0.2327, 0.587, 0.2525]}, {"w": "question", "b": [0.5933, 0.2327, 0.6788, 0.2525]}, {"w": "we", "b": [0.6851, 0.2327, 0.7145, 0.2525]}, {"w": "must", "b": [0.7208, 0.2327, 0.7698, 0.2525]}, {"w": "tackle", "b": [0.7762, 0.2327, 0.8364, 0.2525]}, {"w": "before", "b": [0.1294, 0.2532, 0.1938, 0.273]}, {"w": "we", "b": [0.2001, 0.2532, 0.2296, 0.273]}, {"w": "dive", "b": [0.2359, 0.2532, 0.2793, 0.273]}, {"w": "deeper", "b": [0.2856, 0.2532, 0.3528, 0.273]}, {"w": "into", "b": [0.3591, 0.2532, 0.3984, 0.273]}, {"w": "model", "b": [0.4047, 0.2532, 0.4678, 0.273]}, {"w": "development", "b": [0.4741, 0.2532, 0.6044, 0.273]}, {"w": "is", "b": [0.6107, 0.2532, 0.6275, 0.273]}, {"w": "the", "b": [0.6338, 0.2532, 0.6647, 0.273]}, {"w": "following:", "b": [0.6709, 0.2532, 0.776, 0.273]}, {"w": "how", "b": [0.7823, 0.2532, 0.8257, 0.273]}, {"w": "do", "b": [0.832, 0.2532, 0.8573, 0.273]}, {"w": "you", "b": [0.1294, 0.2737, 0.1673, 0.2935]}, {"w": "prepare", "b": [0.1736, 0.2737, 0.2492, 0.2935]}, {"w": "the", "b": [0.2555, 0.2737, 0.2863, 0.2935]}, {"w": "input", "b": [0.2926, 0.2737, 0.3445, 0.2935]}, {"w": "data", "b": [0.3508, 0.2737, 0.3928, 0.2935]}, {"w": "and", "b": [0.3991, 0.2737, 0.4356, 0.2935]}, {"w": "targets", "b": [0.4419, 0.2737, 0.5086, 0.2935]}, {"w": "before", "b": [0.5149, 0.2737, 0.5793, 0.2935]}, {"w": "feeding", "b": [0.5856, 0.2737, 0.6613, 0.2935]}, {"w": "them", "b": [0.6676, 0.2737, 0.7181, 0.2935]}, {"w": "into", "b": [0.7244, 0.2737, 0.7636, 0.2935]}, {"w": "a", "b": [0.7699, 0.2737, 0.7811, 0.2935]}, {"w": "neural", "b": [0.7874, 0.2737, 0.8505, 0.2935]}, {"w": "network?", "b": [0.1294, 0.2942, 0.2233, 0.314]}, {"w": "Many", "b": [0.2296, 0.2942, 0.2884, 0.314]}, {"w": "data-preprocessing", "b": [0.2947, 0.2942, 0.4853, 0.314]}, {"w": "and", "b": [0.4915, 0.2942, 0.528, 0.314]}, {"w": "feature-engineering", "b": [0.5343, 0.2942, 0.7318, 0.314]}, {"w": "techniques", "b": [0.7381, 0.2942, 0.846, 0.314]}, {"w": "are", "b": [0.1294, 0.3147, 0.1602, 0.3345]}, {"w": "domain", "b": [0.1665, 0.3147, 0.2422, 0.3345]}, {"w": "specific", "b": [0.2485, 0.3147, 0.327, 0.3345]}, {"w": "(for", "b": [0.3333, 0.3147, 0.3711, 0.3345]}, {"w": "example,", "b": [0.3774, 0.3147, 0.4692, 0.3345]}, {"w": "specific", "b": [0.4755, 0.3147, 0.5539, 0.3345]}, {"w": "to", "b": [0.5602, 0.3147, 0.5798, 0.3345]}, {"w": "text", "b": [0.5861, 0.3147, 0.624, 0.3345]}, {"w": "data", "b": [0.6303, 0.3147, 0.6723, 0.3345]}, {"w": "or", "b": [0.6786, 0.3147, 0.6996, 0.3345]}, {"w": "image", "b": [0.7059, 0.3147, 0.7676, 0.3345]}, {"w": "data);", "b": [0.7739, 0.3147, 0.8313, 0.3345]}, {"w": "we’ll", "b": [0.1294, 0.3352, 0.1813, 0.355]}, {"w": "cover", "b": [0.1876, 0.3352, 0.2436, 0.355]}, {"w": "those", "b": [0.2499, 0.3352, 0.3031, 0.355]}, {"w": "in", "b": [0.3094, 0.3352, 0.329, 0.355]}, {"w": "the", "b": [0.3354, 0.3352, 0.3662, 0.355]}, {"w": "following", "b": [0.3725, 0.3352, 0.4706, 0.355]}, {"w": "chapters", "b": [0.4769, 0.3352, 0.5609, 0.355]}, {"w": "as", "b": [0.5673, 0.3352, 0.5883, 0.355]}, {"w": "we", "b": [0.5946, 0.3352, 0.624, 0.355]}, {"w": "encounter", "b": [0.6303, 0.3352, 0.7298, 0.355]}, {"w": "them", "b": [0.7361, 0.3352, 0.7865, 0.355]}, {"w": "in", "b": [0.7928, 0.3352, 0.8124, 0.355]}, {"w": "practical", "b": [0.1294, 0.3557, 0.2163, 0.3755]}, {"w": "examples.", "b": [0.2226, 0.3557, 0.3242, 0.3755]}, {"w": "For", "b": [0.3305, 0.3557, 0.3655, 0.3755]}, {"w": "now,", "b": [0.3718, 0.3557, 0.4199, 0.3755]}, {"w": "we’ll", "b": [0.4262, 0.3557, 0.478, 0.3755]}, {"w": "review", "b": [0.4843, 0.3557, 0.553, 0.3755]}, {"w": "the", "b": [0.5593, 0.3557, 0.5901, 0.3755]}, {"w": "basics", "b": [0.5964, 0.3557, 0.6581, 0.3755]}, {"w": "that", "b": [0.6644, 0.3557, 0.7022, 0.3755]}, {"w": "are", "b": [0.7085, 0.3557, 0.7393, 0.3755]}, {"w": "common", "b": [0.7456, 0.3557, 0.8339, 0.3755]}, {"w": "to", "b": [0.8402, 0.3557, 0.8598, 0.3755]}, {"w": "all", "b": [0.1294, 0.3762, 0.1546, 0.396]}, {"w": "data", "b": [0.1609, 0.3762, 0.203, 0.396]}, {"w": "domains.", "b": [0.2093, 0.3762, 0.3011, 0.396]}]}, {"id": "b_3", "type": "paragraph", "text": "4.3.1. Data preprocessing for neural networks", "words": [{"w": "4.3.1.", "b": [0.1294, 0.4235, 0.1862, 0.4432]}, {"w": "Data", "b": [0.1925, 0.4235, 0.2443, 0.4432]}, {"w": "preprocessing", "b": [0.2506, 0.4235, 0.3997, 0.4432]}, {"w": "for", "b": [0.406, 0.4235, 0.4382, 0.4432]}, {"w": "neural", "b": [0.4445, 0.4235, 0.5146, 0.4432]}, {"w": "networks", "b": [0.5209, 0.4235, 0.6204, 0.4432]}]}, {"id": "b_4", "type": "paragraph", "text": "Data preprocessing aims at making the raw data at hand more amenable to neural networks. This includes vectorization, normalization, handling missing values, and feature extraction.", "words": [{"w": "Data", "b": [0.1294, 0.4663, 0.177, 0.486]}, {"w": "preprocessing", "b": [0.1833, 0.4663, 0.3234, 0.486]}, {"w": "aims", "b": [0.3298, 0.4663, 0.3774, 0.486]}, {"w": "at", "b": [0.3837, 0.4663, 0.4019, 0.486]}, {"w": "making", "b": [0.4082, 0.4663, 0.4839, 0.486]}, {"w": "the", "b": [0.4902, 0.4663, 0.521, 0.486]}, {"w": "raw", "b": [0.5273, 0.4663, 0.5652, 0.486]}, {"w": "data", "b": [0.5715, 0.4663, 0.6135, 0.486]}, {"w": "at", "b": [0.6198, 0.4663, 0.638, 0.486]}, {"w": "hand", "b": [0.6443, 0.4663, 0.6934, 0.486]}, {"w": "more", "b": [0.6997, 0.4663, 0.7515, 0.486]}, {"w": "amenable", "b": [0.7578, 0.4663, 0.8545, 0.486]}, {"w": "to", "b": [0.1294, 0.4868, 0.149, 0.5065]}, {"w": "neural", "b": [0.1553, 0.4868, 0.2184, 0.5065]}, {"w": "networks.", "b": [0.2247, 0.4868, 0.3235, 0.5065]}, {"w": "This", "b": [0.3298, 0.4868, 0.3746, 0.5065]}, {"w": "includes", "b": [0.3809, 0.4868, 0.465, 0.5065]}, {"w": "vectorization,", "b": [0.4713, 0.4868, 0.6093, 0.5065]}, {"w": "normalization,", "b": [0.6156, 0.4868, 0.7621, 0.5065]}, {"w": "handling", "b": [0.7683, 0.4868, 0.8566, 0.5065]}, {"w": "missing", "b": [0.1294, 0.5073, 0.2079, 0.527]}, {"w": "values,", "b": [0.2142, 0.5073, 0.285, 0.527]}, {"w": "and", "b": [0.2913, 0.5073, 0.3277, 0.527]}, {"w": "feature", "b": [0.334, 0.5073, 0.404, 0.527]}, {"w": "extraction.", "b": [0.4104, 0.5073, 0.5175, 0.527]}]}, {"id": "b_5", "type": "paragraph", "text": "Vectorization", "words": [{"w": "Vectorization", "b": [0.1294, 0.5451, 0.237, 0.5599]}]}, {"id": "b_6", "type": "paragraph", "text": "All inputs and targets in a neural network must be tensors of floating- point data (or, in specific cases, tensors of integers). Whatever data you need to process—sound, images, text—you must first turn into tensors, a step called data vectorization. For instance, in the two previous text- classification examples, we started from text represented as lists of integers (standing for sequences of words), and we used one-hot encoding to turn them into a tensor of float32 data. In the examples of classifying digits and predicting house prices, the data already came in vectorized form, so you were able to skip this step.", "words": [{"w": "All", "b": [0.1294, 0.583, 0.1617, 0.6028]}, {"w": "inputs", "b": [0.168, 0.583, 0.2296, 0.6028]}, {"w": "and", "b": [0.2359, 0.583, 0.2724, 0.6028]}, {"w": "targets", "b": [0.2787, 0.583, 0.3454, 0.6028]}, {"w": "in", "b": [0.3518, 0.583, 0.3714, 0.6028]}, {"w": "a", "b": [0.3777, 0.583, 0.3889, 0.6028]}, {"w": "neural", "b": [0.3952, 0.583, 0.4582, 0.6028]}, {"w": "network", "b": [0.4645, 0.583, 0.5472, 0.6028]}, {"w": "must", "b": [0.5535, 0.583, 0.6026, 0.6028]}, {"w": "be", "b": [0.6089, 0.583, 0.6327, 0.6028]}, {"w": "tensors", "b": [0.639, 0.583, 0.7105, 0.6028]}, {"w": "of", "b": [0.7168, 0.583, 0.7378, 0.6028]}, {"w": "floating-", "b": [0.7441, 0.583, 0.831, 0.6028]}, {"w": "point", "b": [0.1294, 0.6035, 0.1813, 0.6233]}, {"w": "data", "b": [0.1876, 0.6035, 0.2296, 0.6233]}, {"w": "(or,", "b": [0.2359, 0.6035, 0.2706, 0.6233]}, {"w": "in", "b": [0.2769, 0.6035, 0.2965, 0.6233]}, {"w": "specific", "b": [0.3028, 0.6035, 0.3813, 0.6233]}, {"w": "cases,", "b": [0.3876, 0.6035, 0.4471, 0.6233]}, {"w": "tensors", "b": [0.4534, 0.6035, 0.5249, 0.6233]}, {"w": "of", "b": [0.5312, 0.6035, 0.5522, 0.6233]}, {"w": "integers).", "b": [0.5585, 0.6035, 0.6531, 0.6233]}, {"w": "Whatever", "b": [0.6594, 0.6035, 0.7574, 0.6233]}, {"w": "data", "b": [0.7637, 0.6035, 0.8058, 0.6233]}, {"w": "you", "b": [0.8121, 0.6035, 0.8499, 0.6233]}, {"w": "need", "b": [0.1294, 0.624, 0.177, 0.6438]}, {"w": "to", "b": [0.1833, 0.624, 0.203, 0.6438]}, {"w": "process—sound,", "b": [0.2093, 0.624, 0.3767, 0.6438]}, {"w": "images,", "b": [0.383, 0.624, 0.4608, 0.6438]}, {"w": "text—you", "b": [0.4671, 0.624, 0.568, 0.6438]}, {"w": "must", "b": [0.5743, 0.624, 0.6234, 0.6438]}, {"w": "first", "b": [0.6297, 0.624, 0.6703, 0.6438]}, {"w": "turn", "b": [0.6766, 0.624, 0.7173, 0.6438]}, {"w": "into", "b": [0.7236, 0.624, 0.7628, 0.6438]}, {"w": "tensors,", "b": [0.7691, 0.624, 0.8469, 0.6438]}, {"w": "a", "b": [0.8532, 0.624, 0.8644, 0.6438]}, {"w": "step", "b": [0.1294, 0.6445, 0.1701, 0.6643]}, {"w": "called", "b": [0.1764, 0.6445, 0.2366, 0.6643]}, {"w": "data", "b": [0.2429, 0.6445, 0.2877, 0.6643]}, {"w": "vectorization.", "b": [0.294, 0.6445, 0.432, 0.6643]}, {"w": "For", "b": [0.4383, 0.6445, 0.4734, 0.6643]}, {"w": "instance,", "b": [0.4797, 0.6445, 0.5686, 0.6643]}, {"w": "in", "b": [0.575, 0.6445, 0.5946, 0.6643]}, {"w": "the", "b": [0.6009, 0.6445, 0.6317, 0.6643]}, {"w": "two", "b": [0.638, 0.6445, 0.6759, 0.6643]}, {"w": "previous", "b": [0.6822, 0.6445, 0.769, 0.6643]}, {"w": "text-", "b": [0.7753, 0.6445, 0.8216, 0.6643]}, {"w": "classification", "b": [0.1294, 0.665, 0.2625, 0.6848]}, {"w": "examples,", "b": [0.2688, 0.665, 0.3704, 0.6848]}, {"w": "we", "b": [0.3767, 0.665, 0.4061, 0.6848]}, {"w": "started", "b": [0.4124, 0.665, 0.4797, 0.6848]}, {"w": "from", "b": [0.486, 0.665, 0.535, 0.6848]}, {"w": "text", "b": [0.5413, 0.665, 0.5792, 0.6848]}, {"w": "represented", "b": [0.5855, 0.665, 0.7018, 0.6848]}, {"w": "as", "b": [0.7081, 0.665, 0.7291, 0.6848]}, {"w": "lists", "b": [0.7354, 0.665, 0.776, 0.6848]}, {"w": "of", "b": [0.7824, 0.665, 0.8034, 0.6848]}, {"w": "integers", "b": [0.1294, 0.6855, 0.2093, 0.7053]}, {"w": "(standing", "b": [0.2156, 0.6855, 0.3095, 0.7053]}, {"w": "for", "b": [0.3157, 0.6855, 0.3452, 0.7053]}, {"w": "sequences", "b": [0.3515, 0.6855, 0.4537, 0.7053]}, {"w": "of", "b": [0.46, 0.6855, 0.4811, 0.7053]}, {"w": "words),", "b": [0.4874, 0.6855, 0.5637, 0.7053]}, {"w": "and", "b": [0.57, 0.6855, 0.6064, 0.7053]}, {"w": "we", "b": [0.6128, 0.6855, 0.6422, 0.7053]}, {"w": "used", "b": [0.6485, 0.6855, 0.6947, 0.7053]}, {"w": "one-hot", "b": [0.701, 0.6855, 0.7781, 0.7053]}, {"w": "encoding", "b": [0.1294, 0.706, 0.2219, 0.7258]}, {"w": "to", "b": [0.2282, 0.706, 0.2478, 0.7258]}, {"w": "turn", "b": [0.2541, 0.706, 0.2948, 0.7258]}, {"w": "them", "b": [0.3011, 0.706, 0.3515, 0.7258]}, {"w": "into", "b": [0.3578, 0.706, 0.3971, 0.7258]}, {"w": "a", "b": [0.4034, 0.706, 0.4146, 0.7258]}, {"w": "tensor", "b": [0.4209, 0.706, 0.4825, 0.7258]}, {"w": "of", "b": [0.4889, 0.706, 0.5099, 0.7258]}, {"w": "float32", "b": [0.5161, 0.7071, 0.6221, 0.7273]}, {"w": "data.", "b": [0.6284, 0.706, 0.6767, 0.7258]}, {"w": "In", "b": [0.683, 0.706, 0.704, 0.7258]}, {"w": "the", "b": [0.7103, 0.706, 0.7412, 0.7258]}, {"w": "examples", "b": [0.7475, 0.706, 0.8427, 0.7258]}, {"w": "of", "b": [0.849, 0.706, 0.8701, 0.7258]}, {"w": "classifying", "b": [0.1294, 0.7274, 0.2387, 0.7472]}, {"w": "digits", "b": [0.245, 0.7274, 0.3011, 0.7472]}, {"w": "and", "b": [0.3074, 0.7274, 0.3438, 0.7472]}, {"w": "predicting", "b": [0.3501, 0.7274, 0.4524, 0.7472]}, {"w": "house", "b": [0.4587, 0.7274, 0.5176, 0.7472]}, {"w": "prices,", "b": [0.5239, 0.7274, 0.5904, 0.7472]}, {"w": "the", "b": [0.5967, 0.7274, 0.6276, 0.7472]}, {"w": "data", "b": [0.6339, 0.7274, 0.6759, 0.7472]}, {"w": "already", "b": [0.6822, 0.7274, 0.7564, 0.7472]}, {"w": "came", "b": [0.7628, 0.7274, 0.816, 0.7472]}, {"w": "in", "b": [0.8223, 0.7274, 0.8419, 0.7472]}, {"w": "vectorized", "b": [0.1294, 0.7479, 0.2345, 0.7677]}, {"w": "form,", "b": [0.2408, 0.7479, 0.2961, 0.7677]}, {"w": "so", "b": [0.3024, 0.7479, 0.3249, 0.7677]}, {"w": "you", "b": [0.3312, 0.7479, 0.369, 0.7677]}, {"w": "were", "b": [0.3753, 0.7479, 0.4243, 0.7677]}, {"w": "able", "b": [0.4306, 0.7479, 0.4726, 0.7677]}, {"w": "to", "b": [0.4789, 0.7479, 0.4986, 0.7677]}, {"w": "skip", "b": [0.5049, 0.7479, 0.5469, 0.7677]}, {"w": "this", "b": [0.5532, 0.7479, 0.5897, 0.7677]}, {"w": "step.", "b": [0.596, 0.7479, 0.6429, 0.7677]}]}, {"id": "b_7", "type": "paragraph", "text": "Value normalization", "words": [{"w": "Value", "b": [0.1294, 0.7858, 0.175, 0.8006]}, {"w": "normalization", "b": [0.1797, 0.7858, 0.2932, 0.8006]}]}, {"id": "b_8", "type": "paragraph", "text": "In the digit-classification example, you started from image data encoded as integers in the 0–255 range, encoding grayscale values. Before you fed this data into your network, you had to cast it to float32 and divide by 255 so you’d end up with floating-point values in the 0–1", "words": [{"w": "In", "b": [0.1294, 0.8237, 0.1504, 0.8434]}, {"w": "the", "b": [0.1567, 0.8237, 0.1876, 0.8434]}, {"w": "digit-classification", "b": [0.1939, 0.8237, 0.3816, 0.8434]}, {"w": "example,", "b": [0.388, 0.8237, 0.4797, 0.8434]}, {"w": "you", "b": [0.486, 0.8237, 0.5239, 0.8434]}, {"w": "started", "b": [0.5302, 0.8237, 0.5974, 0.8434]}, {"w": "from", "b": [0.6037, 0.8237, 0.6528, 0.8434]}, {"w": "image", "b": [0.6591, 0.8237, 0.7207, 0.8434]}, {"w": "data", "b": [0.727, 0.8237, 0.7691, 0.8434]}, {"w": "encoded", "b": [0.7754, 0.8237, 0.8594, 0.8434]}, {"w": "as", "b": [0.1294, 0.8442, 0.1504, 0.8639]}, {"w": "integers", "b": [0.1567, 0.8442, 0.2366, 0.8639]}, {"w": "in", "b": [0.2429, 0.8442, 0.2625, 0.8639]}, {"w": "the", "b": [0.2688, 0.8442, 0.2997, 0.8639]}, {"w": "0–255", "b": [0.306, 0.8442, 0.369, 0.8639]}, {"w": "range,", "b": [0.3753, 0.8442, 0.4377, 0.8639]}, {"w": "encoding", "b": [0.444, 0.8442, 0.5365, 0.8639]}, {"w": "grayscale", "b": [0.5428, 0.8442, 0.638, 0.8639]}, {"w": "values.", "b": [0.6443, 0.8442, 0.715, 0.8639]}, {"w": "Before", "b": [0.7213, 0.8442, 0.79, 0.8639]}, {"w": "you", "b": [0.7963, 0.8442, 0.8341, 0.8639]}, {"w": "fed", "b": [0.1294, 0.8647, 0.1616, 0.8844]}, {"w": "this", "b": [0.1679, 0.8647, 0.2044, 0.8844]}, {"w": "data", "b": [0.2107, 0.8647, 0.2527, 0.8844]}, {"w": "into", "b": [0.259, 0.8647, 0.2983, 0.8844]}, {"w": "your", "b": [0.3046, 0.8647, 0.3508, 0.8844]}, {"w": "network,", "b": [0.3571, 0.8647, 0.4461, 0.8844]}, {"w": "you", "b": [0.4524, 0.8647, 0.4902, 0.8844]}, {"w": "had", "b": [0.4965, 0.8647, 0.533, 0.8844]}, {"w": "to", "b": [0.5393, 0.8647, 0.5589, 0.8844]}, {"w": "cast", "b": [0.5652, 0.8647, 0.6044, 0.8844]}, {"w": "it", "b": [0.6107, 0.8647, 0.6248, 0.8844]}, {"w": "to", "b": [0.6311, 0.8647, 0.6507, 0.8844]}, {"w": "float32", "b": [0.6569, 0.8657, 0.7629, 0.8859]}, {"w": "and", "b": [0.7692, 0.8647, 0.8056, 0.8844]}, {"w": "divide", "b": [0.1294, 0.8861, 0.1925, 0.9058]}, {"w": "by", "b": [0.1988, 0.8861, 0.224, 0.9058]}, {"w": "255", "b": [0.2303, 0.8861, 0.2682, 0.9058]}, {"w": "so", "b": [0.2745, 0.8861, 0.2969, 0.9058]}, {"w": "you’d", "b": [0.3032, 0.8861, 0.362, 0.9058]}, {"w": "end", "b": [0.3684, 0.8861, 0.4048, 0.9058]}, {"w": "up", "b": [0.4111, 0.8861, 0.4363, 0.9058]}, {"w": "with", "b": [0.4426, 0.8861, 0.4875, 0.9058]}, {"w": "floating-point", "b": [0.4938, 0.8861, 0.6325, 0.9058]}, {"w": "values", "b": [0.6388, 0.8861, 0.7033, 0.9058]}, {"w": "in", "b": [0.7096, 0.8861, 0.7292, 0.9058]}, {"w": "the", "b": [0.7355, 0.8861, 0.7663, 0.9058]}, {"w": "0–1", "b": [0.7726, 0.8861, 0.8105, 0.9058]}]}]}, {"page": 150, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "range. Similarly, when predicting house prices, you started from features that took a variety of ranges—some features had small floating-point values, others had fairly large integer values. Before you fed this data into your network, you had to normalize each feature independently so that it had a standard deviation of 1 and a mean of 0.", "words": [{"w": "range.", "b": [0.1294, 0.0857, 0.1917, 0.1054]}, {"w": "Similarly,", "b": [0.1981, 0.0857, 0.2966, 0.1054]}, {"w": "when", "b": [0.3029, 0.0857, 0.3576, 0.1054]}, {"w": "predicting", "b": [0.3639, 0.0857, 0.4661, 0.1054]}, {"w": "house", "b": [0.4725, 0.0857, 0.5313, 0.1054]}, {"w": "prices,", "b": [0.5376, 0.0857, 0.6042, 0.1054]}, {"w": "you", "b": [0.6105, 0.0857, 0.6483, 0.1054]}, {"w": "started", "b": [0.6546, 0.0857, 0.7218, 0.1054]}, {"w": "from", "b": [0.7281, 0.0857, 0.7772, 0.1054]}, {"w": "features", "b": [0.7835, 0.0857, 0.8633, 0.1054]}, {"w": "that", "b": [0.1294, 0.1062, 0.1673, 0.1259]}, {"w": "took", "b": [0.1736, 0.1062, 0.2184, 0.1259]}, {"w": "a", "b": [0.2247, 0.1062, 0.2359, 0.1259]}, {"w": "variety", "b": [0.2422, 0.1062, 0.3123, 0.1259]}, {"w": "of", "b": [0.3186, 0.1062, 0.3396, 0.1259]}, {"w": "ranges—some", "b": [0.3459, 0.1062, 0.4902, 0.1259]}, {"w": "features", "b": [0.4965, 0.1062, 0.5764, 0.1259]}, {"w": "had", "b": [0.5827, 0.1062, 0.6191, 0.1259]}, {"w": "small", "b": [0.6254, 0.1062, 0.6801, 0.1259]}, {"w": "floating-point", "b": [0.6864, 0.1062, 0.8251, 0.1259]}, {"w": "values,", "b": [0.1294, 0.1267, 0.2002, 0.1464]}, {"w": "others", "b": [0.2065, 0.1267, 0.2681, 0.1464]}, {"w": "had", "b": [0.2744, 0.1267, 0.3109, 0.1464]}, {"w": "fairly", "b": [0.3172, 0.1267, 0.3718, 0.1464]}, {"w": "large", "b": [0.3781, 0.1267, 0.428, 0.1464]}, {"w": "integer", "b": [0.4343, 0.1267, 0.5044, 0.1464]}, {"w": "values.", "b": [0.5107, 0.1267, 0.5815, 0.1464]}, {"w": "Before", "b": [0.5878, 0.1267, 0.6564, 0.1464]}, {"w": "you", "b": [0.6627, 0.1267, 0.7006, 0.1464]}, {"w": "fed", "b": [0.7069, 0.1267, 0.7391, 0.1464]}, {"w": "this", "b": [0.7454, 0.1267, 0.7818, 0.1464]}, {"w": "data", "b": [0.7881, 0.1267, 0.8302, 0.1464]}, {"w": "into", "b": [0.1294, 0.1472, 0.1687, 0.1669]}, {"w": "your", "b": [0.175, 0.1472, 0.2212, 0.1669]}, {"w": "network,", "b": [0.2275, 0.1472, 0.3165, 0.1669]}, {"w": "you", "b": [0.3228, 0.1472, 0.3606, 0.1669]}, {"w": "had", "b": [0.3669, 0.1472, 0.4034, 0.1669]}, {"w": "to", "b": [0.4097, 0.1472, 0.4293, 0.1669]}, {"w": "normalize", "b": [0.4356, 0.1472, 0.5365, 0.1669]}, {"w": "each", "b": [0.5428, 0.1472, 0.589, 0.1669]}, {"w": "feature", "b": [0.5953, 0.1472, 0.6653, 0.1669]}, {"w": "independently", "b": [0.6716, 0.1472, 0.8146, 0.1669]}, {"w": "so", "b": [0.8209, 0.1472, 0.8433, 0.1669]}, {"w": "that", "b": [0.1294, 0.1677, 0.1673, 0.1874]}, {"w": "it", "b": [0.1736, 0.1677, 0.1876, 0.1874]}, {"w": "had", "b": [0.1939, 0.1677, 0.2303, 0.1874]}, {"w": "a", "b": [0.2366, 0.1677, 0.2478, 0.1874]}, {"w": "standard", "b": [0.2541, 0.1677, 0.3396, 0.1874]}, {"w": "deviation", "b": [0.3459, 0.1677, 0.4398, 0.1874]}, {"w": "of", "b": [0.4461, 0.1677, 0.4671, 0.1874]}, {"w": "1", "b": [0.4734, 0.1677, 0.486, 0.1874]}, {"w": "and", "b": [0.4923, 0.1677, 0.5287, 0.1874]}, {"w": "a", "b": [0.535, 0.1677, 0.5462, 0.1874]}, {"w": "mean", "b": [0.5525, 0.1677, 0.6072, 0.1874]}, {"w": "of", "b": [0.6135, 0.1677, 0.6345, 0.1874]}, {"w": "0.", "b": [0.6408, 0.1677, 0.6597, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "In general, it isn’t safe to feed into a neural network data that takes relatively large values (for example, multidigit integers, which are much larger than the initial values taken by the weights of a network) or data that is heterogeneous (for example, data where one feature is in the range 0–1 and another is in the range 100–200). Doing so can trigger large gradient updates that will prevent the network from converging. To make learning easier for your network, your data should have the following characteristics:", "words": [{"w": "In", "b": [0.1294, 0.2105, 0.1504, 0.2302]}, {"w": "general,", "b": [0.1567, 0.2105, 0.2373, 0.2302]}, {"w": "it", "b": [0.2436, 0.2105, 0.2576, 0.2302]}, {"w": "isn’t", "b": [0.2639, 0.2105, 0.3083, 0.2302]}, {"w": "safe", "b": [0.3146, 0.2105, 0.3552, 0.2302]}, {"w": "to", "b": [0.3615, 0.2105, 0.3811, 0.2302]}, {"w": "feed", "b": [0.3874, 0.2105, 0.4309, 0.2302]}, {"w": "into", "b": [0.4372, 0.2105, 0.4764, 0.2302]}, {"w": "a", "b": [0.4827, 0.2105, 0.4939, 0.2302]}, {"w": "neural", "b": [0.5002, 0.2105, 0.5633, 0.2302]}, {"w": "network", "b": [0.5696, 0.2105, 0.6522, 0.2302]}, {"w": "data", "b": [0.6585, 0.2105, 0.7006, 0.2302]}, {"w": "that", "b": [0.7069, 0.2105, 0.7447, 0.2302]}, {"w": "takes", "b": [0.751, 0.2105, 0.8029, 0.2302]}, {"w": "relatively", "b": [0.1294, 0.231, 0.2247, 0.2507]}, {"w": "large", "b": [0.231, 0.231, 0.2809, 0.2507]}, {"w": "values", "b": [0.2872, 0.231, 0.3517, 0.2507]}, {"w": "(for", "b": [0.358, 0.231, 0.3958, 0.2507]}, {"w": "example,", "b": [0.4021, 0.231, 0.4939, 0.2507]}, {"w": "multidigit", "b": [0.5002, 0.231, 0.5997, 0.2507]}, {"w": "integers,", "b": [0.606, 0.231, 0.6922, 0.2507]}, {"w": "which", "b": [0.6984, 0.231, 0.7601, 0.2507]}, {"w": "are", "b": [0.7664, 0.231, 0.7972, 0.2507]}, {"w": "much", "b": [0.8035, 0.231, 0.8595, 0.2507]}, {"w": "larger", "b": [0.1294, 0.2515, 0.1878, 0.2712]}, {"w": "than", "b": [0.1941, 0.2515, 0.2375, 0.2712]}, {"w": "the", "b": [0.2438, 0.2515, 0.2747, 0.2712]}, {"w": "initial", "b": [0.281, 0.2515, 0.3398, 0.2712]}, {"w": "values", "b": [0.3461, 0.2515, 0.4106, 0.2712]}, {"w": "taken", "b": [0.4169, 0.2515, 0.4715, 0.2712]}, {"w": "by", "b": [0.4778, 0.2515, 0.5031, 0.2712]}, {"w": "the", "b": [0.5094, 0.2515, 0.5402, 0.2712]}, {"w": "weights", "b": [0.5465, 0.2515, 0.625, 0.2712]}, {"w": "of", "b": [0.6313, 0.2515, 0.6523, 0.2712]}, {"w": "a", "b": [0.6586, 0.2515, 0.6698, 0.2712]}, {"w": "network)", "b": [0.6761, 0.2515, 0.7672, 0.2712]}, {"w": "or", "b": [0.7735, 0.2515, 0.7945, 0.2712]}, {"w": "data", "b": [0.8008, 0.2515, 0.8428, 0.2712]}, {"w": "that", "b": [0.1294, 0.272, 0.1673, 0.2917]}, {"w": "is", "b": [0.1736, 0.272, 0.1904, 0.2917]}, {"w": "heterogeneous", "b": [0.1967, 0.272, 0.3424, 0.2917]}, {"w": "(for", "b": [0.3487, 0.272, 0.3865, 0.2917]}, {"w": "example,", "b": [0.3928, 0.272, 0.4846, 0.2917]}, {"w": "data", "b": [0.4908, 0.272, 0.5329, 0.2917]}, {"w": "where", "b": [0.5392, 0.272, 0.6008, 0.2917]}, {"w": "one", "b": [0.6071, 0.272, 0.6435, 0.2917]}, {"w": "feature", "b": [0.6498, 0.272, 0.7199, 0.2917]}, {"w": "is", "b": [0.7262, 0.272, 0.743, 0.2917]}, {"w": "in", "b": [0.7493, 0.272, 0.7689, 0.2917]}, {"w": "the", "b": [0.7752, 0.272, 0.8061, 0.2917]}, {"w": "range", "b": [0.8124, 0.272, 0.8684, 0.2917]}, {"w": "0–1", "b": [0.1294, 0.2925, 0.1673, 0.3122]}, {"w": "and", "b": [0.1736, 0.2925, 0.21, 0.3122]}, {"w": "another", "b": [0.2163, 0.2925, 0.2919, 0.3122]}, {"w": "is", "b": [0.2982, 0.2925, 0.3151, 0.3122]}, {"w": "in", "b": [0.3214, 0.2925, 0.341, 0.3122]}, {"w": "the", "b": [0.3473, 0.2925, 0.3781, 0.3122]}, {"w": "range", "b": [0.3844, 0.2925, 0.4405, 0.3122]}, {"w": "100–200).", "b": [0.4468, 0.2925, 0.5498, 0.3122]}, {"w": "Doing", "b": [0.5561, 0.2925, 0.6191, 0.3122]}, {"w": "so", "b": [0.6255, 0.2925, 0.6479, 0.3122]}, {"w": "can", "b": [0.6542, 0.2925, 0.6892, 0.3122]}, {"w": "trigger", "b": [0.6955, 0.2925, 0.7628, 0.3122]}, {"w": "large", "b": [0.7691, 0.2925, 0.819, 0.3122]}, {"w": "gradient", "b": [0.1294, 0.313, 0.2121, 0.3327]}, {"w": "updates", "b": [0.2184, 0.313, 0.2954, 0.3327]}, {"w": "that", "b": [0.3017, 0.313, 0.3396, 0.3327]}, {"w": "will", "b": [0.3459, 0.313, 0.3851, 0.3327]}, {"w": "prevent", "b": [0.3914, 0.313, 0.4671, 0.3327]}, {"w": "the", "b": [0.4734, 0.313, 0.5042, 0.3327]}, {"w": "network", "b": [0.5105, 0.313, 0.5932, 0.3327]}, {"w": "from", "b": [0.5995, 0.313, 0.6485, 0.3327]}, {"w": "converging.", "b": [0.6548, 0.313, 0.7741, 0.3327]}, {"w": "To", "b": [0.7804, 0.313, 0.8067, 0.3327]}, {"w": "make", "b": [0.813, 0.313, 0.8676, 0.3327]}, {"w": "learning", "b": [0.1294, 0.3335, 0.2121, 0.3532]}, {"w": "easier", "b": [0.2184, 0.3335, 0.2772, 0.3532]}, {"w": "for", "b": [0.2835, 0.3335, 0.3129, 0.3532]}, {"w": "your", "b": [0.3192, 0.3335, 0.3655, 0.3532]}, {"w": "network,", "b": [0.3718, 0.3335, 0.4608, 0.3532]}, {"w": "your", "b": [0.4671, 0.3335, 0.5133, 0.3532]}, {"w": "data", "b": [0.5196, 0.3335, 0.5616, 0.3532]}, {"w": "should", "b": [0.5679, 0.3335, 0.6352, 0.3532]}, {"w": "have", "b": [0.6415, 0.3335, 0.6891, 0.3532]}, {"w": "the", "b": [0.6955, 0.3335, 0.7263, 0.3532]}, {"w": "following", "b": [0.7326, 0.3335, 0.8307, 0.3532]}, {"w": "characteristics:", "b": [0.1294, 0.354, 0.2807, 0.3737]}]}, {"id": "b_2", "type": "paragraph", "text": "Take small values— Typically, most values should be in the 0–1 range. Be homogenous— That is, all features should take values in roughly the same range.", "words": [{"w": "Take", "b": [0.1799, 0.3923, 0.2294, 0.412]}, {"w": "small", "b": [0.2357, 0.3923, 0.2918, 0.412]}, {"w": "values—", "b": [0.2981, 0.3923, 0.3892, 0.412]}, {"w": "Typically,", "b": [0.3954, 0.3923, 0.495, 0.412]}, {"w": "most", "b": [0.5013, 0.3923, 0.5504, 0.412]}, {"w": "values", "b": [0.5567, 0.3923, 0.6211, 0.412]}, {"w": "should", "b": [0.6275, 0.3923, 0.6947, 0.412]}, {"w": "be", "b": [0.701, 0.3923, 0.7248, 0.412]}, {"w": "in", "b": [0.7312, 0.3923, 0.7508, 0.412]}, {"w": "the", "b": [0.7571, 0.3923, 0.7879, 0.412]}, {"w": "0–1", "b": [0.7942, 0.3923, 0.8321, 0.412]}, {"w": "range.", "b": [0.1799, 0.4128, 0.2422, 0.4325]}, {"w": "Be", "b": [0.1799, 0.4333, 0.2079, 0.453]}, {"w": "homogenous—", "b": [0.2142, 0.4333, 0.3726, 0.453]}, {"w": "That", "b": [0.3789, 0.4333, 0.4251, 0.453]}, {"w": "is,", "b": [0.4314, 0.4333, 0.4546, 0.453]}, {"w": "all", "b": [0.4609, 0.4333, 0.4861, 0.453]}, {"w": "features", "b": [0.4924, 0.4333, 0.5722, 0.453]}, {"w": "should", "b": [0.5786, 0.4333, 0.6458, 0.453]}, {"w": "take", "b": [0.6521, 0.4333, 0.6942, 0.453]}, {"w": "values", "b": [0.7005, 0.4333, 0.7649, 0.453]}, {"w": "in", "b": [0.7712, 0.4333, 0.7909, 0.453]}, {"w": "roughly", "b": [0.1799, 0.4538, 0.2583, 0.4735]}, {"w": "the", "b": [0.2646, 0.4538, 0.2955, 0.4735]}, {"w": "same", "b": [0.3018, 0.4538, 0.3536, 0.4735]}, {"w": "range.", "b": [0.3599, 0.4538, 0.4223, 0.4735]}]}, {"id": "b_3", "type": "paragraph", "text": "Additionally, the following stricter normalization practice is common and can help, although it isn’t always necessary (for example, you didn’t do this in the digit-classification example):", "words": [{"w": "Additionally,", "b": [0.1294, 0.4966, 0.2616, 0.5163]}, {"w": "the", "b": [0.2679, 0.4966, 0.2987, 0.5163]}, {"w": "following", "b": [0.305, 0.4966, 0.4031, 0.5163]}, {"w": "stricter", "b": [0.4094, 0.4966, 0.4795, 0.5163]}, {"w": "normalization", "b": [0.4858, 0.4966, 0.6259, 0.5163]}, {"w": "practice", "b": [0.6322, 0.4966, 0.7121, 0.5163]}, {"w": "is", "b": [0.7184, 0.4966, 0.7352, 0.5163]}, {"w": "common", "b": [0.7415, 0.4966, 0.8298, 0.5163]}, {"w": "and", "b": [0.1294, 0.5171, 0.1658, 0.5368]}, {"w": "can", "b": [0.1721, 0.5171, 0.2072, 0.5368]}, {"w": "help,", "b": [0.2135, 0.5171, 0.2632, 0.5368]}, {"w": "although", "b": [0.2695, 0.5171, 0.3578, 0.5368]}, {"w": "it", "b": [0.3641, 0.5171, 0.3781, 0.5368]}, {"w": "isn’t", "b": [0.3844, 0.5171, 0.4288, 0.5368]}, {"w": "always", "b": [0.4351, 0.5171, 0.5052, 0.5368]}, {"w": "necessary", "b": [0.5115, 0.5171, 0.6095, 0.5368]}, {"w": "(for", "b": [0.6158, 0.5171, 0.6536, 0.5368]}, {"w": "example,", "b": [0.6599, 0.5171, 0.7517, 0.5368]}, {"w": "you", "b": [0.758, 0.5171, 0.7958, 0.5368]}, {"w": "didn’t", "b": [0.8021, 0.5171, 0.8619, 0.5368]}, {"w": "do", "b": [0.1294, 0.5376, 0.1546, 0.5573]}, {"w": "this", "b": [0.1609, 0.5376, 0.1974, 0.5573]}, {"w": "in", "b": [0.2037, 0.5376, 0.2233, 0.5573]}, {"w": "the", "b": [0.2296, 0.5376, 0.2605, 0.5573]}, {"w": "digit-classification", "b": [0.2668, 0.5376, 0.4545, 0.5573]}, {"w": "example):", "b": [0.4609, 0.5376, 0.5617, 0.5573]}]}, {"id": "b_4", "type": "paragraph", "text": "Normalize each feature independently to have a mean of 0. Normalize each feature independently to have a standard deviation of 1.", "words": [{"w": "Normalize", "b": [0.1799, 0.5759, 0.2863, 0.5956]}, {"w": "each", "b": [0.2926, 0.5759, 0.3389, 0.5956]}, {"w": "feature", "b": [0.3452, 0.5759, 0.4152, 0.5956]}, {"w": "independently", "b": [0.4215, 0.5759, 0.5644, 0.5956]}, {"w": "to", "b": [0.5707, 0.5759, 0.5904, 0.5956]}, {"w": "have", "b": [0.5967, 0.5759, 0.6443, 0.5956]}, {"w": "a", "b": [0.6506, 0.5759, 0.6618, 0.5956]}, {"w": "mean", "b": [0.6681, 0.5759, 0.7227, 0.5956]}, {"w": "of", "b": [0.7291, 0.5759, 0.7501, 0.5956]}, {"w": "0.", "b": [0.7564, 0.5759, 0.7753, 0.5956]}, {"w": "Normalize", "b": [0.1799, 0.5964, 0.2863, 0.6161]}, {"w": "each", "b": [0.2926, 0.5964, 0.3389, 0.6161]}, {"w": "feature", "b": [0.3452, 0.5964, 0.4152, 0.6161]}, {"w": "independently", "b": [0.4215, 0.5964, 0.5644, 0.6161]}, {"w": "to", "b": [0.5707, 0.5964, 0.5904, 0.6161]}, {"w": "have", "b": [0.5967, 0.5964, 0.6443, 0.6161]}, {"w": "a", "b": [0.6506, 0.5964, 0.6618, 0.6161]}, {"w": "standard", "b": [0.6681, 0.5964, 0.7536, 0.6161]}, {"w": "deviation", "b": [0.7599, 0.5964, 0.8538, 0.6161]}, {"w": "of", "b": [0.1799, 0.6169, 0.2009, 0.6366]}, {"w": "1.", "b": [0.2072, 0.6169, 0.2261, 0.6366]}]}, {"id": "b_5", "type": "paragraph", "text": "This is easy to do with Numpy arrays:", "words": [{"w": "This", "b": [0.1294, 0.6597, 0.1743, 0.6794]}, {"w": "is", "b": [0.1806, 0.6597, 0.1974, 0.6794]}, {"w": "easy", "b": [0.2037, 0.6597, 0.2485, 0.6794]}, {"w": "to", "b": [0.2548, 0.6597, 0.2745, 0.6794]}, {"w": "do", "b": [0.2808, 0.6597, 0.306, 0.6794]}, {"w": "with", "b": [0.3123, 0.6597, 0.3572, 0.6794]}, {"w": "Numpy", "b": [0.3635, 0.6597, 0.4391, 0.6794]}, {"w": "arrays:", "b": [0.4454, 0.6597, 0.5141, 0.6794]}]}, {"id": "b_6", "type": "equation", "text": "x -= x.mean(axis=0) 1 x /= x.std(axis=0)", "words": [{"w": "x", "b": [0.1357, 0.6974, 0.1471, 0.7126]}, {"w": "-=", "b": [0.1584, 0.6974, 0.1811, 0.7126]}, {"w": "x.mean(axis=0)", "b": [0.1925, 0.6974, 0.3514, 0.7126]}, {"w": "1", "b": [0.465, 0.6974, 0.4763, 0.7126]}, {"w": "x", "b": [0.1357, 0.7126, 0.1471, 0.7277]}, {"w": "/=", "b": [0.1584, 0.7126, 0.1811, 0.7277]}, {"w": "x.std(axis=0)", "b": [0.1925, 0.7126, 0.34, 0.7277]}]}, {"id": "b_7", "type": "paragraph", "text": "1 Assuming x is a 2D data matrix of shape (samples, features)", "words": [{"w": "1", "b": [0.1799, 0.7461, 0.1925, 0.7659]}, {"w": "Assuming", "b": [0.1988, 0.7461, 0.3053, 0.7659]}, {"w": "x", "b": [0.3116, 0.7461, 0.3242, 0.7659]}, {"w": "is", "b": [0.3305, 0.7461, 0.3474, 0.7659]}, {"w": "a", "b": [0.3537, 0.7461, 0.3663, 0.7659]}, {"w": "2D", "b": [0.3726, 0.7461, 0.4034, 0.7659]}, {"w": "data", "b": [0.4097, 0.7461, 0.4574, 0.7659]}, {"w": "matrix", "b": [0.4637, 0.7461, 0.5365, 0.7659]}, {"w": "of", "b": [0.5428, 0.7461, 0.5639, 0.7659]}, {"w": "shape", "b": [0.5702, 0.7461, 0.6318, 0.7659]}, {"w": "(samples,", "b": [0.6381, 0.7461, 0.7383, 0.7659]}, {"w": "features)", "b": [0.7446, 0.7461, 0.8395, 0.7659]}]}, {"id": "b_8", "type": "paragraph", "text": "Handling missing values", "words": [{"w": "Handling", "b": [0.1294, 0.784, 0.2051, 0.7988]}, {"w": "missing", "b": [0.2099, 0.784, 0.2708, 0.7988]}, {"w": "values", "b": [0.2756, 0.784, 0.326, 0.7988]}]}, {"id": "b_9", "type": "paragraph", "text": "You may sometimes have missing values in your data. For instance, in the house-price example, the first feature (the column of index 0 in the data) was the per capita crime rate. What if this feature wasn’t available", "words": [{"w": "You", "b": [0.1294, 0.8219, 0.1703, 0.8416]}, {"w": "may", "b": [0.1766, 0.8219, 0.2201, 0.8416]}, {"w": "sometimes", "b": [0.2264, 0.8219, 0.3343, 0.8416]}, {"w": "have", "b": [0.3406, 0.8219, 0.3882, 0.8416]}, {"w": "missing", "b": [0.3945, 0.8219, 0.473, 0.8416]}, {"w": "values", "b": [0.4793, 0.8219, 0.5438, 0.8416]}, {"w": "in", "b": [0.5501, 0.8219, 0.5697, 0.8416]}, {"w": "your", "b": [0.576, 0.8219, 0.6223, 0.8416]}, {"w": "data.", "b": [0.6286, 0.8219, 0.6769, 0.8416]}, {"w": "For", "b": [0.6832, 0.8219, 0.7183, 0.8416]}, {"w": "instance,", "b": [0.7246, 0.8219, 0.8135, 0.8416]}, {"w": "in", "b": [0.8198, 0.8219, 0.8395, 0.8416]}, {"w": "the", "b": [0.1294, 0.8424, 0.1602, 0.8621]}, {"w": "house-price", "b": [0.1665, 0.8424, 0.2842, 0.8621]}, {"w": "example,", "b": [0.2905, 0.8424, 0.3823, 0.8621]}, {"w": "the", "b": [0.3886, 0.8424, 0.4194, 0.8621]}, {"w": "first", "b": [0.4257, 0.8424, 0.4664, 0.8621]}, {"w": "feature", "b": [0.4727, 0.8424, 0.5427, 0.8621]}, {"w": "(the", "b": [0.549, 0.8424, 0.5882, 0.8621]}, {"w": "column", "b": [0.5945, 0.8424, 0.6702, 0.8621]}, {"w": "of", "b": [0.6764, 0.8424, 0.6974, 0.8621]}, {"w": "index", "b": [0.7038, 0.8424, 0.7598, 0.8621]}, {"w": "0", "b": [0.7661, 0.8424, 0.7787, 0.8621]}, {"w": "in", "b": [0.785, 0.8424, 0.8047, 0.8621]}, {"w": "the", "b": [0.811, 0.8424, 0.8418, 0.8621]}, {"w": "data)", "b": [0.1294, 0.8629, 0.1798, 0.8826]}, {"w": "was", "b": [0.1861, 0.8629, 0.2254, 0.8826]}, {"w": "the", "b": [0.2317, 0.8629, 0.2625, 0.8826]}, {"w": "per", "b": [0.2688, 0.8629, 0.301, 0.8826]}, {"w": "capita", "b": [0.3073, 0.8629, 0.3676, 0.8826]}, {"w": "crime", "b": [0.3739, 0.8629, 0.4313, 0.8826]}, {"w": "rate.", "b": [0.4376, 0.8629, 0.4817, 0.8826]}, {"w": "What", "b": [0.488, 0.8629, 0.5427, 0.8826]}, {"w": "if", "b": [0.549, 0.8629, 0.5644, 0.8826]}, {"w": "this", "b": [0.5707, 0.8629, 0.6072, 0.8826]}, {"w": "feature", "b": [0.6135, 0.8629, 0.6835, 0.8826]}, {"w": "wasn’t", "b": [0.6898, 0.8629, 0.7565, 0.8826]}, {"w": "available", "b": [0.7628, 0.8629, 0.8539, 0.8826]}]}]}, {"page": 151, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "for all samples? You’d then have missing values in the training or test data.", "words": [{"w": "for", "b": [0.1294, 0.0857, 0.1588, 0.1054]}, {"w": "all", "b": [0.1651, 0.0857, 0.1904, 0.1054]}, {"w": "samples?", "b": [0.1967, 0.0857, 0.2891, 0.1054]}, {"w": "You’d", "b": [0.2954, 0.0857, 0.3574, 0.1054]}, {"w": "then", "b": [0.3637, 0.0857, 0.4071, 0.1054]}, {"w": "have", "b": [0.4134, 0.0857, 0.461, 0.1054]}, {"w": "missing", "b": [0.4673, 0.0857, 0.5458, 0.1054]}, {"w": "values", "b": [0.5521, 0.0857, 0.6166, 0.1054]}, {"w": "in", "b": [0.6229, 0.0857, 0.6425, 0.1054]}, {"w": "the", "b": [0.6488, 0.0857, 0.6796, 0.1054]}, {"w": "training", "b": [0.686, 0.0857, 0.7644, 0.1054]}, {"w": "or", "b": [0.7707, 0.0857, 0.7917, 0.1054]}, {"w": "test", "b": [0.7981, 0.0857, 0.8331, 0.1054]}, {"w": "data.", "b": [0.1294, 0.1062, 0.1777, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "In general, with neural networks, it’s safe to input missing values as 0, with the condition that 0 isn’t already a meaningful value. The network will learn from exposure to the data that the value 0 means missing data and will start ignoring the value.", "words": [{"w": "In", "b": [0.1294, 0.149, 0.1504, 0.1687]}, {"w": "general,", "b": [0.1567, 0.149, 0.2373, 0.1687]}, {"w": "with", "b": [0.2436, 0.149, 0.2884, 0.1687]}, {"w": "neural", "b": [0.2947, 0.149, 0.3578, 0.1687]}, {"w": "networks,", "b": [0.3641, 0.149, 0.4629, 0.1687]}, {"w": "it’s", "b": [0.4692, 0.149, 0.5, 0.1687]}, {"w": "safe", "b": [0.5063, 0.149, 0.5469, 0.1687]}, {"w": "to", "b": [0.5532, 0.149, 0.5728, 0.1687]}, {"w": "input", "b": [0.5791, 0.149, 0.631, 0.1687]}, {"w": "missing", "b": [0.6373, 0.149, 0.7158, 0.1687]}, {"w": "values", "b": [0.7221, 0.149, 0.7866, 0.1687]}, {"w": "as", "b": [0.7929, 0.149, 0.8139, 0.1687]}, {"w": "0,", "b": [0.8202, 0.149, 0.8391, 0.1687]}, {"w": "with", "b": [0.1294, 0.1695, 0.1743, 0.1892]}, {"w": "the", "b": [0.1806, 0.1695, 0.2114, 0.1892]}, {"w": "condition", "b": [0.2177, 0.1695, 0.313, 0.1892]}, {"w": "that", "b": [0.3193, 0.1695, 0.3572, 0.1892]}, {"w": "0", "b": [0.3635, 0.1695, 0.3761, 0.1892]}, {"w": "isn’t", "b": [0.3824, 0.1695, 0.4267, 0.1892]}, {"w": "already", "b": [0.433, 0.1695, 0.5073, 0.1892]}, {"w": "a", "b": [0.5136, 0.1695, 0.5248, 0.1892]}, {"w": "meaningful", "b": [0.5311, 0.1695, 0.646, 0.1892]}, {"w": "value.", "b": [0.6523, 0.1695, 0.7132, 0.1892]}, {"w": "The", "b": [0.7195, 0.1695, 0.7587, 0.1892]}, {"w": "network", "b": [0.765, 0.1695, 0.8477, 0.1892]}, {"w": "will", "b": [0.1294, 0.19, 0.1687, 0.2097]}, {"w": "learn", "b": [0.175, 0.19, 0.2254, 0.2097]}, {"w": "from", "b": [0.2317, 0.19, 0.2807, 0.2097]}, {"w": "exposure", "b": [0.287, 0.19, 0.3781, 0.2097]}, {"w": "to", "b": [0.3844, 0.19, 0.404, 0.2097]}, {"w": "the", "b": [0.4104, 0.19, 0.4412, 0.2097]}, {"w": "data", "b": [0.4475, 0.19, 0.4895, 0.2097]}, {"w": "that", "b": [0.4958, 0.19, 0.5337, 0.2097]}, {"w": "the", "b": [0.54, 0.19, 0.5708, 0.2097]}, {"w": "value", "b": [0.5771, 0.19, 0.6317, 0.2097]}, {"w": "0", "b": [0.638, 0.19, 0.6507, 0.2097]}, {"w": "means", "b": [0.657, 0.19, 0.7214, 0.2097]}, {"w": "missing", "b": [0.7276, 0.19, 0.8047, 0.2097]}, {"w": "data", "b": [0.811, 0.19, 0.8559, 0.2097]}, {"w": "and", "b": [0.1294, 0.2105, 0.1658, 0.2302]}, {"w": "will", "b": [0.1721, 0.2105, 0.2114, 0.2302]}, {"w": "start", "b": [0.2177, 0.2105, 0.2611, 0.2302]}, {"w": "ignoring", "b": [0.2674, 0.2105, 0.3529, 0.2302]}, {"w": "the", "b": [0.3592, 0.2105, 0.3901, 0.2302]}, {"w": "value.", "b": [0.3964, 0.2105, 0.4573, 0.2302]}]}, {"id": "b_2", "type": "paragraph", "text": "Note that if you’re expecting missing values in the test data, but the network was trained on data without any missing values, the network won’t have learned to ignore missing values! In this situation, you should artificially generate training samples with missing entries: copy some training samples several times, and drop some of the features that you expect are likely to be missing in the test data.", "words": [{"w": "Note", "b": [0.1294, 0.2532, 0.1785, 0.273]}, {"w": "that", "b": [0.1848, 0.2532, 0.2226, 0.273]}, {"w": "if", "b": [0.2289, 0.2532, 0.2443, 0.273]}, {"w": "you’re", "b": [0.2506, 0.2532, 0.3165, 0.273]}, {"w": "expecting", "b": [0.3228, 0.2532, 0.4208, 0.273]}, {"w": "missing", "b": [0.4272, 0.2532, 0.5057, 0.273]}, {"w": "values", "b": [0.512, 0.2532, 0.5764, 0.273]}, {"w": "in", "b": [0.5827, 0.2532, 0.6023, 0.273]}, {"w": "the", "b": [0.6087, 0.2532, 0.6395, 0.273]}, {"w": "test", "b": [0.6458, 0.2532, 0.6808, 0.273]}, {"w": "data,", "b": [0.6871, 0.2532, 0.7355, 0.273]}, {"w": "but", "b": [0.7418, 0.2532, 0.774, 0.273]}, {"w": "the", "b": [0.7803, 0.2532, 0.8111, 0.273]}, {"w": "network", "b": [0.1294, 0.2737, 0.2121, 0.2935]}, {"w": "was", "b": [0.2184, 0.2737, 0.2576, 0.2935]}, {"w": "trained", "b": [0.2639, 0.2737, 0.334, 0.2935]}, {"w": "on", "b": [0.3403, 0.2737, 0.3655, 0.2935]}, {"w": "data", "b": [0.3718, 0.2737, 0.4138, 0.2935]}, {"w": "without", "b": [0.4201, 0.2737, 0.4972, 0.2935]}, {"w": "any", "b": [0.5035, 0.2737, 0.54, 0.2935]}, {"w": "missing", "b": [0.5463, 0.2737, 0.6248, 0.2935]}, {"w": "values,", "b": [0.6311, 0.2737, 0.7018, 0.2935]}, {"w": "the", "b": [0.7081, 0.2737, 0.7389, 0.2935]}, {"w": "network", "b": [0.7452, 0.2737, 0.8279, 0.2935]}, {"w": "won’t", "b": [0.1294, 0.2942, 0.1878, 0.314]}, {"w": "have", "b": [0.1941, 0.2942, 0.2417, 0.314]}, {"w": "learned", "b": [0.2481, 0.2942, 0.3223, 0.314]}, {"w": "to", "b": [0.3286, 0.2942, 0.3482, 0.314]}, {"w": "ignore", "b": [0.3545, 0.2942, 0.419, 0.314]}, {"w": "missing", "b": [0.4253, 0.2942, 0.5038, 0.314]}, {"w": "values!", "b": [0.5101, 0.2942, 0.5829, 0.314]}, {"w": "In", "b": [0.5893, 0.2942, 0.6103, 0.314]}, {"w": "this", "b": [0.6166, 0.2942, 0.653, 0.314]}, {"w": "situation,", "b": [0.6593, 0.2942, 0.7525, 0.314]}, {"w": "you", "b": [0.7588, 0.2942, 0.7967, 0.314]}, {"w": "should", "b": [0.803, 0.2942, 0.8703, 0.314]}, {"w": "artificially", "b": [0.1294, 0.3147, 0.2345, 0.3345]}, {"w": "generate", "b": [0.2408, 0.3147, 0.3262, 0.3345]}, {"w": "training", "b": [0.3326, 0.3147, 0.411, 0.3345]}, {"w": "samples", "b": [0.4173, 0.3147, 0.4986, 0.3345]}, {"w": "with", "b": [0.5048, 0.3147, 0.5497, 0.3345]}, {"w": "missing", "b": [0.556, 0.3147, 0.6345, 0.3345]}, {"w": "entries:", "b": [0.6408, 0.3147, 0.7151, 0.3345]}, {"w": "copy", "b": [0.7214, 0.3147, 0.7704, 0.3345]}, {"w": "some", "b": [0.7767, 0.3147, 0.83, 0.3345]}, {"w": "training", "b": [0.1294, 0.3352, 0.2079, 0.355]}, {"w": "samples", "b": [0.2142, 0.3352, 0.2955, 0.355]}, {"w": "several", "b": [0.3018, 0.3352, 0.3732, 0.355]}, {"w": "times,", "b": [0.3795, 0.3352, 0.4405, 0.355]}, {"w": "and", "b": [0.4468, 0.3352, 0.4832, 0.355]}, {"w": "drop", "b": [0.4895, 0.3352, 0.5358, 0.355]}, {"w": "some", "b": [0.5421, 0.3352, 0.5953, 0.355]}, {"w": "of", "b": [0.6016, 0.3352, 0.6227, 0.355]}, {"w": "the", "b": [0.629, 0.3352, 0.6598, 0.355]}, {"w": "features", "b": [0.6661, 0.3352, 0.7459, 0.355]}, {"w": "that", "b": [0.7522, 0.3352, 0.7901, 0.355]}, {"w": "you", "b": [0.7964, 0.3352, 0.8342, 0.355]}, {"w": "expect", "b": [0.1294, 0.3557, 0.1953, 0.3755]}, {"w": "are", "b": [0.2016, 0.3557, 0.2324, 0.3755]}, {"w": "likely", "b": [0.2387, 0.3557, 0.2961, 0.3755]}, {"w": "to", "b": [0.3024, 0.3557, 0.3221, 0.3755]}, {"w": "be", "b": [0.3283, 0.3557, 0.3521, 0.3755]}, {"w": "missing", "b": [0.3584, 0.3557, 0.4369, 0.3755]}, {"w": "in", "b": [0.4432, 0.3557, 0.4629, 0.3755]}, {"w": "the", "b": [0.4692, 0.3557, 0.5, 0.3755]}, {"w": "test", "b": [0.5063, 0.3557, 0.5414, 0.3755]}, {"w": "data.", "b": [0.5477, 0.3557, 0.596, 0.3755]}]}, {"id": "b_3", "type": "paragraph", "text": "4.3.2. Feature engineering", "words": [{"w": "4.3.2.", "b": [0.1294, 0.403, 0.1862, 0.4227]}, {"w": "Feature", "b": [0.1925, 0.403, 0.2761, 0.4227]}, {"w": "engineering", "b": [0.2824, 0.403, 0.4085, 0.4227]}]}, {"id": "b_4", "type": "paragraph", "text": "Feature engineering is the process of using your own knowledge about the data and about the machine-learning algorithm at hand (in this case, a neural network) to make the algorithm work better by applying hardcoded (nonlearned) transformations to the data before it goes into the model. In many cases, it isn’t reasonable to expect a machine- learning model to be able to learn from completely arbitrary data. The data needs to be presented to the model in a way that will make the model’s job easier.", "words": [{"w": "Feature", "b": [0.1294, 0.4458, 0.2083, 0.4655]}, {"w": "engineering", "b": [0.2146, 0.4458, 0.3351, 0.4655]}, {"w": "is", "b": [0.3414, 0.4458, 0.3583, 0.4655]}, {"w": "the", "b": [0.3646, 0.4458, 0.3954, 0.4655]}, {"w": "process", "b": [0.4017, 0.4458, 0.4773, 0.4655]}, {"w": "of", "b": [0.4836, 0.4458, 0.5047, 0.4655]}, {"w": "using", "b": [0.511, 0.4458, 0.5656, 0.4655]}, {"w": "your", "b": [0.5719, 0.4458, 0.6182, 0.4655]}, {"w": "own", "b": [0.6245, 0.4458, 0.6679, 0.4655]}, {"w": "knowledge", "b": [0.6742, 0.4458, 0.7849, 0.4655]}, {"w": "about", "b": [0.7912, 0.4458, 0.8473, 0.4655]}, {"w": "the", "b": [0.1294, 0.4663, 0.1602, 0.486]}, {"w": "data", "b": [0.1665, 0.4663, 0.2086, 0.486]}, {"w": "and", "b": [0.2149, 0.4663, 0.2513, 0.486]}, {"w": "about", "b": [0.2576, 0.4663, 0.3137, 0.486]}, {"w": "the", "b": [0.32, 0.4663, 0.3508, 0.486]}, {"w": "machine-learning", "b": [0.3571, 0.4663, 0.5336, 0.486]}, {"w": "algorithm", "b": [0.5399, 0.4663, 0.638, 0.486]}, {"w": "at", "b": [0.6443, 0.4663, 0.6626, 0.486]}, {"w": "hand", "b": [0.6689, 0.4663, 0.7179, 0.486]}, {"w": "(in", "b": [0.7242, 0.4663, 0.7522, 0.486]}, {"w": "this", "b": [0.7585, 0.4663, 0.795, 0.486]}, {"w": "case,", "b": [0.8013, 0.4663, 0.851, 0.486]}, {"w": "a", "b": [0.8572, 0.4663, 0.8684, 0.486]}, {"w": "neural", "b": [0.1294, 0.4868, 0.1925, 0.5065]}, {"w": "network)", "b": [0.1988, 0.4868, 0.2898, 0.5065]}, {"w": "to", "b": [0.2961, 0.4868, 0.3158, 0.5065]}, {"w": "make", "b": [0.3221, 0.4868, 0.3767, 0.5065]}, {"w": "the", "b": [0.383, 0.4868, 0.4138, 0.5065]}, {"w": "algorithm", "b": [0.4201, 0.4868, 0.5182, 0.5065]}, {"w": "work", "b": [0.5245, 0.4868, 0.5764, 0.5065]}, {"w": "better", "b": [0.5827, 0.4868, 0.6401, 0.5065]}, {"w": "by", "b": [0.6464, 0.4868, 0.6717, 0.5065]}, {"w": "applying", "b": [0.678, 0.4868, 0.7663, 0.5065]}, {"w": "hardcoded", "b": [0.1294, 0.5073, 0.2345, 0.527]}, {"w": "(nonlearned)", "b": [0.2408, 0.5073, 0.3697, 0.527]}, {"w": "transformations", "b": [0.376, 0.5073, 0.5343, 0.527]}, {"w": "to", "b": [0.5406, 0.5073, 0.5602, 0.527]}, {"w": "the", "b": [0.5665, 0.5073, 0.5974, 0.527]}, {"w": "data", "b": [0.6037, 0.5073, 0.6457, 0.527]}, {"w": "before", "b": [0.652, 0.5073, 0.7164, 0.527]}, {"w": "it", "b": [0.7227, 0.5073, 0.7367, 0.527]}, {"w": "goes", "b": [0.743, 0.5073, 0.7892, 0.527]}, {"w": "into", "b": [0.7955, 0.5073, 0.8348, 0.527]}, {"w": "the", "b": [0.1294, 0.5278, 0.1602, 0.5475]}, {"w": "model.", "b": [0.1665, 0.5278, 0.2359, 0.5475]}, {"w": "In", "b": [0.2422, 0.5278, 0.2632, 0.5475]}, {"w": "many", "b": [0.2695, 0.5278, 0.3256, 0.5475]}, {"w": "cases,", "b": [0.3319, 0.5278, 0.3914, 0.5475]}, {"w": "it", "b": [0.3977, 0.5278, 0.4118, 0.5475]}, {"w": "isn’t", "b": [0.4181, 0.5278, 0.4624, 0.5475]}, {"w": "reasonable", "b": [0.4687, 0.5278, 0.5766, 0.5475]}, {"w": "to", "b": [0.5829, 0.5278, 0.6025, 0.5475]}, {"w": "expect", "b": [0.6088, 0.5278, 0.6747, 0.5475]}, {"w": "a", "b": [0.681, 0.5278, 0.6922, 0.5475]}, {"w": "machine-", "b": [0.6985, 0.5278, 0.7924, 0.5475]}, {"w": "learning", "b": [0.1294, 0.5483, 0.2121, 0.568]}, {"w": "model", "b": [0.2184, 0.5483, 0.2814, 0.568]}, {"w": "to", "b": [0.2878, 0.5483, 0.3074, 0.568]}, {"w": "be", "b": [0.3137, 0.5483, 0.3375, 0.568]}, {"w": "able", "b": [0.3438, 0.5483, 0.3858, 0.568]}, {"w": "to", "b": [0.3921, 0.5483, 0.4118, 0.568]}, {"w": "learn", "b": [0.4181, 0.5483, 0.4685, 0.568]}, {"w": "from", "b": [0.4748, 0.5483, 0.5238, 0.568]}, {"w": "completely", "b": [0.5301, 0.5483, 0.6423, 0.568]}, {"w": "arbitrary", "b": [0.6485, 0.5483, 0.7353, 0.568]}, {"w": "data.", "b": [0.7416, 0.5483, 0.7899, 0.568]}, {"w": "The", "b": [0.7962, 0.5483, 0.8355, 0.568]}, {"w": "data", "b": [0.1294, 0.5688, 0.1714, 0.5885]}, {"w": "needs", "b": [0.1777, 0.5688, 0.2352, 0.5885]}, {"w": "to", "b": [0.2415, 0.5688, 0.2611, 0.5885]}, {"w": "be", "b": [0.2674, 0.5688, 0.2912, 0.5885]}, {"w": "presented", "b": [0.2975, 0.5688, 0.3942, 0.5885]}, {"w": "to", "b": [0.4005, 0.5688, 0.4201, 0.5885]}, {"w": "the", "b": [0.4264, 0.5688, 0.4573, 0.5885]}, {"w": "model", "b": [0.4636, 0.5688, 0.5266, 0.5885]}, {"w": "in", "b": [0.5329, 0.5688, 0.5526, 0.5885]}, {"w": "a", "b": [0.5589, 0.5688, 0.5701, 0.5885]}, {"w": "way", "b": [0.5764, 0.5688, 0.6184, 0.5885]}, {"w": "that", "b": [0.6247, 0.5688, 0.6626, 0.5885]}, {"w": "will", "b": [0.6689, 0.5688, 0.7081, 0.5885]}, {"w": "make", "b": [0.7144, 0.5688, 0.7691, 0.5885]}, {"w": "the", "b": [0.7754, 0.5688, 0.8062, 0.5885]}, {"w": "model’s", "b": [0.1294, 0.5893, 0.2093, 0.609]}, {"w": "job", "b": [0.2156, 0.5893, 0.2478, 0.609]}, {"w": "easier.", "b": [0.2541, 0.5893, 0.3179, 0.609]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s look at an intuitive example. Suppose you’re trying to develop a model that can take as input an image of a clock and can output the time of day (see figure 4.3).", "words": [{"w": "Let’s", "b": [0.1294, 0.6321, 0.1798, 0.6518]}, {"w": "look", "b": [0.1862, 0.6321, 0.231, 0.6518]}, {"w": "at", "b": [0.2373, 0.6321, 0.2555, 0.6518]}, {"w": "an", "b": [0.2618, 0.6321, 0.2856, 0.6518]}, {"w": "intuitive", "b": [0.292, 0.6321, 0.3761, 0.6518]}, {"w": "example.", "b": [0.3824, 0.6321, 0.4741, 0.6518]}, {"w": "Suppose", "b": [0.4804, 0.6321, 0.5659, 0.6518]}, {"w": "you’re", "b": [0.5722, 0.6321, 0.6381, 0.6518]}, {"w": "trying", "b": [0.6444, 0.6321, 0.7046, 0.6518]}, {"w": "to", "b": [0.711, 0.6321, 0.7306, 0.6518]}, {"w": "develop", "b": [0.7369, 0.6321, 0.8167, 0.6518]}, {"w": "a", "b": [0.8231, 0.6321, 0.8343, 0.6518]}, {"w": "model", "b": [0.1294, 0.6526, 0.1925, 0.6723]}, {"w": "that", "b": [0.1988, 0.6526, 0.2366, 0.6723]}, {"w": "can", "b": [0.2429, 0.6526, 0.2779, 0.6723]}, {"w": "take", "b": [0.2842, 0.6526, 0.3263, 0.6723]}, {"w": "as", "b": [0.3326, 0.6526, 0.3536, 0.6723]}, {"w": "input", "b": [0.3599, 0.6526, 0.4118, 0.6723]}, {"w": "an", "b": [0.4181, 0.6526, 0.4419, 0.6723]}, {"w": "image", "b": [0.4482, 0.6526, 0.5098, 0.6723]}, {"w": "of", "b": [0.5161, 0.6526, 0.5372, 0.6723]}, {"w": "a", "b": [0.5435, 0.6526, 0.5547, 0.6723]}, {"w": "clock", "b": [0.561, 0.6526, 0.6156, 0.6723]}, {"w": "and", "b": [0.6219, 0.6526, 0.6583, 0.6723]}, {"w": "can", "b": [0.6646, 0.6526, 0.6996, 0.6723]}, {"w": "output", "b": [0.7059, 0.6526, 0.7703, 0.6723]}, {"w": "the", "b": [0.7767, 0.6526, 0.8075, 0.6723]}, {"w": "time", "b": [0.8138, 0.6526, 0.8586, 0.6723]}, {"w": "of", "b": [0.1294, 0.6731, 0.1504, 0.6928]}, {"w": "day", "b": [0.1567, 0.6731, 0.1932, 0.6928]}, {"w": "(see", "b": [0.1995, 0.6731, 0.2401, 0.6928]}, {"w": "figure", "b": [0.2464, 0.6731, 0.3066, 0.6928]}, {"w": "4.3).", "b": [0.3129, 0.6731, 0.3591, 0.6928]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 4.3. Feature engineering for reading the time on a clock", "words": [{"w": "Figure", "b": [0.1294, 0.7109, 0.1827, 0.7257]}, {"w": "4.3.", "b": [0.1874, 0.7109, 0.2158, 0.7257]}, {"w": "Feature", "b": [0.2205, 0.7109, 0.2832, 0.7257]}, {"w": "engineering", "b": [0.2879, 0.7109, 0.3825, 0.7257]}, {"w": "for", "b": [0.3872, 0.7109, 0.4114, 0.7257]}, {"w": "reading", "b": [0.4161, 0.7109, 0.4778, 0.7257]}, {"w": "the", "b": [0.4825, 0.7109, 0.5077, 0.7257]}, {"w": "time", "b": [0.5125, 0.7109, 0.5482, 0.7257]}, {"w": "on", "b": [0.5529, 0.7109, 0.5729, 0.7257]}, {"w": "a", "b": [0.5776, 0.7109, 0.5871, 0.7257]}, {"w": "clock", "b": [0.5918, 0.7109, 0.6338, 0.7257]}]}]}, {"page": 152, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "If you choose to use the raw pixels of the image as input data, then you have a difficult machine-learning problem on your hands. You’ll need a convolutional neural network to solve it, and you’ll have to expend quite a bit of computational resources to train the network.", "words": [{"w": "If", "b": [0.1294, 0.3602, 0.1462, 0.3799]}, {"w": "you", "b": [0.1525, 0.3602, 0.1904, 0.3799]}, {"w": "choose", "b": [0.1967, 0.3602, 0.2667, 0.3799]}, {"w": "to", "b": [0.273, 0.3602, 0.2926, 0.3799]}, {"w": "use", "b": [0.299, 0.3602, 0.3326, 0.3799]}, {"w": "the", "b": [0.3389, 0.3602, 0.3697, 0.3799]}, {"w": "raw", "b": [0.376, 0.3602, 0.4138, 0.3799]}, {"w": "pixels", "b": [0.4201, 0.3602, 0.4804, 0.3799]}, {"w": "of", "b": [0.4867, 0.3602, 0.5077, 0.3799]}, {"w": "the", "b": [0.514, 0.3602, 0.5449, 0.3799]}, {"w": "image", "b": [0.5512, 0.3602, 0.6128, 0.3799]}, {"w": "as", "b": [0.6191, 0.3602, 0.6401, 0.3799]}, {"w": "input", "b": [0.6464, 0.3602, 0.6983, 0.3799]}, {"w": "data,", "b": [0.7046, 0.3602, 0.7529, 0.3799]}, {"w": "then", "b": [0.7592, 0.3602, 0.8027, 0.3799]}, {"w": "you", "b": [0.809, 0.3602, 0.8468, 0.3799]}, {"w": "have", "b": [0.1294, 0.3807, 0.177, 0.4004]}, {"w": "a", "b": [0.1833, 0.3807, 0.1945, 0.4004]}, {"w": "difficult", "b": [0.2009, 0.3807, 0.2817, 0.4004]}, {"w": "machine-learning", "b": [0.288, 0.3807, 0.4645, 0.4004]}, {"w": "problem", "b": [0.4708, 0.3807, 0.5549, 0.4004]}, {"w": "on", "b": [0.5612, 0.3807, 0.5864, 0.4004]}, {"w": "your", "b": [0.5927, 0.3807, 0.639, 0.4004]}, {"w": "hands.", "b": [0.6452, 0.3807, 0.7103, 0.4004]}, {"w": "You’ll", "b": [0.7166, 0.3807, 0.78, 0.4004]}, {"w": "need", "b": [0.7863, 0.3807, 0.8339, 0.4004]}, {"w": "a", "b": [0.8402, 0.3807, 0.8514, 0.4004]}, {"w": "convolutional", "b": [0.1294, 0.4012, 0.2682, 0.4209]}, {"w": "neural", "b": [0.2745, 0.4012, 0.3375, 0.4209]}, {"w": "network", "b": [0.3438, 0.4012, 0.4265, 0.4209]}, {"w": "to", "b": [0.4328, 0.4012, 0.4524, 0.4209]}, {"w": "solve", "b": [0.4587, 0.4012, 0.512, 0.4209]}, {"w": "it,", "b": [0.5183, 0.4012, 0.5386, 0.4209]}, {"w": "and", "b": [0.5449, 0.4012, 0.5813, 0.4209]}, {"w": "you’ll", "b": [0.5876, 0.4012, 0.6479, 0.4209]}, {"w": "have", "b": [0.6542, 0.4012, 0.7018, 0.4209]}, {"w": "to", "b": [0.7081, 0.4012, 0.7278, 0.4209]}, {"w": "expend", "b": [0.7341, 0.4012, 0.8069, 0.4209]}, {"w": "quite", "b": [0.8132, 0.4012, 0.8637, 0.4209]}, {"w": "a", "b": [0.1294, 0.4217, 0.1406, 0.4414]}, {"w": "bit", "b": [0.1469, 0.4217, 0.1736, 0.4414]}, {"w": "of", "b": [0.1799, 0.4217, 0.2009, 0.4414]}, {"w": "computational", "b": [0.2072, 0.4217, 0.3515, 0.4414]}, {"w": "resources", "b": [0.3578, 0.4217, 0.4531, 0.4414]}, {"w": "to", "b": [0.4593, 0.4217, 0.479, 0.4414]}, {"w": "train", "b": [0.4853, 0.4217, 0.5315, 0.4414]}, {"w": "the", "b": [0.5378, 0.4217, 0.5686, 0.4414]}, {"w": "network.", "b": [0.5749, 0.4217, 0.6639, 0.4414]}]}, {"id": "b_1", "type": "paragraph", "text": "But if you already understand the problem at a high level (you understand how humans read time on a clock face), then you can come up with much better input features for a machine-learning algorithm: for instance, it’s easy to write a five-line Python script to follow the black pixels of the clock hands and output the (x, y) coordinates of the tip of each hand. Then a simple machine-learning algorithm can learn to associate these coordinates with the appropriate time of day.", "words": [{"w": "But", "b": [0.1294, 0.4645, 0.1659, 0.4842]}, {"w": "if", "b": [0.1722, 0.4645, 0.1876, 0.4842]}, {"w": "you", "b": [0.1939, 0.4645, 0.2317, 0.4842]}, {"w": "already", "b": [0.238, 0.4645, 0.3123, 0.4842]}, {"w": "understand", "b": [0.3186, 0.4645, 0.4293, 0.4842]}, {"w": "the", "b": [0.4356, 0.4645, 0.4664, 0.4842]}, {"w": "problem", "b": [0.4727, 0.4645, 0.5568, 0.4842]}, {"w": "at", "b": [0.5631, 0.4645, 0.5813, 0.4842]}, {"w": "a", "b": [0.5876, 0.4645, 0.5988, 0.4842]}, {"w": "high", "b": [0.6051, 0.4645, 0.65, 0.4842]}, {"w": "level", "b": [0.6563, 0.4645, 0.7053, 0.4842]}, {"w": "(you", "b": [0.7116, 0.4645, 0.7579, 0.4842]}, {"w": "understand", "b": [0.1294, 0.485, 0.2401, 0.5047]}, {"w": "how", "b": [0.2464, 0.485, 0.2898, 0.5047]}, {"w": "humans", "b": [0.2962, 0.485, 0.3746, 0.5047]}, {"w": "read", "b": [0.3809, 0.485, 0.4244, 0.5047]}, {"w": "time", "b": [0.4307, 0.485, 0.4755, 0.5047]}, {"w": "on", "b": [0.4818, 0.485, 0.507, 0.5047]}, {"w": "a", "b": [0.5133, 0.485, 0.5245, 0.5047]}, {"w": "clock", "b": [0.5309, 0.485, 0.5855, 0.5047]}, {"w": "face),", "b": [0.5918, 0.485, 0.6485, 0.5047]}, {"w": "then", "b": [0.6548, 0.485, 0.6983, 0.5047]}, {"w": "you", "b": [0.7046, 0.485, 0.7424, 0.5047]}, {"w": "can", "b": [0.7486, 0.485, 0.7836, 0.5047]}, {"w": "come", "b": [0.7899, 0.485, 0.8446, 0.5047]}, {"w": "up", "b": [0.1294, 0.5055, 0.1546, 0.5252]}, {"w": "with", "b": [0.1609, 0.5055, 0.2058, 0.5252]}, {"w": "much", "b": [0.2121, 0.5055, 0.2682, 0.5252]}, {"w": "better", "b": [0.2745, 0.5055, 0.3319, 0.5252]}, {"w": "input", "b": [0.3382, 0.5055, 0.3901, 0.5252]}, {"w": "features", "b": [0.3964, 0.5055, 0.4762, 0.5252]}, {"w": "for", "b": [0.4825, 0.5055, 0.5119, 0.5252]}, {"w": "a", "b": [0.5182, 0.5055, 0.5294, 0.5252]}, {"w": "machine-learning", "b": [0.5357, 0.5055, 0.7123, 0.5252]}, {"w": "algorithm:", "b": [0.7186, 0.5055, 0.8237, 0.5252]}, {"w": "for", "b": [0.83, 0.5055, 0.8594, 0.5252]}, {"w": "instance,", "b": [0.1294, 0.526, 0.2184, 0.5457]}, {"w": "it’s", "b": [0.2247, 0.526, 0.2555, 0.5457]}, {"w": "easy", "b": [0.2618, 0.526, 0.3066, 0.5457]}, {"w": "to", "b": [0.313, 0.526, 0.3326, 0.5457]}, {"w": "write", "b": [0.3389, 0.526, 0.3907, 0.5457]}, {"w": "a", "b": [0.397, 0.526, 0.4082, 0.5457]}, {"w": "five-line", "b": [0.4145, 0.526, 0.5, 0.5457]}, {"w": "Python", "b": [0.5063, 0.526, 0.5778, 0.5457]}, {"w": "script", "b": [0.5841, 0.526, 0.6401, 0.5457]}, {"w": "to", "b": [0.6464, 0.526, 0.666, 0.5457]}, {"w": "follow", "b": [0.6723, 0.526, 0.7382, 0.5457]}, {"w": "the", "b": [0.7445, 0.526, 0.7753, 0.5457]}, {"w": "black", "b": [0.7817, 0.526, 0.8363, 0.5457]}, {"w": "pixels", "b": [0.1294, 0.5465, 0.1897, 0.5662]}, {"w": "of", "b": [0.196, 0.5465, 0.217, 0.5662]}, {"w": "the", "b": [0.2233, 0.5465, 0.2541, 0.5662]}, {"w": "clock", "b": [0.2604, 0.5465, 0.3151, 0.5662]}, {"w": "hands", "b": [0.3214, 0.5465, 0.3802, 0.5662]}, {"w": "and", "b": [0.3865, 0.5465, 0.423, 0.5662]}, {"w": "output", "b": [0.4293, 0.5465, 0.4937, 0.5662]}, {"w": "the", "b": [0.5001, 0.5465, 0.5309, 0.5662]}, {"w": "(x,", "b": [0.5372, 0.5465, 0.5645, 0.5662]}, {"w": "y)", "b": [0.5708, 0.5465, 0.5918, 0.5662]}, {"w": "coordinates", "b": [0.5981, 0.5465, 0.7144, 0.5662]}, {"w": "of", "b": [0.7207, 0.5465, 0.7417, 0.5662]}, {"w": "the", "b": [0.748, 0.5465, 0.7789, 0.5662]}, {"w": "tip", "b": [0.7852, 0.5465, 0.8118, 0.5662]}, {"w": "of", "b": [0.8181, 0.5465, 0.8391, 0.5662]}, {"w": "each", "b": [0.1294, 0.567, 0.1756, 0.5867]}, {"w": "hand.", "b": [0.1819, 0.567, 0.2373, 0.5867]}, {"w": "Then", "b": [0.2436, 0.567, 0.2954, 0.5867]}, {"w": "a", "b": [0.3017, 0.567, 0.3129, 0.5867]}, {"w": "simple", "b": [0.3192, 0.567, 0.3865, 0.5867]}, {"w": "machine-learning", "b": [0.3928, 0.567, 0.5693, 0.5867]}, {"w": "algorithm", "b": [0.5756, 0.567, 0.6737, 0.5867]}, {"w": "can", "b": [0.68, 0.567, 0.715, 0.5867]}, {"w": "learn", "b": [0.7214, 0.567, 0.7718, 0.5867]}, {"w": "to", "b": [0.7781, 0.567, 0.7977, 0.5867]}, {"w": "associate", "b": [0.1294, 0.5875, 0.2205, 0.6072]}, {"w": "these", "b": [0.2268, 0.5875, 0.2786, 0.6072]}, {"w": "coordinates", "b": [0.2849, 0.5875, 0.4012, 0.6072]}, {"w": "with", "b": [0.4075, 0.5875, 0.4524, 0.6072]}, {"w": "the", "b": [0.4587, 0.5875, 0.4895, 0.6072]}, {"w": "appropriate", "b": [0.4958, 0.5875, 0.6107, 0.6072]}, {"w": "time", "b": [0.617, 0.5875, 0.6619, 0.6072]}, {"w": "of", "b": [0.6682, 0.5875, 0.6892, 0.6072]}, {"w": "day.", "b": [0.6955, 0.5875, 0.7365, 0.6072]}]}, {"id": "b_2", "type": "paragraph", "text": "You can go even further: do a coordinate change, and express the (x, y) coordinates as polar coordinates with regard to the center of the image. Your input will become the angle theta of each clock hand. At this point, your features are making the problem so easy that no machine learning is required; a simple rounding operation and dictionary lookup are enough to recover the approximate time of day.", "words": [{"w": "You", "b": [0.1294, 0.6303, 0.1703, 0.65]}, {"w": "can", "b": [0.1766, 0.6303, 0.2116, 0.65]}, {"w": "go", "b": [0.218, 0.6303, 0.2432, 0.65]}, {"w": "even", "b": [0.2495, 0.6303, 0.2971, 0.65]}, {"w": "further:", "b": [0.3034, 0.6303, 0.3791, 0.65]}, {"w": "do", "b": [0.3854, 0.6303, 0.4106, 0.65]}, {"w": "a", "b": [0.4169, 0.6303, 0.4281, 0.65]}, {"w": "coordinate", "b": [0.4344, 0.6303, 0.5409, 0.65]}, {"w": "change,", "b": [0.5472, 0.6303, 0.6249, 0.65]}, {"w": "and", "b": [0.6313, 0.6303, 0.6677, 0.65]}, {"w": "express", "b": [0.674, 0.6303, 0.7496, 0.65]}, {"w": "the", "b": [0.7559, 0.6303, 0.7868, 0.65]}, {"w": "(x,", "b": [0.7931, 0.6303, 0.8204, 0.65]}, {"w": "y)", "b": [0.8267, 0.6303, 0.8477, 0.65]}, {"w": "coordinates", "b": [0.1294, 0.6508, 0.2457, 0.6705]}, {"w": "as", "b": [0.252, 0.6508, 0.273, 0.6705]}, {"w": "polar", "b": [0.2793, 0.6508, 0.3312, 0.6705]}, {"w": "coordinates", "b": [0.3375, 0.6508, 0.4538, 0.6705]}, {"w": "with", "b": [0.4601, 0.6508, 0.5049, 0.6705]}, {"w": "regard", "b": [0.5112, 0.6508, 0.5757, 0.6705]}, {"w": "to", "b": [0.582, 0.6508, 0.6016, 0.6705]}, {"w": "the", "b": [0.6079, 0.6508, 0.6387, 0.6705]}, {"w": "center", "b": [0.645, 0.6508, 0.7066, 0.6705]}, {"w": "of", "b": [0.7129, 0.6508, 0.7339, 0.6705]}, {"w": "the", "b": [0.7402, 0.6508, 0.771, 0.6705]}, {"w": "image.", "b": [0.7773, 0.6508, 0.8453, 0.6705]}, {"w": "Your", "b": [0.1294, 0.6713, 0.1787, 0.691]}, {"w": "input", "b": [0.185, 0.6713, 0.2369, 0.691]}, {"w": "will", "b": [0.2432, 0.6713, 0.2825, 0.691]}, {"w": "become", "b": [0.2888, 0.6713, 0.3672, 0.691]}, {"w": "the", "b": [0.3735, 0.6713, 0.4043, 0.691]}, {"w": "angle", "b": [0.4107, 0.6713, 0.4653, 0.691]}, {"w": "theta", "b": [0.4715, 0.6723, 0.5472, 0.6925]}, {"w": "of", "b": [0.5535, 0.6713, 0.5745, 0.691]}, {"w": "each", "b": [0.5808, 0.6713, 0.6271, 0.691]}, {"w": "clock", "b": [0.6334, 0.6713, 0.688, 0.691]}, {"w": "hand.", "b": [0.6943, 0.6713, 0.7497, 0.691]}, {"w": "At", "b": [0.756, 0.6713, 0.7812, 0.691]}, {"w": "this", "b": [0.7875, 0.6713, 0.8239, 0.691]}, {"w": "point,", "b": [0.1294, 0.6927, 0.1876, 0.7124]}, {"w": "your", "b": [0.1939, 0.6927, 0.2401, 0.7124]}, {"w": "features", "b": [0.2464, 0.6927, 0.3263, 0.7124]}, {"w": "are", "b": [0.3326, 0.6927, 0.3634, 0.7124]}, {"w": "making", "b": [0.3697, 0.6927, 0.4454, 0.7124]}, {"w": "the", "b": [0.4517, 0.6927, 0.4825, 0.7124]}, {"w": "problem", "b": [0.4888, 0.6927, 0.5729, 0.7124]}, {"w": "so", "b": [0.5792, 0.6927, 0.6016, 0.7124]}, {"w": "easy", "b": [0.6079, 0.6927, 0.6527, 0.7124]}, {"w": "that", "b": [0.6591, 0.6927, 0.6969, 0.7124]}, {"w": "no", "b": [0.7032, 0.6927, 0.7284, 0.7124]}, {"w": "machine", "b": [0.7347, 0.6927, 0.8202, 0.7124]}, {"w": "learning", "b": [0.1294, 0.7132, 0.2121, 0.7329]}, {"w": "is", "b": [0.2184, 0.7132, 0.2352, 0.7329]}, {"w": "required;", "b": [0.2415, 0.7132, 0.3326, 0.7329]}, {"w": "a", "b": [0.3389, 0.7132, 0.3501, 0.7329]}, {"w": "simple", "b": [0.3564, 0.7132, 0.4237, 0.7329]}, {"w": "rounding", "b": [0.4299, 0.7132, 0.521, 0.7329]}, {"w": "operation", "b": [0.5273, 0.7132, 0.6226, 0.7329]}, {"w": "and", "b": [0.6289, 0.7132, 0.6653, 0.7329]}, {"w": "dictionary", "b": [0.6716, 0.7132, 0.7739, 0.7329]}, {"w": "lookup", "b": [0.7802, 0.7132, 0.8503, 0.7329]}, {"w": "are", "b": [0.1294, 0.7337, 0.1602, 0.7534]}, {"w": "enough", "b": [0.1665, 0.7337, 0.2408, 0.7534]}, {"w": "to", "b": [0.2471, 0.7337, 0.2667, 0.7534]}, {"w": "recover", "b": [0.273, 0.7337, 0.3486, 0.7534]}, {"w": "the", "b": [0.355, 0.7337, 0.3858, 0.7534]}, {"w": "approximate", "b": [0.3921, 0.7337, 0.5182, 0.7534]}, {"w": "time", "b": [0.5245, 0.7337, 0.5693, 0.7534]}, {"w": "of", "b": [0.5757, 0.7337, 0.5967, 0.7534]}, {"w": "day.", "b": [0.603, 0.7337, 0.644, 0.7534]}]}, {"id": "b_3", "type": "paragraph", "text": "That’s the essence of feature engineering: making a problem easier by expressing it in a simpler way. It usually requires understanding the problem in depth.", "words": [{"w": "That’s", "b": [0.1294, 0.7764, 0.1925, 0.7962]}, {"w": "the", "b": [0.1988, 0.7764, 0.2296, 0.7962]}, {"w": "essence", "b": [0.2359, 0.7764, 0.3129, 0.7962]}, {"w": "of", "b": [0.3192, 0.7764, 0.3403, 0.7962]}, {"w": "feature", "b": [0.3466, 0.7764, 0.4166, 0.7962]}, {"w": "engineering:", "b": [0.4229, 0.7764, 0.549, 0.7962]}, {"w": "making", "b": [0.5553, 0.7764, 0.631, 0.7962]}, {"w": "a", "b": [0.6373, 0.7764, 0.6485, 0.7962]}, {"w": "problem", "b": [0.6548, 0.7764, 0.7389, 0.7962]}, {"w": "easier", "b": [0.7452, 0.7764, 0.804, 0.7962]}, {"w": "by", "b": [0.8103, 0.7764, 0.8355, 0.7962]}, {"w": "expressing", "b": [0.1294, 0.7969, 0.2373, 0.8167]}, {"w": "it", "b": [0.2436, 0.7969, 0.2576, 0.8167]}, {"w": "in", "b": [0.2639, 0.7969, 0.2836, 0.8167]}, {"w": "a", "b": [0.2899, 0.7969, 0.3011, 0.8167]}, {"w": "simpler", "b": [0.3074, 0.7969, 0.3831, 0.8167]}, {"w": "way.", "b": [0.3894, 0.7969, 0.436, 0.8167]}, {"w": "It", "b": [0.4423, 0.7969, 0.4577, 0.8167]}, {"w": "usually", "b": [0.4641, 0.7969, 0.5369, 0.8167]}, {"w": "requires", "b": [0.5432, 0.7969, 0.6245, 0.8167]}, {"w": "understanding", "b": [0.6308, 0.7969, 0.7737, 0.8167]}, {"w": "the", "b": [0.78, 0.7969, 0.8108, 0.8167]}, {"w": "problem", "b": [0.1294, 0.8174, 0.2135, 0.8372]}, {"w": "in", "b": [0.2198, 0.8174, 0.2394, 0.8372]}, {"w": "depth.", "b": [0.2457, 0.8174, 0.3081, 0.8372]}]}, {"id": "b_4", "type": "paragraph", "text": "Before deep learning, feature engineering used to be critical, because classical shallow algorithms didn’t have hypothesis spaces rich enough", "words": [{"w": "Before", "b": [0.1294, 0.8602, 0.1981, 0.88]}, {"w": "deep", "b": [0.2044, 0.8602, 0.252, 0.88]}, {"w": "learning,", "b": [0.2583, 0.8602, 0.3473, 0.88]}, {"w": "feature", "b": [0.3536, 0.8602, 0.4236, 0.88]}, {"w": "engineering", "b": [0.4299, 0.8602, 0.549, 0.88]}, {"w": "used", "b": [0.5553, 0.8602, 0.6015, 0.88]}, {"w": "to", "b": [0.6078, 0.8602, 0.6275, 0.88]}, {"w": "be", "b": [0.6338, 0.8602, 0.6576, 0.88]}, {"w": "critical,", "b": [0.6639, 0.8602, 0.7403, 0.88]}, {"w": "because", "b": [0.7466, 0.8602, 0.8264, 0.88]}, {"w": "classical", "b": [0.1294, 0.8807, 0.2149, 0.9005]}, {"w": "shallow", "b": [0.2212, 0.8807, 0.2997, 0.9005]}, {"w": "algorithms", "b": [0.306, 0.8807, 0.4139, 0.9005]}, {"w": "didn’t", "b": [0.4202, 0.8807, 0.48, 0.9005]}, {"w": "have", "b": [0.4863, 0.8807, 0.5339, 0.9005]}, {"w": "hypothesis", "b": [0.5402, 0.8807, 0.6481, 0.9005]}, {"w": "spaces", "b": [0.6544, 0.8807, 0.7202, 0.9005]}, {"w": "rich", "b": [0.7265, 0.8807, 0.7658, 0.9005]}, {"w": "enough", "b": [0.7721, 0.8807, 0.8463, 0.9005]}]}]}, {"page": 153, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "to learn useful features by themselves. The way you presented the data to the algorithm was essential to its success. For instance, before convolutional neural networks became successful on the MNIST digit- classification problem, solutions were typically based on hardcoded features such as the number of loops in a digit image, the height of each digit in an image, a histogram of pixel values, and so on.", "words": [{"w": "to", "b": [0.1294, 0.0857, 0.149, 0.1054]}, {"w": "learn", "b": [0.1553, 0.0857, 0.2058, 0.1054]}, {"w": "useful", "b": [0.2121, 0.0857, 0.2737, 0.1054]}, {"w": "features", "b": [0.28, 0.0857, 0.3599, 0.1054]}, {"w": "by", "b": [0.3662, 0.0857, 0.3914, 0.1054]}, {"w": "themselves.", "b": [0.3977, 0.0857, 0.5161, 0.1054]}, {"w": "The", "b": [0.5224, 0.0857, 0.5617, 0.1054]}, {"w": "way", "b": [0.568, 0.0857, 0.61, 0.1054]}, {"w": "you", "b": [0.6163, 0.0857, 0.6541, 0.1054]}, {"w": "presented", "b": [0.6604, 0.0857, 0.7571, 0.1054]}, {"w": "the", "b": [0.7634, 0.0857, 0.7942, 0.1054]}, {"w": "data", "b": [0.8005, 0.0857, 0.8426, 0.1054]}, {"w": "to", "b": [0.8489, 0.0857, 0.8685, 0.1054]}, {"w": "the", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "algorithm", "b": [0.1665, 0.1062, 0.2646, 0.1259]}, {"w": "was", "b": [0.271, 0.1062, 0.3102, 0.1259]}, {"w": "essential", "b": [0.3165, 0.1062, 0.4034, 0.1259]}, {"w": "to", "b": [0.4097, 0.1062, 0.4293, 0.1259]}, {"w": "its", "b": [0.4356, 0.1062, 0.4594, 0.1259]}, {"w": "success.", "b": [0.4657, 0.1062, 0.5477, 0.1259]}, {"w": "For", "b": [0.554, 0.1062, 0.589, 0.1259]}, {"w": "instance,", "b": [0.5953, 0.1062, 0.6843, 0.1259]}, {"w": "before", "b": [0.6906, 0.1062, 0.755, 0.1259]}, {"w": "convolutional", "b": [0.1294, 0.1267, 0.2682, 0.1464]}, {"w": "neural", "b": [0.2745, 0.1267, 0.3375, 0.1464]}, {"w": "networks", "b": [0.3438, 0.1267, 0.4363, 0.1464]}, {"w": "became", "b": [0.4426, 0.1267, 0.5196, 0.1464]}, {"w": "successful", "b": [0.5259, 0.1267, 0.6296, 0.1464]}, {"w": "on", "b": [0.6359, 0.1267, 0.6611, 0.1464]}, {"w": "the", "b": [0.6675, 0.1267, 0.6983, 0.1464]}, {"w": "MNIST", "b": [0.7046, 0.1267, 0.7831, 0.1464]}, {"w": "digit-", "b": [0.7894, 0.1267, 0.844, 0.1464]}, {"w": "classification", "b": [0.1294, 0.1472, 0.2625, 0.1669]}, {"w": "problem,", "b": [0.2688, 0.1472, 0.3592, 0.1669]}, {"w": "solutions", "b": [0.3655, 0.1472, 0.4566, 0.1669]}, {"w": "were", "b": [0.4629, 0.1472, 0.5119, 0.1669]}, {"w": "typically", "b": [0.5182, 0.1472, 0.6065, 0.1669]}, {"w": "based", "b": [0.6128, 0.1472, 0.6702, 0.1669]}, {"w": "on", "b": [0.6766, 0.1472, 0.7018, 0.1669]}, {"w": "hardcoded", "b": [0.7081, 0.1472, 0.8132, 0.1669]}, {"w": "features", "b": [0.1294, 0.1677, 0.2093, 0.1874]}, {"w": "such", "b": [0.2156, 0.1677, 0.2618, 0.1874]}, {"w": "as", "b": [0.2681, 0.1677, 0.2891, 0.1874]}, {"w": "the", "b": [0.2954, 0.1677, 0.3262, 0.1874]}, {"w": "number", "b": [0.3326, 0.1677, 0.4096, 0.1874]}, {"w": "of", "b": [0.4159, 0.1677, 0.4369, 0.1874]}, {"w": "loops", "b": [0.4432, 0.1677, 0.4979, 0.1874]}, {"w": "in", "b": [0.5042, 0.1677, 0.5238, 0.1874]}, {"w": "a", "b": [0.5301, 0.1677, 0.5413, 0.1874]}, {"w": "digit", "b": [0.5477, 0.1677, 0.5939, 0.1874]}, {"w": "image,", "b": [0.6002, 0.1677, 0.6682, 0.1874]}, {"w": "the", "b": [0.6745, 0.1677, 0.7053, 0.1874]}, {"w": "height", "b": [0.7116, 0.1677, 0.7747, 0.1874]}, {"w": "of", "b": [0.781, 0.1677, 0.802, 0.1874]}, {"w": "each", "b": [0.8083, 0.1677, 0.8545, 0.1874]}, {"w": "digit", "b": [0.1294, 0.1882, 0.1757, 0.2079]}, {"w": "in", "b": [0.182, 0.1882, 0.2016, 0.2079]}, {"w": "an", "b": [0.2079, 0.1882, 0.2317, 0.2079]}, {"w": "image,", "b": [0.238, 0.1882, 0.306, 0.2079]}, {"w": "a", "b": [0.3123, 0.1882, 0.3235, 0.2079]}, {"w": "histogram", "b": [0.3298, 0.1882, 0.4307, 0.2079]}, {"w": "of", "b": [0.437, 0.1882, 0.458, 0.2079]}, {"w": "pixel", "b": [0.4643, 0.1882, 0.5148, 0.2079]}, {"w": "values,", "b": [0.5211, 0.1882, 0.5918, 0.2079]}, {"w": "and", "b": [0.5981, 0.1882, 0.6346, 0.2079]}, {"w": "so", "b": [0.6409, 0.1882, 0.6633, 0.2079]}, {"w": "on.", "b": [0.6696, 0.1882, 0.7011, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "Fortunately, modern deep learning removes the need for most feature engineering, because neural networks are capable of automatically extracting useful features from raw data. Does this mean you don’t have to worry about feature engineering as long as you’re using deep neural networks? No, for two reasons:", "words": [{"w": "Fortunately,", "b": [0.1294, 0.231, 0.2504, 0.2507]}, {"w": "modern", "b": [0.2567, 0.231, 0.3338, 0.2507]}, {"w": "deep", "b": [0.3401, 0.231, 0.3877, 0.2507]}, {"w": "learning", "b": [0.394, 0.231, 0.4767, 0.2507]}, {"w": "removes", "b": [0.483, 0.231, 0.5684, 0.2507]}, {"w": "the", "b": [0.5747, 0.231, 0.6056, 0.2507]}, {"w": "need", "b": [0.6119, 0.231, 0.6595, 0.2507]}, {"w": "for", "b": [0.6658, 0.231, 0.6952, 0.2507]}, {"w": "most", "b": [0.7015, 0.231, 0.7506, 0.2507]}, {"w": "feature", "b": [0.7569, 0.231, 0.8269, 0.2507]}, {"w": "engineering,", "b": [0.1294, 0.2515, 0.2548, 0.2712]}, {"w": "because", "b": [0.2611, 0.2515, 0.341, 0.2712]}, {"w": "neural", "b": [0.3473, 0.2515, 0.4103, 0.2712]}, {"w": "networks", "b": [0.4166, 0.2515, 0.5091, 0.2712]}, {"w": "are", "b": [0.5154, 0.2515, 0.5462, 0.2712]}, {"w": "capable", "b": [0.5525, 0.2515, 0.6295, 0.2712]}, {"w": "of", "b": [0.6358, 0.2515, 0.6569, 0.2712]}, {"w": "automatically", "b": [0.6632, 0.2515, 0.8005, 0.2712]}, {"w": "extracting", "b": [0.1294, 0.272, 0.2303, 0.2917]}, {"w": "useful", "b": [0.2366, 0.272, 0.2982, 0.2917]}, {"w": "features", "b": [0.3046, 0.272, 0.3844, 0.2917]}, {"w": "from", "b": [0.3907, 0.272, 0.4397, 0.2917]}, {"w": "raw", "b": [0.446, 0.272, 0.4839, 0.2917]}, {"w": "data.", "b": [0.4902, 0.272, 0.5385, 0.2917]}, {"w": "Does", "b": [0.5448, 0.272, 0.5966, 0.2917]}, {"w": "this", "b": [0.603, 0.272, 0.6394, 0.2917]}, {"w": "mean", "b": [0.6457, 0.272, 0.7003, 0.2917]}, {"w": "you", "b": [0.7067, 0.272, 0.7445, 0.2917]}, {"w": "don’t", "b": [0.7508, 0.272, 0.8035, 0.2917]}, {"w": "have", "b": [0.8098, 0.272, 0.8575, 0.2917]}, {"w": "to", "b": [0.1294, 0.2925, 0.149, 0.3122]}, {"w": "worry", "b": [0.1553, 0.2925, 0.2156, 0.3122]}, {"w": "about", "b": [0.2219, 0.2925, 0.2779, 0.3122]}, {"w": "feature", "b": [0.2842, 0.2925, 0.3543, 0.3122]}, {"w": "engineering", "b": [0.3606, 0.2925, 0.4797, 0.3122]}, {"w": "as", "b": [0.486, 0.2925, 0.507, 0.3122]}, {"w": "long", "b": [0.5133, 0.2925, 0.5581, 0.3122]}, {"w": "as", "b": [0.5645, 0.2925, 0.5855, 0.3122]}, {"w": "you’re", "b": [0.5918, 0.2925, 0.6576, 0.3122]}, {"w": "using", "b": [0.6639, 0.2925, 0.7185, 0.3122]}, {"w": "deep", "b": [0.7248, 0.2925, 0.7725, 0.3122]}, {"w": "neural", "b": [0.7788, 0.2925, 0.8418, 0.3122]}, {"w": "networks?", "b": [0.1294, 0.313, 0.2331, 0.3327]}, {"w": "No,", "b": [0.2394, 0.313, 0.2765, 0.3327]}, {"w": "for", "b": [0.2828, 0.313, 0.3122, 0.3327]}, {"w": "two", "b": [0.3186, 0.313, 0.3564, 0.3327]}, {"w": "reasons:", "b": [0.3627, 0.313, 0.4454, 0.3327]}]}, {"id": "b_2", "type": "paragraph", "text": "Good features still allow you to solve problems more elegantly while using fewer resources. For instance, it would be ridiculous to solve the problem of reading a clock face using a convolutional neural network. Good features let you solve a problem with far less data. The ability of deep-learning models to learn features on their own relies on having lots of training data available; if you have only a few samples, then the information value in their features becomes critical.", "words": [{"w": "Good", "b": [0.1799, 0.3513, 0.2359, 0.371]}, {"w": "features", "b": [0.2422, 0.3513, 0.3221, 0.371]}, {"w": "still", "b": [0.3284, 0.3513, 0.3662, 0.371]}, {"w": "allow", "b": [0.3725, 0.3513, 0.4286, 0.371]}, {"w": "you", "b": [0.4349, 0.3513, 0.4727, 0.371]}, {"w": "to", "b": [0.479, 0.3513, 0.4987, 0.371]}, {"w": "solve", "b": [0.505, 0.3513, 0.5582, 0.371]}, {"w": "problems", "b": [0.5645, 0.3513, 0.6584, 0.371]}, {"w": "more", "b": [0.6647, 0.3513, 0.7166, 0.371]}, {"w": "elegantly", "b": [0.7229, 0.3513, 0.8154, 0.371]}, {"w": "while", "b": [0.1799, 0.3718, 0.2359, 0.3915]}, {"w": "using", "b": [0.2422, 0.3718, 0.2969, 0.3915]}, {"w": "fewer", "b": [0.3032, 0.3718, 0.3606, 0.3915]}, {"w": "resources.", "b": [0.3669, 0.3718, 0.4685, 0.3915]}, {"w": "For", "b": [0.4748, 0.3718, 0.5098, 0.3915]}, {"w": "instance,", "b": [0.5161, 0.3718, 0.6051, 0.3915]}, {"w": "it", "b": [0.6114, 0.3718, 0.6254, 0.3915]}, {"w": "would", "b": [0.6317, 0.3718, 0.6948, 0.3915]}, {"w": "be", "b": [0.7011, 0.3718, 0.7249, 0.3915]}, {"w": "ridiculous", "b": [0.7312, 0.3718, 0.8321, 0.3915]}, {"w": "to", "b": [0.8384, 0.3718, 0.858, 0.3915]}, {"w": "solve", "b": [0.1799, 0.3923, 0.2331, 0.412]}, {"w": "the", "b": [0.2394, 0.3923, 0.2702, 0.412]}, {"w": "problem", "b": [0.2766, 0.3923, 0.3606, 0.412]}, {"w": "of", "b": [0.3669, 0.3923, 0.388, 0.412]}, {"w": "reading", "b": [0.3943, 0.3923, 0.4699, 0.412]}, {"w": "a", "b": [0.4762, 0.3923, 0.4874, 0.412]}, {"w": "clock", "b": [0.4937, 0.3923, 0.5484, 0.412]}, {"w": "face", "b": [0.5547, 0.3923, 0.5967, 0.412]}, {"w": "using", "b": [0.603, 0.3923, 0.6576, 0.412]}, {"w": "a", "b": [0.6639, 0.3923, 0.6751, 0.412]}, {"w": "convolutional", "b": [0.6815, 0.3923, 0.8202, 0.412]}, {"w": "neural", "b": [0.1799, 0.4128, 0.2429, 0.4325]}, {"w": "network.", "b": [0.2492, 0.4128, 0.3382, 0.4325]}, {"w": "Good", "b": [0.1799, 0.4333, 0.2359, 0.453]}, {"w": "features", "b": [0.2422, 0.4333, 0.3221, 0.453]}, {"w": "let", "b": [0.3284, 0.4333, 0.3536, 0.453]}, {"w": "you", "b": [0.3599, 0.4333, 0.3977, 0.453]}, {"w": "solve", "b": [0.404, 0.4333, 0.4573, 0.453]}, {"w": "a", "b": [0.4636, 0.4333, 0.4748, 0.453]}, {"w": "problem", "b": [0.4811, 0.4333, 0.5652, 0.453]}, {"w": "with", "b": [0.5715, 0.4333, 0.6163, 0.453]}, {"w": "far", "b": [0.6227, 0.4333, 0.6507, 0.453]}, {"w": "less", "b": [0.657, 0.4333, 0.6948, 0.453]}, {"w": "data.", "b": [0.7011, 0.4333, 0.7494, 0.453]}, {"w": "The", "b": [0.7557, 0.4333, 0.795, 0.453]}, {"w": "ability", "b": [0.8013, 0.4333, 0.8658, 0.453]}, {"w": "of", "b": [0.1799, 0.4538, 0.2009, 0.4735]}, {"w": "deep-learning", "b": [0.2072, 0.4538, 0.3459, 0.4735]}, {"w": "models", "b": [0.3522, 0.4538, 0.4251, 0.4735]}, {"w": "to", "b": [0.4314, 0.4538, 0.451, 0.4735]}, {"w": "learn", "b": [0.4573, 0.4538, 0.5077, 0.4735]}, {"w": "features", "b": [0.514, 0.4538, 0.5939, 0.4735]}, {"w": "on", "b": [0.6002, 0.4538, 0.6254, 0.4735]}, {"w": "their", "b": [0.6317, 0.4538, 0.6779, 0.4735]}, {"w": "own", "b": [0.6843, 0.4538, 0.7277, 0.4735]}, {"w": "relies", "b": [0.7339, 0.4538, 0.7886, 0.4735]}, {"w": "on", "b": [0.7949, 0.4538, 0.8201, 0.4735]}, {"w": "having", "b": [0.1799, 0.4743, 0.2485, 0.494]}, {"w": "lots", "b": [0.2548, 0.4743, 0.2913, 0.494]}, {"w": "of", "b": [0.2976, 0.4743, 0.3186, 0.494]}, {"w": "training", "b": [0.3249, 0.4743, 0.4034, 0.494]}, {"w": "data", "b": [0.4097, 0.4743, 0.4517, 0.494]}, {"w": "available;", "b": [0.458, 0.4743, 0.5561, 0.494]}, {"w": "if", "b": [0.5624, 0.4743, 0.5778, 0.494]}, {"w": "you", "b": [0.5841, 0.4743, 0.622, 0.494]}, {"w": "have", "b": [0.6283, 0.4743, 0.6759, 0.494]}, {"w": "only", "b": [0.6822, 0.4743, 0.7271, 0.494]}, {"w": "a", "b": [0.7334, 0.4743, 0.7446, 0.494]}, {"w": "few", "b": [0.7509, 0.4743, 0.7887, 0.494]}, {"w": "samples,", "b": [0.1799, 0.4948, 0.2674, 0.5145]}, {"w": "then", "b": [0.2738, 0.4948, 0.3172, 0.5145]}, {"w": "the", "b": [0.3235, 0.4948, 0.3543, 0.5145]}, {"w": "information", "b": [0.3606, 0.4948, 0.4797, 0.5145]}, {"w": "value", "b": [0.4861, 0.4948, 0.5407, 0.5145]}, {"w": "in", "b": [0.547, 0.4948, 0.5666, 0.5145]}, {"w": "their", "b": [0.5729, 0.4948, 0.6192, 0.5145]}, {"w": "features", "b": [0.6255, 0.4948, 0.7053, 0.5145]}, {"w": "becomes", "b": [0.7115, 0.4948, 0.7998, 0.5145]}, {"w": "critical.", "b": [0.1799, 0.5153, 0.2562, 0.535]}]}, {"id": "b_3", "type": "paragraph", "text": "4.4. Overfitting and underfitting", "words": [{"w": "4.4.", "b": [0.1294, 0.5721, 0.172, 0.5943]}, {"w": "Overfitting", "b": [0.1791, 0.5721, 0.3146, 0.5943]}, {"w": "and", "b": [0.3217, 0.5721, 0.3675, 0.5943]}, {"w": "underfitting", "b": [0.3746, 0.5721, 0.5212, 0.5943]}]}, {"id": "b_4", "type": "paragraph", "text": "In all three examples in the previous chapter—predicting movie reviews, topic classification, and house-price regression—the performance of the model on the held-out validation data always peaked after a few epochs and then began to degrade: the model quickly started to overfit to the training data. Overfitting happens in every machine-learning problem. Learning how to deal with overfitting is essential to mastering machine learning.", "words": [{"w": "In", "b": [0.1294, 0.6178, 0.1504, 0.6375]}, {"w": "all", "b": [0.1567, 0.6178, 0.182, 0.6375]}, {"w": "three", "b": [0.1883, 0.6178, 0.2387, 0.6375]}, {"w": "examples", "b": [0.245, 0.6178, 0.3403, 0.6375]}, {"w": "in", "b": [0.3466, 0.6178, 0.3662, 0.6375]}, {"w": "the", "b": [0.3725, 0.6178, 0.4033, 0.6375]}, {"w": "previous", "b": [0.4096, 0.6178, 0.4965, 0.6375]}, {"w": "chapter—predicting", "b": [0.5028, 0.6178, 0.7046, 0.6375]}, {"w": "movie", "b": [0.7109, 0.6178, 0.774, 0.6375]}, {"w": "reviews,", "b": [0.7803, 0.6178, 0.865, 0.6375]}, {"w": "topic", "b": [0.1294, 0.6383, 0.1799, 0.658]}, {"w": "classification,", "b": [0.1862, 0.6383, 0.3256, 0.658]}, {"w": "and", "b": [0.3319, 0.6383, 0.3683, 0.658]}, {"w": "house-price", "b": [0.3746, 0.6383, 0.4923, 0.658]}, {"w": "regression—the", "b": [0.4986, 0.6383, 0.6583, 0.658]}, {"w": "performance", "b": [0.6646, 0.6383, 0.792, 0.658]}, {"w": "of", "b": [0.7983, 0.6383, 0.8194, 0.658]}, {"w": "the", "b": [0.8257, 0.6383, 0.8565, 0.658]}, {"w": "model", "b": [0.1294, 0.6588, 0.1925, 0.6785]}, {"w": "on", "b": [0.1988, 0.6588, 0.224, 0.6785]}, {"w": "the", "b": [0.2303, 0.6588, 0.2611, 0.6785]}, {"w": "held-out", "b": [0.2674, 0.6588, 0.3515, 0.6785]}, {"w": "validation", "b": [0.3578, 0.6588, 0.4587, 0.6785]}, {"w": "data", "b": [0.465, 0.6588, 0.5071, 0.6785]}, {"w": "always", "b": [0.5134, 0.6588, 0.5834, 0.6785]}, {"w": "peaked", "b": [0.5897, 0.6588, 0.6612, 0.6785]}, {"w": "after", "b": [0.6675, 0.6588, 0.7137, 0.6785]}, {"w": "a", "b": [0.72, 0.6588, 0.7312, 0.6785]}, {"w": "few", "b": [0.7375, 0.6588, 0.7753, 0.6785]}, {"w": "epochs", "b": [0.7816, 0.6588, 0.8517, 0.6785]}, {"w": "and", "b": [0.1294, 0.6793, 0.1658, 0.699]}, {"w": "then", "b": [0.1721, 0.6793, 0.2156, 0.699]}, {"w": "began", "b": [0.2219, 0.6793, 0.2821, 0.699]}, {"w": "to", "b": [0.2884, 0.6793, 0.3081, 0.699]}, {"w": "degrade:", "b": [0.3144, 0.6793, 0.4012, 0.699]}, {"w": "the", "b": [0.4075, 0.6793, 0.4384, 0.699]}, {"w": "model", "b": [0.4447, 0.6793, 0.5077, 0.699]}, {"w": "quickly", "b": [0.514, 0.6793, 0.5896, 0.699]}, {"w": "started", "b": [0.596, 0.6793, 0.6632, 0.699]}, {"w": "to", "b": [0.6695, 0.6793, 0.6891, 0.699]}, {"w": "overfit", "b": [0.6954, 0.6793, 0.7613, 0.699]}, {"w": "to", "b": [0.7675, 0.6793, 0.7872, 0.699]}, {"w": "the", "b": [0.7935, 0.6793, 0.8243, 0.699]}, {"w": "training", "b": [0.1294, 0.6998, 0.2079, 0.7195]}, {"w": "data.", "b": [0.2142, 0.6998, 0.2625, 0.7195]}, {"w": "Overfitting", "b": [0.2688, 0.6998, 0.3809, 0.7195]}, {"w": "happens", "b": [0.3872, 0.6998, 0.4699, 0.7195]}, {"w": "in", "b": [0.4762, 0.6998, 0.4958, 0.7195]}, {"w": "every", "b": [0.5021, 0.6998, 0.5582, 0.7195]}, {"w": "machine-learning", "b": [0.5645, 0.6998, 0.741, 0.7195]}, {"w": "problem.", "b": [0.7473, 0.6998, 0.8377, 0.7195]}, {"w": "Learning", "b": [0.1294, 0.7203, 0.2205, 0.74]}, {"w": "how", "b": [0.2268, 0.7203, 0.2702, 0.74]}, {"w": "to", "b": [0.2765, 0.7203, 0.2962, 0.74]}, {"w": "deal", "b": [0.3025, 0.7203, 0.3445, 0.74]}, {"w": "with", "b": [0.3508, 0.7203, 0.3956, 0.74]}, {"w": "overfitting", "b": [0.402, 0.7203, 0.5085, 0.74]}, {"w": "is", "b": [0.5148, 0.7203, 0.5316, 0.74]}, {"w": "essential", "b": [0.5379, 0.7203, 0.6248, 0.74]}, {"w": "to", "b": [0.631, 0.7203, 0.6506, 0.74]}, {"w": "mastering", "b": [0.6569, 0.7203, 0.7564, 0.74]}, {"w": "machine", "b": [0.7627, 0.7203, 0.8482, 0.74]}, {"w": "learning.", "b": [0.1294, 0.7408, 0.2184, 0.7605]}]}, {"id": "b_5", "type": "paragraph", "text": "The fundamental issue in machine learning is the tension between optimization and generalization. Optimization refers to the process of adjusting a model to get the best performance possible on the training data (the learning in machine learning), whereas generalization refers to how well the trained model performs on data it has never seen before. The goal of the game is to get good generalization, of course, but you", "words": [{"w": "The", "b": [0.1294, 0.7836, 0.1686, 0.8033]}, {"w": "fundamental", "b": [0.1749, 0.7836, 0.301, 0.8033]}, {"w": "issue", "b": [0.3074, 0.7836, 0.3578, 0.8033]}, {"w": "in", "b": [0.3641, 0.7836, 0.3837, 0.8033]}, {"w": "machine", "b": [0.39, 0.7836, 0.4755, 0.8033]}, {"w": "learning", "b": [0.4818, 0.7836, 0.5645, 0.8033]}, {"w": "is", "b": [0.5708, 0.7836, 0.5876, 0.8033]}, {"w": "the", "b": [0.5939, 0.7836, 0.6247, 0.8033]}, {"w": "tension", "b": [0.6311, 0.7836, 0.7039, 0.8033]}, {"w": "between", "b": [0.7102, 0.7836, 0.7943, 0.8033]}, {"w": "optimization", "b": [0.1294, 0.8041, 0.257, 0.8238]}, {"w": "and", "b": [0.2633, 0.8041, 0.2997, 0.8238]}, {"w": "generalization.", "b": [0.306, 0.8041, 0.4552, 0.8238]}, {"w": "Optimization", "b": [0.4614, 0.8041, 0.5932, 0.8238]}, {"w": "refers", "b": [0.5995, 0.8041, 0.6569, 0.8238]}, {"w": "to", "b": [0.6632, 0.8041, 0.6828, 0.8238]}, {"w": "the", "b": [0.6891, 0.8041, 0.72, 0.8238]}, {"w": "process", "b": [0.7263, 0.8041, 0.8019, 0.8238]}, {"w": "of", "b": [0.8082, 0.8041, 0.8292, 0.8238]}, {"w": "adjusting", "b": [0.1294, 0.8246, 0.2219, 0.8443]}, {"w": "a", "b": [0.2282, 0.8246, 0.2394, 0.8443]}, {"w": "model", "b": [0.2457, 0.8246, 0.3088, 0.8443]}, {"w": "to", "b": [0.3151, 0.8246, 0.3347, 0.8443]}, {"w": "get", "b": [0.341, 0.8246, 0.3719, 0.8443]}, {"w": "the", "b": [0.3782, 0.8246, 0.409, 0.8443]}, {"w": "best", "b": [0.4153, 0.8246, 0.4559, 0.8443]}, {"w": "performance", "b": [0.4622, 0.8246, 0.5897, 0.8443]}, {"w": "possible", "b": [0.596, 0.8246, 0.6787, 0.8443]}, {"w": "on", "b": [0.685, 0.8246, 0.7102, 0.8443]}, {"w": "the", "b": [0.7165, 0.8246, 0.7474, 0.8443]}, {"w": "training", "b": [0.7537, 0.8246, 0.8322, 0.8443]}, {"w": "data", "b": [0.1294, 0.8451, 0.1714, 0.8648]}, {"w": "(the", "b": [0.1777, 0.8451, 0.217, 0.8648]}, {"w": "learning", "b": [0.2232, 0.8451, 0.3087, 0.8648]}, {"w": "in", "b": [0.315, 0.8451, 0.3346, 0.8648]}, {"w": "machine", "b": [0.3409, 0.8451, 0.4264, 0.8648]}, {"w": "learning),", "b": [0.4327, 0.8451, 0.5329, 0.8648]}, {"w": "whereas", "b": [0.5392, 0.8451, 0.6218, 0.8648]}, {"w": "generalization", "b": [0.6281, 0.8451, 0.7739, 0.8648]}, {"w": "refers", "b": [0.7802, 0.8451, 0.8376, 0.8648]}, {"w": "to", "b": [0.8439, 0.8451, 0.8635, 0.8648]}, {"w": "how", "b": [0.1294, 0.8656, 0.1729, 0.8853]}, {"w": "well", "b": [0.1792, 0.8656, 0.2226, 0.8853]}, {"w": "the", "b": [0.2289, 0.8656, 0.2597, 0.8853]}, {"w": "trained", "b": [0.266, 0.8656, 0.3361, 0.8853]}, {"w": "model", "b": [0.3424, 0.8656, 0.4055, 0.8853]}, {"w": "performs", "b": [0.4118, 0.8656, 0.5028, 0.8853]}, {"w": "on", "b": [0.5091, 0.8656, 0.5344, 0.8853]}, {"w": "data", "b": [0.5407, 0.8656, 0.5827, 0.8853]}, {"w": "it", "b": [0.589, 0.8656, 0.603, 0.8853]}, {"w": "has", "b": [0.6093, 0.8656, 0.643, 0.8853]}, {"w": "never", "b": [0.6493, 0.8656, 0.7053, 0.8853]}, {"w": "seen", "b": [0.7116, 0.8656, 0.7564, 0.8853]}, {"w": "before.", "b": [0.7627, 0.8656, 0.8335, 0.8853]}, {"w": "The", "b": [0.1294, 0.8861, 0.1686, 0.9058]}, {"w": "goal", "b": [0.1749, 0.8861, 0.2184, 0.9058]}, {"w": "of", "b": [0.2247, 0.8861, 0.2457, 0.9058]}, {"w": "the", "b": [0.252, 0.8861, 0.2828, 0.9058]}, {"w": "game", "b": [0.2891, 0.8861, 0.3438, 0.9058]}, {"w": "is", "b": [0.3501, 0.8861, 0.3669, 0.9058]}, {"w": "to", "b": [0.3732, 0.8861, 0.3928, 0.9058]}, {"w": "get", "b": [0.3992, 0.8861, 0.43, 0.9058]}, {"w": "good", "b": [0.4363, 0.8861, 0.4867, 0.9058]}, {"w": "generalization,", "b": [0.493, 0.8861, 0.6423, 0.9058]}, {"w": "of", "b": [0.6485, 0.8861, 0.6695, 0.9058]}, {"w": "course,", "b": [0.6758, 0.8861, 0.7479, 0.9058]}, {"w": "but", "b": [0.7542, 0.8861, 0.7865, 0.9058]}, {"w": "you", "b": [0.7928, 0.8861, 0.8306, 0.9058]}]}]}, {"page": 154, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "don’t control generalization; you can only adjust the model based on its training data.", "words": [{"w": "don’t", "b": [0.1294, 0.0857, 0.1822, 0.1054]}, {"w": "control", "b": [0.1885, 0.0857, 0.26, 0.1054]}, {"w": "generalization;", "b": [0.2663, 0.0857, 0.4162, 0.1054]}, {"w": "you", "b": [0.4225, 0.0857, 0.4603, 0.1054]}, {"w": "can", "b": [0.4667, 0.0857, 0.5017, 0.1054]}, {"w": "only", "b": [0.508, 0.0857, 0.5528, 0.1054]}, {"w": "adjust", "b": [0.5591, 0.0857, 0.6194, 0.1054]}, {"w": "the", "b": [0.6257, 0.0857, 0.6565, 0.1054]}, {"w": "model", "b": [0.6628, 0.0857, 0.7259, 0.1054]}, {"w": "based", "b": [0.7322, 0.0857, 0.7896, 0.1054]}, {"w": "on", "b": [0.796, 0.0857, 0.8212, 0.1054]}, {"w": "its", "b": [0.8275, 0.0857, 0.8513, 0.1054]}, {"w": "training", "b": [0.1294, 0.1062, 0.2079, 0.1259]}, {"w": "data.", "b": [0.2142, 0.1062, 0.2625, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "At the beginning of training, optimization and generalization are correlated: the lower the loss on training data, the lower the loss on test data. While this is happening, your model is said to be underfit: there is still progress to be made; the network hasn’t yet modeled all relevant patterns in the training data. But after a certain number of iterations on the training data, generalization stops improving, and validation metrics stall and then begin to degrade: the model is starting to overfit. That is, it’s beginning to learn patterns that are specific to the training data but that are misleading or irrelevant when it comes to new data.", "words": [{"w": "At", "b": [0.1294, 0.149, 0.1546, 0.1687]}, {"w": "the", "b": [0.1609, 0.149, 0.1918, 0.1687]}, {"w": "beginning", "b": [0.1981, 0.149, 0.299, 0.1687]}, {"w": "of", "b": [0.3053, 0.149, 0.3263, 0.1687]}, {"w": "training,", "b": [0.3326, 0.149, 0.4174, 0.1687]}, {"w": "optimization", "b": [0.4237, 0.149, 0.5512, 0.1687]}, {"w": "and", "b": [0.5575, 0.149, 0.594, 0.1687]}, {"w": "generalization", "b": [0.6003, 0.149, 0.7432, 0.1687]}, {"w": "are", "b": [0.7495, 0.149, 0.7803, 0.1687]}, {"w": "correlated:", "b": [0.1294, 0.1695, 0.2373, 0.1892]}, {"w": "the", "b": [0.2436, 0.1695, 0.2744, 0.1892]}, {"w": "lower", "b": [0.2807, 0.1695, 0.3382, 0.1892]}, {"w": "the", "b": [0.3445, 0.1695, 0.3753, 0.1892]}, {"w": "loss", "b": [0.3816, 0.1695, 0.4208, 0.1892]}, {"w": "on", "b": [0.4272, 0.1695, 0.4524, 0.1892]}, {"w": "training", "b": [0.4587, 0.1695, 0.5372, 0.1892]}, {"w": "data,", "b": [0.5435, 0.1695, 0.5918, 0.1892]}, {"w": "the", "b": [0.5981, 0.1695, 0.6289, 0.1892]}, {"w": "lower", "b": [0.6352, 0.1695, 0.6927, 0.1892]}, {"w": "the", "b": [0.6989, 0.1695, 0.7297, 0.1892]}, {"w": "loss", "b": [0.736, 0.1695, 0.7753, 0.1892]}, {"w": "on", "b": [0.7816, 0.1695, 0.8068, 0.1892]}, {"w": "test", "b": [0.8131, 0.1695, 0.8481, 0.1892]}, {"w": "data.", "b": [0.1294, 0.19, 0.1777, 0.2097]}, {"w": "While", "b": [0.1841, 0.19, 0.2457, 0.2097]}, {"w": "this", "b": [0.252, 0.19, 0.2885, 0.2097]}, {"w": "is", "b": [0.2948, 0.19, 0.3116, 0.2097]}, {"w": "happening,", "b": [0.3179, 0.19, 0.4293, 0.2097]}, {"w": "your", "b": [0.4356, 0.19, 0.4818, 0.2097]}, {"w": "model", "b": [0.4881, 0.19, 0.5512, 0.2097]}, {"w": "is", "b": [0.5575, 0.19, 0.5743, 0.2097]}, {"w": "said", "b": [0.5807, 0.19, 0.6213, 0.2097]}, {"w": "to", "b": [0.6276, 0.19, 0.6472, 0.2097]}, {"w": "be", "b": [0.6535, 0.19, 0.6773, 0.2097]}, {"w": "underfit:", "b": [0.6836, 0.19, 0.7705, 0.2097]}, {"w": "there", "b": [0.7768, 0.19, 0.8272, 0.2097]}, {"w": "is", "b": [0.8335, 0.19, 0.8503, 0.2097]}, {"w": "still", "b": [0.1294, 0.2105, 0.1673, 0.2302]}, {"w": "progress", "b": [0.1736, 0.2105, 0.259, 0.2302]}, {"w": "to", "b": [0.2654, 0.2105, 0.285, 0.2302]}, {"w": "be", "b": [0.2913, 0.2105, 0.3151, 0.2302]}, {"w": "made;", "b": [0.3214, 0.2105, 0.3831, 0.2302]}, {"w": "the", "b": [0.3894, 0.2105, 0.4202, 0.2302]}, {"w": "network", "b": [0.4265, 0.2105, 0.5092, 0.2302]}, {"w": "hasn’t", "b": [0.5155, 0.2105, 0.5766, 0.2302]}, {"w": "yet", "b": [0.5829, 0.2105, 0.6138, 0.2302]}, {"w": "modeled", "b": [0.6201, 0.2105, 0.7069, 0.2302]}, {"w": "all", "b": [0.7132, 0.2105, 0.7385, 0.2302]}, {"w": "relevant", "b": [0.7448, 0.2105, 0.826, 0.2302]}, {"w": "patterns", "b": [0.1294, 0.231, 0.2093, 0.2507]}, {"w": "in", "b": [0.2156, 0.231, 0.2352, 0.2507]}, {"w": "the", "b": [0.2415, 0.231, 0.2723, 0.2507]}, {"w": "training", "b": [0.2786, 0.231, 0.3571, 0.2507]}, {"w": "data.", "b": [0.3634, 0.231, 0.4118, 0.2507]}, {"w": "But", "b": [0.4181, 0.231, 0.4545, 0.2507]}, {"w": "after", "b": [0.4608, 0.231, 0.507, 0.2507]}, {"w": "a", "b": [0.5133, 0.231, 0.5245, 0.2507]}, {"w": "certain", "b": [0.5308, 0.231, 0.5994, 0.2507]}, {"w": "number", "b": [0.6057, 0.231, 0.6828, 0.2507]}, {"w": "of", "b": [0.6891, 0.231, 0.7101, 0.2507]}, {"w": "iterations", "b": [0.7164, 0.231, 0.8103, 0.2507]}, {"w": "on", "b": [0.8166, 0.231, 0.8418, 0.2507]}, {"w": "the", "b": [0.1294, 0.2515, 0.1602, 0.2712]}, {"w": "training", "b": [0.1665, 0.2515, 0.245, 0.2712]}, {"w": "data,", "b": [0.2513, 0.2515, 0.2997, 0.2712]}, {"w": "generalization", "b": [0.306, 0.2515, 0.4489, 0.2712]}, {"w": "stops", "b": [0.4552, 0.2515, 0.507, 0.2712]}, {"w": "improving,", "b": [0.5133, 0.2515, 0.6248, 0.2712]}, {"w": "and", "b": [0.6311, 0.2515, 0.6675, 0.2712]}, {"w": "validation", "b": [0.6738, 0.2515, 0.7747, 0.2712]}, {"w": "metrics", "b": [0.781, 0.2515, 0.8553, 0.2712]}, {"w": "stall", "b": [0.1294, 0.272, 0.1715, 0.2917]}, {"w": "and", "b": [0.1778, 0.272, 0.2142, 0.2917]}, {"w": "then", "b": [0.2205, 0.272, 0.2639, 0.2917]}, {"w": "begin", "b": [0.2702, 0.272, 0.3263, 0.2917]}, {"w": "to", "b": [0.3326, 0.272, 0.3522, 0.2917]}, {"w": "degrade:", "b": [0.3585, 0.272, 0.4454, 0.2917]}, {"w": "the", "b": [0.4517, 0.272, 0.4825, 0.2917]}, {"w": "model", "b": [0.4888, 0.272, 0.5519, 0.2917]}, {"w": "is", "b": [0.5582, 0.272, 0.575, 0.2917]}, {"w": "starting", "b": [0.5813, 0.272, 0.657, 0.2917]}, {"w": "to", "b": [0.6633, 0.272, 0.6829, 0.2917]}, {"w": "overfit.", "b": [0.6892, 0.272, 0.7628, 0.2917]}, {"w": "That", "b": [0.7691, 0.272, 0.8153, 0.2917]}, {"w": "is,", "b": [0.8216, 0.272, 0.8448, 0.2917]}, {"w": "it’s", "b": [0.1294, 0.2925, 0.1603, 0.3122]}, {"w": "beginning", "b": [0.1666, 0.2925, 0.2675, 0.3122]}, {"w": "to", "b": [0.2738, 0.2925, 0.2934, 0.3122]}, {"w": "learn", "b": [0.2997, 0.2925, 0.3501, 0.3122]}, {"w": "patterns", "b": [0.3564, 0.2925, 0.4363, 0.3122]}, {"w": "that", "b": [0.4426, 0.2925, 0.4804, 0.3122]}, {"w": "are", "b": [0.4867, 0.2925, 0.5175, 0.3122]}, {"w": "specific", "b": [0.5239, 0.2925, 0.6023, 0.3122]}, {"w": "to", "b": [0.6086, 0.2925, 0.6282, 0.3122]}, {"w": "the", "b": [0.6345, 0.2925, 0.6654, 0.3122]}, {"w": "training", "b": [0.6717, 0.2925, 0.7502, 0.3122]}, {"w": "data", "b": [0.7564, 0.2925, 0.7984, 0.3122]}, {"w": "but", "b": [0.8047, 0.2925, 0.8369, 0.3122]}, {"w": "that", "b": [0.1294, 0.313, 0.1673, 0.3327]}, {"w": "are", "b": [0.1736, 0.313, 0.2044, 0.3327]}, {"w": "misleading", "b": [0.2107, 0.313, 0.3214, 0.3327]}, {"w": "or", "b": [0.3277, 0.313, 0.3487, 0.3327]}, {"w": "irrelevant", "b": [0.355, 0.313, 0.4517, 0.3327]}, {"w": "when", "b": [0.458, 0.313, 0.5126, 0.3327]}, {"w": "it", "b": [0.5189, 0.313, 0.5329, 0.3327]}, {"w": "comes", "b": [0.5393, 0.313, 0.6037, 0.3327]}, {"w": "to", "b": [0.61, 0.313, 0.6296, 0.3327]}, {"w": "new", "b": [0.6359, 0.313, 0.678, 0.3327]}, {"w": "data.", "b": [0.6843, 0.313, 0.7326, 0.3327]}]}, {"id": "b_2", "type": "paragraph", "text": "To prevent a model from learning misleading or irrelevant patterns found in the training data, the best solution is to get more training data. A model trained on more data will naturally generalize better. When that isn’t possible, the next-best solution is to modulate the quantity of information that your model is allowed to store or to add constraints on what information it’s allowed to store. If a network can only afford to memorize a small number of patterns, the optimization process will force it to focus on the most prominent patterns, which have a better chance of generalizing well.", "words": [{"w": "To", "b": [0.1294, 0.3557, 0.1557, 0.3755]}, {"w": "prevent", "b": [0.162, 0.3557, 0.2376, 0.3755]}, {"w": "a", "b": [0.2439, 0.3557, 0.2551, 0.3755]}, {"w": "model", "b": [0.2614, 0.3557, 0.3245, 0.3755]}, {"w": "from", "b": [0.3308, 0.3557, 0.3799, 0.3755]}, {"w": "learning", "b": [0.3862, 0.3557, 0.4688, 0.3755]}, {"w": "misleading", "b": [0.4751, 0.3557, 0.5858, 0.3755]}, {"w": "or", "b": [0.5922, 0.3557, 0.6132, 0.3755]}, {"w": "irrelevant", "b": [0.6195, 0.3557, 0.7161, 0.3755]}, {"w": "patterns", "b": [0.7224, 0.3557, 0.8023, 0.3755]}, {"w": "found", "b": [0.8086, 0.3557, 0.8675, 0.3755]}, {"w": "in", "b": [0.1294, 0.3762, 0.149, 0.396]}, {"w": "the", "b": [0.1553, 0.3762, 0.1862, 0.396]}, {"w": "training", "b": [0.1925, 0.3762, 0.271, 0.396]}, {"w": "data,", "b": [0.2773, 0.3762, 0.3256, 0.396]}, {"w": "the", "b": [0.3318, 0.3762, 0.3627, 0.396]}, {"w": "best", "b": [0.369, 0.3762, 0.4096, 0.396]}, {"w": "solution", "b": [0.4159, 0.3762, 0.4972, 0.396]}, {"w": "is", "b": [0.5035, 0.3762, 0.5204, 0.396]}, {"w": "to", "b": [0.5267, 0.3762, 0.5463, 0.396]}, {"w": "get", "b": [0.5526, 0.3762, 0.5834, 0.396]}, {"w": "more", "b": [0.5897, 0.3762, 0.6406, 0.396]}, {"w": "training", "b": [0.6469, 0.3762, 0.7282, 0.396]}, {"w": "data.", "b": [0.7345, 0.3762, 0.7857, 0.396]}, {"w": "A", "b": [0.792, 0.3762, 0.8102, 0.396]}, {"w": "model", "b": [0.1294, 0.3967, 0.1925, 0.4165]}, {"w": "trained", "b": [0.1988, 0.3967, 0.2688, 0.4165]}, {"w": "on", "b": [0.2751, 0.3967, 0.3004, 0.4165]}, {"w": "more", "b": [0.3067, 0.3967, 0.3585, 0.4165]}, {"w": "data", "b": [0.3648, 0.3967, 0.4068, 0.4165]}, {"w": "will", "b": [0.4132, 0.3967, 0.4524, 0.4165]}, {"w": "naturally", "b": [0.4587, 0.3967, 0.5484, 0.4165]}, {"w": "generalize", "b": [0.5547, 0.3967, 0.6583, 0.4165]}, {"w": "better.", "b": [0.6647, 0.3967, 0.7269, 0.4165]}, {"w": "When", "b": [0.7332, 0.3967, 0.7934, 0.4165]}, {"w": "that", "b": [0.7997, 0.3967, 0.8376, 0.4165]}, {"w": "isn’t", "b": [0.1294, 0.4172, 0.1738, 0.437]}, {"w": "possible,", "b": [0.1801, 0.4172, 0.2691, 0.437]}, {"w": "the", "b": [0.2754, 0.4172, 0.3062, 0.437]}, {"w": "next-best", "b": [0.3125, 0.4172, 0.405, 0.437]}, {"w": "solution", "b": [0.4113, 0.4172, 0.4926, 0.437]}, {"w": "is", "b": [0.4989, 0.4172, 0.5158, 0.437]}, {"w": "to", "b": [0.5221, 0.4172, 0.5417, 0.437]}, {"w": "modulate", "b": [0.548, 0.4172, 0.6419, 0.437]}, {"w": "the", "b": [0.6481, 0.4172, 0.679, 0.437]}, {"w": "quantity", "b": [0.6853, 0.4172, 0.768, 0.437]}, {"w": "of", "b": [0.7743, 0.4172, 0.7953, 0.437]}, {"w": "information", "b": [0.1294, 0.4377, 0.2485, 0.4575]}, {"w": "that", "b": [0.2548, 0.4377, 0.2927, 0.4575]}, {"w": "your", "b": [0.299, 0.4377, 0.3452, 0.4575]}, {"w": "model", "b": [0.3515, 0.4377, 0.4146, 0.4575]}, {"w": "is", "b": [0.4209, 0.4377, 0.4377, 0.4575]}, {"w": "allowed", "b": [0.444, 0.4377, 0.5239, 0.4575]}, {"w": "to", "b": [0.5302, 0.4377, 0.5498, 0.4575]}, {"w": "store", "b": [0.5561, 0.4377, 0.6052, 0.4575]}, {"w": "or", "b": [0.6115, 0.4377, 0.6325, 0.4575]}, {"w": "to", "b": [0.6388, 0.4377, 0.6584, 0.4575]}, {"w": "add", "b": [0.6647, 0.4377, 0.7012, 0.4575]}, {"w": "constraints", "b": [0.7075, 0.4377, 0.8168, 0.4575]}, {"w": "on", "b": [0.8231, 0.4377, 0.8483, 0.4575]}, {"w": "what", "b": [0.1294, 0.4582, 0.1785, 0.478]}, {"w": "information", "b": [0.1848, 0.4582, 0.3039, 0.478]}, {"w": "it’s", "b": [0.3102, 0.4582, 0.341, 0.478]}, {"w": "allowed", "b": [0.3473, 0.4582, 0.4272, 0.478]}, {"w": "to", "b": [0.4335, 0.4582, 0.4531, 0.478]}, {"w": "store.", "b": [0.4594, 0.4582, 0.5147, 0.478]}, {"w": "If", "b": [0.521, 0.4582, 0.5378, 0.478]}, {"w": "a", "b": [0.5441, 0.4582, 0.5553, 0.478]}, {"w": "network", "b": [0.5616, 0.4582, 0.6443, 0.478]}, {"w": "can", "b": [0.6506, 0.4582, 0.6856, 0.478]}, {"w": "only", "b": [0.6919, 0.4582, 0.7368, 0.478]}, {"w": "afford", "b": [0.7431, 0.4582, 0.8042, 0.478]}, {"w": "to", "b": [0.8105, 0.4582, 0.8302, 0.478]}, {"w": "memorize", "b": [0.1294, 0.4787, 0.2303, 0.4985]}, {"w": "a", "b": [0.2366, 0.4787, 0.2478, 0.4985]}, {"w": "small", "b": [0.2541, 0.4787, 0.3088, 0.4985]}, {"w": "number", "b": [0.3151, 0.4787, 0.3921, 0.4985]}, {"w": "of", "b": [0.3984, 0.4787, 0.4195, 0.4985]}, {"w": "patterns,", "b": [0.4258, 0.4787, 0.5119, 0.4985]}, {"w": "the", "b": [0.5182, 0.4787, 0.5491, 0.4985]}, {"w": "optimization", "b": [0.5554, 0.4787, 0.6829, 0.4985]}, {"w": "process", "b": [0.6892, 0.4787, 0.7649, 0.4985]}, {"w": "will", "b": [0.7712, 0.4787, 0.8104, 0.4985]}, {"w": "force", "b": [0.8167, 0.4787, 0.8686, 0.4985]}, {"w": "it", "b": [0.1294, 0.4992, 0.1434, 0.519]}, {"w": "to", "b": [0.1497, 0.4992, 0.1694, 0.519]}, {"w": "focus", "b": [0.1757, 0.4992, 0.2303, 0.519]}, {"w": "on", "b": [0.2366, 0.4992, 0.2618, 0.519]}, {"w": "the", "b": [0.2681, 0.4992, 0.299, 0.519]}, {"w": "most", "b": [0.3053, 0.4992, 0.3543, 0.519]}, {"w": "prominent", "b": [0.3606, 0.4992, 0.4643, 0.519]}, {"w": "patterns,", "b": [0.4706, 0.4992, 0.5568, 0.519]}, {"w": "which", "b": [0.5631, 0.4992, 0.6248, 0.519]}, {"w": "have", "b": [0.6311, 0.4992, 0.6787, 0.519]}, {"w": "a", "b": [0.685, 0.4992, 0.6962, 0.519]}, {"w": "better", "b": [0.7025, 0.4992, 0.76, 0.519]}, {"w": "chance", "b": [0.7663, 0.4992, 0.8363, 0.519]}, {"w": "of", "b": [0.8426, 0.4992, 0.8636, 0.519]}, {"w": "generalizing", "b": [0.1294, 0.5197, 0.2541, 0.5395]}, {"w": "well.", "b": [0.2604, 0.5197, 0.3102, 0.5395]}]}, {"id": "b_3", "type": "paragraph", "text": "The processing of fighting overfitting this way is called regularization. Let’s review some of the most common regularization techniques and apply them in practice to improve the movie-classification model from section 3.4.", "words": [{"w": "The", "b": [0.1294, 0.5625, 0.1686, 0.5823]}, {"w": "processing", "b": [0.1749, 0.5625, 0.2828, 0.5823]}, {"w": "of", "b": [0.2891, 0.5625, 0.3102, 0.5823]}, {"w": "fighting", "b": [0.3165, 0.5625, 0.3964, 0.5823]}, {"w": "overfitting", "b": [0.4027, 0.5625, 0.5092, 0.5823]}, {"w": "this", "b": [0.5155, 0.5625, 0.5519, 0.5823]}, {"w": "way", "b": [0.5582, 0.5625, 0.6003, 0.5823]}, {"w": "is", "b": [0.6066, 0.5625, 0.6234, 0.5823]}, {"w": "called", "b": [0.6297, 0.5625, 0.6899, 0.5823]}, {"w": "regularization.", "b": [0.6962, 0.5625, 0.8459, 0.5823]}, {"w": "Let’s", "b": [0.1294, 0.583, 0.1798, 0.6028]}, {"w": "review", "b": [0.1862, 0.583, 0.2548, 0.6028]}, {"w": "some", "b": [0.2611, 0.583, 0.3144, 0.6028]}, {"w": "of", "b": [0.3207, 0.583, 0.3417, 0.6028]}, {"w": "the", "b": [0.348, 0.583, 0.3788, 0.6028]}, {"w": "most", "b": [0.3851, 0.583, 0.4342, 0.6028]}, {"w": "common", "b": [0.4405, 0.583, 0.5288, 0.6028]}, {"w": "regularization", "b": [0.5351, 0.583, 0.6752, 0.6028]}, {"w": "techniques", "b": [0.6815, 0.583, 0.7894, 0.6028]}, {"w": "and", "b": [0.7957, 0.583, 0.8321, 0.6028]}, {"w": "apply", "b": [0.1294, 0.6035, 0.1855, 0.6233]}, {"w": "them", "b": [0.1918, 0.6035, 0.2422, 0.6233]}, {"w": "in", "b": [0.2485, 0.6035, 0.2682, 0.6233]}, {"w": "practice", "b": [0.2745, 0.6035, 0.3543, 0.6233]}, {"w": "to", "b": [0.3606, 0.6035, 0.3802, 0.6233]}, {"w": "improve", "b": [0.3865, 0.6035, 0.4706, 0.6233]}, {"w": "the", "b": [0.4769, 0.6035, 0.5077, 0.6233]}, {"w": "movie-classification", "b": [0.5141, 0.6035, 0.7186, 0.6233]}, {"w": "model", "b": [0.7248, 0.6035, 0.7879, 0.6233]}, {"w": "from", "b": [0.7942, 0.6035, 0.8432, 0.6233]}, {"w": "section", "b": [0.1294, 0.624, 0.2009, 0.6438]}, {"w": "3.4.", "b": [0.2072, 0.624, 0.245, 0.6438]}]}, {"id": "b_4", "type": "paragraph", "text": "4.4.1. Reducing the network’s size", "words": [{"w": "4.4.1.", "b": [0.1294, 0.6713, 0.1862, 0.691]}, {"w": "Reducing", "b": [0.1925, 0.6713, 0.2948, 0.691]}, {"w": "the", "b": [0.3011, 0.6713, 0.3347, 0.691]}, {"w": "network’s", "b": [0.341, 0.6713, 0.448, 0.691]}, {"w": "size", "b": [0.4543, 0.6713, 0.4935, 0.691]}]}, {"id": "b_5", "type": "paragraph", "text": "The simplest way to prevent overfitting is to reduce the size of the model: the number of learnable parameters in the model (which is determined by the number of layers and the number of units per layer). In deep learning, the number of learnable parameters in a model is often referred to as the model’s capacity. Intuitively, a model with more parameters has more memorization capacity and therefore can easily learn a perfect dictionary-like mapping between training samples and their targets—a mapping without any generalization power. For instance, a model with 500,000 binary parameters could easily be made to learn", "words": [{"w": "The", "b": [0.1294, 0.7141, 0.1686, 0.7338]}, {"w": "simplest", "b": [0.1749, 0.7141, 0.259, 0.7338]}, {"w": "way", "b": [0.2654, 0.7141, 0.3074, 0.7338]}, {"w": "to", "b": [0.3137, 0.7141, 0.3333, 0.7338]}, {"w": "prevent", "b": [0.3396, 0.7141, 0.4153, 0.7338]}, {"w": "overfitting", "b": [0.4216, 0.7141, 0.5281, 0.7338]}, {"w": "is", "b": [0.5344, 0.7141, 0.5512, 0.7338]}, {"w": "to", "b": [0.5575, 0.7141, 0.5771, 0.7338]}, {"w": "reduce", "b": [0.5835, 0.7141, 0.6507, 0.7338]}, {"w": "the", "b": [0.657, 0.7141, 0.6878, 0.7338]}, {"w": "size", "b": [0.6941, 0.7141, 0.7333, 0.7338]}, {"w": "of", "b": [0.7396, 0.7141, 0.7607, 0.7338]}, {"w": "the", "b": [0.767, 0.7141, 0.7978, 0.7338]}, {"w": "model:", "b": [0.1294, 0.7346, 0.1995, 0.7543]}, {"w": "the", "b": [0.2058, 0.7346, 0.2366, 0.7543]}, {"w": "number", "b": [0.2429, 0.7346, 0.32, 0.7543]}, {"w": "of", "b": [0.3263, 0.7346, 0.3473, 0.7543]}, {"w": "learnable", "b": [0.3536, 0.7346, 0.4461, 0.7543]}, {"w": "parameters", "b": [0.4524, 0.7346, 0.563, 0.7543]}, {"w": "in", "b": [0.5693, 0.7346, 0.589, 0.7543]}, {"w": "the", "b": [0.5953, 0.7346, 0.6261, 0.7543]}, {"w": "model", "b": [0.6324, 0.7346, 0.6955, 0.7543]}, {"w": "(which", "b": [0.7017, 0.7346, 0.7717, 0.7543]}, {"w": "is", "b": [0.778, 0.7346, 0.7949, 0.7543]}, {"w": "determined", "b": [0.1294, 0.7551, 0.2429, 0.7748]}, {"w": "by", "b": [0.2492, 0.7551, 0.2744, 0.7748]}, {"w": "the", "b": [0.2807, 0.7551, 0.3116, 0.7748]}, {"w": "number", "b": [0.3179, 0.7551, 0.3949, 0.7748]}, {"w": "of", "b": [0.4012, 0.7551, 0.4223, 0.7748]}, {"w": "layers", "b": [0.4286, 0.7551, 0.4888, 0.7748]}, {"w": "and", "b": [0.4951, 0.7551, 0.5315, 0.7748]}, {"w": "the", "b": [0.5378, 0.7551, 0.5687, 0.7748]}, {"w": "number", "b": [0.575, 0.7551, 0.652, 0.7748]}, {"w": "of", "b": [0.6583, 0.7551, 0.6794, 0.7748]}, {"w": "units", "b": [0.6857, 0.7551, 0.7347, 0.7748]}, {"w": "per", "b": [0.741, 0.7551, 0.7732, 0.7748]}, {"w": "layer).", "b": [0.7796, 0.7551, 0.8447, 0.7748]}, {"w": "In", "b": [0.1294, 0.7756, 0.1504, 0.7953]}, {"w": "deep", "b": [0.1567, 0.7756, 0.2044, 0.7953]}, {"w": "learning,", "b": [0.2107, 0.7756, 0.2996, 0.7953]}, {"w": "the", "b": [0.3059, 0.7756, 0.3368, 0.7953]}, {"w": "number", "b": [0.3431, 0.7756, 0.4201, 0.7953]}, {"w": "of", "b": [0.4264, 0.7756, 0.4475, 0.7953]}, {"w": "learnable", "b": [0.4538, 0.7756, 0.5462, 0.7953]}, {"w": "parameters", "b": [0.5525, 0.7756, 0.6631, 0.7953]}, {"w": "in", "b": [0.6694, 0.7756, 0.6891, 0.7953]}, {"w": "a", "b": [0.6954, 0.7756, 0.7066, 0.7953]}, {"w": "model", "b": [0.7129, 0.7756, 0.7759, 0.7953]}, {"w": "is", "b": [0.7822, 0.7756, 0.7991, 0.7953]}, {"w": "often", "b": [0.8054, 0.7756, 0.8572, 0.7953]}, {"w": "referred", "b": [0.1294, 0.7961, 0.2092, 0.8158]}, {"w": "to", "b": [0.2155, 0.7961, 0.2352, 0.8158]}, {"w": "as", "b": [0.2415, 0.7961, 0.2625, 0.8158]}, {"w": "the", "b": [0.2688, 0.7961, 0.2996, 0.8158]}, {"w": "model’s", "b": [0.3059, 0.7961, 0.3858, 0.8158]}, {"w": "capacity.", "b": [0.3921, 0.7961, 0.4838, 0.8158]}, {"w": "Intuitively,", "b": [0.4901, 0.7961, 0.5999, 0.8158]}, {"w": "a", "b": [0.6062, 0.7961, 0.6174, 0.8158]}, {"w": "model", "b": [0.6237, 0.7961, 0.6868, 0.8158]}, {"w": "with", "b": [0.6931, 0.7961, 0.7379, 0.8158]}, {"w": "more", "b": [0.7442, 0.7961, 0.7961, 0.8158]}, {"w": "parameters", "b": [0.1294, 0.8166, 0.2401, 0.8363]}, {"w": "has", "b": [0.2464, 0.8166, 0.28, 0.8363]}, {"w": "more", "b": [0.2863, 0.8166, 0.3382, 0.8363]}, {"w": "memorization", "b": [0.3444, 0.8166, 0.4832, 0.8363]}, {"w": "capacity", "b": [0.4895, 0.8166, 0.5749, 0.8363]}, {"w": "and", "b": [0.5812, 0.8166, 0.6176, 0.8363]}, {"w": "therefore", "b": [0.6239, 0.8166, 0.715, 0.8363]}, {"w": "can", "b": [0.7213, 0.8166, 0.7563, 0.8363]}, {"w": "easily", "b": [0.7626, 0.8166, 0.8215, 0.8363]}, {"w": "learn", "b": [0.1294, 0.8371, 0.1798, 0.8568]}, {"w": "a", "b": [0.1861, 0.8371, 0.1973, 0.8568]}, {"w": "perfect", "b": [0.2037, 0.8371, 0.2737, 0.8568]}, {"w": "dictionary-like", "b": [0.28, 0.8371, 0.4285, 0.8568]}, {"w": "mapping", "b": [0.4348, 0.8371, 0.5231, 0.8568]}, {"w": "between", "b": [0.5294, 0.8371, 0.6135, 0.8568]}, {"w": "training", "b": [0.6198, 0.8371, 0.6983, 0.8568]}, {"w": "samples", "b": [0.7046, 0.8371, 0.7858, 0.8568]}, {"w": "and", "b": [0.7921, 0.8371, 0.8286, 0.8568]}, {"w": "their", "b": [0.1294, 0.8576, 0.1757, 0.8773]}, {"w": "targets—a", "b": [0.182, 0.8576, 0.2852, 0.8773]}, {"w": "mapping", "b": [0.2915, 0.8576, 0.3798, 0.8773]}, {"w": "without", "b": [0.3861, 0.8576, 0.4632, 0.8773]}, {"w": "any", "b": [0.4694, 0.8576, 0.5059, 0.8773]}, {"w": "generalization", "b": [0.5122, 0.8576, 0.6551, 0.8773]}, {"w": "power.", "b": [0.6614, 0.8576, 0.7293, 0.8773]}, {"w": "For", "b": [0.7356, 0.8576, 0.7706, 0.8773]}, {"w": "instance,", "b": [0.7769, 0.8576, 0.8659, 0.8773]}, {"w": "a", "b": [0.1294, 0.8781, 0.1406, 0.8978]}, {"w": "model", "b": [0.1469, 0.8781, 0.21, 0.8978]}, {"w": "with", "b": [0.2163, 0.8781, 0.2611, 0.8978]}, {"w": "500,000", "b": [0.2674, 0.8781, 0.3494, 0.8978]}, {"w": "binary", "b": [0.3557, 0.8781, 0.4202, 0.8978]}, {"w": "parameters", "b": [0.4265, 0.8781, 0.5372, 0.8978]}, {"w": "could", "b": [0.5435, 0.8781, 0.5995, 0.8978]}, {"w": "easily", "b": [0.6058, 0.8781, 0.6647, 0.8978]}, {"w": "be", "b": [0.671, 0.8781, 0.6948, 0.8978]}, {"w": "made", "b": [0.7011, 0.8781, 0.7557, 0.8978]}, {"w": "to", "b": [0.762, 0.8781, 0.7817, 0.8978]}, {"w": "learn", "b": [0.788, 0.8781, 0.8384, 0.8978]}]}]}, {"page": 155, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the class of every digit in the MNIST training set: we’d need only 10 binary parameters for each of the 50,000 digits. But such a model would be useless for classifying new digit samples. Always keep this in mind: deep-learning models tend to be good at fitting to the training data, but the real challenge is generalization, not fitting.", "words": [{"w": "the", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "class", "b": [0.1665, 0.0857, 0.2156, 0.1054]}, {"w": "of", "b": [0.2219, 0.0857, 0.2429, 0.1054]}, {"w": "every", "b": [0.2492, 0.0857, 0.3052, 0.1054]}, {"w": "digit", "b": [0.3115, 0.0857, 0.3578, 0.1054]}, {"w": "in", "b": [0.3641, 0.0857, 0.3837, 0.1054]}, {"w": "the", "b": [0.39, 0.0857, 0.4209, 0.1054]}, {"w": "MNIST", "b": [0.4272, 0.0857, 0.5056, 0.1054]}, {"w": "training", "b": [0.5119, 0.0857, 0.5904, 0.1054]}, {"w": "set:", "b": [0.5967, 0.0857, 0.6318, 0.1054]}, {"w": "we’d", "b": [0.6381, 0.0857, 0.6885, 0.1054]}, {"w": "need", "b": [0.6948, 0.0857, 0.7424, 0.1054]}, {"w": "only", "b": [0.7487, 0.0857, 0.7936, 0.1054]}, {"w": "10", "b": [0.7999, 0.0857, 0.8251, 0.1054]}, {"w": "binary", "b": [0.1294, 0.1062, 0.1939, 0.1259]}, {"w": "parameters", "b": [0.2002, 0.1062, 0.3108, 0.1259]}, {"w": "for", "b": [0.3171, 0.1062, 0.3466, 0.1259]}, {"w": "each", "b": [0.3529, 0.1062, 0.3991, 0.1259]}, {"w": "of", "b": [0.4054, 0.1062, 0.4264, 0.1259]}, {"w": "the", "b": [0.4327, 0.1062, 0.4635, 0.1259]}, {"w": "50,000", "b": [0.4698, 0.1062, 0.5392, 0.1259]}, {"w": "digits.", "b": [0.5455, 0.1062, 0.6079, 0.1259]}, {"w": "But", "b": [0.6142, 0.1062, 0.6507, 0.1259]}, {"w": "such", "b": [0.657, 0.1062, 0.7032, 0.1259]}, {"w": "a", "b": [0.7095, 0.1062, 0.7207, 0.1259]}, {"w": "model", "b": [0.727, 0.1062, 0.7901, 0.1259]}, {"w": "would", "b": [0.7963, 0.1062, 0.8594, 0.1259]}, {"w": "be", "b": [0.1294, 0.1267, 0.1532, 0.1464]}, {"w": "useless", "b": [0.1595, 0.1267, 0.231, 0.1464]}, {"w": "for", "b": [0.2373, 0.1267, 0.2667, 0.1464]}, {"w": "classifying", "b": [0.273, 0.1267, 0.3823, 0.1464]}, {"w": "new", "b": [0.3886, 0.1267, 0.4307, 0.1464]}, {"w": "digit", "b": [0.437, 0.1267, 0.4832, 0.1464]}, {"w": "samples.", "b": [0.4895, 0.1267, 0.5771, 0.1464]}, {"w": "Always", "b": [0.5834, 0.1267, 0.6605, 0.1464]}, {"w": "keep", "b": [0.6668, 0.1267, 0.7144, 0.1464]}, {"w": "this", "b": [0.7207, 0.1267, 0.7572, 0.1464]}, {"w": "in", "b": [0.7635, 0.1267, 0.7831, 0.1464]}, {"w": "mind:", "b": [0.7894, 0.1267, 0.8483, 0.1464]}, {"w": "deep-learning", "b": [0.1294, 0.1472, 0.2681, 0.1669]}, {"w": "models", "b": [0.2744, 0.1472, 0.3473, 0.1669]}, {"w": "tend", "b": [0.3536, 0.1472, 0.397, 0.1669]}, {"w": "to", "b": [0.4033, 0.1472, 0.423, 0.1669]}, {"w": "be", "b": [0.4293, 0.1472, 0.4531, 0.1669]}, {"w": "good", "b": [0.4594, 0.1472, 0.5098, 0.1669]}, {"w": "at", "b": [0.5161, 0.1472, 0.5344, 0.1669]}, {"w": "fitting", "b": [0.5407, 0.1472, 0.6023, 0.1669]}, {"w": "to", "b": [0.6086, 0.1472, 0.6282, 0.1669]}, {"w": "the", "b": [0.6345, 0.1472, 0.6653, 0.1669]}, {"w": "training", "b": [0.6716, 0.1472, 0.7501, 0.1669]}, {"w": "data,", "b": [0.7564, 0.1472, 0.8047, 0.1669]}, {"w": "but", "b": [0.8111, 0.1472, 0.8433, 0.1669]}, {"w": "the", "b": [0.1294, 0.1677, 0.1602, 0.1874]}, {"w": "real", "b": [0.1665, 0.1677, 0.2044, 0.1874]}, {"w": "challenge", "b": [0.2107, 0.1677, 0.3073, 0.1874]}, {"w": "is", "b": [0.3136, 0.1677, 0.3305, 0.1874]}, {"w": "generalization,", "b": [0.3368, 0.1677, 0.486, 0.1874]}, {"w": "not", "b": [0.4923, 0.1677, 0.5245, 0.1874]}, {"w": "fitting.", "b": [0.5308, 0.1677, 0.5988, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "On the other hand, if the network has limited memorization resources, it won’t be able to learn this mapping as easily; thus, in order to minimize its loss, it will have to resort to learning compressed representations that have predictive power regarding the targets—precisely the type of representations we’re interested in. At the same time, keep in mind that you should use models that have enough parameters that they don’t underfit: your model shouldn’t be starved for memorization resources. There is a compromise to be found between too much capacity and not enough capacity.", "words": [{"w": "On", "b": [0.1294, 0.2105, 0.1602, 0.2302]}, {"w": "the", "b": [0.1665, 0.2105, 0.1974, 0.2302]}, {"w": "other", "b": [0.2037, 0.2105, 0.2555, 0.2302]}, {"w": "hand,", "b": [0.2618, 0.2105, 0.3172, 0.2302]}, {"w": "if", "b": [0.3235, 0.2105, 0.3389, 0.2302]}, {"w": "the", "b": [0.3452, 0.2105, 0.376, 0.2302]}, {"w": "network", "b": [0.3823, 0.2105, 0.465, 0.2302]}, {"w": "has", "b": [0.4713, 0.2105, 0.5049, 0.2302]}, {"w": "limited", "b": [0.5112, 0.2105, 0.5827, 0.2302]}, {"w": "memorization", "b": [0.589, 0.2105, 0.7292, 0.2302]}, {"w": "resources,", "b": [0.7355, 0.2105, 0.837, 0.2302]}, {"w": "it", "b": [0.8433, 0.2105, 0.8574, 0.2302]}, {"w": "won’t", "b": [0.1294, 0.231, 0.1878, 0.2507]}, {"w": "be", "b": [0.1941, 0.231, 0.2179, 0.2507]}, {"w": "able", "b": [0.2242, 0.231, 0.2663, 0.2507]}, {"w": "to", "b": [0.2726, 0.231, 0.2922, 0.2507]}, {"w": "learn", "b": [0.2985, 0.231, 0.3489, 0.2507]}, {"w": "this", "b": [0.3552, 0.231, 0.3917, 0.2507]}, {"w": "mapping", "b": [0.398, 0.231, 0.4863, 0.2507]}, {"w": "as", "b": [0.4926, 0.231, 0.5136, 0.2507]}, {"w": "easily;", "b": [0.5199, 0.231, 0.5858, 0.2507]}, {"w": "thus,", "b": [0.5921, 0.231, 0.6404, 0.2507]}, {"w": "in", "b": [0.6467, 0.231, 0.6663, 0.2507]}, {"w": "order", "b": [0.6726, 0.231, 0.7258, 0.2507]}, {"w": "to", "b": [0.7321, 0.231, 0.7517, 0.2507]}, {"w": "minimize", "b": [0.7581, 0.231, 0.8534, 0.2507]}, {"w": "its", "b": [0.1294, 0.2515, 0.1533, 0.2712]}, {"w": "loss,", "b": [0.1596, 0.2515, 0.2051, 0.2712]}, {"w": "it", "b": [0.2114, 0.2515, 0.2254, 0.2712]}, {"w": "will", "b": [0.2318, 0.2515, 0.271, 0.2712]}, {"w": "have", "b": [0.2773, 0.2515, 0.3249, 0.2712]}, {"w": "to", "b": [0.3312, 0.2515, 0.3509, 0.2712]}, {"w": "resort", "b": [0.3572, 0.2515, 0.4146, 0.2712]}, {"w": "to", "b": [0.4209, 0.2515, 0.4405, 0.2712]}, {"w": "learning", "b": [0.4469, 0.2515, 0.5295, 0.2712]}, {"w": "compressed", "b": [0.5358, 0.2515, 0.6549, 0.2712]}, {"w": "representations", "b": [0.6612, 0.2515, 0.8139, 0.2712]}, {"w": "that", "b": [0.8202, 0.2515, 0.8581, 0.2712]}, {"w": "have", "b": [0.1294, 0.272, 0.177, 0.2917]}, {"w": "predictive", "b": [0.1833, 0.272, 0.2842, 0.2917]}, {"w": "power", "b": [0.2905, 0.272, 0.3536, 0.2917]}, {"w": "regarding", "b": [0.3599, 0.272, 0.4565, 0.2917]}, {"w": "the", "b": [0.4628, 0.272, 0.4936, 0.2917]}, {"w": "targets—precisely", "b": [0.4999, 0.272, 0.683, 0.2917]}, {"w": "the", "b": [0.6893, 0.272, 0.7201, 0.2917]}, {"w": "type", "b": [0.7264, 0.272, 0.7699, 0.2917]}, {"w": "of", "b": [0.7762, 0.272, 0.7972, 0.2917]}, {"w": "representations", "b": [0.1294, 0.2925, 0.2821, 0.3122]}, {"w": "we’re", "b": [0.2884, 0.2925, 0.3458, 0.3122]}, {"w": "interested", "b": [0.3522, 0.2925, 0.4502, 0.3122]}, {"w": "in.", "b": [0.4565, 0.2925, 0.4825, 0.3122]}, {"w": "At", "b": [0.4888, 0.2925, 0.514, 0.3122]}, {"w": "the", "b": [0.5203, 0.2925, 0.5511, 0.3122]}, {"w": "same", "b": [0.5574, 0.2925, 0.6093, 0.3122]}, {"w": "time,", "b": [0.6156, 0.2925, 0.6667, 0.3122]}, {"w": "keep", "b": [0.6731, 0.2925, 0.7207, 0.3122]}, {"w": "in", "b": [0.727, 0.2925, 0.7466, 0.3122]}, {"w": "mind", "b": [0.7529, 0.2925, 0.8048, 0.3122]}, {"w": "that", "b": [0.8111, 0.2925, 0.8489, 0.3122]}, {"w": "you", "b": [0.1294, 0.313, 0.1673, 0.3327]}, {"w": "should", "b": [0.1736, 0.313, 0.2408, 0.3327]}, {"w": "use", "b": [0.2471, 0.313, 0.2808, 0.3327]}, {"w": "models", "b": [0.2871, 0.313, 0.36, 0.3327]}, {"w": "that", "b": [0.3663, 0.313, 0.4041, 0.3327]}, {"w": "have", "b": [0.4104, 0.313, 0.458, 0.3327]}, {"w": "enough", "b": [0.4643, 0.313, 0.5386, 0.3327]}, {"w": "parameters", "b": [0.5449, 0.313, 0.6556, 0.3327]}, {"w": "that", "b": [0.6619, 0.313, 0.6997, 0.3327]}, {"w": "they", "b": [0.706, 0.313, 0.7495, 0.3327]}, {"w": "don’t", "b": [0.7558, 0.313, 0.8085, 0.3327]}, {"w": "underfit:", "b": [0.1294, 0.3335, 0.2163, 0.3532]}, {"w": "your", "b": [0.2226, 0.3335, 0.2688, 0.3532]}, {"w": "model", "b": [0.2751, 0.3335, 0.3382, 0.3532]}, {"w": "shouldn’t", "b": [0.3445, 0.3335, 0.4393, 0.3532]}, {"w": "be", "b": [0.4456, 0.3335, 0.4695, 0.3532]}, {"w": "starved", "b": [0.4758, 0.3335, 0.5486, 0.3532]}, {"w": "for", "b": [0.5549, 0.3335, 0.5843, 0.3532]}, {"w": "memorization", "b": [0.5906, 0.3335, 0.7308, 0.3532]}, {"w": "resources.", "b": [0.7371, 0.3335, 0.8386, 0.3532]}, {"w": "There", "b": [0.1294, 0.354, 0.1882, 0.3737]}, {"w": "is", "b": [0.1945, 0.354, 0.2114, 0.3737]}, {"w": "a", "b": [0.2177, 0.354, 0.2289, 0.3737]}, {"w": "compromise", "b": [0.2352, 0.354, 0.3599, 0.3737]}, {"w": "to", "b": [0.3662, 0.354, 0.3858, 0.3737]}, {"w": "be", "b": [0.3921, 0.354, 0.4159, 0.3737]}, {"w": "found", "b": [0.4222, 0.354, 0.4811, 0.3737]}, {"w": "between", "b": [0.4874, 0.354, 0.5714, 0.3737]}, {"w": "too", "b": [0.5777, 0.354, 0.6099, 0.3737]}, {"w": "much", "b": [0.6162, 0.354, 0.6709, 0.3737]}, {"w": "capacity", "b": [0.6772, 0.354, 0.7627, 0.3737]}, {"w": "and", "b": [0.7689, 0.354, 0.8054, 0.3737]}, {"w": "not", "b": [0.8117, 0.354, 0.8439, 0.3737]}, {"w": "enough", "b": [0.1294, 0.3745, 0.2037, 0.3942]}, {"w": "capacity.", "b": [0.21, 0.3745, 0.3017, 0.3942]}]}, {"id": "b_2", "type": "paragraph", "text": "Unfortunately, there is no magical formula to determine the right number of layers or the right size for each layer. You must evaluate an array of different architectures (on your validation set, not on your test set, of course) in order to find the correct model size for your data. The general workflow to find an appropriate model size is to start with relatively few layers and parameters, and increase the size of the layers or add new layers until you see diminishing returns with regard to validation loss.", "words": [{"w": "Unfortunately,", "b": [0.1294, 0.4172, 0.2756, 0.437]}, {"w": "there", "b": [0.2819, 0.4172, 0.3323, 0.437]}, {"w": "is", "b": [0.3386, 0.4172, 0.3554, 0.437]}, {"w": "no", "b": [0.3618, 0.4172, 0.387, 0.437]}, {"w": "magical", "b": [0.3933, 0.4172, 0.4731, 0.437]}, {"w": "formula", "b": [0.4795, 0.4172, 0.5593, 0.437]}, {"w": "to", "b": [0.5656, 0.4172, 0.5853, 0.437]}, {"w": "determine", "b": [0.5916, 0.4172, 0.6924, 0.437]}, {"w": "the", "b": [0.6987, 0.4172, 0.7296, 0.437]}, {"w": "right", "b": [0.7359, 0.4172, 0.7835, 0.437]}, {"w": "number", "b": [0.7898, 0.4172, 0.8669, 0.437]}, {"w": "of", "b": [0.1294, 0.4377, 0.1504, 0.4575]}, {"w": "layers", "b": [0.1567, 0.4377, 0.217, 0.4575]}, {"w": "or", "b": [0.2233, 0.4377, 0.2443, 0.4575]}, {"w": "the", "b": [0.2506, 0.4377, 0.2814, 0.4575]}, {"w": "right", "b": [0.2877, 0.4377, 0.3354, 0.4575]}, {"w": "size", "b": [0.3417, 0.4377, 0.3809, 0.4575]}, {"w": "for", "b": [0.3872, 0.4377, 0.4166, 0.4575]}, {"w": "each", "b": [0.4229, 0.4377, 0.4692, 0.4575]}, {"w": "layer.", "b": [0.4755, 0.4377, 0.5307, 0.4575]}, {"w": "You", "b": [0.5371, 0.4377, 0.578, 0.4575]}, {"w": "must", "b": [0.5843, 0.4377, 0.6333, 0.4575]}, {"w": "evaluate", "b": [0.6396, 0.4377, 0.7237, 0.4575]}, {"w": "an", "b": [0.73, 0.4377, 0.7538, 0.4575]}, {"w": "array", "b": [0.7601, 0.4377, 0.8119, 0.4575]}, {"w": "of", "b": [0.8182, 0.4377, 0.8393, 0.4575]}, {"w": "different", "b": [0.1294, 0.4582, 0.2158, 0.478]}, {"w": "architectures", "b": [0.2221, 0.4582, 0.351, 0.478]}, {"w": "(on", "b": [0.3573, 0.4582, 0.3909, 0.478]}, {"w": "your", "b": [0.3972, 0.4582, 0.4435, 0.478]}, {"w": "validation", "b": [0.4498, 0.4582, 0.5507, 0.478]}, {"w": "set,", "b": [0.557, 0.4582, 0.5913, 0.478]}, {"w": "not", "b": [0.5976, 0.4582, 0.6299, 0.478]}, {"w": "on", "b": [0.6362, 0.4582, 0.6614, 0.478]}, {"w": "your", "b": [0.6677, 0.4582, 0.7139, 0.478]}, {"w": "test", "b": [0.7202, 0.4582, 0.7553, 0.478]}, {"w": "set,", "b": [0.7616, 0.4582, 0.7959, 0.478]}, {"w": "of", "b": [0.8022, 0.4582, 0.8232, 0.478]}, {"w": "course)", "b": [0.1294, 0.4787, 0.2037, 0.4985]}, {"w": "in", "b": [0.21, 0.4787, 0.2296, 0.4985]}, {"w": "order", "b": [0.2359, 0.4787, 0.2891, 0.4985]}, {"w": "to", "b": [0.2954, 0.4787, 0.315, 0.4985]}, {"w": "find", "b": [0.3214, 0.4787, 0.362, 0.4985]}, {"w": "the", "b": [0.3683, 0.4787, 0.3991, 0.4985]}, {"w": "correct", "b": [0.4054, 0.4787, 0.4754, 0.4985]}, {"w": "model", "b": [0.4817, 0.4787, 0.5448, 0.4985]}, {"w": "size", "b": [0.5511, 0.4787, 0.5903, 0.4985]}, {"w": "for", "b": [0.5966, 0.4787, 0.626, 0.4985]}, {"w": "your", "b": [0.6324, 0.4787, 0.6786, 0.4985]}, {"w": "data.", "b": [0.6849, 0.4787, 0.7332, 0.4985]}, {"w": "The", "b": [0.7395, 0.4787, 0.7788, 0.4985]}, {"w": "general", "b": [0.7851, 0.4787, 0.8593, 0.4985]}, {"w": "workflow", "b": [0.1294, 0.4992, 0.2275, 0.519]}, {"w": "to", "b": [0.2338, 0.4992, 0.2534, 0.519]}, {"w": "find", "b": [0.2597, 0.4992, 0.3004, 0.519]}, {"w": "an", "b": [0.3067, 0.4992, 0.3305, 0.519]}, {"w": "appropriate", "b": [0.3368, 0.4992, 0.4517, 0.519]}, {"w": "model", "b": [0.458, 0.4992, 0.521, 0.519]}, {"w": "size", "b": [0.5273, 0.4992, 0.5666, 0.519]}, {"w": "is", "b": [0.5729, 0.4992, 0.5897, 0.519]}, {"w": "to", "b": [0.596, 0.4992, 0.6156, 0.519]}, {"w": "start", "b": [0.6219, 0.4992, 0.6654, 0.519]}, {"w": "with", "b": [0.6717, 0.4992, 0.7165, 0.519]}, {"w": "relatively", "b": [0.7228, 0.4992, 0.8181, 0.519]}, {"w": "few", "b": [0.8244, 0.4992, 0.8622, 0.519]}, {"w": "layers", "b": [0.1294, 0.5197, 0.1897, 0.5395]}, {"w": "and", "b": [0.1959, 0.5197, 0.2324, 0.5395]}, {"w": "parameters,", "b": [0.2387, 0.5197, 0.3556, 0.5395]}, {"w": "and", "b": [0.362, 0.5197, 0.3984, 0.5395]}, {"w": "increase", "b": [0.4047, 0.5197, 0.4873, 0.5395]}, {"w": "the", "b": [0.4936, 0.5197, 0.5245, 0.5395]}, {"w": "size", "b": [0.5308, 0.5197, 0.57, 0.5395]}, {"w": "of", "b": [0.5763, 0.5197, 0.5973, 0.5395]}, {"w": "the", "b": [0.6036, 0.5197, 0.6344, 0.5395]}, {"w": "layers", "b": [0.6408, 0.5197, 0.701, 0.5395]}, {"w": "or", "b": [0.7073, 0.5197, 0.7283, 0.5395]}, {"w": "add", "b": [0.7346, 0.5197, 0.771, 0.5395]}, {"w": "new", "b": [0.7773, 0.5197, 0.8194, 0.5395]}, {"w": "layers", "b": [0.1294, 0.5402, 0.1897, 0.56]}, {"w": "until", "b": [0.196, 0.5402, 0.2422, 0.56]}, {"w": "you", "b": [0.2485, 0.5402, 0.2864, 0.56]}, {"w": "see", "b": [0.2927, 0.5402, 0.3249, 0.56]}, {"w": "diminishing", "b": [0.3312, 0.5402, 0.4517, 0.56]}, {"w": "returns", "b": [0.4581, 0.5402, 0.5281, 0.56]}, {"w": "with", "b": [0.5344, 0.5402, 0.5793, 0.56]}, {"w": "regard", "b": [0.5856, 0.5402, 0.65, 0.56]}, {"w": "to", "b": [0.6563, 0.5402, 0.6759, 0.56]}, {"w": "validation", "b": [0.6822, 0.5402, 0.7831, 0.56]}, {"w": "loss.", "b": [0.7893, 0.5402, 0.8349, 0.56]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s try this on the movie-review classification network. The original network is shown next.", "words": [{"w": "Let’s", "b": [0.1294, 0.583, 0.1798, 0.6028]}, {"w": "try", "b": [0.1862, 0.583, 0.2142, 0.6028]}, {"w": "this", "b": [0.2205, 0.583, 0.2569, 0.6028]}, {"w": "on", "b": [0.2632, 0.583, 0.2885, 0.6028]}, {"w": "the", "b": [0.2948, 0.583, 0.3256, 0.6028]}, {"w": "movie-review", "b": [0.3319, 0.583, 0.472, 0.6028]}, {"w": "classification", "b": [0.4783, 0.583, 0.6114, 0.6028]}, {"w": "network.", "b": [0.6177, 0.583, 0.7067, 0.6028]}, {"w": "The", "b": [0.713, 0.583, 0.7522, 0.6028]}, {"w": "original", "b": [0.7586, 0.583, 0.837, 0.6028]}, {"w": "network", "b": [0.1294, 0.6035, 0.2121, 0.6233]}, {"w": "is", "b": [0.2184, 0.6035, 0.2352, 0.6233]}, {"w": "shown", "b": [0.2415, 0.6035, 0.3074, 0.6233]}, {"w": "next.", "b": [0.3137, 0.6035, 0.3634, 0.6233]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 4.3. Original model", "words": [{"w": "Listing", "b": [0.1294, 0.6414, 0.1862, 0.6562]}, {"w": "4.3.", "b": [0.1909, 0.6414, 0.2193, 0.6562]}, {"w": "Original", "b": [0.224, 0.6414, 0.2923, 0.6562]}, {"w": "model", "b": [0.2971, 0.6414, 0.3465, 0.6562]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras import models from keras import layers model = models.Sequential() model.add(layers.Dense(16, activation='relu', input_shape= (10000,))) model.add(layers.Dense(16, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "from", "b": [0.1357, 0.6698, 0.1811, 0.6849]}, {"w": "keras", "b": [0.1925, 0.6698, 0.2492, 0.6849]}, {"w": "import", "b": [0.2606, 0.6698, 0.3287, 0.6849]}, {"w": "models", "b": [0.34, 0.6698, 0.4082, 0.6849]}, {"w": "from", "b": [0.1357, 0.6849, 0.1811, 0.7001]}, {"w": "keras", "b": [0.1925, 0.6849, 0.2492, 0.7001]}, {"w": "import", "b": [0.2606, 0.6849, 0.3287, 0.7001]}, {"w": "layers", "b": [0.34, 0.6849, 0.4082, 0.7001]}, {"w": "model", "b": [0.1357, 0.7152, 0.1925, 0.7304]}, {"w": "=", "b": [0.2038, 0.7152, 0.2152, 0.7304]}, {"w": "models.Sequential()", "b": [0.2265, 0.7152, 0.4422, 0.7304]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.7304, 0.4309, 0.7455]}, {"w": "activation='relu',", "b": [0.4422, 0.7304, 0.6465, 0.7455]}, {"w": "input_shape=", "b": [0.6579, 0.7304, 0.7941, 0.7455]}, {"w": "(10000,)))", "b": [0.1357, 0.7455, 0.2492, 0.7607]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.7607, 0.4309, 0.7758]}, {"w": "activation='relu'))", "b": [0.4422, 0.7607, 0.6579, 0.7758]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.7759, 0.4195, 0.791]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.7759, 0.6806, 0.791]}]}, {"id": "b_6", "type": "paragraph", "text": "Now let’s try to replace it with this smaller network.", "words": [{"w": "Now", "b": [0.1294, 0.8139, 0.1785, 0.8336]}, {"w": "let’s", "b": [0.1848, 0.8139, 0.2268, 0.8336]}, {"w": "try", "b": [0.2331, 0.8139, 0.2611, 0.8336]}, {"w": "to", "b": [0.2674, 0.8139, 0.2871, 0.8336]}, {"w": "replace", "b": [0.2934, 0.8139, 0.3662, 0.8336]}, {"w": "it", "b": [0.3725, 0.8139, 0.3865, 0.8336]}, {"w": "with", "b": [0.3928, 0.8139, 0.4377, 0.8336]}, {"w": "this", "b": [0.444, 0.8139, 0.4804, 0.8336]}, {"w": "smaller", "b": [0.4868, 0.8139, 0.561, 0.8336]}, {"w": "network.", "b": [0.5673, 0.8139, 0.6563, 0.8336]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 4.4. Version of the model with lower capacity", "words": [{"w": "Listing", "b": [0.1294, 0.8517, 0.1862, 0.8665]}, {"w": "4.4.", "b": [0.1909, 0.8517, 0.2193, 0.8665]}, {"w": "Version", "b": [0.224, 0.8517, 0.2853, 0.8665]}, {"w": "of", "b": [0.2901, 0.8517, 0.3058, 0.8665]}, {"w": "the", "b": [0.3106, 0.8517, 0.3358, 0.8665]}, {"w": "model", "b": [0.3405, 0.8517, 0.3899, 0.8665]}, {"w": "with", "b": [0.3946, 0.8517, 0.4304, 0.8665]}, {"w": "lower", "b": [0.4351, 0.8517, 0.4803, 0.8665]}, {"w": "capacity", "b": [0.485, 0.8517, 0.5523, 0.8665]}]}, {"id": "b_8", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(4, activation='relu', input_shape=", "words": [{"w": "model", "b": [0.1357, 0.8801, 0.1925, 0.8953]}, {"w": "=", "b": [0.2038, 0.8801, 0.2152, 0.8953]}, {"w": "models.Sequential()", "b": [0.2265, 0.8801, 0.4422, 0.8953]}, {"w": "model.add(layers.Dense(4,", "b": [0.1357, 0.8953, 0.4195, 0.9104]}, {"w": "activation='relu',", "b": [0.4309, 0.8953, 0.6352, 0.9104]}, {"w": "input_shape=", "b": [0.6465, 0.8953, 0.7828, 0.9104]}]}]}, {"page": 156, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "(10000,))) model.add(layers.Dense(4, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "(10000,)))", "b": [0.1357, 0.0851, 0.2492, 0.1002]}, {"w": "model.add(layers.Dense(4,", "b": [0.1357, 0.1002, 0.4195, 0.1154]}, {"w": "activation='relu'))", "b": [0.4309, 0.1002, 0.6465, 0.1154]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.1154, 0.4195, 0.1305]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.1154, 0.6806, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 4.4 shows a comparison of the validation losses of the original network and the smaller network. The dots are the validation loss values of the smaller network, and the crosses are the initial network (remember, a lower validation loss signals a better model).", "words": [{"w": "Figure", "b": [0.1294, 0.1534, 0.1953, 0.1732]}, {"w": "4.4", "b": [0.2016, 0.1534, 0.2331, 0.1732]}, {"w": "shows", "b": [0.2394, 0.1534, 0.3025, 0.1732]}, {"w": "a", "b": [0.3088, 0.1534, 0.32, 0.1732]}, {"w": "comparison", "b": [0.3263, 0.1534, 0.444, 0.1732]}, {"w": "of", "b": [0.4503, 0.1534, 0.4713, 0.1732]}, {"w": "the", "b": [0.4776, 0.1534, 0.5084, 0.1732]}, {"w": "validation", "b": [0.5147, 0.1534, 0.6156, 0.1732]}, {"w": "losses", "b": [0.6219, 0.1534, 0.6822, 0.1732]}, {"w": "of", "b": [0.6885, 0.1534, 0.7095, 0.1732]}, {"w": "the", "b": [0.7158, 0.1534, 0.7467, 0.1732]}, {"w": "original", "b": [0.753, 0.1534, 0.8314, 0.1732]}, {"w": "network", "b": [0.1294, 0.1739, 0.2121, 0.1937]}, {"w": "and", "b": [0.2184, 0.1739, 0.2548, 0.1937]}, {"w": "the", "b": [0.2611, 0.1739, 0.2919, 0.1937]}, {"w": "smaller", "b": [0.2982, 0.1739, 0.3725, 0.1937]}, {"w": "network.", "b": [0.3788, 0.1739, 0.4678, 0.1937]}, {"w": "The", "b": [0.4741, 0.1739, 0.5133, 0.1937]}, {"w": "dots", "b": [0.5196, 0.1739, 0.5617, 0.1937]}, {"w": "are", "b": [0.568, 0.1739, 0.5988, 0.1937]}, {"w": "the", "b": [0.6051, 0.1739, 0.6359, 0.1937]}, {"w": "validation", "b": [0.6422, 0.1739, 0.7431, 0.1937]}, {"w": "loss", "b": [0.7493, 0.1739, 0.7886, 0.1937]}, {"w": "values", "b": [0.7949, 0.1739, 0.8593, 0.1937]}, {"w": "of", "b": [0.1294, 0.1944, 0.1504, 0.2142]}, {"w": "the", "b": [0.1567, 0.1944, 0.1876, 0.2142]}, {"w": "smaller", "b": [0.1939, 0.1944, 0.2681, 0.2142]}, {"w": "network,", "b": [0.2744, 0.1944, 0.3634, 0.2142]}, {"w": "and", "b": [0.3697, 0.1944, 0.4061, 0.2142]}, {"w": "the", "b": [0.4124, 0.1944, 0.4433, 0.2142]}, {"w": "crosses", "b": [0.4496, 0.1944, 0.5224, 0.2142]}, {"w": "are", "b": [0.5287, 0.1944, 0.5595, 0.2142]}, {"w": "the", "b": [0.5658, 0.1944, 0.5967, 0.2142]}, {"w": "initial", "b": [0.603, 0.1944, 0.6619, 0.2142]}, {"w": "network", "b": [0.6682, 0.1944, 0.7508, 0.2142]}, {"w": "(remember,", "b": [0.1294, 0.2149, 0.2454, 0.2347]}, {"w": "a", "b": [0.2517, 0.2149, 0.2629, 0.2347]}, {"w": "lower", "b": [0.2692, 0.2149, 0.3266, 0.2347]}, {"w": "validation", "b": [0.3329, 0.2149, 0.4338, 0.2347]}, {"w": "loss", "b": [0.4401, 0.2149, 0.4794, 0.2347]}, {"w": "signals", "b": [0.4857, 0.2149, 0.5558, 0.2347]}, {"w": "a", "b": [0.5621, 0.2149, 0.5733, 0.2347]}, {"w": "better", "b": [0.5796, 0.2149, 0.637, 0.2347]}, {"w": "model).", "b": [0.6432, 0.2149, 0.721, 0.2347]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 4.4. Effect of model capacity on validation loss: trying a smaller model", "words": [{"w": "Figure", "b": [0.1294, 0.2572, 0.1827, 0.272]}, {"w": "4.4.", "b": [0.1874, 0.2572, 0.2158, 0.272]}, {"w": "Effect", "b": [0.2205, 0.2572, 0.2688, 0.272]}, {"w": "of", "b": [0.2735, 0.2572, 0.2893, 0.272]}, {"w": "model", "b": [0.294, 0.2572, 0.3434, 0.272]}, {"w": "capacity", "b": [0.3481, 0.2572, 0.4154, 0.272]}, {"w": "on", "b": [0.4201, 0.2572, 0.4401, 0.272]}, {"w": "validation", "b": [0.4448, 0.2572, 0.5258, 0.272]}, {"w": "loss:", "b": [0.5305, 0.2572, 0.5663, 0.272]}, {"w": "trying", "b": [0.571, 0.2572, 0.6204, 0.272]}, {"w": "a", "b": [0.6251, 0.2572, 0.6346, 0.272]}, {"w": "smaller", "b": [0.6393, 0.2572, 0.6992, 0.272]}, {"w": "model", "b": [0.7039, 0.2572, 0.7533, 0.272]}]}, {"id": "b_3", "type": "paragraph", "text": "As you can see, the smaller network starts overfitting later than the reference network (after six epochs rather than four), and its performance degrades more slowly once it starts overfitting.", "words": [{"w": "As", "b": [0.1294, 0.5625, 0.1574, 0.5823]}, {"w": "you", "b": [0.1637, 0.5625, 0.2016, 0.5823]}, {"w": "can", "b": [0.2079, 0.5625, 0.2429, 0.5823]}, {"w": "see,", "b": [0.2492, 0.5625, 0.2877, 0.5823]}, {"w": "the", "b": [0.294, 0.5625, 0.3249, 0.5823]}, {"w": "smaller", "b": [0.3312, 0.5625, 0.4054, 0.5823]}, {"w": "network", "b": [0.4117, 0.5625, 0.4944, 0.5823]}, {"w": "starts", "b": [0.5007, 0.5625, 0.554, 0.5823]}, {"w": "overfitting", "b": [0.5603, 0.5625, 0.6668, 0.5823]}, {"w": "later", "b": [0.6731, 0.5625, 0.7179, 0.5823]}, {"w": "than", "b": [0.7242, 0.5625, 0.7676, 0.5823]}, {"w": "the", "b": [0.774, 0.5625, 0.8048, 0.5823]}, {"w": "reference", "b": [0.1294, 0.583, 0.2232, 0.6028]}, {"w": "network", "b": [0.2295, 0.583, 0.3122, 0.6028]}, {"w": "(after", "b": [0.3185, 0.583, 0.3731, 0.6028]}, {"w": "six", "b": [0.3794, 0.583, 0.4089, 0.6028]}, {"w": "epochs", "b": [0.4152, 0.583, 0.4852, 0.6028]}, {"w": "rather", "b": [0.4915, 0.583, 0.5504, 0.6028]}, {"w": "than", "b": [0.5567, 0.583, 0.6001, 0.6028]}, {"w": "four),", "b": [0.6064, 0.583, 0.6631, 0.6028]}, {"w": "and", "b": [0.6694, 0.583, 0.7058, 0.6028]}, {"w": "its", "b": [0.7121, 0.583, 0.736, 0.6028]}, {"w": "performance", "b": [0.7423, 0.583, 0.8697, 0.6028]}, {"w": "degrades", "b": [0.1294, 0.6035, 0.2191, 0.6233]}, {"w": "more", "b": [0.2254, 0.6035, 0.2772, 0.6233]}, {"w": "slowly", "b": [0.2835, 0.6035, 0.3508, 0.6233]}, {"w": "once", "b": [0.3571, 0.6035, 0.4047, 0.6233]}, {"w": "it", "b": [0.411, 0.6035, 0.4251, 0.6233]}, {"w": "starts", "b": [0.4314, 0.6035, 0.4846, 0.6233]}, {"w": "overfitting.", "b": [0.4909, 0.6035, 0.6037, 0.6233]}]}, {"id": "b_4", "type": "paragraph", "text": "Now, for kicks, let’s add to this benchmark a network that has much more capacity—far more than the problem warrants.", "words": [{"w": "Now,", "b": [0.1294, 0.6463, 0.1831, 0.6661]}, {"w": "for", "b": [0.1894, 0.6463, 0.2188, 0.6661]}, {"w": "kicks,", "b": [0.2252, 0.6463, 0.2847, 0.6661]}, {"w": "let’s", "b": [0.291, 0.6463, 0.333, 0.6661]}, {"w": "add", "b": [0.3394, 0.6463, 0.3758, 0.6661]}, {"w": "to", "b": [0.3821, 0.6463, 0.4017, 0.6661]}, {"w": "this", "b": [0.408, 0.6463, 0.4445, 0.6661]}, {"w": "benchmark", "b": [0.4508, 0.6463, 0.5629, 0.6661]}, {"w": "a", "b": [0.5692, 0.6463, 0.5804, 0.6661]}, {"w": "network", "b": [0.5867, 0.6463, 0.6693, 0.6661]}, {"w": "that", "b": [0.6756, 0.6463, 0.7135, 0.6661]}, {"w": "has", "b": [0.7198, 0.6463, 0.7534, 0.6661]}, {"w": "much", "b": [0.7597, 0.6463, 0.8158, 0.6661]}, {"w": "more", "b": [0.1294, 0.6668, 0.1813, 0.6866]}, {"w": "capacity—far", "b": [0.1876, 0.6668, 0.3248, 0.6866]}, {"w": "more", "b": [0.3311, 0.6668, 0.383, 0.6866]}, {"w": "than", "b": [0.3893, 0.6668, 0.4327, 0.6866]}, {"w": "the", "b": [0.439, 0.6668, 0.4699, 0.6866]}, {"w": "problem", "b": [0.4762, 0.6668, 0.5602, 0.6866]}, {"w": "warrants.", "b": [0.5665, 0.6668, 0.6597, 0.6866]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 4.5. Version of the model with higher capacity", "words": [{"w": "Listing", "b": [0.1294, 0.7047, 0.1862, 0.7195]}, {"w": "4.5.", "b": [0.1909, 0.7047, 0.2193, 0.7195]}, {"w": "Version", "b": [0.224, 0.7047, 0.2853, 0.7195]}, {"w": "of", "b": [0.2901, 0.7047, 0.3058, 0.7195]}, {"w": "the", "b": [0.3106, 0.7047, 0.3358, 0.7195]}, {"w": "model", "b": [0.3405, 0.7047, 0.3899, 0.7195]}, {"w": "with", "b": [0.3946, 0.7047, 0.4304, 0.7195]}, {"w": "higher", "b": [0.4351, 0.7047, 0.4877, 0.7195]}, {"w": "capacity", "b": [0.4924, 0.7047, 0.5596, 0.7195]}]}, {"id": "b_6", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(512, activation='relu', input_shape= (10000,))) model.add(layers.Dense(512, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "model", "b": [0.1357, 0.7331, 0.1925, 0.7482]}, {"w": "=", "b": [0.2038, 0.7331, 0.2152, 0.7482]}, {"w": "models.Sequential()", "b": [0.2265, 0.7331, 0.4422, 0.7482]}, {"w": "model.add(layers.Dense(512,", "b": [0.1357, 0.7482, 0.4422, 0.7634]}, {"w": "activation='relu',", "b": [0.4536, 0.7482, 0.6579, 0.7634]}, {"w": "input_shape=", "b": [0.6692, 0.7482, 0.8055, 0.7634]}, {"w": "(10000,)))", "b": [0.1357, 0.7634, 0.2492, 0.7785]}, {"w": "model.add(layers.Dense(512,", "b": [0.1357, 0.7785, 0.4422, 0.7937]}, {"w": "activation='relu'))", "b": [0.4536, 0.7785, 0.6692, 0.7937]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.7937, 0.4195, 0.8088]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.7937, 0.6806, 0.8088]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 4.5 shows how the bigger network fares compared to the reference network. The dots are the validation loss values of the bigger network, and the crosses are the initial network.", "words": [{"w": "Figure", "b": [0.1294, 0.8317, 0.1953, 0.8515]}, {"w": "4.5", "b": [0.2016, 0.8317, 0.2331, 0.8515]}, {"w": "shows", "b": [0.2394, 0.8317, 0.3025, 0.8515]}, {"w": "how", "b": [0.3088, 0.8317, 0.3522, 0.8515]}, {"w": "the", "b": [0.3585, 0.8317, 0.3893, 0.8515]}, {"w": "bigger", "b": [0.3956, 0.8317, 0.4601, 0.8515]}, {"w": "network", "b": [0.4664, 0.8317, 0.5491, 0.8515]}, {"w": "fares", "b": [0.5554, 0.8317, 0.6044, 0.8515]}, {"w": "compared", "b": [0.6107, 0.8317, 0.7102, 0.8515]}, {"w": "to", "b": [0.7165, 0.8317, 0.7361, 0.8515]}, {"w": "the", "b": [0.7424, 0.8317, 0.7732, 0.8515]}, {"w": "reference", "b": [0.1294, 0.8522, 0.2232, 0.8719]}, {"w": "network.", "b": [0.2295, 0.8522, 0.3185, 0.8719]}, {"w": "The", "b": [0.3248, 0.8522, 0.364, 0.8719]}, {"w": "dots", "b": [0.3703, 0.8522, 0.4124, 0.8719]}, {"w": "are", "b": [0.4187, 0.8522, 0.4495, 0.8719]}, {"w": "the", "b": [0.4558, 0.8522, 0.4866, 0.8719]}, {"w": "validation", "b": [0.4929, 0.8522, 0.5938, 0.8719]}, {"w": "loss", "b": [0.6001, 0.8522, 0.6394, 0.8719]}, {"w": "values", "b": [0.6457, 0.8522, 0.7102, 0.8719]}, {"w": "of", "b": [0.7165, 0.8522, 0.7375, 0.8719]}, {"w": "the", "b": [0.7438, 0.8522, 0.7746, 0.8719]}, {"w": "bigger", "b": [0.7809, 0.8522, 0.8454, 0.8719]}, {"w": "network,", "b": [0.1294, 0.8727, 0.2184, 0.8924]}, {"w": "and", "b": [0.2247, 0.8727, 0.2611, 0.8924]}, {"w": "the", "b": [0.2674, 0.8727, 0.2982, 0.8924]}, {"w": "crosses", "b": [0.3046, 0.8727, 0.3774, 0.8924]}, {"w": "are", "b": [0.3837, 0.8727, 0.4145, 0.8924]}, {"w": "the", "b": [0.4208, 0.8727, 0.4516, 0.8924]}, {"w": "initial", "b": [0.458, 0.8727, 0.5168, 0.8924]}, {"w": "network.", "b": [0.5231, 0.8727, 0.6121, 0.8924]}]}]}, {"page": 157, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 4.5. Effect of model capacity on validation loss: trying a bigger model", "words": [{"w": "Figure", "b": [0.1294, 0.0852, 0.1827, 0.1]}, {"w": "4.5.", "b": [0.1874, 0.0852, 0.2158, 0.1]}, {"w": "Effect", "b": [0.2205, 0.0852, 0.2688, 0.1]}, {"w": "of", "b": [0.2735, 0.0852, 0.2893, 0.1]}, {"w": "model", "b": [0.294, 0.0852, 0.3434, 0.1]}, {"w": "capacity", "b": [0.3481, 0.0852, 0.4154, 0.1]}, {"w": "on", "b": [0.4201, 0.0852, 0.4401, 0.1]}, {"w": "validation", "b": [0.4448, 0.0852, 0.5258, 0.1]}, {"w": "loss:", "b": [0.5305, 0.0852, 0.5663, 0.1]}, {"w": "trying", "b": [0.571, 0.0852, 0.6204, 0.1]}, {"w": "a", "b": [0.6251, 0.0852, 0.6346, 0.1]}, {"w": "bigger", "b": [0.6393, 0.0852, 0.6908, 0.1]}, {"w": "model", "b": [0.6955, 0.0852, 0.7449, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "The bigger network starts overfitting almost immediately, after just one epoch, and it overfits much more severely. Its validation loss is also noisier.", "words": [{"w": "The", "b": [0.1294, 0.3905, 0.1686, 0.4102]}, {"w": "bigger", "b": [0.1749, 0.3905, 0.2394, 0.4102]}, {"w": "network", "b": [0.2457, 0.3905, 0.3284, 0.4102]}, {"w": "starts", "b": [0.3347, 0.3905, 0.3879, 0.4102]}, {"w": "overfitting", "b": [0.3942, 0.3905, 0.5007, 0.4102]}, {"w": "almost", "b": [0.507, 0.3905, 0.5743, 0.4102]}, {"w": "immediately,", "b": [0.5806, 0.3905, 0.7113, 0.4102]}, {"w": "after", "b": [0.7176, 0.3905, 0.7638, 0.4102]}, {"w": "just", "b": [0.7702, 0.3905, 0.8066, 0.4102]}, {"w": "one", "b": [0.8129, 0.3905, 0.8493, 0.4102]}, {"w": "epoch,", "b": [0.1294, 0.411, 0.196, 0.4307]}, {"w": "and", "b": [0.2023, 0.411, 0.2387, 0.4307]}, {"w": "it", "b": [0.245, 0.411, 0.259, 0.4307]}, {"w": "overfits", "b": [0.2653, 0.411, 0.3424, 0.4307]}, {"w": "much", "b": [0.3487, 0.411, 0.4048, 0.4307]}, {"w": "more", "b": [0.4111, 0.411, 0.4629, 0.4307]}, {"w": "severely.", "b": [0.4692, 0.411, 0.5579, 0.4307]}, {"w": "Its", "b": [0.5642, 0.411, 0.5894, 0.4307]}, {"w": "validation", "b": [0.5957, 0.411, 0.6966, 0.4307]}, {"w": "loss", "b": [0.7029, 0.411, 0.7421, 0.4307]}, {"w": "is", "b": [0.7484, 0.411, 0.7653, 0.4307]}, {"w": "also", "b": [0.7716, 0.411, 0.8122, 0.4307]}, {"w": "noisier.", "b": [0.1294, 0.4315, 0.203, 0.4512]}]}, {"id": "b_2", "type": "paragraph", "text": "Meanwhile, figure 4.6 shows the training losses for the two networks. As you can see, the bigger network gets its training loss near zero very quickly. The more capacity the network has, the more quickly it can model the training data (resulting in a low training loss), but the more susceptible it is to overfitting (resulting in a large difference between the training and validation loss).", "words": [{"w": "Meanwhile,", "b": [0.1294, 0.4743, 0.2492, 0.494]}, {"w": "figure", "b": [0.2555, 0.4743, 0.3157, 0.494]}, {"w": "4.6", "b": [0.322, 0.4743, 0.3536, 0.494]}, {"w": "shows", "b": [0.3599, 0.4743, 0.4229, 0.494]}, {"w": "the", "b": [0.4292, 0.4743, 0.4601, 0.494]}, {"w": "training", "b": [0.4664, 0.4743, 0.5449, 0.494]}, {"w": "losses", "b": [0.5512, 0.4743, 0.6114, 0.494]}, {"w": "for", "b": [0.6177, 0.4743, 0.6471, 0.494]}, {"w": "the", "b": [0.6535, 0.4743, 0.6843, 0.494]}, {"w": "two", "b": [0.6906, 0.4743, 0.7284, 0.494]}, {"w": "networks.", "b": [0.7347, 0.4743, 0.8335, 0.494]}, {"w": "As", "b": [0.8398, 0.4743, 0.8678, 0.494]}, {"w": "you", "b": [0.1294, 0.4948, 0.1673, 0.5145]}, {"w": "can", "b": [0.1736, 0.4948, 0.2086, 0.5145]}, {"w": "see,", "b": [0.2149, 0.4948, 0.2534, 0.5145]}, {"w": "the", "b": [0.2597, 0.4948, 0.2905, 0.5145]}, {"w": "bigger", "b": [0.2968, 0.4948, 0.3613, 0.5145]}, {"w": "network", "b": [0.3676, 0.4948, 0.4503, 0.5145]}, {"w": "gets", "b": [0.4566, 0.4948, 0.4972, 0.5145]}, {"w": "its", "b": [0.5035, 0.4948, 0.5273, 0.5145]}, {"w": "training", "b": [0.5337, 0.4948, 0.6121, 0.5145]}, {"w": "loss", "b": [0.6184, 0.4948, 0.6577, 0.5145]}, {"w": "near", "b": [0.664, 0.4948, 0.7074, 0.5145]}, {"w": "zero", "b": [0.7137, 0.4948, 0.7571, 0.5145]}, {"w": "very", "b": [0.7634, 0.4948, 0.8083, 0.5145]}, {"w": "quickly.", "b": [0.1294, 0.5153, 0.2097, 0.535]}, {"w": "The", "b": [0.2161, 0.5153, 0.2553, 0.535]}, {"w": "more", "b": [0.2616, 0.5153, 0.3134, 0.535]}, {"w": "capacity", "b": [0.3197, 0.5153, 0.4038, 0.535]}, {"w": "the", "b": [0.4101, 0.5153, 0.4409, 0.535]}, {"w": "network", "b": [0.4472, 0.5153, 0.5299, 0.535]}, {"w": "has,", "b": [0.5362, 0.5153, 0.5761, 0.535]}, {"w": "the", "b": [0.5824, 0.5153, 0.6133, 0.535]}, {"w": "more", "b": [0.6196, 0.5153, 0.6714, 0.535]}, {"w": "quickly", "b": [0.6777, 0.5153, 0.7534, 0.535]}, {"w": "it", "b": [0.7597, 0.5153, 0.7737, 0.535]}, {"w": "can", "b": [0.78, 0.5153, 0.815, 0.535]}, {"w": "model", "b": [0.1294, 0.5358, 0.1925, 0.5555]}, {"w": "the", "b": [0.1988, 0.5358, 0.2296, 0.5555]}, {"w": "training", "b": [0.2359, 0.5358, 0.3144, 0.5555]}, {"w": "data", "b": [0.3207, 0.5358, 0.3627, 0.5555]}, {"w": "(resulting", "b": [0.369, 0.5358, 0.4657, 0.5555]}, {"w": "in", "b": [0.472, 0.5358, 0.4917, 0.5555]}, {"w": "a", "b": [0.498, 0.5358, 0.5092, 0.5555]}, {"w": "low", "b": [0.5155, 0.5358, 0.5533, 0.5555]}, {"w": "training", "b": [0.5596, 0.5358, 0.6381, 0.5555]}, {"w": "loss),", "b": [0.6444, 0.5358, 0.6984, 0.5555]}, {"w": "but", "b": [0.7046, 0.5358, 0.7368, 0.5555]}, {"w": "the", "b": [0.7431, 0.5358, 0.7739, 0.5555]}, {"w": "more", "b": [0.7803, 0.5358, 0.8321, 0.5555]}, {"w": "susceptible", "b": [0.1294, 0.5563, 0.2415, 0.576]}, {"w": "it", "b": [0.2478, 0.5563, 0.2618, 0.576]}, {"w": "is", "b": [0.2682, 0.5563, 0.285, 0.576]}, {"w": "to", "b": [0.2913, 0.5563, 0.3109, 0.576]}, {"w": "overfitting", "b": [0.3172, 0.5563, 0.4237, 0.576]}, {"w": "(resulting", "b": [0.43, 0.5563, 0.5267, 0.576]}, {"w": "in", "b": [0.533, 0.5563, 0.5526, 0.576]}, {"w": "a", "b": [0.559, 0.5563, 0.5702, 0.576]}, {"w": "large", "b": [0.5765, 0.5563, 0.6264, 0.576]}, {"w": "difference", "b": [0.6327, 0.5563, 0.7344, 0.576]}, {"w": "between", "b": [0.7407, 0.5563, 0.8248, 0.576]}, {"w": "the", "b": [0.8311, 0.5563, 0.8619, 0.576]}, {"w": "training", "b": [0.1294, 0.5768, 0.2079, 0.5965]}, {"w": "and", "b": [0.2142, 0.5768, 0.2506, 0.5965]}, {"w": "validation", "b": [0.2569, 0.5768, 0.3578, 0.5965]}, {"w": "loss).", "b": [0.3641, 0.5768, 0.4181, 0.5965]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 4.6. Effect of model capacity on training loss: trying a bigger model", "words": [{"w": "Figure", "b": [0.1294, 0.6146, 0.1827, 0.6294]}, {"w": "4.6.", "b": [0.1874, 0.6146, 0.2158, 0.6294]}, {"w": "Effect", "b": [0.2205, 0.6146, 0.2688, 0.6294]}, {"w": "of", "b": [0.2735, 0.6146, 0.2893, 0.6294]}, {"w": "model", "b": [0.294, 0.6146, 0.3434, 0.6294]}, {"w": "capacity", "b": [0.3481, 0.6146, 0.4154, 0.6294]}, {"w": "on", "b": [0.4201, 0.6146, 0.4401, 0.6294]}, {"w": "training", "b": [0.4448, 0.6146, 0.51, 0.6294]}, {"w": "loss:", "b": [0.5148, 0.6146, 0.5505, 0.6294]}, {"w": "trying", "b": [0.5552, 0.6146, 0.6046, 0.6294]}, {"w": "a", "b": [0.6093, 0.6146, 0.6188, 0.6294]}, {"w": "bigger", "b": [0.6235, 0.6146, 0.675, 0.6294]}, {"w": "model", "b": [0.6798, 0.6146, 0.7292, 0.6294]}]}]}, {"page": 158, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4.4.2. Adding weight regularization", "words": [{"w": "4.4.2.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Adding", "b": [0.1925, 0.0857, 0.2724, 0.1054]}, {"w": "weight", "b": [0.2787, 0.0857, 0.3502, 0.1054]}, {"w": "regularization", "b": [0.3565, 0.0857, 0.5088, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "You may be familiar with the principle of Occam’s razor: given two explanations for something, the explanation most likely to be correct is the simplest one—the one that makes fewer assumptions. This idea also applies to the models learned by neural networks: given some training data and a network architecture, multiple sets of weight values (multiple models) could explain the data. Simpler models are less likely to overfit than complex ones.", "words": [{"w": "You", "b": [0.1294, 0.1285, 0.1703, 0.1482]}, {"w": "may", "b": [0.1766, 0.1285, 0.2201, 0.1482]}, {"w": "be", "b": [0.2264, 0.1285, 0.2502, 0.1482]}, {"w": "familiar", "b": [0.2565, 0.1285, 0.3364, 0.1482]}, {"w": "with", "b": [0.3427, 0.1285, 0.3875, 0.1482]}, {"w": "the", "b": [0.3938, 0.1285, 0.4247, 0.1482]}, {"w": "principle", "b": [0.431, 0.1285, 0.5206, 0.1482]}, {"w": "of", "b": [0.5269, 0.1285, 0.548, 0.1482]}, {"w": "Occam’s", "b": [0.5542, 0.1285, 0.6406, 0.1482]}, {"w": "razor:", "b": [0.6469, 0.1285, 0.7086, 0.1482]}, {"w": "given", "b": [0.7149, 0.1285, 0.7709, 0.1482]}, {"w": "two", "b": [0.7772, 0.1285, 0.8151, 0.1482]}, {"w": "explanations", "b": [0.1294, 0.149, 0.2569, 0.1687]}, {"w": "for", "b": [0.2632, 0.149, 0.2926, 0.1687]}, {"w": "something,", "b": [0.299, 0.149, 0.4104, 0.1687]}, {"w": "the", "b": [0.4167, 0.149, 0.4475, 0.1687]}, {"w": "explanation", "b": [0.4538, 0.149, 0.5715, 0.1687]}, {"w": "most", "b": [0.5778, 0.149, 0.6269, 0.1687]}, {"w": "likely", "b": [0.6332, 0.149, 0.6907, 0.1687]}, {"w": "to", "b": [0.697, 0.149, 0.7166, 0.1687]}, {"w": "be", "b": [0.7229, 0.149, 0.7467, 0.1687]}, {"w": "correct", "b": [0.753, 0.149, 0.823, 0.1687]}, {"w": "is", "b": [0.8294, 0.149, 0.8462, 0.1687]}, {"w": "the", "b": [0.1294, 0.1695, 0.1602, 0.1892]}, {"w": "simplest", "b": [0.1665, 0.1695, 0.2506, 0.1892]}, {"w": "one—the", "b": [0.257, 0.1695, 0.3494, 0.1892]}, {"w": "one", "b": [0.3557, 0.1695, 0.3922, 0.1892]}, {"w": "that", "b": [0.3985, 0.1695, 0.4363, 0.1892]}, {"w": "makes", "b": [0.4426, 0.1695, 0.5071, 0.1892]}, {"w": "fewer", "b": [0.5134, 0.1695, 0.5708, 0.1892]}, {"w": "assumptions.", "b": [0.577, 0.1695, 0.7081, 0.1892]}, {"w": "This", "b": [0.7144, 0.1695, 0.7592, 0.1892]}, {"w": "idea", "b": [0.7655, 0.1695, 0.8076, 0.1892]}, {"w": "also", "b": [0.8139, 0.1695, 0.8545, 0.1892]}, {"w": "applies", "b": [0.1294, 0.19, 0.2009, 0.2097]}, {"w": "to", "b": [0.2072, 0.19, 0.2268, 0.2097]}, {"w": "the", "b": [0.2331, 0.19, 0.2639, 0.2097]}, {"w": "models", "b": [0.2702, 0.19, 0.3431, 0.2097]}, {"w": "learned", "b": [0.3494, 0.19, 0.4237, 0.2097]}, {"w": "by", "b": [0.43, 0.19, 0.4552, 0.2097]}, {"w": "neural", "b": [0.4615, 0.19, 0.5245, 0.2097]}, {"w": "networks:", "b": [0.5309, 0.19, 0.6303, 0.2097]}, {"w": "given", "b": [0.6367, 0.19, 0.6927, 0.2097]}, {"w": "some", "b": [0.699, 0.19, 0.7523, 0.2097]}, {"w": "training", "b": [0.7586, 0.19, 0.837, 0.2097]}, {"w": "data", "b": [0.1294, 0.2105, 0.1714, 0.2302]}, {"w": "and", "b": [0.1777, 0.2105, 0.2142, 0.2302]}, {"w": "a", "b": [0.2205, 0.2105, 0.2317, 0.2302]}, {"w": "network", "b": [0.238, 0.2105, 0.3206, 0.2302]}, {"w": "architecture,", "b": [0.327, 0.2105, 0.4523, 0.2302]}, {"w": "multiple", "b": [0.4586, 0.2105, 0.5427, 0.2302]}, {"w": "sets", "b": [0.549, 0.2105, 0.5868, 0.2302]}, {"w": "of", "b": [0.5931, 0.2105, 0.6141, 0.2302]}, {"w": "weight", "b": [0.6204, 0.2105, 0.6891, 0.2302]}, {"w": "values", "b": [0.6954, 0.2105, 0.7599, 0.2302]}, {"w": "(multiple", "b": [0.7662, 0.2105, 0.8587, 0.2302]}, {"w": "models)", "b": [0.1294, 0.231, 0.2093, 0.2507]}, {"w": "could", "b": [0.2156, 0.231, 0.2716, 0.2507]}, {"w": "explain", "b": [0.2779, 0.231, 0.3522, 0.2507]}, {"w": "the", "b": [0.3585, 0.231, 0.3893, 0.2507]}, {"w": "data.", "b": [0.3956, 0.231, 0.444, 0.2507]}, {"w": "Simpler", "b": [0.4503, 0.231, 0.5302, 0.2507]}, {"w": "models", "b": [0.5365, 0.231, 0.6094, 0.2507]}, {"w": "are", "b": [0.6157, 0.231, 0.6465, 0.2507]}, {"w": "less", "b": [0.6528, 0.231, 0.6906, 0.2507]}, {"w": "likely", "b": [0.6969, 0.231, 0.7544, 0.2507]}, {"w": "to", "b": [0.7607, 0.231, 0.7803, 0.2507]}, {"w": "overfit", "b": [0.7866, 0.231, 0.8539, 0.2507]}, {"w": "than", "b": [0.1294, 0.2515, 0.1729, 0.2712]}, {"w": "complex", "b": [0.1792, 0.2515, 0.266, 0.2712]}, {"w": "ones.", "b": [0.2723, 0.2515, 0.3249, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "A simple model in this context is a model where the distribution of parameter values has less entropy (or a model with fewer parameters, as you saw in the previous section). Thus a common way to mitigate overfitting is to put constraints on the complexity of a network by forcing its weights to take only small values, which makes the distribution of weight values more regular. This is called weight regularization, and it’s done by adding to the loss function of the network a cost associated with having large weights. This cost comes in two flavors:", "words": [{"w": "A", "b": [0.1294, 0.2942, 0.1476, 0.314]}, {"w": "simple", "b": [0.1539, 0.2942, 0.2198, 0.314]}, {"w": "model", "b": [0.2261, 0.2942, 0.2878, 0.314]}, {"w": "in", "b": [0.294, 0.2942, 0.3137, 0.314]}, {"w": "this", "b": [0.32, 0.2942, 0.3564, 0.314]}, {"w": "context", "b": [0.3627, 0.2942, 0.437, 0.314]}, {"w": "is", "b": [0.4433, 0.2942, 0.4601, 0.314]}, {"w": "a", "b": [0.4664, 0.2942, 0.4776, 0.314]}, {"w": "model", "b": [0.4839, 0.2942, 0.547, 0.314]}, {"w": "where", "b": [0.5533, 0.2942, 0.6149, 0.314]}, {"w": "the", "b": [0.6213, 0.2942, 0.6521, 0.314]}, {"w": "distribution", "b": [0.6584, 0.2942, 0.7747, 0.314]}, {"w": "of", "b": [0.781, 0.2942, 0.802, 0.314]}, {"w": "parameter", "b": [0.1294, 0.3147, 0.2303, 0.3345]}, {"w": "values", "b": [0.2366, 0.3147, 0.301, 0.3345]}, {"w": "has", "b": [0.3073, 0.3147, 0.341, 0.3345]}, {"w": "less", "b": [0.3473, 0.3147, 0.3851, 0.3345]}, {"w": "entropy", "b": [0.3914, 0.3147, 0.4685, 0.3345]}, {"w": "(or", "b": [0.4748, 0.3147, 0.5042, 0.3345]}, {"w": "a", "b": [0.5105, 0.3147, 0.5217, 0.3345]}, {"w": "model", "b": [0.528, 0.3147, 0.5911, 0.3345]}, {"w": "with", "b": [0.5974, 0.3147, 0.6422, 0.3345]}, {"w": "fewer", "b": [0.6485, 0.3147, 0.7059, 0.3345]}, {"w": "parameters,", "b": [0.7123, 0.3147, 0.8292, 0.3345]}, {"w": "as", "b": [0.8354, 0.3147, 0.8565, 0.3345]}, {"w": "you", "b": [0.1294, 0.3352, 0.1673, 0.355]}, {"w": "saw", "b": [0.1736, 0.3352, 0.2128, 0.355]}, {"w": "in", "b": [0.2191, 0.3352, 0.2387, 0.355]}, {"w": "the", "b": [0.245, 0.3352, 0.2758, 0.355]}, {"w": "previous", "b": [0.2822, 0.3352, 0.369, 0.355]}, {"w": "section).", "b": [0.3753, 0.3352, 0.4615, 0.355]}, {"w": "Thus", "b": [0.4678, 0.3352, 0.5183, 0.355]}, {"w": "a", "b": [0.5246, 0.3352, 0.5358, 0.355]}, {"w": "common", "b": [0.5421, 0.3352, 0.6304, 0.355]}, {"w": "way", "b": [0.6367, 0.3352, 0.6787, 0.355]}, {"w": "to", "b": [0.685, 0.3352, 0.7046, 0.355]}, {"w": "mitigate", "b": [0.7109, 0.3352, 0.7936, 0.355]}, {"w": "overfitting", "b": [0.1294, 0.3557, 0.2359, 0.3755]}, {"w": "is", "b": [0.2422, 0.3557, 0.259, 0.3755]}, {"w": "to", "b": [0.2654, 0.3557, 0.285, 0.3755]}, {"w": "put", "b": [0.2913, 0.3557, 0.3235, 0.3755]}, {"w": "constraints", "b": [0.3298, 0.3557, 0.4391, 0.3755]}, {"w": "on", "b": [0.4454, 0.3557, 0.4707, 0.3755]}, {"w": "the", "b": [0.477, 0.3557, 0.5078, 0.3755]}, {"w": "complexity", "b": [0.5141, 0.3557, 0.6276, 0.3755]}, {"w": "of", "b": [0.6339, 0.3557, 0.6549, 0.3755]}, {"w": "a", "b": [0.6612, 0.3557, 0.6724, 0.3755]}, {"w": "network", "b": [0.6787, 0.3557, 0.7613, 0.3755]}, {"w": "by", "b": [0.7676, 0.3557, 0.7929, 0.3755]}, {"w": "forcing", "b": [0.1294, 0.3762, 0.2023, 0.396]}, {"w": "its", "b": [0.2086, 0.3762, 0.2324, 0.396]}, {"w": "weights", "b": [0.2387, 0.3762, 0.3172, 0.396]}, {"w": "to", "b": [0.3235, 0.3762, 0.3431, 0.396]}, {"w": "take", "b": [0.3494, 0.3762, 0.3915, 0.396]}, {"w": "only", "b": [0.3978, 0.3762, 0.4426, 0.396]}, {"w": "small", "b": [0.4489, 0.3762, 0.5036, 0.396]}, {"w": "values,", "b": [0.5099, 0.3762, 0.5807, 0.396]}, {"w": "which", "b": [0.587, 0.3762, 0.6486, 0.396]}, {"w": "makes", "b": [0.6549, 0.3762, 0.7194, 0.396]}, {"w": "the", "b": [0.7257, 0.3762, 0.7565, 0.396]}, {"w": "distribution", "b": [0.1294, 0.3967, 0.2458, 0.4165]}, {"w": "of", "b": [0.2521, 0.3967, 0.2731, 0.4165]}, {"w": "weight", "b": [0.2794, 0.3967, 0.348, 0.4165]}, {"w": "values", "b": [0.3544, 0.3967, 0.4188, 0.4165]}, {"w": "more", "b": [0.4251, 0.3967, 0.4769, 0.4165]}, {"w": "regular.", "b": [0.4832, 0.3967, 0.5642, 0.4165]}, {"w": "This", "b": [0.5705, 0.3967, 0.6154, 0.4165]}, {"w": "is", "b": [0.6217, 0.3967, 0.6385, 0.4165]}, {"w": "called", "b": [0.6448, 0.3967, 0.7051, 0.4165]}, {"w": "weight", "b": [0.7114, 0.3967, 0.7786, 0.4165]}, {"w": "regularization,", "b": [0.1294, 0.4172, 0.2791, 0.437]}, {"w": "and", "b": [0.2854, 0.4172, 0.3219, 0.437]}, {"w": "it’s", "b": [0.3282, 0.4172, 0.359, 0.437]}, {"w": "done", "b": [0.3653, 0.4172, 0.4143, 0.437]}, {"w": "by", "b": [0.4207, 0.4172, 0.4459, 0.437]}, {"w": "adding", "b": [0.4522, 0.4172, 0.5209, 0.437]}, {"w": "to", "b": [0.5272, 0.4172, 0.5468, 0.437]}, {"w": "the", "b": [0.5531, 0.4172, 0.5839, 0.437]}, {"w": "loss", "b": [0.5902, 0.4172, 0.6295, 0.437]}, {"w": "function", "b": [0.6358, 0.4172, 0.7199, 0.437]}, {"w": "of", "b": [0.7262, 0.4172, 0.7472, 0.437]}, {"w": "the", "b": [0.7535, 0.4172, 0.7843, 0.437]}, {"w": "network", "b": [0.1294, 0.4377, 0.2121, 0.4575]}, {"w": "a", "b": [0.2184, 0.4377, 0.2296, 0.4575]}, {"w": "cost", "b": [0.2359, 0.4377, 0.2765, 0.4575]}, {"w": "associated", "b": [0.2828, 0.4377, 0.3865, 0.4575]}, {"w": "with", "b": [0.3928, 0.4377, 0.4376, 0.4575]}, {"w": "having", "b": [0.4439, 0.4377, 0.5126, 0.4575]}, {"w": "large", "b": [0.5189, 0.4377, 0.5688, 0.4575]}, {"w": "weights.", "b": [0.5752, 0.4377, 0.6599, 0.4575]}, {"w": "This", "b": [0.6662, 0.4377, 0.7111, 0.4575]}, {"w": "cost", "b": [0.7174, 0.4377, 0.758, 0.4575]}, {"w": "comes", "b": [0.7643, 0.4377, 0.8288, 0.4575]}, {"w": "in", "b": [0.8351, 0.4377, 0.8547, 0.4575]}, {"w": "two", "b": [0.1294, 0.4582, 0.1673, 0.478]}, {"w": "flavors:", "b": [0.1736, 0.4582, 0.2506, 0.478]}]}, {"id": "b_3", "type": "paragraph", "text": "L1 regularization— The cost added is proportional to the absolute value of the weight coefficients (the L1 norm of the weights). L2 regularization— The cost added is proportional to the square of the value of the weight coefficients (the L2 norm of the weights). L2 regularization is also called weight decay in the context of neural networks. Don’t let the different name confuse you: weight decay is mathematically the same as L2 regularization.", "words": [{"w": "L1", "b": [0.1799, 0.4966, 0.2079, 0.5163]}, {"w": "regularization—", "b": [0.2142, 0.4966, 0.3866, 0.5163]}, {"w": "The", "b": [0.3929, 0.4966, 0.4321, 0.5163]}, {"w": "cost", "b": [0.4384, 0.4966, 0.4791, 0.5163]}, {"w": "added", "b": [0.4854, 0.4966, 0.5456, 0.5163]}, {"w": "is", "b": [0.5519, 0.4966, 0.5688, 0.5163]}, {"w": "proportional", "b": [0.5751, 0.4966, 0.6998, 0.5163]}, {"w": "to", "b": [0.7061, 0.4966, 0.7257, 0.5163]}, {"w": "the", "b": [0.732, 0.4966, 0.7628, 0.5163]}, {"w": "absolute", "b": [0.7691, 0.4966, 0.8546, 0.5163]}, {"w": "value", "b": [0.1799, 0.5171, 0.2345, 0.5368]}, {"w": "of", "b": [0.2408, 0.5171, 0.2604, 0.5368]}, {"w": "the", "b": [0.2667, 0.5171, 0.2976, 0.5368]}, {"w": "weight", "b": [0.3039, 0.5171, 0.3712, 0.5368]}, {"w": "coefficients", "b": [0.3775, 0.5171, 0.4924, 0.5368]}, {"w": "(the", "b": [0.4986, 0.5171, 0.5378, 0.5368]}, {"w": "L1", "b": [0.5441, 0.5171, 0.5708, 0.5368]}, {"w": "norm", "b": [0.5771, 0.5171, 0.6303, 0.5368]}, {"w": "of", "b": [0.6366, 0.5171, 0.6576, 0.5368]}, {"w": "the", "b": [0.6639, 0.5171, 0.6948, 0.5368]}, {"w": "weights).", "b": [0.7011, 0.5171, 0.7943, 0.5368]}, {"w": "L2", "b": [0.1799, 0.5376, 0.2079, 0.5573]}, {"w": "regularization—", "b": [0.2142, 0.5376, 0.3866, 0.5573]}, {"w": "The", "b": [0.3929, 0.5376, 0.4321, 0.5573]}, {"w": "cost", "b": [0.4384, 0.5376, 0.4791, 0.5573]}, {"w": "added", "b": [0.4854, 0.5376, 0.5456, 0.5573]}, {"w": "is", "b": [0.5519, 0.5376, 0.5688, 0.5573]}, {"w": "proportional", "b": [0.5751, 0.5376, 0.6998, 0.5573]}, {"w": "to", "b": [0.7061, 0.5376, 0.7257, 0.5573]}, {"w": "the", "b": [0.732, 0.5376, 0.7628, 0.5573]}, {"w": "square", "b": [0.7691, 0.5376, 0.8368, 0.5573]}, {"w": "of", "b": [0.8431, 0.5376, 0.8628, 0.5573]}, {"w": "the", "b": [0.1799, 0.5581, 0.2107, 0.5778]}, {"w": "value", "b": [0.217, 0.5581, 0.2716, 0.5778]}, {"w": "of", "b": [0.2779, 0.5581, 0.2976, 0.5778]}, {"w": "the", "b": [0.3039, 0.5581, 0.3347, 0.5778]}, {"w": "weight", "b": [0.341, 0.5581, 0.4083, 0.5778]}, {"w": "coefficients", "b": [0.4146, 0.5581, 0.5295, 0.5778]}, {"w": "(the", "b": [0.5357, 0.5581, 0.5749, 0.5778]}, {"w": "L2", "b": [0.5812, 0.5581, 0.6079, 0.5778]}, {"w": "norm", "b": [0.6142, 0.5581, 0.6674, 0.5778]}, {"w": "of", "b": [0.6737, 0.5581, 0.6947, 0.5778]}, {"w": "the", "b": [0.7011, 0.5581, 0.7319, 0.5778]}, {"w": "weights).", "b": [0.7382, 0.5581, 0.8314, 0.5778]}, {"w": "L2", "b": [0.8377, 0.5581, 0.8657, 0.5778]}, {"w": "regularization", "b": [0.1799, 0.5786, 0.32, 0.5983]}, {"w": "is", "b": [0.3263, 0.5786, 0.3431, 0.5983]}, {"w": "also", "b": [0.3494, 0.5786, 0.39, 0.5983]}, {"w": "called", "b": [0.3964, 0.5786, 0.4566, 0.5983]}, {"w": "weight", "b": [0.4628, 0.5786, 0.5301, 0.5983]}, {"w": "decay", "b": [0.5364, 0.5786, 0.5952, 0.5983]}, {"w": "in", "b": [0.6015, 0.5786, 0.6211, 0.5983]}, {"w": "the", "b": [0.6274, 0.5786, 0.6583, 0.5983]}, {"w": "context", "b": [0.6646, 0.5786, 0.7388, 0.5983]}, {"w": "of", "b": [0.7451, 0.5786, 0.7662, 0.5983]}, {"w": "neural", "b": [0.7725, 0.5786, 0.8355, 0.5983]}, {"w": "networks.", "b": [0.1799, 0.5991, 0.2786, 0.6188]}, {"w": "Don’t", "b": [0.285, 0.5991, 0.3434, 0.6188]}, {"w": "let", "b": [0.3497, 0.5991, 0.3749, 0.6188]}, {"w": "the", "b": [0.3812, 0.5991, 0.412, 0.6188]}, {"w": "different", "b": [0.4183, 0.5991, 0.5047, 0.6188]}, {"w": "name", "b": [0.511, 0.5991, 0.5656, 0.6188]}, {"w": "confuse", "b": [0.5719, 0.5991, 0.6504, 0.6188]}, {"w": "you:", "b": [0.6567, 0.5991, 0.7016, 0.6188]}, {"w": "weight", "b": [0.7079, 0.5991, 0.7765, 0.6188]}, {"w": "decay", "b": [0.7828, 0.5991, 0.8417, 0.6188]}, {"w": "is", "b": [0.848, 0.5991, 0.8648, 0.6188]}, {"w": "mathematically", "b": [0.1799, 0.6196, 0.3354, 0.6393]}, {"w": "the", "b": [0.3417, 0.6196, 0.3725, 0.6393]}, {"w": "same", "b": [0.3788, 0.6196, 0.4307, 0.6393]}, {"w": "as", "b": [0.437, 0.6196, 0.458, 0.6393]}, {"w": "L2", "b": [0.4643, 0.6196, 0.4923, 0.6393]}, {"w": "regularization.", "b": [0.4986, 0.6196, 0.645, 0.6393]}]}, {"id": "b_4", "type": "paragraph", "text": "In Keras, weight regularization is added by passing weight regularizer instances to layers as keyword arguments. Let’s add L2 weight regularization to the movie-review classification network.", "words": [{"w": "In", "b": [0.1294, 0.6624, 0.1504, 0.6821]}, {"w": "Keras,", "b": [0.1567, 0.6624, 0.2219, 0.6821]}, {"w": "weight", "b": [0.2282, 0.6624, 0.2968, 0.6821]}, {"w": "regularization", "b": [0.3031, 0.6624, 0.4432, 0.6821]}, {"w": "is", "b": [0.4496, 0.6624, 0.4664, 0.6821]}, {"w": "added", "b": [0.4727, 0.6624, 0.5329, 0.6821]}, {"w": "by", "b": [0.5392, 0.6624, 0.5645, 0.6821]}, {"w": "passing", "b": [0.5708, 0.6624, 0.6464, 0.6821]}, {"w": "weight", "b": [0.6527, 0.6624, 0.72, 0.6821]}, {"w": "regularizer", "b": [0.7263, 0.6624, 0.8388, 0.6821]}, {"w": "instances", "b": [0.1294, 0.6829, 0.2233, 0.7026]}, {"w": "to", "b": [0.2296, 0.6829, 0.2492, 0.7026]}, {"w": "layers", "b": [0.2555, 0.6829, 0.3158, 0.7026]}, {"w": "as", "b": [0.3221, 0.6829, 0.3431, 0.7026]}, {"w": "keyword", "b": [0.3494, 0.6829, 0.4376, 0.7026]}, {"w": "arguments.", "b": [0.444, 0.6829, 0.5549, 0.7026]}, {"w": "Let’s", "b": [0.5612, 0.6829, 0.6116, 0.7026]}, {"w": "add", "b": [0.6179, 0.6829, 0.6543, 0.7026]}, {"w": "L2", "b": [0.6607, 0.6829, 0.6887, 0.7026]}, {"w": "weight", "b": [0.695, 0.6829, 0.7636, 0.7026]}, {"w": "regularization", "b": [0.1294, 0.7034, 0.2695, 0.7231]}, {"w": "to", "b": [0.2758, 0.7034, 0.2954, 0.7231]}, {"w": "the", "b": [0.3018, 0.7034, 0.3326, 0.7231]}, {"w": "movie-review", "b": [0.3389, 0.7034, 0.479, 0.7231]}, {"w": "classification", "b": [0.4853, 0.7034, 0.6184, 0.7231]}, {"w": "network.", "b": [0.6247, 0.7034, 0.7137, 0.7231]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 4.6. Adding L2 weight regularization to the model", "words": [{"w": "Listing", "b": [0.1294, 0.7412, 0.1862, 0.756]}, {"w": "4.6.", "b": [0.1909, 0.7412, 0.2193, 0.756]}, {"w": "Adding", "b": [0.224, 0.7412, 0.2839, 0.756]}, {"w": "L2", "b": [0.2887, 0.7412, 0.3108, 0.756]}, {"w": "weight", "b": [0.3155, 0.7412, 0.3691, 0.756]}, {"w": "regularization", "b": [0.3738, 0.7412, 0.488, 0.756]}, {"w": "to", "b": [0.4928, 0.7412, 0.5085, 0.756]}, {"w": "the", "b": [0.5133, 0.7412, 0.5385, 0.756]}, {"w": "model", "b": [0.5432, 0.7412, 0.5926, 0.756]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras import regularizers model = models.Sequential() model.add(layers.Dense(16, kernel_regularizer=regularizers.l2(0.001), activation='relu', input_shape=(10000,))) model.add(layers.Dense(16, kernel_regularizer=regularizers.l2(0.001),", "words": [{"w": "from", "b": [0.1357, 0.7696, 0.1811, 0.7848]}, {"w": "keras", "b": [0.1925, 0.7696, 0.2492, 0.7848]}, {"w": "import", "b": [0.2606, 0.7696, 0.3287, 0.7848]}, {"w": "regularizers", "b": [0.34, 0.7696, 0.4763, 0.7848]}, {"w": "model", "b": [0.1357, 0.7999, 0.1925, 0.8151]}, {"w": "=", "b": [0.2038, 0.7999, 0.2152, 0.8151]}, {"w": "models.Sequential()", "b": [0.2265, 0.7999, 0.4422, 0.8151]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.8151, 0.4309, 0.8302]}, {"w": "kernel_regularizer=regularizers.l2(0.001),", "b": [0.1357, 0.8302, 0.6125, 0.8454]}, {"w": "activation='relu',", "b": [0.3968, 0.8454, 0.6011, 0.8605]}, {"w": "input_shape=(10000,)))", "b": [0.6125, 0.8454, 0.8622, 0.8605]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.8605, 0.4309, 0.8757]}, {"w": "kernel_regularizer=regularizers.l2(0.001),", "b": [0.1357, 0.8757, 0.6125, 0.8908]}]}]}, {"page": 159, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "activation='relu'))", "b": [0.3968, 0.0851, 0.6125, 0.1002]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.1002, 0.4195, 0.1154]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.1002, 0.6806, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "l2(0.001) means every coefficient in the weight matrix of the layer will add 0.001 * weight_coefficient_value to the total loss of the network. Note that because this penalty is only added at training time, the loss for this network will be much higher at training than at test time.", "words": [{"w": "l2(0.001)", "b": [0.1294, 0.1393, 0.2656, 0.1595]}, {"w": "means", "b": [0.272, 0.1383, 0.3364, 0.158]}, {"w": "every", "b": [0.3427, 0.1383, 0.3987, 0.158]}, {"w": "coefficient", "b": [0.405, 0.1383, 0.5124, 0.158]}, {"w": "in", "b": [0.5187, 0.1383, 0.5384, 0.158]}, {"w": "the", "b": [0.5447, 0.1383, 0.5755, 0.158]}, {"w": "weight", "b": [0.5818, 0.1383, 0.6505, 0.158]}, {"w": "matrix", "b": [0.6568, 0.1383, 0.7226, 0.158]}, {"w": "of", "b": [0.7289, 0.1383, 0.75, 0.158]}, {"w": "the", "b": [0.7563, 0.1383, 0.7871, 0.158]}, {"w": "layer", "b": [0.7934, 0.1383, 0.8438, 0.158]}, {"w": "will", "b": [0.1294, 0.1597, 0.1687, 0.1794]}, {"w": "add", "b": [0.175, 0.1597, 0.2114, 0.1794]}, {"w": "0.001", "b": [0.2177, 0.1607, 0.2934, 0.1809]}, {"w": "*", "b": [0.3085, 0.1607, 0.3236, 0.1809]}, {"w": "weight_coefficient_value", "b": [0.3388, 0.1607, 0.702, 0.1809]}, {"w": "to", "b": [0.7084, 0.1597, 0.728, 0.1794]}, {"w": "the", "b": [0.7343, 0.1597, 0.7652, 0.1794]}, {"w": "total", "b": [0.7715, 0.1597, 0.8163, 0.1794]}, {"w": "loss", "b": [0.8226, 0.1597, 0.8619, 0.1794]}, {"w": "of", "b": [0.1294, 0.181, 0.1504, 0.2008]}, {"w": "the", "b": [0.1567, 0.181, 0.1876, 0.2008]}, {"w": "network.", "b": [0.1939, 0.181, 0.2828, 0.2008]}, {"w": "Note", "b": [0.2891, 0.181, 0.3382, 0.2008]}, {"w": "that", "b": [0.3445, 0.181, 0.3823, 0.2008]}, {"w": "because", "b": [0.3886, 0.181, 0.4685, 0.2008]}, {"w": "this", "b": [0.4748, 0.181, 0.5112, 0.2008]}, {"w": "penalty", "b": [0.5175, 0.181, 0.5918, 0.2008]}, {"w": "is", "b": [0.5981, 0.181, 0.6149, 0.2008]}, {"w": "only", "b": [0.6212, 0.181, 0.6646, 0.2008]}, {"w": "added", "b": [0.6709, 0.181, 0.7326, 0.2008]}, {"w": "at", "b": [0.7389, 0.181, 0.7585, 0.2008]}, {"w": "training", "b": [0.7648, 0.181, 0.8461, 0.2008]}, {"w": "time,", "b": [0.1294, 0.2015, 0.1791, 0.2213]}, {"w": "the", "b": [0.1854, 0.2015, 0.2163, 0.2213]}, {"w": "loss", "b": [0.2226, 0.2015, 0.2618, 0.2213]}, {"w": "for", "b": [0.2681, 0.2015, 0.2975, 0.2213]}, {"w": "this", "b": [0.3039, 0.2015, 0.3403, 0.2213]}, {"w": "network", "b": [0.3466, 0.2015, 0.4293, 0.2213]}, {"w": "will", "b": [0.4356, 0.2015, 0.4748, 0.2213]}, {"w": "be", "b": [0.4811, 0.2015, 0.505, 0.2213]}, {"w": "much", "b": [0.5113, 0.2015, 0.5673, 0.2213]}, {"w": "higher", "b": [0.5736, 0.2015, 0.6381, 0.2213]}, {"w": "at", "b": [0.6444, 0.2015, 0.6626, 0.2213]}, {"w": "training", "b": [0.6689, 0.2015, 0.7474, 0.2213]}, {"w": "than", "b": [0.7537, 0.2015, 0.7971, 0.2213]}, {"w": "at", "b": [0.8034, 0.2015, 0.8216, 0.2213]}, {"w": "test", "b": [0.8279, 0.2015, 0.863, 0.2213]}, {"w": "time.", "b": [0.1294, 0.222, 0.1806, 0.2418]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 4.7 shows the impact of the L2 regularization penalty. As you can see, the model with L2 regularization (dots) has become much more resistant to overfitting than the reference model (crosses), even though both models have the same number of parameters.", "words": [{"w": "Figure", "b": [0.1294, 0.2648, 0.1953, 0.2846]}, {"w": "4.7", "b": [0.2016, 0.2648, 0.2331, 0.2846]}, {"w": "shows", "b": [0.2394, 0.2648, 0.3025, 0.2846]}, {"w": "the", "b": [0.3088, 0.2648, 0.3396, 0.2846]}, {"w": "impact", "b": [0.3459, 0.2648, 0.4146, 0.2846]}, {"w": "of", "b": [0.4209, 0.2648, 0.4419, 0.2846]}, {"w": "the", "b": [0.4482, 0.2648, 0.479, 0.2846]}, {"w": "L2", "b": [0.4853, 0.2648, 0.5134, 0.2846]}, {"w": "regularization", "b": [0.5197, 0.2648, 0.6598, 0.2846]}, {"w": "penalty.", "b": [0.6661, 0.2648, 0.7449, 0.2846]}, {"w": "As", "b": [0.7512, 0.2648, 0.7793, 0.2846]}, {"w": "you", "b": [0.7856, 0.2648, 0.8234, 0.2846]}, {"w": "can", "b": [0.8297, 0.2648, 0.8647, 0.2846]}, {"w": "see,", "b": [0.1294, 0.2853, 0.1679, 0.3051]}, {"w": "the", "b": [0.1742, 0.2853, 0.2051, 0.3051]}, {"w": "model", "b": [0.2114, 0.2853, 0.2744, 0.3051]}, {"w": "with", "b": [0.2807, 0.2853, 0.3256, 0.3051]}, {"w": "L2", "b": [0.3319, 0.2853, 0.3599, 0.3051]}, {"w": "regularization", "b": [0.3662, 0.2853, 0.5063, 0.3051]}, {"w": "(dots)", "b": [0.5126, 0.2853, 0.5715, 0.3051]}, {"w": "has", "b": [0.5778, 0.2853, 0.6114, 0.3051]}, {"w": "become", "b": [0.6177, 0.2853, 0.6962, 0.3051]}, {"w": "much", "b": [0.7025, 0.2853, 0.7585, 0.3051]}, {"w": "more", "b": [0.7647, 0.2853, 0.8166, 0.3051]}, {"w": "resistant", "b": [0.1294, 0.3058, 0.2135, 0.3256]}, {"w": "to", "b": [0.2198, 0.3058, 0.2394, 0.3256]}, {"w": "overfitting", "b": [0.2457, 0.3058, 0.3522, 0.3256]}, {"w": "than", "b": [0.3585, 0.3058, 0.402, 0.3256]}, {"w": "the", "b": [0.4083, 0.3058, 0.4391, 0.3256]}, {"w": "reference", "b": [0.4454, 0.3058, 0.5392, 0.3256]}, {"w": "model", "b": [0.5455, 0.3058, 0.6086, 0.3256]}, {"w": "(crosses),", "b": [0.6149, 0.3058, 0.7109, 0.3256]}, {"w": "even", "b": [0.7172, 0.3058, 0.7648, 0.3256]}, {"w": "though", "b": [0.7711, 0.3058, 0.8412, 0.3256]}, {"w": "both", "b": [0.1294, 0.3263, 0.1743, 0.3461]}, {"w": "models", "b": [0.1806, 0.3263, 0.2534, 0.3461]}, {"w": "have", "b": [0.2598, 0.3263, 0.3074, 0.3461]}, {"w": "the", "b": [0.3137, 0.3263, 0.3445, 0.3461]}, {"w": "same", "b": [0.3508, 0.3263, 0.4027, 0.3461]}, {"w": "number", "b": [0.409, 0.3263, 0.486, 0.3461]}, {"w": "of", "b": [0.4923, 0.3263, 0.5133, 0.3461]}, {"w": "parameters.", "b": [0.5197, 0.3263, 0.6366, 0.3461]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 4.7. Effect of L2 weight regularization on validation loss", "words": [{"w": "Figure", "b": [0.1294, 0.3642, 0.1827, 0.379]}, {"w": "4.7.", "b": [0.1874, 0.3642, 0.2158, 0.379]}, {"w": "Effect", "b": [0.2205, 0.3642, 0.2688, 0.379]}, {"w": "of", "b": [0.2735, 0.3642, 0.2893, 0.379]}, {"w": "L2", "b": [0.294, 0.3642, 0.3161, 0.379]}, {"w": "weight", "b": [0.3208, 0.3642, 0.3744, 0.379]}, {"w": "regularization", "b": [0.3792, 0.3642, 0.4934, 0.379]}, {"w": "on", "b": [0.4981, 0.3642, 0.5181, 0.379]}, {"w": "validation", "b": [0.5228, 0.3642, 0.6038, 0.379]}, {"w": "loss", "b": [0.6085, 0.3642, 0.6379, 0.379]}]}, {"id": "b_4", "type": "paragraph", "text": "As an alternative to L2 regularization, you can use one of the following Keras weight regularizers.", "words": [{"w": "As", "b": [0.1294, 0.6695, 0.1574, 0.6892]}, {"w": "an", "b": [0.1637, 0.6695, 0.1876, 0.6892]}, {"w": "alternative", "b": [0.1939, 0.6695, 0.3003, 0.6892]}, {"w": "to", "b": [0.3066, 0.6695, 0.3263, 0.6892]}, {"w": "L2", "b": [0.3326, 0.6695, 0.3606, 0.6892]}, {"w": "regularization,", "b": [0.3669, 0.6695, 0.5133, 0.6892]}, {"w": "you", "b": [0.5196, 0.6695, 0.5575, 0.6892]}, {"w": "can", "b": [0.5638, 0.6695, 0.5988, 0.6892]}, {"w": "use", "b": [0.6051, 0.6695, 0.6387, 0.6892]}, {"w": "one", "b": [0.645, 0.6695, 0.6815, 0.6892]}, {"w": "of", "b": [0.6878, 0.6695, 0.7088, 0.6892]}, {"w": "the", "b": [0.7151, 0.6695, 0.7459, 0.6892]}, {"w": "following", "b": [0.7522, 0.6695, 0.8503, 0.6892]}, {"w": "Keras", "b": [0.1294, 0.69, 0.1882, 0.7097]}, {"w": "weight", "b": [0.1945, 0.69, 0.2632, 0.7097]}, {"w": "regularizers.", "b": [0.2695, 0.69, 0.3949, 0.7097]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 4.7. Different weight regularizers available in Keras", "words": [{"w": "Listing", "b": [0.1294, 0.7278, 0.1862, 0.7426]}, {"w": "4.7.", "b": [0.1909, 0.7278, 0.2193, 0.7426]}, {"w": "Different", "b": [0.224, 0.7278, 0.2972, 0.7426]}, {"w": "weight", "b": [0.3019, 0.7278, 0.3555, 0.7426]}, {"w": "regularizers", "b": [0.3603, 0.7278, 0.4576, 0.7426]}, {"w": "available", "b": [0.4624, 0.7278, 0.5349, 0.7426]}, {"w": "in", "b": [0.5396, 0.7278, 0.5554, 0.7426]}, {"w": "Keras", "b": [0.5601, 0.7278, 0.6085, 0.7426]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras import regularizers regularizers.l1(0.001) 1 regularizers.l1_l2(l1=0.001, l2=0.001) 2", "words": [{"w": "from", "b": [0.1357, 0.7562, 0.1811, 0.7714]}, {"w": "keras", "b": [0.1925, 0.7562, 0.2492, 0.7714]}, {"w": "import", "b": [0.2606, 0.7562, 0.3287, 0.7714]}, {"w": "regularizers", "b": [0.34, 0.7562, 0.4763, 0.7714]}, {"w": "regularizers.l1(0.001)", "b": [0.1357, 0.7865, 0.3855, 0.8017]}, {"w": "1", "b": [0.6693, 0.7865, 0.6807, 0.8017]}, {"w": "regularizers.l1_l2(l1=0.001,", "b": [0.1357, 0.8169, 0.4536, 0.832]}, {"w": "l2=0.001)", "b": [0.4649, 0.8169, 0.5671, 0.832]}, {"w": "2", "b": [0.6693, 0.8169, 0.6807, 0.832]}]}, {"id": "b_7", "type": "paragraph", "text": "1 L1 regularization 2 Simultaneous L1 and L2 regularization", "words": [{"w": "1", "b": [0.1799, 0.8504, 0.1925, 0.8702]}, {"w": "L1", "b": [0.1988, 0.8504, 0.2282, 0.8702]}, {"w": "regularization", "b": [0.2345, 0.8504, 0.3868, 0.8702]}, {"w": "2", "b": [0.1799, 0.8709, 0.1925, 0.8907]}, {"w": "Simultaneous", "b": [0.1988, 0.8709, 0.3446, 0.8907]}, {"w": "L1", "b": [0.3509, 0.8709, 0.3803, 0.8907]}, {"w": "and", "b": [0.3866, 0.8709, 0.4273, 0.8907]}, {"w": "L2", "b": [0.4336, 0.8709, 0.463, 0.8907]}, {"w": "regularization", "b": [0.4693, 0.8709, 0.6216, 0.8907]}]}]}, {"page": 160, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4.4.3. Adding dropout", "words": [{"w": "4.4.3.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Adding", "b": [0.1925, 0.0857, 0.2724, 0.1054]}, {"w": "dropout", "b": [0.2787, 0.0857, 0.3652, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Dropout is one of the most effective and most commonly used regularization techniques for neural networks, developed by Geoff Hinton and his students at the University of Toronto. Dropout, applied to a layer, consists of randomly dropping out (setting to zero) a number of output features of the layer during training. Let’s say a given layer would normally return a vector [0.2, 0.5, 1.3, 0.8, 1.1] for a given input sample during training. After applying dropout, this vector will have a few zero entries distributed at random: for example, [0, 0.5, 1.3, 0, 1.1]. The dropout rate is the fraction of the features that are zeroed out; it’s usually set between 0.2 and 0.5. At test time, no units are dropped out; instead, the layer’s output values are scaled down by a factor equal to the dropout rate, to balance for the fact that more units are active than at training time.", "words": [{"w": "Dropout", "b": [0.1294, 0.1285, 0.214, 0.1482]}, {"w": "is", "b": [0.2203, 0.1285, 0.2371, 0.1482]}, {"w": "one", "b": [0.2434, 0.1285, 0.2798, 0.1482]}, {"w": "of", "b": [0.2861, 0.1285, 0.3071, 0.1482]}, {"w": "the", "b": [0.3134, 0.1285, 0.3443, 0.1482]}, {"w": "most", "b": [0.3506, 0.1285, 0.3996, 0.1482]}, {"w": "effective", "b": [0.406, 0.1285, 0.4937, 0.1482]}, {"w": "and", "b": [0.5, 0.1285, 0.5364, 0.1482]}, {"w": "most", "b": [0.5428, 0.1285, 0.5918, 0.1482]}, {"w": "commonly", "b": [0.5981, 0.1285, 0.706, 0.1482]}, {"w": "used", "b": [0.7123, 0.1285, 0.7586, 0.1482]}, {"w": "regularization", "b": [0.1294, 0.149, 0.2695, 0.1687]}, {"w": "techniques", "b": [0.2758, 0.149, 0.3837, 0.1687]}, {"w": "for", "b": [0.39, 0.149, 0.4194, 0.1687]}, {"w": "neural", "b": [0.4257, 0.149, 0.4888, 0.1687]}, {"w": "networks,", "b": [0.4951, 0.149, 0.5939, 0.1687]}, {"w": "developed", "b": [0.6002, 0.149, 0.7039, 0.1687]}, {"w": "by", "b": [0.7102, 0.149, 0.7354, 0.1687]}, {"w": "Geoff", "b": [0.7417, 0.149, 0.8, 0.1687]}, {"w": "Hinton", "b": [0.1294, 0.1695, 0.1995, 0.1892]}, {"w": "and", "b": [0.2058, 0.1695, 0.2422, 0.1892]}, {"w": "his", "b": [0.2485, 0.1695, 0.2779, 0.1892]}, {"w": "students", "b": [0.2843, 0.1695, 0.3669, 0.1892]}, {"w": "at", "b": [0.3733, 0.1695, 0.3915, 0.1892]}, {"w": "the", "b": [0.3978, 0.1695, 0.4286, 0.1892]}, {"w": "University", "b": [0.4349, 0.1695, 0.5414, 0.1892]}, {"w": "of", "b": [0.5477, 0.1695, 0.5687, 0.1892]}, {"w": "Toronto.", "b": [0.575, 0.1695, 0.6608, 0.1892]}, {"w": "Dropout,", "b": [0.6671, 0.1695, 0.7575, 0.1892]}, {"w": "applied", "b": [0.7638, 0.1695, 0.8381, 0.1892]}, {"w": "to", "b": [0.8444, 0.1695, 0.864, 0.1892]}, {"w": "a", "b": [0.1294, 0.19, 0.1406, 0.2097]}, {"w": "layer,", "b": [0.1469, 0.19, 0.2026, 0.2097]}, {"w": "consists", "b": [0.2089, 0.19, 0.2888, 0.2097]}, {"w": "of", "b": [0.2951, 0.19, 0.3161, 0.2097]}, {"w": "randomly", "b": [0.3224, 0.19, 0.4191, 0.2097]}, {"w": "dropping", "b": [0.4254, 0.19, 0.517, 0.2097]}, {"w": "out", "b": [0.5233, 0.19, 0.5555, 0.2097]}, {"w": "(setting", "b": [0.5618, 0.19, 0.6375, 0.2097]}, {"w": "to", "b": [0.6438, 0.19, 0.6634, 0.2097]}, {"w": "zero)", "b": [0.6697, 0.19, 0.7215, 0.2097]}, {"w": "a", "b": [0.7279, 0.19, 0.7391, 0.2097]}, {"w": "number", "b": [0.7454, 0.19, 0.8224, 0.2097]}, {"w": "of", "b": [0.8287, 0.19, 0.8497, 0.2097]}, {"w": "output", "b": [0.1294, 0.2105, 0.1939, 0.2302]}, {"w": "features", "b": [0.2002, 0.2105, 0.28, 0.2302]}, {"w": "of", "b": [0.2863, 0.2105, 0.3074, 0.2302]}, {"w": "the", "b": [0.3137, 0.2105, 0.3445, 0.2302]}, {"w": "layer", "b": [0.3508, 0.2105, 0.4012, 0.2302]}, {"w": "during", "b": [0.4075, 0.2105, 0.4734, 0.2302]}, {"w": "training.", "b": [0.4797, 0.2105, 0.5645, 0.2302]}, {"w": "Let’s", "b": [0.5708, 0.2105, 0.6212, 0.2302]}, {"w": "say", "b": [0.6275, 0.2105, 0.6611, 0.2302]}, {"w": "a", "b": [0.6674, 0.2105, 0.6786, 0.2302]}, {"w": "given", "b": [0.6849, 0.2105, 0.741, 0.2302]}, {"w": "layer", "b": [0.7473, 0.2105, 0.7977, 0.2302]}, {"w": "would", "b": [0.804, 0.2105, 0.8671, 0.2302]}, {"w": "normally", "b": [0.1294, 0.231, 0.2205, 0.2507]}, {"w": "return", "b": [0.2268, 0.231, 0.287, 0.2507]}, {"w": "a", "b": [0.2933, 0.231, 0.3045, 0.2507]}, {"w": "vector", "b": [0.3108, 0.231, 0.3739, 0.2507]}, {"w": "[0.2,", "b": [0.3802, 0.231, 0.4264, 0.2507]}, {"w": "0.5,", "b": [0.4327, 0.231, 0.4706, 0.2507]}, {"w": "1.3,", "b": [0.4769, 0.231, 0.5147, 0.2507]}, {"w": "0.8,", "b": [0.521, 0.231, 0.5588, 0.2507]}, {"w": "1.1]", "b": [0.5652, 0.231, 0.6051, 0.2507]}, {"w": "for", "b": [0.6114, 0.231, 0.6408, 0.2507]}, {"w": "a", "b": [0.6471, 0.231, 0.6583, 0.2507]}, {"w": "given", "b": [0.6646, 0.231, 0.7207, 0.2507]}, {"w": "input", "b": [0.727, 0.231, 0.7788, 0.2507]}, {"w": "sample", "b": [0.7851, 0.231, 0.8566, 0.2507]}, {"w": "during", "b": [0.1294, 0.2515, 0.1953, 0.2712]}, {"w": "training.", "b": [0.2016, 0.2515, 0.2864, 0.2712]}, {"w": "After", "b": [0.2927, 0.2515, 0.3459, 0.2712]}, {"w": "applying", "b": [0.3522, 0.2515, 0.4405, 0.2712]}, {"w": "dropout,", "b": [0.4468, 0.2515, 0.5316, 0.2712]}, {"w": "this", "b": [0.5379, 0.2515, 0.5743, 0.2712]}, {"w": "vector", "b": [0.5807, 0.2515, 0.6437, 0.2712]}, {"w": "will", "b": [0.65, 0.2515, 0.6892, 0.2712]}, {"w": "have", "b": [0.6956, 0.2515, 0.7432, 0.2712]}, {"w": "a", "b": [0.7494, 0.2515, 0.7606, 0.2712]}, {"w": "few", "b": [0.7669, 0.2515, 0.8047, 0.2712]}, {"w": "zero", "b": [0.811, 0.2515, 0.8545, 0.2712]}, {"w": "entries", "b": [0.1294, 0.272, 0.1967, 0.2917]}, {"w": "distributed", "b": [0.203, 0.272, 0.3109, 0.2917]}, {"w": "at", "b": [0.3172, 0.272, 0.3354, 0.2917]}, {"w": "random:", "b": [0.3417, 0.272, 0.4258, 0.2917]}, {"w": "for", "b": [0.4321, 0.272, 0.4615, 0.2917]}, {"w": "example,", "b": [0.4678, 0.272, 0.5596, 0.2917]}, {"w": "[0,", "b": [0.5659, 0.272, 0.5932, 0.2917]}, {"w": "0.5,", "b": [0.5995, 0.272, 0.6374, 0.2917]}, {"w": "1.3,", "b": [0.6437, 0.272, 0.6815, 0.2917]}, {"w": "0,", "b": [0.6878, 0.272, 0.7067, 0.2917]}, {"w": "1.1].", "b": [0.713, 0.272, 0.7593, 0.2917]}, {"w": "The", "b": [0.7656, 0.272, 0.8048, 0.2917]}, {"w": "dropout", "b": [0.1294, 0.2925, 0.2084, 0.3122]}, {"w": "rate", "b": [0.2147, 0.2925, 0.2553, 0.3122]}, {"w": "is", "b": [0.2616, 0.2925, 0.2784, 0.3122]}, {"w": "the", "b": [0.2847, 0.2925, 0.3156, 0.3122]}, {"w": "fraction", "b": [0.3219, 0.2925, 0.4003, 0.3122]}, {"w": "of", "b": [0.4066, 0.2925, 0.4276, 0.3122]}, {"w": "the", "b": [0.434, 0.2925, 0.4648, 0.3122]}, {"w": "features", "b": [0.4711, 0.2925, 0.5509, 0.3122]}, {"w": "that", "b": [0.5572, 0.2925, 0.5951, 0.3122]}, {"w": "are", "b": [0.6014, 0.2925, 0.6322, 0.3122]}, {"w": "zeroed", "b": [0.6385, 0.2925, 0.7057, 0.3122]}, {"w": "out;", "b": [0.712, 0.2925, 0.7513, 0.3122]}, {"w": "it’s", "b": [0.7576, 0.2925, 0.7883, 0.3122]}, {"w": "usually", "b": [0.7946, 0.2925, 0.8675, 0.3122]}, {"w": "set", "b": [0.1294, 0.313, 0.1574, 0.3327]}, {"w": "between", "b": [0.1637, 0.313, 0.2478, 0.3327]}, {"w": "0.2", "b": [0.2541, 0.313, 0.2856, 0.3327]}, {"w": "and", "b": [0.2919, 0.313, 0.3284, 0.3327]}, {"w": "0.5.", "b": [0.3347, 0.313, 0.3725, 0.3327]}, {"w": "At", "b": [0.3788, 0.313, 0.404, 0.3327]}, {"w": "test", "b": [0.4104, 0.313, 0.4454, 0.3327]}, {"w": "time,", "b": [0.4517, 0.313, 0.5029, 0.3327]}, {"w": "no", "b": [0.5092, 0.313, 0.5344, 0.3327]}, {"w": "units", "b": [0.5407, 0.313, 0.5898, 0.3327]}, {"w": "are", "b": [0.5961, 0.313, 0.6269, 0.3327]}, {"w": "dropped", "b": [0.6332, 0.313, 0.7158, 0.3327]}, {"w": "out;", "b": [0.7221, 0.313, 0.7613, 0.3327]}, {"w": "instead,", "b": [0.7676, 0.313, 0.8454, 0.3327]}, {"w": "the", "b": [0.1294, 0.3335, 0.1602, 0.3532]}, {"w": "layer’s", "b": [0.1665, 0.3335, 0.2347, 0.3532]}, {"w": "output", "b": [0.241, 0.3335, 0.3055, 0.3532]}, {"w": "values", "b": [0.3118, 0.3335, 0.3763, 0.3532]}, {"w": "are", "b": [0.3826, 0.3335, 0.4134, 0.3532]}, {"w": "scaled", "b": [0.4197, 0.3335, 0.4827, 0.3532]}, {"w": "down", "b": [0.489, 0.3335, 0.5451, 0.3532]}, {"w": "by", "b": [0.5514, 0.3335, 0.5766, 0.3532]}, {"w": "a", "b": [0.5829, 0.3335, 0.5941, 0.3532]}, {"w": "factor", "b": [0.6004, 0.3335, 0.6592, 0.3532]}, {"w": "equal", "b": [0.6655, 0.3335, 0.7202, 0.3532]}, {"w": "to", "b": [0.7265, 0.3335, 0.7461, 0.3532]}, {"w": "the", "b": [0.7524, 0.3335, 0.7832, 0.3532]}, {"w": "dropout", "b": [0.7895, 0.3335, 0.868, 0.3532]}, {"w": "rate,", "b": [0.1294, 0.354, 0.1735, 0.3737]}, {"w": "to", "b": [0.1798, 0.354, 0.1995, 0.3737]}, {"w": "balance", "b": [0.2058, 0.354, 0.2828, 0.3737]}, {"w": "for", "b": [0.2891, 0.354, 0.3185, 0.3737]}, {"w": "the", "b": [0.3248, 0.354, 0.3557, 0.3737]}, {"w": "fact", "b": [0.362, 0.354, 0.3998, 0.3737]}, {"w": "that", "b": [0.4061, 0.354, 0.4439, 0.3737]}, {"w": "more", "b": [0.4502, 0.354, 0.502, 0.3737]}, {"w": "units", "b": [0.5083, 0.354, 0.5574, 0.3737]}, {"w": "are", "b": [0.5637, 0.354, 0.5945, 0.3737]}, {"w": "active", "b": [0.6008, 0.354, 0.661, 0.3737]}, {"w": "than", "b": [0.6673, 0.354, 0.7108, 0.3737]}, {"w": "at", "b": [0.7171, 0.354, 0.7353, 0.3737]}, {"w": "training", "b": [0.7416, 0.354, 0.8201, 0.3737]}, {"w": "time.", "b": [0.1294, 0.3745, 0.1806, 0.3942]}]}, {"id": "b_2", "type": "paragraph", "text": "Consider a Numpy matrix containing the output of a layer, layer_output, of shape (batch_size, features). At training time, we zero out at random a fraction of the values in the matrix:", "words": [{"w": "Consider", "b": [0.1294, 0.4172, 0.2205, 0.437]}, {"w": "a", "b": [0.2268, 0.4172, 0.238, 0.437]}, {"w": "Numpy", "b": [0.2443, 0.4172, 0.32, 0.437]}, {"w": "matrix", "b": [0.3263, 0.4172, 0.3922, 0.437]}, {"w": "containing", "b": [0.3985, 0.4172, 0.505, 0.437]}, {"w": "the", "b": [0.5113, 0.4172, 0.5421, 0.437]}, {"w": "output", "b": [0.5484, 0.4172, 0.6129, 0.437]}, {"w": "of", "b": [0.6192, 0.4172, 0.6402, 0.437]}, {"w": "a", "b": [0.6465, 0.4172, 0.6577, 0.437]}, {"w": "layer,", "b": [0.664, 0.4172, 0.7197, 0.437]}, {"w": "layer_output,", "b": [0.1294, 0.4377, 0.3174, 0.459]}, {"w": "of", "b": [0.3237, 0.4377, 0.3447, 0.4575]}, {"w": "shape", "b": [0.351, 0.4377, 0.4084, 0.4575]}, {"w": "(batch_size,", "b": [0.4147, 0.4388, 0.5963, 0.459]}, {"w": "features).", "b": [0.6115, 0.4377, 0.754, 0.459]}, {"w": "At", "b": [0.7604, 0.4377, 0.7856, 0.4575]}, {"w": "training", "b": [0.7919, 0.4377, 0.8704, 0.4575]}, {"w": "time,", "b": [0.1294, 0.4591, 0.1806, 0.4789]}, {"w": "we", "b": [0.1869, 0.4591, 0.2163, 0.4789]}, {"w": "zero", "b": [0.2226, 0.4591, 0.266, 0.4789]}, {"w": "out", "b": [0.2723, 0.4591, 0.3046, 0.4789]}, {"w": "at", "b": [0.3109, 0.4591, 0.3291, 0.4789]}, {"w": "random", "b": [0.3354, 0.4591, 0.4124, 0.4789]}, {"w": "a", "b": [0.4188, 0.4591, 0.43, 0.4789]}, {"w": "fraction", "b": [0.4363, 0.4591, 0.5147, 0.4789]}, {"w": "of", "b": [0.521, 0.4591, 0.542, 0.4789]}, {"w": "the", "b": [0.5483, 0.4591, 0.5792, 0.4789]}, {"w": "values", "b": [0.5855, 0.4591, 0.6499, 0.4789]}, {"w": "in", "b": [0.6562, 0.4591, 0.6759, 0.4789]}, {"w": "the", "b": [0.6822, 0.4591, 0.713, 0.4789]}, {"w": "matrix:", "b": [0.7193, 0.4591, 0.7922, 0.4789]}]}, {"id": "b_3", "type": "equation", "text": "layer_output *= np.random.randint(0, high=2, size=layer_output.shape) 1", "words": [{"w": "layer_output", "b": [0.1357, 0.4969, 0.2719, 0.512]}, {"w": "*=", "b": [0.2833, 0.4969, 0.306, 0.512]}, {"w": "np.random.randint(0,", "b": [0.3173, 0.4969, 0.5444, 0.512]}, {"w": "high=2,", "b": [0.5557, 0.4969, 0.6352, 0.512]}, {"w": "size=layer_output.shape)", "b": [0.1357, 0.512, 0.4082, 0.5272]}, {"w": "1", "b": [0.4536, 0.512, 0.465, 0.5272]}]}, {"id": "b_4", "type": "paragraph", "text": "1 At training time, drops out 50% of the units in the output", "words": [{"w": "1", "b": [0.1799, 0.5456, 0.1925, 0.5653]}, {"w": "At", "b": [0.1988, 0.5456, 0.2254, 0.5653]}, {"w": "training", "b": [0.2317, 0.5456, 0.3186, 0.5653]}, {"w": "time,", "b": [0.3249, 0.5456, 0.3788, 0.5653]}, {"w": "drops", "b": [0.3852, 0.5456, 0.4464, 0.5653]}, {"w": "out", "b": [0.4527, 0.5456, 0.4877, 0.5653]}, {"w": "50%", "b": [0.494, 0.5456, 0.5445, 0.5653]}, {"w": "of", "b": [0.5508, 0.5456, 0.5718, 0.5653]}, {"w": "the", "b": [0.5781, 0.5456, 0.6117, 0.5653]}, {"w": "units", "b": [0.618, 0.5456, 0.6713, 0.5653]}, {"w": "in", "b": [0.6776, 0.5456, 0.6986, 0.5653]}, {"w": "the", "b": [0.705, 0.5456, 0.7386, 0.5653]}, {"w": "output", "b": [0.7449, 0.5456, 0.8164, 0.5653]}]}, {"id": "b_5", "type": "paragraph", "text": "At test time, we scale down the output by the dropout rate. Here, we scale by 0.5 (because we previously dropped half the units):", "words": [{"w": "At", "b": [0.1294, 0.5884, 0.1546, 0.6081]}, {"w": "test", "b": [0.1609, 0.5884, 0.196, 0.6081]}, {"w": "time,", "b": [0.2023, 0.5884, 0.2534, 0.6081]}, {"w": "we", "b": [0.2598, 0.5884, 0.2892, 0.6081]}, {"w": "scale", "b": [0.2955, 0.5884, 0.3459, 0.6081]}, {"w": "down", "b": [0.3522, 0.5884, 0.4083, 0.6081]}, {"w": "the", "b": [0.4146, 0.5884, 0.4454, 0.6081]}, {"w": "output", "b": [0.4517, 0.5884, 0.5162, 0.6081]}, {"w": "by", "b": [0.5225, 0.5884, 0.5477, 0.6081]}, {"w": "the", "b": [0.554, 0.5884, 0.5848, 0.6081]}, {"w": "dropout", "b": [0.5911, 0.5884, 0.6696, 0.6081]}, {"w": "rate.", "b": [0.6759, 0.5884, 0.72, 0.6081]}, {"w": "Here,", "b": [0.7264, 0.5884, 0.7817, 0.6081]}, {"w": "we", "b": [0.788, 0.5884, 0.8174, 0.6081]}, {"w": "scale", "b": [0.1294, 0.6089, 0.1798, 0.6286]}, {"w": "by", "b": [0.1861, 0.6089, 0.2114, 0.6286]}, {"w": "0.5", "b": [0.2177, 0.6089, 0.2492, 0.6286]}, {"w": "(because", "b": [0.2555, 0.6089, 0.3438, 0.6286]}, {"w": "we", "b": [0.3501, 0.6089, 0.3795, 0.6286]}, {"w": "previously", "b": [0.3858, 0.6089, 0.4923, 0.6286]}, {"w": "dropped", "b": [0.4986, 0.6089, 0.5813, 0.6286]}, {"w": "half", "b": [0.5876, 0.6089, 0.6268, 0.6286]}, {"w": "the", "b": [0.6331, 0.6089, 0.6639, 0.6286]}, {"w": "units):", "b": [0.6702, 0.6089, 0.7346, 0.6286]}]}, {"id": "b_6", "type": "equation", "text": "layer_output *= 0.5 1", "words": [{"w": "layer_output", "b": [0.1357, 0.6466, 0.2719, 0.6618]}, {"w": "*=", "b": [0.2833, 0.6466, 0.306, 0.6618]}, {"w": "0.5", "b": [0.3173, 0.6466, 0.3514, 0.6618]}, {"w": "1", "b": [0.465, 0.6466, 0.4763, 0.6618]}]}, {"id": "b_7", "type": "paragraph", "text": "1 At test time", "words": [{"w": "1", "b": [0.1799, 0.6802, 0.1925, 0.6999]}, {"w": "At", "b": [0.1988, 0.6802, 0.2254, 0.6999]}, {"w": "test", "b": [0.2317, 0.6802, 0.2695, 0.6999]}, {"w": "time", "b": [0.2758, 0.6802, 0.3234, 0.6999]}]}, {"id": "b_8", "type": "paragraph", "text": "Note that this process can be implemented by doing both operations at training time and leaving the output unchanged at test time, which is often the way it’s implemented in practice (see figure 4.8):", "words": [{"w": "Note", "b": [0.1294, 0.723, 0.1785, 0.7427]}, {"w": "that", "b": [0.1848, 0.723, 0.2226, 0.7427]}, {"w": "this", "b": [0.2289, 0.723, 0.2654, 0.7427]}, {"w": "process", "b": [0.2717, 0.723, 0.3473, 0.7427]}, {"w": "can", "b": [0.3536, 0.723, 0.3886, 0.7427]}, {"w": "be", "b": [0.3949, 0.723, 0.4188, 0.7427]}, {"w": "implemented", "b": [0.4251, 0.723, 0.5568, 0.7427]}, {"w": "by", "b": [0.5631, 0.723, 0.5883, 0.7427]}, {"w": "doing", "b": [0.5946, 0.723, 0.6521, 0.7427]}, {"w": "both", "b": [0.6584, 0.723, 0.7032, 0.7427]}, {"w": "operations", "b": [0.7096, 0.723, 0.8146, 0.7427]}, {"w": "at", "b": [0.821, 0.723, 0.8392, 0.7427]}, {"w": "training", "b": [0.1294, 0.7435, 0.2079, 0.7632]}, {"w": "time", "b": [0.2142, 0.7435, 0.259, 0.7632]}, {"w": "and", "b": [0.2654, 0.7435, 0.3018, 0.7632]}, {"w": "leaving", "b": [0.3081, 0.7435, 0.3824, 0.7632]}, {"w": "the", "b": [0.3887, 0.7435, 0.4195, 0.7632]}, {"w": "output", "b": [0.4258, 0.7435, 0.4903, 0.7632]}, {"w": "unchanged", "b": [0.4966, 0.7435, 0.6059, 0.7632]}, {"w": "at", "b": [0.6122, 0.7435, 0.6304, 0.7632]}, {"w": "test", "b": [0.6367, 0.7435, 0.6717, 0.7632]}, {"w": "time,", "b": [0.6779, 0.7435, 0.7291, 0.7632]}, {"w": "which", "b": [0.7354, 0.7435, 0.797, 0.7632]}, {"w": "is", "b": [0.8033, 0.7435, 0.8202, 0.7632]}, {"w": "often", "b": [0.1294, 0.764, 0.1813, 0.7837]}, {"w": "the", "b": [0.1876, 0.764, 0.2184, 0.7837]}, {"w": "way", "b": [0.2247, 0.764, 0.2667, 0.7837]}, {"w": "it’s", "b": [0.273, 0.764, 0.3038, 0.7837]}, {"w": "implemented", "b": [0.3102, 0.764, 0.4419, 0.7837]}, {"w": "in", "b": [0.4482, 0.764, 0.4678, 0.7837]}, {"w": "practice", "b": [0.4741, 0.764, 0.554, 0.7837]}, {"w": "(see", "b": [0.5603, 0.764, 0.6009, 0.7837]}, {"w": "figure", "b": [0.6071, 0.764, 0.6674, 0.7837]}, {"w": "4.8):", "b": [0.6737, 0.764, 0.7206, 0.7837]}]}, {"id": "b_9", "type": "paragraph", "text": "layer_output *= np.random.randint(0, high=2, size=layer_output.shape) 1 layer_output /= 0.5 2", "words": [{"w": "layer_output", "b": [0.1357, 0.8017, 0.2719, 0.8168]}, {"w": "*=", "b": [0.2833, 0.8017, 0.306, 0.8168]}, {"w": "np.random.randint(0,", "b": [0.3173, 0.8017, 0.5444, 0.8168]}, {"w": "high=2,", "b": [0.5557, 0.8017, 0.6352, 0.8168]}, {"w": "size=layer_output.shape)", "b": [0.1357, 0.8169, 0.4082, 0.832]}, {"w": "1", "b": [0.4536, 0.8169, 0.465, 0.832]}, {"w": "layer_output", "b": [0.1357, 0.832, 0.2719, 0.8472]}, {"w": "/=", "b": [0.2833, 0.832, 0.306, 0.8472]}, {"w": "0.5", "b": [0.3173, 0.832, 0.3514, 0.8472]}, {"w": "2", "b": [0.1357, 0.8472, 0.1471, 0.8623]}]}, {"id": "b_10", "type": "paragraph", "text": "1 At training time", "words": [{"w": "1", "b": [0.1799, 0.8807, 0.1925, 0.9005]}, {"w": "At", "b": [0.1988, 0.8807, 0.2254, 0.9005]}, {"w": "training", "b": [0.2317, 0.8807, 0.3186, 0.9005]}, {"w": "time", "b": [0.3249, 0.8807, 0.3725, 0.9005]}]}]}, {"page": 161, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2 Note that we’re scaling up rather scaling down in this case.", "words": [{"w": "2", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Note", "b": [0.1988, 0.0857, 0.2492, 0.1054]}, {"w": "that", "b": [0.2555, 0.0857, 0.299, 0.1054]}, {"w": "we’re", "b": [0.3053, 0.0857, 0.365, 0.1054]}, {"w": "scaling", "b": [0.3713, 0.0857, 0.4456, 0.1054]}, {"w": "up", "b": [0.4519, 0.0857, 0.48, 0.1054]}, {"w": "rather", "b": [0.4863, 0.0857, 0.5549, 0.1054]}, {"w": "scaling", "b": [0.5612, 0.0857, 0.6355, 0.1054]}, {"w": "down", "b": [0.6418, 0.0857, 0.7007, 0.1054]}, {"w": "in", "b": [0.707, 0.0857, 0.728, 0.1054]}, {"w": "this", "b": [0.7344, 0.0857, 0.7736, 0.1054]}, {"w": "case.", "b": [0.7799, 0.0857, 0.831, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 4.8. Dropout applied to an activation matrix at training time, with rescaling happening during training. At test time, the activation matrix is unchanged.", "words": [{"w": "Figure", "b": [0.1294, 0.1235, 0.1827, 0.1383]}, {"w": "4.8.", "b": [0.1874, 0.1235, 0.2158, 0.1383]}, {"w": "Dropout", "b": [0.2205, 0.1235, 0.2885, 0.1383]}, {"w": "applied", "b": [0.2932, 0.1235, 0.3531, 0.1383]}, {"w": "to", "b": [0.3579, 0.1235, 0.3736, 0.1383]}, {"w": "an", "b": [0.3783, 0.1235, 0.3983, 0.1383]}, {"w": "activation", "b": [0.4031, 0.1235, 0.4829, 0.1383]}, {"w": "matrix", "b": [0.4877, 0.1235, 0.5423, 0.1383]}, {"w": "at", "b": [0.547, 0.1235, 0.5628, 0.1383]}, {"w": "training", "b": [0.5675, 0.1235, 0.6327, 0.1383]}, {"w": "time,", "b": [0.6374, 0.1235, 0.6779, 0.1383]}, {"w": "with", "b": [0.6826, 0.1235, 0.7183, 0.1383]}, {"w": "rescaling", "b": [0.7231, 0.1235, 0.7952, 0.1383]}, {"w": "happening", "b": [0.1294, 0.1387, 0.2146, 0.1535]}, {"w": "during", "b": [0.2193, 0.1387, 0.274, 0.1535]}, {"w": "training.", "b": [0.2787, 0.1387, 0.3486, 0.1535]}, {"w": "At", "b": [0.3534, 0.1387, 0.3733, 0.1535]}, {"w": "test", "b": [0.378, 0.1387, 0.4064, 0.1535]}, {"w": "time,", "b": [0.4111, 0.1387, 0.4516, 0.1535]}, {"w": "the", "b": [0.4563, 0.1387, 0.4815, 0.1535]}, {"w": "activation", "b": [0.4863, 0.1387, 0.5661, 0.1535]}, {"w": "matrix", "b": [0.5709, 0.1387, 0.6255, 0.1535]}, {"w": "is", "b": [0.6302, 0.1387, 0.6429, 0.1535]}, {"w": "unchanged.", "b": [0.6476, 0.1387, 0.7406, 0.1535]}]}, {"id": "b_2", "type": "paragraph", "text": "This technique may seem strange and arbitrary. Why would this help reduce overfitting? Hinton says he was inspired by, among other things, a fraud-prevention mechanism used by banks. In his own words, “I went to my bank. The tellers kept changing and I asked one of them why. He said he didn’t know but they got moved around a lot. I figured it must be because it would require cooperation between employees to successfully defraud the bank. This made me realize that randomly removing a different subset of neurons on each example would prevent conspiracies and thus reduce overfitting.”[1] The core idea is that introducing noise in the output values of a layer can break up happenstance patterns that aren’t significant (what Hinton refers to as conspiracies), which the network will start memorizing if no noise is present.", "words": [{"w": "This", "b": [0.1294, 0.3094, 0.1743, 0.3291]}, {"w": "technique", "b": [0.1806, 0.3094, 0.2786, 0.3291]}, {"w": "may", "b": [0.285, 0.3094, 0.3284, 0.3291]}, {"w": "seem", "b": [0.3347, 0.3094, 0.3865, 0.3291]}, {"w": "strange", "b": [0.3928, 0.3094, 0.4657, 0.3291]}, {"w": "and", "b": [0.472, 0.3094, 0.5084, 0.3291]}, {"w": "arbitrary.", "b": [0.5147, 0.3094, 0.6062, 0.3291]}, {"w": "Why", "b": [0.6125, 0.3094, 0.6615, 0.3291]}, {"w": "would", "b": [0.6678, 0.3094, 0.7309, 0.3291]}, {"w": "this", "b": [0.7372, 0.3094, 0.7737, 0.3291]}, {"w": "help", "b": [0.78, 0.3094, 0.8234, 0.3291]}, {"w": "reduce", "b": [0.1294, 0.3299, 0.1966, 0.3496]}, {"w": "overfitting?", "b": [0.2029, 0.3299, 0.3206, 0.3496]}, {"w": "Hinton", "b": [0.327, 0.3299, 0.397, 0.3496]}, {"w": "says", "b": [0.4033, 0.3299, 0.4468, 0.3496]}, {"w": "he", "b": [0.4531, 0.3299, 0.4769, 0.3496]}, {"w": "was", "b": [0.4832, 0.3299, 0.5224, 0.3496]}, {"w": "inspired", "b": [0.5287, 0.3299, 0.61, 0.3496]}, {"w": "by,", "b": [0.6163, 0.3299, 0.6462, 0.3496]}, {"w": "among", "b": [0.6525, 0.3299, 0.7211, 0.3496]}, {"w": "other", "b": [0.7274, 0.3299, 0.7793, 0.3496]}, {"w": "things,", "b": [0.7856, 0.3299, 0.8536, 0.3496]}, {"w": "a", "b": [0.1294, 0.3504, 0.1406, 0.3701]}, {"w": "fraud-prevention", "b": [0.1469, 0.3504, 0.3164, 0.3701]}, {"w": "mechanism", "b": [0.3227, 0.3504, 0.4376, 0.3701]}, {"w": "used", "b": [0.444, 0.3504, 0.4902, 0.3701]}, {"w": "by", "b": [0.4965, 0.3504, 0.5217, 0.3701]}, {"w": "banks.", "b": [0.528, 0.3504, 0.5932, 0.3701]}, {"w": "In", "b": [0.5995, 0.3504, 0.6205, 0.3701]}, {"w": "his", "b": [0.6268, 0.3504, 0.6563, 0.3701]}, {"w": "own", "b": [0.6626, 0.3504, 0.706, 0.3701]}, {"w": "words,", "b": [0.7123, 0.3504, 0.7803, 0.3701]}, {"w": "“I", "b": [0.7866, 0.3504, 0.8062, 0.3701]}, {"w": "went", "b": [0.8125, 0.3504, 0.8615, 0.3701]}, {"w": "to", "b": [0.1294, 0.3709, 0.149, 0.3906]}, {"w": "my", "b": [0.1553, 0.3709, 0.1876, 0.3906]}, {"w": "bank.", "b": [0.1939, 0.3709, 0.2492, 0.3906]}, {"w": "The", "b": [0.2555, 0.3709, 0.2948, 0.3906]}, {"w": "tellers", "b": [0.3011, 0.3709, 0.3627, 0.3906]}, {"w": "kept", "b": [0.369, 0.3709, 0.4125, 0.3906]}, {"w": "changing", "b": [0.4188, 0.3709, 0.5113, 0.3906]}, {"w": "and", "b": [0.5175, 0.3709, 0.5539, 0.3906]}, {"w": "I", "b": [0.5602, 0.3709, 0.5686, 0.3906]}, {"w": "asked", "b": [0.5749, 0.3709, 0.6324, 0.3906]}, {"w": "one", "b": [0.6387, 0.3709, 0.6751, 0.3906]}, {"w": "of", "b": [0.6814, 0.3709, 0.7024, 0.3906]}, {"w": "them", "b": [0.7087, 0.3709, 0.7592, 0.3906]}, {"w": "why.", "b": [0.7655, 0.3709, 0.8136, 0.3906]}, {"w": "He", "b": [0.8199, 0.3709, 0.8493, 0.3906]}, {"w": "said", "b": [0.1294, 0.3914, 0.1701, 0.4111]}, {"w": "he", "b": [0.1764, 0.3914, 0.2002, 0.4111]}, {"w": "didn’t", "b": [0.2065, 0.3914, 0.2663, 0.4111]}, {"w": "know", "b": [0.2726, 0.3914, 0.3286, 0.4111]}, {"w": "but", "b": [0.3349, 0.3914, 0.3672, 0.4111]}, {"w": "they", "b": [0.3735, 0.3914, 0.4169, 0.4111]}, {"w": "got", "b": [0.4232, 0.3914, 0.4555, 0.4111]}, {"w": "moved", "b": [0.4618, 0.3914, 0.5304, 0.4111]}, {"w": "around", "b": [0.5367, 0.3914, 0.6068, 0.4111]}, {"w": "a", "b": [0.6131, 0.3914, 0.6243, 0.4111]}, {"w": "lot.", "b": [0.6306, 0.3914, 0.6636, 0.4111]}, {"w": "I", "b": [0.6699, 0.3914, 0.6783, 0.4111]}, {"w": "figured", "b": [0.6846, 0.3914, 0.7574, 0.4111]}, {"w": "it", "b": [0.7637, 0.3914, 0.7778, 0.4111]}, {"w": "must", "b": [0.7841, 0.3914, 0.8331, 0.4111]}, {"w": "be", "b": [0.8394, 0.3914, 0.8632, 0.4111]}, {"w": "because", "b": [0.1294, 0.4119, 0.2093, 0.4316]}, {"w": "it", "b": [0.2156, 0.4119, 0.2296, 0.4316]}, {"w": "would", "b": [0.2359, 0.4119, 0.299, 0.4316]}, {"w": "require", "b": [0.3052, 0.4119, 0.3767, 0.4316]}, {"w": "cooperation", "b": [0.383, 0.4119, 0.5021, 0.4316]}, {"w": "between", "b": [0.5084, 0.4119, 0.5924, 0.4316]}, {"w": "employees", "b": [0.5987, 0.4119, 0.7066, 0.4316]}, {"w": "to", "b": [0.7129, 0.4119, 0.7325, 0.4316]}, {"w": "successfully", "b": [0.7389, 0.4119, 0.8622, 0.4316]}, {"w": "defraud", "b": [0.1294, 0.4324, 0.2065, 0.4521]}, {"w": "the", "b": [0.2128, 0.4324, 0.2436, 0.4521]}, {"w": "bank.", "b": [0.2499, 0.4324, 0.3052, 0.4521]}, {"w": "This", "b": [0.3115, 0.4324, 0.3564, 0.4521]}, {"w": "made", "b": [0.3627, 0.4324, 0.4173, 0.4521]}, {"w": "me", "b": [0.4236, 0.4324, 0.4545, 0.4521]}, {"w": "realize", "b": [0.4608, 0.4324, 0.528, 0.4521]}, {"w": "that", "b": [0.5343, 0.4324, 0.5721, 0.4521]}, {"w": "randomly", "b": [0.5785, 0.4324, 0.6751, 0.4521]}, {"w": "removing", "b": [0.6815, 0.4324, 0.7781, 0.4521]}, {"w": "a", "b": [0.7844, 0.4324, 0.7956, 0.4521]}, {"w": "different", "b": [0.1294, 0.4529, 0.2158, 0.4726]}, {"w": "subset", "b": [0.2221, 0.4529, 0.2852, 0.4726]}, {"w": "of", "b": [0.2915, 0.4529, 0.3125, 0.4726]}, {"w": "neurons", "b": [0.3188, 0.4529, 0.3987, 0.4726]}, {"w": "on", "b": [0.405, 0.4529, 0.4302, 0.4726]}, {"w": "each", "b": [0.4365, 0.4529, 0.4827, 0.4726]}, {"w": "example", "b": [0.489, 0.4529, 0.5745, 0.4726]}, {"w": "would", "b": [0.5808, 0.4529, 0.6438, 0.4726]}, {"w": "prevent", "b": [0.6502, 0.4529, 0.7258, 0.4726]}, {"w": "conspiracies", "b": [0.7321, 0.4529, 0.8568, 0.4726]}, {"w": "and", "b": [0.1294, 0.4752, 0.1658, 0.4949]}, {"w": "thus", "b": [0.1721, 0.4752, 0.2142, 0.4949]}, {"w": "reduce", "b": [0.2205, 0.4752, 0.2877, 0.4949]}, {"w": "overfitting.”[1]", "b": [0.294, 0.4729, 0.44, 0.4949]}, {"w": "The", "b": [0.4463, 0.4752, 0.4856, 0.4949]}, {"w": "core", "b": [0.4919, 0.4752, 0.5353, 0.4949]}, {"w": "idea", "b": [0.5416, 0.4752, 0.5836, 0.4949]}, {"w": "is", "b": [0.5899, 0.4752, 0.6067, 0.4949]}, {"w": "that", "b": [0.613, 0.4752, 0.6509, 0.4949]}, {"w": "introducing", "b": [0.6572, 0.4752, 0.7735, 0.4949]}, {"w": "noise", "b": [0.7798, 0.4752, 0.8331, 0.4949]}, {"w": "in", "b": [0.8394, 0.4752, 0.859, 0.4949]}, {"w": "the", "b": [0.1294, 0.4957, 0.1602, 0.5154]}, {"w": "output", "b": [0.1665, 0.4957, 0.231, 0.5154]}, {"w": "values", "b": [0.2373, 0.4957, 0.3018, 0.5154]}, {"w": "of", "b": [0.3081, 0.4957, 0.3291, 0.5154]}, {"w": "a", "b": [0.3354, 0.4957, 0.3466, 0.5154]}, {"w": "layer", "b": [0.3529, 0.4957, 0.4033, 0.5154]}, {"w": "can", "b": [0.4096, 0.4957, 0.4447, 0.5154]}, {"w": "break", "b": [0.451, 0.4957, 0.507, 0.5154]}, {"w": "up", "b": [0.5133, 0.4957, 0.5385, 0.5154]}, {"w": "happenstance", "b": [0.5448, 0.4957, 0.6807, 0.5154]}, {"w": "patterns", "b": [0.687, 0.4957, 0.7669, 0.5154]}, {"w": "that", "b": [0.7732, 0.4957, 0.811, 0.5154]}, {"w": "aren’t", "b": [0.1294, 0.5162, 0.1878, 0.5359]}, {"w": "significant", "b": [0.1941, 0.5162, 0.3006, 0.5359]}, {"w": "(what", "b": [0.3069, 0.5162, 0.3643, 0.5359]}, {"w": "Hinton", "b": [0.3706, 0.5162, 0.4407, 0.5359]}, {"w": "refers", "b": [0.447, 0.5162, 0.5044, 0.5359]}, {"w": "to", "b": [0.5107, 0.5162, 0.5303, 0.5359]}, {"w": "as", "b": [0.5366, 0.5162, 0.5577, 0.5359]}, {"w": "conspiracies),", "b": [0.5639, 0.5162, 0.7062, 0.5359]}, {"w": "which", "b": [0.7125, 0.5162, 0.7741, 0.5359]}, {"w": "the", "b": [0.7804, 0.5162, 0.8113, 0.5359]}, {"w": "network", "b": [0.1294, 0.5367, 0.2121, 0.5564]}, {"w": "will", "b": [0.2184, 0.5367, 0.2576, 0.5564]}, {"w": "start", "b": [0.2639, 0.5367, 0.3074, 0.5564]}, {"w": "memorizing", "b": [0.3137, 0.5367, 0.4356, 0.5564]}, {"w": "if", "b": [0.4419, 0.5367, 0.4573, 0.5564]}, {"w": "no", "b": [0.4636, 0.5367, 0.4889, 0.5564]}, {"w": "noise", "b": [0.4952, 0.5367, 0.5484, 0.5564]}, {"w": "is", "b": [0.5547, 0.5367, 0.5715, 0.5564]}, {"w": "present.", "b": [0.5779, 0.5367, 0.657, 0.5564]}]}, {"id": "b_4", "type": "paragraph", "text": "See the Reddit thread “AMA: We are the Google Brain team. We’d love to answer your questions about machine learning,” http://mng.bz/XrsS.", "words": [{"w": "See", "b": [0.1483, 0.6022, 0.1757, 0.617]}, {"w": "the", "b": [0.1804, 0.6022, 0.2035, 0.617]}, {"w": "Reddit", "b": [0.2082, 0.6022, 0.2587, 0.617]}, {"w": "thread", "b": [0.2634, 0.6022, 0.3107, 0.617]}, {"w": "“AMA:", "b": [0.3154, 0.6022, 0.3732, 0.617]}, {"w": "We", "b": [0.378, 0.6022, 0.4027, 0.617]}, {"w": "are", "b": [0.4074, 0.6022, 0.4305, 0.617]}, {"w": "the", "b": [0.4352, 0.6022, 0.4584, 0.617]}, {"w": "Google", "b": [0.4631, 0.6022, 0.5188, 0.617]}, {"w": "Brain", "b": [0.5235, 0.6022, 0.5655, 0.617]}, {"w": "team.", "b": [0.5703, 0.6022, 0.6118, 0.617]}, {"w": "We’d", "b": [0.6165, 0.6022, 0.657, 0.617]}, {"w": "love", "b": [0.6617, 0.6022, 0.6943, 0.617]}, {"w": "to", "b": [0.699, 0.6022, 0.7137, 0.617]}, {"w": "answer", "b": [0.7185, 0.6022, 0.7721, 0.617]}, {"w": "your", "b": [0.7768, 0.6022, 0.8115, 0.617]}, {"w": "questions", "b": [0.1483, 0.6173, 0.2198, 0.6321]}, {"w": "about", "b": [0.2245, 0.6173, 0.2666, 0.6321]}, {"w": "machine", "b": [0.2713, 0.6173, 0.3354, 0.6321]}, {"w": "learning,”", "b": [0.3401, 0.6173, 0.4153, 0.6321]}, {"w": "http://mng.bz/XrsS.", "b": [0.4199, 0.6173, 0.5692, 0.6321]}]}, {"id": "b_5", "type": "paragraph", "text": "In Keras, you can introduce dropout in a network via the Dropout layer, which is applied to the output of the layer right before it:", "words": [{"w": "In", "b": [0.1294, 0.6552, 0.1504, 0.675]}, {"w": "Keras,", "b": [0.1567, 0.6552, 0.2219, 0.675]}, {"w": "you", "b": [0.2282, 0.6552, 0.266, 0.675]}, {"w": "can", "b": [0.2723, 0.6552, 0.3073, 0.675]}, {"w": "introduce", "b": [0.3136, 0.6552, 0.4089, 0.675]}, {"w": "dropout", "b": [0.4152, 0.6552, 0.4937, 0.675]}, {"w": "in", "b": [0.5, 0.6552, 0.5196, 0.675]}, {"w": "a", "b": [0.5259, 0.6552, 0.5371, 0.675]}, {"w": "network", "b": [0.5434, 0.6552, 0.6261, 0.675]}, {"w": "via", "b": [0.6324, 0.6552, 0.6632, 0.675]}, {"w": "the", "b": [0.6695, 0.6552, 0.7004, 0.675]}, {"w": "Dropout", "b": [0.7066, 0.6563, 0.8126, 0.6765]}, {"w": "layer,", "b": [0.1294, 0.6766, 0.1851, 0.6964]}, {"w": "which", "b": [0.1914, 0.6766, 0.2531, 0.6964]}, {"w": "is", "b": [0.2594, 0.6766, 0.2762, 0.6964]}, {"w": "applied", "b": [0.2825, 0.6766, 0.3568, 0.6964]}, {"w": "to", "b": [0.3631, 0.6766, 0.3827, 0.6964]}, {"w": "the", "b": [0.389, 0.6766, 0.4198, 0.6964]}, {"w": "output", "b": [0.4262, 0.6766, 0.4906, 0.6964]}, {"w": "of", "b": [0.4969, 0.6766, 0.518, 0.6964]}, {"w": "the", "b": [0.5243, 0.6766, 0.5551, 0.6964]}, {"w": "layer", "b": [0.5614, 0.6766, 0.6118, 0.6964]}, {"w": "right", "b": [0.6181, 0.6766, 0.6658, 0.6964]}, {"w": "before", "b": [0.6721, 0.6766, 0.7365, 0.6964]}, {"w": "it:", "b": [0.7428, 0.6766, 0.7639, 0.6964]}]}, {"id": "b_6", "type": "paragraph", "text": "model.add(layers.Dropout(0.5))", "words": [{"w": "model.add(layers.Dropout(0.5))", "b": [0.1357, 0.7144, 0.4763, 0.7295]}]}, {"id": "b_7", "type": "paragraph", "text": "Let’s add two Dropout layers in the IMDB network to see how well they do at reducing overfitting.", "words": [{"w": "Let’s", "b": [0.1294, 0.7524, 0.1798, 0.7721]}, {"w": "add", "b": [0.1862, 0.7524, 0.2226, 0.7721]}, {"w": "two", "b": [0.2289, 0.7524, 0.2667, 0.7721]}, {"w": "Dropout", "b": [0.273, 0.7534, 0.379, 0.7736]}, {"w": "layers", "b": [0.3853, 0.7524, 0.4455, 0.7721]}, {"w": "in", "b": [0.4518, 0.7524, 0.4714, 0.7721]}, {"w": "the", "b": [0.4778, 0.7524, 0.5086, 0.7721]}, {"w": "IMDB", "b": [0.5149, 0.7524, 0.5808, 0.7721]}, {"w": "network", "b": [0.5871, 0.7524, 0.6697, 0.7721]}, {"w": "to", "b": [0.676, 0.7524, 0.6957, 0.7721]}, {"w": "see", "b": [0.702, 0.7524, 0.7342, 0.7721]}, {"w": "how", "b": [0.7405, 0.7524, 0.7839, 0.7721]}, {"w": "well", "b": [0.7902, 0.7524, 0.8337, 0.7721]}, {"w": "they", "b": [0.1294, 0.7738, 0.1729, 0.7935]}, {"w": "do", "b": [0.1792, 0.7738, 0.2044, 0.7935]}, {"w": "at", "b": [0.2107, 0.7738, 0.2289, 0.7935]}, {"w": "reducing", "b": [0.2352, 0.7738, 0.3235, 0.7935]}, {"w": "overfitting.", "b": [0.3298, 0.7738, 0.4426, 0.7935]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 4.8. Adding dropout to the IMDB network", "words": [{"w": "Listing", "b": [0.1294, 0.8116, 0.1862, 0.8264]}, {"w": "4.8.", "b": [0.1909, 0.8116, 0.2193, 0.8264]}, {"w": "Adding", "b": [0.224, 0.8116, 0.2839, 0.8264]}, {"w": "dropout", "b": [0.2887, 0.8116, 0.3535, 0.8264]}, {"w": "to", "b": [0.3582, 0.8116, 0.374, 0.8264]}, {"w": "the", "b": [0.3787, 0.8116, 0.404, 0.8264]}, {"w": "IMDB", "b": [0.4087, 0.8116, 0.4602, 0.8264]}, {"w": "network", "b": [0.4649, 0.8116, 0.5322, 0.8264]}]}, {"id": "b_9", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(16, activation='relu', input_shape= (10000,))) model.add(layers.Dropout(0.5))", "words": [{"w": "model", "b": [0.1357, 0.84, 0.1925, 0.8552]}, {"w": "=", "b": [0.2038, 0.84, 0.2152, 0.8552]}, {"w": "models.Sequential()", "b": [0.2265, 0.84, 0.4422, 0.8552]}, {"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.8552, 0.4309, 0.8703]}, {"w": "activation='relu',", "b": [0.4422, 0.8552, 0.6465, 0.8703]}, {"w": "input_shape=", "b": [0.6579, 0.8552, 0.7941, 0.8703]}, {"w": "(10000,)))", "b": [0.1357, 0.8703, 0.2492, 0.8855]}, {"w": "model.add(layers.Dropout(0.5))", "b": [0.1357, 0.8855, 0.4763, 0.9006]}]}]}, {"page": 162, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.add(layers.Dense(16, activation='relu')) model.add(layers.Dropout(0.5)) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "model.add(layers.Dense(16,", "b": [0.1357, 0.0851, 0.4309, 0.1002]}, {"w": "activation='relu'))", "b": [0.4422, 0.0851, 0.6579, 0.1002]}, {"w": "model.add(layers.Dropout(0.5))", "b": [0.1357, 0.1002, 0.4763, 0.1154]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.1154, 0.4195, 0.1305]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.1154, 0.6806, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 4.9 shows a plot of the results. Again, this is a clear improvement over the reference network.", "words": [{"w": "Figure", "b": [0.1294, 0.1534, 0.1953, 0.1732]}, {"w": "4.9", "b": [0.2016, 0.1534, 0.2331, 0.1732]}, {"w": "shows", "b": [0.2394, 0.1534, 0.3025, 0.1732]}, {"w": "a", "b": [0.3088, 0.1534, 0.32, 0.1732]}, {"w": "plot", "b": [0.3263, 0.1534, 0.3655, 0.1732]}, {"w": "of", "b": [0.3718, 0.1534, 0.3928, 0.1732]}, {"w": "the", "b": [0.3992, 0.1534, 0.43, 0.1732]}, {"w": "results.", "b": [0.4363, 0.1534, 0.5085, 0.1732]}, {"w": "Again,", "b": [0.5148, 0.1534, 0.5827, 0.1732]}, {"w": "this", "b": [0.589, 0.1534, 0.6255, 0.1732]}, {"w": "is", "b": [0.6318, 0.1534, 0.6486, 0.1732]}, {"w": "a", "b": [0.6549, 0.1534, 0.6661, 0.1732]}, {"w": "clear", "b": [0.6724, 0.1534, 0.7214, 0.1732]}, {"w": "improvement", "b": [0.7277, 0.1534, 0.8623, 0.1732]}, {"w": "over", "b": [0.1294, 0.1739, 0.1742, 0.1937]}, {"w": "the", "b": [0.1805, 0.1739, 0.2114, 0.1937]}, {"w": "reference", "b": [0.2177, 0.1739, 0.3115, 0.1937]}, {"w": "network.", "b": [0.3178, 0.1739, 0.4068, 0.1937]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 4.9. Effect of dropout on validation loss", "words": [{"w": "Figure", "b": [0.1294, 0.2118, 0.1827, 0.2266]}, {"w": "4.9.", "b": [0.1874, 0.2118, 0.2158, 0.2266]}, {"w": "Effect", "b": [0.2205, 0.2118, 0.2688, 0.2266]}, {"w": "of", "b": [0.2735, 0.2118, 0.2893, 0.2266]}, {"w": "dropout", "b": [0.294, 0.2118, 0.3589, 0.2266]}, {"w": "on", "b": [0.3636, 0.2118, 0.3836, 0.2266]}, {"w": "validation", "b": [0.3883, 0.2118, 0.4692, 0.2266]}, {"w": "loss", "b": [0.474, 0.2118, 0.5034, 0.2266]}]}, {"id": "b_3", "type": "paragraph", "text": "To recap, these are the most common ways to prevent overfitting in neural networks:", "words": [{"w": "To", "b": [0.1294, 0.5171, 0.1557, 0.5368]}, {"w": "recap,", "b": [0.162, 0.5171, 0.2229, 0.5368]}, {"w": "these", "b": [0.2292, 0.5171, 0.281, 0.5368]}, {"w": "are", "b": [0.2874, 0.5171, 0.3182, 0.5368]}, {"w": "the", "b": [0.3245, 0.5171, 0.3553, 0.5368]}, {"w": "most", "b": [0.3616, 0.5171, 0.4107, 0.5368]}, {"w": "common", "b": [0.417, 0.5171, 0.5053, 0.5368]}, {"w": "ways", "b": [0.5116, 0.5171, 0.5634, 0.5368]}, {"w": "to", "b": [0.5697, 0.5171, 0.5893, 0.5368]}, {"w": "prevent", "b": [0.5956, 0.5171, 0.6713, 0.5368]}, {"w": "overfitting", "b": [0.6776, 0.5171, 0.7841, 0.5368]}, {"w": "in", "b": [0.7904, 0.5171, 0.81, 0.5368]}, {"w": "neural", "b": [0.1294, 0.5376, 0.1925, 0.5573]}, {"w": "networks:", "b": [0.1988, 0.5376, 0.2982, 0.5573]}]}, {"id": "b_4", "type": "paragraph", "text": "Get more training data. Reduce the capacity of the network. Add weight regularization. Add dropout.", "words": [{"w": "Get", "b": [0.1799, 0.5759, 0.2163, 0.5956]}, {"w": "more", "b": [0.2226, 0.5759, 0.2744, 0.5956]}, {"w": "training", "b": [0.2807, 0.5759, 0.3592, 0.5956]}, {"w": "data.", "b": [0.3655, 0.5759, 0.4139, 0.5956]}, {"w": "Reduce", "b": [0.1799, 0.5964, 0.2555, 0.6161]}, {"w": "the", "b": [0.2618, 0.5964, 0.2926, 0.6161]}, {"w": "capacity", "b": [0.299, 0.5964, 0.383, 0.6161]}, {"w": "of", "b": [0.3893, 0.5964, 0.4103, 0.6161]}, {"w": "the", "b": [0.4166, 0.5964, 0.4475, 0.6161]}, {"w": "network.", "b": [0.4538, 0.5964, 0.5427, 0.6161]}, {"w": "Add", "b": [0.1799, 0.6169, 0.2233, 0.6366]}, {"w": "weight", "b": [0.2296, 0.6169, 0.2983, 0.6366]}, {"w": "regularization.", "b": [0.3046, 0.6169, 0.451, 0.6366]}, {"w": "Add", "b": [0.1799, 0.6374, 0.2233, 0.6571]}, {"w": "dropout.", "b": [0.2296, 0.6374, 0.3144, 0.6571]}]}, {"id": "b_5", "type": "paragraph", "text": "4.5. The universal workflow of machine learning", "words": [{"w": "4.5.", "b": [0.1294, 0.6942, 0.172, 0.7165]}, {"w": "The", "b": [0.1791, 0.6942, 0.2264, 0.7165]}, {"w": "universal", "b": [0.2335, 0.6942, 0.3454, 0.7165]}, {"w": "workflow", "b": [0.3525, 0.6942, 0.4676, 0.7165]}, {"w": "of", "b": [0.4747, 0.6942, 0.4983, 0.7165]}, {"w": "machine", "b": [0.5054, 0.6942, 0.6079, 0.7165]}, {"w": "learning", "b": [0.615, 0.6942, 0.7159, 0.7165]}]}, {"id": "b_6", "type": "paragraph", "text": "In this section, we’ll present a universal blueprint that you can use to attack and solve any machine-learning problem. The blueprint ties together the concepts you’ve learned about in this chapter: problem definition, evaluation, feature engineering, and fighting overfitting.", "words": [{"w": "In", "b": [0.1294, 0.7399, 0.1504, 0.7596]}, {"w": "this", "b": [0.1567, 0.7399, 0.1932, 0.7596]}, {"w": "section,", "b": [0.1995, 0.7399, 0.2773, 0.7596]}, {"w": "we’ll", "b": [0.2836, 0.7399, 0.3354, 0.7596]}, {"w": "present", "b": [0.3417, 0.7399, 0.4146, 0.7596]}, {"w": "a", "b": [0.4209, 0.7399, 0.4321, 0.7596]}, {"w": "universal", "b": [0.4384, 0.7399, 0.5309, 0.7596]}, {"w": "blueprint", "b": [0.5372, 0.7399, 0.6283, 0.7596]}, {"w": "that", "b": [0.6346, 0.7399, 0.6724, 0.7596]}, {"w": "you", "b": [0.6787, 0.7399, 0.7165, 0.7596]}, {"w": "can", "b": [0.7228, 0.7399, 0.7579, 0.7596]}, {"w": "use", "b": [0.7642, 0.7399, 0.7978, 0.7596]}, {"w": "to", "b": [0.8041, 0.7399, 0.8237, 0.7596]}, {"w": "attack", "b": [0.1294, 0.7604, 0.1897, 0.7801]}, {"w": "and", "b": [0.196, 0.7604, 0.2324, 0.7801]}, {"w": "solve", "b": [0.2387, 0.7604, 0.2919, 0.7801]}, {"w": "any", "b": [0.2982, 0.7604, 0.3347, 0.7801]}, {"w": "machine-learning", "b": [0.341, 0.7604, 0.5175, 0.7801]}, {"w": "problem.", "b": [0.5238, 0.7604, 0.6142, 0.7801]}, {"w": "The", "b": [0.6205, 0.7604, 0.6597, 0.7801]}, {"w": "blueprint", "b": [0.666, 0.7604, 0.757, 0.7801]}, {"w": "ties", "b": [0.7633, 0.7604, 0.7984, 0.7801]}, {"w": "together", "b": [0.1294, 0.7809, 0.2121, 0.8006]}, {"w": "the", "b": [0.2184, 0.7809, 0.2492, 0.8006]}, {"w": "concepts", "b": [0.2555, 0.7809, 0.3438, 0.8006]}, {"w": "you’ve", "b": [0.3501, 0.7809, 0.4201, 0.8006]}, {"w": "learned", "b": [0.4264, 0.7809, 0.5007, 0.8006]}, {"w": "about", "b": [0.507, 0.7809, 0.563, 0.8006]}, {"w": "in", "b": [0.5693, 0.7809, 0.589, 0.8006]}, {"w": "this", "b": [0.5953, 0.7809, 0.6317, 0.8006]}, {"w": "chapter:", "b": [0.638, 0.7809, 0.7193, 0.8006]}, {"w": "problem", "b": [0.7256, 0.7809, 0.8097, 0.8006]}, {"w": "definition,", "b": [0.1294, 0.8014, 0.2338, 0.8211]}, {"w": "evaluation,", "b": [0.2401, 0.8014, 0.3515, 0.8211]}, {"w": "feature", "b": [0.3578, 0.8014, 0.4279, 0.8211]}, {"w": "engineering,", "b": [0.4342, 0.8014, 0.5596, 0.8211]}, {"w": "and", "b": [0.5658, 0.8014, 0.6022, 0.8211]}, {"w": "fighting", "b": [0.6085, 0.8014, 0.6884, 0.8211]}, {"w": "overfitting.", "b": [0.6947, 0.8014, 0.8075, 0.8211]}]}, {"id": "b_7", "type": "paragraph", "text": "4.5.1. Defining the problem and assembling a dataset", "words": [{"w": "4.5.1.", "b": [0.1294, 0.8486, 0.1862, 0.8684]}, {"w": "Defining", "b": [0.1925, 0.8486, 0.285, 0.8684]}, {"w": "the", "b": [0.2913, 0.8486, 0.3249, 0.8684]}, {"w": "problem", "b": [0.3312, 0.8486, 0.4219, 0.8684]}, {"w": "and", "b": [0.4282, 0.8486, 0.4688, 0.8684]}, {"w": "assembling", "b": [0.4751, 0.8486, 0.5943, 0.8684]}, {"w": "a", "b": [0.6006, 0.8486, 0.6132, 0.8684]}, {"w": "dataset", "b": [0.6195, 0.8486, 0.6966, 0.8684]}]}, {"id": "b_8", "type": "paragraph", "text": "First, you must define the problem at hand:", "words": [{"w": "First,", "b": [0.1294, 0.8914, 0.182, 0.9112]}, {"w": "you", "b": [0.1883, 0.8914, 0.2261, 0.9112]}, {"w": "must", "b": [0.2324, 0.8914, 0.2815, 0.9112]}, {"w": "define", "b": [0.2878, 0.8914, 0.3508, 0.9112]}, {"w": "the", "b": [0.3572, 0.8914, 0.388, 0.9112]}, {"w": "problem", "b": [0.3943, 0.8914, 0.4784, 0.9112]}, {"w": "at", "b": [0.4847, 0.8914, 0.5029, 0.9112]}, {"w": "hand:", "b": [0.5092, 0.8914, 0.5652, 0.9112]}]}]}, {"page": 163, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "What will your input data be? What are you trying to predict? You can only learn to predict something if you have available training data: for example, you can only learn to classify the sentiment of movie reviews if you have both movie reviews and sentiment annotations available. As such, data availability is usually the limiting factor at this stage (unless you have the means to pay people to collect data for you). What type of problem are you facing? Is it binary classification? Multiclass classification? Scalar regression? Vector regression? Multiclass, multilabel classification? Something else, like clustering, generation, or reinforcement learning? Identifying the problem type will guide your choice of model architecture, loss function, and so on.", "words": [{"w": "What", "b": [0.1799, 0.0857, 0.2345, 0.1054]}, {"w": "will", "b": [0.2408, 0.0857, 0.2801, 0.1054]}, {"w": "your", "b": [0.2864, 0.0857, 0.3326, 0.1054]}, {"w": "input", "b": [0.3389, 0.0857, 0.3908, 0.1054]}, {"w": "data", "b": [0.3971, 0.0857, 0.4391, 0.1054]}, {"w": "be?", "b": [0.4454, 0.0857, 0.4804, 0.1054]}, {"w": "What", "b": [0.4867, 0.0857, 0.5414, 0.1054]}, {"w": "are", "b": [0.5477, 0.0857, 0.5785, 0.1054]}, {"w": "you", "b": [0.5848, 0.0857, 0.6226, 0.1054]}, {"w": "trying", "b": [0.6289, 0.0857, 0.6892, 0.1054]}, {"w": "to", "b": [0.6955, 0.0857, 0.7151, 0.1054]}, {"w": "predict?", "b": [0.7214, 0.0857, 0.8027, 0.1054]}, {"w": "You", "b": [0.809, 0.0857, 0.8498, 0.1054]}, {"w": "can", "b": [0.1799, 0.1062, 0.2149, 0.1259]}, {"w": "only", "b": [0.2212, 0.1062, 0.266, 0.1259]}, {"w": "learn", "b": [0.2723, 0.1062, 0.3228, 0.1259]}, {"w": "to", "b": [0.3291, 0.1062, 0.3487, 0.1259]}, {"w": "predict", "b": [0.355, 0.1062, 0.4251, 0.1259]}, {"w": "something", "b": [0.4314, 0.1062, 0.5365, 0.1259]}, {"w": "if", "b": [0.5428, 0.1062, 0.5582, 0.1259]}, {"w": "you", "b": [0.5645, 0.1062, 0.6023, 0.1259]}, {"w": "have", "b": [0.6087, 0.1062, 0.6563, 0.1259]}, {"w": "available", "b": [0.6626, 0.1062, 0.7536, 0.1259]}, {"w": "training", "b": [0.7599, 0.1062, 0.8383, 0.1259]}, {"w": "data:", "b": [0.1799, 0.1267, 0.2289, 0.1464]}, {"w": "for", "b": [0.2352, 0.1267, 0.2646, 0.1464]}, {"w": "example,", "b": [0.2709, 0.1267, 0.3627, 0.1464]}, {"w": "you", "b": [0.369, 0.1267, 0.4068, 0.1464]}, {"w": "can", "b": [0.4132, 0.1267, 0.4482, 0.1464]}, {"w": "only", "b": [0.4545, 0.1267, 0.4993, 0.1464]}, {"w": "learn", "b": [0.5056, 0.1267, 0.5561, 0.1464]}, {"w": "to", "b": [0.5624, 0.1267, 0.582, 0.1464]}, {"w": "classify", "b": [0.5883, 0.1267, 0.6654, 0.1464]}, {"w": "the", "b": [0.6717, 0.1267, 0.7025, 0.1464]}, {"w": "sentiment", "b": [0.7088, 0.1267, 0.8069, 0.1464]}, {"w": "of", "b": [0.8132, 0.1267, 0.8342, 0.1464]}, {"w": "movie", "b": [0.1799, 0.1472, 0.2429, 0.1669]}, {"w": "reviews", "b": [0.2492, 0.1472, 0.3277, 0.1669]}, {"w": "if", "b": [0.334, 0.1472, 0.3494, 0.1669]}, {"w": "you", "b": [0.3557, 0.1472, 0.3936, 0.1669]}, {"w": "have", "b": [0.3999, 0.1472, 0.4475, 0.1669]}, {"w": "both", "b": [0.4538, 0.1472, 0.4986, 0.1669]}, {"w": "movie", "b": [0.5049, 0.1472, 0.568, 0.1669]}, {"w": "reviews", "b": [0.5743, 0.1472, 0.6528, 0.1669]}, {"w": "and", "b": [0.6591, 0.1472, 0.6955, 0.1669]}, {"w": "sentiment", "b": [0.7017, 0.1472, 0.7998, 0.1669]}, {"w": "annotations", "b": [0.1799, 0.1677, 0.2962, 0.1874]}, {"w": "available.", "b": [0.3025, 0.1677, 0.3999, 0.1874]}, {"w": "As", "b": [0.4062, 0.1677, 0.4342, 0.1874]}, {"w": "such,", "b": [0.4405, 0.1677, 0.493, 0.1874]}, {"w": "data", "b": [0.4993, 0.1677, 0.5414, 0.1874]}, {"w": "availability", "b": [0.5477, 0.1677, 0.6612, 0.1874]}, {"w": "is", "b": [0.6675, 0.1677, 0.6843, 0.1874]}, {"w": "usually", "b": [0.6906, 0.1677, 0.7635, 0.1874]}, {"w": "the", "b": [0.7698, 0.1677, 0.8006, 0.1874]}, {"w": "limiting", "b": [0.1799, 0.1882, 0.2598, 0.2079]}, {"w": "factor", "b": [0.2661, 0.1882, 0.3249, 0.2079]}, {"w": "at", "b": [0.3312, 0.1882, 0.3494, 0.2079]}, {"w": "this", "b": [0.3557, 0.1882, 0.3922, 0.2079]}, {"w": "stage", "b": [0.3985, 0.1882, 0.4503, 0.2079]}, {"w": "(unless", "b": [0.4566, 0.1882, 0.5281, 0.2079]}, {"w": "you", "b": [0.5344, 0.1882, 0.5723, 0.2079]}, {"w": "have", "b": [0.5786, 0.1882, 0.6262, 0.2079]}, {"w": "the", "b": [0.6324, 0.1882, 0.6632, 0.2079]}, {"w": "means", "b": [0.6695, 0.1882, 0.734, 0.2079]}, {"w": "to", "b": [0.7403, 0.1882, 0.7599, 0.2079]}, {"w": "pay", "b": [0.7662, 0.1882, 0.8027, 0.2079]}, {"w": "people", "b": [0.1799, 0.2087, 0.2471, 0.2284]}, {"w": "to", "b": [0.2534, 0.2087, 0.273, 0.2284]}, {"w": "collect", "b": [0.2794, 0.2087, 0.3466, 0.2284]}, {"w": "data", "b": [0.3529, 0.2087, 0.3949, 0.2284]}, {"w": "for", "b": [0.4012, 0.2087, 0.4307, 0.2284]}, {"w": "you).", "b": [0.437, 0.2087, 0.4895, 0.2284]}, {"w": "What", "b": [0.1799, 0.2292, 0.2345, 0.2489]}, {"w": "type", "b": [0.2408, 0.2292, 0.2842, 0.2489]}, {"w": "of", "b": [0.2906, 0.2292, 0.3116, 0.2489]}, {"w": "problem", "b": [0.3179, 0.2292, 0.402, 0.2489]}, {"w": "are", "b": [0.4083, 0.2292, 0.4391, 0.2489]}, {"w": "you", "b": [0.4454, 0.2292, 0.4832, 0.2489]}, {"w": "facing?", "b": [0.4895, 0.2292, 0.5637, 0.2489]}, {"w": "Is", "b": [0.5701, 0.2292, 0.5883, 0.2489]}, {"w": "it", "b": [0.5946, 0.2292, 0.6086, 0.2489]}, {"w": "binary", "b": [0.6149, 0.2292, 0.6794, 0.2489]}, {"w": "classification?", "b": [0.6857, 0.2292, 0.83, 0.2489]}, {"w": "Multiclass", "b": [0.1799, 0.2497, 0.285, 0.2694]}, {"w": "classification?", "b": [0.2913, 0.2497, 0.4356, 0.2694]}, {"w": "Scalar", "b": [0.4419, 0.2497, 0.5049, 0.2694]}, {"w": "regression?", "b": [0.5113, 0.2497, 0.6261, 0.2694]}, {"w": "Vector", "b": [0.6324, 0.2497, 0.6982, 0.2694]}, {"w": "regression?", "b": [0.7045, 0.2497, 0.8194, 0.2694]}, {"w": "Multiclass,", "b": [0.1799, 0.2702, 0.2913, 0.2899]}, {"w": "multilabel", "b": [0.2976, 0.2702, 0.3999, 0.2899]}, {"w": "classification?", "b": [0.4062, 0.2702, 0.5505, 0.2899]}, {"w": "Something", "b": [0.5568, 0.2702, 0.6662, 0.2899]}, {"w": "else,", "b": [0.6725, 0.2702, 0.718, 0.2899]}, {"w": "like", "b": [0.7243, 0.2702, 0.7621, 0.2899]}, {"w": "clustering,", "b": [0.1799, 0.2907, 0.2857, 0.3104]}, {"w": "generation,", "b": [0.292, 0.2907, 0.4048, 0.3104]}, {"w": "or", "b": [0.4111, 0.2907, 0.4321, 0.3104]}, {"w": "reinforcement", "b": [0.4384, 0.2907, 0.5799, 0.3104]}, {"w": "learning?", "b": [0.5862, 0.2907, 0.68, 0.3104]}, {"w": "Identifying", "b": [0.6863, 0.2907, 0.7984, 0.3104]}, {"w": "the", "b": [0.8047, 0.2907, 0.8355, 0.3104]}, {"w": "problem", "b": [0.1799, 0.3112, 0.2639, 0.3309]}, {"w": "type", "b": [0.2702, 0.3112, 0.3137, 0.3309]}, {"w": "will", "b": [0.32, 0.3112, 0.3592, 0.3309]}, {"w": "guide", "b": [0.3656, 0.3112, 0.4216, 0.3309]}, {"w": "your", "b": [0.4279, 0.3112, 0.4741, 0.3309]}, {"w": "choice", "b": [0.4805, 0.3112, 0.5463, 0.3309]}, {"w": "of", "b": [0.5526, 0.3112, 0.5736, 0.3309]}, {"w": "model", "b": [0.5799, 0.3112, 0.643, 0.3309]}, {"w": "architecture,", "b": [0.6493, 0.3112, 0.7747, 0.3309]}, {"w": "loss", "b": [0.781, 0.3112, 0.8202, 0.3309]}, {"w": "function,", "b": [0.1799, 0.3317, 0.2702, 0.3514]}, {"w": "and", "b": [0.2766, 0.3317, 0.313, 0.3514]}, {"w": "so", "b": [0.3193, 0.3317, 0.3417, 0.3514]}, {"w": "on.", "b": [0.348, 0.3317, 0.3796, 0.3514]}]}, {"id": "b_1", "type": "paragraph", "text": "You can’t move to the next stage until you know what your inputs and outputs are, and what data you’ll use. Be aware of the hypotheses you make at this stage:", "words": [{"w": "You", "b": [0.1294, 0.3745, 0.1703, 0.3942]}, {"w": "can’t", "b": [0.1766, 0.3745, 0.2266, 0.3942]}, {"w": "move", "b": [0.2329, 0.3745, 0.289, 0.3942]}, {"w": "to", "b": [0.2953, 0.3745, 0.3149, 0.3942]}, {"w": "the", "b": [0.3212, 0.3745, 0.352, 0.3942]}, {"w": "next", "b": [0.3583, 0.3745, 0.4018, 0.3942]}, {"w": "stage", "b": [0.4081, 0.3745, 0.4599, 0.3942]}, {"w": "until", "b": [0.4662, 0.3745, 0.5125, 0.3942]}, {"w": "you", "b": [0.5188, 0.3745, 0.5566, 0.3942]}, {"w": "know", "b": [0.5629, 0.3745, 0.619, 0.3942]}, {"w": "what", "b": [0.6253, 0.3745, 0.6743, 0.3942]}, {"w": "your", "b": [0.6806, 0.3745, 0.7269, 0.3942]}, {"w": "inputs", "b": [0.7332, 0.3745, 0.7949, 0.3942]}, {"w": "and", "b": [0.8012, 0.3745, 0.8376, 0.3942]}, {"w": "outputs", "b": [0.1294, 0.395, 0.2037, 0.4147]}, {"w": "are,", "b": [0.21, 0.395, 0.2471, 0.4147]}, {"w": "and", "b": [0.2534, 0.395, 0.2898, 0.4147]}, {"w": "what", "b": [0.2962, 0.395, 0.3452, 0.4147]}, {"w": "data", "b": [0.3515, 0.395, 0.3935, 0.4147]}, {"w": "you’ll", "b": [0.3998, 0.395, 0.4601, 0.4147]}, {"w": "use.", "b": [0.4664, 0.395, 0.5063, 0.4147]}, {"w": "Be", "b": [0.5126, 0.395, 0.5407, 0.4147]}, {"w": "aware", "b": [0.547, 0.395, 0.6072, 0.4147]}, {"w": "of", "b": [0.6135, 0.395, 0.6345, 0.4147]}, {"w": "the", "b": [0.6408, 0.395, 0.6716, 0.4147]}, {"w": "hypotheses", "b": [0.6779, 0.395, 0.79, 0.4147]}, {"w": "you", "b": [0.7963, 0.395, 0.8341, 0.4147]}, {"w": "make", "b": [0.1294, 0.4155, 0.1841, 0.4352]}, {"w": "at", "b": [0.1904, 0.4155, 0.2086, 0.4352]}, {"w": "this", "b": [0.2149, 0.4155, 0.2513, 0.4352]}, {"w": "stage:", "b": [0.2576, 0.4155, 0.3165, 0.4352]}]}, {"id": "b_2", "type": "paragraph", "text": "You hypothesize that your outputs can be predicted given your inputs. You hypothesize that your available data is sufficiently informative to learn the relationship between inputs and outputs.", "words": [{"w": "You", "b": [0.1799, 0.4538, 0.2208, 0.4735]}, {"w": "hypothesize", "b": [0.2271, 0.4538, 0.3476, 0.4735]}, {"w": "that", "b": [0.3539, 0.4538, 0.3917, 0.4735]}, {"w": "your", "b": [0.398, 0.4538, 0.4443, 0.4735]}, {"w": "outputs", "b": [0.4506, 0.4538, 0.5249, 0.4735]}, {"w": "can", "b": [0.5312, 0.4538, 0.5662, 0.4735]}, {"w": "be", "b": [0.5725, 0.4538, 0.5963, 0.4735]}, {"w": "predicted", "b": [0.6026, 0.4538, 0.6965, 0.4735]}, {"w": "given", "b": [0.7028, 0.4538, 0.7588, 0.4735]}, {"w": "your", "b": [0.7652, 0.4538, 0.8114, 0.4735]}, {"w": "inputs.", "b": [0.1799, 0.4743, 0.2478, 0.494]}, {"w": "You", "b": [0.1799, 0.4948, 0.2208, 0.5145]}, {"w": "hypothesize", "b": [0.2271, 0.4948, 0.3476, 0.5145]}, {"w": "that", "b": [0.3539, 0.4948, 0.3917, 0.5145]}, {"w": "your", "b": [0.398, 0.4948, 0.4443, 0.5145]}, {"w": "available", "b": [0.4506, 0.4948, 0.5417, 0.5145]}, {"w": "data", "b": [0.548, 0.4948, 0.59, 0.5145]}, {"w": "is", "b": [0.5963, 0.4948, 0.6131, 0.5145]}, {"w": "sufficiently", "b": [0.6194, 0.4948, 0.7338, 0.5145]}, {"w": "informative", "b": [0.7401, 0.4948, 0.8578, 0.5145]}, {"w": "to", "b": [0.1799, 0.5153, 0.1995, 0.535]}, {"w": "learn", "b": [0.2058, 0.5153, 0.2562, 0.535]}, {"w": "the", "b": [0.2625, 0.5153, 0.2934, 0.535]}, {"w": "relationship", "b": [0.2997, 0.5153, 0.4188, 0.535]}, {"w": "between", "b": [0.4251, 0.5153, 0.5091, 0.535]}, {"w": "inputs", "b": [0.5154, 0.5153, 0.5771, 0.535]}, {"w": "and", "b": [0.5834, 0.5153, 0.6199, 0.535]}, {"w": "outputs.", "b": [0.6262, 0.5153, 0.7068, 0.535]}]}, {"id": "b_3", "type": "paragraph", "text": "Until you have a working model, these are merely hypotheses, waiting to be validated or invalidated. Not all problems can be solved; just because you’ve assembled examples of inputs X and targets Y doesn’t mean X contains enough information to predict Y. For instance, if you’re trying to predict the movements of a stock on the stock market given its recent price history, you’re unlikely to succeed, because price history doesn’t contain much predictive information.", "words": [{"w": "Until", "b": [0.1294, 0.5581, 0.1813, 0.5778]}, {"w": "you", "b": [0.1876, 0.5581, 0.2254, 0.5778]}, {"w": "have", "b": [0.2317, 0.5581, 0.2794, 0.5778]}, {"w": "a", "b": [0.2857, 0.5581, 0.2969, 0.5778]}, {"w": "working", "b": [0.3032, 0.5581, 0.3872, 0.5778]}, {"w": "model,", "b": [0.3936, 0.5581, 0.4629, 0.5778]}, {"w": "these", "b": [0.4692, 0.5581, 0.5211, 0.5778]}, {"w": "are", "b": [0.5274, 0.5581, 0.5582, 0.5778]}, {"w": "merely", "b": [0.5645, 0.5581, 0.6345, 0.5778]}, {"w": "hypotheses,", "b": [0.6408, 0.5581, 0.7592, 0.5778]}, {"w": "waiting", "b": [0.7656, 0.5581, 0.8412, 0.5778]}, {"w": "to", "b": [0.8475, 0.5581, 0.8672, 0.5778]}, {"w": "be", "b": [0.1294, 0.5786, 0.1532, 0.5983]}, {"w": "validated", "b": [0.1595, 0.5786, 0.252, 0.5983]}, {"w": "or", "b": [0.2583, 0.5786, 0.2793, 0.5983]}, {"w": "invalidated.", "b": [0.2856, 0.5786, 0.404, 0.5983]}, {"w": "Not", "b": [0.4104, 0.5786, 0.4482, 0.5983]}, {"w": "all", "b": [0.4545, 0.5786, 0.4797, 0.5983]}, {"w": "problems", "b": [0.486, 0.5786, 0.5799, 0.5983]}, {"w": "can", "b": [0.5862, 0.5786, 0.6212, 0.5983]}, {"w": "be", "b": [0.6274, 0.5786, 0.6513, 0.5983]}, {"w": "solved;", "b": [0.6576, 0.5786, 0.7304, 0.5983]}, {"w": "just", "b": [0.7367, 0.5786, 0.7732, 0.5983]}, {"w": "because", "b": [0.7795, 0.5786, 0.8593, 0.5983]}, {"w": "you’ve", "b": [0.1294, 0.5991, 0.1995, 0.6188]}, {"w": "assembled", "b": [0.2058, 0.5991, 0.3109, 0.6188]}, {"w": "examples", "b": [0.3172, 0.5991, 0.4124, 0.6188]}, {"w": "of", "b": [0.4188, 0.5991, 0.4398, 0.6188]}, {"w": "inputs", "b": [0.4461, 0.5991, 0.5077, 0.6188]}, {"w": "X", "b": [0.5141, 0.5991, 0.5323, 0.6188]}, {"w": "and", "b": [0.5386, 0.5991, 0.575, 0.6188]}, {"w": "targets", "b": [0.5813, 0.5991, 0.6481, 0.6188]}, {"w": "Y", "b": [0.6544, 0.5991, 0.6726, 0.6188]}, {"w": "doesn’t", "b": [0.6789, 0.5991, 0.7527, 0.6188]}, {"w": "mean", "b": [0.759, 0.5991, 0.8136, 0.6188]}, {"w": "X", "b": [0.8199, 0.5991, 0.8382, 0.6188]}, {"w": "contains", "b": [0.1294, 0.6196, 0.2135, 0.6393]}, {"w": "enough", "b": [0.2198, 0.6196, 0.2941, 0.6393]}, {"w": "information", "b": [0.3004, 0.6196, 0.4195, 0.6393]}, {"w": "to", "b": [0.4258, 0.6196, 0.4454, 0.6393]}, {"w": "predict", "b": [0.4517, 0.6196, 0.5217, 0.6393]}, {"w": "Y.", "b": [0.528, 0.6196, 0.5493, 0.6393]}, {"w": "For", "b": [0.5556, 0.6196, 0.5906, 0.6393]}, {"w": "instance,", "b": [0.5969, 0.6196, 0.6859, 0.6393]}, {"w": "if", "b": [0.6922, 0.6196, 0.7076, 0.6393]}, {"w": "you’re", "b": [0.7139, 0.6196, 0.7798, 0.6393]}, {"w": "trying", "b": [0.7861, 0.6196, 0.8463, 0.6393]}, {"w": "to", "b": [0.1294, 0.6401, 0.149, 0.6598]}, {"w": "predict", "b": [0.1553, 0.6401, 0.2254, 0.6598]}, {"w": "the", "b": [0.2317, 0.6401, 0.2625, 0.6598]}, {"w": "movements", "b": [0.2688, 0.6401, 0.3852, 0.6598]}, {"w": "of", "b": [0.3915, 0.6401, 0.4125, 0.6598]}, {"w": "a", "b": [0.4188, 0.6401, 0.43, 0.6598]}, {"w": "stock", "b": [0.4363, 0.6401, 0.4895, 0.6598]}, {"w": "on", "b": [0.4958, 0.6401, 0.5211, 0.6598]}, {"w": "the", "b": [0.5274, 0.6401, 0.5582, 0.6598]}, {"w": "stock", "b": [0.5645, 0.6401, 0.6178, 0.6598]}, {"w": "market", "b": [0.6241, 0.6401, 0.6941, 0.6598]}, {"w": "given", "b": [0.7004, 0.6401, 0.7565, 0.6598]}, {"w": "its", "b": [0.7628, 0.6401, 0.7866, 0.6598]}, {"w": "recent", "b": [0.7929, 0.6401, 0.8546, 0.6598]}, {"w": "price", "b": [0.1294, 0.6606, 0.1798, 0.6803]}, {"w": "history,", "b": [0.1861, 0.6606, 0.2609, 0.6803]}, {"w": "you’re", "b": [0.2672, 0.6606, 0.333, 0.6803]}, {"w": "unlikely", "b": [0.3393, 0.6606, 0.422, 0.6803]}, {"w": "to", "b": [0.4283, 0.6606, 0.4479, 0.6803]}, {"w": "succeed,", "b": [0.4542, 0.6606, 0.5404, 0.6803]}, {"w": "because", "b": [0.5467, 0.6606, 0.6265, 0.6803]}, {"w": "price", "b": [0.6328, 0.6606, 0.6833, 0.6803]}, {"w": "history", "b": [0.6896, 0.6606, 0.7597, 0.6803]}, {"w": "doesn’t", "b": [0.766, 0.6606, 0.8397, 0.6803]}, {"w": "contain", "b": [0.1294, 0.6811, 0.2037, 0.7008]}, {"w": "much", "b": [0.21, 0.6811, 0.266, 0.7008]}, {"w": "predictive", "b": [0.2723, 0.6811, 0.3732, 0.7008]}, {"w": "information.", "b": [0.3795, 0.6811, 0.5049, 0.7008]}]}, {"id": "b_4", "type": "paragraph", "text": "One class of unsolvable problems you should be aware of is nonstationary problems. Suppose you’re trying to build a recommendation engine for clothing, you’re training it on one month of data (August), and you want to start generating recommendations in the winter. One big issue is that the kinds of clothes people buy change from season to season: clothes buying is a nonstationary phenomenon over the scale of a few months. What you’re trying to model changes over time. In this case, the right move is to constantly retrain your model on data from the recent past, or gather data at a timescale where the problem is", "words": [{"w": "One", "b": [0.1294, 0.7239, 0.1714, 0.7436]}, {"w": "class", "b": [0.1777, 0.7239, 0.2268, 0.7436]}, {"w": "of", "b": [0.2331, 0.7239, 0.2541, 0.7436]}, {"w": "unsolvable", "b": [0.2604, 0.7239, 0.3697, 0.7436]}, {"w": "problems", "b": [0.376, 0.7239, 0.4699, 0.7436]}, {"w": "you", "b": [0.4762, 0.7239, 0.5141, 0.7436]}, {"w": "should", "b": [0.5204, 0.7239, 0.5876, 0.7436]}, {"w": "be", "b": [0.5939, 0.7239, 0.6178, 0.7436]}, {"w": "aware", "b": [0.6241, 0.7239, 0.6843, 0.7436]}, {"w": "of", "b": [0.6906, 0.7239, 0.7116, 0.7436]}, {"w": "is", "b": [0.7179, 0.7239, 0.7347, 0.7436]}, {"w": "nonstationary", "b": [0.1294, 0.7444, 0.2696, 0.7641]}, {"w": "problems.", "b": [0.2759, 0.7444, 0.3751, 0.7641]}, {"w": "Suppose", "b": [0.3814, 0.7444, 0.4669, 0.7641]}, {"w": "you’re", "b": [0.4732, 0.7444, 0.5391, 0.7641]}, {"w": "trying", "b": [0.5454, 0.7444, 0.6056, 0.7641]}, {"w": "to", "b": [0.6119, 0.7444, 0.6316, 0.7641]}, {"w": "build", "b": [0.6379, 0.7444, 0.6897, 0.7641]}, {"w": "a", "b": [0.696, 0.7444, 0.7072, 0.7641]}, {"w": "recommendation", "b": [0.1294, 0.7649, 0.299, 0.7846]}, {"w": "engine", "b": [0.3053, 0.7649, 0.3725, 0.7846]}, {"w": "for", "b": [0.3788, 0.7649, 0.4082, 0.7846]}, {"w": "clothing,", "b": [0.4145, 0.7649, 0.5035, 0.7846]}, {"w": "you’re", "b": [0.5098, 0.7649, 0.5757, 0.7846]}, {"w": "training", "b": [0.582, 0.7649, 0.6605, 0.7846]}, {"w": "it", "b": [0.6668, 0.7649, 0.6808, 0.7846]}, {"w": "on", "b": [0.6871, 0.7649, 0.7123, 0.7846]}, {"w": "one", "b": [0.7186, 0.7649, 0.7551, 0.7846]}, {"w": "month", "b": [0.7614, 0.7649, 0.8258, 0.7846]}, {"w": "of", "b": [0.8322, 0.7649, 0.8532, 0.7846]}, {"w": "data", "b": [0.1294, 0.7854, 0.1714, 0.8051]}, {"w": "(August),", "b": [0.1777, 0.7854, 0.2737, 0.8051]}, {"w": "and", "b": [0.28, 0.7854, 0.3165, 0.8051]}, {"w": "you", "b": [0.3227, 0.7854, 0.3606, 0.8051]}, {"w": "want", "b": [0.3669, 0.7854, 0.4159, 0.8051]}, {"w": "to", "b": [0.4222, 0.7854, 0.4419, 0.8051]}, {"w": "start", "b": [0.4482, 0.7854, 0.4916, 0.8051]}, {"w": "generating", "b": [0.4979, 0.7854, 0.6044, 0.8051]}, {"w": "recommendations", "b": [0.6107, 0.7854, 0.7901, 0.8051]}, {"w": "in", "b": [0.7964, 0.7854, 0.816, 0.8051]}, {"w": "the", "b": [0.8223, 0.7854, 0.8531, 0.8051]}, {"w": "winter.", "b": [0.1294, 0.8059, 0.1988, 0.8256]}, {"w": "One", "b": [0.2051, 0.8059, 0.2471, 0.8256]}, {"w": "big", "b": [0.2534, 0.8059, 0.2856, 0.8256]}, {"w": "issue", "b": [0.292, 0.8059, 0.3424, 0.8256]}, {"w": "is", "b": [0.3487, 0.8059, 0.3655, 0.8256]}, {"w": "that", "b": [0.3718, 0.8059, 0.4097, 0.8256]}, {"w": "the", "b": [0.416, 0.8059, 0.4468, 0.8256]}, {"w": "kinds", "b": [0.4531, 0.8059, 0.5078, 0.8256]}, {"w": "of", "b": [0.5141, 0.8059, 0.5351, 0.8256]}, {"w": "clothes", "b": [0.5414, 0.8059, 0.6129, 0.8256]}, {"w": "people", "b": [0.6192, 0.8059, 0.6864, 0.8256]}, {"w": "buy", "b": [0.6927, 0.8059, 0.7306, 0.8256]}, {"w": "change", "b": [0.7369, 0.8059, 0.8083, 0.8256]}, {"w": "from", "b": [0.8146, 0.8059, 0.8637, 0.8256]}, {"w": "season", "b": [0.1294, 0.8264, 0.1967, 0.8461]}, {"w": "to", "b": [0.203, 0.8264, 0.2226, 0.8461]}, {"w": "season:", "b": [0.2289, 0.8264, 0.3032, 0.8461]}, {"w": "clothes", "b": [0.3095, 0.8264, 0.3809, 0.8461]}, {"w": "buying", "b": [0.3872, 0.8264, 0.4573, 0.8461]}, {"w": "is", "b": [0.4636, 0.8264, 0.4805, 0.8461]}, {"w": "a", "b": [0.4868, 0.8264, 0.498, 0.8461]}, {"w": "nonstationary", "b": [0.5043, 0.8264, 0.6416, 0.8461]}, {"w": "phenomenon", "b": [0.6479, 0.8264, 0.7782, 0.8461]}, {"w": "over", "b": [0.7845, 0.8264, 0.8294, 0.8461]}, {"w": "the", "b": [0.8357, 0.8264, 0.8665, 0.8461]}, {"w": "scale", "b": [0.1294, 0.8469, 0.1798, 0.8666]}, {"w": "of", "b": [0.1861, 0.8469, 0.2072, 0.8666]}, {"w": "a", "b": [0.2135, 0.8469, 0.2247, 0.8666]}, {"w": "few", "b": [0.231, 0.8469, 0.2688, 0.8666]}, {"w": "months.", "b": [0.2751, 0.8469, 0.3557, 0.8666]}, {"w": "What", "b": [0.362, 0.8469, 0.4166, 0.8666]}, {"w": "you’re", "b": [0.4229, 0.8469, 0.4888, 0.8666]}, {"w": "trying", "b": [0.4951, 0.8469, 0.5553, 0.8666]}, {"w": "to", "b": [0.5617, 0.8469, 0.5813, 0.8666]}, {"w": "model", "b": [0.5876, 0.8469, 0.6507, 0.8666]}, {"w": "changes", "b": [0.6569, 0.8469, 0.7381, 0.8666]}, {"w": "over", "b": [0.7444, 0.8469, 0.7893, 0.8666]}, {"w": "time.", "b": [0.7956, 0.8469, 0.8467, 0.8666]}, {"w": "In", "b": [0.1294, 0.8674, 0.1504, 0.8871]}, {"w": "this", "b": [0.1567, 0.8674, 0.1932, 0.8871]}, {"w": "case,", "b": [0.1995, 0.8674, 0.2492, 0.8871]}, {"w": "the", "b": [0.2555, 0.8674, 0.2863, 0.8871]}, {"w": "right", "b": [0.2926, 0.8674, 0.3403, 0.8871]}, {"w": "move", "b": [0.3466, 0.8674, 0.4027, 0.8871]}, {"w": "is", "b": [0.409, 0.8674, 0.4258, 0.8871]}, {"w": "to", "b": [0.4321, 0.8674, 0.4517, 0.8871]}, {"w": "constantly", "b": [0.458, 0.8674, 0.5617, 0.8871]}, {"w": "retrain", "b": [0.568, 0.8674, 0.6339, 0.8871]}, {"w": "your", "b": [0.6402, 0.8674, 0.6864, 0.8871]}, {"w": "model", "b": [0.6927, 0.8674, 0.7558, 0.8871]}, {"w": "on", "b": [0.7621, 0.8674, 0.7873, 0.8871]}, {"w": "data", "b": [0.7936, 0.8674, 0.8357, 0.8871]}, {"w": "from", "b": [0.1294, 0.8879, 0.1785, 0.9076]}, {"w": "the", "b": [0.1848, 0.8879, 0.2156, 0.9076]}, {"w": "recent", "b": [0.2219, 0.8879, 0.2835, 0.9076]}, {"w": "past,", "b": [0.2898, 0.8879, 0.3368, 0.9076]}, {"w": "or", "b": [0.3431, 0.8879, 0.3641, 0.9076]}, {"w": "gather", "b": [0.3704, 0.8879, 0.4334, 0.9076]}, {"w": "data", "b": [0.4397, 0.8879, 0.4817, 0.9076]}, {"w": "at", "b": [0.488, 0.8879, 0.5062, 0.9076]}, {"w": "a", "b": [0.5125, 0.8879, 0.5237, 0.9076]}, {"w": "timescale", "b": [0.53, 0.8879, 0.6253, 0.9076]}, {"w": "where", "b": [0.6316, 0.8879, 0.6933, 0.9076]}, {"w": "the", "b": [0.6996, 0.8879, 0.7304, 0.9076]}, {"w": "problem", "b": [0.7367, 0.8879, 0.8208, 0.9076]}, {"w": "is", "b": [0.8271, 0.8879, 0.8439, 0.9076]}]}]}, {"page": 164, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "stationary. For a cyclical problem like clothes buying, a few years’ worth of data will suffice to capture seasonal variation—but remember to make the time of the year an input of your model!", "words": [{"w": "stationary.", "b": [0.1294, 0.0857, 0.2336, 0.1054]}, {"w": "For", "b": [0.2399, 0.0857, 0.2749, 0.1054]}, {"w": "a", "b": [0.2812, 0.0857, 0.2924, 0.1054]}, {"w": "cyclical", "b": [0.2987, 0.0857, 0.3772, 0.1054]}, {"w": "problem", "b": [0.3835, 0.0857, 0.4675, 0.1054]}, {"w": "like", "b": [0.4739, 0.0857, 0.5117, 0.1054]}, {"w": "clothes", "b": [0.518, 0.0857, 0.5895, 0.1054]}, {"w": "buying,", "b": [0.5958, 0.0857, 0.6722, 0.1054]}, {"w": "a", "b": [0.6785, 0.0857, 0.6897, 0.1054]}, {"w": "few", "b": [0.696, 0.0857, 0.7338, 0.1054]}, {"w": "years’", "b": [0.7401, 0.0857, 0.8017, 0.1054]}, {"w": "worth", "b": [0.808, 0.0857, 0.8669, 0.1054]}, {"w": "of", "b": [0.1294, 0.1062, 0.1504, 0.1259]}, {"w": "data", "b": [0.1567, 0.1062, 0.1988, 0.1259]}, {"w": "will", "b": [0.205, 0.1062, 0.2443, 0.1259]}, {"w": "suffice", "b": [0.2506, 0.1062, 0.3188, 0.1259]}, {"w": "to", "b": [0.3251, 0.1062, 0.3447, 0.1259]}, {"w": "capture", "b": [0.351, 0.1062, 0.4253, 0.1259]}, {"w": "seasonal", "b": [0.4316, 0.1062, 0.517, 0.1259]}, {"w": "variation—but", "b": [0.5233, 0.1062, 0.6705, 0.1259]}, {"w": "remember", "b": [0.6768, 0.1062, 0.7791, 0.1259]}, {"w": "to", "b": [0.7854, 0.1062, 0.805, 0.1259]}, {"w": "make", "b": [0.8113, 0.1062, 0.8659, 0.1259]}, {"w": "the", "b": [0.1294, 0.1267, 0.1602, 0.1464]}, {"w": "time", "b": [0.1665, 0.1267, 0.2114, 0.1464]}, {"w": "of", "b": [0.2177, 0.1267, 0.2387, 0.1464]}, {"w": "the", "b": [0.245, 0.1267, 0.2758, 0.1464]}, {"w": "year", "b": [0.2822, 0.1267, 0.3256, 0.1464]}, {"w": "an", "b": [0.3319, 0.1267, 0.3557, 0.1464]}, {"w": "input", "b": [0.362, 0.1267, 0.4139, 0.1464]}, {"w": "of", "b": [0.4202, 0.1267, 0.4412, 0.1464]}, {"w": "your", "b": [0.4475, 0.1267, 0.4937, 0.1464]}, {"w": "model!", "b": [0.5, 0.1267, 0.5715, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "Keep in mind that machine learning can only be used to memorize patterns that are present in your training data. You can only recognize what you’ve seen before. Using machine learning trained on past data to predict the future is making the assumption that the future will behave like the past. That often isn’t the case.", "words": [{"w": "Keep", "b": [0.1294, 0.1695, 0.1826, 0.1892]}, {"w": "in", "b": [0.1889, 0.1695, 0.2086, 0.1892]}, {"w": "mind", "b": [0.2149, 0.1695, 0.2667, 0.1892]}, {"w": "that", "b": [0.273, 0.1695, 0.3109, 0.1892]}, {"w": "machine", "b": [0.3172, 0.1695, 0.4027, 0.1892]}, {"w": "learning", "b": [0.409, 0.1695, 0.4916, 0.1892]}, {"w": "can", "b": [0.4979, 0.1695, 0.5329, 0.1892]}, {"w": "only", "b": [0.5393, 0.1695, 0.5841, 0.1892]}, {"w": "be", "b": [0.5904, 0.1695, 0.6142, 0.1892]}, {"w": "used", "b": [0.6205, 0.1695, 0.6668, 0.1892]}, {"w": "to", "b": [0.6731, 0.1695, 0.6927, 0.1892]}, {"w": "memorize", "b": [0.699, 0.1695, 0.7999, 0.1892]}, {"w": "patterns", "b": [0.1294, 0.19, 0.2093, 0.2097]}, {"w": "that", "b": [0.2156, 0.19, 0.2534, 0.2097]}, {"w": "are", "b": [0.2597, 0.19, 0.2905, 0.2097]}, {"w": "present", "b": [0.2968, 0.19, 0.3697, 0.2097]}, {"w": "in", "b": [0.376, 0.19, 0.3956, 0.2097]}, {"w": "your", "b": [0.4019, 0.19, 0.4482, 0.2097]}, {"w": "training", "b": [0.4545, 0.19, 0.5329, 0.2097]}, {"w": "data.", "b": [0.5393, 0.19, 0.5876, 0.2097]}, {"w": "You", "b": [0.5939, 0.19, 0.6347, 0.2097]}, {"w": "can", "b": [0.641, 0.19, 0.6761, 0.2097]}, {"w": "only", "b": [0.6824, 0.19, 0.7272, 0.2097]}, {"w": "recognize", "b": [0.7335, 0.19, 0.8316, 0.2097]}, {"w": "what", "b": [0.1294, 0.2105, 0.1785, 0.2302]}, {"w": "you’ve", "b": [0.1848, 0.2105, 0.2548, 0.2302]}, {"w": "seen", "b": [0.2611, 0.2105, 0.3059, 0.2302]}, {"w": "before.", "b": [0.3122, 0.2105, 0.383, 0.2302]}, {"w": "Using", "b": [0.3893, 0.2105, 0.4496, 0.2302]}, {"w": "machine", "b": [0.4559, 0.2105, 0.5413, 0.2302]}, {"w": "learning", "b": [0.5476, 0.2105, 0.6303, 0.2302]}, {"w": "trained", "b": [0.6366, 0.2105, 0.7067, 0.2302]}, {"w": "on", "b": [0.713, 0.2105, 0.7382, 0.2302]}, {"w": "past", "b": [0.7445, 0.2105, 0.7851, 0.2302]}, {"w": "data", "b": [0.7914, 0.2105, 0.8335, 0.2302]}, {"w": "to", "b": [0.8398, 0.2105, 0.8594, 0.2302]}, {"w": "predict", "b": [0.1294, 0.231, 0.1995, 0.2507]}, {"w": "the", "b": [0.2058, 0.231, 0.2366, 0.2507]}, {"w": "future", "b": [0.2429, 0.231, 0.3031, 0.2507]}, {"w": "is", "b": [0.3094, 0.231, 0.3263, 0.2507]}, {"w": "making", "b": [0.3326, 0.231, 0.4083, 0.2507]}, {"w": "the", "b": [0.4146, 0.231, 0.4454, 0.2507]}, {"w": "assumption", "b": [0.4517, 0.231, 0.5666, 0.2507]}, {"w": "that", "b": [0.5729, 0.231, 0.6107, 0.2507]}, {"w": "the", "b": [0.617, 0.231, 0.6478, 0.2507]}, {"w": "future", "b": [0.6541, 0.231, 0.7144, 0.2507]}, {"w": "will", "b": [0.7207, 0.231, 0.7599, 0.2507]}, {"w": "behave", "b": [0.7662, 0.231, 0.8377, 0.2507]}, {"w": "like", "b": [0.1294, 0.2515, 0.1673, 0.2712]}, {"w": "the", "b": [0.1736, 0.2515, 0.2044, 0.2712]}, {"w": "past.", "b": [0.2107, 0.2515, 0.2576, 0.2712]}, {"w": "That", "b": [0.2639, 0.2515, 0.3102, 0.2712]}, {"w": "often", "b": [0.3165, 0.2515, 0.3683, 0.2712]}, {"w": "isn’t", "b": [0.3746, 0.2515, 0.419, 0.2712]}, {"w": "the", "b": [0.4253, 0.2515, 0.4561, 0.2712]}, {"w": "case.", "b": [0.4624, 0.2515, 0.5121, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "4.5.2. Choosing a measure of success", "words": [{"w": "4.5.2.", "b": [0.1294, 0.2987, 0.1862, 0.3184]}, {"w": "Choosing", "b": [0.1925, 0.2987, 0.2934, 0.3184]}, {"w": "a", "b": [0.2997, 0.2987, 0.3123, 0.3184]}, {"w": "measure", "b": [0.3186, 0.2987, 0.4093, 0.3184]}, {"w": "of", "b": [0.4156, 0.2987, 0.4366, 0.3184]}, {"w": "success", "b": [0.4429, 0.2987, 0.5199, 0.3184]}]}, {"id": "b_3", "type": "paragraph", "text": "To control something, you need to be able to observe it. To achieve success, you must define what you mean by success—accuracy? Precision and recall? Customer-retention rate? Your metric for success will guide the choice of a loss function: what your model will optimize. It should directly align with your higher-level goals, such as the success of your business.", "words": [{"w": "To", "b": [0.1294, 0.3415, 0.1557, 0.3612]}, {"w": "control", "b": [0.162, 0.3415, 0.2334, 0.3612]}, {"w": "something,", "b": [0.2397, 0.3415, 0.3512, 0.3612]}, {"w": "you", "b": [0.3575, 0.3415, 0.3953, 0.3612]}, {"w": "need", "b": [0.4016, 0.3415, 0.4492, 0.3612]}, {"w": "to", "b": [0.4556, 0.3415, 0.4752, 0.3612]}, {"w": "be", "b": [0.4815, 0.3415, 0.5053, 0.3612]}, {"w": "able", "b": [0.5116, 0.3415, 0.5536, 0.3612]}, {"w": "to", "b": [0.5599, 0.3415, 0.5796, 0.3612]}, {"w": "observe", "b": [0.5859, 0.3415, 0.6643, 0.3612]}, {"w": "it.", "b": [0.6706, 0.3415, 0.691, 0.3612]}, {"w": "To", "b": [0.6973, 0.3415, 0.7235, 0.3612]}, {"w": "achieve", "b": [0.7298, 0.3415, 0.8068, 0.3612]}, {"w": "success,", "b": [0.1294, 0.362, 0.2114, 0.3817]}, {"w": "you", "b": [0.2177, 0.362, 0.2555, 0.3817]}, {"w": "must", "b": [0.2618, 0.362, 0.3109, 0.3817]}, {"w": "define", "b": [0.3172, 0.362, 0.3802, 0.3817]}, {"w": "what", "b": [0.3865, 0.362, 0.4356, 0.3817]}, {"w": "you", "b": [0.4419, 0.362, 0.4797, 0.3817]}, {"w": "mean", "b": [0.486, 0.362, 0.5407, 0.3817]}, {"w": "by", "b": [0.547, 0.362, 0.5722, 0.3817]}, {"w": "success—accuracy?", "b": [0.5785, 0.362, 0.7802, 0.3817]}, {"w": "Precision", "b": [0.1294, 0.3825, 0.2233, 0.4022]}, {"w": "and", "b": [0.2296, 0.3825, 0.266, 0.4022]}, {"w": "recall?", "b": [0.2723, 0.3825, 0.3396, 0.4022]}, {"w": "Customer-retention", "b": [0.3459, 0.3825, 0.5415, 0.4022]}, {"w": "rate?", "b": [0.5478, 0.3825, 0.5968, 0.4022]}, {"w": "Your", "b": [0.6031, 0.3825, 0.6524, 0.4022]}, {"w": "metric", "b": [0.6587, 0.3825, 0.7232, 0.4022]}, {"w": "for", "b": [0.7295, 0.3825, 0.7589, 0.4022]}, {"w": "success", "b": [0.7652, 0.3825, 0.8409, 0.4022]}, {"w": "will", "b": [0.1294, 0.403, 0.1687, 0.4227]}, {"w": "guide", "b": [0.175, 0.403, 0.231, 0.4227]}, {"w": "the", "b": [0.2373, 0.403, 0.2682, 0.4227]}, {"w": "choice", "b": [0.2745, 0.403, 0.3403, 0.4227]}, {"w": "of", "b": [0.3466, 0.403, 0.3676, 0.4227]}, {"w": "a", "b": [0.3739, 0.403, 0.3851, 0.4227]}, {"w": "loss", "b": [0.3914, 0.403, 0.4307, 0.4227]}, {"w": "function:", "b": [0.437, 0.403, 0.5281, 0.4227]}, {"w": "what", "b": [0.5344, 0.403, 0.5834, 0.4227]}, {"w": "your", "b": [0.5897, 0.403, 0.636, 0.4227]}, {"w": "model", "b": [0.6422, 0.403, 0.7053, 0.4227]}, {"w": "will", "b": [0.7116, 0.403, 0.7508, 0.4227]}, {"w": "optimize.", "b": [0.7571, 0.403, 0.8517, 0.4227]}, {"w": "It", "b": [0.1294, 0.4235, 0.1448, 0.4432]}, {"w": "should", "b": [0.1511, 0.4235, 0.2184, 0.4432]}, {"w": "directly", "b": [0.2247, 0.4235, 0.3018, 0.4432]}, {"w": "align", "b": [0.3081, 0.4235, 0.3585, 0.4432]}, {"w": "with", "b": [0.3648, 0.4235, 0.4097, 0.4432]}, {"w": "your", "b": [0.416, 0.4235, 0.4622, 0.4432]}, {"w": "higher-level", "b": [0.4685, 0.4235, 0.5899, 0.4432]}, {"w": "goals,", "b": [0.5962, 0.4235, 0.6557, 0.4432]}, {"w": "such", "b": [0.6621, 0.4235, 0.7083, 0.4432]}, {"w": "as", "b": [0.7146, 0.4235, 0.7356, 0.4432]}, {"w": "the", "b": [0.7419, 0.4235, 0.7727, 0.4432]}, {"w": "success", "b": [0.7791, 0.4235, 0.8547, 0.4432]}, {"w": "of", "b": [0.1294, 0.444, 0.1504, 0.4637]}, {"w": "your", "b": [0.1567, 0.444, 0.203, 0.4637]}, {"w": "business.", "b": [0.2093, 0.444, 0.3011, 0.4637]}]}, {"id": "b_4", "type": "paragraph", "text": "For balanced-classification problems, where every class is equally likely, accuracy and area under the receiver operating characteristic curve (ROC AUC) are common metrics. For class-imbalanced problems, you can use precision and recall. For ranking problems or multilabel classification, you can use mean average precision. And it isn’t uncommon to have to define your own custom metric by which to measure success. To get a sense of the diversity of machine-learning success metrics and how they relate to different problem domains, it’s helpful to browse the data science competitions on Kaggle (https://kaggle.com); they showcase a wide range of problems and evaluation metrics.", "words": [{"w": "For", "b": [0.1294, 0.4868, 0.1645, 0.5065]}, {"w": "balanced-classification", "b": [0.1708, 0.4868, 0.4019, 0.5065]}, {"w": "problems,", "b": [0.4082, 0.4868, 0.5084, 0.5065]}, {"w": "where", "b": [0.5147, 0.4868, 0.5764, 0.5065]}, {"w": "every", "b": [0.5827, 0.4868, 0.6387, 0.5065]}, {"w": "class", "b": [0.645, 0.4868, 0.694, 0.5065]}, {"w": "is", "b": [0.7003, 0.4868, 0.7172, 0.5065]}, {"w": "equally", "b": [0.7235, 0.4868, 0.7977, 0.5065]}, {"w": "likely,", "b": [0.804, 0.4868, 0.8661, 0.5065]}, {"w": "accuracy", "b": [0.1294, 0.5073, 0.219, 0.527]}, {"w": "and", "b": [0.2253, 0.5073, 0.2618, 0.527]}, {"w": "area", "b": [0.2681, 0.5073, 0.3134, 0.527]}, {"w": "under", "b": [0.3197, 0.5073, 0.3785, 0.527]}, {"w": "the", "b": [0.3848, 0.5073, 0.4157, 0.527]}, {"w": "receiver", "b": [0.422, 0.5073, 0.5037, 0.527]}, {"w": "operating", "b": [0.51, 0.5073, 0.6081, 0.527]}, {"w": "characteristic", "b": [0.6144, 0.5073, 0.7545, 0.527]}, {"w": "curve", "b": [0.7608, 0.5073, 0.8168, 0.527]}, {"w": "(ROC", "b": [0.1294, 0.5278, 0.1897, 0.5475]}, {"w": "AUC)", "b": [0.196, 0.5278, 0.2576, 0.5475]}, {"w": "are", "b": [0.2639, 0.5278, 0.2947, 0.5475]}, {"w": "common", "b": [0.301, 0.5278, 0.3893, 0.5475]}, {"w": "metrics.", "b": [0.3956, 0.5278, 0.4762, 0.5475]}, {"w": "For", "b": [0.4825, 0.5278, 0.5176, 0.5475]}, {"w": "class-imbalanced", "b": [0.5239, 0.5278, 0.6976, 0.5475]}, {"w": "problems,", "b": [0.7039, 0.5278, 0.8041, 0.5475]}, {"w": "you", "b": [0.8104, 0.5278, 0.8482, 0.5475]}, {"w": "can", "b": [0.1294, 0.5483, 0.1644, 0.568]}, {"w": "use", "b": [0.1707, 0.5483, 0.2044, 0.568]}, {"w": "precision", "b": [0.2107, 0.5483, 0.3031, 0.568]}, {"w": "and", "b": [0.3094, 0.5483, 0.3459, 0.568]}, {"w": "recall.", "b": [0.3522, 0.5483, 0.4145, 0.568]}, {"w": "For", "b": [0.4208, 0.5483, 0.4559, 0.568]}, {"w": "ranking", "b": [0.4622, 0.5483, 0.5392, 0.568]}, {"w": "problems", "b": [0.5455, 0.5483, 0.6394, 0.568]}, {"w": "or", "b": [0.6457, 0.5483, 0.6667, 0.568]}, {"w": "multilabel", "b": [0.6731, 0.5483, 0.7754, 0.568]}, {"w": "classification,", "b": [0.1294, 0.5688, 0.2688, 0.5885]}, {"w": "you", "b": [0.2751, 0.5688, 0.313, 0.5885]}, {"w": "can", "b": [0.3193, 0.5688, 0.3543, 0.5885]}, {"w": "use", "b": [0.3606, 0.5688, 0.3942, 0.5885]}, {"w": "mean", "b": [0.4005, 0.5688, 0.4552, 0.5885]}, {"w": "average", "b": [0.4615, 0.5688, 0.5399, 0.5885]}, {"w": "precision.", "b": [0.5462, 0.5688, 0.645, 0.5885]}, {"w": "And", "b": [0.6513, 0.5688, 0.6947, 0.5885]}, {"w": "it", "b": [0.7011, 0.5688, 0.7151, 0.5885]}, {"w": "isn’t", "b": [0.7214, 0.5688, 0.7657, 0.5885]}, {"w": "uncommon", "b": [0.1294, 0.5893, 0.2429, 0.609]}, {"w": "to", "b": [0.2492, 0.5893, 0.2689, 0.609]}, {"w": "have", "b": [0.2752, 0.5893, 0.3228, 0.609]}, {"w": "to", "b": [0.3291, 0.5893, 0.3487, 0.609]}, {"w": "define", "b": [0.355, 0.5893, 0.4181, 0.609]}, {"w": "your", "b": [0.4244, 0.5893, 0.4706, 0.609]}, {"w": "own", "b": [0.4769, 0.5893, 0.5204, 0.609]}, {"w": "custom", "b": [0.5267, 0.5893, 0.5995, 0.609]}, {"w": "metric", "b": [0.6059, 0.5893, 0.6703, 0.609]}, {"w": "by", "b": [0.6766, 0.5893, 0.7018, 0.609]}, {"w": "which", "b": [0.7081, 0.5893, 0.7698, 0.609]}, {"w": "to", "b": [0.776, 0.5893, 0.7956, 0.609]}, {"w": "measure", "b": [0.1294, 0.6098, 0.2135, 0.6295]}, {"w": "success.", "b": [0.2198, 0.6098, 0.3017, 0.6295]}, {"w": "To", "b": [0.308, 0.6098, 0.3343, 0.6295]}, {"w": "get", "b": [0.3406, 0.6098, 0.3714, 0.6295]}, {"w": "a", "b": [0.3777, 0.6098, 0.3889, 0.6295]}, {"w": "sense", "b": [0.3952, 0.6098, 0.4499, 0.6295]}, {"w": "of", "b": [0.4562, 0.6098, 0.4772, 0.6295]}, {"w": "the", "b": [0.4835, 0.6098, 0.5143, 0.6295]}, {"w": "diversity", "b": [0.5206, 0.6098, 0.6089, 0.6295]}, {"w": "of", "b": [0.6152, 0.6098, 0.6362, 0.6295]}, {"w": "machine-learning", "b": [0.6425, 0.6098, 0.8191, 0.6295]}, {"w": "success", "b": [0.1294, 0.6303, 0.2051, 0.65]}, {"w": "metrics", "b": [0.2114, 0.6303, 0.2856, 0.65]}, {"w": "and", "b": [0.2919, 0.6303, 0.3284, 0.65]}, {"w": "how", "b": [0.3347, 0.6303, 0.3781, 0.65]}, {"w": "they", "b": [0.3844, 0.6303, 0.4279, 0.65]}, {"w": "relate", "b": [0.4342, 0.6303, 0.4902, 0.65]}, {"w": "to", "b": [0.4965, 0.6303, 0.5161, 0.65]}, {"w": "different", "b": [0.5224, 0.6303, 0.6088, 0.65]}, {"w": "problem", "b": [0.6151, 0.6303, 0.6992, 0.65]}, {"w": "domains,", "b": [0.7054, 0.6303, 0.7972, 0.65]}, {"w": "it’s", "b": [0.8035, 0.6303, 0.8344, 0.65]}, {"w": "helpful", "b": [0.1294, 0.6508, 0.2009, 0.6705]}, {"w": "to", "b": [0.2072, 0.6508, 0.2268, 0.6705]}, {"w": "browse", "b": [0.2331, 0.6508, 0.306, 0.6705]}, {"w": "the", "b": [0.3123, 0.6508, 0.3431, 0.6705]}, {"w": "data", "b": [0.3494, 0.6508, 0.3914, 0.6705]}, {"w": "science", "b": [0.3977, 0.6508, 0.472, 0.6705]}, {"w": "competitions", "b": [0.4783, 0.6508, 0.6086, 0.6705]}, {"w": "on", "b": [0.6149, 0.6508, 0.6402, 0.6705]}, {"w": "Kaggle", "b": [0.6465, 0.6508, 0.7193, 0.6705]}, {"w": "(https://kaggle.com);", "b": [0.1294, 0.6713, 0.3403, 0.691]}, {"w": "they", "b": [0.3466, 0.6713, 0.39, 0.691]}, {"w": "showcase", "b": [0.3963, 0.6713, 0.493, 0.691]}, {"w": "a", "b": [0.4993, 0.6713, 0.5105, 0.691]}, {"w": "wide", "b": [0.5168, 0.6713, 0.5658, 0.691]}, {"w": "range", "b": [0.5721, 0.6713, 0.6282, 0.691]}, {"w": "of", "b": [0.6345, 0.6713, 0.6555, 0.691]}, {"w": "problems", "b": [0.6618, 0.6713, 0.7557, 0.691]}, {"w": "and", "b": [0.762, 0.6713, 0.7984, 0.691]}, {"w": "evaluation", "b": [0.1294, 0.6918, 0.2345, 0.7115]}, {"w": "metrics.", "b": [0.2408, 0.6918, 0.3214, 0.7115]}]}, {"id": "b_5", "type": "paragraph", "text": "4.5.3. Deciding on an evaluation protocol", "words": [{"w": "4.5.3.", "b": [0.1294, 0.739, 0.1862, 0.7588]}, {"w": "Deciding", "b": [0.1925, 0.739, 0.2878, 0.7588]}, {"w": "on", "b": [0.2941, 0.739, 0.3207, 0.7588]}, {"w": "an", "b": [0.327, 0.739, 0.3537, 0.7588]}, {"w": "evaluation", "b": [0.36, 0.739, 0.4721, 0.7588]}, {"w": "protocol", "b": [0.4784, 0.739, 0.5676, 0.7588]}]}, {"id": "b_6", "type": "paragraph", "text": "Once you know what you’re aiming for, you must establish how you’ll measure your current progress. We’ve previously reviewed three common evaluation protocols:", "words": [{"w": "Once", "b": [0.1294, 0.7818, 0.1826, 0.8015]}, {"w": "you", "b": [0.1889, 0.7818, 0.2268, 0.8015]}, {"w": "know", "b": [0.2331, 0.7818, 0.2891, 0.8015]}, {"w": "what", "b": [0.2954, 0.7818, 0.3445, 0.8015]}, {"w": "you’re", "b": [0.3508, 0.7818, 0.4166, 0.8015]}, {"w": "aiming", "b": [0.4229, 0.7818, 0.493, 0.8015]}, {"w": "for,", "b": [0.4993, 0.7818, 0.534, 0.8015]}, {"w": "you", "b": [0.5403, 0.7818, 0.5782, 0.8015]}, {"w": "must", "b": [0.5845, 0.7818, 0.6335, 0.8015]}, {"w": "establish", "b": [0.6398, 0.7818, 0.7281, 0.8015]}, {"w": "how", "b": [0.7344, 0.7818, 0.7779, 0.8015]}, {"w": "you’ll", "b": [0.7842, 0.7818, 0.8444, 0.8015]}, {"w": "measure", "b": [0.1294, 0.8023, 0.2135, 0.822]}, {"w": "your", "b": [0.2198, 0.8023, 0.266, 0.822]}, {"w": "current", "b": [0.2723, 0.8023, 0.3438, 0.822]}, {"w": "progress.", "b": [0.3501, 0.8023, 0.4418, 0.822]}, {"w": "We’ve", "b": [0.4481, 0.8023, 0.5133, 0.822]}, {"w": "previously", "b": [0.5196, 0.8023, 0.6261, 0.822]}, {"w": "reviewed", "b": [0.6324, 0.8023, 0.7249, 0.822]}, {"w": "three", "b": [0.7312, 0.8023, 0.7816, 0.822]}, {"w": "common", "b": [0.1294, 0.8228, 0.2177, 0.8425]}, {"w": "evaluation", "b": [0.224, 0.8228, 0.3291, 0.8425]}, {"w": "protocols:", "b": [0.3354, 0.8228, 0.4363, 0.8425]}]}, {"id": "b_7", "type": "paragraph", "text": "Maintaining a hold-out validation set— The way to go when you have plenty of data", "words": [{"w": "Maintaining", "b": [0.1799, 0.8611, 0.3103, 0.8809]}, {"w": "a", "b": [0.3166, 0.8611, 0.3292, 0.8809]}, {"w": "hold-out", "b": [0.3355, 0.8611, 0.4238, 0.8809]}, {"w": "validation", "b": [0.4301, 0.8611, 0.5338, 0.8809]}, {"w": "set—", "b": [0.5401, 0.8611, 0.5934, 0.8809]}, {"w": "The", "b": [0.5997, 0.8611, 0.6389, 0.8809]}, {"w": "way", "b": [0.6452, 0.8611, 0.6872, 0.8809]}, {"w": "to", "b": [0.6935, 0.8611, 0.7131, 0.8809]}, {"w": "go", "b": [0.7195, 0.8611, 0.7447, 0.8809]}, {"w": "when", "b": [0.751, 0.8611, 0.8056, 0.8809]}, {"w": "you", "b": [0.8119, 0.8611, 0.8498, 0.8809]}, {"w": "have", "b": [0.1799, 0.8816, 0.2275, 0.9014]}, {"w": "plenty", "b": [0.2338, 0.8816, 0.2969, 0.9014]}, {"w": "of", "b": [0.3032, 0.8816, 0.3242, 0.9014]}, {"w": "data", "b": [0.3305, 0.8816, 0.3725, 0.9014]}]}]}, {"page": 165, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Doing K-fold cross-validation— The right choice when you have too few samples for hold-out validation to be reliable Doing iterated K-fold validation— For performing highly accurate model evaluation when little data is available", "words": [{"w": "Doing", "b": [0.1799, 0.0857, 0.2443, 0.1054]}, {"w": "K-fold", "b": [0.2506, 0.0857, 0.3165, 0.1054]}, {"w": "cross-validation—", "b": [0.3228, 0.0857, 0.5134, 0.1054]}, {"w": "The", "b": [0.5197, 0.0857, 0.5589, 0.1054]}, {"w": "right", "b": [0.5653, 0.0857, 0.6129, 0.1054]}, {"w": "choice", "b": [0.6192, 0.0857, 0.6851, 0.1054]}, {"w": "when", "b": [0.6914, 0.0857, 0.746, 0.1054]}, {"w": "you", "b": [0.7523, 0.0857, 0.7901, 0.1054]}, {"w": "have", "b": [0.7964, 0.0857, 0.8441, 0.1054]}, {"w": "too", "b": [0.1799, 0.1062, 0.2121, 0.1259]}, {"w": "few", "b": [0.2184, 0.1062, 0.2562, 0.1259]}, {"w": "samples", "b": [0.2625, 0.1062, 0.3438, 0.1259]}, {"w": "for", "b": [0.3501, 0.1062, 0.3795, 0.1259]}, {"w": "hold-out", "b": [0.3858, 0.1062, 0.4713, 0.1259]}, {"w": "validation", "b": [0.4776, 0.1062, 0.5785, 0.1259]}, {"w": "to", "b": [0.5848, 0.1062, 0.6045, 0.1259]}, {"w": "be", "b": [0.6108, 0.1062, 0.6346, 0.1259]}, {"w": "reliable", "b": [0.6409, 0.1062, 0.7165, 0.1259]}, {"w": "Doing", "b": [0.1799, 0.1267, 0.2443, 0.1464]}, {"w": "iterated", "b": [0.2506, 0.1267, 0.3291, 0.1464]}, {"w": "K-fold", "b": [0.3354, 0.1267, 0.4013, 0.1464]}, {"w": "validation—", "b": [0.4076, 0.1267, 0.5366, 0.1464]}, {"w": "For", "b": [0.5428, 0.1267, 0.5779, 0.1464]}, {"w": "performing", "b": [0.5842, 0.1267, 0.6977, 0.1464]}, {"w": "highly", "b": [0.704, 0.1267, 0.7684, 0.1464]}, {"w": "accurate", "b": [0.7747, 0.1267, 0.8588, 0.1464]}, {"w": "model", "b": [0.1799, 0.1472, 0.2429, 0.1669]}, {"w": "evaluation", "b": [0.2492, 0.1472, 0.3543, 0.1669]}, {"w": "when", "b": [0.3606, 0.1472, 0.4153, 0.1669]}, {"w": "little", "b": [0.4216, 0.1472, 0.4678, 0.1669]}, {"w": "data", "b": [0.4741, 0.1472, 0.5162, 0.1669]}, {"w": "is", "b": [0.5225, 0.1472, 0.5393, 0.1669]}, {"w": "available", "b": [0.5456, 0.1472, 0.6367, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Just pick one of these. In most cases, the first will work well enough.", "words": [{"w": "Just", "b": [0.1294, 0.19, 0.1687, 0.2097]}, {"w": "pick", "b": [0.175, 0.19, 0.2184, 0.2097]}, {"w": "one", "b": [0.2247, 0.19, 0.2611, 0.2097]}, {"w": "of", "b": [0.2674, 0.19, 0.2885, 0.2097]}, {"w": "these.", "b": [0.2948, 0.19, 0.3529, 0.2097]}, {"w": "In", "b": [0.3592, 0.19, 0.3802, 0.2097]}, {"w": "most", "b": [0.3865, 0.19, 0.4356, 0.2097]}, {"w": "cases,", "b": [0.4419, 0.19, 0.5014, 0.2097]}, {"w": "the", "b": [0.5077, 0.19, 0.5386, 0.2097]}, {"w": "first", "b": [0.5449, 0.19, 0.5855, 0.2097]}, {"w": "will", "b": [0.5918, 0.19, 0.6311, 0.2097]}, {"w": "work", "b": [0.6374, 0.19, 0.6892, 0.2097]}, {"w": "well", "b": [0.6955, 0.19, 0.739, 0.2097]}, {"w": "enough.", "b": [0.7453, 0.19, 0.8258, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "4.5.4. Preparing your data", "words": [{"w": "4.5.4.", "b": [0.1294, 0.2372, 0.1862, 0.2569]}, {"w": "Preparing", "b": [0.1925, 0.2372, 0.3013, 0.2569]}, {"w": "your", "b": [0.3076, 0.2372, 0.3581, 0.2569]}, {"w": "data", "b": [0.3644, 0.2372, 0.412, 0.2569]}]}, {"id": "b_3", "type": "paragraph", "text": "Once you know what you’re training on, what you’re optimizing for, and how to evaluate your approach, you’re almost ready to begin training models. But first, you should format your data in a way that can be fed into a machine-learning model—here, we’ll assume a deep neural network:", "words": [{"w": "Once", "b": [0.1294, 0.28, 0.1826, 0.2997]}, {"w": "you", "b": [0.1889, 0.28, 0.2268, 0.2997]}, {"w": "know", "b": [0.2331, 0.28, 0.2891, 0.2997]}, {"w": "what", "b": [0.2954, 0.28, 0.3445, 0.2997]}, {"w": "you’re", "b": [0.3508, 0.28, 0.4166, 0.2997]}, {"w": "training", "b": [0.4229, 0.28, 0.5014, 0.2997]}, {"w": "on,", "b": [0.5077, 0.28, 0.5393, 0.2997]}, {"w": "what", "b": [0.5456, 0.28, 0.5946, 0.2997]}, {"w": "you’re", "b": [0.6009, 0.28, 0.6667, 0.2997]}, {"w": "optimizing", "b": [0.6731, 0.28, 0.7824, 0.2997]}, {"w": "for,", "b": [0.7887, 0.28, 0.8233, 0.2997]}, {"w": "and", "b": [0.8296, 0.28, 0.8661, 0.2997]}, {"w": "how", "b": [0.1294, 0.3005, 0.1729, 0.3202]}, {"w": "to", "b": [0.1792, 0.3005, 0.1988, 0.3202]}, {"w": "evaluate", "b": [0.2051, 0.3005, 0.2891, 0.3202]}, {"w": "your", "b": [0.2954, 0.3005, 0.3417, 0.3202]}, {"w": "approach,", "b": [0.348, 0.3005, 0.4468, 0.3202]}, {"w": "you’re", "b": [0.4531, 0.3005, 0.5189, 0.3202]}, {"w": "almost", "b": [0.5252, 0.3005, 0.5925, 0.3202]}, {"w": "ready", "b": [0.5988, 0.3005, 0.6548, 0.3202]}, {"w": "to", "b": [0.661, 0.3005, 0.6807, 0.3202]}, {"w": "begin", "b": [0.687, 0.3005, 0.743, 0.3202]}, {"w": "training", "b": [0.7493, 0.3005, 0.8278, 0.3202]}, {"w": "models.", "b": [0.1294, 0.321, 0.2086, 0.3407]}, {"w": "But", "b": [0.2149, 0.321, 0.2514, 0.3407]}, {"w": "first,", "b": [0.2577, 0.321, 0.3046, 0.3407]}, {"w": "you", "b": [0.3109, 0.321, 0.3488, 0.3407]}, {"w": "should", "b": [0.3551, 0.321, 0.4223, 0.3407]}, {"w": "format", "b": [0.4286, 0.321, 0.4959, 0.3407]}, {"w": "your", "b": [0.5022, 0.321, 0.5484, 0.3407]}, {"w": "data", "b": [0.5547, 0.321, 0.5968, 0.3407]}, {"w": "in", "b": [0.6031, 0.321, 0.6227, 0.3407]}, {"w": "a", "b": [0.629, 0.321, 0.6402, 0.3407]}, {"w": "way", "b": [0.6465, 0.321, 0.6885, 0.3407]}, {"w": "that", "b": [0.6948, 0.321, 0.7327, 0.3407]}, {"w": "can", "b": [0.739, 0.321, 0.774, 0.3407]}, {"w": "be", "b": [0.7803, 0.321, 0.8041, 0.3407]}, {"w": "fed", "b": [0.8104, 0.321, 0.8426, 0.3407]}, {"w": "into", "b": [0.1294, 0.3415, 0.1687, 0.3612]}, {"w": "a", "b": [0.175, 0.3415, 0.1862, 0.3612]}, {"w": "machine-learning", "b": [0.1925, 0.3415, 0.369, 0.3612]}, {"w": "model—here,", "b": [0.3753, 0.3415, 0.5133, 0.3612]}, {"w": "we’ll", "b": [0.5195, 0.3415, 0.5714, 0.3612]}, {"w": "assume", "b": [0.5777, 0.3415, 0.652, 0.3612]}, {"w": "a", "b": [0.6583, 0.3415, 0.6695, 0.3612]}, {"w": "deep", "b": [0.6758, 0.3415, 0.7234, 0.3612]}, {"w": "neural", "b": [0.7297, 0.3415, 0.7927, 0.3612]}, {"w": "network:", "b": [0.1294, 0.362, 0.2191, 0.3817]}]}, {"id": "b_4", "type": "paragraph", "text": "As you saw previously, your data should be formatted as tensors. The values taken by these tensors should usually be scaled to small values: for example, in the [-1, 1] range or [0, 1] range. If different features take values in different ranges (heterogeneous data), then the data should be normalized. You may want to do some feature engineering, especially for small- data problems.", "words": [{"w": "As", "b": [0.1799, 0.4003, 0.2079, 0.4201]}, {"w": "you", "b": [0.2142, 0.4003, 0.252, 0.4201]}, {"w": "saw", "b": [0.2583, 0.4003, 0.2976, 0.4201]}, {"w": "previously,", "b": [0.3039, 0.4003, 0.415, 0.4201]}, {"w": "your", "b": [0.4214, 0.4003, 0.4676, 0.4201]}, {"w": "data", "b": [0.4739, 0.4003, 0.5159, 0.4201]}, {"w": "should", "b": [0.5222, 0.4003, 0.5895, 0.4201]}, {"w": "be", "b": [0.5958, 0.4003, 0.6196, 0.4201]}, {"w": "formatted", "b": [0.6259, 0.4003, 0.724, 0.4201]}, {"w": "as", "b": [0.7303, 0.4003, 0.7513, 0.4201]}, {"w": "tensors.", "b": [0.7576, 0.4003, 0.8354, 0.4201]}, {"w": "The", "b": [0.1799, 0.4208, 0.2191, 0.4406]}, {"w": "values", "b": [0.2254, 0.4208, 0.2898, 0.4406]}, {"w": "taken", "b": [0.2962, 0.4208, 0.3508, 0.4406]}, {"w": "by", "b": [0.3571, 0.4208, 0.3823, 0.4406]}, {"w": "these", "b": [0.3886, 0.4208, 0.4405, 0.4406]}, {"w": "tensors", "b": [0.4468, 0.4208, 0.5182, 0.4406]}, {"w": "should", "b": [0.5245, 0.4208, 0.5918, 0.4406]}, {"w": "usually", "b": [0.5981, 0.4208, 0.671, 0.4406]}, {"w": "be", "b": [0.6773, 0.4208, 0.7011, 0.4406]}, {"w": "scaled", "b": [0.7074, 0.4208, 0.7705, 0.4406]}, {"w": "to", "b": [0.7768, 0.4208, 0.7964, 0.4406]}, {"w": "small", "b": [0.8027, 0.4208, 0.8574, 0.4406]}, {"w": "values:", "b": [0.1799, 0.4413, 0.2513, 0.4611]}, {"w": "for", "b": [0.2576, 0.4413, 0.287, 0.4611]}, {"w": "example,", "b": [0.2934, 0.4413, 0.3851, 0.4611]}, {"w": "in", "b": [0.3914, 0.4413, 0.4111, 0.4611]}, {"w": "the", "b": [0.4174, 0.4413, 0.4482, 0.4611]}, {"w": "[-1,", "b": [0.4545, 0.4413, 0.4902, 0.4611]}, {"w": "1]", "b": [0.4965, 0.4413, 0.5175, 0.4611]}, {"w": "range", "b": [0.5238, 0.4413, 0.5799, 0.4611]}, {"w": "or", "b": [0.5862, 0.4413, 0.6072, 0.4611]}, {"w": "[0,", "b": [0.6135, 0.4413, 0.6408, 0.4611]}, {"w": "1]", "b": [0.6471, 0.4413, 0.6681, 0.4611]}, {"w": "range.", "b": [0.6744, 0.4413, 0.7368, 0.4611]}, {"w": "If", "b": [0.1799, 0.4618, 0.1967, 0.4816]}, {"w": "different", "b": [0.203, 0.4618, 0.2894, 0.4816]}, {"w": "features", "b": [0.2957, 0.4618, 0.3755, 0.4816]}, {"w": "take", "b": [0.3818, 0.4618, 0.4238, 0.4816]}, {"w": "values", "b": [0.4301, 0.4618, 0.4946, 0.4816]}, {"w": "in", "b": [0.5009, 0.4618, 0.5205, 0.4816]}, {"w": "different", "b": [0.5268, 0.4618, 0.6132, 0.4816]}, {"w": "ranges", "b": [0.6195, 0.4618, 0.6853, 0.4816]}, {"w": "(heterogeneous", "b": [0.6916, 0.4618, 0.8457, 0.4816]}, {"w": "data),", "b": [0.1799, 0.4823, 0.2366, 0.5021]}, {"w": "then", "b": [0.2429, 0.4823, 0.2863, 0.5021]}, {"w": "the", "b": [0.2926, 0.4823, 0.3235, 0.5021]}, {"w": "data", "b": [0.3298, 0.4823, 0.3718, 0.5021]}, {"w": "should", "b": [0.3781, 0.4823, 0.4454, 0.5021]}, {"w": "be", "b": [0.4517, 0.4823, 0.4755, 0.5021]}, {"w": "normalized.", "b": [0.4818, 0.4823, 0.6016, 0.5021]}, {"w": "You", "b": [0.1799, 0.5028, 0.2208, 0.5226]}, {"w": "may", "b": [0.2271, 0.5028, 0.2705, 0.5226]}, {"w": "want", "b": [0.2768, 0.5028, 0.3259, 0.5226]}, {"w": "to", "b": [0.3322, 0.5028, 0.3518, 0.5226]}, {"w": "do", "b": [0.3581, 0.5028, 0.3833, 0.5226]}, {"w": "some", "b": [0.3896, 0.5028, 0.4429, 0.5226]}, {"w": "feature", "b": [0.4492, 0.5028, 0.5192, 0.5226]}, {"w": "engineering,", "b": [0.5255, 0.5028, 0.6509, 0.5226]}, {"w": "especially", "b": [0.6572, 0.5028, 0.7581, 0.5226]}, {"w": "for", "b": [0.7644, 0.5028, 0.7938, 0.5226]}, {"w": "small-", "b": [0.8001, 0.5028, 0.8632, 0.5226]}, {"w": "data", "b": [0.1799, 0.5233, 0.2219, 0.5431]}, {"w": "problems.", "b": [0.2282, 0.5233, 0.3284, 0.5431]}]}, {"id": "b_5", "type": "paragraph", "text": "Once your tensors of input data and target data are ready, you can begin to train models.", "words": [{"w": "Once", "b": [0.1294, 0.5661, 0.1826, 0.5858]}, {"w": "your", "b": [0.1889, 0.5661, 0.2352, 0.5858]}, {"w": "tensors", "b": [0.2415, 0.5661, 0.313, 0.5858]}, {"w": "of", "b": [0.3193, 0.5661, 0.3403, 0.5858]}, {"w": "input", "b": [0.3466, 0.5661, 0.3984, 0.5858]}, {"w": "data", "b": [0.4048, 0.5661, 0.4468, 0.5858]}, {"w": "and", "b": [0.4531, 0.5661, 0.4895, 0.5858]}, {"w": "target", "b": [0.4958, 0.5661, 0.5528, 0.5858]}, {"w": "data", "b": [0.5591, 0.5661, 0.6011, 0.5858]}, {"w": "are", "b": [0.6074, 0.5661, 0.6382, 0.5858]}, {"w": "ready,", "b": [0.6445, 0.5661, 0.7052, 0.5858]}, {"w": "you", "b": [0.7115, 0.5661, 0.7493, 0.5858]}, {"w": "can", "b": [0.7556, 0.5661, 0.7906, 0.5858]}, {"w": "begin", "b": [0.7969, 0.5661, 0.853, 0.5858]}, {"w": "to", "b": [0.1294, 0.5866, 0.149, 0.6063]}, {"w": "train", "b": [0.1553, 0.5866, 0.2016, 0.6063]}, {"w": "models.", "b": [0.2079, 0.5866, 0.2871, 0.6063]}]}, {"id": "b_6", "type": "paragraph", "text": "4.5.5. Developing a model that does better than a baseline", "words": [{"w": "4.5.5.", "b": [0.1294, 0.6338, 0.1862, 0.6536]}, {"w": "Developing", "b": [0.1925, 0.6338, 0.313, 0.6536]}, {"w": "a", "b": [0.3193, 0.6338, 0.3319, 0.6536]}, {"w": "model", "b": [0.3382, 0.6338, 0.4041, 0.6536]}, {"w": "that", "b": [0.4104, 0.6338, 0.4538, 0.6536]}, {"w": "does", "b": [0.4601, 0.6338, 0.5078, 0.6536]}, {"w": "better", "b": [0.5141, 0.6338, 0.5785, 0.6536]}, {"w": "than", "b": [0.5848, 0.6338, 0.6339, 0.6536]}, {"w": "a", "b": [0.6402, 0.6338, 0.6528, 0.6536]}, {"w": "baseline", "b": [0.6591, 0.6338, 0.746, 0.6536]}]}, {"id": "b_7", "type": "paragraph", "text": "Your goal at this stage is to achieve statistical power: that is, to develop a small model that is capable of beating a dumb baseline. In the MNIST digit-classification example, anything that achieves an accuracy greater than 0.1 can be said to have statistical power; in the IMDB example, it’s anything with an accuracy greater than 0.5.", "words": [{"w": "Your", "b": [0.1294, 0.6766, 0.1787, 0.6964]}, {"w": "goal", "b": [0.185, 0.6766, 0.2285, 0.6964]}, {"w": "at", "b": [0.2348, 0.6766, 0.253, 0.6964]}, {"w": "this", "b": [0.2593, 0.6766, 0.2958, 0.6964]}, {"w": "stage", "b": [0.3021, 0.6766, 0.3539, 0.6964]}, {"w": "is", "b": [0.3602, 0.6766, 0.377, 0.6964]}, {"w": "to", "b": [0.3833, 0.6766, 0.403, 0.6964]}, {"w": "achieve", "b": [0.4093, 0.6766, 0.4863, 0.6964]}, {"w": "statistical", "b": [0.4925, 0.6766, 0.5907, 0.6964]}, {"w": "power:", "b": [0.597, 0.6766, 0.667, 0.6964]}, {"w": "that", "b": [0.6733, 0.6766, 0.7112, 0.6964]}, {"w": "is,", "b": [0.7175, 0.6766, 0.7406, 0.6964]}, {"w": "to", "b": [0.7469, 0.6766, 0.7665, 0.6964]}, {"w": "develop", "b": [0.7729, 0.6766, 0.8527, 0.6964]}, {"w": "a", "b": [0.859, 0.6766, 0.8702, 0.6964]}, {"w": "small", "b": [0.1294, 0.6971, 0.1841, 0.7169]}, {"w": "model", "b": [0.1904, 0.6971, 0.2534, 0.7169]}, {"w": "that", "b": [0.2598, 0.6971, 0.2976, 0.7169]}, {"w": "is", "b": [0.3039, 0.6971, 0.3207, 0.7169]}, {"w": "capable", "b": [0.327, 0.6971, 0.4041, 0.7169]}, {"w": "of", "b": [0.4104, 0.6971, 0.4314, 0.7169]}, {"w": "beating", "b": [0.4377, 0.6971, 0.512, 0.7169]}, {"w": "a", "b": [0.5183, 0.6971, 0.5295, 0.7169]}, {"w": "dumb", "b": [0.5358, 0.6971, 0.5932, 0.7169]}, {"w": "baseline.", "b": [0.5995, 0.6971, 0.6885, 0.7169]}, {"w": "In", "b": [0.6948, 0.6971, 0.7158, 0.7169]}, {"w": "the", "b": [0.7221, 0.6971, 0.753, 0.7169]}, {"w": "MNIST", "b": [0.7593, 0.6971, 0.8378, 0.7169]}, {"w": "digit-classification", "b": [0.1294, 0.7176, 0.3172, 0.7374]}, {"w": "example,", "b": [0.3235, 0.7176, 0.4153, 0.7374]}, {"w": "anything", "b": [0.4215, 0.7176, 0.5098, 0.7374]}, {"w": "that", "b": [0.5161, 0.7176, 0.5539, 0.7374]}, {"w": "achieves", "b": [0.5602, 0.7176, 0.6471, 0.7374]}, {"w": "an", "b": [0.6534, 0.7176, 0.6772, 0.7374]}, {"w": "accuracy", "b": [0.6835, 0.7176, 0.7731, 0.7374]}, {"w": "greater", "b": [0.7795, 0.7176, 0.8495, 0.7374]}, {"w": "than", "b": [0.1294, 0.7381, 0.1729, 0.7579]}, {"w": "0.1", "b": [0.1792, 0.7381, 0.2107, 0.7579]}, {"w": "can", "b": [0.217, 0.7381, 0.252, 0.7579]}, {"w": "be", "b": [0.2583, 0.7381, 0.2821, 0.7579]}, {"w": "said", "b": [0.2884, 0.7381, 0.3291, 0.7579]}, {"w": "to", "b": [0.3354, 0.7381, 0.355, 0.7579]}, {"w": "have", "b": [0.3613, 0.7381, 0.4089, 0.7579]}, {"w": "statistical", "b": [0.4152, 0.7381, 0.5105, 0.7579]}, {"w": "power;", "b": [0.5169, 0.7381, 0.5869, 0.7579]}, {"w": "in", "b": [0.5932, 0.7381, 0.6128, 0.7579]}, {"w": "the", "b": [0.6191, 0.7381, 0.65, 0.7579]}, {"w": "IMDB", "b": [0.6563, 0.7381, 0.7221, 0.7579]}, {"w": "example,", "b": [0.7284, 0.7381, 0.8202, 0.7579]}, {"w": "it’s", "b": [0.8265, 0.7381, 0.8573, 0.7579]}, {"w": "anything", "b": [0.1294, 0.7586, 0.2177, 0.7784]}, {"w": "with", "b": [0.224, 0.7586, 0.2688, 0.7784]}, {"w": "an", "b": [0.2751, 0.7586, 0.299, 0.7784]}, {"w": "accuracy", "b": [0.3053, 0.7586, 0.3949, 0.7784]}, {"w": "greater", "b": [0.4012, 0.7586, 0.4712, 0.7784]}, {"w": "than", "b": [0.4775, 0.7586, 0.521, 0.7784]}, {"w": "0.5.", "b": [0.5273, 0.7586, 0.5651, 0.7784]}]}, {"id": "b_8", "type": "paragraph", "text": "Note that it’s not always possible to achieve statistical power. If you can’t beat a random baseline after trying multiple reasonable architectures, it may be that the answer to the question you’re asking isn’t present in the input data. Remember that you make two hypotheses:", "words": [{"w": "Note", "b": [0.1294, 0.8014, 0.1785, 0.8211]}, {"w": "that", "b": [0.1848, 0.8014, 0.2226, 0.8211]}, {"w": "it’s", "b": [0.2289, 0.8014, 0.2597, 0.8211]}, {"w": "not", "b": [0.266, 0.8014, 0.2983, 0.8211]}, {"w": "always", "b": [0.3046, 0.8014, 0.3746, 0.8211]}, {"w": "possible", "b": [0.3809, 0.8014, 0.4636, 0.8211]}, {"w": "to", "b": [0.4699, 0.8014, 0.4896, 0.8211]}, {"w": "achieve", "b": [0.4959, 0.8014, 0.5729, 0.8211]}, {"w": "statistical", "b": [0.5792, 0.8014, 0.6745, 0.8211]}, {"w": "power.", "b": [0.6808, 0.8014, 0.7487, 0.8211]}, {"w": "If", "b": [0.755, 0.8014, 0.7718, 0.8211]}, {"w": "you", "b": [0.7781, 0.8014, 0.816, 0.8211]}, {"w": "can’t", "b": [0.1294, 0.8219, 0.1794, 0.8416]}, {"w": "beat", "b": [0.1857, 0.8219, 0.2277, 0.8416]}, {"w": "a", "b": [0.234, 0.8219, 0.2452, 0.8416]}, {"w": "random", "b": [0.2515, 0.8219, 0.3286, 0.8416]}, {"w": "baseline", "b": [0.3349, 0.8219, 0.4176, 0.8416]}, {"w": "after", "b": [0.4239, 0.8219, 0.4701, 0.8416]}, {"w": "trying", "b": [0.4764, 0.8219, 0.5366, 0.8416]}, {"w": "multiple", "b": [0.543, 0.8219, 0.6271, 0.8416]}, {"w": "reasonable", "b": [0.6333, 0.8219, 0.7411, 0.8416]}, {"w": "architectures,", "b": [0.1294, 0.8424, 0.2646, 0.8621]}, {"w": "it", "b": [0.2709, 0.8424, 0.2849, 0.8621]}, {"w": "may", "b": [0.2912, 0.8424, 0.3347, 0.8621]}, {"w": "be", "b": [0.341, 0.8424, 0.3648, 0.8621]}, {"w": "that", "b": [0.3711, 0.8424, 0.4089, 0.8621]}, {"w": "the", "b": [0.4152, 0.8424, 0.4461, 0.8621]}, {"w": "answer", "b": [0.4524, 0.8424, 0.5238, 0.8621]}, {"w": "to", "b": [0.5301, 0.8424, 0.5497, 0.8621]}, {"w": "the", "b": [0.5561, 0.8424, 0.5869, 0.8621]}, {"w": "question", "b": [0.5932, 0.8424, 0.6787, 0.8621]}, {"w": "you’re", "b": [0.685, 0.8424, 0.7508, 0.8621]}, {"w": "asking", "b": [0.7571, 0.8424, 0.823, 0.8621]}, {"w": "isn’t", "b": [0.1294, 0.8629, 0.1738, 0.8826]}, {"w": "present", "b": [0.1801, 0.8629, 0.253, 0.8826]}, {"w": "in", "b": [0.2593, 0.8629, 0.2789, 0.8826]}, {"w": "the", "b": [0.2852, 0.8629, 0.316, 0.8826]}, {"w": "input", "b": [0.3223, 0.8629, 0.3742, 0.8826]}, {"w": "data.", "b": [0.3805, 0.8629, 0.4288, 0.8826]}, {"w": "Remember", "b": [0.4351, 0.8629, 0.5458, 0.8826]}, {"w": "that", "b": [0.5521, 0.8629, 0.5899, 0.8826]}, {"w": "you", "b": [0.5962, 0.8629, 0.634, 0.8826]}, {"w": "make", "b": [0.6404, 0.8629, 0.695, 0.8826]}, {"w": "two", "b": [0.7013, 0.8629, 0.7391, 0.8826]}, {"w": "hypotheses:", "b": [0.7454, 0.8629, 0.8646, 0.8826]}]}]}, {"page": 166, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You hypothesize that your outputs can be predicted given your inputs. You hypothesize that the available data is sufficiently informative to learn the relationship between inputs and outputs.", "words": [{"w": "You", "b": [0.1799, 0.0857, 0.2208, 0.1054]}, {"w": "hypothesize", "b": [0.2271, 0.0857, 0.3476, 0.1054]}, {"w": "that", "b": [0.3539, 0.0857, 0.3917, 0.1054]}, {"w": "your", "b": [0.398, 0.0857, 0.4443, 0.1054]}, {"w": "outputs", "b": [0.4506, 0.0857, 0.5249, 0.1054]}, {"w": "can", "b": [0.5312, 0.0857, 0.5662, 0.1054]}, {"w": "be", "b": [0.5725, 0.0857, 0.5963, 0.1054]}, {"w": "predicted", "b": [0.6026, 0.0857, 0.6965, 0.1054]}, {"w": "given", "b": [0.7028, 0.0857, 0.7588, 0.1054]}, {"w": "your", "b": [0.7652, 0.0857, 0.8114, 0.1054]}, {"w": "inputs.", "b": [0.1799, 0.1062, 0.2478, 0.1259]}, {"w": "You", "b": [0.1799, 0.1267, 0.2208, 0.1464]}, {"w": "hypothesize", "b": [0.2271, 0.1267, 0.3476, 0.1464]}, {"w": "that", "b": [0.3539, 0.1267, 0.3917, 0.1464]}, {"w": "the", "b": [0.398, 0.1267, 0.4289, 0.1464]}, {"w": "available", "b": [0.4352, 0.1267, 0.5262, 0.1464]}, {"w": "data", "b": [0.5325, 0.1267, 0.5746, 0.1464]}, {"w": "is", "b": [0.5809, 0.1267, 0.5977, 0.1464]}, {"w": "sufficiently", "b": [0.604, 0.1267, 0.7184, 0.1464]}, {"w": "informative", "b": [0.7247, 0.1267, 0.8424, 0.1464]}, {"w": "to", "b": [0.8487, 0.1267, 0.8683, 0.1464]}, {"w": "learn", "b": [0.1799, 0.1472, 0.2303, 0.1669]}, {"w": "the", "b": [0.2366, 0.1472, 0.2674, 0.1669]}, {"w": "relationship", "b": [0.2737, 0.1472, 0.3928, 0.1669]}, {"w": "between", "b": [0.3992, 0.1472, 0.4832, 0.1669]}, {"w": "inputs", "b": [0.4895, 0.1472, 0.5512, 0.1669]}, {"w": "and", "b": [0.5575, 0.1472, 0.5939, 0.1669]}, {"w": "outputs.", "b": [0.6002, 0.1472, 0.6808, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "It may well be that these hypotheses are false, in which case you must go back to the drawing board.", "words": [{"w": "It", "b": [0.1294, 0.19, 0.1448, 0.2097]}, {"w": "may", "b": [0.1511, 0.19, 0.1946, 0.2097]}, {"w": "well", "b": [0.2009, 0.19, 0.2443, 0.2097]}, {"w": "be", "b": [0.2506, 0.19, 0.2744, 0.2097]}, {"w": "that", "b": [0.2807, 0.19, 0.3186, 0.2097]}, {"w": "these", "b": [0.3249, 0.19, 0.3767, 0.2097]}, {"w": "hypotheses", "b": [0.383, 0.19, 0.4951, 0.2097]}, {"w": "are", "b": [0.5014, 0.19, 0.5322, 0.2097]}, {"w": "false,", "b": [0.5385, 0.19, 0.5925, 0.2097]}, {"w": "in", "b": [0.5988, 0.19, 0.6184, 0.2097]}, {"w": "which", "b": [0.6247, 0.19, 0.6864, 0.2097]}, {"w": "case", "b": [0.6927, 0.19, 0.7361, 0.2097]}, {"w": "you", "b": [0.7424, 0.19, 0.7802, 0.2097]}, {"w": "must", "b": [0.7865, 0.19, 0.8356, 0.2097]}, {"w": "go", "b": [0.8419, 0.19, 0.8671, 0.2097]}, {"w": "back", "b": [0.1294, 0.2105, 0.177, 0.2302]}, {"w": "to", "b": [0.1833, 0.2105, 0.203, 0.2302]}, {"w": "the", "b": [0.2093, 0.2105, 0.2401, 0.2302]}, {"w": "drawing", "b": [0.2464, 0.2105, 0.3291, 0.2302]}, {"w": "board.", "b": [0.3354, 0.2105, 0.3991, 0.2302]}]}, {"id": "b_2", "type": "paragraph", "text": "Assuming that things go well, you need to make three key choices to build your first working model:", "words": [{"w": "Assuming", "b": [0.1294, 0.2532, 0.2317, 0.273]}, {"w": "that", "b": [0.238, 0.2532, 0.2759, 0.273]}, {"w": "things", "b": [0.2822, 0.2532, 0.3439, 0.273]}, {"w": "go", "b": [0.3502, 0.2532, 0.3754, 0.273]}, {"w": "well,", "b": [0.3817, 0.2532, 0.4314, 0.273]}, {"w": "you", "b": [0.4377, 0.2532, 0.4756, 0.273]}, {"w": "need", "b": [0.4819, 0.2532, 0.5295, 0.273]}, {"w": "to", "b": [0.5358, 0.2532, 0.5554, 0.273]}, {"w": "make", "b": [0.5618, 0.2532, 0.6164, 0.273]}, {"w": "three", "b": [0.6227, 0.2532, 0.6731, 0.273]}, {"w": "key", "b": [0.6794, 0.2532, 0.7159, 0.273]}, {"w": "choices", "b": [0.7222, 0.2532, 0.7978, 0.273]}, {"w": "to", "b": [0.8041, 0.2532, 0.8238, 0.273]}, {"w": "build", "b": [0.1294, 0.2737, 0.1813, 0.2935]}, {"w": "your", "b": [0.1876, 0.2737, 0.2338, 0.2935]}, {"w": "first", "b": [0.2401, 0.2737, 0.2808, 0.2935]}, {"w": "working", "b": [0.2871, 0.2737, 0.3712, 0.2935]}, {"w": "model:", "b": [0.3775, 0.2737, 0.4475, 0.2935]}]}, {"id": "b_3", "type": "paragraph", "text": "Last-layer activation— This establishes useful constraints on the network’s output. For instance, the IMDB classification example used sigmoid in the last layer; the regression example didn’t use any last-layer activation; and so on. Loss function— This should match the type of problem you’re trying to solve. For instance, the IMDB example used binary_crossentropy, the regression example used mse, and so on. Optimization configuration— What optimizer will you use? What will its learning rate be? In most cases, it’s safe to go with rmsprop and its default learning rate.", "words": [{"w": "Last-layer", "b": [0.1799, 0.3121, 0.285, 0.3318]}, {"w": "activation—", "b": [0.2913, 0.3121, 0.4188, 0.3318]}, {"w": "This", "b": [0.4251, 0.3121, 0.4699, 0.3318]}, {"w": "establishes", "b": [0.4762, 0.3121, 0.5855, 0.3318]}, {"w": "useful", "b": [0.5918, 0.3121, 0.6535, 0.3318]}, {"w": "constraints", "b": [0.6598, 0.3121, 0.7691, 0.3318]}, {"w": "on", "b": [0.7754, 0.3121, 0.8006, 0.3318]}, {"w": "the", "b": [0.8069, 0.3121, 0.8378, 0.3318]}, {"w": "network’s", "b": [0.1799, 0.3326, 0.2793, 0.3523]}, {"w": "output.", "b": [0.2857, 0.3326, 0.3564, 0.3523]}, {"w": "For", "b": [0.3627, 0.3326, 0.3978, 0.3523]}, {"w": "instance,", "b": [0.4041, 0.3326, 0.4931, 0.3523]}, {"w": "the", "b": [0.4994, 0.3326, 0.5302, 0.3523]}, {"w": "IMDB", "b": [0.5365, 0.3326, 0.6024, 0.3523]}, {"w": "classification", "b": [0.6087, 0.3326, 0.7418, 0.3523]}, {"w": "example", "b": [0.7481, 0.3326, 0.8336, 0.3523]}, {"w": "used", "b": [0.1799, 0.3531, 0.2261, 0.3728]}, {"w": "sigmoid", "b": [0.2324, 0.3541, 0.3384, 0.3743]}, {"w": "in", "b": [0.3447, 0.3531, 0.3643, 0.3728]}, {"w": "the", "b": [0.3706, 0.3531, 0.4014, 0.3728]}, {"w": "last", "b": [0.4077, 0.3531, 0.4428, 0.3728]}, {"w": "layer;", "b": [0.4491, 0.3531, 0.5065, 0.3728]}, {"w": "the", "b": [0.5128, 0.3531, 0.5436, 0.3728]}, {"w": "regression", "b": [0.5499, 0.3531, 0.6536, 0.3728]}, {"w": "example", "b": [0.6599, 0.3531, 0.7454, 0.3728]}, {"w": "didn’t", "b": [0.7517, 0.3531, 0.8114, 0.3728]}, {"w": "use", "b": [0.8177, 0.3531, 0.8514, 0.3728]}, {"w": "any", "b": [0.1799, 0.3745, 0.2163, 0.3942]}, {"w": "last-layer", "b": [0.2226, 0.3745, 0.3165, 0.3942]}, {"w": "activation;", "b": [0.3228, 0.3745, 0.4293, 0.3942]}, {"w": "and", "b": [0.4356, 0.3745, 0.472, 0.3942]}, {"w": "so", "b": [0.4783, 0.3745, 0.5007, 0.3942]}, {"w": "on.", "b": [0.507, 0.3745, 0.5386, 0.3942]}, {"w": "Loss", "b": [0.1799, 0.395, 0.2275, 0.4147]}, {"w": "function—", "b": [0.2338, 0.395, 0.3474, 0.4147]}, {"w": "This", "b": [0.3537, 0.395, 0.3985, 0.4147]}, {"w": "should", "b": [0.4048, 0.395, 0.4721, 0.4147]}, {"w": "match", "b": [0.4784, 0.395, 0.5401, 0.4147]}, {"w": "the", "b": [0.5464, 0.395, 0.5772, 0.4147]}, {"w": "type", "b": [0.5835, 0.395, 0.6269, 0.4147]}, {"w": "of", "b": [0.6332, 0.395, 0.6543, 0.4147]}, {"w": "problem", "b": [0.6606, 0.395, 0.7446, 0.4147]}, {"w": "you’re", "b": [0.7509, 0.395, 0.8168, 0.4147]}, {"w": "trying", "b": [0.1799, 0.4155, 0.2401, 0.4352]}, {"w": "to", "b": [0.2464, 0.4155, 0.2661, 0.4352]}, {"w": "solve.", "b": [0.2724, 0.4155, 0.3319, 0.4352]}, {"w": "For", "b": [0.3382, 0.4155, 0.3733, 0.4352]}, {"w": "instance,", "b": [0.3796, 0.4155, 0.4685, 0.4352]}, {"w": "the", "b": [0.4749, 0.4155, 0.5057, 0.4352]}, {"w": "IMDB", "b": [0.512, 0.4155, 0.5779, 0.4352]}, {"w": "example", "b": [0.5842, 0.4155, 0.6696, 0.4352]}, {"w": "used", "b": [0.6759, 0.4155, 0.7222, 0.4352]}, {"w": "binary_crossentropy,", "b": [0.1799, 0.436, 0.4738, 0.4572]}, {"w": "the", "b": [0.4801, 0.436, 0.5109, 0.4557]}, {"w": "regression", "b": [0.5172, 0.436, 0.6209, 0.4557]}, {"w": "example", "b": [0.6272, 0.436, 0.7127, 0.4557]}, {"w": "used", "b": [0.719, 0.436, 0.7652, 0.4557]}, {"w": "mse,", "b": [0.7715, 0.436, 0.8232, 0.4572]}, {"w": "and", "b": [0.8295, 0.436, 0.8659, 0.4557]}, {"w": "so", "b": [0.1799, 0.4574, 0.2023, 0.4771]}, {"w": "on.", "b": [0.2086, 0.4574, 0.2401, 0.4771]}, {"w": "Optimization", "b": [0.1799, 0.4779, 0.3144, 0.4976]}, {"w": "configuration—", "b": [0.3207, 0.4779, 0.489, 0.4976]}, {"w": "What", "b": [0.4952, 0.4779, 0.5499, 0.4976]}, {"w": "optimizer", "b": [0.5562, 0.4779, 0.6529, 0.4976]}, {"w": "will", "b": [0.6592, 0.4779, 0.6984, 0.4976]}, {"w": "you", "b": [0.7047, 0.4779, 0.7426, 0.4976]}, {"w": "use?", "b": [0.7489, 0.4779, 0.7937, 0.4976]}, {"w": "What", "b": [0.8, 0.4779, 0.8547, 0.4976]}, {"w": "will", "b": [0.1799, 0.4984, 0.2191, 0.5181]}, {"w": "its", "b": [0.2254, 0.4984, 0.2493, 0.5181]}, {"w": "learning", "b": [0.2556, 0.4984, 0.3382, 0.5181]}, {"w": "rate", "b": [0.3445, 0.4984, 0.3824, 0.5181]}, {"w": "be?", "b": [0.3887, 0.4984, 0.4237, 0.5181]}, {"w": "In", "b": [0.43, 0.4984, 0.451, 0.5181]}, {"w": "most", "b": [0.4573, 0.4984, 0.5064, 0.5181]}, {"w": "cases,", "b": [0.5127, 0.4984, 0.5722, 0.5181]}, {"w": "it’s", "b": [0.5785, 0.4984, 0.6093, 0.5181]}, {"w": "safe", "b": [0.6156, 0.4984, 0.6562, 0.5181]}, {"w": "to", "b": [0.6625, 0.4984, 0.6821, 0.5181]}, {"w": "go", "b": [0.6884, 0.4984, 0.7137, 0.5181]}, {"w": "with", "b": [0.72, 0.4984, 0.7648, 0.5181]}, {"w": "rmsprop", "b": [0.1799, 0.5199, 0.2858, 0.5401]}, {"w": "and", "b": [0.2921, 0.5189, 0.3285, 0.5386]}, {"w": "its", "b": [0.3349, 0.5189, 0.3587, 0.5386]}, {"w": "default", "b": [0.365, 0.5189, 0.435, 0.5386]}, {"w": "learning", "b": [0.4414, 0.5189, 0.524, 0.5386]}, {"w": "rate.", "b": [0.5303, 0.5189, 0.5744, 0.5386]}]}, {"id": "b_4", "type": "paragraph", "text": "Regarding the choice of a loss function, note that it isn’t always possible to directly optimize for the metric that measures success on a problem. Sometimes there is no easy way to turn a metric into a loss function; loss functions, after all, need to be computable given only a mini-batch of data (ideally, a loss function should be computable for as little as a single data point) and must be differentiable (otherwise, you can’t use backpropagation to train your network). For instance, the widely used classification metric ROC AUC can’t be directly optimized. Hence, in classification tasks, it’s common to optimize for a proxy metric of ROC AUC, such as crossentropy. In general, you can hope that the lower the crossentropy gets, the higher the ROC AUC will be.", "words": [{"w": "Regarding", "b": [0.1294, 0.5625, 0.2345, 0.5823]}, {"w": "the", "b": [0.2408, 0.5625, 0.2716, 0.5823]}, {"w": "choice", "b": [0.2779, 0.5625, 0.3438, 0.5823]}, {"w": "of", "b": [0.3501, 0.5625, 0.3711, 0.5823]}, {"w": "a", "b": [0.3774, 0.5625, 0.3886, 0.5823]}, {"w": "loss", "b": [0.3949, 0.5625, 0.4342, 0.5823]}, {"w": "function,", "b": [0.4405, 0.5625, 0.5309, 0.5823]}, {"w": "note", "b": [0.5372, 0.5625, 0.5806, 0.5823]}, {"w": "that", "b": [0.5869, 0.5625, 0.6247, 0.5823]}, {"w": "it", "b": [0.6311, 0.5625, 0.6451, 0.5823]}, {"w": "isn’t", "b": [0.6514, 0.5625, 0.6957, 0.5823]}, {"w": "always", "b": [0.702, 0.5625, 0.7721, 0.5823]}, {"w": "possible", "b": [0.7784, 0.5625, 0.8611, 0.5823]}, {"w": "to", "b": [0.1294, 0.583, 0.149, 0.6028]}, {"w": "directly", "b": [0.1553, 0.583, 0.2324, 0.6028]}, {"w": "optimize", "b": [0.2387, 0.583, 0.327, 0.6028]}, {"w": "for", "b": [0.3333, 0.583, 0.3627, 0.6028]}, {"w": "the", "b": [0.369, 0.583, 0.3999, 0.6028]}, {"w": "metric", "b": [0.4062, 0.583, 0.4706, 0.6028]}, {"w": "that", "b": [0.4769, 0.583, 0.5148, 0.6028]}, {"w": "measures", "b": [0.5211, 0.583, 0.6149, 0.6028]}, {"w": "success", "b": [0.6211, 0.583, 0.6968, 0.6028]}, {"w": "on", "b": [0.7031, 0.583, 0.7283, 0.6028]}, {"w": "a", "b": [0.7346, 0.583, 0.7458, 0.6028]}, {"w": "problem.", "b": [0.7521, 0.583, 0.8425, 0.6028]}, {"w": "Sometimes", "b": [0.1294, 0.6035, 0.2415, 0.6233]}, {"w": "there", "b": [0.2478, 0.6035, 0.2983, 0.6233]}, {"w": "is", "b": [0.3046, 0.6035, 0.3214, 0.6233]}, {"w": "no", "b": [0.3277, 0.6035, 0.3529, 0.6233]}, {"w": "easy", "b": [0.3592, 0.6035, 0.4041, 0.6233]}, {"w": "way", "b": [0.4104, 0.6035, 0.4524, 0.6233]}, {"w": "to", "b": [0.4587, 0.6035, 0.4783, 0.6233]}, {"w": "turn", "b": [0.4846, 0.6035, 0.5253, 0.6233]}, {"w": "a", "b": [0.5316, 0.6035, 0.5428, 0.6233]}, {"w": "metric", "b": [0.5491, 0.6035, 0.6135, 0.6233]}, {"w": "into", "b": [0.6199, 0.6035, 0.6591, 0.6233]}, {"w": "a", "b": [0.6654, 0.6035, 0.6766, 0.6233]}, {"w": "loss", "b": [0.6829, 0.6035, 0.7222, 0.6233]}, {"w": "function;", "b": [0.7285, 0.6035, 0.8196, 0.6233]}, {"w": "loss", "b": [0.8259, 0.6035, 0.8651, 0.6233]}, {"w": "functions,", "b": [0.1294, 0.624, 0.2296, 0.6438]}, {"w": "after", "b": [0.2359, 0.624, 0.2821, 0.6438]}, {"w": "all,", "b": [0.2884, 0.624, 0.32, 0.6438]}, {"w": "need", "b": [0.3263, 0.624, 0.3739, 0.6438]}, {"w": "to", "b": [0.3802, 0.624, 0.3998, 0.6438]}, {"w": "be", "b": [0.4061, 0.624, 0.4299, 0.6438]}, {"w": "computable", "b": [0.4362, 0.624, 0.5539, 0.6438]}, {"w": "given", "b": [0.5602, 0.624, 0.6163, 0.6438]}, {"w": "only", "b": [0.6226, 0.624, 0.6674, 0.6438]}, {"w": "a", "b": [0.6737, 0.624, 0.6849, 0.6438]}, {"w": "mini-batch", "b": [0.6912, 0.624, 0.8005, 0.6438]}, {"w": "of", "b": [0.8068, 0.624, 0.8279, 0.6438]}, {"w": "data", "b": [0.1294, 0.6445, 0.1714, 0.6643]}, {"w": "(ideally,", "b": [0.1777, 0.6445, 0.2594, 0.6643]}, {"w": "a", "b": [0.2658, 0.6445, 0.277, 0.6643]}, {"w": "loss", "b": [0.2833, 0.6445, 0.3225, 0.6643]}, {"w": "function", "b": [0.3288, 0.6445, 0.4129, 0.6643]}, {"w": "should", "b": [0.4192, 0.6445, 0.4865, 0.6643]}, {"w": "be", "b": [0.4928, 0.6445, 0.5166, 0.6643]}, {"w": "computable", "b": [0.5229, 0.6445, 0.6406, 0.6643]}, {"w": "for", "b": [0.6469, 0.6445, 0.6763, 0.6643]}, {"w": "as", "b": [0.6826, 0.6445, 0.7036, 0.6643]}, {"w": "little", "b": [0.71, 0.6445, 0.7562, 0.6643]}, {"w": "as", "b": [0.7625, 0.6445, 0.7835, 0.6643]}, {"w": "a", "b": [0.7898, 0.6445, 0.801, 0.6643]}, {"w": "single", "b": [0.8073, 0.6445, 0.8676, 0.6643]}, {"w": "data", "b": [0.1294, 0.665, 0.1714, 0.6848]}, {"w": "point)", "b": [0.1777, 0.665, 0.238, 0.6848]}, {"w": "and", "b": [0.2443, 0.665, 0.2807, 0.6848]}, {"w": "must", "b": [0.287, 0.665, 0.3361, 0.6848]}, {"w": "be", "b": [0.3424, 0.665, 0.3662, 0.6848]}, {"w": "differentiable", "b": [0.3725, 0.665, 0.5079, 0.6848]}, {"w": "(otherwise,", "b": [0.5142, 0.665, 0.627, 0.6848]}, {"w": "you", "b": [0.6333, 0.665, 0.6712, 0.6848]}, {"w": "can’t", "b": [0.6775, 0.665, 0.7274, 0.6848]}, {"w": "use", "b": [0.7337, 0.665, 0.7673, 0.6848]}, {"w": "backpropagation", "b": [0.1294, 0.6855, 0.2975, 0.7053]}, {"w": "to", "b": [0.3038, 0.6855, 0.3235, 0.7053]}, {"w": "train", "b": [0.3298, 0.6855, 0.376, 0.7053]}, {"w": "your", "b": [0.3823, 0.6855, 0.4286, 0.7053]}, {"w": "network).", "b": [0.4349, 0.6855, 0.5322, 0.7053]}, {"w": "For", "b": [0.5385, 0.6855, 0.5736, 0.7053]}, {"w": "instance,", "b": [0.5799, 0.6855, 0.6689, 0.7053]}, {"w": "the", "b": [0.6752, 0.6855, 0.706, 0.7053]}, {"w": "widely", "b": [0.7122, 0.6855, 0.7809, 0.7053]}, {"w": "used", "b": [0.7872, 0.6855, 0.8334, 0.7053]}, {"w": "classification", "b": [0.1294, 0.706, 0.2625, 0.7258]}, {"w": "metric", "b": [0.2688, 0.706, 0.3333, 0.7258]}, {"w": "ROC", "b": [0.3396, 0.706, 0.3915, 0.7258]}, {"w": "AUC", "b": [0.3978, 0.706, 0.451, 0.7258]}, {"w": "can’t", "b": [0.4573, 0.706, 0.5072, 0.7258]}, {"w": "be", "b": [0.5136, 0.706, 0.5374, 0.7258]}, {"w": "directly", "b": [0.5437, 0.706, 0.6207, 0.7258]}, {"w": "optimized.", "b": [0.627, 0.706, 0.7343, 0.7258]}, {"w": "Hence,", "b": [0.7406, 0.706, 0.8113, 0.7258]}, {"w": "in", "b": [0.8176, 0.706, 0.8372, 0.7258]}, {"w": "classification", "b": [0.1294, 0.7265, 0.2625, 0.7463]}, {"w": "tasks,", "b": [0.2688, 0.7265, 0.3256, 0.7463]}, {"w": "it’s", "b": [0.3319, 0.7265, 0.3627, 0.7463]}, {"w": "common", "b": [0.369, 0.7265, 0.4573, 0.7463]}, {"w": "to", "b": [0.4636, 0.7265, 0.4832, 0.7463]}, {"w": "optimize", "b": [0.4895, 0.7265, 0.5778, 0.7463]}, {"w": "for", "b": [0.5841, 0.7265, 0.6135, 0.7463]}, {"w": "a", "b": [0.6198, 0.7265, 0.631, 0.7463]}, {"w": "proxy", "b": [0.6373, 0.7265, 0.6962, 0.7463]}, {"w": "metric", "b": [0.7025, 0.7265, 0.7669, 0.7463]}, {"w": "of", "b": [0.7732, 0.7265, 0.7942, 0.7463]}, {"w": "ROC", "b": [0.8005, 0.7265, 0.8524, 0.7463]}, {"w": "AUC,", "b": [0.1294, 0.747, 0.189, 0.7668]}, {"w": "such", "b": [0.1953, 0.747, 0.2415, 0.7668]}, {"w": "as", "b": [0.2478, 0.747, 0.2688, 0.7668]}, {"w": "crossentropy.", "b": [0.2751, 0.747, 0.4087, 0.7668]}, {"w": "In", "b": [0.415, 0.747, 0.436, 0.7668]}, {"w": "general,", "b": [0.4423, 0.747, 0.5229, 0.7668]}, {"w": "you", "b": [0.5292, 0.747, 0.567, 0.7668]}, {"w": "can", "b": [0.5733, 0.747, 0.6084, 0.7668]}, {"w": "hope", "b": [0.6147, 0.747, 0.6637, 0.7668]}, {"w": "that", "b": [0.67, 0.747, 0.7078, 0.7668]}, {"w": "the", "b": [0.7142, 0.747, 0.745, 0.7668]}, {"w": "lower", "b": [0.7513, 0.747, 0.8087, 0.7668]}, {"w": "the", "b": [0.815, 0.747, 0.8459, 0.7668]}, {"w": "crossentropy", "b": [0.1294, 0.7675, 0.2583, 0.7873]}, {"w": "gets,", "b": [0.2646, 0.7675, 0.3116, 0.7873]}, {"w": "the", "b": [0.3179, 0.7675, 0.3487, 0.7873]}, {"w": "higher", "b": [0.355, 0.7675, 0.4195, 0.7873]}, {"w": "the", "b": [0.4257, 0.7675, 0.4566, 0.7873]}, {"w": "ROC", "b": [0.4629, 0.7675, 0.5147, 0.7873]}, {"w": "AUC", "b": [0.521, 0.7675, 0.5743, 0.7873]}, {"w": "will", "b": [0.5806, 0.7675, 0.6198, 0.7873]}, {"w": "be.", "b": [0.6262, 0.7675, 0.6563, 0.7873]}]}, {"id": "b_5", "type": "paragraph", "text": "Table 4.1 can help you choose a last-layer activation and a loss function for a few common problem types.", "words": [{"w": "Table", "b": [0.1294, 0.8103, 0.1851, 0.8301]}, {"w": "4.1", "b": [0.1914, 0.8103, 0.2229, 0.8301]}, {"w": "can", "b": [0.2292, 0.8103, 0.2642, 0.8301]}, {"w": "help", "b": [0.2705, 0.8103, 0.314, 0.8301]}, {"w": "you", "b": [0.3203, 0.8103, 0.3581, 0.8301]}, {"w": "choose", "b": [0.3644, 0.8103, 0.4345, 0.8301]}, {"w": "a", "b": [0.4408, 0.8103, 0.452, 0.8301]}, {"w": "last-layer", "b": [0.4583, 0.8103, 0.5522, 0.8301]}, {"w": "activation", "b": [0.5585, 0.8103, 0.6579, 0.8301]}, {"w": "and", "b": [0.6643, 0.8103, 0.7007, 0.8301]}, {"w": "a", "b": [0.707, 0.8103, 0.7182, 0.8301]}, {"w": "loss", "b": [0.7245, 0.8103, 0.7637, 0.8301]}, {"w": "function", "b": [0.7701, 0.8103, 0.8541, 0.8301]}, {"w": "for", "b": [0.1294, 0.8308, 0.1588, 0.8506]}, {"w": "a", "b": [0.1651, 0.8308, 0.1763, 0.8506]}, {"w": "few", "b": [0.1826, 0.8308, 0.2205, 0.8506]}, {"w": "common", "b": [0.2268, 0.8308, 0.315, 0.8506]}, {"w": "problem", "b": [0.3214, 0.8308, 0.4054, 0.8506]}, {"w": "types.", "b": [0.4117, 0.8308, 0.4713, 0.8506]}]}, {"id": "b_6", "type": "paragraph", "text": "Table 4.1. Choosing the right last-layer activation and loss function for your model", "words": [{"w": "Table", "b": [0.1294, 0.8731, 0.1739, 0.8879]}, {"w": "4.1.", "b": [0.1787, 0.8731, 0.207, 0.8879]}, {"w": "Choosing", "b": [0.2118, 0.8731, 0.2874, 0.8879]}, {"w": "the", "b": [0.2922, 0.8731, 0.3174, 0.8879]}, {"w": "right", "b": [0.3221, 0.8731, 0.3621, 0.8879]}, {"w": "last-layer", "b": [0.3668, 0.8731, 0.4425, 0.8879]}, {"w": "activation", "b": [0.4472, 0.8731, 0.5271, 0.8879]}, {"w": "and", "b": [0.5318, 0.8731, 0.5623, 0.8879]}, {"w": "loss", "b": [0.567, 0.8731, 0.5965, 0.8879]}, {"w": "function", "b": [0.6012, 0.8731, 0.6685, 0.8879]}, {"w": "for", "b": [0.6732, 0.8731, 0.6974, 0.8879]}, {"w": "your", "b": [0.7021, 0.8731, 0.7399, 0.8879]}, {"w": "model", "b": [0.7447, 0.8731, 0.794, 0.8879]}]}]}, {"page": 167, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Problem type Last-layer activation Loss function Problem type Last-layer activation Loss function", "words": [{"w": "Problem", "b": [0.1975, 0.1093, 0.2666, 0.1241]}, {"w": "type", "b": [0.2713, 0.1093, 0.306, 0.1241]}, {"w": "Last-layer", "b": [0.4133, 0.1093, 0.4963, 0.1241]}, {"w": "activation", "b": [0.501, 0.1093, 0.5809, 0.1241]}, {"w": "Loss", "b": [0.6905, 0.1093, 0.7273, 0.1241]}, {"w": "function", "b": [0.732, 0.1093, 0.7993, 0.1241]}, {"w": "Problem", "b": [0.1975, 0.1093, 0.2666, 0.1241]}, {"w": "type", "b": [0.2713, 0.1093, 0.306, 0.1241]}, {"w": "Last-layer", "b": [0.4133, 0.1093, 0.4963, 0.1241]}, {"w": "activation", "b": [0.501, 0.1093, 0.5809, 0.1241]}, {"w": "Loss", "b": [0.6905, 0.1093, 0.7273, 0.1241]}, {"w": "function", "b": [0.732, 0.1093, 0.7993, 0.1241]}]}, {"id": "b_1", "type": "paragraph", "text": "Binary classification sigmoid binary_crossentropy Multiclass, single-label classification", "words": [{"w": "Binary", "b": [0.1307, 0.1405, 0.1822, 0.1553]}, {"w": "classification", "b": [0.1869, 0.1405, 0.2867, 0.1553]}, {"w": "sigmoid", "b": [0.3754, 0.1405, 0.4363, 0.1553]}, {"w": "binary_crossentropy", "b": [0.6213, 0.1405, 0.7758, 0.1553]}, {"w": "Multiclass,", "b": [0.1307, 0.1574, 0.2142, 0.1722]}, {"w": "single-label", "b": [0.219, 0.1574, 0.3072, 0.1722]}, {"w": "classification", "b": [0.1307, 0.1725, 0.2305, 0.1873]}]}, {"id": "b_2", "type": "equation", "text": "softmax categorical_crossentropy", "words": [{"w": "softmax", "b": [0.3754, 0.1574, 0.4363, 0.1722]}, {"w": "categorical_crossentropy", "b": [0.6213, 0.1574, 0.8105, 0.1722]}]}, {"id": "b_3", "type": "paragraph", "text": "Multiclass, multilabel classification", "words": [{"w": "Multiclass,", "b": [0.1307, 0.1895, 0.2142, 0.2043]}, {"w": "multilabel", "b": [0.219, 0.1895, 0.2957, 0.2043]}, {"w": "classification", "b": [0.1307, 0.2046, 0.2305, 0.2194]}]}, {"id": "b_4", "type": "equation", "text": "sigmoid binary_crossentropy", "words": [{"w": "sigmoid", "b": [0.3754, 0.1895, 0.4363, 0.2043]}, {"w": "binary_crossentropy", "b": [0.6213, 0.1895, 0.7758, 0.2043]}]}, {"id": "b_5", "type": "paragraph", "text": "Regression to arbitrary values None mse Regression to values between 0 and 1", "words": [{"w": "Regression", "b": [0.1307, 0.2216, 0.2148, 0.2364]}, {"w": "to", "b": [0.2195, 0.2216, 0.2342, 0.2364]}, {"w": "arbitrary", "b": [0.2389, 0.2216, 0.3041, 0.2364]}, {"w": "values", "b": [0.3088, 0.2216, 0.3571, 0.2364]}, {"w": "None", "b": [0.3754, 0.2216, 0.4163, 0.2364]}, {"w": "mse", "b": [0.6213, 0.2216, 0.6518, 0.2364]}, {"w": "Regression", "b": [0.1307, 0.2385, 0.2148, 0.2533]}, {"w": "to", "b": [0.2195, 0.2385, 0.2342, 0.2533]}, {"w": "values", "b": [0.2389, 0.2385, 0.2873, 0.2533]}, {"w": "between", "b": [0.292, 0.2385, 0.355, 0.2533]}, {"w": "0", "b": [0.3598, 0.2385, 0.3692, 0.2533]}, {"w": "and", "b": [0.1307, 0.2536, 0.158, 0.2685]}, {"w": "1", "b": [0.1627, 0.2536, 0.1722, 0.2685]}]}, {"id": "b_6", "type": "equation", "text": "sigmoid mse or binary_crossentropy", "words": [{"w": "sigmoid", "b": [0.3754, 0.2385, 0.4363, 0.2533]}, {"w": "mse", "b": [0.6213, 0.2385, 0.6518, 0.2533]}, {"w": "or", "b": [0.6565, 0.2385, 0.6723, 0.2533]}, {"w": "binary_crossentropy", "b": [0.677, 0.2385, 0.8315, 0.2533]}]}, {"id": "b_7", "type": "paragraph", "text": "4.5.6. Scaling up: developing a model that overfits", "words": [{"w": "4.5.6.", "b": [0.1294, 0.2978, 0.1862, 0.3176]}, {"w": "Scaling", "b": [0.1925, 0.2978, 0.271, 0.3176]}, {"w": "up:", "b": [0.2773, 0.2978, 0.3137, 0.3176]}, {"w": "developing", "b": [0.32, 0.2978, 0.4364, 0.3176]}, {"w": "a", "b": [0.4427, 0.2978, 0.4553, 0.3176]}, {"w": "model", "b": [0.4616, 0.2978, 0.5275, 0.3176]}, {"w": "that", "b": [0.5338, 0.2978, 0.5772, 0.3176]}, {"w": "overfits", "b": [0.5835, 0.2978, 0.6648, 0.3176]}]}, {"id": "b_8", "type": "paragraph", "text": "Once you’ve obtained a model that has statistical power, the question becomes, is your model sufficiently powerful? Does it have enough layers and parameters to properly model the problem at hand? For instance, a network with a single hidden layer with two units would have statistical power on MNIST but wouldn’t be sufficient to solve the problem well. Remember that the universal tension in machine learning is between optimization and generalization; the ideal model is one that stands right at the border between underfitting and overfitting; between undercapacity and overcapacity. To figure out where this border lies, first you must cross it.", "words": [{"w": "Once", "b": [0.1294, 0.3406, 0.1826, 0.3603]}, {"w": "you’ve", "b": [0.1889, 0.3406, 0.259, 0.3603]}, {"w": "obtained", "b": [0.2653, 0.3406, 0.3522, 0.3603]}, {"w": "a", "b": [0.3585, 0.3406, 0.3697, 0.3603]}, {"w": "model", "b": [0.376, 0.3406, 0.4391, 0.3603]}, {"w": "that", "b": [0.4454, 0.3406, 0.4832, 0.3603]}, {"w": "has", "b": [0.4895, 0.3406, 0.5231, 0.3603]}, {"w": "statistical", "b": [0.5294, 0.3406, 0.6247, 0.3603]}, {"w": "power,", "b": [0.6311, 0.3406, 0.6993, 0.3603]}, {"w": "the", "b": [0.7056, 0.3406, 0.7364, 0.3603]}, {"w": "question", "b": [0.7427, 0.3406, 0.8282, 0.3603]}, {"w": "becomes,", "b": [0.1294, 0.3611, 0.224, 0.3808]}, {"w": "is", "b": [0.2303, 0.3611, 0.2471, 0.3808]}, {"w": "your", "b": [0.2534, 0.3611, 0.2997, 0.3808]}, {"w": "model", "b": [0.306, 0.3611, 0.369, 0.3808]}, {"w": "sufficiently", "b": [0.3753, 0.3611, 0.4898, 0.3808]}, {"w": "powerful?", "b": [0.4961, 0.3611, 0.5983, 0.3808]}, {"w": "Does", "b": [0.6046, 0.3611, 0.6565, 0.3808]}, {"w": "it", "b": [0.6628, 0.3611, 0.6768, 0.3808]}, {"w": "have", "b": [0.6831, 0.3611, 0.7307, 0.3808]}, {"w": "enough", "b": [0.737, 0.3611, 0.8113, 0.3808]}, {"w": "layers", "b": [0.1294, 0.3816, 0.1897, 0.4013]}, {"w": "and", "b": [0.196, 0.3816, 0.2324, 0.4013]}, {"w": "parameters", "b": [0.2387, 0.3816, 0.3494, 0.4013]}, {"w": "to", "b": [0.3557, 0.3816, 0.3753, 0.4013]}, {"w": "properly", "b": [0.3816, 0.3816, 0.4671, 0.4013]}, {"w": "model", "b": [0.4734, 0.3816, 0.5364, 0.4013]}, {"w": "the", "b": [0.5427, 0.3816, 0.5736, 0.4013]}, {"w": "problem", "b": [0.5799, 0.3816, 0.6639, 0.4013]}, {"w": "at", "b": [0.6703, 0.3816, 0.6885, 0.4013]}, {"w": "hand?", "b": [0.6948, 0.3816, 0.755, 0.4013]}, {"w": "For", "b": [0.7613, 0.3816, 0.7964, 0.4013]}, {"w": "instance,", "b": [0.1294, 0.4021, 0.2184, 0.4218]}, {"w": "a", "b": [0.2247, 0.4021, 0.2359, 0.4218]}, {"w": "network", "b": [0.2422, 0.4021, 0.3249, 0.4218]}, {"w": "with", "b": [0.3312, 0.4021, 0.376, 0.4218]}, {"w": "a", "b": [0.3823, 0.4021, 0.3935, 0.4218]}, {"w": "single", "b": [0.3998, 0.4021, 0.4601, 0.4218]}, {"w": "hidden", "b": [0.4664, 0.4021, 0.5351, 0.4218]}, {"w": "layer", "b": [0.5414, 0.4021, 0.5918, 0.4218]}, {"w": "with", "b": [0.598, 0.4021, 0.6429, 0.4218]}, {"w": "two", "b": [0.6492, 0.4021, 0.687, 0.4218]}, {"w": "units", "b": [0.6933, 0.4021, 0.7424, 0.4218]}, {"w": "would", "b": [0.7487, 0.4021, 0.8118, 0.4218]}, {"w": "have", "b": [0.8181, 0.4021, 0.8657, 0.4218]}, {"w": "statistical", "b": [0.1294, 0.4226, 0.2247, 0.4423]}, {"w": "power", "b": [0.231, 0.4226, 0.2941, 0.4423]}, {"w": "on", "b": [0.3004, 0.4226, 0.3256, 0.4423]}, {"w": "MNIST", "b": [0.3319, 0.4226, 0.4104, 0.4423]}, {"w": "but", "b": [0.4167, 0.4226, 0.4489, 0.4423]}, {"w": "wouldn’t", "b": [0.4552, 0.4226, 0.5458, 0.4423]}, {"w": "be", "b": [0.5521, 0.4226, 0.576, 0.4423]}, {"w": "sufficient", "b": [0.5823, 0.4226, 0.6771, 0.4423]}, {"w": "to", "b": [0.6834, 0.4226, 0.703, 0.4423]}, {"w": "solve", "b": [0.7093, 0.4226, 0.7626, 0.4423]}, {"w": "the", "b": [0.7689, 0.4226, 0.7997, 0.4423]}, {"w": "problem", "b": [0.1294, 0.4431, 0.2135, 0.4628]}, {"w": "well.", "b": [0.2198, 0.4431, 0.2695, 0.4628]}, {"w": "Remember", "b": [0.2758, 0.4431, 0.3865, 0.4628]}, {"w": "that", "b": [0.3928, 0.4431, 0.4307, 0.4628]}, {"w": "the", "b": [0.437, 0.4431, 0.4678, 0.4628]}, {"w": "universal", "b": [0.4741, 0.4431, 0.5665, 0.4628]}, {"w": "tension", "b": [0.5728, 0.4431, 0.6457, 0.4628]}, {"w": "in", "b": [0.652, 0.4431, 0.6717, 0.4628]}, {"w": "machine", "b": [0.678, 0.4431, 0.7634, 0.4628]}, {"w": "learning", "b": [0.7697, 0.4431, 0.8524, 0.4628]}, {"w": "is", "b": [0.1294, 0.4636, 0.1462, 0.4833]}, {"w": "between", "b": [0.1525, 0.4636, 0.2366, 0.4833]}, {"w": "optimization", "b": [0.2429, 0.4636, 0.3704, 0.4833]}, {"w": "and", "b": [0.3768, 0.4636, 0.4132, 0.4833]}, {"w": "generalization;", "b": [0.4195, 0.4636, 0.5694, 0.4833]}, {"w": "the", "b": [0.5757, 0.4636, 0.6065, 0.4833]}, {"w": "ideal", "b": [0.6128, 0.4636, 0.6619, 0.4833]}, {"w": "model", "b": [0.6682, 0.4636, 0.7312, 0.4833]}, {"w": "is", "b": [0.7376, 0.4636, 0.7544, 0.4833]}, {"w": "one", "b": [0.7607, 0.4636, 0.7971, 0.4833]}, {"w": "that", "b": [0.8034, 0.4636, 0.8413, 0.4833]}, {"w": "stands", "b": [0.1294, 0.4841, 0.1925, 0.5038]}, {"w": "right", "b": [0.1988, 0.4841, 0.2464, 0.5038]}, {"w": "at", "b": [0.2527, 0.4841, 0.2709, 0.5038]}, {"w": "the", "b": [0.2772, 0.4841, 0.3081, 0.5038]}, {"w": "border", "b": [0.3144, 0.4841, 0.3802, 0.5038]}, {"w": "between", "b": [0.3865, 0.4841, 0.4706, 0.5038]}, {"w": "underfitting", "b": [0.4769, 0.4841, 0.596, 0.5038]}, {"w": "and", "b": [0.6023, 0.4841, 0.6387, 0.5038]}, {"w": "overfitting;", "b": [0.645, 0.4841, 0.7585, 0.5038]}, {"w": "between", "b": [0.7649, 0.4841, 0.8489, 0.5038]}, {"w": "undercapacity", "b": [0.1294, 0.5046, 0.2709, 0.5243]}, {"w": "and", "b": [0.2772, 0.5046, 0.3136, 0.5243]}, {"w": "overcapacity.", "b": [0.3199, 0.5046, 0.4534, 0.5243]}, {"w": "To", "b": [0.4597, 0.5046, 0.486, 0.5243]}, {"w": "figure", "b": [0.4923, 0.5046, 0.5525, 0.5243]}, {"w": "out", "b": [0.5588, 0.5046, 0.5911, 0.5243]}, {"w": "where", "b": [0.5974, 0.5046, 0.659, 0.5243]}, {"w": "this", "b": [0.6653, 0.5046, 0.7018, 0.5243]}, {"w": "border", "b": [0.7081, 0.5046, 0.7739, 0.5243]}, {"w": "lies,", "b": [0.7802, 0.5046, 0.8215, 0.5243]}, {"w": "first", "b": [0.8278, 0.5046, 0.8685, 0.5243]}, {"w": "you", "b": [0.1294, 0.5251, 0.1673, 0.5448]}, {"w": "must", "b": [0.1736, 0.5251, 0.2226, 0.5448]}, {"w": "cross", "b": [0.2289, 0.5251, 0.2808, 0.5448]}, {"w": "it.", "b": [0.2871, 0.5251, 0.3074, 0.5448]}]}, {"id": "b_9", "type": "paragraph", "text": "To figure out how big a model you’ll need, you must develop a model that overfits. This is fairly easy:", "words": [{"w": "To", "b": [0.1294, 0.5679, 0.1557, 0.5876]}, {"w": "figure", "b": [0.162, 0.5679, 0.2222, 0.5876]}, {"w": "out", "b": [0.2285, 0.5679, 0.2608, 0.5876]}, {"w": "how", "b": [0.2671, 0.5679, 0.3105, 0.5876]}, {"w": "big", "b": [0.3168, 0.5679, 0.3491, 0.5876]}, {"w": "a", "b": [0.3554, 0.5679, 0.3666, 0.5876]}, {"w": "model", "b": [0.3729, 0.5679, 0.4359, 0.5876]}, {"w": "you’ll", "b": [0.4422, 0.5679, 0.5025, 0.5876]}, {"w": "need,", "b": [0.5088, 0.5679, 0.5627, 0.5876]}, {"w": "you", "b": [0.569, 0.5679, 0.6069, 0.5876]}, {"w": "must", "b": [0.6132, 0.5679, 0.6623, 0.5876]}, {"w": "develop", "b": [0.6686, 0.5679, 0.7484, 0.5876]}, {"w": "a", "b": [0.7547, 0.5679, 0.7659, 0.5876]}, {"w": "model", "b": [0.7722, 0.5679, 0.8353, 0.5876]}, {"w": "that", "b": [0.1294, 0.5884, 0.1673, 0.6081]}, {"w": "overfits.", "b": [0.1736, 0.5884, 0.2569, 0.6081]}, {"w": "This", "b": [0.2632, 0.5884, 0.3081, 0.6081]}, {"w": "is", "b": [0.3144, 0.5884, 0.3312, 0.6081]}, {"w": "fairly", "b": [0.3375, 0.5884, 0.3922, 0.6081]}, {"w": "easy:", "b": [0.3985, 0.5884, 0.4503, 0.6081]}]}, {"id": "b_10", "type": "paragraph", "text": "1. Add layers. 2. Make the layers bigger. 3. Train for more epochs.", "words": [{"w": "1.", "b": [0.1551, 0.6267, 0.174, 0.6464]}, {"w": "Add", "b": [0.1799, 0.6267, 0.2233, 0.6464]}, {"w": "layers.", "b": [0.2296, 0.6267, 0.2962, 0.6464]}, {"w": "2.", "b": [0.1551, 0.6472, 0.174, 0.6669]}, {"w": "Make", "b": [0.1799, 0.6472, 0.2373, 0.6669]}, {"w": "the", "b": [0.2436, 0.6472, 0.2744, 0.6669]}, {"w": "layers", "b": [0.2807, 0.6472, 0.341, 0.6669]}, {"w": "bigger.", "b": [0.3473, 0.6472, 0.4166, 0.6669]}, {"w": "3.", "b": [0.1551, 0.6677, 0.174, 0.6874]}, {"w": "Train", "b": [0.1799, 0.6677, 0.2336, 0.6874]}, {"w": "for", "b": [0.2399, 0.6677, 0.2693, 0.6874]}, {"w": "more", "b": [0.2756, 0.6677, 0.3275, 0.6874]}, {"w": "epochs.", "b": [0.3338, 0.6677, 0.4101, 0.6874]}]}, {"id": "b_11", "type": "paragraph", "text": "Always monitor the training loss and validation loss, as well as the training and validation values for any metrics you care about. When you see that the model’s performance on the validation data begins to degrade, you’ve achieved overfitting.", "words": [{"w": "Always", "b": [0.1294, 0.7105, 0.2065, 0.7302]}, {"w": "monitor", "b": [0.2128, 0.7105, 0.2927, 0.7302]}, {"w": "the", "b": [0.299, 0.7105, 0.3298, 0.7302]}, {"w": "training", "b": [0.3361, 0.7105, 0.4146, 0.7302]}, {"w": "loss", "b": [0.4209, 0.7105, 0.4601, 0.7302]}, {"w": "and", "b": [0.4665, 0.7105, 0.5029, 0.7302]}, {"w": "validation", "b": [0.5092, 0.7105, 0.6101, 0.7302]}, {"w": "loss,", "b": [0.6164, 0.7105, 0.662, 0.7302]}, {"w": "as", "b": [0.6683, 0.7105, 0.6893, 0.7302]}, {"w": "well", "b": [0.6956, 0.7105, 0.739, 0.7302]}, {"w": "as", "b": [0.7453, 0.7105, 0.7663, 0.7302]}, {"w": "the", "b": [0.7726, 0.7105, 0.8035, 0.7302]}, {"w": "training", "b": [0.1294, 0.731, 0.2079, 0.7507]}, {"w": "and", "b": [0.2142, 0.731, 0.2506, 0.7507]}, {"w": "validation", "b": [0.2569, 0.731, 0.3578, 0.7507]}, {"w": "values", "b": [0.3641, 0.731, 0.4286, 0.7507]}, {"w": "for", "b": [0.4349, 0.731, 0.4643, 0.7507]}, {"w": "any", "b": [0.4706, 0.731, 0.507, 0.7507]}, {"w": "metrics", "b": [0.5133, 0.731, 0.5876, 0.7507]}, {"w": "you", "b": [0.5939, 0.731, 0.6318, 0.7507]}, {"w": "care", "b": [0.6381, 0.731, 0.6801, 0.7507]}, {"w": "about.", "b": [0.6863, 0.731, 0.7486, 0.7507]}, {"w": "When", "b": [0.7549, 0.731, 0.8152, 0.7507]}, {"w": "you", "b": [0.8215, 0.731, 0.8593, 0.7507]}, {"w": "see", "b": [0.1294, 0.7515, 0.1616, 0.7712]}, {"w": "that", "b": [0.1679, 0.7515, 0.2058, 0.7712]}, {"w": "the", "b": [0.2121, 0.7515, 0.2429, 0.7712]}, {"w": "model’s", "b": [0.2492, 0.7515, 0.3291, 0.7712]}, {"w": "performance", "b": [0.3354, 0.7515, 0.4628, 0.7712]}, {"w": "on", "b": [0.4691, 0.7515, 0.4944, 0.7712]}, {"w": "the", "b": [0.5007, 0.7515, 0.5315, 0.7712]}, {"w": "validation", "b": [0.5378, 0.7515, 0.6387, 0.7712]}, {"w": "data", "b": [0.645, 0.7515, 0.687, 0.7712]}, {"w": "begins", "b": [0.6933, 0.7515, 0.7592, 0.7712]}, {"w": "to", "b": [0.7655, 0.7515, 0.7851, 0.7712]}, {"w": "degrade,", "b": [0.1294, 0.772, 0.2156, 0.7917]}, {"w": "you’ve", "b": [0.2219, 0.772, 0.2919, 0.7917]}, {"w": "achieved", "b": [0.2982, 0.772, 0.3879, 0.7917]}, {"w": "overfitting.", "b": [0.3942, 0.772, 0.507, 0.7917]}]}, {"id": "b_12", "type": "paragraph", "text": "The next stage is to start regularizing and tuning the model, to get as close as possible to the ideal model that neither underfits nor overfits.", "words": [{"w": "The", "b": [0.1294, 0.8148, 0.1686, 0.8345]}, {"w": "next", "b": [0.1749, 0.8148, 0.2184, 0.8345]}, {"w": "stage", "b": [0.2247, 0.8148, 0.2765, 0.8345]}, {"w": "is", "b": [0.2828, 0.8148, 0.2997, 0.8345]}, {"w": "to", "b": [0.306, 0.8148, 0.3256, 0.8345]}, {"w": "start", "b": [0.3319, 0.8148, 0.3753, 0.8345]}, {"w": "regularizing", "b": [0.3816, 0.8148, 0.5035, 0.8345]}, {"w": "and", "b": [0.5098, 0.8148, 0.5463, 0.8345]}, {"w": "tuning", "b": [0.5526, 0.8148, 0.6171, 0.8345]}, {"w": "the", "b": [0.6234, 0.8148, 0.6542, 0.8345]}, {"w": "model,", "b": [0.6605, 0.8148, 0.7299, 0.8345]}, {"w": "to", "b": [0.7362, 0.8148, 0.7558, 0.8345]}, {"w": "get", "b": [0.7621, 0.8148, 0.7929, 0.8345]}, {"w": "as", "b": [0.7992, 0.8148, 0.8202, 0.8345]}, {"w": "close", "b": [0.1294, 0.8353, 0.1813, 0.855]}, {"w": "as", "b": [0.1876, 0.8353, 0.2086, 0.855]}, {"w": "possible", "b": [0.2149, 0.8353, 0.2976, 0.855]}, {"w": "to", "b": [0.3039, 0.8353, 0.3235, 0.855]}, {"w": "the", "b": [0.3298, 0.8353, 0.3606, 0.855]}, {"w": "ideal", "b": [0.3669, 0.8353, 0.416, 0.855]}, {"w": "model", "b": [0.4223, 0.8353, 0.4853, 0.855]}, {"w": "that", "b": [0.4917, 0.8353, 0.5295, 0.855]}, {"w": "neither", "b": [0.5358, 0.8353, 0.6059, 0.855]}, {"w": "underfits", "b": [0.6121, 0.8353, 0.7017, 0.855]}, {"w": "nor", "b": [0.7081, 0.8353, 0.7417, 0.855]}, {"w": "overfits.", "b": [0.748, 0.8353, 0.8314, 0.855]}]}, {"id": "b_13", "type": "paragraph", "text": "4.5.7. Regularizing your model and tuning your hyperparameters", "words": [{"w": "4.5.7.", "b": [0.1294, 0.8825, 0.1862, 0.9023]}, {"w": "Regularizing", "b": [0.1925, 0.8825, 0.3312, 0.9023]}, {"w": "your", "b": [0.3375, 0.8825, 0.388, 0.9023]}, {"w": "model", "b": [0.3943, 0.8825, 0.4601, 0.9023]}, {"w": "and", "b": [0.4665, 0.8825, 0.5071, 0.9023]}, {"w": "tuning", "b": [0.5134, 0.8825, 0.5835, 0.9023]}, {"w": "your", "b": [0.5898, 0.8825, 0.6403, 0.9023]}, {"w": "hyperparameters", "b": [0.6466, 0.8825, 0.8329, 0.9023]}]}]}, {"page": 168, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This step will take the most time: you’ll repeatedly modify your model, train it, evaluate on your validation data (not the test data, at this point), modify it again, and repeat, until the model is as good as it can get. These are some things you should try:", "words": [{"w": "This", "b": [0.1294, 0.0857, 0.1743, 0.1054]}, {"w": "step", "b": [0.1806, 0.0857, 0.2212, 0.1054]}, {"w": "will", "b": [0.2275, 0.0857, 0.2668, 0.1054]}, {"w": "take", "b": [0.2731, 0.0857, 0.3151, 0.1054]}, {"w": "the", "b": [0.3214, 0.0857, 0.3522, 0.1054]}, {"w": "most", "b": [0.3585, 0.0857, 0.4076, 0.1054]}, {"w": "time:", "b": [0.4139, 0.0857, 0.4658, 0.1054]}, {"w": "you’ll", "b": [0.4721, 0.0857, 0.5323, 0.1054]}, {"w": "repeatedly", "b": [0.5386, 0.0857, 0.6437, 0.1054]}, {"w": "modify", "b": [0.65, 0.0857, 0.7229, 0.1054]}, {"w": "your", "b": [0.7292, 0.0857, 0.7754, 0.1054]}, {"w": "model,", "b": [0.7818, 0.0857, 0.8511, 0.1054]}, {"w": "train", "b": [0.1294, 0.1062, 0.1757, 0.1259]}, {"w": "it,", "b": [0.182, 0.1062, 0.2023, 0.1259]}, {"w": "evaluate", "b": [0.2086, 0.1062, 0.2926, 0.1259]}, {"w": "on", "b": [0.299, 0.1062, 0.3242, 0.1259]}, {"w": "your", "b": [0.3305, 0.1062, 0.3767, 0.1259]}, {"w": "validation", "b": [0.383, 0.1062, 0.4839, 0.1259]}, {"w": "data", "b": [0.4902, 0.1062, 0.5323, 0.1259]}, {"w": "(not", "b": [0.5386, 0.1062, 0.5792, 0.1259]}, {"w": "the", "b": [0.5855, 0.1062, 0.6163, 0.1259]}, {"w": "test", "b": [0.6226, 0.1062, 0.6576, 0.1259]}, {"w": "data,", "b": [0.6639, 0.1062, 0.7122, 0.1259]}, {"w": "at", "b": [0.7185, 0.1062, 0.7368, 0.1259]}, {"w": "this", "b": [0.7431, 0.1062, 0.7795, 0.1259]}, {"w": "point),", "b": [0.7858, 0.1062, 0.8524, 0.1259]}, {"w": "modify", "b": [0.1294, 0.1267, 0.2023, 0.1464]}, {"w": "it", "b": [0.2086, 0.1267, 0.2226, 0.1464]}, {"w": "again,", "b": [0.2289, 0.1267, 0.2899, 0.1464]}, {"w": "and", "b": [0.2962, 0.1267, 0.3326, 0.1464]}, {"w": "repeat,", "b": [0.3389, 0.1267, 0.4068, 0.1464]}, {"w": "until", "b": [0.4132, 0.1267, 0.4594, 0.1464]}, {"w": "the", "b": [0.4657, 0.1267, 0.4965, 0.1464]}, {"w": "model", "b": [0.5029, 0.1267, 0.5659, 0.1464]}, {"w": "is", "b": [0.5722, 0.1267, 0.5891, 0.1464]}, {"w": "as", "b": [0.5954, 0.1267, 0.6164, 0.1464]}, {"w": "good", "b": [0.6227, 0.1267, 0.6731, 0.1464]}, {"w": "as", "b": [0.6794, 0.1267, 0.7004, 0.1464]}, {"w": "it", "b": [0.7068, 0.1267, 0.7208, 0.1464]}, {"w": "can", "b": [0.7271, 0.1267, 0.7621, 0.1464]}, {"w": "get.", "b": [0.7684, 0.1267, 0.8055, 0.1464]}, {"w": "These", "b": [0.1294, 0.1472, 0.1897, 0.1669]}, {"w": "are", "b": [0.196, 0.1472, 0.2268, 0.1669]}, {"w": "some", "b": [0.2331, 0.1472, 0.2863, 0.1669]}, {"w": "things", "b": [0.2926, 0.1472, 0.3543, 0.1669]}, {"w": "you", "b": [0.3606, 0.1472, 0.3984, 0.1669]}, {"w": "should", "b": [0.4047, 0.1472, 0.472, 0.1669]}, {"w": "try:", "b": [0.4783, 0.1472, 0.5133, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Add dropout. Try different architectures: add or remove layers. Add L1 and/or L2 regularization. Try different hyperparameters (such as the number of units per layer or the learning rate of the optimizer) to find the optimal configuration. Optionally, iterate on feature engineering: add new features, or remove features that don’t seem to be informative.", "words": [{"w": "Add", "b": [0.1799, 0.1855, 0.2233, 0.2052]}, {"w": "dropout.", "b": [0.2296, 0.1855, 0.3144, 0.2052]}, {"w": "Try", "b": [0.1799, 0.206, 0.2154, 0.2257]}, {"w": "different", "b": [0.2217, 0.206, 0.3081, 0.2257]}, {"w": "architectures:", "b": [0.3144, 0.206, 0.4503, 0.2257]}, {"w": "add", "b": [0.4566, 0.206, 0.493, 0.2257]}, {"w": "or", "b": [0.4993, 0.206, 0.5203, 0.2257]}, {"w": "remove", "b": [0.5267, 0.206, 0.6023, 0.2257]}, {"w": "layers.", "b": [0.6086, 0.206, 0.6752, 0.2257]}, {"w": "Add", "b": [0.1799, 0.2265, 0.2233, 0.2462]}, {"w": "L1", "b": [0.2296, 0.2265, 0.2576, 0.2462]}, {"w": "and/or", "b": [0.2639, 0.2265, 0.3284, 0.2462]}, {"w": "L2", "b": [0.3347, 0.2265, 0.3627, 0.2462]}, {"w": "regularization.", "b": [0.369, 0.2265, 0.5154, 0.2462]}, {"w": "Try", "b": [0.1799, 0.247, 0.2154, 0.2667]}, {"w": "different", "b": [0.2217, 0.247, 0.3081, 0.2667]}, {"w": "hyperparameters", "b": [0.3144, 0.247, 0.4825, 0.2667]}, {"w": "(such", "b": [0.4888, 0.247, 0.5435, 0.2667]}, {"w": "as", "b": [0.5498, 0.247, 0.5708, 0.2667]}, {"w": "the", "b": [0.5771, 0.247, 0.6079, 0.2667]}, {"w": "number", "b": [0.6142, 0.247, 0.6913, 0.2667]}, {"w": "of", "b": [0.6976, 0.247, 0.7186, 0.2667]}, {"w": "units", "b": [0.7249, 0.247, 0.774, 0.2667]}, {"w": "per", "b": [0.7803, 0.247, 0.8125, 0.2667]}, {"w": "layer", "b": [0.8188, 0.247, 0.8692, 0.2667]}, {"w": "or", "b": [0.1799, 0.2675, 0.2009, 0.2872]}, {"w": "the", "b": [0.2072, 0.2675, 0.238, 0.2872]}, {"w": "learning", "b": [0.2443, 0.2675, 0.327, 0.2872]}, {"w": "rate", "b": [0.3333, 0.2675, 0.3711, 0.2872]}, {"w": "of", "b": [0.3774, 0.2675, 0.3984, 0.2872]}, {"w": "the", "b": [0.4047, 0.2675, 0.4356, 0.2872]}, {"w": "optimizer)", "b": [0.4419, 0.2675, 0.5469, 0.2872]}, {"w": "to", "b": [0.5533, 0.2675, 0.5729, 0.2872]}, {"w": "find", "b": [0.5792, 0.2675, 0.6198, 0.2872]}, {"w": "the", "b": [0.6261, 0.2675, 0.657, 0.2872]}, {"w": "optimal", "b": [0.6633, 0.2675, 0.7404, 0.2872]}, {"w": "configuration.", "b": [0.1799, 0.288, 0.3221, 0.3077]}, {"w": "Optionally,", "b": [0.1799, 0.3085, 0.2924, 0.3282]}, {"w": "iterate", "b": [0.2987, 0.3085, 0.3618, 0.3282]}, {"w": "on", "b": [0.3681, 0.3085, 0.3933, 0.3282]}, {"w": "feature", "b": [0.3996, 0.3085, 0.4696, 0.3282]}, {"w": "engineering:", "b": [0.4759, 0.3085, 0.6021, 0.3282]}, {"w": "add", "b": [0.6084, 0.3085, 0.6448, 0.3282]}, {"w": "new", "b": [0.6511, 0.3085, 0.6931, 0.3282]}, {"w": "features,", "b": [0.6994, 0.3085, 0.7856, 0.3282]}, {"w": "or", "b": [0.7919, 0.3085, 0.8129, 0.3282]}, {"w": "remove", "b": [0.1799, 0.329, 0.2555, 0.3487]}, {"w": "features", "b": [0.2618, 0.329, 0.3417, 0.3487]}, {"w": "that", "b": [0.348, 0.329, 0.3858, 0.3487]}, {"w": "don’t", "b": [0.3921, 0.329, 0.4449, 0.3487]}, {"w": "seem", "b": [0.4512, 0.329, 0.503, 0.3487]}, {"w": "to", "b": [0.5093, 0.329, 0.529, 0.3487]}, {"w": "be", "b": [0.5353, 0.329, 0.5591, 0.3487]}, {"w": "informative.", "b": [0.5654, 0.329, 0.6894, 0.3487]}]}, {"id": "b_2", "type": "paragraph", "text": "Be mindful of the following: every time you use feedback from your validation process to tune your model, you leak information about the validation process into the model. Repeated just a few times, this is innocuous; but done systematically over many iterations, it will eventually cause your model to overfit to the validation process (even though no model is directly trained on any of the validation data). This makes the evaluation process less reliable.", "words": [{"w": "Be", "b": [0.1294, 0.3718, 0.1574, 0.3915]}, {"w": "mindful", "b": [0.1637, 0.3718, 0.2436, 0.3915]}, {"w": "of", "b": [0.2499, 0.3718, 0.271, 0.3915]}, {"w": "the", "b": [0.2773, 0.3718, 0.3081, 0.3915]}, {"w": "following:", "b": [0.3144, 0.3718, 0.4195, 0.3915]}, {"w": "every", "b": [0.4258, 0.3718, 0.4818, 0.3915]}, {"w": "time", "b": [0.4881, 0.3718, 0.533, 0.3915]}, {"w": "you", "b": [0.5393, 0.3718, 0.5771, 0.3915]}, {"w": "use", "b": [0.5835, 0.3718, 0.6171, 0.3915]}, {"w": "feedback", "b": [0.6234, 0.3718, 0.7144, 0.3915]}, {"w": "from", "b": [0.7207, 0.3718, 0.7698, 0.3915]}, {"w": "your", "b": [0.7761, 0.3718, 0.8223, 0.3915]}, {"w": "validation", "b": [0.1294, 0.3923, 0.2303, 0.412]}, {"w": "process", "b": [0.2366, 0.3923, 0.3123, 0.412]}, {"w": "to", "b": [0.3186, 0.3923, 0.3382, 0.412]}, {"w": "tune", "b": [0.3445, 0.3923, 0.388, 0.412]}, {"w": "your", "b": [0.3943, 0.3923, 0.4405, 0.412]}, {"w": "model,", "b": [0.4468, 0.3923, 0.5162, 0.412]}, {"w": "you", "b": [0.5225, 0.3923, 0.5603, 0.412]}, {"w": "leak", "b": [0.5666, 0.3923, 0.6087, 0.412]}, {"w": "information", "b": [0.615, 0.3923, 0.7341, 0.412]}, {"w": "about", "b": [0.7403, 0.3923, 0.7963, 0.412]}, {"w": "the", "b": [0.8026, 0.3923, 0.8335, 0.412]}, {"w": "validation", "b": [0.1294, 0.4128, 0.2303, 0.4325]}, {"w": "process", "b": [0.2366, 0.4128, 0.3123, 0.4325]}, {"w": "into", "b": [0.3186, 0.4128, 0.3578, 0.4325]}, {"w": "the", "b": [0.3641, 0.4128, 0.395, 0.4325]}, {"w": "model.", "b": [0.4013, 0.4128, 0.4706, 0.4325]}, {"w": "Repeated", "b": [0.4769, 0.4128, 0.5708, 0.4325]}, {"w": "just", "b": [0.5771, 0.4128, 0.6136, 0.4325]}, {"w": "a", "b": [0.6199, 0.4128, 0.6311, 0.4325]}, {"w": "few", "b": [0.6374, 0.4128, 0.6752, 0.4325]}, {"w": "times,", "b": [0.6815, 0.4128, 0.7425, 0.4325]}, {"w": "this", "b": [0.7488, 0.4128, 0.7852, 0.4325]}, {"w": "is", "b": [0.7915, 0.4128, 0.8084, 0.4325]}, {"w": "innocuous;", "b": [0.1294, 0.4333, 0.2401, 0.453]}, {"w": "but", "b": [0.2464, 0.4333, 0.2787, 0.453]}, {"w": "done", "b": [0.285, 0.4333, 0.334, 0.453]}, {"w": "systematically", "b": [0.3403, 0.4333, 0.4847, 0.453]}, {"w": "over", "b": [0.491, 0.4333, 0.5358, 0.453]}, {"w": "many", "b": [0.5421, 0.4333, 0.5982, 0.453]}, {"w": "iterations,", "b": [0.6044, 0.4333, 0.7046, 0.453]}, {"w": "it", "b": [0.7109, 0.4333, 0.7249, 0.453]}, {"w": "will", "b": [0.7312, 0.4333, 0.7705, 0.453]}, {"w": "eventually", "b": [0.1294, 0.4538, 0.2345, 0.4735]}, {"w": "cause", "b": [0.2408, 0.4538, 0.2968, 0.4735]}, {"w": "your", "b": [0.3031, 0.4538, 0.3494, 0.4735]}, {"w": "model", "b": [0.3557, 0.4538, 0.4188, 0.4735]}, {"w": "to", "b": [0.4251, 0.4538, 0.4447, 0.4735]}, {"w": "overfit", "b": [0.451, 0.4538, 0.5182, 0.4735]}, {"w": "to", "b": [0.5245, 0.4538, 0.5442, 0.4735]}, {"w": "the", "b": [0.5505, 0.4538, 0.5813, 0.4735]}, {"w": "validation", "b": [0.5876, 0.4538, 0.6885, 0.4735]}, {"w": "process", "b": [0.6948, 0.4538, 0.7705, 0.4735]}, {"w": "(even", "b": [0.7768, 0.4538, 0.8328, 0.4735]}, {"w": "though", "b": [0.1294, 0.4743, 0.1995, 0.494]}, {"w": "no", "b": [0.2058, 0.4743, 0.231, 0.494]}, {"w": "model", "b": [0.2373, 0.4743, 0.3004, 0.494]}, {"w": "is", "b": [0.3067, 0.4743, 0.3235, 0.494]}, {"w": "directly", "b": [0.3298, 0.4743, 0.4069, 0.494]}, {"w": "trained", "b": [0.4132, 0.4743, 0.4833, 0.494]}, {"w": "on", "b": [0.4895, 0.4743, 0.5147, 0.494]}, {"w": "any", "b": [0.521, 0.4743, 0.5574, 0.494]}, {"w": "of", "b": [0.5638, 0.4743, 0.5848, 0.494]}, {"w": "the", "b": [0.5911, 0.4743, 0.6219, 0.494]}, {"w": "validation", "b": [0.6282, 0.4743, 0.7291, 0.494]}, {"w": "data).", "b": [0.7354, 0.4743, 0.7921, 0.494]}, {"w": "This", "b": [0.7985, 0.4743, 0.8433, 0.494]}, {"w": "makes", "b": [0.1294, 0.4948, 0.1939, 0.5145]}, {"w": "the", "b": [0.2002, 0.4948, 0.231, 0.5145]}, {"w": "evaluation", "b": [0.2373, 0.4948, 0.3424, 0.5145]}, {"w": "process", "b": [0.3487, 0.4948, 0.4244, 0.5145]}, {"w": "less", "b": [0.4307, 0.4948, 0.4685, 0.5145]}, {"w": "reliable.", "b": [0.4748, 0.4948, 0.5568, 0.5145]}]}, {"id": "b_3", "type": "paragraph", "text": "Once you’ve developed a satisfactory model configuration, you can train your final production model on all the available data (training and validation) and evaluate it one last time on the test set. If it turns out that performance on the test set is significantly worse than the performance measured on the validation data, this may mean either that your validation procedure wasn’t reliable after all, or that you began overfitting to the validation data while tuning the parameters of the model. In this case, you may want to switch to a more reliable evaluation protocol (such as iterated K-fold validation).", "words": [{"w": "Once", "b": [0.1294, 0.5376, 0.1826, 0.5573]}, {"w": "you’ve", "b": [0.1889, 0.5376, 0.259, 0.5573]}, {"w": "developed", "b": [0.2653, 0.5376, 0.369, 0.5573]}, {"w": "a", "b": [0.3753, 0.5376, 0.3865, 0.5573]}, {"w": "satisfactory", "b": [0.3928, 0.5376, 0.5091, 0.5573]}, {"w": "model", "b": [0.5154, 0.5376, 0.5785, 0.5573]}, {"w": "configuration,", "b": [0.5848, 0.5376, 0.727, 0.5573]}, {"w": "you", "b": [0.7333, 0.5376, 0.7711, 0.5573]}, {"w": "can", "b": [0.7774, 0.5376, 0.8124, 0.5573]}, {"w": "train", "b": [0.8188, 0.5376, 0.865, 0.5573]}, {"w": "your", "b": [0.1294, 0.5581, 0.1757, 0.5778]}, {"w": "final", "b": [0.182, 0.5581, 0.2282, 0.5778]}, {"w": "production", "b": [0.2345, 0.5581, 0.3438, 0.5778]}, {"w": "model", "b": [0.3501, 0.5581, 0.4132, 0.5778]}, {"w": "on", "b": [0.4195, 0.5581, 0.4447, 0.5778]}, {"w": "all", "b": [0.451, 0.5581, 0.4762, 0.5778]}, {"w": "the", "b": [0.4825, 0.5581, 0.5134, 0.5778]}, {"w": "available", "b": [0.5197, 0.5581, 0.6107, 0.5778]}, {"w": "data", "b": [0.6171, 0.5581, 0.6591, 0.5778]}, {"w": "(training", "b": [0.6653, 0.5581, 0.7522, 0.5778]}, {"w": "and", "b": [0.7585, 0.5581, 0.7949, 0.5778]}, {"w": "validation)", "b": [0.1294, 0.5786, 0.2387, 0.5983]}, {"w": "and", "b": [0.245, 0.5786, 0.2814, 0.5983]}, {"w": "evaluate", "b": [0.2878, 0.5786, 0.3718, 0.5983]}, {"w": "it", "b": [0.3781, 0.5786, 0.3921, 0.5983]}, {"w": "one", "b": [0.3984, 0.5786, 0.4349, 0.5983]}, {"w": "last", "b": [0.4412, 0.5786, 0.4762, 0.5983]}, {"w": "time", "b": [0.4825, 0.5786, 0.5274, 0.5983]}, {"w": "on", "b": [0.5337, 0.5786, 0.5589, 0.5983]}, {"w": "the", "b": [0.5652, 0.5786, 0.596, 0.5983]}, {"w": "test", "b": [0.6023, 0.5786, 0.6374, 0.5983]}, {"w": "set.", "b": [0.6437, 0.5786, 0.678, 0.5983]}, {"w": "If", "b": [0.6843, 0.5786, 0.7011, 0.5983]}, {"w": "it", "b": [0.7074, 0.5786, 0.7215, 0.5983]}, {"w": "turns", "b": [0.7278, 0.5786, 0.7782, 0.5983]}, {"w": "out", "b": [0.7845, 0.5786, 0.8168, 0.5983]}, {"w": "that", "b": [0.8231, 0.5786, 0.8609, 0.5983]}, {"w": "performance", "b": [0.1294, 0.5991, 0.2569, 0.6188]}, {"w": "on", "b": [0.2632, 0.5991, 0.2884, 0.6188]}, {"w": "the", "b": [0.2947, 0.5991, 0.3255, 0.6188]}, {"w": "test", "b": [0.3318, 0.5991, 0.3669, 0.6188]}, {"w": "set", "b": [0.3732, 0.5991, 0.4012, 0.6188]}, {"w": "is", "b": [0.4075, 0.5991, 0.4243, 0.6188]}, {"w": "significantly", "b": [0.4306, 0.5991, 0.5567, 0.6188]}, {"w": "worse", "b": [0.5631, 0.5991, 0.6233, 0.6188]}, {"w": "than", "b": [0.6296, 0.5991, 0.673, 0.6188]}, {"w": "the", "b": [0.6793, 0.5991, 0.7102, 0.6188]}, {"w": "performance", "b": [0.7165, 0.5991, 0.8439, 0.6188]}, {"w": "measured", "b": [0.1294, 0.6196, 0.2261, 0.6393]}, {"w": "on", "b": [0.2324, 0.6196, 0.2576, 0.6393]}, {"w": "the", "b": [0.2639, 0.6196, 0.2947, 0.6393]}, {"w": "validation", "b": [0.301, 0.6196, 0.402, 0.6393]}, {"w": "data,", "b": [0.4083, 0.6196, 0.4566, 0.6393]}, {"w": "this", "b": [0.4629, 0.6196, 0.4993, 0.6393]}, {"w": "may", "b": [0.5057, 0.6196, 0.5491, 0.6393]}, {"w": "mean", "b": [0.5554, 0.6196, 0.61, 0.6393]}, {"w": "either", "b": [0.6163, 0.6196, 0.6738, 0.6393]}, {"w": "that", "b": [0.6801, 0.6196, 0.7179, 0.6393]}, {"w": "your", "b": [0.7242, 0.6196, 0.7705, 0.6393]}, {"w": "validation", "b": [0.1294, 0.6401, 0.2303, 0.6598]}, {"w": "procedure", "b": [0.2366, 0.6401, 0.3375, 0.6598]}, {"w": "wasn’t", "b": [0.3437, 0.6401, 0.4105, 0.6598]}, {"w": "reliable", "b": [0.4168, 0.6401, 0.4925, 0.6598]}, {"w": "after", "b": [0.4988, 0.6401, 0.545, 0.6598]}, {"w": "all,", "b": [0.5513, 0.6401, 0.5829, 0.6598]}, {"w": "or", "b": [0.5892, 0.6401, 0.6102, 0.6598]}, {"w": "that", "b": [0.6165, 0.6401, 0.6543, 0.6598]}, {"w": "you", "b": [0.6606, 0.6401, 0.6985, 0.6598]}, {"w": "began", "b": [0.7048, 0.6401, 0.765, 0.6598]}, {"w": "overfitting", "b": [0.1294, 0.6606, 0.2359, 0.6803]}, {"w": "to", "b": [0.2422, 0.6606, 0.2618, 0.6803]}, {"w": "the", "b": [0.2682, 0.6606, 0.299, 0.6803]}, {"w": "validation", "b": [0.3053, 0.6606, 0.4062, 0.6803]}, {"w": "data", "b": [0.4125, 0.6606, 0.4545, 0.6803]}, {"w": "while", "b": [0.4608, 0.6606, 0.5169, 0.6803]}, {"w": "tuning", "b": [0.5232, 0.6606, 0.5877, 0.6803]}, {"w": "the", "b": [0.594, 0.6606, 0.6248, 0.6803]}, {"w": "parameters", "b": [0.6311, 0.6606, 0.7418, 0.6803]}, {"w": "of", "b": [0.7481, 0.6606, 0.7691, 0.6803]}, {"w": "the", "b": [0.7754, 0.6606, 0.8062, 0.6803]}, {"w": "model.", "b": [0.1294, 0.6811, 0.1988, 0.7008]}, {"w": "In", "b": [0.2051, 0.6811, 0.2261, 0.7008]}, {"w": "this", "b": [0.2324, 0.6811, 0.2688, 0.7008]}, {"w": "case,", "b": [0.2751, 0.6811, 0.3249, 0.7008]}, {"w": "you", "b": [0.3312, 0.6811, 0.369, 0.7008]}, {"w": "may", "b": [0.3753, 0.6811, 0.4188, 0.7008]}, {"w": "want", "b": [0.4251, 0.6811, 0.4741, 0.7008]}, {"w": "to", "b": [0.4804, 0.6811, 0.5, 0.7008]}, {"w": "switch", "b": [0.5063, 0.6811, 0.5722, 0.7008]}, {"w": "to", "b": [0.5785, 0.6811, 0.5981, 0.7008]}, {"w": "a", "b": [0.6044, 0.6811, 0.6156, 0.7008]}, {"w": "more", "b": [0.622, 0.6811, 0.6738, 0.7008]}, {"w": "reliable", "b": [0.6801, 0.6811, 0.7557, 0.7008]}, {"w": "evaluation", "b": [0.7621, 0.6811, 0.8671, 0.7008]}, {"w": "protocol", "b": [0.1294, 0.7016, 0.2135, 0.7213]}, {"w": "(such", "b": [0.2198, 0.7016, 0.2744, 0.7213]}, {"w": "as", "b": [0.2807, 0.7016, 0.3018, 0.7213]}, {"w": "iterated", "b": [0.3081, 0.7016, 0.3837, 0.7213]}, {"w": "K-fold", "b": [0.39, 0.7016, 0.4573, 0.7213]}, {"w": "validation).", "b": [0.4636, 0.7016, 0.5792, 0.7213]}]}, {"id": "b_4", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1294, 0.7533, 0.2191, 0.773]}, {"w": "summary", "b": [0.2254, 0.7533, 0.3277, 0.773]}]}, {"id": "b_5", "type": "paragraph", "text": "Define the problem at hand and the data on which you’ll train. Collect this data, or annotate it with labels if need be. Choose how you’ll measure success on your problem. Which metrics will you monitor on your validation data? Determine your evaluation protocol: hold-out validation? K-fold validation? Which portion of the data should you use for validation?", "words": [{"w": "Define", "b": [0.1799, 0.7916, 0.2485, 0.8113]}, {"w": "the", "b": [0.2548, 0.7916, 0.2856, 0.8113]}, {"w": "problem", "b": [0.2919, 0.7916, 0.376, 0.8113]}, {"w": "at", "b": [0.3823, 0.7916, 0.4005, 0.8113]}, {"w": "hand", "b": [0.4068, 0.7916, 0.4559, 0.8113]}, {"w": "and", "b": [0.4622, 0.7916, 0.4986, 0.8113]}, {"w": "the", "b": [0.5049, 0.7916, 0.5357, 0.8113]}, {"w": "data", "b": [0.5421, 0.7916, 0.5841, 0.8113]}, {"w": "on", "b": [0.5904, 0.7916, 0.6156, 0.8113]}, {"w": "which", "b": [0.6219, 0.7916, 0.6836, 0.8113]}, {"w": "you’ll", "b": [0.6899, 0.7916, 0.7501, 0.8113]}, {"w": "train.", "b": [0.7564, 0.7916, 0.809, 0.8113]}, {"w": "Collect", "b": [0.1799, 0.8121, 0.2527, 0.8318]}, {"w": "this", "b": [0.259, 0.8121, 0.2955, 0.8318]}, {"w": "data,", "b": [0.3018, 0.8121, 0.3501, 0.8318]}, {"w": "or", "b": [0.3564, 0.8121, 0.3775, 0.8318]}, {"w": "annotate", "b": [0.3838, 0.8121, 0.4692, 0.8318]}, {"w": "it", "b": [0.4755, 0.8121, 0.4896, 0.8318]}, {"w": "with", "b": [0.4959, 0.8121, 0.5407, 0.8318]}, {"w": "labels", "b": [0.547, 0.8121, 0.6059, 0.8318]}, {"w": "if", "b": [0.6122, 0.8121, 0.6276, 0.8318]}, {"w": "need", "b": [0.6339, 0.8121, 0.6815, 0.8318]}, {"w": "be.", "b": [0.6878, 0.8121, 0.718, 0.8318]}, {"w": "Choose", "b": [0.1799, 0.8326, 0.2555, 0.8523]}, {"w": "how", "b": [0.2618, 0.8326, 0.3053, 0.8523]}, {"w": "you’ll", "b": [0.3116, 0.8326, 0.3719, 0.8523]}, {"w": "measure", "b": [0.3782, 0.8326, 0.4622, 0.8523]}, {"w": "success", "b": [0.4685, 0.8326, 0.5442, 0.8523]}, {"w": "on", "b": [0.5505, 0.8326, 0.5757, 0.8523]}, {"w": "your", "b": [0.582, 0.8326, 0.6283, 0.8523]}, {"w": "problem.", "b": [0.6346, 0.8326, 0.7249, 0.8523]}, {"w": "Which", "b": [0.7312, 0.8326, 0.7985, 0.8523]}, {"w": "metrics", "b": [0.1799, 0.8531, 0.2541, 0.8728]}, {"w": "will", "b": [0.2604, 0.8531, 0.2997, 0.8728]}, {"w": "you", "b": [0.306, 0.8531, 0.3438, 0.8728]}, {"w": "monitor", "b": [0.3501, 0.8531, 0.43, 0.8728]}, {"w": "on", "b": [0.4363, 0.8531, 0.4616, 0.8728]}, {"w": "your", "b": [0.4679, 0.8531, 0.5141, 0.8728]}, {"w": "validation", "b": [0.5204, 0.8531, 0.6213, 0.8728]}, {"w": "data?", "b": [0.6276, 0.8531, 0.6808, 0.8728]}, {"w": "Determine", "b": [0.1799, 0.8736, 0.2863, 0.8933]}, {"w": "your", "b": [0.2926, 0.8736, 0.3389, 0.8933]}, {"w": "evaluation", "b": [0.3452, 0.8736, 0.4503, 0.8933]}, {"w": "protocol:", "b": [0.4566, 0.8736, 0.5477, 0.8933]}, {"w": "hold-out", "b": [0.554, 0.8736, 0.6395, 0.8933]}, {"w": "validation?", "b": [0.6458, 0.8736, 0.7579, 0.8933]}, {"w": "K-fold", "b": [0.7642, 0.8736, 0.8314, 0.8933]}, {"w": "validation?", "b": [0.1799, 0.8941, 0.292, 0.9138]}, {"w": "Which", "b": [0.2983, 0.8941, 0.3655, 0.9138]}, {"w": "portion", "b": [0.3718, 0.8941, 0.4447, 0.9138]}, {"w": "of", "b": [0.451, 0.8941, 0.472, 0.9138]}, {"w": "the", "b": [0.4783, 0.8941, 0.5092, 0.9138]}, {"w": "data", "b": [0.5155, 0.8941, 0.5575, 0.9138]}, {"w": "should", "b": [0.5638, 0.8941, 0.6311, 0.9138]}, {"w": "you", "b": [0.6374, 0.8941, 0.6752, 0.9138]}, {"w": "use", "b": [0.6815, 0.8941, 0.7152, 0.9138]}, {"w": "for", "b": [0.7215, 0.8941, 0.7509, 0.9138]}, {"w": "validation?", "b": [0.7572, 0.8941, 0.8693, 0.9138]}]}]}, {"page": 169, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Develop a first model that does better than a basic baseline: a model with statistical power. Develop a model that overfits. Regularize your model and tune its hyperparameters, based on performance on the validation data. A lot of machine-learning research tends to focus only on this step—but keep the big picture in mind.", "words": [{"w": "Develop", "b": [0.1799, 0.0857, 0.2653, 0.1054]}, {"w": "a", "b": [0.2716, 0.0857, 0.2828, 0.1054]}, {"w": "first", "b": [0.2891, 0.0857, 0.3298, 0.1054]}, {"w": "model", "b": [0.3361, 0.0857, 0.3992, 0.1054]}, {"w": "that", "b": [0.4055, 0.0857, 0.4433, 0.1054]}, {"w": "does", "b": [0.4496, 0.0857, 0.4958, 0.1054]}, {"w": "better", "b": [0.5021, 0.0857, 0.5596, 0.1054]}, {"w": "than", "b": [0.5659, 0.0857, 0.6093, 0.1054]}, {"w": "a", "b": [0.6156, 0.0857, 0.6268, 0.1054]}, {"w": "basic", "b": [0.6331, 0.0857, 0.685, 0.1054]}, {"w": "baseline:", "b": [0.6913, 0.0857, 0.781, 0.1054]}, {"w": "a", "b": [0.7873, 0.0857, 0.7985, 0.1054]}, {"w": "model", "b": [0.8048, 0.0857, 0.8678, 0.1054]}, {"w": "with", "b": [0.1799, 0.1062, 0.2247, 0.1259]}, {"w": "statistical", "b": [0.231, 0.1062, 0.3263, 0.1259]}, {"w": "power.", "b": [0.3326, 0.1062, 0.4006, 0.1259]}, {"w": "Develop", "b": [0.1799, 0.1267, 0.2653, 0.1464]}, {"w": "a", "b": [0.2716, 0.1267, 0.2828, 0.1464]}, {"w": "model", "b": [0.2891, 0.1267, 0.3522, 0.1464]}, {"w": "that", "b": [0.3585, 0.1267, 0.3964, 0.1464]}, {"w": "overfits.", "b": [0.4027, 0.1267, 0.486, 0.1464]}, {"w": "Regularize", "b": [0.1799, 0.1472, 0.2891, 0.1669]}, {"w": "your", "b": [0.2954, 0.1472, 0.3417, 0.1669]}, {"w": "model", "b": [0.348, 0.1472, 0.4111, 0.1669]}, {"w": "and", "b": [0.4174, 0.1472, 0.4538, 0.1669]}, {"w": "tune", "b": [0.4601, 0.1472, 0.5035, 0.1669]}, {"w": "its", "b": [0.5098, 0.1472, 0.5337, 0.1669]}, {"w": "hyperparameters,", "b": [0.54, 0.1472, 0.7144, 0.1669]}, {"w": "based", "b": [0.7207, 0.1472, 0.7781, 0.1669]}, {"w": "on", "b": [0.7844, 0.1472, 0.8097, 0.1669]}, {"w": "performance", "b": [0.1799, 0.1677, 0.3073, 0.1874]}, {"w": "on", "b": [0.3136, 0.1677, 0.3389, 0.1874]}, {"w": "the", "b": [0.3452, 0.1677, 0.376, 0.1874]}, {"w": "validation", "b": [0.3823, 0.1677, 0.4832, 0.1874]}, {"w": "data.", "b": [0.4895, 0.1677, 0.5378, 0.1874]}, {"w": "A", "b": [0.5441, 0.1677, 0.5624, 0.1874]}, {"w": "lot", "b": [0.5687, 0.1677, 0.5953, 0.1874]}, {"w": "of", "b": [0.6016, 0.1677, 0.6226, 0.1874]}, {"w": "machine-learning", "b": [0.6289, 0.1677, 0.8055, 0.1874]}, {"w": "research", "b": [0.1799, 0.1882, 0.2639, 0.2079]}, {"w": "tends", "b": [0.2702, 0.1882, 0.3234, 0.2079]}, {"w": "to", "b": [0.3298, 0.1882, 0.3494, 0.2079]}, {"w": "focus", "b": [0.3557, 0.1882, 0.4103, 0.2079]}, {"w": "only", "b": [0.4166, 0.1882, 0.4615, 0.2079]}, {"w": "on", "b": [0.4678, 0.1882, 0.493, 0.2079]}, {"w": "this", "b": [0.4993, 0.1882, 0.5358, 0.2079]}, {"w": "step—but", "b": [0.5421, 0.1882, 0.6402, 0.2079]}, {"w": "keep", "b": [0.6465, 0.1882, 0.6941, 0.2079]}, {"w": "the", "b": [0.7004, 0.1882, 0.7312, 0.2079]}, {"w": "big", "b": [0.7376, 0.1882, 0.7698, 0.2079]}, {"w": "picture", "b": [0.7761, 0.1882, 0.8462, 0.2079]}, {"w": "in", "b": [0.1799, 0.2087, 0.1995, 0.2284]}, {"w": "mind.", "b": [0.2058, 0.2087, 0.264, 0.2284]}]}]}, {"page": 170, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Part 2. Deep learning in practice", "words": [{"w": "Part", "b": [0.1294, 0.1076, 0.1969, 0.1355]}, {"w": "2.", "b": [0.2058, 0.1076, 0.2326, 0.1355]}, {"w": "Deep", "b": [0.2415, 0.1076, 0.3189, 0.1355]}, {"w": "learning", "b": [0.3278, 0.1076, 0.4549, 0.1355]}, {"w": "in", "b": [0.4638, 0.1076, 0.4936, 0.1355]}, {"w": "practice", "b": [0.5025, 0.1076, 0.6255, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapters 5–9 will help you gain practical intuition about how to solve real-world problems using deep learning, and will familiarize you with essential deep-learning best practices. Most of the code examples in the book are concentrated in this second half.", "words": [{"w": "Chapters", "b": [0.1294, 0.1588, 0.2191, 0.1785]}, {"w": "5–9", "b": [0.2254, 0.1588, 0.2632, 0.1785]}, {"w": "will", "b": [0.2695, 0.1588, 0.3088, 0.1785]}, {"w": "help", "b": [0.3151, 0.1588, 0.3585, 0.1785]}, {"w": "you", "b": [0.3648, 0.1588, 0.4027, 0.1785]}, {"w": "gain", "b": [0.409, 0.1588, 0.4524, 0.1785]}, {"w": "practical", "b": [0.4587, 0.1588, 0.5456, 0.1785]}, {"w": "intuition", "b": [0.5519, 0.1588, 0.6374, 0.1785]}, {"w": "about", "b": [0.6437, 0.1588, 0.6998, 0.1785]}, {"w": "how", "b": [0.7061, 0.1588, 0.7495, 0.1785]}, {"w": "to", "b": [0.7558, 0.1588, 0.7754, 0.1785]}, {"w": "solve", "b": [0.7817, 0.1588, 0.835, 0.1785]}, {"w": "real-world", "b": [0.1294, 0.1793, 0.2345, 0.199]}, {"w": "problems", "b": [0.2408, 0.1793, 0.3347, 0.199]}, {"w": "using", "b": [0.341, 0.1793, 0.3956, 0.199]}, {"w": "deep", "b": [0.402, 0.1793, 0.4496, 0.199]}, {"w": "learning,", "b": [0.4559, 0.1793, 0.5449, 0.199]}, {"w": "and", "b": [0.5512, 0.1793, 0.5876, 0.199]}, {"w": "will", "b": [0.5939, 0.1793, 0.6331, 0.199]}, {"w": "familiarize", "b": [0.6395, 0.1793, 0.7487, 0.199]}, {"w": "you", "b": [0.755, 0.1793, 0.7929, 0.199]}, {"w": "with", "b": [0.7991, 0.1793, 0.8439, 0.199]}, {"w": "essential", "b": [0.1294, 0.1998, 0.2163, 0.2195]}, {"w": "deep-learning", "b": [0.2226, 0.1998, 0.3613, 0.2195]}, {"w": "best", "b": [0.3676, 0.1998, 0.4082, 0.2195]}, {"w": "practices.", "b": [0.4145, 0.1998, 0.5105, 0.2195]}, {"w": "Most", "b": [0.5168, 0.1998, 0.5687, 0.2195]}, {"w": "of", "b": [0.575, 0.1998, 0.596, 0.2195]}, {"w": "the", "b": [0.6023, 0.1998, 0.6331, 0.2195]}, {"w": "code", "b": [0.6394, 0.1998, 0.6871, 0.2195]}, {"w": "examples", "b": [0.6934, 0.1998, 0.7886, 0.2195]}, {"w": "in", "b": [0.7949, 0.1998, 0.8146, 0.2195]}, {"w": "the", "b": [0.8209, 0.1998, 0.8517, 0.2195]}, {"w": "book", "b": [0.1294, 0.2203, 0.1799, 0.24]}, {"w": "are", "b": [0.1862, 0.2203, 0.217, 0.24]}, {"w": "concentrated", "b": [0.2233, 0.2203, 0.3522, 0.24]}, {"w": "in", "b": [0.3585, 0.2203, 0.3781, 0.24]}, {"w": "this", "b": [0.3844, 0.2203, 0.4208, 0.24]}, {"w": "second", "b": [0.4272, 0.2203, 0.4972, 0.24]}, {"w": "half.", "b": [0.5035, 0.2203, 0.549, 0.24]}]}]}, {"page": 171, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 5. Deep learning for computer vision", "words": [{"w": "Chapter", "b": [0.1289, 0.1062, 0.2478, 0.1324]}, {"w": "5.", "b": [0.2562, 0.1062, 0.2812, 0.1324]}, {"w": "Deep", "b": [0.2896, 0.1062, 0.362, 0.1324]}, {"w": "learning", "b": [0.3704, 0.1062, 0.4893, 0.1324]}, {"w": "for", "b": [0.4977, 0.1062, 0.5404, 0.1324]}, {"w": "computer", "b": [0.5488, 0.1062, 0.6862, 0.1324]}, {"w": "vision", "b": [0.6946, 0.1062, 0.7782, 0.1324]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1289, 0.1541, 0.1696, 0.1726]}, {"w": "chapter", "b": [0.1755, 0.1541, 0.2476, 0.1726]}, {"w": "covers", "b": [0.2535, 0.1541, 0.3151, 0.1726]}]}, {"id": "b_2", "type": "paragraph", "text": "Understanding convolutional neural networks (convnets) Using data augmentation to mitigate overfitting Using a pretrained convnet to do feature extraction Fine-tuning a pretrained convnet Visualizing what convnets learn and how they make classification decisions", "words": [{"w": "Understanding", "b": [0.1761, 0.19, 0.3151, 0.2084]}, {"w": "convolutional", "b": [0.3211, 0.19, 0.4509, 0.2084]}, {"w": "neural", "b": [0.4568, 0.19, 0.5159, 0.2084]}, {"w": "networks", "b": [0.5218, 0.19, 0.6083, 0.2084]}, {"w": "(convnets)", "b": [0.6142, 0.19, 0.7139, 0.2084]}, {"w": "Using", "b": [0.1761, 0.2092, 0.2325, 0.2276]}, {"w": "data", "b": [0.2384, 0.2092, 0.2778, 0.2276]}, {"w": "augmentation", "b": [0.2837, 0.2092, 0.4122, 0.2276]}, {"w": "to", "b": [0.4181, 0.2092, 0.4365, 0.2276]}, {"w": "mitigate", "b": [0.4424, 0.2092, 0.5198, 0.2276]}, {"w": "overfitting", "b": [0.5257, 0.2092, 0.6254, 0.2276]}, {"w": "Using", "b": [0.1761, 0.2283, 0.2325, 0.2468]}, {"w": "a", "b": [0.2384, 0.2283, 0.2489, 0.2468]}, {"w": "pretrained", "b": [0.2548, 0.2283, 0.3505, 0.2468]}, {"w": "convnet", "b": [0.3565, 0.2283, 0.4312, 0.2468]}, {"w": "to", "b": [0.4371, 0.2283, 0.4555, 0.2468]}, {"w": "do", "b": [0.4614, 0.2283, 0.485, 0.2468]}, {"w": "feature", "b": [0.4909, 0.2283, 0.5565, 0.2468]}, {"w": "extraction", "b": [0.5624, 0.2283, 0.6568, 0.2468]}, {"w": "Fine-tuning", "b": [0.1761, 0.2475, 0.2863, 0.266]}, {"w": "a", "b": [0.2922, 0.2475, 0.3027, 0.266]}, {"w": "pretrained", "b": [0.3086, 0.2475, 0.4043, 0.266]}, {"w": "convnet", "b": [0.4102, 0.2475, 0.485, 0.266]}, {"w": "Visualizing", "b": [0.1761, 0.2667, 0.2836, 0.2852]}, {"w": "what", "b": [0.2895, 0.2667, 0.3354, 0.2852]}, {"w": "convnets", "b": [0.3413, 0.2667, 0.4252, 0.2852]}, {"w": "learn", "b": [0.4311, 0.2667, 0.4784, 0.2852]}, {"w": "and", "b": [0.4843, 0.2667, 0.5184, 0.2852]}, {"w": "how", "b": [0.5243, 0.2667, 0.5649, 0.2852]}, {"w": "they", "b": [0.5708, 0.2667, 0.6115, 0.2852]}, {"w": "make", "b": [0.6174, 0.2667, 0.6685, 0.2852]}, {"w": "classification", "b": [0.6745, 0.2667, 0.7991, 0.2852]}, {"w": "decisions", "b": [0.1761, 0.2859, 0.264, 0.3044]}]}, {"id": "b_3", "type": "paragraph", "text": "This chapter introduces convolutional neural networks, also known as convnets, a type of deep-learning model almost universally used in computer vision applications. You’ll learn to apply convnets to image-classification problems—in particular those involving small training datasets, which are the most common use case if you aren’t a large tech company.", "words": [{"w": "This", "b": [0.1289, 0.326, 0.1709, 0.3445]}, {"w": "chapter", "b": [0.1768, 0.326, 0.2463, 0.3445]}, {"w": "introduces", "b": [0.2522, 0.326, 0.3505, 0.3445]}, {"w": "convolutional", "b": [0.3565, 0.326, 0.4863, 0.3445]}, {"w": "neural", "b": [0.4922, 0.326, 0.5512, 0.3445]}, {"w": "networks,", "b": [0.5572, 0.326, 0.6496, 0.3445]}, {"w": "also", "b": [0.6555, 0.326, 0.6936, 0.3445]}, {"w": "known", "b": [0.6995, 0.326, 0.7638, 0.3445]}, {"w": "as", "b": [0.7697, 0.326, 0.7893, 0.3445]}, {"w": "convnets,", "b": [0.1289, 0.3452, 0.2174, 0.3636]}, {"w": "a", "b": [0.2233, 0.3452, 0.2338, 0.3636]}, {"w": "type", "b": [0.2397, 0.3452, 0.2804, 0.3636]}, {"w": "of", "b": [0.2863, 0.3452, 0.3059, 0.3636]}, {"w": "deep-learning", "b": [0.3118, 0.3452, 0.4417, 0.3636]}, {"w": "model", "b": [0.4476, 0.3452, 0.5066, 0.3636]}, {"w": "almost", "b": [0.5125, 0.3452, 0.5755, 0.3636]}, {"w": "universally", "b": [0.5814, 0.3452, 0.6863, 0.3636]}, {"w": "used", "b": [0.6922, 0.3452, 0.7355, 0.3636]}, {"w": "in", "b": [0.7414, 0.3452, 0.7598, 0.3636]}, {"w": "computer", "b": [0.7657, 0.3452, 0.8549, 0.3636]}, {"w": "vision", "b": [0.1289, 0.3644, 0.1866, 0.3828]}, {"w": "applications.", "b": [0.1925, 0.3644, 0.3126, 0.3828]}, {"w": "You’ll", "b": [0.3185, 0.3644, 0.3777, 0.3828]}, {"w": "learn", "b": [0.3836, 0.3644, 0.4308, 0.3828]}, {"w": "to", "b": [0.4367, 0.3644, 0.4551, 0.3828]}, {"w": "apply", "b": [0.461, 0.3644, 0.5135, 0.3828]}, {"w": "convnets", "b": [0.5194, 0.3644, 0.6033, 0.3828]}, {"w": "to", "b": [0.6092, 0.3644, 0.6276, 0.3828]}, {"w": "image-classification", "b": [0.6335, 0.3644, 0.8237, 0.3828]}, {"w": "problems—in", "b": [0.1289, 0.3835, 0.2588, 0.402]}, {"w": "particular", "b": [0.2647, 0.3835, 0.3552, 0.402]}, {"w": "those", "b": [0.3611, 0.3835, 0.4109, 0.402]}, {"w": "involving", "b": [0.4168, 0.3835, 0.5073, 0.402]}, {"w": "small", "b": [0.5133, 0.3835, 0.5644, 0.402]}, {"w": "training", "b": [0.5703, 0.3835, 0.6438, 0.402]}, {"w": "datasets,", "b": [0.6497, 0.3835, 0.7304, 0.402]}, {"w": "which", "b": [0.7363, 0.3835, 0.794, 0.402]}, {"w": "are", "b": [0.7999, 0.3835, 0.8287, 0.402]}, {"w": "the", "b": [0.8346, 0.3835, 0.8635, 0.402]}, {"w": "most", "b": [0.1289, 0.4027, 0.1748, 0.4212]}, {"w": "common", "b": [0.1807, 0.4027, 0.2634, 0.4212]}, {"w": "use", "b": [0.2693, 0.4027, 0.3007, 0.4212]}, {"w": "case", "b": [0.3066, 0.4027, 0.3473, 0.4212]}, {"w": "if", "b": [0.3532, 0.4027, 0.3676, 0.4212]}, {"w": "you", "b": [0.3735, 0.4027, 0.4089, 0.4212]}, {"w": "aren’t", "b": [0.4148, 0.4027, 0.4695, 0.4212]}, {"w": "a", "b": [0.4754, 0.4027, 0.4858, 0.4212]}, {"w": "large", "b": [0.4917, 0.4027, 0.5385, 0.4212]}, {"w": "tech", "b": [0.5444, 0.4027, 0.5838, 0.4212]}, {"w": "company.", "b": [0.5897, 0.4027, 0.6806, 0.4212]}]}, {"id": "b_4", "type": "paragraph", "text": "5.1. Introduction to convnets", "words": [{"w": "5.1.", "b": [0.1289, 0.4559, 0.1687, 0.4767]}, {"w": "Introduction", "b": [0.1754, 0.4559, 0.3195, 0.4767]}, {"w": "to", "b": [0.3262, 0.4559, 0.3483, 0.4767]}, {"w": "convnets", "b": [0.355, 0.4559, 0.4538, 0.4767]}]}, {"id": "b_5", "type": "paragraph", "text": "We’re about to dive into the theory of what convnets are and why they have been so successful at computer vision tasks. But first, let’s take a practical look at a simple convnet example. It uses a convnet to classify MNIST digits, a task we performed in chapter 2 using a densely connected network (our test accuracy then was 97.8%). Even though the convnet will be basic, its accuracy will blow out of the water that of the densely connected model from chapter 2.", "words": [{"w": "We’re", "b": [0.1289, 0.4987, 0.186, 0.5172]}, {"w": "about", "b": [0.1919, 0.4987, 0.2443, 0.5172]}, {"w": "to", "b": [0.2503, 0.4987, 0.2686, 0.5172]}, {"w": "dive", "b": [0.2745, 0.4987, 0.3152, 0.5172]}, {"w": "into", "b": [0.3211, 0.4987, 0.3578, 0.5172]}, {"w": "the", "b": [0.3637, 0.4987, 0.3926, 0.5172]}, {"w": "theory", "b": [0.3985, 0.4987, 0.4588, 0.5172]}, {"w": "of", "b": [0.4647, 0.4987, 0.4844, 0.5172]}, {"w": "what", "b": [0.4903, 0.4987, 0.5362, 0.5172]}, {"w": "convnets", "b": [0.5421, 0.4987, 0.6261, 0.5172]}, {"w": "are", "b": [0.632, 0.4987, 0.6608, 0.5172]}, {"w": "and", "b": [0.6667, 0.4987, 0.7008, 0.5172]}, {"w": "why", "b": [0.7067, 0.4987, 0.7474, 0.5172]}, {"w": "they", "b": [0.7533, 0.4987, 0.794, 0.5172]}, {"w": "have", "b": [0.7999, 0.4987, 0.8444, 0.5172]}, {"w": "been", "b": [0.1289, 0.5179, 0.1735, 0.5364]}, {"w": "so", "b": [0.1794, 0.5179, 0.2004, 0.5364]}, {"w": "successful", "b": [0.2063, 0.5179, 0.3033, 0.5364]}, {"w": "at", "b": [0.3092, 0.5179, 0.3263, 0.5364]}, {"w": "computer", "b": [0.3322, 0.5179, 0.4214, 0.5364]}, {"w": "vision", "b": [0.4273, 0.5179, 0.485, 0.5364]}, {"w": "tasks.", "b": [0.4909, 0.5179, 0.544, 0.5364]}, {"w": "But", "b": [0.55, 0.5179, 0.5841, 0.5364]}, {"w": "first,", "b": [0.5899, 0.5179, 0.6339, 0.5364]}, {"w": "let’s", "b": [0.6398, 0.5179, 0.6791, 0.5364]}, {"w": "take", "b": [0.685, 0.5179, 0.7244, 0.5364]}, {"w": "a", "b": [0.7303, 0.5179, 0.7408, 0.5364]}, {"w": "practical", "b": [0.7467, 0.5179, 0.828, 0.5364]}, {"w": "look", "b": [0.1289, 0.5371, 0.1709, 0.5556]}, {"w": "at", "b": [0.1768, 0.5371, 0.1938, 0.5556]}, {"w": "a", "b": [0.1997, 0.5371, 0.2102, 0.5556]}, {"w": "simple", "b": [0.2161, 0.5371, 0.2791, 0.5556]}, {"w": "convnet", "b": [0.285, 0.5371, 0.3598, 0.5556]}, {"w": "example.", "b": [0.3657, 0.5371, 0.4516, 0.5556]}, {"w": "It", "b": [0.4575, 0.5371, 0.4719, 0.5556]}, {"w": "uses", "b": [0.4778, 0.5371, 0.5185, 0.5556]}, {"w": "a", "b": [0.5244, 0.5371, 0.5349, 0.5556]}, {"w": "convnet", "b": [0.5408, 0.5371, 0.6155, 0.5556]}, {"w": "to", "b": [0.6214, 0.5371, 0.6398, 0.5556]}, {"w": "classify", "b": [0.6457, 0.5371, 0.7179, 0.5556]}, {"w": "MNIST", "b": [0.7238, 0.5371, 0.7972, 0.5556]}, {"w": "digits,", "b": [0.8031, 0.5371, 0.8615, 0.5556]}, {"w": "a", "b": [0.1289, 0.5563, 0.1394, 0.5747]}, {"w": "task", "b": [0.1453, 0.5563, 0.1833, 0.5747]}, {"w": "we", "b": [0.1892, 0.5563, 0.2167, 0.5747]}, {"w": "performed", "b": [0.2227, 0.5563, 0.321, 0.5747]}, {"w": "in", "b": [0.3269, 0.5563, 0.3453, 0.5747]}, {"w": "chapter", "b": [0.3511, 0.5563, 0.4206, 0.5747]}, {"w": "2", "b": [0.4266, 0.5563, 0.4384, 0.5747]}, {"w": "using", "b": [0.4442, 0.5563, 0.4954, 0.5747]}, {"w": "a", "b": [0.5013, 0.5563, 0.5118, 0.5747]}, {"w": "densely", "b": [0.5177, 0.5563, 0.5899, 0.5747]}, {"w": "connected", "b": [0.5958, 0.5563, 0.6915, 0.5747]}, {"w": "network", "b": [0.6974, 0.5563, 0.7748, 0.5747]}, {"w": "(our", "b": [0.7807, 0.5563, 0.82, 0.5747]}, {"w": "test", "b": [0.8259, 0.5563, 0.8587, 0.5747]}, {"w": "accuracy", "b": [0.1289, 0.5755, 0.2128, 0.5939]}, {"w": "then", "b": [0.2187, 0.5755, 0.2593, 0.5939]}, {"w": "was", "b": [0.2653, 0.5755, 0.302, 0.5939]}, {"w": "97.8%).", "b": [0.3079, 0.5755, 0.3826, 0.5939]}, {"w": "Even", "b": [0.3885, 0.5755, 0.4371, 0.5939]}, {"w": "though", "b": [0.443, 0.5755, 0.5086, 0.5939]}, {"w": "the", "b": [0.5145, 0.5755, 0.5433, 0.5939]}, {"w": "convnet", "b": [0.5492, 0.5755, 0.624, 0.5939]}, {"w": "will", "b": [0.6299, 0.5755, 0.6667, 0.5939]}, {"w": "be", "b": [0.6726, 0.5755, 0.6949, 0.5939]}, {"w": "basic,", "b": [0.7008, 0.5755, 0.7552, 0.5939]}, {"w": "its", "b": [0.7611, 0.5755, 0.7834, 0.5939]}, {"w": "accuracy", "b": [0.1289, 0.5946, 0.2128, 0.6131]}, {"w": "will", "b": [0.2186, 0.5946, 0.2554, 0.6131]}, {"w": "blow", "b": [0.2613, 0.5946, 0.3085, 0.6131]}, {"w": "out", "b": [0.3144, 0.5946, 0.3446, 0.6131]}, {"w": "of", "b": [0.3505, 0.5946, 0.3702, 0.6131]}, {"w": "the", "b": [0.3761, 0.5946, 0.4049, 0.6131]}, {"w": "water", "b": [0.4108, 0.5946, 0.4633, 0.6131]}, {"w": "that", "b": [0.4692, 0.5946, 0.5046, 0.6131]}, {"w": "of", "b": [0.5105, 0.5946, 0.5302, 0.6131]}, {"w": "the", "b": [0.5361, 0.5946, 0.565, 0.6131]}, {"w": "densely", "b": [0.5709, 0.5946, 0.643, 0.6131]}, {"w": "connected", "b": [0.6489, 0.5946, 0.7446, 0.6131]}, {"w": "model", "b": [0.7505, 0.5946, 0.8096, 0.6131]}, {"w": "from", "b": [0.8155, 0.5946, 0.8614, 0.6131]}, {"w": "chapter", "b": [0.1289, 0.6138, 0.1984, 0.6323]}, {"w": "2.", "b": [0.2043, 0.6138, 0.222, 0.6323]}]}, {"id": "b_6", "type": "paragraph", "text": "The following lines of code show you what a basic convnet looks like. It’s a stack of Conv2D and MaxPooling2D layers. You’ll see in a minute exactly what they do.", "words": [{"w": "The", "b": [0.1289, 0.6539, 0.1656, 0.6724]}, {"w": "following", "b": [0.1715, 0.6539, 0.2633, 0.6724]}, {"w": "lines", "b": [0.2692, 0.6539, 0.3139, 0.6724]}, {"w": "of", "b": [0.3198, 0.6539, 0.3394, 0.6724]}, {"w": "code", "b": [0.3453, 0.6539, 0.3899, 0.6724]}, {"w": "show", "b": [0.3958, 0.6539, 0.4457, 0.6724]}, {"w": "you", "b": [0.4516, 0.6539, 0.487, 0.6724]}, {"w": "what", "b": [0.4929, 0.6539, 0.5388, 0.6724]}, {"w": "a", "b": [0.5447, 0.6539, 0.5552, 0.6724]}, {"w": "basic", "b": [0.5611, 0.6539, 0.6096, 0.6724]}, {"w": "convnet", "b": [0.6155, 0.6539, 0.6903, 0.6724]}, {"w": "looks", "b": [0.6962, 0.6539, 0.7474, 0.6724]}, {"w": "like.", "b": [0.7533, 0.6539, 0.7946, 0.6724]}, {"w": "It’s", "b": [0.8005, 0.6539, 0.8306, 0.6724]}, {"w": "a", "b": [0.8365, 0.6539, 0.847, 0.6724]}, {"w": "stack", "b": [0.1289, 0.6731, 0.1774, 0.6916]}, {"w": "of", "b": [0.1833, 0.6731, 0.203, 0.6916]}, {"w": "Conv2D", "b": [0.2089, 0.6741, 0.2939, 0.693]}, {"w": "and", "b": [0.2998, 0.6731, 0.3339, 0.6916]}, {"w": "MaxPooling2D", "b": [0.3398, 0.6741, 0.5098, 0.693]}, {"w": "layers.", "b": [0.5157, 0.6731, 0.578, 0.6916]}, {"w": "You’ll", "b": [0.5839, 0.6731, 0.6432, 0.6916]}, {"w": "see", "b": [0.6491, 0.6731, 0.6793, 0.6916]}, {"w": "in", "b": [0.6852, 0.6731, 0.7036, 0.6916]}, {"w": "a", "b": [0.7095, 0.6731, 0.7199, 0.6916]}, {"w": "minute", "b": [0.7259, 0.6731, 0.7915, 0.6916]}, {"w": "exactly", "b": [0.7974, 0.6731, 0.8656, 0.6916]}, {"w": "what", "b": [0.1289, 0.6931, 0.1748, 0.7116]}, {"w": "they", "b": [0.1807, 0.6931, 0.2214, 0.7116]}, {"w": "do.", "b": [0.2273, 0.6931, 0.2568, 0.7116]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 5.1. Instantiating a small convnet", "words": [{"w": "Listing", "b": [0.1289, 0.7285, 0.182, 0.7424]}, {"w": "5.1.", "b": [0.1865, 0.7285, 0.213, 0.7424]}, {"w": "Instantiating", "b": [0.2174, 0.7285, 0.3149, 0.7424]}, {"w": "a", "b": [0.3193, 0.7285, 0.3281, 0.7424]}, {"w": "small", "b": [0.3326, 0.7285, 0.3729, 0.7424]}, {"w": "convnet", "b": [0.3773, 0.7285, 0.4364, 0.7424]}]}, {"id": "b_8", "type": "paragraph", "text": "from keras import layers from keras import models model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape= (28, 28, 1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu'))", "words": [{"w": "from", "b": [0.1348, 0.7551, 0.1773, 0.7693]}, {"w": "keras", "b": [0.1879, 0.7551, 0.241, 0.7693]}, {"w": "import", "b": [0.2517, 0.7551, 0.3154, 0.7693]}, {"w": "layers", "b": [0.3261, 0.7551, 0.3898, 0.7693]}, {"w": "from", "b": [0.1348, 0.7693, 0.1773, 0.7835]}, {"w": "keras", "b": [0.1879, 0.7693, 0.241, 0.7835]}, {"w": "import", "b": [0.2517, 0.7693, 0.3154, 0.7835]}, {"w": "models", "b": [0.3261, 0.7693, 0.3898, 0.7835]}, {"w": "model", "b": [0.1348, 0.7977, 0.1879, 0.8119]}, {"w": "=", "b": [0.1985, 0.7977, 0.2092, 0.8119]}, {"w": "models.Sequential()", "b": [0.2198, 0.7977, 0.4217, 0.8119]}, {"w": "model.add(layers.Conv2D(32,", "b": [0.1348, 0.8119, 0.4217, 0.826]}, {"w": "(3,", "b": [0.4323, 0.8119, 0.4642, 0.826]}, {"w": "3),", "b": [0.4748, 0.8119, 0.5067, 0.826]}, {"w": "activation='relu',", "b": [0.5173, 0.8119, 0.7086, 0.826]}, {"w": "input_shape=", "b": [0.7192, 0.8119, 0.8468, 0.826]}, {"w": "(28,", "b": [0.1348, 0.8261, 0.1773, 0.8402]}, {"w": "28,", "b": [0.1879, 0.8261, 0.2198, 0.8402]}, {"w": "1)))", "b": [0.2304, 0.8261, 0.2729, 0.8402]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.8402, 0.4855, 0.8544]}, {"w": "2)))", "b": [0.4961, 0.8402, 0.5386, 0.8544]}, {"w": "model.add(layers.Conv2D(64,", "b": [0.1348, 0.8544, 0.4217, 0.8686]}, {"w": "(3,", "b": [0.4323, 0.8544, 0.4642, 0.8686]}, {"w": "3),", "b": [0.4748, 0.8544, 0.5067, 0.8686]}, {"w": "activation='relu'))", "b": [0.5173, 0.8544, 0.7192, 0.8686]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.8686, 0.4855, 0.8828]}, {"w": "2)))", "b": [0.4961, 0.8686, 0.5386, 0.8828]}, {"w": "model.add(layers.Conv2D(64,", "b": [0.1348, 0.8828, 0.4217, 0.897]}, {"w": "(3,", "b": [0.4323, 0.8828, 0.4642, 0.897]}, {"w": "3),", "b": [0.4748, 0.8828, 0.5067, 0.897]}, {"w": "activation='relu'))", "b": [0.5173, 0.8828, 0.7192, 0.897]}]}]}, {"page": 172, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Importantly, a convnet takes as input tensors of shape (image_height, image_width, image_channels) (not including the batch dimension). In this case, we’ll configure the convnet to process inputs of size (28, 28, 1), which is the format of MNIST images. We’ll do this by passing the argument input_shape=(28, 28, 1) to the first layer.", "words": [{"w": "Importantly,", "b": [0.1289, 0.0857, 0.2447, 0.1041]}, {"w": "a", "b": [0.2506, 0.0857, 0.2611, 0.1041]}, {"w": "convnet", "b": [0.267, 0.0857, 0.3418, 0.1041]}, {"w": "takes", "b": [0.3477, 0.0857, 0.3962, 0.1041]}, {"w": "as", "b": [0.4021, 0.0857, 0.4218, 0.1041]}, {"w": "input", "b": [0.4277, 0.0857, 0.4763, 0.1041]}, {"w": "tensors", "b": [0.4822, 0.0857, 0.5491, 0.1041]}, {"w": "of", "b": [0.555, 0.0857, 0.5746, 0.1041]}, {"w": "shape", "b": [0.5805, 0.0857, 0.6343, 0.1041]}, {"w": "(image_height,", "b": [0.6402, 0.0866, 0.8385, 0.1055]}, {"w": "image_width,", "b": [0.1289, 0.1067, 0.2989, 0.1256]}, {"w": "image_channels)", "b": [0.3131, 0.1067, 0.5256, 0.1256]}, {"w": "(not", "b": [0.5316, 0.1057, 0.5696, 0.1242]}, {"w": "including", "b": [0.5755, 0.1057, 0.6647, 0.1242]}, {"w": "the", "b": [0.6706, 0.1057, 0.6995, 0.1242]}, {"w": "batch", "b": [0.7054, 0.1057, 0.7565, 0.1242]}, {"w": "dimension).", "b": [0.1289, 0.1257, 0.241, 0.1442]}, {"w": "In", "b": [0.2469, 0.1257, 0.2666, 0.1442]}, {"w": "this", "b": [0.2725, 0.1257, 0.3066, 0.1442]}, {"w": "case,", "b": [0.3126, 0.1257, 0.3591, 0.1442]}, {"w": "we’ll", "b": [0.365, 0.1257, 0.4135, 0.1442]}, {"w": "configure", "b": [0.4194, 0.1257, 0.5099, 0.1442]}, {"w": "the", "b": [0.5158, 0.1257, 0.5447, 0.1442]}, {"w": "convnet", "b": [0.5506, 0.1257, 0.6254, 0.1442]}, {"w": "to", "b": [0.6313, 0.1257, 0.6496, 0.1442]}, {"w": "process", "b": [0.6555, 0.1257, 0.7264, 0.1442]}, {"w": "inputs", "b": [0.7323, 0.1257, 0.79, 0.1442]}, {"w": "of", "b": [0.7959, 0.1257, 0.8156, 0.1442]}, {"w": "size", "b": [0.8215, 0.1257, 0.8582, 0.1442]}, {"w": "(28,", "b": [0.1289, 0.1459, 0.1856, 0.1648]}, {"w": "28,", "b": [0.1997, 0.1459, 0.2422, 0.1648]}, {"w": "1),", "b": [0.2564, 0.1449, 0.2907, 0.1648]}, {"w": "which", "b": [0.2966, 0.1449, 0.3543, 0.1634]}, {"w": "is", "b": [0.3602, 0.1449, 0.3759, 0.1634]}, {"w": "the", "b": [0.3818, 0.1449, 0.4107, 0.1634]}, {"w": "format", "b": [0.4166, 0.1449, 0.4796, 0.1634]}, {"w": "of", "b": [0.4855, 0.1449, 0.5051, 0.1634]}, {"w": "MNIST", "b": [0.511, 0.1449, 0.5845, 0.1634]}, {"w": "images.", "b": [0.5904, 0.1449, 0.6632, 0.1634]}, {"w": "We’ll", "b": [0.6691, 0.1449, 0.721, 0.1634]}, {"w": "do", "b": [0.7269, 0.1449, 0.7505, 0.1634]}, {"w": "this", "b": [0.7564, 0.1449, 0.7905, 0.1634]}, {"w": "by", "b": [0.7964, 0.1449, 0.82, 0.1634]}, {"w": "passing", "b": [0.1289, 0.1649, 0.1997, 0.1834]}, {"w": "the", "b": [0.2056, 0.1649, 0.2345, 0.1834]}, {"w": "argument", "b": [0.2404, 0.1649, 0.3291, 0.1834]}, {"w": "input_shape=(28,", "b": [0.335, 0.1659, 0.5617, 0.1848]}, {"w": "28,", "b": [0.5759, 0.1659, 0.6184, 0.1848]}, {"w": "1)", "b": [0.6326, 0.1659, 0.6609, 0.1848]}, {"w": "to", "b": [0.6668, 0.1649, 0.6852, 0.1834]}, {"w": "the", "b": [0.6911, 0.1649, 0.72, 0.1834]}, {"w": "first", "b": [0.7259, 0.1649, 0.7639, 0.1834]}, {"w": "layer.", "b": [0.7698, 0.1649, 0.8216, 0.1834]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s display the architecture of the convnet so far:", "words": [{"w": "Let’s", "b": [0.1289, 0.2058, 0.1761, 0.2243]}, {"w": "display", "b": [0.182, 0.2058, 0.2502, 0.2243]}, {"w": "the", "b": [0.2561, 0.2058, 0.285, 0.2243]}, {"w": "architecture", "b": [0.2909, 0.2058, 0.4023, 0.2243]}, {"w": "of", "b": [0.4082, 0.2058, 0.4279, 0.2243]}, {"w": "the", "b": [0.4338, 0.2058, 0.4627, 0.2243]}, {"w": "convnet", "b": [0.4686, 0.2058, 0.5433, 0.2243]}, {"w": "so", "b": [0.5493, 0.2058, 0.5702, 0.2243]}, {"w": "far:", "b": [0.5761, 0.2058, 0.6089, 0.2243]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> model.summary() ________________________________________________________________ Layer (type) Output Shape Param # ================================================================ conv2d_1 (Conv2D) (None, 26, 26, 32) 320 ________________________________________________________________ maxpooling2d_1 (MaxPooling2D) (None, 13, 13, 32) 0 ________________________________________________________________ conv2d_2 (Conv2D) (None, 11, 11, 64) 18496 ________________________________________________________________ maxpooling2d_2 (MaxPooling2D) (None, 5, 5, 64) 0 ________________________________________________________________ conv2d_3 (Conv2D) (None, 3, 3, 64) 36928 ================================================================ Total params: 55,744 Trainable params: 55,744 Non-trainable params: 0", "words": [{"w": ">>>", "b": [0.1348, 0.2411, 0.1667, 0.2553]}, {"w": "model.summary()", "b": [0.1773, 0.2411, 0.3367, 0.2553]}, {"w": "________________________________________________________________", "b": [0.1348, 0.2553, 0.8149, 0.2695]}, {"w": "Layer", "b": [0.1348, 0.2695, 0.1879, 0.2837]}, {"w": "(type)", "b": [0.1985, 0.2695, 0.2623, 0.2837]}, {"w": "Output", "b": [0.4855, 0.2695, 0.5492, 0.2837]}, {"w": "Shape", "b": [0.5598, 0.2695, 0.613, 0.2837]}, {"w": "Param", "b": [0.7192, 0.2695, 0.7724, 0.2837]}, {"w": "#", "b": [0.783, 0.2695, 0.7936, 0.2837]}, {"w": "================================================================", "b": [0.1348, 0.2837, 0.8149, 0.2979]}, {"w": "conv2d_1", "b": [0.1348, 0.2979, 0.2198, 0.3121]}, {"w": "(Conv2D)", "b": [0.2304, 0.2979, 0.3154, 0.3121]}, {"w": "(None,", "b": [0.4855, 0.2979, 0.5492, 0.3121]}, {"w": "26,", "b": [0.5598, 0.2979, 0.5917, 0.3121]}, {"w": "26,", "b": [0.6024, 0.2979, 0.6342, 0.3121]}, {"w": "32)", "b": [0.6449, 0.2979, 0.6767, 0.3121]}, {"w": "320", "b": [0.7192, 0.2979, 0.7511, 0.3121]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3121, 0.8149, 0.3262]}, {"w": "maxpooling2d_1", "b": [0.1348, 0.3263, 0.2836, 0.3404]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.3263, 0.443, 0.3404]}, {"w": "(None,", "b": [0.4855, 0.3263, 0.5492, 0.3404]}, {"w": "13,", "b": [0.5598, 0.3263, 0.5917, 0.3404]}, {"w": "13,", "b": [0.6024, 0.3263, 0.6342, 0.3404]}, {"w": "32)", "b": [0.6449, 0.3263, 0.6767, 0.3404]}, {"w": "0", "b": [0.7192, 0.3263, 0.7299, 0.3404]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3404, 0.8149, 0.3546]}, {"w": "conv2d_2", "b": [0.1348, 0.3546, 0.2198, 0.3688]}, {"w": "(Conv2D)", "b": [0.2304, 0.3546, 0.3154, 0.3688]}, {"w": "(None,", "b": [0.4855, 0.3546, 0.5492, 0.3688]}, {"w": "11,", "b": [0.5598, 0.3546, 0.5917, 0.3688]}, {"w": "11,", "b": [0.6024, 0.3546, 0.6342, 0.3688]}, {"w": "64)", "b": [0.6449, 0.3546, 0.6767, 0.3688]}, {"w": "18496", "b": [0.7192, 0.3546, 0.7724, 0.3688]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3688, 0.8149, 0.383]}, {"w": "maxpooling2d_2", "b": [0.1348, 0.383, 0.2836, 0.3972]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.383, 0.443, 0.3972]}, {"w": "(None,", "b": [0.4855, 0.383, 0.5492, 0.3972]}, {"w": "5,", "b": [0.5598, 0.383, 0.5811, 0.3972]}, {"w": "5,", "b": [0.5917, 0.383, 0.613, 0.3972]}, {"w": "64)", "b": [0.6236, 0.383, 0.6555, 0.3972]}, {"w": "0", "b": [0.7192, 0.383, 0.7299, 0.3972]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3972, 0.8149, 0.4114]}, {"w": "conv2d_3", "b": [0.1348, 0.4114, 0.2198, 0.4255]}, {"w": "(Conv2D)", "b": [0.2304, 0.4114, 0.3154, 0.4255]}, {"w": "(None,", "b": [0.4855, 0.4114, 0.5492, 0.4255]}, {"w": "3,", "b": [0.5598, 0.4114, 0.5811, 0.4255]}, {"w": "3,", "b": [0.5917, 0.4114, 0.613, 0.4255]}, {"w": "64)", "b": [0.6236, 0.4114, 0.6555, 0.4255]}, {"w": "36928", "b": [0.7192, 0.4114, 0.7724, 0.4255]}, {"w": "================================================================", "b": [0.1348, 0.4255, 0.8149, 0.4397]}, {"w": "Total", "b": [0.1348, 0.4397, 0.1879, 0.4539]}, {"w": "params:", "b": [0.1985, 0.4397, 0.2729, 0.4539]}, {"w": "55,744", "b": [0.2836, 0.4397, 0.3473, 0.4539]}, {"w": "Trainable", "b": [0.1348, 0.4539, 0.2304, 0.4681]}, {"w": "params:", "b": [0.241, 0.4539, 0.3154, 0.4681]}, {"w": "55,744", "b": [0.3261, 0.4539, 0.3898, 0.4681]}, {"w": "Non-trainable", "b": [0.1348, 0.4681, 0.2729, 0.4823]}, {"w": "params:", "b": [0.2836, 0.4681, 0.3579, 0.4823]}, {"w": "0", "b": [0.3686, 0.4681, 0.3792, 0.4823]}]}, {"id": "b_3", "type": "paragraph", "text": "You can see that the output of every Conv2D and MaxPooling2D layer is a 3D tensor of shape (height, width, channels). The width and height dimensions tend to shrink as you go deeper in the network. The number of channels is controlled by the first argument passed to the Conv2D layers (32 or 64).", "words": [{"w": "You", "b": [0.1289, 0.5037, 0.1672, 0.5222]}, {"w": "can", "b": [0.1731, 0.5037, 0.2059, 0.5222]}, {"w": "see", "b": [0.2118, 0.5037, 0.2419, 0.5222]}, {"w": "that", "b": [0.2478, 0.5037, 0.2832, 0.5222]}, {"w": "the", "b": [0.2892, 0.5037, 0.318, 0.5222]}, {"w": "output", "b": [0.3239, 0.5037, 0.3843, 0.5222]}, {"w": "of", "b": [0.3902, 0.5037, 0.4098, 0.5222]}, {"w": "every", "b": [0.4157, 0.5037, 0.4682, 0.5222]}, {"w": "Conv2D", "b": [0.4741, 0.5047, 0.5591, 0.5236]}, {"w": "and", "b": [0.565, 0.5037, 0.5991, 0.5222]}, {"w": "MaxPooling2D", "b": [0.605, 0.5047, 0.775, 0.5236]}, {"w": "layer", "b": [0.7809, 0.5037, 0.8281, 0.5222]}, {"w": "is", "b": [0.834, 0.5037, 0.8498, 0.5222]}, {"w": "a", "b": [0.8557, 0.5037, 0.8662, 0.5222]}, {"w": "3D", "b": [0.1289, 0.5237, 0.1577, 0.5422]}, {"w": "tensor", "b": [0.1636, 0.5237, 0.2214, 0.5422]}, {"w": "of", "b": [0.2273, 0.5237, 0.2469, 0.5422]}, {"w": "shape", "b": [0.2528, 0.5237, 0.3066, 0.5422]}, {"w": "(height,", "b": [0.3125, 0.5247, 0.4259, 0.5436]}, {"w": "width,", "b": [0.44, 0.5247, 0.525, 0.5436]}, {"w": "channels).", "b": [0.5392, 0.5237, 0.6727, 0.5436]}, {"w": "The", "b": [0.6786, 0.5237, 0.7153, 0.5422]}, {"w": "width", "b": [0.7212, 0.5237, 0.775, 0.5422]}, {"w": "and", "b": [0.7809, 0.5237, 0.815, 0.5422]}, {"w": "height", "b": [0.1289, 0.5437, 0.1879, 0.5622]}, {"w": "dimensions", "b": [0.1938, 0.5437, 0.3014, 0.5622]}, {"w": "tend", "b": [0.3073, 0.5437, 0.348, 0.5622]}, {"w": "to", "b": [0.3539, 0.5437, 0.3722, 0.5622]}, {"w": "shrink", "b": [0.3782, 0.5437, 0.4372, 0.5622]}, {"w": "as", "b": [0.4431, 0.5437, 0.4628, 0.5622]}, {"w": "you", "b": [0.4687, 0.5437, 0.5041, 0.5622]}, {"w": "go", "b": [0.51, 0.5437, 0.5336, 0.5622]}, {"w": "deeper", "b": [0.5395, 0.5437, 0.6024, 0.5622]}, {"w": "in", "b": [0.6084, 0.5437, 0.6267, 0.5622]}, {"w": "the", "b": [0.6326, 0.5437, 0.6615, 0.5622]}, {"w": "network.", "b": [0.6674, 0.5437, 0.7507, 0.5622]}, {"w": "The", "b": [0.7566, 0.5437, 0.7933, 0.5622]}, {"w": "number", "b": [0.1289, 0.5629, 0.201, 0.5814]}, {"w": "of", "b": [0.2069, 0.5629, 0.2266, 0.5814]}, {"w": "channels", "b": [0.2325, 0.5629, 0.3151, 0.5814]}, {"w": "is", "b": [0.321, 0.5629, 0.3368, 0.5814]}, {"w": "controlled", "b": [0.3427, 0.5629, 0.4384, 0.5814]}, {"w": "by", "b": [0.4443, 0.5629, 0.468, 0.5814]}, {"w": "the", "b": [0.4738, 0.5629, 0.5027, 0.5814]}, {"w": "first", "b": [0.5086, 0.5629, 0.5466, 0.5814]}, {"w": "argument", "b": [0.5525, 0.5629, 0.6413, 0.5814]}, {"w": "passed", "b": [0.6472, 0.5629, 0.7101, 0.5814]}, {"w": "to", "b": [0.716, 0.5629, 0.7344, 0.5814]}, {"w": "the", "b": [0.7403, 0.5629, 0.7692, 0.5814]}, {"w": "Conv2D", "b": [0.7751, 0.5639, 0.8601, 0.5828]}, {"w": "layers", "b": [0.1289, 0.583, 0.1853, 0.6014]}, {"w": "(32", "b": [0.1912, 0.583, 0.2227, 0.6014]}, {"w": "or", "b": [0.2286, 0.583, 0.2482, 0.6014]}, {"w": "64).", "b": [0.2541, 0.583, 0.2915, 0.6014]}]}, {"id": "b_4", "type": "paragraph", "text": "The next step is to feed the last output tensor (of shape (3, 3, 64)) into a densely connected classifier network like those you’re already familiar with: a stack of Dense layers. These classifiers process vectors, which are 1D, whereas the current output is a 3D tensor. First we have to flatten the 3D outputs to 1D, and then add a few Dense layers on top.", "words": [{"w": "The", "b": [0.1289, 0.623, 0.1656, 0.6415]}, {"w": "next", "b": [0.1715, 0.623, 0.2122, 0.6415]}, {"w": "step", "b": [0.2181, 0.623, 0.2561, 0.6415]}, {"w": "is", "b": [0.262, 0.623, 0.2778, 0.6415]}, {"w": "to", "b": [0.2837, 0.623, 0.302, 0.6415]}, {"w": "feed", "b": [0.3079, 0.623, 0.3486, 0.6415]}, {"w": "the", "b": [0.3545, 0.623, 0.3833, 0.6415]}, {"w": "last", "b": [0.3893, 0.623, 0.4221, 0.6415]}, {"w": "output", "b": [0.428, 0.623, 0.4883, 0.6415]}, {"w": "tensor", "b": [0.4942, 0.623, 0.5519, 0.6415]}, {"w": "(of", "b": [0.5578, 0.623, 0.5854, 0.6415]}, {"w": "shape", "b": [0.5913, 0.623, 0.645, 0.6415]}, {"w": "(3,", "b": [0.6509, 0.624, 0.6934, 0.6429]}, {"w": "3,", "b": [0.7076, 0.624, 0.7359, 0.6429]}, {"w": "64))", "b": [0.7501, 0.623, 0.8005, 0.6429]}, {"w": "into", "b": [0.8064, 0.623, 0.8431, 0.6415]}, {"w": "a", "b": [0.849, 0.623, 0.8595, 0.6415]}, {"w": "densely", "b": [0.1289, 0.643, 0.201, 0.6615]}, {"w": "connected", "b": [0.2069, 0.643, 0.3027, 0.6615]}, {"w": "classifier", "b": [0.3086, 0.643, 0.3938, 0.6615]}, {"w": "network", "b": [0.3997, 0.643, 0.4771, 0.6615]}, {"w": "like", "b": [0.483, 0.643, 0.5184, 0.6615]}, {"w": "those", "b": [0.5243, 0.643, 0.5742, 0.6615]}, {"w": "you’re", "b": [0.5801, 0.643, 0.6417, 0.6615]}, {"w": "already", "b": [0.6476, 0.643, 0.7171, 0.6615]}, {"w": "familiar", "b": [0.723, 0.643, 0.7978, 0.6615]}, {"w": "with:", "b": [0.8037, 0.643, 0.8522, 0.6615]}, {"w": "a", "b": [0.8581, 0.643, 0.8686, 0.6615]}, {"w": "stack", "b": [0.1289, 0.6622, 0.1774, 0.6807]}, {"w": "of", "b": [0.1833, 0.6622, 0.203, 0.6807]}, {"w": "Dense", "b": [0.2089, 0.6632, 0.2797, 0.6821]}, {"w": "layers.", "b": [0.2856, 0.6622, 0.3479, 0.6807]}, {"w": "These", "b": [0.3538, 0.6622, 0.4102, 0.6807]}, {"w": "classifiers", "b": [0.4161, 0.6622, 0.5105, 0.6807]}, {"w": "process", "b": [0.5165, 0.6622, 0.5873, 0.6807]}, {"w": "vectors,", "b": [0.5932, 0.6622, 0.6673, 0.6807]}, {"w": "which", "b": [0.6732, 0.6622, 0.7309, 0.6807]}, {"w": "are", "b": [0.7368, 0.6622, 0.7656, 0.6807]}, {"w": "1D,", "b": [0.7715, 0.6622, 0.8063, 0.6807]}, {"w": "whereas", "b": [0.1289, 0.6823, 0.2062, 0.7007]}, {"w": "the", "b": [0.2121, 0.6823, 0.241, 0.7007]}, {"w": "current", "b": [0.2469, 0.6823, 0.3138, 0.7007]}, {"w": "output", "b": [0.3197, 0.6823, 0.38, 0.7007]}, {"w": "is", "b": [0.3859, 0.6823, 0.4017, 0.7007]}, {"w": "a", "b": [0.4076, 0.6823, 0.4181, 0.7007]}, {"w": "3D", "b": [0.424, 0.6823, 0.4528, 0.7007]}, {"w": "tensor.", "b": [0.4588, 0.6823, 0.521, 0.7007]}, {"w": "First", "b": [0.5269, 0.6823, 0.5702, 0.7007]}, {"w": "we", "b": [0.5762, 0.6823, 0.6037, 0.7007]}, {"w": "have", "b": [0.6096, 0.6823, 0.6542, 0.7007]}, {"w": "to", "b": [0.6601, 0.6823, 0.6784, 0.7007]}, {"w": "flatten", "b": [0.6844, 0.6823, 0.7447, 0.7007]}, {"w": "the", "b": [0.7506, 0.6823, 0.7794, 0.7007]}, {"w": "3D", "b": [0.7853, 0.6823, 0.8142, 0.7007]}, {"w": "outputs", "b": [0.1289, 0.7014, 0.1984, 0.7199]}, {"w": "to", "b": [0.2043, 0.7014, 0.2227, 0.7199]}, {"w": "1D,", "b": [0.2286, 0.7014, 0.2634, 0.7199]}, {"w": "and", "b": [0.2693, 0.7014, 0.3034, 0.7199]}, {"w": "then", "b": [0.3093, 0.7014, 0.3499, 0.7199]}, {"w": "add", "b": [0.3558, 0.7014, 0.3899, 0.7199]}, {"w": "a", "b": [0.3958, 0.7014, 0.4063, 0.7199]}, {"w": "few", "b": [0.4122, 0.7014, 0.4476, 0.7199]}, {"w": "Dense", "b": [0.4535, 0.7024, 0.5243, 0.7213]}, {"w": "layers", "b": [0.5303, 0.7014, 0.5866, 0.7199]}, {"w": "on", "b": [0.5925, 0.7014, 0.6162, 0.7199]}, {"w": "top.", "b": [0.6221, 0.7014, 0.6582, 0.7199]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.2. Adding a classifier on top of the convnet", "words": [{"w": "Listing", "b": [0.1289, 0.7377, 0.182, 0.7516]}, {"w": "5.2.", "b": [0.1865, 0.7377, 0.213, 0.7516]}, {"w": "Adding", "b": [0.2174, 0.7377, 0.2735, 0.7516]}, {"w": "a", "b": [0.278, 0.7377, 0.2868, 0.7516]}, {"w": "classifier", "b": [0.2913, 0.7377, 0.3581, 0.7516]}, {"w": "on", "b": [0.3626, 0.7377, 0.3813, 0.7516]}, {"w": "top", "b": [0.3857, 0.7377, 0.4103, 0.7516]}, {"w": "of", "b": [0.4147, 0.7377, 0.4295, 0.7516]}, {"w": "the", "b": [0.4339, 0.7377, 0.4575, 0.7516]}, {"w": "convnet", "b": [0.462, 0.7377, 0.521, 0.7516]}]}, {"id": "b_6", "type": "paragraph", "text": "model.add(layers.Flatten()) model.add(layers.Dense(64, activation='relu')) model.add(layers.Dense(10, activation='softmax'))", "words": [{"w": "model.add(layers.Flatten())", "b": [0.1348, 0.7643, 0.4217, 0.7785]}, {"w": "model.add(layers.Dense(64,", "b": [0.1348, 0.7785, 0.4111, 0.7927]}, {"w": "activation='relu'))", "b": [0.4217, 0.7785, 0.6236, 0.7927]}, {"w": "model.add(layers.Dense(10,", "b": [0.1348, 0.7927, 0.4111, 0.8069]}, {"w": "activation='softmax'))", "b": [0.4217, 0.7927, 0.6555, 0.8069]}]}, {"id": "b_7", "type": "paragraph", "text": "We’ll do 10-way classification, using a final layer with 10 outputs and a softmax activation. Here’s what the network looks like now:", "words": [{"w": "We’ll", "b": [0.1289, 0.8283, 0.1808, 0.8468]}, {"w": "do", "b": [0.1867, 0.8283, 0.2103, 0.8468]}, {"w": "10-way", "b": [0.2162, 0.8283, 0.287, 0.8468]}, {"w": "classification,", "b": [0.2929, 0.8283, 0.4234, 0.8468]}, {"w": "using", "b": [0.4293, 0.8283, 0.4805, 0.8468]}, {"w": "a", "b": [0.4864, 0.8283, 0.4969, 0.8468]}, {"w": "final", "b": [0.5028, 0.8283, 0.5461, 0.8468]}, {"w": "layer", "b": [0.552, 0.8283, 0.5992, 0.8468]}, {"w": "with", "b": [0.6051, 0.8283, 0.6471, 0.8468]}, {"w": "10", "b": [0.653, 0.8283, 0.6766, 0.8468]}, {"w": "outputs", "b": [0.6825, 0.8283, 0.752, 0.8468]}, {"w": "and", "b": [0.7579, 0.8283, 0.792, 0.8468]}, {"w": "a", "b": [0.7979, 0.8283, 0.8084, 0.8468]}, {"w": "softmax", "b": [0.1289, 0.8475, 0.205, 0.8659]}, {"w": "activation.", "b": [0.2109, 0.8475, 0.3099, 0.8659]}, {"w": "Here’s", "b": [0.3158, 0.8475, 0.3774, 0.8659]}, {"w": "what", "b": [0.3833, 0.8475, 0.4292, 0.8659]}, {"w": "the", "b": [0.4351, 0.8475, 0.464, 0.8659]}, {"w": "network", "b": [0.4699, 0.8475, 0.5473, 0.8659]}, {"w": "looks", "b": [0.5532, 0.8475, 0.6043, 0.8659]}, {"w": "like", "b": [0.6102, 0.8475, 0.6457, 0.8659]}, {"w": "now:", "b": [0.6516, 0.8475, 0.6988, 0.8659]}]}, {"id": "b_8", "type": "paragraph", "text": ">>> model.summary() Layer (type) Output Shape Param #", "words": [{"w": ">>>", "b": [0.1348, 0.8828, 0.1667, 0.897]}, {"w": "model.summary()", "b": [0.1773, 0.8828, 0.3367, 0.897]}, {"w": "Layer", "b": [0.1348, 0.897, 0.1879, 0.9112]}, {"w": "(type)", "b": [0.1985, 0.897, 0.2623, 0.9112]}, {"w": "Output", "b": [0.4855, 0.897, 0.5492, 0.9112]}, {"w": "Shape", "b": [0.5598, 0.897, 0.613, 0.9112]}, {"w": "Param", "b": [0.7192, 0.897, 0.7724, 0.9112]}, {"w": "#", "b": [0.783, 0.897, 0.7936, 0.9112]}]}]}, {"page": 173, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "================================================================ conv2d_1 (Conv2D) (None, 26, 26, 32) 320 ________________________________________________________________ maxpooling2d_1 (MaxPooling2D) (None, 13, 13, 32) 0 ________________________________________________________________ conv2d_2 (Conv2D) (None, 11, 11, 64) 18496 ________________________________________________________________ maxpooling2d_2 (MaxPooling2D) (None, 5, 5, 64) 0 ________________________________________________________________ conv2d_3 (Conv2D) (None, 3, 3, 64) 36928 ________________________________________________________________ flatten_1 (Flatten) (None, 576) 0 ________________________________________________________________ dense_1 (Dense) (None, 64) 36928 ________________________________________________________________ dense_2 (Dense) (None, 10) 650 ================================================================ Total params: 93,322 Trainable params: 93,322 Non-trainable params: 0", "words": [{"w": "================================================================", "b": [0.1348, 0.0851, 0.8149, 0.0993]}, {"w": "conv2d_1", "b": [0.1348, 0.0993, 0.2198, 0.1135]}, {"w": "(Conv2D)", "b": [0.2304, 0.0993, 0.3154, 0.1135]}, {"w": "(None,", "b": [0.4855, 0.0993, 0.5492, 0.1135]}, {"w": "26,", "b": [0.5598, 0.0993, 0.5917, 0.1135]}, {"w": "26,", "b": [0.6024, 0.0993, 0.6342, 0.1135]}, {"w": "32)", "b": [0.6449, 0.0993, 0.6767, 0.1135]}, {"w": "320", "b": [0.7192, 0.0993, 0.7511, 0.1135]}, {"w": "________________________________________________________________", "b": [0.1348, 0.1135, 0.8149, 0.1277]}, {"w": "maxpooling2d_1", "b": [0.1348, 0.1277, 0.2836, 0.1418]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.1277, 0.443, 0.1418]}, {"w": "(None,", "b": [0.4855, 0.1277, 0.5492, 0.1418]}, {"w": "13,", "b": [0.5598, 0.1277, 0.5917, 0.1418]}, {"w": "13,", "b": [0.6024, 0.1277, 0.6342, 0.1418]}, {"w": "32)", "b": [0.6449, 0.1277, 0.6767, 0.1418]}, {"w": "0", "b": [0.7192, 0.1277, 0.7299, 0.1418]}, {"w": "________________________________________________________________", "b": [0.1348, 0.1419, 0.8149, 0.156]}, {"w": "conv2d_2", "b": [0.1348, 0.156, 0.2198, 0.1702]}, {"w": "(Conv2D)", "b": [0.2304, 0.156, 0.3154, 0.1702]}, {"w": "(None,", "b": [0.4855, 0.156, 0.5492, 0.1702]}, {"w": "11,", "b": [0.5598, 0.156, 0.5917, 0.1702]}, {"w": "11,", "b": [0.6024, 0.156, 0.6342, 0.1702]}, {"w": "64)", "b": [0.6449, 0.156, 0.6767, 0.1702]}, {"w": "18496", "b": [0.7192, 0.156, 0.7724, 0.1702]}, {"w": "________________________________________________________________", "b": [0.1348, 0.1702, 0.8149, 0.1844]}, {"w": "maxpooling2d_2", "b": [0.1348, 0.1844, 0.2836, 0.1986]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.1844, 0.443, 0.1986]}, {"w": "(None,", "b": [0.4855, 0.1844, 0.5492, 0.1986]}, {"w": "5,", "b": [0.5598, 0.1844, 0.5811, 0.1986]}, {"w": "5,", "b": [0.5917, 0.1844, 0.613, 0.1986]}, {"w": "64)", "b": [0.6236, 0.1844, 0.6555, 0.1986]}, {"w": "0", "b": [0.7192, 0.1844, 0.7299, 0.1986]}, {"w": "________________________________________________________________", "b": [0.1348, 0.1986, 0.8149, 0.2128]}, {"w": "conv2d_3", "b": [0.1348, 0.2128, 0.2198, 0.227]}, {"w": "(Conv2D)", "b": [0.2304, 0.2128, 0.3154, 0.227]}, {"w": "(None,", "b": [0.4855, 0.2128, 0.5492, 0.227]}, {"w": "3,", "b": [0.5598, 0.2128, 0.5811, 0.227]}, {"w": "3,", "b": [0.5917, 0.2128, 0.613, 0.227]}, {"w": "64)", "b": [0.6236, 0.2128, 0.6555, 0.227]}, {"w": "36928", "b": [0.7192, 0.2128, 0.7724, 0.227]}, {"w": "________________________________________________________________", "b": [0.1348, 0.227, 0.8149, 0.2411]}, {"w": "flatten_1", "b": [0.1348, 0.2411, 0.2304, 0.2553]}, {"w": "(Flatten)", "b": [0.241, 0.2411, 0.3367, 0.2553]}, {"w": "(None,", "b": [0.4855, 0.2411, 0.5492, 0.2553]}, {"w": "576)", "b": [0.5598, 0.2411, 0.6024, 0.2553]}, {"w": "0", "b": [0.7192, 0.2411, 0.7299, 0.2553]}, {"w": "________________________________________________________________", "b": [0.1348, 0.2553, 0.8149, 0.2695]}, {"w": "dense_1", "b": [0.1348, 0.2695, 0.2092, 0.2837]}, {"w": "(Dense)", "b": [0.2198, 0.2695, 0.2942, 0.2837]}, {"w": "(None,", "b": [0.4855, 0.2695, 0.5492, 0.2837]}, {"w": "64)", "b": [0.5598, 0.2695, 0.5917, 0.2837]}, {"w": "36928", "b": [0.7192, 0.2695, 0.7724, 0.2837]}, {"w": "________________________________________________________________", "b": [0.1348, 0.2837, 0.8149, 0.2979]}, {"w": "dense_2", "b": [0.1348, 0.2979, 0.2092, 0.3121]}, {"w": "(Dense)", "b": [0.2198, 0.2979, 0.2942, 0.3121]}, {"w": "(None,", "b": [0.4855, 0.2979, 0.5492, 0.3121]}, {"w": "10)", "b": [0.5598, 0.2979, 0.5917, 0.3121]}, {"w": "650", "b": [0.7192, 0.2979, 0.7511, 0.3121]}, {"w": "================================================================", "b": [0.1348, 0.3121, 0.8149, 0.3262]}, {"w": "Total", "b": [0.1348, 0.3263, 0.1879, 0.3404]}, {"w": "params:", "b": [0.1985, 0.3263, 0.2729, 0.3404]}, {"w": "93,322", "b": [0.2836, 0.3263, 0.3473, 0.3404]}, {"w": "Trainable", "b": [0.1348, 0.3404, 0.2304, 0.3546]}, {"w": "params:", "b": [0.241, 0.3404, 0.3154, 0.3546]}, {"w": "93,322", "b": [0.3261, 0.3404, 0.3898, 0.3546]}, {"w": "Non-trainable", "b": [0.1348, 0.3546, 0.2729, 0.3688]}, {"w": "params:", "b": [0.2836, 0.3546, 0.3579, 0.3688]}, {"w": "0", "b": [0.3686, 0.3546, 0.3792, 0.3688]}]}, {"id": "b_1", "type": "paragraph", "text": "As you can see, the (3, 3, 64) outputs are flattened into vectors of shape (576,) before going through two Dense layers.", "words": [{"w": "As", "b": [0.1289, 0.3902, 0.1551, 0.4087]}, {"w": "you", "b": [0.161, 0.3902, 0.1964, 0.4087]}, {"w": "can", "b": [0.2023, 0.3902, 0.2351, 0.4087]}, {"w": "see,", "b": [0.241, 0.3902, 0.2771, 0.4087]}, {"w": "the", "b": [0.283, 0.3902, 0.3118, 0.4087]}, {"w": "(3,", "b": [0.3177, 0.3912, 0.3602, 0.4101]}, {"w": "3,", "b": [0.3744, 0.3912, 0.4027, 0.4101]}, {"w": "64)", "b": [0.4169, 0.3912, 0.4594, 0.4101]}, {"w": "outputs", "b": [0.4653, 0.3902, 0.5349, 0.4087]}, {"w": "are", "b": [0.5408, 0.3902, 0.5696, 0.4087]}, {"w": "flattened", "b": [0.5755, 0.3902, 0.6581, 0.4087]}, {"w": "into", "b": [0.664, 0.3902, 0.7008, 0.4087]}, {"w": "vectors", "b": [0.7067, 0.3902, 0.7749, 0.4087]}, {"w": "of", "b": [0.7808, 0.3902, 0.8005, 0.4087]}, {"w": "shape", "b": [0.8064, 0.3902, 0.8601, 0.4087]}, {"w": "(576,)", "b": [0.1289, 0.4112, 0.2139, 0.4301]}, {"w": "before", "b": [0.2198, 0.4102, 0.2801, 0.4287]}, {"w": "going", "b": [0.286, 0.4102, 0.3398, 0.4287]}, {"w": "through", "b": [0.3457, 0.4102, 0.4192, 0.4287]}, {"w": "two", "b": [0.4251, 0.4102, 0.4605, 0.4287]}, {"w": "Dense", "b": [0.4664, 0.4112, 0.5372, 0.4301]}, {"w": "layers.", "b": [0.5431, 0.4102, 0.6054, 0.4287]}]}, {"id": "b_2", "type": "paragraph", "text": "Now, let’s train the convnet on the MNIST digits. We’ll reuse a lot of the code from the MNIST example in chapter 2.", "words": [{"w": "Now,", "b": [0.1289, 0.4511, 0.1792, 0.4696]}, {"w": "let���s", "b": [0.1851, 0.4511, 0.2244, 0.4696]}, {"w": "train", "b": [0.2303, 0.4511, 0.2736, 0.4696]}, {"w": "the", "b": [0.2795, 0.4511, 0.3084, 0.4696]}, {"w": "convnet", "b": [0.3143, 0.4511, 0.389, 0.4696]}, {"w": "on", "b": [0.3949, 0.4511, 0.4186, 0.4696]}, {"w": "the", "b": [0.4245, 0.4511, 0.4533, 0.4696]}, {"w": "MNIST", "b": [0.4592, 0.4511, 0.5327, 0.4696]}, {"w": "digits.", "b": [0.5386, 0.4511, 0.597, 0.4696]}, {"w": "We’ll", "b": [0.6029, 0.4511, 0.6547, 0.4696]}, {"w": "reuse", "b": [0.6606, 0.4511, 0.7105, 0.4696]}, {"w": "a", "b": [0.7164, 0.4511, 0.7269, 0.4696]}, {"w": "lot", "b": [0.7328, 0.4511, 0.7577, 0.4696]}, {"w": "of", "b": [0.7636, 0.4511, 0.7833, 0.4696]}, {"w": "the", "b": [0.7892, 0.4511, 0.818, 0.4696]}, {"w": "code", "b": [0.8239, 0.4511, 0.8685, 0.4696]}, {"w": "from", "b": [0.1289, 0.4703, 0.1748, 0.4888]}, {"w": "the", "b": [0.1807, 0.4703, 0.2095, 0.4888]}, {"w": "MNIST", "b": [0.2154, 0.4703, 0.2889, 0.4888]}, {"w": "example", "b": [0.2948, 0.4703, 0.3748, 0.4888]}, {"w": "in", "b": [0.3807, 0.4703, 0.3991, 0.4888]}, {"w": "chapter", "b": [0.405, 0.4703, 0.4745, 0.4888]}, {"w": "2.", "b": [0.4804, 0.4703, 0.4981, 0.4888]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.3. Training the convnet on MNIST images", "words": [{"w": "Listing", "b": [0.1289, 0.5057, 0.182, 0.5196]}, {"w": "5.3.", "b": [0.1865, 0.5057, 0.213, 0.5196]}, {"w": "Training", "b": [0.2174, 0.5057, 0.283, 0.5196]}, {"w": "the", "b": [0.2875, 0.5057, 0.3111, 0.5196]}, {"w": "convnet", "b": [0.3155, 0.5057, 0.3745, 0.5196]}, {"w": "on", "b": [0.379, 0.5057, 0.3977, 0.5196]}, {"w": "MNIST", "b": [0.4021, 0.5057, 0.4602, 0.5196]}, {"w": "images", "b": [0.4646, 0.5057, 0.5167, 0.5196]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.datasets import mnist from keras.utils import to_categorical (train_images, train_labels), (test_images, test_labels) = mnist.load_data() train_images = train_images.reshape((60000, 28, 28, 1)) train_images = train_images.astype('float32') / 255 test_images = test_images.reshape((10000, 28, 28, 1)) test_images = test_images.astype('float32') / 255 train_labels = to_categorical(train_labels) test_labels = to_categorical(test_labels) model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy']) model.fit(train_images, train_labels, epochs=5, batch_size=64)", "words": [{"w": "from", "b": [0.1348, 0.5323, 0.1773, 0.5465]}, {"w": "keras.datasets", "b": [0.1879, 0.5323, 0.3367, 0.5465]}, {"w": "import", "b": [0.3473, 0.5323, 0.4111, 0.5465]}, {"w": "mnist", "b": [0.4217, 0.5323, 0.4748, 0.5465]}, {"w": "from", "b": [0.1348, 0.5465, 0.1773, 0.5607]}, {"w": "keras.utils", "b": [0.1879, 0.5465, 0.3048, 0.5607]}, {"w": "import", "b": [0.3154, 0.5465, 0.3792, 0.5607]}, {"w": "to_categorical", "b": [0.3898, 0.5465, 0.5386, 0.5607]}, {"w": "(train_images,", "b": [0.1348, 0.5749, 0.2836, 0.5891]}, {"w": "train_labels),", "b": [0.2942, 0.5749, 0.443, 0.5891]}, {"w": "(test_images,", "b": [0.4536, 0.5749, 0.5917, 0.5891]}, {"w": "test_labels)", "b": [0.6024, 0.5749, 0.7299, 0.5891]}, {"w": "=", "b": [0.7405, 0.5749, 0.7511, 0.5891]}, {"w": "mnist.load_data()", "b": [0.1348, 0.5891, 0.3154, 0.6033]}, {"w": "train_images", "b": [0.1348, 0.6033, 0.2623, 0.6174]}, {"w": "=", "b": [0.2729, 0.6033, 0.2836, 0.6174]}, {"w": "train_images.reshape((60000,", "b": [0.2942, 0.6033, 0.5917, 0.6174]}, {"w": "28,", "b": [0.6024, 0.6033, 0.6342, 0.6174]}, {"w": "28,", "b": [0.6449, 0.6033, 0.6767, 0.6174]}, {"w": "1))", "b": [0.6874, 0.6033, 0.7192, 0.6174]}, {"w": "train_images", "b": [0.1348, 0.6175, 0.2623, 0.6316]}, {"w": "=", "b": [0.2729, 0.6175, 0.2836, 0.6316]}, {"w": "train_images.astype('float32')", "b": [0.2942, 0.6175, 0.613, 0.6316]}, {"w": "/", "b": [0.6236, 0.6175, 0.6342, 0.6316]}, {"w": "255", "b": [0.6449, 0.6175, 0.6767, 0.6316]}, {"w": "test_images", "b": [0.1348, 0.6458, 0.2517, 0.66]}, {"w": "=", "b": [0.2623, 0.6458, 0.2729, 0.66]}, {"w": "test_images.reshape((10000,", "b": [0.2836, 0.6458, 0.5705, 0.66]}, {"w": "28,", "b": [0.5811, 0.6458, 0.613, 0.66]}, {"w": "28,", "b": [0.6236, 0.6458, 0.6555, 0.66]}, {"w": "1))", "b": [0.6661, 0.6458, 0.698, 0.66]}, {"w": "test_images", "b": [0.1348, 0.66, 0.2517, 0.6742]}, {"w": "=", "b": [0.2623, 0.66, 0.2729, 0.6742]}, {"w": "test_images.astype('float32')", "b": [0.2836, 0.66, 0.5917, 0.6742]}, {"w": "/", "b": [0.6024, 0.66, 0.613, 0.6742]}, {"w": "255", "b": [0.6236, 0.66, 0.6555, 0.6742]}, {"w": "train_labels", "b": [0.1348, 0.6884, 0.2623, 0.7026]}, {"w": "=", "b": [0.2729, 0.6884, 0.2836, 0.7026]}, {"w": "to_categorical(train_labels)", "b": [0.2942, 0.6884, 0.5917, 0.7026]}, {"w": "test_labels", "b": [0.1348, 0.7026, 0.2517, 0.7167]}, {"w": "=", "b": [0.2623, 0.7026, 0.2729, 0.7167]}, {"w": "to_categorical(test_labels)", "b": [0.2836, 0.7026, 0.5705, 0.7167]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1348, 0.7309, 0.4961, 0.7451]}, {"w": "loss='categorical_crossentropy',", "b": [0.2836, 0.7451, 0.6236, 0.7593]}, {"w": "metrics=['accuracy'])", "b": [0.2836, 0.7593, 0.5067, 0.7735]}, {"w": "model.fit(train_images,", "b": [0.1348, 0.7735, 0.3792, 0.7877]}, {"w": "train_labels,", "b": [0.3898, 0.7735, 0.528, 0.7877]}, {"w": "epochs=5,", "b": [0.5386, 0.7735, 0.6342, 0.7877]}, {"w": "batch_size=64)", "b": [0.6449, 0.7735, 0.7936, 0.7877]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s evaluate the model on the test data:", "words": [{"w": "Let’s", "b": [0.1289, 0.8091, 0.1761, 0.8276]}, {"w": "evaluate", "b": [0.182, 0.8091, 0.2607, 0.8276]}, {"w": "the", "b": [0.2666, 0.8091, 0.2954, 0.8276]}, {"w": "model", "b": [0.3013, 0.8091, 0.3604, 0.8276]}, {"w": "on", "b": [0.3663, 0.8091, 0.3899, 0.8276]}, {"w": "the", "b": [0.3958, 0.8091, 0.4247, 0.8276]}, {"w": "test", "b": [0.4306, 0.8091, 0.4634, 0.8276]}, {"w": "data:", "b": [0.4693, 0.8091, 0.5152, 0.8276]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> test_loss, test_acc = model.evaluate(test_images, test_labels) >>> test_acc 0.99080000000000001", "words": [{"w": ">>>", "b": [0.1348, 0.8444, 0.1667, 0.8586]}, {"w": "test_loss,", "b": [0.1773, 0.8444, 0.2836, 0.8586]}, {"w": "test_acc", "b": [0.2942, 0.8444, 0.3792, 0.8586]}, {"w": "=", "b": [0.3898, 0.8444, 0.4004, 0.8586]}, {"w": "model.evaluate(test_images,", "b": [0.4111, 0.8444, 0.698, 0.8586]}, {"w": "test_labels)", "b": [0.7086, 0.8444, 0.8361, 0.8586]}, {"w": ">>>", "b": [0.1348, 0.8586, 0.1667, 0.8728]}, {"w": "test_acc", "b": [0.1773, 0.8586, 0.2623, 0.8728]}, {"w": "0.99080000000000001", "b": [0.1348, 0.8728, 0.3367, 0.887]}]}]}, {"page": 174, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Whereas the densely connected network from chapter 2 had a test accuracy of 97.8%, the basic convnet has a test accuracy of 99.3%: we decreased the error rate by 68% (relative). Not bad!", "words": [{"w": "Whereas", "b": [0.1289, 0.0857, 0.2115, 0.1041]}, {"w": "the", "b": [0.2174, 0.0857, 0.2462, 0.1041]}, {"w": "densely", "b": [0.2521, 0.0857, 0.3243, 0.1041]}, {"w": "connected", "b": [0.3302, 0.0857, 0.4259, 0.1041]}, {"w": "network", "b": [0.4318, 0.0857, 0.5092, 0.1041]}, {"w": "from", "b": [0.5151, 0.0857, 0.561, 0.1041]}, {"w": "chapter", "b": [0.5669, 0.0857, 0.6364, 0.1041]}, {"w": "2", "b": [0.6423, 0.0857, 0.6541, 0.1041]}, {"w": "had", "b": [0.66, 0.0857, 0.6941, 0.1041]}, {"w": "a", "b": [0.7, 0.0857, 0.7105, 0.1041]}, {"w": "test", "b": [0.7164, 0.0857, 0.7492, 0.1041]}, {"w": "accuracy", "b": [0.7551, 0.0857, 0.839, 0.1041]}, {"w": "of", "b": [0.8449, 0.0857, 0.8645, 0.1041]}, {"w": "97.8%,", "b": [0.1289, 0.1049, 0.1958, 0.1233]}, {"w": "the", "b": [0.2017, 0.1049, 0.2305, 0.1233]}, {"w": "basic", "b": [0.2364, 0.1049, 0.285, 0.1233]}, {"w": "convnet", "b": [0.2909, 0.1049, 0.3656, 0.1233]}, {"w": "has", "b": [0.3715, 0.1049, 0.403, 0.1233]}, {"w": "a", "b": [0.4089, 0.1049, 0.4194, 0.1233]}, {"w": "test", "b": [0.4253, 0.1049, 0.4581, 0.1233]}, {"w": "accuracy", "b": [0.464, 0.1049, 0.5479, 0.1233]}, {"w": "of", "b": [0.5538, 0.1049, 0.5735, 0.1233]}, {"w": "99.3%:", "b": [0.5794, 0.1049, 0.647, 0.1233]}, {"w": "we", "b": [0.6529, 0.1049, 0.6804, 0.1233]}, {"w": "decreased", "b": [0.6863, 0.1049, 0.7794, 0.1233]}, {"w": "the", "b": [0.7853, 0.1049, 0.8142, 0.1233]}, {"w": "error", "b": [0.8201, 0.1049, 0.8659, 0.1233]}, {"w": "rate", "b": [0.1289, 0.124, 0.1643, 0.1425]}, {"w": "by", "b": [0.1702, 0.124, 0.1938, 0.1425]}, {"w": "68%", "b": [0.1997, 0.124, 0.243, 0.1425]}, {"w": "(relative).", "b": [0.2489, 0.124, 0.3413, 0.1425]}, {"w": "Not", "b": [0.3472, 0.124, 0.3826, 0.1425]}, {"w": "bad!", "b": [0.3885, 0.124, 0.4305, 0.1425]}]}, {"id": "b_1", "type": "paragraph", "text": "But why does this simple convnet work so well, compared to a densely connected model? To answer this, let’s dive into what the Conv2D and MaxPooling2D layers do.", "words": [{"w": "But", "b": [0.1289, 0.1641, 0.163, 0.1826]}, {"w": "why", "b": [0.1689, 0.1641, 0.2096, 0.1826]}, {"w": "does", "b": [0.2155, 0.1641, 0.2588, 0.1826]}, {"w": "this", "b": [0.2647, 0.1641, 0.2988, 0.1826]}, {"w": "simple", "b": [0.3047, 0.1641, 0.3677, 0.1826]}, {"w": "convnet", "b": [0.3736, 0.1641, 0.4483, 0.1826]}, {"w": "work", "b": [0.4542, 0.1641, 0.5028, 0.1826]}, {"w": "so", "b": [0.5087, 0.1641, 0.5297, 0.1826]}, {"w": "well,", "b": [0.5356, 0.1641, 0.5821, 0.1826]}, {"w": "compared", "b": [0.588, 0.1641, 0.6812, 0.1826]}, {"w": "to", "b": [0.6871, 0.1641, 0.7054, 0.1826]}, {"w": "a", "b": [0.7113, 0.1641, 0.7218, 0.1826]}, {"w": "densely", "b": [0.7277, 0.1641, 0.7999, 0.1826]}, {"w": "connected", "b": [0.1289, 0.1833, 0.2246, 0.2018]}, {"w": "model?", "b": [0.2305, 0.1833, 0.3, 0.2018]}, {"w": "To", "b": [0.3059, 0.1833, 0.3305, 0.2018]}, {"w": "answer", "b": [0.3364, 0.1833, 0.4033, 0.2018]}, {"w": "this,", "b": [0.4092, 0.1833, 0.4492, 0.2018]}, {"w": "let’s", "b": [0.4551, 0.1833, 0.4945, 0.2018]}, {"w": "dive", "b": [0.5004, 0.1833, 0.541, 0.2018]}, {"w": "into", "b": [0.5469, 0.1833, 0.5837, 0.2018]}, {"w": "what", "b": [0.5896, 0.1833, 0.6355, 0.2018]}, {"w": "the", "b": [0.6414, 0.1833, 0.6702, 0.2018]}, {"w": "Conv2D", "b": [0.6761, 0.1843, 0.7611, 0.2032]}, {"w": "and", "b": [0.767, 0.1833, 0.8011, 0.2018]}, {"w": "MaxPooling2D", "b": [0.1289, 0.2043, 0.2989, 0.2232]}, {"w": "layers", "b": [0.3048, 0.2033, 0.3612, 0.2218]}, {"w": "do.", "b": [0.3671, 0.2033, 0.3966, 0.2218]}]}, {"id": "b_2", "type": "paragraph", "text": "5.1.1. The convolution operation", "words": [{"w": "5.1.1.", "b": [0.1289, 0.2484, 0.182, 0.2669]}, {"w": "The", "b": [0.1879, 0.2484, 0.2273, 0.2669]}, {"w": "convolution", "b": [0.2332, 0.2484, 0.3513, 0.2669]}, {"w": "operation", "b": [0.3572, 0.2484, 0.4543, 0.2669]}]}, {"id": "b_3", "type": "paragraph", "text": "The fundamental difference between a densely connected layer and a convolution layer is this: Dense layers learn global patterns in their input feature space (for example, for a MNIST digit, patterns involving all pixels), whereas convolution layers learn local patterns (see figure 5.1): in the case of images, patterns found in small 2D windows of the inputs. In the previous example, these windows were all 3 × 3.", "words": [{"w": "The", "b": [0.1289, 0.2884, 0.1656, 0.3069]}, {"w": "fundamental", "b": [0.1715, 0.2884, 0.2896, 0.3069]}, {"w": "difference", "b": [0.2955, 0.2884, 0.3907, 0.3069]}, {"w": "between", "b": [0.3966, 0.2884, 0.4753, 0.3069]}, {"w": "a", "b": [0.4812, 0.2884, 0.4917, 0.3069]}, {"w": "densely", "b": [0.4976, 0.2884, 0.5697, 0.3069]}, {"w": "connected", "b": [0.5756, 0.2884, 0.6714, 0.3069]}, {"w": "layer", "b": [0.6773, 0.2884, 0.7245, 0.3069]}, {"w": "and", "b": [0.7304, 0.2884, 0.7645, 0.3069]}, {"w": "a", "b": [0.7704, 0.2884, 0.7809, 0.3069]}, {"w": "convolution", "b": [0.1289, 0.3076, 0.2417, 0.3261]}, {"w": "layer", "b": [0.2476, 0.3076, 0.2948, 0.3261]}, {"w": "is", "b": [0.3007, 0.3076, 0.3165, 0.3261]}, {"w": "this:", "b": [0.3224, 0.3076, 0.3631, 0.3261]}, {"w": "Dense", "b": [0.3689, 0.3086, 0.4398, 0.3275]}, {"w": "layers", "b": [0.4457, 0.3076, 0.5021, 0.3261]}, {"w": "learn", "b": [0.508, 0.3076, 0.5552, 0.3261]}, {"w": "global", "b": [0.5611, 0.3076, 0.6201, 0.3261]}, {"w": "patterns", "b": [0.626, 0.3076, 0.7008, 0.3261]}, {"w": "in", "b": [0.7067, 0.3076, 0.7251, 0.3261]}, {"w": "their", "b": [0.731, 0.3076, 0.7742, 0.3261]}, {"w": "input", "b": [0.7801, 0.3076, 0.8287, 0.3261]}, {"w": "feature", "b": [0.1289, 0.3276, 0.1944, 0.3461]}, {"w": "space", "b": [0.2003, 0.3276, 0.2528, 0.3461]}, {"w": "(for", "b": [0.2587, 0.3276, 0.2941, 0.3461]}, {"w": "example,", "b": [0.3, 0.3276, 0.3859, 0.3461]}, {"w": "for", "b": [0.3918, 0.3276, 0.4193, 0.3461]}, {"w": "a", "b": [0.4252, 0.3276, 0.4357, 0.3461]}, {"w": "MNIST", "b": [0.4416, 0.3276, 0.5151, 0.3461]}, {"w": "digit,", "b": [0.521, 0.3276, 0.5702, 0.3461]}, {"w": "patterns", "b": [0.5761, 0.3276, 0.6509, 0.3461]}, {"w": "involving", "b": [0.6568, 0.3276, 0.7473, 0.3461]}, {"w": "all", "b": [0.7532, 0.3276, 0.7768, 0.3461]}, {"w": "pixels),", "b": [0.7827, 0.3276, 0.8529, 0.3461]}, {"w": "whereas", "b": [0.1289, 0.3468, 0.2062, 0.3653]}, {"w": "convolution", "b": [0.2121, 0.3468, 0.325, 0.3653]}, {"w": "layers", "b": [0.3309, 0.3468, 0.3873, 0.3653]}, {"w": "learn", "b": [0.3932, 0.3468, 0.4404, 0.3653]}, {"w": "local", "b": [0.4463, 0.3468, 0.4922, 0.3653]}, {"w": "patterns", "b": [0.4981, 0.3468, 0.5729, 0.3653]}, {"w": "(see", "b": [0.5788, 0.3468, 0.6168, 0.3653]}, {"w": "figure", "b": [0.6226, 0.3468, 0.679, 0.3653]}, {"w": "5.1):", "b": [0.6849, 0.3468, 0.7288, 0.3653]}, {"w": "in", "b": [0.7347, 0.3468, 0.7531, 0.3653]}, {"w": "the", "b": [0.759, 0.3468, 0.7879, 0.3653]}, {"w": "case", "b": [0.7938, 0.3468, 0.8344, 0.3653]}, {"w": "of", "b": [0.8403, 0.3468, 0.86, 0.3653]}, {"w": "images,", "b": [0.1289, 0.366, 0.2017, 0.3845]}, {"w": "patterns", "b": [0.2076, 0.366, 0.2823, 0.3845]}, {"w": "found", "b": [0.2883, 0.366, 0.3433, 0.3845]}, {"w": "in", "b": [0.3492, 0.366, 0.3676, 0.3845]}, {"w": "small", "b": [0.3735, 0.366, 0.4247, 0.3845]}, {"w": "2D", "b": [0.4306, 0.366, 0.4595, 0.3845]}, {"w": "windows", "b": [0.4654, 0.366, 0.5506, 0.3845]}, {"w": "of", "b": [0.5565, 0.366, 0.5762, 0.3845]}, {"w": "the", "b": [0.5821, 0.366, 0.611, 0.3845]}, {"w": "inputs.", "b": [0.6169, 0.366, 0.6805, 0.3845]}, {"w": "In", "b": [0.6864, 0.366, 0.7061, 0.3845]}, {"w": "the", "b": [0.712, 0.366, 0.7409, 0.3845]}, {"w": "previous", "b": [0.7468, 0.366, 0.8281, 0.3845]}, {"w": "example,", "b": [0.1289, 0.3852, 0.2148, 0.4037]}, {"w": "these", "b": [0.2207, 0.3852, 0.2692, 0.4037]}, {"w": "windows", "b": [0.2751, 0.3852, 0.3604, 0.4037]}, {"w": "were", "b": [0.3663, 0.3852, 0.4122, 0.4037]}, {"w": "all", "b": [0.4181, 0.3852, 0.4417, 0.4037]}, {"w": "3", "b": [0.4476, 0.3852, 0.4594, 0.4037]}, {"w": "×", "b": [0.4653, 0.3852, 0.4786, 0.4037]}, {"w": "3.", "b": [0.4845, 0.3852, 0.5022, 0.4037]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 5.1. Images can be broken into local patterns such as edges, textures, and so on.", "words": [{"w": "Figure", "b": [0.1289, 0.4206, 0.1787, 0.4345]}, {"w": "5.1.", "b": [0.1832, 0.4206, 0.2097, 0.4345]}, {"w": "Images", "b": [0.2141, 0.4206, 0.2682, 0.4345]}, {"w": "can", "b": [0.2727, 0.4206, 0.2992, 0.4345]}, {"w": "be", "b": [0.3037, 0.4206, 0.3214, 0.4345]}, {"w": "broken", "b": [0.3258, 0.4206, 0.3796, 0.4345]}, {"w": "into", "b": [0.384, 0.4206, 0.4136, 0.4345]}, {"w": "local", "b": [0.418, 0.4206, 0.4534, 0.4345]}, {"w": "patterns", "b": [0.4578, 0.4206, 0.5208, 0.4345]}, {"w": "such", "b": [0.5252, 0.4206, 0.5597, 0.4345]}, {"w": "as", "b": [0.5641, 0.4206, 0.5798, 0.4345]}, {"w": "edges,", "b": [0.5843, 0.4206, 0.63, 0.4345]}, {"w": "textures,", "b": [0.6345, 0.4206, 0.6995, 0.4345]}, {"w": "and", "b": [0.704, 0.4206, 0.7325, 0.4345]}, {"w": "so", "b": [0.7369, 0.4206, 0.7527, 0.4345]}, {"w": "on.", "b": [0.7571, 0.4206, 0.7802, 0.4345]}]}, {"id": "b_5", "type": "paragraph", "text": "This key characteristic gives convnets two interesting properties:", "words": [{"w": "This", "b": [0.1289, 0.6856, 0.1709, 0.7041]}, {"w": "key", "b": [0.1768, 0.6856, 0.2109, 0.7041]}, {"w": "characteristic", "b": [0.2168, 0.6856, 0.3427, 0.7041]}, {"w": "gives", "b": [0.3486, 0.6856, 0.3984, 0.7041]}, {"w": "convnets", "b": [0.4043, 0.6856, 0.4883, 0.7041]}, {"w": "two", "b": [0.4942, 0.6856, 0.5296, 0.7041]}, {"w": "interesting", "b": [0.5355, 0.6856, 0.6352, 0.7041]}, {"w": "properties:", "b": [0.6411, 0.6856, 0.7421, 0.7041]}]}, {"id": "b_6", "type": "paragraph", "text": "The patterns they learn are translation invariant. After learning a certain pattern in the lower-right corner of a picture, a convnet can recognize it anywhere: for example, in the upper-left corner. A densely connected network would have to learn the pattern anew if it appeared at a new location. This makes convnets data efficient when processing images (because the visual world is fundamentally translation invariant): they need fewer training samples to learn representations that have generalization power. They can learn spatial hierarchies of patterns (see figure 5.2). A first convolution layer will learn small local patterns such as edges, a second", "words": [{"w": "The", "b": [0.1761, 0.7215, 0.2141, 0.74]}, {"w": "patterns", "b": [0.2201, 0.7215, 0.2988, 0.74]}, {"w": "they", "b": [0.3047, 0.7215, 0.3454, 0.74]}, {"w": "learn", "b": [0.3513, 0.7215, 0.4024, 0.74]}, {"w": "are", "b": [0.4083, 0.7215, 0.4398, 0.74]}, {"w": "translation", "b": [0.4457, 0.7215, 0.552, 0.74]}, {"w": "invariant.", "b": [0.5579, 0.7215, 0.6531, 0.74]}, {"w": "After", "b": [0.659, 0.7215, 0.7088, 0.74]}, {"w": "learning", "b": [0.7147, 0.7215, 0.7921, 0.74]}, {"w": "a", "b": [0.798, 0.7215, 0.8085, 0.74]}, {"w": "certain", "b": [0.1761, 0.7407, 0.2404, 0.7591]}, {"w": "pattern", "b": [0.2463, 0.7407, 0.3118, 0.7591]}, {"w": "in", "b": [0.3177, 0.7407, 0.3361, 0.7591]}, {"w": "the", "b": [0.342, 0.7407, 0.3709, 0.7591]}, {"w": "lower-right", "b": [0.3768, 0.7407, 0.4825, 0.7591]}, {"w": "corner", "b": [0.4884, 0.7407, 0.5487, 0.7591]}, {"w": "of", "b": [0.5546, 0.7407, 0.5743, 0.7591]}, {"w": "a", "b": [0.5802, 0.7407, 0.5907, 0.7591]}, {"w": "picture,", "b": [0.5966, 0.7407, 0.6681, 0.7591]}, {"w": "a", "b": [0.674, 0.7407, 0.6845, 0.7591]}, {"w": "convnet", "b": [0.6904, 0.7407, 0.7651, 0.7591]}, {"w": "can", "b": [0.771, 0.7407, 0.8038, 0.7591]}, {"w": "recognize", "b": [0.1761, 0.7599, 0.2679, 0.7783]}, {"w": "it", "b": [0.2738, 0.7599, 0.2869, 0.7783]}, {"w": "anywhere:", "b": [0.2928, 0.7599, 0.3912, 0.7783]}, {"w": "for", "b": [0.3971, 0.7599, 0.4246, 0.7783]}, {"w": "example,", "b": [0.4305, 0.7599, 0.5164, 0.7783]}, {"w": "in", "b": [0.5223, 0.7599, 0.5407, 0.7783]}, {"w": "the", "b": [0.5466, 0.7599, 0.5754, 0.7783]}, {"w": "upper-left", "b": [0.5813, 0.7599, 0.6739, 0.7783]}, {"w": "corner.", "b": [0.6798, 0.7599, 0.7447, 0.7783]}, {"w": "A", "b": [0.7506, 0.7599, 0.7677, 0.7783]}, {"w": "densely", "b": [0.7736, 0.7599, 0.8457, 0.7783]}, {"w": "connected", "b": [0.1761, 0.779, 0.2718, 0.7975]}, {"w": "network", "b": [0.2777, 0.779, 0.3551, 0.7975]}, {"w": "would", "b": [0.361, 0.779, 0.4201, 0.7975]}, {"w": "have", "b": [0.426, 0.779, 0.4706, 0.7975]}, {"w": "to", "b": [0.4765, 0.779, 0.4948, 0.7975]}, {"w": "learn", "b": [0.5007, 0.779, 0.5479, 0.7975]}, {"w": "the", "b": [0.5538, 0.779, 0.5827, 0.7975]}, {"w": "pattern", "b": [0.5886, 0.779, 0.6542, 0.7975]}, {"w": "anew", "b": [0.6601, 0.779, 0.7099, 0.7975]}, {"w": "if", "b": [0.7158, 0.779, 0.7302, 0.7975]}, {"w": "it", "b": [0.7362, 0.779, 0.7493, 0.7975]}, {"w": "appeared", "b": [0.7552, 0.779, 0.8404, 0.7975]}, {"w": "at", "b": [0.8463, 0.779, 0.8634, 0.7975]}, {"w": "a", "b": [0.1761, 0.7982, 0.1866, 0.8167]}, {"w": "new", "b": [0.1925, 0.7982, 0.2318, 0.8167]}, {"w": "location.", "b": [0.2377, 0.7982, 0.3197, 0.8167]}, {"w": "This", "b": [0.3256, 0.7982, 0.3676, 0.8167]}, {"w": "makes", "b": [0.3735, 0.7982, 0.4338, 0.8167]}, {"w": "convnets", "b": [0.4397, 0.7982, 0.5237, 0.8167]}, {"w": "data", "b": [0.5296, 0.7982, 0.5689, 0.8167]}, {"w": "efficient", "b": [0.5748, 0.7982, 0.6531, 0.8167]}, {"w": "when", "b": [0.659, 0.7982, 0.7101, 0.8167]}, {"w": "processing", "b": [0.716, 0.7982, 0.817, 0.8167]}, {"w": "images", "b": [0.1761, 0.8174, 0.243, 0.8359]}, {"w": "(because", "b": [0.2489, 0.8174, 0.3315, 0.8359]}, {"w": "the", "b": [0.3374, 0.8174, 0.3662, 0.8359]}, {"w": "visual", "b": [0.3721, 0.8174, 0.4286, 0.8359]}, {"w": "world", "b": [0.4345, 0.8174, 0.4896, 0.8359]}, {"w": "is", "b": [0.4955, 0.8174, 0.5112, 0.8359]}, {"w": "fundamentally", "b": [0.5171, 0.8174, 0.6523, 0.8359]}, {"w": "translation", "b": [0.6582, 0.8174, 0.7618, 0.8359]}, {"w": "invariant):", "b": [0.7677, 0.8174, 0.8687, 0.8359]}, {"w": "they", "b": [0.1761, 0.8366, 0.2168, 0.8551]}, {"w": "need", "b": [0.2227, 0.8366, 0.2673, 0.8551]}, {"w": "fewer", "b": [0.2732, 0.8366, 0.3269, 0.8551]}, {"w": "training", "b": [0.3328, 0.8366, 0.4063, 0.8551]}, {"w": "samples", "b": [0.4122, 0.8366, 0.4883, 0.8551]}, {"w": "to", "b": [0.4942, 0.8366, 0.5125, 0.8551]}, {"w": "learn", "b": [0.5184, 0.8366, 0.5657, 0.8551]}, {"w": "representations", "b": [0.5716, 0.8366, 0.7145, 0.8551]}, {"w": "that", "b": [0.7204, 0.8366, 0.7558, 0.8551]}, {"w": "have", "b": [0.7618, 0.8366, 0.8063, 0.8551]}, {"w": "generalization", "b": [0.1761, 0.8558, 0.3099, 0.8743]}, {"w": "power.", "b": [0.3158, 0.8558, 0.3794, 0.8743]}, {"w": "They", "b": [0.1761, 0.875, 0.2246, 0.8935]}, {"w": "can", "b": [0.2305, 0.875, 0.266, 0.8935]}, {"w": "learn", "b": [0.2719, 0.875, 0.323, 0.8935]}, {"w": "spatial", "b": [0.3289, 0.875, 0.3932, 0.8935]}, {"w": "hierarchies", "b": [0.3991, 0.875, 0.5094, 0.8935]}, {"w": "of", "b": [0.5153, 0.875, 0.5349, 0.8935]}, {"w": "patterns", "b": [0.5408, 0.875, 0.6196, 0.8935]}, {"w": "(see", "b": [0.6255, 0.875, 0.6635, 0.8935]}, {"w": "figure", "b": [0.6694, 0.875, 0.7284, 0.8935]}, {"w": "5.2).", "b": [0.7343, 0.875, 0.7776, 0.8935]}, {"w": "A", "b": [0.7835, 0.875, 0.8005, 0.8935]}, {"w": "first", "b": [0.8064, 0.875, 0.8445, 0.8935]}, {"w": "convolution", "b": [0.1761, 0.8942, 0.2889, 0.9127]}, {"w": "layer", "b": [0.2948, 0.8942, 0.342, 0.9127]}, {"w": "will", "b": [0.348, 0.8942, 0.3847, 0.9127]}, {"w": "learn", "b": [0.3906, 0.8942, 0.4378, 0.9127]}, {"w": "small", "b": [0.4437, 0.8942, 0.4949, 0.9127]}, {"w": "local", "b": [0.5008, 0.8942, 0.5467, 0.9127]}, {"w": "patterns", "b": [0.5526, 0.8942, 0.6274, 0.9127]}, {"w": "such", "b": [0.6333, 0.8942, 0.6765, 0.9127]}, {"w": "as", "b": [0.6825, 0.8942, 0.7021, 0.9127]}, {"w": "edges,", "b": [0.708, 0.8942, 0.7677, 0.9127]}, {"w": "a", "b": [0.7736, 0.8942, 0.7841, 0.9127]}, {"w": "second", "b": [0.79, 0.8942, 0.8556, 0.9127]}]}]}, {"page": 175, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "convolution layer will learn larger patterns made of the features of the first layers, and so on. This allows convnets to efficiently learn increasingly complex and abstract visual concepts (because the visual world is fundamentally spatially hierarchical).", "words": [{"w": "convolution", "b": [0.1761, 0.0857, 0.2889, 0.1041]}, {"w": "layer", "b": [0.2948, 0.0857, 0.342, 0.1041]}, {"w": "will", "b": [0.348, 0.0857, 0.3847, 0.1041]}, {"w": "learn", "b": [0.3906, 0.0857, 0.4378, 0.1041]}, {"w": "larger", "b": [0.4437, 0.0857, 0.4983, 0.1041]}, {"w": "patterns", "b": [0.5042, 0.0857, 0.579, 0.1041]}, {"w": "made", "b": [0.5848, 0.0857, 0.636, 0.1041]}, {"w": "of", "b": [0.6419, 0.0857, 0.6616, 0.1041]}, {"w": "the", "b": [0.6675, 0.0857, 0.6963, 0.1041]}, {"w": "features", "b": [0.7022, 0.0857, 0.777, 0.1041]}, {"w": "of", "b": [0.7829, 0.0857, 0.8025, 0.1041]}, {"w": "the", "b": [0.8085, 0.0857, 0.8373, 0.1041]}, {"w": "first", "b": [0.1761, 0.1049, 0.2141, 0.1233]}, {"w": "layers,", "b": [0.2201, 0.1049, 0.2823, 0.1233]}, {"w": "and", "b": [0.2883, 0.1049, 0.3224, 0.1233]}, {"w": "so", "b": [0.3283, 0.1049, 0.3492, 0.1233]}, {"w": "on.", "b": [0.3552, 0.1049, 0.3847, 0.1233]}, {"w": "This", "b": [0.3906, 0.1049, 0.4326, 0.1233]}, {"w": "allows", "b": [0.4385, 0.1049, 0.5001, 0.1233]}, {"w": "convnets", "b": [0.506, 0.1049, 0.59, 0.1233]}, {"w": "to", "b": [0.5959, 0.1049, 0.6143, 0.1233]}, {"w": "efficiently", "b": [0.6202, 0.1049, 0.7168, 0.1233]}, {"w": "learn", "b": [0.7227, 0.1049, 0.7699, 0.1233]}, {"w": "increasingly", "b": [0.1761, 0.124, 0.2915, 0.1425]}, {"w": "complex", "b": [0.2974, 0.124, 0.3788, 0.1425]}, {"w": "and", "b": [0.3847, 0.124, 0.4188, 0.1425]}, {"w": "abstract", "b": [0.4247, 0.124, 0.4981, 0.1425]}, {"w": "visual", "b": [0.504, 0.124, 0.5604, 0.1425]}, {"w": "concepts", "b": [0.5663, 0.124, 0.6489, 0.1425]}, {"w": "(because", "b": [0.6548, 0.124, 0.7374, 0.1425]}, {"w": "the", "b": [0.7433, 0.124, 0.7721, 0.1425]}, {"w": "visual", "b": [0.778, 0.124, 0.8345, 0.1425]}, {"w": "world", "b": [0.1761, 0.1432, 0.2312, 0.1617]}, {"w": "is", "b": [0.2371, 0.1432, 0.2529, 0.1617]}, {"w": "fundamentally", "b": [0.2588, 0.1432, 0.3939, 0.1617]}, {"w": "spatially", "b": [0.3998, 0.1432, 0.4812, 0.1617]}, {"w": "hierarchical).", "b": [0.4871, 0.1432, 0.6167, 0.1617]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.2. The visual world forms a spatial hierarchy of visual modules: hyperlocal edges combine into local objects such as eyes or ears, which combine into high-level concepts such as “cat.”", "words": [{"w": "Figure", "b": [0.1289, 0.1787, 0.1787, 0.1925]}, {"w": "5.2.", "b": [0.1832, 0.1787, 0.2097, 0.1925]}, {"w": "The", "b": [0.2141, 0.1787, 0.2437, 0.1925]}, {"w": "visual", "b": [0.2481, 0.1787, 0.2924, 0.1925]}, {"w": "world", "b": [0.2968, 0.1787, 0.3411, 0.1925]}, {"w": "forms", "b": [0.3455, 0.1787, 0.3898, 0.1925]}, {"w": "a", "b": [0.3942, 0.1787, 0.4031, 0.1925]}, {"w": "spatial", "b": [0.4075, 0.1787, 0.4577, 0.1925]}, {"w": "hierarchy", "b": [0.4621, 0.1787, 0.5356, 0.1925]}, {"w": "of", "b": [0.54, 0.1787, 0.5547, 0.1925]}, {"w": "visual", "b": [0.5592, 0.1787, 0.6035, 0.1925]}, {"w": "modules:", "b": [0.6079, 0.1787, 0.6768, 0.1925]}, {"w": "hyperlocal", "b": [0.6812, 0.1787, 0.7609, 0.1925]}, {"w": "edges", "b": [0.7653, 0.1787, 0.8066, 0.1925]}, {"w": "combine", "b": [0.1289, 0.1928, 0.1928, 0.2067]}, {"w": "into", "b": [0.1973, 0.1928, 0.2268, 0.2067]}, {"w": "local", "b": [0.2312, 0.1928, 0.2666, 0.2067]}, {"w": "objects", "b": [0.2711, 0.1928, 0.3242, 0.2067]}, {"w": "such", "b": [0.3286, 0.1928, 0.3631, 0.2067]}, {"w": "as", "b": [0.3675, 0.1928, 0.3832, 0.2067]}, {"w": "eyes", "b": [0.3877, 0.1928, 0.4191, 0.2067]}, {"w": "or", "b": [0.4236, 0.1928, 0.4403, 0.2067]}, {"w": "ears,", "b": [0.4444, 0.1928, 0.4803, 0.2067]}, {"w": "which", "b": [0.4847, 0.1928, 0.53, 0.2067]}, {"w": "combine", "b": [0.5344, 0.1928, 0.5983, 0.2067]}, {"w": "into", "b": [0.6028, 0.1928, 0.6323, 0.2067]}, {"w": "high-level", "b": [0.6367, 0.1928, 0.7105, 0.2067]}, {"w": "concepts", "b": [0.7149, 0.1928, 0.7799, 0.2067]}, {"w": "such", "b": [0.7843, 0.1928, 0.8187, 0.2067]}, {"w": "as", "b": [0.8232, 0.1928, 0.8389, 0.2067]}, {"w": "“cat.”", "b": [0.1289, 0.207, 0.1736, 0.2209]}]}, {"id": "b_2", "type": "paragraph", "text": "Convolutions operate over 3D tensors, called feature maps, with two spatial axes (height and width) as well as a depth axis (also called the channels axis). For an RGB image, the dimension of the depth axis is 3, because the image has three color channels: red, green, and blue. For a black-and-white picture, like the MNIST digits, the depth is 1 (levels of gray). The convolution operation extracts patches from its input feature map and applies the same transformation to all of these patches, producing an output feature map. This output feature map is still a 3D tensor: it has a width and a height. Its depth can be arbitrary, because the output depth is a parameter of the layer, and the different channels in that depth axis no longer stand for specific colors as in RGB input; rather, they stand for filters. Filters encode specific aspects of the input data: at a high level, a single filter could encode the concept “presence of a face in the input,” for instance.", "words": [{"w": "Convolutions", "b": [0.1289, 0.5588, 0.2562, 0.5772]}, {"w": "operate", "b": [0.2621, 0.5588, 0.3316, 0.5772]}, {"w": "over", "b": [0.3375, 0.5588, 0.3794, 0.5772]}, {"w": "3D", "b": [0.3853, 0.5588, 0.4142, 0.5772]}, {"w": "tensors,", "b": [0.4201, 0.5588, 0.4929, 0.5772]}, {"w": "called", "b": [0.4988, 0.5588, 0.5552, 0.5772]}, {"w": "feature", "b": [0.561, 0.5588, 0.6271, 0.5772]}, {"w": "maps,", "b": [0.633, 0.5588, 0.6887, 0.5772]}, {"w": "with", "b": [0.6946, 0.5588, 0.7366, 0.5772]}, {"w": "two", "b": [0.7425, 0.5588, 0.7779, 0.5772]}, {"w": "spatial", "b": [0.7838, 0.5588, 0.8455, 0.5772]}, {"w": "axes", "b": [0.1289, 0.578, 0.1708, 0.5964]}, {"w": "(height", "b": [0.1767, 0.578, 0.2436, 0.5964]}, {"w": "and", "b": [0.2495, 0.578, 0.2836, 0.5964]}, {"w": "width)", "b": [0.2895, 0.578, 0.3499, 0.5964]}, {"w": "as", "b": [0.3558, 0.578, 0.3754, 0.5964]}, {"w": "well", "b": [0.3813, 0.578, 0.422, 0.5964]}, {"w": "as", "b": [0.4279, 0.578, 0.4476, 0.5964]}, {"w": "a", "b": [0.4535, 0.578, 0.464, 0.5964]}, {"w": "depth", "b": [0.4699, 0.578, 0.5223, 0.5964]}, {"w": "axis", "b": [0.5282, 0.578, 0.5662, 0.5964]}, {"w": "(also", "b": [0.5722, 0.578, 0.6181, 0.5964]}, {"w": "called", "b": [0.624, 0.578, 0.6804, 0.5964]}, {"w": "the", "b": [0.6863, 0.578, 0.7151, 0.5964]}, {"w": "channels", "b": [0.721, 0.578, 0.8049, 0.5964]}, {"w": "axis).", "b": [0.8108, 0.578, 0.8626, 0.5964]}, {"w": "For", "b": [0.1289, 0.5971, 0.1617, 0.6156]}, {"w": "an", "b": [0.1676, 0.5971, 0.1899, 0.6156]}, {"w": "RGB", "b": [0.1958, 0.5971, 0.2443, 0.6156]}, {"w": "image,", "b": [0.2502, 0.5971, 0.3139, 0.6156]}, {"w": "the", "b": [0.3198, 0.5971, 0.3486, 0.6156]}, {"w": "dimension", "b": [0.3545, 0.5971, 0.4529, 0.6156]}, {"w": "of", "b": [0.4588, 0.5971, 0.4785, 0.6156]}, {"w": "the", "b": [0.4844, 0.5971, 0.5133, 0.6156]}, {"w": "depth", "b": [0.5192, 0.5971, 0.5716, 0.6156]}, {"w": "axis", "b": [0.5775, 0.5971, 0.6156, 0.6156]}, {"w": "is", "b": [0.6215, 0.5971, 0.6372, 0.6156]}, {"w": "3,", "b": [0.6431, 0.5971, 0.6608, 0.6156]}, {"w": "because", "b": [0.6667, 0.5971, 0.7415, 0.6156]}, {"w": "the", "b": [0.7474, 0.5971, 0.7763, 0.6156]}, {"w": "image", "b": [0.7822, 0.5971, 0.8399, 0.6156]}, {"w": "has", "b": [0.1289, 0.6163, 0.1604, 0.6348]}, {"w": "three", "b": [0.1663, 0.6163, 0.2135, 0.6348]}, {"w": "color", "b": [0.2194, 0.6163, 0.2679, 0.6348]}, {"w": "channels:", "b": [0.2738, 0.6163, 0.363, 0.6348]}, {"w": "red,", "b": [0.3689, 0.6163, 0.405, 0.6348]}, {"w": "green,", "b": [0.4109, 0.6163, 0.4692, 0.6348]}, {"w": "and", "b": [0.4751, 0.6163, 0.5092, 0.6348]}, {"w": "blue.", "b": [0.5151, 0.6163, 0.5616, 0.6348]}, {"w": "For", "b": [0.5675, 0.6163, 0.6003, 0.6348]}, {"w": "a", "b": [0.6062, 0.6163, 0.6167, 0.6348]}, {"w": "black-and-white", "b": [0.6226, 0.6163, 0.7761, 0.6348]}, {"w": "picture,", "b": [0.782, 0.6163, 0.8535, 0.6348]}, {"w": "like", "b": [0.1289, 0.6355, 0.1643, 0.654]}, {"w": "the", "b": [0.1702, 0.6355, 0.1991, 0.654]}, {"w": "MNIST", "b": [0.205, 0.6355, 0.2784, 0.654]}, {"w": "digits,", "b": [0.2843, 0.6355, 0.3427, 0.654]}, {"w": "the", "b": [0.3486, 0.6355, 0.3775, 0.654]}, {"w": "depth", "b": [0.3834, 0.6355, 0.4359, 0.654]}, {"w": "is", "b": [0.4418, 0.6355, 0.4575, 0.654]}, {"w": "1", "b": [0.4634, 0.6355, 0.4752, 0.654]}, {"w": "(levels", "b": [0.4811, 0.6355, 0.5441, 0.654]}, {"w": "of", "b": [0.55, 0.6355, 0.5697, 0.654]}, {"w": "gray).", "b": [0.5756, 0.6355, 0.6313, 0.654]}, {"w": "The", "b": [0.6372, 0.6355, 0.6739, 0.654]}, {"w": "convolution", "b": [0.6798, 0.6355, 0.7927, 0.654]}, {"w": "operation", "b": [0.1289, 0.6547, 0.2181, 0.6732]}, {"w": "extracts", "b": [0.224, 0.6547, 0.2974, 0.6732]}, {"w": "patches", "b": [0.3033, 0.6547, 0.3741, 0.6732]}, {"w": "from", "b": [0.38, 0.6547, 0.4259, 0.6732]}, {"w": "its", "b": [0.4318, 0.6547, 0.4541, 0.6732]}, {"w": "input", "b": [0.46, 0.6547, 0.5086, 0.6732]}, {"w": "feature", "b": [0.5145, 0.6547, 0.58, 0.6732]}, {"w": "map", "b": [0.5859, 0.6547, 0.6266, 0.6732]}, {"w": "and", "b": [0.6325, 0.6547, 0.6666, 0.6732]}, {"w": "applies", "b": [0.6725, 0.6547, 0.7394, 0.6732]}, {"w": "the", "b": [0.7453, 0.6547, 0.7742, 0.6732]}, {"w": "same", "b": [0.7801, 0.6547, 0.8286, 0.6732]}, {"w": "transformation", "b": [0.1289, 0.6739, 0.2679, 0.6924]}, {"w": "to", "b": [0.2738, 0.6739, 0.2922, 0.6924]}, {"w": "all", "b": [0.2981, 0.6739, 0.3217, 0.6924]}, {"w": "of", "b": [0.3276, 0.6739, 0.3473, 0.6924]}, {"w": "these", "b": [0.3532, 0.6739, 0.4017, 0.6924]}, {"w": "patches,", "b": [0.4076, 0.6739, 0.4843, 0.6924]}, {"w": "producing", "b": [0.4903, 0.6739, 0.586, 0.6924]}, {"w": "an", "b": [0.5919, 0.6739, 0.6142, 0.6924]}, {"w": "output", "b": [0.62, 0.6739, 0.6804, 0.6924]}, {"w": "feature", "b": [0.6863, 0.6739, 0.7523, 0.6924]}, {"w": "map.", "b": [0.7582, 0.6739, 0.8048, 0.6924]}, {"w": "This", "b": [0.8107, 0.6739, 0.8527, 0.6924]}, {"w": "output", "b": [0.1289, 0.6931, 0.1892, 0.7116]}, {"w": "feature", "b": [0.1951, 0.6931, 0.2607, 0.7116]}, {"w": "map", "b": [0.2666, 0.6931, 0.3073, 0.7116]}, {"w": "is", "b": [0.3132, 0.6931, 0.3289, 0.7116]}, {"w": "still", "b": [0.3348, 0.6931, 0.3703, 0.7116]}, {"w": "a", "b": [0.3762, 0.6931, 0.3867, 0.7116]}, {"w": "3D", "b": [0.3926, 0.6931, 0.4214, 0.7116]}, {"w": "tensor:", "b": [0.4273, 0.6931, 0.4916, 0.7116]}, {"w": "it", "b": [0.4975, 0.6931, 0.5106, 0.7116]}, {"w": "has", "b": [0.5165, 0.6931, 0.548, 0.7116]}, {"w": "a", "b": [0.5539, 0.6931, 0.5644, 0.7116]}, {"w": "width", "b": [0.5703, 0.6931, 0.6241, 0.7116]}, {"w": "and", "b": [0.63, 0.6931, 0.6641, 0.7116]}, {"w": "a", "b": [0.67, 0.6931, 0.6805, 0.7116]}, {"w": "height.", "b": [0.6864, 0.6931, 0.7513, 0.7116]}, {"w": "Its", "b": [0.7572, 0.6931, 0.7809, 0.7116]}, {"w": "depth", "b": [0.7868, 0.6931, 0.8392, 0.7116]}, {"w": "can", "b": [0.1289, 0.7123, 0.1617, 0.7308]}, {"w": "be", "b": [0.1676, 0.7123, 0.1898, 0.7308]}, {"w": "arbitrary,", "b": [0.1958, 0.7123, 0.2814, 0.7308]}, {"w": "because", "b": [0.2873, 0.7123, 0.362, 0.7308]}, {"w": "the", "b": [0.368, 0.7123, 0.3968, 0.7308]}, {"w": "output", "b": [0.4027, 0.7123, 0.4631, 0.7308]}, {"w": "depth", "b": [0.4689, 0.7123, 0.5214, 0.7308]}, {"w": "is", "b": [0.5273, 0.7123, 0.5431, 0.7308]}, {"w": "a", "b": [0.549, 0.7123, 0.5595, 0.7308]}, {"w": "parameter", "b": [0.5654, 0.7123, 0.6598, 0.7308]}, {"w": "of", "b": [0.6657, 0.7123, 0.6854, 0.7308]}, {"w": "the", "b": [0.6913, 0.7123, 0.7201, 0.7308]}, {"w": "layer,", "b": [0.726, 0.7123, 0.7781, 0.7308]}, {"w": "and", "b": [0.784, 0.7123, 0.8181, 0.7308]}, {"w": "the", "b": [0.824, 0.7123, 0.8529, 0.7308]}, {"w": "different", "b": [0.1289, 0.7315, 0.2098, 0.75]}, {"w": "channels", "b": [0.2157, 0.7315, 0.2983, 0.75]}, {"w": "in", "b": [0.3042, 0.7315, 0.3226, 0.75]}, {"w": "that", "b": [0.3285, 0.7315, 0.3639, 0.75]}, {"w": "depth", "b": [0.3698, 0.7315, 0.4223, 0.75]}, {"w": "axis", "b": [0.4282, 0.7315, 0.4662, 0.75]}, {"w": "no", "b": [0.4721, 0.7315, 0.4957, 0.75]}, {"w": "longer", "b": [0.5016, 0.7315, 0.562, 0.75]}, {"w": "stand", "b": [0.5679, 0.7315, 0.6177, 0.75]}, {"w": "for", "b": [0.6236, 0.7315, 0.6512, 0.75]}, {"w": "specific", "b": [0.6571, 0.7315, 0.7305, 0.75]}, {"w": "colors", "b": [0.7364, 0.7315, 0.7941, 0.75]}, {"w": "as", "b": [0.8, 0.7315, 0.8197, 0.75]}, {"w": "in", "b": [0.8256, 0.7315, 0.844, 0.75]}, {"w": "RGB", "b": [0.1289, 0.7507, 0.1774, 0.7692]}, {"w": "input;", "b": [0.1833, 0.7507, 0.2384, 0.7692]}, {"w": "rather,", "b": [0.2444, 0.7507, 0.3044, 0.7692]}, {"w": "they", "b": [0.3103, 0.7507, 0.3509, 0.7692]}, {"w": "stand", "b": [0.3568, 0.7507, 0.4067, 0.7692]}, {"w": "for", "b": [0.4126, 0.7507, 0.4401, 0.7692]}, {"w": "filters.", "b": [0.446, 0.7507, 0.507, 0.7692]}, {"w": "Filters", "b": [0.5129, 0.7507, 0.5733, 0.7692]}, {"w": "encode", "b": [0.5792, 0.7507, 0.6461, 0.7692]}, {"w": "specific", "b": [0.652, 0.7507, 0.7254, 0.7692]}, {"w": "aspects", "b": [0.7313, 0.7507, 0.7995, 0.7692]}, {"w": "of", "b": [0.8054, 0.7507, 0.8251, 0.7692]}, {"w": "the", "b": [0.831, 0.7507, 0.8598, 0.7692]}, {"w": "input", "b": [0.1289, 0.7699, 0.1774, 0.7883]}, {"w": "data:", "b": [0.1833, 0.7699, 0.2292, 0.7883]}, {"w": "at", "b": [0.2351, 0.7699, 0.2522, 0.7883]}, {"w": "a", "b": [0.2581, 0.7699, 0.2686, 0.7883]}, {"w": "high", "b": [0.2745, 0.7699, 0.3165, 0.7883]}, {"w": "level,", "b": [0.3224, 0.7699, 0.3742, 0.7883]}, {"w": "a", "b": [0.3801, 0.7699, 0.3906, 0.7883]}, {"w": "single", "b": [0.3965, 0.7699, 0.4529, 0.7883]}, {"w": "filter", "b": [0.4588, 0.7699, 0.5047, 0.7883]}, {"w": "could", "b": [0.5106, 0.7699, 0.5631, 0.7883]}, {"w": "encode", "b": [0.569, 0.7699, 0.6359, 0.7883]}, {"w": "the", "b": [0.6418, 0.7699, 0.6706, 0.7883]}, {"w": "concept", "b": [0.6765, 0.7699, 0.75, 0.7883]}, {"w": "“presence", "b": [0.7559, 0.7699, 0.849, 0.7883]}, {"w": "of", "b": [0.1289, 0.7891, 0.1485, 0.8075]}, {"w": "a", "b": [0.1544, 0.7891, 0.1649, 0.8075]}, {"w": "face", "b": [0.1708, 0.7891, 0.2102, 0.8075]}, {"w": "in", "b": [0.2161, 0.7891, 0.2344, 0.8075]}, {"w": "the", "b": [0.2403, 0.7891, 0.2692, 0.8075]}, {"w": "input,”", "b": [0.2751, 0.7891, 0.34, 0.8075]}, {"w": "for", "b": [0.3459, 0.7891, 0.3735, 0.8075]}, {"w": "instance.", "b": [0.3794, 0.7891, 0.4627, 0.8075]}]}, {"id": "b_3", "type": "paragraph", "text": "In the MNIST example, the first convolution layer takes a feature map of size (28, 28, 1) and outputs a feature map of size (26, 26, 32): it computes 32 filters over its input. Each of these 32 output channels contains a 26 × 26 grid of values, which is a response map of the filter over the input,", "words": [{"w": "In", "b": [0.1289, 0.8291, 0.1485, 0.8476]}, {"w": "the", "b": [0.1545, 0.8291, 0.1833, 0.8476]}, {"w": "MNIST", "b": [0.1892, 0.8291, 0.2627, 0.8476]}, {"w": "example,", "b": [0.2686, 0.8291, 0.3545, 0.8476]}, {"w": "the", "b": [0.3604, 0.8291, 0.3893, 0.8476]}, {"w": "first", "b": [0.3952, 0.8291, 0.4332, 0.8476]}, {"w": "convolution", "b": [0.4391, 0.8291, 0.5519, 0.8476]}, {"w": "layer", "b": [0.5578, 0.8291, 0.605, 0.8476]}, {"w": "takes", "b": [0.6109, 0.8291, 0.6595, 0.8476]}, {"w": "a", "b": [0.6654, 0.8291, 0.6759, 0.8476]}, {"w": "feature", "b": [0.6818, 0.8291, 0.7473, 0.8476]}, {"w": "map", "b": [0.7532, 0.8291, 0.7939, 0.8476]}, {"w": "of", "b": [0.7998, 0.8291, 0.8195, 0.8476]}, {"w": "size", "b": [0.8254, 0.8291, 0.8621, 0.8476]}, {"w": "(28,", "b": [0.1289, 0.8493, 0.1856, 0.8682]}, {"w": "28,", "b": [0.1997, 0.8493, 0.2422, 0.8682]}, {"w": "1)", "b": [0.2564, 0.8493, 0.2847, 0.8682]}, {"w": "and", "b": [0.2907, 0.8483, 0.3248, 0.8668]}, {"w": "outputs", "b": [0.3307, 0.8483, 0.4002, 0.8668]}, {"w": "a", "b": [0.4061, 0.8483, 0.4166, 0.8668]}, {"w": "feature", "b": [0.4225, 0.8483, 0.4881, 0.8668]}, {"w": "map", "b": [0.494, 0.8483, 0.5346, 0.8668]}, {"w": "of", "b": [0.5405, 0.8483, 0.5602, 0.8668]}, {"w": "size", "b": [0.5661, 0.8483, 0.6028, 0.8668]}, {"w": "(26,", "b": [0.6087, 0.8493, 0.6654, 0.8682]}, {"w": "26,", "b": [0.6795, 0.8493, 0.722, 0.8682]}, {"w": "32):", "b": [0.7362, 0.8483, 0.7853, 0.8682]}, {"w": "it", "b": [0.7912, 0.8483, 0.8043, 0.8668]}, {"w": "computes", "b": [0.1289, 0.8683, 0.2194, 0.8868]}, {"w": "32", "b": [0.2253, 0.8683, 0.2489, 0.8868]}, {"w": "filters", "b": [0.2548, 0.8683, 0.3099, 0.8868]}, {"w": "over", "b": [0.3158, 0.8683, 0.3578, 0.8868]}, {"w": "its", "b": [0.3637, 0.8683, 0.386, 0.8868]}, {"w": "input.", "b": [0.3919, 0.8683, 0.4464, 0.8868]}, {"w": "Each", "b": [0.4523, 0.8683, 0.4995, 0.8868]}, {"w": "of", "b": [0.5054, 0.8683, 0.525, 0.8868]}, {"w": "these", "b": [0.5309, 0.8683, 0.5795, 0.8868]}, {"w": "32", "b": [0.5854, 0.8683, 0.609, 0.8868]}, {"w": "output", "b": [0.6149, 0.8683, 0.6753, 0.8868]}, {"w": "channels", "b": [0.6812, 0.8683, 0.7638, 0.8868]}, {"w": "contains", "b": [0.7697, 0.8683, 0.8484, 0.8868]}, {"w": "a", "b": [0.8543, 0.8683, 0.8648, 0.8868]}, {"w": "26", "b": [0.1289, 0.8875, 0.1525, 0.906]}, {"w": "×", "b": [0.1584, 0.8875, 0.1717, 0.906]}, {"w": "26", "b": [0.1776, 0.8875, 0.2012, 0.906]}, {"w": "grid", "b": [0.2071, 0.8875, 0.2452, 0.906]}, {"w": "of", "b": [0.2511, 0.8875, 0.2708, 0.906]}, {"w": "values,", "b": [0.2767, 0.8875, 0.3429, 0.906]}, {"w": "which", "b": [0.3488, 0.8875, 0.4065, 0.906]}, {"w": "is", "b": [0.4124, 0.8875, 0.4282, 0.906]}, {"w": "a", "b": [0.4341, 0.8875, 0.4446, 0.906]}, {"w": "response", "b": [0.4504, 0.8875, 0.5335, 0.906]}, {"w": "map", "b": [0.5394, 0.8875, 0.5801, 0.906]}, {"w": "of", "b": [0.586, 0.8875, 0.6057, 0.906]}, {"w": "the", "b": [0.6116, 0.8875, 0.6404, 0.906]}, {"w": "filter", "b": [0.6463, 0.8875, 0.6922, 0.906]}, {"w": "over", "b": [0.6981, 0.8875, 0.7401, 0.906]}, {"w": "the", "b": [0.746, 0.8875, 0.7749, 0.906]}, {"w": "input,", "b": [0.7808, 0.8875, 0.8352, 0.906]}]}]}, {"page": 176, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "indicating the response of that filter pattern at different locations in the input (see figure 5.3). That is what the term feature map means: every dimension in the depth axis is a feature (or filter), and the 2D tensor output[:, :, n] is the 2D spatial map of the response of this filter over the input.", "words": [{"w": "indicating", "b": [0.1289, 0.0857, 0.2233, 0.1041]}, {"w": "the", "b": [0.2292, 0.0857, 0.2581, 0.1041]}, {"w": "response", "b": [0.264, 0.0857, 0.3466, 0.1041]}, {"w": "of", "b": [0.3525, 0.0857, 0.3722, 0.1041]}, {"w": "that", "b": [0.3781, 0.0857, 0.4135, 0.1041]}, {"w": "filter", "b": [0.4194, 0.0857, 0.4653, 0.1041]}, {"w": "pattern", "b": [0.4712, 0.0857, 0.5368, 0.1041]}, {"w": "at", "b": [0.5427, 0.0857, 0.5598, 0.1041]}, {"w": "different", "b": [0.5657, 0.0857, 0.6465, 0.1041]}, {"w": "locations", "b": [0.6524, 0.0857, 0.7377, 0.1041]}, {"w": "in", "b": [0.7436, 0.0857, 0.7619, 0.1041]}, {"w": "the", "b": [0.7678, 0.0857, 0.7967, 0.1041]}, {"w": "input", "b": [0.8026, 0.0857, 0.8511, 0.1041]}, {"w": "(see", "b": [0.1289, 0.1049, 0.1669, 0.1233]}, {"w": "figure", "b": [0.1728, 0.1049, 0.2292, 0.1233]}, {"w": "5.3).", "b": [0.2351, 0.1049, 0.2784, 0.1233]}, {"w": "That", "b": [0.2843, 0.1049, 0.3275, 0.1233]}, {"w": "is", "b": [0.3334, 0.1049, 0.3492, 0.1233]}, {"w": "what", "b": [0.3551, 0.1049, 0.401, 0.1233]}, {"w": "the", "b": [0.4069, 0.1049, 0.4358, 0.1233]}, {"w": "term", "b": [0.4417, 0.1049, 0.485, 0.1233]}, {"w": "feature", "b": [0.4908, 0.1049, 0.5568, 0.1233]}, {"w": "map", "b": [0.5627, 0.1049, 0.6034, 0.1233]}, {"w": "means:", "b": [0.6093, 0.1049, 0.6762, 0.1233]}, {"w": "every", "b": [0.6821, 0.1049, 0.7346, 0.1233]}, {"w": "dimension", "b": [0.7405, 0.1049, 0.8389, 0.1233]}, {"w": "in", "b": [0.8448, 0.1049, 0.8631, 0.1233]}, {"w": "the", "b": [0.1289, 0.124, 0.1577, 0.1425]}, {"w": "depth", "b": [0.1636, 0.124, 0.2161, 0.1425]}, {"w": "axis", "b": [0.222, 0.124, 0.2601, 0.1425]}, {"w": "is", "b": [0.266, 0.124, 0.2817, 0.1425]}, {"w": "a", "b": [0.2876, 0.124, 0.2981, 0.1425]}, {"w": "feature", "b": [0.304, 0.124, 0.3696, 0.1425]}, {"w": "(or", "b": [0.3755, 0.124, 0.403, 0.1425]}, {"w": "filter),", "b": [0.4089, 0.124, 0.4686, 0.1425]}, {"w": "and", "b": [0.4745, 0.124, 0.5086, 0.1425]}, {"w": "the", "b": [0.5145, 0.124, 0.5433, 0.1425]}, {"w": "2D", "b": [0.5492, 0.124, 0.5781, 0.1425]}, {"w": "tensor", "b": [0.584, 0.124, 0.6417, 0.1425]}, {"w": "output[:,", "b": [0.6476, 0.125, 0.7751, 0.1439]}, {"w": ":,", "b": [0.7892, 0.125, 0.8176, 0.1439]}, {"w": "n]", "b": [0.8317, 0.125, 0.8601, 0.1439]}, {"w": "is", "b": [0.1289, 0.1441, 0.1446, 0.1626]}, {"w": "the", "b": [0.1505, 0.1441, 0.1794, 0.1626]}, {"w": "2D", "b": [0.1853, 0.1441, 0.2141, 0.1626]}, {"w": "spatial", "b": [0.2201, 0.1441, 0.2817, 0.1626]}, {"w": "map", "b": [0.2876, 0.1441, 0.3283, 0.1626]}, {"w": "of", "b": [0.3342, 0.1441, 0.3538, 0.1626]}, {"w": "the", "b": [0.3597, 0.1441, 0.3886, 0.1626]}, {"w": "response", "b": [0.3945, 0.1441, 0.4771, 0.1626]}, {"w": "of", "b": [0.483, 0.1441, 0.5027, 0.1626]}, {"w": "this", "b": [0.5086, 0.1441, 0.5427, 0.1626]}, {"w": "filter", "b": [0.5486, 0.1441, 0.5945, 0.1626]}, {"w": "over", "b": [0.6004, 0.1441, 0.6424, 0.1626]}, {"w": "the", "b": [0.6483, 0.1441, 0.6772, 0.1626]}, {"w": "input.", "b": [0.6831, 0.1441, 0.7375, 0.1626]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.3. The concept of a response map: a 2D map of the presence of a pattern at different locations in an input", "words": [{"w": "Figure", "b": [0.1289, 0.1795, 0.1787, 0.1934]}, {"w": "5.3.", "b": [0.1832, 0.1795, 0.2097, 0.1934]}, {"w": "The", "b": [0.2141, 0.1795, 0.2437, 0.1934]}, {"w": "concept", "b": [0.2481, 0.1795, 0.3061, 0.1934]}, {"w": "of", "b": [0.3105, 0.1795, 0.3253, 0.1934]}, {"w": "a", "b": [0.3297, 0.1795, 0.3386, 0.1934]}, {"w": "response", "b": [0.343, 0.1795, 0.407, 0.1934]}, {"w": "map:", "b": [0.4114, 0.1795, 0.4488, 0.1934]}, {"w": "a", "b": [0.4532, 0.1795, 0.462, 0.1934]}, {"w": "2D", "b": [0.4665, 0.1795, 0.4881, 0.1934]}, {"w": "map", "b": [0.4925, 0.1795, 0.526, 0.1934]}, {"w": "of", "b": [0.5304, 0.1795, 0.5452, 0.1934]}, {"w": "the", "b": [0.5496, 0.1795, 0.5732, 0.1934]}, {"w": "presence", "b": [0.5776, 0.1795, 0.6432, 0.1934]}, {"w": "of", "b": [0.6477, 0.1795, 0.6624, 0.1934]}, {"w": "a", "b": [0.6668, 0.1795, 0.6757, 0.1934]}, {"w": "pattern", "b": [0.6801, 0.1795, 0.7362, 0.1934]}, {"w": "at", "b": [0.7406, 0.1795, 0.7554, 0.1934]}, {"w": "different", "b": [0.7598, 0.1795, 0.8254, 0.1934]}, {"w": "locations", "b": [0.1289, 0.1937, 0.1958, 0.2075]}, {"w": "in", "b": [0.2002, 0.1937, 0.215, 0.2075]}, {"w": "an", "b": [0.2194, 0.1937, 0.2381, 0.2075]}, {"w": "input", "b": [0.2425, 0.1937, 0.2829, 0.2075]}]}, {"id": "b_2", "type": "paragraph", "text": "Convolutions are defined by two key parameters:", "words": [{"w": "Convolutions", "b": [0.1289, 0.4153, 0.2562, 0.4337]}, {"w": "are", "b": [0.2621, 0.4153, 0.2909, 0.4337]}, {"w": "defined", "b": [0.2968, 0.4153, 0.3676, 0.4337]}, {"w": "by", "b": [0.3735, 0.4153, 0.3971, 0.4337]}, {"w": "two", "b": [0.403, 0.4153, 0.4385, 0.4337]}, {"w": "key", "b": [0.4444, 0.4153, 0.4785, 0.4337]}, {"w": "parameters:", "b": [0.4844, 0.4153, 0.5945, 0.4337]}]}, {"id": "b_3", "type": "paragraph", "text": "Size of the patches extracted from the inputs— These are typically 3 × 3 or 5 × 5. In the example, they were 3 × 3, which is a common choice. Depth of the output feature map— The number of filters computed by the convolution. The example started with a depth of 32 and ended with a depth of 64.", "words": [{"w": "Size", "b": [0.1761, 0.4511, 0.2155, 0.4696]}, {"w": "of", "b": [0.2214, 0.4511, 0.241, 0.4696]}, {"w": "the", "b": [0.2469, 0.4511, 0.2771, 0.4696]}, {"w": "patches", "b": [0.283, 0.4511, 0.3565, 0.4696]}, {"w": "extracted", "b": [0.3624, 0.4511, 0.4516, 0.4696]}, {"w": "from", "b": [0.4575, 0.4511, 0.5047, 0.4696]}, {"w": "the", "b": [0.5106, 0.4511, 0.5408, 0.4696]}, {"w": "inputs—", "b": [0.5467, 0.4511, 0.6307, 0.4696]}, {"w": "These", "b": [0.6366, 0.4511, 0.693, 0.4696]}, {"w": "are", "b": [0.6989, 0.4511, 0.7277, 0.4696]}, {"w": "typically", "b": [0.7336, 0.4511, 0.8163, 0.4696]}, {"w": "3", "b": [0.8222, 0.4511, 0.834, 0.4696]}, {"w": "×", "b": [0.8399, 0.4511, 0.8532, 0.4696]}, {"w": "3", "b": [0.8591, 0.4511, 0.8709, 0.4696]}, {"w": "or", "b": [0.1761, 0.4703, 0.1958, 0.4888]}, {"w": "5", "b": [0.2017, 0.4703, 0.2135, 0.4888]}, {"w": "×", "b": [0.2194, 0.4703, 0.2327, 0.4888]}, {"w": "5.", "b": [0.2386, 0.4703, 0.2563, 0.4888]}, {"w": "In", "b": [0.2622, 0.4703, 0.2819, 0.4888]}, {"w": "the", "b": [0.2878, 0.4703, 0.3167, 0.4888]}, {"w": "example,", "b": [0.3226, 0.4703, 0.4085, 0.4888]}, {"w": "they", "b": [0.4144, 0.4703, 0.455, 0.4888]}, {"w": "were", "b": [0.4609, 0.4703, 0.5068, 0.4888]}, {"w": "3", "b": [0.5127, 0.4703, 0.5245, 0.4888]}, {"w": "×", "b": [0.5304, 0.4703, 0.5438, 0.4888]}, {"w": "3,", "b": [0.5497, 0.4703, 0.5674, 0.4888]}, {"w": "which", "b": [0.5733, 0.4703, 0.631, 0.4888]}, {"w": "is", "b": [0.6369, 0.4703, 0.6527, 0.4888]}, {"w": "a", "b": [0.6586, 0.4703, 0.669, 0.4888]}, {"w": "common", "b": [0.6749, 0.4703, 0.7576, 0.4888]}, {"w": "choice.", "b": [0.7635, 0.4703, 0.831, 0.4888]}, {"w": "Depth", "b": [0.1761, 0.4895, 0.2351, 0.508]}, {"w": "of", "b": [0.241, 0.4895, 0.2607, 0.508]}, {"w": "the", "b": [0.2666, 0.4895, 0.2968, 0.508]}, {"w": "output", "b": [0.3027, 0.4895, 0.3657, 0.508]}, {"w": "feature", "b": [0.3716, 0.4895, 0.4411, 0.508]}, {"w": "map—", "b": [0.447, 0.4895, 0.5126, 0.508]}, {"w": "The", "b": [0.5185, 0.4895, 0.5552, 0.508]}, {"w": "number", "b": [0.5611, 0.4895, 0.6333, 0.508]}, {"w": "of", "b": [0.6392, 0.4895, 0.6589, 0.508]}, {"w": "filters", "b": [0.6648, 0.4895, 0.7199, 0.508]}, {"w": "computed", "b": [0.7258, 0.4895, 0.8189, 0.508]}, {"w": "by", "b": [0.8248, 0.4895, 0.8484, 0.508]}, {"w": "the", "b": [0.1761, 0.5087, 0.205, 0.5272]}, {"w": "convolution.", "b": [0.2109, 0.5087, 0.3296, 0.5272]}, {"w": "The", "b": [0.3355, 0.5087, 0.3722, 0.5272]}, {"w": "example", "b": [0.3781, 0.5087, 0.4581, 0.5272]}, {"w": "started", "b": [0.464, 0.5087, 0.527, 0.5272]}, {"w": "with", "b": [0.5329, 0.5087, 0.5749, 0.5272]}, {"w": "a", "b": [0.5808, 0.5087, 0.5913, 0.5272]}, {"w": "depth", "b": [0.5972, 0.5087, 0.6497, 0.5272]}, {"w": "of", "b": [0.6556, 0.5087, 0.6752, 0.5272]}, {"w": "32", "b": [0.6811, 0.5087, 0.7047, 0.5272]}, {"w": "and", "b": [0.7106, 0.5087, 0.7447, 0.5272]}, {"w": "ended", "b": [0.7507, 0.5087, 0.807, 0.5272]}, {"w": "with", "b": [0.8129, 0.5087, 0.8549, 0.5272]}, {"w": "a", "b": [0.1761, 0.5279, 0.1866, 0.5464]}, {"w": "depth", "b": [0.1925, 0.5279, 0.245, 0.5464]}, {"w": "of", "b": [0.2509, 0.5279, 0.2705, 0.5464]}, {"w": "64.", "b": [0.2764, 0.5279, 0.306, 0.5464]}]}, {"id": "b_4", "type": "paragraph", "text": "In Keras Conv2D layers, these parameters are the first arguments passed to the layer: Conv2D(output_depth, (window_height, window_width)).", "words": [{"w": "In", "b": [0.1289, 0.5679, 0.1485, 0.5864]}, {"w": "Keras", "b": [0.1545, 0.5679, 0.2095, 0.5864]}, {"w": "Conv2D", "b": [0.2154, 0.5689, 0.3004, 0.5878]}, {"w": "layers,", "b": [0.3063, 0.5679, 0.3686, 0.5864]}, {"w": "these", "b": [0.3745, 0.5679, 0.4231, 0.5864]}, {"w": "parameters", "b": [0.429, 0.5679, 0.5326, 0.5864]}, {"w": "are", "b": [0.5385, 0.5679, 0.5673, 0.5864]}, {"w": "the", "b": [0.5732, 0.5679, 0.6021, 0.5864]}, {"w": "first", "b": [0.608, 0.5679, 0.646, 0.5864]}, {"w": "arguments", "b": [0.6519, 0.5679, 0.7498, 0.5864]}, {"w": "passed", "b": [0.7557, 0.5679, 0.8187, 0.5864]}, {"w": "to", "b": [0.8246, 0.5679, 0.843, 0.5864]}, {"w": "the", "b": [0.1289, 0.588, 0.1577, 0.6065]}, {"w": "layer:", "b": [0.1636, 0.588, 0.2174, 0.6065]}, {"w": "Conv2D(output_depth,", "b": [0.2233, 0.5889, 0.5067, 0.6079]}, {"w": "(window_height,", "b": [0.5208, 0.5889, 0.7334, 0.6079]}, {"w": "window_width)).", "b": [0.1289, 0.608, 0.3332, 0.6279]}]}, {"id": "b_5", "type": "paragraph", "text": "A convolution works by sliding these windows of size 3 × 3 or 5 × 5 over the 3D input feature map, stopping at every possible location, and extracting the 3D patch of surrounding features (shape (window_height, window_width, input_depth)). Each such 3D patch is then transformed (via a tensor product with the same learned weight matrix, called the convolution kernel) into a 1D vector of shape (output_depth,). All of these vectors are then spatially reassembled into a 3D output map of shape (height, width, output_depth). Every spatial location in the output feature map corresponds to the same location in the input feature map (for example, the lower-right corner of the output contains information about the lower-right corner of the input). For instance, with 3 × 3 windows, the vector output[i, j, :] comes from the 3D patch input[i-1:i+1, j-1:j+1, :]. The full process is detailed in figure 5.4.", "words": [{"w": "A", "b": [0.1289, 0.6489, 0.1459, 0.6674]}, {"w": "convolution", "b": [0.1518, 0.6489, 0.2647, 0.6674]}, {"w": "works", "b": [0.2706, 0.6489, 0.3283, 0.6674]}, {"w": "by", "b": [0.3342, 0.6489, 0.3578, 0.6674]}, {"w": "sliding", "b": [0.3637, 0.6489, 0.428, 0.6674]}, {"w": "these", "b": [0.4339, 0.6489, 0.4824, 0.6674]}, {"w": "windows", "b": [0.4883, 0.6489, 0.5736, 0.6674]}, {"w": "of", "b": [0.5795, 0.6489, 0.5992, 0.6674]}, {"w": "size", "b": [0.6051, 0.6489, 0.6418, 0.6674]}, {"w": "3", "b": [0.6477, 0.6489, 0.6595, 0.6674]}, {"w": "×", "b": [0.6654, 0.6489, 0.6787, 0.6674]}, {"w": "3", "b": [0.6846, 0.6489, 0.6964, 0.6674]}, {"w": "or", "b": [0.7023, 0.6489, 0.722, 0.6674]}, {"w": "5", "b": [0.7279, 0.6489, 0.7397, 0.6674]}, {"w": "×", "b": [0.7456, 0.6489, 0.759, 0.6674]}, {"w": "5", "b": [0.7649, 0.6489, 0.7767, 0.6674]}, {"w": "over", "b": [0.7826, 0.6489, 0.8245, 0.6674]}, {"w": "the", "b": [0.8304, 0.6489, 0.8593, 0.6674]}, {"w": "3D", "b": [0.1289, 0.6681, 0.1577, 0.6866]}, {"w": "input", "b": [0.1636, 0.6681, 0.2122, 0.6866]}, {"w": "feature", "b": [0.2181, 0.6681, 0.2836, 0.6866]}, {"w": "map,", "b": [0.2896, 0.6681, 0.3361, 0.6866]}, {"w": "stopping", "b": [0.342, 0.6681, 0.4234, 0.6866]}, {"w": "at", "b": [0.4293, 0.6681, 0.4463, 0.6866]}, {"w": "every", "b": [0.4522, 0.6681, 0.5047, 0.6866]}, {"w": "possible", "b": [0.5106, 0.6681, 0.588, 0.6866]}, {"w": "location,", "b": [0.5939, 0.6681, 0.6759, 0.6866]}, {"w": "and", "b": [0.6818, 0.6681, 0.7159, 0.6866]}, {"w": "extracting", "b": [0.7218, 0.6681, 0.8162, 0.6866]}, {"w": "the", "b": [0.8221, 0.6681, 0.851, 0.6866]}, {"w": "3D", "b": [0.1289, 0.6873, 0.1577, 0.7057]}, {"w": "patch", "b": [0.1636, 0.6873, 0.2148, 0.7057]}, {"w": "of", "b": [0.2207, 0.6873, 0.2404, 0.7057]}, {"w": "surrounding", "b": [0.2463, 0.6873, 0.3604, 0.7057]}, {"w": "features", "b": [0.3663, 0.6873, 0.441, 0.7057]}, {"w": "(shape", "b": [0.4469, 0.6873, 0.5086, 0.7057]}, {"w": "(window_height,", "b": [0.5145, 0.6882, 0.727, 0.7071]}, {"w": "window_width,", "b": [0.1289, 0.7083, 0.3131, 0.7272]}, {"w": "input_depth)).", "b": [0.3272, 0.7073, 0.5111, 0.7272]}, {"w": "Each", "b": [0.517, 0.7073, 0.5642, 0.7258]}, {"w": "such", "b": [0.5701, 0.7073, 0.6134, 0.7258]}, {"w": "3D", "b": [0.6193, 0.7073, 0.6481, 0.7258]}, {"w": "patch", "b": [0.6541, 0.7073, 0.7052, 0.7258]}, {"w": "is", "b": [0.7111, 0.7073, 0.7269, 0.7258]}, {"w": "then", "b": [0.7328, 0.7073, 0.7734, 0.7258]}, {"w": "transformed", "b": [0.1289, 0.7273, 0.243, 0.7458]}, {"w": "(via", "b": [0.2489, 0.7273, 0.2856, 0.7458]}, {"w": "a", "b": [0.2915, 0.7273, 0.302, 0.7458]}, {"w": "tensor", "b": [0.3079, 0.7273, 0.3656, 0.7458]}, {"w": "product", "b": [0.3715, 0.7273, 0.4437, 0.7458]}, {"w": "with", "b": [0.4496, 0.7273, 0.4916, 0.7458]}, {"w": "the", "b": [0.4975, 0.7273, 0.5263, 0.7458]}, {"w": "same", "b": [0.5322, 0.7273, 0.5807, 0.7458]}, {"w": "learned", "b": [0.5866, 0.7273, 0.6561, 0.7458]}, {"w": "weight", "b": [0.6621, 0.7273, 0.7263, 0.7458]}, {"w": "matrix,", "b": [0.7322, 0.7273, 0.7998, 0.7458]}, {"w": "called", "b": [0.8057, 0.7273, 0.8621, 0.7458]}, {"w": "the", "b": [0.1289, 0.7465, 0.1577, 0.765]}, {"w": "convolution", "b": [0.1636, 0.7465, 0.2751, 0.765]}, {"w": "kernel)", "b": [0.281, 0.7465, 0.3479, 0.765]}, {"w": "into", "b": [0.3538, 0.7465, 0.3905, 0.765]}, {"w": "a", "b": [0.3964, 0.7465, 0.4069, 0.765]}, {"w": "1D", "b": [0.4128, 0.7465, 0.4417, 0.765]}, {"w": "vector", "b": [0.4476, 0.7465, 0.5066, 0.765]}, {"w": "of", "b": [0.5125, 0.7465, 0.5322, 0.765]}, {"w": "shape", "b": [0.5381, 0.7465, 0.5918, 0.765]}, {"w": "(output_depth,).", "b": [0.5977, 0.7465, 0.8162, 0.7664]}, {"w": "All", "b": [0.8221, 0.7465, 0.8522, 0.765]}, {"w": "of", "b": [0.1289, 0.7665, 0.1485, 0.785]}, {"w": "these", "b": [0.1545, 0.7665, 0.203, 0.785]}, {"w": "vectors", "b": [0.2089, 0.7665, 0.2771, 0.785]}, {"w": "are", "b": [0.283, 0.7665, 0.3118, 0.785]}, {"w": "then", "b": [0.3177, 0.7665, 0.3584, 0.785]}, {"w": "spatially", "b": [0.3643, 0.7665, 0.4443, 0.785]}, {"w": "reassembled", "b": [0.4502, 0.7665, 0.567, 0.785]}, {"w": "into", "b": [0.5729, 0.7665, 0.6096, 0.785]}, {"w": "a", "b": [0.6155, 0.7665, 0.626, 0.785]}, {"w": "3D", "b": [0.6319, 0.7665, 0.6608, 0.785]}, {"w": "output", "b": [0.6667, 0.7665, 0.727, 0.785]}, {"w": "map", "b": [0.7329, 0.7665, 0.7736, 0.785]}, {"w": "of", "b": [0.7795, 0.7665, 0.7992, 0.785]}, {"w": "shape", "b": [0.8051, 0.7665, 0.8588, 0.785]}, {"w": "(height,", "b": [0.1289, 0.7867, 0.2422, 0.8056]}, {"w": "width,", "b": [0.2564, 0.7867, 0.3414, 0.8056]}, {"w": "output_depth).", "b": [0.3556, 0.7857, 0.5457, 0.8056]}, {"w": "Every", "b": [0.5516, 0.7857, 0.608, 0.8042]}, {"w": "spatial", "b": [0.6139, 0.7857, 0.6756, 0.8042]}, {"w": "location", "b": [0.6815, 0.7857, 0.7576, 0.8042]}, {"w": "in", "b": [0.7635, 0.7857, 0.7819, 0.8042]}, {"w": "the", "b": [0.7878, 0.7857, 0.8166, 0.8042]}, {"w": "output", "b": [0.1289, 0.8057, 0.1892, 0.8242]}, {"w": "feature", "b": [0.1951, 0.8057, 0.2607, 0.8242]}, {"w": "map", "b": [0.2666, 0.8057, 0.3073, 0.8242]}, {"w": "corresponds", "b": [0.3132, 0.8057, 0.4273, 0.8242]}, {"w": "to", "b": [0.4332, 0.8057, 0.4515, 0.8242]}, {"w": "the", "b": [0.4575, 0.8057, 0.4863, 0.8242]}, {"w": "same", "b": [0.4922, 0.8057, 0.5407, 0.8242]}, {"w": "location", "b": [0.5466, 0.8057, 0.6227, 0.8242]}, {"w": "in", "b": [0.6286, 0.8057, 0.647, 0.8242]}, {"w": "the", "b": [0.6529, 0.8057, 0.6818, 0.8242]}, {"w": "input", "b": [0.6877, 0.8057, 0.7362, 0.8242]}, {"w": "feature", "b": [0.7421, 0.8057, 0.8077, 0.8242]}, {"w": "map", "b": [0.8136, 0.8057, 0.8543, 0.8242]}, {"w": "(for", "b": [0.1289, 0.8249, 0.1643, 0.8434]}, {"w": "example,", "b": [0.1702, 0.8249, 0.2561, 0.8434]}, {"w": "the", "b": [0.262, 0.8249, 0.2908, 0.8434]}, {"w": "lower-right", "b": [0.2967, 0.8249, 0.4025, 0.8434]}, {"w": "corner", "b": [0.4084, 0.8249, 0.4687, 0.8434]}, {"w": "of", "b": [0.4746, 0.8249, 0.4943, 0.8434]}, {"w": "the", "b": [0.5002, 0.8249, 0.529, 0.8434]}, {"w": "output", "b": [0.5349, 0.8249, 0.5953, 0.8434]}, {"w": "contains", "b": [0.6012, 0.8249, 0.6799, 0.8434]}, {"w": "information", "b": [0.6858, 0.8249, 0.7973, 0.8434]}, {"w": "about", "b": [0.8032, 0.8249, 0.8557, 0.8434]}, {"w": "the", "b": [0.1289, 0.8441, 0.1577, 0.8626]}, {"w": "lower-right", "b": [0.1636, 0.8441, 0.2694, 0.8626]}, {"w": "corner", "b": [0.2753, 0.8441, 0.3356, 0.8626]}, {"w": "of", "b": [0.3415, 0.8441, 0.3612, 0.8626]}, {"w": "the", "b": [0.3671, 0.8441, 0.3959, 0.8626]}, {"w": "input).", "b": [0.4019, 0.8441, 0.4642, 0.8626]}, {"w": "For", "b": [0.4701, 0.8441, 0.5029, 0.8626]}, {"w": "instance,", "b": [0.5088, 0.8441, 0.5921, 0.8626]}, {"w": "with", "b": [0.598, 0.8441, 0.64, 0.8626]}, {"w": "3", "b": [0.6459, 0.8441, 0.6577, 0.8626]}, {"w": "×", "b": [0.6635, 0.8441, 0.6768, 0.8626]}, {"w": "3", "b": [0.6828, 0.8441, 0.6946, 0.8626]}, {"w": "windows,", "b": [0.7005, 0.8441, 0.7916, 0.8626]}, {"w": "the", "b": [0.7975, 0.8441, 0.8264, 0.8626]}, {"w": "vector", "b": [0.1289, 0.8633, 0.1879, 0.8818]}, {"w": "output[i,", "b": [0.1938, 0.8643, 0.3213, 0.8832]}, {"w": "j,", "b": [0.3355, 0.8643, 0.3638, 0.8832]}, {"w": ":]", "b": [0.378, 0.8643, 0.4063, 0.8832]}, {"w": "comes", "b": [0.4122, 0.8633, 0.4726, 0.8818]}, {"w": "from", "b": [0.4785, 0.8633, 0.5244, 0.8818]}, {"w": "the", "b": [0.5303, 0.8633, 0.5591, 0.8818]}, {"w": "3D", "b": [0.565, 0.8633, 0.5939, 0.8818]}, {"w": "patch", "b": [0.5998, 0.8633, 0.651, 0.8818]}, {"w": "input[i-1:i+1,", "b": [0.6568, 0.8643, 0.8552, 0.8832]}, {"w": "j-1:j+1,", "b": [0.1289, 0.8843, 0.2422, 0.9032]}, {"w": ":].", "b": [0.2564, 0.8833, 0.2907, 0.9032]}, {"w": "The", "b": [0.2966, 0.8833, 0.3333, 0.9018]}, {"w": "full", "b": [0.3392, 0.8833, 0.372, 0.9018]}, {"w": "process", "b": [0.3779, 0.8833, 0.4487, 0.9018]}, {"w": "is", "b": [0.4546, 0.8833, 0.4704, 0.9018]}, {"w": "detailed", "b": [0.4763, 0.8833, 0.551, 0.9018]}, {"w": "in", "b": [0.5569, 0.8833, 0.5753, 0.9018]}, {"w": "figure", "b": [0.5812, 0.8833, 0.6375, 0.9018]}, {"w": "5.4.", "b": [0.6434, 0.8833, 0.6789, 0.9018]}]}]}, {"page": 177, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 5.4. How convolution works", "words": [{"w": "Figure", "b": [0.1289, 0.0852, 0.1787, 0.0991]}, {"w": "5.4.", "b": [0.1832, 0.0852, 0.2097, 0.0991]}, {"w": "How", "b": [0.2141, 0.0852, 0.2496, 0.0991]}, {"w": "convolution", "b": [0.254, 0.0852, 0.3426, 0.0991]}, {"w": "works", "b": [0.347, 0.0852, 0.3932, 0.0991]}]}, {"id": "b_1", "type": "paragraph", "text": "Note that the output width and height may differ from the input width and height. They may differ for two reasons:", "words": [{"w": "Note", "b": [0.1289, 0.5921, 0.1748, 0.6106]}, {"w": "that", "b": [0.1807, 0.5921, 0.2161, 0.6106]}, {"w": "the", "b": [0.222, 0.5921, 0.2509, 0.6106]}, {"w": "output", "b": [0.2568, 0.5921, 0.3171, 0.6106]}, {"w": "width", "b": [0.323, 0.5921, 0.3768, 0.6106]}, {"w": "and", "b": [0.3827, 0.5921, 0.4168, 0.6106]}, {"w": "height", "b": [0.4227, 0.5921, 0.4818, 0.6106]}, {"w": "may", "b": [0.4877, 0.5921, 0.5283, 0.6106]}, {"w": "differ", "b": [0.5342, 0.5921, 0.5862, 0.6106]}, {"w": "from", "b": [0.5921, 0.5921, 0.638, 0.6106]}, {"w": "the", "b": [0.6439, 0.5921, 0.6728, 0.6106]}, {"w": "input", "b": [0.6787, 0.5921, 0.7272, 0.6106]}, {"w": "width", "b": [0.7331, 0.5921, 0.7869, 0.6106]}, {"w": "and", "b": [0.7928, 0.5921, 0.8269, 0.6106]}, {"w": "height.", "b": [0.1289, 0.6113, 0.1938, 0.6298]}, {"w": "They", "b": [0.1997, 0.6113, 0.2482, 0.6298]}, {"w": "may", "b": [0.2542, 0.6113, 0.2948, 0.6298]}, {"w": "differ", "b": [0.3007, 0.6113, 0.3527, 0.6298]}, {"w": "for", "b": [0.3586, 0.6113, 0.3862, 0.6298]}, {"w": "two", "b": [0.3921, 0.6113, 0.4275, 0.6298]}, {"w": "reasons:", "b": [0.4334, 0.6113, 0.5108, 0.6298]}]}, {"id": "b_2", "type": "paragraph", "text": "Border effects, which can be countered by padding the input feature map The use of strides, which I’ll define in a second", "words": [{"w": "Border", "b": [0.1761, 0.6472, 0.2417, 0.6657]}, {"w": "effects,", "b": [0.2476, 0.6472, 0.316, 0.6657]}, {"w": "which", "b": [0.3219, 0.6472, 0.3796, 0.6657]}, {"w": "can", "b": [0.3855, 0.6472, 0.4183, 0.6657]}, {"w": "be", "b": [0.4242, 0.6472, 0.4465, 0.6657]}, {"w": "countered", "b": [0.4524, 0.6472, 0.5455, 0.6657]}, {"w": "by", "b": [0.5514, 0.6472, 0.575, 0.6657]}, {"w": "padding", "b": [0.5809, 0.6472, 0.657, 0.6657]}, {"w": "the", "b": [0.6629, 0.6472, 0.6918, 0.6657]}, {"w": "input", "b": [0.6977, 0.6472, 0.7462, 0.6657]}, {"w": "feature", "b": [0.7521, 0.6472, 0.8177, 0.6657]}, {"w": "map", "b": [0.8236, 0.6472, 0.8643, 0.6657]}, {"w": "The", "b": [0.1761, 0.6664, 0.2128, 0.6849]}, {"w": "use", "b": [0.2187, 0.6664, 0.2502, 0.6849]}, {"w": "of", "b": [0.2561, 0.6664, 0.2758, 0.6849]}, {"w": "strides,", "b": [0.2817, 0.6664, 0.3505, 0.6849]}, {"w": "which", "b": [0.3564, 0.6664, 0.4142, 0.6849]}, {"w": "I’ll", "b": [0.4201, 0.6664, 0.4489, 0.6849]}, {"w": "define", "b": [0.4548, 0.6664, 0.5138, 0.6849]}, {"w": "in", "b": [0.5197, 0.6664, 0.5381, 0.6849]}, {"w": "a", "b": [0.544, 0.6664, 0.5545, 0.6849]}, {"w": "second", "b": [0.5604, 0.6664, 0.626, 0.6849]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s take a deeper look at these notions.", "words": [{"w": "Let’s", "b": [0.1289, 0.7065, 0.1761, 0.7249]}, {"w": "take", "b": [0.182, 0.7065, 0.2213, 0.7249]}, {"w": "a", "b": [0.2272, 0.7065, 0.2377, 0.7249]}, {"w": "deeper", "b": [0.2436, 0.7065, 0.3066, 0.7249]}, {"w": "look", "b": [0.3125, 0.7065, 0.3545, 0.7249]}, {"w": "at", "b": [0.3604, 0.7065, 0.3774, 0.7249]}, {"w": "these", "b": [0.3833, 0.7065, 0.4318, 0.7249]}, {"w": "notions.", "b": [0.4377, 0.7065, 0.5132, 0.7249]}]}, {"id": "b_4", "type": "paragraph", "text": "Understanding border effects and padding", "words": [{"w": "Understanding", "b": [0.1289, 0.7419, 0.242, 0.7557]}, {"w": "border", "b": [0.2465, 0.7419, 0.2986, 0.7557]}, {"w": "effects", "b": [0.303, 0.7419, 0.3512, 0.7557]}, {"w": "and", "b": [0.3556, 0.7419, 0.3842, 0.7557]}, {"w": "padding", "b": [0.3886, 0.7419, 0.4507, 0.7557]}]}, {"id": "b_5", "type": "paragraph", "text": "Consider a 5 × 5 feature map (25 tiles total). There are only 9 tiles around which you can center a 3 × 3 window, forming a 3 × 3 grid (see figure 5.5). Hence, the output feature map will be 3 × 3. It shrinks a little: by exactly two tiles alongside each dimension, in this case. You can see this border effect in action in the earlier example: you start with 28 × 28 inputs, which become 26 × 26 after the first convolution layer.", "words": [{"w": "Consider", "b": [0.1289, 0.7774, 0.2141, 0.7959]}, {"w": "a", "b": [0.2201, 0.7774, 0.2305, 0.7959]}, {"w": "5", "b": [0.2364, 0.7774, 0.2482, 0.7959]}, {"w": "×", "b": [0.2542, 0.7774, 0.2675, 0.7959]}, {"w": "5", "b": [0.2734, 0.7774, 0.2852, 0.7959]}, {"w": "feature", "b": [0.2911, 0.7774, 0.3566, 0.7959]}, {"w": "map", "b": [0.3625, 0.7774, 0.4032, 0.7959]}, {"w": "(25", "b": [0.4091, 0.7774, 0.4406, 0.7959]}, {"w": "tiles", "b": [0.4465, 0.7774, 0.4859, 0.7959]}, {"w": "total).", "b": [0.4918, 0.7774, 0.5475, 0.7959]}, {"w": "There", "b": [0.5534, 0.7774, 0.6085, 0.7959]}, {"w": "are", "b": [0.6144, 0.7774, 0.6432, 0.7959]}, {"w": "only", "b": [0.6491, 0.7774, 0.6911, 0.7959]}, {"w": "9", "b": [0.697, 0.7774, 0.7088, 0.7959]}, {"w": "tiles", "b": [0.7147, 0.7774, 0.7541, 0.7959]}, {"w": "around", "b": [0.76, 0.7774, 0.8256, 0.7959]}, {"w": "which", "b": [0.1289, 0.7966, 0.1866, 0.8151]}, {"w": "you", "b": [0.1925, 0.7966, 0.2279, 0.8151]}, {"w": "can", "b": [0.2338, 0.7966, 0.2666, 0.8151]}, {"w": "center", "b": [0.2725, 0.7966, 0.3302, 0.8151]}, {"w": "a", "b": [0.3361, 0.7966, 0.3466, 0.8151]}, {"w": "3", "b": [0.3525, 0.7966, 0.3643, 0.8151]}, {"w": "×", "b": [0.3702, 0.7966, 0.3835, 0.8151]}, {"w": "3", "b": [0.3894, 0.7966, 0.4012, 0.8151]}, {"w": "window,", "b": [0.4071, 0.7966, 0.4876, 0.8151]}, {"w": "forming", "b": [0.4935, 0.7966, 0.5696, 0.8151]}, {"w": "a", "b": [0.5754, 0.7966, 0.5859, 0.8151]}, {"w": "3", "b": [0.5918, 0.7966, 0.6036, 0.8151]}, {"w": "×", "b": [0.6095, 0.7966, 0.6229, 0.8151]}, {"w": "3", "b": [0.6288, 0.7966, 0.6406, 0.8151]}, {"w": "grid", "b": [0.6465, 0.7966, 0.6845, 0.8151]}, {"w": "(see", "b": [0.6904, 0.7966, 0.7284, 0.8151]}, {"w": "figure", "b": [0.7343, 0.7966, 0.7907, 0.8151]}, {"w": "5.5).", "b": [0.7966, 0.7966, 0.8399, 0.8151]}, {"w": "Hence,", "b": [0.1289, 0.8158, 0.1951, 0.8342]}, {"w": "the", "b": [0.201, 0.8158, 0.2299, 0.8342]}, {"w": "output", "b": [0.2358, 0.8158, 0.2961, 0.8342]}, {"w": "feature", "b": [0.302, 0.8158, 0.3676, 0.8342]}, {"w": "map", "b": [0.3735, 0.8158, 0.4141, 0.8342]}, {"w": "will", "b": [0.42, 0.8158, 0.4568, 0.8342]}, {"w": "be", "b": [0.4627, 0.8158, 0.485, 0.8342]}, {"w": "3", "b": [0.4909, 0.8158, 0.5027, 0.8342]}, {"w": "×", "b": [0.5086, 0.8158, 0.5219, 0.8342]}, {"w": "3.", "b": [0.5278, 0.8158, 0.5455, 0.8342]}, {"w": "It", "b": [0.5514, 0.8158, 0.5659, 0.8342]}, {"w": "shrinks", "b": [0.5718, 0.8158, 0.64, 0.8342]}, {"w": "a", "b": [0.6459, 0.8158, 0.6564, 0.8342]}, {"w": "little:", "b": [0.6623, 0.8158, 0.7122, 0.8342]}, {"w": "by", "b": [0.7181, 0.8158, 0.7417, 0.8342]}, {"w": "exactly", "b": [0.7476, 0.8158, 0.8158, 0.8342]}, {"w": "two", "b": [0.8217, 0.8158, 0.8571, 0.8342]}, {"w": "tiles", "b": [0.1289, 0.835, 0.1682, 0.8534]}, {"w": "alongside", "b": [0.1741, 0.835, 0.2647, 0.8534]}, {"w": "each", "b": [0.2706, 0.835, 0.3138, 0.8534]}, {"w": "dimension,", "b": [0.3197, 0.835, 0.424, 0.8534]}, {"w": "in", "b": [0.4299, 0.835, 0.4483, 0.8534]}, {"w": "this", "b": [0.4542, 0.835, 0.4883, 0.8534]}, {"w": "case.", "b": [0.4942, 0.835, 0.5407, 0.8534]}, {"w": "You", "b": [0.5466, 0.835, 0.5849, 0.8534]}, {"w": "can", "b": [0.5908, 0.835, 0.6236, 0.8534]}, {"w": "see", "b": [0.6295, 0.835, 0.6597, 0.8534]}, {"w": "this", "b": [0.6656, 0.835, 0.6997, 0.8534]}, {"w": "border", "b": [0.7056, 0.835, 0.7672, 0.8534]}, {"w": "effect", "b": [0.7731, 0.835, 0.8264, 0.8534]}, {"w": "in", "b": [0.8323, 0.835, 0.8507, 0.8534]}, {"w": "action", "b": [0.1289, 0.8541, 0.1866, 0.8726]}, {"w": "in", "b": [0.1925, 0.8541, 0.2109, 0.8726]}, {"w": "the", "b": [0.2168, 0.8541, 0.2456, 0.8726]}, {"w": "earlier", "b": [0.2515, 0.8541, 0.3118, 0.8726]}, {"w": "example:", "b": [0.3177, 0.8541, 0.4043, 0.8726]}, {"w": "you", "b": [0.4102, 0.8541, 0.4456, 0.8726]}, {"w": "start", "b": [0.4515, 0.8541, 0.4922, 0.8726]}, {"w": "with", "b": [0.4981, 0.8541, 0.5401, 0.8726]}, {"w": "28", "b": [0.546, 0.8541, 0.5696, 0.8726]}, {"w": "×", "b": [0.5755, 0.8541, 0.5888, 0.8726]}, {"w": "28", "b": [0.5947, 0.8541, 0.6184, 0.8726]}, {"w": "inputs,", "b": [0.6243, 0.8541, 0.6879, 0.8726]}, {"w": "which", "b": [0.6938, 0.8541, 0.7515, 0.8726]}, {"w": "become", "b": [0.7574, 0.8541, 0.8309, 0.8726]}, {"w": "26", "b": [0.8368, 0.8541, 0.8604, 0.8726]}, {"w": "×", "b": [0.1289, 0.8733, 0.1422, 0.8918]}, {"w": "26", "b": [0.1481, 0.8733, 0.1717, 0.8918]}, {"w": "after", "b": [0.1776, 0.8733, 0.2209, 0.8918]}, {"w": "the", "b": [0.2268, 0.8733, 0.2556, 0.8918]}, {"w": "first", "b": [0.2615, 0.8733, 0.2996, 0.8918]}, {"w": "convolution", "b": [0.3055, 0.8733, 0.4183, 0.8918]}, {"w": "layer.", "b": [0.4242, 0.8733, 0.476, 0.8918]}]}]}, {"page": 178, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 5.5. Valid locations of 3 × 3 patches in a 5 × 5 input feature map", "words": [{"w": "Figure", "b": [0.1289, 0.0852, 0.1787, 0.0991]}, {"w": "5.5.", "b": [0.1832, 0.0852, 0.2097, 0.0991]}, {"w": "Valid", "b": [0.2141, 0.0852, 0.2538, 0.0991]}, {"w": "locations", "b": [0.2583, 0.0852, 0.3252, 0.0991]}, {"w": "of", "b": [0.3296, 0.0852, 0.3444, 0.0991]}, {"w": "3", "b": [0.3488, 0.0852, 0.3576, 0.0991]}, {"w": "×", "b": [0.3621, 0.0852, 0.3722, 0.0991]}, {"w": "3", "b": [0.3766, 0.0852, 0.3855, 0.0991]}, {"w": "patches", "b": [0.3899, 0.0852, 0.4469, 0.0991]}, {"w": "in", "b": [0.4514, 0.0852, 0.4661, 0.0991]}, {"w": "a", "b": [0.4706, 0.0852, 0.4794, 0.0991]}, {"w": "5", "b": [0.4839, 0.0852, 0.4927, 0.0991]}, {"w": "×", "b": [0.4971, 0.0852, 0.5072, 0.0991]}, {"w": "5", "b": [0.5117, 0.0852, 0.5205, 0.0991]}, {"w": "input", "b": [0.5249, 0.0852, 0.5653, 0.0991]}, {"w": "feature", "b": [0.5697, 0.0852, 0.6235, 0.0991]}, {"w": "map", "b": [0.6279, 0.0852, 0.6614, 0.0991]}]}, {"id": "b_1", "type": "paragraph", "text": "If you want to get an output feature map with the same spatial dimensions as the input, you can use padding. Padding consists of adding an appropriate number of rows and columns on each side of the input feature map so as to make it possible to fit center convolution windows around every input tile. For a 3 × 3 window, you add one column on the right, one column on the left, one row at the top, and one row at the bottom. For a 5 × 5 window, you add two rows (see figure 5.6).", "words": [{"w": "If", "b": [0.1289, 0.3719, 0.1446, 0.3903]}, {"w": "you", "b": [0.1505, 0.3719, 0.1859, 0.3903]}, {"w": "want", "b": [0.1918, 0.3719, 0.2377, 0.3903]}, {"w": "to", "b": [0.2436, 0.3719, 0.262, 0.3903]}, {"w": "get", "b": [0.2679, 0.3719, 0.2968, 0.3903]}, {"w": "an", "b": [0.3027, 0.3719, 0.325, 0.3903]}, {"w": "output", "b": [0.3309, 0.3719, 0.3912, 0.3903]}, {"w": "feature", "b": [0.3971, 0.3719, 0.4627, 0.3903]}, {"w": "map", "b": [0.4686, 0.3719, 0.5093, 0.3903]}, {"w": "with", "b": [0.5152, 0.3719, 0.5572, 0.3903]}, {"w": "the", "b": [0.5631, 0.3719, 0.5919, 0.3903]}, {"w": "same", "b": [0.5978, 0.3719, 0.6463, 0.3903]}, {"w": "spatial", "b": [0.6523, 0.3719, 0.7139, 0.3903]}, {"w": "dimensions", "b": [0.7198, 0.3719, 0.8274, 0.3903]}, {"w": "as", "b": [0.8333, 0.3719, 0.853, 0.3903]}, {"w": "the", "b": [0.1289, 0.3911, 0.1577, 0.4095]}, {"w": "input,", "b": [0.1636, 0.3911, 0.2181, 0.4095]}, {"w": "you", "b": [0.224, 0.3911, 0.2594, 0.4095]}, {"w": "can", "b": [0.2653, 0.3911, 0.2981, 0.4095]}, {"w": "use", "b": [0.304, 0.3911, 0.3355, 0.4095]}, {"w": "padding.", "b": [0.3414, 0.3911, 0.4247, 0.4095]}, {"w": "Padding", "b": [0.4306, 0.3911, 0.508, 0.4095]}, {"w": "consists", "b": [0.5139, 0.3911, 0.5887, 0.4095]}, {"w": "of", "b": [0.5946, 0.3911, 0.6142, 0.4095]}, {"w": "adding", "b": [0.6201, 0.3911, 0.6844, 0.4095]}, {"w": "an", "b": [0.6903, 0.3911, 0.7126, 0.4095]}, {"w": "appropriate", "b": [0.7185, 0.3911, 0.8261, 0.4095]}, {"w": "number", "b": [0.1289, 0.4102, 0.201, 0.4287]}, {"w": "of", "b": [0.2069, 0.4102, 0.2266, 0.4287]}, {"w": "rows", "b": [0.2325, 0.4102, 0.2784, 0.4287]}, {"w": "and", "b": [0.2843, 0.4102, 0.3184, 0.4287]}, {"w": "columns", "b": [0.3243, 0.4102, 0.4043, 0.4287]}, {"w": "on", "b": [0.4102, 0.4102, 0.4339, 0.4287]}, {"w": "each", "b": [0.4398, 0.4102, 0.483, 0.4287]}, {"w": "side", "b": [0.4889, 0.4102, 0.527, 0.4287]}, {"w": "of", "b": [0.5329, 0.4102, 0.5525, 0.4287]}, {"w": "the", "b": [0.5585, 0.4102, 0.5873, 0.4287]}, {"w": "input", "b": [0.5932, 0.4102, 0.6418, 0.4287]}, {"w": "feature", "b": [0.6477, 0.4102, 0.7132, 0.4287]}, {"w": "map", "b": [0.7191, 0.4102, 0.7598, 0.4287]}, {"w": "so", "b": [0.7657, 0.4102, 0.7867, 0.4287]}, {"w": "as", "b": [0.7926, 0.4102, 0.8123, 0.4287]}, {"w": "to", "b": [0.8182, 0.4102, 0.8365, 0.4287]}, {"w": "make", "b": [0.1289, 0.4294, 0.18, 0.4479]}, {"w": "it", "b": [0.1859, 0.4294, 0.199, 0.4479]}, {"w": "possible", "b": [0.2049, 0.4294, 0.2823, 0.4479]}, {"w": "to", "b": [0.2882, 0.4294, 0.3066, 0.4479]}, {"w": "fit", "b": [0.3125, 0.4294, 0.3335, 0.4479]}, {"w": "center", "b": [0.3394, 0.4294, 0.3971, 0.4479]}, {"w": "convolution", "b": [0.403, 0.4294, 0.5158, 0.4479]}, {"w": "windows", "b": [0.5218, 0.4294, 0.607, 0.4479]}, {"w": "around", "b": [0.6129, 0.4294, 0.6785, 0.4479]}, {"w": "every", "b": [0.6844, 0.4294, 0.7369, 0.4479]}, {"w": "input", "b": [0.7428, 0.4294, 0.7913, 0.4479]}, {"w": "tile.", "b": [0.7972, 0.4294, 0.8333, 0.4479]}, {"w": "For", "b": [0.1289, 0.4486, 0.1617, 0.4671]}, {"w": "a", "b": [0.1676, 0.4486, 0.1781, 0.4671]}, {"w": "3", "b": [0.184, 0.4486, 0.1958, 0.4671]}, {"w": "×", "b": [0.2017, 0.4486, 0.215, 0.4671]}, {"w": "3", "b": [0.2209, 0.4486, 0.2327, 0.4671]}, {"w": "window,", "b": [0.2386, 0.4486, 0.3191, 0.4671]}, {"w": "you", "b": [0.325, 0.4486, 0.3604, 0.4671]}, {"w": "add", "b": [0.3663, 0.4486, 0.4004, 0.4671]}, {"w": "one", "b": [0.4063, 0.4486, 0.4404, 0.4671]}, {"w": "column", "b": [0.4463, 0.4486, 0.5172, 0.4671]}, {"w": "on", "b": [0.5231, 0.4486, 0.5467, 0.4671]}, {"w": "the", "b": [0.5526, 0.4486, 0.5814, 0.4671]}, {"w": "right,", "b": [0.5873, 0.4486, 0.6378, 0.4671]}, {"w": "one", "b": [0.6437, 0.4486, 0.6778, 0.4671]}, {"w": "column", "b": [0.6837, 0.4486, 0.7546, 0.4671]}, {"w": "on", "b": [0.7605, 0.4486, 0.7841, 0.4671]}, {"w": "the", "b": [0.79, 0.4486, 0.8188, 0.4671]}, {"w": "left,", "b": [0.8247, 0.4486, 0.8621, 0.4671]}, {"w": "one", "b": [0.1289, 0.4678, 0.163, 0.4863]}, {"w": "row", "b": [0.1689, 0.4678, 0.2056, 0.4863]}, {"w": "at", "b": [0.2115, 0.4678, 0.2286, 0.4863]}, {"w": "the", "b": [0.2345, 0.4678, 0.2633, 0.4863]}, {"w": "top,", "b": [0.2692, 0.4678, 0.3053, 0.4863]}, {"w": "and", "b": [0.3112, 0.4678, 0.3453, 0.4863]}, {"w": "one", "b": [0.3512, 0.4678, 0.3853, 0.4863]}, {"w": "row", "b": [0.3912, 0.4678, 0.4279, 0.4863]}, {"w": "at", "b": [0.4338, 0.4678, 0.4509, 0.4863]}, {"w": "the", "b": [0.4568, 0.4678, 0.4856, 0.4863]}, {"w": "bottom.", "b": [0.4916, 0.4678, 0.5644, 0.4863]}, {"w": "For", "b": [0.5703, 0.4678, 0.6031, 0.4863]}, {"w": "a", "b": [0.609, 0.4678, 0.6195, 0.4863]}, {"w": "5", "b": [0.6254, 0.4678, 0.6372, 0.4863]}, {"w": "×", "b": [0.6431, 0.4678, 0.6564, 0.4863]}, {"w": "5", "b": [0.6623, 0.4678, 0.6741, 0.4863]}, {"w": "window,", "b": [0.68, 0.4678, 0.7604, 0.4863]}, {"w": "you", "b": [0.7663, 0.4678, 0.8018, 0.4863]}, {"w": "add", "b": [0.8077, 0.4678, 0.8418, 0.4863]}, {"w": "two", "b": [0.1289, 0.487, 0.1643, 0.5055]}, {"w": "rows", "b": [0.1702, 0.487, 0.2161, 0.5055]}, {"w": "(see", "b": [0.222, 0.487, 0.26, 0.5055]}, {"w": "figure", "b": [0.2659, 0.487, 0.3223, 0.5055]}, {"w": "5.6).", "b": [0.3282, 0.487, 0.3715, 0.5055]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 5.6. Padding a 5 × 5 input in order to be able to extract 25 3 × 3 patches", "words": [{"w": "Figure", "b": [0.1289, 0.5224, 0.1787, 0.5363]}, {"w": "5.6.", "b": [0.1832, 0.5224, 0.2097, 0.5363]}, {"w": "Padding", "b": [0.2141, 0.5224, 0.2771, 0.5363]}, {"w": "a", "b": [0.2816, 0.5224, 0.2904, 0.5363]}, {"w": "5", "b": [0.2948, 0.5224, 0.3037, 0.5363]}, {"w": "×", "b": [0.3081, 0.5224, 0.3182, 0.5363]}, {"w": "5", "b": [0.3226, 0.5224, 0.3315, 0.5363]}, {"w": "input", "b": [0.3359, 0.5224, 0.3763, 0.5363]}, {"w": "in", "b": [0.3807, 0.5224, 0.3955, 0.5363]}, {"w": "order", "b": [0.3999, 0.5224, 0.4422, 0.5363]}, {"w": "to", "b": [0.4466, 0.5224, 0.4614, 0.5363]}, {"w": "be", "b": [0.4658, 0.5224, 0.4835, 0.5363]}, {"w": "able", "b": [0.488, 0.5224, 0.5195, 0.5363]}, {"w": "to", "b": [0.5239, 0.5224, 0.5386, 0.5363]}, {"w": "extract", "b": [0.5431, 0.5224, 0.5962, 0.5363]}, {"w": "25", "b": [0.6006, 0.5224, 0.6183, 0.5363]}, {"w": "3", "b": [0.6227, 0.5224, 0.6316, 0.5363]}, {"w": "×", "b": [0.636, 0.5224, 0.6461, 0.5363]}, {"w": "3", "b": [0.6505, 0.5224, 0.6594, 0.5363]}, {"w": "patches", "b": [0.6638, 0.5224, 0.7209, 0.5363]}]}, {"id": "b_3", "type": "paragraph", "text": "In Conv2D layers, padding is configurable via the padding argument, which takes two values: \"valid\", which means no padding (only valid window locations will be used); and \"same\", which means “pad in such a way as to have an output with the same width and height as the input.” The padding argument defaults to \"valid\".", "words": [{"w": "In", "b": [0.1289, 0.7415, 0.1485, 0.76]}, {"w": "Conv2D", "b": [0.1544, 0.7425, 0.2395, 0.7614]}, {"w": "layers,", "b": [0.2454, 0.7415, 0.3077, 0.76]}, {"w": "padding", "b": [0.3136, 0.7415, 0.3896, 0.76]}, {"w": "is", "b": [0.3956, 0.7415, 0.4113, 0.76]}, {"w": "configurable", "b": [0.4172, 0.7415, 0.5366, 0.76]}, {"w": "via", "b": [0.5425, 0.7415, 0.5713, 0.76]}, {"w": "the", "b": [0.5772, 0.7415, 0.6061, 0.76]}, {"w": "padding", "b": [0.6119, 0.7425, 0.7111, 0.7614]}, {"w": "argument,", "b": [0.717, 0.7415, 0.8117, 0.76]}, {"w": "which", "b": [0.1289, 0.7615, 0.1866, 0.78]}, {"w": "takes", "b": [0.1925, 0.7615, 0.241, 0.78]}, {"w": "two", "b": [0.2469, 0.7615, 0.2823, 0.78]}, {"w": "values:", "b": [0.2883, 0.7615, 0.3552, 0.78]}, {"w": "\"valid\",", "b": [0.361, 0.7615, 0.4661, 0.7814]}, {"w": "which", "b": [0.472, 0.7615, 0.5297, 0.78]}, {"w": "means", "b": [0.5356, 0.7615, 0.596, 0.78]}, {"w": "no", "b": [0.6019, 0.7615, 0.6255, 0.78]}, {"w": "padding", "b": [0.6314, 0.7615, 0.7075, 0.78]}, {"w": "(only", "b": [0.7134, 0.7615, 0.7632, 0.78]}, {"w": "valid", "b": [0.7691, 0.7615, 0.8164, 0.78]}, {"w": "window", "b": [0.1289, 0.7816, 0.205, 0.8]}, {"w": "locations", "b": [0.2109, 0.7816, 0.2961, 0.8]}, {"w": "will", "b": [0.302, 0.7816, 0.3388, 0.8]}, {"w": "be", "b": [0.3447, 0.7816, 0.367, 0.8]}, {"w": "used);", "b": [0.3729, 0.7816, 0.4306, 0.8]}, {"w": "and", "b": [0.4365, 0.7816, 0.4706, 0.8]}, {"w": "\"same\",", "b": [0.4765, 0.7816, 0.5674, 0.8014]}, {"w": "which", "b": [0.5733, 0.7816, 0.631, 0.8]}, {"w": "means", "b": [0.6369, 0.7816, 0.6972, 0.8]}, {"w": "“pad", "b": [0.7032, 0.7816, 0.7477, 0.8]}, {"w": "in", "b": [0.7536, 0.7816, 0.772, 0.8]}, {"w": "such", "b": [0.7779, 0.7816, 0.8212, 0.8]}, {"w": "a", "b": [0.8271, 0.7816, 0.8376, 0.8]}, {"w": "way", "b": [0.1289, 0.8016, 0.1682, 0.8201]}, {"w": "as", "b": [0.1741, 0.8016, 0.1938, 0.8201]}, {"w": "to", "b": [0.1997, 0.8016, 0.2181, 0.8201]}, {"w": "have", "b": [0.224, 0.8016, 0.2686, 0.8201]}, {"w": "an", "b": [0.2745, 0.8016, 0.2968, 0.8201]}, {"w": "output", "b": [0.3027, 0.8016, 0.363, 0.8201]}, {"w": "with", "b": [0.3689, 0.8016, 0.4109, 0.8201]}, {"w": "the", "b": [0.4168, 0.8016, 0.4457, 0.8201]}, {"w": "same", "b": [0.4516, 0.8016, 0.5001, 0.8201]}, {"w": "width", "b": [0.506, 0.8016, 0.5598, 0.8201]}, {"w": "and", "b": [0.5657, 0.8016, 0.5998, 0.8201]}, {"w": "height", "b": [0.6057, 0.8016, 0.6647, 0.8201]}, {"w": "as", "b": [0.6706, 0.8016, 0.6903, 0.8201]}, {"w": "the", "b": [0.6962, 0.8016, 0.7251, 0.8201]}, {"w": "input.”", "b": [0.731, 0.8016, 0.7959, 0.8201]}, {"w": "The", "b": [0.8018, 0.8016, 0.8385, 0.8201]}, {"w": "padding", "b": [0.1289, 0.8217, 0.2281, 0.8406]}, {"w": "argument", "b": [0.234, 0.8208, 0.3227, 0.8392]}, {"w": "defaults", "b": [0.3286, 0.8208, 0.4034, 0.8392]}, {"w": "to", "b": [0.4093, 0.8208, 0.4277, 0.8392]}, {"w": "\"valid\".", "b": [0.4335, 0.8208, 0.5386, 0.8406]}]}, {"id": "b_4", "type": "paragraph", "text": "Understanding convolution strides", "words": [{"w": "Understanding", "b": [0.1289, 0.857, 0.242, 0.8709]}, {"w": "convolution", "b": [0.2465, 0.857, 0.3351, 0.8709]}, {"w": "strides", "b": [0.3395, 0.857, 0.3897, 0.8709]}]}]}, {"page": 179, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The other factor that can influence output size is the notion of strides. The description of convolution so far has assumed that the center tiles of the convolution windows are all contiguous. But the distance between two successive windows is a parameter of the convolution, called its stride, which defaults to 1. It’s possible to have strided convolutions: convolutions with a stride higher than 1. In figure 5.7, you can see the patches extracted by a 3 × 3 convolution with stride 2 over a 5 × 5 input (without padding).", "words": [{"w": "The", "b": [0.1289, 0.0857, 0.1656, 0.1041]}, {"w": "other", "b": [0.1715, 0.0857, 0.22, 0.1041]}, {"w": "factor", "b": [0.2259, 0.0857, 0.281, 0.1041]}, {"w": "that", "b": [0.2869, 0.0857, 0.3223, 0.1041]}, {"w": "can", "b": [0.3282, 0.0857, 0.361, 0.1041]}, {"w": "influence", "b": [0.3669, 0.0857, 0.4548, 0.1041]}, {"w": "output", "b": [0.4607, 0.0857, 0.521, 0.1041]}, {"w": "size", "b": [0.527, 0.0857, 0.5637, 0.1041]}, {"w": "is", "b": [0.5696, 0.0857, 0.5853, 0.1041]}, {"w": "the", "b": [0.5912, 0.0857, 0.6201, 0.1041]}, {"w": "notion", "b": [0.626, 0.0857, 0.6863, 0.1041]}, {"w": "of", "b": [0.6923, 0.0857, 0.7119, 0.1041]}, {"w": "strides.", "b": [0.7177, 0.0857, 0.7866, 0.1041]}, {"w": "The", "b": [0.7925, 0.0857, 0.8292, 0.1041]}, {"w": "description", "b": [0.1289, 0.1049, 0.2338, 0.1233]}, {"w": "of", "b": [0.2397, 0.1049, 0.2594, 0.1233]}, {"w": "convolution", "b": [0.2653, 0.1049, 0.3781, 0.1233]}, {"w": "so", "b": [0.384, 0.1049, 0.405, 0.1233]}, {"w": "far", "b": [0.4109, 0.1049, 0.4371, 0.1233]}, {"w": "has", "b": [0.443, 0.1049, 0.4745, 0.1233]}, {"w": "assumed", "b": [0.4804, 0.1049, 0.5618, 0.1233]}, {"w": "that", "b": [0.5677, 0.1049, 0.6031, 0.1233]}, {"w": "the", "b": [0.609, 0.1049, 0.6378, 0.1233]}, {"w": "center", "b": [0.6437, 0.1049, 0.7014, 0.1233]}, {"w": "tiles", "b": [0.7073, 0.1049, 0.7467, 0.1233]}, {"w": "of", "b": [0.7526, 0.1049, 0.7723, 0.1233]}, {"w": "the", "b": [0.7782, 0.1049, 0.807, 0.1233]}, {"w": "convolution", "b": [0.1289, 0.124, 0.2417, 0.1425]}, {"w": "windows", "b": [0.2476, 0.124, 0.3329, 0.1425]}, {"w": "are", "b": [0.3388, 0.124, 0.3676, 0.1425]}, {"w": "all", "b": [0.3735, 0.124, 0.3971, 0.1425]}, {"w": "contiguous.", "b": [0.403, 0.124, 0.5126, 0.1425]}, {"w": "But", "b": [0.5185, 0.124, 0.5526, 0.1425]}, {"w": "the", "b": [0.5585, 0.124, 0.5873, 0.1425]}, {"w": "distance", "b": [0.5932, 0.124, 0.6706, 0.1425]}, {"w": "between", "b": [0.6765, 0.124, 0.7552, 0.1425]}, {"w": "two", "b": [0.7611, 0.124, 0.7965, 0.1425]}, {"w": "successive", "b": [0.1289, 0.1432, 0.2286, 0.1617]}, {"w": "windows", "b": [0.2345, 0.1432, 0.3197, 0.1617]}, {"w": "is", "b": [0.3256, 0.1432, 0.3414, 0.1617]}, {"w": "a", "b": [0.3473, 0.1432, 0.3578, 0.1617]}, {"w": "parameter", "b": [0.3637, 0.1432, 0.4581, 0.1617]}, {"w": "of", "b": [0.464, 0.1432, 0.4837, 0.1617]}, {"w": "the", "b": [0.4896, 0.1432, 0.5184, 0.1617]}, {"w": "convolution,", "b": [0.5243, 0.1432, 0.6431, 0.1617]}, {"w": "called", "b": [0.649, 0.1432, 0.7054, 0.1617]}, {"w": "its", "b": [0.7113, 0.1432, 0.7336, 0.1617]}, {"w": "stride,", "b": [0.7394, 0.1432, 0.7991, 0.1617]}, {"w": "which", "b": [0.805, 0.1432, 0.8627, 0.1617]}, {"w": "defaults", "b": [0.1289, 0.1624, 0.2036, 0.1809]}, {"w": "to", "b": [0.2095, 0.1624, 0.2279, 0.1809]}, {"w": "1.", "b": [0.2338, 0.1624, 0.2515, 0.1809]}, {"w": "It’s", "b": [0.2574, 0.1624, 0.2876, 0.1809]}, {"w": "possible", "b": [0.2935, 0.1624, 0.3709, 0.1809]}, {"w": "to", "b": [0.3768, 0.1624, 0.3952, 0.1809]}, {"w": "have", "b": [0.4011, 0.1624, 0.4457, 0.1809]}, {"w": "strided", "b": [0.4515, 0.1624, 0.5172, 0.1809]}, {"w": "convolutions:", "b": [0.5231, 0.1624, 0.6503, 0.1809]}, {"w": "convolutions", "b": [0.6562, 0.1624, 0.7782, 0.1809]}, {"w": "with", "b": [0.7841, 0.1624, 0.8261, 0.1809]}, {"w": "a", "b": [0.832, 0.1624, 0.8425, 0.1809]}, {"w": "stride", "b": [0.1289, 0.1816, 0.1813, 0.2001]}, {"w": "higher", "b": [0.1873, 0.1816, 0.2476, 0.2001]}, {"w": "than", "b": [0.2535, 0.1816, 0.2942, 0.2001]}, {"w": "1.", "b": [0.3001, 0.1816, 0.3178, 0.2001]}, {"w": "In", "b": [0.3237, 0.1816, 0.3433, 0.2001]}, {"w": "figure", "b": [0.3492, 0.1816, 0.4056, 0.2001]}, {"w": "5.7,", "b": [0.4115, 0.1816, 0.4469, 0.2001]}, {"w": "you", "b": [0.4528, 0.1816, 0.4882, 0.2001]}, {"w": "can", "b": [0.4941, 0.1816, 0.5269, 0.2001]}, {"w": "see", "b": [0.5328, 0.1816, 0.563, 0.2001]}, {"w": "the", "b": [0.5689, 0.1816, 0.5977, 0.2001]}, {"w": "patches", "b": [0.6037, 0.1816, 0.6745, 0.2001]}, {"w": "extracted", "b": [0.6804, 0.1816, 0.7669, 0.2001]}, {"w": "by", "b": [0.7728, 0.1816, 0.7964, 0.2001]}, {"w": "a", "b": [0.8023, 0.1816, 0.8128, 0.2001]}, {"w": "3", "b": [0.8187, 0.1816, 0.8305, 0.2001]}, {"w": "×", "b": [0.8364, 0.1816, 0.8498, 0.2001]}, {"w": "3", "b": [0.8557, 0.1816, 0.8675, 0.2001]}, {"w": "convolution", "b": [0.1289, 0.2008, 0.2417, 0.2193]}, {"w": "with", "b": [0.2476, 0.2008, 0.2896, 0.2193]}, {"w": "stride", "b": [0.2955, 0.2008, 0.348, 0.2193]}, {"w": "2", "b": [0.3539, 0.2008, 0.3657, 0.2193]}, {"w": "over", "b": [0.3716, 0.2008, 0.4136, 0.2193]}, {"w": "a", "b": [0.4195, 0.2008, 0.4299, 0.2193]}, {"w": "5", "b": [0.4358, 0.2008, 0.4477, 0.2193]}, {"w": "×", "b": [0.4536, 0.2008, 0.4669, 0.2193]}, {"w": "5", "b": [0.4728, 0.2008, 0.4846, 0.2193]}, {"w": "input", "b": [0.4905, 0.2008, 0.539, 0.2193]}, {"w": "(without", "b": [0.5449, 0.2008, 0.625, 0.2193]}, {"w": "padding).", "b": [0.6309, 0.2008, 0.7207, 0.2193]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.7. 3 × 3 convolution patches with 2 × 2 strides", "words": [{"w": "Figure", "b": [0.1289, 0.2362, 0.1787, 0.2501]}, {"w": "5.7.", "b": [0.1832, 0.2362, 0.2097, 0.2501]}, {"w": "3", "b": [0.2141, 0.2362, 0.223, 0.2501]}, {"w": "×", "b": [0.2274, 0.2362, 0.2375, 0.2501]}, {"w": "3", "b": [0.2419, 0.2362, 0.2508, 0.2501]}, {"w": "convolution", "b": [0.2552, 0.2362, 0.3438, 0.2501]}, {"w": "patches", "b": [0.3482, 0.2362, 0.4053, 0.2501]}, {"w": "with", "b": [0.4097, 0.2362, 0.4432, 0.2501]}, {"w": "2", "b": [0.4476, 0.2362, 0.4565, 0.2501]}, {"w": "×", "b": [0.4609, 0.2362, 0.471, 0.2501]}, {"w": "2", "b": [0.4754, 0.2362, 0.4843, 0.2501]}, {"w": "strides", "b": [0.4887, 0.2362, 0.5389, 0.2501]}]}, {"id": "b_2", "type": "paragraph", "text": "Using stride 2 means the width and height of the feature map are downsampled by a factor of 2 (in addition to any changes induced by border effects). Strided convolutions are rarely used in practice, although they can come in handy for some types of models; it’s good to be familiar with the concept.", "words": [{"w": "Using", "b": [0.1289, 0.5062, 0.1853, 0.5247]}, {"w": "stride", "b": [0.1912, 0.5062, 0.2437, 0.5247]}, {"w": "2", "b": [0.2496, 0.5062, 0.2614, 0.5247]}, {"w": "means", "b": [0.2673, 0.5062, 0.3276, 0.5247]}, {"w": "the", "b": [0.3335, 0.5062, 0.3624, 0.5247]}, {"w": "width", "b": [0.3683, 0.5062, 0.4221, 0.5247]}, {"w": "and", "b": [0.428, 0.5062, 0.4621, 0.5247]}, {"w": "height", "b": [0.468, 0.5062, 0.527, 0.5247]}, {"w": "of", "b": [0.5329, 0.5062, 0.5526, 0.5247]}, {"w": "the", "b": [0.5585, 0.5062, 0.5874, 0.5247]}, {"w": "feature", "b": [0.5933, 0.5062, 0.6588, 0.5247]}, {"w": "map", "b": [0.6647, 0.5062, 0.7054, 0.5247]}, {"w": "are", "b": [0.7113, 0.5062, 0.7401, 0.5247]}, {"w": "downsampled", "b": [0.1289, 0.5254, 0.2601, 0.5439]}, {"w": "by", "b": [0.266, 0.5254, 0.2896, 0.5439]}, {"w": "a", "b": [0.2955, 0.5254, 0.306, 0.5439]}, {"w": "factor", "b": [0.3119, 0.5254, 0.3669, 0.5439]}, {"w": "of", "b": [0.3728, 0.5254, 0.3925, 0.5439]}, {"w": "2", "b": [0.3984, 0.5254, 0.4102, 0.5439]}, {"w": "(in", "b": [0.4161, 0.5254, 0.4424, 0.5439]}, {"w": "addition", "b": [0.4483, 0.5254, 0.5257, 0.5439]}, {"w": "to", "b": [0.5316, 0.5254, 0.55, 0.5439]}, {"w": "any", "b": [0.5559, 0.5254, 0.59, 0.5439]}, {"w": "changes", "b": [0.5959, 0.5254, 0.6719, 0.5439]}, {"w": "induced", "b": [0.6778, 0.5254, 0.7525, 0.5439]}, {"w": "by", "b": [0.7584, 0.5254, 0.782, 0.5439]}, {"w": "border", "b": [0.7879, 0.5254, 0.8496, 0.5439]}, {"w": "effects).", "b": [0.1289, 0.5446, 0.2051, 0.5631]}, {"w": "Strided", "b": [0.2111, 0.5446, 0.2793, 0.5631]}, {"w": "convolutions", "b": [0.2852, 0.5446, 0.4072, 0.5631]}, {"w": "are", "b": [0.4131, 0.5446, 0.4419, 0.5631]}, {"w": "rarely", "b": [0.4478, 0.5446, 0.5029, 0.5631]}, {"w": "used", "b": [0.5088, 0.5446, 0.5521, 0.5631]}, {"w": "in", "b": [0.558, 0.5446, 0.5764, 0.5631]}, {"w": "practice,", "b": [0.5823, 0.5446, 0.6629, 0.5631]}, {"w": "although", "b": [0.6688, 0.5446, 0.7515, 0.5631]}, {"w": "they", "b": [0.7574, 0.5446, 0.798, 0.5631]}, {"w": "can", "b": [0.8039, 0.5446, 0.8367, 0.5631]}, {"w": "come", "b": [0.1289, 0.5638, 0.18, 0.5823]}, {"w": "in", "b": [0.1859, 0.5638, 0.2043, 0.5823]}, {"w": "handy", "b": [0.2102, 0.5638, 0.2679, 0.5823]}, {"w": "for", "b": [0.2738, 0.5638, 0.3014, 0.5823]}, {"w": "some", "b": [0.3073, 0.5638, 0.3571, 0.5823]}, {"w": "types", "b": [0.363, 0.5638, 0.4129, 0.5823]}, {"w": "of", "b": [0.4187, 0.5638, 0.4384, 0.5823]}, {"w": "models;", "b": [0.4443, 0.5638, 0.5191, 0.5823]}, {"w": "it’s", "b": [0.525, 0.5638, 0.5539, 0.5823]}, {"w": "good", "b": [0.5598, 0.5638, 0.607, 0.5823]}, {"w": "to", "b": [0.6129, 0.5638, 0.6313, 0.5823]}, {"w": "be", "b": [0.6372, 0.5638, 0.6595, 0.5823]}, {"w": "familiar", "b": [0.6654, 0.5638, 0.7401, 0.5823]}, {"w": "with", "b": [0.746, 0.5638, 0.788, 0.5823]}, {"w": "the", "b": [0.7939, 0.5638, 0.8228, 0.5823]}, {"w": "concept.", "b": [0.1289, 0.583, 0.2082, 0.6014]}]}, {"id": "b_3", "type": "paragraph", "text": "To downsample feature maps, instead of strides, we tend to use the max- pooling operation, which you saw in action in the first convnet example. Let’s look at it in more depth.", "words": [{"w": "To", "b": [0.1289, 0.623, 0.1535, 0.6415]}, {"w": "downsample", "b": [0.1594, 0.623, 0.2787, 0.6415]}, {"w": "feature", "b": [0.2846, 0.623, 0.3502, 0.6415]}, {"w": "maps,", "b": [0.3561, 0.623, 0.4119, 0.6415]}, {"w": "instead", "b": [0.4178, 0.623, 0.4847, 0.6415]}, {"w": "of", "b": [0.4906, 0.623, 0.5102, 0.6415]}, {"w": "strides,", "b": [0.5161, 0.623, 0.5837, 0.6415]}, {"w": "we", "b": [0.5896, 0.623, 0.6171, 0.6415]}, {"w": "tend", "b": [0.623, 0.623, 0.6637, 0.6415]}, {"w": "to", "b": [0.6696, 0.623, 0.688, 0.6415]}, {"w": "use", "b": [0.6939, 0.623, 0.7254, 0.6415]}, {"w": "the", "b": [0.7313, 0.623, 0.7601, 0.6415]}, {"w": "max-", "b": [0.766, 0.623, 0.8132, 0.6415]}, {"w": "pooling", "b": [0.1289, 0.6422, 0.201, 0.6607]}, {"w": "operation,", "b": [0.2069, 0.6422, 0.302, 0.6607]}, {"w": "which", "b": [0.3079, 0.6422, 0.3656, 0.6607]}, {"w": "you", "b": [0.3716, 0.6422, 0.407, 0.6607]}, {"w": "saw", "b": [0.4129, 0.6422, 0.4496, 0.6607]}, {"w": "in", "b": [0.4555, 0.6422, 0.4739, 0.6607]}, {"w": "action", "b": [0.4798, 0.6422, 0.5375, 0.6607]}, {"w": "in", "b": [0.5434, 0.6422, 0.5618, 0.6607]}, {"w": "the", "b": [0.5677, 0.6422, 0.5965, 0.6607]}, {"w": "first", "b": [0.6024, 0.6422, 0.6405, 0.6607]}, {"w": "convnet", "b": [0.6464, 0.6422, 0.7211, 0.6607]}, {"w": "example.", "b": [0.727, 0.6422, 0.813, 0.6607]}, {"w": "Let’s", "b": [0.8189, 0.6422, 0.866, 0.6607]}, {"w": "look", "b": [0.1289, 0.6614, 0.1709, 0.6799]}, {"w": "at", "b": [0.1768, 0.6614, 0.1938, 0.6799]}, {"w": "it", "b": [0.1997, 0.6614, 0.2128, 0.6799]}, {"w": "in", "b": [0.2188, 0.6614, 0.2371, 0.6799]}, {"w": "more", "b": [0.243, 0.6614, 0.2916, 0.6799]}, {"w": "depth.", "b": [0.2975, 0.6614, 0.3558, 0.6799]}]}, {"id": "b_4", "type": "equation", "text": "5.1.2. The max-pooling operation", "words": [{"w": "5.1.2.", "b": [0.1289, 0.7056, 0.182, 0.7241]}, {"w": "The", "b": [0.1879, 0.7056, 0.2273, 0.7241]}, {"w": "max-pooling", "b": [0.2332, 0.7056, 0.3591, 0.7241]}, {"w": "operation", "b": [0.365, 0.7056, 0.4621, 0.7241]}]}, {"id": "b_5", "type": "paragraph", "text": "In the convnet example, you may have noticed that the size of the feature maps is halved after every MaxPooling2D layer. For instance, before the first MaxPooling2D layers, the feature map is 26 × 26, but the max-pooling operation halves it to 13 × 13. That’s the role of max pooling: to aggressively downsample feature maps, much like strided convolutions.", "words": [{"w": "In", "b": [0.1289, 0.7457, 0.1485, 0.7642]}, {"w": "the", "b": [0.1545, 0.7457, 0.1833, 0.7642]}, {"w": "convnet", "b": [0.1892, 0.7457, 0.264, 0.7642]}, {"w": "example,", "b": [0.2699, 0.7457, 0.3558, 0.7642]}, {"w": "you", "b": [0.3617, 0.7457, 0.3971, 0.7642]}, {"w": "may", "b": [0.403, 0.7457, 0.4437, 0.7642]}, {"w": "have", "b": [0.4496, 0.7457, 0.4942, 0.7642]}, {"w": "noticed", "b": [0.5001, 0.7457, 0.5696, 0.7642]}, {"w": "that", "b": [0.5755, 0.7457, 0.6109, 0.7642]}, {"w": "the", "b": [0.6168, 0.7457, 0.6457, 0.7642]}, {"w": "size", "b": [0.6516, 0.7457, 0.6883, 0.7642]}, {"w": "of", "b": [0.6942, 0.7457, 0.7139, 0.7642]}, {"w": "the", "b": [0.7198, 0.7457, 0.7486, 0.7642]}, {"w": "feature", "b": [0.7545, 0.7457, 0.8201, 0.7642]}, {"w": "maps", "b": [0.1289, 0.7649, 0.1787, 0.7833]}, {"w": "is", "b": [0.1846, 0.7649, 0.2004, 0.7833]}, {"w": "halved", "b": [0.2063, 0.7649, 0.2692, 0.7833]}, {"w": "after", "b": [0.2751, 0.7649, 0.3184, 0.7833]}, {"w": "every", "b": [0.3243, 0.7649, 0.3768, 0.7833]}, {"w": "MaxPooling2D", "b": [0.3826, 0.7658, 0.5527, 0.7847]}, {"w": "layer.", "b": [0.5586, 0.7649, 0.6104, 0.7833]}, {"w": "For", "b": [0.6163, 0.7649, 0.6491, 0.7833]}, {"w": "instance,", "b": [0.655, 0.7649, 0.7383, 0.7833]}, {"w": "before", "b": [0.7442, 0.7649, 0.8045, 0.7833]}, {"w": "the", "b": [0.8104, 0.7649, 0.8392, 0.7833]}, {"w": "first", "b": [0.1289, 0.7849, 0.1669, 0.8034]}, {"w": "MaxPooling2D", "b": [0.1728, 0.7859, 0.3428, 0.8048]}, {"w": "layers,", "b": [0.3488, 0.7849, 0.411, 0.8034]}, {"w": "the", "b": [0.417, 0.7849, 0.4458, 0.8034]}, {"w": "feature", "b": [0.4517, 0.7849, 0.5173, 0.8034]}, {"w": "map", "b": [0.5232, 0.7849, 0.5638, 0.8034]}, {"w": "is", "b": [0.5697, 0.7849, 0.5855, 0.8034]}, {"w": "26", "b": [0.5914, 0.7849, 0.615, 0.8034]}, {"w": "×", "b": [0.6209, 0.7849, 0.6342, 0.8034]}, {"w": "26,", "b": [0.6401, 0.7849, 0.6697, 0.8034]}, {"w": "but", "b": [0.6756, 0.7849, 0.7057, 0.8034]}, {"w": "the", "b": [0.7116, 0.7849, 0.7405, 0.8034]}, {"w": "max-pooling", "b": [0.7464, 0.7849, 0.8671, 0.8034]}, {"w": "operation", "b": [0.1289, 0.8049, 0.2181, 0.8234]}, {"w": "halves", "b": [0.224, 0.8049, 0.2843, 0.8234]}, {"w": "it", "b": [0.2902, 0.8049, 0.3033, 0.8234]}, {"w": "to", "b": [0.3092, 0.8049, 0.3276, 0.8234]}, {"w": "13", "b": [0.3335, 0.8049, 0.3571, 0.8234]}, {"w": "×", "b": [0.363, 0.8049, 0.3764, 0.8234]}, {"w": "13.", "b": [0.3823, 0.8049, 0.4118, 0.8234]}, {"w": "That’s", "b": [0.4177, 0.8049, 0.4767, 0.8234]}, {"w": "the", "b": [0.4826, 0.8049, 0.5114, 0.8234]}, {"w": "role", "b": [0.5173, 0.8049, 0.5541, 0.8234]}, {"w": "of", "b": [0.56, 0.8049, 0.5796, 0.8234]}, {"w": "max", "b": [0.5855, 0.8049, 0.6262, 0.8234]}, {"w": "pooling:", "b": [0.6321, 0.8049, 0.7108, 0.8234]}, {"w": "to", "b": [0.7167, 0.8049, 0.7351, 0.8234]}, {"w": "aggressively", "b": [0.741, 0.8049, 0.859, 0.8234]}, {"w": "downsample", "b": [0.1289, 0.8241, 0.2482, 0.8426]}, {"w": "feature", "b": [0.2542, 0.8241, 0.3197, 0.8426]}, {"w": "maps,", "b": [0.3256, 0.8241, 0.3814, 0.8426]}, {"w": "much", "b": [0.3873, 0.8241, 0.4397, 0.8426]}, {"w": "like", "b": [0.4456, 0.8241, 0.4811, 0.8426]}, {"w": "strided", "b": [0.487, 0.8241, 0.5512, 0.8426]}, {"w": "convolutions.", "b": [0.5572, 0.8241, 0.6851, 0.8426]}]}, {"id": "b_6", "type": "paragraph", "text": "Max pooling consists of extracting windows from the input feature maps and outputting the max value of each channel. It’s conceptually similar to", "words": [{"w": "Max", "b": [0.1289, 0.8642, 0.1722, 0.8826]}, {"w": "pooling", "b": [0.1781, 0.8642, 0.2502, 0.8826]}, {"w": "consists", "b": [0.2561, 0.8642, 0.3309, 0.8826]}, {"w": "of", "b": [0.3368, 0.8642, 0.3565, 0.8826]}, {"w": "extracting", "b": [0.3624, 0.8642, 0.4568, 0.8826]}, {"w": "windows", "b": [0.4627, 0.8642, 0.548, 0.8826]}, {"w": "from", "b": [0.5539, 0.8642, 0.5998, 0.8826]}, {"w": "the", "b": [0.6057, 0.8642, 0.6346, 0.8826]}, {"w": "input", "b": [0.6405, 0.8642, 0.689, 0.8826]}, {"w": "feature", "b": [0.6949, 0.8642, 0.7605, 0.8826]}, {"w": "maps", "b": [0.7664, 0.8642, 0.8163, 0.8826]}, {"w": "and", "b": [0.8222, 0.8642, 0.8563, 0.8826]}, {"w": "outputting", "b": [0.1289, 0.8833, 0.226, 0.9018]}, {"w": "the", "b": [0.2319, 0.8833, 0.2607, 0.9018]}, {"w": "max", "b": [0.2666, 0.8833, 0.3073, 0.9018]}, {"w": "value", "b": [0.3132, 0.8833, 0.3644, 0.9018]}, {"w": "of", "b": [0.3703, 0.8833, 0.3899, 0.9018]}, {"w": "each", "b": [0.3958, 0.8833, 0.4391, 0.9018]}, {"w": "channel.", "b": [0.445, 0.8833, 0.5244, 0.9018]}, {"w": "It’s", "b": [0.5303, 0.8833, 0.5604, 0.9018]}, {"w": "conceptually", "b": [0.5663, 0.8833, 0.6869, 0.9018]}, {"w": "similar", "b": [0.6928, 0.8833, 0.7584, 0.9018]}, {"w": "to", "b": [0.7643, 0.8833, 0.7827, 0.9018]}]}]}, {"page": 180, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "convolution, except that instead of transforming local patches via a learned linear transformation (the convolution kernel), they’re transformed via a hardcoded max tensor operation. A big difference from convolution is that max pooling is usually done with 2 × 2 windows and stride 2, in order to downsample the feature maps by a factor of 2. On the other hand, convolution is typically done with 3 × 3 windows and no stride (stride 1).", "words": [{"w": "convolution,", "b": [0.1289, 0.0857, 0.2476, 0.1041]}, {"w": "except", "b": [0.2535, 0.0857, 0.3151, 0.1041]}, {"w": "that", "b": [0.3211, 0.0857, 0.3565, 0.1041]}, {"w": "instead", "b": [0.3624, 0.0857, 0.4293, 0.1041]}, {"w": "of", "b": [0.4352, 0.0857, 0.4549, 0.1041]}, {"w": "transforming", "b": [0.4608, 0.0857, 0.5828, 0.1041]}, {"w": "local", "b": [0.5887, 0.0857, 0.6346, 0.1041]}, {"w": "patches", "b": [0.6405, 0.0857, 0.7113, 0.1041]}, {"w": "via", "b": [0.7172, 0.0857, 0.746, 0.1041]}, {"w": "a", "b": [0.752, 0.0857, 0.7624, 0.1041]}, {"w": "learned", "b": [0.7683, 0.0857, 0.8378, 0.1041]}, {"w": "linear", "b": [0.1289, 0.1049, 0.1826, 0.1233]}, {"w": "transformation", "b": [0.1886, 0.1049, 0.3276, 0.1233]}, {"w": "(the", "b": [0.3335, 0.1049, 0.3702, 0.1233]}, {"w": "convolution", "b": [0.3761, 0.1049, 0.4889, 0.1233]}, {"w": "kernel),", "b": [0.4948, 0.1049, 0.5676, 0.1233]}, {"w": "they’re", "b": [0.5735, 0.1049, 0.6404, 0.1233]}, {"w": "transformed", "b": [0.6463, 0.1049, 0.7604, 0.1233]}, {"w": "via", "b": [0.7663, 0.1049, 0.7951, 0.1233]}, {"w": "a", "b": [0.8011, 0.1049, 0.8115, 0.1233]}, {"w": "hardcoded", "b": [0.1289, 0.124, 0.2272, 0.1425]}, {"w": "max", "b": [0.2331, 0.125, 0.2756, 0.1439]}, {"w": "tensor", "b": [0.2815, 0.124, 0.3392, 0.1425]}, {"w": "operation.", "b": [0.3451, 0.124, 0.4402, 0.1425]}, {"w": "A", "b": [0.4461, 0.124, 0.4632, 0.1425]}, {"w": "big", "b": [0.4691, 0.124, 0.4993, 0.1425]}, {"w": "difference", "b": [0.5052, 0.124, 0.6004, 0.1425]}, {"w": "from", "b": [0.6063, 0.124, 0.6523, 0.1425]}, {"w": "convolution", "b": [0.6582, 0.124, 0.771, 0.1425]}, {"w": "is", "b": [0.7769, 0.124, 0.7926, 0.1425]}, {"w": "that", "b": [0.7985, 0.124, 0.834, 0.1425]}, {"w": "max", "b": [0.1289, 0.1441, 0.1695, 0.1626]}, {"w": "pooling", "b": [0.1754, 0.1441, 0.2476, 0.1626]}, {"w": "is", "b": [0.2535, 0.1441, 0.2693, 0.1626]}, {"w": "usually", "b": [0.2752, 0.1441, 0.3434, 0.1626]}, {"w": "done", "b": [0.3493, 0.1441, 0.3952, 0.1626]}, {"w": "with", "b": [0.4011, 0.1441, 0.4431, 0.1626]}, {"w": "2", "b": [0.449, 0.1441, 0.4608, 0.1626]}, {"w": "×", "b": [0.4667, 0.1441, 0.48, 0.1626]}, {"w": "2", "b": [0.4859, 0.1441, 0.4977, 0.1626]}, {"w": "windows", "b": [0.5036, 0.1441, 0.5889, 0.1626]}, {"w": "and", "b": [0.5948, 0.1441, 0.6289, 0.1626]}, {"w": "stride", "b": [0.6348, 0.1441, 0.6873, 0.1626]}, {"w": "2,", "b": [0.6932, 0.1441, 0.7109, 0.1626]}, {"w": "in", "b": [0.7168, 0.1441, 0.7351, 0.1626]}, {"w": "order", "b": [0.741, 0.1441, 0.7909, 0.1626]}, {"w": "to", "b": [0.7968, 0.1441, 0.8152, 0.1626]}, {"w": "downsample", "b": [0.1289, 0.1633, 0.2482, 0.1817]}, {"w": "the", "b": [0.2542, 0.1633, 0.283, 0.1817]}, {"w": "feature", "b": [0.2889, 0.1633, 0.3545, 0.1817]}, {"w": "maps", "b": [0.3604, 0.1633, 0.4102, 0.1817]}, {"w": "by", "b": [0.4161, 0.1633, 0.4397, 0.1817]}, {"w": "a", "b": [0.4456, 0.1633, 0.4561, 0.1817]}, {"w": "factor", "b": [0.462, 0.1633, 0.5171, 0.1817]}, {"w": "of", "b": [0.523, 0.1633, 0.5427, 0.1817]}, {"w": "2.", "b": [0.5486, 0.1633, 0.5663, 0.1817]}, {"w": "On", "b": [0.5722, 0.1633, 0.6011, 0.1817]}, {"w": "the", "b": [0.607, 0.1633, 0.6358, 0.1817]}, {"w": "other", "b": [0.6417, 0.1633, 0.6902, 0.1817]}, {"w": "hand,", "b": [0.6961, 0.1633, 0.748, 0.1817]}, {"w": "convolution", "b": [0.7539, 0.1633, 0.8667, 0.1817]}, {"w": "is", "b": [0.1289, 0.1825, 0.1446, 0.2009]}, {"w": "typically", "b": [0.1505, 0.1825, 0.2332, 0.2009]}, {"w": "done", "b": [0.2391, 0.1825, 0.285, 0.2009]}, {"w": "with", "b": [0.2909, 0.1825, 0.3329, 0.2009]}, {"w": "3", "b": [0.3388, 0.1825, 0.3506, 0.2009]}, {"w": "×", "b": [0.3565, 0.1825, 0.3698, 0.2009]}, {"w": "3", "b": [0.3757, 0.1825, 0.3875, 0.2009]}, {"w": "windows", "b": [0.3934, 0.1825, 0.4787, 0.2009]}, {"w": "and", "b": [0.4846, 0.1825, 0.5187, 0.2009]}, {"w": "no", "b": [0.5246, 0.1825, 0.5482, 0.2009]}, {"w": "stride", "b": [0.5541, 0.1825, 0.6066, 0.2009]}, {"w": "(stride", "b": [0.6125, 0.1825, 0.6728, 0.2009]}, {"w": "1).", "b": [0.6787, 0.1825, 0.7043, 0.2009]}]}, {"id": "b_1", "type": "paragraph", "text": "Why downsample feature maps this way? Why not remove the max-pooling layers and keep fairly large feature maps all the way up? Let’s look at this option. The convolutional base of the model would then look like this:", "words": [{"w": "Why", "b": [0.1289, 0.2225, 0.1748, 0.241]}, {"w": "downsample", "b": [0.1807, 0.2225, 0.3001, 0.241]}, {"w": "feature", "b": [0.306, 0.2225, 0.3715, 0.241]}, {"w": "maps", "b": [0.3774, 0.2225, 0.4273, 0.241]}, {"w": "this", "b": [0.4332, 0.2225, 0.4673, 0.241]}, {"w": "way?", "b": [0.4732, 0.2225, 0.523, 0.241]}, {"w": "Why", "b": [0.5289, 0.2225, 0.5748, 0.241]}, {"w": "not", "b": [0.5807, 0.2225, 0.6109, 0.241]}, {"w": "remove", "b": [0.6168, 0.2225, 0.6876, 0.241]}, {"w": "the", "b": [0.6936, 0.2225, 0.7224, 0.241]}, {"w": "max-pooling", "b": [0.7283, 0.2225, 0.849, 0.241]}, {"w": "layers", "b": [0.1289, 0.2417, 0.1853, 0.2602]}, {"w": "and", "b": [0.1912, 0.2417, 0.2253, 0.2602]}, {"w": "keep", "b": [0.2312, 0.2417, 0.2758, 0.2602]}, {"w": "fairly", "b": [0.2817, 0.2417, 0.3328, 0.2602]}, {"w": "large", "b": [0.3387, 0.2417, 0.3855, 0.2602]}, {"w": "feature", "b": [0.3914, 0.2417, 0.4569, 0.2602]}, {"w": "maps", "b": [0.4628, 0.2417, 0.5127, 0.2602]}, {"w": "all", "b": [0.5186, 0.2417, 0.5422, 0.2602]}, {"w": "the", "b": [0.5481, 0.2417, 0.577, 0.2602]}, {"w": "way", "b": [0.5829, 0.2417, 0.6222, 0.2602]}, {"w": "up?", "b": [0.6281, 0.2417, 0.6622, 0.2602]}, {"w": "Let’s", "b": [0.6681, 0.2417, 0.7153, 0.2602]}, {"w": "look", "b": [0.7212, 0.2417, 0.7632, 0.2602]}, {"w": "at", "b": [0.7691, 0.2417, 0.7861, 0.2602]}, {"w": "this", "b": [0.792, 0.2417, 0.8261, 0.2602]}, {"w": "option.", "b": [0.1289, 0.2609, 0.1951, 0.2794]}, {"w": "The", "b": [0.201, 0.2609, 0.2378, 0.2794]}, {"w": "convolutional", "b": [0.2437, 0.2609, 0.3735, 0.2794]}, {"w": "base", "b": [0.3795, 0.2609, 0.4214, 0.2794]}, {"w": "of", "b": [0.4273, 0.2609, 0.447, 0.2794]}, {"w": "the", "b": [0.4529, 0.2609, 0.4818, 0.2794]}, {"w": "model", "b": [0.4877, 0.2609, 0.5467, 0.2794]}, {"w": "would", "b": [0.5526, 0.2609, 0.6116, 0.2794]}, {"w": "then", "b": [0.6175, 0.2609, 0.6582, 0.2794]}, {"w": "look", "b": [0.6641, 0.2609, 0.7061, 0.2794]}, {"w": "like", "b": [0.712, 0.2609, 0.7474, 0.2794]}, {"w": "this:", "b": [0.7533, 0.2609, 0.794, 0.2794]}]}, {"id": "b_2", "type": "paragraph", "text": "model_no_max_pool = models.Sequential() model_no_max_pool.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1))) model_no_max_pool.add(layers.Conv2D(64, (3, 3), activation='relu')) model_no_max_pool.add(layers.Conv2D(64, (3, 3), activation='relu'))", "words": [{"w": "model_no_max_pool", "b": [0.1348, 0.2962, 0.3154, 0.3104]}, {"w": "=", "b": [0.3261, 0.2962, 0.3367, 0.3104]}, {"w": "models.Sequential()", "b": [0.3473, 0.2962, 0.5492, 0.3104]}, {"w": "model_no_max_pool.add(layers.Conv2D(32,", "b": [0.1348, 0.3104, 0.5492, 0.3246]}, {"w": "(3,", "b": [0.5598, 0.3104, 0.5917, 0.3246]}, {"w": "3),", "b": [0.6024, 0.3104, 0.6342, 0.3246]}, {"w": "activation='relu',", "b": [0.6449, 0.3104, 0.8361, 0.3246]}, {"w": "input_shape=(28,", "b": [0.3686, 0.3246, 0.5386, 0.3388]}, {"w": "28,", "b": [0.5492, 0.3246, 0.5811, 0.3388]}, {"w": "1)))", "b": [0.5917, 0.3246, 0.6342, 0.3388]}, {"w": "model_no_max_pool.add(layers.Conv2D(64,", "b": [0.1348, 0.3388, 0.5492, 0.3529]}, {"w": "(3,", "b": [0.5598, 0.3388, 0.5917, 0.3529]}, {"w": "3),", "b": [0.6024, 0.3388, 0.6342, 0.3529]}, {"w": "activation='relu'))", "b": [0.6449, 0.3388, 0.8468, 0.3529]}, {"w": "model_no_max_pool.add(layers.Conv2D(64,", "b": [0.1348, 0.353, 0.5492, 0.3671]}, {"w": "(3,", "b": [0.5598, 0.353, 0.5917, 0.3671]}, {"w": "3),", "b": [0.6024, 0.353, 0.6342, 0.3671]}, {"w": "activation='relu'))", "b": [0.6449, 0.353, 0.8468, 0.3671]}]}, {"id": "b_3", "type": "paragraph", "text": "Here’s a summary of the model:", "words": [{"w": "Here’s", "b": [0.1289, 0.3886, 0.1905, 0.407]}, {"w": "a", "b": [0.1964, 0.3886, 0.2069, 0.407]}, {"w": "summary", "b": [0.2128, 0.3886, 0.3007, 0.407]}, {"w": "of", "b": [0.3066, 0.3886, 0.3263, 0.407]}, {"w": "the", "b": [0.3322, 0.3886, 0.361, 0.407]}, {"w": "model:", "b": [0.3669, 0.3886, 0.4325, 0.407]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> model_no_max_pool.summary() Layer (type) Output Shape Param # ================================================================ conv2d_4 (Conv2D) (None, 26, 26, 32) 320 ________________________________________________________________ conv2d_5 (Conv2D) (None, 24, 24, 64) 18496 ________________________________________________________________ conv2d_6 (Conv2D) (None, 22, 22, 64) 36928 ================================================================ Total params: 55,744 Trainable params: 55,744 Non-trainable params: 0", "words": [{"w": ">>>", "b": [0.1348, 0.4239, 0.1667, 0.4381]}, {"w": "model_no_max_pool.summary()", "b": [0.1773, 0.4239, 0.4642, 0.4381]}, {"w": "Layer", "b": [0.1348, 0.4522, 0.1879, 0.4664]}, {"w": "(type)", "b": [0.1985, 0.4522, 0.2623, 0.4664]}, {"w": "Output", "b": [0.4855, 0.4522, 0.5492, 0.4664]}, {"w": "Shape", "b": [0.5598, 0.4522, 0.613, 0.4664]}, {"w": "Param", "b": [0.7192, 0.4522, 0.7724, 0.4664]}, {"w": "#", "b": [0.783, 0.4522, 0.7936, 0.4664]}, {"w": "================================================================", "b": [0.1348, 0.4664, 0.8149, 0.4806]}, {"w": "conv2d_4", "b": [0.1348, 0.4806, 0.2198, 0.4948]}, {"w": "(Conv2D)", "b": [0.2304, 0.4806, 0.3154, 0.4948]}, {"w": "(None,", "b": [0.4855, 0.4806, 0.5492, 0.4948]}, {"w": "26,", "b": [0.5598, 0.4806, 0.5917, 0.4948]}, {"w": "26,", "b": [0.6024, 0.4806, 0.6342, 0.4948]}, {"w": "32)", "b": [0.6449, 0.4806, 0.6767, 0.4948]}, {"w": "320", "b": [0.7192, 0.4806, 0.7511, 0.4948]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4948, 0.8149, 0.509]}, {"w": "conv2d_5", "b": [0.1348, 0.509, 0.2198, 0.5232]}, {"w": "(Conv2D)", "b": [0.2304, 0.509, 0.3154, 0.5232]}, {"w": "(None,", "b": [0.4855, 0.509, 0.5492, 0.5232]}, {"w": "24,", "b": [0.5598, 0.509, 0.5917, 0.5232]}, {"w": "24,", "b": [0.6024, 0.509, 0.6342, 0.5232]}, {"w": "64)", "b": [0.6449, 0.509, 0.6767, 0.5232]}, {"w": "18496", "b": [0.7192, 0.509, 0.7724, 0.5232]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5232, 0.8149, 0.5373]}, {"w": "conv2d_6", "b": [0.1348, 0.5374, 0.2198, 0.5515]}, {"w": "(Conv2D)", "b": [0.2304, 0.5374, 0.3154, 0.5515]}, {"w": "(None,", "b": [0.4855, 0.5374, 0.5492, 0.5515]}, {"w": "22,", "b": [0.5598, 0.5374, 0.5917, 0.5515]}, {"w": "22,", "b": [0.6024, 0.5374, 0.6342, 0.5515]}, {"w": "64)", "b": [0.6449, 0.5374, 0.6767, 0.5515]}, {"w": "36928", "b": [0.7192, 0.5374, 0.7724, 0.5515]}, {"w": "================================================================", "b": [0.1348, 0.5515, 0.8149, 0.5657]}, {"w": "Total", "b": [0.1348, 0.5657, 0.1879, 0.5799]}, {"w": "params:", "b": [0.1985, 0.5657, 0.2729, 0.5799]}, {"w": "55,744", "b": [0.2836, 0.5657, 0.3473, 0.5799]}, {"w": "Trainable", "b": [0.1348, 0.5799, 0.2304, 0.5941]}, {"w": "params:", "b": [0.241, 0.5799, 0.3154, 0.5941]}, {"w": "55,744", "b": [0.3261, 0.5799, 0.3898, 0.5941]}, {"w": "Non-trainable", "b": [0.1348, 0.5941, 0.2729, 0.6083]}, {"w": "params:", "b": [0.2836, 0.5941, 0.3579, 0.6083]}, {"w": "0", "b": [0.3686, 0.5941, 0.3792, 0.6083]}]}, {"id": "b_5", "type": "paragraph", "text": "What’s wrong with this setup? Two things:", "words": [{"w": "What’s", "b": [0.1289, 0.6297, 0.1958, 0.6482]}, {"w": "wrong", "b": [0.2017, 0.6297, 0.262, 0.6482]}, {"w": "with", "b": [0.2679, 0.6297, 0.3099, 0.6482]}, {"w": "this", "b": [0.3158, 0.6297, 0.3499, 0.6482]}, {"w": "setup?", "b": [0.3558, 0.6297, 0.4162, 0.6482]}, {"w": "Two", "b": [0.4221, 0.6297, 0.4637, 0.6482]}, {"w": "things:", "b": [0.4696, 0.6297, 0.5339, 0.6482]}]}, {"id": "b_6", "type": "paragraph", "text": "It isn’t conducive to learning a spatial hierarchy of features. The 3 × 3 windows in the third layer will only contain information coming from 7 × 7 windows in the initial input. The high-level patterns learned by the convnet will still be very small with regard to the initial input, which may not be enough to learn to classify digits (try recognizing a digit by only looking at it through windows that are 7 × 7 pixels!). We need the features from the last convolution layer to contain information about the totality of the input. The final feature map has 22 × 22 × 64 = 30,976 total coefficients per sample. This is huge. If you were to flatten it to stick a Dense layer of size 512 on top, that layer would have 15.8 million parameters. This is", "words": [{"w": "It", "b": [0.1761, 0.6656, 0.1905, 0.6841]}, {"w": "isn’t", "b": [0.1964, 0.6656, 0.238, 0.6841]}, {"w": "conducive", "b": [0.2439, 0.6656, 0.341, 0.6841]}, {"w": "to", "b": [0.3469, 0.6656, 0.3652, 0.6841]}, {"w": "learning", "b": [0.3711, 0.6656, 0.4485, 0.6841]}, {"w": "a", "b": [0.4544, 0.6656, 0.4649, 0.6841]}, {"w": "spatial", "b": [0.4708, 0.6656, 0.5325, 0.6841]}, {"w": "hierarchy", "b": [0.5384, 0.6656, 0.6275, 0.6841]}, {"w": "of", "b": [0.6334, 0.6656, 0.6531, 0.6841]}, {"w": "features.", "b": [0.659, 0.6656, 0.7397, 0.6841]}, {"w": "The", "b": [0.7456, 0.6656, 0.7823, 0.6841]}, {"w": "3", "b": [0.7882, 0.6656, 0.8, 0.6841]}, {"w": "×", "b": [0.8059, 0.6656, 0.8192, 0.6841]}, {"w": "3", "b": [0.8251, 0.6656, 0.8369, 0.6841]}, {"w": "windows", "b": [0.1761, 0.6848, 0.2614, 0.7032]}, {"w": "in", "b": [0.2673, 0.6848, 0.2857, 0.7032]}, {"w": "the", "b": [0.2916, 0.6848, 0.3204, 0.7032]}, {"w": "third", "b": [0.3263, 0.6848, 0.3709, 0.7032]}, {"w": "layer", "b": [0.3768, 0.6848, 0.424, 0.7032]}, {"w": "will", "b": [0.4299, 0.6848, 0.4667, 0.7032]}, {"w": "only", "b": [0.4726, 0.6848, 0.5146, 0.7032]}, {"w": "contain", "b": [0.5205, 0.6848, 0.59, 0.7032]}, {"w": "information", "b": [0.5959, 0.6848, 0.7074, 0.7032]}, {"w": "coming", "b": [0.7132, 0.6848, 0.7841, 0.7032]}, {"w": "from", "b": [0.79, 0.6848, 0.8359, 0.7032]}, {"w": "7", "b": [0.8418, 0.6848, 0.8536, 0.7032]}, {"w": "×", "b": [0.1761, 0.704, 0.1894, 0.7224]}, {"w": "7", "b": [0.1953, 0.704, 0.2071, 0.7224]}, {"w": "windows", "b": [0.213, 0.704, 0.2983, 0.7224]}, {"w": "in", "b": [0.3042, 0.704, 0.3226, 0.7224]}, {"w": "the", "b": [0.3285, 0.704, 0.3573, 0.7224]}, {"w": "initial", "b": [0.3633, 0.704, 0.4184, 0.7224]}, {"w": "input.", "b": [0.4243, 0.704, 0.4787, 0.7224]}, {"w": "The", "b": [0.4846, 0.704, 0.5214, 0.7224]}, {"w": "high-level", "b": [0.5273, 0.704, 0.623, 0.7224]}, {"w": "patterns", "b": [0.6289, 0.704, 0.7037, 0.7224]}, {"w": "learned", "b": [0.7096, 0.704, 0.7791, 0.7224]}, {"w": "by", "b": [0.785, 0.704, 0.8086, 0.7224]}, {"w": "the", "b": [0.8145, 0.704, 0.8434, 0.7224]}, {"w": "convnet", "b": [0.1761, 0.7231, 0.2509, 0.7416]}, {"w": "will", "b": [0.2568, 0.7231, 0.2935, 0.7416]}, {"w": "still", "b": [0.2994, 0.7231, 0.3349, 0.7416]}, {"w": "be", "b": [0.3408, 0.7231, 0.3631, 0.7416]}, {"w": "very", "b": [0.369, 0.7231, 0.4109, 0.7416]}, {"w": "small", "b": [0.4168, 0.7231, 0.468, 0.7416]}, {"w": "with", "b": [0.4739, 0.7231, 0.5159, 0.7416]}, {"w": "regard", "b": [0.5217, 0.7231, 0.5821, 0.7416]}, {"w": "to", "b": [0.588, 0.7231, 0.6063, 0.7416]}, {"w": "the", "b": [0.6122, 0.7231, 0.6411, 0.7416]}, {"w": "initial", "b": [0.647, 0.7231, 0.7021, 0.7416]}, {"w": "input,", "b": [0.708, 0.7231, 0.7625, 0.7416]}, {"w": "which", "b": [0.7684, 0.7231, 0.8261, 0.7416]}, {"w": "may", "b": [0.1761, 0.7423, 0.2168, 0.7608]}, {"w": "not", "b": [0.2227, 0.7423, 0.2529, 0.7608]}, {"w": "be", "b": [0.2588, 0.7423, 0.281, 0.7608]}, {"w": "enough", "b": [0.287, 0.7423, 0.3565, 0.7608]}, {"w": "to", "b": [0.3624, 0.7423, 0.3808, 0.7608]}, {"w": "learn", "b": [0.3867, 0.7423, 0.4339, 0.7608]}, {"w": "to", "b": [0.4398, 0.7423, 0.4581, 0.7608]}, {"w": "classify", "b": [0.464, 0.7423, 0.5362, 0.7608]}, {"w": "digits", "b": [0.5421, 0.7423, 0.5946, 0.7608]}, {"w": "(try", "b": [0.6005, 0.7423, 0.6346, 0.7608]}, {"w": "recognizing", "b": [0.6405, 0.7423, 0.752, 0.7608]}, {"w": "a", "b": [0.7579, 0.7423, 0.7684, 0.7608]}, {"w": "digit", "b": [0.7743, 0.7423, 0.8176, 0.7608]}, {"w": "by", "b": [0.8235, 0.7423, 0.8471, 0.7608]}, {"w": "only", "b": [0.1761, 0.7615, 0.2181, 0.78]}, {"w": "looking", "b": [0.224, 0.7615, 0.2962, 0.78]}, {"w": "at", "b": [0.302, 0.7615, 0.3191, 0.78]}, {"w": "it", "b": [0.325, 0.7615, 0.3381, 0.78]}, {"w": "through", "b": [0.344, 0.7615, 0.4175, 0.78]}, {"w": "windows", "b": [0.4234, 0.7615, 0.5087, 0.78]}, {"w": "that", "b": [0.5146, 0.7615, 0.55, 0.78]}, {"w": "are", "b": [0.5559, 0.7615, 0.5847, 0.78]}, {"w": "7", "b": [0.5906, 0.7615, 0.6024, 0.78]}, {"w": "×", "b": [0.6083, 0.7615, 0.6217, 0.78]}, {"w": "7", "b": [0.6276, 0.7615, 0.6394, 0.78]}, {"w": "pixels!).", "b": [0.6453, 0.7615, 0.7233, 0.78]}, {"w": "We", "b": [0.7292, 0.7615, 0.7601, 0.78]}, {"w": "need", "b": [0.766, 0.7615, 0.8106, 0.78]}, {"w": "the", "b": [0.8165, 0.7615, 0.8453, 0.78]}, {"w": "features", "b": [0.1761, 0.7807, 0.2508, 0.7992]}, {"w": "from", "b": [0.2567, 0.7807, 0.3027, 0.7992]}, {"w": "the", "b": [0.3086, 0.7807, 0.3374, 0.7992]}, {"w": "last", "b": [0.3433, 0.7807, 0.3761, 0.7992]}, {"w": "convolution", "b": [0.382, 0.7807, 0.4949, 0.7992]}, {"w": "layer", "b": [0.5008, 0.7807, 0.548, 0.7992]}, {"w": "to", "b": [0.5539, 0.7807, 0.5722, 0.7992]}, {"w": "contain", "b": [0.5781, 0.7807, 0.6477, 0.7992]}, {"w": "information", "b": [0.6536, 0.7807, 0.7651, 0.7992]}, {"w": "about", "b": [0.7709, 0.7807, 0.8234, 0.7992]}, {"w": "the", "b": [0.8293, 0.7807, 0.8581, 0.7992]}, {"w": "totality", "b": [0.1761, 0.7999, 0.243, 0.8184]}, {"w": "of", "b": [0.2489, 0.7999, 0.2686, 0.8184]}, {"w": "the", "b": [0.2745, 0.7999, 0.3034, 0.8184]}, {"w": "input.", "b": [0.3093, 0.7999, 0.3637, 0.8184]}, {"w": "The", "b": [0.1761, 0.8191, 0.2128, 0.8376]}, {"w": "final", "b": [0.2187, 0.8191, 0.262, 0.8376]}, {"w": "feature", "b": [0.2679, 0.8191, 0.3335, 0.8376]}, {"w": "map", "b": [0.3394, 0.8191, 0.38, 0.8376]}, {"w": "has", "b": [0.3859, 0.8191, 0.4174, 0.8376]}, {"w": "22", "b": [0.4233, 0.8191, 0.4469, 0.8376]}, {"w": "×", "b": [0.4528, 0.8191, 0.4662, 0.8376]}, {"w": "22", "b": [0.4721, 0.8191, 0.4957, 0.8376]}, {"w": "×", "b": [0.5016, 0.8191, 0.5149, 0.8376]}, {"w": "64", "b": [0.5208, 0.8191, 0.5444, 0.8376]}, {"w": "=", "b": [0.5503, 0.8191, 0.5636, 0.8376]}, {"w": "30,976", "b": [0.5696, 0.8191, 0.6345, 0.8376]}, {"w": "total", "b": [0.6404, 0.8191, 0.6824, 0.8376]}, {"w": "coefficients", "b": [0.6883, 0.8191, 0.798, 0.8376]}, {"w": "per", "b": [0.8039, 0.8191, 0.834, 0.8376]}, {"w": "sample.", "b": [0.1761, 0.8383, 0.2489, 0.8568]}, {"w": "This", "b": [0.2548, 0.8383, 0.2968, 0.8568]}, {"w": "is", "b": [0.3027, 0.8383, 0.3185, 0.8568]}, {"w": "huge.", "b": [0.3244, 0.8383, 0.3762, 0.8568]}, {"w": "If", "b": [0.3821, 0.8383, 0.3978, 0.8568]}, {"w": "you", "b": [0.4037, 0.8383, 0.4391, 0.8568]}, {"w": "were", "b": [0.445, 0.8383, 0.4909, 0.8568]}, {"w": "to", "b": [0.4968, 0.8383, 0.5152, 0.8568]}, {"w": "flatten", "b": [0.5211, 0.8383, 0.5814, 0.8568]}, {"w": "it", "b": [0.5873, 0.8383, 0.6005, 0.8568]}, {"w": "to", "b": [0.6064, 0.8383, 0.6247, 0.8568]}, {"w": "stick", "b": [0.6306, 0.8383, 0.6752, 0.8568]}, {"w": "a", "b": [0.6811, 0.8383, 0.6916, 0.8568]}, {"w": "Dense", "b": [0.6975, 0.8393, 0.7683, 0.8582]}, {"w": "layer", "b": [0.7742, 0.8383, 0.8214, 0.8568]}, {"w": "of", "b": [0.8273, 0.8383, 0.847, 0.8568]}, {"w": "size", "b": [0.1761, 0.8583, 0.2128, 0.8768]}, {"w": "512", "b": [0.2187, 0.8583, 0.2542, 0.8768]}, {"w": "on", "b": [0.2601, 0.8583, 0.2837, 0.8768]}, {"w": "top,", "b": [0.2896, 0.8583, 0.3257, 0.8768]}, {"w": "that", "b": [0.3316, 0.8583, 0.367, 0.8768]}, {"w": "layer", "b": [0.3729, 0.8583, 0.4201, 0.8768]}, {"w": "would", "b": [0.426, 0.8583, 0.485, 0.8768]}, {"w": "have", "b": [0.4909, 0.8583, 0.5355, 0.8768]}, {"w": "15.8", "b": [0.5414, 0.8583, 0.5828, 0.8768]}, {"w": "million", "b": [0.5887, 0.8583, 0.6569, 0.8768]}, {"w": "parameters.", "b": [0.6628, 0.8583, 0.7723, 0.8768]}, {"w": "This", "b": [0.7782, 0.8583, 0.8202, 0.8768]}, {"w": "is", "b": [0.8261, 0.8583, 0.8419, 0.8768]}]}]}, {"page": 181, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "far too large for such a small model and would result in intense overfitting.", "words": [{"w": "far", "b": [0.1761, 0.0857, 0.2023, 0.1041]}, {"w": "too", "b": [0.2082, 0.0857, 0.2384, 0.1041]}, {"w": "large", "b": [0.2443, 0.0857, 0.2911, 0.1041]}, {"w": "for", "b": [0.297, 0.0857, 0.3245, 0.1041]}, {"w": "such", "b": [0.3304, 0.0857, 0.3737, 0.1041]}, {"w": "a", "b": [0.3796, 0.0857, 0.3901, 0.1041]}, {"w": "small", "b": [0.396, 0.0857, 0.4472, 0.1041]}, {"w": "model", "b": [0.4531, 0.0857, 0.5121, 0.1041]}, {"w": "and", "b": [0.518, 0.0857, 0.5521, 0.1041]}, {"w": "would", "b": [0.558, 0.0857, 0.617, 0.1041]}, {"w": "result", "b": [0.6229, 0.0857, 0.6754, 0.1041]}, {"w": "in", "b": [0.6813, 0.0857, 0.6997, 0.1041]}, {"w": "intense", "b": [0.7056, 0.0857, 0.7725, 0.1041]}, {"w": "overfitting.", "b": [0.1761, 0.1049, 0.2817, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "In short, the reason to use downsampling is to reduce the number of feature- map coefficients to process, as well as to induce spatial-filter hierarchies by making successive convolution layers look at increasingly large windows (in terms of the fraction of the original input they cover).", "words": [{"w": "In", "b": [0.1289, 0.1449, 0.1485, 0.1634]}, {"w": "short,", "b": [0.1545, 0.1449, 0.2076, 0.1634]}, {"w": "the", "b": [0.2135, 0.1449, 0.2423, 0.1634]}, {"w": "reason", "b": [0.2482, 0.1449, 0.3099, 0.1634]}, {"w": "to", "b": [0.3158, 0.1449, 0.3342, 0.1634]}, {"w": "use", "b": [0.3401, 0.1449, 0.3715, 0.1634]}, {"w": "downsampling", "b": [0.3774, 0.1449, 0.5165, 0.1634]}, {"w": "is", "b": [0.5224, 0.1449, 0.5382, 0.1634]}, {"w": "to", "b": [0.5441, 0.1449, 0.5624, 0.1634]}, {"w": "reduce", "b": [0.5683, 0.1449, 0.6313, 0.1634]}, {"w": "the", "b": [0.6372, 0.1449, 0.666, 0.1634]}, {"w": "number", "b": [0.6719, 0.1449, 0.7441, 0.1634]}, {"w": "of", "b": [0.75, 0.1449, 0.7697, 0.1634]}, {"w": "feature-", "b": [0.7756, 0.1449, 0.849, 0.1634]}, {"w": "map", "b": [0.1289, 0.1641, 0.1695, 0.1826]}, {"w": "coefficients", "b": [0.1754, 0.1641, 0.2852, 0.1826]}, {"w": "to", "b": [0.2911, 0.1641, 0.3094, 0.1826]}, {"w": "process,", "b": [0.3153, 0.1641, 0.3921, 0.1826]}, {"w": "as", "b": [0.398, 0.1641, 0.4176, 0.1826]}, {"w": "well", "b": [0.4235, 0.1641, 0.4642, 0.1826]}, {"w": "as", "b": [0.4701, 0.1641, 0.4898, 0.1826]}, {"w": "to", "b": [0.4957, 0.1641, 0.5141, 0.1826]}, {"w": "induce", "b": [0.52, 0.1641, 0.5829, 0.1826]}, {"w": "spatial-filter", "b": [0.5888, 0.1641, 0.7042, 0.1826]}, {"w": "hierarchies", "b": [0.7101, 0.1641, 0.8137, 0.1826]}, {"w": "by", "b": [0.8196, 0.1641, 0.8432, 0.1826]}, {"w": "making", "b": [0.1289, 0.1833, 0.1997, 0.2018]}, {"w": "successive", "b": [0.2056, 0.1833, 0.3053, 0.2018]}, {"w": "convolution", "b": [0.3112, 0.1833, 0.424, 0.2018]}, {"w": "layers", "b": [0.4299, 0.1833, 0.4863, 0.2018]}, {"w": "look", "b": [0.4922, 0.1833, 0.5342, 0.2018]}, {"w": "at", "b": [0.5401, 0.1833, 0.5572, 0.2018]}, {"w": "increasingly", "b": [0.5631, 0.1833, 0.6785, 0.2018]}, {"w": "large", "b": [0.6844, 0.1833, 0.7311, 0.2018]}, {"w": "windows", "b": [0.737, 0.1833, 0.8223, 0.2018]}, {"w": "(in", "b": [0.8282, 0.1833, 0.8544, 0.2018]}, {"w": "terms", "b": [0.1289, 0.2025, 0.1813, 0.221]}, {"w": "of", "b": [0.1873, 0.2025, 0.2069, 0.221]}, {"w": "the", "b": [0.2128, 0.2025, 0.2417, 0.221]}, {"w": "fraction", "b": [0.2476, 0.2025, 0.321, 0.221]}, {"w": "of", "b": [0.3269, 0.2025, 0.3466, 0.221]}, {"w": "the", "b": [0.3525, 0.2025, 0.3813, 0.221]}, {"w": "original", "b": [0.3872, 0.2025, 0.4607, 0.221]}, {"w": "input", "b": [0.4666, 0.2025, 0.5151, 0.221]}, {"w": "they", "b": [0.5211, 0.2025, 0.5617, 0.221]}, {"w": "cover).", "b": [0.5676, 0.2025, 0.6338, 0.221]}]}, {"id": "b_2", "type": "paragraph", "text": "Note that max pooling isn’t the only way you can achieve such downsampling. As you already know, you can also use strides in the prior convolution layer. And you can use average pooling instead of max pooling, where each local input patch is transformed by taking the average value of each channel over the patch, rather than the max. But max pooling tends to work better than these alternative solutions. In a nutshell, the reason is that features tend to encode the spatial presence of some pattern or concept over the different tiles of the feature map (hence, the term feature map), and it’s more informative to look at the maximal presence of different features than at their average presence. So the most reasonable subsampling strategy is to first produce dense maps of features (via unstrided convolutions) and then look at the maximal activation of the features over small patches, rather than looking at sparser windows of the inputs (via strided convolutions) or averaging input patches, which could cause you to miss or dilute feature-presence information.", "words": [{"w": "Note", "b": [0.1289, 0.2425, 0.1748, 0.261]}, {"w": "that", "b": [0.1807, 0.2425, 0.2161, 0.261]}, {"w": "max", "b": [0.222, 0.2425, 0.2627, 0.261]}, {"w": "pooling", "b": [0.2686, 0.2425, 0.3407, 0.261]}, {"w": "isn’t", "b": [0.3467, 0.2425, 0.3882, 0.261]}, {"w": "the", "b": [0.3941, 0.2425, 0.4229, 0.261]}, {"w": "only", "b": [0.4288, 0.2425, 0.4708, 0.261]}, {"w": "way", "b": [0.4767, 0.2425, 0.5161, 0.261]}, {"w": "you", "b": [0.522, 0.2425, 0.5574, 0.261]}, {"w": "can", "b": [0.5633, 0.2425, 0.5961, 0.261]}, {"w": "achieve", "b": [0.602, 0.2425, 0.6741, 0.261]}, {"w": "such", "b": [0.68, 0.2425, 0.7233, 0.261]}, {"w": "downsampling.", "b": [0.1289, 0.2617, 0.2738, 0.2802]}, {"w": "As", "b": [0.2798, 0.2617, 0.306, 0.2802]}, {"w": "you", "b": [0.3119, 0.2617, 0.3473, 0.2802]}, {"w": "already", "b": [0.3532, 0.2617, 0.4227, 0.2802]}, {"w": "know,", "b": [0.4286, 0.2617, 0.4854, 0.2802]}, {"w": "you", "b": [0.4914, 0.2617, 0.5268, 0.2802]}, {"w": "can", "b": [0.5327, 0.2617, 0.5655, 0.2802]}, {"w": "also", "b": [0.5714, 0.2617, 0.6094, 0.2802]}, {"w": "use", "b": [0.6153, 0.2617, 0.6468, 0.2802]}, {"w": "strides", "b": [0.6527, 0.2617, 0.7143, 0.2802]}, {"w": "in", "b": [0.7202, 0.2617, 0.7386, 0.2802]}, {"w": "the", "b": [0.7445, 0.2617, 0.7734, 0.2802]}, {"w": "prior", "b": [0.7793, 0.2617, 0.8252, 0.2802]}, {"w": "convolution", "b": [0.1289, 0.2809, 0.2417, 0.2994]}, {"w": "layer.", "b": [0.2476, 0.2809, 0.2994, 0.2994]}, {"w": "And", "b": [0.3053, 0.2809, 0.346, 0.2994]}, {"w": "you", "b": [0.3519, 0.2809, 0.3873, 0.2994]}, {"w": "can", "b": [0.3932, 0.2809, 0.426, 0.2994]}, {"w": "use", "b": [0.4319, 0.2809, 0.4633, 0.2994]}, {"w": "average", "b": [0.4692, 0.2809, 0.5427, 0.2994]}, {"w": "pooling", "b": [0.5486, 0.2809, 0.6207, 0.2994]}, {"w": "instead", "b": [0.6266, 0.2809, 0.6935, 0.2994]}, {"w": "of", "b": [0.6994, 0.2809, 0.7191, 0.2994]}, {"w": "max", "b": [0.725, 0.2809, 0.7657, 0.2994]}, {"w": "pooling,", "b": [0.7716, 0.2809, 0.8497, 0.2994]}, {"w": "where", "b": [0.1289, 0.3001, 0.1866, 0.3186]}, {"w": "each", "b": [0.1925, 0.3001, 0.2357, 0.3186]}, {"w": "local", "b": [0.2416, 0.3001, 0.2875, 0.3186]}, {"w": "input", "b": [0.2934, 0.3001, 0.342, 0.3186]}, {"w": "patch", "b": [0.3479, 0.3001, 0.3991, 0.3186]}, {"w": "is", "b": [0.405, 0.3001, 0.4207, 0.3186]}, {"w": "transformed", "b": [0.4266, 0.3001, 0.5407, 0.3186]}, {"w": "by", "b": [0.5466, 0.3001, 0.5702, 0.3186]}, {"w": "taking", "b": [0.5761, 0.3001, 0.6352, 0.3186]}, {"w": "the", "b": [0.6411, 0.3001, 0.6699, 0.3186]}, {"w": "average", "b": [0.6758, 0.3001, 0.7493, 0.3186]}, {"w": "value", "b": [0.7552, 0.3001, 0.8063, 0.3186]}, {"w": "of", "b": [0.8122, 0.3001, 0.8319, 0.3186]}, {"w": "each", "b": [0.1289, 0.3193, 0.1721, 0.3378]}, {"w": "channel", "b": [0.178, 0.3193, 0.2515, 0.3378]}, {"w": "over", "b": [0.2574, 0.3193, 0.2993, 0.3378]}, {"w": "the", "b": [0.3052, 0.3193, 0.3341, 0.3378]}, {"w": "patch,", "b": [0.34, 0.3193, 0.3971, 0.3378]}, {"w": "rather", "b": [0.403, 0.3193, 0.458, 0.3378]}, {"w": "than", "b": [0.4639, 0.3193, 0.5046, 0.3378]}, {"w": "the", "b": [0.5105, 0.3193, 0.5394, 0.3378]}, {"w": "max.", "b": [0.5453, 0.3193, 0.5918, 0.3378]}, {"w": "But", "b": [0.5977, 0.3193, 0.6319, 0.3378]}, {"w": "max", "b": [0.6378, 0.3193, 0.6784, 0.3378]}, {"w": "pooling", "b": [0.6843, 0.3193, 0.7565, 0.3378]}, {"w": "tends", "b": [0.7624, 0.3193, 0.8122, 0.3378]}, {"w": "to", "b": [0.8181, 0.3193, 0.8365, 0.3378]}, {"w": "work", "b": [0.1289, 0.3385, 0.1774, 0.357]}, {"w": "better", "b": [0.1833, 0.3385, 0.2371, 0.357]}, {"w": "than", "b": [0.243, 0.3385, 0.2836, 0.357]}, {"w": "these", "b": [0.2896, 0.3385, 0.3381, 0.357]}, {"w": "alternative", "b": [0.344, 0.3385, 0.4437, 0.357]}, {"w": "solutions.", "b": [0.4496, 0.3385, 0.5408, 0.357]}, {"w": "In", "b": [0.5467, 0.3385, 0.5663, 0.357]}, {"w": "a", "b": [0.5722, 0.3385, 0.5827, 0.357]}, {"w": "nutshell,", "b": [0.5886, 0.3385, 0.6693, 0.357]}, {"w": "the", "b": [0.6752, 0.3385, 0.704, 0.357]}, {"w": "reason", "b": [0.7099, 0.3385, 0.7715, 0.357]}, {"w": "is", "b": [0.7775, 0.3385, 0.7932, 0.357]}, {"w": "that", "b": [0.7991, 0.3385, 0.8345, 0.357]}, {"w": "features", "b": [0.1289, 0.3577, 0.2036, 0.3762]}, {"w": "tend", "b": [0.2095, 0.3577, 0.2502, 0.3762]}, {"w": "to", "b": [0.2561, 0.3577, 0.2745, 0.3762]}, {"w": "encode", "b": [0.2804, 0.3577, 0.3472, 0.3762]}, {"w": "the", "b": [0.3531, 0.3577, 0.382, 0.3762]}, {"w": "spatial", "b": [0.3879, 0.3577, 0.4496, 0.3762]}, {"w": "presence", "b": [0.4555, 0.3577, 0.5381, 0.3762]}, {"w": "of", "b": [0.544, 0.3577, 0.5636, 0.3762]}, {"w": "some", "b": [0.5696, 0.3577, 0.6194, 0.3762]}, {"w": "pattern", "b": [0.6253, 0.3577, 0.6909, 0.3762]}, {"w": "or", "b": [0.6968, 0.3577, 0.7165, 0.3762]}, {"w": "concept", "b": [0.7224, 0.3577, 0.7958, 0.3762]}, {"w": "over", "b": [0.8017, 0.3577, 0.8437, 0.3762]}, {"w": "the", "b": [0.1289, 0.3769, 0.1577, 0.3954]}, {"w": "different", "b": [0.1636, 0.3769, 0.2445, 0.3954]}, {"w": "tiles", "b": [0.2504, 0.3769, 0.2898, 0.3954]}, {"w": "of", "b": [0.2957, 0.3769, 0.3153, 0.3954]}, {"w": "the", "b": [0.3213, 0.3769, 0.3501, 0.3954]}, {"w": "feature", "b": [0.356, 0.3769, 0.4215, 0.3954]}, {"w": "map", "b": [0.4274, 0.3769, 0.4681, 0.3954]}, {"w": "(hence,", "b": [0.474, 0.3769, 0.5428, 0.3954]}, {"w": "the", "b": [0.5488, 0.3769, 0.5776, 0.3954]}, {"w": "term", "b": [0.5835, 0.3769, 0.6268, 0.3954]}, {"w": "feature", "b": [0.6326, 0.3769, 0.6987, 0.3954]}, {"w": "map),", "b": [0.7046, 0.3769, 0.759, 0.3954]}, {"w": "and", "b": [0.7649, 0.3769, 0.799, 0.3954]}, {"w": "it’s", "b": [0.8049, 0.3769, 0.8338, 0.3954]}, {"w": "more", "b": [0.1289, 0.3961, 0.1774, 0.4145]}, {"w": "informative", "b": [0.1833, 0.3961, 0.2935, 0.4145]}, {"w": "to", "b": [0.2994, 0.3961, 0.3178, 0.4145]}, {"w": "look", "b": [0.3237, 0.3961, 0.3657, 0.4145]}, {"w": "at", "b": [0.3716, 0.3961, 0.3886, 0.4145]}, {"w": "the", "b": [0.3945, 0.3961, 0.4234, 0.4145]}, {"w": "maximal", "b": [0.4292, 0.3961, 0.5106, 0.4145]}, {"w": "presence", "b": [0.5165, 0.3961, 0.5995, 0.4145]}, {"w": "of", "b": [0.6054, 0.3961, 0.6251, 0.4145]}, {"w": "different", "b": [0.631, 0.3961, 0.7118, 0.4145]}, {"w": "features", "b": [0.7178, 0.3961, 0.7925, 0.4145]}, {"w": "than", "b": [0.7984, 0.3961, 0.8391, 0.4145]}, {"w": "at", "b": [0.845, 0.3961, 0.862, 0.4145]}, {"w": "their", "b": [0.1289, 0.4153, 0.1722, 0.4337]}, {"w": "average", "b": [0.178, 0.4153, 0.2541, 0.4337]}, {"w": "presence.", "b": [0.26, 0.4153, 0.3489, 0.4337]}, {"w": "So", "b": [0.3548, 0.4153, 0.3798, 0.4337]}, {"w": "the", "b": [0.3857, 0.4153, 0.4145, 0.4337]}, {"w": "most", "b": [0.4204, 0.4153, 0.4664, 0.4337]}, {"w": "reasonable", "b": [0.4723, 0.4153, 0.5733, 0.4337]}, {"w": "subsampling", "b": [0.5792, 0.4153, 0.6986, 0.4337]}, {"w": "strategy", "b": [0.7045, 0.4153, 0.7792, 0.4337]}, {"w": "is", "b": [0.7851, 0.4153, 0.8009, 0.4337]}, {"w": "to", "b": [0.8068, 0.4153, 0.8252, 0.4337]}, {"w": "first", "b": [0.8311, 0.4153, 0.8691, 0.4337]}, {"w": "produce", "b": [0.1289, 0.4344, 0.2049, 0.4529]}, {"w": "dense", "b": [0.2108, 0.4344, 0.2646, 0.4529]}, {"w": "maps", "b": [0.2705, 0.4344, 0.3204, 0.4529]}, {"w": "of", "b": [0.3263, 0.4344, 0.3459, 0.4529]}, {"w": "features", "b": [0.3518, 0.4344, 0.4266, 0.4529]}, {"w": "(via", "b": [0.4325, 0.4344, 0.4692, 0.4529]}, {"w": "unstrided", "b": [0.4751, 0.4344, 0.563, 0.4529]}, {"w": "convolutions)", "b": [0.5689, 0.4344, 0.6988, 0.4529]}, {"w": "and", "b": [0.7047, 0.4344, 0.7388, 0.4529]}, {"w": "then", "b": [0.7446, 0.4344, 0.7853, 0.4529]}, {"w": "look", "b": [0.7912, 0.4344, 0.8332, 0.4529]}, {"w": "at", "b": [0.8391, 0.4344, 0.8561, 0.4529]}, {"w": "the", "b": [0.1289, 0.4536, 0.1577, 0.4721]}, {"w": "maximal", "b": [0.1636, 0.4536, 0.2463, 0.4721]}, {"w": "activation", "b": [0.2522, 0.4536, 0.3453, 0.4721]}, {"w": "of", "b": [0.3512, 0.4536, 0.3709, 0.4721]}, {"w": "the", "b": [0.3768, 0.4536, 0.4057, 0.4721]}, {"w": "features", "b": [0.4116, 0.4536, 0.4863, 0.4721]}, {"w": "over", "b": [0.4922, 0.4536, 0.5342, 0.4721]}, {"w": "small", "b": [0.5401, 0.4536, 0.5913, 0.4721]}, {"w": "patches,", "b": [0.5972, 0.4536, 0.6739, 0.4721]}, {"w": "rather", "b": [0.6798, 0.4536, 0.7349, 0.4721]}, {"w": "than", "b": [0.7408, 0.4536, 0.7814, 0.4721]}, {"w": "looking", "b": [0.7873, 0.4536, 0.8595, 0.4721]}, {"w": "at", "b": [0.1289, 0.4728, 0.1459, 0.4913]}, {"w": "sparser", "b": [0.1518, 0.4728, 0.2187, 0.4913]}, {"w": "windows", "b": [0.2246, 0.4728, 0.3099, 0.4913]}, {"w": "of", "b": [0.3158, 0.4728, 0.3355, 0.4913]}, {"w": "the", "b": [0.3414, 0.4728, 0.3702, 0.4913]}, {"w": "inputs", "b": [0.3761, 0.4728, 0.4339, 0.4913]}, {"w": "(via", "b": [0.4397, 0.4728, 0.4765, 0.4913]}, {"w": "strided", "b": [0.4824, 0.4728, 0.5466, 0.4913]}, {"w": "convolutions)", "b": [0.5525, 0.4728, 0.6824, 0.4913]}, {"w": "or", "b": [0.6883, 0.4728, 0.708, 0.4913]}, {"w": "averaging", "b": [0.7139, 0.4728, 0.807, 0.4913]}, {"w": "input", "b": [0.8129, 0.4728, 0.8615, 0.4913]}, {"w": "patches,", "b": [0.1289, 0.492, 0.2056, 0.5105]}, {"w": "which", "b": [0.2115, 0.492, 0.2692, 0.5105]}, {"w": "could", "b": [0.2751, 0.492, 0.3276, 0.5105]}, {"w": "cause", "b": [0.3335, 0.492, 0.3859, 0.5105]}, {"w": "you", "b": [0.3918, 0.492, 0.4273, 0.5105]}, {"w": "to", "b": [0.4332, 0.492, 0.4515, 0.5105]}, {"w": "miss", "b": [0.4575, 0.492, 0.5008, 0.5105]}, {"w": "or", "b": [0.5067, 0.492, 0.5263, 0.5105]}, {"w": "dilute", "b": [0.5322, 0.492, 0.586, 0.5105]}, {"w": "feature-presence", "b": [0.5919, 0.492, 0.748, 0.5105]}, {"w": "information.", "b": [0.7539, 0.492, 0.8713, 0.5105]}]}, {"id": "b_3", "type": "paragraph", "text": "At this point, you should understand the basics of convnets—feature maps, convolution, and max pooling—and you know how to build a small convnet to solve a toy problem such as MNIST digits classification. Now let’s move on to more useful, practical applications.", "words": [{"w": "At", "b": [0.1289, 0.5321, 0.1525, 0.5505]}, {"w": "this", "b": [0.1584, 0.5321, 0.1925, 0.5505]}, {"w": "point,", "b": [0.1984, 0.5321, 0.2529, 0.5505]}, {"w": "you", "b": [0.2588, 0.5321, 0.2942, 0.5505]}, {"w": "should", "b": [0.3001, 0.5321, 0.3631, 0.5505]}, {"w": "understand", "b": [0.369, 0.5321, 0.4726, 0.5505]}, {"w": "the", "b": [0.4785, 0.5321, 0.5074, 0.5505]}, {"w": "basics", "b": [0.5133, 0.5321, 0.571, 0.5505]}, {"w": "of", "b": [0.5769, 0.5321, 0.5966, 0.5505]}, {"w": "convnets—feature", "b": [0.6025, 0.5321, 0.7756, 0.5505]}, {"w": "maps,", "b": [0.7815, 0.5321, 0.8372, 0.5505]}, {"w": "convolution,", "b": [0.1289, 0.5513, 0.2476, 0.5697]}, {"w": "and", "b": [0.2535, 0.5513, 0.2876, 0.5697]}, {"w": "max", "b": [0.2935, 0.5513, 0.3342, 0.5697]}, {"w": "pooling—and", "b": [0.3401, 0.5513, 0.47, 0.5697]}, {"w": "you", "b": [0.4759, 0.5513, 0.5113, 0.5697]}, {"w": "know", "b": [0.5172, 0.5513, 0.5697, 0.5697]}, {"w": "how", "b": [0.5756, 0.5513, 0.6162, 0.5697]}, {"w": "to", "b": [0.6221, 0.5513, 0.6405, 0.5697]}, {"w": "build", "b": [0.6464, 0.5513, 0.6949, 0.5697]}, {"w": "a", "b": [0.7008, 0.5513, 0.7113, 0.5697]}, {"w": "small", "b": [0.7172, 0.5513, 0.7684, 0.5697]}, {"w": "convnet", "b": [0.7743, 0.5513, 0.8491, 0.5697]}, {"w": "to", "b": [0.1289, 0.5704, 0.1472, 0.5889]}, {"w": "solve", "b": [0.1532, 0.5704, 0.203, 0.5889]}, {"w": "a", "b": [0.2089, 0.5704, 0.2194, 0.5889]}, {"w": "toy", "b": [0.2253, 0.5704, 0.2555, 0.5889]}, {"w": "problem", "b": [0.2614, 0.5704, 0.3401, 0.5889]}, {"w": "such", "b": [0.346, 0.5704, 0.3893, 0.5889]}, {"w": "as", "b": [0.3952, 0.5704, 0.4149, 0.5889]}, {"w": "MNIST", "b": [0.4208, 0.5704, 0.4942, 0.5889]}, {"w": "digits", "b": [0.5001, 0.5704, 0.5526, 0.5889]}, {"w": "classification.", "b": [0.5585, 0.5704, 0.689, 0.5889]}, {"w": "Now", "b": [0.6949, 0.5704, 0.7409, 0.5889]}, {"w": "let’s", "b": [0.7468, 0.5704, 0.7861, 0.5889]}, {"w": "move", "b": [0.792, 0.5704, 0.8444, 0.5889]}, {"w": "on", "b": [0.1289, 0.5896, 0.1525, 0.6081]}, {"w": "to", "b": [0.1584, 0.5896, 0.1768, 0.6081]}, {"w": "more", "b": [0.1827, 0.5896, 0.2312, 0.6081]}, {"w": "useful,", "b": [0.2371, 0.5896, 0.3007, 0.6081]}, {"w": "practical", "b": [0.3066, 0.5896, 0.3879, 0.6081]}, {"w": "applications.", "b": [0.3938, 0.5896, 0.5138, 0.6081]}]}, {"id": "b_4", "type": "paragraph", "text": "5.2. Training a convnet from scratch on a small dataset", "words": [{"w": "5.2.", "b": [0.1289, 0.6429, 0.1687, 0.6636]}, {"w": "Training", "b": [0.1754, 0.6429, 0.2738, 0.6636]}, {"w": "a", "b": [0.2804, 0.6429, 0.2937, 0.6636]}, {"w": "convnet", "b": [0.3004, 0.6429, 0.3889, 0.6636]}, {"w": "from", "b": [0.3955, 0.6429, 0.4511, 0.6636]}, {"w": "scratch", "b": [0.4578, 0.6429, 0.5404, 0.6636]}, {"w": "on", "b": [0.547, 0.6429, 0.5751, 0.6636]}, {"w": "a", "b": [0.5817, 0.6429, 0.595, 0.6636]}, {"w": "small", "b": [0.6016, 0.6429, 0.6622, 0.6636]}, {"w": "dataset", "b": [0.6688, 0.6429, 0.75, 0.6636]}]}, {"id": "b_5", "type": "paragraph", "text": "Having to train an image-classification model using very little data is a common situation, which you’ll likely encounter in practice if you ever do computer vision in a professional context. A “few” samples can mean anywhere from a few hundred to a few tens of thousands of images. As a practical example, we’ll focus on classifying images as dogs or cats, in a dataset containing 4,000 pictures of cats and dogs (2,000 cats, 2,000 dogs). We’ll use 2,000 pictures for training—1,000 for validation, and 1,000 for testing.", "words": [{"w": "Having", "b": [0.1289, 0.6856, 0.1984, 0.7041]}, {"w": "to", "b": [0.2043, 0.6856, 0.2227, 0.7041]}, {"w": "train", "b": [0.2286, 0.6856, 0.2719, 0.7041]}, {"w": "an", "b": [0.2778, 0.6856, 0.3001, 0.7041]}, {"w": "image-classification", "b": [0.306, 0.6856, 0.4962, 0.7041]}, {"w": "model", "b": [0.5021, 0.6856, 0.5611, 0.7041]}, {"w": "using", "b": [0.567, 0.6856, 0.6182, 0.7041]}, {"w": "very", "b": [0.6241, 0.6856, 0.666, 0.7041]}, {"w": "little", "b": [0.6719, 0.6856, 0.7153, 0.7041]}, {"w": "data", "b": [0.7212, 0.6856, 0.7605, 0.7041]}, {"w": "is", "b": [0.7664, 0.6856, 0.7822, 0.7041]}, {"w": "a", "b": [0.7881, 0.6856, 0.7985, 0.7041]}, {"w": "common", "b": [0.1289, 0.7048, 0.2115, 0.7233]}, {"w": "situation,", "b": [0.2174, 0.7048, 0.3047, 0.7233]}, {"w": "which", "b": [0.3106, 0.7048, 0.3683, 0.7233]}, {"w": "you’ll", "b": [0.3742, 0.7048, 0.4306, 0.7233]}, {"w": "likely", "b": [0.4365, 0.7048, 0.4903, 0.7233]}, {"w": "encounter", "b": [0.4962, 0.7048, 0.5893, 0.7233]}, {"w": "in", "b": [0.5952, 0.7048, 0.6135, 0.7233]}, {"w": "practice", "b": [0.6195, 0.7048, 0.6942, 0.7233]}, {"w": "if", "b": [0.7001, 0.7048, 0.7145, 0.7233]}, {"w": "you", "b": [0.7204, 0.7048, 0.7559, 0.7233]}, {"w": "ever", "b": [0.7618, 0.7048, 0.8024, 0.7233]}, {"w": "do", "b": [0.8083, 0.7048, 0.8319, 0.7233]}, {"w": "computer", "b": [0.1289, 0.724, 0.2181, 0.7425]}, {"w": "vision", "b": [0.224, 0.724, 0.2817, 0.7425]}, {"w": "in", "b": [0.2876, 0.724, 0.306, 0.7425]}, {"w": "a", "b": [0.3119, 0.724, 0.3224, 0.7425]}, {"w": "professional", "b": [0.3283, 0.724, 0.4437, 0.7425]}, {"w": "context.", "b": [0.4496, 0.724, 0.525, 0.7425]}, {"w": "A", "b": [0.5309, 0.724, 0.548, 0.7425]}, {"w": "“few”", "b": [0.5539, 0.724, 0.6103, 0.7425]}, {"w": "samples", "b": [0.6162, 0.724, 0.6923, 0.7425]}, {"w": "can", "b": [0.6982, 0.724, 0.7309, 0.7425]}, {"w": "mean", "b": [0.7368, 0.724, 0.788, 0.7425]}, {"w": "anywhere", "b": [0.1289, 0.7432, 0.2207, 0.7616]}, {"w": "from", "b": [0.2266, 0.7432, 0.2725, 0.7616]}, {"w": "a", "b": [0.2784, 0.7432, 0.2889, 0.7616]}, {"w": "few", "b": [0.2948, 0.7432, 0.3302, 0.7616]}, {"w": "hundred", "b": [0.3361, 0.7432, 0.4135, 0.7616]}, {"w": "to", "b": [0.4193, 0.7432, 0.4377, 0.7616]}, {"w": "a", "b": [0.4436, 0.7432, 0.4541, 0.7616]}, {"w": "few", "b": [0.46, 0.7432, 0.4954, 0.7616]}, {"w": "tens", "b": [0.5013, 0.7432, 0.5393, 0.7616]}, {"w": "of", "b": [0.5453, 0.7432, 0.5649, 0.7616]}, {"w": "thousands", "b": [0.5708, 0.7432, 0.6653, 0.7616]}, {"w": "of", "b": [0.6712, 0.7432, 0.6909, 0.7616]}, {"w": "images.", "b": [0.6968, 0.7432, 0.7696, 0.7616]}, {"w": "As", "b": [0.7755, 0.7432, 0.8017, 0.7616]}, {"w": "a", "b": [0.8076, 0.7432, 0.8181, 0.7616]}, {"w": "practical", "b": [0.1289, 0.7624, 0.2102, 0.7808]}, {"w": "example,", "b": [0.2161, 0.7624, 0.302, 0.7808]}, {"w": "we’ll", "b": [0.3079, 0.7624, 0.3564, 0.7808]}, {"w": "focus", "b": [0.3623, 0.7624, 0.4135, 0.7808]}, {"w": "on", "b": [0.4194, 0.7624, 0.443, 0.7808]}, {"w": "classifying", "b": [0.4489, 0.7624, 0.5512, 0.7808]}, {"w": "images", "b": [0.5571, 0.7624, 0.624, 0.7808]}, {"w": "as", "b": [0.6299, 0.7624, 0.6496, 0.7808]}, {"w": "dogs", "b": [0.6555, 0.7624, 0.7001, 0.7808]}, {"w": "or", "b": [0.706, 0.7624, 0.7257, 0.7808]}, {"w": "cats,", "b": [0.7316, 0.7624, 0.7742, 0.7808]}, {"w": "in", "b": [0.7801, 0.7624, 0.7985, 0.7808]}, {"w": "a", "b": [0.8044, 0.7624, 0.8149, 0.7808]}, {"w": "dataset", "b": [0.1289, 0.7816, 0.1945, 0.8]}, {"w": "containing", "b": [0.2003, 0.7816, 0.3, 0.8]}, {"w": "4,000", "b": [0.3059, 0.7816, 0.3591, 0.8]}, {"w": "pictures", "b": [0.365, 0.7816, 0.4397, 0.8]}, {"w": "of", "b": [0.4456, 0.7816, 0.4653, 0.8]}, {"w": "cats", "b": [0.4712, 0.7816, 0.5079, 0.8]}, {"w": "and", "b": [0.5138, 0.7816, 0.5479, 0.8]}, {"w": "dogs", "b": [0.5538, 0.7816, 0.5985, 0.8]}, {"w": "(2,000", "b": [0.6044, 0.7816, 0.6654, 0.8]}, {"w": "cats,", "b": [0.6713, 0.7816, 0.7139, 0.8]}, {"w": "2,000", "b": [0.7198, 0.7816, 0.7729, 0.8]}, {"w": "dogs).", "b": [0.7788, 0.7816, 0.8372, 0.8]}, {"w": "We’ll", "b": [0.1289, 0.8007, 0.1808, 0.8192]}, {"w": "use", "b": [0.1867, 0.8007, 0.2181, 0.8192]}, {"w": "2,000", "b": [0.224, 0.8007, 0.2772, 0.8192]}, {"w": "pictures", "b": [0.2831, 0.8007, 0.3578, 0.8192]}, {"w": "for", "b": [0.3637, 0.8007, 0.3913, 0.8192]}, {"w": "training—1,000", "b": [0.3972, 0.8007, 0.5474, 0.8192]}, {"w": "for", "b": [0.5533, 0.8007, 0.5808, 0.8192]}, {"w": "validation,", "b": [0.5867, 0.8007, 0.6871, 0.8192]}, {"w": "and", "b": [0.6929, 0.8007, 0.727, 0.8192]}, {"w": "1,000", "b": [0.7329, 0.8007, 0.7861, 0.8192]}, {"w": "for", "b": [0.792, 0.8007, 0.8195, 0.8192]}, {"w": "testing.", "b": [0.1289, 0.8199, 0.1978, 0.8384]}]}, {"id": "b_6", "type": "paragraph", "text": "In this section, we’ll review one basic strategy to tackle this problem: training a new model from scratch using what little data you have. You’ll start by", "words": [{"w": "In", "b": [0.1289, 0.86, 0.1485, 0.8785]}, {"w": "this", "b": [0.1545, 0.86, 0.1886, 0.8785]}, {"w": "section,", "b": [0.1945, 0.86, 0.2673, 0.8785]}, {"w": "we’ll", "b": [0.2732, 0.86, 0.3217, 0.8785]}, {"w": "review", "b": [0.3276, 0.86, 0.3919, 0.8785]}, {"w": "one", "b": [0.3978, 0.86, 0.4319, 0.8785]}, {"w": "basic", "b": [0.4378, 0.86, 0.4863, 0.8785]}, {"w": "strategy", "b": [0.4922, 0.86, 0.567, 0.8785]}, {"w": "to", "b": [0.5729, 0.86, 0.5913, 0.8785]}, {"w": "tackle", "b": [0.5972, 0.86, 0.6535, 0.8785]}, {"w": "this", "b": [0.6595, 0.86, 0.6936, 0.8785]}, {"w": "problem:", "b": [0.6995, 0.86, 0.7848, 0.8785]}, {"w": "training", "b": [0.7907, 0.86, 0.8641, 0.8785]}, {"w": "a", "b": [0.1289, 0.8792, 0.1394, 0.8977]}, {"w": "new", "b": [0.1453, 0.8792, 0.1846, 0.8977]}, {"w": "model", "b": [0.1905, 0.8792, 0.2495, 0.8977]}, {"w": "from", "b": [0.2555, 0.8792, 0.3014, 0.8977]}, {"w": "scratch", "b": [0.3073, 0.8792, 0.3741, 0.8977]}, {"w": "using", "b": [0.38, 0.8792, 0.4312, 0.8977]}, {"w": "what", "b": [0.4371, 0.8792, 0.483, 0.8977]}, {"w": "little", "b": [0.4889, 0.8792, 0.5322, 0.8977]}, {"w": "data", "b": [0.5381, 0.8792, 0.5774, 0.8977]}, {"w": "you", "b": [0.5833, 0.8792, 0.6187, 0.8977]}, {"w": "have.", "b": [0.6246, 0.8792, 0.6751, 0.8977]}, {"w": "You’ll", "b": [0.681, 0.8792, 0.7403, 0.8977]}, {"w": "start", "b": [0.7462, 0.8792, 0.7869, 0.8977]}, {"w": "by", "b": [0.7928, 0.8792, 0.8164, 0.8977]}]}]}, {"page": 182, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "naively training a small convnet on the 2,000 training samples, without any regularization, to set a baseline for what can be achieved. This will get you to a classification accuracy of 71%. At that point, the main issue will be overfitting. Then we’ll introduce data augmentation, a powerful technique for mitigating overfitting in computer vision. By using data augmentation, you’ll improve the network to reach an accuracy of 82%.", "words": [{"w": "naively", "b": [0.1289, 0.0857, 0.1984, 0.1041]}, {"w": "training", "b": [0.2043, 0.0857, 0.2778, 0.1041]}, {"w": "a", "b": [0.2837, 0.0857, 0.2942, 0.1041]}, {"w": "small", "b": [0.3001, 0.0857, 0.3512, 0.1041]}, {"w": "convnet", "b": [0.3571, 0.0857, 0.4319, 0.1041]}, {"w": "on", "b": [0.4378, 0.0857, 0.4614, 0.1041]}, {"w": "the", "b": [0.4673, 0.0857, 0.4962, 0.1041]}, {"w": "2,000", "b": [0.5021, 0.0857, 0.5552, 0.1041]}, {"w": "training", "b": [0.5611, 0.0857, 0.6346, 0.1041]}, {"w": "samples,", "b": [0.6405, 0.0857, 0.7225, 0.1041]}, {"w": "without", "b": [0.7284, 0.0857, 0.8006, 0.1041]}, {"w": "any", "b": [0.8065, 0.0857, 0.8406, 0.1041]}, {"w": "regularization,", "b": [0.1289, 0.1049, 0.2659, 0.1233]}, {"w": "to", "b": [0.2718, 0.1049, 0.2902, 0.1233]}, {"w": "set", "b": [0.2961, 0.1049, 0.3223, 0.1233]}, {"w": "a", "b": [0.3282, 0.1049, 0.3387, 0.1233]}, {"w": "baseline", "b": [0.3446, 0.1049, 0.422, 0.1233]}, {"w": "for", "b": [0.4279, 0.1049, 0.4554, 0.1233]}, {"w": "what", "b": [0.4613, 0.1049, 0.5072, 0.1233]}, {"w": "can", "b": [0.5131, 0.1049, 0.5459, 0.1233]}, {"w": "be", "b": [0.5518, 0.1049, 0.5741, 0.1233]}, {"w": "achieved.", "b": [0.58, 0.1049, 0.6699, 0.1233]}, {"w": "This", "b": [0.6758, 0.1049, 0.7177, 0.1233]}, {"w": "will", "b": [0.7236, 0.1049, 0.7604, 0.1233]}, {"w": "get", "b": [0.7663, 0.1049, 0.7952, 0.1233]}, {"w": "you", "b": [0.8011, 0.1049, 0.8365, 0.1233]}, {"w": "to", "b": [0.8424, 0.1049, 0.8608, 0.1233]}, {"w": "a", "b": [0.1289, 0.124, 0.1394, 0.1425]}, {"w": "classification", "b": [0.1453, 0.124, 0.2699, 0.1425]}, {"w": "accuracy", "b": [0.2758, 0.124, 0.3597, 0.1425]}, {"w": "of", "b": [0.3656, 0.124, 0.3853, 0.1425]}, {"w": "71%.", "b": [0.3912, 0.124, 0.4404, 0.1425]}, {"w": "At", "b": [0.4463, 0.124, 0.4699, 0.1425]}, {"w": "that", "b": [0.4758, 0.124, 0.5112, 0.1425]}, {"w": "point,", "b": [0.5171, 0.124, 0.5716, 0.1425]}, {"w": "the", "b": [0.5775, 0.124, 0.6063, 0.1425]}, {"w": "main", "b": [0.6122, 0.124, 0.6595, 0.1425]}, {"w": "issue", "b": [0.6653, 0.124, 0.7125, 0.1425]}, {"w": "will", "b": [0.7184, 0.124, 0.7551, 0.1425]}, {"w": "be", "b": [0.761, 0.124, 0.7833, 0.1425]}, {"w": "overfitting.", "b": [0.1289, 0.1432, 0.2345, 0.1617]}, {"w": "Then", "b": [0.2404, 0.1432, 0.2889, 0.1617]}, {"w": "we’ll", "b": [0.2948, 0.1432, 0.3433, 0.1617]}, {"w": "introduce", "b": [0.3492, 0.1432, 0.4384, 0.1617]}, {"w": "data", "b": [0.4443, 0.1432, 0.4863, 0.1617]}, {"w": "augmentation,", "b": [0.4922, 0.1432, 0.6279, 0.1617]}, {"w": "a", "b": [0.6338, 0.1432, 0.6443, 0.1617]}, {"w": "powerful", "b": [0.6502, 0.1432, 0.7355, 0.1617]}, {"w": "technique", "b": [0.7414, 0.1432, 0.8332, 0.1617]}, {"w": "for", "b": [0.8391, 0.1432, 0.8666, 0.1617]}, {"w": "mitigating", "b": [0.1289, 0.1624, 0.226, 0.1809]}, {"w": "overfitting", "b": [0.2319, 0.1624, 0.3316, 0.1809]}, {"w": "in", "b": [0.3375, 0.1624, 0.3559, 0.1809]}, {"w": "computer", "b": [0.3618, 0.1624, 0.451, 0.1809]}, {"w": "vision.", "b": [0.4569, 0.1624, 0.5205, 0.1809]}, {"w": "By", "b": [0.5264, 0.1624, 0.554, 0.1809]}, {"w": "using", "b": [0.5599, 0.1624, 0.611, 0.1809]}, {"w": "data", "b": [0.6169, 0.1624, 0.6563, 0.1809]}, {"w": "augmentation,", "b": [0.6622, 0.1624, 0.7967, 0.1809]}, {"w": "you’ll", "b": [0.8026, 0.1624, 0.859, 0.1809]}, {"w": "improve", "b": [0.1289, 0.1816, 0.2076, 0.2001]}, {"w": "the", "b": [0.2135, 0.1816, 0.2423, 0.2001]}, {"w": "network", "b": [0.2482, 0.1816, 0.3256, 0.2001]}, {"w": "to", "b": [0.3315, 0.1816, 0.3499, 0.2001]}, {"w": "reach", "b": [0.3558, 0.1816, 0.4069, 0.2001]}, {"w": "an", "b": [0.4128, 0.1816, 0.4351, 0.2001]}, {"w": "accuracy", "b": [0.441, 0.1816, 0.5249, 0.2001]}, {"w": "of", "b": [0.5308, 0.1816, 0.5505, 0.2001]}, {"w": "82%.", "b": [0.5564, 0.1816, 0.6056, 0.2001]}]}, {"id": "b_1", "type": "paragraph", "text": "In the next section, we’ll review two more essential techniques for applying deep learning to small datasets: feature extraction with a pretrained network (which will get you to an accuracy of 90% to 96%) and fine-tuning a pretrained network (this will get you to a final accuracy of 97%). Together, these three strategies—training a small model from scratch, doing feature extraction using a pretrained model, and fine-tuning a pretrained model—will constitute your future toolbox for tackling the problem of performing image classification with small datasets.", "words": [{"w": "In", "b": [0.1289, 0.2217, 0.1485, 0.2402]}, {"w": "the", "b": [0.1545, 0.2217, 0.1833, 0.2402]}, {"w": "next", "b": [0.1892, 0.2217, 0.2299, 0.2402]}, {"w": "section,", "b": [0.2358, 0.2217, 0.3086, 0.2402]}, {"w": "we’ll", "b": [0.3145, 0.2217, 0.363, 0.2402]}, {"w": "review", "b": [0.3689, 0.2217, 0.4332, 0.2402]}, {"w": "two", "b": [0.4391, 0.2217, 0.4745, 0.2402]}, {"w": "more", "b": [0.4804, 0.2217, 0.5289, 0.2402]}, {"w": "essential", "b": [0.5348, 0.2217, 0.6162, 0.2402]}, {"w": "techniques", "b": [0.6221, 0.2217, 0.7231, 0.2402]}, {"w": "for", "b": [0.729, 0.2217, 0.7565, 0.2402]}, {"w": "applying", "b": [0.7624, 0.2217, 0.8451, 0.2402]}, {"w": "deep", "b": [0.1289, 0.2409, 0.1735, 0.2593]}, {"w": "learning", "b": [0.1794, 0.2409, 0.2567, 0.2593]}, {"w": "to", "b": [0.2627, 0.2409, 0.281, 0.2593]}, {"w": "small", "b": [0.2869, 0.2409, 0.3381, 0.2593]}, {"w": "datasets:", "b": [0.344, 0.2409, 0.4253, 0.2593]}, {"w": "feature", "b": [0.4312, 0.2409, 0.4972, 0.2593]}, {"w": "extraction", "b": [0.5031, 0.2409, 0.5989, 0.2593]}, {"w": "with", "b": [0.6048, 0.2409, 0.6455, 0.2593]}, {"w": "a", "b": [0.6514, 0.2409, 0.6632, 0.2593]}, {"w": "pretrained", "b": [0.6691, 0.2409, 0.7679, 0.2593]}, {"w": "network", "b": [0.7738, 0.2409, 0.8499, 0.2593]}, {"w": "(which", "b": [0.1289, 0.2601, 0.1945, 0.2785]}, {"w": "will", "b": [0.2004, 0.2601, 0.2371, 0.2785]}, {"w": "get", "b": [0.243, 0.2601, 0.2719, 0.2785]}, {"w": "you", "b": [0.2778, 0.2601, 0.3132, 0.2785]}, {"w": "to", "b": [0.3191, 0.2601, 0.3375, 0.2785]}, {"w": "an", "b": [0.3434, 0.2601, 0.3657, 0.2785]}, {"w": "accuracy", "b": [0.3716, 0.2601, 0.4555, 0.2785]}, {"w": "of", "b": [0.4614, 0.2601, 0.481, 0.2785]}, {"w": "90%", "b": [0.4869, 0.2601, 0.5302, 0.2785]}, {"w": "to", "b": [0.5361, 0.2601, 0.5545, 0.2785]}, {"w": "96%)", "b": [0.5604, 0.2601, 0.6116, 0.2785]}, {"w": "and", "b": [0.6175, 0.2601, 0.6516, 0.2785]}, {"w": "fine-tuning", "b": [0.6574, 0.2601, 0.761, 0.2785]}, {"w": "a", "b": [0.767, 0.2601, 0.7788, 0.2785]}, {"w": "pretrained", "b": [0.1289, 0.2792, 0.2277, 0.2977]}, {"w": "network", "b": [0.2336, 0.2792, 0.3097, 0.2977]}, {"w": "(this", "b": [0.3156, 0.2792, 0.3576, 0.2977]}, {"w": "will", "b": [0.3635, 0.2792, 0.4002, 0.2977]}, {"w": "get", "b": [0.4061, 0.2792, 0.435, 0.2977]}, {"w": "you", "b": [0.4409, 0.2792, 0.4763, 0.2977]}, {"w": "to", "b": [0.4822, 0.2792, 0.5006, 0.2977]}, {"w": "a", "b": [0.5065, 0.2792, 0.517, 0.2977]}, {"w": "final", "b": [0.5229, 0.2792, 0.5662, 0.2977]}, {"w": "accuracy", "b": [0.5721, 0.2792, 0.656, 0.2977]}, {"w": "of", "b": [0.6619, 0.2792, 0.6815, 0.2977]}, {"w": "97%).", "b": [0.6874, 0.2792, 0.7445, 0.2977]}, {"w": "Together,", "b": [0.7504, 0.2792, 0.8389, 0.2977]}, {"w": "these", "b": [0.1289, 0.2984, 0.1774, 0.3169]}, {"w": "three", "b": [0.1833, 0.2984, 0.2305, 0.3169]}, {"w": "strategies—training", "b": [0.2364, 0.2984, 0.4227, 0.3169]}, {"w": "a", "b": [0.4286, 0.2984, 0.4391, 0.3169]}, {"w": "small", "b": [0.445, 0.2984, 0.4962, 0.3169]}, {"w": "model", "b": [0.5021, 0.2984, 0.5611, 0.3169]}, {"w": "from", "b": [0.567, 0.2984, 0.6129, 0.3169]}, {"w": "scratch,", "b": [0.6188, 0.2984, 0.6916, 0.3169]}, {"w": "doing", "b": [0.6975, 0.2984, 0.7513, 0.3169]}, {"w": "feature", "b": [0.7571, 0.2984, 0.8226, 0.3169]}, {"w": "extraction", "b": [0.1289, 0.3176, 0.2233, 0.3361]}, {"w": "using", "b": [0.2292, 0.3176, 0.2804, 0.3361]}, {"w": "a", "b": [0.2863, 0.3176, 0.2968, 0.3361]}, {"w": "pretrained", "b": [0.3027, 0.3176, 0.3984, 0.3361]}, {"w": "model,", "b": [0.4043, 0.3176, 0.4693, 0.3361]}, {"w": "and", "b": [0.4752, 0.3176, 0.5093, 0.3361]}, {"w": "fine-tuning", "b": [0.5152, 0.3176, 0.6201, 0.3361]}, {"w": "a", "b": [0.626, 0.3176, 0.6365, 0.3361]}, {"w": "pretrained", "b": [0.6424, 0.3176, 0.7381, 0.3361]}, {"w": "model—will", "b": [0.744, 0.3176, 0.8634, 0.3361]}, {"w": "constitute", "b": [0.1289, 0.3368, 0.2207, 0.3553]}, {"w": "your", "b": [0.2266, 0.3368, 0.2699, 0.3553]}, {"w": "future", "b": [0.2758, 0.3368, 0.3322, 0.3553]}, {"w": "toolbox", "b": [0.3381, 0.3368, 0.4103, 0.3553]}, {"w": "for", "b": [0.4162, 0.3368, 0.4437, 0.3553]}, {"w": "tackling", "b": [0.4496, 0.3368, 0.5257, 0.3553]}, {"w": "the", "b": [0.5315, 0.3368, 0.5604, 0.3553]}, {"w": "problem", "b": [0.5663, 0.3368, 0.645, 0.3553]}, {"w": "of", "b": [0.6509, 0.3368, 0.6706, 0.3553]}, {"w": "performing", "b": [0.6765, 0.3368, 0.7827, 0.3553]}, {"w": "image", "b": [0.7886, 0.3368, 0.8464, 0.3553]}, {"w": "classification", "b": [0.1289, 0.356, 0.2535, 0.3745]}, {"w": "with", "b": [0.2594, 0.356, 0.3014, 0.3745]}, {"w": "small", "b": [0.3073, 0.356, 0.3585, 0.3745]}, {"w": "datasets.", "b": [0.3644, 0.356, 0.445, 0.3745]}]}, {"id": "b_2", "type": "equation", "text": "5.2.1. The relevance of deep learning for small-data problems", "words": [{"w": "5.2.1.", "b": [0.1289, 0.4002, 0.182, 0.4187]}, {"w": "The", "b": [0.1879, 0.4002, 0.2273, 0.4187]}, {"w": "relevance", "b": [0.2332, 0.4002, 0.3285, 0.4187]}, {"w": "of", "b": [0.3344, 0.4002, 0.3541, 0.4187]}, {"w": "deep", "b": [0.36, 0.4002, 0.4072, 0.4187]}, {"w": "learning", "b": [0.4131, 0.4002, 0.4971, 0.4187]}, {"w": "for", "b": [0.503, 0.4002, 0.5331, 0.4187]}, {"w": "small-data", "b": [0.539, 0.4002, 0.6453, 0.4187]}, {"w": "problems", "b": [0.6512, 0.4002, 0.7452, 0.4187]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ll sometimes hear that deep learning only works when lots of data is available. This is valid in part: one fundamental characteristic of deep learning is that it can find interesting features in the training data on its own, without any need for manual feature engineering, and this can only be achieved when lots of training examples are available. This is especially true for problems where the input samples are very high-dimensional, like images.", "words": [{"w": "You’ll", "b": [0.1289, 0.4403, 0.1882, 0.4588]}, {"w": "sometimes", "b": [0.1941, 0.4403, 0.2951, 0.4588]}, {"w": "hear", "b": [0.301, 0.4403, 0.3416, 0.4588]}, {"w": "that", "b": [0.3476, 0.4403, 0.383, 0.4588]}, {"w": "deep", "b": [0.3889, 0.4403, 0.4335, 0.4588]}, {"w": "learning", "b": [0.4394, 0.4403, 0.5168, 0.4588]}, {"w": "only", "b": [0.5227, 0.4403, 0.5646, 0.4588]}, {"w": "works", "b": [0.5705, 0.4403, 0.6283, 0.4588]}, {"w": "when", "b": [0.6342, 0.4403, 0.6853, 0.4588]}, {"w": "lots", "b": [0.6912, 0.4403, 0.7253, 0.4588]}, {"w": "of", "b": [0.7312, 0.4403, 0.7509, 0.4588]}, {"w": "data", "b": [0.7568, 0.4403, 0.7962, 0.4588]}, {"w": "is", "b": [0.8021, 0.4403, 0.8178, 0.4588]}, {"w": "available.", "b": [0.1289, 0.4595, 0.22, 0.478]}, {"w": "This", "b": [0.2259, 0.4595, 0.2679, 0.478]}, {"w": "is", "b": [0.2738, 0.4595, 0.2896, 0.478]}, {"w": "valid", "b": [0.2955, 0.4595, 0.3427, 0.478]}, {"w": "in", "b": [0.3486, 0.4595, 0.367, 0.478]}, {"w": "part:", "b": [0.3729, 0.4595, 0.4162, 0.478]}, {"w": "one", "b": [0.4221, 0.4595, 0.4562, 0.478]}, {"w": "fundamental", "b": [0.4621, 0.4595, 0.5801, 0.478]}, {"w": "characteristic", "b": [0.586, 0.4595, 0.7118, 0.478]}, {"w": "of", "b": [0.7177, 0.4595, 0.7374, 0.478]}, {"w": "deep", "b": [0.7433, 0.4595, 0.7879, 0.478]}, {"w": "learning", "b": [0.7938, 0.4595, 0.8712, 0.478]}, {"w": "is", "b": [0.1289, 0.4787, 0.1446, 0.4971]}, {"w": "that", "b": [0.1505, 0.4787, 0.186, 0.4971]}, {"w": "it", "b": [0.1919, 0.4787, 0.205, 0.4971]}, {"w": "can", "b": [0.2109, 0.4787, 0.2437, 0.4971]}, {"w": "find", "b": [0.2496, 0.4787, 0.2876, 0.4971]}, {"w": "interesting", "b": [0.2935, 0.4787, 0.3932, 0.4971]}, {"w": "features", "b": [0.3991, 0.4787, 0.4739, 0.4971]}, {"w": "in", "b": [0.4798, 0.4787, 0.4981, 0.4971]}, {"w": "the", "b": [0.504, 0.4787, 0.5329, 0.4971]}, {"w": "training", "b": [0.5388, 0.4787, 0.6123, 0.4971]}, {"w": "data", "b": [0.6182, 0.4787, 0.6575, 0.4971]}, {"w": "on", "b": [0.6634, 0.4787, 0.687, 0.4971]}, {"w": "its", "b": [0.6929, 0.4787, 0.7153, 0.4971]}, {"w": "own,", "b": [0.7212, 0.4787, 0.7677, 0.4971]}, {"w": "without", "b": [0.7736, 0.4787, 0.8458, 0.4971]}, {"w": "any", "b": [0.1289, 0.4979, 0.163, 0.5163]}, {"w": "need", "b": [0.1689, 0.4979, 0.2135, 0.5163]}, {"w": "for", "b": [0.2193, 0.4979, 0.2469, 0.5163]}, {"w": "manual", "b": [0.2528, 0.4979, 0.3223, 0.5163]}, {"w": "feature", "b": [0.3282, 0.4979, 0.3938, 0.5163]}, {"w": "engineering,", "b": [0.3997, 0.4979, 0.5171, 0.5163]}, {"w": "and", "b": [0.523, 0.4979, 0.5571, 0.5163]}, {"w": "this", "b": [0.563, 0.4979, 0.5971, 0.5163]}, {"w": "can", "b": [0.603, 0.4979, 0.6358, 0.5163]}, {"w": "only", "b": [0.6417, 0.4979, 0.6837, 0.5163]}, {"w": "be", "b": [0.6896, 0.4979, 0.7119, 0.5163]}, {"w": "achieved", "b": [0.7178, 0.4979, 0.8017, 0.5163]}, {"w": "when", "b": [0.8076, 0.4979, 0.8587, 0.5163]}, {"w": "lots", "b": [0.1289, 0.517, 0.163, 0.5355]}, {"w": "of", "b": [0.1689, 0.517, 0.1886, 0.5355]}, {"w": "training", "b": [0.1945, 0.517, 0.2679, 0.5355]}, {"w": "examples", "b": [0.2738, 0.517, 0.363, 0.5355]}, {"w": "are", "b": [0.3689, 0.517, 0.3978, 0.5355]}, {"w": "available.", "b": [0.4037, 0.517, 0.4948, 0.5355]}, {"w": "This", "b": [0.5007, 0.517, 0.5427, 0.5355]}, {"w": "is", "b": [0.5486, 0.517, 0.5644, 0.5355]}, {"w": "especially", "b": [0.5703, 0.517, 0.6647, 0.5355]}, {"w": "true", "b": [0.6705, 0.517, 0.7072, 0.5355]}, {"w": "for", "b": [0.7131, 0.517, 0.7407, 0.5355]}, {"w": "problems", "b": [0.7466, 0.517, 0.8345, 0.5355]}, {"w": "where", "b": [0.1289, 0.5362, 0.1866, 0.5547]}, {"w": "the", "b": [0.1925, 0.5362, 0.2213, 0.5547]}, {"w": "input", "b": [0.2272, 0.5362, 0.2758, 0.5547]}, {"w": "samples", "b": [0.2817, 0.5362, 0.3578, 0.5547]}, {"w": "are", "b": [0.3637, 0.5362, 0.3925, 0.5547]}, {"w": "very", "b": [0.3984, 0.5362, 0.4404, 0.5547]}, {"w": "high-dimensional,", "b": [0.4463, 0.5362, 0.6175, 0.5547]}, {"w": "like", "b": [0.6234, 0.5362, 0.6588, 0.5547]}, {"w": "images.", "b": [0.6647, 0.5362, 0.7375, 0.5547]}]}, {"id": "b_4", "type": "paragraph", "text": "But what constitutes lots of samples is relative—relative to the size and depth of the network you’re trying to train, for starters. It isn’t possible to train a convnet to solve a complex problem with just a few tens of samples, but a few hundred can potentially suffice if the model is small and well regularized and the task is simple. Because convnets learn local, translation-invariant features, they’re highly data efficient on perceptual problems. Training a convnet from scratch on a very small image dataset will still yield reasonable results despite a relative lack of data, without the need for any custom feature engineering. You’ll see this in action in this section.", "words": [{"w": "But", "b": [0.1289, 0.5763, 0.163, 0.5948]}, {"w": "what", "b": [0.1689, 0.5763, 0.2148, 0.5948]}, {"w": "constitutes", "b": [0.2207, 0.5763, 0.3217, 0.5948]}, {"w": "lots", "b": [0.3276, 0.5763, 0.3618, 0.5948]}, {"w": "of", "b": [0.3677, 0.5763, 0.3873, 0.5948]}, {"w": "samples", "b": [0.3932, 0.5763, 0.4693, 0.5948]}, {"w": "is", "b": [0.4752, 0.5763, 0.491, 0.5948]}, {"w": "relative—relative", "b": [0.4969, 0.5763, 0.6621, 0.5948]}, {"w": "to", "b": [0.668, 0.5763, 0.6864, 0.5948]}, {"w": "the", "b": [0.6923, 0.5763, 0.7212, 0.5948]}, {"w": "size", "b": [0.7271, 0.5763, 0.7638, 0.5948]}, {"w": "and", "b": [0.7697, 0.5763, 0.8038, 0.5948]}, {"w": "depth", "b": [0.8097, 0.5763, 0.8622, 0.5948]}, {"w": "of", "b": [0.1289, 0.5955, 0.1485, 0.614]}, {"w": "the", "b": [0.1545, 0.5955, 0.1833, 0.614]}, {"w": "network", "b": [0.1892, 0.5955, 0.2666, 0.614]}, {"w": "you’re", "b": [0.2725, 0.5955, 0.3341, 0.614]}, {"w": "trying", "b": [0.34, 0.5955, 0.3965, 0.614]}, {"w": "to", "b": [0.4024, 0.5955, 0.4207, 0.614]}, {"w": "train,", "b": [0.4266, 0.5955, 0.4758, 0.614]}, {"w": "for", "b": [0.4817, 0.5955, 0.5093, 0.614]}, {"w": "starters.", "b": [0.5151, 0.5955, 0.5892, 0.614]}, {"w": "It", "b": [0.5951, 0.5955, 0.6096, 0.614]}, {"w": "isn’t", "b": [0.6155, 0.5955, 0.657, 0.614]}, {"w": "possible", "b": [0.6629, 0.5955, 0.7403, 0.614]}, {"w": "to", "b": [0.7462, 0.5955, 0.7646, 0.614]}, {"w": "train", "b": [0.7705, 0.5955, 0.8138, 0.614]}, {"w": "a", "b": [0.8197, 0.5955, 0.8302, 0.614]}, {"w": "convnet", "b": [0.1289, 0.6147, 0.2036, 0.6332]}, {"w": "to", "b": [0.2095, 0.6147, 0.2279, 0.6332]}, {"w": "solve", "b": [0.2338, 0.6147, 0.2837, 0.6332]}, {"w": "a", "b": [0.2896, 0.6147, 0.3001, 0.6332]}, {"w": "complex", "b": [0.306, 0.6147, 0.3873, 0.6332]}, {"w": "problem", "b": [0.3932, 0.6147, 0.4719, 0.6332]}, {"w": "with", "b": [0.4778, 0.6147, 0.5198, 0.6332]}, {"w": "just", "b": [0.5257, 0.6147, 0.5598, 0.6332]}, {"w": "a", "b": [0.5657, 0.6147, 0.5762, 0.6332]}, {"w": "few", "b": [0.5821, 0.6147, 0.6175, 0.6332]}, {"w": "tens", "b": [0.6234, 0.6147, 0.6615, 0.6332]}, {"w": "of", "b": [0.6674, 0.6147, 0.687, 0.6332]}, {"w": "samples,", "b": [0.6929, 0.6147, 0.7749, 0.6332]}, {"w": "but", "b": [0.7808, 0.6147, 0.811, 0.6332]}, {"w": "a", "b": [0.8169, 0.6147, 0.8274, 0.6332]}, {"w": "few", "b": [0.8333, 0.6147, 0.8687, 0.6332]}, {"w": "hundred", "b": [0.1289, 0.6339, 0.2063, 0.6523]}, {"w": "can", "b": [0.2122, 0.6339, 0.2449, 0.6523]}, {"w": "potentially", "b": [0.2508, 0.6339, 0.3519, 0.6523]}, {"w": "suffice", "b": [0.3578, 0.6339, 0.4216, 0.6523]}, {"w": "if", "b": [0.4275, 0.6339, 0.4419, 0.6523]}, {"w": "the", "b": [0.4478, 0.6339, 0.4767, 0.6523]}, {"w": "model", "b": [0.4826, 0.6339, 0.5416, 0.6523]}, {"w": "is", "b": [0.5475, 0.6339, 0.5633, 0.6523]}, {"w": "small", "b": [0.5692, 0.6339, 0.6203, 0.6523]}, {"w": "and", "b": [0.6262, 0.6339, 0.6603, 0.6523]}, {"w": "well", "b": [0.6662, 0.6339, 0.7069, 0.6523]}, {"w": "regularized", "b": [0.7128, 0.6339, 0.819, 0.6523]}, {"w": "and", "b": [0.8249, 0.6339, 0.859, 0.6523]}, {"w": "the", "b": [0.1289, 0.6531, 0.1577, 0.6715]}, {"w": "task", "b": [0.1636, 0.6531, 0.2017, 0.6715]}, {"w": "is", "b": [0.2076, 0.6531, 0.2233, 0.6715]}, {"w": "simple.", "b": [0.2292, 0.6531, 0.2981, 0.6715]}, {"w": "Because", "b": [0.304, 0.6531, 0.3827, 0.6715]}, {"w": "convnets", "b": [0.3886, 0.6531, 0.4726, 0.6715]}, {"w": "learn", "b": [0.4785, 0.6531, 0.5257, 0.6715]}, {"w": "local,", "b": [0.5316, 0.6531, 0.5834, 0.6715]}, {"w": "translation-invariant", "b": [0.5893, 0.6531, 0.7808, 0.6715]}, {"w": "features,", "b": [0.7866, 0.6531, 0.8672, 0.6715]}, {"w": "they’re", "b": [0.1289, 0.6722, 0.1958, 0.6907]}, {"w": "highly", "b": [0.2017, 0.6722, 0.262, 0.6907]}, {"w": "data", "b": [0.2679, 0.6722, 0.3073, 0.6907]}, {"w": "efficient", "b": [0.3132, 0.6722, 0.3914, 0.6907]}, {"w": "on", "b": [0.3973, 0.6722, 0.4209, 0.6907]}, {"w": "perceptual", "b": [0.4268, 0.6722, 0.5252, 0.6907]}, {"w": "problems.", "b": [0.5311, 0.6722, 0.6249, 0.6907]}, {"w": "Training", "b": [0.6308, 0.6722, 0.7112, 0.6907]}, {"w": "a", "b": [0.7171, 0.6722, 0.7276, 0.6907]}, {"w": "convnet", "b": [0.7335, 0.6722, 0.8083, 0.6907]}, {"w": "from", "b": [0.8142, 0.6722, 0.8601, 0.6907]}, {"w": "scratch", "b": [0.1289, 0.6914, 0.1958, 0.7099]}, {"w": "on", "b": [0.2017, 0.6914, 0.2253, 0.7099]}, {"w": "a", "b": [0.2312, 0.6914, 0.2417, 0.7099]}, {"w": "very", "b": [0.2476, 0.6914, 0.2895, 0.7099]}, {"w": "small", "b": [0.2954, 0.6914, 0.3466, 0.7099]}, {"w": "image", "b": [0.3525, 0.6914, 0.4102, 0.7099]}, {"w": "dataset", "b": [0.4161, 0.6914, 0.4817, 0.7099]}, {"w": "will", "b": [0.4875, 0.6914, 0.5243, 0.7099]}, {"w": "still", "b": [0.5302, 0.6914, 0.5656, 0.7099]}, {"w": "yield", "b": [0.5715, 0.6914, 0.6188, 0.7099]}, {"w": "reasonable", "b": [0.6247, 0.6914, 0.7257, 0.7099]}, {"w": "results", "b": [0.7316, 0.6914, 0.7932, 0.7099]}, {"w": "despite", "b": [0.7991, 0.6914, 0.866, 0.7099]}, {"w": "a", "b": [0.1289, 0.7106, 0.1394, 0.7291]}, {"w": "relative", "b": [0.1453, 0.7106, 0.2161, 0.7291]}, {"w": "lack", "b": [0.222, 0.7106, 0.2613, 0.7291]}, {"w": "of", "b": [0.2672, 0.7106, 0.2869, 0.7291]}, {"w": "data,", "b": [0.2928, 0.7106, 0.3381, 0.7291]}, {"w": "without", "b": [0.344, 0.7106, 0.4161, 0.7291]}, {"w": "the", "b": [0.422, 0.7106, 0.4509, 0.7291]}, {"w": "need", "b": [0.4568, 0.7106, 0.5014, 0.7291]}, {"w": "for", "b": [0.5073, 0.7106, 0.5348, 0.7291]}, {"w": "any", "b": [0.5407, 0.7106, 0.5748, 0.7291]}, {"w": "custom", "b": [0.5807, 0.7106, 0.6489, 0.7291]}, {"w": "feature", "b": [0.6548, 0.7106, 0.7204, 0.7291]}, {"w": "engineering.", "b": [0.7263, 0.7106, 0.8437, 0.7291]}, {"w": "You’ll", "b": [0.1289, 0.7298, 0.1882, 0.7483]}, {"w": "see", "b": [0.1941, 0.7298, 0.2242, 0.7483]}, {"w": "this", "b": [0.2301, 0.7298, 0.2643, 0.7483]}, {"w": "in", "b": [0.2702, 0.7298, 0.2885, 0.7483]}, {"w": "action", "b": [0.2944, 0.7298, 0.3522, 0.7483]}, {"w": "in", "b": [0.3581, 0.7298, 0.3764, 0.7483]}, {"w": "this", "b": [0.3823, 0.7298, 0.4165, 0.7483]}, {"w": "section.", "b": [0.4224, 0.7298, 0.4952, 0.7483]}]}, {"id": "b_5", "type": "paragraph", "text": "What’s more, deep-learning models are by nature highly repurposable: you can take, say, an image-classification or speech-to-text model trained on a large-scale dataset and reuse it on a significantly different problem with only minor changes. Specifically, in the case of computer vision, many pretrained models (usually trained on the Image-Net dataset) are now publicly available for download and can be used to bootstrap powerful vision models out of very", "words": [{"w": "What’s", "b": [0.1289, 0.7699, 0.1958, 0.7883]}, {"w": "more,", "b": [0.2017, 0.7699, 0.2561, 0.7883]}, {"w": "deep-learning", "b": [0.262, 0.7699, 0.3918, 0.7883]}, {"w": "models", "b": [0.3977, 0.7699, 0.466, 0.7883]}, {"w": "are", "b": [0.4719, 0.7699, 0.5007, 0.7883]}, {"w": "by", "b": [0.5066, 0.7699, 0.5302, 0.7883]}, {"w": "nature", "b": [0.5361, 0.7699, 0.5951, 0.7883]}, {"w": "highly", "b": [0.601, 0.7699, 0.6614, 0.7883]}, {"w": "repurposable:", "b": [0.6673, 0.7699, 0.7958, 0.7883]}, {"w": "you", "b": [0.8017, 0.7699, 0.8372, 0.7883]}, {"w": "can", "b": [0.1289, 0.7891, 0.1617, 0.8075]}, {"w": "take,", "b": [0.1676, 0.7891, 0.2128, 0.8075]}, {"w": "say,", "b": [0.2187, 0.7891, 0.2545, 0.8075]}, {"w": "an", "b": [0.2604, 0.7891, 0.2827, 0.8075]}, {"w": "image-classification", "b": [0.2886, 0.7891, 0.4788, 0.8075]}, {"w": "or", "b": [0.4847, 0.7891, 0.5044, 0.8075]}, {"w": "speech-to-text", "b": [0.5103, 0.7891, 0.6441, 0.8075]}, {"w": "model", "b": [0.6499, 0.7891, 0.709, 0.8075]}, {"w": "trained", "b": [0.7149, 0.7891, 0.7804, 0.8075]}, {"w": "on", "b": [0.7863, 0.7891, 0.81, 0.8075]}, {"w": "a", "b": [0.8159, 0.7891, 0.8263, 0.8075]}, {"w": "large-scale", "b": [0.1289, 0.8083, 0.2307, 0.8267]}, {"w": "dataset", "b": [0.2366, 0.8083, 0.3022, 0.8267]}, {"w": "and", "b": [0.3081, 0.8083, 0.3422, 0.8267]}, {"w": "reuse", "b": [0.3481, 0.8083, 0.3979, 0.8267]}, {"w": "it", "b": [0.4038, 0.8083, 0.417, 0.8267]}, {"w": "on", "b": [0.4229, 0.8083, 0.4465, 0.8267]}, {"w": "a", "b": [0.4524, 0.8083, 0.4629, 0.8267]}, {"w": "significantly", "b": [0.4688, 0.8083, 0.5869, 0.8267]}, {"w": "different", "b": [0.5928, 0.8083, 0.6736, 0.8267]}, {"w": "problem", "b": [0.6795, 0.8083, 0.7582, 0.8267]}, {"w": "with", "b": [0.7641, 0.8083, 0.8061, 0.8267]}, {"w": "only", "b": [0.812, 0.8083, 0.854, 0.8267]}, {"w": "minor", "b": [0.1289, 0.8274, 0.1853, 0.8459]}, {"w": "changes.", "b": [0.1912, 0.8274, 0.2732, 0.8459]}, {"w": "Specifically,", "b": [0.2791, 0.8274, 0.3962, 0.8459]}, {"w": "in", "b": [0.4021, 0.8274, 0.4205, 0.8459]}, {"w": "the", "b": [0.4264, 0.8274, 0.4552, 0.8459]}, {"w": "case", "b": [0.4611, 0.8274, 0.5018, 0.8459]}, {"w": "of", "b": [0.5077, 0.8274, 0.5274, 0.8459]}, {"w": "computer", "b": [0.5333, 0.8274, 0.6225, 0.8459]}, {"w": "vision,", "b": [0.6284, 0.8274, 0.692, 0.8459]}, {"w": "many", "b": [0.6979, 0.8274, 0.7504, 0.8459]}, {"w": "pretrained", "b": [0.7563, 0.8274, 0.852, 0.8459]}, {"w": "models", "b": [0.1289, 0.8466, 0.1971, 0.8651]}, {"w": "(usually", "b": [0.203, 0.8466, 0.2791, 0.8651]}, {"w": "trained", "b": [0.285, 0.8466, 0.3506, 0.8651]}, {"w": "on", "b": [0.3565, 0.8466, 0.3801, 0.8651]}, {"w": "the", "b": [0.386, 0.8466, 0.4149, 0.8651]}, {"w": "Image-Net", "b": [0.4208, 0.8466, 0.5217, 0.8651]}, {"w": "dataset)", "b": [0.5276, 0.8466, 0.6011, 0.8651]}, {"w": "are", "b": [0.607, 0.8466, 0.6358, 0.8651]}, {"w": "now", "b": [0.6417, 0.8466, 0.6824, 0.8651]}, {"w": "publicly", "b": [0.6883, 0.8466, 0.7657, 0.8651]}, {"w": "available", "b": [0.7716, 0.8466, 0.8568, 0.8651]}, {"w": "for", "b": [0.1289, 0.8658, 0.1564, 0.8843]}, {"w": "download", "b": [0.1623, 0.8658, 0.2555, 0.8843]}, {"w": "and", "b": [0.2614, 0.8658, 0.2955, 0.8843]}, {"w": "can", "b": [0.3014, 0.8658, 0.3341, 0.8843]}, {"w": "be", "b": [0.34, 0.8658, 0.3623, 0.8843]}, {"w": "used", "b": [0.3682, 0.8658, 0.4115, 0.8843]}, {"w": "to", "b": [0.4174, 0.8658, 0.4358, 0.8843]}, {"w": "bootstrap", "b": [0.4417, 0.8658, 0.5296, 0.8843]}, {"w": "powerful", "b": [0.5355, 0.8658, 0.6207, 0.8843]}, {"w": "vision", "b": [0.6267, 0.8658, 0.6844, 0.8843]}, {"w": "models", "b": [0.6903, 0.8658, 0.7585, 0.8843]}, {"w": "out", "b": [0.7644, 0.8658, 0.7946, 0.8843]}, {"w": "of", "b": [0.8005, 0.8658, 0.8202, 0.8843]}, {"w": "very", "b": [0.8261, 0.8658, 0.868, 0.8843]}]}]}, {"page": 183, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "little data. That’s what you’ll do in the next section. Let’s start by getting your hands on the data.", "words": [{"w": "little", "b": [0.1289, 0.0857, 0.1722, 0.1041]}, {"w": "data.", "b": [0.1781, 0.0857, 0.2233, 0.1041]}, {"w": "That’s", "b": [0.2292, 0.0857, 0.2882, 0.1041]}, {"w": "what", "b": [0.2941, 0.0857, 0.34, 0.1041]}, {"w": "you’ll", "b": [0.3459, 0.0857, 0.4024, 0.1041]}, {"w": "do", "b": [0.4083, 0.0857, 0.4319, 0.1041]}, {"w": "in", "b": [0.4378, 0.0857, 0.4562, 0.1041]}, {"w": "the", "b": [0.4621, 0.0857, 0.4909, 0.1041]}, {"w": "next", "b": [0.4968, 0.0857, 0.5375, 0.1041]}, {"w": "section.", "b": [0.5434, 0.0857, 0.6162, 0.1041]}, {"w": "Let’s", "b": [0.6221, 0.0857, 0.6693, 0.1041]}, {"w": "start", "b": [0.6752, 0.0857, 0.7158, 0.1041]}, {"w": "by", "b": [0.7217, 0.0857, 0.7453, 0.1041]}, {"w": "getting", "b": [0.7513, 0.0857, 0.8169, 0.1041]}, {"w": "your", "b": [0.8228, 0.0857, 0.866, 0.1041]}, {"w": "hands", "b": [0.1289, 0.1049, 0.184, 0.1233]}, {"w": "on", "b": [0.1899, 0.1049, 0.2135, 0.1233]}, {"w": "the", "b": [0.2194, 0.1049, 0.2482, 0.1233]}, {"w": "data.", "b": [0.2542, 0.1049, 0.2994, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "5.2.2. Downloading the data", "words": [{"w": "5.2.2.", "b": [0.1289, 0.1491, 0.182, 0.1676]}, {"w": "Downloading", "b": [0.1879, 0.1491, 0.3218, 0.1676]}, {"w": "the", "b": [0.3277, 0.1491, 0.3591, 0.1676]}, {"w": "data", "b": [0.365, 0.1491, 0.4097, 0.1676]}]}, {"id": "b_2", "type": "paragraph", "text": "The Dogs vs. Cats dataset that you’ll use isn’t packaged with Keras. It was made available by Kaggle as part of a computer-vision competition in late 2013, back when convnets weren’t mainstream. You can download the original dataset from www.kaggle.com/c/dogs-vs-cats/data (you’ll need to create a Kaggle account if you don’t already have one—don’t worry, the process is painless).", "words": [{"w": "The", "b": [0.1289, 0.1891, 0.1656, 0.2076]}, {"w": "Dogs", "b": [0.1715, 0.1891, 0.2214, 0.2076]}, {"w": "vs.", "b": [0.2273, 0.1891, 0.2542, 0.2076]}, {"w": "Cats", "b": [0.2601, 0.1891, 0.302, 0.2076]}, {"w": "dataset", "b": [0.3079, 0.1891, 0.3735, 0.2076]}, {"w": "that", "b": [0.3794, 0.1891, 0.4149, 0.2076]}, {"w": "you’ll", "b": [0.4208, 0.1891, 0.4772, 0.2076]}, {"w": "use", "b": [0.4831, 0.1891, 0.5146, 0.2076]}, {"w": "isn’t", "b": [0.5205, 0.1891, 0.562, 0.2076]}, {"w": "packaged", "b": [0.5679, 0.1891, 0.6571, 0.2076]}, {"w": "with", "b": [0.663, 0.1891, 0.7049, 0.2076]}, {"w": "Keras.", "b": [0.7109, 0.1891, 0.7718, 0.2076]}, {"w": "It", "b": [0.7777, 0.1891, 0.7922, 0.2076]}, {"w": "was", "b": [0.7981, 0.1891, 0.8348, 0.2076]}, {"w": "made", "b": [0.1289, 0.2083, 0.18, 0.2268]}, {"w": "available", "b": [0.1859, 0.2083, 0.2712, 0.2268]}, {"w": "by", "b": [0.2771, 0.2083, 0.3007, 0.2268]}, {"w": "Kaggle", "b": [0.3066, 0.2083, 0.3748, 0.2268]}, {"w": "as", "b": [0.3807, 0.2083, 0.4004, 0.2268]}, {"w": "part", "b": [0.4063, 0.2083, 0.443, 0.2268]}, {"w": "of", "b": [0.4489, 0.2083, 0.4686, 0.2268]}, {"w": "a", "b": [0.4745, 0.2083, 0.485, 0.2268]}, {"w": "computer-vision", "b": [0.4909, 0.2083, 0.6451, 0.2268]}, {"w": "competition", "b": [0.651, 0.2083, 0.7638, 0.2268]}, {"w": "in", "b": [0.7697, 0.2083, 0.7881, 0.2268]}, {"w": "late", "b": [0.794, 0.2083, 0.8281, 0.2268]}, {"w": "2013,", "b": [0.1289, 0.2275, 0.182, 0.246]}, {"w": "back", "b": [0.1879, 0.2275, 0.2325, 0.246]}, {"w": "when", "b": [0.2384, 0.2275, 0.2896, 0.246]}, {"w": "convnets", "b": [0.2955, 0.2275, 0.3794, 0.246]}, {"w": "weren’t", "b": [0.3853, 0.2275, 0.457, 0.246]}, {"w": "mainstream.", "b": [0.4629, 0.2275, 0.579, 0.246]}, {"w": "You", "b": [0.5849, 0.2275, 0.6232, 0.246]}, {"w": "can", "b": [0.6291, 0.2275, 0.6618, 0.246]}, {"w": "download", "b": [0.6677, 0.2275, 0.7609, 0.246]}, {"w": "the", "b": [0.7668, 0.2275, 0.7956, 0.246]}, {"w": "original", "b": [0.1289, 0.2467, 0.2023, 0.2652]}, {"w": "dataset", "b": [0.2082, 0.2467, 0.2738, 0.2652]}, {"w": "from", "b": [0.2797, 0.2467, 0.3256, 0.2652]}, {"w": "www.kaggle.com/c/dogs-vs-cats/data", "b": [0.3315, 0.2467, 0.6841, 0.2652]}, {"w": "(you’ll", "b": [0.69, 0.2467, 0.7543, 0.2652]}, {"w": "need", "b": [0.7602, 0.2467, 0.8048, 0.2652]}, {"w": "to", "b": [0.8107, 0.2467, 0.829, 0.2652]}, {"w": "create", "b": [0.1289, 0.2659, 0.1852, 0.2844]}, {"w": "a", "b": [0.1911, 0.2659, 0.2016, 0.2844]}, {"w": "Kaggle", "b": [0.2075, 0.2659, 0.2757, 0.2844]}, {"w": "account", "b": [0.2816, 0.2659, 0.3551, 0.2844]}, {"w": "if", "b": [0.361, 0.2659, 0.3754, 0.2844]}, {"w": "you", "b": [0.3813, 0.2659, 0.4167, 0.2844]}, {"w": "don’t", "b": [0.4226, 0.2659, 0.472, 0.2844]}, {"w": "already", "b": [0.4779, 0.2659, 0.5474, 0.2844]}, {"w": "have", "b": [0.5533, 0.2659, 0.5979, 0.2844]}, {"w": "one—don’t", "b": [0.6038, 0.2659, 0.7109, 0.2844]}, {"w": "worry,", "b": [0.7168, 0.2659, 0.7776, 0.2844]}, {"w": "the", "b": [0.7835, 0.2659, 0.8124, 0.2844]}, {"w": "process", "b": [0.1289, 0.2851, 0.1997, 0.3036]}, {"w": "is", "b": [0.2056, 0.2851, 0.2214, 0.3036]}, {"w": "painless).", "b": [0.2273, 0.2851, 0.3171, 0.3036]}]}, {"id": "b_3", "type": "equation", "text": "The pictures are medium-resolution color JPEGs. Figure 5.8 shows some examples.", "words": [{"w": "The", "b": [0.1289, 0.3251, 0.1656, 0.3436]}, {"w": "pictures", "b": [0.1715, 0.3251, 0.2463, 0.3436]}, {"w": "are", "b": [0.2522, 0.3251, 0.281, 0.3436]}, {"w": "medium-resolution", "b": [0.2869, 0.3251, 0.4666, 0.3436]}, {"w": "color", "b": [0.4725, 0.3251, 0.5211, 0.3436]}, {"w": "JPEGs.", "b": [0.527, 0.3251, 0.5959, 0.3436]}, {"w": "Figure", "b": [0.6017, 0.3251, 0.6634, 0.3436]}, {"w": "5.8", "b": [0.6693, 0.3251, 0.6988, 0.3436]}, {"w": "shows", "b": [0.7047, 0.3251, 0.7637, 0.3436]}, {"w": "some", "b": [0.7696, 0.3251, 0.8195, 0.3436]}, {"w": "examples.", "b": [0.1289, 0.3443, 0.224, 0.3628]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 5.8. Samples from the Dogs vs. Cats dataset. Sizes weren’t modified: the samples are heterogeneous in size, appearance, and so on.", "words": [{"w": "Figure", "b": [0.1289, 0.3798, 0.1787, 0.3936]}, {"w": "5.8.", "b": [0.1832, 0.3798, 0.2097, 0.3936]}, {"w": "Samples", "b": [0.2141, 0.3798, 0.2771, 0.3936]}, {"w": "from", "b": [0.2815, 0.3798, 0.3186, 0.3936]}, {"w": "the", "b": [0.323, 0.3798, 0.3466, 0.3936]}, {"w": "Dogs", "b": [0.3511, 0.3798, 0.3884, 0.3936]}, {"w": "vs.", "b": [0.3929, 0.3798, 0.413, 0.3936]}, {"w": "Cats", "b": [0.4175, 0.3798, 0.4519, 0.3936]}, {"w": "dataset.", "b": [0.4563, 0.3798, 0.5149, 0.3936]}, {"w": "Sizes", "b": [0.5193, 0.3798, 0.5567, 0.3936]}, {"w": "weren’t", "b": [0.5611, 0.3798, 0.6188, 0.3936]}, {"w": "modified:", "b": [0.6232, 0.3798, 0.6961, 0.3936]}, {"w": "the", "b": [0.7005, 0.3798, 0.7241, 0.3936]}, {"w": "samples", "b": [0.7285, 0.3798, 0.7885, 0.3936]}, {"w": "are", "b": [0.793, 0.3798, 0.8172, 0.3936]}, {"w": "heterogeneous", "b": [0.1289, 0.3939, 0.2368, 0.4078]}, {"w": "in", "b": [0.2412, 0.3939, 0.256, 0.4078]}, {"w": "size,", "b": [0.2604, 0.3939, 0.2924, 0.4078]}, {"w": "appearance,", "b": [0.2968, 0.3939, 0.3888, 0.4078]}, {"w": "and", "b": [0.3932, 0.3939, 0.4218, 0.4078]}, {"w": "so", "b": [0.4262, 0.3939, 0.4419, 0.4078]}, {"w": "on.", "b": [0.4463, 0.3939, 0.4695, 0.4078]}]}, {"id": "b_5", "type": "paragraph", "text": "Unsurprisingly, the dogs-versus-cats Kaggle competition in 2013 was won by entrants who used convnets. The best entries achieved up to 95% accuracy. In this example, you’ll get fairly close to this accuracy (in the next section), even though you’ll train your models on less than 10% of the data that was available to the competitors.", "words": [{"w": "Unsurprisingly,", "b": [0.1289, 0.7173, 0.2749, 0.7358]}, {"w": "the", "b": [0.2808, 0.7173, 0.3097, 0.7358]}, {"w": "dogs-versus-cats", "b": [0.3156, 0.7173, 0.473, 0.7358]}, {"w": "Kaggle", "b": [0.4789, 0.7173, 0.5471, 0.7358]}, {"w": "competition", "b": [0.553, 0.7173, 0.6658, 0.7358]}, {"w": "in", "b": [0.6717, 0.7173, 0.6901, 0.7358]}, {"w": "2013", "b": [0.696, 0.7173, 0.7432, 0.7358]}, {"w": "was", "b": [0.7491, 0.7173, 0.7859, 0.7358]}, {"w": "won", "b": [0.7918, 0.7173, 0.8324, 0.7358]}, {"w": "by", "b": [0.8383, 0.7173, 0.862, 0.7358]}, {"w": "entrants", "b": [0.1289, 0.7365, 0.2036, 0.755]}, {"w": "who", "b": [0.2095, 0.7365, 0.2502, 0.755]}, {"w": "used", "b": [0.2561, 0.7365, 0.2994, 0.755]}, {"w": "convnets.", "b": [0.3053, 0.7365, 0.3952, 0.755]}, {"w": "The", "b": [0.4011, 0.7365, 0.4378, 0.755]}, {"w": "best", "b": [0.4437, 0.7365, 0.4817, 0.755]}, {"w": "entries", "b": [0.4876, 0.7365, 0.5506, 0.755]}, {"w": "achieved", "b": [0.5565, 0.7365, 0.6404, 0.755]}, {"w": "up", "b": [0.6463, 0.7365, 0.6699, 0.755]}, {"w": "to", "b": [0.6758, 0.7365, 0.6942, 0.755]}, {"w": "95%", "b": [0.7001, 0.7365, 0.7433, 0.755]}, {"w": "accuracy.", "b": [0.7492, 0.7365, 0.8375, 0.755]}, {"w": "In", "b": [0.8434, 0.7365, 0.8631, 0.755]}, {"w": "this", "b": [0.1289, 0.7557, 0.163, 0.7742]}, {"w": "example,", "b": [0.1689, 0.7557, 0.2548, 0.7742]}, {"w": "you’ll", "b": [0.2607, 0.7557, 0.3171, 0.7742]}, {"w": "get", "b": [0.323, 0.7557, 0.3519, 0.7742]}, {"w": "fairly", "b": [0.3578, 0.7557, 0.4089, 0.7742]}, {"w": "close", "b": [0.4149, 0.7557, 0.4634, 0.7742]}, {"w": "to", "b": [0.4693, 0.7557, 0.4877, 0.7742]}, {"w": "this", "b": [0.4936, 0.7557, 0.5277, 0.7742]}, {"w": "accuracy", "b": [0.5336, 0.7557, 0.6175, 0.7742]}, {"w": "(in", "b": [0.6234, 0.7557, 0.6496, 0.7742]}, {"w": "the", "b": [0.6555, 0.7557, 0.6844, 0.7742]}, {"w": "next", "b": [0.6903, 0.7557, 0.731, 0.7742]}, {"w": "section),", "b": [0.7369, 0.7557, 0.8175, 0.7742]}, {"w": "even", "b": [0.8234, 0.7557, 0.868, 0.7742]}, {"w": "though", "b": [0.1289, 0.7749, 0.1945, 0.7934]}, {"w": "you’ll", "b": [0.2004, 0.7749, 0.2568, 0.7934]}, {"w": "train", "b": [0.2627, 0.7749, 0.306, 0.7934]}, {"w": "your", "b": [0.3119, 0.7749, 0.3551, 0.7934]}, {"w": "models", "b": [0.361, 0.7749, 0.4293, 0.7934]}, {"w": "on", "b": [0.4352, 0.7749, 0.4588, 0.7934]}, {"w": "less", "b": [0.4647, 0.7749, 0.5001, 0.7934]}, {"w": "than", "b": [0.506, 0.7749, 0.5467, 0.7934]}, {"w": "10%", "b": [0.5526, 0.7749, 0.5959, 0.7934]}, {"w": "of", "b": [0.6018, 0.7749, 0.6214, 0.7934]}, {"w": "the", "b": [0.6273, 0.7749, 0.6562, 0.7934]}, {"w": "data", "b": [0.6621, 0.7749, 0.7014, 0.7934]}, {"w": "that", "b": [0.7074, 0.7749, 0.7428, 0.7934]}, {"w": "was", "b": [0.7487, 0.7749, 0.7854, 0.7934]}, {"w": "available", "b": [0.1289, 0.7941, 0.2141, 0.8125]}, {"w": "to", "b": [0.22, 0.7941, 0.2384, 0.8125]}, {"w": "the", "b": [0.2443, 0.7941, 0.2732, 0.8125]}, {"w": "competitors.", "b": [0.2791, 0.7941, 0.3965, 0.8125]}]}, {"id": "b_6", "type": "paragraph", "text": "This dataset contains 25,000 images of dogs and cats (12,500 from each class) and is 543 MB (compressed). After downloading and uncompressing it, you’ll create a new dataset containing three subsets: a training set with 1,000", "words": [{"w": "This", "b": [0.1289, 0.8341, 0.1709, 0.8526]}, {"w": "dataset", "b": [0.1768, 0.8341, 0.2423, 0.8526]}, {"w": "contains", "b": [0.2482, 0.8341, 0.327, 0.8526]}, {"w": "25,000", "b": [0.3329, 0.8341, 0.3978, 0.8526]}, {"w": "images", "b": [0.4037, 0.8341, 0.4706, 0.8526]}, {"w": "of", "b": [0.4765, 0.8341, 0.4962, 0.8526]}, {"w": "dogs", "b": [0.5021, 0.8341, 0.5467, 0.8526]}, {"w": "and", "b": [0.5526, 0.8341, 0.5867, 0.8526]}, {"w": "cats", "b": [0.5926, 0.8341, 0.6293, 0.8526]}, {"w": "(12,500", "b": [0.6352, 0.8341, 0.708, 0.8526]}, {"w": "from", "b": [0.7139, 0.8341, 0.7598, 0.8526]}, {"w": "each", "b": [0.7657, 0.8341, 0.809, 0.8526]}, {"w": "class)", "b": [0.8149, 0.8341, 0.8687, 0.8526]}, {"w": "and", "b": [0.1289, 0.8533, 0.163, 0.8718]}, {"w": "is", "b": [0.1689, 0.8533, 0.1846, 0.8718]}, {"w": "543", "b": [0.1905, 0.8533, 0.226, 0.8718]}, {"w": "MB", "b": [0.2319, 0.8533, 0.2686, 0.8718]}, {"w": "(compressed).", "b": [0.2745, 0.8533, 0.4076, 0.8718]}, {"w": "After", "b": [0.4135, 0.8533, 0.4634, 0.8718]}, {"w": "downloading", "b": [0.4693, 0.8533, 0.5926, 0.8718]}, {"w": "and", "b": [0.5985, 0.8533, 0.6326, 0.8718]}, {"w": "uncompressing", "b": [0.6385, 0.8533, 0.7815, 0.8718]}, {"w": "it,", "b": [0.7874, 0.8533, 0.8064, 0.8718]}, {"w": "you’ll", "b": [0.8123, 0.8533, 0.8687, 0.8718]}, {"w": "create", "b": [0.1289, 0.8725, 0.1852, 0.891]}, {"w": "a", "b": [0.1911, 0.8725, 0.2016, 0.891]}, {"w": "new", "b": [0.2075, 0.8725, 0.2469, 0.891]}, {"w": "dataset", "b": [0.2528, 0.8725, 0.3184, 0.891]}, {"w": "containing", "b": [0.3243, 0.8725, 0.424, 0.891]}, {"w": "three", "b": [0.4299, 0.8725, 0.4771, 0.891]}, {"w": "subsets:", "b": [0.483, 0.8725, 0.5578, 0.891]}, {"w": "a", "b": [0.5637, 0.8725, 0.5742, 0.891]}, {"w": "training", "b": [0.5801, 0.8725, 0.6535, 0.891]}, {"w": "set", "b": [0.6594, 0.8725, 0.6857, 0.891]}, {"w": "with", "b": [0.6916, 0.8725, 0.7336, 0.891]}, {"w": "1,000", "b": [0.7395, 0.8725, 0.7926, 0.891]}]}]}, {"page": 184, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "samples of each class, a validation set with 500 samples of each class, and a test set with 500 samples of each class.", "words": [{"w": "samples", "b": [0.1289, 0.0857, 0.205, 0.1041]}, {"w": "of", "b": [0.2109, 0.0857, 0.2305, 0.1041]}, {"w": "each", "b": [0.2364, 0.0857, 0.2797, 0.1041]}, {"w": "class,", "b": [0.2856, 0.0857, 0.3374, 0.1041]}, {"w": "a", "b": [0.3433, 0.0857, 0.3538, 0.1041]}, {"w": "validation", "b": [0.3597, 0.0857, 0.4541, 0.1041]}, {"w": "set", "b": [0.46, 0.0857, 0.4863, 0.1041]}, {"w": "with", "b": [0.4922, 0.0857, 0.5342, 0.1041]}, {"w": "500", "b": [0.5401, 0.0857, 0.5755, 0.1041]}, {"w": "samples", "b": [0.5814, 0.0857, 0.6575, 0.1041]}, {"w": "of", "b": [0.6634, 0.0857, 0.6831, 0.1041]}, {"w": "each", "b": [0.689, 0.0857, 0.7322, 0.1041]}, {"w": "class,", "b": [0.7381, 0.0857, 0.7899, 0.1041]}, {"w": "and", "b": [0.7958, 0.0857, 0.8299, 0.1041]}, {"w": "a", "b": [0.8358, 0.0857, 0.8463, 0.1041]}, {"w": "test", "b": [0.1289, 0.1049, 0.1617, 0.1233]}, {"w": "set", "b": [0.1676, 0.1049, 0.1938, 0.1233]}, {"w": "with", "b": [0.1997, 0.1049, 0.2417, 0.1233]}, {"w": "500", "b": [0.2476, 0.1049, 0.283, 0.1233]}, {"w": "samples", "b": [0.2889, 0.1049, 0.365, 0.1233]}, {"w": "of", "b": [0.3709, 0.1049, 0.3906, 0.1233]}, {"w": "each", "b": [0.3965, 0.1049, 0.4398, 0.1233]}, {"w": "class.", "b": [0.4457, 0.1049, 0.4975, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "Following is the code to do this.", "words": [{"w": "Following", "b": [0.1289, 0.1449, 0.226, 0.1634]}, {"w": "is", "b": [0.2319, 0.1449, 0.2476, 0.1634]}, {"w": "the", "b": [0.2535, 0.1449, 0.2824, 0.1634]}, {"w": "code", "b": [0.2883, 0.1449, 0.3329, 0.1634]}, {"w": "to", "b": [0.3388, 0.1449, 0.3572, 0.1634]}, {"w": "do", "b": [0.3631, 0.1449, 0.3867, 0.1634]}, {"w": "this.", "b": [0.3926, 0.1449, 0.4326, 0.1634]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.4. Copying images to training, validation, and test directories", "words": [{"w": "Listing", "b": [0.1289, 0.1845, 0.182, 0.1984]}, {"w": "5.4.", "b": [0.1865, 0.1845, 0.213, 0.1984]}, {"w": "Copying", "b": [0.2174, 0.1845, 0.2814, 0.1984]}, {"w": "images", "b": [0.2858, 0.1845, 0.338, 0.1984]}, {"w": "to", "b": [0.3424, 0.1845, 0.3572, 0.1984]}, {"w": "training,", "b": [0.3616, 0.1845, 0.427, 0.1984]}, {"w": "validation,", "b": [0.4315, 0.1845, 0.5117, 0.1984]}, {"w": "and", "b": [0.5161, 0.1845, 0.5446, 0.1984]}, {"w": "test", "b": [0.5491, 0.1845, 0.5756, 0.1984]}, {"w": "directories", "b": [0.58, 0.1845, 0.6604, 0.1984]}]}, {"id": "b_3", "type": "paragraph", "text": "import os, shutil original_dataset_dir = '/Users/fchollet/Downloads/kaggle_original_data' 1 base_dir = '/Users/fchollet/Downloads/cats_and_dogs_small' 2 os.mkdir(base_dir) train_dir = os.path.join(base_dir, 'train') 3 os.mkdir(train_dir) validation_dir = os.path.join(base_dir, 'validation') 3 os.mkdir(validation_dir) test_dir = os.path.join(base_dir, 'test') 3 os.mkdir(test_dir) train_cats_dir = os.path.join(train_dir, 'cats') 4 os.mkdir(train_cats_dir) 4 train_dogs_dir = os.path.join(train_dir, 'dogs') 5 os.mkdir(train_dogs_dir) 5 validation_cats_dir = os.path.join(validation_dir, 'cats') 6 os.mkdir(validation_cats_dir) 6 validation_dogs_dir = os.path.join(validation_dir, 'dogs') 7 os.mkdir(validation_dogs_dir) 7 test_cats_dir = os.path.join(test_dir, 'cats') 8 os.mkdir(test_cats_dir) 8 test_dogs_dir = os.path.join(test_dir, 'dogs') 9 os.mkdir(test_dogs_dir) 9", "words": [{"w": "import", "b": [0.1348, 0.2111, 0.1985, 0.2253]}, {"w": "os,", "b": [0.2092, 0.2111, 0.241, 0.2253]}, {"w": "shutil", "b": [0.2517, 0.2111, 0.3154, 0.2253]}, {"w": "original_dataset_dir", "b": [0.1348, 0.2395, 0.3473, 0.2537]}, {"w": "=", "b": [0.3579, 0.2395, 0.3686, 0.2537]}, {"w": "'/Users/fchollet/Downloads/kaggle_original_data'", "b": [0.1348, 0.2537, 0.6449, 0.2678]}, {"w": "1", "b": [0.6874, 0.2537, 0.6981, 0.2678]}, {"w": "base_dir", "b": [0.1348, 0.282, 0.2198, 0.2962]}, {"w": "=", "b": [0.2304, 0.282, 0.241, 0.2962]}, {"w": "'/Users/fchollet/Downloads/cats_and_dogs_small'", "b": [0.2517, 0.282, 0.7511, 0.2962]}, {"w": "2", "b": [0.1348, 0.2962, 0.1454, 0.3104]}, {"w": "os.mkdir(base_dir)", "b": [0.1348, 0.3104, 0.3261, 0.3246]}, {"w": "train_dir", "b": [0.1348, 0.3388, 0.2304, 0.3529]}, {"w": "=", "b": [0.241, 0.3388, 0.2517, 0.3529]}, {"w": "os.path.join(base_dir,", "b": [0.2623, 0.3388, 0.4961, 0.3529]}, {"w": "'train')", "b": [0.5067, 0.3388, 0.5917, 0.3529]}, {"w": "3", "b": [0.1348, 0.353, 0.1454, 0.3671]}, {"w": "os.mkdir(train_dir)", "b": [0.1348, 0.3671, 0.3367, 0.3813]}, {"w": "validation_dir", "b": [0.1348, 0.3813, 0.2836, 0.3955]}, {"w": "=", "b": [0.2942, 0.3813, 0.3048, 0.3955]}, {"w": "os.path.join(base_dir,", "b": [0.3154, 0.3813, 0.5492, 0.3955]}, {"w": "'validation')", "b": [0.5598, 0.3813, 0.698, 0.3955]}, {"w": "3", "b": [0.1348, 0.3955, 0.1454, 0.4097]}, {"w": "os.mkdir(validation_dir)", "b": [0.1348, 0.4097, 0.3898, 0.4239]}, {"w": "test_dir", "b": [0.1348, 0.4239, 0.2198, 0.4381]}, {"w": "=", "b": [0.2304, 0.4239, 0.241, 0.4381]}, {"w": "os.path.join(base_dir,", "b": [0.2517, 0.4239, 0.4855, 0.4381]}, {"w": "'test')", "b": [0.4961, 0.4239, 0.5705, 0.4381]}, {"w": "3", "b": [0.1348, 0.4381, 0.1454, 0.4522]}, {"w": "os.mkdir(test_dir)", "b": [0.1348, 0.4522, 0.3261, 0.4664]}, {"w": "train_cats_dir", "b": [0.1348, 0.4806, 0.2836, 0.4948]}, {"w": "=", "b": [0.2942, 0.4806, 0.3048, 0.4948]}, {"w": "os.path.join(train_dir,", "b": [0.3154, 0.4806, 0.5598, 0.4948]}, {"w": "'cats')", "b": [0.5705, 0.4806, 0.6449, 0.4948]}, {"w": "4", "b": [0.1348, 0.4948, 0.1454, 0.509]}, {"w": "os.mkdir(train_cats_dir)", "b": [0.1348, 0.509, 0.3898, 0.5232]}, {"w": "4", "b": [0.1348, 0.5232, 0.1454, 0.5373]}, {"w": "train_dogs_dir", "b": [0.1348, 0.5515, 0.2836, 0.5657]}, {"w": "=", "b": [0.2942, 0.5515, 0.3048, 0.5657]}, {"w": "os.path.join(train_dir,", "b": [0.3154, 0.5515, 0.5598, 0.5657]}, {"w": "'dogs')", "b": [0.5705, 0.5515, 0.6449, 0.5657]}, {"w": "5", "b": [0.1348, 0.5657, 0.1454, 0.5799]}, {"w": "os.mkdir(train_dogs_dir)", "b": [0.1348, 0.5799, 0.3898, 0.5941]}, {"w": "5", "b": [0.1348, 0.5941, 0.1454, 0.6083]}, {"w": "validation_cats_dir", "b": [0.1348, 0.6225, 0.3367, 0.6366]}, {"w": "=", "b": [0.3473, 0.6225, 0.3579, 0.6366]}, {"w": "os.path.join(validation_dir,", "b": [0.3686, 0.6225, 0.6661, 0.6366]}, {"w": "'cats')", "b": [0.6767, 0.6225, 0.7511, 0.6366]}, {"w": "6", "b": [0.1348, 0.6366, 0.1454, 0.6508]}, {"w": "os.mkdir(validation_cats_dir)", "b": [0.1348, 0.6508, 0.443, 0.665]}, {"w": "6", "b": [0.1348, 0.665, 0.1454, 0.6792]}, {"w": "validation_dogs_dir", "b": [0.1348, 0.6934, 0.3367, 0.7076]}, {"w": "=", "b": [0.3473, 0.6934, 0.3579, 0.7076]}, {"w": "os.path.join(validation_dir,", "b": [0.3686, 0.6934, 0.6661, 0.7076]}, {"w": "'dogs')", "b": [0.6767, 0.6934, 0.7511, 0.7076]}, {"w": "7", "b": [0.1348, 0.7076, 0.1454, 0.7217]}, {"w": "os.mkdir(validation_dogs_dir)", "b": [0.1348, 0.7218, 0.443, 0.7359]}, {"w": "7", "b": [0.1348, 0.7359, 0.1454, 0.7501]}, {"w": "test_cats_dir", "b": [0.1348, 0.7643, 0.2729, 0.7785]}, {"w": "=", "b": [0.2836, 0.7643, 0.2942, 0.7785]}, {"w": "os.path.join(test_dir,", "b": [0.3048, 0.7643, 0.5386, 0.7785]}, {"w": "'cats')", "b": [0.5492, 0.7643, 0.6236, 0.7785]}, {"w": "8", "b": [0.1348, 0.7785, 0.1454, 0.7927]}, {"w": "os.mkdir(test_cats_dir)", "b": [0.1348, 0.7927, 0.3792, 0.8069]}, {"w": "8", "b": [0.1348, 0.8069, 0.1454, 0.821]}, {"w": "test_dogs_dir", "b": [0.1348, 0.8352, 0.2729, 0.8494]}, {"w": "=", "b": [0.2836, 0.8352, 0.2942, 0.8494]}, {"w": "os.path.join(test_dir,", "b": [0.3048, 0.8352, 0.5386, 0.8494]}, {"w": "'dogs')", "b": [0.5492, 0.8352, 0.6236, 0.8494]}, {"w": "9", "b": [0.1348, 0.8494, 0.1454, 0.8636]}, {"w": "os.mkdir(test_dogs_dir)", "b": [0.1348, 0.8636, 0.3792, 0.8778]}, {"w": "9", "b": [0.1348, 0.8778, 0.1454, 0.892]}]}]}, {"page": 185, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "fnames = ['cat.{}.jpg'.format(i) for i in range(1000)] 10 for fname in fnames: 10 src = os.path.join(original_dataset_dir, fname) 10 dst = os.path.join(train_cats_dir, fname) 10 shutil.copyfile(src, dst) 10 fnames = ['cat.{}.jpg'.format(i) for i in range(1000, 1500)] 11 for fname in fnames: 11 src = os.path.join(original_dataset_dir, fname) 11 dst = os.path.join(validation_cats_dir, fname) 11 shutil.copyfile(src, dst) 11 fnames = ['cat.{}.jpg'.format(i) for i in range(1500, 2000)] 12 for fname in fnames: 12 src = os.path.join(original_dataset_dir, fname) 12 dst = os.path.join(test_cats_dir, fname) 12 shutil.copyfile(src, dst) 12 fnames = ['dog.{}.jpg'.format(i) for i in range(1000)] 13 for fname in fnames: 13 src = os.path.join(original_dataset_dir, fname) 13 dst = os.path.join(train_dogs_dir, fname) 13 shutil.copyfile(src, dst) 13 fnames = ['dog.{}.jpg'.format(i) for i in range(1000, 1500)] 14 for fname in fnames: 14 src = os.path.join(original_dataset_dir, fname) 14 dst = os.path.join(validation_dogs_dir, fname) 14 shutil.copyfile(src, dst) 14 fnames = ['dog.{}.jpg'.format(i) for i in range(1500, 2000)] 15 for fname in fnames: 15", "words": [{"w": "fnames", "b": [0.1348, 0.0851, 0.1985, 0.0993]}, {"w": "=", "b": [0.2092, 0.0851, 0.2198, 0.0993]}, {"w": "['cat.{}.jpg'.format(i)", "b": [0.2304, 0.0851, 0.4748, 0.0993]}, {"w": "for", "b": [0.4855, 0.0851, 0.5173, 0.0993]}, {"w": "i", "b": [0.528, 0.0851, 0.5386, 0.0993]}, {"w": "in", "b": [0.5492, 0.0851, 0.5705, 0.0993]}, {"w": "range(1000)]", "b": [0.5811, 0.0851, 0.7086, 0.0993]}, {"w": "10", "b": [0.1348, 0.0993, 0.156, 0.1135]}, {"w": "for", "b": [0.1348, 0.1135, 0.1667, 0.1277]}, {"w": "fname", "b": [0.1773, 0.1135, 0.2304, 0.1277]}, {"w": "in", "b": [0.241, 0.1135, 0.2623, 0.1277]}, {"w": "fnames:", "b": [0.2729, 0.1135, 0.3473, 0.1277]}, {"w": "10", "b": [0.1348, 0.1277, 0.156, 0.1418]}, {"w": "src", "b": [0.1773, 0.1419, 0.2092, 0.156]}, {"w": "=", "b": [0.2198, 0.1419, 0.2304, 0.156]}, {"w": "os.path.join(original_dataset_dir,", "b": [0.241, 0.1419, 0.6024, 0.156]}, {"w": "fname)", "b": [0.613, 0.1419, 0.6767, 0.156]}, {"w": "10", "b": [0.1348, 0.156, 0.156, 0.1702]}, {"w": "dst", "b": [0.1773, 0.1702, 0.2092, 0.1844]}, {"w": "=", "b": [0.2198, 0.1702, 0.2304, 0.1844]}, {"w": "os.path.join(train_cats_dir,", "b": [0.241, 0.1702, 0.5386, 0.1844]}, {"w": "fname)", "b": [0.5492, 0.1702, 0.613, 0.1844]}, {"w": "10", "b": [0.1348, 0.1844, 0.156, 0.1986]}, {"w": "shutil.copyfile(src,", "b": [0.1773, 0.1986, 0.3898, 0.2128]}, {"w": "dst)", "b": [0.4004, 0.1986, 0.443, 0.2128]}, {"w": "10", "b": [0.1348, 0.2128, 0.156, 0.227]}, {"w": "fnames", "b": [0.1348, 0.2411, 0.1985, 0.2553]}, {"w": "=", "b": [0.2092, 0.2411, 0.2198, 0.2553]}, {"w": "['cat.{}.jpg'.format(i)", "b": [0.2304, 0.2411, 0.4748, 0.2553]}, {"w": "for", "b": [0.4855, 0.2411, 0.5173, 0.2553]}, {"w": "i", "b": [0.528, 0.2411, 0.5386, 0.2553]}, {"w": "in", "b": [0.5492, 0.2411, 0.5705, 0.2553]}, {"w": "range(1000,", "b": [0.5811, 0.2411, 0.698, 0.2553]}, {"w": "1500)]", "b": [0.7086, 0.2411, 0.7724, 0.2553]}, {"w": "11", "b": [0.1348, 0.2553, 0.156, 0.2695]}, {"w": "for", "b": [0.1348, 0.2695, 0.1667, 0.2837]}, {"w": "fname", "b": [0.1773, 0.2695, 0.2304, 0.2837]}, {"w": "in", "b": [0.241, 0.2695, 0.2623, 0.2837]}, {"w": "fnames:", "b": [0.2729, 0.2695, 0.3473, 0.2837]}, {"w": "11", "b": [0.1348, 0.2837, 0.156, 0.2979]}, {"w": "src", "b": [0.1773, 0.2979, 0.2092, 0.3121]}, {"w": "=", "b": [0.2198, 0.2979, 0.2304, 0.3121]}, {"w": "os.path.join(original_dataset_dir,", "b": [0.241, 0.2979, 0.6024, 0.3121]}, {"w": "fname)", "b": [0.613, 0.2979, 0.6767, 0.3121]}, {"w": "11", "b": [0.1348, 0.3121, 0.156, 0.3262]}, {"w": "dst", "b": [0.1773, 0.3263, 0.2092, 0.3404]}, {"w": "=", "b": [0.2198, 0.3263, 0.2304, 0.3404]}, {"w": "os.path.join(validation_cats_dir,", "b": [0.241, 0.3263, 0.5917, 0.3404]}, {"w": "fname)", "b": [0.6024, 0.3263, 0.6661, 0.3404]}, {"w": "11", "b": [0.1348, 0.3404, 0.156, 0.3546]}, {"w": "shutil.copyfile(src,", "b": [0.1773, 0.3546, 0.3898, 0.3688]}, {"w": "dst)", "b": [0.4004, 0.3546, 0.443, 0.3688]}, {"w": "11", "b": [0.1348, 0.3688, 0.156, 0.383]}, {"w": "fnames", "b": [0.1348, 0.3972, 0.1985, 0.4114]}, {"w": "=", "b": [0.2092, 0.3972, 0.2198, 0.4114]}, {"w": "['cat.{}.jpg'.format(i)", "b": [0.2304, 0.3972, 0.4748, 0.4114]}, {"w": "for", "b": [0.4855, 0.3972, 0.5173, 0.4114]}, {"w": "i", "b": [0.528, 0.3972, 0.5386, 0.4114]}, {"w": "in", "b": [0.5492, 0.3972, 0.5705, 0.4114]}, {"w": "range(1500,", "b": [0.5811, 0.3972, 0.698, 0.4114]}, {"w": "2000)]", "b": [0.7086, 0.3972, 0.7724, 0.4114]}, {"w": "12", "b": [0.1348, 0.4114, 0.156, 0.4255]}, {"w": "for", "b": [0.1348, 0.4255, 0.1667, 0.4397]}, {"w": "fname", "b": [0.1773, 0.4255, 0.2304, 0.4397]}, {"w": "in", "b": [0.241, 0.4255, 0.2623, 0.4397]}, {"w": "fnames:", "b": [0.2729, 0.4255, 0.3473, 0.4397]}, {"w": "12", "b": [0.1348, 0.4397, 0.156, 0.4539]}, {"w": "src", "b": [0.1773, 0.4539, 0.2092, 0.4681]}, {"w": "=", "b": [0.2198, 0.4539, 0.2304, 0.4681]}, {"w": "os.path.join(original_dataset_dir,", "b": [0.241, 0.4539, 0.6024, 0.4681]}, {"w": "fname)", "b": [0.613, 0.4539, 0.6767, 0.4681]}, {"w": "12", "b": [0.1348, 0.4681, 0.156, 0.4823]}, {"w": "dst", "b": [0.1773, 0.4823, 0.2092, 0.4965]}, {"w": "=", "b": [0.2198, 0.4823, 0.2304, 0.4965]}, {"w": "os.path.join(test_cats_dir,", "b": [0.241, 0.4823, 0.528, 0.4965]}, {"w": "fname)", "b": [0.5386, 0.4823, 0.6024, 0.4965]}, {"w": "12", "b": [0.1348, 0.4965, 0.156, 0.5106]}, {"w": "shutil.copyfile(src,", "b": [0.1773, 0.5107, 0.3898, 0.5248]}, {"w": "dst)", "b": [0.4004, 0.5107, 0.443, 0.5248]}, {"w": "12", "b": [0.1348, 0.5248, 0.156, 0.539]}, {"w": "fnames", "b": [0.1348, 0.5532, 0.1985, 0.5674]}, {"w": "=", "b": [0.2092, 0.5532, 0.2198, 0.5674]}, {"w": "['dog.{}.jpg'.format(i)", "b": [0.2304, 0.5532, 0.4748, 0.5674]}, {"w": "for", "b": [0.4855, 0.5532, 0.5173, 0.5674]}, {"w": "i", "b": [0.528, 0.5532, 0.5386, 0.5674]}, {"w": "in", "b": [0.5492, 0.5532, 0.5705, 0.5674]}, {"w": "range(1000)]", "b": [0.5811, 0.5532, 0.7086, 0.5674]}, {"w": "13", "b": [0.1348, 0.5674, 0.156, 0.5816]}, {"w": "for", "b": [0.1348, 0.5816, 0.1667, 0.5958]}, {"w": "fname", "b": [0.1773, 0.5816, 0.2304, 0.5958]}, {"w": "in", "b": [0.241, 0.5816, 0.2623, 0.5958]}, {"w": "fnames:", "b": [0.2729, 0.5816, 0.3473, 0.5958]}, {"w": "13", "b": [0.1348, 0.5958, 0.156, 0.6099]}, {"w": "src", "b": [0.1773, 0.6099, 0.2092, 0.6241]}, {"w": "=", "b": [0.2198, 0.6099, 0.2304, 0.6241]}, {"w": "os.path.join(original_dataset_dir,", "b": [0.241, 0.6099, 0.6024, 0.6241]}, {"w": "fname)", "b": [0.613, 0.6099, 0.6767, 0.6241]}, {"w": "13", "b": [0.1348, 0.6241, 0.156, 0.6383]}, {"w": "dst", "b": [0.1773, 0.6383, 0.2092, 0.6525]}, {"w": "=", "b": [0.2198, 0.6383, 0.2304, 0.6525]}, {"w": "os.path.join(train_dogs_dir,", "b": [0.241, 0.6383, 0.5386, 0.6525]}, {"w": "fname)", "b": [0.5492, 0.6383, 0.613, 0.6525]}, {"w": "13", "b": [0.1348, 0.6525, 0.156, 0.6667]}, {"w": "shutil.copyfile(src,", "b": [0.1773, 0.6667, 0.3898, 0.6809]}, {"w": "dst)", "b": [0.4004, 0.6667, 0.443, 0.6809]}, {"w": "13", "b": [0.1348, 0.6809, 0.156, 0.695]}, {"w": "fnames", "b": [0.1348, 0.6951, 0.1985, 0.7092]}, {"w": "=", "b": [0.2092, 0.6951, 0.2198, 0.7092]}, {"w": "['dog.{}.jpg'.format(i)", "b": [0.2304, 0.6951, 0.4748, 0.7092]}, {"w": "for", "b": [0.4855, 0.6951, 0.5173, 0.7092]}, {"w": "i", "b": [0.528, 0.6951, 0.5386, 0.7092]}, {"w": "in", "b": [0.5492, 0.6951, 0.5705, 0.7092]}, {"w": "range(1000,", "b": [0.5811, 0.6951, 0.698, 0.7092]}, {"w": "1500)]", "b": [0.7086, 0.6951, 0.7724, 0.7092]}, {"w": "14", "b": [0.1348, 0.7092, 0.156, 0.7234]}, {"w": "for", "b": [0.1348, 0.7234, 0.1667, 0.7376]}, {"w": "fname", "b": [0.1773, 0.7234, 0.2304, 0.7376]}, {"w": "in", "b": [0.241, 0.7234, 0.2623, 0.7376]}, {"w": "fnames:", "b": [0.2729, 0.7234, 0.3473, 0.7376]}, {"w": "14", "b": [0.1348, 0.7376, 0.156, 0.7518]}, {"w": "src", "b": [0.1773, 0.7518, 0.2092, 0.766]}, {"w": "=", "b": [0.2198, 0.7518, 0.2304, 0.766]}, {"w": "os.path.join(original_dataset_dir,", "b": [0.241, 0.7518, 0.6024, 0.766]}, {"w": "fname)", "b": [0.613, 0.7518, 0.6767, 0.766]}, {"w": "14", "b": [0.1348, 0.766, 0.156, 0.7802]}, {"w": "dst", "b": [0.1773, 0.7802, 0.2092, 0.7943]}, {"w": "=", "b": [0.2198, 0.7802, 0.2304, 0.7943]}, {"w": "os.path.join(validation_dogs_dir,", "b": [0.241, 0.7802, 0.5917, 0.7943]}, {"w": "fname)", "b": [0.6024, 0.7802, 0.6661, 0.7943]}, {"w": "14", "b": [0.1348, 0.7943, 0.156, 0.8085]}, {"w": "shutil.copyfile(src,", "b": [0.1773, 0.8085, 0.3898, 0.8227]}, {"w": "dst)", "b": [0.4004, 0.8085, 0.443, 0.8227]}, {"w": "14", "b": [0.1348, 0.8227, 0.156, 0.8369]}, {"w": "fnames", "b": [0.1348, 0.8511, 0.1985, 0.8653]}, {"w": "=", "b": [0.2092, 0.8511, 0.2198, 0.8653]}, {"w": "['dog.{}.jpg'.format(i)", "b": [0.2304, 0.8511, 0.4748, 0.8653]}, {"w": "for", "b": [0.4855, 0.8511, 0.5173, 0.8653]}, {"w": "i", "b": [0.528, 0.8511, 0.5386, 0.8653]}, {"w": "in", "b": [0.5492, 0.8511, 0.5705, 0.8653]}, {"w": "range(1500,", "b": [0.5811, 0.8511, 0.698, 0.8653]}, {"w": "2000)]", "b": [0.7086, 0.8511, 0.7724, 0.8653]}, {"w": "15", "b": [0.1348, 0.8653, 0.156, 0.8794]}, {"w": "for", "b": [0.1348, 0.8795, 0.1667, 0.8936]}, {"w": "fname", "b": [0.1773, 0.8795, 0.2304, 0.8936]}, {"w": "in", "b": [0.241, 0.8795, 0.2623, 0.8936]}, {"w": "fnames:", "b": [0.2729, 0.8795, 0.3473, 0.8936]}, {"w": "15", "b": [0.1348, 0.8936, 0.156, 0.9078]}]}]}, {"page": 186, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "src = os.path.join(original_dataset_dir, fname) 15 dst = os.path.join(test_dogs_dir, fname) 15 shutil.copyfile(src, dst) 15", "words": [{"w": "src", "b": [0.1773, 0.0851, 0.2092, 0.0993]}, {"w": "=", "b": [0.2198, 0.0851, 0.2304, 0.0993]}, {"w": "os.path.join(original_dataset_dir,", "b": [0.241, 0.0851, 0.6024, 0.0993]}, {"w": "fname)", "b": [0.613, 0.0851, 0.6767, 0.0993]}, {"w": "15", "b": [0.1348, 0.0993, 0.156, 0.1135]}, {"w": "dst", "b": [0.1773, 0.1135, 0.2092, 0.1277]}, {"w": "=", "b": [0.2198, 0.1135, 0.2304, 0.1277]}, {"w": "os.path.join(test_dogs_dir,", "b": [0.241, 0.1135, 0.528, 0.1277]}, {"w": "fname)", "b": [0.5386, 0.1135, 0.6024, 0.1277]}, {"w": "15", "b": [0.1348, 0.1277, 0.156, 0.1418]}, {"w": "shutil.copyfile(src,", "b": [0.1773, 0.1419, 0.3898, 0.156]}, {"w": "dst)", "b": [0.4004, 0.1419, 0.443, 0.156]}, {"w": "15", "b": [0.1348, 0.156, 0.156, 0.1702]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Path to the directory where the original dataset was uncompressed 2 Directory where you’ll store your smaller dataset 3 Directories for the training, validation, and test splits 4 Directory with training cat pictures 5 Directory with training dog pictures 6 Directory with validation cat pictures 7 Directory with validation dog pictures 8 Directory with test cat pictures 9 Directory with test dog pictures 10 Copies the first 1,000 cat images to train_cats_dir 11 Copies the next 500 cat images to validation_cats_dir 12 Copies the next 500 cat images to test_cats_dir 13 Copies the first 1,000 dog images to train_dogs_dir 14 Copies the next 500 dog images to validation_dogs_dir 15 Copies the next 500 dog images to test_dogs_dir", "words": [{"w": "1", "b": [0.1761, 0.1875, 0.1879, 0.2059]}, {"w": "Path", "b": [0.1938, 0.1875, 0.241, 0.2059]}, {"w": "to", "b": [0.2469, 0.1875, 0.2666, 0.2059]}, {"w": "the", "b": [0.2725, 0.1875, 0.304, 0.2059]}, {"w": "directory", "b": [0.3099, 0.1875, 0.4026, 0.2059]}, {"w": "where", "b": [0.4085, 0.1875, 0.4697, 0.2059]}, {"w": "the", "b": [0.4756, 0.1875, 0.5071, 0.2059]}, {"w": "original", "b": [0.513, 0.1875, 0.5917, 0.2059]}, {"w": "dataset", "b": [0.5976, 0.1875, 0.6698, 0.2059]}, {"w": "was", "b": [0.6757, 0.1875, 0.7137, 0.2059]}, {"w": "uncompressed", "b": [0.7196, 0.1875, 0.8635, 0.2059]}, {"w": "2", "b": [0.1761, 0.2067, 0.1879, 0.2251]}, {"w": "Directory", "b": [0.1938, 0.2067, 0.2904, 0.2251]}, {"w": "where", "b": [0.2963, 0.2067, 0.3575, 0.2251]}, {"w": "you’ll", "b": [0.3634, 0.2067, 0.4212, 0.2251]}, {"w": "store", "b": [0.4271, 0.2067, 0.4765, 0.2251]}, {"w": "your", "b": [0.4824, 0.2067, 0.5296, 0.2251]}, {"w": "smaller", "b": [0.5355, 0.2067, 0.6103, 0.2251]}, {"w": "dataset", "b": [0.6162, 0.2067, 0.6883, 0.2251]}, {"w": "3", "b": [0.1761, 0.2258, 0.1879, 0.2443]}, {"w": "Directories", "b": [0.1938, 0.2258, 0.3048, 0.2443]}, {"w": "for", "b": [0.3108, 0.2258, 0.3409, 0.2443]}, {"w": "the", "b": [0.3468, 0.2258, 0.3783, 0.2443]}, {"w": "training,", "b": [0.3842, 0.2258, 0.4715, 0.2443]}, {"w": "validation,", "b": [0.4774, 0.2258, 0.5843, 0.2443]}, {"w": "and", "b": [0.5902, 0.2258, 0.6283, 0.2443]}, {"w": "test", "b": [0.6342, 0.2258, 0.6696, 0.2443]}, {"w": "splits", "b": [0.6755, 0.2258, 0.728, 0.2443]}, {"w": "4", "b": [0.1761, 0.245, 0.1879, 0.2635]}, {"w": "Directory", "b": [0.1938, 0.245, 0.2904, 0.2635]}, {"w": "with", "b": [0.2963, 0.245, 0.3409, 0.2635]}, {"w": "training", "b": [0.3468, 0.245, 0.4282, 0.2635]}, {"w": "cat", "b": [0.4341, 0.245, 0.4642, 0.2635]}, {"w": "pictures", "b": [0.4702, 0.245, 0.551, 0.2635]}, {"w": "5", "b": [0.1761, 0.2642, 0.1879, 0.2827]}, {"w": "Directory", "b": [0.1938, 0.2642, 0.2904, 0.2827]}, {"w": "with", "b": [0.2963, 0.2642, 0.3409, 0.2827]}, {"w": "training", "b": [0.3468, 0.2642, 0.4282, 0.2827]}, {"w": "dog", "b": [0.4341, 0.2642, 0.4708, 0.2827]}, {"w": "pictures", "b": [0.4767, 0.2642, 0.5576, 0.2827]}, {"w": "6", "b": [0.1761, 0.2834, 0.1879, 0.3019]}, {"w": "Directory", "b": [0.1938, 0.2834, 0.2904, 0.3019]}, {"w": "with", "b": [0.2963, 0.2834, 0.3409, 0.3019]}, {"w": "validation", "b": [0.3468, 0.2834, 0.4479, 0.3019]}, {"w": "cat", "b": [0.4538, 0.2834, 0.4839, 0.3019]}, {"w": "pictures", "b": [0.4898, 0.2834, 0.5707, 0.3019]}, {"w": "7", "b": [0.1761, 0.3026, 0.1879, 0.3211]}, {"w": "Directory", "b": [0.1938, 0.3026, 0.2904, 0.3211]}, {"w": "with", "b": [0.2963, 0.3026, 0.3409, 0.3211]}, {"w": "validation", "b": [0.3468, 0.3026, 0.4479, 0.3211]}, {"w": "dog", "b": [0.4538, 0.3026, 0.4905, 0.3211]}, {"w": "pictures", "b": [0.4964, 0.3026, 0.5773, 0.3211]}, {"w": "8", "b": [0.1761, 0.3218, 0.1879, 0.3403]}, {"w": "Directory", "b": [0.1938, 0.3218, 0.2904, 0.3403]}, {"w": "with", "b": [0.2963, 0.3218, 0.3409, 0.3403]}, {"w": "test", "b": [0.3468, 0.3218, 0.3822, 0.3403]}, {"w": "cat", "b": [0.3881, 0.3218, 0.4183, 0.3403]}, {"w": "pictures", "b": [0.4242, 0.3218, 0.5051, 0.3403]}, {"w": "9", "b": [0.1761, 0.341, 0.1879, 0.3595]}, {"w": "Directory", "b": [0.1938, 0.341, 0.2904, 0.3595]}, {"w": "with", "b": [0.2963, 0.341, 0.3409, 0.3595]}, {"w": "test", "b": [0.3468, 0.341, 0.3822, 0.3595]}, {"w": "dog", "b": [0.3881, 0.341, 0.4249, 0.3595]}, {"w": "pictures", "b": [0.4308, 0.341, 0.5117, 0.3595]}, {"w": "10", "b": [0.1761, 0.3602, 0.1997, 0.3787]}, {"w": "Copies", "b": [0.2056, 0.3602, 0.2738, 0.3787]}, {"w": "the", "b": [0.2798, 0.3602, 0.3112, 0.3787]}, {"w": "first", "b": [0.3171, 0.3602, 0.3591, 0.3787]}, {"w": "1,000", "b": [0.365, 0.3602, 0.4181, 0.3787]}, {"w": "cat", "b": [0.424, 0.3602, 0.4542, 0.3787]}, {"w": "images", "b": [0.4601, 0.3602, 0.5296, 0.3787]}, {"w": "to", "b": [0.5355, 0.3602, 0.5552, 0.3787]}, {"w": "train_cats_dir", "b": [0.5611, 0.3602, 0.7041, 0.3787]}, {"w": "11", "b": [0.1761, 0.3794, 0.1984, 0.3979]}, {"w": "Copies", "b": [0.2043, 0.3794, 0.2725, 0.3979]}, {"w": "the", "b": [0.2784, 0.3794, 0.3099, 0.3979]}, {"w": "next", "b": [0.3158, 0.3794, 0.3591, 0.3979]}, {"w": "500", "b": [0.365, 0.3794, 0.4004, 0.3979]}, {"w": "cat", "b": [0.4063, 0.3794, 0.4365, 0.3979]}, {"w": "images", "b": [0.4424, 0.3794, 0.5119, 0.3979]}, {"w": "to", "b": [0.5178, 0.3794, 0.5375, 0.3979]}, {"w": "validation_cats_dir", "b": [0.5434, 0.3794, 0.7376, 0.3979]}, {"w": "12", "b": [0.1761, 0.3986, 0.1997, 0.417]}, {"w": "Copies", "b": [0.2056, 0.3986, 0.2738, 0.417]}, {"w": "the", "b": [0.2798, 0.3986, 0.3112, 0.417]}, {"w": "next", "b": [0.3171, 0.3986, 0.3604, 0.417]}, {"w": "500", "b": [0.3663, 0.3986, 0.4017, 0.417]}, {"w": "cat", "b": [0.4076, 0.3986, 0.4378, 0.417]}, {"w": "images", "b": [0.4437, 0.3986, 0.5132, 0.417]}, {"w": "to", "b": [0.5191, 0.3986, 0.5388, 0.417]}, {"w": "test_cats_dir", "b": [0.5447, 0.3986, 0.6732, 0.417]}, {"w": "13", "b": [0.1761, 0.4178, 0.1997, 0.4362]}, {"w": "Copies", "b": [0.2056, 0.4178, 0.2738, 0.4362]}, {"w": "the", "b": [0.2798, 0.4178, 0.3112, 0.4362]}, {"w": "first", "b": [0.3171, 0.4178, 0.3591, 0.4362]}, {"w": "1,000", "b": [0.365, 0.4178, 0.4181, 0.4362]}, {"w": "dog", "b": [0.424, 0.4178, 0.4608, 0.4362]}, {"w": "images", "b": [0.4667, 0.4178, 0.5362, 0.4362]}, {"w": "to", "b": [0.5421, 0.4178, 0.5618, 0.4362]}, {"w": "train_dogs_dir", "b": [0.5677, 0.4178, 0.7173, 0.4362]}, {"w": "14", "b": [0.1761, 0.4369, 0.1997, 0.4554]}, {"w": "Copies", "b": [0.2056, 0.4369, 0.2738, 0.4554]}, {"w": "the", "b": [0.2798, 0.4369, 0.3112, 0.4554]}, {"w": "next", "b": [0.3171, 0.4369, 0.3604, 0.4554]}, {"w": "500", "b": [0.3663, 0.4369, 0.4017, 0.4554]}, {"w": "dog", "b": [0.4076, 0.4369, 0.4444, 0.4554]}, {"w": "images", "b": [0.4503, 0.4369, 0.5198, 0.4554]}, {"w": "to", "b": [0.5257, 0.4369, 0.5454, 0.4554]}, {"w": "validation_dogs_dir", "b": [0.5513, 0.4369, 0.7521, 0.4554]}, {"w": "15", "b": [0.1761, 0.4561, 0.1997, 0.4746]}, {"w": "Copies", "b": [0.2056, 0.4561, 0.2738, 0.4746]}, {"w": "the", "b": [0.2798, 0.4561, 0.3112, 0.4746]}, {"w": "next", "b": [0.3171, 0.4561, 0.3604, 0.4746]}, {"w": "500", "b": [0.3663, 0.4561, 0.4017, 0.4746]}, {"w": "dog", "b": [0.4076, 0.4561, 0.4444, 0.4746]}, {"w": "images", "b": [0.4503, 0.4561, 0.5198, 0.4746]}, {"w": "to", "b": [0.5257, 0.4561, 0.5454, 0.4746]}, {"w": "test_dogs_dir", "b": [0.5513, 0.4561, 0.6864, 0.4746]}]}, {"id": "b_2", "type": "paragraph", "text": "As a sanity check, let’s count how many pictures are in each training split (train/validation/test):", "words": [{"w": "As", "b": [0.1289, 0.4962, 0.1551, 0.5147]}, {"w": "a", "b": [0.161, 0.4962, 0.1715, 0.5147]}, {"w": "sanity", "b": [0.1774, 0.4962, 0.2338, 0.5147]}, {"w": "check,", "b": [0.2397, 0.4962, 0.3007, 0.5147]}, {"w": "let’s", "b": [0.3066, 0.4962, 0.3459, 0.5147]}, {"w": "count", "b": [0.3518, 0.4962, 0.4043, 0.5147]}, {"w": "how", "b": [0.4102, 0.4962, 0.4509, 0.5147]}, {"w": "many", "b": [0.4568, 0.4962, 0.5093, 0.5147]}, {"w": "pictures", "b": [0.5152, 0.4962, 0.5899, 0.5147]}, {"w": "are", "b": [0.5958, 0.4962, 0.6247, 0.5147]}, {"w": "in", "b": [0.6306, 0.4962, 0.6489, 0.5147]}, {"w": "each", "b": [0.6548, 0.4962, 0.6981, 0.5147]}, {"w": "training", "b": [0.704, 0.4962, 0.7775, 0.5147]}, {"w": "split", "b": [0.7834, 0.4962, 0.8241, 0.5147]}, {"w": "(train/validation/test):", "b": [0.1289, 0.5154, 0.3348, 0.5339]}]}, {"id": "b_3", "type": "paragraph", "text": ">>> print('total training cat images:', len(os.listdir(train_cats_dir))) total training cat images: 1000 >>> print('total training dog images:', len(os.listdir(train_dogs_dir))) total training dog images: 1000 >>> print('total validation cat images:', len(os.listdir(validation_cats_dir))) total validation cat images: 500 >>> print('total validation dog images:', len(os.listdir(validation_dogs_dir))) total validation dog images: 500 >>> print('total test cat images:', len(os.listdir(test_cats_dir))) total test cat images: 500 >>> print('total test dog images:', len(os.listdir(test_dogs_dir))) total test dog images: 500", "words": [{"w": ">>>", "b": [0.1348, 0.5507, 0.1667, 0.5649]}, {"w": "print('total", "b": [0.1773, 0.5507, 0.3048, 0.5649]}, {"w": "training", "b": [0.3154, 0.5507, 0.4004, 0.5649]}, {"w": "cat", "b": [0.4111, 0.5507, 0.443, 0.5649]}, {"w": "images:',", "b": [0.4536, 0.5507, 0.5492, 0.5649]}, {"w": "len(os.listdir(train_cats_dir)))", "b": [0.1348, 0.5649, 0.4748, 0.5791]}, {"w": "total", "b": [0.1348, 0.5791, 0.1879, 0.5932]}, {"w": "training", "b": [0.1985, 0.5791, 0.2836, 0.5932]}, {"w": "cat", "b": [0.2942, 0.5791, 0.3261, 0.5932]}, {"w": "images:", "b": [0.3367, 0.5791, 0.4111, 0.5932]}, {"w": "1000", "b": [0.4217, 0.5791, 0.4642, 0.5932]}, {"w": ">>>", "b": [0.1348, 0.5933, 0.1667, 0.6074]}, {"w": "print('total", "b": [0.1773, 0.5933, 0.3048, 0.6074]}, {"w": "training", "b": [0.3154, 0.5933, 0.4004, 0.6074]}, {"w": "dog", "b": [0.4111, 0.5933, 0.443, 0.6074]}, {"w": "images:',", "b": [0.4536, 0.5933, 0.5492, 0.6074]}, {"w": "len(os.listdir(train_dogs_dir)))", "b": [0.1348, 0.6074, 0.4748, 0.6216]}, {"w": "total", "b": [0.1348, 0.6216, 0.1879, 0.6358]}, {"w": "training", "b": [0.1985, 0.6216, 0.2836, 0.6358]}, {"w": "dog", "b": [0.2942, 0.6216, 0.3261, 0.6358]}, {"w": "images:", "b": [0.3367, 0.6216, 0.4111, 0.6358]}, {"w": "1000", "b": [0.4217, 0.6216, 0.4642, 0.6358]}, {"w": ">>>", "b": [0.1348, 0.6358, 0.1667, 0.65]}, {"w": "print('total", "b": [0.1773, 0.6358, 0.3048, 0.65]}, {"w": "validation", "b": [0.3154, 0.6358, 0.4217, 0.65]}, {"w": "cat", "b": [0.4323, 0.6358, 0.4642, 0.65]}, {"w": "images:',", "b": [0.4748, 0.6358, 0.5705, 0.65]}, {"w": "len(os.listdir(validation_cats_dir)))", "b": [0.1348, 0.65, 0.528, 0.6642]}, {"w": "total", "b": [0.1348, 0.6642, 0.1879, 0.6784]}, {"w": "validation", "b": [0.1985, 0.6642, 0.3048, 0.6784]}, {"w": "cat", "b": [0.3154, 0.6642, 0.3473, 0.6784]}, {"w": "images:", "b": [0.3579, 0.6642, 0.4323, 0.6784]}, {"w": "500", "b": [0.443, 0.6642, 0.4748, 0.6784]}, {"w": ">>>", "b": [0.1348, 0.6784, 0.1667, 0.6925]}, {"w": "print('total", "b": [0.1773, 0.6784, 0.3048, 0.6925]}, {"w": "validation", "b": [0.3154, 0.6784, 0.4217, 0.6925]}, {"w": "dog", "b": [0.4323, 0.6784, 0.4642, 0.6925]}, {"w": "images:',", "b": [0.4748, 0.6784, 0.5705, 0.6925]}, {"w": "len(os.listdir(validation_dogs_dir)))", "b": [0.1348, 0.6925, 0.528, 0.7067]}, {"w": "total", "b": [0.1348, 0.7067, 0.1879, 0.7209]}, {"w": "validation", "b": [0.1985, 0.7067, 0.3048, 0.7209]}, {"w": "dog", "b": [0.3154, 0.7067, 0.3473, 0.7209]}, {"w": "images:", "b": [0.3579, 0.7067, 0.4323, 0.7209]}, {"w": "500", "b": [0.443, 0.7067, 0.4748, 0.7209]}, {"w": ">>>", "b": [0.1348, 0.7209, 0.1667, 0.7351]}, {"w": "print('total", "b": [0.1773, 0.7209, 0.3048, 0.7351]}, {"w": "test", "b": [0.3154, 0.7209, 0.3579, 0.7351]}, {"w": "cat", "b": [0.3686, 0.7209, 0.4004, 0.7351]}, {"w": "images:',", "b": [0.4111, 0.7209, 0.5067, 0.7351]}, {"w": "len(os.listdir(test_cats_dir)))", "b": [0.5173, 0.7209, 0.8468, 0.7351]}, {"w": "total", "b": [0.1348, 0.7351, 0.1879, 0.7493]}, {"w": "test", "b": [0.1985, 0.7351, 0.241, 0.7493]}, {"w": "cat", "b": [0.2517, 0.7351, 0.2836, 0.7493]}, {"w": "images:", "b": [0.2942, 0.7351, 0.3686, 0.7493]}, {"w": "500", "b": [0.3792, 0.7351, 0.4111, 0.7493]}, {"w": ">>>", "b": [0.1348, 0.7493, 0.1667, 0.7635]}, {"w": "print('total", "b": [0.1773, 0.7493, 0.3048, 0.7635]}, {"w": "test", "b": [0.3154, 0.7493, 0.3579, 0.7635]}, {"w": "dog", "b": [0.3686, 0.7493, 0.4004, 0.7635]}, {"w": "images:',", "b": [0.4111, 0.7493, 0.5067, 0.7635]}, {"w": "len(os.listdir(test_dogs_dir)))", "b": [0.5173, 0.7493, 0.8468, 0.7635]}, {"w": "total", "b": [0.1348, 0.7635, 0.1879, 0.7777]}, {"w": "test", "b": [0.1985, 0.7635, 0.241, 0.7777]}, {"w": "dog", "b": [0.2517, 0.7635, 0.2836, 0.7777]}, {"w": "images:", "b": [0.2942, 0.7635, 0.3686, 0.7777]}, {"w": "500", "b": [0.3792, 0.7635, 0.4111, 0.7777]}]}, {"id": "b_4", "type": "paragraph", "text": "So you do indeed have 2,000 training images, 1,000 validation images, and 1,000 test images. Each split contains the same number of samples from each class: this is a balanced binary-classification problem, which means classification accuracy will be an appropriate measure of success.", "words": [{"w": "So", "b": [0.1289, 0.7991, 0.1538, 0.8176]}, {"w": "you", "b": [0.1597, 0.7991, 0.1951, 0.8176]}, {"w": "do", "b": [0.201, 0.7991, 0.2247, 0.8176]}, {"w": "indeed", "b": [0.2306, 0.7991, 0.2935, 0.8176]}, {"w": "have", "b": [0.2994, 0.7991, 0.344, 0.8176]}, {"w": "2,000", "b": [0.3499, 0.7991, 0.403, 0.8176]}, {"w": "training", "b": [0.4089, 0.7991, 0.4824, 0.8176]}, {"w": "images,", "b": [0.4883, 0.7991, 0.5611, 0.8176]}, {"w": "1,000", "b": [0.567, 0.7991, 0.6202, 0.8176]}, {"w": "validation", "b": [0.6261, 0.7991, 0.7205, 0.8176]}, {"w": "images,", "b": [0.7264, 0.7991, 0.7992, 0.8176]}, {"w": "and", "b": [0.8051, 0.7991, 0.8392, 0.8176]}, {"w": "1,000", "b": [0.1289, 0.8183, 0.182, 0.8367]}, {"w": "test", "b": [0.1879, 0.8183, 0.2207, 0.8367]}, {"w": "images.", "b": [0.2266, 0.8183, 0.2994, 0.8367]}, {"w": "Each", "b": [0.3053, 0.8183, 0.3525, 0.8367]}, {"w": "split", "b": [0.3584, 0.8183, 0.3991, 0.8367]}, {"w": "contains", "b": [0.405, 0.8183, 0.4837, 0.8367]}, {"w": "the", "b": [0.4896, 0.8183, 0.5185, 0.8367]}, {"w": "same", "b": [0.5244, 0.8183, 0.5729, 0.8367]}, {"w": "number", "b": [0.5788, 0.8183, 0.6509, 0.8367]}, {"w": "of", "b": [0.6568, 0.8183, 0.6765, 0.8367]}, {"w": "samples", "b": [0.6824, 0.8183, 0.7585, 0.8367]}, {"w": "from", "b": [0.7644, 0.8183, 0.8103, 0.8367]}, {"w": "each", "b": [0.8162, 0.8183, 0.8594, 0.8367]}, {"w": "class:", "b": [0.1289, 0.8375, 0.1813, 0.8559]}, {"w": "this", "b": [0.1873, 0.8375, 0.2214, 0.8559]}, {"w": "is", "b": [0.2273, 0.8375, 0.243, 0.8559]}, {"w": "a", "b": [0.2489, 0.8375, 0.2594, 0.8559]}, {"w": "balanced", "b": [0.2653, 0.8375, 0.3492, 0.8559]}, {"w": "binary-classification", "b": [0.3552, 0.8375, 0.548, 0.8559]}, {"w": "problem,", "b": [0.5539, 0.8375, 0.6385, 0.8559]}, {"w": "which", "b": [0.6444, 0.8375, 0.7021, 0.8559]}, {"w": "means", "b": [0.708, 0.8375, 0.7683, 0.8559]}, {"w": "classification", "b": [0.1289, 0.8566, 0.2535, 0.8751]}, {"w": "accuracy", "b": [0.2594, 0.8566, 0.3433, 0.8751]}, {"w": "will", "b": [0.3492, 0.8566, 0.3859, 0.8751]}, {"w": "be", "b": [0.3918, 0.8566, 0.4141, 0.8751]}, {"w": "an", "b": [0.42, 0.8566, 0.4423, 0.8751]}, {"w": "appropriate", "b": [0.4482, 0.8566, 0.5557, 0.8751]}, {"w": "measure", "b": [0.5616, 0.8566, 0.6403, 0.8751]}, {"w": "of", "b": [0.6462, 0.8566, 0.6659, 0.8751]}, {"w": "success.", "b": [0.6718, 0.8566, 0.7485, 0.8751]}]}]}, {"page": 187, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "5.2.3. Building your network", "words": [{"w": "5.2.3.", "b": [0.1289, 0.0857, 0.182, 0.1041]}, {"w": "Building", "b": [0.1879, 0.0857, 0.2746, 0.1041]}, {"w": "your", "b": [0.2805, 0.0857, 0.3277, 0.1041]}, {"w": "network", "b": [0.3336, 0.0857, 0.4175, 0.1041]}]}, {"id": "b_1", "type": "paragraph", "text": "You built a small convnet for MNIST in the previous example, so you should be familiar with such convnets. You’ll reuse the same general structure: the convnet will be a stack of alternated Conv2D (with relu activation) and MaxPooling2D layers.", "words": [{"w": "You", "b": [0.1289, 0.1257, 0.1672, 0.1442]}, {"w": "built", "b": [0.1731, 0.1257, 0.2164, 0.1442]}, {"w": "a", "b": [0.2223, 0.1257, 0.2328, 0.1442]}, {"w": "small", "b": [0.2387, 0.1257, 0.2899, 0.1442]}, {"w": "convnet", "b": [0.2958, 0.1257, 0.3705, 0.1442]}, {"w": "for", "b": [0.3764, 0.1257, 0.404, 0.1442]}, {"w": "MNIST", "b": [0.4099, 0.1257, 0.4833, 0.1442]}, {"w": "in", "b": [0.4892, 0.1257, 0.5076, 0.1442]}, {"w": "the", "b": [0.5135, 0.1257, 0.5424, 0.1442]}, {"w": "previous", "b": [0.5483, 0.1257, 0.6296, 0.1442]}, {"w": "example,", "b": [0.6355, 0.1257, 0.7214, 0.1442]}, {"w": "so", "b": [0.7273, 0.1257, 0.7483, 0.1442]}, {"w": "you", "b": [0.7542, 0.1257, 0.7896, 0.1442]}, {"w": "should", "b": [0.7955, 0.1257, 0.8585, 0.1442]}, {"w": "be", "b": [0.1289, 0.1449, 0.1512, 0.1634]}, {"w": "familiar", "b": [0.1571, 0.1449, 0.2318, 0.1634]}, {"w": "with", "b": [0.2377, 0.1449, 0.2797, 0.1634]}, {"w": "such", "b": [0.2856, 0.1449, 0.3289, 0.1634]}, {"w": "convnets.", "b": [0.3348, 0.1449, 0.4247, 0.1634]}, {"w": "You’ll", "b": [0.4306, 0.1449, 0.4898, 0.1634]}, {"w": "reuse", "b": [0.4957, 0.1449, 0.5456, 0.1634]}, {"w": "the", "b": [0.5515, 0.1449, 0.5803, 0.1634]}, {"w": "same", "b": [0.5862, 0.1449, 0.6347, 0.1634]}, {"w": "general", "b": [0.6406, 0.1449, 0.7101, 0.1634]}, {"w": "structure:", "b": [0.716, 0.1449, 0.8052, 0.1634]}, {"w": "the", "b": [0.8111, 0.1449, 0.84, 0.1634]}, {"w": "convnet", "b": [0.1289, 0.1641, 0.2036, 0.1826]}, {"w": "will", "b": [0.2095, 0.1641, 0.2463, 0.1826]}, {"w": "be", "b": [0.2522, 0.1641, 0.2745, 0.1826]}, {"w": "a", "b": [0.2804, 0.1641, 0.2909, 0.1826]}, {"w": "stack", "b": [0.2968, 0.1641, 0.3453, 0.1826]}, {"w": "of", "b": [0.3512, 0.1641, 0.3709, 0.1826]}, {"w": "alternated", "b": [0.3768, 0.1641, 0.4699, 0.1826]}, {"w": "Conv2D", "b": [0.4757, 0.1651, 0.5607, 0.184]}, {"w": "(with", "b": [0.5667, 0.1641, 0.6165, 0.1826]}, {"w": "relu", "b": [0.6224, 0.1651, 0.6791, 0.184]}, {"w": "activation)", "b": [0.685, 0.1641, 0.786, 0.1826]}, {"w": "and", "b": [0.7919, 0.1641, 0.826, 0.1826]}, {"w": "MaxPooling2D", "b": [0.1289, 0.1851, 0.2989, 0.204]}, {"w": "layers.", "b": [0.3048, 0.1841, 0.3671, 0.2026]}]}, {"id": "b_2", "type": "paragraph", "text": "But because you’re dealing with bigger images and a more complex problem, you’ll make your network larger, accordingly: it will have one more Conv2D + MaxPooling2D stage. This serves both to augment the capacity of the network and to further reduce the size of the feature maps so they aren’t overly large when you reach the Flatten layer. Here, because you start from inputs of size 150 × 150 (a somewhat arbitrary choice), you end up with feature maps of size 7 × 7 just before the Flatten layer.", "words": [{"w": "But", "b": [0.1289, 0.225, 0.163, 0.2435]}, {"w": "because", "b": [0.1689, 0.225, 0.2436, 0.2435]}, {"w": "you’re", "b": [0.2495, 0.225, 0.3112, 0.2435]}, {"w": "dealing", "b": [0.3171, 0.225, 0.3866, 0.2435]}, {"w": "with", "b": [0.3925, 0.225, 0.4345, 0.2435]}, {"w": "bigger", "b": [0.4404, 0.225, 0.5007, 0.2435]}, {"w": "images", "b": [0.5066, 0.225, 0.5735, 0.2435]}, {"w": "and", "b": [0.5794, 0.225, 0.6135, 0.2435]}, {"w": "a", "b": [0.6194, 0.225, 0.6299, 0.2435]}, {"w": "more", "b": [0.6358, 0.225, 0.6844, 0.2435]}, {"w": "complex", "b": [0.6903, 0.225, 0.7716, 0.2435]}, {"w": "problem,", "b": [0.7775, 0.225, 0.8621, 0.2435]}, {"w": "you’ll", "b": [0.1289, 0.2442, 0.1853, 0.2627]}, {"w": "make", "b": [0.1912, 0.2442, 0.2423, 0.2627]}, {"w": "your", "b": [0.2482, 0.2442, 0.2915, 0.2627]}, {"w": "network", "b": [0.2974, 0.2442, 0.3748, 0.2627]}, {"w": "larger,", "b": [0.3807, 0.2442, 0.4403, 0.2627]}, {"w": "accordingly:", "b": [0.4462, 0.2442, 0.5642, 0.2627]}, {"w": "it", "b": [0.5702, 0.2442, 0.5833, 0.2627]}, {"w": "will", "b": [0.5891, 0.2442, 0.6259, 0.2627]}, {"w": "have", "b": [0.6318, 0.2442, 0.6764, 0.2627]}, {"w": "one", "b": [0.6823, 0.2442, 0.7164, 0.2627]}, {"w": "more", "b": [0.7223, 0.2442, 0.7708, 0.2627]}, {"w": "Conv2D", "b": [0.7767, 0.2452, 0.8617, 0.2641]}, {"w": "+", "b": [0.1289, 0.2642, 0.1422, 0.2827]}, {"w": "MaxPooling2D", "b": [0.1481, 0.2652, 0.3181, 0.2841]}, {"w": "stage.", "b": [0.324, 0.2642, 0.3785, 0.2827]}, {"w": "This", "b": [0.3844, 0.2642, 0.4264, 0.2827]}, {"w": "serves", "b": [0.4323, 0.2642, 0.4913, 0.2827]}, {"w": "both", "b": [0.4972, 0.2642, 0.5392, 0.2827]}, {"w": "to", "b": [0.5451, 0.2642, 0.5634, 0.2827]}, {"w": "augment", "b": [0.5693, 0.2642, 0.6507, 0.2827]}, {"w": "the", "b": [0.6566, 0.2642, 0.6854, 0.2827]}, {"w": "capacity", "b": [0.6913, 0.2642, 0.77, 0.2827]}, {"w": "of", "b": [0.7759, 0.2642, 0.7956, 0.2827]}, {"w": "the", "b": [0.8015, 0.2642, 0.8304, 0.2827]}, {"w": "network", "b": [0.1289, 0.2843, 0.2063, 0.3027]}, {"w": "and", "b": [0.2122, 0.2843, 0.2463, 0.3027]}, {"w": "to", "b": [0.2522, 0.2843, 0.2705, 0.3027]}, {"w": "further", "b": [0.2764, 0.2843, 0.3407, 0.3027]}, {"w": "reduce", "b": [0.3466, 0.2843, 0.4095, 0.3027]}, {"w": "the", "b": [0.4154, 0.2843, 0.4443, 0.3027]}, {"w": "size", "b": [0.4502, 0.2843, 0.4869, 0.3027]}, {"w": "of", "b": [0.4928, 0.2843, 0.5125, 0.3027]}, {"w": "the", "b": [0.5184, 0.2843, 0.5473, 0.3027]}, {"w": "feature", "b": [0.5532, 0.2843, 0.6187, 0.3027]}, {"w": "maps", "b": [0.6246, 0.2843, 0.6745, 0.3027]}, {"w": "so", "b": [0.6804, 0.2843, 0.7014, 0.3027]}, {"w": "they", "b": [0.7073, 0.2843, 0.7479, 0.3027]}, {"w": "aren’t", "b": [0.7538, 0.2843, 0.8084, 0.3027]}, {"w": "overly", "b": [0.1289, 0.3034, 0.1892, 0.3219]}, {"w": "large", "b": [0.1951, 0.3034, 0.2419, 0.3219]}, {"w": "when", "b": [0.2478, 0.3034, 0.2989, 0.3219]}, {"w": "you", "b": [0.3048, 0.3034, 0.3403, 0.3219]}, {"w": "reach", "b": [0.3462, 0.3034, 0.3973, 0.3219]}, {"w": "the", "b": [0.4032, 0.3034, 0.432, 0.3219]}, {"w": "Flatten", "b": [0.4379, 0.3044, 0.5371, 0.3233]}, {"w": "layer.", "b": [0.543, 0.3034, 0.5948, 0.3219]}, {"w": "Here,", "b": [0.6007, 0.3034, 0.6525, 0.3219]}, {"w": "because", "b": [0.6584, 0.3034, 0.7331, 0.3219]}, {"w": "you", "b": [0.739, 0.3034, 0.7745, 0.3219]}, {"w": "start", "b": [0.7804, 0.3034, 0.821, 0.3219]}, {"w": "from", "b": [0.1289, 0.3235, 0.1748, 0.3419]}, {"w": "inputs", "b": [0.1807, 0.3235, 0.2384, 0.3419]}, {"w": "of", "b": [0.2443, 0.3235, 0.264, 0.3419]}, {"w": "size", "b": [0.2699, 0.3235, 0.3066, 0.3419]}, {"w": "150", "b": [0.3125, 0.3235, 0.348, 0.3419]}, {"w": "×", "b": [0.3539, 0.3235, 0.3672, 0.3419]}, {"w": "150", "b": [0.3731, 0.3235, 0.4085, 0.3419]}, {"w": "(a", "b": [0.4144, 0.3235, 0.4328, 0.3419]}, {"w": "somewhat", "b": [0.4387, 0.3235, 0.5344, 0.3419]}, {"w": "arbitrary", "b": [0.5403, 0.3235, 0.6216, 0.3419]}, {"w": "choice),", "b": [0.6275, 0.3235, 0.7029, 0.3419]}, {"w": "you", "b": [0.7088, 0.3235, 0.7443, 0.3419]}, {"w": "end", "b": [0.7502, 0.3235, 0.7843, 0.3419]}, {"w": "up", "b": [0.7902, 0.3235, 0.8138, 0.3419]}, {"w": "with", "b": [0.8197, 0.3235, 0.8617, 0.3419]}, {"w": "feature", "b": [0.1289, 0.3427, 0.1944, 0.3611]}, {"w": "maps", "b": [0.2003, 0.3427, 0.2502, 0.3611]}, {"w": "of", "b": [0.2561, 0.3427, 0.2757, 0.3611]}, {"w": "size", "b": [0.2816, 0.3427, 0.3184, 0.3611]}, {"w": "7", "b": [0.3243, 0.3427, 0.3361, 0.3611]}, {"w": "×", "b": [0.342, 0.3427, 0.3553, 0.3611]}, {"w": "7", "b": [0.3612, 0.3427, 0.373, 0.3611]}, {"w": "just", "b": [0.3789, 0.3427, 0.413, 0.3611]}, {"w": "before", "b": [0.4189, 0.3427, 0.4792, 0.3611]}, {"w": "the", "b": [0.4852, 0.3427, 0.514, 0.3611]}, {"w": "Flatten", "b": [0.5199, 0.3436, 0.6191, 0.3625]}, {"w": "layer.", "b": [0.625, 0.3427, 0.6768, 0.3611]}]}, {"id": "b_3", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1289, 0.3889, 0.1643, 0.4028]}]}, {"id": "b_4", "type": "paragraph", "text": "The depth of the feature maps progressively increases in the network (from 32 to 128), whereas the size of the feature maps decreases (from 148 × 148 to 7 × 7). This is a pattern you’ll see in almost all convnets.", "words": [{"w": "The", "b": [0.1289, 0.4203, 0.1656, 0.4387]}, {"w": "depth", "b": [0.1715, 0.4203, 0.224, 0.4387]}, {"w": "of", "b": [0.2299, 0.4203, 0.2495, 0.4387]}, {"w": "the", "b": [0.2555, 0.4203, 0.2843, 0.4387]}, {"w": "feature", "b": [0.2902, 0.4203, 0.3558, 0.4387]}, {"w": "maps", "b": [0.3617, 0.4203, 0.4115, 0.4387]}, {"w": "progressively", "b": [0.4174, 0.4203, 0.5447, 0.4387]}, {"w": "increases", "b": [0.5506, 0.4203, 0.6371, 0.4387]}, {"w": "in", "b": [0.643, 0.4203, 0.6614, 0.4387]}, {"w": "the", "b": [0.6673, 0.4203, 0.6961, 0.4387]}, {"w": "network", "b": [0.7021, 0.4203, 0.7794, 0.4387]}, {"w": "(from", "b": [0.7853, 0.4203, 0.8391, 0.4387]}, {"w": "32", "b": [0.845, 0.4203, 0.8686, 0.4387]}, {"w": "to", "b": [0.1289, 0.4394, 0.1472, 0.4579]}, {"w": "128),", "b": [0.1532, 0.4394, 0.2023, 0.4579]}, {"w": "whereas", "b": [0.2082, 0.4394, 0.2856, 0.4579]}, {"w": "the", "b": [0.2915, 0.4394, 0.3204, 0.4579]}, {"w": "size", "b": [0.3263, 0.4394, 0.363, 0.4579]}, {"w": "of", "b": [0.3689, 0.4394, 0.3886, 0.4579]}, {"w": "the", "b": [0.3945, 0.4394, 0.4233, 0.4579]}, {"w": "feature", "b": [0.4292, 0.4394, 0.4948, 0.4579]}, {"w": "maps", "b": [0.5007, 0.4394, 0.5505, 0.4579]}, {"w": "decreases", "b": [0.5564, 0.4394, 0.6469, 0.4579]}, {"w": "(from", "b": [0.6528, 0.4394, 0.7065, 0.4579]}, {"w": "148", "b": [0.7124, 0.4394, 0.7479, 0.4579]}, {"w": "×", "b": [0.7538, 0.4394, 0.7671, 0.4579]}, {"w": "148", "b": [0.773, 0.4394, 0.8084, 0.4579]}, {"w": "to", "b": [0.8143, 0.4394, 0.8327, 0.4579]}, {"w": "7", "b": [0.8386, 0.4394, 0.8504, 0.4579]}, {"w": "×", "b": [0.8563, 0.4394, 0.8696, 0.4579]}, {"w": "7).", "b": [0.1289, 0.4586, 0.1545, 0.4771]}, {"w": "This", "b": [0.1604, 0.4586, 0.2023, 0.4771]}, {"w": "is", "b": [0.2082, 0.4586, 0.224, 0.4771]}, {"w": "a", "b": [0.2299, 0.4586, 0.2404, 0.4771]}, {"w": "pattern", "b": [0.2463, 0.4586, 0.3119, 0.4771]}, {"w": "you’ll", "b": [0.3178, 0.4586, 0.3742, 0.4771]}, {"w": "see", "b": [0.3801, 0.4586, 0.4102, 0.4771]}, {"w": "in", "b": [0.4161, 0.4586, 0.4345, 0.4771]}, {"w": "almost", "b": [0.4404, 0.4586, 0.5034, 0.4771]}, {"w": "all", "b": [0.5093, 0.4586, 0.5329, 0.4771]}, {"w": "convnets.", "b": [0.5388, 0.4586, 0.6287, 0.4771]}]}, {"id": "b_5", "type": "paragraph", "text": "Because you’re attacking a binary-classification problem, you’ll end the network with a single unit (a Dense layer of size 1) and a sigmoid activation. This unit will encode the probability that the network is looking at one class or the other.", "words": [{"w": "Because", "b": [0.1289, 0.5237, 0.2076, 0.5422]}, {"w": "you’re", "b": [0.2135, 0.5237, 0.2751, 0.5422]}, {"w": "attacking", "b": [0.281, 0.5237, 0.3676, 0.5422]}, {"w": "a", "b": [0.3735, 0.5237, 0.384, 0.5422]}, {"w": "binary-classification", "b": [0.3899, 0.5237, 0.5827, 0.5422]}, {"w": "problem,", "b": [0.5886, 0.5237, 0.6732, 0.5422]}, {"w": "you’ll", "b": [0.6791, 0.5237, 0.7355, 0.5422]}, {"w": "end", "b": [0.7414, 0.5237, 0.7755, 0.5422]}, {"w": "the", "b": [0.7814, 0.5237, 0.8103, 0.5422]}, {"w": "network", "b": [0.1289, 0.5429, 0.2063, 0.5614]}, {"w": "with", "b": [0.2122, 0.5429, 0.2542, 0.5614]}, {"w": "a", "b": [0.2601, 0.5429, 0.2705, 0.5614]}, {"w": "single", "b": [0.2764, 0.5429, 0.3329, 0.5614]}, {"w": "unit", "b": [0.3388, 0.5429, 0.3755, 0.5614]}, {"w": "(a", "b": [0.3814, 0.5429, 0.3998, 0.5614]}, {"w": "Dense", "b": [0.4056, 0.5439, 0.4765, 0.5628]}, {"w": "layer", "b": [0.4824, 0.5429, 0.5296, 0.5614]}, {"w": "of", "b": [0.5355, 0.5429, 0.5552, 0.5614]}, {"w": "size", "b": [0.5611, 0.5429, 0.5978, 0.5614]}, {"w": "1)", "b": [0.6037, 0.5429, 0.6234, 0.5614]}, {"w": "and", "b": [0.6293, 0.5429, 0.6634, 0.5614]}, {"w": "a", "b": [0.6693, 0.5429, 0.6798, 0.5614]}, {"w": "sigmoid", "b": [0.6856, 0.5439, 0.7848, 0.5628]}, {"w": "activation.", "b": [0.1289, 0.5629, 0.2279, 0.5814]}, {"w": "This", "b": [0.2338, 0.5629, 0.2758, 0.5814]}, {"w": "unit", "b": [0.2817, 0.5629, 0.3185, 0.5814]}, {"w": "will", "b": [0.3244, 0.5629, 0.3611, 0.5814]}, {"w": "encode", "b": [0.367, 0.5629, 0.4339, 0.5814]}, {"w": "the", "b": [0.4398, 0.5629, 0.4686, 0.5814]}, {"w": "probability", "b": [0.4745, 0.5629, 0.5782, 0.5814]}, {"w": "that", "b": [0.5841, 0.5629, 0.6195, 0.5814]}, {"w": "the", "b": [0.6254, 0.5629, 0.6543, 0.5814]}, {"w": "network", "b": [0.6602, 0.5629, 0.7376, 0.5814]}, {"w": "is", "b": [0.7435, 0.5629, 0.7592, 0.5814]}, {"w": "looking", "b": [0.7651, 0.5629, 0.8373, 0.5814]}, {"w": "at", "b": [0.8432, 0.5629, 0.8602, 0.5814]}, {"w": "one", "b": [0.1289, 0.5821, 0.163, 0.6006]}, {"w": "class", "b": [0.1689, 0.5821, 0.2148, 0.6006]}, {"w": "or", "b": [0.2207, 0.5821, 0.2404, 0.6006]}, {"w": "the", "b": [0.2463, 0.5821, 0.2751, 0.6006]}, {"w": "other.", "b": [0.281, 0.5821, 0.3341, 0.6006]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.5. Instantiating a small convnet for dogs vs. cats classification", "words": [{"w": "Listing", "b": [0.1289, 0.6176, 0.182, 0.6314]}, {"w": "5.5.", "b": [0.1865, 0.6176, 0.213, 0.6314]}, {"w": "Instantiating", "b": [0.2174, 0.6176, 0.3149, 0.6314]}, {"w": "a", "b": [0.3193, 0.6176, 0.3281, 0.6314]}, {"w": "small", "b": [0.3326, 0.6176, 0.3729, 0.6314]}, {"w": "convnet", "b": [0.3773, 0.6176, 0.4364, 0.6314]}, {"w": "for", "b": [0.4408, 0.6176, 0.4634, 0.6314]}, {"w": "dogs", "b": [0.4678, 0.6176, 0.5023, 0.6314]}, {"w": "vs.", "b": [0.5067, 0.6176, 0.5269, 0.6314]}, {"w": "cats", "b": [0.5313, 0.6176, 0.5608, 0.6314]}, {"w": "classification", "b": [0.5653, 0.6176, 0.6627, 0.6314]}]}, {"id": "b_7", "type": "paragraph", "text": "from keras import layers from keras import models model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Flatten()) model.add(layers.Dense(512, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "from", "b": [0.1348, 0.6442, 0.1773, 0.6583]}, {"w": "keras", "b": [0.1879, 0.6442, 0.241, 0.6583]}, {"w": "import", "b": [0.2517, 0.6442, 0.3154, 0.6583]}, {"w": "layers", "b": [0.3261, 0.6442, 0.3898, 0.6583]}, {"w": "from", "b": [0.1348, 0.6583, 0.1773, 0.6725]}, {"w": "keras", "b": [0.1879, 0.6583, 0.241, 0.6725]}, {"w": "import", "b": [0.2517, 0.6583, 0.3154, 0.6725]}, {"w": "models", "b": [0.3261, 0.6583, 0.3898, 0.6725]}, {"w": "model", "b": [0.1348, 0.6867, 0.1879, 0.7009]}, {"w": "=", "b": [0.1985, 0.6867, 0.2092, 0.7009]}, {"w": "models.Sequential()", "b": [0.2198, 0.6867, 0.4217, 0.7009]}, {"w": "model.add(layers.Conv2D(32,", "b": [0.1348, 0.7009, 0.4217, 0.7151]}, {"w": "(3,", "b": [0.4323, 0.7009, 0.4642, 0.7151]}, {"w": "3),", "b": [0.4748, 0.7009, 0.5067, 0.7151]}, {"w": "activation='relu',", "b": [0.5173, 0.7009, 0.7086, 0.7151]}, {"w": "input_shape=(150,", "b": [0.3898, 0.7151, 0.5705, 0.7293]}, {"w": "150,", "b": [0.5811, 0.7151, 0.6236, 0.7293]}, {"w": "3)))", "b": [0.6342, 0.7151, 0.6767, 0.7293]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.7293, 0.4855, 0.7434]}, {"w": "2)))", "b": [0.4961, 0.7293, 0.5386, 0.7434]}, {"w": "model.add(layers.Conv2D(64,", "b": [0.1348, 0.7434, 0.4217, 0.7576]}, {"w": "(3,", "b": [0.4323, 0.7434, 0.4642, 0.7576]}, {"w": "3),", "b": [0.4748, 0.7434, 0.5067, 0.7576]}, {"w": "activation='relu'))", "b": [0.5173, 0.7434, 0.7192, 0.7576]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.7576, 0.4855, 0.7718]}, {"w": "2)))", "b": [0.4961, 0.7576, 0.5386, 0.7718]}, {"w": "model.add(layers.Conv2D(128,", "b": [0.1348, 0.7718, 0.4323, 0.786]}, {"w": "(3,", "b": [0.443, 0.7718, 0.4748, 0.786]}, {"w": "3),", "b": [0.4855, 0.7718, 0.5173, 0.786]}, {"w": "activation='relu'))", "b": [0.528, 0.7718, 0.7299, 0.786]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.786, 0.4855, 0.8002]}, {"w": "2)))", "b": [0.4961, 0.786, 0.5386, 0.8002]}, {"w": "model.add(layers.Conv2D(128,", "b": [0.1348, 0.8002, 0.4323, 0.8144]}, {"w": "(3,", "b": [0.443, 0.8002, 0.4748, 0.8144]}, {"w": "3),", "b": [0.4855, 0.8002, 0.5173, 0.8144]}, {"w": "activation='relu'))", "b": [0.528, 0.8002, 0.7299, 0.8144]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.8144, 0.4855, 0.8285]}, {"w": "2)))", "b": [0.4961, 0.8144, 0.5386, 0.8285]}, {"w": "model.add(layers.Flatten())", "b": [0.1348, 0.8286, 0.4217, 0.8427]}, {"w": "model.add(layers.Dense(512,", "b": [0.1348, 0.8427, 0.4217, 0.8569]}, {"w": "activation='relu'))", "b": [0.4323, 0.8427, 0.6342, 0.8569]}, {"w": "model.add(layers.Dense(1,", "b": [0.1348, 0.8569, 0.4004, 0.8711]}, {"w": "activation='sigmoid'))", "b": [0.4111, 0.8569, 0.6449, 0.8711]}]}]}, {"page": 188, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Let’s look at how the dimensions of the feature maps change with every successive layer:", "words": [{"w": "Let’s", "b": [0.1289, 0.0857, 0.1761, 0.1041]}, {"w": "look", "b": [0.182, 0.0857, 0.224, 0.1041]}, {"w": "at", "b": [0.2299, 0.0857, 0.2469, 0.1041]}, {"w": "how", "b": [0.2528, 0.0857, 0.2935, 0.1041]}, {"w": "the", "b": [0.2994, 0.0857, 0.3283, 0.1041]}, {"w": "dimensions", "b": [0.3342, 0.0857, 0.4418, 0.1041]}, {"w": "of", "b": [0.4477, 0.0857, 0.4673, 0.1041]}, {"w": "the", "b": [0.4732, 0.0857, 0.5021, 0.1041]}, {"w": "feature", "b": [0.508, 0.0857, 0.5736, 0.1041]}, {"w": "maps", "b": [0.5795, 0.0857, 0.6293, 0.1041]}, {"w": "change", "b": [0.6352, 0.0857, 0.7021, 0.1041]}, {"w": "with", "b": [0.708, 0.0857, 0.75, 0.1041]}, {"w": "every", "b": [0.7559, 0.0857, 0.8083, 0.1041]}, {"w": "successive", "b": [0.1289, 0.1049, 0.2286, 0.1233]}, {"w": "layer:", "b": [0.2345, 0.1049, 0.2882, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": ">>> model.summary() Layer (type) Output Shape Param # ================================================================ conv2d_1 (Conv2D) (None, 148, 148, 32) 896 ________________________________________________________________ maxpooling2d_1 (MaxPooling2D) (None, 74, 74, 32) 0 ________________________________________________________________ conv2d_2 (Conv2D) (None, 72, 72, 64) 18496 ________________________________________________________________ maxpooling2d_2 (MaxPooling2D) (None, 36, 36, 64) 0 ________________________________________________________________ conv2d_3 (Conv2D) (None, 34, 34, 128) 73856 ________________________________________________________________ maxpooling2d_3 (MaxPooling2D) (None, 17, 17, 128) 0 ________________________________________________________________ conv2d_4 (Conv2D) (None, 15, 15, 128) 147584 ________________________________________________________________ maxpooling2d_4 (MaxPooling2D) (None, 7, 7, 128) 0 ________________________________________________________________ flatten_1 (Flatten) (None, 6272) 0 ________________________________________________________________ dense_1 (Dense) (None, 512) 3211776 ________________________________________________________________ dense_2 (Dense) (None, 1) 513 ================================================================ Total params: 3,453,121 Trainable params: 3,453,121 Non-trainable params: 0", "words": [{"w": ">>>", "b": [0.1348, 0.1402, 0.1667, 0.1544]}, {"w": "model.summary()", "b": [0.1773, 0.1402, 0.3367, 0.1544]}, {"w": "Layer", "b": [0.1348, 0.1544, 0.1879, 0.1685]}, {"w": "(type)", "b": [0.1985, 0.1544, 0.2623, 0.1685]}, {"w": "Output", "b": [0.4855, 0.1544, 0.5492, 0.1685]}, {"w": "Shape", "b": [0.5598, 0.1544, 0.613, 0.1685]}, {"w": "Param", "b": [0.7192, 0.1544, 0.7724, 0.1685]}, {"w": "#", "b": [0.783, 0.1544, 0.7936, 0.1685]}, {"w": "================================================================", "b": [0.1348, 0.1686, 0.8149, 0.1827]}, {"w": "conv2d_1", "b": [0.1348, 0.1827, 0.2198, 0.1969]}, {"w": "(Conv2D)", "b": [0.2304, 0.1827, 0.3154, 0.1969]}, {"w": "(None,", "b": [0.4855, 0.1827, 0.5492, 0.1969]}, {"w": "148,", "b": [0.5598, 0.1827, 0.6024, 0.1969]}, {"w": "148,", "b": [0.613, 0.1827, 0.6555, 0.1969]}, {"w": "32)", "b": [0.6661, 0.1827, 0.698, 0.1969]}, {"w": "896", "b": [0.7192, 0.1827, 0.7511, 0.1969]}, {"w": "________________________________________________________________", "b": [0.1348, 0.1969, 0.8149, 0.2111]}, {"w": "maxpooling2d_1", "b": [0.1348, 0.2111, 0.2836, 0.2253]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.2111, 0.443, 0.2253]}, {"w": "(None,", "b": [0.4855, 0.2111, 0.5492, 0.2253]}, {"w": "74,", "b": [0.5598, 0.2111, 0.5917, 0.2253]}, {"w": "74,", "b": [0.6024, 0.2111, 0.6342, 0.2253]}, {"w": "32)", "b": [0.6449, 0.2111, 0.6767, 0.2253]}, {"w": "0", "b": [0.7192, 0.2111, 0.7299, 0.2253]}, {"w": "________________________________________________________________", "b": [0.1348, 0.2253, 0.8149, 0.2395]}, {"w": "conv2d_2", "b": [0.1348, 0.2395, 0.2198, 0.2537]}, {"w": "(Conv2D)", "b": [0.2304, 0.2395, 0.3154, 0.2537]}, {"w": "(None,", "b": [0.4855, 0.2395, 0.5492, 0.2537]}, {"w": "72,", "b": [0.5598, 0.2395, 0.5917, 0.2537]}, {"w": "72,", "b": [0.6024, 0.2395, 0.6342, 0.2537]}, {"w": "64)", "b": [0.6449, 0.2395, 0.6767, 0.2537]}, {"w": "18496", "b": [0.7192, 0.2395, 0.7724, 0.2537]}, {"w": "________________________________________________________________", "b": [0.1348, 0.2537, 0.8149, 0.2678]}, {"w": "maxpooling2d_2", "b": [0.1348, 0.2678, 0.2836, 0.282]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.2678, 0.443, 0.282]}, {"w": "(None,", "b": [0.4855, 0.2678, 0.5492, 0.282]}, {"w": "36,", "b": [0.5598, 0.2678, 0.5917, 0.282]}, {"w": "36,", "b": [0.6024, 0.2678, 0.6342, 0.282]}, {"w": "64)", "b": [0.6449, 0.2678, 0.6767, 0.282]}, {"w": "0", "b": [0.7192, 0.2678, 0.7299, 0.282]}, {"w": "________________________________________________________________", "b": [0.1348, 0.282, 0.8149, 0.2962]}, {"w": "conv2d_3", "b": [0.1348, 0.2962, 0.2198, 0.3104]}, {"w": "(Conv2D)", "b": [0.2304, 0.2962, 0.3154, 0.3104]}, {"w": "(None,", "b": [0.4855, 0.2962, 0.5492, 0.3104]}, {"w": "34,", "b": [0.5598, 0.2962, 0.5917, 0.3104]}, {"w": "34,", "b": [0.6024, 0.2962, 0.6342, 0.3104]}, {"w": "128)", "b": [0.6449, 0.2962, 0.6874, 0.3104]}, {"w": "73856", "b": [0.7192, 0.2962, 0.7724, 0.3104]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3104, 0.8149, 0.3246]}, {"w": "maxpooling2d_3", "b": [0.1348, 0.3246, 0.2836, 0.3388]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.3246, 0.443, 0.3388]}, {"w": "(None,", "b": [0.4855, 0.3246, 0.5492, 0.3388]}, {"w": "17,", "b": [0.5598, 0.3246, 0.5917, 0.3388]}, {"w": "17,", "b": [0.6024, 0.3246, 0.6342, 0.3388]}, {"w": "128)", "b": [0.6449, 0.3246, 0.6874, 0.3388]}, {"w": "0", "b": [0.7192, 0.3246, 0.7299, 0.3388]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3388, 0.8149, 0.3529]}, {"w": "conv2d_4", "b": [0.1348, 0.353, 0.2198, 0.3671]}, {"w": "(Conv2D)", "b": [0.2304, 0.353, 0.3154, 0.3671]}, {"w": "(None,", "b": [0.4855, 0.353, 0.5492, 0.3671]}, {"w": "15,", "b": [0.5598, 0.353, 0.5917, 0.3671]}, {"w": "15,", "b": [0.6024, 0.353, 0.6342, 0.3671]}, {"w": "128)", "b": [0.6449, 0.353, 0.6874, 0.3671]}, {"w": "147584", "b": [0.7192, 0.353, 0.783, 0.3671]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3671, 0.8149, 0.3813]}, {"w": "maxpooling2d_4", "b": [0.1348, 0.3813, 0.2836, 0.3955]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.3813, 0.443, 0.3955]}, {"w": "(None,", "b": [0.4855, 0.3813, 0.5492, 0.3955]}, {"w": "7,", "b": [0.5598, 0.3813, 0.5811, 0.3955]}, {"w": "7,", "b": [0.5917, 0.3813, 0.613, 0.3955]}, {"w": "128)", "b": [0.6236, 0.3813, 0.6661, 0.3955]}, {"w": "0", "b": [0.7192, 0.3813, 0.7299, 0.3955]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3955, 0.8149, 0.4097]}, {"w": "flatten_1", "b": [0.1348, 0.4097, 0.2304, 0.4239]}, {"w": "(Flatten)", "b": [0.241, 0.4097, 0.3367, 0.4239]}, {"w": "(None,", "b": [0.4855, 0.4097, 0.5492, 0.4239]}, {"w": "6272)", "b": [0.5598, 0.4097, 0.613, 0.4239]}, {"w": "0", "b": [0.7192, 0.4097, 0.7299, 0.4239]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4239, 0.8149, 0.4381]}, {"w": "dense_1", "b": [0.1348, 0.4381, 0.2092, 0.4522]}, {"w": "(Dense)", "b": [0.2198, 0.4381, 0.2942, 0.4522]}, {"w": "(None,", "b": [0.4855, 0.4381, 0.5492, 0.4522]}, {"w": "512)", "b": [0.5598, 0.4381, 0.6024, 0.4522]}, {"w": "3211776", "b": [0.7192, 0.4381, 0.7936, 0.4522]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4522, 0.8149, 0.4664]}, {"w": "dense_2", "b": [0.1348, 0.4664, 0.2092, 0.4806]}, {"w": "(Dense)", "b": [0.2198, 0.4664, 0.2942, 0.4806]}, {"w": "(None,", "b": [0.4855, 0.4664, 0.5492, 0.4806]}, {"w": "1)", "b": [0.5598, 0.4664, 0.5811, 0.4806]}, {"w": "513", "b": [0.7192, 0.4664, 0.7511, 0.4806]}, {"w": "================================================================", "b": [0.1348, 0.4806, 0.8149, 0.4948]}, {"w": "Total", "b": [0.1348, 0.4948, 0.1879, 0.509]}, {"w": "params:", "b": [0.1985, 0.4948, 0.2729, 0.509]}, {"w": "3,453,121", "b": [0.2836, 0.4948, 0.3792, 0.509]}, {"w": "Trainable", "b": [0.1348, 0.509, 0.2304, 0.5232]}, {"w": "params:", "b": [0.241, 0.509, 0.3154, 0.5232]}, {"w": "3,453,121", "b": [0.3261, 0.509, 0.4217, 0.5232]}, {"w": "Non-trainable", "b": [0.1348, 0.5232, 0.2729, 0.5373]}, {"w": "params:", "b": [0.2836, 0.5232, 0.3579, 0.5373]}, {"w": "0", "b": [0.3686, 0.5232, 0.3792, 0.5373]}]}, {"id": "b_2", "type": "paragraph", "text": "For the compilation step, you’ll go with the RMSprop optimizer, as usual. Because you ended the network with a single sigmoid unit, you’ll use binary crossentropy as the loss (as a reminder, check out table 4.1 for a cheatsheet on what loss function to use in various situations).", "words": [{"w": "For", "b": [0.1289, 0.5588, 0.1617, 0.5772]}, {"w": "the", "b": [0.1676, 0.5588, 0.1964, 0.5772]}, {"w": "compilation", "b": [0.2023, 0.5588, 0.3152, 0.5772]}, {"w": "step,", "b": [0.3211, 0.5588, 0.365, 0.5772]}, {"w": "you’ll", "b": [0.3709, 0.5588, 0.4273, 0.5772]}, {"w": "go", "b": [0.4332, 0.5588, 0.4569, 0.5772]}, {"w": "with", "b": [0.4628, 0.5588, 0.5048, 0.5772]}, {"w": "the", "b": [0.5107, 0.5588, 0.5395, 0.5772]}, {"w": "RMSprop", "b": [0.5454, 0.5597, 0.6445, 0.5787]}, {"w": "optimizer,", "b": [0.6504, 0.5588, 0.7459, 0.5772]}, {"w": "as", "b": [0.7518, 0.5588, 0.7715, 0.5772]}, {"w": "usual.", "b": [0.7774, 0.5588, 0.8331, 0.5772]}, {"w": "Because", "b": [0.1289, 0.5788, 0.2076, 0.5973]}, {"w": "you", "b": [0.2135, 0.5788, 0.2489, 0.5973]}, {"w": "ended", "b": [0.2548, 0.5788, 0.3112, 0.5973]}, {"w": "the", "b": [0.3171, 0.5788, 0.3459, 0.5973]}, {"w": "network", "b": [0.3518, 0.5788, 0.4292, 0.5973]}, {"w": "with", "b": [0.4351, 0.5788, 0.4771, 0.5973]}, {"w": "a", "b": [0.483, 0.5788, 0.4935, 0.5973]}, {"w": "single", "b": [0.4994, 0.5788, 0.5558, 0.5973]}, {"w": "sigmoid", "b": [0.5617, 0.5788, 0.6378, 0.5973]}, {"w": "unit,", "b": [0.6437, 0.5788, 0.6864, 0.5973]}, {"w": "you’ll", "b": [0.6923, 0.5788, 0.7487, 0.5973]}, {"w": "use", "b": [0.7546, 0.5788, 0.7861, 0.5973]}, {"w": "binary", "b": [0.792, 0.5788, 0.8523, 0.5973]}, {"w": "crossentropy", "b": [0.1289, 0.598, 0.2495, 0.6165]}, {"w": "as", "b": [0.2555, 0.598, 0.2751, 0.6165]}, {"w": "the", "b": [0.281, 0.598, 0.3099, 0.6165]}, {"w": "loss", "b": [0.3158, 0.598, 0.3525, 0.6165]}, {"w": "(as", "b": [0.3584, 0.598, 0.386, 0.6165]}, {"w": "a", "b": [0.3919, 0.598, 0.4023, 0.6165]}, {"w": "reminder,", "b": [0.4082, 0.598, 0.4984, 0.6165]}, {"w": "check", "b": [0.5043, 0.598, 0.5594, 0.6165]}, {"w": "out", "b": [0.5653, 0.598, 0.5955, 0.6165]}, {"w": "table", "b": [0.6014, 0.598, 0.6473, 0.6165]}, {"w": "4.1", "b": [0.6532, 0.598, 0.6827, 0.6165]}, {"w": "for", "b": [0.6886, 0.598, 0.7161, 0.6165]}, {"w": "a", "b": [0.722, 0.598, 0.7325, 0.6165]}, {"w": "cheatsheet", "b": [0.7384, 0.598, 0.8368, 0.6165]}, {"w": "on", "b": [0.8427, 0.598, 0.8663, 0.6165]}, {"w": "what", "b": [0.1289, 0.6172, 0.1748, 0.6357]}, {"w": "loss", "b": [0.1807, 0.6172, 0.2174, 0.6357]}, {"w": "function", "b": [0.2233, 0.6172, 0.302, 0.6357]}, {"w": "to", "b": [0.3079, 0.6172, 0.3263, 0.6357]}, {"w": "use", "b": [0.3322, 0.6172, 0.3637, 0.6357]}, {"w": "in", "b": [0.3696, 0.6172, 0.388, 0.6357]}, {"w": "various", "b": [0.3939, 0.6172, 0.4634, 0.6357]}, {"w": "situations).", "b": [0.4693, 0.6172, 0.5736, 0.6357]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.6. Configuring the model for training", "words": [{"w": "Listing", "b": [0.1289, 0.6526, 0.182, 0.6665]}, {"w": "5.6.", "b": [0.1865, 0.6526, 0.213, 0.6665]}, {"w": "Configuring", "b": [0.2174, 0.6526, 0.3099, 0.6665]}, {"w": "the", "b": [0.3144, 0.6526, 0.338, 0.6665]}, {"w": "model", "b": [0.3424, 0.6526, 0.3886, 0.6665]}, {"w": "for", "b": [0.3931, 0.6526, 0.4157, 0.6665]}, {"w": "training", "b": [0.4201, 0.6526, 0.4811, 0.6665]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras import optimizers model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=1e-4), metrics=['acc'])", "words": [{"w": "from", "b": [0.1348, 0.6792, 0.1773, 0.6934]}, {"w": "keras", "b": [0.1879, 0.6792, 0.241, 0.6934]}, {"w": "import", "b": [0.2517, 0.6792, 0.3154, 0.6934]}, {"w": "optimizers", "b": [0.3261, 0.6792, 0.4323, 0.6934]}, {"w": "model.compile(loss='binary_crossentropy',", "b": [0.1348, 0.7076, 0.5705, 0.7217]}, {"w": "optimizer=optimizers.RMSprop(lr=1e-4),", "b": [0.2836, 0.7218, 0.6874, 0.7359]}, {"w": "metrics=['acc'])", "b": [0.2836, 0.7359, 0.4536, 0.7501]}]}, {"id": "b_5", "type": "paragraph", "text": "5.2.4. Data preprocessing", "words": [{"w": "5.2.4.", "b": [0.1289, 0.7757, 0.182, 0.7942]}, {"w": "Data", "b": [0.1879, 0.7757, 0.2364, 0.7942]}, {"w": "preprocessing", "b": [0.2423, 0.7757, 0.3819, 0.7942]}]}, {"id": "b_6", "type": "paragraph", "text": "As you know by now, data should be formatted into appropriately preprocessed floating-point tensors before being fed into the network. Currently, the data sits on a drive as JPEG files, so the steps for getting it into the network are roughly as follows:", "words": [{"w": "As", "b": [0.1289, 0.8158, 0.1551, 0.8342]}, {"w": "you", "b": [0.161, 0.8158, 0.1964, 0.8342]}, {"w": "know", "b": [0.2023, 0.8158, 0.2548, 0.8342]}, {"w": "by", "b": [0.2607, 0.8158, 0.2843, 0.8342]}, {"w": "now,", "b": [0.2902, 0.8158, 0.3353, 0.8342]}, {"w": "data", "b": [0.3412, 0.8158, 0.3805, 0.8342]}, {"w": "should", "b": [0.3864, 0.8158, 0.4494, 0.8342]}, {"w": "be", "b": [0.4553, 0.8158, 0.4776, 0.8342]}, {"w": "formatted", "b": [0.4835, 0.8158, 0.5753, 0.8342]}, {"w": "into", "b": [0.5812, 0.8158, 0.618, 0.8342]}, {"w": "appropriately", "b": [0.6239, 0.8158, 0.7498, 0.8342]}, {"w": "preprocessed", "b": [0.1289, 0.835, 0.2521, 0.8534]}, {"w": "floating-point", "b": [0.258, 0.835, 0.3879, 0.8534]}, {"w": "tensors", "b": [0.3938, 0.835, 0.4607, 0.8534]}, {"w": "before", "b": [0.4666, 0.835, 0.527, 0.8534]}, {"w": "being", "b": [0.5329, 0.835, 0.5853, 0.8534]}, {"w": "fed", "b": [0.5912, 0.835, 0.6214, 0.8534]}, {"w": "into", "b": [0.6273, 0.835, 0.664, 0.8534]}, {"w": "the", "b": [0.6699, 0.835, 0.6987, 0.8534]}, {"w": "network.", "b": [0.7046, 0.835, 0.7879, 0.8534]}, {"w": "Currently,", "b": [0.1289, 0.8541, 0.2238, 0.8726]}, {"w": "the", "b": [0.2297, 0.8541, 0.2585, 0.8726]}, {"w": "data", "b": [0.2644, 0.8541, 0.3038, 0.8726]}, {"w": "sits", "b": [0.3097, 0.8541, 0.3412, 0.8726]}, {"w": "on", "b": [0.3471, 0.8541, 0.3707, 0.8726]}, {"w": "a", "b": [0.3766, 0.8541, 0.3871, 0.8726]}, {"w": "drive", "b": [0.393, 0.8541, 0.4415, 0.8726]}, {"w": "as", "b": [0.4474, 0.8541, 0.4671, 0.8726]}, {"w": "JPEG", "b": [0.473, 0.8541, 0.5268, 0.8726]}, {"w": "files,", "b": [0.5327, 0.8541, 0.5792, 0.8726]}, {"w": "so", "b": [0.5852, 0.8541, 0.6061, 0.8726]}, {"w": "the", "b": [0.612, 0.8541, 0.6409, 0.8726]}, {"w": "steps", "b": [0.6468, 0.8541, 0.694, 0.8726]}, {"w": "for", "b": [0.6999, 0.8541, 0.7275, 0.8726]}, {"w": "getting", "b": [0.7334, 0.8541, 0.799, 0.8726]}, {"w": "it", "b": [0.8049, 0.8541, 0.818, 0.8726]}, {"w": "into", "b": [0.8239, 0.8541, 0.8607, 0.8726]}, {"w": "the", "b": [0.1289, 0.8733, 0.1577, 0.8918]}, {"w": "network", "b": [0.1636, 0.8733, 0.241, 0.8918]}, {"w": "are", "b": [0.2469, 0.8733, 0.2758, 0.8918]}, {"w": "roughly", "b": [0.2817, 0.8733, 0.3551, 0.8918]}, {"w": "as", "b": [0.361, 0.8733, 0.3807, 0.8918]}, {"w": "follows:", "b": [0.3866, 0.8733, 0.464, 0.8918]}]}]}, {"page": 189, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1. Read the picture files. 2. Decode the JPEG content to RGB grids of pixels. 3. Convert these into floating-point tensors. 4. Rescale the pixel values (between 0 and 255) to the [0, 1] interval (as you know, neural networks prefer to deal with small input values).", "words": [{"w": "1.", "b": [0.1529, 0.0857, 0.1706, 0.1041]}, {"w": "Read", "b": [0.1761, 0.0857, 0.2246, 0.1041]}, {"w": "the", "b": [0.2305, 0.0857, 0.2594, 0.1041]}, {"w": "picture", "b": [0.2653, 0.0857, 0.3309, 0.1041]}, {"w": "files.", "b": [0.3368, 0.0857, 0.3833, 0.1041]}, {"w": "2.", "b": [0.1529, 0.1049, 0.1706, 0.1233]}, {"w": "Decode", "b": [0.1761, 0.1049, 0.2482, 0.1233]}, {"w": "the", "b": [0.2541, 0.1049, 0.283, 0.1233]}, {"w": "JPEG", "b": [0.2889, 0.1049, 0.3427, 0.1233]}, {"w": "content", "b": [0.3486, 0.1049, 0.4181, 0.1233]}, {"w": "to", "b": [0.424, 0.1049, 0.4424, 0.1233]}, {"w": "RGB", "b": [0.4483, 0.1049, 0.4968, 0.1233]}, {"w": "grids", "b": [0.5027, 0.1049, 0.55, 0.1233]}, {"w": "of", "b": [0.5559, 0.1049, 0.5755, 0.1233]}, {"w": "pixels.", "b": [0.5815, 0.1049, 0.6438, 0.1233]}, {"w": "3.", "b": [0.1529, 0.124, 0.1706, 0.1425]}, {"w": "Convert", "b": [0.1761, 0.124, 0.2522, 0.1425]}, {"w": "these", "b": [0.2581, 0.124, 0.3066, 0.1425]}, {"w": "into", "b": [0.3125, 0.124, 0.3493, 0.1425]}, {"w": "floating-point", "b": [0.3552, 0.124, 0.4851, 0.1425]}, {"w": "tensors.", "b": [0.491, 0.124, 0.5638, 0.1425]}, {"w": "4.", "b": [0.1529, 0.1432, 0.1706, 0.1617]}, {"w": "Rescale", "b": [0.1761, 0.1432, 0.2495, 0.1617]}, {"w": "the", "b": [0.2555, 0.1432, 0.2843, 0.1617]}, {"w": "pixel", "b": [0.2902, 0.1432, 0.3374, 0.1617]}, {"w": "values", "b": [0.3433, 0.1432, 0.4037, 0.1617]}, {"w": "(between", "b": [0.4096, 0.1432, 0.4961, 0.1617]}, {"w": "0", "b": [0.502, 0.1432, 0.5138, 0.1617]}, {"w": "and", "b": [0.5197, 0.1432, 0.5538, 0.1617]}, {"w": "255)", "b": [0.5598, 0.1432, 0.603, 0.1617]}, {"w": "to", "b": [0.6089, 0.1432, 0.6273, 0.1617]}, {"w": "the", "b": [0.6332, 0.1432, 0.6621, 0.1617]}, {"w": "[0,", "b": [0.668, 0.1432, 0.6936, 0.1617]}, {"w": "1]", "b": [0.6995, 0.1432, 0.7191, 0.1617]}, {"w": "interval", "b": [0.725, 0.1432, 0.7972, 0.1617]}, {"w": "(as", "b": [0.8031, 0.1432, 0.8306, 0.1617]}, {"w": "you", "b": [0.1761, 0.1624, 0.2115, 0.1809]}, {"w": "know,", "b": [0.2174, 0.1624, 0.2743, 0.1809]}, {"w": "neural", "b": [0.2802, 0.1624, 0.3392, 0.1809]}, {"w": "networks", "b": [0.3451, 0.1624, 0.4317, 0.1809]}, {"w": "prefer", "b": [0.4376, 0.1624, 0.4939, 0.1809]}, {"w": "to", "b": [0.4998, 0.1624, 0.5182, 0.1809]}, {"w": "deal", "b": [0.5241, 0.1624, 0.5635, 0.1809]}, {"w": "with", "b": [0.5694, 0.1624, 0.6114, 0.1809]}, {"w": "small", "b": [0.6173, 0.1624, 0.6684, 0.1809]}, {"w": "input", "b": [0.6743, 0.1624, 0.7228, 0.1809]}, {"w": "values).", "b": [0.7287, 0.1624, 0.8028, 0.1809]}]}, {"id": "b_1", "type": "paragraph", "text": "It may seem a bit daunting, but fortunately Keras has utilities to take care of these steps automatically. Keras has a module with image-processing helper tools, located at keras.preprocessing.image. In particular, it contains the class ImageDataGenerator, which lets you quickly set up Python generators that can automatically turn image files on disk into batches of preprocessed tensors. This is what you’ll use here.", "words": [{"w": "It", "b": [0.1289, 0.2025, 0.1433, 0.221]}, {"w": "may", "b": [0.1492, 0.2025, 0.1899, 0.221]}, {"w": "seem", "b": [0.1958, 0.2025, 0.2443, 0.221]}, {"w": "a", "b": [0.2502, 0.2025, 0.2607, 0.221]}, {"w": "bit", "b": [0.2666, 0.2025, 0.2915, 0.221]}, {"w": "daunting,", "b": [0.2974, 0.2025, 0.386, 0.221]}, {"w": "but", "b": [0.3919, 0.2025, 0.4221, 0.221]}, {"w": "fortunately", "b": [0.428, 0.2025, 0.5316, 0.221]}, {"w": "Keras", "b": [0.5375, 0.2025, 0.5926, 0.221]}, {"w": "has", "b": [0.5985, 0.2025, 0.63, 0.221]}, {"w": "utilities", "b": [0.6359, 0.2025, 0.7067, 0.221]}, {"w": "to", "b": [0.7126, 0.2025, 0.731, 0.221]}, {"w": "take", "b": [0.7369, 0.2025, 0.7763, 0.221]}, {"w": "care", "b": [0.7822, 0.2025, 0.8215, 0.221]}, {"w": "of", "b": [0.8274, 0.2025, 0.847, 0.221]}, {"w": "these", "b": [0.1289, 0.2217, 0.1774, 0.2402]}, {"w": "steps", "b": [0.1833, 0.2217, 0.2305, 0.2402]}, {"w": "automatically.", "b": [0.2364, 0.2217, 0.3693, 0.2402]}, {"w": "Keras", "b": [0.3752, 0.2217, 0.4303, 0.2402]}, {"w": "has", "b": [0.4362, 0.2217, 0.4677, 0.2402]}, {"w": "a", "b": [0.4736, 0.2217, 0.4841, 0.2402]}, {"w": "module", "b": [0.49, 0.2217, 0.5608, 0.2402]}, {"w": "with", "b": [0.5667, 0.2217, 0.6087, 0.2402]}, {"w": "image-processing", "b": [0.6146, 0.2217, 0.7812, 0.2402]}, {"w": "helper", "b": [0.7871, 0.2217, 0.8461, 0.2402]}, {"w": "tools,", "b": [0.1289, 0.2409, 0.1807, 0.2593]}, {"w": "located", "b": [0.1866, 0.2409, 0.2548, 0.2593]}, {"w": "at", "b": [0.2607, 0.2409, 0.2778, 0.2593]}, {"w": "keras.preprocessing.image.", "b": [0.2836, 0.2409, 0.6438, 0.2607]}, {"w": "In", "b": [0.6497, 0.2409, 0.6694, 0.2593]}, {"w": "particular,", "b": [0.6753, 0.2409, 0.7707, 0.2593]}, {"w": "it", "b": [0.7766, 0.2409, 0.7897, 0.2593]}, {"w": "contains", "b": [0.1289, 0.2609, 0.2076, 0.2794]}, {"w": "the", "b": [0.2135, 0.2609, 0.2423, 0.2794]}, {"w": "class", "b": [0.2482, 0.2609, 0.2942, 0.2794]}, {"w": "ImageDataGenerator,", "b": [0.3, 0.2609, 0.561, 0.2808]}, {"w": "which", "b": [0.5669, 0.2609, 0.6246, 0.2794]}, {"w": "lets", "b": [0.6305, 0.2609, 0.6633, 0.2794]}, {"w": "you", "b": [0.6692, 0.2609, 0.7047, 0.2794]}, {"w": "quickly", "b": [0.7106, 0.2609, 0.7814, 0.2794]}, {"w": "set", "b": [0.7873, 0.2609, 0.8135, 0.2794]}, {"w": "up", "b": [0.8194, 0.2609, 0.8431, 0.2794]}, {"w": "Python", "b": [0.1289, 0.2809, 0.1958, 0.2994]}, {"w": "generators", "b": [0.2017, 0.2809, 0.3001, 0.2994]}, {"w": "that", "b": [0.306, 0.2809, 0.3414, 0.2994]}, {"w": "can", "b": [0.3473, 0.2809, 0.3801, 0.2994]}, {"w": "automatically", "b": [0.386, 0.2809, 0.5145, 0.2994]}, {"w": "turn", "b": [0.5204, 0.2809, 0.5585, 0.2994]}, {"w": "image", "b": [0.5644, 0.2809, 0.6221, 0.2994]}, {"w": "files", "b": [0.628, 0.2809, 0.6687, 0.2994]}, {"w": "on", "b": [0.6746, 0.2809, 0.6982, 0.2994]}, {"w": "disk", "b": [0.7041, 0.2809, 0.7435, 0.2994]}, {"w": "into", "b": [0.7494, 0.2809, 0.7861, 0.2994]}, {"w": "batches", "b": [0.792, 0.2809, 0.8628, 0.2994]}, {"w": "of", "b": [0.1289, 0.3001, 0.1485, 0.3186]}, {"w": "preprocessed", "b": [0.1545, 0.3001, 0.2777, 0.3186]}, {"w": "tensors.", "b": [0.2836, 0.3001, 0.3564, 0.3186]}, {"w": "This", "b": [0.3623, 0.3001, 0.4043, 0.3186]}, {"w": "is", "b": [0.4102, 0.3001, 0.426, 0.3186]}, {"w": "what", "b": [0.4319, 0.3001, 0.4778, 0.3186]}, {"w": "you’ll", "b": [0.4837, 0.3001, 0.5401, 0.3186]}, {"w": "use", "b": [0.546, 0.3001, 0.5775, 0.3186]}, {"w": "here.", "b": [0.5834, 0.3001, 0.6299, 0.3186]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.7. Using ImageDataGenerator to read images from directories", "words": [{"w": "Listing", "b": [0.1289, 0.3397, 0.182, 0.3536]}, {"w": "5.7.", "b": [0.1865, 0.3397, 0.213, 0.3536]}, {"w": "Using", "b": [0.2174, 0.3397, 0.2607, 0.3536]}, {"w": "ImageDataGenerator", "b": [0.2652, 0.3404, 0.4564, 0.3546]}, {"w": "to", "b": [0.4609, 0.3397, 0.4756, 0.3536]}, {"w": "read", "b": [0.4801, 0.3397, 0.5142, 0.3536]}, {"w": "images", "b": [0.5186, 0.3397, 0.5707, 0.3536]}, {"w": "from", "b": [0.5752, 0.3397, 0.6122, 0.3536]}, {"w": "directories", "b": [0.6166, 0.3397, 0.697, 0.3536]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.preprocessing.image import ImageDataGenerator train_datagen = ImageDataGenerator(rescale=1./255) 1 test_datagen = ImageDataGenerator(rescale=1./255) 1 train_generator = train_datagen.flow_from_directory( train_dir, 2 target_size=(150, 150) 3 batch_size=20, class_mode='binary') 4 validation_generator = test_datagen.flow_from_directory( validation_dir, target_size=(150, 150), batch_size=20, class_mode='binary')", "words": [{"w": "from", "b": [0.1348, 0.3671, 0.1773, 0.3813]}, {"w": "keras.preprocessing.image", "b": [0.1879, 0.3671, 0.4536, 0.3813]}, {"w": "import", "b": [0.4642, 0.3671, 0.528, 0.3813]}, {"w": "ImageDataGenerator", "b": [0.5386, 0.3671, 0.7299, 0.3813]}, {"w": "train_datagen", "b": [0.1348, 0.3955, 0.2729, 0.4097]}, {"w": "=", "b": [0.2836, 0.3955, 0.2942, 0.4097]}, {"w": "ImageDataGenerator(rescale=1./255)", "b": [0.3048, 0.3955, 0.6661, 0.4097]}, {"w": "1", "b": [0.8044, 0.3955, 0.815, 0.4097]}, {"w": "test_datagen", "b": [0.1348, 0.4097, 0.2623, 0.4239]}, {"w": "=", "b": [0.2729, 0.4097, 0.2836, 0.4239]}, {"w": "ImageDataGenerator(rescale=1./255)", "b": [0.2942, 0.4097, 0.6555, 0.4239]}, {"w": "1", "b": [0.8044, 0.4097, 0.815, 0.4239]}, {"w": "train_generator", "b": [0.1348, 0.4381, 0.2942, 0.4522]}, {"w": "=", "b": [0.3048, 0.4381, 0.3154, 0.4522]}, {"w": "train_datagen.flow_from_directory(", "b": [0.3261, 0.4381, 0.6874, 0.4522]}, {"w": "train_dir,", "b": [0.2198, 0.4522, 0.3261, 0.4664]}, {"w": "2", "b": [0.8044, 0.4522, 0.815, 0.4664]}, {"w": "target_size=(150,", "b": [0.2198, 0.4664, 0.4004, 0.4806]}, {"w": "150)", "b": [0.4111, 0.4664, 0.4536, 0.4806]}, {"w": "3", "b": [0.8044, 0.4664, 0.815, 0.4806]}, {"w": "batch_size=20,", "b": [0.2198, 0.4806, 0.3686, 0.4948]}, {"w": "class_mode='binary')", "b": [0.2198, 0.4948, 0.4323, 0.509]}, {"w": "4", "b": [0.8044, 0.4948, 0.815, 0.509]}, {"w": "validation_generator", "b": [0.1348, 0.5232, 0.3473, 0.5373]}, {"w": "=", "b": [0.3579, 0.5232, 0.3686, 0.5373]}, {"w": "test_datagen.flow_from_directory(", "b": [0.3792, 0.5232, 0.7299, 0.5373]}, {"w": "validation_dir,", "b": [0.2198, 0.5374, 0.3792, 0.5515]}, {"w": "target_size=(150,", "b": [0.2198, 0.5515, 0.4004, 0.5657]}, {"w": "150),", "b": [0.4111, 0.5515, 0.4642, 0.5657]}, {"w": "batch_size=20,", "b": [0.2198, 0.5657, 0.3686, 0.5799]}, {"w": "class_mode='binary')", "b": [0.2198, 0.5799, 0.4323, 0.5941]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Rescales all images by 1/255 2 Target directory 3 Resizes all images to 150 × 150 4 Because you use binary_crossentropy loss, you need binary labels.", "words": [{"w": "1", "b": [0.1761, 0.6113, 0.1879, 0.6298]}, {"w": "Rescales", "b": [0.1938, 0.6113, 0.2791, 0.6298]}, {"w": "all", "b": [0.285, 0.6113, 0.3099, 0.6298]}, {"w": "images", "b": [0.3158, 0.6113, 0.3853, 0.6298]}, {"w": "by", "b": [0.3912, 0.6113, 0.4162, 0.6298]}, {"w": "1/255", "b": [0.4221, 0.6113, 0.4759, 0.6298]}, {"w": "2", "b": [0.1761, 0.6305, 0.1879, 0.649]}, {"w": "Target", "b": [0.1938, 0.6305, 0.2598, 0.649]}, {"w": "directory", "b": [0.2658, 0.6305, 0.3584, 0.649]}, {"w": "3", "b": [0.1761, 0.6497, 0.1879, 0.6682]}, {"w": "Resizes", "b": [0.1938, 0.6497, 0.2673, 0.6682]}, {"w": "all", "b": [0.2732, 0.6497, 0.2981, 0.6682]}, {"w": "images", "b": [0.304, 0.6497, 0.3735, 0.6682]}, {"w": "to", "b": [0.3794, 0.6497, 0.3991, 0.6682]}, {"w": "150", "b": [0.405, 0.6497, 0.4404, 0.6682]}, {"w": "×", "b": [0.4463, 0.6497, 0.4598, 0.6682]}, {"w": "150", "b": [0.4657, 0.6497, 0.5011, 0.6682]}, {"w": "4", "b": [0.1761, 0.6689, 0.1879, 0.6874]}, {"w": "Because", "b": [0.1938, 0.6689, 0.2751, 0.6874]}, {"w": "you", "b": [0.281, 0.6689, 0.3178, 0.6874]}, {"w": "use", "b": [0.3237, 0.6689, 0.3565, 0.6874]}, {"w": "binary_crossentropy", "b": [0.3624, 0.6689, 0.5701, 0.6874]}, {"w": "loss,", "b": [0.576, 0.6689, 0.6187, 0.6874]}, {"w": "you", "b": [0.6246, 0.6689, 0.6613, 0.6874]}, {"w": "need", "b": [0.6672, 0.6689, 0.7145, 0.6874]}, {"w": "binary", "b": [0.7204, 0.6689, 0.7873, 0.6874]}, {"w": "labels.", "b": [0.7932, 0.6689, 0.8568, 0.6874]}]}, {"id": "b_5", "type": "paragraph", "text": "Understanding Python generators", "words": [{"w": "Understanding", "b": [0.1289, 0.7131, 0.2798, 0.7316]}, {"w": "Python", "b": [0.2857, 0.7131, 0.3578, 0.7316]}, {"w": "generators", "b": [0.3637, 0.7131, 0.4713, 0.7316]}]}, {"id": "b_6", "type": "paragraph", "text": "A Python generator is an object that acts as an iterator: it’s an object you can use with the for ... in operator. Generators are built using the yield operator.", "words": [{"w": "A", "b": [0.1289, 0.7532, 0.1459, 0.7717]}, {"w": "Python", "b": [0.1518, 0.7532, 0.2187, 0.7717]}, {"w": "generator", "b": [0.2246, 0.7532, 0.3178, 0.7717]}, {"w": "is", "b": [0.3236, 0.7532, 0.3394, 0.7717]}, {"w": "an", "b": [0.3453, 0.7532, 0.3676, 0.7717]}, {"w": "object", "b": [0.3735, 0.7532, 0.4312, 0.7717]}, {"w": "that", "b": [0.4371, 0.7532, 0.4725, 0.7717]}, {"w": "acts", "b": [0.4784, 0.7532, 0.5152, 0.7717]}, {"w": "as", "b": [0.5211, 0.7532, 0.5407, 0.7717]}, {"w": "an", "b": [0.5466, 0.7532, 0.5689, 0.7717]}, {"w": "iterator:", "b": [0.5748, 0.7532, 0.6496, 0.7717]}, {"w": "it’s", "b": [0.6555, 0.7532, 0.6843, 0.7717]}, {"w": "an", "b": [0.6902, 0.7532, 0.7125, 0.7717]}, {"w": "object", "b": [0.7184, 0.7532, 0.7761, 0.7717]}, {"w": "you", "b": [0.782, 0.7532, 0.8174, 0.7717]}, {"w": "can", "b": [0.8233, 0.7532, 0.8561, 0.7717]}, {"w": "use", "b": [0.1289, 0.7724, 0.1604, 0.7909]}, {"w": "with", "b": [0.1663, 0.7724, 0.2082, 0.7909]}, {"w": "the", "b": [0.2141, 0.7724, 0.243, 0.7909]}, {"w": "for", "b": [0.2489, 0.7733, 0.2914, 0.7923]}, {"w": "...", "b": [0.2973, 0.7733, 0.3398, 0.7923]}, {"w": "in", "b": [0.3457, 0.7733, 0.374, 0.7923]}, {"w": "operator.", "b": [0.3799, 0.7724, 0.4632, 0.7909]}, {"w": "Generators", "b": [0.4691, 0.7724, 0.5727, 0.7909]}, {"w": "are", "b": [0.5786, 0.7724, 0.6075, 0.7909]}, {"w": "built", "b": [0.6134, 0.7724, 0.6567, 0.7909]}, {"w": "using", "b": [0.6626, 0.7724, 0.7138, 0.7909]}, {"w": "the", "b": [0.7197, 0.7724, 0.7485, 0.7909]}, {"w": "yield", "b": [0.7544, 0.7733, 0.8252, 0.7923]}, {"w": "operator.", "b": [0.1289, 0.7924, 0.2122, 0.8109]}]}, {"id": "b_7", "type": "paragraph", "text": "Here is an example of a generator that yields integers:", "words": [{"w": "Here", "b": [0.1289, 0.8324, 0.1748, 0.8509]}, {"w": "is", "b": [0.1807, 0.8324, 0.1964, 0.8509]}, {"w": "an", "b": [0.2023, 0.8324, 0.2246, 0.8509]}, {"w": "example", "b": [0.2305, 0.8324, 0.3105, 0.8509]}, {"w": "of", "b": [0.3164, 0.8324, 0.3361, 0.8509]}, {"w": "a", "b": [0.342, 0.8324, 0.3525, 0.8509]}, {"w": "generator", "b": [0.3584, 0.8324, 0.4476, 0.8509]}, {"w": "that", "b": [0.4535, 0.8324, 0.4889, 0.8509]}, {"w": "yields", "b": [0.4948, 0.8324, 0.5512, 0.8509]}, {"w": "integers:", "b": [0.5571, 0.8324, 0.6384, 0.8509]}]}, {"id": "b_8", "type": "equation", "text": "def generator(): i = 0 while True:", "words": [{"w": "def", "b": [0.1348, 0.8678, 0.1667, 0.882]}, {"w": "generator():", "b": [0.1773, 0.8678, 0.3048, 0.882]}, {"w": "i", "b": [0.1773, 0.882, 0.1879, 0.8961]}, {"w": "=", "b": [0.1985, 0.882, 0.2092, 0.8961]}, {"w": "0", "b": [0.2198, 0.882, 0.2304, 0.8961]}, {"w": "while", "b": [0.1773, 0.8961, 0.2304, 0.9103]}, {"w": "True:", "b": [0.241, 0.8961, 0.2942, 0.9103]}]}]}, {"page": 190, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "i += 1 yield i for item in generator(): print(item) if item > 4: break", "words": [{"w": "i", "b": [0.2198, 0.0851, 0.2304, 0.0993]}, {"w": "+=", "b": [0.241, 0.0851, 0.2623, 0.0993]}, {"w": "1", "b": [0.2729, 0.0851, 0.2836, 0.0993]}, {"w": "yield", "b": [0.2198, 0.0993, 0.2729, 0.1135]}, {"w": "i", "b": [0.2836, 0.0993, 0.2942, 0.1135]}, {"w": "for", "b": [0.1348, 0.1277, 0.1667, 0.1418]}, {"w": "item", "b": [0.1773, 0.1277, 0.2198, 0.1418]}, {"w": "in", "b": [0.2304, 0.1277, 0.2517, 0.1418]}, {"w": "generator():", "b": [0.2623, 0.1277, 0.3898, 0.1418]}, {"w": "print(item)", "b": [0.1773, 0.1419, 0.2942, 0.156]}, {"w": "if", "b": [0.1773, 0.156, 0.1985, 0.1702]}, {"w": "item", "b": [0.2092, 0.156, 0.2517, 0.1702]}, {"w": ">", "b": [0.2623, 0.156, 0.2729, 0.1702]}, {"w": "4:", "b": [0.2836, 0.156, 0.3048, 0.1702]}, {"w": "break", "b": [0.2198, 0.1702, 0.2729, 0.1844]}]}, {"id": "b_1", "type": "paragraph", "text": "It prints this:", "words": [{"w": "It", "b": [0.1289, 0.2058, 0.1433, 0.2243]}, {"w": "prints", "b": [0.1492, 0.2058, 0.203, 0.2243]}, {"w": "this:", "b": [0.2089, 0.2058, 0.2496, 0.2243]}]}, {"id": "b_2", "type": "paragraph", "text": "1 2 3 4 5", "words": [{"w": "1", "b": [0.1348, 0.2411, 0.1454, 0.2553]}, {"w": "2", "b": [0.156, 0.2411, 0.1667, 0.2553]}, {"w": "3", "b": [0.1773, 0.2411, 0.1879, 0.2553]}, {"w": "4", "b": [0.1985, 0.2411, 0.2092, 0.2553]}, {"w": "5", "b": [0.2198, 0.2411, 0.2304, 0.2553]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s look at the output of one of these generators: it yields batches of 150 × 150 RGB images (shape (20, 150, 150, 3)) and binary labels (shape (20,)). There are 20 samples in each batch (the batch size). Note that the generator yields these batches indefinitely: it loops endlessly over the images in the target folder. For this reason, you need to break the iteration loop at some point:", "words": [{"w": "Let’s", "b": [0.1289, 0.2976, 0.1761, 0.3161]}, {"w": "look", "b": [0.182, 0.2976, 0.224, 0.3161]}, {"w": "at", "b": [0.2299, 0.2976, 0.2469, 0.3161]}, {"w": "the", "b": [0.2528, 0.2976, 0.2817, 0.3161]}, {"w": "output", "b": [0.2876, 0.2976, 0.348, 0.3161]}, {"w": "of", "b": [0.3539, 0.2976, 0.3735, 0.3161]}, {"w": "one", "b": [0.3794, 0.2976, 0.4135, 0.3161]}, {"w": "of", "b": [0.4194, 0.2976, 0.4391, 0.3161]}, {"w": "these", "b": [0.445, 0.2976, 0.4935, 0.3161]}, {"w": "generators:", "b": [0.4994, 0.2976, 0.6044, 0.3161]}, {"w": "it", "b": [0.6103, 0.2976, 0.6234, 0.3161]}, {"w": "yields", "b": [0.6293, 0.2976, 0.6857, 0.3161]}, {"w": "batches", "b": [0.6916, 0.2976, 0.7624, 0.3161]}, {"w": "of", "b": [0.7683, 0.2976, 0.788, 0.3161]}, {"w": "150", "b": [0.7939, 0.2976, 0.8293, 0.3161]}, {"w": "×", "b": [0.8352, 0.2976, 0.8486, 0.3161]}, {"w": "150", "b": [0.1289, 0.3168, 0.1643, 0.3353]}, {"w": "RGB", "b": [0.1702, 0.3168, 0.2188, 0.3353]}, {"w": "images", "b": [0.2247, 0.3168, 0.2916, 0.3353]}, {"w": "(shape", "b": [0.2975, 0.3168, 0.3591, 0.3353]}, {"w": "(20,", "b": [0.365, 0.3178, 0.4217, 0.3367]}, {"w": "150,", "b": [0.4358, 0.3178, 0.4925, 0.3367]}, {"w": "150,", "b": [0.5067, 0.3178, 0.5634, 0.3367]}, {"w": "3))", "b": [0.5775, 0.3168, 0.6138, 0.3367]}, {"w": "and", "b": [0.6197, 0.3168, 0.6538, 0.3353]}, {"w": "binary", "b": [0.6597, 0.3168, 0.72, 0.3353]}, {"w": "labels", "b": [0.7259, 0.3168, 0.781, 0.3353]}, {"w": "(shape", "b": [0.7869, 0.3168, 0.8485, 0.3353]}, {"w": "(20,)).", "b": [0.1289, 0.3368, 0.2135, 0.3567]}, {"w": "There", "b": [0.2194, 0.3368, 0.2745, 0.3553]}, {"w": "are", "b": [0.2804, 0.3368, 0.3092, 0.3553]}, {"w": "20", "b": [0.3151, 0.3368, 0.3387, 0.3553]}, {"w": "samples", "b": [0.3446, 0.3368, 0.4207, 0.3553]}, {"w": "in", "b": [0.4266, 0.3368, 0.445, 0.3553]}, {"w": "each", "b": [0.4509, 0.3368, 0.4941, 0.3553]}, {"w": "batch", "b": [0.5, 0.3368, 0.5512, 0.3553]}, {"w": "(the", "b": [0.5571, 0.3368, 0.5938, 0.3553]}, {"w": "batch", "b": [0.5997, 0.3368, 0.6509, 0.3553]}, {"w": "size).", "b": [0.6568, 0.3368, 0.7073, 0.3553]}, {"w": "Note", "b": [0.7132, 0.3368, 0.7591, 0.3553]}, {"w": "that", "b": [0.765, 0.3368, 0.8004, 0.3553]}, {"w": "the", "b": [0.8063, 0.3368, 0.8352, 0.3553]}, {"w": "generator", "b": [0.1289, 0.3568, 0.218, 0.3753]}, {"w": "yields", "b": [0.2239, 0.3568, 0.2804, 0.3753]}, {"w": "these", "b": [0.2863, 0.3568, 0.3348, 0.3753]}, {"w": "batches", "b": [0.3407, 0.3568, 0.4115, 0.3753]}, {"w": "indefinitely:", "b": [0.4174, 0.3568, 0.5329, 0.3753]}, {"w": "it", "b": [0.5388, 0.3568, 0.5519, 0.3753]}, {"w": "loops", "b": [0.5578, 0.3568, 0.609, 0.3753]}, {"w": "endlessly", "b": [0.6149, 0.3568, 0.7028, 0.3753]}, {"w": "over", "b": [0.7087, 0.3568, 0.7507, 0.3753]}, {"w": "the", "b": [0.7565, 0.3568, 0.7853, 0.3753]}, {"w": "images", "b": [0.7912, 0.3568, 0.8581, 0.3753]}, {"w": "in", "b": [0.1289, 0.376, 0.1472, 0.3945]}, {"w": "the", "b": [0.1532, 0.376, 0.182, 0.3945]}, {"w": "target", "b": [0.1879, 0.376, 0.2412, 0.3945]}, {"w": "folder.", "b": [0.2471, 0.376, 0.3081, 0.3945]}, {"w": "For", "b": [0.314, 0.376, 0.3468, 0.3945]}, {"w": "this", "b": [0.3527, 0.376, 0.3869, 0.3945]}, {"w": "reason,", "b": [0.3928, 0.376, 0.4603, 0.3945]}, {"w": "you", "b": [0.4662, 0.376, 0.5016, 0.3945]}, {"w": "need", "b": [0.5075, 0.376, 0.5521, 0.3945]}, {"w": "to", "b": [0.558, 0.376, 0.5764, 0.3945]}, {"w": "break", "b": [0.5823, 0.377, 0.6531, 0.3959]}, {"w": "the", "b": [0.659, 0.376, 0.6879, 0.3945]}, {"w": "iteration", "b": [0.6938, 0.376, 0.7725, 0.3945]}, {"w": "loop", "b": [0.7784, 0.376, 0.8204, 0.3945]}, {"w": "at", "b": [0.8263, 0.376, 0.8433, 0.3945]}, {"w": "some", "b": [0.1289, 0.3961, 0.1787, 0.4145]}, {"w": "point:", "b": [0.1846, 0.3961, 0.2397, 0.4145]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> for data_batch, labels_batch in train_generator: >>> print('data batch shape:', data_batch.shape) >>> print('labels batch shape:', labels_batch.shape) >>> break data batch shape: (20, 150, 150, 3) labels batch shape: (20,)", "words": [{"w": ">>>", "b": [0.1348, 0.4314, 0.1667, 0.4456]}, {"w": "for", "b": [0.1773, 0.4314, 0.2092, 0.4456]}, {"w": "data_batch,", "b": [0.2198, 0.4314, 0.3367, 0.4456]}, {"w": "labels_batch", "b": [0.3473, 0.4314, 0.4748, 0.4456]}, {"w": "in", "b": [0.4855, 0.4314, 0.5067, 0.4456]}, {"w": "train_generator:", "b": [0.5173, 0.4314, 0.6874, 0.4456]}, {"w": ">>>", "b": [0.1348, 0.4456, 0.1667, 0.4597]}, {"w": "print('data", "b": [0.2198, 0.4456, 0.3367, 0.4597]}, {"w": "batch", "b": [0.3473, 0.4456, 0.4004, 0.4597]}, {"w": "shape:',", "b": [0.4111, 0.4456, 0.4961, 0.4597]}, {"w": "data_batch.shape)", "b": [0.5067, 0.4456, 0.6874, 0.4597]}, {"w": ">>>", "b": [0.1348, 0.4598, 0.1667, 0.4739]}, {"w": "print('labels", "b": [0.2198, 0.4598, 0.3579, 0.4739]}, {"w": "batch", "b": [0.3686, 0.4598, 0.4217, 0.4739]}, {"w": "shape:',", "b": [0.4323, 0.4598, 0.5173, 0.4739]}, {"w": "labels_batch.shape)", "b": [0.528, 0.4598, 0.7299, 0.4739]}, {"w": ">>>", "b": [0.1348, 0.4739, 0.1667, 0.4881]}, {"w": "break", "b": [0.2198, 0.4739, 0.2729, 0.4881]}, {"w": "data", "b": [0.1348, 0.4881, 0.1773, 0.5023]}, {"w": "batch", "b": [0.1879, 0.4881, 0.241, 0.5023]}, {"w": "shape:", "b": [0.2517, 0.4881, 0.3154, 0.5023]}, {"w": "(20,", "b": [0.3261, 0.4881, 0.3686, 0.5023]}, {"w": "150,", "b": [0.3792, 0.4881, 0.4217, 0.5023]}, {"w": "150,", "b": [0.4323, 0.4881, 0.4748, 0.5023]}, {"w": "3)", "b": [0.4855, 0.4881, 0.5067, 0.5023]}, {"w": "labels", "b": [0.1348, 0.5023, 0.1985, 0.5165]}, {"w": "batch", "b": [0.2092, 0.5023, 0.2623, 0.5165]}, {"w": "shape:", "b": [0.2729, 0.5023, 0.3367, 0.5165]}, {"w": "(20,)", "b": [0.3473, 0.5023, 0.4004, 0.5165]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s fit the model to the data using the generator. You do so using the fit_generator method, the equivalent of fit for data generators like this one. It expects as its first argument a Python generator that will yield batches of inputs and targets indefinitely, like this one does. Because the data is being generated endlessly, the Keras model needs to know how many samples to draw from the generator before declaring an epoch over. This is the role of the steps_per_epoch argument: after having drawn steps_per_epoch batches from the generator—that is, after having run for steps_per_epoch gradient descent steps—the fitting process will go to the next epoch. In this case, batches are 20 samples, so it will take 100 batches until you see your target of 2,000 samples.", "words": [{"w": "Let’s", "b": [0.1289, 0.5379, 0.1761, 0.5564]}, {"w": "fit", "b": [0.182, 0.5379, 0.203, 0.5564]}, {"w": "the", "b": [0.2089, 0.5379, 0.2377, 0.5564]}, {"w": "model", "b": [0.2437, 0.5379, 0.3027, 0.5564]}, {"w": "to", "b": [0.3086, 0.5379, 0.327, 0.5564]}, {"w": "the", "b": [0.3329, 0.5379, 0.3617, 0.5564]}, {"w": "data", "b": [0.3676, 0.5379, 0.407, 0.5564]}, {"w": "using", "b": [0.4129, 0.5379, 0.464, 0.5564]}, {"w": "the", "b": [0.47, 0.5379, 0.4988, 0.5564]}, {"w": "generator.", "b": [0.5047, 0.5379, 0.5984, 0.5564]}, {"w": "You", "b": [0.6043, 0.5379, 0.6426, 0.5564]}, {"w": "do", "b": [0.6485, 0.5379, 0.6721, 0.5564]}, {"w": "so", "b": [0.678, 0.5379, 0.699, 0.5564]}, {"w": "using", "b": [0.7049, 0.5379, 0.7561, 0.5564]}, {"w": "the", "b": [0.762, 0.5379, 0.7909, 0.5564]}, {"w": "fit_generator", "b": [0.1289, 0.5581, 0.3131, 0.577]}, {"w": "method,", "b": [0.319, 0.5571, 0.3957, 0.5756]}, {"w": "the", "b": [0.4016, 0.5571, 0.4305, 0.5756]}, {"w": "equivalent", "b": [0.4364, 0.5571, 0.5348, 0.5756]}, {"w": "of", "b": [0.5407, 0.5571, 0.5604, 0.5756]}, {"w": "fit", "b": [0.5662, 0.5581, 0.6087, 0.577]}, {"w": "for", "b": [0.6146, 0.5571, 0.6422, 0.5756]}, {"w": "data", "b": [0.6481, 0.5571, 0.6874, 0.5756]}, {"w": "generators", "b": [0.6933, 0.5571, 0.7917, 0.5756]}, {"w": "like", "b": [0.7976, 0.5571, 0.833, 0.5756]}, {"w": "this", "b": [0.1289, 0.5771, 0.163, 0.5956]}, {"w": "one.", "b": [0.1689, 0.5771, 0.2089, 0.5956]}, {"w": "It", "b": [0.2148, 0.5771, 0.2292, 0.5956]}, {"w": "expects", "b": [0.2351, 0.5771, 0.306, 0.5956]}, {"w": "as", "b": [0.3119, 0.5771, 0.3315, 0.5956]}, {"w": "its", "b": [0.3374, 0.5771, 0.3598, 0.5956]}, {"w": "first", "b": [0.3657, 0.5771, 0.4037, 0.5956]}, {"w": "argument", "b": [0.4096, 0.5771, 0.4983, 0.5956]}, {"w": "a", "b": [0.5042, 0.5771, 0.5147, 0.5956]}, {"w": "Python", "b": [0.5206, 0.5771, 0.5876, 0.5956]}, {"w": "generator", "b": [0.5935, 0.5771, 0.6826, 0.5956]}, {"w": "that", "b": [0.6885, 0.5771, 0.724, 0.5956]}, {"w": "will", "b": [0.7299, 0.5771, 0.7666, 0.5956]}, {"w": "yield", "b": [0.7725, 0.5771, 0.8197, 0.5956]}, {"w": "batches", "b": [0.1289, 0.5963, 0.1997, 0.6148]}, {"w": "of", "b": [0.2056, 0.5963, 0.2253, 0.6148]}, {"w": "inputs", "b": [0.2312, 0.5963, 0.2889, 0.6148]}, {"w": "and", "b": [0.2948, 0.5963, 0.3289, 0.6148]}, {"w": "targets", "b": [0.3348, 0.5963, 0.3973, 0.6148]}, {"w": "indefinitely,", "b": [0.4032, 0.5963, 0.5164, 0.6148]}, {"w": "like", "b": [0.5223, 0.5963, 0.5578, 0.6148]}, {"w": "this", "b": [0.5637, 0.5963, 0.5978, 0.6148]}, {"w": "one", "b": [0.6037, 0.5963, 0.6378, 0.6148]}, {"w": "does.", "b": [0.6437, 0.5963, 0.6929, 0.6148]}, {"w": "Because", "b": [0.6988, 0.5963, 0.7775, 0.6148]}, {"w": "the", "b": [0.7834, 0.5963, 0.8122, 0.6148]}, {"w": "data", "b": [0.8181, 0.5963, 0.8575, 0.6148]}, {"w": "is", "b": [0.1289, 0.6155, 0.1446, 0.634]}, {"w": "being", "b": [0.1505, 0.6155, 0.203, 0.634]}, {"w": "generated", "b": [0.2089, 0.6155, 0.3007, 0.634]}, {"w": "endlessly,", "b": [0.3066, 0.6155, 0.3988, 0.634]}, {"w": "the", "b": [0.4047, 0.6155, 0.4336, 0.634]}, {"w": "Keras", "b": [0.4395, 0.6155, 0.4946, 0.634]}, {"w": "model", "b": [0.5005, 0.6155, 0.5595, 0.634]}, {"w": "needs", "b": [0.5654, 0.6155, 0.6192, 0.634]}, {"w": "to", "b": [0.6251, 0.6155, 0.6435, 0.634]}, {"w": "know", "b": [0.6494, 0.6155, 0.7018, 0.634]}, {"w": "how", "b": [0.7077, 0.6155, 0.7484, 0.634]}, {"w": "many", "b": [0.7543, 0.6155, 0.8068, 0.634]}, {"w": "samples", "b": [0.1289, 0.6347, 0.205, 0.6532]}, {"w": "to", "b": [0.2109, 0.6347, 0.2292, 0.6532]}, {"w": "draw", "b": [0.2351, 0.6347, 0.2823, 0.6532]}, {"w": "from", "b": [0.2883, 0.6347, 0.3342, 0.6532]}, {"w": "the", "b": [0.3401, 0.6347, 0.3689, 0.6532]}, {"w": "generator", "b": [0.3748, 0.6347, 0.464, 0.6532]}, {"w": "before", "b": [0.4699, 0.6347, 0.5302, 0.6532]}, {"w": "declaring", "b": [0.5361, 0.6347, 0.624, 0.6532]}, {"w": "an", "b": [0.6299, 0.6347, 0.6522, 0.6532]}, {"w": "epoch", "b": [0.6581, 0.6347, 0.7145, 0.6532]}, {"w": "over.", "b": [0.7204, 0.6347, 0.7669, 0.6532]}, {"w": "This", "b": [0.7728, 0.6347, 0.8148, 0.6532]}, {"w": "is", "b": [0.8207, 0.6347, 0.8364, 0.6532]}, {"w": "the", "b": [0.8423, 0.6347, 0.8712, 0.6532]}, {"w": "role", "b": [0.1289, 0.6539, 0.1656, 0.6724]}, {"w": "of", "b": [0.1715, 0.6539, 0.1912, 0.6724]}, {"w": "the", "b": [0.1971, 0.6539, 0.2259, 0.6724]}, {"w": "steps_per_epoch", "b": [0.2318, 0.6549, 0.4444, 0.6738]}, {"w": "argument:", "b": [0.4503, 0.6539, 0.5456, 0.6724]}, {"w": "after", "b": [0.5515, 0.6539, 0.5948, 0.6724]}, {"w": "having", "b": [0.6007, 0.6539, 0.665, 0.6724]}, {"w": "drawn", "b": [0.6709, 0.6539, 0.7299, 0.6724]}, {"w": "steps_per_epoch", "b": [0.1289, 0.6749, 0.3414, 0.6938]}, {"w": "batches", "b": [0.3473, 0.6739, 0.4182, 0.6924]}, {"w": "from", "b": [0.4241, 0.6739, 0.47, 0.6924]}, {"w": "the", "b": [0.4759, 0.6739, 0.5047, 0.6924]}, {"w": "generator—that", "b": [0.5106, 0.6739, 0.6588, 0.6924]}, {"w": "is,", "b": [0.6647, 0.6739, 0.6864, 0.6924]}, {"w": "after", "b": [0.6923, 0.6739, 0.7356, 0.6924]}, {"w": "having", "b": [0.7415, 0.6739, 0.8057, 0.6924]}, {"w": "run", "b": [0.8116, 0.6739, 0.8431, 0.6924]}, {"w": "for", "b": [0.1289, 0.6939, 0.1564, 0.7124]}, {"w": "steps_per_epoch", "b": [0.1623, 0.6949, 0.3748, 0.7138]}, {"w": "gradient", "b": [0.3808, 0.6939, 0.4581, 0.7124]}, {"w": "descent", "b": [0.464, 0.6939, 0.5349, 0.7124]}, {"w": "steps—the", "b": [0.5408, 0.6939, 0.6405, 0.7124]}, {"w": "fitting", "b": [0.6464, 0.6939, 0.7041, 0.7124]}, {"w": "process", "b": [0.71, 0.6939, 0.7808, 0.7124]}, {"w": "will", "b": [0.7867, 0.6939, 0.8235, 0.7124]}, {"w": "go", "b": [0.8294, 0.6939, 0.853, 0.7124]}, {"w": "to", "b": [0.1289, 0.714, 0.1472, 0.7324]}, {"w": "the", "b": [0.1532, 0.714, 0.182, 0.7324]}, {"w": "next", "b": [0.1879, 0.714, 0.2286, 0.7324]}, {"w": "epoch.", "b": [0.2345, 0.714, 0.2968, 0.7324]}, {"w": "In", "b": [0.3027, 0.714, 0.3224, 0.7324]}, {"w": "this", "b": [0.3283, 0.714, 0.3624, 0.7324]}, {"w": "case,", "b": [0.3683, 0.714, 0.4148, 0.7324]}, {"w": "batches", "b": [0.4207, 0.714, 0.4916, 0.7324]}, {"w": "are", "b": [0.4975, 0.714, 0.5263, 0.7324]}, {"w": "20", "b": [0.5322, 0.714, 0.5558, 0.7324]}, {"w": "samples,", "b": [0.5617, 0.714, 0.6437, 0.7324]}, {"w": "so", "b": [0.6496, 0.714, 0.6706, 0.7324]}, {"w": "it", "b": [0.6765, 0.714, 0.6896, 0.7324]}, {"w": "will", "b": [0.6955, 0.714, 0.7323, 0.7324]}, {"w": "take", "b": [0.7382, 0.714, 0.7775, 0.7324]}, {"w": "100", "b": [0.7833, 0.714, 0.8188, 0.7324]}, {"w": "batches", "b": [0.1289, 0.7332, 0.1997, 0.7516]}, {"w": "until", "b": [0.2056, 0.7332, 0.2489, 0.7516]}, {"w": "you", "b": [0.2548, 0.7332, 0.2902, 0.7516]}, {"w": "see", "b": [0.2961, 0.7332, 0.3263, 0.7516]}, {"w": "your", "b": [0.3322, 0.7332, 0.3755, 0.7516]}, {"w": "target", "b": [0.3814, 0.7332, 0.4347, 0.7516]}, {"w": "of", "b": [0.4406, 0.7332, 0.4603, 0.7516]}, {"w": "2,000", "b": [0.4662, 0.7332, 0.5193, 0.7516]}, {"w": "samples.", "b": [0.5252, 0.7332, 0.6072, 0.7516]}]}, {"id": "b_6", "type": "paragraph", "text": "When using fit_generator, you can pass a validation_data argument, much as with the fit method. It’s important to note that this argument is allowed to be a data generator, but it could also be a tuple of Numpy arrays. If you pass a generator as validation_data, then this generator is expected to yield batches of validation data endlessly; thus you should also specify the validation_steps argument, which tells the", "words": [{"w": "When", "b": [0.1289, 0.7732, 0.1853, 0.7917]}, {"w": "using", "b": [0.1912, 0.7732, 0.2423, 0.7917]}, {"w": "fit_generator,", "b": [0.2482, 0.7732, 0.4384, 0.7931]}, {"w": "you", "b": [0.4443, 0.7732, 0.4797, 0.7917]}, {"w": "can", "b": [0.4856, 0.7732, 0.5184, 0.7917]}, {"w": "pass", "b": [0.5243, 0.7732, 0.5649, 0.7917]}, {"w": "a", "b": [0.5708, 0.7732, 0.5813, 0.7917]}, {"w": "validation_data", "b": [0.5872, 0.7742, 0.7997, 0.7931]}, {"w": "argument,", "b": [0.1289, 0.7932, 0.2235, 0.8117]}, {"w": "much", "b": [0.2294, 0.7932, 0.2819, 0.8117]}, {"w": "as", "b": [0.2878, 0.7932, 0.3075, 0.8117]}, {"w": "with", "b": [0.3134, 0.7932, 0.3554, 0.8117]}, {"w": "the", "b": [0.3613, 0.7932, 0.3901, 0.8117]}, {"w": "fit", "b": [0.396, 0.7942, 0.4385, 0.8131]}, {"w": "method.", "b": [0.4444, 0.7932, 0.5212, 0.8117]}, {"w": "It’s", "b": [0.5271, 0.7932, 0.5572, 0.8117]}, {"w": "important", "b": [0.5631, 0.7932, 0.655, 0.8117]}, {"w": "to", "b": [0.6609, 0.7932, 0.6793, 0.8117]}, {"w": "note", "b": [0.6852, 0.7932, 0.7258, 0.8117]}, {"w": "that", "b": [0.7317, 0.7932, 0.7672, 0.8117]}, {"w": "this", "b": [0.7731, 0.7932, 0.8072, 0.8117]}, {"w": "argument", "b": [0.1289, 0.8133, 0.2176, 0.8317]}, {"w": "is", "b": [0.2235, 0.8133, 0.2393, 0.8317]}, {"w": "allowed", "b": [0.2452, 0.8133, 0.32, 0.8317]}, {"w": "to", "b": [0.3259, 0.8133, 0.3442, 0.8317]}, {"w": "be", "b": [0.3501, 0.8133, 0.3724, 0.8317]}, {"w": "a", "b": [0.3783, 0.8133, 0.3888, 0.8317]}, {"w": "data", "b": [0.3947, 0.8133, 0.4341, 0.8317]}, {"w": "generator,", "b": [0.44, 0.8133, 0.534, 0.8317]}, {"w": "but", "b": [0.5399, 0.8133, 0.5701, 0.8317]}, {"w": "it", "b": [0.576, 0.8133, 0.5892, 0.8317]}, {"w": "could", "b": [0.5951, 0.8133, 0.6475, 0.8317]}, {"w": "also", "b": [0.6534, 0.8133, 0.6915, 0.8317]}, {"w": "be", "b": [0.6974, 0.8133, 0.7197, 0.8317]}, {"w": "a", "b": [0.7256, 0.8133, 0.7361, 0.8317]}, {"w": "tuple", "b": [0.742, 0.8133, 0.7892, 0.8317]}, {"w": "of", "b": [0.7951, 0.8133, 0.8148, 0.8317]}, {"w": "Numpy", "b": [0.1289, 0.8324, 0.1997, 0.8509]}, {"w": "arrays.", "b": [0.2056, 0.8324, 0.2692, 0.8509]}, {"w": "If", "b": [0.2751, 0.8324, 0.2908, 0.8509]}, {"w": "you", "b": [0.2968, 0.8324, 0.3322, 0.8509]}, {"w": "pass", "b": [0.3381, 0.8324, 0.3787, 0.8509]}, {"w": "a", "b": [0.3846, 0.8324, 0.3951, 0.8509]}, {"w": "generator", "b": [0.401, 0.8324, 0.4902, 0.8509]}, {"w": "as", "b": [0.4961, 0.8324, 0.5158, 0.8509]}, {"w": "validation_data,", "b": [0.5217, 0.8324, 0.7401, 0.8523]}, {"w": "then", "b": [0.746, 0.8324, 0.7867, 0.8509]}, {"w": "this", "b": [0.7926, 0.8324, 0.8267, 0.8509]}, {"w": "generator", "b": [0.1289, 0.8525, 0.218, 0.871]}, {"w": "is", "b": [0.2239, 0.8525, 0.2397, 0.871]}, {"w": "expected", "b": [0.2456, 0.8525, 0.3295, 0.871]}, {"w": "to", "b": [0.3354, 0.8525, 0.3538, 0.871]}, {"w": "yield", "b": [0.3597, 0.8525, 0.4069, 0.871]}, {"w": "batches", "b": [0.4128, 0.8525, 0.4837, 0.871]}, {"w": "of", "b": [0.4896, 0.8525, 0.5092, 0.871]}, {"w": "validation", "b": [0.5151, 0.8525, 0.6096, 0.871]}, {"w": "data", "b": [0.6155, 0.8525, 0.6548, 0.871]}, {"w": "endlessly;", "b": [0.6608, 0.8525, 0.7552, 0.871]}, {"w": "thus", "b": [0.7611, 0.8525, 0.8005, 0.871]}, {"w": "you", "b": [0.8064, 0.8525, 0.8418, 0.871]}, {"w": "should", "b": [0.1289, 0.8717, 0.1919, 0.8901]}, {"w": "also", "b": [0.1978, 0.8717, 0.2358, 0.8901]}, {"w": "specify", "b": [0.2417, 0.8717, 0.3099, 0.8901]}, {"w": "the", "b": [0.3158, 0.8717, 0.3447, 0.8901]}, {"w": "validation_steps", "b": [0.3505, 0.8726, 0.5772, 0.8915]}, {"w": "argument,", "b": [0.5832, 0.8717, 0.6779, 0.8901]}, {"w": "which", "b": [0.6838, 0.8717, 0.7415, 0.8901]}, {"w": "tells", "b": [0.7474, 0.8717, 0.7867, 0.8901]}, {"w": "the", "b": [0.7926, 0.8717, 0.8215, 0.8901]}]}]}, {"page": 191, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "process how many batches to draw from the validation generator for evaluation.", "words": [{"w": "process", "b": [0.1289, 0.0857, 0.1997, 0.1041]}, {"w": "how", "b": [0.2056, 0.0857, 0.2463, 0.1041]}, {"w": "many", "b": [0.2522, 0.0857, 0.3046, 0.1041]}, {"w": "batches", "b": [0.3105, 0.0857, 0.3814, 0.1041]}, {"w": "to", "b": [0.3873, 0.0857, 0.4056, 0.1041]}, {"w": "draw", "b": [0.4115, 0.0857, 0.4588, 0.1041]}, {"w": "from", "b": [0.4647, 0.0857, 0.5106, 0.1041]}, {"w": "the", "b": [0.5165, 0.0857, 0.5453, 0.1041]}, {"w": "validation", "b": [0.5512, 0.0857, 0.6457, 0.1041]}, {"w": "generator", "b": [0.6516, 0.0857, 0.7408, 0.1041]}, {"w": "for", "b": [0.7467, 0.0857, 0.7742, 0.1041]}, {"w": "evaluation.", "b": [0.1289, 0.1049, 0.2332, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 5.8. Fitting the model using a batch generator", "words": [{"w": "Listing", "b": [0.1289, 0.1403, 0.182, 0.1541]}, {"w": "5.8.", "b": [0.1865, 0.1403, 0.213, 0.1541]}, {"w": "Fitting", "b": [0.2174, 0.1403, 0.2686, 0.1541]}, {"w": "the", "b": [0.273, 0.1403, 0.2966, 0.1541]}, {"w": "model", "b": [0.3011, 0.1403, 0.3473, 0.1541]}, {"w": "using", "b": [0.3517, 0.1403, 0.3921, 0.1541]}, {"w": "a", "b": [0.3965, 0.1403, 0.4054, 0.1541]}, {"w": "batch", "b": [0.4098, 0.1403, 0.4521, 0.1541]}, {"w": "generator", "b": [0.4565, 0.1403, 0.5303, 0.1541]}]}, {"id": "b_2", "type": "paragraph", "text": "history = model.fit_generator( train_generator, steps_per_epoch=100, epochs=30, validation_data=validation_generator, validation_steps=50)", "words": [{"w": "history", "b": [0.1348, 0.1669, 0.2092, 0.1811]}, {"w": "=", "b": [0.2198, 0.1669, 0.2304, 0.1811]}, {"w": "model.fit_generator(", "b": [0.241, 0.1669, 0.4536, 0.1811]}, {"w": "train_generator,", "b": [0.1985, 0.1811, 0.3686, 0.1952]}, {"w": "steps_per_epoch=100,", "b": [0.1985, 0.1953, 0.4111, 0.2094]}, {"w": "epochs=30,", "b": [0.1985, 0.2094, 0.3048, 0.2236]}, {"w": "validation_data=validation_generator,", "b": [0.1985, 0.2236, 0.5917, 0.2378]}, {"w": "validation_steps=50)", "b": [0.1985, 0.2378, 0.4111, 0.252]}]}, {"id": "b_3", "type": "paragraph", "text": "It’s good practice to always save your models after training.", "words": [{"w": "It’s", "b": [0.1289, 0.2734, 0.159, 0.2919]}, {"w": "good", "b": [0.165, 0.2734, 0.2122, 0.2919]}, {"w": "practice", "b": [0.2181, 0.2734, 0.2928, 0.2919]}, {"w": "to", "b": [0.2987, 0.2734, 0.3171, 0.2919]}, {"w": "always", "b": [0.323, 0.2734, 0.3886, 0.2919]}, {"w": "save", "b": [0.3945, 0.2734, 0.4365, 0.2919]}, {"w": "your", "b": [0.4424, 0.2734, 0.4856, 0.2919]}, {"w": "models", "b": [0.4915, 0.2734, 0.5598, 0.2919]}, {"w": "after", "b": [0.5657, 0.2734, 0.6089, 0.2919]}, {"w": "training.", "b": [0.6148, 0.2734, 0.6942, 0.2919]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 5.9. Saving the model", "words": [{"w": "Listing", "b": [0.1289, 0.3088, 0.182, 0.3227]}, {"w": "5.9.", "b": [0.1865, 0.3088, 0.213, 0.3227]}, {"w": "Saving", "b": [0.2174, 0.3088, 0.2686, 0.3227]}, {"w": "the", "b": [0.273, 0.3088, 0.2967, 0.3227]}, {"w": "model", "b": [0.3011, 0.3088, 0.3473, 0.3227]}]}, {"id": "b_5", "type": "equation", "text": "model.save('cats_and_dogs_small_1.h5')", "words": [{"w": "model.save('cats_and_dogs_small_1.h5')", "b": [0.1348, 0.3354, 0.5386, 0.3496]}]}, {"id": "b_6", "type": "paragraph", "text": "Let’s plot the loss and accuracy of the model over the training and validation data during training (see figures 5.9 and 5.10).", "words": [{"w": "Let’s", "b": [0.1289, 0.371, 0.1761, 0.3895]}, {"w": "plot", "b": [0.182, 0.371, 0.2187, 0.3895]}, {"w": "the", "b": [0.2246, 0.371, 0.2535, 0.3895]}, {"w": "loss", "b": [0.2594, 0.371, 0.2961, 0.3895]}, {"w": "and", "b": [0.3021, 0.371, 0.3362, 0.3895]}, {"w": "accuracy", "b": [0.3421, 0.371, 0.426, 0.3895]}, {"w": "of", "b": [0.4319, 0.371, 0.4515, 0.3895]}, {"w": "the", "b": [0.4574, 0.371, 0.4863, 0.3895]}, {"w": "model", "b": [0.4922, 0.371, 0.5512, 0.3895]}, {"w": "over", "b": [0.5571, 0.371, 0.5991, 0.3895]}, {"w": "the", "b": [0.605, 0.371, 0.6339, 0.3895]}, {"w": "training", "b": [0.6398, 0.371, 0.7132, 0.3895]}, {"w": "and", "b": [0.7191, 0.371, 0.7532, 0.3895]}, {"w": "validation", "b": [0.7591, 0.371, 0.8536, 0.3895]}, {"w": "data", "b": [0.1289, 0.3902, 0.1682, 0.4087]}, {"w": "during", "b": [0.1741, 0.3902, 0.2358, 0.4087]}, {"w": "training", "b": [0.2417, 0.3902, 0.3151, 0.4087]}, {"w": "(see", "b": [0.3211, 0.3902, 0.3591, 0.4087]}, {"w": "figures", "b": [0.3649, 0.3902, 0.4305, 0.4087]}, {"w": "5.9", "b": [0.4364, 0.3902, 0.4659, 0.4087]}, {"w": "and", "b": [0.4718, 0.3902, 0.5059, 0.4087]}, {"w": "5.10).", "b": [0.5118, 0.3902, 0.5669, 0.4087]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 5.9. Training and validation accuracy", "words": [{"w": "Figure", "b": [0.1289, 0.4298, 0.1787, 0.4437]}, {"w": "5.9.", "b": [0.1832, 0.4298, 0.2097, 0.4437]}, {"w": "Training", "b": [0.2141, 0.4298, 0.2797, 0.4437]}, {"w": "and", "b": [0.2842, 0.4298, 0.3127, 0.4437]}, {"w": "validation", "b": [0.3172, 0.4298, 0.3929, 0.4437]}, {"w": "accuracy", "b": [0.3974, 0.4298, 0.4652, 0.4437]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 5.10. Training and validation loss", "words": [{"w": "Figure", "b": [0.1289, 0.711, 0.1787, 0.7249]}, {"w": "5.10.", "b": [0.1832, 0.711, 0.2186, 0.7249]}, {"w": "Training", "b": [0.223, 0.711, 0.2886, 0.7249]}, {"w": "and", "b": [0.293, 0.711, 0.3216, 0.7249]}, {"w": "validation", "b": [0.326, 0.711, 0.4018, 0.7249]}, {"w": "loss", "b": [0.4062, 0.711, 0.4338, 0.7249]}]}]}, {"page": 192, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 5.10. Displaying curves of loss and accuracy during training", "words": [{"w": "Listing", "b": [0.1289, 0.3355, 0.182, 0.3494]}, {"w": "5.10.", "b": [0.1865, 0.3355, 0.2219, 0.3494]}, {"w": "Displaying", "b": [0.2263, 0.3355, 0.307, 0.3494]}, {"w": "curves", "b": [0.3114, 0.3355, 0.3606, 0.3494]}, {"w": "of", "b": [0.365, 0.3355, 0.3798, 0.3494]}, {"w": "loss", "b": [0.3842, 0.3355, 0.4118, 0.3494]}, {"w": "and", "b": [0.4162, 0.3355, 0.4448, 0.3494]}, {"w": "accuracy", "b": [0.4492, 0.3355, 0.517, 0.3494]}, {"w": "during", "b": [0.5215, 0.3355, 0.5727, 0.3494]}, {"w": "training", "b": [0.5771, 0.3355, 0.6381, 0.3494]}]}, {"id": "b_1", "type": "paragraph", "text": "import matplotlib.pyplot as plt acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(1, len(acc) + 1) plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()", "words": [{"w": "import", "b": [0.1348, 0.3621, 0.1985, 0.3763]}, {"w": "matplotlib.pyplot", "b": [0.2092, 0.3621, 0.3898, 0.3763]}, {"w": "as", "b": [0.4004, 0.3621, 0.4217, 0.3763]}, {"w": "plt", "b": [0.4323, 0.3621, 0.4642, 0.3763]}, {"w": "acc", "b": [0.1348, 0.3905, 0.1667, 0.4047]}, {"w": "=", "b": [0.1773, 0.3905, 0.1879, 0.4047]}, {"w": "history.history['acc']", "b": [0.1985, 0.3905, 0.4323, 0.4047]}, {"w": "val_acc", "b": [0.1348, 0.4047, 0.2092, 0.4189]}, {"w": "=", "b": [0.2198, 0.4047, 0.2304, 0.4189]}, {"w": "history.history['val_acc']", "b": [0.241, 0.4047, 0.5173, 0.4189]}, {"w": "loss", "b": [0.1348, 0.4189, 0.1773, 0.433]}, {"w": "=", "b": [0.1879, 0.4189, 0.1985, 0.433]}, {"w": "history.history['loss']", "b": [0.2092, 0.4189, 0.4536, 0.433]}, {"w": "val_loss", "b": [0.1348, 0.4331, 0.2198, 0.4472]}, {"w": "=", "b": [0.2304, 0.4331, 0.241, 0.4472]}, {"w": "history.history['val_loss']", "b": [0.2517, 0.4331, 0.5386, 0.4472]}, {"w": "epochs", "b": [0.1348, 0.4614, 0.1985, 0.4756]}, {"w": "=", "b": [0.2092, 0.4614, 0.2198, 0.4756]}, {"w": "range(1,", "b": [0.2304, 0.4614, 0.3154, 0.4756]}, {"w": "len(acc)", "b": [0.3261, 0.4614, 0.4111, 0.4756]}, {"w": "+", "b": [0.4217, 0.4614, 0.4323, 0.4756]}, {"w": "1)", "b": [0.443, 0.4614, 0.4642, 0.4756]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.4898, 0.3048, 0.504]}, {"w": "acc,", "b": [0.3154, 0.4898, 0.3579, 0.504]}, {"w": "'bo',", "b": [0.3686, 0.4898, 0.4217, 0.504]}, {"w": "label='Training", "b": [0.4323, 0.4898, 0.5917, 0.504]}, {"w": "acc')", "b": [0.6024, 0.4898, 0.6555, 0.504]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.504, 0.3048, 0.5182]}, {"w": "val_acc,", "b": [0.3154, 0.504, 0.4004, 0.5182]}, {"w": "'b',", "b": [0.4111, 0.504, 0.4536, 0.5182]}, {"w": "label='Validation", "b": [0.4642, 0.504, 0.6449, 0.5182]}, {"w": "acc')", "b": [0.6555, 0.504, 0.7086, 0.5182]}, {"w": "plt.title('Training", "b": [0.1348, 0.5182, 0.3367, 0.5323]}, {"w": "and", "b": [0.3473, 0.5182, 0.3792, 0.5323]}, {"w": "validation", "b": [0.3898, 0.5182, 0.4961, 0.5323]}, {"w": "accuracy')", "b": [0.5067, 0.5182, 0.613, 0.5323]}, {"w": "plt.legend()", "b": [0.1348, 0.5323, 0.2623, 0.5465]}, {"w": "plt.figure()", "b": [0.1348, 0.5607, 0.2623, 0.5749]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.5891, 0.3048, 0.6033]}, {"w": "loss,", "b": [0.3154, 0.5891, 0.3686, 0.6033]}, {"w": "'bo',", "b": [0.3792, 0.5891, 0.4323, 0.6033]}, {"w": "label='Training", "b": [0.443, 0.5891, 0.6024, 0.6033]}, {"w": "loss')", "b": [0.613, 0.5891, 0.6767, 0.6033]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.6033, 0.3048, 0.6174]}, {"w": "val_loss,", "b": [0.3154, 0.6033, 0.4111, 0.6174]}, {"w": "'b',", "b": [0.4217, 0.6033, 0.4642, 0.6174]}, {"w": "label='Validation", "b": [0.4748, 0.6033, 0.6555, 0.6174]}, {"w": "loss')", "b": [0.6661, 0.6033, 0.7299, 0.6174]}, {"w": "plt.title('Training", "b": [0.1348, 0.6175, 0.3367, 0.6316]}, {"w": "and", "b": [0.3473, 0.6175, 0.3792, 0.6316]}, {"w": "validation", "b": [0.3898, 0.6175, 0.4961, 0.6316]}, {"w": "loss')", "b": [0.5067, 0.6175, 0.5705, 0.6316]}, {"w": "plt.legend()", "b": [0.1348, 0.6316, 0.2623, 0.6458]}, {"w": "plt.show()", "b": [0.1348, 0.66, 0.241, 0.6742]}]}, {"id": "b_2", "type": "paragraph", "text": "These plots are characteristic of overfitting. The training accuracy increases linearly over time, until it reaches nearly 100%, whereas the validation accuracy stalls at 70–72%. The validation loss reaches its minimum after only five epochs and then stalls, whereas the training loss keeps decreasing linearly until it reaches nearly 0.", "words": [{"w": "These", "b": [0.1289, 0.6956, 0.1853, 0.7141]}, {"w": "plots", "b": [0.1912, 0.6956, 0.2371, 0.7141]}, {"w": "are", "b": [0.243, 0.6956, 0.2718, 0.7141]}, {"w": "characteristic", "b": [0.2777, 0.6956, 0.4036, 0.7141]}, {"w": "of", "b": [0.4095, 0.6956, 0.4292, 0.7141]}, {"w": "overfitting.", "b": [0.4351, 0.6956, 0.5407, 0.7141]}, {"w": "The", "b": [0.5466, 0.6956, 0.5833, 0.7141]}, {"w": "training", "b": [0.5892, 0.6956, 0.6627, 0.7141]}, {"w": "accuracy", "b": [0.6686, 0.6956, 0.7525, 0.7141]}, {"w": "increases", "b": [0.7584, 0.6956, 0.845, 0.7141]}, {"w": "linearly", "b": [0.1289, 0.7148, 0.201, 0.7333]}, {"w": "over", "b": [0.2069, 0.7148, 0.2489, 0.7333]}, {"w": "time,", "b": [0.2548, 0.7148, 0.3027, 0.7333]}, {"w": "until", "b": [0.3086, 0.7148, 0.3519, 0.7333]}, {"w": "it", "b": [0.3578, 0.7148, 0.3709, 0.7333]}, {"w": "reaches", "b": [0.3768, 0.7148, 0.4476, 0.7333]}, {"w": "nearly", "b": [0.4535, 0.7148, 0.5125, 0.7333]}, {"w": "100%,", "b": [0.5184, 0.7148, 0.5794, 0.7333]}, {"w": "whereas", "b": [0.5853, 0.7148, 0.6626, 0.7333]}, {"w": "the", "b": [0.6685, 0.7148, 0.6974, 0.7333]}, {"w": "validation", "b": [0.7033, 0.7148, 0.7977, 0.7333]}, {"w": "accuracy", "b": [0.1289, 0.734, 0.2128, 0.7525]}, {"w": "stalls", "b": [0.2187, 0.734, 0.2672, 0.7525]}, {"w": "at", "b": [0.2731, 0.734, 0.2902, 0.7525]}, {"w": "70–72%.", "b": [0.2961, 0.734, 0.3807, 0.7525]}, {"w": "The", "b": [0.3866, 0.734, 0.4233, 0.7525]}, {"w": "validation", "b": [0.4292, 0.734, 0.5237, 0.7525]}, {"w": "loss", "b": [0.5296, 0.734, 0.5663, 0.7525]}, {"w": "reaches", "b": [0.5722, 0.734, 0.643, 0.7525]}, {"w": "its", "b": [0.6489, 0.734, 0.6713, 0.7525]}, {"w": "minimum", "b": [0.6772, 0.734, 0.769, 0.7525]}, {"w": "after", "b": [0.7749, 0.734, 0.8182, 0.7525]}, {"w": "only", "b": [0.8241, 0.734, 0.8661, 0.7525]}, {"w": "five", "b": [0.1289, 0.7532, 0.1656, 0.7717]}, {"w": "epochs", "b": [0.1715, 0.7532, 0.2371, 0.7717]}, {"w": "and", "b": [0.243, 0.7532, 0.2771, 0.7717]}, {"w": "then", "b": [0.283, 0.7532, 0.3236, 0.7717]}, {"w": "stalls,", "b": [0.3295, 0.7532, 0.384, 0.7717]}, {"w": "whereas", "b": [0.3899, 0.7532, 0.4673, 0.7717]}, {"w": "the", "b": [0.4732, 0.7532, 0.502, 0.7717]}, {"w": "training", "b": [0.5079, 0.7532, 0.5814, 0.7717]}, {"w": "loss", "b": [0.5873, 0.7532, 0.624, 0.7717]}, {"w": "keeps", "b": [0.6299, 0.7532, 0.6837, 0.7717]}, {"w": "decreasing", "b": [0.6896, 0.7532, 0.7906, 0.7717]}, {"w": "linearly", "b": [0.7965, 0.7532, 0.8686, 0.7717]}, {"w": "until", "b": [0.1289, 0.7724, 0.1722, 0.7909]}, {"w": "it", "b": [0.1781, 0.7724, 0.1912, 0.7909]}, {"w": "reaches", "b": [0.1971, 0.7724, 0.2679, 0.7909]}, {"w": "nearly", "b": [0.2738, 0.7724, 0.3328, 0.7909]}, {"w": "0.", "b": [0.3387, 0.7724, 0.3565, 0.7909]}]}, {"id": "b_3", "type": "paragraph", "text": "Because you have relatively few training samples (2,000), overfitting will be your number-one concern. You already know about a number of techniques that can help mitigate overfitting, such as dropout and weight decay (L2 regularization). We’re now going to work with a new one, specific to", "words": [{"w": "Because", "b": [0.1289, 0.8124, 0.2076, 0.8309]}, {"w": "you", "b": [0.2135, 0.8124, 0.2489, 0.8309]}, {"w": "have", "b": [0.2548, 0.8124, 0.2994, 0.8309]}, {"w": "relatively", "b": [0.3053, 0.8124, 0.3945, 0.8309]}, {"w": "few", "b": [0.4004, 0.8124, 0.4358, 0.8309]}, {"w": "training", "b": [0.4417, 0.8124, 0.5151, 0.8309]}, {"w": "samples", "b": [0.521, 0.8124, 0.5971, 0.8309]}, {"w": "(2,000),", "b": [0.603, 0.8124, 0.6778, 0.8309]}, {"w": "overfitting", "b": [0.6837, 0.8124, 0.7834, 0.8309]}, {"w": "will", "b": [0.7893, 0.8124, 0.8261, 0.8309]}, {"w": "be", "b": [0.832, 0.8124, 0.8543, 0.8309]}, {"w": "your", "b": [0.1289, 0.8316, 0.1722, 0.8501]}, {"w": "number-one", "b": [0.1781, 0.8316, 0.2917, 0.8501]}, {"w": "concern.", "b": [0.2976, 0.8316, 0.3782, 0.8501]}, {"w": "You", "b": [0.3841, 0.8316, 0.4224, 0.8501]}, {"w": "already", "b": [0.4283, 0.8316, 0.4978, 0.8501]}, {"w": "know", "b": [0.5037, 0.8316, 0.5562, 0.8501]}, {"w": "about", "b": [0.5621, 0.8316, 0.6146, 0.8501]}, {"w": "a", "b": [0.6205, 0.8316, 0.631, 0.8501]}, {"w": "number", "b": [0.6369, 0.8316, 0.709, 0.8501]}, {"w": "of", "b": [0.7149, 0.8316, 0.7346, 0.8501]}, {"w": "techniques", "b": [0.7405, 0.8316, 0.8415, 0.8501]}, {"w": "that", "b": [0.1289, 0.8508, 0.1643, 0.8693]}, {"w": "can", "b": [0.1702, 0.8508, 0.203, 0.8693]}, {"w": "help", "b": [0.2089, 0.8508, 0.2495, 0.8693]}, {"w": "mitigate", "b": [0.2555, 0.8508, 0.3329, 0.8693]}, {"w": "overfitting,", "b": [0.3388, 0.8508, 0.4444, 0.8693]}, {"w": "such", "b": [0.4503, 0.8508, 0.4936, 0.8693]}, {"w": "as", "b": [0.4995, 0.8508, 0.5191, 0.8693]}, {"w": "dropout", "b": [0.525, 0.8508, 0.5985, 0.8693]}, {"w": "and", "b": [0.6044, 0.8508, 0.6385, 0.8693]}, {"w": "weight", "b": [0.6444, 0.8508, 0.7087, 0.8693]}, {"w": "decay", "b": [0.7146, 0.8508, 0.7697, 0.8693]}, {"w": "(L2", "b": [0.7756, 0.8508, 0.8097, 0.8693]}, {"w": "regularization).", "b": [0.1289, 0.87, 0.2738, 0.8885]}, {"w": "We’re", "b": [0.2797, 0.87, 0.3368, 0.8885]}, {"w": "now", "b": [0.3427, 0.87, 0.3833, 0.8885]}, {"w": "going", "b": [0.3892, 0.87, 0.443, 0.8885]}, {"w": "to", "b": [0.4489, 0.87, 0.4673, 0.8885]}, {"w": "work", "b": [0.4732, 0.87, 0.5217, 0.8885]}, {"w": "with", "b": [0.5276, 0.87, 0.5696, 0.8885]}, {"w": "a", "b": [0.5755, 0.87, 0.586, 0.8885]}, {"w": "new", "b": [0.5919, 0.87, 0.6313, 0.8885]}, {"w": "one,", "b": [0.6372, 0.87, 0.6772, 0.8885]}, {"w": "specific", "b": [0.6831, 0.87, 0.7565, 0.8885]}, {"w": "to", "b": [0.7624, 0.87, 0.7808, 0.8885]}]}]}, {"page": 193, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "computer vision and used almost universally when processing images with deep-learning models: data augmentation.", "words": [{"w": "computer", "b": [0.1289, 0.0857, 0.2181, 0.1041]}, {"w": "vision", "b": [0.224, 0.0857, 0.2817, 0.1041]}, {"w": "and", "b": [0.2876, 0.0857, 0.3217, 0.1041]}, {"w": "used", "b": [0.3276, 0.0857, 0.3709, 0.1041]}, {"w": "almost", "b": [0.3768, 0.0857, 0.4398, 0.1041]}, {"w": "universally", "b": [0.4457, 0.0857, 0.5506, 0.1041]}, {"w": "when", "b": [0.5565, 0.0857, 0.6077, 0.1041]}, {"w": "processing", "b": [0.6136, 0.0857, 0.7146, 0.1041]}, {"w": "images", "b": [0.7205, 0.0857, 0.7874, 0.1041]}, {"w": "with", "b": [0.7933, 0.0857, 0.8353, 0.1041]}, {"w": "deep-learning", "b": [0.1289, 0.1049, 0.2587, 0.1233]}, {"w": "models:", "b": [0.2646, 0.1049, 0.3394, 0.1233]}, {"w": "data", "b": [0.3453, 0.1049, 0.3873, 0.1233]}, {"w": "augmentation.", "b": [0.3932, 0.1049, 0.5289, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "5.2.5. Using data augmentation", "words": [{"w": "5.2.5.", "b": [0.1289, 0.1491, 0.182, 0.1676]}, {"w": "Using", "b": [0.1879, 0.1491, 0.2457, 0.1676]}, {"w": "data", "b": [0.2516, 0.1491, 0.2962, 0.1676]}, {"w": "augmentation", "b": [0.3021, 0.1491, 0.4411, 0.1676]}]}, {"id": "b_2", "type": "paragraph", "text": "Overfitting is caused by having too few samples to learn from, rendering you unable to train a model that can generalize to new data. Given infinite data, your model would be exposed to every possible aspect of the data distribution at hand: you would never overfit. Data augmentation takes the approach of generating more training data from existing training samples, by augmenting the samples via a number of random transformations that yield believable- looking images. The goal is that at training time, your model will never see the exact same picture twice. This helps expose the model to more aspects of the data and generalize better.", "words": [{"w": "Overfitting", "b": [0.1289, 0.1891, 0.2338, 0.2076]}, {"w": "is", "b": [0.2397, 0.1891, 0.2555, 0.2076]}, {"w": "caused", "b": [0.2614, 0.1891, 0.3256, 0.2076]}, {"w": "by", "b": [0.3315, 0.1891, 0.3552, 0.2076]}, {"w": "having", "b": [0.3611, 0.1891, 0.4253, 0.2076]}, {"w": "too", "b": [0.4312, 0.1891, 0.4614, 0.2076]}, {"w": "few", "b": [0.4673, 0.1891, 0.5027, 0.2076]}, {"w": "samples", "b": [0.5086, 0.1891, 0.5847, 0.2076]}, {"w": "to", "b": [0.5906, 0.1891, 0.609, 0.2076]}, {"w": "learn", "b": [0.6149, 0.1891, 0.6621, 0.2076]}, {"w": "from,", "b": [0.668, 0.1891, 0.7198, 0.2076]}, {"w": "rendering", "b": [0.7257, 0.1891, 0.8162, 0.2076]}, {"w": "you", "b": [0.8221, 0.1891, 0.8575, 0.2076]}, {"w": "unable", "b": [0.1289, 0.2083, 0.1918, 0.2268]}, {"w": "to", "b": [0.1977, 0.2083, 0.2161, 0.2268]}, {"w": "train", "b": [0.222, 0.2083, 0.2653, 0.2268]}, {"w": "a", "b": [0.2712, 0.2083, 0.2817, 0.2268]}, {"w": "model", "b": [0.2876, 0.2083, 0.3466, 0.2268]}, {"w": "that", "b": [0.3525, 0.2083, 0.388, 0.2268]}, {"w": "can", "b": [0.3939, 0.2083, 0.4266, 0.2268]}, {"w": "generalize", "b": [0.4325, 0.2083, 0.5296, 0.2268]}, {"w": "to", "b": [0.5355, 0.2083, 0.5538, 0.2268]}, {"w": "new", "b": [0.5597, 0.2083, 0.599, 0.2268]}, {"w": "data.", "b": [0.6049, 0.2083, 0.6502, 0.2268]}, {"w": "Given", "b": [0.6561, 0.2083, 0.7138, 0.2268]}, {"w": "infinite", "b": [0.7197, 0.2083, 0.7879, 0.2268]}, {"w": "data,", "b": [0.7938, 0.2083, 0.839, 0.2268]}, {"w": "your", "b": [0.1289, 0.2275, 0.1722, 0.246]}, {"w": "model", "b": [0.1781, 0.2275, 0.2371, 0.246]}, {"w": "would", "b": [0.243, 0.2275, 0.302, 0.246]}, {"w": "be", "b": [0.3079, 0.2275, 0.3302, 0.246]}, {"w": "exposed", "b": [0.3361, 0.2275, 0.4135, 0.246]}, {"w": "to", "b": [0.4194, 0.2275, 0.4378, 0.246]}, {"w": "every", "b": [0.4437, 0.2275, 0.4962, 0.246]}, {"w": "possible", "b": [0.5021, 0.2275, 0.5795, 0.246]}, {"w": "aspect", "b": [0.5854, 0.2275, 0.6444, 0.246]}, {"w": "of", "b": [0.6503, 0.2275, 0.67, 0.246]}, {"w": "the", "b": [0.6759, 0.2275, 0.7047, 0.246]}, {"w": "data", "b": [0.7106, 0.2275, 0.75, 0.246]}, {"w": "distribution", "b": [0.7559, 0.2275, 0.8648, 0.246]}, {"w": "at", "b": [0.1289, 0.2467, 0.1459, 0.2652]}, {"w": "hand:", "b": [0.1518, 0.2467, 0.2043, 0.2652]}, {"w": "you", "b": [0.2102, 0.2467, 0.2456, 0.2652]}, {"w": "would", "b": [0.2515, 0.2467, 0.3105, 0.2652]}, {"w": "never", "b": [0.3164, 0.2467, 0.3689, 0.2652]}, {"w": "overfit.", "b": [0.3748, 0.2467, 0.4437, 0.2652]}, {"w": "Data", "b": [0.4496, 0.2467, 0.4941, 0.2652]}, {"w": "augmentation", "b": [0.5001, 0.2467, 0.6286, 0.2652]}, {"w": "takes", "b": [0.6345, 0.2467, 0.683, 0.2652]}, {"w": "the", "b": [0.6889, 0.2467, 0.7178, 0.2652]}, {"w": "approach", "b": [0.7237, 0.2467, 0.8103, 0.2652]}, {"w": "of", "b": [0.8162, 0.2467, 0.8358, 0.2652]}, {"w": "generating", "b": [0.1289, 0.2659, 0.2286, 0.2844]}, {"w": "more", "b": [0.2345, 0.2659, 0.283, 0.2844]}, {"w": "training", "b": [0.2889, 0.2659, 0.3624, 0.2844]}, {"w": "data", "b": [0.3683, 0.2659, 0.4076, 0.2844]}, {"w": "from", "b": [0.4135, 0.2659, 0.4594, 0.2844]}, {"w": "existing", "b": [0.4653, 0.2659, 0.5401, 0.2844]}, {"w": "training", "b": [0.546, 0.2659, 0.6195, 0.2844]}, {"w": "samples,", "b": [0.6254, 0.2659, 0.7074, 0.2844]}, {"w": "by", "b": [0.7132, 0.2659, 0.7368, 0.2844]}, {"w": "augmenting", "b": [0.7427, 0.2659, 0.8542, 0.2844]}, {"w": "the", "b": [0.1289, 0.2851, 0.1577, 0.3036]}, {"w": "samples", "b": [0.1636, 0.2851, 0.2397, 0.3036]}, {"w": "via", "b": [0.2456, 0.2851, 0.2745, 0.3036]}, {"w": "a", "b": [0.2804, 0.2851, 0.2909, 0.3036]}, {"w": "number", "b": [0.2968, 0.2851, 0.3689, 0.3036]}, {"w": "of", "b": [0.3748, 0.2851, 0.3945, 0.3036]}, {"w": "random", "b": [0.4004, 0.2851, 0.4725, 0.3036]}, {"w": "transformations", "b": [0.4784, 0.2851, 0.6267, 0.3036]}, {"w": "that", "b": [0.6326, 0.2851, 0.668, 0.3036]}, {"w": "yield", "b": [0.6739, 0.2851, 0.7211, 0.3036]}, {"w": "believable-", "b": [0.727, 0.2851, 0.832, 0.3036]}, {"w": "looking", "b": [0.1289, 0.3043, 0.201, 0.3228]}, {"w": "images.", "b": [0.2069, 0.3043, 0.2798, 0.3228]}, {"w": "The", "b": [0.2857, 0.3043, 0.3224, 0.3228]}, {"w": "goal", "b": [0.3283, 0.3043, 0.3689, 0.3228]}, {"w": "is", "b": [0.3748, 0.3043, 0.3906, 0.3228]}, {"w": "that", "b": [0.3965, 0.3043, 0.4319, 0.3228]}, {"w": "at", "b": [0.4378, 0.3043, 0.4549, 0.3228]}, {"w": "training", "b": [0.4608, 0.3043, 0.5342, 0.3228]}, {"w": "time,", "b": [0.5402, 0.3043, 0.588, 0.3228]}, {"w": "your", "b": [0.5938, 0.3043, 0.6371, 0.3228]}, {"w": "model", "b": [0.643, 0.3043, 0.7021, 0.3228]}, {"w": "will", "b": [0.708, 0.3043, 0.7447, 0.3228]}, {"w": "never", "b": [0.7506, 0.3043, 0.8031, 0.3228]}, {"w": "see", "b": [0.809, 0.3043, 0.8391, 0.3228]}, {"w": "the", "b": [0.1289, 0.3235, 0.1577, 0.3419]}, {"w": "exact", "b": [0.1636, 0.3235, 0.2135, 0.3419]}, {"w": "same", "b": [0.2194, 0.3235, 0.2679, 0.3419]}, {"w": "picture", "b": [0.2738, 0.3235, 0.3394, 0.3419]}, {"w": "twice.", "b": [0.3453, 0.3235, 0.4023, 0.3419]}, {"w": "This", "b": [0.4082, 0.3235, 0.4502, 0.3419]}, {"w": "helps", "b": [0.4561, 0.3235, 0.506, 0.3419]}, {"w": "expose", "b": [0.5119, 0.3235, 0.5775, 0.3419]}, {"w": "the", "b": [0.5834, 0.3235, 0.6122, 0.3419]}, {"w": "model", "b": [0.6181, 0.3235, 0.6772, 0.3419]}, {"w": "to", "b": [0.6831, 0.3235, 0.7014, 0.3419]}, {"w": "more", "b": [0.7073, 0.3235, 0.7559, 0.3419]}, {"w": "aspects", "b": [0.7618, 0.3235, 0.83, 0.3419]}, {"w": "of", "b": [0.8359, 0.3235, 0.8555, 0.3419]}, {"w": "the", "b": [0.1289, 0.3427, 0.1577, 0.3611]}, {"w": "data", "b": [0.1636, 0.3427, 0.203, 0.3611]}, {"w": "and", "b": [0.2089, 0.3427, 0.243, 0.3611]}, {"w": "generalize", "b": [0.2489, 0.3427, 0.3459, 0.3611]}, {"w": "better.", "b": [0.3518, 0.3427, 0.4101, 0.3611]}]}, {"id": "b_3", "type": "paragraph", "text": "In Keras, this can be done by configuring a number of random transformations to be performed on the images read by the ImageDataGenerator instance. Let’s get started with an example.", "words": [{"w": "In", "b": [0.1289, 0.3827, 0.1485, 0.4012]}, {"w": "Keras,", "b": [0.1545, 0.3827, 0.2154, 0.4012]}, {"w": "this", "b": [0.2213, 0.3827, 0.2555, 0.4012]}, {"w": "can", "b": [0.2614, 0.3827, 0.2941, 0.4012]}, {"w": "be", "b": [0.3, 0.3827, 0.3223, 0.4012]}, {"w": "done", "b": [0.3282, 0.3827, 0.3741, 0.4012]}, {"w": "by", "b": [0.38, 0.3827, 0.4037, 0.4012]}, {"w": "configuring", "b": [0.4096, 0.3827, 0.5197, 0.4012]}, {"w": "a", "b": [0.5257, 0.3827, 0.5361, 0.4012]}, {"w": "number", "b": [0.542, 0.3827, 0.6142, 0.4012]}, {"w": "of", "b": [0.6201, 0.3827, 0.6398, 0.4012]}, {"w": "random", "b": [0.6457, 0.3827, 0.7178, 0.4012]}, {"w": "transformations", "b": [0.1289, 0.4019, 0.2771, 0.4204]}, {"w": "to", "b": [0.283, 0.4019, 0.3014, 0.4204]}, {"w": "be", "b": [0.3073, 0.4019, 0.3296, 0.4204]}, {"w": "performed", "b": [0.3355, 0.4019, 0.4338, 0.4204]}, {"w": "on", "b": [0.4397, 0.4019, 0.4634, 0.4204]}, {"w": "the", "b": [0.4693, 0.4019, 0.4981, 0.4204]}, {"w": "images", "b": [0.504, 0.4019, 0.5709, 0.4204]}, {"w": "read", "b": [0.5768, 0.4019, 0.6175, 0.4204]}, {"w": "by", "b": [0.6234, 0.4019, 0.647, 0.4204]}, {"w": "the", "b": [0.6529, 0.4019, 0.6817, 0.4204]}, {"w": "ImageDataGenerator", "b": [0.1289, 0.4221, 0.3839, 0.441]}, {"w": "instance.", "b": [0.3899, 0.4211, 0.4731, 0.4396]}, {"w": "Let’s", "b": [0.479, 0.4211, 0.5262, 0.4396]}, {"w": "get", "b": [0.5322, 0.4211, 0.561, 0.4396]}, {"w": "started", "b": [0.5669, 0.4211, 0.6299, 0.4396]}, {"w": "with", "b": [0.6358, 0.4211, 0.6778, 0.4396]}, {"w": "an", "b": [0.6837, 0.4211, 0.706, 0.4396]}, {"w": "example.", "b": [0.7119, 0.4211, 0.7978, 0.4396]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 5.11. Setting up a data augmentation configuration via ImageDataGenerator", "words": [{"w": "Listing", "b": [0.1289, 0.4574, 0.182, 0.4712]}, {"w": "5.11.", "b": [0.1865, 0.4574, 0.2209, 0.4712]}, {"w": "Setting", "b": [0.2253, 0.4574, 0.2784, 0.4712]}, {"w": "up", "b": [0.2829, 0.4574, 0.3026, 0.4712]}, {"w": "a", "b": [0.307, 0.4574, 0.3158, 0.4712]}, {"w": "data", "b": [0.3203, 0.4574, 0.3537, 0.4712]}, {"w": "augmentation", "b": [0.3582, 0.4574, 0.4625, 0.4712]}, {"w": "configuration", "b": [0.4669, 0.4574, 0.5692, 0.4712]}, {"w": "via", "b": [0.5737, 0.4574, 0.5963, 0.4712]}, {"w": "ImageDataGenerator", "b": [0.6007, 0.4581, 0.792, 0.4723]}]}, {"id": "b_5", "type": "paragraph", "text": "datagen = ImageDataGenerator( rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True, fill_mode='nearest')", "words": [{"w": "datagen", "b": [0.1348, 0.4848, 0.2092, 0.499]}, {"w": "=", "b": [0.2198, 0.4848, 0.2304, 0.499]}, {"w": "ImageDataGenerator(", "b": [0.241, 0.4848, 0.443, 0.499]}, {"w": "rotation_range=40,", "b": [0.1985, 0.499, 0.3898, 0.5131]}, {"w": "width_shift_range=0.2,", "b": [0.1985, 0.5132, 0.4323, 0.5273]}, {"w": "height_shift_range=0.2,", "b": [0.1985, 0.5273, 0.443, 0.5415]}, {"w": "shear_range=0.2,", "b": [0.1985, 0.5415, 0.3686, 0.5557]}, {"w": "zoom_range=0.2,", "b": [0.1985, 0.5557, 0.3579, 0.5699]}, {"w": "horizontal_flip=True,", "b": [0.1985, 0.5699, 0.4217, 0.5841]}, {"w": "fill_mode='nearest')", "b": [0.1985, 0.5841, 0.4111, 0.5983]}]}, {"id": "b_6", "type": "paragraph", "text": "These are just a few of the options available (for more, see the Keras documentation). Let’s quickly go over this code:", "words": [{"w": "These", "b": [0.1289, 0.6197, 0.1853, 0.6382]}, {"w": "are", "b": [0.1912, 0.6197, 0.22, 0.6382]}, {"w": "just", "b": [0.2259, 0.6197, 0.26, 0.6382]}, {"w": "a", "b": [0.2659, 0.6197, 0.2764, 0.6382]}, {"w": "few", "b": [0.2823, 0.6197, 0.3177, 0.6382]}, {"w": "of", "b": [0.3236, 0.6197, 0.3433, 0.6382]}, {"w": "the", "b": [0.3492, 0.6197, 0.3781, 0.6382]}, {"w": "options", "b": [0.384, 0.6197, 0.4535, 0.6382]}, {"w": "available", "b": [0.4594, 0.6197, 0.5447, 0.6382]}, {"w": "(for", "b": [0.5506, 0.6197, 0.586, 0.6382]}, {"w": "more,", "b": [0.5919, 0.6197, 0.6463, 0.6382]}, {"w": "see", "b": [0.6522, 0.6197, 0.6824, 0.6382]}, {"w": "the", "b": [0.6883, 0.6197, 0.7171, 0.6382]}, {"w": "Keras", "b": [0.723, 0.6197, 0.7781, 0.6382]}, {"w": "documentation).", "b": [0.1289, 0.6389, 0.283, 0.6573]}, {"w": "Let’s", "b": [0.2889, 0.6389, 0.3361, 0.6573]}, {"w": "quickly", "b": [0.342, 0.6389, 0.4128, 0.6573]}, {"w": "go", "b": [0.4188, 0.6389, 0.4424, 0.6573]}, {"w": "over", "b": [0.4483, 0.6389, 0.4902, 0.6573]}, {"w": "this", "b": [0.4961, 0.6389, 0.5303, 0.6573]}, {"w": "code:", "b": [0.5362, 0.6389, 0.5873, 0.6573]}]}, {"id": "b_7", "type": "paragraph", "text": "rotation_range is a value in degrees (0–180), a range within which to randomly rotate pictures. width_shift and height_shift are ranges (as a fraction of total width or height) within which to randomly translate pictures vertically or horizontally. shear_range is for randomly applying shearing transformations. zoom_range is for randomly zooming inside pictures. horizontal_flip is for randomly flipping half the images horizontally—relevant when there are no assumptions of horizontal asymmetry (for example, real-world pictures). fill_mode is the strategy used for filling in newly created pixels, which can appear after a rotation or a width/height shift.", "words": [{"w": "rotation_range", "b": [0.1761, 0.6757, 0.3745, 0.6946]}, {"w": "is", "b": [0.3804, 0.6747, 0.3961, 0.6932]}, {"w": "a", "b": [0.402, 0.6747, 0.4125, 0.6932]}, {"w": "value", "b": [0.4184, 0.6747, 0.4696, 0.6932]}, {"w": "in", "b": [0.4755, 0.6747, 0.4939, 0.6932]}, {"w": "degrees", "b": [0.4998, 0.6747, 0.5719, 0.6932]}, {"w": "(0–180),", "b": [0.5778, 0.6747, 0.6585, 0.6932]}, {"w": "a", "b": [0.6644, 0.6747, 0.6748, 0.6932]}, {"w": "range", "b": [0.6807, 0.6747, 0.7332, 0.6932]}, {"w": "within", "b": [0.7391, 0.6747, 0.7995, 0.6932]}, {"w": "which", "b": [0.8054, 0.6747, 0.8631, 0.6932]}, {"w": "to", "b": [0.1761, 0.6948, 0.1945, 0.7133]}, {"w": "randomly", "b": [0.2004, 0.6948, 0.2909, 0.7133]}, {"w": "rotate", "b": [0.2968, 0.6948, 0.3506, 0.7133]}, {"w": "pictures.", "b": [0.3565, 0.6948, 0.4371, 0.7133]}, {"w": "width_shift", "b": [0.1761, 0.7149, 0.332, 0.7338]}, {"w": "and", "b": [0.3379, 0.714, 0.372, 0.7324]}, {"w": "height_shift", "b": [0.3779, 0.7149, 0.5479, 0.7338]}, {"w": "are", "b": [0.5538, 0.714, 0.5827, 0.7324]}, {"w": "ranges", "b": [0.5886, 0.714, 0.6502, 0.7324]}, {"w": "(as", "b": [0.6561, 0.714, 0.6836, 0.7324]}, {"w": "a", "b": [0.6895, 0.714, 0.7, 0.7324]}, {"w": "fraction", "b": [0.7059, 0.714, 0.7794, 0.7324]}, {"w": "of", "b": [0.7853, 0.714, 0.805, 0.7324]}, {"w": "total", "b": [0.8109, 0.714, 0.8528, 0.7324]}, {"w": "width", "b": [0.1761, 0.734, 0.2299, 0.7525]}, {"w": "or", "b": [0.2358, 0.734, 0.2555, 0.7525]}, {"w": "height)", "b": [0.2614, 0.734, 0.3283, 0.7525]}, {"w": "within", "b": [0.3342, 0.734, 0.3945, 0.7525]}, {"w": "which", "b": [0.4004, 0.734, 0.4582, 0.7525]}, {"w": "to", "b": [0.4641, 0.734, 0.4824, 0.7525]}, {"w": "randomly", "b": [0.4883, 0.734, 0.5789, 0.7525]}, {"w": "translate", "b": [0.5848, 0.734, 0.6648, 0.7525]}, {"w": "pictures", "b": [0.6707, 0.734, 0.7454, 0.7525]}, {"w": "vertically", "b": [0.7513, 0.734, 0.8405, 0.7525]}, {"w": "or", "b": [0.8464, 0.734, 0.8661, 0.7525]}, {"w": "horizontally.", "b": [0.1761, 0.7532, 0.2946, 0.7717]}, {"w": "shear_range", "b": [0.1761, 0.7734, 0.332, 0.7923]}, {"w": "is", "b": [0.3379, 0.7724, 0.3536, 0.7909]}, {"w": "for", "b": [0.3595, 0.7724, 0.3871, 0.7909]}, {"w": "randomly", "b": [0.393, 0.7724, 0.4835, 0.7909]}, {"w": "applying", "b": [0.4894, 0.7724, 0.572, 0.7909]}, {"w": "shearing", "b": [0.578, 0.7724, 0.658, 0.7909]}, {"w": "transformations.", "b": [0.6639, 0.7724, 0.818, 0.7909]}, {"w": "zoom_range", "b": [0.1761, 0.7934, 0.3178, 0.8123]}, {"w": "is", "b": [0.3237, 0.7924, 0.3395, 0.8109]}, {"w": "for", "b": [0.3454, 0.7924, 0.3729, 0.8109]}, {"w": "randomly", "b": [0.3788, 0.7924, 0.4693, 0.8109]}, {"w": "zooming", "b": [0.4752, 0.7924, 0.5579, 0.8109]}, {"w": "inside", "b": [0.5638, 0.7924, 0.6202, 0.8109]}, {"w": "pictures.", "b": [0.6261, 0.7924, 0.7068, 0.8109]}, {"w": "horizontal_flip", "b": [0.1761, 0.8134, 0.3886, 0.8323]}, {"w": "is", "b": [0.3946, 0.8124, 0.4103, 0.8309]}, {"w": "for", "b": [0.4162, 0.8124, 0.4438, 0.8309]}, {"w": "randomly", "b": [0.4497, 0.8124, 0.5402, 0.8309]}, {"w": "flipping", "b": [0.5461, 0.8124, 0.6209, 0.8309]}, {"w": "half", "b": [0.6268, 0.8124, 0.6635, 0.8309]}, {"w": "the", "b": [0.6694, 0.8124, 0.6982, 0.8309]}, {"w": "images", "b": [0.7042, 0.8124, 0.7711, 0.8309]}, {"w": "horizontally—relevant", "b": [0.1761, 0.8324, 0.3899, 0.8509]}, {"w": "when", "b": [0.3958, 0.8324, 0.447, 0.8509]}, {"w": "there", "b": [0.4529, 0.8324, 0.5001, 0.8509]}, {"w": "are", "b": [0.506, 0.8324, 0.5348, 0.8509]}, {"w": "no", "b": [0.5407, 0.8324, 0.5643, 0.8509]}, {"w": "assumptions", "b": [0.5702, 0.8324, 0.687, 0.8509]}, {"w": "of", "b": [0.6929, 0.8324, 0.7126, 0.8509]}, {"w": "horizontal", "b": [0.7185, 0.8324, 0.8142, 0.8509]}, {"w": "asymmetry", "b": [0.1761, 0.8516, 0.281, 0.8701]}, {"w": "(for", "b": [0.287, 0.8516, 0.3224, 0.8701]}, {"w": "example,", "b": [0.3282, 0.8516, 0.4141, 0.8701]}, {"w": "real-world", "b": [0.4201, 0.8516, 0.5184, 0.8701]}, {"w": "pictures).", "b": [0.5243, 0.8516, 0.6128, 0.8701]}, {"w": "fill_mode", "b": [0.1761, 0.8718, 0.3036, 0.8907]}, {"w": "is", "b": [0.3095, 0.8708, 0.3253, 0.8893]}, {"w": "the", "b": [0.3312, 0.8708, 0.3601, 0.8893]}, {"w": "strategy", "b": [0.366, 0.8708, 0.4407, 0.8893]}, {"w": "used", "b": [0.4466, 0.8708, 0.4899, 0.8893]}, {"w": "for", "b": [0.4958, 0.8708, 0.5234, 0.8893]}, {"w": "filling", "b": [0.5293, 0.8708, 0.587, 0.8893]}, {"w": "in", "b": [0.5929, 0.8708, 0.6113, 0.8893]}, {"w": "newly", "b": [0.6172, 0.8708, 0.6749, 0.8893]}, {"w": "created", "b": [0.6808, 0.8708, 0.749, 0.8893]}, {"w": "pixels,", "b": [0.7549, 0.8708, 0.8172, 0.8893]}, {"w": "which", "b": [0.1761, 0.8909, 0.2338, 0.9093]}, {"w": "can", "b": [0.2397, 0.8909, 0.2725, 0.9093]}, {"w": "appear", "b": [0.2784, 0.8909, 0.3413, 0.9093]}, {"w": "after", "b": [0.3472, 0.8909, 0.3905, 0.9093]}, {"w": "a", "b": [0.3964, 0.8909, 0.4069, 0.9093]}, {"w": "rotation", "b": [0.4128, 0.8909, 0.4863, 0.9093]}, {"w": "or", "b": [0.4922, 0.8909, 0.5118, 0.9093]}, {"w": "a", "b": [0.5177, 0.8909, 0.5282, 0.9093]}, {"w": "width/height", "b": [0.5341, 0.8909, 0.6535, 0.9093]}, {"w": "shift.", "b": [0.6594, 0.8909, 0.7073, 0.9093]}]}]}, {"page": 194, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Let’s look at the augmented images (see figure 5.11).", "words": [{"w": "Let’s", "b": [0.1289, 0.0857, 0.1761, 0.1041]}, {"w": "look", "b": [0.182, 0.0857, 0.224, 0.1041]}, {"w": "at", "b": [0.2299, 0.0857, 0.2469, 0.1041]}, {"w": "the", "b": [0.2528, 0.0857, 0.2817, 0.1041]}, {"w": "augmented", "b": [0.2876, 0.0857, 0.3912, 0.1041]}, {"w": "images", "b": [0.3971, 0.0857, 0.464, 0.1041]}, {"w": "(see", "b": [0.4699, 0.0857, 0.5079, 0.1041]}, {"w": "figure", "b": [0.5138, 0.0857, 0.5702, 0.1041]}, {"w": "5.11).", "b": [0.5761, 0.0857, 0.6303, 0.1041]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.11. Generation of cat pictures via random data augmentation", "words": [{"w": "Figure", "b": [0.1289, 0.1211, 0.1787, 0.135]}, {"w": "5.11.", "b": [0.1832, 0.1211, 0.2176, 0.135]}, {"w": "Generation", "b": [0.222, 0.1211, 0.3076, 0.135]}, {"w": "of", "b": [0.312, 0.1211, 0.3268, 0.135]}, {"w": "cat", "b": [0.3312, 0.1211, 0.3538, 0.135]}, {"w": "pictures", "b": [0.3583, 0.1211, 0.4189, 0.135]}, {"w": "via", "b": [0.4233, 0.1211, 0.446, 0.135]}, {"w": "random", "b": [0.4504, 0.1211, 0.5104, 0.135]}, {"w": "data", "b": [0.5149, 0.1211, 0.5483, 0.135]}, {"w": "augmentation", "b": [0.5527, 0.1211, 0.657, 0.135]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.12. Displaying some randomly augmented training images", "words": [{"w": "Listing", "b": [0.1289, 0.5642, 0.182, 0.578]}, {"w": "5.12.", "b": [0.1865, 0.5642, 0.2219, 0.578]}, {"w": "Displaying", "b": [0.2263, 0.5642, 0.307, 0.578]}, {"w": "some", "b": [0.3114, 0.5642, 0.3498, 0.578]}, {"w": "randomly", "b": [0.3542, 0.5642, 0.428, 0.578]}, {"w": "augmented", "b": [0.4324, 0.5642, 0.5161, 0.578]}, {"w": "training", "b": [0.5205, 0.5642, 0.5815, 0.578]}, {"w": "images", "b": [0.5859, 0.5642, 0.6381, 0.578]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.preprocessing import image 1 fnames = [os.path.join(train_cats_dir, fname) for fname in os.listdir(train_cats_dir)] img_path = fnames[3] 2 img = image.load_img(img_path, target_size=(150, 150)) 3 x = image.img_to_array(img) 4 x = x.reshape((1,) + x.shape) 5 i = 0 6 for batch in datagen.flow(x, batch_size=1): 6 plt.figure(i) 6 imgplot = plt.imshow(image.array_to_img(batch[0])) 6 i += 1 6 if i % 4 == 0: 6 break 6 plt.show()", "words": [{"w": "from", "b": [0.1348, 0.5908, 0.1773, 0.6049]}, {"w": "keras.preprocessing", "b": [0.1879, 0.5908, 0.3898, 0.6049]}, {"w": "import", "b": [0.4004, 0.5908, 0.4642, 0.6049]}, {"w": "image", "b": [0.4748, 0.5908, 0.528, 0.6049]}, {"w": "1", "b": [0.815, 0.5908, 0.8256, 0.6049]}, {"w": "fnames", "b": [0.1348, 0.6191, 0.1985, 0.6333]}, {"w": "=", "b": [0.2092, 0.6191, 0.2198, 0.6333]}, {"w": "[os.path.join(train_cats_dir,", "b": [0.2304, 0.6191, 0.5386, 0.6333]}, {"w": "fname)", "b": [0.5492, 0.6191, 0.613, 0.6333]}, {"w": "for", "b": [0.6236, 0.6191, 0.6555, 0.6333]}, {"w": "fname", "b": [0.1879, 0.6333, 0.241, 0.6475]}, {"w": "in", "b": [0.2517, 0.6333, 0.2729, 0.6475]}, {"w": "os.listdir(train_cats_dir)]", "b": [0.2836, 0.6333, 0.5705, 0.6475]}, {"w": "img_path", "b": [0.1348, 0.6617, 0.2198, 0.6759]}, {"w": "=", "b": [0.2304, 0.6617, 0.241, 0.6759]}, {"w": "fnames[3]", "b": [0.2517, 0.6617, 0.3473, 0.6759]}, {"w": "2", "b": [0.815, 0.6617, 0.8256, 0.6759]}, {"w": "img", "b": [0.1348, 0.69, 0.1667, 0.7042]}, {"w": "=", "b": [0.1773, 0.69, 0.1879, 0.7042]}, {"w": "image.load_img(img_path,", "b": [0.1985, 0.69, 0.4536, 0.7042]}, {"w": "target_size=(150,", "b": [0.4642, 0.69, 0.6449, 0.7042]}, {"w": "150))", "b": [0.6555, 0.69, 0.7086, 0.7042]}, {"w": "3", "b": [0.815, 0.69, 0.8256, 0.7042]}, {"w": "x", "b": [0.1348, 0.7184, 0.1454, 0.7326]}, {"w": "=", "b": [0.156, 0.7184, 0.1667, 0.7326]}, {"w": "image.img_to_array(img)", "b": [0.1773, 0.7184, 0.4217, 0.7326]}, {"w": "4", "b": [0.815, 0.7184, 0.8256, 0.7326]}, {"w": "x", "b": [0.1348, 0.7326, 0.1454, 0.7468]}, {"w": "=", "b": [0.156, 0.7326, 0.1667, 0.7468]}, {"w": "x.reshape((1,)", "b": [0.1773, 0.7326, 0.3261, 0.7468]}, {"w": "+", "b": [0.3367, 0.7326, 0.3473, 0.7468]}, {"w": "x.shape)", "b": [0.3579, 0.7326, 0.443, 0.7468]}, {"w": "5", "b": [0.815, 0.7326, 0.8256, 0.7468]}, {"w": "i", "b": [0.1348, 0.761, 0.1454, 0.7751]}, {"w": "=", "b": [0.156, 0.761, 0.1667, 0.7751]}, {"w": "0", "b": [0.1773, 0.761, 0.1879, 0.7751]}, {"w": "6", "b": [0.815, 0.761, 0.8256, 0.7751]}, {"w": "for", "b": [0.1348, 0.7752, 0.1667, 0.7893]}, {"w": "batch", "b": [0.1773, 0.7752, 0.2304, 0.7893]}, {"w": "in", "b": [0.241, 0.7752, 0.2623, 0.7893]}, {"w": "datagen.flow(x,", "b": [0.2729, 0.7752, 0.4323, 0.7893]}, {"w": "batch_size=1):", "b": [0.443, 0.7752, 0.5917, 0.7893]}, {"w": "6", "b": [0.815, 0.7752, 0.8256, 0.7893]}, {"w": "plt.figure(i)", "b": [0.1773, 0.7893, 0.3154, 0.8035]}, {"w": "6", "b": [0.815, 0.7893, 0.8256, 0.8035]}, {"w": "imgplot", "b": [0.1773, 0.8035, 0.2517, 0.8177]}, {"w": "=", "b": [0.2623, 0.8035, 0.2729, 0.8177]}, {"w": "plt.imshow(image.array_to_img(batch[0]))", "b": [0.2836, 0.8035, 0.7086, 0.8177]}, {"w": "6", "b": [0.815, 0.8035, 0.8256, 0.8177]}, {"w": "i", "b": [0.1773, 0.8177, 0.1879, 0.8319]}, {"w": "+=", "b": [0.1985, 0.8177, 0.2198, 0.8319]}, {"w": "1", "b": [0.2304, 0.8177, 0.241, 0.8319]}, {"w": "6", "b": [0.815, 0.8177, 0.8256, 0.8319]}, {"w": "if", "b": [0.1773, 0.8319, 0.1985, 0.8461]}, {"w": "i", "b": [0.2092, 0.8319, 0.2198, 0.8461]}, {"w": "%", "b": [0.2304, 0.8319, 0.241, 0.8461]}, {"w": "4", "b": [0.2517, 0.8319, 0.2623, 0.8461]}, {"w": "==", "b": [0.2729, 0.8319, 0.2942, 0.8461]}, {"w": "0:", "b": [0.3048, 0.8319, 0.3261, 0.8461]}, {"w": "6", "b": [0.815, 0.8319, 0.8256, 0.8461]}, {"w": "break", "b": [0.2198, 0.8461, 0.2729, 0.8603]}, {"w": "6", "b": [0.815, 0.8461, 0.8256, 0.8603]}, {"w": "plt.show()", "b": [0.1348, 0.8744, 0.241, 0.8886]}]}]}, {"page": 195, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1 Module with image-preprocessing utilities 2 Chooses one image to augment 3 Reads the image and resizes it 4 Converts it to a Numpy array with shape (150, 150, 3) 5 Reshapes it to (1, 150, 150, 3) 6 Generates batches of randomly transformed images. Loops indefinitely, so you need to break the loop at some point!", "words": [{"w": "1", "b": [0.1761, 0.0857, 0.1879, 0.1041]}, {"w": "Module", "b": [0.1938, 0.0857, 0.2712, 0.1041]}, {"w": "with", "b": [0.2771, 0.0857, 0.3217, 0.1041]}, {"w": "image-preprocessing", "b": [0.3276, 0.0857, 0.5353, 0.1041]}, {"w": "utilities", "b": [0.5412, 0.0857, 0.616, 0.1041]}, {"w": "2", "b": [0.1761, 0.1049, 0.1879, 0.1233]}, {"w": "Chooses", "b": [0.1938, 0.1049, 0.2765, 0.1233]}, {"w": "one", "b": [0.2824, 0.1049, 0.3178, 0.1233]}, {"w": "image", "b": [0.3237, 0.1049, 0.384, 0.1233]}, {"w": "to", "b": [0.3899, 0.1049, 0.4096, 0.1233]}, {"w": "augment", "b": [0.4155, 0.1049, 0.5034, 0.1233]}, {"w": "3", "b": [0.1761, 0.124, 0.1879, 0.1425]}, {"w": "Reads", "b": [0.1938, 0.124, 0.2555, 0.1425]}, {"w": "the", "b": [0.2614, 0.124, 0.2929, 0.1425]}, {"w": "image", "b": [0.2988, 0.124, 0.3591, 0.1425]}, {"w": "and", "b": [0.365, 0.124, 0.4031, 0.1425]}, {"w": "resizes", "b": [0.409, 0.124, 0.4754, 0.1425]}, {"w": "it", "b": [0.4813, 0.124, 0.4958, 0.1425]}, {"w": "4", "b": [0.1761, 0.1432, 0.1879, 0.1617]}, {"w": "Converts", "b": [0.1938, 0.1432, 0.2856, 0.1617]}, {"w": "it", "b": [0.2915, 0.1432, 0.306, 0.1617]}, {"w": "to", "b": [0.3119, 0.1432, 0.3315, 0.1617]}, {"w": "a", "b": [0.3374, 0.1432, 0.3492, 0.1617]}, {"w": "Numpy", "b": [0.3552, 0.1432, 0.4299, 0.1617]}, {"w": "array", "b": [0.4358, 0.1432, 0.4922, 0.1617]}, {"w": "with", "b": [0.4981, 0.1432, 0.5427, 0.1617]}, {"w": "shape", "b": [0.5487, 0.1432, 0.6064, 0.1617]}, {"w": "(150,", "b": [0.6123, 0.1432, 0.6615, 0.1617]}, {"w": "150,", "b": [0.6674, 0.1432, 0.7087, 0.1617]}, {"w": "3)", "b": [0.7146, 0.1432, 0.7343, 0.1617]}, {"w": "5", "b": [0.1761, 0.1624, 0.1879, 0.1809]}, {"w": "Reshapes", "b": [0.1938, 0.1624, 0.2883, 0.1809]}, {"w": "it", "b": [0.2942, 0.1624, 0.3086, 0.1809]}, {"w": "to", "b": [0.3145, 0.1624, 0.3342, 0.1809]}, {"w": "(1,", "b": [0.3401, 0.1624, 0.3657, 0.1809]}, {"w": "150,", "b": [0.3716, 0.1624, 0.4129, 0.1809]}, {"w": "150,", "b": [0.4188, 0.1624, 0.4601, 0.1809]}, {"w": "3)", "b": [0.466, 0.1624, 0.4857, 0.1809]}, {"w": "6", "b": [0.1761, 0.1816, 0.1879, 0.2001]}, {"w": "Generates", "b": [0.1938, 0.1816, 0.2961, 0.2001]}, {"w": "batches", "b": [0.302, 0.1816, 0.3781, 0.2001]}, {"w": "of", "b": [0.384, 0.1816, 0.4037, 0.2001]}, {"w": "randomly", "b": [0.4096, 0.1816, 0.508, 0.2001]}, {"w": "transformed", "b": [0.5139, 0.1816, 0.6398, 0.2001]}, {"w": "images.", "b": [0.6457, 0.1816, 0.7211, 0.2001]}, {"w": "Loops", "b": [0.727, 0.1816, 0.7887, 0.2001]}, {"w": "indefinitely,", "b": [0.1761, 0.2008, 0.2948, 0.2193]}, {"w": "so", "b": [0.3008, 0.2008, 0.3217, 0.2193]}, {"w": "you", "b": [0.3276, 0.2008, 0.3644, 0.2193]}, {"w": "need", "b": [0.3703, 0.2008, 0.4175, 0.2193]}, {"w": "to", "b": [0.4234, 0.2008, 0.4431, 0.2193]}, {"w": "break", "b": [0.449, 0.2008, 0.5076, 0.2193]}, {"w": "the", "b": [0.5135, 0.2008, 0.545, 0.2193]}, {"w": "loop", "b": [0.5509, 0.2008, 0.5942, 0.2193]}, {"w": "at", "b": [0.6001, 0.2008, 0.6198, 0.2193]}, {"w": "some", "b": [0.6257, 0.2008, 0.6768, 0.2193]}, {"w": "point!", "b": [0.6828, 0.2008, 0.7431, 0.2193]}]}, {"id": "b_1", "type": "paragraph", "text": "If you train a new network using this data-augmentation configuration, the network will never see the same input twice. But the inputs it sees are still heavily intercorrelated, because they come from a small number of original images—you can’t produce new information, you can only remix existing information. As such, this may not be enough to completely get rid of overfitting. To further fight overfitting, you’ll also add a Dropout layer to your model, right before the densely connected classifier.", "words": [{"w": "If", "b": [0.1289, 0.2409, 0.1446, 0.2593]}, {"w": "you", "b": [0.1505, 0.2409, 0.1859, 0.2593]}, {"w": "train", "b": [0.1918, 0.2409, 0.2351, 0.2593]}, {"w": "a", "b": [0.241, 0.2409, 0.2515, 0.2593]}, {"w": "new", "b": [0.2574, 0.2409, 0.2968, 0.2593]}, {"w": "network", "b": [0.3027, 0.2409, 0.38, 0.2593]}, {"w": "using", "b": [0.3859, 0.2409, 0.4371, 0.2593]}, {"w": "this", "b": [0.443, 0.2409, 0.4771, 0.2593]}, {"w": "data-augmentation", "b": [0.4831, 0.2409, 0.6588, 0.2593]}, {"w": "configuration,", "b": [0.6647, 0.2409, 0.7979, 0.2593]}, {"w": "the", "b": [0.8038, 0.2409, 0.8326, 0.2593]}, {"w": "network", "b": [0.1289, 0.2601, 0.2063, 0.2785]}, {"w": "will", "b": [0.2122, 0.2601, 0.2489, 0.2785]}, {"w": "never", "b": [0.2548, 0.2601, 0.3073, 0.2785]}, {"w": "see", "b": [0.3132, 0.2601, 0.3433, 0.2785]}, {"w": "the", "b": [0.3492, 0.2601, 0.3781, 0.2785]}, {"w": "same", "b": [0.384, 0.2601, 0.4325, 0.2785]}, {"w": "input", "b": [0.4384, 0.2601, 0.487, 0.2785]}, {"w": "twice.", "b": [0.4929, 0.2601, 0.5499, 0.2785]}, {"w": "But", "b": [0.5558, 0.2601, 0.59, 0.2785]}, {"w": "the", "b": [0.5958, 0.2601, 0.6246, 0.2785]}, {"w": "inputs", "b": [0.6305, 0.2601, 0.6883, 0.2785]}, {"w": "it", "b": [0.6942, 0.2601, 0.7073, 0.2785]}, {"w": "sees", "b": [0.7132, 0.2601, 0.7526, 0.2785]}, {"w": "are", "b": [0.7585, 0.2601, 0.7873, 0.2785]}, {"w": "still", "b": [0.7932, 0.2601, 0.8286, 0.2785]}, {"w": "heavily", "b": [0.1289, 0.2792, 0.1984, 0.2977]}, {"w": "intercorrelated,", "b": [0.2043, 0.2792, 0.3479, 0.2977]}, {"w": "because", "b": [0.3538, 0.2792, 0.4285, 0.2977]}, {"w": "they", "b": [0.4345, 0.2792, 0.4751, 0.2977]}, {"w": "come", "b": [0.481, 0.2792, 0.5322, 0.2977]}, {"w": "from", "b": [0.5381, 0.2792, 0.584, 0.2977]}, {"w": "a", "b": [0.5899, 0.2792, 0.6004, 0.2977]}, {"w": "small", "b": [0.6063, 0.2792, 0.6574, 0.2977]}, {"w": "number", "b": [0.6633, 0.2792, 0.7355, 0.2977]}, {"w": "of", "b": [0.7414, 0.2792, 0.7611, 0.2977]}, {"w": "original", "b": [0.767, 0.2792, 0.8404, 0.2977]}, {"w": "images—you", "b": [0.1289, 0.2984, 0.2548, 0.3169]}, {"w": "can’t", "b": [0.2607, 0.2984, 0.3075, 0.3169]}, {"w": "produce", "b": [0.3134, 0.2984, 0.3894, 0.3169]}, {"w": "new", "b": [0.3953, 0.2984, 0.4347, 0.3169]}, {"w": "information,", "b": [0.4406, 0.2984, 0.558, 0.3169]}, {"w": "you", "b": [0.5639, 0.2984, 0.5993, 0.3169]}, {"w": "can", "b": [0.6052, 0.2984, 0.638, 0.3169]}, {"w": "only", "b": [0.6439, 0.2984, 0.6859, 0.3169]}, {"w": "remix", "b": [0.6918, 0.2984, 0.7469, 0.3169]}, {"w": "existing", "b": [0.7528, 0.2984, 0.8276, 0.3169]}, {"w": "information.", "b": [0.1289, 0.3176, 0.2463, 0.3361]}, {"w": "As", "b": [0.2522, 0.3176, 0.2784, 0.3361]}, {"w": "such,", "b": [0.2843, 0.3176, 0.3335, 0.3361]}, {"w": "this", "b": [0.3394, 0.3176, 0.3735, 0.3361]}, {"w": "may", "b": [0.3795, 0.3176, 0.4201, 0.3361]}, {"w": "not", "b": [0.426, 0.3176, 0.4562, 0.3361]}, {"w": "be", "b": [0.4621, 0.3176, 0.4844, 0.3361]}, {"w": "enough", "b": [0.4903, 0.3176, 0.5598, 0.3361]}, {"w": "to", "b": [0.5657, 0.3176, 0.5841, 0.3361]}, {"w": "completely", "b": [0.59, 0.3176, 0.6949, 0.3361]}, {"w": "get", "b": [0.7008, 0.3176, 0.7297, 0.3361]}, {"w": "rid", "b": [0.7356, 0.3176, 0.7618, 0.3361]}, {"w": "of", "b": [0.7677, 0.3176, 0.7874, 0.3361]}, {"w": "overfitting.", "b": [0.1289, 0.3368, 0.2345, 0.3553]}, {"w": "To", "b": [0.2404, 0.3368, 0.2649, 0.3553]}, {"w": "further", "b": [0.2709, 0.3368, 0.3351, 0.3553]}, {"w": "fight", "b": [0.341, 0.3368, 0.3856, 0.3553]}, {"w": "overfitting,", "b": [0.3915, 0.3368, 0.4971, 0.3553]}, {"w": "you’ll", "b": [0.503, 0.3368, 0.5594, 0.3553]}, {"w": "also", "b": [0.5654, 0.3368, 0.6034, 0.3553]}, {"w": "add", "b": [0.6093, 0.3368, 0.6434, 0.3553]}, {"w": "a", "b": [0.6493, 0.3368, 0.6598, 0.3553]}, {"w": "Dropout", "b": [0.6656, 0.3378, 0.7648, 0.3567]}, {"w": "layer", "b": [0.7707, 0.3368, 0.8179, 0.3553]}, {"w": "to", "b": [0.8238, 0.3368, 0.8422, 0.3553]}, {"w": "your", "b": [0.1289, 0.3568, 0.1722, 0.3753]}, {"w": "model,", "b": [0.1781, 0.3568, 0.243, 0.3753]}, {"w": "right", "b": [0.2489, 0.3568, 0.2935, 0.3753]}, {"w": "before", "b": [0.2994, 0.3568, 0.3597, 0.3753]}, {"w": "the", "b": [0.3656, 0.3568, 0.3945, 0.3753]}, {"w": "densely", "b": [0.4004, 0.3568, 0.4725, 0.3753]}, {"w": "connected", "b": [0.4784, 0.3568, 0.5742, 0.3753]}, {"w": "classifier.", "b": [0.5801, 0.3568, 0.6699, 0.3753]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.13. Defining a new convnet that includes dropout", "words": [{"w": "Listing", "b": [0.1289, 0.3923, 0.182, 0.4061]}, {"w": "5.13.", "b": [0.1865, 0.3923, 0.2219, 0.4061]}, {"w": "Defining", "b": [0.2263, 0.3923, 0.2912, 0.4061]}, {"w": "a", "b": [0.2957, 0.3923, 0.3045, 0.4061]}, {"w": "new", "b": [0.3089, 0.3923, 0.3394, 0.4061]}, {"w": "convnet", "b": [0.3439, 0.3923, 0.4029, 0.4061]}, {"w": "that", "b": [0.4073, 0.3923, 0.4378, 0.4061]}, {"w": "includes", "b": [0.4423, 0.3923, 0.5043, 0.4061]}, {"w": "dropout", "b": [0.5087, 0.3923, 0.5694, 0.4061]}]}, {"id": "b_3", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Flatten()) model.add(layers.Dropout(0.5)) model.add(layers.Dense(512, activation='relu')) model.add(layers.Dense(1, activation='sigmoid')) model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=1e-4), metrics=['acc'])", "words": [{"w": "model", "b": [0.1348, 0.4189, 0.1879, 0.433]}, {"w": "=", "b": [0.1985, 0.4189, 0.2092, 0.433]}, {"w": "models.Sequential()", "b": [0.2198, 0.4189, 0.4217, 0.433]}, {"w": "model.add(layers.Conv2D(32,", "b": [0.1348, 0.4331, 0.4217, 0.4472]}, {"w": "(3,", "b": [0.4323, 0.4331, 0.4642, 0.4472]}, {"w": "3),", "b": [0.4748, 0.4331, 0.5067, 0.4472]}, {"w": "activation='relu',", "b": [0.5173, 0.4331, 0.7086, 0.4472]}, {"w": "input_shape=(150,", "b": [0.3898, 0.4472, 0.5705, 0.4614]}, {"w": "150,", "b": [0.5811, 0.4472, 0.6236, 0.4614]}, {"w": "3)))", "b": [0.6342, 0.4472, 0.6767, 0.4614]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.4614, 0.4855, 0.4756]}, {"w": "2)))", "b": [0.4961, 0.4614, 0.5386, 0.4756]}, {"w": "model.add(layers.Conv2D(64,", "b": [0.1348, 0.4756, 0.4217, 0.4898]}, {"w": "(3,", "b": [0.4323, 0.4756, 0.4642, 0.4898]}, {"w": "3),", "b": [0.4748, 0.4756, 0.5067, 0.4898]}, {"w": "activation='relu'))", "b": [0.5173, 0.4756, 0.7192, 0.4898]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.4898, 0.4855, 0.504]}, {"w": "2)))", "b": [0.4961, 0.4898, 0.5386, 0.504]}, {"w": "model.add(layers.Conv2D(128,", "b": [0.1348, 0.504, 0.4323, 0.5182]}, {"w": "(3,", "b": [0.443, 0.504, 0.4748, 0.5182]}, {"w": "3),", "b": [0.4855, 0.504, 0.5173, 0.5182]}, {"w": "activation='relu'))", "b": [0.528, 0.504, 0.7299, 0.5182]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.5182, 0.4855, 0.5323]}, {"w": "2)))", "b": [0.4961, 0.5182, 0.5386, 0.5323]}, {"w": "model.add(layers.Conv2D(128,", "b": [0.1348, 0.5323, 0.4323, 0.5465]}, {"w": "(3,", "b": [0.443, 0.5323, 0.4748, 0.5465]}, {"w": "3),", "b": [0.4855, 0.5323, 0.5173, 0.5465]}, {"w": "activation='relu'))", "b": [0.528, 0.5323, 0.7299, 0.5465]}, {"w": "model.add(layers.MaxPooling2D((2,", "b": [0.1348, 0.5465, 0.4855, 0.5607]}, {"w": "2)))", "b": [0.4961, 0.5465, 0.5386, 0.5607]}, {"w": "model.add(layers.Flatten())", "b": [0.1348, 0.5607, 0.4217, 0.5749]}, {"w": "model.add(layers.Dropout(0.5))", "b": [0.1348, 0.5749, 0.4536, 0.5891]}, {"w": "model.add(layers.Dense(512,", "b": [0.1348, 0.5891, 0.4217, 0.6033]}, {"w": "activation='relu'))", "b": [0.4323, 0.5891, 0.6342, 0.6033]}, {"w": "model.add(layers.Dense(1,", "b": [0.1348, 0.6033, 0.4004, 0.6174]}, {"w": "activation='sigmoid'))", "b": [0.4111, 0.6033, 0.6449, 0.6174]}, {"w": "model.compile(loss='binary_crossentropy',", "b": [0.1348, 0.6316, 0.5705, 0.6458]}, {"w": "optimizer=optimizers.RMSprop(lr=1e-4),", "b": [0.2836, 0.6458, 0.6874, 0.66]}, {"w": "metrics=['acc'])", "b": [0.2836, 0.66, 0.4536, 0.6742]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s train the network using data augmentation and dropout.", "words": [{"w": "Let’s", "b": [0.1289, 0.6956, 0.1761, 0.7141]}, {"w": "train", "b": [0.182, 0.6956, 0.2253, 0.7141]}, {"w": "the", "b": [0.2312, 0.6956, 0.26, 0.7141]}, {"w": "network", "b": [0.2659, 0.6956, 0.3433, 0.7141]}, {"w": "using", "b": [0.3492, 0.6956, 0.4004, 0.7141]}, {"w": "data", "b": [0.4063, 0.6956, 0.4457, 0.7141]}, {"w": "augmentation", "b": [0.4516, 0.6956, 0.5801, 0.7141]}, {"w": "and", "b": [0.586, 0.6956, 0.6201, 0.7141]}, {"w": "dropout.", "b": [0.626, 0.6956, 0.7054, 0.7141]}]}, {"id": "b_5", "type": "equation", "text": "Listing 5.14. Training the convnet using data-augmentation generators", "words": [{"w": "Listing", "b": [0.1289, 0.7352, 0.182, 0.7491]}, {"w": "5.14.", "b": [0.1865, 0.7352, 0.2219, 0.7491]}, {"w": "Training", "b": [0.2263, 0.7352, 0.2919, 0.7491]}, {"w": "the", "b": [0.2963, 0.7352, 0.3199, 0.7491]}, {"w": "convnet", "b": [0.3244, 0.7352, 0.3834, 0.7491]}, {"w": "using", "b": [0.3878, 0.7352, 0.4282, 0.7491]}, {"w": "data-augmentation", "b": [0.4326, 0.7352, 0.5763, 0.7491]}, {"w": "generators", "b": [0.5807, 0.7352, 0.6614, 0.7491]}]}, {"id": "b_6", "type": "paragraph", "text": "train_datagen = ImageDataGenerator( rescale=1./255, rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True,) test_datagen = ImageDataGenerator(rescale=1./255) 1", "words": [{"w": "train_datagen", "b": [0.1348, 0.7618, 0.2729, 0.776]}, {"w": "=", "b": [0.2836, 0.7618, 0.2942, 0.776]}, {"w": "ImageDataGenerator(", "b": [0.3048, 0.7618, 0.5067, 0.776]}, {"w": "rescale=1./255,", "b": [0.1773, 0.776, 0.3367, 0.7902]}, {"w": "rotation_range=40,", "b": [0.1773, 0.7902, 0.3686, 0.8044]}, {"w": "width_shift_range=0.2,", "b": [0.1773, 0.8044, 0.4111, 0.8185]}, {"w": "height_shift_range=0.2,", "b": [0.1773, 0.8185, 0.4217, 0.8327]}, {"w": "shear_range=0.2,", "b": [0.1773, 0.8327, 0.3473, 0.8469]}, {"w": "zoom_range=0.2,", "b": [0.1773, 0.8469, 0.3367, 0.8611]}, {"w": "horizontal_flip=True,)", "b": [0.1773, 0.8611, 0.4111, 0.8753]}, {"w": "test_datagen", "b": [0.1348, 0.8895, 0.2623, 0.9036]}, {"w": "=", "b": [0.2729, 0.8895, 0.2836, 0.9036]}, {"w": "ImageDataGenerator(rescale=1./255)", "b": [0.2942, 0.8895, 0.6555, 0.9036]}, {"w": "1", "b": [0.815, 0.8895, 0.8256, 0.9036]}]}]}, {"page": 196, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "train_generator = train_datagen.flow_from_directory( train_dir, 2 target_size=(150, 150), 3 batch_size=32, class_mode='binary') 4 validation_generator = test_datagen.flow_from_directory( validation_dir, target_size=(150, 150), batch_size=32, class_mode='binary') history = model.fit_generator( train_generator, steps_per_epoch=100, epochs=100, validation_data=validation_generator, validation_steps=50)", "words": [{"w": "train_generator", "b": [0.1348, 0.0993, 0.2942, 0.1135]}, {"w": "=", "b": [0.3048, 0.0993, 0.3154, 0.1135]}, {"w": "train_datagen.flow_from_directory(", "b": [0.3261, 0.0993, 0.6874, 0.1135]}, {"w": "train_dir,", "b": [0.2198, 0.1135, 0.3261, 0.1277]}, {"w": "2", "b": [0.815, 0.1135, 0.8256, 0.1277]}, {"w": "target_size=(150,", "b": [0.2198, 0.1277, 0.4004, 0.1418]}, {"w": "150),", "b": [0.4111, 0.1277, 0.4642, 0.1418]}, {"w": "3", "b": [0.815, 0.1277, 0.8256, 0.1418]}, {"w": "batch_size=32,", "b": [0.2198, 0.1419, 0.3686, 0.156]}, {"w": "class_mode='binary')", "b": [0.2198, 0.156, 0.4323, 0.1702]}, {"w": "4", "b": [0.815, 0.156, 0.8256, 0.1702]}, {"w": "validation_generator", "b": [0.1348, 0.1844, 0.3473, 0.1986]}, {"w": "=", "b": [0.3579, 0.1844, 0.3686, 0.1986]}, {"w": "test_datagen.flow_from_directory(", "b": [0.3792, 0.1844, 0.7299, 0.1986]}, {"w": "validation_dir,", "b": [0.2198, 0.1986, 0.3792, 0.2128]}, {"w": "target_size=(150,", "b": [0.2198, 0.2128, 0.4004, 0.227]}, {"w": "150),", "b": [0.4111, 0.2128, 0.4642, 0.227]}, {"w": "batch_size=32,", "b": [0.2198, 0.227, 0.3686, 0.2411]}, {"w": "class_mode='binary')", "b": [0.2198, 0.2411, 0.4323, 0.2553]}, {"w": "history", "b": [0.1348, 0.2695, 0.2092, 0.2837]}, {"w": "=", "b": [0.2198, 0.2695, 0.2304, 0.2837]}, {"w": "model.fit_generator(", "b": [0.241, 0.2695, 0.4536, 0.2837]}, {"w": "train_generator,", "b": [0.1985, 0.2837, 0.3686, 0.2979]}, {"w": "steps_per_epoch=100,", "b": [0.1985, 0.2979, 0.4111, 0.3121]}, {"w": "epochs=100,", "b": [0.1985, 0.3121, 0.3154, 0.3262]}, {"w": "validation_data=validation_generator,", "b": [0.1985, 0.3263, 0.5917, 0.3404]}, {"w": "validation_steps=50)", "b": [0.1985, 0.3404, 0.4111, 0.3546]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Note that the validation data shouldn’t be augmented! 2 Target directory 3 Resizes all images to 150 × 150 4 Because you use binary_crossentropy loss, you need binary labels.", "words": [{"w": "1", "b": [0.1761, 0.3719, 0.1879, 0.3903]}, {"w": "Note", "b": [0.1938, 0.3719, 0.241, 0.3903]}, {"w": "that", "b": [0.2469, 0.3719, 0.2876, 0.3903]}, {"w": "the", "b": [0.2935, 0.3719, 0.325, 0.3903]}, {"w": "validation", "b": [0.3309, 0.3719, 0.4319, 0.3903]}, {"w": "data", "b": [0.4378, 0.3719, 0.4824, 0.3903]}, {"w": "shouldn’t", "b": [0.4883, 0.3719, 0.5841, 0.3903]}, {"w": "be", "b": [0.59, 0.3719, 0.6137, 0.3903]}, {"w": "augmented!", "b": [0.6196, 0.3719, 0.7389, 0.3903]}, {"w": "2", "b": [0.1761, 0.3911, 0.1879, 0.4095]}, {"w": "Target", "b": [0.1938, 0.3911, 0.2598, 0.4095]}, {"w": "directory", "b": [0.2658, 0.3911, 0.3584, 0.4095]}, {"w": "3", "b": [0.1761, 0.4102, 0.1879, 0.4287]}, {"w": "Resizes", "b": [0.1938, 0.4102, 0.2673, 0.4287]}, {"w": "all", "b": [0.2732, 0.4102, 0.2981, 0.4287]}, {"w": "images", "b": [0.304, 0.4102, 0.3735, 0.4287]}, {"w": "to", "b": [0.3794, 0.4102, 0.3991, 0.4287]}, {"w": "150", "b": [0.405, 0.4102, 0.4404, 0.4287]}, {"w": "×", "b": [0.4463, 0.4102, 0.4598, 0.4287]}, {"w": "150", "b": [0.4657, 0.4102, 0.5011, 0.4287]}, {"w": "4", "b": [0.1761, 0.4294, 0.1879, 0.4479]}, {"w": "Because", "b": [0.1938, 0.4294, 0.2751, 0.4479]}, {"w": "you", "b": [0.281, 0.4294, 0.3178, 0.4479]}, {"w": "use", "b": [0.3237, 0.4294, 0.3565, 0.4479]}, {"w": "binary_crossentropy", "b": [0.3624, 0.4294, 0.5701, 0.4479]}, {"w": "loss,", "b": [0.576, 0.4294, 0.6187, 0.4479]}, {"w": "you", "b": [0.6246, 0.4294, 0.6613, 0.4479]}, {"w": "need", "b": [0.6672, 0.4294, 0.7145, 0.4479]}, {"w": "binary", "b": [0.7204, 0.4294, 0.7873, 0.4479]}, {"w": "labels.", "b": [0.7932, 0.4294, 0.8568, 0.4479]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s save the model—you’ll use it in section 5.4.", "words": [{"w": "Let’s", "b": [0.1289, 0.4695, 0.1761, 0.488]}, {"w": "save", "b": [0.182, 0.4695, 0.224, 0.488]}, {"w": "the", "b": [0.2299, 0.4695, 0.2587, 0.488]}, {"w": "model—you’ll", "b": [0.2646, 0.4695, 0.4037, 0.488]}, {"w": "use", "b": [0.4096, 0.4695, 0.4411, 0.488]}, {"w": "it", "b": [0.447, 0.4695, 0.4601, 0.488]}, {"w": "in", "b": [0.466, 0.4695, 0.4844, 0.488]}, {"w": "section", "b": [0.4902, 0.4695, 0.5571, 0.488]}, {"w": "5.4.", "b": [0.563, 0.4695, 0.5984, 0.488]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.15. Saving the model", "words": [{"w": "Listing", "b": [0.1289, 0.5049, 0.182, 0.5188]}, {"w": "5.15.", "b": [0.1865, 0.5049, 0.2219, 0.5188]}, {"w": "Saving", "b": [0.2263, 0.5049, 0.2775, 0.5188]}, {"w": "the", "b": [0.2819, 0.5049, 0.3055, 0.5188]}, {"w": "model", "b": [0.3099, 0.5049, 0.3562, 0.5188]}]}, {"id": "b_4", "type": "equation", "text": "model.save('cats_and_dogs_small_2.h5')", "words": [{"w": "model.save('cats_and_dogs_small_2.h5')", "b": [0.1348, 0.5315, 0.5386, 0.5457]}]}, {"id": "b_5", "type": "paragraph", "text": "And let’s plot the results again: see figures 5.12 and 5.13. Thanks to data augmentation and dropout, you’re no longer overfitting: the training curves are closely tracking the validation curves. You now reach an accuracy of 82%, a 15% relative improvement over the non-regularized model.", "words": [{"w": "And", "b": [0.1289, 0.5671, 0.1695, 0.5856]}, {"w": "let’s", "b": [0.1754, 0.5671, 0.2148, 0.5856]}, {"w": "plot", "b": [0.2207, 0.5671, 0.2574, 0.5856]}, {"w": "the", "b": [0.2634, 0.5671, 0.2922, 0.5856]}, {"w": "results", "b": [0.2981, 0.5671, 0.3598, 0.5856]}, {"w": "again:", "b": [0.3657, 0.5671, 0.4234, 0.5856]}, {"w": "see", "b": [0.4293, 0.5671, 0.4594, 0.5856]}, {"w": "figures", "b": [0.4653, 0.5671, 0.5309, 0.5856]}, {"w": "5.12", "b": [0.5368, 0.5671, 0.5781, 0.5856]}, {"w": "and", "b": [0.584, 0.5671, 0.6181, 0.5856]}, {"w": "5.13.", "b": [0.624, 0.5671, 0.6712, 0.5856]}, {"w": "Thanks", "b": [0.6771, 0.5671, 0.7467, 0.5856]}, {"w": "to", "b": [0.7526, 0.5671, 0.7709, 0.5856]}, {"w": "data", "b": [0.7768, 0.5671, 0.8162, 0.5856]}, {"w": "augmentation", "b": [0.1289, 0.5863, 0.2574, 0.6048]}, {"w": "and", "b": [0.2633, 0.5863, 0.2974, 0.6048]}, {"w": "dropout,", "b": [0.3033, 0.5863, 0.3827, 0.6048]}, {"w": "you’re", "b": [0.3886, 0.5863, 0.4502, 0.6048]}, {"w": "no", "b": [0.4562, 0.5863, 0.4798, 0.6048]}, {"w": "longer", "b": [0.4857, 0.5863, 0.546, 0.6048]}, {"w": "overfitting:", "b": [0.5519, 0.5863, 0.6582, 0.6048]}, {"w": "the", "b": [0.6641, 0.5863, 0.6929, 0.6048]}, {"w": "training", "b": [0.6988, 0.5863, 0.7723, 0.6048]}, {"w": "curves", "b": [0.7782, 0.5863, 0.8398, 0.6048]}, {"w": "are", "b": [0.1289, 0.6055, 0.1577, 0.624]}, {"w": "closely", "b": [0.1636, 0.6055, 0.2305, 0.624]}, {"w": "tracking", "b": [0.2364, 0.6055, 0.3138, 0.624]}, {"w": "the", "b": [0.3197, 0.6055, 0.3486, 0.624]}, {"w": "validation", "b": [0.3545, 0.6055, 0.4489, 0.624]}, {"w": "curves.", "b": [0.4548, 0.6055, 0.5223, 0.624]}, {"w": "You", "b": [0.5282, 0.6055, 0.5665, 0.624]}, {"w": "now", "b": [0.5724, 0.6055, 0.6131, 0.624]}, {"w": "reach", "b": [0.619, 0.6055, 0.6701, 0.624]}, {"w": "an", "b": [0.676, 0.6055, 0.6983, 0.624]}, {"w": "accuracy", "b": [0.7042, 0.6055, 0.7881, 0.624]}, {"w": "of", "b": [0.794, 0.6055, 0.8137, 0.624]}, {"w": "82%,", "b": [0.8196, 0.6055, 0.8688, 0.624]}, {"w": "a", "b": [0.1289, 0.6247, 0.1394, 0.6432]}, {"w": "15%", "b": [0.1453, 0.6247, 0.1886, 0.6432]}, {"w": "relative", "b": [0.1945, 0.6247, 0.2653, 0.6432]}, {"w": "improvement", "b": [0.2712, 0.6247, 0.3971, 0.6432]}, {"w": "over", "b": [0.403, 0.6247, 0.445, 0.6432]}, {"w": "the", "b": [0.4509, 0.6247, 0.4797, 0.6432]}, {"w": "non-regularized", "b": [0.4856, 0.6247, 0.6352, 0.6432]}, {"w": "model.", "b": [0.6411, 0.6247, 0.706, 0.6432]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 5.12. Training and validation accuracy with data augmentation", "words": [{"w": "Figure", "b": [0.1289, 0.6643, 0.1787, 0.6781]}, {"w": "5.12.", "b": [0.1832, 0.6643, 0.2186, 0.6781]}, {"w": "Training", "b": [0.223, 0.6643, 0.2886, 0.6781]}, {"w": "and", "b": [0.293, 0.6643, 0.3216, 0.6781]}, {"w": "validation", "b": [0.326, 0.6643, 0.4018, 0.6781]}, {"w": "accuracy", "b": [0.4062, 0.6643, 0.4741, 0.6781]}, {"w": "with", "b": [0.4785, 0.6643, 0.512, 0.6781]}, {"w": "data", "b": [0.5164, 0.6643, 0.5499, 0.6781]}, {"w": "augmentation", "b": [0.5543, 0.6643, 0.6586, 0.6781]}]}]}, {"page": 197, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 5.13. Training and validation loss with data augmentation", "words": [{"w": "Figure", "b": [0.1289, 0.3355, 0.1787, 0.3494]}, {"w": "5.13.", "b": [0.1832, 0.3355, 0.2186, 0.3494]}, {"w": "Training", "b": [0.223, 0.3355, 0.2886, 0.3494]}, {"w": "and", "b": [0.293, 0.3355, 0.3216, 0.3494]}, {"w": "validation", "b": [0.326, 0.3355, 0.4018, 0.3494]}, {"w": "loss", "b": [0.4062, 0.3355, 0.4338, 0.3494]}, {"w": "with", "b": [0.4382, 0.3355, 0.4717, 0.3494]}, {"w": "data", "b": [0.4761, 0.3355, 0.5095, 0.3494]}, {"w": "augmentation", "b": [0.514, 0.3355, 0.6183, 0.3494]}]}, {"id": "b_1", "type": "paragraph", "text": "By using regularization techniques even further, and by tuning the network’s parameters (such as the number of filters per convolution layer, or the number of layers in the network), you may be able to get an even better accuracy, likely up to 86% or 87%. But it would prove difficult to go any higher just by training your own convnet from scratch, because you have so little data to work with. As a next step to improve your accuracy on this problem, you’ll have to use a pretrained model, which is the focus of the next two sections.", "words": [{"w": "By", "b": [0.1289, 0.6213, 0.1564, 0.6398]}, {"w": "using", "b": [0.1623, 0.6213, 0.2135, 0.6398]}, {"w": "regularization", "b": [0.2194, 0.6213, 0.3506, 0.6398]}, {"w": "techniques", "b": [0.3565, 0.6213, 0.4575, 0.6398]}, {"w": "even", "b": [0.4634, 0.6213, 0.508, 0.6398]}, {"w": "further,", "b": [0.5139, 0.6213, 0.583, 0.6398]}, {"w": "and", "b": [0.5889, 0.6213, 0.623, 0.6398]}, {"w": "by", "b": [0.6289, 0.6213, 0.6525, 0.6398]}, {"w": "tuning", "b": [0.6584, 0.6213, 0.7188, 0.6398]}, {"w": "the", "b": [0.7247, 0.6213, 0.7536, 0.6398]}, {"w": "network’s", "b": [0.7595, 0.6213, 0.8526, 0.6398]}, {"w": "parameters", "b": [0.1289, 0.6405, 0.2325, 0.659]}, {"w": "(such", "b": [0.2384, 0.6405, 0.2895, 0.659]}, {"w": "as", "b": [0.2954, 0.6405, 0.3151, 0.659]}, {"w": "the", "b": [0.321, 0.6405, 0.3499, 0.659]}, {"w": "number", "b": [0.3558, 0.6405, 0.4279, 0.659]}, {"w": "of", "b": [0.4338, 0.6405, 0.4535, 0.659]}, {"w": "filters", "b": [0.4594, 0.6405, 0.5145, 0.659]}, {"w": "per", "b": [0.5204, 0.6405, 0.5505, 0.659]}, {"w": "convolution", "b": [0.5564, 0.6405, 0.6692, 0.659]}, {"w": "layer,", "b": [0.6751, 0.6405, 0.7273, 0.659]}, {"w": "or", "b": [0.7332, 0.6405, 0.7528, 0.659]}, {"w": "the", "b": [0.7587, 0.6405, 0.7876, 0.659]}, {"w": "number", "b": [0.7935, 0.6405, 0.8657, 0.659]}, {"w": "of", "b": [0.1289, 0.6597, 0.1485, 0.6782]}, {"w": "layers", "b": [0.1545, 0.6597, 0.2108, 0.6782]}, {"w": "in", "b": [0.2167, 0.6597, 0.2351, 0.6782]}, {"w": "the", "b": [0.241, 0.6597, 0.2699, 0.6782]}, {"w": "network),", "b": [0.2758, 0.6597, 0.3669, 0.6782]}, {"w": "you", "b": [0.3728, 0.6597, 0.4083, 0.6782]}, {"w": "may", "b": [0.4142, 0.6597, 0.4548, 0.6782]}, {"w": "be", "b": [0.4607, 0.6597, 0.483, 0.6782]}, {"w": "able", "b": [0.4889, 0.6597, 0.5283, 0.6782]}, {"w": "to", "b": [0.5342, 0.6597, 0.5525, 0.6782]}, {"w": "get", "b": [0.5585, 0.6597, 0.5873, 0.6782]}, {"w": "an", "b": [0.5932, 0.6597, 0.6155, 0.6782]}, {"w": "even", "b": [0.6214, 0.6597, 0.666, 0.6782]}, {"w": "better", "b": [0.6719, 0.6597, 0.7257, 0.6782]}, {"w": "accuracy,", "b": [0.7316, 0.6597, 0.8197, 0.6782]}, {"w": "likely", "b": [0.1289, 0.6789, 0.1827, 0.6974]}, {"w": "up", "b": [0.1886, 0.6789, 0.2122, 0.6974]}, {"w": "to", "b": [0.2181, 0.6789, 0.2365, 0.6974]}, {"w": "86%", "b": [0.2424, 0.6789, 0.2857, 0.6974]}, {"w": "or", "b": [0.2915, 0.6789, 0.3112, 0.6974]}, {"w": "87%.", "b": [0.3171, 0.6789, 0.3663, 0.6974]}, {"w": "But", "b": [0.3722, 0.6789, 0.4063, 0.6974]}, {"w": "it", "b": [0.4122, 0.6789, 0.4253, 0.6974]}, {"w": "would", "b": [0.4313, 0.6789, 0.4903, 0.6974]}, {"w": "prove", "b": [0.4962, 0.6789, 0.55, 0.6974]}, {"w": "difficult", "b": [0.5559, 0.6789, 0.6315, 0.6974]}, {"w": "to", "b": [0.6374, 0.6789, 0.6558, 0.6974]}, {"w": "go", "b": [0.6617, 0.6789, 0.6853, 0.6974]}, {"w": "any", "b": [0.6912, 0.6789, 0.7253, 0.6974]}, {"w": "higher", "b": [0.7312, 0.6789, 0.7915, 0.6974]}, {"w": "just", "b": [0.7974, 0.6789, 0.8316, 0.6974]}, {"w": "by", "b": [0.8375, 0.6789, 0.8611, 0.6974]}, {"w": "training", "b": [0.1289, 0.6981, 0.2023, 0.7166]}, {"w": "your", "b": [0.2082, 0.6981, 0.2515, 0.7166]}, {"w": "own", "b": [0.2574, 0.6981, 0.2981, 0.7166]}, {"w": "convnet", "b": [0.304, 0.6981, 0.3788, 0.7166]}, {"w": "from", "b": [0.3847, 0.6981, 0.4306, 0.7166]}, {"w": "scratch,", "b": [0.4365, 0.6981, 0.5093, 0.7166]}, {"w": "because", "b": [0.5152, 0.6981, 0.5899, 0.7166]}, {"w": "you", "b": [0.5958, 0.6981, 0.6312, 0.7166]}, {"w": "have", "b": [0.6371, 0.6981, 0.6817, 0.7166]}, {"w": "so", "b": [0.6876, 0.6981, 0.7086, 0.7166]}, {"w": "little", "b": [0.7145, 0.6981, 0.7578, 0.7166]}, {"w": "data", "b": [0.7637, 0.6981, 0.803, 0.7166]}, {"w": "to", "b": [0.8089, 0.6981, 0.8273, 0.7166]}, {"w": "work", "b": [0.1289, 0.7173, 0.1774, 0.7358]}, {"w": "with.", "b": [0.1833, 0.7173, 0.2312, 0.7358]}, {"w": "As", "b": [0.2371, 0.7173, 0.2633, 0.7358]}, {"w": "a", "b": [0.2692, 0.7173, 0.2797, 0.7358]}, {"w": "next", "b": [0.2856, 0.7173, 0.3263, 0.7358]}, {"w": "step", "b": [0.3322, 0.7173, 0.3702, 0.7358]}, {"w": "to", "b": [0.3761, 0.7173, 0.3945, 0.7358]}, {"w": "improve", "b": [0.4004, 0.7173, 0.4791, 0.7358]}, {"w": "your", "b": [0.485, 0.7173, 0.5283, 0.7358]}, {"w": "accuracy", "b": [0.5342, 0.7173, 0.6181, 0.7358]}, {"w": "on", "b": [0.624, 0.7173, 0.6476, 0.7358]}, {"w": "this", "b": [0.6535, 0.7173, 0.6877, 0.7358]}, {"w": "problem,", "b": [0.6936, 0.7173, 0.7782, 0.7358]}, {"w": "you’ll", "b": [0.7841, 0.7173, 0.8405, 0.7358]}, {"w": "have", "b": [0.1289, 0.7365, 0.1735, 0.755]}, {"w": "to", "b": [0.1794, 0.7365, 0.1977, 0.755]}, {"w": "use", "b": [0.2036, 0.7365, 0.2351, 0.755]}, {"w": "a", "b": [0.241, 0.7365, 0.2515, 0.755]}, {"w": "pretrained", "b": [0.2574, 0.7365, 0.3531, 0.755]}, {"w": "model,", "b": [0.359, 0.7365, 0.424, 0.755]}, {"w": "which", "b": [0.4298, 0.7365, 0.4875, 0.755]}, {"w": "is", "b": [0.4935, 0.7365, 0.5092, 0.755]}, {"w": "the", "b": [0.5151, 0.7365, 0.544, 0.755]}, {"w": "focus", "b": [0.5499, 0.7365, 0.601, 0.755]}, {"w": "of", "b": [0.6069, 0.7365, 0.6266, 0.755]}, {"w": "the", "b": [0.6325, 0.7365, 0.6614, 0.755]}, {"w": "next", "b": [0.6673, 0.7365, 0.7079, 0.755]}, {"w": "two", "b": [0.7138, 0.7365, 0.7492, 0.755]}, {"w": "sections.", "b": [0.7552, 0.7365, 0.8371, 0.755]}]}, {"id": "b_2", "type": "paragraph", "text": "5.3. Using a pretrained convnet", "words": [{"w": "5.3.", "b": [0.1289, 0.7897, 0.1687, 0.8105]}, {"w": "Using", "b": [0.1754, 0.7897, 0.2403, 0.8105]}, {"w": "a", "b": [0.247, 0.7897, 0.2602, 0.8105]}, {"w": "pretrained", "b": [0.2669, 0.7897, 0.3874, 0.8105]}, {"w": "convnet", "b": [0.3941, 0.7897, 0.4826, 0.8105]}]}, {"id": "b_3", "type": "paragraph", "text": "A common and highly effective approach to deep learning on small image datasets is to use a pretrained network. A pretrained network is a saved network that was previously trained on a large dataset, typically on a large- scale image-classification task. If this original dataset is large enough and", "words": [{"w": "A", "b": [0.1289, 0.8324, 0.1459, 0.8509]}, {"w": "common", "b": [0.1518, 0.8324, 0.2345, 0.8509]}, {"w": "and", "b": [0.2404, 0.8324, 0.2745, 0.8509]}, {"w": "highly", "b": [0.2804, 0.8324, 0.3407, 0.8509]}, {"w": "effective", "b": [0.3467, 0.8324, 0.4288, 0.8509]}, {"w": "approach", "b": [0.4347, 0.8324, 0.5213, 0.8509]}, {"w": "to", "b": [0.5272, 0.8324, 0.5455, 0.8509]}, {"w": "deep", "b": [0.5514, 0.8324, 0.596, 0.8509]}, {"w": "learning", "b": [0.6019, 0.8324, 0.6793, 0.8509]}, {"w": "on", "b": [0.6852, 0.8324, 0.7088, 0.8509]}, {"w": "small", "b": [0.7147, 0.8324, 0.7659, 0.8509]}, {"w": "image", "b": [0.7718, 0.8324, 0.8295, 0.8509]}, {"w": "datasets", "b": [0.1289, 0.8516, 0.2036, 0.8701]}, {"w": "is", "b": [0.2095, 0.8516, 0.2253, 0.8701]}, {"w": "to", "b": [0.2312, 0.8516, 0.2496, 0.8701]}, {"w": "use", "b": [0.2555, 0.8516, 0.287, 0.8701]}, {"w": "a", "b": [0.2929, 0.8516, 0.3033, 0.8701]}, {"w": "pretrained", "b": [0.3092, 0.8516, 0.405, 0.8701]}, {"w": "network.", "b": [0.4109, 0.8516, 0.4942, 0.8701]}, {"w": "A", "b": [0.5001, 0.8516, 0.5171, 0.8701]}, {"w": "pretrained", "b": [0.523, 0.8516, 0.6218, 0.8701]}, {"w": "network", "b": [0.6277, 0.8516, 0.7038, 0.8701]}, {"w": "is", "b": [0.7097, 0.8516, 0.7254, 0.8701]}, {"w": "a", "b": [0.7313, 0.8516, 0.7418, 0.8701]}, {"w": "saved", "b": [0.7477, 0.8516, 0.8015, 0.8701]}, {"w": "network", "b": [0.1289, 0.8708, 0.2063, 0.8893]}, {"w": "that", "b": [0.2122, 0.8708, 0.2476, 0.8893]}, {"w": "was", "b": [0.2535, 0.8708, 0.2902, 0.8893]}, {"w": "previously", "b": [0.2961, 0.8708, 0.3958, 0.8893]}, {"w": "trained", "b": [0.4017, 0.8708, 0.4673, 0.8893]}, {"w": "on", "b": [0.4732, 0.8708, 0.4968, 0.8893]}, {"w": "a", "b": [0.5027, 0.8708, 0.5132, 0.8893]}, {"w": "large", "b": [0.5191, 0.8708, 0.5658, 0.8893]}, {"w": "dataset,", "b": [0.5717, 0.8708, 0.6432, 0.8893]}, {"w": "typically", "b": [0.6491, 0.8708, 0.7318, 0.8893]}, {"w": "on", "b": [0.7377, 0.8708, 0.7613, 0.8893]}, {"w": "a", "b": [0.7672, 0.8708, 0.7777, 0.8893]}, {"w": "large-", "b": [0.7836, 0.8708, 0.8382, 0.8893]}, {"w": "scale", "b": [0.1289, 0.89, 0.1761, 0.9085]}, {"w": "image-classification", "b": [0.182, 0.89, 0.3722, 0.9085]}, {"w": "task.", "b": [0.3781, 0.89, 0.422, 0.9085]}, {"w": "If", "b": [0.4279, 0.89, 0.4436, 0.9085]}, {"w": "this", "b": [0.4495, 0.89, 0.4836, 0.9085]}, {"w": "original", "b": [0.4895, 0.89, 0.563, 0.9085]}, {"w": "dataset", "b": [0.5689, 0.89, 0.6345, 0.9085]}, {"w": "is", "b": [0.6404, 0.89, 0.6561, 0.9085]}, {"w": "large", "b": [0.662, 0.89, 0.7088, 0.9085]}, {"w": "enough", "b": [0.7147, 0.89, 0.7842, 0.9085]}, {"w": "and", "b": [0.7901, 0.89, 0.8242, 0.9085]}]}]}, {"page": 198, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "general enough, then the spatial hierarchy of features learned by the pretrained network can effectively act as a generic model of the visual world, and hence its features can prove useful for many different computer-vision problems, even though these new problems may involve completely different classes than those of the original task. For instance, you might train a network on Image-Net (where classes are mostly animals and everyday objects) and then repurpose this trained network for something as remote as identifying furniture items in images. Such portability of learned features across different problems is a key advantage of deep learning compared to many older, shallow-learning approaches, and it makes deep learning very effective for small-data problems.", "words": [{"w": "general", "b": [0.1289, 0.0857, 0.1984, 0.1041]}, {"w": "enough,", "b": [0.2043, 0.0857, 0.2797, 0.1041]}, {"w": "then", "b": [0.2856, 0.0857, 0.3263, 0.1041]}, {"w": "the", "b": [0.3322, 0.0857, 0.361, 0.1041]}, {"w": "spatial", "b": [0.3669, 0.0857, 0.4286, 0.1041]}, {"w": "hierarchy", "b": [0.4345, 0.0857, 0.5237, 0.1041]}, {"w": "of", "b": [0.5296, 0.0857, 0.5492, 0.1041]}, {"w": "features", "b": [0.5551, 0.0857, 0.6299, 0.1041]}, {"w": "learned", "b": [0.6358, 0.0857, 0.7053, 0.1041]}, {"w": "by", "b": [0.7112, 0.0857, 0.7348, 0.1041]}, {"w": "the", "b": [0.7407, 0.0857, 0.7696, 0.1041]}, {"w": "pretrained", "b": [0.7755, 0.0857, 0.8712, 0.1041]}, {"w": "network", "b": [0.1289, 0.1049, 0.2063, 0.1233]}, {"w": "can", "b": [0.2122, 0.1049, 0.2449, 0.1233]}, {"w": "effectively", "b": [0.2508, 0.1049, 0.3514, 0.1233]}, {"w": "act", "b": [0.3573, 0.1049, 0.3848, 0.1233]}, {"w": "as", "b": [0.3907, 0.1049, 0.4104, 0.1233]}, {"w": "a", "b": [0.4163, 0.1049, 0.4268, 0.1233]}, {"w": "generic", "b": [0.4327, 0.1049, 0.5022, 0.1233]}, {"w": "model", "b": [0.5081, 0.1049, 0.5671, 0.1233]}, {"w": "of", "b": [0.573, 0.1049, 0.5927, 0.1233]}, {"w": "the", "b": [0.5986, 0.1049, 0.6275, 0.1233]}, {"w": "visual", "b": [0.6334, 0.1049, 0.6898, 0.1233]}, {"w": "world,", "b": [0.6957, 0.1049, 0.7567, 0.1233]}, {"w": "and", "b": [0.7626, 0.1049, 0.7967, 0.1233]}, {"w": "hence", "b": [0.8026, 0.1049, 0.8577, 0.1233]}, {"w": "its", "b": [0.1289, 0.124, 0.1512, 0.1425]}, {"w": "features", "b": [0.1571, 0.124, 0.2318, 0.1425]}, {"w": "can", "b": [0.2377, 0.124, 0.2705, 0.1425]}, {"w": "prove", "b": [0.2764, 0.124, 0.3302, 0.1425]}, {"w": "useful", "b": [0.3361, 0.124, 0.3938, 0.1425]}, {"w": "for", "b": [0.3997, 0.124, 0.4272, 0.1425]}, {"w": "many", "b": [0.4332, 0.124, 0.4856, 0.1425]}, {"w": "different", "b": [0.4915, 0.124, 0.5724, 0.1425]}, {"w": "computer-vision", "b": [0.5783, 0.124, 0.7326, 0.1425]}, {"w": "problems,", "b": [0.7385, 0.124, 0.8323, 0.1425]}, {"w": "even", "b": [0.1289, 0.1432, 0.1735, 0.1617]}, {"w": "though", "b": [0.1794, 0.1432, 0.245, 0.1617]}, {"w": "these", "b": [0.2509, 0.1432, 0.2994, 0.1617]}, {"w": "new", "b": [0.3053, 0.1432, 0.3446, 0.1617]}, {"w": "problems", "b": [0.3505, 0.1432, 0.4384, 0.1617]}, {"w": "may", "b": [0.4443, 0.1432, 0.485, 0.1617]}, {"w": "involve", "b": [0.4909, 0.1432, 0.5618, 0.1617]}, {"w": "completely", "b": [0.5677, 0.1432, 0.6726, 0.1617]}, {"w": "different", "b": [0.6785, 0.1432, 0.7593, 0.1617]}, {"w": "classes", "b": [0.7652, 0.1432, 0.8308, 0.1617]}, {"w": "than", "b": [0.1289, 0.1624, 0.1695, 0.1809]}, {"w": "those", "b": [0.1754, 0.1624, 0.2253, 0.1809]}, {"w": "of", "b": [0.2312, 0.1624, 0.2509, 0.1809]}, {"w": "the", "b": [0.2568, 0.1624, 0.2856, 0.1809]}, {"w": "original", "b": [0.2915, 0.1624, 0.365, 0.1809]}, {"w": "task.", "b": [0.3709, 0.1624, 0.4148, 0.1809]}, {"w": "For", "b": [0.4207, 0.1624, 0.4535, 0.1809]}, {"w": "instance,", "b": [0.4594, 0.1624, 0.5427, 0.1809]}, {"w": "you", "b": [0.5486, 0.1624, 0.584, 0.1809]}, {"w": "might", "b": [0.5899, 0.1624, 0.645, 0.1809]}, {"w": "train", "b": [0.6509, 0.1624, 0.6942, 0.1809]}, {"w": "a", "b": [0.7001, 0.1624, 0.7106, 0.1809]}, {"w": "network", "b": [0.7165, 0.1624, 0.7939, 0.1809]}, {"w": "on", "b": [0.7998, 0.1624, 0.8234, 0.1809]}, {"w": "Image-Net", "b": [0.1289, 0.1816, 0.2299, 0.2001]}, {"w": "(where", "b": [0.2358, 0.1816, 0.3013, 0.2001]}, {"w": "classes", "b": [0.3072, 0.1816, 0.3728, 0.2001]}, {"w": "are", "b": [0.3787, 0.1816, 0.4075, 0.2001]}, {"w": "mostly", "b": [0.4134, 0.1816, 0.4777, 0.2001]}, {"w": "animals", "b": [0.4836, 0.1816, 0.5571, 0.2001]}, {"w": "and", "b": [0.563, 0.1816, 0.5971, 0.2001]}, {"w": "everyday", "b": [0.603, 0.1816, 0.6896, 0.2001]}, {"w": "objects)", "b": [0.6955, 0.1816, 0.7702, 0.2001]}, {"w": "and", "b": [0.7761, 0.1816, 0.8102, 0.2001]}, {"w": "then", "b": [0.8161, 0.1816, 0.8568, 0.2001]}, {"w": "repurpose", "b": [0.1289, 0.2008, 0.222, 0.2193]}, {"w": "this", "b": [0.2279, 0.2008, 0.262, 0.2193]}, {"w": "trained", "b": [0.2679, 0.2008, 0.3335, 0.2193]}, {"w": "network", "b": [0.3394, 0.2008, 0.4168, 0.2193]}, {"w": "for", "b": [0.4227, 0.2008, 0.4502, 0.2193]}, {"w": "something", "b": [0.4561, 0.2008, 0.5545, 0.2193]}, {"w": "as", "b": [0.5604, 0.2008, 0.5801, 0.2193]}, {"w": "remote", "b": [0.586, 0.2008, 0.6516, 0.2193]}, {"w": "as", "b": [0.6575, 0.2008, 0.6772, 0.2193]}, {"w": "identifying", "b": [0.6831, 0.2008, 0.7867, 0.2193]}, {"w": "furniture", "b": [0.1289, 0.22, 0.2115, 0.2385]}, {"w": "items", "b": [0.2174, 0.22, 0.2686, 0.2385]}, {"w": "in", "b": [0.2745, 0.22, 0.2929, 0.2385]}, {"w": "images.", "b": [0.2988, 0.22, 0.3716, 0.2385]}, {"w": "Such", "b": [0.3775, 0.22, 0.4247, 0.2385]}, {"w": "portability", "b": [0.4306, 0.22, 0.529, 0.2385]}, {"w": "of", "b": [0.5349, 0.22, 0.5546, 0.2385]}, {"w": "learned", "b": [0.5605, 0.22, 0.63, 0.2385]}, {"w": "features", "b": [0.6358, 0.22, 0.7105, 0.2385]}, {"w": "across", "b": [0.7164, 0.22, 0.7755, 0.2385]}, {"w": "different", "b": [0.7814, 0.22, 0.8622, 0.2385]}, {"w": "problems", "b": [0.1289, 0.2392, 0.2168, 0.2577]}, {"w": "is", "b": [0.2227, 0.2392, 0.2384, 0.2577]}, {"w": "a", "b": [0.2443, 0.2392, 0.2548, 0.2577]}, {"w": "key", "b": [0.2607, 0.2392, 0.2948, 0.2577]}, {"w": "advantage", "b": [0.3007, 0.2392, 0.3965, 0.2577]}, {"w": "of", "b": [0.4024, 0.2392, 0.422, 0.2577]}, {"w": "deep", "b": [0.4279, 0.2392, 0.4725, 0.2577]}, {"w": "learning", "b": [0.4784, 0.2392, 0.5558, 0.2577]}, {"w": "compared", "b": [0.5617, 0.2392, 0.6548, 0.2577]}, {"w": "to", "b": [0.6607, 0.2392, 0.6791, 0.2577]}, {"w": "many", "b": [0.685, 0.2392, 0.7375, 0.2577]}, {"w": "older,", "b": [0.7434, 0.2392, 0.7968, 0.2577]}, {"w": "shallow-learning", "b": [0.1289, 0.2584, 0.2876, 0.2769]}, {"w": "approaches,", "b": [0.2935, 0.2584, 0.4056, 0.2769]}, {"w": "and", "b": [0.4115, 0.2584, 0.4456, 0.2769]}, {"w": "it", "b": [0.4515, 0.2584, 0.4646, 0.2769]}, {"w": "makes", "b": [0.4705, 0.2584, 0.5309, 0.2769]}, {"w": "deep", "b": [0.5368, 0.2584, 0.5813, 0.2769]}, {"w": "learning", "b": [0.5872, 0.2584, 0.6646, 0.2769]}, {"w": "very", "b": [0.6705, 0.2584, 0.7125, 0.2769]}, {"w": "effective", "b": [0.7184, 0.2584, 0.8005, 0.2769]}, {"w": "for", "b": [0.8064, 0.2584, 0.834, 0.2769]}, {"w": "small-data", "b": [0.1289, 0.2776, 0.2273, 0.2961]}, {"w": "problems.", "b": [0.2332, 0.2776, 0.327, 0.2961]}]}, {"id": "b_1", "type": "paragraph", "text": "In this case, let’s consider a large convnet trained on the ImageNet dataset (1.4 million labeled images and 1,000 different classes). ImageNet contains many animal classes, including different species of cats and dogs, and you can thus expect to perform well on the dogs-versus-cats classification problem.", "words": [{"w": "In", "b": [0.1289, 0.3176, 0.1485, 0.3361]}, {"w": "this", "b": [0.1545, 0.3176, 0.1886, 0.3361]}, {"w": "case,", "b": [0.1945, 0.3176, 0.241, 0.3361]}, {"w": "let’s", "b": [0.2469, 0.3176, 0.2863, 0.3361]}, {"w": "consider", "b": [0.2922, 0.3176, 0.3722, 0.3361]}, {"w": "a", "b": [0.3781, 0.3176, 0.3886, 0.3361]}, {"w": "large", "b": [0.3945, 0.3176, 0.4412, 0.3361]}, {"w": "convnet", "b": [0.4471, 0.3176, 0.5219, 0.3361]}, {"w": "trained", "b": [0.5278, 0.3176, 0.5934, 0.3361]}, {"w": "on", "b": [0.5993, 0.3176, 0.6229, 0.3361]}, {"w": "the", "b": [0.6288, 0.3176, 0.6577, 0.3361]}, {"w": "ImageNet", "b": [0.6636, 0.3176, 0.7567, 0.3361]}, {"w": "dataset", "b": [0.7626, 0.3176, 0.8282, 0.3361]}, {"w": "(1.4", "b": [0.1289, 0.3368, 0.1663, 0.3553]}, {"w": "million", "b": [0.1722, 0.3368, 0.2404, 0.3553]}, {"w": "labeled", "b": [0.2463, 0.3368, 0.3145, 0.3553]}, {"w": "images", "b": [0.3204, 0.3368, 0.3873, 0.3553]}, {"w": "and", "b": [0.3932, 0.3368, 0.4273, 0.3553]}, {"w": "1,000", "b": [0.4332, 0.3368, 0.4864, 0.3553]}, {"w": "different", "b": [0.4923, 0.3368, 0.5731, 0.3553]}, {"w": "classes).", "b": [0.579, 0.3368, 0.6583, 0.3553]}, {"w": "ImageNet", "b": [0.6642, 0.3368, 0.7573, 0.3553]}, {"w": "contains", "b": [0.7632, 0.3368, 0.8419, 0.3553]}, {"w": "many", "b": [0.1289, 0.356, 0.1813, 0.3745]}, {"w": "animal", "b": [0.1873, 0.356, 0.2515, 0.3745]}, {"w": "classes,", "b": [0.2574, 0.356, 0.3289, 0.3745]}, {"w": "including", "b": [0.3348, 0.356, 0.424, 0.3745]}, {"w": "different", "b": [0.4299, 0.356, 0.5108, 0.3745]}, {"w": "species", "b": [0.5167, 0.356, 0.5849, 0.3745]}, {"w": "of", "b": [0.5908, 0.356, 0.6104, 0.3745]}, {"w": "cats", "b": [0.6164, 0.356, 0.6531, 0.3745]}, {"w": "and", "b": [0.659, 0.356, 0.6931, 0.3745]}, {"w": "dogs,", "b": [0.699, 0.356, 0.7495, 0.3745]}, {"w": "and", "b": [0.7554, 0.356, 0.7895, 0.3745]}, {"w": "you", "b": [0.7954, 0.356, 0.8308, 0.3745]}, {"w": "can", "b": [0.8367, 0.356, 0.8695, 0.3745]}, {"w": "thus", "b": [0.1289, 0.3752, 0.1682, 0.3937]}, {"w": "expect", "b": [0.1741, 0.3752, 0.2358, 0.3937]}, {"w": "to", "b": [0.2417, 0.3752, 0.2601, 0.3937]}, {"w": "perform", "b": [0.2659, 0.3752, 0.342, 0.3937]}, {"w": "well", "b": [0.3479, 0.3752, 0.3886, 0.3937]}, {"w": "on", "b": [0.3945, 0.3752, 0.4181, 0.3937]}, {"w": "the", "b": [0.424, 0.3752, 0.4528, 0.3937]}, {"w": "dogs-versus-cats", "b": [0.4587, 0.3752, 0.6161, 0.3937]}, {"w": "classification", "b": [0.622, 0.3752, 0.7467, 0.3937]}, {"w": "problem.", "b": [0.7526, 0.3752, 0.8372, 0.3937]}]}, {"id": "b_2", "type": "paragraph", "text": "You’ll use the VGG16 architecture, developed by Karen Simonyan and Andrew Zisserman in 2014; it’s a simple and widely used convnet architecture for ImageNet.[1] Although it’s an older model, far from the current state of the art and somewhat heavier than many other recent models, I chose it because its architecture is similar to what you’re already familiar with and is easy to understand without introducing any new concepts. This may be your first encounter with one of these cutesy model names—VGG, ResNet, Inception, Inception-ResNet, Xception, and so on; you’ll get used to them, because they will come up frequently if you keep doing deep learning for computer vision.", "words": [{"w": "You’ll", "b": [0.1289, 0.4152, 0.1882, 0.4337]}, {"w": "use", "b": [0.1941, 0.4152, 0.2256, 0.4337]}, {"w": "the", "b": [0.2315, 0.4152, 0.2603, 0.4337]}, {"w": "VGG16", "b": [0.2662, 0.4152, 0.341, 0.4337]}, {"w": "architecture,", "b": [0.3469, 0.4152, 0.4643, 0.4337]}, {"w": "developed", "b": [0.4702, 0.4152, 0.5672, 0.4337]}, {"w": "by", "b": [0.5731, 0.4152, 0.5967, 0.4337]}, {"w": "Karen", "b": [0.6026, 0.4152, 0.6603, 0.4337]}, {"w": "Simonyan", "b": [0.6662, 0.4152, 0.762, 0.4337]}, {"w": "and", "b": [0.7679, 0.4152, 0.802, 0.4337]}, {"w": "Andrew", "b": [0.1289, 0.4344, 0.2049, 0.4529]}, {"w": "Zisserman", "b": [0.2108, 0.4344, 0.3092, 0.4529]}, {"w": "in", "b": [0.3151, 0.4344, 0.3335, 0.4529]}, {"w": "2014;", "b": [0.3394, 0.4344, 0.3932, 0.4529]}, {"w": "it’s", "b": [0.3991, 0.4344, 0.428, 0.4529]}, {"w": "a", "b": [0.4339, 0.4344, 0.4443, 0.4529]}, {"w": "simple", "b": [0.4502, 0.4344, 0.5132, 0.4529]}, {"w": "and", "b": [0.5191, 0.4344, 0.5532, 0.4529]}, {"w": "widely", "b": [0.5591, 0.4344, 0.6234, 0.4529]}, {"w": "used", "b": [0.6293, 0.4344, 0.6726, 0.4529]}, {"w": "convnet", "b": [0.6785, 0.4344, 0.7532, 0.4529]}, {"w": "architecture", "b": [0.7591, 0.4344, 0.8706, 0.4529]}, {"w": "for", "b": [0.1289, 0.4553, 0.1564, 0.4738]}, {"w": "ImageNet.[1]", "b": [0.1623, 0.4532, 0.2819, 0.4738]}, {"w": "Although", "b": [0.2878, 0.4553, 0.377, 0.4738]}, {"w": "it’s", "b": [0.383, 0.4553, 0.4118, 0.4738]}, {"w": "an", "b": [0.4177, 0.4553, 0.44, 0.4738]}, {"w": "older", "b": [0.4459, 0.4553, 0.4944, 0.4738]}, {"w": "model,", "b": [0.5003, 0.4553, 0.5653, 0.4738]}, {"w": "far", "b": [0.5712, 0.4553, 0.5974, 0.4738]}, {"w": "from", "b": [0.6033, 0.4553, 0.6492, 0.4738]}, {"w": "the", "b": [0.6551, 0.4553, 0.684, 0.4738]}, {"w": "current", "b": [0.6899, 0.4553, 0.7568, 0.4738]}, {"w": "state", "b": [0.7627, 0.4553, 0.8059, 0.4738]}, {"w": "of", "b": [0.8119, 0.4553, 0.8315, 0.4738]}, {"w": "the", "b": [0.8374, 0.4553, 0.8663, 0.4738]}, {"w": "art", "b": [0.1289, 0.4745, 0.1538, 0.493]}, {"w": "and", "b": [0.1597, 0.4745, 0.1938, 0.493]}, {"w": "somewhat", "b": [0.1997, 0.4745, 0.2955, 0.493]}, {"w": "heavier", "b": [0.3014, 0.4745, 0.3709, 0.493]}, {"w": "than", "b": [0.3768, 0.4745, 0.4174, 0.493]}, {"w": "many", "b": [0.4233, 0.4745, 0.4758, 0.493]}, {"w": "other", "b": [0.4817, 0.4745, 0.5302, 0.493]}, {"w": "recent", "b": [0.5361, 0.4745, 0.5938, 0.493]}, {"w": "models,", "b": [0.5997, 0.4745, 0.6739, 0.493]}, {"w": "I", "b": [0.6798, 0.4745, 0.6876, 0.493]}, {"w": "chose", "b": [0.6934, 0.4745, 0.7472, 0.493]}, {"w": "it", "b": [0.7531, 0.4745, 0.7662, 0.493]}, {"w": "because", "b": [0.7721, 0.4745, 0.8469, 0.493]}, {"w": "its", "b": [0.1289, 0.4937, 0.1512, 0.5122]}, {"w": "architecture", "b": [0.1571, 0.4937, 0.2686, 0.5122]}, {"w": "is", "b": [0.2745, 0.4937, 0.2902, 0.5122]}, {"w": "similar", "b": [0.2961, 0.4937, 0.3617, 0.5122]}, {"w": "to", "b": [0.3676, 0.4937, 0.386, 0.5122]}, {"w": "what", "b": [0.3919, 0.4937, 0.4378, 0.5122]}, {"w": "you’re", "b": [0.4437, 0.4937, 0.5053, 0.5122]}, {"w": "already", "b": [0.5112, 0.4937, 0.5807, 0.5122]}, {"w": "familiar", "b": [0.5866, 0.4937, 0.6614, 0.5122]}, {"w": "with", "b": [0.6673, 0.4937, 0.7093, 0.5122]}, {"w": "and", "b": [0.7152, 0.4937, 0.7493, 0.5122]}, {"w": "is", "b": [0.7552, 0.4937, 0.771, 0.5122]}, {"w": "easy", "b": [0.7769, 0.4937, 0.8188, 0.5122]}, {"w": "to", "b": [0.8247, 0.4937, 0.8431, 0.5122]}, {"w": "understand", "b": [0.1289, 0.5129, 0.2325, 0.5314]}, {"w": "without", "b": [0.2384, 0.5129, 0.3106, 0.5314]}, {"w": "introducing", "b": [0.3165, 0.5129, 0.4254, 0.5314]}, {"w": "any", "b": [0.4312, 0.5129, 0.4653, 0.5314]}, {"w": "new", "b": [0.4712, 0.5129, 0.5106, 0.5314]}, {"w": "concepts.", "b": [0.5165, 0.5129, 0.605, 0.5314]}, {"w": "This", "b": [0.6109, 0.5129, 0.6529, 0.5314]}, {"w": "may", "b": [0.6588, 0.5129, 0.6995, 0.5314]}, {"w": "be", "b": [0.7054, 0.5129, 0.7277, 0.5314]}, {"w": "your", "b": [0.7336, 0.5129, 0.7768, 0.5314]}, {"w": "first", "b": [0.7827, 0.5129, 0.8208, 0.5314]}, {"w": "encounter", "b": [0.1289, 0.5321, 0.222, 0.5505]}, {"w": "with", "b": [0.2279, 0.5321, 0.2699, 0.5505]}, {"w": "one", "b": [0.2758, 0.5321, 0.3099, 0.5505]}, {"w": "of", "b": [0.3158, 0.5321, 0.3355, 0.5505]}, {"w": "these", "b": [0.3414, 0.5321, 0.3899, 0.5505]}, {"w": "cutesy", "b": [0.3958, 0.5321, 0.4561, 0.5505]}, {"w": "model", "b": [0.462, 0.5321, 0.5211, 0.5505]}, {"w": "names—VGG,", "b": [0.527, 0.5321, 0.668, 0.5505]}, {"w": "ResNet,", "b": [0.6739, 0.5321, 0.7493, 0.5505]}, {"w": "Inception,", "b": [0.7552, 0.5321, 0.8503, 0.5505]}, {"w": "Inception-ResNet,", "b": [0.1289, 0.5513, 0.3014, 0.5697]}, {"w": "Xception,", "b": [0.3072, 0.5513, 0.3997, 0.5697]}, {"w": "and", "b": [0.4056, 0.5513, 0.4397, 0.5697]}, {"w": "so", "b": [0.4456, 0.5513, 0.4666, 0.5697]}, {"w": "on;", "b": [0.4725, 0.5513, 0.5027, 0.5697]}, {"w": "you’ll", "b": [0.5086, 0.5513, 0.565, 0.5697]}, {"w": "get", "b": [0.5709, 0.5513, 0.5998, 0.5697]}, {"w": "used", "b": [0.6057, 0.5513, 0.649, 0.5697]}, {"w": "to", "b": [0.6549, 0.5513, 0.6732, 0.5697]}, {"w": "them,", "b": [0.6792, 0.5513, 0.7323, 0.5697]}, {"w": "because", "b": [0.7382, 0.5513, 0.8129, 0.5697]}, {"w": "they", "b": [0.8188, 0.5513, 0.8595, 0.5697]}, {"w": "will", "b": [0.1289, 0.5704, 0.1656, 0.5889]}, {"w": "come", "b": [0.1715, 0.5704, 0.2227, 0.5889]}, {"w": "up", "b": [0.2286, 0.5704, 0.2522, 0.5889]}, {"w": "frequently", "b": [0.2581, 0.5704, 0.3552, 0.5889]}, {"w": "if", "b": [0.3611, 0.5704, 0.3755, 0.5889]}, {"w": "you", "b": [0.3814, 0.5704, 0.4168, 0.5889]}, {"w": "keep", "b": [0.4227, 0.5704, 0.4673, 0.5889]}, {"w": "doing", "b": [0.4732, 0.5704, 0.527, 0.5889]}, {"w": "deep", "b": [0.5329, 0.5704, 0.5775, 0.5889]}, {"w": "learning", "b": [0.5834, 0.5704, 0.6608, 0.5889]}, {"w": "for", "b": [0.6667, 0.5704, 0.6942, 0.5889]}, {"w": "computer", "b": [0.7001, 0.5704, 0.7893, 0.5889]}, {"w": "vision.", "b": [0.7951, 0.5704, 0.8588, 0.5889]}]}, {"id": "b_4", "type": "paragraph", "text": "Karen Simonyan and Andrew Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” arXiv (2014), https://arxiv.org/abs/1409.1556.", "words": [{"w": "Karen", "b": [0.1466, 0.6317, 0.1899, 0.6456]}, {"w": "Simonyan", "b": [0.1943, 0.6317, 0.2661, 0.6456]}, {"w": "and", "b": [0.2705, 0.6317, 0.2961, 0.6456]}, {"w": "Andrew", "b": [0.3005, 0.6317, 0.3576, 0.6456]}, {"w": "Zisserman,", "b": [0.362, 0.6317, 0.4402, 0.6456]}, {"w": "“Very", "b": [0.4447, 0.6317, 0.486, 0.6456]}, {"w": "Deep", "b": [0.4904, 0.6317, 0.5278, 0.6456]}, {"w": "Convolutional", "b": [0.5322, 0.6317, 0.6335, 0.6456]}, {"w": "Networks", "b": [0.638, 0.6317, 0.7068, 0.6456]}, {"w": "for", "b": [0.7113, 0.6317, 0.7319, 0.6456]}, {"w": "Large-Scale", "b": [0.7363, 0.6317, 0.8216, 0.6456]}, {"w": "Image", "b": [0.1466, 0.6459, 0.1908, 0.6598]}, {"w": "Recognition,”", "b": [0.1953, 0.6459, 0.2942, 0.6598]}, {"w": "arXiv", "b": [0.2986, 0.6459, 0.3389, 0.6598]}, {"w": "(2014),", "b": [0.3433, 0.6459, 0.395, 0.6598]}, {"w": "https://arxiv.org/abs/1409.1556.", "b": [0.3994, 0.6459, 0.6247, 0.6598]}]}, {"id": "b_5", "type": "paragraph", "text": "There are two ways to use a pretrained network: feature extraction and fine- tuning. We’ll cover both of them. Let’s start with feature extraction.", "words": [{"w": "There", "b": [0.1289, 0.6814, 0.1839, 0.6999]}, {"w": "are", "b": [0.1898, 0.6814, 0.2187, 0.6999]}, {"w": "two", "b": [0.2246, 0.6814, 0.26, 0.6999]}, {"w": "ways", "b": [0.2659, 0.6814, 0.3144, 0.6999]}, {"w": "to", "b": [0.3203, 0.6814, 0.3387, 0.6999]}, {"w": "use", "b": [0.3446, 0.6814, 0.3761, 0.6999]}, {"w": "a", "b": [0.382, 0.6814, 0.3925, 0.6999]}, {"w": "pretrained", "b": [0.3984, 0.6814, 0.4941, 0.6999]}, {"w": "network:", "b": [0.5, 0.6814, 0.584, 0.6999]}, {"w": "feature", "b": [0.5898, 0.6814, 0.6558, 0.6999]}, {"w": "extraction", "b": [0.6617, 0.6814, 0.7575, 0.6999]}, {"w": "and", "b": [0.7634, 0.6814, 0.7975, 0.6999]}, {"w": "fine-", "b": [0.8034, 0.6814, 0.8467, 0.6999]}, {"w": "tuning.", "b": [0.1289, 0.7006, 0.1951, 0.7191]}, {"w": "We’ll", "b": [0.201, 0.7006, 0.2529, 0.7191]}, {"w": "cover", "b": [0.2588, 0.7006, 0.3113, 0.7191]}, {"w": "both", "b": [0.3172, 0.7006, 0.3591, 0.7191]}, {"w": "of", "b": [0.3651, 0.7006, 0.3847, 0.7191]}, {"w": "them.", "b": [0.3906, 0.7006, 0.4438, 0.7191]}, {"w": "Let’s", "b": [0.4497, 0.7006, 0.4968, 0.7191]}, {"w": "start", "b": [0.5027, 0.7006, 0.5434, 0.7191]}, {"w": "with", "b": [0.5493, 0.7006, 0.5913, 0.7191]}, {"w": "feature", "b": [0.5972, 0.7006, 0.6628, 0.7191]}, {"w": "extraction.", "b": [0.6687, 0.7006, 0.769, 0.7191]}]}, {"id": "b_6", "type": "paragraph", "text": "5.3.1. Feature extraction", "words": [{"w": "5.3.1.", "b": [0.1289, 0.7448, 0.182, 0.7633]}, {"w": "Feature", "b": [0.1879, 0.7448, 0.2662, 0.7633]}, {"w": "extraction", "b": [0.2721, 0.7448, 0.3744, 0.7633]}]}, {"id": "b_7", "type": "paragraph", "text": "Feature extraction consists of using the representations learned by a previous network to extract interesting features from new samples. These features are then run through a new classifier, which is trained from scratch.", "words": [{"w": "Feature", "b": [0.1289, 0.7849, 0.1997, 0.8034]}, {"w": "extraction", "b": [0.2056, 0.7849, 0.3, 0.8034]}, {"w": "consists", "b": [0.3059, 0.7849, 0.3807, 0.8034]}, {"w": "of", "b": [0.3866, 0.7849, 0.4063, 0.8034]}, {"w": "using", "b": [0.4122, 0.7849, 0.4634, 0.8034]}, {"w": "the", "b": [0.4693, 0.7849, 0.4981, 0.8034]}, {"w": "representations", "b": [0.504, 0.7849, 0.647, 0.8034]}, {"w": "learned", "b": [0.6529, 0.7849, 0.7224, 0.8034]}, {"w": "by", "b": [0.7283, 0.7849, 0.7519, 0.8034]}, {"w": "a", "b": [0.7578, 0.7849, 0.7683, 0.8034]}, {"w": "previous", "b": [0.7742, 0.7849, 0.8555, 0.8034]}, {"w": "network", "b": [0.1289, 0.8041, 0.2063, 0.8226]}, {"w": "to", "b": [0.2122, 0.8041, 0.2305, 0.8226]}, {"w": "extract", "b": [0.2364, 0.8041, 0.3007, 0.8226]}, {"w": "interesting", "b": [0.3066, 0.8041, 0.4063, 0.8226]}, {"w": "features", "b": [0.4122, 0.8041, 0.4869, 0.8226]}, {"w": "from", "b": [0.4929, 0.8041, 0.5388, 0.8226]}, {"w": "new", "b": [0.5446, 0.8041, 0.5839, 0.8226]}, {"w": "samples.", "b": [0.5898, 0.8041, 0.6718, 0.8226]}, {"w": "These", "b": [0.6777, 0.8041, 0.7341, 0.8226]}, {"w": "features", "b": [0.74, 0.8041, 0.8148, 0.8226]}, {"w": "are", "b": [0.8207, 0.8041, 0.8495, 0.8226]}, {"w": "then", "b": [0.1289, 0.8233, 0.1695, 0.8417]}, {"w": "run", "b": [0.1754, 0.8233, 0.2069, 0.8417]}, {"w": "through", "b": [0.2128, 0.8233, 0.2863, 0.8417]}, {"w": "a", "b": [0.2922, 0.8233, 0.3027, 0.8417]}, {"w": "new", "b": [0.3086, 0.8233, 0.3479, 0.8417]}, {"w": "classifier,", "b": [0.3538, 0.8233, 0.444, 0.8417]}, {"w": "which", "b": [0.4499, 0.8233, 0.5076, 0.8417]}, {"w": "is", "b": [0.5135, 0.8233, 0.5293, 0.8417]}, {"w": "trained", "b": [0.5352, 0.8233, 0.6008, 0.8417]}, {"w": "from", "b": [0.6067, 0.8233, 0.6526, 0.8417]}, {"w": "scratch.", "b": [0.6585, 0.8233, 0.7313, 0.8417]}]}, {"id": "b_8", "type": "paragraph", "text": "As you saw previously, convnets used for image classification comprise two parts: they start with a series of pooling and convolution layers, and they end", "words": [{"w": "As", "b": [0.1289, 0.8633, 0.1551, 0.8818]}, {"w": "you", "b": [0.161, 0.8633, 0.1964, 0.8818]}, {"w": "saw", "b": [0.2023, 0.8633, 0.2391, 0.8818]}, {"w": "previously,", "b": [0.245, 0.8633, 0.349, 0.8818]}, {"w": "convnets", "b": [0.3549, 0.8633, 0.4389, 0.8818]}, {"w": "used", "b": [0.4448, 0.8633, 0.4881, 0.8818]}, {"w": "for", "b": [0.494, 0.8633, 0.5215, 0.8818]}, {"w": "image", "b": [0.5274, 0.8633, 0.5851, 0.8818]}, {"w": "classification", "b": [0.591, 0.8633, 0.7157, 0.8818]}, {"w": "comprise", "b": [0.7216, 0.8633, 0.8081, 0.8818]}, {"w": "two", "b": [0.814, 0.8633, 0.8495, 0.8818]}, {"w": "parts:", "b": [0.1289, 0.8825, 0.1813, 0.901]}, {"w": "they", "b": [0.1873, 0.8825, 0.2279, 0.901]}, {"w": "start", "b": [0.2338, 0.8825, 0.2745, 0.901]}, {"w": "with", "b": [0.2804, 0.8825, 0.3224, 0.901]}, {"w": "a", "b": [0.3283, 0.8825, 0.3388, 0.901]}, {"w": "series", "b": [0.3447, 0.8825, 0.3984, 0.901]}, {"w": "of", "b": [0.4043, 0.8825, 0.424, 0.901]}, {"w": "pooling", "b": [0.4299, 0.8825, 0.5021, 0.901]}, {"w": "and", "b": [0.508, 0.8825, 0.5421, 0.901]}, {"w": "convolution", "b": [0.5479, 0.8825, 0.6608, 0.901]}, {"w": "layers,", "b": [0.6667, 0.8825, 0.729, 0.901]}, {"w": "and", "b": [0.7349, 0.8825, 0.769, 0.901]}, {"w": "they", "b": [0.7749, 0.8825, 0.8155, 0.901]}, {"w": "end", "b": [0.8215, 0.8825, 0.8556, 0.901]}]}]}, {"page": 199, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "with a densely connected classifier. The first part is called the convolutional base of the model. In the case of convnets, feature extraction consists of taking the convolutional base of a previously trained network, running the new data through it, and training a new classifier on top of the output (see figure 5.14).", "words": [{"w": "with", "b": [0.1289, 0.0857, 0.1709, 0.1041]}, {"w": "a", "b": [0.1768, 0.0857, 0.1873, 0.1041]}, {"w": "densely", "b": [0.1932, 0.0857, 0.2653, 0.1041]}, {"w": "connected", "b": [0.2712, 0.0857, 0.3669, 0.1041]}, {"w": "classifier.", "b": [0.3728, 0.0857, 0.4626, 0.1041]}, {"w": "The", "b": [0.4685, 0.0857, 0.5053, 0.1041]}, {"w": "first", "b": [0.5112, 0.0857, 0.5492, 0.1041]}, {"w": "part", "b": [0.5551, 0.0857, 0.5918, 0.1041]}, {"w": "is", "b": [0.5977, 0.0857, 0.6135, 0.1041]}, {"w": "called", "b": [0.6194, 0.0857, 0.6758, 0.1041]}, {"w": "the", "b": [0.6817, 0.0857, 0.7105, 0.1041]}, {"w": "convolutional", "b": [0.7164, 0.0857, 0.8463, 0.1041]}, {"w": "base", "b": [0.1289, 0.1049, 0.1722, 0.1233]}, {"w": "of", "b": [0.1781, 0.1049, 0.1977, 0.1233]}, {"w": "the", "b": [0.2036, 0.1049, 0.2325, 0.1233]}, {"w": "model.", "b": [0.2384, 0.1049, 0.3033, 0.1233]}, {"w": "In", "b": [0.3092, 0.1049, 0.3289, 0.1233]}, {"w": "the", "b": [0.3348, 0.1049, 0.3637, 0.1233]}, {"w": "case", "b": [0.3696, 0.1049, 0.4102, 0.1233]}, {"w": "of", "b": [0.4161, 0.1049, 0.4358, 0.1233]}, {"w": "convnets,", "b": [0.4417, 0.1049, 0.5316, 0.1233]}, {"w": "feature", "b": [0.5375, 0.1049, 0.603, 0.1233]}, {"w": "extraction", "b": [0.6089, 0.1049, 0.7033, 0.1233]}, {"w": "consists", "b": [0.7093, 0.1049, 0.784, 0.1233]}, {"w": "of", "b": [0.7899, 0.1049, 0.8096, 0.1233]}, {"w": "taking", "b": [0.1289, 0.1241, 0.1879, 0.1425]}, {"w": "the", "b": [0.1938, 0.1241, 0.2227, 0.1425]}, {"w": "convolutional", "b": [0.2286, 0.1241, 0.3585, 0.1425]}, {"w": "base", "b": [0.3644, 0.1241, 0.4063, 0.1425]}, {"w": "of", "b": [0.4122, 0.1241, 0.4319, 0.1425]}, {"w": "a", "b": [0.4378, 0.1241, 0.4483, 0.1425]}, {"w": "previously", "b": [0.4541, 0.1241, 0.5538, 0.1425]}, {"w": "trained", "b": [0.5597, 0.1241, 0.6253, 0.1425]}, {"w": "network,", "b": [0.6312, 0.1241, 0.7145, 0.1425]}, {"w": "running", "b": [0.7204, 0.1241, 0.7939, 0.1425]}, {"w": "the", "b": [0.7998, 0.1241, 0.8286, 0.1425]}, {"w": "new", "b": [0.1289, 0.1432, 0.1682, 0.1617]}, {"w": "data", "b": [0.1741, 0.1432, 0.2135, 0.1617]}, {"w": "through", "b": [0.2194, 0.1432, 0.2928, 0.1617]}, {"w": "it,", "b": [0.2987, 0.1432, 0.3178, 0.1617]}, {"w": "and", "b": [0.3237, 0.1432, 0.3578, 0.1617]}, {"w": "training", "b": [0.3637, 0.1432, 0.4371, 0.1617]}, {"w": "a", "b": [0.443, 0.1432, 0.4535, 0.1617]}, {"w": "new", "b": [0.4594, 0.1432, 0.4988, 0.1617]}, {"w": "classifier", "b": [0.5047, 0.1432, 0.5899, 0.1617]}, {"w": "on", "b": [0.5958, 0.1432, 0.6194, 0.1617]}, {"w": "top", "b": [0.6254, 0.1432, 0.6555, 0.1617]}, {"w": "of", "b": [0.6614, 0.1432, 0.6811, 0.1617]}, {"w": "the", "b": [0.687, 0.1432, 0.7159, 0.1617]}, {"w": "output", "b": [0.7218, 0.1432, 0.7821, 0.1617]}, {"w": "(see", "b": [0.788, 0.1432, 0.8261, 0.1617]}, {"w": "figure", "b": [0.1289, 0.1624, 0.1853, 0.1809]}, {"w": "5.14).", "b": [0.1912, 0.1624, 0.2463, 0.1809]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.14. Swapping classifiers while keeping the same convolutional base", "words": [{"w": "Figure", "b": [0.1289, 0.1979, 0.1787, 0.2117]}, {"w": "5.14.", "b": [0.1832, 0.1979, 0.2186, 0.2117]}, {"w": "Swapping", "b": [0.223, 0.1979, 0.2978, 0.2117]}, {"w": "classifiers", "b": [0.3022, 0.1979, 0.376, 0.2117]}, {"w": "while", "b": [0.3804, 0.1979, 0.4208, 0.2117]}, {"w": "keeping", "b": [0.4252, 0.1979, 0.4843, 0.2117]}, {"w": "the", "b": [0.4887, 0.1979, 0.5123, 0.2117]}, {"w": "same", "b": [0.5167, 0.1979, 0.5551, 0.2117]}, {"w": "convolutional", "b": [0.5595, 0.1979, 0.6619, 0.2117]}, {"w": "base", "b": [0.6663, 0.1979, 0.6997, 0.2117]}]}, {"id": "b_2", "type": "paragraph", "text": "Why only reuse the convolutional base? Could you reuse the densely connected classifier as well? In general, doing so should be avoided. The reason is that the representations learned by the convolutional base are likely to be more generic and therefore more reusable: the feature maps of a convnet are presence maps of generic concepts over a picture, which is likely to be useful regardless of the computer-vision problem at hand. But the representations learned by the classifier will necessarily be specific to the set of classes on which the model was trained—they will only contain information about the presence probability of this or that class in the entire picture. Additionally, representations found in densely connected layers no longer contain any information about where objects are located in the input image: these layers get rid of the notion of space, whereas the object location is still described by convolutional feature maps. For problems where object location matters, densely connected features are largely useless.", "words": [{"w": "Why", "b": [0.1289, 0.5496, 0.1748, 0.5681]}, {"w": "only", "b": [0.1807, 0.5496, 0.2227, 0.5681]}, {"w": "reuse", "b": [0.2286, 0.5496, 0.2784, 0.5681]}, {"w": "the", "b": [0.2843, 0.5496, 0.3132, 0.5681]}, {"w": "convolutional", "b": [0.3191, 0.5496, 0.449, 0.5681]}, {"w": "base?", "b": [0.4549, 0.5496, 0.5073, 0.5681]}, {"w": "Could", "b": [0.5132, 0.5496, 0.5709, 0.5681]}, {"w": "you", "b": [0.5768, 0.5496, 0.6123, 0.5681]}, {"w": "reuse", "b": [0.6182, 0.5496, 0.668, 0.5681]}, {"w": "the", "b": [0.6739, 0.5496, 0.7028, 0.5681]}, {"w": "densely", "b": [0.7087, 0.5496, 0.7808, 0.5681]}, {"w": "connected", "b": [0.1289, 0.5688, 0.2246, 0.5873]}, {"w": "classifier", "b": [0.2305, 0.5688, 0.3158, 0.5873]}, {"w": "as", "b": [0.3217, 0.5688, 0.3413, 0.5873]}, {"w": "well?", "b": [0.3472, 0.5688, 0.3984, 0.5873]}, {"w": "In", "b": [0.4043, 0.5688, 0.424, 0.5873]}, {"w": "general,", "b": [0.4299, 0.5688, 0.5053, 0.5873]}, {"w": "doing", "b": [0.5112, 0.5688, 0.565, 0.5873]}, {"w": "so", "b": [0.5709, 0.5688, 0.5919, 0.5873]}, {"w": "should", "b": [0.5978, 0.5688, 0.6608, 0.5873]}, {"w": "be", "b": [0.6666, 0.5688, 0.6889, 0.5873]}, {"w": "avoided.", "b": [0.6948, 0.5688, 0.7755, 0.5873]}, {"w": "The", "b": [0.7814, 0.5688, 0.8181, 0.5873]}, {"w": "reason", "b": [0.1289, 0.588, 0.1905, 0.6065]}, {"w": "is", "b": [0.1964, 0.588, 0.2122, 0.6065]}, {"w": "that", "b": [0.2181, 0.588, 0.2535, 0.6065]}, {"w": "the", "b": [0.2594, 0.588, 0.2883, 0.6065]}, {"w": "representations", "b": [0.2942, 0.588, 0.4371, 0.6065]}, {"w": "learned", "b": [0.443, 0.588, 0.5125, 0.6065]}, {"w": "by", "b": [0.5184, 0.588, 0.542, 0.6065]}, {"w": "the", "b": [0.5479, 0.588, 0.5768, 0.6065]}, {"w": "convolutional", "b": [0.5827, 0.588, 0.7126, 0.6065]}, {"w": "base", "b": [0.7185, 0.588, 0.7605, 0.6065]}, {"w": "are", "b": [0.7664, 0.588, 0.7952, 0.6065]}, {"w": "likely", "b": [0.8011, 0.588, 0.8549, 0.6065]}, {"w": "to", "b": [0.1289, 0.6072, 0.1472, 0.6256]}, {"w": "be", "b": [0.1532, 0.6072, 0.1754, 0.6256]}, {"w": "more", "b": [0.1813, 0.6072, 0.2299, 0.6256]}, {"w": "generic", "b": [0.2358, 0.6072, 0.3053, 0.6256]}, {"w": "and", "b": [0.3112, 0.6072, 0.3453, 0.6256]}, {"w": "therefore", "b": [0.3512, 0.6072, 0.4364, 0.6256]}, {"w": "more", "b": [0.4423, 0.6072, 0.4908, 0.6256]}, {"w": "reusable:", "b": [0.4967, 0.6072, 0.5819, 0.6256]}, {"w": "the", "b": [0.5878, 0.6072, 0.6167, 0.6256]}, {"w": "feature", "b": [0.6226, 0.6072, 0.6882, 0.6256]}, {"w": "maps", "b": [0.6941, 0.6072, 0.7439, 0.6256]}, {"w": "of", "b": [0.7498, 0.6072, 0.7695, 0.6256]}, {"w": "a", "b": [0.7754, 0.6072, 0.7859, 0.6256]}, {"w": "convnet", "b": [0.7918, 0.6072, 0.8665, 0.6256]}, {"w": "are", "b": [0.1289, 0.6264, 0.1577, 0.6448]}, {"w": "presence", "b": [0.1636, 0.6264, 0.2462, 0.6448]}, {"w": "maps", "b": [0.2521, 0.6264, 0.302, 0.6448]}, {"w": "of", "b": [0.3079, 0.6264, 0.3275, 0.6448]}, {"w": "generic", "b": [0.3335, 0.6264, 0.4029, 0.6448]}, {"w": "concepts", "b": [0.4089, 0.6264, 0.4915, 0.6448]}, {"w": "over", "b": [0.4974, 0.6264, 0.5393, 0.6448]}, {"w": "a", "b": [0.5453, 0.6264, 0.5557, 0.6448]}, {"w": "picture,", "b": [0.5616, 0.6264, 0.6331, 0.6448]}, {"w": "which", "b": [0.639, 0.6264, 0.6967, 0.6448]}, {"w": "is", "b": [0.7026, 0.6264, 0.7184, 0.6448]}, {"w": "likely", "b": [0.7243, 0.6264, 0.7781, 0.6448]}, {"w": "to", "b": [0.784, 0.6264, 0.8024, 0.6448]}, {"w": "be", "b": [0.8083, 0.6264, 0.8306, 0.6448]}, {"w": "useful", "b": [0.1289, 0.6455, 0.1866, 0.664]}, {"w": "regardless", "b": [0.1925, 0.6455, 0.2882, 0.664]}, {"w": "of", "b": [0.2941, 0.6455, 0.3138, 0.664]}, {"w": "the", "b": [0.3197, 0.6455, 0.3486, 0.664]}, {"w": "computer-vision", "b": [0.3545, 0.6455, 0.5088, 0.664]}, {"w": "problem", "b": [0.5147, 0.6455, 0.5934, 0.664]}, {"w": "at", "b": [0.5993, 0.6455, 0.6163, 0.664]}, {"w": "hand.", "b": [0.6222, 0.6455, 0.674, 0.664]}, {"w": "But", "b": [0.6799, 0.6455, 0.7141, 0.664]}, {"w": "the", "b": [0.72, 0.6455, 0.7488, 0.664]}, {"w": "representations", "b": [0.1289, 0.6647, 0.2718, 0.6832]}, {"w": "learned", "b": [0.2777, 0.6647, 0.3472, 0.6832]}, {"w": "by", "b": [0.3531, 0.6647, 0.3768, 0.6832]}, {"w": "the", "b": [0.3827, 0.6647, 0.4115, 0.6832]}, {"w": "classifier", "b": [0.4174, 0.6647, 0.5027, 0.6832]}, {"w": "will", "b": [0.5086, 0.6647, 0.5453, 0.6832]}, {"w": "necessarily", "b": [0.5512, 0.6647, 0.6561, 0.6832]}, {"w": "be", "b": [0.6621, 0.6647, 0.6843, 0.6832]}, {"w": "specific", "b": [0.6902, 0.6647, 0.7637, 0.6832]}, {"w": "to", "b": [0.7695, 0.6647, 0.7879, 0.6832]}, {"w": "the", "b": [0.7938, 0.6647, 0.8226, 0.6832]}, {"w": "set", "b": [0.8285, 0.6647, 0.8548, 0.6832]}, {"w": "of", "b": [0.1289, 0.6839, 0.1485, 0.7024]}, {"w": "classes", "b": [0.1545, 0.6839, 0.22, 0.7024]}, {"w": "on", "b": [0.2259, 0.6839, 0.2495, 0.7024]}, {"w": "which", "b": [0.2555, 0.6839, 0.3132, 0.7024]}, {"w": "the", "b": [0.3191, 0.6839, 0.3479, 0.7024]}, {"w": "model", "b": [0.3538, 0.6839, 0.4129, 0.7024]}, {"w": "was", "b": [0.4188, 0.6839, 0.4555, 0.7024]}, {"w": "trained—they", "b": [0.4614, 0.6839, 0.5913, 0.7024]}, {"w": "will", "b": [0.5972, 0.6839, 0.6339, 0.7024]}, {"w": "only", "b": [0.6398, 0.6839, 0.6818, 0.7024]}, {"w": "contain", "b": [0.6877, 0.6839, 0.7572, 0.7024]}, {"w": "information", "b": [0.1289, 0.7031, 0.2404, 0.7216]}, {"w": "about", "b": [0.2463, 0.7031, 0.2988, 0.7216]}, {"w": "the", "b": [0.3047, 0.7031, 0.3335, 0.7216]}, {"w": "presence", "b": [0.3394, 0.7031, 0.422, 0.7216]}, {"w": "probability", "b": [0.4279, 0.7031, 0.5316, 0.7216]}, {"w": "of", "b": [0.5375, 0.7031, 0.5572, 0.7216]}, {"w": "this", "b": [0.563, 0.7031, 0.5971, 0.7216]}, {"w": "or", "b": [0.603, 0.7031, 0.6227, 0.7216]}, {"w": "that", "b": [0.6286, 0.7031, 0.664, 0.7216]}, {"w": "class", "b": [0.6699, 0.7031, 0.7158, 0.7216]}, {"w": "in", "b": [0.7217, 0.7031, 0.7401, 0.7216]}, {"w": "the", "b": [0.746, 0.7031, 0.7749, 0.7216]}, {"w": "entire", "b": [0.7808, 0.7031, 0.8345, 0.7216]}, {"w": "picture.", "b": [0.1289, 0.7223, 0.2004, 0.7408]}, {"w": "Additionally,", "b": [0.2063, 0.7223, 0.33, 0.7408]}, {"w": "representations", "b": [0.3359, 0.7223, 0.4789, 0.7408]}, {"w": "found", "b": [0.4848, 0.7223, 0.5399, 0.7408]}, {"w": "in", "b": [0.5458, 0.7223, 0.5641, 0.7408]}, {"w": "densely", "b": [0.57, 0.7223, 0.6422, 0.7408]}, {"w": "connected", "b": [0.6481, 0.7223, 0.7438, 0.7408]}, {"w": "layers", "b": [0.7497, 0.7223, 0.8061, 0.7408]}, {"w": "no", "b": [0.812, 0.7223, 0.8356, 0.7408]}, {"w": "longer", "b": [0.1289, 0.7415, 0.1892, 0.76]}, {"w": "contain", "b": [0.1951, 0.7415, 0.2646, 0.76]}, {"w": "any", "b": [0.2705, 0.7415, 0.3046, 0.76]}, {"w": "information", "b": [0.3105, 0.7415, 0.422, 0.76]}, {"w": "about", "b": [0.4279, 0.7415, 0.4804, 0.76]}, {"w": "where", "b": [0.4863, 0.7415, 0.5431, 0.76]}, {"w": "objects", "b": [0.549, 0.7415, 0.6159, 0.76]}, {"w": "are", "b": [0.6218, 0.7415, 0.6506, 0.76]}, {"w": "located", "b": [0.6565, 0.7415, 0.7247, 0.76]}, {"w": "in", "b": [0.7306, 0.7415, 0.749, 0.76]}, {"w": "the", "b": [0.7549, 0.7415, 0.7838, 0.76]}, {"w": "input", "b": [0.7897, 0.7415, 0.8382, 0.76]}, {"w": "image:", "b": [0.1289, 0.7607, 0.1932, 0.7792]}, {"w": "these", "b": [0.1991, 0.7607, 0.2476, 0.7792]}, {"w": "layers", "b": [0.2535, 0.7607, 0.3099, 0.7792]}, {"w": "get", "b": [0.3158, 0.7607, 0.3446, 0.7792]}, {"w": "rid", "b": [0.3505, 0.7607, 0.3768, 0.7792]}, {"w": "of", "b": [0.3827, 0.7607, 0.4024, 0.7792]}, {"w": "the", "b": [0.4083, 0.7607, 0.4371, 0.7792]}, {"w": "notion", "b": [0.443, 0.7607, 0.5034, 0.7792]}, {"w": "of", "b": [0.5093, 0.7607, 0.529, 0.7792]}, {"w": "space,", "b": [0.5349, 0.7607, 0.5932, 0.7792]}, {"w": "whereas", "b": [0.5991, 0.7607, 0.6765, 0.7792]}, {"w": "the", "b": [0.6824, 0.7607, 0.7112, 0.7792]}, {"w": "object", "b": [0.7171, 0.7607, 0.7749, 0.7792]}, {"w": "location", "b": [0.7808, 0.7607, 0.8568, 0.7792]}, {"w": "is", "b": [0.1289, 0.7799, 0.1446, 0.7984]}, {"w": "still", "b": [0.1505, 0.7799, 0.186, 0.7984]}, {"w": "described", "b": [0.1919, 0.7799, 0.2824, 0.7984]}, {"w": "by", "b": [0.2883, 0.7799, 0.3119, 0.7984]}, {"w": "convolutional", "b": [0.3178, 0.7799, 0.4477, 0.7984]}, {"w": "feature", "b": [0.4536, 0.7799, 0.5191, 0.7984]}, {"w": "maps.", "b": [0.525, 0.7799, 0.5808, 0.7984]}, {"w": "For", "b": [0.5867, 0.7799, 0.6195, 0.7984]}, {"w": "problems", "b": [0.6254, 0.7799, 0.7133, 0.7984]}, {"w": "where", "b": [0.7192, 0.7799, 0.7769, 0.7984]}, {"w": "object", "b": [0.7828, 0.7799, 0.8405, 0.7984]}, {"w": "location", "b": [0.1289, 0.7991, 0.205, 0.8176]}, {"w": "matters,", "b": [0.2109, 0.7991, 0.2863, 0.8176]}, {"w": "densely", "b": [0.2922, 0.7991, 0.3643, 0.8176]}, {"w": "connected", "b": [0.3702, 0.7991, 0.466, 0.8176]}, {"w": "features", "b": [0.4719, 0.7991, 0.5466, 0.8176]}, {"w": "are", "b": [0.5525, 0.7991, 0.5814, 0.8176]}, {"w": "largely", "b": [0.5873, 0.7991, 0.6523, 0.8176]}, {"w": "useless.", "b": [0.6582, 0.7991, 0.731, 0.8176]}]}, {"id": "b_3", "type": "paragraph", "text": "Note that the level of generality (and therefore reusability) of the representations extracted by specific convolution layers depends on the depth of the layer in the model. Layers that come earlier in the model extract local,", "words": [{"w": "Note", "b": [0.1289, 0.8391, 0.1748, 0.8576]}, {"w": "that", "b": [0.1807, 0.8391, 0.2161, 0.8576]}, {"w": "the", "b": [0.222, 0.8391, 0.2509, 0.8576]}, {"w": "level", "b": [0.2568, 0.8391, 0.3027, 0.8576]}, {"w": "of", "b": [0.3086, 0.8391, 0.3283, 0.8576]}, {"w": "generality", "b": [0.3342, 0.8391, 0.4286, 0.8576]}, {"w": "(and", "b": [0.4345, 0.8391, 0.4765, 0.8576]}, {"w": "therefore", "b": [0.4824, 0.8391, 0.5676, 0.8576]}, {"w": "reusability)", "b": [0.5735, 0.8391, 0.6811, 0.8576]}, {"w": "of", "b": [0.687, 0.8391, 0.7066, 0.8576]}, {"w": "the", "b": [0.7125, 0.8391, 0.7414, 0.8576]}, {"w": "representations", "b": [0.1289, 0.8583, 0.2718, 0.8768]}, {"w": "extracted", "b": [0.2777, 0.8583, 0.3643, 0.8768]}, {"w": "by", "b": [0.3702, 0.8583, 0.3938, 0.8768]}, {"w": "specific", "b": [0.3997, 0.8583, 0.4732, 0.8768]}, {"w": "convolution", "b": [0.4791, 0.8583, 0.5919, 0.8768]}, {"w": "layers", "b": [0.5978, 0.8583, 0.6542, 0.8768]}, {"w": "depends", "b": [0.66, 0.8583, 0.7374, 0.8768]}, {"w": "on", "b": [0.7433, 0.8583, 0.7669, 0.8768]}, {"w": "the", "b": [0.7728, 0.8583, 0.8017, 0.8768]}, {"w": "depth", "b": [0.8076, 0.8583, 0.86, 0.8768]}, {"w": "of", "b": [0.1289, 0.8775, 0.1485, 0.896]}, {"w": "the", "b": [0.1545, 0.8775, 0.1833, 0.896]}, {"w": "layer", "b": [0.1892, 0.8775, 0.2364, 0.896]}, {"w": "in", "b": [0.2423, 0.8775, 0.2607, 0.896]}, {"w": "the", "b": [0.2666, 0.8775, 0.2955, 0.896]}, {"w": "model.", "b": [0.3014, 0.8775, 0.3663, 0.896]}, {"w": "Layers", "b": [0.3722, 0.8775, 0.4365, 0.896]}, {"w": "that", "b": [0.4424, 0.8775, 0.4778, 0.896]}, {"w": "come", "b": [0.4837, 0.8775, 0.5348, 0.896]}, {"w": "earlier", "b": [0.5407, 0.8775, 0.6011, 0.896]}, {"w": "in", "b": [0.607, 0.8775, 0.6253, 0.896]}, {"w": "the", "b": [0.6312, 0.8775, 0.6601, 0.896]}, {"w": "model", "b": [0.666, 0.8775, 0.725, 0.896]}, {"w": "extract", "b": [0.7309, 0.8775, 0.7952, 0.896]}, {"w": "local,", "b": [0.8011, 0.8775, 0.8529, 0.896]}]}]}, {"page": 200, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "highly generic feature maps (such as visual edges, colors, and textures), whereas layers that are higher up extract more-abstract concepts (such as “cat ear” or “dog eye”). So if your new dataset differs a lot from the dataset on which the original model was trained, you may be better off using only the first few layers of the model to do feature extraction, rather than using the entire convolutional base.", "words": [{"w": "highly", "b": [0.1289, 0.0857, 0.1892, 0.1041]}, {"w": "generic", "b": [0.1951, 0.0857, 0.2646, 0.1041]}, {"w": "feature", "b": [0.2705, 0.0857, 0.3361, 0.1041]}, {"w": "maps", "b": [0.342, 0.0857, 0.3918, 0.1041]}, {"w": "(such", "b": [0.3977, 0.0857, 0.4489, 0.1041]}, {"w": "as", "b": [0.4548, 0.0857, 0.4744, 0.1041]}, {"w": "visual", "b": [0.4803, 0.0857, 0.5368, 0.1041]}, {"w": "edges,", "b": [0.5427, 0.0857, 0.6023, 0.1041]}, {"w": "colors,", "b": [0.6082, 0.0857, 0.6719, 0.1041]}, {"w": "and", "b": [0.6778, 0.0857, 0.7119, 0.1041]}, {"w": "textures),", "b": [0.7178, 0.0857, 0.8063, 0.1041]}, {"w": "whereas", "b": [0.1289, 0.1049, 0.2062, 0.1233]}, {"w": "layers", "b": [0.2121, 0.1049, 0.2685, 0.1233]}, {"w": "that", "b": [0.2744, 0.1049, 0.3099, 0.1233]}, {"w": "are", "b": [0.3158, 0.1049, 0.3446, 0.1233]}, {"w": "higher", "b": [0.3505, 0.1049, 0.4108, 0.1233]}, {"w": "up", "b": [0.4167, 0.1049, 0.4404, 0.1233]}, {"w": "extract", "b": [0.4463, 0.1049, 0.5105, 0.1233]}, {"w": "more-abstract", "b": [0.5164, 0.1049, 0.6463, 0.1233]}, {"w": "concepts", "b": [0.6522, 0.1049, 0.7348, 0.1233]}, {"w": "(such", "b": [0.7407, 0.1049, 0.7918, 0.1233]}, {"w": "as", "b": [0.7977, 0.1049, 0.8173, 0.1233]}, {"w": "“cat", "b": [0.8232, 0.1049, 0.8612, 0.1233]}, {"w": "ear”", "b": [0.1289, 0.124, 0.1682, 0.1425]}, {"w": "or", "b": [0.1741, 0.124, 0.1938, 0.1425]}, {"w": "“dog", "b": [0.1997, 0.124, 0.2456, 0.1425]}, {"w": "eye”).", "b": [0.2515, 0.124, 0.3085, 0.1425]}, {"w": "So", "b": [0.3144, 0.124, 0.3394, 0.1425]}, {"w": "if", "b": [0.3453, 0.124, 0.3597, 0.1425]}, {"w": "your", "b": [0.3656, 0.124, 0.4089, 0.1425]}, {"w": "new", "b": [0.4148, 0.124, 0.4541, 0.1425]}, {"w": "dataset", "b": [0.46, 0.124, 0.5256, 0.1425]}, {"w": "differs", "b": [0.5315, 0.124, 0.5927, 0.1425]}, {"w": "a", "b": [0.5986, 0.124, 0.6091, 0.1425]}, {"w": "lot", "b": [0.615, 0.124, 0.6399, 0.1425]}, {"w": "from", "b": [0.6458, 0.124, 0.6917, 0.1425]}, {"w": "the", "b": [0.6976, 0.124, 0.7265, 0.1425]}, {"w": "dataset", "b": [0.7324, 0.124, 0.798, 0.1425]}, {"w": "on", "b": [0.8039, 0.124, 0.8275, 0.1425]}, {"w": "which", "b": [0.1289, 0.1432, 0.1866, 0.1617]}, {"w": "the", "b": [0.1925, 0.1432, 0.2214, 0.1617]}, {"w": "original", "b": [0.2273, 0.1432, 0.3007, 0.1617]}, {"w": "model", "b": [0.3066, 0.1432, 0.3657, 0.1617]}, {"w": "was", "b": [0.3716, 0.1432, 0.4083, 0.1617]}, {"w": "trained,", "b": [0.4142, 0.1432, 0.4857, 0.1617]}, {"w": "you", "b": [0.4915, 0.1432, 0.5269, 0.1617]}, {"w": "may", "b": [0.5328, 0.1432, 0.5735, 0.1617]}, {"w": "be", "b": [0.5794, 0.1432, 0.6017, 0.1617]}, {"w": "better", "b": [0.6076, 0.1432, 0.6614, 0.1617]}, {"w": "off", "b": [0.6673, 0.1432, 0.6944, 0.1617]}, {"w": "using", "b": [0.7003, 0.1432, 0.7514, 0.1617]}, {"w": "only", "b": [0.7573, 0.1432, 0.7993, 0.1617]}, {"w": "the", "b": [0.8052, 0.1432, 0.8341, 0.1617]}, {"w": "first", "b": [0.1289, 0.1624, 0.1669, 0.1809]}, {"w": "few", "b": [0.1728, 0.1624, 0.2082, 0.1809]}, {"w": "layers", "b": [0.2141, 0.1624, 0.2705, 0.1809]}, {"w": "of", "b": [0.2764, 0.1624, 0.2961, 0.1809]}, {"w": "the", "b": [0.302, 0.1624, 0.3309, 0.1809]}, {"w": "model", "b": [0.3368, 0.1624, 0.3958, 0.1809]}, {"w": "to", "b": [0.4017, 0.1624, 0.4201, 0.1809]}, {"w": "do", "b": [0.426, 0.1624, 0.4496, 0.1809]}, {"w": "feature", "b": [0.4555, 0.1624, 0.521, 0.1809]}, {"w": "extraction,", "b": [0.527, 0.1624, 0.6273, 0.1809]}, {"w": "rather", "b": [0.6332, 0.1624, 0.6883, 0.1809]}, {"w": "than", "b": [0.6942, 0.1624, 0.7348, 0.1809]}, {"w": "using", "b": [0.7407, 0.1624, 0.7919, 0.1809]}, {"w": "the", "b": [0.7978, 0.1624, 0.8267, 0.1809]}, {"w": "entire", "b": [0.1289, 0.1816, 0.1826, 0.2001]}, {"w": "convolutional", "b": [0.1885, 0.1816, 0.3184, 0.2001]}, {"w": "base.", "b": [0.3243, 0.1816, 0.3722, 0.2001]}]}, {"id": "b_1", "type": "paragraph", "text": "In this case, because the ImageNet class set contains multiple dog and cat classes, it’s likely to be beneficial to reuse the information contained in the densely connected layers of the original model. But we’ll choose not to, in order to cover the more general case where the class set of the new problem doesn’t overlap the class set of the original model. Let’s put this in practice by using the convolutional base of the VGG16 network, trained on ImageNet, to extract interesting features from cat and dog images, and then train a dogs- versus-cats classifier on top of these features.", "words": [{"w": "In", "b": [0.1289, 0.2217, 0.1485, 0.2402]}, {"w": "this", "b": [0.1545, 0.2217, 0.1886, 0.2402]}, {"w": "case,", "b": [0.1945, 0.2217, 0.241, 0.2402]}, {"w": "because", "b": [0.2469, 0.2217, 0.3217, 0.2402]}, {"w": "the", "b": [0.3276, 0.2217, 0.3564, 0.2402]}, {"w": "ImageNet", "b": [0.3623, 0.2217, 0.4554, 0.2402]}, {"w": "class", "b": [0.4613, 0.2217, 0.5073, 0.2402]}, {"w": "set", "b": [0.5132, 0.2217, 0.5394, 0.2402]}, {"w": "contains", "b": [0.5453, 0.2217, 0.624, 0.2402]}, {"w": "multiple", "b": [0.6299, 0.2217, 0.7086, 0.2402]}, {"w": "dog", "b": [0.7145, 0.2217, 0.75, 0.2402]}, {"w": "and", "b": [0.7559, 0.2217, 0.79, 0.2402]}, {"w": "cat", "b": [0.7959, 0.2217, 0.8234, 0.2402]}, {"w": "classes,", "b": [0.1289, 0.2409, 0.2004, 0.2593]}, {"w": "it’s", "b": [0.2063, 0.2409, 0.2351, 0.2593]}, {"w": "likely", "b": [0.241, 0.2409, 0.2948, 0.2593]}, {"w": "to", "b": [0.3007, 0.2409, 0.3191, 0.2593]}, {"w": "be", "b": [0.325, 0.2409, 0.3473, 0.2593]}, {"w": "beneficial", "b": [0.3532, 0.2409, 0.4463, 0.2593]}, {"w": "to", "b": [0.4522, 0.2409, 0.4706, 0.2593]}, {"w": "reuse", "b": [0.4765, 0.2409, 0.5263, 0.2593]}, {"w": "the", "b": [0.5322, 0.2409, 0.561, 0.2593]}, {"w": "information", "b": [0.5669, 0.2409, 0.6784, 0.2593]}, {"w": "contained", "b": [0.6843, 0.2409, 0.7762, 0.2593]}, {"w": "in", "b": [0.7821, 0.2409, 0.8004, 0.2593]}, {"w": "the", "b": [0.8063, 0.2409, 0.8352, 0.2593]}, {"w": "densely", "b": [0.1289, 0.2601, 0.201, 0.2785]}, {"w": "connected", "b": [0.2069, 0.2601, 0.3027, 0.2785]}, {"w": "layers", "b": [0.3086, 0.2601, 0.365, 0.2785]}, {"w": "of", "b": [0.3709, 0.2601, 0.3905, 0.2785]}, {"w": "the", "b": [0.3964, 0.2601, 0.4253, 0.2785]}, {"w": "original", "b": [0.4312, 0.2601, 0.5047, 0.2785]}, {"w": "model.", "b": [0.5106, 0.2601, 0.5755, 0.2785]}, {"w": "But", "b": [0.5814, 0.2601, 0.6155, 0.2785]}, {"w": "we’ll", "b": [0.6214, 0.2601, 0.67, 0.2785]}, {"w": "choose", "b": [0.6759, 0.2601, 0.7414, 0.2785]}, {"w": "not", "b": [0.7473, 0.2601, 0.7775, 0.2785]}, {"w": "to,", "b": [0.7834, 0.2601, 0.8077, 0.2785]}, {"w": "in", "b": [0.8136, 0.2601, 0.832, 0.2785]}, {"w": "order", "b": [0.1289, 0.2792, 0.1787, 0.2977]}, {"w": "to", "b": [0.1846, 0.2792, 0.203, 0.2977]}, {"w": "cover", "b": [0.2089, 0.2792, 0.2613, 0.2977]}, {"w": "the", "b": [0.2672, 0.2792, 0.2961, 0.2977]}, {"w": "more", "b": [0.302, 0.2792, 0.3505, 0.2977]}, {"w": "general", "b": [0.3564, 0.2792, 0.4259, 0.2977]}, {"w": "case", "b": [0.4318, 0.2792, 0.4724, 0.2977]}, {"w": "where", "b": [0.4783, 0.2792, 0.536, 0.2977]}, {"w": "the", "b": [0.5419, 0.2792, 0.5708, 0.2977]}, {"w": "class", "b": [0.5767, 0.2792, 0.6226, 0.2977]}, {"w": "set", "b": [0.6285, 0.2792, 0.6547, 0.2977]}, {"w": "of", "b": [0.6607, 0.2792, 0.6803, 0.2977]}, {"w": "the", "b": [0.6862, 0.2792, 0.7151, 0.2977]}, {"w": "new", "b": [0.721, 0.2792, 0.7603, 0.2977]}, {"w": "problem", "b": [0.7662, 0.2792, 0.8449, 0.2977]}, {"w": "doesn’t", "b": [0.1289, 0.2984, 0.198, 0.3169]}, {"w": "overlap", "b": [0.2039, 0.2984, 0.2747, 0.3169]}, {"w": "the", "b": [0.2806, 0.2984, 0.3095, 0.3169]}, {"w": "class", "b": [0.3154, 0.2984, 0.3613, 0.3169]}, {"w": "set", "b": [0.3672, 0.2984, 0.3934, 0.3169]}, {"w": "of", "b": [0.3993, 0.2984, 0.419, 0.3169]}, {"w": "the", "b": [0.4249, 0.2984, 0.4537, 0.3169]}, {"w": "original", "b": [0.4596, 0.2984, 0.5331, 0.3169]}, {"w": "model.", "b": [0.539, 0.2984, 0.604, 0.3169]}, {"w": "Let’s", "b": [0.6099, 0.2984, 0.657, 0.3169]}, {"w": "put", "b": [0.6629, 0.2984, 0.6931, 0.3169]}, {"w": "this", "b": [0.699, 0.2984, 0.7331, 0.3169]}, {"w": "in", "b": [0.739, 0.2984, 0.7574, 0.3169]}, {"w": "practice", "b": [0.7633, 0.2984, 0.838, 0.3169]}, {"w": "by", "b": [0.8439, 0.2984, 0.8676, 0.3169]}, {"w": "using", "b": [0.1289, 0.3176, 0.18, 0.3361]}, {"w": "the", "b": [0.186, 0.3176, 0.2148, 0.3361]}, {"w": "convolutional", "b": [0.2207, 0.3176, 0.3506, 0.3361]}, {"w": "base", "b": [0.3565, 0.3176, 0.3985, 0.3361]}, {"w": "of", "b": [0.4044, 0.3176, 0.424, 0.3361]}, {"w": "the", "b": [0.4299, 0.3176, 0.4588, 0.3361]}, {"w": "VGG16", "b": [0.4647, 0.3176, 0.5395, 0.3361]}, {"w": "network,", "b": [0.5454, 0.3176, 0.6287, 0.3361]}, {"w": "trained", "b": [0.6346, 0.3176, 0.7001, 0.3361]}, {"w": "on", "b": [0.706, 0.3176, 0.7297, 0.3361]}, {"w": "ImageNet,", "b": [0.7356, 0.3176, 0.8346, 0.3361]}, {"w": "to", "b": [0.8405, 0.3176, 0.8589, 0.3361]}, {"w": "extract", "b": [0.1289, 0.3368, 0.1931, 0.3553]}, {"w": "interesting", "b": [0.199, 0.3368, 0.2987, 0.3553]}, {"w": "features", "b": [0.3046, 0.3368, 0.3794, 0.3553]}, {"w": "from", "b": [0.3852, 0.3368, 0.4311, 0.3553]}, {"w": "cat", "b": [0.437, 0.3368, 0.4646, 0.3553]}, {"w": "and", "b": [0.4705, 0.3368, 0.5046, 0.3553]}, {"w": "dog", "b": [0.5105, 0.3368, 0.5459, 0.3553]}, {"w": "images,", "b": [0.5518, 0.3368, 0.6246, 0.3553]}, {"w": "and", "b": [0.6305, 0.3368, 0.6646, 0.3553]}, {"w": "then", "b": [0.6705, 0.3368, 0.7112, 0.3553]}, {"w": "train", "b": [0.7171, 0.3368, 0.7604, 0.3553]}, {"w": "a", "b": [0.7663, 0.3368, 0.7768, 0.3553]}, {"w": "dogs-", "b": [0.7827, 0.3368, 0.8351, 0.3553]}, {"w": "versus-cats", "b": [0.1289, 0.356, 0.2338, 0.3745]}, {"w": "classifier", "b": [0.2397, 0.356, 0.3249, 0.3745]}, {"w": "on", "b": [0.3309, 0.356, 0.3545, 0.3745]}, {"w": "top", "b": [0.3604, 0.356, 0.3906, 0.3745]}, {"w": "of", "b": [0.3965, 0.356, 0.4161, 0.3745]}, {"w": "these", "b": [0.422, 0.356, 0.4706, 0.3745]}, {"w": "features.", "b": [0.4765, 0.356, 0.5571, 0.3745]}]}, {"id": "b_2", "type": "paragraph", "text": "The VGG16 model, among others, comes prepackaged with Keras. You can import it from the keras.applications module. Here’s the list of image-classification models (all pretrained on the ImageNet dataset) that are available as part of keras.applications:", "words": [{"w": "The", "b": [0.1289, 0.3961, 0.1656, 0.4145]}, {"w": "VGG16", "b": [0.1715, 0.3961, 0.2463, 0.4145]}, {"w": "model,", "b": [0.2522, 0.3961, 0.3171, 0.4145]}, {"w": "among", "b": [0.323, 0.3961, 0.3873, 0.4145]}, {"w": "others,", "b": [0.3932, 0.3961, 0.4568, 0.4145]}, {"w": "comes", "b": [0.4627, 0.3961, 0.5231, 0.4145]}, {"w": "prepackaged", "b": [0.529, 0.3961, 0.6483, 0.4145]}, {"w": "with", "b": [0.6542, 0.3961, 0.6962, 0.4145]}, {"w": "Keras.", "b": [0.7021, 0.3961, 0.7631, 0.4145]}, {"w": "You", "b": [0.769, 0.3961, 0.8072, 0.4145]}, {"w": "can", "b": [0.8131, 0.3961, 0.8459, 0.4145]}, {"w": "import", "b": [0.1289, 0.4153, 0.1919, 0.4337]}, {"w": "it", "b": [0.1978, 0.4153, 0.2109, 0.4337]}, {"w": "from", "b": [0.2168, 0.4153, 0.2627, 0.4337]}, {"w": "the", "b": [0.2686, 0.4153, 0.2975, 0.4337]}, {"w": "keras.applications", "b": [0.3033, 0.4162, 0.5584, 0.4351]}, {"w": "module.", "b": [0.5643, 0.4153, 0.6411, 0.4337]}, {"w": "Here’s", "b": [0.647, 0.4153, 0.7086, 0.4337]}, {"w": "the", "b": [0.7145, 0.4153, 0.7433, 0.4337]}, {"w": "list", "b": [0.7492, 0.4153, 0.7781, 0.4337]}, {"w": "of", "b": [0.784, 0.4153, 0.8037, 0.4337]}, {"w": "image-classification", "b": [0.1289, 0.4353, 0.3191, 0.4538]}, {"w": "models", "b": [0.325, 0.4353, 0.3932, 0.4538]}, {"w": "(all", "b": [0.3991, 0.4353, 0.4306, 0.4538]}, {"w": "pretrained", "b": [0.4365, 0.4353, 0.5322, 0.4538]}, {"w": "on", "b": [0.5381, 0.4353, 0.5617, 0.4538]}, {"w": "the", "b": [0.5676, 0.4353, 0.5965, 0.4538]}, {"w": "ImageNet", "b": [0.6024, 0.4353, 0.6955, 0.4538]}, {"w": "dataset)", "b": [0.7014, 0.4353, 0.7749, 0.4538]}, {"w": "that", "b": [0.7808, 0.4353, 0.8162, 0.4538]}, {"w": "are", "b": [0.8221, 0.4353, 0.8509, 0.4538]}, {"w": "available", "b": [0.1289, 0.4545, 0.2141, 0.4729]}, {"w": "as", "b": [0.22, 0.4545, 0.2397, 0.4729]}, {"w": "part", "b": [0.2456, 0.4545, 0.2823, 0.4729]}, {"w": "of", "b": [0.2882, 0.4545, 0.3079, 0.4729]}, {"w": "keras.applications:", "b": [0.3138, 0.4545, 0.5754, 0.4744]}]}, {"id": "b_3", "type": "paragraph", "text": "Xception Inception V3 ResNet50 VGG16 VGG19 MobileNet", "words": [{"w": "Xception", "b": [0.1761, 0.4912, 0.2627, 0.5097]}, {"w": "Inception", "b": [0.1761, 0.5104, 0.2653, 0.5289]}, {"w": "V3", "b": [0.2712, 0.5104, 0.3001, 0.5289]}, {"w": "ResNet50", "b": [0.1761, 0.5296, 0.2692, 0.548]}, {"w": "VGG16", "b": [0.1761, 0.5488, 0.2509, 0.5672]}, {"w": "VGG19", "b": [0.1761, 0.5679, 0.2509, 0.5864]}, {"w": "MobileNet", "b": [0.1761, 0.5871, 0.2784, 0.6056]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s instantiate the VGG16 model.", "words": [{"w": "Let’s", "b": [0.1289, 0.6272, 0.1761, 0.6457]}, {"w": "instantiate", "b": [0.182, 0.6272, 0.2791, 0.6457]}, {"w": "the", "b": [0.285, 0.6272, 0.3138, 0.6457]}, {"w": "VGG16", "b": [0.3197, 0.6272, 0.3945, 0.6457]}, {"w": "model.", "b": [0.4004, 0.6272, 0.4653, 0.6457]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.16. Instantiating the VGG16 convolutional base", "words": [{"w": "Listing", "b": [0.1289, 0.6626, 0.182, 0.6765]}, {"w": "5.16.", "b": [0.1865, 0.6626, 0.2219, 0.6765]}, {"w": "Instantiating", "b": [0.2263, 0.6626, 0.3237, 0.6765]}, {"w": "the", "b": [0.3281, 0.6626, 0.3518, 0.6765]}, {"w": "VGG16", "b": [0.3562, 0.6626, 0.4142, 0.6765]}, {"w": "convolutional", "b": [0.4187, 0.6626, 0.521, 0.6765]}, {"w": "base", "b": [0.5254, 0.6626, 0.5589, 0.6765]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras.applications import VGG16 conv_base = VGG16(weights='imagenet', include_top=False, input_shape=(150, 150, 3))", "words": [{"w": "from", "b": [0.1348, 0.6892, 0.1773, 0.7034]}, {"w": "keras.applications", "b": [0.1879, 0.6892, 0.3792, 0.7034]}, {"w": "import", "b": [0.3898, 0.6892, 0.4536, 0.7034]}, {"w": "VGG16", "b": [0.4642, 0.6892, 0.5173, 0.7034]}, {"w": "conv_base", "b": [0.1348, 0.7176, 0.2304, 0.7318]}, {"w": "=", "b": [0.241, 0.7176, 0.2517, 0.7318]}, {"w": "VGG16(weights='imagenet',", "b": [0.2623, 0.7176, 0.528, 0.7318]}, {"w": "include_top=False,", "b": [0.3261, 0.7318, 0.5173, 0.7459]}, {"w": "input_shape=(150,", "b": [0.3261, 0.7459, 0.5067, 0.7601]}, {"w": "150,", "b": [0.5173, 0.7459, 0.5598, 0.7601]}, {"w": "3))", "b": [0.5705, 0.7459, 0.6024, 0.7601]}]}, {"id": "b_7", "type": "paragraph", "text": "You pass three arguments to the constructor:", "words": [{"w": "You", "b": [0.1289, 0.7816, 0.1672, 0.8]}, {"w": "pass", "b": [0.1731, 0.7816, 0.2137, 0.8]}, {"w": "three", "b": [0.2197, 0.7816, 0.2669, 0.8]}, {"w": "arguments", "b": [0.2728, 0.7816, 0.3707, 0.8]}, {"w": "to", "b": [0.3766, 0.7816, 0.395, 0.8]}, {"w": "the", "b": [0.4009, 0.7816, 0.4297, 0.8]}, {"w": "constructor:", "b": [0.4356, 0.7816, 0.5485, 0.8]}]}, {"id": "b_8", "type": "paragraph", "text": "weights specifies the weight checkpoint from which to initialize the model. include_top refers to including (or not) the densely connected classifier on top of the network. By default, this densely connected", "words": [{"w": "weights", "b": [0.1761, 0.8184, 0.2753, 0.8373]}, {"w": "specifies", "b": [0.2812, 0.8174, 0.3638, 0.8359]}, {"w": "the", "b": [0.3697, 0.8174, 0.3986, 0.8359]}, {"w": "weight", "b": [0.4045, 0.8174, 0.4688, 0.8359]}, {"w": "checkpoint", "b": [0.4747, 0.8174, 0.5783, 0.8359]}, {"w": "from", "b": [0.5842, 0.8174, 0.6301, 0.8359]}, {"w": "which", "b": [0.636, 0.8174, 0.6937, 0.8359]}, {"w": "to", "b": [0.6996, 0.8174, 0.718, 0.8359]}, {"w": "initialize", "b": [0.7239, 0.8174, 0.8065, 0.8359]}, {"w": "the", "b": [0.8125, 0.8174, 0.8413, 0.8359]}, {"w": "model.", "b": [0.1761, 0.8375, 0.241, 0.8559]}, {"w": "include_top", "b": [0.1761, 0.8576, 0.332, 0.8765]}, {"w": "refers", "b": [0.3379, 0.8566, 0.3916, 0.8751]}, {"w": "to", "b": [0.3975, 0.8566, 0.4159, 0.8751]}, {"w": "including", "b": [0.4218, 0.8566, 0.511, 0.8751]}, {"w": "(or", "b": [0.5169, 0.8566, 0.5445, 0.8751]}, {"w": "not)", "b": [0.5504, 0.8566, 0.5884, 0.8751]}, {"w": "the", "b": [0.5943, 0.8566, 0.6232, 0.8751]}, {"w": "densely", "b": [0.6291, 0.8566, 0.7012, 0.8751]}, {"w": "connected", "b": [0.7071, 0.8566, 0.8029, 0.8751]}, {"w": "classifier", "b": [0.1761, 0.8767, 0.2614, 0.8952]}, {"w": "on", "b": [0.2673, 0.8767, 0.2909, 0.8952]}, {"w": "top", "b": [0.2968, 0.8767, 0.327, 0.8952]}, {"w": "of", "b": [0.3329, 0.8767, 0.3525, 0.8952]}, {"w": "the", "b": [0.3584, 0.8767, 0.3873, 0.8952]}, {"w": "network.", "b": [0.3932, 0.8767, 0.4765, 0.8952]}, {"w": "By", "b": [0.4824, 0.8767, 0.5099, 0.8952]}, {"w": "default,", "b": [0.5159, 0.8767, 0.5873, 0.8952]}, {"w": "this", "b": [0.5932, 0.8767, 0.6274, 0.8952]}, {"w": "densely", "b": [0.6333, 0.8767, 0.7054, 0.8952]}, {"w": "connected", "b": [0.7113, 0.8767, 0.807, 0.8952]}]}]}, {"page": 201, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "classifier corresponds to the 1,000 classes from ImageNet. Because you intend to use your own densely connected classifier (with only two classes: cat and dog), you don’t need to include it. input_shape is the shape of the image tensors that you’ll feed to the network. This argument is purely optional: if you don’t pass it, the network will be able to process inputs of any size.", "words": [{"w": "classifier", "b": [0.1761, 0.0857, 0.2614, 0.1041]}, {"w": "corresponds", "b": [0.2672, 0.0857, 0.3814, 0.1041]}, {"w": "to", "b": [0.3873, 0.0857, 0.4056, 0.1041]}, {"w": "the", "b": [0.4115, 0.0857, 0.4404, 0.1041]}, {"w": "1,000", "b": [0.4463, 0.0857, 0.4994, 0.1041]}, {"w": "classes", "b": [0.5053, 0.0857, 0.5709, 0.1041]}, {"w": "from", "b": [0.5768, 0.0857, 0.6227, 0.1041]}, {"w": "ImageNet.", "b": [0.6286, 0.0857, 0.7276, 0.1041]}, {"w": "Because", "b": [0.7335, 0.0857, 0.8122, 0.1041]}, {"w": "you", "b": [0.8181, 0.0857, 0.8536, 0.1041]}, {"w": "intend", "b": [0.1761, 0.1049, 0.2351, 0.1233]}, {"w": "to", "b": [0.241, 0.1049, 0.2594, 0.1233]}, {"w": "use", "b": [0.2653, 0.1049, 0.2968, 0.1233]}, {"w": "your", "b": [0.3027, 0.1049, 0.346, 0.1233]}, {"w": "own", "b": [0.3519, 0.1049, 0.3926, 0.1233]}, {"w": "densely", "b": [0.3985, 0.1049, 0.4706, 0.1233]}, {"w": "connected", "b": [0.4765, 0.1049, 0.5722, 0.1233]}, {"w": "classifier", "b": [0.5781, 0.1049, 0.6634, 0.1233]}, {"w": "(with", "b": [0.6693, 0.1049, 0.7192, 0.1233]}, {"w": "only", "b": [0.7251, 0.1049, 0.767, 0.1233]}, {"w": "two", "b": [0.7729, 0.1049, 0.8083, 0.1233]}, {"w": "classes:", "b": [0.1761, 0.124, 0.2482, 0.1425]}, {"w": "cat", "b": [0.2541, 0.125, 0.2967, 0.1439]}, {"w": "and", "b": [0.3026, 0.124, 0.3367, 0.1425]}, {"w": "dog),", "b": [0.3426, 0.124, 0.3988, 0.1439]}, {"w": "you", "b": [0.4047, 0.124, 0.4402, 0.1425]}, {"w": "don’t", "b": [0.4461, 0.124, 0.4955, 0.1425]}, {"w": "need", "b": [0.5014, 0.124, 0.546, 0.1425]}, {"w": "to", "b": [0.5519, 0.124, 0.5702, 0.1425]}, {"w": "include", "b": [0.5761, 0.124, 0.6457, 0.1425]}, {"w": "it.", "b": [0.6516, 0.124, 0.6706, 0.1425]}, {"w": "input_shape", "b": [0.1761, 0.1451, 0.332, 0.164]}, {"w": "is", "b": [0.3379, 0.1441, 0.3536, 0.1626]}, {"w": "the", "b": [0.3595, 0.1441, 0.3884, 0.1626]}, {"w": "shape", "b": [0.3943, 0.1441, 0.4481, 0.1626]}, {"w": "of", "b": [0.454, 0.1441, 0.4736, 0.1626]}, {"w": "the", "b": [0.4796, 0.1441, 0.5084, 0.1626]}, {"w": "image", "b": [0.5143, 0.1441, 0.572, 0.1626]}, {"w": "tensors", "b": [0.5779, 0.1441, 0.6448, 0.1626]}, {"w": "that", "b": [0.6507, 0.1441, 0.6862, 0.1626]}, {"w": "you’ll", "b": [0.6921, 0.1441, 0.7485, 0.1626]}, {"w": "feed", "b": [0.7544, 0.1441, 0.795, 0.1626]}, {"w": "to", "b": [0.8009, 0.1441, 0.8193, 0.1626]}, {"w": "the", "b": [0.8252, 0.1441, 0.8541, 0.1626]}, {"w": "network.", "b": [0.1761, 0.1641, 0.2594, 0.1826]}, {"w": "This", "b": [0.2653, 0.1641, 0.3073, 0.1826]}, {"w": "argument", "b": [0.3132, 0.1641, 0.4019, 0.1826]}, {"w": "is", "b": [0.4078, 0.1641, 0.4236, 0.1826]}, {"w": "purely", "b": [0.4295, 0.1641, 0.4898, 0.1826]}, {"w": "optional:", "b": [0.4957, 0.1641, 0.5797, 0.1826]}, {"w": "if", "b": [0.5856, 0.1641, 0.6, 0.1826]}, {"w": "you", "b": [0.606, 0.1641, 0.6414, 0.1826]}, {"w": "don’t", "b": [0.6473, 0.1641, 0.6967, 0.1826]}, {"w": "pass", "b": [0.7026, 0.1641, 0.7432, 0.1826]}, {"w": "it,", "b": [0.7491, 0.1641, 0.7682, 0.1826]}, {"w": "the", "b": [0.7741, 0.1641, 0.8029, 0.1826]}, {"w": "network", "b": [0.1761, 0.1833, 0.2535, 0.2018]}, {"w": "will", "b": [0.2594, 0.1833, 0.2961, 0.2018]}, {"w": "be", "b": [0.302, 0.1833, 0.3243, 0.2018]}, {"w": "able", "b": [0.3302, 0.1833, 0.3696, 0.2018]}, {"w": "to", "b": [0.3755, 0.1833, 0.3939, 0.2018]}, {"w": "process", "b": [0.3998, 0.1833, 0.4706, 0.2018]}, {"w": "inputs", "b": [0.4765, 0.1833, 0.5342, 0.2018]}, {"w": "of", "b": [0.5401, 0.1833, 0.5598, 0.2018]}, {"w": "any", "b": [0.5657, 0.1833, 0.5998, 0.2018]}, {"w": "size.", "b": [0.6057, 0.1833, 0.6483, 0.2018]}]}, {"id": "b_1", "type": "paragraph", "text": "Here’s the detail of the architecture of the VGG16 convolutional base. It’s similar to the simple convnets you’re already familiar with:", "words": [{"w": "Here’s", "b": [0.1289, 0.2233, 0.1905, 0.2418]}, {"w": "the", "b": [0.1964, 0.2233, 0.2253, 0.2418]}, {"w": "detail", "b": [0.2312, 0.2233, 0.2836, 0.2418]}, {"w": "of", "b": [0.2895, 0.2233, 0.3092, 0.2418]}, {"w": "the", "b": [0.3151, 0.2233, 0.344, 0.2418]}, {"w": "architecture", "b": [0.3499, 0.2233, 0.4613, 0.2418]}, {"w": "of", "b": [0.4672, 0.2233, 0.4869, 0.2418]}, {"w": "the", "b": [0.4928, 0.2233, 0.5217, 0.2418]}, {"w": "VGG16", "b": [0.5276, 0.2233, 0.6023, 0.2418]}, {"w": "convolutional", "b": [0.6082, 0.2233, 0.7381, 0.2418]}, {"w": "base.", "b": [0.744, 0.2233, 0.7919, 0.2418]}, {"w": "It’s", "b": [0.7978, 0.2233, 0.8279, 0.2418]}, {"w": "similar", "b": [0.1289, 0.2425, 0.1945, 0.261]}, {"w": "to", "b": [0.2004, 0.2425, 0.2188, 0.261]}, {"w": "the", "b": [0.2247, 0.2425, 0.2535, 0.261]}, {"w": "simple", "b": [0.2594, 0.2425, 0.3224, 0.261]}, {"w": "convnets", "b": [0.3283, 0.2425, 0.4123, 0.261]}, {"w": "you’re", "b": [0.4182, 0.2425, 0.4798, 0.261]}, {"w": "already", "b": [0.4857, 0.2425, 0.5552, 0.261]}, {"w": "familiar", "b": [0.561, 0.2425, 0.6358, 0.261]}, {"w": "with:", "b": [0.6417, 0.2425, 0.6902, 0.261]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> conv_base.summary() Layer (type) Output Shape Param # ================================================================ input_1 (InputLayer) (None, 150, 150, 3) 0 ________________________________________________________________ block1_conv1 (Convolution2D) (None, 150, 150, 64) 1792 ________________________________________________________________ block1_conv2 (Convolution2D) (None, 150, 150, 64) 36928 ________________________________________________________________ block1_pool (MaxPooling2D) (None, 75, 75, 64) 0 ________________________________________________________________ block2_conv1 (Convolution2D) (None, 75, 75, 128) 73856 ________________________________________________________________ block2_conv2 (Convolution2D) (None, 75, 75, 128) 147584 ________________________________________________________________ block2_pool (MaxPooling2D) (None, 37, 37, 128) 0 ________________________________________________________________ block3_conv1 (Convolution2D) (None, 37, 37, 256) 295168 ________________________________________________________________ block3_conv2 (Convolution2D) (None, 37, 37, 256) 590080 ________________________________________________________________ block3_conv3 (Convolution2D) (None, 37, 37, 256) 590080 ________________________________________________________________ block3_pool (MaxPooling2D) (None, 18, 18, 256) 0 ________________________________________________________________ block4_conv1 (Convolution2D) (None, 18, 18, 512) 1180160 ________________________________________________________________ block4_conv2 (Convolution2D) (None, 18, 18, 512) 2359808 ________________________________________________________________ block4_conv3 (Convolution2D) (None, 18, 18, 512) 2359808 ________________________________________________________________ block4_pool (MaxPooling2D) (None, 9, 9, 512) 0 ________________________________________________________________ block5_conv1 (Convolution2D) (None, 9, 9, 512) 2359808 ________________________________________________________________ block5_conv2 (Convolution2D) (None, 9, 9, 512) 2359808 ________________________________________________________________ block5_conv3 (Convolution2D) (None, 9, 9, 512) 2359808 ________________________________________________________________ block5_pool (MaxPooling2D) (None, 4, 4, 512) 0 ================================================================ Total params: 14,714,688", "words": [{"w": ">>>", "b": [0.1348, 0.2779, 0.1667, 0.292]}, {"w": "conv_base.summary()", "b": [0.1773, 0.2779, 0.3792, 0.292]}, {"w": "Layer", "b": [0.1348, 0.292, 0.1879, 0.3062]}, {"w": "(type)", "b": [0.1985, 0.292, 0.2623, 0.3062]}, {"w": "Output", "b": [0.4855, 0.292, 0.5492, 0.3062]}, {"w": "Shape", "b": [0.5598, 0.292, 0.613, 0.3062]}, {"w": "Param", "b": [0.7192, 0.292, 0.7724, 0.3062]}, {"w": "#", "b": [0.783, 0.292, 0.7936, 0.3062]}, {"w": "================================================================", "b": [0.1348, 0.3062, 0.8149, 0.3204]}, {"w": "input_1", "b": [0.1348, 0.3204, 0.2092, 0.3346]}, {"w": "(InputLayer)", "b": [0.2198, 0.3204, 0.3473, 0.3346]}, {"w": "(None,", "b": [0.4855, 0.3204, 0.5492, 0.3346]}, {"w": "150,", "b": [0.5598, 0.3204, 0.6024, 0.3346]}, {"w": "150,", "b": [0.613, 0.3204, 0.6555, 0.3346]}, {"w": "3)", "b": [0.6661, 0.3204, 0.6874, 0.3346]}, {"w": "0", "b": [0.7192, 0.3204, 0.7299, 0.3346]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3488, 0.8149, 0.363]}, {"w": "block1_conv1", "b": [0.1348, 0.363, 0.2623, 0.3771]}, {"w": "(Convolution2D)", "b": [0.2729, 0.363, 0.4323, 0.3771]}, {"w": "(None,", "b": [0.4855, 0.363, 0.5492, 0.3771]}, {"w": "150,", "b": [0.5598, 0.363, 0.6024, 0.3771]}, {"w": "150,", "b": [0.613, 0.363, 0.6555, 0.3771]}, {"w": "64)", "b": [0.6661, 0.363, 0.698, 0.3771]}, {"w": "1792", "b": [0.7192, 0.363, 0.7618, 0.3771]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3772, 0.8149, 0.3913]}, {"w": "block1_conv2", "b": [0.1348, 0.3913, 0.2623, 0.4055]}, {"w": "(Convolution2D)", "b": [0.2729, 0.3913, 0.4323, 0.4055]}, {"w": "(None,", "b": [0.4855, 0.3913, 0.5492, 0.4055]}, {"w": "150,", "b": [0.5598, 0.3913, 0.6024, 0.4055]}, {"w": "150,", "b": [0.613, 0.3913, 0.6555, 0.4055]}, {"w": "64)", "b": [0.6661, 0.3913, 0.698, 0.4055]}, {"w": "36928", "b": [0.7192, 0.3913, 0.7724, 0.4055]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4055, 0.8149, 0.4197]}, {"w": "block1_pool", "b": [0.1348, 0.4197, 0.2517, 0.4339]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.4197, 0.4111, 0.4339]}, {"w": "(None,", "b": [0.4855, 0.4197, 0.5492, 0.4339]}, {"w": "75,", "b": [0.5598, 0.4197, 0.5917, 0.4339]}, {"w": "75,", "b": [0.6024, 0.4197, 0.6342, 0.4339]}, {"w": "64)", "b": [0.6449, 0.4197, 0.6767, 0.4339]}, {"w": "0", "b": [0.7192, 0.4197, 0.7299, 0.4339]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4339, 0.8149, 0.4481]}, {"w": "block2_conv1", "b": [0.1348, 0.4481, 0.2623, 0.4623]}, {"w": "(Convolution2D)", "b": [0.2729, 0.4481, 0.4323, 0.4623]}, {"w": "(None,", "b": [0.4855, 0.4481, 0.5492, 0.4623]}, {"w": "75,", "b": [0.5598, 0.4481, 0.5917, 0.4623]}, {"w": "75,", "b": [0.6024, 0.4481, 0.6342, 0.4623]}, {"w": "128)", "b": [0.6449, 0.4481, 0.6874, 0.4623]}, {"w": "73856", "b": [0.7192, 0.4481, 0.7724, 0.4623]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4623, 0.8149, 0.4764]}, {"w": "block2_conv2", "b": [0.1348, 0.4764, 0.2623, 0.4906]}, {"w": "(Convolution2D)", "b": [0.2729, 0.4764, 0.4323, 0.4906]}, {"w": "(None,", "b": [0.4855, 0.4764, 0.5492, 0.4906]}, {"w": "75,", "b": [0.5598, 0.4764, 0.5917, 0.4906]}, {"w": "75,", "b": [0.6024, 0.4764, 0.6342, 0.4906]}, {"w": "128)", "b": [0.6449, 0.4764, 0.6874, 0.4906]}, {"w": "147584", "b": [0.7192, 0.4764, 0.783, 0.4906]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4906, 0.8149, 0.5048]}, {"w": "block2_pool", "b": [0.1348, 0.5048, 0.2517, 0.519]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.5048, 0.4111, 0.519]}, {"w": "(None,", "b": [0.4855, 0.5048, 0.5492, 0.519]}, {"w": "37,", "b": [0.5598, 0.5048, 0.5917, 0.519]}, {"w": "37,", "b": [0.6024, 0.5048, 0.6342, 0.519]}, {"w": "128)", "b": [0.6449, 0.5048, 0.6874, 0.519]}, {"w": "0", "b": [0.7192, 0.5048, 0.7299, 0.519]}, {"w": "________________________________________________________________", "b": [0.1348, 0.519, 0.8149, 0.5332]}, {"w": "block3_conv1", "b": [0.1348, 0.5332, 0.2623, 0.5474]}, {"w": "(Convolution2D)", "b": [0.2729, 0.5332, 0.4323, 0.5474]}, {"w": "(None,", "b": [0.4855, 0.5332, 0.5492, 0.5474]}, {"w": "37,", "b": [0.5598, 0.5332, 0.5917, 0.5474]}, {"w": "37,", "b": [0.6024, 0.5332, 0.6342, 0.5474]}, {"w": "256)", "b": [0.6449, 0.5332, 0.6874, 0.5474]}, {"w": "295168", "b": [0.7192, 0.5332, 0.783, 0.5474]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5474, 0.8149, 0.5615]}, {"w": "block3_conv2", "b": [0.1348, 0.5615, 0.2623, 0.5757]}, {"w": "(Convolution2D)", "b": [0.2729, 0.5615, 0.4323, 0.5757]}, {"w": "(None,", "b": [0.4855, 0.5615, 0.5492, 0.5757]}, {"w": "37,", "b": [0.5598, 0.5615, 0.5917, 0.5757]}, {"w": "37,", "b": [0.6024, 0.5615, 0.6342, 0.5757]}, {"w": "256)", "b": [0.6449, 0.5615, 0.6874, 0.5757]}, {"w": "590080", "b": [0.7192, 0.5615, 0.783, 0.5757]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5757, 0.8149, 0.5899]}, {"w": "block3_conv3", "b": [0.1348, 0.5899, 0.2623, 0.6041]}, {"w": "(Convolution2D)", "b": [0.2729, 0.5899, 0.4323, 0.6041]}, {"w": "(None,", "b": [0.4855, 0.5899, 0.5492, 0.6041]}, {"w": "37,", "b": [0.5598, 0.5899, 0.5917, 0.6041]}, {"w": "37,", "b": [0.6024, 0.5899, 0.6342, 0.6041]}, {"w": "256)", "b": [0.6449, 0.5899, 0.6874, 0.6041]}, {"w": "590080", "b": [0.7192, 0.5899, 0.783, 0.6041]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6041, 0.8149, 0.6183]}, {"w": "block3_pool", "b": [0.1348, 0.6183, 0.2517, 0.6325]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.6183, 0.4111, 0.6325]}, {"w": "(None,", "b": [0.4855, 0.6183, 0.5492, 0.6325]}, {"w": "18,", "b": [0.5598, 0.6183, 0.5917, 0.6325]}, {"w": "18,", "b": [0.6024, 0.6183, 0.6342, 0.6325]}, {"w": "256)", "b": [0.6449, 0.6183, 0.6874, 0.6325]}, {"w": "0", "b": [0.7192, 0.6183, 0.7299, 0.6325]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6325, 0.8149, 0.6467]}, {"w": "block4_conv1", "b": [0.1348, 0.6467, 0.2623, 0.6608]}, {"w": "(Convolution2D)", "b": [0.2729, 0.6467, 0.4323, 0.6608]}, {"w": "(None,", "b": [0.4855, 0.6467, 0.5492, 0.6608]}, {"w": "18,", "b": [0.5598, 0.6467, 0.5917, 0.6608]}, {"w": "18,", "b": [0.6024, 0.6467, 0.6342, 0.6608]}, {"w": "512)", "b": [0.6449, 0.6467, 0.6874, 0.6608]}, {"w": "1180160", "b": [0.7192, 0.6467, 0.7936, 0.6608]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6608, 0.8149, 0.675]}, {"w": "block4_conv2", "b": [0.1348, 0.675, 0.2623, 0.6892]}, {"w": "(Convolution2D)", "b": [0.2729, 0.675, 0.4323, 0.6892]}, {"w": "(None,", "b": [0.4855, 0.675, 0.5492, 0.6892]}, {"w": "18,", "b": [0.5598, 0.675, 0.5917, 0.6892]}, {"w": "18,", "b": [0.6024, 0.675, 0.6342, 0.6892]}, {"w": "512)", "b": [0.6449, 0.675, 0.6874, 0.6892]}, {"w": "2359808", "b": [0.7192, 0.675, 0.7936, 0.6892]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6892, 0.8149, 0.7034]}, {"w": "block4_conv3", "b": [0.1348, 0.7034, 0.2623, 0.7176]}, {"w": "(Convolution2D)", "b": [0.2729, 0.7034, 0.4323, 0.7176]}, {"w": "(None,", "b": [0.4855, 0.7034, 0.5492, 0.7176]}, {"w": "18,", "b": [0.5598, 0.7034, 0.5917, 0.7176]}, {"w": "18,", "b": [0.6024, 0.7034, 0.6342, 0.7176]}, {"w": "512)", "b": [0.6449, 0.7034, 0.6874, 0.7176]}, {"w": "2359808", "b": [0.7192, 0.7034, 0.7936, 0.7176]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7176, 0.8149, 0.7318]}, {"w": "block4_pool", "b": [0.1348, 0.7318, 0.2517, 0.7459]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.7318, 0.4111, 0.7459]}, {"w": "(None,", "b": [0.4855, 0.7318, 0.5492, 0.7459]}, {"w": "9,", "b": [0.5598, 0.7318, 0.5811, 0.7459]}, {"w": "9,", "b": [0.5917, 0.7318, 0.613, 0.7459]}, {"w": "512)", "b": [0.6236, 0.7318, 0.6661, 0.7459]}, {"w": "0", "b": [0.7192, 0.7318, 0.7299, 0.7459]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7459, 0.8149, 0.7601]}, {"w": "block5_conv1", "b": [0.1348, 0.7601, 0.2623, 0.7743]}, {"w": "(Convolution2D)", "b": [0.2729, 0.7601, 0.4323, 0.7743]}, {"w": "(None,", "b": [0.4855, 0.7601, 0.5492, 0.7743]}, {"w": "9,", "b": [0.5598, 0.7601, 0.5811, 0.7743]}, {"w": "9,", "b": [0.5917, 0.7601, 0.613, 0.7743]}, {"w": "512)", "b": [0.6236, 0.7601, 0.6661, 0.7743]}, {"w": "2359808", "b": [0.7192, 0.7601, 0.7936, 0.7743]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7743, 0.8149, 0.7885]}, {"w": "block5_conv2", "b": [0.1348, 0.7885, 0.2623, 0.8027]}, {"w": "(Convolution2D)", "b": [0.2729, 0.7885, 0.4323, 0.8027]}, {"w": "(None,", "b": [0.4855, 0.7885, 0.5492, 0.8027]}, {"w": "9,", "b": [0.5598, 0.7885, 0.5811, 0.8027]}, {"w": "9,", "b": [0.5917, 0.7885, 0.613, 0.8027]}, {"w": "512)", "b": [0.6236, 0.7885, 0.6661, 0.8027]}, {"w": "2359808", "b": [0.7192, 0.7885, 0.7936, 0.8027]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8027, 0.8149, 0.8169]}, {"w": "block5_conv3", "b": [0.1348, 0.8169, 0.2623, 0.8311]}, {"w": "(Convolution2D)", "b": [0.2729, 0.8169, 0.4323, 0.8311]}, {"w": "(None,", "b": [0.4855, 0.8169, 0.5492, 0.8311]}, {"w": "9,", "b": [0.5598, 0.8169, 0.5811, 0.8311]}, {"w": "9,", "b": [0.5917, 0.8169, 0.613, 0.8311]}, {"w": "512)", "b": [0.6236, 0.8169, 0.6661, 0.8311]}, {"w": "2359808", "b": [0.7192, 0.8169, 0.7936, 0.8311]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8311, 0.8149, 0.8452]}, {"w": "block5_pool", "b": [0.1348, 0.8452, 0.2517, 0.8594]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.8452, 0.4111, 0.8594]}, {"w": "(None,", "b": [0.4855, 0.8452, 0.5492, 0.8594]}, {"w": "4,", "b": [0.5598, 0.8452, 0.5811, 0.8594]}, {"w": "4,", "b": [0.5917, 0.8452, 0.613, 0.8594]}, {"w": "512)", "b": [0.6236, 0.8452, 0.6661, 0.8594]}, {"w": "0", "b": [0.7192, 0.8452, 0.7299, 0.8594]}, {"w": "================================================================", "b": [0.1348, 0.8594, 0.8149, 0.8736]}, {"w": "Total", "b": [0.1348, 0.8736, 0.1879, 0.8878]}, {"w": "params:", "b": [0.1985, 0.8736, 0.2729, 0.8878]}, {"w": "14,714,688", "b": [0.2836, 0.8736, 0.3898, 0.8878]}]}]}, {"page": 202, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Trainable params: 14,714,688 Non-trainable params: 0", "words": [{"w": "Trainable", "b": [0.1348, 0.0851, 0.2304, 0.0993]}, {"w": "params:", "b": [0.241, 0.0851, 0.3154, 0.0993]}, {"w": "14,714,688", "b": [0.3261, 0.0851, 0.4323, 0.0993]}, {"w": "Non-trainable", "b": [0.1348, 0.0993, 0.2729, 0.1135]}, {"w": "params:", "b": [0.2836, 0.0993, 0.3579, 0.1135]}, {"w": "0", "b": [0.3686, 0.0993, 0.3792, 0.1135]}]}, {"id": "b_1", "type": "paragraph", "text": "The final feature map has shape (4, 4, 512). That’s the feature on top of which you’ll stick a densely connected classifier.", "words": [{"w": "The", "b": [0.1289, 0.1349, 0.1656, 0.1534]}, {"w": "final", "b": [0.1715, 0.1349, 0.2148, 0.1534]}, {"w": "feature", "b": [0.2207, 0.1349, 0.2862, 0.1534]}, {"w": "map", "b": [0.2921, 0.1349, 0.3328, 0.1534]}, {"w": "has", "b": [0.3387, 0.1349, 0.3702, 0.1534]}, {"w": "shape", "b": [0.3761, 0.1349, 0.4299, 0.1534]}, {"w": "(4,", "b": [0.4357, 0.1359, 0.4782, 0.1548]}, {"w": "4,", "b": [0.4924, 0.1359, 0.5207, 0.1548]}, {"w": "512).", "b": [0.5349, 0.1349, 0.5975, 0.1548]}, {"w": "That’s", "b": [0.6034, 0.1349, 0.6624, 0.1534]}, {"w": "the", "b": [0.6683, 0.1349, 0.6972, 0.1534]}, {"w": "feature", "b": [0.7031, 0.1349, 0.7686, 0.1534]}, {"w": "on", "b": [0.7745, 0.1349, 0.7982, 0.1534]}, {"w": "top", "b": [0.8041, 0.1349, 0.8342, 0.1534]}, {"w": "of", "b": [0.8401, 0.1349, 0.8598, 0.1534]}, {"w": "which", "b": [0.1289, 0.1549, 0.1866, 0.1734]}, {"w": "you’ll", "b": [0.1925, 0.1549, 0.2489, 0.1734]}, {"w": "stick", "b": [0.2548, 0.1549, 0.2994, 0.1734]}, {"w": "a", "b": [0.3053, 0.1549, 0.3158, 0.1734]}, {"w": "densely", "b": [0.3217, 0.1549, 0.3939, 0.1734]}, {"w": "connected", "b": [0.3998, 0.1549, 0.4955, 0.1734]}, {"w": "classifier.", "b": [0.5014, 0.1549, 0.5912, 0.1734]}]}, {"id": "b_2", "type": "paragraph", "text": "At this point, there are two ways you could proceed:", "words": [{"w": "At", "b": [0.1289, 0.195, 0.1525, 0.2135]}, {"w": "this", "b": [0.1584, 0.195, 0.1925, 0.2135]}, {"w": "point,", "b": [0.1984, 0.195, 0.2529, 0.2135]}, {"w": "there", "b": [0.2588, 0.195, 0.306, 0.2135]}, {"w": "are", "b": [0.3119, 0.195, 0.3407, 0.2135]}, {"w": "two", "b": [0.3466, 0.195, 0.382, 0.2135]}, {"w": "ways", "b": [0.388, 0.195, 0.4365, 0.2135]}, {"w": "you", "b": [0.4424, 0.195, 0.4778, 0.2135]}, {"w": "could", "b": [0.4837, 0.195, 0.5362, 0.2135]}, {"w": "proceed:", "b": [0.5421, 0.195, 0.6234, 0.2135]}]}, {"id": "b_3", "type": "paragraph", "text": "Running the convolutional base over your dataset, recording its output to a Numpy array on disk, and then using this data as input to a standalone, densely connected classifier similar to those you saw in part 1 of this book. This solution is fast and cheap to run, because it only requires running the convolutional base once for every input image, and the convolutional base is by far the most expensive part of the pipeline. But for the same reason, this technique won’t allow you to use data augmentation. Extending the model you have (conv_base) by adding Dense layers on top, and running the whole thing end to end on the input data. This will allow you to use data augmentation, because every input image goes through the convolutional base every time it’s seen by the model. But for the same reason, this technique is far more expensive than the first.", "words": [{"w": "Running", "b": [0.1761, 0.2309, 0.2575, 0.2493]}, {"w": "the", "b": [0.2634, 0.2309, 0.2922, 0.2493]}, {"w": "convolutional", "b": [0.2981, 0.2309, 0.428, 0.2493]}, {"w": "base", "b": [0.4339, 0.2309, 0.4759, 0.2493]}, {"w": "over", "b": [0.4818, 0.2309, 0.5237, 0.2493]}, {"w": "your", "b": [0.5296, 0.2309, 0.5729, 0.2493]}, {"w": "dataset,", "b": [0.5788, 0.2309, 0.6503, 0.2493]}, {"w": "recording", "b": [0.6562, 0.2309, 0.7467, 0.2493]}, {"w": "its", "b": [0.7526, 0.2309, 0.7749, 0.2493]}, {"w": "output", "b": [0.7808, 0.2309, 0.8412, 0.2493]}, {"w": "to", "b": [0.8471, 0.2309, 0.8655, 0.2493]}, {"w": "a", "b": [0.1761, 0.25, 0.1866, 0.2685]}, {"w": "Numpy", "b": [0.1925, 0.25, 0.2633, 0.2685]}, {"w": "array", "b": [0.2692, 0.25, 0.3177, 0.2685]}, {"w": "on", "b": [0.3237, 0.25, 0.3473, 0.2685]}, {"w": "disk,", "b": [0.3532, 0.25, 0.3984, 0.2685]}, {"w": "and", "b": [0.4043, 0.25, 0.4384, 0.2685]}, {"w": "then", "b": [0.4443, 0.25, 0.485, 0.2685]}, {"w": "using", "b": [0.4909, 0.25, 0.5421, 0.2685]}, {"w": "this", "b": [0.548, 0.25, 0.5821, 0.2685]}, {"w": "data", "b": [0.588, 0.25, 0.6274, 0.2685]}, {"w": "as", "b": [0.6332, 0.25, 0.6529, 0.2685]}, {"w": "input", "b": [0.6588, 0.25, 0.7073, 0.2685]}, {"w": "to", "b": [0.7132, 0.25, 0.7316, 0.2685]}, {"w": "a", "b": [0.7375, 0.25, 0.748, 0.2685]}, {"w": "standalone,", "b": [0.7539, 0.25, 0.8608, 0.2685]}, {"w": "densely", "b": [0.1761, 0.2692, 0.2482, 0.2877]}, {"w": "connected", "b": [0.2542, 0.2692, 0.3499, 0.2877]}, {"w": "classifier", "b": [0.3558, 0.2692, 0.441, 0.2877]}, {"w": "similar", "b": [0.4469, 0.2692, 0.5125, 0.2877]}, {"w": "to", "b": [0.5184, 0.2692, 0.5368, 0.2877]}, {"w": "those", "b": [0.5427, 0.2692, 0.5926, 0.2877]}, {"w": "you", "b": [0.5985, 0.2692, 0.6339, 0.2877]}, {"w": "saw", "b": [0.6398, 0.2692, 0.6765, 0.2877]}, {"w": "in", "b": [0.6824, 0.2692, 0.7008, 0.2877]}, {"w": "part", "b": [0.7066, 0.2692, 0.7433, 0.2877]}, {"w": "1", "b": [0.7493, 0.2692, 0.7611, 0.2877]}, {"w": "of", "b": [0.767, 0.2692, 0.7866, 0.2877]}, {"w": "this", "b": [0.7925, 0.2692, 0.8267, 0.2877]}, {"w": "book.", "b": [0.1761, 0.2884, 0.2292, 0.3069]}, {"w": "This", "b": [0.2351, 0.2884, 0.2771, 0.3069]}, {"w": "solution", "b": [0.283, 0.2884, 0.3591, 0.3069]}, {"w": "is", "b": [0.365, 0.2884, 0.3808, 0.3069]}, {"w": "fast", "b": [0.3867, 0.2884, 0.4208, 0.3069]}, {"w": "and", "b": [0.4267, 0.2884, 0.4608, 0.3069]}, {"w": "cheap", "b": [0.4667, 0.2884, 0.5218, 0.3069]}, {"w": "to", "b": [0.5277, 0.2884, 0.5461, 0.3069]}, {"w": "run,", "b": [0.552, 0.2884, 0.5893, 0.3069]}, {"w": "because", "b": [0.5952, 0.2884, 0.67, 0.3069]}, {"w": "it", "b": [0.6759, 0.2884, 0.689, 0.3069]}, {"w": "only", "b": [0.6949, 0.2884, 0.7369, 0.3069]}, {"w": "requires", "b": [0.7428, 0.2884, 0.8189, 0.3069]}, {"w": "running", "b": [0.1761, 0.3076, 0.2496, 0.3261]}, {"w": "the", "b": [0.2555, 0.3076, 0.2843, 0.3261]}, {"w": "convolutional", "b": [0.2902, 0.3076, 0.4201, 0.3261]}, {"w": "base", "b": [0.426, 0.3076, 0.468, 0.3261]}, {"w": "once", "b": [0.4739, 0.3076, 0.5185, 0.3261]}, {"w": "for", "b": [0.5244, 0.3076, 0.5519, 0.3261]}, {"w": "every", "b": [0.5578, 0.3076, 0.6103, 0.3261]}, {"w": "input", "b": [0.6161, 0.3076, 0.6647, 0.3261]}, {"w": "image,", "b": [0.6706, 0.3076, 0.7342, 0.3261]}, {"w": "and", "b": [0.7401, 0.3076, 0.7742, 0.3261]}, {"w": "the", "b": [0.7801, 0.3076, 0.809, 0.3261]}, {"w": "convolutional", "b": [0.1761, 0.3268, 0.306, 0.3453]}, {"w": "base", "b": [0.3119, 0.3268, 0.3539, 0.3453]}, {"w": "is", "b": [0.3598, 0.3268, 0.3755, 0.3453]}, {"w": "by", "b": [0.3814, 0.3268, 0.405, 0.3453]}, {"w": "far", "b": [0.4109, 0.3268, 0.4371, 0.3453]}, {"w": "the", "b": [0.443, 0.3268, 0.4719, 0.3453]}, {"w": "most", "b": [0.4778, 0.3268, 0.5237, 0.3453]}, {"w": "expensive", "b": [0.5296, 0.3268, 0.6241, 0.3453]}, {"w": "part", "b": [0.63, 0.3268, 0.6667, 0.3453]}, {"w": "of", "b": [0.6726, 0.3268, 0.6923, 0.3453]}, {"w": "the", "b": [0.6982, 0.3268, 0.727, 0.3453]}, {"w": "pipeline.", "b": [0.7329, 0.3268, 0.8149, 0.3453]}, {"w": "But", "b": [0.8208, 0.3268, 0.855, 0.3453]}, {"w": "for", "b": [0.1761, 0.346, 0.2036, 0.3645]}, {"w": "the", "b": [0.2095, 0.346, 0.2384, 0.3645]}, {"w": "same", "b": [0.2443, 0.346, 0.2928, 0.3645]}, {"w": "reason,", "b": [0.2987, 0.346, 0.3663, 0.3645]}, {"w": "this", "b": [0.3722, 0.346, 0.4063, 0.3645]}, {"w": "technique", "b": [0.4122, 0.346, 0.504, 0.3645]}, {"w": "won’t", "b": [0.5099, 0.346, 0.5645, 0.3645]}, {"w": "allow", "b": [0.5704, 0.346, 0.6229, 0.3645]}, {"w": "you", "b": [0.6288, 0.346, 0.6642, 0.3645]}, {"w": "to", "b": [0.6701, 0.346, 0.6885, 0.3645]}, {"w": "use", "b": [0.6944, 0.346, 0.7259, 0.3645]}, {"w": "data", "b": [0.7318, 0.346, 0.7711, 0.3645]}, {"w": "augmentation.", "b": [0.1761, 0.3652, 0.3106, 0.3837]}, {"w": "Extending", "b": [0.1761, 0.3844, 0.2732, 0.4029]}, {"w": "the", "b": [0.2791, 0.3844, 0.3079, 0.4029]}, {"w": "model", "b": [0.3139, 0.3844, 0.3729, 0.4029]}, {"w": "you", "b": [0.3788, 0.3844, 0.4142, 0.4029]}, {"w": "have", "b": [0.4201, 0.3844, 0.4647, 0.4029]}, {"w": "(conv_base)", "b": [0.4706, 0.3844, 0.6138, 0.4043]}, {"w": "by", "b": [0.6197, 0.3844, 0.6433, 0.4029]}, {"w": "adding", "b": [0.6492, 0.3844, 0.7135, 0.4029]}, {"w": "Dense", "b": [0.7194, 0.3854, 0.7903, 0.4043]}, {"w": "layers", "b": [0.7962, 0.3844, 0.8526, 0.4029]}, {"w": "on", "b": [0.1761, 0.4044, 0.1997, 0.4229]}, {"w": "top,", "b": [0.2056, 0.4044, 0.2417, 0.4229]}, {"w": "and", "b": [0.2476, 0.4044, 0.2817, 0.4229]}, {"w": "running", "b": [0.2876, 0.4044, 0.3611, 0.4229]}, {"w": "the", "b": [0.367, 0.4044, 0.3958, 0.4229]}, {"w": "whole", "b": [0.4017, 0.4044, 0.4595, 0.4229]}, {"w": "thing", "b": [0.4654, 0.4044, 0.5139, 0.4229]}, {"w": "end", "b": [0.5198, 0.4044, 0.5539, 0.4229]}, {"w": "to", "b": [0.5598, 0.4044, 0.5782, 0.4229]}, {"w": "end", "b": [0.5841, 0.4044, 0.6182, 0.4229]}, {"w": "on", "b": [0.6241, 0.4044, 0.6477, 0.4229]}, {"w": "the", "b": [0.6536, 0.4044, 0.6825, 0.4229]}, {"w": "input", "b": [0.6884, 0.4044, 0.7369, 0.4229]}, {"w": "data.", "b": [0.7428, 0.4044, 0.7881, 0.4229]}, {"w": "This", "b": [0.794, 0.4044, 0.836, 0.4229]}, {"w": "will", "b": [0.1761, 0.4236, 0.2128, 0.4421]}, {"w": "allow", "b": [0.2188, 0.4236, 0.2712, 0.4421]}, {"w": "you", "b": [0.2771, 0.4236, 0.3126, 0.4421]}, {"w": "to", "b": [0.3185, 0.4236, 0.3368, 0.4421]}, {"w": "use", "b": [0.3427, 0.4236, 0.3742, 0.4421]}, {"w": "data", "b": [0.3801, 0.4236, 0.4195, 0.4421]}, {"w": "augmentation,", "b": [0.4254, 0.4236, 0.5598, 0.4421]}, {"w": "because", "b": [0.5657, 0.4236, 0.6405, 0.4421]}, {"w": "every", "b": [0.6463, 0.4236, 0.6987, 0.4421]}, {"w": "input", "b": [0.7046, 0.4236, 0.7532, 0.4421]}, {"w": "image", "b": [0.7591, 0.4236, 0.8168, 0.4421]}, {"w": "goes", "b": [0.8227, 0.4236, 0.866, 0.4421]}, {"w": "through", "b": [0.1761, 0.4428, 0.2496, 0.4613]}, {"w": "the", "b": [0.2555, 0.4428, 0.2843, 0.4613]}, {"w": "convolutional", "b": [0.2902, 0.4428, 0.4201, 0.4613]}, {"w": "base", "b": [0.426, 0.4428, 0.468, 0.4613]}, {"w": "every", "b": [0.4739, 0.4428, 0.5263, 0.4613]}, {"w": "time", "b": [0.5322, 0.4428, 0.5742, 0.4613]}, {"w": "it’s", "b": [0.5801, 0.4428, 0.6089, 0.4613]}, {"w": "seen", "b": [0.6148, 0.4428, 0.6568, 0.4613]}, {"w": "by", "b": [0.6627, 0.4428, 0.6863, 0.4613]}, {"w": "the", "b": [0.6922, 0.4428, 0.7211, 0.4613]}, {"w": "model.", "b": [0.727, 0.4428, 0.7919, 0.4613]}, {"w": "But", "b": [0.7978, 0.4428, 0.832, 0.4613]}, {"w": "for", "b": [0.8379, 0.4428, 0.8654, 0.4613]}, {"w": "the", "b": [0.1761, 0.462, 0.205, 0.4805]}, {"w": "same", "b": [0.2109, 0.462, 0.2594, 0.4805]}, {"w": "reason,", "b": [0.2653, 0.462, 0.3328, 0.4805]}, {"w": "this", "b": [0.3387, 0.462, 0.3729, 0.4805]}, {"w": "technique", "b": [0.3788, 0.462, 0.4706, 0.4805]}, {"w": "is", "b": [0.4764, 0.462, 0.4922, 0.4805]}, {"w": "far", "b": [0.4981, 0.462, 0.5243, 0.4805]}, {"w": "more", "b": [0.5302, 0.462, 0.5787, 0.4805]}, {"w": "expensive", "b": [0.5846, 0.462, 0.6791, 0.4805]}, {"w": "than", "b": [0.685, 0.462, 0.7256, 0.4805]}, {"w": "the", "b": [0.7315, 0.462, 0.7604, 0.4805]}, {"w": "first.", "b": [0.7663, 0.462, 0.8103, 0.4805]}]}, {"id": "b_4", "type": "paragraph", "text": "We’ll cover both techniques. Let’s walk through the code required to set up the first one: recording the output of conv_base on your data and using these outputs as inputs to a new model.", "words": [{"w": "We’ll", "b": [0.1289, 0.502, 0.1808, 0.5205]}, {"w": "cover", "b": [0.1867, 0.502, 0.2391, 0.5205]}, {"w": "both", "b": [0.245, 0.502, 0.287, 0.5205]}, {"w": "techniques.", "b": [0.2929, 0.502, 0.3998, 0.5205]}, {"w": "Let’s", "b": [0.4057, 0.502, 0.4529, 0.5205]}, {"w": "walk", "b": [0.4588, 0.502, 0.5047, 0.5205]}, {"w": "through", "b": [0.5106, 0.502, 0.5841, 0.5205]}, {"w": "the", "b": [0.59, 0.502, 0.6188, 0.5205]}, {"w": "code", "b": [0.6247, 0.502, 0.6693, 0.5205]}, {"w": "required", "b": [0.6752, 0.502, 0.7539, 0.5205]}, {"w": "to", "b": [0.7598, 0.502, 0.7782, 0.5205]}, {"w": "set", "b": [0.7841, 0.502, 0.8103, 0.5205]}, {"w": "up", "b": [0.8162, 0.502, 0.8398, 0.5205]}, {"w": "the", "b": [0.1289, 0.5212, 0.1577, 0.5397]}, {"w": "first", "b": [0.1636, 0.5212, 0.2017, 0.5397]}, {"w": "one:", "b": [0.2076, 0.5212, 0.2482, 0.5397]}, {"w": "recording", "b": [0.2542, 0.5212, 0.3446, 0.5397]}, {"w": "the", "b": [0.3505, 0.5212, 0.3794, 0.5397]}, {"w": "output", "b": [0.3853, 0.5212, 0.4457, 0.5397]}, {"w": "of", "b": [0.4516, 0.5212, 0.4712, 0.5397]}, {"w": "conv_base", "b": [0.4771, 0.5222, 0.6046, 0.5411]}, {"w": "on", "b": [0.6105, 0.5212, 0.6342, 0.5397]}, {"w": "your", "b": [0.6401, 0.5212, 0.6833, 0.5397]}, {"w": "data", "b": [0.6893, 0.5212, 0.7286, 0.5397]}, {"w": "and", "b": [0.7345, 0.5212, 0.7686, 0.5397]}, {"w": "using", "b": [0.7745, 0.5212, 0.8257, 0.5397]}, {"w": "these", "b": [0.1289, 0.5412, 0.1774, 0.5597]}, {"w": "outputs", "b": [0.1833, 0.5412, 0.2529, 0.5597]}, {"w": "as", "b": [0.2588, 0.5412, 0.2784, 0.5597]}, {"w": "inputs", "b": [0.2843, 0.5412, 0.3421, 0.5597]}, {"w": "to", "b": [0.348, 0.5412, 0.3663, 0.5597]}, {"w": "a", "b": [0.3722, 0.5412, 0.3827, 0.5597]}, {"w": "new", "b": [0.3886, 0.5412, 0.428, 0.5597]}, {"w": "model.", "b": [0.4339, 0.5412, 0.4988, 0.5597]}]}, {"id": "b_5", "type": "paragraph", "text": "Fast feature extraction without data augmentation", "words": [{"w": "Fast", "b": [0.1289, 0.5767, 0.1613, 0.5905]}, {"w": "feature", "b": [0.1658, 0.5767, 0.2195, 0.5905]}, {"w": "extraction", "b": [0.224, 0.5767, 0.3007, 0.5905]}, {"w": "without", "b": [0.3051, 0.5767, 0.3632, 0.5905]}, {"w": "data", "b": [0.3676, 0.5767, 0.4011, 0.5905]}, {"w": "augmentation", "b": [0.4055, 0.5767, 0.5098, 0.5905]}]}, {"id": "b_6", "type": "paragraph", "text": "You’ll start by running instances of the previously introduced ImageDataGenerator to extract images as Numpy arrays as well as their labels. You’ll extract features from these images by calling the predict method of the conv_base model.", "words": [{"w": "You’ll", "b": [0.1289, 0.6122, 0.1882, 0.6307]}, {"w": "start", "b": [0.1941, 0.6122, 0.2347, 0.6307]}, {"w": "by", "b": [0.2406, 0.6122, 0.2643, 0.6307]}, {"w": "running", "b": [0.2702, 0.6122, 0.3436, 0.6307]}, {"w": "instances", "b": [0.3495, 0.6122, 0.4361, 0.6307]}, {"w": "of", "b": [0.442, 0.6122, 0.4617, 0.6307]}, {"w": "the", "b": [0.4676, 0.6122, 0.4964, 0.6307]}, {"w": "previously", "b": [0.5023, 0.6122, 0.602, 0.6307]}, {"w": "introduced", "b": [0.608, 0.6122, 0.709, 0.6307]}, {"w": "ImageDataGenerator", "b": [0.1289, 0.6323, 0.3839, 0.6512]}, {"w": "to", "b": [0.3899, 0.6314, 0.4082, 0.6498]}, {"w": "extract", "b": [0.4141, 0.6314, 0.4784, 0.6498]}, {"w": "images", "b": [0.4843, 0.6314, 0.5512, 0.6498]}, {"w": "as", "b": [0.5571, 0.6314, 0.5768, 0.6498]}, {"w": "Numpy", "b": [0.5827, 0.6314, 0.6535, 0.6498]}, {"w": "arrays", "b": [0.6594, 0.6314, 0.7171, 0.6498]}, {"w": "as", "b": [0.723, 0.6314, 0.7427, 0.6498]}, {"w": "well", "b": [0.7486, 0.6314, 0.7893, 0.6498]}, {"w": "as", "b": [0.7952, 0.6314, 0.8148, 0.6498]}, {"w": "their", "b": [0.8207, 0.6314, 0.864, 0.6498]}, {"w": "labels.", "b": [0.1289, 0.6514, 0.1899, 0.6699]}, {"w": "You’ll", "b": [0.1958, 0.6514, 0.2551, 0.6699]}, {"w": "extract", "b": [0.261, 0.6514, 0.3252, 0.6699]}, {"w": "features", "b": [0.3311, 0.6514, 0.4059, 0.6699]}, {"w": "from", "b": [0.4118, 0.6514, 0.4577, 0.6699]}, {"w": "these", "b": [0.4636, 0.6514, 0.5121, 0.6699]}, {"w": "images", "b": [0.518, 0.6514, 0.5849, 0.6699]}, {"w": "by", "b": [0.5908, 0.6514, 0.6144, 0.6699]}, {"w": "calling", "b": [0.6203, 0.6514, 0.6846, 0.6699]}, {"w": "the", "b": [0.6905, 0.6514, 0.7194, 0.6699]}, {"w": "predict", "b": [0.7252, 0.6524, 0.8244, 0.6713]}, {"w": "method", "b": [0.1289, 0.6714, 0.1997, 0.6899]}, {"w": "of", "b": [0.2056, 0.6714, 0.2253, 0.6899]}, {"w": "the", "b": [0.2312, 0.6714, 0.2601, 0.6899]}, {"w": "conv_base", "b": [0.2659, 0.6724, 0.3935, 0.6913]}, {"w": "model.", "b": [0.3994, 0.6714, 0.4643, 0.6899]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 5.17. Extracting features using the pretrained convolutional base", "words": [{"w": "Listing", "b": [0.1289, 0.7077, 0.182, 0.7215]}, {"w": "5.17.", "b": [0.1865, 0.7077, 0.2219, 0.7215]}, {"w": "Extracting", "b": [0.2263, 0.7077, 0.307, 0.7215]}, {"w": "features", "b": [0.3114, 0.7077, 0.372, 0.7215]}, {"w": "using", "b": [0.3765, 0.7077, 0.4168, 0.7215]}, {"w": "the", "b": [0.4213, 0.7077, 0.4449, 0.7215]}, {"w": "pretrained", "b": [0.4493, 0.7077, 0.5297, 0.7215]}, {"w": "convolutional", "b": [0.5341, 0.7077, 0.6364, 0.7215]}, {"w": "base", "b": [0.6409, 0.7077, 0.6743, 0.7215]}]}, {"id": "b_8", "type": "paragraph", "text": "import os import numpy as np from keras.preprocessing.image import ImageDataGenerator base_dir = '/Users/fchollet/Downloads/cats_and_dogs_small' train_dir = os.path.join(base_dir, 'train') validation_dir = os.path.join(base_dir, 'validation') test_dir = os.path.join(base_dir, 'test') datagen = ImageDataGenerator(rescale=1./255) batch_size = 20", "words": [{"w": "import", "b": [0.1348, 0.7343, 0.1985, 0.7484]}, {"w": "os", "b": [0.2092, 0.7343, 0.2304, 0.7484]}, {"w": "import", "b": [0.1348, 0.7485, 0.1985, 0.7626]}, {"w": "numpy", "b": [0.2092, 0.7485, 0.2623, 0.7626]}, {"w": "as", "b": [0.2729, 0.7485, 0.2942, 0.7626]}, {"w": "np", "b": [0.3048, 0.7485, 0.3261, 0.7626]}, {"w": "from", "b": [0.1348, 0.7626, 0.1773, 0.7768]}, {"w": "keras.preprocessing.image", "b": [0.1879, 0.7626, 0.4536, 0.7768]}, {"w": "import", "b": [0.4642, 0.7626, 0.528, 0.7768]}, {"w": "ImageDataGenerator", "b": [0.5386, 0.7626, 0.7299, 0.7768]}, {"w": "base_dir", "b": [0.1348, 0.791, 0.2198, 0.8052]}, {"w": "=", "b": [0.2304, 0.791, 0.241, 0.8052]}, {"w": "'/Users/fchollet/Downloads/cats_and_dogs_small'", "b": [0.2517, 0.791, 0.7511, 0.8052]}, {"w": "train_dir", "b": [0.1348, 0.8052, 0.2304, 0.8194]}, {"w": "=", "b": [0.241, 0.8052, 0.2517, 0.8194]}, {"w": "os.path.join(base_dir,", "b": [0.2623, 0.8052, 0.4961, 0.8194]}, {"w": "'train')", "b": [0.5067, 0.8052, 0.5917, 0.8194]}, {"w": "validation_dir", "b": [0.1348, 0.8194, 0.2836, 0.8336]}, {"w": "=", "b": [0.2942, 0.8194, 0.3048, 0.8336]}, {"w": "os.path.join(base_dir,", "b": [0.3154, 0.8194, 0.5492, 0.8336]}, {"w": "'validation')", "b": [0.5598, 0.8194, 0.698, 0.8336]}, {"w": "test_dir", "b": [0.1348, 0.8336, 0.2198, 0.8477]}, {"w": "=", "b": [0.2304, 0.8336, 0.241, 0.8477]}, {"w": "os.path.join(base_dir,", "b": [0.2517, 0.8336, 0.4855, 0.8477]}, {"w": "'test')", "b": [0.4961, 0.8336, 0.5705, 0.8477]}, {"w": "datagen", "b": [0.1348, 0.8619, 0.2092, 0.8761]}, {"w": "=", "b": [0.2198, 0.8619, 0.2304, 0.8761]}, {"w": "ImageDataGenerator(rescale=1./255)", "b": [0.241, 0.8619, 0.6024, 0.8761]}, {"w": "batch_size", "b": [0.1348, 0.8761, 0.241, 0.8903]}, {"w": "=", "b": [0.2517, 0.8761, 0.2623, 0.8903]}, {"w": "20", "b": [0.2729, 0.8761, 0.2942, 0.8903]}]}]}, {"page": 203, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "def extract_features(directory, sample_count): features = np.zeros(shape=(sample_count, 4, 4, 512)) labels = np.zeros(shape=(sample_count)) generator = datagen.flow_from_directory( directory, target_size=(150, 150), batch_size=batch_size, class_mode='binary') i = 0 for inputs_batch, labels_batch in generator: features_batch = conv_base.predict(inputs_batch) features[i * batch_size : (i + 1) * batch_size] = features_batch labels[i * batch_size : (i + 1) * batch_size] = labels_batch i += 1 if i * batch_size >= sample_count: break 1 return features, labels train_features, train_labels = extract_features(train_dir, 2000) validation_features, validation_labels = extract_features(validation_dir, 1000) test_features, test_labels = extract_features(test_dir, 1000)", "words": [{"w": "def", "b": [0.1348, 0.0851, 0.1667, 0.0993]}, {"w": "extract_features(directory,", "b": [0.1773, 0.0851, 0.4642, 0.0993]}, {"w": "sample_count):", "b": [0.4748, 0.0851, 0.6236, 0.0993]}, {"w": "features", "b": [0.1773, 0.0993, 0.2623, 0.1135]}, {"w": "=", "b": [0.2729, 0.0993, 0.2836, 0.1135]}, {"w": "np.zeros(shape=(sample_count,", "b": [0.2942, 0.0993, 0.6024, 0.1135]}, {"w": "4,", "b": [0.613, 0.0993, 0.6342, 0.1135]}, {"w": "4,", "b": [0.6449, 0.0993, 0.6661, 0.1135]}, {"w": "512))", "b": [0.6767, 0.0993, 0.7299, 0.1135]}, {"w": "labels", "b": [0.1773, 0.1135, 0.241, 0.1277]}, {"w": "=", "b": [0.2517, 0.1135, 0.2623, 0.1277]}, {"w": "np.zeros(shape=(sample_count))", "b": [0.2729, 0.1135, 0.5917, 0.1277]}, {"w": "generator", "b": [0.1773, 0.1277, 0.2729, 0.1418]}, {"w": "=", "b": [0.2836, 0.1277, 0.2942, 0.1418]}, {"w": "datagen.flow_from_directory(", "b": [0.3048, 0.1277, 0.6024, 0.1418]}, {"w": "directory,", "b": [0.2198, 0.1418, 0.3261, 0.156]}, {"w": "target_size=(150,", "b": [0.2198, 0.156, 0.4004, 0.1702]}, {"w": "150),", "b": [0.4111, 0.156, 0.4642, 0.1702]}, {"w": "batch_size=batch_size,", "b": [0.2198, 0.1702, 0.4536, 0.1844]}, {"w": "class_mode='binary')", "b": [0.2198, 0.1844, 0.4323, 0.1986]}, {"w": "i", "b": [0.1773, 0.1986, 0.1879, 0.2128]}, {"w": "=", "b": [0.1985, 0.1986, 0.2092, 0.2128]}, {"w": "0", "b": [0.2198, 0.1986, 0.2304, 0.2128]}, {"w": "for", "b": [0.1773, 0.2128, 0.2092, 0.227]}, {"w": "inputs_batch,", "b": [0.2198, 0.2128, 0.3579, 0.227]}, {"w": "labels_batch", "b": [0.3686, 0.2128, 0.4961, 0.227]}, {"w": "in", "b": [0.5067, 0.2128, 0.528, 0.227]}, {"w": "generator:", "b": [0.5386, 0.2128, 0.6449, 0.227]}, {"w": "features_batch", "b": [0.2198, 0.227, 0.3686, 0.2411]}, {"w": "=", "b": [0.3792, 0.227, 0.3898, 0.2411]}, {"w": "conv_base.predict(inputs_batch)", "b": [0.4004, 0.227, 0.7299, 0.2411]}, {"w": "features[i", "b": [0.2198, 0.2411, 0.3261, 0.2553]}, {"w": "*", "b": [0.3367, 0.2411, 0.3473, 0.2553]}, {"w": "batch_size", "b": [0.3579, 0.2411, 0.4642, 0.2553]}, {"w": ":", "b": [0.4748, 0.2411, 0.4855, 0.2553]}, {"w": "(i", "b": [0.4961, 0.2411, 0.5173, 0.2553]}, {"w": "+", "b": [0.528, 0.2411, 0.5386, 0.2553]}, {"w": "1)", "b": [0.5492, 0.2411, 0.5705, 0.2553]}, {"w": "*", "b": [0.5811, 0.2411, 0.5917, 0.2553]}, {"w": "batch_size]", "b": [0.6024, 0.2411, 0.7192, 0.2553]}, {"w": "=", "b": [0.7299, 0.2411, 0.7405, 0.2553]}, {"w": "features_batch", "b": [0.1348, 0.2553, 0.2836, 0.2695]}, {"w": "labels[i", "b": [0.2198, 0.2695, 0.3048, 0.2837]}, {"w": "*", "b": [0.3154, 0.2695, 0.3261, 0.2837]}, {"w": "batch_size", "b": [0.3367, 0.2695, 0.443, 0.2837]}, {"w": ":", "b": [0.4536, 0.2695, 0.4642, 0.2837]}, {"w": "(i", "b": [0.4748, 0.2695, 0.4961, 0.2837]}, {"w": "+", "b": [0.5067, 0.2695, 0.5173, 0.2837]}, {"w": "1)", "b": [0.528, 0.2695, 0.5492, 0.2837]}, {"w": "*", "b": [0.5598, 0.2695, 0.5705, 0.2837]}, {"w": "batch_size]", "b": [0.5811, 0.2695, 0.698, 0.2837]}, {"w": "=", "b": [0.7086, 0.2695, 0.7192, 0.2837]}, {"w": "labels_batch", "b": [0.7299, 0.2695, 0.8574, 0.2837]}, {"w": "i", "b": [0.2198, 0.2837, 0.2304, 0.2979]}, {"w": "+=", "b": [0.241, 0.2837, 0.2623, 0.2979]}, {"w": "1", "b": [0.2729, 0.2837, 0.2836, 0.2979]}, {"w": "if", "b": [0.2198, 0.2979, 0.241, 0.3121]}, {"w": "i", "b": [0.2517, 0.2979, 0.2623, 0.3121]}, {"w": "*", "b": [0.2729, 0.2979, 0.2836, 0.3121]}, {"w": "batch_size", "b": [0.2942, 0.2979, 0.4004, 0.3121]}, {"w": ">=", "b": [0.4111, 0.2979, 0.4323, 0.3121]}, {"w": "sample_count:", "b": [0.443, 0.2979, 0.5811, 0.3121]}, {"w": "break", "b": [0.2623, 0.3121, 0.3154, 0.3262]}, {"w": "1", "b": [0.1348, 0.3263, 0.1454, 0.3404]}, {"w": "return", "b": [0.1773, 0.3404, 0.241, 0.3546]}, {"w": "features,", "b": [0.2517, 0.3404, 0.3473, 0.3546]}, {"w": "labels", "b": [0.3579, 0.3404, 0.4217, 0.3546]}, {"w": "train_features,", "b": [0.1348, 0.3688, 0.2942, 0.383]}, {"w": "train_labels", "b": [0.3048, 0.3688, 0.4323, 0.383]}, {"w": "=", "b": [0.443, 0.3688, 0.4536, 0.383]}, {"w": "extract_features(train_dir,", "b": [0.4642, 0.3688, 0.7511, 0.383]}, {"w": "2000)", "b": [0.7618, 0.3688, 0.8149, 0.383]}, {"w": "validation_features,", "b": [0.1348, 0.383, 0.3473, 0.3972]}, {"w": "validation_labels", "b": [0.3579, 0.383, 0.5386, 0.3972]}, {"w": "=", "b": [0.5492, 0.383, 0.5598, 0.3972]}, {"w": "extract_features(validation_dir,", "b": [0.1348, 0.3972, 0.4748, 0.4114]}, {"w": "1000)", "b": [0.4855, 0.3972, 0.5386, 0.4114]}, {"w": "test_features,", "b": [0.1348, 0.4114, 0.2836, 0.4255]}, {"w": "test_labels", "b": [0.2942, 0.4114, 0.4111, 0.4255]}, {"w": "=", "b": [0.4217, 0.4114, 0.4323, 0.4255]}, {"w": "extract_features(test_dir,", "b": [0.443, 0.4114, 0.7192, 0.4255]}, {"w": "1000)", "b": [0.7299, 0.4114, 0.783, 0.4255]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Note that because generators yield data indefinitely in a loop, you must break after every image has been seen once.", "words": [{"w": "1", "b": [0.1761, 0.4428, 0.1879, 0.4613]}, {"w": "Note", "b": [0.1938, 0.4428, 0.241, 0.4613]}, {"w": "that", "b": [0.2469, 0.4428, 0.2876, 0.4613]}, {"w": "because", "b": [0.2935, 0.4428, 0.3722, 0.4613]}, {"w": "generators", "b": [0.3781, 0.4428, 0.4856, 0.4613]}, {"w": "yield", "b": [0.4916, 0.4428, 0.5401, 0.4613]}, {"w": "data", "b": [0.546, 0.4428, 0.5906, 0.4613]}, {"w": "indefinitely", "b": [0.5965, 0.4428, 0.7107, 0.4613]}, {"w": "in", "b": [0.7166, 0.4428, 0.7363, 0.4613]}, {"w": "a", "b": [0.7422, 0.4428, 0.754, 0.4613]}, {"w": "loop,", "b": [0.7599, 0.4428, 0.8091, 0.4613]}, {"w": "you", "b": [0.815, 0.4428, 0.8517, 0.4613]}, {"w": "must", "b": [0.1761, 0.462, 0.226, 0.4805]}, {"w": "break", "b": [0.2319, 0.462, 0.2905, 0.4805]}, {"w": "after", "b": [0.2964, 0.462, 0.3449, 0.4805]}, {"w": "every", "b": [0.3508, 0.462, 0.4059, 0.4805]}, {"w": "image", "b": [0.4118, 0.462, 0.4721, 0.4805]}, {"w": "has", "b": [0.478, 0.462, 0.5121, 0.4805]}, {"w": "been", "b": [0.518, 0.462, 0.5653, 0.4805]}, {"w": "seen", "b": [0.5712, 0.462, 0.6144, 0.4805]}, {"w": "once.", "b": [0.6204, 0.462, 0.6722, 0.4805]}]}, {"id": "b_2", "type": "paragraph", "text": "The extracted features are currently of shape (samples, 4, 4, 512). You’ll feed them to a densely connected classifier, so first you must flatten them to (samples, 8192):", "words": [{"w": "The", "b": [0.1289, 0.502, 0.1656, 0.5205]}, {"w": "extracted", "b": [0.1715, 0.502, 0.258, 0.5205]}, {"w": "features", "b": [0.264, 0.502, 0.3387, 0.5205]}, {"w": "are", "b": [0.3446, 0.502, 0.3734, 0.5205]}, {"w": "currently", "b": [0.3793, 0.502, 0.4646, 0.5205]}, {"w": "of", "b": [0.4705, 0.502, 0.4902, 0.5205]}, {"w": "shape", "b": [0.4961, 0.502, 0.5498, 0.5205]}, {"w": "(samples,", "b": [0.5557, 0.503, 0.6832, 0.5219]}, {"w": "4,", "b": [0.6973, 0.503, 0.7257, 0.5219]}, {"w": "4,", "b": [0.7399, 0.503, 0.7682, 0.5219]}, {"w": "512).", "b": [0.7824, 0.502, 0.845, 0.5219]}, {"w": "You’ll", "b": [0.1289, 0.5221, 0.1882, 0.5405]}, {"w": "feed", "b": [0.1941, 0.5221, 0.2347, 0.5405]}, {"w": "them", "b": [0.2406, 0.5221, 0.2879, 0.5405]}, {"w": "to", "b": [0.2938, 0.5221, 0.3121, 0.5405]}, {"w": "a", "b": [0.318, 0.5221, 0.3285, 0.5405]}, {"w": "densely", "b": [0.3344, 0.5221, 0.4066, 0.5405]}, {"w": "connected", "b": [0.4125, 0.5221, 0.5082, 0.5405]}, {"w": "classifier,", "b": [0.5141, 0.5221, 0.6042, 0.5405]}, {"w": "so", "b": [0.6101, 0.5221, 0.6311, 0.5405]}, {"w": "first", "b": [0.637, 0.5221, 0.6751, 0.5405]}, {"w": "you", "b": [0.681, 0.5221, 0.7164, 0.5405]}, {"w": "must", "b": [0.7223, 0.5221, 0.7682, 0.5405]}, {"w": "flatten", "b": [0.7741, 0.5221, 0.8345, 0.5405]}, {"w": "them", "b": [0.1289, 0.5412, 0.1761, 0.5597]}, {"w": "to", "b": [0.182, 0.5412, 0.2004, 0.5597]}, {"w": "(samples,", "b": [0.2063, 0.5422, 0.3338, 0.5611]}, {"w": "8192):", "b": [0.348, 0.5412, 0.4254, 0.5611]}]}, {"id": "b_3", "type": "paragraph", "text": "train_features = np.reshape(train_features, (2000, 4 * 4 * 512)) validation_features = np.reshape(validation_features, (1000, 4 * 4 * 512)) test_features = np.reshape(test_features, (1000, 4 * 4 * 512))", "words": [{"w": "train_features", "b": [0.1348, 0.5774, 0.2836, 0.5916]}, {"w": "=", "b": [0.2942, 0.5774, 0.3048, 0.5916]}, {"w": "np.reshape(train_features,", "b": [0.3154, 0.5774, 0.5917, 0.5916]}, {"w": "(2000,", "b": [0.6024, 0.5774, 0.6661, 0.5916]}, {"w": "4", "b": [0.6767, 0.5774, 0.6874, 0.5916]}, {"w": "*", "b": [0.698, 0.5774, 0.7086, 0.5916]}, {"w": "4", "b": [0.7192, 0.5774, 0.7299, 0.5916]}, {"w": "*", "b": [0.7405, 0.5774, 0.7511, 0.5916]}, {"w": "512))", "b": [0.7618, 0.5774, 0.8149, 0.5916]}, {"w": "validation_features", "b": [0.1348, 0.5916, 0.3367, 0.6058]}, {"w": "=", "b": [0.3473, 0.5916, 0.3579, 0.6058]}, {"w": "np.reshape(validation_features,", "b": [0.3686, 0.5916, 0.698, 0.6058]}, {"w": "(1000,", "b": [0.7086, 0.5916, 0.7724, 0.6058]}, {"w": "4", "b": [0.783, 0.5916, 0.7936, 0.6058]}, {"w": "*", "b": [0.8043, 0.5916, 0.8149, 0.6058]}, {"w": "4", "b": [0.8255, 0.5916, 0.8361, 0.6058]}, {"w": "*", "b": [0.8468, 0.5916, 0.8574, 0.6058]}, {"w": "512))", "b": [0.1348, 0.6058, 0.1879, 0.6199]}, {"w": "test_features", "b": [0.1348, 0.62, 0.2729, 0.6341]}, {"w": "=", "b": [0.2836, 0.62, 0.2942, 0.6341]}, {"w": "np.reshape(test_features,", "b": [0.3048, 0.62, 0.5705, 0.6341]}, {"w": "(1000,", "b": [0.5811, 0.62, 0.6449, 0.6341]}, {"w": "4", "b": [0.6555, 0.62, 0.6661, 0.6341]}, {"w": "*", "b": [0.6767, 0.62, 0.6874, 0.6341]}, {"w": "4", "b": [0.698, 0.62, 0.7086, 0.6341]}, {"w": "*", "b": [0.7192, 0.62, 0.7299, 0.6341]}, {"w": "512))", "b": [0.7405, 0.62, 0.7936, 0.6341]}]}, {"id": "b_4", "type": "paragraph", "text": "At this point, you can define your densely connected classifier (note the use of dropout for regularization) and train it on the data and labels that you just recorded.", "words": [{"w": "At", "b": [0.1289, 0.6556, 0.1525, 0.674]}, {"w": "this", "b": [0.1584, 0.6556, 0.1925, 0.674]}, {"w": "point,", "b": [0.1984, 0.6556, 0.2529, 0.674]}, {"w": "you", "b": [0.2588, 0.6556, 0.2942, 0.674]}, {"w": "can", "b": [0.3001, 0.6556, 0.3329, 0.674]}, {"w": "define", "b": [0.3388, 0.6556, 0.3978, 0.674]}, {"w": "your", "b": [0.4037, 0.6556, 0.447, 0.674]}, {"w": "densely", "b": [0.4529, 0.6556, 0.525, 0.674]}, {"w": "connected", "b": [0.5309, 0.6556, 0.6267, 0.674]}, {"w": "classifier", "b": [0.6326, 0.6556, 0.7178, 0.674]}, {"w": "(note", "b": [0.7237, 0.6556, 0.7723, 0.674]}, {"w": "the", "b": [0.7782, 0.6556, 0.807, 0.674]}, {"w": "use", "b": [0.8129, 0.6556, 0.8444, 0.674]}, {"w": "of", "b": [0.8503, 0.6556, 0.87, 0.674]}, {"w": "dropout", "b": [0.1289, 0.6747, 0.2023, 0.6932]}, {"w": "for", "b": [0.2082, 0.6747, 0.2358, 0.6932]}, {"w": "regularization)", "b": [0.2417, 0.6747, 0.3807, 0.6932]}, {"w": "and", "b": [0.3866, 0.6747, 0.4207, 0.6932]}, {"w": "train", "b": [0.4266, 0.6747, 0.4699, 0.6932]}, {"w": "it", "b": [0.4758, 0.6747, 0.4889, 0.6932]}, {"w": "on", "b": [0.4948, 0.6747, 0.5184, 0.6932]}, {"w": "the", "b": [0.5243, 0.6747, 0.5532, 0.6932]}, {"w": "data", "b": [0.5591, 0.6747, 0.5984, 0.6932]}, {"w": "and", "b": [0.6043, 0.6747, 0.6384, 0.6932]}, {"w": "labels", "b": [0.6443, 0.6747, 0.6994, 0.6932]}, {"w": "that", "b": [0.7053, 0.6747, 0.7407, 0.6932]}, {"w": "you", "b": [0.7466, 0.6747, 0.782, 0.6932]}, {"w": "just", "b": [0.788, 0.6747, 0.8221, 0.6932]}, {"w": "recorded.", "b": [0.1289, 0.6939, 0.2174, 0.7124]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.18. Defining and training the densely connected classifier", "words": [{"w": "Listing", "b": [0.1289, 0.7294, 0.182, 0.7432]}, {"w": "5.18.", "b": [0.1865, 0.7294, 0.2219, 0.7432]}, {"w": "Defining", "b": [0.2263, 0.7294, 0.2912, 0.7432]}, {"w": "and", "b": [0.2957, 0.7294, 0.3242, 0.7432]}, {"w": "training", "b": [0.3286, 0.7294, 0.3897, 0.7432]}, {"w": "the", "b": [0.3941, 0.7294, 0.4177, 0.7432]}, {"w": "densely", "b": [0.4221, 0.7294, 0.4782, 0.7432]}, {"w": "connected", "b": [0.4826, 0.7294, 0.5584, 0.7432]}, {"w": "classifier", "b": [0.5628, 0.7294, 0.6297, 0.7432]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras import models from keras import layers from keras import optimizers model = models.Sequential() model.add(layers.Dense(256, activation='relu', input_dim=4 * 4 * 512)) model.add(layers.Dropout(0.5)) model.add(layers.Dense(1, activation='sigmoid')) model.compile(optimizer=optimizers.RMSprop(lr=2e-5),", "words": [{"w": "from", "b": [0.1348, 0.756, 0.1773, 0.7701]}, {"w": "keras", "b": [0.1879, 0.756, 0.241, 0.7701]}, {"w": "import", "b": [0.2517, 0.756, 0.3154, 0.7701]}, {"w": "models", "b": [0.3261, 0.756, 0.3898, 0.7701]}, {"w": "from", "b": [0.1348, 0.7701, 0.1773, 0.7843]}, {"w": "keras", "b": [0.1879, 0.7701, 0.241, 0.7843]}, {"w": "import", "b": [0.2517, 0.7701, 0.3154, 0.7843]}, {"w": "layers", "b": [0.3261, 0.7701, 0.3898, 0.7843]}, {"w": "from", "b": [0.1348, 0.7843, 0.1773, 0.7985]}, {"w": "keras", "b": [0.1879, 0.7843, 0.241, 0.7985]}, {"w": "import", "b": [0.2517, 0.7843, 0.3154, 0.7985]}, {"w": "optimizers", "b": [0.3261, 0.7843, 0.4323, 0.7985]}, {"w": "model", "b": [0.1348, 0.8127, 0.1879, 0.8269]}, {"w": "=", "b": [0.1985, 0.8127, 0.2092, 0.8269]}, {"w": "models.Sequential()", "b": [0.2198, 0.8127, 0.4217, 0.8269]}, {"w": "model.add(layers.Dense(256,", "b": [0.1348, 0.8269, 0.4217, 0.8411]}, {"w": "activation='relu',", "b": [0.4323, 0.8269, 0.6236, 0.8411]}, {"w": "input_dim=4", "b": [0.6342, 0.8269, 0.7511, 0.8411]}, {"w": "*", "b": [0.7618, 0.8269, 0.7724, 0.8411]}, {"w": "4", "b": [0.783, 0.8269, 0.7936, 0.8411]}, {"w": "*", "b": [0.8043, 0.8269, 0.8149, 0.8411]}, {"w": "512))", "b": [0.1348, 0.8411, 0.1879, 0.8552]}, {"w": "model.add(layers.Dropout(0.5))", "b": [0.1348, 0.8553, 0.4536, 0.8694]}, {"w": "model.add(layers.Dense(1,", "b": [0.1348, 0.8694, 0.4004, 0.8836]}, {"w": "activation='sigmoid'))", "b": [0.4111, 0.8694, 0.6449, 0.8836]}, {"w": "model.compile(optimizer=optimizers.RMSprop(lr=2e-5),", "b": [0.1348, 0.8978, 0.6874, 0.912]}]}]}, {"page": 204, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "loss='binary_crossentropy', metrics=['acc']) history = model.fit(train_features, train_labels, epochs=30, batch_size=20, validation_data=(validation_features, validation_labels))", "words": [{"w": "loss='binary_crossentropy',", "b": [0.2836, 0.0851, 0.5705, 0.0993]}, {"w": "metrics=['acc'])", "b": [0.2836, 0.0993, 0.4536, 0.1135]}, {"w": "history", "b": [0.1348, 0.1277, 0.2092, 0.1418]}, {"w": "=", "b": [0.2198, 0.1277, 0.2304, 0.1418]}, {"w": "model.fit(train_features,", "b": [0.241, 0.1277, 0.5067, 0.1418]}, {"w": "train_labels,", "b": [0.5173, 0.1277, 0.6555, 0.1418]}, {"w": "epochs=30,", "b": [0.3473, 0.1419, 0.4536, 0.156]}, {"w": "batch_size=20,", "b": [0.3473, 0.156, 0.4961, 0.1702]}, {"w": "validation_data=(validation_features,", "b": [0.3473, 0.1702, 0.7405, 0.1844]}, {"w": "validation_labels))", "b": [0.1348, 0.1844, 0.3367, 0.1986]}]}, {"id": "b_1", "type": "paragraph", "text": "Training is very fast, because you only have to deal with two Dense layers— an epoch takes less than one second even on CPU.", "words": [{"w": "Training", "b": [0.1289, 0.22, 0.2094, 0.2385]}, {"w": "is", "b": [0.2153, 0.22, 0.231, 0.2385]}, {"w": "very", "b": [0.2369, 0.22, 0.2789, 0.2385]}, {"w": "fast,", "b": [0.2848, 0.22, 0.3248, 0.2385]}, {"w": "because", "b": [0.3307, 0.22, 0.4054, 0.2385]}, {"w": "you", "b": [0.4113, 0.22, 0.4468, 0.2385]}, {"w": "only", "b": [0.4527, 0.22, 0.4947, 0.2385]}, {"w": "have", "b": [0.5006, 0.22, 0.5451, 0.2385]}, {"w": "to", "b": [0.5511, 0.22, 0.5694, 0.2385]}, {"w": "deal", "b": [0.5753, 0.22, 0.6147, 0.2385]}, {"w": "with", "b": [0.6206, 0.22, 0.6626, 0.2385]}, {"w": "two", "b": [0.6685, 0.22, 0.7039, 0.2385]}, {"w": "Dense", "b": [0.7097, 0.221, 0.7806, 0.2399]}, {"w": "layers—", "b": [0.7865, 0.22, 0.8665, 0.2385]}, {"w": "an", "b": [0.1289, 0.24, 0.1512, 0.2585]}, {"w": "epoch", "b": [0.1571, 0.24, 0.2135, 0.2585]}, {"w": "takes", "b": [0.2194, 0.24, 0.2679, 0.2585]}, {"w": "less", "b": [0.2738, 0.24, 0.3092, 0.2585]}, {"w": "than", "b": [0.3151, 0.24, 0.3558, 0.2585]}, {"w": "one", "b": [0.3617, 0.24, 0.3958, 0.2585]}, {"w": "second", "b": [0.4017, 0.24, 0.4673, 0.2585]}, {"w": "even", "b": [0.4732, 0.24, 0.5178, 0.2585]}, {"w": "on", "b": [0.5237, 0.24, 0.5473, 0.2585]}, {"w": "CPU.", "b": [0.5532, 0.24, 0.605, 0.2585]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s look at the loss and accuracy curves during training (see figures 5.15 and 5.16).", "words": [{"w": "Let’s", "b": [0.1289, 0.2801, 0.1761, 0.2986]}, {"w": "look", "b": [0.182, 0.2801, 0.224, 0.2986]}, {"w": "at", "b": [0.2299, 0.2801, 0.2469, 0.2986]}, {"w": "the", "b": [0.2528, 0.2801, 0.2817, 0.2986]}, {"w": "loss", "b": [0.2876, 0.2801, 0.3243, 0.2986]}, {"w": "and", "b": [0.3302, 0.2801, 0.3643, 0.2986]}, {"w": "accuracy", "b": [0.3703, 0.2801, 0.4542, 0.2986]}, {"w": "curves", "b": [0.4601, 0.2801, 0.5217, 0.2986]}, {"w": "during", "b": [0.5276, 0.2801, 0.5893, 0.2986]}, {"w": "training", "b": [0.5952, 0.2801, 0.6686, 0.2986]}, {"w": "(see", "b": [0.6745, 0.2801, 0.7125, 0.2986]}, {"w": "figures", "b": [0.7184, 0.2801, 0.784, 0.2986]}, {"w": "5.15", "b": [0.7899, 0.2801, 0.8312, 0.2986]}, {"w": "and", "b": [0.8371, 0.2801, 0.8712, 0.2986]}, {"w": "5.16).", "b": [0.1289, 0.2993, 0.184, 0.3178]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 5.15. Training and validation accuracy for simple feature extraction", "words": [{"w": "Figure", "b": [0.1289, 0.3347, 0.1787, 0.3486]}, {"w": "5.15.", "b": [0.1832, 0.3347, 0.2186, 0.3486]}, {"w": "Training", "b": [0.223, 0.3347, 0.2886, 0.3486]}, {"w": "and", "b": [0.293, 0.3347, 0.3216, 0.3486]}, {"w": "validation", "b": [0.326, 0.3347, 0.4018, 0.3486]}, {"w": "accuracy", "b": [0.4062, 0.3347, 0.4741, 0.3486]}, {"w": "for", "b": [0.4785, 0.3347, 0.5011, 0.3486]}, {"w": "simple", "b": [0.5056, 0.3347, 0.5548, 0.3486]}, {"w": "feature", "b": [0.5592, 0.3347, 0.6129, 0.3486]}, {"w": "extraction", "b": [0.6174, 0.3347, 0.6941, 0.3486]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 5.16. Training and validation loss for simple feature extraction", "words": [{"w": "Figure", "b": [0.1289, 0.6159, 0.1787, 0.6297]}, {"w": "5.16.", "b": [0.1832, 0.6159, 0.2186, 0.6297]}, {"w": "Training", "b": [0.223, 0.6159, 0.2886, 0.6297]}, {"w": "and", "b": [0.293, 0.6159, 0.3216, 0.6297]}, {"w": "validation", "b": [0.326, 0.6159, 0.4018, 0.6297]}, {"w": "loss", "b": [0.4062, 0.6159, 0.4338, 0.6297]}, {"w": "for", "b": [0.4382, 0.6159, 0.4608, 0.6297]}, {"w": "simple", "b": [0.4653, 0.6159, 0.5145, 0.6297]}, {"w": "feature", "b": [0.5189, 0.6159, 0.5726, 0.6297]}, {"w": "extraction", "b": [0.5771, 0.6159, 0.6538, 0.6297]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.19. Plotting the results", "words": [{"w": "Listing", "b": [0.1289, 0.8971, 0.182, 0.9109]}, {"w": "5.19.", "b": [0.1865, 0.8971, 0.2219, 0.9109]}, {"w": "Plotting", "b": [0.2263, 0.8971, 0.2863, 0.9109]}, {"w": "the", "b": [0.2907, 0.8971, 0.3143, 0.9109]}, {"w": "results", "b": [0.3188, 0.8971, 0.3686, 0.9109]}]}]}, {"page": 205, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "import matplotlib.pyplot as plt acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(1, len(acc) + 1) plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()", "words": [{"w": "import", "b": [0.1348, 0.0851, 0.1985, 0.0993]}, {"w": "matplotlib.pyplot", "b": [0.2092, 0.0851, 0.3898, 0.0993]}, {"w": "as", "b": [0.4004, 0.0851, 0.4217, 0.0993]}, {"w": "plt", "b": [0.4323, 0.0851, 0.4642, 0.0993]}, {"w": "acc", "b": [0.1348, 0.1135, 0.1667, 0.1277]}, {"w": "=", "b": [0.1773, 0.1135, 0.1879, 0.1277]}, {"w": "history.history['acc']", "b": [0.1985, 0.1135, 0.4323, 0.1277]}, {"w": "val_acc", "b": [0.1348, 0.1277, 0.2092, 0.1418]}, {"w": "=", "b": [0.2198, 0.1277, 0.2304, 0.1418]}, {"w": "history.history['val_acc']", "b": [0.241, 0.1277, 0.5173, 0.1418]}, {"w": "loss", "b": [0.1348, 0.1419, 0.1773, 0.156]}, {"w": "=", "b": [0.1879, 0.1419, 0.1985, 0.156]}, {"w": "history.history['loss']", "b": [0.2092, 0.1419, 0.4536, 0.156]}, {"w": "val_loss", "b": [0.1348, 0.156, 0.2198, 0.1702]}, {"w": "=", "b": [0.2304, 0.156, 0.241, 0.1702]}, {"w": "history.history['val_loss']", "b": [0.2517, 0.156, 0.5386, 0.1702]}, {"w": "epochs", "b": [0.1348, 0.1844, 0.1985, 0.1986]}, {"w": "=", "b": [0.2092, 0.1844, 0.2198, 0.1986]}, {"w": "range(1,", "b": [0.2304, 0.1844, 0.3154, 0.1986]}, {"w": "len(acc)", "b": [0.3261, 0.1844, 0.4111, 0.1986]}, {"w": "+", "b": [0.4217, 0.1844, 0.4323, 0.1986]}, {"w": "1)", "b": [0.443, 0.1844, 0.4642, 0.1986]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.2128, 0.3048, 0.227]}, {"w": "acc,", "b": [0.3154, 0.2128, 0.3579, 0.227]}, {"w": "'bo',", "b": [0.3686, 0.2128, 0.4217, 0.227]}, {"w": "label='Training", "b": [0.4323, 0.2128, 0.5917, 0.227]}, {"w": "acc')", "b": [0.6024, 0.2128, 0.6555, 0.227]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.227, 0.3048, 0.2411]}, {"w": "val_acc,", "b": [0.3154, 0.227, 0.4004, 0.2411]}, {"w": "'b',", "b": [0.4111, 0.227, 0.4536, 0.2411]}, {"w": "label='Validation", "b": [0.4642, 0.227, 0.6449, 0.2411]}, {"w": "acc')", "b": [0.6555, 0.227, 0.7086, 0.2411]}, {"w": "plt.title('Training", "b": [0.1348, 0.2411, 0.3367, 0.2553]}, {"w": "and", "b": [0.3473, 0.2411, 0.3792, 0.2553]}, {"w": "validation", "b": [0.3898, 0.2411, 0.4961, 0.2553]}, {"w": "accuracy')", "b": [0.5067, 0.2411, 0.613, 0.2553]}, {"w": "plt.legend()", "b": [0.1348, 0.2553, 0.2623, 0.2695]}, {"w": "plt.figure()", "b": [0.1348, 0.2837, 0.2623, 0.2979]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.3121, 0.3048, 0.3262]}, {"w": "loss,", "b": [0.3154, 0.3121, 0.3686, 0.3262]}, {"w": "'bo',", "b": [0.3792, 0.3121, 0.4323, 0.3262]}, {"w": "label='Training", "b": [0.443, 0.3121, 0.6024, 0.3262]}, {"w": "loss')", "b": [0.613, 0.3121, 0.6767, 0.3262]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.3263, 0.3048, 0.3404]}, {"w": "val_loss,", "b": [0.3154, 0.3263, 0.4111, 0.3404]}, {"w": "'b',", "b": [0.4217, 0.3263, 0.4642, 0.3404]}, {"w": "label='Validation", "b": [0.4748, 0.3263, 0.6555, 0.3404]}, {"w": "loss')", "b": [0.6661, 0.3263, 0.7299, 0.3404]}, {"w": "plt.title('Training", "b": [0.1348, 0.3404, 0.3367, 0.3546]}, {"w": "and", "b": [0.3473, 0.3404, 0.3792, 0.3546]}, {"w": "validation", "b": [0.3898, 0.3404, 0.4961, 0.3546]}, {"w": "loss')", "b": [0.5067, 0.3404, 0.5705, 0.3546]}, {"w": "plt.legend()", "b": [0.1348, 0.3546, 0.2623, 0.3688]}, {"w": "plt.show()", "b": [0.1348, 0.383, 0.241, 0.3972]}]}, {"id": "b_1", "type": "paragraph", "text": "You reach a validation accuracy of about 90%—much better than you achieved in the previous section with the small model trained from scratch. But the plots also indicate that you’re overfitting almost from the start— despite using dropout with a fairly large rate. That’s because this technique doesn’t use data augmentation, which is essential for preventing overfitting with small image datasets.", "words": [{"w": "You", "b": [0.1289, 0.4186, 0.1672, 0.4371]}, {"w": "reach", "b": [0.1731, 0.4186, 0.2242, 0.4371]}, {"w": "a", "b": [0.2301, 0.4186, 0.2406, 0.4371]}, {"w": "validation", "b": [0.2465, 0.4186, 0.341, 0.4371]}, {"w": "accuracy", "b": [0.3469, 0.4186, 0.4308, 0.4371]}, {"w": "of", "b": [0.4367, 0.4186, 0.4563, 0.4371]}, {"w": "about", "b": [0.4622, 0.4186, 0.5147, 0.4371]}, {"w": "90%—much", "b": [0.5206, 0.4186, 0.64, 0.4371]}, {"w": "better", "b": [0.6459, 0.4186, 0.6997, 0.4371]}, {"w": "than", "b": [0.7056, 0.4186, 0.7462, 0.4371]}, {"w": "you", "b": [0.7521, 0.4186, 0.7876, 0.4371]}, {"w": "achieved", "b": [0.1289, 0.4378, 0.2128, 0.4563]}, {"w": "in", "b": [0.2187, 0.4378, 0.2371, 0.4563]}, {"w": "the", "b": [0.243, 0.4378, 0.2718, 0.4563]}, {"w": "previous", "b": [0.2777, 0.4378, 0.3591, 0.4563]}, {"w": "section", "b": [0.365, 0.4378, 0.4319, 0.4563]}, {"w": "with", "b": [0.4378, 0.4378, 0.4798, 0.4563]}, {"w": "the", "b": [0.4857, 0.4378, 0.5145, 0.4563]}, {"w": "small", "b": [0.5204, 0.4378, 0.5716, 0.4563]}, {"w": "model", "b": [0.5775, 0.4378, 0.6365, 0.4563]}, {"w": "trained", "b": [0.6424, 0.4378, 0.708, 0.4563]}, {"w": "from", "b": [0.7138, 0.4378, 0.7597, 0.4563]}, {"w": "scratch.", "b": [0.7656, 0.4378, 0.8384, 0.4563]}, {"w": "But", "b": [0.1289, 0.457, 0.163, 0.4755]}, {"w": "the", "b": [0.1689, 0.457, 0.1978, 0.4755]}, {"w": "plots", "b": [0.2037, 0.457, 0.2496, 0.4755]}, {"w": "also", "b": [0.2555, 0.457, 0.2935, 0.4755]}, {"w": "indicate", "b": [0.2994, 0.457, 0.3742, 0.4755]}, {"w": "that", "b": [0.3801, 0.457, 0.4155, 0.4755]}, {"w": "you’re", "b": [0.4214, 0.457, 0.4831, 0.4755]}, {"w": "overfitting", "b": [0.489, 0.457, 0.5887, 0.4755]}, {"w": "almost", "b": [0.5946, 0.457, 0.6576, 0.4755]}, {"w": "from", "b": [0.6635, 0.457, 0.7094, 0.4755]}, {"w": "the", "b": [0.7153, 0.457, 0.7441, 0.4755]}, {"w": "start—", "b": [0.75, 0.457, 0.8143, 0.4755]}, {"w": "despite", "b": [0.1289, 0.4762, 0.1958, 0.4946]}, {"w": "using", "b": [0.2017, 0.4762, 0.2529, 0.4946]}, {"w": "dropout", "b": [0.2588, 0.4762, 0.3322, 0.4946]}, {"w": "with", "b": [0.3381, 0.4762, 0.3801, 0.4946]}, {"w": "a", "b": [0.386, 0.4762, 0.3965, 0.4946]}, {"w": "fairly", "b": [0.4024, 0.4762, 0.4536, 0.4946]}, {"w": "large", "b": [0.4594, 0.4762, 0.5062, 0.4946]}, {"w": "rate.", "b": [0.5121, 0.4762, 0.5534, 0.4946]}, {"w": "That’s", "b": [0.5593, 0.4762, 0.6183, 0.4946]}, {"w": "because", "b": [0.6242, 0.4762, 0.6989, 0.4946]}, {"w": "this", "b": [0.7048, 0.4762, 0.739, 0.4946]}, {"w": "technique", "b": [0.7449, 0.4762, 0.8367, 0.4946]}, {"w": "doesn’t", "b": [0.1289, 0.4954, 0.198, 0.5138]}, {"w": "use", "b": [0.2039, 0.4954, 0.2354, 0.5138]}, {"w": "data", "b": [0.2413, 0.4954, 0.2806, 0.5138]}, {"w": "augmentation,", "b": [0.2865, 0.4954, 0.421, 0.5138]}, {"w": "which", "b": [0.4269, 0.4954, 0.4846, 0.5138]}, {"w": "is", "b": [0.4905, 0.4954, 0.5062, 0.5138]}, {"w": "essential", "b": [0.5121, 0.4954, 0.5935, 0.5138]}, {"w": "for", "b": [0.5994, 0.4954, 0.6269, 0.5138]}, {"w": "preventing", "b": [0.6328, 0.4954, 0.7338, 0.5138]}, {"w": "overfitting", "b": [0.7397, 0.4954, 0.8394, 0.5138]}, {"w": "with", "b": [0.1289, 0.5145, 0.1709, 0.533]}, {"w": "small", "b": [0.1768, 0.5145, 0.2279, 0.533]}, {"w": "image", "b": [0.2338, 0.5145, 0.2915, 0.533]}, {"w": "datasets.", "b": [0.2974, 0.5145, 0.3781, 0.533]}]}, {"id": "b_2", "type": "paragraph", "text": "Feature extraction with data augmentation", "words": [{"w": "Feature", "b": [0.1289, 0.55, 0.1876, 0.5638]}, {"w": "extraction", "b": [0.192, 0.55, 0.2687, 0.5638]}, {"w": "with", "b": [0.2731, 0.55, 0.3066, 0.5638]}, {"w": "data", "b": [0.311, 0.55, 0.3445, 0.5638]}, {"w": "augmentation", "b": [0.3489, 0.55, 0.4532, 0.5638]}]}, {"id": "b_3", "type": "paragraph", "text": "Now, let’s review the second technique I mentioned for doing feature extraction, which is much slower and more expensive, but which allows you to use data augmentation during training: extending the conv_base model and running it end to end on the inputs.", "words": [{"w": "Now,", "b": [0.1289, 0.5855, 0.1792, 0.6039]}, {"w": "let’s", "b": [0.1851, 0.5855, 0.2244, 0.6039]}, {"w": "review", "b": [0.2303, 0.5855, 0.2946, 0.6039]}, {"w": "the", "b": [0.3005, 0.5855, 0.3293, 0.6039]}, {"w": "second", "b": [0.3352, 0.5855, 0.4008, 0.6039]}, {"w": "technique", "b": [0.4067, 0.5855, 0.4985, 0.6039]}, {"w": "I", "b": [0.5044, 0.5855, 0.5123, 0.6039]}, {"w": "mentioned", "b": [0.5182, 0.5855, 0.6179, 0.6039]}, {"w": "for", "b": [0.6238, 0.5855, 0.6513, 0.6039]}, {"w": "doing", "b": [0.6573, 0.5855, 0.711, 0.6039]}, {"w": "feature", "b": [0.7169, 0.5855, 0.7825, 0.6039]}, {"w": "extraction,", "b": [0.1289, 0.6047, 0.2292, 0.6231]}, {"w": "which", "b": [0.2351, 0.6047, 0.2928, 0.6231]}, {"w": "is", "b": [0.2987, 0.6047, 0.3145, 0.6231]}, {"w": "much", "b": [0.3204, 0.6047, 0.3729, 0.6231]}, {"w": "slower", "b": [0.3788, 0.6047, 0.4417, 0.6231]}, {"w": "and", "b": [0.4476, 0.6047, 0.4817, 0.6231]}, {"w": "more", "b": [0.4876, 0.6047, 0.5362, 0.6231]}, {"w": "expensive,", "b": [0.5421, 0.6047, 0.6424, 0.6231]}, {"w": "but", "b": [0.6482, 0.6047, 0.6784, 0.6231]}, {"w": "which", "b": [0.6843, 0.6047, 0.742, 0.6231]}, {"w": "allows", "b": [0.7479, 0.6047, 0.8096, 0.6231]}, {"w": "you", "b": [0.8155, 0.6047, 0.8509, 0.6231]}, {"w": "to", "b": [0.1289, 0.6239, 0.1472, 0.6423]}, {"w": "use", "b": [0.1532, 0.6239, 0.1846, 0.6423]}, {"w": "data", "b": [0.1905, 0.6239, 0.2299, 0.6423]}, {"w": "augmentation", "b": [0.2358, 0.6239, 0.3643, 0.6423]}, {"w": "during", "b": [0.3702, 0.6239, 0.4319, 0.6423]}, {"w": "training:", "b": [0.4378, 0.6239, 0.5178, 0.6423]}, {"w": "extending", "b": [0.5237, 0.6239, 0.6169, 0.6423]}, {"w": "the", "b": [0.6228, 0.6239, 0.6516, 0.6423]}, {"w": "conv_base", "b": [0.6574, 0.6248, 0.785, 0.6437]}, {"w": "model", "b": [0.7909, 0.6239, 0.8499, 0.6423]}, {"w": "and", "b": [0.1289, 0.6439, 0.163, 0.6624]}, {"w": "running", "b": [0.1689, 0.6439, 0.2423, 0.6624]}, {"w": "it", "b": [0.2482, 0.6439, 0.2614, 0.6624]}, {"w": "end", "b": [0.2673, 0.6439, 0.3014, 0.6624]}, {"w": "to", "b": [0.3073, 0.6439, 0.3257, 0.6624]}, {"w": "end", "b": [0.3316, 0.6439, 0.3657, 0.6624]}, {"w": "on", "b": [0.3716, 0.6439, 0.3952, 0.6624]}, {"w": "the", "b": [0.4011, 0.6439, 0.4299, 0.6624]}, {"w": "inputs.", "b": [0.4358, 0.6439, 0.4995, 0.6624]}]}, {"id": "b_4", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1289, 0.6893, 0.1643, 0.7032]}]}, {"id": "b_5", "type": "paragraph", "text": "This technique is so expensive that you should only attempt it if you have access to a GPU—it’s absolutely intractable on CPU. If you can’t run your code on GPU, then the previous technique is the way to go.", "words": [{"w": "This", "b": [0.1289, 0.7206, 0.1709, 0.7391]}, {"w": "technique", "b": [0.1768, 0.7206, 0.2686, 0.7391]}, {"w": "is", "b": [0.2745, 0.7206, 0.2902, 0.7391]}, {"w": "so", "b": [0.2961, 0.7206, 0.3171, 0.7391]}, {"w": "expensive", "b": [0.323, 0.7206, 0.4175, 0.7391]}, {"w": "that", "b": [0.4234, 0.7206, 0.4588, 0.7391]}, {"w": "you", "b": [0.4647, 0.7206, 0.5001, 0.7391]}, {"w": "should", "b": [0.506, 0.7206, 0.569, 0.7391]}, {"w": "only", "b": [0.5749, 0.7206, 0.6169, 0.7391]}, {"w": "attempt", "b": [0.6228, 0.7206, 0.6936, 0.7391]}, {"w": "it", "b": [0.6996, 0.7206, 0.7127, 0.7391]}, {"w": "if", "b": [0.7186, 0.7206, 0.733, 0.7391]}, {"w": "you", "b": [0.7389, 0.7206, 0.7743, 0.7391]}, {"w": "have", "b": [0.7802, 0.7206, 0.8248, 0.7391]}, {"w": "access", "b": [0.1289, 0.7398, 0.1892, 0.7583]}, {"w": "to", "b": [0.1951, 0.7398, 0.2135, 0.7583]}, {"w": "a", "b": [0.2194, 0.7398, 0.2299, 0.7583]}, {"w": "GPU—it’s", "b": [0.2358, 0.7398, 0.3355, 0.7583]}, {"w": "absolutely", "b": [0.3414, 0.7398, 0.4385, 0.7583]}, {"w": "intractable", "b": [0.4444, 0.7398, 0.544, 0.7583]}, {"w": "on", "b": [0.5499, 0.7398, 0.5736, 0.7583]}, {"w": "CPU.", "b": [0.5794, 0.7398, 0.6312, 0.7583]}, {"w": "If", "b": [0.6371, 0.7398, 0.6529, 0.7583]}, {"w": "you", "b": [0.6588, 0.7398, 0.6942, 0.7583]}, {"w": "can’t", "b": [0.7001, 0.7398, 0.7469, 0.7583]}, {"w": "run", "b": [0.7528, 0.7398, 0.7843, 0.7583]}, {"w": "your", "b": [0.7902, 0.7398, 0.8334, 0.7583]}, {"w": "code", "b": [0.1289, 0.759, 0.1735, 0.7775]}, {"w": "on", "b": [0.1794, 0.759, 0.203, 0.7775]}, {"w": "GPU,", "b": [0.2089, 0.759, 0.262, 0.7775]}, {"w": "then", "b": [0.2679, 0.759, 0.3086, 0.7775]}, {"w": "the", "b": [0.3145, 0.759, 0.3433, 0.7775]}, {"w": "previous", "b": [0.3492, 0.759, 0.4306, 0.7775]}, {"w": "technique", "b": [0.4365, 0.759, 0.5283, 0.7775]}, {"w": "is", "b": [0.5342, 0.759, 0.55, 0.7775]}, {"w": "the", "b": [0.5559, 0.759, 0.5847, 0.7775]}, {"w": "way", "b": [0.5906, 0.759, 0.63, 0.7775]}, {"w": "to", "b": [0.6359, 0.759, 0.6542, 0.7775]}, {"w": "go.", "b": [0.6601, 0.759, 0.6897, 0.7775]}]}, {"id": "b_6", "type": "paragraph", "text": "Because models behave just like layers, you can add a model (like conv_base) to a Sequential model just like you would add a layer.", "words": [{"w": "Because", "b": [0.1289, 0.8241, 0.2076, 0.8426]}, {"w": "models", "b": [0.2135, 0.8241, 0.2817, 0.8426]}, {"w": "behave", "b": [0.2876, 0.8241, 0.3545, 0.8426]}, {"w": "just", "b": [0.3604, 0.8241, 0.3945, 0.8426]}, {"w": "like", "b": [0.4004, 0.8241, 0.4358, 0.8426]}, {"w": "layers,", "b": [0.4417, 0.8241, 0.504, 0.8426]}, {"w": "you", "b": [0.5099, 0.8241, 0.5453, 0.8426]}, {"w": "can", "b": [0.5512, 0.8241, 0.584, 0.8426]}, {"w": "add", "b": [0.5899, 0.8241, 0.624, 0.8426]}, {"w": "a", "b": [0.6299, 0.8241, 0.6404, 0.8426]}, {"w": "model", "b": [0.6463, 0.8241, 0.7054, 0.8426]}, {"w": "(like", "b": [0.7113, 0.8241, 0.7545, 0.8426]}, {"w": "conv_base)", "b": [0.1289, 0.8433, 0.2643, 0.8632]}, {"w": "to", "b": [0.2702, 0.8433, 0.2886, 0.8618]}, {"w": "a", "b": [0.2945, 0.8433, 0.3049, 0.8618]}, {"w": "Sequential", "b": [0.3108, 0.8443, 0.4525, 0.8632]}, {"w": "model", "b": [0.4584, 0.8433, 0.5175, 0.8618]}, {"w": "just", "b": [0.5234, 0.8433, 0.5575, 0.8618]}, {"w": "like", "b": [0.5634, 0.8433, 0.5988, 0.8618]}, {"w": "you", "b": [0.6047, 0.8433, 0.6402, 0.8618]}, {"w": "would", "b": [0.6461, 0.8433, 0.7051, 0.8618]}, {"w": "add", "b": [0.711, 0.8433, 0.7451, 0.8618]}, {"w": "a", "b": [0.751, 0.8433, 0.7615, 0.8618]}, {"w": "layer.", "b": [0.7674, 0.8433, 0.8192, 0.8618]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 5.20. Adding a densely connected classifier on top of the convolutional base", "words": [{"w": "Listing", "b": [0.1289, 0.8796, 0.182, 0.8934]}, {"w": "5.20.", "b": [0.1865, 0.8796, 0.2219, 0.8934]}, {"w": "Adding", "b": [0.2263, 0.8796, 0.2824, 0.8934]}, {"w": "a", "b": [0.2868, 0.8796, 0.2957, 0.8934]}, {"w": "densely", "b": [0.3001, 0.8796, 0.3562, 0.8934]}, {"w": "connected", "b": [0.3606, 0.8796, 0.4364, 0.8934]}, {"w": "classifier", "b": [0.4408, 0.8796, 0.5077, 0.8934]}, {"w": "on", "b": [0.5121, 0.8796, 0.5308, 0.8934]}, {"w": "top", "b": [0.5353, 0.8796, 0.5599, 0.8934]}, {"w": "of", "b": [0.5643, 0.8796, 0.579, 0.8934]}, {"w": "the", "b": [0.5835, 0.8796, 0.6071, 0.8934]}, {"w": "convolutional", "b": [0.6115, 0.8796, 0.7139, 0.8934]}, {"w": "base", "b": [0.7183, 0.8796, 0.7517, 0.8934]}]}]}, {"page": 206, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "from keras import models from keras import layers model = models.Sequential() model.add(conv_base) model.add(layers.Flatten()) model.add(layers.Dense(256, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))", "words": [{"w": "from", "b": [0.1348, 0.0851, 0.1773, 0.0993]}, {"w": "keras", "b": [0.1879, 0.0851, 0.241, 0.0993]}, {"w": "import", "b": [0.2517, 0.0851, 0.3154, 0.0993]}, {"w": "models", "b": [0.3261, 0.0851, 0.3898, 0.0993]}, {"w": "from", "b": [0.1348, 0.0993, 0.1773, 0.1135]}, {"w": "keras", "b": [0.1879, 0.0993, 0.241, 0.1135]}, {"w": "import", "b": [0.2517, 0.0993, 0.3154, 0.1135]}, {"w": "layers", "b": [0.3261, 0.0993, 0.3898, 0.1135]}, {"w": "model", "b": [0.1348, 0.1277, 0.1879, 0.1418]}, {"w": "=", "b": [0.1985, 0.1277, 0.2092, 0.1418]}, {"w": "models.Sequential()", "b": [0.2198, 0.1277, 0.4217, 0.1418]}, {"w": "model.add(conv_base)", "b": [0.1348, 0.1419, 0.3473, 0.156]}, {"w": "model.add(layers.Flatten())", "b": [0.1348, 0.156, 0.4217, 0.1702]}, {"w": "model.add(layers.Dense(256,", "b": [0.1348, 0.1702, 0.4217, 0.1844]}, {"w": "activation='relu'))", "b": [0.4323, 0.1702, 0.6342, 0.1844]}, {"w": "model.add(layers.Dense(1,", "b": [0.1348, 0.1844, 0.4004, 0.1986]}, {"w": "activation='sigmoid'))", "b": [0.4111, 0.1844, 0.6449, 0.1986]}]}, {"id": "b_1", "type": "paragraph", "text": "This is what the model looks like now:", "words": [{"w": "This", "b": [0.1289, 0.22, 0.1709, 0.2385]}, {"w": "is", "b": [0.1768, 0.22, 0.1925, 0.2385]}, {"w": "what", "b": [0.1984, 0.22, 0.2443, 0.2385]}, {"w": "the", "b": [0.2502, 0.22, 0.2791, 0.2385]}, {"w": "model", "b": [0.285, 0.22, 0.344, 0.2385]}, {"w": "looks", "b": [0.3499, 0.22, 0.4011, 0.2385]}, {"w": "like", "b": [0.407, 0.22, 0.4424, 0.2385]}, {"w": "now:", "b": [0.4483, 0.22, 0.4956, 0.2385]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> model.summary() Layer (type) Output Shape Param # ================================================================ vgg16 (Model) (None, 4, 4, 512) 14714688 ________________________________________________________________ flatten_1 (Flatten) (None, 8192) 0 ________________________________________________________________ dense_1 (Dense) (None, 256) 2097408 ________________________________________________________________ dense_2 (Dense) (None, 1) 257 ================================================================ Total params: 16,812,353 Trainable params: 16,812,353 Non-trainable params: 0", "words": [{"w": ">>>", "b": [0.1348, 0.2553, 0.1667, 0.2695]}, {"w": "model.summary()", "b": [0.1773, 0.2553, 0.3367, 0.2695]}, {"w": "Layer", "b": [0.1348, 0.2695, 0.1879, 0.2837]}, {"w": "(type)", "b": [0.1985, 0.2695, 0.2623, 0.2837]}, {"w": "Output", "b": [0.4855, 0.2695, 0.5492, 0.2837]}, {"w": "Shape", "b": [0.5598, 0.2695, 0.613, 0.2837]}, {"w": "Param", "b": [0.7192, 0.2695, 0.7724, 0.2837]}, {"w": "#", "b": [0.783, 0.2695, 0.7936, 0.2837]}, {"w": "================================================================", "b": [0.1348, 0.2837, 0.8149, 0.2979]}, {"w": "vgg16", "b": [0.1348, 0.2979, 0.1879, 0.3121]}, {"w": "(Model)", "b": [0.1985, 0.2979, 0.2729, 0.3121]}, {"w": "(None,", "b": [0.4855, 0.2979, 0.5492, 0.3121]}, {"w": "4,", "b": [0.5598, 0.2979, 0.5811, 0.3121]}, {"w": "4,", "b": [0.5917, 0.2979, 0.613, 0.3121]}, {"w": "512)", "b": [0.6236, 0.2979, 0.6661, 0.3121]}, {"w": "14714688", "b": [0.7192, 0.2979, 0.8043, 0.3121]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3121, 0.8149, 0.3262]}, {"w": "flatten_1", "b": [0.1348, 0.3263, 0.2304, 0.3404]}, {"w": "(Flatten)", "b": [0.241, 0.3263, 0.3367, 0.3404]}, {"w": "(None,", "b": [0.4855, 0.3263, 0.5492, 0.3404]}, {"w": "8192)", "b": [0.5598, 0.3263, 0.613, 0.3404]}, {"w": "0", "b": [0.7192, 0.3263, 0.7299, 0.3404]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3404, 0.8149, 0.3546]}, {"w": "dense_1", "b": [0.1348, 0.3546, 0.2092, 0.3688]}, {"w": "(Dense)", "b": [0.2198, 0.3546, 0.2942, 0.3688]}, {"w": "(None,", "b": [0.4855, 0.3546, 0.5492, 0.3688]}, {"w": "256)", "b": [0.5598, 0.3546, 0.6024, 0.3688]}, {"w": "2097408", "b": [0.7192, 0.3546, 0.7936, 0.3688]}, {"w": "________________________________________________________________", "b": [0.1348, 0.3688, 0.8149, 0.383]}, {"w": "dense_2", "b": [0.1348, 0.383, 0.2092, 0.3972]}, {"w": "(Dense)", "b": [0.2198, 0.383, 0.2942, 0.3972]}, {"w": "(None,", "b": [0.4855, 0.383, 0.5492, 0.3972]}, {"w": "1)", "b": [0.5598, 0.383, 0.5811, 0.3972]}, {"w": "257", "b": [0.7192, 0.383, 0.7511, 0.3972]}, {"w": "================================================================", "b": [0.1348, 0.3972, 0.8149, 0.4114]}, {"w": "Total", "b": [0.1348, 0.4114, 0.1879, 0.4255]}, {"w": "params:", "b": [0.1985, 0.4114, 0.2729, 0.4255]}, {"w": "16,812,353", "b": [0.2836, 0.4114, 0.3898, 0.4255]}, {"w": "Trainable", "b": [0.1348, 0.4255, 0.2304, 0.4397]}, {"w": "params:", "b": [0.241, 0.4255, 0.3154, 0.4397]}, {"w": "16,812,353", "b": [0.3261, 0.4255, 0.4323, 0.4397]}, {"w": "Non-trainable", "b": [0.1348, 0.4397, 0.2729, 0.4539]}, {"w": "params:", "b": [0.2836, 0.4397, 0.3579, 0.4539]}, {"w": "0", "b": [0.3686, 0.4397, 0.3792, 0.4539]}]}, {"id": "b_3", "type": "paragraph", "text": "As you can see, the convolutional base of VGG16 has 14,714,688 parameters, which is very large. The classifier you’re adding on top has 2 million parameters.", "words": [{"w": "As", "b": [0.1289, 0.4753, 0.1551, 0.4938]}, {"w": "you", "b": [0.161, 0.4753, 0.1964, 0.4938]}, {"w": "can", "b": [0.2023, 0.4753, 0.2351, 0.4938]}, {"w": "see,", "b": [0.241, 0.4753, 0.2771, 0.4938]}, {"w": "the", "b": [0.283, 0.4753, 0.3118, 0.4938]}, {"w": "convolutional", "b": [0.3177, 0.4753, 0.4476, 0.4938]}, {"w": "base", "b": [0.4535, 0.4753, 0.4955, 0.4938]}, {"w": "of", "b": [0.5014, 0.4753, 0.5211, 0.4938]}, {"w": "VGG16", "b": [0.527, 0.4753, 0.6017, 0.4938]}, {"w": "has", "b": [0.6076, 0.4753, 0.6391, 0.4938]}, {"w": "14,714,688", "b": [0.645, 0.4753, 0.7513, 0.4938]}, {"w": "parameters,", "b": [0.7572, 0.4753, 0.8667, 0.4938]}, {"w": "which", "b": [0.1289, 0.4945, 0.1866, 0.513]}, {"w": "is", "b": [0.1925, 0.4945, 0.2082, 0.513]}, {"w": "very", "b": [0.2141, 0.4945, 0.2561, 0.513]}, {"w": "large.", "b": [0.262, 0.4945, 0.3147, 0.513]}, {"w": "The", "b": [0.3206, 0.4945, 0.3573, 0.513]}, {"w": "classifier", "b": [0.3632, 0.4945, 0.4485, 0.513]}, {"w": "you’re", "b": [0.4544, 0.4945, 0.516, 0.513]}, {"w": "adding", "b": [0.5219, 0.4945, 0.5862, 0.513]}, {"w": "on", "b": [0.592, 0.4945, 0.6157, 0.513]}, {"w": "top", "b": [0.6216, 0.4945, 0.6517, 0.513]}, {"w": "has", "b": [0.6576, 0.4945, 0.6891, 0.513]}, {"w": "2", "b": [0.695, 0.4945, 0.7068, 0.513]}, {"w": "million", "b": [0.7127, 0.4945, 0.781, 0.513]}, {"w": "parameters.", "b": [0.1289, 0.5137, 0.2384, 0.5322]}]}, {"id": "b_4", "type": "paragraph", "text": "Before you compile and train the model, it’s very important to freeze the convolutional base. Freezing a layer or set of layers means preventing their weights from being updated during training. If you don’t do this, then the representations that were previously learned by the convolutional base will be modified during training. Because the Dense layers on top are randomly initialized, very large weight updates would be propagated through the network, effectively destroying the representations previously learned.", "words": [{"w": "Before", "b": [0.1289, 0.5538, 0.1931, 0.5722]}, {"w": "you", "b": [0.199, 0.5538, 0.2345, 0.5722]}, {"w": "compile", "b": [0.2404, 0.5538, 0.3164, 0.5722]}, {"w": "and", "b": [0.3224, 0.5538, 0.3565, 0.5722]}, {"w": "train", "b": [0.3624, 0.5538, 0.4056, 0.5722]}, {"w": "the", "b": [0.4115, 0.5538, 0.4404, 0.5722]}, {"w": "model,", "b": [0.4463, 0.5538, 0.5112, 0.5722]}, {"w": "it’s", "b": [0.5171, 0.5538, 0.546, 0.5722]}, {"w": "very", "b": [0.5519, 0.5538, 0.5938, 0.5722]}, {"w": "important", "b": [0.5997, 0.5538, 0.6916, 0.5722]}, {"w": "to", "b": [0.6975, 0.5538, 0.7158, 0.5722]}, {"w": "freeze", "b": [0.7217, 0.5538, 0.7794, 0.5722]}, {"w": "the", "b": [0.7853, 0.5538, 0.8142, 0.5722]}, {"w": "convolutional", "b": [0.1289, 0.573, 0.2588, 0.5914]}, {"w": "base.", "b": [0.2647, 0.573, 0.3125, 0.5914]}, {"w": "Freezing", "b": [0.3184, 0.573, 0.4015, 0.5914]}, {"w": "a", "b": [0.4074, 0.573, 0.4178, 0.5914]}, {"w": "layer", "b": [0.4238, 0.573, 0.471, 0.5914]}, {"w": "or", "b": [0.4769, 0.573, 0.4965, 0.5914]}, {"w": "set", "b": [0.5024, 0.573, 0.5287, 0.5914]}, {"w": "of", "b": [0.5346, 0.573, 0.5542, 0.5914]}, {"w": "layers", "b": [0.5602, 0.573, 0.6165, 0.5914]}, {"w": "means", "b": [0.6224, 0.573, 0.6828, 0.5914]}, {"w": "preventing", "b": [0.6887, 0.573, 0.7897, 0.5914]}, {"w": "their", "b": [0.7956, 0.573, 0.8389, 0.5914]}, {"w": "weights", "b": [0.1289, 0.5921, 0.2023, 0.6106]}, {"w": "from", "b": [0.2082, 0.5921, 0.2542, 0.6106]}, {"w": "being", "b": [0.2601, 0.5921, 0.3125, 0.6106]}, {"w": "updated", "b": [0.3184, 0.5921, 0.3932, 0.6106]}, {"w": "during", "b": [0.3991, 0.5921, 0.4608, 0.6106]}, {"w": "training.", "b": [0.4667, 0.5921, 0.546, 0.6106]}, {"w": "If", "b": [0.5519, 0.5921, 0.5677, 0.6106]}, {"w": "you", "b": [0.5736, 0.5921, 0.609, 0.6106]}, {"w": "don’t", "b": [0.6149, 0.5921, 0.6643, 0.6106]}, {"w": "do", "b": [0.6702, 0.5921, 0.6938, 0.6106]}, {"w": "this,", "b": [0.6997, 0.5921, 0.7397, 0.6106]}, {"w": "then", "b": [0.7456, 0.5921, 0.7863, 0.6106]}, {"w": "the", "b": [0.7922, 0.5921, 0.821, 0.6106]}, {"w": "representations", "b": [0.1289, 0.6113, 0.2718, 0.6298]}, {"w": "that", "b": [0.2777, 0.6113, 0.3132, 0.6298]}, {"w": "were", "b": [0.3191, 0.6113, 0.365, 0.6298]}, {"w": "previously", "b": [0.3709, 0.6113, 0.4706, 0.6298]}, {"w": "learned", "b": [0.4765, 0.6113, 0.546, 0.6298]}, {"w": "by", "b": [0.5519, 0.6113, 0.5755, 0.6298]}, {"w": "the", "b": [0.5814, 0.6113, 0.6102, 0.6298]}, {"w": "convolutional", "b": [0.6161, 0.6113, 0.746, 0.6298]}, {"w": "base", "b": [0.7519, 0.6113, 0.7939, 0.6298]}, {"w": "will", "b": [0.7998, 0.6113, 0.8365, 0.6298]}, {"w": "be", "b": [0.8424, 0.6113, 0.8647, 0.6298]}, {"w": "modified", "b": [0.1289, 0.6305, 0.2141, 0.649]}, {"w": "during", "b": [0.2201, 0.6305, 0.2817, 0.649]}, {"w": "training.", "b": [0.2876, 0.6305, 0.367, 0.649]}, {"w": "Because", "b": [0.3729, 0.6305, 0.4516, 0.649]}, {"w": "the", "b": [0.4575, 0.6305, 0.4863, 0.649]}, {"w": "Dense", "b": [0.4922, 0.6315, 0.563, 0.6504]}, {"w": "layers", "b": [0.5689, 0.6305, 0.6253, 0.649]}, {"w": "on", "b": [0.6312, 0.6305, 0.6548, 0.649]}, {"w": "top", "b": [0.6607, 0.6305, 0.6909, 0.649]}, {"w": "are", "b": [0.6968, 0.6305, 0.7257, 0.649]}, {"w": "randomly", "b": [0.7316, 0.6305, 0.8221, 0.649]}, {"w": "initialized,", "b": [0.1289, 0.6506, 0.2292, 0.669]}, {"w": "very", "b": [0.2351, 0.6506, 0.2771, 0.669]}, {"w": "large", "b": [0.283, 0.6506, 0.3297, 0.669]}, {"w": "weight", "b": [0.3356, 0.6506, 0.3999, 0.669]}, {"w": "updates", "b": [0.4058, 0.6506, 0.478, 0.669]}, {"w": "would", "b": [0.4839, 0.6506, 0.5429, 0.669]}, {"w": "be", "b": [0.5488, 0.6506, 0.5711, 0.669]}, {"w": "propagated", "b": [0.577, 0.6506, 0.6819, 0.669]}, {"w": "through", "b": [0.6878, 0.6506, 0.7613, 0.669]}, {"w": "the", "b": [0.7672, 0.6506, 0.7961, 0.669]}, {"w": "network,", "b": [0.1289, 0.6697, 0.2122, 0.6882]}, {"w": "effectively", "b": [0.2181, 0.6697, 0.3186, 0.6882]}, {"w": "destroying", "b": [0.3245, 0.6697, 0.4242, 0.6882]}, {"w": "the", "b": [0.4301, 0.6697, 0.4589, 0.6882]}, {"w": "representations", "b": [0.4648, 0.6697, 0.6078, 0.6882]}, {"w": "previously", "b": [0.6137, 0.6697, 0.7134, 0.6882]}, {"w": "learned.", "b": [0.7193, 0.6697, 0.7947, 0.6882]}]}, {"id": "b_5", "type": "paragraph", "text": "In Keras, you freeze a network by setting its trainable attribute to False:", "words": [{"w": "In", "b": [0.1289, 0.7098, 0.1485, 0.7283]}, {"w": "Keras,", "b": [0.1545, 0.7098, 0.2154, 0.7283]}, {"w": "you", "b": [0.2213, 0.7098, 0.2567, 0.7283]}, {"w": "freeze", "b": [0.2627, 0.7098, 0.3203, 0.7283]}, {"w": "a", "b": [0.3262, 0.7098, 0.3367, 0.7283]}, {"w": "network", "b": [0.3426, 0.7098, 0.42, 0.7283]}, {"w": "by", "b": [0.4259, 0.7098, 0.4495, 0.7283]}, {"w": "setting", "b": [0.4554, 0.7098, 0.5184, 0.7283]}, {"w": "its", "b": [0.5243, 0.7098, 0.5466, 0.7283]}, {"w": "trainable", "b": [0.5525, 0.7108, 0.68, 0.7297]}, {"w": "attribute", "b": [0.6859, 0.7098, 0.7646, 0.7283]}, {"w": "to", "b": [0.7705, 0.7098, 0.7889, 0.7283]}, {"w": "False:", "b": [0.1289, 0.7298, 0.2063, 0.7497]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> print('This is the number of trainable weights ' 'before freezing the conv base:', len(model.trainable_weights)) This is the number of trainable weights before freezing the conv base: 30 >>> conv_base.trainable = False >>> print('This is the number of trainable weights ' 'after freezing the conv base:', len(model.trainable_weights))", "words": [{"w": ">>>", "b": [0.1348, 0.766, 0.1667, 0.7802]}, {"w": "print('This", "b": [0.1773, 0.766, 0.2942, 0.7802]}, {"w": "is", "b": [0.3048, 0.766, 0.3261, 0.7802]}, {"w": "the", "b": [0.3367, 0.766, 0.3686, 0.7802]}, {"w": "number", "b": [0.3792, 0.766, 0.443, 0.7802]}, {"w": "of", "b": [0.4536, 0.766, 0.4748, 0.7802]}, {"w": "trainable", "b": [0.4855, 0.766, 0.5811, 0.7802]}, {"w": "weights", "b": [0.5917, 0.766, 0.6661, 0.7802]}, {"w": "'", "b": [0.6767, 0.766, 0.6874, 0.7802]}, {"w": "'before", "b": [0.2304, 0.7802, 0.3048, 0.7943]}, {"w": "freezing", "b": [0.3154, 0.7802, 0.4004, 0.7943]}, {"w": "the", "b": [0.4111, 0.7802, 0.443, 0.7943]}, {"w": "conv", "b": [0.4536, 0.7802, 0.4961, 0.7943]}, {"w": "base:',", "b": [0.5067, 0.7802, 0.5811, 0.7943]}, {"w": "len(model.trainable_weights))", "b": [0.1348, 0.7943, 0.443, 0.8085]}, {"w": "This", "b": [0.1348, 0.8085, 0.1773, 0.8227]}, {"w": "is", "b": [0.1879, 0.8085, 0.2092, 0.8227]}, {"w": "the", "b": [0.2198, 0.8085, 0.2517, 0.8227]}, {"w": "number", "b": [0.2623, 0.8085, 0.3261, 0.8227]}, {"w": "of", "b": [0.3367, 0.8085, 0.3579, 0.8227]}, {"w": "trainable", "b": [0.3686, 0.8085, 0.4642, 0.8227]}, {"w": "weights", "b": [0.4748, 0.8085, 0.5492, 0.8227]}, {"w": "before", "b": [0.5598, 0.8085, 0.6236, 0.8227]}, {"w": "freezing", "b": [0.6342, 0.8085, 0.7192, 0.8227]}, {"w": "the", "b": [0.7299, 0.8085, 0.7618, 0.8227]}, {"w": "conv", "b": [0.7724, 0.8085, 0.8149, 0.8227]}, {"w": "base:", "b": [0.1348, 0.8227, 0.1879, 0.8369]}, {"w": "30", "b": [0.1985, 0.8227, 0.2198, 0.8369]}, {"w": ">>>", "b": [0.1348, 0.8369, 0.1667, 0.8511]}, {"w": "conv_base.trainable", "b": [0.1773, 0.8369, 0.3792, 0.8511]}, {"w": "=", "b": [0.3898, 0.8369, 0.4004, 0.8511]}, {"w": "False", "b": [0.4111, 0.8369, 0.4642, 0.8511]}, {"w": ">>>", "b": [0.1348, 0.8511, 0.1667, 0.8653]}, {"w": "print('This", "b": [0.1773, 0.8511, 0.2942, 0.8653]}, {"w": "is", "b": [0.3048, 0.8511, 0.3261, 0.8653]}, {"w": "the", "b": [0.3367, 0.8511, 0.3686, 0.8653]}, {"w": "number", "b": [0.3792, 0.8511, 0.443, 0.8653]}, {"w": "of", "b": [0.4536, 0.8511, 0.4748, 0.8653]}, {"w": "trainable", "b": [0.4855, 0.8511, 0.5811, 0.8653]}, {"w": "weights", "b": [0.5917, 0.8511, 0.6661, 0.8653]}, {"w": "'", "b": [0.6767, 0.8511, 0.6874, 0.8653]}, {"w": "'after", "b": [0.241, 0.8653, 0.3048, 0.8794]}, {"w": "freezing", "b": [0.3154, 0.8653, 0.4004, 0.8794]}, {"w": "the", "b": [0.4111, 0.8653, 0.443, 0.8794]}, {"w": "conv", "b": [0.4536, 0.8653, 0.4961, 0.8794]}, {"w": "base:',", "b": [0.5067, 0.8653, 0.5811, 0.8794]}, {"w": "len(model.trainable_weights))", "b": [0.1348, 0.8795, 0.443, 0.8936]}]}]}, {"page": 207, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This is the number of trainable weights after freezing the conv base: 4", "words": [{"w": "This", "b": [0.1348, 0.0851, 0.1773, 0.0993]}, {"w": "is", "b": [0.1879, 0.0851, 0.2092, 0.0993]}, {"w": "the", "b": [0.2198, 0.0851, 0.2517, 0.0993]}, {"w": "number", "b": [0.2623, 0.0851, 0.3261, 0.0993]}, {"w": "of", "b": [0.3367, 0.0851, 0.3579, 0.0993]}, {"w": "trainable", "b": [0.3686, 0.0851, 0.4642, 0.0993]}, {"w": "weights", "b": [0.4748, 0.0851, 0.5492, 0.0993]}, {"w": "after", "b": [0.5598, 0.0851, 0.613, 0.0993]}, {"w": "freezing", "b": [0.6236, 0.0851, 0.7086, 0.0993]}, {"w": "the", "b": [0.7192, 0.0851, 0.7511, 0.0993]}, {"w": "conv", "b": [0.7618, 0.0851, 0.8043, 0.0993]}, {"w": "base:", "b": [0.8149, 0.0851, 0.868, 0.0993]}, {"w": "4", "b": [0.1348, 0.0993, 0.1454, 0.1135]}]}, {"id": "b_1", "type": "paragraph", "text": "With this setup, only the weights from the two Dense layers that you added will be trained. That’s a total of four weight tensors: two per layer (the main weight matrix and the bias vector). Note that in order for these changes to take effect, you must first compile the model. If you ever modify weight trainability after compilation, you should then recompile the model, or these changes will be ignored.", "words": [{"w": "With", "b": [0.1289, 0.1349, 0.1752, 0.1534]}, {"w": "this", "b": [0.1811, 0.1349, 0.2152, 0.1534]}, {"w": "setup,", "b": [0.2211, 0.1349, 0.2768, 0.1534]}, {"w": "only", "b": [0.2827, 0.1349, 0.3247, 0.1534]}, {"w": "the", "b": [0.3306, 0.1349, 0.3595, 0.1534]}, {"w": "weights", "b": [0.3654, 0.1349, 0.4389, 0.1534]}, {"w": "from", "b": [0.4448, 0.1349, 0.4907, 0.1534]}, {"w": "the", "b": [0.4966, 0.1349, 0.5254, 0.1534]}, {"w": "two", "b": [0.5313, 0.1349, 0.5668, 0.1534]}, {"w": "Dense", "b": [0.5726, 0.1359, 0.6435, 0.1548]}, {"w": "layers", "b": [0.6494, 0.1349, 0.7058, 0.1534]}, {"w": "that", "b": [0.7117, 0.1349, 0.7471, 0.1534]}, {"w": "you", "b": [0.753, 0.1349, 0.7884, 0.1534]}, {"w": "added", "b": [0.7943, 0.1349, 0.8507, 0.1534]}, {"w": "will", "b": [0.1289, 0.1549, 0.1656, 0.1734]}, {"w": "be", "b": [0.1715, 0.1549, 0.1938, 0.1734]}, {"w": "trained.", "b": [0.1997, 0.1549, 0.2712, 0.1734]}, {"w": "That’s", "b": [0.2771, 0.1549, 0.3361, 0.1734]}, {"w": "a", "b": [0.342, 0.1549, 0.3525, 0.1734]}, {"w": "total", "b": [0.3584, 0.1549, 0.4004, 0.1734]}, {"w": "of", "b": [0.4063, 0.1549, 0.426, 0.1734]}, {"w": "four", "b": [0.4319, 0.1549, 0.4712, 0.1734]}, {"w": "weight", "b": [0.4771, 0.1549, 0.5414, 0.1734]}, {"w": "tensors:", "b": [0.5473, 0.1549, 0.6208, 0.1734]}, {"w": "two", "b": [0.6267, 0.1549, 0.6621, 0.1734]}, {"w": "per", "b": [0.668, 0.1549, 0.6981, 0.1734]}, {"w": "layer", "b": [0.704, 0.1549, 0.7512, 0.1734]}, {"w": "(the", "b": [0.7572, 0.1549, 0.7939, 0.1734]}, {"w": "main", "b": [0.7998, 0.1549, 0.847, 0.1734]}, {"w": "weight", "b": [0.1289, 0.1741, 0.1932, 0.1926]}, {"w": "matrix", "b": [0.1991, 0.1741, 0.2607, 0.1926]}, {"w": "and", "b": [0.2666, 0.1741, 0.3007, 0.1926]}, {"w": "the", "b": [0.3066, 0.1741, 0.3355, 0.1926]}, {"w": "bias", "b": [0.3413, 0.1741, 0.3794, 0.1926]}, {"w": "vector).", "b": [0.3853, 0.1741, 0.4581, 0.1926]}, {"w": "Note", "b": [0.464, 0.1741, 0.5099, 0.1926]}, {"w": "that", "b": [0.5158, 0.1741, 0.5512, 0.1926]}, {"w": "in", "b": [0.5571, 0.1741, 0.5755, 0.1926]}, {"w": "order", "b": [0.5814, 0.1741, 0.6312, 0.1926]}, {"w": "for", "b": [0.6371, 0.1741, 0.6646, 0.1926]}, {"w": "these", "b": [0.6705, 0.1741, 0.7191, 0.1926]}, {"w": "changes", "b": [0.725, 0.1741, 0.801, 0.1926]}, {"w": "to", "b": [0.8069, 0.1741, 0.8253, 0.1926]}, {"w": "take", "b": [0.8312, 0.1741, 0.8706, 0.1926]}, {"w": "effect,", "b": [0.1289, 0.1933, 0.1881, 0.2118]}, {"w": "you", "b": [0.194, 0.1933, 0.2294, 0.2118]}, {"w": "must", "b": [0.2353, 0.1933, 0.2813, 0.2118]}, {"w": "first", "b": [0.2872, 0.1933, 0.3252, 0.2118]}, {"w": "compile", "b": [0.3311, 0.1933, 0.4072, 0.2118]}, {"w": "the", "b": [0.4131, 0.1933, 0.442, 0.2118]}, {"w": "model.", "b": [0.4479, 0.1933, 0.5128, 0.2118]}, {"w": "If", "b": [0.5187, 0.1933, 0.5344, 0.2118]}, {"w": "you", "b": [0.5403, 0.1933, 0.5758, 0.2118]}, {"w": "ever", "b": [0.5817, 0.1933, 0.6223, 0.2118]}, {"w": "modify", "b": [0.6282, 0.1933, 0.6964, 0.2118]}, {"w": "weight", "b": [0.7023, 0.1933, 0.7666, 0.2118]}, {"w": "trainability", "b": [0.1289, 0.2125, 0.2325, 0.231]}, {"w": "after", "b": [0.2384, 0.2125, 0.2817, 0.231]}, {"w": "compilation,", "b": [0.2876, 0.2125, 0.4063, 0.231]}, {"w": "you", "b": [0.4122, 0.2125, 0.4477, 0.231]}, {"w": "should", "b": [0.4536, 0.2125, 0.5165, 0.231]}, {"w": "then", "b": [0.5224, 0.2125, 0.5631, 0.231]}, {"w": "recompile", "b": [0.569, 0.2125, 0.6634, 0.231]}, {"w": "the", "b": [0.6693, 0.2125, 0.6982, 0.231]}, {"w": "model,", "b": [0.7041, 0.2125, 0.769, 0.231]}, {"w": "or", "b": [0.775, 0.2125, 0.7946, 0.231]}, {"w": "these", "b": [0.8005, 0.2125, 0.8491, 0.231]}, {"w": "changes", "b": [0.1289, 0.2317, 0.2049, 0.2502]}, {"w": "will", "b": [0.2108, 0.2317, 0.2476, 0.2502]}, {"w": "be", "b": [0.2535, 0.2317, 0.2758, 0.2502]}, {"w": "ignored.", "b": [0.2817, 0.2317, 0.3597, 0.2502]}]}, {"id": "b_2", "type": "paragraph", "text": "Now you can start training your model, with the same data-augmentation configuration that you used in the previous example.", "words": [{"w": "Now", "b": [0.1289, 0.2717, 0.1748, 0.2902]}, {"w": "you", "b": [0.1807, 0.2717, 0.2161, 0.2902]}, {"w": "can", "b": [0.222, 0.2717, 0.2548, 0.2902]}, {"w": "start", "b": [0.2607, 0.2717, 0.3014, 0.2902]}, {"w": "training", "b": [0.3073, 0.2717, 0.3807, 0.2902]}, {"w": "your", "b": [0.3866, 0.2717, 0.4299, 0.2902]}, {"w": "model,", "b": [0.4358, 0.2717, 0.5008, 0.2902]}, {"w": "with", "b": [0.5067, 0.2717, 0.5487, 0.2902]}, {"w": "the", "b": [0.5546, 0.2717, 0.5834, 0.2902]}, {"w": "same", "b": [0.5893, 0.2717, 0.6378, 0.2902]}, {"w": "data-augmentation", "b": [0.6437, 0.2717, 0.8195, 0.2902]}, {"w": "configuration", "b": [0.1289, 0.2909, 0.2561, 0.3094]}, {"w": "that", "b": [0.262, 0.2909, 0.2974, 0.3094]}, {"w": "you", "b": [0.3033, 0.2909, 0.3388, 0.3094]}, {"w": "used", "b": [0.3447, 0.2909, 0.388, 0.3094]}, {"w": "in", "b": [0.3939, 0.2909, 0.4122, 0.3094]}, {"w": "the", "b": [0.4181, 0.2909, 0.447, 0.3094]}, {"w": "previous", "b": [0.4529, 0.2909, 0.5342, 0.3094]}, {"w": "example.", "b": [0.5401, 0.2909, 0.626, 0.3094]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.21. Training the model end to end with a frozen convolutional base", "words": [{"w": "Listing", "b": [0.1289, 0.3264, 0.182, 0.3402]}, {"w": "5.21.", "b": [0.1865, 0.3264, 0.2219, 0.3402]}, {"w": "Training", "b": [0.2263, 0.3264, 0.2919, 0.3402]}, {"w": "the", "b": [0.2963, 0.3264, 0.3199, 0.3402]}, {"w": "model", "b": [0.3244, 0.3264, 0.3706, 0.3402]}, {"w": "end", "b": [0.375, 0.3264, 0.4026, 0.3402]}, {"w": "to", "b": [0.407, 0.3264, 0.4218, 0.3402]}, {"w": "end", "b": [0.4262, 0.3264, 0.4538, 0.3402]}, {"w": "with", "b": [0.4582, 0.3264, 0.4916, 0.3402]}, {"w": "a", "b": [0.4961, 0.3264, 0.5049, 0.3402]}, {"w": "frozen", "b": [0.5094, 0.3264, 0.5572, 0.3402]}, {"w": "convolutional", "b": [0.5617, 0.3264, 0.664, 0.3402]}, {"w": "base", "b": [0.6684, 0.3264, 0.7019, 0.3402]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.preprocessing.image import ImageDataGenerator from keras import optimizers train_datagen = ImageDataGenerator( rescale=1./255, rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True, fill_mode='nearest') test_datagen = ImageDataGenerator(rescale=1./255) 1 train_generator = train_datagen.flow_from_directory( train_dir, 2 target_size=(150, 150), 3 batch_size=20, class_mode='binary') 4 validation_generator = test_datagen.flow_from_directory( validation_dir, target_size=(150, 150), batch_size=20, class_mode='binary') model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=2e-5), metrics=['acc']) history = model.fit_generator( train_generator, steps_per_epoch=100, epochs=30, validation_data=validation_generator, validation_steps=50)", "words": [{"w": "from", "b": [0.1348, 0.353, 0.1773, 0.3671]}, {"w": "keras.preprocessing.image", "b": [0.1879, 0.353, 0.4536, 0.3671]}, {"w": "import", "b": [0.4642, 0.353, 0.528, 0.3671]}, {"w": "ImageDataGenerator", "b": [0.5386, 0.353, 0.7299, 0.3671]}, {"w": "from", "b": [0.1348, 0.3671, 0.1773, 0.3813]}, {"w": "keras", "b": [0.1879, 0.3671, 0.241, 0.3813]}, {"w": "import", "b": [0.2517, 0.3671, 0.3154, 0.3813]}, {"w": "optimizers", "b": [0.3261, 0.3671, 0.4323, 0.3813]}, {"w": "train_datagen", "b": [0.1348, 0.3955, 0.2729, 0.4097]}, {"w": "=", "b": [0.2836, 0.3955, 0.2942, 0.4097]}, {"w": "ImageDataGenerator(", "b": [0.3048, 0.3955, 0.5067, 0.4097]}, {"w": "rescale=1./255,", "b": [0.1985, 0.4097, 0.3579, 0.4239]}, {"w": "rotation_range=40,", "b": [0.1985, 0.4239, 0.3898, 0.4381]}, {"w": "width_shift_range=0.2,", "b": [0.1985, 0.4381, 0.4323, 0.4522]}, {"w": "height_shift_range=0.2,", "b": [0.1985, 0.4522, 0.443, 0.4664]}, {"w": "shear_range=0.2,", "b": [0.1985, 0.4664, 0.3686, 0.4806]}, {"w": "zoom_range=0.2,", "b": [0.1985, 0.4806, 0.3579, 0.4948]}, {"w": "horizontal_flip=True,", "b": [0.1985, 0.4948, 0.4217, 0.509]}, {"w": "fill_mode='nearest')", "b": [0.1985, 0.509, 0.4111, 0.5232]}, {"w": "test_datagen", "b": [0.1348, 0.5374, 0.2623, 0.5515]}, {"w": "=", "b": [0.2729, 0.5374, 0.2836, 0.5515]}, {"w": "ImageDataGenerator(rescale=1./255)", "b": [0.2942, 0.5374, 0.6555, 0.5515]}, {"w": "1", "b": [0.8256, 0.5374, 0.8362, 0.5515]}, {"w": "train_generator", "b": [0.1348, 0.5657, 0.2942, 0.5799]}, {"w": "=", "b": [0.3048, 0.5657, 0.3154, 0.5799]}, {"w": "train_datagen.flow_from_directory(", "b": [0.3261, 0.5657, 0.6874, 0.5799]}, {"w": "train_dir,", "b": [0.2198, 0.5799, 0.3261, 0.5941]}, {"w": "2", "b": [0.8256, 0.5799, 0.8362, 0.5941]}, {"w": "target_size=(150,", "b": [0.2198, 0.5941, 0.4004, 0.6083]}, {"w": "150),", "b": [0.4111, 0.5941, 0.4642, 0.6083]}, {"w": "3", "b": [0.8256, 0.5941, 0.8362, 0.6083]}, {"w": "batch_size=20,", "b": [0.2198, 0.6083, 0.3686, 0.6225]}, {"w": "class_mode='binary')", "b": [0.2198, 0.6225, 0.4323, 0.6366]}, {"w": "4", "b": [0.8256, 0.6225, 0.8362, 0.6366]}, {"w": "validation_generator", "b": [0.1348, 0.6508, 0.3473, 0.665]}, {"w": "=", "b": [0.3579, 0.6508, 0.3686, 0.665]}, {"w": "test_datagen.flow_from_directory(", "b": [0.3792, 0.6508, 0.7299, 0.665]}, {"w": "validation_dir,", "b": [0.2198, 0.665, 0.3792, 0.6792]}, {"w": "target_size=(150,", "b": [0.2198, 0.6792, 0.4004, 0.6934]}, {"w": "150),", "b": [0.4111, 0.6792, 0.4642, 0.6934]}, {"w": "batch_size=20,", "b": [0.2198, 0.6934, 0.3686, 0.7076]}, {"w": "class_mode='binary')", "b": [0.2198, 0.7076, 0.4323, 0.7217]}, {"w": "model.compile(loss='binary_crossentropy',", "b": [0.1348, 0.7359, 0.5705, 0.7501]}, {"w": "optimizer=optimizers.RMSprop(lr=2e-5),", "b": [0.2836, 0.7501, 0.6874, 0.7643]}, {"w": "metrics=['acc'])", "b": [0.2836, 0.7643, 0.4536, 0.7785]}, {"w": "history", "b": [0.1348, 0.7927, 0.2092, 0.8069]}, {"w": "=", "b": [0.2198, 0.7927, 0.2304, 0.8069]}, {"w": "model.fit_generator(", "b": [0.241, 0.7927, 0.4536, 0.8069]}, {"w": "train_generator,", "b": [0.1985, 0.8069, 0.3686, 0.821]}, {"w": "steps_per_epoch=100,", "b": [0.1985, 0.821, 0.4111, 0.8352]}, {"w": "epochs=30,", "b": [0.1985, 0.8352, 0.3048, 0.8494]}, {"w": "validation_data=validation_generator,", "b": [0.1985, 0.8494, 0.5917, 0.8636]}, {"w": "validation_steps=50)", "b": [0.1985, 0.8636, 0.4111, 0.8778]}]}, {"id": "b_5", "type": "paragraph", "text": "1 Note that the validation data shouldn’t be augmented!", "words": [{"w": "1", "b": [0.1761, 0.895, 0.1879, 0.9135]}, {"w": "Note", "b": [0.1938, 0.895, 0.241, 0.9135]}, {"w": "that", "b": [0.2469, 0.895, 0.2876, 0.9135]}, {"w": "the", "b": [0.2935, 0.895, 0.325, 0.9135]}, {"w": "validation", "b": [0.3309, 0.895, 0.4319, 0.9135]}, {"w": "data", "b": [0.4378, 0.895, 0.4824, 0.9135]}, {"w": "shouldn’t", "b": [0.4883, 0.895, 0.5841, 0.9135]}, {"w": "be", "b": [0.59, 0.895, 0.6137, 0.9135]}, {"w": "augmented!", "b": [0.6196, 0.895, 0.7389, 0.9135]}]}]}, {"page": 208, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2 Target directory 3 Resizes all images to 150 × 150 4 Because you use binary_crossentropy loss, you need binary labels.", "words": [{"w": "2", "b": [0.1761, 0.0857, 0.1879, 0.1041]}, {"w": "Target", "b": [0.1938, 0.0857, 0.2598, 0.1041]}, {"w": "directory", "b": [0.2658, 0.0857, 0.3584, 0.1041]}, {"w": "3", "b": [0.1761, 0.1049, 0.1879, 0.1233]}, {"w": "Resizes", "b": [0.1938, 0.1049, 0.2673, 0.1233]}, {"w": "all", "b": [0.2732, 0.1049, 0.2981, 0.1233]}, {"w": "images", "b": [0.304, 0.1049, 0.3735, 0.1233]}, {"w": "to", "b": [0.3794, 0.1049, 0.3991, 0.1233]}, {"w": "150", "b": [0.405, 0.1049, 0.4404, 0.1233]}, {"w": "×", "b": [0.4463, 0.1049, 0.4598, 0.1233]}, {"w": "150", "b": [0.4657, 0.1049, 0.5011, 0.1233]}, {"w": "4", "b": [0.1761, 0.124, 0.1879, 0.1425]}, {"w": "Because", "b": [0.1938, 0.124, 0.2751, 0.1425]}, {"w": "you", "b": [0.281, 0.124, 0.3178, 0.1425]}, {"w": "use", "b": [0.3237, 0.124, 0.3565, 0.1425]}, {"w": "binary_crossentropy", "b": [0.3624, 0.124, 0.5701, 0.1425]}, {"w": "loss,", "b": [0.576, 0.124, 0.6187, 0.1425]}, {"w": "you", "b": [0.6246, 0.124, 0.6613, 0.1425]}, {"w": "need", "b": [0.6672, 0.124, 0.7145, 0.1425]}, {"w": "binary", "b": [0.7204, 0.124, 0.7873, 0.1425]}, {"w": "labels.", "b": [0.7932, 0.124, 0.8568, 0.1425]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s plot the results again (see figures 5.17 and 5.18). As you can see, you reach a validation accuracy of about 96%. This is much better than you achieved with the small convnet trained from scratch.", "words": [{"w": "Let’s", "b": [0.1289, 0.1641, 0.1761, 0.1826]}, {"w": "plot", "b": [0.182, 0.1641, 0.2187, 0.1826]}, {"w": "the", "b": [0.2246, 0.1641, 0.2535, 0.1826]}, {"w": "results", "b": [0.2594, 0.1641, 0.3211, 0.1826]}, {"w": "again", "b": [0.327, 0.1641, 0.3781, 0.1826]}, {"w": "(see", "b": [0.384, 0.1641, 0.422, 0.1826]}, {"w": "figures", "b": [0.4279, 0.1641, 0.4935, 0.1826]}, {"w": "5.17", "b": [0.4994, 0.1641, 0.5407, 0.1826]}, {"w": "and", "b": [0.5466, 0.1641, 0.5807, 0.1826]}, {"w": "5.18).", "b": [0.5866, 0.1641, 0.6417, 0.1826]}, {"w": "As", "b": [0.6476, 0.1641, 0.6738, 0.1826]}, {"w": "you", "b": [0.6797, 0.1641, 0.7152, 0.1826]}, {"w": "can", "b": [0.7211, 0.1641, 0.7538, 0.1826]}, {"w": "see,", "b": [0.7597, 0.1641, 0.7958, 0.1826]}, {"w": "you", "b": [0.8017, 0.1641, 0.8371, 0.1826]}, {"w": "reach", "b": [0.1289, 0.1833, 0.18, 0.2018]}, {"w": "a", "b": [0.1859, 0.1833, 0.1964, 0.2018]}, {"w": "validation", "b": [0.2023, 0.1833, 0.2968, 0.2018]}, {"w": "accuracy", "b": [0.3027, 0.1833, 0.3866, 0.2018]}, {"w": "of", "b": [0.3925, 0.1833, 0.4121, 0.2018]}, {"w": "about", "b": [0.418, 0.1833, 0.4705, 0.2018]}, {"w": "96%.", "b": [0.4764, 0.1833, 0.5256, 0.2018]}, {"w": "This", "b": [0.5315, 0.1833, 0.5735, 0.2018]}, {"w": "is", "b": [0.5794, 0.1833, 0.5951, 0.2018]}, {"w": "much", "b": [0.6011, 0.1833, 0.6535, 0.2018]}, {"w": "better", "b": [0.6594, 0.1833, 0.7132, 0.2018]}, {"w": "than", "b": [0.7191, 0.1833, 0.7598, 0.2018]}, {"w": "you", "b": [0.7657, 0.1833, 0.8011, 0.2018]}, {"w": "achieved", "b": [0.1289, 0.2025, 0.2128, 0.221]}, {"w": "with", "b": [0.2187, 0.2025, 0.2607, 0.221]}, {"w": "the", "b": [0.2666, 0.2025, 0.2955, 0.221]}, {"w": "small", "b": [0.3014, 0.2025, 0.3525, 0.221]}, {"w": "convnet", "b": [0.3584, 0.2025, 0.4332, 0.221]}, {"w": "trained", "b": [0.439, 0.2025, 0.5046, 0.221]}, {"w": "from", "b": [0.5105, 0.2025, 0.5564, 0.221]}, {"w": "scratch.", "b": [0.5623, 0.2025, 0.6351, 0.221]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 5.17. Training and validation accuracy for feature extraction with data augmentation", "words": [{"w": "Figure", "b": [0.1289, 0.2379, 0.1787, 0.2518]}, {"w": "5.17.", "b": [0.1832, 0.2379, 0.2186, 0.2518]}, {"w": "Training", "b": [0.223, 0.2379, 0.2886, 0.2518]}, {"w": "and", "b": [0.293, 0.2379, 0.3216, 0.2518]}, {"w": "validation", "b": [0.326, 0.2379, 0.4018, 0.2518]}, {"w": "accuracy", "b": [0.4062, 0.2379, 0.4741, 0.2518]}, {"w": "for", "b": [0.4785, 0.2379, 0.5011, 0.2518]}, {"w": "feature", "b": [0.5056, 0.2379, 0.5593, 0.2518]}, {"w": "extraction", "b": [0.5637, 0.2379, 0.6405, 0.2518]}, {"w": "with", "b": [0.6449, 0.2379, 0.6784, 0.2518]}, {"w": "data", "b": [0.6828, 0.2379, 0.7162, 0.2518]}, {"w": "augmentation", "b": [0.7207, 0.2379, 0.825, 0.2518]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 5.18. Training and validation loss for feature extraction with data augmentation", "words": [{"w": "Figure", "b": [0.1289, 0.5191, 0.1787, 0.533]}, {"w": "5.18.", "b": [0.1832, 0.5191, 0.2186, 0.533]}, {"w": "Training", "b": [0.223, 0.5191, 0.2886, 0.533]}, {"w": "and", "b": [0.293, 0.5191, 0.3216, 0.533]}, {"w": "validation", "b": [0.326, 0.5191, 0.4018, 0.533]}, {"w": "loss", "b": [0.4062, 0.5191, 0.4338, 0.533]}, {"w": "for", "b": [0.4382, 0.5191, 0.4608, 0.533]}, {"w": "feature", "b": [0.4653, 0.5191, 0.519, 0.533]}, {"w": "extraction", "b": [0.5234, 0.5191, 0.6002, 0.533]}, {"w": "with", "b": [0.6046, 0.5191, 0.6381, 0.533]}, {"w": "data", "b": [0.6425, 0.5191, 0.6759, 0.533]}, {"w": "augmentation", "b": [0.6804, 0.5191, 0.7847, 0.533]}]}, {"id": "b_4", "type": "equation", "text": "5.3.2. Fine-tuning", "words": [{"w": "5.3.2.", "b": [0.1289, 0.8091, 0.182, 0.8276]}, {"w": "Fine-tuning", "b": [0.1879, 0.8091, 0.306, 0.8276]}]}, {"id": "b_5", "type": "paragraph", "text": "Another widely used technique for model reuse, complementary to feature extraction, is fine-tuning (see figure 5.19). Fine-tuning consists of unfreezing a few of the top layers of a frozen model base used for feature extraction, and", "words": [{"w": "Another", "b": [0.1289, 0.8491, 0.2063, 0.8676]}, {"w": "widely", "b": [0.2122, 0.8491, 0.2764, 0.8676]}, {"w": "used", "b": [0.2823, 0.8491, 0.3256, 0.8676]}, {"w": "technique", "b": [0.3315, 0.8491, 0.4234, 0.8676]}, {"w": "for", "b": [0.4293, 0.8491, 0.4568, 0.8676]}, {"w": "model", "b": [0.4627, 0.8491, 0.5217, 0.8676]}, {"w": "reuse,", "b": [0.5276, 0.8491, 0.5834, 0.8676]}, {"w": "complementary", "b": [0.5893, 0.8491, 0.7362, 0.8676]}, {"w": "to", "b": [0.7421, 0.8491, 0.7605, 0.8676]}, {"w": "feature", "b": [0.7664, 0.8491, 0.8319, 0.8676]}, {"w": "extraction,", "b": [0.1289, 0.8683, 0.2292, 0.8868]}, {"w": "is", "b": [0.2351, 0.8683, 0.2509, 0.8868]}, {"w": "fine-tuning", "b": [0.2567, 0.8683, 0.3604, 0.8868]}, {"w": "(see", "b": [0.3663, 0.8683, 0.4043, 0.8868]}, {"w": "figure", "b": [0.4102, 0.8683, 0.4666, 0.8868]}, {"w": "5.19).", "b": [0.4725, 0.8683, 0.5275, 0.8868]}, {"w": "Fine-tuning", "b": [0.5334, 0.8683, 0.6437, 0.8868]}, {"w": "consists", "b": [0.6496, 0.8683, 0.7244, 0.8868]}, {"w": "of", "b": [0.7303, 0.8683, 0.7499, 0.8868]}, {"w": "unfreezing", "b": [0.7558, 0.8683, 0.8568, 0.8868]}, {"w": "a", "b": [0.1289, 0.8875, 0.1394, 0.906]}, {"w": "few", "b": [0.1453, 0.8875, 0.1807, 0.906]}, {"w": "of", "b": [0.1866, 0.8875, 0.2062, 0.906]}, {"w": "the", "b": [0.2121, 0.8875, 0.241, 0.906]}, {"w": "top", "b": [0.2469, 0.8875, 0.2771, 0.906]}, {"w": "layers", "b": [0.283, 0.8875, 0.3394, 0.906]}, {"w": "of", "b": [0.3453, 0.8875, 0.365, 0.906]}, {"w": "a", "b": [0.3709, 0.8875, 0.3813, 0.906]}, {"w": "frozen", "b": [0.3872, 0.8875, 0.4476, 0.906]}, {"w": "model", "b": [0.4535, 0.8875, 0.5125, 0.906]}, {"w": "base", "b": [0.5184, 0.8875, 0.5604, 0.906]}, {"w": "used", "b": [0.5663, 0.8875, 0.6096, 0.906]}, {"w": "for", "b": [0.6155, 0.8875, 0.643, 0.906]}, {"w": "feature", "b": [0.6489, 0.8875, 0.7145, 0.906]}, {"w": "extraction,", "b": [0.7204, 0.8875, 0.8207, 0.906]}, {"w": "and", "b": [0.8266, 0.8875, 0.8607, 0.906]}]}]}, {"page": 209, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "jointly training both the newly added part of the model (in this case, the fully connected classifier) and these top layers. This is called fine-tuning because it slightly adjusts the more abstract representations of the model being reused, in order to make them more relevant for the problem at hand.", "words": [{"w": "jointly", "b": [0.1289, 0.0857, 0.1906, 0.1041]}, {"w": "training", "b": [0.1964, 0.0857, 0.2699, 0.1041]}, {"w": "both", "b": [0.2758, 0.0857, 0.3178, 0.1041]}, {"w": "the", "b": [0.3237, 0.0857, 0.3526, 0.1041]}, {"w": "newly", "b": [0.3585, 0.0857, 0.4162, 0.1041]}, {"w": "added", "b": [0.4221, 0.0857, 0.4785, 0.1041]}, {"w": "part", "b": [0.4844, 0.0857, 0.5211, 0.1041]}, {"w": "of", "b": [0.527, 0.0857, 0.5467, 0.1041]}, {"w": "the", "b": [0.5526, 0.0857, 0.5814, 0.1041]}, {"w": "model", "b": [0.5873, 0.0857, 0.6464, 0.1041]}, {"w": "(in", "b": [0.6523, 0.0857, 0.6785, 0.1041]}, {"w": "this", "b": [0.6844, 0.0857, 0.7185, 0.1041]}, {"w": "case,", "b": [0.7244, 0.0857, 0.771, 0.1041]}, {"w": "the", "b": [0.7769, 0.0857, 0.8057, 0.1041]}, {"w": "fully", "b": [0.8116, 0.0857, 0.8563, 0.1041]}, {"w": "connected", "b": [0.1289, 0.1049, 0.2246, 0.1233]}, {"w": "classifier)", "b": [0.2305, 0.1049, 0.3236, 0.1233]}, {"w": "and", "b": [0.3295, 0.1049, 0.3636, 0.1233]}, {"w": "these", "b": [0.3695, 0.1049, 0.4181, 0.1233]}, {"w": "top", "b": [0.424, 0.1049, 0.4541, 0.1233]}, {"w": "layers.", "b": [0.46, 0.1049, 0.5223, 0.1233]}, {"w": "This", "b": [0.5282, 0.1049, 0.5702, 0.1233]}, {"w": "is", "b": [0.5761, 0.1049, 0.5918, 0.1233]}, {"w": "called", "b": [0.5977, 0.1049, 0.6541, 0.1233]}, {"w": "fine-tuning", "b": [0.66, 0.1049, 0.7637, 0.1233]}, {"w": "because", "b": [0.7695, 0.1049, 0.8443, 0.1233]}, {"w": "it", "b": [0.8502, 0.1049, 0.8633, 0.1233]}, {"w": "slightly", "b": [0.1289, 0.124, 0.1997, 0.1425]}, {"w": "adjusts", "b": [0.2056, 0.124, 0.2712, 0.1425]}, {"w": "the", "b": [0.2772, 0.124, 0.306, 0.1425]}, {"w": "more", "b": [0.3119, 0.124, 0.3604, 0.1425]}, {"w": "abstract", "b": [0.3663, 0.124, 0.4398, 0.1425]}, {"w": "representations", "b": [0.4457, 0.124, 0.5887, 0.1425]}, {"w": "of", "b": [0.5946, 0.124, 0.6142, 0.1425]}, {"w": "the", "b": [0.6201, 0.124, 0.649, 0.1425]}, {"w": "model", "b": [0.6549, 0.124, 0.7139, 0.1425]}, {"w": "being", "b": [0.7198, 0.124, 0.7723, 0.1425]}, {"w": "reused,", "b": [0.7782, 0.124, 0.8457, 0.1425]}, {"w": "in", "b": [0.8517, 0.124, 0.87, 0.1425]}, {"w": "order", "b": [0.1289, 0.1432, 0.1787, 0.1617]}, {"w": "to", "b": [0.1846, 0.1432, 0.203, 0.1617]}, {"w": "make", "b": [0.2089, 0.1432, 0.26, 0.1617]}, {"w": "them", "b": [0.2659, 0.1432, 0.3132, 0.1617]}, {"w": "more", "b": [0.3191, 0.1432, 0.3676, 0.1617]}, {"w": "relevant", "b": [0.3735, 0.1432, 0.4496, 0.1617]}, {"w": "for", "b": [0.4554, 0.1432, 0.4829, 0.1617]}, {"w": "the", "b": [0.4888, 0.1432, 0.5177, 0.1617]}, {"w": "problem", "b": [0.5236, 0.1432, 0.6023, 0.1617]}, {"w": "at", "b": [0.6082, 0.1432, 0.6253, 0.1617]}, {"w": "hand.", "b": [0.6312, 0.1432, 0.683, 0.1617]}]}, {"id": "b_1", "type": "equation", "text": "Figure 5.19. Fine-tuning the last convolutional block of the VGG16 network", "words": [{"w": "Figure", "b": [0.1289, 0.1828, 0.1787, 0.1967]}, {"w": "5.19.", "b": [0.1832, 0.1828, 0.2186, 0.1967]}, {"w": "Fine-tuning", "b": [0.223, 0.1828, 0.3116, 0.1967]}, {"w": "the", "b": [0.316, 0.1828, 0.3396, 0.1967]}, {"w": "last", "b": [0.344, 0.1828, 0.3706, 0.1967]}, {"w": "convolutional", "b": [0.375, 0.1828, 0.4774, 0.1967]}, {"w": "block", "b": [0.4818, 0.1828, 0.5231, 0.1967]}, {"w": "of", "b": [0.5276, 0.1828, 0.5423, 0.1967]}, {"w": "the", "b": [0.5467, 0.1828, 0.5704, 0.1967]}, {"w": "VGG16", "b": [0.5748, 0.1828, 0.6328, 0.1967]}, {"w": "network", "b": [0.6373, 0.1828, 0.7002, 0.1967]}]}]}, {"page": 210, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "I stated earlier that it’s necessary to freeze the convolution base of VGG16 in order to be able to train a randomly initialized classifier on top. For the same reason, it’s only possible to fine-tune the top layers of the convolutional base", "words": [{"w": "I", "b": [0.1289, 0.8483, 0.1367, 0.8668]}, {"w": "stated", "b": [0.1426, 0.8483, 0.1977, 0.8668]}, {"w": "earlier", "b": [0.2036, 0.8483, 0.264, 0.8668]}, {"w": "that", "b": [0.2699, 0.8483, 0.3053, 0.8668]}, {"w": "it’s", "b": [0.3112, 0.8483, 0.34, 0.8668]}, {"w": "necessary", "b": [0.3459, 0.8483, 0.4377, 0.8668]}, {"w": "to", "b": [0.4436, 0.8483, 0.462, 0.8668]}, {"w": "freeze", "b": [0.4679, 0.8483, 0.5256, 0.8668]}, {"w": "the", "b": [0.5315, 0.8483, 0.5603, 0.8668]}, {"w": "convolution", "b": [0.5662, 0.8483, 0.679, 0.8668]}, {"w": "base", "b": [0.685, 0.8483, 0.7269, 0.8668]}, {"w": "of", "b": [0.7328, 0.8483, 0.7525, 0.8668]}, {"w": "VGG16", "b": [0.7584, 0.8483, 0.8332, 0.8668]}, {"w": "in", "b": [0.8391, 0.8483, 0.8574, 0.8668]}, {"w": "order", "b": [0.1289, 0.8675, 0.1787, 0.886]}, {"w": "to", "b": [0.1846, 0.8675, 0.203, 0.886]}, {"w": "be", "b": [0.2089, 0.8675, 0.2312, 0.886]}, {"w": "able", "b": [0.2371, 0.8675, 0.2764, 0.886]}, {"w": "to", "b": [0.2823, 0.8675, 0.3007, 0.886]}, {"w": "train", "b": [0.3066, 0.8675, 0.3499, 0.886]}, {"w": "a", "b": [0.3558, 0.8675, 0.3663, 0.886]}, {"w": "randomly", "b": [0.3722, 0.8675, 0.4627, 0.886]}, {"w": "initialized", "b": [0.4686, 0.8675, 0.5631, 0.886]}, {"w": "classifier", "b": [0.5689, 0.8675, 0.6541, 0.886]}, {"w": "on", "b": [0.66, 0.8675, 0.6836, 0.886]}, {"w": "top.", "b": [0.6895, 0.8675, 0.7256, 0.886]}, {"w": "For", "b": [0.7315, 0.8675, 0.7643, 0.886]}, {"w": "the", "b": [0.7702, 0.8675, 0.7991, 0.886]}, {"w": "same", "b": [0.805, 0.8675, 0.8535, 0.886]}, {"w": "reason,", "b": [0.1289, 0.8867, 0.1964, 0.9052]}, {"w": "it’s", "b": [0.2023, 0.8867, 0.2312, 0.9052]}, {"w": "only", "b": [0.2371, 0.8867, 0.2791, 0.9052]}, {"w": "possible", "b": [0.285, 0.8867, 0.3624, 0.9052]}, {"w": "to", "b": [0.3683, 0.8867, 0.3867, 0.9052]}, {"w": "fine-tune", "b": [0.3926, 0.8867, 0.4778, 0.9052]}, {"w": "the", "b": [0.4837, 0.8867, 0.5126, 0.9052]}, {"w": "top", "b": [0.5185, 0.8867, 0.5487, 0.9052]}, {"w": "layers", "b": [0.5546, 0.8867, 0.611, 0.9052]}, {"w": "of", "b": [0.6169, 0.8867, 0.6365, 0.9052]}, {"w": "the", "b": [0.6424, 0.8867, 0.6713, 0.9052]}, {"w": "convolutional", "b": [0.6772, 0.8867, 0.8071, 0.9052]}, {"w": "base", "b": [0.813, 0.8867, 0.8549, 0.9052]}]}]}, {"page": 211, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "once the classifier on top has already been trained. If the classifier isn’t already trained, then the error signal propagating through the network during training will be too large, and the representations previously learned by the layers being fine-tuned will be destroyed. Thus the steps for fine-tuning a network are as follow:", "words": [{"w": "once", "b": [0.1289, 0.0857, 0.1735, 0.1041]}, {"w": "the", "b": [0.1794, 0.0857, 0.2082, 0.1041]}, {"w": "classifier", "b": [0.2141, 0.0857, 0.2994, 0.1041]}, {"w": "on", "b": [0.3053, 0.0857, 0.3289, 0.1041]}, {"w": "top", "b": [0.3348, 0.0857, 0.365, 0.1041]}, {"w": "has", "b": [0.3709, 0.0857, 0.4023, 0.1041]}, {"w": "already", "b": [0.4082, 0.0857, 0.4777, 0.1041]}, {"w": "been", "b": [0.4836, 0.0857, 0.5282, 0.1041]}, {"w": "trained.", "b": [0.5341, 0.0857, 0.6056, 0.1041]}, {"w": "If", "b": [0.6115, 0.0857, 0.6273, 0.1041]}, {"w": "the", "b": [0.6332, 0.0857, 0.662, 0.1041]}, {"w": "classifier", "b": [0.6679, 0.0857, 0.7532, 0.1041]}, {"w": "isn’t", "b": [0.7591, 0.0857, 0.8006, 0.1041]}, {"w": "already", "b": [0.1289, 0.1049, 0.1984, 0.1233]}, {"w": "trained,", "b": [0.2043, 0.1049, 0.2758, 0.1233]}, {"w": "then", "b": [0.2817, 0.1049, 0.3223, 0.1233]}, {"w": "the", "b": [0.3282, 0.1049, 0.3571, 0.1233]}, {"w": "error", "b": [0.363, 0.1049, 0.4089, 0.1233]}, {"w": "signal", "b": [0.4148, 0.1049, 0.4712, 0.1233]}, {"w": "propagating", "b": [0.4771, 0.1049, 0.5899, 0.1233]}, {"w": "through", "b": [0.5958, 0.1049, 0.6693, 0.1233]}, {"w": "the", "b": [0.6751, 0.1049, 0.704, 0.1233]}, {"w": "network", "b": [0.7099, 0.1049, 0.7872, 0.1233]}, {"w": "during", "b": [0.7931, 0.1049, 0.8548, 0.1233]}, {"w": "training", "b": [0.1289, 0.124, 0.2023, 0.1425]}, {"w": "will", "b": [0.2082, 0.124, 0.245, 0.1425]}, {"w": "be", "b": [0.2509, 0.124, 0.2732, 0.1425]}, {"w": "too", "b": [0.2791, 0.124, 0.3093, 0.1425]}, {"w": "large,", "b": [0.3152, 0.124, 0.3678, 0.1425]}, {"w": "and", "b": [0.3737, 0.124, 0.4078, 0.1425]}, {"w": "the", "b": [0.4137, 0.124, 0.4426, 0.1425]}, {"w": "representations", "b": [0.4485, 0.124, 0.5914, 0.1425]}, {"w": "previously", "b": [0.5974, 0.124, 0.6971, 0.1425]}, {"w": "learned", "b": [0.703, 0.124, 0.7725, 0.1425]}, {"w": "by", "b": [0.7784, 0.124, 0.802, 0.1425]}, {"w": "the", "b": [0.8079, 0.124, 0.8367, 0.1425]}, {"w": "layers", "b": [0.1289, 0.1432, 0.1853, 0.1617]}, {"w": "being", "b": [0.1912, 0.1432, 0.2436, 0.1617]}, {"w": "fine-tuned", "b": [0.2495, 0.1432, 0.3466, 0.1617]}, {"w": "will", "b": [0.3525, 0.1432, 0.3893, 0.1617]}, {"w": "be", "b": [0.3951, 0.1432, 0.4174, 0.1617]}, {"w": "destroyed.", "b": [0.4233, 0.1432, 0.521, 0.1617]}, {"w": "Thus", "b": [0.5269, 0.1432, 0.5742, 0.1617]}, {"w": "the", "b": [0.5801, 0.1432, 0.6089, 0.1617]}, {"w": "steps", "b": [0.6148, 0.1432, 0.6621, 0.1617]}, {"w": "for", "b": [0.668, 0.1432, 0.6955, 0.1617]}, {"w": "fine-tuning", "b": [0.7014, 0.1432, 0.8063, 0.1617]}, {"w": "a", "b": [0.8122, 0.1432, 0.8227, 0.1617]}, {"w": "network", "b": [0.1289, 0.1624, 0.2063, 0.1809]}, {"w": "are", "b": [0.2122, 0.1624, 0.241, 0.1809]}, {"w": "as", "b": [0.2469, 0.1624, 0.2666, 0.1809]}, {"w": "follow:", "b": [0.2725, 0.1624, 0.3407, 0.1809]}]}, {"id": "b_1", "type": "paragraph", "text": "1. Add your custom network on top of an already-trained base network. 2. Freeze the base network. 3. Train the part you added. 4. Unfreeze some layers in the base network. 5. Jointly train both these layers and the part you added.", "words": [{"w": "1.", "b": [0.1529, 0.1983, 0.1706, 0.2168]}, {"w": "Add", "b": [0.1761, 0.1983, 0.2168, 0.2168]}, {"w": "your", "b": [0.2227, 0.1983, 0.266, 0.2168]}, {"w": "custom", "b": [0.2719, 0.1983, 0.3401, 0.2168]}, {"w": "network", "b": [0.346, 0.1983, 0.4234, 0.2168]}, {"w": "on", "b": [0.4293, 0.1983, 0.4529, 0.2168]}, {"w": "top", "b": [0.4588, 0.1983, 0.489, 0.2168]}, {"w": "of", "b": [0.4949, 0.1983, 0.5146, 0.2168]}, {"w": "an", "b": [0.5205, 0.1983, 0.5427, 0.2168]}, {"w": "already-trained", "b": [0.5487, 0.1983, 0.6916, 0.2168]}, {"w": "base", "b": [0.6975, 0.1983, 0.7395, 0.2168]}, {"w": "network.", "b": [0.7454, 0.1983, 0.8287, 0.2168]}, {"w": "2.", "b": [0.1529, 0.2175, 0.1706, 0.236]}, {"w": "Freeze", "b": [0.1761, 0.2175, 0.239, 0.236]}, {"w": "the", "b": [0.2449, 0.2175, 0.2738, 0.236]}, {"w": "base", "b": [0.2797, 0.2175, 0.3217, 0.236]}, {"w": "network.", "b": [0.3276, 0.2175, 0.4109, 0.236]}, {"w": "3.", "b": [0.1529, 0.2367, 0.1706, 0.2552]}, {"w": "Train", "b": [0.1761, 0.2367, 0.2264, 0.2552]}, {"w": "the", "b": [0.2323, 0.2367, 0.2612, 0.2552]}, {"w": "part", "b": [0.2671, 0.2367, 0.3038, 0.2552]}, {"w": "you", "b": [0.3097, 0.2367, 0.3451, 0.2552]}, {"w": "added.", "b": [0.351, 0.2367, 0.4133, 0.2552]}, {"w": "4.", "b": [0.1529, 0.2559, 0.1706, 0.2744]}, {"w": "Unfreeze", "b": [0.1761, 0.2559, 0.2626, 0.2744]}, {"w": "some", "b": [0.2685, 0.2559, 0.3184, 0.2744]}, {"w": "layers", "b": [0.3243, 0.2559, 0.3807, 0.2744]}, {"w": "in", "b": [0.3866, 0.2559, 0.405, 0.2744]}, {"w": "the", "b": [0.4109, 0.2559, 0.4397, 0.2744]}, {"w": "base", "b": [0.4456, 0.2559, 0.4876, 0.2744]}, {"w": "network.", "b": [0.4935, 0.2559, 0.5768, 0.2744]}, {"w": "5.", "b": [0.1529, 0.2751, 0.1706, 0.2936]}, {"w": "Jointly", "b": [0.1761, 0.2751, 0.2404, 0.2936]}, {"w": "train", "b": [0.2463, 0.2751, 0.2896, 0.2936]}, {"w": "both", "b": [0.2955, 0.2751, 0.3375, 0.2936]}, {"w": "these", "b": [0.3434, 0.2751, 0.3919, 0.2936]}, {"w": "layers", "b": [0.3978, 0.2751, 0.4542, 0.2936]}, {"w": "and", "b": [0.4601, 0.2751, 0.4942, 0.2936]}, {"w": "the", "b": [0.5001, 0.2751, 0.529, 0.2936]}, {"w": "part", "b": [0.5349, 0.2751, 0.5716, 0.2936]}, {"w": "you", "b": [0.5775, 0.2751, 0.6129, 0.2936]}, {"w": "added.", "b": [0.6188, 0.2751, 0.6811, 0.2936]}]}, {"id": "b_2", "type": "paragraph", "text": "You already completed the first three steps when doing feature extraction. Let’s proceed with step 4: you’ll unfreeze your conv_base and then freeze individual layers inside it.", "words": [{"w": "You", "b": [0.1289, 0.3151, 0.1672, 0.3336]}, {"w": "already", "b": [0.1731, 0.3151, 0.2426, 0.3336]}, {"w": "completed", "b": [0.2485, 0.3151, 0.3469, 0.3336]}, {"w": "the", "b": [0.3528, 0.3151, 0.3816, 0.3336]}, {"w": "first", "b": [0.3875, 0.3151, 0.4256, 0.3336]}, {"w": "three", "b": [0.4315, 0.3151, 0.4787, 0.3336]}, {"w": "steps", "b": [0.4846, 0.3151, 0.5318, 0.3336]}, {"w": "when", "b": [0.5377, 0.3151, 0.5889, 0.3336]}, {"w": "doing", "b": [0.5948, 0.3151, 0.6486, 0.3336]}, {"w": "feature", "b": [0.6545, 0.3151, 0.72, 0.3336]}, {"w": "extraction.", "b": [0.7259, 0.3151, 0.8263, 0.3336]}, {"w": "Let’s", "b": [0.1289, 0.3343, 0.1761, 0.3528]}, {"w": "proceed", "b": [0.182, 0.3343, 0.2567, 0.3528]}, {"w": "with", "b": [0.2626, 0.3343, 0.3046, 0.3528]}, {"w": "step", "b": [0.3105, 0.3343, 0.3486, 0.3528]}, {"w": "4:", "b": [0.3545, 0.3343, 0.3728, 0.3528]}, {"w": "you’ll", "b": [0.3788, 0.3343, 0.4352, 0.3528]}, {"w": "unfreeze", "b": [0.4411, 0.3343, 0.5224, 0.3528]}, {"w": "your", "b": [0.5283, 0.3343, 0.5715, 0.3528]}, {"w": "conv_base", "b": [0.5774, 0.3353, 0.7049, 0.3542]}, {"w": "and", "b": [0.7108, 0.3343, 0.7449, 0.3528]}, {"w": "then", "b": [0.7508, 0.3343, 0.7915, 0.3528]}, {"w": "freeze", "b": [0.7974, 0.3343, 0.8551, 0.3528]}, {"w": "individual", "b": [0.1289, 0.3543, 0.2247, 0.3728]}, {"w": "layers", "b": [0.2306, 0.3543, 0.287, 0.3728]}, {"w": "inside", "b": [0.2929, 0.3543, 0.3493, 0.3728]}, {"w": "it.", "b": [0.3552, 0.3543, 0.3742, 0.3728]}]}, {"id": "b_3", "type": "paragraph", "text": "As a reminder, this is what your convolutional base looks like:", "words": [{"w": "As", "b": [0.1289, 0.3944, 0.1551, 0.4129]}, {"w": "a", "b": [0.161, 0.3944, 0.1715, 0.4129]}, {"w": "reminder,", "b": [0.1774, 0.3944, 0.2676, 0.4129]}, {"w": "this", "b": [0.2735, 0.3944, 0.3076, 0.4129]}, {"w": "is", "b": [0.3135, 0.3944, 0.3293, 0.4129]}, {"w": "what", "b": [0.3352, 0.3944, 0.3811, 0.4129]}, {"w": "your", "b": [0.387, 0.3944, 0.4303, 0.4129]}, {"w": "convolutional", "b": [0.4362, 0.3944, 0.5661, 0.4129]}, {"w": "base", "b": [0.572, 0.3944, 0.6139, 0.4129]}, {"w": "looks", "b": [0.6198, 0.3944, 0.671, 0.4129]}, {"w": "like:", "b": [0.6769, 0.3944, 0.7189, 0.4129]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> conv_base.summary() Layer (type) Output Shape Param # ================================================================ input_1 (InputLayer) (None, 150, 150, 3) 0 ________________________________________________________________ block1_conv1 (Convolution2D) (None, 150, 150, 64) 1792 ________________________________________________________________ block1_conv2 (Convolution2D) (None, 150, 150, 64) 36928 ________________________________________________________________ block1_pool (MaxPooling2D) (None, 75, 75, 64) 0 ________________________________________________________________ block2_conv1 (Convolution2D) (None, 75, 75, 128) 73856 ________________________________________________________________ block2_conv2 (Convolution2D) (None, 75, 75, 128) 147584 ________________________________________________________________ block2_pool (MaxPooling2D) (None, 37, 37, 128) 0 ________________________________________________________________ block3_conv1 (Convolution2D) (None, 37, 37, 256) 295168 ________________________________________________________________ block3_conv2 (Convolution2D) (None, 37, 37, 256) 590080 ________________________________________________________________ block3_conv3 (Convolution2D) (None, 37, 37, 256) 590080 ________________________________________________________________ block3_pool (MaxPooling2D) (None, 18, 18, 256) 0 ________________________________________________________________ block4_conv1 (Convolution2D) (None, 18, 18, 512) 1180160 ________________________________________________________________ block4_conv2 (Convolution2D) (None, 18, 18, 512) 2359808 ________________________________________________________________ block4_conv3 (Convolution2D) (None, 18, 18, 512) 2359808 ________________________________________________________________ block4_pool (MaxPooling2D) (None, 9, 9, 512) 0 ________________________________________________________________", "words": [{"w": ">>>", "b": [0.1348, 0.4297, 0.1667, 0.4439]}, {"w": "conv_base.summary()", "b": [0.1773, 0.4297, 0.3792, 0.4439]}, {"w": "Layer", "b": [0.1348, 0.4439, 0.1879, 0.4581]}, {"w": "(type)", "b": [0.1985, 0.4439, 0.2623, 0.4581]}, {"w": "Output", "b": [0.4855, 0.4439, 0.5492, 0.4581]}, {"w": "Shape", "b": [0.5598, 0.4439, 0.613, 0.4581]}, {"w": "Param", "b": [0.7192, 0.4439, 0.7724, 0.4581]}, {"w": "#", "b": [0.783, 0.4439, 0.7936, 0.4581]}, {"w": "================================================================", "b": [0.1348, 0.4581, 0.8149, 0.4723]}, {"w": "input_1", "b": [0.1348, 0.4723, 0.2092, 0.4864]}, {"w": "(InputLayer)", "b": [0.2198, 0.4723, 0.3473, 0.4864]}, {"w": "(None,", "b": [0.4855, 0.4723, 0.5492, 0.4864]}, {"w": "150,", "b": [0.5598, 0.4723, 0.6024, 0.4864]}, {"w": "150,", "b": [0.613, 0.4723, 0.6555, 0.4864]}, {"w": "3)", "b": [0.6661, 0.4723, 0.6874, 0.4864]}, {"w": "0", "b": [0.7192, 0.4723, 0.7299, 0.4864]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4865, 0.8149, 0.5006]}, {"w": "block1_conv1", "b": [0.1348, 0.5006, 0.2623, 0.5148]}, {"w": "(Convolution2D)", "b": [0.2729, 0.5006, 0.4323, 0.5148]}, {"w": "(None,", "b": [0.4855, 0.5006, 0.5492, 0.5148]}, {"w": "150,", "b": [0.5598, 0.5006, 0.6024, 0.5148]}, {"w": "150,", "b": [0.613, 0.5006, 0.6555, 0.5148]}, {"w": "64)", "b": [0.6661, 0.5006, 0.698, 0.5148]}, {"w": "1792", "b": [0.7192, 0.5006, 0.7618, 0.5148]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5148, 0.8149, 0.529]}, {"w": "block1_conv2", "b": [0.1348, 0.529, 0.2623, 0.5432]}, {"w": "(Convolution2D)", "b": [0.2729, 0.529, 0.4323, 0.5432]}, {"w": "(None,", "b": [0.4855, 0.529, 0.5492, 0.5432]}, {"w": "150,", "b": [0.5598, 0.529, 0.6024, 0.5432]}, {"w": "150,", "b": [0.613, 0.529, 0.6555, 0.5432]}, {"w": "64)", "b": [0.6661, 0.529, 0.698, 0.5432]}, {"w": "36928", "b": [0.7192, 0.529, 0.7724, 0.5432]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5432, 0.8149, 0.5574]}, {"w": "block1_pool", "b": [0.1348, 0.5574, 0.2517, 0.5716]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.5574, 0.4111, 0.5716]}, {"w": "(None,", "b": [0.4855, 0.5574, 0.5492, 0.5716]}, {"w": "75,", "b": [0.5598, 0.5574, 0.5917, 0.5716]}, {"w": "75,", "b": [0.6024, 0.5574, 0.6342, 0.5716]}, {"w": "64)", "b": [0.6449, 0.5574, 0.6767, 0.5716]}, {"w": "0", "b": [0.7192, 0.5574, 0.7299, 0.5716]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5716, 0.8149, 0.5857]}, {"w": "block2_conv1", "b": [0.1348, 0.5857, 0.2623, 0.5999]}, {"w": "(Convolution2D)", "b": [0.2729, 0.5857, 0.4323, 0.5999]}, {"w": "(None,", "b": [0.4855, 0.5857, 0.5492, 0.5999]}, {"w": "75,", "b": [0.5598, 0.5857, 0.5917, 0.5999]}, {"w": "75,", "b": [0.6024, 0.5857, 0.6342, 0.5999]}, {"w": "128)", "b": [0.6449, 0.5857, 0.6874, 0.5999]}, {"w": "73856", "b": [0.7192, 0.5857, 0.7724, 0.5999]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5999, 0.8149, 0.6141]}, {"w": "block2_conv2", "b": [0.1348, 0.6141, 0.2623, 0.6283]}, {"w": "(Convolution2D)", "b": [0.2729, 0.6141, 0.4323, 0.6283]}, {"w": "(None,", "b": [0.4855, 0.6141, 0.5492, 0.6283]}, {"w": "75,", "b": [0.5598, 0.6141, 0.5917, 0.6283]}, {"w": "75,", "b": [0.6024, 0.6141, 0.6342, 0.6283]}, {"w": "128)", "b": [0.6449, 0.6141, 0.6874, 0.6283]}, {"w": "147584", "b": [0.7192, 0.6141, 0.783, 0.6283]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6283, 0.8149, 0.6425]}, {"w": "block2_pool", "b": [0.1348, 0.6425, 0.2517, 0.6567]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.6425, 0.4111, 0.6567]}, {"w": "(None,", "b": [0.4855, 0.6425, 0.5492, 0.6567]}, {"w": "37,", "b": [0.5598, 0.6425, 0.5917, 0.6567]}, {"w": "37,", "b": [0.6024, 0.6425, 0.6342, 0.6567]}, {"w": "128)", "b": [0.6449, 0.6425, 0.6874, 0.6567]}, {"w": "0", "b": [0.7192, 0.6425, 0.7299, 0.6567]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6567, 0.8149, 0.6708]}, {"w": "block3_conv1", "b": [0.1348, 0.6709, 0.2623, 0.685]}, {"w": "(Convolution2D)", "b": [0.2729, 0.6709, 0.4323, 0.685]}, {"w": "(None,", "b": [0.4855, 0.6709, 0.5492, 0.685]}, {"w": "37,", "b": [0.5598, 0.6709, 0.5917, 0.685]}, {"w": "37,", "b": [0.6024, 0.6709, 0.6342, 0.685]}, {"w": "256)", "b": [0.6449, 0.6709, 0.6874, 0.685]}, {"w": "295168", "b": [0.7192, 0.6709, 0.783, 0.685]}, {"w": "________________________________________________________________", "b": [0.1348, 0.685, 0.8149, 0.6992]}, {"w": "block3_conv2", "b": [0.1348, 0.6992, 0.2623, 0.7134]}, {"w": "(Convolution2D)", "b": [0.2729, 0.6992, 0.4323, 0.7134]}, {"w": "(None,", "b": [0.4855, 0.6992, 0.5492, 0.7134]}, {"w": "37,", "b": [0.5598, 0.6992, 0.5917, 0.7134]}, {"w": "37,", "b": [0.6024, 0.6992, 0.6342, 0.7134]}, {"w": "256)", "b": [0.6449, 0.6992, 0.6874, 0.7134]}, {"w": "590080", "b": [0.7192, 0.6992, 0.783, 0.7134]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7134, 0.8149, 0.7276]}, {"w": "block3_conv3", "b": [0.1348, 0.7276, 0.2623, 0.7418]}, {"w": "(Convolution2D)", "b": [0.2729, 0.7276, 0.4323, 0.7418]}, {"w": "(None,", "b": [0.4855, 0.7276, 0.5492, 0.7418]}, {"w": "37,", "b": [0.5598, 0.7276, 0.5917, 0.7418]}, {"w": "37,", "b": [0.6024, 0.7276, 0.6342, 0.7418]}, {"w": "256)", "b": [0.6449, 0.7276, 0.6874, 0.7418]}, {"w": "590080", "b": [0.7192, 0.7276, 0.783, 0.7418]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7418, 0.8149, 0.756]}, {"w": "block3_pool", "b": [0.1348, 0.756, 0.2517, 0.7701]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.756, 0.4111, 0.7701]}, {"w": "(None,", "b": [0.4855, 0.756, 0.5492, 0.7701]}, {"w": "18,", "b": [0.5598, 0.756, 0.5917, 0.7701]}, {"w": "18,", "b": [0.6024, 0.756, 0.6342, 0.7701]}, {"w": "256)", "b": [0.6449, 0.756, 0.6874, 0.7701]}, {"w": "0", "b": [0.7192, 0.756, 0.7299, 0.7701]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7701, 0.8149, 0.7843]}, {"w": "block4_conv1", "b": [0.1348, 0.7843, 0.2623, 0.7985]}, {"w": "(Convolution2D)", "b": [0.2729, 0.7843, 0.4323, 0.7985]}, {"w": "(None,", "b": [0.4855, 0.7843, 0.5492, 0.7985]}, {"w": "18,", "b": [0.5598, 0.7843, 0.5917, 0.7985]}, {"w": "18,", "b": [0.6024, 0.7843, 0.6342, 0.7985]}, {"w": "512)", "b": [0.6449, 0.7843, 0.6874, 0.7985]}, {"w": "1180160", "b": [0.7192, 0.7843, 0.7936, 0.7985]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7985, 0.8149, 0.8127]}, {"w": "block4_conv2", "b": [0.1348, 0.8127, 0.2623, 0.8269]}, {"w": "(Convolution2D)", "b": [0.2729, 0.8127, 0.4323, 0.8269]}, {"w": "(None,", "b": [0.4855, 0.8127, 0.5492, 0.8269]}, {"w": "18,", "b": [0.5598, 0.8127, 0.5917, 0.8269]}, {"w": "18,", "b": [0.6024, 0.8127, 0.6342, 0.8269]}, {"w": "512)", "b": [0.6449, 0.8127, 0.6874, 0.8269]}, {"w": "2359808", "b": [0.7192, 0.8127, 0.7936, 0.8269]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8269, 0.8149, 0.8411]}, {"w": "block4_conv3", "b": [0.1348, 0.8411, 0.2623, 0.8552]}, {"w": "(Convolution2D)", "b": [0.2729, 0.8411, 0.4323, 0.8552]}, {"w": "(None,", "b": [0.4855, 0.8411, 0.5492, 0.8552]}, {"w": "18,", "b": [0.5598, 0.8411, 0.5917, 0.8552]}, {"w": "18,", "b": [0.6024, 0.8411, 0.6342, 0.8552]}, {"w": "512)", "b": [0.6449, 0.8411, 0.6874, 0.8552]}, {"w": "2359808", "b": [0.7192, 0.8411, 0.7936, 0.8552]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8553, 0.8149, 0.8694]}, {"w": "block4_pool", "b": [0.1348, 0.8694, 0.2517, 0.8836]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.8694, 0.4111, 0.8836]}, {"w": "(None,", "b": [0.4855, 0.8694, 0.5492, 0.8836]}, {"w": "9,", "b": [0.5598, 0.8694, 0.5811, 0.8836]}, {"w": "9,", "b": [0.5917, 0.8694, 0.613, 0.8836]}, {"w": "512)", "b": [0.6236, 0.8694, 0.6661, 0.8836]}, {"w": "0", "b": [0.7192, 0.8694, 0.7299, 0.8836]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8978, 0.8149, 0.912]}]}]}, {"page": 212, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "block5_conv1 (Convolution2D) (None, 9, 9, 512) 2359808 ________________________________________________________________ block5_conv2 (Convolution2D) (None, 9, 9, 512) 2359808 ________________________________________________________________ block5_conv3 (Convolution2D) (None, 9, 9, 512) 2359808 ________________________________________________________________ block5_pool (MaxPooling2D) (None, 4, 4, 512) 0 ================================================================ Total params: 14714688", "words": [{"w": "block5_conv1", "b": [0.1348, 0.0851, 0.2623, 0.0993]}, {"w": "(Convolution2D)", "b": [0.2729, 0.0851, 0.4323, 0.0993]}, {"w": "(None,", "b": [0.4855, 0.0851, 0.5492, 0.0993]}, {"w": "9,", "b": [0.5598, 0.0851, 0.5811, 0.0993]}, {"w": "9,", "b": [0.5917, 0.0851, 0.613, 0.0993]}, {"w": "512)", "b": [0.6236, 0.0851, 0.6661, 0.0993]}, {"w": "2359808", "b": [0.7192, 0.0851, 0.7936, 0.0993]}, {"w": "________________________________________________________________", "b": [0.1348, 0.0993, 0.8149, 0.1135]}, {"w": "block5_conv2", "b": [0.1348, 0.1135, 0.2623, 0.1277]}, {"w": "(Convolution2D)", "b": [0.2729, 0.1135, 0.4323, 0.1277]}, {"w": "(None,", "b": [0.4855, 0.1135, 0.5492, 0.1277]}, {"w": "9,", "b": [0.5598, 0.1135, 0.5811, 0.1277]}, {"w": "9,", "b": [0.5917, 0.1135, 0.613, 0.1277]}, {"w": "512)", "b": [0.6236, 0.1135, 0.6661, 0.1277]}, {"w": "2359808", "b": [0.7192, 0.1135, 0.7936, 0.1277]}, {"w": "________________________________________________________________", "b": [0.1348, 0.1277, 0.8149, 0.1418]}, {"w": "block5_conv3", "b": [0.1348, 0.1419, 0.2623, 0.156]}, {"w": "(Convolution2D)", "b": [0.2729, 0.1419, 0.4323, 0.156]}, {"w": "(None,", "b": [0.4855, 0.1419, 0.5492, 0.156]}, {"w": "9,", "b": [0.5598, 0.1419, 0.5811, 0.156]}, {"w": "9,", "b": [0.5917, 0.1419, 0.613, 0.156]}, {"w": "512)", "b": [0.6236, 0.1419, 0.6661, 0.156]}, {"w": "2359808", "b": [0.7192, 0.1419, 0.7936, 0.156]}, {"w": "________________________________________________________________", "b": [0.1348, 0.156, 0.8149, 0.1702]}, {"w": "block5_pool", "b": [0.1348, 0.1702, 0.2517, 0.1844]}, {"w": "(MaxPooling2D)", "b": [0.2623, 0.1702, 0.4111, 0.1844]}, {"w": "(None,", "b": [0.4855, 0.1702, 0.5492, 0.1844]}, {"w": "4,", "b": [0.5598, 0.1702, 0.5811, 0.1844]}, {"w": "4,", "b": [0.5917, 0.1702, 0.613, 0.1844]}, {"w": "512)", "b": [0.6236, 0.1702, 0.6661, 0.1844]}, {"w": "0", "b": [0.7192, 0.1702, 0.7299, 0.1844]}, {"w": "================================================================", "b": [0.1348, 0.1844, 0.8149, 0.1986]}, {"w": "Total", "b": [0.1348, 0.1986, 0.1879, 0.2128]}, {"w": "params:", "b": [0.1985, 0.1986, 0.2729, 0.2128]}, {"w": "14714688", "b": [0.2836, 0.1986, 0.3686, 0.2128]}]}, {"id": "b_1", "type": "paragraph", "text": "You’ll fine-tune the last three convolutional layers, which means all layers up to block4_pool should be frozen, and the layers block5_conv1, block5_conv2, and block5_conv3 should be trainable.", "words": [{"w": "You’ll", "b": [0.1289, 0.2342, 0.1882, 0.2527]}, {"w": "fine-tune", "b": [0.1941, 0.2342, 0.2793, 0.2527]}, {"w": "the", "b": [0.2852, 0.2342, 0.3141, 0.2527]}, {"w": "last", "b": [0.32, 0.2342, 0.3528, 0.2527]}, {"w": "three", "b": [0.3587, 0.2342, 0.4059, 0.2527]}, {"w": "convolutional", "b": [0.4118, 0.2342, 0.5417, 0.2527]}, {"w": "layers,", "b": [0.5476, 0.2342, 0.6099, 0.2527]}, {"w": "which", "b": [0.6158, 0.2342, 0.6735, 0.2527]}, {"w": "means", "b": [0.6794, 0.2342, 0.7397, 0.2527]}, {"w": "all", "b": [0.7456, 0.2342, 0.7693, 0.2527]}, {"w": "layers", "b": [0.7752, 0.2342, 0.8316, 0.2527]}, {"w": "up", "b": [0.8375, 0.2342, 0.8611, 0.2527]}, {"w": "to", "b": [0.1289, 0.2534, 0.1472, 0.2719]}, {"w": "block4_pool", "b": [0.1531, 0.2544, 0.309, 0.2733]}, {"w": "should", "b": [0.3149, 0.2534, 0.3779, 0.2719]}, {"w": "be", "b": [0.3838, 0.2534, 0.4061, 0.2719]}, {"w": "frozen,", "b": [0.412, 0.2534, 0.4782, 0.2719]}, {"w": "and", "b": [0.4841, 0.2534, 0.5182, 0.2719]}, {"w": "the", "b": [0.5241, 0.2534, 0.553, 0.2719]}, {"w": "layers", "b": [0.5589, 0.2534, 0.6153, 0.2719]}, {"w": "block5_conv1,", "b": [0.6211, 0.2534, 0.7971, 0.2733]}, {"w": "block5_conv2,", "b": [0.1289, 0.2734, 0.3048, 0.2933]}, {"w": "and", "b": [0.3107, 0.2734, 0.3448, 0.2919]}, {"w": "block5_conv3", "b": [0.3507, 0.2744, 0.5208, 0.2933]}, {"w": "should", "b": [0.5267, 0.2734, 0.5897, 0.2919]}, {"w": "be", "b": [0.5956, 0.2734, 0.6179, 0.2919]}, {"w": "trainable.", "b": [0.6238, 0.2734, 0.7123, 0.2919]}]}, {"id": "b_2", "type": "paragraph", "text": "Why not fine-tune more layers? Why not fine-tune the entire convolutional base? You could. But you need to consider the following:", "words": [{"w": "Why", "b": [0.1289, 0.3143, 0.1748, 0.3328]}, {"w": "not", "b": [0.1807, 0.3143, 0.2109, 0.3328]}, {"w": "fine-tune", "b": [0.2168, 0.3143, 0.302, 0.3328]}, {"w": "more", "b": [0.3079, 0.3143, 0.3565, 0.3328]}, {"w": "layers?", "b": [0.3624, 0.3143, 0.4292, 0.3328]}, {"w": "Why", "b": [0.4351, 0.3143, 0.481, 0.3328]}, {"w": "not", "b": [0.4869, 0.3143, 0.5171, 0.3328]}, {"w": "fine-tune", "b": [0.523, 0.3143, 0.6083, 0.3328]}, {"w": "the", "b": [0.6142, 0.3143, 0.643, 0.3328]}, {"w": "entire", "b": [0.6489, 0.3143, 0.7027, 0.3328]}, {"w": "convolutional", "b": [0.7086, 0.3143, 0.8385, 0.3328]}, {"w": "base?", "b": [0.1289, 0.3335, 0.1813, 0.352]}, {"w": "You", "b": [0.1872, 0.3335, 0.2255, 0.352]}, {"w": "could.", "b": [0.2314, 0.3335, 0.2898, 0.352]}, {"w": "But", "b": [0.2957, 0.3335, 0.3298, 0.352]}, {"w": "you", "b": [0.3357, 0.3335, 0.3712, 0.352]}, {"w": "need", "b": [0.3771, 0.3335, 0.4216, 0.352]}, {"w": "to", "b": [0.4276, 0.3335, 0.4459, 0.352]}, {"w": "consider", "b": [0.4518, 0.3335, 0.5318, 0.352]}, {"w": "the", "b": [0.5377, 0.3335, 0.5666, 0.352]}, {"w": "following:", "b": [0.5725, 0.3335, 0.6709, 0.352]}]}, {"id": "b_3", "type": "paragraph", "text": "Earlier layers in the convolutional base encode more-generic, reusable features, whereas layers higher up encode more-specialized features. It’s more useful to fine-tune the more specialized features, because these are the ones that need to be repurposed on your new problem. There would be fast-decreasing returns in fine-tuning lower layers. The more parameters you’re training, the more you’re at risk of overfitting. The convolutional base has 15 million parameters, so it would be risky to attempt to train it on your small dataset.", "words": [{"w": "Earlier", "b": [0.1761, 0.3694, 0.2404, 0.3878]}, {"w": "layers", "b": [0.2463, 0.3694, 0.3027, 0.3878]}, {"w": "in", "b": [0.3086, 0.3694, 0.3269, 0.3878]}, {"w": "the", "b": [0.3328, 0.3694, 0.3617, 0.3878]}, {"w": "convolutional", "b": [0.3676, 0.3694, 0.4975, 0.3878]}, {"w": "base", "b": [0.5034, 0.3694, 0.5453, 0.3878]}, {"w": "encode", "b": [0.5512, 0.3694, 0.6181, 0.3878]}, {"w": "more-generic,", "b": [0.624, 0.3694, 0.7558, 0.3878]}, {"w": "reusable", "b": [0.7617, 0.3694, 0.8404, 0.3878]}, {"w": "features,", "b": [0.1761, 0.3886, 0.2567, 0.407]}, {"w": "whereas", "b": [0.2627, 0.3886, 0.34, 0.407]}, {"w": "layers", "b": [0.3459, 0.3886, 0.4023, 0.407]}, {"w": "higher", "b": [0.4082, 0.3886, 0.4686, 0.407]}, {"w": "up", "b": [0.4745, 0.3886, 0.4981, 0.407]}, {"w": "encode", "b": [0.504, 0.3886, 0.5708, 0.407]}, {"w": "more-specialized", "b": [0.5768, 0.3886, 0.7381, 0.407]}, {"w": "features.", "b": [0.7439, 0.3886, 0.8245, 0.407]}, {"w": "It’s", "b": [0.8304, 0.3886, 0.8606, 0.407]}, {"w": "more", "b": [0.1761, 0.4077, 0.2246, 0.4262]}, {"w": "useful", "b": [0.2305, 0.4077, 0.2883, 0.4262]}, {"w": "to", "b": [0.2942, 0.4077, 0.3125, 0.4262]}, {"w": "fine-tune", "b": [0.3184, 0.4077, 0.4037, 0.4262]}, {"w": "the", "b": [0.4096, 0.4077, 0.4384, 0.4262]}, {"w": "more", "b": [0.4443, 0.4077, 0.4929, 0.4262]}, {"w": "specialized", "b": [0.4988, 0.4077, 0.6037, 0.4262]}, {"w": "features,", "b": [0.6096, 0.4077, 0.6902, 0.4262]}, {"w": "because", "b": [0.6961, 0.4077, 0.7709, 0.4262]}, {"w": "these", "b": [0.7768, 0.4077, 0.8253, 0.4262]}, {"w": "are", "b": [0.8312, 0.4077, 0.8601, 0.4262]}, {"w": "the", "b": [0.1761, 0.4269, 0.205, 0.4454]}, {"w": "ones", "b": [0.2109, 0.4269, 0.2542, 0.4454]}, {"w": "that", "b": [0.2601, 0.4269, 0.2955, 0.4454]}, {"w": "need", "b": [0.3014, 0.4269, 0.346, 0.4454]}, {"w": "to", "b": [0.3519, 0.4269, 0.3702, 0.4454]}, {"w": "be", "b": [0.3761, 0.4269, 0.3984, 0.4454]}, {"w": "repurposed", "b": [0.4043, 0.4269, 0.5093, 0.4454]}, {"w": "on", "b": [0.5151, 0.4269, 0.5387, 0.4454]}, {"w": "your", "b": [0.5446, 0.4269, 0.5879, 0.4454]}, {"w": "new", "b": [0.5938, 0.4269, 0.6332, 0.4454]}, {"w": "problem.", "b": [0.6391, 0.4269, 0.7237, 0.4454]}, {"w": "There", "b": [0.7296, 0.4269, 0.7847, 0.4454]}, {"w": "would", "b": [0.7906, 0.4269, 0.8496, 0.4454]}, {"w": "be", "b": [0.1761, 0.4461, 0.1984, 0.4646]}, {"w": "fast-decreasing", "b": [0.2043, 0.4461, 0.3472, 0.4646]}, {"w": "returns", "b": [0.3531, 0.4461, 0.4187, 0.4646]}, {"w": "in", "b": [0.4246, 0.4461, 0.443, 0.4646]}, {"w": "fine-tuning", "b": [0.4489, 0.4461, 0.5538, 0.4646]}, {"w": "lower", "b": [0.5598, 0.4461, 0.6135, 0.4646]}, {"w": "layers.", "b": [0.6194, 0.4461, 0.6817, 0.4646]}, {"w": "The", "b": [0.1761, 0.4653, 0.2128, 0.4838]}, {"w": "more", "b": [0.2187, 0.4653, 0.2673, 0.4838]}, {"w": "parameters", "b": [0.2732, 0.4653, 0.3768, 0.4838]}, {"w": "you’re", "b": [0.3827, 0.4653, 0.4443, 0.4838]}, {"w": "training,", "b": [0.4502, 0.4653, 0.5296, 0.4838]}, {"w": "the", "b": [0.5355, 0.4653, 0.5643, 0.4838]}, {"w": "more", "b": [0.5702, 0.4653, 0.6188, 0.4838]}, {"w": "you’re", "b": [0.6247, 0.4653, 0.6863, 0.4838]}, {"w": "at", "b": [0.6922, 0.4653, 0.7093, 0.4838]}, {"w": "risk", "b": [0.7152, 0.4653, 0.7506, 0.4838]}, {"w": "of", "b": [0.7565, 0.4653, 0.7762, 0.4838]}, {"w": "overfitting.", "b": [0.1761, 0.4845, 0.2817, 0.503]}, {"w": "The", "b": [0.2876, 0.4845, 0.3243, 0.503]}, {"w": "convolutional", "b": [0.3302, 0.4845, 0.4601, 0.503]}, {"w": "base", "b": [0.466, 0.4845, 0.508, 0.503]}, {"w": "has", "b": [0.5139, 0.4845, 0.5454, 0.503]}, {"w": "15", "b": [0.5513, 0.4845, 0.5749, 0.503]}, {"w": "million", "b": [0.5808, 0.4845, 0.649, 0.503]}, {"w": "parameters,", "b": [0.6549, 0.4845, 0.7644, 0.503]}, {"w": "so", "b": [0.7703, 0.4845, 0.7913, 0.503]}, {"w": "it", "b": [0.7972, 0.4845, 0.8103, 0.503]}, {"w": "would", "b": [0.1761, 0.5037, 0.2351, 0.5222]}, {"w": "be", "b": [0.241, 0.5037, 0.2633, 0.5222]}, {"w": "risky", "b": [0.2692, 0.5037, 0.3165, 0.5222]}, {"w": "to", "b": [0.3224, 0.5037, 0.3407, 0.5222]}, {"w": "attempt", "b": [0.3467, 0.5037, 0.4175, 0.5222]}, {"w": "to", "b": [0.4234, 0.5037, 0.4418, 0.5222]}, {"w": "train", "b": [0.4477, 0.5037, 0.491, 0.5222]}, {"w": "it", "b": [0.4969, 0.5037, 0.51, 0.5222]}, {"w": "on", "b": [0.5159, 0.5037, 0.5395, 0.5222]}, {"w": "your", "b": [0.5454, 0.5037, 0.5887, 0.5222]}, {"w": "small", "b": [0.5946, 0.5037, 0.6458, 0.5222]}, {"w": "dataset.", "b": [0.6517, 0.5037, 0.7232, 0.5222]}]}, {"id": "b_4", "type": "paragraph", "text": "Thus, in this situation, it’s a good strategy to fine-tune only the top two or three layers in the convolutional base. Let’s set this up, starting from where you left off in the previous example.", "words": [{"w": "Thus,", "b": [0.1289, 0.5437, 0.182, 0.5622]}, {"w": "in", "b": [0.1879, 0.5437, 0.2063, 0.5622]}, {"w": "this", "b": [0.2122, 0.5437, 0.2463, 0.5622]}, {"w": "situation,", "b": [0.2522, 0.5437, 0.3395, 0.5622]}, {"w": "it’s", "b": [0.3454, 0.5437, 0.3742, 0.5622]}, {"w": "a", "b": [0.3801, 0.5437, 0.3906, 0.5622]}, {"w": "good", "b": [0.3965, 0.5437, 0.4437, 0.5622]}, {"w": "strategy", "b": [0.4496, 0.5437, 0.5244, 0.5622]}, {"w": "to", "b": [0.5303, 0.5437, 0.5487, 0.5622]}, {"w": "fine-tune", "b": [0.5546, 0.5437, 0.6398, 0.5622]}, {"w": "only", "b": [0.6457, 0.5437, 0.6877, 0.5622]}, {"w": "the", "b": [0.6936, 0.5437, 0.7225, 0.5622]}, {"w": "top", "b": [0.7284, 0.5437, 0.7586, 0.5622]}, {"w": "two", "b": [0.7645, 0.5437, 0.7999, 0.5622]}, {"w": "or", "b": [0.8058, 0.5437, 0.8255, 0.5622]}, {"w": "three", "b": [0.1289, 0.5629, 0.1761, 0.5814]}, {"w": "layers", "b": [0.182, 0.5629, 0.2384, 0.5814]}, {"w": "in", "b": [0.2443, 0.5629, 0.2627, 0.5814]}, {"w": "the", "b": [0.2686, 0.5629, 0.2974, 0.5814]}, {"w": "convolutional", "b": [0.3033, 0.5629, 0.4332, 0.5814]}, {"w": "base.", "b": [0.4391, 0.5629, 0.487, 0.5814]}, {"w": "Let’s", "b": [0.4929, 0.5629, 0.54, 0.5814]}, {"w": "set", "b": [0.5459, 0.5629, 0.5722, 0.5814]}, {"w": "this", "b": [0.5781, 0.5629, 0.6122, 0.5814]}, {"w": "up,", "b": [0.6181, 0.5629, 0.6476, 0.5814]}, {"w": "starting", "b": [0.6535, 0.5629, 0.7244, 0.5814]}, {"w": "from", "b": [0.7303, 0.5629, 0.7762, 0.5814]}, {"w": "where", "b": [0.7821, 0.5629, 0.8398, 0.5814]}, {"w": "you", "b": [0.1289, 0.5821, 0.1643, 0.6006]}, {"w": "left", "b": [0.1702, 0.5821, 0.2017, 0.6006]}, {"w": "off", "b": [0.2076, 0.5821, 0.2347, 0.6006]}, {"w": "in", "b": [0.2406, 0.5821, 0.259, 0.6006]}, {"w": "the", "b": [0.2649, 0.5821, 0.2937, 0.6006]}, {"w": "previous", "b": [0.2996, 0.5821, 0.381, 0.6006]}, {"w": "example.", "b": [0.3869, 0.5821, 0.4728, 0.6006]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.22. Freezing all layers up to a specific one", "words": [{"w": "Listing", "b": [0.1289, 0.6176, 0.182, 0.6314]}, {"w": "5.22.", "b": [0.1865, 0.6176, 0.2219, 0.6314]}, {"w": "Freezing", "b": [0.2263, 0.6176, 0.2919, 0.6314]}, {"w": "all", "b": [0.2963, 0.6176, 0.315, 0.6314]}, {"w": "layers", "b": [0.3194, 0.6176, 0.3647, 0.6314]}, {"w": "up", "b": [0.3691, 0.6176, 0.3888, 0.6314]}, {"w": "to", "b": [0.3932, 0.6176, 0.408, 0.6314]}, {"w": "a", "b": [0.4124, 0.6176, 0.4213, 0.6314]}, {"w": "specific", "b": [0.4257, 0.6176, 0.4818, 0.6314]}, {"w": "one", "b": [0.4862, 0.6176, 0.5128, 0.6314]}]}, {"id": "b_6", "type": "paragraph", "text": "conv_base.trainable = True set_trainable = False for layer in conv_base.layers: if layer.name == 'block5_conv1': set_trainable = True if set_trainable: layer.trainable = True else: layer.trainable = False", "words": [{"w": "conv_base.trainable", "b": [0.1348, 0.6442, 0.3367, 0.6583]}, {"w": "=", "b": [0.3473, 0.6442, 0.3579, 0.6583]}, {"w": "True", "b": [0.3686, 0.6442, 0.4111, 0.6583]}, {"w": "set_trainable", "b": [0.1348, 0.6725, 0.2729, 0.6867]}, {"w": "=", "b": [0.2836, 0.6725, 0.2942, 0.6867]}, {"w": "False", "b": [0.3048, 0.6725, 0.3579, 0.6867]}, {"w": "for", "b": [0.1348, 0.6867, 0.1667, 0.7009]}, {"w": "layer", "b": [0.1773, 0.6867, 0.2304, 0.7009]}, {"w": "in", "b": [0.241, 0.6867, 0.2623, 0.7009]}, {"w": "conv_base.layers:", "b": [0.2729, 0.6867, 0.4536, 0.7009]}, {"w": "if", "b": [0.1773, 0.7009, 0.1985, 0.7151]}, {"w": "layer.name", "b": [0.2092, 0.7009, 0.3154, 0.7151]}, {"w": "==", "b": [0.3261, 0.7009, 0.3473, 0.7151]}, {"w": "'block5_conv1':", "b": [0.3579, 0.7009, 0.5173, 0.7151]}, {"w": "set_trainable", "b": [0.2198, 0.7151, 0.3579, 0.7293]}, {"w": "=", "b": [0.3686, 0.7151, 0.3792, 0.7293]}, {"w": "True", "b": [0.3898, 0.7151, 0.4323, 0.7293]}, {"w": "if", "b": [0.1773, 0.7293, 0.1985, 0.7434]}, {"w": "set_trainable:", "b": [0.2092, 0.7293, 0.3579, 0.7434]}, {"w": "layer.trainable", "b": [0.2198, 0.7434, 0.3792, 0.7576]}, {"w": "=", "b": [0.3898, 0.7434, 0.4004, 0.7576]}, {"w": "True", "b": [0.4111, 0.7434, 0.4536, 0.7576]}, {"w": "else:", "b": [0.1773, 0.7576, 0.2304, 0.7718]}, {"w": "layer.trainable", "b": [0.2198, 0.7718, 0.3792, 0.786]}, {"w": "=", "b": [0.3898, 0.7718, 0.4004, 0.786]}, {"w": "False", "b": [0.4111, 0.7718, 0.4642, 0.786]}]}, {"id": "b_7", "type": "paragraph", "text": "Now you can begin fine-tuning the network. You’ll do this with the RMSProp optimizer, using a very low learning rate. The reason for using a low learning rate is that you want to limit the magnitude of the modifications you make to the representations of the three layers you’re fine-tuning. Updates that are too large may harm these representations.", "words": [{"w": "Now", "b": [0.1289, 0.8074, 0.1748, 0.8259]}, {"w": "you", "b": [0.1807, 0.8074, 0.2161, 0.8259]}, {"w": "can", "b": [0.222, 0.8074, 0.2548, 0.8259]}, {"w": "begin", "b": [0.2607, 0.8074, 0.3132, 0.8259]}, {"w": "fine-tuning", "b": [0.3191, 0.8074, 0.424, 0.8259]}, {"w": "the", "b": [0.4299, 0.8074, 0.4588, 0.8259]}, {"w": "network.", "b": [0.4647, 0.8074, 0.548, 0.8259]}, {"w": "You’ll", "b": [0.5539, 0.8074, 0.6131, 0.8259]}, {"w": "do", "b": [0.619, 0.8074, 0.6427, 0.8259]}, {"w": "this", "b": [0.6486, 0.8074, 0.6827, 0.8259]}, {"w": "with", "b": [0.6886, 0.8074, 0.7306, 0.8259]}, {"w": "the", "b": [0.7365, 0.8074, 0.7653, 0.8259]}, {"w": "RMSProp", "b": [0.7712, 0.8074, 0.8657, 0.8259]}, {"w": "optimizer,", "b": [0.1289, 0.8266, 0.2243, 0.8451]}, {"w": "using", "b": [0.2302, 0.8266, 0.2814, 0.8451]}, {"w": "a", "b": [0.2873, 0.8266, 0.2978, 0.8451]}, {"w": "very", "b": [0.3037, 0.8266, 0.3457, 0.8451]}, {"w": "low", "b": [0.3516, 0.8266, 0.387, 0.8451]}, {"w": "learning", "b": [0.3929, 0.8266, 0.4703, 0.8451]}, {"w": "rate.", "b": [0.4762, 0.8266, 0.5175, 0.8451]}, {"w": "The", "b": [0.5234, 0.8266, 0.5601, 0.8451]}, {"w": "reason", "b": [0.566, 0.8266, 0.6276, 0.8451]}, {"w": "for", "b": [0.6335, 0.8266, 0.661, 0.8451]}, {"w": "using", "b": [0.6669, 0.8266, 0.7181, 0.8451]}, {"w": "a", "b": [0.724, 0.8266, 0.7345, 0.8451]}, {"w": "low", "b": [0.7404, 0.8266, 0.7758, 0.8451]}, {"w": "learning", "b": [0.7817, 0.8266, 0.8591, 0.8451]}, {"w": "rate", "b": [0.1289, 0.8458, 0.1643, 0.8643]}, {"w": "is", "b": [0.1702, 0.8458, 0.1859, 0.8643]}, {"w": "that", "b": [0.1918, 0.8458, 0.2273, 0.8643]}, {"w": "you", "b": [0.2332, 0.8458, 0.2686, 0.8643]}, {"w": "want", "b": [0.2745, 0.8458, 0.3204, 0.8643]}, {"w": "to", "b": [0.3263, 0.8458, 0.3447, 0.8643]}, {"w": "limit", "b": [0.3506, 0.8458, 0.3952, 0.8643]}, {"w": "the", "b": [0.4011, 0.8458, 0.43, 0.8643]}, {"w": "magnitude", "b": [0.4359, 0.8458, 0.5356, 0.8643]}, {"w": "of", "b": [0.5415, 0.8458, 0.5611, 0.8643]}, {"w": "the", "b": [0.567, 0.8458, 0.5959, 0.8643]}, {"w": "modifications", "b": [0.6018, 0.8458, 0.7317, 0.8643]}, {"w": "you", "b": [0.7376, 0.8458, 0.773, 0.8643]}, {"w": "make", "b": [0.7789, 0.8458, 0.8301, 0.8643]}, {"w": "to", "b": [0.836, 0.8458, 0.8543, 0.8643]}, {"w": "the", "b": [0.1289, 0.865, 0.1577, 0.8835]}, {"w": "representations", "b": [0.1636, 0.865, 0.3066, 0.8835]}, {"w": "of", "b": [0.3125, 0.865, 0.3321, 0.8835]}, {"w": "the", "b": [0.338, 0.865, 0.3669, 0.8835]}, {"w": "three", "b": [0.3728, 0.865, 0.42, 0.8835]}, {"w": "layers", "b": [0.4259, 0.865, 0.4823, 0.8835]}, {"w": "you’re", "b": [0.4882, 0.865, 0.5498, 0.8835]}, {"w": "fine-tuning.", "b": [0.5557, 0.865, 0.6666, 0.8835]}, {"w": "Updates", "b": [0.6725, 0.865, 0.7499, 0.8835]}, {"w": "that", "b": [0.7558, 0.865, 0.7912, 0.8835]}, {"w": "are", "b": [0.7971, 0.865, 0.8259, 0.8835]}, {"w": "too", "b": [0.8318, 0.865, 0.862, 0.8835]}, {"w": "large", "b": [0.1289, 0.8842, 0.1756, 0.9027]}, {"w": "may", "b": [0.1816, 0.8842, 0.2222, 0.9027]}, {"w": "harm", "b": [0.2281, 0.8842, 0.2766, 0.9027]}, {"w": "these", "b": [0.2826, 0.8842, 0.3311, 0.9027]}, {"w": "representations.", "b": [0.337, 0.8842, 0.4859, 0.9027]}]}]}, {"page": 213, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Listing 5.23. Fine-tuning the model", "words": [{"w": "Listing", "b": [0.1289, 0.0852, 0.182, 0.0991]}, {"w": "5.23.", "b": [0.1865, 0.0852, 0.2219, 0.0991]}, {"w": "Fine-tuning", "b": [0.2263, 0.0852, 0.3149, 0.0991]}, {"w": "the", "b": [0.3193, 0.0852, 0.3429, 0.0991]}, {"w": "model", "b": [0.3473, 0.0852, 0.3936, 0.0991]}]}, {"id": "b_1", "type": "paragraph", "text": "model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=1e-5), metrics=['acc']) history = model.fit_generator( train_generator, steps_per_epoch=100, epochs=100, validation_data=validation_generator, validation_steps=50)", "words": [{"w": "model.compile(loss='binary_crossentropy',", "b": [0.1348, 0.1118, 0.5705, 0.126]}, {"w": "optimizer=optimizers.RMSprop(lr=1e-5),", "b": [0.2836, 0.126, 0.6874, 0.1402]}, {"w": "metrics=['acc'])", "b": [0.2836, 0.1402, 0.4536, 0.1544]}, {"w": "history", "b": [0.1348, 0.1686, 0.2092, 0.1827]}, {"w": "=", "b": [0.2198, 0.1686, 0.2304, 0.1827]}, {"w": "model.fit_generator(", "b": [0.241, 0.1686, 0.4536, 0.1827]}, {"w": "train_generator,", "b": [0.1985, 0.1827, 0.3686, 0.1969]}, {"w": "steps_per_epoch=100,", "b": [0.1985, 0.1969, 0.4111, 0.2111]}, {"w": "epochs=100,", "b": [0.1985, 0.2111, 0.3154, 0.2253]}, {"w": "validation_data=validation_generator,", "b": [0.1985, 0.2253, 0.5917, 0.2395]}, {"w": "validation_steps=50)", "b": [0.1985, 0.2395, 0.4111, 0.2537]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s plot the results using the same plotting code as before (see figures 5.20 and 5.21).", "words": [{"w": "Let’s", "b": [0.1289, 0.2751, 0.1761, 0.2936]}, {"w": "plot", "b": [0.182, 0.2751, 0.2187, 0.2936]}, {"w": "the", "b": [0.2246, 0.2751, 0.2535, 0.2936]}, {"w": "results", "b": [0.2594, 0.2751, 0.3211, 0.2936]}, {"w": "using", "b": [0.327, 0.2751, 0.3781, 0.2936]}, {"w": "the", "b": [0.384, 0.2751, 0.4129, 0.2936]}, {"w": "same", "b": [0.4188, 0.2751, 0.4673, 0.2936]}, {"w": "plotting", "b": [0.4732, 0.2751, 0.5467, 0.2936]}, {"w": "code", "b": [0.5526, 0.2751, 0.5972, 0.2936]}, {"w": "as", "b": [0.6031, 0.2751, 0.6228, 0.2936]}, {"w": "before", "b": [0.6287, 0.2751, 0.689, 0.2936]}, {"w": "(see", "b": [0.6949, 0.2751, 0.7329, 0.2936]}, {"w": "figures", "b": [0.7388, 0.2751, 0.8043, 0.2936]}, {"w": "5.20", "b": [0.8102, 0.2751, 0.8516, 0.2936]}, {"w": "and", "b": [0.1289, 0.2943, 0.163, 0.3127]}, {"w": "5.21).", "b": [0.1689, 0.2943, 0.224, 0.3127]}]}, {"id": "b_3", "type": "equation", "text": "Figure 5.20. Training and validation accuracy for fine-tuning", "words": [{"w": "Figure", "b": [0.1289, 0.3297, 0.1787, 0.3436]}, {"w": "5.20.", "b": [0.1832, 0.3297, 0.2186, 0.3436]}, {"w": "Training", "b": [0.223, 0.3297, 0.2886, 0.3436]}, {"w": "and", "b": [0.293, 0.3297, 0.3216, 0.3436]}, {"w": "validation", "b": [0.326, 0.3297, 0.4018, 0.3436]}, {"w": "accuracy", "b": [0.4062, 0.3297, 0.4741, 0.3436]}, {"w": "for", "b": [0.4785, 0.3297, 0.5011, 0.3436]}, {"w": "fine-tuning", "b": [0.5056, 0.3297, 0.5892, 0.3436]}]}, {"id": "b_4", "type": "equation", "text": "Figure 5.21. Training and validation loss for fine-tuning", "words": [{"w": "Figure", "b": [0.1289, 0.6109, 0.1787, 0.6247]}, {"w": "5.21.", "b": [0.1832, 0.6109, 0.2186, 0.6247]}, {"w": "Training", "b": [0.223, 0.6109, 0.2886, 0.6247]}, {"w": "and", "b": [0.293, 0.6109, 0.3216, 0.6247]}, {"w": "validation", "b": [0.326, 0.6109, 0.4018, 0.6247]}, {"w": "loss", "b": [0.4062, 0.6109, 0.4338, 0.6247]}, {"w": "for", "b": [0.4382, 0.6109, 0.4608, 0.6247]}, {"w": "fine-tuning", "b": [0.4653, 0.6109, 0.5489, 0.6247]}]}]}, {"page": 214, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "These curves look noisy. To make them more readable, you can smooth them by replacing every loss and accuracy with exponential moving averages of these quantities. Here’s a trivial utility function to do this (see figures 5.22 and 5.23).", "words": [{"w": "These", "b": [0.1289, 0.0857, 0.1853, 0.1041]}, {"w": "curves", "b": [0.1912, 0.0857, 0.2528, 0.1041]}, {"w": "look", "b": [0.2587, 0.0857, 0.3007, 0.1041]}, {"w": "noisy.", "b": [0.3066, 0.0857, 0.3621, 0.1041]}, {"w": "To", "b": [0.368, 0.0857, 0.3926, 0.1041]}, {"w": "make", "b": [0.3985, 0.0857, 0.4497, 0.1041]}, {"w": "them", "b": [0.4556, 0.0857, 0.5028, 0.1041]}, {"w": "more", "b": [0.5087, 0.0857, 0.5572, 0.1041]}, {"w": "readable,", "b": [0.5631, 0.0857, 0.649, 0.1041]}, {"w": "you", "b": [0.6549, 0.0857, 0.6904, 0.1041]}, {"w": "can", "b": [0.6963, 0.0857, 0.729, 0.1041]}, {"w": "smooth", "b": [0.7349, 0.0857, 0.8045, 0.1041]}, {"w": "them", "b": [0.8104, 0.0857, 0.8576, 0.1041]}, {"w": "by", "b": [0.1289, 0.1049, 0.1525, 0.1233]}, {"w": "replacing", "b": [0.1584, 0.1049, 0.2463, 0.1233]}, {"w": "every", "b": [0.2522, 0.1049, 0.3046, 0.1233]}, {"w": "loss", "b": [0.3105, 0.1049, 0.3473, 0.1233]}, {"w": "and", "b": [0.3532, 0.1049, 0.3873, 0.1233]}, {"w": "accuracy", "b": [0.3932, 0.1049, 0.4771, 0.1233]}, {"w": "with", "b": [0.483, 0.1049, 0.525, 0.1233]}, {"w": "exponential", "b": [0.5309, 0.1049, 0.6411, 0.1233]}, {"w": "moving", "b": [0.6469, 0.1049, 0.7191, 0.1233]}, {"w": "averages", "b": [0.725, 0.1049, 0.8076, 0.1233]}, {"w": "of", "b": [0.8135, 0.1049, 0.8331, 0.1233]}, {"w": "these", "b": [0.1289, 0.124, 0.1774, 0.1425]}, {"w": "quantities.", "b": [0.1833, 0.124, 0.281, 0.1425]}, {"w": "Here’s", "b": [0.287, 0.124, 0.3486, 0.1425]}, {"w": "a", "b": [0.3545, 0.124, 0.3649, 0.1425]}, {"w": "trivial", "b": [0.3708, 0.124, 0.4273, 0.1425]}, {"w": "utility", "b": [0.4332, 0.124, 0.4896, 0.1425]}, {"w": "function", "b": [0.4955, 0.124, 0.5742, 0.1425]}, {"w": "to", "b": [0.5801, 0.124, 0.5985, 0.1425]}, {"w": "do", "b": [0.6044, 0.124, 0.628, 0.1425]}, {"w": "this", "b": [0.6339, 0.124, 0.668, 0.1425]}, {"w": "(see", "b": [0.6739, 0.124, 0.712, 0.1425]}, {"w": "figures", "b": [0.7178, 0.124, 0.7834, 0.1425]}, {"w": "5.22", "b": [0.7893, 0.124, 0.8306, 0.1425]}, {"w": "and", "b": [0.8365, 0.124, 0.8706, 0.1425]}, {"w": "5.23).", "b": [0.1289, 0.1432, 0.184, 0.1617]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.22. Smoothed curves for training and validation accuracy for fine-tuning", "words": [{"w": "Figure", "b": [0.1289, 0.1828, 0.1787, 0.1967]}, {"w": "5.22.", "b": [0.1832, 0.1828, 0.2186, 0.1967]}, {"w": "Smoothed", "b": [0.223, 0.1828, 0.2988, 0.1967]}, {"w": "curves", "b": [0.3032, 0.1828, 0.3524, 0.1967]}, {"w": "for", "b": [0.3568, 0.1828, 0.3794, 0.1967]}, {"w": "training", "b": [0.3838, 0.1828, 0.4449, 0.1967]}, {"w": "and", "b": [0.4493, 0.1828, 0.4778, 0.1967]}, {"w": "validation", "b": [0.4823, 0.1828, 0.558, 0.1967]}, {"w": "accuracy", "b": [0.5625, 0.1828, 0.6303, 0.1967]}, {"w": "for", "b": [0.6348, 0.1828, 0.6574, 0.1967]}, {"w": "fine-tuning", "b": [0.6618, 0.1828, 0.7455, 0.1967]}]}, {"id": "b_2", "type": "equation", "text": "Figure 5.23. Smoothed curves for training and validation loss for fine-tuning", "words": [{"w": "Figure", "b": [0.1289, 0.464, 0.1787, 0.4779]}, {"w": "5.23.", "b": [0.1832, 0.464, 0.2186, 0.4779]}, {"w": "Smoothed", "b": [0.223, 0.464, 0.2988, 0.4779]}, {"w": "curves", "b": [0.3032, 0.464, 0.3524, 0.4779]}, {"w": "for", "b": [0.3568, 0.464, 0.3794, 0.4779]}, {"w": "training", "b": [0.3838, 0.464, 0.4449, 0.4779]}, {"w": "and", "b": [0.4493, 0.464, 0.4778, 0.4779]}, {"w": "validation", "b": [0.4823, 0.464, 0.558, 0.4779]}, {"w": "loss", "b": [0.5625, 0.464, 0.59, 0.4779]}, {"w": "for", "b": [0.5945, 0.464, 0.6171, 0.4779]}, {"w": "fine-tuning", "b": [0.6215, 0.464, 0.7052, 0.4779]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.24. Smoothing the plots", "words": [{"w": "Listing", "b": [0.1289, 0.7519, 0.182, 0.7658]}, {"w": "5.24.", "b": [0.1865, 0.7519, 0.2219, 0.7658]}, {"w": "Smoothing", "b": [0.2263, 0.7519, 0.308, 0.7658]}, {"w": "the", "b": [0.3124, 0.7519, 0.336, 0.7658]}, {"w": "plots", "b": [0.3404, 0.7519, 0.3768, 0.7658]}]}, {"id": "b_4", "type": "paragraph", "text": "def smooth_curve(points, factor=0.8): smoothed_points = [] for point in points: if smoothed_points: previous = smoothed_points[-1] smoothed_points.append(previous * factor + point * (1 - factor)) else: smoothed_points.append(point)", "words": [{"w": "def", "b": [0.1348, 0.7785, 0.1667, 0.7927]}, {"w": "smooth_curve(points,", "b": [0.1773, 0.7785, 0.3898, 0.7927]}, {"w": "factor=0.8):", "b": [0.4004, 0.7785, 0.528, 0.7927]}, {"w": "smoothed_points", "b": [0.156, 0.7927, 0.3154, 0.8069]}, {"w": "=", "b": [0.3261, 0.7927, 0.3367, 0.8069]}, {"w": "[]", "b": [0.3473, 0.7927, 0.3686, 0.8069]}, {"w": "for", "b": [0.156, 0.8069, 0.1879, 0.821]}, {"w": "point", "b": [0.1985, 0.8069, 0.2517, 0.821]}, {"w": "in", "b": [0.2623, 0.8069, 0.2836, 0.821]}, {"w": "points:", "b": [0.2942, 0.8069, 0.3686, 0.821]}, {"w": "if", "b": [0.1773, 0.821, 0.1985, 0.8352]}, {"w": "smoothed_points:", "b": [0.2092, 0.821, 0.3792, 0.8352]}, {"w": "previous", "b": [0.1985, 0.8352, 0.2836, 0.8494]}, {"w": "=", "b": [0.2942, 0.8352, 0.3048, 0.8494]}, {"w": "smoothed_points[-1]", "b": [0.3154, 0.8352, 0.5173, 0.8494]}, {"w": "smoothed_points.append(previous", "b": [0.1985, 0.8494, 0.528, 0.8636]}, {"w": "*", "b": [0.5386, 0.8494, 0.5492, 0.8636]}, {"w": "factor", "b": [0.5598, 0.8494, 0.6236, 0.8636]}, {"w": "+", "b": [0.6342, 0.8494, 0.6449, 0.8636]}, {"w": "point", "b": [0.6555, 0.8494, 0.7086, 0.8636]}, {"w": "*", "b": [0.7192, 0.8494, 0.7299, 0.8636]}, {"w": "(1", "b": [0.7405, 0.8494, 0.7618, 0.8636]}, {"w": "-", "b": [0.7724, 0.8494, 0.783, 0.8636]}, {"w": "factor))", "b": [0.1348, 0.8636, 0.2198, 0.8778]}, {"w": "else:", "b": [0.1773, 0.8778, 0.2304, 0.892]}, {"w": "smoothed_points.append(point)", "b": [0.1985, 0.892, 0.5067, 0.9061]}]}]}, {"page": 215, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "return smoothed_points plt.plot(epochs, smooth_curve(acc), 'bo', label='Smoothed training acc') plt.plot(epochs, smooth_curve(val_acc), 'b', label='Smoothed validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, smooth_curve(loss), 'bo', label='Smoothed training loss') plt.plot(epochs, smooth_curve(val_loss), 'b', label='Smoothed validation loss') plt.title('Training and validation loss') plt.legend() plt.show()", "words": [{"w": "return", "b": [0.156, 0.0851, 0.2198, 0.0993]}, {"w": "smoothed_points", "b": [0.2304, 0.0851, 0.3898, 0.0993]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.1135, 0.3048, 0.1277]}, {"w": "smooth_curve(acc),", "b": [0.2304, 0.1277, 0.4217, 0.1418]}, {"w": "'bo',", "b": [0.4323, 0.1277, 0.4855, 0.1418]}, {"w": "label='Smoothed", "b": [0.4961, 0.1277, 0.6555, 0.1418]}, {"w": "training", "b": [0.6661, 0.1277, 0.7511, 0.1418]}, {"w": "acc')", "b": [0.7618, 0.1277, 0.8149, 0.1418]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.1419, 0.3048, 0.156]}, {"w": "smooth_curve(val_acc),", "b": [0.2304, 0.156, 0.4642, 0.1702]}, {"w": "'b',", "b": [0.4748, 0.156, 0.5173, 0.1702]}, {"w": "label='Smoothed", "b": [0.528, 0.156, 0.6874, 0.1702]}, {"w": "validation", "b": [0.698, 0.156, 0.8043, 0.1702]}, {"w": "acc')", "b": [0.8149, 0.156, 0.868, 0.1702]}, {"w": "plt.title('Training", "b": [0.1348, 0.1702, 0.3367, 0.1844]}, {"w": "and", "b": [0.3473, 0.1702, 0.3792, 0.1844]}, {"w": "validation", "b": [0.3898, 0.1702, 0.4961, 0.1844]}, {"w": "accuracy')", "b": [0.5067, 0.1702, 0.613, 0.1844]}, {"w": "plt.legend()", "b": [0.1348, 0.1844, 0.2623, 0.1986]}, {"w": "plt.figure()", "b": [0.1348, 0.2128, 0.2623, 0.227]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.2411, 0.3048, 0.2553]}, {"w": "smooth_curve(loss),", "b": [0.2304, 0.2553, 0.4323, 0.2695]}, {"w": "'bo',", "b": [0.443, 0.2553, 0.4961, 0.2695]}, {"w": "label='Smoothed", "b": [0.5067, 0.2553, 0.6661, 0.2695]}, {"w": "training", "b": [0.6767, 0.2553, 0.7618, 0.2695]}, {"w": "loss')", "b": [0.7724, 0.2553, 0.8361, 0.2695]}, {"w": "plt.plot(epochs,", "b": [0.1348, 0.2695, 0.3048, 0.2837]}, {"w": "smooth_curve(val_loss),", "b": [0.2304, 0.2837, 0.4748, 0.2979]}, {"w": "'b',", "b": [0.4855, 0.2837, 0.528, 0.2979]}, {"w": "label='Smoothed", "b": [0.5386, 0.2837, 0.698, 0.2979]}, {"w": "validation", "b": [0.7086, 0.2837, 0.8149, 0.2979]}, {"w": "loss')", "b": [0.1348, 0.2979, 0.1985, 0.3121]}, {"w": "plt.title('Training", "b": [0.1348, 0.3121, 0.3367, 0.3262]}, {"w": "and", "b": [0.3473, 0.3121, 0.3792, 0.3262]}, {"w": "validation", "b": [0.3898, 0.3121, 0.4961, 0.3262]}, {"w": "loss')", "b": [0.5067, 0.3121, 0.5705, 0.3262]}, {"w": "plt.legend()", "b": [0.1348, 0.3263, 0.2623, 0.3404]}, {"w": "plt.show()", "b": [0.1348, 0.3546, 0.241, 0.3688]}]}, {"id": "b_1", "type": "paragraph", "text": "The validation accuracy curve look much cleaner. You’re seeing a nice 1% absolute improvement in accuracy, from about 96% to above 97%.", "words": [{"w": "The", "b": [0.1289, 0.3902, 0.1656, 0.4087]}, {"w": "validation", "b": [0.1715, 0.3902, 0.266, 0.4087]}, {"w": "accuracy", "b": [0.2719, 0.3902, 0.3558, 0.4087]}, {"w": "curve", "b": [0.3617, 0.3902, 0.4141, 0.4087]}, {"w": "look", "b": [0.42, 0.3902, 0.462, 0.4087]}, {"w": "much", "b": [0.4679, 0.3902, 0.5204, 0.4087]}, {"w": "cleaner.", "b": [0.5263, 0.3902, 0.599, 0.4087]}, {"w": "You’re", "b": [0.6049, 0.3902, 0.6694, 0.4087]}, {"w": "seeing", "b": [0.6753, 0.3902, 0.7356, 0.4087]}, {"w": "a", "b": [0.7415, 0.3902, 0.752, 0.4087]}, {"w": "nice", "b": [0.7579, 0.3902, 0.7973, 0.4087]}, {"w": "1%", "b": [0.8032, 0.3902, 0.8347, 0.4087]}, {"w": "absolute", "b": [0.1289, 0.4094, 0.2076, 0.4279]}, {"w": "improvement", "b": [0.2135, 0.4094, 0.3394, 0.4279]}, {"w": "in", "b": [0.3453, 0.4094, 0.3637, 0.4279]}, {"w": "accuracy,", "b": [0.3696, 0.4094, 0.4578, 0.4279]}, {"w": "from", "b": [0.4637, 0.4094, 0.5096, 0.4279]}, {"w": "about", "b": [0.5155, 0.4094, 0.568, 0.4279]}, {"w": "96%", "b": [0.5739, 0.4094, 0.6172, 0.4279]}, {"w": "to", "b": [0.6231, 0.4094, 0.6415, 0.4279]}, {"w": "above", "b": [0.6474, 0.4094, 0.7038, 0.4279]}, {"w": "97%.", "b": [0.7097, 0.4094, 0.7589, 0.4279]}]}, {"id": "b_2", "type": "paragraph", "text": "Note that the loss curve doesn’t show any real improvement (in fact, it’s deteriorating). You may wonder, how could accuracy stay stable or improve if the loss isn’t decreasing? The answer is simple: what you display is an average of pointwise loss values; but what matters for accuracy is the distribution of the loss values, not their average, because accuracy is the result of a binary thresholding of the class probability predicted by the model. The model may still be improving even if this isn’t reflected in the average loss.", "words": [{"w": "Note", "b": [0.1289, 0.4495, 0.1748, 0.4679]}, {"w": "that", "b": [0.1807, 0.4495, 0.2161, 0.4679]}, {"w": "the", "b": [0.222, 0.4495, 0.2509, 0.4679]}, {"w": "loss", "b": [0.2568, 0.4495, 0.2935, 0.4679]}, {"w": "curve", "b": [0.2994, 0.4495, 0.3519, 0.4679]}, {"w": "doesn’t", "b": [0.3578, 0.4495, 0.4268, 0.4679]}, {"w": "show", "b": [0.4327, 0.4495, 0.4826, 0.4679]}, {"w": "any", "b": [0.4885, 0.4495, 0.5226, 0.4679]}, {"w": "real", "b": [0.5285, 0.4495, 0.5639, 0.4679]}, {"w": "improvement", "b": [0.5698, 0.4495, 0.6957, 0.4679]}, {"w": "(in", "b": [0.7016, 0.4495, 0.7279, 0.4679]}, {"w": "fact,", "b": [0.7338, 0.4495, 0.7751, 0.4679]}, {"w": "it’s", "b": [0.781, 0.4495, 0.8098, 0.4679]}, {"w": "deteriorating).", "b": [0.1289, 0.4687, 0.2633, 0.4871]}, {"w": "You", "b": [0.2692, 0.4687, 0.3075, 0.4871]}, {"w": "may", "b": [0.3134, 0.4687, 0.3541, 0.4871]}, {"w": "wonder,", "b": [0.36, 0.4687, 0.4357, 0.4871]}, {"w": "how", "b": [0.4416, 0.4687, 0.4823, 0.4871]}, {"w": "could", "b": [0.4882, 0.4687, 0.5407, 0.4871]}, {"w": "accuracy", "b": [0.5466, 0.4687, 0.6305, 0.4871]}, {"w": "stay", "b": [0.6364, 0.4687, 0.6744, 0.4871]}, {"w": "stable", "b": [0.6803, 0.4687, 0.7354, 0.4871]}, {"w": "or", "b": [0.7413, 0.4687, 0.761, 0.4871]}, {"w": "improve", "b": [0.7669, 0.4687, 0.8456, 0.4871]}, {"w": "if", "b": [0.8515, 0.4687, 0.8659, 0.4871]}, {"w": "the", "b": [0.1289, 0.4878, 0.1577, 0.5063]}, {"w": "loss", "b": [0.1636, 0.4878, 0.2004, 0.5063]}, {"w": "isn’t", "b": [0.2063, 0.4878, 0.2478, 0.5063]}, {"w": "decreasing?", "b": [0.2537, 0.4878, 0.3652, 0.5063]}, {"w": "The", "b": [0.3711, 0.4878, 0.4078, 0.5063]}, {"w": "answer", "b": [0.4137, 0.4878, 0.4806, 0.5063]}, {"w": "is", "b": [0.4865, 0.4878, 0.5023, 0.5063]}, {"w": "simple:", "b": [0.5082, 0.4878, 0.5777, 0.5063]}, {"w": "what", "b": [0.5836, 0.4878, 0.6295, 0.5063]}, {"w": "you", "b": [0.6354, 0.4878, 0.6709, 0.5063]}, {"w": "display", "b": [0.6768, 0.4878, 0.745, 0.5063]}, {"w": "is", "b": [0.7509, 0.4878, 0.7666, 0.5063]}, {"w": "an", "b": [0.7725, 0.4878, 0.7948, 0.5063]}, {"w": "average", "b": [0.1289, 0.507, 0.2023, 0.5255]}, {"w": "of", "b": [0.2082, 0.507, 0.2279, 0.5255]}, {"w": "pointwise", "b": [0.2338, 0.507, 0.3256, 0.5255]}, {"w": "loss", "b": [0.3315, 0.507, 0.3683, 0.5255]}, {"w": "values;", "b": [0.3741, 0.507, 0.441, 0.5255]}, {"w": "but", "b": [0.4469, 0.507, 0.4771, 0.5255]}, {"w": "what", "b": [0.483, 0.507, 0.5289, 0.5255]}, {"w": "matters", "b": [0.5348, 0.507, 0.6044, 0.5255]}, {"w": "for", "b": [0.6103, 0.507, 0.6378, 0.5255]}, {"w": "accuracy", "b": [0.6437, 0.507, 0.7276, 0.5255]}, {"w": "is", "b": [0.7335, 0.507, 0.7493, 0.5255]}, {"w": "the", "b": [0.7552, 0.507, 0.784, 0.5255]}, {"w": "distribution", "b": [0.1289, 0.5262, 0.2378, 0.5447]}, {"w": "of", "b": [0.2437, 0.5262, 0.2634, 0.5447]}, {"w": "the", "b": [0.2693, 0.5262, 0.2981, 0.5447]}, {"w": "loss", "b": [0.304, 0.5262, 0.3408, 0.5447]}, {"w": "values,", "b": [0.3467, 0.5262, 0.4129, 0.5447]}, {"w": "not", "b": [0.4188, 0.5262, 0.449, 0.5447]}, {"w": "their", "b": [0.4549, 0.5262, 0.4982, 0.5447]}, {"w": "average,", "b": [0.5041, 0.5262, 0.5834, 0.5447]}, {"w": "because", "b": [0.5893, 0.5262, 0.6641, 0.5447]}, {"w": "accuracy", "b": [0.67, 0.5262, 0.7539, 0.5447]}, {"w": "is", "b": [0.7598, 0.5262, 0.7755, 0.5447]}, {"w": "the", "b": [0.7814, 0.5262, 0.8103, 0.5447]}, {"w": "result", "b": [0.8162, 0.5262, 0.8687, 0.5447]}, {"w": "of", "b": [0.1289, 0.5454, 0.1485, 0.5639]}, {"w": "a", "b": [0.1545, 0.5454, 0.1649, 0.5639]}, {"w": "binary", "b": [0.1708, 0.5454, 0.2312, 0.5639]}, {"w": "thresholding", "b": [0.2371, 0.5454, 0.3552, 0.5639]}, {"w": "of", "b": [0.3611, 0.5454, 0.3807, 0.5639]}, {"w": "the", "b": [0.3866, 0.5454, 0.4155, 0.5639]}, {"w": "class", "b": [0.4214, 0.5454, 0.4673, 0.5639]}, {"w": "probability", "b": [0.4732, 0.5454, 0.5768, 0.5639]}, {"w": "predicted", "b": [0.5828, 0.5454, 0.6706, 0.5639]}, {"w": "by", "b": [0.6765, 0.5454, 0.7001, 0.5639]}, {"w": "the", "b": [0.706, 0.5454, 0.7349, 0.5639]}, {"w": "model.", "b": [0.7408, 0.5454, 0.8057, 0.5639]}, {"w": "The", "b": [0.8116, 0.5454, 0.8484, 0.5639]}, {"w": "model", "b": [0.1289, 0.5646, 0.1879, 0.5831]}, {"w": "may", "b": [0.1938, 0.5646, 0.2345, 0.5831]}, {"w": "still", "b": [0.2404, 0.5646, 0.2758, 0.5831]}, {"w": "be", "b": [0.2817, 0.5646, 0.304, 0.5831]}, {"w": "improving", "b": [0.3099, 0.5646, 0.4083, 0.5831]}, {"w": "even", "b": [0.4142, 0.5646, 0.4588, 0.5831]}, {"w": "if", "b": [0.4647, 0.5646, 0.4792, 0.5831]}, {"w": "this", "b": [0.4851, 0.5646, 0.5192, 0.5831]}, {"w": "isn’t", "b": [0.5251, 0.5646, 0.5666, 0.5831]}, {"w": "reflected", "b": [0.5725, 0.5646, 0.6551, 0.5831]}, {"w": "in", "b": [0.661, 0.5646, 0.6794, 0.5831]}, {"w": "the", "b": [0.6853, 0.5646, 0.7141, 0.5831]}, {"w": "average", "b": [0.72, 0.5646, 0.7934, 0.5831]}, {"w": "loss.", "b": [0.7994, 0.5646, 0.842, 0.5831]}]}, {"id": "b_3", "type": "paragraph", "text": "You can now finally evaluate this model on the test data:", "words": [{"w": "You", "b": [0.1289, 0.6047, 0.1672, 0.6231]}, {"w": "can", "b": [0.1731, 0.6047, 0.2059, 0.6231]}, {"w": "now", "b": [0.2118, 0.6047, 0.2524, 0.6231]}, {"w": "finally", "b": [0.2583, 0.6047, 0.32, 0.6231]}, {"w": "evaluate", "b": [0.3259, 0.6047, 0.4046, 0.6231]}, {"w": "this", "b": [0.4105, 0.6047, 0.4446, 0.6231]}, {"w": "model", "b": [0.4505, 0.6047, 0.5095, 0.6231]}, {"w": "on", "b": [0.5155, 0.6047, 0.5391, 0.6231]}, {"w": "the", "b": [0.545, 0.6047, 0.5738, 0.6231]}, {"w": "test", "b": [0.5797, 0.6047, 0.6125, 0.6231]}, {"w": "data:", "b": [0.6184, 0.6047, 0.6643, 0.6231]}]}, {"id": "b_4", "type": "paragraph", "text": "test_generator = test_datagen.flow_from_directory( test_dir, target_size=(150, 150), batch_size=20, class_mode='binary') test_loss, test_acc = model.evaluate_generator(test_generator, steps=50) print('test acc:', test_acc)", "words": [{"w": "test_generator", "b": [0.1348, 0.64, 0.2836, 0.6542]}, {"w": "=", "b": [0.2942, 0.64, 0.3048, 0.6542]}, {"w": "test_datagen.flow_from_directory(", "b": [0.3154, 0.64, 0.6661, 0.6542]}, {"w": "test_dir,", "b": [0.2198, 0.6542, 0.3154, 0.6683]}, {"w": "target_size=(150,", "b": [0.2198, 0.6684, 0.4004, 0.6825]}, {"w": "150),", "b": [0.4111, 0.6684, 0.4642, 0.6825]}, {"w": "batch_size=20,", "b": [0.2198, 0.6825, 0.3686, 0.6967]}, {"w": "class_mode='binary')", "b": [0.2198, 0.6967, 0.4323, 0.7109]}, {"w": "test_loss,", "b": [0.1348, 0.7251, 0.241, 0.7393]}, {"w": "test_acc", "b": [0.2517, 0.7251, 0.3367, 0.7393]}, {"w": "=", "b": [0.3473, 0.7251, 0.3579, 0.7393]}, {"w": "model.evaluate_generator(test_generator,", "b": [0.3686, 0.7251, 0.7936, 0.7393]}, {"w": "steps=50)", "b": [0.1348, 0.7393, 0.2304, 0.7535]}, {"w": "print('test", "b": [0.1348, 0.7535, 0.2517, 0.7676]}, {"w": "acc:',", "b": [0.2623, 0.7535, 0.3261, 0.7676]}, {"w": "test_acc)", "b": [0.3367, 0.7535, 0.4323, 0.7676]}]}, {"id": "b_5", "type": "paragraph", "text": "Here you get a test accuracy of 97%. In the original Kaggle competition around this dataset, this would have been one of the top results. But using modern deep-learning techniques, you managed to reach this result using only a small fraction of the training data available (about 10%). There is a huge difference between being able to train on 20,000 samples compared to 2,000 samples!", "words": [{"w": "Here", "b": [0.1289, 0.7891, 0.1748, 0.8075]}, {"w": "you", "b": [0.1807, 0.7891, 0.2161, 0.8075]}, {"w": "get", "b": [0.222, 0.7891, 0.2508, 0.8075]}, {"w": "a", "b": [0.2567, 0.7891, 0.2672, 0.8075]}, {"w": "test", "b": [0.2731, 0.7891, 0.3059, 0.8075]}, {"w": "accuracy", "b": [0.3118, 0.7891, 0.3957, 0.8075]}, {"w": "of", "b": [0.4017, 0.7891, 0.4213, 0.8075]}, {"w": "97%.", "b": [0.4272, 0.7891, 0.4764, 0.8075]}, {"w": "In", "b": [0.4823, 0.7891, 0.502, 0.8075]}, {"w": "the", "b": [0.5079, 0.7891, 0.5368, 0.8075]}, {"w": "original", "b": [0.5427, 0.7891, 0.6161, 0.8075]}, {"w": "Kaggle", "b": [0.622, 0.7891, 0.6902, 0.8075]}, {"w": "competition", "b": [0.6961, 0.7891, 0.809, 0.8075]}, {"w": "around", "b": [0.1289, 0.8083, 0.1945, 0.8267]}, {"w": "this", "b": [0.2004, 0.8083, 0.2345, 0.8267]}, {"w": "dataset,", "b": [0.2404, 0.8083, 0.3119, 0.8267]}, {"w": "this", "b": [0.3178, 0.8083, 0.3519, 0.8267]}, {"w": "would", "b": [0.3578, 0.8083, 0.4168, 0.8267]}, {"w": "have", "b": [0.4227, 0.8083, 0.4673, 0.8267]}, {"w": "been", "b": [0.4732, 0.8083, 0.5178, 0.8267]}, {"w": "one", "b": [0.5237, 0.8083, 0.5578, 0.8267]}, {"w": "of", "b": [0.5637, 0.8083, 0.5834, 0.8267]}, {"w": "the", "b": [0.5893, 0.8083, 0.6182, 0.8267]}, {"w": "top", "b": [0.624, 0.8083, 0.6542, 0.8267]}, {"w": "results.", "b": [0.6601, 0.8083, 0.7276, 0.8267]}, {"w": "But", "b": [0.7335, 0.8083, 0.7677, 0.8267]}, {"w": "using", "b": [0.7736, 0.8083, 0.8247, 0.8267]}, {"w": "modern", "b": [0.1289, 0.8274, 0.201, 0.8459]}, {"w": "deep-learning", "b": [0.2069, 0.8274, 0.3368, 0.8459]}, {"w": "techniques,", "b": [0.3427, 0.8274, 0.4496, 0.8459]}, {"w": "you", "b": [0.4555, 0.8274, 0.4909, 0.8459]}, {"w": "managed", "b": [0.4968, 0.8274, 0.582, 0.8459]}, {"w": "to", "b": [0.5879, 0.8274, 0.6063, 0.8459]}, {"w": "reach", "b": [0.6122, 0.8274, 0.6633, 0.8459]}, {"w": "this", "b": [0.6693, 0.8274, 0.7034, 0.8459]}, {"w": "result", "b": [0.7093, 0.8274, 0.7618, 0.8459]}, {"w": "using", "b": [0.7677, 0.8274, 0.8188, 0.8459]}, {"w": "only", "b": [0.8247, 0.8274, 0.8667, 0.8459]}, {"w": "a", "b": [0.1289, 0.8466, 0.1394, 0.8651]}, {"w": "small", "b": [0.1453, 0.8466, 0.1964, 0.8651]}, {"w": "fraction", "b": [0.2023, 0.8466, 0.2758, 0.8651]}, {"w": "of", "b": [0.2817, 0.8466, 0.3014, 0.8651]}, {"w": "the", "b": [0.3073, 0.8466, 0.3361, 0.8651]}, {"w": "training", "b": [0.342, 0.8466, 0.4154, 0.8651]}, {"w": "data", "b": [0.4213, 0.8466, 0.4607, 0.8651]}, {"w": "available", "b": [0.4666, 0.8466, 0.5518, 0.8651]}, {"w": "(about", "b": [0.5577, 0.8466, 0.6181, 0.8651]}, {"w": "10%).", "b": [0.624, 0.8466, 0.681, 0.8651]}, {"w": "There", "b": [0.6869, 0.8466, 0.742, 0.8651]}, {"w": "is", "b": [0.7479, 0.8466, 0.7637, 0.8651]}, {"w": "a", "b": [0.7696, 0.8466, 0.7801, 0.8651]}, {"w": "huge", "b": [0.786, 0.8466, 0.8319, 0.8651]}, {"w": "difference", "b": [0.1289, 0.8658, 0.2242, 0.8843]}, {"w": "between", "b": [0.2301, 0.8658, 0.3087, 0.8843]}, {"w": "being", "b": [0.3146, 0.8658, 0.3671, 0.8843]}, {"w": "able", "b": [0.373, 0.8658, 0.4124, 0.8843]}, {"w": "to", "b": [0.4183, 0.8658, 0.4366, 0.8843]}, {"w": "train", "b": [0.4425, 0.8658, 0.4858, 0.8843]}, {"w": "on", "b": [0.4917, 0.8658, 0.5153, 0.8843]}, {"w": "20,000", "b": [0.5213, 0.8658, 0.5862, 0.8843]}, {"w": "samples", "b": [0.5921, 0.8658, 0.6682, 0.8843]}, {"w": "compared", "b": [0.6741, 0.8658, 0.7672, 0.8843]}, {"w": "to", "b": [0.7731, 0.8658, 0.7915, 0.8843]}, {"w": "2,000", "b": [0.7973, 0.8658, 0.8504, 0.8843]}, {"w": "samples!", "b": [0.1289, 0.885, 0.2128, 0.9035]}]}]}, {"page": 216, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "5.3.3. Wrapping up", "words": [{"w": "5.3.3.", "b": [0.1289, 0.0857, 0.182, 0.1041]}, {"w": "Wrapping", "b": [0.1879, 0.0857, 0.2912, 0.1041]}, {"w": "up", "b": [0.2971, 0.0857, 0.3233, 0.1041]}]}, {"id": "b_1", "type": "paragraph", "text": "Here’s what you should take away from the exercises in the past two sections:", "words": [{"w": "Here’s", "b": [0.1289, 0.1257, 0.1905, 0.1442]}, {"w": "what", "b": [0.1964, 0.1257, 0.2423, 0.1442]}, {"w": "you", "b": [0.2482, 0.1257, 0.2836, 0.1442]}, {"w": "should", "b": [0.2895, 0.1257, 0.3525, 0.1442]}, {"w": "take", "b": [0.3584, 0.1257, 0.3978, 0.1442]}, {"w": "away", "b": [0.4037, 0.1257, 0.4535, 0.1442]}, {"w": "from", "b": [0.4594, 0.1257, 0.5053, 0.1442]}, {"w": "the", "b": [0.5112, 0.1257, 0.5401, 0.1442]}, {"w": "exercises", "b": [0.546, 0.1257, 0.6325, 0.1442]}, {"w": "in", "b": [0.6384, 0.1257, 0.6568, 0.1442]}, {"w": "the", "b": [0.6627, 0.1257, 0.6916, 0.1442]}, {"w": "past", "b": [0.6975, 0.1257, 0.7355, 0.1442]}, {"w": "two", "b": [0.7414, 0.1257, 0.7768, 0.1442]}, {"w": "sections:", "b": [0.7827, 0.1257, 0.8654, 0.1442]}]}, {"id": "b_2", "type": "paragraph", "text": "Convnets are the best type of machine-learning models for computer- vision tasks. It’s possible to train one from scratch even on a very small dataset, with decent results. On a small dataset, overfitting will be the main issue. Data augmentation is a powerful way to fight overfitting when you’re working with image data. It’s easy to reuse an existing convnet on a new dataset via feature extraction. This is a valuable technique for working with small image datasets. As a complement to feature extraction, you can use fine-tuning, which adapts to a new problem some of the representations previously learned by an existing model. This pushes performance a bit further.", "words": [{"w": "Convnets", "b": [0.1761, 0.1616, 0.2653, 0.1801]}, {"w": "are", "b": [0.2712, 0.1616, 0.3001, 0.1801]}, {"w": "the", "b": [0.306, 0.1616, 0.3348, 0.1801]}, {"w": "best", "b": [0.3407, 0.1616, 0.3788, 0.1801]}, {"w": "type", "b": [0.3847, 0.1616, 0.4253, 0.1801]}, {"w": "of", "b": [0.4312, 0.1616, 0.4509, 0.1801]}, {"w": "machine-learning", "b": [0.4568, 0.1616, 0.6221, 0.1801]}, {"w": "models", "b": [0.628, 0.1616, 0.6962, 0.1801]}, {"w": "for", "b": [0.7021, 0.1616, 0.7296, 0.1801]}, {"w": "computer-", "b": [0.7355, 0.1616, 0.832, 0.1801]}, {"w": "vision", "b": [0.1761, 0.1808, 0.2338, 0.1993]}, {"w": "tasks.", "b": [0.2397, 0.1808, 0.2929, 0.1993]}, {"w": "It’s", "b": [0.2988, 0.1808, 0.329, 0.1993]}, {"w": "possible", "b": [0.3349, 0.1808, 0.4123, 0.1993]}, {"w": "to", "b": [0.4182, 0.1808, 0.4365, 0.1993]}, {"w": "train", "b": [0.4424, 0.1808, 0.4857, 0.1993]}, {"w": "one", "b": [0.4916, 0.1808, 0.5257, 0.1993]}, {"w": "from", "b": [0.5316, 0.1808, 0.5775, 0.1993]}, {"w": "scratch", "b": [0.5834, 0.1808, 0.6503, 0.1993]}, {"w": "even", "b": [0.6562, 0.1808, 0.7008, 0.1993]}, {"w": "on", "b": [0.7067, 0.1808, 0.7303, 0.1993]}, {"w": "a", "b": [0.7362, 0.1808, 0.7467, 0.1993]}, {"w": "very", "b": [0.7526, 0.1808, 0.7945, 0.1993]}, {"w": "small", "b": [0.8004, 0.1808, 0.8516, 0.1993]}, {"w": "dataset,", "b": [0.1761, 0.2, 0.2476, 0.2185]}, {"w": "with", "b": [0.2535, 0.2, 0.2955, 0.2185]}, {"w": "decent", "b": [0.3014, 0.2, 0.363, 0.2185]}, {"w": "results.", "b": [0.3689, 0.2, 0.4365, 0.2185]}, {"w": "On", "b": [0.1761, 0.2192, 0.205, 0.2376]}, {"w": "a", "b": [0.2109, 0.2192, 0.2214, 0.2376]}, {"w": "small", "b": [0.2273, 0.2192, 0.2784, 0.2376]}, {"w": "dataset,", "b": [0.2843, 0.2192, 0.3558, 0.2376]}, {"w": "overfitting", "b": [0.3617, 0.2192, 0.4614, 0.2376]}, {"w": "will", "b": [0.4673, 0.2192, 0.5041, 0.2376]}, {"w": "be", "b": [0.51, 0.2192, 0.5323, 0.2376]}, {"w": "the", "b": [0.5382, 0.2192, 0.567, 0.2376]}, {"w": "main", "b": [0.5729, 0.2192, 0.6202, 0.2376]}, {"w": "issue.", "b": [0.6261, 0.2192, 0.6792, 0.2376]}, {"w": "Data", "b": [0.6851, 0.2192, 0.7297, 0.2376]}, {"w": "augmentation", "b": [0.7356, 0.2192, 0.8641, 0.2376]}, {"w": "is", "b": [0.1761, 0.2384, 0.1919, 0.2568]}, {"w": "a", "b": [0.1978, 0.2384, 0.2082, 0.2568]}, {"w": "powerful", "b": [0.2141, 0.2384, 0.2994, 0.2568]}, {"w": "way", "b": [0.3053, 0.2384, 0.3446, 0.2568]}, {"w": "to", "b": [0.3505, 0.2384, 0.3689, 0.2568]}, {"w": "fight", "b": [0.3748, 0.2384, 0.4194, 0.2568]}, {"w": "overfitting", "b": [0.4253, 0.2384, 0.525, 0.2568]}, {"w": "when", "b": [0.5309, 0.2384, 0.5821, 0.2568]}, {"w": "you’re", "b": [0.588, 0.2384, 0.6496, 0.2568]}, {"w": "working", "b": [0.6555, 0.2384, 0.7342, 0.2568]}, {"w": "with", "b": [0.7401, 0.2384, 0.7821, 0.2568]}, {"w": "image", "b": [0.788, 0.2384, 0.8457, 0.2568]}, {"w": "data.", "b": [0.1761, 0.2576, 0.2214, 0.276]}, {"w": "It’s", "b": [0.1761, 0.2767, 0.2063, 0.2952]}, {"w": "easy", "b": [0.2122, 0.2767, 0.2541, 0.2952]}, {"w": "to", "b": [0.26, 0.2767, 0.2784, 0.2952]}, {"w": "reuse", "b": [0.2843, 0.2767, 0.3342, 0.2952]}, {"w": "an", "b": [0.3401, 0.2767, 0.3623, 0.2952]}, {"w": "existing", "b": [0.3683, 0.2767, 0.443, 0.2952]}, {"w": "convnet", "b": [0.4489, 0.2767, 0.5237, 0.2952]}, {"w": "on", "b": [0.5296, 0.2767, 0.5532, 0.2952]}, {"w": "a", "b": [0.5591, 0.2767, 0.5696, 0.2952]}, {"w": "new", "b": [0.5755, 0.2767, 0.6149, 0.2952]}, {"w": "dataset", "b": [0.6208, 0.2767, 0.6863, 0.2952]}, {"w": "via", "b": [0.6922, 0.2767, 0.7211, 0.2952]}, {"w": "feature", "b": [0.727, 0.2767, 0.7926, 0.2952]}, {"w": "extraction.", "b": [0.1761, 0.2959, 0.2764, 0.3144]}, {"w": "This", "b": [0.2823, 0.2959, 0.3243, 0.3144]}, {"w": "is", "b": [0.3302, 0.2959, 0.346, 0.3144]}, {"w": "a", "b": [0.3519, 0.2959, 0.3624, 0.3144]}, {"w": "valuable", "b": [0.3683, 0.2959, 0.4483, 0.3144]}, {"w": "technique", "b": [0.4542, 0.2959, 0.546, 0.3144]}, {"w": "for", "b": [0.5519, 0.2959, 0.5794, 0.3144]}, {"w": "working", "b": [0.5853, 0.2959, 0.6641, 0.3144]}, {"w": "with", "b": [0.67, 0.2959, 0.7119, 0.3144]}, {"w": "small", "b": [0.7178, 0.2959, 0.7689, 0.3144]}, {"w": "image", "b": [0.7748, 0.2959, 0.8326, 0.3144]}, {"w": "datasets.", "b": [0.1761, 0.3151, 0.2568, 0.3336]}, {"w": "As", "b": [0.1761, 0.3343, 0.2023, 0.3528]}, {"w": "a", "b": [0.2082, 0.3343, 0.2187, 0.3528]}, {"w": "complement", "b": [0.2246, 0.3343, 0.3414, 0.3528]}, {"w": "to", "b": [0.3473, 0.3343, 0.3657, 0.3528]}, {"w": "feature", "b": [0.3716, 0.3343, 0.4371, 0.3528]}, {"w": "extraction,", "b": [0.443, 0.3343, 0.5434, 0.3528]}, {"w": "you", "b": [0.5493, 0.3343, 0.5847, 0.3528]}, {"w": "can", "b": [0.5906, 0.3343, 0.6234, 0.3528]}, {"w": "use", "b": [0.6293, 0.3343, 0.6608, 0.3528]}, {"w": "fine-tuning,", "b": [0.6667, 0.3343, 0.7775, 0.3528]}, {"w": "which", "b": [0.7834, 0.3343, 0.8411, 0.3528]}, {"w": "adapts", "b": [0.1761, 0.3535, 0.2364, 0.372]}, {"w": "to", "b": [0.2423, 0.3535, 0.2607, 0.372]}, {"w": "a", "b": [0.2666, 0.3535, 0.2771, 0.372]}, {"w": "new", "b": [0.283, 0.3535, 0.3224, 0.372]}, {"w": "problem", "b": [0.3283, 0.3535, 0.407, 0.372]}, {"w": "some", "b": [0.4129, 0.3535, 0.4627, 0.372]}, {"w": "of", "b": [0.4686, 0.3535, 0.4883, 0.372]}, {"w": "the", "b": [0.4942, 0.3535, 0.5231, 0.372]}, {"w": "representations", "b": [0.529, 0.3535, 0.6719, 0.372]}, {"w": "previously", "b": [0.6778, 0.3535, 0.7775, 0.372]}, {"w": "learned", "b": [0.7834, 0.3535, 0.8529, 0.372]}, {"w": "by", "b": [0.1761, 0.3727, 0.1997, 0.3912]}, {"w": "an", "b": [0.2056, 0.3727, 0.2279, 0.3912]}, {"w": "existing", "b": [0.2338, 0.3727, 0.3086, 0.3912]}, {"w": "model.", "b": [0.3145, 0.3727, 0.3795, 0.3912]}, {"w": "This", "b": [0.3854, 0.3727, 0.4273, 0.3912]}, {"w": "pushes", "b": [0.4332, 0.3727, 0.4975, 0.3912]}, {"w": "performance", "b": [0.5034, 0.3727, 0.6228, 0.3912]}, {"w": "a", "b": [0.6287, 0.3727, 0.6391, 0.3912]}, {"w": "bit", "b": [0.645, 0.3727, 0.67, 0.3912]}, {"w": "further.", "b": [0.6759, 0.3727, 0.7447, 0.3912]}]}, {"id": "b_3", "type": "paragraph", "text": "Now you have a solid set of tools for dealing with image-classification problems—in particular with small datasets.", "words": [{"w": "Now", "b": [0.1289, 0.4127, 0.1748, 0.4312]}, {"w": "you", "b": [0.1807, 0.4127, 0.2161, 0.4312]}, {"w": "have", "b": [0.222, 0.4127, 0.2666, 0.4312]}, {"w": "a", "b": [0.2725, 0.4127, 0.283, 0.4312]}, {"w": "solid", "b": [0.2889, 0.4127, 0.3348, 0.4312]}, {"w": "set", "b": [0.3407, 0.4127, 0.367, 0.4312]}, {"w": "of", "b": [0.3729, 0.4127, 0.3925, 0.4312]}, {"w": "tools", "b": [0.3984, 0.4127, 0.4444, 0.4312]}, {"w": "for", "b": [0.4503, 0.4127, 0.4778, 0.4312]}, {"w": "dealing", "b": [0.4837, 0.4127, 0.5532, 0.4312]}, {"w": "with", "b": [0.5591, 0.4127, 0.6011, 0.4312]}, {"w": "image-classification", "b": [0.607, 0.4127, 0.7972, 0.4312]}, {"w": "problems—in", "b": [0.1289, 0.4319, 0.2588, 0.4504]}, {"w": "particular", "b": [0.2647, 0.4319, 0.3552, 0.4504]}, {"w": "with", "b": [0.3611, 0.4319, 0.403, 0.4504]}, {"w": "small", "b": [0.4089, 0.4319, 0.4601, 0.4504]}, {"w": "datasets.", "b": [0.466, 0.4319, 0.5467, 0.4504]}]}, {"id": "b_4", "type": "paragraph", "text": "5.4. Visualizing what convnets learn", "words": [{"w": "5.4.", "b": [0.1289, 0.4852, 0.1687, 0.5059]}, {"w": "Visualizing", "b": [0.1754, 0.4852, 0.3013, 0.5059]}, {"w": "what", "b": [0.308, 0.4852, 0.3641, 0.5059]}, {"w": "convnets", "b": [0.3707, 0.4852, 0.4696, 0.5059]}, {"w": "learn", "b": [0.4762, 0.4852, 0.5353, 0.5059]}]}, {"id": "b_5", "type": "paragraph", "text": "It’s often said that deep-learning models are “black boxes”: learning representations that are difficult to extract and present in a human-readable form. Although this is partially true for certain types of deep-learning models, it’s definitely not true for convnets. The representations learned by convnets are highly amenable to visualization, in large part because they’re representations of visual concepts. Since 2013, a wide array of techniques have been developed for visualizing and interpreting these representations. We won’t survey all of them, but we’ll cover three of the most accessible and useful ones:", "words": [{"w": "It’s", "b": [0.1289, 0.5279, 0.159, 0.5464]}, {"w": "often", "b": [0.165, 0.5279, 0.2135, 0.5464]}, {"w": "said", "b": [0.2194, 0.5279, 0.2574, 0.5464]}, {"w": "that", "b": [0.2633, 0.5279, 0.2988, 0.5464]}, {"w": "deep-learning", "b": [0.3047, 0.5279, 0.4345, 0.5464]}, {"w": "models", "b": [0.4404, 0.5279, 0.5086, 0.5464]}, {"w": "are", "b": [0.5145, 0.5279, 0.5434, 0.5464]}, {"w": "“black", "b": [0.5493, 0.5279, 0.6109, 0.5464]}, {"w": "boxes”:", "b": [0.6168, 0.5279, 0.6889, 0.5464]}, {"w": "learning", "b": [0.6948, 0.5279, 0.7722, 0.5464]}, {"w": "representations", "b": [0.1289, 0.5471, 0.2718, 0.5656]}, {"w": "that", "b": [0.2777, 0.5471, 0.3132, 0.5656]}, {"w": "are", "b": [0.3191, 0.5471, 0.3479, 0.5656]}, {"w": "difficult", "b": [0.3538, 0.5471, 0.4294, 0.5656]}, {"w": "to", "b": [0.4353, 0.5471, 0.4537, 0.5656]}, {"w": "extract", "b": [0.4596, 0.5471, 0.5239, 0.5656]}, {"w": "and", "b": [0.5298, 0.5471, 0.5639, 0.5656]}, {"w": "present", "b": [0.5698, 0.5471, 0.638, 0.5656]}, {"w": "in", "b": [0.6438, 0.5471, 0.6622, 0.5656]}, {"w": "a", "b": [0.6681, 0.5471, 0.6786, 0.5656]}, {"w": "human-readable", "b": [0.6845, 0.5471, 0.8366, 0.5656]}, {"w": "form.", "b": [0.1289, 0.5663, 0.1807, 0.5848]}, {"w": "Although", "b": [0.1866, 0.5663, 0.2758, 0.5848]}, {"w": "this", "b": [0.2817, 0.5663, 0.3158, 0.5848]}, {"w": "is", "b": [0.3217, 0.5663, 0.3375, 0.5848]}, {"w": "partially", "b": [0.3434, 0.5663, 0.4221, 0.5848]}, {"w": "true", "b": [0.428, 0.5663, 0.4647, 0.5848]}, {"w": "for", "b": [0.4706, 0.5663, 0.4982, 0.5848]}, {"w": "certain", "b": [0.5041, 0.5663, 0.5683, 0.5848]}, {"w": "types", "b": [0.5742, 0.5663, 0.6241, 0.5848]}, {"w": "of", "b": [0.63, 0.5663, 0.6497, 0.5848]}, {"w": "deep-learning", "b": [0.6556, 0.5663, 0.7854, 0.5848]}, {"w": "models,", "b": [0.7913, 0.5663, 0.8654, 0.5848]}, {"w": "it’s", "b": [0.1289, 0.5855, 0.1577, 0.6039]}, {"w": "definitely", "b": [0.1636, 0.5855, 0.2542, 0.6039]}, {"w": "not", "b": [0.2601, 0.5855, 0.2902, 0.6039]}, {"w": "true", "b": [0.2962, 0.5855, 0.3329, 0.6039]}, {"w": "for", "b": [0.3387, 0.5855, 0.3663, 0.6039]}, {"w": "convnets.", "b": [0.3722, 0.5855, 0.462, 0.6039]}, {"w": "The", "b": [0.4679, 0.5855, 0.5047, 0.6039]}, {"w": "representations", "b": [0.5106, 0.5855, 0.6535, 0.6039]}, {"w": "learned", "b": [0.6594, 0.5855, 0.7289, 0.6039]}, {"w": "by", "b": [0.7348, 0.5855, 0.7584, 0.6039]}, {"w": "convnets", "b": [0.7643, 0.5855, 0.8483, 0.6039]}, {"w": "are", "b": [0.1289, 0.6047, 0.1577, 0.6231]}, {"w": "highly", "b": [0.1636, 0.6047, 0.224, 0.6231]}, {"w": "amenable", "b": [0.2299, 0.6047, 0.3204, 0.6231]}, {"w": "to", "b": [0.3263, 0.6047, 0.3446, 0.6231]}, {"w": "visualization,", "b": [0.3505, 0.6047, 0.4771, 0.6231]}, {"w": "in", "b": [0.4831, 0.6047, 0.5014, 0.6231]}, {"w": "large", "b": [0.5073, 0.6047, 0.554, 0.6231]}, {"w": "part", "b": [0.5599, 0.6047, 0.5967, 0.6231]}, {"w": "because", "b": [0.6026, 0.6047, 0.6773, 0.6231]}, {"w": "they’re", "b": [0.6832, 0.6047, 0.7501, 0.6231]}, {"w": "representations", "b": [0.1289, 0.6239, 0.2741, 0.6423]}, {"w": "of", "b": [0.28, 0.6239, 0.2983, 0.6423]}, {"w": "visual", "b": [0.3042, 0.6239, 0.3607, 0.6423]}, {"w": "concepts.", "b": [0.3666, 0.6239, 0.4551, 0.6423]}, {"w": "Since", "b": [0.461, 0.6239, 0.5134, 0.6423]}, {"w": "2013,", "b": [0.5193, 0.6239, 0.5725, 0.6423]}, {"w": "a", "b": [0.5784, 0.6239, 0.5889, 0.6423]}, {"w": "wide", "b": [0.5948, 0.6239, 0.6407, 0.6423]}, {"w": "array", "b": [0.6466, 0.6239, 0.6951, 0.6423]}, {"w": "of", "b": [0.701, 0.6239, 0.7207, 0.6423]}, {"w": "techniques", "b": [0.7266, 0.6239, 0.8276, 0.6423]}, {"w": "have", "b": [0.1289, 0.643, 0.1735, 0.6615]}, {"w": "been", "b": [0.1794, 0.643, 0.2239, 0.6615]}, {"w": "developed", "b": [0.2299, 0.643, 0.3269, 0.6615]}, {"w": "for", "b": [0.3328, 0.643, 0.3603, 0.6615]}, {"w": "visualizing", "b": [0.3663, 0.643, 0.4699, 0.6615]}, {"w": "and", "b": [0.4758, 0.643, 0.5099, 0.6615]}, {"w": "interpreting", "b": [0.5158, 0.643, 0.626, 0.6615]}, {"w": "these", "b": [0.6319, 0.643, 0.6804, 0.6615]}, {"w": "representations.", "b": [0.6863, 0.643, 0.8352, 0.6615]}, {"w": "We", "b": [0.1289, 0.6622, 0.1598, 0.6807]}, {"w": "won’t", "b": [0.1657, 0.6622, 0.2203, 0.6807]}, {"w": "survey", "b": [0.2262, 0.6622, 0.2892, 0.6807]}, {"w": "all", "b": [0.2951, 0.6622, 0.3187, 0.6807]}, {"w": "of", "b": [0.3246, 0.6622, 0.3443, 0.6807]}, {"w": "them,", "b": [0.3502, 0.6622, 0.4033, 0.6807]}, {"w": "but", "b": [0.4092, 0.6622, 0.4394, 0.6807]}, {"w": "we’ll", "b": [0.4453, 0.6622, 0.4938, 0.6807]}, {"w": "cover", "b": [0.4997, 0.6622, 0.5522, 0.6807]}, {"w": "three", "b": [0.5581, 0.6622, 0.6053, 0.6807]}, {"w": "of", "b": [0.6112, 0.6622, 0.6309, 0.6807]}, {"w": "the", "b": [0.6368, 0.6622, 0.6656, 0.6807]}, {"w": "most", "b": [0.6715, 0.6622, 0.7174, 0.6807]}, {"w": "accessible", "b": [0.7234, 0.6622, 0.8191, 0.6807]}, {"w": "and", "b": [0.825, 0.6622, 0.8591, 0.6807]}, {"w": "useful", "b": [0.1289, 0.6814, 0.1866, 0.6999]}, {"w": "ones:", "b": [0.1925, 0.6814, 0.2423, 0.6999]}]}, {"id": "b_6", "type": "paragraph", "text": "Visualizing intermediate convnet outputs (intermediate activations)— Useful for understanding how successive convnet layers transform their input, and for getting a first idea of the meaning of individual convnet filters. Visualizing convnets filters— Useful for understanding precisely what visual pattern or concept each filter in a convnet is receptive to. Visualizing heatmaps of class activation in an image— Useful for understanding which parts of an image were identified as belonging to a given class, thus allowing you to localize objects in images.", "words": [{"w": "Visualizing", "b": [0.1761, 0.7173, 0.2851, 0.7358]}, {"w": "intermediate", "b": [0.291, 0.7173, 0.413, 0.7358]}, {"w": "convnet", "b": [0.4189, 0.7173, 0.495, 0.7358]}, {"w": "outputs", "b": [0.5009, 0.7173, 0.5731, 0.7358]}, {"w": "(intermediate", "b": [0.579, 0.7173, 0.7089, 0.7358]}, {"w": "activations)—", "b": [0.7148, 0.7173, 0.8512, 0.7358]}, {"w": "Useful", "b": [0.1761, 0.7365, 0.2391, 0.755]}, {"w": "for", "b": [0.245, 0.7365, 0.2725, 0.755]}, {"w": "understanding", "b": [0.2784, 0.7365, 0.4122, 0.755]}, {"w": "how", "b": [0.4181, 0.7365, 0.4588, 0.755]}, {"w": "successive", "b": [0.4647, 0.7365, 0.5644, 0.755]}, {"w": "convnet", "b": [0.5703, 0.7365, 0.645, 0.755]}, {"w": "layers", "b": [0.6509, 0.7365, 0.7073, 0.755]}, {"w": "transform", "b": [0.7132, 0.7365, 0.805, 0.755]}, {"w": "their", "b": [0.8109, 0.7365, 0.8542, 0.755]}, {"w": "input,", "b": [0.1761, 0.7557, 0.2306, 0.7742]}, {"w": "and", "b": [0.2365, 0.7557, 0.2706, 0.7742]}, {"w": "for", "b": [0.2765, 0.7557, 0.304, 0.7742]}, {"w": "getting", "b": [0.3099, 0.7557, 0.3755, 0.7742]}, {"w": "a", "b": [0.3814, 0.7557, 0.3919, 0.7742]}, {"w": "first", "b": [0.3978, 0.7557, 0.4358, 0.7742]}, {"w": "idea", "b": [0.4417, 0.7557, 0.4811, 0.7742]}, {"w": "of", "b": [0.487, 0.7557, 0.5067, 0.7742]}, {"w": "the", "b": [0.5126, 0.7557, 0.5414, 0.7742]}, {"w": "meaning", "b": [0.5473, 0.7557, 0.6287, 0.7742]}, {"w": "of", "b": [0.6345, 0.7557, 0.6542, 0.7742]}, {"w": "individual", "b": [0.6601, 0.7557, 0.7558, 0.7742]}, {"w": "convnet", "b": [0.7618, 0.7557, 0.8365, 0.7742]}, {"w": "filters.", "b": [0.1761, 0.7749, 0.2371, 0.7934]}, {"w": "Visualizing", "b": [0.1761, 0.7941, 0.2851, 0.8125]}, {"w": "convnets", "b": [0.291, 0.7941, 0.3762, 0.8125]}, {"w": "filters—", "b": [0.3821, 0.7941, 0.4622, 0.8125]}, {"w": "Useful", "b": [0.4681, 0.7941, 0.531, 0.8125]}, {"w": "for", "b": [0.5369, 0.7941, 0.5645, 0.8125]}, {"w": "understanding", "b": [0.5704, 0.7941, 0.7042, 0.8125]}, {"w": "precisely", "b": [0.7101, 0.7941, 0.7953, 0.8125]}, {"w": "what", "b": [0.8012, 0.7941, 0.8471, 0.8125]}, {"w": "visual", "b": [0.1761, 0.8133, 0.2325, 0.8317]}, {"w": "pattern", "b": [0.2384, 0.8133, 0.304, 0.8317]}, {"w": "or", "b": [0.3099, 0.8133, 0.3296, 0.8317]}, {"w": "concept", "b": [0.3355, 0.8133, 0.4089, 0.8317]}, {"w": "each", "b": [0.4148, 0.8133, 0.4581, 0.8317]}, {"w": "filter", "b": [0.464, 0.8133, 0.5099, 0.8317]}, {"w": "in", "b": [0.5158, 0.8133, 0.5342, 0.8317]}, {"w": "a", "b": [0.5401, 0.8133, 0.5506, 0.8317]}, {"w": "convnet", "b": [0.5565, 0.8133, 0.6312, 0.8317]}, {"w": "is", "b": [0.6371, 0.8133, 0.6529, 0.8317]}, {"w": "receptive", "b": [0.6588, 0.8133, 0.7453, 0.8317]}, {"w": "to.", "b": [0.7512, 0.8133, 0.7755, 0.8317]}, {"w": "Visualizing", "b": [0.1761, 0.8324, 0.2851, 0.8509]}, {"w": "heatmaps", "b": [0.291, 0.8324, 0.3841, 0.8509]}, {"w": "of", "b": [0.39, 0.8324, 0.4097, 0.8509]}, {"w": "class", "b": [0.4156, 0.8324, 0.4628, 0.8509]}, {"w": "activation", "b": [0.4687, 0.8324, 0.5645, 0.8509]}, {"w": "in", "b": [0.5704, 0.8324, 0.5901, 0.8509]}, {"w": "an", "b": [0.596, 0.8324, 0.621, 0.8509]}, {"w": "image—", "b": [0.6269, 0.8324, 0.7095, 0.8509]}, {"w": "Useful", "b": [0.7154, 0.8324, 0.7783, 0.8509]}, {"w": "for", "b": [0.7842, 0.8324, 0.8118, 0.8509]}, {"w": "understanding", "b": [0.1761, 0.8516, 0.3099, 0.8701]}, {"w": "which", "b": [0.3158, 0.8516, 0.3735, 0.8701]}, {"w": "parts", "b": [0.3794, 0.8516, 0.4253, 0.8701]}, {"w": "of", "b": [0.4312, 0.8516, 0.4509, 0.8701]}, {"w": "an", "b": [0.4568, 0.8516, 0.4791, 0.8701]}, {"w": "image", "b": [0.485, 0.8516, 0.5427, 0.8701]}, {"w": "were", "b": [0.5486, 0.8516, 0.5945, 0.8701]}, {"w": "identified", "b": [0.6004, 0.8516, 0.6909, 0.8701]}, {"w": "as", "b": [0.6968, 0.8516, 0.7165, 0.8701]}, {"w": "belonging", "b": [0.7224, 0.8516, 0.8169, 0.8701]}, {"w": "to", "b": [0.8228, 0.8516, 0.8411, 0.8701]}, {"w": "a", "b": [0.847, 0.8516, 0.8575, 0.8701]}, {"w": "given", "b": [0.1761, 0.8708, 0.2286, 0.8893]}, {"w": "class,", "b": [0.2345, 0.8708, 0.2863, 0.8893]}, {"w": "thus", "b": [0.2922, 0.8708, 0.3316, 0.8893]}, {"w": "allowing", "b": [0.3375, 0.8708, 0.4201, 0.8893]}, {"w": "you", "b": [0.426, 0.8708, 0.4614, 0.8893]}, {"w": "to", "b": [0.4673, 0.8708, 0.4857, 0.8893]}, {"w": "localize", "b": [0.4916, 0.8708, 0.5651, 0.8893]}, {"w": "objects", "b": [0.5709, 0.8708, 0.6378, 0.8893]}, {"w": "in", "b": [0.6437, 0.8708, 0.6621, 0.8893]}, {"w": "images.", "b": [0.668, 0.8708, 0.7408, 0.8893]}]}]}, {"page": 217, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "For the first method—activation visualization—you’ll use the small convnet that you trained from scratch on the dogs-versus-cats classification problem in section 5.2. For the next two methods, you’ll use the VGG16 model introduced in section 5.3.", "words": [{"w": "For", "b": [0.1289, 0.0857, 0.1617, 0.1041]}, {"w": "the", "b": [0.1676, 0.0857, 0.1964, 0.1041]}, {"w": "first", "b": [0.2023, 0.0857, 0.2404, 0.1041]}, {"w": "method—activation", "b": [0.2463, 0.0857, 0.4339, 0.1041]}, {"w": "visualization—you’ll", "b": [0.4398, 0.0857, 0.6405, 0.1041]}, {"w": "use", "b": [0.6464, 0.0857, 0.6779, 0.1041]}, {"w": "the", "b": [0.6838, 0.0857, 0.7127, 0.1041]}, {"w": "small", "b": [0.7186, 0.0857, 0.7697, 0.1041]}, {"w": "convnet", "b": [0.7756, 0.0857, 0.8504, 0.1041]}, {"w": "that", "b": [0.1289, 0.1049, 0.1643, 0.1233]}, {"w": "you", "b": [0.1702, 0.1049, 0.2056, 0.1233]}, {"w": "trained", "b": [0.2115, 0.1049, 0.2771, 0.1233]}, {"w": "from", "b": [0.283, 0.1049, 0.3289, 0.1233]}, {"w": "scratch", "b": [0.3348, 0.1049, 0.4017, 0.1233]}, {"w": "on", "b": [0.4076, 0.1049, 0.4312, 0.1233]}, {"w": "the", "b": [0.4371, 0.1049, 0.466, 0.1233]}, {"w": "dogs-versus-cats", "b": [0.4719, 0.1049, 0.6293, 0.1233]}, {"w": "classification", "b": [0.6351, 0.1049, 0.7597, 0.1233]}, {"w": "problem", "b": [0.7656, 0.1049, 0.8443, 0.1233]}, {"w": "in", "b": [0.8502, 0.1049, 0.8686, 0.1233]}, {"w": "section", "b": [0.1289, 0.124, 0.1958, 0.1425]}, {"w": "5.2.", "b": [0.2017, 0.124, 0.2371, 0.1425]}, {"w": "For", "b": [0.243, 0.124, 0.2758, 0.1425]}, {"w": "the", "b": [0.2817, 0.124, 0.3105, 0.1425]}, {"w": "next", "b": [0.3164, 0.124, 0.3571, 0.1425]}, {"w": "two", "b": [0.363, 0.124, 0.3984, 0.1425]}, {"w": "methods,", "b": [0.4043, 0.124, 0.4903, 0.1425]}, {"w": "you’ll", "b": [0.4962, 0.124, 0.5526, 0.1425]}, {"w": "use", "b": [0.5585, 0.124, 0.59, 0.1425]}, {"w": "the", "b": [0.5959, 0.124, 0.6247, 0.1425]}, {"w": "VGG16", "b": [0.6306, 0.124, 0.7054, 0.1425]}, {"w": "model", "b": [0.7113, 0.124, 0.7703, 0.1425]}, {"w": "introduced", "b": [0.1289, 0.1432, 0.2299, 0.1617]}, {"w": "in", "b": [0.2358, 0.1432, 0.2542, 0.1617]}, {"w": "section", "b": [0.26, 0.1432, 0.3269, 0.1617]}, {"w": "5.3.", "b": [0.3328, 0.1432, 0.3682, 0.1617]}]}, {"id": "b_1", "type": "paragraph", "text": "5.4.1. Visualizing intermediate activations", "words": [{"w": "5.4.1.", "b": [0.1289, 0.1875, 0.182, 0.2059]}, {"w": "Visualizing", "b": [0.1879, 0.1875, 0.2999, 0.2059]}, {"w": "intermediate", "b": [0.3058, 0.1875, 0.4343, 0.2059]}, {"w": "activations", "b": [0.4402, 0.1875, 0.5491, 0.2059]}]}, {"id": "b_2", "type": "paragraph", "text": "Visualizing intermediate activations consists of displaying the feature maps that are output by various convolution and pooling layers in a network, given a certain input (the output of a layer is often called its activation, the output of the activation function). This gives a view into how an input is decomposed into the different filters learned by the network. You want to visualize feature maps with three dimensions: width, height, and depth (channels). Each channel encodes relatively independent features, so the proper way to visualize these feature maps is by independently plotting the contents of every channel as a 2D image. Let’s start by loading the model that you saved in section 5.2:", "words": [{"w": "Visualizing", "b": [0.1289, 0.2275, 0.2363, 0.246]}, {"w": "intermediate", "b": [0.2423, 0.2275, 0.3603, 0.246]}, {"w": "activations", "b": [0.3662, 0.2275, 0.4685, 0.246]}, {"w": "consists", "b": [0.4744, 0.2275, 0.5492, 0.246]}, {"w": "of", "b": [0.5551, 0.2275, 0.5748, 0.246]}, {"w": "displaying", "b": [0.5807, 0.2275, 0.6791, 0.246]}, {"w": "the", "b": [0.685, 0.2275, 0.7139, 0.246]}, {"w": "feature", "b": [0.7198, 0.2275, 0.7853, 0.246]}, {"w": "maps", "b": [0.7912, 0.2275, 0.8411, 0.246]}, {"w": "that", "b": [0.1289, 0.2467, 0.1643, 0.2652]}, {"w": "are", "b": [0.1702, 0.2467, 0.199, 0.2652]}, {"w": "output", "b": [0.2049, 0.2467, 0.2653, 0.2652]}, {"w": "by", "b": [0.2712, 0.2467, 0.2948, 0.2652]}, {"w": "various", "b": [0.3007, 0.2467, 0.3702, 0.2652]}, {"w": "convolution", "b": [0.3761, 0.2467, 0.489, 0.2652]}, {"w": "and", "b": [0.4949, 0.2467, 0.529, 0.2652]}, {"w": "pooling", "b": [0.5349, 0.2467, 0.6071, 0.2652]}, {"w": "layers", "b": [0.6129, 0.2467, 0.6693, 0.2652]}, {"w": "in", "b": [0.6752, 0.2467, 0.6936, 0.2652]}, {"w": "a", "b": [0.6995, 0.2467, 0.7099, 0.2652]}, {"w": "network,", "b": [0.7158, 0.2467, 0.7991, 0.2652]}, {"w": "given", "b": [0.805, 0.2467, 0.8575, 0.2652]}, {"w": "a", "b": [0.1289, 0.2659, 0.1394, 0.2844]}, {"w": "certain", "b": [0.1453, 0.2659, 0.2095, 0.2844]}, {"w": "input", "b": [0.2154, 0.2659, 0.264, 0.2844]}, {"w": "(the", "b": [0.2699, 0.2659, 0.3066, 0.2844]}, {"w": "output", "b": [0.3125, 0.2659, 0.3729, 0.2844]}, {"w": "of", "b": [0.3788, 0.2659, 0.3984, 0.2844]}, {"w": "a", "b": [0.4043, 0.2659, 0.4148, 0.2844]}, {"w": "layer", "b": [0.4207, 0.2659, 0.4679, 0.2844]}, {"w": "is", "b": [0.4738, 0.2659, 0.4896, 0.2844]}, {"w": "often", "b": [0.4955, 0.2659, 0.544, 0.2844]}, {"w": "called", "b": [0.5499, 0.2659, 0.6063, 0.2844]}, {"w": "its", "b": [0.6122, 0.2659, 0.6345, 0.2844]}, {"w": "activation,", "b": [0.6403, 0.2659, 0.7407, 0.2844]}, {"w": "the", "b": [0.7466, 0.2659, 0.7754, 0.2844]}, {"w": "output", "b": [0.7813, 0.2659, 0.8417, 0.2844]}, {"w": "of", "b": [0.8476, 0.2659, 0.8673, 0.2844]}, {"w": "the", "b": [0.1289, 0.2851, 0.1577, 0.3036]}, {"w": "activation", "b": [0.1636, 0.2851, 0.2568, 0.3036]}, {"w": "function).", "b": [0.2627, 0.2851, 0.3552, 0.3036]}, {"w": "This", "b": [0.3611, 0.2851, 0.403, 0.3036]}, {"w": "gives", "b": [0.4089, 0.2851, 0.4588, 0.3036]}, {"w": "a", "b": [0.4647, 0.2851, 0.4752, 0.3036]}, {"w": "view", "b": [0.4811, 0.2851, 0.527, 0.3036]}, {"w": "into", "b": [0.5329, 0.2851, 0.5696, 0.3036]}, {"w": "how", "b": [0.5755, 0.2851, 0.6162, 0.3036]}, {"w": "an", "b": [0.6221, 0.2851, 0.6444, 0.3036]}, {"w": "input", "b": [0.6503, 0.2851, 0.6989, 0.3036]}, {"w": "is", "b": [0.7048, 0.2851, 0.7205, 0.3036]}, {"w": "decomposed", "b": [0.7264, 0.2851, 0.8445, 0.3036]}, {"w": "into", "b": [0.1289, 0.3043, 0.1656, 0.3228]}, {"w": "the", "b": [0.1715, 0.3043, 0.2004, 0.3228]}, {"w": "different", "b": [0.2063, 0.3043, 0.2871, 0.3228]}, {"w": "filters", "b": [0.293, 0.3043, 0.3481, 0.3228]}, {"w": "learned", "b": [0.354, 0.3043, 0.4235, 0.3228]}, {"w": "by", "b": [0.4294, 0.3043, 0.453, 0.3228]}, {"w": "the", "b": [0.4589, 0.3043, 0.4878, 0.3228]}, {"w": "network.", "b": [0.4937, 0.3043, 0.577, 0.3228]}, {"w": "You", "b": [0.5829, 0.3043, 0.6212, 0.3228]}, {"w": "want", "b": [0.6271, 0.3043, 0.673, 0.3228]}, {"w": "to", "b": [0.6789, 0.3043, 0.6973, 0.3228]}, {"w": "visualize", "b": [0.7032, 0.3043, 0.7871, 0.3228]}, {"w": "feature", "b": [0.793, 0.3043, 0.8586, 0.3228]}, {"w": "maps", "b": [0.1289, 0.3235, 0.1787, 0.342]}, {"w": "with", "b": [0.1846, 0.3235, 0.2266, 0.342]}, {"w": "three", "b": [0.2325, 0.3235, 0.2797, 0.342]}, {"w": "dimensions:", "b": [0.2856, 0.3235, 0.3998, 0.342]}, {"w": "width,", "b": [0.4057, 0.3235, 0.4654, 0.342]}, {"w": "height,", "b": [0.4713, 0.3235, 0.5362, 0.342]}, {"w": "and", "b": [0.5421, 0.3235, 0.5762, 0.342]}, {"w": "depth", "b": [0.5821, 0.3235, 0.6346, 0.342]}, {"w": "(channels).", "b": [0.6405, 0.3235, 0.7448, 0.342]}, {"w": "Each", "b": [0.7507, 0.3235, 0.7979, 0.342]}, {"w": "channel", "b": [0.1289, 0.3427, 0.2023, 0.3611]}, {"w": "encodes", "b": [0.2082, 0.3427, 0.2843, 0.3611]}, {"w": "relatively", "b": [0.2902, 0.3427, 0.3794, 0.3611]}, {"w": "independent", "b": [0.3853, 0.3427, 0.5007, 0.3611]}, {"w": "features,", "b": [0.5066, 0.3427, 0.5872, 0.3611]}, {"w": "so", "b": [0.5932, 0.3427, 0.6141, 0.3611]}, {"w": "the", "b": [0.62, 0.3427, 0.6489, 0.3611]}, {"w": "proper", "b": [0.6548, 0.3427, 0.7164, 0.3611]}, {"w": "way", "b": [0.7223, 0.3427, 0.7617, 0.3611]}, {"w": "to", "b": [0.7676, 0.3427, 0.786, 0.3611]}, {"w": "visualize", "b": [0.1289, 0.3619, 0.2128, 0.3803]}, {"w": "these", "b": [0.2187, 0.3619, 0.2673, 0.3803]}, {"w": "feature", "b": [0.2732, 0.3619, 0.3387, 0.3803]}, {"w": "maps", "b": [0.3446, 0.3619, 0.3945, 0.3803]}, {"w": "is", "b": [0.4004, 0.3619, 0.4161, 0.3803]}, {"w": "by", "b": [0.422, 0.3619, 0.4456, 0.3803]}, {"w": "independently", "b": [0.4515, 0.3619, 0.5853, 0.3803]}, {"w": "plotting", "b": [0.5913, 0.3619, 0.6647, 0.3803]}, {"w": "the", "b": [0.6706, 0.3619, 0.6995, 0.3803]}, {"w": "contents", "b": [0.7053, 0.3619, 0.784, 0.3803]}, {"w": "of", "b": [0.7899, 0.3619, 0.8096, 0.3803]}, {"w": "every", "b": [0.8155, 0.3619, 0.868, 0.3803]}, {"w": "channel", "b": [0.1289, 0.381, 0.2023, 0.3995]}, {"w": "as", "b": [0.2082, 0.381, 0.2279, 0.3995]}, {"w": "a", "b": [0.2338, 0.381, 0.2443, 0.3995]}, {"w": "2D", "b": [0.2502, 0.381, 0.279, 0.3995]}, {"w": "image.", "b": [0.2849, 0.381, 0.3486, 0.3995]}, {"w": "Let’s", "b": [0.3545, 0.381, 0.4017, 0.3995]}, {"w": "start", "b": [0.4076, 0.381, 0.4482, 0.3995]}, {"w": "by", "b": [0.4541, 0.381, 0.4777, 0.3995]}, {"w": "loading", "b": [0.4836, 0.381, 0.5545, 0.3995]}, {"w": "the", "b": [0.5604, 0.381, 0.5892, 0.3995]}, {"w": "model", "b": [0.5952, 0.381, 0.6542, 0.3995]}, {"w": "that", "b": [0.6601, 0.381, 0.6955, 0.3995]}, {"w": "you", "b": [0.7014, 0.381, 0.7368, 0.3995]}, {"w": "saved", "b": [0.7427, 0.381, 0.7965, 0.3995]}, {"w": "in", "b": [0.8024, 0.381, 0.8208, 0.3995]}, {"w": "section", "b": [0.1289, 0.4002, 0.1958, 0.4187]}, {"w": "5.2:", "b": [0.2017, 0.4002, 0.2377, 0.4187]}]}, {"id": "b_3", "type": "paragraph", "text": ">>> from keras.models import load_model >>> model = load_model('cats_and_dogs_small_2.h5') >>> model.summary() <1> As a reminder. ________________________________________________________________ Layer (type) Output Shape Param # ================================================================ conv2d_5 (Conv2D) (None, 148, 148, 32) 896 ________________________________________________________________ maxpooling2d_5 (MaxPooling2D) (None, 74, 74, 32) 0 ________________________________________________________________ conv2d_6 (Conv2D) (None, 72, 72, 64) 18496 ________________________________________________________________ maxpooling2d_6 (MaxPooling2D) (None, 36, 36, 64) 0 ________________________________________________________________ conv2d_7 (Conv2D) (None, 34, 34, 128) 73856 ________________________________________________________________ maxpooling2d_7 (MaxPooling2D) (None, 17, 17, 128) 0 ________________________________________________________________ conv2d_8 (Conv2D) (None, 15, 15, 128) 147584 ________________________________________________________________ maxpooling2d_8 (MaxPooling2D) (None, 7, 7, 128) 0 ________________________________________________________________ flatten_2 (Flatten) (None, 6272) 0 ________________________________________________________________ dropout_1 (Dropout) (None, 6272) 0 ________________________________________________________________ dense_3 (Dense) (None, 512) 3211776 ________________________________________________________________ dense_4 (Dense) (None, 1) 513 ================================================================ Total params: 3,453,121", "words": [{"w": ">>>", "b": [0.1348, 0.4356, 0.1667, 0.4497]}, {"w": "from", "b": [0.1773, 0.4356, 0.2198, 0.4497]}, {"w": "keras.models", "b": [0.2304, 0.4356, 0.3579, 0.4497]}, {"w": "import", "b": [0.3686, 0.4356, 0.4323, 0.4497]}, {"w": "load_model", "b": [0.443, 0.4356, 0.5492, 0.4497]}, {"w": ">>>", "b": [0.1348, 0.4497, 0.1667, 0.4639]}, {"w": "model", "b": [0.1773, 0.4497, 0.2304, 0.4639]}, {"w": "=", "b": [0.241, 0.4497, 0.2517, 0.4639]}, {"w": "load_model('cats_and_dogs_small_2.h5')", "b": [0.2623, 0.4497, 0.6661, 0.4639]}, {"w": ">>>", "b": [0.1348, 0.4639, 0.1667, 0.4781]}, {"w": "model.summary()", "b": [0.1773, 0.4639, 0.3367, 0.4781]}, {"w": "<1>", "b": [0.3579, 0.4639, 0.3898, 0.4781]}, {"w": "As", "b": [0.4004, 0.4639, 0.4217, 0.4781]}, {"w": "a", "b": [0.4323, 0.4639, 0.443, 0.4781]}, {"w": "reminder.", "b": [0.4536, 0.4639, 0.5492, 0.4781]}, {"w": "________________________________________________________________", "b": [0.1348, 0.4781, 0.8149, 0.4923]}, {"w": "Layer", "b": [0.1348, 0.4923, 0.1879, 0.5065]}, {"w": "(type)", "b": [0.1985, 0.4923, 0.2623, 0.5065]}, {"w": "Output", "b": [0.4855, 0.4923, 0.5492, 0.5065]}, {"w": "Shape", "b": [0.5598, 0.4923, 0.613, 0.5065]}, {"w": "Param", "b": [0.7192, 0.4923, 0.7724, 0.5065]}, {"w": "#", "b": [0.783, 0.4923, 0.7936, 0.5065]}, {"w": "================================================================", "b": [0.1348, 0.5065, 0.8149, 0.5207]}, {"w": "conv2d_5", "b": [0.1348, 0.5207, 0.2198, 0.5348]}, {"w": "(Conv2D)", "b": [0.2304, 0.5207, 0.3154, 0.5348]}, {"w": "(None,", "b": [0.4855, 0.5207, 0.5492, 0.5348]}, {"w": "148,", "b": [0.5598, 0.5207, 0.6024, 0.5348]}, {"w": "148,", "b": [0.613, 0.5207, 0.6555, 0.5348]}, {"w": "32)", "b": [0.6661, 0.5207, 0.698, 0.5348]}, {"w": "896", "b": [0.7192, 0.5207, 0.7511, 0.5348]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5349, 0.8149, 0.549]}, {"w": "maxpooling2d_5", "b": [0.1348, 0.549, 0.2836, 0.5632]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.549, 0.443, 0.5632]}, {"w": "(None,", "b": [0.4855, 0.549, 0.5492, 0.5632]}, {"w": "74,", "b": [0.5598, 0.549, 0.5917, 0.5632]}, {"w": "74,", "b": [0.6024, 0.549, 0.6342, 0.5632]}, {"w": "32)", "b": [0.6449, 0.549, 0.6767, 0.5632]}, {"w": "0", "b": [0.7192, 0.549, 0.7299, 0.5632]}, {"w": "________________________________________________________________", "b": [0.1348, 0.5774, 0.8149, 0.5916]}, {"w": "conv2d_6", "b": [0.1348, 0.5916, 0.2198, 0.6058]}, {"w": "(Conv2D)", "b": [0.2304, 0.5916, 0.3154, 0.6058]}, {"w": "(None,", "b": [0.4855, 0.5916, 0.5492, 0.6058]}, {"w": "72,", "b": [0.5598, 0.5916, 0.5917, 0.6058]}, {"w": "72,", "b": [0.6024, 0.5916, 0.6342, 0.6058]}, {"w": "64)", "b": [0.6449, 0.5916, 0.6767, 0.6058]}, {"w": "18496", "b": [0.7192, 0.5916, 0.7724, 0.6058]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6058, 0.8149, 0.62]}, {"w": "maxpooling2d_6", "b": [0.1348, 0.62, 0.2836, 0.6341]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.62, 0.443, 0.6341]}, {"w": "(None,", "b": [0.4855, 0.62, 0.5492, 0.6341]}, {"w": "36,", "b": [0.5598, 0.62, 0.5917, 0.6341]}, {"w": "36,", "b": [0.6024, 0.62, 0.6342, 0.6341]}, {"w": "64)", "b": [0.6449, 0.62, 0.6767, 0.6341]}, {"w": "0", "b": [0.7192, 0.62, 0.7299, 0.6341]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6341, 0.8149, 0.6483]}, {"w": "conv2d_7", "b": [0.1348, 0.6483, 0.2198, 0.6625]}, {"w": "(Conv2D)", "b": [0.2304, 0.6483, 0.3154, 0.6625]}, {"w": "(None,", "b": [0.4855, 0.6483, 0.5492, 0.6625]}, {"w": "34,", "b": [0.5598, 0.6483, 0.5917, 0.6625]}, {"w": "34,", "b": [0.6024, 0.6483, 0.6342, 0.6625]}, {"w": "128)", "b": [0.6449, 0.6483, 0.6874, 0.6625]}, {"w": "73856", "b": [0.7192, 0.6483, 0.7724, 0.6625]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6625, 0.8149, 0.6767]}, {"w": "maxpooling2d_7", "b": [0.1348, 0.6767, 0.2836, 0.6909]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.6767, 0.443, 0.6909]}, {"w": "(None,", "b": [0.4855, 0.6767, 0.5492, 0.6909]}, {"w": "17,", "b": [0.5598, 0.6767, 0.5917, 0.6909]}, {"w": "17,", "b": [0.6024, 0.6767, 0.6342, 0.6909]}, {"w": "128)", "b": [0.6449, 0.6767, 0.6874, 0.6909]}, {"w": "0", "b": [0.7192, 0.6767, 0.7299, 0.6909]}, {"w": "________________________________________________________________", "b": [0.1348, 0.6909, 0.8149, 0.7051]}, {"w": "conv2d_8", "b": [0.1348, 0.7051, 0.2198, 0.7192]}, {"w": "(Conv2D)", "b": [0.2304, 0.7051, 0.3154, 0.7192]}, {"w": "(None,", "b": [0.4855, 0.7051, 0.5492, 0.7192]}, {"w": "15,", "b": [0.5598, 0.7051, 0.5917, 0.7192]}, {"w": "15,", "b": [0.6024, 0.7051, 0.6342, 0.7192]}, {"w": "128)", "b": [0.6449, 0.7051, 0.6874, 0.7192]}, {"w": "147584", "b": [0.7192, 0.7051, 0.783, 0.7192]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7193, 0.8149, 0.7334]}, {"w": "maxpooling2d_8", "b": [0.1348, 0.7334, 0.2836, 0.7476]}, {"w": "(MaxPooling2D)", "b": [0.2942, 0.7334, 0.443, 0.7476]}, {"w": "(None,", "b": [0.4855, 0.7334, 0.5492, 0.7476]}, {"w": "7,", "b": [0.5598, 0.7334, 0.5811, 0.7476]}, {"w": "7,", "b": [0.5917, 0.7334, 0.613, 0.7476]}, {"w": "128)", "b": [0.6236, 0.7334, 0.6661, 0.7476]}, {"w": "0", "b": [0.7192, 0.7334, 0.7299, 0.7476]}, {"w": "________________________________________________________________", "b": [0.1348, 0.7476, 0.8149, 0.7618]}, {"w": "flatten_2", "b": [0.1348, 0.7618, 0.2304, 0.776]}, {"w": "(Flatten)", "b": [0.241, 0.7618, 0.3367, 0.776]}, {"w": "(None,", "b": [0.4855, 0.7618, 0.5492, 0.776]}, {"w": "6272)", "b": [0.5598, 0.7618, 0.613, 0.776]}, {"w": "0", "b": [0.7192, 0.7618, 0.7299, 0.776]}, {"w": "________________________________________________________________", "b": [0.1348, 0.776, 0.8149, 0.7902]}, {"w": "dropout_1", "b": [0.1348, 0.7902, 0.2304, 0.8044]}, {"w": "(Dropout)", "b": [0.241, 0.7902, 0.3367, 0.8044]}, {"w": "(None,", "b": [0.4855, 0.7902, 0.5492, 0.8044]}, {"w": "6272)", "b": [0.5598, 0.7902, 0.613, 0.8044]}, {"w": "0", "b": [0.7192, 0.7902, 0.7299, 0.8044]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8044, 0.8149, 0.8185]}, {"w": "dense_3", "b": [0.1348, 0.8185, 0.2092, 0.8327]}, {"w": "(Dense)", "b": [0.2198, 0.8185, 0.2942, 0.8327]}, {"w": "(None,", "b": [0.4855, 0.8185, 0.5492, 0.8327]}, {"w": "512)", "b": [0.5598, 0.8185, 0.6024, 0.8327]}, {"w": "3211776", "b": [0.7192, 0.8185, 0.7936, 0.8327]}, {"w": "________________________________________________________________", "b": [0.1348, 0.8327, 0.8149, 0.8469]}, {"w": "dense_4", "b": [0.1348, 0.8469, 0.2092, 0.8611]}, {"w": "(Dense)", "b": [0.2198, 0.8469, 0.2942, 0.8611]}, {"w": "(None,", "b": [0.4855, 0.8469, 0.5492, 0.8611]}, {"w": "1)", "b": [0.5598, 0.8469, 0.5811, 0.8611]}, {"w": "513", "b": [0.7192, 0.8469, 0.7511, 0.8611]}, {"w": "================================================================", "b": [0.1348, 0.8611, 0.8149, 0.8753]}, {"w": "Total", "b": [0.1348, 0.8753, 0.1879, 0.8895]}, {"w": "params:", "b": [0.1985, 0.8753, 0.2729, 0.8895]}, {"w": "3,453,121", "b": [0.2836, 0.8753, 0.3792, 0.8895]}]}]}, {"page": 218, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Trainable params: 3,453,121 Non-trainable params: 0", "words": [{"w": "Trainable", "b": [0.1348, 0.0851, 0.2304, 0.0993]}, {"w": "params:", "b": [0.241, 0.0851, 0.3154, 0.0993]}, {"w": "3,453,121", "b": [0.3261, 0.0851, 0.4217, 0.0993]}, {"w": "Non-trainable", "b": [0.1348, 0.0993, 0.2729, 0.1135]}, {"w": "params:", "b": [0.2836, 0.0993, 0.3579, 0.1135]}, {"w": "0", "b": [0.3686, 0.0993, 0.3792, 0.1135]}]}, {"id": "b_1", "type": "paragraph", "text": "Next, you’ll get an input image—a picture of a cat, not part of the images the network was trained on.", "words": [{"w": "Next,", "b": [0.1289, 0.1349, 0.1807, 0.1534]}, {"w": "you’ll", "b": [0.1866, 0.1349, 0.243, 0.1534]}, {"w": "get", "b": [0.2489, 0.1349, 0.2778, 0.1534]}, {"w": "an", "b": [0.2837, 0.1349, 0.306, 0.1534]}, {"w": "input", "b": [0.3119, 0.1349, 0.3604, 0.1534]}, {"w": "image—a", "b": [0.3663, 0.1349, 0.4581, 0.1534]}, {"w": "picture", "b": [0.464, 0.1349, 0.5296, 0.1534]}, {"w": "of", "b": [0.5355, 0.1349, 0.5552, 0.1534]}, {"w": "a", "b": [0.5611, 0.1349, 0.5716, 0.1534]}, {"w": "cat,", "b": [0.5775, 0.1349, 0.6109, 0.1534]}, {"w": "not", "b": [0.6168, 0.1349, 0.647, 0.1534]}, {"w": "part", "b": [0.6529, 0.1349, 0.6896, 0.1534]}, {"w": "of", "b": [0.6955, 0.1349, 0.7152, 0.1534]}, {"w": "the", "b": [0.7211, 0.1349, 0.75, 0.1534]}, {"w": "images", "b": [0.7559, 0.1349, 0.8228, 0.1534]}, {"w": "the", "b": [0.8287, 0.1349, 0.8575, 0.1534]}, {"w": "network", "b": [0.1289, 0.1541, 0.2063, 0.1726]}, {"w": "was", "b": [0.2122, 0.1541, 0.2489, 0.1726]}, {"w": "trained", "b": [0.2548, 0.1541, 0.3204, 0.1726]}, {"w": "on.", "b": [0.3263, 0.1541, 0.3558, 0.1726]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.25. Preprocessing a single image", "words": [{"w": "Listing", "b": [0.1289, 0.1895, 0.182, 0.2034]}, {"w": "5.25.", "b": [0.1865, 0.1895, 0.2219, 0.2034]}, {"w": "Preprocessing", "b": [0.2263, 0.1895, 0.3319, 0.2034]}, {"w": "a", "b": [0.3363, 0.1895, 0.3452, 0.2034]}, {"w": "single", "b": [0.3496, 0.1895, 0.3929, 0.2034]}, {"w": "image", "b": [0.3973, 0.1895, 0.4426, 0.2034]}]}, {"id": "b_3", "type": "paragraph", "text": "img_path = '/Users/fchollet/Downloads/cats_and_dogs_small/test/cats/cat.1700.jpg' from keras.preprocessing import image 1 import numpy as np img = image.load_img(img_path, target_size=(150, 150)) img_tensor = image.img_to_array(img) img_tensor = np.expand_dims(img_tensor, axis=0) img_tensor /= 255. 2 <1> Its shape is (1, 150, 150, 3) print(img_tensor.shape)", "words": [{"w": "img_path", "b": [0.1348, 0.2161, 0.2198, 0.2303]}, {"w": "=", "b": [0.2304, 0.2161, 0.241, 0.2303]}, {"w": "'/Users/fchollet/Downloads/cats_and_dogs_small/test/cats/cat.1700.jpg'", "b": [0.1348, 0.2303, 0.8786, 0.2445]}, {"w": "from", "b": [0.1348, 0.2728, 0.1773, 0.287]}, {"w": "keras.preprocessing", "b": [0.1879, 0.2728, 0.3898, 0.287]}, {"w": "import", "b": [0.4004, 0.2728, 0.4642, 0.287]}, {"w": "image", "b": [0.4748, 0.2728, 0.528, 0.287]}, {"w": "1", "b": [0.8362, 0.2728, 0.8469, 0.287]}, {"w": "import", "b": [0.1348, 0.287, 0.1985, 0.3012]}, {"w": "numpy", "b": [0.2092, 0.287, 0.2623, 0.3012]}, {"w": "as", "b": [0.2729, 0.287, 0.2942, 0.3012]}, {"w": "np", "b": [0.3048, 0.287, 0.3261, 0.3012]}, {"w": "img", "b": [0.1348, 0.3154, 0.1667, 0.3296]}, {"w": "=", "b": [0.1773, 0.3154, 0.1879, 0.3296]}, {"w": "image.load_img(img_path,", "b": [0.1985, 0.3154, 0.4536, 0.3296]}, {"w": "target_size=(150,", "b": [0.4642, 0.3154, 0.6449, 0.3296]}, {"w": "150))", "b": [0.6555, 0.3154, 0.7086, 0.3296]}, {"w": "img_tensor", "b": [0.1348, 0.3296, 0.241, 0.3438]}, {"w": "=", "b": [0.2517, 0.3296, 0.2623, 0.3438]}, {"w": "image.img_to_array(img)", "b": [0.2729, 0.3296, 0.5173, 0.3438]}, {"w": "img_tensor", "b": [0.1348, 0.3438, 0.241, 0.358]}, {"w": "=", "b": [0.2517, 0.3438, 0.2623, 0.358]}, {"w": "np.expand_dims(img_tensor,", "b": [0.2729, 0.3438, 0.5492, 0.358]}, {"w": "axis=0)", "b": [0.5598, 0.3438, 0.6342, 0.358]}, {"w": "img_tensor", "b": [0.1348, 0.358, 0.241, 0.3721]}, {"w": "/=", "b": [0.2517, 0.358, 0.2729, 0.3721]}, {"w": "255.", "b": [0.2836, 0.358, 0.3261, 0.3721]}, {"w": "2", "b": [0.8256, 0.358, 0.8362, 0.3721]}, {"w": "<1>", "b": [0.1348, 0.3863, 0.1667, 0.4005]}, {"w": "Its", "b": [0.1773, 0.3863, 0.2092, 0.4005]}, {"w": "shape", "b": [0.2198, 0.3863, 0.2729, 0.4005]}, {"w": "is", "b": [0.2836, 0.3863, 0.3048, 0.4005]}, {"w": "(1,", "b": [0.3154, 0.3863, 0.3473, 0.4005]}, {"w": "150,", "b": [0.3579, 0.3863, 0.4004, 0.4005]}, {"w": "150,", "b": [0.4111, 0.3863, 0.4536, 0.4005]}, {"w": "3)", "b": [0.4642, 0.3863, 0.4855, 0.4005]}, {"w": "print(img_tensor.shape)", "b": [0.1348, 0.4005, 0.3792, 0.4147]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Preprocesses the image into a 4D tensor 2 Remember that the model was trained on inputs that were preprocessed this way.", "words": [{"w": "1", "b": [0.1761, 0.4319, 0.1879, 0.4504]}, {"w": "Preprocesses", "b": [0.1938, 0.4319, 0.3228, 0.4504]}, {"w": "the", "b": [0.3287, 0.4319, 0.3602, 0.4504]}, {"w": "image", "b": [0.3661, 0.4319, 0.4264, 0.4504]}, {"w": "into", "b": [0.4323, 0.4319, 0.4717, 0.4504]}, {"w": "a", "b": [0.4776, 0.4319, 0.4894, 0.4504]}, {"w": "4D", "b": [0.4953, 0.4319, 0.5241, 0.4504]}, {"w": "tensor", "b": [0.5301, 0.4319, 0.593, 0.4504]}, {"w": "2", "b": [0.1761, 0.4511, 0.1879, 0.4696]}, {"w": "Remember", "b": [0.1938, 0.4511, 0.3053, 0.4696]}, {"w": "that", "b": [0.3112, 0.4511, 0.3518, 0.4696]}, {"w": "the", "b": [0.3578, 0.4511, 0.3892, 0.4696]}, {"w": "model", "b": [0.3951, 0.4511, 0.4568, 0.4696]}, {"w": "was", "b": [0.4627, 0.4511, 0.5007, 0.4696]}, {"w": "trained", "b": [0.5066, 0.4511, 0.5801, 0.4696]}, {"w": "on", "b": [0.586, 0.4511, 0.6109, 0.4696]}, {"w": "inputs", "b": [0.6169, 0.4511, 0.6799, 0.4696]}, {"w": "that", "b": [0.6858, 0.4511, 0.7264, 0.4696]}, {"w": "were", "b": [0.7323, 0.4511, 0.7804, 0.4696]}, {"w": "preprocessed", "b": [0.1761, 0.4703, 0.3077, 0.4888]}, {"w": "this", "b": [0.3136, 0.4703, 0.3504, 0.4888]}, {"w": "way.", "b": [0.3563, 0.4703, 0.4016, 0.4888]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s display the picture (see figure 5.24).", "words": [{"w": "Let’s", "b": [0.1289, 0.5104, 0.1761, 0.5289]}, {"w": "display", "b": [0.182, 0.5104, 0.2502, 0.5289]}, {"w": "the", "b": [0.2561, 0.5104, 0.285, 0.5289]}, {"w": "picture", "b": [0.2909, 0.5104, 0.3565, 0.5289]}, {"w": "(see", "b": [0.3624, 0.5104, 0.4004, 0.5289]}, {"w": "figure", "b": [0.4063, 0.5104, 0.4626, 0.5289]}, {"w": "5.24).", "b": [0.4686, 0.5104, 0.5236, 0.5289]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 5.24. The test cat picture", "words": [{"w": "Figure", "b": [0.1289, 0.5458, 0.1787, 0.5597]}, {"w": "5.24.", "b": [0.1832, 0.5458, 0.2186, 0.5597]}, {"w": "The", "b": [0.223, 0.5458, 0.2525, 0.5597]}, {"w": "test", "b": [0.2569, 0.5458, 0.2835, 0.5597]}, {"w": "cat", "b": [0.2879, 0.5458, 0.3105, 0.5597]}, {"w": "picture", "b": [0.315, 0.5458, 0.3687, 0.5597]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 5.26. Displaying the test picture", "words": [{"w": "Listing", "b": [0.1289, 0.8387, 0.182, 0.8525]}, {"w": "5.26.", "b": [0.1865, 0.8387, 0.2219, 0.8525]}, {"w": "Displaying", "b": [0.2263, 0.8387, 0.307, 0.8525]}, {"w": "the", "b": [0.3114, 0.8387, 0.335, 0.8525]}, {"w": "test", "b": [0.3395, 0.8387, 0.366, 0.8525]}, {"w": "picture", "b": [0.3704, 0.8387, 0.4242, 0.8525]}]}, {"id": "b_8", "type": "paragraph", "text": "import matplotlib.pyplot as plt", "words": [{"w": "import", "b": [0.1348, 0.8653, 0.1985, 0.8794]}, {"w": "matplotlib.pyplot", "b": [0.2092, 0.8653, 0.3898, 0.8794]}, {"w": "as", "b": [0.4004, 0.8653, 0.4217, 0.8794]}, {"w": "plt", "b": [0.4323, 0.8653, 0.4642, 0.8794]}]}]}, {"page": 219, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "plt.imshow(img_tensor[0]) plt.show()", "words": [{"w": "plt.imshow(img_tensor[0])", "b": [0.1348, 0.0851, 0.4004, 0.0993]}, {"w": "plt.show()", "b": [0.1348, 0.0993, 0.241, 0.1135]}]}, {"id": "b_1", "type": "paragraph", "text": "In order to extract the feature maps you want to look at, you’ll create a Keras model that takes batches of images as input, and outputs the activations of all convolution and pooling layers. To do this, you’ll use the Keras class Model. A model is instantiated using two arguments: an input tensor (or list of input tensors) and an output tensor (or list of output tensors). The resulting class is a Keras model, just like the Sequential models you’re familiar with, mapping the specified inputs to the specified outputs. What sets the Model class apart is that it allows for models with multiple outputs, unlike Sequential. For more information about the Model class, see section 7.1.", "words": [{"w": "In", "b": [0.1289, 0.1349, 0.1485, 0.1534]}, {"w": "order", "b": [0.1545, 0.1349, 0.2043, 0.1534]}, {"w": "to", "b": [0.2102, 0.1349, 0.2286, 0.1534]}, {"w": "extract", "b": [0.2345, 0.1349, 0.2987, 0.1534]}, {"w": "the", "b": [0.3046, 0.1349, 0.3335, 0.1534]}, {"w": "feature", "b": [0.3394, 0.1349, 0.4049, 0.1534]}, {"w": "maps", "b": [0.4108, 0.1349, 0.4607, 0.1534]}, {"w": "you", "b": [0.4666, 0.1349, 0.502, 0.1534]}, {"w": "want", "b": [0.5079, 0.1349, 0.5538, 0.1534]}, {"w": "to", "b": [0.5597, 0.1349, 0.5781, 0.1534]}, {"w": "look", "b": [0.584, 0.1349, 0.626, 0.1534]}, {"w": "at,", "b": [0.6319, 0.1349, 0.6548, 0.1534]}, {"w": "you’ll", "b": [0.6608, 0.1349, 0.7172, 0.1534]}, {"w": "create", "b": [0.7231, 0.1349, 0.7794, 0.1534]}, {"w": "a", "b": [0.7853, 0.1349, 0.7958, 0.1534]}, {"w": "Keras", "b": [0.8017, 0.1349, 0.8568, 0.1534]}, {"w": "model", "b": [0.1289, 0.1541, 0.1879, 0.1726]}, {"w": "that", "b": [0.1938, 0.1541, 0.2292, 0.1726]}, {"w": "takes", "b": [0.2351, 0.1541, 0.2837, 0.1726]}, {"w": "batches", "b": [0.2896, 0.1541, 0.3604, 0.1726]}, {"w": "of", "b": [0.3663, 0.1541, 0.386, 0.1726]}, {"w": "images", "b": [0.3919, 0.1541, 0.4588, 0.1726]}, {"w": "as", "b": [0.4647, 0.1541, 0.4843, 0.1726]}, {"w": "input,", "b": [0.4903, 0.1541, 0.5447, 0.1726]}, {"w": "and", "b": [0.5505, 0.1541, 0.5846, 0.1726]}, {"w": "outputs", "b": [0.5906, 0.1541, 0.6601, 0.1726]}, {"w": "the", "b": [0.666, 0.1541, 0.6949, 0.1726]}, {"w": "activations", "b": [0.7008, 0.1541, 0.8031, 0.1726]}, {"w": "of", "b": [0.809, 0.1541, 0.8287, 0.1726]}, {"w": "all", "b": [0.8346, 0.1541, 0.8582, 0.1726]}, {"w": "convolution", "b": [0.1289, 0.1733, 0.2417, 0.1918]}, {"w": "and", "b": [0.2476, 0.1733, 0.2817, 0.1918]}, {"w": "pooling", "b": [0.2876, 0.1733, 0.3598, 0.1918]}, {"w": "layers.", "b": [0.3657, 0.1733, 0.428, 0.1918]}, {"w": "To", "b": [0.4339, 0.1733, 0.4584, 0.1918]}, {"w": "do", "b": [0.4643, 0.1733, 0.488, 0.1918]}, {"w": "this,", "b": [0.4939, 0.1733, 0.5339, 0.1918]}, {"w": "you’ll", "b": [0.5398, 0.1733, 0.5962, 0.1918]}, {"w": "use", "b": [0.6021, 0.1733, 0.6336, 0.1918]}, {"w": "the", "b": [0.6395, 0.1733, 0.6683, 0.1918]}, {"w": "Keras", "b": [0.6742, 0.1733, 0.7293, 0.1918]}, {"w": "class", "b": [0.7352, 0.1733, 0.7811, 0.1918]}, {"w": "Model.", "b": [0.787, 0.1733, 0.8638, 0.1932]}, {"w": "A", "b": [0.1289, 0.1933, 0.1459, 0.2118]}, {"w": "model", "b": [0.1518, 0.1933, 0.2109, 0.2118]}, {"w": "is", "b": [0.2168, 0.1933, 0.2325, 0.2118]}, {"w": "instantiated", "b": [0.2384, 0.1933, 0.3473, 0.2118]}, {"w": "using", "b": [0.3532, 0.1933, 0.4044, 0.2118]}, {"w": "two", "b": [0.4103, 0.1933, 0.4457, 0.2118]}, {"w": "arguments:", "b": [0.4516, 0.1933, 0.5561, 0.2118]}, {"w": "an", "b": [0.562, 0.1933, 0.5843, 0.2118]}, {"w": "input", "b": [0.5902, 0.1933, 0.6387, 0.2118]}, {"w": "tensor", "b": [0.6447, 0.1933, 0.7024, 0.2118]}, {"w": "(or", "b": [0.7083, 0.1933, 0.7358, 0.2118]}, {"w": "list", "b": [0.7417, 0.1933, 0.7706, 0.2118]}, {"w": "of", "b": [0.7765, 0.1933, 0.7962, 0.2118]}, {"w": "input", "b": [0.8021, 0.1933, 0.8506, 0.2118]}, {"w": "tensors)", "b": [0.1289, 0.2125, 0.2036, 0.231]}, {"w": "and", "b": [0.2095, 0.2125, 0.2436, 0.231]}, {"w": "an", "b": [0.2495, 0.2125, 0.2718, 0.231]}, {"w": "output", "b": [0.2777, 0.2125, 0.3381, 0.231]}, {"w": "tensor", "b": [0.344, 0.2125, 0.4017, 0.231]}, {"w": "(or", "b": [0.4076, 0.2125, 0.4352, 0.231]}, {"w": "list", "b": [0.4411, 0.2125, 0.4699, 0.231]}, {"w": "of", "b": [0.4758, 0.2125, 0.4955, 0.231]}, {"w": "output", "b": [0.5014, 0.2125, 0.5617, 0.231]}, {"w": "tensors).", "b": [0.5676, 0.2125, 0.6483, 0.231]}, {"w": "The", "b": [0.6542, 0.2125, 0.6909, 0.231]}, {"w": "resulting", "b": [0.6968, 0.2125, 0.7795, 0.231]}, {"w": "class", "b": [0.7854, 0.2125, 0.8313, 0.231]}, {"w": "is", "b": [0.8372, 0.2125, 0.853, 0.231]}, {"w": "a", "b": [0.8589, 0.2125, 0.8693, 0.231]}, {"w": "Keras", "b": [0.1289, 0.2317, 0.1839, 0.2502]}, {"w": "model,", "b": [0.1898, 0.2317, 0.2548, 0.2502]}, {"w": "just", "b": [0.2607, 0.2317, 0.2948, 0.2502]}, {"w": "like", "b": [0.3007, 0.2317, 0.3361, 0.2502]}, {"w": "the", "b": [0.342, 0.2317, 0.3709, 0.2502]}, {"w": "Sequential", "b": [0.3768, 0.2327, 0.5184, 0.2516]}, {"w": "models", "b": [0.5244, 0.2317, 0.5926, 0.2502]}, {"w": "you’re", "b": [0.5985, 0.2317, 0.6601, 0.2502]}, {"w": "familiar", "b": [0.666, 0.2317, 0.7408, 0.2502]}, {"w": "with,", "b": [0.7467, 0.2317, 0.7946, 0.2502]}, {"w": "mapping", "b": [0.1289, 0.2517, 0.2115, 0.2702]}, {"w": "the", "b": [0.2174, 0.2517, 0.2463, 0.2702]}, {"w": "specified", "b": [0.2522, 0.2517, 0.3374, 0.2702]}, {"w": "inputs", "b": [0.3433, 0.2517, 0.4011, 0.2702]}, {"w": "to", "b": [0.407, 0.2517, 0.4254, 0.2702]}, {"w": "the", "b": [0.4313, 0.2517, 0.4601, 0.2702]}, {"w": "specified", "b": [0.466, 0.2517, 0.5513, 0.2702]}, {"w": "outputs.", "b": [0.5572, 0.2517, 0.6326, 0.2702]}, {"w": "What", "b": [0.6385, 0.2517, 0.6897, 0.2702]}, {"w": "sets", "b": [0.6956, 0.2517, 0.731, 0.2702]}, {"w": "the", "b": [0.7369, 0.2517, 0.7658, 0.2702]}, {"w": "Model", "b": [0.7716, 0.2527, 0.8424, 0.2716]}, {"w": "class", "b": [0.1289, 0.2717, 0.1748, 0.2902]}, {"w": "apart", "b": [0.1807, 0.2717, 0.2279, 0.2902]}, {"w": "is", "b": [0.2338, 0.2717, 0.2495, 0.2902]}, {"w": "that", "b": [0.2555, 0.2717, 0.2909, 0.2902]}, {"w": "it", "b": [0.2968, 0.2717, 0.3099, 0.2902]}, {"w": "allows", "b": [0.3158, 0.2717, 0.3775, 0.2902]}, {"w": "for", "b": [0.3834, 0.2717, 0.4109, 0.2902]}, {"w": "models", "b": [0.4168, 0.2717, 0.485, 0.2902]}, {"w": "with", "b": [0.4909, 0.2717, 0.5329, 0.2902]}, {"w": "multiple", "b": [0.5388, 0.2717, 0.6176, 0.2902]}, {"w": "outputs,", "b": [0.6235, 0.2717, 0.6989, 0.2902]}, {"w": "unlike", "b": [0.7048, 0.2717, 0.7639, 0.2902]}, {"w": "Sequential.", "b": [0.1289, 0.2909, 0.2765, 0.3108]}, {"w": "For", "b": [0.2824, 0.2909, 0.3152, 0.3094]}, {"w": "more", "b": [0.3211, 0.2909, 0.3696, 0.3094]}, {"w": "information", "b": [0.3755, 0.2909, 0.487, 0.3094]}, {"w": "about", "b": [0.4929, 0.2909, 0.5454, 0.3094]}, {"w": "the", "b": [0.5513, 0.2909, 0.5802, 0.3094]}, {"w": "Model", "b": [0.586, 0.2919, 0.6569, 0.3108]}, {"w": "class,", "b": [0.6628, 0.2909, 0.7146, 0.3094]}, {"w": "see", "b": [0.7205, 0.2909, 0.7506, 0.3094]}, {"w": "section", "b": [0.7565, 0.2909, 0.8234, 0.3094]}, {"w": "7.1.", "b": [0.8293, 0.2909, 0.8647, 0.3094]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.27. Instantiating a model from an input tensor and a list of output tensors", "words": [{"w": "Listing", "b": [0.1289, 0.3272, 0.182, 0.341]}, {"w": "5.27.", "b": [0.1865, 0.3272, 0.2219, 0.341]}, {"w": "Instantiating", "b": [0.2263, 0.3272, 0.3237, 0.341]}, {"w": "a", "b": [0.3281, 0.3272, 0.337, 0.341]}, {"w": "model", "b": [0.3414, 0.3272, 0.3877, 0.341]}, {"w": "from", "b": [0.3921, 0.3272, 0.4292, 0.341]}, {"w": "an", "b": [0.4336, 0.3272, 0.4523, 0.341]}, {"w": "input", "b": [0.4567, 0.3272, 0.4971, 0.341]}, {"w": "tensor", "b": [0.5015, 0.3272, 0.5487, 0.341]}, {"w": "and", "b": [0.5531, 0.3272, 0.5817, 0.341]}, {"w": "a", "b": [0.5861, 0.3272, 0.595, 0.341]}, {"w": "list", "b": [0.5994, 0.3272, 0.622, 0.341]}, {"w": "of", "b": [0.6265, 0.3272, 0.6412, 0.341]}, {"w": "output", "b": [0.6457, 0.3272, 0.6958, 0.341]}, {"w": "tensors", "b": [0.7003, 0.3272, 0.7544, 0.341]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras import models layer_outputs = [layer.output for layer in model.layers[:8]] 1 activation_model = models.Model(inputs=model.input, outputs=layer_outputs) 2", "words": [{"w": "from", "b": [0.1348, 0.3538, 0.1773, 0.368]}, {"w": "keras", "b": [0.1879, 0.3538, 0.241, 0.368]}, {"w": "import", "b": [0.2517, 0.3538, 0.3154, 0.368]}, {"w": "models", "b": [0.3261, 0.3538, 0.3898, 0.368]}, {"w": "layer_outputs", "b": [0.1348, 0.3822, 0.2729, 0.3963]}, {"w": "=", "b": [0.2836, 0.3822, 0.2942, 0.3963]}, {"w": "[layer.output", "b": [0.3048, 0.3822, 0.443, 0.3963]}, {"w": "for", "b": [0.4536, 0.3822, 0.4855, 0.3963]}, {"w": "layer", "b": [0.4961, 0.3822, 0.5492, 0.3963]}, {"w": "in", "b": [0.5598, 0.3822, 0.5811, 0.3963]}, {"w": "model.layers[:8]]", "b": [0.5917, 0.3822, 0.7724, 0.3963]}, {"w": "1", "b": [0.1348, 0.3963, 0.1454, 0.4105]}, {"w": "activation_model", "b": [0.1348, 0.4105, 0.3048, 0.4247]}, {"w": "=", "b": [0.3154, 0.4105, 0.3261, 0.4247]}, {"w": "models.Model(inputs=model.input,", "b": [0.3367, 0.4105, 0.6767, 0.4247]}, {"w": "outputs=layer_outputs)", "b": [0.1348, 0.4247, 0.3686, 0.4389]}, {"w": "2", "b": [0.3792, 0.4247, 0.3899, 0.4389]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Extracts the outputs of the top eight layers 2 Creates a model that will return these outputs, given the model input", "words": [{"w": "1", "b": [0.1761, 0.4561, 0.1879, 0.4746]}, {"w": "Extracts", "b": [0.1938, 0.4561, 0.2791, 0.4746]}, {"w": "the", "b": [0.285, 0.4561, 0.3164, 0.4746]}, {"w": "outputs", "b": [0.3224, 0.4561, 0.3985, 0.4746]}, {"w": "of", "b": [0.4044, 0.4561, 0.424, 0.4746]}, {"w": "the", "b": [0.4299, 0.4561, 0.4614, 0.4746]}, {"w": "top", "b": [0.4673, 0.4561, 0.5001, 0.4746]}, {"w": "eight", "b": [0.506, 0.4561, 0.5559, 0.4746]}, {"w": "layers", "b": [0.5618, 0.4561, 0.6221, 0.4746]}, {"w": "2", "b": [0.1761, 0.4753, 0.1879, 0.4938]}, {"w": "Creates", "b": [0.1938, 0.4753, 0.2708, 0.4938]}, {"w": "a", "b": [0.2767, 0.4753, 0.2885, 0.4938]}, {"w": "model", "b": [0.2944, 0.4753, 0.356, 0.4938]}, {"w": "that", "b": [0.3619, 0.4753, 0.4026, 0.4938]}, {"w": "will", "b": [0.4085, 0.4753, 0.4452, 0.4938]}, {"w": "return", "b": [0.4511, 0.4753, 0.5163, 0.4938]}, {"w": "these", "b": [0.5222, 0.4753, 0.5733, 0.4938]}, {"w": "outputs,", "b": [0.5792, 0.4753, 0.6613, 0.4938]}, {"w": "given", "b": [0.6672, 0.4753, 0.721, 0.4938]}, {"w": "the", "b": [0.7269, 0.4753, 0.7583, 0.4938]}, {"w": "model", "b": [0.7642, 0.4753, 0.8259, 0.4938]}, {"w": "input", "b": [0.1761, 0.4945, 0.2299, 0.513]}]}, {"id": "b_5", "type": "paragraph", "text": "When fed an image input, this model returns the values of the layer activations in the original model. This is the first time you’ve encountered a multi-output model in this book: until now, the models you’ve seen have had exactly one input and one output. In the general case, a model can have any number of inputs and outputs. This one has one input and eight outputs: one output per layer activation.", "words": [{"w": "When", "b": [0.1289, 0.5346, 0.1853, 0.553]}, {"w": "fed", "b": [0.1912, 0.5346, 0.2213, 0.553]}, {"w": "an", "b": [0.2272, 0.5346, 0.2495, 0.553]}, {"w": "image", "b": [0.2554, 0.5346, 0.3131, 0.553]}, {"w": "input,", "b": [0.319, 0.5346, 0.3735, 0.553]}, {"w": "this", "b": [0.3794, 0.5346, 0.4135, 0.553]}, {"w": "model", "b": [0.4194, 0.5346, 0.4785, 0.553]}, {"w": "returns", "b": [0.4844, 0.5346, 0.55, 0.553]}, {"w": "the", "b": [0.5559, 0.5346, 0.5847, 0.553]}, {"w": "values", "b": [0.5906, 0.5346, 0.651, 0.553]}, {"w": "of", "b": [0.6569, 0.5346, 0.6765, 0.553]}, {"w": "the", "b": [0.6824, 0.5346, 0.7113, 0.553]}, {"w": "layer", "b": [0.7172, 0.5346, 0.7644, 0.553]}, {"w": "activations", "b": [0.1289, 0.5538, 0.2312, 0.5722]}, {"w": "in", "b": [0.2371, 0.5538, 0.2555, 0.5722]}, {"w": "the", "b": [0.2614, 0.5538, 0.2902, 0.5722]}, {"w": "original", "b": [0.2961, 0.5538, 0.3696, 0.5722]}, {"w": "model.", "b": [0.3755, 0.5538, 0.4404, 0.5722]}, {"w": "This", "b": [0.4464, 0.5538, 0.4883, 0.5722]}, {"w": "is", "b": [0.4942, 0.5538, 0.51, 0.5722]}, {"w": "the", "b": [0.5159, 0.5538, 0.5448, 0.5722]}, {"w": "first", "b": [0.5507, 0.5538, 0.5887, 0.5722]}, {"w": "time", "b": [0.5946, 0.5538, 0.6366, 0.5722]}, {"w": "you’ve", "b": [0.6424, 0.5538, 0.708, 0.5722]}, {"w": "encountered", "b": [0.7139, 0.5538, 0.8293, 0.5722]}, {"w": "a", "b": [0.8352, 0.5538, 0.8457, 0.5722]}, {"w": "multi-output", "b": [0.1289, 0.573, 0.247, 0.5914]}, {"w": "model", "b": [0.2529, 0.573, 0.3119, 0.5914]}, {"w": "in", "b": [0.3178, 0.573, 0.3362, 0.5914]}, {"w": "this", "b": [0.3421, 0.573, 0.3762, 0.5914]}, {"w": "book:", "b": [0.3821, 0.573, 0.4359, 0.5914]}, {"w": "until", "b": [0.4418, 0.573, 0.4851, 0.5914]}, {"w": "now,", "b": [0.491, 0.573, 0.536, 0.5914]}, {"w": "the", "b": [0.5419, 0.573, 0.5708, 0.5914]}, {"w": "models", "b": [0.5767, 0.573, 0.6449, 0.5914]}, {"w": "you’ve", "b": [0.6508, 0.573, 0.7164, 0.5914]}, {"w": "seen", "b": [0.7223, 0.573, 0.7642, 0.5914]}, {"w": "have", "b": [0.7702, 0.573, 0.8147, 0.5914]}, {"w": "had", "b": [0.8206, 0.573, 0.8547, 0.5914]}, {"w": "exactly", "b": [0.1289, 0.5921, 0.1971, 0.6106]}, {"w": "one", "b": [0.203, 0.5921, 0.2371, 0.6106]}, {"w": "input", "b": [0.243, 0.5921, 0.2915, 0.6106]}, {"w": "and", "b": [0.2974, 0.5921, 0.3315, 0.6106]}, {"w": "one", "b": [0.3374, 0.5921, 0.3715, 0.6106]}, {"w": "output.", "b": [0.3774, 0.5921, 0.4437, 0.6106]}, {"w": "In", "b": [0.4496, 0.5921, 0.4692, 0.6106]}, {"w": "the", "b": [0.4751, 0.5921, 0.504, 0.6106]}, {"w": "general", "b": [0.5099, 0.5921, 0.5794, 0.6106]}, {"w": "case,", "b": [0.5853, 0.5921, 0.6319, 0.6106]}, {"w": "a", "b": [0.6378, 0.5921, 0.6482, 0.6106]}, {"w": "model", "b": [0.6541, 0.5921, 0.7132, 0.6106]}, {"w": "can", "b": [0.7191, 0.5921, 0.7519, 0.6106]}, {"w": "have", "b": [0.7578, 0.5921, 0.8024, 0.6106]}, {"w": "any", "b": [0.8083, 0.5921, 0.8424, 0.6106]}, {"w": "number", "b": [0.1289, 0.6113, 0.201, 0.6298]}, {"w": "of", "b": [0.2069, 0.6113, 0.2266, 0.6298]}, {"w": "inputs", "b": [0.2325, 0.6113, 0.2902, 0.6298]}, {"w": "and", "b": [0.2961, 0.6113, 0.3302, 0.6298]}, {"w": "outputs.", "b": [0.3361, 0.6113, 0.4116, 0.6298]}, {"w": "This", "b": [0.4175, 0.6113, 0.4595, 0.6298]}, {"w": "one", "b": [0.4654, 0.6113, 0.4995, 0.6298]}, {"w": "has", "b": [0.5054, 0.6113, 0.5369, 0.6298]}, {"w": "one", "b": [0.5428, 0.6113, 0.5769, 0.6298]}, {"w": "input", "b": [0.5828, 0.6113, 0.6313, 0.6298]}, {"w": "and", "b": [0.6372, 0.6113, 0.6713, 0.6298]}, {"w": "eight", "b": [0.6772, 0.6113, 0.7245, 0.6298]}, {"w": "outputs:", "b": [0.7304, 0.6113, 0.8065, 0.6298]}, {"w": "one", "b": [0.8123, 0.6113, 0.8464, 0.6298]}, {"w": "output", "b": [0.1289, 0.6305, 0.1892, 0.649]}, {"w": "per", "b": [0.1951, 0.6305, 0.2253, 0.649]}, {"w": "layer", "b": [0.2312, 0.6305, 0.2784, 0.649]}, {"w": "activation.", "b": [0.2843, 0.6305, 0.3833, 0.649]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.28. Running the model in predict mode", "words": [{"w": "Listing", "b": [0.1289, 0.6659, 0.182, 0.6798]}, {"w": "5.28.", "b": [0.1865, 0.6659, 0.2219, 0.6798]}, {"w": "Running", "b": [0.2263, 0.6659, 0.2922, 0.6798]}, {"w": "the", "b": [0.2967, 0.6659, 0.3203, 0.6798]}, {"w": "model", "b": [0.3247, 0.6659, 0.371, 0.6798]}, {"w": "in", "b": [0.3754, 0.6659, 0.3901, 0.6798]}, {"w": "predict", "b": [0.3946, 0.6659, 0.4484, 0.6798]}, {"w": "mode", "b": [0.4528, 0.6659, 0.4941, 0.6798]}]}, {"id": "b_7", "type": "equation", "text": "activations = activation_model.predict(img_tensor) 1", "words": [{"w": "activations", "b": [0.1348, 0.6925, 0.2517, 0.7067]}, {"w": "=", "b": [0.2623, 0.6925, 0.2729, 0.7067]}, {"w": "activation_model.predict(img_tensor)", "b": [0.2836, 0.6925, 0.6661, 0.7067]}, {"w": "1", "b": [0.7512, 0.6925, 0.7618, 0.7067]}]}, {"id": "b_8", "type": "paragraph", "text": "1 Returns a list of five Numpy arrays: one array per layer activation", "words": [{"w": "1", "b": [0.1761, 0.724, 0.1879, 0.7425]}, {"w": "Returns", "b": [0.1938, 0.724, 0.2751, 0.7425]}, {"w": "a", "b": [0.281, 0.724, 0.2929, 0.7425]}, {"w": "list", "b": [0.2988, 0.724, 0.3289, 0.7425]}, {"w": "of", "b": [0.3348, 0.724, 0.3545, 0.7425]}, {"w": "five", "b": [0.3604, 0.724, 0.3971, 0.7425]}, {"w": "Numpy", "b": [0.403, 0.724, 0.4778, 0.7425]}, {"w": "arrays:", "b": [0.4837, 0.724, 0.5572, 0.7425]}, {"w": "one", "b": [0.5631, 0.724, 0.5985, 0.7425]}, {"w": "array", "b": [0.6044, 0.724, 0.6608, 0.7425]}, {"w": "per", "b": [0.6667, 0.724, 0.7008, 0.7425]}, {"w": "layer", "b": [0.7067, 0.724, 0.7579, 0.7425]}, {"w": "activation", "b": [0.7638, 0.724, 0.8635, 0.7425]}]}, {"id": "b_9", "type": "paragraph", "text": "For instance, this is the activation of the first convolution layer for the cat image input:", "words": [{"w": "For", "b": [0.1289, 0.764, 0.1617, 0.7825]}, {"w": "instance,", "b": [0.1676, 0.764, 0.2509, 0.7825]}, {"w": "this", "b": [0.2568, 0.764, 0.2909, 0.7825]}, {"w": "is", "b": [0.2968, 0.764, 0.3126, 0.7825]}, {"w": "the", "b": [0.3185, 0.764, 0.3473, 0.7825]}, {"w": "activation", "b": [0.3532, 0.764, 0.4464, 0.7825]}, {"w": "of", "b": [0.4523, 0.764, 0.4719, 0.7825]}, {"w": "the", "b": [0.4778, 0.764, 0.5067, 0.7825]}, {"w": "first", "b": [0.5126, 0.764, 0.5506, 0.7825]}, {"w": "convolution", "b": [0.5565, 0.764, 0.6694, 0.7825]}, {"w": "layer", "b": [0.6753, 0.764, 0.7225, 0.7825]}, {"w": "for", "b": [0.7284, 0.764, 0.7559, 0.7825]}, {"w": "the", "b": [0.7618, 0.764, 0.7907, 0.7825]}, {"w": "cat", "b": [0.7966, 0.764, 0.8241, 0.7825]}, {"w": "image", "b": [0.1289, 0.7832, 0.1866, 0.8017]}, {"w": "input:", "b": [0.1925, 0.7832, 0.2476, 0.8017]}]}, {"id": "b_10", "type": "paragraph", "text": ">>> first_layer_activation = activations[0] >>> print(first_layer_activation.shape) (1, 148, 148, 32)", "words": [{"w": ">>>", "b": [0.1348, 0.8185, 0.1667, 0.8327]}, {"w": "first_layer_activation", "b": [0.1773, 0.8185, 0.4111, 0.8327]}, {"w": "=", "b": [0.4217, 0.8185, 0.4323, 0.8327]}, {"w": "activations[0]", "b": [0.443, 0.8185, 0.5917, 0.8327]}, {"w": ">>>", "b": [0.1348, 0.8327, 0.1667, 0.8469]}, {"w": "print(first_layer_activation.shape)", "b": [0.1773, 0.8327, 0.5492, 0.8469]}, {"w": "(1,", "b": [0.1348, 0.8469, 0.1667, 0.8611]}, {"w": "148,", "b": [0.1773, 0.8469, 0.2198, 0.8611]}, {"w": "148,", "b": [0.2304, 0.8469, 0.2729, 0.8611]}, {"w": "32)", "b": [0.2836, 0.8469, 0.3154, 0.8611]}]}]}, {"page": 220, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "It’s a 148 × 148 feature map with 32 channels. Let’s try plotting the fourth channel of the activation of the first layer of the original model (see figure 5.25).", "words": [{"w": "It’s", "b": [0.1289, 0.0857, 0.159, 0.1041]}, {"w": "a", "b": [0.165, 0.0857, 0.1754, 0.1041]}, {"w": "148", "b": [0.1813, 0.0857, 0.2168, 0.1041]}, {"w": "×", "b": [0.2227, 0.0857, 0.236, 0.1041]}, {"w": "148", "b": [0.2419, 0.0857, 0.2773, 0.1041]}, {"w": "feature", "b": [0.2832, 0.0857, 0.3488, 0.1041]}, {"w": "map", "b": [0.3547, 0.0857, 0.3953, 0.1041]}, {"w": "with", "b": [0.4012, 0.0857, 0.4432, 0.1041]}, {"w": "32", "b": [0.4491, 0.0857, 0.4727, 0.1041]}, {"w": "channels.", "b": [0.4787, 0.0857, 0.5672, 0.1041]}, {"w": "Let’s", "b": [0.5731, 0.0857, 0.6203, 0.1041]}, {"w": "try", "b": [0.6262, 0.0857, 0.6524, 0.1041]}, {"w": "plotting", "b": [0.6583, 0.0857, 0.7318, 0.1041]}, {"w": "the", "b": [0.7377, 0.0857, 0.7666, 0.1041]}, {"w": "fourth", "b": [0.7725, 0.0857, 0.8302, 0.1041]}, {"w": "channel", "b": [0.1289, 0.1049, 0.2023, 0.1233]}, {"w": "of", "b": [0.2082, 0.1049, 0.2279, 0.1233]}, {"w": "the", "b": [0.2338, 0.1049, 0.2627, 0.1233]}, {"w": "activation", "b": [0.2686, 0.1049, 0.3617, 0.1233]}, {"w": "of", "b": [0.3676, 0.1049, 0.3873, 0.1233]}, {"w": "the", "b": [0.3932, 0.1049, 0.422, 0.1233]}, {"w": "first", "b": [0.4279, 0.1049, 0.466, 0.1233]}, {"w": "layer", "b": [0.4719, 0.1049, 0.5191, 0.1233]}, {"w": "of", "b": [0.5249, 0.1049, 0.5446, 0.1233]}, {"w": "the", "b": [0.5505, 0.1049, 0.5793, 0.1233]}, {"w": "original", "b": [0.5852, 0.1049, 0.6587, 0.1233]}, {"w": "model", "b": [0.6646, 0.1049, 0.7236, 0.1233]}, {"w": "(see", "b": [0.7295, 0.1049, 0.7676, 0.1233]}, {"w": "figure", "b": [0.7734, 0.1049, 0.8298, 0.1233]}, {"w": "5.25).", "b": [0.1289, 0.124, 0.184, 0.1425]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.25. Fourth channel of the activation of the first layer on the test cat picture", "words": [{"w": "Figure", "b": [0.1289, 0.1595, 0.1787, 0.1733]}, {"w": "5.25.", "b": [0.1832, 0.1595, 0.2186, 0.1733]}, {"w": "Fourth", "b": [0.223, 0.1595, 0.2761, 0.1733]}, {"w": "channel", "b": [0.2805, 0.1595, 0.3396, 0.1733]}, {"w": "of", "b": [0.344, 0.1595, 0.3588, 0.1733]}, {"w": "the", "b": [0.3632, 0.1595, 0.3868, 0.1733]}, {"w": "activation", "b": [0.3912, 0.1595, 0.466, 0.1733]}, {"w": "of", "b": [0.4704, 0.1595, 0.4852, 0.1733]}, {"w": "the", "b": [0.4896, 0.1595, 0.5132, 0.1733]}, {"w": "first", "b": [0.5177, 0.1595, 0.5491, 0.1733]}, {"w": "layer", "b": [0.5536, 0.1595, 0.5919, 0.1733]}, {"w": "on", "b": [0.5964, 0.1595, 0.6151, 0.1733]}, {"w": "the", "b": [0.6195, 0.1595, 0.6431, 0.1733]}, {"w": "test", "b": [0.6475, 0.1595, 0.6741, 0.1733]}, {"w": "cat", "b": [0.6785, 0.1595, 0.7011, 0.1733]}, {"w": "picture", "b": [0.7055, 0.1595, 0.7593, 0.1733]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.29. Visualizing the fourth channel", "words": [{"w": "Listing", "b": [0.1289, 0.449, 0.182, 0.4629]}, {"w": "5.29.", "b": [0.1865, 0.449, 0.2219, 0.4629]}, {"w": "Visualizing", "b": [0.2263, 0.449, 0.3103, 0.4629]}, {"w": "the", "b": [0.3147, 0.449, 0.3383, 0.4629]}, {"w": "fourth", "b": [0.3427, 0.449, 0.3909, 0.4629]}, {"w": "channel", "b": [0.3954, 0.449, 0.4544, 0.4629]}]}, {"id": "b_3", "type": "paragraph", "text": "import matplotlib.pyplot as plt plt.matshow(first_layer_activation[0, :, :, 4], cmap='viridis')", "words": [{"w": "import", "b": [0.1348, 0.4756, 0.1985, 0.4898]}, {"w": "matplotlib.pyplot", "b": [0.2092, 0.4756, 0.3898, 0.4898]}, {"w": "as", "b": [0.4004, 0.4756, 0.4217, 0.4898]}, {"w": "plt", "b": [0.4323, 0.4756, 0.4642, 0.4898]}, {"w": "plt.matshow(first_layer_activation[0,", "b": [0.1348, 0.504, 0.528, 0.5182]}, {"w": ":,", "b": [0.5386, 0.504, 0.5598, 0.5182]}, {"w": ":,", "b": [0.5705, 0.504, 0.5917, 0.5182]}, {"w": "4],", "b": [0.6024, 0.504, 0.6342, 0.5182]}, {"w": "cmap='viridis')", "b": [0.6449, 0.504, 0.8043, 0.5182]}]}, {"id": "b_4", "type": "paragraph", "text": "This channel appears to encode a diagonal edge detector. Let’s try the seventh channel (see figure 5.26)—but note that your own channels may vary, because the specific filters learned by convolution layers aren’t deterministic.", "words": [{"w": "This", "b": [0.1289, 0.5396, 0.1709, 0.5581]}, {"w": "channel", "b": [0.1768, 0.5396, 0.2502, 0.5581]}, {"w": "appears", "b": [0.2561, 0.5396, 0.3282, 0.5581]}, {"w": "to", "b": [0.3341, 0.5396, 0.3525, 0.5581]}, {"w": "encode", "b": [0.3584, 0.5396, 0.4253, 0.5581]}, {"w": "a", "b": [0.4312, 0.5396, 0.4417, 0.5581]}, {"w": "diagonal", "b": [0.4476, 0.5396, 0.5289, 0.5581]}, {"w": "edge", "b": [0.5348, 0.5396, 0.5794, 0.5581]}, {"w": "detector.", "b": [0.5853, 0.5396, 0.6659, 0.5581]}, {"w": "Let’s", "b": [0.6718, 0.5396, 0.719, 0.5581]}, {"w": "try", "b": [0.7249, 0.5396, 0.7511, 0.5581]}, {"w": "the", "b": [0.757, 0.5396, 0.7859, 0.5581]}, {"w": "seventh", "b": [0.7918, 0.5396, 0.8639, 0.5581]}, {"w": "channel", "b": [0.1289, 0.5588, 0.2023, 0.5772]}, {"w": "(see", "b": [0.2082, 0.5588, 0.2462, 0.5772]}, {"w": "figure", "b": [0.2521, 0.5588, 0.3085, 0.5772]}, {"w": "5.26)—but", "b": [0.3144, 0.5588, 0.4174, 0.5772]}, {"w": "note", "b": [0.4233, 0.5588, 0.464, 0.5772]}, {"w": "that", "b": [0.4699, 0.5588, 0.5053, 0.5772]}, {"w": "your", "b": [0.5112, 0.5588, 0.5545, 0.5772]}, {"w": "own", "b": [0.5604, 0.5588, 0.601, 0.5772]}, {"w": "channels", "b": [0.6069, 0.5588, 0.6896, 0.5772]}, {"w": "may", "b": [0.6955, 0.5588, 0.7361, 0.5772]}, {"w": "vary,", "b": [0.742, 0.5588, 0.7883, 0.5772]}, {"w": "because", "b": [0.7942, 0.5588, 0.869, 0.5772]}, {"w": "the", "b": [0.1289, 0.578, 0.1577, 0.5964]}, {"w": "specific", "b": [0.1636, 0.578, 0.2371, 0.5964]}, {"w": "filters", "b": [0.243, 0.578, 0.2981, 0.5964]}, {"w": "learned", "b": [0.304, 0.578, 0.3735, 0.5964]}, {"w": "by", "b": [0.3794, 0.578, 0.403, 0.5964]}, {"w": "convolution", "b": [0.4089, 0.578, 0.5217, 0.5964]}, {"w": "layers", "b": [0.5276, 0.578, 0.584, 0.5964]}, {"w": "aren’t", "b": [0.5899, 0.578, 0.6445, 0.5964]}, {"w": "deterministic.", "b": [0.6504, 0.578, 0.7796, 0.5964]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 5.26. Seventh channel of the activation of the first layer on the test cat picture", "words": [{"w": "Figure", "b": [0.1289, 0.6134, 0.1787, 0.6272]}, {"w": "5.26.", "b": [0.1832, 0.6134, 0.2186, 0.6272]}, {"w": "Seventh", "b": [0.223, 0.6134, 0.283, 0.6272]}, {"w": "channel", "b": [0.2874, 0.6134, 0.3465, 0.6272]}, {"w": "of", "b": [0.3509, 0.6134, 0.3657, 0.6272]}, {"w": "the", "b": [0.3701, 0.6134, 0.3937, 0.6272]}, {"w": "activation", "b": [0.3981, 0.6134, 0.4729, 0.6272]}, {"w": "of", "b": [0.4773, 0.6134, 0.4921, 0.6272]}, {"w": "the", "b": [0.4965, 0.6134, 0.5201, 0.6272]}, {"w": "first", "b": [0.5246, 0.6134, 0.556, 0.6272]}, {"w": "layer", "b": [0.5605, 0.6134, 0.5988, 0.6272]}, {"w": "on", "b": [0.6032, 0.6134, 0.6219, 0.6272]}, {"w": "the", "b": [0.6264, 0.6134, 0.65, 0.6272]}, {"w": "test", "b": [0.6544, 0.6134, 0.681, 0.6272]}, {"w": "cat", "b": [0.6854, 0.6134, 0.708, 0.6272]}, {"w": "picture", "b": [0.7124, 0.6134, 0.7662, 0.6272]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.30. Visualizing the seventh channel", "words": [{"w": "Listing", "b": [0.1289, 0.8779, 0.182, 0.8917]}, {"w": "5.30.", "b": [0.1865, 0.8779, 0.2219, 0.8917]}, {"w": "Visualizing", "b": [0.2263, 0.8779, 0.3103, 0.8917]}, {"w": "the", "b": [0.3147, 0.8779, 0.3383, 0.8917]}, {"w": "seventh", "b": [0.3427, 0.8779, 0.3998, 0.8917]}, {"w": "channel", "b": [0.4042, 0.8779, 0.4633, 0.8917]}]}]}, {"page": 221, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "plt.matshow(first_layer_activation[0, :, :, 7], cmap='viridis')", "words": [{"w": "plt.matshow(first_layer_activation[0,", "b": [0.1348, 0.0851, 0.528, 0.0993]}, {"w": ":,", "b": [0.5386, 0.0851, 0.5598, 0.0993]}, {"w": ":,", "b": [0.5705, 0.0851, 0.5917, 0.0993]}, {"w": "7],", "b": [0.6024, 0.0851, 0.6342, 0.0993]}, {"w": "cmap='viridis')", "b": [0.6449, 0.0851, 0.8043, 0.0993]}]}, {"id": "b_1", "type": "paragraph", "text": "This one looks like a “bright green dot” detector, useful to encode cat eyes. At this point, let’s plot a complete visualization of all the activations in the network (see figure 5.27). You’ll extract and plot every channel in each of the eight activation maps, and you’ll stack the results in one big image tensor, with channels stacked side by side.", "words": [{"w": "This", "b": [0.1289, 0.1207, 0.1709, 0.1392]}, {"w": "one", "b": [0.1768, 0.1207, 0.2109, 0.1392]}, {"w": "looks", "b": [0.2168, 0.1207, 0.2679, 0.1392]}, {"w": "like", "b": [0.2738, 0.1207, 0.3093, 0.1392]}, {"w": "a", "b": [0.3152, 0.1207, 0.3257, 0.1392]}, {"w": "“bright", "b": [0.3316, 0.1207, 0.3985, 0.1392]}, {"w": "green", "b": [0.4044, 0.1207, 0.4568, 0.1392]}, {"w": "dot”", "b": [0.4627, 0.1207, 0.5034, 0.1392]}, {"w": "detector,", "b": [0.5093, 0.1207, 0.5902, 0.1392]}, {"w": "useful", "b": [0.5961, 0.1207, 0.6539, 0.1392]}, {"w": "to", "b": [0.6598, 0.1207, 0.6781, 0.1392]}, {"w": "encode", "b": [0.684, 0.1207, 0.7509, 0.1392]}, {"w": "cat", "b": [0.7568, 0.1207, 0.7844, 0.1392]}, {"w": "eyes.", "b": [0.7903, 0.1207, 0.8381, 0.1392]}, {"w": "At", "b": [0.844, 0.1207, 0.8676, 0.1392]}, {"w": "this", "b": [0.1289, 0.1399, 0.163, 0.1584]}, {"w": "point,", "b": [0.1689, 0.1399, 0.2234, 0.1584]}, {"w": "let’s", "b": [0.2293, 0.1399, 0.2686, 0.1584]}, {"w": "plot", "b": [0.2745, 0.1399, 0.3112, 0.1584]}, {"w": "a", "b": [0.3172, 0.1399, 0.3276, 0.1584]}, {"w": "complete", "b": [0.3335, 0.1399, 0.4201, 0.1584]}, {"w": "visualization", "b": [0.426, 0.1399, 0.5467, 0.1584]}, {"w": "of", "b": [0.5526, 0.1399, 0.5722, 0.1584]}, {"w": "all", "b": [0.5781, 0.1399, 0.6017, 0.1584]}, {"w": "the", "b": [0.6077, 0.1399, 0.6365, 0.1584]}, {"w": "activations", "b": [0.6424, 0.1399, 0.7447, 0.1584]}, {"w": "in", "b": [0.7506, 0.1399, 0.769, 0.1584]}, {"w": "the", "b": [0.7749, 0.1399, 0.8038, 0.1584]}, {"w": "network", "b": [0.1289, 0.1591, 0.2063, 0.1776]}, {"w": "(see", "b": [0.2122, 0.1591, 0.2502, 0.1776]}, {"w": "figure", "b": [0.2561, 0.1591, 0.3125, 0.1776]}, {"w": "5.27).", "b": [0.3184, 0.1591, 0.3735, 0.1776]}, {"w": "You’ll", "b": [0.3794, 0.1591, 0.4387, 0.1776]}, {"w": "extract", "b": [0.4446, 0.1591, 0.5088, 0.1776]}, {"w": "and", "b": [0.5147, 0.1591, 0.5488, 0.1776]}, {"w": "plot", "b": [0.5547, 0.1591, 0.5915, 0.1776]}, {"w": "every", "b": [0.5974, 0.1591, 0.6498, 0.1776]}, {"w": "channel", "b": [0.6557, 0.1591, 0.7292, 0.1776]}, {"w": "in", "b": [0.7351, 0.1591, 0.7534, 0.1776]}, {"w": "each", "b": [0.7594, 0.1591, 0.8026, 0.1776]}, {"w": "of", "b": [0.8085, 0.1591, 0.8282, 0.1776]}, {"w": "the", "b": [0.8341, 0.1591, 0.8629, 0.1776]}, {"w": "eight", "b": [0.1289, 0.1783, 0.1761, 0.1968]}, {"w": "activation", "b": [0.182, 0.1783, 0.2751, 0.1968]}, {"w": "maps,", "b": [0.281, 0.1783, 0.3368, 0.1968]}, {"w": "and", "b": [0.3427, 0.1783, 0.3768, 0.1968]}, {"w": "you’ll", "b": [0.3827, 0.1783, 0.4391, 0.1968]}, {"w": "stack", "b": [0.445, 0.1783, 0.4936, 0.1968]}, {"w": "the", "b": [0.4995, 0.1783, 0.5283, 0.1968]}, {"w": "results", "b": [0.5342, 0.1783, 0.5959, 0.1968]}, {"w": "in", "b": [0.6018, 0.1783, 0.6202, 0.1968]}, {"w": "one", "b": [0.6261, 0.1783, 0.6602, 0.1968]}, {"w": "big", "b": [0.6661, 0.1783, 0.6962, 0.1968]}, {"w": "image", "b": [0.7021, 0.1783, 0.7599, 0.1968]}, {"w": "tensor,", "b": [0.7657, 0.1783, 0.8283, 0.1968]}, {"w": "with", "b": [0.1289, 0.1975, 0.1709, 0.216]}, {"w": "channels", "b": [0.1768, 0.1975, 0.2594, 0.216]}, {"w": "stacked", "b": [0.2653, 0.1975, 0.3361, 0.216]}, {"w": "side", "b": [0.342, 0.1975, 0.3801, 0.216]}, {"w": "by", "b": [0.386, 0.1975, 0.4096, 0.216]}, {"w": "side.", "b": [0.4155, 0.1975, 0.4594, 0.216]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 5.27. Every channel of every layer activation on the test cat picture", "words": [{"w": "Figure", "b": [0.1289, 0.2371, 0.1787, 0.2509]}, {"w": "5.27.", "b": [0.1832, 0.2371, 0.2186, 0.2509]}, {"w": "Every", "b": [0.223, 0.2371, 0.2682, 0.2509]}, {"w": "channel", "b": [0.2727, 0.2371, 0.3317, 0.2509]}, {"w": "of", "b": [0.3361, 0.2371, 0.3509, 0.2509]}, {"w": "every", "b": [0.3553, 0.2371, 0.3966, 0.2509]}, {"w": "layer", "b": [0.4011, 0.2371, 0.4394, 0.2509]}, {"w": "activation", "b": [0.4438, 0.2371, 0.5186, 0.2509]}, {"w": "on", "b": [0.523, 0.2371, 0.5417, 0.2509]}, {"w": "the", "b": [0.5462, 0.2371, 0.5698, 0.2509]}, {"w": "test", "b": [0.5742, 0.2371, 0.6008, 0.2509]}, {"w": "cat", "b": [0.6052, 0.2371, 0.6278, 0.2509]}, {"w": "picture", "b": [0.6322, 0.2371, 0.686, 0.2509]}]}]}, {"page": 222, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 5.31. Visualizing every channel in every intermediate activation", "words": [{"w": "Listing", "b": [0.1289, 0.817, 0.182, 0.8308]}, {"w": "5.31.", "b": [0.1865, 0.817, 0.2219, 0.8308]}, {"w": "Visualizing", "b": [0.2263, 0.817, 0.3103, 0.8308]}, {"w": "every", "b": [0.3147, 0.817, 0.356, 0.8308]}, {"w": "channel", "b": [0.3604, 0.817, 0.4195, 0.8308]}, {"w": "in", "b": [0.4239, 0.817, 0.4387, 0.8308]}, {"w": "every", "b": [0.4431, 0.817, 0.4844, 0.8308]}, {"w": "intermediate", "b": [0.4888, 0.817, 0.5852, 0.8308]}, {"w": "activation", "b": [0.5897, 0.817, 0.6644, 0.8308]}]}, {"id": "b_1", "type": "equation", "text": "layer_names = [] 1 for layer in model.layers[:8]: 1", "words": [{"w": "layer_names", "b": [0.1348, 0.8436, 0.2517, 0.8578]}, {"w": "=", "b": [0.2623, 0.8436, 0.2729, 0.8578]}, {"w": "[]", "b": [0.2836, 0.8436, 0.3048, 0.8578]}, {"w": "1", "b": [0.1348, 0.8578, 0.1454, 0.8719]}, {"w": "for", "b": [0.1348, 0.8719, 0.1667, 0.8861]}, {"w": "layer", "b": [0.1773, 0.8719, 0.2304, 0.8861]}, {"w": "in", "b": [0.241, 0.8719, 0.2623, 0.8861]}, {"w": "model.layers[:8]:", "b": [0.2729, 0.8719, 0.4536, 0.8861]}, {"w": "1", "b": [0.1348, 0.8861, 0.1454, 0.9003]}]}]}, {"page": 223, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "layer_names.append(layer.name) 1 images_per_row = 16 for layer_name, layer_activation in zip(layer_names, activations): 2 n_features = layer_activation.shape[-1] 3 size = layer_activation.shape[1] 4 n_cols = n_features // images_per_row 5 display_grid = np.zeros((size * n_cols, images_per_row * size)) for col in range(n_cols): 6 for row in range(images_per_row): channel_image = layer_activation[0, :, :, col * images_per_row + row] channel_image -= channel_image.mean() 7 channel_image /= channel_image.std() channel_image *= 64 channel_image += 128 channel_image = np.clip(channel_image, 0, 255).astype('uint8') display_grid[col * size : (col + 1) * size, 8 row * size : (row + 1) * size] = channel_image scale = 1. / size plt.figure(figsize=(scale * display_grid.shape[1], scale * display_grid.shape[0])) plt.title(layer_name) plt.grid(False) plt.imshow(display_grid, aspect='auto', cmap='viridis')", "words": [{"w": "layer_names.append(layer.name)", "b": [0.1773, 0.0851, 0.4961, 0.0993]}, {"w": "1", "b": [0.1348, 0.0993, 0.1454, 0.1135]}, {"w": "images_per_row", "b": [0.1348, 0.1277, 0.2836, 0.1418]}, {"w": "=", "b": [0.2942, 0.1277, 0.3048, 0.1418]}, {"w": "16", "b": [0.3154, 0.1277, 0.3367, 0.1418]}, {"w": "for", "b": [0.1348, 0.156, 0.1667, 0.1702]}, {"w": "layer_name,", "b": [0.1773, 0.156, 0.2942, 0.1702]}, {"w": "layer_activation", "b": [0.3048, 0.156, 0.4748, 0.1702]}, {"w": "in", "b": [0.4855, 0.156, 0.5067, 0.1702]}, {"w": "zip(layer_names,", "b": [0.5173, 0.156, 0.6874, 0.1702]}, {"w": "activations):", "b": [0.698, 0.156, 0.8361, 0.1702]}, {"w": "2", "b": [0.1348, 0.1702, 0.1454, 0.1844]}, {"w": "n_features", "b": [0.1773, 0.1844, 0.2836, 0.1986]}, {"w": "=", "b": [0.2942, 0.1844, 0.3048, 0.1986]}, {"w": "layer_activation.shape[-1]", "b": [0.3154, 0.1844, 0.5917, 0.1986]}, {"w": "3", "b": [0.1348, 0.1986, 0.1454, 0.2128]}, {"w": "size", "b": [0.1773, 0.227, 0.2198, 0.2411]}, {"w": "=", "b": [0.2304, 0.227, 0.241, 0.2411]}, {"w": "layer_activation.shape[1]", "b": [0.2517, 0.227, 0.5173, 0.2411]}, {"w": "4", "b": [0.1348, 0.2411, 0.1454, 0.2553]}, {"w": "n_cols", "b": [0.1773, 0.2695, 0.241, 0.2837]}, {"w": "=", "b": [0.2517, 0.2695, 0.2623, 0.2837]}, {"w": "n_features", "b": [0.2729, 0.2695, 0.3792, 0.2837]}, {"w": "//", "b": [0.3898, 0.2695, 0.4111, 0.2837]}, {"w": "images_per_row", "b": [0.4217, 0.2695, 0.5705, 0.2837]}, {"w": "5", "b": [0.1348, 0.2837, 0.1454, 0.2979]}, {"w": "display_grid", "b": [0.1773, 0.2979, 0.3048, 0.3121]}, {"w": "=", "b": [0.3154, 0.2979, 0.3261, 0.3121]}, {"w": "np.zeros((size", "b": [0.3367, 0.2979, 0.4855, 0.3121]}, {"w": "*", "b": [0.4961, 0.2979, 0.5067, 0.3121]}, {"w": "n_cols,", "b": [0.5173, 0.2979, 0.5917, 0.3121]}, {"w": "images_per_row", "b": [0.6024, 0.2979, 0.7511, 0.3121]}, {"w": "*", "b": [0.7618, 0.2979, 0.7724, 0.3121]}, {"w": "size))", "b": [0.783, 0.2979, 0.8468, 0.3121]}, {"w": "for", "b": [0.1773, 0.3263, 0.2092, 0.3404]}, {"w": "col", "b": [0.2198, 0.3263, 0.2517, 0.3404]}, {"w": "in", "b": [0.2623, 0.3263, 0.2836, 0.3404]}, {"w": "range(n_cols):", "b": [0.2942, 0.3263, 0.443, 0.3404]}, {"w": "6", "b": [0.1348, 0.3404, 0.1454, 0.3546]}, {"w": "for", "b": [0.2198, 0.3546, 0.2517, 0.3688]}, {"w": "row", "b": [0.2623, 0.3546, 0.2942, 0.3688]}, {"w": "in", "b": [0.3048, 0.3546, 0.3261, 0.3688]}, {"w": "range(images_per_row):", "b": [0.3367, 0.3546, 0.5705, 0.3688]}, {"w": "channel_image", "b": [0.2623, 0.3688, 0.4004, 0.383]}, {"w": "=", "b": [0.4111, 0.3688, 0.4217, 0.383]}, {"w": "layer_activation[0,", "b": [0.4323, 0.3688, 0.6342, 0.383]}, {"w": ":,", "b": [0.613, 0.383, 0.6342, 0.3972]}, {"w": ":,", "b": [0.6449, 0.383, 0.6661, 0.3972]}, {"w": "col", "b": [0.613, 0.3972, 0.6449, 0.4114]}, {"w": "*", "b": [0.6555, 0.3972, 0.6661, 0.4114]}, {"w": "images_per_row", "b": [0.6767, 0.3972, 0.8255, 0.4114]}, {"w": "+", "b": [0.8361, 0.3972, 0.8468, 0.4114]}, {"w": "row]", "b": [0.1348, 0.4114, 0.1773, 0.4255]}, {"w": "channel_image", "b": [0.2623, 0.4255, 0.4004, 0.4397]}, {"w": "-=", "b": [0.4111, 0.4255, 0.4323, 0.4397]}, {"w": "channel_image.mean()", "b": [0.443, 0.4255, 0.6555, 0.4397]}, {"w": "7", "b": [0.1348, 0.4397, 0.1454, 0.4539]}, {"w": "channel_image", "b": [0.2623, 0.4539, 0.4004, 0.4681]}, {"w": "/=", "b": [0.4111, 0.4539, 0.4323, 0.4681]}, {"w": "channel_image.std()", "b": [0.443, 0.4539, 0.6449, 0.4681]}, {"w": "channel_image", "b": [0.2623, 0.4681, 0.4004, 0.4823]}, {"w": "*=", "b": [0.4111, 0.4681, 0.4323, 0.4823]}, {"w": "64", "b": [0.443, 0.4681, 0.4642, 0.4823]}, {"w": "channel_image", "b": [0.2623, 0.4823, 0.4004, 0.4965]}, {"w": "+=", "b": [0.4111, 0.4823, 0.4323, 0.4965]}, {"w": "128", "b": [0.443, 0.4823, 0.4748, 0.4965]}, {"w": "channel_image", "b": [0.2623, 0.4965, 0.4004, 0.5106]}, {"w": "=", "b": [0.4111, 0.4965, 0.4217, 0.5106]}, {"w": "np.clip(channel_image,", "b": [0.4323, 0.4965, 0.6661, 0.5106]}, {"w": "0,", "b": [0.6767, 0.4965, 0.698, 0.5106]}, {"w": "255).astype('uint8')", "b": [0.1348, 0.5107, 0.3473, 0.5248]}, {"w": "display_grid[col", "b": [0.2623, 0.5248, 0.4323, 0.539]}, {"w": "*", "b": [0.443, 0.5248, 0.4536, 0.539]}, {"w": "size", "b": [0.4642, 0.5248, 0.5067, 0.539]}, {"w": ":", "b": [0.5173, 0.5248, 0.528, 0.539]}, {"w": "(col", "b": [0.5386, 0.5248, 0.5811, 0.539]}, {"w": "+", "b": [0.5917, 0.5248, 0.6024, 0.539]}, {"w": "1)", "b": [0.613, 0.5248, 0.6342, 0.539]}, {"w": "*", "b": [0.6449, 0.5248, 0.6555, 0.539]}, {"w": "size,", "b": [0.6661, 0.5248, 0.7192, 0.539]}, {"w": "8", "b": [0.1348, 0.539, 0.1454, 0.5532]}, {"w": "row", "b": [0.4004, 0.5532, 0.4323, 0.5674]}, {"w": "*", "b": [0.443, 0.5532, 0.4536, 0.5674]}, {"w": "size", "b": [0.4642, 0.5532, 0.5067, 0.5674]}, {"w": ":", "b": [0.5173, 0.5532, 0.528, 0.5674]}, {"w": "(row", "b": [0.5386, 0.5532, 0.5811, 0.5674]}, {"w": "+", "b": [0.5917, 0.5532, 0.6024, 0.5674]}, {"w": "1)", "b": [0.613, 0.5532, 0.6342, 0.5674]}, {"w": "*", "b": [0.6449, 0.5532, 0.6555, 0.5674]}, {"w": "size]", "b": [0.6661, 0.5532, 0.7192, 0.5674]}, {"w": "=", "b": [0.7299, 0.5532, 0.7405, 0.5674]}, {"w": "channel_image", "b": [0.1348, 0.5674, 0.2729, 0.5816]}, {"w": "scale", "b": [0.1773, 0.5958, 0.2304, 0.6099]}, {"w": "=", "b": [0.241, 0.5958, 0.2517, 0.6099]}, {"w": "1.", "b": [0.2623, 0.5958, 0.2836, 0.6099]}, {"w": "/", "b": [0.2942, 0.5958, 0.3048, 0.6099]}, {"w": "size", "b": [0.3154, 0.5958, 0.3579, 0.6099]}, {"w": "plt.figure(figsize=(scale", "b": [0.1773, 0.6099, 0.443, 0.6241]}, {"w": "*", "b": [0.4536, 0.6099, 0.4642, 0.6241]}, {"w": "display_grid.shape[1],", "b": [0.4748, 0.6099, 0.7086, 0.6241]}, {"w": "scale", "b": [0.3898, 0.6241, 0.443, 0.6383]}, {"w": "*", "b": [0.4536, 0.6241, 0.4642, 0.6383]}, {"w": "display_grid.shape[0]))", "b": [0.4748, 0.6241, 0.7192, 0.6383]}, {"w": "plt.title(layer_name)", "b": [0.1773, 0.6383, 0.4004, 0.6525]}, {"w": "plt.grid(False)", "b": [0.1773, 0.6525, 0.3367, 0.6667]}, {"w": "plt.imshow(display_grid,", "b": [0.1773, 0.6667, 0.4323, 0.6809]}, {"w": "aspect='auto',", "b": [0.443, 0.6667, 0.5917, 0.6809]}, {"w": "cmap='viridis')", "b": [0.6024, 0.6667, 0.7618, 0.6809]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Names of the layers, so you can have them as part of your plot 2 Displays the feature maps 3 Number of features in the feature map 4 The feature map has shape (1, size, size, n_features). 5 Tiles the activation channels in this matrix 6 Tiles each filter into a big horizontal grid 7 Post-processes the feature to make it visually palatable 8 Displays the grid", "words": [{"w": "1", "b": [0.1761, 0.6981, 0.1879, 0.7166]}, {"w": "Names", "b": [0.1938, 0.6981, 0.262, 0.7166]}, {"w": "of", "b": [0.2679, 0.6981, 0.2876, 0.7166]}, {"w": "the", "b": [0.2935, 0.6981, 0.325, 0.7166]}, {"w": "layers,", "b": [0.3309, 0.6981, 0.3971, 0.7166]}, {"w": "so", "b": [0.403, 0.6981, 0.424, 0.7166]}, {"w": "you", "b": [0.4299, 0.6981, 0.4667, 0.7166]}, {"w": "can", "b": [0.4726, 0.6981, 0.508, 0.7166]}, {"w": "have", "b": [0.5139, 0.6981, 0.5611, 0.7166]}, {"w": "them", "b": [0.567, 0.6981, 0.6182, 0.7166]}, {"w": "as", "b": [0.6241, 0.6981, 0.6451, 0.7166]}, {"w": "part", "b": [0.651, 0.6981, 0.6943, 0.7166]}, {"w": "of", "b": [0.7002, 0.6981, 0.7198, 0.7166]}, {"w": "your", "b": [0.7257, 0.6981, 0.773, 0.7166]}, {"w": "plot", "b": [0.7789, 0.6981, 0.8182, 0.7166]}, {"w": "2", "b": [0.1761, 0.7173, 0.1879, 0.7358]}, {"w": "Displays", "b": [0.1938, 0.7173, 0.2791, 0.7358]}, {"w": "the", "b": [0.285, 0.7173, 0.3165, 0.7358]}, {"w": "feature", "b": [0.3224, 0.7173, 0.3941, 0.7358]}, {"w": "maps", "b": [0.4, 0.7173, 0.4538, 0.7358]}, {"w": "3", "b": [0.1761, 0.7365, 0.1879, 0.755]}, {"w": "Number", "b": [0.1938, 0.7365, 0.2778, 0.755]}, {"w": "of", "b": [0.2837, 0.7365, 0.3033, 0.755]}, {"w": "features", "b": [0.3092, 0.7365, 0.3901, 0.755]}, {"w": "in", "b": [0.396, 0.7365, 0.4157, 0.755]}, {"w": "the", "b": [0.4216, 0.7365, 0.4531, 0.755]}, {"w": "feature", "b": [0.459, 0.7365, 0.5307, 0.755]}, {"w": "map", "b": [0.5366, 0.7365, 0.5812, 0.755]}, {"w": "4", "b": [0.1761, 0.7557, 0.1879, 0.7742]}, {"w": "The", "b": [0.1938, 0.7557, 0.2332, 0.7742]}, {"w": "feature", "b": [0.2391, 0.7557, 0.3108, 0.7742]}, {"w": "map", "b": [0.3167, 0.7557, 0.3613, 0.7742]}, {"w": "has", "b": [0.3672, 0.7557, 0.4013, 0.7742]}, {"w": "shape", "b": [0.4072, 0.7557, 0.465, 0.7742]}, {"w": "(1,", "b": [0.4709, 0.7557, 0.4964, 0.7742]}, {"w": "size,", "b": [0.5023, 0.7557, 0.545, 0.7742]}, {"w": "size,", "b": [0.5509, 0.7557, 0.5935, 0.7742]}, {"w": "n_features).", "b": [0.5994, 0.7557, 0.719, 0.7742]}, {"w": "5", "b": [0.1761, 0.7749, 0.1879, 0.7934]}, {"w": "Tiles", "b": [0.1938, 0.7749, 0.2419, 0.7934]}, {"w": "the", "b": [0.2478, 0.7749, 0.2793, 0.7934]}, {"w": "activation", "b": [0.2852, 0.7749, 0.3849, 0.7934]}, {"w": "channels", "b": [0.3908, 0.7749, 0.4788, 0.7934]}, {"w": "in", "b": [0.4847, 0.7749, 0.5043, 0.7934]}, {"w": "this", "b": [0.5103, 0.7749, 0.547, 0.7934]}, {"w": "matrix", "b": [0.5529, 0.7749, 0.6211, 0.7934]}, {"w": "6", "b": [0.1761, 0.7941, 0.1879, 0.8125]}, {"w": "Tiles", "b": [0.1938, 0.7941, 0.2419, 0.8125]}, {"w": "each", "b": [0.2478, 0.7941, 0.2938, 0.8125]}, {"w": "filter", "b": [0.2997, 0.7941, 0.3495, 0.8125]}, {"w": "into", "b": [0.3554, 0.7941, 0.3948, 0.8125]}, {"w": "a", "b": [0.4007, 0.7941, 0.4125, 0.8125]}, {"w": "big", "b": [0.4184, 0.7941, 0.4499, 0.8125]}, {"w": "horizontal", "b": [0.4558, 0.7941, 0.5594, 0.8125]}, {"w": "grid", "b": [0.5653, 0.7941, 0.6073, 0.8125]}, {"w": "7", "b": [0.1761, 0.8133, 0.1879, 0.8317]}, {"w": "Post-processes", "b": [0.1938, 0.8133, 0.339, 0.8317]}, {"w": "the", "b": [0.3449, 0.8133, 0.3764, 0.8317]}, {"w": "feature", "b": [0.3823, 0.8133, 0.454, 0.8317]}, {"w": "to", "b": [0.4599, 0.8133, 0.4795, 0.8317]}, {"w": "make", "b": [0.4854, 0.8133, 0.5405, 0.8317]}, {"w": "it", "b": [0.5464, 0.8133, 0.5609, 0.8317]}, {"w": "visually", "b": [0.5668, 0.8133, 0.6442, 0.8317]}, {"w": "palatable", "b": [0.6501, 0.8133, 0.7433, 0.8317]}, {"w": "8", "b": [0.1761, 0.8324, 0.1879, 0.8509]}, {"w": "Displays", "b": [0.1938, 0.8324, 0.2791, 0.8509]}, {"w": "the", "b": [0.285, 0.8324, 0.3165, 0.8509]}, {"w": "grid", "b": [0.3224, 0.8324, 0.3644, 0.8509]}]}, {"id": "b_2", "type": "paragraph", "text": "There are a few things to note here:", "words": [{"w": "There", "b": [0.1289, 0.8725, 0.1839, 0.891]}, {"w": "are", "b": [0.1898, 0.8725, 0.2187, 0.891]}, {"w": "a", "b": [0.2246, 0.8725, 0.2351, 0.891]}, {"w": "few", "b": [0.241, 0.8725, 0.2764, 0.891]}, {"w": "things", "b": [0.2823, 0.8725, 0.34, 0.891]}, {"w": "to", "b": [0.3459, 0.8725, 0.3643, 0.891]}, {"w": "note", "b": [0.3702, 0.8725, 0.4109, 0.891]}, {"w": "here:", "b": [0.4168, 0.8725, 0.464, 0.891]}]}]}, {"page": 224, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The first layer acts as a collection of various edge detectors. At that stage, the activations retain almost all of the information present in the initial picture. As you go higher, the activations become increasingly abstract and less visually interpretable. They begin to encode higher-level concepts such as “cat ear” and “cat eye.” Higher presentations carry increasingly less information about the visual contents of the image, and increasingly more information related to the class of the image. The sparsity of the activations increases with the depth of the layer: in the first layer, all filters are activated by the input image; but in the following layers, more and more filters are blank. This means the pattern encoded by the filter isn’t found in the input image.", "words": [{"w": "The", "b": [0.1761, 0.0857, 0.2128, 0.1041]}, {"w": "first", "b": [0.2187, 0.0857, 0.2568, 0.1041]}, {"w": "layer", "b": [0.2627, 0.0857, 0.3099, 0.1041]}, {"w": "acts", "b": [0.3158, 0.0857, 0.3525, 0.1041]}, {"w": "as", "b": [0.3584, 0.0857, 0.3781, 0.1041]}, {"w": "a", "b": [0.384, 0.0857, 0.3945, 0.1041]}, {"w": "collection", "b": [0.4004, 0.0857, 0.4935, 0.1041]}, {"w": "of", "b": [0.4994, 0.0857, 0.5191, 0.1041]}, {"w": "various", "b": [0.525, 0.0857, 0.5945, 0.1041]}, {"w": "edge", "b": [0.6004, 0.0857, 0.645, 0.1041]}, {"w": "detectors.", "b": [0.6509, 0.0857, 0.7421, 0.1041]}, {"w": "At", "b": [0.748, 0.0857, 0.7716, 0.1041]}, {"w": "that", "b": [0.7775, 0.0857, 0.8129, 0.1041]}, {"w": "stage,", "b": [0.1761, 0.1049, 0.2305, 0.1233]}, {"w": "the", "b": [0.2364, 0.1049, 0.2653, 0.1233]}, {"w": "activations", "b": [0.2712, 0.1049, 0.3735, 0.1233]}, {"w": "retain", "b": [0.3794, 0.1049, 0.4332, 0.1233]}, {"w": "almost", "b": [0.4391, 0.1049, 0.5021, 0.1233]}, {"w": "all", "b": [0.508, 0.1049, 0.5316, 0.1233]}, {"w": "of", "b": [0.5375, 0.1049, 0.5572, 0.1233]}, {"w": "the", "b": [0.5631, 0.1049, 0.5919, 0.1233]}, {"w": "information", "b": [0.5978, 0.1049, 0.7094, 0.1233]}, {"w": "present", "b": [0.7151, 0.1049, 0.7833, 0.1233]}, {"w": "in", "b": [0.7893, 0.1049, 0.8076, 0.1233]}, {"w": "the", "b": [0.8135, 0.1049, 0.8424, 0.1233]}, {"w": "initial", "b": [0.1761, 0.124, 0.2312, 0.1425]}, {"w": "picture.", "b": [0.2371, 0.124, 0.3086, 0.1425]}, {"w": "As", "b": [0.1761, 0.1432, 0.2023, 0.1617]}, {"w": "you", "b": [0.2082, 0.1432, 0.2437, 0.1617]}, {"w": "go", "b": [0.2496, 0.1432, 0.2732, 0.1617]}, {"w": "higher,", "b": [0.2791, 0.1432, 0.3444, 0.1617]}, {"w": "the", "b": [0.3503, 0.1432, 0.3791, 0.1617]}, {"w": "activations", "b": [0.385, 0.1432, 0.4874, 0.1617]}, {"w": "become", "b": [0.4933, 0.1432, 0.5667, 0.1617]}, {"w": "increasingly", "b": [0.5726, 0.1432, 0.688, 0.1617]}, {"w": "abstract", "b": [0.694, 0.1432, 0.7674, 0.1617]}, {"w": "and", "b": [0.7733, 0.1432, 0.8074, 0.1617]}, {"w": "less", "b": [0.8133, 0.1432, 0.8487, 0.1617]}, {"w": "visually", "b": [0.1761, 0.1624, 0.2509, 0.1809]}, {"w": "interpretable.", "b": [0.2568, 0.1624, 0.382, 0.1809]}, {"w": "They", "b": [0.388, 0.1624, 0.4365, 0.1809]}, {"w": "begin", "b": [0.4424, 0.1624, 0.4949, 0.1809]}, {"w": "to", "b": [0.5008, 0.1624, 0.5191, 0.1809]}, {"w": "encode", "b": [0.525, 0.1624, 0.5919, 0.1809]}, {"w": "higher-level", "b": [0.5978, 0.1624, 0.7114, 0.1809]}, {"w": "concepts", "b": [0.7173, 0.1624, 0.7999, 0.1809]}, {"w": "such", "b": [0.8058, 0.1624, 0.8491, 0.1809]}, {"w": "as", "b": [0.1761, 0.1816, 0.1958, 0.2001]}, {"w": "“cat", "b": [0.2017, 0.1816, 0.2397, 0.2001]}, {"w": "ear”", "b": [0.2456, 0.1816, 0.2849, 0.2001]}, {"w": "and", "b": [0.2908, 0.1816, 0.3249, 0.2001]}, {"w": "“cat", "b": [0.3308, 0.1816, 0.3688, 0.2001]}, {"w": "eye.”", "b": [0.3748, 0.1816, 0.4239, 0.2001]}, {"w": "Higher", "b": [0.4298, 0.1816, 0.4954, 0.2001]}, {"w": "presentations", "b": [0.5013, 0.1816, 0.6259, 0.2001]}, {"w": "carry", "b": [0.6318, 0.1816, 0.6803, 0.2001]}, {"w": "increasingly", "b": [0.6862, 0.1816, 0.8017, 0.2001]}, {"w": "less", "b": [0.8076, 0.1816, 0.843, 0.2001]}, {"w": "information", "b": [0.1761, 0.2008, 0.2876, 0.2193]}, {"w": "about", "b": [0.2935, 0.2008, 0.346, 0.2193]}, {"w": "the", "b": [0.3519, 0.2008, 0.3808, 0.2193]}, {"w": "visual", "b": [0.3867, 0.2008, 0.4431, 0.2193]}, {"w": "contents", "b": [0.449, 0.2008, 0.5277, 0.2193]}, {"w": "of", "b": [0.5335, 0.2008, 0.5532, 0.2193]}, {"w": "the", "b": [0.5591, 0.2008, 0.588, 0.2193]}, {"w": "image,", "b": [0.5939, 0.2008, 0.6575, 0.2193]}, {"w": "and", "b": [0.6634, 0.2008, 0.6975, 0.2193]}, {"w": "increasingly", "b": [0.7034, 0.2008, 0.8188, 0.2193]}, {"w": "more", "b": [0.1761, 0.22, 0.2246, 0.2385]}, {"w": "information", "b": [0.2305, 0.22, 0.342, 0.2385]}, {"w": "related", "b": [0.348, 0.22, 0.4122, 0.2385]}, {"w": "to", "b": [0.4181, 0.22, 0.4365, 0.2385]}, {"w": "the", "b": [0.4424, 0.22, 0.4712, 0.2385]}, {"w": "class", "b": [0.4771, 0.22, 0.5231, 0.2385]}, {"w": "of", "b": [0.529, 0.22, 0.5486, 0.2385]}, {"w": "the", "b": [0.5545, 0.22, 0.5834, 0.2385]}, {"w": "image.", "b": [0.5893, 0.22, 0.6529, 0.2385]}, {"w": "The", "b": [0.1761, 0.2392, 0.2128, 0.2577]}, {"w": "sparsity", "b": [0.2187, 0.2392, 0.2922, 0.2577]}, {"w": "of", "b": [0.2981, 0.2392, 0.3178, 0.2577]}, {"w": "the", "b": [0.3237, 0.2392, 0.3525, 0.2577]}, {"w": "activations", "b": [0.3584, 0.2392, 0.4608, 0.2577]}, {"w": "increases", "b": [0.4667, 0.2392, 0.5532, 0.2577]}, {"w": "with", "b": [0.5591, 0.2392, 0.6011, 0.2577]}, {"w": "the", "b": [0.607, 0.2392, 0.6359, 0.2577]}, {"w": "depth", "b": [0.6418, 0.2392, 0.6942, 0.2577]}, {"w": "of", "b": [0.7001, 0.2392, 0.7198, 0.2577]}, {"w": "the", "b": [0.7257, 0.2392, 0.7546, 0.2577]}, {"w": "layer:", "b": [0.7605, 0.2392, 0.8142, 0.2577]}, {"w": "in", "b": [0.8202, 0.2392, 0.8385, 0.2577]}, {"w": "the", "b": [0.1761, 0.2584, 0.205, 0.2769]}, {"w": "first", "b": [0.2109, 0.2584, 0.2489, 0.2769]}, {"w": "layer,", "b": [0.2548, 0.2584, 0.307, 0.2769]}, {"w": "all", "b": [0.3129, 0.2584, 0.3365, 0.2769]}, {"w": "filters", "b": [0.3424, 0.2584, 0.3975, 0.2769]}, {"w": "are", "b": [0.4034, 0.2584, 0.4322, 0.2769]}, {"w": "activated", "b": [0.4381, 0.2584, 0.5234, 0.2769]}, {"w": "by", "b": [0.5293, 0.2584, 0.5529, 0.2769]}, {"w": "the", "b": [0.5588, 0.2584, 0.5876, 0.2769]}, {"w": "input", "b": [0.5935, 0.2584, 0.642, 0.2769]}, {"w": "image;", "b": [0.6479, 0.2584, 0.7122, 0.2769]}, {"w": "but", "b": [0.7181, 0.2584, 0.7483, 0.2769]}, {"w": "in", "b": [0.7542, 0.2584, 0.7726, 0.2769]}, {"w": "the", "b": [0.7785, 0.2584, 0.8073, 0.2769]}, {"w": "following", "b": [0.1761, 0.2776, 0.2679, 0.2961]}, {"w": "layers,", "b": [0.2738, 0.2776, 0.3361, 0.2961]}, {"w": "more", "b": [0.342, 0.2776, 0.3906, 0.2961]}, {"w": "and", "b": [0.3965, 0.2776, 0.4306, 0.2961]}, {"w": "more", "b": [0.4365, 0.2776, 0.485, 0.2961]}, {"w": "filters", "b": [0.4909, 0.2776, 0.546, 0.2961]}, {"w": "are", "b": [0.5519, 0.2776, 0.5807, 0.2961]}, {"w": "blank.", "b": [0.5866, 0.2776, 0.645, 0.2961]}, {"w": "This", "b": [0.6509, 0.2776, 0.6929, 0.2961]}, {"w": "means", "b": [0.6988, 0.2776, 0.7592, 0.2961]}, {"w": "the", "b": [0.7651, 0.2776, 0.7939, 0.2961]}, {"w": "pattern", "b": [0.7998, 0.2776, 0.8654, 0.2961]}, {"w": "encoded", "b": [0.1761, 0.2968, 0.2548, 0.3152]}, {"w": "by", "b": [0.2607, 0.2968, 0.2843, 0.3152]}, {"w": "the", "b": [0.2902, 0.2968, 0.3191, 0.3152]}, {"w": "filter", "b": [0.325, 0.2968, 0.3709, 0.3152]}, {"w": "isn’t", "b": [0.3768, 0.2968, 0.4183, 0.3152]}, {"w": "found", "b": [0.4242, 0.2968, 0.4793, 0.3152]}, {"w": "in", "b": [0.4852, 0.2968, 0.5036, 0.3152]}, {"w": "the", "b": [0.5095, 0.2968, 0.5383, 0.3152]}, {"w": "input", "b": [0.5442, 0.2968, 0.5928, 0.3152]}, {"w": "image.", "b": [0.5987, 0.2968, 0.6623, 0.3152]}]}, {"id": "b_1", "type": "paragraph", "text": "We have just evidenced an important universal characteristic of the representations learned by deep neural networks: the features extracted by a layer become increasingly abstract with the depth of the layer. The activations of higher layers carry less and less information about the specific input being seen, and more and more information about the target (in this case, the class of the image: cat or dog). A deep neural network effectively acts as an information distillation pipeline, with raw data going in (in this case, RGB pictures) and being repeatedly transformed so that irrelevant information is filtered out (for example, the specific visual appearance of the image), and useful information is magnified and refined (for example, the class of the image).", "words": [{"w": "We", "b": [0.1289, 0.3368, 0.1598, 0.3553]}, {"w": "have", "b": [0.1657, 0.3368, 0.2102, 0.3553]}, {"w": "just", "b": [0.2162, 0.3368, 0.2503, 0.3553]}, {"w": "evidenced", "b": [0.2562, 0.3368, 0.3519, 0.3553]}, {"w": "an", "b": [0.3578, 0.3368, 0.3801, 0.3553]}, {"w": "important", "b": [0.386, 0.3368, 0.4778, 0.3553]}, {"w": "universal", "b": [0.4838, 0.3368, 0.5703, 0.3553]}, {"w": "characteristic", "b": [0.5762, 0.3368, 0.7021, 0.3553]}, {"w": "of", "b": [0.708, 0.3368, 0.7277, 0.3553]}, {"w": "the", "b": [0.7336, 0.3368, 0.7625, 0.3553]}, {"w": "representations", "b": [0.1289, 0.356, 0.2718, 0.3745]}, {"w": "learned", "b": [0.2777, 0.356, 0.3472, 0.3745]}, {"w": "by", "b": [0.3531, 0.356, 0.3768, 0.3745]}, {"w": "deep", "b": [0.3827, 0.356, 0.4272, 0.3745]}, {"w": "neural", "b": [0.4332, 0.356, 0.4922, 0.3745]}, {"w": "networks:", "b": [0.4981, 0.356, 0.5912, 0.3745]}, {"w": "the", "b": [0.5971, 0.356, 0.626, 0.3745]}, {"w": "features", "b": [0.6319, 0.356, 0.7066, 0.3745]}, {"w": "extracted", "b": [0.7124, 0.356, 0.799, 0.3745]}, {"w": "by", "b": [0.8049, 0.356, 0.8285, 0.3745]}, {"w": "a", "b": [0.8344, 0.356, 0.8449, 0.3745]}, {"w": "layer", "b": [0.1289, 0.3752, 0.1761, 0.3937]}, {"w": "become", "b": [0.182, 0.3752, 0.2554, 0.3937]}, {"w": "increasingly", "b": [0.2613, 0.3752, 0.3768, 0.3937]}, {"w": "abstract", "b": [0.3827, 0.3752, 0.4561, 0.3937]}, {"w": "with", "b": [0.462, 0.3752, 0.504, 0.3937]}, {"w": "the", "b": [0.5099, 0.3752, 0.5388, 0.3937]}, {"w": "depth", "b": [0.5447, 0.3752, 0.5971, 0.3937]}, {"w": "of", "b": [0.603, 0.3752, 0.6227, 0.3937]}, {"w": "the", "b": [0.6286, 0.3752, 0.6575, 0.3937]}, {"w": "layer.", "b": [0.6634, 0.3752, 0.7151, 0.3937]}, {"w": "The", "b": [0.721, 0.3752, 0.7577, 0.3937]}, {"w": "activations", "b": [0.7636, 0.3752, 0.8659, 0.3937]}, {"w": "of", "b": [0.1289, 0.3944, 0.1485, 0.4129]}, {"w": "higher", "b": [0.1545, 0.3944, 0.2148, 0.4129]}, {"w": "layers", "b": [0.2207, 0.3944, 0.2771, 0.4129]}, {"w": "carry", "b": [0.283, 0.3944, 0.3315, 0.4129]}, {"w": "less", "b": [0.3374, 0.3944, 0.3728, 0.4129]}, {"w": "and", "b": [0.3787, 0.3944, 0.4128, 0.4129]}, {"w": "less", "b": [0.4187, 0.3944, 0.4541, 0.4129]}, {"w": "information", "b": [0.46, 0.3944, 0.5715, 0.4129]}, {"w": "about", "b": [0.5774, 0.3944, 0.6299, 0.4129]}, {"w": "the", "b": [0.6358, 0.3944, 0.6647, 0.4129]}, {"w": "specific", "b": [0.6706, 0.3944, 0.744, 0.4129]}, {"w": "input", "b": [0.7499, 0.3944, 0.7985, 0.4129]}, {"w": "being", "b": [0.8044, 0.3944, 0.8568, 0.4129]}, {"w": "seen,", "b": [0.1289, 0.4136, 0.1767, 0.4321]}, {"w": "and", "b": [0.1826, 0.4136, 0.2167, 0.4321]}, {"w": "more", "b": [0.2227, 0.4136, 0.2712, 0.4321]}, {"w": "and", "b": [0.2771, 0.4136, 0.3112, 0.4321]}, {"w": "more", "b": [0.3171, 0.4136, 0.3656, 0.4321]}, {"w": "information", "b": [0.3715, 0.4136, 0.483, 0.4321]}, {"w": "about", "b": [0.4889, 0.4136, 0.5414, 0.4321]}, {"w": "the", "b": [0.5473, 0.4136, 0.5762, 0.4321]}, {"w": "target", "b": [0.5821, 0.4136, 0.6353, 0.4321]}, {"w": "(in", "b": [0.6412, 0.4136, 0.6675, 0.4321]}, {"w": "this", "b": [0.6734, 0.4136, 0.7075, 0.4321]}, {"w": "case,", "b": [0.7134, 0.4136, 0.76, 0.4321]}, {"w": "the", "b": [0.7659, 0.4136, 0.7947, 0.4321]}, {"w": "class", "b": [0.8006, 0.4136, 0.8465, 0.4321]}, {"w": "of", "b": [0.1289, 0.4328, 0.1485, 0.4513]}, {"w": "the", "b": [0.1545, 0.4328, 0.1833, 0.4513]}, {"w": "image:", "b": [0.1892, 0.4328, 0.2535, 0.4513]}, {"w": "cat", "b": [0.2594, 0.4328, 0.2869, 0.4513]}, {"w": "or", "b": [0.2928, 0.4328, 0.3125, 0.4513]}, {"w": "dog).", "b": [0.3184, 0.4328, 0.3676, 0.4513]}, {"w": "A", "b": [0.3735, 0.4328, 0.3906, 0.4513]}, {"w": "deep", "b": [0.3965, 0.4328, 0.441, 0.4513]}, {"w": "neural", "b": [0.4469, 0.4328, 0.506, 0.4513]}, {"w": "network", "b": [0.5119, 0.4328, 0.5892, 0.4513]}, {"w": "effectively", "b": [0.5951, 0.4328, 0.6956, 0.4513]}, {"w": "acts", "b": [0.7015, 0.4328, 0.7383, 0.4513]}, {"w": "as", "b": [0.7442, 0.4328, 0.7638, 0.4513]}, {"w": "an", "b": [0.7697, 0.4328, 0.792, 0.4513]}, {"w": "information", "b": [0.1289, 0.452, 0.2404, 0.4704]}, {"w": "distillation", "b": [0.2463, 0.452, 0.3487, 0.4704]}, {"w": "pipeline,", "b": [0.3546, 0.452, 0.4365, 0.4704]}, {"w": "with", "b": [0.4424, 0.452, 0.4844, 0.4704]}, {"w": "raw", "b": [0.4903, 0.452, 0.5257, 0.4704]}, {"w": "data", "b": [0.5316, 0.452, 0.571, 0.4704]}, {"w": "going", "b": [0.5769, 0.452, 0.6307, 0.4704]}, {"w": "in", "b": [0.6366, 0.452, 0.6549, 0.4704]}, {"w": "(in", "b": [0.6608, 0.452, 0.6871, 0.4704]}, {"w": "this", "b": [0.693, 0.452, 0.7271, 0.4704]}, {"w": "case,", "b": [0.733, 0.452, 0.7795, 0.4704]}, {"w": "RGB", "b": [0.7854, 0.452, 0.834, 0.4704]}, {"w": "pictures)", "b": [0.1289, 0.4712, 0.2115, 0.4896]}, {"w": "and", "b": [0.2174, 0.4712, 0.2515, 0.4896]}, {"w": "being", "b": [0.2574, 0.4712, 0.3099, 0.4896]}, {"w": "repeatedly", "b": [0.3158, 0.4712, 0.4141, 0.4896]}, {"w": "transformed", "b": [0.42, 0.4712, 0.5342, 0.4896]}, {"w": "so", "b": [0.5401, 0.4712, 0.561, 0.4896]}, {"w": "that", "b": [0.567, 0.4712, 0.6024, 0.4896]}, {"w": "irrelevant", "b": [0.6083, 0.4712, 0.6988, 0.4896]}, {"w": "information", "b": [0.7047, 0.4712, 0.8162, 0.4896]}, {"w": "is", "b": [0.8221, 0.4712, 0.8378, 0.4896]}, {"w": "filtered", "b": [0.1289, 0.4903, 0.1971, 0.5088]}, {"w": "out", "b": [0.2029, 0.4903, 0.2331, 0.5088]}, {"w": "(for", "b": [0.239, 0.4903, 0.2744, 0.5088]}, {"w": "example,", "b": [0.2803, 0.4903, 0.3662, 0.5088]}, {"w": "the", "b": [0.3721, 0.4903, 0.401, 0.5088]}, {"w": "specific", "b": [0.4069, 0.4903, 0.4804, 0.5088]}, {"w": "visual", "b": [0.4863, 0.4903, 0.5427, 0.5088]}, {"w": "appearance", "b": [0.5486, 0.4903, 0.6548, 0.5088]}, {"w": "of", "b": [0.6607, 0.4903, 0.6803, 0.5088]}, {"w": "the", "b": [0.6862, 0.4903, 0.7151, 0.5088]}, {"w": "image),", "b": [0.721, 0.4903, 0.7925, 0.5088]}, {"w": "and", "b": [0.7984, 0.4903, 0.8325, 0.5088]}, {"w": "useful", "b": [0.1289, 0.5095, 0.1866, 0.528]}, {"w": "information", "b": [0.1925, 0.5095, 0.304, 0.528]}, {"w": "is", "b": [0.3099, 0.5095, 0.3257, 0.528]}, {"w": "magnified", "b": [0.3316, 0.5095, 0.4273, 0.528]}, {"w": "and", "b": [0.4332, 0.5095, 0.4673, 0.528]}, {"w": "refined", "b": [0.4732, 0.5095, 0.5401, 0.528]}, {"w": "(for", "b": [0.546, 0.5095, 0.5814, 0.528]}, {"w": "example,", "b": [0.5873, 0.5095, 0.6732, 0.528]}, {"w": "the", "b": [0.679, 0.5095, 0.7079, 0.528]}, {"w": "class", "b": [0.7138, 0.5095, 0.7597, 0.528]}, {"w": "of", "b": [0.7656, 0.5095, 0.7853, 0.528]}, {"w": "the", "b": [0.7912, 0.5095, 0.82, 0.528]}, {"w": "image).", "b": [0.1289, 0.5287, 0.2004, 0.5472]}]}, {"id": "b_2", "type": "paragraph", "text": "This is analogous to the way humans and animals perceive the world: after observing a scene for a few seconds, a human can remember which abstract objects were present in it (bicycle, tree) but can’t remember the specific appearance of these objects. In fact, if you tried to draw a generic bicycle from memory, chances are you couldn’t get it even remotely right, even though you’ve seen thousands of bicycles in your lifetime (see, for example, figure 5.28). Try it right now: this effect is absolutely real. You brain has learned to completely abstract its visual input—to transform it into high-level visual concepts while filtering out irrelevant visual details—making it tremendously difficult to remember how things around you look.", "words": [{"w": "This", "b": [0.1289, 0.5688, 0.1709, 0.5873]}, {"w": "is", "b": [0.1768, 0.5688, 0.1925, 0.5873]}, {"w": "analogous", "b": [0.1984, 0.5688, 0.2942, 0.5873]}, {"w": "to", "b": [0.3001, 0.5688, 0.3185, 0.5873]}, {"w": "the", "b": [0.3244, 0.5688, 0.3532, 0.5873]}, {"w": "way", "b": [0.3591, 0.5688, 0.3985, 0.5873]}, {"w": "humans", "b": [0.4044, 0.5688, 0.4778, 0.5873]}, {"w": "and", "b": [0.4837, 0.5688, 0.5178, 0.5873]}, {"w": "animals", "b": [0.5237, 0.5688, 0.5972, 0.5873]}, {"w": "perceive", "b": [0.6031, 0.5688, 0.6831, 0.5873]}, {"w": "the", "b": [0.689, 0.5688, 0.7179, 0.5873]}, {"w": "world:", "b": [0.7238, 0.5688, 0.7854, 0.5873]}, {"w": "after", "b": [0.7913, 0.5688, 0.8346, 0.5873]}, {"w": "observing", "b": [0.1289, 0.588, 0.222, 0.6064]}, {"w": "a", "b": [0.2279, 0.588, 0.2384, 0.6064]}, {"w": "scene", "b": [0.2443, 0.588, 0.2968, 0.6064]}, {"w": "for", "b": [0.3027, 0.588, 0.3302, 0.6064]}, {"w": "a", "b": [0.3361, 0.588, 0.3466, 0.6064]}, {"w": "few", "b": [0.3525, 0.588, 0.3879, 0.6064]}, {"w": "seconds,", "b": [0.3938, 0.588, 0.4745, 0.6064]}, {"w": "a", "b": [0.4804, 0.588, 0.4908, 0.6064]}, {"w": "human", "b": [0.4967, 0.588, 0.561, 0.6064]}, {"w": "can", "b": [0.5669, 0.588, 0.5997, 0.6064]}, {"w": "remember", "b": [0.6056, 0.588, 0.7013, 0.6064]}, {"w": "which", "b": [0.7072, 0.588, 0.7649, 0.6064]}, {"w": "abstract", "b": [0.7708, 0.588, 0.8443, 0.6064]}, {"w": "objects", "b": [0.1289, 0.6072, 0.1958, 0.6256]}, {"w": "were", "b": [0.2017, 0.6072, 0.2476, 0.6256]}, {"w": "present", "b": [0.2535, 0.6072, 0.3217, 0.6256]}, {"w": "in", "b": [0.3276, 0.6072, 0.3459, 0.6256]}, {"w": "it", "b": [0.3518, 0.6072, 0.365, 0.6256]}, {"w": "(bicycle,", "b": [0.3709, 0.6072, 0.4528, 0.6256]}, {"w": "tree)", "b": [0.4588, 0.6072, 0.502, 0.6256]}, {"w": "but", "b": [0.5079, 0.6072, 0.5381, 0.6256]}, {"w": "can’t", "b": [0.544, 0.6072, 0.5907, 0.6256]}, {"w": "remember", "b": [0.5966, 0.6072, 0.6923, 0.6256]}, {"w": "the", "b": [0.6982, 0.6072, 0.7271, 0.6256]}, {"w": "specific", "b": [0.733, 0.6072, 0.8064, 0.6256]}, {"w": "appearance", "b": [0.1289, 0.6263, 0.2351, 0.6448]}, {"w": "of", "b": [0.241, 0.6263, 0.2606, 0.6448]}, {"w": "these", "b": [0.2665, 0.6263, 0.3151, 0.6448]}, {"w": "objects.", "b": [0.321, 0.6263, 0.3938, 0.6448]}, {"w": "In", "b": [0.3996, 0.6263, 0.4193, 0.6448]}, {"w": "fact,", "b": [0.4252, 0.6263, 0.4665, 0.6448]}, {"w": "if", "b": [0.4724, 0.6263, 0.4868, 0.6448]}, {"w": "you", "b": [0.4927, 0.6263, 0.5282, 0.6448]}, {"w": "tried", "b": [0.5341, 0.6263, 0.5774, 0.6448]}, {"w": "to", "b": [0.5833, 0.6263, 0.6016, 0.6448]}, {"w": "draw", "b": [0.6075, 0.6263, 0.6547, 0.6448]}, {"w": "a", "b": [0.6606, 0.6263, 0.6711, 0.6448]}, {"w": "generic", "b": [0.677, 0.6263, 0.7465, 0.6448]}, {"w": "bicycle", "b": [0.7524, 0.6263, 0.8206, 0.6448]}, {"w": "from", "b": [0.1289, 0.6455, 0.1748, 0.664]}, {"w": "memory,", "b": [0.1807, 0.6455, 0.2637, 0.664]}, {"w": "chances", "b": [0.2697, 0.6455, 0.3444, 0.664]}, {"w": "are", "b": [0.3503, 0.6455, 0.3791, 0.664]}, {"w": "you", "b": [0.385, 0.6455, 0.4205, 0.664]}, {"w": "couldn’t", "b": [0.4264, 0.6455, 0.5046, 0.664]}, {"w": "get", "b": [0.5105, 0.6455, 0.5394, 0.664]}, {"w": "it", "b": [0.5453, 0.6455, 0.5584, 0.664]}, {"w": "even", "b": [0.5643, 0.6455, 0.6089, 0.664]}, {"w": "remotely", "b": [0.6148, 0.6455, 0.6988, 0.664]}, {"w": "right,", "b": [0.7047, 0.6455, 0.7552, 0.664]}, {"w": "even", "b": [0.7611, 0.6455, 0.8057, 0.664]}, {"w": "though", "b": [0.1289, 0.6647, 0.1945, 0.6832]}, {"w": "you’ve", "b": [0.2004, 0.6647, 0.2659, 0.6832]}, {"w": "seen", "b": [0.2718, 0.6647, 0.3138, 0.6832]}, {"w": "thousands", "b": [0.3197, 0.6647, 0.4142, 0.6832]}, {"w": "of", "b": [0.4201, 0.6647, 0.4397, 0.6832]}, {"w": "bicycles", "b": [0.4457, 0.6647, 0.523, 0.6832]}, {"w": "in", "b": [0.5289, 0.6647, 0.5473, 0.6832]}, {"w": "your", "b": [0.5532, 0.6647, 0.5965, 0.6832]}, {"w": "lifetime", "b": [0.6024, 0.6647, 0.6759, 0.6832]}, {"w": "(see,", "b": [0.6818, 0.6647, 0.7257, 0.6832]}, {"w": "for", "b": [0.7316, 0.6647, 0.7591, 0.6832]}, {"w": "example,", "b": [0.765, 0.6647, 0.851, 0.6832]}, {"w": "figure", "b": [0.1289, 0.6839, 0.1853, 0.7024]}, {"w": "5.28).", "b": [0.1912, 0.6839, 0.2463, 0.7024]}, {"w": "Try", "b": [0.2522, 0.6839, 0.2854, 0.7024]}, {"w": "it", "b": [0.2913, 0.6839, 0.3045, 0.7024]}, {"w": "right", "b": [0.3104, 0.6839, 0.355, 0.7024]}, {"w": "now:", "b": [0.3609, 0.6839, 0.4081, 0.7024]}, {"w": "this", "b": [0.414, 0.6839, 0.4481, 0.7024]}, {"w": "effect", "b": [0.454, 0.6839, 0.5073, 0.7024]}, {"w": "is", "b": [0.5132, 0.6839, 0.529, 0.7024]}, {"w": "absolutely", "b": [0.5349, 0.6839, 0.632, 0.7024]}, {"w": "real.", "b": [0.6379, 0.6839, 0.6792, 0.7024]}, {"w": "You", "b": [0.6851, 0.6839, 0.7233, 0.7024]}, {"w": "brain", "b": [0.7292, 0.6839, 0.7778, 0.7024]}, {"w": "has", "b": [0.7837, 0.6839, 0.8152, 0.7024]}, {"w": "learned", "b": [0.1289, 0.7031, 0.1984, 0.7216]}, {"w": "to", "b": [0.2043, 0.7031, 0.2227, 0.7216]}, {"w": "completely", "b": [0.2286, 0.7031, 0.3335, 0.7216]}, {"w": "abstract", "b": [0.3394, 0.7031, 0.4128, 0.7216]}, {"w": "its", "b": [0.4187, 0.7031, 0.4411, 0.7216]}, {"w": "visual", "b": [0.447, 0.7031, 0.5034, 0.7216]}, {"w": "input—to", "b": [0.5093, 0.7031, 0.5998, 0.7216]}, {"w": "transform", "b": [0.6057, 0.7031, 0.6975, 0.7216]}, {"w": "it", "b": [0.7033, 0.7031, 0.7165, 0.7216]}, {"w": "into", "b": [0.7224, 0.7031, 0.7591, 0.7216]}, {"w": "high-level", "b": [0.765, 0.7031, 0.8608, 0.7216]}, {"w": "visual", "b": [0.1289, 0.7223, 0.1853, 0.7408]}, {"w": "concepts", "b": [0.1912, 0.7223, 0.2738, 0.7408]}, {"w": "while", "b": [0.2797, 0.7223, 0.3322, 0.7408]}, {"w": "filtering", "b": [0.3381, 0.7223, 0.4142, 0.7408]}, {"w": "out", "b": [0.4201, 0.7223, 0.4503, 0.7408]}, {"w": "irrelevant", "b": [0.4562, 0.7223, 0.5467, 0.7408]}, {"w": "visual", "b": [0.5526, 0.7223, 0.609, 0.7408]}, {"w": "details—making", "b": [0.6149, 0.7223, 0.771, 0.7408]}, {"w": "it", "b": [0.7769, 0.7223, 0.79, 0.7408]}, {"w": "tremendously", "b": [0.1289, 0.7415, 0.2574, 0.76]}, {"w": "difficult", "b": [0.2633, 0.7415, 0.339, 0.76]}, {"w": "to", "b": [0.3449, 0.7415, 0.3633, 0.76]}, {"w": "remember", "b": [0.3692, 0.7415, 0.4649, 0.76]}, {"w": "how", "b": [0.4708, 0.7415, 0.5114, 0.76]}, {"w": "things", "b": [0.5173, 0.7415, 0.5751, 0.76]}, {"w": "around", "b": [0.581, 0.7415, 0.6465, 0.76]}, {"w": "you", "b": [0.6524, 0.7415, 0.6879, 0.76]}, {"w": "look.", "b": [0.6938, 0.7415, 0.7417, 0.76]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 5.28. Left: attempts to draw a bicycle from memory. Right: what a schematic bicycle should look like.", "words": [{"w": "Figure", "b": [0.1289, 0.7769, 0.1787, 0.7908]}, {"w": "5.28.", "b": [0.1832, 0.7769, 0.2186, 0.7908]}, {"w": "Left:", "b": [0.223, 0.7769, 0.2604, 0.7908]}, {"w": "attempts", "b": [0.2648, 0.7769, 0.3307, 0.7908]}, {"w": "to", "b": [0.3351, 0.7769, 0.3499, 0.7908]}, {"w": "draw", "b": [0.3543, 0.7769, 0.3936, 0.7908]}, {"w": "a", "b": [0.3981, 0.7769, 0.4069, 0.7908]}, {"w": "bicycle", "b": [0.4114, 0.7769, 0.4635, 0.7908]}, {"w": "from", "b": [0.4679, 0.7769, 0.505, 0.7908]}, {"w": "memory.", "b": [0.5094, 0.7769, 0.5758, 0.7908]}, {"w": "Right:", "b": [0.5802, 0.7769, 0.6284, 0.7908]}, {"w": "what", "b": [0.6329, 0.7769, 0.6702, 0.7908]}, {"w": "a", "b": [0.6747, 0.7769, 0.6835, 0.7908]}, {"w": "schematic", "b": [0.688, 0.7769, 0.7627, 0.7908]}, {"w": "bicycle", "b": [0.7671, 0.7769, 0.8193, 0.7908]}, {"w": "should", "b": [0.1289, 0.7911, 0.1791, 0.805]}, {"w": "look", "b": [0.1835, 0.7911, 0.216, 0.805]}, {"w": "like.", "b": [0.2204, 0.7911, 0.2524, 0.805]}]}]}, {"page": 225, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "5.4.2. Visualizing convnet filters", "words": [{"w": "5.4.2.", "b": [0.1289, 0.3018, 0.182, 0.3203]}, {"w": "Visualizing", "b": [0.1879, 0.3018, 0.2999, 0.3203]}, {"w": "convnet", "b": [0.3058, 0.3018, 0.3845, 0.3203]}, {"w": "filters", "b": [0.3904, 0.3018, 0.4494, 0.3203]}]}, {"id": "b_1", "type": "paragraph", "text": "Another easy way to inspect the filters learned by convnets is to display the visual pattern that each filter is meant to respond to. This can be done with gradient ascent in input space: applying gradient descent to the value of the input image of a convnet so as to maximize the response of a specific filter, starting from a blank input image. The resulting input image will be one that the chosen filter is maximally responsive to.", "words": [{"w": "Another", "b": [0.1289, 0.3418, 0.2063, 0.3603]}, {"w": "easy", "b": [0.2122, 0.3418, 0.2541, 0.3603]}, {"w": "way", "b": [0.26, 0.3418, 0.2994, 0.3603]}, {"w": "to", "b": [0.3053, 0.3418, 0.3237, 0.3603]}, {"w": "inspect", "b": [0.3296, 0.3418, 0.3965, 0.3603]}, {"w": "the", "b": [0.4024, 0.3418, 0.4312, 0.3603]}, {"w": "filters", "b": [0.4371, 0.3418, 0.4922, 0.3603]}, {"w": "learned", "b": [0.4981, 0.3418, 0.5676, 0.3603]}, {"w": "by", "b": [0.5735, 0.3418, 0.5971, 0.3603]}, {"w": "convnets", "b": [0.603, 0.3418, 0.687, 0.3603]}, {"w": "is", "b": [0.6929, 0.3418, 0.7086, 0.3603]}, {"w": "to", "b": [0.7145, 0.3418, 0.7329, 0.3603]}, {"w": "display", "b": [0.7388, 0.3418, 0.807, 0.3603]}, {"w": "the", "b": [0.8129, 0.3418, 0.8418, 0.3603]}, {"w": "visual", "b": [0.1289, 0.361, 0.1853, 0.3795]}, {"w": "pattern", "b": [0.1912, 0.361, 0.2568, 0.3795]}, {"w": "that", "b": [0.2627, 0.361, 0.2981, 0.3795]}, {"w": "each", "b": [0.304, 0.361, 0.3473, 0.3795]}, {"w": "filter", "b": [0.3532, 0.361, 0.3991, 0.3795]}, {"w": "is", "b": [0.405, 0.361, 0.4207, 0.3795]}, {"w": "meant", "b": [0.4266, 0.361, 0.4843, 0.3795]}, {"w": "to", "b": [0.4903, 0.361, 0.5086, 0.3795]}, {"w": "respond", "b": [0.5144, 0.361, 0.5892, 0.3795]}, {"w": "to.", "b": [0.5951, 0.361, 0.6194, 0.3795]}, {"w": "This", "b": [0.6253, 0.361, 0.6673, 0.3795]}, {"w": "can", "b": [0.6732, 0.361, 0.706, 0.3795]}, {"w": "be", "b": [0.7119, 0.361, 0.7342, 0.3795]}, {"w": "done", "b": [0.7401, 0.361, 0.786, 0.3795]}, {"w": "with", "b": [0.7919, 0.361, 0.8339, 0.3795]}, {"w": "gradient", "b": [0.1289, 0.3802, 0.2089, 0.3987]}, {"w": "ascent", "b": [0.2148, 0.3802, 0.2751, 0.3987]}, {"w": "in", "b": [0.281, 0.3802, 0.2994, 0.3987]}, {"w": "input", "b": [0.3053, 0.3802, 0.3539, 0.3987]}, {"w": "space:", "b": [0.3598, 0.3802, 0.4201, 0.3987]}, {"w": "applying", "b": [0.426, 0.3802, 0.5086, 0.3987]}, {"w": "gradient", "b": [0.5145, 0.3802, 0.5945, 0.3987]}, {"w": "descent", "b": [0.6005, 0.3802, 0.6713, 0.3987]}, {"w": "to", "b": [0.6771, 0.3802, 0.6955, 0.3987]}, {"w": "the", "b": [0.7014, 0.3802, 0.7303, 0.3987]}, {"w": "value", "b": [0.7362, 0.3802, 0.7873, 0.3987]}, {"w": "of", "b": [0.7932, 0.3802, 0.8129, 0.3987]}, {"w": "the", "b": [0.8188, 0.3802, 0.8477, 0.3987]}, {"w": "input", "b": [0.1289, 0.3994, 0.1774, 0.4179]}, {"w": "image", "b": [0.1833, 0.3994, 0.241, 0.4179]}, {"w": "of", "b": [0.2469, 0.3994, 0.2666, 0.4179]}, {"w": "a", "b": [0.2725, 0.3994, 0.283, 0.4179]}, {"w": "convnet", "b": [0.2889, 0.3994, 0.3637, 0.4179]}, {"w": "so", "b": [0.3696, 0.3994, 0.3906, 0.4179]}, {"w": "as", "b": [0.3965, 0.3994, 0.4161, 0.4179]}, {"w": "to", "b": [0.4221, 0.3994, 0.4404, 0.4179]}, {"w": "maximize", "b": [0.4463, 0.3994, 0.5355, 0.4179]}, {"w": "the", "b": [0.5414, 0.3994, 0.5702, 0.4179]}, {"w": "response", "b": [0.5761, 0.3994, 0.6588, 0.4179]}, {"w": "of", "b": [0.6647, 0.3994, 0.6843, 0.4179]}, {"w": "a", "b": [0.6902, 0.3994, 0.7007, 0.4179]}, {"w": "specific", "b": [0.7066, 0.3994, 0.7801, 0.4179]}, {"w": "filter,", "b": [0.786, 0.3994, 0.8368, 0.4179]}, {"w": "starting", "b": [0.1289, 0.4186, 0.1997, 0.4371]}, {"w": "from", "b": [0.2056, 0.4186, 0.2515, 0.4371]}, {"w": "a", "b": [0.2574, 0.4186, 0.2679, 0.4371]}, {"w": "blank", "b": [0.2738, 0.4186, 0.3263, 0.4371]}, {"w": "input", "b": [0.3322, 0.4186, 0.3808, 0.4371]}, {"w": "image.", "b": [0.3867, 0.4186, 0.4503, 0.4371]}, {"w": "The", "b": [0.4562, 0.4186, 0.4929, 0.4371]}, {"w": "resulting", "b": [0.4988, 0.4186, 0.5815, 0.4371]}, {"w": "input", "b": [0.5874, 0.4186, 0.6359, 0.4371]}, {"w": "image", "b": [0.6418, 0.4186, 0.6995, 0.4371]}, {"w": "will", "b": [0.7054, 0.4186, 0.7422, 0.4371]}, {"w": "be", "b": [0.7481, 0.4186, 0.7704, 0.4371]}, {"w": "one", "b": [0.7763, 0.4186, 0.8104, 0.4371]}, {"w": "that", "b": [0.8163, 0.4186, 0.8517, 0.4371]}, {"w": "the", "b": [0.1289, 0.4378, 0.1577, 0.4563]}, {"w": "chosen", "b": [0.1636, 0.4378, 0.2292, 0.4563]}, {"w": "filter", "b": [0.2351, 0.4378, 0.281, 0.4563]}, {"w": "is", "b": [0.2869, 0.4378, 0.3027, 0.4563]}, {"w": "maximally", "b": [0.3086, 0.4378, 0.4096, 0.4563]}, {"w": "responsive", "b": [0.4155, 0.4378, 0.5165, 0.4563]}, {"w": "to.", "b": [0.5224, 0.4378, 0.5467, 0.4563]}]}, {"id": "b_2", "type": "paragraph", "text": "The process is simple: you’ll build a loss function that maximizes the value of a given filter in a given convolution layer, and then you’ll use stochastic gradient descent to adjust the values of the input image so as to maximize this activation value. For instance, here’s a loss for the activation of filter 0 in the layer block3_conv1 of the VGG16 network, pretrained on ImageNet.", "words": [{"w": "The", "b": [0.1289, 0.4778, 0.1656, 0.4963]}, {"w": "process", "b": [0.1715, 0.4778, 0.2423, 0.4963]}, {"w": "is", "b": [0.2482, 0.4778, 0.264, 0.4963]}, {"w": "simple:", "b": [0.2699, 0.4778, 0.3394, 0.4963]}, {"w": "you’ll", "b": [0.3453, 0.4778, 0.4017, 0.4963]}, {"w": "build", "b": [0.4076, 0.4778, 0.4562, 0.4963]}, {"w": "a", "b": [0.4621, 0.4778, 0.4726, 0.4963]}, {"w": "loss", "b": [0.4785, 0.4778, 0.5152, 0.4963]}, {"w": "function", "b": [0.5211, 0.4778, 0.5998, 0.4963]}, {"w": "that", "b": [0.6058, 0.4778, 0.6412, 0.4963]}, {"w": "maximizes", "b": [0.6471, 0.4778, 0.7494, 0.4963]}, {"w": "the", "b": [0.7553, 0.4778, 0.7842, 0.4963]}, {"w": "value", "b": [0.7901, 0.4778, 0.8412, 0.4963]}, {"w": "of", "b": [0.8471, 0.4778, 0.8668, 0.4963]}, {"w": "a", "b": [0.1289, 0.497, 0.1394, 0.5155]}, {"w": "given", "b": [0.1453, 0.497, 0.1977, 0.5155]}, {"w": "filter", "b": [0.2036, 0.497, 0.2495, 0.5155]}, {"w": "in", "b": [0.2555, 0.497, 0.2738, 0.5155]}, {"w": "a", "b": [0.2797, 0.497, 0.2902, 0.5155]}, {"w": "given", "b": [0.2961, 0.497, 0.3486, 0.5155]}, {"w": "convolution", "b": [0.3545, 0.497, 0.4673, 0.5155]}, {"w": "layer,", "b": [0.4732, 0.497, 0.5253, 0.5155]}, {"w": "and", "b": [0.5312, 0.497, 0.5653, 0.5155]}, {"w": "then", "b": [0.5712, 0.497, 0.6119, 0.5155]}, {"w": "you’ll", "b": [0.6178, 0.497, 0.6742, 0.5155]}, {"w": "use", "b": [0.6801, 0.497, 0.7116, 0.5155]}, {"w": "stochastic", "b": [0.7175, 0.497, 0.8106, 0.5155]}, {"w": "gradient", "b": [0.1289, 0.5162, 0.2063, 0.5347]}, {"w": "descent", "b": [0.2122, 0.5162, 0.283, 0.5347]}, {"w": "to", "b": [0.2889, 0.5162, 0.3073, 0.5347]}, {"w": "adjust", "b": [0.3132, 0.5162, 0.3696, 0.5347]}, {"w": "the", "b": [0.3755, 0.5162, 0.4043, 0.5347]}, {"w": "values", "b": [0.4102, 0.5162, 0.4706, 0.5347]}, {"w": "of", "b": [0.4765, 0.5162, 0.4962, 0.5347]}, {"w": "the", "b": [0.5021, 0.5162, 0.5309, 0.5347]}, {"w": "input", "b": [0.5368, 0.5162, 0.5854, 0.5347]}, {"w": "image", "b": [0.5913, 0.5162, 0.649, 0.5347]}, {"w": "so", "b": [0.6549, 0.5162, 0.6759, 0.5347]}, {"w": "as", "b": [0.6818, 0.5162, 0.7015, 0.5347]}, {"w": "to", "b": [0.7074, 0.5162, 0.7257, 0.5347]}, {"w": "maximize", "b": [0.7316, 0.5162, 0.8248, 0.5347]}, {"w": "this", "b": [0.8307, 0.5162, 0.8648, 0.5347]}, {"w": "activation", "b": [0.1289, 0.5354, 0.222, 0.5539]}, {"w": "value.", "b": [0.2279, 0.5354, 0.2849, 0.5539]}, {"w": "For", "b": [0.2908, 0.5354, 0.3236, 0.5539]}, {"w": "instance,", "b": [0.3295, 0.5354, 0.4128, 0.5539]}, {"w": "here’s", "b": [0.4187, 0.5354, 0.4751, 0.5539]}, {"w": "a", "b": [0.481, 0.5354, 0.4915, 0.5539]}, {"w": "loss", "b": [0.4974, 0.5354, 0.5341, 0.5539]}, {"w": "for", "b": [0.54, 0.5354, 0.5676, 0.5539]}, {"w": "the", "b": [0.5735, 0.5354, 0.6023, 0.5539]}, {"w": "activation", "b": [0.6082, 0.5354, 0.7014, 0.5539]}, {"w": "of", "b": [0.7073, 0.5354, 0.7269, 0.5539]}, {"w": "filter", "b": [0.7328, 0.5354, 0.7787, 0.5539]}, {"w": "0", "b": [0.7847, 0.5354, 0.7965, 0.5539]}, {"w": "in", "b": [0.8024, 0.5354, 0.8207, 0.5539]}, {"w": "the", "b": [0.8266, 0.5354, 0.8555, 0.5539]}, {"w": "layer", "b": [0.1289, 0.5546, 0.1761, 0.5731]}, {"w": "block3_conv1", "b": [0.182, 0.5556, 0.352, 0.5745]}, {"w": "of", "b": [0.3579, 0.5546, 0.3776, 0.5731]}, {"w": "the", "b": [0.3835, 0.5546, 0.4124, 0.5731]}, {"w": "VGG16", "b": [0.4183, 0.5546, 0.493, 0.5731]}, {"w": "network,", "b": [0.4989, 0.5546, 0.5822, 0.5731]}, {"w": "pretrained", "b": [0.5881, 0.5546, 0.6839, 0.5731]}, {"w": "on", "b": [0.6898, 0.5546, 0.7134, 0.5731]}, {"w": "ImageNet.", "b": [0.7193, 0.5546, 0.8183, 0.5731]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.32. Defining the loss tensor for filter visualization", "words": [{"w": "Listing", "b": [0.1289, 0.5909, 0.182, 0.6047]}, {"w": "5.32.", "b": [0.1865, 0.5909, 0.2219, 0.6047]}, {"w": "Defining", "b": [0.2263, 0.5909, 0.2912, 0.6047]}, {"w": "the", "b": [0.2957, 0.5909, 0.3193, 0.6047]}, {"w": "loss", "b": [0.3237, 0.5909, 0.3513, 0.6047]}, {"w": "tensor", "b": [0.3557, 0.5909, 0.4029, 0.6047]}, {"w": "for", "b": [0.4073, 0.5909, 0.4299, 0.6047]}, {"w": "filter", "b": [0.4344, 0.5909, 0.4717, 0.6047]}, {"w": "visualization", "b": [0.4762, 0.5909, 0.5716, 0.6047]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.applications import VGG16 from keras import backend as K model = VGG16(weights='imagenet', include_top=False) layer_name = 'block3_conv1' filter_index = 0 layer_output = model.get_layer(layer_name).output loss = K.mean(layer_output[:, :, :, filter_index])", "words": [{"w": "from", "b": [0.1348, 0.6175, 0.1773, 0.6316]}, {"w": "keras.applications", "b": [0.1879, 0.6175, 0.3792, 0.6316]}, {"w": "import", "b": [0.3898, 0.6175, 0.4536, 0.6316]}, {"w": "VGG16", "b": [0.4642, 0.6175, 0.5173, 0.6316]}, {"w": "from", "b": [0.1348, 0.6316, 0.1773, 0.6458]}, {"w": "keras", "b": [0.1879, 0.6316, 0.241, 0.6458]}, {"w": "import", "b": [0.2517, 0.6316, 0.3154, 0.6458]}, {"w": "backend", "b": [0.3261, 0.6316, 0.4004, 0.6458]}, {"w": "as", "b": [0.4111, 0.6316, 0.4323, 0.6458]}, {"w": "K", "b": [0.443, 0.6316, 0.4536, 0.6458]}, {"w": "model", "b": [0.1348, 0.66, 0.1879, 0.6742]}, {"w": "=", "b": [0.1985, 0.66, 0.2092, 0.6742]}, {"w": "VGG16(weights='imagenet',", "b": [0.2198, 0.66, 0.4855, 0.6742]}, {"w": "include_top=False)", "b": [0.2836, 0.6742, 0.4748, 0.6884]}, {"w": "layer_name", "b": [0.1348, 0.7026, 0.241, 0.7167]}, {"w": "=", "b": [0.2517, 0.7026, 0.2623, 0.7167]}, {"w": "'block3_conv1'", "b": [0.2729, 0.7026, 0.4217, 0.7167]}, {"w": "filter_index", "b": [0.1348, 0.7167, 0.2623, 0.7309]}, {"w": "=", "b": [0.2729, 0.7167, 0.2836, 0.7309]}, {"w": "0", "b": [0.2942, 0.7167, 0.3048, 0.7309]}, {"w": "layer_output", "b": [0.1348, 0.7451, 0.2623, 0.7593]}, {"w": "=", "b": [0.2729, 0.7451, 0.2836, 0.7593]}, {"w": "model.get_layer(layer_name).output", "b": [0.2942, 0.7451, 0.6555, 0.7593]}, {"w": "loss", "b": [0.1348, 0.7593, 0.1773, 0.7735]}, {"w": "=", "b": [0.1879, 0.7593, 0.1985, 0.7735]}, {"w": "K.mean(layer_output[:,", "b": [0.2092, 0.7593, 0.443, 0.7735]}, {"w": ":,", "b": [0.4536, 0.7593, 0.4748, 0.7735]}, {"w": ":,", "b": [0.4855, 0.7593, 0.5067, 0.7735]}, {"w": "filter_index])", "b": [0.5173, 0.7593, 0.6661, 0.7735]}]}, {"id": "b_5", "type": "paragraph", "text": "To implement gradient descent, you’ll need the gradient of this loss with respect to the model’s input. To do this, you’ll use the gradients function packaged with the backend module of Keras.", "words": [{"w": "To", "b": [0.1289, 0.7949, 0.1535, 0.8134]}, {"w": "implement", "b": [0.1594, 0.7949, 0.2604, 0.8134]}, {"w": "gradient", "b": [0.2663, 0.7949, 0.3437, 0.8134]}, {"w": "descent,", "b": [0.3496, 0.7949, 0.4263, 0.8134]}, {"w": "you’ll", "b": [0.4322, 0.7949, 0.4886, 0.8134]}, {"w": "need", "b": [0.4945, 0.7949, 0.5391, 0.8134]}, {"w": "the", "b": [0.545, 0.7949, 0.5739, 0.8134]}, {"w": "gradient", "b": [0.5798, 0.7949, 0.6572, 0.8134]}, {"w": "of", "b": [0.6631, 0.7949, 0.6827, 0.8134]}, {"w": "this", "b": [0.6886, 0.7949, 0.7228, 0.8134]}, {"w": "loss", "b": [0.7287, 0.7949, 0.7654, 0.8134]}, {"w": "with", "b": [0.7713, 0.7949, 0.8133, 0.8134]}, {"w": "respect", "b": [0.1289, 0.8141, 0.1958, 0.8326]}, {"w": "to", "b": [0.2017, 0.8141, 0.22, 0.8326]}, {"w": "the", "b": [0.2259, 0.8141, 0.2548, 0.8326]}, {"w": "model’s", "b": [0.2607, 0.8141, 0.3354, 0.8326]}, {"w": "input.", "b": [0.3413, 0.8141, 0.3958, 0.8326]}, {"w": "To", "b": [0.4017, 0.8141, 0.4263, 0.8326]}, {"w": "do", "b": [0.4322, 0.8141, 0.4558, 0.8326]}, {"w": "this,", "b": [0.4617, 0.8141, 0.5017, 0.8326]}, {"w": "you’ll", "b": [0.5076, 0.8141, 0.5641, 0.8326]}, {"w": "use", "b": [0.5699, 0.8141, 0.6014, 0.8326]}, {"w": "the", "b": [0.6073, 0.8141, 0.6362, 0.8326]}, {"w": "gradients", "b": [0.6421, 0.8151, 0.7696, 0.834]}, {"w": "function", "b": [0.7755, 0.8141, 0.8542, 0.8326]}, {"w": "packaged", "b": [0.1289, 0.8341, 0.218, 0.8526]}, {"w": "with", "b": [0.2239, 0.8341, 0.2659, 0.8526]}, {"w": "the", "b": [0.2718, 0.8341, 0.3007, 0.8526]}, {"w": "backend", "b": [0.3066, 0.8351, 0.4057, 0.854]}, {"w": "module", "b": [0.4116, 0.8341, 0.4825, 0.8526]}, {"w": "of", "b": [0.4884, 0.8341, 0.5081, 0.8526]}, {"w": "Keras.", "b": [0.514, 0.8341, 0.5749, 0.8526]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.33. Obtaining the gradient of the loss with regard to the input", "words": [{"w": "Listing", "b": [0.1289, 0.8704, 0.182, 0.8842]}, {"w": "5.33.", "b": [0.1865, 0.8704, 0.2219, 0.8842]}, {"w": "Obtaining", "b": [0.2263, 0.8704, 0.3031, 0.8842]}, {"w": "the", "b": [0.3075, 0.8704, 0.3311, 0.8842]}, {"w": "gradient", "b": [0.3355, 0.8704, 0.3995, 0.8842]}, {"w": "of", "b": [0.4039, 0.8704, 0.4187, 0.8842]}, {"w": "the", "b": [0.4231, 0.8704, 0.4467, 0.8842]}, {"w": "loss", "b": [0.4511, 0.8704, 0.4787, 0.8842]}, {"w": "with", "b": [0.4831, 0.8704, 0.5166, 0.8842]}, {"w": "regard", "b": [0.521, 0.8704, 0.5718, 0.8842]}, {"w": "to", "b": [0.5763, 0.8704, 0.591, 0.8842]}, {"w": "the", "b": [0.5954, 0.8704, 0.619, 0.8842]}, {"w": "input", "b": [0.6235, 0.8704, 0.6638, 0.8842]}]}, {"id": "b_7", "type": "equation", "text": "grads = K.gradients(loss, model.input)[0] 1", "words": [{"w": "grads", "b": [0.1348, 0.897, 0.1879, 0.9112]}, {"w": "=", "b": [0.1985, 0.897, 0.2092, 0.9112]}, {"w": "K.gradients(loss,", "b": [0.2198, 0.897, 0.4004, 0.9112]}, {"w": "model.input)[0]", "b": [0.4111, 0.897, 0.5705, 0.9112]}, {"w": "1", "b": [0.6768, 0.897, 0.6874, 0.9112]}]}]}, {"page": 226, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1 The call to gradients returns a list of tensors (of size 1 in this case). Hence, you keep only the first element—which is a tensor.", "words": [{"w": "1", "b": [0.1761, 0.0857, 0.1879, 0.1041]}, {"w": "The", "b": [0.1938, 0.0857, 0.2332, 0.1041]}, {"w": "call", "b": [0.2391, 0.0857, 0.2745, 0.1041]}, {"w": "to", "b": [0.2804, 0.0857, 0.3001, 0.1041]}, {"w": "gradients", "b": [0.306, 0.0857, 0.4004, 0.1041]}, {"w": "returns", "b": [0.4063, 0.0857, 0.4807, 0.1041]}, {"w": "a", "b": [0.4866, 0.0857, 0.4984, 0.1041]}, {"w": "list", "b": [0.5043, 0.0857, 0.5345, 0.1041]}, {"w": "of", "b": [0.5404, 0.0857, 0.56, 0.1041]}, {"w": "tensors", "b": [0.5659, 0.0857, 0.6381, 0.1041]}, {"w": "(of", "b": [0.644, 0.0857, 0.6715, 0.1041]}, {"w": "size", "b": [0.6774, 0.0857, 0.7142, 0.1041]}, {"w": "1", "b": [0.7201, 0.0857, 0.7319, 0.1041]}, {"w": "in", "b": [0.7378, 0.0857, 0.7575, 0.1041]}, {"w": "this", "b": [0.7634, 0.0857, 0.8001, 0.1041]}, {"w": "case).", "b": [0.806, 0.0857, 0.8617, 0.1041]}, {"w": "Hence,", "b": [0.1761, 0.1049, 0.245, 0.1233]}, {"w": "you", "b": [0.2509, 0.1049, 0.2876, 0.1233]}, {"w": "keep", "b": [0.2935, 0.1049, 0.3407, 0.1233]}, {"w": "only", "b": [0.3467, 0.1049, 0.39, 0.1233]}, {"w": "the", "b": [0.3959, 0.1049, 0.4273, 0.1233]}, {"w": "first", "b": [0.4332, 0.1049, 0.4752, 0.1233]}, {"w": "element—which", "b": [0.4811, 0.1049, 0.6438, 0.1233]}, {"w": "is", "b": [0.6497, 0.1049, 0.6654, 0.1233]}, {"w": "a", "b": [0.6713, 0.1049, 0.6831, 0.1233]}, {"w": "tensor.", "b": [0.689, 0.1049, 0.7557, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "A non-obvious trick to use to help the gradient-descent process go smoothly is to normalize the gradient tensor by dividing it by its L2 norm (the square root of the average of the square of the values in the tensor). This ensures that the magnitude of the updates done to the input image is always within the same range.", "words": [{"w": "A", "b": [0.1289, 0.1449, 0.1459, 0.1634]}, {"w": "non-obvious", "b": [0.1518, 0.1449, 0.2699, 0.1634]}, {"w": "trick", "b": [0.2758, 0.1449, 0.3191, 0.1634]}, {"w": "to", "b": [0.325, 0.1449, 0.3434, 0.1634]}, {"w": "use", "b": [0.3493, 0.1449, 0.3808, 0.1634]}, {"w": "to", "b": [0.3867, 0.1449, 0.405, 0.1634]}, {"w": "help", "b": [0.4109, 0.1449, 0.4516, 0.1634]}, {"w": "the", "b": [0.4575, 0.1449, 0.4864, 0.1634]}, {"w": "gradient-descent", "b": [0.4923, 0.1449, 0.6483, 0.1634]}, {"w": "process", "b": [0.6542, 0.1449, 0.7251, 0.1634]}, {"w": "go", "b": [0.731, 0.1449, 0.7546, 0.1634]}, {"w": "smoothly", "b": [0.7605, 0.1449, 0.8484, 0.1634]}, {"w": "is", "b": [0.8543, 0.1449, 0.87, 0.1634]}, {"w": "to", "b": [0.1289, 0.1641, 0.1472, 0.1826]}, {"w": "normalize", "b": [0.1532, 0.1641, 0.2476, 0.1826]}, {"w": "the", "b": [0.2535, 0.1641, 0.2823, 0.1826]}, {"w": "gradient", "b": [0.2883, 0.1641, 0.3656, 0.1826]}, {"w": "tensor", "b": [0.3715, 0.1641, 0.4293, 0.1826]}, {"w": "by", "b": [0.4352, 0.1641, 0.4588, 0.1826]}, {"w": "dividing", "b": [0.4647, 0.1641, 0.5434, 0.1826]}, {"w": "it", "b": [0.5492, 0.1641, 0.5624, 0.1826]}, {"w": "by", "b": [0.5683, 0.1641, 0.5919, 0.1826]}, {"w": "its", "b": [0.5978, 0.1641, 0.6201, 0.1826]}, {"w": "L2", "b": [0.626, 0.1641, 0.6522, 0.1826]}, {"w": "norm", "b": [0.6581, 0.1641, 0.708, 0.1826]}, {"w": "(the", "b": [0.7139, 0.1641, 0.7506, 0.1826]}, {"w": "square", "b": [0.7565, 0.1641, 0.8182, 0.1826]}, {"w": "root", "b": [0.8241, 0.1641, 0.8621, 0.1826]}, {"w": "of", "b": [0.1289, 0.1833, 0.1485, 0.2018]}, {"w": "the", "b": [0.1545, 0.1833, 0.1833, 0.2018]}, {"w": "average", "b": [0.1892, 0.1833, 0.2626, 0.2018]}, {"w": "of", "b": [0.2685, 0.1833, 0.2882, 0.2018]}, {"w": "the", "b": [0.2941, 0.1833, 0.323, 0.2018]}, {"w": "square", "b": [0.3289, 0.1833, 0.3905, 0.2018]}, {"w": "of", "b": [0.3964, 0.1833, 0.4161, 0.2018]}, {"w": "the", "b": [0.422, 0.1833, 0.4508, 0.2018]}, {"w": "values", "b": [0.4567, 0.1833, 0.5171, 0.2018]}, {"w": "in", "b": [0.523, 0.1833, 0.5414, 0.2018]}, {"w": "the", "b": [0.5473, 0.1833, 0.5761, 0.2018]}, {"w": "tensor).", "b": [0.582, 0.1833, 0.6535, 0.2018]}, {"w": "This", "b": [0.6594, 0.1833, 0.7014, 0.2018]}, {"w": "ensures", "b": [0.7073, 0.1833, 0.7781, 0.2018]}, {"w": "that", "b": [0.784, 0.1833, 0.8194, 0.2018]}, {"w": "the", "b": [0.8253, 0.1833, 0.8542, 0.2018]}, {"w": "magnitude", "b": [0.1289, 0.2025, 0.2286, 0.221]}, {"w": "of", "b": [0.2345, 0.2025, 0.2541, 0.221]}, {"w": "the", "b": [0.26, 0.2025, 0.2889, 0.221]}, {"w": "updates", "b": [0.2948, 0.2025, 0.3669, 0.221]}, {"w": "done", "b": [0.3728, 0.2025, 0.4187, 0.221]}, {"w": "to", "b": [0.4247, 0.2025, 0.443, 0.221]}, {"w": "the", "b": [0.4489, 0.2025, 0.4778, 0.221]}, {"w": "input", "b": [0.4837, 0.2025, 0.5322, 0.221]}, {"w": "image", "b": [0.5381, 0.2025, 0.5959, 0.221]}, {"w": "is", "b": [0.6018, 0.2025, 0.6175, 0.221]}, {"w": "always", "b": [0.6234, 0.2025, 0.689, 0.221]}, {"w": "within", "b": [0.6949, 0.2025, 0.7553, 0.221]}, {"w": "the", "b": [0.7612, 0.2025, 0.79, 0.221]}, {"w": "same", "b": [0.7959, 0.2025, 0.8445, 0.221]}, {"w": "range.", "b": [0.1289, 0.2217, 0.1872, 0.2402]}]}, {"id": "b_2", "type": "equation", "text": "Listing 5.34. Gradient-normalization trick", "words": [{"w": "Listing", "b": [0.1289, 0.2571, 0.182, 0.271]}, {"w": "5.34.", "b": [0.1865, 0.2571, 0.2219, 0.271]}, {"w": "Gradient-normalization", "b": [0.2263, 0.2571, 0.4073, 0.271]}, {"w": "trick", "b": [0.4118, 0.2571, 0.4482, 0.271]}]}, {"id": "b_3", "type": "equation", "text": "grads /= (K.sqrt(K.mean(K.square(grads))) + 1e-5) 1", "words": [{"w": "grads", "b": [0.1348, 0.2837, 0.1879, 0.2979]}, {"w": "/=", "b": [0.1985, 0.2837, 0.2198, 0.2979]}, {"w": "(K.sqrt(K.mean(K.square(grads)))", "b": [0.2304, 0.2837, 0.5705, 0.2979]}, {"w": "+", "b": [0.5811, 0.2837, 0.5917, 0.2979]}, {"w": "1e-5)", "b": [0.6024, 0.2837, 0.6555, 0.2979]}, {"w": "1", "b": [0.7512, 0.2837, 0.7618, 0.2979]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Add 1e–5 before dividing to avoid accidentally dividing by 0.", "words": [{"w": "1", "b": [0.1761, 0.3151, 0.1879, 0.3336]}, {"w": "Add", "b": [0.1938, 0.3151, 0.2371, 0.3336]}, {"w": "1e–5", "b": [0.243, 0.3151, 0.2889, 0.3336]}, {"w": "before", "b": [0.2948, 0.3151, 0.3587, 0.3336]}, {"w": "dividing", "b": [0.3646, 0.3151, 0.4473, 0.3336]}, {"w": "to", "b": [0.4532, 0.3151, 0.4729, 0.3336]}, {"w": "avoid", "b": [0.4788, 0.3151, 0.5339, 0.3336]}, {"w": "accidentally", "b": [0.5398, 0.3151, 0.6605, 0.3336]}, {"w": "dividing", "b": [0.6664, 0.3151, 0.7491, 0.3336]}, {"w": "by", "b": [0.755, 0.3151, 0.7799, 0.3336]}, {"w": "0.", "b": [0.7858, 0.3151, 0.8035, 0.3336]}]}, {"id": "b_5", "type": "paragraph", "text": "Now you need a way to compute the value of the loss tensor and the gradient tensor, given an input image. You can define a Keras backend function to do this: iterate is a function that takes a Numpy tensor (as a list of tensors of size 1) and returns a list of two Numpy tensors: the loss value and the gradient value.", "words": [{"w": "Now", "b": [0.1289, 0.3552, 0.1748, 0.3737]}, {"w": "you", "b": [0.1807, 0.3552, 0.2161, 0.3737]}, {"w": "need", "b": [0.222, 0.3552, 0.2666, 0.3737]}, {"w": "a", "b": [0.2725, 0.3552, 0.283, 0.3737]}, {"w": "way", "b": [0.2889, 0.3552, 0.3282, 0.3737]}, {"w": "to", "b": [0.3341, 0.3552, 0.3525, 0.3737]}, {"w": "compute", "b": [0.3584, 0.3552, 0.4397, 0.3737]}, {"w": "the", "b": [0.4456, 0.3552, 0.4745, 0.3737]}, {"w": "value", "b": [0.4804, 0.3552, 0.5316, 0.3737]}, {"w": "of", "b": [0.5375, 0.3552, 0.5571, 0.3737]}, {"w": "the", "b": [0.563, 0.3552, 0.5919, 0.3737]}, {"w": "loss", "b": [0.5978, 0.3552, 0.6345, 0.3737]}, {"w": "tensor", "b": [0.6404, 0.3552, 0.6982, 0.3737]}, {"w": "and", "b": [0.7041, 0.3552, 0.7382, 0.3737]}, {"w": "the", "b": [0.7441, 0.3552, 0.7729, 0.3737]}, {"w": "gradient", "b": [0.7788, 0.3552, 0.8562, 0.3737]}, {"w": "tensor,", "b": [0.1289, 0.3744, 0.1915, 0.3928]}, {"w": "given", "b": [0.1974, 0.3744, 0.2499, 0.3928]}, {"w": "an", "b": [0.2558, 0.3744, 0.2781, 0.3928]}, {"w": "input", "b": [0.284, 0.3744, 0.3326, 0.3928]}, {"w": "image.", "b": [0.3385, 0.3744, 0.4021, 0.3928]}, {"w": "You", "b": [0.408, 0.3744, 0.4463, 0.3928]}, {"w": "can", "b": [0.4522, 0.3744, 0.4849, 0.3928]}, {"w": "define", "b": [0.4909, 0.3744, 0.5499, 0.3928]}, {"w": "a", "b": [0.5558, 0.3744, 0.5663, 0.3928]}, {"w": "Keras", "b": [0.5721, 0.3744, 0.6272, 0.3928]}, {"w": "backend", "b": [0.6331, 0.3744, 0.7118, 0.3928]}, {"w": "function", "b": [0.7177, 0.3744, 0.7964, 0.3928]}, {"w": "to", "b": [0.8023, 0.3744, 0.8207, 0.3928]}, {"w": "do", "b": [0.8266, 0.3744, 0.8502, 0.3928]}, {"w": "this:", "b": [0.1289, 0.3936, 0.1696, 0.412]}, {"w": "iterate", "b": [0.1755, 0.3945, 0.2746, 0.4134]}, {"w": "is", "b": [0.2805, 0.3936, 0.2963, 0.412]}, {"w": "a", "b": [0.3022, 0.3936, 0.3127, 0.412]}, {"w": "function", "b": [0.3186, 0.3936, 0.3973, 0.412]}, {"w": "that", "b": [0.4032, 0.3936, 0.4386, 0.412]}, {"w": "takes", "b": [0.4445, 0.3936, 0.4931, 0.412]}, {"w": "a", "b": [0.499, 0.3936, 0.5094, 0.412]}, {"w": "Numpy", "b": [0.5153, 0.3936, 0.5862, 0.412]}, {"w": "tensor", "b": [0.5921, 0.3936, 0.6498, 0.412]}, {"w": "(as", "b": [0.6557, 0.3936, 0.6832, 0.412]}, {"w": "a", "b": [0.6892, 0.3936, 0.6996, 0.412]}, {"w": "list", "b": [0.7055, 0.3936, 0.7344, 0.412]}, {"w": "of", "b": [0.7403, 0.3936, 0.76, 0.412]}, {"w": "tensors", "b": [0.7659, 0.3936, 0.8328, 0.412]}, {"w": "of", "b": [0.8387, 0.3936, 0.8584, 0.412]}, {"w": "size", "b": [0.1289, 0.4136, 0.1656, 0.4321]}, {"w": "1)", "b": [0.1715, 0.4136, 0.1912, 0.4321]}, {"w": "and", "b": [0.1971, 0.4136, 0.2312, 0.4321]}, {"w": "returns", "b": [0.2371, 0.4136, 0.3027, 0.4321]}, {"w": "a", "b": [0.3086, 0.4136, 0.319, 0.4321]}, {"w": "list", "b": [0.3249, 0.4136, 0.3538, 0.4321]}, {"w": "of", "b": [0.3597, 0.4136, 0.3794, 0.4321]}, {"w": "two", "b": [0.3853, 0.4136, 0.4207, 0.4321]}, {"w": "Numpy", "b": [0.4266, 0.4136, 0.4975, 0.4321]}, {"w": "tensors:", "b": [0.5034, 0.4136, 0.5768, 0.4321]}, {"w": "the", "b": [0.5828, 0.4136, 0.6116, 0.4321]}, {"w": "loss", "b": [0.6175, 0.4136, 0.6543, 0.4321]}, {"w": "value", "b": [0.6601, 0.4136, 0.7113, 0.4321]}, {"w": "and", "b": [0.7172, 0.4136, 0.7513, 0.4321]}, {"w": "the", "b": [0.7572, 0.4136, 0.786, 0.4321]}, {"w": "gradient", "b": [0.7919, 0.4136, 0.8693, 0.4321]}, {"w": "value.", "b": [0.1289, 0.4328, 0.1859, 0.4513]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.35. Fetching Numpy output values given Numpy input values", "words": [{"w": "Listing", "b": [0.1289, 0.4682, 0.182, 0.4821]}, {"w": "5.35.", "b": [0.1865, 0.4682, 0.2219, 0.4821]}, {"w": "Fetching", "b": [0.2263, 0.4682, 0.2922, 0.4821]}, {"w": "Numpy", "b": [0.2966, 0.4682, 0.3527, 0.4821]}, {"w": "output", "b": [0.3572, 0.4682, 0.4073, 0.4821]}, {"w": "values", "b": [0.4118, 0.4682, 0.459, 0.4821]}, {"w": "given", "b": [0.4634, 0.4682, 0.5038, 0.4821]}, {"w": "Numpy", "b": [0.5082, 0.4682, 0.5643, 0.4821]}, {"w": "input", "b": [0.5687, 0.4682, 0.6091, 0.4821]}, {"w": "values", "b": [0.6135, 0.4682, 0.6608, 0.4821]}]}, {"id": "b_7", "type": "paragraph", "text": "iterate = K.function([model.input], [loss, grads]) import numpy as np loss_value, grads_value = iterate([np.zeros((1, 150, 150, 3))])", "words": [{"w": "iterate", "b": [0.1348, 0.4948, 0.2092, 0.509]}, {"w": "=", "b": [0.2198, 0.4948, 0.2304, 0.509]}, {"w": "K.function([model.input],", "b": [0.241, 0.4948, 0.5067, 0.509]}, {"w": "[loss,", "b": [0.5173, 0.4948, 0.5811, 0.509]}, {"w": "grads])", "b": [0.5917, 0.4948, 0.6661, 0.509]}, {"w": "import", "b": [0.1348, 0.5232, 0.1985, 0.5373]}, {"w": "numpy", "b": [0.2092, 0.5232, 0.2623, 0.5373]}, {"w": "as", "b": [0.2729, 0.5232, 0.2942, 0.5373]}, {"w": "np", "b": [0.3048, 0.5232, 0.3261, 0.5373]}, {"w": "loss_value,", "b": [0.1348, 0.5374, 0.2517, 0.5515]}, {"w": "grads_value", "b": [0.2623, 0.5374, 0.3792, 0.5515]}, {"w": "=", "b": [0.3898, 0.5374, 0.4004, 0.5515]}, {"w": "iterate([np.zeros((1,", "b": [0.4111, 0.5374, 0.6342, 0.5515]}, {"w": "150,", "b": [0.6449, 0.5374, 0.6874, 0.5515]}, {"w": "150,", "b": [0.698, 0.5374, 0.7405, 0.5515]}, {"w": "3))])", "b": [0.7511, 0.5374, 0.8043, 0.5515]}]}, {"id": "b_8", "type": "paragraph", "text": "At this point, you can define a Python loop to do stochastic gradient descent.", "words": [{"w": "At", "b": [0.1289, 0.573, 0.1525, 0.5914]}, {"w": "this", "b": [0.1584, 0.573, 0.1925, 0.5914]}, {"w": "point,", "b": [0.1984, 0.573, 0.2529, 0.5914]}, {"w": "you", "b": [0.2588, 0.573, 0.2942, 0.5914]}, {"w": "can", "b": [0.3001, 0.573, 0.3329, 0.5914]}, {"w": "define", "b": [0.3388, 0.573, 0.3978, 0.5914]}, {"w": "a", "b": [0.4037, 0.573, 0.4142, 0.5914]}, {"w": "Python", "b": [0.4201, 0.573, 0.487, 0.5914]}, {"w": "loop", "b": [0.4929, 0.573, 0.5349, 0.5914]}, {"w": "to", "b": [0.5408, 0.573, 0.5592, 0.5914]}, {"w": "do", "b": [0.5651, 0.573, 0.5887, 0.5914]}, {"w": "stochastic", "b": [0.5946, 0.573, 0.6877, 0.5914]}, {"w": "gradient", "b": [0.6936, 0.573, 0.771, 0.5914]}, {"w": "descent.", "b": [0.7769, 0.573, 0.8537, 0.5914]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 5.36. Loss maximization via stochastic gradient descent", "words": [{"w": "Listing", "b": [0.1289, 0.6084, 0.182, 0.6222]}, {"w": "5.36.", "b": [0.1865, 0.6084, 0.2219, 0.6222]}, {"w": "Loss", "b": [0.2263, 0.6084, 0.2607, 0.6222]}, {"w": "maximization", "b": [0.2652, 0.6084, 0.3685, 0.6222]}, {"w": "via", "b": [0.3729, 0.6084, 0.3955, 0.6222]}, {"w": "stochastic", "b": [0.4, 0.6084, 0.4737, 0.6222]}, {"w": "gradient", "b": [0.4782, 0.6084, 0.5421, 0.6222]}, {"w": "descent", "b": [0.5466, 0.6084, 0.6026, 0.6222]}]}, {"id": "b_10", "type": "paragraph", "text": "input_img_data = np.random.random((1, 150, 150, 3)) * 20 + 128. 1 step = 1. 23 for i in range(40): 3 loss_value, grads_value = iterate([input_img_data]) 43 input_img_data += grads_value * step 53", "words": [{"w": "input_img_data", "b": [0.1348, 0.635, 0.2836, 0.6492]}, {"w": "=", "b": [0.2942, 0.635, 0.3048, 0.6492]}, {"w": "np.random.random((1,", "b": [0.3154, 0.635, 0.528, 0.6492]}, {"w": "150,", "b": [0.5386, 0.635, 0.5811, 0.6492]}, {"w": "150,", "b": [0.5917, 0.635, 0.6342, 0.6492]}, {"w": "3))", "b": [0.6449, 0.635, 0.6767, 0.6492]}, {"w": "*", "b": [0.6874, 0.635, 0.698, 0.6492]}, {"w": "20", "b": [0.7086, 0.635, 0.7299, 0.6492]}, {"w": "+", "b": [0.7405, 0.635, 0.7511, 0.6492]}, {"w": "128.", "b": [0.7618, 0.635, 0.8043, 0.6492]}, {"w": "1", "b": [0.1348, 0.6492, 0.1454, 0.6633]}, {"w": "step", "b": [0.1348, 0.6775, 0.1773, 0.6917]}, {"w": "=", "b": [0.1879, 0.6775, 0.1985, 0.6917]}, {"w": "1.", "b": [0.2092, 0.6775, 0.2304, 0.6917]}, {"w": "23", "b": [0.1348, 0.6917, 0.156, 0.7059]}, {"w": "for", "b": [0.1348, 0.7059, 0.1667, 0.7201]}, {"w": "i", "b": [0.1773, 0.7059, 0.1879, 0.7201]}, {"w": "in", "b": [0.1985, 0.7059, 0.2198, 0.7201]}, {"w": "range(40):", "b": [0.2304, 0.7059, 0.3367, 0.7201]}, {"w": "3", "b": [0.1348, 0.7201, 0.1454, 0.7343]}, {"w": "loss_value,", "b": [0.1773, 0.7343, 0.2942, 0.7484]}, {"w": "grads_value", "b": [0.3048, 0.7343, 0.4217, 0.7484]}, {"w": "=", "b": [0.4323, 0.7343, 0.443, 0.7484]}, {"w": "iterate([input_img_data])", "b": [0.4536, 0.7343, 0.7192, 0.7484]}, {"w": "43", "b": [0.1348, 0.7485, 0.156, 0.7626]}, {"w": "input_img_data", "b": [0.1773, 0.7768, 0.3261, 0.791]}, {"w": "+=", "b": [0.3367, 0.7768, 0.3579, 0.791]}, {"w": "grads_value", "b": [0.3686, 0.7768, 0.4855, 0.791]}, {"w": "*", "b": [0.4961, 0.7768, 0.5067, 0.791]}, {"w": "step", "b": [0.5173, 0.7768, 0.5598, 0.791]}, {"w": "53", "b": [0.1348, 0.791, 0.156, 0.8052]}]}, {"id": "b_11", "type": "paragraph", "text": "1 Starts from a gray image with some noise 2 Magnitude of each gradient update 3 Runs gradient ascent for 40 steps 4 Computes the loss value and gradient value", "words": [{"w": "1", "b": [0.1761, 0.8224, 0.1879, 0.8409]}, {"w": "Starts", "b": [0.1938, 0.8224, 0.2542, 0.8409]}, {"w": "from", "b": [0.2601, 0.8224, 0.3095, 0.8409]}, {"w": "a", "b": [0.3154, 0.8224, 0.3272, 0.8409]}, {"w": "gray", "b": [0.3331, 0.8224, 0.379, 0.8409]}, {"w": "image", "b": [0.3849, 0.8224, 0.4452, 0.8409]}, {"w": "with", "b": [0.4511, 0.8224, 0.4957, 0.8409]}, {"w": "some", "b": [0.5016, 0.8224, 0.5528, 0.8409]}, {"w": "noise", "b": [0.5587, 0.8224, 0.6099, 0.8409]}, {"w": "2", "b": [0.1761, 0.8416, 0.1879, 0.8601]}, {"w": "Magnitude", "b": [0.1938, 0.8416, 0.304, 0.8601]}, {"w": "of", "b": [0.3099, 0.8416, 0.3296, 0.8601]}, {"w": "each", "b": [0.3355, 0.8416, 0.3814, 0.8601]}, {"w": "gradient", "b": [0.3873, 0.8416, 0.4726, 0.8601]}, {"w": "update", "b": [0.4785, 0.8416, 0.548, 0.8601]}, {"w": "3", "b": [0.1761, 0.8608, 0.1879, 0.8793]}, {"w": "Runs", "b": [0.1938, 0.8608, 0.2463, 0.8793]}, {"w": "gradient", "b": [0.2522, 0.8608, 0.3375, 0.8793]}, {"w": "ascent", "b": [0.3434, 0.8608, 0.4063, 0.8793]}, {"w": "for", "b": [0.4123, 0.8608, 0.4424, 0.8793]}, {"w": "40", "b": [0.4483, 0.8608, 0.4719, 0.8793]}, {"w": "steps", "b": [0.4778, 0.8608, 0.5277, 0.8793]}, {"w": "4", "b": [0.1761, 0.88, 0.1879, 0.8985]}, {"w": "Computes", "b": [0.1938, 0.88, 0.2961, 0.8985]}, {"w": "the", "b": [0.302, 0.88, 0.3335, 0.8985]}, {"w": "loss", "b": [0.3394, 0.88, 0.3762, 0.8985]}, {"w": "value", "b": [0.3821, 0.88, 0.4359, 0.8985]}, {"w": "and", "b": [0.4418, 0.88, 0.4798, 0.8985]}, {"w": "gradient", "b": [0.4857, 0.88, 0.571, 0.8985]}, {"w": "value", "b": [0.5769, 0.88, 0.6307, 0.8985]}]}]}, {"page": 227, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "5 Adjusts the input image in the direction that maximizes the loss", "words": [{"w": "5", "b": [0.1761, 0.0857, 0.1879, 0.1041]}, {"w": "Adjusts", "b": [0.1938, 0.0857, 0.2712, 0.1041]}, {"w": "the", "b": [0.2771, 0.0857, 0.3086, 0.1041]}, {"w": "input", "b": [0.3145, 0.0857, 0.3683, 0.1041]}, {"w": "image", "b": [0.3742, 0.0857, 0.4346, 0.1041]}, {"w": "in", "b": [0.4405, 0.0857, 0.4602, 0.1041]}, {"w": "the", "b": [0.4661, 0.0857, 0.4975, 0.1041]}, {"w": "direction", "b": [0.5035, 0.0857, 0.5936, 0.1041]}, {"w": "that", "b": [0.5995, 0.0857, 0.6401, 0.1041]}, {"w": "maximizes", "b": [0.646, 0.0857, 0.7523, 0.1041]}, {"w": "the", "b": [0.7582, 0.0857, 0.7897, 0.1041]}, {"w": "loss", "b": [0.7956, 0.0857, 0.8323, 0.1041]}]}, {"id": "b_1", "type": "paragraph", "text": "The resulting image tensor is a floating-point tensor of shape (1, 150, 150, 3), with values that may not be integers within [0, 255]. Hence, you need to postprocess this tensor to turn it into a displayable image. You do so with the following straightforward utility function.", "words": [{"w": "The", "b": [0.1289, 0.1257, 0.1656, 0.1442]}, {"w": "resulting", "b": [0.1715, 0.1257, 0.2542, 0.1442]}, {"w": "image", "b": [0.2601, 0.1257, 0.3178, 0.1442]}, {"w": "tensor", "b": [0.3237, 0.1257, 0.3814, 0.1442]}, {"w": "is", "b": [0.3873, 0.1257, 0.403, 0.1442]}, {"w": "a", "b": [0.4089, 0.1257, 0.4194, 0.1442]}, {"w": "floating-point", "b": [0.4253, 0.1257, 0.5552, 0.1442]}, {"w": "tensor", "b": [0.5611, 0.1257, 0.6188, 0.1442]}, {"w": "of", "b": [0.6247, 0.1257, 0.6444, 0.1442]}, {"w": "shape", "b": [0.6503, 0.1257, 0.7041, 0.1442]}, {"w": "(1,", "b": [0.7099, 0.1267, 0.7524, 0.1456]}, {"w": "150,", "b": [0.7666, 0.1267, 0.8233, 0.1456]}, {"w": "150,", "b": [0.1289, 0.1467, 0.1856, 0.1656]}, {"w": "3),", "b": [0.1997, 0.1457, 0.234, 0.1656]}, {"w": "with", "b": [0.2399, 0.1457, 0.2819, 0.1642]}, {"w": "values", "b": [0.2878, 0.1457, 0.3481, 0.1642]}, {"w": "that", "b": [0.354, 0.1457, 0.3894, 0.1642]}, {"w": "may", "b": [0.3953, 0.1457, 0.436, 0.1642]}, {"w": "not", "b": [0.4419, 0.1457, 0.4721, 0.1642]}, {"w": "be", "b": [0.478, 0.1457, 0.5003, 0.1642]}, {"w": "integers", "b": [0.5062, 0.1457, 0.5809, 0.1642]}, {"w": "within", "b": [0.5868, 0.1457, 0.6472, 0.1642]}, {"w": "[0,", "b": [0.6531, 0.1457, 0.6787, 0.1642]}, {"w": "255].", "b": [0.6846, 0.1457, 0.7338, 0.1642]}, {"w": "Hence,", "b": [0.7397, 0.1457, 0.8059, 0.1642]}, {"w": "you", "b": [0.8118, 0.1457, 0.8472, 0.1642]}, {"w": "need", "b": [0.1289, 0.1658, 0.1735, 0.1843]}, {"w": "to", "b": [0.1794, 0.1658, 0.1977, 0.1843]}, {"w": "postprocess", "b": [0.2036, 0.1658, 0.3138, 0.1843]}, {"w": "this", "b": [0.3197, 0.1658, 0.3539, 0.1843]}, {"w": "tensor", "b": [0.3598, 0.1658, 0.4175, 0.1843]}, {"w": "to", "b": [0.4234, 0.1658, 0.4417, 0.1843]}, {"w": "turn", "b": [0.4477, 0.1658, 0.4857, 0.1843]}, {"w": "it", "b": [0.4916, 0.1658, 0.5047, 0.1843]}, {"w": "into", "b": [0.5106, 0.1658, 0.5474, 0.1843]}, {"w": "a", "b": [0.5533, 0.1658, 0.5638, 0.1843]}, {"w": "displayable", "b": [0.5697, 0.1658, 0.6772, 0.1843]}, {"w": "image.", "b": [0.6831, 0.1658, 0.7467, 0.1843]}, {"w": "You", "b": [0.7526, 0.1658, 0.7909, 0.1843]}, {"w": "do", "b": [0.7968, 0.1658, 0.8204, 0.1843]}, {"w": "so", "b": [0.8263, 0.1658, 0.8473, 0.1843]}, {"w": "with", "b": [0.1289, 0.185, 0.1709, 0.2034]}, {"w": "the", "b": [0.1768, 0.185, 0.2056, 0.2034]}, {"w": "following", "b": [0.2115, 0.185, 0.3034, 0.2034]}, {"w": "straightforward", "b": [0.3093, 0.185, 0.4549, 0.2034]}, {"w": "utility", "b": [0.4608, 0.185, 0.5172, 0.2034]}, {"w": "function.", "b": [0.5231, 0.185, 0.6077, 0.2034]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.37. Utility function to convert a tensor into a valid image", "words": [{"w": "Listing", "b": [0.1289, 0.2204, 0.182, 0.2342]}, {"w": "5.37.", "b": [0.1865, 0.2204, 0.2219, 0.2342]}, {"w": "Utility", "b": [0.2263, 0.2204, 0.2745, 0.2342]}, {"w": "function", "b": [0.2789, 0.2204, 0.3419, 0.2342]}, {"w": "to", "b": [0.3463, 0.2204, 0.3611, 0.2342]}, {"w": "convert", "b": [0.3655, 0.2204, 0.4226, 0.2342]}, {"w": "a", "b": [0.427, 0.2204, 0.4358, 0.2342]}, {"w": "tensor", "b": [0.4403, 0.2204, 0.4875, 0.2342]}, {"w": "into", "b": [0.4919, 0.2204, 0.5214, 0.2342]}, {"w": "a", "b": [0.5259, 0.2204, 0.5347, 0.2342]}, {"w": "valid", "b": [0.5392, 0.2204, 0.5766, 0.2342]}, {"w": "image", "b": [0.581, 0.2204, 0.6262, 0.2342]}]}, {"id": "b_3", "type": "paragraph", "text": "def deprocess_image(x): x -= x.mean() 1 x /= (x.std() + 1e-5) 1 x *= 0.1 1 x += 0.5 2 x = np.clip(x, 0, 1) 2 x *= 255 3 x = np.clip(x, 0, 255).astype('uint8') 3 return x 3", "words": [{"w": "def", "b": [0.1348, 0.247, 0.1667, 0.2612]}, {"w": "deprocess_image(x):", "b": [0.1773, 0.247, 0.3792, 0.2612]}, {"w": "x", "b": [0.1773, 0.2612, 0.1879, 0.2753]}, {"w": "-=", "b": [0.1985, 0.2612, 0.2198, 0.2753]}, {"w": "x.mean()", "b": [0.2304, 0.2612, 0.3154, 0.2753]}, {"w": "1", "b": [0.6556, 0.2612, 0.6662, 0.2753]}, {"w": "x", "b": [0.1773, 0.2754, 0.1879, 0.2895]}, {"w": "/=", "b": [0.1985, 0.2754, 0.2198, 0.2895]}, {"w": "(x.std()", "b": [0.2304, 0.2754, 0.3154, 0.2895]}, {"w": "+", "b": [0.3261, 0.2754, 0.3367, 0.2895]}, {"w": "1e-5)", "b": [0.3473, 0.2754, 0.4004, 0.2895]}, {"w": "1", "b": [0.6556, 0.2754, 0.6662, 0.2895]}, {"w": "x", "b": [0.1773, 0.2895, 0.1879, 0.3037]}, {"w": "*=", "b": [0.1985, 0.2895, 0.2198, 0.3037]}, {"w": "0.1", "b": [0.2304, 0.2895, 0.2623, 0.3037]}, {"w": "1", "b": [0.6556, 0.2895, 0.6662, 0.3037]}, {"w": "x", "b": [0.1773, 0.3179, 0.1879, 0.3321]}, {"w": "+=", "b": [0.1985, 0.3179, 0.2198, 0.3321]}, {"w": "0.5", "b": [0.2304, 0.3179, 0.2623, 0.3321]}, {"w": "2", "b": [0.6556, 0.3179, 0.6662, 0.3321]}, {"w": "x", "b": [0.1773, 0.3321, 0.1879, 0.3463]}, {"w": "=", "b": [0.1985, 0.3321, 0.2092, 0.3463]}, {"w": "np.clip(x,", "b": [0.2198, 0.3321, 0.3261, 0.3463]}, {"w": "0,", "b": [0.3367, 0.3321, 0.3579, 0.3463]}, {"w": "1)", "b": [0.3686, 0.3321, 0.3898, 0.3463]}, {"w": "2", "b": [0.6556, 0.3321, 0.6662, 0.3463]}, {"w": "x", "b": [0.1773, 0.3605, 0.1879, 0.3746]}, {"w": "*=", "b": [0.1985, 0.3605, 0.2198, 0.3746]}, {"w": "255", "b": [0.2304, 0.3605, 0.2623, 0.3746]}, {"w": "3", "b": [0.6556, 0.3605, 0.6662, 0.3746]}, {"w": "x", "b": [0.1773, 0.3746, 0.1879, 0.3888]}, {"w": "=", "b": [0.1985, 0.3746, 0.2092, 0.3888]}, {"w": "np.clip(x,", "b": [0.2198, 0.3746, 0.3261, 0.3888]}, {"w": "0,", "b": [0.3367, 0.3746, 0.3579, 0.3888]}, {"w": "255).astype('uint8')", "b": [0.3686, 0.3746, 0.5811, 0.3888]}, {"w": "3", "b": [0.6556, 0.3746, 0.6662, 0.3888]}, {"w": "return", "b": [0.1773, 0.3888, 0.241, 0.403]}, {"w": "x", "b": [0.2517, 0.3888, 0.2623, 0.403]}, {"w": "3", "b": [0.6556, 0.3888, 0.6662, 0.403]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Normalizes the tensor: centers on 0, ensures that std is 0.1 2 Clips to [0, 1] 3 Converts to an RGB array", "words": [{"w": "1", "b": [0.1761, 0.4203, 0.1879, 0.4387]}, {"w": "Normalizes", "b": [0.1938, 0.4203, 0.3079, 0.4387]}, {"w": "the", "b": [0.3138, 0.4203, 0.3453, 0.4387]}, {"w": "tensor:", "b": [0.3512, 0.4203, 0.422, 0.4387]}, {"w": "centers", "b": [0.4279, 0.4203, 0.5001, 0.4387]}, {"w": "on", "b": [0.506, 0.4203, 0.5309, 0.4387]}, {"w": "0,", "b": [0.5368, 0.4203, 0.5545, 0.4387]}, {"w": "ensures", "b": [0.5604, 0.4203, 0.6361, 0.4387]}, {"w": "that", "b": [0.642, 0.4203, 0.6826, 0.4387]}, {"w": "std", "b": [0.6885, 0.4203, 0.7187, 0.4387]}, {"w": "is", "b": [0.7246, 0.4203, 0.7404, 0.4387]}, {"w": "0.1", "b": [0.7463, 0.4203, 0.7758, 0.4387]}, {"w": "2", "b": [0.1761, 0.4395, 0.1879, 0.4579]}, {"w": "Clips", "b": [0.1938, 0.4395, 0.2463, 0.4579]}, {"w": "to", "b": [0.2522, 0.4395, 0.2719, 0.4579]}, {"w": "[0,", "b": [0.2778, 0.4395, 0.3034, 0.4579]}, {"w": "1]", "b": [0.3093, 0.4395, 0.3289, 0.4579]}, {"w": "3", "b": [0.1761, 0.4586, 0.1879, 0.4771]}, {"w": "Converts", "b": [0.1938, 0.4586, 0.2856, 0.4771]}, {"w": "to", "b": [0.2915, 0.4586, 0.3112, 0.4771]}, {"w": "an", "b": [0.3171, 0.4586, 0.342, 0.4771]}, {"w": "RGB", "b": [0.348, 0.4586, 0.3991, 0.4771]}, {"w": "array", "b": [0.405, 0.4586, 0.4614, 0.4771]}]}, {"id": "b_5", "type": "paragraph", "text": "Now you have all the pieces. Let’s put them together into a Python function that takes as input a layer name and a filter index, and returns a valid image tensor representing the pattern that maximizes the activation of the specified filter.", "words": [{"w": "Now", "b": [0.1289, 0.4987, 0.1748, 0.5172]}, {"w": "you", "b": [0.1807, 0.4987, 0.2161, 0.5172]}, {"w": "have", "b": [0.222, 0.4987, 0.2666, 0.5172]}, {"w": "all", "b": [0.2725, 0.4987, 0.2961, 0.5172]}, {"w": "the", "b": [0.302, 0.4987, 0.3309, 0.5172]}, {"w": "pieces.", "b": [0.3368, 0.4987, 0.4017, 0.5172]}, {"w": "Let’s", "b": [0.4076, 0.4987, 0.4548, 0.5172]}, {"w": "put", "b": [0.4607, 0.4987, 0.4909, 0.5172]}, {"w": "them", "b": [0.4968, 0.4987, 0.544, 0.5172]}, {"w": "together", "b": [0.5499, 0.4987, 0.6273, 0.5172]}, {"w": "into", "b": [0.6332, 0.4987, 0.6699, 0.5172]}, {"w": "a", "b": [0.6758, 0.4987, 0.6863, 0.5172]}, {"w": "Python", "b": [0.6922, 0.4987, 0.7592, 0.5172]}, {"w": "function", "b": [0.7651, 0.4987, 0.8438, 0.5172]}, {"w": "that", "b": [0.1289, 0.5179, 0.1643, 0.5364]}, {"w": "takes", "b": [0.1702, 0.5179, 0.2187, 0.5364]}, {"w": "as", "b": [0.2246, 0.5179, 0.2443, 0.5364]}, {"w": "input", "b": [0.2502, 0.5179, 0.2988, 0.5364]}, {"w": "a", "b": [0.3047, 0.5179, 0.3151, 0.5364]}, {"w": "layer", "b": [0.3211, 0.5179, 0.3683, 0.5364]}, {"w": "name", "b": [0.3742, 0.5179, 0.4253, 0.5364]}, {"w": "and", "b": [0.4312, 0.5179, 0.4653, 0.5364]}, {"w": "a", "b": [0.4712, 0.5179, 0.4817, 0.5364]}, {"w": "filter", "b": [0.4876, 0.5179, 0.5335, 0.5364]}, {"w": "index,", "b": [0.5393, 0.5179, 0.5977, 0.5364]}, {"w": "and", "b": [0.6036, 0.5179, 0.6377, 0.5364]}, {"w": "returns", "b": [0.6436, 0.5179, 0.7092, 0.5364]}, {"w": "a", "b": [0.7151, 0.5179, 0.7256, 0.5364]}, {"w": "valid", "b": [0.7315, 0.5179, 0.7787, 0.5364]}, {"w": "image", "b": [0.7846, 0.5179, 0.8423, 0.5364]}, {"w": "tensor", "b": [0.1289, 0.5371, 0.1866, 0.5556]}, {"w": "representing", "b": [0.1925, 0.5371, 0.3092, 0.5556]}, {"w": "the", "b": [0.3151, 0.5371, 0.344, 0.5556]}, {"w": "pattern", "b": [0.3499, 0.5371, 0.4155, 0.5556]}, {"w": "that", "b": [0.4214, 0.5371, 0.4568, 0.5556]}, {"w": "maximizes", "b": [0.4627, 0.5371, 0.565, 0.5556]}, {"w": "the", "b": [0.5709, 0.5371, 0.5998, 0.5556]}, {"w": "activation", "b": [0.6057, 0.5371, 0.6988, 0.5556]}, {"w": "of", "b": [0.7047, 0.5371, 0.7244, 0.5556]}, {"w": "the", "b": [0.7303, 0.5371, 0.7592, 0.5556]}, {"w": "specified", "b": [0.7651, 0.5371, 0.8503, 0.5556]}, {"w": "filter.", "b": [0.1289, 0.5563, 0.1794, 0.5747]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.38. Function to generate filter visualizations", "words": [{"w": "Listing", "b": [0.1289, 0.5917, 0.182, 0.6056]}, {"w": "5.38.", "b": [0.1865, 0.5917, 0.2219, 0.6056]}, {"w": "Function", "b": [0.2263, 0.5917, 0.2942, 0.6056]}, {"w": "to", "b": [0.2986, 0.5917, 0.3134, 0.6056]}, {"w": "generate", "b": [0.3178, 0.5917, 0.3827, 0.6056]}, {"w": "filter", "b": [0.3871, 0.5917, 0.4245, 0.6056]}, {"w": "visualizations", "b": [0.4289, 0.5917, 0.5313, 0.6056]}]}, {"id": "b_7", "type": "paragraph", "text": "def generate_pattern(layer_name, filter_index, size=150): layer_output = model.get_layer(layer_name).output 1 loss = K.mean(layer_output[:, :, :, filter_index]) 1 grads = K.gradients(loss, model.input)[0] 2 grads /= (K.sqrt(K.mean(K.square(grads))) + 1e-5) 3 iterate = K.function([model.input], [loss, grads]) 4 input_img_data = np.random.random((1, size, size, 3)) * 20 + 128. 5 step = 1. 6", "words": [{"w": "def", "b": [0.1348, 0.6183, 0.1667, 0.6325]}, {"w": "generate_pattern(layer_name,", "b": [0.1773, 0.6183, 0.4748, 0.6325]}, {"w": "filter_index,", "b": [0.4855, 0.6183, 0.6236, 0.6325]}, {"w": "size=150):", "b": [0.6342, 0.6183, 0.7405, 0.6325]}, {"w": "layer_output", "b": [0.1773, 0.6325, 0.3048, 0.6467]}, {"w": "=", "b": [0.3154, 0.6325, 0.3261, 0.6467]}, {"w": "model.get_layer(layer_name).output", "b": [0.3367, 0.6325, 0.698, 0.6467]}, {"w": "1", "b": [0.1348, 0.6467, 0.1454, 0.6608]}, {"w": "loss", "b": [0.1773, 0.6608, 0.2198, 0.675]}, {"w": "=", "b": [0.2304, 0.6608, 0.241, 0.675]}, {"w": "K.mean(layer_output[:,", "b": [0.2517, 0.6608, 0.4855, 0.675]}, {"w": ":,", "b": [0.4961, 0.6608, 0.5173, 0.675]}, {"w": ":,", "b": [0.528, 0.6608, 0.5492, 0.675]}, {"w": "filter_index])", "b": [0.5598, 0.6608, 0.7086, 0.675]}, {"w": "1", "b": [0.1348, 0.675, 0.1454, 0.6892]}, {"w": "grads", "b": [0.1773, 0.7034, 0.2304, 0.7176]}, {"w": "=", "b": [0.241, 0.7034, 0.2517, 0.7176]}, {"w": "K.gradients(loss,", "b": [0.2623, 0.7034, 0.443, 0.7176]}, {"w": "model.input)[0]", "b": [0.4536, 0.7034, 0.613, 0.7176]}, {"w": "2", "b": [0.1348, 0.7176, 0.1454, 0.7318]}, {"w": "grads", "b": [0.1773, 0.746, 0.2304, 0.7601]}, {"w": "/=", "b": [0.241, 0.746, 0.2623, 0.7601]}, {"w": "(K.sqrt(K.mean(K.square(grads)))", "b": [0.2729, 0.746, 0.613, 0.7601]}, {"w": "+", "b": [0.6236, 0.746, 0.6342, 0.7601]}, {"w": "1e-5)", "b": [0.6449, 0.746, 0.698, 0.7601]}, {"w": "3", "b": [0.1348, 0.7601, 0.1454, 0.7743]}, {"w": "iterate", "b": [0.1773, 0.7885, 0.2517, 0.8027]}, {"w": "=", "b": [0.2623, 0.7885, 0.2729, 0.8027]}, {"w": "K.function([model.input],", "b": [0.2836, 0.7885, 0.5492, 0.8027]}, {"w": "[loss,", "b": [0.5598, 0.7885, 0.6236, 0.8027]}, {"w": "grads])", "b": [0.6342, 0.7885, 0.7086, 0.8027]}, {"w": "4", "b": [0.1348, 0.8027, 0.1454, 0.8169]}, {"w": "input_img_data", "b": [0.1773, 0.8311, 0.3261, 0.8452]}, {"w": "=", "b": [0.3367, 0.8311, 0.3473, 0.8452]}, {"w": "np.random.random((1,", "b": [0.3579, 0.8311, 0.5705, 0.8452]}, {"w": "size,", "b": [0.5811, 0.8311, 0.6342, 0.8452]}, {"w": "size,", "b": [0.6449, 0.8311, 0.698, 0.8452]}, {"w": "3))", "b": [0.7086, 0.8311, 0.7405, 0.8452]}, {"w": "*", "b": [0.7511, 0.8311, 0.7618, 0.8452]}, {"w": "20", "b": [0.7724, 0.8311, 0.7936, 0.8452]}, {"w": "+", "b": [0.8043, 0.8311, 0.8149, 0.8452]}, {"w": "128.", "b": [0.8255, 0.8311, 0.868, 0.8452]}, {"w": "5", "b": [0.1348, 0.8452, 0.1454, 0.8594]}, {"w": "step", "b": [0.1773, 0.8736, 0.2198, 0.8878]}, {"w": "=", "b": [0.2304, 0.8736, 0.241, 0.8878]}, {"w": "1.", "b": [0.2517, 0.8736, 0.2729, 0.8878]}, {"w": "6", "b": [0.1348, 0.8878, 0.1454, 0.902]}]}]}, {"page": 228, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "for i in range(40): 6 loss_value, grads_value = iterate([input_img_data]) 6 input_img_data += grads_value * step 6 img = input_img_data[0] return deprocess_image(img)", "words": [{"w": "for", "b": [0.1773, 0.0851, 0.2092, 0.0993]}, {"w": "i", "b": [0.2198, 0.0851, 0.2304, 0.0993]}, {"w": "in", "b": [0.241, 0.0851, 0.2623, 0.0993]}, {"w": "range(40):", "b": [0.2729, 0.0851, 0.3792, 0.0993]}, {"w": "6", "b": [0.1348, 0.0993, 0.1454, 0.1135]}, {"w": "loss_value,", "b": [0.2198, 0.1135, 0.3367, 0.1277]}, {"w": "grads_value", "b": [0.3473, 0.1135, 0.4642, 0.1277]}, {"w": "=", "b": [0.4748, 0.1135, 0.4855, 0.1277]}, {"w": "iterate([input_img_data])", "b": [0.4961, 0.1135, 0.7618, 0.1277]}, {"w": "6", "b": [0.1348, 0.1277, 0.1454, 0.1418]}, {"w": "input_img_data", "b": [0.2198, 0.1419, 0.3686, 0.156]}, {"w": "+=", "b": [0.3792, 0.1419, 0.4004, 0.156]}, {"w": "grads_value", "b": [0.4111, 0.1419, 0.528, 0.156]}, {"w": "*", "b": [0.5386, 0.1419, 0.5492, 0.156]}, {"w": "step", "b": [0.5598, 0.1419, 0.6024, 0.156]}, {"w": "6", "b": [0.1348, 0.156, 0.1454, 0.1702]}, {"w": "img", "b": [0.1773, 0.1844, 0.2092, 0.1986]}, {"w": "=", "b": [0.2198, 0.1844, 0.2304, 0.1986]}, {"w": "input_img_data[0]", "b": [0.241, 0.1844, 0.4217, 0.1986]}, {"w": "return", "b": [0.1773, 0.1986, 0.241, 0.2128]}, {"w": "deprocess_image(img)", "b": [0.2517, 0.1986, 0.4642, 0.2128]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Builds a loss function that maximizes the activation of the nth filter of the layer under consideration 2 Computes the gradient of the input picture with regard to this loss 3 Normalization trick: normalizes the gradient 4 Returns the loss and grads given the input picture 5 Starts from a gray image with some noise 6 Runs gradient ascent for 40 steps", "words": [{"w": "1", "b": [0.1761, 0.23, 0.1879, 0.2485]}, {"w": "Builds", "b": [0.1938, 0.23, 0.2581, 0.2485]}, {"w": "a", "b": [0.264, 0.23, 0.2759, 0.2485]}, {"w": "loss", "b": [0.2818, 0.23, 0.3185, 0.2485]}, {"w": "function", "b": [0.3244, 0.23, 0.4084, 0.2485]}, {"w": "that", "b": [0.4143, 0.23, 0.4549, 0.2485]}, {"w": "maximizes", "b": [0.4609, 0.23, 0.5671, 0.2485]}, {"w": "the", "b": [0.573, 0.23, 0.6045, 0.2485]}, {"w": "activation", "b": [0.6104, 0.23, 0.7101, 0.2485]}, {"w": "of", "b": [0.716, 0.23, 0.7357, 0.2485]}, {"w": "the", "b": [0.7416, 0.23, 0.773, 0.2485]}, {"w": "nth", "b": [0.7789, 0.23, 0.8131, 0.2485]}, {"w": "filter", "b": [0.819, 0.23, 0.8688, 0.2485]}, {"w": "of", "b": [0.1761, 0.2492, 0.1958, 0.2677]}, {"w": "the", "b": [0.2017, 0.2492, 0.2332, 0.2677]}, {"w": "layer", "b": [0.2391, 0.2492, 0.2902, 0.2677]}, {"w": "under", "b": [0.2961, 0.2492, 0.3565, 0.2677]}, {"w": "consideration", "b": [0.3624, 0.2492, 0.4988, 0.2677]}, {"w": "2", "b": [0.1761, 0.2684, 0.1879, 0.2869]}, {"w": "Computes", "b": [0.1938, 0.2684, 0.2961, 0.2869]}, {"w": "the", "b": [0.302, 0.2684, 0.3335, 0.2869]}, {"w": "gradient", "b": [0.3394, 0.2684, 0.4247, 0.2869]}, {"w": "of", "b": [0.4306, 0.2684, 0.4503, 0.2869]}, {"w": "the", "b": [0.4562, 0.2684, 0.4877, 0.2869]}, {"w": "input", "b": [0.4936, 0.2684, 0.5474, 0.2869]}, {"w": "picture", "b": [0.5533, 0.2684, 0.625, 0.2869]}, {"w": "with", "b": [0.6309, 0.2684, 0.6755, 0.2869]}, {"w": "regard", "b": [0.6814, 0.2684, 0.7492, 0.2869]}, {"w": "to", "b": [0.7551, 0.2684, 0.7748, 0.2869]}, {"w": "this", "b": [0.7807, 0.2684, 0.8174, 0.2869]}, {"w": "loss", "b": [0.8233, 0.2684, 0.8601, 0.2869]}, {"w": "3", "b": [0.1761, 0.2876, 0.1879, 0.3061]}, {"w": "Normalization", "b": [0.1938, 0.2876, 0.3394, 0.3061]}, {"w": "trick:", "b": [0.3453, 0.2876, 0.4017, 0.3061]}, {"w": "normalizes", "b": [0.4076, 0.2876, 0.5178, 0.3061]}, {"w": "the", "b": [0.5237, 0.2876, 0.5552, 0.3061]}, {"w": "gradient", "b": [0.5611, 0.2876, 0.6464, 0.3061]}, {"w": "4", "b": [0.1761, 0.3068, 0.1879, 0.3253]}, {"w": "Returns", "b": [0.1938, 0.3068, 0.2751, 0.3253]}, {"w": "the", "b": [0.281, 0.3068, 0.3125, 0.3253]}, {"w": "loss", "b": [0.3184, 0.3068, 0.3552, 0.3253]}, {"w": "and", "b": [0.3611, 0.3068, 0.3991, 0.3253]}, {"w": "grads", "b": [0.4051, 0.3068, 0.4615, 0.3253]}, {"w": "given", "b": [0.4674, 0.3068, 0.5212, 0.3253]}, {"w": "the", "b": [0.5271, 0.3068, 0.5585, 0.3253]}, {"w": "input", "b": [0.5645, 0.3068, 0.6183, 0.3253]}, {"w": "picture", "b": [0.6242, 0.3068, 0.6959, 0.3253]}, {"w": "5", "b": [0.1761, 0.326, 0.1879, 0.3445]}, {"w": "Starts", "b": [0.1938, 0.326, 0.2542, 0.3445]}, {"w": "from", "b": [0.2601, 0.326, 0.3095, 0.3445]}, {"w": "a", "b": [0.3154, 0.326, 0.3272, 0.3445]}, {"w": "gray", "b": [0.3331, 0.326, 0.379, 0.3445]}, {"w": "image", "b": [0.3849, 0.326, 0.4452, 0.3445]}, {"w": "with", "b": [0.4511, 0.326, 0.4957, 0.3445]}, {"w": "some", "b": [0.5016, 0.326, 0.5528, 0.3445]}, {"w": "noise", "b": [0.5587, 0.326, 0.6099, 0.3445]}, {"w": "6", "b": [0.1761, 0.3452, 0.1879, 0.3636]}, {"w": "Runs", "b": [0.1938, 0.3452, 0.2463, 0.3636]}, {"w": "gradient", "b": [0.2522, 0.3452, 0.3375, 0.3636]}, {"w": "ascent", "b": [0.3434, 0.3452, 0.4063, 0.3636]}, {"w": "for", "b": [0.4123, 0.3452, 0.4424, 0.3636]}, {"w": "40", "b": [0.4483, 0.3452, 0.4719, 0.3636]}, {"w": "steps", "b": [0.4778, 0.3452, 0.5277, 0.3636]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s try it (see figure 5.29):", "words": [{"w": "Let’s", "b": [0.1289, 0.3852, 0.1761, 0.4037]}, {"w": "try", "b": [0.182, 0.3852, 0.2082, 0.4037]}, {"w": "it", "b": [0.2141, 0.3852, 0.2273, 0.4037]}, {"w": "(see", "b": [0.2332, 0.3852, 0.2712, 0.4037]}, {"w": "figure", "b": [0.2771, 0.3852, 0.3335, 0.4037]}, {"w": "5.29):", "b": [0.3394, 0.3852, 0.3951, 0.4037]}]}, {"id": "b_3", "type": "equation", "text": ">>> plt.imshow(generate_pattern('block3_conv1', 0))", "words": [{"w": ">>>", "b": [0.1348, 0.4205, 0.1667, 0.4347]}, {"w": "plt.imshow(generate_pattern('block3_conv1',", "b": [0.1773, 0.4205, 0.6342, 0.4347]}, {"w": "0))", "b": [0.6449, 0.4205, 0.6767, 0.4347]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 5.29. Pattern that the zeroth channel in layer block3_conv1 responds to maximally", "words": [{"w": "Figure", "b": [0.1289, 0.4473, 0.1787, 0.4612]}, {"w": "5.29.", "b": [0.1832, 0.4473, 0.2186, 0.4612]}, {"w": "Pattern", "b": [0.223, 0.4473, 0.28, 0.4612]}, {"w": "that", "b": [0.2845, 0.4473, 0.315, 0.4612]}, {"w": "the", "b": [0.3194, 0.4473, 0.343, 0.4612]}, {"w": "zeroth", "b": [0.3474, 0.4473, 0.3953, 0.4612]}, {"w": "channel", "b": [0.3997, 0.4473, 0.4588, 0.4612]}, {"w": "in", "b": [0.4632, 0.4473, 0.478, 0.4612]}, {"w": "layer", "b": [0.4824, 0.4473, 0.5207, 0.4612]}, {"w": "block3_conv1", "b": [0.5252, 0.4481, 0.6527, 0.4623]}, {"w": "responds", "b": [0.6571, 0.4473, 0.7247, 0.4612]}, {"w": "to", "b": [0.7291, 0.4473, 0.7439, 0.4612]}, {"w": "maximally", "b": [0.7483, 0.4473, 0.828, 0.4612]}]}, {"id": "b_5", "type": "paragraph", "text": "It seems that filter 0 in layer block3_conv1 is responsive to a polka-dot pattern. Now the fun part: you can start visualizing every filter in every layer. For simplicity, you’ll only look at the first 64 filters in each layer, and you’ll only look at the first layer of each convolution block (block1_conv1, block2_conv1, block3_conv1, block4_conv1, block5_conv1). You’ll arrange the outputs on an 8 × 8 grid of 64 × 64 filter patterns, with some black margins between each filter pattern (see figures 5.30–5.33).", "words": [{"w": "It", "b": [0.1289, 0.7515, 0.1433, 0.77]}, {"w": "seems", "b": [0.1492, 0.7515, 0.2069, 0.77]}, {"w": "that", "b": [0.2128, 0.7515, 0.2482, 0.77]}, {"w": "filter", "b": [0.2542, 0.7515, 0.3001, 0.77]}, {"w": "0", "b": [0.306, 0.7515, 0.3178, 0.77]}, {"w": "in", "b": [0.3237, 0.7515, 0.342, 0.77]}, {"w": "layer", "b": [0.348, 0.7515, 0.3952, 0.77]}, {"w": "block3_conv1", "b": [0.401, 0.7525, 0.571, 0.7714]}, {"w": "is", "b": [0.5769, 0.7515, 0.5927, 0.77]}, {"w": "responsive", "b": [0.5986, 0.7515, 0.6996, 0.77]}, {"w": "to", "b": [0.7055, 0.7515, 0.7239, 0.77]}, {"w": "a", "b": [0.7298, 0.7515, 0.7403, 0.77]}, {"w": "polka-dot", "b": [0.7462, 0.7515, 0.8367, 0.77]}, {"w": "pattern.", "b": [0.1289, 0.7715, 0.2004, 0.79]}, {"w": "Now", "b": [0.2063, 0.7715, 0.2522, 0.79]}, {"w": "the", "b": [0.2581, 0.7715, 0.2869, 0.79]}, {"w": "fun", "b": [0.2928, 0.7715, 0.3243, 0.79]}, {"w": "part:", "b": [0.3302, 0.7715, 0.3735, 0.79]}, {"w": "you", "b": [0.3794, 0.7715, 0.4148, 0.79]}, {"w": "can", "b": [0.4207, 0.7715, 0.4535, 0.79]}, {"w": "start", "b": [0.4594, 0.7715, 0.5001, 0.79]}, {"w": "visualizing", "b": [0.506, 0.7715, 0.6096, 0.79]}, {"w": "every", "b": [0.6155, 0.7715, 0.668, 0.79]}, {"w": "filter", "b": [0.6739, 0.7715, 0.7198, 0.79]}, {"w": "in", "b": [0.7257, 0.7715, 0.7441, 0.79]}, {"w": "every", "b": [0.75, 0.7715, 0.8024, 0.79]}, {"w": "layer.", "b": [0.8083, 0.7715, 0.86, 0.79]}, {"w": "For", "b": [0.1289, 0.7907, 0.1617, 0.8092]}, {"w": "simplicity,", "b": [0.1676, 0.7907, 0.2664, 0.8092]}, {"w": "you’ll", "b": [0.2723, 0.7907, 0.3287, 0.8092]}, {"w": "only", "b": [0.3346, 0.7907, 0.3766, 0.8092]}, {"w": "look", "b": [0.3825, 0.7907, 0.4245, 0.8092]}, {"w": "at", "b": [0.4304, 0.7907, 0.4475, 0.8092]}, {"w": "the", "b": [0.4534, 0.7907, 0.4822, 0.8092]}, {"w": "first", "b": [0.4881, 0.7907, 0.5262, 0.8092]}, {"w": "64", "b": [0.5321, 0.7907, 0.5557, 0.8092]}, {"w": "filters", "b": [0.5616, 0.7907, 0.6167, 0.8092]}, {"w": "in", "b": [0.6226, 0.7907, 0.641, 0.8092]}, {"w": "each", "b": [0.6469, 0.7907, 0.6901, 0.8092]}, {"w": "layer,", "b": [0.696, 0.7907, 0.7481, 0.8092]}, {"w": "and", "b": [0.754, 0.7907, 0.7881, 0.8092]}, {"w": "you’ll", "b": [0.794, 0.7907, 0.8505, 0.8092]}, {"w": "only", "b": [0.1289, 0.8099, 0.1709, 0.8284]}, {"w": "look", "b": [0.1768, 0.8099, 0.2188, 0.8284]}, {"w": "at", "b": [0.2247, 0.8099, 0.2417, 0.8284]}, {"w": "the", "b": [0.2476, 0.8099, 0.2765, 0.8284]}, {"w": "first", "b": [0.2824, 0.8099, 0.3204, 0.8284]}, {"w": "layer", "b": [0.3263, 0.8099, 0.3735, 0.8284]}, {"w": "of", "b": [0.3794, 0.8099, 0.3991, 0.8284]}, {"w": "each", "b": [0.405, 0.8099, 0.4483, 0.8284]}, {"w": "convolution", "b": [0.4542, 0.8099, 0.567, 0.8284]}, {"w": "block", "b": [0.5729, 0.8099, 0.6254, 0.8284]}, {"w": "(block1_conv1,", "b": [0.6312, 0.8099, 0.815, 0.8298]}, {"w": "block2_conv1,", "b": [0.1289, 0.8299, 0.3048, 0.8498]}, {"w": "block3_conv1,", "b": [0.3107, 0.8299, 0.4867, 0.8498]}, {"w": "block4_conv1,", "b": [0.4926, 0.8299, 0.6685, 0.8498]}, {"w": "block5_conv1).", "b": [0.6744, 0.8299, 0.8582, 0.8498]}, {"w": "You’ll", "b": [0.1289, 0.85, 0.1882, 0.8685]}, {"w": "arrange", "b": [0.1941, 0.85, 0.2649, 0.8685]}, {"w": "the", "b": [0.2708, 0.85, 0.2996, 0.8685]}, {"w": "outputs", "b": [0.3055, 0.85, 0.3751, 0.8685]}, {"w": "on", "b": [0.381, 0.85, 0.4046, 0.8685]}, {"w": "an", "b": [0.4105, 0.85, 0.4328, 0.8685]}, {"w": "8", "b": [0.4387, 0.85, 0.4505, 0.8685]}, {"w": "×", "b": [0.4564, 0.85, 0.4697, 0.8685]}, {"w": "8", "b": [0.4756, 0.85, 0.4874, 0.8685]}, {"w": "grid", "b": [0.4933, 0.85, 0.5314, 0.8685]}, {"w": "of", "b": [0.5373, 0.85, 0.557, 0.8685]}, {"w": "64", "b": [0.5629, 0.85, 0.5865, 0.8685]}, {"w": "×", "b": [0.5924, 0.85, 0.6057, 0.8685]}, {"w": "64", "b": [0.6116, 0.85, 0.6352, 0.8685]}, {"w": "filter", "b": [0.6411, 0.85, 0.687, 0.8685]}, {"w": "patterns,", "b": [0.6929, 0.85, 0.7736, 0.8685]}, {"w": "with", "b": [0.7795, 0.85, 0.8215, 0.8685]}, {"w": "some", "b": [0.1289, 0.8692, 0.1787, 0.8876]}, {"w": "black", "b": [0.1846, 0.8692, 0.2358, 0.8876]}, {"w": "margins", "b": [0.2417, 0.8692, 0.3173, 0.8876]}, {"w": "between", "b": [0.3232, 0.8692, 0.4019, 0.8876]}, {"w": "each", "b": [0.4078, 0.8692, 0.4511, 0.8876]}, {"w": "filter", "b": [0.457, 0.8692, 0.5029, 0.8876]}, {"w": "pattern", "b": [0.5088, 0.8692, 0.5744, 0.8876]}, {"w": "(see", "b": [0.5802, 0.8692, 0.6182, 0.8876]}, {"w": "figures", "b": [0.6241, 0.8692, 0.6897, 0.8876]}, {"w": "5.30–5.33).", "b": [0.6956, 0.8692, 0.8038, 0.8876]}]}]}, {"page": 229, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Figure 5.30. Filter patterns for layer block1_conv1", "words": [{"w": "Figure", "b": [0.1289, 0.0852, 0.1787, 0.0991]}, {"w": "5.30.", "b": [0.1832, 0.0852, 0.2186, 0.0991]}, {"w": "Filter", "b": [0.223, 0.0852, 0.2653, 0.0991]}, {"w": "patterns", "b": [0.2697, 0.0852, 0.3327, 0.0991]}, {"w": "for", "b": [0.3371, 0.0852, 0.3597, 0.0991]}, {"w": "layer", "b": [0.3641, 0.0852, 0.4025, 0.0991]}, {"w": "block1_conv1", "b": [0.4069, 0.0859, 0.5344, 0.1001]}]}, {"id": "b_1", "type": "equation", "text": "Figure 5.31. Filter patterns for layer block2_conv1", "words": [{"w": "Figure", "b": [0.1289, 0.4824, 0.1787, 0.4962]}, {"w": "5.31.", "b": [0.1832, 0.4824, 0.2186, 0.4962]}, {"w": "Filter", "b": [0.223, 0.4824, 0.2653, 0.4962]}, {"w": "patterns", "b": [0.2697, 0.4824, 0.3327, 0.4962]}, {"w": "for", "b": [0.3371, 0.4824, 0.3597, 0.4962]}, {"w": "layer", "b": [0.3641, 0.4824, 0.4025, 0.4962]}, {"w": "block2_conv1", "b": [0.4069, 0.4831, 0.5344, 0.4973]}]}, {"id": "b_2", "type": "equation", "text": "Figure 5.32. Filter patterns for layer block3_conv1", "words": [{"w": "Figure", "b": [0.1289, 0.8737, 0.1787, 0.8876]}, {"w": "5.32.", "b": [0.1832, 0.8737, 0.2186, 0.8876]}, {"w": "Filter", "b": [0.223, 0.8737, 0.2653, 0.8876]}, {"w": "patterns", "b": [0.2697, 0.8737, 0.3327, 0.8876]}, {"w": "for", "b": [0.3371, 0.8737, 0.3597, 0.8876]}, {"w": "layer", "b": [0.3641, 0.8737, 0.4025, 0.8876]}, {"w": "block3_conv1", "b": [0.4069, 0.8744, 0.5344, 0.8886]}]}]}, {"page": 230, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Figure 5.33. Filter patterns for layer block4_conv1", "words": [{"w": "Figure", "b": [0.1289, 0.4306, 0.1787, 0.4445]}, {"w": "5.33.", "b": [0.1832, 0.4306, 0.2186, 0.4445]}, {"w": "Filter", "b": [0.223, 0.4306, 0.2653, 0.4445]}, {"w": "patterns", "b": [0.2697, 0.4306, 0.3327, 0.4445]}, {"w": "for", "b": [0.3371, 0.4306, 0.3597, 0.4445]}, {"w": "layer", "b": [0.3641, 0.4306, 0.4025, 0.4445]}, {"w": "block4_conv1", "b": [0.4069, 0.4314, 0.5344, 0.4456]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 5.39. Generating a grid of all filter response patterns in a layer", "words": [{"w": "Listing", "b": [0.1289, 0.7978, 0.182, 0.8116]}, {"w": "5.39.", "b": [0.1865, 0.7978, 0.2219, 0.8116]}, {"w": "Generating", "b": [0.2263, 0.7978, 0.3119, 0.8116]}, {"w": "a", "b": [0.3163, 0.7978, 0.3252, 0.8116]}, {"w": "grid", "b": [0.3296, 0.7978, 0.3611, 0.8116]}, {"w": "of", "b": [0.3655, 0.7978, 0.3803, 0.8116]}, {"w": "all", "b": [0.3847, 0.7978, 0.4034, 0.8116]}, {"w": "filter", "b": [0.4078, 0.7978, 0.4452, 0.8116]}, {"w": "response", "b": [0.4496, 0.7978, 0.5152, 0.8116]}, {"w": "patterns", "b": [0.5196, 0.7978, 0.5826, 0.8116]}, {"w": "in", "b": [0.587, 0.7978, 0.6018, 0.8116]}, {"w": "a", "b": [0.6062, 0.7978, 0.6151, 0.8116]}, {"w": "layer", "b": [0.6195, 0.7978, 0.6579, 0.8116]}]}, {"id": "b_2", "type": "paragraph", "text": "layer_name = 'block1_conv1' size = 64 margin = 5 results = np.zeros((8 * size + 7 * margin, 8 * size + 7 * margin, 3)) 1", "words": [{"w": "layer_name", "b": [0.1348, 0.8244, 0.241, 0.8386]}, {"w": "=", "b": [0.2517, 0.8244, 0.2623, 0.8386]}, {"w": "'block1_conv1'", "b": [0.2729, 0.8244, 0.4217, 0.8386]}, {"w": "size", "b": [0.1348, 0.8386, 0.1773, 0.8527]}, {"w": "=", "b": [0.1879, 0.8386, 0.1985, 0.8527]}, {"w": "64", "b": [0.2092, 0.8386, 0.2304, 0.8527]}, {"w": "margin", "b": [0.1348, 0.8527, 0.1985, 0.8669]}, {"w": "=", "b": [0.2092, 0.8527, 0.2198, 0.8669]}, {"w": "5", "b": [0.2304, 0.8527, 0.241, 0.8669]}, {"w": "results", "b": [0.1348, 0.8811, 0.2092, 0.8953]}, {"w": "=", "b": [0.2198, 0.8811, 0.2304, 0.8953]}, {"w": "np.zeros((8", "b": [0.241, 0.8811, 0.3579, 0.8953]}, {"w": "*", "b": [0.3686, 0.8811, 0.3792, 0.8953]}, {"w": "size", "b": [0.3898, 0.8811, 0.4323, 0.8953]}, {"w": "+", "b": [0.443, 0.8811, 0.4536, 0.8953]}, {"w": "7", "b": [0.4642, 0.8811, 0.4748, 0.8953]}, {"w": "*", "b": [0.4855, 0.8811, 0.4961, 0.8953]}, {"w": "margin,", "b": [0.5067, 0.8811, 0.5811, 0.8953]}, {"w": "8", "b": [0.5917, 0.8811, 0.6024, 0.8953]}, {"w": "*", "b": [0.613, 0.8811, 0.6236, 0.8953]}, {"w": "size", "b": [0.6342, 0.8811, 0.6767, 0.8953]}, {"w": "+", "b": [0.6874, 0.8811, 0.698, 0.8953]}, {"w": "7", "b": [0.7086, 0.8811, 0.7192, 0.8953]}, {"w": "*", "b": [0.7299, 0.8811, 0.7405, 0.8953]}, {"w": "margin,", "b": [0.7511, 0.8811, 0.8255, 0.8953]}, {"w": "3))", "b": [0.8361, 0.8811, 0.868, 0.8953]}, {"w": "1", "b": [0.1348, 0.8953, 0.1454, 0.9095]}]}]}, {"page": 231, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "for i in range(8): 2 for j in range(8): 3 filter_img = generate_pattern(layer_name, i + (j * 8), size=size) 4 horizontal_start = i * size + i * margin 5 horizontal_end = horizontal_start + size 5 vertical_start = j * size + j * margin 5 vertical_end = vertical_start + size 5 results[horizontal_start: horizontal_end, 5 vertical_start: vertical_end, :] = filter_img 5 plt.figure(figsize=(20, 20)) 6 plt.imshow(results) 6", "words": [{"w": "for", "b": [0.1348, 0.0993, 0.1667, 0.1135]}, {"w": "i", "b": [0.1773, 0.0993, 0.1879, 0.1135]}, {"w": "in", "b": [0.1985, 0.0993, 0.2198, 0.1135]}, {"w": "range(8):", "b": [0.2304, 0.0993, 0.3261, 0.1135]}, {"w": "2", "b": [0.1348, 0.1135, 0.1454, 0.1277]}, {"w": "for", "b": [0.1773, 0.1277, 0.2092, 0.1418]}, {"w": "j", "b": [0.2198, 0.1277, 0.2304, 0.1418]}, {"w": "in", "b": [0.241, 0.1277, 0.2623, 0.1418]}, {"w": "range(8):", "b": [0.2729, 0.1277, 0.3686, 0.1418]}, {"w": "3", "b": [0.1348, 0.1419, 0.1454, 0.156]}, {"w": "filter_img", "b": [0.2198, 0.156, 0.3261, 0.1702]}, {"w": "=", "b": [0.3367, 0.156, 0.3473, 0.1702]}, {"w": "generate_pattern(layer_name,", "b": [0.3579, 0.156, 0.6555, 0.1702]}, {"w": "i", "b": [0.6661, 0.156, 0.6767, 0.1702]}, {"w": "+", "b": [0.6874, 0.156, 0.698, 0.1702]}, {"w": "(j", "b": [0.7086, 0.156, 0.7299, 0.1702]}, {"w": "*", "b": [0.7405, 0.156, 0.7511, 0.1702]}, {"w": "8),", "b": [0.7618, 0.156, 0.7936, 0.1702]}, {"w": "size=size)", "b": [0.1348, 0.1702, 0.241, 0.1844]}, {"w": "4", "b": [0.2623, 0.1702, 0.2729, 0.1844]}, {"w": "horizontal_start", "b": [0.2198, 0.1986, 0.3898, 0.2128]}, {"w": "=", "b": [0.4004, 0.1986, 0.4111, 0.2128]}, {"w": "i", "b": [0.4217, 0.1986, 0.4323, 0.2128]}, {"w": "*", "b": [0.443, 0.1986, 0.4536, 0.2128]}, {"w": "size", "b": [0.4642, 0.1986, 0.5067, 0.2128]}, {"w": "+", "b": [0.5173, 0.1986, 0.528, 0.2128]}, {"w": "i", "b": [0.5386, 0.1986, 0.5492, 0.2128]}, {"w": "*", "b": [0.5598, 0.1986, 0.5705, 0.2128]}, {"w": "margin", "b": [0.5811, 0.1986, 0.6449, 0.2128]}, {"w": "5", "b": [0.1348, 0.2128, 0.1454, 0.227]}, {"w": "horizontal_end", "b": [0.2198, 0.227, 0.3686, 0.2411]}, {"w": "=", "b": [0.3792, 0.227, 0.3898, 0.2411]}, {"w": "horizontal_start", "b": [0.4004, 0.227, 0.5705, 0.2411]}, {"w": "+", "b": [0.5811, 0.227, 0.5917, 0.2411]}, {"w": "size", "b": [0.6024, 0.227, 0.6449, 0.2411]}, {"w": "5", "b": [0.1348, 0.2411, 0.1454, 0.2553]}, {"w": "vertical_start", "b": [0.2198, 0.2553, 0.3686, 0.2695]}, {"w": "=", "b": [0.3792, 0.2553, 0.3898, 0.2695]}, {"w": "j", "b": [0.4004, 0.2553, 0.4111, 0.2695]}, {"w": "*", "b": [0.4217, 0.2553, 0.4323, 0.2695]}, {"w": "size", "b": [0.443, 0.2553, 0.4855, 0.2695]}, {"w": "+", "b": [0.4961, 0.2553, 0.5067, 0.2695]}, {"w": "j", "b": [0.5173, 0.2553, 0.528, 0.2695]}, {"w": "*", "b": [0.5386, 0.2553, 0.5492, 0.2695]}, {"w": "margin", "b": [0.5598, 0.2553, 0.6236, 0.2695]}, {"w": "5", "b": [0.1348, 0.2695, 0.1454, 0.2837]}, {"w": "vertical_end", "b": [0.2198, 0.2837, 0.3473, 0.2979]}, {"w": "=", "b": [0.3579, 0.2837, 0.3686, 0.2979]}, {"w": "vertical_start", "b": [0.3792, 0.2837, 0.528, 0.2979]}, {"w": "+", "b": [0.5386, 0.2837, 0.5492, 0.2979]}, {"w": "size", "b": [0.5598, 0.2837, 0.6024, 0.2979]}, {"w": "5", "b": [0.1348, 0.2979, 0.1454, 0.3121]}, {"w": "results[horizontal_start:", "b": [0.2198, 0.3121, 0.4855, 0.3262]}, {"w": "horizontal_end,", "b": [0.4961, 0.3121, 0.6555, 0.3262]}, {"w": "5", "b": [0.1348, 0.3263, 0.1454, 0.3404]}, {"w": "vertical_start:", "b": [0.3048, 0.3404, 0.4642, 0.3546]}, {"w": "vertical_end,", "b": [0.4748, 0.3404, 0.613, 0.3546]}, {"w": ":]", "b": [0.6236, 0.3404, 0.6449, 0.3546]}, {"w": "=", "b": [0.6555, 0.3404, 0.6661, 0.3546]}, {"w": "filter_img", "b": [0.6767, 0.3404, 0.783, 0.3546]}, {"w": "5", "b": [0.1348, 0.3546, 0.1454, 0.3688]}, {"w": "plt.figure(figsize=(20,", "b": [0.1348, 0.383, 0.3792, 0.3972]}, {"w": "20))", "b": [0.3898, 0.383, 0.4323, 0.3972]}, {"w": "6", "b": [0.1348, 0.3972, 0.1454, 0.4114]}, {"w": "plt.imshow(results)", "b": [0.1348, 0.4114, 0.3367, 0.4255]}, {"w": "6", "b": [0.1348, 0.4255, 0.1454, 0.4397]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Empty (black) image to store results 2 Iterates over the rows of the results grid 3 Iterates over the columns of the results grid 4 Generates the pattern for filter i + (j * 8) in layer_name 5 Puts the result in the square (i, j) of the results grid 6 Displays the results grid", "words": [{"w": "1", "b": [0.1761, 0.457, 0.1879, 0.4755]}, {"w": "Empty", "b": [0.1938, 0.457, 0.262, 0.4755]}, {"w": "(black)", "b": [0.2679, 0.457, 0.3388, 0.4755]}, {"w": "image", "b": [0.3447, 0.457, 0.405, 0.4755]}, {"w": "to", "b": [0.4109, 0.457, 0.4306, 0.4755]}, {"w": "store", "b": [0.4365, 0.457, 0.4859, 0.4755]}, {"w": "results", "b": [0.4918, 0.457, 0.5583, 0.4755]}, {"w": "2", "b": [0.1761, 0.4762, 0.1879, 0.4946]}, {"w": "Iterates", "b": [0.1938, 0.4762, 0.2712, 0.4946]}, {"w": "over", "b": [0.2771, 0.4762, 0.3217, 0.4946]}, {"w": "the", "b": [0.3276, 0.4762, 0.359, 0.4946]}, {"w": "rows", "b": [0.365, 0.4762, 0.413, 0.4946]}, {"w": "of", "b": [0.4189, 0.4762, 0.4386, 0.4946]}, {"w": "the", "b": [0.4445, 0.4762, 0.476, 0.4946]}, {"w": "results", "b": [0.4819, 0.4762, 0.5484, 0.4946]}, {"w": "grid", "b": [0.5543, 0.4762, 0.5963, 0.4946]}, {"w": "3", "b": [0.1761, 0.4954, 0.1879, 0.5138]}, {"w": "Iterates", "b": [0.1938, 0.4954, 0.2712, 0.5138]}, {"w": "over", "b": [0.2771, 0.4954, 0.3217, 0.5138]}, {"w": "the", "b": [0.3276, 0.4954, 0.359, 0.5138]}, {"w": "columns", "b": [0.365, 0.4954, 0.4489, 0.5138]}, {"w": "of", "b": [0.4548, 0.4954, 0.4745, 0.5138]}, {"w": "the", "b": [0.4804, 0.4954, 0.5119, 0.5138]}, {"w": "results", "b": [0.5178, 0.4954, 0.5843, 0.5138]}, {"w": "grid", "b": [0.5902, 0.4954, 0.6321, 0.5138]}, {"w": "4", "b": [0.1761, 0.5145, 0.1879, 0.533]}, {"w": "Generates", "b": [0.1938, 0.5145, 0.2961, 0.533]}, {"w": "the", "b": [0.302, 0.5145, 0.3335, 0.533]}, {"w": "pattern", "b": [0.3394, 0.5145, 0.4142, 0.533]}, {"w": "for", "b": [0.4201, 0.5145, 0.4502, 0.533]}, {"w": "filter", "b": [0.4561, 0.5145, 0.506, 0.533]}, {"w": "i", "b": [0.5119, 0.5145, 0.5184, 0.533]}, {"w": "+", "b": [0.5243, 0.5145, 0.5378, 0.533]}, {"w": "(j", "b": [0.5437, 0.5145, 0.5594, 0.533]}, {"w": "*", "b": [0.5653, 0.5145, 0.5771, 0.533]}, {"w": "8)", "b": [0.583, 0.5145, 0.6027, 0.533]}, {"w": "in", "b": [0.6086, 0.5145, 0.6283, 0.533]}, {"w": "layer_name", "b": [0.6342, 0.5145, 0.7523, 0.533]}, {"w": "5", "b": [0.1761, 0.5337, 0.1879, 0.5522]}, {"w": "Puts", "b": [0.1938, 0.5337, 0.2384, 0.5522]}, {"w": "the", "b": [0.2443, 0.5337, 0.2758, 0.5522]}, {"w": "result", "b": [0.2817, 0.5337, 0.339, 0.5522]}, {"w": "in", "b": [0.3449, 0.5337, 0.3646, 0.5522]}, {"w": "the", "b": [0.3705, 0.5337, 0.402, 0.5522]}, {"w": "square", "b": [0.4079, 0.5337, 0.4757, 0.5522]}, {"w": "(i,", "b": [0.4816, 0.5337, 0.5019, 0.5522]}, {"w": "j)", "b": [0.5078, 0.5337, 0.5236, 0.5522]}, {"w": "of", "b": [0.5295, 0.5337, 0.5491, 0.5522]}, {"w": "the", "b": [0.555, 0.5337, 0.5865, 0.5522]}, {"w": "results", "b": [0.5924, 0.5337, 0.6589, 0.5522]}, {"w": "grid", "b": [0.6648, 0.5337, 0.7068, 0.5522]}, {"w": "6", "b": [0.1761, 0.5529, 0.1879, 0.5714]}, {"w": "Displays", "b": [0.1938, 0.5529, 0.2791, 0.5714]}, {"w": "the", "b": [0.285, 0.5529, 0.3165, 0.5714]}, {"w": "results", "b": [0.3224, 0.5529, 0.3889, 0.5714]}, {"w": "grid", "b": [0.3948, 0.5529, 0.4368, 0.5714]}]}, {"id": "b_2", "type": "paragraph", "text": "These filter visualizations tell you a lot about how convnet layers see the world: each layer in a convnet learns a collection of filters such that their inputs can be expressed as a combination of the filters. This is similar to how the Fourier transform decomposes signals onto a bank of cosine functions. The filters in these convnet filter banks get increasingly complex and refined as you go higher in the model:", "words": [{"w": "These", "b": [0.1289, 0.593, 0.1853, 0.6115]}, {"w": "filter", "b": [0.1912, 0.593, 0.2371, 0.6115]}, {"w": "visualizations", "b": [0.243, 0.593, 0.3729, 0.6115]}, {"w": "tell", "b": [0.3788, 0.593, 0.4089, 0.6115]}, {"w": "you", "b": [0.4149, 0.593, 0.4503, 0.6115]}, {"w": "a", "b": [0.4562, 0.593, 0.4667, 0.6115]}, {"w": "lot", "b": [0.4726, 0.593, 0.4975, 0.6115]}, {"w": "about", "b": [0.5034, 0.593, 0.5559, 0.6115]}, {"w": "how", "b": [0.5618, 0.593, 0.6024, 0.6115]}, {"w": "convnet", "b": [0.6084, 0.593, 0.6831, 0.6115]}, {"w": "layers", "b": [0.689, 0.593, 0.7454, 0.6115]}, {"w": "see", "b": [0.7513, 0.593, 0.7815, 0.6115]}, {"w": "the", "b": [0.7874, 0.593, 0.8162, 0.6115]}, {"w": "world:", "b": [0.1289, 0.6122, 0.1905, 0.6307]}, {"w": "each", "b": [0.1964, 0.6122, 0.2397, 0.6307]}, {"w": "layer", "b": [0.2456, 0.6122, 0.2928, 0.6307]}, {"w": "in", "b": [0.2987, 0.6122, 0.3171, 0.6307]}, {"w": "a", "b": [0.323, 0.6122, 0.3335, 0.6307]}, {"w": "convnet", "b": [0.3394, 0.6122, 0.4141, 0.6307]}, {"w": "learns", "b": [0.42, 0.6122, 0.4764, 0.6307]}, {"w": "a", "b": [0.4823, 0.6122, 0.4928, 0.6307]}, {"w": "collection", "b": [0.4987, 0.6122, 0.5919, 0.6307]}, {"w": "of", "b": [0.5977, 0.6122, 0.6174, 0.6307]}, {"w": "filters", "b": [0.6233, 0.6122, 0.6784, 0.6307]}, {"w": "such", "b": [0.6843, 0.6122, 0.7275, 0.6307]}, {"w": "that", "b": [0.7334, 0.6122, 0.7689, 0.6307]}, {"w": "their", "b": [0.7748, 0.6122, 0.8181, 0.6307]}, {"w": "inputs", "b": [0.1289, 0.6314, 0.1866, 0.6498]}, {"w": "can", "b": [0.1925, 0.6314, 0.2253, 0.6498]}, {"w": "be", "b": [0.2312, 0.6314, 0.2535, 0.6498]}, {"w": "expressed", "b": [0.2594, 0.6314, 0.3525, 0.6498]}, {"w": "as", "b": [0.3584, 0.6314, 0.3781, 0.6498]}, {"w": "a", "b": [0.384, 0.6314, 0.3945, 0.6498]}, {"w": "combination", "b": [0.4004, 0.6314, 0.5184, 0.6498]}, {"w": "of", "b": [0.5244, 0.6314, 0.544, 0.6498]}, {"w": "the", "b": [0.5499, 0.6314, 0.5788, 0.6498]}, {"w": "filters.", "b": [0.5847, 0.6314, 0.6457, 0.6498]}, {"w": "This", "b": [0.6516, 0.6314, 0.6936, 0.6498]}, {"w": "is", "b": [0.6995, 0.6314, 0.7152, 0.6498]}, {"w": "similar", "b": [0.7211, 0.6314, 0.7867, 0.6498]}, {"w": "to", "b": [0.7926, 0.6314, 0.811, 0.6498]}, {"w": "how", "b": [0.8169, 0.6314, 0.8576, 0.6498]}, {"w": "the", "b": [0.1289, 0.6505, 0.1577, 0.669]}, {"w": "Fourier", "b": [0.1636, 0.6505, 0.2332, 0.669]}, {"w": "transform", "b": [0.2391, 0.6505, 0.3309, 0.669]}, {"w": "decomposes", "b": [0.3368, 0.6505, 0.4522, 0.669]}, {"w": "signals", "b": [0.4581, 0.6505, 0.5237, 0.669]}, {"w": "onto", "b": [0.5296, 0.6505, 0.5716, 0.669]}, {"w": "a", "b": [0.5775, 0.6505, 0.588, 0.669]}, {"w": "bank", "b": [0.5939, 0.6505, 0.6398, 0.669]}, {"w": "of", "b": [0.6457, 0.6505, 0.6654, 0.669]}, {"w": "cosine", "b": [0.6713, 0.6505, 0.7316, 0.669]}, {"w": "functions.", "b": [0.7375, 0.6505, 0.8313, 0.669]}, {"w": "The", "b": [0.1289, 0.6697, 0.1656, 0.6882]}, {"w": "filters", "b": [0.1715, 0.6697, 0.2266, 0.6882]}, {"w": "in", "b": [0.2325, 0.6697, 0.2509, 0.6882]}, {"w": "these", "b": [0.2568, 0.6697, 0.3053, 0.6882]}, {"w": "convnet", "b": [0.3112, 0.6697, 0.386, 0.6882]}, {"w": "filter", "b": [0.3919, 0.6697, 0.4378, 0.6882]}, {"w": "banks", "b": [0.4437, 0.6697, 0.4988, 0.6882]}, {"w": "get", "b": [0.5047, 0.6697, 0.5335, 0.6882]}, {"w": "increasingly", "b": [0.5394, 0.6697, 0.6549, 0.6882]}, {"w": "complex", "b": [0.6608, 0.6697, 0.7421, 0.6882]}, {"w": "and", "b": [0.748, 0.6697, 0.7821, 0.6882]}, {"w": "refined", "b": [0.7879, 0.6697, 0.8548, 0.6882]}, {"w": "as", "b": [0.1289, 0.6889, 0.1485, 0.7074]}, {"w": "you", "b": [0.1545, 0.6889, 0.1899, 0.7074]}, {"w": "go", "b": [0.1958, 0.6889, 0.2194, 0.7074]}, {"w": "higher", "b": [0.2253, 0.6889, 0.2856, 0.7074]}, {"w": "in", "b": [0.2915, 0.6889, 0.3099, 0.7074]}, {"w": "the", "b": [0.3158, 0.6889, 0.3447, 0.7074]}, {"w": "model:", "b": [0.3506, 0.6889, 0.4162, 0.7074]}]}, {"id": "b_3", "type": "paragraph", "text": "The filters from the first layer in the model (block1_conv1) encode simple directional edges and colors (or colored edges, in some cases). The filters from block2_conv1 encode simple textures made from combinations of edges and colors. The filters in higher layers begin to resemble textures found in natural images: feathers, eyes, leaves, and so on.", "words": [{"w": "The", "b": [0.1761, 0.7248, 0.2128, 0.7433]}, {"w": "filters", "b": [0.2187, 0.7248, 0.2738, 0.7433]}, {"w": "from", "b": [0.2797, 0.7248, 0.3256, 0.7433]}, {"w": "the", "b": [0.3315, 0.7248, 0.3604, 0.7433]}, {"w": "first", "b": [0.3663, 0.7248, 0.4043, 0.7433]}, {"w": "layer", "b": [0.4102, 0.7248, 0.4575, 0.7433]}, {"w": "in", "b": [0.4634, 0.7248, 0.4817, 0.7433]}, {"w": "the", "b": [0.4876, 0.7248, 0.5165, 0.7433]}, {"w": "model", "b": [0.5224, 0.7248, 0.5814, 0.7433]}, {"w": "(block1_conv1)", "b": [0.5873, 0.7248, 0.773, 0.7447]}, {"w": "encode", "b": [0.7789, 0.7248, 0.8458, 0.7433]}, {"w": "simple", "b": [0.1761, 0.7448, 0.2391, 0.7633]}, {"w": "directional", "b": [0.245, 0.7448, 0.346, 0.7633]}, {"w": "edges", "b": [0.3519, 0.7448, 0.4057, 0.7633]}, {"w": "and", "b": [0.4116, 0.7448, 0.4457, 0.7633]}, {"w": "colors", "b": [0.4516, 0.7448, 0.5093, 0.7633]}, {"w": "(or", "b": [0.5152, 0.7448, 0.5427, 0.7633]}, {"w": "colored", "b": [0.5486, 0.7448, 0.6194, 0.7633]}, {"w": "edges,", "b": [0.6254, 0.7448, 0.685, 0.7633]}, {"w": "in", "b": [0.6909, 0.7448, 0.7093, 0.7633]}, {"w": "some", "b": [0.7152, 0.7448, 0.7651, 0.7633]}, {"w": "cases).", "b": [0.771, 0.7448, 0.8346, 0.7633]}, {"w": "The", "b": [0.1761, 0.764, 0.2128, 0.7825]}, {"w": "filters", "b": [0.2187, 0.764, 0.2738, 0.7825]}, {"w": "from", "b": [0.2797, 0.764, 0.3256, 0.7825]}, {"w": "block2_conv1", "b": [0.3315, 0.765, 0.5015, 0.7839]}, {"w": "encode", "b": [0.5075, 0.764, 0.5743, 0.7825]}, {"w": "simple", "b": [0.5802, 0.764, 0.6432, 0.7825]}, {"w": "textures", "b": [0.6491, 0.764, 0.7239, 0.7825]}, {"w": "made", "b": [0.7298, 0.764, 0.7809, 0.7825]}, {"w": "from", "b": [0.7868, 0.764, 0.8327, 0.7825]}, {"w": "combinations", "b": [0.1761, 0.7841, 0.3034, 0.8025]}, {"w": "of", "b": [0.3093, 0.7841, 0.3289, 0.8025]}, {"w": "edges", "b": [0.3348, 0.7841, 0.3886, 0.8025]}, {"w": "and", "b": [0.3945, 0.7841, 0.4286, 0.8025]}, {"w": "colors.", "b": [0.4345, 0.7841, 0.4981, 0.8025]}, {"w": "The", "b": [0.1761, 0.8032, 0.2128, 0.8217]}, {"w": "filters", "b": [0.2187, 0.8032, 0.2738, 0.8217]}, {"w": "in", "b": [0.2797, 0.8032, 0.2981, 0.8217]}, {"w": "higher", "b": [0.304, 0.8032, 0.3643, 0.8217]}, {"w": "layers", "b": [0.3702, 0.8032, 0.4266, 0.8217]}, {"w": "begin", "b": [0.4325, 0.8032, 0.485, 0.8217]}, {"w": "to", "b": [0.4909, 0.8032, 0.5093, 0.8217]}, {"w": "resemble", "b": [0.5152, 0.8032, 0.6004, 0.8217]}, {"w": "textures", "b": [0.6063, 0.8032, 0.6811, 0.8217]}, {"w": "found", "b": [0.687, 0.8032, 0.7421, 0.8217]}, {"w": "in", "b": [0.748, 0.8032, 0.7664, 0.8217]}, {"w": "natural", "b": [0.7723, 0.8032, 0.8379, 0.8217]}, {"w": "images:", "b": [0.1761, 0.8224, 0.2496, 0.8409]}, {"w": "feathers,", "b": [0.2555, 0.8224, 0.3361, 0.8409]}, {"w": "eyes,", "b": [0.342, 0.8224, 0.3899, 0.8409]}, {"w": "leaves,", "b": [0.3958, 0.8224, 0.4607, 0.8409]}, {"w": "and", "b": [0.4666, 0.8224, 0.5007, 0.8409]}, {"w": "so", "b": [0.5066, 0.8224, 0.5276, 0.8409]}, {"w": "on.", "b": [0.5335, 0.8224, 0.563, 0.8409]}]}, {"id": "b_4", "type": "paragraph", "text": "5.4.3. Visualizing heatmaps of class activation", "words": [{"w": "5.4.3.", "b": [0.1289, 0.8667, 0.182, 0.8851]}, {"w": "Visualizing", "b": [0.1879, 0.8667, 0.2999, 0.8851]}, {"w": "heatmaps", "b": [0.3058, 0.8667, 0.4029, 0.8851]}, {"w": "of", "b": [0.4088, 0.8667, 0.4285, 0.8851]}, {"w": "class", "b": [0.4344, 0.8667, 0.4816, 0.8851]}, {"w": "activation", "b": [0.4875, 0.8667, 0.5872, 0.8851]}]}]}, {"page": 232, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "I’ll introduce one more visualization technique: one that is useful for understanding which parts of a given image led a convnet to its final classification decision. This is helpful for debugging the decision process of a convnet, particularly in the case of a classification mistake. It also allows you to locate specific objects in an image.", "words": [{"w": "I’ll", "b": [0.1289, 0.0857, 0.1577, 0.1041]}, {"w": "introduce", "b": [0.1636, 0.0857, 0.2528, 0.1041]}, {"w": "one", "b": [0.2587, 0.0857, 0.2928, 0.1041]}, {"w": "more", "b": [0.2987, 0.0857, 0.3473, 0.1041]}, {"w": "visualization", "b": [0.3532, 0.0857, 0.4739, 0.1041]}, {"w": "technique:", "b": [0.4798, 0.0857, 0.5781, 0.1041]}, {"w": "one", "b": [0.5841, 0.0857, 0.6182, 0.1041]}, {"w": "that", "b": [0.6241, 0.0857, 0.6595, 0.1041]}, {"w": "is", "b": [0.6654, 0.0857, 0.6811, 0.1041]}, {"w": "useful", "b": [0.687, 0.0857, 0.7447, 0.1041]}, {"w": "for", "b": [0.7507, 0.0857, 0.7782, 0.1041]}, {"w": "understanding", "b": [0.1289, 0.1049, 0.2627, 0.1233]}, {"w": "which", "b": [0.2686, 0.1049, 0.3263, 0.1233]}, {"w": "parts", "b": [0.3322, 0.1049, 0.3781, 0.1233]}, {"w": "of", "b": [0.384, 0.1049, 0.4037, 0.1233]}, {"w": "a", "b": [0.4096, 0.1049, 0.4201, 0.1233]}, {"w": "given", "b": [0.426, 0.1049, 0.4784, 0.1233]}, {"w": "image", "b": [0.4843, 0.1049, 0.5421, 0.1233]}, {"w": "led", "b": [0.548, 0.1049, 0.5768, 0.1233]}, {"w": "a", "b": [0.5827, 0.1049, 0.5932, 0.1233]}, {"w": "convnet", "b": [0.5991, 0.1049, 0.6739, 0.1233]}, {"w": "to", "b": [0.6797, 0.1049, 0.6981, 0.1233]}, {"w": "its", "b": [0.704, 0.1049, 0.7263, 0.1233]}, {"w": "final", "b": [0.7322, 0.1049, 0.7755, 0.1233]}, {"w": "classification", "b": [0.1289, 0.1241, 0.2535, 0.1425]}, {"w": "decision.", "b": [0.2594, 0.1241, 0.344, 0.1425]}, {"w": "This", "b": [0.3499, 0.1241, 0.3919, 0.1425]}, {"w": "is", "b": [0.3978, 0.1241, 0.4136, 0.1425]}, {"w": "helpful", "b": [0.4195, 0.1241, 0.4864, 0.1425]}, {"w": "for", "b": [0.4923, 0.1241, 0.5198, 0.1425]}, {"w": "debugging", "b": [0.5257, 0.1241, 0.6254, 0.1425]}, {"w": "the", "b": [0.6313, 0.1241, 0.6602, 0.1425]}, {"w": "decision", "b": [0.6661, 0.1241, 0.7448, 0.1425]}, {"w": "process", "b": [0.7507, 0.1241, 0.8215, 0.1425]}, {"w": "of", "b": [0.8274, 0.1241, 0.8471, 0.1425]}, {"w": "a", "b": [0.853, 0.1241, 0.8635, 0.1425]}, {"w": "convnet,", "b": [0.1289, 0.1432, 0.2095, 0.1617]}, {"w": "particularly", "b": [0.2154, 0.1432, 0.3243, 0.1617]}, {"w": "in", "b": [0.3302, 0.1432, 0.3486, 0.1617]}, {"w": "the", "b": [0.3545, 0.1432, 0.3833, 0.1617]}, {"w": "case", "b": [0.3892, 0.1432, 0.4298, 0.1617]}, {"w": "of", "b": [0.4357, 0.1432, 0.4554, 0.1617]}, {"w": "a", "b": [0.4613, 0.1432, 0.4718, 0.1617]}, {"w": "classification", "b": [0.4777, 0.1432, 0.6023, 0.1617]}, {"w": "mistake.", "b": [0.6082, 0.1432, 0.6876, 0.1617]}, {"w": "It", "b": [0.6935, 0.1432, 0.7079, 0.1617]}, {"w": "also", "b": [0.7138, 0.1432, 0.7519, 0.1617]}, {"w": "allows", "b": [0.7578, 0.1432, 0.8194, 0.1617]}, {"w": "you", "b": [0.8253, 0.1432, 0.8608, 0.1617]}, {"w": "to", "b": [0.1289, 0.1624, 0.1472, 0.1809]}, {"w": "locate", "b": [0.1532, 0.1624, 0.2095, 0.1809]}, {"w": "specific", "b": [0.2154, 0.1624, 0.2889, 0.1809]}, {"w": "objects", "b": [0.2948, 0.1624, 0.3617, 0.1809]}, {"w": "in", "b": [0.3676, 0.1624, 0.386, 0.1809]}, {"w": "an", "b": [0.3919, 0.1624, 0.4142, 0.1809]}, {"w": "image.", "b": [0.4201, 0.1624, 0.4837, 0.1809]}]}, {"id": "b_1", "type": "paragraph", "text": "This general category of techniques is called class activation map (CAM) visualization, and it consists of producing heatmaps of class activation over input images. A class activation heatmap is a 2D grid of scores associated with a specific output class, computed for every location in any input image, indicating how important each location is with respect to the class under consideration. For instance, given an image fed into a dogs-versus-cats convnet, CAM visualization allows you to generate a heatmap for the class “cat,” indicating how cat-like different parts of the image are, and also a heatmap for the class “dog,” indicating how dog-like parts of the image are.", "words": [{"w": "This", "b": [0.1289, 0.2025, 0.1709, 0.221]}, {"w": "general", "b": [0.1768, 0.2025, 0.2463, 0.221]}, {"w": "category", "b": [0.2522, 0.2025, 0.3335, 0.221]}, {"w": "of", "b": [0.3394, 0.2025, 0.359, 0.221]}, {"w": "techniques", "b": [0.365, 0.2025, 0.466, 0.221]}, {"w": "is", "b": [0.4719, 0.2025, 0.4876, 0.221]}, {"w": "called", "b": [0.4935, 0.2025, 0.5499, 0.221]}, {"w": "class", "b": [0.5557, 0.2025, 0.603, 0.221]}, {"w": "activation", "b": [0.6089, 0.2025, 0.7033, 0.221]}, {"w": "map", "b": [0.7092, 0.2025, 0.7499, 0.221]}, {"w": "(CAM)", "b": [0.7558, 0.2025, 0.8253, 0.221]}, {"w": "visualization,", "b": [0.1289, 0.2217, 0.2555, 0.2402]}, {"w": "and", "b": [0.2614, 0.2217, 0.2955, 0.2402]}, {"w": "it", "b": [0.3014, 0.2217, 0.3145, 0.2402]}, {"w": "consists", "b": [0.3204, 0.2217, 0.3952, 0.2402]}, {"w": "of", "b": [0.4011, 0.2217, 0.4208, 0.2402]}, {"w": "producing", "b": [0.4267, 0.2217, 0.5224, 0.2402]}, {"w": "heatmaps", "b": [0.5283, 0.2217, 0.6175, 0.2402]}, {"w": "of", "b": [0.6234, 0.2217, 0.6431, 0.2402]}, {"w": "class", "b": [0.649, 0.2217, 0.6949, 0.2402]}, {"w": "activation", "b": [0.7008, 0.2217, 0.794, 0.2402]}, {"w": "over", "b": [0.7999, 0.2217, 0.8418, 0.2402]}, {"w": "input", "b": [0.1289, 0.2409, 0.1774, 0.2593]}, {"w": "images.", "b": [0.1833, 0.2409, 0.2561, 0.2593]}, {"w": "A", "b": [0.262, 0.2409, 0.2791, 0.2593]}, {"w": "class", "b": [0.285, 0.2409, 0.3309, 0.2593]}, {"w": "activation", "b": [0.3368, 0.2409, 0.4299, 0.2593]}, {"w": "heatmap", "b": [0.4358, 0.2409, 0.5159, 0.2593]}, {"w": "is", "b": [0.5217, 0.2409, 0.5374, 0.2593]}, {"w": "a", "b": [0.5433, 0.2409, 0.5538, 0.2593]}, {"w": "2D", "b": [0.5597, 0.2409, 0.5886, 0.2593]}, {"w": "grid", "b": [0.5945, 0.2409, 0.6325, 0.2593]}, {"w": "of", "b": [0.6384, 0.2409, 0.6581, 0.2593]}, {"w": "scores", "b": [0.664, 0.2409, 0.723, 0.2593]}, {"w": "associated", "b": [0.7289, 0.2409, 0.826, 0.2593]}, {"w": "with", "b": [0.1289, 0.2601, 0.1709, 0.2785]}, {"w": "a", "b": [0.1768, 0.2601, 0.1873, 0.2785]}, {"w": "specific", "b": [0.1932, 0.2601, 0.2666, 0.2785]}, {"w": "output", "b": [0.2725, 0.2601, 0.3329, 0.2785]}, {"w": "class,", "b": [0.3388, 0.2601, 0.3906, 0.2785]}, {"w": "computed", "b": [0.3965, 0.2601, 0.4896, 0.2785]}, {"w": "for", "b": [0.4955, 0.2601, 0.5231, 0.2785]}, {"w": "every", "b": [0.529, 0.2601, 0.5814, 0.2785]}, {"w": "location", "b": [0.5873, 0.2601, 0.6634, 0.2785]}, {"w": "in", "b": [0.6693, 0.2601, 0.6877, 0.2785]}, {"w": "any", "b": [0.6936, 0.2601, 0.7277, 0.2785]}, {"w": "input", "b": [0.7336, 0.2601, 0.7821, 0.2785]}, {"w": "image,", "b": [0.788, 0.2601, 0.8517, 0.2785]}, {"w": "indicating", "b": [0.1289, 0.2792, 0.2233, 0.2977]}, {"w": "how", "b": [0.2292, 0.2792, 0.2699, 0.2977]}, {"w": "important", "b": [0.2758, 0.2792, 0.3676, 0.2977]}, {"w": "each", "b": [0.3735, 0.2792, 0.4168, 0.2977]}, {"w": "location", "b": [0.4227, 0.2792, 0.4988, 0.2977]}, {"w": "is", "b": [0.5047, 0.2792, 0.5204, 0.2977]}, {"w": "with", "b": [0.5263, 0.2792, 0.5683, 0.2977]}, {"w": "respect", "b": [0.5742, 0.2792, 0.6411, 0.2977]}, {"w": "to", "b": [0.647, 0.2792, 0.6654, 0.2977]}, {"w": "the", "b": [0.6713, 0.2792, 0.7001, 0.2977]}, {"w": "class", "b": [0.706, 0.2792, 0.7519, 0.2977]}, {"w": "under", "b": [0.7578, 0.2792, 0.8116, 0.2977]}, {"w": "consideration.", "b": [0.1289, 0.2984, 0.262, 0.3169]}, {"w": "For", "b": [0.2679, 0.2984, 0.3007, 0.3169]}, {"w": "instance,", "b": [0.3066, 0.2984, 0.3899, 0.3169]}, {"w": "given", "b": [0.3958, 0.2984, 0.4483, 0.3169]}, {"w": "an", "b": [0.4542, 0.2984, 0.4765, 0.3169]}, {"w": "image", "b": [0.4824, 0.2984, 0.5401, 0.3169]}, {"w": "fed", "b": [0.546, 0.2984, 0.5762, 0.3169]}, {"w": "into", "b": [0.5821, 0.2984, 0.6188, 0.3169]}, {"w": "a", "b": [0.6247, 0.2984, 0.6352, 0.3169]}, {"w": "dogs-versus-cats", "b": [0.6411, 0.2984, 0.7985, 0.3169]}, {"w": "convnet,", "b": [0.1289, 0.3176, 0.2095, 0.3361]}, {"w": "CAM", "b": [0.2154, 0.3176, 0.2692, 0.3361]}, {"w": "visualization", "b": [0.2751, 0.3176, 0.3958, 0.3361]}, {"w": "allows", "b": [0.4017, 0.3176, 0.4634, 0.3361]}, {"w": "you", "b": [0.4693, 0.3176, 0.5047, 0.3361]}, {"w": "to", "b": [0.5106, 0.3176, 0.529, 0.3361]}, {"w": "generate", "b": [0.5349, 0.3176, 0.6149, 0.3361]}, {"w": "a", "b": [0.6208, 0.3176, 0.6313, 0.3361]}, {"w": "heatmap", "b": [0.6372, 0.3176, 0.7172, 0.3361]}, {"w": "for", "b": [0.7231, 0.3176, 0.7506, 0.3361]}, {"w": "the", "b": [0.7565, 0.3176, 0.7854, 0.3361]}, {"w": "class", "b": [0.7913, 0.3176, 0.8372, 0.3361]}, {"w": "“cat,”", "b": [0.1289, 0.3368, 0.1833, 0.3553]}, {"w": "indicating", "b": [0.1892, 0.3368, 0.2836, 0.3553]}, {"w": "how", "b": [0.2896, 0.3368, 0.3302, 0.3553]}, {"w": "cat-like", "b": [0.3361, 0.3368, 0.4069, 0.3553]}, {"w": "different", "b": [0.4128, 0.3368, 0.4937, 0.3553]}, {"w": "parts", "b": [0.4996, 0.3368, 0.5455, 0.3553]}, {"w": "of", "b": [0.5514, 0.3368, 0.571, 0.3553]}, {"w": "the", "b": [0.5769, 0.3368, 0.6058, 0.3553]}, {"w": "image", "b": [0.6117, 0.3368, 0.6694, 0.3553]}, {"w": "are,", "b": [0.6753, 0.3368, 0.71, 0.3553]}, {"w": "and", "b": [0.7159, 0.3368, 0.75, 0.3553]}, {"w": "also", "b": [0.756, 0.3368, 0.794, 0.3553]}, {"w": "a", "b": [0.7999, 0.3368, 0.8104, 0.3553]}, {"w": "heatmap", "b": [0.1289, 0.356, 0.2089, 0.3745]}, {"w": "for", "b": [0.2148, 0.356, 0.2423, 0.3745]}, {"w": "the", "b": [0.2482, 0.356, 0.2771, 0.3745]}, {"w": "class", "b": [0.283, 0.356, 0.3289, 0.3745]}, {"w": "“dog,”", "b": [0.3348, 0.356, 0.3971, 0.3745]}, {"w": "indicating", "b": [0.403, 0.356, 0.4975, 0.3745]}, {"w": "how", "b": [0.5034, 0.356, 0.544, 0.3745]}, {"w": "dog-like", "b": [0.5499, 0.356, 0.6286, 0.3745]}, {"w": "parts", "b": [0.6345, 0.356, 0.6804, 0.3745]}, {"w": "of", "b": [0.6863, 0.356, 0.706, 0.3745]}, {"w": "the", "b": [0.7119, 0.356, 0.7408, 0.3745]}, {"w": "image", "b": [0.7467, 0.356, 0.8044, 0.3745]}, {"w": "are.", "b": [0.8103, 0.356, 0.845, 0.3745]}]}, {"id": "b_2", "type": "paragraph", "text": "The specific implementation you’ll use is the one described in “Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization.”[2] It’s very simple: it consists of taking the output feature map of a convolution layer, given an input image, and weighing every channel in that feature map by the gradient of the class with respect to the channel. Intuitively, one way to understand this trick is that you’re weighting a spatial map of “how intensely the input image activates different channels” by “how important each channel is with regard to the class,” resulting in a spatial map of “how intensely the input image activates the class.”", "words": [{"w": "The", "b": [0.1289, 0.3961, 0.1656, 0.4145]}, {"w": "specific", "b": [0.1715, 0.3961, 0.2449, 0.4145]}, {"w": "implementation", "b": [0.2508, 0.3961, 0.3991, 0.4145]}, {"w": "you’ll", "b": [0.405, 0.3961, 0.4614, 0.4145]}, {"w": "use", "b": [0.4673, 0.3961, 0.4988, 0.4145]}, {"w": "is", "b": [0.5047, 0.3961, 0.5205, 0.4145]}, {"w": "the", "b": [0.5264, 0.3961, 0.5552, 0.4145]}, {"w": "one", "b": [0.5611, 0.3961, 0.5952, 0.4145]}, {"w": "described", "b": [0.6011, 0.3961, 0.6916, 0.4145]}, {"w": "in", "b": [0.6975, 0.3961, 0.7159, 0.4145]}, {"w": "“Grad-CAM:", "b": [0.7218, 0.3961, 0.8477, 0.4145]}, {"w": "Visual", "b": [0.1289, 0.4169, 0.1891, 0.4354]}, {"w": "Explanations", "b": [0.195, 0.4169, 0.3183, 0.4354]}, {"w": "from", "b": [0.3242, 0.4169, 0.3702, 0.4354]}, {"w": "Deep", "b": [0.3761, 0.4169, 0.4259, 0.4354]}, {"w": "Networks", "b": [0.4318, 0.4169, 0.5236, 0.4354]}, {"w": "via", "b": [0.5295, 0.4169, 0.5584, 0.4354]}, {"w": "Gradient-based", "b": [0.5643, 0.4169, 0.7085, 0.4354]}, {"w": "Localization.”[2]", "b": [0.7144, 0.4148, 0.8694, 0.4354]}, {"w": "It’s", "b": [0.1289, 0.4361, 0.159, 0.4546]}, {"w": "very", "b": [0.165, 0.4361, 0.2069, 0.4546]}, {"w": "simple:", "b": [0.2128, 0.4361, 0.2824, 0.4546]}, {"w": "it", "b": [0.2883, 0.4361, 0.3014, 0.4546]}, {"w": "consists", "b": [0.3073, 0.4361, 0.3821, 0.4546]}, {"w": "of", "b": [0.388, 0.4361, 0.4077, 0.4546]}, {"w": "taking", "b": [0.4136, 0.4361, 0.4726, 0.4546]}, {"w": "the", "b": [0.4785, 0.4361, 0.5074, 0.4546]}, {"w": "output", "b": [0.5133, 0.4361, 0.5736, 0.4546]}, {"w": "feature", "b": [0.5795, 0.4361, 0.6451, 0.4546]}, {"w": "map", "b": [0.651, 0.4361, 0.6917, 0.4546]}, {"w": "of", "b": [0.6976, 0.4361, 0.7172, 0.4546]}, {"w": "a", "b": [0.7231, 0.4361, 0.7336, 0.4546]}, {"w": "convolution", "b": [0.7395, 0.4361, 0.8524, 0.4546]}, {"w": "layer,", "b": [0.1289, 0.4553, 0.181, 0.4738]}, {"w": "given", "b": [0.1869, 0.4553, 0.2394, 0.4738]}, {"w": "an", "b": [0.2453, 0.4553, 0.2676, 0.4738]}, {"w": "input", "b": [0.2735, 0.4553, 0.3221, 0.4738]}, {"w": "image,", "b": [0.328, 0.4553, 0.3916, 0.4738]}, {"w": "and", "b": [0.3975, 0.4553, 0.4316, 0.4738]}, {"w": "weighing", "b": [0.4375, 0.4553, 0.5254, 0.4738]}, {"w": "every", "b": [0.5312, 0.4553, 0.5837, 0.4738]}, {"w": "channel", "b": [0.5896, 0.4553, 0.663, 0.4738]}, {"w": "in", "b": [0.6689, 0.4553, 0.6873, 0.4738]}, {"w": "that", "b": [0.6932, 0.4553, 0.7286, 0.4738]}, {"w": "feature", "b": [0.7345, 0.4553, 0.8001, 0.4738]}, {"w": "map", "b": [0.806, 0.4553, 0.8467, 0.4738]}, {"w": "by", "b": [0.1289, 0.4745, 0.1525, 0.493]}, {"w": "the", "b": [0.1584, 0.4745, 0.1873, 0.493]}, {"w": "gradient", "b": [0.1932, 0.4745, 0.2705, 0.493]}, {"w": "of", "b": [0.2764, 0.4745, 0.2961, 0.493]}, {"w": "the", "b": [0.302, 0.4745, 0.3309, 0.493]}, {"w": "class", "b": [0.3368, 0.4745, 0.3827, 0.493]}, {"w": "with", "b": [0.3886, 0.4745, 0.4306, 0.493]}, {"w": "respect", "b": [0.4365, 0.4745, 0.5034, 0.493]}, {"w": "to", "b": [0.5093, 0.4745, 0.5276, 0.493]}, {"w": "the", "b": [0.5335, 0.4745, 0.5624, 0.493]}, {"w": "channel.", "b": [0.5683, 0.4745, 0.6476, 0.493]}, {"w": "Intuitively,", "b": [0.6535, 0.4745, 0.7562, 0.493]}, {"w": "one", "b": [0.7621, 0.4745, 0.7962, 0.493]}, {"w": "way", "b": [0.8021, 0.4745, 0.8415, 0.493]}, {"w": "to", "b": [0.8474, 0.4745, 0.8657, 0.493]}, {"w": "understand", "b": [0.1289, 0.4937, 0.2325, 0.5122]}, {"w": "this", "b": [0.2384, 0.4937, 0.2725, 0.5122]}, {"w": "trick", "b": [0.2784, 0.4937, 0.3217, 0.5122]}, {"w": "is", "b": [0.3276, 0.4937, 0.3434, 0.5122]}, {"w": "that", "b": [0.3493, 0.4937, 0.3847, 0.5122]}, {"w": "you’re", "b": [0.3906, 0.4937, 0.4522, 0.5122]}, {"w": "weighting", "b": [0.4581, 0.4937, 0.5526, 0.5122]}, {"w": "a", "b": [0.5585, 0.4937, 0.569, 0.5122]}, {"w": "spatial", "b": [0.5749, 0.4937, 0.6365, 0.5122]}, {"w": "map", "b": [0.6424, 0.4937, 0.6831, 0.5122]}, {"w": "of", "b": [0.689, 0.4937, 0.7087, 0.5122]}, {"w": "“how", "b": [0.7146, 0.4937, 0.7657, 0.5122]}, {"w": "intensely", "b": [0.7716, 0.4937, 0.8569, 0.5122]}, {"w": "the", "b": [0.1289, 0.5129, 0.1577, 0.5314]}, {"w": "input", "b": [0.1636, 0.5129, 0.2122, 0.5314]}, {"w": "image", "b": [0.2181, 0.5129, 0.2758, 0.5314]}, {"w": "activates", "b": [0.2817, 0.5129, 0.3643, 0.5314]}, {"w": "different", "b": [0.3702, 0.5129, 0.4511, 0.5314]}, {"w": "channels”", "b": [0.457, 0.5129, 0.5501, 0.5314]}, {"w": "by", "b": [0.556, 0.5129, 0.5796, 0.5314]}, {"w": "“how", "b": [0.5855, 0.5129, 0.6367, 0.5314]}, {"w": "important", "b": [0.6425, 0.5129, 0.7344, 0.5314]}, {"w": "each", "b": [0.7403, 0.5129, 0.7835, 0.5314]}, {"w": "channel", "b": [0.7894, 0.5129, 0.8629, 0.5314]}, {"w": "is", "b": [0.1289, 0.5321, 0.1446, 0.5505]}, {"w": "with", "b": [0.1505, 0.5321, 0.1925, 0.5505]}, {"w": "regard", "b": [0.1984, 0.5321, 0.2587, 0.5505]}, {"w": "to", "b": [0.2646, 0.5321, 0.283, 0.5505]}, {"w": "the", "b": [0.2889, 0.5321, 0.3178, 0.5505]}, {"w": "class,”", "b": [0.3237, 0.5321, 0.386, 0.5505]}, {"w": "resulting", "b": [0.3919, 0.5321, 0.4745, 0.5505]}, {"w": "in", "b": [0.4804, 0.5321, 0.4988, 0.5505]}, {"w": "a", "b": [0.5047, 0.5321, 0.5152, 0.5505]}, {"w": "spatial", "b": [0.5211, 0.5321, 0.5828, 0.5505]}, {"w": "map", "b": [0.5887, 0.5321, 0.6293, 0.5505]}, {"w": "of", "b": [0.6352, 0.5321, 0.6549, 0.5505]}, {"w": "“how", "b": [0.6608, 0.5321, 0.7119, 0.5505]}, {"w": "intensely", "b": [0.7179, 0.5321, 0.8031, 0.5505]}, {"w": "the", "b": [0.809, 0.5321, 0.8379, 0.5505]}, {"w": "input", "b": [0.1289, 0.5513, 0.1774, 0.5697]}, {"w": "image", "b": [0.1833, 0.5513, 0.241, 0.5697]}, {"w": "activates", "b": [0.2469, 0.5513, 0.3296, 0.5697]}, {"w": "the", "b": [0.3354, 0.5513, 0.3643, 0.5697]}, {"w": "class.”", "b": [0.3702, 0.5513, 0.4325, 0.5697]}]}, {"id": "b_4", "type": "paragraph", "text": "Ramprasaath R. Selvaraju et al., arXiv (2017), https://arxiv.org/abs/1610.02391.", "words": [{"w": "Ramprasaath", "b": [0.1466, 0.6126, 0.2391, 0.6264]}, {"w": "R.", "b": [0.2435, 0.6126, 0.2597, 0.6264]}, {"w": "Selvaraju", "b": [0.2642, 0.6126, 0.331, 0.6264]}, {"w": "et", "b": [0.3355, 0.6126, 0.3483, 0.6264]}, {"w": "al.,", "b": [0.3527, 0.6126, 0.3743, 0.6264]}, {"w": "arXiv", "b": [0.3788, 0.6126, 0.4191, 0.6264]}, {"w": "(2017),", "b": [0.4235, 0.6126, 0.4752, 0.6264]}, {"w": "https://arxiv.org/abs/1610.02391.", "b": [0.4795, 0.6126, 0.7137, 0.6264]}]}, {"id": "b_5", "type": "paragraph", "text": "We’ll demonstrate this technique using the pretrained VGG16 network again.", "words": [{"w": "We’ll", "b": [0.1289, 0.648, 0.1808, 0.6665]}, {"w": "demonstrate", "b": [0.1867, 0.648, 0.3021, 0.6665]}, {"w": "this", "b": [0.308, 0.648, 0.3421, 0.6665]}, {"w": "technique", "b": [0.348, 0.648, 0.4398, 0.6665]}, {"w": "using", "b": [0.4457, 0.648, 0.4969, 0.6665]}, {"w": "the", "b": [0.5028, 0.648, 0.5317, 0.6665]}, {"w": "pretrained", "b": [0.5376, 0.648, 0.6333, 0.6665]}, {"w": "VGG16", "b": [0.6392, 0.648, 0.714, 0.6665]}, {"w": "network", "b": [0.7199, 0.648, 0.7973, 0.6665]}, {"w": "again.", "b": [0.8032, 0.648, 0.8602, 0.6665]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.40. Loading the VGG16 network with pretrained weights", "words": [{"w": "Listing", "b": [0.1289, 0.6835, 0.182, 0.6973]}, {"w": "5.40.", "b": [0.1865, 0.6835, 0.2219, 0.6973]}, {"w": "Loading", "b": [0.2263, 0.6835, 0.2893, 0.6973]}, {"w": "the", "b": [0.2937, 0.6835, 0.3173, 0.6973]}, {"w": "VGG16", "b": [0.3217, 0.6835, 0.3798, 0.6973]}, {"w": "network", "b": [0.3842, 0.6835, 0.4472, 0.6973]}, {"w": "with", "b": [0.4516, 0.6835, 0.4851, 0.6973]}, {"w": "pretrained", "b": [0.4895, 0.6835, 0.5699, 0.6973]}, {"w": "weights", "b": [0.5743, 0.6835, 0.6314, 0.6973]}]}, {"id": "b_7", "type": "equation", "text": "from keras.applications.vgg16 import VGG16 model = VGG16(weights='imagenet') 1", "words": [{"w": "from", "b": [0.1348, 0.7101, 0.1773, 0.7243]}, {"w": "keras.applications.vgg16", "b": [0.1879, 0.7101, 0.443, 0.7243]}, {"w": "import", "b": [0.4536, 0.7101, 0.5173, 0.7243]}, {"w": "VGG16", "b": [0.528, 0.7101, 0.5811, 0.7243]}, {"w": "model", "b": [0.1348, 0.7384, 0.1879, 0.7526]}, {"w": "=", "b": [0.1985, 0.7384, 0.2092, 0.7526]}, {"w": "VGG16(weights='imagenet')", "b": [0.2198, 0.7384, 0.4855, 0.7526]}, {"w": "1", "b": [0.6768, 0.7384, 0.6874, 0.7526]}]}, {"id": "b_8", "type": "paragraph", "text": "1 Note that you include the densely connected classifier on top; in all previous cases, you discarded it.", "words": [{"w": "1", "b": [0.1761, 0.7699, 0.1879, 0.7883]}, {"w": "Note", "b": [0.1938, 0.7699, 0.241, 0.7883]}, {"w": "that", "b": [0.2469, 0.7699, 0.2876, 0.7883]}, {"w": "you", "b": [0.2935, 0.7699, 0.3302, 0.7883]}, {"w": "include", "b": [0.3361, 0.7699, 0.4096, 0.7883]}, {"w": "the", "b": [0.4155, 0.7699, 0.447, 0.7883]}, {"w": "densely", "b": [0.4529, 0.7699, 0.5277, 0.7883]}, {"w": "connected", "b": [0.5336, 0.7699, 0.6346, 0.7883]}, {"w": "classifier", "b": [0.6405, 0.7699, 0.7297, 0.7883]}, {"w": "on", "b": [0.7356, 0.7699, 0.7605, 0.7883]}, {"w": "top;", "b": [0.7665, 0.7699, 0.8071, 0.7883]}, {"w": "in", "b": [0.813, 0.7699, 0.8327, 0.7883]}, {"w": "all", "b": [0.8386, 0.7699, 0.8636, 0.7883]}, {"w": "previous", "b": [0.1761, 0.7891, 0.2623, 0.8075]}, {"w": "cases,", "b": [0.2682, 0.7891, 0.3252, 0.8075]}, {"w": "you", "b": [0.3311, 0.7891, 0.3679, 0.8075]}, {"w": "discarded", "b": [0.3738, 0.7891, 0.4722, 0.8075]}, {"w": "it.", "b": [0.4781, 0.7891, 0.4984, 0.8075]}]}, {"id": "b_9", "type": "paragraph", "text": "Consider the image of two African elephants shown in figure 5.34 (under a Creative Commons license), possibly a mother and her calf, strolling on the savanna. Let’s convert this image into something the VGG16 model can read: the model was trained on images of size 224 × 244, preprocessed according to", "words": [{"w": "Consider", "b": [0.1289, 0.8291, 0.2141, 0.8476]}, {"w": "the", "b": [0.2201, 0.8291, 0.2489, 0.8476]}, {"w": "image", "b": [0.2548, 0.8291, 0.3125, 0.8476]}, {"w": "of", "b": [0.3184, 0.8291, 0.3381, 0.8476]}, {"w": "two", "b": [0.344, 0.8291, 0.3794, 0.8476]}, {"w": "African", "b": [0.3853, 0.8291, 0.4575, 0.8476]}, {"w": "elephants", "b": [0.4634, 0.8291, 0.5525, 0.8476]}, {"w": "shown", "b": [0.5585, 0.8291, 0.6201, 0.8476]}, {"w": "in", "b": [0.626, 0.8291, 0.6444, 0.8476]}, {"w": "figure", "b": [0.6502, 0.8291, 0.7066, 0.8476]}, {"w": "5.34", "b": [0.7125, 0.8291, 0.7539, 0.8476]}, {"w": "(under", "b": [0.7598, 0.8291, 0.8214, 0.8476]}, {"w": "a", "b": [0.8273, 0.8291, 0.8378, 0.8476]}, {"w": "Creative", "b": [0.1289, 0.8483, 0.2089, 0.8668]}, {"w": "Commons", "b": [0.2148, 0.8483, 0.3119, 0.8668]}, {"w": "license),", "b": [0.3178, 0.8483, 0.3971, 0.8668]}, {"w": "possibly", "b": [0.403, 0.8483, 0.4818, 0.8668]}, {"w": "a", "b": [0.4877, 0.8483, 0.4982, 0.8668]}, {"w": "mother", "b": [0.5041, 0.8483, 0.571, 0.8668]}, {"w": "and", "b": [0.5769, 0.8483, 0.611, 0.8668]}, {"w": "her", "b": [0.6169, 0.8483, 0.647, 0.8668]}, {"w": "calf,", "b": [0.6529, 0.8483, 0.6942, 0.8668]}, {"w": "strolling", "b": [0.7001, 0.8483, 0.7789, 0.8668]}, {"w": "on", "b": [0.7848, 0.8483, 0.8084, 0.8668]}, {"w": "the", "b": [0.8143, 0.8483, 0.8432, 0.8668]}, {"w": "savanna.", "b": [0.1289, 0.8675, 0.2108, 0.886]}, {"w": "Let’s", "b": [0.2167, 0.8675, 0.264, 0.886]}, {"w": "convert", "b": [0.2699, 0.8675, 0.3407, 0.886]}, {"w": "this", "b": [0.3466, 0.8675, 0.3807, 0.886]}, {"w": "image", "b": [0.3866, 0.8675, 0.4443, 0.886]}, {"w": "into", "b": [0.4502, 0.8675, 0.487, 0.886]}, {"w": "something", "b": [0.4928, 0.8675, 0.5912, 0.886]}, {"w": "the", "b": [0.5971, 0.8675, 0.626, 0.886]}, {"w": "VGG16", "b": [0.6319, 0.8675, 0.7067, 0.886]}, {"w": "model", "b": [0.7126, 0.8675, 0.7716, 0.886]}, {"w": "can", "b": [0.7775, 0.8675, 0.8103, 0.886]}, {"w": "read:", "b": [0.8162, 0.8675, 0.8634, 0.886]}, {"w": "the", "b": [0.1289, 0.8867, 0.1577, 0.9052]}, {"w": "model", "b": [0.1636, 0.8867, 0.2227, 0.9052]}, {"w": "was", "b": [0.2286, 0.8867, 0.2653, 0.9052]}, {"w": "trained", "b": [0.2712, 0.8867, 0.3368, 0.9052]}, {"w": "on", "b": [0.3427, 0.8867, 0.3663, 0.9052]}, {"w": "images", "b": [0.3722, 0.8867, 0.4391, 0.9052]}, {"w": "of", "b": [0.445, 0.8867, 0.4647, 0.9052]}, {"w": "size", "b": [0.4706, 0.8867, 0.5073, 0.9052]}, {"w": "224", "b": [0.5132, 0.8867, 0.5486, 0.9052]}, {"w": "×", "b": [0.5545, 0.8867, 0.5679, 0.9052]}, {"w": "244,", "b": [0.5738, 0.8867, 0.6151, 0.9052]}, {"w": "preprocessed", "b": [0.621, 0.8867, 0.7443, 0.9052]}, {"w": "according", "b": [0.7502, 0.8867, 0.8433, 0.9052]}, {"w": "to", "b": [0.8492, 0.8867, 0.8675, 0.9052]}]}]}, {"page": 233, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "a few rules that are packaged in the utility function keras.applications.vgg16.preprocess_input. So you need to load the image, resize it to 224 × 224, convert it to a Numpy float32 tensor, and apply these preprocessing rules.", "words": [{"w": "a", "b": [0.1289, 0.0857, 0.1394, 0.1041]}, {"w": "few", "b": [0.1453, 0.0857, 0.1807, 0.1041]}, {"w": "rules", "b": [0.1866, 0.0857, 0.2325, 0.1041]}, {"w": "that", "b": [0.2384, 0.0857, 0.2738, 0.1041]}, {"w": "are", "b": [0.2797, 0.0857, 0.3085, 0.1041]}, {"w": "packaged", "b": [0.3144, 0.0857, 0.4036, 0.1041]}, {"w": "in", "b": [0.4095, 0.0857, 0.4279, 0.1041]}, {"w": "the", "b": [0.4338, 0.0857, 0.4626, 0.1041]}, {"w": "utility", "b": [0.4685, 0.0857, 0.525, 0.1041]}, {"w": "function", "b": [0.5309, 0.0857, 0.6096, 0.1041]}, {"w": "keras.applications.vgg16.preprocess_input.", "b": [0.1289, 0.1049, 0.7158, 0.1247]}, {"w": "So", "b": [0.7217, 0.1049, 0.7466, 0.1233]}, {"w": "you", "b": [0.7525, 0.1049, 0.788, 0.1233]}, {"w": "need", "b": [0.7939, 0.1049, 0.8385, 0.1233]}, {"w": "to", "b": [0.8444, 0.1049, 0.8627, 0.1233]}, {"w": "load", "b": [0.1289, 0.1249, 0.1695, 0.1434]}, {"w": "the", "b": [0.1754, 0.1249, 0.2043, 0.1434]}, {"w": "image,", "b": [0.2102, 0.1249, 0.2738, 0.1434]}, {"w": "resize", "b": [0.2797, 0.1249, 0.3348, 0.1434]}, {"w": "it", "b": [0.3407, 0.1249, 0.3538, 0.1434]}, {"w": "to", "b": [0.3597, 0.1249, 0.3781, 0.1434]}, {"w": "224", "b": [0.384, 0.1249, 0.4194, 0.1434]}, {"w": "×", "b": [0.4253, 0.1249, 0.4387, 0.1434]}, {"w": "224,", "b": [0.4446, 0.1249, 0.4859, 0.1434]}, {"w": "convert", "b": [0.4918, 0.1249, 0.5626, 0.1434]}, {"w": "it", "b": [0.5685, 0.1249, 0.5816, 0.1434]}, {"w": "to", "b": [0.5875, 0.1249, 0.6059, 0.1434]}, {"w": "a", "b": [0.6118, 0.1249, 0.6223, 0.1434]}, {"w": "Numpy", "b": [0.6282, 0.1249, 0.6991, 0.1434]}, {"w": "float32", "b": [0.7049, 0.1259, 0.8041, 0.1448]}, {"w": "tensor,", "b": [0.1289, 0.1449, 0.1915, 0.1634]}, {"w": "and", "b": [0.1974, 0.1449, 0.2315, 0.1634]}, {"w": "apply", "b": [0.2375, 0.1449, 0.2899, 0.1634]}, {"w": "these", "b": [0.2958, 0.1449, 0.3444, 0.1634]}, {"w": "preprocessing", "b": [0.3503, 0.1449, 0.4814, 0.1634]}, {"w": "rules.", "b": [0.4873, 0.1449, 0.5391, 0.1634]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.34. Test picture of African elephants", "words": [{"w": "Figure", "b": [0.1289, 0.1803, 0.1787, 0.1942]}, {"w": "5.34.", "b": [0.1832, 0.1803, 0.2186, 0.1942]}, {"w": "Test", "b": [0.223, 0.1803, 0.2538, 0.1942]}, {"w": "picture", "b": [0.2583, 0.1803, 0.312, 0.1942]}, {"w": "of", "b": [0.3165, 0.1803, 0.3312, 0.1942]}, {"w": "African", "b": [0.3356, 0.1803, 0.3937, 0.1942]}, {"w": "elephants", "b": [0.3981, 0.1803, 0.4699, 0.1942]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.41. Preprocessing an input image for VGG16", "words": [{"w": "Listing", "b": [0.1289, 0.4615, 0.182, 0.4754]}, {"w": "5.41.", "b": [0.1865, 0.4615, 0.2219, 0.4754]}, {"w": "Preprocessing", "b": [0.2263, 0.4615, 0.3319, 0.4754]}, {"w": "an", "b": [0.3363, 0.4615, 0.355, 0.4754]}, {"w": "input", "b": [0.3594, 0.4615, 0.3998, 0.4754]}, {"w": "image", "b": [0.4042, 0.4615, 0.4495, 0.4754]}, {"w": "for", "b": [0.4539, 0.4615, 0.4765, 0.4754]}, {"w": "VGG16", "b": [0.481, 0.4615, 0.539, 0.4754]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.preprocessing import image from keras.applications.vgg16 import preprocess_input, decode_predictions import numpy as np img_path = '/Users/fchollet/Downloads/creative_commons_elephant.jpg' 1 img = image.load_img(img_path, target_size=(224, 224)) 2 x = image.img_to_array(img) 3 x = np.expand_dims(x, axis=0) 4 x = preprocess_input(x) 5", "words": [{"w": "from", "b": [0.1348, 0.4881, 0.1773, 0.5023]}, {"w": "keras.preprocessing", "b": [0.1879, 0.4881, 0.3898, 0.5023]}, {"w": "import", "b": [0.4004, 0.4881, 0.4642, 0.5023]}, {"w": "image", "b": [0.4748, 0.4881, 0.528, 0.5023]}, {"w": "from", "b": [0.1348, 0.5023, 0.1773, 0.5165]}, {"w": "keras.applications.vgg16", "b": [0.1879, 0.5023, 0.443, 0.5165]}, {"w": "import", "b": [0.4536, 0.5023, 0.5173, 0.5165]}, {"w": "preprocess_input,", "b": [0.528, 0.5023, 0.7086, 0.5165]}, {"w": "decode_predictions", "b": [0.1348, 0.5165, 0.3261, 0.5307]}, {"w": "import", "b": [0.1348, 0.5307, 0.1985, 0.5449]}, {"w": "numpy", "b": [0.2092, 0.5307, 0.2623, 0.5449]}, {"w": "as", "b": [0.2729, 0.5307, 0.2942, 0.5449]}, {"w": "np", "b": [0.3048, 0.5307, 0.3261, 0.5449]}, {"w": "img_path", "b": [0.1348, 0.559, 0.2198, 0.5732]}, {"w": "=", "b": [0.2304, 0.559, 0.241, 0.5732]}, {"w": "'/Users/fchollet/Downloads/creative_commons_elephant.jpg'", "b": [0.2517, 0.559, 0.8574, 0.5732]}, {"w": "1", "b": [0.1348, 0.5732, 0.1454, 0.5874]}, {"w": "img", "b": [0.1348, 0.6016, 0.1667, 0.6158]}, {"w": "=", "b": [0.1773, 0.6016, 0.1879, 0.6158]}, {"w": "image.load_img(img_path,", "b": [0.1985, 0.6016, 0.4536, 0.6158]}, {"w": "target_size=(224,", "b": [0.4642, 0.6016, 0.6449, 0.6158]}, {"w": "224))", "b": [0.6555, 0.6016, 0.7086, 0.6158]}, {"w": "2", "b": [0.1348, 0.6158, 0.1454, 0.63]}, {"w": "x", "b": [0.1348, 0.6442, 0.1454, 0.6583]}, {"w": "=", "b": [0.156, 0.6442, 0.1667, 0.6583]}, {"w": "image.img_to_array(img)", "b": [0.1773, 0.6442, 0.4217, 0.6583]}, {"w": "3", "b": [0.1348, 0.6583, 0.1454, 0.6725]}, {"w": "x", "b": [0.1348, 0.6867, 0.1454, 0.7009]}, {"w": "=", "b": [0.156, 0.6867, 0.1667, 0.7009]}, {"w": "np.expand_dims(x,", "b": [0.1773, 0.6867, 0.3579, 0.7009]}, {"w": "axis=0)", "b": [0.3686, 0.6867, 0.443, 0.7009]}, {"w": "4", "b": [0.1348, 0.7009, 0.1454, 0.7151]}, {"w": "x", "b": [0.1348, 0.7293, 0.1454, 0.7434]}, {"w": "=", "b": [0.156, 0.7293, 0.1667, 0.7434]}, {"w": "preprocess_input(x)", "b": [0.1773, 0.7293, 0.3792, 0.7434]}, {"w": "5", "b": [0.1348, 0.7434, 0.1454, 0.7576]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Local path to the target image 2 Python Imaging Library (PIL) image of size 224 × 224 3 float32 Numpy array of shape (224, 224, 3) 4 Adds a dimension to transform the array into a batch of size (1, 224, 224, 3) 5 Preprocesses the batch (this does channel-wise color normalization)", "words": [{"w": "1", "b": [0.1761, 0.7749, 0.1879, 0.7934]}, {"w": "Local", "b": [0.1938, 0.7749, 0.2502, 0.7934]}, {"w": "path", "b": [0.2561, 0.7749, 0.3021, 0.7934]}, {"w": "to", "b": [0.308, 0.7749, 0.3276, 0.7934]}, {"w": "the", "b": [0.3335, 0.7749, 0.365, 0.7934]}, {"w": "target", "b": [0.3709, 0.7749, 0.4312, 0.7934]}, {"w": "image", "b": [0.4371, 0.7749, 0.4975, 0.7934]}, {"w": "2", "b": [0.1761, 0.7941, 0.1879, 0.8125]}, {"w": "Python", "b": [0.1938, 0.7941, 0.266, 0.8125]}, {"w": "Imaging", "b": [0.2719, 0.7941, 0.3559, 0.8125]}, {"w": "Library", "b": [0.3618, 0.7941, 0.4418, 0.8125]}, {"w": "(PIL)", "b": [0.4477, 0.7941, 0.5028, 0.8125]}, {"w": "image", "b": [0.5087, 0.7941, 0.569, 0.8125]}, {"w": "of", "b": [0.5749, 0.7941, 0.5946, 0.8125]}, {"w": "size", "b": [0.6005, 0.7941, 0.6372, 0.8125]}, {"w": "224", "b": [0.6431, 0.7941, 0.6786, 0.8125]}, {"w": "×", "b": [0.6845, 0.7941, 0.6979, 0.8125]}, {"w": "224", "b": [0.7038, 0.7941, 0.7392, 0.8125]}, {"w": "3", "b": [0.1761, 0.8133, 0.1879, 0.8317]}, {"w": "float32", "b": [0.1938, 0.8133, 0.2633, 0.8317]}, {"w": "Numpy", "b": [0.2692, 0.8133, 0.344, 0.8317]}, {"w": "array", "b": [0.3499, 0.8133, 0.4063, 0.8317]}, {"w": "of", "b": [0.4122, 0.8133, 0.4319, 0.8317]}, {"w": "shape", "b": [0.4378, 0.8133, 0.4955, 0.8317]}, {"w": "(224,", "b": [0.5014, 0.8133, 0.5506, 0.8317]}, {"w": "224,", "b": [0.5565, 0.8133, 0.5979, 0.8317]}, {"w": "3)", "b": [0.6038, 0.8133, 0.6234, 0.8317]}, {"w": "4", "b": [0.1761, 0.8324, 0.1879, 0.8509]}, {"w": "Adds", "b": [0.1938, 0.8324, 0.2463, 0.8509]}, {"w": "a", "b": [0.2522, 0.8324, 0.264, 0.8509]}, {"w": "dimension", "b": [0.2699, 0.8324, 0.3736, 0.8509]}, {"w": "to", "b": [0.3795, 0.8324, 0.3992, 0.8509]}, {"w": "transform", "b": [0.4051, 0.8324, 0.5074, 0.8509]}, {"w": "the", "b": [0.5133, 0.8324, 0.5448, 0.8509]}, {"w": "array", "b": [0.5507, 0.8324, 0.6071, 0.8509]}, {"w": "into", "b": [0.613, 0.8324, 0.6523, 0.8509]}, {"w": "a", "b": [0.6582, 0.8324, 0.67, 0.8509]}, {"w": "batch", "b": [0.6759, 0.8324, 0.7324, 0.8509]}, {"w": "of", "b": [0.7383, 0.8324, 0.7579, 0.8509]}, {"w": "size", "b": [0.7638, 0.8324, 0.8006, 0.8509]}, {"w": "(1,", "b": [0.8065, 0.8324, 0.832, 0.8509]}, {"w": "224,", "b": [0.1761, 0.8516, 0.2174, 0.8701]}, {"w": "224,", "b": [0.2233, 0.8516, 0.2647, 0.8701]}, {"w": "3)", "b": [0.2706, 0.8516, 0.2902, 0.8701]}, {"w": "5", "b": [0.1761, 0.8708, 0.1879, 0.8893]}, {"w": "Preprocesses", "b": [0.1938, 0.8708, 0.3228, 0.8893]}, {"w": "the", "b": [0.3287, 0.8708, 0.3602, 0.8893]}, {"w": "batch", "b": [0.3661, 0.8708, 0.4225, 0.8893]}, {"w": "(this", "b": [0.4284, 0.8708, 0.473, 0.8893]}, {"w": "does", "b": [0.4789, 0.8708, 0.5235, 0.8893]}, {"w": "channel-wise", "b": [0.5294, 0.8708, 0.6593, 0.8893]}, {"w": "color", "b": [0.6652, 0.8708, 0.7164, 0.8893]}, {"w": "normalization)", "b": [0.1761, 0.89, 0.3257, 0.9085]}]}]}, {"page": 234, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You can now run the pretrained network on the image and decode its prediction vector back to a human-readable format:", "words": [{"w": "You", "b": [0.1289, 0.0857, 0.1672, 0.1041]}, {"w": "can", "b": [0.1731, 0.0857, 0.2059, 0.1041]}, {"w": "now", "b": [0.2118, 0.0857, 0.2524, 0.1041]}, {"w": "run", "b": [0.2583, 0.0857, 0.2898, 0.1041]}, {"w": "the", "b": [0.2957, 0.0857, 0.3246, 0.1041]}, {"w": "pretrained", "b": [0.3305, 0.0857, 0.4262, 0.1041]}, {"w": "network", "b": [0.4321, 0.0857, 0.5095, 0.1041]}, {"w": "on", "b": [0.5154, 0.0857, 0.539, 0.1041]}, {"w": "the", "b": [0.5449, 0.0857, 0.5738, 0.1041]}, {"w": "image", "b": [0.5797, 0.0857, 0.6374, 0.1041]}, {"w": "and", "b": [0.6433, 0.0857, 0.6774, 0.1041]}, {"w": "decode", "b": [0.6833, 0.0857, 0.7502, 0.1041]}, {"w": "its", "b": [0.7561, 0.0857, 0.7784, 0.1041]}, {"w": "prediction", "b": [0.1289, 0.1049, 0.2246, 0.1233]}, {"w": "vector", "b": [0.2305, 0.1049, 0.2896, 0.1233]}, {"w": "back", "b": [0.2955, 0.1049, 0.34, 0.1233]}, {"w": "to", "b": [0.3459, 0.1049, 0.3643, 0.1233]}, {"w": "a", "b": [0.3702, 0.1049, 0.3807, 0.1233]}, {"w": "human-readable", "b": [0.3866, 0.1049, 0.5387, 0.1233]}, {"w": "format:", "b": [0.5446, 0.1049, 0.6142, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": ">>> preds = model.predict(x) >>> print('Predicted:', decode_predictions(preds, top=3)[0]) Predicted:', [(u'n02504458', u'African_elephant', 0.92546833), (u'n01871265', u'tusker', 0.070257246), (u'n02504013', u'Indian_elephant', 0.0042589349)]", "words": [{"w": ">>>", "b": [0.1348, 0.1402, 0.1667, 0.1544]}, {"w": "preds", "b": [0.1773, 0.1402, 0.2304, 0.1544]}, {"w": "=", "b": [0.241, 0.1402, 0.2517, 0.1544]}, {"w": "model.predict(x)", "b": [0.2623, 0.1402, 0.4323, 0.1544]}, {"w": ">>>", "b": [0.1348, 0.1544, 0.1667, 0.1685]}, {"w": "print('Predicted:',", "b": [0.1773, 0.1544, 0.3792, 0.1685]}, {"w": "decode_predictions(preds,", "b": [0.3898, 0.1544, 0.6555, 0.1685]}, {"w": "top=3)[0])", "b": [0.6661, 0.1544, 0.7724, 0.1685]}, {"w": "Predicted:',", "b": [0.1348, 0.1685, 0.2623, 0.1827]}, {"w": "[(u'n02504458',", "b": [0.2729, 0.1685, 0.4323, 0.1827]}, {"w": "u'African_elephant',", "b": [0.443, 0.1685, 0.6555, 0.1827]}, {"w": "0.92546833),", "b": [0.6661, 0.1685, 0.7936, 0.1827]}, {"w": "(u'n01871265',", "b": [0.1348, 0.1827, 0.2836, 0.1969]}, {"w": "u'tusker',", "b": [0.2942, 0.1827, 0.4004, 0.1969]}, {"w": "0.070257246),", "b": [0.4111, 0.1827, 0.5492, 0.1969]}, {"w": "(u'n02504013',", "b": [0.1348, 0.1969, 0.2836, 0.2111]}, {"w": "u'Indian_elephant',", "b": [0.2942, 0.1969, 0.4961, 0.2111]}, {"w": "0.0042589349)]", "b": [0.5067, 0.1969, 0.6555, 0.2111]}]}, {"id": "b_2", "type": "paragraph", "text": "The top three classes predicted for this image are as follows:", "words": [{"w": "The", "b": [0.1289, 0.2325, 0.1656, 0.251]}, {"w": "top", "b": [0.1715, 0.2325, 0.2017, 0.251]}, {"w": "three", "b": [0.2076, 0.2325, 0.2548, 0.251]}, {"w": "classes", "b": [0.2607, 0.2325, 0.3263, 0.251]}, {"w": "predicted", "b": [0.3322, 0.2325, 0.42, 0.251]}, {"w": "for", "b": [0.4259, 0.2325, 0.4535, 0.251]}, {"w": "this", "b": [0.4594, 0.2325, 0.4935, 0.251]}, {"w": "image", "b": [0.4994, 0.2325, 0.5571, 0.251]}, {"w": "are", "b": [0.563, 0.2325, 0.5919, 0.251]}, {"w": "as", "b": [0.5978, 0.2325, 0.6174, 0.251]}, {"w": "follows:", "b": [0.6233, 0.2325, 0.7008, 0.251]}]}, {"id": "b_3", "type": "paragraph", "text": "African elephant (with 92.5% probability) Tusker (with 7% probability) Indian elephant (with 0.4% probability)", "words": [{"w": "African", "b": [0.1761, 0.2684, 0.2482, 0.2869]}, {"w": "elephant", "b": [0.2541, 0.2684, 0.3341, 0.2869]}, {"w": "(with", "b": [0.34, 0.2684, 0.3899, 0.2869]}, {"w": "92.5%", "b": [0.3958, 0.2684, 0.4568, 0.2869]}, {"w": "probability)", "b": [0.4627, 0.2684, 0.5742, 0.2869]}, {"w": "Tusker", "b": [0.1761, 0.2876, 0.2408, 0.3061]}, {"w": "(with", "b": [0.2468, 0.2876, 0.2966, 0.3061]}, {"w": "7%", "b": [0.3025, 0.2876, 0.334, 0.3061]}, {"w": "probability)", "b": [0.3399, 0.2876, 0.4514, 0.3061]}, {"w": "Indian", "b": [0.1761, 0.3068, 0.2364, 0.3253]}, {"w": "elephant", "b": [0.2423, 0.3068, 0.3224, 0.3253]}, {"w": "(with", "b": [0.3283, 0.3068, 0.3781, 0.3253]}, {"w": "0.4%", "b": [0.384, 0.3068, 0.4332, 0.3253]}, {"w": "probability)", "b": [0.4391, 0.3068, 0.5506, 0.3253]}]}, {"id": "b_4", "type": "paragraph", "text": "The network has recognized the image as containing an undetermined quantity of African elephants. The entry in the prediction vector that was maximally activated is the one corresponding to the “African elephant” class, at index 386:", "words": [{"w": "The", "b": [0.1289, 0.3468, 0.1656, 0.3653]}, {"w": "network", "b": [0.1715, 0.3468, 0.2489, 0.3653]}, {"w": "has", "b": [0.2548, 0.3468, 0.2863, 0.3653]}, {"w": "recognized", "b": [0.2922, 0.3468, 0.3958, 0.3653]}, {"w": "the", "b": [0.4017, 0.3468, 0.4305, 0.3653]}, {"w": "image", "b": [0.4364, 0.3468, 0.4941, 0.3653]}, {"w": "as", "b": [0.5001, 0.3468, 0.5197, 0.3653]}, {"w": "containing", "b": [0.5256, 0.3468, 0.6253, 0.3653]}, {"w": "an", "b": [0.6312, 0.3468, 0.6535, 0.3653]}, {"w": "undetermined", "b": [0.6594, 0.3468, 0.7893, 0.3653]}, {"w": "quantity", "b": [0.1289, 0.366, 0.2063, 0.3845]}, {"w": "of", "b": [0.2122, 0.366, 0.2319, 0.3845]}, {"w": "African", "b": [0.2378, 0.366, 0.3099, 0.3845]}, {"w": "elephants.", "b": [0.3158, 0.366, 0.4109, 0.3845]}, {"w": "The", "b": [0.4168, 0.366, 0.4535, 0.3845]}, {"w": "entry", "b": [0.4594, 0.366, 0.5079, 0.3845]}, {"w": "in", "b": [0.5138, 0.366, 0.5322, 0.3845]}, {"w": "the", "b": [0.5381, 0.366, 0.567, 0.3845]}, {"w": "prediction", "b": [0.5729, 0.366, 0.6686, 0.3845]}, {"w": "vector", "b": [0.6745, 0.366, 0.7335, 0.3845]}, {"w": "that", "b": [0.7394, 0.366, 0.7748, 0.3845]}, {"w": "was", "b": [0.7807, 0.366, 0.8174, 0.3845]}, {"w": "maximally", "b": [0.1289, 0.3852, 0.2299, 0.4037]}, {"w": "activated", "b": [0.2358, 0.3852, 0.3211, 0.4037]}, {"w": "is", "b": [0.327, 0.3852, 0.3427, 0.4037]}, {"w": "the", "b": [0.3486, 0.3852, 0.3775, 0.4037]}, {"w": "one", "b": [0.3834, 0.3852, 0.4175, 0.4037]}, {"w": "corresponding", "b": [0.4234, 0.3852, 0.5585, 0.4037]}, {"w": "to", "b": [0.5644, 0.3852, 0.5828, 0.4037]}, {"w": "the", "b": [0.5887, 0.3852, 0.6175, 0.4037]}, {"w": "“African", "b": [0.6234, 0.3852, 0.706, 0.4037]}, {"w": "elephant”", "b": [0.7119, 0.3852, 0.8024, 0.4037]}, {"w": "class,", "b": [0.8083, 0.3852, 0.8601, 0.4037]}, {"w": "at", "b": [0.1289, 0.4044, 0.1459, 0.4229]}, {"w": "index", "b": [0.1518, 0.4044, 0.2043, 0.4229]}, {"w": "386:", "b": [0.2102, 0.4044, 0.2522, 0.4229]}]}, {"id": "b_5", "type": "paragraph", "text": ">>> np.argmax(preds[0]) 386", "words": [{"w": ">>>", "b": [0.1348, 0.4397, 0.1667, 0.4539]}, {"w": "np.argmax(preds[0])", "b": [0.1773, 0.4397, 0.3792, 0.4539]}, {"w": "386", "b": [0.1348, 0.4539, 0.1667, 0.4681]}]}, {"id": "b_6", "type": "paragraph", "text": "To visualize which parts of the image are the most African elephant–like, let’s set up the Grad-CAM process.", "words": [{"w": "To", "b": [0.1289, 0.4895, 0.1535, 0.508]}, {"w": "visualize", "b": [0.1594, 0.4895, 0.2433, 0.508]}, {"w": "which", "b": [0.2492, 0.4895, 0.3069, 0.508]}, {"w": "parts", "b": [0.3128, 0.4895, 0.3587, 0.508]}, {"w": "of", "b": [0.3646, 0.4895, 0.3843, 0.508]}, {"w": "the", "b": [0.3902, 0.4895, 0.4191, 0.508]}, {"w": "image", "b": [0.425, 0.4895, 0.4827, 0.508]}, {"w": "are", "b": [0.4886, 0.4895, 0.5174, 0.508]}, {"w": "the", "b": [0.5233, 0.4895, 0.5522, 0.508]}, {"w": "most", "b": [0.5581, 0.4895, 0.604, 0.508]}, {"w": "African", "b": [0.6099, 0.4895, 0.6821, 0.508]}, {"w": "elephant–like,", "b": [0.688, 0.4895, 0.8211, 0.508]}, {"w": "let’s", "b": [0.827, 0.4895, 0.8662, 0.508]}, {"w": "set", "b": [0.1289, 0.5087, 0.1551, 0.5272]}, {"w": "up", "b": [0.161, 0.5087, 0.1846, 0.5272]}, {"w": "the", "b": [0.1905, 0.5087, 0.2194, 0.5272]}, {"w": "Grad-CAM", "b": [0.2253, 0.5087, 0.3342, 0.5272]}, {"w": "process.", "b": [0.3401, 0.5087, 0.4168, 0.5272]}]}, {"id": "b_7", "type": "equation", "text": "Listing 5.42. Setting up the Grad-CAM algorithm", "words": [{"w": "Listing", "b": [0.1289, 0.5441, 0.182, 0.558]}, {"w": "5.42.", "b": [0.1865, 0.5441, 0.2219, 0.558]}, {"w": "Setting", "b": [0.2263, 0.5441, 0.2794, 0.558]}, {"w": "up", "b": [0.2838, 0.5441, 0.3035, 0.558]}, {"w": "the", "b": [0.308, 0.5441, 0.3316, 0.558]}, {"w": "Grad-CAM", "b": [0.336, 0.5441, 0.4245, 0.558]}, {"w": "algorithm", "b": [0.429, 0.5441, 0.5037, 0.558]}]}, {"id": "b_8", "type": "paragraph", "text": "african_e66lephant_output = model.output[:, 386] 1 last_conv_layer = model.get_layer('block5_conv3') 2 grads = K.gradients(african_elephant_output, last_conv_layer.output) [0] 3 pooled_grads = K.mean(grads, axis=(0, 1, 2)) 4 iterate = K.function([model.input], [pooled_grads, last_conv_layer.output[0]]) 5 pooled_grads_value, conv_layer_output_value = iterate([x]) 6 for i in range(512): 7 conv_layer_output_value[:, :, i] *= pooled_grads_value[i] 7", "words": [{"w": "african_e66lephant_output", "b": [0.1348, 0.5707, 0.4004, 0.5849]}, {"w": "=", "b": [0.4111, 0.5707, 0.4217, 0.5849]}, {"w": "model.output[:,", "b": [0.4323, 0.5707, 0.5917, 0.5849]}, {"w": "386]", "b": [0.6024, 0.5707, 0.6449, 0.5849]}, {"w": "1", "b": [0.1348, 0.5849, 0.1454, 0.5991]}, {"w": "last_conv_layer", "b": [0.1348, 0.6133, 0.2942, 0.6275]}, {"w": "=", "b": [0.3048, 0.6133, 0.3154, 0.6275]}, {"w": "model.get_layer('block5_conv3')", "b": [0.3261, 0.6133, 0.6555, 0.6275]}, {"w": "2", "b": [0.1348, 0.6275, 0.1454, 0.6416]}, {"w": "grads", "b": [0.1348, 0.6558, 0.1879, 0.67]}, {"w": "=", "b": [0.1985, 0.6558, 0.2092, 0.67]}, {"w": "K.gradients(african_elephant_output,", "b": [0.2198, 0.6558, 0.6024, 0.67]}, {"w": "last_conv_layer.output)", "b": [0.613, 0.6558, 0.8574, 0.67]}, {"w": "[0]", "b": [0.1348, 0.67, 0.1667, 0.6842]}, {"w": "3", "b": [0.1985, 0.67, 0.2092, 0.6842]}, {"w": "pooled_grads", "b": [0.1348, 0.6984, 0.2623, 0.7126]}, {"w": "=", "b": [0.2729, 0.6984, 0.2836, 0.7126]}, {"w": "K.mean(grads,", "b": [0.2942, 0.6984, 0.4323, 0.7126]}, {"w": "axis=(0,", "b": [0.443, 0.6984, 0.528, 0.7126]}, {"w": "1,", "b": [0.5386, 0.6984, 0.5598, 0.7126]}, {"w": "2))", "b": [0.5705, 0.6984, 0.6024, 0.7126]}, {"w": "4", "b": [0.1348, 0.7126, 0.1454, 0.7268]}, {"w": "iterate", "b": [0.1348, 0.7409, 0.2092, 0.7551]}, {"w": "=", "b": [0.2198, 0.7409, 0.2304, 0.7551]}, {"w": "K.function([model.input],", "b": [0.241, 0.7409, 0.5067, 0.7551]}, {"w": "[pooled_grads,", "b": [0.3579, 0.7551, 0.5067, 0.7693]}, {"w": "last_conv_layer.output[0]])", "b": [0.5173, 0.7551, 0.8043, 0.7693]}, {"w": "5", "b": [0.1348, 0.7693, 0.1454, 0.7835]}, {"w": "pooled_grads_value,", "b": [0.1348, 0.7977, 0.3367, 0.8119]}, {"w": "conv_layer_output_value", "b": [0.3473, 0.7977, 0.5917, 0.8119]}, {"w": "=", "b": [0.6024, 0.7977, 0.613, 0.8119]}, {"w": "iterate([x])", "b": [0.6236, 0.7977, 0.7511, 0.8119]}, {"w": "6", "b": [0.1348, 0.8119, 0.1454, 0.826]}, {"w": "for", "b": [0.1348, 0.8402, 0.1667, 0.8544]}, {"w": "i", "b": [0.1773, 0.8402, 0.1879, 0.8544]}, {"w": "in", "b": [0.1985, 0.8402, 0.2198, 0.8544]}, {"w": "range(512):", "b": [0.2304, 0.8402, 0.3473, 0.8544]}, {"w": "7", "b": [0.1348, 0.8544, 0.1454, 0.8686]}, {"w": "conv_layer_output_value[:,", "b": [0.1773, 0.8686, 0.4536, 0.8828]}, {"w": ":,", "b": [0.4642, 0.8686, 0.4855, 0.8828]}, {"w": "i]", "b": [0.4961, 0.8686, 0.5173, 0.8828]}, {"w": "*=", "b": [0.528, 0.8686, 0.5492, 0.8828]}, {"w": "pooled_grads_value[i]", "b": [0.5598, 0.8686, 0.783, 0.8828]}, {"w": "7", "b": [0.1348, 0.8828, 0.1454, 0.897]}]}]}, {"page": 235, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "heatmap = np.mean(conv_layer_output_value, axis=-1) 8", "words": [{"w": "heatmap", "b": [0.1348, 0.0851, 0.2092, 0.0993]}, {"w": "=", "b": [0.2198, 0.0851, 0.2304, 0.0993]}, {"w": "np.mean(conv_layer_output_value,", "b": [0.241, 0.0851, 0.5811, 0.0993]}, {"w": "axis=-1)", "b": [0.5917, 0.0851, 0.6767, 0.0993]}, {"w": "8", "b": [0.1348, 0.0993, 0.1454, 0.1135]}]}, {"id": "b_1", "type": "paragraph", "text": "1 “African elephant” entry in the prediction vector 2 Output feature map of the block5_conv3 layer, the last convolutional layer in VGG16 3 Gradient of the “African elephant” class with regard to the output feature map of block5_conv3 4 Vector of shape (512,), where each entry is the mean intensity of the gradient over a specific feature-map channel 5 Lets you access the values of the quantities you just defined: pooled_grads and the output feature map of block5_conv3, given a sample image 6 Values of these two quantities, as Numpy arrays, given the sample image of two elephants 7 Multiplies each channel in the feature-map array by “how important this channel is” with regard to the “elephant” class 8 The channel-wise mean of the resulting feature map is the heatmap of the class activation.", "words": [{"w": "1", "b": [0.1761, 0.1307, 0.1879, 0.1492]}, {"w": "“African", "b": [0.1938, 0.1307, 0.283, 0.1492]}, {"w": "elephant”", "b": [0.2889, 0.1307, 0.3873, 0.1492]}, {"w": "entry", "b": [0.3932, 0.1307, 0.447, 0.1492]}, {"w": "in", "b": [0.4529, 0.1307, 0.4726, 0.1492]}, {"w": "the", "b": [0.4785, 0.1307, 0.51, 0.1492]}, {"w": "prediction", "b": [0.5159, 0.1307, 0.6191, 0.1492]}, {"w": "vector", "b": [0.625, 0.1307, 0.6879, 0.1492]}, {"w": "2", "b": [0.1761, 0.1499, 0.1879, 0.1684]}, {"w": "Output", "b": [0.1938, 0.1499, 0.2673, 0.1684]}, {"w": "feature", "b": [0.2732, 0.1499, 0.3449, 0.1684]}, {"w": "map", "b": [0.3508, 0.1499, 0.3954, 0.1684]}, {"w": "of", "b": [0.4013, 0.1499, 0.421, 0.1684]}, {"w": "the", "b": [0.4269, 0.1499, 0.4584, 0.1684]}, {"w": "block5_conv3", "b": [0.4643, 0.1499, 0.602, 0.1684]}, {"w": "layer,", "b": [0.608, 0.1499, 0.6628, 0.1684]}, {"w": "the", "b": [0.6687, 0.1499, 0.7002, 0.1684]}, {"w": "last", "b": [0.7061, 0.1499, 0.7415, 0.1684]}, {"w": "convolutional", "b": [0.1761, 0.1691, 0.3126, 0.1876]}, {"w": "layer", "b": [0.3185, 0.1691, 0.3696, 0.1876]}, {"w": "in", "b": [0.3755, 0.1691, 0.3952, 0.1876]}, {"w": "VGG16", "b": [0.4011, 0.1691, 0.4785, 0.1876]}, {"w": "3", "b": [0.1761, 0.1883, 0.1879, 0.2068]}, {"w": "Gradient", "b": [0.1938, 0.1883, 0.2857, 0.2068]}, {"w": "of", "b": [0.2916, 0.1883, 0.3112, 0.2068]}, {"w": "the", "b": [0.3171, 0.1883, 0.3486, 0.2068]}, {"w": "“African", "b": [0.3545, 0.1883, 0.4437, 0.2068]}, {"w": "elephant”", "b": [0.4496, 0.1883, 0.548, 0.2068]}, {"w": "class", "b": [0.5539, 0.1883, 0.6011, 0.2068]}, {"w": "with", "b": [0.6071, 0.1883, 0.6517, 0.2068]}, {"w": "regard", "b": [0.6576, 0.1883, 0.7253, 0.2068]}, {"w": "to", "b": [0.7312, 0.1883, 0.7509, 0.2068]}, {"w": "the", "b": [0.7568, 0.1883, 0.7883, 0.2068]}, {"w": "output", "b": [0.7942, 0.1883, 0.8611, 0.2068]}, {"w": "feature", "b": [0.1761, 0.2075, 0.2478, 0.226]}, {"w": "map", "b": [0.2537, 0.2075, 0.2983, 0.226]}, {"w": "of", "b": [0.3042, 0.2075, 0.3239, 0.226]}, {"w": "block5_conv3", "b": [0.3298, 0.2075, 0.4676, 0.226]}, {"w": "4", "b": [0.1761, 0.2267, 0.1879, 0.2452]}, {"w": "Vector", "b": [0.1938, 0.2267, 0.2598, 0.2452]}, {"w": "of", "b": [0.2657, 0.2267, 0.2854, 0.2452]}, {"w": "shape", "b": [0.2913, 0.2267, 0.349, 0.2452]}, {"w": "(512,),", "b": [0.3549, 0.2267, 0.4179, 0.2452]}, {"w": "where", "b": [0.4238, 0.2267, 0.485, 0.2452]}, {"w": "each", "b": [0.4909, 0.2267, 0.5368, 0.2452]}, {"w": "entry", "b": [0.5427, 0.2267, 0.5965, 0.2452]}, {"w": "is", "b": [0.6024, 0.2267, 0.6182, 0.2452]}, {"w": "the", "b": [0.6241, 0.2267, 0.6555, 0.2452]}, {"w": "mean", "b": [0.6614, 0.2267, 0.7165, 0.2452]}, {"w": "intensity", "b": [0.7224, 0.2267, 0.809, 0.2452]}, {"w": "of", "b": [0.8149, 0.2267, 0.8346, 0.2452]}, {"w": "the", "b": [0.1761, 0.2459, 0.2076, 0.2643]}, {"w": "gradient", "b": [0.2135, 0.2459, 0.2988, 0.2643]}, {"w": "over", "b": [0.3047, 0.2459, 0.3492, 0.2643]}, {"w": "a", "b": [0.3552, 0.2459, 0.367, 0.2643]}, {"w": "specific", "b": [0.3729, 0.2459, 0.4476, 0.2643]}, {"w": "feature-map", "b": [0.4535, 0.2459, 0.5777, 0.2643]}, {"w": "channel", "b": [0.5836, 0.2459, 0.6623, 0.2643]}, {"w": "5", "b": [0.1761, 0.2651, 0.1879, 0.2835]}, {"w": "Lets", "b": [0.1938, 0.2651, 0.2371, 0.2835]}, {"w": "you", "b": [0.243, 0.2651, 0.2798, 0.2835]}, {"w": "access", "b": [0.2857, 0.2651, 0.3473, 0.2835]}, {"w": "the", "b": [0.3532, 0.2651, 0.3847, 0.2835]}, {"w": "values", "b": [0.3906, 0.2651, 0.4536, 0.2835]}, {"w": "of", "b": [0.4595, 0.2651, 0.4791, 0.2835]}, {"w": "the", "b": [0.485, 0.2651, 0.5165, 0.2835]}, {"w": "quantities", "b": [0.5224, 0.2651, 0.6221, 0.2835]}, {"w": "you", "b": [0.628, 0.2651, 0.6648, 0.2835]}, {"w": "just", "b": [0.6707, 0.2651, 0.7087, 0.2835]}, {"w": "defined:", "b": [0.7146, 0.2651, 0.7973, 0.2835]}, {"w": "pooled_grads", "b": [0.1761, 0.2843, 0.3113, 0.3027]}, {"w": "and", "b": [0.3172, 0.2843, 0.3552, 0.3027]}, {"w": "the", "b": [0.3611, 0.2843, 0.3926, 0.3027]}, {"w": "output", "b": [0.3985, 0.2843, 0.4654, 0.3027]}, {"w": "feature", "b": [0.4713, 0.2843, 0.543, 0.3027]}, {"w": "map", "b": [0.549, 0.2843, 0.5936, 0.3027]}, {"w": "of", "b": [0.5995, 0.2843, 0.6191, 0.3027]}, {"w": "block5_conv3,", "b": [0.625, 0.2843, 0.7687, 0.3027]}, {"w": "given", "b": [0.7746, 0.2843, 0.8284, 0.3027]}, {"w": "a", "b": [0.8343, 0.2843, 0.8461, 0.3027]}, {"w": "sample", "b": [0.1761, 0.3034, 0.2469, 0.3219]}, {"w": "image", "b": [0.2529, 0.3034, 0.3132, 0.3219]}, {"w": "6", "b": [0.1761, 0.3226, 0.1879, 0.3411]}, {"w": "Values", "b": [0.1938, 0.3226, 0.2599, 0.3411]}, {"w": "of", "b": [0.2658, 0.3226, 0.2855, 0.3411]}, {"w": "these", "b": [0.2914, 0.3226, 0.3425, 0.3411]}, {"w": "two", "b": [0.3484, 0.3226, 0.3851, 0.3411]}, {"w": "quantities,", "b": [0.391, 0.3226, 0.4967, 0.3411]}, {"w": "as", "b": [0.5026, 0.3226, 0.5236, 0.3411]}, {"w": "Numpy", "b": [0.5295, 0.3226, 0.6042, 0.3411]}, {"w": "arrays,", "b": [0.6102, 0.3226, 0.6816, 0.3411]}, {"w": "given", "b": [0.6875, 0.3226, 0.7413, 0.3411]}, {"w": "the", "b": [0.7472, 0.3226, 0.7787, 0.3411]}, {"w": "sample", "b": [0.7846, 0.3226, 0.8555, 0.3411]}, {"w": "image", "b": [0.1761, 0.3418, 0.2364, 0.3603]}, {"w": "of", "b": [0.2423, 0.3418, 0.262, 0.3603]}, {"w": "two", "b": [0.2679, 0.3418, 0.3046, 0.3603]}, {"w": "elephants", "b": [0.3105, 0.3418, 0.4063, 0.3603]}, {"w": "7", "b": [0.1761, 0.361, 0.1879, 0.3795]}, {"w": "Multiplies", "b": [0.1938, 0.361, 0.2962, 0.3795]}, {"w": "each", "b": [0.3021, 0.361, 0.348, 0.3795]}, {"w": "channel", "b": [0.3539, 0.361, 0.4326, 0.3795]}, {"w": "in", "b": [0.4385, 0.361, 0.4582, 0.3795]}, {"w": "the", "b": [0.4641, 0.361, 0.4956, 0.3795]}, {"w": "feature-map", "b": [0.5015, 0.361, 0.6256, 0.3795]}, {"w": "array", "b": [0.6315, 0.361, 0.6879, 0.3795]}, {"w": "by", "b": [0.6938, 0.361, 0.7188, 0.3795]}, {"w": "“how", "b": [0.7247, 0.361, 0.7785, 0.3795]}, {"w": "important", "b": [0.1761, 0.3802, 0.2784, 0.3987]}, {"w": "this", "b": [0.2843, 0.3802, 0.3211, 0.3987]}, {"w": "channel", "b": [0.327, 0.3802, 0.4057, 0.3987]}, {"w": "is”", "b": [0.4116, 0.3802, 0.4392, 0.3987]}, {"w": "with", "b": [0.4451, 0.3802, 0.4897, 0.3987]}, {"w": "regard", "b": [0.4956, 0.3802, 0.5634, 0.3987]}, {"w": "to", "b": [0.5693, 0.3802, 0.5889, 0.3987]}, {"w": "the", "b": [0.5948, 0.3802, 0.6263, 0.3987]}, {"w": "“elephant”", "b": [0.6322, 0.3802, 0.7424, 0.3987]}, {"w": "class", "b": [0.7483, 0.3802, 0.7956, 0.3987]}, {"w": "8", "b": [0.1761, 0.3994, 0.1879, 0.4179]}, {"w": "The", "b": [0.1938, 0.3994, 0.2332, 0.4179]}, {"w": "channel-wise", "b": [0.2391, 0.3994, 0.369, 0.4179]}, {"w": "mean", "b": [0.3749, 0.3994, 0.43, 0.4179]}, {"w": "of", "b": [0.4359, 0.3994, 0.4555, 0.4179]}, {"w": "the", "b": [0.4614, 0.3994, 0.4929, 0.4179]}, {"w": "resulting", "b": [0.4988, 0.3994, 0.5876, 0.4179]}, {"w": "feature", "b": [0.5935, 0.3994, 0.6652, 0.4179]}, {"w": "map", "b": [0.6711, 0.3994, 0.7157, 0.4179]}, {"w": "is", "b": [0.7216, 0.3994, 0.7374, 0.4179]}, {"w": "the", "b": [0.7433, 0.3994, 0.7748, 0.4179]}, {"w": "heatmap", "b": [0.7807, 0.3994, 0.8686, 0.4179]}, {"w": "of", "b": [0.1761, 0.4186, 0.1958, 0.4371]}, {"w": "the", "b": [0.2017, 0.4186, 0.2332, 0.4371]}, {"w": "class", "b": [0.2391, 0.4186, 0.2863, 0.4371]}, {"w": "activation.", "b": [0.2922, 0.4186, 0.3978, 0.4371]}]}, {"id": "b_2", "type": "paragraph", "text": "For visualization purposes, you’ll also normalize the heatmap between 0 and 1. The result is shown in figure 5.35.", "words": [{"w": "For", "b": [0.1289, 0.4586, 0.1617, 0.4771]}, {"w": "visualization", "b": [0.1676, 0.4586, 0.2883, 0.4771]}, {"w": "purposes,", "b": [0.2942, 0.4586, 0.384, 0.4771]}, {"w": "you’ll", "b": [0.3899, 0.4586, 0.4464, 0.4771]}, {"w": "also", "b": [0.4523, 0.4586, 0.4903, 0.4771]}, {"w": "normalize", "b": [0.4962, 0.4586, 0.5906, 0.4771]}, {"w": "the", "b": [0.5965, 0.4586, 0.6254, 0.4771]}, {"w": "heatmap", "b": [0.6313, 0.4586, 0.7113, 0.4771]}, {"w": "between", "b": [0.7172, 0.4586, 0.7959, 0.4771]}, {"w": "0", "b": [0.8018, 0.4586, 0.8136, 0.4771]}, {"w": "and", "b": [0.8195, 0.4586, 0.8536, 0.4771]}, {"w": "1.", "b": [0.1289, 0.4778, 0.1466, 0.4963]}, {"w": "The", "b": [0.1525, 0.4778, 0.1892, 0.4963]}, {"w": "result", "b": [0.1951, 0.4778, 0.2476, 0.4963]}, {"w": "is", "b": [0.2535, 0.4778, 0.2692, 0.4963]}, {"w": "shown", "b": [0.2751, 0.4778, 0.3368, 0.4963]}, {"w": "in", "b": [0.3427, 0.4778, 0.3611, 0.4963]}, {"w": "figure", "b": [0.367, 0.4778, 0.4234, 0.4963]}, {"w": "5.35.", "b": [0.4293, 0.4778, 0.4765, 0.4963]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 5.35. African elephant class activation heatmap over the test picture", "words": [{"w": "Figure", "b": [0.1289, 0.5133, 0.1787, 0.5271]}, {"w": "5.35.", "b": [0.1832, 0.5133, 0.2186, 0.5271]}, {"w": "African", "b": [0.223, 0.5133, 0.281, 0.5271]}, {"w": "elephant", "b": [0.2855, 0.5133, 0.3504, 0.5271]}, {"w": "class", "b": [0.3548, 0.5133, 0.3902, 0.5271]}, {"w": "activation", "b": [0.3947, 0.5133, 0.4695, 0.5271]}, {"w": "heatmap", "b": [0.4739, 0.5133, 0.5398, 0.5271]}, {"w": "over", "b": [0.5442, 0.5133, 0.5777, 0.5271]}, {"w": "the", "b": [0.5821, 0.5133, 0.6057, 0.5271]}, {"w": "test", "b": [0.6101, 0.5133, 0.6367, 0.5271]}, {"w": "picture", "b": [0.6411, 0.5133, 0.6949, 0.5271]}]}, {"id": "b_4", "type": "equation", "text": "Listing 5.43. Heatmap post-processing", "words": [{"w": "Listing", "b": [0.1289, 0.7928, 0.182, 0.8066]}, {"w": "5.43.", "b": [0.1865, 0.7928, 0.2219, 0.8066]}, {"w": "Heatmap", "b": [0.2263, 0.7928, 0.2961, 0.8066]}, {"w": "post-processing", "b": [0.3006, 0.7928, 0.4173, 0.8066]}]}, {"id": "b_5", "type": "paragraph", "text": "heatmap = np.maximum(heatmap, 0) heatmap /= np.max(heatmap) plt.matshow(heatmap)", "words": [{"w": "heatmap", "b": [0.1348, 0.8194, 0.2092, 0.8336]}, {"w": "=", "b": [0.2198, 0.8194, 0.2304, 0.8336]}, {"w": "np.maximum(heatmap,", "b": [0.241, 0.8194, 0.443, 0.8336]}, {"w": "0)", "b": [0.4536, 0.8194, 0.4748, 0.8336]}, {"w": "heatmap", "b": [0.1348, 0.8336, 0.2092, 0.8477]}, {"w": "/=", "b": [0.2198, 0.8336, 0.241, 0.8477]}, {"w": "np.max(heatmap)", "b": [0.2517, 0.8336, 0.4111, 0.8477]}, {"w": "plt.matshow(heatmap)", "b": [0.1348, 0.8477, 0.3473, 0.8619]}]}]}, {"page": 236, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Finally, you’ll use OpenCV to generate an image that superimposes the original image on the heatmap you just obtained (see figure 5.36).", "words": [{"w": "Finally,", "b": [0.1289, 0.0857, 0.2002, 0.1041]}, {"w": "you’ll", "b": [0.2061, 0.0857, 0.2625, 0.1041]}, {"w": "use", "b": [0.2684, 0.0857, 0.2999, 0.1041]}, {"w": "OpenCV", "b": [0.3058, 0.0857, 0.3897, 0.1041]}, {"w": "to", "b": [0.3956, 0.0857, 0.414, 0.1041]}, {"w": "generate", "b": [0.4199, 0.0857, 0.4999, 0.1041]}, {"w": "an", "b": [0.5058, 0.0857, 0.5281, 0.1041]}, {"w": "image", "b": [0.534, 0.0857, 0.5917, 0.1041]}, {"w": "that", "b": [0.5976, 0.0857, 0.633, 0.1041]}, {"w": "superimposes", "b": [0.6389, 0.0857, 0.7675, 0.1041]}, {"w": "the", "b": [0.7734, 0.0857, 0.8022, 0.1041]}, {"w": "original", "b": [0.1289, 0.1049, 0.2023, 0.1233]}, {"w": "image", "b": [0.2082, 0.1049, 0.266, 0.1233]}, {"w": "on", "b": [0.2719, 0.1049, 0.2955, 0.1233]}, {"w": "the", "b": [0.3014, 0.1049, 0.3302, 0.1233]}, {"w": "heatmap", "b": [0.3361, 0.1049, 0.4161, 0.1233]}, {"w": "you", "b": [0.4221, 0.1049, 0.4575, 0.1233]}, {"w": "just", "b": [0.4634, 0.1049, 0.4975, 0.1233]}, {"w": "obtained", "b": [0.5034, 0.1049, 0.5847, 0.1233]}, {"w": "(see", "b": [0.5906, 0.1049, 0.6287, 0.1233]}, {"w": "figure", "b": [0.6345, 0.1049, 0.6909, 0.1233]}, {"w": "5.36).", "b": [0.6968, 0.1049, 0.7518, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.36. Superimposing the class activation heatmap on the original picture", "words": [{"w": "Figure", "b": [0.1289, 0.1403, 0.1787, 0.1541]}, {"w": "5.36.", "b": [0.1832, 0.1403, 0.2186, 0.1541]}, {"w": "Superimposing", "b": [0.223, 0.1403, 0.3372, 0.1541]}, {"w": "the", "b": [0.3416, 0.1403, 0.3652, 0.1541]}, {"w": "class", "b": [0.3696, 0.1403, 0.405, 0.1541]}, {"w": "activation", "b": [0.4095, 0.1403, 0.4842, 0.1541]}, {"w": "heatmap", "b": [0.4887, 0.1403, 0.5546, 0.1541]}, {"w": "on", "b": [0.559, 0.1403, 0.5777, 0.1541]}, {"w": "the", "b": [0.5821, 0.1403, 0.6058, 0.1541]}, {"w": "original", "b": [0.6102, 0.1403, 0.6692, 0.1541]}, {"w": "picture", "b": [0.6737, 0.1403, 0.7274, 0.1541]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.44. Superimposing the heatmap with the original picture", "words": [{"w": "Listing", "b": [0.1289, 0.4415, 0.182, 0.4554]}, {"w": "5.44.", "b": [0.1865, 0.4415, 0.2219, 0.4554]}, {"w": "Superimposing", "b": [0.2263, 0.4415, 0.3405, 0.4554]}, {"w": "the", "b": [0.3449, 0.4415, 0.3685, 0.4554]}, {"w": "heatmap", "b": [0.3729, 0.4415, 0.4388, 0.4554]}, {"w": "with", "b": [0.4433, 0.4415, 0.4767, 0.4554]}, {"w": "the", "b": [0.4811, 0.4415, 0.5048, 0.4554]}, {"w": "original", "b": [0.5092, 0.4415, 0.5682, 0.4554]}, {"w": "picture", "b": [0.5727, 0.4415, 0.6264, 0.4554]}]}, {"id": "b_3", "type": "paragraph", "text": "import cv2 img = cv2.imread(img_path) 1 heatmap = cv2.resize(heatmap, (img.shape[1], img.shape[0])) 2 heatmap = np.uint8(255 * heatmap) 3 heatmap = cv2.applyColorMap(heatmap, cv2.COLORMAP_JET) 4 superimposed_img = heatmap * 0.4 + img 5 cv2.imwrite('/Users/fchollet/Downloads/elephant_cam.jpg', superimposed_img)6", "words": [{"w": "import", "b": [0.1348, 0.4681, 0.1985, 0.4823]}, {"w": "cv2", "b": [0.2092, 0.4681, 0.241, 0.4823]}, {"w": "img", "b": [0.1348, 0.4965, 0.1667, 0.5106]}, {"w": "=", "b": [0.1773, 0.4965, 0.1879, 0.5106]}, {"w": "cv2.imread(img_path)", "b": [0.1985, 0.4965, 0.4111, 0.5106]}, {"w": "1", "b": [0.1348, 0.5107, 0.1454, 0.5248]}, {"w": "heatmap", "b": [0.1348, 0.539, 0.2092, 0.5532]}, {"w": "=", "b": [0.2198, 0.539, 0.2304, 0.5532]}, {"w": "cv2.resize(heatmap,", "b": [0.241, 0.539, 0.443, 0.5532]}, {"w": "(img.shape[1],", "b": [0.4536, 0.539, 0.6024, 0.5532]}, {"w": "img.shape[0]))", "b": [0.613, 0.539, 0.7618, 0.5532]}, {"w": "2", "b": [0.1348, 0.5532, 0.1454, 0.5674]}, {"w": "heatmap", "b": [0.1348, 0.5816, 0.2092, 0.5958]}, {"w": "=", "b": [0.2198, 0.5816, 0.2304, 0.5958]}, {"w": "np.uint8(255", "b": [0.241, 0.5816, 0.3686, 0.5958]}, {"w": "*", "b": [0.3792, 0.5816, 0.3898, 0.5958]}, {"w": "heatmap)", "b": [0.4004, 0.5816, 0.4855, 0.5958]}, {"w": "3", "b": [0.1348, 0.5958, 0.1454, 0.6099]}, {"w": "heatmap", "b": [0.1348, 0.6241, 0.2092, 0.6383]}, {"w": "=", "b": [0.2198, 0.6241, 0.2304, 0.6383]}, {"w": "cv2.applyColorMap(heatmap,", "b": [0.241, 0.6241, 0.5173, 0.6383]}, {"w": "cv2.COLORMAP_JET)", "b": [0.528, 0.6241, 0.7086, 0.6383]}, {"w": "4", "b": [0.1348, 0.6383, 0.1454, 0.6525]}, {"w": "superimposed_img", "b": [0.1348, 0.6667, 0.3048, 0.6809]}, {"w": "=", "b": [0.3154, 0.6667, 0.3261, 0.6809]}, {"w": "heatmap", "b": [0.3367, 0.6667, 0.4111, 0.6809]}, {"w": "*", "b": [0.4217, 0.6667, 0.4323, 0.6809]}, {"w": "0.4", "b": [0.443, 0.6667, 0.4748, 0.6809]}, {"w": "+", "b": [0.4855, 0.6667, 0.4961, 0.6809]}, {"w": "img", "b": [0.5067, 0.6667, 0.5386, 0.6809]}, {"w": "5", "b": [0.1348, 0.6809, 0.1454, 0.695]}, {"w": "cv2.imwrite('/Users/fchollet/Downloads/elephant_cam.jpg',", "b": [0.1348, 0.7092, 0.7405, 0.7234]}, {"w": "superimposed_img)6", "b": [0.1348, 0.7234, 0.3261, 0.7376]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Uses cv2 to load the original image 2 Resizes the heatmap to be the same size as the original image 3 Converts the heatmap to RGB 4 Applies the heatmap to the original image 5 0.4 here is a heatmap intensity factor. 6 Saves the image to disk", "words": [{"w": "1", "b": [0.1761, 0.7548, 0.1879, 0.7733]}, {"w": "Uses", "b": [0.1938, 0.7548, 0.2397, 0.7733]}, {"w": "cv2", "b": [0.2456, 0.7548, 0.2797, 0.7733]}, {"w": "to", "b": [0.2856, 0.7548, 0.3053, 0.7733]}, {"w": "load", "b": [0.3112, 0.7548, 0.3545, 0.7733]}, {"w": "the", "b": [0.3604, 0.7548, 0.3919, 0.7733]}, {"w": "original", "b": [0.3978, 0.7548, 0.4765, 0.7733]}, {"w": "image", "b": [0.4824, 0.7548, 0.5428, 0.7733]}, {"w": "2", "b": [0.1761, 0.774, 0.1879, 0.7925]}, {"w": "Resizes", "b": [0.1938, 0.774, 0.2673, 0.7925]}, {"w": "the", "b": [0.2732, 0.774, 0.3046, 0.7925]}, {"w": "heatmap", "b": [0.3105, 0.774, 0.3984, 0.7925]}, {"w": "to", "b": [0.4043, 0.774, 0.424, 0.7925]}, {"w": "be", "b": [0.4299, 0.774, 0.4535, 0.7925]}, {"w": "the", "b": [0.4594, 0.774, 0.4909, 0.7925]}, {"w": "same", "b": [0.4968, 0.774, 0.548, 0.7925]}, {"w": "size", "b": [0.5539, 0.774, 0.5906, 0.7925]}, {"w": "as", "b": [0.5965, 0.774, 0.6175, 0.7925]}, {"w": "the", "b": [0.6234, 0.774, 0.6549, 0.7925]}, {"w": "original", "b": [0.6608, 0.774, 0.7395, 0.7925]}, {"w": "image", "b": [0.7454, 0.774, 0.8057, 0.7925]}, {"w": "3", "b": [0.1761, 0.7932, 0.1879, 0.8117]}, {"w": "Converts", "b": [0.1938, 0.7932, 0.2856, 0.8117]}, {"w": "the", "b": [0.2915, 0.7932, 0.323, 0.8117]}, {"w": "heatmap", "b": [0.3289, 0.7932, 0.4168, 0.8117]}, {"w": "to", "b": [0.4227, 0.7932, 0.4424, 0.8117]}, {"w": "RGB", "b": [0.4483, 0.7932, 0.4995, 0.8117]}, {"w": "4", "b": [0.1761, 0.8124, 0.1879, 0.8309]}, {"w": "Applies", "b": [0.1938, 0.8124, 0.2699, 0.8309]}, {"w": "the", "b": [0.2758, 0.8124, 0.3073, 0.8309]}, {"w": "heatmap", "b": [0.3132, 0.8124, 0.4011, 0.8309]}, {"w": "to", "b": [0.407, 0.8124, 0.4267, 0.8309]}, {"w": "the", "b": [0.4326, 0.8124, 0.4641, 0.8309]}, {"w": "original", "b": [0.47, 0.8124, 0.5487, 0.8309]}, {"w": "image", "b": [0.5546, 0.8124, 0.6149, 0.8309]}, {"w": "5", "b": [0.1761, 0.8316, 0.1879, 0.8501]}, {"w": "0.4", "b": [0.1938, 0.8316, 0.2233, 0.8501]}, {"w": "here", "b": [0.2292, 0.8316, 0.2734, 0.8501]}, {"w": "is", "b": [0.2793, 0.8316, 0.295, 0.8501]}, {"w": "a", "b": [0.301, 0.8316, 0.3128, 0.8501]}, {"w": "heatmap", "b": [0.3187, 0.8316, 0.4066, 0.8501]}, {"w": "intensity", "b": [0.4125, 0.8316, 0.4991, 0.8501]}, {"w": "factor.", "b": [0.505, 0.8316, 0.569, 0.8501]}, {"w": "6", "b": [0.1761, 0.8508, 0.1879, 0.8693]}, {"w": "Saves", "b": [0.1938, 0.8508, 0.2502, 0.8693]}, {"w": "the", "b": [0.2561, 0.8508, 0.2876, 0.8693]}, {"w": "image", "b": [0.2935, 0.8508, 0.3539, 0.8693]}, {"w": "to", "b": [0.3598, 0.8508, 0.3794, 0.8693]}, {"w": "disk", "b": [0.3853, 0.8508, 0.4273, 0.8693]}]}, {"id": "b_5", "type": "paragraph", "text": "This visualization technique answers two important questions:", "words": [{"w": "This", "b": [0.1289, 0.8909, 0.1709, 0.9093]}, {"w": "visualization", "b": [0.1768, 0.8909, 0.2975, 0.9093]}, {"w": "technique", "b": [0.3034, 0.8909, 0.3952, 0.9093]}, {"w": "answers", "b": [0.4011, 0.8909, 0.4771, 0.9093]}, {"w": "two", "b": [0.4831, 0.8909, 0.5185, 0.9093]}, {"w": "important", "b": [0.5244, 0.8909, 0.6162, 0.9093]}, {"w": "questions:", "b": [0.6221, 0.8909, 0.7179, 0.9093]}]}]}, {"page": 237, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Why did the network think this image contained an African elephant? Where is the African elephant located in the picture?", "words": [{"w": "Why", "b": [0.1761, 0.0857, 0.222, 0.1041]}, {"w": "did", "b": [0.2279, 0.0857, 0.2581, 0.1041]}, {"w": "the", "b": [0.264, 0.0857, 0.2929, 0.1041]}, {"w": "network", "b": [0.2988, 0.0857, 0.3761, 0.1041]}, {"w": "think", "b": [0.382, 0.0857, 0.4306, 0.1041]}, {"w": "this", "b": [0.4365, 0.0857, 0.4706, 0.1041]}, {"w": "image", "b": [0.4765, 0.0857, 0.5342, 0.1041]}, {"w": "contained", "b": [0.5402, 0.0857, 0.632, 0.1041]}, {"w": "an", "b": [0.6379, 0.0857, 0.6602, 0.1041]}, {"w": "African", "b": [0.6661, 0.0857, 0.7382, 0.1041]}, {"w": "elephant?", "b": [0.7441, 0.0857, 0.8346, 0.1041]}, {"w": "Where", "b": [0.1761, 0.1049, 0.239, 0.1233]}, {"w": "is", "b": [0.2449, 0.1049, 0.2607, 0.1233]}, {"w": "the", "b": [0.2666, 0.1049, 0.2955, 0.1233]}, {"w": "African", "b": [0.3014, 0.1049, 0.3735, 0.1233]}, {"w": "elephant", "b": [0.3794, 0.1049, 0.4594, 0.1233]}, {"w": "located", "b": [0.4653, 0.1049, 0.5335, 0.1233]}, {"w": "in", "b": [0.5394, 0.1049, 0.5578, 0.1233]}, {"w": "the", "b": [0.5637, 0.1049, 0.5925, 0.1233]}, {"w": "picture?", "b": [0.5984, 0.1049, 0.6745, 0.1233]}]}, {"id": "b_1", "type": "paragraph", "text": "In particular, it’s interesting to note that the ears of the elephant calf are strongly activated: this is probably how the network can tell the difference between African and Indian elephants.", "words": [{"w": "In", "b": [0.1289, 0.1449, 0.1485, 0.1634]}, {"w": "particular,", "b": [0.1545, 0.1449, 0.2499, 0.1634]}, {"w": "it’s", "b": [0.2558, 0.1449, 0.2847, 0.1634]}, {"w": "interesting", "b": [0.2906, 0.1449, 0.3903, 0.1634]}, {"w": "to", "b": [0.3962, 0.1449, 0.4145, 0.1634]}, {"w": "note", "b": [0.4204, 0.1449, 0.4611, 0.1634]}, {"w": "that", "b": [0.467, 0.1449, 0.5024, 0.1634]}, {"w": "the", "b": [0.5083, 0.1449, 0.5372, 0.1634]}, {"w": "ears", "b": [0.5431, 0.1449, 0.5811, 0.1634]}, {"w": "of", "b": [0.587, 0.1449, 0.6067, 0.1634]}, {"w": "the", "b": [0.6126, 0.1449, 0.6414, 0.1634]}, {"w": "elephant", "b": [0.6474, 0.1449, 0.7274, 0.1634]}, {"w": "calf", "b": [0.7333, 0.1449, 0.7687, 0.1634]}, {"w": "are", "b": [0.7746, 0.1449, 0.8034, 0.1634]}, {"w": "strongly", "b": [0.1289, 0.1641, 0.2063, 0.1826]}, {"w": "activated:", "b": [0.2122, 0.1641, 0.304, 0.1826]}, {"w": "this", "b": [0.3099, 0.1641, 0.344, 0.1826]}, {"w": "is", "b": [0.3499, 0.1641, 0.3657, 0.1826]}, {"w": "probably", "b": [0.3716, 0.1641, 0.4555, 0.1826]}, {"w": "how", "b": [0.4614, 0.1641, 0.5021, 0.1826]}, {"w": "the", "b": [0.508, 0.1641, 0.5369, 0.1826]}, {"w": "network", "b": [0.5427, 0.1641, 0.6201, 0.1826]}, {"w": "can", "b": [0.626, 0.1641, 0.6588, 0.1826]}, {"w": "tell", "b": [0.6647, 0.1641, 0.6949, 0.1826]}, {"w": "the", "b": [0.7008, 0.1641, 0.7296, 0.1826]}, {"w": "difference", "b": [0.7355, 0.1641, 0.8308, 0.1826]}, {"w": "between", "b": [0.1289, 0.1833, 0.2076, 0.2018]}, {"w": "African", "b": [0.2135, 0.1833, 0.2856, 0.2018]}, {"w": "and", "b": [0.2915, 0.1833, 0.3256, 0.2018]}, {"w": "Indian", "b": [0.3315, 0.1833, 0.3918, 0.2018]}, {"w": "elephants.", "b": [0.3977, 0.1833, 0.4928, 0.2018]}]}, {"id": "b_2", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1289, 0.2317, 0.2128, 0.2502]}, {"w": "summary", "b": [0.2187, 0.2317, 0.3145, 0.2502]}]}, {"id": "b_3", "type": "paragraph", "text": "Convnets are the best tool for attacking visual-classification problems. Convnets work by learning a hierarchy of modular patterns and concepts to represent the visual world. The representations they learn are easy to inspect—convnets are the opposite of black boxes! You’re now capable of training your own convnet from scratch to solve an image-classification problem. You understand how to use visual data augmentation to fight overfitting. You know how to use a pretrained convnet to do feature extraction and fine-tuning. You can generate visualizations of the filters learned by your convnets, as well as heatmaps of class activity.", "words": [{"w": "Convnets", "b": [0.1761, 0.2676, 0.2653, 0.286]}, {"w": "are", "b": [0.2712, 0.2676, 0.3001, 0.286]}, {"w": "the", "b": [0.306, 0.2676, 0.3348, 0.286]}, {"w": "best", "b": [0.3407, 0.2676, 0.3788, 0.286]}, {"w": "tool", "b": [0.3847, 0.2676, 0.4214, 0.286]}, {"w": "for", "b": [0.4273, 0.2676, 0.4549, 0.286]}, {"w": "attacking", "b": [0.4608, 0.2676, 0.5473, 0.286]}, {"w": "visual-classification", "b": [0.5532, 0.2676, 0.7421, 0.286]}, {"w": "problems.", "b": [0.748, 0.2676, 0.8418, 0.286]}, {"w": "Convnets", "b": [0.1761, 0.2868, 0.2653, 0.3052]}, {"w": "work", "b": [0.2712, 0.2868, 0.3198, 0.3052]}, {"w": "by", "b": [0.3257, 0.2868, 0.3493, 0.3052]}, {"w": "learning", "b": [0.3552, 0.2868, 0.4326, 0.3052]}, {"w": "a", "b": [0.4385, 0.2868, 0.449, 0.3052]}, {"w": "hierarchy", "b": [0.4549, 0.2868, 0.544, 0.3052]}, {"w": "of", "b": [0.5499, 0.2868, 0.5696, 0.3052]}, {"w": "modular", "b": [0.5755, 0.2868, 0.6542, 0.3052]}, {"w": "patterns", "b": [0.6601, 0.2868, 0.7349, 0.3052]}, {"w": "and", "b": [0.7408, 0.2868, 0.7749, 0.3052]}, {"w": "concepts", "b": [0.7808, 0.2868, 0.8634, 0.3052]}, {"w": "to", "b": [0.1761, 0.3059, 0.1945, 0.3244]}, {"w": "represent", "b": [0.2004, 0.3059, 0.2869, 0.3244]}, {"w": "the", "b": [0.2928, 0.3059, 0.3217, 0.3244]}, {"w": "visual", "b": [0.3276, 0.3059, 0.384, 0.3244]}, {"w": "world.", "b": [0.3899, 0.3059, 0.4509, 0.3244]}, {"w": "The", "b": [0.1761, 0.3251, 0.2128, 0.3436]}, {"w": "representations", "b": [0.2187, 0.3251, 0.3617, 0.3436]}, {"w": "they", "b": [0.3676, 0.3251, 0.4083, 0.3436]}, {"w": "learn", "b": [0.4142, 0.3251, 0.4614, 0.3436]}, {"w": "are", "b": [0.4673, 0.3251, 0.4961, 0.3436]}, {"w": "easy", "b": [0.502, 0.3251, 0.544, 0.3436]}, {"w": "to", "b": [0.5499, 0.3251, 0.5683, 0.3436]}, {"w": "inspect—convnets", "b": [0.5742, 0.3251, 0.7486, 0.3436]}, {"w": "are", "b": [0.7545, 0.3251, 0.7834, 0.3436]}, {"w": "the", "b": [0.7893, 0.3251, 0.8181, 0.3436]}, {"w": "opposite", "b": [0.1761, 0.3443, 0.2561, 0.3628]}, {"w": "of", "b": [0.262, 0.3443, 0.2817, 0.3628]}, {"w": "black", "b": [0.2876, 0.3443, 0.3388, 0.3628]}, {"w": "boxes!", "b": [0.3447, 0.3443, 0.4076, 0.3628]}, {"w": "You’re", "b": [0.1761, 0.3635, 0.2406, 0.382]}, {"w": "now", "b": [0.2465, 0.3635, 0.2872, 0.382]}, {"w": "capable", "b": [0.2931, 0.3635, 0.3652, 0.382]}, {"w": "of", "b": [0.3711, 0.3635, 0.3908, 0.382]}, {"w": "training", "b": [0.3967, 0.3635, 0.4702, 0.382]}, {"w": "your", "b": [0.4761, 0.3635, 0.5193, 0.382]}, {"w": "own", "b": [0.5253, 0.3635, 0.5659, 0.382]}, {"w": "convnet", "b": [0.5718, 0.3635, 0.6466, 0.382]}, {"w": "from", "b": [0.6525, 0.3635, 0.6984, 0.382]}, {"w": "scratch", "b": [0.7043, 0.3635, 0.7712, 0.382]}, {"w": "to", "b": [0.7771, 0.3635, 0.7955, 0.382]}, {"w": "solve", "b": [0.8014, 0.3635, 0.8512, 0.382]}, {"w": "an", "b": [0.1761, 0.3827, 0.1984, 0.4012]}, {"w": "image-classification", "b": [0.2043, 0.3827, 0.3945, 0.4012]}, {"w": "problem.", "b": [0.4004, 0.3827, 0.485, 0.4012]}, {"w": "You", "b": [0.1761, 0.4019, 0.2144, 0.4204]}, {"w": "understand", "b": [0.2203, 0.4019, 0.3239, 0.4204]}, {"w": "how", "b": [0.3298, 0.4019, 0.3705, 0.4204]}, {"w": "to", "b": [0.3764, 0.4019, 0.3948, 0.4204]}, {"w": "use", "b": [0.4007, 0.4019, 0.4322, 0.4204]}, {"w": "visual", "b": [0.4381, 0.4019, 0.4945, 0.4204]}, {"w": "data", "b": [0.5004, 0.4019, 0.5397, 0.4204]}, {"w": "augmentation", "b": [0.5456, 0.4019, 0.6742, 0.4204]}, {"w": "to", "b": [0.6801, 0.4019, 0.6985, 0.4204]}, {"w": "fight", "b": [0.7044, 0.4019, 0.749, 0.4204]}, {"w": "overfitting.", "b": [0.7549, 0.4019, 0.8605, 0.4204]}, {"w": "You", "b": [0.1761, 0.4211, 0.2144, 0.4396]}, {"w": "know", "b": [0.2203, 0.4211, 0.2728, 0.4396]}, {"w": "how", "b": [0.2787, 0.4211, 0.3194, 0.4396]}, {"w": "to", "b": [0.3253, 0.4211, 0.3436, 0.4396]}, {"w": "use", "b": [0.3495, 0.4211, 0.381, 0.4396]}, {"w": "a", "b": [0.3869, 0.4211, 0.3974, 0.4396]}, {"w": "pretrained", "b": [0.4033, 0.4211, 0.499, 0.4396]}, {"w": "convnet", "b": [0.5049, 0.4211, 0.5797, 0.4396]}, {"w": "to", "b": [0.5856, 0.4211, 0.604, 0.4396]}, {"w": "do", "b": [0.6099, 0.4211, 0.6335, 0.4396]}, {"w": "feature", "b": [0.6394, 0.4211, 0.705, 0.4396]}, {"w": "extraction", "b": [0.7109, 0.4211, 0.8053, 0.4396]}, {"w": "and", "b": [0.8112, 0.4211, 0.8453, 0.4396]}, {"w": "fine-tuning.", "b": [0.1761, 0.4403, 0.287, 0.4588]}, {"w": "You", "b": [0.1761, 0.4595, 0.2144, 0.478]}, {"w": "can", "b": [0.2203, 0.4595, 0.2531, 0.478]}, {"w": "generate", "b": [0.259, 0.4595, 0.339, 0.478]}, {"w": "visualizations", "b": [0.3449, 0.4595, 0.4748, 0.478]}, {"w": "of", "b": [0.4807, 0.4595, 0.5003, 0.478]}, {"w": "the", "b": [0.5062, 0.4595, 0.5351, 0.478]}, {"w": "filters", "b": [0.541, 0.4595, 0.5961, 0.478]}, {"w": "learned", "b": [0.602, 0.4595, 0.6715, 0.478]}, {"w": "by", "b": [0.6774, 0.4595, 0.701, 0.478]}, {"w": "your", "b": [0.7069, 0.4595, 0.7502, 0.478]}, {"w": "convnets,", "b": [0.7561, 0.4595, 0.846, 0.478]}, {"w": "as", "b": [0.1761, 0.4787, 0.1958, 0.4971]}, {"w": "well", "b": [0.2017, 0.4787, 0.2423, 0.4971]}, {"w": "as", "b": [0.2482, 0.4787, 0.2679, 0.4971]}, {"w": "heatmaps", "b": [0.2738, 0.4787, 0.363, 0.4971]}, {"w": "of", "b": [0.3689, 0.4787, 0.3886, 0.4971]}, {"w": "class", "b": [0.3945, 0.4787, 0.4404, 0.4971]}, {"w": "activity.", "b": [0.4463, 0.4787, 0.5215, 0.4971]}]}]}, {"page": 238, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 6. Deep learning for text and sequences", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "6.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Deep", "b": [0.3011, 0.1076, 0.3785, 0.1355]}, {"w": "learning", "b": [0.3874, 0.1076, 0.5145, 0.1355]}, {"w": "for", "b": [0.5234, 0.1076, 0.569, 0.1355]}, {"w": "text", "b": [0.5779, 0.1076, 0.6355, 0.1355]}, {"w": "and", "b": [0.6444, 0.1076, 0.702, 0.1355]}, {"w": "sequences", "b": [0.7109, 0.1076, 0.8618, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1729, 0.1785]}, {"w": "chapter", "b": [0.1792, 0.1588, 0.2562, 0.1785]}, {"w": "covers", "b": [0.2626, 0.1588, 0.3284, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Preprocessing text data into useful representations Working with recurrent neural networks Using 1D convnets for sequence processing", "words": [{"w": "Preprocessing", "b": [0.1799, 0.1971, 0.3214, 0.2168]}, {"w": "text", "b": [0.3277, 0.1971, 0.3655, 0.2168]}, {"w": "data", "b": [0.3718, 0.1971, 0.4139, 0.2168]}, {"w": "into", "b": [0.4202, 0.1971, 0.4594, 0.2168]}, {"w": "useful", "b": [0.4657, 0.1971, 0.5274, 0.2168]}, {"w": "representations", "b": [0.5337, 0.1971, 0.6864, 0.2168]}, {"w": "Working", "b": [0.1799, 0.2176, 0.2675, 0.2373]}, {"w": "with", "b": [0.2738, 0.2176, 0.3187, 0.2373]}, {"w": "recurrent", "b": [0.325, 0.2176, 0.416, 0.2373]}, {"w": "neural", "b": [0.4223, 0.2176, 0.4854, 0.2373]}, {"w": "networks", "b": [0.4917, 0.2176, 0.5842, 0.2373]}, {"w": "Using", "b": [0.1799, 0.2381, 0.2401, 0.2578]}, {"w": "1D", "b": [0.2464, 0.2381, 0.2773, 0.2578]}, {"w": "convnets", "b": [0.2836, 0.2381, 0.3732, 0.2578]}, {"w": "for", "b": [0.3796, 0.2381, 0.409, 0.2578]}, {"w": "sequence", "b": [0.4153, 0.2381, 0.5077, 0.2578]}, {"w": "processing", "b": [0.514, 0.2381, 0.6219, 0.2578]}]}, {"id": "b_3", "type": "paragraph", "text": "This chapter explores deep-learning models that can process text (understood as sequences of word or sequences of characters), timeseries, and sequence data in general. The two fundamental deep- learning algorithms for sequence processing are recurrent neural networks and 1D convnets, the one-dimensional version of the 2D convnets that we covered in the previous chapters. We’ll discuss both of these approaches in this chapter.", "words": [{"w": "This", "b": [0.1294, 0.2809, 0.1743, 0.3006]}, {"w": "chapter", "b": [0.1806, 0.2809, 0.2548, 0.3006]}, {"w": "explores", "b": [0.2611, 0.2809, 0.3466, 0.3006]}, {"w": "deep-learning", "b": [0.3529, 0.2809, 0.4916, 0.3006]}, {"w": "models", "b": [0.4979, 0.2809, 0.5708, 0.3006]}, {"w": "that", "b": [0.5771, 0.2809, 0.6149, 0.3006]}, {"w": "can", "b": [0.6212, 0.2809, 0.6562, 0.3006]}, {"w": "process", "b": [0.6625, 0.2809, 0.7382, 0.3006]}, {"w": "text", "b": [0.7445, 0.2809, 0.7823, 0.3006]}, {"w": "(understood", "b": [0.1294, 0.3014, 0.2499, 0.3211]}, {"w": "as", "b": [0.2562, 0.3014, 0.2772, 0.3211]}, {"w": "sequences", "b": [0.2835, 0.3014, 0.3858, 0.3211]}, {"w": "of", "b": [0.3921, 0.3014, 0.4131, 0.3211]}, {"w": "word", "b": [0.4194, 0.3014, 0.4713, 0.3211]}, {"w": "or", "b": [0.4776, 0.3014, 0.4986, 0.3211]}, {"w": "sequences", "b": [0.5049, 0.3014, 0.6072, 0.3211]}, {"w": "of", "b": [0.6135, 0.3014, 0.6345, 0.3211]}, {"w": "characters),", "b": [0.6408, 0.3014, 0.7577, 0.3211]}, {"w": "timeseries,", "b": [0.1294, 0.3219, 0.238, 0.3416]}, {"w": "and", "b": [0.2443, 0.3219, 0.2807, 0.3416]}, {"w": "sequence", "b": [0.287, 0.3219, 0.3795, 0.3416]}, {"w": "data", "b": [0.3858, 0.3219, 0.4278, 0.3416]}, {"w": "in", "b": [0.4341, 0.3219, 0.4538, 0.3416]}, {"w": "general.", "b": [0.4601, 0.3219, 0.5406, 0.3416]}, {"w": "The", "b": [0.5469, 0.3219, 0.5861, 0.3416]}, {"w": "two", "b": [0.5925, 0.3219, 0.6303, 0.3416]}, {"w": "fundamental", "b": [0.6366, 0.3219, 0.7627, 0.3416]}, {"w": "deep-", "b": [0.769, 0.3219, 0.825, 0.3416]}, {"w": "learning", "b": [0.1294, 0.3424, 0.2121, 0.3621]}, {"w": "algorithms", "b": [0.2184, 0.3424, 0.3263, 0.3621]}, {"w": "for", "b": [0.3326, 0.3424, 0.362, 0.3621]}, {"w": "sequence", "b": [0.3683, 0.3424, 0.4608, 0.3621]}, {"w": "processing", "b": [0.4671, 0.3424, 0.575, 0.3621]}, {"w": "are", "b": [0.5813, 0.3424, 0.6121, 0.3621]}, {"w": "recurrent", "b": [0.6183, 0.3424, 0.7117, 0.3621]}, {"w": "neural", "b": [0.718, 0.3424, 0.7839, 0.3621]}, {"w": "networks", "b": [0.1294, 0.3629, 0.2205, 0.3826]}, {"w": "and", "b": [0.2268, 0.3629, 0.2632, 0.3826]}, {"w": "1D", "b": [0.2695, 0.3629, 0.3003, 0.3826]}, {"w": "convnets,", "b": [0.3066, 0.3629, 0.4012, 0.3826]}, {"w": "the", "b": [0.4075, 0.3629, 0.4383, 0.3826]}, {"w": "one-dimensional", "b": [0.4446, 0.3629, 0.6128, 0.3826]}, {"w": "version", "b": [0.6191, 0.3629, 0.6934, 0.3826]}, {"w": "of", "b": [0.6997, 0.3629, 0.7207, 0.3826]}, {"w": "the", "b": [0.727, 0.3629, 0.7578, 0.3826]}, {"w": "2D", "b": [0.7641, 0.3629, 0.7949, 0.3826]}, {"w": "convnets", "b": [0.1294, 0.3834, 0.2191, 0.4031]}, {"w": "that", "b": [0.2254, 0.3834, 0.2632, 0.4031]}, {"w": "we", "b": [0.2695, 0.3834, 0.299, 0.4031]}, {"w": "covered", "b": [0.3053, 0.3834, 0.3851, 0.4031]}, {"w": "in", "b": [0.3914, 0.3834, 0.411, 0.4031]}, {"w": "the", "b": [0.4173, 0.3834, 0.4482, 0.4031]}, {"w": "previous", "b": [0.4545, 0.3834, 0.5413, 0.4031]}, {"w": "chapters.", "b": [0.5477, 0.3834, 0.638, 0.4031]}, {"w": "We’ll", "b": [0.6443, 0.3834, 0.6997, 0.4031]}, {"w": "discuss", "b": [0.706, 0.3834, 0.7789, 0.4031]}, {"w": "both", "b": [0.7852, 0.3834, 0.83, 0.4031]}, {"w": "of", "b": [0.8363, 0.3834, 0.8573, 0.4031]}, {"w": "these", "b": [0.1294, 0.4039, 0.1813, 0.4236]}, {"w": "approaches", "b": [0.1876, 0.4039, 0.301, 0.4236]}, {"w": "in", "b": [0.3073, 0.4039, 0.3269, 0.4236]}, {"w": "this", "b": [0.3332, 0.4039, 0.3697, 0.4236]}, {"w": "chapter.", "b": [0.376, 0.4039, 0.4551, 0.4236]}]}, {"id": "b_4", "type": "paragraph", "text": "Applications of these algorithms include the following:", "words": [{"w": "Applications", "b": [0.1294, 0.4467, 0.2583, 0.4664]}, {"w": "of", "b": [0.2646, 0.4467, 0.2857, 0.4664]}, {"w": "these", "b": [0.292, 0.4467, 0.3438, 0.4664]}, {"w": "algorithms", "b": [0.3501, 0.4467, 0.458, 0.4664]}, {"w": "include", "b": [0.4643, 0.4467, 0.5386, 0.4664]}, {"w": "the", "b": [0.5449, 0.4467, 0.5757, 0.4664]}, {"w": "following:", "b": [0.582, 0.4467, 0.6872, 0.4664]}]}, {"id": "b_5", "type": "paragraph", "text": "Document classification and timeseries classification, such as identifying the topic of an article or the author of a book Timeseries comparisons, such as estimating how closely related two documents or two stock tickers are Sequence-to-sequence learning, such as decoding an English sentence into French Sentiment analysis, such as classifying the sentiment of tweets or movie reviews as positive or negative Timeseries forecasting, such as predicting the future weather at a certain location, given recent weather data", "words": [{"w": "Document", "b": [0.1799, 0.485, 0.285, 0.5047]}, {"w": "classification", "b": [0.2913, 0.485, 0.4244, 0.5047]}, {"w": "and", "b": [0.4307, 0.485, 0.4671, 0.5047]}, {"w": "timeseries", "b": [0.4734, 0.485, 0.5757, 0.5047]}, {"w": "classification,", "b": [0.582, 0.485, 0.7214, 0.5047]}, {"w": "such", "b": [0.7277, 0.485, 0.774, 0.5047]}, {"w": "as", "b": [0.7803, 0.485, 0.8013, 0.5047]}, {"w": "identifying", "b": [0.1799, 0.5055, 0.2906, 0.5252]}, {"w": "the", "b": [0.2969, 0.5055, 0.3277, 0.5252]}, {"w": "topic", "b": [0.334, 0.5055, 0.3845, 0.5252]}, {"w": "of", "b": [0.3908, 0.5055, 0.4118, 0.5252]}, {"w": "an", "b": [0.4181, 0.5055, 0.4419, 0.5252]}, {"w": "article", "b": [0.4482, 0.5055, 0.5113, 0.5252]}, {"w": "or", "b": [0.5176, 0.5055, 0.5386, 0.5252]}, {"w": "the", "b": [0.5449, 0.5055, 0.5757, 0.5252]}, {"w": "author", "b": [0.582, 0.5055, 0.6465, 0.5252]}, {"w": "of", "b": [0.6528, 0.5055, 0.6738, 0.5252]}, {"w": "a", "b": [0.6801, 0.5055, 0.6913, 0.5252]}, {"w": "book", "b": [0.6976, 0.5055, 0.748, 0.5252]}, {"w": "Timeseries", "b": [0.1799, 0.526, 0.2897, 0.5457]}, {"w": "comparisons,", "b": [0.296, 0.526, 0.4298, 0.5457]}, {"w": "such", "b": [0.4361, 0.526, 0.4823, 0.5457]}, {"w": "as", "b": [0.4886, 0.526, 0.5097, 0.5457]}, {"w": "estimating", "b": [0.516, 0.526, 0.6211, 0.5457]}, {"w": "how", "b": [0.6274, 0.526, 0.6708, 0.5457]}, {"w": "closely", "b": [0.6771, 0.526, 0.7486, 0.5457]}, {"w": "related", "b": [0.7549, 0.526, 0.8235, 0.5457]}, {"w": "two", "b": [0.8298, 0.526, 0.8677, 0.5457]}, {"w": "documents", "b": [0.1799, 0.5465, 0.2892, 0.5662]}, {"w": "or", "b": [0.2955, 0.5465, 0.3165, 0.5662]}, {"w": "two", "b": [0.3228, 0.5465, 0.3606, 0.5662]}, {"w": "stock", "b": [0.3669, 0.5465, 0.4202, 0.5662]}, {"w": "tickers", "b": [0.4265, 0.5465, 0.4937, 0.5662]}, {"w": "are", "b": [0.5001, 0.5465, 0.5309, 0.5662]}, {"w": "Sequence-to-sequence", "b": [0.1799, 0.567, 0.4054, 0.5867]}, {"w": "learning,", "b": [0.4117, 0.567, 0.5007, 0.5867]}, {"w": "such", "b": [0.507, 0.567, 0.5532, 0.5867]}, {"w": "as", "b": [0.5595, 0.567, 0.5805, 0.5867]}, {"w": "decoding", "b": [0.5869, 0.567, 0.6793, 0.5867]}, {"w": "an", "b": [0.6856, 0.567, 0.7095, 0.5867]}, {"w": "English", "b": [0.7158, 0.567, 0.7928, 0.5867]}, {"w": "sentence", "b": [0.1799, 0.5875, 0.2667, 0.6072]}, {"w": "into", "b": [0.273, 0.5875, 0.3123, 0.6072]}, {"w": "French", "b": [0.3186, 0.5875, 0.3886, 0.6072]}, {"w": "Sentiment", "b": [0.1799, 0.608, 0.2822, 0.6277]}, {"w": "analysis,", "b": [0.2885, 0.608, 0.3761, 0.6277]}, {"w": "such", "b": [0.3824, 0.608, 0.4286, 0.6277]}, {"w": "as", "b": [0.4349, 0.608, 0.4559, 0.6277]}, {"w": "classifying", "b": [0.4622, 0.608, 0.5715, 0.6277]}, {"w": "the", "b": [0.5779, 0.608, 0.6087, 0.6277]}, {"w": "sentiment", "b": [0.615, 0.608, 0.7131, 0.6277]}, {"w": "of", "b": [0.7194, 0.608, 0.7404, 0.6277]}, {"w": "tweets", "b": [0.7467, 0.608, 0.8112, 0.6277]}, {"w": "or", "b": [0.8175, 0.608, 0.8385, 0.6277]}, {"w": "movie", "b": [0.1799, 0.6285, 0.2429, 0.6482]}, {"w": "reviews", "b": [0.2492, 0.6285, 0.3277, 0.6482]}, {"w": "as", "b": [0.334, 0.6285, 0.355, 0.6482]}, {"w": "positive", "b": [0.3613, 0.6285, 0.4412, 0.6482]}, {"w": "or", "b": [0.4475, 0.6285, 0.4685, 0.6482]}, {"w": "negative", "b": [0.4748, 0.6285, 0.5603, 0.6482]}, {"w": "Timeseries", "b": [0.1799, 0.649, 0.2897, 0.6687]}, {"w": "forecasting,", "b": [0.296, 0.649, 0.4144, 0.6687]}, {"w": "such", "b": [0.4207, 0.649, 0.4669, 0.6687]}, {"w": "as", "b": [0.4732, 0.649, 0.4942, 0.6687]}, {"w": "predicting", "b": [0.5005, 0.649, 0.6028, 0.6687]}, {"w": "the", "b": [0.6091, 0.649, 0.6399, 0.6687]}, {"w": "future", "b": [0.6463, 0.649, 0.7065, 0.6687]}, {"w": "weather", "b": [0.7128, 0.649, 0.7926, 0.6687]}, {"w": "at", "b": [0.7989, 0.649, 0.8172, 0.6687]}, {"w": "a", "b": [0.8235, 0.649, 0.8347, 0.6687]}, {"w": "certain", "b": [0.1799, 0.6695, 0.2485, 0.6892]}, {"w": "location,", "b": [0.2548, 0.6695, 0.3424, 0.6892]}, {"w": "given", "b": [0.3487, 0.6695, 0.4048, 0.6892]}, {"w": "recent", "b": [0.4111, 0.6695, 0.4727, 0.6892]}, {"w": "weather", "b": [0.479, 0.6695, 0.5588, 0.6892]}, {"w": "data", "b": [0.5651, 0.6695, 0.6072, 0.6892]}]}, {"id": "b_6", "type": "paragraph", "text": "This chapter’s examples focus on two narrow tasks: sentiment analysis on the IMDB dataset, a task we approached earlier in the book, and temperature forecasting. But the techniques demonstrated for these two tasks are relevant to all the applications just listed, and many more.", "words": [{"w": "This", "b": [0.1294, 0.7123, 0.1743, 0.732]}, {"w": "chapter’s", "b": [0.1806, 0.7123, 0.2725, 0.732]}, {"w": "examples", "b": [0.2789, 0.7123, 0.3741, 0.732]}, {"w": "focus", "b": [0.3804, 0.7123, 0.4351, 0.732]}, {"w": "on", "b": [0.4414, 0.7123, 0.4666, 0.732]}, {"w": "two", "b": [0.4729, 0.7123, 0.5108, 0.732]}, {"w": "narrow", "b": [0.5171, 0.7123, 0.5885, 0.732]}, {"w": "tasks:", "b": [0.5948, 0.7123, 0.6523, 0.732]}, {"w": "sentiment", "b": [0.6586, 0.7123, 0.7567, 0.732]}, {"w": "analysis", "b": [0.763, 0.7123, 0.8443, 0.732]}, {"w": "on", "b": [0.1294, 0.7328, 0.1546, 0.7525]}, {"w": "the", "b": [0.1609, 0.7328, 0.1918, 0.7525]}, {"w": "IMDB", "b": [0.1981, 0.7328, 0.2639, 0.7525]}, {"w": "dataset,", "b": [0.2702, 0.7328, 0.3466, 0.7525]}, {"w": "a", "b": [0.3529, 0.7328, 0.3641, 0.7525]}, {"w": "task", "b": [0.3704, 0.7328, 0.4111, 0.7525]}, {"w": "we", "b": [0.4174, 0.7328, 0.4468, 0.7525]}, {"w": "approached", "b": [0.4531, 0.7328, 0.5693, 0.7525]}, {"w": "earlier", "b": [0.5757, 0.7328, 0.6401, 0.7525]}, {"w": "in", "b": [0.6464, 0.7328, 0.666, 0.7525]}, {"w": "the", "b": [0.6723, 0.7328, 0.7031, 0.7525]}, {"w": "book,", "b": [0.7094, 0.7328, 0.7661, 0.7525]}, {"w": "and", "b": [0.7725, 0.7328, 0.8089, 0.7525]}, {"w": "temperature", "b": [0.1294, 0.7533, 0.2499, 0.773]}, {"w": "forecasting.", "b": [0.2562, 0.7533, 0.3746, 0.773]}, {"w": "But", "b": [0.3809, 0.7533, 0.4173, 0.773]}, {"w": "the", "b": [0.4236, 0.7533, 0.4545, 0.773]}, {"w": "techniques", "b": [0.4608, 0.7533, 0.5687, 0.773]}, {"w": "demonstrated", "b": [0.575, 0.7533, 0.7109, 0.773]}, {"w": "for", "b": [0.7172, 0.7533, 0.7466, 0.773]}, {"w": "these", "b": [0.7529, 0.7533, 0.8048, 0.773]}, {"w": "two", "b": [0.8111, 0.7533, 0.8489, 0.773]}, {"w": "tasks", "b": [0.1294, 0.7738, 0.1799, 0.7935]}, {"w": "are", "b": [0.1862, 0.7738, 0.217, 0.7935]}, {"w": "relevant", "b": [0.2233, 0.7738, 0.3045, 0.7935]}, {"w": "to", "b": [0.3108, 0.7738, 0.3305, 0.7935]}, {"w": "all", "b": [0.3368, 0.7738, 0.362, 0.7935]}, {"w": "the", "b": [0.3683, 0.7738, 0.3991, 0.7935]}, {"w": "applications", "b": [0.4054, 0.7738, 0.5273, 0.7935]}, {"w": "just", "b": [0.5336, 0.7738, 0.57, 0.7935]}, {"w": "listed,", "b": [0.5763, 0.7738, 0.6373, 0.7935]}, {"w": "and", "b": [0.6436, 0.7738, 0.68, 0.7935]}, {"w": "many", "b": [0.6863, 0.7738, 0.7424, 0.7935]}, {"w": "more.", "b": [0.7487, 0.7738, 0.8068, 0.7935]}]}, {"id": "b_7", "type": "paragraph", "text": "6.1. Working with text data", "words": [{"w": "6.1.", "b": [0.1294, 0.8306, 0.172, 0.8528]}, {"w": "Working", "b": [0.1791, 0.8306, 0.2863, 0.8528]}, {"w": "with", "b": [0.2934, 0.8306, 0.347, 0.8528]}, {"w": "text", "b": [0.3541, 0.8306, 0.3998, 0.8528]}, {"w": "data", "b": [0.4069, 0.8306, 0.4605, 0.8528]}]}]}, {"page": 239, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Text is one of the most widespread forms of sequence data. It can be understood as either a sequence of characters or a sequence of words, but it’s most common to work at the level of words. The deep-learning sequence-processing models introduced in the following sections can use text to produce a basic form of natural-l-anguage understanding, sufficient for applications including document classification, sentiment analysis, author identification, and even question-answering (QA) (in a constrained context). Of course, keep in mind throughout this chapter that none of these deep-learning models truly understand text in a human sense; rather, these models can map the statistical structure of written language, which is sufficient to solve many simple textual tasks. Deep learning for natural-language processing is pattern recognition applied to words, sentences, and paragraphs, in much the same way that computer vision is pattern recognition applied to pixels.", "words": [{"w": "Text", "b": [0.1294, 0.0857, 0.1739, 0.1054]}, {"w": "is", "b": [0.1802, 0.0857, 0.197, 0.1054]}, {"w": "one", "b": [0.2033, 0.0857, 0.2397, 0.1054]}, {"w": "of", "b": [0.2461, 0.0857, 0.2671, 0.1054]}, {"w": "the", "b": [0.2734, 0.0857, 0.3042, 0.1054]}, {"w": "most", "b": [0.3105, 0.0857, 0.3596, 0.1054]}, {"w": "widespread", "b": [0.3659, 0.0857, 0.4808, 0.1054]}, {"w": "forms", "b": [0.4871, 0.0857, 0.5459, 0.1054]}, {"w": "of", "b": [0.5522, 0.0857, 0.5732, 0.1054]}, {"w": "sequence", "b": [0.5795, 0.0857, 0.672, 0.1054]}, {"w": "data.", "b": [0.6783, 0.0857, 0.7266, 0.1054]}, {"w": "It", "b": [0.7329, 0.0857, 0.7484, 0.1054]}, {"w": "can", "b": [0.7547, 0.0857, 0.7897, 0.1054]}, {"w": "be", "b": [0.796, 0.0857, 0.8198, 0.1054]}, {"w": "understood", "b": [0.1294, 0.1062, 0.2415, 0.1259]}, {"w": "as", "b": [0.2478, 0.1062, 0.2688, 0.1259]}, {"w": "either", "b": [0.2751, 0.1062, 0.3326, 0.1259]}, {"w": "a", "b": [0.3389, 0.1062, 0.3501, 0.1259]}, {"w": "sequence", "b": [0.3564, 0.1062, 0.4488, 0.1259]}, {"w": "of", "b": [0.4552, 0.1062, 0.4762, 0.1259]}, {"w": "characters", "b": [0.4825, 0.1062, 0.5847, 0.1259]}, {"w": "or", "b": [0.591, 0.1062, 0.612, 0.1259]}, {"w": "a", "b": [0.6183, 0.1062, 0.6295, 0.1259]}, {"w": "sequence", "b": [0.6358, 0.1062, 0.7283, 0.1259]}, {"w": "of", "b": [0.7345, 0.1062, 0.7555, 0.1259]}, {"w": "words,", "b": [0.7619, 0.1062, 0.8298, 0.1259]}, {"w": "but", "b": [0.8361, 0.1062, 0.8684, 0.1259]}, {"w": "it’s", "b": [0.1294, 0.1267, 0.1603, 0.1464]}, {"w": "most", "b": [0.1666, 0.1267, 0.2156, 0.1464]}, {"w": "common", "b": [0.2219, 0.1267, 0.3102, 0.1464]}, {"w": "to", "b": [0.3165, 0.1267, 0.3361, 0.1464]}, {"w": "work", "b": [0.3425, 0.1267, 0.3943, 0.1464]}, {"w": "at", "b": [0.4006, 0.1267, 0.4188, 0.1464]}, {"w": "the", "b": [0.4251, 0.1267, 0.4559, 0.1464]}, {"w": "level", "b": [0.4623, 0.1267, 0.5113, 0.1464]}, {"w": "of", "b": [0.5176, 0.1267, 0.5386, 0.1464]}, {"w": "words.", "b": [0.5449, 0.1267, 0.6129, 0.1464]}, {"w": "The", "b": [0.6192, 0.1267, 0.6584, 0.1464]}, {"w": "deep-learning", "b": [0.6647, 0.1267, 0.8034, 0.1464]}, {"w": "sequence-processing", "b": [0.1294, 0.1472, 0.3382, 0.1669]}, {"w": "models", "b": [0.3445, 0.1472, 0.4173, 0.1669]}, {"w": "introduced", "b": [0.4236, 0.1472, 0.5315, 0.1669]}, {"w": "in", "b": [0.5378, 0.1472, 0.5575, 0.1669]}, {"w": "the", "b": [0.5638, 0.1472, 0.5946, 0.1669]}, {"w": "following", "b": [0.6008, 0.1472, 0.6989, 0.1669]}, {"w": "sections", "b": [0.7052, 0.1472, 0.7865, 0.1669]}, {"w": "can", "b": [0.7928, 0.1472, 0.8278, 0.1669]}, {"w": "use", "b": [0.8342, 0.1472, 0.8678, 0.1669]}, {"w": "text", "b": [0.1294, 0.1677, 0.1673, 0.1874]}, {"w": "to", "b": [0.1736, 0.1677, 0.1932, 0.1874]}, {"w": "produce", "b": [0.1995, 0.1677, 0.2807, 0.1874]}, {"w": "a", "b": [0.287, 0.1677, 0.2982, 0.1874]}, {"w": "basic", "b": [0.3046, 0.1677, 0.3564, 0.1874]}, {"w": "form", "b": [0.3627, 0.1677, 0.4117, 0.1874]}, {"w": "of", "b": [0.418, 0.1677, 0.4391, 0.1874]}, {"w": "natural-l-anguage", "b": [0.4454, 0.1677, 0.6233, 0.1874]}, {"w": "understanding,", "b": [0.6296, 0.1677, 0.7788, 0.1874]}, {"w": "sufficient", "b": [0.1294, 0.1882, 0.2242, 0.2079]}, {"w": "for", "b": [0.2305, 0.1882, 0.26, 0.2079]}, {"w": "applications", "b": [0.2663, 0.1882, 0.3882, 0.2079]}, {"w": "including", "b": [0.3945, 0.1882, 0.4898, 0.2079]}, {"w": "document", "b": [0.496, 0.1882, 0.5955, 0.2079]}, {"w": "classification,", "b": [0.6018, 0.1882, 0.7413, 0.2079]}, {"w": "sentiment", "b": [0.7476, 0.1882, 0.8457, 0.2079]}, {"w": "analysis,", "b": [0.1294, 0.2087, 0.217, 0.2284]}, {"w": "author", "b": [0.2233, 0.2087, 0.2878, 0.2284]}, {"w": "identification,", "b": [0.2941, 0.2087, 0.4349, 0.2284]}, {"w": "and", "b": [0.4412, 0.2087, 0.4776, 0.2284]}, {"w": "even", "b": [0.4839, 0.2087, 0.5316, 0.2284]}, {"w": "question-answering", "b": [0.5379, 0.2087, 0.7354, 0.2284]}, {"w": "(QA)", "b": [0.7417, 0.2087, 0.795, 0.2284]}, {"w": "(in", "b": [0.8013, 0.2087, 0.8293, 0.2284]}, {"w": "a", "b": [0.8356, 0.2087, 0.8468, 0.2284]}, {"w": "constrained", "b": [0.1294, 0.2292, 0.2457, 0.2489]}, {"w": "context).", "b": [0.252, 0.2292, 0.341, 0.2489]}, {"w": "Of", "b": [0.3472, 0.2292, 0.3739, 0.2489]}, {"w": "course,", "b": [0.3802, 0.2292, 0.4523, 0.2489]}, {"w": "keep", "b": [0.4586, 0.2292, 0.5062, 0.2489]}, {"w": "in", "b": [0.5125, 0.2292, 0.5322, 0.2489]}, {"w": "mind", "b": [0.5385, 0.2292, 0.5903, 0.2489]}, {"w": "throughout", "b": [0.5966, 0.2292, 0.7074, 0.2489]}, {"w": "this", "b": [0.7137, 0.2292, 0.7501, 0.2489]}, {"w": "chapter", "b": [0.7564, 0.2292, 0.8307, 0.2489]}, {"w": "that", "b": [0.1294, 0.2497, 0.1673, 0.2694]}, {"w": "none", "b": [0.1736, 0.2497, 0.2226, 0.2694]}, {"w": "of", "b": [0.2289, 0.2497, 0.2499, 0.2694]}, {"w": "these", "b": [0.2562, 0.2497, 0.3081, 0.2694]}, {"w": "deep-learning", "b": [0.3144, 0.2497, 0.4531, 0.2694]}, {"w": "models", "b": [0.4594, 0.2497, 0.5322, 0.2694]}, {"w": "truly", "b": [0.5385, 0.2497, 0.5862, 0.2694]}, {"w": "understand", "b": [0.5925, 0.2497, 0.7032, 0.2694]}, {"w": "text", "b": [0.7095, 0.2497, 0.7473, 0.2694]}, {"w": "in", "b": [0.7536, 0.2497, 0.7733, 0.2694]}, {"w": "a", "b": [0.7796, 0.2497, 0.7908, 0.2694]}, {"w": "human", "b": [0.7971, 0.2497, 0.8658, 0.2694]}, {"w": "sense;", "b": [0.1294, 0.2702, 0.1911, 0.2899]}, {"w": "rather,", "b": [0.1974, 0.2702, 0.2615, 0.2899]}, {"w": "these", "b": [0.2678, 0.2702, 0.3196, 0.2899]}, {"w": "models", "b": [0.3259, 0.2702, 0.3988, 0.2899]}, {"w": "can", "b": [0.4051, 0.2702, 0.4401, 0.2899]}, {"w": "map", "b": [0.4464, 0.2702, 0.4899, 0.2899]}, {"w": "the", "b": [0.4962, 0.2702, 0.527, 0.2899]}, {"w": "statistical", "b": [0.5333, 0.2702, 0.6286, 0.2899]}, {"w": "structure", "b": [0.6349, 0.2702, 0.7232, 0.2899]}, {"w": "of", "b": [0.7295, 0.2702, 0.7505, 0.2899]}, {"w": "written", "b": [0.7568, 0.2702, 0.8283, 0.2899]}, {"w": "language,", "b": [0.1294, 0.2907, 0.2268, 0.3104]}, {"w": "which", "b": [0.2331, 0.2907, 0.2947, 0.3104]}, {"w": "is", "b": [0.301, 0.2907, 0.3179, 0.3104]}, {"w": "sufficient", "b": [0.3242, 0.2907, 0.419, 0.3104]}, {"w": "to", "b": [0.4253, 0.2907, 0.4449, 0.3104]}, {"w": "solve", "b": [0.4512, 0.2907, 0.5045, 0.3104]}, {"w": "many", "b": [0.5108, 0.2907, 0.5668, 0.3104]}, {"w": "simple", "b": [0.5731, 0.2907, 0.6404, 0.3104]}, {"w": "textual", "b": [0.6467, 0.2907, 0.7154, 0.3104]}, {"w": "tasks.", "b": [0.7216, 0.2907, 0.7784, 0.3104]}, {"w": "Deep", "b": [0.7847, 0.2907, 0.8379, 0.3104]}, {"w": "learning", "b": [0.1294, 0.3112, 0.2121, 0.3309]}, {"w": "for", "b": [0.2184, 0.3112, 0.2478, 0.3309]}, {"w": "natural-language", "b": [0.2541, 0.3112, 0.4236, 0.3309]}, {"w": "processing", "b": [0.4299, 0.3112, 0.5378, 0.3309]}, {"w": "is", "b": [0.5441, 0.3112, 0.5609, 0.3309]}, {"w": "pattern", "b": [0.5673, 0.3112, 0.6373, 0.3309]}, {"w": "recognition", "b": [0.6436, 0.3112, 0.7585, 0.3309]}, {"w": "applied", "b": [0.7648, 0.3112, 0.8391, 0.3309]}, {"w": "to", "b": [0.8454, 0.3112, 0.865, 0.3309]}, {"w": "words,", "b": [0.1294, 0.3317, 0.1974, 0.3514]}, {"w": "sentences,", "b": [0.2037, 0.3317, 0.3066, 0.3514]}, {"w": "and", "b": [0.313, 0.3317, 0.3494, 0.3514]}, {"w": "paragraphs,", "b": [0.3557, 0.3317, 0.4727, 0.3514]}, {"w": "in", "b": [0.479, 0.3317, 0.4986, 0.3514]}, {"w": "much", "b": [0.5049, 0.3317, 0.5609, 0.3514]}, {"w": "the", "b": [0.5672, 0.3317, 0.598, 0.3514]}, {"w": "same", "b": [0.6044, 0.3317, 0.6562, 0.3514]}, {"w": "way", "b": [0.6625, 0.3317, 0.7045, 0.3514]}, {"w": "that", "b": [0.7108, 0.3317, 0.7487, 0.3514]}, {"w": "computer", "b": [0.755, 0.3317, 0.8503, 0.3514]}, {"w": "vision", "b": [0.1294, 0.3522, 0.1911, 0.3719]}, {"w": "is", "b": [0.1974, 0.3522, 0.2142, 0.3719]}, {"w": "pattern", "b": [0.2205, 0.3522, 0.2906, 0.3719]}, {"w": "recognition", "b": [0.2969, 0.3522, 0.4118, 0.3719]}, {"w": "applied", "b": [0.4181, 0.3522, 0.4924, 0.3719]}, {"w": "to", "b": [0.4987, 0.3522, 0.5183, 0.3719]}, {"w": "pixels.", "b": [0.5246, 0.3522, 0.5912, 0.3719]}]}, {"id": "b_1", "type": "paragraph", "text": "Like all other neural networks, deep-learning models don’t take as input raw text: they only work with numeric tensors. Vectorizing text is the process of transforming text into numeric tensors. This can be done in multiple ways:", "words": [{"w": "Like", "b": [0.1294, 0.395, 0.1757, 0.4147]}, {"w": "all", "b": [0.182, 0.395, 0.2072, 0.4147]}, {"w": "other", "b": [0.2135, 0.395, 0.2653, 0.4147]}, {"w": "neural", "b": [0.2716, 0.395, 0.3347, 0.4147]}, {"w": "networks,", "b": [0.341, 0.395, 0.4398, 0.4147]}, {"w": "deep-learning", "b": [0.4461, 0.395, 0.5848, 0.4147]}, {"w": "models", "b": [0.5911, 0.395, 0.6639, 0.4147]}, {"w": "don’t", "b": [0.6703, 0.395, 0.723, 0.4147]}, {"w": "take", "b": [0.7293, 0.395, 0.7713, 0.4147]}, {"w": "as", "b": [0.7776, 0.395, 0.7986, 0.4147]}, {"w": "input", "b": [0.8049, 0.395, 0.8568, 0.4147]}, {"w": "raw", "b": [0.1294, 0.4155, 0.1672, 0.4352]}, {"w": "text:", "b": [0.1735, 0.4155, 0.2184, 0.4352]}, {"w": "they", "b": [0.2247, 0.4155, 0.2681, 0.4352]}, {"w": "only", "b": [0.2744, 0.4155, 0.3193, 0.4352]}, {"w": "work", "b": [0.3256, 0.4155, 0.3774, 0.4352]}, {"w": "with", "b": [0.3837, 0.4155, 0.4286, 0.4352]}, {"w": "numeric", "b": [0.4349, 0.4155, 0.5176, 0.4352]}, {"w": "tensors.", "b": [0.5239, 0.4155, 0.6016, 0.4352]}, {"w": "Vectorizing", "b": [0.6079, 0.4155, 0.7214, 0.4352]}, {"w": "text", "b": [0.7277, 0.4155, 0.7655, 0.4352]}, {"w": "is", "b": [0.7718, 0.4155, 0.7887, 0.4352]}, {"w": "the", "b": [0.795, 0.4155, 0.8258, 0.4352]}, {"w": "process", "b": [0.1294, 0.436, 0.2051, 0.4557]}, {"w": "of", "b": [0.2114, 0.436, 0.2324, 0.4557]}, {"w": "transforming", "b": [0.2387, 0.436, 0.369, 0.4557]}, {"w": "text", "b": [0.3753, 0.436, 0.4132, 0.4557]}, {"w": "into", "b": [0.4195, 0.436, 0.4587, 0.4557]}, {"w": "numeric", "b": [0.465, 0.436, 0.5477, 0.4557]}, {"w": "tensors.", "b": [0.554, 0.436, 0.6318, 0.4557]}, {"w": "This", "b": [0.6381, 0.436, 0.6829, 0.4557]}, {"w": "can", "b": [0.6892, 0.436, 0.7242, 0.4557]}, {"w": "be", "b": [0.7305, 0.436, 0.7544, 0.4557]}, {"w": "done", "b": [0.7607, 0.436, 0.8097, 0.4557]}, {"w": "in", "b": [0.816, 0.436, 0.8356, 0.4557]}, {"w": "multiple", "b": [0.1294, 0.4565, 0.2135, 0.4762]}, {"w": "ways:", "b": [0.2198, 0.4565, 0.2787, 0.4762]}]}, {"id": "b_2", "type": "paragraph", "text": "Segment text into words, and transform each word into a vector. Segment text into characters, and transform each character into a vector. Extract n-grams of words or characters, and transform each n-gram into a vector. N-grams are overlapping groups of multiple consecutive words or characters.", "words": [{"w": "Segment", "b": [0.1799, 0.4948, 0.2682, 0.5145]}, {"w": "text", "b": [0.2745, 0.4948, 0.3123, 0.5145]}, {"w": "into", "b": [0.3186, 0.4948, 0.3579, 0.5145]}, {"w": "words,", "b": [0.3642, 0.4948, 0.4321, 0.5145]}, {"w": "and", "b": [0.4384, 0.4948, 0.4749, 0.5145]}, {"w": "transform", "b": [0.4812, 0.4948, 0.5792, 0.5145]}, {"w": "each", "b": [0.5855, 0.4948, 0.6318, 0.5145]}, {"w": "word", "b": [0.6381, 0.4948, 0.6899, 0.5145]}, {"w": "into", "b": [0.6962, 0.4948, 0.7355, 0.5145]}, {"w": "a", "b": [0.7418, 0.4948, 0.753, 0.5145]}, {"w": "vector.", "b": [0.7593, 0.4948, 0.8272, 0.5145]}, {"w": "Segment", "b": [0.1799, 0.5153, 0.2682, 0.535]}, {"w": "text", "b": [0.2745, 0.5153, 0.3123, 0.535]}, {"w": "into", "b": [0.3186, 0.5153, 0.3579, 0.535]}, {"w": "characters,", "b": [0.3642, 0.5153, 0.4727, 0.535]}, {"w": "and", "b": [0.479, 0.5153, 0.5154, 0.535]}, {"w": "transform", "b": [0.5217, 0.5153, 0.6198, 0.535]}, {"w": "each", "b": [0.6261, 0.5153, 0.6723, 0.535]}, {"w": "character", "b": [0.6787, 0.5153, 0.7711, 0.535]}, {"w": "into", "b": [0.7774, 0.5153, 0.8166, 0.535]}, {"w": "a", "b": [0.8229, 0.5153, 0.8341, 0.535]}, {"w": "vector.", "b": [0.1799, 0.5358, 0.2478, 0.5555]}, {"w": "Extract", "b": [0.1799, 0.5563, 0.2527, 0.576]}, {"w": "n-grams", "b": [0.259, 0.5563, 0.3417, 0.576]}, {"w": "of", "b": [0.348, 0.5563, 0.369, 0.576]}, {"w": "words", "b": [0.3753, 0.5563, 0.437, 0.576]}, {"w": "or", "b": [0.4433, 0.5563, 0.4643, 0.576]}, {"w": "characters,", "b": [0.4706, 0.5563, 0.5791, 0.576]}, {"w": "and", "b": [0.5854, 0.5563, 0.6219, 0.576]}, {"w": "transform", "b": [0.6282, 0.5563, 0.7263, 0.576]}, {"w": "each", "b": [0.7326, 0.5563, 0.7788, 0.576]}, {"w": "n-gram", "b": [0.7851, 0.5563, 0.8579, 0.576]}, {"w": "into", "b": [0.1799, 0.5768, 0.2191, 0.5965]}, {"w": "a", "b": [0.2254, 0.5768, 0.2366, 0.5965]}, {"w": "vector.", "b": [0.2429, 0.5768, 0.3109, 0.5965]}, {"w": "N-grams", "b": [0.3171, 0.5768, 0.4054, 0.5965]}, {"w": "are", "b": [0.4117, 0.5768, 0.4425, 0.5965]}, {"w": "overlapping", "b": [0.4489, 0.5768, 0.5694, 0.5965]}, {"w": "groups", "b": [0.5757, 0.5768, 0.6443, 0.5965]}, {"w": "of", "b": [0.6506, 0.5768, 0.6716, 0.5965]}, {"w": "multiple", "b": [0.678, 0.5768, 0.7621, 0.5965]}, {"w": "consecutive", "b": [0.1799, 0.5973, 0.299, 0.617]}, {"w": "words", "b": [0.3053, 0.5973, 0.3669, 0.617]}, {"w": "or", "b": [0.3732, 0.5973, 0.3942, 0.617]}, {"w": "characters.", "b": [0.4005, 0.5973, 0.5091, 0.617]}]}, {"id": "b_3", "type": "paragraph", "text": "Collectively, the different units into which you can break down text (words, characters, or n-grams) are called tokens, and breaking text into such tokens is called tokenization. All text-vectorization processes consist of applying some tokenization scheme and then associating numeric vectors with the generated tokens. These vectors, packed into sequence tensors, are fed into deep neural networks. There are multiple ways to associate a vector with a token. In this section, I’ll present two major ones: one-hot encoding of tokens, and token embedding (typically used exclusively for words, and called word embedding). The remainder of this section explains these techniques and shows how to use them to go from raw text to a Numpy tensor that you can send to a Keras network.", "words": [{"w": "Collectively,", "b": [0.1294, 0.6401, 0.2574, 0.6598]}, {"w": "the", "b": [0.2637, 0.6401, 0.2945, 0.6598]}, {"w": "different", "b": [0.3008, 0.6401, 0.3872, 0.6598]}, {"w": "units", "b": [0.3935, 0.6401, 0.4426, 0.6598]}, {"w": "into", "b": [0.4489, 0.6401, 0.4881, 0.6598]}, {"w": "which", "b": [0.4944, 0.6401, 0.5561, 0.6598]}, {"w": "you", "b": [0.5624, 0.6401, 0.6002, 0.6598]}, {"w": "can", "b": [0.6065, 0.6401, 0.6416, 0.6598]}, {"w": "break", "b": [0.6479, 0.6401, 0.7039, 0.6598]}, {"w": "down", "b": [0.7102, 0.6401, 0.7662, 0.6598]}, {"w": "text", "b": [0.7725, 0.6401, 0.8104, 0.6598]}, {"w": "(words,", "b": [0.1294, 0.6606, 0.2058, 0.6803]}, {"w": "characters,", "b": [0.2121, 0.6606, 0.3206, 0.6803]}, {"w": "or", "b": [0.3269, 0.6606, 0.3479, 0.6803]}, {"w": "n-grams)", "b": [0.3542, 0.6606, 0.4453, 0.6803]}, {"w": "are", "b": [0.4516, 0.6606, 0.4824, 0.6803]}, {"w": "called", "b": [0.4887, 0.6606, 0.549, 0.6803]}, {"w": "tokens,", "b": [0.5552, 0.6606, 0.626, 0.6803]}, {"w": "and", "b": [0.6323, 0.6606, 0.6687, 0.6803]}, {"w": "breaking", "b": [0.675, 0.6606, 0.7633, 0.6803]}, {"w": "text", "b": [0.7696, 0.6606, 0.8074, 0.6803]}, {"w": "into", "b": [0.8137, 0.6606, 0.853, 0.6803]}, {"w": "such", "b": [0.1294, 0.6811, 0.1757, 0.7008]}, {"w": "tokens", "b": [0.182, 0.6811, 0.2478, 0.7008]}, {"w": "is", "b": [0.2541, 0.6811, 0.271, 0.7008]}, {"w": "called", "b": [0.2773, 0.6811, 0.3375, 0.7008]}, {"w": "tokenization.", "b": [0.3438, 0.6811, 0.4734, 0.7008]}, {"w": "All", "b": [0.4797, 0.6811, 0.5119, 0.7008]}, {"w": "text-vectorization", "b": [0.5182, 0.6811, 0.6962, 0.7008]}, {"w": "processes", "b": [0.7025, 0.6811, 0.7991, 0.7008]}, {"w": "consist", "b": [0.1294, 0.7016, 0.1995, 0.7213]}, {"w": "of", "b": [0.2058, 0.7016, 0.2268, 0.7213]}, {"w": "applying", "b": [0.2331, 0.7016, 0.3214, 0.7213]}, {"w": "some", "b": [0.3277, 0.7016, 0.381, 0.7213]}, {"w": "tokenization", "b": [0.3873, 0.7016, 0.512, 0.7213]}, {"w": "scheme", "b": [0.5183, 0.7016, 0.5939, 0.7213]}, {"w": "and", "b": [0.6003, 0.7016, 0.6367, 0.7213]}, {"w": "then", "b": [0.643, 0.7016, 0.6864, 0.7213]}, {"w": "associating", "b": [0.6927, 0.7016, 0.8048, 0.7213]}, {"w": "numeric", "b": [0.1294, 0.7221, 0.2121, 0.7418]}, {"w": "vectors", "b": [0.2184, 0.7221, 0.2912, 0.7418]}, {"w": "with", "b": [0.2975, 0.7221, 0.3424, 0.7418]}, {"w": "the", "b": [0.3487, 0.7221, 0.3795, 0.7418]}, {"w": "generated", "b": [0.3858, 0.7221, 0.4838, 0.7418]}, {"w": "tokens.", "b": [0.4902, 0.7221, 0.5623, 0.7418]}, {"w": "These", "b": [0.5686, 0.7221, 0.6289, 0.7418]}, {"w": "vectors,", "b": [0.6352, 0.7221, 0.7143, 0.7418]}, {"w": "packed", "b": [0.7206, 0.7221, 0.7921, 0.7418]}, {"w": "into", "b": [0.7984, 0.7221, 0.8376, 0.7418]}, {"w": "sequence", "b": [0.1294, 0.7426, 0.2219, 0.7623]}, {"w": "tensors,", "b": [0.2282, 0.7426, 0.3059, 0.7623]}, {"w": "are", "b": [0.3122, 0.7426, 0.343, 0.7623]}, {"w": "fed", "b": [0.3494, 0.7426, 0.3816, 0.7623]}, {"w": "into", "b": [0.3879, 0.7426, 0.4271, 0.7623]}, {"w": "deep", "b": [0.4334, 0.7426, 0.4811, 0.7623]}, {"w": "neural", "b": [0.4874, 0.7426, 0.5504, 0.7623]}, {"w": "networks.", "b": [0.5567, 0.7426, 0.6555, 0.7623]}, {"w": "There", "b": [0.6618, 0.7426, 0.7206, 0.7623]}, {"w": "are", "b": [0.7269, 0.7426, 0.7577, 0.7623]}, {"w": "multiple", "b": [0.764, 0.7426, 0.8481, 0.7623]}, {"w": "ways", "b": [0.1294, 0.7631, 0.1813, 0.7828]}, {"w": "to", "b": [0.1875, 0.7631, 0.2072, 0.7828]}, {"w": "associate", "b": [0.2135, 0.7631, 0.3045, 0.7828]}, {"w": "a", "b": [0.3109, 0.7631, 0.3221, 0.7828]}, {"w": "vector", "b": [0.3284, 0.7631, 0.3914, 0.7828]}, {"w": "with", "b": [0.3977, 0.7631, 0.4426, 0.7828]}, {"w": "a", "b": [0.4489, 0.7631, 0.4601, 0.7828]}, {"w": "token.", "b": [0.4664, 0.7631, 0.5287, 0.7828]}, {"w": "In", "b": [0.535, 0.7631, 0.556, 0.7828]}, {"w": "this", "b": [0.5624, 0.7631, 0.5988, 0.7828]}, {"w": "section,", "b": [0.6051, 0.7631, 0.6829, 0.7828]}, {"w": "I’ll", "b": [0.6892, 0.7631, 0.72, 0.7828]}, {"w": "present", "b": [0.7263, 0.7631, 0.7992, 0.7828]}, {"w": "two", "b": [0.8055, 0.7631, 0.8433, 0.7828]}, {"w": "major", "b": [0.1294, 0.7836, 0.1883, 0.8033]}, {"w": "ones:", "b": [0.1946, 0.7836, 0.2478, 0.8033]}, {"w": "one-hot", "b": [0.2541, 0.7836, 0.3312, 0.8033]}, {"w": "encoding", "b": [0.3375, 0.7836, 0.43, 0.8033]}, {"w": "of", "b": [0.4362, 0.7836, 0.4572, 0.8033]}, {"w": "tokens,", "b": [0.4635, 0.7836, 0.5357, 0.8033]}, {"w": "and", "b": [0.542, 0.7836, 0.5784, 0.8033]}, {"w": "token", "b": [0.5847, 0.7836, 0.6394, 0.8033]}, {"w": "embedding", "b": [0.6457, 0.7836, 0.7564, 0.8033]}, {"w": "(typically", "b": [0.7627, 0.7836, 0.8593, 0.8033]}, {"w": "used", "b": [0.1294, 0.8041, 0.1757, 0.8238]}, {"w": "exclusively", "b": [0.182, 0.8041, 0.2969, 0.8238]}, {"w": "for", "b": [0.3032, 0.8041, 0.3326, 0.8238]}, {"w": "words,", "b": [0.3389, 0.8041, 0.4068, 0.8238]}, {"w": "and", "b": [0.4132, 0.8041, 0.4496, 0.8238]}, {"w": "called", "b": [0.4559, 0.8041, 0.5161, 0.8238]}, {"w": "word", "b": [0.5224, 0.8041, 0.5733, 0.8238]}, {"w": "embedding).", "b": [0.5796, 0.8041, 0.705, 0.8238]}, {"w": "The", "b": [0.7113, 0.8041, 0.7505, 0.8238]}, {"w": "remainder", "b": [0.7568, 0.8041, 0.8591, 0.8238]}, {"w": "of", "b": [0.1294, 0.8246, 0.1504, 0.8443]}, {"w": "this", "b": [0.1567, 0.8246, 0.1932, 0.8443]}, {"w": "section", "b": [0.1995, 0.8246, 0.271, 0.8443]}, {"w": "explains", "b": [0.2773, 0.8246, 0.3613, 0.8443]}, {"w": "these", "b": [0.3676, 0.8246, 0.4195, 0.8443]}, {"w": "techniques", "b": [0.4258, 0.8246, 0.5337, 0.8443]}, {"w": "and", "b": [0.54, 0.8246, 0.5764, 0.8443]}, {"w": "shows", "b": [0.5827, 0.8246, 0.6458, 0.8443]}, {"w": "how", "b": [0.6521, 0.8246, 0.6955, 0.8443]}, {"w": "to", "b": [0.7018, 0.8246, 0.7215, 0.8443]}, {"w": "use", "b": [0.7278, 0.8246, 0.7614, 0.8443]}, {"w": "them", "b": [0.7677, 0.8246, 0.8182, 0.8443]}, {"w": "to", "b": [0.8245, 0.8246, 0.8441, 0.8443]}, {"w": "go", "b": [0.1294, 0.8451, 0.1546, 0.8648]}, {"w": "from", "b": [0.1609, 0.8451, 0.21, 0.8648]}, {"w": "raw", "b": [0.2163, 0.8451, 0.2541, 0.8648]}, {"w": "text", "b": [0.2604, 0.8451, 0.2982, 0.8648]}, {"w": "to", "b": [0.3046, 0.8451, 0.3242, 0.8648]}, {"w": "a", "b": [0.3305, 0.8451, 0.3417, 0.8648]}, {"w": "Numpy", "b": [0.348, 0.8451, 0.4237, 0.8648]}, {"w": "tensor", "b": [0.43, 0.8451, 0.4916, 0.8648]}, {"w": "that", "b": [0.4979, 0.8451, 0.5357, 0.8648]}, {"w": "you", "b": [0.5421, 0.8451, 0.5799, 0.8648]}, {"w": "can", "b": [0.5862, 0.8451, 0.6212, 0.8648]}, {"w": "send", "b": [0.6275, 0.8451, 0.6738, 0.8648]}, {"w": "to", "b": [0.6801, 0.8451, 0.6997, 0.8648]}, {"w": "a", "b": [0.706, 0.8451, 0.7172, 0.8648]}, {"w": "Keras", "b": [0.7235, 0.8451, 0.7823, 0.8648]}, {"w": "network.", "b": [0.1294, 0.8656, 0.2184, 0.8853]}]}]}, {"page": 240, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 6.1. From text to tokens to vectors", "words": [{"w": "Figure", "b": [0.1294, 0.0852, 0.1827, 0.1]}, {"w": "6.1.", "b": [0.1874, 0.0852, 0.2158, 0.1]}, {"w": "From", "b": [0.2205, 0.0852, 0.2653, 0.1]}, {"w": "text", "b": [0.27, 0.0852, 0.3005, 0.1]}, {"w": "to", "b": [0.3052, 0.0852, 0.321, 0.1]}, {"w": "tokens", "b": [0.3257, 0.0852, 0.3783, 0.1]}, {"w": "to", "b": [0.383, 0.0852, 0.3988, 0.1]}, {"w": "vectors", "b": [0.4035, 0.0852, 0.4613, 0.1]}]}, {"id": "b_1", "type": "equation", "text": "Understanding n-grams and bag-of-words", "words": [{"w": "Understanding", "b": [0.1294, 0.3682, 0.2906, 0.388]}, {"w": "n-grams", "b": [0.2969, 0.3682, 0.3866, 0.388]}, {"w": "and", "b": [0.3929, 0.3682, 0.4336, 0.388]}, {"w": "bag-of-words", "b": [0.4399, 0.3682, 0.5828, 0.388]}]}, {"id": "b_2", "type": "paragraph", "text": "Word n-grams are groups of N (or fewer) consecutive words that you can extract from a sentence. The same concept may also be applied to characters instead of words.", "words": [{"w": "Word", "b": [0.1294, 0.411, 0.1848, 0.4307]}, {"w": "n-grams", "b": [0.1911, 0.411, 0.2738, 0.4307]}, {"w": "are", "b": [0.2801, 0.411, 0.3109, 0.4307]}, {"w": "groups", "b": [0.3172, 0.411, 0.3859, 0.4307]}, {"w": "of", "b": [0.3922, 0.411, 0.4132, 0.4307]}, {"w": "N", "b": [0.4195, 0.411, 0.4363, 0.4307]}, {"w": "(or", "b": [0.4426, 0.411, 0.472, 0.4307]}, {"w": "fewer)", "b": [0.4783, 0.411, 0.5441, 0.4307]}, {"w": "consecutive", "b": [0.5504, 0.411, 0.6695, 0.4307]}, {"w": "words", "b": [0.6758, 0.411, 0.7375, 0.4307]}, {"w": "that", "b": [0.7438, 0.411, 0.7816, 0.4307]}, {"w": "you", "b": [0.7879, 0.411, 0.8258, 0.4307]}, {"w": "can", "b": [0.8321, 0.411, 0.8671, 0.4307]}, {"w": "extract", "b": [0.1294, 0.4315, 0.1981, 0.4512]}, {"w": "from", "b": [0.2044, 0.4315, 0.2534, 0.4512]}, {"w": "a", "b": [0.2597, 0.4315, 0.2709, 0.4512]}, {"w": "sentence.", "b": [0.2772, 0.4315, 0.3704, 0.4512]}, {"w": "The", "b": [0.3767, 0.4315, 0.4159, 0.4512]}, {"w": "same", "b": [0.4222, 0.4315, 0.474, 0.4512]}, {"w": "concept", "b": [0.4804, 0.4315, 0.5588, 0.4512]}, {"w": "may", "b": [0.5651, 0.4315, 0.6086, 0.4512]}, {"w": "also", "b": [0.6149, 0.4315, 0.6555, 0.4512]}, {"w": "be", "b": [0.6618, 0.4315, 0.6856, 0.4512]}, {"w": "applied", "b": [0.6919, 0.4315, 0.7662, 0.4512]}, {"w": "to", "b": [0.7725, 0.4315, 0.7921, 0.4512]}, {"w": "characters", "b": [0.1294, 0.452, 0.2317, 0.4717]}, {"w": "instead", "b": [0.238, 0.452, 0.3094, 0.4717]}, {"w": "of", "b": [0.3157, 0.452, 0.3367, 0.4717]}, {"w": "words.", "b": [0.343, 0.452, 0.411, 0.4717]}]}, {"id": "b_3", "type": "paragraph", "text": "Here’s a simple example. Consider the sentence “The cat sat on the mat.” It may be decomposed into the following set of 2-grams:", "words": [{"w": "Here’s", "b": [0.1294, 0.4948, 0.1952, 0.5145]}, {"w": "a", "b": [0.2016, 0.4948, 0.2128, 0.5145]}, {"w": "simple", "b": [0.2191, 0.4948, 0.2863, 0.5145]}, {"w": "example.", "b": [0.2926, 0.4948, 0.3844, 0.5145]}, {"w": "Consider", "b": [0.3907, 0.4948, 0.4818, 0.5145]}, {"w": "the", "b": [0.4881, 0.4948, 0.5189, 0.5145]}, {"w": "sentence", "b": [0.5252, 0.4948, 0.6121, 0.5145]}, {"w": "“The", "b": [0.6184, 0.4948, 0.6688, 0.5145]}, {"w": "cat", "b": [0.6751, 0.4948, 0.7046, 0.5145]}, {"w": "sat", "b": [0.7109, 0.4948, 0.7389, 0.5145]}, {"w": "on", "b": [0.7452, 0.4948, 0.7704, 0.5145]}, {"w": "the", "b": [0.7767, 0.4948, 0.8075, 0.5145]}, {"w": "mat.”", "b": [0.8139, 0.4948, 0.8692, 0.5145]}, {"w": "It", "b": [0.1294, 0.5153, 0.1448, 0.535]}, {"w": "may", "b": [0.1511, 0.5153, 0.1946, 0.535]}, {"w": "be", "b": [0.2009, 0.5153, 0.2247, 0.535]}, {"w": "decomposed", "b": [0.231, 0.5153, 0.3571, 0.535]}, {"w": "into", "b": [0.3634, 0.5153, 0.4027, 0.535]}, {"w": "the", "b": [0.409, 0.5153, 0.4398, 0.535]}, {"w": "following", "b": [0.4461, 0.5153, 0.5442, 0.535]}, {"w": "set", "b": [0.5505, 0.5153, 0.5785, 0.535]}, {"w": "of", "b": [0.5848, 0.5153, 0.6059, 0.535]}, {"w": "2-grams:", "b": [0.6122, 0.5153, 0.7018, 0.535]}]}, {"id": "b_4", "type": "paragraph", "text": "{\"The\", \"The cat\", \"cat\", \"cat sat\", \"sat\", \"sat on\", \"on\", \"on the\", \"the\", \"the mat\", \"mat\"}", "words": [{"w": "{\"The\",", "b": [0.1357, 0.553, 0.2152, 0.5682]}, {"w": "\"The", "b": [0.2265, 0.553, 0.2719, 0.5682]}, {"w": "cat\",", "b": [0.2833, 0.553, 0.34, 0.5682]}, {"w": "\"cat\",", "b": [0.3514, 0.553, 0.4195, 0.5682]}, {"w": "\"cat", "b": [0.4309, 0.553, 0.4763, 0.5682]}, {"w": "sat\",", "b": [0.4876, 0.553, 0.5444, 0.5682]}, {"w": "\"sat\",", "b": [0.5557, 0.553, 0.6238, 0.5682]}, {"w": "\"sat", "b": [0.1584, 0.5682, 0.2038, 0.5833]}, {"w": "on\",", "b": [0.2152, 0.5682, 0.2606, 0.5833]}, {"w": "\"on\",", "b": [0.2719, 0.5682, 0.3287, 0.5833]}, {"w": "\"on", "b": [0.34, 0.5682, 0.3741, 0.5833]}, {"w": "the\",", "b": [0.3855, 0.5682, 0.4422, 0.5833]}, {"w": "\"the\",", "b": [0.4536, 0.5682, 0.5217, 0.5833]}, {"w": "\"the", "b": [0.533, 0.5682, 0.5784, 0.5833]}, {"w": "mat\",", "b": [0.5898, 0.5682, 0.6465, 0.5833]}, {"w": "\"mat\"}", "b": [0.6579, 0.5682, 0.726, 0.5833]}]}, {"id": "b_5", "type": "equation", "text": "It may also be decomposed into the following set of 3-grams:", "words": [{"w": "It", "b": [0.1294, 0.6062, 0.1448, 0.6259]}, {"w": "may", "b": [0.1511, 0.6062, 0.1946, 0.6259]}, {"w": "also", "b": [0.2009, 0.6062, 0.2415, 0.6259]}, {"w": "be", "b": [0.2478, 0.6062, 0.2716, 0.6259]}, {"w": "decomposed", "b": [0.2779, 0.6062, 0.404, 0.6259]}, {"w": "into", "b": [0.4104, 0.6062, 0.4496, 0.6259]}, {"w": "the", "b": [0.4559, 0.6062, 0.4867, 0.6259]}, {"w": "following", "b": [0.493, 0.6062, 0.5911, 0.6259]}, {"w": "set", "b": [0.5975, 0.6062, 0.6255, 0.6259]}, {"w": "of", "b": [0.6318, 0.6062, 0.6528, 0.6259]}, {"w": "3-grams:", "b": [0.6591, 0.6062, 0.7488, 0.6259]}]}, {"id": "b_6", "type": "paragraph", "text": "{\"The\", \"The cat\", \"cat\", \"cat sat\", \"The cat sat\", \"sat\", \"sat on\", \"on\", \"cat sat on\", \"on the\", \"the\", \"sat on the\", \"the mat\", \"mat\", \"on the mat\"}", "words": [{"w": "{\"The\",", "b": [0.1357, 0.6439, 0.2152, 0.6591]}, {"w": "\"The", "b": [0.2265, 0.6439, 0.2719, 0.6591]}, {"w": "cat\",", "b": [0.2833, 0.6439, 0.34, 0.6591]}, {"w": "\"cat\",", "b": [0.3514, 0.6439, 0.4195, 0.6591]}, {"w": "\"cat", "b": [0.4309, 0.6439, 0.4763, 0.6591]}, {"w": "sat\",", "b": [0.4876, 0.6439, 0.5444, 0.6591]}, {"w": "\"The", "b": [0.5557, 0.6439, 0.6011, 0.6591]}, {"w": "cat", "b": [0.6125, 0.6439, 0.6465, 0.6591]}, {"w": "sat\",", "b": [0.6579, 0.6439, 0.7146, 0.6591]}, {"w": "\"sat\",", "b": [0.1584, 0.6591, 0.2265, 0.6742]}, {"w": "\"sat", "b": [0.2379, 0.6591, 0.2833, 0.6742]}, {"w": "on\",", "b": [0.2946, 0.6591, 0.34, 0.6742]}, {"w": "\"on\",", "b": [0.3514, 0.6591, 0.4082, 0.6742]}, {"w": "\"cat", "b": [0.4195, 0.6591, 0.4649, 0.6742]}, {"w": "sat", "b": [0.4763, 0.6591, 0.5103, 0.6742]}, {"w": "on\",", "b": [0.5217, 0.6591, 0.5671, 0.6742]}, {"w": "\"on", "b": [0.5784, 0.6591, 0.6125, 0.6742]}, {"w": "the\",", "b": [0.6238, 0.6591, 0.6806, 0.6742]}, {"w": "\"the\",", "b": [0.6919, 0.6591, 0.7601, 0.6742]}, {"w": "\"sat", "b": [0.1584, 0.6742, 0.2038, 0.6894]}, {"w": "on", "b": [0.2152, 0.6742, 0.2379, 0.6894]}, {"w": "the\",", "b": [0.2492, 0.6742, 0.306, 0.6894]}, {"w": "\"the", "b": [0.3173, 0.6742, 0.3628, 0.6894]}, {"w": "mat\",", "b": [0.3741, 0.6742, 0.4309, 0.6894]}, {"w": "\"mat\",", "b": [0.4422, 0.6742, 0.5103, 0.6894]}, {"w": "\"on", "b": [0.5217, 0.6742, 0.5557, 0.6894]}, {"w": "the", "b": [0.5671, 0.6742, 0.6011, 0.6894]}, {"w": "mat\"}", "b": [0.6125, 0.6742, 0.6692, 0.6894]}]}, {"id": "b_7", "type": "paragraph", "text": "Such a set is called a bag-of-2-grams or bag-of-3-grams, respectively. The term bag here refers to the fact that you’re dealing with a set of tokens rather than a list or sequence: the tokens have no specific order. This family of tokenization methods is called bag-of-words.", "words": [{"w": "Such", "b": [0.1294, 0.7123, 0.1799, 0.732]}, {"w": "a", "b": [0.1862, 0.7123, 0.1974, 0.732]}, {"w": "set", "b": [0.2037, 0.7123, 0.2317, 0.732]}, {"w": "is", "b": [0.238, 0.7123, 0.2548, 0.732]}, {"w": "called", "b": [0.2611, 0.7123, 0.3214, 0.732]}, {"w": "a", "b": [0.3277, 0.7123, 0.3389, 0.732]}, {"w": "bag-of-2-grams", "b": [0.3452, 0.7123, 0.5035, 0.732]}, {"w": "or", "b": [0.5098, 0.7123, 0.5308, 0.732]}, {"w": "bag-of-3-grams,", "b": [0.5371, 0.7123, 0.7018, 0.732]}, {"w": "respectively.", "b": [0.7081, 0.7123, 0.8346, 0.732]}, {"w": "The", "b": [0.1294, 0.7328, 0.1686, 0.7525]}, {"w": "term", "b": [0.1749, 0.7328, 0.2212, 0.7525]}, {"w": "bag", "b": [0.2275, 0.7328, 0.2653, 0.7525]}, {"w": "here", "b": [0.2716, 0.7328, 0.315, 0.7525]}, {"w": "refers", "b": [0.3213, 0.7328, 0.3787, 0.7525]}, {"w": "to", "b": [0.385, 0.7328, 0.4047, 0.7525]}, {"w": "the", "b": [0.411, 0.7328, 0.4418, 0.7525]}, {"w": "fact", "b": [0.4481, 0.7328, 0.4859, 0.7525]}, {"w": "that", "b": [0.4922, 0.7328, 0.5301, 0.7525]}, {"w": "you’re", "b": [0.5364, 0.7328, 0.6022, 0.7525]}, {"w": "dealing", "b": [0.6085, 0.7328, 0.6828, 0.7525]}, {"w": "with", "b": [0.6891, 0.7328, 0.7339, 0.7525]}, {"w": "a", "b": [0.7402, 0.7328, 0.7514, 0.7525]}, {"w": "set", "b": [0.7577, 0.7328, 0.7857, 0.7525]}, {"w": "of", "b": [0.792, 0.7328, 0.813, 0.7525]}, {"w": "tokens", "b": [0.1294, 0.7533, 0.1953, 0.773]}, {"w": "rather", "b": [0.2016, 0.7533, 0.2604, 0.773]}, {"w": "than", "b": [0.2667, 0.7533, 0.3102, 0.773]}, {"w": "a", "b": [0.3165, 0.7533, 0.3277, 0.773]}, {"w": "list", "b": [0.334, 0.7533, 0.3648, 0.773]}, {"w": "or", "b": [0.3711, 0.7533, 0.3921, 0.773]}, {"w": "sequence:", "b": [0.3984, 0.7533, 0.4979, 0.773]}, {"w": "the", "b": [0.5042, 0.7533, 0.535, 0.773]}, {"w": "tokens", "b": [0.5413, 0.7533, 0.6072, 0.773]}, {"w": "have", "b": [0.6135, 0.7533, 0.6611, 0.773]}, {"w": "no", "b": [0.6675, 0.7533, 0.6927, 0.773]}, {"w": "specific", "b": [0.699, 0.7533, 0.7774, 0.773]}, {"w": "order.", "b": [0.7837, 0.7533, 0.8418, 0.773]}, {"w": "This", "b": [0.1294, 0.7738, 0.1743, 0.7935]}, {"w": "family", "b": [0.1806, 0.7738, 0.2464, 0.7935]}, {"w": "of", "b": [0.2527, 0.7738, 0.2738, 0.7935]}, {"w": "tokenization", "b": [0.2801, 0.7738, 0.4048, 0.7935]}, {"w": "methods", "b": [0.4111, 0.7738, 0.4966, 0.7935]}, {"w": "is", "b": [0.5029, 0.7738, 0.5197, 0.7935]}, {"w": "called", "b": [0.526, 0.7738, 0.5863, 0.7935]}, {"w": "bag-of-words.", "b": [0.5925, 0.7738, 0.7338, 0.7935]}]}, {"id": "b_8", "type": "paragraph", "text": "Because bag-of-words isn’t an order-preserving tokenization method (the tokens generated are understood as a set, not a sequence, and the general structure of the sentences is lost), it tends to be used in shallow language- processing models rather than in deep-learning models. Extracting n-", "words": [{"w": "Because", "b": [0.1294, 0.8166, 0.2135, 0.8363]}, {"w": "bag-of-words", "b": [0.2198, 0.8166, 0.3557, 0.8363]}, {"w": "isn’t", "b": [0.362, 0.8166, 0.4064, 0.8363]}, {"w": "an", "b": [0.4127, 0.8166, 0.4365, 0.8363]}, {"w": "order-preserving", "b": [0.4428, 0.8166, 0.6104, 0.8363]}, {"w": "tokenization", "b": [0.6167, 0.8166, 0.7414, 0.8363]}, {"w": "method", "b": [0.7477, 0.8166, 0.8234, 0.8363]}, {"w": "(the", "b": [0.8297, 0.8166, 0.8689, 0.8363]}, {"w": "tokens", "b": [0.1294, 0.8371, 0.1953, 0.8568]}, {"w": "generated", "b": [0.2016, 0.8371, 0.2996, 0.8568]}, {"w": "are", "b": [0.3059, 0.8371, 0.3367, 0.8568]}, {"w": "understood", "b": [0.343, 0.8371, 0.4552, 0.8568]}, {"w": "as", "b": [0.4615, 0.8371, 0.4825, 0.8568]}, {"w": "a", "b": [0.4888, 0.8371, 0.5, 0.8568]}, {"w": "set,", "b": [0.5063, 0.8371, 0.5406, 0.8568]}, {"w": "not", "b": [0.5469, 0.8371, 0.5792, 0.8568]}, {"w": "a", "b": [0.5855, 0.8371, 0.5967, 0.8568]}, {"w": "sequence,", "b": [0.603, 0.8371, 0.7017, 0.8568]}, {"w": "and", "b": [0.708, 0.8371, 0.7444, 0.8568]}, {"w": "the", "b": [0.7507, 0.8371, 0.7815, 0.8568]}, {"w": "general", "b": [0.7878, 0.8371, 0.8621, 0.8568]}, {"w": "structure", "b": [0.1294, 0.8576, 0.2177, 0.8773]}, {"w": "of", "b": [0.224, 0.8576, 0.245, 0.8773]}, {"w": "the", "b": [0.2513, 0.8576, 0.2821, 0.8773]}, {"w": "sentences", "b": [0.2884, 0.8576, 0.3851, 0.8773]}, {"w": "is", "b": [0.3914, 0.8576, 0.4082, 0.8773]}, {"w": "lost),", "b": [0.4145, 0.8576, 0.4657, 0.8773]}, {"w": "it", "b": [0.472, 0.8576, 0.486, 0.8773]}, {"w": "tends", "b": [0.4923, 0.8576, 0.5456, 0.8773]}, {"w": "to", "b": [0.5519, 0.8576, 0.5715, 0.8773]}, {"w": "be", "b": [0.5778, 0.8576, 0.6016, 0.8773]}, {"w": "used", "b": [0.6079, 0.8576, 0.6542, 0.8773]}, {"w": "in", "b": [0.6605, 0.8576, 0.6801, 0.8773]}, {"w": "shallow", "b": [0.6864, 0.8576, 0.7649, 0.8773]}, {"w": "language-", "b": [0.7712, 0.8576, 0.8707, 0.8773]}, {"w": "processing", "b": [0.1294, 0.8781, 0.2373, 0.8978]}, {"w": "models", "b": [0.2436, 0.8781, 0.3165, 0.8978]}, {"w": "rather", "b": [0.3228, 0.8781, 0.3816, 0.8978]}, {"w": "than", "b": [0.3879, 0.8781, 0.4314, 0.8978]}, {"w": "in", "b": [0.4376, 0.8781, 0.4573, 0.8978]}, {"w": "deep-learning", "b": [0.4636, 0.8781, 0.6023, 0.8978]}, {"w": "models.", "b": [0.6086, 0.8781, 0.6878, 0.8978]}, {"w": "Extracting", "b": [0.6941, 0.8781, 0.7991, 0.8978]}, {"w": "n-", "b": [0.8055, 0.8781, 0.8265, 0.8978]}]}]}, {"page": 241, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "grams is a form of feature engineering, and deep learning does away with this kind of rigid, brittle approach, replacing it with hierarchical feature learning. One-dimensional convnets and recurrent neural networks, introduced later in this chapter, are capable of learning representations for groups of words and characters without being explicitly told about the existence of such groups, by looking at continuous word or character sequences. For this reason, we won’t cover n-grams any further in this book. But do keep in mind that they’re a powerful, unavoidable feature-engineering tool when using lightweight, shallow text-processing models such as logistic regression and random forests.", "words": [{"w": "grams", "b": [0.1294, 0.0857, 0.1911, 0.1054]}, {"w": "is", "b": [0.1974, 0.0857, 0.2142, 0.1054]}, {"w": "a", "b": [0.2205, 0.0857, 0.2317, 0.1054]}, {"w": "form", "b": [0.238, 0.0857, 0.287, 0.1054]}, {"w": "of", "b": [0.2934, 0.0857, 0.3144, 0.1054]}, {"w": "feature", "b": [0.3207, 0.0857, 0.3907, 0.1054]}, {"w": "engineering,", "b": [0.397, 0.0857, 0.5224, 0.1054]}, {"w": "and", "b": [0.5287, 0.0857, 0.5651, 0.1054]}, {"w": "deep", "b": [0.5714, 0.0857, 0.6191, 0.1054]}, {"w": "learning", "b": [0.6254, 0.0857, 0.708, 0.1054]}, {"w": "does", "b": [0.7143, 0.0857, 0.7606, 0.1054]}, {"w": "away", "b": [0.7669, 0.0857, 0.8201, 0.1054]}, {"w": "with", "b": [0.1294, 0.1062, 0.1743, 0.1259]}, {"w": "this", "b": [0.1806, 0.1062, 0.217, 0.1259]}, {"w": "kind", "b": [0.2233, 0.1062, 0.2682, 0.1259]}, {"w": "of", "b": [0.2745, 0.1062, 0.2955, 0.1259]}, {"w": "rigid,", "b": [0.3018, 0.1062, 0.3557, 0.1259]}, {"w": "brittle", "b": [0.362, 0.1062, 0.4223, 0.1259]}, {"w": "approach,", "b": [0.4286, 0.1062, 0.5274, 0.1259]}, {"w": "replacing", "b": [0.5337, 0.1062, 0.6275, 0.1259]}, {"w": "it", "b": [0.6338, 0.1062, 0.6479, 0.1259]}, {"w": "with", "b": [0.6542, 0.1062, 0.699, 0.1259]}, {"w": "hierarchical", "b": [0.7053, 0.1062, 0.8244, 0.1259]}, {"w": "feature", "b": [0.1294, 0.1267, 0.1994, 0.1464]}, {"w": "learning.", "b": [0.2057, 0.1267, 0.2947, 0.1464]}, {"w": "One-dimensional", "b": [0.301, 0.1267, 0.4748, 0.1464]}, {"w": "convnets", "b": [0.4811, 0.1267, 0.5708, 0.1464]}, {"w": "and", "b": [0.5771, 0.1267, 0.6135, 0.1464]}, {"w": "recurrent", "b": [0.6198, 0.1267, 0.7108, 0.1464]}, {"w": "neural", "b": [0.7171, 0.1267, 0.7802, 0.1464]}, {"w": "networks,", "b": [0.1294, 0.1472, 0.2282, 0.1669]}, {"w": "introduced", "b": [0.2345, 0.1472, 0.3424, 0.1669]}, {"w": "later", "b": [0.3487, 0.1472, 0.3935, 0.1669]}, {"w": "in", "b": [0.3998, 0.1472, 0.4194, 0.1669]}, {"w": "this", "b": [0.4258, 0.1472, 0.4622, 0.1669]}, {"w": "chapter,", "b": [0.4685, 0.1472, 0.548, 0.1669]}, {"w": "are", "b": [0.5543, 0.1472, 0.5851, 0.1669]}, {"w": "capable", "b": [0.5914, 0.1472, 0.6684, 0.1669]}, {"w": "of", "b": [0.6748, 0.1472, 0.6958, 0.1669]}, {"w": "learning", "b": [0.7021, 0.1472, 0.7847, 0.1669]}, {"w": "representations", "b": [0.1294, 0.1677, 0.2821, 0.1874]}, {"w": "for", "b": [0.2884, 0.1677, 0.3178, 0.1874]}, {"w": "groups", "b": [0.3242, 0.1677, 0.3928, 0.1874]}, {"w": "of", "b": [0.3991, 0.1677, 0.4201, 0.1874]}, {"w": "words", "b": [0.4264, 0.1677, 0.4881, 0.1874]}, {"w": "and", "b": [0.4944, 0.1677, 0.5308, 0.1874]}, {"w": "characters", "b": [0.5371, 0.1677, 0.6394, 0.1874]}, {"w": "without", "b": [0.6457, 0.1677, 0.7228, 0.1874]}, {"w": "being", "b": [0.7291, 0.1677, 0.7851, 0.1874]}, {"w": "explicitly", "b": [0.1294, 0.1882, 0.2247, 0.2079]}, {"w": "told", "b": [0.231, 0.1882, 0.2703, 0.2079]}, {"w": "about", "b": [0.2766, 0.1882, 0.3326, 0.2079]}, {"w": "the", "b": [0.3389, 0.1882, 0.3698, 0.2079]}, {"w": "existence", "b": [0.3761, 0.1882, 0.4699, 0.2079]}, {"w": "of", "b": [0.4762, 0.1882, 0.4973, 0.2079]}, {"w": "such", "b": [0.5036, 0.1882, 0.5498, 0.2079]}, {"w": "groups,", "b": [0.5561, 0.1882, 0.6311, 0.2079]}, {"w": "by", "b": [0.6374, 0.1882, 0.6626, 0.2079]}, {"w": "looking", "b": [0.6689, 0.1882, 0.746, 0.2079]}, {"w": "at", "b": [0.7523, 0.1882, 0.7705, 0.2079]}, {"w": "continuous", "b": [0.1294, 0.2087, 0.2401, 0.2284]}, {"w": "word", "b": [0.2464, 0.2087, 0.2983, 0.2284]}, {"w": "or", "b": [0.3046, 0.2087, 0.3256, 0.2284]}, {"w": "character", "b": [0.3319, 0.2087, 0.4243, 0.2284]}, {"w": "sequences.", "b": [0.4306, 0.2087, 0.5392, 0.2284]}, {"w": "For", "b": [0.5455, 0.2087, 0.5805, 0.2284]}, {"w": "this", "b": [0.5869, 0.2087, 0.6233, 0.2284]}, {"w": "reason,", "b": [0.6296, 0.2087, 0.7018, 0.2284]}, {"w": "we", "b": [0.708, 0.2087, 0.7374, 0.2284]}, {"w": "won’t", "b": [0.7437, 0.2087, 0.8021, 0.2284]}, {"w": "cover", "b": [0.8085, 0.2087, 0.8645, 0.2284]}, {"w": "n-grams", "b": [0.1294, 0.2292, 0.2121, 0.2489]}, {"w": "any", "b": [0.2184, 0.2292, 0.2548, 0.2489]}, {"w": "further", "b": [0.2611, 0.2292, 0.3298, 0.2489]}, {"w": "in", "b": [0.3361, 0.2292, 0.3557, 0.2489]}, {"w": "this", "b": [0.362, 0.2292, 0.3984, 0.2489]}, {"w": "book.", "b": [0.4048, 0.2292, 0.4615, 0.2489]}, {"w": "But", "b": [0.4678, 0.2292, 0.5043, 0.2489]}, {"w": "do", "b": [0.5106, 0.2292, 0.5358, 0.2489]}, {"w": "keep", "b": [0.5421, 0.2292, 0.5897, 0.2489]}, {"w": "in", "b": [0.596, 0.2292, 0.6157, 0.2489]}, {"w": "mind", "b": [0.622, 0.2292, 0.6738, 0.2489]}, {"w": "that", "b": [0.6801, 0.2292, 0.718, 0.2489]}, {"w": "they’re", "b": [0.7243, 0.2292, 0.7957, 0.2489]}, {"w": "a", "b": [0.802, 0.2292, 0.8132, 0.2489]}, {"w": "powerful,", "b": [0.1294, 0.2497, 0.2268, 0.2694]}, {"w": "unavoidable", "b": [0.2331, 0.2497, 0.3564, 0.2694]}, {"w": "feature-engineering", "b": [0.3627, 0.2497, 0.5602, 0.2694]}, {"w": "tool", "b": [0.5664, 0.2497, 0.6057, 0.2694]}, {"w": "when", "b": [0.612, 0.2497, 0.6666, 0.2694]}, {"w": "using", "b": [0.673, 0.2497, 0.7276, 0.2694]}, {"w": "lightweight,", "b": [0.7339, 0.2497, 0.8552, 0.2694]}, {"w": "shallow", "b": [0.1294, 0.2702, 0.2079, 0.2899]}, {"w": "text-processing", "b": [0.2142, 0.2702, 0.3683, 0.2899]}, {"w": "models", "b": [0.3746, 0.2702, 0.4475, 0.2899]}, {"w": "such", "b": [0.4538, 0.2702, 0.5001, 0.2899]}, {"w": "as", "b": [0.5064, 0.2702, 0.5274, 0.2899]}, {"w": "logistic", "b": [0.5337, 0.2702, 0.608, 0.2899]}, {"w": "regression", "b": [0.6143, 0.2702, 0.718, 0.2899]}, {"w": "and", "b": [0.7243, 0.2702, 0.7607, 0.2899]}, {"w": "random", "b": [0.767, 0.2702, 0.8441, 0.2899]}, {"w": "forests.", "b": [0.1294, 0.2907, 0.203, 0.3104]}]}, {"id": "b_1", "type": "equation", "text": "6.1.1. One-hot encoding of words and characters", "words": [{"w": "6.1.1.", "b": [0.1294, 0.3647, 0.1862, 0.3844]}, {"w": "One-hot", "b": [0.1925, 0.3647, 0.2808, 0.3844]}, {"w": "encoding", "b": [0.2871, 0.3647, 0.3838, 0.3844]}, {"w": "of", "b": [0.3901, 0.3647, 0.4111, 0.3844]}, {"w": "words", "b": [0.4174, 0.3647, 0.4833, 0.3844]}, {"w": "and", "b": [0.4896, 0.3647, 0.5302, 0.3844]}, {"w": "characters", "b": [0.5366, 0.3647, 0.65, 0.3844]}]}, {"id": "b_2", "type": "paragraph", "text": "One-hot encoding is the most common, most basic way to turn a token into a vector. You saw it in action in the initial IMDB and Reuters examples in chapter 3 (done with words, in that case). It consists of associating a unique integer index with every word and then turning this integer index i into a binary vector of size N (the size of the vocabulary); the vector is all zeros except for the ith entry, which is 1.", "words": [{"w": "One-hot", "b": [0.1294, 0.4074, 0.2121, 0.4272]}, {"w": "encoding", "b": [0.2184, 0.4074, 0.3109, 0.4272]}, {"w": "is", "b": [0.3172, 0.4074, 0.334, 0.4272]}, {"w": "the", "b": [0.3403, 0.4074, 0.3711, 0.4272]}, {"w": "most", "b": [0.3774, 0.4074, 0.4265, 0.4272]}, {"w": "common,", "b": [0.4328, 0.4074, 0.5274, 0.4272]}, {"w": "most", "b": [0.5337, 0.4074, 0.5828, 0.4272]}, {"w": "basic", "b": [0.5891, 0.4074, 0.6409, 0.4272]}, {"w": "way", "b": [0.6472, 0.4074, 0.6892, 0.4272]}, {"w": "to", "b": [0.6956, 0.4074, 0.7152, 0.4272]}, {"w": "turn", "b": [0.7215, 0.4074, 0.7621, 0.4272]}, {"w": "a", "b": [0.7684, 0.4074, 0.7796, 0.4272]}, {"w": "token", "b": [0.7859, 0.4074, 0.842, 0.4272]}, {"w": "into", "b": [0.1294, 0.4279, 0.1687, 0.4477]}, {"w": "a", "b": [0.175, 0.4279, 0.1862, 0.4477]}, {"w": "vector.", "b": [0.1925, 0.4279, 0.2604, 0.4477]}, {"w": "You", "b": [0.2667, 0.4279, 0.3076, 0.4477]}, {"w": "saw", "b": [0.3139, 0.4279, 0.3532, 0.4477]}, {"w": "it", "b": [0.3595, 0.4279, 0.3735, 0.4477]}, {"w": "in", "b": [0.3798, 0.4279, 0.3994, 0.4477]}, {"w": "action", "b": [0.4057, 0.4279, 0.4674, 0.4477]}, {"w": "in", "b": [0.4737, 0.4279, 0.4933, 0.4477]}, {"w": "the", "b": [0.4996, 0.4279, 0.5304, 0.4477]}, {"w": "initial", "b": [0.5368, 0.4279, 0.5956, 0.4477]}, {"w": "IMDB", "b": [0.6019, 0.4279, 0.6678, 0.4477]}, {"w": "and", "b": [0.6741, 0.4279, 0.7105, 0.4477]}, {"w": "Reuters", "b": [0.7168, 0.4279, 0.7938, 0.4477]}, {"w": "examples", "b": [0.1294, 0.4484, 0.2247, 0.4682]}, {"w": "in", "b": [0.231, 0.4484, 0.2506, 0.4682]}, {"w": "chapter", "b": [0.2569, 0.4484, 0.3311, 0.4682]}, {"w": "3", "b": [0.3374, 0.4484, 0.3501, 0.4682]}, {"w": "(done", "b": [0.3563, 0.4484, 0.4138, 0.4682]}, {"w": "with", "b": [0.4201, 0.4484, 0.4649, 0.4682]}, {"w": "words,", "b": [0.4712, 0.4484, 0.5392, 0.4682]}, {"w": "in", "b": [0.5455, 0.4484, 0.5651, 0.4682]}, {"w": "that", "b": [0.5714, 0.4484, 0.6093, 0.4682]}, {"w": "case).", "b": [0.6156, 0.4484, 0.6737, 0.4682]}, {"w": "It", "b": [0.68, 0.4484, 0.6954, 0.4682]}, {"w": "consists", "b": [0.7017, 0.4484, 0.7816, 0.4682]}, {"w": "of", "b": [0.7879, 0.4484, 0.8089, 0.4682]}, {"w": "associating", "b": [0.1294, 0.4689, 0.2415, 0.4887]}, {"w": "a", "b": [0.2478, 0.4689, 0.259, 0.4887]}, {"w": "unique", "b": [0.2653, 0.4689, 0.334, 0.4887]}, {"w": "integer", "b": [0.3403, 0.4689, 0.4104, 0.4887]}, {"w": "index", "b": [0.4167, 0.4689, 0.4727, 0.4887]}, {"w": "with", "b": [0.479, 0.4689, 0.5239, 0.4887]}, {"w": "every", "b": [0.5302, 0.4689, 0.5862, 0.4887]}, {"w": "word", "b": [0.5925, 0.4689, 0.6443, 0.4887]}, {"w": "and", "b": [0.6507, 0.4689, 0.6871, 0.4887]}, {"w": "then", "b": [0.6934, 0.4689, 0.7368, 0.4887]}, {"w": "turning", "b": [0.7431, 0.4689, 0.816, 0.4887]}, {"w": "this", "b": [0.8223, 0.4689, 0.8588, 0.4887]}, {"w": "integer", "b": [0.1294, 0.4894, 0.1995, 0.5092]}, {"w": "index", "b": [0.2058, 0.4894, 0.2618, 0.5092]}, {"w": "i", "b": [0.2681, 0.4894, 0.2751, 0.5092]}, {"w": "into", "b": [0.2814, 0.4894, 0.3206, 0.5092]}, {"w": "a", "b": [0.327, 0.4894, 0.3382, 0.5092]}, {"w": "binary", "b": [0.3445, 0.4894, 0.4089, 0.5092]}, {"w": "vector", "b": [0.4152, 0.4894, 0.4783, 0.5092]}, {"w": "of", "b": [0.4846, 0.4894, 0.5056, 0.5092]}, {"w": "size", "b": [0.5119, 0.4894, 0.5511, 0.5092]}, {"w": "N", "b": [0.5574, 0.4894, 0.5742, 0.5092]}, {"w": "(the", "b": [0.5805, 0.4894, 0.6197, 0.5092]}, {"w": "size", "b": [0.626, 0.4894, 0.6652, 0.5092]}, {"w": "of", "b": [0.6715, 0.4894, 0.6926, 0.5092]}, {"w": "the", "b": [0.6989, 0.4894, 0.7297, 0.5092]}, {"w": "vocabulary);", "b": [0.736, 0.4894, 0.8635, 0.5092]}, {"w": "the", "b": [0.1294, 0.5099, 0.1602, 0.5297]}, {"w": "vector", "b": [0.1665, 0.5099, 0.2296, 0.5297]}, {"w": "is", "b": [0.2359, 0.5099, 0.2527, 0.5297]}, {"w": "all", "b": [0.259, 0.5099, 0.2842, 0.5297]}, {"w": "zeros", "b": [0.2906, 0.5099, 0.3438, 0.5297]}, {"w": "except", "b": [0.3501, 0.5099, 0.4159, 0.5297]}, {"w": "for", "b": [0.4222, 0.5099, 0.4516, 0.5297]}, {"w": "the", "b": [0.458, 0.5099, 0.4888, 0.5297]}, {"w": "ith", "b": [0.495, 0.5099, 0.5216, 0.5297]}, {"w": "entry,", "b": [0.5279, 0.5099, 0.5844, 0.5297]}, {"w": "which", "b": [0.5907, 0.5099, 0.6524, 0.5297]}, {"w": "is", "b": [0.6587, 0.5099, 0.6755, 0.5297]}, {"w": "1.", "b": [0.6818, 0.5099, 0.7007, 0.5297]}]}, {"id": "b_3", "type": "paragraph", "text": "Of course, one-hot encoding can be done at the character level, as well. To unambiguously drive home what one-hot encoding is and how to implement it, listings 6.1 and 6.2 show two toy examples: one for words, the other for characters.", "words": [{"w": "Of", "b": [0.1294, 0.5527, 0.156, 0.5725]}, {"w": "course,", "b": [0.1623, 0.5527, 0.2345, 0.5725]}, {"w": "one-hot", "b": [0.2408, 0.5527, 0.3178, 0.5725]}, {"w": "encoding", "b": [0.3242, 0.5527, 0.4166, 0.5725]}, {"w": "can", "b": [0.4229, 0.5527, 0.458, 0.5725]}, {"w": "be", "b": [0.4643, 0.5527, 0.4881, 0.5725]}, {"w": "done", "b": [0.4944, 0.5527, 0.5434, 0.5725]}, {"w": "at", "b": [0.5497, 0.5527, 0.5679, 0.5725]}, {"w": "the", "b": [0.5742, 0.5527, 0.6051, 0.5725]}, {"w": "character", "b": [0.6114, 0.5527, 0.7038, 0.5725]}, {"w": "level,", "b": [0.7101, 0.5527, 0.7655, 0.5725]}, {"w": "as", "b": [0.7718, 0.5527, 0.7928, 0.5725]}, {"w": "well.", "b": [0.7991, 0.5527, 0.8488, 0.5725]}, {"w": "To", "b": [0.1294, 0.5732, 0.1557, 0.593]}, {"w": "unambiguously", "b": [0.162, 0.5732, 0.3175, 0.593]}, {"w": "drive", "b": [0.3239, 0.5732, 0.3757, 0.593]}, {"w": "home", "b": [0.382, 0.5732, 0.438, 0.593]}, {"w": "what", "b": [0.4444, 0.5732, 0.4934, 0.593]}, {"w": "one-hot", "b": [0.4997, 0.5732, 0.5768, 0.593]}, {"w": "encoding", "b": [0.5831, 0.5732, 0.6756, 0.593]}, {"w": "is", "b": [0.6818, 0.5732, 0.6986, 0.593]}, {"w": "and", "b": [0.7049, 0.5732, 0.7414, 0.593]}, {"w": "how", "b": [0.7477, 0.5732, 0.7911, 0.593]}, {"w": "to", "b": [0.7974, 0.5732, 0.817, 0.593]}, {"w": "implement", "b": [0.1294, 0.5937, 0.2373, 0.6135]}, {"w": "it,", "b": [0.2436, 0.5937, 0.264, 0.6135]}, {"w": "listings", "b": [0.2702, 0.5937, 0.3431, 0.6135]}, {"w": "6.1", "b": [0.3494, 0.5937, 0.381, 0.6135]}, {"w": "and", "b": [0.3872, 0.5937, 0.4237, 0.6135]}, {"w": "6.2", "b": [0.43, 0.5937, 0.4615, 0.6135]}, {"w": "show", "b": [0.4678, 0.5937, 0.5211, 0.6135]}, {"w": "two", "b": [0.5274, 0.5937, 0.5652, 0.6135]}, {"w": "toy", "b": [0.5715, 0.5937, 0.6038, 0.6135]}, {"w": "examples:", "b": [0.6101, 0.5937, 0.7124, 0.6135]}, {"w": "one", "b": [0.7187, 0.5937, 0.7551, 0.6135]}, {"w": "for", "b": [0.7614, 0.5937, 0.7908, 0.6135]}, {"w": "words,", "b": [0.7971, 0.5937, 0.8651, 0.6135]}, {"w": "the", "b": [0.1294, 0.6142, 0.1602, 0.634]}, {"w": "other", "b": [0.1665, 0.6142, 0.2184, 0.634]}, {"w": "for", "b": [0.2247, 0.6142, 0.2541, 0.634]}, {"w": "characters.", "b": [0.2604, 0.6142, 0.369, 0.634]}]}, {"id": "b_4", "type": "equation", "text": "Listing 6.1. Word-level one-hot encoding (toy example)", "words": [{"w": "Listing", "b": [0.1294, 0.6565, 0.1862, 0.6713]}, {"w": "6.1.", "b": [0.1909, 0.6565, 0.2193, 0.6713]}, {"w": "Word-level", "b": [0.224, 0.6565, 0.3133, 0.6713]}, {"w": "one-hot", "b": [0.3181, 0.6565, 0.379, 0.6713]}, {"w": "encoding", "b": [0.3838, 0.6565, 0.4563, 0.6713]}, {"w": "(toy", "b": [0.461, 0.6565, 0.4925, 0.6713]}, {"w": "example)", "b": [0.4973, 0.6565, 0.5708, 0.6713]}]}, {"id": "b_5", "type": "paragraph", "text": "import numpy as np samples = ['The cat sat on the mat.', 'The dog ate my homework.'] 1 token_index = {} 2 for sample in samples: for word in sample.split(): 3 if word not in token_index: token_index[word] = len(token_index) + 1 4 max_length = 10", "words": [{"w": "import", "b": [0.1357, 0.6849, 0.2038, 0.7001]}, {"w": "numpy", "b": [0.2152, 0.6849, 0.2719, 0.7001]}, {"w": "as", "b": [0.2833, 0.6849, 0.306, 0.7001]}, {"w": "np", "b": [0.3173, 0.6849, 0.34, 0.7001]}, {"w": "samples", "b": [0.1357, 0.7152, 0.2152, 0.7304]}, {"w": "=", "b": [0.2265, 0.7152, 0.2379, 0.7304]}, {"w": "['The", "b": [0.2492, 0.7152, 0.306, 0.7304]}, {"w": "cat", "b": [0.3173, 0.7152, 0.3514, 0.7304]}, {"w": "sat", "b": [0.3628, 0.7152, 0.3968, 0.7304]}, {"w": "on", "b": [0.4082, 0.7152, 0.4309, 0.7304]}, {"w": "the", "b": [0.4422, 0.7152, 0.4763, 0.7304]}, {"w": "mat.',", "b": [0.4876, 0.7152, 0.5557, 0.7304]}, {"w": "'The", "b": [0.5671, 0.7152, 0.6125, 0.7304]}, {"w": "dog", "b": [0.6238, 0.7152, 0.6579, 0.7304]}, {"w": "ate", "b": [0.6692, 0.7152, 0.7033, 0.7304]}, {"w": "my", "b": [0.7146, 0.7152, 0.7374, 0.7304]}, {"w": "homework.']", "b": [0.1357, 0.7304, 0.2606, 0.7455]}, {"w": "1", "b": [0.3287, 0.7304, 0.3401, 0.7455]}, {"w": "token_index", "b": [0.1357, 0.7607, 0.2606, 0.7758]}, {"w": "=", "b": [0.2719, 0.7607, 0.2833, 0.7758]}, {"w": "{}", "b": [0.2946, 0.7607, 0.3173, 0.7758]}, {"w": "2", "b": [0.1357, 0.7759, 0.1471, 0.791]}, {"w": "for", "b": [0.1357, 0.791, 0.1698, 0.8062]}, {"w": "sample", "b": [0.1811, 0.791, 0.2492, 0.8062]}, {"w": "in", "b": [0.2606, 0.791, 0.2833, 0.8062]}, {"w": "samples:", "b": [0.2946, 0.791, 0.3855, 0.8062]}, {"w": "for", "b": [0.1811, 0.8062, 0.2152, 0.8213]}, {"w": "word", "b": [0.2265, 0.8062, 0.2719, 0.8213]}, {"w": "in", "b": [0.2833, 0.8062, 0.306, 0.8213]}, {"w": "sample.split():", "b": [0.3173, 0.8062, 0.4876, 0.8213]}, {"w": "3", "b": [0.1357, 0.8213, 0.1471, 0.8365]}, {"w": "if", "b": [0.2265, 0.8365, 0.2492, 0.8516]}, {"w": "word", "b": [0.2606, 0.8365, 0.306, 0.8516]}, {"w": "not", "b": [0.3173, 0.8365, 0.3514, 0.8516]}, {"w": "in", "b": [0.3628, 0.8365, 0.3855, 0.8516]}, {"w": "token_index:", "b": [0.3968, 0.8365, 0.533, 0.8516]}, {"w": "token_index[word]", "b": [0.2719, 0.8516, 0.4649, 0.8668]}, {"w": "=", "b": [0.4763, 0.8516, 0.4876, 0.8668]}, {"w": "len(token_index)", "b": [0.499, 0.8516, 0.6806, 0.8668]}, {"w": "+", "b": [0.6919, 0.8516, 0.7033, 0.8668]}, {"w": "1", "b": [0.7146, 0.8516, 0.726, 0.8668]}, {"w": "4", "b": [0.1357, 0.8668, 0.1471, 0.8819]}, {"w": "max_length", "b": [0.1357, 0.8971, 0.2492, 0.9122]}, {"w": "=", "b": [0.2606, 0.8971, 0.2719, 0.9122]}, {"w": "10", "b": [0.2833, 0.8971, 0.306, 0.9122]}]}]}, {"page": 242, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "5 results = np.zeros(shape=(len(samples), max_length, max(token_index.values()) + 1)) 6 for i, sample in enumerate(samples): for j, word in list(enumerate(sample.split()))[:max_length]: index = token_index.get(word) results[i, j, index] = 1.", "words": [{"w": "5", "b": [0.1357, 0.0851, 0.1471, 0.1002]}, {"w": "results", "b": [0.1357, 0.1154, 0.2152, 0.1305]}, {"w": "=", "b": [0.2265, 0.1154, 0.2379, 0.1305]}, {"w": "np.zeros(shape=(len(samples),", "b": [0.2492, 0.1154, 0.5784, 0.1305]}, {"w": "max_length,", "b": [0.4309, 0.1305, 0.5557, 0.1457]}, {"w": "max(token_index.values())", "b": [0.4309, 0.1457, 0.7146, 0.1608]}, {"w": "+", "b": [0.726, 0.1457, 0.7374, 0.1608]}, {"w": "1))", "b": [0.7487, 0.1457, 0.7828, 0.1608]}, {"w": "6", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "for", "b": [0.1357, 0.176, 0.1698, 0.1911]}, {"w": "i,", "b": [0.1811, 0.176, 0.2038, 0.1911]}, {"w": "sample", "b": [0.2152, 0.176, 0.2833, 0.1911]}, {"w": "in", "b": [0.2946, 0.176, 0.3173, 0.1911]}, {"w": "enumerate(samples):", "b": [0.3287, 0.176, 0.5444, 0.1911]}, {"w": "for", "b": [0.1811, 0.1912, 0.2152, 0.2063]}, {"w": "j,", "b": [0.2265, 0.1912, 0.2492, 0.2063]}, {"w": "word", "b": [0.2606, 0.1912, 0.306, 0.2063]}, {"w": "in", "b": [0.3173, 0.1912, 0.34, 0.2063]}, {"w": "list(enumerate(sample.split()))[:max_length]:", "b": [0.3514, 0.1912, 0.8622, 0.2063]}, {"w": "index", "b": [0.2265, 0.2063, 0.2833, 0.2214]}, {"w": "=", "b": [0.2946, 0.2063, 0.306, 0.2214]}, {"w": "token_index.get(word)", "b": [0.3173, 0.2063, 0.5557, 0.2214]}, {"w": "results[i,", "b": [0.2265, 0.2215, 0.34, 0.2366]}, {"w": "j,", "b": [0.3514, 0.2215, 0.3741, 0.2366]}, {"w": "index]", "b": [0.3855, 0.2215, 0.4536, 0.2366]}, {"w": "=", "b": [0.4649, 0.2215, 0.4763, 0.2366]}, {"w": "1.", "b": [0.4876, 0.2215, 0.5103, 0.2366]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Initial data: one entry per sample (in this example, a sample is a sentence, but it could be an entire document) 2 Builds an index of all tokens in the data 3 Tokenizes the samples via the split method. In real life, you’d also strip punctuation and special characters from the samples. 4 Assigns a unique index to each unique word. Note that you don’t attribute index 0 to anything. 5 Vectorizes the samples. You’ll only consider the first max_length words in each sample. 6 This is where you store the results.", "words": [{"w": "1", "b": [0.1799, 0.255, 0.1925, 0.2748]}, {"w": "Initial", "b": [0.1988, 0.255, 0.2647, 0.2748]}, {"w": "data:", "b": [0.271, 0.255, 0.327, 0.2748]}, {"w": "one", "b": [0.3333, 0.255, 0.3712, 0.2748]}, {"w": "entry", "b": [0.3775, 0.255, 0.4349, 0.2748]}, {"w": "per", "b": [0.4412, 0.255, 0.4777, 0.2748]}, {"w": "sample", "b": [0.484, 0.255, 0.5596, 0.2748]}, {"w": "(in", "b": [0.5659, 0.255, 0.5954, 0.2748]}, {"w": "this", "b": [0.6017, 0.255, 0.6409, 0.2748]}, {"w": "example,", "b": [0.6472, 0.255, 0.7432, 0.2748]}, {"w": "a", "b": [0.7495, 0.255, 0.7621, 0.2748]}, {"w": "sample", "b": [0.7685, 0.255, 0.8441, 0.2748]}, {"w": "is", "b": [0.8504, 0.255, 0.8673, 0.2748]}, {"w": "a", "b": [0.1799, 0.2755, 0.1925, 0.2953]}, {"w": "sentence,", "b": [0.1988, 0.2755, 0.2962, 0.2953]}, {"w": "but", "b": [0.3025, 0.2755, 0.3389, 0.2953]}, {"w": "it", "b": [0.3452, 0.2755, 0.3606, 0.2953]}, {"w": "could", "b": [0.3669, 0.2755, 0.4258, 0.2953]}, {"w": "be", "b": [0.4321, 0.2755, 0.4573, 0.2953]}, {"w": "an", "b": [0.4637, 0.2755, 0.4903, 0.2953]}, {"w": "entire", "b": [0.4966, 0.2755, 0.5592, 0.2953]}, {"w": "document)", "b": [0.5655, 0.2755, 0.6804, 0.2953]}, {"w": "2", "b": [0.1799, 0.296, 0.1925, 0.3158]}, {"w": "Builds", "b": [0.1988, 0.296, 0.2675, 0.3158]}, {"w": "an", "b": [0.2738, 0.296, 0.3004, 0.3158]}, {"w": "index", "b": [0.3067, 0.296, 0.3656, 0.3158]}, {"w": "of", "b": [0.3719, 0.296, 0.3929, 0.3158]}, {"w": "all", "b": [0.3993, 0.296, 0.4259, 0.3158]}, {"w": "tokens", "b": [0.4322, 0.296, 0.5023, 0.3158]}, {"w": "in", "b": [0.5086, 0.296, 0.5296, 0.3158]}, {"w": "the", "b": [0.5359, 0.296, 0.5696, 0.3158]}, {"w": "data", "b": [0.5759, 0.296, 0.6235, 0.3158]}, {"w": "3", "b": [0.1799, 0.3165, 0.1925, 0.3363]}, {"w": "Tokenizes", "b": [0.1988, 0.3165, 0.3044, 0.3363]}, {"w": "the", "b": [0.3107, 0.3165, 0.3443, 0.3363]}, {"w": "samples", "b": [0.3506, 0.3165, 0.4361, 0.3363]}, {"w": "via", "b": [0.4424, 0.3165, 0.4747, 0.3363]}, {"w": "the", "b": [0.481, 0.3165, 0.5146, 0.3363]}, {"w": "split", "b": [0.5209, 0.3165, 0.5672, 0.3363]}, {"w": "method.", "b": [0.5735, 0.3165, 0.661, 0.3363]}, {"w": "In", "b": [0.6674, 0.3165, 0.6912, 0.3363]}, {"w": "real", "b": [0.6975, 0.3165, 0.7391, 0.3363]}, {"w": "life,", "b": [0.7454, 0.3165, 0.7853, 0.3363]}, {"w": "you’d", "b": [0.7916, 0.3165, 0.8533, 0.3363]}, {"w": "also", "b": [0.1799, 0.337, 0.2219, 0.3568]}, {"w": "strip", "b": [0.2282, 0.337, 0.2787, 0.3568]}, {"w": "punctuation", "b": [0.285, 0.337, 0.4153, 0.3568]}, {"w": "and", "b": [0.4217, 0.337, 0.4623, 0.3568]}, {"w": "special", "b": [0.4686, 0.337, 0.5415, 0.3568]}, {"w": "characters", "b": [0.5478, 0.337, 0.6613, 0.3568]}, {"w": "from", "b": [0.6676, 0.337, 0.7203, 0.3568]}, {"w": "the", "b": [0.7267, 0.337, 0.7603, 0.3568]}, {"w": "samples.", "b": [0.7666, 0.337, 0.8584, 0.3568]}, {"w": "4", "b": [0.1799, 0.3575, 0.1925, 0.3773]}, {"w": "Assigns", "b": [0.1988, 0.3575, 0.2801, 0.3773]}, {"w": "a", "b": [0.2864, 0.3575, 0.299, 0.3773]}, {"w": "unique", "b": [0.3053, 0.3575, 0.3796, 0.3773]}, {"w": "index", "b": [0.3859, 0.3575, 0.4448, 0.3773]}, {"w": "to", "b": [0.4511, 0.3575, 0.4721, 0.3773]}, {"w": "each", "b": [0.4784, 0.3575, 0.5275, 0.3773]}, {"w": "unique", "b": [0.5338, 0.3575, 0.6081, 0.3773]}, {"w": "word.", "b": [0.6144, 0.3575, 0.6768, 0.3773]}, {"w": "Note", "b": [0.6831, 0.3575, 0.7335, 0.3773]}, {"w": "that", "b": [0.7398, 0.3575, 0.7832, 0.3773]}, {"w": "you", "b": [0.7895, 0.3575, 0.8288, 0.3773]}, {"w": "don’t", "b": [0.1799, 0.378, 0.2373, 0.3978]}, {"w": "attribute", "b": [0.2436, 0.378, 0.3389, 0.3978]}, {"w": "index", "b": [0.3452, 0.378, 0.4041, 0.3978]}, {"w": "0", "b": [0.4104, 0.378, 0.423, 0.3978]}, {"w": "to", "b": [0.4293, 0.378, 0.4503, 0.3978]}, {"w": "anything.", "b": [0.4566, 0.378, 0.5583, 0.3978]}, {"w": "5", "b": [0.1799, 0.3985, 0.1925, 0.4183]}, {"w": "Vectorizes", "b": [0.1988, 0.3985, 0.3085, 0.4183]}, {"w": "the", "b": [0.3148, 0.3985, 0.3485, 0.4183]}, {"w": "samples.", "b": [0.3548, 0.3985, 0.4466, 0.4183]}, {"w": "You’ll", "b": [0.4529, 0.3985, 0.5173, 0.4183]}, {"w": "only", "b": [0.5236, 0.3985, 0.5699, 0.4183]}, {"w": "consider", "b": [0.5762, 0.3985, 0.6673, 0.4183]}, {"w": "the", "b": [0.6736, 0.3985, 0.7072, 0.4183]}, {"w": "first", "b": [0.7135, 0.3985, 0.7584, 0.4183]}, {"w": "max_length", "b": [0.1799, 0.419, 0.306, 0.4388]}, {"w": "words", "b": [0.3123, 0.419, 0.3782, 0.4388]}, {"w": "in", "b": [0.3845, 0.419, 0.4055, 0.4388]}, {"w": "each", "b": [0.4118, 0.419, 0.4609, 0.4388]}, {"w": "sample.", "b": [0.4672, 0.419, 0.5491, 0.4388]}, {"w": "6", "b": [0.1799, 0.4395, 0.1925, 0.4593]}, {"w": "This", "b": [0.1988, 0.4395, 0.2465, 0.4593]}, {"w": "is", "b": [0.2528, 0.4395, 0.2696, 0.4593]}, {"w": "where", "b": [0.2759, 0.4395, 0.3413, 0.4593]}, {"w": "you", "b": [0.3476, 0.4395, 0.3868, 0.4593]}, {"w": "store", "b": [0.3931, 0.4395, 0.4459, 0.4593]}, {"w": "the", "b": [0.4522, 0.4395, 0.4859, 0.4593]}, {"w": "results.", "b": [0.4922, 0.4395, 0.5695, 0.4593]}]}, {"id": "b_2", "type": "equation", "text": "Listing 6.2. Character-level one-hot encoding (toy example)", "words": [{"w": "Listing", "b": [0.1294, 0.4774, 0.1862, 0.4922]}, {"w": "6.2.", "b": [0.1909, 0.4774, 0.2193, 0.4922]}, {"w": "Character-level", "b": [0.224, 0.4774, 0.3494, 0.4922]}, {"w": "one-hot", "b": [0.3541, 0.4774, 0.4151, 0.4922]}, {"w": "encoding", "b": [0.4198, 0.4774, 0.4923, 0.4922]}, {"w": "(toy", "b": [0.4971, 0.4774, 0.5286, 0.4922]}, {"w": "example)", "b": [0.5333, 0.4774, 0.6069, 0.4922]}]}, {"id": "b_3", "type": "paragraph", "text": "import string samples = ['The cat sat on the mat.', 'The dog ate my homework.'] characters = string.printable 1 token_index = dict(zip(range(1, len(characters) + 1), characters)) max_length = 50 results = np.zeros((len(samples), max_length, max(token_index.keys()) + 1)) for i, sample in enumerate(samples): for j, character in enumerate(sample): index = token_index.get(character) results[i, j, index] = 1.", "words": [{"w": "import", "b": [0.1357, 0.5058, 0.2038, 0.5209]}, {"w": "string", "b": [0.2152, 0.5058, 0.2833, 0.5209]}, {"w": "samples", "b": [0.1357, 0.5361, 0.2152, 0.5512]}, {"w": "=", "b": [0.2265, 0.5361, 0.2379, 0.5512]}, {"w": "['The", "b": [0.2492, 0.5361, 0.306, 0.5512]}, {"w": "cat", "b": [0.3173, 0.5361, 0.3514, 0.5512]}, {"w": "sat", "b": [0.3628, 0.5361, 0.3968, 0.5512]}, {"w": "on", "b": [0.4082, 0.5361, 0.4309, 0.5512]}, {"w": "the", "b": [0.4422, 0.5361, 0.4763, 0.5512]}, {"w": "mat.',", "b": [0.4876, 0.5361, 0.5557, 0.5512]}, {"w": "'The", "b": [0.5671, 0.5361, 0.6125, 0.5512]}, {"w": "dog", "b": [0.6238, 0.5361, 0.6579, 0.5512]}, {"w": "ate", "b": [0.6692, 0.5361, 0.7033, 0.5512]}, {"w": "my", "b": [0.7146, 0.5361, 0.7374, 0.5512]}, {"w": "homework.']", "b": [0.1357, 0.5512, 0.2606, 0.5664]}, {"w": "characters", "b": [0.1357, 0.5664, 0.2492, 0.5815]}, {"w": "=", "b": [0.2606, 0.5664, 0.2719, 0.5815]}, {"w": "string.printable", "b": [0.2833, 0.5664, 0.4649, 0.5815]}, {"w": "1", "b": [0.1357, 0.5815, 0.1471, 0.5967]}, {"w": "token_index", "b": [0.1357, 0.5967, 0.2606, 0.6118]}, {"w": "=", "b": [0.2719, 0.5967, 0.2833, 0.6118]}, {"w": "dict(zip(range(1,", "b": [0.2946, 0.5967, 0.4876, 0.6118]}, {"w": "len(characters)", "b": [0.499, 0.5967, 0.6692, 0.6118]}, {"w": "+", "b": [0.6806, 0.5967, 0.6919, 0.6118]}, {"w": "1),", "b": [0.7033, 0.5967, 0.7374, 0.6118]}, {"w": "characters))", "b": [0.1357, 0.6119, 0.2719, 0.627]}, {"w": "max_length", "b": [0.1357, 0.6422, 0.2492, 0.6573]}, {"w": "=", "b": [0.2606, 0.6422, 0.2719, 0.6573]}, {"w": "50", "b": [0.2833, 0.6422, 0.306, 0.6573]}, {"w": "results", "b": [0.1357, 0.6573, 0.2152, 0.6725]}, {"w": "=", "b": [0.2265, 0.6573, 0.2379, 0.6725]}, {"w": "np.zeros((len(samples),", "b": [0.2492, 0.6573, 0.5103, 0.6725]}, {"w": "max_length,", "b": [0.5217, 0.6573, 0.6465, 0.6725]}, {"w": "max(token_index.keys())", "b": [0.1357, 0.6725, 0.3968, 0.6876]}, {"w": "+", "b": [0.4082, 0.6725, 0.4195, 0.6876]}, {"w": "1))", "b": [0.4309, 0.6725, 0.4649, 0.6876]}, {"w": "for", "b": [0.1357, 0.6876, 0.1698, 0.7028]}, {"w": "i,", "b": [0.1811, 0.6876, 0.2038, 0.7028]}, {"w": "sample", "b": [0.2152, 0.6876, 0.2833, 0.7028]}, {"w": "in", "b": [0.2946, 0.6876, 0.3173, 0.7028]}, {"w": "enumerate(samples):", "b": [0.3287, 0.6876, 0.5444, 0.7028]}, {"w": "for", "b": [0.1811, 0.7028, 0.2152, 0.7179]}, {"w": "j,", "b": [0.2265, 0.7028, 0.2492, 0.7179]}, {"w": "character", "b": [0.2606, 0.7028, 0.3628, 0.7179]}, {"w": "in", "b": [0.3741, 0.7028, 0.3968, 0.7179]}, {"w": "enumerate(sample):", "b": [0.4082, 0.7028, 0.6125, 0.7179]}, {"w": "index", "b": [0.2265, 0.7179, 0.2833, 0.7331]}, {"w": "=", "b": [0.2946, 0.7179, 0.306, 0.7331]}, {"w": "token_index.get(character)", "b": [0.3173, 0.7179, 0.6125, 0.7331]}, {"w": "results[i,", "b": [0.2265, 0.7331, 0.34, 0.7482]}, {"w": "j,", "b": [0.3514, 0.7331, 0.3741, 0.7482]}, {"w": "index]", "b": [0.3855, 0.7331, 0.4536, 0.7482]}, {"w": "=", "b": [0.4649, 0.7331, 0.4763, 0.7482]}, {"w": "1.", "b": [0.4876, 0.7331, 0.5103, 0.7482]}]}, {"id": "b_4", "type": "paragraph", "text": "1 All printable ASCII characters", "words": [{"w": "1", "b": [0.1799, 0.7666, 0.1925, 0.7864]}, {"w": "All", "b": [0.1988, 0.7666, 0.231, 0.7864]}, {"w": "printable", "b": [0.2373, 0.7666, 0.3368, 0.7864]}, {"w": "ASCII", "b": [0.3431, 0.7666, 0.4132, 0.7864]}, {"w": "characters", "b": [0.4195, 0.7666, 0.533, 0.7864]}]}, {"id": "b_5", "type": "paragraph", "text": "Note that Keras has built-in utilities for doing one-hot encoding of text at the word level or character level, starting from raw text data. You should use these utilities, because they take care of a number of important features such as stripping special characters from strings and only taking", "words": [{"w": "Note", "b": [0.1294, 0.8094, 0.1785, 0.8292]}, {"w": "that", "b": [0.1848, 0.8094, 0.2226, 0.8292]}, {"w": "Keras", "b": [0.2289, 0.8094, 0.2877, 0.8292]}, {"w": "has", "b": [0.294, 0.8094, 0.3277, 0.8292]}, {"w": "built-in", "b": [0.334, 0.8094, 0.4083, 0.8292]}, {"w": "utilities", "b": [0.4146, 0.8094, 0.4903, 0.8292]}, {"w": "for", "b": [0.4966, 0.8094, 0.526, 0.8292]}, {"w": "doing", "b": [0.5323, 0.8094, 0.5898, 0.8292]}, {"w": "one-hot", "b": [0.5961, 0.8094, 0.6731, 0.8292]}, {"w": "encoding", "b": [0.6794, 0.8094, 0.7719, 0.8292]}, {"w": "of", "b": [0.7782, 0.8094, 0.7992, 0.8292]}, {"w": "text", "b": [0.8055, 0.8094, 0.8434, 0.8292]}, {"w": "at", "b": [0.8497, 0.8094, 0.8679, 0.8292]}, {"w": "the", "b": [0.1294, 0.8299, 0.1602, 0.8497]}, {"w": "word", "b": [0.1665, 0.8299, 0.2184, 0.8497]}, {"w": "level", "b": [0.2247, 0.8299, 0.2737, 0.8497]}, {"w": "or", "b": [0.28, 0.8299, 0.301, 0.8497]}, {"w": "character", "b": [0.3074, 0.8299, 0.3998, 0.8497]}, {"w": "level,", "b": [0.4061, 0.8299, 0.4614, 0.8497]}, {"w": "starting", "b": [0.4677, 0.8299, 0.5434, 0.8497]}, {"w": "from", "b": [0.5497, 0.8299, 0.5988, 0.8497]}, {"w": "raw", "b": [0.605, 0.8299, 0.6428, 0.8497]}, {"w": "text", "b": [0.6491, 0.8299, 0.6869, 0.8497]}, {"w": "data.", "b": [0.6932, 0.8299, 0.7416, 0.8497]}, {"w": "You", "b": [0.7479, 0.8299, 0.7888, 0.8497]}, {"w": "should", "b": [0.7951, 0.8299, 0.8624, 0.8497]}, {"w": "use", "b": [0.1294, 0.8504, 0.163, 0.8702]}, {"w": "these", "b": [0.1693, 0.8504, 0.2212, 0.8702]}, {"w": "utilities,", "b": [0.2275, 0.8504, 0.3095, 0.8702]}, {"w": "because", "b": [0.3158, 0.8504, 0.3956, 0.8702]}, {"w": "they", "b": [0.402, 0.8504, 0.4454, 0.8702]}, {"w": "take", "b": [0.4517, 0.8504, 0.4937, 0.8702]}, {"w": "care", "b": [0.5, 0.8504, 0.542, 0.8702]}, {"w": "of", "b": [0.5483, 0.8504, 0.5693, 0.8702]}, {"w": "a", "b": [0.5757, 0.8504, 0.5869, 0.8702]}, {"w": "number", "b": [0.5932, 0.8504, 0.6702, 0.8702]}, {"w": "of", "b": [0.6765, 0.8504, 0.6975, 0.8702]}, {"w": "important", "b": [0.7039, 0.8504, 0.802, 0.8702]}, {"w": "features", "b": [0.1294, 0.8709, 0.2093, 0.8907]}, {"w": "such", "b": [0.2156, 0.8709, 0.2618, 0.8907]}, {"w": "as", "b": [0.2681, 0.8709, 0.2891, 0.8907]}, {"w": "stripping", "b": [0.2954, 0.8709, 0.3851, 0.8907]}, {"w": "special", "b": [0.3914, 0.8709, 0.4615, 0.8907]}, {"w": "characters", "b": [0.4678, 0.8709, 0.57, 0.8907]}, {"w": "from", "b": [0.5763, 0.8709, 0.6253, 0.8907]}, {"w": "strings", "b": [0.6317, 0.8709, 0.6989, 0.8907]}, {"w": "and", "b": [0.7052, 0.8709, 0.7417, 0.8907]}, {"w": "only", "b": [0.748, 0.8709, 0.7928, 0.8907]}, {"w": "taking", "b": [0.7991, 0.8709, 0.8622, 0.8907]}]}]}, {"page": 243, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "into account the N most common words in your dataset (a common restriction, to avoid dealing with very large input vector spaces).", "words": [{"w": "into", "b": [0.1294, 0.0857, 0.1687, 0.1054]}, {"w": "account", "b": [0.175, 0.0857, 0.2534, 0.1054]}, {"w": "the", "b": [0.2597, 0.0857, 0.2906, 0.1054]}, {"w": "N", "b": [0.2968, 0.0857, 0.3137, 0.1054]}, {"w": "most", "b": [0.3199, 0.0857, 0.369, 0.1054]}, {"w": "common", "b": [0.3753, 0.0857, 0.4636, 0.1054]}, {"w": "words", "b": [0.4699, 0.0857, 0.5316, 0.1054]}, {"w": "in", "b": [0.5379, 0.0857, 0.5575, 0.1054]}, {"w": "your", "b": [0.5638, 0.0857, 0.61, 0.1054]}, {"w": "dataset", "b": [0.6163, 0.0857, 0.6864, 0.1054]}, {"w": "(a", "b": [0.6927, 0.0857, 0.7123, 0.1054]}, {"w": "common", "b": [0.7186, 0.0857, 0.8069, 0.1054]}, {"w": "restriction,", "b": [0.1294, 0.1062, 0.238, 0.1259]}, {"w": "to", "b": [0.2443, 0.1062, 0.2639, 0.1259]}, {"w": "avoid", "b": [0.2702, 0.1062, 0.3263, 0.1259]}, {"w": "dealing", "b": [0.3326, 0.1062, 0.4069, 0.1259]}, {"w": "with", "b": [0.4132, 0.1062, 0.458, 0.1259]}, {"w": "very", "b": [0.4643, 0.1062, 0.5092, 0.1259]}, {"w": "large", "b": [0.5155, 0.1062, 0.5654, 0.1259]}, {"w": "input", "b": [0.5717, 0.1062, 0.6235, 0.1259]}, {"w": "vector", "b": [0.6299, 0.1062, 0.6929, 0.1259]}, {"w": "spaces).", "b": [0.6992, 0.1062, 0.7797, 0.1259]}]}, {"id": "b_1", "type": "equation", "text": "Listing 6.3. Using Keras for word-level one-hot encoding", "words": [{"w": "Listing", "b": [0.1294, 0.1485, 0.1862, 0.1633]}, {"w": "6.3.", "b": [0.1909, 0.1485, 0.2193, 0.1633]}, {"w": "Using", "b": [0.224, 0.1485, 0.2703, 0.1633]}, {"w": "Keras", "b": [0.275, 0.1485, 0.3233, 0.1633]}, {"w": "for", "b": [0.3281, 0.1485, 0.3522, 0.1633]}, {"w": "word-level", "b": [0.357, 0.1485, 0.4421, 0.1633]}, {"w": "one-hot", "b": [0.4468, 0.1485, 0.5078, 0.1633]}, {"w": "encoding", "b": [0.5125, 0.1485, 0.585, 0.1633]}]}, {"id": "b_2", "type": "paragraph", "text": "from keras.preprocessing.text import Tokenizer samples = ['The cat sat on the mat.', 'The dog ate my homework.'] tokenizer = Tokenizer(num_words=1000) 1 tokenizer.fit_on_texts(samples) 2 sequences = tokenizer.texts_to_sequences(samples) 3 one_hot_results = tokenizer.texts_to_matrix(samples, mode='binary') 4 word_index = tokenizer.word_index 5 print('Found %s unique tokens.' % len(word_index))", "words": [{"w": "from", "b": [0.1357, 0.1769, 0.1811, 0.192]}, {"w": "keras.preprocessing.text", "b": [0.1925, 0.1769, 0.4649, 0.192]}, {"w": "import", "b": [0.4763, 0.1769, 0.5444, 0.192]}, {"w": "Tokenizer", "b": [0.5557, 0.1769, 0.6579, 0.192]}, {"w": "samples", "b": [0.1357, 0.2072, 0.2152, 0.2223]}, {"w": "=", "b": [0.2265, 0.2072, 0.2379, 0.2223]}, {"w": "['The", "b": [0.2492, 0.2072, 0.306, 0.2223]}, {"w": "cat", "b": [0.3173, 0.2072, 0.3514, 0.2223]}, {"w": "sat", "b": [0.3628, 0.2072, 0.3968, 0.2223]}, {"w": "on", "b": [0.4082, 0.2072, 0.4309, 0.2223]}, {"w": "the", "b": [0.4422, 0.2072, 0.4763, 0.2223]}, {"w": "mat.',", "b": [0.4876, 0.2072, 0.5557, 0.2223]}, {"w": "'The", "b": [0.5671, 0.2072, 0.6125, 0.2223]}, {"w": "dog", "b": [0.6238, 0.2072, 0.6579, 0.2223]}, {"w": "ate", "b": [0.6692, 0.2072, 0.7033, 0.2223]}, {"w": "my", "b": [0.7146, 0.2072, 0.7374, 0.2223]}, {"w": "homework.']", "b": [0.1357, 0.2223, 0.2606, 0.2375]}, {"w": "tokenizer", "b": [0.1357, 0.2527, 0.2379, 0.2678]}, {"w": "=", "b": [0.2492, 0.2527, 0.2606, 0.2678]}, {"w": "Tokenizer(num_words=1000)", "b": [0.2719, 0.2527, 0.5557, 0.2678]}, {"w": "1", "b": [0.1357, 0.2678, 0.1471, 0.2829]}, {"w": "tokenizer.fit_on_texts(samples)", "b": [0.1357, 0.283, 0.4876, 0.2981]}, {"w": "2", "b": [0.1357, 0.2981, 0.1471, 0.3133]}, {"w": "sequences", "b": [0.1357, 0.3284, 0.2379, 0.3436]}, {"w": "=", "b": [0.2492, 0.3284, 0.2606, 0.3436]}, {"w": "tokenizer.texts_to_sequences(samples)", "b": [0.2719, 0.3284, 0.6919, 0.3436]}, {"w": "3", "b": [0.1357, 0.3436, 0.1471, 0.3587]}, {"w": "one_hot_results", "b": [0.1357, 0.3739, 0.306, 0.389]}, {"w": "=", "b": [0.3173, 0.3739, 0.3287, 0.389]}, {"w": "tokenizer.texts_to_matrix(samples,", "b": [0.34, 0.3739, 0.726, 0.389]}, {"w": "mode='binary')", "b": [0.1357, 0.389, 0.2946, 0.4042]}, {"w": "4", "b": [0.3514, 0.389, 0.3628, 0.4042]}, {"w": "word_index", "b": [0.1357, 0.4193, 0.2492, 0.4345]}, {"w": "=", "b": [0.2606, 0.4193, 0.2719, 0.4345]}, {"w": "tokenizer.word_index", "b": [0.2833, 0.4193, 0.5103, 0.4345]}, {"w": "5", "b": [0.1357, 0.4345, 0.1471, 0.4496]}, {"w": "print('Found", "b": [0.1357, 0.4496, 0.2719, 0.4648]}, {"w": "%s", "b": [0.2833, 0.4496, 0.306, 0.4648]}, {"w": "unique", "b": [0.3173, 0.4496, 0.3855, 0.4648]}, {"w": "tokens.'", "b": [0.3968, 0.4496, 0.4876, 0.4648]}, {"w": "%", "b": [0.499, 0.4496, 0.5103, 0.4648]}, {"w": "len(word_index))", "b": [0.5217, 0.4496, 0.7033, 0.4648]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Creates a tokenizer, configured to only take into account the 1,000 most common words 2 Builds the word index 3 Builds the word index 4 You could also directly get the one-hot binary representations. Vectorization modes other than one-hot encoding are supported by this tokenizer. 5 How you can recover the word index that was computed", "words": [{"w": "1", "b": [0.1799, 0.4832, 0.1925, 0.5029]}, {"w": "Creates", "b": [0.1988, 0.4832, 0.281, 0.5029]}, {"w": "a", "b": [0.2873, 0.4832, 0.2999, 0.5029]}, {"w": "tokenizer,", "b": [0.3062, 0.4832, 0.411, 0.5029]}, {"w": "configured", "b": [0.4174, 0.4832, 0.5332, 0.5029]}, {"w": "to", "b": [0.5395, 0.4832, 0.5605, 0.5029]}, {"w": "only", "b": [0.5668, 0.4832, 0.6131, 0.5029]}, {"w": "take", "b": [0.6194, 0.4832, 0.6656, 0.5029]}, {"w": "into", "b": [0.672, 0.4832, 0.714, 0.5029]}, {"w": "account", "b": [0.7203, 0.4832, 0.8044, 0.5029]}, {"w": "the", "b": [0.8107, 0.4832, 0.8443, 0.5029]}, {"w": "1,000", "b": [0.1799, 0.5037, 0.2366, 0.5234]}, {"w": "most", "b": [0.2429, 0.5037, 0.2948, 0.5234]}, {"w": "common", "b": [0.3011, 0.5037, 0.3936, 0.5234]}, {"w": "words", "b": [0.3999, 0.5037, 0.4657, 0.5234]}, {"w": "2", "b": [0.1799, 0.5242, 0.1925, 0.5439]}, {"w": "Builds", "b": [0.1988, 0.5242, 0.2675, 0.5439]}, {"w": "the", "b": [0.2738, 0.5242, 0.3074, 0.5439]}, {"w": "word", "b": [0.3137, 0.5242, 0.3698, 0.5439]}, {"w": "index", "b": [0.3761, 0.5242, 0.435, 0.5439]}, {"w": "3", "b": [0.1799, 0.5447, 0.1925, 0.5644]}, {"w": "Builds", "b": [0.1988, 0.5447, 0.2675, 0.5644]}, {"w": "the", "b": [0.2738, 0.5447, 0.3074, 0.5644]}, {"w": "word", "b": [0.3137, 0.5447, 0.3698, 0.5644]}, {"w": "index", "b": [0.3761, 0.5447, 0.435, 0.5644]}, {"w": "4", "b": [0.1799, 0.5652, 0.1925, 0.5849]}, {"w": "You", "b": [0.1988, 0.5652, 0.2408, 0.5849]}, {"w": "could", "b": [0.2471, 0.5652, 0.306, 0.5849]}, {"w": "also", "b": [0.3123, 0.5652, 0.3544, 0.5849]}, {"w": "directly", "b": [0.3607, 0.5652, 0.4429, 0.5849]}, {"w": "get", "b": [0.4492, 0.5652, 0.4814, 0.5849]}, {"w": "the", "b": [0.4877, 0.5652, 0.5214, 0.5849]}, {"w": "one-hot", "b": [0.5277, 0.5652, 0.6089, 0.5849]}, {"w": "binary", "b": [0.6152, 0.5652, 0.6867, 0.5849]}, {"w": "representations.", "b": [0.693, 0.5652, 0.8652, 0.5849]}, {"w": "Vectorization", "b": [0.1799, 0.5857, 0.3233, 0.6054]}, {"w": "modes", "b": [0.3296, 0.5857, 0.3982, 0.6054]}, {"w": "other", "b": [0.4045, 0.5857, 0.462, 0.6054]}, {"w": "than", "b": [0.4683, 0.5857, 0.5173, 0.6054]}, {"w": "one-hot", "b": [0.5236, 0.5857, 0.6049, 0.6054]}, {"w": "encoding", "b": [0.6112, 0.5857, 0.7079, 0.6054]}, {"w": "are", "b": [0.7143, 0.5857, 0.7488, 0.6054]}, {"w": "supported", "b": [0.7551, 0.5857, 0.8644, 0.6054]}, {"w": "by", "b": [0.1799, 0.6062, 0.2065, 0.6259]}, {"w": "this", "b": [0.2128, 0.6062, 0.2521, 0.6259]}, {"w": "tokenizer.", "b": [0.2584, 0.6062, 0.3632, 0.6259]}, {"w": "5", "b": [0.1799, 0.6267, 0.1925, 0.6464]}, {"w": "How", "b": [0.1988, 0.6267, 0.2492, 0.6464]}, {"w": "you", "b": [0.2555, 0.6267, 0.2948, 0.6464]}, {"w": "can", "b": [0.3011, 0.6267, 0.3389, 0.6464]}, {"w": "recover", "b": [0.3452, 0.6267, 0.426, 0.6464]}, {"w": "the", "b": [0.4323, 0.6267, 0.4659, 0.6464]}, {"w": "word", "b": [0.4723, 0.6267, 0.5283, 0.6464]}, {"w": "index", "b": [0.5346, 0.6267, 0.5935, 0.6464]}, {"w": "that", "b": [0.5998, 0.6267, 0.6432, 0.6464]}, {"w": "was", "b": [0.6495, 0.6267, 0.6902, 0.6464]}, {"w": "computed", "b": [0.6965, 0.6267, 0.803, 0.6464]}]}, {"id": "b_4", "type": "paragraph", "text": "A variant of one-hot encoding is the so-called one-hot hashing trick, which you can use when the number of unique tokens in your vocabulary is too large to handle explicitly. Instead of explicitly assigning an index to each word and keeping a reference of these indices in a dictionary, you can hash words into vectors of fixed size. This is typically done with a very lightweight hashing function. The main advantage of this method is that it does away with maintaining an explicit word index, which saves memory and allows online encoding of the data (you can generate token vectors right away, before you’ve seen all of the available data). The one drawback of this approach is that it’s susceptible to hash collisions: two different words may end up with the same hash, and subsequently any", "words": [{"w": "A", "b": [0.1294, 0.6695, 0.1476, 0.6892]}, {"w": "variant", "b": [0.1539, 0.6695, 0.224, 0.6892]}, {"w": "of", "b": [0.2303, 0.6695, 0.2513, 0.6892]}, {"w": "one-hot", "b": [0.2576, 0.6695, 0.3347, 0.6892]}, {"w": "encoding", "b": [0.341, 0.6695, 0.4335, 0.6892]}, {"w": "is", "b": [0.4398, 0.6695, 0.4566, 0.6892]}, {"w": "the", "b": [0.4629, 0.6695, 0.4937, 0.6892]}, {"w": "so-called", "b": [0.5, 0.6695, 0.5911, 0.6892]}, {"w": "one-hot", "b": [0.5973, 0.6695, 0.6744, 0.6892]}, {"w": "hashing", "b": [0.6807, 0.6695, 0.7606, 0.6892]}, {"w": "trick,", "b": [0.7669, 0.6695, 0.8194, 0.6892]}, {"w": "which", "b": [0.1294, 0.69, 0.1911, 0.7097]}, {"w": "you", "b": [0.1974, 0.69, 0.2352, 0.7097]}, {"w": "can", "b": [0.2415, 0.69, 0.2765, 0.7097]}, {"w": "use", "b": [0.2828, 0.69, 0.3165, 0.7097]}, {"w": "when", "b": [0.3228, 0.69, 0.3774, 0.7097]}, {"w": "the", "b": [0.3837, 0.69, 0.4145, 0.7097]}, {"w": "number", "b": [0.4208, 0.69, 0.4979, 0.7097]}, {"w": "of", "b": [0.5042, 0.69, 0.5252, 0.7097]}, {"w": "unique", "b": [0.5315, 0.69, 0.6002, 0.7097]}, {"w": "tokens", "b": [0.6065, 0.69, 0.6724, 0.7097]}, {"w": "in", "b": [0.6787, 0.69, 0.6983, 0.7097]}, {"w": "your", "b": [0.7046, 0.69, 0.7508, 0.7097]}, {"w": "vocabulary", "b": [0.7572, 0.69, 0.8692, 0.7097]}, {"w": "is", "b": [0.1294, 0.7105, 0.1462, 0.7302]}, {"w": "too", "b": [0.1525, 0.7105, 0.1848, 0.7302]}, {"w": "large", "b": [0.1911, 0.7105, 0.241, 0.7302]}, {"w": "to", "b": [0.2474, 0.7105, 0.267, 0.7302]}, {"w": "handle", "b": [0.2733, 0.7105, 0.3405, 0.7302]}, {"w": "explicitly.", "b": [0.3468, 0.7105, 0.4468, 0.7302]}, {"w": "Instead", "b": [0.4531, 0.7105, 0.5259, 0.7302]}, {"w": "of", "b": [0.5322, 0.7105, 0.5532, 0.7302]}, {"w": "explicitly", "b": [0.5596, 0.7105, 0.6549, 0.7302]}, {"w": "assigning", "b": [0.6611, 0.7105, 0.7564, 0.7302]}, {"w": "an", "b": [0.7627, 0.7105, 0.7865, 0.7302]}, {"w": "index", "b": [0.7929, 0.7105, 0.8489, 0.7302]}, {"w": "to", "b": [0.1294, 0.731, 0.149, 0.7507]}, {"w": "each", "b": [0.1553, 0.731, 0.2016, 0.7507]}, {"w": "word", "b": [0.2079, 0.731, 0.2597, 0.7507]}, {"w": "and", "b": [0.266, 0.731, 0.3024, 0.7507]}, {"w": "keeping", "b": [0.3087, 0.731, 0.3886, 0.7507]}, {"w": "a", "b": [0.3949, 0.731, 0.4061, 0.7507]}, {"w": "reference", "b": [0.4124, 0.731, 0.5062, 0.7507]}, {"w": "of", "b": [0.5125, 0.731, 0.5336, 0.7507]}, {"w": "these", "b": [0.5399, 0.731, 0.5917, 0.7507]}, {"w": "indices", "b": [0.598, 0.731, 0.6695, 0.7507]}, {"w": "in", "b": [0.6758, 0.731, 0.6954, 0.7507]}, {"w": "a", "b": [0.7017, 0.731, 0.7129, 0.7507]}, {"w": "dictionary,", "b": [0.7192, 0.731, 0.8261, 0.7507]}, {"w": "you", "b": [0.8324, 0.731, 0.8702, 0.7507]}, {"w": "can", "b": [0.1294, 0.7515, 0.1644, 0.7712]}, {"w": "hash", "b": [0.1707, 0.7515, 0.217, 0.7712]}, {"w": "words", "b": [0.2233, 0.7515, 0.2849, 0.7712]}, {"w": "into", "b": [0.2912, 0.7515, 0.3305, 0.7712]}, {"w": "vectors", "b": [0.3368, 0.7515, 0.4096, 0.7712]}, {"w": "of", "b": [0.4159, 0.7515, 0.4369, 0.7712]}, {"w": "fixed", "b": [0.4432, 0.7515, 0.4951, 0.7712]}, {"w": "size.", "b": [0.5014, 0.7515, 0.5469, 0.7712]}, {"w": "This", "b": [0.5532, 0.7515, 0.5981, 0.7712]}, {"w": "is", "b": [0.6044, 0.7515, 0.6212, 0.7712]}, {"w": "typically", "b": [0.6275, 0.7515, 0.7158, 0.7712]}, {"w": "done", "b": [0.7221, 0.7515, 0.7712, 0.7712]}, {"w": "with", "b": [0.7775, 0.7515, 0.8223, 0.7712]}, {"w": "a", "b": [0.8286, 0.7515, 0.8398, 0.7712]}, {"w": "very", "b": [0.1294, 0.772, 0.1742, 0.7917]}, {"w": "lightweight", "b": [0.1805, 0.772, 0.2955, 0.7917]}, {"w": "hashing", "b": [0.3018, 0.772, 0.3803, 0.7917]}, {"w": "function.", "b": [0.3866, 0.772, 0.4769, 0.7917]}, {"w": "The", "b": [0.4833, 0.772, 0.5225, 0.7917]}, {"w": "main", "b": [0.5288, 0.772, 0.5792, 0.7917]}, {"w": "advantage", "b": [0.5855, 0.772, 0.6878, 0.7917]}, {"w": "of", "b": [0.6941, 0.772, 0.7151, 0.7917]}, {"w": "this", "b": [0.7214, 0.772, 0.7579, 0.7917]}, {"w": "method", "b": [0.7642, 0.772, 0.8399, 0.7917]}, {"w": "is", "b": [0.8462, 0.772, 0.863, 0.7917]}, {"w": "that", "b": [0.1294, 0.7925, 0.1673, 0.8122]}, {"w": "it", "b": [0.1735, 0.7925, 0.1876, 0.8122]}, {"w": "does", "b": [0.1939, 0.7925, 0.2401, 0.8122]}, {"w": "away", "b": [0.2464, 0.7925, 0.2996, 0.8122]}, {"w": "with", "b": [0.3059, 0.7925, 0.3508, 0.8122]}, {"w": "maintaining", "b": [0.3571, 0.7925, 0.4776, 0.8122]}, {"w": "an", "b": [0.4839, 0.7925, 0.5078, 0.8122]}, {"w": "explicit", "b": [0.5141, 0.7925, 0.5897, 0.8122]}, {"w": "word", "b": [0.596, 0.7925, 0.6479, 0.8122]}, {"w": "index,", "b": [0.6542, 0.7925, 0.7165, 0.8122]}, {"w": "which", "b": [0.7229, 0.7925, 0.7845, 0.8122]}, {"w": "saves", "b": [0.7908, 0.7925, 0.8455, 0.8122]}, {"w": "memory", "b": [0.1294, 0.813, 0.2135, 0.8327]}, {"w": "and", "b": [0.2198, 0.813, 0.2562, 0.8327]}, {"w": "allows", "b": [0.2625, 0.813, 0.3284, 0.8327]}, {"w": "online", "b": [0.3347, 0.813, 0.3978, 0.8327]}, {"w": "encoding", "b": [0.4041, 0.813, 0.4965, 0.8327]}, {"w": "of", "b": [0.5029, 0.813, 0.5239, 0.8327]}, {"w": "the", "b": [0.5302, 0.813, 0.561, 0.8327]}, {"w": "data", "b": [0.5673, 0.813, 0.6093, 0.8327]}, {"w": "(you", "b": [0.6156, 0.813, 0.6619, 0.8327]}, {"w": "can", "b": [0.6682, 0.813, 0.7032, 0.8327]}, {"w": "generate", "b": [0.7095, 0.813, 0.7949, 0.8327]}, {"w": "token", "b": [0.8011, 0.813, 0.8572, 0.8327]}, {"w": "vectors", "b": [0.1294, 0.8335, 0.2023, 0.8532]}, {"w": "right", "b": [0.2086, 0.8335, 0.2562, 0.8532]}, {"w": "away,", "b": [0.2625, 0.8335, 0.3204, 0.8532]}, {"w": "before", "b": [0.3267, 0.8335, 0.3911, 0.8532]}, {"w": "you’ve", "b": [0.3974, 0.8335, 0.4675, 0.8532]}, {"w": "seen", "b": [0.4738, 0.8335, 0.5186, 0.8532]}, {"w": "all", "b": [0.5249, 0.8335, 0.5502, 0.8532]}, {"w": "of", "b": [0.5565, 0.8335, 0.5775, 0.8532]}, {"w": "the", "b": [0.5838, 0.8335, 0.6146, 0.8532]}, {"w": "available", "b": [0.6209, 0.8335, 0.712, 0.8532]}, {"w": "data).", "b": [0.7183, 0.8335, 0.775, 0.8532]}, {"w": "The", "b": [0.7813, 0.8335, 0.8206, 0.8532]}, {"w": "one", "b": [0.8269, 0.8335, 0.8633, 0.8532]}, {"w": "drawback", "b": [0.1294, 0.854, 0.2275, 0.8737]}, {"w": "of", "b": [0.2338, 0.854, 0.2548, 0.8737]}, {"w": "this", "b": [0.2611, 0.854, 0.2975, 0.8737]}, {"w": "approach", "b": [0.3038, 0.854, 0.3963, 0.8737]}, {"w": "is", "b": [0.4026, 0.854, 0.4194, 0.8737]}, {"w": "that", "b": [0.4257, 0.854, 0.4636, 0.8737]}, {"w": "it’s", "b": [0.4699, 0.854, 0.5007, 0.8737]}, {"w": "susceptible", "b": [0.507, 0.854, 0.6191, 0.8737]}, {"w": "to", "b": [0.6254, 0.854, 0.645, 0.8737]}, {"w": "hash", "b": [0.6513, 0.854, 0.6989, 0.8737]}, {"w": "collisions:", "b": [0.7052, 0.854, 0.809, 0.8737]}, {"w": "two", "b": [0.8153, 0.854, 0.8531, 0.8737]}, {"w": "different", "b": [0.1294, 0.8745, 0.2158, 0.8942]}, {"w": "words", "b": [0.2221, 0.8745, 0.2838, 0.8942]}, {"w": "may", "b": [0.2901, 0.8745, 0.3335, 0.8942]}, {"w": "end", "b": [0.3398, 0.8745, 0.3762, 0.8942]}, {"w": "up", "b": [0.3825, 0.8745, 0.4078, 0.8942]}, {"w": "with", "b": [0.4141, 0.8745, 0.4589, 0.8942]}, {"w": "the", "b": [0.4652, 0.8745, 0.4961, 0.8942]}, {"w": "same", "b": [0.5024, 0.8745, 0.5542, 0.8942]}, {"w": "hash,", "b": [0.5605, 0.8745, 0.6131, 0.8942]}, {"w": "and", "b": [0.6194, 0.8745, 0.6558, 0.8942]}, {"w": "subsequently", "b": [0.6621, 0.8745, 0.7938, 0.8942]}, {"w": "any", "b": [0.8001, 0.8745, 0.8366, 0.8942]}]}]}, {"page": 244, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "machine-learning model looking at these hashes won’t be able to tell the difference between these words. The likelihood of hash collisions decreases when the dimensionality of the hashing space is much larger than the total number of unique tokens being hashed.", "words": [{"w": "machine-learning", "b": [0.1294, 0.0857, 0.3059, 0.1054]}, {"w": "model", "b": [0.3122, 0.0857, 0.3753, 0.1054]}, {"w": "looking", "b": [0.3816, 0.0857, 0.4587, 0.1054]}, {"w": "at", "b": [0.465, 0.0857, 0.4832, 0.1054]}, {"w": "these", "b": [0.4895, 0.0857, 0.5414, 0.1054]}, {"w": "hashes", "b": [0.5477, 0.0857, 0.6149, 0.1054]}, {"w": "won’t", "b": [0.6212, 0.0857, 0.6796, 0.1054]}, {"w": "be", "b": [0.6859, 0.0857, 0.7097, 0.1054]}, {"w": "able", "b": [0.716, 0.0857, 0.758, 0.1054]}, {"w": "to", "b": [0.7643, 0.0857, 0.7839, 0.1054]}, {"w": "tell", "b": [0.7902, 0.0857, 0.8225, 0.1054]}, {"w": "the", "b": [0.8288, 0.0857, 0.8596, 0.1054]}, {"w": "difference", "b": [0.1294, 0.1062, 0.2312, 0.1259]}, {"w": "between", "b": [0.2375, 0.1062, 0.3216, 0.1259]}, {"w": "these", "b": [0.3279, 0.1062, 0.3797, 0.1259]}, {"w": "words.", "b": [0.386, 0.1062, 0.454, 0.1259]}, {"w": "The", "b": [0.4603, 0.1062, 0.4995, 0.1259]}, {"w": "likelihood", "b": [0.5058, 0.1062, 0.6081, 0.1259]}, {"w": "of", "b": [0.6144, 0.1062, 0.6354, 0.1259]}, {"w": "hash", "b": [0.6417, 0.1062, 0.688, 0.1259]}, {"w": "collisions", "b": [0.6943, 0.1062, 0.791, 0.1259]}, {"w": "decreases", "b": [0.1294, 0.1267, 0.2261, 0.1464]}, {"w": "when", "b": [0.2324, 0.1267, 0.287, 0.1464]}, {"w": "the", "b": [0.2933, 0.1267, 0.3241, 0.1464]}, {"w": "dimensionality", "b": [0.3304, 0.1267, 0.4804, 0.1464]}, {"w": "of", "b": [0.4867, 0.1267, 0.5077, 0.1464]}, {"w": "the", "b": [0.514, 0.1267, 0.5448, 0.1464]}, {"w": "hashing", "b": [0.5511, 0.1267, 0.6296, 0.1464]}, {"w": "space", "b": [0.6359, 0.1267, 0.6919, 0.1464]}, {"w": "is", "b": [0.6982, 0.1267, 0.715, 0.1464]}, {"w": "much", "b": [0.7213, 0.1267, 0.7774, 0.1464]}, {"w": "larger", "b": [0.7837, 0.1267, 0.842, 0.1464]}, {"w": "than", "b": [0.1294, 0.1472, 0.1729, 0.1669]}, {"w": "the", "b": [0.1792, 0.1472, 0.21, 0.1669]}, {"w": "total", "b": [0.2163, 0.1472, 0.2611, 0.1669]}, {"w": "number", "b": [0.2674, 0.1472, 0.3445, 0.1669]}, {"w": "of", "b": [0.3508, 0.1472, 0.3718, 0.1669]}, {"w": "unique", "b": [0.3781, 0.1472, 0.4468, 0.1669]}, {"w": "tokens", "b": [0.4531, 0.1472, 0.519, 0.1669]}, {"w": "being", "b": [0.5253, 0.1472, 0.5813, 0.1669]}, {"w": "hashed.", "b": [0.5876, 0.1472, 0.664, 0.1669]}]}, {"id": "b_1", "type": "equation", "text": "Listing 6.4. Word-level one-hot encoding with hashing trick (toy example)", "words": [{"w": "Listing", "b": [0.1294, 0.185, 0.1862, 0.1998]}, {"w": "6.4.", "b": [0.1909, 0.185, 0.2193, 0.1998]}, {"w": "Word-level", "b": [0.224, 0.185, 0.3133, 0.1998]}, {"w": "one-hot", "b": [0.3181, 0.185, 0.379, 0.1998]}, {"w": "encoding", "b": [0.3838, 0.185, 0.4563, 0.1998]}, {"w": "with", "b": [0.461, 0.185, 0.4968, 0.1998]}, {"w": "hashing", "b": [0.5015, 0.185, 0.5646, 0.1998]}, {"w": "trick", "b": [0.5693, 0.185, 0.6082, 0.1998]}, {"w": "(toy", "b": [0.6129, 0.185, 0.6444, 0.1998]}, {"w": "example)", "b": [0.6492, 0.185, 0.7227, 0.1998]}]}, {"id": "b_2", "type": "paragraph", "text": "samples = ['The cat sat on the mat.', 'The dog ate my homework.'] dimensionality = 1000 1 max_length = 10 results = np.zeros((len(samples), max_length, dimensionality)) for i, sample in enumerate(samples): for j, word in list(enumerate(sample.split()))[:max_length]: index = abs(hash(word)) % dimensionality 2 results[i, j, index] = 1.", "words": [{"w": "samples", "b": [0.1357, 0.2134, 0.2152, 0.2286]}, {"w": "=", "b": [0.2265, 0.2134, 0.2379, 0.2286]}, {"w": "['The", "b": [0.2492, 0.2134, 0.306, 0.2286]}, {"w": "cat", "b": [0.3173, 0.2134, 0.3514, 0.2286]}, {"w": "sat", "b": [0.3628, 0.2134, 0.3968, 0.2286]}, {"w": "on", "b": [0.4082, 0.2134, 0.4309, 0.2286]}, {"w": "the", "b": [0.4422, 0.2134, 0.4763, 0.2286]}, {"w": "mat.',", "b": [0.4876, 0.2134, 0.5557, 0.2286]}, {"w": "'The", "b": [0.5671, 0.2134, 0.6125, 0.2286]}, {"w": "dog", "b": [0.6238, 0.2134, 0.6579, 0.2286]}, {"w": "ate", "b": [0.6692, 0.2134, 0.7033, 0.2286]}, {"w": "my", "b": [0.7146, 0.2134, 0.7374, 0.2286]}, {"w": "homework.']", "b": [0.1357, 0.2286, 0.2606, 0.2437]}, {"w": "dimensionality", "b": [0.1357, 0.2589, 0.2946, 0.274]}, {"w": "=", "b": [0.306, 0.2589, 0.3173, 0.274]}, {"w": "1000", "b": [0.3287, 0.2589, 0.3741, 0.274]}, {"w": "1", "b": [0.1357, 0.274, 0.1471, 0.2892]}, {"w": "max_length", "b": [0.1357, 0.2892, 0.2492, 0.3043]}, {"w": "=", "b": [0.2606, 0.2892, 0.2719, 0.3043]}, {"w": "10", "b": [0.2833, 0.2892, 0.306, 0.3043]}, {"w": "results", "b": [0.1357, 0.3195, 0.2152, 0.3346]}, {"w": "=", "b": [0.2265, 0.3195, 0.2379, 0.3346]}, {"w": "np.zeros((len(samples),", "b": [0.2492, 0.3195, 0.5103, 0.3346]}, {"w": "max_length,", "b": [0.5217, 0.3195, 0.6465, 0.3346]}, {"w": "dimensionality))", "b": [0.6579, 0.3195, 0.8395, 0.3346]}, {"w": "for", "b": [0.1357, 0.3347, 0.1698, 0.3498]}, {"w": "i,", "b": [0.1811, 0.3347, 0.2038, 0.3498]}, {"w": "sample", "b": [0.2152, 0.3347, 0.2833, 0.3498]}, {"w": "in", "b": [0.2946, 0.3347, 0.3173, 0.3498]}, {"w": "enumerate(samples):", "b": [0.3287, 0.3347, 0.5444, 0.3498]}, {"w": "for", "b": [0.1811, 0.3498, 0.2152, 0.3649]}, {"w": "j,", "b": [0.2265, 0.3498, 0.2492, 0.3649]}, {"w": "word", "b": [0.2606, 0.3498, 0.306, 0.3649]}, {"w": "in", "b": [0.3173, 0.3498, 0.34, 0.3649]}, {"w": "list(enumerate(sample.split()))[:max_length]:", "b": [0.3514, 0.3498, 0.8622, 0.3649]}, {"w": "index", "b": [0.2265, 0.365, 0.2833, 0.3801]}, {"w": "=", "b": [0.2946, 0.365, 0.306, 0.3801]}, {"w": "abs(hash(word))", "b": [0.3173, 0.365, 0.4876, 0.3801]}, {"w": "%", "b": [0.499, 0.365, 0.5103, 0.3801]}, {"w": "dimensionality", "b": [0.5217, 0.365, 0.6806, 0.3801]}, {"w": "2", "b": [0.1357, 0.3801, 0.1471, 0.3953]}, {"w": "results[i,", "b": [0.2265, 0.3953, 0.34, 0.4104]}, {"w": "j,", "b": [0.3514, 0.3953, 0.3741, 0.4104]}, {"w": "index]", "b": [0.3855, 0.3953, 0.4536, 0.4104]}, {"w": "=", "b": [0.4649, 0.3953, 0.4763, 0.4104]}, {"w": "1.", "b": [0.4876, 0.3953, 0.5103, 0.4104]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Stores the words as vectors of size 1,000. If you have close to 1,000 words (or more), you’ll see many hash collisions, which will decrease the accuracy of this encoding method. 2 Hashes the word into a random integer index between 0 and 1,000", "words": [{"w": "1", "b": [0.1799, 0.4288, 0.1925, 0.4486]}, {"w": "Stores", "b": [0.1988, 0.4288, 0.2656, 0.4486]}, {"w": "the", "b": [0.2719, 0.4288, 0.3055, 0.4486]}, {"w": "words", "b": [0.3118, 0.4288, 0.3777, 0.4486]}, {"w": "as", "b": [0.384, 0.4288, 0.4064, 0.4486]}, {"w": "vectors", "b": [0.4127, 0.4288, 0.4898, 0.4486]}, {"w": "of", "b": [0.4961, 0.4288, 0.5171, 0.4486]}, {"w": "size", "b": [0.5234, 0.4288, 0.5626, 0.4486]}, {"w": "1,000.", "b": [0.5689, 0.4288, 0.632, 0.4486]}, {"w": "If", "b": [0.6383, 0.4288, 0.6565, 0.4486]}, {"w": "you", "b": [0.6628, 0.4288, 0.7021, 0.4486]}, {"w": "have", "b": [0.7084, 0.4288, 0.7588, 0.4486]}, {"w": "close", "b": [0.7651, 0.4288, 0.817, 0.4486]}, {"w": "to", "b": [0.8233, 0.4288, 0.8443, 0.4486]}, {"w": "1,000", "b": [0.1799, 0.4493, 0.2366, 0.4691]}, {"w": "words", "b": [0.2429, 0.4493, 0.3088, 0.4691]}, {"w": "(or", "b": [0.3151, 0.4493, 0.3473, 0.4691]}, {"w": "more),", "b": [0.3536, 0.4493, 0.4239, 0.4691]}, {"w": "you’ll", "b": [0.4302, 0.4493, 0.4919, 0.4691]}, {"w": "see", "b": [0.4982, 0.4493, 0.5304, 0.4691]}, {"w": "many", "b": [0.5367, 0.4493, 0.597, 0.4691]}, {"w": "hash", "b": [0.6033, 0.4493, 0.6538, 0.4691]}, {"w": "collisions,", "b": [0.6601, 0.4493, 0.7645, 0.4691]}, {"w": "which", "b": [0.7708, 0.4493, 0.8353, 0.4691]}, {"w": "will", "b": [0.1799, 0.4698, 0.2191, 0.4896]}, {"w": "decrease", "b": [0.2254, 0.4698, 0.3174, 0.4896]}, {"w": "the", "b": [0.3237, 0.4698, 0.3573, 0.4896]}, {"w": "accuracy", "b": [0.3636, 0.4698, 0.4603, 0.4896]}, {"w": "of", "b": [0.4666, 0.4698, 0.4876, 0.4896]}, {"w": "this", "b": [0.4939, 0.4698, 0.5332, 0.4896]}, {"w": "encoding", "b": [0.5395, 0.4698, 0.6362, 0.4896]}, {"w": "method.", "b": [0.6425, 0.4698, 0.7301, 0.4896]}, {"w": "2", "b": [0.1799, 0.4903, 0.1925, 0.5101]}, {"w": "Hashes", "b": [0.1988, 0.4903, 0.2759, 0.5101]}, {"w": "the", "b": [0.2822, 0.4903, 0.3158, 0.5101]}, {"w": "word", "b": [0.3221, 0.4903, 0.3782, 0.5101]}, {"w": "into", "b": [0.3845, 0.4903, 0.4265, 0.5101]}, {"w": "a", "b": [0.4328, 0.4903, 0.4454, 0.5101]}, {"w": "random", "b": [0.4517, 0.4903, 0.5372, 0.5101]}, {"w": "integer", "b": [0.5435, 0.4903, 0.6192, 0.5101]}, {"w": "index", "b": [0.6255, 0.4903, 0.6844, 0.5101]}, {"w": "between", "b": [0.6907, 0.4903, 0.779, 0.5101]}, {"w": "0", "b": [0.7853, 0.4903, 0.7979, 0.5101]}, {"w": "and", "b": [0.8042, 0.4903, 0.8448, 0.5101]}, {"w": "1,000", "b": [0.1799, 0.5108, 0.2366, 0.5306]}]}, {"id": "b_4", "type": "paragraph", "text": "6.1.2. Using word embeddings", "words": [{"w": "6.1.2.", "b": [0.1294, 0.5581, 0.1862, 0.5778]}, {"w": "Using", "b": [0.1925, 0.5581, 0.2542, 0.5778]}, {"w": "word", "b": [0.2605, 0.5581, 0.3165, 0.5778]}, {"w": "embeddings", "b": [0.3228, 0.5581, 0.4518, 0.5778]}]}, {"id": "b_5", "type": "paragraph", "text": "Another popular and powerful way to associate a vector with a word is the use of dense word vectors, also called word embeddings. Whereas the vectors obtained through one-hot encoding are binary, sparse (mostly made of zeros), and very high-dimensional (same dimensionality as the number of words in the vocabulary), word embeddings are low- dimensional floating-point vectors (that is, dense vectors, as opposed to sparse vectors); see figure 6.2. Unlike the word vectors obtained via one- hot encoding, word embeddings are learned from data. It’s common to see word embeddings that are 256-dimensional, 512-dimensional, or 1,024-dimensional when dealing with very large vocabularies. On the other hand, one-hot encoding words generally leads to vectors that are 20,000-dimensional or greater (capturing a vocabulary of 20,000 tokens, in this case). So, word embeddings pack more information into far fewer dimensions.", "words": [{"w": "Another", "b": [0.1294, 0.6009, 0.2121, 0.6206]}, {"w": "popular", "b": [0.2184, 0.6009, 0.2954, 0.6206]}, {"w": "and", "b": [0.3018, 0.6009, 0.3382, 0.6206]}, {"w": "powerful", "b": [0.3445, 0.6009, 0.4356, 0.6206]}, {"w": "way", "b": [0.4419, 0.6009, 0.4839, 0.6206]}, {"w": "to", "b": [0.4902, 0.6009, 0.5098, 0.6206]}, {"w": "associate", "b": [0.5161, 0.6009, 0.6072, 0.6206]}, {"w": "a", "b": [0.6135, 0.6009, 0.6247, 0.6206]}, {"w": "vector", "b": [0.631, 0.6009, 0.694, 0.6206]}, {"w": "with", "b": [0.7003, 0.6009, 0.7452, 0.6206]}, {"w": "a", "b": [0.7515, 0.6009, 0.7627, 0.6206]}, {"w": "word", "b": [0.769, 0.6009, 0.8209, 0.6206]}, {"w": "is", "b": [0.8272, 0.6009, 0.844, 0.6206]}, {"w": "the", "b": [0.1294, 0.6214, 0.1602, 0.6411]}, {"w": "use", "b": [0.1665, 0.6214, 0.2002, 0.6411]}, {"w": "of", "b": [0.2065, 0.6214, 0.2275, 0.6411]}, {"w": "dense", "b": [0.2338, 0.6214, 0.2912, 0.6411]}, {"w": "word", "b": [0.2975, 0.6214, 0.3484, 0.6411]}, {"w": "vectors,", "b": [0.3548, 0.6214, 0.4339, 0.6411]}, {"w": "also", "b": [0.4402, 0.6214, 0.4808, 0.6411]}, {"w": "called", "b": [0.4871, 0.6214, 0.5474, 0.6411]}, {"w": "word", "b": [0.5537, 0.6214, 0.6046, 0.6411]}, {"w": "embeddings.", "b": [0.6109, 0.6214, 0.7377, 0.6411]}, {"w": "Whereas", "b": [0.744, 0.6214, 0.8322, 0.6411]}, {"w": "the", "b": [0.8385, 0.6214, 0.8694, 0.6411]}, {"w": "vectors", "b": [0.1294, 0.6419, 0.2023, 0.6616]}, {"w": "obtained", "b": [0.2086, 0.6419, 0.2954, 0.6616]}, {"w": "through", "b": [0.3018, 0.6419, 0.3802, 0.6616]}, {"w": "one-hot", "b": [0.3865, 0.6419, 0.4636, 0.6616]}, {"w": "encoding", "b": [0.4699, 0.6419, 0.5624, 0.6616]}, {"w": "are", "b": [0.5687, 0.6419, 0.5995, 0.6616]}, {"w": "binary,", "b": [0.6058, 0.6419, 0.6749, 0.6616]}, {"w": "sparse", "b": [0.6812, 0.6419, 0.7442, 0.6616]}, {"w": "(mostly", "b": [0.7505, 0.6419, 0.8276, 0.6616]}, {"w": "made", "b": [0.1294, 0.6624, 0.1841, 0.6821]}, {"w": "of", "b": [0.1904, 0.6624, 0.2114, 0.6821]}, {"w": "zeros),", "b": [0.2177, 0.6624, 0.2856, 0.6821]}, {"w": "and", "b": [0.2919, 0.6624, 0.3283, 0.6821]}, {"w": "very", "b": [0.3346, 0.6624, 0.3795, 0.6821]}, {"w": "high-dimensional", "b": [0.3858, 0.6624, 0.5624, 0.6821]}, {"w": "(same", "b": [0.5686, 0.6624, 0.6289, 0.6821]}, {"w": "dimensionality", "b": [0.6352, 0.6624, 0.7851, 0.6821]}, {"w": "as", "b": [0.7914, 0.6624, 0.8124, 0.6821]}, {"w": "the", "b": [0.8188, 0.6624, 0.8496, 0.6821]}, {"w": "number", "b": [0.1294, 0.6829, 0.2065, 0.7026]}, {"w": "of", "b": [0.2128, 0.6829, 0.2338, 0.7026]}, {"w": "words", "b": [0.2401, 0.6829, 0.3018, 0.7026]}, {"w": "in", "b": [0.3081, 0.6829, 0.3277, 0.7026]}, {"w": "the", "b": [0.334, 0.6829, 0.3648, 0.7026]}, {"w": "vocabulary),", "b": [0.3711, 0.6829, 0.4979, 0.7026]}, {"w": "word", "b": [0.5042, 0.6829, 0.5561, 0.7026]}, {"w": "embeddings", "b": [0.5624, 0.6829, 0.6843, 0.7026]}, {"w": "are", "b": [0.6906, 0.6829, 0.7214, 0.7026]}, {"w": "low-", "b": [0.7277, 0.6829, 0.7739, 0.7026]}, {"w": "dimensional", "b": [0.1294, 0.7034, 0.2527, 0.7231]}, {"w": "floating-point", "b": [0.259, 0.7034, 0.3978, 0.7231]}, {"w": "vectors", "b": [0.4041, 0.7034, 0.4769, 0.7231]}, {"w": "(that", "b": [0.4832, 0.7034, 0.5294, 0.7231]}, {"w": "is,", "b": [0.5357, 0.7034, 0.5589, 0.7231]}, {"w": "dense", "b": [0.5652, 0.7034, 0.6226, 0.7231]}, {"w": "vectors,", "b": [0.6289, 0.7034, 0.7081, 0.7231]}, {"w": "as", "b": [0.7144, 0.7034, 0.7354, 0.7231]}, {"w": "opposed", "b": [0.7417, 0.7034, 0.8258, 0.7231]}, {"w": "to", "b": [0.8321, 0.7034, 0.8517, 0.7231]}, {"w": "sparse", "b": [0.1294, 0.7239, 0.1925, 0.7436]}, {"w": "vectors);", "b": [0.1988, 0.7239, 0.287, 0.7436]}, {"w": "see", "b": [0.2933, 0.7239, 0.3255, 0.7436]}, {"w": "figure", "b": [0.3318, 0.7239, 0.3921, 0.7436]}, {"w": "6.2.", "b": [0.3984, 0.7239, 0.4362, 0.7436]}, {"w": "Unlike", "b": [0.4425, 0.7239, 0.5112, 0.7436]}, {"w": "the", "b": [0.5175, 0.7239, 0.5483, 0.7436]}, {"w": "word", "b": [0.5546, 0.7239, 0.6064, 0.7436]}, {"w": "vectors", "b": [0.6128, 0.7239, 0.6856, 0.7436]}, {"w": "obtained", "b": [0.6919, 0.7239, 0.7788, 0.7436]}, {"w": "via", "b": [0.7851, 0.7239, 0.8159, 0.7436]}, {"w": "one-", "b": [0.8222, 0.7239, 0.8671, 0.7436]}, {"w": "hot", "b": [0.1294, 0.7444, 0.1617, 0.7641]}, {"w": "encoding,", "b": [0.168, 0.7444, 0.2667, 0.7641]}, {"w": "word", "b": [0.273, 0.7444, 0.3249, 0.7641]}, {"w": "embeddings", "b": [0.3312, 0.7444, 0.4531, 0.7641]}, {"w": "are", "b": [0.4594, 0.7444, 0.4902, 0.7641]}, {"w": "learned", "b": [0.4965, 0.7444, 0.5708, 0.7641]}, {"w": "from", "b": [0.5771, 0.7444, 0.6261, 0.7641]}, {"w": "data.", "b": [0.6324, 0.7444, 0.6807, 0.7641]}, {"w": "It’s", "b": [0.6871, 0.7444, 0.7192, 0.7641]}, {"w": "common", "b": [0.7255, 0.7444, 0.8138, 0.7641]}, {"w": "to", "b": [0.8201, 0.7444, 0.8397, 0.7641]}, {"w": "see", "b": [0.1294, 0.7649, 0.1616, 0.7846]}, {"w": "word", "b": [0.1679, 0.7649, 0.2198, 0.7846]}, {"w": "embeddings", "b": [0.2261, 0.7649, 0.348, 0.7846]}, {"w": "that", "b": [0.3543, 0.7649, 0.3921, 0.7846]}, {"w": "are", "b": [0.3984, 0.7649, 0.4292, 0.7846]}, {"w": "256-dimensional,", "b": [0.4355, 0.7649, 0.6114, 0.7846]}, {"w": "512-dimensional,", "b": [0.6177, 0.7649, 0.7936, 0.7846]}, {"w": "or", "b": [0.7999, 0.7649, 0.8209, 0.7846]}, {"w": "1,024-dimensional", "b": [0.1294, 0.7854, 0.3179, 0.8051]}, {"w": "when", "b": [0.3242, 0.7854, 0.3788, 0.8051]}, {"w": "dealing", "b": [0.3852, 0.7854, 0.4594, 0.8051]}, {"w": "with", "b": [0.4657, 0.7854, 0.5106, 0.8051]}, {"w": "very", "b": [0.5169, 0.7854, 0.5617, 0.8051]}, {"w": "large", "b": [0.568, 0.7854, 0.6179, 0.8051]}, {"w": "vocabularies.", "b": [0.6242, 0.7854, 0.758, 0.8051]}, {"w": "On", "b": [0.7643, 0.7854, 0.7952, 0.8051]}, {"w": "the", "b": [0.8015, 0.7854, 0.8323, 0.8051]}, {"w": "other", "b": [0.1294, 0.8059, 0.1813, 0.8256]}, {"w": "hand,", "b": [0.1876, 0.8059, 0.2429, 0.8256]}, {"w": "one-hot", "b": [0.2492, 0.8059, 0.3263, 0.8256]}, {"w": "encoding", "b": [0.3326, 0.8059, 0.425, 0.8256]}, {"w": "words", "b": [0.4314, 0.8059, 0.493, 0.8256]}, {"w": "generally", "b": [0.4993, 0.8059, 0.5932, 0.8256]}, {"w": "leads", "b": [0.5995, 0.8059, 0.6513, 0.8256]}, {"w": "to", "b": [0.6576, 0.8059, 0.6773, 0.8256]}, {"w": "vectors", "b": [0.6836, 0.8059, 0.7564, 0.8256]}, {"w": "that", "b": [0.7627, 0.8059, 0.8006, 0.8256]}, {"w": "are", "b": [0.8069, 0.8059, 0.8377, 0.8256]}, {"w": "20,000-dimensional", "b": [0.1294, 0.8264, 0.3305, 0.8461]}, {"w": "or", "b": [0.3368, 0.8264, 0.3578, 0.8461]}, {"w": "greater", "b": [0.3641, 0.8264, 0.4342, 0.8461]}, {"w": "(capturing", "b": [0.4405, 0.8264, 0.5441, 0.8461]}, {"w": "a", "b": [0.5505, 0.8264, 0.5617, 0.8461]}, {"w": "vocabulary", "b": [0.568, 0.8264, 0.68, 0.8461]}, {"w": "of", "b": [0.6863, 0.8264, 0.7074, 0.8461]}, {"w": "20,000", "b": [0.7137, 0.8264, 0.783, 0.8461]}, {"w": "tokens,", "b": [0.7893, 0.8264, 0.8614, 0.8461]}, {"w": "in", "b": [0.1294, 0.8469, 0.149, 0.8666]}, {"w": "this", "b": [0.1553, 0.8469, 0.1918, 0.8666]}, {"w": "case).", "b": [0.1981, 0.8469, 0.2562, 0.8666]}, {"w": "So,", "b": [0.2625, 0.8469, 0.2955, 0.8666]}, {"w": "word", "b": [0.3018, 0.8469, 0.3536, 0.8666]}, {"w": "embeddings", "b": [0.3599, 0.8469, 0.4818, 0.8666]}, {"w": "pack", "b": [0.4881, 0.8469, 0.5358, 0.8666]}, {"w": "more", "b": [0.5421, 0.8469, 0.5939, 0.8666]}, {"w": "information", "b": [0.6002, 0.8469, 0.7193, 0.8666]}, {"w": "into", "b": [0.7256, 0.8469, 0.7649, 0.8666]}, {"w": "far", "b": [0.7712, 0.8469, 0.7992, 0.8666]}, {"w": "fewer", "b": [0.8055, 0.8469, 0.8629, 0.8666]}, {"w": "dimensions.", "b": [0.1294, 0.8674, 0.2506, 0.8871]}]}]}, {"page": 245, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 6.2. Whereas word representations obtained from one-hot encoding or hashing are sparse, high-dimensional, and hardcoded, word embeddings are dense, relatively lowdimensional, and learned from data.", "words": [{"w": "Figure", "b": [0.1294, 0.0852, 0.1827, 0.1]}, {"w": "6.2.", "b": [0.1874, 0.0852, 0.2158, 0.1]}, {"w": "Whereas", "b": [0.2205, 0.0852, 0.2916, 0.1]}, {"w": "word", "b": [0.2963, 0.0852, 0.3384, 0.1]}, {"w": "representations", "b": [0.3431, 0.0852, 0.4675, 0.1]}, {"w": "obtained", "b": [0.4722, 0.0852, 0.5426, 0.1]}, {"w": "from", "b": [0.5474, 0.0852, 0.5869, 0.1]}, {"w": "one-hot", "b": [0.5917, 0.0852, 0.6526, 0.1]}, {"w": "encoding", "b": [0.6574, 0.0852, 0.7299, 0.1]}, {"w": "or", "b": [0.7346, 0.0852, 0.7525, 0.1]}, {"w": "hashing", "b": [0.7572, 0.0852, 0.8203, 0.1]}, {"w": "are", "b": [0.825, 0.0852, 0.851, 0.1]}, {"w": "sparse,", "b": [0.1294, 0.1003, 0.1856, 0.1151]}, {"w": "high-dimensional,", "b": [0.1904, 0.1003, 0.3349, 0.1151]}, {"w": "and", "b": [0.3397, 0.1003, 0.3702, 0.1151]}, {"w": "hardcoded,", "b": [0.3749, 0.1003, 0.4658, 0.1151]}, {"w": "word", "b": [0.4705, 0.1003, 0.5126, 0.1151]}, {"w": "embeddings", "b": [0.5173, 0.1003, 0.614, 0.1151]}, {"w": "are", "b": [0.6188, 0.1003, 0.6447, 0.1151]}, {"w": "dense,", "b": [0.6494, 0.1003, 0.6993, 0.1151]}, {"w": "relatively", "b": [0.7041, 0.1003, 0.7794, 0.1151]}, {"w": "lowdimensional,", "b": [0.1294, 0.1155, 0.2603, 0.1303]}, {"w": "and", "b": [0.265, 0.1155, 0.2955, 0.1303]}, {"w": "learned", "b": [0.3003, 0.1155, 0.3612, 0.1303]}, {"w": "from", "b": [0.3659, 0.1155, 0.4055, 0.1303]}, {"w": "data.", "b": [0.4102, 0.1155, 0.4507, 0.1303]}]}, {"id": "b_1", "type": "paragraph", "text": "There are two ways to obtain word embeddings:", "words": [{"w": "There", "b": [0.1294, 0.4734, 0.1882, 0.4931]}, {"w": "are", "b": [0.1945, 0.4734, 0.2253, 0.4931]}, {"w": "two", "b": [0.2317, 0.4734, 0.2695, 0.4931]}, {"w": "ways", "b": [0.2758, 0.4734, 0.3276, 0.4931]}, {"w": "to", "b": [0.3339, 0.4734, 0.3536, 0.4931]}, {"w": "obtain", "b": [0.3599, 0.4734, 0.4229, 0.4931]}, {"w": "word", "b": [0.4292, 0.4734, 0.4811, 0.4931]}, {"w": "embeddings:", "b": [0.4874, 0.4734, 0.6163, 0.4931]}]}, {"id": "b_2", "type": "paragraph", "text": "Learn word embeddings jointly with the main task you care about (such as document classification or sentiment prediction). In this setup, you start with random word vectors and then learn word vectors in the same way you learn the weights of a neural network. Load into your model word embeddings that were precomputed using a different machine-learning task than the one you’re trying to solve. These are called pretrained word embeddings.", "words": [{"w": "Learn", "b": [0.1799, 0.5117, 0.2387, 0.5315]}, {"w": "word", "b": [0.245, 0.5117, 0.2968, 0.5315]}, {"w": "embeddings", "b": [0.3031, 0.5117, 0.4251, 0.5315]}, {"w": "jointly", "b": [0.4314, 0.5117, 0.4973, 0.5315]}, {"w": "with", "b": [0.5036, 0.5117, 0.5484, 0.5315]}, {"w": "the", "b": [0.5547, 0.5117, 0.5855, 0.5315]}, {"w": "main", "b": [0.5919, 0.5117, 0.6423, 0.5315]}, {"w": "task", "b": [0.6486, 0.5117, 0.6892, 0.5315]}, {"w": "you", "b": [0.6956, 0.5117, 0.7334, 0.5315]}, {"w": "care", "b": [0.7397, 0.5117, 0.7817, 0.5315]}, {"w": "about", "b": [0.788, 0.5117, 0.8441, 0.5315]}, {"w": "(such", "b": [0.1799, 0.5322, 0.2345, 0.552]}, {"w": "as", "b": [0.2408, 0.5322, 0.2618, 0.552]}, {"w": "document", "b": [0.2681, 0.5322, 0.3676, 0.552]}, {"w": "classification", "b": [0.3739, 0.5322, 0.507, 0.552]}, {"w": "or", "b": [0.5133, 0.5322, 0.5344, 0.552]}, {"w": "sentiment", "b": [0.5407, 0.5322, 0.6388, 0.552]}, {"w": "prediction).", "b": [0.6451, 0.5322, 0.7621, 0.552]}, {"w": "In", "b": [0.7683, 0.5322, 0.7893, 0.552]}, {"w": "this", "b": [0.7956, 0.5322, 0.8321, 0.552]}, {"w": "setup,", "b": [0.1799, 0.5527, 0.2394, 0.5725]}, {"w": "you", "b": [0.2457, 0.5527, 0.2836, 0.5725]}, {"w": "start", "b": [0.2899, 0.5527, 0.3333, 0.5725]}, {"w": "with", "b": [0.3396, 0.5527, 0.3845, 0.5725]}, {"w": "random", "b": [0.3908, 0.5527, 0.4678, 0.5725]}, {"w": "word", "b": [0.4741, 0.5527, 0.526, 0.5725]}, {"w": "vectors", "b": [0.5323, 0.5527, 0.6051, 0.5725]}, {"w": "and", "b": [0.6115, 0.5527, 0.6479, 0.5725]}, {"w": "then", "b": [0.6542, 0.5527, 0.6976, 0.5725]}, {"w": "learn", "b": [0.7039, 0.5527, 0.7544, 0.5725]}, {"w": "word", "b": [0.7607, 0.5527, 0.8125, 0.5725]}, {"w": "vectors", "b": [0.1799, 0.5732, 0.2527, 0.593]}, {"w": "in", "b": [0.259, 0.5732, 0.2786, 0.593]}, {"w": "the", "b": [0.285, 0.5732, 0.3158, 0.593]}, {"w": "same", "b": [0.3221, 0.5732, 0.3739, 0.593]}, {"w": "way", "b": [0.3802, 0.5732, 0.4223, 0.593]}, {"w": "you", "b": [0.4286, 0.5732, 0.4664, 0.593]}, {"w": "learn", "b": [0.4727, 0.5732, 0.5231, 0.593]}, {"w": "the", "b": [0.5294, 0.5732, 0.5603, 0.593]}, {"w": "weights", "b": [0.5666, 0.5732, 0.6451, 0.593]}, {"w": "of", "b": [0.6514, 0.5732, 0.6724, 0.593]}, {"w": "a", "b": [0.6787, 0.5732, 0.6899, 0.593]}, {"w": "neural", "b": [0.6962, 0.5732, 0.7592, 0.593]}, {"w": "network.", "b": [0.7655, 0.5732, 0.8544, 0.593]}, {"w": "Load", "b": [0.1799, 0.5937, 0.2317, 0.6135]}, {"w": "into", "b": [0.238, 0.5937, 0.2773, 0.6135]}, {"w": "your", "b": [0.2836, 0.5937, 0.3298, 0.6135]}, {"w": "model", "b": [0.3361, 0.5937, 0.3992, 0.6135]}, {"w": "word", "b": [0.4055, 0.5937, 0.4573, 0.6135]}, {"w": "embeddings", "b": [0.4636, 0.5937, 0.5855, 0.6135]}, {"w": "that", "b": [0.5919, 0.5937, 0.6297, 0.6135]}, {"w": "were", "b": [0.636, 0.5937, 0.685, 0.6135]}, {"w": "precomputed", "b": [0.6913, 0.5937, 0.823, 0.6135]}, {"w": "using", "b": [0.1799, 0.6142, 0.2345, 0.634]}, {"w": "a", "b": [0.2408, 0.6142, 0.252, 0.634]}, {"w": "different", "b": [0.2583, 0.6142, 0.3447, 0.634]}, {"w": "machine-learning", "b": [0.351, 0.6142, 0.5276, 0.634]}, {"w": "task", "b": [0.5339, 0.6142, 0.5745, 0.634]}, {"w": "than", "b": [0.5808, 0.6142, 0.6243, 0.634]}, {"w": "the", "b": [0.6306, 0.6142, 0.6614, 0.634]}, {"w": "one", "b": [0.6677, 0.6142, 0.7041, 0.634]}, {"w": "you’re", "b": [0.7104, 0.6142, 0.7763, 0.634]}, {"w": "trying", "b": [0.7826, 0.6142, 0.8428, 0.634]}, {"w": "to", "b": [0.8491, 0.6142, 0.8687, 0.634]}, {"w": "solve.", "b": [0.1799, 0.6347, 0.2394, 0.6545]}, {"w": "These", "b": [0.2457, 0.6347, 0.306, 0.6545]}, {"w": "are", "b": [0.3123, 0.6347, 0.3431, 0.6545]}, {"w": "called", "b": [0.3494, 0.6347, 0.4096, 0.6545]}, {"w": "pretrained", "b": [0.4159, 0.6347, 0.5215, 0.6545]}, {"w": "word", "b": [0.5278, 0.6347, 0.5787, 0.6545]}, {"w": "embeddings.", "b": [0.585, 0.6347, 0.7118, 0.6545]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s look at both.", "words": [{"w": "Let’s", "b": [0.1294, 0.6775, 0.1798, 0.6973]}, {"w": "look", "b": [0.1862, 0.6775, 0.231, 0.6973]}, {"w": "at", "b": [0.2373, 0.6775, 0.2555, 0.6973]}, {"w": "both.", "b": [0.2618, 0.6775, 0.313, 0.6973]}]}, {"id": "b_4", "type": "paragraph", "text": "Learning word embeddings with the Embedding layer", "words": [{"w": "Learning", "b": [0.1294, 0.7154, 0.204, 0.7302]}, {"w": "word", "b": [0.2088, 0.7154, 0.2508, 0.7302]}, {"w": "embeddings", "b": [0.2555, 0.7154, 0.3523, 0.7302]}, {"w": "with", "b": [0.357, 0.7154, 0.3927, 0.7302]}, {"w": "the", "b": [0.3975, 0.7154, 0.4227, 0.7302]}, {"w": "Embedding", "b": [0.4274, 0.7154, 0.521, 0.7302]}, {"w": "layer", "b": [0.5257, 0.7154, 0.5667, 0.7302]}]}, {"id": "b_5", "type": "paragraph", "text": "The simplest way to associate a dense vector with a word is to choose the vector at random. The problem with this approach is that the resulting embedding space has no structure: for instance, the words accurate and exact may end up with completely different embeddings, even though they’re interchangeable in most sentences. It’s difficult for a deep neural network to make sense of such a noisy, unstructured embedding space.", "words": [{"w": "The", "b": [0.1294, 0.7533, 0.1686, 0.773]}, {"w": "simplest", "b": [0.1749, 0.7533, 0.259, 0.773]}, {"w": "way", "b": [0.2654, 0.7533, 0.3074, 0.773]}, {"w": "to", "b": [0.3137, 0.7533, 0.3333, 0.773]}, {"w": "associate", "b": [0.3396, 0.7533, 0.4307, 0.773]}, {"w": "a", "b": [0.437, 0.7533, 0.4482, 0.773]}, {"w": "dense", "b": [0.4545, 0.7533, 0.5119, 0.773]}, {"w": "vector", "b": [0.5182, 0.7533, 0.5813, 0.773]}, {"w": "with", "b": [0.5876, 0.7533, 0.6324, 0.773]}, {"w": "a", "b": [0.6387, 0.7533, 0.6499, 0.773]}, {"w": "word", "b": [0.6563, 0.7533, 0.7081, 0.773]}, {"w": "is", "b": [0.7144, 0.7533, 0.7312, 0.773]}, {"w": "to", "b": [0.7375, 0.7533, 0.7572, 0.773]}, {"w": "choose", "b": [0.7635, 0.7533, 0.8335, 0.773]}, {"w": "the", "b": [0.8398, 0.7533, 0.8706, 0.773]}, {"w": "vector", "b": [0.1294, 0.7738, 0.1925, 0.7935]}, {"w": "at", "b": [0.1988, 0.7738, 0.217, 0.7935]}, {"w": "random.", "b": [0.2233, 0.7738, 0.3066, 0.7935]}, {"w": "The", "b": [0.313, 0.7738, 0.3522, 0.7935]}, {"w": "problem", "b": [0.3585, 0.7738, 0.4426, 0.7935]}, {"w": "with", "b": [0.4489, 0.7738, 0.4937, 0.7935]}, {"w": "this", "b": [0.5, 0.7738, 0.5365, 0.7935]}, {"w": "approach", "b": [0.5428, 0.7738, 0.6352, 0.7935]}, {"w": "is", "b": [0.6415, 0.7738, 0.6583, 0.7935]}, {"w": "that", "b": [0.6646, 0.7738, 0.7024, 0.7935]}, {"w": "the", "b": [0.7088, 0.7738, 0.7396, 0.7935]}, {"w": "resulting", "b": [0.7459, 0.7738, 0.8342, 0.7935]}, {"w": "embedding", "b": [0.1294, 0.7943, 0.2415, 0.814]}, {"w": "space", "b": [0.2478, 0.7943, 0.3038, 0.814]}, {"w": "has", "b": [0.3102, 0.7943, 0.3438, 0.814]}, {"w": "no", "b": [0.3501, 0.7943, 0.3753, 0.814]}, {"w": "structure:", "b": [0.3816, 0.7943, 0.4769, 0.814]}, {"w": "for", "b": [0.4832, 0.7943, 0.5126, 0.814]}, {"w": "instance,", "b": [0.5189, 0.7943, 0.6079, 0.814]}, {"w": "the", "b": [0.6142, 0.7943, 0.645, 0.814]}, {"w": "words", "b": [0.6513, 0.7943, 0.713, 0.814]}, {"w": "accurate", "b": [0.7192, 0.7943, 0.8075, 0.814]}, {"w": "and", "b": [0.8138, 0.7943, 0.8502, 0.814]}, {"w": "exact", "b": [0.1294, 0.8148, 0.1826, 0.8345]}, {"w": "may", "b": [0.1889, 0.8148, 0.2324, 0.8345]}, {"w": "end", "b": [0.2387, 0.8148, 0.2751, 0.8345]}, {"w": "up", "b": [0.2814, 0.8148, 0.3066, 0.8345]}, {"w": "with", "b": [0.3129, 0.8148, 0.3578, 0.8345]}, {"w": "completely", "b": [0.3641, 0.8148, 0.4762, 0.8345]}, {"w": "different", "b": [0.4825, 0.8148, 0.5689, 0.8345]}, {"w": "embeddings,", "b": [0.5752, 0.8148, 0.7034, 0.8345]}, {"w": "even", "b": [0.7097, 0.8148, 0.7573, 0.8345]}, {"w": "though", "b": [0.7636, 0.8148, 0.8337, 0.8345]}, {"w": "they’re", "b": [0.1294, 0.8353, 0.2009, 0.855]}, {"w": "interchangeable", "b": [0.2072, 0.8353, 0.3669, 0.855]}, {"w": "in", "b": [0.3732, 0.8353, 0.3928, 0.855]}, {"w": "most", "b": [0.3991, 0.8353, 0.4482, 0.855]}, {"w": "sentences.", "b": [0.4545, 0.8353, 0.5574, 0.855]}, {"w": "It’s", "b": [0.5637, 0.8353, 0.5959, 0.855]}, {"w": "difficult", "b": [0.6022, 0.8353, 0.683, 0.855]}, {"w": "for", "b": [0.6893, 0.8353, 0.7188, 0.855]}, {"w": "a", "b": [0.725, 0.8353, 0.7362, 0.855]}, {"w": "deep", "b": [0.7425, 0.8353, 0.7902, 0.855]}, {"w": "neural", "b": [0.7965, 0.8353, 0.8595, 0.855]}, {"w": "network", "b": [0.1294, 0.8558, 0.2121, 0.8755]}, {"w": "to", "b": [0.2184, 0.8558, 0.238, 0.8755]}, {"w": "make", "b": [0.2443, 0.8558, 0.299, 0.8755]}, {"w": "sense", "b": [0.3053, 0.8558, 0.3599, 0.8755]}, {"w": "of", "b": [0.3662, 0.8558, 0.3872, 0.8755]}, {"w": "such", "b": [0.3935, 0.8558, 0.4398, 0.8755]}, {"w": "a", "b": [0.4461, 0.8558, 0.4573, 0.8755]}, {"w": "noisy,", "b": [0.4636, 0.8558, 0.5229, 0.8755]}, {"w": "unstructured", "b": [0.5292, 0.8558, 0.6553, 0.8755]}, {"w": "embedding", "b": [0.6616, 0.8558, 0.7737, 0.8755]}, {"w": "space.", "b": [0.78, 0.8558, 0.8423, 0.8755]}]}]}, {"page": 246, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "To get a bit more abstract, the geometric relationships between word vectors should reflect the semantic relationships between these words. Word embeddings are meant to map human language into a geometric space. For instance, in a reasonable embedding space, you would expect synonyms to be embedded into similar word vectors; and in general, you would expect the geometric distance (such as L2 distance) between any two word vectors to relate to the semantic distance between the associated words (words meaning different things are embedded at points far away from each other, whereas related words are closer). In addition to distance, you may want specific directions in the embedding space to be meaningful. To make this clearer, let’s look at a concrete example.", "words": [{"w": "To", "b": [0.1294, 0.0857, 0.1557, 0.1054]}, {"w": "get", "b": [0.162, 0.0857, 0.1928, 0.1054]}, {"w": "a", "b": [0.1991, 0.0857, 0.2103, 0.1054]}, {"w": "bit", "b": [0.2166, 0.0857, 0.2433, 0.1054]}, {"w": "more", "b": [0.2496, 0.0857, 0.3014, 0.1054]}, {"w": "abstract,", "b": [0.3077, 0.0857, 0.3925, 0.1054]}, {"w": "the", "b": [0.3988, 0.0857, 0.4296, 0.1054]}, {"w": "geometric", "b": [0.4359, 0.0857, 0.5368, 0.1054]}, {"w": "relationships", "b": [0.5431, 0.0857, 0.672, 0.1054]}, {"w": "between", "b": [0.6783, 0.0857, 0.7624, 0.1054]}, {"w": "word", "b": [0.7687, 0.0857, 0.8205, 0.1054]}, {"w": "vectors", "b": [0.1294, 0.1062, 0.2023, 0.1259]}, {"w": "should", "b": [0.2086, 0.1062, 0.2758, 0.1259]}, {"w": "reflect", "b": [0.2822, 0.1062, 0.3466, 0.1259]}, {"w": "the", "b": [0.3529, 0.1062, 0.3837, 0.1259]}, {"w": "semantic", "b": [0.39, 0.1062, 0.4797, 0.1259]}, {"w": "relationships", "b": [0.486, 0.1062, 0.6149, 0.1259]}, {"w": "between", "b": [0.6212, 0.1062, 0.7053, 0.1259]}, {"w": "these", "b": [0.7115, 0.1062, 0.7633, 0.1259]}, {"w": "words.", "b": [0.7696, 0.1062, 0.8376, 0.1259]}, {"w": "Word", "b": [0.1294, 0.1267, 0.1848, 0.1464]}, {"w": "embeddings", "b": [0.1911, 0.1267, 0.313, 0.1464]}, {"w": "are", "b": [0.3194, 0.1267, 0.3502, 0.1464]}, {"w": "meant", "b": [0.3565, 0.1267, 0.4181, 0.1464]}, {"w": "to", "b": [0.4244, 0.1267, 0.444, 0.1464]}, {"w": "map", "b": [0.4504, 0.1267, 0.4938, 0.1464]}, {"w": "human", "b": [0.5001, 0.1267, 0.5688, 0.1464]}, {"w": "language", "b": [0.5751, 0.1267, 0.6661, 0.1464]}, {"w": "into", "b": [0.6724, 0.1267, 0.7117, 0.1464]}, {"w": "a", "b": [0.718, 0.1267, 0.7292, 0.1464]}, {"w": "geometric", "b": [0.7355, 0.1267, 0.8364, 0.1464]}, {"w": "space.", "b": [0.1294, 0.1472, 0.1917, 0.1669]}, {"w": "For", "b": [0.1981, 0.1472, 0.2331, 0.1669]}, {"w": "instance,", "b": [0.2394, 0.1472, 0.3284, 0.1669]}, {"w": "in", "b": [0.3347, 0.1472, 0.3543, 0.1669]}, {"w": "a", "b": [0.3606, 0.1472, 0.3718, 0.1669]}, {"w": "reasonable", "b": [0.3781, 0.1472, 0.486, 0.1669]}, {"w": "embedding", "b": [0.4923, 0.1472, 0.6044, 0.1669]}, {"w": "space,", "b": [0.6106, 0.1472, 0.673, 0.1669]}, {"w": "you", "b": [0.6793, 0.1472, 0.7171, 0.1669]}, {"w": "would", "b": [0.7234, 0.1472, 0.7865, 0.1669]}, {"w": "expect", "b": [0.7928, 0.1472, 0.8586, 0.1669]}, {"w": "synonyms", "b": [0.1294, 0.1677, 0.2317, 0.1874]}, {"w": "to", "b": [0.238, 0.1677, 0.2577, 0.1874]}, {"w": "be", "b": [0.264, 0.1677, 0.2878, 0.1874]}, {"w": "embedded", "b": [0.2941, 0.1677, 0.3978, 0.1874]}, {"w": "into", "b": [0.4041, 0.1677, 0.4433, 0.1874]}, {"w": "similar", "b": [0.4496, 0.1677, 0.5197, 0.1874]}, {"w": "word", "b": [0.526, 0.1677, 0.5779, 0.1874]}, {"w": "vectors;", "b": [0.5842, 0.1677, 0.664, 0.1874]}, {"w": "and", "b": [0.6703, 0.1677, 0.7068, 0.1874]}, {"w": "in", "b": [0.7131, 0.1677, 0.7327, 0.1874]}, {"w": "general,", "b": [0.739, 0.1677, 0.8195, 0.1874]}, {"w": "you", "b": [0.8258, 0.1677, 0.8637, 0.1874]}, {"w": "would", "b": [0.1294, 0.1882, 0.1925, 0.2079]}, {"w": "expect", "b": [0.1988, 0.1882, 0.2646, 0.2079]}, {"w": "the", "b": [0.2709, 0.1882, 0.3018, 0.2079]}, {"w": "geometric", "b": [0.3081, 0.1882, 0.4089, 0.2079]}, {"w": "distance", "b": [0.4152, 0.1882, 0.4979, 0.2079]}, {"w": "(such", "b": [0.5042, 0.1882, 0.5588, 0.2079]}, {"w": "as", "b": [0.5651, 0.1882, 0.5861, 0.2079]}, {"w": "L2", "b": [0.5924, 0.1882, 0.6205, 0.2079]}, {"w": "distance)", "b": [0.6268, 0.1882, 0.7178, 0.2079]}, {"w": "between", "b": [0.7241, 0.1882, 0.8082, 0.2079]}, {"w": "any", "b": [0.8145, 0.1882, 0.8509, 0.2079]}, {"w": "two", "b": [0.1294, 0.2087, 0.1673, 0.2284]}, {"w": "word", "b": [0.1736, 0.2087, 0.2254, 0.2284]}, {"w": "vectors", "b": [0.2317, 0.2087, 0.3046, 0.2284]}, {"w": "to", "b": [0.3109, 0.2087, 0.3305, 0.2284]}, {"w": "relate", "b": [0.3368, 0.2087, 0.3928, 0.2284]}, {"w": "to", "b": [0.3991, 0.2087, 0.4188, 0.2284]}, {"w": "the", "b": [0.4251, 0.2087, 0.4559, 0.2284]}, {"w": "semantic", "b": [0.4622, 0.2087, 0.5519, 0.2284]}, {"w": "distance", "b": [0.5582, 0.2087, 0.6408, 0.2284]}, {"w": "between", "b": [0.6471, 0.2087, 0.7312, 0.2284]}, {"w": "the", "b": [0.7375, 0.2087, 0.7683, 0.2284]}, {"w": "associated", "b": [0.1294, 0.2292, 0.2331, 0.2489]}, {"w": "words", "b": [0.2394, 0.2292, 0.301, 0.2489]}, {"w": "(words", "b": [0.3073, 0.2292, 0.3774, 0.2489]}, {"w": "meaning", "b": [0.3837, 0.2292, 0.4706, 0.2489]}, {"w": "different", "b": [0.4769, 0.2292, 0.5633, 0.2489]}, {"w": "things", "b": [0.5696, 0.2292, 0.6312, 0.2489]}, {"w": "are", "b": [0.6375, 0.2292, 0.6684, 0.2489]}, {"w": "embedded", "b": [0.6747, 0.2292, 0.7783, 0.2489]}, {"w": "at", "b": [0.7846, 0.2292, 0.8029, 0.2489]}, {"w": "points", "b": [0.1294, 0.2497, 0.1911, 0.2694]}, {"w": "far", "b": [0.1974, 0.2497, 0.2254, 0.2694]}, {"w": "away", "b": [0.2317, 0.2497, 0.2849, 0.2694]}, {"w": "from", "b": [0.2912, 0.2497, 0.3403, 0.2694]}, {"w": "each", "b": [0.3466, 0.2497, 0.3928, 0.2694]}, {"w": "other,", "b": [0.3991, 0.2497, 0.4562, 0.2694]}, {"w": "whereas", "b": [0.4625, 0.2497, 0.5451, 0.2694]}, {"w": "related", "b": [0.5515, 0.2497, 0.6201, 0.2694]}, {"w": "words", "b": [0.6264, 0.2497, 0.6881, 0.2694]}, {"w": "are", "b": [0.6944, 0.2497, 0.7252, 0.2694]}, {"w": "closer).", "b": [0.7315, 0.2497, 0.8064, 0.2694]}, {"w": "In", "b": [0.8127, 0.2497, 0.8337, 0.2694]}, {"w": "addition", "b": [0.1294, 0.2702, 0.2121, 0.2899]}, {"w": "to", "b": [0.2184, 0.2702, 0.238, 0.2899]}, {"w": "distance,", "b": [0.2443, 0.2702, 0.3333, 0.2899]}, {"w": "you", "b": [0.3396, 0.2702, 0.3774, 0.2899]}, {"w": "may", "b": [0.3837, 0.2702, 0.4272, 0.2899]}, {"w": "want", "b": [0.4335, 0.2702, 0.4825, 0.2899]}, {"w": "specific", "b": [0.4888, 0.2702, 0.5673, 0.2899]}, {"w": "directions", "b": [0.5735, 0.2702, 0.6735, 0.2899]}, {"w": "in", "b": [0.6798, 0.2702, 0.6994, 0.2899]}, {"w": "the", "b": [0.7057, 0.2702, 0.7365, 0.2899]}, {"w": "embedding", "b": [0.7429, 0.2702, 0.855, 0.2899]}, {"w": "space", "b": [0.1294, 0.2907, 0.1854, 0.3104]}, {"w": "to", "b": [0.1917, 0.2907, 0.2114, 0.3104]}, {"w": "be", "b": [0.2177, 0.2907, 0.2415, 0.3104]}, {"w": "meaningful.", "b": [0.2478, 0.2907, 0.369, 0.3104]}, {"w": "To", "b": [0.3753, 0.2907, 0.4015, 0.3104]}, {"w": "make", "b": [0.4078, 0.2907, 0.4625, 0.3104]}, {"w": "this", "b": [0.4688, 0.2907, 0.5052, 0.3104]}, {"w": "clearer,", "b": [0.5115, 0.2907, 0.5854, 0.3104]}, {"w": "let’s", "b": [0.5917, 0.2907, 0.6338, 0.3104]}, {"w": "look", "b": [0.6401, 0.2907, 0.6849, 0.3104]}, {"w": "at", "b": [0.6912, 0.2907, 0.7094, 0.3104]}, {"w": "a", "b": [0.7157, 0.2907, 0.7269, 0.3104]}, {"w": "concrete", "b": [0.7333, 0.2907, 0.8187, 0.3104]}, {"w": "example.", "b": [0.1294, 0.3112, 0.2212, 0.3309]}]}, {"id": "b_1", "type": "paragraph", "text": "In figure 6.3, four words are embedded on a 2D plane: cat, dog, wolf, and tiger. With the vector representations we chose here, some semantic relationships between these words can be encoded as geometric transformations. For instance, the same vector allows us to go from cat to tiger and from dog to wolf: this vector could be interpreted as the “from pet to wild animal” vector. Similarly, another vector lets us go from dog to cat and from wolf to tiger, which could be interpreted as a “from canine to feline” vector.", "words": [{"w": "In", "b": [0.1294, 0.354, 0.1504, 0.3737]}, {"w": "figure", "b": [0.1567, 0.354, 0.217, 0.3737]}, {"w": "6.3,", "b": [0.2233, 0.354, 0.2611, 0.3737]}, {"w": "four", "b": [0.2674, 0.354, 0.3094, 0.3737]}, {"w": "words", "b": [0.3157, 0.354, 0.3774, 0.3737]}, {"w": "are", "b": [0.3837, 0.354, 0.4145, 0.3737]}, {"w": "embedded", "b": [0.4208, 0.354, 0.5245, 0.3737]}, {"w": "on", "b": [0.5308, 0.354, 0.556, 0.3737]}, {"w": "a", "b": [0.5623, 0.354, 0.5735, 0.3737]}, {"w": "2D", "b": [0.5798, 0.354, 0.6107, 0.3737]}, {"w": "plane:", "b": [0.617, 0.354, 0.6786, 0.3737]}, {"w": "cat,", "b": [0.6849, 0.354, 0.722, 0.3737]}, {"w": "dog,", "b": [0.7283, 0.354, 0.7724, 0.3737]}, {"w": "wolf,", "b": [0.7787, 0.354, 0.8285, 0.3737]}, {"w": "and", "b": [0.1294, 0.3745, 0.1658, 0.3942]}, {"w": "tiger.", "b": [0.1721, 0.3745, 0.2261, 0.3942]}, {"w": "With", "b": [0.2324, 0.3745, 0.2818, 0.3942]}, {"w": "the", "b": [0.2881, 0.3745, 0.319, 0.3942]}, {"w": "vector", "b": [0.3253, 0.3745, 0.3883, 0.3942]}, {"w": "representations", "b": [0.3946, 0.3745, 0.5473, 0.3942]}, {"w": "we", "b": [0.5536, 0.3745, 0.583, 0.3942]}, {"w": "chose", "b": [0.5893, 0.3745, 0.6468, 0.3942]}, {"w": "here,", "b": [0.6531, 0.3745, 0.7028, 0.3942]}, {"w": "some", "b": [0.7091, 0.3745, 0.7624, 0.3942]}, {"w": "semantic", "b": [0.7687, 0.3745, 0.8584, 0.3942]}, {"w": "relationships", "b": [0.1294, 0.395, 0.2583, 0.4147]}, {"w": "between", "b": [0.2646, 0.395, 0.3487, 0.4147]}, {"w": "these", "b": [0.355, 0.395, 0.4068, 0.4147]}, {"w": "words", "b": [0.4132, 0.395, 0.4748, 0.4147]}, {"w": "can", "b": [0.4811, 0.395, 0.5161, 0.4147]}, {"w": "be", "b": [0.5224, 0.395, 0.5462, 0.4147]}, {"w": "encoded", "b": [0.5525, 0.395, 0.6366, 0.4147]}, {"w": "as", "b": [0.6429, 0.395, 0.6639, 0.4147]}, {"w": "geometric", "b": [0.6702, 0.395, 0.7711, 0.4147]}, {"w": "transformations.", "b": [0.1294, 0.4155, 0.2941, 0.4352]}, {"w": "For", "b": [0.3004, 0.4155, 0.3354, 0.4352]}, {"w": "instance,", "b": [0.3417, 0.4155, 0.4307, 0.4352]}, {"w": "the", "b": [0.437, 0.4155, 0.4678, 0.4352]}, {"w": "same", "b": [0.4741, 0.4155, 0.526, 0.4352]}, {"w": "vector", "b": [0.5323, 0.4155, 0.5953, 0.4352]}, {"w": "allows", "b": [0.6016, 0.4155, 0.6675, 0.4352]}, {"w": "us", "b": [0.6738, 0.4155, 0.6962, 0.4352]}, {"w": "to", "b": [0.7025, 0.4155, 0.7221, 0.4352]}, {"w": "go", "b": [0.7284, 0.4155, 0.7537, 0.4352]}, {"w": "from", "b": [0.76, 0.4155, 0.809, 0.4352]}, {"w": "cat", "b": [0.8153, 0.4155, 0.8461, 0.4352]}, {"w": "to", "b": [0.1294, 0.436, 0.149, 0.4557]}, {"w": "tiger", "b": [0.1553, 0.436, 0.203, 0.4557]}, {"w": "and", "b": [0.2093, 0.436, 0.2457, 0.4557]}, {"w": "from", "b": [0.252, 0.436, 0.301, 0.4557]}, {"w": "dog", "b": [0.3073, 0.436, 0.3452, 0.4557]}, {"w": "to", "b": [0.3515, 0.436, 0.3711, 0.4557]}, {"w": "wolf:", "b": [0.3774, 0.436, 0.4279, 0.4557]}, {"w": "this", "b": [0.4342, 0.436, 0.4706, 0.4557]}, {"w": "vector", "b": [0.4769, 0.436, 0.54, 0.4557]}, {"w": "could", "b": [0.5463, 0.436, 0.6023, 0.4557]}, {"w": "be", "b": [0.6086, 0.436, 0.6324, 0.4557]}, {"w": "interpreted", "b": [0.6387, 0.436, 0.748, 0.4557]}, {"w": "as", "b": [0.7543, 0.436, 0.7753, 0.4557]}, {"w": "the", "b": [0.7817, 0.436, 0.8125, 0.4557]}, {"w": "“from", "b": [0.1294, 0.4565, 0.1897, 0.4762]}, {"w": "pet", "b": [0.196, 0.4565, 0.2268, 0.4762]}, {"w": "to", "b": [0.2331, 0.4565, 0.2527, 0.4762]}, {"w": "wild", "b": [0.259, 0.4565, 0.3039, 0.4762]}, {"w": "animal”", "b": [0.3102, 0.4565, 0.39, 0.4762]}, {"w": "vector.", "b": [0.3964, 0.4565, 0.4642, 0.4762]}, {"w": "Similarly,", "b": [0.4706, 0.4565, 0.5691, 0.4762]}, {"w": "another", "b": [0.5754, 0.4565, 0.6511, 0.4762]}, {"w": "vector", "b": [0.6574, 0.4565, 0.7204, 0.4762]}, {"w": "lets", "b": [0.7267, 0.4565, 0.7618, 0.4762]}, {"w": "us", "b": [0.7681, 0.4565, 0.7905, 0.4762]}, {"w": "go", "b": [0.7968, 0.4565, 0.822, 0.4762]}, {"w": "from", "b": [0.1294, 0.477, 0.1785, 0.4967]}, {"w": "dog", "b": [0.1848, 0.477, 0.2226, 0.4967]}, {"w": "to", "b": [0.2289, 0.477, 0.2485, 0.4967]}, {"w": "cat", "b": [0.2548, 0.477, 0.2856, 0.4967]}, {"w": "and", "b": [0.2919, 0.477, 0.3283, 0.4967]}, {"w": "from", "b": [0.3347, 0.477, 0.3837, 0.4967]}, {"w": "wolf", "b": [0.39, 0.477, 0.4335, 0.4967]}, {"w": "to", "b": [0.4397, 0.477, 0.4594, 0.4967]}, {"w": "tiger,", "b": [0.4657, 0.477, 0.5196, 0.4967]}, {"w": "which", "b": [0.5259, 0.477, 0.5876, 0.4967]}, {"w": "could", "b": [0.5939, 0.477, 0.6499, 0.4967]}, {"w": "be", "b": [0.6562, 0.477, 0.68, 0.4967]}, {"w": "interpreted", "b": [0.6863, 0.477, 0.7956, 0.4967]}, {"w": "as", "b": [0.8019, 0.477, 0.8229, 0.4967]}, {"w": "a", "b": [0.8292, 0.477, 0.8404, 0.4967]}, {"w": "“from", "b": [0.1294, 0.4975, 0.1897, 0.5172]}, {"w": "canine", "b": [0.196, 0.4975, 0.2618, 0.5172]}, {"w": "to", "b": [0.2681, 0.4975, 0.2877, 0.5172]}, {"w": "feline”", "b": [0.294, 0.4975, 0.3627, 0.5172]}, {"w": "vector.", "b": [0.369, 0.4975, 0.4369, 0.5172]}]}, {"id": "b_2", "type": "equation", "text": "Figure 6.3. A toy example of a word-embedding space", "words": [{"w": "Figure", "b": [0.1294, 0.5353, 0.1827, 0.5501]}, {"w": "6.3.", "b": [0.1874, 0.5353, 0.2158, 0.5501]}, {"w": "A", "b": [0.2205, 0.5353, 0.2341, 0.5501]}, {"w": "toy", "b": [0.2389, 0.5353, 0.2641, 0.5501]}, {"w": "example", "b": [0.2688, 0.5353, 0.3361, 0.5501]}, {"w": "of", "b": [0.3408, 0.5353, 0.3566, 0.5501]}, {"w": "a", "b": [0.3613, 0.5353, 0.3708, 0.5501]}, {"w": "word-embedding", "b": [0.3755, 0.5353, 0.5132, 0.5501]}, {"w": "space", "b": [0.5179, 0.5353, 0.5621, 0.5501]}]}, {"id": "b_3", "type": "paragraph", "text": "In real-world word-embedding spaces, common examples of meaningful geometric transformations are “gender” vectors and “plural” vectors. For instance, by adding a “female” vector to the vector “king,” we obtain the vector “queen.” By adding a “plural” vector, we obtain “kings.” Word- embedding spaces typically feature thousands of such interpretable and potentially useful vectors.", "words": [{"w": "In", "b": [0.1294, 0.7283, 0.1504, 0.7481]}, {"w": "real-world", "b": [0.1567, 0.7283, 0.2618, 0.7481]}, {"w": "word-embedding", "b": [0.2681, 0.7283, 0.4404, 0.7481]}, {"w": "spaces,", "b": [0.4468, 0.7283, 0.5189, 0.7481]}, {"w": "common", "b": [0.5252, 0.7283, 0.6135, 0.7481]}, {"w": "examples", "b": [0.6198, 0.7283, 0.7151, 0.7481]}, {"w": "of", "b": [0.7214, 0.7283, 0.7424, 0.7481]}, {"w": "meaningful", "b": [0.7487, 0.7283, 0.8636, 0.7481]}, {"w": "geometric", "b": [0.1294, 0.7488, 0.2303, 0.7686]}, {"w": "transformations", "b": [0.2366, 0.7488, 0.3949, 0.7686]}, {"w": "are", "b": [0.4012, 0.7488, 0.432, 0.7686]}, {"w": "“gender”", "b": [0.4384, 0.7488, 0.5294, 0.7686]}, {"w": "vectors", "b": [0.5357, 0.7488, 0.6086, 0.7686]}, {"w": "and", "b": [0.6149, 0.7488, 0.6513, 0.7686]}, {"w": "“plural”", "b": [0.6576, 0.7488, 0.7388, 0.7686]}, {"w": "vectors.", "b": [0.745, 0.7488, 0.8242, 0.7686]}, {"w": "For", "b": [0.8305, 0.7488, 0.8655, 0.7686]}, {"w": "instance,", "b": [0.1294, 0.7693, 0.2184, 0.7891]}, {"w": "by", "b": [0.2247, 0.7693, 0.2499, 0.7891]}, {"w": "adding", "b": [0.2562, 0.7693, 0.3249, 0.7891]}, {"w": "a", "b": [0.3312, 0.7693, 0.3424, 0.7891]}, {"w": "“female”", "b": [0.3487, 0.7693, 0.4397, 0.7891]}, {"w": "vector", "b": [0.446, 0.7693, 0.5091, 0.7891]}, {"w": "to", "b": [0.5154, 0.7693, 0.535, 0.7891]}, {"w": "the", "b": [0.5413, 0.7693, 0.5721, 0.7891]}, {"w": "vector", "b": [0.5785, 0.7693, 0.6415, 0.7891]}, {"w": "“king,”", "b": [0.6478, 0.7693, 0.7214, 0.7891]}, {"w": "we", "b": [0.7277, 0.7693, 0.7571, 0.7891]}, {"w": "obtain", "b": [0.7634, 0.7693, 0.8265, 0.7891]}, {"w": "the", "b": [0.8328, 0.7693, 0.8636, 0.7891]}, {"w": "vector", "b": [0.1294, 0.7898, 0.1925, 0.8096]}, {"w": "“queen.”", "b": [0.1988, 0.7898, 0.2877, 0.8096]}, {"w": "By", "b": [0.294, 0.7898, 0.3234, 0.8096]}, {"w": "adding", "b": [0.3298, 0.7898, 0.3984, 0.8096]}, {"w": "a", "b": [0.4047, 0.7898, 0.4159, 0.8096]}, {"w": "“plural”", "b": [0.4222, 0.7898, 0.5035, 0.8096]}, {"w": "vector,", "b": [0.5097, 0.7898, 0.5781, 0.8096]}, {"w": "we", "b": [0.5844, 0.7898, 0.6138, 0.8096]}, {"w": "obtain", "b": [0.6201, 0.7898, 0.6831, 0.8096]}, {"w": "“kings.”", "b": [0.6895, 0.7898, 0.7728, 0.8096]}, {"w": "Word-", "b": [0.7791, 0.7898, 0.8429, 0.8096]}, {"w": "embedding", "b": [0.1294, 0.8103, 0.2415, 0.8301]}, {"w": "spaces", "b": [0.2478, 0.8103, 0.3137, 0.8301]}, {"w": "typically", "b": [0.32, 0.8103, 0.4083, 0.8301]}, {"w": "feature", "b": [0.4146, 0.8103, 0.4846, 0.8301]}, {"w": "thousands", "b": [0.4909, 0.8103, 0.5918, 0.8301]}, {"w": "of", "b": [0.5981, 0.8103, 0.6191, 0.8301]}, {"w": "such", "b": [0.6254, 0.8103, 0.6717, 0.8301]}, {"w": "interpretable", "b": [0.678, 0.8103, 0.8055, 0.8301]}, {"w": "and", "b": [0.8118, 0.8103, 0.8482, 0.8301]}, {"w": "potentially", "b": [0.1294, 0.8308, 0.2373, 0.8506]}, {"w": "useful", "b": [0.2436, 0.8308, 0.3053, 0.8506]}, {"w": "vectors.", "b": [0.3115, 0.8308, 0.3907, 0.8506]}]}, {"id": "b_4", "type": "paragraph", "text": "Is there some ideal word-embedding space that would perfectly map human language and could be used for any natural-language-processing", "words": [{"w": "Is", "b": [0.1294, 0.8736, 0.1476, 0.8933]}, {"w": "there", "b": [0.1539, 0.8736, 0.2044, 0.8933]}, {"w": "some", "b": [0.2107, 0.8736, 0.2639, 0.8933]}, {"w": "ideal", "b": [0.2702, 0.8736, 0.3193, 0.8933]}, {"w": "word-embedding", "b": [0.3256, 0.8736, 0.4979, 0.8933]}, {"w": "space", "b": [0.5042, 0.8736, 0.5602, 0.8933]}, {"w": "that", "b": [0.5665, 0.8736, 0.6044, 0.8933]}, {"w": "would", "b": [0.6107, 0.8736, 0.6738, 0.8933]}, {"w": "perfectly", "b": [0.6801, 0.8736, 0.7697, 0.8933]}, {"w": "map", "b": [0.776, 0.8736, 0.8195, 0.8933]}, {"w": "human", "b": [0.1294, 0.8941, 0.1981, 0.9138]}, {"w": "language", "b": [0.2044, 0.8941, 0.2954, 0.9138]}, {"w": "and", "b": [0.3018, 0.8941, 0.3382, 0.9138]}, {"w": "could", "b": [0.3445, 0.8941, 0.4005, 0.9138]}, {"w": "be", "b": [0.4068, 0.8941, 0.4307, 0.9138]}, {"w": "used", "b": [0.437, 0.8941, 0.4832, 0.9138]}, {"w": "for", "b": [0.4895, 0.8941, 0.5189, 0.9138]}, {"w": "any", "b": [0.5252, 0.8941, 0.5617, 0.9138]}, {"w": "natural-language-processing", "b": [0.568, 0.8941, 0.8538, 0.9138]}]}]}, {"page": 247, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "task? Possibly, but we have yet to compute anything of the sort. Also, there is no such a thing as human language—there are many different languages, and they aren’t isomorphic, because a language is the reflection of a specific culture and a specific context. But more pragmatically, what makes a good word-embedding space depends heavily on your task: the perfect word-embedding space for an English- language movie-review sentiment-analysis model may look different from the perfect embedding space for an English-language legal-- document-classification model, because the importance of certain semantic relationships varies from task to task.", "words": [{"w": "task?", "b": [0.1294, 0.0857, 0.1813, 0.1054]}, {"w": "Possibly,", "b": [0.1876, 0.0857, 0.2777, 0.1054]}, {"w": "but", "b": [0.284, 0.0857, 0.3163, 0.1054]}, {"w": "we", "b": [0.3226, 0.0857, 0.352, 0.1054]}, {"w": "have", "b": [0.3583, 0.0857, 0.4059, 0.1054]}, {"w": "yet", "b": [0.4122, 0.0857, 0.4431, 0.1054]}, {"w": "to", "b": [0.4494, 0.0857, 0.469, 0.1054]}, {"w": "compute", "b": [0.4753, 0.0857, 0.5622, 0.1054]}, {"w": "anything", "b": [0.5685, 0.0857, 0.6568, 0.1054]}, {"w": "of", "b": [0.6631, 0.0857, 0.6841, 0.1054]}, {"w": "the", "b": [0.6904, 0.0857, 0.7212, 0.1054]}, {"w": "sort.", "b": [0.7275, 0.0857, 0.7717, 0.1054]}, {"w": "Also,", "b": [0.778, 0.0857, 0.8319, 0.1054]}, {"w": "there", "b": [0.1294, 0.1062, 0.1798, 0.1259]}, {"w": "is", "b": [0.1861, 0.1062, 0.203, 0.1259]}, {"w": "no", "b": [0.2093, 0.1062, 0.2345, 0.1259]}, {"w": "such", "b": [0.2408, 0.1062, 0.287, 0.1259]}, {"w": "a", "b": [0.2934, 0.1062, 0.3046, 0.1259]}, {"w": "thing", "b": [0.3109, 0.1062, 0.3627, 0.1259]}, {"w": "as", "b": [0.369, 0.1062, 0.39, 0.1259]}, {"w": "human", "b": [0.3963, 0.1062, 0.465, 0.1259]}, {"w": "language—there", "b": [0.4713, 0.1062, 0.6408, 0.1259]}, {"w": "are", "b": [0.6471, 0.1062, 0.6779, 0.1259]}, {"w": "many", "b": [0.6842, 0.1062, 0.7403, 0.1259]}, {"w": "different", "b": [0.7466, 0.1062, 0.833, 0.1259]}, {"w": "languages,", "b": [0.1294, 0.1267, 0.2366, 0.1464]}, {"w": "and", "b": [0.2429, 0.1267, 0.2793, 0.1464]}, {"w": "they", "b": [0.2856, 0.1267, 0.3291, 0.1464]}, {"w": "aren’t", "b": [0.3354, 0.1267, 0.3937, 0.1464]}, {"w": "isomorphic,", "b": [0.4, 0.1267, 0.5198, 0.1464]}, {"w": "because", "b": [0.5262, 0.1267, 0.606, 0.1464]}, {"w": "a", "b": [0.6123, 0.1267, 0.6235, 0.1464]}, {"w": "language", "b": [0.6298, 0.1267, 0.7209, 0.1464]}, {"w": "is", "b": [0.7272, 0.1267, 0.744, 0.1464]}, {"w": "the", "b": [0.7503, 0.1267, 0.7811, 0.1464]}, {"w": "reflection", "b": [0.1294, 0.1472, 0.2261, 0.1669]}, {"w": "of", "b": [0.2324, 0.1472, 0.2534, 0.1669]}, {"w": "a", "b": [0.2597, 0.1472, 0.2709, 0.1669]}, {"w": "specific", "b": [0.2772, 0.1472, 0.3557, 0.1669]}, {"w": "culture", "b": [0.362, 0.1472, 0.432, 0.1669]}, {"w": "and", "b": [0.4383, 0.1472, 0.4747, 0.1669]}, {"w": "a", "b": [0.481, 0.1472, 0.4922, 0.1669]}, {"w": "specific", "b": [0.4985, 0.1472, 0.5769, 0.1669]}, {"w": "context.", "b": [0.5832, 0.1472, 0.6638, 0.1669]}, {"w": "But", "b": [0.6701, 0.1472, 0.7066, 0.1669]}, {"w": "more", "b": [0.7129, 0.1472, 0.7647, 0.1669]}, {"w": "pragmatically,", "b": [0.1294, 0.1677, 0.2728, 0.1874]}, {"w": "what", "b": [0.2791, 0.1677, 0.3281, 0.1874]}, {"w": "makes", "b": [0.3344, 0.1677, 0.3989, 0.1874]}, {"w": "a", "b": [0.4052, 0.1677, 0.4164, 0.1874]}, {"w": "good", "b": [0.4227, 0.1677, 0.4731, 0.1874]}, {"w": "word-embedding", "b": [0.4794, 0.1677, 0.6518, 0.1874]}, {"w": "space", "b": [0.6581, 0.1677, 0.7141, 0.1874]}, {"w": "depends", "b": [0.7204, 0.1677, 0.8031, 0.1874]}, {"w": "heavily", "b": [0.1294, 0.1882, 0.2037, 0.2079]}, {"w": "on", "b": [0.21, 0.1882, 0.2352, 0.2079]}, {"w": "your", "b": [0.2415, 0.1882, 0.2878, 0.2079]}, {"w": "task:", "b": [0.2941, 0.1882, 0.3417, 0.2079]}, {"w": "the", "b": [0.348, 0.1882, 0.3788, 0.2079]}, {"w": "perfect", "b": [0.3852, 0.1882, 0.4552, 0.2079]}, {"w": "word-embedding", "b": [0.4614, 0.1882, 0.6338, 0.2079]}, {"w": "space", "b": [0.6401, 0.1882, 0.6961, 0.2079]}, {"w": "for", "b": [0.7024, 0.1882, 0.7318, 0.2079]}, {"w": "an", "b": [0.7381, 0.1882, 0.7619, 0.2079]}, {"w": "English-", "b": [0.7682, 0.1882, 0.8537, 0.2079]}, {"w": "language", "b": [0.1294, 0.2087, 0.2205, 0.2284]}, {"w": "movie-review", "b": [0.2268, 0.2087, 0.3669, 0.2284]}, {"w": "sentiment-analysis", "b": [0.3732, 0.2087, 0.561, 0.2284]}, {"w": "model", "b": [0.5673, 0.2087, 0.6303, 0.2284]}, {"w": "may", "b": [0.6367, 0.2087, 0.6801, 0.2284]}, {"w": "look", "b": [0.6864, 0.2087, 0.7312, 0.2284]}, {"w": "different", "b": [0.7376, 0.2087, 0.8239, 0.2284]}, {"w": "from", "b": [0.1294, 0.2292, 0.1785, 0.2489]}, {"w": "the", "b": [0.1848, 0.2292, 0.2156, 0.2489]}, {"w": "perfect", "b": [0.2219, 0.2292, 0.2919, 0.2489]}, {"w": "embedding", "b": [0.2982, 0.2292, 0.4103, 0.2489]}, {"w": "space", "b": [0.4166, 0.2292, 0.4726, 0.2489]}, {"w": "for", "b": [0.4789, 0.2292, 0.5083, 0.2489]}, {"w": "an", "b": [0.5146, 0.2292, 0.5384, 0.2489]}, {"w": "English-language", "b": [0.5447, 0.2292, 0.7213, 0.2489]}, {"w": "legal--", "b": [0.7276, 0.2292, 0.7934, 0.2489]}, {"w": "document-classification", "b": [0.1294, 0.2497, 0.3704, 0.2694]}, {"w": "model,", "b": [0.3767, 0.2497, 0.4461, 0.2694]}, {"w": "because", "b": [0.4524, 0.2497, 0.5322, 0.2694]}, {"w": "the", "b": [0.5385, 0.2497, 0.5694, 0.2694]}, {"w": "importance", "b": [0.5757, 0.2497, 0.6892, 0.2694]}, {"w": "of", "b": [0.6955, 0.2497, 0.7165, 0.2694]}, {"w": "certain", "b": [0.7228, 0.2497, 0.7914, 0.2694]}, {"w": "semantic", "b": [0.1294, 0.2702, 0.2191, 0.2899]}, {"w": "relationships", "b": [0.2254, 0.2702, 0.3543, 0.2899]}, {"w": "varies", "b": [0.3606, 0.2702, 0.4208, 0.2899]}, {"w": "from", "b": [0.4271, 0.2702, 0.4762, 0.2899]}, {"w": "task", "b": [0.4825, 0.2702, 0.5231, 0.2899]}, {"w": "to", "b": [0.5294, 0.2702, 0.549, 0.2899]}, {"w": "task.", "b": [0.5554, 0.2702, 0.6023, 0.2899]}]}, {"id": "b_1", "type": "paragraph", "text": "It’s thus reasonable to learn a new embedding space with every new task. Fortunately, backpropagation makes this easy, and Keras makes it even easier. It’s about learning the weights of a layer: the Embedding layer.", "words": [{"w": "It’s", "b": [0.1294, 0.313, 0.1616, 0.3327]}, {"w": "thus", "b": [0.1679, 0.313, 0.21, 0.3327]}, {"w": "reasonable", "b": [0.2163, 0.313, 0.3242, 0.3327]}, {"w": "to", "b": [0.3305, 0.313, 0.3501, 0.3327]}, {"w": "learn", "b": [0.3564, 0.313, 0.4096, 0.3327]}, {"w": "a", "b": [0.4159, 0.313, 0.4271, 0.3327]}, {"w": "new", "b": [0.4334, 0.313, 0.4755, 0.3327]}, {"w": "embedding", "b": [0.4818, 0.313, 0.5939, 0.3327]}, {"w": "space", "b": [0.6002, 0.313, 0.6562, 0.3327]}, {"w": "with", "b": [0.6625, 0.313, 0.7074, 0.3327]}, {"w": "every", "b": [0.7137, 0.313, 0.7697, 0.3327]}, {"w": "new", "b": [0.776, 0.313, 0.818, 0.3327]}, {"w": "task.", "b": [0.1294, 0.3335, 0.1764, 0.3532]}, {"w": "Fortunately,", "b": [0.1827, 0.3335, 0.3036, 0.3532]}, {"w": "backpropagation", "b": [0.3099, 0.3335, 0.4781, 0.3532]}, {"w": "makes", "b": [0.4844, 0.3335, 0.5488, 0.3532]}, {"w": "this", "b": [0.5551, 0.3335, 0.5916, 0.3532]}, {"w": "easy,", "b": [0.5979, 0.3335, 0.6473, 0.3532]}, {"w": "and", "b": [0.6536, 0.3335, 0.6901, 0.3532]}, {"w": "Keras", "b": [0.6964, 0.3335, 0.7552, 0.3532]}, {"w": "makes", "b": [0.7615, 0.3335, 0.826, 0.3532]}, {"w": "it", "b": [0.8323, 0.3335, 0.8463, 0.3532]}, {"w": "even", "b": [0.1294, 0.354, 0.177, 0.3737]}, {"w": "easier.", "b": [0.1833, 0.354, 0.2471, 0.3737]}, {"w": "It’s", "b": [0.2534, 0.354, 0.2856, 0.3737]}, {"w": "about", "b": [0.2919, 0.354, 0.348, 0.3737]}, {"w": "learning", "b": [0.3543, 0.354, 0.4369, 0.3737]}, {"w": "the", "b": [0.4432, 0.354, 0.4741, 0.3737]}, {"w": "weights", "b": [0.4804, 0.354, 0.5588, 0.3737]}, {"w": "of", "b": [0.5652, 0.354, 0.5862, 0.3737]}, {"w": "a", "b": [0.5925, 0.354, 0.6037, 0.3737]}, {"w": "layer:", "b": [0.61, 0.354, 0.6674, 0.3737]}, {"w": "the", "b": [0.6737, 0.354, 0.7046, 0.3737]}, {"w": "Embedding", "b": [0.7108, 0.355, 0.847, 0.3752]}, {"w": "layer.", "b": [0.1294, 0.3754, 0.1847, 0.3951]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.5. Instantiating an Embedding layer", "words": [{"w": "Listing", "b": [0.1294, 0.4132, 0.1862, 0.428]}, {"w": "6.5.", "b": [0.1909, 0.4132, 0.2193, 0.428]}, {"w": "Instantiating", "b": [0.224, 0.4132, 0.3281, 0.428]}, {"w": "an", "b": [0.3328, 0.4132, 0.3528, 0.428]}, {"w": "Embedding", "b": [0.3575, 0.414, 0.4597, 0.4291]}, {"w": "layer", "b": [0.4644, 0.4132, 0.5054, 0.428]}]}, {"id": "b_3", "type": "equation", "text": "from keras.layers import Embedding embedding_layer = Embedding(1000, 64) 1", "words": [{"w": "from", "b": [0.1357, 0.4425, 0.1811, 0.4576]}, {"w": "keras.layers", "b": [0.1925, 0.4425, 0.3287, 0.4576]}, {"w": "import", "b": [0.34, 0.4425, 0.4082, 0.4576]}, {"w": "Embedding", "b": [0.4195, 0.4425, 0.5217, 0.4576]}, {"w": "embedding_layer", "b": [0.1357, 0.4728, 0.306, 0.488]}, {"w": "=", "b": [0.3173, 0.4728, 0.3287, 0.488]}, {"w": "Embedding(1000,", "b": [0.34, 0.4728, 0.5103, 0.488]}, {"w": "64)", "b": [0.5217, 0.4728, 0.5557, 0.488]}, {"w": "1", "b": [0.6807, 0.4728, 0.692, 0.488]}]}, {"id": "b_4", "type": "paragraph", "text": "1 The Embedding layer takes at least two arguments: the number of possible tokens (here, 1,000: 1 + maximum word index) and the dimensionality of the embeddings (here, 64).", "words": [{"w": "1", "b": [0.1799, 0.5064, 0.1925, 0.5261]}, {"w": "The", "b": [0.1988, 0.5064, 0.2408, 0.5261]}, {"w": "Embedding", "b": [0.2471, 0.5064, 0.3719, 0.5261]}, {"w": "layer", "b": [0.3782, 0.5064, 0.4329, 0.5261]}, {"w": "takes", "b": [0.4392, 0.5064, 0.4952, 0.5261]}, {"w": "at", "b": [0.5015, 0.5064, 0.5225, 0.5261]}, {"w": "least", "b": [0.5288, 0.5064, 0.5779, 0.5261]}, {"w": "two", "b": [0.5842, 0.5064, 0.6234, 0.5261]}, {"w": "arguments:", "b": [0.6297, 0.5064, 0.753, 0.5261]}, {"w": "the", "b": [0.7593, 0.5064, 0.793, 0.5261]}, {"w": "number", "b": [0.1799, 0.5269, 0.2654, 0.5466]}, {"w": "of", "b": [0.2717, 0.5269, 0.2927, 0.5466]}, {"w": "possible", "b": [0.299, 0.5269, 0.3845, 0.5466]}, {"w": "tokens", "b": [0.3908, 0.5269, 0.4609, 0.5466]}, {"w": "(here,", "b": [0.4672, 0.5269, 0.5291, 0.5466]}, {"w": "1,000:", "b": [0.5354, 0.5269, 0.6005, 0.5466]}, {"w": "1", "b": [0.6068, 0.5269, 0.6195, 0.5466]}, {"w": "+", "b": [0.6258, 0.5269, 0.6401, 0.5466]}, {"w": "maximum", "b": [0.6464, 0.5269, 0.7558, 0.5466]}, {"w": "word", "b": [0.7621, 0.5269, 0.8181, 0.5466]}, {"w": "index)", "b": [0.1799, 0.5474, 0.2471, 0.5671]}, {"w": "and", "b": [0.2534, 0.5474, 0.2941, 0.5671]}, {"w": "the", "b": [0.3004, 0.5474, 0.334, 0.5671]}, {"w": "dimensionality", "b": [0.3403, 0.5474, 0.4987, 0.5671]}, {"w": "of", "b": [0.505, 0.5474, 0.5261, 0.5671]}, {"w": "the", "b": [0.5324, 0.5474, 0.566, 0.5671]}, {"w": "embeddings", "b": [0.5723, 0.5474, 0.7013, 0.5671]}, {"w": "(here,", "b": [0.7076, 0.5474, 0.7694, 0.5671]}, {"w": "64).", "b": [0.7757, 0.5474, 0.8157, 0.5671]}]}, {"id": "b_5", "type": "paragraph", "text": "The Embedding layer is best understood as a dictionary that maps integer indices (which stand for specific words) to dense vectors. It takes integers as input, it looks up these integers in an internal dictionary, and it returns the associated vectors. It’s effectively a dictionary lookup (see figure 6.4).", "words": [{"w": "The", "b": [0.1294, 0.5902, 0.1686, 0.6099]}, {"w": "Embedding", "b": [0.1749, 0.5912, 0.3112, 0.6114]}, {"w": "layer", "b": [0.3175, 0.5902, 0.3679, 0.6099]}, {"w": "is", "b": [0.3742, 0.5902, 0.391, 0.6099]}, {"w": "best", "b": [0.3973, 0.5902, 0.438, 0.6099]}, {"w": "understood", "b": [0.4443, 0.5902, 0.5564, 0.6099]}, {"w": "as", "b": [0.5627, 0.5902, 0.5837, 0.6099]}, {"w": "a", "b": [0.59, 0.5902, 0.6012, 0.6099]}, {"w": "dictionary", "b": [0.6075, 0.5902, 0.7098, 0.6099]}, {"w": "that", "b": [0.7161, 0.5902, 0.754, 0.6099]}, {"w": "maps", "b": [0.7603, 0.5902, 0.8135, 0.6099]}, {"w": "integer", "b": [0.1294, 0.6116, 0.1995, 0.6313]}, {"w": "indices", "b": [0.2058, 0.6116, 0.2772, 0.6313]}, {"w": "(which", "b": [0.2835, 0.6116, 0.3536, 0.6313]}, {"w": "stand", "b": [0.3599, 0.6116, 0.4132, 0.6313]}, {"w": "for", "b": [0.4195, 0.6116, 0.4489, 0.6313]}, {"w": "specific", "b": [0.4552, 0.6116, 0.5336, 0.6313]}, {"w": "words)", "b": [0.5399, 0.6116, 0.61, 0.6313]}, {"w": "to", "b": [0.6163, 0.6116, 0.6359, 0.6313]}, {"w": "dense", "b": [0.6422, 0.6116, 0.6997, 0.6313]}, {"w": "vectors.", "b": [0.706, 0.6116, 0.7851, 0.6313]}, {"w": "It", "b": [0.7914, 0.6116, 0.8068, 0.6313]}, {"w": "takes", "b": [0.8131, 0.6116, 0.8649, 0.6313]}, {"w": "integers", "b": [0.1294, 0.6321, 0.2093, 0.6518]}, {"w": "as", "b": [0.2156, 0.6321, 0.2366, 0.6518]}, {"w": "input,", "b": [0.2429, 0.6321, 0.3011, 0.6518]}, {"w": "it", "b": [0.3074, 0.6321, 0.3214, 0.6518]}, {"w": "looks", "b": [0.3277, 0.6321, 0.3824, 0.6518]}, {"w": "up", "b": [0.3887, 0.6321, 0.4139, 0.6518]}, {"w": "these", "b": [0.4202, 0.6321, 0.4721, 0.6518]}, {"w": "integers", "b": [0.4784, 0.6321, 0.5582, 0.6518]}, {"w": "in", "b": [0.5645, 0.6321, 0.5842, 0.6518]}, {"w": "an", "b": [0.5905, 0.6321, 0.6143, 0.6518]}, {"w": "internal", "b": [0.6206, 0.6321, 0.6976, 0.6518]}, {"w": "dictionary,", "b": [0.704, 0.6321, 0.8108, 0.6518]}, {"w": "and", "b": [0.8171, 0.6321, 0.8535, 0.6518]}, {"w": "it", "b": [0.1294, 0.6526, 0.1434, 0.6723]}, {"w": "returns", "b": [0.1497, 0.6526, 0.2198, 0.6723]}, {"w": "the", "b": [0.2261, 0.6526, 0.2569, 0.6723]}, {"w": "associated", "b": [0.2632, 0.6526, 0.3669, 0.6723]}, {"w": "vectors.", "b": [0.3732, 0.6526, 0.4524, 0.6723]}, {"w": "It’s", "b": [0.4587, 0.6526, 0.4909, 0.6723]}, {"w": "effectively", "b": [0.4972, 0.6526, 0.6046, 0.6723]}, {"w": "a", "b": [0.6109, 0.6526, 0.6221, 0.6723]}, {"w": "dictionary", "b": [0.6284, 0.6526, 0.7307, 0.6723]}, {"w": "lookup", "b": [0.737, 0.6526, 0.8071, 0.6723]}, {"w": "(see", "b": [0.8134, 0.6526, 0.854, 0.6723]}, {"w": "figure", "b": [0.1294, 0.6731, 0.1897, 0.6928]}, {"w": "6.4).", "b": [0.196, 0.6731, 0.2422, 0.6928]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 6.4. The embedding layer", "words": [{"w": "Figure", "b": [0.1294, 0.7109, 0.1827, 0.7257]}, {"w": "6.4.", "b": [0.1874, 0.7109, 0.2158, 0.7257]}, {"w": "The", "b": [0.2205, 0.7109, 0.252, 0.7257]}, {"w": "embedding", "b": [0.2567, 0.7117, 0.3589, 0.7268]}, {"w": "layer", "b": [0.3636, 0.7109, 0.4046, 0.7257]}]}, {"id": "b_7", "type": "paragraph", "text": "The Embedding layer takes as input a 2D tensor of integers, of shape (samples, sequence_length), where each entry is a sequence of integers. It can embed sequences of variable lengths: for instance, you could feed into the Embedding layer in the previous example batches with shapes (32, 10) (batch of 32 sequences of length 10) or (64, 15) (batch of 64 sequences of length 15). All sequences in a batch must", "words": [{"w": "The", "b": [0.1294, 0.7782, 0.1686, 0.798]}, {"w": "Embedding", "b": [0.1749, 0.7793, 0.3112, 0.7995]}, {"w": "layer", "b": [0.3175, 0.7782, 0.3679, 0.798]}, {"w": "takes", "b": [0.3742, 0.7782, 0.4261, 0.798]}, {"w": "as", "b": [0.4324, 0.7782, 0.4534, 0.798]}, {"w": "input", "b": [0.4597, 0.7782, 0.5115, 0.798]}, {"w": "a", "b": [0.5179, 0.7782, 0.5291, 0.798]}, {"w": "2D", "b": [0.5354, 0.7782, 0.5662, 0.798]}, {"w": "tensor", "b": [0.5725, 0.7782, 0.6341, 0.798]}, {"w": "of", "b": [0.6404, 0.7782, 0.6615, 0.798]}, {"w": "integers,", "b": [0.6678, 0.7782, 0.7539, 0.798]}, {"w": "of", "b": [0.7602, 0.7782, 0.7813, 0.798]}, {"w": "shape", "b": [0.7876, 0.7782, 0.845, 0.798]}, {"w": "(samples,", "b": [0.1294, 0.8007, 0.2656, 0.8209]}, {"w": "sequence_length),", "b": [0.2808, 0.7996, 0.5293, 0.8209]}, {"w": "where", "b": [0.5356, 0.7996, 0.5972, 0.8194]}, {"w": "each", "b": [0.6035, 0.7996, 0.6498, 0.8194]}, {"w": "entry", "b": [0.6561, 0.7996, 0.7079, 0.8194]}, {"w": "is", "b": [0.7142, 0.7996, 0.731, 0.8194]}, {"w": "a", "b": [0.7373, 0.7996, 0.7485, 0.8194]}, {"w": "sequence", "b": [0.7548, 0.7996, 0.8473, 0.8194]}, {"w": "of", "b": [0.1294, 0.821, 0.1504, 0.8408]}, {"w": "integers.", "b": [0.1567, 0.821, 0.2429, 0.8408]}, {"w": "It", "b": [0.2492, 0.821, 0.2646, 0.8408]}, {"w": "can", "b": [0.2709, 0.821, 0.3059, 0.8408]}, {"w": "embed", "b": [0.3122, 0.821, 0.3795, 0.8408]}, {"w": "sequences", "b": [0.3858, 0.821, 0.4881, 0.8408]}, {"w": "of", "b": [0.4944, 0.821, 0.5154, 0.8408]}, {"w": "variable", "b": [0.5217, 0.821, 0.603, 0.8408]}, {"w": "lengths:", "b": [0.6093, 0.821, 0.6891, 0.8408]}, {"w": "for", "b": [0.6955, 0.821, 0.7249, 0.8408]}, {"w": "instance,", "b": [0.7312, 0.821, 0.8201, 0.8408]}, {"w": "you", "b": [0.8265, 0.821, 0.8643, 0.8408]}, {"w": "could", "b": [0.1294, 0.8415, 0.1855, 0.8613]}, {"w": "feed", "b": [0.1918, 0.8415, 0.2352, 0.8613]}, {"w": "into", "b": [0.2415, 0.8415, 0.2807, 0.8613]}, {"w": "the", "b": [0.287, 0.8415, 0.3178, 0.8613]}, {"w": "Embedding", "b": [0.3241, 0.8426, 0.4603, 0.8627]}, {"w": "layer", "b": [0.4667, 0.8415, 0.5171, 0.8613]}, {"w": "in", "b": [0.5234, 0.8415, 0.543, 0.8613]}, {"w": "the", "b": [0.5493, 0.8415, 0.5802, 0.8613]}, {"w": "previous", "b": [0.5865, 0.8415, 0.6733, 0.8613]}, {"w": "example", "b": [0.6796, 0.8415, 0.7651, 0.8613]}, {"w": "batches", "b": [0.7714, 0.8415, 0.8471, 0.8613]}, {"w": "with", "b": [0.1294, 0.8629, 0.1743, 0.8826]}, {"w": "shapes", "b": [0.1806, 0.8629, 0.2478, 0.8826]}, {"w": "(32,", "b": [0.2541, 0.8639, 0.3147, 0.8841]}, {"w": "10)", "b": [0.3298, 0.8639, 0.3752, 0.8841]}, {"w": "(batch", "b": [0.3815, 0.8629, 0.4446, 0.8826]}, {"w": "of", "b": [0.4509, 0.8629, 0.4719, 0.8826]}, {"w": "32", "b": [0.4782, 0.8629, 0.5034, 0.8826]}, {"w": "sequences", "b": [0.5097, 0.8629, 0.612, 0.8826]}, {"w": "of", "b": [0.6183, 0.8629, 0.6393, 0.8826]}, {"w": "length", "b": [0.6456, 0.8629, 0.7087, 0.8826]}, {"w": "10)", "b": [0.715, 0.8629, 0.7486, 0.8826]}, {"w": "or", "b": [0.7549, 0.8629, 0.7759, 0.8826]}, {"w": "(64,", "b": [0.7822, 0.8639, 0.8427, 0.8841]}, {"w": "15)", "b": [0.1294, 0.8853, 0.1748, 0.9055]}, {"w": "(batch", "b": [0.1811, 0.8843, 0.2442, 0.904]}, {"w": "of", "b": [0.2505, 0.8843, 0.2715, 0.904]}, {"w": "64", "b": [0.2778, 0.8843, 0.303, 0.904]}, {"w": "sequences", "b": [0.3093, 0.8843, 0.4116, 0.904]}, {"w": "of", "b": [0.4179, 0.8843, 0.4389, 0.904]}, {"w": "length", "b": [0.4452, 0.8843, 0.5083, 0.904]}, {"w": "15).", "b": [0.5146, 0.8843, 0.5545, 0.904]}, {"w": "All", "b": [0.5608, 0.8843, 0.5931, 0.904]}, {"w": "sequences", "b": [0.5994, 0.8843, 0.7016, 0.904]}, {"w": "in", "b": [0.7079, 0.8843, 0.7276, 0.904]}, {"w": "a", "b": [0.7339, 0.8843, 0.7451, 0.904]}, {"w": "batch", "b": [0.7514, 0.8843, 0.806, 0.904]}, {"w": "must", "b": [0.8123, 0.8843, 0.8614, 0.904]}]}]}, {"page": 248, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "have the same length, though (because you need to pack them into a single tensor), so sequences that are shorter than others should be padded with zeros, and sequences that are longer should be truncated.", "words": [{"w": "have", "b": [0.1294, 0.0857, 0.177, 0.1054]}, {"w": "the", "b": [0.1833, 0.0857, 0.2142, 0.1054]}, {"w": "same", "b": [0.2205, 0.0857, 0.2723, 0.1054]}, {"w": "length,", "b": [0.2786, 0.0857, 0.348, 0.1054]}, {"w": "though", "b": [0.3543, 0.0857, 0.4244, 0.1054]}, {"w": "(because", "b": [0.4307, 0.0857, 0.5189, 0.1054]}, {"w": "you", "b": [0.5252, 0.0857, 0.5631, 0.1054]}, {"w": "need", "b": [0.5694, 0.0857, 0.617, 0.1054]}, {"w": "to", "b": [0.6233, 0.0857, 0.6429, 0.1054]}, {"w": "pack", "b": [0.6492, 0.0857, 0.6969, 0.1054]}, {"w": "them", "b": [0.7031, 0.0857, 0.7536, 0.1054]}, {"w": "into", "b": [0.7599, 0.0857, 0.7991, 0.1054]}, {"w": "a", "b": [0.8054, 0.0857, 0.8166, 0.1054]}, {"w": "single", "b": [0.1294, 0.1062, 0.1897, 0.1259]}, {"w": "tensor),", "b": [0.196, 0.1062, 0.2723, 0.1259]}, {"w": "so", "b": [0.2786, 0.1062, 0.3011, 0.1259]}, {"w": "sequences", "b": [0.3074, 0.1062, 0.4096, 0.1259]}, {"w": "that", "b": [0.416, 0.1062, 0.4538, 0.1259]}, {"w": "are", "b": [0.4601, 0.1062, 0.4909, 0.1259]}, {"w": "shorter", "b": [0.4972, 0.1062, 0.5673, 0.1259]}, {"w": "than", "b": [0.5736, 0.1062, 0.617, 0.1259]}, {"w": "others", "b": [0.6233, 0.1062, 0.685, 0.1259]}, {"w": "should", "b": [0.6913, 0.1062, 0.7585, 0.1259]}, {"w": "be", "b": [0.7648, 0.1062, 0.7887, 0.1259]}, {"w": "padded", "b": [0.795, 0.1062, 0.8678, 0.1259]}, {"w": "with", "b": [0.1294, 0.1267, 0.1743, 0.1464]}, {"w": "zeros,", "b": [0.1806, 0.1267, 0.2401, 0.1464]}, {"w": "and", "b": [0.2464, 0.1267, 0.2828, 0.1464]}, {"w": "sequences", "b": [0.2891, 0.1267, 0.3914, 0.1464]}, {"w": "that", "b": [0.3977, 0.1267, 0.4356, 0.1464]}, {"w": "are", "b": [0.4419, 0.1267, 0.4727, 0.1464]}, {"w": "longer", "b": [0.4789, 0.1267, 0.5434, 0.1464]}, {"w": "should", "b": [0.5497, 0.1267, 0.617, 0.1464]}, {"w": "be", "b": [0.6233, 0.1267, 0.6471, 0.1464]}, {"w": "truncated.", "b": [0.6534, 0.1267, 0.7536, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "This layer returns a 3D floating-point tensor of shape (samples, sequence_length, embedding_dimensionality). Such a 3D tensor can then be processed by an RNN layer or a 1D convolution layer (both will be introduced in the following sections).", "words": [{"w": "This", "b": [0.1294, 0.1695, 0.1743, 0.1892]}, {"w": "layer", "b": [0.1806, 0.1695, 0.231, 0.1892]}, {"w": "returns", "b": [0.2373, 0.1695, 0.3074, 0.1892]}, {"w": "a", "b": [0.3137, 0.1695, 0.3249, 0.1892]}, {"w": "3D", "b": [0.3312, 0.1695, 0.362, 0.1892]}, {"w": "floating-point", "b": [0.3683, 0.1695, 0.507, 0.1892]}, {"w": "tensor", "b": [0.5133, 0.1695, 0.575, 0.1892]}, {"w": "of", "b": [0.5813, 0.1695, 0.6023, 0.1892]}, {"w": "shape", "b": [0.6086, 0.1695, 0.6661, 0.1892]}, {"w": "(samples,", "b": [0.6723, 0.1705, 0.8085, 0.1907]}, {"w": "sequence_length,", "b": [0.1294, 0.1919, 0.3716, 0.2121]}, {"w": "embedding_dimensionality).", "b": [0.3867, 0.1909, 0.7715, 0.2121]}, {"w": "Such", "b": [0.7778, 0.1909, 0.8283, 0.2106]}, {"w": "a", "b": [0.8346, 0.1909, 0.8458, 0.2106]}, {"w": "3D", "b": [0.1294, 0.2122, 0.1602, 0.232]}, {"w": "tensor", "b": [0.1665, 0.2122, 0.2282, 0.232]}, {"w": "can", "b": [0.2345, 0.2122, 0.2695, 0.232]}, {"w": "then", "b": [0.2758, 0.2122, 0.3193, 0.232]}, {"w": "be", "b": [0.3256, 0.2122, 0.3494, 0.232]}, {"w": "processed", "b": [0.3557, 0.2122, 0.4552, 0.232]}, {"w": "by", "b": [0.4615, 0.2122, 0.4867, 0.232]}, {"w": "an", "b": [0.493, 0.2122, 0.5168, 0.232]}, {"w": "RNN", "b": [0.5231, 0.2122, 0.5764, 0.232]}, {"w": "layer", "b": [0.5827, 0.2122, 0.6331, 0.232]}, {"w": "or", "b": [0.6394, 0.2122, 0.6604, 0.232]}, {"w": "a", "b": [0.6667, 0.2122, 0.6779, 0.232]}, {"w": "1D", "b": [0.6842, 0.2122, 0.7151, 0.232]}, {"w": "convolution", "b": [0.7214, 0.2122, 0.8419, 0.232]}, {"w": "layer", "b": [0.1294, 0.2327, 0.1798, 0.2525]}, {"w": "(both", "b": [0.1861, 0.2327, 0.2394, 0.2525]}, {"w": "will", "b": [0.2457, 0.2327, 0.285, 0.2525]}, {"w": "be", "b": [0.2913, 0.2327, 0.3151, 0.2525]}, {"w": "introduced", "b": [0.3214, 0.2327, 0.4293, 0.2525]}, {"w": "in", "b": [0.4356, 0.2327, 0.4552, 0.2525]}, {"w": "the", "b": [0.4615, 0.2327, 0.4923, 0.2525]}, {"w": "following", "b": [0.4986, 0.2327, 0.5967, 0.2525]}, {"w": "sections).", "b": [0.603, 0.2327, 0.699, 0.2525]}]}, {"id": "b_2", "type": "paragraph", "text": "When you instantiate an Embedding layer, its weights (its internal dictionary of token vectors) are initially random, just as with any other layer. During training, these word vectors are gradually adjusted via backpropagation, structuring the space into something the downstream model can exploit. Once fully trained, the embedding space will show a lot of structure—a kind of structure specialized for the specific problem for which you’re training your model.", "words": [{"w": "When", "b": [0.1294, 0.2755, 0.1897, 0.2953]}, {"w": "you", "b": [0.196, 0.2755, 0.2338, 0.2953]}, {"w": "instantiate", "b": [0.2401, 0.2755, 0.3438, 0.2953]}, {"w": "an", "b": [0.3501, 0.2755, 0.3739, 0.2953]}, {"w": "Embedding", "b": [0.3802, 0.2766, 0.5164, 0.2968]}, {"w": "layer,", "b": [0.5227, 0.2755, 0.5784, 0.2953]}, {"w": "its", "b": [0.5848, 0.2755, 0.6086, 0.2953]}, {"w": "weights", "b": [0.6149, 0.2755, 0.6934, 0.2953]}, {"w": "(its", "b": [0.6997, 0.2755, 0.7319, 0.2953]}, {"w": "internal", "b": [0.7382, 0.2755, 0.8153, 0.2953]}, {"w": "dictionary", "b": [0.1294, 0.2969, 0.2317, 0.3167]}, {"w": "of", "b": [0.238, 0.2969, 0.259, 0.3167]}, {"w": "token", "b": [0.2653, 0.2969, 0.3214, 0.3167]}, {"w": "vectors)", "b": [0.3277, 0.2969, 0.4089, 0.3167]}, {"w": "are", "b": [0.4152, 0.2969, 0.446, 0.3167]}, {"w": "initially", "b": [0.4524, 0.2969, 0.5309, 0.3167]}, {"w": "random,", "b": [0.5372, 0.2969, 0.6205, 0.3167]}, {"w": "just", "b": [0.6268, 0.2969, 0.6633, 0.3167]}, {"w": "as", "b": [0.6696, 0.2969, 0.6906, 0.3167]}, {"w": "with", "b": [0.6969, 0.2969, 0.7418, 0.3167]}, {"w": "any", "b": [0.7481, 0.2969, 0.7845, 0.3167]}, {"w": "other", "b": [0.7908, 0.2969, 0.8426, 0.3167]}, {"w": "layer.", "b": [0.1294, 0.3174, 0.1847, 0.3372]}, {"w": "During", "b": [0.191, 0.3174, 0.2625, 0.3372]}, {"w": "training,", "b": [0.2688, 0.3174, 0.3536, 0.3372]}, {"w": "these", "b": [0.3599, 0.3174, 0.4117, 0.3372]}, {"w": "word", "b": [0.418, 0.3174, 0.4699, 0.3372]}, {"w": "vectors", "b": [0.4762, 0.3174, 0.549, 0.3372]}, {"w": "are", "b": [0.5553, 0.3174, 0.5861, 0.3372]}, {"w": "gradually", "b": [0.5925, 0.3174, 0.6877, 0.3372]}, {"w": "adjusted", "b": [0.694, 0.3174, 0.7781, 0.3372]}, {"w": "via", "b": [0.7844, 0.3174, 0.8152, 0.3372]}, {"w": "backpropagation,", "b": [0.1294, 0.3379, 0.3038, 0.3577]}, {"w": "structuring", "b": [0.3102, 0.3379, 0.4195, 0.3577]}, {"w": "the", "b": [0.4258, 0.3379, 0.4566, 0.3577]}, {"w": "space", "b": [0.4629, 0.3379, 0.5189, 0.3577]}, {"w": "into", "b": [0.5252, 0.3379, 0.5645, 0.3577]}, {"w": "something", "b": [0.5708, 0.3379, 0.6759, 0.3577]}, {"w": "the", "b": [0.6822, 0.3379, 0.713, 0.3577]}, {"w": "downstream", "b": [0.7193, 0.3379, 0.8426, 0.3577]}, {"w": "model", "b": [0.1294, 0.3584, 0.1925, 0.3782]}, {"w": "can", "b": [0.1988, 0.3584, 0.2338, 0.3782]}, {"w": "exploit.", "b": [0.2401, 0.3584, 0.3165, 0.3782]}, {"w": "Once", "b": [0.3228, 0.3584, 0.376, 0.3782]}, {"w": "fully", "b": [0.3823, 0.3584, 0.43, 0.3782]}, {"w": "trained,", "b": [0.4363, 0.3584, 0.5126, 0.3782]}, {"w": "the", "b": [0.5189, 0.3584, 0.5498, 0.3782]}, {"w": "embedding", "b": [0.5561, 0.3584, 0.6682, 0.3782]}, {"w": "space", "b": [0.6745, 0.3584, 0.7305, 0.3782]}, {"w": "will", "b": [0.7368, 0.3584, 0.7761, 0.3782]}, {"w": "show", "b": [0.7824, 0.3584, 0.8356, 0.3782]}, {"w": "a", "b": [0.8419, 0.3584, 0.8531, 0.3782]}, {"w": "lot", "b": [0.1294, 0.3789, 0.1561, 0.3987]}, {"w": "of", "b": [0.1624, 0.3789, 0.1834, 0.3987]}, {"w": "structure—a", "b": [0.1897, 0.3789, 0.3144, 0.3987]}, {"w": "kind", "b": [0.3207, 0.3789, 0.3655, 0.3987]}, {"w": "of", "b": [0.3718, 0.3789, 0.3928, 0.3987]}, {"w": "structure", "b": [0.3992, 0.3789, 0.4874, 0.3987]}, {"w": "specialized", "b": [0.4937, 0.3789, 0.6058, 0.3987]}, {"w": "for", "b": [0.6121, 0.3789, 0.6415, 0.3987]}, {"w": "the", "b": [0.6477, 0.3789, 0.6786, 0.3987]}, {"w": "specific", "b": [0.6849, 0.3789, 0.7633, 0.3987]}, {"w": "problem", "b": [0.7696, 0.3789, 0.8537, 0.3987]}, {"w": "for", "b": [0.1294, 0.3994, 0.1588, 0.4192]}, {"w": "which", "b": [0.1651, 0.3994, 0.2268, 0.4192]}, {"w": "you’re", "b": [0.2331, 0.3994, 0.2989, 0.4192]}, {"w": "training", "b": [0.3052, 0.3994, 0.3837, 0.4192]}, {"w": "your", "b": [0.39, 0.3994, 0.4363, 0.4192]}, {"w": "model.", "b": [0.4426, 0.3994, 0.5119, 0.4192]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s apply this idea to the IMDB movie-review sentiment-prediction task that you’re already familiar with. First, you’ll quickly prepare the data. You’ll restrict the movie reviews to the top 10,000 most common words (as you did the first time you worked with this dataset) and cut off the reviews after only 20 words. The network will learn 8-dimensional embeddings for each of the 10,000 words, turn the input integer sequences (2D integer tensor) into embedded sequences (3D float tensor), flatten the tensor to 2D, and train a single Dense layer on top for classification.", "words": [{"w": "Let’s", "b": [0.1294, 0.4422, 0.1798, 0.4619]}, {"w": "apply", "b": [0.1862, 0.4422, 0.2422, 0.4619]}, {"w": "this", "b": [0.2485, 0.4422, 0.285, 0.4619]}, {"w": "idea", "b": [0.2913, 0.4422, 0.3333, 0.4619]}, {"w": "to", "b": [0.3396, 0.4422, 0.3592, 0.4619]}, {"w": "the", "b": [0.3655, 0.4422, 0.3964, 0.4619]}, {"w": "IMDB", "b": [0.4027, 0.4422, 0.4685, 0.4619]}, {"w": "movie-review", "b": [0.4748, 0.4422, 0.6149, 0.4619]}, {"w": "sentiment-prediction", "b": [0.6212, 0.4422, 0.83, 0.4619]}, {"w": "task", "b": [0.1294, 0.4627, 0.1701, 0.4824]}, {"w": "that", "b": [0.1764, 0.4627, 0.2142, 0.4824]}, {"w": "you’re", "b": [0.2205, 0.4627, 0.2863, 0.4824]}, {"w": "already", "b": [0.2926, 0.4627, 0.3669, 0.4824]}, {"w": "familiar", "b": [0.3732, 0.4627, 0.4531, 0.4824]}, {"w": "with.", "b": [0.4594, 0.4627, 0.5105, 0.4824]}, {"w": "First,", "b": [0.5168, 0.4627, 0.5694, 0.4824]}, {"w": "you’ll", "b": [0.5757, 0.4627, 0.636, 0.4824]}, {"w": "quickly", "b": [0.6422, 0.4627, 0.7179, 0.4824]}, {"w": "prepare", "b": [0.7242, 0.4627, 0.7998, 0.4824]}, {"w": "the", "b": [0.8061, 0.4627, 0.8369, 0.4824]}, {"w": "data.", "b": [0.1294, 0.4832, 0.1777, 0.5029]}, {"w": "You’ll", "b": [0.1841, 0.4832, 0.2474, 0.5029]}, {"w": "restrict", "b": [0.2537, 0.4832, 0.3237, 0.5029]}, {"w": "the", "b": [0.33, 0.4832, 0.3609, 0.5029]}, {"w": "movie", "b": [0.3672, 0.4832, 0.4302, 0.5029]}, {"w": "reviews", "b": [0.4366, 0.4832, 0.515, 0.5029]}, {"w": "to", "b": [0.5213, 0.4832, 0.5409, 0.5029]}, {"w": "the", "b": [0.5472, 0.4832, 0.5781, 0.5029]}, {"w": "top", "b": [0.5844, 0.4832, 0.6166, 0.5029]}, {"w": "10,000", "b": [0.6229, 0.4832, 0.6923, 0.5029]}, {"w": "most", "b": [0.6986, 0.4832, 0.7477, 0.5029]}, {"w": "common", "b": [0.754, 0.4832, 0.8423, 0.5029]}, {"w": "words", "b": [0.1294, 0.5037, 0.1911, 0.5234]}, {"w": "(as", "b": [0.1974, 0.5037, 0.2268, 0.5234]}, {"w": "you", "b": [0.2331, 0.5037, 0.2709, 0.5234]}, {"w": "did", "b": [0.2772, 0.5037, 0.3095, 0.5234]}, {"w": "the", "b": [0.3158, 0.5037, 0.3466, 0.5234]}, {"w": "first", "b": [0.3529, 0.5037, 0.3936, 0.5234]}, {"w": "time", "b": [0.3999, 0.5037, 0.4447, 0.5234]}, {"w": "you", "b": [0.451, 0.5037, 0.4888, 0.5234]}, {"w": "worked", "b": [0.4951, 0.5037, 0.5708, 0.5234]}, {"w": "with", "b": [0.5771, 0.5037, 0.6219, 0.5234]}, {"w": "this", "b": [0.6282, 0.5037, 0.6647, 0.5234]}, {"w": "dataset)", "b": [0.671, 0.5037, 0.7495, 0.5234]}, {"w": "and", "b": [0.7558, 0.5037, 0.7922, 0.5234]}, {"w": "cut", "b": [0.7985, 0.5037, 0.8293, 0.5234]}, {"w": "off", "b": [0.8356, 0.5037, 0.8645, 0.5234]}, {"w": "the", "b": [0.1294, 0.5242, 0.1602, 0.5439]}, {"w": "reviews", "b": [0.1665, 0.5242, 0.245, 0.5439]}, {"w": "after", "b": [0.2513, 0.5242, 0.2975, 0.5439]}, {"w": "only", "b": [0.3038, 0.5242, 0.3487, 0.5439]}, {"w": "20", "b": [0.355, 0.5242, 0.3802, 0.5439]}, {"w": "words.", "b": [0.3865, 0.5242, 0.4545, 0.5439]}, {"w": "The", "b": [0.4608, 0.5242, 0.5, 0.5439]}, {"w": "network", "b": [0.5063, 0.5242, 0.589, 0.5439]}, {"w": "will", "b": [0.5953, 0.5242, 0.6345, 0.5439]}, {"w": "learn", "b": [0.6408, 0.5242, 0.6912, 0.5439]}, {"w": "8-dimensional", "b": [0.6975, 0.5242, 0.8419, 0.5439]}, {"w": "embeddings", "b": [0.1294, 0.5447, 0.2513, 0.5644]}, {"w": "for", "b": [0.2576, 0.5447, 0.287, 0.5644]}, {"w": "each", "b": [0.2934, 0.5447, 0.3396, 0.5644]}, {"w": "of", "b": [0.3459, 0.5447, 0.3669, 0.5644]}, {"w": "the", "b": [0.3732, 0.5447, 0.404, 0.5644]}, {"w": "10,000", "b": [0.4103, 0.5447, 0.4797, 0.5644]}, {"w": "words,", "b": [0.486, 0.5447, 0.554, 0.5644]}, {"w": "turn", "b": [0.5603, 0.5447, 0.6009, 0.5644]}, {"w": "the", "b": [0.6072, 0.5447, 0.638, 0.5644]}, {"w": "input", "b": [0.6443, 0.5447, 0.6962, 0.5644]}, {"w": "integer", "b": [0.7025, 0.5447, 0.7726, 0.5644]}, {"w": "sequences", "b": [0.1294, 0.5652, 0.2317, 0.5849]}, {"w": "(2D", "b": [0.238, 0.5652, 0.2772, 0.5849]}, {"w": "integer", "b": [0.2835, 0.5652, 0.3536, 0.5849]}, {"w": "tensor)", "b": [0.3599, 0.5652, 0.4299, 0.5849]}, {"w": "into", "b": [0.4362, 0.5652, 0.4755, 0.5849]}, {"w": "embedded", "b": [0.4818, 0.5652, 0.5855, 0.5849]}, {"w": "sequences", "b": [0.5917, 0.5652, 0.694, 0.5849]}, {"w": "(3D", "b": [0.7003, 0.5652, 0.7395, 0.5849]}, {"w": "float", "b": [0.7458, 0.5652, 0.7921, 0.5849]}, {"w": "tensor),", "b": [0.1294, 0.5857, 0.2058, 0.6054]}, {"w": "flatten", "b": [0.2121, 0.5857, 0.2765, 0.6054]}, {"w": "the", "b": [0.2828, 0.5857, 0.3137, 0.6054]}, {"w": "tensor", "b": [0.32, 0.5857, 0.3816, 0.6054]}, {"w": "to", "b": [0.3879, 0.5857, 0.4076, 0.6054]}, {"w": "2D,", "b": [0.4139, 0.5857, 0.451, 0.6054]}, {"w": "and", "b": [0.4573, 0.5857, 0.4937, 0.6054]}, {"w": "train", "b": [0.5, 0.5857, 0.5463, 0.6054]}, {"w": "a", "b": [0.5526, 0.5857, 0.5638, 0.6054]}, {"w": "single", "b": [0.5701, 0.5857, 0.6303, 0.6054]}, {"w": "Dense", "b": [0.6366, 0.5867, 0.7123, 0.6069]}, {"w": "layer", "b": [0.7186, 0.5857, 0.769, 0.6054]}, {"w": "on", "b": [0.7753, 0.5857, 0.8005, 0.6054]}, {"w": "top", "b": [0.8068, 0.5857, 0.8391, 0.6054]}, {"w": "for", "b": [0.1294, 0.6071, 0.1588, 0.6268]}, {"w": "classification.", "b": [0.1651, 0.6071, 0.3046, 0.6268]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.6. Loading the IMDB data for use with an Embedding layer", "words": [{"w": "Listing", "b": [0.1294, 0.6449, 0.1862, 0.6597]}, {"w": "6.6.", "b": [0.1909, 0.6449, 0.2193, 0.6597]}, {"w": "Loading", "b": [0.224, 0.6449, 0.2913, 0.6597]}, {"w": "the", "b": [0.296, 0.6449, 0.3213, 0.6597]}, {"w": "IMDB", "b": [0.326, 0.6449, 0.3775, 0.6597]}, {"w": "data", "b": [0.3822, 0.6449, 0.418, 0.6597]}, {"w": "for", "b": [0.4227, 0.6449, 0.4468, 0.6597]}, {"w": "use", "b": [0.4516, 0.6449, 0.4778, 0.6597]}, {"w": "with", "b": [0.4826, 0.6449, 0.5183, 0.6597]}, {"w": "an", "b": [0.523, 0.6449, 0.543, 0.6597]}, {"w": "Embedding", "b": [0.5478, 0.6457, 0.6499, 0.6609]}, {"w": "layer", "b": [0.6547, 0.6449, 0.6956, 0.6597]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras.datasets import imdb from keras import preprocessing max_features = 10000 1 maxlen = 20 2 (x_train, y_train), (x_test, y_test) = imdb.load_data( num_words=max_features) 3 x_train = preprocessing.sequence.pad_sequences(x_train, maxlen=maxlen 4", "words": [{"w": "from", "b": [0.1357, 0.6742, 0.1811, 0.6894]}, {"w": "keras.datasets", "b": [0.1925, 0.6742, 0.3514, 0.6894]}, {"w": "import", "b": [0.3628, 0.6742, 0.4309, 0.6894]}, {"w": "imdb", "b": [0.4422, 0.6742, 0.4876, 0.6894]}, {"w": "from", "b": [0.1357, 0.6894, 0.1811, 0.7045]}, {"w": "keras", "b": [0.1925, 0.6894, 0.2492, 0.7045]}, {"w": "import", "b": [0.2606, 0.6894, 0.3287, 0.7045]}, {"w": "preprocessing", "b": [0.34, 0.6894, 0.4876, 0.7045]}, {"w": "max_features", "b": [0.1357, 0.7197, 0.2719, 0.7348]}, {"w": "=", "b": [0.2833, 0.7197, 0.2946, 0.7348]}, {"w": "10000", "b": [0.306, 0.7197, 0.3628, 0.7348]}, {"w": "1", "b": [0.1357, 0.7349, 0.1471, 0.75]}, {"w": "maxlen", "b": [0.1357, 0.75, 0.2038, 0.7651]}, {"w": "=", "b": [0.2152, 0.75, 0.2265, 0.7651]}, {"w": "20", "b": [0.2379, 0.75, 0.2606, 0.7651]}, {"w": "2", "b": [0.1357, 0.7652, 0.1471, 0.7803]}, {"w": "(x_train,", "b": [0.1357, 0.7955, 0.2379, 0.8106]}, {"w": "y_train),", "b": [0.2492, 0.7955, 0.3514, 0.8106]}, {"w": "(x_test,", "b": [0.3628, 0.7955, 0.4536, 0.8106]}, {"w": "y_test)", "b": [0.4649, 0.7955, 0.5444, 0.8106]}, {"w": "=", "b": [0.5557, 0.7955, 0.5671, 0.8106]}, {"w": "imdb.load_data(", "b": [0.5784, 0.7955, 0.7487, 0.8106]}, {"w": "num_words=max_features)", "b": [0.1811, 0.8106, 0.4422, 0.8258]}, {"w": "3", "b": [0.1357, 0.8258, 0.1471, 0.8409]}, {"w": "x_train", "b": [0.1357, 0.8561, 0.2152, 0.8712]}, {"w": "=", "b": [0.2265, 0.8561, 0.2379, 0.8712]}, {"w": "preprocessing.sequence.pad_sequences(x_train,", "b": [0.2492, 0.8561, 0.7601, 0.8712]}, {"w": "maxlen=maxlen", "b": [0.1357, 0.8712, 0.2833, 0.8864]}, {"w": "4", "b": [0.3287, 0.8712, 0.3401, 0.8864]}]}]}, {"page": 249, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "x_test = preprocessing.sequence.pad_sequences(x_test, maxlen=maxlen)", "words": [{"w": "x_test", "b": [0.1357, 0.0851, 0.2038, 0.1002]}, {"w": "=", "b": [0.2152, 0.0851, 0.2265, 0.1002]}, {"w": "preprocessing.sequence.pad_sequences(x_test,", "b": [0.2379, 0.0851, 0.7374, 0.1002]}, {"w": "maxlen=maxlen)", "b": [0.1357, 0.1002, 0.2946, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Number of words to consider as features 2 Cuts off the text after this number of words (among the max_features most common words) 3 Loads the data as lists of integers 4 Turns the lists of integers into a 2D integer tensor of shape (samples, maxlen)", "words": [{"w": "1", "b": [0.1799, 0.1338, 0.1925, 0.1535]}, {"w": "Number", "b": [0.1988, 0.1338, 0.2885, 0.1535]}, {"w": "of", "b": [0.2948, 0.1338, 0.3158, 0.1535]}, {"w": "words", "b": [0.3221, 0.1338, 0.388, 0.1535]}, {"w": "to", "b": [0.3943, 0.1338, 0.4153, 0.1535]}, {"w": "consider", "b": [0.4216, 0.1338, 0.5127, 0.1535]}, {"w": "as", "b": [0.519, 0.1338, 0.5414, 0.1535]}, {"w": "features", "b": [0.5477, 0.1338, 0.6341, 0.1535]}, {"w": "2", "b": [0.1799, 0.1543, 0.1925, 0.174]}, {"w": "Cuts", "b": [0.1988, 0.1543, 0.2492, 0.174]}, {"w": "off", "b": [0.2555, 0.1543, 0.285, 0.174]}, {"w": "the", "b": [0.2913, 0.1543, 0.3249, 0.174]}, {"w": "text", "b": [0.3312, 0.1543, 0.3718, 0.174]}, {"w": "after", "b": [0.3781, 0.1543, 0.4299, 0.174]}, {"w": "this", "b": [0.4362, 0.1543, 0.4755, 0.174]}, {"w": "number", "b": [0.4818, 0.1543, 0.5673, 0.174]}, {"w": "of", "b": [0.5736, 0.1543, 0.5946, 0.174]}, {"w": "words", "b": [0.6009, 0.1543, 0.6668, 0.174]}, {"w": "(among", "b": [0.6731, 0.1543, 0.7544, 0.174]}, {"w": "the", "b": [0.7607, 0.1543, 0.7943, 0.174]}, {"w": "max_features", "b": [0.1799, 0.1748, 0.3251, 0.1945]}, {"w": "most", "b": [0.3314, 0.1748, 0.3833, 0.1945]}, {"w": "common", "b": [0.3896, 0.1748, 0.482, 0.1945]}, {"w": "words)", "b": [0.4883, 0.1748, 0.5626, 0.1945]}, {"w": "3", "b": [0.1799, 0.1953, 0.1925, 0.215]}, {"w": "Loads", "b": [0.1988, 0.1953, 0.2647, 0.215]}, {"w": "the", "b": [0.271, 0.1953, 0.3046, 0.215]}, {"w": "data", "b": [0.3109, 0.1953, 0.3586, 0.215]}, {"w": "as", "b": [0.3649, 0.1953, 0.3873, 0.215]}, {"w": "lists", "b": [0.3936, 0.1953, 0.4357, 0.215]}, {"w": "of", "b": [0.442, 0.1953, 0.463, 0.215]}, {"w": "integers", "b": [0.4693, 0.1953, 0.5547, 0.215]}, {"w": "4", "b": [0.1799, 0.2158, 0.1925, 0.2356]}, {"w": "Turns", "b": [0.1988, 0.2158, 0.2624, 0.2356]}, {"w": "the", "b": [0.2687, 0.2158, 0.3023, 0.2356]}, {"w": "lists", "b": [0.3086, 0.2158, 0.3506, 0.2356]}, {"w": "of", "b": [0.357, 0.2158, 0.378, 0.2356]}, {"w": "integers", "b": [0.3843, 0.2158, 0.4697, 0.2356]}, {"w": "into", "b": [0.476, 0.2158, 0.5181, 0.2356]}, {"w": "a", "b": [0.5244, 0.2158, 0.537, 0.2356]}, {"w": "2D", "b": [0.5433, 0.2158, 0.5741, 0.2356]}, {"w": "integer", "b": [0.5805, 0.2158, 0.6561, 0.2356]}, {"w": "tensor", "b": [0.6624, 0.2158, 0.7297, 0.2356]}, {"w": "of", "b": [0.736, 0.2158, 0.757, 0.2356]}, {"w": "shape", "b": [0.7633, 0.2158, 0.825, 0.2356]}, {"w": "(samples,", "b": [0.1799, 0.2363, 0.2801, 0.256]}, {"w": "maxlen)", "b": [0.2864, 0.2363, 0.3732, 0.256]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.7. Using an Embedding layer and classifier on the IMDB data", "words": [{"w": "Listing", "b": [0.1294, 0.2742, 0.1862, 0.289]}, {"w": "6.7.", "b": [0.1909, 0.2742, 0.2193, 0.289]}, {"w": "Using", "b": [0.224, 0.2742, 0.2703, 0.289]}, {"w": "an", "b": [0.275, 0.2742, 0.295, 0.289]}, {"w": "Embedding", "b": [0.2997, 0.2749, 0.4019, 0.2901]}, {"w": "layer", "b": [0.4066, 0.2742, 0.4476, 0.289]}, {"w": "and", "b": [0.4523, 0.2742, 0.4828, 0.289]}, {"w": "classifier", "b": [0.4875, 0.2742, 0.559, 0.289]}, {"w": "on", "b": [0.5637, 0.2742, 0.5837, 0.289]}, {"w": "the", "b": [0.5884, 0.2742, 0.6137, 0.289]}, {"w": "IMDB", "b": [0.6184, 0.2742, 0.6699, 0.289]}, {"w": "data", "b": [0.6746, 0.2742, 0.7103, 0.289]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.models import Sequential from keras.layers import Flatten, Dense model = Sequential() model.add(Embedding(10000, 8, input_length=maxlen)) 1 model.add(Flatten()) 2 model.add(Dense(1, activation='sigmoid')) 3 model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) model.summary() history = model.fit(x_train, y_train, epochs=10, batch_size=32, validation_split=0.2)", "words": [{"w": "from", "b": [0.1357, 0.3035, 0.1811, 0.3186]}, {"w": "keras.models", "b": [0.1925, 0.3035, 0.3287, 0.3186]}, {"w": "import", "b": [0.34, 0.3035, 0.4082, 0.3186]}, {"w": "Sequential", "b": [0.4195, 0.3035, 0.533, 0.3186]}, {"w": "from", "b": [0.1357, 0.3186, 0.1811, 0.3338]}, {"w": "keras.layers", "b": [0.1925, 0.3186, 0.3287, 0.3338]}, {"w": "import", "b": [0.34, 0.3186, 0.4082, 0.3338]}, {"w": "Flatten,", "b": [0.4195, 0.3186, 0.5103, 0.3338]}, {"w": "Dense", "b": [0.5217, 0.3186, 0.5784, 0.3338]}, {"w": "model", "b": [0.1357, 0.3489, 0.1925, 0.3641]}, {"w": "=", "b": [0.2038, 0.3489, 0.2152, 0.3641]}, {"w": "Sequential()", "b": [0.2265, 0.3489, 0.3628, 0.3641]}, {"w": "model.add(Embedding(10000,", "b": [0.1357, 0.3641, 0.4309, 0.3792]}, {"w": "8,", "b": [0.4422, 0.3641, 0.4649, 0.3792]}, {"w": "input_length=maxlen))", "b": [0.4763, 0.3641, 0.7146, 0.3792]}, {"w": "1", "b": [0.1357, 0.3792, 0.1471, 0.3944]}, {"w": "model.add(Flatten())", "b": [0.1357, 0.4095, 0.3628, 0.4247]}, {"w": "2", "b": [0.1357, 0.4247, 0.1471, 0.4398]}, {"w": "model.add(Dense(1,", "b": [0.1357, 0.455, 0.34, 0.4701]}, {"w": "activation='sigmoid'))", "b": [0.3514, 0.455, 0.6011, 0.4701]}, {"w": "3", "b": [0.1357, 0.4701, 0.1471, 0.4853]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.4853, 0.5217, 0.5004]}, {"w": "loss='binary_crossentropy',", "b": [0.533, 0.4853, 0.8395, 0.5004]}, {"w": "metrics=['acc'])", "b": [0.1357, 0.5004, 0.3173, 0.5156]}, {"w": "model.summary()", "b": [0.1357, 0.5156, 0.306, 0.5307]}, {"w": "history", "b": [0.1357, 0.5459, 0.2152, 0.561]}, {"w": "=", "b": [0.2265, 0.5459, 0.2379, 0.561]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.5459, 0.4536, 0.561]}, {"w": "y_train,", "b": [0.4649, 0.5459, 0.5557, 0.561]}, {"w": "epochs=10,", "b": [0.3628, 0.561, 0.4763, 0.5762]}, {"w": "batch_size=32,", "b": [0.3628, 0.5762, 0.5217, 0.5913]}, {"w": "validation_split=0.2)", "b": [0.3628, 0.5914, 0.6011, 0.6065]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Specifies the maximum input length to the Embedding layer so you can later flatten the embedded inputs. After the Embedding layer, the activations have shape (samples, maxlen, 8). 2 Flattens the 3D tensor of embeddings into a 2D tensor of shape (samples, maxlen * 8) 3 Adds the classifier on top", "words": [{"w": "1", "b": [0.1799, 0.6249, 0.1925, 0.6447]}, {"w": "Specifies", "b": [0.1988, 0.6249, 0.2927, 0.6447]}, {"w": "the", "b": [0.299, 0.6249, 0.3326, 0.6447]}, {"w": "maximum", "b": [0.3389, 0.6249, 0.4482, 0.6447]}, {"w": "input", "b": [0.4545, 0.6249, 0.512, 0.6447]}, {"w": "length", "b": [0.5183, 0.6249, 0.5856, 0.6447]}, {"w": "to", "b": [0.5919, 0.6249, 0.6129, 0.6447]}, {"w": "the", "b": [0.6192, 0.6249, 0.6528, 0.6447]}, {"w": "Embedding", "b": [0.6592, 0.6249, 0.7839, 0.6447]}, {"w": "layer", "b": [0.7902, 0.6249, 0.8449, 0.6447]}, {"w": "so", "b": [0.1799, 0.6454, 0.2023, 0.6652]}, {"w": "you", "b": [0.2086, 0.6454, 0.2478, 0.6652]}, {"w": "can", "b": [0.2542, 0.6454, 0.292, 0.6652]}, {"w": "later", "b": [0.2983, 0.6454, 0.3487, 0.6652]}, {"w": "flatten", "b": [0.355, 0.6454, 0.4251, 0.6652]}, {"w": "the", "b": [0.4314, 0.6454, 0.465, 0.6652]}, {"w": "embedded", "b": [0.4713, 0.6454, 0.582, 0.6652]}, {"w": "inputs.", "b": [0.5883, 0.6454, 0.662, 0.6652]}, {"w": "After", "b": [0.6683, 0.6454, 0.7257, 0.6652]}, {"w": "the", "b": [0.732, 0.6454, 0.7656, 0.6652]}, {"w": "Embedding", "b": [0.1799, 0.6659, 0.3046, 0.6857]}, {"w": "layer,", "b": [0.3109, 0.6659, 0.3696, 0.6857]}, {"w": "the", "b": [0.3759, 0.6659, 0.4095, 0.6857]}, {"w": "activations", "b": [0.4158, 0.6659, 0.5321, 0.6857]}, {"w": "have", "b": [0.5384, 0.6659, 0.5889, 0.6857]}, {"w": "shape", "b": [0.5952, 0.6659, 0.6569, 0.6857]}, {"w": "(samples,", "b": [0.6632, 0.6659, 0.7634, 0.6857]}, {"w": "maxlen,", "b": [0.7697, 0.6659, 0.8544, 0.6857]}, {"w": "8).", "b": [0.1799, 0.6864, 0.2072, 0.7062]}, {"w": "2", "b": [0.1799, 0.7069, 0.1925, 0.7267]}, {"w": "Flattens", "b": [0.1988, 0.7069, 0.2857, 0.7267]}, {"w": "the", "b": [0.292, 0.7069, 0.3256, 0.7267]}, {"w": "3D", "b": [0.3319, 0.7069, 0.3627, 0.7267]}, {"w": "tensor", "b": [0.369, 0.7069, 0.4363, 0.7267]}, {"w": "of", "b": [0.4426, 0.7069, 0.4636, 0.7267]}, {"w": "embeddings", "b": [0.4699, 0.7069, 0.5989, 0.7267]}, {"w": "into", "b": [0.6052, 0.7069, 0.6472, 0.7267]}, {"w": "a", "b": [0.6535, 0.7069, 0.6661, 0.7267]}, {"w": "2D", "b": [0.6724, 0.7069, 0.7033, 0.7267]}, {"w": "tensor", "b": [0.7096, 0.7069, 0.7768, 0.7267]}, {"w": "of", "b": [0.7831, 0.7069, 0.8042, 0.7267]}, {"w": "shape", "b": [0.1799, 0.7274, 0.2415, 0.7472]}, {"w": "(samples,", "b": [0.2478, 0.7274, 0.348, 0.7472]}, {"w": "maxlen", "b": [0.3544, 0.7274, 0.4328, 0.7472]}, {"w": "*", "b": [0.4391, 0.7274, 0.4517, 0.7472]}, {"w": "8)", "b": [0.4581, 0.7274, 0.4791, 0.7472]}, {"w": "3", "b": [0.1799, 0.7479, 0.1925, 0.7677]}, {"w": "Adds", "b": [0.1988, 0.7479, 0.2549, 0.7677]}, {"w": "the", "b": [0.2612, 0.7479, 0.2948, 0.7677]}, {"w": "classifier", "b": [0.3011, 0.7479, 0.3964, 0.7677]}, {"w": "on", "b": [0.4027, 0.7479, 0.4293, 0.7677]}, {"w": "top", "b": [0.4356, 0.7479, 0.4707, 0.7677]}]}, {"id": "b_5", "type": "paragraph", "text": "You get to a validation accuracy of ~76%, which is pretty good considering that you’re only looking at the first 20 words in every review. But note that merely flattening the embedded sequences and training a single Dense layer on top leads to a model that treats each word in the input sequence separately, without considering inter-word relationships and sentence structure (for example, this model would", "words": [{"w": "You", "b": [0.1294, 0.7907, 0.1703, 0.8104]}, {"w": "get", "b": [0.1766, 0.7907, 0.2075, 0.8104]}, {"w": "to", "b": [0.2138, 0.7907, 0.2334, 0.8104]}, {"w": "a", "b": [0.2397, 0.7907, 0.2509, 0.8104]}, {"w": "validation", "b": [0.2572, 0.7907, 0.3581, 0.8104]}, {"w": "accuracy", "b": [0.3644, 0.7907, 0.454, 0.8104]}, {"w": "of", "b": [0.4604, 0.7907, 0.4814, 0.8104]}, {"w": "~76%,", "b": [0.4877, 0.7907, 0.5539, 0.8104]}, {"w": "which", "b": [0.5602, 0.7907, 0.6218, 0.8104]}, {"w": "is", "b": [0.6281, 0.7907, 0.645, 0.8104]}, {"w": "pretty", "b": [0.6513, 0.7907, 0.7101, 0.8104]}, {"w": "good", "b": [0.7164, 0.7907, 0.7669, 0.8104]}, {"w": "considering", "b": [0.1294, 0.8112, 0.2471, 0.8309]}, {"w": "that", "b": [0.2534, 0.8112, 0.2913, 0.8309]}, {"w": "you’re", "b": [0.2976, 0.8112, 0.3634, 0.8309]}, {"w": "only", "b": [0.3697, 0.8112, 0.4146, 0.8309]}, {"w": "looking", "b": [0.4209, 0.8112, 0.498, 0.8309]}, {"w": "at", "b": [0.5043, 0.8112, 0.5225, 0.8309]}, {"w": "the", "b": [0.5288, 0.8112, 0.5596, 0.8309]}, {"w": "first", "b": [0.5659, 0.8112, 0.6066, 0.8309]}, {"w": "20", "b": [0.6129, 0.8112, 0.6381, 0.8309]}, {"w": "words", "b": [0.6444, 0.8112, 0.706, 0.8309]}, {"w": "in", "b": [0.7123, 0.8112, 0.7319, 0.8309]}, {"w": "every", "b": [0.7382, 0.8112, 0.7942, 0.8309]}, {"w": "review.", "b": [0.1294, 0.8317, 0.2027, 0.8514]}, {"w": "But", "b": [0.209, 0.8317, 0.2455, 0.8514]}, {"w": "note", "b": [0.2518, 0.8317, 0.2952, 0.8514]}, {"w": "that", "b": [0.3015, 0.8317, 0.3394, 0.8514]}, {"w": "merely", "b": [0.3457, 0.8317, 0.4157, 0.8514]}, {"w": "flattening", "b": [0.422, 0.8317, 0.5187, 0.8514]}, {"w": "the", "b": [0.525, 0.8317, 0.5558, 0.8514]}, {"w": "embedded", "b": [0.5622, 0.8317, 0.6658, 0.8514]}, {"w": "sequences", "b": [0.6721, 0.8317, 0.7744, 0.8514]}, {"w": "and", "b": [0.7807, 0.8317, 0.8171, 0.8514]}, {"w": "training", "b": [0.1294, 0.8522, 0.2079, 0.8719]}, {"w": "a", "b": [0.2142, 0.8522, 0.2254, 0.8719]}, {"w": "single", "b": [0.2317, 0.8522, 0.292, 0.8719]}, {"w": "Dense", "b": [0.2982, 0.8533, 0.3739, 0.8734]}, {"w": "layer", "b": [0.3802, 0.8522, 0.4306, 0.8719]}, {"w": "on", "b": [0.4369, 0.8522, 0.4622, 0.8719]}, {"w": "top", "b": [0.4685, 0.8522, 0.5007, 0.8719]}, {"w": "leads", "b": [0.507, 0.8522, 0.5589, 0.8719]}, {"w": "to", "b": [0.5652, 0.8522, 0.5848, 0.8719]}, {"w": "a", "b": [0.5911, 0.8522, 0.6023, 0.8719]}, {"w": "model", "b": [0.6086, 0.8522, 0.6717, 0.8719]}, {"w": "that", "b": [0.678, 0.8522, 0.7158, 0.8719]}, {"w": "treats", "b": [0.7221, 0.8522, 0.7768, 0.8719]}, {"w": "each", "b": [0.7831, 0.8522, 0.8293, 0.8719]}, {"w": "word", "b": [0.1294, 0.8736, 0.1813, 0.8933]}, {"w": "in", "b": [0.1876, 0.8736, 0.2072, 0.8933]}, {"w": "the", "b": [0.2135, 0.8736, 0.2443, 0.8933]}, {"w": "input", "b": [0.2506, 0.8736, 0.3025, 0.8933]}, {"w": "sequence", "b": [0.3088, 0.8736, 0.4012, 0.8933]}, {"w": "separately,", "b": [0.4076, 0.8736, 0.5144, 0.8933]}, {"w": "without", "b": [0.5207, 0.8736, 0.5978, 0.8933]}, {"w": "considering", "b": [0.6041, 0.8736, 0.7218, 0.8933]}, {"w": "inter-word", "b": [0.7282, 0.8736, 0.8341, 0.8933]}, {"w": "relationships", "b": [0.1294, 0.8941, 0.2583, 0.9138]}, {"w": "and", "b": [0.2646, 0.8941, 0.3011, 0.9138]}, {"w": "sentence", "b": [0.3074, 0.8941, 0.3942, 0.9138]}, {"w": "structure", "b": [0.4005, 0.8941, 0.4888, 0.9138]}, {"w": "(for", "b": [0.4951, 0.8941, 0.5329, 0.9138]}, {"w": "example,", "b": [0.5392, 0.8941, 0.631, 0.9138]}, {"w": "this", "b": [0.6373, 0.8941, 0.6737, 0.9138]}, {"w": "model", "b": [0.68, 0.8941, 0.7431, 0.9138]}, {"w": "would", "b": [0.7494, 0.8941, 0.8125, 0.9138]}]}]}, {"page": 250, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "likely treat both “this movie is a bomb” and “this movie is the bomb” as being negative reviews). It’s much better to add recurrent layers or 1D convolutional layers on top of the embedded sequences to learn features that take into account each sequence as a whole. That’s what we’ll focus on in the next few sections.", "words": [{"w": "likely", "b": [0.1294, 0.0857, 0.1869, 0.1054]}, {"w": "treat", "b": [0.1932, 0.0857, 0.238, 0.1054]}, {"w": "both", "b": [0.2443, 0.0857, 0.2892, 0.1054]}, {"w": "“this", "b": [0.2955, 0.0857, 0.3431, 0.1054]}, {"w": "movie", "b": [0.3494, 0.0857, 0.4125, 0.1054]}, {"w": "is", "b": [0.4188, 0.0857, 0.4356, 0.1054]}, {"w": "a", "b": [0.4419, 0.0857, 0.4531, 0.1054]}, {"w": "bomb”", "b": [0.4594, 0.0857, 0.5281, 0.1054]}, {"w": "and", "b": [0.5344, 0.0857, 0.5708, 0.1054]}, {"w": "“this", "b": [0.5771, 0.0857, 0.6248, 0.1054]}, {"w": "movie", "b": [0.6311, 0.0857, 0.6942, 0.1054]}, {"w": "is", "b": [0.7005, 0.0857, 0.7173, 0.1054]}, {"w": "the", "b": [0.7236, 0.0857, 0.7544, 0.1054]}, {"w": "bomb”", "b": [0.7607, 0.0857, 0.8294, 0.1054]}, {"w": "as", "b": [0.8356, 0.0857, 0.8566, 0.1054]}, {"w": "being", "b": [0.1294, 0.1062, 0.1855, 0.1259]}, {"w": "negative", "b": [0.1918, 0.1062, 0.2772, 0.1259]}, {"w": "reviews).", "b": [0.2835, 0.1062, 0.3767, 0.1259]}, {"w": "It’s", "b": [0.383, 0.1062, 0.4152, 0.1259]}, {"w": "much", "b": [0.4215, 0.1062, 0.4776, 0.1259]}, {"w": "better", "b": [0.4839, 0.1062, 0.5413, 0.1259]}, {"w": "to", "b": [0.5476, 0.1062, 0.5672, 0.1259]}, {"w": "add", "b": [0.5735, 0.1062, 0.61, 0.1259]}, {"w": "recurrent", "b": [0.6163, 0.1062, 0.7073, 0.1259]}, {"w": "layers", "b": [0.7136, 0.1062, 0.7739, 0.1259]}, {"w": "or", "b": [0.7802, 0.1062, 0.8012, 0.1259]}, {"w": "1D", "b": [0.8075, 0.1062, 0.8383, 0.1259]}, {"w": "convolutional", "b": [0.1294, 0.1267, 0.2682, 0.1464]}, {"w": "layers", "b": [0.2745, 0.1267, 0.3347, 0.1464]}, {"w": "on", "b": [0.341, 0.1267, 0.3662, 0.1464]}, {"w": "top", "b": [0.3725, 0.1267, 0.4048, 0.1464]}, {"w": "of", "b": [0.4111, 0.1267, 0.4321, 0.1464]}, {"w": "the", "b": [0.4384, 0.1267, 0.4692, 0.1464]}, {"w": "embedded", "b": [0.4755, 0.1267, 0.5792, 0.1464]}, {"w": "sequences", "b": [0.5855, 0.1267, 0.6878, 0.1464]}, {"w": "to", "b": [0.6941, 0.1267, 0.7137, 0.1464]}, {"w": "learn", "b": [0.72, 0.1267, 0.7704, 0.1464]}, {"w": "features", "b": [0.7768, 0.1267, 0.8566, 0.1464]}, {"w": "that", "b": [0.1294, 0.1472, 0.1673, 0.1669]}, {"w": "take", "b": [0.1736, 0.1472, 0.2156, 0.1669]}, {"w": "into", "b": [0.2219, 0.1472, 0.2611, 0.1669]}, {"w": "account", "b": [0.2674, 0.1472, 0.3459, 0.1669]}, {"w": "each", "b": [0.3522, 0.1472, 0.3984, 0.1669]}, {"w": "sequence", "b": [0.4047, 0.1472, 0.4971, 0.1669]}, {"w": "as", "b": [0.5035, 0.1472, 0.5245, 0.1669]}, {"w": "a", "b": [0.5308, 0.1472, 0.542, 0.1669]}, {"w": "whole.", "b": [0.5483, 0.1472, 0.6162, 0.1669]}, {"w": "That’s", "b": [0.6225, 0.1472, 0.6855, 0.1669]}, {"w": "what", "b": [0.6918, 0.1472, 0.7409, 0.1669]}, {"w": "we’ll", "b": [0.7472, 0.1472, 0.799, 0.1669]}, {"w": "focus", "b": [0.8053, 0.1472, 0.86, 0.1669]}, {"w": "on", "b": [0.1294, 0.1677, 0.1546, 0.1874]}, {"w": "in", "b": [0.1609, 0.1677, 0.1806, 0.1874]}, {"w": "the", "b": [0.1869, 0.1677, 0.2177, 0.1874]}, {"w": "next", "b": [0.224, 0.1677, 0.2674, 0.1874]}, {"w": "few", "b": [0.2738, 0.1677, 0.3116, 0.1874]}, {"w": "sections.", "b": [0.3179, 0.1677, 0.4055, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Using pretrained word embeddings", "words": [{"w": "Using", "b": [0.1294, 0.2055, 0.1757, 0.2203]}, {"w": "pretrained", "b": [0.1804, 0.2055, 0.2662, 0.2203]}, {"w": "word", "b": [0.271, 0.2055, 0.313, 0.2203]}, {"w": "embeddings", "b": [0.3177, 0.2055, 0.4145, 0.2203]}]}, {"id": "b_2", "type": "paragraph", "text": "Sometimes, you have so little training data available that you can’t use your data alone to learn an appropriate task-specific embedding of your vocabulary. What do you do then?", "words": [{"w": "Sometimes,", "b": [0.1294, 0.2434, 0.2478, 0.2632]}, {"w": "you", "b": [0.2542, 0.2434, 0.292, 0.2632]}, {"w": "have", "b": [0.2983, 0.2434, 0.3459, 0.2632]}, {"w": "so", "b": [0.3522, 0.2434, 0.3747, 0.2632]}, {"w": "little", "b": [0.381, 0.2434, 0.4272, 0.2632]}, {"w": "training", "b": [0.4335, 0.2434, 0.512, 0.2632]}, {"w": "data", "b": [0.5183, 0.2434, 0.5603, 0.2632]}, {"w": "available", "b": [0.5667, 0.2434, 0.6577, 0.2632]}, {"w": "that", "b": [0.664, 0.2434, 0.7019, 0.2632]}, {"w": "you", "b": [0.7082, 0.2434, 0.746, 0.2632]}, {"w": "can’t", "b": [0.7523, 0.2434, 0.8022, 0.2632]}, {"w": "use", "b": [0.8085, 0.2434, 0.8421, 0.2632]}, {"w": "your", "b": [0.1294, 0.2639, 0.1757, 0.2837]}, {"w": "data", "b": [0.182, 0.2639, 0.224, 0.2837]}, {"w": "alone", "b": [0.2303, 0.2639, 0.2849, 0.2837]}, {"w": "to", "b": [0.2912, 0.2639, 0.3109, 0.2837]}, {"w": "learn", "b": [0.3172, 0.2639, 0.3676, 0.2837]}, {"w": "an", "b": [0.3739, 0.2639, 0.3977, 0.2837]}, {"w": "appropriate", "b": [0.404, 0.2639, 0.5189, 0.2837]}, {"w": "task-specific", "b": [0.5252, 0.2639, 0.6527, 0.2837]}, {"w": "embedding", "b": [0.6589, 0.2639, 0.771, 0.2837]}, {"w": "of", "b": [0.7773, 0.2639, 0.7983, 0.2837]}, {"w": "your", "b": [0.8046, 0.2639, 0.8509, 0.2837]}, {"w": "vocabulary.", "b": [0.1294, 0.2844, 0.2461, 0.3042]}, {"w": "What", "b": [0.2524, 0.2844, 0.3071, 0.3042]}, {"w": "do", "b": [0.3134, 0.2844, 0.3386, 0.3042]}, {"w": "you", "b": [0.3449, 0.2844, 0.3828, 0.3042]}, {"w": "do", "b": [0.3891, 0.2844, 0.4143, 0.3042]}, {"w": "then?", "b": [0.4206, 0.2844, 0.4752, 0.3042]}]}, {"id": "b_3", "type": "paragraph", "text": "Instead of learning word embeddings jointly with the problem you want to solve, you can load embedding vectors from a precomputed embedding space that you know is highly structured and exhibits useful properties—that captures generic aspects of language structure. The rationale behind using pretrained word embeddings in natural-language processing is much the same as for using pretrained convnets in image classification: you don’t have enough data available to learn truly powerful features on your own, but you expect the features that you need to be fairly generic—that is, common visual features or semantic features. In this case, it makes sense to reuse features learned on a different problem.", "words": [{"w": "Instead", "b": [0.1294, 0.3272, 0.2023, 0.347]}, {"w": "of", "b": [0.2086, 0.3272, 0.2296, 0.347]}, {"w": "learning", "b": [0.2359, 0.3272, 0.3186, 0.347]}, {"w": "word", "b": [0.3249, 0.3272, 0.3767, 0.347]}, {"w": "embeddings", "b": [0.383, 0.3272, 0.5049, 0.347]}, {"w": "jointly", "b": [0.5112, 0.3272, 0.5771, 0.347]}, {"w": "with", "b": [0.5834, 0.3272, 0.6283, 0.347]}, {"w": "the", "b": [0.6346, 0.3272, 0.6654, 0.347]}, {"w": "problem", "b": [0.6717, 0.3272, 0.7558, 0.347]}, {"w": "you", "b": [0.7621, 0.3272, 0.7999, 0.347]}, {"w": "want", "b": [0.8062, 0.3272, 0.8553, 0.347]}, {"w": "to", "b": [0.1294, 0.3477, 0.149, 0.3675]}, {"w": "solve,", "b": [0.1553, 0.3477, 0.2149, 0.3675]}, {"w": "you", "b": [0.2212, 0.3477, 0.259, 0.3675]}, {"w": "can", "b": [0.2654, 0.3477, 0.3004, 0.3675]}, {"w": "load", "b": [0.3067, 0.3477, 0.3501, 0.3675]}, {"w": "embedding", "b": [0.3564, 0.3477, 0.4685, 0.3675]}, {"w": "vectors", "b": [0.4748, 0.3477, 0.5477, 0.3675]}, {"w": "from", "b": [0.554, 0.3477, 0.603, 0.3675]}, {"w": "a", "b": [0.6093, 0.3477, 0.6205, 0.3675]}, {"w": "precomputed", "b": [0.6268, 0.3477, 0.7585, 0.3675]}, {"w": "embedding", "b": [0.1294, 0.3682, 0.2415, 0.388]}, {"w": "space", "b": [0.2478, 0.3682, 0.3038, 0.388]}, {"w": "that", "b": [0.3102, 0.3682, 0.348, 0.388]}, {"w": "you", "b": [0.3543, 0.3682, 0.3921, 0.388]}, {"w": "know", "b": [0.3984, 0.3682, 0.4545, 0.388]}, {"w": "is", "b": [0.4608, 0.3682, 0.4776, 0.388]}, {"w": "highly", "b": [0.4839, 0.3682, 0.5484, 0.388]}, {"w": "structured", "b": [0.5547, 0.3682, 0.6556, 0.388]}, {"w": "and", "b": [0.6619, 0.3682, 0.6983, 0.388]}, {"w": "exhibits", "b": [0.7046, 0.3682, 0.7845, 0.388]}, {"w": "useful", "b": [0.7908, 0.3682, 0.8525, 0.388]}, {"w": "properties—that", "b": [0.1294, 0.3887, 0.2934, 0.4085]}, {"w": "captures", "b": [0.2997, 0.3887, 0.3837, 0.4085]}, {"w": "generic", "b": [0.39, 0.3887, 0.4643, 0.4085]}, {"w": "aspects", "b": [0.4706, 0.3887, 0.5434, 0.4085]}, {"w": "of", "b": [0.5497, 0.3887, 0.5707, 0.4085]}, {"w": "language", "b": [0.577, 0.3887, 0.6681, 0.4085]}, {"w": "structure.", "b": [0.6743, 0.3887, 0.7689, 0.4085]}, {"w": "The", "b": [0.7752, 0.3887, 0.8144, 0.4085]}, {"w": "rationale", "b": [0.1294, 0.4092, 0.2177, 0.429]}, {"w": "behind", "b": [0.224, 0.4092, 0.2926, 0.429]}, {"w": "using", "b": [0.299, 0.4092, 0.3536, 0.429]}, {"w": "pretrained", "b": [0.3599, 0.4092, 0.4622, 0.429]}, {"w": "word", "b": [0.4685, 0.4092, 0.5203, 0.429]}, {"w": "embeddings", "b": [0.5266, 0.4092, 0.6486, 0.429]}, {"w": "in", "b": [0.6549, 0.4092, 0.6745, 0.429]}, {"w": "natural-language", "b": [0.6808, 0.4092, 0.8503, 0.429]}, {"w": "processing", "b": [0.1294, 0.4297, 0.2373, 0.4495]}, {"w": "is", "b": [0.2436, 0.4297, 0.2604, 0.4495]}, {"w": "much", "b": [0.2667, 0.4297, 0.3228, 0.4495]}, {"w": "the", "b": [0.3291, 0.4297, 0.3599, 0.4495]}, {"w": "same", "b": [0.3662, 0.4297, 0.4181, 0.4495]}, {"w": "as", "b": [0.4244, 0.4297, 0.4454, 0.4495]}, {"w": "for", "b": [0.4517, 0.4297, 0.4811, 0.4495]}, {"w": "using", "b": [0.4874, 0.4297, 0.5421, 0.4495]}, {"w": "pretrained", "b": [0.5484, 0.4297, 0.6506, 0.4495]}, {"w": "convnets", "b": [0.6569, 0.4297, 0.7466, 0.4495]}, {"w": "in", "b": [0.7529, 0.4297, 0.7725, 0.4495]}, {"w": "image", "b": [0.7788, 0.4297, 0.8405, 0.4495]}, {"w": "classification:", "b": [0.1294, 0.4502, 0.2695, 0.47]}, {"w": "you", "b": [0.2758, 0.4502, 0.3137, 0.47]}, {"w": "don’t", "b": [0.32, 0.4502, 0.3728, 0.47]}, {"w": "have", "b": [0.3791, 0.4502, 0.4267, 0.47]}, {"w": "enough", "b": [0.433, 0.4502, 0.5073, 0.47]}, {"w": "data", "b": [0.5136, 0.4502, 0.5556, 0.47]}, {"w": "available", "b": [0.5619, 0.4502, 0.653, 0.47]}, {"w": "to", "b": [0.6593, 0.4502, 0.6789, 0.47]}, {"w": "learn", "b": [0.6852, 0.4502, 0.7356, 0.47]}, {"w": "truly", "b": [0.7419, 0.4502, 0.7896, 0.47]}, {"w": "powerful", "b": [0.1294, 0.4707, 0.2205, 0.4905]}, {"w": "features", "b": [0.2268, 0.4707, 0.3066, 0.4905]}, {"w": "on", "b": [0.3129, 0.4707, 0.3382, 0.4905]}, {"w": "your", "b": [0.3445, 0.4707, 0.3907, 0.4905]}, {"w": "own,", "b": [0.397, 0.4707, 0.4467, 0.4905]}, {"w": "but", "b": [0.453, 0.4707, 0.4853, 0.4905]}, {"w": "you", "b": [0.4916, 0.4707, 0.5294, 0.4905]}, {"w": "expect", "b": [0.5357, 0.4707, 0.6016, 0.4905]}, {"w": "the", "b": [0.6079, 0.4707, 0.6387, 0.4905]}, {"w": "features", "b": [0.645, 0.4707, 0.7248, 0.4905]}, {"w": "that", "b": [0.7311, 0.4707, 0.769, 0.4905]}, {"w": "you", "b": [0.7753, 0.4707, 0.8131, 0.4905]}, {"w": "need", "b": [0.8194, 0.4707, 0.8671, 0.4905]}, {"w": "to", "b": [0.1294, 0.4912, 0.149, 0.511]}, {"w": "be", "b": [0.1553, 0.4912, 0.1792, 0.511]}, {"w": "fairly", "b": [0.1855, 0.4912, 0.2401, 0.511]}, {"w": "generic—that", "b": [0.2464, 0.4912, 0.3837, 0.511]}, {"w": "is,", "b": [0.39, 0.4912, 0.4132, 0.511]}, {"w": "common", "b": [0.4195, 0.4912, 0.5077, 0.511]}, {"w": "visual", "b": [0.5141, 0.4912, 0.5743, 0.511]}, {"w": "features", "b": [0.5806, 0.4912, 0.6605, 0.511]}, {"w": "or", "b": [0.6668, 0.4912, 0.6878, 0.511]}, {"w": "semantic", "b": [0.6941, 0.4912, 0.7838, 0.511]}, {"w": "features.", "b": [0.1294, 0.5117, 0.2156, 0.5315]}, {"w": "In", "b": [0.2218, 0.5117, 0.2429, 0.5315]}, {"w": "this", "b": [0.2492, 0.5117, 0.2856, 0.5315]}, {"w": "case,", "b": [0.2919, 0.5117, 0.3416, 0.5315]}, {"w": "it", "b": [0.3479, 0.5117, 0.362, 0.5315]}, {"w": "makes", "b": [0.3683, 0.5117, 0.4327, 0.5315]}, {"w": "sense", "b": [0.439, 0.5117, 0.4937, 0.5315]}, {"w": "to", "b": [0.5, 0.5117, 0.5196, 0.5315]}, {"w": "reuse", "b": [0.5259, 0.5117, 0.5791, 0.5315]}, {"w": "features", "b": [0.5854, 0.5117, 0.6653, 0.5315]}, {"w": "learned", "b": [0.6716, 0.5117, 0.7458, 0.5315]}, {"w": "on", "b": [0.7521, 0.5117, 0.7774, 0.5315]}, {"w": "a", "b": [0.7837, 0.5117, 0.7949, 0.5315]}, {"w": "different", "b": [0.1294, 0.5322, 0.2158, 0.552]}, {"w": "problem.", "b": [0.2221, 0.5322, 0.3125, 0.552]}]}, {"id": "b_4", "type": "paragraph", "text": "Such word embeddings are generally computed using word-occurrence statistics (observations about what words co-occur in sentences or documents), using a variety of techniques, some involving neural networks, others not. The idea of a dense, low-dimensional embedding space for words, computed in an unsupervised way, was initially explored by Bengio et al. in the early 2000s,[1] but it only started to take off in research and industry applications after the release of one of the most famous and successful word-embedding schemes: the Word2vec algorithm (https://code.google.com/archive/p/word2vec), developed by Tomas Mikolov at Google in 2013. Word2vec dimensions capture specific semantic properties, such as gender.", "words": [{"w": "Such", "b": [0.1294, 0.575, 0.1799, 0.5947]}, {"w": "word", "b": [0.1862, 0.575, 0.238, 0.5947]}, {"w": "embeddings", "b": [0.2443, 0.575, 0.3662, 0.5947]}, {"w": "are", "b": [0.3725, 0.575, 0.4033, 0.5947]}, {"w": "generally", "b": [0.4096, 0.575, 0.5035, 0.5947]}, {"w": "computed", "b": [0.5098, 0.575, 0.6093, 0.5947]}, {"w": "using", "b": [0.6156, 0.575, 0.6703, 0.5947]}, {"w": "word-occurrence", "b": [0.6766, 0.575, 0.8475, 0.5947]}, {"w": "statistics", "b": [0.1294, 0.5955, 0.2163, 0.6152]}, {"w": "(observations", "b": [0.2226, 0.5955, 0.3585, 0.6152]}, {"w": "about", "b": [0.3648, 0.5955, 0.4209, 0.6152]}, {"w": "what", "b": [0.4272, 0.5955, 0.4762, 0.6152]}, {"w": "words", "b": [0.4825, 0.5955, 0.5442, 0.6152]}, {"w": "co-occur", "b": [0.5505, 0.5955, 0.6387, 0.6152]}, {"w": "in", "b": [0.6451, 0.5955, 0.6647, 0.6152]}, {"w": "sentences", "b": [0.671, 0.5955, 0.7676, 0.6152]}, {"w": "or", "b": [0.7739, 0.5955, 0.7949, 0.6152]}, {"w": "documents),", "b": [0.1294, 0.616, 0.2534, 0.6357]}, {"w": "using", "b": [0.2597, 0.616, 0.3144, 0.6357]}, {"w": "a", "b": [0.3207, 0.616, 0.3319, 0.6357]}, {"w": "variety", "b": [0.3382, 0.616, 0.4083, 0.6357]}, {"w": "of", "b": [0.4146, 0.616, 0.4356, 0.6357]}, {"w": "techniques,", "b": [0.4419, 0.616, 0.5561, 0.6357]}, {"w": "some", "b": [0.5624, 0.616, 0.6156, 0.6357]}, {"w": "involving", "b": [0.6219, 0.616, 0.7187, 0.6357]}, {"w": "neural", "b": [0.725, 0.616, 0.788, 0.6357]}, {"w": "networks,", "b": [0.1294, 0.6365, 0.2282, 0.6563]}, {"w": "others", "b": [0.2345, 0.6365, 0.2962, 0.6563]}, {"w": "not.", "b": [0.3025, 0.6365, 0.341, 0.6563]}, {"w": "The", "b": [0.3473, 0.6365, 0.3865, 0.6563]}, {"w": "idea", "b": [0.3928, 0.6365, 0.4349, 0.6563]}, {"w": "of", "b": [0.4412, 0.6365, 0.4622, 0.6563]}, {"w": "a", "b": [0.4685, 0.6365, 0.4797, 0.6563]}, {"w": "dense,", "b": [0.486, 0.6365, 0.5497, 0.6563]}, {"w": "low-dimensional", "b": [0.5561, 0.6365, 0.7256, 0.6563]}, {"w": "embedding", "b": [0.7319, 0.6365, 0.844, 0.6563]}, {"w": "space", "b": [0.1294, 0.657, 0.1854, 0.6768]}, {"w": "for", "b": [0.1917, 0.657, 0.2212, 0.6768]}, {"w": "words,", "b": [0.2275, 0.657, 0.2954, 0.6768]}, {"w": "computed", "b": [0.3017, 0.657, 0.4012, 0.6768]}, {"w": "in", "b": [0.4075, 0.657, 0.4272, 0.6768]}, {"w": "an", "b": [0.4335, 0.657, 0.4573, 0.6768]}, {"w": "unsupervised", "b": [0.4636, 0.657, 0.5967, 0.6768]}, {"w": "way,", "b": [0.603, 0.657, 0.6497, 0.6768]}, {"w": "was", "b": [0.656, 0.657, 0.6952, 0.6768]}, {"w": "initially", "b": [0.7015, 0.657, 0.78, 0.6768]}, {"w": "explored", "b": [0.1294, 0.6793, 0.2177, 0.699]}, {"w": "by", "b": [0.224, 0.6793, 0.2492, 0.699]}, {"w": "Bengio", "b": [0.2555, 0.6793, 0.3284, 0.699]}, {"w": "et", "b": [0.3347, 0.6793, 0.3529, 0.699]}, {"w": "al.", "b": [0.3592, 0.6793, 0.3837, 0.699]}, {"w": "in", "b": [0.39, 0.6793, 0.4097, 0.699]}, {"w": "the", "b": [0.416, 0.6793, 0.4468, 0.699]}, {"w": "early", "b": [0.4531, 0.6793, 0.5035, 0.699]}, {"w": "2000s,[1]", "b": [0.5098, 0.677, 0.5984, 0.699]}, {"w": "but", "b": [0.6047, 0.6793, 0.6369, 0.699]}, {"w": "it", "b": [0.6432, 0.6793, 0.6573, 0.699]}, {"w": "only", "b": [0.6636, 0.6793, 0.7084, 0.699]}, {"w": "started", "b": [0.7147, 0.6793, 0.782, 0.699]}, {"w": "to", "b": [0.7883, 0.6793, 0.8079, 0.699]}, {"w": "take", "b": [0.8142, 0.6793, 0.8562, 0.699]}, {"w": "off", "b": [0.1294, 0.6998, 0.1584, 0.7195]}, {"w": "in", "b": [0.1647, 0.6998, 0.1843, 0.7195]}, {"w": "research", "b": [0.1906, 0.6998, 0.2746, 0.7195]}, {"w": "and", "b": [0.2809, 0.6998, 0.3174, 0.7195]}, {"w": "industry", "b": [0.3237, 0.6998, 0.4064, 0.7195]}, {"w": "applications", "b": [0.4127, 0.6998, 0.5346, 0.7195]}, {"w": "after", "b": [0.5409, 0.6998, 0.5871, 0.7195]}, {"w": "the", "b": [0.5934, 0.6998, 0.6242, 0.7195]}, {"w": "release", "b": [0.6305, 0.6998, 0.7006, 0.7195]}, {"w": "of", "b": [0.7069, 0.6998, 0.7279, 0.7195]}, {"w": "one", "b": [0.7342, 0.6998, 0.7706, 0.7195]}, {"w": "of", "b": [0.7769, 0.6998, 0.7979, 0.7195]}, {"w": "the", "b": [0.8043, 0.6998, 0.8351, 0.7195]}, {"w": "most", "b": [0.1294, 0.7203, 0.1785, 0.74]}, {"w": "famous", "b": [0.1848, 0.7203, 0.259, 0.74]}, {"w": "and", "b": [0.2654, 0.7203, 0.3018, 0.74]}, {"w": "successful", "b": [0.3081, 0.7203, 0.4118, 0.74]}, {"w": "word-embedding", "b": [0.418, 0.7203, 0.5904, 0.74]}, {"w": "schemes:", "b": [0.5967, 0.7203, 0.6892, 0.74]}, {"w": "the", "b": [0.6955, 0.7203, 0.7263, 0.74]}, {"w": "Word2vec", "b": [0.7326, 0.7203, 0.8356, 0.74]}, {"w": "algorithm", "b": [0.1294, 0.7408, 0.2275, 0.7605]}, {"w": "(https://code.google.com/archive/p/word2vec),", "b": [0.2338, 0.7408, 0.7066, 0.7605]}, {"w": "developed", "b": [0.7129, 0.7408, 0.8166, 0.7605]}, {"w": "by", "b": [0.8229, 0.7408, 0.8481, 0.7605]}, {"w": "Tomas", "b": [0.1294, 0.7613, 0.1963, 0.781]}, {"w": "Mikolov", "b": [0.2026, 0.7613, 0.2895, 0.781]}, {"w": "at", "b": [0.2958, 0.7613, 0.314, 0.781]}, {"w": "Google", "b": [0.3203, 0.7613, 0.3946, 0.781]}, {"w": "in", "b": [0.4009, 0.7613, 0.4205, 0.781]}, {"w": "2013.", "b": [0.4268, 0.7613, 0.4836, 0.781]}, {"w": "Word2vec", "b": [0.4899, 0.7613, 0.5929, 0.781]}, {"w": "dimensions", "b": [0.5992, 0.7613, 0.7142, 0.781]}, {"w": "capture", "b": [0.7205, 0.7613, 0.7947, 0.781]}, {"w": "specific", "b": [0.1294, 0.7818, 0.2079, 0.8015]}, {"w": "semantic", "b": [0.2142, 0.7818, 0.3038, 0.8015]}, {"w": "properties,", "b": [0.3102, 0.7818, 0.4173, 0.8015]}, {"w": "such", "b": [0.4236, 0.7818, 0.4699, 0.8015]}, {"w": "as", "b": [0.4762, 0.7818, 0.4972, 0.8015]}, {"w": "gender.", "b": [0.5035, 0.7818, 0.577, 0.8015]}]}, {"id": "b_6", "type": "paragraph", "text": "Yoshua Bengio et al., Neural Probabilistic Language Models (Springer, 2003).", "words": [{"w": "Yoshua", "b": [0.1483, 0.8473, 0.2042, 0.8621]}, {"w": "Bengio", "b": [0.209, 0.8473, 0.2636, 0.8621]}, {"w": "et", "b": [0.2684, 0.8473, 0.282, 0.8621]}, {"w": "al.,", "b": [0.2867, 0.8473, 0.3099, 0.8621]}, {"w": "Neural", "b": [0.3146, 0.8473, 0.3671, 0.8621]}, {"w": "Probabilistic", "b": [0.3719, 0.8473, 0.47, 0.8621]}, {"w": "Language", "b": [0.4747, 0.8473, 0.5504, 0.8621]}, {"w": "Models", "b": [0.5551, 0.8473, 0.6108, 0.8621]}, {"w": "(Springer,", "b": [0.6155, 0.8473, 0.6909, 0.8621]}, {"w": "2003).", "b": [0.6957, 0.8473, 0.7445, 0.8621]}]}]}, {"page": 251, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "There are various precomputed databases of word embeddings that you can download and use in a Keras Embedding layer. Word2vec is one of them. Another popular one is called Global Vectors for Word Representation (GloVe, https://nlp.stanford.edu/projects/glove), which was developed by Stanford researchers in 2014. This embedding technique is based on factorizing a matrix of word co-occurrence statistics. Its developers have made available precomputed embeddings for millions of English tokens, obtained from Wikipedia data and Common Crawl data.", "words": [{"w": "There", "b": [0.1294, 0.0857, 0.1882, 0.1054]}, {"w": "are", "b": [0.1945, 0.0857, 0.2253, 0.1054]}, {"w": "various", "b": [0.2317, 0.0857, 0.3059, 0.1054]}, {"w": "precomputed", "b": [0.3122, 0.0857, 0.4439, 0.1054]}, {"w": "databases", "b": [0.4502, 0.0857, 0.5469, 0.1054]}, {"w": "of", "b": [0.5532, 0.0857, 0.5742, 0.1054]}, {"w": "word", "b": [0.5805, 0.0857, 0.6324, 0.1054]}, {"w": "embeddings", "b": [0.6387, 0.0857, 0.7606, 0.1054]}, {"w": "that", "b": [0.7669, 0.0857, 0.8047, 0.1054]}, {"w": "you", "b": [0.811, 0.0857, 0.8489, 0.1054]}, {"w": "can", "b": [0.1294, 0.1062, 0.1644, 0.1259]}, {"w": "download", "b": [0.1707, 0.1062, 0.2702, 0.1259]}, {"w": "and", "b": [0.2765, 0.1062, 0.313, 0.1259]}, {"w": "use", "b": [0.3193, 0.1062, 0.3529, 0.1259]}, {"w": "in", "b": [0.3592, 0.1062, 0.3788, 0.1259]}, {"w": "a", "b": [0.3851, 0.1062, 0.3963, 0.1259]}, {"w": "Keras", "b": [0.4026, 0.1062, 0.4615, 0.1259]}, {"w": "Embedding", "b": [0.4677, 0.1072, 0.604, 0.1274]}, {"w": "layer.", "b": [0.6103, 0.1062, 0.6656, 0.1259]}, {"w": "Word2vec", "b": [0.6719, 0.1062, 0.775, 0.1259]}, {"w": "is", "b": [0.7813, 0.1062, 0.7981, 0.1259]}, {"w": "one", "b": [0.8044, 0.1062, 0.8408, 0.1259]}, {"w": "of", "b": [0.8471, 0.1062, 0.8681, 0.1259]}, {"w": "them.", "b": [0.1294, 0.1276, 0.1862, 0.1473]}, {"w": "Another", "b": [0.1925, 0.1276, 0.2751, 0.1473]}, {"w": "popular", "b": [0.2814, 0.1276, 0.3585, 0.1473]}, {"w": "one", "b": [0.3648, 0.1276, 0.4012, 0.1473]}, {"w": "is", "b": [0.4076, 0.1276, 0.4244, 0.1473]}, {"w": "called", "b": [0.4307, 0.1276, 0.4909, 0.1473]}, {"w": "Global", "b": [0.4972, 0.1276, 0.5659, 0.1473]}, {"w": "Vectors", "b": [0.5722, 0.1276, 0.6478, 0.1473]}, {"w": "for", "b": [0.6541, 0.1276, 0.6835, 0.1473]}, {"w": "Word", "b": [0.6898, 0.1276, 0.7452, 0.1473]}, {"w": "Representation", "b": [0.1294, 0.1481, 0.2807, 0.1678]}, {"w": "(GloVe,", "b": [0.287, 0.1481, 0.3662, 0.1678]}, {"w": "https://nlp.stanford.edu/projects/glove),", "b": [0.3725, 0.1481, 0.7711, 0.1678]}, {"w": "which", "b": [0.7774, 0.1481, 0.8391, 0.1678]}, {"w": "was", "b": [0.1294, 0.1686, 0.1686, 0.1883]}, {"w": "developed", "b": [0.1749, 0.1686, 0.2786, 0.1883]}, {"w": "by", "b": [0.2849, 0.1686, 0.3102, 0.1883]}, {"w": "Stanford", "b": [0.3165, 0.1686, 0.4033, 0.1883]}, {"w": "researchers", "b": [0.4096, 0.1686, 0.5231, 0.1883]}, {"w": "in", "b": [0.5294, 0.1686, 0.549, 0.1883]}, {"w": "2014.", "b": [0.5553, 0.1686, 0.6121, 0.1883]}, {"w": "This", "b": [0.6184, 0.1686, 0.6632, 0.1883]}, {"w": "embedding", "b": [0.6695, 0.1686, 0.7816, 0.1883]}, {"w": "technique", "b": [0.1294, 0.1891, 0.2275, 0.2088]}, {"w": "is", "b": [0.2338, 0.1891, 0.2506, 0.2088]}, {"w": "based", "b": [0.2569, 0.1891, 0.3144, 0.2088]}, {"w": "on", "b": [0.3207, 0.1891, 0.3459, 0.2088]}, {"w": "factorizing", "b": [0.3522, 0.1891, 0.4615, 0.2088]}, {"w": "a", "b": [0.4678, 0.1891, 0.479, 0.2088]}, {"w": "matrix", "b": [0.4853, 0.1891, 0.5512, 0.2088]}, {"w": "of", "b": [0.5575, 0.1891, 0.5785, 0.2088]}, {"w": "word", "b": [0.5848, 0.1891, 0.6366, 0.2088]}, {"w": "co-occurrence", "b": [0.6429, 0.1891, 0.7857, 0.2088]}, {"w": "statistics.", "b": [0.1294, 0.2096, 0.2226, 0.2293]}, {"w": "Its", "b": [0.2289, 0.2096, 0.2542, 0.2293]}, {"w": "developers", "b": [0.2605, 0.2096, 0.3697, 0.2293]}, {"w": "have", "b": [0.376, 0.2096, 0.4237, 0.2293]}, {"w": "made", "b": [0.43, 0.2096, 0.4846, 0.2293]}, {"w": "available", "b": [0.4909, 0.2096, 0.582, 0.2293]}, {"w": "precomputed", "b": [0.5883, 0.2096, 0.72, 0.2293]}, {"w": "embeddings", "b": [0.7263, 0.2096, 0.8482, 0.2293]}, {"w": "for", "b": [0.1294, 0.2301, 0.1588, 0.2498]}, {"w": "millions", "b": [0.1651, 0.2301, 0.2478, 0.2498]}, {"w": "of", "b": [0.2542, 0.2301, 0.2752, 0.2498]}, {"w": "English", "b": [0.2815, 0.2301, 0.3586, 0.2498]}, {"w": "tokens,", "b": [0.3649, 0.2301, 0.437, 0.2498]}, {"w": "obtained", "b": [0.4433, 0.2301, 0.5302, 0.2498]}, {"w": "from", "b": [0.5365, 0.2301, 0.5855, 0.2498]}, {"w": "Wikipedia", "b": [0.5918, 0.2301, 0.6959, 0.2498]}, {"w": "data", "b": [0.7022, 0.2301, 0.7442, 0.2498]}, {"w": "and", "b": [0.7505, 0.2301, 0.787, 0.2498]}, {"w": "Common", "b": [0.1294, 0.2506, 0.2233, 0.2703]}, {"w": "Crawl", "b": [0.2296, 0.2506, 0.2913, 0.2703]}, {"w": "data.", "b": [0.2976, 0.2506, 0.3459, 0.2703]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s look at how you can get started using GloVe embeddings in a Keras model. The same method is valid for Word2vec embeddings or any other word-embedding database. You’ll also use this example to refresh the text-tokenization techniques introduced a few paragraphs ago: you’ll start from raw text and work your way up.", "words": [{"w": "Let’s", "b": [0.1294, 0.2934, 0.1798, 0.3131]}, {"w": "look", "b": [0.1862, 0.2934, 0.231, 0.3131]}, {"w": "at", "b": [0.2373, 0.2934, 0.2555, 0.3131]}, {"w": "how", "b": [0.2618, 0.2934, 0.3053, 0.3131]}, {"w": "you", "b": [0.3116, 0.2934, 0.3494, 0.3131]}, {"w": "can", "b": [0.3557, 0.2934, 0.3907, 0.3131]}, {"w": "get", "b": [0.397, 0.2934, 0.4279, 0.3131]}, {"w": "started", "b": [0.4342, 0.2934, 0.5014, 0.3131]}, {"w": "using", "b": [0.5077, 0.2934, 0.5624, 0.3131]}, {"w": "GloVe", "b": [0.5687, 0.2934, 0.6331, 0.3131]}, {"w": "embeddings", "b": [0.6394, 0.2934, 0.7614, 0.3131]}, {"w": "in", "b": [0.7677, 0.2934, 0.7873, 0.3131]}, {"w": "a", "b": [0.7936, 0.2934, 0.8048, 0.3131]}, {"w": "Keras", "b": [0.8111, 0.2934, 0.8699, 0.3131]}, {"w": "model.", "b": [0.1294, 0.3139, 0.1988, 0.3336]}, {"w": "The", "b": [0.2051, 0.3139, 0.2443, 0.3336]}, {"w": "same", "b": [0.2506, 0.3139, 0.3025, 0.3336]}, {"w": "method", "b": [0.3088, 0.3139, 0.3844, 0.3336]}, {"w": "is", "b": [0.3908, 0.3139, 0.4076, 0.3336]}, {"w": "valid", "b": [0.4139, 0.3139, 0.4643, 0.3336]}, {"w": "for", "b": [0.4706, 0.3139, 0.5001, 0.3336]}, {"w": "Word2vec", "b": [0.5064, 0.3139, 0.6093, 0.3336]}, {"w": "embeddings", "b": [0.6157, 0.3139, 0.7376, 0.3336]}, {"w": "or", "b": [0.7439, 0.3139, 0.7649, 0.3336]}, {"w": "any", "b": [0.7712, 0.3139, 0.8076, 0.3336]}, {"w": "other", "b": [0.8139, 0.3139, 0.8657, 0.3336]}, {"w": "word-embedding", "b": [0.1294, 0.3344, 0.3018, 0.3541]}, {"w": "database.", "b": [0.3081, 0.3344, 0.4012, 0.3541]}, {"w": "You’ll", "b": [0.4075, 0.3344, 0.4708, 0.3541]}, {"w": "also", "b": [0.4771, 0.3344, 0.5178, 0.3541]}, {"w": "use", "b": [0.5241, 0.3344, 0.5577, 0.3541]}, {"w": "this", "b": [0.564, 0.3344, 0.6005, 0.3541]}, {"w": "example", "b": [0.6068, 0.3344, 0.6922, 0.3541]}, {"w": "to", "b": [0.6986, 0.3344, 0.7182, 0.3541]}, {"w": "refresh", "b": [0.7245, 0.3344, 0.7945, 0.3541]}, {"w": "the", "b": [0.8008, 0.3344, 0.8316, 0.3541]}, {"w": "text-tokenization", "b": [0.1294, 0.3549, 0.3004, 0.3746]}, {"w": "techniques", "b": [0.3067, 0.3549, 0.4146, 0.3746]}, {"w": "introduced", "b": [0.4209, 0.3549, 0.5288, 0.3746]}, {"w": "a", "b": [0.535, 0.3549, 0.5462, 0.3746]}, {"w": "few", "b": [0.5525, 0.3549, 0.5903, 0.3746]}, {"w": "paragraphs", "b": [0.5966, 0.3549, 0.7073, 0.3746]}, {"w": "ago:", "b": [0.7136, 0.3549, 0.757, 0.3746]}, {"w": "you’ll", "b": [0.7633, 0.3549, 0.8236, 0.3746]}, {"w": "start", "b": [0.1294, 0.3754, 0.1729, 0.3951]}, {"w": "from", "b": [0.1792, 0.3754, 0.2282, 0.3951]}, {"w": "raw", "b": [0.2345, 0.3754, 0.2723, 0.3951]}, {"w": "text", "b": [0.2786, 0.3754, 0.3165, 0.3951]}, {"w": "and", "b": [0.3228, 0.3754, 0.3592, 0.3951]}, {"w": "work", "b": [0.3655, 0.3754, 0.4173, 0.3951]}, {"w": "your", "b": [0.4236, 0.3754, 0.4699, 0.3951]}, {"w": "way", "b": [0.4762, 0.3754, 0.5182, 0.3951]}, {"w": "up.", "b": [0.5245, 0.3754, 0.5561, 0.3951]}]}, {"id": "b_2", "type": "paragraph", "text": "6.1.3. Putting it all together: from raw text to word embeddings", "words": [{"w": "6.1.3.", "b": [0.1294, 0.4226, 0.1862, 0.4423]}, {"w": "Putting", "b": [0.1925, 0.4226, 0.2724, 0.4423]}, {"w": "it", "b": [0.2787, 0.4226, 0.2941, 0.4423]}, {"w": "all", "b": [0.3004, 0.4226, 0.327, 0.4423]}, {"w": "together:", "b": [0.3333, 0.4226, 0.4314, 0.4423]}, {"w": "from", "b": [0.4377, 0.4226, 0.4904, 0.4423]}, {"w": "raw", "b": [0.4967, 0.4226, 0.5388, 0.4423]}, {"w": "text", "b": [0.5451, 0.4226, 0.5857, 0.4423]}, {"w": "to", "b": [0.592, 0.4226, 0.613, 0.4423]}, {"w": "word", "b": [0.6193, 0.4226, 0.6754, 0.4423]}, {"w": "embeddings", "b": [0.6817, 0.4226, 0.8106, 0.4423]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ll use a model similar to the one we just went over: embedding sentences in sequences of vectors, flattening them, and training a Dense layer on top. But you’ll do so using pretrained word embeddings; and instead of using the pretokenized IMDB data packaged in Keras, you’ll start from scratch by downloading the original text data.", "words": [{"w": "You’ll", "b": [0.1294, 0.4654, 0.1928, 0.4851]}, {"w": "use", "b": [0.1991, 0.4654, 0.2327, 0.4851]}, {"w": "a", "b": [0.239, 0.4654, 0.2502, 0.4851]}, {"w": "model", "b": [0.2565, 0.4654, 0.3196, 0.4851]}, {"w": "similar", "b": [0.3259, 0.4654, 0.3959, 0.4851]}, {"w": "to", "b": [0.4023, 0.4654, 0.4219, 0.4851]}, {"w": "the", "b": [0.4282, 0.4654, 0.459, 0.4851]}, {"w": "one", "b": [0.4653, 0.4654, 0.5017, 0.4851]}, {"w": "we", "b": [0.5081, 0.4654, 0.5375, 0.4851]}, {"w": "just", "b": [0.5438, 0.4654, 0.5802, 0.4851]}, {"w": "went", "b": [0.5865, 0.4654, 0.6356, 0.4851]}, {"w": "over:", "b": [0.6419, 0.4654, 0.6937, 0.4851]}, {"w": "embedding", "b": [0.7, 0.4654, 0.8121, 0.4851]}, {"w": "sentences", "b": [0.1294, 0.4859, 0.2261, 0.5056]}, {"w": "in", "b": [0.2324, 0.4859, 0.252, 0.5056]}, {"w": "sequences", "b": [0.2583, 0.4859, 0.3606, 0.5056]}, {"w": "of", "b": [0.3669, 0.4859, 0.3879, 0.5056]}, {"w": "vectors,", "b": [0.3942, 0.4859, 0.4734, 0.5056]}, {"w": "flattening", "b": [0.4797, 0.4859, 0.5764, 0.5056]}, {"w": "them,", "b": [0.5827, 0.4859, 0.6394, 0.5056]}, {"w": "and", "b": [0.6457, 0.4859, 0.6822, 0.5056]}, {"w": "training", "b": [0.6884, 0.4859, 0.7669, 0.5056]}, {"w": "a", "b": [0.7732, 0.4859, 0.7844, 0.5056]}, {"w": "Dense", "b": [0.7906, 0.4869, 0.8663, 0.5071]}, {"w": "layer", "b": [0.1294, 0.5073, 0.1798, 0.527]}, {"w": "on", "b": [0.1861, 0.5073, 0.2114, 0.527]}, {"w": "top.", "b": [0.2177, 0.5073, 0.2562, 0.527]}, {"w": "But", "b": [0.2625, 0.5073, 0.299, 0.527]}, {"w": "you’ll", "b": [0.3053, 0.5073, 0.3656, 0.527]}, {"w": "do", "b": [0.3719, 0.5073, 0.3971, 0.527]}, {"w": "so", "b": [0.4033, 0.5073, 0.4258, 0.527]}, {"w": "using", "b": [0.4321, 0.5073, 0.4867, 0.527]}, {"w": "pretrained", "b": [0.4931, 0.5073, 0.5953, 0.527]}, {"w": "word", "b": [0.6016, 0.5073, 0.6535, 0.527]}, {"w": "embeddings;", "b": [0.6598, 0.5073, 0.7887, 0.527]}, {"w": "and", "b": [0.795, 0.5073, 0.8314, 0.527]}, {"w": "instead", "b": [0.1294, 0.5278, 0.2009, 0.5475]}, {"w": "of", "b": [0.2072, 0.5278, 0.2282, 0.5475]}, {"w": "using", "b": [0.2345, 0.5278, 0.2892, 0.5475]}, {"w": "the", "b": [0.2955, 0.5278, 0.3263, 0.5475]}, {"w": "pretokenized", "b": [0.3326, 0.5278, 0.4629, 0.5475]}, {"w": "IMDB", "b": [0.4692, 0.5278, 0.5351, 0.5475]}, {"w": "data", "b": [0.5414, 0.5278, 0.5834, 0.5475]}, {"w": "packaged", "b": [0.5897, 0.5278, 0.685, 0.5475]}, {"w": "in", "b": [0.6913, 0.5278, 0.7109, 0.5475]}, {"w": "Keras,", "b": [0.7172, 0.5278, 0.7823, 0.5475]}, {"w": "you’ll", "b": [0.7886, 0.5278, 0.8489, 0.5475]}, {"w": "start", "b": [0.1294, 0.5483, 0.1729, 0.568]}, {"w": "from", "b": [0.1792, 0.5483, 0.2282, 0.568]}, {"w": "scratch", "b": [0.2345, 0.5483, 0.3059, 0.568]}, {"w": "by", "b": [0.3122, 0.5483, 0.3374, 0.568]}, {"w": "downloading", "b": [0.3438, 0.5483, 0.4755, 0.568]}, {"w": "the", "b": [0.4818, 0.5483, 0.5126, 0.568]}, {"w": "original", "b": [0.5189, 0.5483, 0.5974, 0.568]}, {"w": "text", "b": [0.6037, 0.5483, 0.6415, 0.568]}, {"w": "data.", "b": [0.6478, 0.5483, 0.6962, 0.568]}]}, {"id": "b_4", "type": "paragraph", "text": "Downloading the IMDB data as raw text", "words": [{"w": "Downloading", "b": [0.1294, 0.5861, 0.2366, 0.6009]}, {"w": "the", "b": [0.2414, 0.5861, 0.2666, 0.6009]}, {"w": "IMDB", "b": [0.2713, 0.5861, 0.3228, 0.6009]}, {"w": "data", "b": [0.3276, 0.5861, 0.3633, 0.6009]}, {"w": "as", "b": [0.368, 0.5861, 0.3848, 0.6009]}, {"w": "raw", "b": [0.3896, 0.5861, 0.4211, 0.6009]}, {"w": "text", "b": [0.4258, 0.5861, 0.4563, 0.6009]}]}, {"id": "b_5", "type": "paragraph", "text": "First, head to http://mng.bz/0tIo and download the raw IMDB dataset. Uncompress it.", "words": [{"w": "First,", "b": [0.1294, 0.624, 0.182, 0.6438]}, {"w": "head", "b": [0.1883, 0.624, 0.2359, 0.6438]}, {"w": "to", "b": [0.2422, 0.624, 0.2618, 0.6438]}, {"w": "http://mng.bz/0tIo", "b": [0.2681, 0.624, 0.451, 0.6438]}, {"w": "and", "b": [0.4573, 0.624, 0.4937, 0.6438]}, {"w": "download", "b": [0.5, 0.624, 0.5995, 0.6438]}, {"w": "the", "b": [0.6058, 0.624, 0.6367, 0.6438]}, {"w": "raw", "b": [0.643, 0.624, 0.6808, 0.6438]}, {"w": "IMDB", "b": [0.6871, 0.624, 0.753, 0.6438]}, {"w": "dataset.", "b": [0.7593, 0.624, 0.8356, 0.6438]}, {"w": "Uncompress", "b": [0.1294, 0.6445, 0.2555, 0.6643]}, {"w": "it.", "b": [0.2618, 0.6445, 0.2822, 0.6643]}]}, {"id": "b_6", "type": "paragraph", "text": "Now, let’s collect the individual training reviews into a list of strings, one string per review. You’ll also collect the review labels (positive/negative) into a labels list.", "words": [{"w": "Now,", "b": [0.1294, 0.6873, 0.1831, 0.7071]}, {"w": "let’s", "b": [0.1894, 0.6873, 0.2315, 0.7071]}, {"w": "collect", "b": [0.2378, 0.6873, 0.305, 0.7071]}, {"w": "the", "b": [0.3113, 0.6873, 0.3422, 0.7071]}, {"w": "individual", "b": [0.3485, 0.6873, 0.4508, 0.7071]}, {"w": "training", "b": [0.4571, 0.6873, 0.5356, 0.7071]}, {"w": "reviews", "b": [0.5419, 0.6873, 0.6203, 0.7071]}, {"w": "into", "b": [0.6266, 0.6873, 0.6659, 0.7071]}, {"w": "a", "b": [0.6722, 0.6873, 0.6834, 0.7071]}, {"w": "list", "b": [0.6897, 0.6873, 0.7205, 0.7071]}, {"w": "of", "b": [0.7269, 0.6873, 0.7479, 0.7071]}, {"w": "strings,", "b": [0.7542, 0.6873, 0.8278, 0.7071]}, {"w": "one", "b": [0.8341, 0.6873, 0.8705, 0.7071]}, {"w": "string", "b": [0.1294, 0.7078, 0.1869, 0.7276]}, {"w": "per", "b": [0.1932, 0.7078, 0.2254, 0.7276]}, {"w": "review.", "b": [0.2317, 0.7078, 0.305, 0.7276]}, {"w": "You’ll", "b": [0.3113, 0.7078, 0.3746, 0.7276]}, {"w": "also", "b": [0.381, 0.7078, 0.4216, 0.7276]}, {"w": "collect", "b": [0.4279, 0.7078, 0.4951, 0.7276]}, {"w": "the", "b": [0.5015, 0.7078, 0.5323, 0.7276]}, {"w": "review", "b": [0.5385, 0.7078, 0.6072, 0.7276]}, {"w": "labels", "b": [0.6135, 0.7078, 0.6723, 0.7276]}, {"w": "(positive/negative)", "b": [0.6786, 0.7078, 0.8678, 0.7276]}, {"w": "into", "b": [0.1294, 0.7283, 0.1687, 0.7481]}, {"w": "a", "b": [0.175, 0.7283, 0.1862, 0.7481]}, {"w": "labels", "b": [0.1925, 0.7294, 0.2833, 0.7496]}, {"w": "list.", "b": [0.2896, 0.7283, 0.3267, 0.7481]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 6.8. Processing the labels of the raw IMDB data", "words": [{"w": "Listing", "b": [0.1294, 0.767, 0.1862, 0.7819]}, {"w": "6.8.", "b": [0.1909, 0.767, 0.2193, 0.7819]}, {"w": "Processing", "b": [0.224, 0.767, 0.3098, 0.7819]}, {"w": "the", "b": [0.3146, 0.767, 0.3398, 0.7819]}, {"w": "labels", "b": [0.3445, 0.767, 0.3908, 0.7819]}, {"w": "of", "b": [0.3955, 0.767, 0.4113, 0.7819]}, {"w": "the", "b": [0.416, 0.767, 0.4412, 0.7819]}, {"w": "raw", "b": [0.4459, 0.767, 0.4775, 0.7819]}, {"w": "IMDB", "b": [0.4822, 0.767, 0.5337, 0.7819]}, {"w": "data", "b": [0.5384, 0.767, 0.5742, 0.7819]}]}, {"id": "b_8", "type": "paragraph", "text": "import os imdb_dir = '/Users/fchollet/Downloads/aclImdb' train_dir = os.path.join(imdb_dir, 'train') labels = [] texts = []", "words": [{"w": "import", "b": [0.1357, 0.7955, 0.2038, 0.8106]}, {"w": "os", "b": [0.2152, 0.7955, 0.2379, 0.8106]}, {"w": "imdb_dir", "b": [0.1357, 0.8258, 0.2265, 0.8409]}, {"w": "=", "b": [0.2379, 0.8258, 0.2492, 0.8409]}, {"w": "'/Users/fchollet/Downloads/aclImdb'", "b": [0.2606, 0.8258, 0.6579, 0.8409]}, {"w": "train_dir", "b": [0.1357, 0.8409, 0.2379, 0.8561]}, {"w": "=", "b": [0.2492, 0.8409, 0.2606, 0.8561]}, {"w": "os.path.join(imdb_dir,", "b": [0.2719, 0.8409, 0.5217, 0.8561]}, {"w": "'train')", "b": [0.533, 0.8409, 0.6238, 0.8561]}, {"w": "labels", "b": [0.1357, 0.8712, 0.2038, 0.8864]}, {"w": "=", "b": [0.2152, 0.8712, 0.2265, 0.8864]}, {"w": "[]", "b": [0.2379, 0.8712, 0.2606, 0.8864]}, {"w": "texts", "b": [0.1357, 0.8864, 0.1925, 0.9015]}, {"w": "=", "b": [0.2038, 0.8864, 0.2152, 0.9015]}, {"w": "[]", "b": [0.2265, 0.8864, 0.2492, 0.9015]}]}]}, {"page": 252, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "for label_type in ['neg', 'pos']: dir_name = os.path.join(train_dir, label_type) for fname in os.listdir(dir_name): if fname[-4:] == '.txt': f = open(os.path.join(dir_name, fname)) texts.append(f.read()) f.close() if label_type == 'neg': labels.append(0) else: labels.append(1)", "words": [{"w": "for", "b": [0.1357, 0.1002, 0.1698, 0.1154]}, {"w": "label_type", "b": [0.1811, 0.1002, 0.2946, 0.1154]}, {"w": "in", "b": [0.306, 0.1002, 0.3287, 0.1154]}, {"w": "['neg',", "b": [0.34, 0.1002, 0.4195, 0.1154]}, {"w": "'pos']:", "b": [0.4309, 0.1002, 0.5103, 0.1154]}, {"w": "dir_name", "b": [0.1811, 0.1154, 0.2719, 0.1305]}, {"w": "=", "b": [0.2833, 0.1154, 0.2946, 0.1305]}, {"w": "os.path.join(train_dir,", "b": [0.306, 0.1154, 0.5671, 0.1305]}, {"w": "label_type)", "b": [0.5784, 0.1154, 0.7033, 0.1305]}, {"w": "for", "b": [0.1811, 0.1305, 0.2152, 0.1457]}, {"w": "fname", "b": [0.2265, 0.1305, 0.2833, 0.1457]}, {"w": "in", "b": [0.2946, 0.1305, 0.3173, 0.1457]}, {"w": "os.listdir(dir_name):", "b": [0.3287, 0.1305, 0.5671, 0.1457]}, {"w": "if", "b": [0.2265, 0.1457, 0.2492, 0.1608]}, {"w": "fname[-4:]", "b": [0.2606, 0.1457, 0.3741, 0.1608]}, {"w": "==", "b": [0.3855, 0.1457, 0.4082, 0.1608]}, {"w": "'.txt':", "b": [0.4195, 0.1457, 0.499, 0.1608]}, {"w": "f", "b": [0.2719, 0.1608, 0.2833, 0.176]}, {"w": "=", "b": [0.2946, 0.1608, 0.306, 0.176]}, {"w": "open(os.path.join(dir_name,", "b": [0.3173, 0.1608, 0.6238, 0.176]}, {"w": "fname))", "b": [0.6352, 0.1608, 0.7146, 0.176]}, {"w": "texts.append(f.read())", "b": [0.2719, 0.176, 0.5217, 0.1911]}, {"w": "f.close()", "b": [0.2719, 0.1911, 0.3741, 0.2063]}, {"w": "if", "b": [0.2719, 0.2063, 0.2946, 0.2214]}, {"w": "label_type", "b": [0.306, 0.2063, 0.4195, 0.2214]}, {"w": "==", "b": [0.4309, 0.2063, 0.4536, 0.2214]}, {"w": "'neg':", "b": [0.4649, 0.2063, 0.533, 0.2214]}, {"w": "labels.append(0)", "b": [0.3173, 0.2215, 0.499, 0.2366]}, {"w": "else:", "b": [0.2719, 0.2366, 0.3287, 0.2518]}, {"w": "labels.append(1)", "b": [0.3173, 0.2518, 0.499, 0.2669]}]}, {"id": "b_1", "type": "paragraph", "text": "Tokenizing the data", "words": [{"w": "Tokenizing", "b": [0.1294, 0.2804, 0.2181, 0.2952]}, {"w": "the", "b": [0.2228, 0.2804, 0.248, 0.2952]}, {"w": "data", "b": [0.2528, 0.2804, 0.2885, 0.2952]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s vectorize the text and prepare a training and validation split, using the concepts introduced earlier in this section. Because pretrained word embeddings are meant to be particularly useful on problems where little training data is available (otherwise, task-specific embeddings are likely to outperform them), we’ll add the following twist: restricting the training data to the first 200 samples. So you’ll learn to classify movie reviews after looking at just 200 examples.", "words": [{"w": "Let’s", "b": [0.1294, 0.3183, 0.1798, 0.3381]}, {"w": "vectorize", "b": [0.1862, 0.3183, 0.2786, 0.3381]}, {"w": "the", "b": [0.2849, 0.3183, 0.3157, 0.3381]}, {"w": "text", "b": [0.322, 0.3183, 0.3599, 0.3381]}, {"w": "and", "b": [0.3662, 0.3183, 0.4026, 0.3381]}, {"w": "prepare", "b": [0.4089, 0.3183, 0.4845, 0.3381]}, {"w": "a", "b": [0.4909, 0.3183, 0.5021, 0.3381]}, {"w": "training", "b": [0.5084, 0.3183, 0.5868, 0.3381]}, {"w": "and", "b": [0.5931, 0.3183, 0.6296, 0.3381]}, {"w": "validation", "b": [0.6359, 0.3183, 0.7368, 0.3381]}, {"w": "split,", "b": [0.7431, 0.3183, 0.7929, 0.3381]}, {"w": "using", "b": [0.7992, 0.3183, 0.8538, 0.3381]}, {"w": "the", "b": [0.1294, 0.3388, 0.1602, 0.3586]}, {"w": "concepts", "b": [0.1665, 0.3388, 0.2548, 0.3586]}, {"w": "introduced", "b": [0.2611, 0.3388, 0.369, 0.3586]}, {"w": "earlier", "b": [0.3753, 0.3388, 0.4397, 0.3586]}, {"w": "in", "b": [0.446, 0.3388, 0.4657, 0.3586]}, {"w": "this", "b": [0.472, 0.3388, 0.5084, 0.3586]}, {"w": "section.", "b": [0.5147, 0.3388, 0.5925, 0.3586]}, {"w": "Because", "b": [0.5987, 0.3388, 0.6828, 0.3586]}, {"w": "pretrained", "b": [0.6891, 0.3388, 0.7914, 0.3586]}, {"w": "word", "b": [0.7977, 0.3388, 0.8495, 0.3586]}, {"w": "embeddings", "b": [0.1294, 0.3593, 0.2513, 0.3791]}, {"w": "are", "b": [0.2576, 0.3593, 0.2884, 0.3791]}, {"w": "meant", "b": [0.2947, 0.3593, 0.3564, 0.3791]}, {"w": "to", "b": [0.3627, 0.3593, 0.3823, 0.3791]}, {"w": "be", "b": [0.3886, 0.3593, 0.4124, 0.3791]}, {"w": "particularly", "b": [0.4188, 0.3593, 0.535, 0.3791]}, {"w": "useful", "b": [0.5413, 0.3593, 0.603, 0.3791]}, {"w": "on", "b": [0.6093, 0.3593, 0.6345, 0.3791]}, {"w": "problems", "b": [0.6408, 0.3593, 0.7347, 0.3791]}, {"w": "where", "b": [0.741, 0.3593, 0.8027, 0.3791]}, {"w": "little", "b": [0.809, 0.3593, 0.8552, 0.3791]}, {"w": "training", "b": [0.1294, 0.3798, 0.2079, 0.3996]}, {"w": "data", "b": [0.2142, 0.3798, 0.2562, 0.3996]}, {"w": "is", "b": [0.2625, 0.3798, 0.2794, 0.3996]}, {"w": "available", "b": [0.2857, 0.3798, 0.3767, 0.3996]}, {"w": "(otherwise,", "b": [0.383, 0.3798, 0.4958, 0.3996]}, {"w": "task-specific", "b": [0.5021, 0.3798, 0.6296, 0.3996]}, {"w": "embeddings", "b": [0.6359, 0.3798, 0.7578, 0.3996]}, {"w": "are", "b": [0.7641, 0.3798, 0.7949, 0.3996]}, {"w": "likely", "b": [0.8012, 0.3798, 0.8587, 0.3996]}, {"w": "to", "b": [0.1294, 0.4003, 0.149, 0.4201]}, {"w": "outperform", "b": [0.1553, 0.4003, 0.2688, 0.4201]}, {"w": "them),", "b": [0.2751, 0.4003, 0.3403, 0.4201]}, {"w": "we’ll", "b": [0.3466, 0.4003, 0.3984, 0.4201]}, {"w": "add", "b": [0.4048, 0.4003, 0.4412, 0.4201]}, {"w": "the", "b": [0.4475, 0.4003, 0.4783, 0.4201]}, {"w": "following", "b": [0.4846, 0.4003, 0.5827, 0.4201]}, {"w": "twist:", "b": [0.589, 0.4003, 0.6451, 0.4201]}, {"w": "restricting", "b": [0.6514, 0.4003, 0.7537, 0.4201]}, {"w": "the", "b": [0.76, 0.4003, 0.7908, 0.4201]}, {"w": "training", "b": [0.1294, 0.4208, 0.2079, 0.4406]}, {"w": "data", "b": [0.2142, 0.4208, 0.2562, 0.4406]}, {"w": "to", "b": [0.2625, 0.4208, 0.2821, 0.4406]}, {"w": "the", "b": [0.2884, 0.4208, 0.3193, 0.4406]}, {"w": "first", "b": [0.3256, 0.4208, 0.3662, 0.4406]}, {"w": "200", "b": [0.3725, 0.4208, 0.4104, 0.4406]}, {"w": "samples.", "b": [0.4167, 0.4208, 0.5042, 0.4406]}, {"w": "So", "b": [0.5106, 0.4208, 0.5372, 0.4406]}, {"w": "you’ll", "b": [0.5435, 0.4208, 0.6038, 0.4406]}, {"w": "learn", "b": [0.6101, 0.4208, 0.6605, 0.4406]}, {"w": "to", "b": [0.6668, 0.4208, 0.6864, 0.4406]}, {"w": "classify", "b": [0.6927, 0.4208, 0.7698, 0.4406]}, {"w": "movie", "b": [0.7761, 0.4208, 0.8392, 0.4406]}, {"w": "reviews", "b": [0.1294, 0.4413, 0.2079, 0.4611]}, {"w": "after", "b": [0.2142, 0.4413, 0.2604, 0.4611]}, {"w": "looking", "b": [0.2667, 0.4413, 0.3438, 0.4611]}, {"w": "at", "b": [0.3501, 0.4413, 0.3683, 0.4611]}, {"w": "just", "b": [0.3746, 0.4413, 0.4111, 0.4611]}, {"w": "200", "b": [0.4174, 0.4413, 0.4552, 0.4611]}, {"w": "examples.", "b": [0.4615, 0.4413, 0.5631, 0.4611]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.9. Tokenizing the text of the raw IMDB data", "words": [{"w": "Listing", "b": [0.1294, 0.4792, 0.1862, 0.494]}, {"w": "6.9.", "b": [0.1909, 0.4792, 0.2193, 0.494]}, {"w": "Tokenizing", "b": [0.224, 0.4792, 0.3127, 0.494]}, {"w": "the", "b": [0.3174, 0.4792, 0.3426, 0.494]}, {"w": "text", "b": [0.3474, 0.4792, 0.3778, 0.494]}, {"w": "of", "b": [0.3826, 0.4792, 0.3983, 0.494]}, {"w": "the", "b": [0.403, 0.4792, 0.4283, 0.494]}, {"w": "raw", "b": [0.433, 0.4792, 0.4645, 0.494]}, {"w": "IMDB", "b": [0.4692, 0.4792, 0.5207, 0.494]}, {"w": "data", "b": [0.5255, 0.4792, 0.5612, 0.494]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences import numpy as np maxlen = 100 1 training_samples = 200 2 validation_samples = 10000 3 max_words = 10000 4 tokenizer = Tokenizer(num_words=max_words) tokenizer.fit_on_texts(texts) sequences = tokenizer.texts_to_sequences(texts) word_index = tokenizer.word_index print('Found %s unique tokens.' % len(word_index)) data = pad_sequences(sequences, maxlen=maxlen) labels = np.asarray(labels) print('Shape of data tensor:', data.shape) print('Shape of label tensor:', labels.shape) indices = np.arange(data.shape[0]) 5 np.random.shuffle(indices) data = data[indices] labels = labels[indices]", "words": [{"w": "from", "b": [0.1357, 0.5076, 0.1811, 0.5227]}, {"w": "keras.preprocessing.text", "b": [0.1925, 0.5076, 0.4649, 0.5227]}, {"w": "import", "b": [0.4763, 0.5076, 0.5444, 0.5227]}, {"w": "Tokenizer", "b": [0.5557, 0.5076, 0.6579, 0.5227]}, {"w": "from", "b": [0.1357, 0.5227, 0.1811, 0.5379]}, {"w": "keras.preprocessing.sequence", "b": [0.1925, 0.5227, 0.5103, 0.5379]}, {"w": "import", "b": [0.5217, 0.5227, 0.5898, 0.5379]}, {"w": "pad_sequences", "b": [0.6011, 0.5227, 0.7487, 0.5379]}, {"w": "import", "b": [0.1357, 0.5379, 0.2038, 0.553]}, {"w": "numpy", "b": [0.2152, 0.5379, 0.2719, 0.553]}, {"w": "as", "b": [0.2833, 0.5379, 0.306, 0.553]}, {"w": "np", "b": [0.3173, 0.5379, 0.34, 0.553]}, {"w": "maxlen", "b": [0.1357, 0.5682, 0.2038, 0.5833]}, {"w": "=", "b": [0.2152, 0.5682, 0.2265, 0.5833]}, {"w": "100", "b": [0.2379, 0.5682, 0.2719, 0.5833]}, {"w": "1", "b": [0.7602, 0.5682, 0.7715, 0.5833]}, {"w": "training_samples", "b": [0.1357, 0.5833, 0.3173, 0.5985]}, {"w": "=", "b": [0.3287, 0.5833, 0.34, 0.5985]}, {"w": "200", "b": [0.3514, 0.5833, 0.3855, 0.5985]}, {"w": "2", "b": [0.7602, 0.5833, 0.7715, 0.5985]}, {"w": "validation_samples", "b": [0.1357, 0.5985, 0.34, 0.6136]}, {"w": "=", "b": [0.3514, 0.5985, 0.3628, 0.6136]}, {"w": "10000", "b": [0.3741, 0.5985, 0.4309, 0.6136]}, {"w": "3", "b": [0.7602, 0.5985, 0.7715, 0.6136]}, {"w": "max_words", "b": [0.1357, 0.6136, 0.2379, 0.6288]}, {"w": "=", "b": [0.2492, 0.6136, 0.2606, 0.6288]}, {"w": "10000", "b": [0.2719, 0.6136, 0.3287, 0.6288]}, {"w": "4", "b": [0.7602, 0.6136, 0.7715, 0.6288]}, {"w": "tokenizer", "b": [0.1357, 0.6439, 0.2379, 0.6591]}, {"w": "=", "b": [0.2492, 0.6439, 0.2606, 0.6591]}, {"w": "Tokenizer(num_words=max_words)", "b": [0.2719, 0.6439, 0.6125, 0.6591]}, {"w": "tokenizer.fit_on_texts(texts)", "b": [0.1357, 0.6591, 0.4649, 0.6742]}, {"w": "sequences", "b": [0.1357, 0.6742, 0.2379, 0.6894]}, {"w": "=", "b": [0.2492, 0.6742, 0.2606, 0.6894]}, {"w": "tokenizer.texts_to_sequences(texts)", "b": [0.2719, 0.6742, 0.6692, 0.6894]}, {"w": "word_index", "b": [0.1357, 0.7045, 0.2492, 0.7197]}, {"w": "=", "b": [0.2606, 0.7045, 0.2719, 0.7197]}, {"w": "tokenizer.word_index", "b": [0.2833, 0.7045, 0.5103, 0.7197]}, {"w": "print('Found", "b": [0.1357, 0.7197, 0.2719, 0.7348]}, {"w": "%s", "b": [0.2833, 0.7197, 0.306, 0.7348]}, {"w": "unique", "b": [0.3173, 0.7197, 0.3855, 0.7348]}, {"w": "tokens.'", "b": [0.3968, 0.7197, 0.4876, 0.7348]}, {"w": "%", "b": [0.499, 0.7197, 0.5103, 0.7348]}, {"w": "len(word_index))", "b": [0.5217, 0.7197, 0.7033, 0.7348]}, {"w": "data", "b": [0.1357, 0.75, 0.1811, 0.7651]}, {"w": "=", "b": [0.1925, 0.75, 0.2038, 0.7651]}, {"w": "pad_sequences(sequences,", "b": [0.2152, 0.75, 0.4876, 0.7651]}, {"w": "maxlen=maxlen)", "b": [0.499, 0.75, 0.6579, 0.7651]}, {"w": "labels", "b": [0.1357, 0.7803, 0.2038, 0.7955]}, {"w": "=", "b": [0.2152, 0.7803, 0.2265, 0.7955]}, {"w": "np.asarray(labels)", "b": [0.2379, 0.7803, 0.4422, 0.7955]}, {"w": "print('Shape", "b": [0.1357, 0.7955, 0.2719, 0.8106]}, {"w": "of", "b": [0.2833, 0.7955, 0.306, 0.8106]}, {"w": "data", "b": [0.3173, 0.7955, 0.3628, 0.8106]}, {"w": "tensor:',", "b": [0.3741, 0.7955, 0.4763, 0.8106]}, {"w": "data.shape)", "b": [0.4876, 0.7955, 0.6125, 0.8106]}, {"w": "print('Shape", "b": [0.1357, 0.8106, 0.2719, 0.8258]}, {"w": "of", "b": [0.2833, 0.8106, 0.306, 0.8258]}, {"w": "label", "b": [0.3173, 0.8106, 0.3741, 0.8258]}, {"w": "tensor:',", "b": [0.3855, 0.8106, 0.4876, 0.8258]}, {"w": "labels.shape)", "b": [0.499, 0.8106, 0.6465, 0.8258]}, {"w": "indices", "b": [0.1357, 0.8409, 0.2152, 0.8561]}, {"w": "=", "b": [0.2265, 0.8409, 0.2379, 0.8561]}, {"w": "np.arange(data.shape[0])", "b": [0.2492, 0.8409, 0.5217, 0.8561]}, {"w": "5", "b": [0.7602, 0.8409, 0.7715, 0.8561]}, {"w": "np.random.shuffle(indices)", "b": [0.1357, 0.8561, 0.4309, 0.8712]}, {"w": "data", "b": [0.1357, 0.8712, 0.1811, 0.8864]}, {"w": "=", "b": [0.1925, 0.8712, 0.2038, 0.8864]}, {"w": "data[indices]", "b": [0.2152, 0.8712, 0.3628, 0.8864]}, {"w": "labels", "b": [0.1357, 0.8864, 0.2038, 0.9015]}, {"w": "=", "b": [0.2152, 0.8864, 0.2265, 0.9015]}, {"w": "labels[indices]", "b": [0.2379, 0.8864, 0.4082, 0.9015]}]}]}, {"page": 253, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "x_train = data[:training_samples] y_train = labels[:training_samples] x_val = data[training_samples: training_samples + validation_samples] y_val = labels[training_samples: training_samples + validation_samples]", "words": [{"w": "x_train", "b": [0.1357, 0.1002, 0.2152, 0.1154]}, {"w": "=", "b": [0.2265, 0.1002, 0.2379, 0.1154]}, {"w": "data[:training_samples]", "b": [0.2492, 0.1002, 0.5103, 0.1154]}, {"w": "y_train", "b": [0.1357, 0.1154, 0.2152, 0.1305]}, {"w": "=", "b": [0.2265, 0.1154, 0.2379, 0.1305]}, {"w": "labels[:training_samples]", "b": [0.2492, 0.1154, 0.533, 0.1305]}, {"w": "x_val", "b": [0.1357, 0.1305, 0.1925, 0.1457]}, {"w": "=", "b": [0.2038, 0.1305, 0.2152, 0.1457]}, {"w": "data[training_samples:", "b": [0.2265, 0.1305, 0.4763, 0.1457]}, {"w": "training_samples", "b": [0.4876, 0.1305, 0.6692, 0.1457]}, {"w": "+", "b": [0.6806, 0.1305, 0.6919, 0.1457]}, {"w": "validation_samples]", "b": [0.1357, 0.1457, 0.3514, 0.1608]}, {"w": "y_val", "b": [0.1357, 0.1608, 0.1925, 0.176]}, {"w": "=", "b": [0.2038, 0.1608, 0.2152, 0.176]}, {"w": "labels[training_samples:", "b": [0.2265, 0.1608, 0.499, 0.176]}, {"w": "training_samples", "b": [0.5103, 0.1608, 0.6919, 0.176]}, {"w": "+", "b": [0.7033, 0.1608, 0.7146, 0.176]}, {"w": "validation_samples]", "b": [0.1357, 0.176, 0.3514, 0.1911]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Cuts off reviews after 100 words 2 Trains on 200 samples 3 Validates on 10,000 samples 4 Considers only the top 10,000 words in the dataset 5 Splits the data into a training set and a validation set, but first shuffles the data, because you’re starting with data in which samples are ordered (all negative first, then all positive)", "words": [{"w": "1", "b": [0.1799, 0.2096, 0.1925, 0.2293]}, {"w": "Cuts", "b": [0.1988, 0.2096, 0.2492, 0.2293]}, {"w": "off", "b": [0.2555, 0.2096, 0.285, 0.2293]}, {"w": "reviews", "b": [0.2913, 0.2096, 0.3721, 0.2293]}, {"w": "after", "b": [0.3784, 0.2096, 0.4302, 0.2293]}, {"w": "100", "b": [0.4365, 0.2096, 0.4743, 0.2293]}, {"w": "words", "b": [0.4806, 0.2096, 0.5465, 0.2293]}, {"w": "2", "b": [0.1799, 0.2301, 0.1925, 0.2498]}, {"w": "Trains", "b": [0.1988, 0.2301, 0.2684, 0.2498]}, {"w": "on", "b": [0.2747, 0.2301, 0.3013, 0.2498]}, {"w": "200", "b": [0.3077, 0.2301, 0.3455, 0.2498]}, {"w": "samples", "b": [0.3518, 0.2301, 0.4373, 0.2498]}, {"w": "3", "b": [0.1799, 0.2506, 0.1925, 0.2703]}, {"w": "Validates", "b": [0.1988, 0.2506, 0.2974, 0.2703]}, {"w": "on", "b": [0.3037, 0.2506, 0.3303, 0.2703]}, {"w": "10,000", "b": [0.3366, 0.2506, 0.406, 0.2703]}, {"w": "samples", "b": [0.4123, 0.2506, 0.4978, 0.2703]}, {"w": "4", "b": [0.1799, 0.2711, 0.1925, 0.2908]}, {"w": "Considers", "b": [0.1988, 0.2711, 0.3067, 0.2908]}, {"w": "only", "b": [0.313, 0.2711, 0.3593, 0.2908]}, {"w": "the", "b": [0.3656, 0.2711, 0.3992, 0.2908]}, {"w": "top", "b": [0.4055, 0.2711, 0.4405, 0.2908]}, {"w": "10,000", "b": [0.4469, 0.2711, 0.5162, 0.2908]}, {"w": "words", "b": [0.5225, 0.2711, 0.5884, 0.2908]}, {"w": "in", "b": [0.5947, 0.2711, 0.6157, 0.2908]}, {"w": "the", "b": [0.622, 0.2711, 0.6557, 0.2908]}, {"w": "dataset", "b": [0.662, 0.2711, 0.739, 0.2908]}, {"w": "5", "b": [0.1799, 0.2916, 0.1925, 0.3113]}, {"w": "Splits", "b": [0.1988, 0.2916, 0.2591, 0.3113]}, {"w": "the", "b": [0.2654, 0.2916, 0.299, 0.3113]}, {"w": "data", "b": [0.3053, 0.2916, 0.353, 0.3113]}, {"w": "into", "b": [0.3593, 0.2916, 0.4013, 0.3113]}, {"w": "a", "b": [0.4076, 0.2916, 0.4202, 0.3113]}, {"w": "training", "b": [0.4265, 0.2916, 0.5134, 0.3113]}, {"w": "set", "b": [0.5198, 0.2916, 0.5492, 0.3113]}, {"w": "and", "b": [0.5555, 0.2916, 0.5961, 0.3113]}, {"w": "a", "b": [0.6024, 0.2916, 0.6151, 0.3113]}, {"w": "validation", "b": [0.6214, 0.2916, 0.7293, 0.3113]}, {"w": "set,", "b": [0.7356, 0.2916, 0.7713, 0.3113]}, {"w": "but", "b": [0.7776, 0.2916, 0.8141, 0.3113]}, {"w": "first", "b": [0.8204, 0.2916, 0.8652, 0.3113]}, {"w": "shuffles", "b": [0.1799, 0.3121, 0.2626, 0.3318]}, {"w": "the", "b": [0.2689, 0.3121, 0.3025, 0.3318]}, {"w": "data,", "b": [0.3088, 0.3121, 0.3628, 0.3318]}, {"w": "because", "b": [0.3691, 0.3121, 0.4531, 0.3318]}, {"w": "you’re", "b": [0.4594, 0.3121, 0.529, 0.3318]}, {"w": "starting", "b": [0.5354, 0.3121, 0.6194, 0.3318]}, {"w": "with", "b": [0.6257, 0.3121, 0.6734, 0.3318]}, {"w": "data", "b": [0.6797, 0.3121, 0.7273, 0.3318]}, {"w": "in", "b": [0.7336, 0.3121, 0.7547, 0.3318]}, {"w": "which", "b": [0.761, 0.3121, 0.8255, 0.3318]}, {"w": "samples", "b": [0.1799, 0.3326, 0.2654, 0.3523]}, {"w": "are", "b": [0.2717, 0.3326, 0.3062, 0.3523]}, {"w": "ordered", "b": [0.3125, 0.3326, 0.3975, 0.3523]}, {"w": "(all", "b": [0.4038, 0.3326, 0.4389, 0.3523]}, {"w": "negative", "b": [0.4452, 0.3326, 0.5349, 0.3523]}, {"w": "first,", "b": [0.5412, 0.3326, 0.5923, 0.3523]}, {"w": "then", "b": [0.5986, 0.3326, 0.6462, 0.3523]}, {"w": "all", "b": [0.6526, 0.3326, 0.6792, 0.3523]}, {"w": "positive)", "b": [0.6855, 0.3326, 0.7766, 0.3523]}]}, {"id": "b_2", "type": "paragraph", "text": "Downloading the GloVe word embeddings", "words": [{"w": "Downloading", "b": [0.1294, 0.3704, 0.2366, 0.3852]}, {"w": "the", "b": [0.2414, 0.3704, 0.2666, 0.3852]}, {"w": "GloVe", "b": [0.2713, 0.3704, 0.3211, 0.3852]}, {"w": "word", "b": [0.3258, 0.3704, 0.3679, 0.3852]}, {"w": "embeddings", "b": [0.3726, 0.3704, 0.4693, 0.3852]}]}, {"id": "b_3", "type": "paragraph", "text": "Go to https://nlp.stanford.edu/projects/glove, and download the precomputed embeddings from 2014 English Wikipedia. It’s an 822 MB zip file called glove.6B.zip, containing 100-dimensional embedding vectors for 400,000 words (or nonword tokens). Unzip it.", "words": [{"w": "Go", "b": [0.1294, 0.4083, 0.1602, 0.4281]}, {"w": "to", "b": [0.1665, 0.4083, 0.1862, 0.4281]}, {"w": "https://nlp.stanford.edu/projects/glove,", "b": [0.1925, 0.4083, 0.5827, 0.4281]}, {"w": "and", "b": [0.589, 0.4083, 0.6254, 0.4281]}, {"w": "download", "b": [0.6317, 0.4083, 0.7312, 0.4281]}, {"w": "the", "b": [0.7375, 0.4083, 0.7684, 0.4281]}, {"w": "precomputed", "b": [0.1294, 0.4288, 0.2611, 0.4486]}, {"w": "embeddings", "b": [0.2674, 0.4288, 0.3893, 0.4486]}, {"w": "from", "b": [0.3956, 0.4288, 0.4447, 0.4486]}, {"w": "2014", "b": [0.451, 0.4288, 0.5014, 0.4486]}, {"w": "English", "b": [0.5077, 0.4288, 0.5848, 0.4486]}, {"w": "Wikipedia.", "b": [0.5911, 0.4288, 0.7015, 0.4486]}, {"w": "It’s", "b": [0.7078, 0.4288, 0.74, 0.4486]}, {"w": "an", "b": [0.7463, 0.4288, 0.7701, 0.4486]}, {"w": "822", "b": [0.7764, 0.4288, 0.8143, 0.4486]}, {"w": "MB", "b": [0.8206, 0.4288, 0.8598, 0.4486]}, {"w": "zip", "b": [0.1294, 0.4493, 0.1602, 0.4691]}, {"w": "file", "b": [0.1665, 0.4493, 0.2002, 0.4691]}, {"w": "called", "b": [0.2065, 0.4493, 0.2667, 0.4691]}, {"w": "glove.6B.zip,", "b": [0.273, 0.4493, 0.4083, 0.4691]}, {"w": "containing", "b": [0.4146, 0.4493, 0.5211, 0.4691]}, {"w": "100-dimensional", "b": [0.5273, 0.4493, 0.6969, 0.4691]}, {"w": "embedding", "b": [0.7032, 0.4493, 0.8153, 0.4691]}, {"w": "vectors", "b": [0.1294, 0.4698, 0.2023, 0.4896]}, {"w": "for", "b": [0.2086, 0.4698, 0.238, 0.4896]}, {"w": "400,000", "b": [0.2443, 0.4698, 0.3263, 0.4896]}, {"w": "words", "b": [0.3326, 0.4698, 0.3942, 0.4896]}, {"w": "(or", "b": [0.4005, 0.4698, 0.43, 0.4896]}, {"w": "nonword", "b": [0.4363, 0.4698, 0.5259, 0.4896]}, {"w": "tokens).", "b": [0.5322, 0.4698, 0.6128, 0.4896]}, {"w": "Unzip", "b": [0.6191, 0.4698, 0.6808, 0.4896]}, {"w": "it.", "b": [0.6871, 0.4698, 0.7074, 0.4896]}]}, {"id": "b_4", "type": "paragraph", "text": "Preprocessing the embeddings", "words": [{"w": "Preprocessing", "b": [0.1294, 0.5077, 0.2422, 0.5225]}, {"w": "the", "b": [0.2469, 0.5077, 0.2722, 0.5225]}, {"w": "embeddings", "b": [0.2769, 0.5077, 0.3736, 0.5225]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s parse the unzipped file (a .txt file) to build an index that maps words (as strings) to their vector representation (as number vectors).", "words": [{"w": "Let’s", "b": [0.1294, 0.5456, 0.1798, 0.5653]}, {"w": "parse", "b": [0.1862, 0.5456, 0.2394, 0.5653]}, {"w": "the", "b": [0.2457, 0.5456, 0.2765, 0.5653]}, {"w": "unzipped", "b": [0.2828, 0.5456, 0.3753, 0.5653]}, {"w": "file", "b": [0.3816, 0.5456, 0.4152, 0.5653]}, {"w": "(a", "b": [0.4215, 0.5456, 0.4411, 0.5653]}, {"w": ".txt", "b": [0.4474, 0.5456, 0.4804, 0.5653]}, {"w": "file)", "b": [0.4867, 0.5456, 0.5287, 0.5653]}, {"w": "to", "b": [0.535, 0.5456, 0.5547, 0.5653]}, {"w": "build", "b": [0.561, 0.5456, 0.6128, 0.5653]}, {"w": "an", "b": [0.6191, 0.5456, 0.6429, 0.5653]}, {"w": "index", "b": [0.6492, 0.5456, 0.7053, 0.5653]}, {"w": "that", "b": [0.7116, 0.5456, 0.7494, 0.5653]}, {"w": "maps", "b": [0.7558, 0.5456, 0.809, 0.5653]}, {"w": "words", "b": [0.1294, 0.5661, 0.1911, 0.5858]}, {"w": "(as", "b": [0.1974, 0.5661, 0.2268, 0.5858]}, {"w": "strings)", "b": [0.2331, 0.5661, 0.3088, 0.5858]}, {"w": "to", "b": [0.3151, 0.5661, 0.3347, 0.5858]}, {"w": "their", "b": [0.341, 0.5661, 0.3872, 0.5858]}, {"w": "vector", "b": [0.3936, 0.5661, 0.4566, 0.5858]}, {"w": "representation", "b": [0.4629, 0.5661, 0.6058, 0.5858]}, {"w": "(as", "b": [0.6121, 0.5661, 0.6415, 0.5858]}, {"w": "number", "b": [0.6478, 0.5661, 0.7248, 0.5858]}, {"w": "vectors).", "b": [0.7311, 0.5661, 0.8187, 0.5858]}]}, {"id": "b_6", "type": "equation", "text": "Listing 6.10. Parsing the GloVe word-embeddings file", "words": [{"w": "Listing", "b": [0.1294, 0.6039, 0.1862, 0.6187]}, {"w": "6.10.", "b": [0.1909, 0.6039, 0.2288, 0.6187]}, {"w": "Parsing", "b": [0.2335, 0.6039, 0.2955, 0.6187]}, {"w": "the", "b": [0.3002, 0.6039, 0.3254, 0.6187]}, {"w": "GloVe", "b": [0.3302, 0.6039, 0.3799, 0.6187]}, {"w": "word-embeddings", "b": [0.3847, 0.6039, 0.5297, 0.6187]}, {"w": "file", "b": [0.5344, 0.6039, 0.5597, 0.6187]}]}, {"id": "b_7", "type": "paragraph", "text": "glove_dir = '/Users/fchollet/Downloads/glove.6B' embeddings_index = {} f = open(os.path.join(glove_dir, 'glove.6B.100d.txt')) for line in f: values = line.split() word = values[0] coefs = np.asarray(values[1:], dtype='float32') embeddings_index[word] = coefs f.close() print('Found %s word vectors.' % len(embeddings_index))", "words": [{"w": "glove_dir", "b": [0.1357, 0.6324, 0.2379, 0.6475]}, {"w": "=", "b": [0.2492, 0.6324, 0.2606, 0.6475]}, {"w": "'/Users/fchollet/Downloads/glove.6B'", "b": [0.2719, 0.6324, 0.6806, 0.6475]}, {"w": "embeddings_index", "b": [0.1357, 0.6627, 0.3173, 0.6778]}, {"w": "=", "b": [0.3287, 0.6627, 0.34, 0.6778]}, {"w": "{}", "b": [0.3514, 0.6627, 0.3741, 0.6778]}, {"w": "f", "b": [0.1357, 0.6778, 0.1471, 0.693]}, {"w": "=", "b": [0.1584, 0.6778, 0.1698, 0.693]}, {"w": "open(os.path.join(glove_dir,", "b": [0.1811, 0.6778, 0.499, 0.693]}, {"w": "'glove.6B.100d.txt'))", "b": [0.5103, 0.6778, 0.7487, 0.693]}, {"w": "for", "b": [0.1357, 0.693, 0.1698, 0.7081]}, {"w": "line", "b": [0.1811, 0.693, 0.2265, 0.7081]}, {"w": "in", "b": [0.2379, 0.693, 0.2606, 0.7081]}, {"w": "f:", "b": [0.2719, 0.693, 0.2946, 0.7081]}, {"w": "values", "b": [0.1811, 0.7081, 0.2492, 0.7233]}, {"w": "=", "b": [0.2606, 0.7081, 0.2719, 0.7233]}, {"w": "line.split()", "b": [0.2833, 0.7081, 0.4195, 0.7233]}, {"w": "word", "b": [0.1811, 0.7233, 0.2265, 0.7384]}, {"w": "=", "b": [0.2379, 0.7233, 0.2492, 0.7384]}, {"w": "values[0]", "b": [0.2606, 0.7233, 0.3628, 0.7384]}, {"w": "coefs", "b": [0.1811, 0.7384, 0.2379, 0.7536]}, {"w": "=", "b": [0.2492, 0.7384, 0.2606, 0.7536]}, {"w": "np.asarray(values[1:],", "b": [0.2719, 0.7384, 0.5217, 0.7536]}, {"w": "dtype='float32')", "b": [0.533, 0.7384, 0.7146, 0.7536]}, {"w": "embeddings_index[word]", "b": [0.1811, 0.7536, 0.4309, 0.7687]}, {"w": "=", "b": [0.4422, 0.7536, 0.4536, 0.7687]}, {"w": "coefs", "b": [0.4649, 0.7536, 0.5217, 0.7687]}, {"w": "f.close()", "b": [0.1357, 0.7687, 0.2379, 0.7839]}, {"w": "print('Found", "b": [0.1357, 0.799, 0.2719, 0.8142]}, {"w": "%s", "b": [0.2833, 0.799, 0.306, 0.8142]}, {"w": "word", "b": [0.3173, 0.799, 0.3628, 0.8142]}, {"w": "vectors.'", "b": [0.3741, 0.799, 0.4763, 0.8142]}, {"w": "%", "b": [0.4876, 0.799, 0.499, 0.8142]}, {"w": "len(embeddings_index))", "b": [0.5103, 0.799, 0.7601, 0.8142]}]}, {"id": "b_8", "type": "paragraph", "text": "Next, you’ll build an embedding matrix that you can load into an Embedding layer. It must be a matrix of shape (max_words, embedding_dim), where each entry i contains the", "words": [{"w": "Next,", "b": [0.1294, 0.8371, 0.1848, 0.8568]}, {"w": "you’ll", "b": [0.1911, 0.8371, 0.2513, 0.8568]}, {"w": "build", "b": [0.2576, 0.8371, 0.3095, 0.8568]}, {"w": "an", "b": [0.3158, 0.8371, 0.3396, 0.8568]}, {"w": "embedding", "b": [0.3459, 0.8371, 0.458, 0.8568]}, {"w": "matrix", "b": [0.4643, 0.8371, 0.5302, 0.8568]}, {"w": "that", "b": [0.5365, 0.8371, 0.5743, 0.8568]}, {"w": "you", "b": [0.5807, 0.8371, 0.6185, 0.8568]}, {"w": "can", "b": [0.6248, 0.8371, 0.6598, 0.8568]}, {"w": "load", "b": [0.6661, 0.8371, 0.7096, 0.8568]}, {"w": "into", "b": [0.7159, 0.8371, 0.7551, 0.8568]}, {"w": "an", "b": [0.7614, 0.8371, 0.7852, 0.8568]}, {"w": "Embedding", "b": [0.1294, 0.8586, 0.2656, 0.8788]}, {"w": "layer.", "b": [0.272, 0.8576, 0.3273, 0.8773]}, {"w": "It", "b": [0.3336, 0.8576, 0.349, 0.8773]}, {"w": "must", "b": [0.3553, 0.8576, 0.4044, 0.8773]}, {"w": "be", "b": [0.4107, 0.8576, 0.4345, 0.8773]}, {"w": "a", "b": [0.4408, 0.8576, 0.452, 0.8773]}, {"w": "matrix", "b": [0.4583, 0.8576, 0.5242, 0.8773]}, {"w": "of", "b": [0.5305, 0.8576, 0.5515, 0.8773]}, {"w": "shape", "b": [0.5578, 0.8576, 0.6152, 0.8773]}, {"w": "(max_words,", "b": [0.6215, 0.8586, 0.788, 0.8788]}, {"w": "embedding_dim),", "b": [0.1294, 0.8789, 0.3476, 0.9002]}, {"w": "where", "b": [0.3539, 0.8789, 0.4156, 0.8987]}, {"w": "each", "b": [0.4219, 0.8789, 0.4681, 0.8987]}, {"w": "entry", "b": [0.4744, 0.8789, 0.5262, 0.8987]}, {"w": "i", "b": [0.5325, 0.8789, 0.5395, 0.8987]}, {"w": "contains", "b": [0.5458, 0.8789, 0.6299, 0.8987]}, {"w": "the", "b": [0.6362, 0.8789, 0.667, 0.8987]}]}]}, {"page": 254, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "embedding_dim-dimensional vector for the word of index i in the reference word index (built during tokenization). Note that index 0 isn’t supposed to stand for any word or token—it’s a placeholder.", "words": [{"w": "embedding_dim-dimensional", "b": [0.1294, 0.0857, 0.4579, 0.1069]}, {"w": "vector", "b": [0.4642, 0.0857, 0.5273, 0.1054]}, {"w": "for", "b": [0.5336, 0.0857, 0.563, 0.1054]}, {"w": "the", "b": [0.5693, 0.0857, 0.6001, 0.1054]}, {"w": "word", "b": [0.6064, 0.0857, 0.6583, 0.1054]}, {"w": "of", "b": [0.6646, 0.0857, 0.6856, 0.1054]}, {"w": "index", "b": [0.6919, 0.0857, 0.7479, 0.1054]}, {"w": "i", "b": [0.7542, 0.0857, 0.7612, 0.1054]}, {"w": "in", "b": [0.7675, 0.0857, 0.7871, 0.1054]}, {"w": "the", "b": [0.7934, 0.0857, 0.8243, 0.1054]}, {"w": "reference", "b": [0.1294, 0.1071, 0.2232, 0.1268]}, {"w": "word", "b": [0.2295, 0.1071, 0.2814, 0.1268]}, {"w": "index", "b": [0.2877, 0.1071, 0.3437, 0.1268]}, {"w": "(built", "b": [0.35, 0.1071, 0.4047, 0.1268]}, {"w": "during", "b": [0.411, 0.1071, 0.4769, 0.1268]}, {"w": "tokenization).", "b": [0.4832, 0.1071, 0.6226, 0.1268]}, {"w": "Note", "b": [0.6289, 0.1071, 0.6779, 0.1268]}, {"w": "that", "b": [0.6843, 0.1071, 0.7221, 0.1268]}, {"w": "index", "b": [0.7284, 0.1071, 0.7844, 0.1268]}, {"w": "0", "b": [0.7908, 0.1071, 0.8034, 0.1268]}, {"w": "isn’t", "b": [0.8097, 0.1071, 0.854, 0.1268]}, {"w": "supposed", "b": [0.1294, 0.1276, 0.2233, 0.1473]}, {"w": "to", "b": [0.2296, 0.1276, 0.2492, 0.1473]}, {"w": "stand", "b": [0.2555, 0.1276, 0.3088, 0.1473]}, {"w": "for", "b": [0.3151, 0.1276, 0.3445, 0.1473]}, {"w": "any", "b": [0.3508, 0.1276, 0.3872, 0.1473]}, {"w": "word", "b": [0.3936, 0.1276, 0.4454, 0.1473]}, {"w": "or", "b": [0.4517, 0.1276, 0.4727, 0.1473]}, {"w": "token—it’s", "b": [0.479, 0.1276, 0.5911, 0.1473]}, {"w": "a", "b": [0.5974, 0.1276, 0.6086, 0.1473]}, {"w": "placeholder.", "b": [0.6149, 0.1276, 0.7375, 0.1473]}]}, {"id": "b_1", "type": "equation", "text": "Listing 6.11. Preparing the GloVe word-embeddings matrix", "words": [{"w": "Listing", "b": [0.1294, 0.1654, 0.1862, 0.1802]}, {"w": "6.11.", "b": [0.1909, 0.1654, 0.2277, 0.1802]}, {"w": "Preparing", "b": [0.2324, 0.1654, 0.3141, 0.1802]}, {"w": "the", "b": [0.3188, 0.1654, 0.344, 0.1802]}, {"w": "GloVe", "b": [0.3487, 0.1654, 0.3985, 0.1802]}, {"w": "word-embeddings", "b": [0.4032, 0.1654, 0.5483, 0.1802]}, {"w": "matrix", "b": [0.553, 0.1654, 0.6076, 0.1802]}]}, {"id": "b_2", "type": "paragraph", "text": "embedding_dim = 100 embedding_matrix = np.zeros((max_words, embedding_dim)) for word, i in word_index.items(): if i < max_words: embedding_vector = embeddings_index.get(word) if embedding_vector is not None: embedding_matrix[i] = embedding_vector 1", "words": [{"w": "embedding_dim", "b": [0.1357, 0.1938, 0.2833, 0.209]}, {"w": "=", "b": [0.2946, 0.1938, 0.306, 0.209]}, {"w": "100", "b": [0.3173, 0.1938, 0.3514, 0.209]}, {"w": "embedding_matrix", "b": [0.1357, 0.2241, 0.3173, 0.2393]}, {"w": "=", "b": [0.3287, 0.2241, 0.34, 0.2393]}, {"w": "np.zeros((max_words,", "b": [0.3514, 0.2241, 0.5784, 0.2393]}, {"w": "embedding_dim))", "b": [0.5898, 0.2241, 0.7601, 0.2393]}, {"w": "for", "b": [0.1357, 0.2393, 0.1698, 0.2544]}, {"w": "word,", "b": [0.1811, 0.2393, 0.2379, 0.2544]}, {"w": "i", "b": [0.2492, 0.2393, 0.2606, 0.2544]}, {"w": "in", "b": [0.2719, 0.2393, 0.2946, 0.2544]}, {"w": "word_index.items():", "b": [0.306, 0.2393, 0.5217, 0.2544]}, {"w": "if", "b": [0.1811, 0.2544, 0.2038, 0.2696]}, {"w": "i", "b": [0.2152, 0.2544, 0.2265, 0.2696]}, {"w": "<", "b": [0.2379, 0.2544, 0.2492, 0.2696]}, {"w": "max_words:", "b": [0.2606, 0.2544, 0.3741, 0.2696]}, {"w": "embedding_vector", "b": [0.2265, 0.2696, 0.4082, 0.2847]}, {"w": "=", "b": [0.4195, 0.2696, 0.4309, 0.2847]}, {"w": "embeddings_index.get(word)", "b": [0.4422, 0.2696, 0.7374, 0.2847]}, {"w": "if", "b": [0.2265, 0.2847, 0.2492, 0.2999]}, {"w": "embedding_vector", "b": [0.2606, 0.2847, 0.4422, 0.2999]}, {"w": "is", "b": [0.4536, 0.2847, 0.4763, 0.2999]}, {"w": "not", "b": [0.4876, 0.2847, 0.5217, 0.2999]}, {"w": "None:", "b": [0.533, 0.2847, 0.5898, 0.2999]}, {"w": "embedding_matrix[i]", "b": [0.2719, 0.2999, 0.4876, 0.315]}, {"w": "=", "b": [0.499, 0.2999, 0.5103, 0.315]}, {"w": "embedding_vector", "b": [0.5217, 0.2999, 0.7033, 0.315]}, {"w": "1", "b": [0.8283, 0.2999, 0.8396, 0.315]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Words not found in the embedding index will be all zeros.", "words": [{"w": "1", "b": [0.1799, 0.3335, 0.1925, 0.3532]}, {"w": "Words", "b": [0.1988, 0.3335, 0.2703, 0.3532]}, {"w": "not", "b": [0.2766, 0.3335, 0.3116, 0.3532]}, {"w": "found", "b": [0.3179, 0.3335, 0.381, 0.3532]}, {"w": "in", "b": [0.3873, 0.3335, 0.4084, 0.3532]}, {"w": "the", "b": [0.4147, 0.3335, 0.4483, 0.3532]}, {"w": "embedding", "b": [0.4546, 0.3335, 0.5737, 0.3532]}, {"w": "index", "b": [0.58, 0.3335, 0.6389, 0.3532]}, {"w": "will", "b": [0.6452, 0.3335, 0.6845, 0.3532]}, {"w": "be", "b": [0.6908, 0.3335, 0.716, 0.3532]}, {"w": "all", "b": [0.7223, 0.3335, 0.749, 0.3532]}, {"w": "zeros.", "b": [0.7553, 0.3335, 0.8171, 0.3532]}]}, {"id": "b_4", "type": "paragraph", "text": "Defining a model", "words": [{"w": "Defining", "b": [0.1294, 0.3713, 0.1988, 0.3861]}, {"w": "a", "b": [0.2035, 0.3713, 0.213, 0.3861]}, {"w": "model", "b": [0.2177, 0.3713, 0.2671, 0.3861]}]}, {"id": "b_5", "type": "paragraph", "text": "You’ll use the same model architecture as before.", "words": [{"w": "You’ll", "b": [0.1294, 0.4092, 0.1928, 0.429]}, {"w": "use", "b": [0.1991, 0.4092, 0.2327, 0.429]}, {"w": "the", "b": [0.239, 0.4092, 0.2698, 0.429]}, {"w": "same", "b": [0.2761, 0.4092, 0.328, 0.429]}, {"w": "model", "b": [0.3343, 0.4092, 0.3973, 0.429]}, {"w": "architecture", "b": [0.4036, 0.4092, 0.5227, 0.429]}, {"w": "as", "b": [0.529, 0.4092, 0.55, 0.429]}, {"w": "before.", "b": [0.5563, 0.4092, 0.6271, 0.429]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 6.12. Model definition", "words": [{"w": "Listing", "b": [0.1294, 0.4471, 0.1862, 0.4619]}, {"w": "6.12.", "b": [0.1909, 0.4471, 0.2288, 0.4619]}, {"w": "Model", "b": [0.2335, 0.4471, 0.285, 0.4619]}, {"w": "definition", "b": [0.2897, 0.4471, 0.3675, 0.4619]}]}, {"id": "b_7", "type": "paragraph", "text": "from keras.models import Sequential from keras.layers import Embedding, Flatten, Dense model = Sequential() model.add(Embedding(max_words, embedding_dim, input_length=maxlen)) model.add(Flatten()) model.add(Dense(32, activation='relu')) model.add(Dense(1, activation='sigmoid')) model.summary()", "words": [{"w": "from", "b": [0.1357, 0.4755, 0.1811, 0.4906]}, {"w": "keras.models", "b": [0.1925, 0.4755, 0.3287, 0.4906]}, {"w": "import", "b": [0.34, 0.4755, 0.4082, 0.4906]}, {"w": "Sequential", "b": [0.4195, 0.4755, 0.533, 0.4906]}, {"w": "from", "b": [0.1357, 0.4906, 0.1811, 0.5058]}, {"w": "keras.layers", "b": [0.1925, 0.4906, 0.3287, 0.5058]}, {"w": "import", "b": [0.34, 0.4906, 0.4082, 0.5058]}, {"w": "Embedding,", "b": [0.4195, 0.4906, 0.533, 0.5058]}, {"w": "Flatten,", "b": [0.5444, 0.4906, 0.6352, 0.5058]}, {"w": "Dense", "b": [0.6465, 0.4906, 0.7033, 0.5058]}, {"w": "model", "b": [0.1357, 0.5209, 0.1925, 0.5361]}, {"w": "=", "b": [0.2038, 0.5209, 0.2152, 0.5361]}, {"w": "Sequential()", "b": [0.2265, 0.5209, 0.3628, 0.5361]}, {"w": "model.add(Embedding(max_words,", "b": [0.1357, 0.5361, 0.4763, 0.5512]}, {"w": "embedding_dim,", "b": [0.4876, 0.5361, 0.6465, 0.5512]}, {"w": "input_length=maxlen))", "b": [0.1357, 0.5512, 0.3741, 0.5664]}, {"w": "model.add(Flatten())", "b": [0.1357, 0.5664, 0.3628, 0.5815]}, {"w": "model.add(Dense(32,", "b": [0.1357, 0.5815, 0.3514, 0.5967]}, {"w": "activation='relu'))", "b": [0.3628, 0.5815, 0.5784, 0.5967]}, {"w": "model.add(Dense(1,", "b": [0.1357, 0.5967, 0.34, 0.6118]}, {"w": "activation='sigmoid'))", "b": [0.3514, 0.5967, 0.6011, 0.6118]}, {"w": "model.summary()", "b": [0.1357, 0.6119, 0.306, 0.627]}]}, {"id": "b_8", "type": "paragraph", "text": "Loading the GloVe embeddings in the model", "words": [{"w": "Loading", "b": [0.1294, 0.6405, 0.1967, 0.6553]}, {"w": "the", "b": [0.2014, 0.6405, 0.2267, 0.6553]}, {"w": "GloVe", "b": [0.2314, 0.6405, 0.2811, 0.6553]}, {"w": "embeddings", "b": [0.2859, 0.6405, 0.3826, 0.6553]}, {"w": "in", "b": [0.3873, 0.6405, 0.4031, 0.6553]}, {"w": "the", "b": [0.4078, 0.6405, 0.4331, 0.6553]}, {"w": "model", "b": [0.4378, 0.6405, 0.4872, 0.6553]}]}, {"id": "b_9", "type": "paragraph", "text": "The Embedding layer has a single weight matrix: a 2D float matrix where each entry i is the word vector meant to be associated with index i. Simple enough. Load the GloVe matrix you prepared into the Embedding layer, the first layer in the model.", "words": [{"w": "The", "b": [0.1294, 0.6784, 0.1686, 0.6981]}, {"w": "Embedding", "b": [0.1749, 0.6794, 0.3112, 0.6996]}, {"w": "layer", "b": [0.3175, 0.6784, 0.3679, 0.6981]}, {"w": "has", "b": [0.3742, 0.6784, 0.4078, 0.6981]}, {"w": "a", "b": [0.4141, 0.6784, 0.4253, 0.6981]}, {"w": "single", "b": [0.4317, 0.6784, 0.4919, 0.6981]}, {"w": "weight", "b": [0.4982, 0.6784, 0.5669, 0.6981]}, {"w": "matrix:", "b": [0.5732, 0.6784, 0.6461, 0.6981]}, {"w": "a", "b": [0.6524, 0.6784, 0.6636, 0.6981]}, {"w": "2D", "b": [0.6699, 0.6784, 0.7007, 0.6981]}, {"w": "float", "b": [0.707, 0.6784, 0.7533, 0.6981]}, {"w": "matrix", "b": [0.7596, 0.6784, 0.8254, 0.6981]}, {"w": "where", "b": [0.1294, 0.6998, 0.191, 0.7195]}, {"w": "each", "b": [0.1973, 0.6998, 0.2436, 0.7195]}, {"w": "entry", "b": [0.2499, 0.6998, 0.3017, 0.7195]}, {"w": "i", "b": [0.308, 0.6998, 0.315, 0.7195]}, {"w": "is", "b": [0.3213, 0.6998, 0.3381, 0.7195]}, {"w": "the", "b": [0.3444, 0.6998, 0.3752, 0.7195]}, {"w": "word", "b": [0.3815, 0.6998, 0.4334, 0.7195]}, {"w": "vector", "b": [0.4397, 0.6998, 0.5027, 0.7195]}, {"w": "meant", "b": [0.509, 0.6998, 0.5707, 0.7195]}, {"w": "to", "b": [0.577, 0.6998, 0.5966, 0.7195]}, {"w": "be", "b": [0.6029, 0.6998, 0.6267, 0.7195]}, {"w": "associated", "b": [0.6331, 0.6998, 0.7367, 0.7195]}, {"w": "with", "b": [0.743, 0.6998, 0.7879, 0.7195]}, {"w": "index", "b": [0.7942, 0.6998, 0.8502, 0.7195]}, {"w": "i.", "b": [0.8565, 0.6998, 0.8698, 0.7195]}, {"w": "Simple", "b": [0.1294, 0.7203, 0.2009, 0.74]}, {"w": "enough.", "b": [0.2072, 0.7203, 0.2878, 0.74]}, {"w": "Load", "b": [0.2941, 0.7203, 0.3459, 0.74]}, {"w": "the", "b": [0.3522, 0.7203, 0.3831, 0.74]}, {"w": "GloVe", "b": [0.3894, 0.7203, 0.4538, 0.74]}, {"w": "matrix", "b": [0.4601, 0.7203, 0.526, 0.74]}, {"w": "you", "b": [0.5323, 0.7203, 0.5701, 0.74]}, {"w": "prepared", "b": [0.5764, 0.7203, 0.6647, 0.74]}, {"w": "into", "b": [0.671, 0.7203, 0.7102, 0.74]}, {"w": "the", "b": [0.7165, 0.7203, 0.7473, 0.74]}, {"w": "Embedding", "b": [0.1294, 0.7418, 0.2656, 0.762]}, {"w": "layer,", "b": [0.272, 0.7408, 0.3277, 0.7605]}, {"w": "the", "b": [0.334, 0.7408, 0.3648, 0.7605]}, {"w": "first", "b": [0.3711, 0.7408, 0.4117, 0.7605]}, {"w": "layer", "b": [0.4181, 0.7408, 0.4685, 0.7605]}, {"w": "in", "b": [0.4748, 0.7408, 0.4944, 0.7605]}, {"w": "the", "b": [0.5007, 0.7408, 0.5315, 0.7605]}, {"w": "model.", "b": [0.5378, 0.7408, 0.6072, 0.7605]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 6.13. Loading pretrained word embeddings into the Embedding layer", "words": [{"w": "Listing", "b": [0.1294, 0.7795, 0.1862, 0.7943]}, {"w": "6.13.", "b": [0.1909, 0.7795, 0.2288, 0.7943]}, {"w": "Loading", "b": [0.2335, 0.7795, 0.3008, 0.7943]}, {"w": "pretrained", "b": [0.3055, 0.7795, 0.3913, 0.7943]}, {"w": "word", "b": [0.3961, 0.7795, 0.4381, 0.7943]}, {"w": "embeddings", "b": [0.4428, 0.7795, 0.5395, 0.7943]}, {"w": "into", "b": [0.5443, 0.7795, 0.5758, 0.7943]}, {"w": "the", "b": [0.5805, 0.7795, 0.6058, 0.7943]}, {"w": "Embedding", "b": [0.6105, 0.7803, 0.7127, 0.7955]}, {"w": "layer", "b": [0.7174, 0.7795, 0.7584, 0.7943]}]}, {"id": "b_11", "type": "paragraph", "text": "model.layers[0].set_weights([embedding_matrix]) model.layers[0].trainable = False", "words": [{"w": "model.layers[0].set_weights([embedding_matrix])", "b": [0.1357, 0.8088, 0.6692, 0.824]}, {"w": "model.layers[0].trainable", "b": [0.1357, 0.824, 0.4195, 0.8391]}, {"w": "=", "b": [0.4309, 0.824, 0.4422, 0.8391]}, {"w": "False", "b": [0.4536, 0.824, 0.5103, 0.8391]}]}, {"id": "b_12", "type": "paragraph", "text": "Additionally, you’ll freeze the Embedding layer (set its trainable attribute to False), following the same rationale you’re already familiar", "words": [{"w": "Additionally,", "b": [0.1294, 0.862, 0.2616, 0.8818]}, {"w": "you’ll", "b": [0.2679, 0.862, 0.3282, 0.8818]}, {"w": "freeze", "b": [0.3345, 0.862, 0.3961, 0.8818]}, {"w": "the", "b": [0.4024, 0.862, 0.4332, 0.8818]}, {"w": "Embedding", "b": [0.4395, 0.8631, 0.5757, 0.8833]}, {"w": "layer", "b": [0.582, 0.862, 0.6324, 0.8818]}, {"w": "(set", "b": [0.6388, 0.862, 0.6752, 0.8818]}, {"w": "its", "b": [0.6815, 0.862, 0.7053, 0.8818]}, {"w": "trainable", "b": [0.7116, 0.8631, 0.8478, 0.8833]}, {"w": "attribute", "b": [0.1294, 0.8834, 0.2135, 0.9031]}, {"w": "to", "b": [0.2198, 0.8834, 0.2394, 0.9031]}, {"w": "False),", "b": [0.2457, 0.8834, 0.3361, 0.9046]}, {"w": "following", "b": [0.3424, 0.8834, 0.4405, 0.9031]}, {"w": "the", "b": [0.4468, 0.8834, 0.4776, 0.9031]}, {"w": "same", "b": [0.4839, 0.8834, 0.5358, 0.9031]}, {"w": "rationale", "b": [0.5421, 0.8834, 0.6303, 0.9031]}, {"w": "you’re", "b": [0.6366, 0.8834, 0.7025, 0.9031]}, {"w": "already", "b": [0.7088, 0.8834, 0.783, 0.9031]}, {"w": "familiar", "b": [0.7893, 0.8834, 0.8692, 0.9031]}]}]}, {"page": 255, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "with in the context of pretrained convnet features: when parts of a model are pretrained (like your Embedding layer) and parts are randomly initialized (like your classifier), the pretrained parts shouldn’t be updated during training, to avoid forgetting what they already know. The large gradient updates triggered by the randomly initialized layers would be disruptive to the already-learned features.", "words": [{"w": "with", "b": [0.1294, 0.0857, 0.1743, 0.1054]}, {"w": "in", "b": [0.1806, 0.0857, 0.2002, 0.1054]}, {"w": "the", "b": [0.2065, 0.0857, 0.2373, 0.1054]}, {"w": "context", "b": [0.2436, 0.0857, 0.3179, 0.1054]}, {"w": "of", "b": [0.3242, 0.0857, 0.3452, 0.1054]}, {"w": "pretrained", "b": [0.3515, 0.0857, 0.4538, 0.1054]}, {"w": "convnet", "b": [0.4601, 0.0857, 0.54, 0.1054]}, {"w": "features:", "b": [0.5463, 0.0857, 0.6331, 0.1054]}, {"w": "when", "b": [0.6394, 0.0857, 0.6941, 0.1054]}, {"w": "parts", "b": [0.7004, 0.0857, 0.7494, 0.1054]}, {"w": "of", "b": [0.7557, 0.0857, 0.7767, 0.1054]}, {"w": "a", "b": [0.7829, 0.0857, 0.7941, 0.1054]}, {"w": "model", "b": [0.8004, 0.0857, 0.8635, 0.1054]}, {"w": "are", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "pretrained", "b": [0.1665, 0.1062, 0.2688, 0.1259]}, {"w": "(like", "b": [0.2751, 0.1062, 0.3213, 0.1259]}, {"w": "your", "b": [0.3276, 0.1062, 0.3739, 0.1259]}, {"w": "Embedding", "b": [0.3801, 0.1072, 0.5164, 0.1274]}, {"w": "layer)", "b": [0.5227, 0.1062, 0.5815, 0.1259]}, {"w": "and", "b": [0.5878, 0.1062, 0.6242, 0.1259]}, {"w": "parts", "b": [0.6305, 0.1062, 0.6796, 0.1259]}, {"w": "are", "b": [0.6859, 0.1062, 0.7167, 0.1259]}, {"w": "randomly", "b": [0.723, 0.1062, 0.8197, 0.1259]}, {"w": "initialized", "b": [0.1294, 0.1276, 0.2303, 0.1473]}, {"w": "(like", "b": [0.2366, 0.1276, 0.2829, 0.1473]}, {"w": "your", "b": [0.2892, 0.1276, 0.3354, 0.1473]}, {"w": "classifier),", "b": [0.3417, 0.1276, 0.4475, 0.1473]}, {"w": "the", "b": [0.4538, 0.1276, 0.4846, 0.1473]}, {"w": "pretrained", "b": [0.4909, 0.1276, 0.5932, 0.1473]}, {"w": "parts", "b": [0.5995, 0.1276, 0.6485, 0.1473]}, {"w": "shouldn’t", "b": [0.6548, 0.1276, 0.7496, 0.1473]}, {"w": "be", "b": [0.7559, 0.1276, 0.7797, 0.1473]}, {"w": "updated", "b": [0.786, 0.1276, 0.8659, 0.1473]}, {"w": "during", "b": [0.1294, 0.1481, 0.1953, 0.1678]}, {"w": "training,", "b": [0.2016, 0.1481, 0.2864, 0.1678]}, {"w": "to", "b": [0.2927, 0.1481, 0.3123, 0.1678]}, {"w": "avoid", "b": [0.3186, 0.1481, 0.3746, 0.1678]}, {"w": "forgetting", "b": [0.3809, 0.1481, 0.48, 0.1678]}, {"w": "what", "b": [0.4863, 0.1481, 0.5353, 0.1678]}, {"w": "they", "b": [0.5416, 0.1481, 0.5851, 0.1678]}, {"w": "already", "b": [0.5914, 0.1481, 0.6656, 0.1678]}, {"w": "know.", "b": [0.6719, 0.1481, 0.7326, 0.1678]}, {"w": "The", "b": [0.7389, 0.1481, 0.7781, 0.1678]}, {"w": "large", "b": [0.7844, 0.1481, 0.8344, 0.1678]}, {"w": "gradient", "b": [0.1294, 0.1686, 0.2121, 0.1883]}, {"w": "updates", "b": [0.2184, 0.1686, 0.2954, 0.1883]}, {"w": "triggered", "b": [0.3018, 0.1686, 0.3928, 0.1883]}, {"w": "by", "b": [0.3991, 0.1686, 0.4244, 0.1883]}, {"w": "the", "b": [0.4307, 0.1686, 0.4615, 0.1883]}, {"w": "randomly", "b": [0.4678, 0.1686, 0.5645, 0.1883]}, {"w": "initialized", "b": [0.5708, 0.1686, 0.6717, 0.1883]}, {"w": "layers", "b": [0.678, 0.1686, 0.7382, 0.1883]}, {"w": "would", "b": [0.7445, 0.1686, 0.8076, 0.1883]}, {"w": "be", "b": [0.8139, 0.1686, 0.8377, 0.1883]}, {"w": "disruptive", "b": [0.1294, 0.1891, 0.2303, 0.2088]}, {"w": "to", "b": [0.2366, 0.1891, 0.2562, 0.2088]}, {"w": "the", "b": [0.2626, 0.1891, 0.2934, 0.2088]}, {"w": "already-learned", "b": [0.2997, 0.1891, 0.4566, 0.2088]}, {"w": "features.", "b": [0.4629, 0.1891, 0.549, 0.2088]}]}, {"id": "b_1", "type": "paragraph", "text": "Training and evaluating the model", "words": [{"w": "Training", "b": [0.1294, 0.2269, 0.1995, 0.2417]}, {"w": "and", "b": [0.2042, 0.2269, 0.2347, 0.2417]}, {"w": "evaluating", "b": [0.2395, 0.2269, 0.3236, 0.2417]}, {"w": "the", "b": [0.3283, 0.2269, 0.3535, 0.2417]}, {"w": "model", "b": [0.3582, 0.2269, 0.4076, 0.2417]}]}, {"id": "b_2", "type": "paragraph", "text": "Compile and train the model.", "words": [{"w": "Compile", "b": [0.1294, 0.2648, 0.2163, 0.2846]}, {"w": "and", "b": [0.2226, 0.2648, 0.259, 0.2846]}, {"w": "train", "b": [0.2654, 0.2648, 0.3116, 0.2846]}, {"w": "the", "b": [0.3179, 0.2648, 0.3487, 0.2846]}, {"w": "model.", "b": [0.355, 0.2648, 0.4244, 0.2846]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.14. Training and evaluation", "words": [{"w": "Listing", "b": [0.1294, 0.3027, 0.1862, 0.3175]}, {"w": "6.14.", "b": [0.1909, 0.3027, 0.2288, 0.3175]}, {"w": "Training", "b": [0.2335, 0.3027, 0.3036, 0.3175]}, {"w": "and", "b": [0.3083, 0.3027, 0.3388, 0.3175]}, {"w": "evaluation", "b": [0.3435, 0.3027, 0.4276, 0.3175]}]}, {"id": "b_4", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(x_train, y_train, epochs=10, batch_size=32, validation_data=(x_val, y_val)) model.save_weights('pre_trained_glove_model.h5')", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.3311, 0.5217, 0.3462]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.3462, 0.6011, 0.3614]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.3614, 0.4763, 0.3765]}, {"w": "history", "b": [0.1357, 0.3765, 0.2152, 0.3917]}, {"w": "=", "b": [0.2265, 0.3765, 0.2379, 0.3917]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.3765, 0.4536, 0.3917]}, {"w": "y_train,", "b": [0.4649, 0.3765, 0.5557, 0.3917]}, {"w": "epochs=10,", "b": [0.3628, 0.3917, 0.4763, 0.4068]}, {"w": "batch_size=32,", "b": [0.3628, 0.4068, 0.5217, 0.422]}, {"w": "validation_data=(x_val,", "b": [0.3628, 0.422, 0.6238, 0.4371]}, {"w": "y_val))", "b": [0.6352, 0.422, 0.7146, 0.4371]}, {"w": "model.save_weights('pre_trained_glove_model.h5')", "b": [0.1357, 0.4372, 0.6806, 0.4523]}]}, {"id": "b_5", "type": "paragraph", "text": "Now, plot the model’s performance over time (see figures 6.5 and 6.6).", "words": [{"w": "Now,", "b": [0.1294, 0.4752, 0.1831, 0.4949]}, {"w": "plot", "b": [0.1894, 0.4752, 0.2287, 0.4949]}, {"w": "the", "b": [0.235, 0.4752, 0.2658, 0.4949]}, {"w": "model’s", "b": [0.2721, 0.4752, 0.352, 0.4949]}, {"w": "performance", "b": [0.3583, 0.4752, 0.4858, 0.4949]}, {"w": "over", "b": [0.4921, 0.4752, 0.5369, 0.4949]}, {"w": "time", "b": [0.5432, 0.4752, 0.588, 0.4949]}, {"w": "(see", "b": [0.5944, 0.4752, 0.635, 0.4949]}, {"w": "figures", "b": [0.6412, 0.4752, 0.7113, 0.4949]}, {"w": "6.5", "b": [0.7176, 0.4752, 0.7491, 0.4949]}, {"w": "and", "b": [0.7554, 0.4752, 0.7918, 0.4949]}, {"w": "6.6).", "b": [0.7981, 0.4752, 0.8444, 0.4949]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 6.5. Training and validation loss when using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1294, 0.513, 0.1827, 0.5278]}, {"w": "6.5.", "b": [0.1874, 0.513, 0.2158, 0.5278]}, {"w": "Training", "b": [0.2205, 0.513, 0.2906, 0.5278]}, {"w": "and", "b": [0.2953, 0.513, 0.3258, 0.5278]}, {"w": "validation", "b": [0.3305, 0.513, 0.4115, 0.5278]}, {"w": "loss", "b": [0.4162, 0.513, 0.4457, 0.5278]}, {"w": "when", "b": [0.4504, 0.513, 0.4935, 0.5278]}, {"w": "using", "b": [0.4982, 0.513, 0.5413, 0.5278]}, {"w": "pretrained", "b": [0.5461, 0.513, 0.6319, 0.5278]}, {"w": "word", "b": [0.6366, 0.513, 0.6787, 0.5278]}, {"w": "embeddings", "b": [0.6834, 0.513, 0.7801, 0.5278]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 6.6. Training and validation accuracy when using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1294, 0.8134, 0.1827, 0.8282]}, {"w": "6.6.", "b": [0.1874, 0.8134, 0.2158, 0.8282]}, {"w": "Training", "b": [0.2205, 0.8134, 0.2906, 0.8282]}, {"w": "and", "b": [0.2953, 0.8134, 0.3258, 0.8282]}, {"w": "validation", "b": [0.3305, 0.8134, 0.4115, 0.8282]}, {"w": "accuracy", "b": [0.4162, 0.8134, 0.4887, 0.8282]}, {"w": "when", "b": [0.4934, 0.8134, 0.5365, 0.8282]}, {"w": "using", "b": [0.5413, 0.8134, 0.5844, 0.8282]}, {"w": "pretrained", "b": [0.5891, 0.8134, 0.675, 0.8282]}, {"w": "word", "b": [0.6797, 0.8134, 0.7217, 0.8282]}, {"w": "embeddings", "b": [0.7265, 0.8134, 0.8232, 0.8282]}]}]}, {"page": 256, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 6.15. Plotting the results", "words": [{"w": "Listing", "b": [0.1294, 0.3526, 0.1862, 0.3674]}, {"w": "6.15.", "b": [0.1909, 0.3526, 0.2288, 0.3674]}, {"w": "Plotting", "b": [0.2335, 0.3526, 0.2976, 0.3674]}, {"w": "the", "b": [0.3023, 0.3526, 0.3275, 0.3674]}, {"w": "results", "b": [0.3323, 0.3526, 0.3855, 0.3674]}]}, {"id": "b_1", "type": "paragraph", "text": "import matplotlib.pyplot as plt acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(1, len(acc) + 1) plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()", "words": [{"w": "import", "b": [0.1357, 0.381, 0.2038, 0.3961]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.381, 0.4082, 0.3961]}, {"w": "as", "b": [0.4195, 0.381, 0.4422, 0.3961]}, {"w": "plt", "b": [0.4536, 0.381, 0.4876, 0.3961]}, {"w": "acc", "b": [0.1357, 0.4113, 0.1698, 0.4264]}, {"w": "=", "b": [0.1811, 0.4113, 0.1925, 0.4264]}, {"w": "history.history['acc']", "b": [0.2038, 0.4113, 0.4536, 0.4264]}, {"w": "val_acc", "b": [0.1357, 0.4265, 0.2152, 0.4416]}, {"w": "=", "b": [0.2265, 0.4265, 0.2379, 0.4416]}, {"w": "history.history['val_acc']", "b": [0.2492, 0.4265, 0.5444, 0.4416]}, {"w": "loss", "b": [0.1357, 0.4416, 0.1811, 0.4568]}, {"w": "=", "b": [0.1925, 0.4416, 0.2038, 0.4568]}, {"w": "history.history['loss']", "b": [0.2152, 0.4416, 0.4763, 0.4568]}, {"w": "val_loss", "b": [0.1357, 0.4568, 0.2265, 0.4719]}, {"w": "=", "b": [0.2379, 0.4568, 0.2492, 0.4719]}, {"w": "history.history['val_loss']", "b": [0.2606, 0.4568, 0.5671, 0.4719]}, {"w": "epochs", "b": [0.1357, 0.4871, 0.2038, 0.5022]}, {"w": "=", "b": [0.2152, 0.4871, 0.2265, 0.5022]}, {"w": "range(1,", "b": [0.2379, 0.4871, 0.3287, 0.5022]}, {"w": "len(acc)", "b": [0.34, 0.4871, 0.4309, 0.5022]}, {"w": "+", "b": [0.4422, 0.4871, 0.4536, 0.5022]}, {"w": "1)", "b": [0.4649, 0.4871, 0.4876, 0.5022]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.5174, 0.3173, 0.5325]}, {"w": "acc,", "b": [0.3287, 0.5174, 0.3741, 0.5325]}, {"w": "'bo',", "b": [0.3855, 0.5174, 0.4422, 0.5325]}, {"w": "label='Training", "b": [0.4536, 0.5174, 0.6238, 0.5325]}, {"w": "acc')", "b": [0.6352, 0.5174, 0.6919, 0.5325]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.5325, 0.3173, 0.5477]}, {"w": "val_acc,", "b": [0.3287, 0.5325, 0.4195, 0.5477]}, {"w": "'b',", "b": [0.4309, 0.5325, 0.4763, 0.5477]}, {"w": "label='Validation", "b": [0.4876, 0.5325, 0.6806, 0.5477]}, {"w": "acc')", "b": [0.6919, 0.5325, 0.7487, 0.5477]}, {"w": "plt.title('Training", "b": [0.1357, 0.5477, 0.3514, 0.5628]}, {"w": "and", "b": [0.3628, 0.5477, 0.3968, 0.5628]}, {"w": "validation", "b": [0.4082, 0.5477, 0.5217, 0.5628]}, {"w": "accuracy')", "b": [0.533, 0.5477, 0.6465, 0.5628]}, {"w": "plt.legend()", "b": [0.1357, 0.5628, 0.2719, 0.578]}, {"w": "plt.figure()", "b": [0.1357, 0.5931, 0.2719, 0.6083]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.6234, 0.3173, 0.6386]}, {"w": "loss,", "b": [0.3287, 0.6234, 0.3855, 0.6386]}, {"w": "'bo',", "b": [0.3968, 0.6234, 0.4536, 0.6386]}, {"w": "label='Training", "b": [0.4649, 0.6234, 0.6352, 0.6386]}, {"w": "loss')", "b": [0.6465, 0.6234, 0.7146, 0.6386]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.6386, 0.3173, 0.6537]}, {"w": "val_loss,", "b": [0.3287, 0.6386, 0.4309, 0.6537]}, {"w": "'b',", "b": [0.4422, 0.6386, 0.4876, 0.6537]}, {"w": "label='Validation", "b": [0.499, 0.6386, 0.6919, 0.6537]}, {"w": "loss')", "b": [0.7033, 0.6386, 0.7714, 0.6537]}, {"w": "plt.title('Training", "b": [0.1357, 0.6537, 0.3514, 0.6689]}, {"w": "and", "b": [0.3628, 0.6537, 0.3968, 0.6689]}, {"w": "validation", "b": [0.4082, 0.6537, 0.5217, 0.6689]}, {"w": "loss')", "b": [0.533, 0.6537, 0.6011, 0.6689]}, {"w": "plt.legend()", "b": [0.1357, 0.6689, 0.2719, 0.684]}, {"w": "plt.show()", "b": [0.1357, 0.6992, 0.2492, 0.7143]}]}, {"id": "b_2", "type": "paragraph", "text": "The model quickly starts overfitting, which is unsurprising given the small number of training samples. Validation accuracy has high variance for the same reason, but it seems to reach the high 50s.", "words": [{"w": "The", "b": [0.1294, 0.7372, 0.1686, 0.757]}, {"w": "model", "b": [0.1749, 0.7372, 0.238, 0.757]}, {"w": "quickly", "b": [0.2443, 0.7372, 0.32, 0.757]}, {"w": "starts", "b": [0.3263, 0.7372, 0.3796, 0.757]}, {"w": "overfitting,", "b": [0.3859, 0.7372, 0.4987, 0.757]}, {"w": "which", "b": [0.505, 0.7372, 0.5666, 0.757]}, {"w": "is", "b": [0.5729, 0.7372, 0.5898, 0.757]}, {"w": "unsurprising", "b": [0.5961, 0.7372, 0.7222, 0.757]}, {"w": "given", "b": [0.7285, 0.7372, 0.7846, 0.757]}, {"w": "the", "b": [0.7909, 0.7372, 0.8217, 0.757]}, {"w": "small", "b": [0.1294, 0.7577, 0.1841, 0.7775]}, {"w": "number", "b": [0.1904, 0.7577, 0.2674, 0.7775]}, {"w": "of", "b": [0.2738, 0.7577, 0.2948, 0.7775]}, {"w": "training", "b": [0.3011, 0.7577, 0.3796, 0.7775]}, {"w": "samples.", "b": [0.3859, 0.7577, 0.4734, 0.7775]}, {"w": "Validation", "b": [0.4797, 0.7577, 0.5834, 0.7775]}, {"w": "accuracy", "b": [0.5897, 0.7577, 0.6793, 0.7775]}, {"w": "has", "b": [0.6856, 0.7577, 0.7192, 0.7775]}, {"w": "high", "b": [0.7255, 0.7577, 0.7704, 0.7775]}, {"w": "variance", "b": [0.7767, 0.7577, 0.8621, 0.7775]}, {"w": "for", "b": [0.1294, 0.7782, 0.1588, 0.798]}, {"w": "the", "b": [0.1651, 0.7782, 0.196, 0.798]}, {"w": "same", "b": [0.2023, 0.7782, 0.2541, 0.798]}, {"w": "reason,", "b": [0.2604, 0.7782, 0.3326, 0.798]}, {"w": "but", "b": [0.3389, 0.7782, 0.3711, 0.798]}, {"w": "it", "b": [0.3774, 0.7782, 0.3914, 0.798]}, {"w": "seems", "b": [0.3977, 0.7782, 0.4594, 0.798]}, {"w": "to", "b": [0.4657, 0.7782, 0.4853, 0.798]}, {"w": "reach", "b": [0.4916, 0.7782, 0.5462, 0.798]}, {"w": "the", "b": [0.5525, 0.7782, 0.5834, 0.798]}, {"w": "high", "b": [0.5897, 0.7782, 0.6345, 0.798]}, {"w": "50s.", "b": [0.6408, 0.7782, 0.6822, 0.798]}]}, {"id": "b_3", "type": "paragraph", "text": "Note that your mileage may vary: because you have so few training samples, performance is heavily dependent on exactly which 200 samples you choose—and you’re choosing them at random. If this works poorly for you, try choosing a different random set of 200 samples, for", "words": [{"w": "Note", "b": [0.1294, 0.821, 0.1785, 0.8408]}, {"w": "that", "b": [0.1848, 0.821, 0.2226, 0.8408]}, {"w": "your", "b": [0.2289, 0.821, 0.2751, 0.8408]}, {"w": "mileage", "b": [0.2814, 0.821, 0.3613, 0.8408]}, {"w": "may", "b": [0.3676, 0.821, 0.4111, 0.8408]}, {"w": "vary:", "b": [0.4174, 0.821, 0.4692, 0.8408]}, {"w": "because", "b": [0.4755, 0.821, 0.5553, 0.8408]}, {"w": "you", "b": [0.5617, 0.821, 0.5995, 0.8408]}, {"w": "have", "b": [0.6058, 0.821, 0.6534, 0.8408]}, {"w": "so", "b": [0.6597, 0.821, 0.6822, 0.8408]}, {"w": "few", "b": [0.6885, 0.821, 0.7263, 0.8408]}, {"w": "training", "b": [0.7326, 0.821, 0.8111, 0.8408]}, {"w": "samples,", "b": [0.1294, 0.8415, 0.217, 0.8613]}, {"w": "performance", "b": [0.2233, 0.8415, 0.3508, 0.8613]}, {"w": "is", "b": [0.3571, 0.8415, 0.3739, 0.8613]}, {"w": "heavily", "b": [0.3802, 0.8415, 0.4545, 0.8613]}, {"w": "dependent", "b": [0.4608, 0.8415, 0.5645, 0.8613]}, {"w": "on", "b": [0.5708, 0.8415, 0.596, 0.8613]}, {"w": "exactly", "b": [0.6023, 0.8415, 0.6751, 0.8613]}, {"w": "which", "b": [0.6815, 0.8415, 0.7431, 0.8613]}, {"w": "200", "b": [0.7493, 0.8415, 0.7872, 0.8613]}, {"w": "samples", "b": [0.1294, 0.862, 0.2107, 0.8818]}, {"w": "you", "b": [0.217, 0.862, 0.2548, 0.8818]}, {"w": "choose—and", "b": [0.2611, 0.862, 0.3928, 0.8818]}, {"w": "you’re", "b": [0.3992, 0.862, 0.465, 0.8818]}, {"w": "choosing", "b": [0.4713, 0.862, 0.5624, 0.8818]}, {"w": "them", "b": [0.5687, 0.862, 0.6191, 0.8818]}, {"w": "at", "b": [0.6255, 0.862, 0.6437, 0.8818]}, {"w": "random.", "b": [0.65, 0.862, 0.7333, 0.8818]}, {"w": "If", "b": [0.7396, 0.862, 0.7564, 0.8818]}, {"w": "this", "b": [0.7628, 0.862, 0.7992, 0.8818]}, {"w": "works", "b": [0.8055, 0.862, 0.8672, 0.8818]}, {"w": "poorly", "b": [0.1294, 0.8825, 0.1953, 0.9023]}, {"w": "for", "b": [0.2016, 0.8825, 0.231, 0.9023]}, {"w": "you,", "b": [0.2373, 0.8825, 0.2814, 0.9023]}, {"w": "try", "b": [0.2878, 0.8825, 0.3158, 0.9023]}, {"w": "choosing", "b": [0.3221, 0.8825, 0.4132, 0.9023]}, {"w": "a", "b": [0.4195, 0.8825, 0.4307, 0.9023]}, {"w": "different", "b": [0.437, 0.8825, 0.5234, 0.9023]}, {"w": "random", "b": [0.5297, 0.8825, 0.6067, 0.9023]}, {"w": "set", "b": [0.613, 0.8825, 0.6411, 0.9023]}, {"w": "of", "b": [0.6473, 0.8825, 0.6684, 0.9023]}, {"w": "200", "b": [0.6747, 0.8825, 0.7125, 0.9023]}, {"w": "samples,", "b": [0.7188, 0.8825, 0.8064, 0.9023]}, {"w": "for", "b": [0.8127, 0.8825, 0.8421, 0.9023]}]}]}, {"page": 257, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the sake of the exercise (in real life, you don’t get to choose your training data).", "words": [{"w": "the", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "sake", "b": [0.1665, 0.0857, 0.2114, 0.1054]}, {"w": "of", "b": [0.2177, 0.0857, 0.2387, 0.1054]}, {"w": "the", "b": [0.245, 0.0857, 0.2758, 0.1054]}, {"w": "exercise", "b": [0.2821, 0.0857, 0.3648, 0.1054]}, {"w": "(in", "b": [0.3711, 0.0857, 0.3991, 0.1054]}, {"w": "real", "b": [0.4054, 0.0857, 0.4432, 0.1054]}, {"w": "life,", "b": [0.4495, 0.0857, 0.4895, 0.1054]}, {"w": "you", "b": [0.4958, 0.0857, 0.5336, 0.1054]}, {"w": "don’t", "b": [0.5399, 0.0857, 0.5926, 0.1054]}, {"w": "get", "b": [0.599, 0.0857, 0.6298, 0.1054]}, {"w": "to", "b": [0.6361, 0.0857, 0.6557, 0.1054]}, {"w": "choose", "b": [0.662, 0.0857, 0.7321, 0.1054]}, {"w": "your", "b": [0.7384, 0.0857, 0.7846, 0.1054]}, {"w": "training", "b": [0.7909, 0.0857, 0.8694, 0.1054]}, {"w": "data).", "b": [0.1294, 0.1062, 0.1861, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "You can also train the same model without loading the pretrained word embeddings and without freezing the embedding layer. In that case, you’ll learn a task--specific embedding of the input tokens, which is generally more powerful than pretrained word embeddings when lots of data is available. But in this case, you have only 200 training samples. Let’s try it (see figures 6.7 and 6.8).", "words": [{"w": "You", "b": [0.1294, 0.149, 0.1703, 0.1687]}, {"w": "can", "b": [0.1766, 0.149, 0.2116, 0.1687]}, {"w": "also", "b": [0.218, 0.149, 0.2586, 0.1687]}, {"w": "train", "b": [0.2649, 0.149, 0.3111, 0.1687]}, {"w": "the", "b": [0.3174, 0.149, 0.3483, 0.1687]}, {"w": "same", "b": [0.3546, 0.149, 0.4064, 0.1687]}, {"w": "model", "b": [0.4127, 0.149, 0.4758, 0.1687]}, {"w": "without", "b": [0.4821, 0.149, 0.5592, 0.1687]}, {"w": "loading", "b": [0.5655, 0.149, 0.6412, 0.1687]}, {"w": "the", "b": [0.6475, 0.149, 0.6783, 0.1687]}, {"w": "pretrained", "b": [0.6846, 0.149, 0.7869, 0.1687]}, {"w": "word", "b": [0.7932, 0.149, 0.845, 0.1687]}, {"w": "embeddings", "b": [0.1294, 0.1695, 0.2513, 0.1892]}, {"w": "and", "b": [0.2576, 0.1695, 0.2941, 0.1892]}, {"w": "without", "b": [0.3004, 0.1695, 0.3775, 0.1892]}, {"w": "freezing", "b": [0.3838, 0.1695, 0.4664, 0.1892]}, {"w": "the", "b": [0.4727, 0.1695, 0.5035, 0.1892]}, {"w": "embedding", "b": [0.5098, 0.1695, 0.6219, 0.1892]}, {"w": "layer.", "b": [0.6283, 0.1695, 0.6835, 0.1892]}, {"w": "In", "b": [0.6898, 0.1695, 0.7108, 0.1892]}, {"w": "that", "b": [0.7171, 0.1695, 0.755, 0.1892]}, {"w": "case,", "b": [0.7613, 0.1695, 0.811, 0.1892]}, {"w": "you’ll", "b": [0.1294, 0.19, 0.1897, 0.2097]}, {"w": "learn", "b": [0.196, 0.19, 0.2464, 0.2097]}, {"w": "a", "b": [0.2527, 0.19, 0.2639, 0.2097]}, {"w": "task--specific", "b": [0.2702, 0.19, 0.4061, 0.2097]}, {"w": "embedding", "b": [0.4124, 0.19, 0.5245, 0.2097]}, {"w": "of", "b": [0.5308, 0.19, 0.5518, 0.2097]}, {"w": "the", "b": [0.5581, 0.19, 0.589, 0.2097]}, {"w": "input", "b": [0.5953, 0.19, 0.6471, 0.2097]}, {"w": "tokens,", "b": [0.6535, 0.19, 0.7256, 0.2097]}, {"w": "which", "b": [0.7319, 0.19, 0.7936, 0.2097]}, {"w": "is", "b": [0.7999, 0.19, 0.8167, 0.2097]}, {"w": "generally", "b": [0.1294, 0.2105, 0.2233, 0.2302]}, {"w": "more", "b": [0.2296, 0.2105, 0.2814, 0.2302]}, {"w": "powerful", "b": [0.2877, 0.2105, 0.3788, 0.2302]}, {"w": "than", "b": [0.3851, 0.2105, 0.4285, 0.2302]}, {"w": "pretrained", "b": [0.4348, 0.2105, 0.5371, 0.2302]}, {"w": "word", "b": [0.5434, 0.2105, 0.5952, 0.2302]}, {"w": "embeddings", "b": [0.6015, 0.2105, 0.7234, 0.2302]}, {"w": "when", "b": [0.7297, 0.2105, 0.7844, 0.2302]}, {"w": "lots", "b": [0.7907, 0.2105, 0.8271, 0.2302]}, {"w": "of", "b": [0.8334, 0.2105, 0.8544, 0.2302]}, {"w": "data", "b": [0.1294, 0.231, 0.1714, 0.2507]}, {"w": "is", "b": [0.1777, 0.231, 0.1946, 0.2507]}, {"w": "available.", "b": [0.2009, 0.231, 0.2982, 0.2507]}, {"w": "But", "b": [0.3046, 0.231, 0.341, 0.2507]}, {"w": "in", "b": [0.3473, 0.231, 0.3669, 0.2507]}, {"w": "this", "b": [0.3732, 0.231, 0.4097, 0.2507]}, {"w": "case,", "b": [0.416, 0.231, 0.4657, 0.2507]}, {"w": "you", "b": [0.472, 0.231, 0.5099, 0.2507]}, {"w": "have", "b": [0.5162, 0.231, 0.5638, 0.2507]}, {"w": "only", "b": [0.5701, 0.231, 0.615, 0.2507]}, {"w": "200", "b": [0.6213, 0.231, 0.6591, 0.2507]}, {"w": "training", "b": [0.6654, 0.231, 0.7439, 0.2507]}, {"w": "samples.", "b": [0.7502, 0.231, 0.8378, 0.2507]}, {"w": "Let’s", "b": [0.1294, 0.2515, 0.1798, 0.2712]}, {"w": "try", "b": [0.1862, 0.2515, 0.2142, 0.2712]}, {"w": "it", "b": [0.2205, 0.2515, 0.2345, 0.2712]}, {"w": "(see", "b": [0.2408, 0.2515, 0.2814, 0.2712]}, {"w": "figures", "b": [0.2877, 0.2515, 0.3578, 0.2712]}, {"w": "6.7", "b": [0.3641, 0.2515, 0.3956, 0.2712]}, {"w": "and", "b": [0.4019, 0.2515, 0.4383, 0.2712]}, {"w": "6.8).", "b": [0.4446, 0.2515, 0.4909, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.7. Training and validation loss without using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1294, 0.2893, 0.1827, 0.3041]}, {"w": "6.7.", "b": [0.1874, 0.2893, 0.2158, 0.3041]}, {"w": "Training", "b": [0.2205, 0.2893, 0.2906, 0.3041]}, {"w": "and", "b": [0.2953, 0.2893, 0.3258, 0.3041]}, {"w": "validation", "b": [0.3305, 0.2893, 0.4115, 0.3041]}, {"w": "loss", "b": [0.4162, 0.2893, 0.4457, 0.3041]}, {"w": "without", "b": [0.4504, 0.2893, 0.5124, 0.3041]}, {"w": "using", "b": [0.5171, 0.2893, 0.5602, 0.3041]}, {"w": "pretrained", "b": [0.565, 0.2893, 0.6508, 0.3041]}, {"w": "word", "b": [0.6556, 0.2893, 0.6976, 0.3041]}, {"w": "embeddings", "b": [0.7023, 0.2893, 0.799, 0.3041]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 6.8. Training and validation accuracy without using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1294, 0.5781, 0.1827, 0.5929]}, {"w": "6.8.", "b": [0.1874, 0.5781, 0.2158, 0.5929]}, {"w": "Training", "b": [0.2205, 0.5781, 0.2906, 0.5929]}, {"w": "and", "b": [0.2953, 0.5781, 0.3258, 0.5929]}, {"w": "validation", "b": [0.3305, 0.5781, 0.4115, 0.5929]}, {"w": "accuracy", "b": [0.4162, 0.5781, 0.4887, 0.5929]}, {"w": "without", "b": [0.4934, 0.5781, 0.5555, 0.5929]}, {"w": "using", "b": [0.5602, 0.5781, 0.6033, 0.5929]}, {"w": "pretrained", "b": [0.608, 0.5781, 0.6939, 0.5929]}, {"w": "word", "b": [0.6986, 0.5781, 0.7406, 0.5929]}, {"w": "embeddings", "b": [0.7454, 0.5781, 0.8421, 0.5929]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.16. Training the same model without pretrained word embeddings", "words": [{"w": "Listing", "b": [0.1294, 0.8829, 0.1862, 0.8977]}, {"w": "6.16.", "b": [0.1909, 0.8829, 0.2288, 0.8977]}, {"w": "Training", "b": [0.2335, 0.8829, 0.3036, 0.8977]}, {"w": "the", "b": [0.3083, 0.8829, 0.3335, 0.8977]}, {"w": "same", "b": [0.3382, 0.8829, 0.3792, 0.8977]}, {"w": "model", "b": [0.3839, 0.8829, 0.4333, 0.8977]}, {"w": "without", "b": [0.4381, 0.8829, 0.5001, 0.8977]}, {"w": "pretrained", "b": [0.5048, 0.8829, 0.5907, 0.8977]}, {"w": "word", "b": [0.5954, 0.8829, 0.6374, 0.8977]}, {"w": "embeddings", "b": [0.6422, 0.8829, 0.7389, 0.8977]}]}]}, {"page": 258, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "from keras.models import Sequential from keras.layers import Embedding, Flatten, Dense model = Sequential() model.add(Embedding(max_words, embedding_dim, input_length=maxlen)) model.add(Flatten()) model.add(Dense(32, activation='relu')) model.add(Dense(1, activation='sigmoid')) model.summary() model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(x_train, y_train, epochs=10, batch_size=32, validation_data=(x_val, y_val))", "words": [{"w": "from", "b": [0.1357, 0.0851, 0.1811, 0.1002]}, {"w": "keras.models", "b": [0.1925, 0.0851, 0.3287, 0.1002]}, {"w": "import", "b": [0.34, 0.0851, 0.4082, 0.1002]}, {"w": "Sequential", "b": [0.4195, 0.0851, 0.533, 0.1002]}, {"w": "from", "b": [0.1357, 0.1002, 0.1811, 0.1154]}, {"w": "keras.layers", "b": [0.1925, 0.1002, 0.3287, 0.1154]}, {"w": "import", "b": [0.34, 0.1002, 0.4082, 0.1154]}, {"w": "Embedding,", "b": [0.4195, 0.1002, 0.533, 0.1154]}, {"w": "Flatten,", "b": [0.5444, 0.1002, 0.6352, 0.1154]}, {"w": "Dense", "b": [0.6465, 0.1002, 0.7033, 0.1154]}, {"w": "model", "b": [0.1357, 0.1305, 0.1925, 0.1457]}, {"w": "=", "b": [0.2038, 0.1305, 0.2152, 0.1457]}, {"w": "Sequential()", "b": [0.2265, 0.1305, 0.3628, 0.1457]}, {"w": "model.add(Embedding(max_words,", "b": [0.1357, 0.1457, 0.4763, 0.1608]}, {"w": "embedding_dim,", "b": [0.4876, 0.1457, 0.6465, 0.1608]}, {"w": "input_length=maxlen))", "b": [0.1357, 0.1608, 0.3741, 0.176]}, {"w": "model.add(Flatten())", "b": [0.1357, 0.176, 0.3628, 0.1911]}, {"w": "model.add(Dense(32,", "b": [0.1357, 0.1911, 0.3514, 0.2063]}, {"w": "activation='relu'))", "b": [0.3628, 0.1911, 0.5784, 0.2063]}, {"w": "model.add(Dense(1,", "b": [0.1357, 0.2063, 0.34, 0.2214]}, {"w": "activation='sigmoid'))", "b": [0.3514, 0.2063, 0.6011, 0.2214]}, {"w": "model.summary()", "b": [0.1357, 0.2215, 0.306, 0.2366]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.2518, 0.5217, 0.2669]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.2669, 0.6011, 0.2821]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.2821, 0.4763, 0.2972]}, {"w": "history", "b": [0.1357, 0.2972, 0.2152, 0.3124]}, {"w": "=", "b": [0.2265, 0.2972, 0.2379, 0.3124]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.2972, 0.4536, 0.3124]}, {"w": "y_train,", "b": [0.4649, 0.2972, 0.5557, 0.3124]}, {"w": "epochs=10,", "b": [0.3628, 0.3124, 0.4763, 0.3275]}, {"w": "batch_size=32,", "b": [0.3628, 0.3275, 0.5217, 0.3427]}, {"w": "validation_data=(x_val,", "b": [0.3628, 0.3427, 0.6238, 0.3578]}, {"w": "y_val))", "b": [0.6352, 0.3427, 0.7146, 0.3578]}]}, {"id": "b_1", "type": "paragraph", "text": "Validation accuracy stalls in the low 50s. So in this case, pretrained word embeddings outperform jointly learned embeddings. If you increase the number of training samples, this will quickly stop being the case—try it as an exercise.", "words": [{"w": "Validation", "b": [0.1294, 0.3807, 0.2331, 0.4004]}, {"w": "accuracy", "b": [0.2394, 0.3807, 0.3291, 0.4004]}, {"w": "stalls", "b": [0.3354, 0.3807, 0.3872, 0.4004]}, {"w": "in", "b": [0.3935, 0.3807, 0.4132, 0.4004]}, {"w": "the", "b": [0.4195, 0.3807, 0.4503, 0.4004]}, {"w": "low", "b": [0.4566, 0.3807, 0.4944, 0.4004]}, {"w": "50s.", "b": [0.5007, 0.3807, 0.5421, 0.4004]}, {"w": "So", "b": [0.5484, 0.3807, 0.575, 0.4004]}, {"w": "in", "b": [0.5813, 0.3807, 0.601, 0.4004]}, {"w": "this", "b": [0.6073, 0.3807, 0.6437, 0.4004]}, {"w": "case,", "b": [0.65, 0.3807, 0.6997, 0.4004]}, {"w": "pretrained", "b": [0.7061, 0.3807, 0.8083, 0.4004]}, {"w": "word", "b": [0.8146, 0.3807, 0.8665, 0.4004]}, {"w": "embeddings", "b": [0.1294, 0.4012, 0.2513, 0.4209]}, {"w": "outperform", "b": [0.2576, 0.4012, 0.3711, 0.4209]}, {"w": "jointly", "b": [0.3774, 0.4012, 0.4433, 0.4209]}, {"w": "learned", "b": [0.4496, 0.4012, 0.5239, 0.4209]}, {"w": "embeddings.", "b": [0.5302, 0.4012, 0.6584, 0.4209]}, {"w": "If", "b": [0.6646, 0.4012, 0.6814, 0.4209]}, {"w": "you", "b": [0.6877, 0.4012, 0.7256, 0.4209]}, {"w": "increase", "b": [0.7319, 0.4012, 0.8145, 0.4209]}, {"w": "the", "b": [0.8208, 0.4012, 0.8517, 0.4209]}, {"w": "number", "b": [0.1294, 0.4217, 0.2065, 0.4414]}, {"w": "of", "b": [0.2128, 0.4217, 0.2338, 0.4414]}, {"w": "training", "b": [0.2401, 0.4217, 0.3186, 0.4414]}, {"w": "samples,", "b": [0.3249, 0.4217, 0.4125, 0.4414]}, {"w": "this", "b": [0.4188, 0.4217, 0.4552, 0.4414]}, {"w": "will", "b": [0.4615, 0.4217, 0.5008, 0.4414]}, {"w": "quickly", "b": [0.5071, 0.4217, 0.5828, 0.4414]}, {"w": "stop", "b": [0.5891, 0.4217, 0.6311, 0.4414]}, {"w": "being", "b": [0.6374, 0.4217, 0.6935, 0.4414]}, {"w": "the", "b": [0.6998, 0.4217, 0.7306, 0.4414]}, {"w": "case—try", "b": [0.7369, 0.4217, 0.8336, 0.4414]}, {"w": "it", "b": [0.8399, 0.4217, 0.8539, 0.4414]}, {"w": "as", "b": [0.1294, 0.4422, 0.1504, 0.4619]}, {"w": "an", "b": [0.1567, 0.4422, 0.1805, 0.4619]}, {"w": "exercise.", "b": [0.1869, 0.4422, 0.2758, 0.4619]}]}, {"id": "b_2", "type": "paragraph", "text": "Finally, let’s evaluate the model on the test data. First, you need to tokenize the test data.", "words": [{"w": "Finally,", "b": [0.1294, 0.485, 0.2056, 0.5047]}, {"w": "let’s", "b": [0.2119, 0.485, 0.2539, 0.5047]}, {"w": "evaluate", "b": [0.2602, 0.485, 0.3443, 0.5047]}, {"w": "the", "b": [0.3506, 0.485, 0.3814, 0.5047]}, {"w": "model", "b": [0.3877, 0.485, 0.4508, 0.5047]}, {"w": "on", "b": [0.4571, 0.485, 0.4823, 0.5047]}, {"w": "the", "b": [0.4886, 0.485, 0.5194, 0.5047]}, {"w": "test", "b": [0.5257, 0.485, 0.5608, 0.5047]}, {"w": "data.", "b": [0.5671, 0.485, 0.6154, 0.5047]}, {"w": "First,", "b": [0.6217, 0.485, 0.6743, 0.5047]}, {"w": "you", "b": [0.6806, 0.485, 0.7184, 0.5047]}, {"w": "need", "b": [0.7247, 0.485, 0.7724, 0.5047]}, {"w": "to", "b": [0.7787, 0.485, 0.7983, 0.5047]}, {"w": "tokenize", "b": [0.1294, 0.5055, 0.2149, 0.5252]}, {"w": "the", "b": [0.2212, 0.5055, 0.252, 0.5252]}, {"w": "test", "b": [0.2583, 0.5055, 0.2934, 0.5252]}, {"w": "data.", "b": [0.2997, 0.5055, 0.348, 0.5252]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.17. Tokenizing the data of the test set", "words": [{"w": "Listing", "b": [0.1294, 0.5433, 0.1862, 0.5581]}, {"w": "6.17.", "b": [0.1909, 0.5433, 0.2288, 0.5581]}, {"w": "Tokenizing", "b": [0.2335, 0.5433, 0.3221, 0.5581]}, {"w": "the", "b": [0.3269, 0.5433, 0.3521, 0.5581]}, {"w": "data", "b": [0.3568, 0.5433, 0.3926, 0.5581]}, {"w": "of", "b": [0.3973, 0.5433, 0.4131, 0.5581]}, {"w": "the", "b": [0.4178, 0.5433, 0.443, 0.5581]}, {"w": "test", "b": [0.4477, 0.5433, 0.4761, 0.5581]}, {"w": "set", "b": [0.4808, 0.5433, 0.5029, 0.5581]}]}, {"id": "b_4", "type": "paragraph", "text": "test_dir = os.path.join(imdb_dir, 'test') labels = [] texts = [] for label_type in ['neg', 'pos']: dir_name = os.path.join(test_dir, label_type) for fname in sorted(os.listdir(dir_name)): if fname[-4:] == '.txt': f = open(os.path.join(dir_name, fname)) texts.append(f.read()) f.close() if label_type == 'neg': labels.append(0) else: labels.append(1) sequences = tokenizer.texts_to_sequences(texts) x_test = pad_sequences(sequences, maxlen=maxlen) y_test = np.asarray(labels)", "words": [{"w": "test_dir", "b": [0.1357, 0.5717, 0.2265, 0.5869]}, {"w": "=", "b": [0.2379, 0.5717, 0.2492, 0.5869]}, {"w": "os.path.join(imdb_dir,", "b": [0.2606, 0.5717, 0.5103, 0.5869]}, {"w": "'test')", "b": [0.5217, 0.5717, 0.6011, 0.5869]}, {"w": "labels", "b": [0.1357, 0.602, 0.2038, 0.6172]}, {"w": "=", "b": [0.2152, 0.602, 0.2265, 0.6172]}, {"w": "[]", "b": [0.2379, 0.602, 0.2606, 0.6172]}, {"w": "texts", "b": [0.1357, 0.6172, 0.1925, 0.6323]}, {"w": "=", "b": [0.2038, 0.6172, 0.2152, 0.6323]}, {"w": "[]", "b": [0.2265, 0.6172, 0.2492, 0.6323]}, {"w": "for", "b": [0.1357, 0.6475, 0.1698, 0.6626]}, {"w": "label_type", "b": [0.1811, 0.6475, 0.2946, 0.6626]}, {"w": "in", "b": [0.306, 0.6475, 0.3287, 0.6626]}, {"w": "['neg',", "b": [0.34, 0.6475, 0.4195, 0.6626]}, {"w": "'pos']:", "b": [0.4309, 0.6475, 0.5103, 0.6626]}, {"w": "dir_name", "b": [0.1811, 0.6627, 0.2719, 0.6778]}, {"w": "=", "b": [0.2833, 0.6627, 0.2946, 0.6778]}, {"w": "os.path.join(test_dir,", "b": [0.306, 0.6627, 0.5557, 0.6778]}, {"w": "label_type)", "b": [0.5671, 0.6627, 0.6919, 0.6778]}, {"w": "for", "b": [0.1811, 0.6778, 0.2152, 0.693]}, {"w": "fname", "b": [0.2265, 0.6778, 0.2833, 0.693]}, {"w": "in", "b": [0.2946, 0.6778, 0.3173, 0.693]}, {"w": "sorted(os.listdir(dir_name)):", "b": [0.3287, 0.6778, 0.6579, 0.693]}, {"w": "if", "b": [0.2265, 0.693, 0.2492, 0.7081]}, {"w": "fname[-4:]", "b": [0.2606, 0.693, 0.3741, 0.7081]}, {"w": "==", "b": [0.3855, 0.693, 0.4082, 0.7081]}, {"w": "'.txt':", "b": [0.4195, 0.693, 0.499, 0.7081]}, {"w": "f", "b": [0.2719, 0.7081, 0.2833, 0.7233]}, {"w": "=", "b": [0.2946, 0.7081, 0.306, 0.7233]}, {"w": "open(os.path.join(dir_name,", "b": [0.3173, 0.7081, 0.6238, 0.7233]}, {"w": "fname))", "b": [0.6352, 0.7081, 0.7146, 0.7233]}, {"w": "texts.append(f.read())", "b": [0.2719, 0.7233, 0.5217, 0.7384]}, {"w": "f.close()", "b": [0.2719, 0.7384, 0.3741, 0.7536]}, {"w": "if", "b": [0.2719, 0.7536, 0.2946, 0.7687]}, {"w": "label_type", "b": [0.306, 0.7536, 0.4195, 0.7687]}, {"w": "==", "b": [0.4309, 0.7536, 0.4536, 0.7687]}, {"w": "'neg':", "b": [0.4649, 0.7536, 0.533, 0.7687]}, {"w": "labels.append(0)", "b": [0.3173, 0.7687, 0.499, 0.7839]}, {"w": "else:", "b": [0.2719, 0.7839, 0.3287, 0.799]}, {"w": "labels.append(1)", "b": [0.3173, 0.799, 0.499, 0.8142]}, {"w": "sequences", "b": [0.1357, 0.8293, 0.2379, 0.8445]}, {"w": "=", "b": [0.2492, 0.8293, 0.2606, 0.8445]}, {"w": "tokenizer.texts_to_sequences(texts)", "b": [0.2719, 0.8293, 0.6692, 0.8445]}, {"w": "x_test", "b": [0.1357, 0.8445, 0.2038, 0.8596]}, {"w": "=", "b": [0.2152, 0.8445, 0.2265, 0.8596]}, {"w": "pad_sequences(sequences,", "b": [0.2379, 0.8445, 0.5103, 0.8596]}, {"w": "maxlen=maxlen)", "b": [0.5217, 0.8445, 0.6806, 0.8596]}, {"w": "y_test", "b": [0.1357, 0.8596, 0.2038, 0.8748]}, {"w": "=", "b": [0.2152, 0.8596, 0.2265, 0.8748]}, {"w": "np.asarray(labels)", "b": [0.2379, 0.8596, 0.4422, 0.8748]}]}]}, {"page": 259, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Next, load and evaluate the first model.", "words": [{"w": "Next,", "b": [0.1294, 0.0857, 0.1848, 0.1054]}, {"w": "load", "b": [0.1911, 0.0857, 0.2345, 0.1054]}, {"w": "and", "b": [0.2408, 0.0857, 0.2772, 0.1054]}, {"w": "evaluate", "b": [0.2835, 0.0857, 0.3676, 0.1054]}, {"w": "the", "b": [0.3739, 0.0857, 0.4047, 0.1054]}, {"w": "first", "b": [0.411, 0.0857, 0.4517, 0.1054]}, {"w": "model.", "b": [0.458, 0.0857, 0.5273, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 6.18. Evaluating the model on the test set", "words": [{"w": "Listing", "b": [0.1294, 0.1235, 0.1862, 0.1383]}, {"w": "6.18.", "b": [0.1909, 0.1235, 0.2288, 0.1383]}, {"w": "Evaluating", "b": [0.2335, 0.1235, 0.3218, 0.1383]}, {"w": "the", "b": [0.3265, 0.1235, 0.3517, 0.1383]}, {"w": "model", "b": [0.3565, 0.1235, 0.4059, 0.1383]}, {"w": "on", "b": [0.4106, 0.1235, 0.4306, 0.1383]}, {"w": "the", "b": [0.4353, 0.1235, 0.4605, 0.1383]}, {"w": "test", "b": [0.4652, 0.1235, 0.4936, 0.1383]}, {"w": "set", "b": [0.4983, 0.1235, 0.5204, 0.1383]}]}, {"id": "b_2", "type": "equation", "text": "model.load_weights('pre_trained_glove_model.h5') model.evaluate(x_test, y_test)", "words": [{"w": "model.load_weights('pre_trained_glove_model.h5')", "b": [0.1357, 0.1519, 0.6806, 0.1671]}, {"w": "model.evaluate(x_test,", "b": [0.1357, 0.1671, 0.3855, 0.1822]}, {"w": "y_test)", "b": [0.3968, 0.1671, 0.4763, 0.1822]}]}, {"id": "b_3", "type": "paragraph", "text": "You get an appalling test accuracy of 56%. Working with just a handful of training samples is difficult!", "words": [{"w": "You", "b": [0.1294, 0.2051, 0.1703, 0.2249]}, {"w": "get", "b": [0.1766, 0.2051, 0.2075, 0.2249]}, {"w": "an", "b": [0.2138, 0.2051, 0.2376, 0.2249]}, {"w": "appalling", "b": [0.2439, 0.2051, 0.3378, 0.2249]}, {"w": "test", "b": [0.3441, 0.2051, 0.3791, 0.2249]}, {"w": "accuracy", "b": [0.3854, 0.2051, 0.4751, 0.2249]}, {"w": "of", "b": [0.4814, 0.2051, 0.5024, 0.2249]}, {"w": "56%.", "b": [0.5087, 0.2051, 0.5612, 0.2249]}, {"w": "Working", "b": [0.5675, 0.2051, 0.6551, 0.2249]}, {"w": "with", "b": [0.6614, 0.2051, 0.7063, 0.2249]}, {"w": "just", "b": [0.7126, 0.2051, 0.749, 0.2249]}, {"w": "a", "b": [0.7554, 0.2051, 0.7666, 0.2249]}, {"w": "handful", "b": [0.7729, 0.2051, 0.8499, 0.2249]}, {"w": "of", "b": [0.1294, 0.2256, 0.1504, 0.2454]}, {"w": "training", "b": [0.1567, 0.2256, 0.2352, 0.2454]}, {"w": "samples", "b": [0.2415, 0.2256, 0.3228, 0.2454]}, {"w": "is", "b": [0.3291, 0.2256, 0.3459, 0.2454]}, {"w": "difficult!", "b": [0.3522, 0.2256, 0.4414, 0.2454]}]}, {"id": "b_4", "type": "paragraph", "text": "6.1.4. Wrapping up", "words": [{"w": "6.1.4.", "b": [0.1294, 0.2729, 0.1862, 0.2926]}, {"w": "Wrapping", "b": [0.1925, 0.2729, 0.3028, 0.2926]}, {"w": "up", "b": [0.3091, 0.2729, 0.3371, 0.2926]}]}, {"id": "b_5", "type": "paragraph", "text": "Now you’re able to do the following:", "words": [{"w": "Now", "b": [0.1294, 0.3156, 0.1785, 0.3354]}, {"w": "you’re", "b": [0.1848, 0.3156, 0.2506, 0.3354]}, {"w": "able", "b": [0.2569, 0.3156, 0.2989, 0.3354]}, {"w": "to", "b": [0.3052, 0.3156, 0.3249, 0.3354]}, {"w": "do", "b": [0.3312, 0.3156, 0.3564, 0.3354]}, {"w": "the", "b": [0.3627, 0.3156, 0.3935, 0.3354]}, {"w": "following:", "b": [0.3998, 0.3156, 0.5049, 0.3354]}]}, {"id": "b_6", "type": "paragraph", "text": "Turn raw text into something a neural network can process Use the Embedding layer in a Keras model to learn task-specific token embeddings Use pretrained word embeddings to get an extra boost on small natural--language-processing problems", "words": [{"w": "Turn", "b": [0.1799, 0.354, 0.228, 0.3737]}, {"w": "raw", "b": [0.2343, 0.354, 0.2721, 0.3737]}, {"w": "text", "b": [0.2784, 0.354, 0.3163, 0.3737]}, {"w": "into", "b": [0.3226, 0.354, 0.3618, 0.3737]}, {"w": "something", "b": [0.3681, 0.354, 0.4733, 0.3737]}, {"w": "a", "b": [0.4796, 0.354, 0.4908, 0.3737]}, {"w": "neural", "b": [0.4971, 0.354, 0.5601, 0.3737]}, {"w": "network", "b": [0.5664, 0.354, 0.6491, 0.3737]}, {"w": "can", "b": [0.6554, 0.354, 0.6904, 0.3737]}, {"w": "process", "b": [0.6967, 0.354, 0.7724, 0.3737]}, {"w": "Use", "b": [0.1799, 0.3745, 0.2191, 0.3942]}, {"w": "the", "b": [0.2254, 0.3745, 0.2562, 0.3942]}, {"w": "Embedding", "b": [0.2625, 0.3755, 0.3987, 0.3957]}, {"w": "layer", "b": [0.4051, 0.3745, 0.4555, 0.3942]}, {"w": "in", "b": [0.4618, 0.3745, 0.4814, 0.3942]}, {"w": "a", "b": [0.4877, 0.3745, 0.4989, 0.3942]}, {"w": "Keras", "b": [0.5052, 0.3745, 0.5641, 0.3942]}, {"w": "model", "b": [0.5704, 0.3745, 0.6334, 0.3942]}, {"w": "to", "b": [0.6397, 0.3745, 0.6594, 0.3942]}, {"w": "learn", "b": [0.6657, 0.3745, 0.7161, 0.3942]}, {"w": "task-specific", "b": [0.7224, 0.3745, 0.8499, 0.3942]}, {"w": "token", "b": [0.1799, 0.3959, 0.2359, 0.4156]}, {"w": "embeddings", "b": [0.2422, 0.3959, 0.3641, 0.4156]}, {"w": "Use", "b": [0.1799, 0.4164, 0.2191, 0.4361]}, {"w": "pretrained", "b": [0.2254, 0.4164, 0.3277, 0.4361]}, {"w": "word", "b": [0.334, 0.4164, 0.3858, 0.4361]}, {"w": "embeddings", "b": [0.3921, 0.4164, 0.514, 0.4361]}, {"w": "to", "b": [0.5203, 0.4164, 0.54, 0.4361]}, {"w": "get", "b": [0.5463, 0.4164, 0.5771, 0.4361]}, {"w": "an", "b": [0.5834, 0.4164, 0.6072, 0.4361]}, {"w": "extra", "b": [0.6135, 0.4164, 0.6639, 0.4361]}, {"w": "boost", "b": [0.6703, 0.4164, 0.7249, 0.4361]}, {"w": "on", "b": [0.7312, 0.4164, 0.7564, 0.4361]}, {"w": "small", "b": [0.7628, 0.4164, 0.8174, 0.4361]}, {"w": "natural--language-processing", "b": [0.1799, 0.4369, 0.4741, 0.4566]}, {"w": "problems", "b": [0.4804, 0.4369, 0.5743, 0.4566]}]}, {"id": "b_7", "type": "paragraph", "text": "6.2. Understanding recurrent neural networks", "words": [{"w": "6.2.", "b": [0.1294, 0.4937, 0.172, 0.5159]}, {"w": "Understanding", "b": [0.1791, 0.4937, 0.3604, 0.5159]}, {"w": "recurrent", "b": [0.3675, 0.4937, 0.4831, 0.5159]}, {"w": "neural", "b": [0.4902, 0.4937, 0.569, 0.5159]}, {"w": "networks", "b": [0.5761, 0.4937, 0.688, 0.5159]}]}, {"id": "b_8", "type": "paragraph", "text": "A major characteristic of all neural networks you’ve seen so far, such as densely connected networks and convnets, is that they have no memory. Each input shown to them is processed independently, with no state kept in between inputs. With such networks, in order to process a sequence or a temporal series of data points, you have to show the entire sequence to the network at once: turn it into a single data point. For instance, this is what you did in the IMDB example: an entire movie review was transformed into a single large vector and processed in one go. Such networks are called feedforward networks.", "words": [{"w": "A", "b": [0.1294, 0.5394, 0.1476, 0.5591]}, {"w": "major", "b": [0.1539, 0.5394, 0.2128, 0.5591]}, {"w": "characteristic", "b": [0.2191, 0.5394, 0.3536, 0.5591]}, {"w": "of", "b": [0.3599, 0.5394, 0.3809, 0.5591]}, {"w": "all", "b": [0.3872, 0.5394, 0.4124, 0.5591]}, {"w": "neural", "b": [0.4187, 0.5394, 0.4818, 0.5591]}, {"w": "networks", "b": [0.4881, 0.5394, 0.5805, 0.5591]}, {"w": "you’ve", "b": [0.5869, 0.5394, 0.6569, 0.5591]}, {"w": "seen", "b": [0.6632, 0.5394, 0.708, 0.5591]}, {"w": "so", "b": [0.7143, 0.5394, 0.7368, 0.5591]}, {"w": "far,", "b": [0.7431, 0.5394, 0.7763, 0.5591]}, {"w": "such", "b": [0.7826, 0.5394, 0.8288, 0.5591]}, {"w": "as", "b": [0.8352, 0.5394, 0.8562, 0.5591]}, {"w": "densely", "b": [0.1294, 0.5599, 0.2065, 0.5796]}, {"w": "connected", "b": [0.2128, 0.5599, 0.315, 0.5796]}, {"w": "networks", "b": [0.3214, 0.5599, 0.4138, 0.5796]}, {"w": "and", "b": [0.4201, 0.5599, 0.4566, 0.5796]}, {"w": "convnets,", "b": [0.4629, 0.5599, 0.5589, 0.5796]}, {"w": "is", "b": [0.5652, 0.5599, 0.582, 0.5796]}, {"w": "that", "b": [0.5883, 0.5599, 0.6261, 0.5796]}, {"w": "they", "b": [0.6324, 0.5599, 0.6758, 0.5796]}, {"w": "have", "b": [0.6821, 0.5599, 0.7297, 0.5796]}, {"w": "no", "b": [0.736, 0.5599, 0.7613, 0.5796]}, {"w": "memory.", "b": [0.7676, 0.5599, 0.8563, 0.5796]}, {"w": "Each", "b": [0.1294, 0.5804, 0.1798, 0.6001]}, {"w": "input", "b": [0.1861, 0.5804, 0.238, 0.6001]}, {"w": "shown", "b": [0.2443, 0.5804, 0.3102, 0.6001]}, {"w": "to", "b": [0.3165, 0.5804, 0.3361, 0.6001]}, {"w": "them", "b": [0.3424, 0.5804, 0.3929, 0.6001]}, {"w": "is", "b": [0.3992, 0.5804, 0.416, 0.6001]}, {"w": "processed", "b": [0.4223, 0.5804, 0.5218, 0.6001]}, {"w": "independently,", "b": [0.5281, 0.5804, 0.6756, 0.6001]}, {"w": "with", "b": [0.6819, 0.5804, 0.7268, 0.6001]}, {"w": "no", "b": [0.7331, 0.5804, 0.7583, 0.6001]}, {"w": "state", "b": [0.7646, 0.5804, 0.8109, 0.6001]}, {"w": "kept", "b": [0.8172, 0.5804, 0.8606, 0.6001]}, {"w": "in", "b": [0.1294, 0.6009, 0.149, 0.6206]}, {"w": "between", "b": [0.1553, 0.6009, 0.2394, 0.6206]}, {"w": "inputs.", "b": [0.2457, 0.6009, 0.3137, 0.6206]}, {"w": "With", "b": [0.32, 0.6009, 0.3694, 0.6206]}, {"w": "such", "b": [0.3757, 0.6009, 0.422, 0.6206]}, {"w": "networks,", "b": [0.4282, 0.6009, 0.527, 0.6206]}, {"w": "in", "b": [0.5333, 0.6009, 0.553, 0.6206]}, {"w": "order", "b": [0.5593, 0.6009, 0.6125, 0.6206]}, {"w": "to", "b": [0.6188, 0.6009, 0.6384, 0.6206]}, {"w": "process", "b": [0.6447, 0.6009, 0.7204, 0.6206]}, {"w": "a", "b": [0.7267, 0.6009, 0.7379, 0.6206]}, {"w": "sequence", "b": [0.7442, 0.6009, 0.8366, 0.6206]}, {"w": "or", "b": [0.843, 0.6009, 0.864, 0.6206]}, {"w": "a", "b": [0.1294, 0.6214, 0.1406, 0.6411]}, {"w": "temporal", "b": [0.1469, 0.6214, 0.2366, 0.6411]}, {"w": "series", "b": [0.2429, 0.6214, 0.3003, 0.6411]}, {"w": "of", "b": [0.3066, 0.6214, 0.3277, 0.6411]}, {"w": "data", "b": [0.334, 0.6214, 0.376, 0.6411]}, {"w": "points,", "b": [0.3823, 0.6214, 0.4503, 0.6411]}, {"w": "you", "b": [0.4566, 0.6214, 0.4944, 0.6411]}, {"w": "have", "b": [0.5007, 0.6214, 0.5484, 0.6411]}, {"w": "to", "b": [0.5547, 0.6214, 0.5743, 0.6411]}, {"w": "show", "b": [0.5806, 0.6214, 0.6339, 0.6411]}, {"w": "the", "b": [0.6402, 0.6214, 0.671, 0.6411]}, {"w": "entire", "b": [0.6773, 0.6214, 0.7347, 0.6411]}, {"w": "sequence", "b": [0.741, 0.6214, 0.8335, 0.6411]}, {"w": "to", "b": [0.8398, 0.6214, 0.8594, 0.6411]}, {"w": "the", "b": [0.1294, 0.6419, 0.1602, 0.6616]}, {"w": "network", "b": [0.1665, 0.6419, 0.2492, 0.6616]}, {"w": "at", "b": [0.2555, 0.6419, 0.2737, 0.6616]}, {"w": "once:", "b": [0.28, 0.6419, 0.3347, 0.6616]}, {"w": "turn", "b": [0.341, 0.6419, 0.3816, 0.6616]}, {"w": "it", "b": [0.3879, 0.6419, 0.4019, 0.6616]}, {"w": "into", "b": [0.4082, 0.6419, 0.4475, 0.6616]}, {"w": "a", "b": [0.4538, 0.6419, 0.465, 0.6616]}, {"w": "single", "b": [0.4713, 0.6419, 0.5316, 0.6616]}, {"w": "data", "b": [0.5379, 0.6419, 0.5799, 0.6616]}, {"w": "point.", "b": [0.5862, 0.6419, 0.6444, 0.6616]}, {"w": "For", "b": [0.6507, 0.6419, 0.6857, 0.6616]}, {"w": "instance,", "b": [0.692, 0.6419, 0.781, 0.6616]}, {"w": "this", "b": [0.7873, 0.6419, 0.8238, 0.6616]}, {"w": "is", "b": [0.8301, 0.6419, 0.8469, 0.6616]}, {"w": "what", "b": [0.1294, 0.6624, 0.1785, 0.6821]}, {"w": "you", "b": [0.1848, 0.6624, 0.2226, 0.6821]}, {"w": "did", "b": [0.2289, 0.6624, 0.2611, 0.6821]}, {"w": "in", "b": [0.2674, 0.6624, 0.2871, 0.6821]}, {"w": "the", "b": [0.2934, 0.6624, 0.3242, 0.6821]}, {"w": "IMDB", "b": [0.3305, 0.6624, 0.3964, 0.6821]}, {"w": "example:", "b": [0.4027, 0.6624, 0.4952, 0.6821]}, {"w": "an", "b": [0.5015, 0.6624, 0.5253, 0.6821]}, {"w": "entire", "b": [0.5316, 0.6624, 0.589, 0.6821]}, {"w": "movie", "b": [0.5953, 0.6624, 0.6584, 0.6821]}, {"w": "review", "b": [0.6646, 0.6624, 0.7333, 0.6821]}, {"w": "was", "b": [0.7396, 0.6624, 0.7788, 0.6821]}, {"w": "transformed", "b": [0.1294, 0.6829, 0.2513, 0.7026]}, {"w": "into", "b": [0.2576, 0.6829, 0.2969, 0.7026]}, {"w": "a", "b": [0.3032, 0.6829, 0.3144, 0.7026]}, {"w": "single", "b": [0.3207, 0.6829, 0.3809, 0.7026]}, {"w": "large", "b": [0.3872, 0.6829, 0.4372, 0.7026]}, {"w": "vector", "b": [0.4435, 0.6829, 0.5065, 0.7026]}, {"w": "and", "b": [0.5128, 0.6829, 0.5493, 0.7026]}, {"w": "processed", "b": [0.5556, 0.6829, 0.655, 0.7026]}, {"w": "in", "b": [0.6613, 0.6829, 0.681, 0.7026]}, {"w": "one", "b": [0.6873, 0.6829, 0.7237, 0.7026]}, {"w": "go.", "b": [0.73, 0.6829, 0.7615, 0.7026]}, {"w": "Such", "b": [0.7678, 0.6829, 0.8183, 0.7026]}, {"w": "networks", "b": [0.1294, 0.7034, 0.2219, 0.7231]}, {"w": "are", "b": [0.2282, 0.7034, 0.259, 0.7231]}, {"w": "called", "b": [0.2653, 0.7034, 0.3255, 0.7231]}, {"w": "feedforward", "b": [0.3318, 0.7034, 0.4542, 0.7231]}, {"w": "networks.", "b": [0.4605, 0.7034, 0.5579, 0.7231]}]}, {"id": "b_9", "type": "paragraph", "text": "In contrast, as you’re reading the present sentence, you’re processing it word by word—or rather, eye saccade by eye saccade—while keeping memories of what came before; this gives you a fluid representation of the meaning conveyed by this sentence. Biological intelligence processes information incrementally while maintaining an internal model of what it’s processing, built from past information and constantly updated as new information comes in.", "words": [{"w": "In", "b": [0.1294, 0.7461, 0.1504, 0.7659]}, {"w": "contrast,", "b": [0.1567, 0.7461, 0.2429, 0.7659]}, {"w": "as", "b": [0.2492, 0.7461, 0.2702, 0.7659]}, {"w": "you’re", "b": [0.2765, 0.7461, 0.3424, 0.7659]}, {"w": "reading", "b": [0.3487, 0.7461, 0.4243, 0.7659]}, {"w": "the", "b": [0.4306, 0.7461, 0.4615, 0.7659]}, {"w": "present", "b": [0.4678, 0.7461, 0.5406, 0.7659]}, {"w": "sentence,", "b": [0.5469, 0.7461, 0.6401, 0.7659]}, {"w": "you’re", "b": [0.6464, 0.7461, 0.7122, 0.7659]}, {"w": "processing", "b": [0.7185, 0.7461, 0.8264, 0.7659]}, {"w": "it", "b": [0.8327, 0.7461, 0.8468, 0.7659]}, {"w": "word", "b": [0.1294, 0.7666, 0.1813, 0.7864]}, {"w": "by", "b": [0.1876, 0.7666, 0.2128, 0.7864]}, {"w": "word—or", "b": [0.2191, 0.7666, 0.3172, 0.7864]}, {"w": "rather,", "b": [0.3235, 0.7666, 0.3876, 0.7864]}, {"w": "eye", "b": [0.3939, 0.7666, 0.4289, 0.7864]}, {"w": "saccade", "b": [0.4352, 0.7666, 0.5136, 0.7864]}, {"w": "by", "b": [0.52, 0.7666, 0.5452, 0.7864]}, {"w": "eye", "b": [0.5515, 0.7666, 0.5865, 0.7864]}, {"w": "saccade—while", "b": [0.5928, 0.7666, 0.7525, 0.7864]}, {"w": "keeping", "b": [0.7588, 0.7666, 0.8386, 0.7864]}, {"w": "memories", "b": [0.1294, 0.7871, 0.2289, 0.8069]}, {"w": "of", "b": [0.2352, 0.7871, 0.2562, 0.8069]}, {"w": "what", "b": [0.2625, 0.7871, 0.3116, 0.8069]}, {"w": "came", "b": [0.3179, 0.7871, 0.3711, 0.8069]}, {"w": "before;", "b": [0.3774, 0.7871, 0.4488, 0.8069]}, {"w": "this", "b": [0.4552, 0.7871, 0.4916, 0.8069]}, {"w": "gives", "b": [0.4979, 0.7871, 0.5512, 0.8069]}, {"w": "you", "b": [0.5575, 0.7871, 0.5953, 0.8069]}, {"w": "a", "b": [0.6016, 0.7871, 0.6128, 0.8069]}, {"w": "fluid", "b": [0.6191, 0.7871, 0.6668, 0.8069]}, {"w": "representation", "b": [0.6731, 0.7871, 0.816, 0.8069]}, {"w": "of", "b": [0.8223, 0.7871, 0.8433, 0.8069]}, {"w": "the", "b": [0.1294, 0.8076, 0.1602, 0.8274]}, {"w": "meaning", "b": [0.1665, 0.8076, 0.2534, 0.8274]}, {"w": "conveyed", "b": [0.2597, 0.8076, 0.3564, 0.8274]}, {"w": "by", "b": [0.3627, 0.8076, 0.3879, 0.8274]}, {"w": "this", "b": [0.3942, 0.8076, 0.4307, 0.8274]}, {"w": "sentence.", "b": [0.437, 0.8076, 0.5301, 0.8274]}, {"w": "Biological", "b": [0.5365, 0.8076, 0.6416, 0.8274]}, {"w": "intelligence", "b": [0.6478, 0.8076, 0.7655, 0.8274]}, {"w": "processes", "b": [0.7718, 0.8076, 0.8685, 0.8274]}, {"w": "information", "b": [0.1294, 0.8281, 0.2485, 0.8479]}, {"w": "incrementally", "b": [0.2548, 0.8281, 0.3936, 0.8479]}, {"w": "while", "b": [0.3999, 0.8281, 0.4559, 0.8479]}, {"w": "maintaining", "b": [0.4622, 0.8281, 0.5827, 0.8479]}, {"w": "an", "b": [0.5891, 0.8281, 0.6129, 0.8479]}, {"w": "internal", "b": [0.6192, 0.8281, 0.6962, 0.8479]}, {"w": "model", "b": [0.7025, 0.8281, 0.7656, 0.8479]}, {"w": "of", "b": [0.7719, 0.8281, 0.7929, 0.8479]}, {"w": "what", "b": [0.7992, 0.8281, 0.8483, 0.8479]}, {"w": "it’s", "b": [0.1294, 0.8486, 0.1603, 0.8684]}, {"w": "processing,", "b": [0.1666, 0.8486, 0.2808, 0.8684]}, {"w": "built", "b": [0.2871, 0.8486, 0.3333, 0.8684]}, {"w": "from", "b": [0.3396, 0.8486, 0.3887, 0.8684]}, {"w": "past", "b": [0.395, 0.8486, 0.4356, 0.8684]}, {"w": "information", "b": [0.4419, 0.8486, 0.561, 0.8684]}, {"w": "and", "b": [0.5673, 0.8486, 0.6037, 0.8684]}, {"w": "constantly", "b": [0.6101, 0.8486, 0.7138, 0.8684]}, {"w": "updated", "b": [0.7201, 0.8486, 0.7999, 0.8684]}, {"w": "as", "b": [0.8062, 0.8486, 0.8272, 0.8684]}, {"w": "new", "b": [0.1294, 0.8691, 0.1714, 0.8889]}, {"w": "information", "b": [0.1777, 0.8691, 0.2969, 0.8889]}, {"w": "comes", "b": [0.3032, 0.8691, 0.3676, 0.8889]}, {"w": "in.", "b": [0.3739, 0.8691, 0.3999, 0.8889]}]}]}, {"page": 260, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "A recurrent neural network (RNN) adopts the same principle, albeit in an extremely simplified version: it processes sequences by iterating through the sequence elements and maintaining a state containing information relative to what it has seen so far. In effect, an RNN is a type of neural network that has an internal loop (see figure 6.9). The state of the RNN is reset between processing two different, independent sequences (such as two different IMDB reviews), so you still consider one sequence a single data point: a single input to the network. What changes is that this data point is no longer processed in a single step; rather, the network internally loops over sequence elements.", "words": [{"w": "A", "b": [0.1294, 0.0857, 0.1476, 0.1054]}, {"w": "recurrent", "b": [0.1539, 0.0857, 0.2473, 0.1054]}, {"w": "neural", "b": [0.2536, 0.0857, 0.3195, 0.1054]}, {"w": "network", "b": [0.3258, 0.0857, 0.4071, 0.1054]}, {"w": "(RNN)", "b": [0.4134, 0.0857, 0.4834, 0.1054]}, {"w": "adopts", "b": [0.4897, 0.0857, 0.5556, 0.1054]}, {"w": "the", "b": [0.5619, 0.0857, 0.5927, 0.1054]}, {"w": "same", "b": [0.599, 0.0857, 0.6509, 0.1054]}, {"w": "principle,", "b": [0.6572, 0.0857, 0.7532, 0.1054]}, {"w": "albeit", "b": [0.7595, 0.0857, 0.8155, 0.1054]}, {"w": "in", "b": [0.8218, 0.0857, 0.8415, 0.1054]}, {"w": "an", "b": [0.1294, 0.1062, 0.1532, 0.1259]}, {"w": "extremely", "b": [0.1595, 0.1062, 0.2604, 0.1259]}, {"w": "simplified", "b": [0.2667, 0.1062, 0.369, 0.1259]}, {"w": "version:", "b": [0.3753, 0.1062, 0.4566, 0.1259]}, {"w": "it", "b": [0.4629, 0.1062, 0.4769, 0.1259]}, {"w": "processes", "b": [0.4833, 0.1062, 0.5799, 0.1259]}, {"w": "sequences", "b": [0.5862, 0.1062, 0.6885, 0.1259]}, {"w": "by", "b": [0.6948, 0.1062, 0.72, 0.1259]}, {"w": "iterating", "b": [0.7263, 0.1062, 0.8104, 0.1259]}, {"w": "through", "b": [0.1294, 0.1267, 0.2079, 0.1464]}, {"w": "the", "b": [0.2142, 0.1267, 0.245, 0.1464]}, {"w": "sequence", "b": [0.2513, 0.1267, 0.3438, 0.1464]}, {"w": "elements", "b": [0.3501, 0.1267, 0.4397, 0.1464]}, {"w": "and", "b": [0.446, 0.1267, 0.4825, 0.1464]}, {"w": "maintaining", "b": [0.4888, 0.1267, 0.6093, 0.1464]}, {"w": "a", "b": [0.6156, 0.1267, 0.6268, 0.1464]}, {"w": "state", "b": [0.633, 0.1267, 0.6807, 0.1464]}, {"w": "containing", "b": [0.687, 0.1267, 0.7935, 0.1464]}, {"w": "information", "b": [0.1294, 0.1472, 0.2485, 0.1669]}, {"w": "relative", "b": [0.2548, 0.1472, 0.3305, 0.1669]}, {"w": "to", "b": [0.3368, 0.1472, 0.3564, 0.1669]}, {"w": "what", "b": [0.3627, 0.1472, 0.4118, 0.1669]}, {"w": "it", "b": [0.4181, 0.1472, 0.4321, 0.1669]}, {"w": "has", "b": [0.4384, 0.1472, 0.472, 0.1669]}, {"w": "seen", "b": [0.4783, 0.1472, 0.5232, 0.1669]}, {"w": "so", "b": [0.5295, 0.1472, 0.5519, 0.1669]}, {"w": "far.", "b": [0.5582, 0.1472, 0.5911, 0.1669]}, {"w": "In", "b": [0.5974, 0.1472, 0.6184, 0.1669]}, {"w": "effect,", "b": [0.6247, 0.1472, 0.6879, 0.1669]}, {"w": "an", "b": [0.6942, 0.1472, 0.7181, 0.1669]}, {"w": "RNN", "b": [0.7244, 0.1472, 0.7776, 0.1669]}, {"w": "is", "b": [0.7839, 0.1472, 0.8007, 0.1669]}, {"w": "a", "b": [0.8071, 0.1472, 0.8183, 0.1669]}, {"w": "type", "b": [0.8246, 0.1472, 0.868, 0.1669]}, {"w": "of", "b": [0.1294, 0.1677, 0.1504, 0.1874]}, {"w": "neural", "b": [0.1567, 0.1677, 0.2198, 0.1874]}, {"w": "network", "b": [0.2261, 0.1677, 0.3087, 0.1874]}, {"w": "that", "b": [0.315, 0.1677, 0.3529, 0.1874]}, {"w": "has", "b": [0.3592, 0.1677, 0.3928, 0.1874]}, {"w": "an", "b": [0.3991, 0.1677, 0.4229, 0.1874]}, {"w": "internal", "b": [0.4292, 0.1677, 0.5063, 0.1874]}, {"w": "loop", "b": [0.5125, 0.1677, 0.5574, 0.1874]}, {"w": "(see", "b": [0.5637, 0.1677, 0.6043, 0.1874]}, {"w": "figure", "b": [0.6106, 0.1677, 0.6709, 0.1874]}, {"w": "6.9).", "b": [0.6772, 0.1677, 0.7234, 0.1874]}, {"w": "The", "b": [0.7297, 0.1677, 0.7689, 0.1874]}, {"w": "state", "b": [0.7752, 0.1677, 0.8215, 0.1874]}, {"w": "of", "b": [0.8278, 0.1677, 0.8488, 0.1874]}, {"w": "the", "b": [0.1294, 0.1882, 0.1602, 0.2079]}, {"w": "RNN", "b": [0.1665, 0.1882, 0.2198, 0.2079]}, {"w": "is", "b": [0.2261, 0.1882, 0.2429, 0.2079]}, {"w": "reset", "b": [0.2492, 0.1882, 0.2969, 0.2079]}, {"w": "between", "b": [0.3032, 0.1882, 0.3872, 0.2079]}, {"w": "processing", "b": [0.3935, 0.1882, 0.5014, 0.2079]}, {"w": "two", "b": [0.5077, 0.1882, 0.5456, 0.2079]}, {"w": "different,", "b": [0.5519, 0.1882, 0.6445, 0.2079]}, {"w": "independent", "b": [0.6509, 0.1882, 0.7742, 0.2079]}, {"w": "sequences", "b": [0.1294, 0.2087, 0.2317, 0.2284]}, {"w": "(such", "b": [0.238, 0.2087, 0.2926, 0.2284]}, {"w": "as", "b": [0.2989, 0.2087, 0.3199, 0.2284]}, {"w": "two", "b": [0.3262, 0.2087, 0.3641, 0.2284]}, {"w": "different", "b": [0.3704, 0.2087, 0.4568, 0.2284]}, {"w": "IMDB", "b": [0.4631, 0.2087, 0.529, 0.2284]}, {"w": "reviews),", "b": [0.5353, 0.2087, 0.6284, 0.2284]}, {"w": "so", "b": [0.6347, 0.2087, 0.6571, 0.2284]}, {"w": "you", "b": [0.6634, 0.2087, 0.7013, 0.2284]}, {"w": "still", "b": [0.7076, 0.2087, 0.7455, 0.2284]}, {"w": "consider", "b": [0.7518, 0.2087, 0.8372, 0.2284]}, {"w": "one", "b": [0.1294, 0.2292, 0.1658, 0.2489]}, {"w": "sequence", "b": [0.1721, 0.2292, 0.2646, 0.2489]}, {"w": "a", "b": [0.2709, 0.2292, 0.2821, 0.2489]}, {"w": "single", "b": [0.2884, 0.2292, 0.3487, 0.2489]}, {"w": "data", "b": [0.355, 0.2292, 0.397, 0.2489]}, {"w": "point:", "b": [0.4033, 0.2292, 0.4622, 0.2489]}, {"w": "a", "b": [0.4685, 0.2292, 0.4797, 0.2489]}, {"w": "single", "b": [0.486, 0.2292, 0.5463, 0.2489]}, {"w": "input", "b": [0.5526, 0.2292, 0.6044, 0.2489]}, {"w": "to", "b": [0.6107, 0.2292, 0.6304, 0.2489]}, {"w": "the", "b": [0.6367, 0.2292, 0.6675, 0.2489]}, {"w": "network.", "b": [0.6738, 0.2292, 0.7628, 0.2489]}, {"w": "What", "b": [0.7691, 0.2292, 0.8237, 0.2489]}, {"w": "changes", "b": [0.1294, 0.2497, 0.2107, 0.2694]}, {"w": "is", "b": [0.217, 0.2497, 0.2338, 0.2694]}, {"w": "that", "b": [0.2401, 0.2497, 0.2779, 0.2694]}, {"w": "this", "b": [0.2842, 0.2497, 0.3207, 0.2694]}, {"w": "data", "b": [0.327, 0.2497, 0.369, 0.2694]}, {"w": "point", "b": [0.3753, 0.2497, 0.4272, 0.2694]}, {"w": "is", "b": [0.4335, 0.2497, 0.4503, 0.2694]}, {"w": "no", "b": [0.4566, 0.2497, 0.4818, 0.2694]}, {"w": "longer", "b": [0.4881, 0.2497, 0.5526, 0.2694]}, {"w": "processed", "b": [0.5589, 0.2497, 0.6583, 0.2694]}, {"w": "in", "b": [0.6647, 0.2497, 0.6843, 0.2694]}, {"w": "a", "b": [0.6906, 0.2497, 0.7018, 0.2694]}, {"w": "single", "b": [0.7081, 0.2497, 0.7684, 0.2694]}, {"w": "step;", "b": [0.7747, 0.2497, 0.8223, 0.2694]}, {"w": "rather,", "b": [0.1294, 0.2702, 0.1935, 0.2899]}, {"w": "the", "b": [0.1998, 0.2702, 0.2307, 0.2899]}, {"w": "network", "b": [0.237, 0.2702, 0.3196, 0.2899]}, {"w": "internally", "b": [0.3259, 0.2702, 0.4226, 0.2899]}, {"w": "loops", "b": [0.4289, 0.2702, 0.4836, 0.2899]}, {"w": "over", "b": [0.4899, 0.2702, 0.5347, 0.2899]}, {"w": "sequence", "b": [0.541, 0.2702, 0.6335, 0.2899]}, {"w": "elements.", "b": [0.6398, 0.2702, 0.7358, 0.2899]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.9. A recurrent network: a network with a loop", "words": [{"w": "Figure", "b": [0.1294, 0.308, 0.1827, 0.3228]}, {"w": "6.9.", "b": [0.1874, 0.308, 0.2158, 0.3228]}, {"w": "A", "b": [0.2205, 0.308, 0.2341, 0.3228]}, {"w": "recurrent", "b": [0.2389, 0.308, 0.3159, 0.3228]}, {"w": "network:", "b": [0.3206, 0.308, 0.3942, 0.3228]}, {"w": "a", "b": [0.3989, 0.308, 0.4084, 0.3228]}, {"w": "network", "b": [0.4131, 0.308, 0.4804, 0.3228]}, {"w": "with", "b": [0.4851, 0.308, 0.5209, 0.3228]}, {"w": "a", "b": [0.5256, 0.308, 0.535, 0.3228]}, {"w": "loop", "b": [0.5398, 0.308, 0.5745, 0.3228]}]}, {"id": "b_2", "type": "paragraph", "text": "To make these notions of loop and state clear, let’s implement the forward pass of a toy RNN in Numpy. This RNN takes as input a sequence of vectors, which you’ll encode as a 2D tensor of size (timesteps, input_features). It loops over timesteps, and at each timestep, it considers its current state at t and the input at t (of shape (input_features,), and combines them to obtain the output at t. You’ll then set the state for the next step to be this previous output. For the first timestep, the previous output isn’t defined; hence, there is no current state. So, you’ll initialize the state as an all-zero vector called the initial state of the network.", "words": [{"w": "To", "b": [0.1294, 0.4805, 0.1557, 0.5003]}, {"w": "make", "b": [0.162, 0.4805, 0.2166, 0.5003]}, {"w": "these", "b": [0.2229, 0.4805, 0.2748, 0.5003]}, {"w": "notions", "b": [0.2811, 0.4805, 0.3554, 0.5003]}, {"w": "of", "b": [0.3617, 0.4805, 0.3827, 0.5003]}, {"w": "loop", "b": [0.389, 0.4805, 0.4338, 0.5003]}, {"w": "and", "b": [0.4401, 0.4805, 0.4765, 0.5003]}, {"w": "state", "b": [0.4828, 0.4805, 0.5305, 0.5003]}, {"w": "clear,", "b": [0.5368, 0.4805, 0.5911, 0.5003]}, {"w": "let’s", "b": [0.5974, 0.4805, 0.6394, 0.5003]}, {"w": "implement", "b": [0.6457, 0.4805, 0.7536, 0.5003]}, {"w": "the", "b": [0.7599, 0.4805, 0.7908, 0.5003]}, {"w": "forward", "b": [0.1294, 0.501, 0.2093, 0.5208]}, {"w": "pass", "b": [0.2156, 0.501, 0.259, 0.5208]}, {"w": "of", "b": [0.2653, 0.501, 0.2863, 0.5208]}, {"w": "a", "b": [0.2926, 0.501, 0.3038, 0.5208]}, {"w": "toy", "b": [0.3101, 0.501, 0.3424, 0.5208]}, {"w": "RNN", "b": [0.3487, 0.501, 0.4019, 0.5208]}, {"w": "in", "b": [0.4082, 0.501, 0.4279, 0.5208]}, {"w": "Numpy.", "b": [0.4342, 0.501, 0.5145, 0.5208]}, {"w": "This", "b": [0.5208, 0.501, 0.5657, 0.5208]}, {"w": "RNN", "b": [0.572, 0.501, 0.6252, 0.5208]}, {"w": "takes", "b": [0.6315, 0.501, 0.6834, 0.5208]}, {"w": "as", "b": [0.6897, 0.501, 0.7107, 0.5208]}, {"w": "input", "b": [0.717, 0.501, 0.7689, 0.5208]}, {"w": "a", "b": [0.7752, 0.501, 0.7864, 0.5208]}, {"w": "sequence", "b": [0.1294, 0.5215, 0.2219, 0.5413]}, {"w": "of", "b": [0.2282, 0.5215, 0.2492, 0.5413]}, {"w": "vectors,", "b": [0.2555, 0.5215, 0.3346, 0.5413]}, {"w": "which", "b": [0.341, 0.5215, 0.4026, 0.5413]}, {"w": "you’ll", "b": [0.4089, 0.5215, 0.4692, 0.5413]}, {"w": "encode", "b": [0.4754, 0.5215, 0.5469, 0.5413]}, {"w": "as", "b": [0.5532, 0.5215, 0.5742, 0.5413]}, {"w": "a", "b": [0.5805, 0.5215, 0.5917, 0.5413]}, {"w": "2D", "b": [0.598, 0.5215, 0.6288, 0.5413]}, {"w": "tensor", "b": [0.6351, 0.5215, 0.6968, 0.5413]}, {"w": "of", "b": [0.7031, 0.5215, 0.7241, 0.5413]}, {"w": "size", "b": [0.7304, 0.5215, 0.7696, 0.5413]}, {"w": "(timesteps,", "b": [0.1294, 0.5431, 0.2959, 0.5633]}, {"w": "input_features).", "b": [0.311, 0.542, 0.5444, 0.5633]}, {"w": "It", "b": [0.5507, 0.542, 0.5662, 0.5618]}, {"w": "loops", "b": [0.5725, 0.542, 0.6271, 0.5618]}, {"w": "over", "b": [0.6334, 0.542, 0.6783, 0.5618]}, {"w": "timesteps,", "b": [0.6846, 0.542, 0.7862, 0.5618]}, {"w": "and", "b": [0.7925, 0.542, 0.8289, 0.5618]}, {"w": "at", "b": [0.8352, 0.542, 0.8534, 0.5618]}, {"w": "each", "b": [0.1294, 0.5634, 0.1756, 0.5832]}, {"w": "timestep,", "b": [0.1819, 0.5634, 0.2737, 0.5832]}, {"w": "it", "b": [0.28, 0.5634, 0.2941, 0.5832]}, {"w": "considers", "b": [0.3004, 0.5634, 0.3956, 0.5832]}, {"w": "its", "b": [0.402, 0.5634, 0.4258, 0.5832]}, {"w": "current", "b": [0.4321, 0.5634, 0.5035, 0.5832]}, {"w": "state", "b": [0.5098, 0.5634, 0.5561, 0.5832]}, {"w": "at", "b": [0.5624, 0.5634, 0.5806, 0.5832]}, {"w": "t", "b": [0.5868, 0.5645, 0.602, 0.5847]}, {"w": "and", "b": [0.6083, 0.5634, 0.6447, 0.5832]}, {"w": "the", "b": [0.651, 0.5634, 0.6818, 0.5832]}, {"w": "input", "b": [0.6881, 0.5634, 0.74, 0.5832]}, {"w": "at", "b": [0.7463, 0.5634, 0.7645, 0.5832]}, {"w": "t", "b": [0.7708, 0.5645, 0.7859, 0.5847]}, {"w": "(of", "b": [0.7922, 0.5634, 0.8216, 0.5832]}, {"w": "shape", "b": [0.1294, 0.5848, 0.1869, 0.6046]}, {"w": "(input_features,),", "b": [0.1931, 0.5848, 0.4568, 0.6061]}, {"w": "and", "b": [0.4631, 0.5848, 0.4995, 0.6046]}, {"w": "combines", "b": [0.5058, 0.5848, 0.6025, 0.6046]}, {"w": "them", "b": [0.6088, 0.5848, 0.6593, 0.6046]}, {"w": "to", "b": [0.6656, 0.5848, 0.6852, 0.6046]}, {"w": "obtain", "b": [0.6915, 0.5848, 0.7546, 0.6046]}, {"w": "the", "b": [0.7609, 0.5848, 0.7917, 0.6046]}, {"w": "output", "b": [0.798, 0.5848, 0.8625, 0.6046]}, {"w": "at", "b": [0.1294, 0.6062, 0.1476, 0.6259]}, {"w": "t.", "b": [0.1539, 0.6062, 0.1754, 0.6274]}, {"w": "You’ll", "b": [0.1817, 0.6062, 0.245, 0.6259]}, {"w": "then", "b": [0.2513, 0.6062, 0.2947, 0.6259]}, {"w": "set", "b": [0.3011, 0.6062, 0.3291, 0.6259]}, {"w": "the", "b": [0.3354, 0.6062, 0.3662, 0.6259]}, {"w": "state", "b": [0.3725, 0.6062, 0.4188, 0.6259]}, {"w": "for", "b": [0.4251, 0.6062, 0.4545, 0.6259]}, {"w": "the", "b": [0.4608, 0.6062, 0.4916, 0.6259]}, {"w": "next", "b": [0.4979, 0.6062, 0.5414, 0.6259]}, {"w": "step", "b": [0.5477, 0.6062, 0.5883, 0.6259]}, {"w": "to", "b": [0.5946, 0.6062, 0.6142, 0.6259]}, {"w": "be", "b": [0.6205, 0.6062, 0.6443, 0.6259]}, {"w": "this", "b": [0.6507, 0.6062, 0.6871, 0.6259]}, {"w": "previous", "b": [0.6934, 0.6062, 0.7803, 0.6259]}, {"w": "output.", "b": [0.7866, 0.6062, 0.8574, 0.6259]}, {"w": "For", "b": [0.1294, 0.6276, 0.1645, 0.6473]}, {"w": "the", "b": [0.1708, 0.6276, 0.2016, 0.6473]}, {"w": "first", "b": [0.2079, 0.6276, 0.2485, 0.6473]}, {"w": "timestep,", "b": [0.2548, 0.6276, 0.3466, 0.6473]}, {"w": "the", "b": [0.3529, 0.6276, 0.3838, 0.6473]}, {"w": "previous", "b": [0.3901, 0.6276, 0.4769, 0.6473]}, {"w": "output", "b": [0.4833, 0.6276, 0.5477, 0.6473]}, {"w": "isn’t", "b": [0.554, 0.6276, 0.5984, 0.6473]}, {"w": "defined;", "b": [0.6047, 0.6276, 0.6873, 0.6473]}, {"w": "hence,", "b": [0.6937, 0.6276, 0.7588, 0.6473]}, {"w": "there", "b": [0.7651, 0.6276, 0.8155, 0.6473]}, {"w": "is", "b": [0.8218, 0.6276, 0.8387, 0.6473]}, {"w": "no", "b": [0.845, 0.6276, 0.8702, 0.6473]}, {"w": "current", "b": [0.1294, 0.6481, 0.2009, 0.6678]}, {"w": "state.", "b": [0.2072, 0.6481, 0.2597, 0.6678]}, {"w": "So,", "b": [0.266, 0.6481, 0.299, 0.6678]}, {"w": "you’ll", "b": [0.3053, 0.6481, 0.3655, 0.6678]}, {"w": "initialize", "b": [0.3718, 0.6481, 0.4601, 0.6678]}, {"w": "the", "b": [0.4664, 0.6481, 0.4973, 0.6678]}, {"w": "state", "b": [0.5036, 0.6481, 0.5498, 0.6678]}, {"w": "as", "b": [0.5561, 0.6481, 0.5771, 0.6678]}, {"w": "an", "b": [0.5834, 0.6481, 0.6072, 0.6678]}, {"w": "all-zero", "b": [0.6135, 0.6481, 0.6906, 0.6678]}, {"w": "vector", "b": [0.6969, 0.6481, 0.7599, 0.6678]}, {"w": "called", "b": [0.7662, 0.6481, 0.8265, 0.6678]}, {"w": "the", "b": [0.8328, 0.6481, 0.8636, 0.6678]}, {"w": "initial", "b": [0.1294, 0.6686, 0.1897, 0.6883]}, {"w": "state", "b": [0.196, 0.6686, 0.2437, 0.6883]}, {"w": "of", "b": [0.2499, 0.6686, 0.2709, 0.6883]}, {"w": "the", "b": [0.2772, 0.6686, 0.3081, 0.6883]}, {"w": "network.", "b": [0.3144, 0.6686, 0.4033, 0.6883]}]}, {"id": "b_3", "type": "paragraph", "text": "In pseudocode, this is the RNN.", "words": [{"w": "In", "b": [0.1294, 0.7114, 0.1504, 0.7311]}, {"w": "pseudocode,", "b": [0.1567, 0.7114, 0.2821, 0.7311]}, {"w": "this", "b": [0.2884, 0.7114, 0.3249, 0.7311]}, {"w": "is", "b": [0.3312, 0.7114, 0.348, 0.7311]}, {"w": "the", "b": [0.3543, 0.7114, 0.3852, 0.7311]}, {"w": "RNN.", "b": [0.3915, 0.7114, 0.451, 0.7311]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.19. Pseudocode RNN", "words": [{"w": "Listing", "b": [0.1294, 0.7492, 0.1862, 0.764]}, {"w": "6.19.", "b": [0.1909, 0.7492, 0.2288, 0.764]}, {"w": "Pseudocode", "b": [0.2335, 0.7492, 0.3281, 0.764]}, {"w": "RNN", "b": [0.3328, 0.7492, 0.3738, 0.764]}]}, {"id": "b_5", "type": "paragraph", "text": "state_t = 0 1 for input_t in input_sequence: 2 output_t = f(input_t, state_t) state_t = output_t 3", "words": [{"w": "state_t", "b": [0.1357, 0.7776, 0.2152, 0.7928]}, {"w": "=", "b": [0.2265, 0.7776, 0.2379, 0.7928]}, {"w": "0", "b": [0.2492, 0.7776, 0.2606, 0.7928]}, {"w": "1", "b": [0.6239, 0.7776, 0.6353, 0.7928]}, {"w": "for", "b": [0.1357, 0.7928, 0.1698, 0.8079]}, {"w": "input_t", "b": [0.1811, 0.7928, 0.2606, 0.8079]}, {"w": "in", "b": [0.2719, 0.7928, 0.2946, 0.8079]}, {"w": "input_sequence:", "b": [0.306, 0.7928, 0.4763, 0.8079]}, {"w": "2", "b": [0.6239, 0.7928, 0.6353, 0.8079]}, {"w": "output_t", "b": [0.1811, 0.8079, 0.2719, 0.8231]}, {"w": "=", "b": [0.2833, 0.8079, 0.2946, 0.8231]}, {"w": "f(input_t,", "b": [0.306, 0.8079, 0.4195, 0.8231]}, {"w": "state_t)", "b": [0.4309, 0.8079, 0.5217, 0.8231]}, {"w": "state_t", "b": [0.1811, 0.8231, 0.2606, 0.8382]}, {"w": "=", "b": [0.2719, 0.8231, 0.2833, 0.8382]}, {"w": "output_t", "b": [0.2946, 0.8231, 0.3855, 0.8382]}, {"w": "3", "b": [0.6239, 0.8231, 0.6353, 0.8382]}]}, {"id": "b_6", "type": "paragraph", "text": "1 The state at t 2 Iterates over sequence elements", "words": [{"w": "1", "b": [0.1799, 0.8567, 0.1925, 0.8764]}, {"w": "The", "b": [0.1988, 0.8567, 0.2408, 0.8764]}, {"w": "state", "b": [0.2471, 0.8567, 0.2976, 0.8764]}, {"w": "at", "b": [0.3039, 0.8567, 0.3249, 0.8764]}, {"w": "t", "b": [0.3312, 0.8567, 0.3396, 0.8764]}, {"w": "2", "b": [0.1799, 0.8772, 0.1925, 0.8969]}, {"w": "Iterates", "b": [0.1988, 0.8772, 0.2814, 0.8969]}, {"w": "over", "b": [0.2877, 0.8772, 0.3354, 0.8969]}, {"w": "sequence", "b": [0.3417, 0.8772, 0.4384, 0.8969]}, {"w": "elements", "b": [0.4447, 0.8772, 0.5385, 0.8969]}]}]}, {"page": 261, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3 The previous output becomes the state for the next iteration.", "words": [{"w": "3", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "The", "b": [0.1988, 0.0857, 0.2408, 0.1054]}, {"w": "previous", "b": [0.2471, 0.0857, 0.3392, 0.1054]}, {"w": "output", "b": [0.3455, 0.0857, 0.417, 0.1054]}, {"w": "becomes", "b": [0.4233, 0.0857, 0.5144, 0.1054]}, {"w": "the", "b": [0.5207, 0.0857, 0.5543, 0.1054]}, {"w": "state", "b": [0.5606, 0.0857, 0.611, 0.1054]}, {"w": "for", "b": [0.6173, 0.0857, 0.6495, 0.1054]}, {"w": "the", "b": [0.6558, 0.0857, 0.6895, 0.1054]}, {"w": "next", "b": [0.6958, 0.0857, 0.742, 0.1054]}, {"w": "iteration.", "b": [0.7483, 0.0857, 0.8471, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "You can even flesh out the function f: the transformation of the input and state into an output will be parameterized by two matrices, W and U, and a bias vector. It’s similar to the transformation operated by a densely connected layer in a feedforward network.", "words": [{"w": "You", "b": [0.1294, 0.1285, 0.1703, 0.1482]}, {"w": "can", "b": [0.1766, 0.1285, 0.2116, 0.1482]}, {"w": "even", "b": [0.218, 0.1285, 0.2656, 0.1482]}, {"w": "flesh", "b": [0.2719, 0.1285, 0.3209, 0.1482]}, {"w": "out", "b": [0.3272, 0.1285, 0.3595, 0.1482]}, {"w": "the", "b": [0.3658, 0.1285, 0.3966, 0.1482]}, {"w": "function", "b": [0.4029, 0.1285, 0.487, 0.1482]}, {"w": "f:", "b": [0.4932, 0.1285, 0.5154, 0.1497]}, {"w": "the", "b": [0.5217, 0.1285, 0.5525, 0.1482]}, {"w": "transformation", "b": [0.5588, 0.1285, 0.7074, 0.1482]}, {"w": "of", "b": [0.7137, 0.1285, 0.7347, 0.1482]}, {"w": "the", "b": [0.741, 0.1285, 0.7718, 0.1482]}, {"w": "input", "b": [0.7781, 0.1285, 0.83, 0.1482]}, {"w": "and", "b": [0.1294, 0.1499, 0.1658, 0.1696]}, {"w": "state", "b": [0.1721, 0.1499, 0.2184, 0.1696]}, {"w": "into", "b": [0.2247, 0.1499, 0.2639, 0.1696]}, {"w": "an", "b": [0.2702, 0.1499, 0.2941, 0.1696]}, {"w": "output", "b": [0.3004, 0.1499, 0.3648, 0.1696]}, {"w": "will", "b": [0.3712, 0.1499, 0.4104, 0.1696]}, {"w": "be", "b": [0.4167, 0.1499, 0.4405, 0.1696]}, {"w": "parameterized", "b": [0.4468, 0.1499, 0.5897, 0.1696]}, {"w": "by", "b": [0.596, 0.1499, 0.6212, 0.1696]}, {"w": "two", "b": [0.6275, 0.1499, 0.6654, 0.1696]}, {"w": "matrices,", "b": [0.6717, 0.1499, 0.7635, 0.1696]}, {"w": "W", "b": [0.7697, 0.1509, 0.7848, 0.1711]}, {"w": "and", "b": [0.7911, 0.1499, 0.8275, 0.1696]}, {"w": "U,", "b": [0.8338, 0.1499, 0.8553, 0.1711]}, {"w": "and", "b": [0.1294, 0.1712, 0.1658, 0.191]}, {"w": "a", "b": [0.1721, 0.1712, 0.1833, 0.191]}, {"w": "bias", "b": [0.1897, 0.1712, 0.2303, 0.191]}, {"w": "vector.", "b": [0.2366, 0.1712, 0.3045, 0.191]}, {"w": "It’s", "b": [0.3108, 0.1712, 0.3431, 0.191]}, {"w": "similar", "b": [0.3494, 0.1712, 0.4194, 0.191]}, {"w": "to", "b": [0.4258, 0.1712, 0.4454, 0.191]}, {"w": "the", "b": [0.4517, 0.1712, 0.4825, 0.191]}, {"w": "transformation", "b": [0.4888, 0.1712, 0.6373, 0.191]}, {"w": "operated", "b": [0.6437, 0.1712, 0.7305, 0.191]}, {"w": "by", "b": [0.7368, 0.1712, 0.762, 0.191]}, {"w": "a", "b": [0.7683, 0.1712, 0.7795, 0.191]}, {"w": "densely", "b": [0.7859, 0.1712, 0.8629, 0.191]}, {"w": "connected", "b": [0.1294, 0.1917, 0.2317, 0.2115]}, {"w": "layer", "b": [0.238, 0.1917, 0.2884, 0.2115]}, {"w": "in", "b": [0.2947, 0.1917, 0.3143, 0.2115]}, {"w": "a", "b": [0.3206, 0.1917, 0.3318, 0.2115]}, {"w": "feedforward", "b": [0.3382, 0.1917, 0.4614, 0.2115]}, {"w": "network.", "b": [0.4677, 0.1917, 0.5567, 0.2115]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.20. More detailed pseudocode for the RNN", "words": [{"w": "Listing", "b": [0.1294, 0.2296, 0.1862, 0.2444]}, {"w": "6.20.", "b": [0.1909, 0.2296, 0.2288, 0.2444]}, {"w": "More", "b": [0.2335, 0.2296, 0.2772, 0.2444]}, {"w": "detailed", "b": [0.282, 0.2296, 0.3461, 0.2444]}, {"w": "pseudocode", "b": [0.3508, 0.2296, 0.4444, 0.2444]}, {"w": "for", "b": [0.4491, 0.2296, 0.4733, 0.2444]}, {"w": "the", "b": [0.478, 0.2296, 0.5032, 0.2444]}, {"w": "RNN", "b": [0.5079, 0.2296, 0.5489, 0.2444]}]}, {"id": "b_3", "type": "paragraph", "text": "state_t = 0 for input_t in input_sequence: output_t = activation(dot(W, input_t) + dot(U, state_t) + b) state_t = output_t", "words": [{"w": "state_t", "b": [0.1357, 0.258, 0.2152, 0.2731]}, {"w": "=", "b": [0.2265, 0.258, 0.2379, 0.2731]}, {"w": "0", "b": [0.2492, 0.258, 0.2606, 0.2731]}, {"w": "for", "b": [0.1357, 0.2732, 0.1698, 0.2883]}, {"w": "input_t", "b": [0.1811, 0.2732, 0.2606, 0.2883]}, {"w": "in", "b": [0.2719, 0.2732, 0.2946, 0.2883]}, {"w": "input_sequence:", "b": [0.306, 0.2732, 0.4763, 0.2883]}, {"w": "output_t", "b": [0.1811, 0.2883, 0.2719, 0.3034]}, {"w": "=", "b": [0.2833, 0.2883, 0.2946, 0.3034]}, {"w": "activation(dot(W,", "b": [0.306, 0.2883, 0.499, 0.3034]}, {"w": "input_t)", "b": [0.5103, 0.2883, 0.6011, 0.3034]}, {"w": "+", "b": [0.6125, 0.2883, 0.6238, 0.3034]}, {"w": "dot(U,", "b": [0.6352, 0.2883, 0.7033, 0.3034]}, {"w": "state_t)", "b": [0.7146, 0.2883, 0.8055, 0.3034]}, {"w": "+", "b": [0.8168, 0.2883, 0.8282, 0.3034]}, {"w": "b)", "b": [0.8395, 0.2883, 0.8622, 0.3034]}, {"w": "state_t", "b": [0.1811, 0.3035, 0.2606, 0.3186]}, {"w": "=", "b": [0.2719, 0.3035, 0.2833, 0.3186]}, {"w": "output_t", "b": [0.2946, 0.3035, 0.3855, 0.3186]}]}, {"id": "b_4", "type": "paragraph", "text": "To make these notions absolutely unambiguous, let’s write a naive Numpy implementation of the forward pass of the simple RNN.", "words": [{"w": "To", "b": [0.1294, 0.3415, 0.1557, 0.3612]}, {"w": "make", "b": [0.162, 0.3415, 0.2166, 0.3612]}, {"w": "these", "b": [0.2229, 0.3415, 0.2748, 0.3612]}, {"w": "notions", "b": [0.2811, 0.3415, 0.3554, 0.3612]}, {"w": "absolutely", "b": [0.3617, 0.3415, 0.4654, 0.3612]}, {"w": "unambiguous,", "b": [0.4717, 0.3415, 0.6139, 0.3612]}, {"w": "let’s", "b": [0.6202, 0.3415, 0.6622, 0.3612]}, {"w": "write", "b": [0.6685, 0.3415, 0.7204, 0.3612]}, {"w": "a", "b": [0.7267, 0.3415, 0.7379, 0.3612]}, {"w": "naive", "b": [0.7442, 0.3415, 0.7988, 0.3612]}, {"w": "Numpy", "b": [0.1294, 0.362, 0.2051, 0.3817]}, {"w": "implementation", "b": [0.2114, 0.362, 0.3698, 0.3817]}, {"w": "of", "b": [0.3761, 0.362, 0.3971, 0.3817]}, {"w": "the", "b": [0.4034, 0.362, 0.4342, 0.3817]}, {"w": "forward", "b": [0.4405, 0.362, 0.5204, 0.3817]}, {"w": "pass", "b": [0.5267, 0.362, 0.5701, 0.3817]}, {"w": "of", "b": [0.5764, 0.362, 0.5974, 0.3817]}, {"w": "the", "b": [0.6037, 0.362, 0.6346, 0.3817]}, {"w": "simple", "b": [0.6409, 0.362, 0.7081, 0.3817]}, {"w": "RNN.", "b": [0.7144, 0.362, 0.774, 0.3817]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 6.21. Numpy implementation of a simple RNN", "words": [{"w": "Listing", "b": [0.1294, 0.3998, 0.1862, 0.4146]}, {"w": "6.21.", "b": [0.1909, 0.3998, 0.2288, 0.4146]}, {"w": "Numpy", "b": [0.2335, 0.3998, 0.2934, 0.4146]}, {"w": "implementation", "b": [0.2981, 0.3998, 0.4253, 0.4146]}, {"w": "of", "b": [0.43, 0.3998, 0.4458, 0.4146]}, {"w": "a", "b": [0.4505, 0.3998, 0.46, 0.4146]}, {"w": "simple", "b": [0.4647, 0.3998, 0.5173, 0.4146]}, {"w": "RNN", "b": [0.522, 0.3998, 0.563, 0.4146]}]}, {"id": "b_6", "type": "paragraph", "text": "import numpy as np timesteps = 100 1 input_features = 32 2 output_features = 64 3 inputs = np.random.random((timesteps, input_features)) 4 state_t = np.zeros((output_features,)) 5 W = np.random.random((output_features, input_features)) 6 U = np.random.random((output_features, output_features)) 6 b = np.random.random((output_features,)) 6 successive_outputs = [] for input_t in inputs: 7 output_t = np.tanh(np.dot(W, input_t) + np.dot(U, state_t) + b) 8 successive_outputs.append(output_t) 9 state_t = output_t", "words": [{"w": "import", "b": [0.1357, 0.4282, 0.2038, 0.4434]}, {"w": "numpy", "b": [0.2152, 0.4282, 0.2719, 0.4434]}, {"w": "as", "b": [0.2833, 0.4282, 0.306, 0.4434]}, {"w": "np", "b": [0.3173, 0.4282, 0.34, 0.4434]}, {"w": "timesteps", "b": [0.1357, 0.4585, 0.2379, 0.4737]}, {"w": "=", "b": [0.2492, 0.4585, 0.2606, 0.4737]}, {"w": "100", "b": [0.2719, 0.4585, 0.306, 0.4737]}, {"w": "1", "b": [0.1357, 0.4737, 0.1471, 0.4888]}, {"w": "input_features", "b": [0.1357, 0.4888, 0.2946, 0.504]}, {"w": "=", "b": [0.306, 0.4888, 0.3173, 0.504]}, {"w": "32", "b": [0.3287, 0.4888, 0.3514, 0.504]}, {"w": "2", "b": [0.1357, 0.504, 0.1471, 0.5191]}, {"w": "output_features", "b": [0.1357, 0.5192, 0.306, 0.5343]}, {"w": "=", "b": [0.3173, 0.5192, 0.3287, 0.5343]}, {"w": "64", "b": [0.34, 0.5192, 0.3628, 0.5343]}, {"w": "3", "b": [0.1357, 0.5343, 0.1471, 0.5495]}, {"w": "inputs", "b": [0.1357, 0.5646, 0.2038, 0.5798]}, {"w": "=", "b": [0.2152, 0.5646, 0.2265, 0.5798]}, {"w": "np.random.random((timesteps,", "b": [0.2379, 0.5646, 0.5557, 0.5798]}, {"w": "input_features))", "b": [0.5671, 0.5646, 0.7487, 0.5798]}, {"w": "4", "b": [0.1357, 0.5798, 0.1471, 0.5949]}, {"w": "state_t", "b": [0.1357, 0.6101, 0.2152, 0.6252]}, {"w": "=", "b": [0.2265, 0.6101, 0.2379, 0.6252]}, {"w": "np.zeros((output_features,))", "b": [0.2492, 0.6101, 0.5671, 0.6252]}, {"w": "5", "b": [0.1357, 0.6252, 0.1471, 0.6404]}, {"w": "W", "b": [0.1357, 0.6555, 0.1471, 0.6707]}, {"w": "=", "b": [0.1584, 0.6555, 0.1698, 0.6707]}, {"w": "np.random.random((output_features,", "b": [0.1811, 0.6555, 0.5671, 0.6707]}, {"w": "input_features))", "b": [0.5784, 0.6555, 0.7601, 0.6707]}, {"w": "6", "b": [0.1357, 0.6707, 0.1471, 0.6858]}, {"w": "U", "b": [0.1357, 0.6858, 0.1471, 0.701]}, {"w": "=", "b": [0.1584, 0.6858, 0.1698, 0.701]}, {"w": "np.random.random((output_features,", "b": [0.1811, 0.6858, 0.5671, 0.701]}, {"w": "output_features))", "b": [0.5784, 0.6858, 0.7714, 0.701]}, {"w": "6", "b": [0.1357, 0.701, 0.1471, 0.7161]}, {"w": "b", "b": [0.1357, 0.7161, 0.1471, 0.7313]}, {"w": "=", "b": [0.1584, 0.7161, 0.1698, 0.7313]}, {"w": "np.random.random((output_features,))", "b": [0.1811, 0.7161, 0.5898, 0.7313]}, {"w": "6", "b": [0.1357, 0.7313, 0.1471, 0.7464]}, {"w": "successive_outputs", "b": [0.1357, 0.7616, 0.34, 0.7767]}, {"w": "=", "b": [0.3514, 0.7616, 0.3628, 0.7767]}, {"w": "[]", "b": [0.3741, 0.7616, 0.3968, 0.7767]}, {"w": "for", "b": [0.1357, 0.7767, 0.1698, 0.7919]}, {"w": "input_t", "b": [0.1811, 0.7767, 0.2606, 0.7919]}, {"w": "in", "b": [0.2719, 0.7767, 0.2946, 0.7919]}, {"w": "inputs:", "b": [0.306, 0.7767, 0.3855, 0.7919]}, {"w": "7", "b": [0.1357, 0.7919, 0.1471, 0.807]}, {"w": "output_t", "b": [0.1811, 0.807, 0.2719, 0.8222]}, {"w": "=", "b": [0.2833, 0.807, 0.2946, 0.8222]}, {"w": "np.tanh(np.dot(W,", "b": [0.306, 0.807, 0.499, 0.8222]}, {"w": "input_t)", "b": [0.5103, 0.807, 0.6011, 0.8222]}, {"w": "+", "b": [0.6125, 0.807, 0.6238, 0.8222]}, {"w": "np.dot(U,", "b": [0.6352, 0.807, 0.7374, 0.8222]}, {"w": "state_t)", "b": [0.7487, 0.807, 0.8395, 0.8222]}, {"w": "+", "b": [0.8509, 0.807, 0.8622, 0.8222]}, {"w": "b)", "b": [0.1357, 0.8222, 0.1584, 0.8373]}, {"w": "8", "b": [0.2152, 0.8222, 0.2265, 0.8373]}, {"w": "successive_outputs.append(output_t)", "b": [0.1811, 0.8525, 0.5784, 0.8677]}, {"w": "9", "b": [0.1357, 0.8677, 0.1471, 0.8828]}, {"w": "state_t", "b": [0.1811, 0.898, 0.2606, 0.9131]}, {"w": "=", "b": [0.2719, 0.898, 0.2833, 0.9131]}, {"w": "output_t", "b": [0.2946, 0.898, 0.3855, 0.9131]}]}]}, {"page": 262, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "10 final_output_sequence = np.concatenate(successive_outputs, axis=0) 11", "words": [{"w": "10", "b": [0.1357, 0.0851, 0.1584, 0.1002]}, {"w": "final_output_sequence", "b": [0.1357, 0.1154, 0.3741, 0.1305]}, {"w": "=", "b": [0.3855, 0.1154, 0.3968, 0.1305]}, {"w": "np.concatenate(successive_outputs,", "b": [0.4082, 0.1154, 0.7941, 0.1305]}, {"w": "axis=0)", "b": [0.1357, 0.1305, 0.2152, 0.1457]}, {"w": "11", "b": [0.2833, 0.1305, 0.306, 0.1457]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Number of timesteps in the input sequence 2 Dimensionality of the input feature space 3 Dimensionality of the output feature space 4 Input data: random noise for the sake of the example 5 Initial state: an all-zero vector 6 Creates random weight matrices 7 input_t is a vector of shape (input_features,). 8 Combines the input with the current state (the previous output) to obtain the current output 9 Stores this output in a list 10 Updates the state of the network for the next timestep 11 The final output is a 2D tensor of shape (timesteps, output_features).", "words": [{"w": "1", "b": [0.1799, 0.1641, 0.1925, 0.1839]}, {"w": "Number", "b": [0.1988, 0.1641, 0.2885, 0.1839]}, {"w": "of", "b": [0.2948, 0.1641, 0.3158, 0.1839]}, {"w": "timesteps", "b": [0.3221, 0.1641, 0.423, 0.1839]}, {"w": "in", "b": [0.4293, 0.1641, 0.4503, 0.1839]}, {"w": "the", "b": [0.4566, 0.1641, 0.4902, 0.1839]}, {"w": "input", "b": [0.4965, 0.1641, 0.554, 0.1839]}, {"w": "sequence", "b": [0.5603, 0.1641, 0.657, 0.1839]}, {"w": "2", "b": [0.1799, 0.1846, 0.1925, 0.2044]}, {"w": "Dimensionality", "b": [0.1988, 0.1846, 0.3614, 0.2044]}, {"w": "of", "b": [0.3677, 0.1846, 0.3887, 0.2044]}, {"w": "the", "b": [0.395, 0.1846, 0.4286, 0.2044]}, {"w": "input", "b": [0.4349, 0.1846, 0.4924, 0.2044]}, {"w": "feature", "b": [0.4987, 0.1846, 0.5753, 0.2044]}, {"w": "space", "b": [0.5816, 0.1846, 0.6405, 0.2044]}, {"w": "3", "b": [0.1799, 0.2051, 0.1925, 0.2249]}, {"w": "Dimensionality", "b": [0.1988, 0.2051, 0.3614, 0.2249]}, {"w": "of", "b": [0.3677, 0.2051, 0.3887, 0.2249]}, {"w": "the", "b": [0.395, 0.2051, 0.4286, 0.2249]}, {"w": "output", "b": [0.4349, 0.2051, 0.5064, 0.2249]}, {"w": "feature", "b": [0.5127, 0.2051, 0.5893, 0.2249]}, {"w": "space", "b": [0.5956, 0.2051, 0.6545, 0.2249]}, {"w": "4", "b": [0.1799, 0.2256, 0.1925, 0.2454]}, {"w": "Input", "b": [0.1988, 0.2256, 0.2591, 0.2454]}, {"w": "data:", "b": [0.2654, 0.2256, 0.3214, 0.2454]}, {"w": "random", "b": [0.3277, 0.2256, 0.4132, 0.2454]}, {"w": "noise", "b": [0.4195, 0.2256, 0.4742, 0.2454]}, {"w": "for", "b": [0.4805, 0.2256, 0.5127, 0.2454]}, {"w": "the", "b": [0.519, 0.2256, 0.5526, 0.2454]}, {"w": "sake", "b": [0.559, 0.2256, 0.6066, 0.2454]}, {"w": "of", "b": [0.6129, 0.2256, 0.6339, 0.2454]}, {"w": "the", "b": [0.6402, 0.2256, 0.6739, 0.2454]}, {"w": "example", "b": [0.6802, 0.2256, 0.7698, 0.2454]}, {"w": "5", "b": [0.1799, 0.2461, 0.1925, 0.2659]}, {"w": "Initial", "b": [0.1988, 0.2461, 0.2647, 0.2659]}, {"w": "state:", "b": [0.271, 0.2461, 0.3298, 0.2659]}, {"w": "an", "b": [0.3361, 0.2461, 0.3628, 0.2659]}, {"w": "all-zero", "b": [0.3691, 0.2461, 0.4498, 0.2659]}, {"w": "vector", "b": [0.4561, 0.2461, 0.5234, 0.2659]}, {"w": "6", "b": [0.1799, 0.2666, 0.1925, 0.2864]}, {"w": "Creates", "b": [0.1988, 0.2666, 0.281, 0.2864]}, {"w": "random", "b": [0.2873, 0.2666, 0.3728, 0.2864]}, {"w": "weight", "b": [0.3791, 0.2666, 0.4505, 0.2864]}, {"w": "matrices", "b": [0.4568, 0.2666, 0.5493, 0.2864]}, {"w": "7", "b": [0.1799, 0.2871, 0.1925, 0.3069]}, {"w": "input_t", "b": [0.1988, 0.2871, 0.2773, 0.3069]}, {"w": "is", "b": [0.2836, 0.2871, 0.3004, 0.3069]}, {"w": "a", "b": [0.3067, 0.2871, 0.3193, 0.3069]}, {"w": "vector", "b": [0.3256, 0.2871, 0.3929, 0.3069]}, {"w": "of", "b": [0.3992, 0.2871, 0.4202, 0.3069]}, {"w": "shape", "b": [0.4265, 0.2871, 0.4882, 0.3069]}, {"w": "(input_features,).", "b": [0.4945, 0.2871, 0.6804, 0.3069]}, {"w": "8", "b": [0.1799, 0.3076, 0.1925, 0.3274]}, {"w": "Combines", "b": [0.1988, 0.3076, 0.3067, 0.3274]}, {"w": "the", "b": [0.313, 0.3076, 0.3466, 0.3274]}, {"w": "input", "b": [0.3529, 0.3076, 0.4104, 0.3274]}, {"w": "with", "b": [0.4167, 0.3076, 0.4644, 0.3274]}, {"w": "the", "b": [0.4707, 0.3076, 0.5043, 0.3274]}, {"w": "current", "b": [0.5106, 0.3076, 0.5914, 0.3274]}, {"w": "state", "b": [0.5977, 0.3076, 0.6482, 0.3274]}, {"w": "(the", "b": [0.6545, 0.3076, 0.6965, 0.3274]}, {"w": "previous", "b": [0.7028, 0.3076, 0.7949, 0.3274]}, {"w": "output)", "b": [0.1799, 0.3281, 0.2598, 0.3479]}, {"w": "to", "b": [0.2661, 0.3281, 0.2871, 0.3479]}, {"w": "obtain", "b": [0.2934, 0.3281, 0.3621, 0.3479]}, {"w": "the", "b": [0.3684, 0.3281, 0.402, 0.3479]}, {"w": "current", "b": [0.4083, 0.3281, 0.4891, 0.3479]}, {"w": "output", "b": [0.4954, 0.3281, 0.5669, 0.3479]}, {"w": "9", "b": [0.1799, 0.3486, 0.1925, 0.3684]}, {"w": "Stores", "b": [0.1988, 0.3486, 0.2656, 0.3684]}, {"w": "this", "b": [0.2719, 0.3486, 0.3111, 0.3684]}, {"w": "output", "b": [0.3174, 0.3486, 0.3889, 0.3684]}, {"w": "in", "b": [0.3952, 0.3486, 0.4163, 0.3684]}, {"w": "a", "b": [0.4226, 0.3486, 0.4352, 0.3684]}, {"w": "list", "b": [0.4415, 0.3486, 0.4737, 0.3684]}, {"w": "10", "b": [0.1799, 0.3691, 0.2051, 0.3889]}, {"w": "Updates", "b": [0.2114, 0.3691, 0.2997, 0.3889]}, {"w": "the", "b": [0.306, 0.3691, 0.3396, 0.3889]}, {"w": "state", "b": [0.3459, 0.3691, 0.3964, 0.3889]}, {"w": "of", "b": [0.4027, 0.3691, 0.4237, 0.3889]}, {"w": "the", "b": [0.43, 0.3691, 0.4636, 0.3889]}, {"w": "network", "b": [0.4699, 0.3691, 0.5596, 0.3889]}, {"w": "for", "b": [0.5659, 0.3691, 0.5981, 0.3889]}, {"w": "the", "b": [0.6044, 0.3691, 0.638, 0.3889]}, {"w": "next", "b": [0.6443, 0.3691, 0.6906, 0.3889]}, {"w": "timestep", "b": [0.6969, 0.3691, 0.788, 0.3889]}, {"w": "11", "b": [0.1799, 0.3896, 0.2037, 0.4094]}, {"w": "The", "b": [0.21, 0.3896, 0.252, 0.4094]}, {"w": "final", "b": [0.2584, 0.3896, 0.3074, 0.4094]}, {"w": "output", "b": [0.3137, 0.3896, 0.3852, 0.4094]}, {"w": "is", "b": [0.3915, 0.3896, 0.4083, 0.4094]}, {"w": "a", "b": [0.4147, 0.3896, 0.4273, 0.4094]}, {"w": "2D", "b": [0.4336, 0.3896, 0.4644, 0.4094]}, {"w": "tensor", "b": [0.4707, 0.3896, 0.538, 0.4094]}, {"w": "of", "b": [0.5443, 0.3896, 0.5653, 0.4094]}, {"w": "shape", "b": [0.5716, 0.3896, 0.6333, 0.4094]}, {"w": "(timesteps,", "b": [0.6396, 0.3896, 0.7552, 0.4094]}, {"w": "output_features).", "b": [0.1799, 0.4101, 0.3651, 0.4299]}]}, {"id": "b_2", "type": "paragraph", "text": "Easy enough: in summary, an RNN is a for loop that reuses quantities computed during the previous iteration of the loop, nothing more. Of course, there are many different RNNs fitting this definition that you could build—this example is one of the simplest RNN formulations. RNNs are characterized by their step function, such as the following function in this case (see figure 6.10):", "words": [{"w": "Easy", "b": [0.1294, 0.4529, 0.1785, 0.4726]}, {"w": "enough:", "b": [0.1848, 0.4529, 0.266, 0.4726]}, {"w": "in", "b": [0.2723, 0.4529, 0.292, 0.4726]}, {"w": "summary,", "b": [0.2983, 0.4529, 0.3968, 0.4726]}, {"w": "an", "b": [0.4031, 0.4529, 0.4269, 0.4726]}, {"w": "RNN", "b": [0.4332, 0.4529, 0.4865, 0.4726]}, {"w": "is", "b": [0.4928, 0.4529, 0.5096, 0.4726]}, {"w": "a", "b": [0.5159, 0.4529, 0.5271, 0.4726]}, {"w": "for", "b": [0.5334, 0.4539, 0.5788, 0.4741]}, {"w": "loop", "b": [0.5851, 0.4529, 0.63, 0.4726]}, {"w": "that", "b": [0.6363, 0.4529, 0.6741, 0.4726]}, {"w": "reuses", "b": [0.6804, 0.4529, 0.7435, 0.4726]}, {"w": "quantities", "b": [0.7498, 0.4529, 0.8479, 0.4726]}, {"w": "computed", "b": [0.1294, 0.4743, 0.2289, 0.494]}, {"w": "during", "b": [0.2352, 0.4743, 0.3011, 0.494]}, {"w": "the", "b": [0.3074, 0.4743, 0.3382, 0.494]}, {"w": "previous", "b": [0.3445, 0.4743, 0.4314, 0.494]}, {"w": "iteration", "b": [0.4377, 0.4743, 0.5218, 0.494]}, {"w": "of", "b": [0.5281, 0.4743, 0.5491, 0.494]}, {"w": "the", "b": [0.5554, 0.4743, 0.5862, 0.494]}, {"w": "loop,", "b": [0.5925, 0.4743, 0.6437, 0.494]}, {"w": "nothing", "b": [0.65, 0.4743, 0.7271, 0.494]}, {"w": "more.", "b": [0.7334, 0.4743, 0.7915, 0.494]}, {"w": "Of", "b": [0.7978, 0.4743, 0.8245, 0.494]}, {"w": "course,", "b": [0.1294, 0.4948, 0.2016, 0.5145]}, {"w": "there", "b": [0.2079, 0.4948, 0.2583, 0.5145]}, {"w": "are", "b": [0.2646, 0.4948, 0.2954, 0.5145]}, {"w": "many", "b": [0.3017, 0.4948, 0.3578, 0.5145]}, {"w": "different", "b": [0.3641, 0.4948, 0.4504, 0.5145]}, {"w": "RNNs", "b": [0.4567, 0.4948, 0.5198, 0.5145]}, {"w": "fitting", "b": [0.5261, 0.4948, 0.5878, 0.5145]}, {"w": "this", "b": [0.5941, 0.4948, 0.6305, 0.5145]}, {"w": "definition", "b": [0.6368, 0.4948, 0.7349, 0.5145]}, {"w": "that", "b": [0.7412, 0.4948, 0.7791, 0.5145]}, {"w": "you", "b": [0.7854, 0.4948, 0.8232, 0.5145]}, {"w": "could", "b": [0.1294, 0.5153, 0.1855, 0.535]}, {"w": "build—this", "b": [0.1918, 0.5153, 0.3053, 0.535]}, {"w": "example", "b": [0.3116, 0.5153, 0.3971, 0.535]}, {"w": "is", "b": [0.4034, 0.5153, 0.4202, 0.535]}, {"w": "one", "b": [0.4265, 0.5153, 0.4629, 0.535]}, {"w": "of", "b": [0.4693, 0.5153, 0.4903, 0.535]}, {"w": "the", "b": [0.4966, 0.5153, 0.5274, 0.535]}, {"w": "simplest", "b": [0.5337, 0.5153, 0.6178, 0.535]}, {"w": "RNN", "b": [0.6241, 0.5153, 0.6774, 0.535]}, {"w": "formulations.", "b": [0.6837, 0.5153, 0.8189, 0.535]}, {"w": "RNNs", "b": [0.1294, 0.5358, 0.1925, 0.5555]}, {"w": "are", "b": [0.1988, 0.5358, 0.2296, 0.5555]}, {"w": "characterized", "b": [0.2359, 0.5358, 0.3703, 0.5555]}, {"w": "by", "b": [0.3766, 0.5358, 0.4018, 0.5555]}, {"w": "their", "b": [0.4081, 0.5358, 0.4544, 0.5555]}, {"w": "step", "b": [0.4607, 0.5358, 0.5013, 0.5555]}, {"w": "function,", "b": [0.5076, 0.5358, 0.598, 0.5555]}, {"w": "such", "b": [0.6043, 0.5358, 0.6506, 0.5555]}, {"w": "as", "b": [0.6569, 0.5358, 0.6779, 0.5555]}, {"w": "the", "b": [0.6842, 0.5358, 0.715, 0.5555]}, {"w": "following", "b": [0.7213, 0.5358, 0.8194, 0.5555]}, {"w": "function", "b": [0.1294, 0.5563, 0.2135, 0.576]}, {"w": "in", "b": [0.2198, 0.5563, 0.2394, 0.576]}, {"w": "this", "b": [0.2457, 0.5563, 0.2822, 0.576]}, {"w": "case", "b": [0.2885, 0.5563, 0.3319, 0.576]}, {"w": "(see", "b": [0.3382, 0.5563, 0.3788, 0.576]}, {"w": "figure", "b": [0.3851, 0.5563, 0.4453, 0.576]}, {"w": "6.10):", "b": [0.4516, 0.5563, 0.5112, 0.576]}]}, {"id": "b_3", "type": "equation", "text": "output_t = np.tanh(np.dot(W, input_t) + np.dot(U, state_t) + b)", "words": [{"w": "output_t", "b": [0.1357, 0.594, 0.2265, 0.6092]}, {"w": "=", "b": [0.2379, 0.594, 0.2492, 0.6092]}, {"w": "np.tanh(np.dot(W,", "b": [0.2606, 0.594, 0.4536, 0.6092]}, {"w": "input_t)", "b": [0.4649, 0.594, 0.5557, 0.6092]}, {"w": "+", "b": [0.5671, 0.594, 0.5784, 0.6092]}, {"w": "np.dot(U,", "b": [0.5898, 0.594, 0.6919, 0.6092]}, {"w": "state_t)", "b": [0.7033, 0.594, 0.7941, 0.6092]}, {"w": "+", "b": [0.8055, 0.594, 0.8168, 0.6092]}, {"w": "b)", "b": [0.8282, 0.594, 0.8509, 0.6092]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 6.10. A simple RNN, unrolled over time", "words": [{"w": "Figure", "b": [0.1294, 0.6227, 0.1827, 0.6375]}, {"w": "6.10.", "b": [0.1874, 0.6227, 0.2252, 0.6375]}, {"w": "A", "b": [0.2299, 0.6227, 0.2436, 0.6375]}, {"w": "simple", "b": [0.2483, 0.6227, 0.3009, 0.6375]}, {"w": "RNN,", "b": [0.3056, 0.6227, 0.3513, 0.6375]}, {"w": "unrolled", "b": [0.3561, 0.6227, 0.4241, 0.6375]}, {"w": "over", "b": [0.4288, 0.6227, 0.4645, 0.6375]}, {"w": "time", "b": [0.4692, 0.6227, 0.505, 0.6375]}]}, {"id": "b_5", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.8776, 0.1672, 0.8924]}]}]}, {"page": 263, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In this example, the final output is a 2D tensor of shape (timesteps, output_features), where each timestep is the output of the loop at time t. Each timestep t in the output tensor contains information about timesteps 0 to t in the input sequence—about the entire past. For this reason, in many cases, you don’t need this full sequence of outputs; you just need the last output (output_t at the end of the loop), because it already contains information about the entire sequence.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "this", "b": [0.1567, 0.0857, 0.1932, 0.1054]}, {"w": "example,", "b": [0.1995, 0.0857, 0.2913, 0.1054]}, {"w": "the", "b": [0.2976, 0.0857, 0.3284, 0.1054]}, {"w": "final", "b": [0.3347, 0.0857, 0.3809, 0.1054]}, {"w": "output", "b": [0.3872, 0.0857, 0.4517, 0.1054]}, {"w": "is", "b": [0.458, 0.0857, 0.4749, 0.1054]}, {"w": "a", "b": [0.4812, 0.0857, 0.4924, 0.1054]}, {"w": "2D", "b": [0.4987, 0.0857, 0.5295, 0.1054]}, {"w": "tensor", "b": [0.5358, 0.0857, 0.5975, 0.1054]}, {"w": "of", "b": [0.6038, 0.0857, 0.6248, 0.1054]}, {"w": "shape", "b": [0.6311, 0.0857, 0.6885, 0.1054]}, {"w": "(timesteps,", "b": [0.6947, 0.0867, 0.8612, 0.1069]}, {"w": "output_features),", "b": [0.1294, 0.1071, 0.3779, 0.1283]}, {"w": "where", "b": [0.3842, 0.1071, 0.4459, 0.1268]}, {"w": "each", "b": [0.4522, 0.1071, 0.4984, 0.1268]}, {"w": "timestep", "b": [0.5047, 0.1071, 0.5902, 0.1268]}, {"w": "is", "b": [0.5965, 0.1071, 0.6133, 0.1268]}, {"w": "the", "b": [0.6196, 0.1071, 0.6504, 0.1268]}, {"w": "output", "b": [0.6567, 0.1071, 0.7212, 0.1268]}, {"w": "of", "b": [0.7275, 0.1071, 0.7485, 0.1268]}, {"w": "the", "b": [0.7548, 0.1071, 0.7857, 0.1268]}, {"w": "loop", "b": [0.792, 0.1071, 0.8368, 0.1268]}, {"w": "at", "b": [0.8431, 0.1071, 0.8614, 0.1268]}, {"w": "time", "b": [0.1294, 0.1285, 0.1743, 0.1482]}, {"w": "t.", "b": [0.1806, 0.1285, 0.202, 0.1497]}, {"w": "Each", "b": [0.2083, 0.1285, 0.2587, 0.1482]}, {"w": "timestep", "b": [0.265, 0.1285, 0.3505, 0.1482]}, {"w": "t", "b": [0.3568, 0.1295, 0.3719, 0.1497]}, {"w": "in", "b": [0.3782, 0.1285, 0.3979, 0.1482]}, {"w": "the", "b": [0.4042, 0.1285, 0.435, 0.1482]}, {"w": "output", "b": [0.4413, 0.1285, 0.5058, 0.1482]}, {"w": "tensor", "b": [0.5121, 0.1285, 0.5737, 0.1482]}, {"w": "contains", "b": [0.58, 0.1285, 0.6641, 0.1482]}, {"w": "information", "b": [0.6704, 0.1285, 0.7895, 0.1482]}, {"w": "about", "b": [0.7959, 0.1285, 0.8519, 0.1482]}, {"w": "timesteps", "b": [0.1294, 0.1499, 0.2247, 0.1696]}, {"w": "0", "b": [0.231, 0.1509, 0.2461, 0.1711]}, {"w": "to", "b": [0.2524, 0.1499, 0.2721, 0.1696]}, {"w": "t", "b": [0.2784, 0.1509, 0.2935, 0.1711]}, {"w": "in", "b": [0.2998, 0.1499, 0.3194, 0.1696]}, {"w": "the", "b": [0.3257, 0.1499, 0.3566, 0.1696]}, {"w": "input", "b": [0.3629, 0.1499, 0.4147, 0.1696]}, {"w": "sequence—about", "b": [0.421, 0.1499, 0.5948, 0.1696]}, {"w": "the", "b": [0.6011, 0.1499, 0.6319, 0.1696]}, {"w": "entire", "b": [0.6382, 0.1499, 0.6956, 0.1696]}, {"w": "past.", "b": [0.702, 0.1499, 0.7489, 0.1696]}, {"w": "For", "b": [0.7552, 0.1499, 0.7902, 0.1696]}, {"w": "this", "b": [0.7965, 0.1499, 0.833, 0.1696]}, {"w": "reason,", "b": [0.1294, 0.1712, 0.2016, 0.191]}, {"w": "in", "b": [0.2079, 0.1712, 0.2275, 0.191]}, {"w": "many", "b": [0.2338, 0.1712, 0.2898, 0.191]}, {"w": "cases,", "b": [0.2962, 0.1712, 0.3557, 0.191]}, {"w": "you", "b": [0.362, 0.1712, 0.3998, 0.191]}, {"w": "don’t", "b": [0.4061, 0.1712, 0.4589, 0.191]}, {"w": "need", "b": [0.4652, 0.1712, 0.5128, 0.191]}, {"w": "this", "b": [0.5192, 0.1712, 0.5556, 0.191]}, {"w": "full", "b": [0.5619, 0.1712, 0.597, 0.191]}, {"w": "sequence", "b": [0.6033, 0.1712, 0.6957, 0.191]}, {"w": "of", "b": [0.702, 0.1712, 0.723, 0.191]}, {"w": "outputs;", "b": [0.7293, 0.1712, 0.8106, 0.191]}, {"w": "you", "b": [0.8169, 0.1712, 0.8547, 0.191]}, {"w": "just", "b": [0.1294, 0.1917, 0.1659, 0.2115]}, {"w": "need", "b": [0.1722, 0.1917, 0.2198, 0.2115]}, {"w": "the", "b": [0.2261, 0.1917, 0.2569, 0.2115]}, {"w": "last", "b": [0.2632, 0.1917, 0.2983, 0.2115]}, {"w": "output", "b": [0.3046, 0.1917, 0.3691, 0.2115]}, {"w": "(output_t", "b": [0.3754, 0.1917, 0.5048, 0.213]}, {"w": "at", "b": [0.5111, 0.1917, 0.5293, 0.2115]}, {"w": "the", "b": [0.5356, 0.1917, 0.5665, 0.2115]}, {"w": "end", "b": [0.5728, 0.1917, 0.6092, 0.2115]}, {"w": "of", "b": [0.6155, 0.1917, 0.6365, 0.2115]}, {"w": "the", "b": [0.6428, 0.1917, 0.6737, 0.2115]}, {"w": "loop),", "b": [0.68, 0.1917, 0.7395, 0.2115]}, {"w": "because", "b": [0.7458, 0.1917, 0.8257, 0.2115]}, {"w": "it", "b": [0.832, 0.1917, 0.846, 0.2115]}, {"w": "already", "b": [0.1294, 0.2131, 0.2037, 0.2329]}, {"w": "contains", "b": [0.21, 0.2131, 0.294, 0.2329]}, {"w": "information", "b": [0.3003, 0.2131, 0.4195, 0.2329]}, {"w": "about", "b": [0.4258, 0.2131, 0.4818, 0.2329]}, {"w": "the", "b": [0.4881, 0.2131, 0.5189, 0.2329]}, {"w": "entire", "b": [0.5253, 0.2131, 0.5827, 0.2329]}, {"w": "sequence.", "b": [0.589, 0.2131, 0.6878, 0.2329]}]}, {"id": "b_1", "type": "paragraph", "text": "6.2.1. A recurrent layer in Keras", "words": [{"w": "6.2.1.", "b": [0.1294, 0.2871, 0.1862, 0.3069]}, {"w": "A", "b": [0.1925, 0.2871, 0.2107, 0.3069]}, {"w": "recurrent", "b": [0.217, 0.2871, 0.3197, 0.3069]}, {"w": "layer", "b": [0.326, 0.2871, 0.3807, 0.3069]}, {"w": "in", "b": [0.387, 0.2871, 0.408, 0.3069]}, {"w": "Keras", "b": [0.4143, 0.2871, 0.4788, 0.3069]}]}, {"id": "b_2", "type": "paragraph", "text": "The process you just naively implemented in Numpy corresponds to an actual Keras layer—the SimpleRNN layer:", "words": [{"w": "The", "b": [0.1294, 0.3299, 0.1686, 0.3496]}, {"w": "process", "b": [0.1749, 0.3299, 0.2506, 0.3496]}, {"w": "you", "b": [0.2569, 0.3299, 0.2947, 0.3496]}, {"w": "just", "b": [0.301, 0.3299, 0.3375, 0.3496]}, {"w": "naively", "b": [0.3438, 0.3299, 0.4181, 0.3496]}, {"w": "implemented", "b": [0.4244, 0.3299, 0.5561, 0.3496]}, {"w": "in", "b": [0.5624, 0.3299, 0.582, 0.3496]}, {"w": "Numpy", "b": [0.5883, 0.3299, 0.664, 0.3496]}, {"w": "corresponds", "b": [0.6703, 0.3299, 0.7922, 0.3496]}, {"w": "to", "b": [0.7985, 0.3299, 0.8182, 0.3496]}, {"w": "an", "b": [0.8245, 0.3299, 0.8483, 0.3496]}, {"w": "actual", "b": [0.1294, 0.3504, 0.1897, 0.3701]}, {"w": "Keras", "b": [0.196, 0.3504, 0.2548, 0.3701]}, {"w": "layer—the", "b": [0.2611, 0.3504, 0.3676, 0.3701]}, {"w": "SimpleRNN", "b": [0.3738, 0.3514, 0.51, 0.3716]}, {"w": "layer:", "b": [0.5164, 0.3504, 0.5738, 0.3701]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.layers import SimpleRNN", "words": [{"w": "from", "b": [0.1357, 0.389, 0.1811, 0.4042]}, {"w": "keras.layers", "b": [0.1925, 0.389, 0.3287, 0.4042]}, {"w": "import", "b": [0.34, 0.389, 0.4082, 0.4042]}, {"w": "SimpleRNN", "b": [0.4195, 0.389, 0.5217, 0.4042]}]}, {"id": "b_4", "type": "paragraph", "text": "There is one minor difference: SimpleRNN processes batches of sequences, like all other Keras layers, not a single sequence as in the Numpy example. This means it takes inputs of shape (batch_size, timesteps, input_features), rather than (timesteps, input_features).", "words": [{"w": "There", "b": [0.1294, 0.4271, 0.1882, 0.4468]}, {"w": "is", "b": [0.1945, 0.4271, 0.2114, 0.4468]}, {"w": "one", "b": [0.2177, 0.4271, 0.2541, 0.4468]}, {"w": "minor", "b": [0.2604, 0.4271, 0.3207, 0.4468]}, {"w": "difference:", "b": [0.327, 0.4271, 0.4357, 0.4468]}, {"w": "SimpleRNN", "b": [0.442, 0.4281, 0.5783, 0.4483]}, {"w": "processes", "b": [0.5846, 0.4271, 0.6812, 0.4468]}, {"w": "batches", "b": [0.6876, 0.4271, 0.7632, 0.4468]}, {"w": "of", "b": [0.7695, 0.4271, 0.7905, 0.4468]}, {"w": "sequences,", "b": [0.1294, 0.4484, 0.238, 0.4682]}, {"w": "like", "b": [0.2443, 0.4484, 0.2821, 0.4682]}, {"w": "all", "b": [0.2884, 0.4484, 0.3137, 0.4682]}, {"w": "other", "b": [0.32, 0.4484, 0.3718, 0.4682]}, {"w": "Keras", "b": [0.3781, 0.4484, 0.4369, 0.4682]}, {"w": "layers,", "b": [0.4432, 0.4484, 0.5098, 0.4682]}, {"w": "not", "b": [0.5161, 0.4484, 0.5483, 0.4682]}, {"w": "a", "b": [0.5546, 0.4484, 0.5658, 0.4682]}, {"w": "single", "b": [0.5721, 0.4484, 0.6324, 0.4682]}, {"w": "sequence", "b": [0.6387, 0.4484, 0.7312, 0.4682]}, {"w": "as", "b": [0.7375, 0.4484, 0.7585, 0.4682]}, {"w": "in", "b": [0.7648, 0.4484, 0.7844, 0.4682]}, {"w": "the", "b": [0.7907, 0.4484, 0.8216, 0.4682]}, {"w": "Numpy", "b": [0.1294, 0.4689, 0.2051, 0.4887]}, {"w": "example.", "b": [0.2114, 0.4689, 0.3032, 0.4887]}, {"w": "This", "b": [0.3095, 0.4689, 0.3543, 0.4887]}, {"w": "means", "b": [0.3606, 0.4689, 0.4251, 0.4887]}, {"w": "it", "b": [0.4314, 0.4689, 0.4454, 0.4887]}, {"w": "takes", "b": [0.4517, 0.4689, 0.5035, 0.4887]}, {"w": "inputs", "b": [0.5098, 0.4689, 0.5715, 0.4887]}, {"w": "of", "b": [0.5778, 0.4689, 0.5988, 0.4887]}, {"w": "shape", "b": [0.6051, 0.4689, 0.6626, 0.4887]}, {"w": "(batch_size,", "b": [0.6688, 0.47, 0.8505, 0.4902]}, {"w": "timesteps,", "b": [0.1294, 0.4914, 0.2808, 0.5116]}, {"w": "input_features),", "b": [0.2959, 0.4903, 0.5293, 0.5116]}, {"w": "rather", "b": [0.5356, 0.4903, 0.5944, 0.5101]}, {"w": "than", "b": [0.6007, 0.4903, 0.6442, 0.5101]}, {"w": "(timesteps,", "b": [0.6505, 0.4914, 0.817, 0.5116]}, {"w": "input_features).", "b": [0.1294, 0.5117, 0.3628, 0.533]}]}, {"id": "b_5", "type": "paragraph", "text": "Like all recurrent layers in Keras, SimpleRNN can be run in two different modes: it can return either the full sequences of successive outputs for each timestep (a 3D tensor of shape (batch_size, timesteps, output_features)) or only the last output for each input sequence (a 2D tensor of shape (batch_size, output_features)). These two modes are controlled by the return_sequences constructor argument. Let’s look at an example that uses SimpleRNN and returns only the output at the last timestep:", "words": [{"w": "Like", "b": [0.1294, 0.5554, 0.1757, 0.5751]}, {"w": "all", "b": [0.182, 0.5554, 0.2072, 0.5751]}, {"w": "recurrent", "b": [0.2135, 0.5554, 0.3045, 0.5751]}, {"w": "layers", "b": [0.3108, 0.5554, 0.3711, 0.5751]}, {"w": "in", "b": [0.3774, 0.5554, 0.397, 0.5751]}, {"w": "Keras,", "b": [0.4033, 0.5554, 0.4684, 0.5751]}, {"w": "SimpleRNN", "b": [0.4747, 0.5564, 0.6109, 0.5766]}, {"w": "can", "b": [0.6172, 0.5554, 0.6522, 0.5751]}, {"w": "be", "b": [0.6586, 0.5554, 0.6824, 0.5751]}, {"w": "run", "b": [0.6887, 0.5554, 0.7223, 0.5751]}, {"w": "in", "b": [0.7286, 0.5554, 0.7482, 0.5751]}, {"w": "two", "b": [0.7545, 0.5554, 0.7924, 0.5751]}, {"w": "different", "b": [0.1294, 0.5768, 0.2158, 0.5965]}, {"w": "modes:", "b": [0.2221, 0.5768, 0.295, 0.5965]}, {"w": "it", "b": [0.3013, 0.5768, 0.3153, 0.5965]}, {"w": "can", "b": [0.3216, 0.5768, 0.3566, 0.5965]}, {"w": "return", "b": [0.3629, 0.5768, 0.4232, 0.5965]}, {"w": "either", "b": [0.4295, 0.5768, 0.4869, 0.5965]}, {"w": "the", "b": [0.4932, 0.5768, 0.5241, 0.5965]}, {"w": "full", "b": [0.5304, 0.5768, 0.5654, 0.5965]}, {"w": "sequences", "b": [0.5717, 0.5768, 0.674, 0.5965]}, {"w": "of", "b": [0.6803, 0.5768, 0.7013, 0.5965]}, {"w": "successive", "b": [0.7076, 0.5768, 0.8141, 0.5965]}, {"w": "outputs", "b": [0.1294, 0.5973, 0.2037, 0.617]}, {"w": "for", "b": [0.21, 0.5973, 0.2394, 0.617]}, {"w": "each", "b": [0.2457, 0.5973, 0.2919, 0.617]}, {"w": "timestep", "b": [0.2982, 0.5973, 0.3837, 0.617]}, {"w": "(a", "b": [0.39, 0.5973, 0.4096, 0.617]}, {"w": "3D", "b": [0.416, 0.5973, 0.4468, 0.617]}, {"w": "tensor", "b": [0.453, 0.5973, 0.5147, 0.617]}, {"w": "of", "b": [0.521, 0.5973, 0.542, 0.617]}, {"w": "shape", "b": [0.5483, 0.5973, 0.6057, 0.617]}, {"w": "(batch_size,", "b": [0.612, 0.5983, 0.7937, 0.6185]}, {"w": "timesteps,", "b": [0.1294, 0.6197, 0.2808, 0.6399]}, {"w": "output_features))", "b": [0.2959, 0.6187, 0.5465, 0.6399]}, {"w": "or", "b": [0.5528, 0.6187, 0.5738, 0.6384]}, {"w": "only", "b": [0.5802, 0.6187, 0.625, 0.6384]}, {"w": "the", "b": [0.6313, 0.6187, 0.6621, 0.6384]}, {"w": "last", "b": [0.6684, 0.6187, 0.7035, 0.6384]}, {"w": "output", "b": [0.7098, 0.6187, 0.7743, 0.6384]}, {"w": "for", "b": [0.7806, 0.6187, 0.81, 0.6384]}, {"w": "each", "b": [0.8163, 0.6187, 0.8625, 0.6384]}, {"w": "input", "b": [0.1294, 0.6401, 0.1813, 0.6598]}, {"w": "sequence", "b": [0.1876, 0.6401, 0.28, 0.6598]}, {"w": "(a", "b": [0.2863, 0.6401, 0.3059, 0.6598]}, {"w": "2D", "b": [0.3122, 0.6401, 0.3431, 0.6598]}, {"w": "tensor", "b": [0.3494, 0.6401, 0.411, 0.6598]}, {"w": "of", "b": [0.4173, 0.6401, 0.4384, 0.6598]}, {"w": "shape", "b": [0.4447, 0.6401, 0.5021, 0.6598]}, {"w": "(batch_size,", "b": [0.5084, 0.6411, 0.69, 0.6613]}, {"w": "output_features)).", "b": [0.1294, 0.6615, 0.3863, 0.6827]}, {"w": "These", "b": [0.3926, 0.6615, 0.4529, 0.6812]}, {"w": "two", "b": [0.4592, 0.6615, 0.497, 0.6812]}, {"w": "modes", "b": [0.5033, 0.6615, 0.5692, 0.6812]}, {"w": "are", "b": [0.5755, 0.6615, 0.6063, 0.6812]}, {"w": "controlled", "b": [0.6126, 0.6615, 0.7149, 0.6812]}, {"w": "by", "b": [0.7212, 0.6615, 0.7464, 0.6812]}, {"w": "the", "b": [0.7527, 0.6615, 0.7836, 0.6812]}, {"w": "return_sequences", "b": [0.1294, 0.6839, 0.3716, 0.7041]}, {"w": "constructor", "b": [0.3779, 0.6829, 0.4914, 0.7026]}, {"w": "argument.", "b": [0.4977, 0.6829, 0.5988, 0.7026]}, {"w": "Let’s", "b": [0.6051, 0.6829, 0.6556, 0.7026]}, {"w": "look", "b": [0.6619, 0.6829, 0.7067, 0.7026]}, {"w": "at", "b": [0.713, 0.6829, 0.7312, 0.7026]}, {"w": "an", "b": [0.7375, 0.6829, 0.7614, 0.7026]}, {"w": "example", "b": [0.7677, 0.6829, 0.8531, 0.7026]}, {"w": "that", "b": [0.1294, 0.7043, 0.1673, 0.724]}, {"w": "uses", "b": [0.1736, 0.7043, 0.217, 0.724]}, {"w": "SimpleRNN", "b": [0.2233, 0.7053, 0.3595, 0.7255]}, {"w": "and", "b": [0.3658, 0.7043, 0.4023, 0.724]}, {"w": "returns", "b": [0.4086, 0.7043, 0.4786, 0.724]}, {"w": "only", "b": [0.4849, 0.7043, 0.5298, 0.724]}, {"w": "the", "b": [0.5361, 0.7043, 0.5669, 0.724]}, {"w": "output", "b": [0.5732, 0.7043, 0.6377, 0.724]}, {"w": "at", "b": [0.644, 0.7043, 0.6622, 0.724]}, {"w": "the", "b": [0.6685, 0.7043, 0.6993, 0.724]}, {"w": "last", "b": [0.7056, 0.7043, 0.7407, 0.724]}, {"w": "timestep:", "b": [0.747, 0.7043, 0.8395, 0.724]}]}, {"id": "b_6", "type": "paragraph", "text": ">>> from keras.models import Sequential >>> from keras.layers import Embedding, SimpleRNN >>> model = Sequential() >>> model.add(Embedding(10000, 32)) >>> model.add(SimpleRNN(32)) >>> model.summary() ________________________________________________________________ Layer (type) Output Shape Param # ================================================================ embedding_22 (Embedding) (None, None, 32) 320000 ________________________________________________________________", "words": [{"w": ">>>", "b": [0.1357, 0.7429, 0.1698, 0.758]}, {"w": "from", "b": [0.1811, 0.7429, 0.2265, 0.758]}, {"w": "keras.models", "b": [0.2379, 0.7429, 0.3741, 0.758]}, {"w": "import", "b": [0.3855, 0.7429, 0.4536, 0.758]}, {"w": "Sequential", "b": [0.4649, 0.7429, 0.5784, 0.758]}, {"w": ">>>", "b": [0.1357, 0.758, 0.1698, 0.7732]}, {"w": "from", "b": [0.1811, 0.758, 0.2265, 0.7732]}, {"w": "keras.layers", "b": [0.2379, 0.758, 0.3741, 0.7732]}, {"w": "import", "b": [0.3855, 0.758, 0.4536, 0.7732]}, {"w": "Embedding,", "b": [0.4649, 0.758, 0.5784, 0.7732]}, {"w": "SimpleRNN", "b": [0.5898, 0.758, 0.6919, 0.7732]}, {"w": ">>>", "b": [0.1357, 0.7732, 0.1698, 0.7883]}, {"w": "model", "b": [0.1811, 0.7732, 0.2379, 0.7883]}, {"w": "=", "b": [0.2492, 0.7732, 0.2606, 0.7883]}, {"w": "Sequential()", "b": [0.2719, 0.7732, 0.4082, 0.7883]}, {"w": ">>>", "b": [0.1357, 0.7883, 0.1698, 0.8035]}, {"w": "model.add(Embedding(10000,", "b": [0.1811, 0.7883, 0.4763, 0.8035]}, {"w": "32))", "b": [0.4876, 0.7883, 0.533, 0.8035]}, {"w": ">>>", "b": [0.1357, 0.8035, 0.1698, 0.8186]}, {"w": "model.add(SimpleRNN(32))", "b": [0.1811, 0.8035, 0.4536, 0.8186]}, {"w": ">>>", "b": [0.1357, 0.8186, 0.1698, 0.8338]}, {"w": "model.summary()", "b": [0.1811, 0.8186, 0.3514, 0.8338]}, {"w": "________________________________________________________________", "b": [0.1357, 0.8338, 0.8622, 0.8489]}, {"w": "Layer", "b": [0.1357, 0.8489, 0.1925, 0.8641]}, {"w": "(type)", "b": [0.2038, 0.8489, 0.2719, 0.8641]}, {"w": "Output", "b": [0.5103, 0.8489, 0.5784, 0.8641]}, {"w": "Shape", "b": [0.5898, 0.8489, 0.6465, 0.8641]}, {"w": "Param", "b": [0.7601, 0.8489, 0.8168, 0.8641]}, {"w": "#", "b": [0.8282, 0.8489, 0.8395, 0.8641]}, {"w": "================================================================", "b": [0.1357, 0.8641, 0.8622, 0.8792]}, {"w": "embedding_22", "b": [0.1357, 0.8792, 0.2719, 0.8944]}, {"w": "(Embedding)", "b": [0.2833, 0.8792, 0.4082, 0.8944]}, {"w": "(None,", "b": [0.5103, 0.8792, 0.5784, 0.8944]}, {"w": "None,", "b": [0.5898, 0.8792, 0.6465, 0.8944]}, {"w": "32)", "b": [0.6579, 0.8792, 0.6919, 0.8944]}, {"w": "320000", "b": [0.7601, 0.8792, 0.8282, 0.8944]}, {"w": "________________________________________________________________", "b": [0.1357, 0.8944, 0.8622, 0.9095]}]}]}, {"page": 264, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "simplernn_10 (SimpleRNN) (None, 32) 2080 ================================================================ Total params: 322,080 Trainable params: 322,080 Non-trainable params: 0", "words": [{"w": "simplernn_10", "b": [0.1357, 0.0851, 0.2719, 0.1002]}, {"w": "(SimpleRNN)", "b": [0.2833, 0.0851, 0.4082, 0.1002]}, {"w": "(None,", "b": [0.5103, 0.0851, 0.5784, 0.1002]}, {"w": "32)", "b": [0.5898, 0.0851, 0.6238, 0.1002]}, {"w": "2080", "b": [0.7601, 0.0851, 0.8055, 0.1002]}, {"w": "================================================================", "b": [0.1357, 0.1002, 0.8622, 0.1154]}, {"w": "Total", "b": [0.1357, 0.1154, 0.1925, 0.1305]}, {"w": "params:", "b": [0.2038, 0.1154, 0.2833, 0.1305]}, {"w": "322,080", "b": [0.2946, 0.1154, 0.3741, 0.1305]}, {"w": "Trainable", "b": [0.1357, 0.1305, 0.2379, 0.1457]}, {"w": "params:", "b": [0.2492, 0.1305, 0.3287, 0.1457]}, {"w": "322,080", "b": [0.34, 0.1305, 0.4195, 0.1457]}, {"w": "Non-trainable", "b": [0.1357, 0.1457, 0.2833, 0.1608]}, {"w": "params:", "b": [0.2946, 0.1457, 0.3741, 0.1608]}, {"w": "0", "b": [0.3855, 0.1457, 0.3968, 0.1608]}]}, {"id": "b_1", "type": "paragraph", "text": "The following example returns the full state sequence:", "words": [{"w": "The", "b": [0.1294, 0.1837, 0.1686, 0.2035]}, {"w": "following", "b": [0.1749, 0.1837, 0.273, 0.2035]}, {"w": "example", "b": [0.2794, 0.1837, 0.3648, 0.2035]}, {"w": "returns", "b": [0.3711, 0.1837, 0.4412, 0.2035]}, {"w": "the", "b": [0.4475, 0.1837, 0.4783, 0.2035]}, {"w": "full", "b": [0.4846, 0.1837, 0.5197, 0.2035]}, {"w": "state", "b": [0.526, 0.1837, 0.5722, 0.2035]}, {"w": "sequence:", "b": [0.5785, 0.1837, 0.678, 0.2035]}]}, {"id": "b_2", "type": "paragraph", "text": ">>> model = Sequential() >>> model.add(Embedding(10000, 32)) >>> model.add(SimpleRNN(32, return_sequences=True)) >>> model.summary() ________________________________________________________________ Layer (type) Output Shape Param # ================================================================ embedding_23 (Embedding) (None, None, 32) 320000 ________________________________________________________________ simplernn_11 (SimpleRNN) (None, None, 32) 2080 ================================================================ Total params: 322,080 Trainable params: 322,080 Non-trainable params: 0", "words": [{"w": ">>>", "b": [0.1357, 0.2215, 0.1698, 0.2366]}, {"w": "model", "b": [0.1811, 0.2215, 0.2379, 0.2366]}, {"w": "=", "b": [0.2492, 0.2215, 0.2606, 0.2366]}, {"w": "Sequential()", "b": [0.2719, 0.2215, 0.4082, 0.2366]}, {"w": ">>>", "b": [0.1357, 0.2366, 0.1698, 0.2518]}, {"w": "model.add(Embedding(10000,", "b": [0.1811, 0.2366, 0.4763, 0.2518]}, {"w": "32))", "b": [0.4876, 0.2366, 0.533, 0.2518]}, {"w": ">>>", "b": [0.1357, 0.2518, 0.1698, 0.2669]}, {"w": "model.add(SimpleRNN(32,", "b": [0.1811, 0.2518, 0.4422, 0.2669]}, {"w": "return_sequences=True))", "b": [0.4536, 0.2518, 0.7146, 0.2669]}, {"w": ">>>", "b": [0.1357, 0.2669, 0.1698, 0.2821]}, {"w": "model.summary()", "b": [0.1811, 0.2669, 0.3514, 0.2821]}, {"w": "________________________________________________________________", "b": [0.1357, 0.2821, 0.8622, 0.2972]}, {"w": "Layer", "b": [0.1357, 0.2972, 0.1925, 0.3124]}, {"w": "(type)", "b": [0.2038, 0.2972, 0.2719, 0.3124]}, {"w": "Output", "b": [0.5103, 0.2972, 0.5784, 0.3124]}, {"w": "Shape", "b": [0.5898, 0.2972, 0.6465, 0.3124]}, {"w": "Param", "b": [0.7601, 0.2972, 0.8168, 0.3124]}, {"w": "#", "b": [0.8282, 0.2972, 0.8395, 0.3124]}, {"w": "================================================================", "b": [0.1357, 0.3124, 0.8622, 0.3275]}, {"w": "embedding_23", "b": [0.1357, 0.3275, 0.2719, 0.3427]}, {"w": "(Embedding)", "b": [0.2833, 0.3275, 0.4082, 0.3427]}, {"w": "(None,", "b": [0.5103, 0.3275, 0.5784, 0.3427]}, {"w": "None,", "b": [0.5898, 0.3275, 0.6465, 0.3427]}, {"w": "32)", "b": [0.6579, 0.3275, 0.6919, 0.3427]}, {"w": "320000", "b": [0.7601, 0.3275, 0.8282, 0.3427]}, {"w": "________________________________________________________________", "b": [0.1357, 0.3427, 0.8622, 0.3578]}, {"w": "simplernn_11", "b": [0.1357, 0.3578, 0.2719, 0.373]}, {"w": "(SimpleRNN)", "b": [0.2833, 0.3578, 0.4082, 0.373]}, {"w": "(None,", "b": [0.5103, 0.3578, 0.5784, 0.373]}, {"w": "None,", "b": [0.5898, 0.3578, 0.6465, 0.373]}, {"w": "32)", "b": [0.6579, 0.3578, 0.6919, 0.373]}, {"w": "2080", "b": [0.7601, 0.3578, 0.8055, 0.373]}, {"w": "================================================================", "b": [0.1357, 0.373, 0.8622, 0.3881]}, {"w": "Total", "b": [0.1357, 0.3881, 0.1925, 0.4033]}, {"w": "params:", "b": [0.2038, 0.3881, 0.2833, 0.4033]}, {"w": "322,080", "b": [0.2946, 0.3881, 0.3741, 0.4033]}, {"w": "Trainable", "b": [0.1357, 0.4033, 0.2379, 0.4184]}, {"w": "params:", "b": [0.2492, 0.4033, 0.3287, 0.4184]}, {"w": "322,080", "b": [0.34, 0.4033, 0.4195, 0.4184]}, {"w": "Non-trainable", "b": [0.1357, 0.4184, 0.2833, 0.4336]}, {"w": "params:", "b": [0.2946, 0.4184, 0.3741, 0.4336]}, {"w": "0", "b": [0.3855, 0.4184, 0.3968, 0.4336]}]}, {"id": "b_3", "type": "paragraph", "text": "It’s sometimes useful to stack several recurrent layers one after the other in order to increase the representational power of a network. In such a setup, you have to get all of the intermediate layers to return full sequence of outputs:", "words": [{"w": "It’s", "b": [0.1294, 0.4565, 0.1616, 0.4762]}, {"w": "sometimes", "b": [0.1679, 0.4565, 0.2759, 0.4762]}, {"w": "useful", "b": [0.2822, 0.4565, 0.3438, 0.4762]}, {"w": "to", "b": [0.3501, 0.4565, 0.3698, 0.4762]}, {"w": "stack", "b": [0.3761, 0.4565, 0.4279, 0.4762]}, {"w": "several", "b": [0.4342, 0.4565, 0.5056, 0.4762]}, {"w": "recurrent", "b": [0.512, 0.4565, 0.603, 0.4762]}, {"w": "layers", "b": [0.6093, 0.4565, 0.6695, 0.4762]}, {"w": "one", "b": [0.6758, 0.4565, 0.7123, 0.4762]}, {"w": "after", "b": [0.7186, 0.4565, 0.7648, 0.4762]}, {"w": "the", "b": [0.7711, 0.4565, 0.8019, 0.4762]}, {"w": "other", "b": [0.8082, 0.4565, 0.8601, 0.4762]}, {"w": "in", "b": [0.1294, 0.477, 0.149, 0.4967]}, {"w": "order", "b": [0.1553, 0.477, 0.2086, 0.4967]}, {"w": "to", "b": [0.2149, 0.477, 0.2345, 0.4967]}, {"w": "increase", "b": [0.2408, 0.477, 0.3234, 0.4967]}, {"w": "the", "b": [0.3298, 0.477, 0.3606, 0.4967]}, {"w": "representational", "b": [0.3669, 0.477, 0.528, 0.4967]}, {"w": "power", "b": [0.5343, 0.477, 0.5973, 0.4967]}, {"w": "of", "b": [0.6036, 0.477, 0.6246, 0.4967]}, {"w": "a", "b": [0.6309, 0.477, 0.6421, 0.4967]}, {"w": "network.", "b": [0.6484, 0.477, 0.7374, 0.4967]}, {"w": "In", "b": [0.7437, 0.477, 0.7647, 0.4967]}, {"w": "such", "b": [0.771, 0.477, 0.8172, 0.4967]}, {"w": "a", "b": [0.8235, 0.477, 0.8347, 0.4967]}, {"w": "setup,", "b": [0.1294, 0.4975, 0.189, 0.5172]}, {"w": "you", "b": [0.1953, 0.4975, 0.2331, 0.5172]}, {"w": "have", "b": [0.2394, 0.4975, 0.287, 0.5172]}, {"w": "to", "b": [0.2934, 0.4975, 0.313, 0.5172]}, {"w": "get", "b": [0.3193, 0.4975, 0.3501, 0.5172]}, {"w": "all", "b": [0.3564, 0.4975, 0.3816, 0.5172]}, {"w": "of", "b": [0.388, 0.4975, 0.409, 0.5172]}, {"w": "the", "b": [0.4153, 0.4975, 0.4461, 0.5172]}, {"w": "intermediate", "b": [0.4524, 0.4975, 0.5785, 0.5172]}, {"w": "layers", "b": [0.5848, 0.4975, 0.6451, 0.5172]}, {"w": "to", "b": [0.6514, 0.4975, 0.671, 0.5172]}, {"w": "return", "b": [0.6773, 0.4975, 0.7375, 0.5172]}, {"w": "full", "b": [0.7438, 0.4975, 0.7789, 0.5172]}, {"w": "sequence", "b": [0.1294, 0.518, 0.2219, 0.5377]}, {"w": "of", "b": [0.2282, 0.518, 0.2492, 0.5377]}, {"w": "outputs:", "b": [0.2555, 0.518, 0.3368, 0.5377]}]}, {"id": "b_4", "type": "paragraph", "text": ">>> model = Sequential() >>> model.add(Embedding(10000, 32)) >>> model.add(SimpleRNN(32, return_sequences=True)) >>> model.add(SimpleRNN(32, return_sequences=True)) >>> model.add(SimpleRNN(32, return_sequences=True)) >>> model.add(SimpleRNN(32)) 1 >>> model.summary() ________________________________________________________________ Layer (type) Output Shape Param # ================================================================ embedding_24 (Embedding) (None, None, 32) 320000 ________________________________________________________________ simplernn_12 (SimpleRNN) (None, None, 32) 2080 ________________________________________________________________ simplernn_13 (SimpleRNN) (None, None, 32) 2080 ________________________________________________________________ simplernn_14 (SimpleRNN) (None, None, 32) 2080 ________________________________________________________________ simplernn_15 (SimpleRNN) (None, 32) 2080 ================================================================ Total params: 328,320 Trainable params: 328,320 Non-trainable params: 0", "words": [{"w": ">>>", "b": [0.1357, 0.5557, 0.1698, 0.5708]}, {"w": "model", "b": [0.1811, 0.5557, 0.2379, 0.5708]}, {"w": "=", "b": [0.2492, 0.5557, 0.2606, 0.5708]}, {"w": "Sequential()", "b": [0.2719, 0.5557, 0.4082, 0.5708]}, {"w": ">>>", "b": [0.1357, 0.5709, 0.1698, 0.586]}, {"w": "model.add(Embedding(10000,", "b": [0.1811, 0.5709, 0.4763, 0.586]}, {"w": "32))", "b": [0.4876, 0.5709, 0.533, 0.586]}, {"w": ">>>", "b": [0.1357, 0.586, 0.1698, 0.6011]}, {"w": "model.add(SimpleRNN(32,", "b": [0.1811, 0.586, 0.4422, 0.6011]}, {"w": "return_sequences=True))", "b": [0.4536, 0.586, 0.7146, 0.6011]}, {"w": ">>>", "b": [0.1357, 0.6012, 0.1698, 0.6163]}, {"w": "model.add(SimpleRNN(32,", "b": [0.1811, 0.6012, 0.4422, 0.6163]}, {"w": "return_sequences=True))", "b": [0.4536, 0.6012, 0.7146, 0.6163]}, {"w": ">>>", "b": [0.1357, 0.6163, 0.1698, 0.6315]}, {"w": "model.add(SimpleRNN(32,", "b": [0.1811, 0.6163, 0.4422, 0.6315]}, {"w": "return_sequences=True))", "b": [0.4536, 0.6163, 0.7146, 0.6315]}, {"w": ">>>", "b": [0.1357, 0.6315, 0.1698, 0.6466]}, {"w": "model.add(SimpleRNN(32))", "b": [0.1811, 0.6315, 0.4536, 0.6466]}, {"w": "1", "b": [0.8169, 0.6315, 0.8283, 0.6466]}, {"w": ">>>", "b": [0.1357, 0.6466, 0.1698, 0.6618]}, {"w": "model.summary()", "b": [0.1811, 0.6466, 0.3514, 0.6618]}, {"w": "________________________________________________________________", "b": [0.1357, 0.6618, 0.8622, 0.6769]}, {"w": "Layer", "b": [0.1357, 0.6769, 0.1925, 0.6921]}, {"w": "(type)", "b": [0.2038, 0.6769, 0.2719, 0.6921]}, {"w": "Output", "b": [0.5103, 0.6769, 0.5784, 0.6921]}, {"w": "Shape", "b": [0.5898, 0.6769, 0.6465, 0.6921]}, {"w": "Param", "b": [0.7601, 0.6769, 0.8168, 0.6921]}, {"w": "#", "b": [0.8282, 0.6769, 0.8395, 0.6921]}, {"w": "================================================================", "b": [0.1357, 0.6921, 0.8622, 0.7072]}, {"w": "embedding_24", "b": [0.1357, 0.7072, 0.2719, 0.7224]}, {"w": "(Embedding)", "b": [0.2833, 0.7072, 0.4082, 0.7224]}, {"w": "(None,", "b": [0.5103, 0.7072, 0.5784, 0.7224]}, {"w": "None,", "b": [0.5898, 0.7072, 0.6465, 0.7224]}, {"w": "32)", "b": [0.6579, 0.7072, 0.6919, 0.7224]}, {"w": "320000", "b": [0.7601, 0.7072, 0.8282, 0.7224]}, {"w": "________________________________________________________________", "b": [0.1357, 0.7224, 0.8622, 0.7375]}, {"w": "simplernn_12", "b": [0.1357, 0.7375, 0.2719, 0.7527]}, {"w": "(SimpleRNN)", "b": [0.2833, 0.7375, 0.4082, 0.7527]}, {"w": "(None,", "b": [0.5103, 0.7375, 0.5784, 0.7527]}, {"w": "None,", "b": [0.5898, 0.7375, 0.6465, 0.7527]}, {"w": "32)", "b": [0.6579, 0.7375, 0.6919, 0.7527]}, {"w": "2080", "b": [0.7601, 0.7375, 0.8055, 0.7527]}, {"w": "________________________________________________________________", "b": [0.1357, 0.7527, 0.8622, 0.7678]}, {"w": "simplernn_13", "b": [0.1357, 0.7678, 0.2719, 0.783]}, {"w": "(SimpleRNN)", "b": [0.2833, 0.7678, 0.4082, 0.783]}, {"w": "(None,", "b": [0.5103, 0.7678, 0.5784, 0.783]}, {"w": "None,", "b": [0.5898, 0.7678, 0.6465, 0.783]}, {"w": "32)", "b": [0.6579, 0.7678, 0.6919, 0.783]}, {"w": "2080", "b": [0.7601, 0.7678, 0.8055, 0.783]}, {"w": "________________________________________________________________", "b": [0.1357, 0.783, 0.8622, 0.7981]}, {"w": "simplernn_14", "b": [0.1357, 0.7981, 0.2719, 0.8133]}, {"w": "(SimpleRNN)", "b": [0.2833, 0.7981, 0.4082, 0.8133]}, {"w": "(None,", "b": [0.5103, 0.7981, 0.5784, 0.8133]}, {"w": "None,", "b": [0.5898, 0.7981, 0.6465, 0.8133]}, {"w": "32)", "b": [0.6579, 0.7981, 0.6919, 0.8133]}, {"w": "2080", "b": [0.7601, 0.7981, 0.8055, 0.8133]}, {"w": "________________________________________________________________", "b": [0.1357, 0.8133, 0.8622, 0.8284]}, {"w": "simplernn_15", "b": [0.1357, 0.8284, 0.2719, 0.8436]}, {"w": "(SimpleRNN)", "b": [0.2833, 0.8284, 0.4082, 0.8436]}, {"w": "(None,", "b": [0.5103, 0.8284, 0.5784, 0.8436]}, {"w": "32)", "b": [0.5898, 0.8284, 0.6238, 0.8436]}, {"w": "2080", "b": [0.7601, 0.8284, 0.8055, 0.8436]}, {"w": "================================================================", "b": [0.1357, 0.8436, 0.8622, 0.8587]}, {"w": "Total", "b": [0.1357, 0.8587, 0.1925, 0.8739]}, {"w": "params:", "b": [0.2038, 0.8587, 0.2833, 0.8739]}, {"w": "328,320", "b": [0.2946, 0.8587, 0.3741, 0.8739]}, {"w": "Trainable", "b": [0.1357, 0.8739, 0.2379, 0.889]}, {"w": "params:", "b": [0.2492, 0.8739, 0.3287, 0.889]}, {"w": "328,320", "b": [0.34, 0.8739, 0.4195, 0.889]}, {"w": "Non-trainable", "b": [0.1357, 0.8891, 0.2833, 0.9042]}, {"w": "params:", "b": [0.2946, 0.8891, 0.3741, 0.9042]}, {"w": "0", "b": [0.3855, 0.8891, 0.3968, 0.9042]}]}]}, {"page": 265, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1 Last layer only returns the last output", "words": [{"w": "1", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Last", "b": [0.1988, 0.0857, 0.2464, 0.1054]}, {"w": "layer", "b": [0.2527, 0.0857, 0.3074, 0.1054]}, {"w": "only", "b": [0.3137, 0.0857, 0.36, 0.1054]}, {"w": "returns", "b": [0.3663, 0.0857, 0.4457, 0.1054]}, {"w": "the", "b": [0.452, 0.0857, 0.4856, 0.1054]}, {"w": "last", "b": [0.4919, 0.0857, 0.5297, 0.1054]}, {"w": "output", "b": [0.536, 0.0857, 0.6075, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Now, let’s use such a model on the IMDB movie-review-classification problem. First, preprocess the data.", "words": [{"w": "Now,", "b": [0.1294, 0.1285, 0.1831, 0.1482]}, {"w": "let’s", "b": [0.1894, 0.1285, 0.2315, 0.1482]}, {"w": "use", "b": [0.2378, 0.1285, 0.2714, 0.1482]}, {"w": "such", "b": [0.2777, 0.1285, 0.3239, 0.1482]}, {"w": "a", "b": [0.3303, 0.1285, 0.3415, 0.1482]}, {"w": "model", "b": [0.3478, 0.1285, 0.4108, 0.1482]}, {"w": "on", "b": [0.4171, 0.1285, 0.4424, 0.1482]}, {"w": "the", "b": [0.4487, 0.1285, 0.4795, 0.1482]}, {"w": "IMDB", "b": [0.4858, 0.1285, 0.5517, 0.1482]}, {"w": "movie-review-classification", "b": [0.558, 0.1285, 0.8396, 0.1482]}, {"w": "problem.", "b": [0.1294, 0.149, 0.2198, 0.1687]}, {"w": "First,", "b": [0.2261, 0.149, 0.2787, 0.1687]}, {"w": "preprocess", "b": [0.285, 0.149, 0.3928, 0.1687]}, {"w": "the", "b": [0.3992, 0.149, 0.43, 0.1687]}, {"w": "data.", "b": [0.4363, 0.149, 0.4846, 0.1687]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.22. Preparing the IMDB data", "words": [{"w": "Listing", "b": [0.1294, 0.1868, 0.1862, 0.2016]}, {"w": "6.22.", "b": [0.1909, 0.1868, 0.2288, 0.2016]}, {"w": "Preparing", "b": [0.2335, 0.1868, 0.3151, 0.2016]}, {"w": "the", "b": [0.3198, 0.1868, 0.345, 0.2016]}, {"w": "IMDB", "b": [0.3498, 0.1868, 0.4013, 0.2016]}, {"w": "data", "b": [0.406, 0.1868, 0.4417, 0.2016]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.datasets import imdb from keras.preprocessing import sequence max_features = 10000 1 maxlen = 500 2 batch_size = 32 print('Loading data...') (input_train, y_train), (input_test, y_test) = imdb.load_data( num_words=max_features) print(len(input_train), 'train sequences') print(len(input_test), 'test sequences') print('Pad sequences (samples x time)') input_train = sequence.pad_sequences(input_train, maxlen=maxlen) input_test = sequence.pad_sequences(input_test, maxlen=maxlen) print('input_train shape:', input_train.shape) print('input_test shape:', input_test.shape)", "words": [{"w": "from", "b": [0.1357, 0.2152, 0.1811, 0.2304]}, {"w": "keras.datasets", "b": [0.1925, 0.2152, 0.3514, 0.2304]}, {"w": "import", "b": [0.3628, 0.2152, 0.4309, 0.2304]}, {"w": "imdb", "b": [0.4422, 0.2152, 0.4876, 0.2304]}, {"w": "from", "b": [0.1357, 0.2304, 0.1811, 0.2455]}, {"w": "keras.preprocessing", "b": [0.1925, 0.2304, 0.4082, 0.2455]}, {"w": "import", "b": [0.4195, 0.2304, 0.4876, 0.2455]}, {"w": "sequence", "b": [0.499, 0.2304, 0.5898, 0.2455]}, {"w": "max_features", "b": [0.1357, 0.2607, 0.2719, 0.2758]}, {"w": "=", "b": [0.2833, 0.2607, 0.2946, 0.2758]}, {"w": "10000", "b": [0.306, 0.2607, 0.3628, 0.2758]}, {"w": "1", "b": [0.7488, 0.2607, 0.7602, 0.2758]}, {"w": "maxlen", "b": [0.1357, 0.2758, 0.2038, 0.291]}, {"w": "=", "b": [0.2152, 0.2758, 0.2265, 0.291]}, {"w": "500", "b": [0.2379, 0.2758, 0.2719, 0.291]}, {"w": "2", "b": [0.7488, 0.2758, 0.7602, 0.291]}, {"w": "batch_size", "b": [0.1357, 0.291, 0.2492, 0.3061]}, {"w": "=", "b": [0.2606, 0.291, 0.2719, 0.3061]}, {"w": "32", "b": [0.2833, 0.291, 0.306, 0.3061]}, {"w": "print('Loading", "b": [0.1357, 0.3213, 0.2946, 0.3364]}, {"w": "data...')", "b": [0.306, 0.3213, 0.4082, 0.3364]}, {"w": "(input_train,", "b": [0.1357, 0.3364, 0.2833, 0.3516]}, {"w": "y_train),", "b": [0.2946, 0.3364, 0.3968, 0.3516]}, {"w": "(input_test,", "b": [0.4082, 0.3364, 0.5444, 0.3516]}, {"w": "y_test)", "b": [0.5557, 0.3364, 0.6352, 0.3516]}, {"w": "=", "b": [0.6465, 0.3364, 0.6579, 0.3516]}, {"w": "imdb.load_data(", "b": [0.6692, 0.3364, 0.8395, 0.3516]}, {"w": "num_words=max_features)", "b": [0.1925, 0.3516, 0.4536, 0.3667]}, {"w": "print(len(input_train),", "b": [0.1357, 0.3667, 0.3968, 0.3819]}, {"w": "'train", "b": [0.4082, 0.3667, 0.4763, 0.3819]}, {"w": "sequences')", "b": [0.4876, 0.3667, 0.6125, 0.3819]}, {"w": "print(len(input_test),", "b": [0.1357, 0.3819, 0.3855, 0.397]}, {"w": "'test", "b": [0.3968, 0.3819, 0.4536, 0.397]}, {"w": "sequences')", "b": [0.4649, 0.3819, 0.5898, 0.397]}, {"w": "print('Pad", "b": [0.1357, 0.4122, 0.2492, 0.4273]}, {"w": "sequences", "b": [0.2606, 0.4122, 0.3628, 0.4273]}, {"w": "(samples", "b": [0.3741, 0.4122, 0.4649, 0.4273]}, {"w": "x", "b": [0.4763, 0.4122, 0.4876, 0.4273]}, {"w": "time)')", "b": [0.499, 0.4122, 0.5784, 0.4273]}, {"w": "input_train", "b": [0.1357, 0.4274, 0.2606, 0.4425]}, {"w": "=", "b": [0.2719, 0.4274, 0.2833, 0.4425]}, {"w": "sequence.pad_sequences(input_train,", "b": [0.2946, 0.4274, 0.6919, 0.4425]}, {"w": "maxlen=maxlen)", "b": [0.7033, 0.4274, 0.8622, 0.4425]}, {"w": "input_test", "b": [0.1357, 0.4425, 0.2492, 0.4576]}, {"w": "=", "b": [0.2606, 0.4425, 0.2719, 0.4576]}, {"w": "sequence.pad_sequences(input_test,", "b": [0.2833, 0.4425, 0.6692, 0.4576]}, {"w": "maxlen=maxlen)", "b": [0.6806, 0.4425, 0.8395, 0.4576]}, {"w": "print('input_train", "b": [0.1357, 0.4577, 0.34, 0.4728]}, {"w": "shape:',", "b": [0.3514, 0.4577, 0.4422, 0.4728]}, {"w": "input_train.shape)", "b": [0.4536, 0.4577, 0.6579, 0.4728]}, {"w": "print('input_test", "b": [0.1357, 0.4728, 0.3287, 0.488]}, {"w": "shape:',", "b": [0.34, 0.4728, 0.4309, 0.488]}, {"w": "input_test.shape)", "b": [0.4422, 0.4728, 0.6352, 0.488]}]}, {"id": "b_4", "type": "paragraph", "text": "1 Number of words to consider as features 2 Cuts off texts after this many words (among the max_features most common words)", "words": [{"w": "1", "b": [0.1799, 0.5064, 0.1925, 0.5261]}, {"w": "Number", "b": [0.1988, 0.5064, 0.2885, 0.5261]}, {"w": "of", "b": [0.2948, 0.5064, 0.3158, 0.5261]}, {"w": "words", "b": [0.3221, 0.5064, 0.388, 0.5261]}, {"w": "to", "b": [0.3943, 0.5064, 0.4153, 0.5261]}, {"w": "consider", "b": [0.4216, 0.5064, 0.5127, 0.5261]}, {"w": "as", "b": [0.519, 0.5064, 0.5414, 0.5261]}, {"w": "features", "b": [0.5477, 0.5064, 0.6341, 0.5261]}, {"w": "2", "b": [0.1799, 0.5269, 0.1925, 0.5466]}, {"w": "Cuts", "b": [0.1988, 0.5269, 0.2492, 0.5466]}, {"w": "off", "b": [0.2555, 0.5269, 0.285, 0.5466]}, {"w": "texts", "b": [0.2913, 0.5269, 0.3417, 0.5466]}, {"w": "after", "b": [0.348, 0.5269, 0.3998, 0.5466]}, {"w": "this", "b": [0.4061, 0.5269, 0.4454, 0.5466]}, {"w": "many", "b": [0.4517, 0.5269, 0.5119, 0.5466]}, {"w": "words", "b": [0.5182, 0.5269, 0.5841, 0.5466]}, {"w": "(among", "b": [0.5904, 0.5269, 0.6717, 0.5466]}, {"w": "the", "b": [0.678, 0.5269, 0.7116, 0.5466]}, {"w": "max_features", "b": [0.7179, 0.5269, 0.8632, 0.5466]}, {"w": "most", "b": [0.1799, 0.5474, 0.2317, 0.5671]}, {"w": "common", "b": [0.238, 0.5474, 0.3305, 0.5671]}, {"w": "words)", "b": [0.3368, 0.5474, 0.4111, 0.5671]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s train a simple recurrent network using an Embedding layer and a SimpleRNN layer.", "words": [{"w": "Let’s", "b": [0.1294, 0.5902, 0.1798, 0.6099]}, {"w": "train", "b": [0.1862, 0.5902, 0.2324, 0.6099]}, {"w": "a", "b": [0.2387, 0.5902, 0.2499, 0.6099]}, {"w": "simple", "b": [0.2562, 0.5902, 0.3235, 0.6099]}, {"w": "recurrent", "b": [0.3298, 0.5902, 0.4208, 0.6099]}, {"w": "network", "b": [0.4271, 0.5902, 0.5098, 0.6099]}, {"w": "using", "b": [0.5161, 0.5902, 0.5708, 0.6099]}, {"w": "an", "b": [0.5771, 0.5902, 0.6009, 0.6099]}, {"w": "Embedding", "b": [0.6071, 0.5912, 0.7434, 0.6114]}, {"w": "layer", "b": [0.7497, 0.5902, 0.8001, 0.6099]}, {"w": "and", "b": [0.8064, 0.5902, 0.8428, 0.6099]}, {"w": "a", "b": [0.8492, 0.5902, 0.8604, 0.6099]}, {"w": "SimpleRNN", "b": [0.1294, 0.6126, 0.2656, 0.6328]}, {"w": "layer.", "b": [0.272, 0.6116, 0.3273, 0.6313]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 6.23. Training the model with Embedding and SimpleRNN layers", "words": [{"w": "Listing", "b": [0.1294, 0.6503, 0.1862, 0.6651]}, {"w": "6.23.", "b": [0.1909, 0.6503, 0.2288, 0.6651]}, {"w": "Training", "b": [0.2335, 0.6503, 0.3036, 0.6651]}, {"w": "the", "b": [0.3083, 0.6503, 0.3335, 0.6651]}, {"w": "model", "b": [0.3382, 0.6503, 0.3876, 0.6651]}, {"w": "with", "b": [0.3924, 0.6503, 0.4281, 0.6651]}, {"w": "Embedding", "b": [0.4328, 0.6511, 0.535, 0.6662]}, {"w": "and", "b": [0.5397, 0.6503, 0.5702, 0.6651]}, {"w": "SimpleRNN", "b": [0.5749, 0.6511, 0.6771, 0.6662]}, {"w": "layers", "b": [0.6818, 0.6503, 0.7302, 0.6651]}]}, {"id": "b_7", "type": "paragraph", "text": "from keras.layers import Dense model = Sequential() model.add(Embedding(max_features, 32)) model.add(SimpleRNN(32)) model.add(Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(input_train, y_train, epochs=10, batch_size=128, validation_split=0.2)", "words": [{"w": "from", "b": [0.1357, 0.6796, 0.1811, 0.6947]}, {"w": "keras.layers", "b": [0.1925, 0.6796, 0.3287, 0.6947]}, {"w": "import", "b": [0.34, 0.6796, 0.4082, 0.6947]}, {"w": "Dense", "b": [0.4195, 0.6796, 0.4763, 0.6947]}, {"w": "model", "b": [0.1357, 0.7099, 0.1925, 0.725]}, {"w": "=", "b": [0.2038, 0.7099, 0.2152, 0.725]}, {"w": "Sequential()", "b": [0.2265, 0.7099, 0.3628, 0.725]}, {"w": "model.add(Embedding(max_features,", "b": [0.1357, 0.725, 0.5103, 0.7402]}, {"w": "32))", "b": [0.5217, 0.725, 0.5671, 0.7402]}, {"w": "model.add(SimpleRNN(32))", "b": [0.1357, 0.7402, 0.4082, 0.7553]}, {"w": "model.add(Dense(1,", "b": [0.1357, 0.7554, 0.34, 0.7705]}, {"w": "activation='sigmoid'))", "b": [0.3514, 0.7554, 0.6011, 0.7705]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.7857, 0.5217, 0.8008]}, {"w": "loss='binary_crossentropy',", "b": [0.533, 0.7857, 0.8395, 0.8008]}, {"w": "metrics=['acc'])", "b": [0.1357, 0.8008, 0.3173, 0.816]}, {"w": "history", "b": [0.1357, 0.816, 0.2152, 0.8311]}, {"w": "=", "b": [0.2265, 0.816, 0.2379, 0.8311]}, {"w": "model.fit(input_train,", "b": [0.2492, 0.816, 0.499, 0.8311]}, {"w": "y_train,", "b": [0.5103, 0.816, 0.6011, 0.8311]}, {"w": "epochs=10,", "b": [0.3628, 0.8311, 0.4763, 0.8463]}, {"w": "batch_size=128,", "b": [0.3628, 0.8463, 0.533, 0.8614]}, {"w": "validation_split=0.2)", "b": [0.3628, 0.8614, 0.6011, 0.8766]}]}]}, {"page": 266, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Now, let’s display the training and validation loss and accuracy (see figures 6.11 and 6.12).", "words": [{"w": "Now,", "b": [0.1294, 0.0857, 0.1831, 0.1054]}, {"w": "let’s", "b": [0.1894, 0.0857, 0.2315, 0.1054]}, {"w": "display", "b": [0.2378, 0.0857, 0.3107, 0.1054]}, {"w": "the", "b": [0.317, 0.0857, 0.3478, 0.1054]}, {"w": "training", "b": [0.3541, 0.0857, 0.4326, 0.1054]}, {"w": "and", "b": [0.4389, 0.0857, 0.4753, 0.1054]}, {"w": "validation", "b": [0.4816, 0.0857, 0.5825, 0.1054]}, {"w": "loss", "b": [0.5888, 0.0857, 0.6281, 0.1054]}, {"w": "and", "b": [0.6344, 0.0857, 0.6708, 0.1054]}, {"w": "accuracy", "b": [0.6771, 0.0857, 0.7667, 0.1054]}, {"w": "(see", "b": [0.773, 0.0857, 0.8137, 0.1054]}, {"w": "figures", "b": [0.1294, 0.1062, 0.1995, 0.1259]}, {"w": "6.11", "b": [0.2058, 0.1062, 0.249, 0.1259]}, {"w": "and", "b": [0.2553, 0.1062, 0.2917, 0.1259]}, {"w": "6.12).", "b": [0.298, 0.1062, 0.3568, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.11. Training and validation loss on IMDB with simplernn", "words": [{"w": "Figure", "b": [0.1294, 0.144, 0.1827, 0.1588]}, {"w": "6.11.", "b": [0.1874, 0.144, 0.2242, 0.1588]}, {"w": "Training", "b": [0.2289, 0.144, 0.299, 0.1588]}, {"w": "and", "b": [0.3037, 0.144, 0.3342, 0.1588]}, {"w": "validation", "b": [0.3389, 0.144, 0.4199, 0.1588]}, {"w": "loss", "b": [0.4246, 0.144, 0.4541, 0.1588]}, {"w": "on", "b": [0.4588, 0.144, 0.4788, 0.1588]}, {"w": "IMDB", "b": [0.4835, 0.144, 0.535, 0.1588]}, {"w": "with", "b": [0.5397, 0.144, 0.5755, 0.1588]}, {"w": "simplernn", "b": [0.5802, 0.1448, 0.6824, 0.1599]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.12. Training and validation accuracy on IMDB with simplernn", "words": [{"w": "Figure", "b": [0.1294, 0.4453, 0.1827, 0.4601]}, {"w": "6.12.", "b": [0.1874, 0.4453, 0.2252, 0.4601]}, {"w": "Training", "b": [0.2299, 0.4453, 0.3, 0.4601]}, {"w": "and", "b": [0.3048, 0.4453, 0.3353, 0.4601]}, {"w": "validation", "b": [0.34, 0.4453, 0.4209, 0.4601]}, {"w": "accuracy", "b": [0.4257, 0.4453, 0.4982, 0.4601]}, {"w": "on", "b": [0.5029, 0.4453, 0.5229, 0.4601]}, {"w": "IMDB", "b": [0.5276, 0.4453, 0.5791, 0.4601]}, {"w": "with", "b": [0.5838, 0.4453, 0.6196, 0.4601]}, {"w": "simplernn", "b": [0.6243, 0.4461, 0.7265, 0.4612]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.24. Plotting results", "words": [{"w": "Listing", "b": [0.1294, 0.7465, 0.1862, 0.7614]}, {"w": "6.24.", "b": [0.1909, 0.7465, 0.2288, 0.7614]}, {"w": "Plotting", "b": [0.2335, 0.7465, 0.2976, 0.7614]}, {"w": "results", "b": [0.3023, 0.7465, 0.3556, 0.7614]}]}, {"id": "b_4", "type": "paragraph", "text": "import matplotlib.pyplot as plt acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(1, len(acc) + 1)", "words": [{"w": "import", "b": [0.1357, 0.775, 0.2038, 0.7901]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.775, 0.4082, 0.7901]}, {"w": "as", "b": [0.4195, 0.775, 0.4422, 0.7901]}, {"w": "plt", "b": [0.4536, 0.775, 0.4876, 0.7901]}, {"w": "acc", "b": [0.1357, 0.8053, 0.1698, 0.8204]}, {"w": "=", "b": [0.1811, 0.8053, 0.1925, 0.8204]}, {"w": "history.history['acc']", "b": [0.2038, 0.8053, 0.4536, 0.8204]}, {"w": "val_acc", "b": [0.1357, 0.8204, 0.2152, 0.8356]}, {"w": "=", "b": [0.2265, 0.8204, 0.2379, 0.8356]}, {"w": "history.history['val_acc']", "b": [0.2492, 0.8204, 0.5444, 0.8356]}, {"w": "loss", "b": [0.1357, 0.8356, 0.1811, 0.8507]}, {"w": "=", "b": [0.1925, 0.8356, 0.2038, 0.8507]}, {"w": "history.history['loss']", "b": [0.2152, 0.8356, 0.4763, 0.8507]}, {"w": "val_loss", "b": [0.1357, 0.8507, 0.2265, 0.8659]}, {"w": "=", "b": [0.2379, 0.8507, 0.2492, 0.8659]}, {"w": "history.history['val_loss']", "b": [0.2606, 0.8507, 0.5671, 0.8659]}, {"w": "epochs", "b": [0.1357, 0.881, 0.2038, 0.8962]}, {"w": "=", "b": [0.2152, 0.881, 0.2265, 0.8962]}, {"w": "range(1,", "b": [0.2379, 0.881, 0.3287, 0.8962]}, {"w": "len(acc)", "b": [0.34, 0.881, 0.4309, 0.8962]}, {"w": "+", "b": [0.4422, 0.881, 0.4536, 0.8962]}, {"w": "1)", "b": [0.4649, 0.881, 0.4876, 0.8962]}]}]}, {"page": 267, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()", "words": [{"w": "plt.plot(epochs,", "b": [0.1357, 0.0851, 0.3173, 0.1002]}, {"w": "acc,", "b": [0.3287, 0.0851, 0.3741, 0.1002]}, {"w": "'bo',", "b": [0.3855, 0.0851, 0.4422, 0.1002]}, {"w": "label='Training", "b": [0.4536, 0.0851, 0.6238, 0.1002]}, {"w": "acc')", "b": [0.6352, 0.0851, 0.6919, 0.1002]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.1002, 0.3173, 0.1154]}, {"w": "val_acc,", "b": [0.3287, 0.1002, 0.4195, 0.1154]}, {"w": "'b',", "b": [0.4309, 0.1002, 0.4763, 0.1154]}, {"w": "label='Validation", "b": [0.4876, 0.1002, 0.6806, 0.1154]}, {"w": "acc')", "b": [0.6919, 0.1002, 0.7487, 0.1154]}, {"w": "plt.title('Training", "b": [0.1357, 0.1154, 0.3514, 0.1305]}, {"w": "and", "b": [0.3628, 0.1154, 0.3968, 0.1305]}, {"w": "validation", "b": [0.4082, 0.1154, 0.5217, 0.1305]}, {"w": "accuracy')", "b": [0.533, 0.1154, 0.6465, 0.1305]}, {"w": "plt.legend()", "b": [0.1357, 0.1305, 0.2719, 0.1457]}, {"w": "plt.figure()", "b": [0.1357, 0.1608, 0.2719, 0.176]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.1912, 0.3173, 0.2063]}, {"w": "loss,", "b": [0.3287, 0.1912, 0.3855, 0.2063]}, {"w": "'bo',", "b": [0.3968, 0.1912, 0.4536, 0.2063]}, {"w": "label='Training", "b": [0.4649, 0.1912, 0.6352, 0.2063]}, {"w": "loss')", "b": [0.6465, 0.1912, 0.7146, 0.2063]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.2063, 0.3173, 0.2214]}, {"w": "val_loss,", "b": [0.3287, 0.2063, 0.4309, 0.2214]}, {"w": "'b',", "b": [0.4422, 0.2063, 0.4876, 0.2214]}, {"w": "label='Validation", "b": [0.499, 0.2063, 0.6919, 0.2214]}, {"w": "loss')", "b": [0.7033, 0.2063, 0.7714, 0.2214]}, {"w": "plt.title('Training", "b": [0.1357, 0.2215, 0.3514, 0.2366]}, {"w": "and", "b": [0.3628, 0.2215, 0.3968, 0.2366]}, {"w": "validation", "b": [0.4082, 0.2215, 0.5217, 0.2366]}, {"w": "loss')", "b": [0.533, 0.2215, 0.6011, 0.2366]}, {"w": "plt.legend()", "b": [0.1357, 0.2366, 0.2719, 0.2518]}, {"w": "plt.show()", "b": [0.1357, 0.2669, 0.2492, 0.2821]}]}, {"id": "b_1", "type": "paragraph", "text": "As a reminder, in chapter 3, the first naive approach to this dataset got you to a test accuracy of 88%. Unfortunately, this small recurrent network doesn’t perform well compared to this baseline (only 85% validation accuracy). Part of the problem is that your inputs only consider the first 500 words, rather than full sequences—hence, the RNN has access to less information than the earlier baseline model. The remainder of the problem is that SimpleRNN isn’t good at processing long sequences, such as text. Other types of recurrent layers perform much better. Let’s look at some more-advanced layers.", "words": [{"w": "As", "b": [0.1294, 0.3049, 0.1574, 0.3247]}, {"w": "a", "b": [0.1637, 0.3049, 0.1749, 0.3247]}, {"w": "reminder,", "b": [0.1813, 0.3049, 0.2776, 0.3247]}, {"w": "in", "b": [0.2839, 0.3049, 0.3035, 0.3247]}, {"w": "chapter", "b": [0.3098, 0.3049, 0.3841, 0.3247]}, {"w": "3,", "b": [0.3904, 0.3049, 0.4093, 0.3247]}, {"w": "the", "b": [0.4156, 0.3049, 0.4464, 0.3247]}, {"w": "first", "b": [0.4527, 0.3049, 0.4934, 0.3247]}, {"w": "naive", "b": [0.4997, 0.3049, 0.5543, 0.3247]}, {"w": "approach", "b": [0.5606, 0.3049, 0.6531, 0.3247]}, {"w": "to", "b": [0.6594, 0.3049, 0.679, 0.3247]}, {"w": "this", "b": [0.6853, 0.3049, 0.7218, 0.3247]}, {"w": "dataset", "b": [0.7281, 0.3049, 0.7981, 0.3247]}, {"w": "got", "b": [0.8044, 0.3049, 0.8367, 0.3247]}, {"w": "you", "b": [0.1294, 0.3254, 0.1673, 0.3452]}, {"w": "to", "b": [0.1736, 0.3254, 0.1932, 0.3452]}, {"w": "a", "b": [0.1995, 0.3254, 0.2107, 0.3452]}, {"w": "test", "b": [0.217, 0.3254, 0.252, 0.3452]}, {"w": "accuracy", "b": [0.2583, 0.3254, 0.348, 0.3452]}, {"w": "of", "b": [0.3543, 0.3254, 0.3753, 0.3452]}, {"w": "88%.", "b": [0.3816, 0.3254, 0.4341, 0.3452]}, {"w": "Unfortunately,", "b": [0.4404, 0.3254, 0.5866, 0.3452]}, {"w": "this", "b": [0.5929, 0.3254, 0.6293, 0.3452]}, {"w": "small", "b": [0.6356, 0.3254, 0.6903, 0.3452]}, {"w": "recurrent", "b": [0.6966, 0.3254, 0.7877, 0.3452]}, {"w": "network", "b": [0.1294, 0.3459, 0.2121, 0.3657]}, {"w": "doesn’t", "b": [0.2184, 0.3459, 0.2922, 0.3657]}, {"w": "perform", "b": [0.2985, 0.3459, 0.3797, 0.3657]}, {"w": "well", "b": [0.386, 0.3459, 0.4295, 0.3657]}, {"w": "compared", "b": [0.4358, 0.3459, 0.5353, 0.3657]}, {"w": "to", "b": [0.5416, 0.3459, 0.5612, 0.3657]}, {"w": "this", "b": [0.5675, 0.3459, 0.6039, 0.3657]}, {"w": "baseline", "b": [0.6103, 0.3459, 0.6929, 0.3657]}, {"w": "(only", "b": [0.6992, 0.3459, 0.7525, 0.3657]}, {"w": "85%", "b": [0.7588, 0.3459, 0.805, 0.3657]}, {"w": "validation", "b": [0.1294, 0.3664, 0.2303, 0.3862]}, {"w": "accuracy).", "b": [0.2366, 0.3664, 0.341, 0.3862]}, {"w": "Part", "b": [0.3473, 0.3664, 0.3879, 0.3862]}, {"w": "of", "b": [0.3942, 0.3664, 0.4152, 0.3862]}, {"w": "the", "b": [0.4215, 0.3664, 0.4524, 0.3862]}, {"w": "problem", "b": [0.4587, 0.3664, 0.5427, 0.3862]}, {"w": "is", "b": [0.549, 0.3664, 0.5659, 0.3862]}, {"w": "that", "b": [0.5722, 0.3664, 0.61, 0.3862]}, {"w": "your", "b": [0.6163, 0.3664, 0.6626, 0.3862]}, {"w": "inputs", "b": [0.6689, 0.3664, 0.7305, 0.3862]}, {"w": "only", "b": [0.7368, 0.3664, 0.7817, 0.3862]}, {"w": "consider", "b": [0.1294, 0.3869, 0.2149, 0.4067]}, {"w": "the", "b": [0.2212, 0.3869, 0.252, 0.4067]}, {"w": "first", "b": [0.2583, 0.3869, 0.299, 0.4067]}, {"w": "500", "b": [0.3053, 0.3869, 0.3431, 0.4067]}, {"w": "words,", "b": [0.3494, 0.3869, 0.4174, 0.4067]}, {"w": "rather", "b": [0.4237, 0.3869, 0.4825, 0.4067]}, {"w": "than", "b": [0.4888, 0.3869, 0.5322, 0.4067]}, {"w": "full", "b": [0.5385, 0.3869, 0.5736, 0.4067]}, {"w": "sequences—hence,", "b": [0.5799, 0.3869, 0.7725, 0.4067]}, {"w": "the", "b": [0.7788, 0.3869, 0.8096, 0.4067]}, {"w": "RNN", "b": [0.816, 0.3869, 0.8692, 0.4067]}, {"w": "has", "b": [0.1294, 0.4074, 0.163, 0.4272]}, {"w": "access", "b": [0.1693, 0.4074, 0.2338, 0.4272]}, {"w": "to", "b": [0.2401, 0.4074, 0.2597, 0.4272]}, {"w": "less", "b": [0.266, 0.4074, 0.3038, 0.4272]}, {"w": "information", "b": [0.3102, 0.4074, 0.4293, 0.4272]}, {"w": "than", "b": [0.4356, 0.4074, 0.479, 0.4272]}, {"w": "the", "b": [0.4853, 0.4074, 0.5161, 0.4272]}, {"w": "earlier", "b": [0.5225, 0.4074, 0.5869, 0.4272]}, {"w": "baseline", "b": [0.5932, 0.4074, 0.6759, 0.4272]}, {"w": "model.", "b": [0.6821, 0.4074, 0.7514, 0.4272]}, {"w": "The", "b": [0.7578, 0.4074, 0.797, 0.4272]}, {"w": "remainder", "b": [0.1294, 0.4279, 0.2317, 0.4477]}, {"w": "of", "b": [0.238, 0.4279, 0.259, 0.4477]}, {"w": "the", "b": [0.2653, 0.4279, 0.2961, 0.4477]}, {"w": "problem", "b": [0.3024, 0.4279, 0.3865, 0.4477]}, {"w": "is", "b": [0.3928, 0.4279, 0.4096, 0.4477]}, {"w": "that", "b": [0.416, 0.4279, 0.4538, 0.4477]}, {"w": "SimpleRNN", "b": [0.46, 0.429, 0.5962, 0.4492]}, {"w": "isn’t", "b": [0.6026, 0.4279, 0.647, 0.4477]}, {"w": "good", "b": [0.6533, 0.4279, 0.7037, 0.4477]}, {"w": "at", "b": [0.71, 0.4279, 0.7282, 0.4477]}, {"w": "processing", "b": [0.7346, 0.4279, 0.8424, 0.4477]}, {"w": "long", "b": [0.1294, 0.4493, 0.1743, 0.4691]}, {"w": "sequences,", "b": [0.1806, 0.4493, 0.2891, 0.4691]}, {"w": "such", "b": [0.2954, 0.4493, 0.3417, 0.4691]}, {"w": "as", "b": [0.348, 0.4493, 0.369, 0.4691]}, {"w": "text.", "b": [0.3753, 0.4493, 0.4195, 0.4691]}, {"w": "Other", "b": [0.4258, 0.4493, 0.4832, 0.4691]}, {"w": "types", "b": [0.4895, 0.4493, 0.5428, 0.4691]}, {"w": "of", "b": [0.5491, 0.4493, 0.5701, 0.4691]}, {"w": "recurrent", "b": [0.5764, 0.4493, 0.6674, 0.4691]}, {"w": "layers", "b": [0.6737, 0.4493, 0.734, 0.4691]}, {"w": "perform", "b": [0.7403, 0.4493, 0.8215, 0.4691]}, {"w": "much", "b": [0.1294, 0.4698, 0.1855, 0.4896]}, {"w": "better.", "b": [0.1918, 0.4698, 0.2541, 0.4896]}, {"w": "Let’s", "b": [0.2604, 0.4698, 0.3108, 0.4896]}, {"w": "look", "b": [0.3171, 0.4698, 0.362, 0.4896]}, {"w": "at", "b": [0.3683, 0.4698, 0.3865, 0.4896]}, {"w": "some", "b": [0.3928, 0.4698, 0.4461, 0.4896]}, {"w": "more-advanced", "b": [0.4524, 0.4698, 0.6079, 0.4896]}, {"w": "layers.", "b": [0.6142, 0.4698, 0.6807, 0.4896]}]}, {"id": "b_2", "type": "paragraph", "text": "6.2.2. Understanding the LSTM and GRU layers", "words": [{"w": "6.2.2.", "b": [0.1294, 0.5171, 0.1862, 0.5368]}, {"w": "Understanding", "b": [0.1925, 0.5171, 0.3537, 0.5368]}, {"w": "the", "b": [0.36, 0.5171, 0.3936, 0.5368]}, {"w": "LSTM", "b": [0.3999, 0.5171, 0.4714, 0.5368]}, {"w": "and", "b": [0.4777, 0.5171, 0.5184, 0.5368]}, {"w": "GRU", "b": [0.5247, 0.5171, 0.5807, 0.5368]}, {"w": "layers", "b": [0.587, 0.5171, 0.6515, 0.5368]}]}, {"id": "b_3", "type": "paragraph", "text": "SimpleRNN isn’t the only recurrent layer available in Keras. There are two others: LSTM and GRU. In practice, you’ll always use one of these, because SimpleRNN is generally too simplistic to be of real use. SimpleRNN has a major issue: although it should theoretically be able to retain at time t information about inputs seen many timesteps before, in practice, such long-term dependencies are impossible to learn. This is due to the vanishing gradient problem, an effect that is similar to what is observed with non-recurrent networks (feedforward networks) that are many layers deep: as you keep adding layers to a network, the network eventually becomes untrainable. The theoretical reasons for this effect were studied by Hochreiter, Schmidhuber, and Bengio in the early 1990s. [2] The LSTM and GRU layers are designed to solve this problem.", "words": [{"w": "SimpleRNN", "b": [0.1294, 0.5609, 0.2656, 0.5811]}, {"w": "isn’t", "b": [0.272, 0.5599, 0.3164, 0.5796]}, {"w": "the", "b": [0.3227, 0.5599, 0.3535, 0.5796]}, {"w": "only", "b": [0.3598, 0.5599, 0.4046, 0.5796]}, {"w": "recurrent", "b": [0.4109, 0.5599, 0.502, 0.5796]}, {"w": "layer", "b": [0.5083, 0.5599, 0.5587, 0.5796]}, {"w": "available", "b": [0.565, 0.5599, 0.6561, 0.5796]}, {"w": "in", "b": [0.6624, 0.5599, 0.682, 0.5796]}, {"w": "Keras.", "b": [0.6883, 0.5599, 0.7535, 0.5796]}, {"w": "There", "b": [0.7598, 0.5599, 0.8186, 0.5796]}, {"w": "are", "b": [0.8249, 0.5599, 0.8557, 0.5796]}, {"w": "two", "b": [0.1294, 0.5813, 0.1673, 0.601]}, {"w": "others:", "b": [0.1736, 0.5813, 0.2422, 0.601]}, {"w": "LSTM", "b": [0.2485, 0.5823, 0.309, 0.6025]}, {"w": "and", "b": [0.3154, 0.5813, 0.3518, 0.601]}, {"w": "GRU.", "b": [0.3581, 0.5813, 0.4098, 0.6025]}, {"w": "In", "b": [0.4161, 0.5813, 0.4371, 0.601]}, {"w": "practice,", "b": [0.4434, 0.5813, 0.5296, 0.601]}, {"w": "you’ll", "b": [0.5359, 0.5813, 0.5961, 0.601]}, {"w": "always", "b": [0.6024, 0.5813, 0.6725, 0.601]}, {"w": "use", "b": [0.6788, 0.5813, 0.7124, 0.601]}, {"w": "one", "b": [0.7187, 0.5813, 0.7552, 0.601]}, {"w": "of", "b": [0.7615, 0.5813, 0.7825, 0.601]}, {"w": "these,", "b": [0.7888, 0.5813, 0.8469, 0.601]}, {"w": "because", "b": [0.1294, 0.6026, 0.2093, 0.6224]}, {"w": "SimpleRNN", "b": [0.2155, 0.6037, 0.3518, 0.6239]}, {"w": "is", "b": [0.3581, 0.6026, 0.3749, 0.6224]}, {"w": "generally", "b": [0.3812, 0.6026, 0.4751, 0.6224]}, {"w": "too", "b": [0.4814, 0.6026, 0.5136, 0.6224]}, {"w": "simplistic", "b": [0.5199, 0.6026, 0.6181, 0.6224]}, {"w": "to", "b": [0.6244, 0.6026, 0.644, 0.6224]}, {"w": "be", "b": [0.6503, 0.6026, 0.6741, 0.6224]}, {"w": "of", "b": [0.6804, 0.6026, 0.7014, 0.6224]}, {"w": "real", "b": [0.7077, 0.6026, 0.7455, 0.6224]}, {"w": "use.", "b": [0.7519, 0.6026, 0.7918, 0.6224]}, {"w": "SimpleRNN", "b": [0.1294, 0.6251, 0.2656, 0.6453]}, {"w": "has", "b": [0.272, 0.624, 0.3056, 0.6438]}, {"w": "a", "b": [0.3119, 0.624, 0.3231, 0.6438]}, {"w": "major", "b": [0.3294, 0.624, 0.3882, 0.6438]}, {"w": "issue:", "b": [0.3946, 0.624, 0.452, 0.6438]}, {"w": "although", "b": [0.4583, 0.624, 0.5466, 0.6438]}, {"w": "it", "b": [0.5529, 0.624, 0.5669, 0.6438]}, {"w": "should", "b": [0.5733, 0.624, 0.6405, 0.6438]}, {"w": "theoretically", "b": [0.6468, 0.624, 0.7729, 0.6438]}, {"w": "be", "b": [0.7792, 0.624, 0.8031, 0.6438]}, {"w": "able", "b": [0.8094, 0.624, 0.8514, 0.6438]}, {"w": "to", "b": [0.1294, 0.6454, 0.149, 0.6652]}, {"w": "retain", "b": [0.1553, 0.6454, 0.2128, 0.6652]}, {"w": "at", "b": [0.2191, 0.6454, 0.2373, 0.6652]}, {"w": "time", "b": [0.2436, 0.6454, 0.2885, 0.6652]}, {"w": "t", "b": [0.2947, 0.6465, 0.3099, 0.6667]}, {"w": "information", "b": [0.3162, 0.6454, 0.4353, 0.6652]}, {"w": "about", "b": [0.4416, 0.6454, 0.4976, 0.6652]}, {"w": "inputs", "b": [0.5039, 0.6454, 0.5656, 0.6652]}, {"w": "seen", "b": [0.5719, 0.6454, 0.6168, 0.6652]}, {"w": "many", "b": [0.6231, 0.6454, 0.6791, 0.6652]}, {"w": "timesteps", "b": [0.6854, 0.6454, 0.7807, 0.6652]}, {"w": "before,", "b": [0.787, 0.6454, 0.8578, 0.6652]}, {"w": "in", "b": [0.1294, 0.6668, 0.149, 0.6866]}, {"w": "practice,", "b": [0.1553, 0.6668, 0.2415, 0.6866]}, {"w": "such", "b": [0.2478, 0.6668, 0.294, 0.6866]}, {"w": "long-term", "b": [0.3003, 0.6668, 0.3998, 0.6866]}, {"w": "dependencies", "b": [0.4061, 0.6668, 0.542, 0.6866]}, {"w": "are", "b": [0.5483, 0.6668, 0.5791, 0.6866]}, {"w": "impossible", "b": [0.5854, 0.6668, 0.6948, 0.6866]}, {"w": "to", "b": [0.7011, 0.6668, 0.7207, 0.6866]}, {"w": "learn.", "b": [0.727, 0.6668, 0.7837, 0.6866]}, {"w": "This", "b": [0.79, 0.6668, 0.8349, 0.6866]}, {"w": "is", "b": [0.8411, 0.6668, 0.8579, 0.6866]}, {"w": "due", "b": [0.1294, 0.6873, 0.1658, 0.7071]}, {"w": "to", "b": [0.1721, 0.6873, 0.1918, 0.7071]}, {"w": "the", "b": [0.1981, 0.6873, 0.2289, 0.7071]}, {"w": "vanishing", "b": [0.2352, 0.6873, 0.3333, 0.7071]}, {"w": "gradient", "b": [0.3396, 0.6873, 0.4251, 0.7071]}, {"w": "problem,", "b": [0.4314, 0.6873, 0.5208, 0.7071]}, {"w": "an", "b": [0.5271, 0.6873, 0.5509, 0.7071]}, {"w": "effect", "b": [0.5572, 0.6873, 0.6142, 0.7071]}, {"w": "that", "b": [0.6205, 0.6873, 0.6583, 0.7071]}, {"w": "is", "b": [0.6646, 0.6873, 0.6815, 0.7071]}, {"w": "similar", "b": [0.6878, 0.6873, 0.7578, 0.7071]}, {"w": "to", "b": [0.7641, 0.6873, 0.7838, 0.7071]}, {"w": "what", "b": [0.7901, 0.6873, 0.8391, 0.7071]}, {"w": "is", "b": [0.8454, 0.6873, 0.8623, 0.7071]}, {"w": "observed", "b": [0.1294, 0.7078, 0.2205, 0.7276]}, {"w": "with", "b": [0.2268, 0.7078, 0.2716, 0.7276]}, {"w": "non-recurrent", "b": [0.2779, 0.7078, 0.4152, 0.7276]}, {"w": "networks", "b": [0.4215, 0.7078, 0.514, 0.7276]}, {"w": "(feedforward", "b": [0.5203, 0.7078, 0.652, 0.7276]}, {"w": "networks)", "b": [0.6583, 0.7078, 0.7591, 0.7276]}, {"w": "that", "b": [0.7655, 0.7078, 0.8033, 0.7276]}, {"w": "are", "b": [0.8096, 0.7078, 0.8404, 0.7276]}, {"w": "many", "b": [0.1294, 0.7283, 0.1855, 0.7481]}, {"w": "layers", "b": [0.1918, 0.7283, 0.252, 0.7481]}, {"w": "deep:", "b": [0.2583, 0.7283, 0.313, 0.7481]}, {"w": "as", "b": [0.3192, 0.7283, 0.3402, 0.7481]}, {"w": "you", "b": [0.3465, 0.7283, 0.3844, 0.7481]}, {"w": "keep", "b": [0.3907, 0.7283, 0.4383, 0.7481]}, {"w": "adding", "b": [0.4446, 0.7283, 0.5133, 0.7481]}, {"w": "layers", "b": [0.5196, 0.7283, 0.5798, 0.7481]}, {"w": "to", "b": [0.5861, 0.7283, 0.6058, 0.7481]}, {"w": "a", "b": [0.6121, 0.7283, 0.6233, 0.7481]}, {"w": "network,", "b": [0.6296, 0.7283, 0.7185, 0.7481]}, {"w": "the", "b": [0.7248, 0.7283, 0.7557, 0.7481]}, {"w": "network", "b": [0.762, 0.7283, 0.8446, 0.7481]}, {"w": "eventually", "b": [0.1294, 0.7488, 0.2345, 0.7686]}, {"w": "becomes", "b": [0.2408, 0.7488, 0.3291, 0.7686]}, {"w": "untrainable.", "b": [0.3354, 0.7488, 0.4552, 0.7686]}, {"w": "The", "b": [0.4615, 0.7488, 0.5007, 0.7686]}, {"w": "theoretical", "b": [0.507, 0.7488, 0.6135, 0.7686]}, {"w": "reasons", "b": [0.6198, 0.7488, 0.6955, 0.7686]}, {"w": "for", "b": [0.7018, 0.7488, 0.7312, 0.7686]}, {"w": "this", "b": [0.7375, 0.7488, 0.7739, 0.7686]}, {"w": "effect", "b": [0.7802, 0.7488, 0.8371, 0.7686]}, {"w": "were", "b": [0.1294, 0.7693, 0.1784, 0.7891]}, {"w": "studied", "b": [0.1847, 0.7693, 0.2576, 0.7891]}, {"w": "by", "b": [0.2639, 0.7693, 0.2891, 0.7891]}, {"w": "Hochreiter,", "b": [0.2954, 0.7693, 0.4086, 0.7891]}, {"w": "Schmidhuber,", "b": [0.4149, 0.7693, 0.5547, 0.7891]}, {"w": "and", "b": [0.561, 0.7693, 0.5974, 0.7891]}, {"w": "Bengio", "b": [0.6037, 0.7693, 0.6766, 0.7891]}, {"w": "in", "b": [0.6829, 0.7693, 0.7026, 0.7891]}, {"w": "the", "b": [0.7089, 0.7693, 0.7397, 0.7891]}, {"w": "early", "b": [0.746, 0.7693, 0.7964, 0.7891]}, {"w": "1990s.", "b": [0.8027, 0.7693, 0.8693, 0.7891]}, {"w": "[2]", "b": [0.1294, 0.7893, 0.1515, 0.8041]}, {"w": "The", "b": [0.1578, 0.7916, 0.197, 0.8113]}, {"w": "LSTM", "b": [0.2033, 0.7926, 0.2638, 0.8128]}, {"w": "and", "b": [0.2701, 0.7916, 0.3066, 0.8113]}, {"w": "GRU", "b": [0.3129, 0.7926, 0.3583, 0.8128]}, {"w": "layers", "b": [0.3646, 0.7916, 0.4248, 0.8113]}, {"w": "are", "b": [0.4311, 0.7916, 0.4619, 0.8113]}, {"w": "designed", "b": [0.4682, 0.7916, 0.5579, 0.8113]}, {"w": "to", "b": [0.5642, 0.7916, 0.5838, 0.8113]}, {"w": "solve", "b": [0.5901, 0.7916, 0.6434, 0.8113]}, {"w": "this", "b": [0.6497, 0.7916, 0.6861, 0.8113]}, {"w": "problem.", "b": [0.6924, 0.7916, 0.7828, 0.8113]}]}, {"id": "b_5", "type": "paragraph", "text": "See, for example, Yoshua Bengio, Patrice Simard, and Paolo Frasconi, “Learning Long- Term Dependencies with Gradient Descent Is Difficult,” IEEE Transactions on Neural Networks 5, no. 2 (1994).", "words": [{"w": "See,", "b": [0.1483, 0.858, 0.1804, 0.8728]}, {"w": "for", "b": [0.1851, 0.858, 0.2072, 0.8728]}, {"w": "example,", "b": [0.2119, 0.858, 0.2807, 0.8728]}, {"w": "Yoshua", "b": [0.2855, 0.858, 0.3413, 0.8728]}, {"w": "Bengio,", "b": [0.3461, 0.858, 0.4055, 0.8728]}, {"w": "Patrice", "b": [0.4102, 0.858, 0.4627, 0.8728]}, {"w": "Simard,", "b": [0.4675, 0.858, 0.5269, 0.8728]}, {"w": "and", "b": [0.5316, 0.858, 0.5589, 0.8728]}, {"w": "Paolo", "b": [0.5636, 0.858, 0.6067, 0.8728]}, {"w": "Frasconi,", "b": [0.6115, 0.858, 0.6813, 0.8728]}, {"w": "“Learning", "b": [0.6861, 0.858, 0.7628, 0.8728]}, {"w": "Long-", "b": [0.7675, 0.858, 0.8137, 0.8728]}, {"w": "Term", "b": [0.1483, 0.8731, 0.188, 0.8879]}, {"w": "Dependencies", "b": [0.1927, 0.8731, 0.2988, 0.8879]}, {"w": "with", "b": [0.3036, 0.8731, 0.3372, 0.8879]}, {"w": "Gradient", "b": [0.3419, 0.8731, 0.4081, 0.8879]}, {"w": "Descent", "b": [0.4129, 0.8731, 0.4738, 0.8879]}, {"w": "Is", "b": [0.4785, 0.8731, 0.4922, 0.8879]}, {"w": "Difficult,”", "b": [0.4969, 0.8731, 0.5748, 0.8879]}, {"w": "IEEE", "b": [0.5795, 0.8731, 0.6205, 0.8879]}, {"w": "Transactions", "b": [0.6252, 0.8731, 0.723, 0.8879]}, {"w": "on", "b": [0.7277, 0.8731, 0.7467, 0.8879]}, {"w": "Neural", "b": [0.7514, 0.8731, 0.8039, 0.8879]}, {"w": "Networks", "b": [0.1483, 0.8883, 0.2198, 0.9031]}, {"w": "5,", "b": [0.2245, 0.8883, 0.2387, 0.9031]}, {"w": "no.", "b": [0.2434, 0.8883, 0.2671, 0.9031]}, {"w": "2", "b": [0.2718, 0.8883, 0.2813, 0.9031]}, {"w": "(1994).", "b": [0.286, 0.8883, 0.3412, 0.9031]}]}]}, {"page": 268, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Let’s consider the LSTM layer. The underlying Long Short-Term Memory (LSTM) algorithm was developed by Hochreiter and Schmidhuber in 1997;[3] it was the culmination of their research on the vanishing gradient problem.", "words": [{"w": "Let’s", "b": [0.1294, 0.0857, 0.1798, 0.1054]}, {"w": "consider", "b": [0.1862, 0.0857, 0.2716, 0.1054]}, {"w": "the", "b": [0.2779, 0.0857, 0.3088, 0.1054]}, {"w": "LSTM", "b": [0.315, 0.0867, 0.3756, 0.1069]}, {"w": "layer.", "b": [0.3819, 0.0857, 0.4372, 0.1054]}, {"w": "The", "b": [0.4435, 0.0857, 0.4827, 0.1054]}, {"w": "underlying", "b": [0.4891, 0.0857, 0.5984, 0.1054]}, {"w": "Long", "b": [0.6047, 0.0857, 0.6579, 0.1054]}, {"w": "Short-Term", "b": [0.6642, 0.0857, 0.7801, 0.1054]}, {"w": "Memory", "b": [0.1294, 0.1071, 0.2163, 0.1268]}, {"w": "(LSTM)", "b": [0.2226, 0.1071, 0.3067, 0.1268]}, {"w": "algorithm", "b": [0.313, 0.1071, 0.4111, 0.1268]}, {"w": "was", "b": [0.4174, 0.1071, 0.4566, 0.1268]}, {"w": "developed", "b": [0.4629, 0.1071, 0.5666, 0.1268]}, {"w": "by", "b": [0.5729, 0.1071, 0.5981, 0.1268]}, {"w": "Hochreiter", "b": [0.6044, 0.1071, 0.7123, 0.1268]}, {"w": "and", "b": [0.7186, 0.1071, 0.755, 0.1268]}, {"w": "Schmidhuber", "b": [0.1294, 0.1294, 0.2639, 0.1491]}, {"w": "in", "b": [0.2702, 0.1294, 0.2899, 0.1491]}, {"w": "1997;[3]", "b": [0.2962, 0.1271, 0.3757, 0.1491]}, {"w": "it", "b": [0.3819, 0.1294, 0.396, 0.1491]}, {"w": "was", "b": [0.4023, 0.1294, 0.4415, 0.1491]}, {"w": "the", "b": [0.4478, 0.1294, 0.4786, 0.1491]}, {"w": "culmination", "b": [0.4849, 0.1294, 0.6055, 0.1491]}, {"w": "of", "b": [0.6118, 0.1294, 0.6328, 0.1491]}, {"w": "their", "b": [0.6391, 0.1294, 0.6853, 0.1491]}, {"w": "research", "b": [0.6916, 0.1294, 0.7757, 0.1491]}, {"w": "on", "b": [0.782, 0.1294, 0.8072, 0.1491]}, {"w": "the", "b": [0.8135, 0.1294, 0.8443, 0.1491]}, {"w": "vanishing", "b": [0.1294, 0.1499, 0.2275, 0.1696]}, {"w": "gradient", "b": [0.2338, 0.1499, 0.3165, 0.1696]}, {"w": "problem.", "b": [0.3228, 0.1499, 0.4132, 0.1696]}]}, {"id": "b_2", "type": "paragraph", "text": "Sepp Hochreiter and Jürgen Schmidhuber, “Long Short-Term Memory,” Neural Computation 9, no. 8 (1997).", "words": [{"w": "Sepp", "b": [0.1483, 0.2153, 0.1862, 0.2301]}, {"w": "Hochreiter", "b": [0.1909, 0.2153, 0.2718, 0.2301]}, {"w": "and", "b": [0.2765, 0.2153, 0.3038, 0.2301]}, {"w": "Jürgen", "b": [0.3086, 0.2153, 0.3587, 0.2301]}, {"w": "Schmidhuber,", "b": [0.3634, 0.2153, 0.4683, 0.2301]}, {"w": "“Long", "b": [0.473, 0.2153, 0.5213, 0.2301]}, {"w": "Short-Term", "b": [0.526, 0.2153, 0.613, 0.2301]}, {"w": "Memory,”", "b": [0.6177, 0.2153, 0.6948, 0.2301]}, {"w": "Neural", "b": [0.6995, 0.2153, 0.7521, 0.2301]}, {"w": "Computation", "b": [0.1483, 0.2305, 0.2471, 0.2453]}, {"w": "9,", "b": [0.2519, 0.2305, 0.266, 0.2453]}, {"w": "no.", "b": [0.2708, 0.2305, 0.2944, 0.2453]}, {"w": "8", "b": [0.2992, 0.2305, 0.3086, 0.2453]}, {"w": "(1997).", "b": [0.3133, 0.2305, 0.3685, 0.2453]}]}, {"id": "b_3", "type": "paragraph", "text": "This layer is a variant of the SimpleRNN layer you already know about; it adds a way to carry information across many timesteps. Imagine a conveyor belt running parallel to the sequence you’re processing. Information from the sequence can jump onto the conveyor belt at any point, be transported to a later timestep, and jump off, intact, when you need it. This is essentially what LSTM does: it saves information for later, thus preventing older signals from gradually vanishing during processing.", "words": [{"w": "This", "b": [0.1294, 0.2684, 0.1743, 0.2881]}, {"w": "layer", "b": [0.1806, 0.2684, 0.231, 0.2881]}, {"w": "is", "b": [0.2373, 0.2684, 0.2541, 0.2881]}, {"w": "a", "b": [0.2604, 0.2684, 0.2716, 0.2881]}, {"w": "variant", "b": [0.2779, 0.2684, 0.348, 0.2881]}, {"w": "of", "b": [0.3543, 0.2684, 0.3753, 0.2881]}, {"w": "the", "b": [0.3816, 0.2684, 0.4124, 0.2881]}, {"w": "SimpleRNN", "b": [0.4187, 0.2694, 0.5549, 0.2896]}, {"w": "layer", "b": [0.5612, 0.2684, 0.6117, 0.2881]}, {"w": "you", "b": [0.618, 0.2684, 0.6558, 0.2881]}, {"w": "already", "b": [0.6621, 0.2684, 0.7364, 0.2881]}, {"w": "know", "b": [0.7427, 0.2684, 0.7987, 0.2881]}, {"w": "about;", "b": [0.805, 0.2684, 0.8681, 0.2881]}, {"w": "it", "b": [0.1294, 0.2898, 0.1434, 0.3095]}, {"w": "adds", "b": [0.1497, 0.2898, 0.196, 0.3095]}, {"w": "a", "b": [0.2023, 0.2898, 0.2135, 0.3095]}, {"w": "way", "b": [0.2198, 0.2898, 0.2618, 0.3095]}, {"w": "to", "b": [0.2681, 0.2898, 0.2878, 0.3095]}, {"w": "carry", "b": [0.2941, 0.2898, 0.3459, 0.3095]}, {"w": "information", "b": [0.3522, 0.2898, 0.4713, 0.3095]}, {"w": "across", "b": [0.4776, 0.2898, 0.5406, 0.3095]}, {"w": "many", "b": [0.5469, 0.2898, 0.603, 0.3095]}, {"w": "timesteps.", "b": [0.6093, 0.2898, 0.7109, 0.3095]}, {"w": "Imagine", "b": [0.7172, 0.2898, 0.7999, 0.3095]}, {"w": "a", "b": [0.8062, 0.2898, 0.8174, 0.3095]}, {"w": "conveyor", "b": [0.1294, 0.3103, 0.2233, 0.33]}, {"w": "belt", "b": [0.2296, 0.3103, 0.2674, 0.33]}, {"w": "running", "b": [0.2737, 0.3103, 0.3522, 0.33]}, {"w": "parallel", "b": [0.3585, 0.3103, 0.4342, 0.33]}, {"w": "to", "b": [0.4404, 0.3103, 0.46, 0.33]}, {"w": "the", "b": [0.4664, 0.3103, 0.4972, 0.33]}, {"w": "sequence", "b": [0.5035, 0.3103, 0.5959, 0.33]}, {"w": "you’re", "b": [0.6022, 0.3103, 0.6681, 0.33]}, {"w": "processing.", "b": [0.6744, 0.3103, 0.7886, 0.33]}, {"w": "Information", "b": [0.1294, 0.3308, 0.2499, 0.3505]}, {"w": "from", "b": [0.2562, 0.3308, 0.3053, 0.3505]}, {"w": "the", "b": [0.3116, 0.3308, 0.3424, 0.3505]}, {"w": "sequence", "b": [0.3487, 0.3308, 0.4412, 0.3505]}, {"w": "can", "b": [0.4475, 0.3308, 0.4825, 0.3505]}, {"w": "jump", "b": [0.4888, 0.3308, 0.5406, 0.3505]}, {"w": "onto", "b": [0.5469, 0.3308, 0.5918, 0.3505]}, {"w": "the", "b": [0.5981, 0.3308, 0.6289, 0.3505]}, {"w": "conveyor", "b": [0.6352, 0.3308, 0.7291, 0.3505]}, {"w": "belt", "b": [0.7354, 0.3308, 0.7732, 0.3505]}, {"w": "at", "b": [0.7796, 0.3308, 0.7978, 0.3505]}, {"w": "any", "b": [0.8041, 0.3308, 0.8405, 0.3505]}, {"w": "point,", "b": [0.1294, 0.3513, 0.1876, 0.371]}, {"w": "be", "b": [0.1939, 0.3513, 0.2177, 0.371]}, {"w": "transported", "b": [0.224, 0.3513, 0.3375, 0.371]}, {"w": "to", "b": [0.3438, 0.3513, 0.3634, 0.371]}, {"w": "a", "b": [0.3697, 0.3513, 0.3809, 0.371]}, {"w": "later", "b": [0.3872, 0.3513, 0.432, 0.371]}, {"w": "timestep,", "b": [0.4383, 0.3513, 0.5301, 0.371]}, {"w": "and", "b": [0.5364, 0.3513, 0.5729, 0.371]}, {"w": "jump", "b": [0.5792, 0.3513, 0.631, 0.371]}, {"w": "off,", "b": [0.6373, 0.3513, 0.6726, 0.371]}, {"w": "intact,", "b": [0.6789, 0.3513, 0.7412, 0.371]}, {"w": "when", "b": [0.7475, 0.3513, 0.8022, 0.371]}, {"w": "you", "b": [0.8085, 0.3513, 0.8463, 0.371]}, {"w": "need", "b": [0.1294, 0.3718, 0.177, 0.3915]}, {"w": "it.", "b": [0.1833, 0.3718, 0.2037, 0.3915]}, {"w": "This", "b": [0.21, 0.3718, 0.2548, 0.3915]}, {"w": "is", "b": [0.2611, 0.3718, 0.278, 0.3915]}, {"w": "essentially", "b": [0.2843, 0.3718, 0.3908, 0.3915]}, {"w": "what", "b": [0.3971, 0.3718, 0.4461, 0.3915]}, {"w": "LSTM", "b": [0.4524, 0.3718, 0.5197, 0.3915]}, {"w": "does:", "b": [0.526, 0.3718, 0.5793, 0.3915]}, {"w": "it", "b": [0.5856, 0.3718, 0.5996, 0.3915]}, {"w": "saves", "b": [0.6059, 0.3718, 0.6605, 0.3915]}, {"w": "information", "b": [0.6668, 0.3718, 0.786, 0.3915]}, {"w": "for", "b": [0.7923, 0.3718, 0.8217, 0.3915]}, {"w": "later,", "b": [0.1294, 0.3923, 0.1795, 0.412]}, {"w": "thus", "b": [0.1858, 0.3923, 0.2279, 0.412]}, {"w": "preventing", "b": [0.2342, 0.3923, 0.3421, 0.412]}, {"w": "older", "b": [0.3484, 0.3923, 0.4002, 0.412]}, {"w": "signals", "b": [0.4065, 0.3923, 0.4766, 0.412]}, {"w": "from", "b": [0.4829, 0.3923, 0.5319, 0.412]}, {"w": "gradually", "b": [0.5383, 0.3923, 0.6335, 0.412]}, {"w": "vanishing", "b": [0.6398, 0.3923, 0.7379, 0.412]}, {"w": "during", "b": [0.7442, 0.3923, 0.8101, 0.412]}, {"w": "processing.", "b": [0.1294, 0.4128, 0.2436, 0.4325]}]}, {"id": "b_4", "type": "paragraph", "text": "To understand this in detail, let’s start from the SimpleRNN cell (see figure 6.13). Because you’ll have a lot of weight matrices, index the W and U matrices in the cell with the letter o (Wo and Uo) for output.", "words": [{"w": "To", "b": [0.1294, 0.4556, 0.1557, 0.4753]}, {"w": "understand", "b": [0.162, 0.4556, 0.2727, 0.4753]}, {"w": "this", "b": [0.279, 0.4556, 0.3154, 0.4753]}, {"w": "in", "b": [0.3217, 0.4556, 0.3414, 0.4753]}, {"w": "detail,", "b": [0.3477, 0.4556, 0.41, 0.4753]}, {"w": "let’s", "b": [0.4163, 0.4556, 0.4583, 0.4753]}, {"w": "start", "b": [0.4646, 0.4556, 0.5081, 0.4753]}, {"w": "from", "b": [0.5144, 0.4556, 0.5634, 0.4753]}, {"w": "the", "b": [0.5697, 0.4556, 0.6006, 0.4753]}, {"w": "SimpleRNN", "b": [0.6068, 0.4566, 0.743, 0.4768]}, {"w": "cell", "b": [0.7494, 0.4556, 0.7858, 0.4753]}, {"w": "(see", "b": [0.7921, 0.4556, 0.8327, 0.4753]}, {"w": "figure", "b": [0.1294, 0.477, 0.1897, 0.4967]}, {"w": "6.13).", "b": [0.196, 0.477, 0.2548, 0.4967]}, {"w": "Because", "b": [0.2611, 0.477, 0.3452, 0.4967]}, {"w": "you’ll", "b": [0.3515, 0.477, 0.4117, 0.4967]}, {"w": "have", "b": [0.418, 0.477, 0.4657, 0.4967]}, {"w": "a", "b": [0.472, 0.477, 0.4832, 0.4967]}, {"w": "lot", "b": [0.4895, 0.477, 0.5161, 0.4967]}, {"w": "of", "b": [0.5224, 0.477, 0.5434, 0.4967]}, {"w": "weight", "b": [0.5497, 0.477, 0.6184, 0.4967]}, {"w": "matrices,", "b": [0.6247, 0.477, 0.7165, 0.4967]}, {"w": "index", "b": [0.7228, 0.477, 0.7788, 0.4967]}, {"w": "the", "b": [0.7851, 0.477, 0.816, 0.4967]}, {"w": "W", "b": [0.8222, 0.478, 0.8373, 0.4982]}, {"w": "and", "b": [0.1294, 0.4984, 0.1658, 0.5181]}, {"w": "U", "b": [0.1721, 0.4994, 0.1873, 0.5196]}, {"w": "matrices", "b": [0.1936, 0.4984, 0.279, 0.5181]}, {"w": "in", "b": [0.2854, 0.4984, 0.305, 0.5181]}, {"w": "the", "b": [0.3113, 0.4984, 0.3421, 0.5181]}, {"w": "cell", "b": [0.3484, 0.4984, 0.3848, 0.5181]}, {"w": "with", "b": [0.3911, 0.4984, 0.436, 0.5181]}, {"w": "the", "b": [0.4423, 0.4984, 0.4731, 0.5181]}, {"w": "letter", "b": [0.4794, 0.4984, 0.5313, 0.5181]}, {"w": "o", "b": [0.5375, 0.4994, 0.5526, 0.5196]}, {"w": "(Wo", "b": [0.5589, 0.4984, 0.5976, 0.5196]}, {"w": "and", "b": [0.6039, 0.4984, 0.6403, 0.5181]}, {"w": "Uo)", "b": [0.6466, 0.4984, 0.6853, 0.5196]}, {"w": "for", "b": [0.6916, 0.4984, 0.721, 0.5181]}, {"w": "output.", "b": [0.7273, 0.4984, 0.7981, 0.5181]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 6.13. The starting point of an lstm layer: a simplernn", "words": [{"w": "Figure", "b": [0.1294, 0.5371, 0.1827, 0.5519]}, {"w": "6.13.", "b": [0.1874, 0.5371, 0.2252, 0.5519]}, {"w": "The", "b": [0.2299, 0.5371, 0.2615, 0.5519]}, {"w": "starting", "b": [0.2662, 0.5371, 0.3293, 0.5519]}, {"w": "point", "b": [0.334, 0.5371, 0.3761, 0.5519]}, {"w": "of", "b": [0.3808, 0.5371, 0.3965, 0.5519]}, {"w": "an", "b": [0.4013, 0.5371, 0.4213, 0.5519]}, {"w": "lstm", "b": [0.426, 0.5379, 0.4714, 0.553]}, {"w": "layer:", "b": [0.4761, 0.5371, 0.5234, 0.5519]}, {"w": "a", "b": [0.5281, 0.5371, 0.5376, 0.5519]}, {"w": "simplernn", "b": [0.5423, 0.5379, 0.6445, 0.553]}]}, {"id": "b_6", "type": "paragraph", "text": "Let’s add to this picture an additional data flow that carries information across timesteps. Call its values at different timesteps Ct, where C stands for carry. This information will have the following impact on the cell: it will be combined with the input connection and the recurrent connection (via a dense transformation: a dot product with a weight matrix followed by a bias add and the application of an activation", "words": [{"w": "Let’s", "b": [0.1294, 0.7871, 0.1798, 0.8069]}, {"w": "add", "b": [0.1862, 0.7871, 0.2226, 0.8069]}, {"w": "to", "b": [0.2289, 0.7871, 0.2485, 0.8069]}, {"w": "this", "b": [0.2548, 0.7871, 0.2913, 0.8069]}, {"w": "picture", "b": [0.2976, 0.7871, 0.3676, 0.8069]}, {"w": "an", "b": [0.3739, 0.7871, 0.3977, 0.8069]}, {"w": "additional", "b": [0.4041, 0.7871, 0.505, 0.8069]}, {"w": "data", "b": [0.5113, 0.7871, 0.5533, 0.8069]}, {"w": "flow", "b": [0.5596, 0.7871, 0.6058, 0.8069]}, {"w": "that", "b": [0.6121, 0.7871, 0.65, 0.8069]}, {"w": "carries", "b": [0.6563, 0.7871, 0.7235, 0.8069]}, {"w": "information", "b": [0.7298, 0.7871, 0.8489, 0.8069]}, {"w": "across", "b": [0.1294, 0.8076, 0.1925, 0.8274]}, {"w": "timesteps.", "b": [0.1988, 0.8076, 0.3004, 0.8274]}, {"w": "Call", "b": [0.3067, 0.8076, 0.3487, 0.8274]}, {"w": "its", "b": [0.355, 0.8076, 0.3789, 0.8274]}, {"w": "values", "b": [0.3852, 0.8076, 0.4496, 0.8274]}, {"w": "at", "b": [0.4559, 0.8076, 0.4741, 0.8274]}, {"w": "different", "b": [0.4805, 0.8076, 0.5668, 0.8274]}, {"w": "timesteps", "b": [0.5731, 0.8076, 0.6684, 0.8274]}, {"w": "Ct,", "b": [0.6747, 0.8076, 0.7113, 0.8289]}, {"w": "where", "b": [0.7176, 0.8076, 0.7792, 0.8274]}, {"w": "C", "b": [0.7855, 0.8076, 0.8023, 0.8274]}, {"w": "stands", "b": [0.1294, 0.829, 0.1925, 0.8488]}, {"w": "for", "b": [0.1988, 0.829, 0.2282, 0.8488]}, {"w": "carry.", "b": [0.2345, 0.829, 0.2954, 0.8488]}, {"w": "This", "b": [0.3017, 0.829, 0.3466, 0.8488]}, {"w": "information", "b": [0.3529, 0.829, 0.472, 0.8488]}, {"w": "will", "b": [0.4783, 0.829, 0.5176, 0.8488]}, {"w": "have", "b": [0.5239, 0.829, 0.5715, 0.8488]}, {"w": "the", "b": [0.5778, 0.829, 0.6086, 0.8488]}, {"w": "following", "b": [0.6149, 0.829, 0.713, 0.8488]}, {"w": "impact", "b": [0.7193, 0.829, 0.788, 0.8488]}, {"w": "on", "b": [0.7943, 0.829, 0.8195, 0.8488]}, {"w": "the", "b": [0.8259, 0.829, 0.8567, 0.8488]}, {"w": "cell:", "b": [0.1294, 0.8495, 0.1729, 0.8693]}, {"w": "it", "b": [0.1792, 0.8495, 0.1932, 0.8693]}, {"w": "will", "b": [0.1995, 0.8495, 0.2387, 0.8693]}, {"w": "be", "b": [0.245, 0.8495, 0.2689, 0.8693]}, {"w": "combined", "b": [0.2752, 0.8495, 0.3747, 0.8693]}, {"w": "with", "b": [0.381, 0.8495, 0.4258, 0.8693]}, {"w": "the", "b": [0.4321, 0.8495, 0.4629, 0.8693]}, {"w": "input", "b": [0.4693, 0.8495, 0.5211, 0.8693]}, {"w": "connection", "b": [0.5274, 0.8495, 0.6381, 0.8693]}, {"w": "and", "b": [0.6444, 0.8495, 0.6808, 0.8693]}, {"w": "the", "b": [0.6872, 0.8495, 0.718, 0.8693]}, {"w": "recurrent", "b": [0.7243, 0.8495, 0.8153, 0.8693]}, {"w": "connection", "b": [0.1294, 0.87, 0.2401, 0.8898]}, {"w": "(via", "b": [0.2464, 0.87, 0.2856, 0.8898]}, {"w": "a", "b": [0.2919, 0.87, 0.3031, 0.8898]}, {"w": "dense", "b": [0.3094, 0.87, 0.3669, 0.8898]}, {"w": "transformation:", "b": [0.3732, 0.87, 0.5287, 0.8898]}, {"w": "a", "b": [0.535, 0.87, 0.5462, 0.8898]}, {"w": "dot", "b": [0.5525, 0.87, 0.5848, 0.8898]}, {"w": "product", "b": [0.5911, 0.87, 0.6682, 0.8898]}, {"w": "with", "b": [0.6745, 0.87, 0.7193, 0.8898]}, {"w": "a", "b": [0.7256, 0.87, 0.7368, 0.8898]}, {"w": "weight", "b": [0.7431, 0.87, 0.8118, 0.8898]}, {"w": "matrix", "b": [0.1294, 0.8905, 0.1953, 0.9103]}, {"w": "followed", "b": [0.2016, 0.8905, 0.2913, 0.9103]}, {"w": "by", "b": [0.2976, 0.8905, 0.3228, 0.9103]}, {"w": "a", "b": [0.3291, 0.8905, 0.3403, 0.9103]}, {"w": "bias", "b": [0.3466, 0.8905, 0.3872, 0.9103]}, {"w": "add", "b": [0.3936, 0.8905, 0.43, 0.9103]}, {"w": "and", "b": [0.4363, 0.8905, 0.4727, 0.9103]}, {"w": "the", "b": [0.479, 0.8905, 0.5098, 0.9103]}, {"w": "application", "b": [0.5161, 0.8905, 0.6283, 0.9103]}, {"w": "of", "b": [0.6346, 0.8905, 0.6556, 0.9103]}, {"w": "an", "b": [0.6619, 0.8905, 0.6857, 0.9103]}, {"w": "activation", "b": [0.6919, 0.8905, 0.7914, 0.9103]}]}]}, {"page": 269, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "function), and it will affect the state being sent to the next timestep (via an activation function an a multiplication operation). Conceptually, the carry dataflow is a way to modulate the next output and the next state (see figure 6.14). Simple so far.", "words": [{"w": "function),", "b": [0.1294, 0.0857, 0.2282, 0.1054]}, {"w": "and", "b": [0.2345, 0.0857, 0.2709, 0.1054]}, {"w": "it", "b": [0.2772, 0.0857, 0.2913, 0.1054]}, {"w": "will", "b": [0.2976, 0.0857, 0.3368, 0.1054]}, {"w": "affect", "b": [0.3431, 0.0857, 0.4, 0.1054]}, {"w": "the", "b": [0.4064, 0.0857, 0.4372, 0.1054]}, {"w": "state", "b": [0.4435, 0.0857, 0.4897, 0.1054]}, {"w": "being", "b": [0.496, 0.0857, 0.5521, 0.1054]}, {"w": "sent", "b": [0.5584, 0.0857, 0.599, 0.1054]}, {"w": "to", "b": [0.6053, 0.0857, 0.625, 0.1054]}, {"w": "the", "b": [0.6313, 0.0857, 0.6621, 0.1054]}, {"w": "next", "b": [0.6684, 0.0857, 0.7118, 0.1054]}, {"w": "timestep", "b": [0.7181, 0.0857, 0.8036, 0.1054]}, {"w": "(via", "b": [0.8099, 0.0857, 0.8492, 0.1054]}, {"w": "an", "b": [0.1294, 0.1062, 0.1532, 0.1259]}, {"w": "activation", "b": [0.1595, 0.1062, 0.259, 0.1259]}, {"w": "function", "b": [0.2653, 0.1062, 0.3494, 0.1259]}, {"w": "an", "b": [0.3557, 0.1062, 0.3795, 0.1259]}, {"w": "a", "b": [0.3858, 0.1062, 0.397, 0.1259]}, {"w": "multiplication", "b": [0.4033, 0.1062, 0.5449, 0.1259]}, {"w": "operation).", "b": [0.5511, 0.1062, 0.6611, 0.1259]}, {"w": "Conceptually,", "b": [0.6674, 0.1062, 0.8066, 0.1259]}, {"w": "the", "b": [0.8129, 0.1062, 0.8437, 0.1259]}, {"w": "carry", "b": [0.1294, 0.1267, 0.1812, 0.1464]}, {"w": "dataflow", "b": [0.1875, 0.1267, 0.2758, 0.1464]}, {"w": "is", "b": [0.2821, 0.1267, 0.2989, 0.1464]}, {"w": "a", "b": [0.3052, 0.1267, 0.3164, 0.1464]}, {"w": "way", "b": [0.3227, 0.1267, 0.3648, 0.1464]}, {"w": "to", "b": [0.3711, 0.1267, 0.3907, 0.1464]}, {"w": "modulate", "b": [0.397, 0.1267, 0.4909, 0.1464]}, {"w": "the", "b": [0.4972, 0.1267, 0.528, 0.1464]}, {"w": "next", "b": [0.5343, 0.1267, 0.5778, 0.1464]}, {"w": "output", "b": [0.5841, 0.1267, 0.6486, 0.1464]}, {"w": "and", "b": [0.6549, 0.1267, 0.6913, 0.1464]}, {"w": "the", "b": [0.6976, 0.1267, 0.7284, 0.1464]}, {"w": "next", "b": [0.7347, 0.1267, 0.7782, 0.1464]}, {"w": "state", "b": [0.7845, 0.1267, 0.8307, 0.1464]}, {"w": "(see", "b": [0.1294, 0.1472, 0.17, 0.1669]}, {"w": "figure", "b": [0.1763, 0.1472, 0.2366, 0.1669]}, {"w": "6.14).", "b": [0.2429, 0.1472, 0.3017, 0.1669]}, {"w": "Simple", "b": [0.308, 0.1472, 0.3795, 0.1669]}, {"w": "so", "b": [0.3858, 0.1472, 0.4082, 0.1669]}, {"w": "far.", "b": [0.4145, 0.1472, 0.4474, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.14. Going from a simplernn to an lstm: adding a carry track", "words": [{"w": "Figure", "b": [0.1294, 0.185, 0.1827, 0.1998]}, {"w": "6.14.", "b": [0.1874, 0.185, 0.2252, 0.1998]}, {"w": "Going", "b": [0.2299, 0.185, 0.2794, 0.1998]}, {"w": "from", "b": [0.2841, 0.185, 0.3237, 0.1998]}, {"w": "a", "b": [0.3284, 0.185, 0.3378, 0.1998]}, {"w": "simplernn", "b": [0.3426, 0.1858, 0.4447, 0.2009]}, {"w": "to", "b": [0.4495, 0.185, 0.4652, 0.1998]}, {"w": "an", "b": [0.47, 0.185, 0.4899, 0.1998]}, {"w": "lstm:", "b": [0.4947, 0.185, 0.5464, 0.2009]}, {"w": "adding", "b": [0.5511, 0.185, 0.6068, 0.1998]}, {"w": "a", "b": [0.6116, 0.185, 0.621, 0.1998]}, {"w": "carry", "b": [0.6257, 0.185, 0.6699, 0.1998]}, {"w": "track", "b": [0.6746, 0.185, 0.7177, 0.1998]}]}, {"id": "b_2", "type": "paragraph", "text": "Now the subtlety: the way the next value of the carry dataflow is computed. It involves three distinct transformations. All three have the form of a SimpleRNN cell:", "words": [{"w": "Now", "b": [0.1294, 0.4565, 0.1785, 0.4762]}, {"w": "the", "b": [0.1848, 0.4565, 0.2156, 0.4762]}, {"w": "subtlety:", "b": [0.2219, 0.4565, 0.3088, 0.4762]}, {"w": "the", "b": [0.3151, 0.4565, 0.3459, 0.4762]}, {"w": "way", "b": [0.3522, 0.4565, 0.3943, 0.4762]}, {"w": "the", "b": [0.4006, 0.4565, 0.4314, 0.4762]}, {"w": "next", "b": [0.4377, 0.4565, 0.4811, 0.4762]}, {"w": "value", "b": [0.4874, 0.4565, 0.5421, 0.4762]}, {"w": "of", "b": [0.5484, 0.4565, 0.5694, 0.4762]}, {"w": "the", "b": [0.5757, 0.4565, 0.6065, 0.4762]}, {"w": "carry", "b": [0.6128, 0.4565, 0.6647, 0.4762]}, {"w": "dataflow", "b": [0.671, 0.4565, 0.7592, 0.4762]}, {"w": "is", "b": [0.7655, 0.4565, 0.7824, 0.4762]}, {"w": "computed.", "b": [0.1294, 0.477, 0.2352, 0.4967]}, {"w": "It", "b": [0.2415, 0.477, 0.2569, 0.4967]}, {"w": "involves", "b": [0.2632, 0.477, 0.3487, 0.4967]}, {"w": "three", "b": [0.355, 0.477, 0.4055, 0.4967]}, {"w": "distinct", "b": [0.4118, 0.477, 0.4861, 0.4967]}, {"w": "transformations.", "b": [0.4924, 0.477, 0.657, 0.4967]}, {"w": "All", "b": [0.6633, 0.477, 0.6956, 0.4967]}, {"w": "three", "b": [0.7018, 0.477, 0.7522, 0.4967]}, {"w": "have", "b": [0.7585, 0.477, 0.8061, 0.4967]}, {"w": "the", "b": [0.8124, 0.477, 0.8433, 0.4967]}, {"w": "form", "b": [0.1294, 0.4975, 0.1785, 0.5172]}, {"w": "of", "b": [0.1848, 0.4975, 0.2058, 0.5172]}, {"w": "a", "b": [0.2121, 0.4975, 0.2233, 0.5172]}, {"w": "SimpleRNN", "b": [0.2296, 0.4985, 0.3658, 0.5187]}, {"w": "cell:", "b": [0.3721, 0.4975, 0.4156, 0.5172]}]}, {"id": "b_3", "type": "equation", "text": "y = activation(dot(state_t, U) + dot(input_t, W) + b)", "words": [{"w": "y", "b": [0.1357, 0.5361, 0.1471, 0.5512]}, {"w": "=", "b": [0.1584, 0.5361, 0.1698, 0.5512]}, {"w": "activation(dot(state_t,", "b": [0.1811, 0.5361, 0.4422, 0.5512]}, {"w": "U)", "b": [0.4536, 0.5361, 0.4763, 0.5512]}, {"w": "+", "b": [0.4876, 0.5361, 0.499, 0.5512]}, {"w": "dot(input_t,", "b": [0.5103, 0.5361, 0.6465, 0.5512]}, {"w": "W)", "b": [0.6579, 0.5361, 0.6806, 0.5512]}, {"w": "+", "b": [0.6919, 0.5361, 0.7033, 0.5512]}, {"w": "b)", "b": [0.7146, 0.5361, 0.7374, 0.5512]}]}, {"id": "b_4", "type": "paragraph", "text": "But all three transformations have their own weight matrices, which you’ll index with the letters i, f, and k. Here’s what you have so far (it may seem a bit arbitrary, but bear with me).", "words": [{"w": "But", "b": [0.1294, 0.5741, 0.1659, 0.5939]}, {"w": "all", "b": [0.1722, 0.5741, 0.1974, 0.5939]}, {"w": "three", "b": [0.2037, 0.5741, 0.2541, 0.5939]}, {"w": "transformations", "b": [0.2604, 0.5741, 0.4188, 0.5939]}, {"w": "have", "b": [0.4251, 0.5741, 0.4727, 0.5939]}, {"w": "their", "b": [0.479, 0.5741, 0.5253, 0.5939]}, {"w": "own", "b": [0.5316, 0.5741, 0.575, 0.5939]}, {"w": "weight", "b": [0.5813, 0.5741, 0.65, 0.5939]}, {"w": "matrices,", "b": [0.6563, 0.5741, 0.748, 0.5939]}, {"w": "which", "b": [0.7544, 0.5741, 0.816, 0.5939]}, {"w": "you’ll", "b": [0.1294, 0.5946, 0.1897, 0.6144]}, {"w": "index", "b": [0.196, 0.5946, 0.252, 0.6144]}, {"w": "with", "b": [0.2583, 0.5946, 0.3032, 0.6144]}, {"w": "the", "b": [0.3095, 0.5946, 0.3403, 0.6144]}, {"w": "letters", "b": [0.3466, 0.5946, 0.4083, 0.6144]}, {"w": "i,", "b": [0.4145, 0.5946, 0.436, 0.6159]}, {"w": "f,", "b": [0.4423, 0.5946, 0.4637, 0.6159]}, {"w": "and", "b": [0.47, 0.5946, 0.5065, 0.6144]}, {"w": "k.", "b": [0.5128, 0.5946, 0.5342, 0.6159]}, {"w": "Here’s", "b": [0.5405, 0.5946, 0.6063, 0.6144]}, {"w": "what", "b": [0.6127, 0.5946, 0.6617, 0.6144]}, {"w": "you", "b": [0.668, 0.5946, 0.7058, 0.6144]}, {"w": "have", "b": [0.7121, 0.5946, 0.7598, 0.6144]}, {"w": "so", "b": [0.7661, 0.5946, 0.7885, 0.6144]}, {"w": "far", "b": [0.7948, 0.5946, 0.8228, 0.6144]}, {"w": "(it", "b": [0.8291, 0.5946, 0.8515, 0.6144]}, {"w": "may", "b": [0.1294, 0.616, 0.1729, 0.6358]}, {"w": "seem", "b": [0.1792, 0.616, 0.231, 0.6358]}, {"w": "a", "b": [0.2373, 0.616, 0.2485, 0.6358]}, {"w": "bit", "b": [0.2548, 0.616, 0.2814, 0.6358]}, {"w": "arbitrary,", "b": [0.2878, 0.616, 0.3792, 0.6358]}, {"w": "but", "b": [0.3855, 0.616, 0.4178, 0.6358]}, {"w": "bear", "b": [0.4241, 0.616, 0.4675, 0.6358]}, {"w": "with", "b": [0.4738, 0.616, 0.5187, 0.6358]}, {"w": "me).", "b": [0.525, 0.616, 0.5705, 0.6358]}]}, {"id": "b_5", "type": "equation", "text": "Listing 6.25. Pseudocode details of the LSTM architecture (1/2)", "words": [{"w": "Listing", "b": [0.1294, 0.6539, 0.1862, 0.6687]}, {"w": "6.25.", "b": [0.1909, 0.6539, 0.2288, 0.6687]}, {"w": "Pseudocode", "b": [0.2335, 0.6539, 0.3281, 0.6687]}, {"w": "details", "b": [0.3328, 0.6539, 0.3854, 0.6687]}, {"w": "of", "b": [0.3901, 0.6539, 0.4058, 0.6687]}, {"w": "the", "b": [0.4106, 0.6539, 0.4358, 0.6687]}, {"w": "LSTM", "b": [0.4405, 0.6539, 0.4941, 0.6687]}, {"w": "architecture", "b": [0.4989, 0.6539, 0.5969, 0.6687]}, {"w": "(1/2)", "b": [0.6017, 0.6539, 0.6384, 0.6687]}]}, {"id": "b_6", "type": "paragraph", "text": "output_t = activation(dot(state_t, Uo) + dot(input_t, Wo) + dot(C_t, Vo) + bo) i_t = activation(dot(state_t, Ui) + dot(input_t, Wi) + bi) f_t = activation(dot(state_t, Uf) + dot(input_t, Wf) + bf) k_t = activation(dot(state_t, Uk) + dot(input_t, Wk) + bk)", "words": [{"w": "output_t", "b": [0.1357, 0.6823, 0.2265, 0.6974]}, {"w": "=", "b": [0.2379, 0.6823, 0.2492, 0.6974]}, {"w": "activation(dot(state_t,", "b": [0.2606, 0.6823, 0.5217, 0.6974]}, {"w": "Uo)", "b": [0.533, 0.6823, 0.5671, 0.6974]}, {"w": "+", "b": [0.5784, 0.6823, 0.5898, 0.6974]}, {"w": "dot(input_t,", "b": [0.6011, 0.6823, 0.7374, 0.6974]}, {"w": "Wo)", "b": [0.7487, 0.6823, 0.7828, 0.6974]}, {"w": "+", "b": [0.7941, 0.6823, 0.8055, 0.6974]}, {"w": "dot(C_t,", "b": [0.1357, 0.6974, 0.2265, 0.7126]}, {"w": "Vo)", "b": [0.2379, 0.6974, 0.2719, 0.7126]}, {"w": "+", "b": [0.2833, 0.6974, 0.2946, 0.7126]}, {"w": "bo)", "b": [0.306, 0.6974, 0.34, 0.7126]}, {"w": "i_t", "b": [0.1357, 0.7277, 0.1698, 0.7429]}, {"w": "=", "b": [0.1811, 0.7277, 0.1925, 0.7429]}, {"w": "activation(dot(state_t,", "b": [0.2038, 0.7277, 0.4649, 0.7429]}, {"w": "Ui)", "b": [0.4763, 0.7277, 0.5103, 0.7429]}, {"w": "+", "b": [0.5217, 0.7277, 0.533, 0.7429]}, {"w": "dot(input_t,", "b": [0.5444, 0.7277, 0.6806, 0.7429]}, {"w": "Wi)", "b": [0.6919, 0.7277, 0.726, 0.7429]}, {"w": "+", "b": [0.7374, 0.7277, 0.7487, 0.7429]}, {"w": "bi)", "b": [0.7601, 0.7277, 0.7941, 0.7429]}, {"w": "f_t", "b": [0.1357, 0.7429, 0.1698, 0.758]}, {"w": "=", "b": [0.1811, 0.7429, 0.1925, 0.758]}, {"w": "activation(dot(state_t,", "b": [0.2038, 0.7429, 0.4649, 0.758]}, {"w": "Uf)", "b": [0.4763, 0.7429, 0.5103, 0.758]}, {"w": "+", "b": [0.5217, 0.7429, 0.533, 0.758]}, {"w": "dot(input_t,", "b": [0.5444, 0.7429, 0.6806, 0.758]}, {"w": "Wf)", "b": [0.6919, 0.7429, 0.726, 0.758]}, {"w": "+", "b": [0.7374, 0.7429, 0.7487, 0.758]}, {"w": "bf)", "b": [0.7601, 0.7429, 0.7941, 0.758]}, {"w": "k_t", "b": [0.1357, 0.758, 0.1698, 0.7732]}, {"w": "=", "b": [0.1811, 0.758, 0.1925, 0.7732]}, {"w": "activation(dot(state_t,", "b": [0.2038, 0.758, 0.4649, 0.7732]}, {"w": "Uk)", "b": [0.4763, 0.758, 0.5103, 0.7732]}, {"w": "+", "b": [0.5217, 0.758, 0.533, 0.7732]}, {"w": "dot(input_t,", "b": [0.5444, 0.758, 0.6806, 0.7732]}, {"w": "Wk)", "b": [0.6919, 0.758, 0.726, 0.7732]}, {"w": "+", "b": [0.7374, 0.758, 0.7487, 0.7732]}, {"w": "bk)", "b": [0.7601, 0.758, 0.7941, 0.7732]}]}, {"id": "b_7", "type": "equation", "text": "You obtain the new carry state (the next c_t) by combining i_t, f_t, and k_t.", "words": [{"w": "You", "b": [0.1294, 0.7961, 0.1703, 0.8158]}, {"w": "obtain", "b": [0.1766, 0.7961, 0.2397, 0.8158]}, {"w": "the", "b": [0.246, 0.7961, 0.2768, 0.8158]}, {"w": "new", "b": [0.2831, 0.7961, 0.3252, 0.8158]}, {"w": "carry", "b": [0.3315, 0.7961, 0.3833, 0.8158]}, {"w": "state", "b": [0.3896, 0.7961, 0.4358, 0.8158]}, {"w": "(the", "b": [0.4421, 0.7961, 0.4814, 0.8158]}, {"w": "next", "b": [0.4877, 0.7961, 0.5311, 0.8158]}, {"w": "c_t)", "b": [0.5374, 0.7961, 0.5912, 0.8173]}, {"w": "by", "b": [0.5975, 0.7961, 0.6227, 0.8158]}, {"w": "combining", "b": [0.629, 0.7961, 0.7369, 0.8158]}, {"w": "i_t,", "b": [0.7432, 0.7961, 0.7949, 0.8173]}, {"w": "f_t,", "b": [0.8012, 0.7961, 0.8529, 0.8173]}, {"w": "and", "b": [0.1294, 0.8174, 0.1658, 0.8372]}, {"w": "k_t.", "b": [0.1721, 0.8174, 0.2239, 0.8387]}]}, {"id": "b_8", "type": "equation", "text": "Listing 6.26. Pseudocode details of the LSTM architecture (2/2)", "words": [{"w": "Listing", "b": [0.1294, 0.8562, 0.1862, 0.871]}, {"w": "6.26.", "b": [0.1909, 0.8562, 0.2288, 0.871]}, {"w": "Pseudocode", "b": [0.2335, 0.8562, 0.3281, 0.871]}, {"w": "details", "b": [0.3328, 0.8562, 0.3854, 0.871]}, {"w": "of", "b": [0.3901, 0.8562, 0.4058, 0.871]}, {"w": "the", "b": [0.4106, 0.8562, 0.4358, 0.871]}, {"w": "LSTM", "b": [0.4405, 0.8562, 0.4941, 0.871]}, {"w": "architecture", "b": [0.4989, 0.8562, 0.5969, 0.871]}, {"w": "(2/2)", "b": [0.6017, 0.8562, 0.6384, 0.871]}]}, {"id": "b_9", "type": "equation", "text": "c_t+1 = i_t * k_t + c_t * f_t", "words": [{"w": "c_t+1", "b": [0.1357, 0.8846, 0.1925, 0.8997]}, {"w": "=", "b": [0.2038, 0.8846, 0.2152, 0.8997]}, {"w": "i_t", "b": [0.2265, 0.8846, 0.2606, 0.8997]}, {"w": "*", "b": [0.2719, 0.8846, 0.2833, 0.8997]}, {"w": "k_t", "b": [0.2946, 0.8846, 0.3287, 0.8997]}, {"w": "+", "b": [0.34, 0.8846, 0.3514, 0.8997]}, {"w": "c_t", "b": [0.3628, 0.8846, 0.3968, 0.8997]}, {"w": "*", "b": [0.4082, 0.8846, 0.4195, 0.8997]}, {"w": "f_t", "b": [0.4309, 0.8846, 0.4649, 0.8997]}]}]}, {"page": 270, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Add this as shown in figure 6.15. And that’s it. Not so complicated— merely a tad complex.", "words": [{"w": "Add", "b": [0.1294, 0.0857, 0.1729, 0.1054]}, {"w": "this", "b": [0.1792, 0.0857, 0.2156, 0.1054]}, {"w": "as", "b": [0.2219, 0.0857, 0.2429, 0.1054]}, {"w": "shown", "b": [0.2492, 0.0857, 0.3151, 0.1054]}, {"w": "in", "b": [0.3214, 0.0857, 0.341, 0.1054]}, {"w": "figure", "b": [0.3473, 0.0857, 0.4076, 0.1054]}, {"w": "6.15.", "b": [0.4139, 0.0857, 0.4643, 0.1054]}, {"w": "And", "b": [0.4706, 0.0857, 0.5141, 0.1054]}, {"w": "that’s", "b": [0.5204, 0.0857, 0.575, 0.1054]}, {"w": "it.", "b": [0.5813, 0.0857, 0.6017, 0.1054]}, {"w": "Not", "b": [0.608, 0.0857, 0.6458, 0.1054]}, {"w": "so", "b": [0.6521, 0.0857, 0.6745, 0.1054]}, {"w": "complicated—", "b": [0.6808, 0.0857, 0.8294, 0.1054]}, {"w": "merely", "b": [0.1294, 0.1062, 0.1995, 0.1259]}, {"w": "a", "b": [0.2058, 0.1062, 0.217, 0.1259]}, {"w": "tad", "b": [0.2233, 0.1062, 0.2541, 0.1259]}, {"w": "complex.", "b": [0.2604, 0.1062, 0.3536, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.15. Anatomy of an lstm", "words": [{"w": "Figure", "b": [0.1294, 0.144, 0.1827, 0.1588]}, {"w": "6.15.", "b": [0.1874, 0.144, 0.2252, 0.1588]}, {"w": "Anatomy", "b": [0.2299, 0.144, 0.3046, 0.1588]}, {"w": "of", "b": [0.3093, 0.144, 0.325, 0.1588]}, {"w": "an", "b": [0.3298, 0.144, 0.3498, 0.1588]}, {"w": "lstm", "b": [0.3545, 0.1448, 0.3999, 0.1599]}]}, {"id": "b_2", "type": "paragraph", "text": "If you want to get philosophical, you can interpret what each of these operations is meant to do. For instance, you can say that multiplying c_t and f_t is a way to deliberately forget irrelevant information in the carry dataflow. Meanwhile, i_t and k_t provide information about the present, updating the carry track with new information. But at the end of the day, these interpretations don’t mean much, because what these operations actually do is determined by the contents of the weights parameterizing them; and the weights are learned in an end-to-end fashion, starting over with each training round, making it impossible to credit this or that operation with a specific purpose. The specification of an RNN cell (as just described) determines your hypothesis space—the space in which you’ll search for a good model configuration during training—but it doesn’t determine what the cell does; that is up to the cell weights. The same cell with different weights can be doing very different things. So the combination of operations making up an RNN cell is better interpreted as a set of constraints on your search, not as a design in an engineering sense.", "words": [{"w": "If", "b": [0.1294, 0.4101, 0.1462, 0.4299]}, {"w": "you", "b": [0.1525, 0.4101, 0.1904, 0.4299]}, {"w": "want", "b": [0.1967, 0.4101, 0.2457, 0.4299]}, {"w": "to", "b": [0.252, 0.4101, 0.2716, 0.4299]}, {"w": "get", "b": [0.2779, 0.4101, 0.3088, 0.4299]}, {"w": "philosophical,", "b": [0.3151, 0.4101, 0.4573, 0.4299]}, {"w": "you", "b": [0.4636, 0.4101, 0.5015, 0.4299]}, {"w": "can", "b": [0.5078, 0.4101, 0.5428, 0.4299]}, {"w": "interpret", "b": [0.5491, 0.4101, 0.6346, 0.4299]}, {"w": "what", "b": [0.6409, 0.4101, 0.6899, 0.4299]}, {"w": "each", "b": [0.6962, 0.4101, 0.7424, 0.4299]}, {"w": "of", "b": [0.7487, 0.4101, 0.7697, 0.4299]}, {"w": "these", "b": [0.776, 0.4101, 0.8279, 0.4299]}, {"w": "operations", "b": [0.1294, 0.4306, 0.2345, 0.4504]}, {"w": "is", "b": [0.2408, 0.4306, 0.2576, 0.4504]}, {"w": "meant", "b": [0.2639, 0.4306, 0.3256, 0.4504]}, {"w": "to", "b": [0.3319, 0.4306, 0.3515, 0.4504]}, {"w": "do.", "b": [0.3578, 0.4306, 0.3894, 0.4504]}, {"w": "For", "b": [0.3957, 0.4306, 0.4307, 0.4504]}, {"w": "instance,", "b": [0.437, 0.4306, 0.526, 0.4504]}, {"w": "you", "b": [0.5323, 0.4306, 0.5701, 0.4504]}, {"w": "can", "b": [0.5764, 0.4306, 0.6115, 0.4504]}, {"w": "say", "b": [0.6178, 0.4306, 0.6514, 0.4504]}, {"w": "that", "b": [0.6576, 0.4306, 0.6955, 0.4504]}, {"w": "multiplying", "b": [0.7018, 0.4306, 0.8195, 0.4504]}, {"w": "c_t", "b": [0.1294, 0.4522, 0.1748, 0.4724]}, {"w": "and", "b": [0.1811, 0.4511, 0.2176, 0.4709]}, {"w": "f_t", "b": [0.2239, 0.4522, 0.2693, 0.4724]}, {"w": "is", "b": [0.2756, 0.4511, 0.2924, 0.4709]}, {"w": "a", "b": [0.2987, 0.4511, 0.3099, 0.4709]}, {"w": "way", "b": [0.3162, 0.4511, 0.3582, 0.4709]}, {"w": "to", "b": [0.3645, 0.4511, 0.3842, 0.4709]}, {"w": "deliberately", "b": [0.3905, 0.4511, 0.5096, 0.4709]}, {"w": "forget", "b": [0.5159, 0.4511, 0.5756, 0.4709]}, {"w": "irrelevant", "b": [0.5819, 0.4511, 0.6786, 0.4709]}, {"w": "information", "b": [0.6849, 0.4511, 0.804, 0.4709]}, {"w": "in", "b": [0.8103, 0.4511, 0.8299, 0.4709]}, {"w": "the", "b": [0.8362, 0.4511, 0.8671, 0.4709]}, {"w": "carry", "b": [0.1294, 0.4725, 0.1812, 0.4922]}, {"w": "dataflow.", "b": [0.1875, 0.4725, 0.2804, 0.4922]}, {"w": "Meanwhile,", "b": [0.2868, 0.4725, 0.4065, 0.4922]}, {"w": "i_t", "b": [0.4128, 0.4736, 0.4582, 0.4937]}, {"w": "and", "b": [0.4645, 0.4725, 0.501, 0.4922]}, {"w": "k_t", "b": [0.5073, 0.4736, 0.5527, 0.4937]}, {"w": "provide", "b": [0.559, 0.4725, 0.636, 0.4922]}, {"w": "information", "b": [0.6424, 0.4725, 0.7615, 0.4922]}, {"w": "about", "b": [0.7678, 0.4725, 0.8238, 0.4922]}, {"w": "the", "b": [0.8301, 0.4725, 0.861, 0.4922]}, {"w": "present,", "b": [0.1294, 0.4939, 0.2086, 0.5136]}, {"w": "updating", "b": [0.2149, 0.4939, 0.3032, 0.5136]}, {"w": "the", "b": [0.3095, 0.4939, 0.3403, 0.5136]}, {"w": "carry", "b": [0.3466, 0.4939, 0.3984, 0.5136]}, {"w": "track", "b": [0.4047, 0.4939, 0.4552, 0.5136]}, {"w": "with", "b": [0.4615, 0.4939, 0.5063, 0.5136]}, {"w": "new", "b": [0.5126, 0.4939, 0.5546, 0.5136]}, {"w": "information.", "b": [0.5609, 0.4939, 0.6864, 0.5136]}, {"w": "But", "b": [0.6927, 0.4939, 0.7291, 0.5136]}, {"w": "at", "b": [0.7354, 0.4939, 0.7536, 0.5136]}, {"w": "the", "b": [0.76, 0.4939, 0.7908, 0.5136]}, {"w": "end", "b": [0.7971, 0.4939, 0.8335, 0.5136]}, {"w": "of", "b": [0.8398, 0.4939, 0.8608, 0.5136]}, {"w": "the", "b": [0.1294, 0.5144, 0.1602, 0.5341]}, {"w": "day,", "b": [0.1665, 0.5144, 0.2076, 0.5341]}, {"w": "these", "b": [0.2139, 0.5144, 0.2658, 0.5341]}, {"w": "interpretations", "b": [0.2721, 0.5144, 0.4178, 0.5341]}, {"w": "don’t", "b": [0.4241, 0.5144, 0.4769, 0.5341]}, {"w": "mean", "b": [0.4832, 0.5144, 0.5378, 0.5341]}, {"w": "much,", "b": [0.5441, 0.5144, 0.6065, 0.5341]}, {"w": "because", "b": [0.6128, 0.5144, 0.6926, 0.5341]}, {"w": "what", "b": [0.6989, 0.5144, 0.748, 0.5341]}, {"w": "these", "b": [0.7543, 0.5144, 0.8061, 0.5341]}, {"w": "operations", "b": [0.1294, 0.5349, 0.2345, 0.5546]}, {"w": "actually", "b": [0.2408, 0.5349, 0.3221, 0.5546]}, {"w": "do", "b": [0.3283, 0.5349, 0.3536, 0.5546]}, {"w": "is", "b": [0.3599, 0.5349, 0.3767, 0.5546]}, {"w": "determined", "b": [0.383, 0.5349, 0.4965, 0.5546]}, {"w": "by", "b": [0.5028, 0.5349, 0.528, 0.5546]}, {"w": "the", "b": [0.5343, 0.5349, 0.5652, 0.5546]}, {"w": "contents", "b": [0.5715, 0.5349, 0.6555, 0.5546]}, {"w": "of", "b": [0.6619, 0.5349, 0.6829, 0.5546]}, {"w": "the", "b": [0.6892, 0.5349, 0.72, 0.5546]}, {"w": "weights", "b": [0.7263, 0.5349, 0.8048, 0.5546]}, {"w": "parameterizing", "b": [0.1294, 0.5554, 0.2807, 0.5751]}, {"w": "them;", "b": [0.287, 0.5554, 0.3445, 0.5751]}, {"w": "and", "b": [0.3508, 0.5554, 0.3872, 0.5751]}, {"w": "the", "b": [0.3935, 0.5554, 0.4244, 0.5751]}, {"w": "weights", "b": [0.4307, 0.5554, 0.5091, 0.5751]}, {"w": "are", "b": [0.5154, 0.5554, 0.5462, 0.5751]}, {"w": "learned", "b": [0.5525, 0.5554, 0.6268, 0.5751]}, {"w": "in", "b": [0.6331, 0.5554, 0.6527, 0.5751]}, {"w": "an", "b": [0.659, 0.5554, 0.6828, 0.5751]}, {"w": "end-to-end", "b": [0.6891, 0.5554, 0.7984, 0.5751]}, {"w": "fashion,", "b": [0.1294, 0.5759, 0.21, 0.5956]}, {"w": "starting", "b": [0.2163, 0.5759, 0.292, 0.5956]}, {"w": "over", "b": [0.2983, 0.5759, 0.3431, 0.5956]}, {"w": "with", "b": [0.3494, 0.5759, 0.3943, 0.5956]}, {"w": "each", "b": [0.4006, 0.5759, 0.4468, 0.5956]}, {"w": "training", "b": [0.4531, 0.5759, 0.5316, 0.5956]}, {"w": "round,", "b": [0.5379, 0.5759, 0.603, 0.5956]}, {"w": "making", "b": [0.6093, 0.5759, 0.685, 0.5956]}, {"w": "it", "b": [0.6913, 0.5759, 0.7053, 0.5956]}, {"w": "impossible", "b": [0.7116, 0.5759, 0.821, 0.5956]}, {"w": "to", "b": [0.8273, 0.5759, 0.8469, 0.5956]}, {"w": "credit", "b": [0.1294, 0.5964, 0.1869, 0.6161]}, {"w": "this", "b": [0.1932, 0.5964, 0.2296, 0.6161]}, {"w": "or", "b": [0.2359, 0.5964, 0.2569, 0.6161]}, {"w": "that", "b": [0.2632, 0.5964, 0.3011, 0.6161]}, {"w": "operation", "b": [0.3074, 0.5964, 0.4027, 0.6161]}, {"w": "with", "b": [0.409, 0.5964, 0.4538, 0.6161]}, {"w": "a", "b": [0.4601, 0.5964, 0.4713, 0.6161]}, {"w": "specific", "b": [0.4776, 0.5964, 0.5561, 0.6161]}, {"w": "purpose.", "b": [0.5624, 0.5964, 0.6486, 0.6161]}, {"w": "The", "b": [0.6549, 0.5964, 0.6941, 0.6161]}, {"w": "specification", "b": [0.7003, 0.5964, 0.8292, 0.6161]}, {"w": "of", "b": [0.8355, 0.5964, 0.8565, 0.6161]}, {"w": "an", "b": [0.1294, 0.6169, 0.1532, 0.6366]}, {"w": "RNN", "b": [0.1595, 0.6169, 0.2128, 0.6366]}, {"w": "cell", "b": [0.2191, 0.6169, 0.2555, 0.6366]}, {"w": "(as", "b": [0.2618, 0.6169, 0.2912, 0.6366]}, {"w": "just", "b": [0.2975, 0.6169, 0.334, 0.6366]}, {"w": "described)", "b": [0.3403, 0.6169, 0.4454, 0.6366]}, {"w": "determines", "b": [0.4517, 0.6169, 0.5624, 0.6366]}, {"w": "your", "b": [0.5687, 0.6169, 0.6149, 0.6366]}, {"w": "hypothesis", "b": [0.6212, 0.6169, 0.7291, 0.6366]}, {"w": "space—the", "b": [0.7354, 0.6169, 0.8475, 0.6366]}, {"w": "space", "b": [0.1294, 0.6374, 0.1854, 0.6571]}, {"w": "in", "b": [0.1917, 0.6374, 0.2114, 0.6571]}, {"w": "which", "b": [0.2177, 0.6374, 0.2793, 0.6571]}, {"w": "you’ll", "b": [0.2856, 0.6374, 0.3459, 0.6571]}, {"w": "search", "b": [0.3522, 0.6374, 0.4166, 0.6571]}, {"w": "for", "b": [0.4229, 0.6374, 0.4524, 0.6571]}, {"w": "a", "b": [0.4587, 0.6374, 0.4699, 0.6571]}, {"w": "good", "b": [0.4762, 0.6374, 0.5266, 0.6571]}, {"w": "model", "b": [0.5329, 0.6374, 0.596, 0.6571]}, {"w": "configuration", "b": [0.6023, 0.6374, 0.7382, 0.6571]}, {"w": "during", "b": [0.7445, 0.6374, 0.8103, 0.6571]}, {"w": "training—but", "b": [0.1294, 0.6579, 0.2654, 0.6776]}, {"w": "it", "b": [0.2717, 0.6579, 0.2857, 0.6776]}, {"w": "doesn’t", "b": [0.292, 0.6579, 0.3658, 0.6776]}, {"w": "determine", "b": [0.3721, 0.6579, 0.473, 0.6776]}, {"w": "what", "b": [0.4793, 0.6579, 0.5283, 0.6776]}, {"w": "the", "b": [0.5346, 0.6579, 0.5654, 0.6776]}, {"w": "cell", "b": [0.5717, 0.6579, 0.6082, 0.6776]}, {"w": "does;", "b": [0.6145, 0.6579, 0.6677, 0.6776]}, {"w": "that", "b": [0.674, 0.6579, 0.7119, 0.6776]}, {"w": "is", "b": [0.7182, 0.6579, 0.735, 0.6776]}, {"w": "up", "b": [0.7413, 0.6579, 0.7665, 0.6776]}, {"w": "to", "b": [0.7728, 0.6579, 0.7925, 0.6776]}, {"w": "the", "b": [0.7988, 0.6579, 0.8296, 0.6776]}, {"w": "cell", "b": [0.1294, 0.6784, 0.1658, 0.6981]}, {"w": "weights.", "b": [0.1721, 0.6784, 0.2569, 0.6981]}, {"w": "The", "b": [0.2632, 0.6784, 0.3025, 0.6981]}, {"w": "same", "b": [0.3088, 0.6784, 0.3606, 0.6981]}, {"w": "cell", "b": [0.3669, 0.6784, 0.4033, 0.6981]}, {"w": "with", "b": [0.4096, 0.6784, 0.4545, 0.6981]}, {"w": "different", "b": [0.4608, 0.6784, 0.5471, 0.6981]}, {"w": "weights", "b": [0.5534, 0.6784, 0.6319, 0.6981]}, {"w": "can", "b": [0.6382, 0.6784, 0.6732, 0.6981]}, {"w": "be", "b": [0.6795, 0.6784, 0.7034, 0.6981]}, {"w": "doing", "b": [0.7097, 0.6784, 0.7671, 0.6981]}, {"w": "very", "b": [0.7734, 0.6784, 0.8183, 0.6981]}, {"w": "different", "b": [0.1294, 0.6989, 0.2158, 0.7186]}, {"w": "things.", "b": [0.2221, 0.6989, 0.2901, 0.7186]}, {"w": "So", "b": [0.2964, 0.6989, 0.323, 0.7186]}, {"w": "the", "b": [0.3293, 0.6989, 0.3602, 0.7186]}, {"w": "combination", "b": [0.3665, 0.6989, 0.4926, 0.7186]}, {"w": "of", "b": [0.4989, 0.6989, 0.5199, 0.7186]}, {"w": "operations", "b": [0.5262, 0.6989, 0.6313, 0.7186]}, {"w": "making", "b": [0.6376, 0.6989, 0.7133, 0.7186]}, {"w": "up", "b": [0.7196, 0.6989, 0.7448, 0.7186]}, {"w": "an", "b": [0.7511, 0.6989, 0.775, 0.7186]}, {"w": "RNN", "b": [0.7813, 0.6989, 0.8345, 0.7186]}, {"w": "cell", "b": [0.1294, 0.7194, 0.1658, 0.7391]}, {"w": "is", "b": [0.1721, 0.7194, 0.189, 0.7391]}, {"w": "better", "b": [0.1953, 0.7194, 0.2527, 0.7391]}, {"w": "interpreted", "b": [0.259, 0.7194, 0.3683, 0.7391]}, {"w": "as", "b": [0.3746, 0.7194, 0.3956, 0.7391]}, {"w": "a", "b": [0.4019, 0.7194, 0.4131, 0.7391]}, {"w": "set", "b": [0.4194, 0.7194, 0.4474, 0.7391]}, {"w": "of", "b": [0.4537, 0.7194, 0.4748, 0.7391]}, {"w": "constraints", "b": [0.481, 0.7194, 0.5931, 0.7391]}, {"w": "on", "b": [0.5994, 0.7194, 0.6247, 0.7391]}, {"w": "your", "b": [0.631, 0.7194, 0.6772, 0.7391]}, {"w": "search,", "b": [0.6835, 0.7194, 0.7542, 0.7391]}, {"w": "not", "b": [0.7606, 0.7194, 0.7928, 0.7391]}, {"w": "as", "b": [0.7991, 0.7194, 0.8201, 0.7391]}, {"w": "a", "b": [0.8264, 0.7194, 0.8376, 0.7391]}, {"w": "design", "b": [0.1294, 0.7399, 0.1953, 0.7596]}, {"w": "in", "b": [0.2016, 0.7399, 0.2212, 0.7596]}, {"w": "an", "b": [0.2275, 0.7399, 0.2513, 0.7596]}, {"w": "engineering", "b": [0.2576, 0.7399, 0.3767, 0.7596]}, {"w": "sense.", "b": [0.383, 0.7399, 0.444, 0.7596]}]}, {"id": "b_3", "type": "paragraph", "text": "To a researcher, it seems that the choice of such constraints—the question of how to implement RNN cells—is better left to optimization algorithms (like genetic algorithms or reinforcement learning processes) than to human engineers. And in the future, that’s how we’ll build networks. In summary: you don’t need to understand anything about the specific architecture of an LSTM cell; as a human, it shouldn’t be your", "words": [{"w": "To", "b": [0.1294, 0.7827, 0.1557, 0.8024]}, {"w": "a", "b": [0.162, 0.7827, 0.1732, 0.8024]}, {"w": "researcher,", "b": [0.1795, 0.7827, 0.2884, 0.8024]}, {"w": "it", "b": [0.2947, 0.7827, 0.3087, 0.8024]}, {"w": "seems", "b": [0.315, 0.7827, 0.3767, 0.8024]}, {"w": "that", "b": [0.383, 0.7827, 0.4208, 0.8024]}, {"w": "the", "b": [0.4271, 0.7827, 0.458, 0.8024]}, {"w": "choice", "b": [0.4643, 0.7827, 0.5301, 0.8024]}, {"w": "of", "b": [0.5364, 0.7827, 0.5574, 0.8024]}, {"w": "such", "b": [0.5637, 0.7827, 0.61, 0.8024]}, {"w": "constraints—the", "b": [0.6163, 0.7827, 0.7816, 0.8024]}, {"w": "question", "b": [0.1294, 0.8032, 0.2149, 0.8229]}, {"w": "of", "b": [0.2212, 0.8032, 0.2422, 0.8229]}, {"w": "how", "b": [0.2485, 0.8032, 0.292, 0.8229]}, {"w": "to", "b": [0.2983, 0.8032, 0.3179, 0.8229]}, {"w": "implement", "b": [0.3242, 0.8032, 0.4321, 0.8229]}, {"w": "RNN", "b": [0.4384, 0.8032, 0.4917, 0.8229]}, {"w": "cells—is", "b": [0.498, 0.8032, 0.5863, 0.8229]}, {"w": "better", "b": [0.5926, 0.8032, 0.65, 0.8229]}, {"w": "left", "b": [0.6563, 0.8032, 0.69, 0.8229]}, {"w": "to", "b": [0.6963, 0.8032, 0.7159, 0.8229]}, {"w": "optimization", "b": [0.7221, 0.8032, 0.8497, 0.8229]}, {"w": "algorithms", "b": [0.1294, 0.8237, 0.2373, 0.8434]}, {"w": "(like", "b": [0.2436, 0.8237, 0.2899, 0.8434]}, {"w": "genetic", "b": [0.2962, 0.8237, 0.369, 0.8434]}, {"w": "algorithms", "b": [0.3753, 0.8237, 0.4833, 0.8434]}, {"w": "or", "b": [0.4896, 0.8237, 0.5106, 0.8434]}, {"w": "reinforcement", "b": [0.5169, 0.8237, 0.6584, 0.8434]}, {"w": "learning", "b": [0.6647, 0.8237, 0.7473, 0.8434]}, {"w": "processes)", "b": [0.7536, 0.8237, 0.8587, 0.8434]}, {"w": "than", "b": [0.1294, 0.8442, 0.1729, 0.8639]}, {"w": "to", "b": [0.1792, 0.8442, 0.1988, 0.8639]}, {"w": "human", "b": [0.2051, 0.8442, 0.2738, 0.8639]}, {"w": "engineers.", "b": [0.2801, 0.8442, 0.383, 0.8639]}, {"w": "And", "b": [0.3893, 0.8442, 0.4328, 0.8639]}, {"w": "in", "b": [0.4391, 0.8442, 0.4587, 0.8639]}, {"w": "the", "b": [0.465, 0.8442, 0.4958, 0.8639]}, {"w": "future,", "b": [0.5021, 0.8442, 0.5686, 0.8639]}, {"w": "that’s", "b": [0.575, 0.8442, 0.6296, 0.8639]}, {"w": "how", "b": [0.6359, 0.8442, 0.6793, 0.8639]}, {"w": "we’ll", "b": [0.6856, 0.8442, 0.7375, 0.8639]}, {"w": "build", "b": [0.7438, 0.8442, 0.7957, 0.8639]}, {"w": "networks.", "b": [0.1294, 0.8647, 0.2282, 0.8844]}, {"w": "In", "b": [0.2345, 0.8647, 0.2555, 0.8844]}, {"w": "summary:", "b": [0.2618, 0.8647, 0.3627, 0.8844]}, {"w": "you", "b": [0.369, 0.8647, 0.4069, 0.8844]}, {"w": "don’t", "b": [0.4132, 0.8647, 0.466, 0.8844]}, {"w": "need", "b": [0.4723, 0.8647, 0.5199, 0.8844]}, {"w": "to", "b": [0.5262, 0.8647, 0.5458, 0.8844]}, {"w": "understand", "b": [0.5521, 0.8647, 0.6628, 0.8844]}, {"w": "anything", "b": [0.6691, 0.8647, 0.7574, 0.8844]}, {"w": "about", "b": [0.7637, 0.8647, 0.8198, 0.8844]}, {"w": "the", "b": [0.8261, 0.8647, 0.8569, 0.8844]}, {"w": "specific", "b": [0.1294, 0.8852, 0.2079, 0.9049]}, {"w": "architecture", "b": [0.2142, 0.8852, 0.3332, 0.9049]}, {"w": "of", "b": [0.3395, 0.8852, 0.3605, 0.9049]}, {"w": "an", "b": [0.3668, 0.8852, 0.3906, 0.9049]}, {"w": "LSTM", "b": [0.3969, 0.8862, 0.4575, 0.9064]}, {"w": "cell;", "b": [0.4638, 0.8852, 0.5072, 0.9049]}, {"w": "as", "b": [0.5135, 0.8852, 0.5345, 0.9049]}, {"w": "a", "b": [0.5408, 0.8852, 0.552, 0.9049]}, {"w": "human,", "b": [0.5583, 0.8852, 0.6333, 0.9049]}, {"w": "it", "b": [0.6396, 0.8852, 0.6536, 0.9049]}, {"w": "shouldn’t", "b": [0.66, 0.8852, 0.7548, 0.9049]}, {"w": "be", "b": [0.7611, 0.8852, 0.7849, 0.9049]}, {"w": "your", "b": [0.7912, 0.8852, 0.8374, 0.9049]}]}]}, {"page": 271, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "job to understand it. Just keep in mind what the LSTM cell is meant to do: allow past information to be reinjected at a later time, thus fighting the vanishing-gradient problem.", "words": [{"w": "job", "b": [0.1294, 0.0857, 0.1617, 0.1054]}, {"w": "to", "b": [0.168, 0.0857, 0.1876, 0.1054]}, {"w": "understand", "b": [0.1939, 0.0857, 0.3046, 0.1054]}, {"w": "it.", "b": [0.3109, 0.0857, 0.3312, 0.1054]}, {"w": "Just", "b": [0.3375, 0.0857, 0.3768, 0.1054]}, {"w": "keep", "b": [0.3831, 0.0857, 0.4307, 0.1054]}, {"w": "in", "b": [0.437, 0.0857, 0.4566, 0.1054]}, {"w": "mind", "b": [0.4629, 0.0857, 0.5148, 0.1054]}, {"w": "what", "b": [0.5211, 0.0857, 0.5702, 0.1054]}, {"w": "the", "b": [0.5765, 0.0857, 0.6073, 0.1054]}, {"w": "LSTM", "b": [0.6135, 0.0867, 0.6741, 0.1069]}, {"w": "cell", "b": [0.6804, 0.0857, 0.7168, 0.1054]}, {"w": "is", "b": [0.7231, 0.0857, 0.7399, 0.1054]}, {"w": "meant", "b": [0.7462, 0.0857, 0.8079, 0.1054]}, {"w": "to", "b": [0.8142, 0.0857, 0.8338, 0.1054]}, {"w": "do:", "b": [0.1294, 0.1071, 0.1617, 0.1268]}, {"w": "allow", "b": [0.168, 0.1071, 0.224, 0.1268]}, {"w": "past", "b": [0.2303, 0.1071, 0.271, 0.1268]}, {"w": "information", "b": [0.2773, 0.1071, 0.3964, 0.1268]}, {"w": "to", "b": [0.4027, 0.1071, 0.4223, 0.1268]}, {"w": "be", "b": [0.4286, 0.1071, 0.4524, 0.1268]}, {"w": "reinjected", "b": [0.4587, 0.1071, 0.5582, 0.1268]}, {"w": "at", "b": [0.5645, 0.1071, 0.5827, 0.1268]}, {"w": "a", "b": [0.589, 0.1071, 0.6002, 0.1268]}, {"w": "later", "b": [0.6065, 0.1071, 0.6514, 0.1268]}, {"w": "time,", "b": [0.6577, 0.1071, 0.7088, 0.1268]}, {"w": "thus", "b": [0.7151, 0.1071, 0.7572, 0.1268]}, {"w": "fighting", "b": [0.7635, 0.1071, 0.8434, 0.1268]}, {"w": "the", "b": [0.1294, 0.1276, 0.1602, 0.1473]}, {"w": "vanishing-gradient", "b": [0.1665, 0.1276, 0.3557, 0.1473]}, {"w": "problem.", "b": [0.362, 0.1276, 0.4524, 0.1473]}]}, {"id": "b_1", "type": "paragraph", "text": "6.2.3. A concrete LSTM example in Keras", "words": [{"w": "6.2.3.", "b": [0.1294, 0.1748, 0.1862, 0.1946]}, {"w": "A", "b": [0.1925, 0.1748, 0.2107, 0.1946]}, {"w": "concrete", "b": [0.217, 0.1748, 0.3076, 0.1946]}, {"w": "LSTM", "b": [0.3139, 0.1748, 0.3854, 0.1946]}, {"w": "example", "b": [0.3917, 0.1748, 0.4814, 0.1946]}, {"w": "in", "b": [0.4877, 0.1748, 0.5087, 0.1946]}, {"w": "Keras", "b": [0.515, 0.1748, 0.5795, 0.1946]}]}, {"id": "b_2", "type": "paragraph", "text": "Now let’s switch to more practical concerns: you’ll set up a model using an LSTM layer and train it on the IMDB data (see figures 6.16 and 6.17). The network is similar to the one with SimpleRNN that was just presented. You only specify the output dimensionality of the LSTM layer; leave every other argument (there are many) at the Keras defaults. Keras has good defaults, and things will almost always “just work” without you having to spend time tuning parameters by hand.", "words": [{"w": "Now", "b": [0.1294, 0.2176, 0.1785, 0.2373]}, {"w": "let’s", "b": [0.1848, 0.2176, 0.2268, 0.2373]}, {"w": "switch", "b": [0.2331, 0.2176, 0.299, 0.2373]}, {"w": "to", "b": [0.3053, 0.2176, 0.3249, 0.2373]}, {"w": "more", "b": [0.3312, 0.2176, 0.383, 0.2373]}, {"w": "practical", "b": [0.3894, 0.2176, 0.4762, 0.2373]}, {"w": "concerns:", "b": [0.4825, 0.2176, 0.5792, 0.2373]}, {"w": "you’ll", "b": [0.5855, 0.2176, 0.6458, 0.2373]}, {"w": "set", "b": [0.6521, 0.2176, 0.6801, 0.2373]}, {"w": "up", "b": [0.6864, 0.2176, 0.7116, 0.2373]}, {"w": "a", "b": [0.7179, 0.2176, 0.7291, 0.2373]}, {"w": "model", "b": [0.7354, 0.2176, 0.7985, 0.2373]}, {"w": "using", "b": [0.8048, 0.2176, 0.8595, 0.2373]}, {"w": "an", "b": [0.1294, 0.2381, 0.1532, 0.2578]}, {"w": "LSTM", "b": [0.1595, 0.2391, 0.2201, 0.2593]}, {"w": "layer", "b": [0.2264, 0.2381, 0.2768, 0.2578]}, {"w": "and", "b": [0.2831, 0.2381, 0.3195, 0.2578]}, {"w": "train", "b": [0.3258, 0.2381, 0.3721, 0.2578]}, {"w": "it", "b": [0.3784, 0.2381, 0.3924, 0.2578]}, {"w": "on", "b": [0.3987, 0.2381, 0.4239, 0.2578]}, {"w": "the", "b": [0.4302, 0.2381, 0.4611, 0.2578]}, {"w": "IMDB", "b": [0.4674, 0.2381, 0.5332, 0.2578]}, {"w": "data", "b": [0.5396, 0.2381, 0.5816, 0.2578]}, {"w": "(see", "b": [0.5879, 0.2381, 0.6285, 0.2578]}, {"w": "figures", "b": [0.6347, 0.2381, 0.7048, 0.2578]}, {"w": "6.16", "b": [0.7111, 0.2381, 0.7552, 0.2578]}, {"w": "and", "b": [0.7615, 0.2381, 0.798, 0.2578]}, {"w": "6.17).", "b": [0.8043, 0.2381, 0.8631, 0.2578]}, {"w": "The", "b": [0.1294, 0.2595, 0.1686, 0.2792]}, {"w": "network", "b": [0.1749, 0.2595, 0.2576, 0.2792]}, {"w": "is", "b": [0.2639, 0.2595, 0.2807, 0.2792]}, {"w": "similar", "b": [0.287, 0.2595, 0.3571, 0.2792]}, {"w": "to", "b": [0.3634, 0.2595, 0.3831, 0.2792]}, {"w": "the", "b": [0.3894, 0.2595, 0.4202, 0.2792]}, {"w": "one", "b": [0.4265, 0.2595, 0.4629, 0.2792]}, {"w": "with", "b": [0.4692, 0.2595, 0.5141, 0.2792]}, {"w": "SimpleRNN", "b": [0.5203, 0.2605, 0.6566, 0.2807]}, {"w": "that", "b": [0.6629, 0.2595, 0.7007, 0.2792]}, {"w": "was", "b": [0.707, 0.2595, 0.7462, 0.2792]}, {"w": "just", "b": [0.7526, 0.2595, 0.789, 0.2792]}, {"w": "presented.", "b": [0.1294, 0.2809, 0.2324, 0.3006]}, {"w": "You", "b": [0.2387, 0.2809, 0.2796, 0.3006]}, {"w": "only", "b": [0.2859, 0.2809, 0.3308, 0.3006]}, {"w": "specify", "b": [0.3371, 0.2809, 0.4099, 0.3006]}, {"w": "the", "b": [0.4162, 0.2809, 0.447, 0.3006]}, {"w": "output", "b": [0.4534, 0.2809, 0.5178, 0.3006]}, {"w": "dimensionality", "b": [0.5241, 0.2809, 0.6741, 0.3006]}, {"w": "of", "b": [0.6804, 0.2809, 0.7014, 0.3006]}, {"w": "the", "b": [0.7077, 0.2809, 0.7386, 0.3006]}, {"w": "LSTM", "b": [0.7448, 0.2819, 0.8053, 0.3021]}, {"w": "layer;", "b": [0.8116, 0.2809, 0.8691, 0.3006]}, {"w": "leave", "b": [0.1294, 0.3023, 0.1826, 0.322]}, {"w": "every", "b": [0.1889, 0.3023, 0.245, 0.322]}, {"w": "other", "b": [0.2513, 0.3023, 0.3031, 0.322]}, {"w": "argument", "b": [0.3094, 0.3023, 0.4042, 0.322]}, {"w": "(there", "b": [0.4105, 0.3023, 0.4693, 0.322]}, {"w": "are", "b": [0.4756, 0.3023, 0.5065, 0.322]}, {"w": "many)", "b": [0.5128, 0.3023, 0.5772, 0.322]}, {"w": "at", "b": [0.5835, 0.3023, 0.6017, 0.322]}, {"w": "the", "b": [0.608, 0.3023, 0.6389, 0.322]}, {"w": "Keras", "b": [0.6452, 0.3023, 0.704, 0.322]}, {"w": "defaults.", "b": [0.7103, 0.3023, 0.7965, 0.322]}, {"w": "Keras", "b": [0.8028, 0.3023, 0.8616, 0.322]}, {"w": "has", "b": [0.1294, 0.3228, 0.163, 0.3425]}, {"w": "good", "b": [0.1693, 0.3228, 0.2198, 0.3425]}, {"w": "defaults,", "b": [0.2261, 0.3228, 0.3123, 0.3425]}, {"w": "and", "b": [0.3186, 0.3228, 0.355, 0.3425]}, {"w": "things", "b": [0.3613, 0.3228, 0.423, 0.3425]}, {"w": "will", "b": [0.4293, 0.3228, 0.4685, 0.3425]}, {"w": "almost", "b": [0.4749, 0.3228, 0.5421, 0.3425]}, {"w": "always", "b": [0.5484, 0.3228, 0.6184, 0.3425]}, {"w": "“just", "b": [0.6248, 0.3228, 0.6724, 0.3425]}, {"w": "work”", "b": [0.6787, 0.3228, 0.7418, 0.3425]}, {"w": "without", "b": [0.7481, 0.3228, 0.8251, 0.3425]}, {"w": "you", "b": [0.8315, 0.3228, 0.8693, 0.3425]}, {"w": "having", "b": [0.1294, 0.3433, 0.1981, 0.363]}, {"w": "to", "b": [0.2044, 0.3433, 0.224, 0.363]}, {"w": "spend", "b": [0.2303, 0.3433, 0.2892, 0.363]}, {"w": "time", "b": [0.2955, 0.3433, 0.3403, 0.363]}, {"w": "tuning", "b": [0.3466, 0.3433, 0.4111, 0.363]}, {"w": "parameters", "b": [0.4174, 0.3433, 0.5281, 0.363]}, {"w": "by", "b": [0.5344, 0.3433, 0.5596, 0.363]}, {"w": "hand.", "b": [0.5659, 0.3433, 0.6213, 0.363]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 6.16. Training and validation loss on IMDB with LSTM", "words": [{"w": "Figure", "b": [0.1294, 0.3856, 0.1827, 0.4004]}, {"w": "6.16.", "b": [0.1874, 0.3856, 0.2252, 0.4004]}, {"w": "Training", "b": [0.2299, 0.3856, 0.3, 0.4004]}, {"w": "and", "b": [0.3048, 0.3856, 0.3353, 0.4004]}, {"w": "validation", "b": [0.34, 0.3856, 0.4209, 0.4004]}, {"w": "loss", "b": [0.4257, 0.3856, 0.4551, 0.4004]}, {"w": "on", "b": [0.4598, 0.3856, 0.4798, 0.4004]}, {"w": "IMDB", "b": [0.4846, 0.3856, 0.5361, 0.4004]}, {"w": "with", "b": [0.5408, 0.3856, 0.5765, 0.4004]}, {"w": "LSTM", "b": [0.5812, 0.3856, 0.6349, 0.4004]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 6.17. Training and validation accuracy on IMDB with LSTM", "words": [{"w": "Figure", "b": [0.1294, 0.6859, 0.1827, 0.7007]}, {"w": "6.17.", "b": [0.1874, 0.6859, 0.2252, 0.7007]}, {"w": "Training", "b": [0.2299, 0.6859, 0.3, 0.7007]}, {"w": "and", "b": [0.3048, 0.6859, 0.3353, 0.7007]}, {"w": "validation", "b": [0.34, 0.6859, 0.4209, 0.7007]}, {"w": "accuracy", "b": [0.4257, 0.6859, 0.4982, 0.7007]}, {"w": "on", "b": [0.5029, 0.6859, 0.5229, 0.7007]}, {"w": "IMDB", "b": [0.5276, 0.6859, 0.5791, 0.7007]}, {"w": "with", "b": [0.5838, 0.6859, 0.6196, 0.7007]}, {"w": "LSTM", "b": [0.6243, 0.6859, 0.6779, 0.7007]}]}]}, {"page": 272, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 6.27. Using the LSTM layer in Keras", "words": [{"w": "Listing", "b": [0.1294, 0.3526, 0.1862, 0.3674]}, {"w": "6.27.", "b": [0.1909, 0.3526, 0.2288, 0.3674]}, {"w": "Using", "b": [0.2335, 0.3526, 0.2797, 0.3674]}, {"w": "the", "b": [0.2845, 0.3526, 0.3097, 0.3674]}, {"w": "LSTM", "b": [0.3144, 0.3534, 0.3598, 0.3685]}, {"w": "layer", "b": [0.3645, 0.3526, 0.4055, 0.3674]}, {"w": "in", "b": [0.4103, 0.3526, 0.426, 0.3674]}, {"w": "Keras", "b": [0.4308, 0.3526, 0.4791, 0.3674]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras.layers import LSTM model = Sequential() model.add(Embedding(max_features, 32)) model.add(LSTM(32)) model.add(Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(input_train, y_train, epochs=10, batch_size=128, validation_split=0.2)", "words": [{"w": "from", "b": [0.1357, 0.3819, 0.1811, 0.397]}, {"w": "keras.layers", "b": [0.1925, 0.3819, 0.3287, 0.397]}, {"w": "import", "b": [0.34, 0.3819, 0.4082, 0.397]}, {"w": "LSTM", "b": [0.4195, 0.3819, 0.4649, 0.397]}, {"w": "model", "b": [0.1357, 0.4122, 0.1925, 0.4273]}, {"w": "=", "b": [0.2038, 0.4122, 0.2152, 0.4273]}, {"w": "Sequential()", "b": [0.2265, 0.4122, 0.3628, 0.4273]}, {"w": "model.add(Embedding(max_features,", "b": [0.1357, 0.4274, 0.5103, 0.4425]}, {"w": "32))", "b": [0.5217, 0.4274, 0.5671, 0.4425]}, {"w": "model.add(LSTM(32))", "b": [0.1357, 0.4425, 0.3514, 0.4576]}, {"w": "model.add(Dense(1,", "b": [0.1357, 0.4577, 0.34, 0.4728]}, {"w": "activation='sigmoid'))", "b": [0.3514, 0.4577, 0.6011, 0.4728]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.488, 0.5217, 0.5031]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.5031, 0.6011, 0.5183]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.5183, 0.4763, 0.5334]}, {"w": "history", "b": [0.1357, 0.5334, 0.2152, 0.5486]}, {"w": "=", "b": [0.2265, 0.5334, 0.2379, 0.5486]}, {"w": "model.fit(input_train,", "b": [0.2492, 0.5334, 0.499, 0.5486]}, {"w": "y_train,", "b": [0.5103, 0.5334, 0.6011, 0.5486]}, {"w": "epochs=10,", "b": [0.3628, 0.5486, 0.4763, 0.5637]}, {"w": "batch_size=128,", "b": [0.3628, 0.5637, 0.533, 0.5789]}, {"w": "validation_split=0.2)", "b": [0.3628, 0.5789, 0.6011, 0.594]}]}, {"id": "b_2", "type": "paragraph", "text": "This time, you achieve up to 89% validation accuracy. Not bad: certainly much better than the SimpleRNN network—that’s largely because LSTM suffers much less from the vanishing-gradient problem—and slightly better than the fully connected approach from chapter 3, even though you’re looking at less data than you were in chapter 3. You’re truncating sequences after 500 timesteps, whereas in chapter 3, you were considering full sequences.", "words": [{"w": "This", "b": [0.1294, 0.6169, 0.1743, 0.6366]}, {"w": "time,", "b": [0.1806, 0.6169, 0.2317, 0.6366]}, {"w": "you", "b": [0.238, 0.6169, 0.2759, 0.6366]}, {"w": "achieve", "b": [0.2822, 0.6169, 0.3592, 0.6366]}, {"w": "up", "b": [0.3655, 0.6169, 0.3908, 0.6366]}, {"w": "to", "b": [0.3971, 0.6169, 0.4167, 0.6366]}, {"w": "89%", "b": [0.423, 0.6169, 0.4692, 0.6366]}, {"w": "validation", "b": [0.4755, 0.6169, 0.5764, 0.6366]}, {"w": "accuracy.", "b": [0.5827, 0.6169, 0.677, 0.6366]}, {"w": "Not", "b": [0.6833, 0.6169, 0.7211, 0.6366]}, {"w": "bad:", "b": [0.7274, 0.6169, 0.7708, 0.6366]}, {"w": "certainly", "b": [0.7771, 0.6169, 0.8654, 0.6366]}, {"w": "much", "b": [0.1294, 0.6374, 0.1855, 0.6571]}, {"w": "better", "b": [0.1918, 0.6374, 0.2492, 0.6571]}, {"w": "than", "b": [0.2555, 0.6374, 0.299, 0.6571]}, {"w": "the", "b": [0.3053, 0.6374, 0.3361, 0.6571]}, {"w": "SimpleRNN", "b": [0.3424, 0.6384, 0.4786, 0.6586]}, {"w": "network—that’s", "b": [0.4849, 0.6374, 0.6474, 0.6571]}, {"w": "largely", "b": [0.6537, 0.6374, 0.7233, 0.6571]}, {"w": "because", "b": [0.7296, 0.6374, 0.8095, 0.6571]}, {"w": "LSTM", "b": [0.1294, 0.6588, 0.1967, 0.6785]}, {"w": "suffers", "b": [0.203, 0.6588, 0.2712, 0.6785]}, {"w": "much", "b": [0.2775, 0.6588, 0.3335, 0.6785]}, {"w": "less", "b": [0.3398, 0.6588, 0.3777, 0.6785]}, {"w": "from", "b": [0.384, 0.6588, 0.433, 0.6785]}, {"w": "the", "b": [0.4393, 0.6588, 0.4702, 0.6785]}, {"w": "vanishing-gradient", "b": [0.4765, 0.6588, 0.6656, 0.6785]}, {"w": "problem—and", "b": [0.6719, 0.6588, 0.8177, 0.6785]}, {"w": "slightly", "b": [0.1294, 0.6793, 0.2051, 0.699]}, {"w": "better", "b": [0.2114, 0.6793, 0.2689, 0.699]}, {"w": "than", "b": [0.2752, 0.6793, 0.3186, 0.699]}, {"w": "the", "b": [0.3249, 0.6793, 0.3557, 0.699]}, {"w": "fully", "b": [0.362, 0.6793, 0.4097, 0.699]}, {"w": "connected", "b": [0.4159, 0.6793, 0.5182, 0.699]}, {"w": "approach", "b": [0.5245, 0.6793, 0.617, 0.699]}, {"w": "from", "b": [0.6233, 0.6793, 0.6723, 0.699]}, {"w": "chapter", "b": [0.6786, 0.6793, 0.7528, 0.699]}, {"w": "3,", "b": [0.7591, 0.6793, 0.778, 0.699]}, {"w": "even", "b": [0.7843, 0.6793, 0.8319, 0.699]}, {"w": "though", "b": [0.1294, 0.6998, 0.1995, 0.7195]}, {"w": "you’re", "b": [0.2058, 0.6998, 0.2716, 0.7195]}, {"w": "looking", "b": [0.2779, 0.6998, 0.355, 0.7195]}, {"w": "at", "b": [0.3613, 0.6998, 0.3796, 0.7195]}, {"w": "less", "b": [0.3859, 0.6998, 0.4237, 0.7195]}, {"w": "data", "b": [0.43, 0.6998, 0.472, 0.7195]}, {"w": "than", "b": [0.4783, 0.6998, 0.5218, 0.7195]}, {"w": "you", "b": [0.5281, 0.6998, 0.5659, 0.7195]}, {"w": "were", "b": [0.5722, 0.6998, 0.6212, 0.7195]}, {"w": "in", "b": [0.6275, 0.6998, 0.6472, 0.7195]}, {"w": "chapter", "b": [0.6534, 0.6998, 0.7277, 0.7195]}, {"w": "3.", "b": [0.734, 0.6998, 0.7529, 0.7195]}, {"w": "You’re", "b": [0.7592, 0.6998, 0.8281, 0.7195]}, {"w": "truncating", "b": [0.1294, 0.7203, 0.2317, 0.74]}, {"w": "sequences", "b": [0.238, 0.7203, 0.3403, 0.74]}, {"w": "after", "b": [0.3466, 0.7203, 0.3928, 0.74]}, {"w": "500", "b": [0.3991, 0.7203, 0.4369, 0.74]}, {"w": "timesteps,", "b": [0.4432, 0.7203, 0.5449, 0.74]}, {"w": "whereas", "b": [0.5512, 0.7203, 0.6338, 0.74]}, {"w": "in", "b": [0.6401, 0.7203, 0.6597, 0.74]}, {"w": "chapter", "b": [0.666, 0.7203, 0.7402, 0.74]}, {"w": "3,", "b": [0.7465, 0.7203, 0.7654, 0.74]}, {"w": "you", "b": [0.7717, 0.7203, 0.8096, 0.74]}, {"w": "were", "b": [0.8159, 0.7203, 0.8649, 0.74]}, {"w": "considering", "b": [0.1294, 0.7408, 0.2471, 0.7605]}, {"w": "full", "b": [0.2534, 0.7408, 0.2885, 0.7605]}, {"w": "sequences.", "b": [0.2948, 0.7408, 0.4033, 0.7605]}]}, {"id": "b_3", "type": "paragraph", "text": "But this result isn’t groundbreaking for such a computationally intensive approach. Why isn’t LSTM performing better? One reason is that you made no effort to tune hyperparameters such as the embeddings dimensionality or the LSTM output dimensionality. Another may be lack of regularization. But honestly, the primary reason is that analyzing the global, long-term structure of the reviews (what LSTM is good at) isn’t", "words": [{"w": "But", "b": [0.1294, 0.7836, 0.1659, 0.8033]}, {"w": "this", "b": [0.1722, 0.7836, 0.2086, 0.8033]}, {"w": "result", "b": [0.2149, 0.7836, 0.271, 0.8033]}, {"w": "isn’t", "b": [0.2773, 0.7836, 0.3217, 0.8033]}, {"w": "groundbreaking", "b": [0.328, 0.7836, 0.4877, 0.8033]}, {"w": "for", "b": [0.494, 0.7836, 0.5234, 0.8033]}, {"w": "such", "b": [0.5297, 0.7836, 0.576, 0.8033]}, {"w": "a", "b": [0.5823, 0.7836, 0.5935, 0.8033]}, {"w": "computationally", "b": [0.5998, 0.7836, 0.7637, 0.8033]}, {"w": "intensive", "b": [0.7701, 0.7836, 0.8611, 0.8033]}, {"w": "approach.", "b": [0.1294, 0.8041, 0.2282, 0.8238]}, {"w": "Why", "b": [0.2345, 0.8041, 0.2835, 0.8238]}, {"w": "isn’t", "b": [0.2898, 0.8041, 0.3342, 0.8238]}, {"w": "LSTM", "b": [0.3405, 0.8041, 0.4078, 0.8238]}, {"w": "performing", "b": [0.4141, 0.8041, 0.5276, 0.8238]}, {"w": "better?", "b": [0.5339, 0.8041, 0.6025, 0.8238]}, {"w": "One", "b": [0.6088, 0.8041, 0.6509, 0.8238]}, {"w": "reason", "b": [0.6571, 0.8041, 0.723, 0.8238]}, {"w": "is", "b": [0.7293, 0.8041, 0.7461, 0.8238]}, {"w": "that", "b": [0.7524, 0.8041, 0.7902, 0.8238]}, {"w": "you", "b": [0.7965, 0.8041, 0.8344, 0.8238]}, {"w": "made", "b": [0.1294, 0.8246, 0.1841, 0.8443]}, {"w": "no", "b": [0.1904, 0.8246, 0.2156, 0.8443]}, {"w": "effort", "b": [0.2219, 0.8246, 0.2774, 0.8443]}, {"w": "to", "b": [0.2838, 0.8246, 0.3034, 0.8443]}, {"w": "tune", "b": [0.3097, 0.8246, 0.3531, 0.8443]}, {"w": "hyperparameters", "b": [0.3594, 0.8246, 0.5275, 0.8443]}, {"w": "such", "b": [0.5338, 0.8246, 0.5801, 0.8443]}, {"w": "as", "b": [0.5864, 0.8246, 0.6074, 0.8443]}, {"w": "the", "b": [0.6137, 0.8246, 0.6445, 0.8443]}, {"w": "embeddings", "b": [0.6508, 0.8246, 0.7728, 0.8443]}, {"w": "dimensionality", "b": [0.1294, 0.8451, 0.2794, 0.8648]}, {"w": "or", "b": [0.2857, 0.8451, 0.3067, 0.8648]}, {"w": "the", "b": [0.313, 0.8451, 0.3438, 0.8648]}, {"w": "LSTM", "b": [0.3501, 0.8451, 0.4174, 0.8648]}, {"w": "output", "b": [0.4237, 0.8451, 0.4882, 0.8648]}, {"w": "dimensionality.", "b": [0.4945, 0.8451, 0.6491, 0.8648]}, {"w": "Another", "b": [0.6554, 0.8451, 0.738, 0.8648]}, {"w": "may", "b": [0.7443, 0.8451, 0.7878, 0.8648]}, {"w": "be", "b": [0.7941, 0.8451, 0.8179, 0.8648]}, {"w": "lack", "b": [0.8242, 0.8451, 0.8662, 0.8648]}, {"w": "of", "b": [0.1294, 0.8656, 0.1504, 0.8853]}, {"w": "regularization.", "b": [0.1567, 0.8656, 0.3031, 0.8853]}, {"w": "But", "b": [0.3094, 0.8656, 0.3459, 0.8853]}, {"w": "honestly,", "b": [0.3522, 0.8656, 0.4423, 0.8853]}, {"w": "the", "b": [0.4486, 0.8656, 0.4795, 0.8853]}, {"w": "primary", "b": [0.4858, 0.8656, 0.5656, 0.8853]}, {"w": "reason", "b": [0.5719, 0.8656, 0.6378, 0.8853]}, {"w": "is", "b": [0.6441, 0.8656, 0.6609, 0.8853]}, {"w": "that", "b": [0.6672, 0.8656, 0.705, 0.8853]}, {"w": "analyzing", "b": [0.7114, 0.8656, 0.8094, 0.8853]}, {"w": "the", "b": [0.8157, 0.8656, 0.8466, 0.8853]}, {"w": "global,", "b": [0.1294, 0.8861, 0.1988, 0.9058]}, {"w": "long-term", "b": [0.2051, 0.8861, 0.3046, 0.9058]}, {"w": "structure", "b": [0.3109, 0.8861, 0.3992, 0.9058]}, {"w": "of", "b": [0.4054, 0.8861, 0.4264, 0.9058]}, {"w": "the", "b": [0.4327, 0.8861, 0.4636, 0.9058]}, {"w": "reviews", "b": [0.4699, 0.8861, 0.5483, 0.9058]}, {"w": "(what", "b": [0.5546, 0.8861, 0.6121, 0.9058]}, {"w": "LSTM", "b": [0.6184, 0.8861, 0.6857, 0.9058]}, {"w": "is", "b": [0.692, 0.8861, 0.7088, 0.9058]}, {"w": "good", "b": [0.7151, 0.8861, 0.7655, 0.9058]}, {"w": "at)", "b": [0.7718, 0.8861, 0.7985, 0.9058]}, {"w": "isn’t", "b": [0.8048, 0.8861, 0.8491, 0.9058]}]}]}, {"page": 273, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "helpful for a sentiment-analysis problem. Such a basic problem is well solved by looking at what words occur in each review, and at what frequency. That’s what the first fully connected approach looked at. But there are far more difficult natural--language-processing problems out there, where the strength of LSTM will become apparent: in particular, question-answering and machine translation.", "words": [{"w": "helpful", "b": [0.1294, 0.0857, 0.2009, 0.1054]}, {"w": "for", "b": [0.2072, 0.0857, 0.2366, 0.1054]}, {"w": "a", "b": [0.2429, 0.0857, 0.2541, 0.1054]}, {"w": "sentiment-analysis", "b": [0.2604, 0.0857, 0.4482, 0.1054]}, {"w": "problem.", "b": [0.4545, 0.0857, 0.5449, 0.1054]}, {"w": "Such", "b": [0.5512, 0.0857, 0.6016, 0.1054]}, {"w": "a", "b": [0.6079, 0.0857, 0.6191, 0.1054]}, {"w": "basic", "b": [0.6255, 0.0857, 0.6773, 0.1054]}, {"w": "problem", "b": [0.6836, 0.0857, 0.7677, 0.1054]}, {"w": "is", "b": [0.774, 0.0857, 0.7908, 0.1054]}, {"w": "well", "b": [0.7971, 0.0857, 0.8406, 0.1054]}, {"w": "solved", "b": [0.1294, 0.1062, 0.1953, 0.1259]}, {"w": "by", "b": [0.2016, 0.1062, 0.2268, 0.1259]}, {"w": "looking", "b": [0.2331, 0.1062, 0.3102, 0.1259]}, {"w": "at", "b": [0.3165, 0.1062, 0.3347, 0.1259]}, {"w": "what", "b": [0.341, 0.1062, 0.39, 0.1259]}, {"w": "words", "b": [0.3964, 0.1062, 0.458, 0.1259]}, {"w": "occur", "b": [0.4643, 0.1062, 0.5203, 0.1259]}, {"w": "in", "b": [0.5266, 0.1062, 0.5463, 0.1259]}, {"w": "each", "b": [0.5526, 0.1062, 0.5988, 0.1259]}, {"w": "review,", "b": [0.6051, 0.1062, 0.6784, 0.1259]}, {"w": "and", "b": [0.6847, 0.1062, 0.7211, 0.1259]}, {"w": "at", "b": [0.7274, 0.1062, 0.7456, 0.1259]}, {"w": "what", "b": [0.7519, 0.1062, 0.801, 0.1259]}, {"w": "frequency.", "b": [0.1294, 0.1267, 0.2349, 0.1464]}, {"w": "That’s", "b": [0.2412, 0.1267, 0.3043, 0.1464]}, {"w": "what", "b": [0.3106, 0.1267, 0.3596, 0.1464]}, {"w": "the", "b": [0.3659, 0.1267, 0.3968, 0.1464]}, {"w": "first", "b": [0.4031, 0.1267, 0.4437, 0.1464]}, {"w": "fully", "b": [0.45, 0.1267, 0.4977, 0.1464]}, {"w": "connected", "b": [0.504, 0.1267, 0.6062, 0.1464]}, {"w": "approach", "b": [0.6125, 0.1267, 0.705, 0.1464]}, {"w": "looked", "b": [0.7113, 0.1267, 0.78, 0.1464]}, {"w": "at.", "b": [0.7862, 0.1267, 0.8107, 0.1464]}, {"w": "But", "b": [0.817, 0.1267, 0.8535, 0.1464]}, {"w": "there", "b": [0.1294, 0.1472, 0.1798, 0.1669]}, {"w": "are", "b": [0.1861, 0.1472, 0.2169, 0.1669]}, {"w": "far", "b": [0.2233, 0.1472, 0.2513, 0.1669]}, {"w": "more", "b": [0.2576, 0.1472, 0.3094, 0.1669]}, {"w": "difficult", "b": [0.3157, 0.1472, 0.3965, 0.1669]}, {"w": "natural--language-processing", "b": [0.4028, 0.1472, 0.697, 0.1669]}, {"w": "problems", "b": [0.7033, 0.1472, 0.7972, 0.1669]}, {"w": "out", "b": [0.8035, 0.1472, 0.8357, 0.1669]}, {"w": "there,", "b": [0.1294, 0.1677, 0.1861, 0.1874]}, {"w": "where", "b": [0.1925, 0.1677, 0.2541, 0.1874]}, {"w": "the", "b": [0.2604, 0.1677, 0.2912, 0.1874]}, {"w": "strength", "b": [0.2975, 0.1677, 0.3788, 0.1874]}, {"w": "of", "b": [0.3851, 0.1677, 0.4061, 0.1874]}, {"w": "LSTM", "b": [0.4124, 0.1677, 0.4797, 0.1874]}, {"w": "will", "b": [0.486, 0.1677, 0.5253, 0.1874]}, {"w": "become", "b": [0.5316, 0.1677, 0.61, 0.1874]}, {"w": "apparent:", "b": [0.6162, 0.1677, 0.7101, 0.1874]}, {"w": "in", "b": [0.7164, 0.1677, 0.736, 0.1874]}, {"w": "particular,", "b": [0.7424, 0.1677, 0.8443, 0.1874]}, {"w": "question-answering", "b": [0.1294, 0.1882, 0.327, 0.2079]}, {"w": "and", "b": [0.3333, 0.1882, 0.3697, 0.2079]}, {"w": "machine", "b": [0.376, 0.1882, 0.4615, 0.2079]}, {"w": "translation.", "b": [0.4678, 0.1882, 0.5806, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "6.2.4. Wrapping up", "words": [{"w": "6.2.4.", "b": [0.1294, 0.2354, 0.1862, 0.2552]}, {"w": "Wrapping", "b": [0.1925, 0.2354, 0.3028, 0.2552]}, {"w": "up", "b": [0.3091, 0.2354, 0.3371, 0.2552]}]}, {"id": "b_2", "type": "paragraph", "text": "Now you understand the following:", "words": [{"w": "Now", "b": [0.1294, 0.2782, 0.1785, 0.2979]}, {"w": "you", "b": [0.1848, 0.2782, 0.2226, 0.2979]}, {"w": "understand", "b": [0.2289, 0.2782, 0.3396, 0.2979]}, {"w": "the", "b": [0.3459, 0.2782, 0.3767, 0.2979]}, {"w": "following:", "b": [0.383, 0.2782, 0.4881, 0.2979]}]}, {"id": "b_3", "type": "paragraph", "text": "What RNNs are and how they work What LSTM is, and why it works better on long sequences than a naive RNN How to use Keras RNN layers to process sequence data", "words": [{"w": "What", "b": [0.1799, 0.3165, 0.2345, 0.3363]}, {"w": "RNNs", "b": [0.2408, 0.3165, 0.3039, 0.3363]}, {"w": "are", "b": [0.3102, 0.3165, 0.341, 0.3363]}, {"w": "and", "b": [0.3473, 0.3165, 0.3837, 0.3363]}, {"w": "how", "b": [0.39, 0.3165, 0.4335, 0.3363]}, {"w": "they", "b": [0.4398, 0.3165, 0.4832, 0.3363]}, {"w": "work", "b": [0.4895, 0.3165, 0.5413, 0.3363]}, {"w": "What", "b": [0.1799, 0.337, 0.2345, 0.3568]}, {"w": "LSTM", "b": [0.2408, 0.337, 0.3081, 0.3568]}, {"w": "is,", "b": [0.3144, 0.337, 0.3375, 0.3568]}, {"w": "and", "b": [0.3438, 0.337, 0.3803, 0.3568]}, {"w": "why", "b": [0.3866, 0.337, 0.43, 0.3568]}, {"w": "it", "b": [0.4363, 0.337, 0.4503, 0.3568]}, {"w": "works", "b": [0.4566, 0.337, 0.5183, 0.3568]}, {"w": "better", "b": [0.5246, 0.337, 0.582, 0.3568]}, {"w": "on", "b": [0.5883, 0.337, 0.6136, 0.3568]}, {"w": "long", "b": [0.6199, 0.337, 0.6647, 0.3568]}, {"w": "sequences", "b": [0.671, 0.337, 0.7733, 0.3568]}, {"w": "than", "b": [0.7796, 0.337, 0.823, 0.3568]}, {"w": "a", "b": [0.8294, 0.337, 0.8406, 0.3568]}, {"w": "naive", "b": [0.1799, 0.3575, 0.2345, 0.3773]}, {"w": "RNN", "b": [0.2408, 0.3575, 0.2941, 0.3773]}, {"w": "How", "b": [0.1799, 0.378, 0.2289, 0.3978]}, {"w": "to", "b": [0.2352, 0.378, 0.2548, 0.3978]}, {"w": "use", "b": [0.2611, 0.378, 0.2948, 0.3978]}, {"w": "Keras", "b": [0.3011, 0.378, 0.3599, 0.3978]}, {"w": "RNN", "b": [0.3662, 0.378, 0.4195, 0.3978]}, {"w": "layers", "b": [0.4258, 0.378, 0.486, 0.3978]}, {"w": "to", "b": [0.4923, 0.378, 0.5119, 0.3978]}, {"w": "process", "b": [0.5182, 0.378, 0.5939, 0.3978]}, {"w": "sequence", "b": [0.6002, 0.378, 0.6927, 0.3978]}, {"w": "data", "b": [0.699, 0.378, 0.741, 0.3978]}]}, {"id": "b_4", "type": "paragraph", "text": "Next, we’ll review a number of more advanced features of RNNs, which can help you get the most out of your deep-learning sequence models.", "words": [{"w": "Next,", "b": [0.1294, 0.4208, 0.1848, 0.4406]}, {"w": "we’ll", "b": [0.1911, 0.4208, 0.2429, 0.4406]}, {"w": "review", "b": [0.2492, 0.4208, 0.3178, 0.4406]}, {"w": "a", "b": [0.3242, 0.4208, 0.3354, 0.4406]}, {"w": "number", "b": [0.3417, 0.4208, 0.4187, 0.4406]}, {"w": "of", "b": [0.425, 0.4208, 0.446, 0.4406]}, {"w": "more", "b": [0.4524, 0.4208, 0.5042, 0.4406]}, {"w": "advanced", "b": [0.5105, 0.4208, 0.6058, 0.4406]}, {"w": "features", "b": [0.6121, 0.4208, 0.6919, 0.4406]}, {"w": "of", "b": [0.6982, 0.4208, 0.7192, 0.4406]}, {"w": "RNNs,", "b": [0.7255, 0.4208, 0.7949, 0.4406]}, {"w": "which", "b": [0.8012, 0.4208, 0.8629, 0.4406]}, {"w": "can", "b": [0.1294, 0.4413, 0.1644, 0.4611]}, {"w": "help", "b": [0.1707, 0.4413, 0.2142, 0.4611]}, {"w": "you", "b": [0.2205, 0.4413, 0.2583, 0.4611]}, {"w": "get", "b": [0.2646, 0.4413, 0.2954, 0.4611]}, {"w": "the", "b": [0.3018, 0.4413, 0.3326, 0.4611]}, {"w": "most", "b": [0.3389, 0.4413, 0.388, 0.4611]}, {"w": "out", "b": [0.3943, 0.4413, 0.4265, 0.4611]}, {"w": "of", "b": [0.4328, 0.4413, 0.4538, 0.4611]}, {"w": "your", "b": [0.4601, 0.4413, 0.5064, 0.4611]}, {"w": "deep-learning", "b": [0.5127, 0.4413, 0.6514, 0.4611]}, {"w": "sequence", "b": [0.6577, 0.4413, 0.7501, 0.4611]}, {"w": "models.", "b": [0.7563, 0.4413, 0.8355, 0.4611]}]}, {"id": "b_5", "type": "paragraph", "text": "6.3. Advanced use of recurrent neural networks", "words": [{"w": "6.3.", "b": [0.1294, 0.4982, 0.172, 0.5204]}, {"w": "Advanced", "b": [0.1791, 0.4982, 0.3005, 0.5204]}, {"w": "use", "b": [0.3076, 0.4982, 0.347, 0.5204]}, {"w": "of", "b": [0.3541, 0.4982, 0.3777, 0.5204]}, {"w": "recurrent", "b": [0.3848, 0.4982, 0.5004, 0.5204]}, {"w": "neural", "b": [0.5075, 0.4982, 0.5863, 0.5204]}, {"w": "networks", "b": [0.5934, 0.4982, 0.7054, 0.5204]}]}, {"id": "b_6", "type": "paragraph", "text": "In this section, we’ll review three advanced techniques for improving the performance and generalization power of recurrent neural networks. By the end of the section, you’ll know most of what there is to know about using recurrent networks with Keras. We’ll demonstrate all three concepts on a temperature-forecasting problem, where you have access to a timeseries of data points coming from sensors installed on the roof of a building, such as temperature, air pressure, and humidity, which you use to predict what the temperature will be 24 hours after the last data point. This is a fairly challenging problem that exemplifies many common difficulties encountered when working with timeseries.", "words": [{"w": "In", "b": [0.1294, 0.5438, 0.1504, 0.5636]}, {"w": "this", "b": [0.1567, 0.5438, 0.1932, 0.5636]}, {"w": "section,", "b": [0.1995, 0.5438, 0.2773, 0.5636]}, {"w": "we’ll", "b": [0.2836, 0.5438, 0.3354, 0.5636]}, {"w": "review", "b": [0.3417, 0.5438, 0.4104, 0.5636]}, {"w": "three", "b": [0.4167, 0.5438, 0.4671, 0.5636]}, {"w": "advanced", "b": [0.4734, 0.5438, 0.5686, 0.5636]}, {"w": "techniques", "b": [0.5749, 0.5438, 0.6828, 0.5636]}, {"w": "for", "b": [0.6891, 0.5438, 0.7186, 0.5636]}, {"w": "improving", "b": [0.7249, 0.5438, 0.83, 0.5636]}, {"w": "the", "b": [0.8363, 0.5438, 0.8671, 0.5636]}, {"w": "performance", "b": [0.1294, 0.5643, 0.2569, 0.5841]}, {"w": "and", "b": [0.2632, 0.5643, 0.2996, 0.5841]}, {"w": "generalization", "b": [0.3059, 0.5643, 0.4488, 0.5841]}, {"w": "power", "b": [0.4551, 0.5643, 0.5182, 0.5841]}, {"w": "of", "b": [0.5245, 0.5643, 0.5455, 0.5841]}, {"w": "recurrent", "b": [0.5518, 0.5643, 0.6428, 0.5841]}, {"w": "neural", "b": [0.6491, 0.5643, 0.7121, 0.5841]}, {"w": "networks.", "b": [0.7184, 0.5643, 0.8172, 0.5841]}, {"w": "By", "b": [0.8235, 0.5643, 0.8529, 0.5841]}, {"w": "the", "b": [0.1294, 0.5848, 0.1602, 0.6046]}, {"w": "end", "b": [0.1665, 0.5848, 0.203, 0.6046]}, {"w": "of", "b": [0.2093, 0.5848, 0.2303, 0.6046]}, {"w": "the", "b": [0.2366, 0.5848, 0.2674, 0.6046]}, {"w": "section,", "b": [0.2737, 0.5848, 0.3515, 0.6046]}, {"w": "you’ll", "b": [0.3578, 0.5848, 0.4181, 0.6046]}, {"w": "know", "b": [0.4244, 0.5848, 0.4804, 0.6046]}, {"w": "most", "b": [0.4867, 0.5848, 0.5358, 0.6046]}, {"w": "of", "b": [0.5421, 0.5848, 0.5631, 0.6046]}, {"w": "what", "b": [0.5694, 0.5848, 0.6185, 0.6046]}, {"w": "there", "b": [0.6248, 0.5848, 0.6752, 0.6046]}, {"w": "is", "b": [0.6815, 0.5848, 0.6983, 0.6046]}, {"w": "to", "b": [0.7046, 0.5848, 0.7243, 0.6046]}, {"w": "know", "b": [0.7306, 0.5848, 0.7866, 0.6046]}, {"w": "about", "b": [0.7929, 0.5848, 0.849, 0.6046]}, {"w": "using", "b": [0.1294, 0.6053, 0.1841, 0.6251]}, {"w": "recurrent", "b": [0.1904, 0.6053, 0.2814, 0.6251]}, {"w": "networks", "b": [0.2877, 0.6053, 0.3802, 0.6251]}, {"w": "with", "b": [0.3865, 0.6053, 0.4314, 0.6251]}, {"w": "Keras.", "b": [0.4376, 0.6053, 0.5028, 0.6251]}, {"w": "We’ll", "b": [0.5091, 0.6053, 0.5645, 0.6251]}, {"w": "demonstrate", "b": [0.5708, 0.6053, 0.6941, 0.6251]}, {"w": "all", "b": [0.7004, 0.6053, 0.7256, 0.6251]}, {"w": "three", "b": [0.7319, 0.6053, 0.7824, 0.6251]}, {"w": "concepts", "b": [0.1294, 0.6258, 0.2177, 0.6456]}, {"w": "on", "b": [0.224, 0.6258, 0.2492, 0.6456]}, {"w": "a", "b": [0.2555, 0.6258, 0.2667, 0.6456]}, {"w": "temperature-forecasting", "b": [0.273, 0.6258, 0.514, 0.6456]}, {"w": "problem,", "b": [0.5203, 0.6258, 0.6107, 0.6456]}, {"w": "where", "b": [0.617, 0.6258, 0.6786, 0.6456]}, {"w": "you", "b": [0.6849, 0.6258, 0.7227, 0.6456]}, {"w": "have", "b": [0.7291, 0.6258, 0.7767, 0.6456]}, {"w": "access", "b": [0.783, 0.6258, 0.8474, 0.6456]}, {"w": "to", "b": [0.1294, 0.6463, 0.149, 0.6661]}, {"w": "a", "b": [0.1553, 0.6463, 0.1665, 0.6661]}, {"w": "timeseries", "b": [0.1729, 0.6463, 0.2751, 0.6661]}, {"w": "of", "b": [0.2814, 0.6463, 0.3025, 0.6661]}, {"w": "data", "b": [0.3087, 0.6463, 0.3508, 0.6661]}, {"w": "points", "b": [0.3571, 0.6463, 0.4187, 0.6661]}, {"w": "coming", "b": [0.425, 0.6463, 0.5007, 0.6661]}, {"w": "from", "b": [0.507, 0.6463, 0.5561, 0.6661]}, {"w": "sensors", "b": [0.5624, 0.6463, 0.6366, 0.6661]}, {"w": "installed", "b": [0.6429, 0.6463, 0.7284, 0.6661]}, {"w": "on", "b": [0.7347, 0.6463, 0.76, 0.6661]}, {"w": "the", "b": [0.7663, 0.6463, 0.7971, 0.6661]}, {"w": "roof", "b": [0.8034, 0.6463, 0.8454, 0.6661]}, {"w": "of", "b": [0.1294, 0.6668, 0.1504, 0.6866]}, {"w": "a", "b": [0.1567, 0.6668, 0.1679, 0.6866]}, {"w": "building,", "b": [0.1742, 0.6668, 0.2646, 0.6866]}, {"w": "such", "b": [0.271, 0.6668, 0.3172, 0.6866]}, {"w": "as", "b": [0.3235, 0.6668, 0.3445, 0.6866]}, {"w": "temperature,", "b": [0.3508, 0.6668, 0.4776, 0.6866]}, {"w": "air", "b": [0.4839, 0.6668, 0.5105, 0.6866]}, {"w": "pressure,", "b": [0.5168, 0.6668, 0.6072, 0.6866]}, {"w": "and", "b": [0.6135, 0.6668, 0.6499, 0.6866]}, {"w": "humidity,", "b": [0.6562, 0.6668, 0.7519, 0.6866]}, {"w": "which", "b": [0.7582, 0.6668, 0.8199, 0.6866]}, {"w": "you", "b": [0.8262, 0.6668, 0.864, 0.6866]}, {"w": "use", "b": [0.1294, 0.6873, 0.163, 0.7071]}, {"w": "to", "b": [0.1693, 0.6873, 0.189, 0.7071]}, {"w": "predict", "b": [0.1953, 0.6873, 0.2653, 0.7071]}, {"w": "what", "b": [0.2716, 0.6873, 0.3207, 0.7071]}, {"w": "the", "b": [0.327, 0.6873, 0.3578, 0.7071]}, {"w": "temperature", "b": [0.3641, 0.6873, 0.4846, 0.7071]}, {"w": "will", "b": [0.4909, 0.6873, 0.5301, 0.7071]}, {"w": "be", "b": [0.5365, 0.6873, 0.5603, 0.7071]}, {"w": "24", "b": [0.5666, 0.6873, 0.5918, 0.7071]}, {"w": "hours", "b": [0.5981, 0.6873, 0.6542, 0.7071]}, {"w": "after", "b": [0.6605, 0.6873, 0.7067, 0.7071]}, {"w": "the", "b": [0.713, 0.6873, 0.7438, 0.7071]}, {"w": "last", "b": [0.7501, 0.6873, 0.7852, 0.7071]}, {"w": "data", "b": [0.7915, 0.6873, 0.8335, 0.7071]}, {"w": "point.", "b": [0.1294, 0.7078, 0.1876, 0.7276]}, {"w": "This", "b": [0.1939, 0.7078, 0.2387, 0.7276]}, {"w": "is", "b": [0.245, 0.7078, 0.2619, 0.7276]}, {"w": "a", "b": [0.2682, 0.7078, 0.2794, 0.7276]}, {"w": "fairly", "b": [0.2857, 0.7078, 0.3403, 0.7276]}, {"w": "challenging", "b": [0.3466, 0.7078, 0.4643, 0.7276]}, {"w": "problem", "b": [0.4706, 0.7078, 0.5547, 0.7276]}, {"w": "that", "b": [0.561, 0.7078, 0.5989, 0.7276]}, {"w": "exemplifies", "b": [0.6051, 0.7078, 0.7228, 0.7276]}, {"w": "many", "b": [0.7291, 0.7078, 0.7851, 0.7276]}, {"w": "common", "b": [0.1294, 0.7283, 0.2177, 0.7481]}, {"w": "difficulties", "b": [0.224, 0.7283, 0.3328, 0.7481]}, {"w": "encountered", "b": [0.3391, 0.7283, 0.4624, 0.7481]}, {"w": "when", "b": [0.4687, 0.7283, 0.5234, 0.7481]}, {"w": "working", "b": [0.5297, 0.7283, 0.6138, 0.7481]}, {"w": "with", "b": [0.6201, 0.7283, 0.6649, 0.7481]}, {"w": "timeseries.", "b": [0.6712, 0.7283, 0.7798, 0.7481]}]}, {"id": "b_7", "type": "paragraph", "text": "We’ll cover the following techniques:", "words": [{"w": "We’ll", "b": [0.1294, 0.7711, 0.1848, 0.7908]}, {"w": "cover", "b": [0.1911, 0.7711, 0.2472, 0.7908]}, {"w": "the", "b": [0.2535, 0.7711, 0.2843, 0.7908]}, {"w": "following", "b": [0.2906, 0.7711, 0.3887, 0.7908]}, {"w": "techniques:", "b": [0.395, 0.7711, 0.5099, 0.7908]}]}, {"id": "b_8", "type": "paragraph", "text": "Recurrent dropout— This is a specific, built-in way to use dropout to fight overfitting in recurrent layers. Stacking recurrent layers— This increases the representational power of the network (at the cost of higher computational loads).", "words": [{"w": "Recurrent", "b": [0.1799, 0.8094, 0.285, 0.8292]}, {"w": "dropout—", "b": [0.2913, 0.8094, 0.3978, 0.8292]}, {"w": "This", "b": [0.4041, 0.8094, 0.449, 0.8292]}, {"w": "is", "b": [0.4553, 0.8094, 0.4721, 0.8292]}, {"w": "a", "b": [0.4784, 0.8094, 0.4896, 0.8292]}, {"w": "specific,", "b": [0.4959, 0.8094, 0.5807, 0.8292]}, {"w": "built-in", "b": [0.587, 0.8094, 0.6613, 0.8292]}, {"w": "way", "b": [0.6676, 0.8094, 0.7096, 0.8292]}, {"w": "to", "b": [0.7159, 0.8094, 0.7355, 0.8292]}, {"w": "use", "b": [0.7418, 0.8094, 0.7755, 0.8292]}, {"w": "dropout", "b": [0.7818, 0.8094, 0.8602, 0.8292]}, {"w": "to", "b": [0.1799, 0.8299, 0.1995, 0.8497]}, {"w": "fight", "b": [0.2058, 0.8299, 0.2534, 0.8497]}, {"w": "overfitting", "b": [0.2598, 0.8299, 0.3663, 0.8497]}, {"w": "in", "b": [0.3726, 0.8299, 0.3922, 0.8497]}, {"w": "recurrent", "b": [0.3985, 0.8299, 0.4895, 0.8497]}, {"w": "layers.", "b": [0.4958, 0.8299, 0.5624, 0.8497]}, {"w": "Stacking", "b": [0.1799, 0.8504, 0.271, 0.8702]}, {"w": "recurrent", "b": [0.2773, 0.8504, 0.3754, 0.8702]}, {"w": "layers—", "b": [0.3817, 0.8504, 0.4686, 0.8702]}, {"w": "This", "b": [0.4749, 0.8504, 0.5197, 0.8702]}, {"w": "increases", "b": [0.526, 0.8504, 0.6185, 0.8702]}, {"w": "the", "b": [0.6248, 0.8504, 0.6556, 0.8702]}, {"w": "representational", "b": [0.6619, 0.8504, 0.823, 0.8702]}, {"w": "power", "b": [0.1799, 0.8709, 0.2429, 0.8907]}, {"w": "of", "b": [0.2492, 0.8709, 0.2702, 0.8907]}, {"w": "the", "b": [0.2765, 0.8709, 0.3074, 0.8907]}, {"w": "network", "b": [0.3137, 0.8709, 0.3963, 0.8907]}, {"w": "(at", "b": [0.4026, 0.8709, 0.4292, 0.8907]}, {"w": "the", "b": [0.4356, 0.8709, 0.4664, 0.8907]}, {"w": "cost", "b": [0.4727, 0.8709, 0.5133, 0.8907]}, {"w": "of", "b": [0.5196, 0.8709, 0.5406, 0.8907]}, {"w": "higher", "b": [0.5469, 0.8709, 0.6114, 0.8907]}, {"w": "computational", "b": [0.6177, 0.8709, 0.762, 0.8907]}, {"w": "loads).", "b": [0.7684, 0.8709, 0.8363, 0.8907]}]}]}, {"page": 274, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Bidirectional recurrent layers— These present the same information to a recurrent network in different ways, increasing accuracy and mitigating forgetting issues.", "words": [{"w": "Bidirectional", "b": [0.1799, 0.0857, 0.3158, 0.1054]}, {"w": "recurrent", "b": [0.3221, 0.0857, 0.4202, 0.1054]}, {"w": "layers—", "b": [0.4265, 0.0857, 0.5134, 0.1054]}, {"w": "These", "b": [0.5197, 0.0857, 0.5799, 0.1054]}, {"w": "present", "b": [0.5862, 0.0857, 0.6591, 0.1054]}, {"w": "the", "b": [0.6654, 0.0857, 0.6962, 0.1054]}, {"w": "same", "b": [0.7025, 0.0857, 0.7544, 0.1054]}, {"w": "information", "b": [0.1799, 0.1062, 0.299, 0.1259]}, {"w": "to", "b": [0.3053, 0.1062, 0.3249, 0.1259]}, {"w": "a", "b": [0.3312, 0.1062, 0.3424, 0.1259]}, {"w": "recurrent", "b": [0.3487, 0.1062, 0.4398, 0.1259]}, {"w": "network", "b": [0.4461, 0.1062, 0.5287, 0.1259]}, {"w": "in", "b": [0.535, 0.1062, 0.5547, 0.1259]}, {"w": "different", "b": [0.561, 0.1062, 0.6473, 0.1259]}, {"w": "ways,", "b": [0.6536, 0.1062, 0.7118, 0.1259]}, {"w": "increasing", "b": [0.7181, 0.1062, 0.8218, 0.1259]}, {"w": "accuracy", "b": [0.1799, 0.1267, 0.2695, 0.1464]}, {"w": "and", "b": [0.2758, 0.1267, 0.3122, 0.1464]}, {"w": "mitigating", "b": [0.3185, 0.1267, 0.4223, 0.1464]}, {"w": "forgetting", "b": [0.4286, 0.1267, 0.5275, 0.1464]}, {"w": "issues.", "b": [0.5338, 0.1267, 0.6004, 0.1464]}]}, {"id": "b_1", "type": "equation", "text": "6.3.1. A temperature-forecasting problem", "words": [{"w": "6.3.1.", "b": [0.1294, 0.1739, 0.1862, 0.1937]}, {"w": "A", "b": [0.1925, 0.1739, 0.2107, 0.1937]}, {"w": "temperature-forecasting", "b": [0.217, 0.1739, 0.478, 0.1937]}, {"w": "problem", "b": [0.4844, 0.1739, 0.575, 0.1937]}]}, {"id": "b_2", "type": "paragraph", "text": "Until now, the only sequence data we’ve covered has been text data, such as the IMDB dataset and the Reuters dataset. But sequence data is found in many more problems than just language processing. In all the examples in this section, you’ll play with a weather timeseries dataset recorded at the Weather Station at the Max Planck Institute for Biogeochemistry in Jena, Germany.[4]", "words": [{"w": "Until", "b": [0.1294, 0.2167, 0.1813, 0.2364]}, {"w": "now,", "b": [0.1876, 0.2167, 0.2357, 0.2364]}, {"w": "the", "b": [0.242, 0.2167, 0.2728, 0.2364]}, {"w": "only", "b": [0.2791, 0.2167, 0.324, 0.2364]}, {"w": "sequence", "b": [0.3303, 0.2167, 0.4227, 0.2364]}, {"w": "data", "b": [0.429, 0.2167, 0.4711, 0.2364]}, {"w": "we’ve", "b": [0.4774, 0.2167, 0.539, 0.2364]}, {"w": "covered", "b": [0.5453, 0.2167, 0.6251, 0.2364]}, {"w": "has", "b": [0.6315, 0.2167, 0.6651, 0.2364]}, {"w": "been", "b": [0.6714, 0.2167, 0.719, 0.2364]}, {"w": "text", "b": [0.7253, 0.2167, 0.7632, 0.2364]}, {"w": "data,", "b": [0.7695, 0.2167, 0.8178, 0.2364]}, {"w": "such", "b": [0.8241, 0.2167, 0.8703, 0.2364]}, {"w": "as", "b": [0.1294, 0.2372, 0.1504, 0.2569]}, {"w": "the", "b": [0.1567, 0.2372, 0.1876, 0.2569]}, {"w": "IMDB", "b": [0.1939, 0.2372, 0.2597, 0.2569]}, {"w": "dataset", "b": [0.266, 0.2372, 0.3361, 0.2569]}, {"w": "and", "b": [0.3424, 0.2372, 0.3788, 0.2569]}, {"w": "the", "b": [0.3851, 0.2372, 0.416, 0.2569]}, {"w": "Reuters", "b": [0.4223, 0.2372, 0.4993, 0.2569]}, {"w": "dataset.", "b": [0.5056, 0.2372, 0.582, 0.2569]}, {"w": "But", "b": [0.5883, 0.2372, 0.6247, 0.2569]}, {"w": "sequence", "b": [0.631, 0.2372, 0.7234, 0.2569]}, {"w": "data", "b": [0.7297, 0.2372, 0.7718, 0.2569]}, {"w": "is", "b": [0.7781, 0.2372, 0.7949, 0.2569]}, {"w": "found", "b": [0.8012, 0.2372, 0.8601, 0.2569]}, {"w": "in", "b": [0.1294, 0.2577, 0.149, 0.2774]}, {"w": "many", "b": [0.1553, 0.2577, 0.2114, 0.2774]}, {"w": "more", "b": [0.2177, 0.2577, 0.2695, 0.2774]}, {"w": "problems", "b": [0.2758, 0.2577, 0.3697, 0.2774]}, {"w": "than", "b": [0.376, 0.2577, 0.4195, 0.2774]}, {"w": "just", "b": [0.4258, 0.2577, 0.4622, 0.2774]}, {"w": "language", "b": [0.4685, 0.2577, 0.5596, 0.2774]}, {"w": "processing.", "b": [0.5659, 0.2577, 0.6801, 0.2774]}, {"w": "In", "b": [0.6864, 0.2577, 0.7074, 0.2774]}, {"w": "all", "b": [0.7137, 0.2577, 0.739, 0.2774]}, {"w": "the", "b": [0.7453, 0.2577, 0.7761, 0.2774]}, {"w": "examples", "b": [0.1294, 0.2782, 0.2247, 0.2979]}, {"w": "in", "b": [0.231, 0.2782, 0.2506, 0.2979]}, {"w": "this", "b": [0.2569, 0.2782, 0.2934, 0.2979]}, {"w": "section,", "b": [0.2997, 0.2782, 0.3775, 0.2979]}, {"w": "you’ll", "b": [0.3838, 0.2782, 0.444, 0.2979]}, {"w": "play", "b": [0.4503, 0.2782, 0.4938, 0.2979]}, {"w": "with", "b": [0.5, 0.2782, 0.5449, 0.2979]}, {"w": "a", "b": [0.5512, 0.2782, 0.5624, 0.2979]}, {"w": "weather", "b": [0.5687, 0.2782, 0.6485, 0.2979]}, {"w": "timeseries", "b": [0.6548, 0.2782, 0.7571, 0.2979]}, {"w": "dataset", "b": [0.7634, 0.2782, 0.8335, 0.2979]}, {"w": "recorded", "b": [0.1294, 0.2987, 0.2177, 0.3184]}, {"w": "at", "b": [0.224, 0.2987, 0.2422, 0.3184]}, {"w": "the", "b": [0.2485, 0.2987, 0.2793, 0.3184]}, {"w": "Weather", "b": [0.2856, 0.2987, 0.369, 0.3184]}, {"w": "Station", "b": [0.3753, 0.2987, 0.4468, 0.3184]}, {"w": "at", "b": [0.4531, 0.2987, 0.4713, 0.3184]}, {"w": "the", "b": [0.4776, 0.2987, 0.5084, 0.3184]}, {"w": "Max", "b": [0.5148, 0.2987, 0.561, 0.3184]}, {"w": "Planck", "b": [0.5673, 0.2987, 0.636, 0.3184]}, {"w": "Institute", "b": [0.6423, 0.2987, 0.725, 0.3184]}, {"w": "for", "b": [0.7313, 0.2987, 0.7607, 0.3184]}, {"w": "Biogeochemistry", "b": [0.1294, 0.321, 0.3018, 0.3407]}, {"w": "in", "b": [0.3081, 0.321, 0.3277, 0.3407]}, {"w": "Jena,", "b": [0.334, 0.321, 0.3852, 0.3407]}, {"w": "Germany.[4]", "b": [0.3914, 0.3187, 0.512, 0.3407]}]}, {"id": "b_4", "type": "equation", "text": "Olaf Kolle, www.bgc-jena.mpg.de/wetter.", "words": [{"w": "Olaf", "b": [0.1483, 0.3865, 0.182, 0.4013]}, {"w": "Kolle,", "b": [0.1867, 0.3865, 0.2334, 0.4013]}, {"w": "www.bgc-jena.mpg.de/wetter.", "b": [0.2382, 0.3865, 0.466, 0.4013]}]}, {"id": "b_5", "type": "paragraph", "text": "In this dataset, 14 different quantities (such air temperature, atmospheric pressure, humidity, wind direction, and so on) were recorded every 10 minutes, over several years. The original data goes back to 2003, but this example is limited to data from 2009–2016. This dataset is perfect for learning to work with numerical timeseries. You’ll use it to build a model that takes as input some data from the recent past (a few days’ worth of data points) and predicts the air temperature 24 hours in the future.", "words": [{"w": "In", "b": [0.1294, 0.4244, 0.1504, 0.4441]}, {"w": "this", "b": [0.1567, 0.4244, 0.1932, 0.4441]}, {"w": "dataset,", "b": [0.1995, 0.4244, 0.2758, 0.4441]}, {"w": "14", "b": [0.2822, 0.4244, 0.3074, 0.4441]}, {"w": "different", "b": [0.3137, 0.4244, 0.4001, 0.4441]}, {"w": "quantities", "b": [0.4064, 0.4244, 0.5045, 0.4441]}, {"w": "(such", "b": [0.5108, 0.4244, 0.5654, 0.4441]}, {"w": "air", "b": [0.5717, 0.4244, 0.5983, 0.4441]}, {"w": "temperature,", "b": [0.6046, 0.4244, 0.7314, 0.4441]}, {"w": "atmospheric", "b": [0.7377, 0.4244, 0.861, 0.4441]}, {"w": "pressure,", "b": [0.1294, 0.4449, 0.2198, 0.4646]}, {"w": "humidity,", "b": [0.2261, 0.4449, 0.3218, 0.4646]}, {"w": "wind", "b": [0.3282, 0.4449, 0.3786, 0.4646]}, {"w": "direction,", "b": [0.3849, 0.4449, 0.4809, 0.4646]}, {"w": "and", "b": [0.4872, 0.4449, 0.5236, 0.4646]}, {"w": "so", "b": [0.5299, 0.4449, 0.5524, 0.4646]}, {"w": "on)", "b": [0.5587, 0.4449, 0.5923, 0.4646]}, {"w": "were", "b": [0.5986, 0.4449, 0.6476, 0.4646]}, {"w": "recorded", "b": [0.6539, 0.4449, 0.7421, 0.4646]}, {"w": "every", "b": [0.7484, 0.4449, 0.8045, 0.4646]}, {"w": "10", "b": [0.8108, 0.4449, 0.836, 0.4646]}, {"w": "minutes,", "b": [0.1294, 0.4654, 0.2156, 0.4851]}, {"w": "over", "b": [0.2219, 0.4654, 0.2667, 0.4851]}, {"w": "several", "b": [0.273, 0.4654, 0.3445, 0.4851]}, {"w": "years.", "b": [0.3508, 0.4654, 0.4103, 0.4851]}, {"w": "The", "b": [0.4166, 0.4654, 0.4559, 0.4851]}, {"w": "original", "b": [0.4622, 0.4654, 0.5406, 0.4851]}, {"w": "data", "b": [0.5469, 0.4654, 0.589, 0.4851]}, {"w": "goes", "b": [0.5953, 0.4654, 0.6415, 0.4851]}, {"w": "back", "b": [0.6478, 0.4654, 0.6955, 0.4851]}, {"w": "to", "b": [0.7018, 0.4654, 0.7214, 0.4851]}, {"w": "2003,", "b": [0.7277, 0.4654, 0.7844, 0.4851]}, {"w": "but", "b": [0.7908, 0.4654, 0.823, 0.4851]}, {"w": "this", "b": [0.8293, 0.4654, 0.8658, 0.4851]}, {"w": "example", "b": [0.1294, 0.4859, 0.2149, 0.5056]}, {"w": "is", "b": [0.2212, 0.4859, 0.238, 0.5056]}, {"w": "limited", "b": [0.2443, 0.4859, 0.3158, 0.5056]}, {"w": "to", "b": [0.3221, 0.4859, 0.3417, 0.5056]}, {"w": "data", "b": [0.348, 0.4859, 0.3901, 0.5056]}, {"w": "from", "b": [0.3963, 0.4859, 0.4454, 0.5056]}, {"w": "2009–2016.", "b": [0.4517, 0.4859, 0.5715, 0.5056]}, {"w": "This", "b": [0.5778, 0.4859, 0.6226, 0.5056]}, {"w": "dataset", "b": [0.6289, 0.4859, 0.699, 0.5056]}, {"w": "is", "b": [0.7053, 0.4859, 0.7221, 0.5056]}, {"w": "perfect", "b": [0.7284, 0.4859, 0.7985, 0.5056]}, {"w": "for", "b": [0.8048, 0.4859, 0.8342, 0.5056]}, {"w": "learning", "b": [0.1294, 0.5064, 0.2121, 0.5261]}, {"w": "to", "b": [0.2184, 0.5064, 0.238, 0.5261]}, {"w": "work", "b": [0.2443, 0.5064, 0.2962, 0.5261]}, {"w": "with", "b": [0.3025, 0.5064, 0.3473, 0.5261]}, {"w": "numerical", "b": [0.3536, 0.5064, 0.4545, 0.5261]}, {"w": "timeseries.", "b": [0.4608, 0.5064, 0.5694, 0.5261]}, {"w": "You’ll", "b": [0.5757, 0.5064, 0.639, 0.5261]}, {"w": "use", "b": [0.6453, 0.5064, 0.6789, 0.5261]}, {"w": "it", "b": [0.6852, 0.5064, 0.6992, 0.5261]}, {"w": "to", "b": [0.7056, 0.5064, 0.7252, 0.5261]}, {"w": "build", "b": [0.7315, 0.5064, 0.7834, 0.5261]}, {"w": "a", "b": [0.7897, 0.5064, 0.8009, 0.5261]}, {"w": "model", "b": [0.8072, 0.5064, 0.8702, 0.5261]}, {"w": "that", "b": [0.1294, 0.5269, 0.1673, 0.5466]}, {"w": "takes", "b": [0.1735, 0.5269, 0.2254, 0.5466]}, {"w": "as", "b": [0.2317, 0.5269, 0.2527, 0.5466]}, {"w": "input", "b": [0.259, 0.5269, 0.3109, 0.5466]}, {"w": "some", "b": [0.3172, 0.5269, 0.3704, 0.5466]}, {"w": "data", "b": [0.3767, 0.5269, 0.4188, 0.5466]}, {"w": "from", "b": [0.4251, 0.5269, 0.4741, 0.5466]}, {"w": "the", "b": [0.4804, 0.5269, 0.5112, 0.5466]}, {"w": "recent", "b": [0.5175, 0.5269, 0.5792, 0.5466]}, {"w": "past", "b": [0.5855, 0.5269, 0.6261, 0.5466]}, {"w": "(a", "b": [0.6324, 0.5269, 0.652, 0.5466]}, {"w": "few", "b": [0.6583, 0.5269, 0.6961, 0.5466]}, {"w": "days’", "b": [0.7024, 0.5269, 0.7571, 0.5466]}, {"w": "worth", "b": [0.7634, 0.5269, 0.8222, 0.5466]}, {"w": "of", "b": [0.8285, 0.5269, 0.8496, 0.5466]}, {"w": "data", "b": [0.1294, 0.5474, 0.1714, 0.5671]}, {"w": "points)", "b": [0.1777, 0.5474, 0.2478, 0.5671]}, {"w": "and", "b": [0.2541, 0.5474, 0.2906, 0.5671]}, {"w": "predicts", "b": [0.2969, 0.5474, 0.3767, 0.5671]}, {"w": "the", "b": [0.383, 0.5474, 0.4139, 0.5671]}, {"w": "air", "b": [0.4202, 0.5474, 0.4468, 0.5671]}, {"w": "temperature", "b": [0.4531, 0.5474, 0.5736, 0.5671]}, {"w": "24", "b": [0.5799, 0.5474, 0.6051, 0.5671]}, {"w": "hours", "b": [0.6114, 0.5474, 0.6675, 0.5671]}, {"w": "in", "b": [0.6737, 0.5474, 0.6933, 0.5671]}, {"w": "the", "b": [0.6996, 0.5474, 0.7304, 0.5671]}, {"w": "future.", "b": [0.7367, 0.5474, 0.8033, 0.5671]}]}, {"id": "b_6", "type": "paragraph", "text": "Download and uncompress the data as follows:", "words": [{"w": "Download", "b": [0.1294, 0.5902, 0.2345, 0.6099]}, {"w": "and", "b": [0.2408, 0.5902, 0.2772, 0.6099]}, {"w": "uncompress", "b": [0.2835, 0.5902, 0.404, 0.6099]}, {"w": "the", "b": [0.4104, 0.5902, 0.4412, 0.6099]}, {"w": "data", "b": [0.4475, 0.5902, 0.4895, 0.6099]}, {"w": "as", "b": [0.4958, 0.5902, 0.5168, 0.6099]}, {"w": "follows:", "b": [0.5231, 0.5902, 0.6058, 0.6099]}]}, {"id": "b_7", "type": "paragraph", "text": "cd ~/Downloads mkdir jena_climate cd jena_climate wget https://s3.amazonaws.com/keras- datasets/jena_climate_2009_2016.csv.zip unzip jena_climate_2009_2016.csv.zip", "words": [{"w": "cd", "b": [0.1357, 0.6279, 0.1584, 0.643]}, {"w": "~/Downloads", "b": [0.1698, 0.6279, 0.2946, 0.643]}, {"w": "mkdir", "b": [0.1357, 0.643, 0.1925, 0.6582]}, {"w": "jena_climate", "b": [0.2038, 0.643, 0.34, 0.6582]}, {"w": "cd", "b": [0.1357, 0.6582, 0.1584, 0.6733]}, {"w": "jena_climate", "b": [0.1698, 0.6582, 0.306, 0.6733]}, {"w": "wget", "b": [0.1357, 0.6733, 0.1811, 0.6885]}, {"w": "https://s3.amazonaws.com/keras-", "b": [0.1925, 0.6733, 0.5444, 0.6885]}, {"w": "datasets/jena_climate_2009_2016.csv.zip", "b": [0.1357, 0.6885, 0.5784, 0.7036]}, {"w": "unzip", "b": [0.1357, 0.7037, 0.1925, 0.7188]}, {"w": "jena_climate_2009_2016.csv.zip", "b": [0.2038, 0.7037, 0.5444, 0.7188]}]}, {"id": "b_8", "type": "paragraph", "text": "Let’s look at the data.", "words": [{"w": "Let’s", "b": [0.1294, 0.7417, 0.1798, 0.7614]}, {"w": "look", "b": [0.1862, 0.7417, 0.231, 0.7614]}, {"w": "at", "b": [0.2373, 0.7417, 0.2555, 0.7614]}, {"w": "the", "b": [0.2618, 0.7417, 0.2927, 0.7614]}, {"w": "data.", "b": [0.299, 0.7417, 0.3473, 0.7614]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 6.28. Inspecting the data of the Jena weather dataset", "words": [{"w": "Listing", "b": [0.1294, 0.784, 0.1862, 0.7988]}, {"w": "6.28.", "b": [0.1909, 0.784, 0.2288, 0.7988]}, {"w": "Inspecting", "b": [0.2335, 0.784, 0.3176, 0.7988]}, {"w": "the", "b": [0.3223, 0.784, 0.3475, 0.7988]}, {"w": "data", "b": [0.3522, 0.784, 0.388, 0.7988]}, {"w": "of", "b": [0.3927, 0.784, 0.4085, 0.7988]}, {"w": "the", "b": [0.4132, 0.784, 0.4384, 0.7988]}, {"w": "Jena", "b": [0.4432, 0.784, 0.481, 0.7988]}, {"w": "weather", "b": [0.4857, 0.784, 0.5509, 0.7988]}, {"w": "dataset", "b": [0.5556, 0.784, 0.6134, 0.7988]}]}, {"id": "b_10", "type": "paragraph", "text": "import os data_dir = '/users/fchollet/Downloads/jena_climate' fname = os.path.join(data_dir, 'jena_climate_2009_2016.csv') f = open(fname)", "words": [{"w": "import", "b": [0.1357, 0.8124, 0.2038, 0.8275]}, {"w": "os", "b": [0.2152, 0.8124, 0.2379, 0.8275]}, {"w": "data_dir", "b": [0.1357, 0.8427, 0.2265, 0.8578]}, {"w": "=", "b": [0.2379, 0.8427, 0.2492, 0.8578]}, {"w": "'/users/fchollet/Downloads/jena_climate'", "b": [0.2606, 0.8427, 0.7146, 0.8578]}, {"w": "fname", "b": [0.1357, 0.8579, 0.1925, 0.873]}, {"w": "=", "b": [0.2038, 0.8579, 0.2152, 0.873]}, {"w": "os.path.join(data_dir,", "b": [0.2265, 0.8579, 0.4763, 0.873]}, {"w": "'jena_climate_2009_2016.csv')", "b": [0.4876, 0.8579, 0.8168, 0.873]}, {"w": "f", "b": [0.1357, 0.8882, 0.1471, 0.9033]}, {"w": "=", "b": [0.1584, 0.8882, 0.1698, 0.9033]}, {"w": "open(fname)", "b": [0.1811, 0.8882, 0.306, 0.9033]}]}]}, {"page": 275, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "data = f.read() f.close() lines = data.split('\\n') header = lines[0].split(',') lines = lines[1:] print(header) print(len(lines))", "words": [{"w": "data", "b": [0.1357, 0.0851, 0.1811, 0.1002]}, {"w": "=", "b": [0.1925, 0.0851, 0.2038, 0.1002]}, {"w": "f.read()", "b": [0.2152, 0.0851, 0.306, 0.1002]}, {"w": "f.close()", "b": [0.1357, 0.1002, 0.2379, 0.1154]}, {"w": "lines", "b": [0.1357, 0.1305, 0.1925, 0.1457]}, {"w": "=", "b": [0.2038, 0.1305, 0.2152, 0.1457]}, {"w": "data.split('\\n')", "b": [0.2265, 0.1305, 0.4082, 0.1457]}, {"w": "header", "b": [0.1357, 0.1457, 0.2038, 0.1608]}, {"w": "=", "b": [0.2152, 0.1457, 0.2265, 0.1608]}, {"w": "lines[0].split(',')", "b": [0.2379, 0.1457, 0.4536, 0.1608]}, {"w": "lines", "b": [0.1357, 0.1608, 0.1925, 0.176]}, {"w": "=", "b": [0.2038, 0.1608, 0.2152, 0.176]}, {"w": "lines[1:]", "b": [0.2265, 0.1608, 0.3287, 0.176]}, {"w": "print(header)", "b": [0.1357, 0.1912, 0.2833, 0.2063]}, {"w": "print(len(lines))", "b": [0.1357, 0.2063, 0.3287, 0.2214]}]}, {"id": "b_1", "type": "paragraph", "text": "This outputs a count of 420,551 lines of data (each line is a timestep: a record of a date and 14 weather-related values), as well as the following header:", "words": [{"w": "This", "b": [0.1294, 0.2443, 0.1743, 0.2641]}, {"w": "outputs", "b": [0.1806, 0.2443, 0.2549, 0.2641]}, {"w": "a", "b": [0.2612, 0.2443, 0.2724, 0.2641]}, {"w": "count", "b": [0.2787, 0.2443, 0.3347, 0.2641]}, {"w": "of", "b": [0.341, 0.2443, 0.362, 0.2641]}, {"w": "420,551", "b": [0.3684, 0.2443, 0.4503, 0.2641]}, {"w": "lines", "b": [0.4566, 0.2443, 0.5043, 0.2641]}, {"w": "of", "b": [0.5106, 0.2443, 0.5316, 0.2641]}, {"w": "data", "b": [0.5379, 0.2443, 0.5799, 0.2641]}, {"w": "(each", "b": [0.5863, 0.2443, 0.6409, 0.2641]}, {"w": "line", "b": [0.6472, 0.2443, 0.685, 0.2641]}, {"w": "is", "b": [0.6913, 0.2443, 0.7081, 0.2641]}, {"w": "a", "b": [0.7144, 0.2443, 0.7256, 0.2641]}, {"w": "timestep:", "b": [0.732, 0.2443, 0.8245, 0.2641]}, {"w": "a", "b": [0.8308, 0.2443, 0.842, 0.2641]}, {"w": "record", "b": [0.1294, 0.2648, 0.1938, 0.2846]}, {"w": "of", "b": [0.2001, 0.2648, 0.2212, 0.2846]}, {"w": "a", "b": [0.2275, 0.2648, 0.2387, 0.2846]}, {"w": "date", "b": [0.245, 0.2648, 0.287, 0.2846]}, {"w": "and", "b": [0.2933, 0.2648, 0.3297, 0.2846]}, {"w": "14", "b": [0.336, 0.2648, 0.3613, 0.2846]}, {"w": "weather-related", "b": [0.3676, 0.2648, 0.5239, 0.2846]}, {"w": "values),", "b": [0.5302, 0.2648, 0.6094, 0.2846]}, {"w": "as", "b": [0.6156, 0.2648, 0.6367, 0.2846]}, {"w": "well", "b": [0.643, 0.2648, 0.6864, 0.2846]}, {"w": "as", "b": [0.6927, 0.2648, 0.7137, 0.2846]}, {"w": "the", "b": [0.72, 0.2648, 0.7508, 0.2846]}, {"w": "following", "b": [0.7572, 0.2648, 0.8553, 0.2846]}, {"w": "header:", "b": [0.1294, 0.2853, 0.2037, 0.3051]}]}, {"id": "b_2", "type": "paragraph", "text": "[\"Date Time\", \"p (mbar)\", \"T (degC)\", \"Tpot (K)\", \"Tdew (degC)\", \"rh (%)\", \"VPmax (mbar)\", \"VPact (mbar)\", \"VPdef (mbar)\", \"sh (g/kg)\", \"H2OC (mmol/mol)\", \"rho (g/m**3)\", \"wv (m/s)\", \"max. wv (m/s)\", \"wd (deg)\"]", "words": [{"w": "[\"Date", "b": [0.1357, 0.3231, 0.2038, 0.3382]}, {"w": "Time\",", "b": [0.2152, 0.3231, 0.2833, 0.3382]}, {"w": "\"p", "b": [0.1471, 0.3382, 0.1698, 0.3534]}, {"w": "(mbar)\",", "b": [0.1811, 0.3382, 0.2719, 0.3534]}, {"w": "\"T", "b": [0.1471, 0.3534, 0.1698, 0.3685]}, {"w": "(degC)\",", "b": [0.1811, 0.3534, 0.2719, 0.3685]}, {"w": "\"Tpot", "b": [0.1471, 0.3685, 0.2038, 0.3837]}, {"w": "(K)\",", "b": [0.2152, 0.3685, 0.2719, 0.3837]}, {"w": "\"Tdew", "b": [0.1471, 0.3837, 0.2038, 0.3988]}, {"w": "(degC)\",", "b": [0.2152, 0.3837, 0.306, 0.3988]}, {"w": "\"rh", "b": [0.1471, 0.3988, 0.1811, 0.414]}, {"w": "(%)\",", "b": [0.1925, 0.3988, 0.2492, 0.414]}, {"w": "\"VPmax", "b": [0.1471, 0.414, 0.2152, 0.4291]}, {"w": "(mbar)\",", "b": [0.2265, 0.414, 0.3173, 0.4291]}, {"w": "\"VPact", "b": [0.1471, 0.4291, 0.2152, 0.4443]}, {"w": "(mbar)\",", "b": [0.2265, 0.4291, 0.3173, 0.4443]}, {"w": "\"VPdef", "b": [0.1471, 0.4443, 0.2152, 0.4594]}, {"w": "(mbar)\",", "b": [0.2265, 0.4443, 0.3173, 0.4594]}, {"w": "\"sh", "b": [0.1471, 0.4594, 0.1811, 0.4746]}, {"w": "(g/kg)\",", "b": [0.1925, 0.4594, 0.2833, 0.4746]}, {"w": "\"H2OC", "b": [0.1471, 0.4746, 0.2038, 0.4897]}, {"w": "(mmol/mol)\",", "b": [0.2152, 0.4746, 0.3514, 0.4897]}, {"w": "\"rho", "b": [0.1471, 0.4897, 0.1925, 0.5049]}, {"w": "(g/m**3)\",", "b": [0.2038, 0.4897, 0.3173, 0.5049]}, {"w": "\"wv", "b": [0.1471, 0.5049, 0.1811, 0.52]}, {"w": "(m/s)\",", "b": [0.1925, 0.5049, 0.2719, 0.52]}, {"w": "\"max.", "b": [0.1471, 0.52, 0.2038, 0.5352]}, {"w": "wv", "b": [0.2152, 0.52, 0.2379, 0.5352]}, {"w": "(m/s)\",", "b": [0.2492, 0.52, 0.3287, 0.5352]}, {"w": "\"wd", "b": [0.1471, 0.5352, 0.1811, 0.5503]}, {"w": "(deg)\"]", "b": [0.1925, 0.5352, 0.2719, 0.5503]}]}, {"id": "b_3", "type": "paragraph", "text": "Now, convert all 420,551 lines of data into a Numpy array.", "words": [{"w": "Now,", "b": [0.1294, 0.5732, 0.1831, 0.593]}, {"w": "convert", "b": [0.1894, 0.5732, 0.2651, 0.593]}, {"w": "all", "b": [0.2714, 0.5732, 0.2966, 0.593]}, {"w": "420,551", "b": [0.3029, 0.5732, 0.3849, 0.593]}, {"w": "lines", "b": [0.3912, 0.5732, 0.4389, 0.593]}, {"w": "of", "b": [0.4452, 0.5732, 0.4662, 0.593]}, {"w": "data", "b": [0.4725, 0.5732, 0.5145, 0.593]}, {"w": "into", "b": [0.5208, 0.5732, 0.5601, 0.593]}, {"w": "a", "b": [0.5664, 0.5732, 0.5776, 0.593]}, {"w": "Numpy", "b": [0.5839, 0.5732, 0.6596, 0.593]}, {"w": "array.", "b": [0.6659, 0.5732, 0.7223, 0.593]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.29. Parsing the data", "words": [{"w": "Listing", "b": [0.1294, 0.6111, 0.1862, 0.6259]}, {"w": "6.29.", "b": [0.1909, 0.6111, 0.2288, 0.6259]}, {"w": "Parsing", "b": [0.2335, 0.6111, 0.2955, 0.6259]}, {"w": "the", "b": [0.3002, 0.6111, 0.3254, 0.6259]}, {"w": "data", "b": [0.3302, 0.6111, 0.3659, 0.6259]}]}, {"id": "b_5", "type": "paragraph", "text": "import numpy as np float_data = np.zeros((len(lines), len(header) - 1)) for i, line in enumerate(lines): values = [float(x) for x in line.split(',')[1:]] float_data[i, :] = values", "words": [{"w": "import", "b": [0.1357, 0.6395, 0.2038, 0.6546]}, {"w": "numpy", "b": [0.2152, 0.6395, 0.2719, 0.6546]}, {"w": "as", "b": [0.2833, 0.6395, 0.306, 0.6546]}, {"w": "np", "b": [0.3173, 0.6395, 0.34, 0.6546]}, {"w": "float_data", "b": [0.1357, 0.6698, 0.2492, 0.6849]}, {"w": "=", "b": [0.2606, 0.6698, 0.2719, 0.6849]}, {"w": "np.zeros((len(lines),", "b": [0.2833, 0.6698, 0.5217, 0.6849]}, {"w": "len(header)", "b": [0.533, 0.6698, 0.6579, 0.6849]}, {"w": "-", "b": [0.6692, 0.6698, 0.6806, 0.6849]}, {"w": "1))", "b": [0.6919, 0.6698, 0.726, 0.6849]}, {"w": "for", "b": [0.1357, 0.6849, 0.1698, 0.7001]}, {"w": "i,", "b": [0.1811, 0.6849, 0.2038, 0.7001]}, {"w": "line", "b": [0.2152, 0.6849, 0.2606, 0.7001]}, {"w": "in", "b": [0.2719, 0.6849, 0.2946, 0.7001]}, {"w": "enumerate(lines):", "b": [0.306, 0.6849, 0.499, 0.7001]}, {"w": "values", "b": [0.1811, 0.7001, 0.2492, 0.7152]}, {"w": "=", "b": [0.2606, 0.7001, 0.2719, 0.7152]}, {"w": "[float(x)", "b": [0.2833, 0.7001, 0.3855, 0.7152]}, {"w": "for", "b": [0.3968, 0.7001, 0.4309, 0.7152]}, {"w": "x", "b": [0.4422, 0.7001, 0.4536, 0.7152]}, {"w": "in", "b": [0.4649, 0.7001, 0.4876, 0.7152]}, {"w": "line.split(',')[1:]]", "b": [0.499, 0.7001, 0.726, 0.7152]}, {"w": "float_data[i,", "b": [0.1811, 0.7152, 0.3287, 0.7304]}, {"w": ":]", "b": [0.34, 0.7152, 0.3628, 0.7304]}, {"w": "=", "b": [0.3741, 0.7152, 0.3855, 0.7304]}, {"w": "values", "b": [0.3968, 0.7152, 0.4649, 0.7304]}]}, {"id": "b_6", "type": "paragraph", "text": "For instance, here is the plot of temperature (in degrees Celsius) over time (see figure 6.18). On this plot, you can clearly see the yearly periodicity of temperature.", "words": [{"w": "For", "b": [0.1294, 0.7533, 0.1645, 0.773]}, {"w": "instance,", "b": [0.1708, 0.7533, 0.2597, 0.773]}, {"w": "here", "b": [0.266, 0.7533, 0.3094, 0.773]}, {"w": "is", "b": [0.3158, 0.7533, 0.3326, 0.773]}, {"w": "the", "b": [0.3389, 0.7533, 0.3697, 0.773]}, {"w": "plot", "b": [0.376, 0.7533, 0.4153, 0.773]}, {"w": "of", "b": [0.4216, 0.7533, 0.4426, 0.773]}, {"w": "temperature", "b": [0.4489, 0.7533, 0.5694, 0.773]}, {"w": "(in", "b": [0.5757, 0.7533, 0.6037, 0.773]}, {"w": "degrees", "b": [0.61, 0.7533, 0.6871, 0.773]}, {"w": "Celsius)", "b": [0.6934, 0.7533, 0.776, 0.773]}, {"w": "over", "b": [0.7824, 0.7533, 0.8272, 0.773]}, {"w": "time", "b": [0.1294, 0.7738, 0.1743, 0.7935]}, {"w": "(see", "b": [0.1806, 0.7738, 0.2212, 0.7935]}, {"w": "figure", "b": [0.2275, 0.7738, 0.2877, 0.7935]}, {"w": "6.18).", "b": [0.294, 0.7738, 0.3528, 0.7935]}, {"w": "On", "b": [0.3591, 0.7738, 0.39, 0.7935]}, {"w": "this", "b": [0.3963, 0.7738, 0.4327, 0.7935]}, {"w": "plot,", "b": [0.439, 0.7738, 0.4846, 0.7935]}, {"w": "you", "b": [0.4909, 0.7738, 0.5287, 0.7935]}, {"w": "can", "b": [0.535, 0.7738, 0.5701, 0.7935]}, {"w": "clearly", "b": [0.5764, 0.7738, 0.645, 0.7935]}, {"w": "see", "b": [0.6513, 0.7738, 0.6835, 0.7935]}, {"w": "the", "b": [0.6898, 0.7738, 0.7207, 0.7935]}, {"w": "yearly", "b": [0.727, 0.7738, 0.79, 0.7935]}, {"w": "periodicity", "b": [0.1294, 0.7943, 0.2387, 0.814]}, {"w": "of", "b": [0.245, 0.7943, 0.266, 0.814]}, {"w": "temperature.", "b": [0.2723, 0.7943, 0.3991, 0.814]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 6.18. Temperature over the full temporal range of the dataset (°C)", "words": [{"w": "Figure", "b": [0.1294, 0.8321, 0.1827, 0.8469]}, {"w": "6.18.", "b": [0.1874, 0.8321, 0.2252, 0.8469]}, {"w": "Temperature", "b": [0.2299, 0.8321, 0.335, 0.8469]}, {"w": "over", "b": [0.3398, 0.8321, 0.3755, 0.8469]}, {"w": "the", "b": [0.3802, 0.8321, 0.4054, 0.8469]}, {"w": "full", "b": [0.4102, 0.8321, 0.4375, 0.8469]}, {"w": "temporal", "b": [0.4422, 0.8321, 0.5158, 0.8469]}, {"w": "range", "b": [0.5205, 0.8321, 0.5668, 0.8469]}, {"w": "of", "b": [0.5715, 0.8321, 0.5872, 0.8469]}, {"w": "the", "b": [0.592, 0.8321, 0.6172, 0.8469]}, {"w": "dataset", "b": [0.6219, 0.8321, 0.6797, 0.8469]}, {"w": "(°C)", "b": [0.6845, 0.8321, 0.7183, 0.8469]}]}]}, {"page": 276, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 6.30. Plotting the temperature timeseries", "words": [{"w": "Listing", "b": [0.1294, 0.3526, 0.1862, 0.3674]}, {"w": "6.30.", "b": [0.1909, 0.3526, 0.2288, 0.3674]}, {"w": "Plotting", "b": [0.2335, 0.3526, 0.2976, 0.3674]}, {"w": "the", "b": [0.3023, 0.3526, 0.3275, 0.3674]}, {"w": "temperature", "b": [0.3323, 0.3526, 0.4328, 0.3674]}, {"w": "timeseries", "b": [0.4375, 0.3526, 0.5184, 0.3674]}]}, {"id": "b_1", "type": "paragraph", "text": "from matplotlib import pyplot as plt temp = float_data[:, 1] <1> temperature (in degrees Celsius) plt.plot(range(len(temp)), temp)", "words": [{"w": "from", "b": [0.1357, 0.381, 0.1811, 0.3961]}, {"w": "matplotlib", "b": [0.1925, 0.381, 0.306, 0.3961]}, {"w": "import", "b": [0.3173, 0.381, 0.3855, 0.3961]}, {"w": "pyplot", "b": [0.3968, 0.381, 0.4649, 0.3961]}, {"w": "as", "b": [0.4763, 0.381, 0.499, 0.3961]}, {"w": "plt", "b": [0.5103, 0.381, 0.5444, 0.3961]}, {"w": "temp", "b": [0.1357, 0.4113, 0.1811, 0.4264]}, {"w": "=", "b": [0.1925, 0.4113, 0.2038, 0.4264]}, {"w": "float_data[:,", "b": [0.2152, 0.4113, 0.3628, 0.4264]}, {"w": "1]", "b": [0.3741, 0.4113, 0.3968, 0.4264]}, {"w": "<1>", "b": [0.4195, 0.4113, 0.4536, 0.4264]}, {"w": "temperature", "b": [0.4649, 0.4113, 0.5898, 0.4264]}, {"w": "(in", "b": [0.6011, 0.4113, 0.6352, 0.4264]}, {"w": "degrees", "b": [0.6465, 0.4113, 0.726, 0.4264]}, {"w": "Celsius)", "b": [0.7374, 0.4113, 0.8282, 0.4264]}, {"w": "plt.plot(range(len(temp)),", "b": [0.1357, 0.4265, 0.4309, 0.4416]}, {"w": "temp)", "b": [0.4422, 0.4265, 0.499, 0.4416]}]}, {"id": "b_2", "type": "paragraph", "text": "Here is a more narrow plot of the first 10 days of temperature data (see figure 6.19). Because the data is recorded every 10 minutes, you get 144 data points per day.", "words": [{"w": "Here", "b": [0.1294, 0.4645, 0.1784, 0.4842]}, {"w": "is", "b": [0.1847, 0.4645, 0.2016, 0.4842]}, {"w": "a", "b": [0.2079, 0.4645, 0.2191, 0.4842]}, {"w": "more", "b": [0.2254, 0.4645, 0.2772, 0.4842]}, {"w": "narrow", "b": [0.2835, 0.4645, 0.355, 0.4842]}, {"w": "plot", "b": [0.3613, 0.4645, 0.4005, 0.4842]}, {"w": "of", "b": [0.4068, 0.4645, 0.4278, 0.4842]}, {"w": "the", "b": [0.4341, 0.4645, 0.465, 0.4842]}, {"w": "first", "b": [0.4713, 0.4645, 0.5119, 0.4842]}, {"w": "10", "b": [0.5182, 0.4645, 0.5434, 0.4842]}, {"w": "days", "b": [0.5497, 0.4645, 0.596, 0.4842]}, {"w": "of", "b": [0.6023, 0.4645, 0.6233, 0.4842]}, {"w": "temperature", "b": [0.6296, 0.4645, 0.7501, 0.4842]}, {"w": "data", "b": [0.7564, 0.4645, 0.7984, 0.4842]}, {"w": "(see", "b": [0.8047, 0.4645, 0.8453, 0.4842]}, {"w": "figure", "b": [0.1294, 0.485, 0.1897, 0.5047]}, {"w": "6.19).", "b": [0.196, 0.485, 0.2548, 0.5047]}, {"w": "Because", "b": [0.2611, 0.485, 0.3452, 0.5047]}, {"w": "the", "b": [0.3515, 0.485, 0.3823, 0.5047]}, {"w": "data", "b": [0.3886, 0.485, 0.4306, 0.5047]}, {"w": "is", "b": [0.4369, 0.485, 0.4538, 0.5047]}, {"w": "recorded", "b": [0.4601, 0.485, 0.5483, 0.5047]}, {"w": "every", "b": [0.5546, 0.485, 0.6106, 0.5047]}, {"w": "10", "b": [0.6169, 0.485, 0.6422, 0.5047]}, {"w": "minutes,", "b": [0.6485, 0.485, 0.7347, 0.5047]}, {"w": "you", "b": [0.741, 0.485, 0.7788, 0.5047]}, {"w": "get", "b": [0.7851, 0.485, 0.8159, 0.5047]}, {"w": "144", "b": [0.8223, 0.485, 0.8601, 0.5047]}, {"w": "data", "b": [0.1294, 0.5055, 0.1714, 0.5252]}, {"w": "points", "b": [0.1777, 0.5055, 0.2394, 0.5252]}, {"w": "per", "b": [0.2457, 0.5055, 0.2779, 0.5252]}, {"w": "day.", "b": [0.2842, 0.5055, 0.3253, 0.5252]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 6.19. Temperature over the first 10 days of the dataset (°C)", "words": [{"w": "Figure", "b": [0.1294, 0.5433, 0.1827, 0.5581]}, {"w": "6.19.", "b": [0.1874, 0.5433, 0.2252, 0.5581]}, {"w": "Temperature", "b": [0.2299, 0.5433, 0.335, 0.5581]}, {"w": "over", "b": [0.3398, 0.5433, 0.3755, 0.5581]}, {"w": "the", "b": [0.3802, 0.5433, 0.4054, 0.5581]}, {"w": "first", "b": [0.4102, 0.5433, 0.4438, 0.5581]}, {"w": "10", "b": [0.4485, 0.5433, 0.4674, 0.5581]}, {"w": "days", "b": [0.4722, 0.5433, 0.509, 0.5581]}, {"w": "of", "b": [0.5137, 0.5433, 0.5294, 0.5581]}, {"w": "the", "b": [0.5342, 0.5433, 0.5594, 0.5581]}, {"w": "dataset", "b": [0.5641, 0.5433, 0.6219, 0.5581]}, {"w": "(°C)", "b": [0.6267, 0.5433, 0.6605, 0.5581]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.31. Plotting the first 10 days of the temperature timeseries", "words": [{"w": "Listing", "b": [0.1294, 0.8437, 0.1862, 0.8585]}, {"w": "6.31.", "b": [0.1909, 0.8437, 0.2288, 0.8585]}, {"w": "Plotting", "b": [0.2335, 0.8437, 0.2976, 0.8585]}, {"w": "the", "b": [0.3023, 0.8437, 0.3275, 0.8585]}, {"w": "first", "b": [0.3323, 0.8437, 0.3659, 0.8585]}, {"w": "10", "b": [0.3706, 0.8437, 0.3895, 0.8585]}, {"w": "days", "b": [0.3943, 0.8437, 0.4311, 0.8585]}, {"w": "of", "b": [0.4358, 0.8437, 0.4516, 0.8585]}, {"w": "the", "b": [0.4563, 0.8437, 0.4815, 0.8585]}, {"w": "temperature", "b": [0.4862, 0.8437, 0.5867, 0.8585]}, {"w": "timeseries", "b": [0.5915, 0.8437, 0.6724, 0.8585]}]}, {"id": "b_5", "type": "paragraph", "text": "plt.plot(range(1440), temp[:1440])", "words": [{"w": "plt.plot(range(1440),", "b": [0.1357, 0.8721, 0.3741, 0.8873]}, {"w": "temp[:1440])", "b": [0.3855, 0.8721, 0.5217, 0.8873]}]}]}, {"page": 277, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "On this plot, you can see daily periodicity, especially evident for the last 4 days. Also note that this 10-day period must be coming from a fairly cold winter month.", "words": [{"w": "On", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "this", "b": [0.1665, 0.0857, 0.203, 0.1054]}, {"w": "plot,", "b": [0.2093, 0.0857, 0.2549, 0.1054]}, {"w": "you", "b": [0.2612, 0.0857, 0.299, 0.1054]}, {"w": "can", "b": [0.3053, 0.0857, 0.3403, 0.1054]}, {"w": "see", "b": [0.3466, 0.0857, 0.3788, 0.1054]}, {"w": "daily", "b": [0.3852, 0.0857, 0.4356, 0.1054]}, {"w": "periodicity,", "b": [0.4419, 0.0857, 0.5558, 0.1054]}, {"w": "especially", "b": [0.5621, 0.0857, 0.663, 0.1054]}, {"w": "evident", "b": [0.6693, 0.0857, 0.7436, 0.1054]}, {"w": "for", "b": [0.7499, 0.0857, 0.7793, 0.1054]}, {"w": "the", "b": [0.7856, 0.0857, 0.8164, 0.1054]}, {"w": "last", "b": [0.8227, 0.0857, 0.8578, 0.1054]}, {"w": "4", "b": [0.1294, 0.1062, 0.142, 0.1259]}, {"w": "days.", "b": [0.1483, 0.1062, 0.2009, 0.1259]}, {"w": "Also", "b": [0.2072, 0.1062, 0.2548, 0.1259]}, {"w": "note", "b": [0.2611, 0.1062, 0.3046, 0.1259]}, {"w": "that", "b": [0.3109, 0.1062, 0.3487, 0.1259]}, {"w": "this", "b": [0.355, 0.1062, 0.3915, 0.1259]}, {"w": "10-day", "b": [0.3978, 0.1062, 0.4678, 0.1259]}, {"w": "period", "b": [0.4741, 0.1062, 0.5386, 0.1259]}, {"w": "must", "b": [0.5449, 0.1062, 0.594, 0.1259]}, {"w": "be", "b": [0.6002, 0.1062, 0.624, 0.1259]}, {"w": "coming", "b": [0.6303, 0.1062, 0.706, 0.1259]}, {"w": "from", "b": [0.7123, 0.1062, 0.7614, 0.1259]}, {"w": "a", "b": [0.7677, 0.1062, 0.7789, 0.1259]}, {"w": "fairly", "b": [0.7852, 0.1062, 0.8398, 0.1259]}, {"w": "cold", "b": [0.1294, 0.1267, 0.1729, 0.1464]}, {"w": "winter", "b": [0.1792, 0.1267, 0.2436, 0.1464]}, {"w": "month.", "b": [0.2499, 0.1267, 0.3207, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "If you were trying to predict average temperature for the next month given a few months of past data, the problem would be easy, due to the reliable year-scale periodicity of the data. But looking at the data over a scale of days, the temperature looks a lot more chaotic. Is this timeseries predictable at a daily scale? Let’s find out.", "words": [{"w": "If", "b": [0.1294, 0.1695, 0.1462, 0.1892]}, {"w": "you", "b": [0.1525, 0.1695, 0.1904, 0.1892]}, {"w": "were", "b": [0.1967, 0.1695, 0.2457, 0.1892]}, {"w": "trying", "b": [0.252, 0.1695, 0.3122, 0.1892]}, {"w": "to", "b": [0.3186, 0.1695, 0.3382, 0.1892]}, {"w": "predict", "b": [0.3445, 0.1695, 0.4145, 0.1892]}, {"w": "average", "b": [0.4208, 0.1695, 0.4993, 0.1892]}, {"w": "temperature", "b": [0.5056, 0.1695, 0.6261, 0.1892]}, {"w": "for", "b": [0.6324, 0.1695, 0.6618, 0.1892]}, {"w": "the", "b": [0.6681, 0.1695, 0.6989, 0.1892]}, {"w": "next", "b": [0.7052, 0.1695, 0.7487, 0.1892]}, {"w": "month", "b": [0.755, 0.1695, 0.8194, 0.1892]}, {"w": "given", "b": [0.1294, 0.19, 0.1855, 0.2097]}, {"w": "a", "b": [0.1918, 0.19, 0.203, 0.2097]}, {"w": "few", "b": [0.2093, 0.19, 0.2471, 0.2097]}, {"w": "months", "b": [0.2534, 0.19, 0.3277, 0.2097]}, {"w": "of", "b": [0.334, 0.19, 0.355, 0.2097]}, {"w": "past", "b": [0.3613, 0.19, 0.402, 0.2097]}, {"w": "data,", "b": [0.4083, 0.19, 0.4566, 0.2097]}, {"w": "the", "b": [0.4629, 0.19, 0.4937, 0.2097]}, {"w": "problem", "b": [0.5, 0.19, 0.5841, 0.2097]}, {"w": "would", "b": [0.5904, 0.19, 0.6535, 0.2097]}, {"w": "be", "b": [0.6598, 0.19, 0.6836, 0.2097]}, {"w": "easy,", "b": [0.6898, 0.19, 0.7393, 0.2097]}, {"w": "due", "b": [0.7456, 0.19, 0.7821, 0.2097]}, {"w": "to", "b": [0.7884, 0.19, 0.808, 0.2097]}, {"w": "the", "b": [0.8143, 0.19, 0.8451, 0.2097]}, {"w": "reliable", "b": [0.1294, 0.2105, 0.2051, 0.2302]}, {"w": "year-scale", "b": [0.2114, 0.2105, 0.3131, 0.2302]}, {"w": "periodicity", "b": [0.3194, 0.2105, 0.4287, 0.2302]}, {"w": "of", "b": [0.435, 0.2105, 0.456, 0.2302]}, {"w": "the", "b": [0.4623, 0.2105, 0.4931, 0.2302]}, {"w": "data.", "b": [0.4994, 0.2105, 0.5478, 0.2302]}, {"w": "But", "b": [0.5541, 0.2105, 0.5905, 0.2302]}, {"w": "looking", "b": [0.5968, 0.2105, 0.6739, 0.2302]}, {"w": "at", "b": [0.6802, 0.2105, 0.6984, 0.2302]}, {"w": "the", "b": [0.7048, 0.2105, 0.7356, 0.2302]}, {"w": "data", "b": [0.7419, 0.2105, 0.7839, 0.2302]}, {"w": "over", "b": [0.7902, 0.2105, 0.835, 0.2302]}, {"w": "a", "b": [0.8414, 0.2105, 0.8526, 0.2302]}, {"w": "scale", "b": [0.1294, 0.231, 0.1798, 0.2507]}, {"w": "of", "b": [0.1861, 0.231, 0.2072, 0.2507]}, {"w": "days,", "b": [0.2135, 0.231, 0.266, 0.2507]}, {"w": "the", "b": [0.2723, 0.231, 0.3031, 0.2507]}, {"w": "temperature", "b": [0.3094, 0.231, 0.4299, 0.2507]}, {"w": "looks", "b": [0.4362, 0.231, 0.4908, 0.2507]}, {"w": "a", "b": [0.4972, 0.231, 0.5084, 0.2507]}, {"w": "lot", "b": [0.5147, 0.231, 0.5413, 0.2507]}, {"w": "more", "b": [0.5476, 0.231, 0.5994, 0.2507]}, {"w": "chaotic.", "b": [0.6057, 0.231, 0.6849, 0.2507]}, {"w": "Is", "b": [0.6912, 0.231, 0.7094, 0.2507]}, {"w": "this", "b": [0.7157, 0.231, 0.7522, 0.2507]}, {"w": "timeseries", "b": [0.7585, 0.231, 0.8608, 0.2507]}, {"w": "predictable", "b": [0.1294, 0.2515, 0.2415, 0.2712]}, {"w": "at", "b": [0.2478, 0.2515, 0.266, 0.2712]}, {"w": "a", "b": [0.2723, 0.2515, 0.2835, 0.2712]}, {"w": "daily", "b": [0.2898, 0.2515, 0.3403, 0.2712]}, {"w": "scale?", "b": [0.3466, 0.2515, 0.4082, 0.2712]}, {"w": "Let’s", "b": [0.4145, 0.2515, 0.4649, 0.2712]}, {"w": "find", "b": [0.4712, 0.2515, 0.5118, 0.2712]}, {"w": "out.", "b": [0.5181, 0.2515, 0.5567, 0.2712]}]}, {"id": "b_2", "type": "paragraph", "text": "6.3.2. Preparing the data", "words": [{"w": "6.3.2.", "b": [0.1294, 0.2987, 0.1862, 0.3184]}, {"w": "Preparing", "b": [0.1925, 0.2987, 0.3013, 0.3184]}, {"w": "the", "b": [0.3076, 0.2987, 0.3412, 0.3184]}, {"w": "data", "b": [0.3476, 0.2987, 0.3952, 0.3184]}]}, {"id": "b_3", "type": "paragraph", "text": "The exact formulation of the problem will be as follows: given data going as far back as lookback timesteps (a timestep is 10 minutes) and sampled every steps timesteps, can you predict the temperature in delay timesteps? You’ll use the following parameter values:", "words": [{"w": "The", "b": [0.1294, 0.3415, 0.1686, 0.3612]}, {"w": "exact", "b": [0.1749, 0.3415, 0.2282, 0.3612]}, {"w": "formulation", "b": [0.2345, 0.3415, 0.3536, 0.3612]}, {"w": "of", "b": [0.3599, 0.3415, 0.3809, 0.3612]}, {"w": "the", "b": [0.3872, 0.3415, 0.418, 0.3612]}, {"w": "problem", "b": [0.4244, 0.3415, 0.5084, 0.3612]}, {"w": "will", "b": [0.5147, 0.3415, 0.554, 0.3612]}, {"w": "be", "b": [0.5603, 0.3415, 0.5841, 0.3612]}, {"w": "as", "b": [0.5904, 0.3415, 0.6114, 0.3612]}, {"w": "follows:", "b": [0.6177, 0.3415, 0.7004, 0.3612]}, {"w": "given", "b": [0.7067, 0.3415, 0.7628, 0.3612]}, {"w": "data", "b": [0.7691, 0.3415, 0.8111, 0.3612]}, {"w": "going", "b": [0.1294, 0.362, 0.1869, 0.3817]}, {"w": "as", "b": [0.1932, 0.362, 0.2142, 0.3817]}, {"w": "far", "b": [0.2205, 0.362, 0.2485, 0.3817]}, {"w": "back", "b": [0.2548, 0.362, 0.3024, 0.3817]}, {"w": "as", "b": [0.3087, 0.362, 0.3298, 0.3817]}, {"w": "lookback", "b": [0.336, 0.363, 0.4571, 0.3832]}, {"w": "timesteps", "b": [0.4635, 0.362, 0.5588, 0.3817]}, {"w": "(a", "b": [0.5651, 0.362, 0.5847, 0.3817]}, {"w": "timestep", "b": [0.591, 0.362, 0.6765, 0.3817]}, {"w": "is", "b": [0.6828, 0.362, 0.6996, 0.3817]}, {"w": "10", "b": [0.7059, 0.362, 0.7311, 0.3817]}, {"w": "minutes)", "b": [0.7374, 0.362, 0.8257, 0.3817]}, {"w": "and", "b": [0.832, 0.362, 0.8685, 0.3817]}, {"w": "sampled", "b": [0.1294, 0.3834, 0.2135, 0.4031]}, {"w": "every", "b": [0.2198, 0.3834, 0.2758, 0.4031]}, {"w": "steps", "b": [0.2821, 0.3844, 0.3578, 0.4046]}, {"w": "timesteps,", "b": [0.3641, 0.3834, 0.4657, 0.4031]}, {"w": "can", "b": [0.472, 0.3834, 0.507, 0.4031]}, {"w": "you", "b": [0.5133, 0.3834, 0.5512, 0.4031]}, {"w": "predict", "b": [0.5575, 0.3834, 0.6275, 0.4031]}, {"w": "the", "b": [0.6338, 0.3834, 0.6647, 0.4031]}, {"w": "temperature", "b": [0.671, 0.3834, 0.7914, 0.4031]}, {"w": "in", "b": [0.7977, 0.3834, 0.8174, 0.4031]}, {"w": "delay", "b": [0.1294, 0.4058, 0.2051, 0.426]}, {"w": "timesteps?", "b": [0.2114, 0.4048, 0.3179, 0.4245]}, {"w": "You’ll", "b": [0.3242, 0.4048, 0.3875, 0.4245]}, {"w": "use", "b": [0.3938, 0.4048, 0.4275, 0.4245]}, {"w": "the", "b": [0.4338, 0.4048, 0.4646, 0.4245]}, {"w": "following", "b": [0.4709, 0.4048, 0.569, 0.4245]}, {"w": "parameter", "b": [0.5753, 0.4048, 0.6762, 0.4245]}, {"w": "values:", "b": [0.6825, 0.4048, 0.7539, 0.4245]}]}, {"id": "b_4", "type": "paragraph", "text": "lookback = 720—Observations will go back 5 days. steps = 6—Observations will be sampled at one data point per hour. delay = 144—Targets will be 24 hours in the future.", "words": [{"w": "lookback", "b": [0.1799, 0.445, 0.3009, 0.4652]}, {"w": "=", "b": [0.3161, 0.445, 0.3312, 0.4652]}, {"w": "720—Observations", "b": [0.3464, 0.444, 0.5501, 0.4652]}, {"w": "will", "b": [0.5564, 0.444, 0.5957, 0.4637]}, {"w": "go", "b": [0.602, 0.444, 0.6272, 0.4637]}, {"w": "back", "b": [0.6335, 0.444, 0.6811, 0.4637]}, {"w": "5", "b": [0.6875, 0.444, 0.7001, 0.4637]}, {"w": "days.", "b": [0.7064, 0.444, 0.7589, 0.4637]}, {"w": "steps", "b": [0.1799, 0.4664, 0.2555, 0.4866]}, {"w": "=", "b": [0.2707, 0.4664, 0.2858, 0.4866]}, {"w": "6—Observations", "b": [0.3009, 0.4654, 0.4744, 0.4866]}, {"w": "will", "b": [0.4808, 0.4654, 0.52, 0.4851]}, {"w": "be", "b": [0.5263, 0.4654, 0.5501, 0.4851]}, {"w": "sampled", "b": [0.5564, 0.4654, 0.6405, 0.4851]}, {"w": "at", "b": [0.6468, 0.4654, 0.665, 0.4851]}, {"w": "one", "b": [0.6713, 0.4654, 0.7078, 0.4851]}, {"w": "data", "b": [0.7141, 0.4654, 0.7561, 0.4851]}, {"w": "point", "b": [0.7624, 0.4654, 0.8143, 0.4851]}, {"w": "per", "b": [0.8206, 0.4654, 0.8528, 0.4851]}, {"w": "hour.", "b": [0.1799, 0.4868, 0.231, 0.5065]}, {"w": "delay", "b": [0.1799, 0.5083, 0.2555, 0.5285]}, {"w": "=", "b": [0.2707, 0.5083, 0.2858, 0.5285]}, {"w": "144—Targets", "b": [0.3009, 0.5073, 0.445, 0.5285]}, {"w": "will", "b": [0.4513, 0.5073, 0.4906, 0.527]}, {"w": "be", "b": [0.4969, 0.5073, 0.5207, 0.527]}, {"w": "24", "b": [0.527, 0.5073, 0.5522, 0.527]}, {"w": "hours", "b": [0.5585, 0.5073, 0.6146, 0.527]}, {"w": "in", "b": [0.6209, 0.5073, 0.6405, 0.527]}, {"w": "the", "b": [0.6468, 0.5073, 0.6777, 0.527]}, {"w": "future.", "b": [0.684, 0.5073, 0.7505, 0.527]}]}, {"id": "b_5", "type": "paragraph", "text": "To get started, you need to do two things:", "words": [{"w": "To", "b": [0.1294, 0.5509, 0.1557, 0.5707]}, {"w": "get", "b": [0.162, 0.5509, 0.1928, 0.5707]}, {"w": "started,", "b": [0.1991, 0.5509, 0.2727, 0.5707]}, {"w": "you", "b": [0.279, 0.5509, 0.3168, 0.5707]}, {"w": "need", "b": [0.3231, 0.5509, 0.3707, 0.5707]}, {"w": "to", "b": [0.3771, 0.5509, 0.3967, 0.5707]}, {"w": "do", "b": [0.403, 0.5509, 0.4282, 0.5707]}, {"w": "two", "b": [0.4345, 0.5509, 0.4724, 0.5707]}, {"w": "things:", "b": [0.4787, 0.5509, 0.5474, 0.5707]}]}, {"id": "b_6", "type": "paragraph", "text": "Preprocess the data to a format a neural network can ingest. This is easy: the data is already numerical, so you don’t need to do any vectorization. But each timeseries in the data is on a different scale (for example, temperature is typically between -20 and +30, but atmospheric pressure, measured in mbar, is around 1,000). You’ll normalize each timeseries independently so that they all take small values on a similar scale. Write a Python generator that takes the current array of float data and yields batches of data from the recent past, along with a target temperature in the future. Because the samples in the dataset are highly redundant (sample N and sample N + 1 will have most of their timesteps in common), it would be wasteful to explicitly allocate every sample. Instead, you’ll generate the samples on the fly using the original data.", "words": [{"w": "Preprocess", "b": [0.1799, 0.5893, 0.2891, 0.609]}, {"w": "the", "b": [0.2954, 0.5893, 0.3263, 0.609]}, {"w": "data", "b": [0.3326, 0.5893, 0.3746, 0.609]}, {"w": "to", "b": [0.3809, 0.5893, 0.4005, 0.609]}, {"w": "a", "b": [0.4068, 0.5893, 0.418, 0.609]}, {"w": "format", "b": [0.4244, 0.5893, 0.4916, 0.609]}, {"w": "a", "b": [0.4979, 0.5893, 0.5091, 0.609]}, {"w": "neural", "b": [0.5154, 0.5893, 0.5785, 0.609]}, {"w": "network", "b": [0.5848, 0.5893, 0.6674, 0.609]}, {"w": "can", "b": [0.6737, 0.5893, 0.7087, 0.609]}, {"w": "ingest.", "b": [0.7151, 0.5893, 0.7816, 0.609]}, {"w": "This", "b": [0.7879, 0.5893, 0.8328, 0.609]}, {"w": "is", "b": [0.8391, 0.5893, 0.8559, 0.609]}, {"w": "easy:", "b": [0.1799, 0.6098, 0.2317, 0.6295]}, {"w": "the", "b": [0.238, 0.6098, 0.2688, 0.6295]}, {"w": "data", "b": [0.2751, 0.6098, 0.3172, 0.6295]}, {"w": "is", "b": [0.3235, 0.6098, 0.3403, 0.6295]}, {"w": "already", "b": [0.3466, 0.6098, 0.4208, 0.6295]}, {"w": "numerical,", "b": [0.4272, 0.6098, 0.5343, 0.6295]}, {"w": "so", "b": [0.5406, 0.6098, 0.5631, 0.6295]}, {"w": "you", "b": [0.5694, 0.6098, 0.6072, 0.6295]}, {"w": "don’t", "b": [0.6135, 0.6098, 0.6663, 0.6295]}, {"w": "need", "b": [0.6726, 0.6098, 0.7202, 0.6295]}, {"w": "to", "b": [0.7265, 0.6098, 0.7461, 0.6295]}, {"w": "do", "b": [0.7524, 0.6098, 0.7776, 0.6295]}, {"w": "any", "b": [0.7839, 0.6098, 0.8204, 0.6295]}, {"w": "vectorization.", "b": [0.1799, 0.6303, 0.3179, 0.65]}, {"w": "But", "b": [0.3242, 0.6303, 0.3606, 0.65]}, {"w": "each", "b": [0.3669, 0.6303, 0.4132, 0.65]}, {"w": "timeseries", "b": [0.4195, 0.6303, 0.5217, 0.65]}, {"w": "in", "b": [0.5281, 0.6303, 0.5477, 0.65]}, {"w": "the", "b": [0.554, 0.6303, 0.5848, 0.65]}, {"w": "data", "b": [0.5911, 0.6303, 0.6331, 0.65]}, {"w": "is", "b": [0.6395, 0.6303, 0.6563, 0.65]}, {"w": "on", "b": [0.6626, 0.6303, 0.6878, 0.65]}, {"w": "a", "b": [0.6941, 0.6303, 0.7053, 0.65]}, {"w": "different", "b": [0.7116, 0.6303, 0.7979, 0.65]}, {"w": "scale", "b": [0.8042, 0.6303, 0.8547, 0.65]}, {"w": "(for", "b": [0.1799, 0.6508, 0.2177, 0.6705]}, {"w": "example,", "b": [0.224, 0.6508, 0.3158, 0.6705]}, {"w": "temperature", "b": [0.3221, 0.6508, 0.4425, 0.6705]}, {"w": "is", "b": [0.4488, 0.6508, 0.4657, 0.6705]}, {"w": "typically", "b": [0.472, 0.6508, 0.5603, 0.6705]}, {"w": "between", "b": [0.5666, 0.6508, 0.6506, 0.6705]}, {"w": "-20", "b": [0.6568, 0.6508, 0.6905, 0.6705]}, {"w": "and", "b": [0.6968, 0.6508, 0.7332, 0.6705]}, {"w": "+30,", "b": [0.7395, 0.6508, 0.7853, 0.6705]}, {"w": "but", "b": [0.7916, 0.6508, 0.8238, 0.6705]}, {"w": "atmospheric", "b": [0.1799, 0.6713, 0.3032, 0.691]}, {"w": "pressure,", "b": [0.3095, 0.6713, 0.3998, 0.691]}, {"w": "measured", "b": [0.4061, 0.6713, 0.5028, 0.691]}, {"w": "in", "b": [0.5091, 0.6713, 0.5287, 0.691]}, {"w": "mbar,", "b": [0.535, 0.6713, 0.5921, 0.691]}, {"w": "is", "b": [0.5984, 0.6713, 0.6153, 0.691]}, {"w": "around", "b": [0.6216, 0.6713, 0.6916, 0.691]}, {"w": "1,000).", "b": [0.6979, 0.6713, 0.7694, 0.691]}, {"w": "You’ll", "b": [0.7757, 0.6713, 0.839, 0.691]}, {"w": "normalize", "b": [0.1799, 0.6918, 0.2807, 0.7115]}, {"w": "each", "b": [0.287, 0.6918, 0.3333, 0.7115]}, {"w": "timeseries", "b": [0.3396, 0.6918, 0.4419, 0.7115]}, {"w": "independently", "b": [0.4482, 0.6918, 0.5911, 0.7115]}, {"w": "so", "b": [0.5973, 0.6918, 0.6197, 0.7115]}, {"w": "that", "b": [0.626, 0.6918, 0.6639, 0.7115]}, {"w": "they", "b": [0.6702, 0.6918, 0.7136, 0.7115]}, {"w": "all", "b": [0.7199, 0.6918, 0.7452, 0.7115]}, {"w": "take", "b": [0.7515, 0.6918, 0.7935, 0.7115]}, {"w": "small", "b": [0.7998, 0.6918, 0.8545, 0.7115]}, {"w": "values", "b": [0.1799, 0.7123, 0.2443, 0.732]}, {"w": "on", "b": [0.2506, 0.7123, 0.2758, 0.732]}, {"w": "a", "b": [0.2822, 0.7123, 0.2934, 0.732]}, {"w": "similar", "b": [0.2997, 0.7123, 0.3697, 0.732]}, {"w": "scale.", "b": [0.376, 0.7123, 0.4328, 0.732]}, {"w": "Write", "b": [0.1799, 0.7328, 0.2363, 0.7525]}, {"w": "a", "b": [0.2426, 0.7328, 0.2538, 0.7525]}, {"w": "Python", "b": [0.2601, 0.7328, 0.3316, 0.7525]}, {"w": "generator", "b": [0.3379, 0.7328, 0.4332, 0.7525]}, {"w": "that", "b": [0.4395, 0.7328, 0.4773, 0.7525]}, {"w": "takes", "b": [0.4836, 0.7328, 0.5354, 0.7525]}, {"w": "the", "b": [0.5417, 0.7328, 0.5726, 0.7525]}, {"w": "current", "b": [0.5789, 0.7328, 0.6503, 0.7525]}, {"w": "array", "b": [0.6566, 0.7328, 0.7084, 0.7525]}, {"w": "of", "b": [0.7147, 0.7328, 0.7358, 0.7525]}, {"w": "float", "b": [0.7421, 0.7328, 0.7883, 0.7525]}, {"w": "data", "b": [0.7946, 0.7328, 0.8366, 0.7525]}, {"w": "and", "b": [0.1799, 0.7533, 0.2163, 0.773]}, {"w": "yields", "b": [0.2226, 0.7533, 0.2829, 0.773]}, {"w": "batches", "b": [0.2892, 0.7533, 0.3648, 0.773]}, {"w": "of", "b": [0.3711, 0.7533, 0.3921, 0.773]}, {"w": "data", "b": [0.3984, 0.7533, 0.4405, 0.773]}, {"w": "from", "b": [0.4468, 0.7533, 0.4958, 0.773]}, {"w": "the", "b": [0.5021, 0.7533, 0.5329, 0.773]}, {"w": "recent", "b": [0.5393, 0.7533, 0.6009, 0.773]}, {"w": "past,", "b": [0.6072, 0.7533, 0.6541, 0.773]}, {"w": "along", "b": [0.6604, 0.7533, 0.7165, 0.773]}, {"w": "with", "b": [0.7227, 0.7533, 0.7676, 0.773]}, {"w": "a", "b": [0.7739, 0.7533, 0.7851, 0.773]}, {"w": "target", "b": [0.7914, 0.7533, 0.8483, 0.773]}, {"w": "temperature", "b": [0.1799, 0.7738, 0.3003, 0.7935]}, {"w": "in", "b": [0.3066, 0.7738, 0.3263, 0.7935]}, {"w": "the", "b": [0.3326, 0.7738, 0.3634, 0.7935]}, {"w": "future.", "b": [0.3697, 0.7738, 0.4363, 0.7935]}, {"w": "Because", "b": [0.4426, 0.7738, 0.5266, 0.7935]}, {"w": "the", "b": [0.5329, 0.7738, 0.5637, 0.7935]}, {"w": "samples", "b": [0.5701, 0.7738, 0.6513, 0.7935]}, {"w": "in", "b": [0.6576, 0.7738, 0.6773, 0.7935]}, {"w": "the", "b": [0.6836, 0.7738, 0.7144, 0.7935]}, {"w": "dataset", "b": [0.7207, 0.7738, 0.7908, 0.7935]}, {"w": "are", "b": [0.7971, 0.7738, 0.8279, 0.7935]}, {"w": "highly", "b": [0.1799, 0.7943, 0.2443, 0.814]}, {"w": "redundant", "b": [0.2506, 0.7943, 0.3515, 0.814]}, {"w": "(sample", "b": [0.3578, 0.7943, 0.4377, 0.814]}, {"w": "N", "b": [0.444, 0.7943, 0.4608, 0.814]}, {"w": "and", "b": [0.4671, 0.7943, 0.5035, 0.814]}, {"w": "sample", "b": [0.5098, 0.7943, 0.5813, 0.814]}, {"w": "N", "b": [0.5876, 0.7943, 0.6044, 0.814]}, {"w": "+", "b": [0.6107, 0.7943, 0.6249, 0.814]}, {"w": "1", "b": [0.6312, 0.7943, 0.6438, 0.814]}, {"w": "will", "b": [0.6501, 0.7943, 0.6894, 0.814]}, {"w": "have", "b": [0.6957, 0.7943, 0.7433, 0.814]}, {"w": "most", "b": [0.7496, 0.7943, 0.7987, 0.814]}, {"w": "of", "b": [0.805, 0.7943, 0.826, 0.814]}, {"w": "their", "b": [0.1799, 0.8148, 0.2261, 0.8345]}, {"w": "timesteps", "b": [0.2324, 0.8148, 0.3277, 0.8345]}, {"w": "in", "b": [0.334, 0.8148, 0.3536, 0.8345]}, {"w": "common),", "b": [0.36, 0.8148, 0.4629, 0.8345]}, {"w": "it", "b": [0.4693, 0.8148, 0.4833, 0.8345]}, {"w": "would", "b": [0.4896, 0.8148, 0.5526, 0.8345]}, {"w": "be", "b": [0.559, 0.8148, 0.5828, 0.8345]}, {"w": "wasteful", "b": [0.5891, 0.8148, 0.6745, 0.8345]}, {"w": "to", "b": [0.6808, 0.8148, 0.7005, 0.8345]}, {"w": "explicitly", "b": [0.7068, 0.8148, 0.8021, 0.8345]}, {"w": "allocate", "b": [0.1799, 0.8353, 0.2583, 0.855]}, {"w": "every", "b": [0.2646, 0.8353, 0.3206, 0.855]}, {"w": "sample.", "b": [0.327, 0.8353, 0.4047, 0.855]}, {"w": "Instead,", "b": [0.411, 0.8353, 0.4902, 0.855]}, {"w": "you’ll", "b": [0.4965, 0.8353, 0.5568, 0.855]}, {"w": "generate", "b": [0.563, 0.8353, 0.6484, 0.855]}, {"w": "the", "b": [0.6547, 0.8353, 0.6856, 0.855]}, {"w": "samples", "b": [0.6919, 0.8353, 0.7732, 0.855]}, {"w": "on", "b": [0.7795, 0.8353, 0.8047, 0.855]}, {"w": "the", "b": [0.811, 0.8353, 0.8418, 0.855]}, {"w": "fly", "b": [0.1799, 0.8558, 0.2079, 0.8755]}, {"w": "using", "b": [0.2142, 0.8558, 0.2689, 0.8755]}, {"w": "the", "b": [0.2752, 0.8558, 0.306, 0.8755]}, {"w": "original", "b": [0.3123, 0.8558, 0.3908, 0.8755]}, {"w": "data.", "b": [0.3971, 0.8558, 0.4454, 0.8755]}]}]}, {"page": 278, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You’ll preprocess the data by subtracting the mean of each timeseries and dividing by the standard deviation. You’re going to use the first 200,000 timesteps as training data, so compute the mean and standard deviation only on this fraction of the data.", "words": [{"w": "You’ll", "b": [0.1294, 0.0857, 0.1928, 0.1054]}, {"w": "preprocess", "b": [0.1991, 0.0857, 0.3069, 0.1054]}, {"w": "the", "b": [0.3132, 0.0857, 0.3441, 0.1054]}, {"w": "data", "b": [0.3504, 0.0857, 0.3924, 0.1054]}, {"w": "by", "b": [0.3987, 0.0857, 0.4239, 0.1054]}, {"w": "subtracting", "b": [0.4302, 0.0857, 0.5423, 0.1054]}, {"w": "the", "b": [0.5486, 0.0857, 0.5795, 0.1054]}, {"w": "mean", "b": [0.5858, 0.0857, 0.6404, 0.1054]}, {"w": "of", "b": [0.6467, 0.0857, 0.6677, 0.1054]}, {"w": "each", "b": [0.674, 0.0857, 0.7203, 0.1054]}, {"w": "timeseries", "b": [0.7266, 0.0857, 0.8288, 0.1054]}, {"w": "and", "b": [0.1294, 0.1062, 0.1658, 0.1259]}, {"w": "dividing", "b": [0.1721, 0.1062, 0.2562, 0.1259]}, {"w": "by", "b": [0.2626, 0.1062, 0.2878, 0.1259]}, {"w": "the", "b": [0.2941, 0.1062, 0.3249, 0.1259]}, {"w": "standard", "b": [0.3312, 0.1062, 0.4167, 0.1259]}, {"w": "deviation.", "b": [0.423, 0.1062, 0.5232, 0.1259]}, {"w": "You’re", "b": [0.5295, 0.1062, 0.5984, 0.1259]}, {"w": "going", "b": [0.6047, 0.1062, 0.6621, 0.1259]}, {"w": "to", "b": [0.6684, 0.1062, 0.688, 0.1259]}, {"w": "use", "b": [0.6943, 0.1062, 0.728, 0.1259]}, {"w": "the", "b": [0.7343, 0.1062, 0.7651, 0.1259]}, {"w": "first", "b": [0.7714, 0.1062, 0.8121, 0.1259]}, {"w": "200,000", "b": [0.1294, 0.1267, 0.2114, 0.1464]}, {"w": "timesteps", "b": [0.2177, 0.1267, 0.313, 0.1464]}, {"w": "as", "b": [0.3193, 0.1267, 0.3403, 0.1464]}, {"w": "training", "b": [0.3466, 0.1267, 0.4251, 0.1464]}, {"w": "data,", "b": [0.4314, 0.1267, 0.4797, 0.1464]}, {"w": "so", "b": [0.4861, 0.1267, 0.5085, 0.1464]}, {"w": "compute", "b": [0.5148, 0.1267, 0.6017, 0.1464]}, {"w": "the", "b": [0.608, 0.1267, 0.6388, 0.1464]}, {"w": "mean", "b": [0.6451, 0.1267, 0.6997, 0.1464]}, {"w": "and", "b": [0.706, 0.1267, 0.7425, 0.1464]}, {"w": "standard", "b": [0.7488, 0.1267, 0.8342, 0.1464]}, {"w": "deviation", "b": [0.1294, 0.1472, 0.2233, 0.1669]}, {"w": "only", "b": [0.2296, 0.1472, 0.2745, 0.1669]}, {"w": "on", "b": [0.2808, 0.1472, 0.306, 0.1669]}, {"w": "this", "b": [0.3123, 0.1472, 0.3488, 0.1669]}, {"w": "fraction", "b": [0.3551, 0.1472, 0.4335, 0.1669]}, {"w": "of", "b": [0.4398, 0.1472, 0.4608, 0.1669]}, {"w": "the", "b": [0.4671, 0.1472, 0.498, 0.1669]}, {"w": "data.", "b": [0.5042, 0.1472, 0.5525, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 6.32. Normalizing the data", "words": [{"w": "Listing", "b": [0.1294, 0.185, 0.1862, 0.1998]}, {"w": "6.32.", "b": [0.1909, 0.185, 0.2288, 0.1998]}, {"w": "Normalizing", "b": [0.2335, 0.185, 0.3344, 0.1998]}, {"w": "the", "b": [0.3391, 0.185, 0.3643, 0.1998]}, {"w": "data", "b": [0.369, 0.185, 0.4048, 0.1998]}]}, {"id": "b_2", "type": "paragraph", "text": "mean = float_data[:200000].mean(axis=0) float_data -= mean std = float_data[:200000].std(axis=0) float_data /= std", "words": [{"w": "mean", "b": [0.1357, 0.2134, 0.1811, 0.2286]}, {"w": "=", "b": [0.1925, 0.2134, 0.2038, 0.2286]}, {"w": "float_data[:200000].mean(axis=0)", "b": [0.2152, 0.2134, 0.5784, 0.2286]}, {"w": "float_data", "b": [0.1357, 0.2286, 0.2492, 0.2437]}, {"w": "-=", "b": [0.2606, 0.2286, 0.2833, 0.2437]}, {"w": "mean", "b": [0.2946, 0.2286, 0.34, 0.2437]}, {"w": "std", "b": [0.1357, 0.2437, 0.1698, 0.2589]}, {"w": "=", "b": [0.1811, 0.2437, 0.1925, 0.2589]}, {"w": "float_data[:200000].std(axis=0)", "b": [0.2038, 0.2437, 0.5557, 0.2589]}, {"w": "float_data", "b": [0.1357, 0.2589, 0.2492, 0.274]}, {"w": "/=", "b": [0.2606, 0.2589, 0.2833, 0.274]}, {"w": "std", "b": [0.2946, 0.2589, 0.3287, 0.274]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.33 shows the data generator you’ll use. It yields a tuple (samples, targets), where samples is one batch of input data and targets is the corresponding array of target temperatures. It takes the following arguments:", "words": [{"w": "Listing", "b": [0.1294, 0.2969, 0.2009, 0.3167]}, {"w": "6.33", "b": [0.2072, 0.2969, 0.2514, 0.3167]}, {"w": "shows", "b": [0.2576, 0.2969, 0.3207, 0.3167]}, {"w": "the", "b": [0.327, 0.2969, 0.3578, 0.3167]}, {"w": "data", "b": [0.3641, 0.2969, 0.4062, 0.3167]}, {"w": "generator", "b": [0.4125, 0.2969, 0.5077, 0.3167]}, {"w": "you’ll", "b": [0.514, 0.2969, 0.5743, 0.3167]}, {"w": "use.", "b": [0.5806, 0.2969, 0.6205, 0.3167]}, {"w": "It", "b": [0.6268, 0.2969, 0.6422, 0.3167]}, {"w": "yields", "b": [0.6486, 0.2969, 0.7088, 0.3167]}, {"w": "a", "b": [0.7151, 0.2969, 0.7263, 0.3167]}, {"w": "tuple", "b": [0.7326, 0.2969, 0.7831, 0.3167]}, {"w": "(samples,", "b": [0.1294, 0.3185, 0.2656, 0.3387]}, {"w": "targets),", "b": [0.2808, 0.3174, 0.4082, 0.3387]}, {"w": "where", "b": [0.4145, 0.3174, 0.4761, 0.3372]}, {"w": "samples", "b": [0.4824, 0.3185, 0.5884, 0.3387]}, {"w": "is", "b": [0.5947, 0.3174, 0.6115, 0.3372]}, {"w": "one", "b": [0.6178, 0.3174, 0.6542, 0.3372]}, {"w": "batch", "b": [0.6605, 0.3174, 0.7152, 0.3372]}, {"w": "of", "b": [0.7215, 0.3174, 0.7425, 0.3372]}, {"w": "input", "b": [0.7488, 0.3174, 0.8007, 0.3372]}, {"w": "data", "b": [0.807, 0.3174, 0.849, 0.3372]}, {"w": "and", "b": [0.1294, 0.3388, 0.1658, 0.3585]}, {"w": "targets", "b": [0.1721, 0.3399, 0.2781, 0.36]}, {"w": "is", "b": [0.2844, 0.3388, 0.3012, 0.3585]}, {"w": "the", "b": [0.3075, 0.3388, 0.3384, 0.3585]}, {"w": "corresponding", "b": [0.3447, 0.3388, 0.489, 0.3585]}, {"w": "array", "b": [0.4953, 0.3388, 0.5471, 0.3585]}, {"w": "of", "b": [0.5534, 0.3388, 0.5744, 0.3585]}, {"w": "target", "b": [0.5807, 0.3388, 0.6377, 0.3585]}, {"w": "temperatures.", "b": [0.644, 0.3388, 0.7806, 0.3585]}, {"w": "It", "b": [0.7869, 0.3388, 0.8023, 0.3585]}, {"w": "takes", "b": [0.8086, 0.3388, 0.8604, 0.3585]}, {"w": "the", "b": [0.1294, 0.3602, 0.1602, 0.3799]}, {"w": "following", "b": [0.1665, 0.3602, 0.2646, 0.3799]}, {"w": "arguments:", "b": [0.271, 0.3602, 0.3826, 0.3799]}]}, {"id": "b_4", "type": "paragraph", "text": "data—The original array of floating-point data, which you normalized in listing 6.32. lookback—How many timesteps back the input data should go. delay—How many timesteps in the future the target should be. min_index and max_index—Indices in the data array that delimit which timesteps to draw from. This is useful for keeping a segment of the data for validation and another for testing. shuffle—Whether to shuffle the samples or draw them in chronological order. batch_size—The number of samples per batch. step—The period, in timesteps, at which you sample data. You’ll set it to 6 in order to draw one data point every hour.", "words": [{"w": "data—The", "b": [0.1799, 0.3985, 0.3049, 0.4198]}, {"w": "original", "b": [0.3112, 0.3985, 0.3896, 0.4183]}, {"w": "array", "b": [0.3959, 0.3985, 0.4478, 0.4183]}, {"w": "of", "b": [0.4541, 0.3985, 0.4751, 0.4183]}, {"w": "floating-point", "b": [0.4814, 0.3985, 0.6201, 0.4183]}, {"w": "data,", "b": [0.6264, 0.3985, 0.6748, 0.4183]}, {"w": "which", "b": [0.6811, 0.3985, 0.7427, 0.4183]}, {"w": "you", "b": [0.749, 0.3985, 0.7869, 0.4183]}, {"w": "normalized", "b": [0.1799, 0.4199, 0.2934, 0.4397]}, {"w": "in", "b": [0.2997, 0.4199, 0.3193, 0.4397]}, {"w": "listing", "b": [0.3256, 0.4199, 0.3887, 0.4397]}, {"w": "6.32.", "b": [0.395, 0.4199, 0.4454, 0.4397]}, {"w": "lookback—How", "b": [0.1799, 0.4404, 0.3752, 0.4617]}, {"w": "many", "b": [0.3815, 0.4404, 0.4376, 0.4602]}, {"w": "timesteps", "b": [0.4439, 0.4404, 0.5392, 0.4602]}, {"w": "back", "b": [0.5455, 0.4404, 0.5931, 0.4602]}, {"w": "the", "b": [0.5994, 0.4404, 0.6303, 0.4602]}, {"w": "input", "b": [0.6366, 0.4404, 0.6884, 0.4602]}, {"w": "data", "b": [0.6947, 0.4404, 0.7368, 0.4602]}, {"w": "should", "b": [0.7431, 0.4404, 0.8104, 0.4602]}, {"w": "go.", "b": [0.8167, 0.4404, 0.8482, 0.4602]}, {"w": "delay—How", "b": [0.1799, 0.4618, 0.3298, 0.483]}, {"w": "many", "b": [0.3361, 0.4618, 0.3922, 0.4816]}, {"w": "timesteps", "b": [0.3985, 0.4618, 0.4938, 0.4816]}, {"w": "in", "b": [0.5001, 0.4618, 0.5197, 0.4816]}, {"w": "the", "b": [0.526, 0.4618, 0.5568, 0.4816]}, {"w": "future", "b": [0.5631, 0.4618, 0.6234, 0.4816]}, {"w": "the", "b": [0.6297, 0.4618, 0.6605, 0.4816]}, {"w": "target", "b": [0.6668, 0.4618, 0.7238, 0.4816]}, {"w": "should", "b": [0.7301, 0.4618, 0.7973, 0.4816]}, {"w": "be.", "b": [0.8036, 0.4618, 0.8338, 0.4816]}, {"w": "min_index", "b": [0.1799, 0.4842, 0.3161, 0.5044]}, {"w": "and", "b": [0.3224, 0.4832, 0.3588, 0.5029]}, {"w": "max_index—Indices", "b": [0.3651, 0.4832, 0.5995, 0.5044]}, {"w": "in", "b": [0.6058, 0.4832, 0.6254, 0.5029]}, {"w": "the", "b": [0.6317, 0.4832, 0.6625, 0.5029]}, {"w": "data", "b": [0.6688, 0.4842, 0.7293, 0.5044]}, {"w": "array", "b": [0.7356, 0.4832, 0.7875, 0.5029]}, {"w": "that", "b": [0.7938, 0.4832, 0.8316, 0.5029]}, {"w": "delimit", "b": [0.1799, 0.5046, 0.2514, 0.5243]}, {"w": "which", "b": [0.2577, 0.5046, 0.3193, 0.5243]}, {"w": "timesteps", "b": [0.3256, 0.5046, 0.4209, 0.5243]}, {"w": "to", "b": [0.4272, 0.5046, 0.4469, 0.5243]}, {"w": "draw", "b": [0.4532, 0.5046, 0.5036, 0.5243]}, {"w": "from.", "b": [0.5099, 0.5046, 0.5652, 0.5243]}, {"w": "This", "b": [0.5715, 0.5046, 0.6164, 0.5243]}, {"w": "is", "b": [0.6227, 0.5046, 0.6395, 0.5243]}, {"w": "useful", "b": [0.6458, 0.5046, 0.7075, 0.5243]}, {"w": "for", "b": [0.7138, 0.5046, 0.7432, 0.5243]}, {"w": "keeping", "b": [0.7495, 0.5046, 0.8294, 0.5243]}, {"w": "a", "b": [0.8357, 0.5046, 0.8469, 0.5243]}, {"w": "segment", "b": [0.1799, 0.5251, 0.2639, 0.5448]}, {"w": "of", "b": [0.2702, 0.5251, 0.2913, 0.5448]}, {"w": "the", "b": [0.2976, 0.5251, 0.3284, 0.5448]}, {"w": "data", "b": [0.3347, 0.5251, 0.3767, 0.5448]}, {"w": "for", "b": [0.383, 0.5251, 0.4124, 0.5448]}, {"w": "validation", "b": [0.4188, 0.5251, 0.5197, 0.5448]}, {"w": "and", "b": [0.526, 0.5251, 0.5624, 0.5448]}, {"w": "another", "b": [0.5687, 0.5251, 0.6443, 0.5448]}, {"w": "for", "b": [0.6506, 0.5251, 0.68, 0.5448]}, {"w": "testing.", "b": [0.6863, 0.5251, 0.7599, 0.5448]}, {"w": "shuffle—Whether", "b": [0.1799, 0.5456, 0.3979, 0.5668]}, {"w": "to", "b": [0.4042, 0.5456, 0.4238, 0.5653]}, {"w": "shuffle", "b": [0.4301, 0.5456, 0.4997, 0.5653]}, {"w": "the", "b": [0.506, 0.5456, 0.5368, 0.5653]}, {"w": "samples", "b": [0.5431, 0.5456, 0.6244, 0.5653]}, {"w": "or", "b": [0.6307, 0.5456, 0.6517, 0.5653]}, {"w": "draw", "b": [0.6581, 0.5456, 0.7085, 0.5653]}, {"w": "them", "b": [0.7148, 0.5456, 0.7652, 0.5653]}, {"w": "in", "b": [0.7715, 0.5456, 0.7912, 0.5653]}, {"w": "chronological", "b": [0.1799, 0.567, 0.3186, 0.5867]}, {"w": "order.", "b": [0.3249, 0.567, 0.383, 0.5867]}, {"w": "batch_size—The", "b": [0.1799, 0.5875, 0.3957, 0.6087]}, {"w": "number", "b": [0.402, 0.5875, 0.4791, 0.6072]}, {"w": "of", "b": [0.4854, 0.5875, 0.5064, 0.6072]}, {"w": "samples", "b": [0.5127, 0.5875, 0.594, 0.6072]}, {"w": "per", "b": [0.6003, 0.5875, 0.6325, 0.6072]}, {"w": "batch.", "b": [0.6388, 0.5875, 0.6997, 0.6072]}, {"w": "step—The", "b": [0.1799, 0.6089, 0.3049, 0.6301]}, {"w": "period,", "b": [0.3112, 0.6089, 0.3819, 0.6286]}, {"w": "in", "b": [0.3882, 0.6089, 0.4079, 0.6286]}, {"w": "timesteps,", "b": [0.4142, 0.6089, 0.5158, 0.6286]}, {"w": "at", "b": [0.5221, 0.6089, 0.5403, 0.6286]}, {"w": "which", "b": [0.5466, 0.6089, 0.6082, 0.6286]}, {"w": "you", "b": [0.6146, 0.6089, 0.6524, 0.6286]}, {"w": "sample", "b": [0.6587, 0.6089, 0.7302, 0.6286]}, {"w": "data.", "b": [0.7365, 0.6089, 0.7848, 0.6286]}, {"w": "You’ll", "b": [0.7911, 0.6089, 0.8544, 0.6286]}, {"w": "set", "b": [0.1799, 0.6303, 0.2079, 0.65]}, {"w": "it", "b": [0.2142, 0.6303, 0.2282, 0.65]}, {"w": "to", "b": [0.2345, 0.6303, 0.2542, 0.65]}, {"w": "6", "b": [0.2605, 0.6303, 0.2731, 0.65]}, {"w": "in", "b": [0.2794, 0.6303, 0.299, 0.65]}, {"w": "order", "b": [0.3053, 0.6303, 0.3585, 0.65]}, {"w": "to", "b": [0.3648, 0.6303, 0.3845, 0.65]}, {"w": "draw", "b": [0.3908, 0.6303, 0.4412, 0.65]}, {"w": "one", "b": [0.4475, 0.6303, 0.4839, 0.65]}, {"w": "data", "b": [0.4902, 0.6303, 0.5323, 0.65]}, {"w": "point", "b": [0.5386, 0.6303, 0.5904, 0.65]}, {"w": "every", "b": [0.5967, 0.6303, 0.6528, 0.65]}, {"w": "hour.", "b": [0.6591, 0.6303, 0.7102, 0.65]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 6.33. Generator yielding timeseries samples and their targets", "words": [{"w": "Listing", "b": [0.1294, 0.6681, 0.1862, 0.6829]}, {"w": "6.33.", "b": [0.1909, 0.6681, 0.2288, 0.6829]}, {"w": "Generator", "b": [0.2335, 0.6681, 0.3175, 0.6829]}, {"w": "yielding", "b": [0.3223, 0.6681, 0.3864, 0.6829]}, {"w": "timeseries", "b": [0.3911, 0.6681, 0.472, 0.6829]}, {"w": "samples", "b": [0.4768, 0.6681, 0.5409, 0.6829]}, {"w": "and", "b": [0.5456, 0.6681, 0.5761, 0.6829]}, {"w": "their", "b": [0.5808, 0.6681, 0.6197, 0.6829]}, {"w": "targets", "b": [0.6244, 0.6681, 0.6801, 0.6829]}]}, {"id": "b_6", "type": "paragraph", "text": "def generator(data, lookback, delay, min_index, max_index, shuffle=False, batch_size=128, step=6): if max_index is None: max_index = len(data) - delay - 1 i = min_index + lookback while 1: if shuffle: rows = np.random.randint( min_index + lookback, max_index, size=batch_size) else: if i + batch_size >= max_index: i = min_index + lookback rows = np.arange(i, min(i + batch_size, max_index))", "words": [{"w": "def", "b": [0.1357, 0.6965, 0.1698, 0.7117]}, {"w": "generator(data,", "b": [0.1811, 0.6965, 0.3514, 0.7117]}, {"w": "lookback,", "b": [0.3628, 0.6965, 0.4649, 0.7117]}, {"w": "delay,", "b": [0.4763, 0.6965, 0.5444, 0.7117]}, {"w": "min_index,", "b": [0.5557, 0.6965, 0.6692, 0.7117]}, {"w": "max_index,", "b": [0.6806, 0.6965, 0.7941, 0.7117]}, {"w": "shuffle=False,", "b": [0.2946, 0.7117, 0.4536, 0.7268]}, {"w": "batch_size=128,", "b": [0.4649, 0.7117, 0.6352, 0.7268]}, {"w": "step=6):", "b": [0.6465, 0.7117, 0.7374, 0.7268]}, {"w": "if", "b": [0.1811, 0.7268, 0.2038, 0.742]}, {"w": "max_index", "b": [0.2152, 0.7268, 0.3173, 0.742]}, {"w": "is", "b": [0.3287, 0.7268, 0.3514, 0.742]}, {"w": "None:", "b": [0.3628, 0.7268, 0.4195, 0.742]}, {"w": "max_index", "b": [0.2265, 0.742, 0.3287, 0.7571]}, {"w": "=", "b": [0.34, 0.742, 0.3514, 0.7571]}, {"w": "len(data)", "b": [0.3628, 0.742, 0.4649, 0.7571]}, {"w": "-", "b": [0.4763, 0.742, 0.4876, 0.7571]}, {"w": "delay", "b": [0.499, 0.742, 0.5557, 0.7571]}, {"w": "-", "b": [0.5671, 0.742, 0.5784, 0.7571]}, {"w": "1", "b": [0.5898, 0.742, 0.6011, 0.7571]}, {"w": "i", "b": [0.1811, 0.7571, 0.1925, 0.7723]}, {"w": "=", "b": [0.2038, 0.7571, 0.2152, 0.7723]}, {"w": "min_index", "b": [0.2265, 0.7571, 0.3287, 0.7723]}, {"w": "+", "b": [0.34, 0.7571, 0.3514, 0.7723]}, {"w": "lookback", "b": [0.3628, 0.7571, 0.4536, 0.7723]}, {"w": "while", "b": [0.1811, 0.7723, 0.2379, 0.7874]}, {"w": "1:", "b": [0.2492, 0.7723, 0.2719, 0.7874]}, {"w": "if", "b": [0.2265, 0.7874, 0.2492, 0.8026]}, {"w": "shuffle:", "b": [0.2606, 0.7874, 0.3514, 0.8026]}, {"w": "rows", "b": [0.2719, 0.8026, 0.3173, 0.8177]}, {"w": "=", "b": [0.3287, 0.8026, 0.34, 0.8177]}, {"w": "np.random.randint(", "b": [0.3514, 0.8026, 0.5557, 0.8177]}, {"w": "min_index", "b": [0.3173, 0.8177, 0.4195, 0.8329]}, {"w": "+", "b": [0.4309, 0.8177, 0.4422, 0.8329]}, {"w": "lookback,", "b": [0.4536, 0.8177, 0.5557, 0.8329]}, {"w": "max_index,", "b": [0.5671, 0.8177, 0.6806, 0.8329]}, {"w": "size=batch_size)", "b": [0.1357, 0.8329, 0.3173, 0.848]}, {"w": "else:", "b": [0.2265, 0.848, 0.2833, 0.8632]}, {"w": "if", "b": [0.2719, 0.8632, 0.2946, 0.8783]}, {"w": "i", "b": [0.306, 0.8632, 0.3173, 0.8783]}, {"w": "+", "b": [0.3287, 0.8632, 0.34, 0.8783]}, {"w": "batch_size", "b": [0.3514, 0.8632, 0.4649, 0.8783]}, {"w": ">=", "b": [0.4763, 0.8632, 0.499, 0.8783]}, {"w": "max_index:", "b": [0.5103, 0.8632, 0.6238, 0.8783]}, {"w": "i", "b": [0.3173, 0.8784, 0.3287, 0.8935]}, {"w": "=", "b": [0.34, 0.8784, 0.3514, 0.8935]}, {"w": "min_index", "b": [0.3628, 0.8784, 0.4649, 0.8935]}, {"w": "+", "b": [0.4763, 0.8784, 0.4876, 0.8935]}, {"w": "lookback", "b": [0.499, 0.8784, 0.5898, 0.8935]}, {"w": "rows", "b": [0.2719, 0.8935, 0.3173, 0.9087]}, {"w": "=", "b": [0.3287, 0.8935, 0.34, 0.9087]}, {"w": "np.arange(i,", "b": [0.3514, 0.8935, 0.4876, 0.9087]}, {"w": "min(i", "b": [0.499, 0.8935, 0.5557, 0.9087]}, {"w": "+", "b": [0.5671, 0.8935, 0.5784, 0.9087]}, {"w": "batch_size,", "b": [0.5898, 0.8935, 0.7146, 0.9087]}, {"w": "max_index))", "b": [0.726, 0.8935, 0.8509, 0.9087]}]}]}, {"page": 279, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "i += len(rows) samples = np.zeros((len(rows), lookback // step, data.shape[-1])) targets = np.zeros((len(rows),)) for j, row in enumerate(rows): indices = range(rows[j] - lookback, rows[j], step) samples[j] = data[indices] targets[j] = data[rows[j] + delay][1] yield samples, targets", "words": [{"w": "i", "b": [0.2719, 0.0851, 0.2833, 0.1002]}, {"w": "+=", "b": [0.2946, 0.0851, 0.3173, 0.1002]}, {"w": "len(rows)", "b": [0.3287, 0.0851, 0.4309, 0.1002]}, {"w": "samples", "b": [0.2265, 0.1154, 0.306, 0.1305]}, {"w": "=", "b": [0.3173, 0.1154, 0.3287, 0.1305]}, {"w": "np.zeros((len(rows),", "b": [0.34, 0.1154, 0.5671, 0.1305]}, {"w": "lookback", "b": [0.4422, 0.1305, 0.533, 0.1457]}, {"w": "//", "b": [0.5444, 0.1305, 0.5671, 0.1457]}, {"w": "step,", "b": [0.5784, 0.1305, 0.6352, 0.1457]}, {"w": "data.shape[-1]))", "b": [0.4422, 0.1457, 0.6238, 0.1608]}, {"w": "targets", "b": [0.2265, 0.1608, 0.306, 0.176]}, {"w": "=", "b": [0.3173, 0.1608, 0.3287, 0.176]}, {"w": "np.zeros((len(rows),))", "b": [0.34, 0.1608, 0.5898, 0.176]}, {"w": "for", "b": [0.2265, 0.176, 0.2606, 0.1911]}, {"w": "j,", "b": [0.2719, 0.176, 0.2946, 0.1911]}, {"w": "row", "b": [0.306, 0.176, 0.34, 0.1911]}, {"w": "in", "b": [0.3514, 0.176, 0.3741, 0.1911]}, {"w": "enumerate(rows):", "b": [0.3855, 0.176, 0.5671, 0.1911]}, {"w": "indices", "b": [0.2719, 0.1912, 0.3514, 0.2063]}, {"w": "=", "b": [0.3628, 0.1912, 0.3741, 0.2063]}, {"w": "range(rows[j]", "b": [0.3855, 0.1912, 0.533, 0.2063]}, {"w": "-", "b": [0.5444, 0.1912, 0.5557, 0.2063]}, {"w": "lookback,", "b": [0.5671, 0.1912, 0.6692, 0.2063]}, {"w": "rows[j],", "b": [0.6806, 0.1912, 0.7714, 0.2063]}, {"w": "step)", "b": [0.7828, 0.1912, 0.8395, 0.2063]}, {"w": "samples[j]", "b": [0.2719, 0.2063, 0.3855, 0.2214]}, {"w": "=", "b": [0.3968, 0.2063, 0.4082, 0.2214]}, {"w": "data[indices]", "b": [0.4195, 0.2063, 0.5671, 0.2214]}, {"w": "targets[j]", "b": [0.2719, 0.2215, 0.3855, 0.2366]}, {"w": "=", "b": [0.3968, 0.2215, 0.4082, 0.2366]}, {"w": "data[rows[j]", "b": [0.4195, 0.2215, 0.5557, 0.2366]}, {"w": "+", "b": [0.5671, 0.2215, 0.5784, 0.2366]}, {"w": "delay][1]", "b": [0.5898, 0.2215, 0.6919, 0.2366]}, {"w": "yield", "b": [0.2265, 0.2366, 0.2833, 0.2518]}, {"w": "samples,", "b": [0.2946, 0.2366, 0.3855, 0.2518]}, {"w": "targets", "b": [0.3968, 0.2366, 0.4763, 0.2518]}]}, {"id": "b_1", "type": "paragraph", "text": "Now, let’s use the abstract generator function to instantiate three generators: one for training, one for validation, and one for testing. Each will look at different temporal segments of the original data: the training generator looks at the first 200,000 timesteps, the validation generator looks at the following 100,000, and the test generator looks at the remainder.", "words": [{"w": "Now,", "b": [0.1294, 0.2746, 0.1831, 0.2944]}, {"w": "let’s", "b": [0.1894, 0.2746, 0.2315, 0.2944]}, {"w": "use", "b": [0.2378, 0.2746, 0.2714, 0.2944]}, {"w": "the", "b": [0.2777, 0.2746, 0.3085, 0.2944]}, {"w": "abstract", "b": [0.3148, 0.2746, 0.3933, 0.2944]}, {"w": "generator", "b": [0.3996, 0.2757, 0.5358, 0.2959]}, {"w": "function", "b": [0.5421, 0.2746, 0.6262, 0.2944]}, {"w": "to", "b": [0.6325, 0.2746, 0.6521, 0.2944]}, {"w": "instantiate", "b": [0.6584, 0.2746, 0.7621, 0.2944]}, {"w": "three", "b": [0.7684, 0.2746, 0.8189, 0.2944]}, {"w": "generators:", "b": [0.1294, 0.296, 0.2415, 0.3158]}, {"w": "one", "b": [0.2478, 0.296, 0.2842, 0.3158]}, {"w": "for", "b": [0.2905, 0.296, 0.3199, 0.3158]}, {"w": "training,", "b": [0.3262, 0.296, 0.411, 0.3158]}, {"w": "one", "b": [0.4173, 0.296, 0.4538, 0.3158]}, {"w": "for", "b": [0.4601, 0.296, 0.4895, 0.3158]}, {"w": "validation,", "b": [0.4958, 0.296, 0.603, 0.3158]}, {"w": "and", "b": [0.6093, 0.296, 0.6457, 0.3158]}, {"w": "one", "b": [0.652, 0.296, 0.6885, 0.3158]}, {"w": "for", "b": [0.6948, 0.296, 0.7242, 0.3158]}, {"w": "testing.", "b": [0.7305, 0.296, 0.8041, 0.3158]}, {"w": "Each", "b": [0.8104, 0.296, 0.8608, 0.3158]}, {"w": "will", "b": [0.1294, 0.3165, 0.1687, 0.3363]}, {"w": "look", "b": [0.175, 0.3165, 0.2198, 0.3363]}, {"w": "at", "b": [0.2261, 0.3165, 0.2443, 0.3363]}, {"w": "different", "b": [0.2506, 0.3165, 0.337, 0.3363]}, {"w": "temporal", "b": [0.3433, 0.3165, 0.433, 0.3363]}, {"w": "segments", "b": [0.4393, 0.3165, 0.5332, 0.3363]}, {"w": "of", "b": [0.5395, 0.3165, 0.5605, 0.3363]}, {"w": "the", "b": [0.5668, 0.3165, 0.5976, 0.3363]}, {"w": "original", "b": [0.6039, 0.3165, 0.6824, 0.3363]}, {"w": "data:", "b": [0.6887, 0.3165, 0.7378, 0.3363]}, {"w": "the", "b": [0.7441, 0.3165, 0.7749, 0.3363]}, {"w": "training", "b": [0.7812, 0.3165, 0.8597, 0.3363]}, {"w": "generator", "b": [0.1294, 0.337, 0.2247, 0.3568]}, {"w": "looks", "b": [0.231, 0.337, 0.2856, 0.3568]}, {"w": "at", "b": [0.2919, 0.337, 0.3102, 0.3568]}, {"w": "the", "b": [0.3165, 0.337, 0.3473, 0.3568]}, {"w": "first", "b": [0.3536, 0.337, 0.3942, 0.3568]}, {"w": "200,000", "b": [0.4005, 0.337, 0.4825, 0.3568]}, {"w": "timesteps,", "b": [0.4888, 0.337, 0.5904, 0.3568]}, {"w": "the", "b": [0.5967, 0.337, 0.6276, 0.3568]}, {"w": "validation", "b": [0.6339, 0.337, 0.7348, 0.3568]}, {"w": "generator", "b": [0.7411, 0.337, 0.8363, 0.3568]}, {"w": "looks", "b": [0.1294, 0.3575, 0.1841, 0.3773]}, {"w": "at", "b": [0.1904, 0.3575, 0.2086, 0.3773]}, {"w": "the", "b": [0.2149, 0.3575, 0.2457, 0.3773]}, {"w": "following", "b": [0.252, 0.3575, 0.3501, 0.3773]}, {"w": "100,000,", "b": [0.3564, 0.3575, 0.4447, 0.3773]}, {"w": "and", "b": [0.451, 0.3575, 0.4875, 0.3773]}, {"w": "the", "b": [0.4938, 0.3575, 0.5246, 0.3773]}, {"w": "test", "b": [0.5309, 0.3575, 0.5659, 0.3773]}, {"w": "generator", "b": [0.5723, 0.3575, 0.6675, 0.3773]}, {"w": "looks", "b": [0.6738, 0.3575, 0.7285, 0.3773]}, {"w": "at", "b": [0.7348, 0.3575, 0.753, 0.3773]}, {"w": "the", "b": [0.7593, 0.3575, 0.7901, 0.3773]}, {"w": "remainder.", "b": [0.1294, 0.378, 0.2366, 0.3978]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.34. Preparing the training, validation, and test generators", "words": [{"w": "Listing", "b": [0.1294, 0.4159, 0.1862, 0.4307]}, {"w": "6.34.", "b": [0.1909, 0.4159, 0.2288, 0.4307]}, {"w": "Preparing", "b": [0.2335, 0.4159, 0.3151, 0.4307]}, {"w": "the", "b": [0.3198, 0.4159, 0.345, 0.4307]}, {"w": "training,", "b": [0.3498, 0.4159, 0.4197, 0.4307]}, {"w": "validation,", "b": [0.4244, 0.4159, 0.5101, 0.4307]}, {"w": "and", "b": [0.5148, 0.4159, 0.5453, 0.4307]}, {"w": "test", "b": [0.5501, 0.4159, 0.5784, 0.4307]}, {"w": "generators", "b": [0.5831, 0.4159, 0.6693, 0.4307]}]}, {"id": "b_3", "type": "paragraph", "text": "lookback = 1440 step = 6 delay = 144 batch_size = 128 train_gen = generator(float_data, lookback=lookback, delay=delay, min_index=0, max_index=200000, shuffle=True, step=step, batch_size=batch_size) val_gen = generator(float_data, lookback=lookback, delay=delay, min_index=200001, max_index=300000, step=step, batch_size=batch_size) test_gen = generator(float_data, lookback=lookback, delay=delay, min_index=300001, max_index=None, step=step, batch_size=batch_size) val_steps = (300000 - 200001 - lookback) 1", "words": [{"w": "lookback", "b": [0.1357, 0.4443, 0.2265, 0.4594]}, {"w": "=", "b": [0.2379, 0.4443, 0.2492, 0.4594]}, {"w": "1440", "b": [0.2606, 0.4443, 0.306, 0.4594]}, {"w": "step", "b": [0.1357, 0.4594, 0.1811, 0.4746]}, {"w": "=", "b": [0.1925, 0.4594, 0.2038, 0.4746]}, {"w": "6", "b": [0.2152, 0.4594, 0.2265, 0.4746]}, {"w": "delay", "b": [0.1357, 0.4746, 0.1925, 0.4897]}, {"w": "=", "b": [0.2038, 0.4746, 0.2152, 0.4897]}, {"w": "144", "b": [0.2265, 0.4746, 0.2606, 0.4897]}, {"w": "batch_size", "b": [0.1357, 0.4897, 0.2492, 0.5049]}, {"w": "=", "b": [0.2606, 0.4897, 0.2719, 0.5049]}, {"w": "128", "b": [0.2833, 0.4897, 0.3173, 0.5049]}, {"w": "train_gen", "b": [0.1357, 0.5049, 0.2379, 0.52]}, {"w": "=", "b": [0.2492, 0.5049, 0.2606, 0.52]}, {"w": "generator(float_data,", "b": [0.2719, 0.5049, 0.5103, 0.52]}, {"w": "lookback=lookback,", "b": [0.3855, 0.52, 0.5898, 0.5352]}, {"w": "delay=delay,", "b": [0.3855, 0.5352, 0.5217, 0.5503]}, {"w": "min_index=0,", "b": [0.3855, 0.5504, 0.5217, 0.5655]}, {"w": "max_index=200000,", "b": [0.3855, 0.5655, 0.5784, 0.5806]}, {"w": "shuffle=True,", "b": [0.3855, 0.5807, 0.533, 0.5958]}, {"w": "step=step,", "b": [0.3855, 0.5958, 0.499, 0.611]}, {"w": "batch_size=batch_size)", "b": [0.3855, 0.611, 0.6352, 0.6261]}, {"w": "val_gen", "b": [0.1357, 0.6261, 0.2152, 0.6413]}, {"w": "=", "b": [0.2265, 0.6261, 0.2379, 0.6413]}, {"w": "generator(float_data,", "b": [0.2492, 0.6261, 0.4876, 0.6413]}, {"w": "lookback=lookback,", "b": [0.3628, 0.6413, 0.5671, 0.6564]}, {"w": "delay=delay,", "b": [0.3628, 0.6564, 0.499, 0.6716]}, {"w": "min_index=200001,", "b": [0.3628, 0.6716, 0.5557, 0.6867]}, {"w": "max_index=300000,", "b": [0.3628, 0.6867, 0.5557, 0.7019]}, {"w": "step=step,", "b": [0.3628, 0.7019, 0.4763, 0.717]}, {"w": "batch_size=batch_size)", "b": [0.3628, 0.717, 0.6125, 0.7322]}, {"w": "test_gen", "b": [0.1357, 0.7322, 0.2265, 0.7473]}, {"w": "=", "b": [0.2379, 0.7322, 0.2492, 0.7473]}, {"w": "generator(float_data,", "b": [0.2606, 0.7322, 0.499, 0.7473]}, {"w": "lookback=lookback,", "b": [0.3741, 0.7473, 0.5784, 0.7625]}, {"w": "delay=delay,", "b": [0.3741, 0.7625, 0.5103, 0.7776]}, {"w": "min_index=300001,", "b": [0.3741, 0.7776, 0.5671, 0.7928]}, {"w": "max_index=None,", "b": [0.3741, 0.7928, 0.5444, 0.8079]}, {"w": "step=step,", "b": [0.3741, 0.8079, 0.4876, 0.8231]}, {"w": "batch_size=batch_size)", "b": [0.3741, 0.8231, 0.6238, 0.8382]}, {"w": "val_steps", "b": [0.1357, 0.8534, 0.2379, 0.8685]}, {"w": "=", "b": [0.2492, 0.8534, 0.2606, 0.8685]}, {"w": "(300000", "b": [0.2719, 0.8534, 0.3514, 0.8685]}, {"w": "-", "b": [0.3628, 0.8534, 0.3741, 0.8685]}, {"w": "200001", "b": [0.3855, 0.8534, 0.4536, 0.8685]}, {"w": "-", "b": [0.4649, 0.8534, 0.4763, 0.8685]}, {"w": "lookback)", "b": [0.4876, 0.8534, 0.5898, 0.8685]}, {"w": "1", "b": [0.1357, 0.8686, 0.1471, 0.8837]}]}]}, {"page": 280, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "test_steps = (len(float_data) - 300001 - lookback) 2", "words": [{"w": "test_steps", "b": [0.1357, 0.0851, 0.2492, 0.1002]}, {"w": "=", "b": [0.2606, 0.0851, 0.2719, 0.1002]}, {"w": "(len(float_data)", "b": [0.2833, 0.0851, 0.4649, 0.1002]}, {"w": "-", "b": [0.4763, 0.0851, 0.4876, 0.1002]}, {"w": "300001", "b": [0.499, 0.0851, 0.5671, 0.1002]}, {"w": "-", "b": [0.5784, 0.0851, 0.5898, 0.1002]}, {"w": "lookback)", "b": [0.6011, 0.0851, 0.7033, 0.1002]}, {"w": "2", "b": [0.1357, 0.1002, 0.1471, 0.1154]}]}, {"id": "b_1", "type": "paragraph", "text": "1 How many steps to draw from val_gen in order to see the entire validation set 2 How many steps to draw from test_gen in order to see the entire test set", "words": [{"w": "1", "b": [0.1799, 0.1338, 0.1925, 0.1535]}, {"w": "How", "b": [0.1988, 0.1338, 0.2492, 0.1535]}, {"w": "many", "b": [0.2555, 0.1338, 0.3158, 0.1535]}, {"w": "steps", "b": [0.3221, 0.1338, 0.3754, 0.1535]}, {"w": "to", "b": [0.3817, 0.1338, 0.4027, 0.1535]}, {"w": "draw", "b": [0.409, 0.1338, 0.465, 0.1535]}, {"w": "from", "b": [0.4713, 0.1338, 0.5241, 0.1535]}, {"w": "val_gen", "b": [0.5304, 0.1338, 0.6131, 0.1535]}, {"w": "in", "b": [0.6194, 0.1338, 0.6405, 0.1535]}, {"w": "order", "b": [0.6468, 0.1338, 0.707, 0.1535]}, {"w": "to", "b": [0.7133, 0.1338, 0.7343, 0.1535]}, {"w": "see", "b": [0.7406, 0.1338, 0.7729, 0.1535]}, {"w": "the", "b": [0.7792, 0.1338, 0.8128, 0.1535]}, {"w": "entire", "b": [0.1799, 0.1543, 0.2424, 0.174]}, {"w": "validation", "b": [0.2487, 0.1543, 0.3567, 0.174]}, {"w": "set", "b": [0.363, 0.1543, 0.3924, 0.174]}, {"w": "2", "b": [0.1799, 0.1748, 0.1925, 0.1945]}, {"w": "How", "b": [0.1988, 0.1748, 0.2492, 0.1945]}, {"w": "many", "b": [0.2555, 0.1748, 0.3158, 0.1945]}, {"w": "steps", "b": [0.3221, 0.1748, 0.3754, 0.1945]}, {"w": "to", "b": [0.3817, 0.1748, 0.4027, 0.1945]}, {"w": "draw", "b": [0.409, 0.1748, 0.465, 0.1945]}, {"w": "from", "b": [0.4713, 0.1748, 0.5241, 0.1945]}, {"w": "test_gen", "b": [0.5304, 0.1748, 0.6187, 0.1945]}, {"w": "in", "b": [0.625, 0.1748, 0.646, 0.1945]}, {"w": "order", "b": [0.6524, 0.1748, 0.7126, 0.1945]}, {"w": "to", "b": [0.7189, 0.1748, 0.7399, 0.1945]}, {"w": "see", "b": [0.7462, 0.1748, 0.7784, 0.1945]}, {"w": "the", "b": [0.7847, 0.1748, 0.8184, 0.1945]}, {"w": "entire", "b": [0.1799, 0.1953, 0.2424, 0.2151]}, {"w": "test", "b": [0.2487, 0.1953, 0.2866, 0.2151]}, {"w": "set", "b": [0.2929, 0.1953, 0.3223, 0.2151]}]}, {"id": "b_2", "type": "equation", "text": "6.3.3. A common-sense, non-machine-learning baseline", "words": [{"w": "6.3.3.", "b": [0.1294, 0.2425, 0.1862, 0.2623]}, {"w": "A", "b": [0.1925, 0.2425, 0.2107, 0.2623]}, {"w": "common-sense,", "b": [0.217, 0.2425, 0.3802, 0.2623]}, {"w": "non-machine-learning", "b": [0.3865, 0.2425, 0.6248, 0.2623]}, {"w": "baseline", "b": [0.6311, 0.2425, 0.718, 0.2623]}]}, {"id": "b_3", "type": "paragraph", "text": "Before you start using black-box deep-learning models to solve the temperature--prediction problem, let’s try a simple, common-sense approach. It will serve as a sanity check, and it will establish a baseline that you’ll have to beat in order to demonstrate the usefulness of more- advanced machine-learning models. Such common-sense baselines can be useful when you’re approaching a new problem for which there is no known solution (yet). A classic example is that of unbalanced classification tasks, where some classes are much more common than others. If your dataset contains 90% instances of class A and 10% instances of class B, then a common-sense approach to the classification task is to always predict “A” when presented with a new sample. Such a classifier is 90% accurate overall, and any learning-based approach should therefore beat this 90% score in order to demonstrate usefulness. Sometimes, such elementary baselines can prove surprisingly hard to beat.", "words": [{"w": "Before", "b": [0.1294, 0.2853, 0.1981, 0.3051]}, {"w": "you", "b": [0.2044, 0.2853, 0.2422, 0.3051]}, {"w": "start", "b": [0.2485, 0.2853, 0.2919, 0.3051]}, {"w": "using", "b": [0.2982, 0.2853, 0.3529, 0.3051]}, {"w": "black-box", "b": [0.3592, 0.2853, 0.4601, 0.3051]}, {"w": "deep-learning", "b": [0.4664, 0.2853, 0.6051, 0.3051]}, {"w": "models", "b": [0.6114, 0.2853, 0.6843, 0.3051]}, {"w": "to", "b": [0.6906, 0.2853, 0.7102, 0.3051]}, {"w": "solve", "b": [0.7165, 0.2853, 0.7698, 0.3051]}, {"w": "the", "b": [0.7761, 0.2853, 0.8069, 0.3051]}, {"w": "temperature--prediction", "b": [0.1294, 0.3058, 0.369, 0.3256]}, {"w": "problem,", "b": [0.3753, 0.3058, 0.4657, 0.3256]}, {"w": "let’s", "b": [0.472, 0.3058, 0.514, 0.3256]}, {"w": "try", "b": [0.5203, 0.3058, 0.5483, 0.3256]}, {"w": "a", "b": [0.5546, 0.3058, 0.5658, 0.3256]}, {"w": "simple,", "b": [0.5721, 0.3058, 0.6457, 0.3256]}, {"w": "common-sense", "b": [0.652, 0.3058, 0.8033, 0.3256]}, {"w": "approach.", "b": [0.1294, 0.3263, 0.2282, 0.3461]}, {"w": "It", "b": [0.2345, 0.3263, 0.2499, 0.3461]}, {"w": "will", "b": [0.2562, 0.3263, 0.2954, 0.3461]}, {"w": "serve", "b": [0.3018, 0.3263, 0.355, 0.3461]}, {"w": "as", "b": [0.3613, 0.3263, 0.3823, 0.3461]}, {"w": "a", "b": [0.3886, 0.3263, 0.3998, 0.3461]}, {"w": "sanity", "b": [0.4061, 0.3263, 0.4664, 0.3461]}, {"w": "check,", "b": [0.4727, 0.3263, 0.5378, 0.3461]}, {"w": "and", "b": [0.5441, 0.3263, 0.5805, 0.3461]}, {"w": "it", "b": [0.5869, 0.3263, 0.6009, 0.3461]}, {"w": "will", "b": [0.6072, 0.3263, 0.6464, 0.3461]}, {"w": "establish", "b": [0.6527, 0.3263, 0.741, 0.3461]}, {"w": "a", "b": [0.7473, 0.3263, 0.7585, 0.3461]}, {"w": "baseline", "b": [0.7648, 0.3263, 0.8475, 0.3461]}, {"w": "that", "b": [0.1294, 0.3468, 0.1673, 0.3666]}, {"w": "you’ll", "b": [0.1736, 0.3468, 0.2338, 0.3666]}, {"w": "have", "b": [0.2401, 0.3468, 0.2878, 0.3666]}, {"w": "to", "b": [0.2941, 0.3468, 0.3137, 0.3666]}, {"w": "beat", "b": [0.32, 0.3468, 0.362, 0.3666]}, {"w": "in", "b": [0.3683, 0.3468, 0.388, 0.3666]}, {"w": "order", "b": [0.3943, 0.3468, 0.4475, 0.3666]}, {"w": "to", "b": [0.4538, 0.3468, 0.4734, 0.3666]}, {"w": "demonstrate", "b": [0.4797, 0.3468, 0.603, 0.3666]}, {"w": "the", "b": [0.6093, 0.3468, 0.6401, 0.3666]}, {"w": "usefulness", "b": [0.6464, 0.3468, 0.7515, 0.3666]}, {"w": "of", "b": [0.7578, 0.3468, 0.7788, 0.3666]}, {"w": "more-", "b": [0.7851, 0.3468, 0.8453, 0.3666]}, {"w": "advanced", "b": [0.1294, 0.3673, 0.2247, 0.3871]}, {"w": "machine-learning", "b": [0.231, 0.3673, 0.4075, 0.3871]}, {"w": "models.", "b": [0.4138, 0.3673, 0.493, 0.3871]}, {"w": "Such", "b": [0.4993, 0.3673, 0.5497, 0.3871]}, {"w": "common-sense", "b": [0.5561, 0.3673, 0.7074, 0.3871]}, {"w": "baselines", "b": [0.7137, 0.3673, 0.8062, 0.3871]}, {"w": "can", "b": [0.8125, 0.3673, 0.8475, 0.3871]}, {"w": "be", "b": [0.1294, 0.3878, 0.1532, 0.4076]}, {"w": "useful", "b": [0.1595, 0.3878, 0.2212, 0.4076]}, {"w": "when", "b": [0.2275, 0.3878, 0.2821, 0.4076]}, {"w": "you’re", "b": [0.2884, 0.3878, 0.3543, 0.4076]}, {"w": "approaching", "b": [0.3606, 0.3878, 0.4853, 0.4076]}, {"w": "a", "b": [0.4915, 0.3878, 0.5027, 0.4076]}, {"w": "new", "b": [0.509, 0.3878, 0.5511, 0.4076]}, {"w": "problem", "b": [0.5574, 0.3878, 0.6415, 0.4076]}, {"w": "for", "b": [0.6478, 0.3878, 0.6772, 0.4076]}, {"w": "which", "b": [0.6835, 0.3878, 0.7451, 0.4076]}, {"w": "there", "b": [0.7514, 0.3878, 0.8019, 0.4076]}, {"w": "is", "b": [0.8082, 0.3878, 0.825, 0.4076]}, {"w": "no", "b": [0.8313, 0.3878, 0.8565, 0.4076]}, {"w": "known", "b": [0.1294, 0.4083, 0.1981, 0.4281]}, {"w": "solution", "b": [0.2044, 0.4083, 0.2857, 0.4281]}, {"w": "(yet).", "b": [0.292, 0.4083, 0.3459, 0.4281]}, {"w": "A", "b": [0.3522, 0.4083, 0.3704, 0.4281]}, {"w": "classic", "b": [0.3768, 0.4083, 0.444, 0.4281]}, {"w": "example", "b": [0.4503, 0.4083, 0.5358, 0.4281]}, {"w": "is", "b": [0.5421, 0.4083, 0.5589, 0.4281]}, {"w": "that", "b": [0.5652, 0.4083, 0.6031, 0.4281]}, {"w": "of", "b": [0.6094, 0.4083, 0.6304, 0.4281]}, {"w": "unbalanced", "b": [0.6367, 0.4083, 0.7516, 0.4281]}, {"w": "classification", "b": [0.1294, 0.4288, 0.2625, 0.4486]}, {"w": "tasks,", "b": [0.2688, 0.4288, 0.3256, 0.4486]}, {"w": "where", "b": [0.3319, 0.4288, 0.3935, 0.4486]}, {"w": "some", "b": [0.3998, 0.4288, 0.4531, 0.4486]}, {"w": "classes", "b": [0.4594, 0.4288, 0.5294, 0.4486]}, {"w": "are", "b": [0.5357, 0.4288, 0.5665, 0.4486]}, {"w": "much", "b": [0.5728, 0.4288, 0.6289, 0.4486]}, {"w": "more", "b": [0.6352, 0.4288, 0.687, 0.4486]}, {"w": "common", "b": [0.6933, 0.4288, 0.7816, 0.4486]}, {"w": "than", "b": [0.7879, 0.4288, 0.8314, 0.4486]}, {"w": "others.", "b": [0.1294, 0.4493, 0.1974, 0.4691]}, {"w": "If", "b": [0.2037, 0.4493, 0.2205, 0.4691]}, {"w": "your", "b": [0.2268, 0.4493, 0.273, 0.4691]}, {"w": "dataset", "b": [0.2793, 0.4493, 0.3494, 0.4691]}, {"w": "contains", "b": [0.3557, 0.4493, 0.4398, 0.4691]}, {"w": "90%", "b": [0.4461, 0.4493, 0.4923, 0.4691]}, {"w": "instances", "b": [0.4986, 0.4493, 0.5911, 0.4691]}, {"w": "of", "b": [0.5974, 0.4493, 0.6184, 0.4691]}, {"w": "class", "b": [0.6247, 0.4493, 0.6738, 0.4691]}, {"w": "A", "b": [0.6801, 0.4493, 0.6983, 0.4691]}, {"w": "and", "b": [0.7046, 0.4493, 0.741, 0.4691]}, {"w": "10%", "b": [0.7473, 0.4493, 0.7936, 0.4691]}, {"w": "instances", "b": [0.1294, 0.4698, 0.2219, 0.4896]}, {"w": "of", "b": [0.2282, 0.4698, 0.2492, 0.4896]}, {"w": "class", "b": [0.2555, 0.4698, 0.3046, 0.4896]}, {"w": "B,", "b": [0.3108, 0.4698, 0.334, 0.4896]}, {"w": "then", "b": [0.3403, 0.4698, 0.3837, 0.4896]}, {"w": "a", "b": [0.39, 0.4698, 0.4012, 0.4896]}, {"w": "common-sense", "b": [0.4075, 0.4698, 0.5589, 0.4896]}, {"w": "approach", "b": [0.5652, 0.4698, 0.6576, 0.4896]}, {"w": "to", "b": [0.6639, 0.4698, 0.6836, 0.4896]}, {"w": "the", "b": [0.6899, 0.4698, 0.7207, 0.4896]}, {"w": "classification", "b": [0.727, 0.4698, 0.8601, 0.4896]}, {"w": "task", "b": [0.1294, 0.4903, 0.1701, 0.5101]}, {"w": "is", "b": [0.1764, 0.4903, 0.1932, 0.5101]}, {"w": "to", "b": [0.1995, 0.4903, 0.2191, 0.5101]}, {"w": "always", "b": [0.2254, 0.4903, 0.2955, 0.5101]}, {"w": "predict", "b": [0.3018, 0.4903, 0.3718, 0.5101]}, {"w": "“A”", "b": [0.3781, 0.4903, 0.4188, 0.5101]}, {"w": "when", "b": [0.4251, 0.4903, 0.4797, 0.5101]}, {"w": "presented", "b": [0.486, 0.4903, 0.5827, 0.5101]}, {"w": "with", "b": [0.589, 0.4903, 0.6338, 0.5101]}, {"w": "a", "b": [0.6401, 0.4903, 0.6513, 0.5101]}, {"w": "new", "b": [0.6576, 0.4903, 0.6997, 0.5101]}, {"w": "sample.", "b": [0.706, 0.4903, 0.7837, 0.5101]}, {"w": "Such", "b": [0.79, 0.4903, 0.8405, 0.5101]}, {"w": "a", "b": [0.8467, 0.4903, 0.8579, 0.5101]}, {"w": "classifier", "b": [0.1294, 0.5108, 0.2205, 0.5306]}, {"w": "is", "b": [0.2268, 0.5108, 0.2436, 0.5306]}, {"w": "90%", "b": [0.2499, 0.5108, 0.2962, 0.5306]}, {"w": "accurate", "b": [0.3025, 0.5108, 0.3865, 0.5306]}, {"w": "overall,", "b": [0.3928, 0.5108, 0.4692, 0.5306]}, {"w": "and", "b": [0.4755, 0.5108, 0.5119, 0.5306]}, {"w": "any", "b": [0.5182, 0.5108, 0.5546, 0.5306]}, {"w": "learning-based", "b": [0.5609, 0.5108, 0.7094, 0.5306]}, {"w": "approach", "b": [0.7157, 0.5108, 0.8082, 0.5306]}, {"w": "should", "b": [0.1294, 0.5313, 0.1967, 0.5511]}, {"w": "therefore", "b": [0.203, 0.5313, 0.294, 0.5511]}, {"w": "beat", "b": [0.3003, 0.5313, 0.3424, 0.5511]}, {"w": "this", "b": [0.3487, 0.5313, 0.3851, 0.5511]}, {"w": "90%", "b": [0.3914, 0.5313, 0.4377, 0.5511]}, {"w": "score", "b": [0.444, 0.5313, 0.4972, 0.5511]}, {"w": "in", "b": [0.5035, 0.5313, 0.5231, 0.5511]}, {"w": "order", "b": [0.5294, 0.5313, 0.5827, 0.5511]}, {"w": "to", "b": [0.589, 0.5313, 0.6086, 0.5511]}, {"w": "demonstrate", "b": [0.6149, 0.5313, 0.7382, 0.5511]}, {"w": "usefulness.", "b": [0.7444, 0.5313, 0.8558, 0.5511]}, {"w": "Sometimes,", "b": [0.1294, 0.5518, 0.2478, 0.5716]}, {"w": "such", "b": [0.2542, 0.5518, 0.3004, 0.5716]}, {"w": "elementary", "b": [0.3067, 0.5518, 0.4188, 0.5716]}, {"w": "baselines", "b": [0.4251, 0.5518, 0.5176, 0.5716]}, {"w": "can", "b": [0.5239, 0.5518, 0.5589, 0.5716]}, {"w": "prove", "b": [0.5652, 0.5518, 0.6226, 0.5716]}, {"w": "surprisingly", "b": [0.6289, 0.5518, 0.7495, 0.5716]}, {"w": "hard", "b": [0.7558, 0.5518, 0.8006, 0.5716]}, {"w": "to", "b": [0.8069, 0.5518, 0.8265, 0.5716]}, {"w": "beat.", "b": [0.1294, 0.5723, 0.1777, 0.5921]}]}, {"id": "b_4", "type": "paragraph", "text": "In this case, the temperature timeseries can safely be assumed to be continuous (the temperatures tomorrow are likely to be close to the temperatures today) as well as periodical with a daily period. Thus a common-sense approach is to always predict that the temperature 24 hours from now will be equal to the temperature right now. Let’s evaluate this approach, using the mean absolute error (MAE) metric:", "words": [{"w": "In", "b": [0.1294, 0.6151, 0.1504, 0.6349]}, {"w": "this", "b": [0.1567, 0.6151, 0.1932, 0.6349]}, {"w": "case,", "b": [0.1995, 0.6151, 0.2492, 0.6349]}, {"w": "the", "b": [0.2555, 0.6151, 0.2863, 0.6349]}, {"w": "temperature", "b": [0.2926, 0.6151, 0.4131, 0.6349]}, {"w": "timeseries", "b": [0.4194, 0.6151, 0.5217, 0.6349]}, {"w": "can", "b": [0.528, 0.6151, 0.563, 0.6349]}, {"w": "safely", "b": [0.5693, 0.6151, 0.6296, 0.6349]}, {"w": "be", "b": [0.6359, 0.6151, 0.6597, 0.6349]}, {"w": "assumed", "b": [0.666, 0.6151, 0.7529, 0.6349]}, {"w": "to", "b": [0.7592, 0.6151, 0.7788, 0.6349]}, {"w": "be", "b": [0.7851, 0.6151, 0.8089, 0.6349]}, {"w": "continuous", "b": [0.1294, 0.6356, 0.2401, 0.6554]}, {"w": "(the", "b": [0.2464, 0.6356, 0.2857, 0.6554]}, {"w": "temperatures", "b": [0.292, 0.6356, 0.4223, 0.6554]}, {"w": "tomorrow", "b": [0.4286, 0.6356, 0.5281, 0.6554]}, {"w": "are", "b": [0.5344, 0.6356, 0.5652, 0.6554]}, {"w": "likely", "b": [0.5715, 0.6356, 0.6289, 0.6554]}, {"w": "to", "b": [0.6352, 0.6356, 0.6549, 0.6554]}, {"w": "be", "b": [0.6612, 0.6356, 0.685, 0.6554]}, {"w": "close", "b": [0.6912, 0.6356, 0.743, 0.6554]}, {"w": "to", "b": [0.7493, 0.6356, 0.769, 0.6554]}, {"w": "the", "b": [0.7753, 0.6356, 0.8061, 0.6554]}, {"w": "temperatures", "b": [0.1294, 0.6561, 0.2597, 0.6759]}, {"w": "today)", "b": [0.266, 0.6561, 0.3305, 0.6759]}, {"w": "as", "b": [0.3368, 0.6561, 0.3578, 0.6759]}, {"w": "well", "b": [0.3641, 0.6561, 0.4075, 0.6759]}, {"w": "as", "b": [0.4138, 0.6561, 0.4348, 0.6759]}, {"w": "periodical", "b": [0.4412, 0.6561, 0.542, 0.6759]}, {"w": "with", "b": [0.5483, 0.6561, 0.5932, 0.6759]}, {"w": "a", "b": [0.5995, 0.6561, 0.6107, 0.6759]}, {"w": "daily", "b": [0.617, 0.6561, 0.6675, 0.6759]}, {"w": "period.", "b": [0.6738, 0.6561, 0.7445, 0.6759]}, {"w": "Thus", "b": [0.7508, 0.6561, 0.8013, 0.6759]}, {"w": "a", "b": [0.8076, 0.6561, 0.8188, 0.6759]}, {"w": "common-sense", "b": [0.1294, 0.6766, 0.2807, 0.6964]}, {"w": "approach", "b": [0.287, 0.6766, 0.3795, 0.6964]}, {"w": "is", "b": [0.3858, 0.6766, 0.4026, 0.6964]}, {"w": "to", "b": [0.4089, 0.6766, 0.4286, 0.6964]}, {"w": "always", "b": [0.4349, 0.6766, 0.5049, 0.6964]}, {"w": "predict", "b": [0.5112, 0.6766, 0.5813, 0.6964]}, {"w": "that", "b": [0.5875, 0.6766, 0.6254, 0.6964]}, {"w": "the", "b": [0.6317, 0.6766, 0.6625, 0.6964]}, {"w": "temperature", "b": [0.6688, 0.6766, 0.7893, 0.6964]}, {"w": "24", "b": [0.7956, 0.6766, 0.8208, 0.6964]}, {"w": "hours", "b": [0.1294, 0.6971, 0.1855, 0.7169]}, {"w": "from", "b": [0.1918, 0.6971, 0.2408, 0.7169]}, {"w": "now", "b": [0.2471, 0.6971, 0.2906, 0.7169]}, {"w": "will", "b": [0.2969, 0.6971, 0.3361, 0.7169]}, {"w": "be", "b": [0.3424, 0.6971, 0.3662, 0.7169]}, {"w": "equal", "b": [0.3725, 0.6971, 0.4272, 0.7169]}, {"w": "to", "b": [0.4335, 0.6971, 0.4531, 0.7169]}, {"w": "the", "b": [0.4594, 0.6971, 0.4902, 0.7169]}, {"w": "temperature", "b": [0.4965, 0.6971, 0.617, 0.7169]}, {"w": "right", "b": [0.6233, 0.6971, 0.671, 0.7169]}, {"w": "now.", "b": [0.6773, 0.6971, 0.7253, 0.7169]}, {"w": "Let’s", "b": [0.7316, 0.6971, 0.7821, 0.7169]}, {"w": "evaluate", "b": [0.1294, 0.7176, 0.2135, 0.7374]}, {"w": "this", "b": [0.2198, 0.7176, 0.2562, 0.7374]}, {"w": "approach,", "b": [0.2625, 0.7176, 0.3613, 0.7374]}, {"w": "using", "b": [0.3676, 0.7176, 0.4223, 0.7374]}, {"w": "the", "b": [0.4286, 0.7176, 0.4594, 0.7374]}, {"w": "mean", "b": [0.4656, 0.7176, 0.5203, 0.7374]}, {"w": "absolute", "b": [0.5266, 0.7176, 0.6107, 0.7374]}, {"w": "error", "b": [0.617, 0.7176, 0.666, 0.7374]}, {"w": "(MAE)", "b": [0.6723, 0.7176, 0.7451, 0.7374]}, {"w": "metric:", "b": [0.7515, 0.7176, 0.8229, 0.7374]}]}, {"id": "b_5", "type": "equation", "text": "np.mean(np.abs(preds - targets))", "words": [{"w": "np.mean(np.abs(preds", "b": [0.1357, 0.7554, 0.3628, 0.7705]}, {"w": "-", "b": [0.3741, 0.7554, 0.3855, 0.7705]}, {"w": "targets))", "b": [0.3968, 0.7554, 0.499, 0.7705]}]}, {"id": "b_6", "type": "paragraph", "text": "Here’s the evaluation loop.", "words": [{"w": "Here’s", "b": [0.1294, 0.7934, 0.1952, 0.8131]}, {"w": "the", "b": [0.2016, 0.7934, 0.2324, 0.8131]}, {"w": "evaluation", "b": [0.2387, 0.7934, 0.3438, 0.8131]}, {"w": "loop.", "b": [0.3501, 0.7934, 0.4012, 0.8131]}]}, {"id": "b_7", "type": "equation", "text": "Listing 6.35. Computing the common-sense baseline MAE", "words": [{"w": "Listing", "b": [0.1294, 0.8312, 0.1862, 0.846]}, {"w": "6.35.", "b": [0.1909, 0.8312, 0.2288, 0.846]}, {"w": "Computing", "b": [0.2335, 0.8312, 0.3249, 0.846]}, {"w": "the", "b": [0.3297, 0.8312, 0.3549, 0.846]}, {"w": "common-sense", "b": [0.3596, 0.8312, 0.4773, 0.846]}, {"w": "baseline", "b": [0.482, 0.8312, 0.5472, 0.846]}, {"w": "MAE", "b": [0.5519, 0.8312, 0.5961, 0.846]}]}, {"id": "b_8", "type": "equation", "text": "def evaluate_naive_method(): batch_maes = [] for step in range(val_steps):", "words": [{"w": "def", "b": [0.1357, 0.8596, 0.1698, 0.8748]}, {"w": "evaluate_naive_method():", "b": [0.1811, 0.8596, 0.4536, 0.8748]}, {"w": "batch_maes", "b": [0.1811, 0.8748, 0.2946, 0.8899]}, {"w": "=", "b": [0.306, 0.8748, 0.3173, 0.8899]}, {"w": "[]", "b": [0.3287, 0.8748, 0.3514, 0.8899]}, {"w": "for", "b": [0.1811, 0.8899, 0.2152, 0.9051]}, {"w": "step", "b": [0.2265, 0.8899, 0.2719, 0.9051]}, {"w": "in", "b": [0.2833, 0.8899, 0.306, 0.9051]}, {"w": "range(val_steps):", "b": [0.3173, 0.8899, 0.5103, 0.9051]}]}]}, {"page": 281, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "samples, targets = next(val_gen) preds = samples[:, -1, 1] mae = np.mean(np.abs(preds - targets)) batch_maes.append(mae) print(np.mean(batch_maes)) evaluate_naive_method()", "words": [{"w": "samples,", "b": [0.2265, 0.0851, 0.3173, 0.1002]}, {"w": "targets", "b": [0.3287, 0.0851, 0.4082, 0.1002]}, {"w": "=", "b": [0.4195, 0.0851, 0.4309, 0.1002]}, {"w": "next(val_gen)", "b": [0.4422, 0.0851, 0.5898, 0.1002]}, {"w": "preds", "b": [0.2265, 0.1002, 0.2833, 0.1154]}, {"w": "=", "b": [0.2946, 0.1002, 0.306, 0.1154]}, {"w": "samples[:,", "b": [0.3173, 0.1002, 0.4309, 0.1154]}, {"w": "-1,", "b": [0.4422, 0.1002, 0.4763, 0.1154]}, {"w": "1]", "b": [0.4876, 0.1002, 0.5103, 0.1154]}, {"w": "mae", "b": [0.2265, 0.1154, 0.2606, 0.1305]}, {"w": "=", "b": [0.2719, 0.1154, 0.2833, 0.1305]}, {"w": "np.mean(np.abs(preds", "b": [0.2946, 0.1154, 0.5217, 0.1305]}, {"w": "-", "b": [0.533, 0.1154, 0.5444, 0.1305]}, {"w": "targets))", "b": [0.5557, 0.1154, 0.6579, 0.1305]}, {"w": "batch_maes.append(mae)", "b": [0.2265, 0.1305, 0.4763, 0.1457]}, {"w": "print(np.mean(batch_maes))", "b": [0.1811, 0.1457, 0.4763, 0.1608]}, {"w": "evaluate_naive_method()", "b": [0.1357, 0.176, 0.3968, 0.1911]}]}, {"id": "b_1", "type": "paragraph", "text": "This yields an MAE of 0.29. Because the temperature data has been normalized to be centered on 0 and have a standard deviation of 1, this number isn’t immediately interpretable. It translates to an average absolute error of 0.29 × temperature_std degrees Celsius: 2.57°C.", "words": [{"w": "This", "b": [0.1294, 0.214, 0.1743, 0.2338]}, {"w": "yields", "b": [0.1806, 0.214, 0.2408, 0.2338]}, {"w": "an", "b": [0.2471, 0.214, 0.271, 0.2338]}, {"w": "MAE", "b": [0.2773, 0.214, 0.3333, 0.2338]}, {"w": "of", "b": [0.3396, 0.214, 0.3606, 0.2338]}, {"w": "0.29.", "b": [0.3669, 0.214, 0.4174, 0.2338]}, {"w": "Because", "b": [0.4237, 0.214, 0.5077, 0.2338]}, {"w": "the", "b": [0.5141, 0.214, 0.5449, 0.2338]}, {"w": "temperature", "b": [0.5512, 0.214, 0.6717, 0.2338]}, {"w": "data", "b": [0.678, 0.214, 0.72, 0.2338]}, {"w": "has", "b": [0.7263, 0.214, 0.7599, 0.2338]}, {"w": "been", "b": [0.7662, 0.214, 0.8139, 0.2338]}, {"w": "normalized", "b": [0.1294, 0.2345, 0.2429, 0.2543]}, {"w": "to", "b": [0.2492, 0.2345, 0.2688, 0.2543]}, {"w": "be", "b": [0.2751, 0.2345, 0.299, 0.2543]}, {"w": "centered", "b": [0.3053, 0.2345, 0.3907, 0.2543]}, {"w": "on", "b": [0.397, 0.2345, 0.4222, 0.2543]}, {"w": "0", "b": [0.4285, 0.2345, 0.4412, 0.2543]}, {"w": "and", "b": [0.4475, 0.2345, 0.4839, 0.2543]}, {"w": "have", "b": [0.4902, 0.2345, 0.5378, 0.2543]}, {"w": "a", "b": [0.5441, 0.2345, 0.5553, 0.2543]}, {"w": "standard", "b": [0.5616, 0.2345, 0.6471, 0.2543]}, {"w": "deviation", "b": [0.6534, 0.2345, 0.7473, 0.2543]}, {"w": "of", "b": [0.7535, 0.2345, 0.7745, 0.2543]}, {"w": "1,", "b": [0.7808, 0.2345, 0.7997, 0.2543]}, {"w": "this", "b": [0.806, 0.2345, 0.8425, 0.2543]}, {"w": "number", "b": [0.1294, 0.255, 0.2065, 0.2748]}, {"w": "isn’t", "b": [0.2128, 0.255, 0.2572, 0.2748]}, {"w": "immediately", "b": [0.2635, 0.255, 0.3896, 0.2748]}, {"w": "interpretable.", "b": [0.3959, 0.255, 0.5297, 0.2748]}, {"w": "It", "b": [0.536, 0.255, 0.5514, 0.2748]}, {"w": "translates", "b": [0.5577, 0.255, 0.653, 0.2748]}, {"w": "to", "b": [0.6593, 0.255, 0.6789, 0.2748]}, {"w": "an", "b": [0.6853, 0.255, 0.7091, 0.2748]}, {"w": "average", "b": [0.7154, 0.255, 0.7938, 0.2748]}, {"w": "absolute", "b": [0.1294, 0.2755, 0.2135, 0.2953]}, {"w": "error", "b": [0.2198, 0.2755, 0.2688, 0.2953]}, {"w": "of", "b": [0.2751, 0.2755, 0.2961, 0.2953]}, {"w": "0.29", "b": [0.3024, 0.2755, 0.3466, 0.2953]}, {"w": "×", "b": [0.3529, 0.2755, 0.3671, 0.2953]}, {"w": "temperature_std", "b": [0.3734, 0.2766, 0.6004, 0.2968]}, {"w": "degrees", "b": [0.6068, 0.2755, 0.6838, 0.2953]}, {"w": "Celsius:", "b": [0.6901, 0.2755, 0.7714, 0.2953]}, {"w": "2.57°C.", "b": [0.7777, 0.2755, 0.8551, 0.2953]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.36. Converting the MAE back to a Celsius error", "words": [{"w": "Listing", "b": [0.1294, 0.3143, 0.1862, 0.3291]}, {"w": "6.36.", "b": [0.1909, 0.3143, 0.2288, 0.3291]}, {"w": "Converting", "b": [0.2335, 0.3143, 0.3249, 0.3291]}, {"w": "the", "b": [0.3296, 0.3143, 0.3549, 0.3291]}, {"w": "MAE", "b": [0.3596, 0.3143, 0.4037, 0.3291]}, {"w": "back", "b": [0.4085, 0.3143, 0.4474, 0.3291]}, {"w": "to", "b": [0.4521, 0.3143, 0.4678, 0.3291]}, {"w": "a", "b": [0.4726, 0.3143, 0.482, 0.3291]}, {"w": "Celsius", "b": [0.4868, 0.3143, 0.5446, 0.3291]}, {"w": "error", "b": [0.5493, 0.3143, 0.592, 0.3291]}]}, {"id": "b_3", "type": "equation", "text": "celsius_mae = 0.29 * std[1]", "words": [{"w": "celsius_mae", "b": [0.1357, 0.3427, 0.2606, 0.3578]}, {"w": "=", "b": [0.2719, 0.3427, 0.2833, 0.3578]}, {"w": "0.29", "b": [0.2946, 0.3427, 0.34, 0.3578]}, {"w": "*", "b": [0.3514, 0.3427, 0.3628, 0.3578]}, {"w": "std[1]", "b": [0.3741, 0.3427, 0.4422, 0.3578]}]}, {"id": "b_4", "type": "paragraph", "text": "That’s a fairly large average absolute error. Now the game is to use your knowledge of deep learning to do better.", "words": [{"w": "That’s", "b": [0.1294, 0.3807, 0.1925, 0.4004]}, {"w": "a", "b": [0.1988, 0.3807, 0.21, 0.4004]}, {"w": "fairly", "b": [0.2163, 0.3807, 0.2709, 0.4004]}, {"w": "large", "b": [0.2772, 0.3807, 0.3272, 0.4004]}, {"w": "average", "b": [0.3335, 0.3807, 0.4119, 0.4004]}, {"w": "absolute", "b": [0.4182, 0.3807, 0.5023, 0.4004]}, {"w": "error.", "b": [0.5086, 0.3807, 0.5625, 0.4004]}, {"w": "Now", "b": [0.5688, 0.3807, 0.6178, 0.4004]}, {"w": "the", "b": [0.6241, 0.3807, 0.655, 0.4004]}, {"w": "game", "b": [0.6613, 0.3807, 0.7159, 0.4004]}, {"w": "is", "b": [0.7222, 0.3807, 0.739, 0.4004]}, {"w": "to", "b": [0.7453, 0.3807, 0.765, 0.4004]}, {"w": "use", "b": [0.7713, 0.3807, 0.8049, 0.4004]}, {"w": "your", "b": [0.8112, 0.3807, 0.8575, 0.4004]}, {"w": "knowledge", "b": [0.1294, 0.4012, 0.2401, 0.4209]}, {"w": "of", "b": [0.2464, 0.4012, 0.2674, 0.4209]}, {"w": "deep", "b": [0.2737, 0.4012, 0.3214, 0.4209]}, {"w": "learning", "b": [0.3277, 0.4012, 0.4103, 0.4209]}, {"w": "to", "b": [0.4166, 0.4012, 0.4363, 0.4209]}, {"w": "do", "b": [0.4426, 0.4012, 0.4678, 0.4209]}, {"w": "better.", "b": [0.4741, 0.4012, 0.5364, 0.4209]}]}, {"id": "b_5", "type": "equation", "text": "6.3.4. A basic machine-learning approach", "words": [{"w": "6.3.4.", "b": [0.1294, 0.4484, 0.1862, 0.4682]}, {"w": "A", "b": [0.1925, 0.4484, 0.2107, 0.4682]}, {"w": "basic", "b": [0.217, 0.4484, 0.2717, 0.4682]}, {"w": "machine-learning", "b": [0.278, 0.4484, 0.4672, 0.4682]}, {"w": "approach", "b": [0.4735, 0.4484, 0.5753, 0.4682]}]}, {"id": "b_6", "type": "paragraph", "text": "In the same way that it’s useful to establish a common-sense baseline before trying machine-learning approaches, it’s useful to try simple, cheap machine-learning models (such as small, densely connected networks) before looking into complicated and computationally expensive models such as RNNs. This is the best way to make sure any further complexity you throw at the problem is legitimate and delivers real benefits.", "words": [{"w": "In", "b": [0.1294, 0.4912, 0.1504, 0.511]}, {"w": "the", "b": [0.1567, 0.4912, 0.1876, 0.511]}, {"w": "same", "b": [0.1939, 0.4912, 0.2457, 0.511]}, {"w": "way", "b": [0.252, 0.4912, 0.294, 0.511]}, {"w": "that", "b": [0.3003, 0.4912, 0.3382, 0.511]}, {"w": "it’s", "b": [0.3445, 0.4912, 0.3753, 0.511]}, {"w": "useful", "b": [0.3816, 0.4912, 0.4433, 0.511]}, {"w": "to", "b": [0.4496, 0.4912, 0.4692, 0.511]}, {"w": "establish", "b": [0.4755, 0.4912, 0.5638, 0.511]}, {"w": "a", "b": [0.5701, 0.4912, 0.5813, 0.511]}, {"w": "common-sense", "b": [0.5876, 0.4912, 0.7389, 0.511]}, {"w": "baseline", "b": [0.7452, 0.4912, 0.8279, 0.511]}, {"w": "before", "b": [0.1294, 0.5117, 0.1938, 0.5315]}, {"w": "trying", "b": [0.2001, 0.5117, 0.2604, 0.5315]}, {"w": "machine-learning", "b": [0.2667, 0.5117, 0.4432, 0.5315]}, {"w": "approaches,", "b": [0.4496, 0.5117, 0.5693, 0.5315]}, {"w": "it’s", "b": [0.5756, 0.5117, 0.6064, 0.5315]}, {"w": "useful", "b": [0.6127, 0.5117, 0.6744, 0.5315]}, {"w": "to", "b": [0.6807, 0.5117, 0.7003, 0.5315]}, {"w": "try", "b": [0.7066, 0.5117, 0.7346, 0.5315]}, {"w": "simple,", "b": [0.7409, 0.5117, 0.8145, 0.5315]}, {"w": "cheap", "b": [0.1294, 0.5322, 0.1882, 0.552]}, {"w": "machine-learning", "b": [0.1945, 0.5322, 0.3711, 0.552]}, {"w": "models", "b": [0.3774, 0.5322, 0.4503, 0.552]}, {"w": "(such", "b": [0.4566, 0.5322, 0.5112, 0.552]}, {"w": "as", "b": [0.5175, 0.5322, 0.5385, 0.552]}, {"w": "small,", "b": [0.5448, 0.5322, 0.6058, 0.552]}, {"w": "densely", "b": [0.6121, 0.5322, 0.6892, 0.552]}, {"w": "connected", "b": [0.6955, 0.5322, 0.7977, 0.552]}, {"w": "networks)", "b": [0.1294, 0.5527, 0.2303, 0.5725]}, {"w": "before", "b": [0.2366, 0.5527, 0.301, 0.5725]}, {"w": "looking", "b": [0.3073, 0.5527, 0.3844, 0.5725]}, {"w": "into", "b": [0.3907, 0.5527, 0.43, 0.5725]}, {"w": "complicated", "b": [0.4363, 0.5527, 0.5596, 0.5725]}, {"w": "and", "b": [0.5659, 0.5527, 0.6023, 0.5725]}, {"w": "computationally", "b": [0.6086, 0.5527, 0.7725, 0.5725]}, {"w": "expensive", "b": [0.1294, 0.5732, 0.2303, 0.593]}, {"w": "models", "b": [0.2366, 0.5732, 0.3095, 0.593]}, {"w": "such", "b": [0.3158, 0.5732, 0.362, 0.593]}, {"w": "as", "b": [0.3683, 0.5732, 0.3893, 0.593]}, {"w": "RNNs.", "b": [0.3956, 0.5732, 0.465, 0.593]}, {"w": "This", "b": [0.4713, 0.5732, 0.5162, 0.593]}, {"w": "is", "b": [0.5225, 0.5732, 0.5393, 0.593]}, {"w": "the", "b": [0.5456, 0.5732, 0.5764, 0.593]}, {"w": "best", "b": [0.5827, 0.5732, 0.6234, 0.593]}, {"w": "way", "b": [0.6297, 0.5732, 0.6717, 0.593]}, {"w": "to", "b": [0.678, 0.5732, 0.6976, 0.593]}, {"w": "make", "b": [0.704, 0.5732, 0.7586, 0.593]}, {"w": "sure", "b": [0.7649, 0.5732, 0.8069, 0.593]}, {"w": "any", "b": [0.8132, 0.5732, 0.8497, 0.593]}, {"w": "further", "b": [0.1294, 0.5937, 0.1981, 0.6135]}, {"w": "complexity", "b": [0.2044, 0.5937, 0.3179, 0.6135]}, {"w": "you", "b": [0.3242, 0.5937, 0.362, 0.6135]}, {"w": "throw", "b": [0.3683, 0.5937, 0.4272, 0.6135]}, {"w": "at", "b": [0.4335, 0.5937, 0.4517, 0.6135]}, {"w": "the", "b": [0.458, 0.5937, 0.4888, 0.6135]}, {"w": "problem", "b": [0.4951, 0.5937, 0.5792, 0.6135]}, {"w": "is", "b": [0.5854, 0.5937, 0.6023, 0.6135]}, {"w": "legitimate", "b": [0.6086, 0.5937, 0.7095, 0.6135]}, {"w": "and", "b": [0.7158, 0.5937, 0.7522, 0.6135]}, {"w": "delivers", "b": [0.7585, 0.5937, 0.8384, 0.6135]}, {"w": "real", "b": [0.1294, 0.6142, 0.1672, 0.634]}, {"w": "benefits.", "b": [0.1735, 0.6142, 0.2597, 0.634]}]}, {"id": "b_7", "type": "paragraph", "text": "The following listing shows a fully connected model that starts by flattening the data and then runs it through two Dense layers. Note the lack of activation function on the last Dense layer, which is typical for a regression problem. You use MAE as the loss. Because you evaluate on the exact same data and with the exact same metric you did with the common-sense approach, the results will be directly comparable.", "words": [{"w": "The", "b": [0.1294, 0.657, 0.1686, 0.6768]}, {"w": "following", "b": [0.1749, 0.657, 0.273, 0.6768]}, {"w": "listing", "b": [0.2794, 0.657, 0.3424, 0.6768]}, {"w": "shows", "b": [0.3487, 0.657, 0.4118, 0.6768]}, {"w": "a", "b": [0.4181, 0.657, 0.4293, 0.6768]}, {"w": "fully", "b": [0.4356, 0.657, 0.4833, 0.6768]}, {"w": "connected", "b": [0.4896, 0.657, 0.5919, 0.6768]}, {"w": "model", "b": [0.5982, 0.657, 0.6612, 0.6768]}, {"w": "that", "b": [0.6675, 0.657, 0.7054, 0.6768]}, {"w": "starts", "b": [0.7117, 0.657, 0.7649, 0.6768]}, {"w": "by", "b": [0.7712, 0.657, 0.7965, 0.6768]}, {"w": "flattening", "b": [0.1294, 0.6775, 0.2261, 0.6973]}, {"w": "the", "b": [0.2324, 0.6775, 0.2632, 0.6973]}, {"w": "data", "b": [0.2695, 0.6775, 0.3116, 0.6973]}, {"w": "and", "b": [0.3179, 0.6775, 0.3543, 0.6973]}, {"w": "then", "b": [0.3606, 0.6775, 0.404, 0.6973]}, {"w": "runs", "b": [0.4104, 0.6775, 0.4538, 0.6973]}, {"w": "it", "b": [0.4601, 0.6775, 0.4741, 0.6973]}, {"w": "through", "b": [0.4804, 0.6775, 0.5589, 0.6973]}, {"w": "two", "b": [0.5652, 0.6775, 0.6031, 0.6973]}, {"w": "Dense", "b": [0.6093, 0.6786, 0.685, 0.6987]}, {"w": "layers.", "b": [0.6913, 0.6775, 0.7578, 0.6973]}, {"w": "Note", "b": [0.7641, 0.6775, 0.8132, 0.6973]}, {"w": "the", "b": [0.8195, 0.6775, 0.8503, 0.6973]}, {"w": "lack", "b": [0.1294, 0.6989, 0.1714, 0.7186]}, {"w": "of", "b": [0.1777, 0.6989, 0.1988, 0.7186]}, {"w": "activation", "b": [0.2051, 0.6989, 0.3046, 0.7186]}, {"w": "function", "b": [0.3109, 0.6989, 0.3949, 0.7186]}, {"w": "on", "b": [0.4012, 0.6989, 0.4265, 0.7186]}, {"w": "the", "b": [0.4328, 0.6989, 0.4636, 0.7186]}, {"w": "last", "b": [0.4699, 0.6989, 0.5049, 0.7186]}, {"w": "Dense", "b": [0.5112, 0.6999, 0.5868, 0.7201]}, {"w": "layer,", "b": [0.5932, 0.6989, 0.6489, 0.7186]}, {"w": "which", "b": [0.6552, 0.6989, 0.7168, 0.7186]}, {"w": "is", "b": [0.7231, 0.6989, 0.74, 0.7186]}, {"w": "typical", "b": [0.7463, 0.6989, 0.8149, 0.7186]}, {"w": "for", "b": [0.8212, 0.6989, 0.8506, 0.7186]}, {"w": "a", "b": [0.857, 0.6989, 0.8682, 0.7186]}, {"w": "regression", "b": [0.1294, 0.7203, 0.2331, 0.74]}, {"w": "problem.", "b": [0.2394, 0.7203, 0.3298, 0.74]}, {"w": "You", "b": [0.3361, 0.7203, 0.377, 0.74]}, {"w": "use", "b": [0.3833, 0.7203, 0.4169, 0.74]}, {"w": "MAE", "b": [0.4232, 0.7203, 0.4793, 0.74]}, {"w": "as", "b": [0.4856, 0.7203, 0.5066, 0.74]}, {"w": "the", "b": [0.5129, 0.7203, 0.5437, 0.74]}, {"w": "loss.", "b": [0.55, 0.7203, 0.5956, 0.74]}, {"w": "Because", "b": [0.6019, 0.7203, 0.686, 0.74]}, {"w": "you", "b": [0.6923, 0.7203, 0.7301, 0.74]}, {"w": "evaluate", "b": [0.7364, 0.7203, 0.8205, 0.74]}, {"w": "on", "b": [0.8268, 0.7203, 0.852, 0.74]}, {"w": "the", "b": [0.1294, 0.7408, 0.1602, 0.7605]}, {"w": "exact", "b": [0.1665, 0.7408, 0.2198, 0.7605]}, {"w": "same", "b": [0.2261, 0.7408, 0.2779, 0.7605]}, {"w": "data", "b": [0.2842, 0.7408, 0.3262, 0.7605]}, {"w": "and", "b": [0.3326, 0.7408, 0.369, 0.7605]}, {"w": "with", "b": [0.3752, 0.7408, 0.4201, 0.7605]}, {"w": "the", "b": [0.4264, 0.7408, 0.4572, 0.7605]}, {"w": "exact", "b": [0.4635, 0.7408, 0.5167, 0.7605]}, {"w": "same", "b": [0.523, 0.7408, 0.5749, 0.7605]}, {"w": "metric", "b": [0.5812, 0.7408, 0.6456, 0.7605]}, {"w": "you", "b": [0.652, 0.7408, 0.6898, 0.7605]}, {"w": "did", "b": [0.6961, 0.7408, 0.7283, 0.7605]}, {"w": "with", "b": [0.7346, 0.7408, 0.7795, 0.7605]}, {"w": "the", "b": [0.7858, 0.7408, 0.8166, 0.7605]}, {"w": "common-sense", "b": [0.1294, 0.7613, 0.2807, 0.781]}, {"w": "approach,", "b": [0.287, 0.7613, 0.3858, 0.781]}, {"w": "the", "b": [0.3921, 0.7613, 0.4229, 0.781]}, {"w": "results", "b": [0.4292, 0.7613, 0.4951, 0.781]}, {"w": "will", "b": [0.5014, 0.7613, 0.5407, 0.781]}, {"w": "be", "b": [0.547, 0.7613, 0.5708, 0.781]}, {"w": "directly", "b": [0.5771, 0.7613, 0.6542, 0.781]}, {"w": "comparable.", "b": [0.6605, 0.7613, 0.7844, 0.781]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 6.37. Training and evaluating a densely connected model", "words": [{"w": "Listing", "b": [0.1294, 0.7991, 0.1862, 0.8139]}, {"w": "6.37.", "b": [0.1909, 0.7991, 0.2288, 0.8139]}, {"w": "Training", "b": [0.2335, 0.7991, 0.3036, 0.8139]}, {"w": "and", "b": [0.3083, 0.7991, 0.3388, 0.8139]}, {"w": "evaluating", "b": [0.3435, 0.7991, 0.4276, 0.8139]}, {"w": "a", "b": [0.4323, 0.7991, 0.4418, 0.8139]}, {"w": "densely", "b": [0.4465, 0.7991, 0.5065, 0.8139]}, {"w": "connected", "b": [0.5112, 0.7991, 0.5921, 0.8139]}, {"w": "model", "b": [0.5968, 0.7991, 0.6462, 0.8139]}]}, {"id": "b_9", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential()", "words": [{"w": "from", "b": [0.1357, 0.8275, 0.1811, 0.8427]}, {"w": "keras.models", "b": [0.1925, 0.8275, 0.3287, 0.8427]}, {"w": "import", "b": [0.34, 0.8275, 0.4082, 0.8427]}, {"w": "Sequential", "b": [0.4195, 0.8275, 0.533, 0.8427]}, {"w": "from", "b": [0.1357, 0.8427, 0.1811, 0.8578]}, {"w": "keras", "b": [0.1925, 0.8427, 0.2492, 0.8578]}, {"w": "import", "b": [0.2606, 0.8427, 0.3287, 0.8578]}, {"w": "layers", "b": [0.34, 0.8427, 0.4082, 0.8578]}, {"w": "from", "b": [0.1357, 0.8579, 0.1811, 0.873]}, {"w": "keras.optimizers", "b": [0.1925, 0.8579, 0.3741, 0.873]}, {"w": "import", "b": [0.3855, 0.8579, 0.4536, 0.873]}, {"w": "RMSprop", "b": [0.4649, 0.8579, 0.5444, 0.873]}, {"w": "model", "b": [0.1357, 0.8882, 0.1925, 0.9033]}, {"w": "=", "b": [0.2038, 0.8882, 0.2152, 0.9033]}, {"w": "Sequential()", "b": [0.2265, 0.8882, 0.3628, 0.9033]}]}]}, {"page": 282, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.add(layers.Flatten(input_shape=(lookback // step, float_data.shape[-1]))) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(1)) model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=20, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "model.add(layers.Flatten(input_shape=(lookback", "b": [0.1357, 0.0851, 0.6579, 0.1002]}, {"w": "//", "b": [0.6692, 0.0851, 0.6919, 0.1002]}, {"w": "step,", "b": [0.7033, 0.0851, 0.7601, 0.1002]}, {"w": "float_data.shape[-1])))", "b": [0.1357, 0.1002, 0.3968, 0.1154]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.1154, 0.4309, 0.1305]}, {"w": "activation='relu'))", "b": [0.4422, 0.1154, 0.6579, 0.1305]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.1305, 0.4309, 0.1457]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.1457, 0.5217, 0.1608]}, {"w": "loss='mae')", "b": [0.533, 0.1457, 0.6579, 0.1608]}, {"w": "history", "b": [0.1357, 0.1608, 0.2152, 0.176]}, {"w": "=", "b": [0.2265, 0.1608, 0.2379, 0.176]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.1608, 0.5898, 0.176]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.176, 0.7033, 0.1911]}, {"w": "epochs=20,", "b": [0.4763, 0.1911, 0.5898, 0.2063]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.2063, 0.7487, 0.2214]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.2215, 0.7828, 0.2366]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s display the loss curves for validation and training (see figure 6.20).", "words": [{"w": "Let’s", "b": [0.1294, 0.2595, 0.1798, 0.2792]}, {"w": "display", "b": [0.1862, 0.2595, 0.259, 0.2792]}, {"w": "the", "b": [0.2653, 0.2595, 0.2962, 0.2792]}, {"w": "loss", "b": [0.3025, 0.2595, 0.3417, 0.2792]}, {"w": "curves", "b": [0.348, 0.2595, 0.4139, 0.2792]}, {"w": "for", "b": [0.4202, 0.2595, 0.4496, 0.2792]}, {"w": "validation", "b": [0.4559, 0.2595, 0.5568, 0.2792]}, {"w": "and", "b": [0.5631, 0.2595, 0.5995, 0.2792]}, {"w": "training", "b": [0.6058, 0.2595, 0.6843, 0.2792]}, {"w": "(see", "b": [0.6906, 0.2595, 0.7312, 0.2792]}, {"w": "figure", "b": [0.7375, 0.2595, 0.7977, 0.2792]}, {"w": "6.20).", "b": [0.804, 0.2595, 0.8629, 0.2792]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.20. Training and validation loss on the Jena temperature-forecasting task with a simple, densely connected network", "words": [{"w": "Figure", "b": [0.1294, 0.2973, 0.1827, 0.3121]}, {"w": "6.20.", "b": [0.1874, 0.2973, 0.2252, 0.3121]}, {"w": "Training", "b": [0.2299, 0.2973, 0.3, 0.3121]}, {"w": "and", "b": [0.3048, 0.2973, 0.3353, 0.3121]}, {"w": "validation", "b": [0.34, 0.2973, 0.4209, 0.3121]}, {"w": "loss", "b": [0.4257, 0.2973, 0.4551, 0.3121]}, {"w": "on", "b": [0.4598, 0.2973, 0.4798, 0.3121]}, {"w": "the", "b": [0.4846, 0.2973, 0.5098, 0.3121]}, {"w": "Jena", "b": [0.5145, 0.2973, 0.5523, 0.3121]}, {"w": "temperature-forecasting", "b": [0.5571, 0.2973, 0.7529, 0.3121]}, {"w": "task", "b": [0.7576, 0.2973, 0.7912, 0.3121]}, {"w": "with", "b": [0.796, 0.2973, 0.8317, 0.3121]}, {"w": "a", "b": [0.8364, 0.2973, 0.8459, 0.3121]}, {"w": "simple,", "b": [0.1294, 0.3125, 0.1867, 0.3273]}, {"w": "densely", "b": [0.1914, 0.3125, 0.2513, 0.3273]}, {"w": "connected", "b": [0.2561, 0.3125, 0.337, 0.3273]}, {"w": "network", "b": [0.3417, 0.3125, 0.409, 0.3273]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.38. Plotting results", "words": [{"w": "Listing", "b": [0.1294, 0.6128, 0.1862, 0.6277]}, {"w": "6.38.", "b": [0.1909, 0.6128, 0.2288, 0.6277]}, {"w": "Plotting", "b": [0.2335, 0.6128, 0.2976, 0.6277]}, {"w": "results", "b": [0.3023, 0.6128, 0.3556, 0.6277]}]}, {"id": "b_4", "type": "paragraph", "text": "import matplotlib.pyplot as plt loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(1, len(loss) + 1) plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()", "words": [{"w": "import", "b": [0.1357, 0.6413, 0.2038, 0.6564]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.6413, 0.4082, 0.6564]}, {"w": "as", "b": [0.4195, 0.6413, 0.4422, 0.6564]}, {"w": "plt", "b": [0.4536, 0.6413, 0.4876, 0.6564]}, {"w": "loss", "b": [0.1357, 0.6716, 0.1811, 0.6867]}, {"w": "=", "b": [0.1925, 0.6716, 0.2038, 0.6867]}, {"w": "history.history['loss']", "b": [0.2152, 0.6716, 0.4763, 0.6867]}, {"w": "val_loss", "b": [0.1357, 0.6867, 0.2265, 0.7019]}, {"w": "=", "b": [0.2379, 0.6867, 0.2492, 0.7019]}, {"w": "history.history['val_loss']", "b": [0.2606, 0.6867, 0.5671, 0.7019]}, {"w": "epochs", "b": [0.1357, 0.717, 0.2038, 0.7322]}, {"w": "=", "b": [0.2152, 0.717, 0.2265, 0.7322]}, {"w": "range(1,", "b": [0.2379, 0.717, 0.3287, 0.7322]}, {"w": "len(loss)", "b": [0.34, 0.717, 0.4422, 0.7322]}, {"w": "+", "b": [0.4536, 0.717, 0.4649, 0.7322]}, {"w": "1)", "b": [0.4763, 0.717, 0.499, 0.7322]}, {"w": "plt.figure()", "b": [0.1357, 0.7473, 0.2719, 0.7625]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.7776, 0.3173, 0.7928]}, {"w": "loss,", "b": [0.3287, 0.7776, 0.3855, 0.7928]}, {"w": "'bo',", "b": [0.3968, 0.7776, 0.4536, 0.7928]}, {"w": "label='Training", "b": [0.4649, 0.7776, 0.6352, 0.7928]}, {"w": "loss')", "b": [0.6465, 0.7776, 0.7146, 0.7928]}, {"w": "plt.plot(epochs,", "b": [0.1357, 0.7928, 0.3173, 0.8079]}, {"w": "val_loss,", "b": [0.3287, 0.7928, 0.4309, 0.8079]}, {"w": "'b',", "b": [0.4422, 0.7928, 0.4876, 0.8079]}, {"w": "label='Validation", "b": [0.499, 0.7928, 0.6919, 0.8079]}, {"w": "loss')", "b": [0.7033, 0.7928, 0.7714, 0.8079]}, {"w": "plt.title('Training", "b": [0.1357, 0.8079, 0.3514, 0.8231]}, {"w": "and", "b": [0.3628, 0.8079, 0.3968, 0.8231]}, {"w": "validation", "b": [0.4082, 0.8079, 0.5217, 0.8231]}, {"w": "loss')", "b": [0.533, 0.8079, 0.6011, 0.8231]}, {"w": "plt.legend()", "b": [0.1357, 0.8231, 0.2719, 0.8382]}, {"w": "plt.show()", "b": [0.1357, 0.8534, 0.2492, 0.8685]}]}]}, {"page": 283, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Some of the validation losses are close to the no-learning baseline, but not reliably. This goes to show the merit of having this baseline in the first place: it turns out to be not easy to outperform. Your common sense contains a lot of valuable information that a machine-learning model doesn’t have access to.", "words": [{"w": "Some", "b": [0.1294, 0.0857, 0.1869, 0.1054]}, {"w": "of", "b": [0.1932, 0.0857, 0.2142, 0.1054]}, {"w": "the", "b": [0.2205, 0.0857, 0.2513, 0.1054]}, {"w": "validation", "b": [0.2576, 0.0857, 0.3585, 0.1054]}, {"w": "losses", "b": [0.3648, 0.0857, 0.4251, 0.1054]}, {"w": "are", "b": [0.4314, 0.0857, 0.4622, 0.1054]}, {"w": "close", "b": [0.4685, 0.0857, 0.5204, 0.1054]}, {"w": "to", "b": [0.5267, 0.0857, 0.5463, 0.1054]}, {"w": "the", "b": [0.5526, 0.0857, 0.5834, 0.1054]}, {"w": "no-learning", "b": [0.5897, 0.0857, 0.706, 0.1054]}, {"w": "baseline,", "b": [0.7123, 0.0857, 0.8013, 0.1054]}, {"w": "but", "b": [0.8076, 0.0857, 0.8398, 0.1054]}, {"w": "not", "b": [0.1294, 0.1062, 0.1617, 0.1259]}, {"w": "reliably.", "b": [0.168, 0.1062, 0.2497, 0.1259]}, {"w": "This", "b": [0.256, 0.1062, 0.3008, 0.1259]}, {"w": "goes", "b": [0.3071, 0.1062, 0.3534, 0.1259]}, {"w": "to", "b": [0.3597, 0.1062, 0.3793, 0.1259]}, {"w": "show", "b": [0.3856, 0.1062, 0.4389, 0.1259]}, {"w": "the", "b": [0.4452, 0.1062, 0.476, 0.1259]}, {"w": "merit", "b": [0.4823, 0.1062, 0.5355, 0.1259]}, {"w": "of", "b": [0.5419, 0.1062, 0.5629, 0.1259]}, {"w": "having", "b": [0.5692, 0.1062, 0.6378, 0.1259]}, {"w": "this", "b": [0.6441, 0.1062, 0.6805, 0.1259]}, {"w": "baseline", "b": [0.6869, 0.1062, 0.7695, 0.1259]}, {"w": "in", "b": [0.7758, 0.1062, 0.7955, 0.1259]}, {"w": "the", "b": [0.8018, 0.1062, 0.8326, 0.1259]}, {"w": "first", "b": [0.1294, 0.1267, 0.1701, 0.1464]}, {"w": "place:", "b": [0.1764, 0.1267, 0.2366, 0.1464]}, {"w": "it", "b": [0.2429, 0.1267, 0.2569, 0.1464]}, {"w": "turns", "b": [0.2632, 0.1267, 0.3137, 0.1464]}, {"w": "out", "b": [0.32, 0.1267, 0.3522, 0.1464]}, {"w": "to", "b": [0.3585, 0.1267, 0.3782, 0.1464]}, {"w": "be", "b": [0.3845, 0.1267, 0.4083, 0.1464]}, {"w": "not", "b": [0.4146, 0.1267, 0.4468, 0.1464]}, {"w": "easy", "b": [0.4531, 0.1267, 0.498, 0.1464]}, {"w": "to", "b": [0.5043, 0.1267, 0.5239, 0.1464]}, {"w": "outperform.", "b": [0.5302, 0.1267, 0.65, 0.1464]}, {"w": "Your", "b": [0.6563, 0.1267, 0.7056, 0.1464]}, {"w": "common", "b": [0.7119, 0.1267, 0.8001, 0.1464]}, {"w": "sense", "b": [0.8065, 0.1267, 0.8611, 0.1464]}, {"w": "contains", "b": [0.1294, 0.1472, 0.2135, 0.1669]}, {"w": "a", "b": [0.2198, 0.1472, 0.231, 0.1669]}, {"w": "lot", "b": [0.2373, 0.1472, 0.2639, 0.1669]}, {"w": "of", "b": [0.2702, 0.1472, 0.2913, 0.1669]}, {"w": "valuable", "b": [0.2976, 0.1472, 0.383, 0.1669]}, {"w": "information", "b": [0.3893, 0.1472, 0.5084, 0.1669]}, {"w": "that", "b": [0.5147, 0.1472, 0.5525, 0.1669]}, {"w": "a", "b": [0.5588, 0.1472, 0.57, 0.1669]}, {"w": "machine-learning", "b": [0.5764, 0.1472, 0.7529, 0.1669]}, {"w": "model", "b": [0.7592, 0.1472, 0.8223, 0.1669]}, {"w": "doesn’t", "b": [0.1294, 0.1677, 0.2032, 0.1874]}, {"w": "have", "b": [0.2095, 0.1677, 0.2572, 0.1874]}, {"w": "access", "b": [0.2635, 0.1677, 0.3279, 0.1874]}, {"w": "to.", "b": [0.3342, 0.1677, 0.3601, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "You may wonder, if a simple, well-performing model exists to go from the data to the targets (the common-sense baseline), why doesn’t the model you’re training find it and improve on it? Because this simple solution isn’t what your training setup is looking for. The space of models in which you’re searching for a solution—that is, your hypothesis space—is the space of all possible two-layer networks with the configuration you defined. These networks are already fairly complicated. When you’re looking for a solution with a space of complicated models, the simple, well-performing baseline may be unlearnable, even if it’s technically part of the hypothesis space. That is a pretty significant limitation of machine learning in general: unless the learning algorithm is hardcoded to look for a specific kind of simple model, parameter learning can sometimes fail to find a simple solution to a simple problem.", "words": [{"w": "You", "b": [0.1294, 0.2105, 0.1703, 0.2302]}, {"w": "may", "b": [0.1766, 0.2105, 0.2201, 0.2302]}, {"w": "wonder,", "b": [0.2264, 0.2105, 0.3073, 0.2302]}, {"w": "if", "b": [0.3136, 0.2105, 0.329, 0.2302]}, {"w": "a", "b": [0.3353, 0.2105, 0.3465, 0.2302]}, {"w": "simple,", "b": [0.3529, 0.2105, 0.4264, 0.2302]}, {"w": "well-performing", "b": [0.4327, 0.2105, 0.5981, 0.2302]}, {"w": "model", "b": [0.6044, 0.2105, 0.6674, 0.2302]}, {"w": "exists", "b": [0.6738, 0.2105, 0.7312, 0.2302]}, {"w": "to", "b": [0.7375, 0.2105, 0.7571, 0.2302]}, {"w": "go", "b": [0.7635, 0.2105, 0.7887, 0.2302]}, {"w": "from", "b": [0.795, 0.2105, 0.844, 0.2302]}, {"w": "the", "b": [0.1294, 0.231, 0.1602, 0.2507]}, {"w": "data", "b": [0.1665, 0.231, 0.2086, 0.2507]}, {"w": "to", "b": [0.2149, 0.231, 0.2345, 0.2507]}, {"w": "the", "b": [0.2408, 0.231, 0.2716, 0.2507]}, {"w": "targets", "b": [0.2779, 0.231, 0.3447, 0.2507]}, {"w": "(the", "b": [0.351, 0.231, 0.3902, 0.2507]}, {"w": "common-sense", "b": [0.3965, 0.231, 0.5479, 0.2507]}, {"w": "baseline),", "b": [0.5542, 0.231, 0.6515, 0.2507]}, {"w": "why", "b": [0.6578, 0.231, 0.7012, 0.2507]}, {"w": "doesn’t", "b": [0.7075, 0.231, 0.7814, 0.2507]}, {"w": "the", "b": [0.7877, 0.231, 0.8185, 0.2507]}, {"w": "model", "b": [0.1294, 0.2515, 0.1925, 0.2712]}, {"w": "you’re", "b": [0.1988, 0.2515, 0.2646, 0.2712]}, {"w": "training", "b": [0.2709, 0.2515, 0.3494, 0.2712]}, {"w": "find", "b": [0.3557, 0.2515, 0.3964, 0.2712]}, {"w": "it", "b": [0.4027, 0.2515, 0.4167, 0.2712]}, {"w": "and", "b": [0.423, 0.2515, 0.4594, 0.2712]}, {"w": "improve", "b": [0.4657, 0.2515, 0.5498, 0.2712]}, {"w": "on", "b": [0.5561, 0.2515, 0.5813, 0.2712]}, {"w": "it?", "b": [0.5876, 0.2515, 0.6129, 0.2712]}, {"w": "Because", "b": [0.6192, 0.2515, 0.7032, 0.2712]}, {"w": "this", "b": [0.7095, 0.2515, 0.746, 0.2712]}, {"w": "simple", "b": [0.7523, 0.2515, 0.8196, 0.2712]}, {"w": "solution", "b": [0.1294, 0.272, 0.2107, 0.2917]}, {"w": "isn’t", "b": [0.217, 0.272, 0.2614, 0.2917]}, {"w": "what", "b": [0.2677, 0.272, 0.3168, 0.2917]}, {"w": "your", "b": [0.3231, 0.272, 0.3693, 0.2917]}, {"w": "training", "b": [0.3756, 0.272, 0.4541, 0.2917]}, {"w": "setup", "b": [0.4604, 0.272, 0.5136, 0.2917]}, {"w": "is", "b": [0.5199, 0.272, 0.5367, 0.2917]}, {"w": "looking", "b": [0.5431, 0.272, 0.6201, 0.2917]}, {"w": "for.", "b": [0.6264, 0.272, 0.6608, 0.2917]}, {"w": "The", "b": [0.6671, 0.272, 0.7063, 0.2917]}, {"w": "space", "b": [0.7126, 0.272, 0.7686, 0.2917]}, {"w": "of", "b": [0.7749, 0.272, 0.796, 0.2917]}, {"w": "models", "b": [0.1294, 0.2925, 0.2023, 0.3122]}, {"w": "in", "b": [0.2086, 0.2925, 0.2282, 0.3122]}, {"w": "which", "b": [0.2345, 0.2925, 0.2962, 0.3122]}, {"w": "you’re", "b": [0.3025, 0.2925, 0.3683, 0.3122]}, {"w": "searching", "b": [0.3746, 0.2925, 0.4713, 0.3122]}, {"w": "for", "b": [0.4776, 0.2925, 0.507, 0.3122]}, {"w": "a", "b": [0.5133, 0.2925, 0.5245, 0.3122]}, {"w": "solution—that", "b": [0.5308, 0.2925, 0.6752, 0.3122]}, {"w": "is,", "b": [0.6815, 0.2925, 0.7046, 0.3122]}, {"w": "your", "b": [0.7109, 0.2925, 0.7572, 0.3122]}, {"w": "hypothesis", "b": [0.1294, 0.313, 0.2373, 0.3327]}, {"w": "space—is", "b": [0.2436, 0.313, 0.3417, 0.3327]}, {"w": "the", "b": [0.348, 0.313, 0.3788, 0.3327]}, {"w": "space", "b": [0.3852, 0.313, 0.4412, 0.3327]}, {"w": "of", "b": [0.4475, 0.313, 0.4685, 0.3327]}, {"w": "all", "b": [0.4748, 0.313, 0.5, 0.3327]}, {"w": "possible", "b": [0.5063, 0.313, 0.589, 0.3327]}, {"w": "two-layer", "b": [0.5953, 0.313, 0.692, 0.3327]}, {"w": "networks", "b": [0.6983, 0.313, 0.7907, 0.3327]}, {"w": "with", "b": [0.7971, 0.313, 0.8419, 0.3327]}, {"w": "the", "b": [0.1294, 0.3335, 0.1602, 0.3532]}, {"w": "configuration", "b": [0.1665, 0.3335, 0.3025, 0.3532]}, {"w": "you", "b": [0.3088, 0.3335, 0.3466, 0.3532]}, {"w": "defined.", "b": [0.3529, 0.3335, 0.4349, 0.3532]}, {"w": "These", "b": [0.4412, 0.3335, 0.5014, 0.3532]}, {"w": "networks", "b": [0.5077, 0.3335, 0.6002, 0.3532]}, {"w": "are", "b": [0.6065, 0.3335, 0.6373, 0.3532]}, {"w": "already", "b": [0.6436, 0.3335, 0.7179, 0.3532]}, {"w": "fairly", "b": [0.7242, 0.3335, 0.7788, 0.3532]}, {"w": "complicated.", "b": [0.1294, 0.354, 0.259, 0.3737]}, {"w": "When", "b": [0.2653, 0.354, 0.3256, 0.3737]}, {"w": "you’re", "b": [0.3319, 0.354, 0.3977, 0.3737]}, {"w": "looking", "b": [0.404, 0.354, 0.481, 0.3737]}, {"w": "for", "b": [0.4874, 0.354, 0.5168, 0.3737]}, {"w": "a", "b": [0.5231, 0.354, 0.5343, 0.3737]}, {"w": "solution", "b": [0.5406, 0.354, 0.6219, 0.3737]}, {"w": "with", "b": [0.6282, 0.354, 0.673, 0.3737]}, {"w": "a", "b": [0.6793, 0.354, 0.6905, 0.3737]}, {"w": "space", "b": [0.6968, 0.354, 0.7529, 0.3737]}, {"w": "of", "b": [0.7592, 0.354, 0.7802, 0.3737]}, {"w": "complicated", "b": [0.1294, 0.3745, 0.2527, 0.3942]}, {"w": "models,", "b": [0.259, 0.3745, 0.3382, 0.3942]}, {"w": "the", "b": [0.3445, 0.3745, 0.3753, 0.3942]}, {"w": "simple,", "b": [0.3816, 0.3745, 0.4552, 0.3942]}, {"w": "well-performing", "b": [0.4615, 0.3745, 0.6269, 0.3942]}, {"w": "baseline", "b": [0.6332, 0.3745, 0.7158, 0.3942]}, {"w": "may", "b": [0.7221, 0.3745, 0.7656, 0.3942]}, {"w": "be", "b": [0.7719, 0.3745, 0.7957, 0.3942]}, {"w": "unlearnable,", "b": [0.1294, 0.395, 0.2534, 0.4147]}, {"w": "even", "b": [0.2597, 0.395, 0.3073, 0.4147]}, {"w": "if", "b": [0.3136, 0.395, 0.329, 0.4147]}, {"w": "it’s", "b": [0.3354, 0.395, 0.3662, 0.4147]}, {"w": "technically", "b": [0.3725, 0.395, 0.4832, 0.4147]}, {"w": "part", "b": [0.4894, 0.395, 0.5287, 0.4147]}, {"w": "of", "b": [0.535, 0.395, 0.556, 0.4147]}, {"w": "the", "b": [0.5623, 0.395, 0.5931, 0.4147]}, {"w": "hypothesis", "b": [0.5994, 0.395, 0.7073, 0.4147]}, {"w": "space.", "b": [0.7136, 0.395, 0.776, 0.4147]}, {"w": "That", "b": [0.7823, 0.395, 0.8285, 0.4147]}, {"w": "is", "b": [0.8348, 0.395, 0.8516, 0.4147]}, {"w": "a", "b": [0.858, 0.395, 0.8692, 0.4147]}, {"w": "pretty", "b": [0.1294, 0.4155, 0.1883, 0.4352]}, {"w": "significant", "b": [0.1946, 0.4155, 0.3011, 0.4352]}, {"w": "limitation", "b": [0.3074, 0.4155, 0.4055, 0.4352]}, {"w": "of", "b": [0.4118, 0.4155, 0.4328, 0.4352]}, {"w": "machine", "b": [0.4391, 0.4155, 0.5246, 0.4352]}, {"w": "learning", "b": [0.5309, 0.4155, 0.6136, 0.4352]}, {"w": "in", "b": [0.6199, 0.4155, 0.6395, 0.4352]}, {"w": "general:", "b": [0.6458, 0.4155, 0.7271, 0.4352]}, {"w": "unless", "b": [0.7334, 0.4155, 0.7964, 0.4352]}, {"w": "the", "b": [0.8027, 0.4155, 0.8336, 0.4352]}, {"w": "learning", "b": [0.1294, 0.436, 0.2121, 0.4557]}, {"w": "algorithm", "b": [0.2184, 0.436, 0.3165, 0.4557]}, {"w": "is", "b": [0.3228, 0.436, 0.3396, 0.4557]}, {"w": "hardcoded", "b": [0.3459, 0.436, 0.451, 0.4557]}, {"w": "to", "b": [0.4573, 0.436, 0.4769, 0.4557]}, {"w": "look", "b": [0.4832, 0.436, 0.528, 0.4557]}, {"w": "for", "b": [0.5344, 0.436, 0.5638, 0.4557]}, {"w": "a", "b": [0.5701, 0.436, 0.5813, 0.4557]}, {"w": "specific", "b": [0.5876, 0.436, 0.666, 0.4557]}, {"w": "kind", "b": [0.6723, 0.436, 0.7172, 0.4557]}, {"w": "of", "b": [0.7235, 0.436, 0.7445, 0.4557]}, {"w": "simple", "b": [0.7508, 0.436, 0.8181, 0.4557]}, {"w": "model,", "b": [0.1294, 0.4565, 0.1988, 0.4762]}, {"w": "parameter", "b": [0.2051, 0.4565, 0.3059, 0.4762]}, {"w": "learning", "b": [0.3122, 0.4565, 0.3949, 0.4762]}, {"w": "can", "b": [0.4012, 0.4565, 0.4362, 0.4762]}, {"w": "sometimes", "b": [0.4425, 0.4565, 0.5505, 0.4762]}, {"w": "fail", "b": [0.5568, 0.4565, 0.5904, 0.4762]}, {"w": "to", "b": [0.5967, 0.4565, 0.6163, 0.4762]}, {"w": "find", "b": [0.6226, 0.4565, 0.6633, 0.4762]}, {"w": "a", "b": [0.6696, 0.4565, 0.6808, 0.4762]}, {"w": "simple", "b": [0.6871, 0.4565, 0.7544, 0.4762]}, {"w": "solution", "b": [0.7605, 0.4565, 0.8419, 0.4762]}, {"w": "to", "b": [0.8482, 0.4565, 0.8678, 0.4762]}, {"w": "a", "b": [0.1294, 0.477, 0.1406, 0.4967]}, {"w": "simple", "b": [0.1469, 0.477, 0.2142, 0.4967]}, {"w": "problem.", "b": [0.2205, 0.477, 0.3109, 0.4967]}]}, {"id": "b_2", "type": "paragraph", "text": "6.3.5. A first recurrent baseline", "words": [{"w": "6.3.5.", "b": [0.1294, 0.5242, 0.1862, 0.5439]}, {"w": "A", "b": [0.1925, 0.5242, 0.2107, 0.5439]}, {"w": "first", "b": [0.217, 0.5242, 0.2618, 0.5439]}, {"w": "recurrent", "b": [0.2681, 0.5242, 0.3709, 0.5439]}, {"w": "baseline", "b": [0.3772, 0.5242, 0.4641, 0.5439]}]}, {"id": "b_3", "type": "paragraph", "text": "The first fully connected approach didn’t do well, but that doesn’t mean machine learning isn’t applicable to this problem. The previous approach first flattened the timeseries, which removed the notion of time from the input data. Let’s instead look at the data as what it is: a sequence, where causality and order matter. You’ll try a recurrent-sequence processing model—it should be the perfect fit for such sequence data, precisely because it exploits the temporal ordering of data points, unlike the first approach.", "words": [{"w": "The", "b": [0.1294, 0.567, 0.1686, 0.5867]}, {"w": "first", "b": [0.1749, 0.567, 0.2156, 0.5867]}, {"w": "fully", "b": [0.2219, 0.567, 0.2695, 0.5867]}, {"w": "connected", "b": [0.2758, 0.567, 0.3781, 0.5867]}, {"w": "approach", "b": [0.3844, 0.567, 0.4769, 0.5867]}, {"w": "didn’t", "b": [0.4832, 0.567, 0.5429, 0.5867]}, {"w": "do", "b": [0.5492, 0.567, 0.5745, 0.5867]}, {"w": "well,", "b": [0.5808, 0.567, 0.6305, 0.5867]}, {"w": "but", "b": [0.6368, 0.567, 0.6691, 0.5867]}, {"w": "that", "b": [0.6754, 0.567, 0.7132, 0.5867]}, {"w": "doesn’t", "b": [0.7195, 0.567, 0.7933, 0.5867]}, {"w": "mean", "b": [0.7996, 0.567, 0.8542, 0.5867]}, {"w": "machine", "b": [0.1294, 0.5875, 0.2149, 0.6072]}, {"w": "learning", "b": [0.2212, 0.5875, 0.3038, 0.6072]}, {"w": "isn’t", "b": [0.3102, 0.5875, 0.3545, 0.6072]}, {"w": "applicable", "b": [0.3608, 0.5875, 0.4645, 0.6072]}, {"w": "to", "b": [0.4708, 0.5875, 0.4904, 0.6072]}, {"w": "this", "b": [0.4967, 0.5875, 0.5332, 0.6072]}, {"w": "problem.", "b": [0.5395, 0.5875, 0.6299, 0.6072]}, {"w": "The", "b": [0.6361, 0.5875, 0.6753, 0.6072]}, {"w": "previous", "b": [0.6816, 0.5875, 0.7685, 0.6072]}, {"w": "approach", "b": [0.7748, 0.5875, 0.8673, 0.6072]}, {"w": "first", "b": [0.1294, 0.608, 0.1701, 0.6277]}, {"w": "flattened", "b": [0.1764, 0.608, 0.2646, 0.6277]}, {"w": "the", "b": [0.2709, 0.608, 0.3018, 0.6277]}, {"w": "timeseries,", "b": [0.3081, 0.608, 0.4167, 0.6277]}, {"w": "which", "b": [0.423, 0.608, 0.4846, 0.6277]}, {"w": "removed", "b": [0.4909, 0.608, 0.5792, 0.6277]}, {"w": "the", "b": [0.5855, 0.608, 0.6163, 0.6277]}, {"w": "notion", "b": [0.6226, 0.608, 0.6871, 0.6277]}, {"w": "of", "b": [0.6934, 0.608, 0.7144, 0.6277]}, {"w": "time", "b": [0.7207, 0.608, 0.7656, 0.6277]}, {"w": "from", "b": [0.7719, 0.608, 0.8209, 0.6277]}, {"w": "the", "b": [0.8272, 0.608, 0.8581, 0.6277]}, {"w": "input", "b": [0.1294, 0.6285, 0.1813, 0.6482]}, {"w": "data.", "b": [0.1876, 0.6285, 0.2359, 0.6482]}, {"w": "Let’s", "b": [0.2422, 0.6285, 0.2926, 0.6482]}, {"w": "instead", "b": [0.2989, 0.6285, 0.3704, 0.6482]}, {"w": "look", "b": [0.3767, 0.6285, 0.4216, 0.6482]}, {"w": "at", "b": [0.4279, 0.6285, 0.4461, 0.6482]}, {"w": "the", "b": [0.4524, 0.6285, 0.4832, 0.6482]}, {"w": "data", "b": [0.4895, 0.6285, 0.5315, 0.6482]}, {"w": "as", "b": [0.5378, 0.6285, 0.5589, 0.6482]}, {"w": "what", "b": [0.5652, 0.6285, 0.6142, 0.6482]}, {"w": "it", "b": [0.6205, 0.6285, 0.6345, 0.6482]}, {"w": "is:", "b": [0.6408, 0.6285, 0.6647, 0.6482]}, {"w": "a", "b": [0.671, 0.6285, 0.6822, 0.6482]}, {"w": "sequence,", "b": [0.6885, 0.6285, 0.7873, 0.6482]}, {"w": "where", "b": [0.7936, 0.6285, 0.8552, 0.6482]}, {"w": "causality", "b": [0.1294, 0.649, 0.2191, 0.6687]}, {"w": "and", "b": [0.2254, 0.649, 0.2618, 0.6687]}, {"w": "order", "b": [0.2681, 0.649, 0.3214, 0.6687]}, {"w": "matter.", "b": [0.3277, 0.649, 0.397, 0.6687]}, {"w": "You’ll", "b": [0.4033, 0.649, 0.4666, 0.6687]}, {"w": "try", "b": [0.4729, 0.649, 0.501, 0.6687]}, {"w": "a", "b": [0.5073, 0.649, 0.5185, 0.6687]}, {"w": "recurrent-sequence", "b": [0.5248, 0.649, 0.7167, 0.6687]}, {"w": "processing", "b": [0.723, 0.649, 0.8309, 0.6687]}, {"w": "model—it", "b": [0.1294, 0.6695, 0.2317, 0.6892]}, {"w": "should", "b": [0.238, 0.6695, 0.3053, 0.6892]}, {"w": "be", "b": [0.3116, 0.6695, 0.3354, 0.6892]}, {"w": "the", "b": [0.3417, 0.6695, 0.3725, 0.6892]}, {"w": "perfect", "b": [0.3788, 0.6695, 0.4489, 0.6892]}, {"w": "fit", "b": [0.4552, 0.6695, 0.4776, 0.6892]}, {"w": "for", "b": [0.4839, 0.6695, 0.5133, 0.6892]}, {"w": "such", "b": [0.5196, 0.6695, 0.5659, 0.6892]}, {"w": "sequence", "b": [0.5722, 0.6695, 0.6646, 0.6892]}, {"w": "data,", "b": [0.6709, 0.6695, 0.7193, 0.6892]}, {"w": "precisely", "b": [0.7256, 0.6695, 0.8166, 0.6892]}, {"w": "because", "b": [0.1294, 0.69, 0.2093, 0.7097]}, {"w": "it", "b": [0.2156, 0.69, 0.2296, 0.7097]}, {"w": "exploits", "b": [0.2359, 0.69, 0.3158, 0.7097]}, {"w": "the", "b": [0.3221, 0.69, 0.3529, 0.7097]}, {"w": "temporal", "b": [0.3592, 0.69, 0.4489, 0.7097]}, {"w": "ordering", "b": [0.4552, 0.69, 0.5407, 0.7097]}, {"w": "of", "b": [0.547, 0.69, 0.568, 0.7097]}, {"w": "data", "b": [0.5743, 0.69, 0.6163, 0.7097]}, {"w": "points,", "b": [0.6226, 0.69, 0.6906, 0.7097]}, {"w": "unlike", "b": [0.6969, 0.69, 0.76, 0.7097]}, {"w": "the", "b": [0.7662, 0.69, 0.797, 0.7097]}, {"w": "first", "b": [0.8033, 0.69, 0.844, 0.7097]}, {"w": "approach.", "b": [0.1294, 0.7105, 0.2282, 0.7302]}]}, {"id": "b_4", "type": "paragraph", "text": "Instead of the LSTM layer introduced in the previous section, you’ll use the GRU layer, developed by Chung et al. in 2014.[5] Gated recurrent unit (GRU) layers work using the same principle as LSTM, but they’re somewhat streamlined and thus cheaper to run (although they may not have as much representational power as LSTM). This trade-off between computational expensiveness and representational power is seen everywhere in machine learning.", "words": [{"w": "Instead", "b": [0.1294, 0.7533, 0.2023, 0.773]}, {"w": "of", "b": [0.2086, 0.7533, 0.2296, 0.773]}, {"w": "the", "b": [0.2359, 0.7533, 0.2667, 0.773]}, {"w": "LSTM", "b": [0.273, 0.7543, 0.3335, 0.7745]}, {"w": "layer", "b": [0.3399, 0.7533, 0.3903, 0.773]}, {"w": "introduced", "b": [0.3966, 0.7533, 0.5045, 0.773]}, {"w": "in", "b": [0.5108, 0.7533, 0.5304, 0.773]}, {"w": "the", "b": [0.5367, 0.7533, 0.5675, 0.773]}, {"w": "previous", "b": [0.5738, 0.7533, 0.6607, 0.773]}, {"w": "section,", "b": [0.667, 0.7533, 0.7448, 0.773]}, {"w": "you’ll", "b": [0.7511, 0.7533, 0.8114, 0.773]}, {"w": "use", "b": [0.8177, 0.7533, 0.8513, 0.773]}, {"w": "the", "b": [0.1294, 0.7764, 0.1602, 0.7962]}, {"w": "GRU", "b": [0.1665, 0.7775, 0.2119, 0.7977]}, {"w": "layer,", "b": [0.2182, 0.7764, 0.2739, 0.7962]}, {"w": "developed", "b": [0.2803, 0.7764, 0.3839, 0.7962]}, {"w": "by", "b": [0.3902, 0.7764, 0.4155, 0.7962]}, {"w": "Chung", "b": [0.4218, 0.7764, 0.489, 0.7962]}, {"w": "et", "b": [0.4954, 0.7764, 0.5136, 0.7962]}, {"w": "al.", "b": [0.5199, 0.7764, 0.5444, 0.7962]}, {"w": "in", "b": [0.5507, 0.7764, 0.5703, 0.7962]}, {"w": "2014.[5]", "b": [0.5766, 0.7742, 0.6554, 0.7962]}, {"w": "Gated", "b": [0.6617, 0.7764, 0.7219, 0.7962]}, {"w": "recurrent", "b": [0.7282, 0.7764, 0.8193, 0.7962]}, {"w": "unit", "b": [0.8256, 0.7764, 0.8648, 0.7962]}, {"w": "(GRU)", "b": [0.1294, 0.7978, 0.1995, 0.8176]}, {"w": "layers", "b": [0.2058, 0.7978, 0.266, 0.8176]}, {"w": "work", "b": [0.2723, 0.7978, 0.3242, 0.8176]}, {"w": "using", "b": [0.3305, 0.7978, 0.3851, 0.8176]}, {"w": "the", "b": [0.3914, 0.7978, 0.4223, 0.8176]}, {"w": "same", "b": [0.4286, 0.7978, 0.4804, 0.8176]}, {"w": "principle", "b": [0.4867, 0.7978, 0.5764, 0.8176]}, {"w": "as", "b": [0.5827, 0.7978, 0.6037, 0.8176]}, {"w": "LSTM,", "b": [0.61, 0.7978, 0.6836, 0.8176]}, {"w": "but", "b": [0.6899, 0.7978, 0.7221, 0.8176]}, {"w": "they’re", "b": [0.7284, 0.7978, 0.7999, 0.8176]}, {"w": "somewhat", "b": [0.1294, 0.8183, 0.2317, 0.8381]}, {"w": "streamlined", "b": [0.238, 0.8183, 0.3557, 0.8381]}, {"w": "and", "b": [0.362, 0.8183, 0.3984, 0.8381]}, {"w": "thus", "b": [0.4048, 0.8183, 0.4468, 0.8381]}, {"w": "cheaper", "b": [0.4531, 0.8183, 0.5315, 0.8381]}, {"w": "to", "b": [0.5378, 0.8183, 0.5574, 0.8381]}, {"w": "run", "b": [0.5637, 0.8183, 0.5973, 0.8381]}, {"w": "(although", "b": [0.6036, 0.8183, 0.7003, 0.8381]}, {"w": "they", "b": [0.7066, 0.8183, 0.7501, 0.8381]}, {"w": "may", "b": [0.7564, 0.8183, 0.7998, 0.8381]}, {"w": "not", "b": [0.8061, 0.8183, 0.8384, 0.8381]}, {"w": "have", "b": [0.1294, 0.8388, 0.177, 0.8586]}, {"w": "as", "b": [0.1833, 0.8388, 0.2044, 0.8586]}, {"w": "much", "b": [0.2107, 0.8388, 0.2667, 0.8586]}, {"w": "representational", "b": [0.273, 0.8388, 0.4341, 0.8586]}, {"w": "power", "b": [0.4404, 0.8388, 0.5035, 0.8586]}, {"w": "as", "b": [0.5098, 0.8388, 0.5308, 0.8586]}, {"w": "LSTM).", "b": [0.5371, 0.8388, 0.6191, 0.8586]}, {"w": "This", "b": [0.6254, 0.8388, 0.6703, 0.8586]}, {"w": "trade-off", "b": [0.6766, 0.8388, 0.7643, 0.8586]}, {"w": "between", "b": [0.7706, 0.8388, 0.8546, 0.8586]}, {"w": "computational", "b": [0.1294, 0.8593, 0.2738, 0.8791]}, {"w": "expensiveness", "b": [0.2801, 0.8593, 0.4244, 0.8791]}, {"w": "and", "b": [0.4306, 0.8593, 0.4671, 0.8791]}, {"w": "representational", "b": [0.4734, 0.8593, 0.6345, 0.8791]}, {"w": "power", "b": [0.6408, 0.8593, 0.7038, 0.8791]}, {"w": "is", "b": [0.7101, 0.8593, 0.727, 0.8791]}, {"w": "seen", "b": [0.7333, 0.8593, 0.7781, 0.8791]}, {"w": "everywhere", "b": [0.1294, 0.8798, 0.2471, 0.8996]}, {"w": "in", "b": [0.2534, 0.8798, 0.273, 0.8996]}, {"w": "machine", "b": [0.2793, 0.8798, 0.3648, 0.8996]}, {"w": "learning.", "b": [0.3711, 0.8798, 0.46, 0.8996]}]}]}, {"page": 284, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_1", "type": "paragraph", "text": "Junyoung Chung et al., “Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling,” Conference on Neural Information Processing Systems (2014), https://arxiv.org/abs/1412.3555.", "words": [{"w": "Junyoung", "b": [0.1483, 0.1128, 0.2219, 0.1276]}, {"w": "Chung", "b": [0.2266, 0.1128, 0.2771, 0.1276]}, {"w": "et", "b": [0.2818, 0.1128, 0.2955, 0.1276]}, {"w": "al.,", "b": [0.3002, 0.1128, 0.3233, 0.1276]}, {"w": "“Empirical", "b": [0.3281, 0.1128, 0.4111, 0.1276]}, {"w": "Evaluation", "b": [0.4158, 0.1128, 0.4978, 0.1276]}, {"w": "of", "b": [0.5025, 0.1128, 0.5183, 0.1276]}, {"w": "Gated", "b": [0.523, 0.1128, 0.5682, 0.1276]}, {"w": "Recurrent", "b": [0.5729, 0.1128, 0.6475, 0.1276]}, {"w": "Neural", "b": [0.6522, 0.1128, 0.7037, 0.1276]}, {"w": "Networks", "b": [0.7085, 0.1128, 0.782, 0.1276]}, {"w": "on", "b": [0.7867, 0.1128, 0.8057, 0.1276]}, {"w": "Sequence", "b": [0.1483, 0.128, 0.2208, 0.1428]}, {"w": "Modeling,”", "b": [0.2256, 0.128, 0.3123, 0.1428]}, {"w": "Conference", "b": [0.317, 0.128, 0.4042, 0.1428]}, {"w": "on", "b": [0.4089, 0.128, 0.4278, 0.1428]}, {"w": "Neural", "b": [0.4326, 0.128, 0.4841, 0.1428]}, {"w": "Information", "b": [0.4887, 0.128, 0.5791, 0.1428]}, {"w": "Processing", "b": [0.5838, 0.128, 0.6658, 0.1428]}, {"w": "Systems", "b": [0.6706, 0.128, 0.7336, 0.1428]}, {"w": "(2014),", "b": [0.7384, 0.128, 0.7935, 0.1428]}, {"w": "https://arxiv.org/abs/1412.3555.", "b": [0.1483, 0.1431, 0.389, 0.1579]}]}, {"id": "b_2", "type": "equation", "text": "Listing 6.39. Training and evaluating a GRU-based model", "words": [{"w": "Listing", "b": [0.1294, 0.1716, 0.1862, 0.1865]}, {"w": "6.39.", "b": [0.1909, 0.1716, 0.2288, 0.1865]}, {"w": "Training", "b": [0.2335, 0.1716, 0.3036, 0.1865]}, {"w": "and", "b": [0.3083, 0.1716, 0.3388, 0.1865]}, {"w": "evaluating", "b": [0.3435, 0.1716, 0.4276, 0.1865]}, {"w": "a", "b": [0.4323, 0.1716, 0.4418, 0.1865]}, {"w": "GRU-based", "b": [0.4465, 0.1716, 0.5411, 0.1865]}, {"w": "model", "b": [0.5459, 0.1716, 0.5953, 0.1865]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential() model.add(layers.GRU(32, input_shape=(None, float_data.shape[-1]))) model.add(layers.Dense(1)) model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=20, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "from", "b": [0.1357, 0.2001, 0.1811, 0.2152]}, {"w": "keras.models", "b": [0.1925, 0.2001, 0.3287, 0.2152]}, {"w": "import", "b": [0.34, 0.2001, 0.4082, 0.2152]}, {"w": "Sequential", "b": [0.4195, 0.2001, 0.533, 0.2152]}, {"w": "from", "b": [0.1357, 0.2152, 0.1811, 0.2304]}, {"w": "keras", "b": [0.1925, 0.2152, 0.2492, 0.2304]}, {"w": "import", "b": [0.2606, 0.2152, 0.3287, 0.2304]}, {"w": "layers", "b": [0.34, 0.2152, 0.4082, 0.2304]}, {"w": "from", "b": [0.1357, 0.2304, 0.1811, 0.2455]}, {"w": "keras.optimizers", "b": [0.1925, 0.2304, 0.3741, 0.2455]}, {"w": "import", "b": [0.3855, 0.2304, 0.4536, 0.2455]}, {"w": "RMSprop", "b": [0.4649, 0.2304, 0.5444, 0.2455]}, {"w": "model", "b": [0.1357, 0.2607, 0.1925, 0.2758]}, {"w": "=", "b": [0.2038, 0.2607, 0.2152, 0.2758]}, {"w": "Sequential()", "b": [0.2265, 0.2607, 0.3628, 0.2758]}, {"w": "model.add(layers.GRU(32,", "b": [0.1357, 0.2758, 0.4082, 0.291]}, {"w": "input_shape=(None,", "b": [0.4195, 0.2758, 0.6238, 0.291]}, {"w": "float_data.shape[-1])))", "b": [0.1357, 0.291, 0.3968, 0.3061]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.3061, 0.4309, 0.3213]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.3364, 0.5217, 0.3516]}, {"w": "loss='mae')", "b": [0.533, 0.3364, 0.6579, 0.3516]}, {"w": "history", "b": [0.1357, 0.3516, 0.2152, 0.3667]}, {"w": "=", "b": [0.2265, 0.3516, 0.2379, 0.3667]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.3516, 0.5898, 0.3667]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.3667, 0.7033, 0.3819]}, {"w": "epochs=20,", "b": [0.4763, 0.3819, 0.5898, 0.397]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.397, 0.7487, 0.4122]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.4122, 0.7828, 0.4273]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 6.21 shows the results. Much better! You can significantly beat the common-sense baseline, demonstrating the value of machine learning as well as the superiority of recurrent networks compared to sequence- flattening dense networks on this type of task.", "words": [{"w": "Figure", "b": [0.1294, 0.4502, 0.1953, 0.47]}, {"w": "6.21", "b": [0.2016, 0.4502, 0.2457, 0.47]}, {"w": "shows", "b": [0.252, 0.4502, 0.3151, 0.47]}, {"w": "the", "b": [0.3214, 0.4502, 0.3522, 0.47]}, {"w": "results.", "b": [0.3585, 0.4502, 0.4307, 0.47]}, {"w": "Much", "b": [0.437, 0.4502, 0.4958, 0.47]}, {"w": "better!", "b": [0.5022, 0.4502, 0.568, 0.47]}, {"w": "You", "b": [0.5743, 0.4502, 0.6152, 0.47]}, {"w": "can", "b": [0.6215, 0.4502, 0.6565, 0.47]}, {"w": "significantly", "b": [0.6628, 0.4502, 0.789, 0.47]}, {"w": "beat", "b": [0.7953, 0.4502, 0.8373, 0.47]}, {"w": "the", "b": [0.1294, 0.4707, 0.1602, 0.4905]}, {"w": "common-sense", "b": [0.1665, 0.4707, 0.3179, 0.4905]}, {"w": "baseline,", "b": [0.3242, 0.4707, 0.4132, 0.4905]}, {"w": "demonstrating", "b": [0.4195, 0.4707, 0.5638, 0.4905]}, {"w": "the", "b": [0.5701, 0.4707, 0.6009, 0.4905]}, {"w": "value", "b": [0.6072, 0.4707, 0.6619, 0.4905]}, {"w": "of", "b": [0.6682, 0.4707, 0.6892, 0.4905]}, {"w": "machine", "b": [0.6955, 0.4707, 0.781, 0.4905]}, {"w": "learning", "b": [0.7872, 0.4707, 0.8698, 0.4905]}, {"w": "as", "b": [0.1294, 0.4912, 0.1504, 0.511]}, {"w": "well", "b": [0.1567, 0.4912, 0.2002, 0.511]}, {"w": "as", "b": [0.2065, 0.4912, 0.2275, 0.511]}, {"w": "the", "b": [0.2338, 0.4912, 0.2646, 0.511]}, {"w": "superiority", "b": [0.2709, 0.4912, 0.3802, 0.511]}, {"w": "of", "b": [0.3865, 0.4912, 0.4076, 0.511]}, {"w": "recurrent", "b": [0.4139, 0.4912, 0.5049, 0.511]}, {"w": "networks", "b": [0.5112, 0.4912, 0.6037, 0.511]}, {"w": "compared", "b": [0.61, 0.4912, 0.7095, 0.511]}, {"w": "to", "b": [0.7158, 0.4912, 0.7354, 0.511]}, {"w": "sequence-", "b": [0.7417, 0.4912, 0.8425, 0.511]}, {"w": "flattening", "b": [0.1294, 0.5117, 0.2261, 0.5315]}, {"w": "dense", "b": [0.2324, 0.5117, 0.2898, 0.5315]}, {"w": "networks", "b": [0.2962, 0.5117, 0.3886, 0.5315]}, {"w": "on", "b": [0.3949, 0.5117, 0.4202, 0.5315]}, {"w": "this", "b": [0.4265, 0.5117, 0.4629, 0.5315]}, {"w": "type", "b": [0.4692, 0.5117, 0.5127, 0.5315]}, {"w": "of", "b": [0.519, 0.5117, 0.54, 0.5315]}, {"w": "task.", "b": [0.5463, 0.5117, 0.5932, 0.5315]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 6.21. Training and validation loss on the Jena temperature-forecasting task with a GRU", "words": [{"w": "Figure", "b": [0.1294, 0.554, 0.1827, 0.5688]}, {"w": "6.21.", "b": [0.1874, 0.554, 0.2252, 0.5688]}, {"w": "Training", "b": [0.2299, 0.554, 0.3, 0.5688]}, {"w": "and", "b": [0.3048, 0.554, 0.3353, 0.5688]}, {"w": "validation", "b": [0.34, 0.554, 0.4209, 0.5688]}, {"w": "loss", "b": [0.4257, 0.554, 0.4551, 0.5688]}, {"w": "on", "b": [0.4598, 0.554, 0.4798, 0.5688]}, {"w": "the", "b": [0.4846, 0.554, 0.5098, 0.5688]}, {"w": "Jena", "b": [0.5145, 0.554, 0.5523, 0.5688]}, {"w": "temperature-forecasting", "b": [0.5571, 0.554, 0.7529, 0.5688]}, {"w": "task", "b": [0.7576, 0.554, 0.7912, 0.5688]}, {"w": "with", "b": [0.796, 0.554, 0.8317, 0.5688]}, {"w": "a", "b": [0.8364, 0.554, 0.8459, 0.5688]}, {"w": "GRU", "b": [0.1294, 0.5692, 0.1715, 0.584]}]}]}, {"page": 285, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The new validation MAE of ~0.265 (before you start significantly overfitting) translates to a mean absolute error of 2.35°C after denormalization. That’s a solid gain on the initial error of 2.57°C, but you probably still have a bit of a margin for improvement.", "words": [{"w": "The", "b": [0.1294, 0.0857, 0.1686, 0.1054]}, {"w": "new", "b": [0.1749, 0.0857, 0.217, 0.1054]}, {"w": "validation", "b": [0.2233, 0.0857, 0.3242, 0.1054]}, {"w": "MAE", "b": [0.3305, 0.0857, 0.3865, 0.1054]}, {"w": "of", "b": [0.3928, 0.0857, 0.4139, 0.1054]}, {"w": "~0.265", "b": [0.4202, 0.0857, 0.4906, 0.1054]}, {"w": "(before", "b": [0.4969, 0.0857, 0.5697, 0.1054]}, {"w": "you", "b": [0.576, 0.0857, 0.6138, 0.1054]}, {"w": "start", "b": [0.6202, 0.0857, 0.6636, 0.1054]}, {"w": "significantly", "b": [0.6699, 0.0857, 0.796, 0.1054]}, {"w": "overfitting)", "b": [0.1294, 0.1062, 0.2443, 0.1259]}, {"w": "translates", "b": [0.2506, 0.1062, 0.3459, 0.1259]}, {"w": "to", "b": [0.3522, 0.1062, 0.3718, 0.1259]}, {"w": "a", "b": [0.3781, 0.1062, 0.3893, 0.1259]}, {"w": "mean", "b": [0.3956, 0.1062, 0.4503, 0.1259]}, {"w": "absolute", "b": [0.4566, 0.1062, 0.5407, 0.1259]}, {"w": "error", "b": [0.547, 0.1062, 0.596, 0.1259]}, {"w": "of", "b": [0.6023, 0.1062, 0.6233, 0.1259]}, {"w": "2.35°C", "b": [0.6296, 0.1062, 0.7007, 0.1259]}, {"w": "after", "b": [0.7069, 0.1062, 0.7531, 0.1259]}, {"w": "denormalization.", "b": [0.1294, 0.1267, 0.2997, 0.1464]}, {"w": "That’s", "b": [0.306, 0.1267, 0.369, 0.1464]}, {"w": "a", "b": [0.3753, 0.1267, 0.3865, 0.1464]}, {"w": "solid", "b": [0.3928, 0.1267, 0.4419, 0.1464]}, {"w": "gain", "b": [0.4482, 0.1267, 0.4916, 0.1464]}, {"w": "on", "b": [0.4979, 0.1267, 0.5231, 0.1464]}, {"w": "the", "b": [0.5294, 0.1267, 0.5603, 0.1464]}, {"w": "initial", "b": [0.5666, 0.1267, 0.6254, 0.1464]}, {"w": "error", "b": [0.6318, 0.1267, 0.6808, 0.1464]}, {"w": "of", "b": [0.6871, 0.1267, 0.7081, 0.1464]}, {"w": "2.57°C,", "b": [0.7144, 0.1267, 0.7918, 0.1464]}, {"w": "but", "b": [0.7981, 0.1267, 0.8303, 0.1464]}, {"w": "you", "b": [0.1294, 0.1472, 0.1673, 0.1669]}, {"w": "probably", "b": [0.1736, 0.1472, 0.2632, 0.1669]}, {"w": "still", "b": [0.2695, 0.1472, 0.3074, 0.1669]}, {"w": "have", "b": [0.3137, 0.1472, 0.3613, 0.1669]}, {"w": "a", "b": [0.3676, 0.1472, 0.3788, 0.1669]}, {"w": "bit", "b": [0.3852, 0.1472, 0.4118, 0.1669]}, {"w": "of", "b": [0.4181, 0.1472, 0.4391, 0.1669]}, {"w": "a", "b": [0.4454, 0.1472, 0.4566, 0.1669]}, {"w": "margin", "b": [0.4629, 0.1472, 0.5339, 0.1669]}, {"w": "for", "b": [0.5402, 0.1472, 0.5696, 0.1669]}, {"w": "improvement.", "b": [0.5759, 0.1472, 0.7167, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "6.3.6. Using recurrent dropout to fight overfitting", "words": [{"w": "6.3.6.", "b": [0.1294, 0.1944, 0.1862, 0.2142]}, {"w": "Using", "b": [0.1925, 0.1944, 0.2542, 0.2142]}, {"w": "recurrent", "b": [0.2605, 0.1944, 0.3632, 0.2142]}, {"w": "dropout", "b": [0.3695, 0.1944, 0.4559, 0.2142]}, {"w": "to", "b": [0.4623, 0.1944, 0.4833, 0.2142]}, {"w": "fight", "b": [0.4896, 0.1944, 0.54, 0.2142]}, {"w": "overfitting", "b": [0.5463, 0.1944, 0.6598, 0.2142]}]}, {"id": "b_2", "type": "paragraph", "text": "It’s evident from the training and validation curves that the model is overfitting: the training and validation losses start to diverge considerably after a few epochs. You’re already familiar with a classic technique for fighting this phenomenon: dropout, which randomly zeros out input units of a layer in order to break happenstance correlations in the training data that the layer is exposed to. But how to correctly apply dropout in recurrent networks isn’t a trivial question. It has long been known that applying dropout before a recurrent layer hinders learning rather than helping with regularization. In 2015, Yarin Gal, as part of his PhD thesis on Bayesian deep learning,[6] determined the proper way to use dropout with a recurrent network: the same dropout mask (the same pattern of dropped units) should be applied at every timestep, instead of a dropout mask that varies randomly from timestep to timestep. What’s more, in order to regularize the representations formed by the recurrent gates of layers such as GRU and LSTM, a temporally constant dropout mask should be applied to the inner recurrent activations of the layer (a recurrent dropout mask). Using the same dropout mask at every timestep allows the network to properly propagate its learning error through time; a temporally random dropout mask would disrupt this error signal and be harmful to the learning process.", "words": [{"w": "It’s", "b": [0.1294, 0.2372, 0.1616, 0.2569]}, {"w": "evident", "b": [0.1679, 0.2372, 0.2422, 0.2569]}, {"w": "from", "b": [0.2485, 0.2372, 0.2976, 0.2569]}, {"w": "the", "b": [0.3039, 0.2372, 0.3347, 0.2569]}, {"w": "training", "b": [0.341, 0.2372, 0.4195, 0.2569]}, {"w": "and", "b": [0.4258, 0.2372, 0.4622, 0.2569]}, {"w": "validation", "b": [0.4685, 0.2372, 0.5694, 0.2569]}, {"w": "curves", "b": [0.5757, 0.2372, 0.6416, 0.2569]}, {"w": "that", "b": [0.6479, 0.2372, 0.6857, 0.2569]}, {"w": "the", "b": [0.692, 0.2372, 0.7228, 0.2569]}, {"w": "model", "b": [0.7291, 0.2372, 0.7922, 0.2569]}, {"w": "is", "b": [0.7985, 0.2372, 0.8153, 0.2569]}, {"w": "overfitting:", "b": [0.1294, 0.2577, 0.2429, 0.2774]}, {"w": "the", "b": [0.2492, 0.2577, 0.2801, 0.2774]}, {"w": "training", "b": [0.2864, 0.2577, 0.3648, 0.2774]}, {"w": "and", "b": [0.3712, 0.2577, 0.4076, 0.2774]}, {"w": "validation", "b": [0.4139, 0.2577, 0.5148, 0.2774]}, {"w": "losses", "b": [0.5211, 0.2577, 0.5814, 0.2774]}, {"w": "start", "b": [0.5877, 0.2577, 0.6311, 0.2774]}, {"w": "to", "b": [0.6373, 0.2577, 0.6569, 0.2774]}, {"w": "diverge", "b": [0.6632, 0.2577, 0.7384, 0.2774]}, {"w": "considerably", "b": [0.1294, 0.2782, 0.2583, 0.2979]}, {"w": "after", "b": [0.2646, 0.2782, 0.3108, 0.2979]}, {"w": "a", "b": [0.3171, 0.2782, 0.3283, 0.2979]}, {"w": "few", "b": [0.3346, 0.2782, 0.3725, 0.2979]}, {"w": "epochs.", "b": [0.3788, 0.2782, 0.4551, 0.2979]}, {"w": "You’re", "b": [0.4614, 0.2782, 0.5303, 0.2979]}, {"w": "already", "b": [0.5366, 0.2782, 0.6109, 0.2979]}, {"w": "familiar", "b": [0.6172, 0.2782, 0.697, 0.2979]}, {"w": "with", "b": [0.7033, 0.2782, 0.7482, 0.2979]}, {"w": "a", "b": [0.7545, 0.2782, 0.7657, 0.2979]}, {"w": "classic", "b": [0.772, 0.2782, 0.8393, 0.2979]}, {"w": "technique", "b": [0.1294, 0.2987, 0.2275, 0.3184]}, {"w": "for", "b": [0.2338, 0.2987, 0.2632, 0.3184]}, {"w": "fighting", "b": [0.2695, 0.2987, 0.3494, 0.3184]}, {"w": "this", "b": [0.3557, 0.2987, 0.3922, 0.3184]}, {"w": "phenomenon:", "b": [0.3985, 0.2987, 0.5358, 0.3184]}, {"w": "dropout,", "b": [0.5421, 0.2987, 0.6268, 0.3184]}, {"w": "which", "b": [0.6331, 0.2987, 0.6948, 0.3184]}, {"w": "randomly", "b": [0.7011, 0.2987, 0.7978, 0.3184]}, {"w": "zeros", "b": [0.8041, 0.2987, 0.8573, 0.3184]}, {"w": "out", "b": [0.1294, 0.3192, 0.1617, 0.3389]}, {"w": "input", "b": [0.168, 0.3192, 0.2198, 0.3389]}, {"w": "units", "b": [0.2261, 0.3192, 0.2752, 0.3389]}, {"w": "of", "b": [0.2815, 0.3192, 0.3025, 0.3389]}, {"w": "a", "b": [0.3088, 0.3192, 0.32, 0.3389]}, {"w": "layer", "b": [0.3263, 0.3192, 0.3768, 0.3389]}, {"w": "in", "b": [0.3831, 0.3192, 0.4027, 0.3389]}, {"w": "order", "b": [0.409, 0.3192, 0.4622, 0.3389]}, {"w": "to", "b": [0.4685, 0.3192, 0.4881, 0.3389]}, {"w": "break", "b": [0.4945, 0.3192, 0.5505, 0.3389]}, {"w": "happenstance", "b": [0.5568, 0.3192, 0.6927, 0.3389]}, {"w": "correlations", "b": [0.699, 0.3192, 0.8181, 0.3389]}, {"w": "in", "b": [0.8244, 0.3192, 0.844, 0.3389]}, {"w": "the", "b": [0.1294, 0.3397, 0.1602, 0.3594]}, {"w": "training", "b": [0.1665, 0.3397, 0.245, 0.3594]}, {"w": "data", "b": [0.2513, 0.3397, 0.2934, 0.3594]}, {"w": "that", "b": [0.2996, 0.3397, 0.3374, 0.3594]}, {"w": "the", "b": [0.3438, 0.3397, 0.3746, 0.3594]}, {"w": "layer", "b": [0.3809, 0.3397, 0.4313, 0.3594]}, {"w": "is", "b": [0.4376, 0.3397, 0.4544, 0.3594]}, {"w": "exposed", "b": [0.4607, 0.3397, 0.5434, 0.3594]}, {"w": "to.", "b": [0.5497, 0.3397, 0.5757, 0.3594]}, {"w": "But", "b": [0.582, 0.3397, 0.6184, 0.3594]}, {"w": "how", "b": [0.6247, 0.3397, 0.6682, 0.3594]}, {"w": "to", "b": [0.6745, 0.3397, 0.6941, 0.3594]}, {"w": "correctly", "b": [0.7004, 0.3397, 0.79, 0.3594]}, {"w": "apply", "b": [0.7964, 0.3397, 0.8524, 0.3594]}, {"w": "dropout", "b": [0.1294, 0.3602, 0.2079, 0.3799]}, {"w": "in", "b": [0.2142, 0.3602, 0.2338, 0.3799]}, {"w": "recurrent", "b": [0.2401, 0.3602, 0.3312, 0.3799]}, {"w": "networks", "b": [0.3375, 0.3602, 0.43, 0.3799]}, {"w": "isn’t", "b": [0.4363, 0.3602, 0.4806, 0.3799]}, {"w": "a", "b": [0.4869, 0.3602, 0.4981, 0.3799]}, {"w": "trivial", "b": [0.5044, 0.3602, 0.5647, 0.3799]}, {"w": "question.", "b": [0.571, 0.3602, 0.6628, 0.3799]}, {"w": "It", "b": [0.6691, 0.3602, 0.6845, 0.3799]}, {"w": "has", "b": [0.6908, 0.3602, 0.7245, 0.3799]}, {"w": "long", "b": [0.7308, 0.3602, 0.7756, 0.3799]}, {"w": "been", "b": [0.7819, 0.3602, 0.8295, 0.3799]}, {"w": "known", "b": [0.1294, 0.3807, 0.1981, 0.4004]}, {"w": "that", "b": [0.2044, 0.3807, 0.2422, 0.4004]}, {"w": "applying", "b": [0.2485, 0.3807, 0.3368, 0.4004]}, {"w": "dropout", "b": [0.3431, 0.3807, 0.4216, 0.4004]}, {"w": "before", "b": [0.4279, 0.3807, 0.4923, 0.4004]}, {"w": "a", "b": [0.4986, 0.3807, 0.5098, 0.4004]}, {"w": "recurrent", "b": [0.5161, 0.3807, 0.6072, 0.4004]}, {"w": "layer", "b": [0.6135, 0.3807, 0.6639, 0.4004]}, {"w": "hinders", "b": [0.6702, 0.3807, 0.7445, 0.4004]}, {"w": "learning", "b": [0.7508, 0.3807, 0.8335, 0.4004]}, {"w": "rather", "b": [0.1294, 0.4012, 0.1882, 0.4209]}, {"w": "than", "b": [0.1945, 0.4012, 0.238, 0.4209]}, {"w": "helping", "b": [0.2443, 0.4012, 0.32, 0.4209]}, {"w": "with", "b": [0.3263, 0.4012, 0.3711, 0.4209]}, {"w": "regularization.", "b": [0.3774, 0.4012, 0.5238, 0.4209]}, {"w": "In", "b": [0.5301, 0.4012, 0.5512, 0.4209]}, {"w": "2015,", "b": [0.5575, 0.4012, 0.6142, 0.4209]}, {"w": "Yarin", "b": [0.6204, 0.4012, 0.6754, 0.4209]}, {"w": "Gal,", "b": [0.6817, 0.4012, 0.7244, 0.4209]}, {"w": "as", "b": [0.7307, 0.4012, 0.7517, 0.4209]}, {"w": "part", "b": [0.758, 0.4012, 0.7973, 0.4209]}, {"w": "of", "b": [0.8036, 0.4012, 0.8246, 0.4209]}, {"w": "his", "b": [0.8309, 0.4012, 0.8603, 0.4209]}, {"w": "PhD", "b": [0.1294, 0.4235, 0.1743, 0.4432]}, {"w": "thesis", "b": [0.1806, 0.4235, 0.238, 0.4432]}, {"w": "on", "b": [0.2443, 0.4235, 0.2696, 0.4432]}, {"w": "Bayesian", "b": [0.2759, 0.4235, 0.3684, 0.4432]}, {"w": "deep", "b": [0.3747, 0.4235, 0.4223, 0.4432]}, {"w": "learning,[6]", "b": [0.4286, 0.4212, 0.5396, 0.4432]}, {"w": "determined", "b": [0.5459, 0.4235, 0.6593, 0.4432]}, {"w": "the", "b": [0.6657, 0.4235, 0.6965, 0.4432]}, {"w": "proper", "b": [0.7028, 0.4235, 0.7686, 0.4432]}, {"w": "way", "b": [0.7749, 0.4235, 0.817, 0.4432]}, {"w": "to", "b": [0.8233, 0.4235, 0.8429, 0.4432]}, {"w": "use", "b": [0.1294, 0.444, 0.163, 0.4637]}, {"w": "dropout", "b": [0.1693, 0.444, 0.2478, 0.4637]}, {"w": "with", "b": [0.2541, 0.444, 0.299, 0.4637]}, {"w": "a", "b": [0.3053, 0.444, 0.3165, 0.4637]}, {"w": "recurrent", "b": [0.3228, 0.444, 0.4138, 0.4637]}, {"w": "network:", "b": [0.4201, 0.444, 0.5098, 0.4637]}, {"w": "the", "b": [0.5161, 0.444, 0.5469, 0.4637]}, {"w": "same", "b": [0.5533, 0.444, 0.6051, 0.4637]}, {"w": "dropout", "b": [0.6114, 0.444, 0.6899, 0.4637]}, {"w": "mask", "b": [0.6962, 0.444, 0.7494, 0.4637]}, {"w": "(the", "b": [0.7557, 0.444, 0.795, 0.4637]}, {"w": "same", "b": [0.8013, 0.444, 0.8531, 0.4637]}, {"w": "pattern", "b": [0.1294, 0.4645, 0.1995, 0.4842]}, {"w": "of", "b": [0.2058, 0.4645, 0.2268, 0.4842]}, {"w": "dropped", "b": [0.2331, 0.4645, 0.3158, 0.4842]}, {"w": "units)", "b": [0.3221, 0.4645, 0.3795, 0.4842]}, {"w": "should", "b": [0.3858, 0.4645, 0.4531, 0.4842]}, {"w": "be", "b": [0.4594, 0.4645, 0.4832, 0.4842]}, {"w": "applied", "b": [0.4895, 0.4645, 0.5638, 0.4842]}, {"w": "at", "b": [0.5701, 0.4645, 0.5883, 0.4842]}, {"w": "every", "b": [0.5946, 0.4645, 0.6506, 0.4842]}, {"w": "timestep,", "b": [0.6569, 0.4645, 0.7487, 0.4842]}, {"w": "instead", "b": [0.755, 0.4645, 0.8265, 0.4842]}, {"w": "of", "b": [0.8328, 0.4645, 0.8538, 0.4842]}, {"w": "a", "b": [0.1294, 0.485, 0.1406, 0.5047]}, {"w": "dropout", "b": [0.1469, 0.485, 0.2254, 0.5047]}, {"w": "mask", "b": [0.2317, 0.485, 0.285, 0.5047]}, {"w": "that", "b": [0.2913, 0.485, 0.3291, 0.5047]}, {"w": "varies", "b": [0.3354, 0.485, 0.3956, 0.5047]}, {"w": "randomly", "b": [0.402, 0.485, 0.4986, 0.5047]}, {"w": "from", "b": [0.5049, 0.485, 0.554, 0.5047]}, {"w": "timestep", "b": [0.5603, 0.485, 0.6458, 0.5047]}, {"w": "to", "b": [0.6521, 0.485, 0.6717, 0.5047]}, {"w": "timestep.", "b": [0.678, 0.485, 0.7698, 0.5047]}, {"w": "What’s", "b": [0.7761, 0.485, 0.8475, 0.5047]}, {"w": "more,", "b": [0.1294, 0.5055, 0.1876, 0.5252]}, {"w": "in", "b": [0.1939, 0.5055, 0.2135, 0.5252]}, {"w": "order", "b": [0.2198, 0.5055, 0.273, 0.5252]}, {"w": "to", "b": [0.2793, 0.5055, 0.2989, 0.5252]}, {"w": "regularize", "b": [0.3053, 0.5055, 0.4061, 0.5252]}, {"w": "the", "b": [0.4124, 0.5055, 0.4432, 0.5252]}, {"w": "representations", "b": [0.4495, 0.5055, 0.6023, 0.5252]}, {"w": "formed", "b": [0.6086, 0.5055, 0.6814, 0.5252]}, {"w": "by", "b": [0.6877, 0.5055, 0.713, 0.5252]}, {"w": "the", "b": [0.7193, 0.5055, 0.7501, 0.5252]}, {"w": "recurrent", "b": [0.7564, 0.5055, 0.8474, 0.5252]}, {"w": "gates", "b": [0.1294, 0.526, 0.1813, 0.5457]}, {"w": "of", "b": [0.1876, 0.526, 0.2086, 0.5457]}, {"w": "layers", "b": [0.2149, 0.526, 0.2751, 0.5457]}, {"w": "such", "b": [0.2814, 0.526, 0.3277, 0.5457]}, {"w": "as", "b": [0.334, 0.526, 0.355, 0.5457]}, {"w": "GRU", "b": [0.3613, 0.527, 0.4067, 0.5472]}, {"w": "and", "b": [0.413, 0.526, 0.4494, 0.5457]}, {"w": "LSTM,", "b": [0.4557, 0.526, 0.5226, 0.5472]}, {"w": "a", "b": [0.5289, 0.526, 0.5401, 0.5457]}, {"w": "temporally", "b": [0.5464, 0.526, 0.6557, 0.5457]}, {"w": "constant", "b": [0.662, 0.526, 0.7461, 0.5457]}, {"w": "dropout", "b": [0.7524, 0.526, 0.8308, 0.5457]}, {"w": "mask", "b": [0.1294, 0.5474, 0.1827, 0.5671]}, {"w": "should", "b": [0.189, 0.5474, 0.2562, 0.5671]}, {"w": "be", "b": [0.2626, 0.5474, 0.2864, 0.5671]}, {"w": "applied", "b": [0.2927, 0.5474, 0.3669, 0.5671]}, {"w": "to", "b": [0.3732, 0.5474, 0.3929, 0.5671]}, {"w": "the", "b": [0.3992, 0.5474, 0.43, 0.5671]}, {"w": "inner", "b": [0.4363, 0.5474, 0.4881, 0.5671]}, {"w": "recurrent", "b": [0.4945, 0.5474, 0.5855, 0.5671]}, {"w": "activations", "b": [0.5918, 0.5474, 0.7011, 0.5671]}, {"w": "of", "b": [0.7074, 0.5474, 0.7284, 0.5671]}, {"w": "the", "b": [0.7347, 0.5474, 0.7656, 0.5671]}, {"w": "layer", "b": [0.7719, 0.5474, 0.8223, 0.5671]}, {"w": "(a", "b": [0.8286, 0.5474, 0.8482, 0.5671]}, {"w": "recurrent", "b": [0.1294, 0.5679, 0.2228, 0.5876]}, {"w": "dropout", "b": [0.2291, 0.5679, 0.3076, 0.5876]}, {"w": "mask).", "b": [0.3139, 0.5679, 0.3819, 0.5876]}, {"w": "Using", "b": [0.3882, 0.5679, 0.4484, 0.5876]}, {"w": "the", "b": [0.4547, 0.5679, 0.4856, 0.5876]}, {"w": "same", "b": [0.4919, 0.5679, 0.5437, 0.5876]}, {"w": "dropout", "b": [0.55, 0.5679, 0.6285, 0.5876]}, {"w": "mask", "b": [0.6348, 0.5679, 0.688, 0.5876]}, {"w": "at", "b": [0.6944, 0.5679, 0.7126, 0.5876]}, {"w": "every", "b": [0.7189, 0.5679, 0.7749, 0.5876]}, {"w": "timestep", "b": [0.7812, 0.5679, 0.8667, 0.5876]}, {"w": "allows", "b": [0.1294, 0.5884, 0.1953, 0.6081]}, {"w": "the", "b": [0.2016, 0.5884, 0.2324, 0.6081]}, {"w": "network", "b": [0.2387, 0.5884, 0.3214, 0.6081]}, {"w": "to", "b": [0.3277, 0.5884, 0.3473, 0.6081]}, {"w": "properly", "b": [0.3536, 0.5884, 0.4391, 0.6081]}, {"w": "propagate", "b": [0.4454, 0.5884, 0.5449, 0.6081]}, {"w": "its", "b": [0.5512, 0.5884, 0.575, 0.6081]}, {"w": "learning", "b": [0.5813, 0.5884, 0.664, 0.6081]}, {"w": "error", "b": [0.6703, 0.5884, 0.7193, 0.6081]}, {"w": "through", "b": [0.7255, 0.5884, 0.804, 0.6081]}, {"w": "time;", "b": [0.8103, 0.5884, 0.8622, 0.6081]}, {"w": "a", "b": [0.1294, 0.6089, 0.1406, 0.6286]}, {"w": "temporally", "b": [0.1469, 0.6089, 0.2562, 0.6286]}, {"w": "random", "b": [0.2625, 0.6089, 0.3396, 0.6286]}, {"w": "dropout", "b": [0.3459, 0.6089, 0.4244, 0.6286]}, {"w": "mask", "b": [0.4307, 0.6089, 0.4839, 0.6286]}, {"w": "would", "b": [0.4902, 0.6089, 0.5533, 0.6286]}, {"w": "disrupt", "b": [0.5596, 0.6089, 0.6297, 0.6286]}, {"w": "this", "b": [0.636, 0.6089, 0.6724, 0.6286]}, {"w": "error", "b": [0.6788, 0.6089, 0.7278, 0.6286]}, {"w": "signal", "b": [0.7341, 0.6089, 0.7943, 0.6286]}, {"w": "and", "b": [0.8006, 0.6089, 0.8371, 0.6286]}, {"w": "be", "b": [0.8434, 0.6089, 0.8672, 0.6286]}, {"w": "harmful", "b": [0.1294, 0.6294, 0.2093, 0.6491]}, {"w": "to", "b": [0.2156, 0.6294, 0.2352, 0.6491]}, {"w": "the", "b": [0.2415, 0.6294, 0.2723, 0.6491]}, {"w": "learning", "b": [0.2786, 0.6294, 0.3613, 0.6491]}, {"w": "process.", "b": [0.3676, 0.6294, 0.4496, 0.6491]}]}, {"id": "b_4", "type": "paragraph", "text": "See Yarin Gal, “Uncertainty in Deep Learning (PhD Thesis),” October 13, 2016, http://mlg.eng.cam.ac.uk/yarin/blog_2248.html.", "words": [{"w": "See", "b": [0.1483, 0.6948, 0.1757, 0.7097]}, {"w": "Yarin", "b": [0.1804, 0.6948, 0.2216, 0.7097]}, {"w": "Gal,", "b": [0.2263, 0.6948, 0.2583, 0.7097]}, {"w": "“Uncertainty", "b": [0.2631, 0.6948, 0.3608, 0.7097]}, {"w": "in", "b": [0.3655, 0.6948, 0.3802, 0.7097]}, {"w": "Deep", "b": [0.385, 0.6948, 0.4249, 0.7097]}, {"w": "Learning", "b": [0.4296, 0.6948, 0.4979, 0.7097]}, {"w": "(PhD", "b": [0.5027, 0.6948, 0.5426, 0.7097]}, {"w": "Thesis),”", "b": [0.5473, 0.6948, 0.6161, 0.7097]}, {"w": "October", "b": [0.6209, 0.6948, 0.6818, 0.7097]}, {"w": "13,", "b": [0.6865, 0.6948, 0.7102, 0.7097]}, {"w": "2016,", "b": [0.7149, 0.6948, 0.7575, 0.7097]}, {"w": "http://mlg.eng.cam.ac.uk/yarin/blog_2248.html.", "b": [0.1483, 0.71, 0.5109, 0.7248]}]}, {"id": "b_5", "type": "paragraph", "text": "Yarin Gal did his research using Keras and helped build this mechanism directly into Keras recurrent layers. Every recurrent layer in Keras has two dropout-related arguments: dropout, a float specifying the dropout rate for input units of the layer, and recurrent_dropout, specifying the dropout rate of the recurrent units. Let’s add dropout and recurrent dropout to the GRU layer and see how doing so impacts overfitting. Because networks being regularized with dropout always take longer to fully converge, you’ll train the network for twice as many epochs.", "words": [{"w": "Yarin", "b": [0.1294, 0.7479, 0.1843, 0.7677]}, {"w": "Gal", "b": [0.1906, 0.7479, 0.2271, 0.7677]}, {"w": "did", "b": [0.2334, 0.7479, 0.2656, 0.7677]}, {"w": "his", "b": [0.2719, 0.7479, 0.3014, 0.7677]}, {"w": "research", "b": [0.3077, 0.7479, 0.3917, 0.7677]}, {"w": "using", "b": [0.398, 0.7479, 0.4527, 0.7677]}, {"w": "Keras", "b": [0.459, 0.7479, 0.5178, 0.7677]}, {"w": "and", "b": [0.5241, 0.7479, 0.5605, 0.7677]}, {"w": "helped", "b": [0.5668, 0.7479, 0.6341, 0.7677]}, {"w": "build", "b": [0.6404, 0.7479, 0.6923, 0.7677]}, {"w": "this", "b": [0.6986, 0.7479, 0.735, 0.7677]}, {"w": "mechanism", "b": [0.7413, 0.7479, 0.8562, 0.7677]}, {"w": "directly", "b": [0.1294, 0.7684, 0.2065, 0.7882]}, {"w": "into", "b": [0.2128, 0.7684, 0.252, 0.7882]}, {"w": "Keras", "b": [0.2583, 0.7684, 0.3172, 0.7882]}, {"w": "recurrent", "b": [0.3235, 0.7684, 0.4145, 0.7882]}, {"w": "layers.", "b": [0.4208, 0.7684, 0.4874, 0.7882]}, {"w": "Every", "b": [0.4937, 0.7684, 0.5539, 0.7882]}, {"w": "recurrent", "b": [0.5602, 0.7684, 0.6513, 0.7882]}, {"w": "layer", "b": [0.6575, 0.7684, 0.7079, 0.7882]}, {"w": "in", "b": [0.7142, 0.7684, 0.7338, 0.7882]}, {"w": "Keras", "b": [0.7401, 0.7684, 0.799, 0.7882]}, {"w": "has", "b": [0.8053, 0.7684, 0.8389, 0.7882]}, {"w": "two", "b": [0.1294, 0.7889, 0.1673, 0.8087]}, {"w": "dropout-related", "b": [0.1736, 0.7889, 0.3291, 0.8087]}, {"w": "arguments:", "b": [0.3354, 0.7889, 0.447, 0.8087]}, {"w": "dropout,", "b": [0.4533, 0.7889, 0.5655, 0.8102]}, {"w": "a", "b": [0.5718, 0.7889, 0.583, 0.8087]}, {"w": "float", "b": [0.5894, 0.7889, 0.6356, 0.8087]}, {"w": "specifying", "b": [0.6419, 0.7889, 0.747, 0.8087]}, {"w": "the", "b": [0.7533, 0.7889, 0.7841, 0.8087]}, {"w": "dropout", "b": [0.7904, 0.7889, 0.8689, 0.8087]}, {"w": "rate", "b": [0.1294, 0.8103, 0.1672, 0.8301]}, {"w": "for", "b": [0.1735, 0.8103, 0.2029, 0.8301]}, {"w": "input", "b": [0.2093, 0.8103, 0.2611, 0.8301]}, {"w": "units", "b": [0.2674, 0.8103, 0.3165, 0.8301]}, {"w": "of", "b": [0.3228, 0.8103, 0.3438, 0.8301]}, {"w": "the", "b": [0.3501, 0.8103, 0.3809, 0.8301]}, {"w": "layer,", "b": [0.3872, 0.8103, 0.4429, 0.8301]}, {"w": "and", "b": [0.4492, 0.8103, 0.4857, 0.8301]}, {"w": "recurrent_dropout,", "b": [0.492, 0.8103, 0.7556, 0.8316]}, {"w": "specifying", "b": [0.7619, 0.8103, 0.867, 0.8301]}, {"w": "the", "b": [0.1294, 0.8317, 0.1602, 0.8514]}, {"w": "dropout", "b": [0.1665, 0.8317, 0.245, 0.8514]}, {"w": "rate", "b": [0.2513, 0.8317, 0.2891, 0.8514]}, {"w": "of", "b": [0.2954, 0.8317, 0.3165, 0.8514]}, {"w": "the", "b": [0.3228, 0.8317, 0.3536, 0.8514]}, {"w": "recurrent", "b": [0.3599, 0.8317, 0.4509, 0.8514]}, {"w": "units.", "b": [0.4572, 0.8317, 0.5126, 0.8514]}, {"w": "Let’s", "b": [0.5189, 0.8317, 0.5693, 0.8514]}, {"w": "add", "b": [0.5756, 0.8317, 0.612, 0.8514]}, {"w": "dropout", "b": [0.6183, 0.8317, 0.6968, 0.8514]}, {"w": "and", "b": [0.7031, 0.8317, 0.7396, 0.8514]}, {"w": "recurrent", "b": [0.7459, 0.8317, 0.8369, 0.8514]}, {"w": "dropout", "b": [0.1294, 0.8522, 0.2079, 0.8719]}, {"w": "to", "b": [0.2142, 0.8522, 0.2338, 0.8719]}, {"w": "the", "b": [0.2401, 0.8522, 0.271, 0.8719]}, {"w": "GRU", "b": [0.2772, 0.8533, 0.3226, 0.8734]}, {"w": "layer", "b": [0.329, 0.8522, 0.3794, 0.8719]}, {"w": "and", "b": [0.3857, 0.8522, 0.4221, 0.8719]}, {"w": "see", "b": [0.4284, 0.8522, 0.4606, 0.8719]}, {"w": "how", "b": [0.4669, 0.8522, 0.5104, 0.8719]}, {"w": "doing", "b": [0.5167, 0.8522, 0.5741, 0.8719]}, {"w": "so", "b": [0.5805, 0.8522, 0.6029, 0.8719]}, {"w": "impacts", "b": [0.6092, 0.8522, 0.6877, 0.8719]}, {"w": "overfitting.", "b": [0.694, 0.8522, 0.8068, 0.8719]}, {"w": "Because", "b": [0.1294, 0.8736, 0.2135, 0.8933]}, {"w": "networks", "b": [0.2198, 0.8736, 0.3122, 0.8933]}, {"w": "being", "b": [0.3186, 0.8736, 0.3746, 0.8933]}, {"w": "regularized", "b": [0.3809, 0.8736, 0.4944, 0.8933]}, {"w": "with", "b": [0.5007, 0.8736, 0.5455, 0.8933]}, {"w": "dropout", "b": [0.5518, 0.8736, 0.6303, 0.8933]}, {"w": "always", "b": [0.6366, 0.8736, 0.7067, 0.8933]}, {"w": "take", "b": [0.713, 0.8736, 0.755, 0.8933]}, {"w": "longer", "b": [0.7613, 0.8736, 0.8258, 0.8933]}, {"w": "to", "b": [0.8321, 0.8736, 0.8517, 0.8933]}, {"w": "fully", "b": [0.1294, 0.8941, 0.1771, 0.9138]}, {"w": "converge,", "b": [0.1834, 0.8941, 0.2816, 0.9138]}, {"w": "you’ll", "b": [0.288, 0.8941, 0.3482, 0.9138]}, {"w": "train", "b": [0.3545, 0.8941, 0.4008, 0.9138]}, {"w": "the", "b": [0.4071, 0.8941, 0.4379, 0.9138]}, {"w": "network", "b": [0.4442, 0.8941, 0.5269, 0.9138]}, {"w": "for", "b": [0.5332, 0.8941, 0.5626, 0.9138]}, {"w": "twice", "b": [0.5689, 0.8941, 0.6235, 0.9138]}, {"w": "as", "b": [0.6298, 0.8941, 0.6509, 0.9138]}, {"w": "many", "b": [0.6572, 0.8941, 0.7132, 0.9138]}, {"w": "epochs.", "b": [0.7195, 0.8941, 0.7959, 0.9138]}]}]}, {"page": 286, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Listing 6.40. Training and evaluating a dropout-regularized GRU-based model", "words": [{"w": "Listing", "b": [0.1294, 0.0852, 0.1862, 0.1]}, {"w": "6.40.", "b": [0.1909, 0.0852, 0.2288, 0.1]}, {"w": "Training", "b": [0.2335, 0.0852, 0.3036, 0.1]}, {"w": "and", "b": [0.3083, 0.0852, 0.3388, 0.1]}, {"w": "evaluating", "b": [0.3435, 0.0852, 0.4276, 0.1]}, {"w": "a", "b": [0.4323, 0.0852, 0.4418, 0.1]}, {"w": "dropout-regularized", "b": [0.4465, 0.0852, 0.6098, 0.1]}, {"w": "GRU-based", "b": [0.6145, 0.0852, 0.7091, 0.1]}, {"w": "model", "b": [0.7139, 0.0852, 0.7633, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential() model.add(layers.GRU(32, dropout=0.2, recurrent_dropout=0.2, input_shape=(None, float_data.shape[-1]))) model.add(layers.Dense(1)) model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=40, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "from", "b": [0.1357, 0.1136, 0.1811, 0.1287]}, {"w": "keras.models", "b": [0.1925, 0.1136, 0.3287, 0.1287]}, {"w": "import", "b": [0.34, 0.1136, 0.4082, 0.1287]}, {"w": "Sequential", "b": [0.4195, 0.1136, 0.533, 0.1287]}, {"w": "from", "b": [0.1357, 0.1288, 0.1811, 0.1439]}, {"w": "keras", "b": [0.1925, 0.1288, 0.2492, 0.1439]}, {"w": "import", "b": [0.2606, 0.1288, 0.3287, 0.1439]}, {"w": "layers", "b": [0.34, 0.1288, 0.4082, 0.1439]}, {"w": "from", "b": [0.1357, 0.1439, 0.1811, 0.1591]}, {"w": "keras.optimizers", "b": [0.1925, 0.1439, 0.3741, 0.1591]}, {"w": "import", "b": [0.3855, 0.1439, 0.4536, 0.1591]}, {"w": "RMSprop", "b": [0.4649, 0.1439, 0.5444, 0.1591]}, {"w": "model", "b": [0.1357, 0.1742, 0.1925, 0.1894]}, {"w": "=", "b": [0.2038, 0.1742, 0.2152, 0.1894]}, {"w": "Sequential()", "b": [0.2265, 0.1742, 0.3628, 0.1894]}, {"w": "model.add(layers.GRU(32,", "b": [0.1357, 0.1894, 0.4082, 0.2045]}, {"w": "dropout=0.2,", "b": [0.3741, 0.2045, 0.5103, 0.2197]}, {"w": "recurrent_dropout=0.2,", "b": [0.3741, 0.2197, 0.6238, 0.2348]}, {"w": "input_shape=(None,", "b": [0.3741, 0.2348, 0.5784, 0.25]}, {"w": "float_data.shape[-1])))", "b": [0.5898, 0.2348, 0.8509, 0.25]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.25, 0.4309, 0.2651]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.2803, 0.5217, 0.2954]}, {"w": "loss='mae')", "b": [0.533, 0.2803, 0.6579, 0.2954]}, {"w": "history", "b": [0.1357, 0.2954, 0.2152, 0.3106]}, {"w": "=", "b": [0.2265, 0.2954, 0.2379, 0.3106]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.2954, 0.5898, 0.3106]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.3106, 0.7033, 0.3257]}, {"w": "epochs=40,", "b": [0.4763, 0.3257, 0.5898, 0.3409]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.3409, 0.7487, 0.356]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.356, 0.7828, 0.3712]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.22 shows the results. Success! You’re no longer overfitting during the first 30 epochs. But although you have more stable evaluation scores, your best scores aren’t much lower than they were previously.", "words": [{"w": "Figure", "b": [0.1294, 0.3941, 0.1953, 0.4138]}, {"w": "6.22", "b": [0.2016, 0.3941, 0.2457, 0.4138]}, {"w": "shows", "b": [0.252, 0.3941, 0.3151, 0.4138]}, {"w": "the", "b": [0.3214, 0.3941, 0.3522, 0.4138]}, {"w": "results.", "b": [0.3585, 0.3941, 0.4307, 0.4138]}, {"w": "Success!", "b": [0.437, 0.3941, 0.5253, 0.4138]}, {"w": "You’re", "b": [0.5316, 0.3941, 0.6005, 0.4138]}, {"w": "no", "b": [0.6068, 0.3941, 0.632, 0.4138]}, {"w": "longer", "b": [0.6383, 0.3941, 0.7028, 0.4138]}, {"w": "overfitting", "b": [0.7091, 0.3941, 0.8156, 0.4138]}, {"w": "during", "b": [0.1294, 0.4146, 0.1953, 0.4343]}, {"w": "the", "b": [0.2016, 0.4146, 0.2324, 0.4343]}, {"w": "first", "b": [0.2387, 0.4146, 0.2794, 0.4343]}, {"w": "30", "b": [0.2857, 0.4146, 0.3109, 0.4343]}, {"w": "epochs.", "b": [0.3172, 0.4146, 0.3936, 0.4343]}, {"w": "But", "b": [0.3999, 0.4146, 0.4363, 0.4343]}, {"w": "although", "b": [0.4426, 0.4146, 0.5309, 0.4343]}, {"w": "you", "b": [0.5372, 0.4146, 0.5751, 0.4343]}, {"w": "have", "b": [0.5814, 0.4146, 0.629, 0.4343]}, {"w": "more", "b": [0.6353, 0.4146, 0.6871, 0.4343]}, {"w": "stable", "b": [0.6934, 0.4146, 0.7523, 0.4343]}, {"w": "evaluation", "b": [0.7586, 0.4146, 0.8637, 0.4343]}, {"w": "scores,", "b": [0.1294, 0.4351, 0.1988, 0.4548]}, {"w": "your", "b": [0.2051, 0.4351, 0.2513, 0.4548]}, {"w": "best", "b": [0.2576, 0.4351, 0.2982, 0.4548]}, {"w": "scores", "b": [0.3046, 0.4351, 0.3676, 0.4548]}, {"w": "aren’t", "b": [0.3739, 0.4351, 0.4323, 0.4548]}, {"w": "much", "b": [0.4386, 0.4351, 0.4946, 0.4548]}, {"w": "lower", "b": [0.5009, 0.4351, 0.5584, 0.4548]}, {"w": "than", "b": [0.5647, 0.4351, 0.6081, 0.4548]}, {"w": "they", "b": [0.6144, 0.4351, 0.6579, 0.4548]}, {"w": "were", "b": [0.6642, 0.4351, 0.7132, 0.4548]}, {"w": "previously.", "b": [0.7195, 0.4351, 0.8306, 0.4548]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 6.22. Training and validation loss on the Jena temperature-forecasting task with a dropout-regularized GRU", "words": [{"w": "Figure", "b": [0.1294, 0.4729, 0.1827, 0.4877]}, {"w": "6.22.", "b": [0.1874, 0.4729, 0.2252, 0.4877]}, {"w": "Training", "b": [0.2299, 0.4729, 0.3, 0.4877]}, {"w": "and", "b": [0.3048, 0.4729, 0.3353, 0.4877]}, {"w": "validation", "b": [0.34, 0.4729, 0.4209, 0.4877]}, {"w": "loss", "b": [0.4257, 0.4729, 0.4551, 0.4877]}, {"w": "on", "b": [0.4598, 0.4729, 0.4798, 0.4877]}, {"w": "the", "b": [0.4846, 0.4729, 0.5098, 0.4877]}, {"w": "Jena", "b": [0.5145, 0.4729, 0.5523, 0.4877]}, {"w": "temperature-forecasting", "b": [0.5571, 0.4729, 0.7529, 0.4877]}, {"w": "task", "b": [0.7576, 0.4729, 0.7912, 0.4877]}, {"w": "with", "b": [0.796, 0.4729, 0.8317, 0.4877]}, {"w": "a", "b": [0.8364, 0.4729, 0.8459, 0.4877]}, {"w": "dropout-regularized", "b": [0.1294, 0.4881, 0.2927, 0.5029]}, {"w": "GRU", "b": [0.2974, 0.4881, 0.3395, 0.5029]}]}, {"id": "b_4", "type": "paragraph", "text": "6.3.7. Stacking recurrent layers", "words": [{"w": "6.3.7.", "b": [0.1294, 0.7978, 0.1862, 0.8176]}, {"w": "Stacking", "b": [0.1925, 0.7978, 0.2864, 0.8176]}, {"w": "recurrent", "b": [0.2927, 0.7978, 0.3954, 0.8176]}, {"w": "layers", "b": [0.4017, 0.7978, 0.4662, 0.8176]}]}, {"id": "b_5", "type": "paragraph", "text": "Because you’re no longer overfitting but seem to have hit a performance bottleneck, you should consider increasing the capacity of the network. Recall the description of the universal machine-learning workflow: it’s", "words": [{"w": "Because", "b": [0.1294, 0.8406, 0.2135, 0.8604]}, {"w": "you’re", "b": [0.2198, 0.8406, 0.2856, 0.8604]}, {"w": "no", "b": [0.2919, 0.8406, 0.3171, 0.8604]}, {"w": "longer", "b": [0.3234, 0.8406, 0.3879, 0.8604]}, {"w": "overfitting", "b": [0.3942, 0.8406, 0.5007, 0.8604]}, {"w": "but", "b": [0.507, 0.8406, 0.5393, 0.8604]}, {"w": "seem", "b": [0.5456, 0.8406, 0.5974, 0.8604]}, {"w": "to", "b": [0.6037, 0.8406, 0.6233, 0.8604]}, {"w": "have", "b": [0.6296, 0.8406, 0.6773, 0.8604]}, {"w": "hit", "b": [0.6836, 0.8406, 0.7102, 0.8604]}, {"w": "a", "b": [0.7165, 0.8406, 0.7277, 0.8604]}, {"w": "performance", "b": [0.734, 0.8406, 0.8615, 0.8604]}, {"w": "bottleneck,", "b": [0.1294, 0.8611, 0.2408, 0.8809]}, {"w": "you", "b": [0.2471, 0.8611, 0.285, 0.8809]}, {"w": "should", "b": [0.2913, 0.8611, 0.3585, 0.8809]}, {"w": "consider", "b": [0.3648, 0.8611, 0.4503, 0.8809]}, {"w": "increasing", "b": [0.4566, 0.8611, 0.5603, 0.8809]}, {"w": "the", "b": [0.5666, 0.8611, 0.5974, 0.8809]}, {"w": "capacity", "b": [0.6037, 0.8611, 0.6878, 0.8809]}, {"w": "of", "b": [0.694, 0.8611, 0.715, 0.8809]}, {"w": "the", "b": [0.7213, 0.8611, 0.7521, 0.8809]}, {"w": "network.", "b": [0.7584, 0.8611, 0.8474, 0.8809]}, {"w": "Recall", "b": [0.1294, 0.8816, 0.1939, 0.9014]}, {"w": "the", "b": [0.2002, 0.8816, 0.231, 0.9014]}, {"w": "description", "b": [0.2373, 0.8816, 0.3494, 0.9014]}, {"w": "of", "b": [0.3557, 0.8816, 0.3767, 0.9014]}, {"w": "the", "b": [0.383, 0.8816, 0.4139, 0.9014]}, {"w": "universal", "b": [0.4202, 0.8816, 0.5126, 0.9014]}, {"w": "machine-learning", "b": [0.5189, 0.8816, 0.6955, 0.9014]}, {"w": "workflow:", "b": [0.7018, 0.8816, 0.8069, 0.9014]}, {"w": "it’s", "b": [0.8132, 0.8816, 0.8439, 0.9014]}]}]}, {"page": 287, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "generally a good idea to increase the capacity of your network until overfitting becomes the primary obstacle (assuming you’re already taking basic steps to mitigate overfitting, such as using dropout). As long as you aren’t overfitting too badly, you’re likely under capacity.", "words": [{"w": "generally", "b": [0.1294, 0.0857, 0.2233, 0.1054]}, {"w": "a", "b": [0.2296, 0.0857, 0.2408, 0.1054]}, {"w": "good", "b": [0.2471, 0.0857, 0.2975, 0.1054]}, {"w": "idea", "b": [0.3038, 0.0857, 0.3459, 0.1054]}, {"w": "to", "b": [0.3522, 0.0857, 0.3718, 0.1054]}, {"w": "increase", "b": [0.3781, 0.0857, 0.4608, 0.1054]}, {"w": "the", "b": [0.467, 0.0857, 0.4978, 0.1054]}, {"w": "capacity", "b": [0.5041, 0.0857, 0.5882, 0.1054]}, {"w": "of", "b": [0.5945, 0.0857, 0.6155, 0.1054]}, {"w": "your", "b": [0.6218, 0.0857, 0.6681, 0.1054]}, {"w": "network", "b": [0.6744, 0.0857, 0.757, 0.1054]}, {"w": "until", "b": [0.7633, 0.0857, 0.8096, 0.1054]}, {"w": "overfitting", "b": [0.1294, 0.1062, 0.2359, 0.1259]}, {"w": "becomes", "b": [0.2422, 0.1062, 0.3305, 0.1259]}, {"w": "the", "b": [0.3368, 0.1062, 0.3676, 0.1259]}, {"w": "primary", "b": [0.3739, 0.1062, 0.4538, 0.1259]}, {"w": "obstacle", "b": [0.4601, 0.1062, 0.5428, 0.1259]}, {"w": "(assuming", "b": [0.5491, 0.1062, 0.6528, 0.1259]}, {"w": "you’re", "b": [0.659, 0.1062, 0.7248, 0.1259]}, {"w": "already", "b": [0.7311, 0.1062, 0.8054, 0.1259]}, {"w": "taking", "b": [0.1294, 0.1267, 0.1925, 0.1464]}, {"w": "basic", "b": [0.1988, 0.1267, 0.2506, 0.1464]}, {"w": "steps", "b": [0.2569, 0.1267, 0.3074, 0.1464]}, {"w": "to", "b": [0.3137, 0.1267, 0.3333, 0.1464]}, {"w": "mitigate", "b": [0.3396, 0.1267, 0.4223, 0.1464]}, {"w": "overfitting,", "b": [0.4286, 0.1267, 0.5414, 0.1464]}, {"w": "such", "b": [0.5477, 0.1267, 0.594, 0.1464]}, {"w": "as", "b": [0.6003, 0.1267, 0.6213, 0.1464]}, {"w": "using", "b": [0.6276, 0.1267, 0.6823, 0.1464]}, {"w": "dropout).", "b": [0.6886, 0.1267, 0.7818, 0.1464]}, {"w": "As", "b": [0.7881, 0.1267, 0.8161, 0.1464]}, {"w": "long", "b": [0.8224, 0.1267, 0.8672, 0.1464]}, {"w": "as", "b": [0.1294, 0.1472, 0.1504, 0.1669]}, {"w": "you", "b": [0.1567, 0.1472, 0.1946, 0.1669]}, {"w": "aren’t", "b": [0.2009, 0.1472, 0.2592, 0.1669]}, {"w": "overfitting", "b": [0.2655, 0.1472, 0.372, 0.1669]}, {"w": "too", "b": [0.3784, 0.1472, 0.4106, 0.1669]}, {"w": "badly,", "b": [0.4169, 0.1472, 0.4776, 0.1669]}, {"w": "you’re", "b": [0.4839, 0.1472, 0.5497, 0.1669]}, {"w": "likely", "b": [0.556, 0.1472, 0.6135, 0.1669]}, {"w": "under", "b": [0.6198, 0.1472, 0.6772, 0.1669]}, {"w": "capacity.", "b": [0.6835, 0.1472, 0.7722, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Increasing network capacity is typically done by increasing the number of units in the layers or adding more layers. Recurrent layer stacking is a classic way to build more-powerful recurrent networks: for instance, what currently powers the Google Translate algorithm is a stack of seven large LSTM layers—that’s huge.", "words": [{"w": "Increasing", "b": [0.1294, 0.19, 0.2345, 0.2097]}, {"w": "network", "b": [0.2408, 0.19, 0.3234, 0.2097]}, {"w": "capacity", "b": [0.3298, 0.19, 0.4138, 0.2097]}, {"w": "is", "b": [0.4201, 0.19, 0.4369, 0.2097]}, {"w": "typically", "b": [0.4432, 0.19, 0.5315, 0.2097]}, {"w": "done", "b": [0.5378, 0.19, 0.5869, 0.2097]}, {"w": "by", "b": [0.5932, 0.19, 0.6184, 0.2097]}, {"w": "increasing", "b": [0.6247, 0.19, 0.7284, 0.2097]}, {"w": "the", "b": [0.7347, 0.19, 0.7655, 0.2097]}, {"w": "number", "b": [0.7718, 0.19, 0.8489, 0.2097]}, {"w": "of", "b": [0.1294, 0.2105, 0.1504, 0.2302]}, {"w": "units", "b": [0.1567, 0.2105, 0.2058, 0.2302]}, {"w": "in", "b": [0.2121, 0.2105, 0.2317, 0.2302]}, {"w": "the", "b": [0.238, 0.2105, 0.2689, 0.2302]}, {"w": "layers", "b": [0.2752, 0.2105, 0.3354, 0.2302]}, {"w": "or", "b": [0.3417, 0.2105, 0.3627, 0.2302]}, {"w": "adding", "b": [0.369, 0.2105, 0.4377, 0.2302]}, {"w": "more", "b": [0.444, 0.2105, 0.4958, 0.2302]}, {"w": "layers.", "b": [0.5021, 0.2105, 0.5687, 0.2302]}, {"w": "Recurrent", "b": [0.575, 0.2105, 0.6745, 0.2302]}, {"w": "layer", "b": [0.6807, 0.2105, 0.7311, 0.2302]}, {"w": "stacking", "b": [0.7374, 0.2105, 0.8215, 0.2302]}, {"w": "is", "b": [0.8278, 0.2105, 0.8446, 0.2302]}, {"w": "a", "b": [0.8509, 0.2105, 0.8621, 0.2302]}, {"w": "classic", "b": [0.1294, 0.231, 0.1967, 0.2507]}, {"w": "way", "b": [0.203, 0.231, 0.245, 0.2507]}, {"w": "to", "b": [0.2513, 0.231, 0.2709, 0.2507]}, {"w": "build", "b": [0.2772, 0.231, 0.3291, 0.2507]}, {"w": "more-powerful", "b": [0.3354, 0.231, 0.4867, 0.2507]}, {"w": "recurrent", "b": [0.493, 0.231, 0.5841, 0.2507]}, {"w": "networks:", "b": [0.5904, 0.231, 0.6899, 0.2507]}, {"w": "for", "b": [0.6962, 0.231, 0.7256, 0.2507]}, {"w": "instance,", "b": [0.7319, 0.231, 0.8209, 0.2507]}, {"w": "what", "b": [0.1294, 0.2515, 0.1785, 0.2712]}, {"w": "currently", "b": [0.1848, 0.2515, 0.2758, 0.2712]}, {"w": "powers", "b": [0.2821, 0.2515, 0.355, 0.2712]}, {"w": "the", "b": [0.3613, 0.2515, 0.3921, 0.2712]}, {"w": "Google", "b": [0.3984, 0.2515, 0.4727, 0.2712]}, {"w": "Translate", "b": [0.4789, 0.2515, 0.5719, 0.2712]}, {"w": "algorithm", "b": [0.5782, 0.2515, 0.6763, 0.2712]}, {"w": "is", "b": [0.6826, 0.2515, 0.6995, 0.2712]}, {"w": "a", "b": [0.7058, 0.2515, 0.717, 0.2712]}, {"w": "stack", "b": [0.7233, 0.2515, 0.7751, 0.2712]}, {"w": "of", "b": [0.7814, 0.2515, 0.8024, 0.2712]}, {"w": "seven", "b": [0.8087, 0.2515, 0.8662, 0.2712]}, {"w": "large", "b": [0.1294, 0.272, 0.1794, 0.2917]}, {"w": "LSTM", "b": [0.1857, 0.273, 0.2462, 0.2932]}, {"w": "layers—that’s", "b": [0.2525, 0.272, 0.3926, 0.2917]}, {"w": "huge.", "b": [0.3989, 0.272, 0.4543, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "To stack recurrent layers on top of each other in Keras, all intermediate layers should return their full sequence of outputs (a 3D tensor) rather than their output at the last timestep. This is done by specifying return_sequences=True.", "words": [{"w": "To", "b": [0.1294, 0.3156, 0.1557, 0.3354]}, {"w": "stack", "b": [0.162, 0.3156, 0.2138, 0.3354]}, {"w": "recurrent", "b": [0.2201, 0.3156, 0.3112, 0.3354]}, {"w": "layers", "b": [0.3175, 0.3156, 0.3777, 0.3354]}, {"w": "on", "b": [0.384, 0.3156, 0.4092, 0.3354]}, {"w": "top", "b": [0.4155, 0.3156, 0.4478, 0.3354]}, {"w": "of", "b": [0.4541, 0.3156, 0.4751, 0.3354]}, {"w": "each", "b": [0.4814, 0.3156, 0.5276, 0.3354]}, {"w": "other", "b": [0.5339, 0.3156, 0.5858, 0.3354]}, {"w": "in", "b": [0.5921, 0.3156, 0.6117, 0.3354]}, {"w": "Keras,", "b": [0.618, 0.3156, 0.6831, 0.3354]}, {"w": "all", "b": [0.6894, 0.3156, 0.7147, 0.3354]}, {"w": "intermediate", "b": [0.721, 0.3156, 0.8471, 0.3354]}, {"w": "layers", "b": [0.1294, 0.3361, 0.1897, 0.3559]}, {"w": "should", "b": [0.196, 0.3361, 0.2632, 0.3559]}, {"w": "return", "b": [0.2695, 0.3361, 0.3298, 0.3559]}, {"w": "their", "b": [0.3361, 0.3361, 0.3823, 0.3559]}, {"w": "full", "b": [0.3886, 0.3361, 0.4237, 0.3559]}, {"w": "sequence", "b": [0.43, 0.3361, 0.5224, 0.3559]}, {"w": "of", "b": [0.5287, 0.3361, 0.5497, 0.3559]}, {"w": "outputs", "b": [0.5561, 0.3361, 0.6303, 0.3559]}, {"w": "(a", "b": [0.6366, 0.3361, 0.6562, 0.3559]}, {"w": "3D", "b": [0.6625, 0.3361, 0.6933, 0.3559]}, {"w": "tensor)", "b": [0.6996, 0.3361, 0.7697, 0.3559]}, {"w": "rather", "b": [0.776, 0.3361, 0.8348, 0.3559]}, {"w": "than", "b": [0.1294, 0.3566, 0.1729, 0.3764]}, {"w": "their", "b": [0.1792, 0.3566, 0.2254, 0.3764]}, {"w": "output", "b": [0.2317, 0.3566, 0.2962, 0.3764]}, {"w": "at", "b": [0.3025, 0.3566, 0.3207, 0.3764]}, {"w": "the", "b": [0.327, 0.3566, 0.3578, 0.3764]}, {"w": "last", "b": [0.3641, 0.3566, 0.3992, 0.3764]}, {"w": "timestep.", "b": [0.4055, 0.3566, 0.4973, 0.3764]}, {"w": "This", "b": [0.5036, 0.3566, 0.5484, 0.3764]}, {"w": "is", "b": [0.5547, 0.3566, 0.5716, 0.3764]}, {"w": "done", "b": [0.5779, 0.3566, 0.6269, 0.3764]}, {"w": "by", "b": [0.6332, 0.3566, 0.6584, 0.3764]}, {"w": "specifying", "b": [0.6648, 0.3566, 0.7698, 0.3764]}, {"w": "return_sequences=True.", "b": [0.1294, 0.3771, 0.4536, 0.3984]}]}, {"id": "b_3", "type": "equation", "text": "Listing 6.41. Training and evaluating a dropout-regularized, stacked GRU model", "words": [{"w": "Listing", "b": [0.1294, 0.4159, 0.1862, 0.4307]}, {"w": "6.41.", "b": [0.1909, 0.4159, 0.2288, 0.4307]}, {"w": "Training", "b": [0.2335, 0.4159, 0.3036, 0.4307]}, {"w": "and", "b": [0.3083, 0.4159, 0.3388, 0.4307]}, {"w": "evaluating", "b": [0.3435, 0.4159, 0.4276, 0.4307]}, {"w": "a", "b": [0.4323, 0.4159, 0.4418, 0.4307]}, {"w": "dropout-regularized,", "b": [0.4465, 0.4159, 0.6145, 0.4307]}, {"w": "stacked", "b": [0.6193, 0.4159, 0.6802, 0.4307]}, {"w": "GRU", "b": [0.685, 0.4159, 0.727, 0.4307]}, {"w": "model", "b": [0.7317, 0.4159, 0.7811, 0.4307]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential() model.add(layers.GRU(32, dropout=0.1, recurrent_dropout=0.5, return_sequences=True, input_shape=(None, float_data.shape[-1]))) model.add(layers.GRU(64, activation='relu', dropout=0.1, recurrent_dropout=0.5)) model.add(layers.Dense(1)) model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=40, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "from", "b": [0.1357, 0.4443, 0.1811, 0.4594]}, {"w": "keras.models", "b": [0.1925, 0.4443, 0.3287, 0.4594]}, {"w": "import", "b": [0.34, 0.4443, 0.4082, 0.4594]}, {"w": "Sequential", "b": [0.4195, 0.4443, 0.533, 0.4594]}, {"w": "from", "b": [0.1357, 0.4594, 0.1811, 0.4746]}, {"w": "keras", "b": [0.1925, 0.4594, 0.2492, 0.4746]}, {"w": "import", "b": [0.2606, 0.4594, 0.3287, 0.4746]}, {"w": "layers", "b": [0.34, 0.4594, 0.4082, 0.4746]}, {"w": "from", "b": [0.1357, 0.4746, 0.1811, 0.4897]}, {"w": "keras.optimizers", "b": [0.1925, 0.4746, 0.3741, 0.4897]}, {"w": "import", "b": [0.3855, 0.4746, 0.4536, 0.4897]}, {"w": "RMSprop", "b": [0.4649, 0.4746, 0.5444, 0.4897]}, {"w": "model", "b": [0.1357, 0.5049, 0.1925, 0.52]}, {"w": "=", "b": [0.2038, 0.5049, 0.2152, 0.52]}, {"w": "Sequential()", "b": [0.2265, 0.5049, 0.3628, 0.52]}, {"w": "model.add(layers.GRU(32,", "b": [0.1357, 0.52, 0.4082, 0.5352]}, {"w": "dropout=0.1,", "b": [0.3741, 0.5352, 0.5103, 0.5503]}, {"w": "recurrent_dropout=0.5,", "b": [0.3741, 0.5503, 0.6238, 0.5655]}, {"w": "return_sequences=True,", "b": [0.3741, 0.5655, 0.6238, 0.5806]}, {"w": "input_shape=(None,", "b": [0.3741, 0.5807, 0.5784, 0.5958]}, {"w": "float_data.shape[-1])))", "b": [0.5898, 0.5807, 0.8509, 0.5958]}, {"w": "model.add(layers.GRU(64,", "b": [0.1357, 0.5958, 0.4082, 0.6109]}, {"w": "activation='relu',", "b": [0.4195, 0.5958, 0.6238, 0.6109]}, {"w": "dropout=0.1,", "b": [0.3741, 0.611, 0.5103, 0.6261]}, {"w": "recurrent_dropout=0.5))", "b": [0.3741, 0.6261, 0.6352, 0.6413]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.6413, 0.4309, 0.6564]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.6716, 0.5217, 0.6867]}, {"w": "loss='mae')", "b": [0.533, 0.6716, 0.6579, 0.6867]}, {"w": "history", "b": [0.1357, 0.6867, 0.2152, 0.7019]}, {"w": "=", "b": [0.2265, 0.6867, 0.2379, 0.7019]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.6867, 0.5898, 0.7019]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.7019, 0.7033, 0.717]}, {"w": "epochs=40,", "b": [0.4763, 0.717, 0.5898, 0.7322]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.7322, 0.7487, 0.7473]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.7473, 0.7828, 0.7625]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 6.23 shows the results. You can see that the added layer does improve the results a bit, though not significantly. You can draw two conclusions:", "words": [{"w": "Figure", "b": [0.1294, 0.7854, 0.1953, 0.8051]}, {"w": "6.23", "b": [0.2016, 0.7854, 0.2457, 0.8051]}, {"w": "shows", "b": [0.252, 0.7854, 0.3151, 0.8051]}, {"w": "the", "b": [0.3214, 0.7854, 0.3522, 0.8051]}, {"w": "results.", "b": [0.3585, 0.7854, 0.4307, 0.8051]}, {"w": "You", "b": [0.437, 0.7854, 0.4779, 0.8051]}, {"w": "can", "b": [0.4842, 0.7854, 0.5192, 0.8051]}, {"w": "see", "b": [0.5255, 0.7854, 0.5578, 0.8051]}, {"w": "that", "b": [0.5641, 0.7854, 0.6019, 0.8051]}, {"w": "the", "b": [0.6082, 0.7854, 0.639, 0.8051]}, {"w": "added", "b": [0.6453, 0.7854, 0.7056, 0.8051]}, {"w": "layer", "b": [0.7119, 0.7854, 0.7623, 0.8051]}, {"w": "does", "b": [0.7686, 0.7854, 0.8149, 0.8051]}, {"w": "improve", "b": [0.1294, 0.8059, 0.2135, 0.8256]}, {"w": "the", "b": [0.2198, 0.8059, 0.2506, 0.8256]}, {"w": "results", "b": [0.2569, 0.8059, 0.3228, 0.8256]}, {"w": "a", "b": [0.3291, 0.8059, 0.3403, 0.8256]}, {"w": "bit,", "b": [0.3466, 0.8059, 0.3796, 0.8256]}, {"w": "though", "b": [0.3859, 0.8059, 0.4559, 0.8256]}, {"w": "not", "b": [0.4622, 0.8059, 0.4945, 0.8256]}, {"w": "significantly.", "b": [0.5008, 0.8059, 0.6315, 0.8256]}, {"w": "You", "b": [0.6378, 0.8059, 0.6787, 0.8256]}, {"w": "can", "b": [0.685, 0.8059, 0.7201, 0.8256]}, {"w": "draw", "b": [0.7264, 0.8059, 0.7768, 0.8256]}, {"w": "two", "b": [0.7831, 0.8059, 0.8209, 0.8256]}, {"w": "conclusions:", "b": [0.1294, 0.8264, 0.2555, 0.8461]}]}, {"id": "b_6", "type": "paragraph", "text": "Because you’re still not overfitting too badly, you could safely increase the size of your layers in a quest for validation-loss", "words": [{"w": "Because", "b": [0.1799, 0.8647, 0.2639, 0.8844]}, {"w": "you’re", "b": [0.2702, 0.8647, 0.3361, 0.8844]}, {"w": "still", "b": [0.3424, 0.8647, 0.3802, 0.8844]}, {"w": "not", "b": [0.3865, 0.8647, 0.4188, 0.8844]}, {"w": "overfitting", "b": [0.4251, 0.8647, 0.5316, 0.8844]}, {"w": "too", "b": [0.5379, 0.8647, 0.5701, 0.8844]}, {"w": "badly,", "b": [0.5764, 0.8647, 0.6371, 0.8844]}, {"w": "you", "b": [0.6434, 0.8647, 0.6812, 0.8844]}, {"w": "could", "b": [0.6875, 0.8647, 0.7436, 0.8844]}, {"w": "safely", "b": [0.7499, 0.8647, 0.8101, 0.8844]}, {"w": "increase", "b": [0.1799, 0.8852, 0.2625, 0.9049]}, {"w": "the", "b": [0.2688, 0.8852, 0.2996, 0.9049]}, {"w": "size", "b": [0.3059, 0.8852, 0.3452, 0.9049]}, {"w": "of", "b": [0.3515, 0.8852, 0.3725, 0.9049]}, {"w": "your", "b": [0.3788, 0.8852, 0.425, 0.9049]}, {"w": "layers", "b": [0.4313, 0.8852, 0.4916, 0.9049]}, {"w": "in", "b": [0.4979, 0.8852, 0.5175, 0.9049]}, {"w": "a", "b": [0.5238, 0.8852, 0.535, 0.9049]}, {"w": "quest", "b": [0.5413, 0.8852, 0.5946, 0.9049]}, {"w": "for", "b": [0.6009, 0.8852, 0.6303, 0.9049]}, {"w": "validation-loss", "b": [0.6366, 0.8852, 0.7852, 0.9049]}]}]}, {"page": 288, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "improvement. This has a non-negligible computational cost, though. Adding a layer didn’t help by a significant factor, so you may be seeing diminishing returns from increasing network capacity at this point.", "words": [{"w": "improvement.", "b": [0.1799, 0.0857, 0.3207, 0.1054]}, {"w": "This", "b": [0.327, 0.0857, 0.3719, 0.1054]}, {"w": "has", "b": [0.3782, 0.0857, 0.4118, 0.1054]}, {"w": "a", "b": [0.4181, 0.0857, 0.4293, 0.1054]}, {"w": "non-negligible", "b": [0.4356, 0.0857, 0.5827, 0.1054]}, {"w": "computational", "b": [0.5891, 0.0857, 0.7334, 0.1054]}, {"w": "cost,", "b": [0.7397, 0.0857, 0.7866, 0.1054]}, {"w": "though.", "b": [0.793, 0.0857, 0.8693, 0.1054]}, {"w": "Adding", "b": [0.1799, 0.1062, 0.2555, 0.1259]}, {"w": "a", "b": [0.2618, 0.1062, 0.273, 0.1259]}, {"w": "layer", "b": [0.2794, 0.1062, 0.3298, 0.1259]}, {"w": "didn’t", "b": [0.3361, 0.1062, 0.3959, 0.1259]}, {"w": "help", "b": [0.4022, 0.1062, 0.4456, 0.1259]}, {"w": "by", "b": [0.4519, 0.1062, 0.4772, 0.1259]}, {"w": "a", "b": [0.4835, 0.1062, 0.4947, 0.1259]}, {"w": "significant", "b": [0.501, 0.1062, 0.6075, 0.1259]}, {"w": "factor,", "b": [0.6138, 0.1062, 0.6779, 0.1259]}, {"w": "so", "b": [0.6842, 0.1062, 0.7066, 0.1259]}, {"w": "you", "b": [0.7129, 0.1062, 0.7507, 0.1259]}, {"w": "may", "b": [0.757, 0.1062, 0.8005, 0.1259]}, {"w": "be", "b": [0.8068, 0.1062, 0.8306, 0.1259]}, {"w": "seeing", "b": [0.1799, 0.1267, 0.2443, 0.1464]}, {"w": "diminishing", "b": [0.2506, 0.1267, 0.3712, 0.1464]}, {"w": "returns", "b": [0.3775, 0.1267, 0.4475, 0.1464]}, {"w": "from", "b": [0.4538, 0.1267, 0.5029, 0.1464]}, {"w": "increasing", "b": [0.5092, 0.1267, 0.6129, 0.1464]}, {"w": "network", "b": [0.6192, 0.1267, 0.7018, 0.1464]}, {"w": "capacity", "b": [0.7081, 0.1267, 0.7922, 0.1464]}, {"w": "at", "b": [0.7984, 0.1267, 0.8166, 0.1464]}, {"w": "this", "b": [0.8229, 0.1267, 0.8594, 0.1464]}, {"w": "point.", "b": [0.1799, 0.1472, 0.238, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.23. Training and validation loss on the Jena temperature-forecasting task with a stacked GRU network", "words": [{"w": "Figure", "b": [0.1294, 0.1895, 0.1827, 0.2043]}, {"w": "6.23.", "b": [0.1874, 0.1895, 0.2252, 0.2043]}, {"w": "Training", "b": [0.2299, 0.1895, 0.3, 0.2043]}, {"w": "and", "b": [0.3048, 0.1895, 0.3353, 0.2043]}, {"w": "validation", "b": [0.34, 0.1895, 0.4209, 0.2043]}, {"w": "loss", "b": [0.4257, 0.1895, 0.4551, 0.2043]}, {"w": "on", "b": [0.4598, 0.1895, 0.4798, 0.2043]}, {"w": "the", "b": [0.4846, 0.1895, 0.5098, 0.2043]}, {"w": "Jena", "b": [0.5145, 0.1895, 0.5523, 0.2043]}, {"w": "temperature-forecasting", "b": [0.5571, 0.1895, 0.7529, 0.2043]}, {"w": "task", "b": [0.7576, 0.1895, 0.7912, 0.2043]}, {"w": "with", "b": [0.796, 0.1895, 0.8317, 0.2043]}, {"w": "a", "b": [0.8364, 0.1895, 0.8459, 0.2043]}, {"w": "stacked", "b": [0.1294, 0.2046, 0.1904, 0.2194]}, {"w": "GRU", "b": [0.1951, 0.2046, 0.2371, 0.2194]}, {"w": "network", "b": [0.2419, 0.2046, 0.3091, 0.2194]}]}, {"id": "b_2", "type": "paragraph", "text": "6.3.8. Using bidirectional RNNs", "words": [{"w": "6.3.8.", "b": [0.1294, 0.5144, 0.1862, 0.5341]}, {"w": "Using", "b": [0.1925, 0.5144, 0.2542, 0.5341]}, {"w": "bidirectional", "b": [0.2605, 0.5144, 0.3974, 0.5341]}, {"w": "RNNs", "b": [0.4037, 0.5144, 0.4681, 0.5341]}]}, {"id": "b_3", "type": "paragraph", "text": "The last technique introduced in this section is called bidirectional RNNs. A bidirectional RNN is a common RNN variant that can offer greater performance than a regular RNN on certain tasks. It’s frequently used in natural-language processing—you could call it the Swiss Army knife of deep learning for natural-language processing.", "words": [{"w": "The", "b": [0.1294, 0.5572, 0.1686, 0.5769]}, {"w": "last", "b": [0.1749, 0.5572, 0.21, 0.5769]}, {"w": "technique", "b": [0.2163, 0.5572, 0.3144, 0.5769]}, {"w": "introduced", "b": [0.3207, 0.5572, 0.4286, 0.5769]}, {"w": "in", "b": [0.4349, 0.5572, 0.4545, 0.5769]}, {"w": "this", "b": [0.4608, 0.5572, 0.4973, 0.5769]}, {"w": "section", "b": [0.5036, 0.5572, 0.575, 0.5769]}, {"w": "is", "b": [0.5813, 0.5572, 0.5982, 0.5769]}, {"w": "called", "b": [0.6045, 0.5572, 0.6647, 0.5769]}, {"w": "bidirectional", "b": [0.6709, 0.5572, 0.8003, 0.5769]}, {"w": "RNNs.", "b": [0.1294, 0.5777, 0.1946, 0.5974]}, {"w": "A", "b": [0.2009, 0.5777, 0.2191, 0.5974]}, {"w": "bidirectional", "b": [0.2254, 0.5777, 0.3529, 0.5974]}, {"w": "RNN", "b": [0.3592, 0.5777, 0.4125, 0.5974]}, {"w": "is", "b": [0.4188, 0.5777, 0.4356, 0.5974]}, {"w": "a", "b": [0.4419, 0.5777, 0.4531, 0.5974]}, {"w": "common", "b": [0.4594, 0.5777, 0.5477, 0.5974]}, {"w": "RNN", "b": [0.554, 0.5777, 0.6073, 0.5974]}, {"w": "variant", "b": [0.6136, 0.5777, 0.6836, 0.5974]}, {"w": "that", "b": [0.6899, 0.5777, 0.7278, 0.5974]}, {"w": "can", "b": [0.7341, 0.5777, 0.7691, 0.5974]}, {"w": "offer", "b": [0.7754, 0.5777, 0.8239, 0.5974]}, {"w": "greater", "b": [0.1294, 0.5982, 0.1994, 0.6179]}, {"w": "performance", "b": [0.2057, 0.5982, 0.3332, 0.6179]}, {"w": "than", "b": [0.3395, 0.5982, 0.383, 0.6179]}, {"w": "a", "b": [0.3893, 0.5982, 0.4005, 0.6179]}, {"w": "regular", "b": [0.4068, 0.5982, 0.4782, 0.6179]}, {"w": "RNN", "b": [0.4845, 0.5982, 0.5378, 0.6179]}, {"w": "on", "b": [0.5441, 0.5982, 0.5693, 0.6179]}, {"w": "certain", "b": [0.5756, 0.5982, 0.6442, 0.6179]}, {"w": "tasks.", "b": [0.6506, 0.5982, 0.7073, 0.6179]}, {"w": "It’s", "b": [0.7136, 0.5982, 0.7458, 0.6179]}, {"w": "frequently", "b": [0.7521, 0.5982, 0.8558, 0.6179]}, {"w": "used", "b": [0.1294, 0.6187, 0.1757, 0.6384]}, {"w": "in", "b": [0.182, 0.6187, 0.2016, 0.6384]}, {"w": "natural-language", "b": [0.2079, 0.6187, 0.3774, 0.6384]}, {"w": "processing—you", "b": [0.3837, 0.6187, 0.5547, 0.6384]}, {"w": "could", "b": [0.561, 0.6187, 0.617, 0.6384]}, {"w": "call", "b": [0.6233, 0.6187, 0.6598, 0.6384]}, {"w": "it", "b": [0.6661, 0.6187, 0.6801, 0.6384]}, {"w": "the", "b": [0.6864, 0.6187, 0.7172, 0.6384]}, {"w": "Swiss", "b": [0.7235, 0.6187, 0.7824, 0.6384]}, {"w": "Army", "b": [0.7887, 0.6187, 0.8476, 0.6384]}, {"w": "knife", "b": [0.1294, 0.6392, 0.1813, 0.6589]}, {"w": "of", "b": [0.1876, 0.6392, 0.2086, 0.6589]}, {"w": "deep", "b": [0.2149, 0.6392, 0.2625, 0.6589]}, {"w": "learning", "b": [0.2688, 0.6392, 0.3515, 0.6589]}, {"w": "for", "b": [0.3578, 0.6392, 0.3872, 0.6589]}, {"w": "natural-language", "b": [0.3935, 0.6392, 0.563, 0.6589]}, {"w": "processing.", "b": [0.5692, 0.6392, 0.6834, 0.6589]}]}, {"id": "b_4", "type": "paragraph", "text": "RNNs are notably order dependent, or time dependent: they process the timesteps of their input sequences in order, and shuffling or reversing the timesteps can completely change the representations the RNN extracts from the sequence. This is precisely the reason they perform well on problems where order is meaningful, such as the temperature-forecasting problem. A bidirectional RNN exploits the order sensitivity of RNNs: it consists of using two regular RNNs, such as the GRU and LSTM layers you’re already familiar with, each of which processes the input sequence in one direction (chronologically and antichronologically), and then merging their representations. By processing a sequence both ways, a", "words": [{"w": "RNNs", "b": [0.1294, 0.682, 0.1925, 0.7017]}, {"w": "are", "b": [0.1988, 0.682, 0.2296, 0.7017]}, {"w": "notably", "b": [0.2359, 0.682, 0.3116, 0.7017]}, {"w": "order", "b": [0.3179, 0.682, 0.3711, 0.7017]}, {"w": "dependent,", "b": [0.3774, 0.682, 0.4874, 0.7017]}, {"w": "or", "b": [0.4937, 0.682, 0.5147, 0.7017]}, {"w": "time", "b": [0.521, 0.682, 0.5659, 0.7017]}, {"w": "dependent:", "b": [0.5722, 0.682, 0.6829, 0.7017]}, {"w": "they", "b": [0.6892, 0.682, 0.7326, 0.7017]}, {"w": "process", "b": [0.7389, 0.682, 0.8146, 0.7017]}, {"w": "the", "b": [0.8209, 0.682, 0.8517, 0.7017]}, {"w": "timesteps", "b": [0.1294, 0.7025, 0.2247, 0.7222]}, {"w": "of", "b": [0.231, 0.7025, 0.252, 0.7222]}, {"w": "their", "b": [0.2583, 0.7025, 0.3046, 0.7222]}, {"w": "input", "b": [0.3109, 0.7025, 0.3628, 0.7222]}, {"w": "sequences", "b": [0.3691, 0.7025, 0.4713, 0.7222]}, {"w": "in", "b": [0.4776, 0.7025, 0.4973, 0.7222]}, {"w": "order,", "b": [0.5036, 0.7025, 0.562, 0.7222]}, {"w": "and", "b": [0.5683, 0.7025, 0.6048, 0.7222]}, {"w": "shuffling", "b": [0.6111, 0.7025, 0.7017, 0.7222]}, {"w": "or", "b": [0.708, 0.7025, 0.729, 0.7222]}, {"w": "reversing", "b": [0.7353, 0.7025, 0.8292, 0.7222]}, {"w": "the", "b": [0.8355, 0.7025, 0.8663, 0.7222]}, {"w": "timesteps", "b": [0.1294, 0.723, 0.2247, 0.7427]}, {"w": "can", "b": [0.231, 0.723, 0.266, 0.7427]}, {"w": "completely", "b": [0.2723, 0.723, 0.3844, 0.7427]}, {"w": "change", "b": [0.3908, 0.723, 0.4622, 0.7427]}, {"w": "the", "b": [0.4685, 0.723, 0.4993, 0.7427]}, {"w": "representations", "b": [0.5056, 0.723, 0.6583, 0.7427]}, {"w": "the", "b": [0.6647, 0.723, 0.6955, 0.7427]}, {"w": "RNN", "b": [0.7018, 0.723, 0.755, 0.7427]}, {"w": "extracts", "b": [0.7613, 0.723, 0.8398, 0.7427]}, {"w": "from", "b": [0.1294, 0.7435, 0.1785, 0.7632]}, {"w": "the", "b": [0.1848, 0.7435, 0.2156, 0.7632]}, {"w": "sequence.", "b": [0.2219, 0.7435, 0.3206, 0.7632]}, {"w": "This", "b": [0.327, 0.7435, 0.3718, 0.7632]}, {"w": "is", "b": [0.3781, 0.7435, 0.3949, 0.7632]}, {"w": "precisely", "b": [0.4012, 0.7435, 0.4923, 0.7632]}, {"w": "the", "b": [0.4986, 0.7435, 0.5294, 0.7632]}, {"w": "reason", "b": [0.5357, 0.7435, 0.6015, 0.7632]}, {"w": "they", "b": [0.6078, 0.7435, 0.6513, 0.7632]}, {"w": "perform", "b": [0.6576, 0.7435, 0.7388, 0.7632]}, {"w": "well", "b": [0.7451, 0.7435, 0.7886, 0.7632]}, {"w": "on", "b": [0.7949, 0.7435, 0.8201, 0.7632]}, {"w": "problems", "b": [0.1294, 0.764, 0.2233, 0.7837]}, {"w": "where", "b": [0.2296, 0.764, 0.2912, 0.7837]}, {"w": "order", "b": [0.2975, 0.764, 0.3508, 0.7837]}, {"w": "is", "b": [0.3571, 0.764, 0.3739, 0.7837]}, {"w": "meaningful,", "b": [0.3802, 0.764, 0.5014, 0.7837]}, {"w": "such", "b": [0.5077, 0.764, 0.554, 0.7837]}, {"w": "as", "b": [0.5603, 0.764, 0.5813, 0.7837]}, {"w": "the", "b": [0.5876, 0.764, 0.6184, 0.7837]}, {"w": "temperature-forecasting", "b": [0.6247, 0.764, 0.8657, 0.7837]}, {"w": "problem.", "b": [0.1294, 0.7845, 0.2198, 0.8042]}, {"w": "A", "b": [0.2261, 0.7845, 0.2443, 0.8042]}, {"w": "bidirectional", "b": [0.2506, 0.7845, 0.3781, 0.8042]}, {"w": "RNN", "b": [0.3844, 0.7845, 0.4376, 0.8042]}, {"w": "exploits", "b": [0.4439, 0.7845, 0.5238, 0.8042]}, {"w": "the", "b": [0.5301, 0.7845, 0.561, 0.8042]}, {"w": "order", "b": [0.5673, 0.7845, 0.6205, 0.8042]}, {"w": "sensitivity", "b": [0.6268, 0.7845, 0.7305, 0.8042]}, {"w": "of", "b": [0.7368, 0.7845, 0.7579, 0.8042]}, {"w": "RNNs:", "b": [0.7642, 0.7845, 0.8342, 0.8042]}, {"w": "it", "b": [0.8405, 0.7845, 0.8546, 0.8042]}, {"w": "consists", "b": [0.1294, 0.805, 0.2093, 0.8247]}, {"w": "of", "b": [0.2156, 0.805, 0.2366, 0.8247]}, {"w": "using", "b": [0.2429, 0.805, 0.2976, 0.8247]}, {"w": "two", "b": [0.3039, 0.805, 0.3417, 0.8247]}, {"w": "regular", "b": [0.348, 0.805, 0.4195, 0.8247]}, {"w": "RNNs,", "b": [0.4258, 0.805, 0.4952, 0.8247]}, {"w": "such", "b": [0.5015, 0.805, 0.5477, 0.8247]}, {"w": "as", "b": [0.554, 0.805, 0.575, 0.8247]}, {"w": "the", "b": [0.5813, 0.805, 0.6122, 0.8247]}, {"w": "GRU", "b": [0.6185, 0.806, 0.6639, 0.8262]}, {"w": "and", "b": [0.6702, 0.805, 0.7066, 0.8247]}, {"w": "LSTM", "b": [0.7129, 0.806, 0.7734, 0.8262]}, {"w": "layers", "b": [0.7797, 0.805, 0.84, 0.8247]}, {"w": "you’re", "b": [0.1294, 0.8264, 0.1953, 0.8461]}, {"w": "already", "b": [0.2016, 0.8264, 0.2758, 0.8461]}, {"w": "familiar", "b": [0.2821, 0.8264, 0.362, 0.8461]}, {"w": "with,", "b": [0.3683, 0.8264, 0.4194, 0.8461]}, {"w": "each", "b": [0.4257, 0.8264, 0.472, 0.8461]}, {"w": "of", "b": [0.4783, 0.8264, 0.4993, 0.8461]}, {"w": "which", "b": [0.5056, 0.8264, 0.5672, 0.8461]}, {"w": "processes", "b": [0.5735, 0.8264, 0.6702, 0.8461]}, {"w": "the", "b": [0.6765, 0.8264, 0.7073, 0.8461]}, {"w": "input", "b": [0.7136, 0.8264, 0.7655, 0.8461]}, {"w": "sequence", "b": [0.7718, 0.8264, 0.8643, 0.8461]}, {"w": "in", "b": [0.1294, 0.8469, 0.149, 0.8666]}, {"w": "one", "b": [0.1553, 0.8469, 0.1918, 0.8666]}, {"w": "direction", "b": [0.1981, 0.8469, 0.2878, 0.8666]}, {"w": "(chronologically", "b": [0.2941, 0.8469, 0.4608, 0.8666]}, {"w": "and", "b": [0.4671, 0.8469, 0.5035, 0.8666]}, {"w": "antichronologically),", "b": [0.5098, 0.8469, 0.7207, 0.8666]}, {"w": "and", "b": [0.7269, 0.8469, 0.7634, 0.8666]}, {"w": "then", "b": [0.7697, 0.8469, 0.8131, 0.8666]}, {"w": "merging", "b": [0.1294, 0.8674, 0.213, 0.8871]}, {"w": "their", "b": [0.2193, 0.8674, 0.2656, 0.8871]}, {"w": "representations.", "b": [0.2719, 0.8674, 0.4309, 0.8871]}, {"w": "By", "b": [0.4372, 0.8674, 0.4666, 0.8871]}, {"w": "processing", "b": [0.473, 0.8674, 0.5808, 0.8871]}, {"w": "a", "b": [0.5871, 0.8674, 0.5983, 0.8871]}, {"w": "sequence", "b": [0.6047, 0.8674, 0.6971, 0.8871]}, {"w": "both", "b": [0.7034, 0.8674, 0.7483, 0.8871]}, {"w": "ways,", "b": [0.7546, 0.8674, 0.8127, 0.8871]}, {"w": "a", "b": [0.819, 0.8674, 0.8302, 0.8871]}]}]}, {"page": 289, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "bidirectional RNN can catch patterns that may be overlooked by a unidirectional RNN.", "words": [{"w": "bidirectional", "b": [0.1294, 0.0857, 0.2569, 0.1054]}, {"w": "RNN", "b": [0.2632, 0.0857, 0.3165, 0.1054]}, {"w": "can", "b": [0.3228, 0.0857, 0.3578, 0.1054]}, {"w": "catch", "b": [0.3641, 0.0857, 0.4173, 0.1054]}, {"w": "patterns", "b": [0.4236, 0.0857, 0.5035, 0.1054]}, {"w": "that", "b": [0.5098, 0.0857, 0.5477, 0.1054]}, {"w": "may", "b": [0.554, 0.0857, 0.5974, 0.1054]}, {"w": "be", "b": [0.6036, 0.0857, 0.6274, 0.1054]}, {"w": "overlooked", "b": [0.6337, 0.0857, 0.7472, 0.1054]}, {"w": "by", "b": [0.7535, 0.0857, 0.7788, 0.1054]}, {"w": "a", "b": [0.7851, 0.0857, 0.7963, 0.1054]}, {"w": "unidirectional", "b": [0.1294, 0.1062, 0.2695, 0.1259]}, {"w": "RNN.", "b": [0.2758, 0.1062, 0.3354, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Remarkably, the fact that the RNN layers in this section have processed sequences in chronological order (older timesteps first) may have been an arbitrary decision. At least, it’s a decision we made no attempt to question so far. Could the RNNs have performed well enough if they processed input sequences in antichronological order, for instance (newer timesteps first)? Let’s try this in practice and see what happens. All you need to do is write a variant of the data generator where the input sequences are reverted along the time dimension (replace the last line with yield samples[:, ::-1, :], targets). Training the same one-GRU-layer network that you used in the first experiment in this section, you get the results shown in figure 6.24.", "words": [{"w": "Remarkably,", "b": [0.1294, 0.149, 0.2574, 0.1687]}, {"w": "the", "b": [0.2637, 0.149, 0.2945, 0.1687]}, {"w": "fact", "b": [0.3008, 0.149, 0.3386, 0.1687]}, {"w": "that", "b": [0.3449, 0.149, 0.3828, 0.1687]}, {"w": "the", "b": [0.3891, 0.149, 0.4199, 0.1687]}, {"w": "RNN", "b": [0.4262, 0.149, 0.4795, 0.1687]}, {"w": "layers", "b": [0.4858, 0.149, 0.546, 0.1687]}, {"w": "in", "b": [0.5523, 0.149, 0.5719, 0.1687]}, {"w": "this", "b": [0.5782, 0.149, 0.6147, 0.1687]}, {"w": "section", "b": [0.621, 0.149, 0.6925, 0.1687]}, {"w": "have", "b": [0.6988, 0.149, 0.7464, 0.1687]}, {"w": "processed", "b": [0.7527, 0.149, 0.8522, 0.1687]}, {"w": "sequences", "b": [0.1294, 0.1695, 0.2317, 0.1892]}, {"w": "in", "b": [0.238, 0.1695, 0.2576, 0.1892]}, {"w": "chronological", "b": [0.2639, 0.1695, 0.4026, 0.1892]}, {"w": "order", "b": [0.4089, 0.1695, 0.4622, 0.1892]}, {"w": "(older", "b": [0.4685, 0.1695, 0.5287, 0.1892]}, {"w": "timesteps", "b": [0.535, 0.1695, 0.6303, 0.1892]}, {"w": "first)", "b": [0.6365, 0.1695, 0.6856, 0.1892]}, {"w": "may", "b": [0.6919, 0.1695, 0.7353, 0.1892]}, {"w": "have", "b": [0.7416, 0.1695, 0.7893, 0.1892]}, {"w": "been", "b": [0.7956, 0.1695, 0.8432, 0.1892]}, {"w": "an", "b": [0.1294, 0.19, 0.1532, 0.2097]}, {"w": "arbitrary", "b": [0.1595, 0.19, 0.2464, 0.2097]}, {"w": "decision.", "b": [0.2527, 0.19, 0.3431, 0.2097]}, {"w": "At", "b": [0.3494, 0.19, 0.3746, 0.2097]}, {"w": "least,", "b": [0.3809, 0.19, 0.4335, 0.2097]}, {"w": "it’s", "b": [0.4398, 0.19, 0.4706, 0.2097]}, {"w": "a", "b": [0.4769, 0.19, 0.4881, 0.2097]}, {"w": "decision", "b": [0.4944, 0.19, 0.5784, 0.2097]}, {"w": "we", "b": [0.5848, 0.19, 0.6142, 0.2097]}, {"w": "made", "b": [0.6205, 0.19, 0.6751, 0.2097]}, {"w": "no", "b": [0.6814, 0.19, 0.7066, 0.2097]}, {"w": "attempt", "b": [0.713, 0.19, 0.7886, 0.2097]}, {"w": "to", "b": [0.7949, 0.19, 0.8146, 0.2097]}, {"w": "question", "b": [0.1294, 0.2105, 0.2149, 0.2302]}, {"w": "so", "b": [0.2212, 0.2105, 0.2436, 0.2302]}, {"w": "far.", "b": [0.2499, 0.2105, 0.2828, 0.2302]}, {"w": "Could", "b": [0.2892, 0.2105, 0.3508, 0.2302]}, {"w": "the", "b": [0.3571, 0.2105, 0.388, 0.2302]}, {"w": "RNNs", "b": [0.3943, 0.2105, 0.4573, 0.2302]}, {"w": "have", "b": [0.4636, 0.2105, 0.5113, 0.2302]}, {"w": "performed", "b": [0.5176, 0.2105, 0.6226, 0.2302]}, {"w": "well", "b": [0.6289, 0.2105, 0.6724, 0.2302]}, {"w": "enough", "b": [0.6787, 0.2105, 0.7529, 0.2302]}, {"w": "if", "b": [0.7593, 0.2105, 0.7747, 0.2302]}, {"w": "they", "b": [0.781, 0.2105, 0.8244, 0.2302]}, {"w": "processed", "b": [0.1294, 0.231, 0.2289, 0.2507]}, {"w": "input", "b": [0.2352, 0.231, 0.287, 0.2507]}, {"w": "sequences", "b": [0.2934, 0.231, 0.3956, 0.2507]}, {"w": "in", "b": [0.4019, 0.231, 0.4216, 0.2507]}, {"w": "antichronological", "b": [0.4279, 0.231, 0.6044, 0.2507]}, {"w": "order,", "b": [0.6107, 0.231, 0.6692, 0.2507]}, {"w": "for", "b": [0.6755, 0.231, 0.7049, 0.2507]}, {"w": "instance", "b": [0.7112, 0.231, 0.7939, 0.2507]}, {"w": "(newer", "b": [0.8002, 0.231, 0.8702, 0.2507]}, {"w": "timesteps", "b": [0.1294, 0.2515, 0.2247, 0.2712]}, {"w": "first)?", "b": [0.231, 0.2515, 0.2913, 0.2712]}, {"w": "Let’s", "b": [0.2975, 0.2515, 0.348, 0.2712]}, {"w": "try", "b": [0.3543, 0.2515, 0.3823, 0.2712]}, {"w": "this", "b": [0.3886, 0.2515, 0.4251, 0.2712]}, {"w": "in", "b": [0.4314, 0.2515, 0.451, 0.2712]}, {"w": "practice", "b": [0.4573, 0.2515, 0.5371, 0.2712]}, {"w": "and", "b": [0.5434, 0.2515, 0.5799, 0.2712]}, {"w": "see", "b": [0.5862, 0.2515, 0.6184, 0.2712]}, {"w": "what", "b": [0.6247, 0.2515, 0.6737, 0.2712]}, {"w": "happens.", "b": [0.68, 0.2515, 0.769, 0.2712]}, {"w": "All", "b": [0.7753, 0.2515, 0.8076, 0.2712]}, {"w": "you", "b": [0.8139, 0.2515, 0.8517, 0.2712]}, {"w": "need", "b": [0.1294, 0.272, 0.177, 0.2917]}, {"w": "to", "b": [0.1833, 0.272, 0.203, 0.2917]}, {"w": "do", "b": [0.2093, 0.272, 0.2345, 0.2917]}, {"w": "is", "b": [0.2408, 0.272, 0.2576, 0.2917]}, {"w": "write", "b": [0.2639, 0.272, 0.3158, 0.2917]}, {"w": "a", "b": [0.3221, 0.272, 0.3333, 0.2917]}, {"w": "variant", "b": [0.3396, 0.272, 0.4096, 0.2917]}, {"w": "of", "b": [0.416, 0.272, 0.437, 0.2917]}, {"w": "the", "b": [0.4433, 0.272, 0.4741, 0.2917]}, {"w": "data", "b": [0.4804, 0.272, 0.5224, 0.2917]}, {"w": "generator", "b": [0.5287, 0.272, 0.624, 0.2917]}, {"w": "where", "b": [0.6303, 0.272, 0.6919, 0.2917]}, {"w": "the", "b": [0.6982, 0.272, 0.7291, 0.2917]}, {"w": "input", "b": [0.7354, 0.272, 0.7872, 0.2917]}, {"w": "sequences", "b": [0.1294, 0.2925, 0.2317, 0.3122]}, {"w": "are", "b": [0.238, 0.2925, 0.2688, 0.3122]}, {"w": "reverted", "b": [0.2751, 0.2925, 0.3577, 0.3122]}, {"w": "along", "b": [0.364, 0.2925, 0.4201, 0.3122]}, {"w": "the", "b": [0.4264, 0.2925, 0.4572, 0.3122]}, {"w": "time", "b": [0.4635, 0.2925, 0.5084, 0.3122]}, {"w": "dimension", "b": [0.5147, 0.2925, 0.6198, 0.3122]}, {"w": "(replace", "b": [0.6261, 0.2925, 0.7073, 0.3122]}, {"w": "the", "b": [0.7136, 0.2925, 0.7445, 0.3122]}, {"w": "last", "b": [0.7508, 0.2925, 0.7858, 0.3122]}, {"w": "line", "b": [0.7921, 0.2925, 0.83, 0.3122]}, {"w": "with", "b": [0.1294, 0.313, 0.1743, 0.3327]}, {"w": "yield", "b": [0.1806, 0.314, 0.2562, 0.3342]}, {"w": "samples[:,", "b": [0.2714, 0.314, 0.4227, 0.3342]}, {"w": "::-1,", "b": [0.4379, 0.314, 0.5135, 0.3342]}, {"w": ":],", "b": [0.5287, 0.314, 0.5741, 0.3342]}, {"w": "targets).", "b": [0.5892, 0.313, 0.7099, 0.3342]}, {"w": "Training", "b": [0.7163, 0.313, 0.8022, 0.3327]}, {"w": "the", "b": [0.8085, 0.313, 0.8394, 0.3327]}, {"w": "same", "b": [0.1294, 0.3344, 0.1813, 0.3541]}, {"w": "one-GRU-layer", "b": [0.1876, 0.3344, 0.3366, 0.3556]}, {"w": "network", "b": [0.3429, 0.3344, 0.4256, 0.3541]}, {"w": "that", "b": [0.4319, 0.3344, 0.4697, 0.3541]}, {"w": "you", "b": [0.476, 0.3344, 0.5139, 0.3541]}, {"w": "used", "b": [0.5202, 0.3344, 0.5664, 0.3541]}, {"w": "in", "b": [0.5727, 0.3344, 0.5923, 0.3541]}, {"w": "the", "b": [0.5986, 0.3344, 0.6295, 0.3541]}, {"w": "first", "b": [0.6358, 0.3344, 0.6764, 0.3541]}, {"w": "experiment", "b": [0.6827, 0.3344, 0.7962, 0.3541]}, {"w": "in", "b": [0.8025, 0.3344, 0.8221, 0.3541]}, {"w": "this", "b": [0.8284, 0.3344, 0.8649, 0.3541]}, {"w": "section,", "b": [0.1294, 0.3557, 0.2072, 0.3755]}, {"w": "you", "b": [0.2135, 0.3557, 0.2513, 0.3755]}, {"w": "get", "b": [0.2576, 0.3557, 0.2885, 0.3755]}, {"w": "the", "b": [0.2948, 0.3557, 0.3256, 0.3755]}, {"w": "results", "b": [0.3319, 0.3557, 0.3978, 0.3755]}, {"w": "shown", "b": [0.4041, 0.3557, 0.4699, 0.3755]}, {"w": "in", "b": [0.4762, 0.3557, 0.4959, 0.3755]}, {"w": "figure", "b": [0.5021, 0.3557, 0.5624, 0.3755]}, {"w": "6.24.", "b": [0.5687, 0.3557, 0.6191, 0.3755]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.24. Training and validation loss on the Jena temperature-forecasting task with a GRU trained on reversed sequences", "words": [{"w": "Figure", "b": [0.1294, 0.398, 0.1827, 0.4129]}, {"w": "6.24.", "b": [0.1874, 0.398, 0.2252, 0.4129]}, {"w": "Training", "b": [0.2299, 0.398, 0.3, 0.4129]}, {"w": "and", "b": [0.3048, 0.398, 0.3353, 0.4129]}, {"w": "validation", "b": [0.34, 0.398, 0.4209, 0.4129]}, {"w": "loss", "b": [0.4257, 0.398, 0.4551, 0.4129]}, {"w": "on", "b": [0.4598, 0.398, 0.4798, 0.4129]}, {"w": "the", "b": [0.4846, 0.398, 0.5098, 0.4129]}, {"w": "Jena", "b": [0.5145, 0.398, 0.5523, 0.4129]}, {"w": "temperature-forecasting", "b": [0.5571, 0.398, 0.7529, 0.4129]}, {"w": "task", "b": [0.7576, 0.398, 0.7912, 0.4129]}, {"w": "with", "b": [0.796, 0.398, 0.8317, 0.4129]}, {"w": "a", "b": [0.8364, 0.398, 0.8459, 0.4129]}, {"w": "GRU", "b": [0.1294, 0.4132, 0.1715, 0.428]}, {"w": "trained", "b": [0.1762, 0.4132, 0.235, 0.428]}, {"w": "on", "b": [0.2398, 0.4132, 0.2597, 0.428]}, {"w": "reversed", "b": [0.2645, 0.4132, 0.3335, 0.428]}, {"w": "sequences", "b": [0.3382, 0.4132, 0.4181, 0.428]}]}, {"id": "b_3", "type": "paragraph", "text": "The reversed-order GRU strongly underperforms even the common- sense baseline, indicating that in this case, chronological processing is important to the success of your approach. This makes perfect sense: the underlying GRU layer will typically be better at remembering the recent past than the distant past, and naturally the more recent weather data points are more predictive than older data points for the problem (that’s what makes the common-sense baseline fairly strong). Thus the chronological version of the layer is bound to outperform the reversed- order version. Importantly, this isn’t true for many other problems,", "words": [{"w": "The", "b": [0.1294, 0.7185, 0.1686, 0.7383]}, {"w": "reversed-order", "b": [0.1749, 0.7185, 0.322, 0.7383]}, {"w": "GRU", "b": [0.3283, 0.7185, 0.3816, 0.7383]}, {"w": "strongly", "b": [0.3879, 0.7185, 0.4706, 0.7383]}, {"w": "underperforms", "b": [0.4769, 0.7185, 0.6254, 0.7383]}, {"w": "even", "b": [0.6317, 0.7185, 0.6793, 0.7383]}, {"w": "the", "b": [0.6856, 0.7185, 0.7164, 0.7383]}, {"w": "common-", "b": [0.7227, 0.7185, 0.8194, 0.7383]}, {"w": "sense", "b": [0.1294, 0.739, 0.1841, 0.7588]}, {"w": "baseline,", "b": [0.1904, 0.739, 0.2793, 0.7588]}, {"w": "indicating", "b": [0.2856, 0.739, 0.3865, 0.7588]}, {"w": "that", "b": [0.3928, 0.739, 0.4307, 0.7588]}, {"w": "in", "b": [0.437, 0.739, 0.4566, 0.7588]}, {"w": "this", "b": [0.4629, 0.739, 0.4994, 0.7588]}, {"w": "case,", "b": [0.5057, 0.739, 0.5554, 0.7588]}, {"w": "chronological", "b": [0.5617, 0.739, 0.7004, 0.7588]}, {"w": "processing", "b": [0.7066, 0.739, 0.8145, 0.7588]}, {"w": "is", "b": [0.8208, 0.739, 0.8377, 0.7588]}, {"w": "important", "b": [0.1294, 0.7595, 0.2275, 0.7793]}, {"w": "to", "b": [0.2338, 0.7595, 0.2534, 0.7793]}, {"w": "the", "b": [0.2598, 0.7595, 0.2906, 0.7793]}, {"w": "success", "b": [0.2969, 0.7595, 0.3725, 0.7793]}, {"w": "of", "b": [0.3788, 0.7595, 0.3999, 0.7793]}, {"w": "your", "b": [0.4062, 0.7595, 0.4524, 0.7793]}, {"w": "approach.", "b": [0.4587, 0.7595, 0.5575, 0.7793]}, {"w": "This", "b": [0.5638, 0.7595, 0.6086, 0.7793]}, {"w": "makes", "b": [0.6149, 0.7595, 0.6794, 0.7793]}, {"w": "perfect", "b": [0.6857, 0.7595, 0.7557, 0.7793]}, {"w": "sense:", "b": [0.762, 0.7595, 0.8237, 0.7793]}, {"w": "the", "b": [0.83, 0.7595, 0.8608, 0.7793]}, {"w": "underlying", "b": [0.1294, 0.78, 0.2387, 0.7998]}, {"w": "GRU", "b": [0.245, 0.7811, 0.2904, 0.8013]}, {"w": "layer", "b": [0.2967, 0.78, 0.3471, 0.7998]}, {"w": "will", "b": [0.3534, 0.78, 0.3927, 0.7998]}, {"w": "typically", "b": [0.399, 0.78, 0.4873, 0.7998]}, {"w": "be", "b": [0.4936, 0.78, 0.5174, 0.7998]}, {"w": "better", "b": [0.5237, 0.78, 0.5812, 0.7998]}, {"w": "at", "b": [0.5875, 0.78, 0.6057, 0.7998]}, {"w": "remembering", "b": [0.612, 0.78, 0.7465, 0.7998]}, {"w": "the", "b": [0.7528, 0.78, 0.7836, 0.7998]}, {"w": "recent", "b": [0.7899, 0.78, 0.8516, 0.7998]}, {"w": "past", "b": [0.1294, 0.8014, 0.1701, 0.8211]}, {"w": "than", "b": [0.1764, 0.8014, 0.2198, 0.8211]}, {"w": "the", "b": [0.2261, 0.8014, 0.2569, 0.8211]}, {"w": "distant", "b": [0.2632, 0.8014, 0.3305, 0.8211]}, {"w": "past,", "b": [0.3368, 0.8014, 0.3838, 0.8211]}, {"w": "and", "b": [0.3901, 0.8014, 0.4265, 0.8211]}, {"w": "naturally", "b": [0.4328, 0.8014, 0.5225, 0.8211]}, {"w": "the", "b": [0.5288, 0.8014, 0.5596, 0.8211]}, {"w": "more", "b": [0.5659, 0.8014, 0.6178, 0.8211]}, {"w": "recent", "b": [0.6241, 0.8014, 0.6857, 0.8211]}, {"w": "weather", "b": [0.692, 0.8014, 0.7718, 0.8211]}, {"w": "data", "b": [0.778, 0.8014, 0.8201, 0.8211]}, {"w": "points", "b": [0.1294, 0.8219, 0.1911, 0.8416]}, {"w": "are", "b": [0.1974, 0.8219, 0.2282, 0.8416]}, {"w": "more", "b": [0.2345, 0.8219, 0.2863, 0.8416]}, {"w": "predictive", "b": [0.2926, 0.8219, 0.3935, 0.8416]}, {"w": "than", "b": [0.3998, 0.8219, 0.4433, 0.8416]}, {"w": "older", "b": [0.4496, 0.8219, 0.5014, 0.8416]}, {"w": "data", "b": [0.5077, 0.8219, 0.5497, 0.8416]}, {"w": "points", "b": [0.5561, 0.8219, 0.6177, 0.8416]}, {"w": "for", "b": [0.624, 0.8219, 0.6535, 0.8416]}, {"w": "the", "b": [0.6598, 0.8219, 0.6906, 0.8416]}, {"w": "problem", "b": [0.6969, 0.8219, 0.781, 0.8416]}, {"w": "(that’s", "b": [0.7873, 0.8219, 0.8502, 0.8416]}, {"w": "what", "b": [0.1294, 0.8424, 0.1785, 0.8621]}, {"w": "makes", "b": [0.1848, 0.8424, 0.2492, 0.8621]}, {"w": "the", "b": [0.2555, 0.8424, 0.2863, 0.8621]}, {"w": "common-sense", "b": [0.2926, 0.8424, 0.444, 0.8621]}, {"w": "baseline", "b": [0.4503, 0.8424, 0.5329, 0.8621]}, {"w": "fairly", "b": [0.5393, 0.8424, 0.5939, 0.8621]}, {"w": "strong).", "b": [0.6001, 0.8424, 0.6779, 0.8621]}, {"w": "Thus", "b": [0.6842, 0.8424, 0.7347, 0.8621]}, {"w": "the", "b": [0.741, 0.8424, 0.7718, 0.8621]}, {"w": "chronological", "b": [0.1294, 0.8629, 0.2681, 0.8826]}, {"w": "version", "b": [0.2744, 0.8629, 0.3487, 0.8826]}, {"w": "of", "b": [0.355, 0.8629, 0.376, 0.8826]}, {"w": "the", "b": [0.3823, 0.8629, 0.4132, 0.8826]}, {"w": "layer", "b": [0.4195, 0.8629, 0.4699, 0.8826]}, {"w": "is", "b": [0.4762, 0.8629, 0.493, 0.8826]}, {"w": "bound", "b": [0.4993, 0.8629, 0.5624, 0.8826]}, {"w": "to", "b": [0.5687, 0.8629, 0.5883, 0.8826]}, {"w": "outperform", "b": [0.5946, 0.8629, 0.7081, 0.8826]}, {"w": "the", "b": [0.7144, 0.8629, 0.7452, 0.8826]}, {"w": "reversed-", "b": [0.7516, 0.8629, 0.8454, 0.8826]}, {"w": "order", "b": [0.1294, 0.8834, 0.1826, 0.9031]}, {"w": "version.", "b": [0.1889, 0.8834, 0.2695, 0.9031]}, {"w": "Importantly,", "b": [0.2758, 0.8834, 0.3996, 0.9031]}, {"w": "this", "b": [0.4059, 0.8834, 0.4423, 0.9031]}, {"w": "isn’t", "b": [0.4486, 0.8834, 0.493, 0.9031]}, {"w": "true", "b": [0.4993, 0.8834, 0.5386, 0.9031]}, {"w": "for", "b": [0.5449, 0.8834, 0.5743, 0.9031]}, {"w": "many", "b": [0.5806, 0.8834, 0.6366, 0.9031]}, {"w": "other", "b": [0.6429, 0.8834, 0.6948, 0.9031]}, {"w": "problems,", "b": [0.7011, 0.8834, 0.8013, 0.9031]}]}]}, {"page": 290, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "including natural language: intuitively, the importance of a word in understanding a sentence isn’t usually dependent on its position in the sentence. Let’s try the same trick on the LSTM IMDB example from section 6.2.", "words": [{"w": "including", "b": [0.1294, 0.0857, 0.2247, 0.1054]}, {"w": "natural", "b": [0.231, 0.0857, 0.3011, 0.1054]}, {"w": "language:", "b": [0.3074, 0.0857, 0.4055, 0.1054]}, {"w": "intuitively,", "b": [0.4118, 0.0857, 0.5201, 0.1054]}, {"w": "the", "b": [0.5264, 0.0857, 0.5572, 0.1054]}, {"w": "importance", "b": [0.5635, 0.0857, 0.677, 0.1054]}, {"w": "of", "b": [0.6833, 0.0857, 0.7043, 0.1054]}, {"w": "a", "b": [0.7106, 0.0857, 0.7218, 0.1054]}, {"w": "word", "b": [0.7281, 0.0857, 0.78, 0.1054]}, {"w": "in", "b": [0.7863, 0.0857, 0.8059, 0.1054]}, {"w": "understanding", "b": [0.1294, 0.1062, 0.2723, 0.1259]}, {"w": "a", "b": [0.2786, 0.1062, 0.2898, 0.1259]}, {"w": "sentence", "b": [0.2962, 0.1062, 0.383, 0.1259]}, {"w": "isn’t", "b": [0.3893, 0.1062, 0.4337, 0.1259]}, {"w": "usually", "b": [0.44, 0.1062, 0.5129, 0.1259]}, {"w": "dependent", "b": [0.5192, 0.1062, 0.6228, 0.1259]}, {"w": "on", "b": [0.6291, 0.1062, 0.6544, 0.1259]}, {"w": "its", "b": [0.6607, 0.1062, 0.6845, 0.1259]}, {"w": "position", "b": [0.6908, 0.1062, 0.7721, 0.1259]}, {"w": "in", "b": [0.7784, 0.1062, 0.7981, 0.1259]}, {"w": "the", "b": [0.8044, 0.1062, 0.8352, 0.1259]}, {"w": "sentence.", "b": [0.1294, 0.1267, 0.2226, 0.1464]}, {"w": "Let’s", "b": [0.2289, 0.1267, 0.2793, 0.1464]}, {"w": "try", "b": [0.2856, 0.1267, 0.3136, 0.1464]}, {"w": "the", "b": [0.3199, 0.1267, 0.3508, 0.1464]}, {"w": "same", "b": [0.3571, 0.1267, 0.4089, 0.1464]}, {"w": "trick", "b": [0.4152, 0.1267, 0.4615, 0.1464]}, {"w": "on", "b": [0.4678, 0.1267, 0.493, 0.1464]}, {"w": "the", "b": [0.4993, 0.1267, 0.5301, 0.1464]}, {"w": "LSTM", "b": [0.5364, 0.1267, 0.6037, 0.1464]}, {"w": "IMDB", "b": [0.61, 0.1267, 0.6759, 0.1464]}, {"w": "example", "b": [0.6822, 0.1267, 0.7676, 0.1464]}, {"w": "from", "b": [0.7739, 0.1267, 0.823, 0.1464]}, {"w": "section", "b": [0.1294, 0.1472, 0.2009, 0.1669]}, {"w": "6.2.", "b": [0.2072, 0.1472, 0.245, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 6.42. Training and evaluating an LSTM using reversed sequences", "words": [{"w": "Listing", "b": [0.1294, 0.185, 0.1862, 0.1998]}, {"w": "6.42.", "b": [0.1909, 0.185, 0.2288, 0.1998]}, {"w": "Training", "b": [0.2335, 0.185, 0.3036, 0.1998]}, {"w": "and", "b": [0.3083, 0.185, 0.3388, 0.1998]}, {"w": "evaluating", "b": [0.3435, 0.185, 0.4276, 0.1998]}, {"w": "an", "b": [0.4323, 0.185, 0.4523, 0.1998]}, {"w": "LSTM", "b": [0.4571, 0.1858, 0.5025, 0.2009]}, {"w": "using", "b": [0.5072, 0.185, 0.5503, 0.1998]}, {"w": "reversed", "b": [0.555, 0.185, 0.624, 0.1998]}, {"w": "sequences", "b": [0.6288, 0.185, 0.7086, 0.1998]}]}, {"id": "b_2", "type": "paragraph", "text": "from keras.datasets import imdb from keras.preprocessing import sequence from keras import layers from keras.models import Sequential max_features = 10000 1 maxlen = 500 2 (x_train, y_train), (x_test, y_test) = imdb.load_data( num_words=max_features) 3 x_train = [x[::-1] for x in x_train] 4 x_test = [x[::-1] for x in x_test] 4 x_train = sequence.pad_sequences(x_train, maxlen=maxlen) 5 x_test = sequence.pad_sequences(x_test, maxlen=maxlen) 5 model = Sequential() model.add(layers.Embedding(max_features, 128)) model.add(layers.LSTM(32)) model.add(layers.Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(x_train, y_train, epochs=10, batch_size=128, validation_split=0.2)", "words": [{"w": "from", "b": [0.1357, 0.2143, 0.1811, 0.2295]}, {"w": "keras.datasets", "b": [0.1925, 0.2143, 0.3514, 0.2295]}, {"w": "import", "b": [0.3628, 0.2143, 0.4309, 0.2295]}, {"w": "imdb", "b": [0.4422, 0.2143, 0.4876, 0.2295]}, {"w": "from", "b": [0.1357, 0.2295, 0.1811, 0.2446]}, {"w": "keras.preprocessing", "b": [0.1925, 0.2295, 0.4082, 0.2446]}, {"w": "import", "b": [0.4195, 0.2295, 0.4876, 0.2446]}, {"w": "sequence", "b": [0.499, 0.2295, 0.5898, 0.2446]}, {"w": "from", "b": [0.1357, 0.2446, 0.1811, 0.2598]}, {"w": "keras", "b": [0.1925, 0.2446, 0.2492, 0.2598]}, {"w": "import", "b": [0.2606, 0.2446, 0.3287, 0.2598]}, {"w": "layers", "b": [0.34, 0.2446, 0.4082, 0.2598]}, {"w": "from", "b": [0.1357, 0.2598, 0.1811, 0.2749]}, {"w": "keras.models", "b": [0.1925, 0.2598, 0.3287, 0.2749]}, {"w": "import", "b": [0.34, 0.2598, 0.4082, 0.2749]}, {"w": "Sequential", "b": [0.4195, 0.2598, 0.533, 0.2749]}, {"w": "max_features", "b": [0.1357, 0.2901, 0.2719, 0.3052]}, {"w": "=", "b": [0.2833, 0.2901, 0.2946, 0.3052]}, {"w": "10000", "b": [0.306, 0.2901, 0.3628, 0.3052]}, {"w": "1", "b": [0.1357, 0.3052, 0.1471, 0.3204]}, {"w": "maxlen", "b": [0.1357, 0.3204, 0.2038, 0.3355]}, {"w": "=", "b": [0.2152, 0.3204, 0.2265, 0.3355]}, {"w": "500", "b": [0.2379, 0.3204, 0.2719, 0.3355]}, {"w": "2", "b": [0.1357, 0.3355, 0.1471, 0.3507]}, {"w": "(x_train,", "b": [0.1357, 0.3658, 0.2379, 0.381]}, {"w": "y_train),", "b": [0.2492, 0.3658, 0.3514, 0.381]}, {"w": "(x_test,", "b": [0.3628, 0.3658, 0.4536, 0.381]}, {"w": "y_test)", "b": [0.4649, 0.3658, 0.5444, 0.381]}, {"w": "=", "b": [0.5557, 0.3658, 0.5671, 0.381]}, {"w": "imdb.load_data(", "b": [0.5784, 0.3658, 0.7487, 0.381]}, {"w": "num_words=max_features)", "b": [0.1811, 0.381, 0.4422, 0.3961]}, {"w": "3", "b": [0.1357, 0.3962, 0.1471, 0.4113]}, {"w": "x_train", "b": [0.1357, 0.4265, 0.2152, 0.4416]}, {"w": "=", "b": [0.2265, 0.4265, 0.2379, 0.4416]}, {"w": "[x[::-1]", "b": [0.2492, 0.4265, 0.34, 0.4416]}, {"w": "for", "b": [0.3514, 0.4265, 0.3855, 0.4416]}, {"w": "x", "b": [0.3968, 0.4265, 0.4082, 0.4416]}, {"w": "in", "b": [0.4195, 0.4265, 0.4422, 0.4416]}, {"w": "x_train]", "b": [0.4536, 0.4265, 0.5444, 0.4416]}, {"w": "4", "b": [0.1357, 0.4416, 0.1471, 0.4568]}, {"w": "x_test", "b": [0.1357, 0.4568, 0.2038, 0.4719]}, {"w": "=", "b": [0.2152, 0.4568, 0.2265, 0.4719]}, {"w": "[x[::-1]", "b": [0.2379, 0.4568, 0.3287, 0.4719]}, {"w": "for", "b": [0.34, 0.4568, 0.3741, 0.4719]}, {"w": "x", "b": [0.3855, 0.4568, 0.3968, 0.4719]}, {"w": "in", "b": [0.4082, 0.4568, 0.4309, 0.4719]}, {"w": "x_test]", "b": [0.4422, 0.4568, 0.5217, 0.4719]}, {"w": "4", "b": [0.1357, 0.4719, 0.1471, 0.4871]}, {"w": "x_train", "b": [0.1357, 0.5022, 0.2152, 0.5174]}, {"w": "=", "b": [0.2265, 0.5022, 0.2379, 0.5174]}, {"w": "sequence.pad_sequences(x_train,", "b": [0.2492, 0.5022, 0.6011, 0.5174]}, {"w": "maxlen=maxlen)", "b": [0.6125, 0.5022, 0.7714, 0.5174]}, {"w": "5", "b": [0.1357, 0.5174, 0.1471, 0.5325]}, {"w": "x_test", "b": [0.1357, 0.5325, 0.2038, 0.5477]}, {"w": "=", "b": [0.2152, 0.5325, 0.2265, 0.5477]}, {"w": "sequence.pad_sequences(x_test,", "b": [0.2379, 0.5325, 0.5784, 0.5477]}, {"w": "maxlen=maxlen)", "b": [0.5898, 0.5325, 0.7487, 0.5477]}, {"w": "5", "b": [0.1357, 0.5477, 0.1471, 0.5628]}, {"w": "model", "b": [0.1357, 0.578, 0.1925, 0.5931]}, {"w": "=", "b": [0.2038, 0.578, 0.2152, 0.5931]}, {"w": "Sequential()", "b": [0.2265, 0.578, 0.3628, 0.5931]}, {"w": "model.add(layers.Embedding(max_features,", "b": [0.1357, 0.5931, 0.5898, 0.6083]}, {"w": "128))", "b": [0.6011, 0.5931, 0.6579, 0.6083]}, {"w": "model.add(layers.LSTM(32))", "b": [0.1357, 0.6083, 0.4309, 0.6234]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.6234, 0.4195, 0.6386]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.6234, 0.6806, 0.6386]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.6537, 0.5217, 0.6689]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.6689, 0.6011, 0.684]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.684, 0.4763, 0.6992]}, {"w": "history", "b": [0.1357, 0.6992, 0.2152, 0.7143]}, {"w": "=", "b": [0.2265, 0.6992, 0.2379, 0.7143]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.6992, 0.4536, 0.7143]}, {"w": "y_train,", "b": [0.4649, 0.6992, 0.5557, 0.7143]}, {"w": "epochs=10,", "b": [0.3628, 0.7144, 0.4763, 0.7295]}, {"w": "batch_size=128,", "b": [0.3628, 0.7295, 0.533, 0.7446]}, {"w": "validation_split=0.2)", "b": [0.3628, 0.7447, 0.6011, 0.7598]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Number of words to consider as features 2 Cuts off texts after this number of words (among the max_features most common words) 3 Loads data 4 Reverses sequences 5 Pads sequences", "words": [{"w": "1", "b": [0.1799, 0.7782, 0.1925, 0.798]}, {"w": "Number", "b": [0.1988, 0.7782, 0.2885, 0.798]}, {"w": "of", "b": [0.2948, 0.7782, 0.3158, 0.798]}, {"w": "words", "b": [0.3221, 0.7782, 0.388, 0.798]}, {"w": "to", "b": [0.3943, 0.7782, 0.4153, 0.798]}, {"w": "consider", "b": [0.4216, 0.7782, 0.5127, 0.798]}, {"w": "as", "b": [0.519, 0.7782, 0.5414, 0.798]}, {"w": "features", "b": [0.5477, 0.7782, 0.6341, 0.798]}, {"w": "2", "b": [0.1799, 0.7987, 0.1925, 0.8185]}, {"w": "Cuts", "b": [0.1988, 0.7987, 0.2492, 0.8185]}, {"w": "off", "b": [0.2555, 0.7987, 0.285, 0.8185]}, {"w": "texts", "b": [0.2913, 0.7987, 0.3417, 0.8185]}, {"w": "after", "b": [0.348, 0.7987, 0.3998, 0.8185]}, {"w": "this", "b": [0.4061, 0.7987, 0.4454, 0.8185]}, {"w": "number", "b": [0.4517, 0.7987, 0.5372, 0.8185]}, {"w": "of", "b": [0.5435, 0.7987, 0.5645, 0.8185]}, {"w": "words", "b": [0.5708, 0.7987, 0.6367, 0.8185]}, {"w": "(among", "b": [0.643, 0.7987, 0.7242, 0.8185]}, {"w": "the", "b": [0.7305, 0.7987, 0.7642, 0.8185]}, {"w": "max_features", "b": [0.1799, 0.8192, 0.3251, 0.839]}, {"w": "most", "b": [0.3314, 0.8192, 0.3833, 0.839]}, {"w": "common", "b": [0.3896, 0.8192, 0.482, 0.839]}, {"w": "words)", "b": [0.4883, 0.8192, 0.5626, 0.839]}, {"w": "3", "b": [0.1799, 0.8397, 0.1925, 0.8595]}, {"w": "Loads", "b": [0.1988, 0.8397, 0.2647, 0.8595]}, {"w": "data", "b": [0.271, 0.8397, 0.3186, 0.8595]}, {"w": "4", "b": [0.1799, 0.8602, 0.1925, 0.88]}, {"w": "Reverses", "b": [0.1988, 0.8602, 0.294, 0.88]}, {"w": "sequences", "b": [0.3003, 0.8602, 0.4068, 0.88]}, {"w": "5", "b": [0.1799, 0.8807, 0.1925, 0.9005]}, {"w": "Pads", "b": [0.1988, 0.8807, 0.2506, 0.9005]}, {"w": "sequences", "b": [0.257, 0.8807, 0.3635, 0.9005]}]}]}, {"page": 291, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You get performance nearly identical to that of the chronological-order LSTM. Remarkably, on such a text dataset, reversed-order processing works just as well as chronological processing, confirming the hypothesis that, although word order does matter in understanding language, which order you use isn’t crucial. Importantly, an RNN trained on reversed sequences will learn different representations than one trained on the original sequences, much as you would have different mental models if time flowed backward in the real world—if you lived a life where you died on your first day and were born on your last day. In machine learning, representations that are different yet useful are always worth exploiting, and the more they differ, the better: they offer a new angle from which to look at your data, capturing aspects of the data that were missed by other approaches, and thus they can help boost performance on a task. This is the intuition behind ensembling, a concept we’ll explore in chapter 7.", "words": [{"w": "You", "b": [0.1294, 0.0857, 0.1703, 0.1054]}, {"w": "get", "b": [0.1766, 0.0857, 0.2075, 0.1054]}, {"w": "performance", "b": [0.2138, 0.0857, 0.3412, 0.1054]}, {"w": "nearly", "b": [0.3475, 0.0857, 0.4106, 0.1054]}, {"w": "identical", "b": [0.4169, 0.0857, 0.5038, 0.1054]}, {"w": "to", "b": [0.5101, 0.0857, 0.5297, 0.1054]}, {"w": "that", "b": [0.536, 0.0857, 0.5738, 0.1054]}, {"w": "of", "b": [0.5801, 0.0857, 0.6012, 0.1054]}, {"w": "the", "b": [0.6075, 0.0857, 0.6383, 0.1054]}, {"w": "chronological-order", "b": [0.6446, 0.0857, 0.8449, 0.1054]}, {"w": "LSTM.", "b": [0.1294, 0.1062, 0.1963, 0.1274]}, {"w": "Remarkably,", "b": [0.2026, 0.1062, 0.3305, 0.1259]}, {"w": "on", "b": [0.3368, 0.1062, 0.3621, 0.1259]}, {"w": "such", "b": [0.3684, 0.1062, 0.4146, 0.1259]}, {"w": "a", "b": [0.4209, 0.1062, 0.4321, 0.1259]}, {"w": "text", "b": [0.4384, 0.1062, 0.4762, 0.1259]}, {"w": "dataset,", "b": [0.4826, 0.1062, 0.5589, 0.1259]}, {"w": "reversed-order", "b": [0.5652, 0.1062, 0.7123, 0.1259]}, {"w": "processing", "b": [0.7186, 0.1062, 0.8265, 0.1259]}, {"w": "works", "b": [0.1294, 0.1276, 0.1911, 0.1473]}, {"w": "just", "b": [0.1974, 0.1276, 0.2338, 0.1473]}, {"w": "as", "b": [0.2401, 0.1276, 0.2611, 0.1473]}, {"w": "well", "b": [0.2674, 0.1276, 0.3109, 0.1473]}, {"w": "as", "b": [0.3172, 0.1276, 0.3382, 0.1473]}, {"w": "chronological", "b": [0.3445, 0.1276, 0.4832, 0.1473]}, {"w": "processing,", "b": [0.4895, 0.1276, 0.6037, 0.1473]}, {"w": "confirming", "b": [0.61, 0.1276, 0.7221, 0.1473]}, {"w": "the", "b": [0.7284, 0.1276, 0.7592, 0.1473]}, {"w": "hypothesis", "b": [0.1294, 0.1481, 0.2373, 0.1678]}, {"w": "that,", "b": [0.2436, 0.1481, 0.2878, 0.1678]}, {"w": "although", "b": [0.2941, 0.1481, 0.3824, 0.1678]}, {"w": "word", "b": [0.3887, 0.1481, 0.4405, 0.1678]}, {"w": "order", "b": [0.4468, 0.1481, 0.5001, 0.1678]}, {"w": "does", "b": [0.5063, 0.1481, 0.5526, 0.1678]}, {"w": "matter", "b": [0.5589, 0.1481, 0.6233, 0.1678]}, {"w": "in", "b": [0.6296, 0.1481, 0.6492, 0.1678]}, {"w": "understanding", "b": [0.6556, 0.1481, 0.7985, 0.1678]}, {"w": "language,", "b": [0.1294, 0.1686, 0.2268, 0.1883]}, {"w": "which", "b": [0.2331, 0.1686, 0.2933, 0.1883]}, {"w": "order", "b": [0.2996, 0.1686, 0.3529, 0.1883]}, {"w": "you", "b": [0.3592, 0.1686, 0.397, 0.1883]}, {"w": "use", "b": [0.4033, 0.1686, 0.4369, 0.1883]}, {"w": "isn’t", "b": [0.4432, 0.1686, 0.4876, 0.1883]}, {"w": "crucial.", "b": [0.4939, 0.1686, 0.5689, 0.1883]}, {"w": "Importantly,", "b": [0.5752, 0.1686, 0.6989, 0.1883]}, {"w": "an", "b": [0.7052, 0.1686, 0.729, 0.1883]}, {"w": "RNN", "b": [0.7354, 0.1686, 0.7886, 0.1883]}, {"w": "trained", "b": [0.7949, 0.1686, 0.865, 0.1883]}, {"w": "on", "b": [0.1294, 0.1891, 0.1546, 0.2088]}, {"w": "reversed", "b": [0.1609, 0.1891, 0.2464, 0.2088]}, {"w": "sequences", "b": [0.2527, 0.1891, 0.355, 0.2088]}, {"w": "will", "b": [0.3613, 0.1891, 0.4005, 0.2088]}, {"w": "learn", "b": [0.4068, 0.1891, 0.4572, 0.2088]}, {"w": "different", "b": [0.4636, 0.1891, 0.5499, 0.2088]}, {"w": "representations", "b": [0.5562, 0.1891, 0.7089, 0.2088]}, {"w": "than", "b": [0.7152, 0.1891, 0.7587, 0.2088]}, {"w": "one", "b": [0.7649, 0.1891, 0.8014, 0.2088]}, {"w": "trained", "b": [0.1294, 0.2096, 0.1995, 0.2293]}, {"w": "on", "b": [0.2058, 0.2096, 0.231, 0.2293]}, {"w": "the", "b": [0.2373, 0.2096, 0.2681, 0.2293]}, {"w": "original", "b": [0.2744, 0.2096, 0.3529, 0.2293]}, {"w": "sequences,", "b": [0.3592, 0.2096, 0.4678, 0.2293]}, {"w": "much", "b": [0.4741, 0.2096, 0.5301, 0.2293]}, {"w": "as", "b": [0.5365, 0.2096, 0.5575, 0.2293]}, {"w": "you", "b": [0.5638, 0.2096, 0.6016, 0.2293]}, {"w": "would", "b": [0.6079, 0.2096, 0.671, 0.2293]}, {"w": "have", "b": [0.6773, 0.2096, 0.7249, 0.2293]}, {"w": "different", "b": [0.7312, 0.2096, 0.8176, 0.2293]}, {"w": "mental", "b": [0.1294, 0.2301, 0.1981, 0.2498]}, {"w": "models", "b": [0.2044, 0.2301, 0.2773, 0.2498]}, {"w": "if", "b": [0.2836, 0.2301, 0.299, 0.2498]}, {"w": "time", "b": [0.3053, 0.2301, 0.3501, 0.2498]}, {"w": "flowed", "b": [0.3564, 0.2301, 0.4265, 0.2498]}, {"w": "backward", "b": [0.4328, 0.2301, 0.5309, 0.2498]}, {"w": "in", "b": [0.5372, 0.2301, 0.5568, 0.2498]}, {"w": "the", "b": [0.5631, 0.2301, 0.5939, 0.2498]}, {"w": "real", "b": [0.6002, 0.2301, 0.638, 0.2498]}, {"w": "world—if", "b": [0.6443, 0.2301, 0.7437, 0.2498]}, {"w": "you", "b": [0.7501, 0.2301, 0.7879, 0.2498]}, {"w": "lived", "b": [0.7942, 0.2301, 0.8446, 0.2498]}, {"w": "a", "b": [0.851, 0.2301, 0.8622, 0.2498]}, {"w": "life", "b": [0.1294, 0.2506, 0.163, 0.2703]}, {"w": "where", "b": [0.1693, 0.2506, 0.231, 0.2703]}, {"w": "you", "b": [0.2373, 0.2506, 0.2751, 0.2703]}, {"w": "died", "b": [0.2814, 0.2506, 0.3249, 0.2703]}, {"w": "on", "b": [0.3312, 0.2506, 0.3564, 0.2703]}, {"w": "your", "b": [0.3627, 0.2506, 0.4089, 0.2703]}, {"w": "first", "b": [0.4152, 0.2506, 0.4559, 0.2703]}, {"w": "day", "b": [0.4622, 0.2506, 0.4986, 0.2703]}, {"w": "and", "b": [0.5049, 0.2506, 0.5413, 0.2703]}, {"w": "were", "b": [0.5477, 0.2506, 0.5967, 0.2703]}, {"w": "born", "b": [0.603, 0.2506, 0.6492, 0.2703]}, {"w": "on", "b": [0.6555, 0.2506, 0.6807, 0.2703]}, {"w": "your", "b": [0.6871, 0.2506, 0.7333, 0.2703]}, {"w": "last", "b": [0.7396, 0.2506, 0.7746, 0.2703]}, {"w": "day.", "b": [0.7809, 0.2506, 0.822, 0.2703]}, {"w": "In", "b": [0.8283, 0.2506, 0.8493, 0.2703]}, {"w": "machine", "b": [0.1294, 0.2711, 0.2149, 0.2908]}, {"w": "learning,", "b": [0.2212, 0.2711, 0.3102, 0.2908]}, {"w": "representations", "b": [0.3165, 0.2711, 0.4692, 0.2908]}, {"w": "that", "b": [0.4754, 0.2711, 0.5133, 0.2908]}, {"w": "are", "b": [0.5196, 0.2711, 0.5504, 0.2908]}, {"w": "different", "b": [0.5566, 0.2711, 0.6412, 0.2908]}, {"w": "yet", "b": [0.6475, 0.2711, 0.6783, 0.2908]}, {"w": "useful", "b": [0.6846, 0.2711, 0.7448, 0.2908]}, {"w": "are", "b": [0.7511, 0.2711, 0.7819, 0.2908]}, {"w": "always", "b": [0.7882, 0.2711, 0.8583, 0.2908]}, {"w": "worth", "b": [0.1294, 0.2916, 0.1883, 0.3113]}, {"w": "exploiting,", "b": [0.1946, 0.2916, 0.3032, 0.3113]}, {"w": "and", "b": [0.3095, 0.2916, 0.3459, 0.3113]}, {"w": "the", "b": [0.3522, 0.2916, 0.3831, 0.3113]}, {"w": "more", "b": [0.3894, 0.2916, 0.4412, 0.3113]}, {"w": "they", "b": [0.4475, 0.2916, 0.4909, 0.3113]}, {"w": "differ,", "b": [0.4973, 0.2916, 0.5581, 0.3113]}, {"w": "the", "b": [0.5644, 0.2916, 0.5952, 0.3113]}, {"w": "better:", "b": [0.6015, 0.2916, 0.666, 0.3113]}, {"w": "they", "b": [0.6723, 0.2916, 0.7157, 0.3113]}, {"w": "offer", "b": [0.722, 0.2916, 0.7705, 0.3113]}, {"w": "a", "b": [0.7768, 0.2916, 0.788, 0.3113]}, {"w": "new", "b": [0.7943, 0.2916, 0.8364, 0.3113]}, {"w": "angle", "b": [0.1294, 0.3121, 0.1841, 0.3318]}, {"w": "from", "b": [0.1904, 0.3121, 0.2394, 0.3318]}, {"w": "which", "b": [0.2457, 0.3121, 0.3074, 0.3318]}, {"w": "to", "b": [0.3137, 0.3121, 0.3333, 0.3318]}, {"w": "look", "b": [0.3396, 0.3121, 0.3844, 0.3318]}, {"w": "at", "b": [0.3908, 0.3121, 0.409, 0.3318]}, {"w": "your", "b": [0.4153, 0.3121, 0.4615, 0.3318]}, {"w": "data,", "b": [0.4678, 0.3121, 0.5161, 0.3318]}, {"w": "capturing", "b": [0.5224, 0.3121, 0.6177, 0.3318]}, {"w": "aspects", "b": [0.624, 0.3121, 0.6968, 0.3318]}, {"w": "of", "b": [0.7031, 0.3121, 0.7242, 0.3318]}, {"w": "the", "b": [0.7305, 0.3121, 0.7613, 0.3318]}, {"w": "data", "b": [0.7676, 0.3121, 0.8096, 0.3318]}, {"w": "that", "b": [0.8159, 0.3121, 0.8538, 0.3318]}, {"w": "were", "b": [0.1294, 0.3326, 0.1784, 0.3523]}, {"w": "missed", "b": [0.1847, 0.3326, 0.2548, 0.3523]}, {"w": "by", "b": [0.2611, 0.3326, 0.2863, 0.3523]}, {"w": "other", "b": [0.2926, 0.3326, 0.3445, 0.3523]}, {"w": "approaches,", "b": [0.3508, 0.3326, 0.4706, 0.3523]}, {"w": "and", "b": [0.4769, 0.3326, 0.5133, 0.3523]}, {"w": "thus", "b": [0.5196, 0.3326, 0.5617, 0.3523]}, {"w": "they", "b": [0.568, 0.3326, 0.6114, 0.3523]}, {"w": "can", "b": [0.6177, 0.3326, 0.6527, 0.3523]}, {"w": "help", "b": [0.659, 0.3326, 0.7025, 0.3523]}, {"w": "boost", "b": [0.7088, 0.3326, 0.7634, 0.3523]}, {"w": "performance", "b": [0.1294, 0.3531, 0.2569, 0.3728]}, {"w": "on", "b": [0.2632, 0.3531, 0.2884, 0.3728]}, {"w": "a", "b": [0.2947, 0.3531, 0.3059, 0.3728]}, {"w": "task.", "b": [0.3122, 0.3531, 0.3592, 0.3728]}, {"w": "This", "b": [0.3655, 0.3531, 0.4103, 0.3728]}, {"w": "is", "b": [0.4166, 0.3531, 0.4334, 0.3728]}, {"w": "the", "b": [0.4397, 0.3531, 0.4705, 0.3728]}, {"w": "intuition", "b": [0.4769, 0.3531, 0.5624, 0.3728]}, {"w": "behind", "b": [0.5687, 0.3531, 0.6373, 0.3728]}, {"w": "ensembling,", "b": [0.6436, 0.3531, 0.7648, 0.3728]}, {"w": "a", "b": [0.7711, 0.3531, 0.7823, 0.3728]}, {"w": "concept", "b": [0.7886, 0.3531, 0.8671, 0.3728]}, {"w": "we’ll", "b": [0.1294, 0.3736, 0.1813, 0.3933]}, {"w": "explore", "b": [0.1876, 0.3736, 0.2632, 0.3933]}, {"w": "in", "b": [0.2695, 0.3736, 0.2891, 0.3933]}, {"w": "chapter", "b": [0.2954, 0.3736, 0.3696, 0.3933]}, {"w": "7.", "b": [0.376, 0.3736, 0.3949, 0.3933]}]}, {"id": "b_1", "type": "paragraph", "text": "A bidirectional RNN exploits this idea to improve on the performance of chronological-order RNNs. It looks at its input sequence both ways (see figure 6.25), obtaining potentially richer representations and capturing patterns that may have been missed by the chronological-order version alone.", "words": [{"w": "A", "b": [0.1294, 0.4164, 0.1476, 0.4361]}, {"w": "bidirectional", "b": [0.1539, 0.4164, 0.2814, 0.4361]}, {"w": "RNN", "b": [0.2878, 0.4164, 0.341, 0.4361]}, {"w": "exploits", "b": [0.3473, 0.4164, 0.4272, 0.4361]}, {"w": "this", "b": [0.4335, 0.4164, 0.47, 0.4361]}, {"w": "idea", "b": [0.4763, 0.4164, 0.5183, 0.4361]}, {"w": "to", "b": [0.5246, 0.4164, 0.5442, 0.4361]}, {"w": "improve", "b": [0.5505, 0.4164, 0.6346, 0.4361]}, {"w": "on", "b": [0.6409, 0.4164, 0.6661, 0.4361]}, {"w": "the", "b": [0.6724, 0.4164, 0.7033, 0.4361]}, {"w": "performance", "b": [0.7096, 0.4164, 0.837, 0.4361]}, {"w": "of", "b": [0.8434, 0.4164, 0.8644, 0.4361]}, {"w": "chronological-order", "b": [0.1294, 0.4369, 0.3298, 0.4566]}, {"w": "RNNs.", "b": [0.3361, 0.4369, 0.4054, 0.4566]}, {"w": "It", "b": [0.4117, 0.4369, 0.4272, 0.4566]}, {"w": "looks", "b": [0.4335, 0.4369, 0.4881, 0.4566]}, {"w": "at", "b": [0.4944, 0.4369, 0.5126, 0.4566]}, {"w": "its", "b": [0.5189, 0.4369, 0.5428, 0.4566]}, {"w": "input", "b": [0.5491, 0.4369, 0.601, 0.4566]}, {"w": "sequence", "b": [0.6073, 0.4369, 0.6997, 0.4566]}, {"w": "both", "b": [0.706, 0.4369, 0.7508, 0.4566]}, {"w": "ways", "b": [0.7571, 0.4369, 0.809, 0.4566]}, {"w": "(see", "b": [0.8153, 0.4369, 0.8559, 0.4566]}, {"w": "figure", "b": [0.1294, 0.4574, 0.1897, 0.4771]}, {"w": "6.25),", "b": [0.196, 0.4574, 0.2548, 0.4771]}, {"w": "obtaining", "b": [0.2611, 0.4574, 0.3564, 0.4771]}, {"w": "potentially", "b": [0.3627, 0.4574, 0.4706, 0.4771]}, {"w": "richer", "b": [0.4769, 0.4574, 0.5358, 0.4771]}, {"w": "representations", "b": [0.5421, 0.4574, 0.6948, 0.4771]}, {"w": "and", "b": [0.7011, 0.4574, 0.7375, 0.4771]}, {"w": "capturing", "b": [0.7438, 0.4574, 0.8391, 0.4771]}, {"w": "patterns", "b": [0.1294, 0.4779, 0.2093, 0.4976]}, {"w": "that", "b": [0.2156, 0.4779, 0.2534, 0.4976]}, {"w": "may", "b": [0.2597, 0.4779, 0.3032, 0.4976]}, {"w": "have", "b": [0.3095, 0.4779, 0.3571, 0.4976]}, {"w": "been", "b": [0.3634, 0.4779, 0.411, 0.4976]}, {"w": "missed", "b": [0.4173, 0.4779, 0.4874, 0.4976]}, {"w": "by", "b": [0.4937, 0.4779, 0.5189, 0.4976]}, {"w": "the", "b": [0.5253, 0.4779, 0.5561, 0.4976]}, {"w": "chronological-order", "b": [0.5624, 0.4779, 0.7627, 0.4976]}, {"w": "version", "b": [0.7689, 0.4779, 0.8432, 0.4976]}, {"w": "alone.", "b": [0.1294, 0.4984, 0.1904, 0.5181]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.25. How a bidirectional RNN layer works", "words": [{"w": "Figure", "b": [0.1294, 0.5362, 0.1827, 0.551]}, {"w": "6.25.", "b": [0.1874, 0.5362, 0.2252, 0.551]}, {"w": "How", "b": [0.2299, 0.5362, 0.2678, 0.551]}, {"w": "a", "b": [0.2725, 0.5362, 0.282, 0.551]}, {"w": "bidirectional", "b": [0.2867, 0.5362, 0.3894, 0.551]}, {"w": "RNN", "b": [0.3941, 0.5362, 0.4351, 0.551]}, {"w": "layer", "b": [0.4398, 0.5362, 0.4808, 0.551]}, {"w": "works", "b": [0.4855, 0.5362, 0.5349, 0.551]}]}, {"id": "b_3", "type": "paragraph", "text": "To instantiate a bidirectional RNN in Keras, you use the Bidirectional layer, which takes as its first argument a recurrent layer instance. Bidirectional creates a second, separate instance of this recurrent layer and uses one instance for processing the input sequences in chronological order and the other instance for processing", "words": [{"w": "To", "b": [0.1294, 0.7889, 0.1557, 0.8087]}, {"w": "instantiate", "b": [0.162, 0.7889, 0.2657, 0.8087]}, {"w": "a", "b": [0.272, 0.7889, 0.2832, 0.8087]}, {"w": "bidirectional", "b": [0.2895, 0.7889, 0.417, 0.8087]}, {"w": "RNN", "b": [0.4233, 0.7889, 0.4766, 0.8087]}, {"w": "in", "b": [0.4829, 0.7889, 0.5025, 0.8087]}, {"w": "Keras,", "b": [0.5088, 0.7889, 0.5739, 0.8087]}, {"w": "you", "b": [0.5802, 0.7889, 0.6181, 0.8087]}, {"w": "use", "b": [0.6244, 0.7889, 0.658, 0.8087]}, {"w": "the", "b": [0.6643, 0.7889, 0.6952, 0.8087]}, {"w": "Bidirectional", "b": [0.1294, 0.8105, 0.3262, 0.8307]}, {"w": "layer,", "b": [0.3325, 0.8094, 0.3882, 0.8292]}, {"w": "which", "b": [0.3945, 0.8094, 0.4562, 0.8292]}, {"w": "takes", "b": [0.4625, 0.8094, 0.5143, 0.8292]}, {"w": "as", "b": [0.5206, 0.8094, 0.5416, 0.8292]}, {"w": "its", "b": [0.5479, 0.8094, 0.5718, 0.8292]}, {"w": "first", "b": [0.5781, 0.8094, 0.6187, 0.8292]}, {"w": "argument", "b": [0.625, 0.8094, 0.7198, 0.8292]}, {"w": "a", "b": [0.7261, 0.8094, 0.7373, 0.8292]}, {"w": "recurrent", "b": [0.7436, 0.8094, 0.8347, 0.8292]}, {"w": "layer", "b": [0.1294, 0.8308, 0.1798, 0.8506]}, {"w": "instance.", "b": [0.1861, 0.8308, 0.2751, 0.8506]}, {"w": "Bidirectional", "b": [0.2814, 0.8319, 0.4781, 0.8521]}, {"w": "creates", "b": [0.4845, 0.8308, 0.5545, 0.8506]}, {"w": "a", "b": [0.5608, 0.8308, 0.572, 0.8506]}, {"w": "second,", "b": [0.5783, 0.8308, 0.6547, 0.8506]}, {"w": "separate", "b": [0.661, 0.8308, 0.7436, 0.8506]}, {"w": "instance", "b": [0.7499, 0.8308, 0.8326, 0.8506]}, {"w": "of", "b": [0.8389, 0.8308, 0.8599, 0.8506]}, {"w": "this", "b": [0.1294, 0.8522, 0.1659, 0.872]}, {"w": "recurrent", "b": [0.1722, 0.8522, 0.2632, 0.872]}, {"w": "layer", "b": [0.2695, 0.8522, 0.3199, 0.872]}, {"w": "and", "b": [0.3262, 0.8522, 0.3627, 0.872]}, {"w": "uses", "b": [0.369, 0.8522, 0.4124, 0.872]}, {"w": "one", "b": [0.4187, 0.8522, 0.4552, 0.872]}, {"w": "instance", "b": [0.4615, 0.8522, 0.5441, 0.872]}, {"w": "for", "b": [0.5504, 0.8522, 0.5798, 0.872]}, {"w": "processing", "b": [0.5861, 0.8522, 0.694, 0.872]}, {"w": "the", "b": [0.7003, 0.8522, 0.7312, 0.872]}, {"w": "input", "b": [0.7375, 0.8522, 0.7893, 0.872]}, {"w": "sequences", "b": [0.1294, 0.8727, 0.2317, 0.8924]}, {"w": "in", "b": [0.238, 0.8727, 0.2576, 0.8924]}, {"w": "chronological", "b": [0.2639, 0.8727, 0.4026, 0.8924]}, {"w": "order", "b": [0.4089, 0.8727, 0.4621, 0.8924]}, {"w": "and", "b": [0.4684, 0.8727, 0.5048, 0.8924]}, {"w": "the", "b": [0.5112, 0.8727, 0.542, 0.8924]}, {"w": "other", "b": [0.5483, 0.8727, 0.6001, 0.8924]}, {"w": "instance", "b": [0.6064, 0.8727, 0.6891, 0.8924]}, {"w": "for", "b": [0.6954, 0.8727, 0.7248, 0.8924]}, {"w": "processing", "b": [0.7311, 0.8727, 0.839, 0.8924]}]}]}, {"page": 292, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the input sequences in reversed order. Let’s try it on the IMDB sentiment-analysis task.", "words": [{"w": "the", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "input", "b": [0.1665, 0.0857, 0.2184, 0.1054]}, {"w": "sequences", "b": [0.2247, 0.0857, 0.327, 0.1054]}, {"w": "in", "b": [0.3333, 0.0857, 0.3529, 0.1054]}, {"w": "reversed", "b": [0.3592, 0.0857, 0.4447, 0.1054]}, {"w": "order.", "b": [0.451, 0.0857, 0.5091, 0.1054]}, {"w": "Let’s", "b": [0.5154, 0.0857, 0.5658, 0.1054]}, {"w": "try", "b": [0.5721, 0.0857, 0.6001, 0.1054]}, {"w": "it", "b": [0.6064, 0.0857, 0.6205, 0.1054]}, {"w": "on", "b": [0.6268, 0.0857, 0.652, 0.1054]}, {"w": "the", "b": [0.6583, 0.0857, 0.6891, 0.1054]}, {"w": "IMDB", "b": [0.6954, 0.0857, 0.7613, 0.1054]}, {"w": "sentiment-analysis", "b": [0.1294, 0.1062, 0.3172, 0.1259]}, {"w": "task.", "b": [0.3235, 0.1062, 0.3704, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 6.43. Training and evaluating a bidirectional LSTM", "words": [{"w": "Listing", "b": [0.1294, 0.144, 0.1862, 0.1588]}, {"w": "6.43.", "b": [0.1909, 0.144, 0.2288, 0.1588]}, {"w": "Training", "b": [0.2335, 0.144, 0.3036, 0.1588]}, {"w": "and", "b": [0.3083, 0.144, 0.3388, 0.1588]}, {"w": "evaluating", "b": [0.3435, 0.144, 0.4276, 0.1588]}, {"w": "a", "b": [0.4323, 0.144, 0.4418, 0.1588]}, {"w": "bidirectional", "b": [0.4465, 0.144, 0.5492, 0.1588]}, {"w": "LSTM", "b": [0.5539, 0.1448, 0.5993, 0.16]}]}, {"id": "b_2", "type": "paragraph", "text": "model = Sequential() model.add(layers.Embedding(max_features, 32)) model.add(layers.Bidirectional(layers.LSTM(32))) model.add(layers.Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) history = model.fit(x_train, y_train, epochs=10, batch_size=128, validation_split=0.2)", "words": [{"w": "model", "b": [0.1357, 0.1733, 0.1925, 0.1885]}, {"w": "=", "b": [0.2038, 0.1733, 0.2152, 0.1885]}, {"w": "Sequential()", "b": [0.2265, 0.1733, 0.3628, 0.1885]}, {"w": "model.add(layers.Embedding(max_features,", "b": [0.1357, 0.1885, 0.5898, 0.2036]}, {"w": "32))", "b": [0.6011, 0.1885, 0.6465, 0.2036]}, {"w": "model.add(layers.Bidirectional(layers.LSTM(32)))", "b": [0.1357, 0.2036, 0.6806, 0.2188]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.2188, 0.4195, 0.2339]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.2188, 0.6806, 0.2339]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.2491, 0.5217, 0.2642]}, {"w": "loss='binary_crossentropy',", "b": [0.533, 0.2491, 0.8395, 0.2642]}, {"w": "metrics=['acc'])", "b": [0.1357, 0.2642, 0.3173, 0.2794]}, {"w": "history", "b": [0.1357, 0.2794, 0.2152, 0.2945]}, {"w": "=", "b": [0.2265, 0.2794, 0.2379, 0.2945]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.2794, 0.4536, 0.2945]}, {"w": "y_train,", "b": [0.4649, 0.2794, 0.5557, 0.2945]}, {"w": "epochs=10,", "b": [0.3628, 0.2945, 0.4763, 0.3097]}, {"w": "batch_size=128,", "b": [0.3628, 0.3097, 0.533, 0.3248]}, {"w": "validation_split=0.2)", "b": [0.3628, 0.3248, 0.6011, 0.34]}]}, {"id": "b_3", "type": "paragraph", "text": "It performs slightly better than the regular LSTM you tried in the previous section, achieving over 89% validation accuracy. It also seems to overfit more quickly, which is unsurprising because a bidirectional layer has twice as many parameters as a chronological LSTM. With some regularization, the bidirectional approach would likely be a strong performer on this task.", "words": [{"w": "It", "b": [0.1294, 0.3629, 0.1448, 0.3826]}, {"w": "performs", "b": [0.1511, 0.3629, 0.2422, 0.3826]}, {"w": "slightly", "b": [0.2485, 0.3629, 0.3242, 0.3826]}, {"w": "better", "b": [0.3305, 0.3629, 0.388, 0.3826]}, {"w": "than", "b": [0.3943, 0.3629, 0.4377, 0.3826]}, {"w": "the", "b": [0.444, 0.3629, 0.4748, 0.3826]}, {"w": "regular", "b": [0.4811, 0.3629, 0.5526, 0.3826]}, {"w": "LSTM", "b": [0.5588, 0.3639, 0.6193, 0.3841]}, {"w": "you", "b": [0.6257, 0.3629, 0.6635, 0.3826]}, {"w": "tried", "b": [0.6698, 0.3629, 0.716, 0.3826]}, {"w": "in", "b": [0.7223, 0.3629, 0.742, 0.3826]}, {"w": "the", "b": [0.7483, 0.3629, 0.7791, 0.3826]}, {"w": "previous", "b": [0.1294, 0.3843, 0.2163, 0.404]}, {"w": "section,", "b": [0.2226, 0.3843, 0.3004, 0.404]}, {"w": "achieving", "b": [0.3067, 0.3843, 0.4048, 0.404]}, {"w": "over", "b": [0.4111, 0.3843, 0.4559, 0.404]}, {"w": "89%", "b": [0.4622, 0.3843, 0.5084, 0.404]}, {"w": "validation", "b": [0.5147, 0.3843, 0.6156, 0.404]}, {"w": "accuracy.", "b": [0.6219, 0.3843, 0.7162, 0.404]}, {"w": "It", "b": [0.7225, 0.3843, 0.7379, 0.404]}, {"w": "also", "b": [0.7442, 0.3843, 0.7848, 0.404]}, {"w": "seems", "b": [0.7911, 0.3843, 0.8528, 0.404]}, {"w": "to", "b": [0.1294, 0.4048, 0.149, 0.4245]}, {"w": "overfit", "b": [0.1553, 0.4048, 0.2226, 0.4245]}, {"w": "more", "b": [0.2289, 0.4048, 0.2807, 0.4245]}, {"w": "quickly,", "b": [0.287, 0.4048, 0.3674, 0.4245]}, {"w": "which", "b": [0.3737, 0.4048, 0.4353, 0.4245]}, {"w": "is", "b": [0.4416, 0.4048, 0.4584, 0.4245]}, {"w": "unsurprising", "b": [0.4647, 0.4048, 0.5909, 0.4245]}, {"w": "because", "b": [0.5972, 0.4048, 0.677, 0.4245]}, {"w": "a", "b": [0.6833, 0.4048, 0.6945, 0.4245]}, {"w": "bidirectional", "b": [0.7008, 0.4048, 0.8283, 0.4245]}, {"w": "layer", "b": [0.1294, 0.4253, 0.1798, 0.445]}, {"w": "has", "b": [0.1861, 0.4253, 0.2198, 0.445]}, {"w": "twice", "b": [0.2261, 0.4253, 0.2807, 0.445]}, {"w": "as", "b": [0.287, 0.4253, 0.308, 0.445]}, {"w": "many", "b": [0.3143, 0.4253, 0.3704, 0.445]}, {"w": "parameters", "b": [0.3767, 0.4253, 0.4874, 0.445]}, {"w": "as", "b": [0.4937, 0.4253, 0.5147, 0.445]}, {"w": "a", "b": [0.521, 0.4253, 0.5322, 0.445]}, {"w": "chronological", "b": [0.5385, 0.4253, 0.6772, 0.445]}, {"w": "LSTM.", "b": [0.6834, 0.4253, 0.7503, 0.4465]}, {"w": "With", "b": [0.7566, 0.4253, 0.806, 0.445]}, {"w": "some", "b": [0.8123, 0.4253, 0.8656, 0.445]}, {"w": "regularization,", "b": [0.1294, 0.4467, 0.2758, 0.4664]}, {"w": "the", "b": [0.2821, 0.4467, 0.313, 0.4664]}, {"w": "bidirectional", "b": [0.3193, 0.4467, 0.4468, 0.4664]}, {"w": "approach", "b": [0.4531, 0.4467, 0.5455, 0.4664]}, {"w": "would", "b": [0.5518, 0.4467, 0.6149, 0.4664]}, {"w": "likely", "b": [0.6212, 0.4467, 0.6787, 0.4664]}, {"w": "be", "b": [0.685, 0.4467, 0.7088, 0.4664]}, {"w": "a", "b": [0.7151, 0.4467, 0.7263, 0.4664]}, {"w": "strong", "b": [0.7326, 0.4467, 0.7957, 0.4664]}, {"w": "performer", "b": [0.1294, 0.4672, 0.2303, 0.4869]}, {"w": "on", "b": [0.2366, 0.4672, 0.2618, 0.4869]}, {"w": "this", "b": [0.2681, 0.4672, 0.3046, 0.4869]}, {"w": "task.", "b": [0.3109, 0.4672, 0.3578, 0.4869]}]}, {"id": "b_4", "type": "equation", "text": "Now let’s try the same approach on the temperature-prediction task.", "words": [{"w": "Now", "b": [0.1294, 0.5099, 0.1785, 0.5297]}, {"w": "let’s", "b": [0.1848, 0.5099, 0.2268, 0.5297]}, {"w": "try", "b": [0.2331, 0.5099, 0.2611, 0.5297]}, {"w": "the", "b": [0.2674, 0.5099, 0.2983, 0.5297]}, {"w": "same", "b": [0.3046, 0.5099, 0.3564, 0.5297]}, {"w": "approach", "b": [0.3627, 0.5099, 0.4552, 0.5297]}, {"w": "on", "b": [0.4615, 0.5099, 0.4867, 0.5297]}, {"w": "the", "b": [0.493, 0.5099, 0.5238, 0.5297]}, {"w": "temperature-prediction", "b": [0.5301, 0.5099, 0.7613, 0.5297]}, {"w": "task.", "b": [0.7676, 0.5099, 0.8146, 0.5297]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 6.44. Training a bidirectional GRU", "words": [{"w": "Listing", "b": [0.1294, 0.5478, 0.1862, 0.5626]}, {"w": "6.44.", "b": [0.1909, 0.5478, 0.2288, 0.5626]}, {"w": "Training", "b": [0.2335, 0.5478, 0.3036, 0.5626]}, {"w": "a", "b": [0.3083, 0.5478, 0.3177, 0.5626]}, {"w": "bidirectional", "b": [0.3225, 0.5478, 0.4251, 0.5626]}, {"w": "GRU", "b": [0.4299, 0.5486, 0.4639, 0.5637]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential() model.add(layers.Bidirectional( layers.GRU(32), input_shape=(None, float_data.shape[-1]))) model.add(layers.Dense(1)) model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=40, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "from", "b": [0.1357, 0.5771, 0.1811, 0.5922]}, {"w": "keras.models", "b": [0.1925, 0.5771, 0.3287, 0.5922]}, {"w": "import", "b": [0.34, 0.5771, 0.4082, 0.5922]}, {"w": "Sequential", "b": [0.4195, 0.5771, 0.533, 0.5922]}, {"w": "from", "b": [0.1357, 0.5922, 0.1811, 0.6074]}, {"w": "keras", "b": [0.1925, 0.5922, 0.2492, 0.6074]}, {"w": "import", "b": [0.2606, 0.5922, 0.3287, 0.6074]}, {"w": "layers", "b": [0.34, 0.5922, 0.4082, 0.6074]}, {"w": "from", "b": [0.1357, 0.6074, 0.1811, 0.6225]}, {"w": "keras.optimizers", "b": [0.1925, 0.6074, 0.3741, 0.6225]}, {"w": "import", "b": [0.3855, 0.6074, 0.4536, 0.6225]}, {"w": "RMSprop", "b": [0.4649, 0.6074, 0.5444, 0.6225]}, {"w": "model", "b": [0.1357, 0.6377, 0.1925, 0.6528]}, {"w": "=", "b": [0.2038, 0.6377, 0.2152, 0.6528]}, {"w": "Sequential()", "b": [0.2265, 0.6377, 0.3628, 0.6528]}, {"w": "model.add(layers.Bidirectional(", "b": [0.1357, 0.6529, 0.4876, 0.668]}, {"w": "layers.GRU(32),", "b": [0.1811, 0.668, 0.3514, 0.6831]}, {"w": "input_shape=(None,", "b": [0.3628, 0.668, 0.5671, 0.6831]}, {"w": "float_data.shape[-1])))", "b": [0.5784, 0.668, 0.8395, 0.6831]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.6832, 0.4309, 0.6983]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.7135, 0.5217, 0.7286]}, {"w": "loss='mae')", "b": [0.533, 0.7135, 0.6579, 0.7286]}, {"w": "history", "b": [0.1357, 0.7286, 0.2152, 0.7438]}, {"w": "=", "b": [0.2265, 0.7286, 0.2379, 0.7438]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.7286, 0.5898, 0.7438]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.7438, 0.7033, 0.7589]}, {"w": "epochs=40,", "b": [0.4763, 0.7589, 0.5898, 0.7741]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.7741, 0.7487, 0.7892]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.7892, 0.7828, 0.8044]}]}, {"id": "b_7", "type": "paragraph", "text": "This performs about as well as the regular GRU layer. It’s easy to understand why: all the predictive capacity must come from the chronological half of the network, because the antichronological half is", "words": [{"w": "This", "b": [0.1294, 0.8273, 0.1743, 0.847]}, {"w": "performs", "b": [0.1806, 0.8273, 0.2716, 0.847]}, {"w": "about", "b": [0.2779, 0.8273, 0.334, 0.847]}, {"w": "as", "b": [0.3403, 0.8273, 0.3613, 0.847]}, {"w": "well", "b": [0.3676, 0.8273, 0.4111, 0.847]}, {"w": "as", "b": [0.4174, 0.8273, 0.4384, 0.847]}, {"w": "the", "b": [0.4447, 0.8273, 0.4755, 0.847]}, {"w": "regular", "b": [0.4818, 0.8273, 0.5533, 0.847]}, {"w": "GRU", "b": [0.5595, 0.8283, 0.6049, 0.8485]}, {"w": "layer.", "b": [0.6112, 0.8273, 0.6666, 0.847]}, {"w": "It’s", "b": [0.6729, 0.8273, 0.7051, 0.847]}, {"w": "easy", "b": [0.7114, 0.8273, 0.7562, 0.847]}, {"w": "to", "b": [0.7625, 0.8273, 0.7822, 0.847]}, {"w": "understand", "b": [0.1294, 0.8486, 0.2401, 0.8684]}, {"w": "why:", "b": [0.2464, 0.8486, 0.2969, 0.8684]}, {"w": "all", "b": [0.3032, 0.8486, 0.3284, 0.8684]}, {"w": "the", "b": [0.3347, 0.8486, 0.3655, 0.8684]}, {"w": "predictive", "b": [0.3718, 0.8486, 0.4727, 0.8684]}, {"w": "capacity", "b": [0.479, 0.8486, 0.5631, 0.8684]}, {"w": "must", "b": [0.5694, 0.8486, 0.6184, 0.8684]}, {"w": "come", "b": [0.6247, 0.8486, 0.6794, 0.8684]}, {"w": "from", "b": [0.6857, 0.8486, 0.7347, 0.8684]}, {"w": "the", "b": [0.741, 0.8486, 0.7719, 0.8684]}, {"w": "chronological", "b": [0.1294, 0.8691, 0.2681, 0.8889]}, {"w": "half", "b": [0.2744, 0.8691, 0.3137, 0.8889]}, {"w": "of", "b": [0.32, 0.8691, 0.341, 0.8889]}, {"w": "the", "b": [0.3473, 0.8691, 0.3781, 0.8889]}, {"w": "network,", "b": [0.3844, 0.8691, 0.4734, 0.8889]}, {"w": "because", "b": [0.4797, 0.8691, 0.5595, 0.8889]}, {"w": "the", "b": [0.5658, 0.8691, 0.5966, 0.8889]}, {"w": "antichronological", "b": [0.6029, 0.8691, 0.7795, 0.8889]}, {"w": "half", "b": [0.7858, 0.8691, 0.825, 0.8889]}, {"w": "is", "b": [0.8313, 0.8691, 0.8481, 0.8889]}]}]}, {"page": 293, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "known to be severely underperforming on this task (again, because the recent past matters much more than the distant past in this case).", "words": [{"w": "known", "b": [0.1294, 0.0857, 0.1981, 0.1054]}, {"w": "to", "b": [0.2044, 0.0857, 0.224, 0.1054]}, {"w": "be", "b": [0.2303, 0.0857, 0.2541, 0.1054]}, {"w": "severely", "b": [0.2604, 0.0857, 0.3445, 0.1054]}, {"w": "underperforming", "b": [0.3508, 0.0857, 0.5217, 0.1054]}, {"w": "on", "b": [0.528, 0.0857, 0.5533, 0.1054]}, {"w": "this", "b": [0.5596, 0.0857, 0.596, 0.1054]}, {"w": "task", "b": [0.6023, 0.0857, 0.643, 0.1054]}, {"w": "(again,", "b": [0.6493, 0.0857, 0.7186, 0.1054]}, {"w": "because", "b": [0.7249, 0.0857, 0.8048, 0.1054]}, {"w": "the", "b": [0.8111, 0.0857, 0.8419, 0.1054]}, {"w": "recent", "b": [0.1294, 0.1062, 0.191, 0.1259]}, {"w": "past", "b": [0.1973, 0.1062, 0.238, 0.1259]}, {"w": "matters", "b": [0.2443, 0.1062, 0.3186, 0.1259]}, {"w": "much", "b": [0.3249, 0.1062, 0.3809, 0.1259]}, {"w": "more", "b": [0.3872, 0.1062, 0.439, 0.1259]}, {"w": "than", "b": [0.4453, 0.1062, 0.4888, 0.1259]}, {"w": "the", "b": [0.4951, 0.1062, 0.5259, 0.1259]}, {"w": "distant", "b": [0.5322, 0.1062, 0.5995, 0.1259]}, {"w": "past", "b": [0.6058, 0.1062, 0.6464, 0.1259]}, {"w": "in", "b": [0.6527, 0.1062, 0.6723, 0.1259]}, {"w": "this", "b": [0.6787, 0.1062, 0.7151, 0.1259]}, {"w": "case).", "b": [0.7214, 0.1062, 0.7795, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "6.3.9. Going even further", "words": [{"w": "6.3.9.", "b": [0.1294, 0.1534, 0.1862, 0.1732]}, {"w": "Going", "b": [0.1925, 0.1534, 0.2584, 0.1732]}, {"w": "even", "b": [0.2647, 0.1534, 0.3137, 0.1732]}, {"w": "further", "b": [0.32, 0.1534, 0.3985, 0.1732]}]}, {"id": "b_2", "type": "paragraph", "text": "There are many other things you could try, in order to improve performance on the temperature-forecasting problem:", "words": [{"w": "There", "b": [0.1294, 0.1962, 0.1882, 0.2159]}, {"w": "are", "b": [0.1945, 0.1962, 0.2253, 0.2159]}, {"w": "many", "b": [0.2317, 0.1962, 0.2877, 0.2159]}, {"w": "other", "b": [0.294, 0.1962, 0.3458, 0.2159]}, {"w": "things", "b": [0.3522, 0.1962, 0.4138, 0.2159]}, {"w": "you", "b": [0.4201, 0.1962, 0.458, 0.2159]}, {"w": "could", "b": [0.4643, 0.1962, 0.5203, 0.2159]}, {"w": "try,", "b": [0.5266, 0.1962, 0.5593, 0.2159]}, {"w": "in", "b": [0.5656, 0.1962, 0.5852, 0.2159]}, {"w": "order", "b": [0.5915, 0.1962, 0.6447, 0.2159]}, {"w": "to", "b": [0.6511, 0.1962, 0.6707, 0.2159]}, {"w": "improve", "b": [0.677, 0.1962, 0.7611, 0.2159]}, {"w": "performance", "b": [0.1294, 0.2167, 0.2569, 0.2364]}, {"w": "on", "b": [0.2632, 0.2167, 0.2884, 0.2364]}, {"w": "the", "b": [0.2947, 0.2167, 0.3255, 0.2364]}, {"w": "temperature-forecasting", "b": [0.3318, 0.2167, 0.5728, 0.2364]}, {"w": "problem:", "b": [0.5791, 0.2167, 0.6702, 0.2364]}]}, {"id": "b_3", "type": "paragraph", "text": "Adjust the number of units in each recurrent layer in the stacked setup. The current choices are largely arbitrary and thus probably suboptimal. Adjust the learning rate used by the RMSprop optimizer. Try using LSTM layers instead of GRU layers. Try using a bigger densely connected regressor on top of the recurrent layers: that is, a bigger Dense layer or even a stack of Dense layers. Don’t forget to eventually run the best-performing models (in terms of validation MAE) on the test set! Otherwise, you’ll develop architectures that are overfitting to the validation set.", "words": [{"w": "Adjust", "b": [0.1799, 0.255, 0.2471, 0.2748]}, {"w": "the", "b": [0.2534, 0.255, 0.2843, 0.2748]}, {"w": "number", "b": [0.2906, 0.255, 0.3676, 0.2748]}, {"w": "of", "b": [0.374, 0.255, 0.395, 0.2748]}, {"w": "units", "b": [0.4013, 0.255, 0.4503, 0.2748]}, {"w": "in", "b": [0.4566, 0.255, 0.4763, 0.2748]}, {"w": "each", "b": [0.4826, 0.255, 0.5288, 0.2748]}, {"w": "recurrent", "b": [0.5351, 0.255, 0.6261, 0.2748]}, {"w": "layer", "b": [0.6324, 0.255, 0.6829, 0.2748]}, {"w": "in", "b": [0.6892, 0.255, 0.7088, 0.2748]}, {"w": "the", "b": [0.7151, 0.255, 0.7459, 0.2748]}, {"w": "stacked", "b": [0.7522, 0.255, 0.8279, 0.2748]}, {"w": "setup.", "b": [0.1799, 0.2755, 0.2394, 0.2953]}, {"w": "The", "b": [0.2457, 0.2755, 0.285, 0.2953]}, {"w": "current", "b": [0.2913, 0.2755, 0.3627, 0.2953]}, {"w": "choices", "b": [0.369, 0.2755, 0.4447, 0.2953]}, {"w": "are", "b": [0.451, 0.2755, 0.4818, 0.2953]}, {"w": "largely", "b": [0.4881, 0.2755, 0.5576, 0.2953]}, {"w": "arbitrary", "b": [0.5639, 0.2755, 0.6508, 0.2953]}, {"w": "and", "b": [0.6571, 0.2755, 0.6935, 0.2953]}, {"w": "thus", "b": [0.6998, 0.2755, 0.7419, 0.2953]}, {"w": "probably", "b": [0.7481, 0.2755, 0.8378, 0.2953]}, {"w": "suboptimal.", "b": [0.1799, 0.296, 0.2983, 0.3158]}, {"w": "Adjust", "b": [0.1799, 0.3165, 0.2471, 0.3363]}, {"w": "the", "b": [0.2534, 0.3165, 0.2843, 0.3363]}, {"w": "learning", "b": [0.2906, 0.3165, 0.3732, 0.3363]}, {"w": "rate", "b": [0.3796, 0.3165, 0.4174, 0.3363]}, {"w": "used", "b": [0.4237, 0.3165, 0.4699, 0.3363]}, {"w": "by", "b": [0.4762, 0.3165, 0.5014, 0.3363]}, {"w": "the", "b": [0.5077, 0.3165, 0.5386, 0.3363]}, {"w": "RMSprop", "b": [0.5448, 0.3176, 0.6508, 0.3378]}, {"w": "optimizer.", "b": [0.6571, 0.3165, 0.7587, 0.3363]}, {"w": "Try", "b": [0.1799, 0.3379, 0.2154, 0.3577]}, {"w": "using", "b": [0.2217, 0.3379, 0.2764, 0.3577]}, {"w": "LSTM", "b": [0.2827, 0.339, 0.3432, 0.3592]}, {"w": "layers", "b": [0.3495, 0.3379, 0.4097, 0.3577]}, {"w": "instead", "b": [0.4161, 0.3379, 0.4875, 0.3577]}, {"w": "of", "b": [0.4938, 0.3379, 0.5148, 0.3577]}, {"w": "GRU", "b": [0.5211, 0.339, 0.5665, 0.3592]}, {"w": "layers.", "b": [0.5728, 0.3379, 0.6394, 0.3577]}, {"w": "Try", "b": [0.1799, 0.3593, 0.2154, 0.379]}, {"w": "using", "b": [0.2217, 0.3593, 0.2764, 0.379]}, {"w": "a", "b": [0.2827, 0.3593, 0.2939, 0.379]}, {"w": "bigger", "b": [0.3002, 0.3593, 0.3646, 0.379]}, {"w": "densely", "b": [0.3709, 0.3593, 0.448, 0.379]}, {"w": "connected", "b": [0.4543, 0.3593, 0.5566, 0.379]}, {"w": "regressor", "b": [0.5629, 0.3593, 0.6553, 0.379]}, {"w": "on", "b": [0.6616, 0.3593, 0.6869, 0.379]}, {"w": "top", "b": [0.6932, 0.3593, 0.7254, 0.379]}, {"w": "of", "b": [0.7317, 0.3593, 0.7527, 0.379]}, {"w": "the", "b": [0.759, 0.3593, 0.7899, 0.379]}, {"w": "recurrent", "b": [0.1799, 0.3798, 0.2709, 0.3995]}, {"w": "layers:", "b": [0.2772, 0.3798, 0.3445, 0.3995]}, {"w": "that", "b": [0.3508, 0.3798, 0.3886, 0.3995]}, {"w": "is,", "b": [0.3949, 0.3798, 0.418, 0.3995]}, {"w": "a", "b": [0.4244, 0.3798, 0.4356, 0.3995]}, {"w": "bigger", "b": [0.4419, 0.3798, 0.5063, 0.3995]}, {"w": "Dense", "b": [0.5125, 0.3809, 0.5882, 0.401]}, {"w": "layer", "b": [0.5945, 0.3798, 0.645, 0.3995]}, {"w": "or", "b": [0.6513, 0.3798, 0.6723, 0.3995]}, {"w": "even", "b": [0.6786, 0.3798, 0.7262, 0.3995]}, {"w": "a", "b": [0.7325, 0.3798, 0.7437, 0.3995]}, {"w": "stack", "b": [0.75, 0.3798, 0.8019, 0.3995]}, {"w": "of", "b": [0.8082, 0.3798, 0.8292, 0.3995]}, {"w": "Dense", "b": [0.1799, 0.4022, 0.2555, 0.4224]}, {"w": "layers.", "b": [0.2618, 0.4012, 0.3284, 0.4209]}, {"w": "Don’t", "b": [0.1799, 0.4226, 0.2383, 0.4423]}, {"w": "forget", "b": [0.2446, 0.4226, 0.3043, 0.4423]}, {"w": "to", "b": [0.3107, 0.4226, 0.3303, 0.4423]}, {"w": "eventually", "b": [0.3366, 0.4226, 0.4417, 0.4423]}, {"w": "run", "b": [0.448, 0.4226, 0.4816, 0.4423]}, {"w": "the", "b": [0.4879, 0.4226, 0.5187, 0.4423]}, {"w": "best-performing", "b": [0.5251, 0.4226, 0.6876, 0.4423]}, {"w": "models", "b": [0.6939, 0.4226, 0.7668, 0.4423]}, {"w": "(in", "b": [0.7731, 0.4226, 0.8011, 0.4423]}, {"w": "terms", "b": [0.8074, 0.4226, 0.8635, 0.4423]}, {"w": "of", "b": [0.1799, 0.4431, 0.2009, 0.4628]}, {"w": "validation", "b": [0.2072, 0.4431, 0.3081, 0.4628]}, {"w": "MAE)", "b": [0.3144, 0.4431, 0.3788, 0.4628]}, {"w": "on", "b": [0.3852, 0.4431, 0.4104, 0.4628]}, {"w": "the", "b": [0.4167, 0.4431, 0.4475, 0.4628]}, {"w": "test", "b": [0.4538, 0.4431, 0.4889, 0.4628]}, {"w": "set!", "b": [0.4952, 0.4431, 0.5316, 0.4628]}, {"w": "Otherwise,", "b": [0.5379, 0.4431, 0.6479, 0.4628]}, {"w": "you’ll", "b": [0.6542, 0.4431, 0.7144, 0.4628]}, {"w": "develop", "b": [0.7207, 0.4431, 0.8006, 0.4628]}, {"w": "architectures", "b": [0.1799, 0.4636, 0.3087, 0.4833]}, {"w": "that", "b": [0.315, 0.4636, 0.3529, 0.4833]}, {"w": "are", "b": [0.3592, 0.4636, 0.39, 0.4833]}, {"w": "overfitting", "b": [0.3963, 0.4636, 0.5028, 0.4833]}, {"w": "to", "b": [0.5091, 0.4636, 0.5287, 0.4833]}, {"w": "the", "b": [0.535, 0.4636, 0.5659, 0.4833]}, {"w": "validation", "b": [0.5722, 0.4636, 0.6731, 0.4833]}, {"w": "set.", "b": [0.6794, 0.4636, 0.7137, 0.4833]}]}, {"id": "b_4", "type": "paragraph", "text": "As always, deep learning is more an art than a science. We can provide guidelines that suggest what is likely to work or not work on a given problem, but, ultimately, every problem is unique; you’ll have to evaluate different strategies empirically. There is currently no theory that will tell you in advance precisely what you should do to optimally solve a problem. You must iterate.", "words": [{"w": "As", "b": [0.1294, 0.5064, 0.1574, 0.5261]}, {"w": "always,", "b": [0.1637, 0.5064, 0.2401, 0.5261]}, {"w": "deep", "b": [0.2464, 0.5064, 0.294, 0.5261]}, {"w": "learning", "b": [0.3003, 0.5064, 0.383, 0.5261]}, {"w": "is", "b": [0.3893, 0.5064, 0.4061, 0.5261]}, {"w": "more", "b": [0.4124, 0.5064, 0.4643, 0.5261]}, {"w": "an", "b": [0.4706, 0.5064, 0.4944, 0.5261]}, {"w": "art", "b": [0.5007, 0.5064, 0.5273, 0.5261]}, {"w": "than", "b": [0.5336, 0.5064, 0.5771, 0.5261]}, {"w": "a", "b": [0.5834, 0.5064, 0.5946, 0.5261]}, {"w": "science.", "b": [0.6009, 0.5064, 0.6814, 0.5261]}, {"w": "We", "b": [0.6877, 0.5064, 0.7207, 0.5261]}, {"w": "can", "b": [0.727, 0.5064, 0.762, 0.5261]}, {"w": "provide", "b": [0.7683, 0.5064, 0.8453, 0.5261]}, {"w": "guidelines", "b": [0.1294, 0.5269, 0.2331, 0.5466]}, {"w": "that", "b": [0.2394, 0.5269, 0.2773, 0.5466]}, {"w": "suggest", "b": [0.2836, 0.5269, 0.3592, 0.5466]}, {"w": "what", "b": [0.3656, 0.5269, 0.4146, 0.5466]}, {"w": "is", "b": [0.4209, 0.5269, 0.4377, 0.5466]}, {"w": "likely", "b": [0.444, 0.5269, 0.5015, 0.5466]}, {"w": "to", "b": [0.5078, 0.5269, 0.5274, 0.5466]}, {"w": "work", "b": [0.5337, 0.5269, 0.5856, 0.5466]}, {"w": "or", "b": [0.5919, 0.5269, 0.6129, 0.5466]}, {"w": "not", "b": [0.6192, 0.5269, 0.6514, 0.5466]}, {"w": "work", "b": [0.6577, 0.5269, 0.7095, 0.5466]}, {"w": "on", "b": [0.7158, 0.5269, 0.741, 0.5466]}, {"w": "a", "b": [0.7474, 0.5269, 0.7586, 0.5466]}, {"w": "given", "b": [0.7649, 0.5269, 0.8209, 0.5466]}, {"w": "problem,", "b": [0.1294, 0.5474, 0.2198, 0.5671]}, {"w": "but,", "b": [0.2261, 0.5474, 0.2646, 0.5671]}, {"w": "ultimately,", "b": [0.271, 0.5474, 0.3779, 0.5671]}, {"w": "every", "b": [0.3842, 0.5474, 0.4402, 0.5671]}, {"w": "problem", "b": [0.4465, 0.5474, 0.5306, 0.5671]}, {"w": "is", "b": [0.5369, 0.5474, 0.5537, 0.5671]}, {"w": "unique;", "b": [0.56, 0.5474, 0.6357, 0.5671]}, {"w": "you’ll", "b": [0.642, 0.5474, 0.7023, 0.5671]}, {"w": "have", "b": [0.7086, 0.5474, 0.7562, 0.5671]}, {"w": "to", "b": [0.7625, 0.5474, 0.7822, 0.5671]}, {"w": "evaluate", "b": [0.1294, 0.5679, 0.2135, 0.5876]}, {"w": "different", "b": [0.2198, 0.5679, 0.3061, 0.5876]}, {"w": "strategies", "b": [0.3124, 0.5679, 0.4077, 0.5876]}, {"w": "empirically.", "b": [0.414, 0.5679, 0.5335, 0.5876]}, {"w": "There", "b": [0.5398, 0.5679, 0.5987, 0.5876]}, {"w": "is", "b": [0.605, 0.5679, 0.6218, 0.5876]}, {"w": "currently", "b": [0.6281, 0.5679, 0.7192, 0.5876]}, {"w": "no", "b": [0.7255, 0.5679, 0.7507, 0.5876]}, {"w": "theory", "b": [0.757, 0.5679, 0.8215, 0.5876]}, {"w": "that", "b": [0.8278, 0.5679, 0.8656, 0.5876]}, {"w": "will", "b": [0.1294, 0.5884, 0.1687, 0.6081]}, {"w": "tell", "b": [0.175, 0.5884, 0.2072, 0.6081]}, {"w": "you", "b": [0.2135, 0.5884, 0.2514, 0.6081]}, {"w": "in", "b": [0.2577, 0.5884, 0.2773, 0.6081]}, {"w": "advance", "b": [0.2836, 0.5884, 0.3662, 0.6081]}, {"w": "precisely", "b": [0.3725, 0.5884, 0.4636, 0.6081]}, {"w": "what", "b": [0.4699, 0.5884, 0.5189, 0.6081]}, {"w": "you", "b": [0.5253, 0.5884, 0.5631, 0.6081]}, {"w": "should", "b": [0.5694, 0.5884, 0.6367, 0.6081]}, {"w": "do", "b": [0.643, 0.5884, 0.6682, 0.6081]}, {"w": "to", "b": [0.6745, 0.5884, 0.6941, 0.6081]}, {"w": "optimally", "b": [0.7004, 0.5884, 0.7972, 0.6081]}, {"w": "solve", "b": [0.8035, 0.5884, 0.8567, 0.6081]}, {"w": "a", "b": [0.1294, 0.6089, 0.1406, 0.6286]}, {"w": "problem.", "b": [0.1469, 0.6089, 0.2373, 0.6286]}, {"w": "You", "b": [0.2436, 0.6089, 0.2845, 0.6286]}, {"w": "must", "b": [0.2908, 0.6089, 0.3399, 0.6286]}, {"w": "iterate.", "b": [0.3462, 0.6089, 0.4155, 0.6286]}]}, {"id": "b_5", "type": "paragraph", "text": "6.3.10. Wrapping up", "words": [{"w": "6.3.10.", "b": [0.1294, 0.6561, 0.1988, 0.6759]}, {"w": "Wrapping", "b": [0.2051, 0.6561, 0.3154, 0.6759]}, {"w": "up", "b": [0.3217, 0.6561, 0.3497, 0.6759]}]}, {"id": "b_6", "type": "paragraph", "text": "Here’s what you should take away from this section:", "words": [{"w": "Here’s", "b": [0.1294, 0.6989, 0.1952, 0.7186]}, {"w": "what", "b": [0.2016, 0.6989, 0.2506, 0.7186]}, {"w": "you", "b": [0.2569, 0.6989, 0.2947, 0.7186]}, {"w": "should", "b": [0.301, 0.6989, 0.3683, 0.7186]}, {"w": "take", "b": [0.3746, 0.6989, 0.4167, 0.7186]}, {"w": "away", "b": [0.423, 0.6989, 0.4762, 0.7186]}, {"w": "from", "b": [0.4825, 0.6989, 0.5315, 0.7186]}, {"w": "this", "b": [0.5378, 0.6989, 0.5743, 0.7186]}, {"w": "section:", "b": [0.5806, 0.6989, 0.6591, 0.7186]}]}, {"id": "b_7", "type": "paragraph", "text": "As you first learned in chapter 4, when approaching a new problem, it’s good to first establish common-sense baselines for your metric of choice. If you don’t have a baseline to beat, you can’t tell whether you’re making real progress. Try simple models before expensive ones, to justify the additional expense. Sometimes a simple model will turn out to be your best option.", "words": [{"w": "As", "b": [0.1799, 0.7372, 0.2079, 0.757]}, {"w": "you", "b": [0.2142, 0.7372, 0.252, 0.757]}, {"w": "first", "b": [0.2583, 0.7372, 0.299, 0.757]}, {"w": "learned", "b": [0.3053, 0.7372, 0.3795, 0.757]}, {"w": "in", "b": [0.3858, 0.7372, 0.4055, 0.757]}, {"w": "chapter", "b": [0.4117, 0.7372, 0.486, 0.757]}, {"w": "4,", "b": [0.4923, 0.7372, 0.5112, 0.757]}, {"w": "when", "b": [0.5175, 0.7372, 0.5721, 0.757]}, {"w": "approaching", "b": [0.5784, 0.7372, 0.7031, 0.757]}, {"w": "a", "b": [0.7094, 0.7372, 0.7206, 0.757]}, {"w": "new", "b": [0.7269, 0.7372, 0.769, 0.757]}, {"w": "problem,", "b": [0.7753, 0.7372, 0.8657, 0.757]}, {"w": "it’s", "b": [0.1799, 0.7577, 0.2107, 0.7775]}, {"w": "good", "b": [0.217, 0.7577, 0.2675, 0.7775]}, {"w": "to", "b": [0.2738, 0.7577, 0.2934, 0.7775]}, {"w": "first", "b": [0.2997, 0.7577, 0.3403, 0.7775]}, {"w": "establish", "b": [0.3466, 0.7577, 0.4349, 0.7775]}, {"w": "common-sense", "b": [0.4412, 0.7577, 0.5926, 0.7775]}, {"w": "baselines", "b": [0.5989, 0.7577, 0.6914, 0.7775]}, {"w": "for", "b": [0.6977, 0.7577, 0.7271, 0.7775]}, {"w": "your", "b": [0.7334, 0.7577, 0.7796, 0.7775]}, {"w": "metric", "b": [0.7859, 0.7577, 0.8504, 0.7775]}, {"w": "of", "b": [0.1799, 0.7782, 0.2009, 0.798]}, {"w": "choice.", "b": [0.2072, 0.7782, 0.2793, 0.798]}, {"w": "If", "b": [0.2856, 0.7782, 0.3024, 0.798]}, {"w": "you", "b": [0.3087, 0.7782, 0.3466, 0.798]}, {"w": "don’t", "b": [0.3529, 0.7782, 0.4057, 0.798]}, {"w": "have", "b": [0.412, 0.7782, 0.4596, 0.798]}, {"w": "a", "b": [0.4659, 0.7782, 0.4771, 0.798]}, {"w": "baseline", "b": [0.4834, 0.7782, 0.5661, 0.798]}, {"w": "to", "b": [0.5724, 0.7782, 0.592, 0.798]}, {"w": "beat,", "b": [0.5983, 0.7782, 0.6466, 0.798]}, {"w": "you", "b": [0.6529, 0.7782, 0.6908, 0.798]}, {"w": "can’t", "b": [0.6971, 0.7782, 0.747, 0.798]}, {"w": "tell", "b": [0.7533, 0.7782, 0.7856, 0.798]}, {"w": "whether", "b": [0.1799, 0.7987, 0.2611, 0.8185]}, {"w": "you’re", "b": [0.2674, 0.7987, 0.3333, 0.8185]}, {"w": "making", "b": [0.3396, 0.7987, 0.4152, 0.8185]}, {"w": "real", "b": [0.4216, 0.7987, 0.4594, 0.8185]}, {"w": "progress.", "b": [0.4657, 0.7987, 0.5574, 0.8185]}, {"w": "Try", "b": [0.1799, 0.8192, 0.2154, 0.839]}, {"w": "simple", "b": [0.2217, 0.8192, 0.289, 0.839]}, {"w": "models", "b": [0.2953, 0.8192, 0.3682, 0.839]}, {"w": "before", "b": [0.3745, 0.8192, 0.4389, 0.839]}, {"w": "expensive", "b": [0.4452, 0.8192, 0.5461, 0.839]}, {"w": "ones,", "b": [0.5524, 0.8192, 0.6049, 0.839]}, {"w": "to", "b": [0.6112, 0.8192, 0.6309, 0.839]}, {"w": "justify", "b": [0.6372, 0.8192, 0.7017, 0.839]}, {"w": "the", "b": [0.708, 0.8192, 0.7388, 0.839]}, {"w": "additional", "b": [0.7451, 0.8192, 0.846, 0.839]}, {"w": "expense.", "b": [0.1799, 0.8397, 0.2674, 0.8595]}, {"w": "Sometimes", "b": [0.2737, 0.8397, 0.3859, 0.8595]}, {"w": "a", "b": [0.3922, 0.8397, 0.4034, 0.8595]}, {"w": "simple", "b": [0.4097, 0.8397, 0.4769, 0.8595]}, {"w": "model", "b": [0.4833, 0.8397, 0.5463, 0.8595]}, {"w": "will", "b": [0.5526, 0.8397, 0.5919, 0.8595]}, {"w": "turn", "b": [0.5982, 0.8397, 0.6388, 0.8595]}, {"w": "out", "b": [0.6451, 0.8397, 0.6774, 0.8595]}, {"w": "to", "b": [0.6837, 0.8397, 0.7033, 0.8595]}, {"w": "be", "b": [0.7096, 0.8397, 0.7334, 0.8595]}, {"w": "your", "b": [0.7397, 0.8397, 0.786, 0.8595]}, {"w": "best", "b": [0.7922, 0.8397, 0.8328, 0.8595]}, {"w": "option.", "b": [0.1799, 0.8602, 0.2506, 0.88]}]}]}, {"page": 294, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "When you have data where temporal ordering matters, recurrent networks are a great fit and easily outperform models that first flatten the temporal data. To use dropout with recurrent networks, you should use a time- constant dropout mask and recurrent dropout mask. These are built into Keras recurrent layers, so all you have to do is use the dropout and recurrent_dropout arguments of recurrent layers. Stacked RNNs provide more representational power than a single RNN layer. They’re also much more expensive and thus not always worth it. Although they offer clear gains on complex problems (such as machine translation), they may not always be relevant to smaller, simpler problems. Bidirectional RNNs, which look at a sequence both ways, are useful on natural-language processing problems. But they aren’t strong performers on sequence data where the recent past is much more informative than the beginning of the sequence.", "words": [{"w": "When", "b": [0.1799, 0.0857, 0.2401, 0.1054]}, {"w": "you", "b": [0.2464, 0.0857, 0.2842, 0.1054]}, {"w": "have", "b": [0.2906, 0.0857, 0.3382, 0.1054]}, {"w": "data", "b": [0.3445, 0.0857, 0.3865, 0.1054]}, {"w": "where", "b": [0.3928, 0.0857, 0.4544, 0.1054]}, {"w": "temporal", "b": [0.4608, 0.0857, 0.5504, 0.1054]}, {"w": "ordering", "b": [0.5567, 0.0857, 0.6422, 0.1054]}, {"w": "matters,", "b": [0.6485, 0.0857, 0.7291, 0.1054]}, {"w": "recurrent", "b": [0.7354, 0.0857, 0.8264, 0.1054]}, {"w": "networks", "b": [0.1799, 0.1062, 0.2723, 0.1259]}, {"w": "are", "b": [0.2786, 0.1062, 0.3094, 0.1259]}, {"w": "a", "b": [0.3158, 0.1062, 0.327, 0.1259]}, {"w": "great", "b": [0.3333, 0.1062, 0.3837, 0.1259]}, {"w": "fit", "b": [0.39, 0.1062, 0.4124, 0.1259]}, {"w": "and", "b": [0.4187, 0.1062, 0.4552, 0.1259]}, {"w": "easily", "b": [0.4615, 0.1062, 0.5203, 0.1259]}, {"w": "outperform", "b": [0.5266, 0.1062, 0.6401, 0.1259]}, {"w": "models", "b": [0.6464, 0.1062, 0.7193, 0.1259]}, {"w": "that", "b": [0.7256, 0.1062, 0.7634, 0.1259]}, {"w": "first", "b": [0.7697, 0.1062, 0.8104, 0.1259]}, {"w": "flatten", "b": [0.1799, 0.1267, 0.2443, 0.1464]}, {"w": "the", "b": [0.2506, 0.1267, 0.2814, 0.1464]}, {"w": "temporal", "b": [0.2878, 0.1267, 0.3774, 0.1464]}, {"w": "data.", "b": [0.3837, 0.1267, 0.4321, 0.1464]}, {"w": "To", "b": [0.1799, 0.1472, 0.2061, 0.1669]}, {"w": "use", "b": [0.2124, 0.1472, 0.2461, 0.1669]}, {"w": "dropout", "b": [0.2524, 0.1472, 0.3308, 0.1669]}, {"w": "with", "b": [0.3371, 0.1472, 0.382, 0.1669]}, {"w": "recurrent", "b": [0.3883, 0.1472, 0.4793, 0.1669]}, {"w": "networks,", "b": [0.4857, 0.1472, 0.5844, 0.1669]}, {"w": "you", "b": [0.5907, 0.1472, 0.6286, 0.1669]}, {"w": "should", "b": [0.6349, 0.1472, 0.7022, 0.1669]}, {"w": "use", "b": [0.7085, 0.1472, 0.7421, 0.1669]}, {"w": "a", "b": [0.7484, 0.1472, 0.7596, 0.1669]}, {"w": "time-", "b": [0.7659, 0.1472, 0.8192, 0.1669]}, {"w": "constant", "b": [0.1799, 0.1677, 0.2639, 0.1874]}, {"w": "dropout", "b": [0.2702, 0.1677, 0.3487, 0.1874]}, {"w": "mask", "b": [0.355, 0.1677, 0.4083, 0.1874]}, {"w": "and", "b": [0.4146, 0.1677, 0.451, 0.1874]}, {"w": "recurrent", "b": [0.4573, 0.1677, 0.5484, 0.1874]}, {"w": "dropout", "b": [0.5547, 0.1677, 0.6331, 0.1874]}, {"w": "mask.", "b": [0.6395, 0.1677, 0.699, 0.1874]}, {"w": "These", "b": [0.7053, 0.1677, 0.7656, 0.1874]}, {"w": "are", "b": [0.7719, 0.1677, 0.8027, 0.1874]}, {"w": "built", "b": [0.8089, 0.1677, 0.8552, 0.1874]}, {"w": "into", "b": [0.1799, 0.1882, 0.2191, 0.2079]}, {"w": "Keras", "b": [0.2254, 0.1882, 0.2842, 0.2079]}, {"w": "recurrent", "b": [0.2906, 0.1882, 0.3816, 0.2079]}, {"w": "layers,", "b": [0.3879, 0.1882, 0.4544, 0.2079]}, {"w": "so", "b": [0.4608, 0.1882, 0.4832, 0.2079]}, {"w": "all", "b": [0.4895, 0.1882, 0.5147, 0.2079]}, {"w": "you", "b": [0.521, 0.1882, 0.5589, 0.2079]}, {"w": "have", "b": [0.5652, 0.1882, 0.6128, 0.2079]}, {"w": "to", "b": [0.6191, 0.1882, 0.6387, 0.2079]}, {"w": "do", "b": [0.645, 0.1882, 0.6703, 0.2079]}, {"w": "is", "b": [0.6766, 0.1882, 0.6934, 0.2079]}, {"w": "use", "b": [0.6997, 0.1882, 0.7333, 0.2079]}, {"w": "the", "b": [0.7396, 0.1882, 0.7704, 0.2079]}, {"w": "dropout", "b": [0.1799, 0.2097, 0.2858, 0.2299]}, {"w": "and", "b": [0.2921, 0.2087, 0.3285, 0.2284]}, {"w": "recurrent_dropout", "b": [0.3348, 0.2097, 0.5921, 0.2299]}, {"w": "arguments", "b": [0.5985, 0.2087, 0.7031, 0.2284]}, {"w": "of", "b": [0.7094, 0.2087, 0.7304, 0.2284]}, {"w": "recurrent", "b": [0.7368, 0.2087, 0.8278, 0.2284]}, {"w": "layers.", "b": [0.1799, 0.2301, 0.2464, 0.2498]}, {"w": "Stacked", "b": [0.1799, 0.2506, 0.2597, 0.2703]}, {"w": "RNNs", "b": [0.266, 0.2506, 0.3291, 0.2703]}, {"w": "provide", "b": [0.3354, 0.2506, 0.4125, 0.2703]}, {"w": "more", "b": [0.4188, 0.2506, 0.4706, 0.2703]}, {"w": "representational", "b": [0.4769, 0.2506, 0.638, 0.2703]}, {"w": "power", "b": [0.6443, 0.2506, 0.7074, 0.2703]}, {"w": "than", "b": [0.7137, 0.2506, 0.7571, 0.2703]}, {"w": "a", "b": [0.7634, 0.2506, 0.7746, 0.2703]}, {"w": "single", "b": [0.7809, 0.2506, 0.8412, 0.2703]}, {"w": "RNN", "b": [0.1799, 0.2711, 0.2331, 0.2908]}, {"w": "layer.", "b": [0.2394, 0.2711, 0.2948, 0.2908]}, {"w": "They’re", "b": [0.3011, 0.2711, 0.3809, 0.2908]}, {"w": "also", "b": [0.3872, 0.2711, 0.4279, 0.2908]}, {"w": "much", "b": [0.4342, 0.2711, 0.4902, 0.2908]}, {"w": "more", "b": [0.4965, 0.2711, 0.5484, 0.2908]}, {"w": "expensive", "b": [0.5547, 0.2711, 0.6555, 0.2908]}, {"w": "and", "b": [0.6618, 0.2711, 0.6983, 0.2908]}, {"w": "thus", "b": [0.7046, 0.2711, 0.7466, 0.2908]}, {"w": "not", "b": [0.7529, 0.2711, 0.7852, 0.2908]}, {"w": "always", "b": [0.7915, 0.2711, 0.8615, 0.2908]}, {"w": "worth", "b": [0.1799, 0.2916, 0.2387, 0.3113]}, {"w": "it.", "b": [0.245, 0.2916, 0.2654, 0.3113]}, {"w": "Although", "b": [0.2717, 0.2916, 0.367, 0.3113]}, {"w": "they", "b": [0.3733, 0.2916, 0.4167, 0.3113]}, {"w": "offer", "b": [0.423, 0.2916, 0.4716, 0.3113]}, {"w": "clear", "b": [0.4779, 0.2916, 0.5269, 0.3113]}, {"w": "gains", "b": [0.5332, 0.2916, 0.5864, 0.3113]}, {"w": "on", "b": [0.5927, 0.2916, 0.618, 0.3113]}, {"w": "complex", "b": [0.6243, 0.2916, 0.7111, 0.3113]}, {"w": "problems", "b": [0.7175, 0.2916, 0.8113, 0.3113]}, {"w": "(such", "b": [0.1799, 0.3121, 0.2345, 0.3318]}, {"w": "as", "b": [0.2408, 0.3121, 0.2618, 0.3318]}, {"w": "machine", "b": [0.2681, 0.3121, 0.3536, 0.3318]}, {"w": "translation),", "b": [0.3599, 0.3121, 0.4811, 0.3318]}, {"w": "they", "b": [0.4874, 0.3121, 0.5309, 0.3318]}, {"w": "may", "b": [0.5372, 0.3121, 0.5806, 0.3318]}, {"w": "not", "b": [0.5869, 0.3121, 0.6191, 0.3318]}, {"w": "always", "b": [0.6255, 0.3121, 0.6955, 0.3318]}, {"w": "be", "b": [0.7018, 0.3121, 0.7256, 0.3318]}, {"w": "relevant", "b": [0.7319, 0.3121, 0.8132, 0.3318]}, {"w": "to", "b": [0.8194, 0.3121, 0.839, 0.3318]}, {"w": "smaller,", "b": [0.1799, 0.3326, 0.2594, 0.3523]}, {"w": "simpler", "b": [0.2657, 0.3326, 0.3414, 0.3523]}, {"w": "problems.", "b": [0.3477, 0.3326, 0.4479, 0.3523]}, {"w": "Bidirectional", "b": [0.1799, 0.3531, 0.3116, 0.3728]}, {"w": "RNNs,", "b": [0.3179, 0.3531, 0.3873, 0.3728]}, {"w": "which", "b": [0.3936, 0.3531, 0.4552, 0.3728]}, {"w": "look", "b": [0.4615, 0.3531, 0.5064, 0.3728]}, {"w": "at", "b": [0.5127, 0.3531, 0.5309, 0.3728]}, {"w": "a", "b": [0.5372, 0.3531, 0.5484, 0.3728]}, {"w": "sequence", "b": [0.5547, 0.3531, 0.6472, 0.3728]}, {"w": "both", "b": [0.6535, 0.3531, 0.6983, 0.3728]}, {"w": "ways,", "b": [0.7046, 0.3531, 0.7628, 0.3728]}, {"w": "are", "b": [0.7691, 0.3531, 0.7999, 0.3728]}, {"w": "useful", "b": [0.8062, 0.3531, 0.8678, 0.3728]}, {"w": "on", "b": [0.1799, 0.3736, 0.2051, 0.3933]}, {"w": "natural-language", "b": [0.2114, 0.3736, 0.3809, 0.3933]}, {"w": "processing", "b": [0.3872, 0.3736, 0.4951, 0.3933]}, {"w": "problems.", "b": [0.5014, 0.3736, 0.6016, 0.3933]}, {"w": "But", "b": [0.6079, 0.3736, 0.6444, 0.3933]}, {"w": "they", "b": [0.6507, 0.3736, 0.6941, 0.3933]}, {"w": "aren’t", "b": [0.7004, 0.3736, 0.7587, 0.3933]}, {"w": "strong", "b": [0.765, 0.3736, 0.8281, 0.3933]}, {"w": "performers", "b": [0.1799, 0.3941, 0.2905, 0.4138]}, {"w": "on", "b": [0.2968, 0.3941, 0.3221, 0.4138]}, {"w": "sequence", "b": [0.3284, 0.3941, 0.4208, 0.4138]}, {"w": "data", "b": [0.4271, 0.3941, 0.4692, 0.4138]}, {"w": "where", "b": [0.4755, 0.3941, 0.5371, 0.4138]}, {"w": "the", "b": [0.5434, 0.3941, 0.5742, 0.4138]}, {"w": "recent", "b": [0.5805, 0.3941, 0.6422, 0.4138]}, {"w": "past", "b": [0.6485, 0.3941, 0.6891, 0.4138]}, {"w": "is", "b": [0.6954, 0.3941, 0.7122, 0.4138]}, {"w": "much", "b": [0.7185, 0.3941, 0.7746, 0.4138]}, {"w": "more", "b": [0.7809, 0.3941, 0.8327, 0.4138]}, {"w": "informative", "b": [0.1799, 0.4146, 0.2976, 0.4343]}, {"w": "than", "b": [0.3039, 0.4146, 0.3473, 0.4343]}, {"w": "the", "b": [0.3536, 0.4146, 0.3844, 0.4343]}, {"w": "beginning", "b": [0.3908, 0.4146, 0.4917, 0.4343]}, {"w": "of", "b": [0.498, 0.4146, 0.519, 0.4343]}, {"w": "the", "b": [0.5253, 0.4146, 0.5561, 0.4343]}, {"w": "sequence.", "b": [0.5624, 0.4146, 0.6612, 0.4343]}]}, {"id": "b_1", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.4631, 0.1672, 0.4779]}]}, {"id": "b_2", "type": "paragraph", "text": "There are two important concepts we won’t cover in detail here: recurrent attention and sequence masking. Both tend to be especially relevant for natural-language processing, and they aren’t particularly applicable to the temperature-forecasting problem. We’ll leave them for future study outside of this book.", "words": [{"w": "There", "b": [0.1294, 0.4966, 0.1882, 0.5163]}, {"w": "are", "b": [0.1945, 0.4966, 0.2253, 0.5163]}, {"w": "two", "b": [0.2317, 0.4966, 0.2695, 0.5163]}, {"w": "important", "b": [0.2758, 0.4966, 0.3739, 0.5163]}, {"w": "concepts", "b": [0.3802, 0.4966, 0.4685, 0.5163]}, {"w": "we", "b": [0.4748, 0.4966, 0.5042, 0.5163]}, {"w": "won’t", "b": [0.5105, 0.4966, 0.5688, 0.5163]}, {"w": "cover", "b": [0.5752, 0.4966, 0.6312, 0.5163]}, {"w": "in", "b": [0.6375, 0.4966, 0.6571, 0.5163]}, {"w": "detail", "b": [0.6634, 0.4966, 0.7195, 0.5163]}, {"w": "here:", "b": [0.7258, 0.4966, 0.7762, 0.5163]}, {"w": "recurrent", "b": [0.1294, 0.5171, 0.2205, 0.5368]}, {"w": "attention", "b": [0.2268, 0.5171, 0.315, 0.5368]}, {"w": "and", "b": [0.3214, 0.5171, 0.3578, 0.5368]}, {"w": "sequence", "b": [0.3641, 0.5171, 0.4565, 0.5368]}, {"w": "masking.", "b": [0.4628, 0.5171, 0.5546, 0.5368]}, {"w": "Both", "b": [0.5609, 0.5171, 0.61, 0.5368]}, {"w": "tend", "b": [0.6163, 0.5171, 0.6598, 0.5368]}, {"w": "to", "b": [0.6661, 0.5171, 0.6857, 0.5368]}, {"w": "be", "b": [0.692, 0.5171, 0.7158, 0.5368]}, {"w": "especially", "b": [0.722, 0.5171, 0.8229, 0.5368]}, {"w": "relevant", "b": [0.1294, 0.5376, 0.2107, 0.5573]}, {"w": "for", "b": [0.217, 0.5376, 0.2464, 0.5573]}, {"w": "natural-language", "b": [0.2527, 0.5376, 0.4222, 0.5573]}, {"w": "processing,", "b": [0.4285, 0.5376, 0.5427, 0.5573]}, {"w": "and", "b": [0.549, 0.5376, 0.5854, 0.5573]}, {"w": "they", "b": [0.5917, 0.5376, 0.6352, 0.5573]}, {"w": "aren’t", "b": [0.6415, 0.5376, 0.6998, 0.5573]}, {"w": "particularly", "b": [0.7061, 0.5376, 0.8224, 0.5573]}, {"w": "applicable", "b": [0.1294, 0.5581, 0.2331, 0.5778]}, {"w": "to", "b": [0.2394, 0.5581, 0.259, 0.5778]}, {"w": "the", "b": [0.2653, 0.5581, 0.2962, 0.5778]}, {"w": "temperature-forecasting", "b": [0.3025, 0.5581, 0.5434, 0.5778]}, {"w": "problem.", "b": [0.5496, 0.5581, 0.64, 0.5778]}, {"w": "We’ll", "b": [0.6463, 0.5581, 0.7017, 0.5778]}, {"w": "leave", "b": [0.708, 0.5581, 0.7613, 0.5778]}, {"w": "them", "b": [0.7676, 0.5581, 0.818, 0.5778]}, {"w": "for", "b": [0.8243, 0.5581, 0.8537, 0.5778]}, {"w": "future", "b": [0.1294, 0.5786, 0.1897, 0.5983]}, {"w": "study", "b": [0.196, 0.5786, 0.2506, 0.5983]}, {"w": "outside", "b": [0.2569, 0.5786, 0.3298, 0.5983]}, {"w": "of", "b": [0.3361, 0.5786, 0.3571, 0.5983]}, {"w": "this", "b": [0.3634, 0.5786, 0.3999, 0.5983]}, {"w": "book.", "b": [0.4062, 0.5786, 0.4629, 0.5983]}]}, {"id": "b_3", "type": "paragraph", "text": "Markets and machine learning", "words": [{"w": "Markets", "b": [0.1294, 0.657, 0.2205, 0.6767]}, {"w": "and", "b": [0.2268, 0.657, 0.2674, 0.6767]}, {"w": "machine", "b": [0.2738, 0.657, 0.3648, 0.6767]}, {"w": "learning", "b": [0.3712, 0.657, 0.4609, 0.6767]}]}, {"id": "b_4", "type": "paragraph", "text": "Some readers are bound to want to take the techniques we’ve introduced here and try them on the problem of forecasting the future price of securities on the stock market (or currency exchange rates, and so on). Markets have very different statistical characteristics than natural phenomena such as weather patterns. Trying to use machine learning to beat markets, when you only have access to publicly available data, is a difficult endeavor, and you’re likely to waste your time and resources with nothing to show for it.", "words": [{"w": "Some", "b": [0.1294, 0.6998, 0.1869, 0.7195]}, {"w": "readers", "b": [0.1932, 0.6998, 0.266, 0.7195]}, {"w": "are", "b": [0.2723, 0.6998, 0.3031, 0.7195]}, {"w": "bound", "b": [0.3094, 0.6998, 0.3725, 0.7195]}, {"w": "to", "b": [0.3788, 0.6998, 0.3984, 0.7195]}, {"w": "want", "b": [0.4047, 0.6998, 0.4538, 0.7195]}, {"w": "to", "b": [0.4601, 0.6998, 0.4797, 0.7195]}, {"w": "take", "b": [0.486, 0.6998, 0.528, 0.7195]}, {"w": "the", "b": [0.5343, 0.6998, 0.5652, 0.7195]}, {"w": "techniques", "b": [0.5715, 0.6998, 0.6794, 0.7195]}, {"w": "we’ve", "b": [0.6857, 0.6998, 0.7473, 0.7195]}, {"w": "introduced", "b": [0.7536, 0.6998, 0.8615, 0.7195]}, {"w": "here", "b": [0.1294, 0.7203, 0.1728, 0.74]}, {"w": "and", "b": [0.1791, 0.7203, 0.2156, 0.74]}, {"w": "try", "b": [0.2219, 0.7203, 0.2499, 0.74]}, {"w": "them", "b": [0.2562, 0.7203, 0.3066, 0.74]}, {"w": "on", "b": [0.313, 0.7203, 0.3382, 0.74]}, {"w": "the", "b": [0.3445, 0.7203, 0.3753, 0.74]}, {"w": "problem", "b": [0.3816, 0.7203, 0.4657, 0.74]}, {"w": "of", "b": [0.472, 0.7203, 0.493, 0.74]}, {"w": "forecasting", "b": [0.4993, 0.7203, 0.6114, 0.74]}, {"w": "the", "b": [0.6177, 0.7203, 0.6485, 0.74]}, {"w": "future", "b": [0.6548, 0.7203, 0.715, 0.74]}, {"w": "price", "b": [0.7213, 0.7203, 0.7717, 0.74]}, {"w": "of", "b": [0.778, 0.7203, 0.799, 0.74]}, {"w": "securities", "b": [0.1294, 0.7408, 0.2247, 0.7605]}, {"w": "on", "b": [0.231, 0.7408, 0.2562, 0.7605]}, {"w": "the", "b": [0.2625, 0.7408, 0.2934, 0.7605]}, {"w": "stock", "b": [0.2997, 0.7408, 0.3529, 0.7605]}, {"w": "market", "b": [0.3592, 0.7408, 0.4293, 0.7605]}, {"w": "(or", "b": [0.4356, 0.7408, 0.465, 0.7605]}, {"w": "currency", "b": [0.4713, 0.7408, 0.5595, 0.7605]}, {"w": "exchange", "b": [0.5658, 0.7408, 0.6611, 0.7605]}, {"w": "rates,", "b": [0.6674, 0.7408, 0.7213, 0.7605]}, {"w": "and", "b": [0.7276, 0.7408, 0.7641, 0.7605]}, {"w": "so", "b": [0.7704, 0.7408, 0.7928, 0.7605]}, {"w": "on).", "b": [0.7991, 0.7408, 0.839, 0.7605]}, {"w": "Markets", "b": [0.1294, 0.7613, 0.2121, 0.781]}, {"w": "have", "b": [0.2184, 0.7613, 0.266, 0.781]}, {"w": "very", "b": [0.2723, 0.7613, 0.3157, 0.781]}, {"w": "different", "b": [0.322, 0.7613, 0.4065, 0.781]}, {"w": "statistical", "b": [0.4129, 0.7613, 0.511, 0.781]}, {"w": "characteristics", "b": [0.5173, 0.7613, 0.6672, 0.781]}, {"w": "than", "b": [0.6735, 0.7613, 0.7169, 0.781]}, {"w": "natural", "b": [0.7232, 0.7613, 0.7933, 0.781]}, {"w": "phenomena", "b": [0.1294, 0.7818, 0.2457, 0.8015]}, {"w": "such", "b": [0.252, 0.7818, 0.2982, 0.8015]}, {"w": "as", "b": [0.3046, 0.7818, 0.3256, 0.8015]}, {"w": "weather", "b": [0.3319, 0.7818, 0.4117, 0.8015]}, {"w": "patterns.", "b": [0.418, 0.7818, 0.5042, 0.8015]}, {"w": "Trying", "b": [0.5105, 0.7818, 0.5782, 0.8015]}, {"w": "to", "b": [0.5845, 0.7818, 0.6042, 0.8015]}, {"w": "use", "b": [0.6105, 0.7818, 0.6441, 0.8015]}, {"w": "machine", "b": [0.6504, 0.7818, 0.7359, 0.8015]}, {"w": "learning", "b": [0.7422, 0.7818, 0.8248, 0.8015]}, {"w": "to", "b": [0.8311, 0.7818, 0.8508, 0.8015]}, {"w": "beat", "b": [0.1294, 0.8023, 0.1714, 0.822]}, {"w": "markets,", "b": [0.1777, 0.8023, 0.2639, 0.822]}, {"w": "when", "b": [0.2702, 0.8023, 0.3249, 0.822]}, {"w": "you", "b": [0.3312, 0.8023, 0.369, 0.822]}, {"w": "only", "b": [0.3753, 0.8023, 0.4202, 0.822]}, {"w": "have", "b": [0.4265, 0.8023, 0.4741, 0.822]}, {"w": "access", "b": [0.4804, 0.8023, 0.5448, 0.822]}, {"w": "to", "b": [0.5511, 0.8023, 0.5707, 0.822]}, {"w": "publicly", "b": [0.577, 0.8023, 0.6597, 0.822]}, {"w": "available", "b": [0.666, 0.8023, 0.7571, 0.822]}, {"w": "data,", "b": [0.7634, 0.8023, 0.8117, 0.822]}, {"w": "is", "b": [0.818, 0.8023, 0.8348, 0.822]}, {"w": "a", "b": [0.8411, 0.8023, 0.8523, 0.822]}, {"w": "difficult", "b": [0.1294, 0.8228, 0.2102, 0.8425]}, {"w": "endeavor,", "b": [0.2165, 0.8228, 0.3143, 0.8425]}, {"w": "and", "b": [0.3206, 0.8228, 0.357, 0.8425]}, {"w": "you’re", "b": [0.3633, 0.8228, 0.4291, 0.8425]}, {"w": "likely", "b": [0.4354, 0.8228, 0.4929, 0.8425]}, {"w": "to", "b": [0.4992, 0.8228, 0.5188, 0.8425]}, {"w": "waste", "b": [0.5251, 0.8228, 0.5826, 0.8425]}, {"w": "your", "b": [0.5889, 0.8228, 0.6351, 0.8425]}, {"w": "time", "b": [0.6414, 0.8228, 0.6863, 0.8425]}, {"w": "and", "b": [0.6926, 0.8228, 0.729, 0.8425]}, {"w": "resources", "b": [0.7353, 0.8228, 0.8306, 0.8425]}, {"w": "with", "b": [0.1294, 0.8433, 0.1743, 0.863]}, {"w": "nothing", "b": [0.1806, 0.8433, 0.2577, 0.863]}, {"w": "to", "b": [0.264, 0.8433, 0.2836, 0.863]}, {"w": "show", "b": [0.2899, 0.8433, 0.3431, 0.863]}, {"w": "for", "b": [0.3494, 0.8433, 0.3789, 0.863]}, {"w": "it.", "b": [0.3852, 0.8433, 0.4055, 0.863]}]}]}, {"page": 295, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Always remember that when it comes to markets, past performance is not a good predictor of future returns—looking in the rear-view mirror is a bad way to drive. Machine learning, on the other hand, is applicable to datasets where the past is a good predictor of the future.", "words": [{"w": "Always", "b": [0.1294, 0.0857, 0.2065, 0.1054]}, {"w": "remember", "b": [0.2128, 0.0857, 0.315, 0.1054]}, {"w": "that", "b": [0.3214, 0.0857, 0.3592, 0.1054]}, {"w": "when", "b": [0.3655, 0.0857, 0.4201, 0.1054]}, {"w": "it", "b": [0.4264, 0.0857, 0.4405, 0.1054]}, {"w": "comes", "b": [0.4468, 0.0857, 0.5112, 0.1054]}, {"w": "to", "b": [0.5175, 0.0857, 0.5372, 0.1054]}, {"w": "markets,", "b": [0.5435, 0.0857, 0.6296, 0.1054]}, {"w": "past", "b": [0.6359, 0.0857, 0.6766, 0.1054]}, {"w": "performance", "b": [0.6829, 0.0857, 0.8104, 0.1054]}, {"w": "is", "b": [0.8167, 0.0857, 0.8335, 0.1054]}, {"w": "not", "b": [0.1294, 0.1062, 0.1617, 0.1259]}, {"w": "a", "b": [0.1679, 0.1062, 0.1791, 0.1259]}, {"w": "good", "b": [0.1854, 0.1062, 0.2359, 0.1259]}, {"w": "predictor", "b": [0.2422, 0.1062, 0.3333, 0.1259]}, {"w": "of", "b": [0.3396, 0.1062, 0.3606, 0.1259]}, {"w": "future", "b": [0.3669, 0.1062, 0.4271, 0.1259]}, {"w": "returns—looking", "b": [0.4334, 0.1062, 0.6058, 0.1259]}, {"w": "in", "b": [0.6121, 0.1062, 0.6317, 0.1259]}, {"w": "the", "b": [0.638, 0.1062, 0.6689, 0.1259]}, {"w": "rear-view", "b": [0.6752, 0.1062, 0.7713, 0.1259]}, {"w": "mirror", "b": [0.7776, 0.1062, 0.842, 0.1259]}, {"w": "is", "b": [0.8483, 0.1062, 0.8651, 0.1259]}, {"w": "a", "b": [0.1294, 0.1267, 0.1406, 0.1464]}, {"w": "bad", "b": [0.1469, 0.1267, 0.1833, 0.1464]}, {"w": "way", "b": [0.1897, 0.1267, 0.2317, 0.1464]}, {"w": "to", "b": [0.238, 0.1267, 0.2576, 0.1464]}, {"w": "drive.", "b": [0.2639, 0.1267, 0.3221, 0.1464]}, {"w": "Machine", "b": [0.3284, 0.1267, 0.4166, 0.1464]}, {"w": "learning,", "b": [0.4229, 0.1267, 0.5119, 0.1464]}, {"w": "on", "b": [0.5182, 0.1267, 0.5434, 0.1464]}, {"w": "the", "b": [0.5497, 0.1267, 0.5806, 0.1464]}, {"w": "other", "b": [0.5869, 0.1267, 0.6387, 0.1464]}, {"w": "hand,", "b": [0.645, 0.1267, 0.7003, 0.1464]}, {"w": "is", "b": [0.7066, 0.1267, 0.7234, 0.1464]}, {"w": "applicable", "b": [0.7297, 0.1267, 0.8334, 0.1464]}, {"w": "to", "b": [0.8397, 0.1267, 0.8594, 0.1464]}, {"w": "datasets", "b": [0.1294, 0.1472, 0.2093, 0.1669]}, {"w": "where", "b": [0.2156, 0.1472, 0.2772, 0.1669]}, {"w": "the", "b": [0.2835, 0.1472, 0.3143, 0.1669]}, {"w": "past", "b": [0.3206, 0.1472, 0.3613, 0.1669]}, {"w": "is", "b": [0.3676, 0.1472, 0.3844, 0.1669]}, {"w": "a", "b": [0.3907, 0.1472, 0.4019, 0.1669]}, {"w": "good", "b": [0.4082, 0.1472, 0.4586, 0.1669]}, {"w": "predictor", "b": [0.4649, 0.1472, 0.556, 0.1669]}, {"w": "of", "b": [0.5623, 0.1472, 0.5833, 0.1669]}, {"w": "the", "b": [0.5896, 0.1472, 0.6205, 0.1669]}, {"w": "future.", "b": [0.6268, 0.1472, 0.6933, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "6.4. Sequence processing with convnets", "words": [{"w": "6.4.", "b": [0.1294, 0.2308, 0.172, 0.253]}, {"w": "Sequence", "b": [0.1791, 0.2308, 0.2926, 0.253]}, {"w": "processing", "b": [0.2997, 0.2308, 0.4269, 0.253]}, {"w": "with", "b": [0.434, 0.2308, 0.4876, 0.253]}, {"w": "convnets", "b": [0.4947, 0.2308, 0.6003, 0.253]}]}, {"id": "b_2", "type": "paragraph", "text": "In chapter 5, you learned about convolutional neural networks (convnets) and how they perform particularly well on computer vision problems, due to their ability to operate convolutionally, extracting features from local input patches and allowing for representation modularity and data efficiency. The same properties that make convnets excel at computer vision also make them highly relevant to sequence processing. Time can be treated as a spatial dimension, like the height or width of a 2D image.", "words": [{"w": "In", "b": [0.1294, 0.2764, 0.1504, 0.2962]}, {"w": "chapter", "b": [0.1567, 0.2764, 0.231, 0.2962]}, {"w": "5,", "b": [0.2373, 0.2764, 0.2562, 0.2962]}, {"w": "you", "b": [0.2625, 0.2764, 0.3003, 0.2962]}, {"w": "learned", "b": [0.3066, 0.2764, 0.3809, 0.2962]}, {"w": "about", "b": [0.3872, 0.2764, 0.4432, 0.2962]}, {"w": "convolutional", "b": [0.4495, 0.2764, 0.5883, 0.2962]}, {"w": "neural", "b": [0.5946, 0.2764, 0.6576, 0.2962]}, {"w": "networks", "b": [0.6639, 0.2764, 0.7564, 0.2962]}, {"w": "(convnets)", "b": [0.7627, 0.2764, 0.8692, 0.2962]}, {"w": "and", "b": [0.1294, 0.2969, 0.1658, 0.3167]}, {"w": "how", "b": [0.1721, 0.2969, 0.2156, 0.3167]}, {"w": "they", "b": [0.2219, 0.2969, 0.2653, 0.3167]}, {"w": "perform", "b": [0.2716, 0.2969, 0.3529, 0.3167]}, {"w": "particularly", "b": [0.3592, 0.2969, 0.4755, 0.3167]}, {"w": "well", "b": [0.4818, 0.2969, 0.5252, 0.3167]}, {"w": "on", "b": [0.5315, 0.2969, 0.5568, 0.3167]}, {"w": "computer", "b": [0.5631, 0.2969, 0.6583, 0.3167]}, {"w": "vision", "b": [0.6647, 0.2969, 0.7263, 0.3167]}, {"w": "problems,", "b": [0.7326, 0.2969, 0.8328, 0.3167]}, {"w": "due", "b": [0.1294, 0.3174, 0.1658, 0.3372]}, {"w": "to", "b": [0.1721, 0.3174, 0.1918, 0.3372]}, {"w": "their", "b": [0.1981, 0.3174, 0.2443, 0.3372]}, {"w": "ability", "b": [0.2506, 0.3174, 0.3151, 0.3372]}, {"w": "to", "b": [0.3214, 0.3174, 0.341, 0.3372]}, {"w": "operate", "b": [0.3473, 0.3174, 0.4216, 0.3372]}, {"w": "convolutionally,", "b": [0.4278, 0.3174, 0.591, 0.3372]}, {"w": "extracting", "b": [0.5973, 0.3174, 0.6982, 0.3372]}, {"w": "features", "b": [0.7045, 0.3174, 0.7844, 0.3372]}, {"w": "from", "b": [0.7907, 0.3174, 0.8397, 0.3372]}, {"w": "local", "b": [0.1294, 0.3379, 0.1785, 0.3577]}, {"w": "input", "b": [0.1848, 0.3379, 0.2366, 0.3577]}, {"w": "patches", "b": [0.2429, 0.3379, 0.3186, 0.3577]}, {"w": "and", "b": [0.3249, 0.3379, 0.3613, 0.3577]}, {"w": "allowing", "b": [0.3676, 0.3379, 0.4559, 0.3577]}, {"w": "for", "b": [0.4622, 0.3379, 0.4916, 0.3577]}, {"w": "representation", "b": [0.4979, 0.3379, 0.6408, 0.3577]}, {"w": "modularity", "b": [0.6471, 0.3379, 0.7579, 0.3577]}, {"w": "and", "b": [0.7642, 0.3379, 0.8006, 0.3577]}, {"w": "data", "b": [0.8069, 0.3379, 0.8489, 0.3577]}, {"w": "efficiency.", "b": [0.1294, 0.3584, 0.2345, 0.3782]}, {"w": "The", "b": [0.2408, 0.3584, 0.28, 0.3782]}, {"w": "same", "b": [0.2863, 0.3584, 0.3381, 0.3782]}, {"w": "properties", "b": [0.3444, 0.3584, 0.4453, 0.3782]}, {"w": "that", "b": [0.4516, 0.3584, 0.4894, 0.3782]}, {"w": "make", "b": [0.4957, 0.3584, 0.5504, 0.3782]}, {"w": "convnets", "b": [0.5567, 0.3584, 0.6464, 0.3782]}, {"w": "excel", "b": [0.6527, 0.3584, 0.7059, 0.3782]}, {"w": "at", "b": [0.7122, 0.3584, 0.7304, 0.3782]}, {"w": "computer", "b": [0.7367, 0.3584, 0.832, 0.3782]}, {"w": "vision", "b": [0.1294, 0.3789, 0.1911, 0.3987]}, {"w": "also", "b": [0.1974, 0.3789, 0.238, 0.3987]}, {"w": "make", "b": [0.2443, 0.3789, 0.299, 0.3987]}, {"w": "them", "b": [0.3053, 0.3789, 0.3557, 0.3987]}, {"w": "highly", "b": [0.362, 0.3789, 0.4265, 0.3987]}, {"w": "relevant", "b": [0.4328, 0.3789, 0.5141, 0.3987]}, {"w": "to", "b": [0.5204, 0.3789, 0.54, 0.3987]}, {"w": "sequence", "b": [0.5463, 0.3789, 0.6388, 0.3987]}, {"w": "processing.", "b": [0.6451, 0.3789, 0.7593, 0.3987]}, {"w": "Time", "b": [0.7656, 0.3789, 0.8179, 0.3987]}, {"w": "can", "b": [0.8242, 0.3789, 0.8592, 0.3987]}, {"w": "be", "b": [0.1294, 0.3994, 0.1532, 0.4192]}, {"w": "treated", "b": [0.1595, 0.3994, 0.2282, 0.4192]}, {"w": "as", "b": [0.2345, 0.3994, 0.2555, 0.4192]}, {"w": "a", "b": [0.2618, 0.3994, 0.273, 0.4192]}, {"w": "spatial", "b": [0.2793, 0.3994, 0.3451, 0.4192]}, {"w": "dimension,", "b": [0.3514, 0.3994, 0.4629, 0.4192]}, {"w": "like", "b": [0.4692, 0.3994, 0.507, 0.4192]}, {"w": "the", "b": [0.5133, 0.3994, 0.5441, 0.4192]}, {"w": "height", "b": [0.5505, 0.3994, 0.6135, 0.4192]}, {"w": "or", "b": [0.6198, 0.3994, 0.6408, 0.4192]}, {"w": "width", "b": [0.6471, 0.3994, 0.7046, 0.4192]}, {"w": "of", "b": [0.7109, 0.3994, 0.7319, 0.4192]}, {"w": "a", "b": [0.7382, 0.3994, 0.7494, 0.4192]}, {"w": "2D", "b": [0.7557, 0.3994, 0.7866, 0.4192]}, {"w": "image.", "b": [0.7929, 0.3994, 0.8608, 0.4192]}]}, {"id": "b_3", "type": "paragraph", "text": "Such 1D convnets can be competitive with RNNs on certain sequence- processing problems, usually at a considerably cheaper computational cost. Recently, 1D convnets, typically used with dilated kernels, have been used with great success for audio generation and machine translation. In addition to these specific successes, it has long been known that small 1D convnets can offer a fast alternative to RNNs for simple tasks such as text classification and timeseries forecasting.", "words": [{"w": "Such", "b": [0.1294, 0.4422, 0.1799, 0.4619]}, {"w": "1D", "b": [0.1862, 0.4422, 0.217, 0.4619]}, {"w": "convnets", "b": [0.2233, 0.4422, 0.313, 0.4619]}, {"w": "can", "b": [0.3193, 0.4422, 0.3543, 0.4619]}, {"w": "be", "b": [0.3606, 0.4422, 0.3844, 0.4619]}, {"w": "competitive", "b": [0.3907, 0.4422, 0.5098, 0.4619]}, {"w": "with", "b": [0.5161, 0.4422, 0.561, 0.4619]}, {"w": "RNNs", "b": [0.5673, 0.4422, 0.6304, 0.4619]}, {"w": "on", "b": [0.6367, 0.4422, 0.6619, 0.4619]}, {"w": "certain", "b": [0.6682, 0.4422, 0.7368, 0.4619]}, {"w": "sequence-", "b": [0.7432, 0.4422, 0.844, 0.4619]}, {"w": "processing", "b": [0.1294, 0.4627, 0.2373, 0.4824]}, {"w": "problems,", "b": [0.2436, 0.4627, 0.3438, 0.4824]}, {"w": "usually", "b": [0.3501, 0.4627, 0.423, 0.4824]}, {"w": "at", "b": [0.4293, 0.4627, 0.4475, 0.4824]}, {"w": "a", "b": [0.4538, 0.4627, 0.465, 0.4824]}, {"w": "considerably", "b": [0.4713, 0.4627, 0.6002, 0.4824]}, {"w": "cheaper", "b": [0.6065, 0.4627, 0.685, 0.4824]}, {"w": "computational", "b": [0.6913, 0.4627, 0.8356, 0.4824]}, {"w": "cost.", "b": [0.1294, 0.4832, 0.1764, 0.5029]}, {"w": "Recently,", "b": [0.1827, 0.4832, 0.277, 0.5029]}, {"w": "1D", "b": [0.2833, 0.4832, 0.3141, 0.5029]}, {"w": "convnets,", "b": [0.3204, 0.4832, 0.4164, 0.5029]}, {"w": "typically", "b": [0.4227, 0.4832, 0.511, 0.5029]}, {"w": "used", "b": [0.5173, 0.4832, 0.5635, 0.5029]}, {"w": "with", "b": [0.5699, 0.4832, 0.6147, 0.5029]}, {"w": "dilated", "b": [0.621, 0.4832, 0.6897, 0.5029]}, {"w": "kernels,", "b": [0.696, 0.4832, 0.7751, 0.5029]}, {"w": "have", "b": [0.7814, 0.4832, 0.8291, 0.5029]}, {"w": "been", "b": [0.1294, 0.5037, 0.177, 0.5234]}, {"w": "used", "b": [0.1833, 0.5037, 0.2296, 0.5234]}, {"w": "with", "b": [0.2359, 0.5037, 0.2807, 0.5234]}, {"w": "great", "b": [0.287, 0.5037, 0.3375, 0.5234]}, {"w": "success", "b": [0.3438, 0.5037, 0.4194, 0.5234]}, {"w": "for", "b": [0.4257, 0.5037, 0.4552, 0.5234]}, {"w": "audio", "b": [0.4615, 0.5037, 0.5175, 0.5234]}, {"w": "generation", "b": [0.5238, 0.5037, 0.6303, 0.5234]}, {"w": "and", "b": [0.6366, 0.5037, 0.673, 0.5234]}, {"w": "machine", "b": [0.6793, 0.5037, 0.7647, 0.5234]}, {"w": "translation.", "b": [0.1294, 0.5242, 0.2422, 0.5439]}, {"w": "In", "b": [0.2485, 0.5242, 0.2695, 0.5439]}, {"w": "addition", "b": [0.2758, 0.5242, 0.3585, 0.5439]}, {"w": "to", "b": [0.3648, 0.5242, 0.3845, 0.5439]}, {"w": "these", "b": [0.3908, 0.5242, 0.4426, 0.5439]}, {"w": "specific", "b": [0.4489, 0.5242, 0.5274, 0.5439]}, {"w": "successes,", "b": [0.5337, 0.5242, 0.6367, 0.5439]}, {"w": "it", "b": [0.643, 0.5242, 0.657, 0.5439]}, {"w": "has", "b": [0.6633, 0.5242, 0.6969, 0.5439]}, {"w": "long", "b": [0.7032, 0.5242, 0.7481, 0.5439]}, {"w": "been", "b": [0.7544, 0.5242, 0.802, 0.5439]}, {"w": "known", "b": [0.1294, 0.5447, 0.1981, 0.5644]}, {"w": "that", "b": [0.2044, 0.5447, 0.2422, 0.5644]}, {"w": "small", "b": [0.2485, 0.5447, 0.3032, 0.5644]}, {"w": "1D", "b": [0.3095, 0.5447, 0.3403, 0.5644]}, {"w": "convnets", "b": [0.3466, 0.5447, 0.4363, 0.5644]}, {"w": "can", "b": [0.4426, 0.5447, 0.4776, 0.5644]}, {"w": "offer", "b": [0.4839, 0.5447, 0.5325, 0.5644]}, {"w": "a", "b": [0.5388, 0.5447, 0.55, 0.5644]}, {"w": "fast", "b": [0.5563, 0.5447, 0.5927, 0.5644]}, {"w": "alternative", "b": [0.599, 0.5447, 0.7055, 0.5644]}, {"w": "to", "b": [0.7118, 0.5447, 0.7314, 0.5644]}, {"w": "RNNs", "b": [0.7377, 0.5447, 0.8008, 0.5644]}, {"w": "for", "b": [0.8071, 0.5447, 0.8365, 0.5644]}, {"w": "simple", "b": [0.1294, 0.5652, 0.1967, 0.5849]}, {"w": "tasks", "b": [0.203, 0.5652, 0.2534, 0.5849]}, {"w": "such", "b": [0.2598, 0.5652, 0.306, 0.5849]}, {"w": "as", "b": [0.3123, 0.5652, 0.3333, 0.5849]}, {"w": "text", "b": [0.3396, 0.5652, 0.3775, 0.5849]}, {"w": "classification", "b": [0.3838, 0.5652, 0.5169, 0.5849]}, {"w": "and", "b": [0.5232, 0.5652, 0.5596, 0.5849]}, {"w": "timeseries", "b": [0.5659, 0.5652, 0.6682, 0.5849]}, {"w": "forecasting.", "b": [0.6745, 0.5652, 0.7929, 0.5849]}]}, {"id": "b_4", "type": "paragraph", "text": "6.4.1. Understanding 1D convolution for sequence data", "words": [{"w": "6.4.1.", "b": [0.1294, 0.6124, 0.1862, 0.6322]}, {"w": "Understanding", "b": [0.1925, 0.6124, 0.3537, 0.6322]}, {"w": "1D", "b": [0.36, 0.6124, 0.3908, 0.6322]}, {"w": "convolution", "b": [0.3971, 0.6124, 0.5233, 0.6322]}, {"w": "for", "b": [0.5296, 0.6124, 0.5618, 0.6322]}, {"w": "sequence", "b": [0.5681, 0.6124, 0.6648, 0.6322]}, {"w": "data", "b": [0.6711, 0.6124, 0.7187, 0.6322]}]}, {"id": "b_5", "type": "paragraph", "text": "The convolution layers introduced previously were 2D convolutions, extracting 2D patches from image tensors and applying an identical transformation to every patch. In the same way, you can use 1D convolutions, extracting local 1D patches (subsequences) from sequences (see figure 6.26).", "words": [{"w": "The", "b": [0.1294, 0.6552, 0.1686, 0.675]}, {"w": "convolution", "b": [0.1749, 0.6552, 0.2955, 0.675]}, {"w": "layers", "b": [0.3018, 0.6552, 0.362, 0.675]}, {"w": "introduced", "b": [0.3683, 0.6552, 0.4762, 0.675]}, {"w": "previously", "b": [0.4825, 0.6552, 0.589, 0.675]}, {"w": "were", "b": [0.5953, 0.6552, 0.6443, 0.675]}, {"w": "2D", "b": [0.6507, 0.6552, 0.6815, 0.675]}, {"w": "convolutions,", "b": [0.6878, 0.6552, 0.8244, 0.675]}, {"w": "extracting", "b": [0.1294, 0.6757, 0.2303, 0.6955]}, {"w": "2D", "b": [0.2366, 0.6757, 0.2674, 0.6955]}, {"w": "patches", "b": [0.2737, 0.6757, 0.3494, 0.6955]}, {"w": "from", "b": [0.3557, 0.6757, 0.4047, 0.6955]}, {"w": "image", "b": [0.411, 0.6757, 0.4727, 0.6955]}, {"w": "tensors", "b": [0.479, 0.6757, 0.5505, 0.6955]}, {"w": "and", "b": [0.5568, 0.6757, 0.5932, 0.6955]}, {"w": "applying", "b": [0.5995, 0.6757, 0.6878, 0.6955]}, {"w": "an", "b": [0.6941, 0.6757, 0.7179, 0.6955]}, {"w": "identical", "b": [0.7241, 0.6757, 0.811, 0.6955]}, {"w": "transformation", "b": [0.1294, 0.6962, 0.2779, 0.716]}, {"w": "to", "b": [0.2842, 0.6962, 0.3039, 0.716]}, {"w": "every", "b": [0.3102, 0.6962, 0.3662, 0.716]}, {"w": "patch.", "b": [0.3725, 0.6962, 0.4335, 0.716]}, {"w": "In", "b": [0.4398, 0.6962, 0.4608, 0.716]}, {"w": "the", "b": [0.4671, 0.6962, 0.4979, 0.716]}, {"w": "same", "b": [0.5042, 0.6962, 0.5561, 0.716]}, {"w": "way,", "b": [0.5624, 0.6962, 0.609, 0.716]}, {"w": "you", "b": [0.6153, 0.6962, 0.6531, 0.716]}, {"w": "can", "b": [0.6594, 0.6962, 0.6945, 0.716]}, {"w": "use", "b": [0.7008, 0.6962, 0.7344, 0.716]}, {"w": "1D", "b": [0.7407, 0.6962, 0.7715, 0.716]}, {"w": "convolutions,", "b": [0.1294, 0.7167, 0.2661, 0.7365]}, {"w": "extracting", "b": [0.2724, 0.7167, 0.3732, 0.7365]}, {"w": "local", "b": [0.3796, 0.7167, 0.4286, 0.7365]}, {"w": "1D", "b": [0.4349, 0.7167, 0.4657, 0.7365]}, {"w": "patches", "b": [0.472, 0.7167, 0.5477, 0.7365]}, {"w": "(subsequences)", "b": [0.554, 0.7167, 0.7081, 0.7365]}, {"w": "from", "b": [0.7143, 0.7167, 0.7634, 0.7365]}, {"w": "sequences", "b": [0.1294, 0.7372, 0.2317, 0.757]}, {"w": "(see", "b": [0.238, 0.7372, 0.2786, 0.757]}, {"w": "figure", "b": [0.2849, 0.7372, 0.3451, 0.757]}, {"w": "6.26).", "b": [0.3514, 0.7372, 0.4103, 0.757]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 6.26. How 1D convolution works: each output timestep is obtained from a temporal patch in the input sequence.", "words": [{"w": "Figure", "b": [0.1294, 0.7751, 0.1827, 0.7899]}, {"w": "6.26.", "b": [0.1874, 0.7751, 0.2252, 0.7899]}, {"w": "How", "b": [0.2299, 0.7751, 0.2678, 0.7899]}, {"w": "1D", "b": [0.2725, 0.7751, 0.2956, 0.7899]}, {"w": "convolution", "b": [0.3004, 0.7751, 0.395, 0.7899]}, {"w": "works:", "b": [0.3997, 0.7751, 0.4554, 0.7899]}, {"w": "each", "b": [0.4601, 0.7751, 0.4969, 0.7899]}, {"w": "output", "b": [0.5016, 0.7751, 0.5553, 0.7899]}, {"w": "timestep", "b": [0.56, 0.7751, 0.6283, 0.7899]}, {"w": "is", "b": [0.633, 0.7751, 0.6456, 0.7899]}, {"w": "obtained", "b": [0.6504, 0.7751, 0.7208, 0.7899]}, {"w": "from", "b": [0.7255, 0.7751, 0.7651, 0.7899]}, {"w": "a", "b": [0.7699, 0.7751, 0.7793, 0.7899]}, {"w": "temporal", "b": [0.784, 0.7751, 0.8576, 0.7899]}, {"w": "patch", "b": [0.1294, 0.7902, 0.1746, 0.805]}, {"w": "in", "b": [0.1793, 0.7902, 0.1951, 0.805]}, {"w": "the", "b": [0.1998, 0.7902, 0.2251, 0.805]}, {"w": "input", "b": [0.2298, 0.7902, 0.2729, 0.805]}, {"w": "sequence.", "b": [0.2776, 0.7902, 0.3549, 0.805]}]}]}, {"page": 296, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Such 1D convolution layers can recognize local patterns in a sequence. Because the same input transformation is performed on every patch, a pattern learned at a certain position in a sentence can later be recognized at a different position, making 1D convnets translation invariant (for temporal translations). For instance, a 1D convnet processing sequences of characters using convolution windows of size 5 should be able to learn words or word fragments of length 5 or less, and it should be able to recognize these words in any context in an input sequence. A character- level 1D convnet is thus able to learn about word morphology.", "words": [{"w": "Such", "b": [0.1294, 0.3932, 0.1799, 0.4129]}, {"w": "1D", "b": [0.1862, 0.3932, 0.217, 0.4129]}, {"w": "convolution", "b": [0.2233, 0.3932, 0.3438, 0.4129]}, {"w": "layers", "b": [0.3501, 0.3932, 0.4104, 0.4129]}, {"w": "can", "b": [0.4167, 0.3932, 0.4517, 0.4129]}, {"w": "recognize", "b": [0.458, 0.3932, 0.5561, 0.4129]}, {"w": "local", "b": [0.5624, 0.3932, 0.6114, 0.4129]}, {"w": "patterns", "b": [0.6177, 0.3932, 0.6976, 0.4129]}, {"w": "in", "b": [0.7039, 0.3932, 0.7235, 0.4129]}, {"w": "a", "b": [0.7298, 0.3932, 0.741, 0.4129]}, {"w": "sequence.", "b": [0.7473, 0.3932, 0.8461, 0.4129]}, {"w": "Because", "b": [0.1294, 0.4137, 0.2135, 0.4334]}, {"w": "the", "b": [0.2198, 0.4137, 0.2506, 0.4334]}, {"w": "same", "b": [0.2569, 0.4137, 0.3087, 0.4334]}, {"w": "input", "b": [0.315, 0.4137, 0.3669, 0.4334]}, {"w": "transformation", "b": [0.3732, 0.4137, 0.5217, 0.4334]}, {"w": "is", "b": [0.5281, 0.4137, 0.5449, 0.4334]}, {"w": "performed", "b": [0.5512, 0.4137, 0.6563, 0.4334]}, {"w": "on", "b": [0.6625, 0.4137, 0.6877, 0.4334]}, {"w": "every", "b": [0.694, 0.4137, 0.75, 0.4334]}, {"w": "patch,", "b": [0.7563, 0.4137, 0.8173, 0.4334]}, {"w": "a", "b": [0.8236, 0.4137, 0.8348, 0.4334]}, {"w": "pattern", "b": [0.1294, 0.4342, 0.1995, 0.4539]}, {"w": "learned", "b": [0.2058, 0.4342, 0.28, 0.4539]}, {"w": "at", "b": [0.2863, 0.4342, 0.3045, 0.4539]}, {"w": "a", "b": [0.3108, 0.4342, 0.322, 0.4539]}, {"w": "certain", "b": [0.3283, 0.4342, 0.397, 0.4539]}, {"w": "position", "b": [0.4033, 0.4342, 0.4846, 0.4539]}, {"w": "in", "b": [0.4909, 0.4342, 0.5105, 0.4539]}, {"w": "a", "b": [0.5168, 0.4342, 0.528, 0.4539]}, {"w": "sentence", "b": [0.5343, 0.4342, 0.6212, 0.4539]}, {"w": "can", "b": [0.6275, 0.4342, 0.6625, 0.4539]}, {"w": "later", "b": [0.6688, 0.4342, 0.7136, 0.4539]}, {"w": "be", "b": [0.7199, 0.4342, 0.7438, 0.4539]}, {"w": "recognized", "b": [0.7501, 0.4342, 0.8607, 0.4539]}, {"w": "at", "b": [0.1294, 0.4547, 0.1476, 0.4744]}, {"w": "a", "b": [0.1539, 0.4547, 0.1651, 0.4744]}, {"w": "different", "b": [0.1714, 0.4547, 0.2578, 0.4744]}, {"w": "position,", "b": [0.2641, 0.4547, 0.3517, 0.4744]}, {"w": "making", "b": [0.358, 0.4547, 0.4337, 0.4744]}, {"w": "1D", "b": [0.44, 0.4547, 0.4708, 0.4744]}, {"w": "convnets", "b": [0.4771, 0.4547, 0.5668, 0.4744]}, {"w": "translation", "b": [0.5731, 0.4547, 0.6796, 0.4744]}, {"w": "invariant", "b": [0.6859, 0.4547, 0.7756, 0.4744]}, {"w": "(for", "b": [0.7819, 0.4547, 0.8197, 0.4744]}, {"w": "temporal", "b": [0.1294, 0.4752, 0.2191, 0.4949]}, {"w": "translations).", "b": [0.2254, 0.4752, 0.3564, 0.4949]}, {"w": "For", "b": [0.3627, 0.4752, 0.3978, 0.4949]}, {"w": "instance,", "b": [0.4041, 0.4752, 0.493, 0.4949]}, {"w": "a", "b": [0.4993, 0.4752, 0.5105, 0.4949]}, {"w": "1D", "b": [0.5169, 0.4752, 0.5477, 0.4949]}, {"w": "convnet", "b": [0.554, 0.4752, 0.6339, 0.4949]}, {"w": "processing", "b": [0.6402, 0.4752, 0.748, 0.4949]}, {"w": "sequences", "b": [0.7544, 0.4752, 0.8566, 0.4949]}, {"w": "of", "b": [0.1294, 0.4957, 0.1504, 0.5154]}, {"w": "characters", "b": [0.1567, 0.4957, 0.259, 0.5154]}, {"w": "using", "b": [0.2653, 0.4957, 0.3199, 0.5154]}, {"w": "convolution", "b": [0.3262, 0.4957, 0.4468, 0.5154]}, {"w": "windows", "b": [0.4531, 0.4957, 0.5442, 0.5154]}, {"w": "of", "b": [0.5505, 0.4957, 0.5715, 0.5154]}, {"w": "size", "b": [0.5778, 0.4957, 0.617, 0.5154]}, {"w": "5", "b": [0.6233, 0.4957, 0.6359, 0.5154]}, {"w": "should", "b": [0.6422, 0.4957, 0.7095, 0.5154]}, {"w": "be", "b": [0.7158, 0.4957, 0.7396, 0.5154]}, {"w": "able", "b": [0.7459, 0.4957, 0.788, 0.5154]}, {"w": "to", "b": [0.7943, 0.4957, 0.8139, 0.5154]}, {"w": "learn", "b": [0.8202, 0.4957, 0.8706, 0.5154]}, {"w": "words", "b": [0.1294, 0.5162, 0.1911, 0.5359]}, {"w": "or", "b": [0.1974, 0.5162, 0.2184, 0.5359]}, {"w": "word", "b": [0.2247, 0.5162, 0.2765, 0.5359]}, {"w": "fragments", "b": [0.2828, 0.5162, 0.3837, 0.5359]}, {"w": "of", "b": [0.39, 0.5162, 0.411, 0.5359]}, {"w": "length", "b": [0.4173, 0.5162, 0.4804, 0.5359]}, {"w": "5", "b": [0.4867, 0.5162, 0.4993, 0.5359]}, {"w": "or", "b": [0.5056, 0.5162, 0.5266, 0.5359]}, {"w": "less,", "b": [0.5329, 0.5162, 0.5771, 0.5359]}, {"w": "and", "b": [0.5834, 0.5162, 0.6198, 0.5359]}, {"w": "it", "b": [0.6261, 0.5162, 0.6402, 0.5359]}, {"w": "should", "b": [0.6465, 0.5162, 0.7137, 0.5359]}, {"w": "be", "b": [0.72, 0.5162, 0.7439, 0.5359]}, {"w": "able", "b": [0.7501, 0.5162, 0.7921, 0.5359]}, {"w": "to", "b": [0.7985, 0.5162, 0.8181, 0.5359]}, {"w": "recognize", "b": [0.1294, 0.5367, 0.2275, 0.5564]}, {"w": "these", "b": [0.2338, 0.5367, 0.2856, 0.5564]}, {"w": "words", "b": [0.2919, 0.5367, 0.3536, 0.5564]}, {"w": "in", "b": [0.3599, 0.5367, 0.3795, 0.5564]}, {"w": "any", "b": [0.3858, 0.5367, 0.4222, 0.5564]}, {"w": "context", "b": [0.4285, 0.5367, 0.5028, 0.5564]}, {"w": "in", "b": [0.5091, 0.5367, 0.5287, 0.5564]}, {"w": "an", "b": [0.535, 0.5367, 0.5589, 0.5564]}, {"w": "input", "b": [0.5652, 0.5367, 0.617, 0.5564]}, {"w": "sequence.", "b": [0.6233, 0.5367, 0.7221, 0.5564]}, {"w": "A", "b": [0.7284, 0.5367, 0.7466, 0.5564]}, {"w": "character-", "b": [0.7529, 0.5367, 0.8531, 0.5564]}, {"w": "level", "b": [0.1294, 0.5572, 0.1785, 0.5769]}, {"w": "1D", "b": [0.1848, 0.5572, 0.2156, 0.5769]}, {"w": "convnet", "b": [0.2219, 0.5572, 0.3018, 0.5769]}, {"w": "is", "b": [0.3081, 0.5572, 0.3249, 0.5769]}, {"w": "thus", "b": [0.3312, 0.5572, 0.3732, 0.5769]}, {"w": "able", "b": [0.3796, 0.5572, 0.4216, 0.5769]}, {"w": "to", "b": [0.4279, 0.5572, 0.4475, 0.5769]}, {"w": "learn", "b": [0.4538, 0.5572, 0.5042, 0.5769]}, {"w": "about", "b": [0.5105, 0.5572, 0.5666, 0.5769]}, {"w": "word", "b": [0.5728, 0.5572, 0.6247, 0.5769]}, {"w": "morphology.", "b": [0.631, 0.5572, 0.759, 0.5769]}]}, {"id": "b_1", "type": "paragraph", "text": "6.4.2. 1D pooling for sequence data", "words": [{"w": "6.4.2.", "b": [0.1294, 0.6044, 0.1862, 0.6242]}, {"w": "1D", "b": [0.1925, 0.6044, 0.2233, 0.6242]}, {"w": "pooling", "b": [0.2296, 0.6044, 0.3095, 0.6242]}, {"w": "for", "b": [0.3158, 0.6044, 0.348, 0.6242]}, {"w": "sequence", "b": [0.3544, 0.6044, 0.451, 0.6242]}, {"w": "data", "b": [0.4573, 0.6044, 0.505, 0.6242]}]}, {"id": "b_2", "type": "paragraph", "text": "You’re already familiar with 2D pooling operations, such as 2D average pooling and max pooling, used in convnets to spatially downsample image tensors. The 2D pooling operation has a 1D equivalent: extracting 1D patches (subsequences) from an input and outputting the maximum value (max pooling) or average value (average pooling). Just as with 2D convnets, this is used for reducing the length of 1D inputs (subsampling).", "words": [{"w": "You’re", "b": [0.1294, 0.6472, 0.1983, 0.6669]}, {"w": "already", "b": [0.2046, 0.6472, 0.2789, 0.6669]}, {"w": "familiar", "b": [0.2852, 0.6472, 0.365, 0.6669]}, {"w": "with", "b": [0.3714, 0.6472, 0.4162, 0.6669]}, {"w": "2D", "b": [0.4225, 0.6472, 0.4533, 0.6669]}, {"w": "pooling", "b": [0.4596, 0.6472, 0.5367, 0.6669]}, {"w": "operations,", "b": [0.543, 0.6472, 0.6544, 0.6669]}, {"w": "such", "b": [0.6607, 0.6472, 0.707, 0.6669]}, {"w": "as", "b": [0.7133, 0.6472, 0.7343, 0.6669]}, {"w": "2D", "b": [0.7406, 0.6472, 0.7714, 0.6669]}, {"w": "average", "b": [0.7777, 0.6472, 0.8562, 0.6669]}, {"w": "pooling", "b": [0.1294, 0.6677, 0.2065, 0.6874]}, {"w": "and", "b": [0.2128, 0.6677, 0.2492, 0.6874]}, {"w": "max", "b": [0.2555, 0.6677, 0.299, 0.6874]}, {"w": "pooling,", "b": [0.3053, 0.6677, 0.3887, 0.6874]}, {"w": "used", "b": [0.395, 0.6677, 0.4412, 0.6874]}, {"w": "in", "b": [0.4475, 0.6677, 0.4672, 0.6874]}, {"w": "convnets", "b": [0.4735, 0.6677, 0.5631, 0.6874]}, {"w": "to", "b": [0.5695, 0.6677, 0.5891, 0.6874]}, {"w": "spatially", "b": [0.5954, 0.6677, 0.6809, 0.6874]}, {"w": "downsample", "b": [0.6871, 0.6677, 0.8146, 0.6874]}, {"w": "image", "b": [0.1294, 0.6882, 0.1911, 0.7079]}, {"w": "tensors.", "b": [0.1974, 0.6882, 0.2751, 0.7079]}, {"w": "The", "b": [0.2814, 0.6882, 0.3207, 0.7079]}, {"w": "2D", "b": [0.327, 0.6882, 0.3578, 0.7079]}, {"w": "pooling", "b": [0.3641, 0.6882, 0.4412, 0.7079]}, {"w": "operation", "b": [0.4475, 0.6882, 0.5428, 0.7079]}, {"w": "has", "b": [0.5491, 0.6882, 0.5827, 0.7079]}, {"w": "a", "b": [0.589, 0.6882, 0.6002, 0.7079]}, {"w": "1D", "b": [0.6065, 0.6882, 0.6374, 0.7079]}, {"w": "equivalent:", "b": [0.6437, 0.6882, 0.7558, 0.7079]}, {"w": "extracting", "b": [0.7621, 0.6882, 0.863, 0.7079]}, {"w": "1D", "b": [0.1294, 0.7087, 0.1602, 0.7285]}, {"w": "patches", "b": [0.1665, 0.7087, 0.2422, 0.7285]}, {"w": "(subsequences)", "b": [0.2485, 0.7087, 0.4026, 0.7285]}, {"w": "from", "b": [0.4089, 0.7087, 0.458, 0.7285]}, {"w": "an", "b": [0.4643, 0.7087, 0.4881, 0.7285]}, {"w": "input", "b": [0.4944, 0.7087, 0.5462, 0.7285]}, {"w": "and", "b": [0.5525, 0.7087, 0.5889, 0.7285]}, {"w": "outputting", "b": [0.5952, 0.7087, 0.699, 0.7285]}, {"w": "the", "b": [0.7053, 0.7087, 0.7361, 0.7285]}, {"w": "maximum", "b": [0.7424, 0.7087, 0.8447, 0.7285]}, {"w": "value", "b": [0.1294, 0.7292, 0.1841, 0.7489]}, {"w": "(max", "b": [0.1904, 0.7292, 0.2422, 0.7489]}, {"w": "pooling)", "b": [0.2485, 0.7292, 0.334, 0.7489]}, {"w": "or", "b": [0.3403, 0.7292, 0.3613, 0.7489]}, {"w": "average", "b": [0.3676, 0.7292, 0.446, 0.7489]}, {"w": "value", "b": [0.4524, 0.7292, 0.507, 0.7489]}, {"w": "(average", "b": [0.5133, 0.7292, 0.6001, 0.7489]}, {"w": "pooling).", "b": [0.6064, 0.7292, 0.6982, 0.7489]}, {"w": "Just", "b": [0.7045, 0.7292, 0.7438, 0.7489]}, {"w": "as", "b": [0.7501, 0.7292, 0.7711, 0.7489]}, {"w": "with", "b": [0.7774, 0.7292, 0.8223, 0.7489]}, {"w": "2D", "b": [0.8286, 0.7292, 0.8594, 0.7489]}, {"w": "convnets,", "b": [0.1294, 0.7497, 0.2254, 0.7695]}, {"w": "this", "b": [0.2317, 0.7497, 0.2682, 0.7695]}, {"w": "is", "b": [0.2745, 0.7497, 0.2913, 0.7695]}, {"w": "used", "b": [0.2976, 0.7497, 0.3438, 0.7695]}, {"w": "for", "b": [0.3501, 0.7497, 0.3795, 0.7695]}, {"w": "reducing", "b": [0.3858, 0.7497, 0.4741, 0.7695]}, {"w": "the", "b": [0.4804, 0.7497, 0.5112, 0.7695]}, {"w": "length", "b": [0.5175, 0.7497, 0.5806, 0.7695]}, {"w": "of", "b": [0.5869, 0.7497, 0.6079, 0.7695]}, {"w": "1D", "b": [0.6142, 0.7497, 0.6451, 0.7695]}, {"w": "inputs", "b": [0.6514, 0.7497, 0.713, 0.7695]}, {"w": "(subsampling).", "b": [0.7193, 0.7497, 0.87, 0.7695]}]}, {"id": "b_3", "type": "paragraph", "text": "6.4.3. Implementing a 1D convnet", "words": [{"w": "6.4.3.", "b": [0.1294, 0.7969, 0.1862, 0.8167]}, {"w": "Implementing", "b": [0.1925, 0.7969, 0.3438, 0.8167]}, {"w": "a", "b": [0.3501, 0.7969, 0.3628, 0.8167]}, {"w": "1D", "b": [0.3691, 0.7969, 0.3999, 0.8167]}, {"w": "convnet", "b": [0.4062, 0.7969, 0.4903, 0.8167]}]}, {"id": "b_4", "type": "paragraph", "text": "In Keras, you use a 1D convnet via the Conv1D layer, which has an interface similar to Conv2D. It takes as input 3D tensors with shape (samples, time, features) and returns similarly shaped 3D", "words": [{"w": "In", "b": [0.1294, 0.8397, 0.1504, 0.8595]}, {"w": "Keras,", "b": [0.1567, 0.8397, 0.2219, 0.8595]}, {"w": "you", "b": [0.2282, 0.8397, 0.266, 0.8595]}, {"w": "use", "b": [0.2723, 0.8397, 0.3059, 0.8595]}, {"w": "a", "b": [0.3122, 0.8397, 0.3234, 0.8595]}, {"w": "1D", "b": [0.3298, 0.8397, 0.3606, 0.8595]}, {"w": "convnet", "b": [0.3669, 0.8397, 0.4468, 0.8595]}, {"w": "via", "b": [0.4531, 0.8397, 0.4839, 0.8595]}, {"w": "the", "b": [0.4902, 0.8397, 0.521, 0.8595]}, {"w": "Conv1D", "b": [0.5273, 0.8408, 0.6181, 0.861]}, {"w": "layer,", "b": [0.6244, 0.8397, 0.6801, 0.8595]}, {"w": "which", "b": [0.6864, 0.8397, 0.7481, 0.8595]}, {"w": "has", "b": [0.7544, 0.8397, 0.788, 0.8595]}, {"w": "an", "b": [0.7943, 0.8397, 0.8181, 0.8595]}, {"w": "interface", "b": [0.1294, 0.8611, 0.2177, 0.8809]}, {"w": "similar", "b": [0.224, 0.8611, 0.294, 0.8809]}, {"w": "to", "b": [0.3003, 0.8611, 0.32, 0.8809]}, {"w": "Conv2D.", "b": [0.3262, 0.8611, 0.4233, 0.8824]}, {"w": "It", "b": [0.4296, 0.8611, 0.4451, 0.8809]}, {"w": "takes", "b": [0.4514, 0.8611, 0.5032, 0.8809]}, {"w": "as", "b": [0.5095, 0.8611, 0.5305, 0.8809]}, {"w": "input", "b": [0.5368, 0.8611, 0.5887, 0.8809]}, {"w": "3D", "b": [0.595, 0.8611, 0.6258, 0.8809]}, {"w": "tensors", "b": [0.6321, 0.8611, 0.7036, 0.8809]}, {"w": "with", "b": [0.7099, 0.8611, 0.7547, 0.8809]}, {"w": "shape", "b": [0.7611, 0.8611, 0.8185, 0.8809]}, {"w": "(samples,", "b": [0.1294, 0.8836, 0.2656, 0.9038]}, {"w": "time,", "b": [0.2808, 0.8836, 0.3564, 0.9038]}, {"w": "features)", "b": [0.3716, 0.8836, 0.5078, 0.9038]}, {"w": "and", "b": [0.5142, 0.8825, 0.5506, 0.9023]}, {"w": "returns", "b": [0.5569, 0.8825, 0.6269, 0.9023]}, {"w": "similarly", "b": [0.6333, 0.8825, 0.723, 0.9023]}, {"w": "shaped", "b": [0.7293, 0.8825, 0.7993, 0.9023]}, {"w": "3D", "b": [0.8056, 0.8825, 0.8364, 0.9023]}]}]}, {"page": 297, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "tensors. The convolution window is a 1D window on the temporal axis: axis 1 in the input tensor.", "words": [{"w": "tensors.", "b": [0.1294, 0.0857, 0.2072, 0.1054]}, {"w": "The", "b": [0.2135, 0.0857, 0.2527, 0.1054]}, {"w": "convolution", "b": [0.259, 0.0857, 0.3796, 0.1054]}, {"w": "window", "b": [0.3859, 0.0857, 0.4671, 0.1054]}, {"w": "is", "b": [0.4734, 0.0857, 0.4903, 0.1054]}, {"w": "a", "b": [0.4966, 0.0857, 0.5078, 0.1054]}, {"w": "1D", "b": [0.5141, 0.0857, 0.5449, 0.1054]}, {"w": "window", "b": [0.5512, 0.0857, 0.6325, 0.1054]}, {"w": "on", "b": [0.6388, 0.0857, 0.664, 0.1054]}, {"w": "the", "b": [0.6703, 0.0857, 0.7012, 0.1054]}, {"w": "temporal", "b": [0.7075, 0.0857, 0.7971, 0.1054]}, {"w": "axis:", "b": [0.8034, 0.0857, 0.8511, 0.1054]}, {"w": "axis", "b": [0.1294, 0.1062, 0.1701, 0.1259]}, {"w": "1", "b": [0.1764, 0.1062, 0.189, 0.1259]}, {"w": "in", "b": [0.1953, 0.1062, 0.2149, 0.1259]}, {"w": "the", "b": [0.2212, 0.1062, 0.252, 0.1259]}, {"w": "input", "b": [0.2583, 0.1062, 0.3102, 0.1259]}, {"w": "tensor.", "b": [0.3165, 0.1062, 0.383, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s build a simple two-layer 1D convnet and apply it to the IMDB sentiment--classification task you’re already familiar with. As a reminder, this is the code for obtaining and preprocessing the data.", "words": [{"w": "Let’s", "b": [0.1294, 0.149, 0.1798, 0.1687]}, {"w": "build", "b": [0.1862, 0.149, 0.238, 0.1687]}, {"w": "a", "b": [0.2443, 0.149, 0.2555, 0.1687]}, {"w": "simple", "b": [0.2618, 0.149, 0.3291, 0.1687]}, {"w": "two-layer", "b": [0.3354, 0.149, 0.4321, 0.1687]}, {"w": "1D", "b": [0.4384, 0.149, 0.4692, 0.1687]}, {"w": "convnet", "b": [0.4755, 0.149, 0.5554, 0.1687]}, {"w": "and", "b": [0.5617, 0.149, 0.5981, 0.1687]}, {"w": "apply", "b": [0.6044, 0.149, 0.6605, 0.1687]}, {"w": "it", "b": [0.6668, 0.149, 0.6808, 0.1687]}, {"w": "to", "b": [0.6871, 0.149, 0.7067, 0.1687]}, {"w": "the", "b": [0.713, 0.149, 0.7439, 0.1687]}, {"w": "IMDB", "b": [0.7502, 0.149, 0.816, 0.1687]}, {"w": "sentiment--classification", "b": [0.1294, 0.1695, 0.3774, 0.1892]}, {"w": "task", "b": [0.3837, 0.1695, 0.4244, 0.1892]}, {"w": "you’re", "b": [0.4307, 0.1695, 0.4965, 0.1892]}, {"w": "already", "b": [0.5028, 0.1695, 0.5771, 0.1892]}, {"w": "familiar", "b": [0.5834, 0.1695, 0.6632, 0.1892]}, {"w": "with.", "b": [0.6694, 0.1695, 0.7206, 0.1892]}, {"w": "As", "b": [0.7269, 0.1695, 0.7549, 0.1892]}, {"w": "a", "b": [0.7612, 0.1695, 0.7724, 0.1892]}, {"w": "reminder,", "b": [0.1294, 0.19, 0.2258, 0.2097]}, {"w": "this", "b": [0.2321, 0.19, 0.2685, 0.2097]}, {"w": "is", "b": [0.2748, 0.19, 0.2916, 0.2097]}, {"w": "the", "b": [0.298, 0.19, 0.3288, 0.2097]}, {"w": "code", "b": [0.3351, 0.19, 0.3827, 0.2097]}, {"w": "for", "b": [0.389, 0.19, 0.4184, 0.2097]}, {"w": "obtaining", "b": [0.4247, 0.19, 0.52, 0.2097]}, {"w": "and", "b": [0.5263, 0.19, 0.5628, 0.2097]}, {"w": "preprocessing", "b": [0.5691, 0.19, 0.7092, 0.2097]}, {"w": "the", "b": [0.7155, 0.19, 0.7463, 0.2097]}, {"w": "data.", "b": [0.7526, 0.19, 0.801, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.45. Preparing the IMDB data", "words": [{"w": "Listing", "b": [0.1294, 0.2278, 0.1862, 0.2426]}, {"w": "6.45.", "b": [0.1909, 0.2278, 0.2288, 0.2426]}, {"w": "Preparing", "b": [0.2335, 0.2278, 0.3151, 0.2426]}, {"w": "the", "b": [0.3198, 0.2278, 0.345, 0.2426]}, {"w": "IMDB", "b": [0.3498, 0.2278, 0.4013, 0.2426]}, {"w": "data", "b": [0.406, 0.2278, 0.4417, 0.2426]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.datasets import imdb from keras.preprocessing import sequence max_features = 10000 max_len = 500 print('Loading data...') (x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=max_features) print(len(x_train), 'train sequences') print(len(x_test), 'test sequences') print('Pad sequences (samples x time)') x_train = sequence.pad_sequences(x_train, maxlen=max_len) x_test = sequence.pad_sequences(x_test, maxlen=max_len) print('x_train shape:', x_train.shape) print('x_test shape:', x_test.shape)", "words": [{"w": "from", "b": [0.1357, 0.2562, 0.1811, 0.2714]}, {"w": "keras.datasets", "b": [0.1925, 0.2562, 0.3514, 0.2714]}, {"w": "import", "b": [0.3628, 0.2562, 0.4309, 0.2714]}, {"w": "imdb", "b": [0.4422, 0.2562, 0.4876, 0.2714]}, {"w": "from", "b": [0.1357, 0.2714, 0.1811, 0.2865]}, {"w": "keras.preprocessing", "b": [0.1925, 0.2714, 0.4082, 0.2865]}, {"w": "import", "b": [0.4195, 0.2714, 0.4876, 0.2865]}, {"w": "sequence", "b": [0.499, 0.2714, 0.5898, 0.2865]}, {"w": "max_features", "b": [0.1357, 0.3017, 0.2719, 0.3168]}, {"w": "=", "b": [0.2833, 0.3017, 0.2946, 0.3168]}, {"w": "10000", "b": [0.306, 0.3017, 0.3628, 0.3168]}, {"w": "max_len", "b": [0.1357, 0.3168, 0.2152, 0.332]}, {"w": "=", "b": [0.2265, 0.3168, 0.2379, 0.332]}, {"w": "500", "b": [0.2492, 0.3168, 0.2833, 0.332]}, {"w": "print('Loading", "b": [0.1357, 0.3471, 0.2946, 0.3623]}, {"w": "data...')", "b": [0.306, 0.3471, 0.4082, 0.3623]}, {"w": "(x_train,", "b": [0.1357, 0.3623, 0.2379, 0.3774]}, {"w": "y_train),", "b": [0.2492, 0.3623, 0.3514, 0.3774]}, {"w": "(x_test,", "b": [0.3628, 0.3623, 0.4536, 0.3774]}, {"w": "y_test)", "b": [0.4649, 0.3623, 0.5444, 0.3774]}, {"w": "=", "b": [0.5557, 0.3623, 0.5671, 0.3774]}, {"w": "imdb.load_data(num_words=max_features)", "b": [0.1357, 0.3774, 0.5671, 0.3926]}, {"w": "print(len(x_train),", "b": [0.1357, 0.3926, 0.3514, 0.4077]}, {"w": "'train", "b": [0.3628, 0.3926, 0.4309, 0.4077]}, {"w": "sequences')", "b": [0.4422, 0.3926, 0.5671, 0.4077]}, {"w": "print(len(x_test),", "b": [0.1357, 0.4077, 0.34, 0.4229]}, {"w": "'test", "b": [0.3514, 0.4077, 0.4082, 0.4229]}, {"w": "sequences')", "b": [0.4195, 0.4077, 0.5444, 0.4229]}, {"w": "print('Pad", "b": [0.1357, 0.438, 0.2492, 0.4532]}, {"w": "sequences", "b": [0.2606, 0.438, 0.3628, 0.4532]}, {"w": "(samples", "b": [0.3741, 0.438, 0.4649, 0.4532]}, {"w": "x", "b": [0.4763, 0.438, 0.4876, 0.4532]}, {"w": "time)')", "b": [0.499, 0.438, 0.5784, 0.4532]}, {"w": "x_train", "b": [0.1357, 0.4532, 0.2152, 0.4683]}, {"w": "=", "b": [0.2265, 0.4532, 0.2379, 0.4683]}, {"w": "sequence.pad_sequences(x_train,", "b": [0.2492, 0.4532, 0.6011, 0.4683]}, {"w": "maxlen=max_len)", "b": [0.6125, 0.4532, 0.7828, 0.4683]}, {"w": "x_test", "b": [0.1357, 0.4683, 0.2038, 0.4835]}, {"w": "=", "b": [0.2152, 0.4683, 0.2265, 0.4835]}, {"w": "sequence.pad_sequences(x_test,", "b": [0.2379, 0.4683, 0.5784, 0.4835]}, {"w": "maxlen=max_len)", "b": [0.5898, 0.4683, 0.7601, 0.4835]}, {"w": "print('x_train", "b": [0.1357, 0.4835, 0.2946, 0.4986]}, {"w": "shape:',", "b": [0.306, 0.4835, 0.3968, 0.4986]}, {"w": "x_train.shape)", "b": [0.4082, 0.4835, 0.5671, 0.4986]}, {"w": "print('x_test", "b": [0.1357, 0.4987, 0.2833, 0.5138]}, {"w": "shape:',", "b": [0.2946, 0.4987, 0.3855, 0.5138]}, {"w": "x_test.shape)", "b": [0.3968, 0.4987, 0.5444, 0.5138]}]}, {"id": "b_4", "type": "paragraph", "text": "1D convnets are structured in the same way as their 2D counterparts, which you used in chapter 5: they consist of a stack of Conv1D and MaxPooling1D layers, ending in either a global pooling layer or a Flatten layer, that turn the 3D outputs into 2D outputs, allowing you to add one or more Dense layers to the model for classification or regression.", "words": [{"w": "1D", "b": [0.1294, 0.5367, 0.1602, 0.5564]}, {"w": "convnets", "b": [0.1665, 0.5367, 0.2562, 0.5564]}, {"w": "are", "b": [0.2625, 0.5367, 0.2933, 0.5564]}, {"w": "structured", "b": [0.2996, 0.5367, 0.4005, 0.5564]}, {"w": "in", "b": [0.4068, 0.5367, 0.4264, 0.5564]}, {"w": "the", "b": [0.4328, 0.5367, 0.4636, 0.5564]}, {"w": "same", "b": [0.4699, 0.5367, 0.5217, 0.5564]}, {"w": "way", "b": [0.528, 0.5367, 0.5701, 0.5564]}, {"w": "as", "b": [0.5764, 0.5367, 0.5974, 0.5564]}, {"w": "their", "b": [0.6037, 0.5367, 0.6499, 0.5564]}, {"w": "2D", "b": [0.6562, 0.5367, 0.6871, 0.5564]}, {"w": "counterparts,", "b": [0.6934, 0.5367, 0.8244, 0.5564]}, {"w": "which", "b": [0.1294, 0.5572, 0.1911, 0.5769]}, {"w": "you", "b": [0.1974, 0.5572, 0.2352, 0.5769]}, {"w": "used", "b": [0.2415, 0.5572, 0.2878, 0.5769]}, {"w": "in", "b": [0.2941, 0.5572, 0.3137, 0.5769]}, {"w": "chapter", "b": [0.32, 0.5572, 0.3942, 0.5769]}, {"w": "5:", "b": [0.4005, 0.5572, 0.4201, 0.5769]}, {"w": "they", "b": [0.4264, 0.5572, 0.4699, 0.5769]}, {"w": "consist", "b": [0.4762, 0.5572, 0.5463, 0.5769]}, {"w": "of", "b": [0.5526, 0.5572, 0.5736, 0.5769]}, {"w": "a", "b": [0.5799, 0.5572, 0.5911, 0.5769]}, {"w": "stack", "b": [0.5974, 0.5572, 0.6492, 0.5769]}, {"w": "of", "b": [0.6555, 0.5572, 0.6766, 0.5769]}, {"w": "Conv1D", "b": [0.6828, 0.5582, 0.7736, 0.5784]}, {"w": "and", "b": [0.7799, 0.5572, 0.8164, 0.5769]}, {"w": "MaxPooling1D", "b": [0.1294, 0.5796, 0.311, 0.5998]}, {"w": "layers,", "b": [0.3174, 0.5786, 0.3839, 0.5983]}, {"w": "ending", "b": [0.3902, 0.5786, 0.4589, 0.5983]}, {"w": "in", "b": [0.4652, 0.5786, 0.4848, 0.5983]}, {"w": "either", "b": [0.4911, 0.5786, 0.5486, 0.5983]}, {"w": "a", "b": [0.5549, 0.5786, 0.5661, 0.5983]}, {"w": "global", "b": [0.5724, 0.5786, 0.6354, 0.5983]}, {"w": "pooling", "b": [0.6417, 0.5786, 0.7188, 0.5983]}, {"w": "layer", "b": [0.7251, 0.5786, 0.7756, 0.5983]}, {"w": "or", "b": [0.7819, 0.5786, 0.8029, 0.5983]}, {"w": "a", "b": [0.8092, 0.5786, 0.8204, 0.5983]}, {"w": "Flatten", "b": [0.1294, 0.601, 0.2354, 0.6212]}, {"w": "layer,", "b": [0.2417, 0.6, 0.2974, 0.6197]}, {"w": "that", "b": [0.3037, 0.6, 0.3415, 0.6197]}, {"w": "turn", "b": [0.3478, 0.6, 0.3885, 0.6197]}, {"w": "the", "b": [0.3948, 0.6, 0.4256, 0.6197]}, {"w": "3D", "b": [0.4319, 0.6, 0.4627, 0.6197]}, {"w": "outputs", "b": [0.469, 0.6, 0.5433, 0.6197]}, {"w": "into", "b": [0.5496, 0.6, 0.5889, 0.6197]}, {"w": "2D", "b": [0.5952, 0.6, 0.626, 0.6197]}, {"w": "outputs,", "b": [0.6323, 0.6, 0.7129, 0.6197]}, {"w": "allowing", "b": [0.7192, 0.6, 0.8075, 0.6197]}, {"w": "you", "b": [0.8138, 0.6, 0.8517, 0.6197]}, {"w": "to", "b": [0.1294, 0.6214, 0.149, 0.6411]}, {"w": "add", "b": [0.1553, 0.6214, 0.1918, 0.6411]}, {"w": "one", "b": [0.1981, 0.6214, 0.2345, 0.6411]}, {"w": "or", "b": [0.2408, 0.6214, 0.2618, 0.6411]}, {"w": "more", "b": [0.2681, 0.6214, 0.32, 0.6411]}, {"w": "Dense", "b": [0.3263, 0.6224, 0.4019, 0.6426]}, {"w": "layers", "b": [0.4082, 0.6214, 0.4685, 0.6411]}, {"w": "to", "b": [0.4748, 0.6214, 0.4944, 0.6411]}, {"w": "the", "b": [0.5007, 0.6214, 0.5315, 0.6411]}, {"w": "model", "b": [0.5378, 0.6214, 0.6009, 0.6411]}, {"w": "for", "b": [0.6072, 0.6214, 0.6366, 0.6411]}, {"w": "classification", "b": [0.6429, 0.6214, 0.7761, 0.6411]}, {"w": "or", "b": [0.7824, 0.6214, 0.8034, 0.6411]}, {"w": "regression.", "b": [0.1294, 0.6428, 0.2394, 0.6625]}]}, {"id": "b_5", "type": "paragraph", "text": "One difference, though, is the fact that you can afford to use larger convolution windows with 1D convnets. With a 2D convolution layer, a 3 × 3 convolution window contains 3 × 3 = 9 feature vectors; but with a 1D convolution layer, a convolution window of size 3 contains only 3 feature vectors. You can thus easily afford 1D convolution windows of size 7 or 9.", "words": [{"w": "One", "b": [0.1294, 0.6855, 0.1714, 0.7053]}, {"w": "difference,", "b": [0.1777, 0.6855, 0.2858, 0.7053]}, {"w": "though,", "b": [0.2921, 0.6855, 0.3685, 0.7053]}, {"w": "is", "b": [0.3748, 0.6855, 0.3917, 0.7053]}, {"w": "the", "b": [0.398, 0.6855, 0.4288, 0.7053]}, {"w": "fact", "b": [0.4351, 0.6855, 0.4729, 0.7053]}, {"w": "that", "b": [0.4792, 0.6855, 0.5171, 0.7053]}, {"w": "you", "b": [0.5234, 0.6855, 0.5612, 0.7053]}, {"w": "can", "b": [0.5675, 0.6855, 0.6025, 0.7053]}, {"w": "afford", "b": [0.6088, 0.6855, 0.6699, 0.7053]}, {"w": "to", "b": [0.6762, 0.6855, 0.6959, 0.7053]}, {"w": "use", "b": [0.7022, 0.6855, 0.7358, 0.7053]}, {"w": "larger", "b": [0.7421, 0.6855, 0.8005, 0.7053]}, {"w": "convolution", "b": [0.1294, 0.706, 0.2499, 0.7258]}, {"w": "windows", "b": [0.2562, 0.706, 0.3473, 0.7258]}, {"w": "with", "b": [0.3536, 0.706, 0.3985, 0.7258]}, {"w": "1D", "b": [0.4048, 0.706, 0.4356, 0.7258]}, {"w": "convnets.", "b": [0.4419, 0.706, 0.5379, 0.7258]}, {"w": "With", "b": [0.5442, 0.706, 0.5936, 0.7258]}, {"w": "a", "b": [0.6, 0.706, 0.6112, 0.7258]}, {"w": "2D", "b": [0.6175, 0.706, 0.6483, 0.7258]}, {"w": "convolution", "b": [0.6546, 0.706, 0.7751, 0.7258]}, {"w": "layer,", "b": [0.7814, 0.706, 0.8371, 0.7258]}, {"w": "a", "b": [0.8434, 0.706, 0.8546, 0.7258]}, {"w": "3", "b": [0.1294, 0.7265, 0.142, 0.7463]}, {"w": "×", "b": [0.1483, 0.7265, 0.1626, 0.7463]}, {"w": "3", "b": [0.1689, 0.7265, 0.1815, 0.7463]}, {"w": "convolution", "b": [0.1878, 0.7265, 0.3083, 0.7463]}, {"w": "window", "b": [0.3146, 0.7265, 0.3959, 0.7463]}, {"w": "contains", "b": [0.4022, 0.7265, 0.4863, 0.7463]}, {"w": "3", "b": [0.4926, 0.7265, 0.5052, 0.7463]}, {"w": "×", "b": [0.5115, 0.7265, 0.5257, 0.7463]}, {"w": "3", "b": [0.532, 0.7265, 0.5447, 0.7463]}, {"w": "=", "b": [0.551, 0.7265, 0.5652, 0.7463]}, {"w": "9", "b": [0.5715, 0.7265, 0.5841, 0.7463]}, {"w": "feature", "b": [0.5904, 0.7265, 0.6604, 0.7463]}, {"w": "vectors;", "b": [0.6667, 0.7265, 0.7466, 0.7463]}, {"w": "but", "b": [0.7529, 0.7265, 0.7852, 0.7463]}, {"w": "with", "b": [0.7915, 0.7265, 0.8363, 0.7463]}, {"w": "a", "b": [0.8426, 0.7265, 0.8538, 0.7463]}, {"w": "1D", "b": [0.1294, 0.747, 0.1602, 0.7668]}, {"w": "convolution", "b": [0.1665, 0.747, 0.2871, 0.7668]}, {"w": "layer,", "b": [0.2934, 0.747, 0.3491, 0.7668]}, {"w": "a", "b": [0.3554, 0.747, 0.3666, 0.7668]}, {"w": "convolution", "b": [0.3729, 0.747, 0.4934, 0.7668]}, {"w": "window", "b": [0.4997, 0.747, 0.581, 0.7668]}, {"w": "of", "b": [0.5873, 0.747, 0.6083, 0.7668]}, {"w": "size", "b": [0.6146, 0.747, 0.6538, 0.7668]}, {"w": "3", "b": [0.6601, 0.747, 0.6727, 0.7668]}, {"w": "contains", "b": [0.6791, 0.747, 0.7631, 0.7668]}, {"w": "only", "b": [0.7694, 0.747, 0.8143, 0.7668]}, {"w": "3", "b": [0.8206, 0.747, 0.8332, 0.7668]}, {"w": "feature", "b": [0.1294, 0.7675, 0.1994, 0.7873]}, {"w": "vectors.", "b": [0.2057, 0.7675, 0.2849, 0.7873]}, {"w": "You", "b": [0.2912, 0.7675, 0.3321, 0.7873]}, {"w": "can", "b": [0.3384, 0.7675, 0.3734, 0.7873]}, {"w": "thus", "b": [0.3797, 0.7675, 0.4218, 0.7873]}, {"w": "easily", "b": [0.4281, 0.7675, 0.4869, 0.7873]}, {"w": "afford", "b": [0.4932, 0.7675, 0.5544, 0.7873]}, {"w": "1D", "b": [0.5607, 0.7675, 0.5915, 0.7873]}, {"w": "convolution", "b": [0.5978, 0.7675, 0.7184, 0.7873]}, {"w": "windows", "b": [0.7247, 0.7675, 0.8158, 0.7873]}, {"w": "of", "b": [0.8221, 0.7675, 0.8431, 0.7873]}, {"w": "size", "b": [0.1294, 0.788, 0.1686, 0.8078]}, {"w": "7", "b": [0.1749, 0.788, 0.1876, 0.8078]}, {"w": "or", "b": [0.1939, 0.788, 0.2149, 0.8078]}, {"w": "9.", "b": [0.2212, 0.788, 0.2401, 0.8078]}]}, {"id": "b_6", "type": "paragraph", "text": "This is the example 1D convnet for the IMDB dataset.", "words": [{"w": "This", "b": [0.1294, 0.8308, 0.1743, 0.8506]}, {"w": "is", "b": [0.1806, 0.8308, 0.1974, 0.8506]}, {"w": "the", "b": [0.2037, 0.8308, 0.2345, 0.8506]}, {"w": "example", "b": [0.2408, 0.8308, 0.3263, 0.8506]}, {"w": "1D", "b": [0.3326, 0.8308, 0.3634, 0.8506]}, {"w": "convnet", "b": [0.3697, 0.8308, 0.4496, 0.8506]}, {"w": "for", "b": [0.4559, 0.8308, 0.4853, 0.8506]}, {"w": "the", "b": [0.4916, 0.8308, 0.5225, 0.8506]}, {"w": "IMDB", "b": [0.5288, 0.8308, 0.5946, 0.8506]}, {"w": "dataset.", "b": [0.6009, 0.8308, 0.6773, 0.8506]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 6.46. Training and evaluating a simple 1D convnet on the IMDB data", "words": [{"w": "Listing", "b": [0.1294, 0.8687, 0.1862, 0.8835]}, {"w": "6.46.", "b": [0.1909, 0.8687, 0.2288, 0.8835]}, {"w": "Training", "b": [0.2335, 0.8687, 0.3036, 0.8835]}, {"w": "and", "b": [0.3083, 0.8687, 0.3388, 0.8835]}, {"w": "evaluating", "b": [0.3435, 0.8687, 0.4276, 0.8835]}, {"w": "a", "b": [0.4323, 0.8687, 0.4418, 0.8835]}, {"w": "simple", "b": [0.4465, 0.8687, 0.4991, 0.8835]}, {"w": "1D", "b": [0.5038, 0.8687, 0.5269, 0.8835]}, {"w": "convnet", "b": [0.5317, 0.8687, 0.5947, 0.8835]}, {"w": "on", "b": [0.5995, 0.8687, 0.6194, 0.8835]}, {"w": "the", "b": [0.6242, 0.8687, 0.6494, 0.8835]}, {"w": "IMDB", "b": [0.6541, 0.8687, 0.7056, 0.8835]}, {"w": "data", "b": [0.7103, 0.8687, 0.7461, 0.8835]}]}]}, {"page": 298, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential() model.add(layers.Embedding(max_features, 128, input_length=max_len)) model.add(layers.Conv1D(32, 7, activation='relu')) model.add(layers.MaxPooling1D(5)) model.add(layers.Conv1D(32, 7, activation='relu')) model.add(layers.GlobalMaxPooling1D()) model.add(layers.Dense(1)) model.summary() model.compile(optimizer=RMSprop(lr=1e-4), loss='binary_crossentropy', metrics=['acc']) history = model.fit(x_train, y_train, epochs=10, batch_size=128, validation_split=0.2)", "words": [{"w": "from", "b": [0.1357, 0.0851, 0.1811, 0.1002]}, {"w": "keras.models", "b": [0.1925, 0.0851, 0.3287, 0.1002]}, {"w": "import", "b": [0.34, 0.0851, 0.4082, 0.1002]}, {"w": "Sequential", "b": [0.4195, 0.0851, 0.533, 0.1002]}, {"w": "from", "b": [0.1357, 0.1002, 0.1811, 0.1154]}, {"w": "keras", "b": [0.1925, 0.1002, 0.2492, 0.1154]}, {"w": "import", "b": [0.2606, 0.1002, 0.3287, 0.1154]}, {"w": "layers", "b": [0.34, 0.1002, 0.4082, 0.1154]}, {"w": "from", "b": [0.1357, 0.1154, 0.1811, 0.1305]}, {"w": "keras.optimizers", "b": [0.1925, 0.1154, 0.3741, 0.1305]}, {"w": "import", "b": [0.3855, 0.1154, 0.4536, 0.1305]}, {"w": "RMSprop", "b": [0.4649, 0.1154, 0.5444, 0.1305]}, {"w": "model", "b": [0.1357, 0.1457, 0.1925, 0.1608]}, {"w": "=", "b": [0.2038, 0.1457, 0.2152, 0.1608]}, {"w": "Sequential()", "b": [0.2265, 0.1457, 0.3628, 0.1608]}, {"w": "model.add(layers.Embedding(max_features,", "b": [0.1357, 0.1608, 0.5898, 0.176]}, {"w": "128,", "b": [0.6011, 0.1608, 0.6465, 0.176]}, {"w": "input_length=max_len))", "b": [0.1357, 0.176, 0.3855, 0.1911]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.1912, 0.4422, 0.2063]}, {"w": "7,", "b": [0.4536, 0.1912, 0.4763, 0.2063]}, {"w": "activation='relu'))", "b": [0.4876, 0.1912, 0.7033, 0.2063]}, {"w": "model.add(layers.MaxPooling1D(5))", "b": [0.1357, 0.2063, 0.5103, 0.2214]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.2215, 0.4422, 0.2366]}, {"w": "7,", "b": [0.4536, 0.2215, 0.4763, 0.2366]}, {"w": "activation='relu'))", "b": [0.4876, 0.2215, 0.7033, 0.2366]}, {"w": "model.add(layers.GlobalMaxPooling1D())", "b": [0.1357, 0.2366, 0.5671, 0.2518]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.2518, 0.4309, 0.2669]}, {"w": "model.summary()", "b": [0.1357, 0.2821, 0.306, 0.2972]}, {"w": "model.compile(optimizer=RMSprop(lr=1e-4),", "b": [0.1357, 0.3124, 0.6011, 0.3275]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.3275, 0.6011, 0.3427]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.3427, 0.4763, 0.3578]}, {"w": "history", "b": [0.1357, 0.3578, 0.2152, 0.373]}, {"w": "=", "b": [0.2265, 0.3578, 0.2379, 0.373]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.3578, 0.4536, 0.373]}, {"w": "y_train,", "b": [0.4649, 0.3578, 0.5557, 0.373]}, {"w": "epochs=10,", "b": [0.3628, 0.373, 0.4763, 0.3881]}, {"w": "batch_size=128,", "b": [0.3628, 0.3881, 0.533, 0.4033]}, {"w": "validation_split=0.2)", "b": [0.3628, 0.4033, 0.6011, 0.4184]}]}, {"id": "b_1", "type": "paragraph", "text": "Figures 6.27 and 6.28 show the training and validation results. Validation accuracy is somewhat less than that of the LSTM, but runtime is faster on both CPU and GPU (the exact increase in speed will vary greatly depending on your exact configuration). At this point, you could retrain this model for the right number of epochs (eight) and run it on the test set. This is a convincing demonstration that a 1D convnet can offer a fast, cheap alternative to a recurrent network on a word-level sentiment- classification task.", "words": [{"w": "Figures", "b": [0.1294, 0.4413, 0.2051, 0.4611]}, {"w": "6.27", "b": [0.2114, 0.4413, 0.2555, 0.4611]}, {"w": "and", "b": [0.2618, 0.4413, 0.2983, 0.4611]}, {"w": "6.28", "b": [0.3046, 0.4413, 0.3487, 0.4611]}, {"w": "show", "b": [0.355, 0.4413, 0.4083, 0.4611]}, {"w": "the", "b": [0.4146, 0.4413, 0.4454, 0.4611]}, {"w": "training", "b": [0.4517, 0.4413, 0.5302, 0.4611]}, {"w": "and", "b": [0.5365, 0.4413, 0.5729, 0.4611]}, {"w": "validation", "b": [0.5792, 0.4413, 0.6801, 0.4611]}, {"w": "results.", "b": [0.6864, 0.4413, 0.7586, 0.4611]}, {"w": "Validation", "b": [0.7649, 0.4413, 0.8686, 0.4611]}, {"w": "accuracy", "b": [0.1294, 0.4618, 0.219, 0.4816]}, {"w": "is", "b": [0.2253, 0.4618, 0.2422, 0.4816]}, {"w": "somewhat", "b": [0.2485, 0.4618, 0.3508, 0.4816]}, {"w": "less", "b": [0.3571, 0.4618, 0.3949, 0.4816]}, {"w": "than", "b": [0.4012, 0.4618, 0.4447, 0.4816]}, {"w": "that", "b": [0.451, 0.4618, 0.4888, 0.4816]}, {"w": "of", "b": [0.4951, 0.4618, 0.5161, 0.4816]}, {"w": "the", "b": [0.5224, 0.4618, 0.5533, 0.4816]}, {"w": "LSTM,", "b": [0.5595, 0.4618, 0.6263, 0.4831]}, {"w": "but", "b": [0.6326, 0.4618, 0.6649, 0.4816]}, {"w": "runtime", "b": [0.6712, 0.4618, 0.7497, 0.4816]}, {"w": "is", "b": [0.756, 0.4618, 0.7728, 0.4816]}, {"w": "faster", "b": [0.7791, 0.4618, 0.8351, 0.4816]}, {"w": "on", "b": [0.8414, 0.4618, 0.8667, 0.4816]}, {"w": "both", "b": [0.1294, 0.4832, 0.1743, 0.5029]}, {"w": "CPU", "b": [0.1806, 0.4832, 0.2296, 0.5029]}, {"w": "and", "b": [0.2359, 0.4832, 0.2724, 0.5029]}, {"w": "GPU", "b": [0.2787, 0.4832, 0.3291, 0.5029]}, {"w": "(the", "b": [0.3354, 0.4832, 0.3747, 0.5029]}, {"w": "exact", "b": [0.381, 0.4832, 0.4342, 0.5029]}, {"w": "increase", "b": [0.4405, 0.4832, 0.5231, 0.5029]}, {"w": "in", "b": [0.5294, 0.4832, 0.5491, 0.5029]}, {"w": "speed", "b": [0.5554, 0.4832, 0.6128, 0.5029]}, {"w": "will", "b": [0.6191, 0.4832, 0.6584, 0.5029]}, {"w": "vary", "b": [0.6647, 0.4832, 0.7095, 0.5029]}, {"w": "greatly", "b": [0.7158, 0.4832, 0.7859, 0.5029]}, {"w": "depending", "b": [0.1294, 0.5037, 0.2345, 0.5234]}, {"w": "on", "b": [0.2408, 0.5037, 0.266, 0.5234]}, {"w": "your", "b": [0.2723, 0.5037, 0.3186, 0.5234]}, {"w": "exact", "b": [0.3249, 0.5037, 0.3781, 0.5234]}, {"w": "configuration).", "b": [0.3844, 0.5037, 0.535, 0.5234]}, {"w": "At", "b": [0.5413, 0.5037, 0.5665, 0.5234]}, {"w": "this", "b": [0.5728, 0.5037, 0.6093, 0.5234]}, {"w": "point,", "b": [0.6156, 0.5037, 0.6738, 0.5234]}, {"w": "you", "b": [0.6801, 0.5037, 0.7179, 0.5234]}, {"w": "could", "b": [0.7242, 0.5037, 0.7803, 0.5234]}, {"w": "retrain", "b": [0.7866, 0.5037, 0.8524, 0.5234]}, {"w": "this", "b": [0.1294, 0.5242, 0.1659, 0.5439]}, {"w": "model", "b": [0.1722, 0.5242, 0.2352, 0.5439]}, {"w": "for", "b": [0.2415, 0.5242, 0.271, 0.5439]}, {"w": "the", "b": [0.2773, 0.5242, 0.3081, 0.5439]}, {"w": "right", "b": [0.3144, 0.5242, 0.362, 0.5439]}, {"w": "number", "b": [0.3684, 0.5242, 0.4454, 0.5439]}, {"w": "of", "b": [0.4517, 0.5242, 0.4727, 0.5439]}, {"w": "epochs", "b": [0.479, 0.5242, 0.5491, 0.5439]}, {"w": "(eight)", "b": [0.5554, 0.5242, 0.6227, 0.5439]}, {"w": "and", "b": [0.629, 0.5242, 0.6654, 0.5439]}, {"w": "run", "b": [0.6717, 0.5242, 0.7053, 0.5439]}, {"w": "it", "b": [0.7116, 0.5242, 0.7256, 0.5439]}, {"w": "on", "b": [0.732, 0.5242, 0.7572, 0.5439]}, {"w": "the", "b": [0.7635, 0.5242, 0.7943, 0.5439]}, {"w": "test", "b": [0.8006, 0.5242, 0.8357, 0.5439]}, {"w": "set.", "b": [0.1294, 0.5447, 0.1637, 0.5644]}, {"w": "This", "b": [0.1701, 0.5447, 0.2149, 0.5644]}, {"w": "is", "b": [0.2212, 0.5447, 0.238, 0.5644]}, {"w": "a", "b": [0.2443, 0.5447, 0.2555, 0.5644]}, {"w": "convincing", "b": [0.2618, 0.5447, 0.374, 0.5644]}, {"w": "demonstration", "b": [0.3802, 0.5447, 0.5246, 0.5644]}, {"w": "that", "b": [0.5309, 0.5447, 0.5687, 0.5644]}, {"w": "a", "b": [0.575, 0.5447, 0.5862, 0.5644]}, {"w": "1D", "b": [0.5925, 0.5447, 0.6233, 0.5644]}, {"w": "convnet", "b": [0.6296, 0.5447, 0.7095, 0.5644]}, {"w": "can", "b": [0.7158, 0.5447, 0.7508, 0.5644]}, {"w": "offer", "b": [0.7571, 0.5447, 0.8056, 0.5644]}, {"w": "a", "b": [0.8119, 0.5447, 0.8231, 0.5644]}, {"w": "fast,", "b": [0.1294, 0.5652, 0.1721, 0.5849]}, {"w": "cheap", "b": [0.1785, 0.5652, 0.2373, 0.5849]}, {"w": "alternative", "b": [0.2436, 0.5652, 0.3501, 0.5849]}, {"w": "to", "b": [0.3564, 0.5652, 0.376, 0.5849]}, {"w": "a", "b": [0.3823, 0.5652, 0.3935, 0.5849]}, {"w": "recurrent", "b": [0.3998, 0.5652, 0.4908, 0.5849]}, {"w": "network", "b": [0.4972, 0.5652, 0.5798, 0.5849]}, {"w": "on", "b": [0.5861, 0.5652, 0.6114, 0.5849]}, {"w": "a", "b": [0.6177, 0.5652, 0.6289, 0.5849]}, {"w": "word-level", "b": [0.6352, 0.5652, 0.7444, 0.5849]}, {"w": "sentiment-", "b": [0.7507, 0.5652, 0.8573, 0.5849]}, {"w": "classification", "b": [0.1294, 0.5857, 0.2625, 0.6054]}, {"w": "task.", "b": [0.2688, 0.5857, 0.3157, 0.6054]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.27. Training and validation loss on IMDB with a simple 1D convnet", "words": [{"w": "Figure", "b": [0.1294, 0.6235, 0.1827, 0.6384]}, {"w": "6.27.", "b": [0.1874, 0.6235, 0.2252, 0.6384]}, {"w": "Training", "b": [0.2299, 0.6235, 0.3, 0.6384]}, {"w": "and", "b": [0.3048, 0.6235, 0.3353, 0.6384]}, {"w": "validation", "b": [0.34, 0.6235, 0.4209, 0.6384]}, {"w": "loss", "b": [0.4257, 0.6235, 0.4551, 0.6384]}, {"w": "on", "b": [0.4598, 0.6235, 0.4798, 0.6384]}, {"w": "IMDB", "b": [0.4846, 0.6235, 0.5361, 0.6384]}, {"w": "with", "b": [0.5408, 0.6235, 0.5765, 0.6384]}, {"w": "a", "b": [0.5812, 0.6235, 0.5907, 0.6384]}, {"w": "simple", "b": [0.5954, 0.6235, 0.648, 0.6384]}, {"w": "1D", "b": [0.6527, 0.6235, 0.6758, 0.6384]}, {"w": "convnet", "b": [0.6806, 0.6235, 0.7436, 0.6384]}]}]}, {"page": 299, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 6.28. Training and validation accuracy on IMDB with a simple 1D convnet", "words": [{"w": "Figure", "b": [0.1294, 0.0852, 0.1827, 0.1]}, {"w": "6.28.", "b": [0.1874, 0.0852, 0.2252, 0.1]}, {"w": "Training", "b": [0.2299, 0.0852, 0.3, 0.1]}, {"w": "and", "b": [0.3048, 0.0852, 0.3353, 0.1]}, {"w": "validation", "b": [0.34, 0.0852, 0.4209, 0.1]}, {"w": "accuracy", "b": [0.4257, 0.0852, 0.4982, 0.1]}, {"w": "on", "b": [0.5029, 0.0852, 0.5229, 0.1]}, {"w": "IMDB", "b": [0.5276, 0.0852, 0.5791, 0.1]}, {"w": "with", "b": [0.5838, 0.0852, 0.6196, 0.1]}, {"w": "a", "b": [0.6243, 0.0852, 0.6338, 0.1]}, {"w": "simple", "b": [0.6385, 0.0852, 0.6911, 0.1]}, {"w": "1D", "b": [0.6958, 0.0852, 0.7189, 0.1]}, {"w": "convnet", "b": [0.7236, 0.0852, 0.7867, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "6.4.4. Combining CNNs and RNNs to process long sequences", "words": [{"w": "6.4.4.", "b": [0.1294, 0.395, 0.1862, 0.4147]}, {"w": "Combining", "b": [0.1925, 0.395, 0.313, 0.4147]}, {"w": "CNNs", "b": [0.3193, 0.395, 0.3838, 0.4147]}, {"w": "and", "b": [0.3901, 0.395, 0.4308, 0.4147]}, {"w": "RNNs", "b": [0.4371, 0.395, 0.5015, 0.4147]}, {"w": "to", "b": [0.5078, 0.395, 0.5288, 0.4147]}, {"w": "process", "b": [0.5351, 0.395, 0.6146, 0.4147]}, {"w": "long", "b": [0.6209, 0.395, 0.6672, 0.4147]}, {"w": "sequences", "b": [0.6735, 0.395, 0.78, 0.4147]}]}, {"id": "b_2", "type": "paragraph", "text": "Because 1D convnets process input patches independently, they aren’t sensitive to the order of the timesteps (beyond a local scale, the size of the convolution windows), unlike RNNs. Of course, to recognize longer- term patterns, you can stack many convolution layers and pooling layers, resulting in upper layers that will see long chunks of the original inputs —but that’s still a fairly weak way to induce order sensitivity. One way to evidence this weakness is to try 1D convnets on the temperature- forecasting problem, where order-sensitivity is key to producing good predictions. The following example reuses the following variables defined previously: float_data, train_gen, val_gen, and val_steps.", "words": [{"w": "Because", "b": [0.1294, 0.4377, 0.2135, 0.4575]}, {"w": "1D", "b": [0.2198, 0.4377, 0.2506, 0.4575]}, {"w": "convnets", "b": [0.2569, 0.4377, 0.3466, 0.4575]}, {"w": "process", "b": [0.3529, 0.4377, 0.4285, 0.4575]}, {"w": "input", "b": [0.4348, 0.4377, 0.4867, 0.4575]}, {"w": "patches", "b": [0.493, 0.4377, 0.5687, 0.4575]}, {"w": "independently,", "b": [0.575, 0.4377, 0.7225, 0.4575]}, {"w": "they", "b": [0.7288, 0.4377, 0.7723, 0.4575]}, {"w": "aren’t", "b": [0.7786, 0.4377, 0.8369, 0.4575]}, {"w": "sensitive", "b": [0.1294, 0.4582, 0.2177, 0.478]}, {"w": "to", "b": [0.224, 0.4582, 0.2436, 0.478]}, {"w": "the", "b": [0.2499, 0.4582, 0.2808, 0.478]}, {"w": "order", "b": [0.2871, 0.4582, 0.3403, 0.478]}, {"w": "of", "b": [0.3466, 0.4582, 0.3676, 0.478]}, {"w": "the", "b": [0.3739, 0.4582, 0.4048, 0.478]}, {"w": "timesteps", "b": [0.4111, 0.4582, 0.5064, 0.478]}, {"w": "(beyond", "b": [0.5127, 0.4582, 0.5953, 0.478]}, {"w": "a", "b": [0.6016, 0.4582, 0.6128, 0.478]}, {"w": "local", "b": [0.6191, 0.4582, 0.6682, 0.478]}, {"w": "scale,", "b": [0.6744, 0.4582, 0.7311, 0.478]}, {"w": "the", "b": [0.7374, 0.4582, 0.7683, 0.478]}, {"w": "size", "b": [0.7746, 0.4582, 0.8138, 0.478]}, {"w": "of", "b": [0.8201, 0.4582, 0.8411, 0.478]}, {"w": "the", "b": [0.1294, 0.4787, 0.1602, 0.4985]}, {"w": "convolution", "b": [0.1665, 0.4787, 0.2871, 0.4985]}, {"w": "windows),", "b": [0.2934, 0.4787, 0.3992, 0.4985]}, {"w": "unlike", "b": [0.4055, 0.4787, 0.4685, 0.4985]}, {"w": "RNNs.", "b": [0.4749, 0.4787, 0.5442, 0.4985]}, {"w": "Of", "b": [0.5505, 0.4787, 0.5771, 0.4985]}, {"w": "course,", "b": [0.5835, 0.4787, 0.6556, 0.4985]}, {"w": "to", "b": [0.6619, 0.4787, 0.6815, 0.4985]}, {"w": "recognize", "b": [0.6878, 0.4787, 0.7859, 0.4985]}, {"w": "longer-", "b": [0.7922, 0.4787, 0.8645, 0.4985]}, {"w": "term", "b": [0.1294, 0.4993, 0.1757, 0.519]}, {"w": "patterns,", "b": [0.182, 0.4993, 0.2681, 0.519]}, {"w": "you", "b": [0.2744, 0.4993, 0.3123, 0.519]}, {"w": "can", "b": [0.3186, 0.4993, 0.3536, 0.519]}, {"w": "stack", "b": [0.3599, 0.4993, 0.4117, 0.519]}, {"w": "many", "b": [0.418, 0.4993, 0.4741, 0.519]}, {"w": "convolution", "b": [0.4803, 0.4993, 0.6009, 0.519]}, {"w": "layers", "b": [0.6072, 0.4993, 0.6674, 0.519]}, {"w": "and", "b": [0.6737, 0.4993, 0.7102, 0.519]}, {"w": "pooling", "b": [0.7165, 0.4993, 0.7935, 0.519]}, {"w": "layers,", "b": [0.7999, 0.4993, 0.8664, 0.519]}, {"w": "resulting", "b": [0.1294, 0.5197, 0.2177, 0.5395]}, {"w": "in", "b": [0.224, 0.5197, 0.2436, 0.5395]}, {"w": "upper", "b": [0.2499, 0.5197, 0.3074, 0.5395]}, {"w": "layers", "b": [0.3137, 0.5197, 0.3739, 0.5395]}, {"w": "that", "b": [0.3802, 0.5197, 0.4181, 0.5395]}, {"w": "will", "b": [0.4244, 0.5197, 0.4636, 0.5395]}, {"w": "see", "b": [0.4699, 0.5197, 0.5021, 0.5395]}, {"w": "long", "b": [0.5085, 0.5197, 0.5533, 0.5395]}, {"w": "chunks", "b": [0.5596, 0.5197, 0.6311, 0.5395]}, {"w": "of", "b": [0.6374, 0.5197, 0.6584, 0.5395]}, {"w": "the", "b": [0.6647, 0.5197, 0.6955, 0.5395]}, {"w": "original", "b": [0.7018, 0.5197, 0.7803, 0.5395]}, {"w": "inputs", "b": [0.7866, 0.5197, 0.8483, 0.5395]}, {"w": "—but", "b": [0.1294, 0.5403, 0.1869, 0.56]}, {"w": "that’s", "b": [0.1932, 0.5403, 0.2478, 0.56]}, {"w": "still", "b": [0.2541, 0.5403, 0.292, 0.56]}, {"w": "a", "b": [0.2983, 0.5403, 0.3095, 0.56]}, {"w": "fairly", "b": [0.3158, 0.5403, 0.3704, 0.56]}, {"w": "weak", "b": [0.3767, 0.5403, 0.43, 0.56]}, {"w": "way", "b": [0.4363, 0.5403, 0.4783, 0.56]}, {"w": "to", "b": [0.4846, 0.5403, 0.5042, 0.56]}, {"w": "induce", "b": [0.5105, 0.5403, 0.5778, 0.56]}, {"w": "order", "b": [0.5841, 0.5403, 0.6373, 0.56]}, {"w": "sensitivity.", "b": [0.6436, 0.5403, 0.752, 0.56]}, {"w": "One", "b": [0.7583, 0.5403, 0.8003, 0.56]}, {"w": "way", "b": [0.8066, 0.5403, 0.8486, 0.56]}, {"w": "to", "b": [0.1294, 0.5607, 0.149, 0.5805]}, {"w": "evidence", "b": [0.1553, 0.5607, 0.245, 0.5805]}, {"w": "this", "b": [0.2513, 0.5607, 0.2878, 0.5805]}, {"w": "weakness", "b": [0.2941, 0.5607, 0.3907, 0.5805]}, {"w": "is", "b": [0.397, 0.5607, 0.4139, 0.5805]}, {"w": "to", "b": [0.4202, 0.5607, 0.4398, 0.5805]}, {"w": "try", "b": [0.4461, 0.5607, 0.4741, 0.5805]}, {"w": "1D", "b": [0.4804, 0.5607, 0.5113, 0.5805]}, {"w": "convnets", "b": [0.5176, 0.5607, 0.6072, 0.5805]}, {"w": "on", "b": [0.6135, 0.5607, 0.6388, 0.5805]}, {"w": "the", "b": [0.6451, 0.5607, 0.6759, 0.5805]}, {"w": "temperature-", "b": [0.6822, 0.5607, 0.8111, 0.5805]}, {"w": "forecasting", "b": [0.1294, 0.5812, 0.2415, 0.601]}, {"w": "problem,", "b": [0.2478, 0.5812, 0.3382, 0.601]}, {"w": "where", "b": [0.3445, 0.5812, 0.4061, 0.601]}, {"w": "order-sensitivity", "b": [0.4124, 0.5812, 0.5772, 0.601]}, {"w": "is", "b": [0.5835, 0.5812, 0.6004, 0.601]}, {"w": "key", "b": [0.6067, 0.5812, 0.6431, 0.601]}, {"w": "to", "b": [0.6494, 0.5812, 0.669, 0.601]}, {"w": "producing", "b": [0.6753, 0.5812, 0.7776, 0.601]}, {"w": "good", "b": [0.7839, 0.5812, 0.8344, 0.601]}, {"w": "predictions.", "b": [0.1294, 0.6018, 0.2478, 0.6215]}, {"w": "The", "b": [0.2541, 0.6018, 0.2934, 0.6215]}, {"w": "following", "b": [0.2997, 0.6018, 0.3978, 0.6215]}, {"w": "example", "b": [0.4041, 0.6018, 0.4895, 0.6215]}, {"w": "reuses", "b": [0.4958, 0.6018, 0.5589, 0.6215]}, {"w": "the", "b": [0.5652, 0.6018, 0.596, 0.6215]}, {"w": "following", "b": [0.6023, 0.6018, 0.7004, 0.6215]}, {"w": "variables", "b": [0.7067, 0.6018, 0.7978, 0.6215]}, {"w": "defined", "b": [0.1294, 0.6222, 0.2051, 0.642]}, {"w": "previously:", "b": [0.2114, 0.6222, 0.3249, 0.642]}, {"w": "float_data,", "b": [0.3312, 0.6222, 0.4888, 0.6435]}, {"w": "train_gen,", "b": [0.4951, 0.6222, 0.6377, 0.6435]}, {"w": "val_gen,", "b": [0.644, 0.6222, 0.7563, 0.6435]}, {"w": "and", "b": [0.7626, 0.6222, 0.799, 0.642]}, {"w": "val_steps.", "b": [0.1294, 0.6436, 0.272, 0.6649]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.47. Training and evaluating a simple 1D convnet on the Jena data", "words": [{"w": "Listing", "b": [0.1294, 0.6824, 0.1862, 0.6972]}, {"w": "6.47.", "b": [0.1909, 0.6824, 0.2288, 0.6972]}, {"w": "Training", "b": [0.2335, 0.6824, 0.3036, 0.6972]}, {"w": "and", "b": [0.3083, 0.6824, 0.3388, 0.6972]}, {"w": "evaluating", "b": [0.3435, 0.6824, 0.4276, 0.6972]}, {"w": "a", "b": [0.4323, 0.6824, 0.4418, 0.6972]}, {"w": "simple", "b": [0.4465, 0.6824, 0.4991, 0.6972]}, {"w": "1D", "b": [0.5038, 0.6824, 0.5269, 0.6972]}, {"w": "convnet", "b": [0.5317, 0.6824, 0.5947, 0.6972]}, {"w": "on", "b": [0.5995, 0.6824, 0.6194, 0.6972]}, {"w": "the", "b": [0.6242, 0.6824, 0.6494, 0.6972]}, {"w": "Jena", "b": [0.6541, 0.6824, 0.692, 0.6972]}, {"w": "data", "b": [0.6967, 0.6824, 0.7324, 0.6972]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop model = Sequential() model.add(layers.Conv1D(32, 5, activation='relu', input_shape=(None, float_data.shape[-1]))) model.add(layers.MaxPooling1D(3)) model.add(layers.Conv1D(32, 5, activation='relu')) model.add(layers.MaxPooling1D(3)) model.add(layers.Conv1D(32, 5, activation='relu')) model.add(layers.GlobalMaxPooling1D())", "words": [{"w": "from", "b": [0.1357, 0.7108, 0.1811, 0.7259]}, {"w": "keras.models", "b": [0.1925, 0.7108, 0.3287, 0.7259]}, {"w": "import", "b": [0.34, 0.7108, 0.4082, 0.7259]}, {"w": "Sequential", "b": [0.4195, 0.7108, 0.533, 0.7259]}, {"w": "from", "b": [0.1357, 0.7259, 0.1811, 0.7411]}, {"w": "keras", "b": [0.1925, 0.7259, 0.2492, 0.7411]}, {"w": "import", "b": [0.2606, 0.7259, 0.3287, 0.7411]}, {"w": "layers", "b": [0.34, 0.7259, 0.4082, 0.7411]}, {"w": "from", "b": [0.1357, 0.7411, 0.1811, 0.7562]}, {"w": "keras.optimizers", "b": [0.1925, 0.7411, 0.3741, 0.7562]}, {"w": "import", "b": [0.3855, 0.7411, 0.4536, 0.7562]}, {"w": "RMSprop", "b": [0.4649, 0.7411, 0.5444, 0.7562]}, {"w": "model", "b": [0.1357, 0.7714, 0.1925, 0.7865]}, {"w": "=", "b": [0.2038, 0.7714, 0.2152, 0.7865]}, {"w": "Sequential()", "b": [0.2265, 0.7714, 0.3628, 0.7865]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.7865, 0.4422, 0.8017]}, {"w": "5,", "b": [0.4536, 0.7865, 0.4763, 0.8017]}, {"w": "activation='relu',", "b": [0.4876, 0.7865, 0.6919, 0.8017]}, {"w": "input_shape=(None,", "b": [0.4082, 0.8017, 0.6125, 0.8168]}, {"w": "float_data.shape[-1])))", "b": [0.1357, 0.8169, 0.3968, 0.832]}, {"w": "model.add(layers.MaxPooling1D(3))", "b": [0.1357, 0.832, 0.5103, 0.8472]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.8472, 0.4422, 0.8623]}, {"w": "5,", "b": [0.4536, 0.8472, 0.4763, 0.8623]}, {"w": "activation='relu'))", "b": [0.4876, 0.8472, 0.7033, 0.8623]}, {"w": "model.add(layers.MaxPooling1D(3))", "b": [0.1357, 0.8623, 0.5103, 0.8775]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.8775, 0.4422, 0.8926]}, {"w": "5,", "b": [0.4536, 0.8775, 0.4763, 0.8926]}, {"w": "activation='relu'))", "b": [0.4876, 0.8775, 0.7033, 0.8926]}, {"w": "model.add(layers.GlobalMaxPooling1D())", "b": [0.1357, 0.8926, 0.5671, 0.9078]}]}]}, {"page": 300, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.add(layers.Dense(1)) model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=20, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.0851, 0.4309, 0.1002]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.1154, 0.5217, 0.1305]}, {"w": "loss='mae')", "b": [0.533, 0.1154, 0.6579, 0.1305]}, {"w": "history", "b": [0.1357, 0.1305, 0.2152, 0.1457]}, {"w": "=", "b": [0.2265, 0.1305, 0.2379, 0.1457]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.1305, 0.5898, 0.1457]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.1457, 0.7033, 0.1608]}, {"w": "epochs=20,", "b": [0.4763, 0.1608, 0.5898, 0.176]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.176, 0.7487, 0.1911]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.1912, 0.7828, 0.2063]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.29 shows the training and validation MAEs.", "words": [{"w": "Figure", "b": [0.1294, 0.2292, 0.1953, 0.2489]}, {"w": "6.29", "b": [0.2016, 0.2292, 0.2457, 0.2489]}, {"w": "shows", "b": [0.252, 0.2292, 0.3151, 0.2489]}, {"w": "the", "b": [0.3214, 0.2292, 0.3522, 0.2489]}, {"w": "training", "b": [0.3585, 0.2292, 0.437, 0.2489]}, {"w": "and", "b": [0.4433, 0.2292, 0.4797, 0.2489]}, {"w": "validation", "b": [0.486, 0.2292, 0.5869, 0.2489]}, {"w": "MAEs.", "b": [0.5932, 0.2292, 0.6654, 0.2489]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.29. Training and validation loss on the Jena temperature-forecasting task with a simple 1D convnet", "words": [{"w": "Figure", "b": [0.1294, 0.267, 0.1827, 0.2818]}, {"w": "6.29.", "b": [0.1874, 0.267, 0.2252, 0.2818]}, {"w": "Training", "b": [0.2299, 0.267, 0.3, 0.2818]}, {"w": "and", "b": [0.3048, 0.267, 0.3353, 0.2818]}, {"w": "validation", "b": [0.34, 0.267, 0.4209, 0.2818]}, {"w": "loss", "b": [0.4257, 0.267, 0.4551, 0.2818]}, {"w": "on", "b": [0.4598, 0.267, 0.4798, 0.2818]}, {"w": "the", "b": [0.4846, 0.267, 0.5098, 0.2818]}, {"w": "Jena", "b": [0.5145, 0.267, 0.5523, 0.2818]}, {"w": "temperature-forecasting", "b": [0.5571, 0.267, 0.7529, 0.2818]}, {"w": "task", "b": [0.7576, 0.267, 0.7912, 0.2818]}, {"w": "with", "b": [0.796, 0.267, 0.8317, 0.2818]}, {"w": "a", "b": [0.8364, 0.267, 0.8459, 0.2818]}, {"w": "simple", "b": [0.1294, 0.2822, 0.182, 0.297]}, {"w": "1D", "b": [0.1867, 0.2822, 0.2098, 0.297]}, {"w": "convnet", "b": [0.2145, 0.2822, 0.2776, 0.297]}]}, {"id": "b_3", "type": "paragraph", "text": "The validation MAE stays in the 0.40s: you can’t even beat the common- sense baseline using the small convnet. Again, this is because the convnet looks for patterns anywhere in the input timeseries and has no knowledge of the temporal position of a pattern it sees (toward the beginning, toward the end, and so on). Because more recent data points should be interpreted differently from older data points in the case of this specific forecasting problem, the convnet fails at producing meaningful results. This limitation of convnets isn’t an issue with the IMDB data, because patterns of keywords associated with a positive or negative sentiment are informative independently of where they’re found in the input sentences.", "words": [{"w": "The", "b": [0.1294, 0.5875, 0.1686, 0.6072]}, {"w": "validation", "b": [0.1749, 0.5875, 0.2758, 0.6072]}, {"w": "MAE", "b": [0.2822, 0.5875, 0.3382, 0.6072]}, {"w": "stays", "b": [0.3445, 0.5875, 0.395, 0.6072]}, {"w": "in", "b": [0.4013, 0.5875, 0.4209, 0.6072]}, {"w": "the", "b": [0.4272, 0.5875, 0.458, 0.6072]}, {"w": "0.40s:", "b": [0.4643, 0.5875, 0.5253, 0.6072]}, {"w": "you", "b": [0.5316, 0.5875, 0.5695, 0.6072]}, {"w": "can’t", "b": [0.5758, 0.5875, 0.6257, 0.6072]}, {"w": "even", "b": [0.632, 0.5875, 0.6796, 0.6072]}, {"w": "beat", "b": [0.6859, 0.5875, 0.7279, 0.6072]}, {"w": "the", "b": [0.7343, 0.5875, 0.7651, 0.6072]}, {"w": "common-", "b": [0.7714, 0.5875, 0.8681, 0.6072]}, {"w": "sense", "b": [0.1294, 0.608, 0.1841, 0.6277]}, {"w": "baseline", "b": [0.1904, 0.608, 0.273, 0.6277]}, {"w": "using", "b": [0.2793, 0.608, 0.334, 0.6277]}, {"w": "the", "b": [0.3403, 0.608, 0.3711, 0.6277]}, {"w": "small", "b": [0.3774, 0.608, 0.4321, 0.6277]}, {"w": "convnet.", "b": [0.4384, 0.608, 0.5246, 0.6277]}, {"w": "Again,", "b": [0.5309, 0.608, 0.5988, 0.6277]}, {"w": "this", "b": [0.6051, 0.608, 0.6416, 0.6277]}, {"w": "is", "b": [0.6478, 0.608, 0.6647, 0.6277]}, {"w": "because", "b": [0.671, 0.608, 0.7508, 0.6277]}, {"w": "the", "b": [0.7571, 0.608, 0.7879, 0.6277]}, {"w": "convnet", "b": [0.1294, 0.6285, 0.2093, 0.6482]}, {"w": "looks", "b": [0.2156, 0.6285, 0.2702, 0.6482]}, {"w": "for", "b": [0.2766, 0.6285, 0.306, 0.6482]}, {"w": "patterns", "b": [0.3123, 0.6285, 0.3921, 0.6482]}, {"w": "anywhere", "b": [0.3984, 0.6285, 0.4965, 0.6482]}, {"w": "in", "b": [0.5028, 0.6285, 0.5224, 0.6482]}, {"w": "the", "b": [0.5287, 0.6285, 0.5596, 0.6482]}, {"w": "input", "b": [0.5659, 0.6285, 0.6177, 0.6482]}, {"w": "timeseries", "b": [0.624, 0.6285, 0.7263, 0.6482]}, {"w": "and", "b": [0.7326, 0.6285, 0.7691, 0.6482]}, {"w": "has", "b": [0.7754, 0.6285, 0.809, 0.6482]}, {"w": "no", "b": [0.8153, 0.6285, 0.8405, 0.6482]}, {"w": "knowledge", "b": [0.1294, 0.649, 0.2401, 0.6687]}, {"w": "of", "b": [0.2464, 0.649, 0.2674, 0.6687]}, {"w": "the", "b": [0.2737, 0.649, 0.3046, 0.6687]}, {"w": "temporal", "b": [0.3109, 0.649, 0.4005, 0.6687]}, {"w": "position", "b": [0.4068, 0.649, 0.4881, 0.6687]}, {"w": "of", "b": [0.4945, 0.649, 0.5155, 0.6687]}, {"w": "a", "b": [0.5217, 0.649, 0.5329, 0.6687]}, {"w": "pattern", "b": [0.5392, 0.649, 0.6093, 0.6687]}, {"w": "it", "b": [0.6156, 0.649, 0.6296, 0.6687]}, {"w": "sees", "b": [0.6359, 0.649, 0.6779, 0.6687]}, {"w": "(toward", "b": [0.6842, 0.649, 0.7627, 0.6687]}, {"w": "the", "b": [0.769, 0.649, 0.7998, 0.6687]}, {"w": "beginning,", "b": [0.1294, 0.6695, 0.2366, 0.6892]}, {"w": "toward", "b": [0.2429, 0.6695, 0.313, 0.6892]}, {"w": "the", "b": [0.3193, 0.6695, 0.3501, 0.6892]}, {"w": "end,", "b": [0.3564, 0.6695, 0.3992, 0.6892]}, {"w": "and", "b": [0.4055, 0.6695, 0.4419, 0.6892]}, {"w": "so", "b": [0.4482, 0.6695, 0.4706, 0.6892]}, {"w": "on).", "b": [0.4769, 0.6695, 0.5169, 0.6892]}, {"w": "Because", "b": [0.5232, 0.6695, 0.6072, 0.6892]}, {"w": "more", "b": [0.6135, 0.6695, 0.6654, 0.6892]}, {"w": "recent", "b": [0.6717, 0.6695, 0.7333, 0.6892]}, {"w": "data", "b": [0.7396, 0.6695, 0.7816, 0.6892]}, {"w": "points", "b": [0.7879, 0.6695, 0.8496, 0.6892]}, {"w": "should", "b": [0.1294, 0.69, 0.1967, 0.7097]}, {"w": "be", "b": [0.203, 0.69, 0.2268, 0.7097]}, {"w": "interpreted", "b": [0.2331, 0.69, 0.3424, 0.7097]}, {"w": "differently", "b": [0.3487, 0.69, 0.4547, 0.7097]}, {"w": "from", "b": [0.461, 0.69, 0.51, 0.7097]}, {"w": "older", "b": [0.5163, 0.69, 0.5682, 0.7097]}, {"w": "data", "b": [0.5745, 0.69, 0.6165, 0.7097]}, {"w": "points", "b": [0.6228, 0.69, 0.6845, 0.7097]}, {"w": "in", "b": [0.6908, 0.69, 0.7104, 0.7097]}, {"w": "the", "b": [0.7167, 0.69, 0.7475, 0.7097]}, {"w": "case", "b": [0.7539, 0.69, 0.7973, 0.7097]}, {"w": "of", "b": [0.8036, 0.69, 0.8246, 0.7097]}, {"w": "this", "b": [0.8309, 0.69, 0.8673, 0.7097]}, {"w": "specific", "b": [0.1294, 0.7105, 0.2079, 0.7302]}, {"w": "forecasting", "b": [0.2142, 0.7105, 0.3262, 0.7302]}, {"w": "problem,", "b": [0.3326, 0.7105, 0.4229, 0.7302]}, {"w": "the", "b": [0.4292, 0.7105, 0.4601, 0.7302]}, {"w": "convnet", "b": [0.4664, 0.7105, 0.5462, 0.7302]}, {"w": "fails", "b": [0.5525, 0.7105, 0.596, 0.7302]}, {"w": "at", "b": [0.6023, 0.7105, 0.6205, 0.7302]}, {"w": "producing", "b": [0.6268, 0.7105, 0.7291, 0.7302]}, {"w": "meaningful", "b": [0.7354, 0.7105, 0.8503, 0.7302]}, {"w": "results.", "b": [0.1294, 0.731, 0.2016, 0.7507]}, {"w": "This", "b": [0.2079, 0.731, 0.2527, 0.7507]}, {"w": "limitation", "b": [0.259, 0.731, 0.3572, 0.7507]}, {"w": "of", "b": [0.3635, 0.731, 0.3845, 0.7507]}, {"w": "convnets", "b": [0.3908, 0.731, 0.4805, 0.7507]}, {"w": "isn’t", "b": [0.4868, 0.731, 0.5311, 0.7507]}, {"w": "an", "b": [0.5374, 0.731, 0.5613, 0.7507]}, {"w": "issue", "b": [0.5676, 0.731, 0.618, 0.7507]}, {"w": "with", "b": [0.6243, 0.731, 0.6692, 0.7507]}, {"w": "the", "b": [0.6755, 0.731, 0.7063, 0.7507]}, {"w": "IMDB", "b": [0.7126, 0.731, 0.7785, 0.7507]}, {"w": "data,", "b": [0.7848, 0.731, 0.8331, 0.7507]}, {"w": "because", "b": [0.1294, 0.7515, 0.2093, 0.7712]}, {"w": "patterns", "b": [0.2156, 0.7515, 0.2954, 0.7712]}, {"w": "of", "b": [0.3017, 0.7515, 0.3227, 0.7712]}, {"w": "keywords", "b": [0.329, 0.7515, 0.4271, 0.7712]}, {"w": "associated", "b": [0.4334, 0.7515, 0.5371, 0.7712]}, {"w": "with", "b": [0.5434, 0.7515, 0.5883, 0.7712]}, {"w": "a", "b": [0.5946, 0.7515, 0.6058, 0.7712]}, {"w": "positive", "b": [0.6121, 0.7515, 0.692, 0.7712]}, {"w": "or", "b": [0.6982, 0.7515, 0.7192, 0.7712]}, {"w": "negative", "b": [0.7255, 0.7515, 0.811, 0.7712]}, {"w": "sentiment", "b": [0.1294, 0.772, 0.2275, 0.7917]}, {"w": "are", "b": [0.2338, 0.772, 0.2646, 0.7917]}, {"w": "informative", "b": [0.2709, 0.772, 0.3886, 0.7917]}, {"w": "independently", "b": [0.3949, 0.772, 0.5379, 0.7917]}, {"w": "of", "b": [0.5442, 0.772, 0.5652, 0.7917]}, {"w": "where", "b": [0.5715, 0.772, 0.6331, 0.7917]}, {"w": "they’re", "b": [0.6394, 0.772, 0.7109, 0.7917]}, {"w": "found", "b": [0.7172, 0.772, 0.776, 0.7917]}, {"w": "in", "b": [0.7823, 0.772, 0.802, 0.7917]}, {"w": "the", "b": [0.8083, 0.772, 0.8391, 0.7917]}, {"w": "input", "b": [0.1294, 0.7925, 0.1813, 0.8122]}, {"w": "sentences.", "b": [0.1876, 0.7925, 0.2906, 0.8122]}]}, {"id": "b_4", "type": "paragraph", "text": "One strategy to combine the speed and lightness of convnets with the order--sensitivity of RNNs is to use a 1D convnet as a preprocessing step before an RNN (see figure 6.30). This is especially beneficial when", "words": [{"w": "One", "b": [0.1294, 0.8353, 0.1714, 0.855]}, {"w": "strategy", "b": [0.1777, 0.8353, 0.2576, 0.855]}, {"w": "to", "b": [0.2639, 0.8353, 0.2835, 0.855]}, {"w": "combine", "b": [0.2898, 0.8353, 0.3767, 0.855]}, {"w": "the", "b": [0.383, 0.8353, 0.4139, 0.855]}, {"w": "speed", "b": [0.4202, 0.8353, 0.4776, 0.855]}, {"w": "and", "b": [0.4839, 0.8353, 0.5203, 0.855]}, {"w": "lightness", "b": [0.5266, 0.8353, 0.6163, 0.855]}, {"w": "of", "b": [0.6227, 0.8353, 0.6437, 0.855]}, {"w": "convnets", "b": [0.65, 0.8353, 0.7396, 0.855]}, {"w": "with", "b": [0.746, 0.8353, 0.7908, 0.855]}, {"w": "the", "b": [0.7971, 0.8353, 0.8279, 0.855]}, {"w": "order--sensitivity", "b": [0.1294, 0.8558, 0.3027, 0.8755]}, {"w": "of", "b": [0.309, 0.8558, 0.33, 0.8755]}, {"w": "RNNs", "b": [0.3363, 0.8558, 0.3993, 0.8755]}, {"w": "is", "b": [0.4057, 0.8558, 0.4225, 0.8755]}, {"w": "to", "b": [0.4288, 0.8558, 0.4484, 0.8755]}, {"w": "use", "b": [0.4547, 0.8558, 0.4883, 0.8755]}, {"w": "a", "b": [0.4947, 0.8558, 0.5059, 0.8755]}, {"w": "1D", "b": [0.5122, 0.8558, 0.543, 0.8755]}, {"w": "convnet", "b": [0.5493, 0.8558, 0.6292, 0.8755]}, {"w": "as", "b": [0.6355, 0.8558, 0.6565, 0.8755]}, {"w": "a", "b": [0.6628, 0.8558, 0.674, 0.8755]}, {"w": "preprocessing", "b": [0.6803, 0.8558, 0.8204, 0.8755]}, {"w": "step", "b": [0.8267, 0.8558, 0.8673, 0.8755]}, {"w": "before", "b": [0.1294, 0.8763, 0.1938, 0.896]}, {"w": "an", "b": [0.2001, 0.8763, 0.224, 0.896]}, {"w": "RNN", "b": [0.2303, 0.8763, 0.2835, 0.896]}, {"w": "(see", "b": [0.2898, 0.8763, 0.3304, 0.896]}, {"w": "figure", "b": [0.3367, 0.8763, 0.397, 0.896]}, {"w": "6.30).", "b": [0.4033, 0.8763, 0.4621, 0.896]}, {"w": "This", "b": [0.4684, 0.8763, 0.5133, 0.896]}, {"w": "is", "b": [0.5196, 0.8763, 0.5364, 0.896]}, {"w": "especially", "b": [0.5427, 0.8763, 0.6436, 0.896]}, {"w": "beneficial", "b": [0.6499, 0.8763, 0.7494, 0.896]}, {"w": "when", "b": [0.7557, 0.8763, 0.8103, 0.896]}]}]}, {"page": 301, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "you’re dealing with sequences that are so long they can’t realistically be processed with RNNs, such as sequences with thousands of steps. The convnet will turn the long input sequence into much shorter (downsampled) sequences of higher-level features. This sequence of extracted features then becomes the input to the RNN part of the network.", "words": [{"w": "you’re", "b": [0.1294, 0.0857, 0.1953, 0.1054]}, {"w": "dealing", "b": [0.2016, 0.0857, 0.2758, 0.1054]}, {"w": "with", "b": [0.2821, 0.0857, 0.327, 0.1054]}, {"w": "sequences", "b": [0.3333, 0.0857, 0.4356, 0.1054]}, {"w": "that", "b": [0.4419, 0.0857, 0.4797, 0.1054]}, {"w": "are", "b": [0.486, 0.0857, 0.5168, 0.1054]}, {"w": "so", "b": [0.5231, 0.0857, 0.5455, 0.1054]}, {"w": "long", "b": [0.5518, 0.0857, 0.5967, 0.1054]}, {"w": "they", "b": [0.603, 0.0857, 0.6464, 0.1054]}, {"w": "can’t", "b": [0.6527, 0.0857, 0.7026, 0.1054]}, {"w": "realistically", "b": [0.709, 0.0857, 0.8267, 0.1054]}, {"w": "be", "b": [0.833, 0.0857, 0.8568, 0.1054]}, {"w": "processed", "b": [0.1294, 0.1062, 0.2289, 0.1259]}, {"w": "with", "b": [0.2352, 0.1062, 0.28, 0.1259]}, {"w": "RNNs,", "b": [0.2863, 0.1062, 0.3557, 0.1259]}, {"w": "such", "b": [0.362, 0.1062, 0.4082, 0.1259]}, {"w": "as", "b": [0.4145, 0.1062, 0.4356, 0.1259]}, {"w": "sequences", "b": [0.4419, 0.1062, 0.5441, 0.1259]}, {"w": "with", "b": [0.5504, 0.1062, 0.5953, 0.1259]}, {"w": "thousands", "b": [0.6016, 0.1062, 0.7025, 0.1259]}, {"w": "of", "b": [0.7088, 0.1062, 0.7298, 0.1259]}, {"w": "steps.", "b": [0.7361, 0.1062, 0.7929, 0.1259]}, {"w": "The", "b": [0.7992, 0.1062, 0.8384, 0.1259]}, {"w": "convnet", "b": [0.1294, 0.1267, 0.2093, 0.1464]}, {"w": "will", "b": [0.2156, 0.1267, 0.2548, 0.1464]}, {"w": "turn", "b": [0.2611, 0.1267, 0.3018, 0.1464]}, {"w": "the", "b": [0.3081, 0.1267, 0.3389, 0.1464]}, {"w": "long", "b": [0.3452, 0.1267, 0.3901, 0.1464]}, {"w": "input", "b": [0.3964, 0.1267, 0.4482, 0.1464]}, {"w": "sequence", "b": [0.4545, 0.1267, 0.547, 0.1464]}, {"w": "into", "b": [0.5533, 0.1267, 0.5926, 0.1464]}, {"w": "much", "b": [0.5989, 0.1267, 0.6549, 0.1464]}, {"w": "shorter", "b": [0.6612, 0.1267, 0.7313, 0.1464]}, {"w": "(downsampled)", "b": [0.1294, 0.1472, 0.2863, 0.1669]}, {"w": "sequences", "b": [0.2926, 0.1472, 0.3949, 0.1669]}, {"w": "of", "b": [0.4012, 0.1472, 0.4222, 0.1669]}, {"w": "higher-level", "b": [0.4285, 0.1472, 0.5499, 0.1669]}, {"w": "features.", "b": [0.5562, 0.1472, 0.6423, 0.1669]}, {"w": "This", "b": [0.6487, 0.1472, 0.6935, 0.1669]}, {"w": "sequence", "b": [0.6998, 0.1472, 0.7923, 0.1669]}, {"w": "of", "b": [0.7986, 0.1472, 0.8196, 0.1669]}, {"w": "extracted", "b": [0.1294, 0.1677, 0.2219, 0.1874]}, {"w": "features", "b": [0.2282, 0.1677, 0.308, 0.1874]}, {"w": "then", "b": [0.3143, 0.1677, 0.3578, 0.1874]}, {"w": "becomes", "b": [0.3641, 0.1677, 0.4523, 0.1874]}, {"w": "the", "b": [0.4586, 0.1677, 0.4895, 0.1874]}, {"w": "input", "b": [0.4958, 0.1677, 0.5476, 0.1874]}, {"w": "to", "b": [0.5539, 0.1677, 0.5736, 0.1874]}, {"w": "the", "b": [0.5799, 0.1677, 0.6107, 0.1874]}, {"w": "RNN", "b": [0.617, 0.1677, 0.6703, 0.1874]}, {"w": "part", "b": [0.6766, 0.1677, 0.7158, 0.1874]}, {"w": "of", "b": [0.7221, 0.1677, 0.7431, 0.1874]}, {"w": "the", "b": [0.7494, 0.1677, 0.7802, 0.1874]}, {"w": "network.", "b": [0.1294, 0.1882, 0.2184, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.30. Combining a 1D convnet and an RNN for processing long sequences", "words": [{"w": "Figure", "b": [0.1294, 0.226, 0.1827, 0.2408]}, {"w": "6.30.", "b": [0.1874, 0.226, 0.2252, 0.2408]}, {"w": "Combining", "b": [0.2299, 0.226, 0.3204, 0.2408]}, {"w": "a", "b": [0.3251, 0.226, 0.3345, 0.2408]}, {"w": "1D", "b": [0.3393, 0.226, 0.3624, 0.2408]}, {"w": "convnet", "b": [0.3671, 0.226, 0.4302, 0.2408]}, {"w": "and", "b": [0.4349, 0.226, 0.4654, 0.2408]}, {"w": "an", "b": [0.4701, 0.226, 0.4901, 0.2408]}, {"w": "RNN", "b": [0.4948, 0.226, 0.5358, 0.2408]}, {"w": "for", "b": [0.5406, 0.226, 0.5647, 0.2408]}, {"w": "processing", "b": [0.5694, 0.226, 0.6543, 0.2408]}, {"w": "long", "b": [0.659, 0.226, 0.6937, 0.2408]}, {"w": "sequences", "b": [0.6984, 0.226, 0.7783, 0.2408]}]}, {"id": "b_2", "type": "paragraph", "text": "This technique isn’t seen often in research papers and practical applications, possibly because it isn’t well known. It’s effective and ought to be more common. Let’s try it on the temperature-forecasting dataset. Because this strategy allows you to manipulate much longer sequences, you can either look at data from longer ago (by increasing the lookback parameter of the data generator) or look at high-resolution timeseries (by decreasing the step parameter of the generator). Here, somewhat arbitrarily, you’ll use a step that’s half as large, resulting in a timeseries twice as long, where the temperature data is sampled at a rate of 1 point per 30 minutes. The example reuses the generator function defined earlier.", "words": [{"w": "This", "b": [0.1294, 0.518, 0.1743, 0.5377]}, {"w": "technique", "b": [0.1806, 0.518, 0.2786, 0.5377]}, {"w": "isn’t", "b": [0.285, 0.518, 0.3293, 0.5377]}, {"w": "seen", "b": [0.3356, 0.518, 0.3805, 0.5377]}, {"w": "often", "b": [0.3868, 0.518, 0.4386, 0.5377]}, {"w": "in", "b": [0.4449, 0.518, 0.4645, 0.5377]}, {"w": "research", "b": [0.4708, 0.518, 0.5549, 0.5377]}, {"w": "papers", "b": [0.5612, 0.518, 0.627, 0.5377]}, {"w": "and", "b": [0.6333, 0.518, 0.6697, 0.5377]}, {"w": "practical", "b": [0.6761, 0.518, 0.7629, 0.5377]}, {"w": "applications,", "b": [0.1294, 0.5385, 0.2576, 0.5582]}, {"w": "possibly", "b": [0.2639, 0.5385, 0.348, 0.5582]}, {"w": "because", "b": [0.3544, 0.5385, 0.4342, 0.5582]}, {"w": "it", "b": [0.4405, 0.5385, 0.4545, 0.5582]}, {"w": "isn’t", "b": [0.4608, 0.5385, 0.5052, 0.5582]}, {"w": "well", "b": [0.5115, 0.5385, 0.5549, 0.5582]}, {"w": "known.", "b": [0.5612, 0.5385, 0.6362, 0.5582]}, {"w": "It’s", "b": [0.6425, 0.5385, 0.6747, 0.5582]}, {"w": "effective", "b": [0.681, 0.5385, 0.7688, 0.5582]}, {"w": "and", "b": [0.7751, 0.5385, 0.8115, 0.5582]}, {"w": "ought", "b": [0.1294, 0.559, 0.1869, 0.5787]}, {"w": "to", "b": [0.1932, 0.559, 0.2128, 0.5787]}, {"w": "be", "b": [0.2191, 0.559, 0.2429, 0.5787]}, {"w": "more", "b": [0.2492, 0.559, 0.3011, 0.5787]}, {"w": "common.", "b": [0.3074, 0.559, 0.402, 0.5787]}, {"w": "Let’s", "b": [0.4083, 0.559, 0.4587, 0.5787]}, {"w": "try", "b": [0.465, 0.559, 0.493, 0.5787]}, {"w": "it", "b": [0.4993, 0.559, 0.5133, 0.5787]}, {"w": "on", "b": [0.5197, 0.559, 0.5449, 0.5787]}, {"w": "the", "b": [0.5512, 0.559, 0.582, 0.5787]}, {"w": "temperature-forecasting", "b": [0.5883, 0.559, 0.8293, 0.5787]}, {"w": "dataset.", "b": [0.1294, 0.5795, 0.2058, 0.5992]}, {"w": "Because", "b": [0.2121, 0.5795, 0.2961, 0.5992]}, {"w": "this", "b": [0.3024, 0.5795, 0.3389, 0.5992]}, {"w": "strategy", "b": [0.3452, 0.5795, 0.4251, 0.5992]}, {"w": "allows", "b": [0.4314, 0.5795, 0.4972, 0.5992]}, {"w": "you", "b": [0.5035, 0.5795, 0.5414, 0.5992]}, {"w": "to", "b": [0.5476, 0.5795, 0.5673, 0.5992]}, {"w": "manipulate", "b": [0.5736, 0.5795, 0.6857, 0.5992]}, {"w": "much", "b": [0.692, 0.5795, 0.748, 0.5992]}, {"w": "longer", "b": [0.7543, 0.5795, 0.8188, 0.5992]}, {"w": "sequences,", "b": [0.1294, 0.6, 0.238, 0.6197]}, {"w": "you", "b": [0.2443, 0.6, 0.2821, 0.6197]}, {"w": "can", "b": [0.2884, 0.6, 0.3234, 0.6197]}, {"w": "either", "b": [0.3298, 0.6, 0.3872, 0.6197]}, {"w": "look", "b": [0.3935, 0.6, 0.4384, 0.6197]}, {"w": "at", "b": [0.4447, 0.6, 0.4629, 0.6197]}, {"w": "data", "b": [0.4692, 0.6, 0.5112, 0.6197]}, {"w": "from", "b": [0.5175, 0.6, 0.5665, 0.6197]}, {"w": "longer", "b": [0.5729, 0.6, 0.6373, 0.6197]}, {"w": "ago", "b": [0.6436, 0.6, 0.68, 0.6197]}, {"w": "(by", "b": [0.6863, 0.6, 0.72, 0.6197]}, {"w": "increasing", "b": [0.7263, 0.6, 0.83, 0.6197]}, {"w": "the", "b": [0.8363, 0.6, 0.8671, 0.6197]}, {"w": "lookback", "b": [0.1294, 0.6215, 0.2505, 0.6417]}, {"w": "parameter", "b": [0.2568, 0.6205, 0.3577, 0.6402]}, {"w": "of", "b": [0.364, 0.6205, 0.385, 0.6402]}, {"w": "the", "b": [0.3913, 0.6205, 0.4221, 0.6402]}, {"w": "data", "b": [0.4284, 0.6205, 0.4705, 0.6402]}, {"w": "generator)", "b": [0.4768, 0.6205, 0.5804, 0.6402]}, {"w": "or", "b": [0.5867, 0.6205, 0.6077, 0.6402]}, {"w": "look", "b": [0.614, 0.6205, 0.6589, 0.6402]}, {"w": "at", "b": [0.6652, 0.6205, 0.6834, 0.6402]}, {"w": "high-resolution", "b": [0.6897, 0.6205, 0.8439, 0.6402]}, {"w": "timeseries", "b": [0.1294, 0.6419, 0.2317, 0.6616]}, {"w": "(by", "b": [0.238, 0.6419, 0.2716, 0.6616]}, {"w": "decreasing", "b": [0.2779, 0.6419, 0.3858, 0.6616]}, {"w": "the", "b": [0.3921, 0.6419, 0.4229, 0.6616]}, {"w": "step", "b": [0.4292, 0.6429, 0.4897, 0.6631]}, {"w": "parameter", "b": [0.496, 0.6419, 0.5969, 0.6616]}, {"w": "of", "b": [0.6032, 0.6419, 0.6242, 0.6616]}, {"w": "the", "b": [0.6305, 0.6419, 0.6613, 0.6616]}, {"w": "generator).", "b": [0.6676, 0.6419, 0.7776, 0.6616]}, {"w": "Here,", "b": [0.7839, 0.6419, 0.8392, 0.6616]}, {"w": "somewhat", "b": [0.1294, 0.6632, 0.2317, 0.683]}, {"w": "arbitrarily,", "b": [0.238, 0.6632, 0.3435, 0.683]}, {"w": "you’ll", "b": [0.3498, 0.6632, 0.4101, 0.683]}, {"w": "use", "b": [0.4164, 0.6632, 0.45, 0.683]}, {"w": "a", "b": [0.4563, 0.6632, 0.4675, 0.683]}, {"w": "step", "b": [0.4738, 0.6643, 0.5344, 0.6845]}, {"w": "that’s", "b": [0.5407, 0.6632, 0.5953, 0.683]}, {"w": "half", "b": [0.6016, 0.6632, 0.6409, 0.683]}, {"w": "as", "b": [0.6472, 0.6632, 0.6682, 0.683]}, {"w": "large,", "b": [0.6745, 0.6632, 0.7307, 0.683]}, {"w": "resulting", "b": [0.737, 0.6632, 0.8253, 0.683]}, {"w": "in", "b": [0.8316, 0.6632, 0.8513, 0.683]}, {"w": "a", "b": [0.8576, 0.6632, 0.8688, 0.683]}, {"w": "timeseries", "b": [0.1294, 0.6846, 0.2317, 0.7044]}, {"w": "twice", "b": [0.238, 0.6846, 0.2926, 0.7044]}, {"w": "as", "b": [0.299, 0.6846, 0.32, 0.7044]}, {"w": "long,", "b": [0.3263, 0.6846, 0.3774, 0.7044]}, {"w": "where", "b": [0.3837, 0.6846, 0.4454, 0.7044]}, {"w": "the", "b": [0.4517, 0.6846, 0.4825, 0.7044]}, {"w": "temperature", "b": [0.4887, 0.6846, 0.6092, 0.7044]}, {"w": "data", "b": [0.6155, 0.6846, 0.6576, 0.7044]}, {"w": "is", "b": [0.6639, 0.6846, 0.6807, 0.7044]}, {"w": "sampled", "b": [0.687, 0.6846, 0.7711, 0.7044]}, {"w": "at", "b": [0.7774, 0.6846, 0.7956, 0.7044]}, {"w": "a", "b": [0.8019, 0.6846, 0.8131, 0.7044]}, {"w": "rate", "b": [0.8194, 0.6846, 0.8572, 0.7044]}, {"w": "of", "b": [0.1294, 0.7051, 0.1504, 0.7249]}, {"w": "1", "b": [0.1567, 0.7051, 0.1693, 0.7249]}, {"w": "point", "b": [0.1757, 0.7051, 0.2275, 0.7249]}, {"w": "per", "b": [0.2338, 0.7051, 0.266, 0.7249]}, {"w": "30", "b": [0.2723, 0.7051, 0.2976, 0.7249]}, {"w": "minutes.", "b": [0.3039, 0.7051, 0.3901, 0.7249]}, {"w": "The", "b": [0.3964, 0.7051, 0.4356, 0.7249]}, {"w": "example", "b": [0.4419, 0.7051, 0.5274, 0.7249]}, {"w": "reuses", "b": [0.5337, 0.7051, 0.5967, 0.7249]}, {"w": "the", "b": [0.603, 0.7051, 0.6339, 0.7249]}, {"w": "generator", "b": [0.6401, 0.7062, 0.7763, 0.7264]}, {"w": "function", "b": [0.7826, 0.7051, 0.8667, 0.7249]}, {"w": "defined", "b": [0.1294, 0.7265, 0.2051, 0.7463]}, {"w": "earlier.", "b": [0.2114, 0.7265, 0.2807, 0.7463]}]}, {"id": "b_3", "type": "equation", "text": "Listing 6.48. Preparing higher-resolution data generators for the Jena dataset", "words": [{"w": "Listing", "b": [0.1294, 0.7644, 0.1862, 0.7792]}, {"w": "6.48.", "b": [0.1909, 0.7644, 0.2288, 0.7792]}, {"w": "Preparing", "b": [0.2335, 0.7644, 0.3151, 0.7792]}, {"w": "higher-resolution", "b": [0.3198, 0.7644, 0.4586, 0.7792]}, {"w": "data", "b": [0.4633, 0.7644, 0.499, 0.7792]}, {"w": "generators", "b": [0.5038, 0.7644, 0.5899, 0.7792]}, {"w": "for", "b": [0.5947, 0.7644, 0.6188, 0.7792]}, {"w": "the", "b": [0.6235, 0.7644, 0.6488, 0.7792]}, {"w": "Jena", "b": [0.6535, 0.7644, 0.6913, 0.7792]}, {"w": "dataset", "b": [0.6961, 0.7644, 0.7539, 0.7792]}]}, {"id": "b_4", "type": "paragraph", "text": "step = 3 1 lookback = 720 2 delay = 144 2 train_gen = generator(float_data, lookback=lookback, delay=delay, min_index=0,", "words": [{"w": "step", "b": [0.1357, 0.7928, 0.1811, 0.8079]}, {"w": "=", "b": [0.1925, 0.7928, 0.2038, 0.8079]}, {"w": "3", "b": [0.2152, 0.7928, 0.2265, 0.8079]}, {"w": "1", "b": [0.658, 0.7928, 0.6693, 0.8079]}, {"w": "lookback", "b": [0.1357, 0.8079, 0.2265, 0.8231]}, {"w": "=", "b": [0.2379, 0.8079, 0.2492, 0.8231]}, {"w": "720", "b": [0.2606, 0.8079, 0.2946, 0.8231]}, {"w": "2", "b": [0.658, 0.8079, 0.6693, 0.8231]}, {"w": "delay", "b": [0.1357, 0.8231, 0.1925, 0.8382]}, {"w": "=", "b": [0.2038, 0.8231, 0.2152, 0.8382]}, {"w": "144", "b": [0.2265, 0.8231, 0.2606, 0.8382]}, {"w": "2", "b": [0.658, 0.8231, 0.6693, 0.8382]}, {"w": "train_gen", "b": [0.1357, 0.8534, 0.2379, 0.8685]}, {"w": "=", "b": [0.2492, 0.8534, 0.2606, 0.8685]}, {"w": "generator(float_data,", "b": [0.2719, 0.8534, 0.5103, 0.8685]}, {"w": "lookback=lookback,", "b": [0.3855, 0.8685, 0.5898, 0.8837]}, {"w": "delay=delay,", "b": [0.3855, 0.8837, 0.5217, 0.8988]}, {"w": "min_index=0,", "b": [0.3855, 0.8989, 0.5217, 0.914]}]}]}, {"page": 302, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "max_index=200000, shuffle=True, step=step) val_gen = generator(float_data, lookback=lookback, delay=delay, min_index=200001, max_index=300000, step=step) test_gen = generator(float_data, lookback=lookback, delay=delay, min_index=300001, max_index=None, step=step) val_steps = (300000 - 200001 - lookback) // 128 test_steps = (len(float_data) - 300001 - lookback) // 128", "words": [{"w": "max_index=200000,", "b": [0.3855, 0.0851, 0.5784, 0.1002]}, {"w": "shuffle=True,", "b": [0.3855, 0.1002, 0.533, 0.1154]}, {"w": "step=step)", "b": [0.3855, 0.1154, 0.499, 0.1305]}, {"w": "val_gen", "b": [0.1357, 0.1305, 0.2152, 0.1457]}, {"w": "=", "b": [0.2265, 0.1305, 0.2379, 0.1457]}, {"w": "generator(float_data,", "b": [0.2492, 0.1305, 0.4876, 0.1457]}, {"w": "lookback=lookback,", "b": [0.3628, 0.1457, 0.5671, 0.1608]}, {"w": "delay=delay,", "b": [0.3628, 0.1608, 0.499, 0.176]}, {"w": "min_index=200001,", "b": [0.3628, 0.176, 0.5557, 0.1911]}, {"w": "max_index=300000,", "b": [0.3628, 0.1911, 0.5557, 0.2063]}, {"w": "step=step)", "b": [0.3628, 0.2063, 0.4763, 0.2214]}, {"w": "test_gen", "b": [0.1357, 0.2215, 0.2265, 0.2366]}, {"w": "=", "b": [0.2379, 0.2215, 0.2492, 0.2366]}, {"w": "generator(float_data,", "b": [0.2606, 0.2215, 0.499, 0.2366]}, {"w": "lookback=lookback,", "b": [0.3741, 0.2366, 0.5784, 0.2518]}, {"w": "delay=delay,", "b": [0.3741, 0.2518, 0.5103, 0.2669]}, {"w": "min_index=300001,", "b": [0.3741, 0.2669, 0.5671, 0.2821]}, {"w": "max_index=None,", "b": [0.3741, 0.2821, 0.5444, 0.2972]}, {"w": "step=step)", "b": [0.3741, 0.2972, 0.4876, 0.3124]}, {"w": "val_steps", "b": [0.1357, 0.3124, 0.2379, 0.3275]}, {"w": "=", "b": [0.2492, 0.3124, 0.2606, 0.3275]}, {"w": "(300000", "b": [0.2719, 0.3124, 0.3514, 0.3275]}, {"w": "-", "b": [0.3628, 0.3124, 0.3741, 0.3275]}, {"w": "200001", "b": [0.3855, 0.3124, 0.4536, 0.3275]}, {"w": "-", "b": [0.4649, 0.3124, 0.4763, 0.3275]}, {"w": "lookback)", "b": [0.4876, 0.3124, 0.5898, 0.3275]}, {"w": "//", "b": [0.6011, 0.3124, 0.6238, 0.3275]}, {"w": "128", "b": [0.6352, 0.3124, 0.6692, 0.3275]}, {"w": "test_steps", "b": [0.1357, 0.3275, 0.2492, 0.3427]}, {"w": "=", "b": [0.2606, 0.3275, 0.2719, 0.3427]}, {"w": "(len(float_data)", "b": [0.2833, 0.3275, 0.4649, 0.3427]}, {"w": "-", "b": [0.4763, 0.3275, 0.4876, 0.3427]}, {"w": "300001", "b": [0.499, 0.3275, 0.5671, 0.3427]}, {"w": "-", "b": [0.5784, 0.3275, 0.5898, 0.3427]}, {"w": "lookback)", "b": [0.6011, 0.3275, 0.7033, 0.3427]}, {"w": "//", "b": [0.7146, 0.3275, 0.7374, 0.3427]}, {"w": "128", "b": [0.7487, 0.3275, 0.7828, 0.3427]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Previously set to 6 (1 point per hour); now 3 (1 point per 30 min) 2 Unchanged", "words": [{"w": "1", "b": [0.1799, 0.3611, 0.1925, 0.3808]}, {"w": "Previously", "b": [0.1988, 0.3611, 0.3118, 0.3808]}, {"w": "set", "b": [0.3181, 0.3611, 0.3476, 0.3808]}, {"w": "to", "b": [0.3539, 0.3611, 0.3749, 0.3808]}, {"w": "6", "b": [0.3812, 0.3611, 0.3938, 0.3808]}, {"w": "(1", "b": [0.4001, 0.3611, 0.4211, 0.3808]}, {"w": "point", "b": [0.4274, 0.3611, 0.4835, 0.3808]}, {"w": "per", "b": [0.4898, 0.3611, 0.5262, 0.3808]}, {"w": "hour);", "b": [0.5325, 0.3611, 0.6012, 0.3808]}, {"w": "now", "b": [0.6075, 0.3611, 0.6524, 0.3808]}, {"w": "3", "b": [0.6587, 0.3611, 0.6713, 0.3808]}, {"w": "(1", "b": [0.6776, 0.3611, 0.6986, 0.3808]}, {"w": "point", "b": [0.7049, 0.3611, 0.761, 0.3808]}, {"w": "per", "b": [0.7673, 0.3611, 0.8037, 0.3808]}, {"w": "30", "b": [0.81, 0.3611, 0.8352, 0.3808]}, {"w": "min)", "b": [0.1799, 0.3816, 0.2303, 0.4013]}, {"w": "2", "b": [0.1799, 0.4021, 0.1925, 0.4218]}, {"w": "Unchanged", "b": [0.1988, 0.4021, 0.3207, 0.4218]}]}, {"id": "b_2", "type": "paragraph", "text": "This is the model, starting with two Conv1D layers and following up with a GRU layer. Figure 6.31 shows the results.", "words": [{"w": "This", "b": [0.1294, 0.4449, 0.1743, 0.4646]}, {"w": "is", "b": [0.1806, 0.4449, 0.1974, 0.4646]}, {"w": "the", "b": [0.2037, 0.4449, 0.2345, 0.4646]}, {"w": "model,", "b": [0.2408, 0.4449, 0.3102, 0.4646]}, {"w": "starting", "b": [0.3165, 0.4449, 0.3922, 0.4646]}, {"w": "with", "b": [0.3985, 0.4449, 0.4433, 0.4646]}, {"w": "two", "b": [0.4497, 0.4449, 0.4875, 0.4646]}, {"w": "Conv1D", "b": [0.4937, 0.4459, 0.5846, 0.4661]}, {"w": "layers", "b": [0.5909, 0.4449, 0.6511, 0.4646]}, {"w": "and", "b": [0.6574, 0.4449, 0.6938, 0.4646]}, {"w": "following", "b": [0.7001, 0.4449, 0.7982, 0.4646]}, {"w": "up", "b": [0.8046, 0.4449, 0.8298, 0.4646]}, {"w": "with", "b": [0.1294, 0.4663, 0.1743, 0.486]}, {"w": "a", "b": [0.1806, 0.4663, 0.1918, 0.486]}, {"w": "GRU", "b": [0.1981, 0.4673, 0.2435, 0.4875]}, {"w": "layer.", "b": [0.2498, 0.4663, 0.3051, 0.486]}, {"w": "Figure", "b": [0.3114, 0.4663, 0.3773, 0.486]}, {"w": "6.31", "b": [0.3836, 0.4663, 0.4277, 0.486]}, {"w": "shows", "b": [0.434, 0.4663, 0.4971, 0.486]}, {"w": "the", "b": [0.5034, 0.4663, 0.5342, 0.486]}, {"w": "results.", "b": [0.5405, 0.4663, 0.6127, 0.486]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 6.31. Training and validation loss on the Jena temperature-forecasting task with a 1D convnet followed by a gru", "words": [{"w": "Figure", "b": [0.1294, 0.505, 0.1827, 0.5198]}, {"w": "6.31.", "b": [0.1874, 0.505, 0.2252, 0.5198]}, {"w": "Training", "b": [0.2299, 0.505, 0.3, 0.5198]}, {"w": "and", "b": [0.3048, 0.505, 0.3353, 0.5198]}, {"w": "validation", "b": [0.34, 0.505, 0.4209, 0.5198]}, {"w": "loss", "b": [0.4257, 0.505, 0.4551, 0.5198]}, {"w": "on", "b": [0.4598, 0.505, 0.4798, 0.5198]}, {"w": "the", "b": [0.4846, 0.505, 0.5098, 0.5198]}, {"w": "Jena", "b": [0.5145, 0.505, 0.5523, 0.5198]}, {"w": "temperature-forecasting", "b": [0.5571, 0.505, 0.7529, 0.5198]}, {"w": "task", "b": [0.7576, 0.505, 0.7912, 0.5198]}, {"w": "with", "b": [0.796, 0.505, 0.8317, 0.5198]}, {"w": "a", "b": [0.8364, 0.505, 0.8459, 0.5198]}, {"w": "1D", "b": [0.1294, 0.5202, 0.1525, 0.535]}, {"w": "convnet", "b": [0.1573, 0.5202, 0.2203, 0.535]}, {"w": "followed", "b": [0.225, 0.5202, 0.2934, 0.535]}, {"w": "by", "b": [0.2981, 0.5202, 0.3181, 0.535]}, {"w": "a", "b": [0.3228, 0.5202, 0.3323, 0.535]}, {"w": "gru", "b": [0.337, 0.5209, 0.371, 0.5361]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.49. Model combining a 1D convolutional base and a GRU layer", "words": [{"w": "Listing", "b": [0.1294, 0.8214, 0.1862, 0.8362]}, {"w": "6.49.", "b": [0.1909, 0.8214, 0.2288, 0.8362]}, {"w": "Model", "b": [0.2335, 0.8214, 0.285, 0.8362]}, {"w": "combining", "b": [0.2897, 0.8214, 0.3749, 0.8362]}, {"w": "a", "b": [0.3796, 0.8214, 0.389, 0.8362]}, {"w": "1D", "b": [0.3938, 0.8214, 0.4169, 0.8362]}, {"w": "convolutional", "b": [0.4216, 0.8214, 0.531, 0.8362]}, {"w": "base", "b": [0.5357, 0.8214, 0.5714, 0.8362]}, {"w": "and", "b": [0.5762, 0.8214, 0.6067, 0.8362]}, {"w": "a", "b": [0.6114, 0.8214, 0.6208, 0.8362]}, {"w": "GRU", "b": [0.6256, 0.8222, 0.6596, 0.8373]}, {"w": "layer", "b": [0.6644, 0.8214, 0.7053, 0.8362]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras.models import Sequential from keras import layers from keras.optimizers import RMSprop", "words": [{"w": "from", "b": [0.1357, 0.8507, 0.1811, 0.8659]}, {"w": "keras.models", "b": [0.1925, 0.8507, 0.3287, 0.8659]}, {"w": "import", "b": [0.34, 0.8507, 0.4082, 0.8659]}, {"w": "Sequential", "b": [0.4195, 0.8507, 0.533, 0.8659]}, {"w": "from", "b": [0.1357, 0.8659, 0.1811, 0.881]}, {"w": "keras", "b": [0.1925, 0.8659, 0.2492, 0.881]}, {"w": "import", "b": [0.2606, 0.8659, 0.3287, 0.881]}, {"w": "layers", "b": [0.34, 0.8659, 0.4082, 0.881]}, {"w": "from", "b": [0.1357, 0.881, 0.1811, 0.8962]}, {"w": "keras.optimizers", "b": [0.1925, 0.881, 0.3741, 0.8962]}, {"w": "import", "b": [0.3855, 0.881, 0.4536, 0.8962]}, {"w": "RMSprop", "b": [0.4649, 0.881, 0.5444, 0.8962]}]}]}, {"page": 303, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model = Sequential() model.add(layers.Conv1D(32, 5, activation='relu', input_shape=(None, float_data.shape[-1]))) model.add(layers.MaxPooling1D(3)) model.add(layers.Conv1D(32, 5, activation='relu')) model.add(layers.GRU(32, dropout=0.1, recurrent_dropout=0.5)) model.add(layers.Dense(1)) model.summary() model.compile(optimizer=RMSprop(), loss='mae') history = model.fit_generator(train_gen, steps_per_epoch=500, epochs=20, validation_data=val_gen, validation_steps=val_steps)", "words": [{"w": "model", "b": [0.1357, 0.0851, 0.1925, 0.1002]}, {"w": "=", "b": [0.2038, 0.0851, 0.2152, 0.1002]}, {"w": "Sequential()", "b": [0.2265, 0.0851, 0.3628, 0.1002]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.1002, 0.4422, 0.1154]}, {"w": "5,", "b": [0.4536, 0.1002, 0.4763, 0.1154]}, {"w": "activation='relu',", "b": [0.4876, 0.1002, 0.6919, 0.1154]}, {"w": "input_shape=(None,", "b": [0.4082, 0.1154, 0.6125, 0.1305]}, {"w": "float_data.shape[-1])))", "b": [0.1357, 0.1305, 0.3968, 0.1457]}, {"w": "model.add(layers.MaxPooling1D(3))", "b": [0.1357, 0.1457, 0.5103, 0.1608]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.1608, 0.4422, 0.176]}, {"w": "5,", "b": [0.4536, 0.1608, 0.4763, 0.176]}, {"w": "activation='relu'))", "b": [0.4876, 0.1608, 0.7033, 0.176]}, {"w": "model.add(layers.GRU(32,", "b": [0.1357, 0.176, 0.4082, 0.1911]}, {"w": "dropout=0.1,", "b": [0.4195, 0.176, 0.5557, 0.1911]}, {"w": "recurrent_dropout=0.5))", "b": [0.5671, 0.176, 0.8282, 0.1911]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.1911, 0.4309, 0.2063]}, {"w": "model.summary()", "b": [0.1357, 0.2215, 0.306, 0.2366]}, {"w": "model.compile(optimizer=RMSprop(),", "b": [0.1357, 0.2518, 0.5217, 0.2669]}, {"w": "loss='mae')", "b": [0.533, 0.2518, 0.6579, 0.2669]}, {"w": "history", "b": [0.1357, 0.2669, 0.2152, 0.2821]}, {"w": "=", "b": [0.2265, 0.2669, 0.2379, 0.2821]}, {"w": "model.fit_generator(train_gen,", "b": [0.2492, 0.2669, 0.5898, 0.2821]}, {"w": "steps_per_epoch=500,", "b": [0.4763, 0.2821, 0.7033, 0.2972]}, {"w": "epochs=20,", "b": [0.4763, 0.2972, 0.5898, 0.3124]}, {"w": "validation_data=val_gen,", "b": [0.4763, 0.3124, 0.7487, 0.3275]}, {"w": "validation_steps=val_steps)", "b": [0.4763, 0.3275, 0.7828, 0.3427]}]}, {"id": "b_1", "type": "paragraph", "text": "Judging from the validation loss, this setup isn’t as good as the regularized GRU alone, but it’s significantly faster. It looks at twice as much data, which in this case doesn’t appear to be hugely helpful but may be important for other datasets.", "words": [{"w": "Judging", "b": [0.1294, 0.3655, 0.2093, 0.3853]}, {"w": "from", "b": [0.2156, 0.3655, 0.2646, 0.3853]}, {"w": "the", "b": [0.271, 0.3655, 0.3018, 0.3853]}, {"w": "validation", "b": [0.3081, 0.3655, 0.409, 0.3853]}, {"w": "loss,", "b": [0.4153, 0.3655, 0.4609, 0.3853]}, {"w": "this", "b": [0.4672, 0.3655, 0.5036, 0.3853]}, {"w": "setup", "b": [0.5099, 0.3655, 0.5632, 0.3853]}, {"w": "isn’t", "b": [0.5695, 0.3655, 0.6138, 0.3853]}, {"w": "as", "b": [0.6201, 0.3655, 0.6411, 0.3853]}, {"w": "good", "b": [0.6475, 0.3655, 0.6979, 0.3853]}, {"w": "as", "b": [0.7042, 0.3655, 0.7252, 0.3853]}, {"w": "the", "b": [0.7315, 0.3655, 0.7624, 0.3853]}, {"w": "regularized", "b": [0.1294, 0.386, 0.2429, 0.4058]}, {"w": "GRU", "b": [0.2492, 0.3871, 0.2946, 0.4073]}, {"w": "alone,", "b": [0.3009, 0.386, 0.3618, 0.4058]}, {"w": "but", "b": [0.3681, 0.386, 0.4004, 0.4058]}, {"w": "it’s", "b": [0.4067, 0.386, 0.4375, 0.4058]}, {"w": "significantly", "b": [0.4438, 0.386, 0.5699, 0.4058]}, {"w": "faster.", "b": [0.5762, 0.386, 0.6371, 0.4058]}, {"w": "It", "b": [0.6434, 0.386, 0.6589, 0.4058]}, {"w": "looks", "b": [0.6652, 0.386, 0.7198, 0.4058]}, {"w": "at", "b": [0.7261, 0.386, 0.7444, 0.4058]}, {"w": "twice", "b": [0.7507, 0.386, 0.8053, 0.4058]}, {"w": "as", "b": [0.8116, 0.386, 0.8326, 0.4058]}, {"w": "much", "b": [0.1294, 0.4074, 0.1855, 0.4272]}, {"w": "data,", "b": [0.1918, 0.4074, 0.2401, 0.4272]}, {"w": "which", "b": [0.2464, 0.4074, 0.3081, 0.4272]}, {"w": "in", "b": [0.3144, 0.4074, 0.334, 0.4272]}, {"w": "this", "b": [0.3403, 0.4074, 0.3768, 0.4272]}, {"w": "case", "b": [0.3831, 0.4074, 0.4265, 0.4272]}, {"w": "doesn’t", "b": [0.4328, 0.4074, 0.5065, 0.4272]}, {"w": "appear", "b": [0.5129, 0.4074, 0.5801, 0.4272]}, {"w": "to", "b": [0.5864, 0.4074, 0.606, 0.4272]}, {"w": "be", "b": [0.6123, 0.4074, 0.6361, 0.4272]}, {"w": "hugely", "b": [0.6424, 0.4074, 0.7111, 0.4272]}, {"w": "helpful", "b": [0.7174, 0.4074, 0.7889, 0.4272]}, {"w": "but", "b": [0.7951, 0.4074, 0.8274, 0.4272]}, {"w": "may", "b": [0.1294, 0.4279, 0.1729, 0.4477]}, {"w": "be", "b": [0.1792, 0.4279, 0.203, 0.4477]}, {"w": "important", "b": [0.2093, 0.4279, 0.3074, 0.4477]}, {"w": "for", "b": [0.3137, 0.4279, 0.3431, 0.4477]}, {"w": "other", "b": [0.3494, 0.4279, 0.4012, 0.4477]}, {"w": "datasets.", "b": [0.4076, 0.4279, 0.4937, 0.4477]}]}, {"id": "b_2", "type": "paragraph", "text": "6.4.5. Wrapping up", "words": [{"w": "6.4.5.", "b": [0.1294, 0.4752, 0.1862, 0.4949]}, {"w": "Wrapping", "b": [0.1925, 0.4752, 0.3028, 0.4949]}, {"w": "up", "b": [0.3091, 0.4752, 0.3371, 0.4949]}]}, {"id": "b_3", "type": "paragraph", "text": "Here’s what you should take away from this section:", "words": [{"w": "Here’s", "b": [0.1294, 0.518, 0.1952, 0.5377]}, {"w": "what", "b": [0.2016, 0.518, 0.2506, 0.5377]}, {"w": "you", "b": [0.2569, 0.518, 0.2947, 0.5377]}, {"w": "should", "b": [0.301, 0.518, 0.3683, 0.5377]}, {"w": "take", "b": [0.3746, 0.518, 0.4167, 0.5377]}, {"w": "away", "b": [0.423, 0.518, 0.4762, 0.5377]}, {"w": "from", "b": [0.4825, 0.518, 0.5315, 0.5377]}, {"w": "this", "b": [0.5378, 0.518, 0.5743, 0.5377]}, {"w": "section:", "b": [0.5806, 0.518, 0.6591, 0.5377]}]}, {"id": "b_4", "type": "paragraph", "text": "In the same way that 2D convnets perform well for processing visual patterns in 2D space, 1D convnets perform well for processing temporal patterns. They offer a faster alternative to RNNs on some problems, in particular natural--language processing tasks. Typically, 1D convnets are structured much like their 2D equivalents from the world of computer vision: they consist of stacks of Conv1D layers and Max-Pooling1D layers, ending in a global pooling operation or flattening operation. Because RNNs are extremely expensive for processing very long sequences, but 1D convnets are cheap, it can be a good idea to use a 1D convnet as a preprocessing step before an RNN, shortening the sequence and extracting useful representations for the RNN to process.", "words": [{"w": "In", "b": [0.1799, 0.5563, 0.2009, 0.576]}, {"w": "the", "b": [0.2072, 0.5563, 0.238, 0.576]}, {"w": "same", "b": [0.2443, 0.5563, 0.2962, 0.576]}, {"w": "way", "b": [0.3025, 0.5563, 0.3445, 0.576]}, {"w": "that", "b": [0.3508, 0.5563, 0.3886, 0.576]}, {"w": "2D", "b": [0.3949, 0.5563, 0.4258, 0.576]}, {"w": "convnets", "b": [0.4321, 0.5563, 0.5217, 0.576]}, {"w": "perform", "b": [0.5281, 0.5563, 0.6093, 0.576]}, {"w": "well", "b": [0.6156, 0.5563, 0.6591, 0.576]}, {"w": "for", "b": [0.6654, 0.5563, 0.6948, 0.576]}, {"w": "processing", "b": [0.7011, 0.5563, 0.809, 0.576]}, {"w": "visual", "b": [0.1799, 0.5768, 0.2401, 0.5965]}, {"w": "patterns", "b": [0.2464, 0.5768, 0.3263, 0.5965]}, {"w": "in", "b": [0.3326, 0.5768, 0.3522, 0.5965]}, {"w": "2D", "b": [0.3585, 0.5768, 0.3894, 0.5965]}, {"w": "space,", "b": [0.3957, 0.5768, 0.458, 0.5965]}, {"w": "1D", "b": [0.4643, 0.5768, 0.4951, 0.5965]}, {"w": "convnets", "b": [0.5014, 0.5768, 0.5911, 0.5965]}, {"w": "perform", "b": [0.5974, 0.5768, 0.6787, 0.5965]}, {"w": "well", "b": [0.685, 0.5768, 0.7284, 0.5965]}, {"w": "for", "b": [0.7347, 0.5768, 0.7641, 0.5965]}, {"w": "processing", "b": [0.1799, 0.5973, 0.2878, 0.617]}, {"w": "temporal", "b": [0.294, 0.5973, 0.3837, 0.617]}, {"w": "patterns.", "b": [0.39, 0.5973, 0.4762, 0.617]}, {"w": "They", "b": [0.4825, 0.5973, 0.5344, 0.617]}, {"w": "offer", "b": [0.5407, 0.5973, 0.5892, 0.617]}, {"w": "a", "b": [0.5955, 0.5973, 0.6067, 0.617]}, {"w": "faster", "b": [0.613, 0.5973, 0.669, 0.617]}, {"w": "alternative", "b": [0.6753, 0.5973, 0.7818, 0.617]}, {"w": "to", "b": [0.7881, 0.5973, 0.8077, 0.617]}, {"w": "RNNs", "b": [0.1799, 0.6178, 0.2429, 0.6375]}, {"w": "on", "b": [0.2492, 0.6178, 0.2745, 0.6375]}, {"w": "some", "b": [0.2808, 0.6178, 0.334, 0.6375]}, {"w": "problems,", "b": [0.3403, 0.6178, 0.4405, 0.6375]}, {"w": "in", "b": [0.4468, 0.6178, 0.4665, 0.6375]}, {"w": "particular", "b": [0.4728, 0.6178, 0.5694, 0.6375]}, {"w": "natural--language", "b": [0.5757, 0.6178, 0.7536, 0.6375]}, {"w": "processing", "b": [0.76, 0.6178, 0.8678, 0.6375]}, {"w": "tasks.", "b": [0.1799, 0.6383, 0.2366, 0.658]}, {"w": "Typically,", "b": [0.1799, 0.6588, 0.2794, 0.6785]}, {"w": "1D", "b": [0.2857, 0.6588, 0.3166, 0.6785]}, {"w": "convnets", "b": [0.3229, 0.6588, 0.4126, 0.6785]}, {"w": "are", "b": [0.4189, 0.6588, 0.4497, 0.6785]}, {"w": "structured", "b": [0.456, 0.6588, 0.5568, 0.6785]}, {"w": "much", "b": [0.5632, 0.6588, 0.6192, 0.6785]}, {"w": "like", "b": [0.6255, 0.6588, 0.6633, 0.6785]}, {"w": "their", "b": [0.6697, 0.6588, 0.7159, 0.6785]}, {"w": "2D", "b": [0.7222, 0.6588, 0.753, 0.6785]}, {"w": "equivalents", "b": [0.1799, 0.6793, 0.2948, 0.699]}, {"w": "from", "b": [0.3011, 0.6793, 0.3501, 0.699]}, {"w": "the", "b": [0.3564, 0.6793, 0.3872, 0.699]}, {"w": "world", "b": [0.3936, 0.6793, 0.4524, 0.699]}, {"w": "of", "b": [0.4587, 0.6793, 0.4797, 0.699]}, {"w": "computer", "b": [0.486, 0.6793, 0.5813, 0.699]}, {"w": "vision:", "b": [0.5876, 0.6793, 0.6563, 0.699]}, {"w": "they", "b": [0.6626, 0.6793, 0.706, 0.699]}, {"w": "consist", "b": [0.7124, 0.6793, 0.7824, 0.699]}, {"w": "of", "b": [0.7887, 0.6793, 0.8098, 0.699]}, {"w": "stacks", "b": [0.1799, 0.6998, 0.2415, 0.7195]}, {"w": "of", "b": [0.2478, 0.6998, 0.2688, 0.7195]}, {"w": "Conv1D", "b": [0.2751, 0.7008, 0.3659, 0.721]}, {"w": "layers", "b": [0.3722, 0.6998, 0.4325, 0.7195]}, {"w": "and", "b": [0.4388, 0.6998, 0.4752, 0.7195]}, {"w": "Max-Pooling1D", "b": [0.4815, 0.7008, 0.6783, 0.721]}, {"w": "layers,", "b": [0.6846, 0.6998, 0.7511, 0.7195]}, {"w": "ending", "b": [0.7574, 0.6998, 0.8261, 0.7195]}, {"w": "in", "b": [0.8324, 0.6998, 0.852, 0.7195]}, {"w": "a", "b": [0.8584, 0.6998, 0.8696, 0.7195]}, {"w": "global", "b": [0.1799, 0.7212, 0.2429, 0.7409]}, {"w": "pooling", "b": [0.2492, 0.7212, 0.3263, 0.7409]}, {"w": "operation", "b": [0.3326, 0.7212, 0.4279, 0.7409]}, {"w": "or", "b": [0.4342, 0.7212, 0.4552, 0.7409]}, {"w": "flattening", "b": [0.4615, 0.7212, 0.5582, 0.7409]}, {"w": "operation.", "b": [0.5645, 0.7212, 0.6661, 0.7409]}, {"w": "Because", "b": [0.1799, 0.7417, 0.2639, 0.7614]}, {"w": "RNNs", "b": [0.2702, 0.7417, 0.3333, 0.7614]}, {"w": "are", "b": [0.3396, 0.7417, 0.3704, 0.7614]}, {"w": "extremely", "b": [0.3767, 0.7417, 0.4776, 0.7614]}, {"w": "expensive", "b": [0.4839, 0.7417, 0.5848, 0.7614]}, {"w": "for", "b": [0.5911, 0.7417, 0.6205, 0.7614]}, {"w": "processing", "b": [0.6268, 0.7417, 0.7347, 0.7614]}, {"w": "very", "b": [0.741, 0.7417, 0.7858, 0.7614]}, {"w": "long", "b": [0.7921, 0.7417, 0.837, 0.7614]}, {"w": "sequences,", "b": [0.1799, 0.7622, 0.2884, 0.7819]}, {"w": "but", "b": [0.2947, 0.7622, 0.327, 0.7819]}, {"w": "1D", "b": [0.3333, 0.7622, 0.3641, 0.7819]}, {"w": "convnets", "b": [0.3704, 0.7622, 0.4601, 0.7819]}, {"w": "are", "b": [0.4664, 0.7622, 0.4972, 0.7819]}, {"w": "cheap,", "b": [0.5035, 0.7622, 0.5686, 0.7819]}, {"w": "it", "b": [0.5749, 0.7622, 0.589, 0.7819]}, {"w": "can", "b": [0.5953, 0.7622, 0.6303, 0.7819]}, {"w": "be", "b": [0.6366, 0.7622, 0.6604, 0.7819]}, {"w": "a", "b": [0.6667, 0.7622, 0.6779, 0.7819]}, {"w": "good", "b": [0.6842, 0.7622, 0.7347, 0.7819]}, {"w": "idea", "b": [0.741, 0.7622, 0.783, 0.7819]}, {"w": "to", "b": [0.7892, 0.7622, 0.8089, 0.7819]}, {"w": "use", "b": [0.8152, 0.7622, 0.8488, 0.7819]}, {"w": "a", "b": [0.8551, 0.7622, 0.8663, 0.7819]}, {"w": "1D", "b": [0.1799, 0.7827, 0.2107, 0.8024]}, {"w": "convnet", "b": [0.217, 0.7827, 0.2969, 0.8024]}, {"w": "as", "b": [0.3032, 0.7827, 0.3242, 0.8024]}, {"w": "a", "b": [0.3305, 0.7827, 0.3417, 0.8024]}, {"w": "preprocessing", "b": [0.348, 0.7827, 0.4881, 0.8024]}, {"w": "step", "b": [0.4944, 0.7827, 0.535, 0.8024]}, {"w": "before", "b": [0.5413, 0.7827, 0.6058, 0.8024]}, {"w": "an", "b": [0.6121, 0.7827, 0.6359, 0.8024]}, {"w": "RNN,", "b": [0.6422, 0.7827, 0.7018, 0.8024]}, {"w": "shortening", "b": [0.7081, 0.7827, 0.8146, 0.8024]}, {"w": "the", "b": [0.8209, 0.7827, 0.8517, 0.8024]}, {"w": "sequence", "b": [0.1799, 0.8032, 0.2723, 0.8229]}, {"w": "and", "b": [0.2786, 0.8032, 0.315, 0.8229]}, {"w": "extracting", "b": [0.3214, 0.8032, 0.4222, 0.8229]}, {"w": "useful", "b": [0.4285, 0.8032, 0.4902, 0.8229]}, {"w": "representations", "b": [0.4965, 0.8032, 0.6492, 0.8229]}, {"w": "for", "b": [0.6555, 0.8032, 0.6849, 0.8229]}, {"w": "the", "b": [0.6912, 0.8032, 0.722, 0.8229]}, {"w": "RNN", "b": [0.7283, 0.8032, 0.7816, 0.8229]}, {"w": "to", "b": [0.7879, 0.8032, 0.8075, 0.8229]}, {"w": "process.", "b": [0.1799, 0.8237, 0.2618, 0.8434]}]}, {"id": "b_5", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1294, 0.8754, 0.2191, 0.8951]}, {"w": "summary", "b": [0.2254, 0.8754, 0.3277, 0.8951]}]}]}, {"page": 304, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In this chapter, you learned the following techniques, which are widely applicable to any dataset of sequence data, from text to timeseries:", "words": [{"w": "In", "b": [0.1799, 0.0857, 0.2009, 0.1054]}, {"w": "this", "b": [0.2072, 0.0857, 0.2436, 0.1054]}, {"w": "chapter,", "b": [0.2499, 0.0857, 0.3295, 0.1054]}, {"w": "you", "b": [0.3358, 0.0857, 0.3736, 0.1054]}, {"w": "learned", "b": [0.3799, 0.0857, 0.4541, 0.1054]}, {"w": "the", "b": [0.4605, 0.0857, 0.4913, 0.1054]}, {"w": "following", "b": [0.4976, 0.0857, 0.5957, 0.1054]}, {"w": "techniques,", "b": [0.602, 0.0857, 0.7162, 0.1054]}, {"w": "which", "b": [0.7225, 0.0857, 0.7842, 0.1054]}, {"w": "are", "b": [0.7905, 0.0857, 0.8213, 0.1054]}, {"w": "widely", "b": [0.1799, 0.1062, 0.2485, 0.1259]}, {"w": "applicable", "b": [0.2548, 0.1062, 0.3585, 0.1259]}, {"w": "to", "b": [0.3648, 0.1062, 0.3844, 0.1259]}, {"w": "any", "b": [0.3908, 0.1062, 0.4272, 0.1259]}, {"w": "dataset", "b": [0.4335, 0.1062, 0.5035, 0.1259]}, {"w": "of", "b": [0.5098, 0.1062, 0.5309, 0.1259]}, {"w": "sequence", "b": [0.5372, 0.1062, 0.6296, 0.1259]}, {"w": "data,", "b": [0.6359, 0.1062, 0.6843, 0.1259]}, {"w": "from", "b": [0.6906, 0.1062, 0.7396, 0.1259]}, {"w": "text", "b": [0.7459, 0.1062, 0.7837, 0.1259]}, {"w": "to", "b": [0.7899, 0.1062, 0.8096, 0.1259]}, {"w": "timeseries:", "b": [0.1799, 0.1267, 0.2892, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "How to tokenize text What word embeddings are, and how to use them What recurrent networks are, and how to use them How to stack RNN layers and use bidirectional RNNs to build more-powerful sequence-processing models How to use 1D convnets for sequence processing How to combine 1D convnets and RNNs to process long sequences You can use RNNs for timeseries regression (“predicting the future”), timeseries classification, anomaly detection in timeseries, and sequence labeling (such as identifying names or dates in sentences). Similarly, you can use 1D convnets for machine translation (sequence-to-sequence convolutional models, like SliceNet[a]), document classification, and spelling correction.", "words": [{"w": "How", "b": [0.2303, 0.165, 0.2794, 0.1847]}, {"w": "to", "b": [0.2857, 0.165, 0.3053, 0.1847]}, {"w": "tokenize", "b": [0.3116, 0.165, 0.3971, 0.1847]}, {"w": "text", "b": [0.4034, 0.165, 0.4412, 0.1847]}, {"w": "What", "b": [0.2303, 0.1855, 0.285, 0.2052]}, {"w": "word", "b": [0.2913, 0.1855, 0.3431, 0.2052]}, {"w": "embeddings", "b": [0.3494, 0.1855, 0.4713, 0.2052]}, {"w": "are,", "b": [0.4776, 0.1855, 0.5147, 0.2052]}, {"w": "and", "b": [0.521, 0.1855, 0.5575, 0.2052]}, {"w": "how", "b": [0.5638, 0.1855, 0.6072, 0.2052]}, {"w": "to", "b": [0.6135, 0.1855, 0.6331, 0.2052]}, {"w": "use", "b": [0.6395, 0.1855, 0.6731, 0.2052]}, {"w": "them", "b": [0.6794, 0.1855, 0.7298, 0.2052]}, {"w": "What", "b": [0.2303, 0.206, 0.285, 0.2257]}, {"w": "recurrent", "b": [0.2913, 0.206, 0.3823, 0.2257]}, {"w": "networks", "b": [0.3886, 0.206, 0.4811, 0.2257]}, {"w": "are,", "b": [0.4874, 0.206, 0.5245, 0.2257]}, {"w": "and", "b": [0.5308, 0.206, 0.5672, 0.2257]}, {"w": "how", "b": [0.5735, 0.206, 0.617, 0.2257]}, {"w": "to", "b": [0.6233, 0.206, 0.6429, 0.2257]}, {"w": "use", "b": [0.6492, 0.206, 0.6828, 0.2257]}, {"w": "them", "b": [0.6891, 0.206, 0.7396, 0.2257]}, {"w": "How", "b": [0.2303, 0.2265, 0.2794, 0.2462]}, {"w": "to", "b": [0.2857, 0.2265, 0.3053, 0.2462]}, {"w": "stack", "b": [0.3116, 0.2265, 0.3634, 0.2462]}, {"w": "RNN", "b": [0.3697, 0.2265, 0.423, 0.2462]}, {"w": "layers", "b": [0.4293, 0.2265, 0.4895, 0.2462]}, {"w": "and", "b": [0.4958, 0.2265, 0.5323, 0.2462]}, {"w": "use", "b": [0.5386, 0.2265, 0.5722, 0.2462]}, {"w": "bidirectional", "b": [0.5785, 0.2265, 0.706, 0.2462]}, {"w": "RNNs", "b": [0.7123, 0.2265, 0.7754, 0.2462]}, {"w": "to", "b": [0.7817, 0.2265, 0.8013, 0.2462]}, {"w": "build", "b": [0.8076, 0.2265, 0.8595, 0.2462]}, {"w": "more-powerful", "b": [0.2303, 0.247, 0.3816, 0.2668]}, {"w": "sequence-processing", "b": [0.3879, 0.247, 0.5967, 0.2668]}, {"w": "models", "b": [0.603, 0.247, 0.6759, 0.2668]}, {"w": "How", "b": [0.2303, 0.2675, 0.2794, 0.2872]}, {"w": "to", "b": [0.2857, 0.2675, 0.3053, 0.2872]}, {"w": "use", "b": [0.3116, 0.2675, 0.3452, 0.2872]}, {"w": "1D", "b": [0.3515, 0.2675, 0.3824, 0.2872]}, {"w": "convnets", "b": [0.3887, 0.2675, 0.4783, 0.2872]}, {"w": "for", "b": [0.4846, 0.2675, 0.5141, 0.2872]}, {"w": "sequence", "b": [0.5204, 0.2675, 0.6128, 0.2872]}, {"w": "processing", "b": [0.6191, 0.2675, 0.727, 0.2872]}, {"w": "How", "b": [0.2303, 0.288, 0.2794, 0.3078]}, {"w": "to", "b": [0.2857, 0.288, 0.3053, 0.3078]}, {"w": "combine", "b": [0.3116, 0.288, 0.3985, 0.3078]}, {"w": "1D", "b": [0.4048, 0.288, 0.4356, 0.3078]}, {"w": "convnets", "b": [0.4419, 0.288, 0.5316, 0.3078]}, {"w": "and", "b": [0.5379, 0.288, 0.5743, 0.3078]}, {"w": "RNNs", "b": [0.5806, 0.288, 0.6437, 0.3078]}, {"w": "to", "b": [0.65, 0.288, 0.6696, 0.3078]}, {"w": "process", "b": [0.6759, 0.288, 0.7516, 0.3078]}, {"w": "long", "b": [0.7579, 0.288, 0.8027, 0.3078]}, {"w": "sequences", "b": [0.2303, 0.3085, 0.3326, 0.3282]}, {"w": "You", "b": [0.1799, 0.329, 0.2208, 0.3487]}, {"w": "can", "b": [0.2271, 0.329, 0.2621, 0.3487]}, {"w": "use", "b": [0.2684, 0.329, 0.302, 0.3487]}, {"w": "RNNs", "b": [0.3083, 0.329, 0.3714, 0.3487]}, {"w": "for", "b": [0.3777, 0.329, 0.4071, 0.3487]}, {"w": "timeseries", "b": [0.4134, 0.329, 0.5157, 0.3487]}, {"w": "regression", "b": [0.522, 0.329, 0.6257, 0.3487]}, {"w": "(“predicting", "b": [0.632, 0.329, 0.7539, 0.3487]}, {"w": "the", "b": [0.7602, 0.329, 0.791, 0.3487]}, {"w": "future”),", "b": [0.1799, 0.3495, 0.266, 0.3693]}, {"w": "timeseries", "b": [0.2723, 0.3495, 0.3746, 0.3693]}, {"w": "classification,", "b": [0.3809, 0.3495, 0.5203, 0.3693]}, {"w": "anomaly", "b": [0.5266, 0.3495, 0.6135, 0.3693]}, {"w": "detection", "b": [0.6198, 0.3495, 0.7123, 0.3693]}, {"w": "in", "b": [0.7186, 0.3495, 0.7382, 0.3693]}, {"w": "timeseries,", "b": [0.7445, 0.3495, 0.8531, 0.3693]}, {"w": "and", "b": [0.1799, 0.37, 0.2163, 0.3897]}, {"w": "sequence", "b": [0.2226, 0.37, 0.315, 0.3897]}, {"w": "labeling", "b": [0.3214, 0.37, 0.4026, 0.3897]}, {"w": "(such", "b": [0.4089, 0.37, 0.4636, 0.3897]}, {"w": "as", "b": [0.4699, 0.37, 0.4909, 0.3897]}, {"w": "identifying", "b": [0.4972, 0.37, 0.6079, 0.3897]}, {"w": "names", "b": [0.6142, 0.37, 0.6787, 0.3897]}, {"w": "or", "b": [0.685, 0.37, 0.706, 0.3897]}, {"w": "dates", "b": [0.7123, 0.37, 0.7641, 0.3897]}, {"w": "in", "b": [0.7704, 0.37, 0.7901, 0.3897]}, {"w": "sentences).", "b": [0.1799, 0.3905, 0.2912, 0.4103]}, {"w": "Similarly,", "b": [0.1799, 0.411, 0.2784, 0.4307]}, {"w": "you", "b": [0.2847, 0.411, 0.3226, 0.4307]}, {"w": "can", "b": [0.3289, 0.411, 0.3639, 0.4307]}, {"w": "use", "b": [0.3702, 0.411, 0.4038, 0.4307]}, {"w": "1D", "b": [0.4101, 0.411, 0.441, 0.4307]}, {"w": "convnets", "b": [0.4473, 0.411, 0.5369, 0.4307]}, {"w": "for", "b": [0.5432, 0.411, 0.5727, 0.4307]}, {"w": "machine", "b": [0.579, 0.411, 0.6644, 0.4307]}, {"w": "translation", "b": [0.6707, 0.411, 0.7772, 0.4307]}, {"w": "(sequence-to-sequence", "b": [0.1799, 0.4333, 0.4096, 0.453]}, {"w": "convolutional", "b": [0.4159, 0.4333, 0.5546, 0.453]}, {"w": "models,", "b": [0.5609, 0.4333, 0.6401, 0.453]}, {"w": "like", "b": [0.6464, 0.4333, 0.6843, 0.453]}, {"w": "SliceNet[a]),", "b": [0.6906, 0.431, 0.813, 0.453]}, {"w": "document", "b": [0.1799, 0.4538, 0.2794, 0.4735]}, {"w": "classification,", "b": [0.2857, 0.4538, 0.4251, 0.4735]}, {"w": "and", "b": [0.4314, 0.4538, 0.4678, 0.4735]}, {"w": "spelling", "b": [0.4741, 0.4538, 0.554, 0.4735]}, {"w": "correction.", "b": [0.5603, 0.4538, 0.6689, 0.4735]}]}, {"id": "b_3", "type": "equation", "text": "See https://arxiv.org/abs/1706.03059.", "words": [{"w": "See", "b": [0.1988, 0.5148, 0.2261, 0.5296]}, {"w": "https://arxiv.org/abs/1706.03059.", "b": [0.2308, 0.5148, 0.481, 0.5296]}]}, {"id": "b_4", "type": "paragraph", "text": "If global order matters in your sequence data, then it’s preferable to use a recurrent network to process it. This is typically the case for timeseries, where the recent past is likely to be more informative than the distant past. If global ordering isn’t fundamentally meaningful, then 1D convnets will turn out to work at least as well and are cheaper. This is often the case for text data, where a keyword found at the beginning of a sentence is just as meaningful as a keyword found at the end.", "words": [{"w": "If", "b": [0.1799, 0.5438, 0.1967, 0.5636]}, {"w": "global", "b": [0.203, 0.5438, 0.2674, 0.5636]}, {"w": "order", "b": [0.2737, 0.5438, 0.3289, 0.5636]}, {"w": "matters", "b": [0.3352, 0.5438, 0.4108, 0.5636]}, {"w": "in", "b": [0.4171, 0.5438, 0.4368, 0.5636]}, {"w": "your", "b": [0.4431, 0.5438, 0.4893, 0.5636]}, {"w": "sequence", "b": [0.4956, 0.5438, 0.5881, 0.5636]}, {"w": "data,", "b": [0.5944, 0.5438, 0.6427, 0.5636]}, {"w": "then", "b": [0.649, 0.5438, 0.6925, 0.5636]}, {"w": "it’s", "b": [0.6988, 0.5438, 0.7296, 0.5636]}, {"w": "preferable", "b": [0.7359, 0.5438, 0.8381, 0.5636]}, {"w": "to", "b": [0.8444, 0.5438, 0.864, 0.5636]}, {"w": "use", "b": [0.1799, 0.5643, 0.2135, 0.5841]}, {"w": "a", "b": [0.2198, 0.5643, 0.231, 0.5841]}, {"w": "recurrent", "b": [0.2373, 0.5643, 0.3283, 0.5841]}, {"w": "network", "b": [0.3346, 0.5643, 0.4173, 0.5841]}, {"w": "to", "b": [0.4236, 0.5643, 0.4432, 0.5841]}, {"w": "process", "b": [0.4496, 0.5643, 0.5252, 0.5841]}, {"w": "it.", "b": [0.5315, 0.5643, 0.5518, 0.5841]}, {"w": "This", "b": [0.5581, 0.5643, 0.603, 0.5841]}, {"w": "is", "b": [0.6093, 0.5643, 0.6261, 0.5841]}, {"w": "typically", "b": [0.6324, 0.5643, 0.7207, 0.5841]}, {"w": "the", "b": [0.727, 0.5643, 0.7579, 0.5841]}, {"w": "case", "b": [0.7642, 0.5643, 0.8076, 0.5841]}, {"w": "for", "b": [0.8139, 0.5643, 0.8433, 0.5841]}, {"w": "timeseries,", "b": [0.1799, 0.5848, 0.2885, 0.6046]}, {"w": "where", "b": [0.2947, 0.5848, 0.3564, 0.6046]}, {"w": "the", "b": [0.3627, 0.5848, 0.3935, 0.6046]}, {"w": "recent", "b": [0.3998, 0.5848, 0.4614, 0.6046]}, {"w": "past", "b": [0.4677, 0.5848, 0.5084, 0.6046]}, {"w": "is", "b": [0.5147, 0.5848, 0.5315, 0.6046]}, {"w": "likely", "b": [0.5378, 0.5848, 0.5953, 0.6046]}, {"w": "to", "b": [0.6016, 0.5848, 0.6212, 0.6046]}, {"w": "be", "b": [0.6275, 0.5848, 0.6513, 0.6046]}, {"w": "more", "b": [0.6576, 0.5848, 0.7095, 0.6046]}, {"w": "informative", "b": [0.7158, 0.5848, 0.8335, 0.6046]}, {"w": "than", "b": [0.1799, 0.6053, 0.2233, 0.6251]}, {"w": "the", "b": [0.2296, 0.6053, 0.2604, 0.6251]}, {"w": "distant", "b": [0.2667, 0.6053, 0.334, 0.6251]}, {"w": "past.", "b": [0.3403, 0.6053, 0.3873, 0.6251]}, {"w": "If", "b": [0.1799, 0.6258, 0.1967, 0.6456]}, {"w": "global", "b": [0.203, 0.6258, 0.2674, 0.6456]}, {"w": "ordering", "b": [0.2737, 0.6258, 0.3611, 0.6456]}, {"w": "isn’t", "b": [0.3674, 0.6258, 0.4095, 0.6456]}, {"w": "fundamentally", "b": [0.4158, 0.6258, 0.5601, 0.6456]}, {"w": "meaningful,", "b": [0.5664, 0.6258, 0.6862, 0.6456]}, {"w": "then", "b": [0.6925, 0.6258, 0.7359, 0.6456]}, {"w": "1D", "b": [0.7422, 0.6258, 0.7731, 0.6456]}, {"w": "convnets", "b": [0.7794, 0.6258, 0.8691, 0.6456]}, {"w": "will", "b": [0.1799, 0.6463, 0.2191, 0.6661]}, {"w": "turn", "b": [0.2254, 0.6463, 0.2661, 0.6661]}, {"w": "out", "b": [0.2724, 0.6463, 0.3046, 0.6661]}, {"w": "to", "b": [0.3109, 0.6463, 0.3305, 0.6661]}, {"w": "work", "b": [0.3368, 0.6463, 0.3887, 0.6661]}, {"w": "at", "b": [0.395, 0.6463, 0.4132, 0.6661]}, {"w": "least", "b": [0.4195, 0.6463, 0.4657, 0.6661]}, {"w": "as", "b": [0.4721, 0.6463, 0.4931, 0.6661]}, {"w": "well", "b": [0.4994, 0.6463, 0.5428, 0.6661]}, {"w": "and", "b": [0.5491, 0.6463, 0.5855, 0.6661]}, {"w": "are", "b": [0.5919, 0.6463, 0.6227, 0.6661]}, {"w": "cheaper.", "b": [0.629, 0.6463, 0.7122, 0.6661]}, {"w": "This", "b": [0.7185, 0.6463, 0.7634, 0.6661]}, {"w": "is", "b": [0.7697, 0.6463, 0.7865, 0.6661]}, {"w": "often", "b": [0.7928, 0.6463, 0.8447, 0.6661]}, {"w": "the", "b": [0.1799, 0.6668, 0.2107, 0.6866]}, {"w": "case", "b": [0.217, 0.6668, 0.2604, 0.6866]}, {"w": "for", "b": [0.2667, 0.6668, 0.2961, 0.6866]}, {"w": "text", "b": [0.3024, 0.6668, 0.3403, 0.6866]}, {"w": "data,", "b": [0.3466, 0.6668, 0.3949, 0.6866]}, {"w": "where", "b": [0.4012, 0.6668, 0.4628, 0.6866]}, {"w": "a", "b": [0.4692, 0.6668, 0.4804, 0.6866]}, {"w": "keyword", "b": [0.4867, 0.6668, 0.5749, 0.6866]}, {"w": "found", "b": [0.5812, 0.6668, 0.64, 0.6866]}, {"w": "at", "b": [0.6463, 0.6668, 0.6645, 0.6866]}, {"w": "the", "b": [0.6708, 0.6668, 0.7017, 0.6866]}, {"w": "beginning", "b": [0.708, 0.6668, 0.8089, 0.6866]}, {"w": "of", "b": [0.8152, 0.6668, 0.8362, 0.6866]}, {"w": "a", "b": [0.8425, 0.6668, 0.8537, 0.6866]}, {"w": "sentence", "b": [0.1799, 0.6873, 0.2667, 0.7071]}, {"w": "is", "b": [0.273, 0.6873, 0.2898, 0.7071]}, {"w": "just", "b": [0.2962, 0.6873, 0.3326, 0.7071]}, {"w": "as", "b": [0.3389, 0.6873, 0.3599, 0.7071]}, {"w": "meaningful", "b": [0.3662, 0.6873, 0.4811, 0.7071]}, {"w": "as", "b": [0.4874, 0.6873, 0.5085, 0.7071]}, {"w": "a", "b": [0.5148, 0.6873, 0.526, 0.7071]}, {"w": "keyword", "b": [0.5323, 0.6873, 0.6205, 0.7071]}, {"w": "found", "b": [0.6268, 0.6873, 0.6857, 0.7071]}, {"w": "at", "b": [0.692, 0.6873, 0.7102, 0.7071]}, {"w": "the", "b": [0.7165, 0.6873, 0.7473, 0.7071]}, {"w": "end.", "b": [0.7536, 0.6873, 0.7964, 0.7071]}]}]}, {"page": 305, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Chapter 7. Advanced deep-learning best practices", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "7.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Advanced", "b": [0.3011, 0.1076, 0.4539, 0.1355]}, {"w": "deep-learning", "b": [0.4629, 0.1076, 0.6733, 0.1355]}, {"w": "best", "b": [0.6822, 0.1076, 0.7437, 0.1355]}, {"w": "practices", "b": [0.1294, 0.137, 0.2663, 0.165]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1882, 0.1729, 0.2079]}, {"w": "chapter", "b": [0.1792, 0.1882, 0.2562, 0.2079]}, {"w": "covers", "b": [0.2626, 0.1882, 0.3284, 0.2079]}]}, {"id": "b_2", "type": "paragraph", "text": "The Keras functional API Using Keras callbacks Working with the TensorBoard visualization tool Important best practices for developing state-of-the-art models", "words": [{"w": "The", "b": [0.1799, 0.2265, 0.2191, 0.2462]}, {"w": "Keras", "b": [0.2254, 0.2265, 0.2842, 0.2462]}, {"w": "functional", "b": [0.2905, 0.2265, 0.3928, 0.2462]}, {"w": "API", "b": [0.3991, 0.2265, 0.4398, 0.2462]}, {"w": "Using", "b": [0.1799, 0.247, 0.2401, 0.2667]}, {"w": "Keras", "b": [0.2464, 0.247, 0.3053, 0.2667]}, {"w": "callbacks", "b": [0.3116, 0.247, 0.4054, 0.2667]}, {"w": "Working", "b": [0.1799, 0.2675, 0.2675, 0.2872]}, {"w": "with", "b": [0.2738, 0.2675, 0.3187, 0.2872]}, {"w": "the", "b": [0.325, 0.2675, 0.3558, 0.2872]}, {"w": "TensorBoard", "b": [0.3621, 0.2675, 0.492, 0.2872]}, {"w": "visualization", "b": [0.4983, 0.2675, 0.6273, 0.2872]}, {"w": "tool", "b": [0.6336, 0.2675, 0.6728, 0.2872]}, {"w": "Important", "b": [0.1799, 0.288, 0.2794, 0.3077]}, {"w": "best", "b": [0.2857, 0.288, 0.3263, 0.3077]}, {"w": "practices", "b": [0.3326, 0.288, 0.4223, 0.3077]}, {"w": "for", "b": [0.4286, 0.288, 0.458, 0.3077]}, {"w": "developing", "b": [0.4643, 0.288, 0.5764, 0.3077]}, {"w": "state-of-the-art", "b": [0.5827, 0.288, 0.7326, 0.3077]}, {"w": "models", "b": [0.7389, 0.288, 0.8118, 0.3077]}]}, {"id": "b_3", "type": "paragraph", "text": "This chapter explores a number of powerful tools that will bring you closer to being able to develop state-of-the-art models on difficult problems. Using the Keras functional API, you can build graph-like models, share a layer across different inputs, and use Keras models just like Python functions. Keras callbacks and the TensorBoard browser- based visualization tool let you monitor models during training. We’ll also discuss several other best practices including batch normalization, residual connections, hyperparameter optimization, and model ensembling.", "words": [{"w": "This", "b": [0.1294, 0.3308, 0.1743, 0.3505]}, {"w": "chapter", "b": [0.1806, 0.3308, 0.2548, 0.3505]}, {"w": "explores", "b": [0.2611, 0.3308, 0.3466, 0.3505]}, {"w": "a", "b": [0.3529, 0.3308, 0.3641, 0.3505]}, {"w": "number", "b": [0.3704, 0.3308, 0.4475, 0.3505]}, {"w": "of", "b": [0.4538, 0.3308, 0.4748, 0.3505]}, {"w": "powerful", "b": [0.4811, 0.3308, 0.5721, 0.3505]}, {"w": "tools", "b": [0.5785, 0.3308, 0.6275, 0.3505]}, {"w": "that", "b": [0.6338, 0.3308, 0.6717, 0.3505]}, {"w": "will", "b": [0.678, 0.3308, 0.7172, 0.3505]}, {"w": "bring", "b": [0.7235, 0.3308, 0.7768, 0.3505]}, {"w": "you", "b": [0.7831, 0.3308, 0.8209, 0.3505]}, {"w": "closer", "b": [0.1294, 0.3513, 0.1897, 0.371]}, {"w": "to", "b": [0.196, 0.3513, 0.2156, 0.371]}, {"w": "being", "b": [0.2219, 0.3513, 0.2779, 0.371]}, {"w": "able", "b": [0.2842, 0.3513, 0.3263, 0.371]}, {"w": "to", "b": [0.3326, 0.3513, 0.3522, 0.371]}, {"w": "develop", "b": [0.3585, 0.3513, 0.4384, 0.371]}, {"w": "state-of-the-art", "b": [0.4447, 0.3513, 0.5946, 0.371]}, {"w": "models", "b": [0.6009, 0.3513, 0.6738, 0.371]}, {"w": "on", "b": [0.68, 0.3513, 0.7052, 0.371]}, {"w": "difficult", "b": [0.7115, 0.3513, 0.7923, 0.371]}, {"w": "problems.", "b": [0.1294, 0.3718, 0.2296, 0.3915]}, {"w": "Using", "b": [0.2359, 0.3718, 0.2962, 0.3915]}, {"w": "the", "b": [0.3025, 0.3718, 0.3333, 0.3915]}, {"w": "Keras", "b": [0.3396, 0.3718, 0.3984, 0.3915]}, {"w": "functional", "b": [0.4048, 0.3718, 0.507, 0.3915]}, {"w": "API,", "b": [0.5133, 0.3718, 0.5603, 0.3915]}, {"w": "you", "b": [0.5666, 0.3718, 0.6044, 0.3915]}, {"w": "can", "b": [0.6107, 0.3718, 0.6458, 0.3915]}, {"w": "build", "b": [0.6521, 0.3718, 0.7039, 0.3915]}, {"w": "graph-like", "b": [0.7102, 0.3718, 0.8139, 0.3915]}, {"w": "models,", "b": [0.1294, 0.3923, 0.2086, 0.412]}, {"w": "share", "b": [0.2149, 0.3923, 0.2681, 0.412]}, {"w": "a", "b": [0.2744, 0.3923, 0.2856, 0.412]}, {"w": "layer", "b": [0.2919, 0.3923, 0.3424, 0.412]}, {"w": "across", "b": [0.3487, 0.3923, 0.4117, 0.412]}, {"w": "different", "b": [0.418, 0.3923, 0.5044, 0.412]}, {"w": "inputs,", "b": [0.5107, 0.3923, 0.5787, 0.412]}, {"w": "and", "b": [0.585, 0.3923, 0.6214, 0.412]}, {"w": "use", "b": [0.6277, 0.3923, 0.6613, 0.412]}, {"w": "Keras", "b": [0.6676, 0.3923, 0.7264, 0.412]}, {"w": "models", "b": [0.7328, 0.3923, 0.8056, 0.412]}, {"w": "just", "b": [0.8119, 0.3923, 0.8484, 0.412]}, {"w": "like", "b": [0.1294, 0.4128, 0.1673, 0.4325]}, {"w": "Python", "b": [0.1736, 0.4128, 0.245, 0.4325]}, {"w": "functions.", "b": [0.2514, 0.4128, 0.3516, 0.4325]}, {"w": "Keras", "b": [0.3579, 0.4128, 0.4167, 0.4325]}, {"w": "callbacks", "b": [0.423, 0.4128, 0.5169, 0.4325]}, {"w": "and", "b": [0.5232, 0.4128, 0.5596, 0.4325]}, {"w": "the", "b": [0.5659, 0.4128, 0.5967, 0.4325]}, {"w": "TensorBoard", "b": [0.603, 0.4128, 0.7329, 0.4325]}, {"w": "browser-", "b": [0.7392, 0.4128, 0.8284, 0.4325]}, {"w": "based", "b": [0.1294, 0.4333, 0.1869, 0.453]}, {"w": "visualization", "b": [0.1932, 0.4333, 0.3221, 0.453]}, {"w": "tool", "b": [0.3284, 0.4333, 0.3676, 0.453]}, {"w": "let", "b": [0.374, 0.4333, 0.3992, 0.453]}, {"w": "you", "b": [0.4054, 0.4333, 0.4433, 0.453]}, {"w": "monitor", "b": [0.4496, 0.4333, 0.5295, 0.453]}, {"w": "models", "b": [0.5358, 0.4333, 0.6086, 0.453]}, {"w": "during", "b": [0.6149, 0.4333, 0.6808, 0.453]}, {"w": "training.", "b": [0.6871, 0.4333, 0.7719, 0.453]}, {"w": "We’ll", "b": [0.7782, 0.4333, 0.8336, 0.453]}, {"w": "also", "b": [0.1294, 0.4538, 0.1701, 0.4735]}, {"w": "discuss", "b": [0.1764, 0.4538, 0.2492, 0.4735]}, {"w": "several", "b": [0.2555, 0.4538, 0.327, 0.4735]}, {"w": "other", "b": [0.3333, 0.4538, 0.3851, 0.4735]}, {"w": "best", "b": [0.3914, 0.4538, 0.4321, 0.4735]}, {"w": "practices", "b": [0.4384, 0.4538, 0.528, 0.4735]}, {"w": "including", "b": [0.5343, 0.4538, 0.6296, 0.4735]}, {"w": "batch", "b": [0.6359, 0.4538, 0.6906, 0.4735]}, {"w": "normalization,", "b": [0.6969, 0.4538, 0.8433, 0.4735]}, {"w": "residual", "b": [0.1294, 0.4743, 0.2093, 0.494]}, {"w": "connections,", "b": [0.2156, 0.4743, 0.3424, 0.494]}, {"w": "hyperparameter", "b": [0.3487, 0.4743, 0.507, 0.494]}, {"w": "optimization,", "b": [0.5133, 0.4743, 0.6471, 0.494]}, {"w": "and", "b": [0.6534, 0.4743, 0.6898, 0.494]}, {"w": "model", "b": [0.6962, 0.4743, 0.7592, 0.494]}, {"w": "ensembling.", "b": [0.1294, 0.4948, 0.252, 0.5145]}]}, {"id": "b_4", "type": "paragraph", "text": "7.1. Going beyond the Sequential model: the Keras functional API", "words": [{"w": "7.1.", "b": [0.1294, 0.5516, 0.172, 0.5738]}, {"w": "Going", "b": [0.1791, 0.5516, 0.2532, 0.5738]}, {"w": "beyond", "b": [0.2603, 0.5516, 0.3486, 0.5738]}, {"w": "the", "b": [0.3557, 0.5516, 0.3935, 0.5738]}, {"w": "Sequential", "b": [0.4006, 0.5516, 0.5284, 0.5738]}, {"w": "model:", "b": [0.5355, 0.5516, 0.619, 0.5738]}, {"w": "the", "b": [0.6261, 0.5516, 0.6639, 0.5738]}, {"w": "Keras", "b": [0.671, 0.5516, 0.7435, 0.5738]}, {"w": "functional", "b": [0.1294, 0.5757, 0.2524, 0.5979]}, {"w": "API", "b": [0.2595, 0.5757, 0.3084, 0.5979]}]}, {"id": "b_5", "type": "paragraph", "text": "Until now, all neural networks introduced in this book have been implemented using the Sequential model. The Sequential model makes the assumption that the network has exactly one input and exactly one output, and that it consists of a linear stack of layers (see figure 7.1).", "words": [{"w": "Until", "b": [0.1294, 0.6214, 0.1813, 0.6411]}, {"w": "now,", "b": [0.1876, 0.6214, 0.2357, 0.6411]}, {"w": "all", "b": [0.242, 0.6214, 0.2672, 0.6411]}, {"w": "neural", "b": [0.2735, 0.6214, 0.3366, 0.6411]}, {"w": "networks", "b": [0.3429, 0.6214, 0.4353, 0.6411]}, {"w": "introduced", "b": [0.4417, 0.6214, 0.5495, 0.6411]}, {"w": "in", "b": [0.5559, 0.6214, 0.5755, 0.6411]}, {"w": "this", "b": [0.5818, 0.6214, 0.6182, 0.6411]}, {"w": "book", "b": [0.6245, 0.6214, 0.675, 0.6411]}, {"w": "have", "b": [0.6813, 0.6214, 0.7289, 0.6411]}, {"w": "been", "b": [0.7352, 0.6214, 0.7829, 0.6411]}, {"w": "implemented", "b": [0.1294, 0.6419, 0.2611, 0.6616]}, {"w": "using", "b": [0.2674, 0.6419, 0.3221, 0.6616]}, {"w": "the", "b": [0.3284, 0.6419, 0.3592, 0.6616]}, {"w": "Sequential", "b": [0.3655, 0.6429, 0.5169, 0.6631]}, {"w": "model.", "b": [0.5232, 0.6419, 0.5926, 0.6616]}, {"w": "The", "b": [0.5989, 0.6419, 0.6381, 0.6616]}, {"w": "Sequential", "b": [0.6444, 0.6429, 0.7957, 0.6631]}, {"w": "model", "b": [0.8021, 0.6419, 0.8651, 0.6616]}, {"w": "makes", "b": [0.1294, 0.6632, 0.1939, 0.683]}, {"w": "the", "b": [0.2002, 0.6632, 0.231, 0.683]}, {"w": "assumption", "b": [0.2373, 0.6632, 0.3522, 0.683]}, {"w": "that", "b": [0.3585, 0.6632, 0.3964, 0.683]}, {"w": "the", "b": [0.4027, 0.6632, 0.4335, 0.683]}, {"w": "network", "b": [0.4398, 0.6632, 0.5225, 0.683]}, {"w": "has", "b": [0.5288, 0.6632, 0.5624, 0.683]}, {"w": "exactly", "b": [0.5687, 0.6632, 0.6416, 0.683]}, {"w": "one", "b": [0.6479, 0.6632, 0.6843, 0.683]}, {"w": "input", "b": [0.6906, 0.6632, 0.7425, 0.683]}, {"w": "and", "b": [0.7488, 0.6632, 0.7852, 0.683]}, {"w": "exactly", "b": [0.7915, 0.6632, 0.8644, 0.683]}, {"w": "one", "b": [0.1294, 0.6837, 0.1658, 0.7035]}, {"w": "output,", "b": [0.1721, 0.6837, 0.2429, 0.7035]}, {"w": "and", "b": [0.2492, 0.6837, 0.2857, 0.7035]}, {"w": "that", "b": [0.292, 0.6837, 0.3298, 0.7035]}, {"w": "it", "b": [0.3361, 0.6837, 0.3501, 0.7035]}, {"w": "consists", "b": [0.3564, 0.6837, 0.4363, 0.7035]}, {"w": "of", "b": [0.4426, 0.6837, 0.4637, 0.7035]}, {"w": "a", "b": [0.47, 0.6837, 0.4812, 0.7035]}, {"w": "linear", "b": [0.4875, 0.6837, 0.5449, 0.7035]}, {"w": "stack", "b": [0.5512, 0.6837, 0.603, 0.7035]}, {"w": "of", "b": [0.6093, 0.6837, 0.6303, 0.7035]}, {"w": "layers", "b": [0.6366, 0.6837, 0.6969, 0.7035]}, {"w": "(see", "b": [0.7032, 0.6837, 0.7438, 0.7035]}, {"w": "figure", "b": [0.7501, 0.6837, 0.8103, 0.7035]}, {"w": "7.1).", "b": [0.8166, 0.6837, 0.8628, 0.7035]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 7.1. A sequential model: a linear stack of layers", "words": [{"w": "Figure", "b": [0.1294, 0.7216, 0.1827, 0.7364]}, {"w": "7.1.", "b": [0.1874, 0.7216, 0.2158, 0.7364]}, {"w": "A", "b": [0.2205, 0.7216, 0.2341, 0.7364]}, {"w": "sequential", "b": [0.2389, 0.7224, 0.3524, 0.7375]}, {"w": "model:", "b": [0.3571, 0.7216, 0.4128, 0.7364]}, {"w": "a", "b": [0.4175, 0.7216, 0.427, 0.7364]}, {"w": "linear", "b": [0.4317, 0.7216, 0.479, 0.7364]}, {"w": "stack", "b": [0.4838, 0.7216, 0.5258, 0.7364]}, {"w": "of", "b": [0.5305, 0.7216, 0.5463, 0.7364]}, {"w": "layers", "b": [0.551, 0.7216, 0.5994, 0.7364]}]}]}, {"page": 306, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This is a commonly verified assumption; the configuration is so common that we’ve been able to cover many topics and practical applications in these pages so far using only the Sequential model class. But this set of assumptions is too inflexible in a number of cases. Some networks require several independent inputs, others require multiple outputs, and some networks have internal branching between layers that makes them look like graphs of layers rather than linear stacks of layers.", "words": [{"w": "This", "b": [0.1294, 0.3005, 0.1743, 0.3202]}, {"w": "is", "b": [0.1806, 0.3005, 0.1974, 0.3202]}, {"w": "a", "b": [0.2037, 0.3005, 0.2149, 0.3202]}, {"w": "commonly", "b": [0.2212, 0.3005, 0.3291, 0.3202]}, {"w": "verified", "b": [0.3354, 0.3005, 0.4139, 0.3202]}, {"w": "assumption;", "b": [0.4202, 0.3005, 0.5421, 0.3202]}, {"w": "the", "b": [0.5484, 0.3005, 0.5793, 0.3202]}, {"w": "configuration", "b": [0.5856, 0.3005, 0.7215, 0.3202]}, {"w": "is", "b": [0.7278, 0.3005, 0.7446, 0.3202]}, {"w": "so", "b": [0.7509, 0.3005, 0.7734, 0.3202]}, {"w": "common", "b": [0.7797, 0.3005, 0.8679, 0.3202]}, {"w": "that", "b": [0.1294, 0.321, 0.1673, 0.3407]}, {"w": "we’ve", "b": [0.1736, 0.321, 0.2352, 0.3407]}, {"w": "been", "b": [0.2415, 0.321, 0.2891, 0.3407]}, {"w": "able", "b": [0.2954, 0.321, 0.3374, 0.3407]}, {"w": "to", "b": [0.3438, 0.321, 0.3634, 0.3407]}, {"w": "cover", "b": [0.3697, 0.321, 0.4257, 0.3407]}, {"w": "many", "b": [0.432, 0.321, 0.4881, 0.3407]}, {"w": "topics", "b": [0.4944, 0.321, 0.5546, 0.3407]}, {"w": "and", "b": [0.5609, 0.321, 0.5974, 0.3407]}, {"w": "practical", "b": [0.6037, 0.321, 0.6905, 0.3407]}, {"w": "applications", "b": [0.6967, 0.321, 0.8187, 0.3407]}, {"w": "in", "b": [0.825, 0.321, 0.8446, 0.3407]}, {"w": "these", "b": [0.1294, 0.3415, 0.1813, 0.3612]}, {"w": "pages", "b": [0.1876, 0.3415, 0.245, 0.3612]}, {"w": "so", "b": [0.2513, 0.3415, 0.2737, 0.3612]}, {"w": "far", "b": [0.28, 0.3415, 0.308, 0.3612]}, {"w": "using", "b": [0.3143, 0.3415, 0.369, 0.3612]}, {"w": "only", "b": [0.3753, 0.3415, 0.4202, 0.3612]}, {"w": "the", "b": [0.4265, 0.3415, 0.4573, 0.3612]}, {"w": "Sequential", "b": [0.4636, 0.3425, 0.6149, 0.3627]}, {"w": "model", "b": [0.6213, 0.3415, 0.6843, 0.3612]}, {"w": "class.", "b": [0.6906, 0.3415, 0.746, 0.3612]}, {"w": "But", "b": [0.7523, 0.3415, 0.7887, 0.3612]}, {"w": "this", "b": [0.795, 0.3415, 0.8315, 0.3612]}, {"w": "set", "b": [0.8378, 0.3415, 0.8658, 0.3612]}, {"w": "of", "b": [0.1294, 0.3629, 0.1504, 0.3826]}, {"w": "assumptions", "b": [0.1567, 0.3629, 0.2815, 0.3826]}, {"w": "is", "b": [0.2878, 0.3629, 0.3046, 0.3826]}, {"w": "too", "b": [0.3109, 0.3629, 0.3431, 0.3826]}, {"w": "inflexible", "b": [0.3495, 0.3629, 0.4461, 0.3826]}, {"w": "in", "b": [0.4525, 0.3629, 0.4721, 0.3826]}, {"w": "a", "b": [0.4784, 0.3629, 0.4896, 0.3826]}, {"w": "number", "b": [0.4959, 0.3629, 0.573, 0.3826]}, {"w": "of", "b": [0.5793, 0.3629, 0.6003, 0.3826]}, {"w": "cases.", "b": [0.6066, 0.3629, 0.6661, 0.3826]}, {"w": "Some", "b": [0.6724, 0.3629, 0.7299, 0.3826]}, {"w": "networks", "b": [0.7362, 0.3629, 0.8287, 0.3826]}, {"w": "require", "b": [0.1294, 0.3834, 0.2009, 0.4031]}, {"w": "several", "b": [0.2072, 0.3834, 0.2786, 0.4031]}, {"w": "independent", "b": [0.2849, 0.3834, 0.4082, 0.4031]}, {"w": "inputs,", "b": [0.4145, 0.3834, 0.4824, 0.4031]}, {"w": "others", "b": [0.4888, 0.3834, 0.5504, 0.4031]}, {"w": "require", "b": [0.5567, 0.3834, 0.6282, 0.4031]}, {"w": "multiple", "b": [0.6345, 0.3834, 0.7186, 0.4031]}, {"w": "outputs,", "b": [0.7249, 0.3834, 0.8055, 0.4031]}, {"w": "and", "b": [0.8118, 0.3834, 0.8482, 0.4031]}, {"w": "some", "b": [0.1294, 0.4039, 0.1827, 0.4236]}, {"w": "networks", "b": [0.189, 0.4039, 0.2814, 0.4236]}, {"w": "have", "b": [0.2878, 0.4039, 0.3354, 0.4236]}, {"w": "internal", "b": [0.3417, 0.4039, 0.4188, 0.4236]}, {"w": "branching", "b": [0.4251, 0.4039, 0.5259, 0.4236]}, {"w": "between", "b": [0.5322, 0.4039, 0.6163, 0.4236]}, {"w": "layers", "b": [0.6226, 0.4039, 0.6828, 0.4236]}, {"w": "that", "b": [0.6891, 0.4039, 0.727, 0.4236]}, {"w": "makes", "b": [0.7333, 0.4039, 0.7977, 0.4236]}, {"w": "them", "b": [0.804, 0.4039, 0.8545, 0.4236]}, {"w": "look", "b": [0.1294, 0.4244, 0.1743, 0.4441]}, {"w": "like", "b": [0.1806, 0.4244, 0.2184, 0.4441]}, {"w": "graphs", "b": [0.2247, 0.4244, 0.2948, 0.4441]}, {"w": "of", "b": [0.3011, 0.4244, 0.3221, 0.4441]}, {"w": "layers", "b": [0.3284, 0.4244, 0.3886, 0.4441]}, {"w": "rather", "b": [0.395, 0.4244, 0.4538, 0.4441]}, {"w": "than", "b": [0.4601, 0.4244, 0.5035, 0.4441]}, {"w": "linear", "b": [0.5098, 0.4244, 0.5673, 0.4441]}, {"w": "stacks", "b": [0.5736, 0.4244, 0.6352, 0.4441]}, {"w": "of", "b": [0.6415, 0.4244, 0.6625, 0.4441]}, {"w": "layers.", "b": [0.6689, 0.4244, 0.7354, 0.4441]}]}, {"id": "b_1", "type": "paragraph", "text": "Some tasks, for instance, require multimodal inputs: they merge data coming from different input sources, processing each type of data using different kinds of neural layers. Imagine a deep-learning model trying to predict the most likely market price of a second-hand piece of clothing, using the following inputs: user-provided metadata (such as the item’s brand, age, and so on), a user-provided text description, and a picture of the item. If you had only the metadata available, you could one-hot encode it and use a densely connected network to predict the price. If you had only the text description available, you could use an RNN or a 1D convnet. If you had only the picture, you could use a 2D convnet. But how can you use all three at the same time? A naive approach would be to train three separate models and then do a weighted average of their predictions. But this may be suboptimal, because the information extracted by the models may be redundant. A better way is to jointly learn a more accurate model of the data by using a model that can see all available input modalities simultaneously: a model with three input branches (see figure 7.2).", "words": [{"w": "Some", "b": [0.1294, 0.4672, 0.1869, 0.4869]}, {"w": "tasks,", "b": [0.1932, 0.4672, 0.2499, 0.4869]}, {"w": "for", "b": [0.2562, 0.4672, 0.2857, 0.4869]}, {"w": "instance,", "b": [0.292, 0.4672, 0.3809, 0.4869]}, {"w": "require", "b": [0.3872, 0.4672, 0.4587, 0.4869]}, {"w": "multimodal", "b": [0.465, 0.4672, 0.5799, 0.4869]}, {"w": "inputs:", "b": [0.5862, 0.4672, 0.6549, 0.4869]}, {"w": "they", "b": [0.6612, 0.4672, 0.7046, 0.4869]}, {"w": "merge", "b": [0.7109, 0.4672, 0.7735, 0.4869]}, {"w": "data", "b": [0.7798, 0.4672, 0.8218, 0.4869]}, {"w": "coming", "b": [0.1294, 0.4877, 0.2051, 0.5074]}, {"w": "from", "b": [0.2114, 0.4877, 0.2604, 0.5074]}, {"w": "different", "b": [0.2667, 0.4877, 0.3531, 0.5074]}, {"w": "input", "b": [0.3594, 0.4877, 0.4113, 0.5074]}, {"w": "sources,", "b": [0.4176, 0.4877, 0.4996, 0.5074]}, {"w": "processing", "b": [0.5059, 0.4877, 0.6138, 0.5074]}, {"w": "each", "b": [0.6201, 0.4877, 0.6663, 0.5074]}, {"w": "type", "b": [0.6726, 0.4877, 0.716, 0.5074]}, {"w": "of", "b": [0.7223, 0.4877, 0.7433, 0.5074]}, {"w": "data", "b": [0.7496, 0.4877, 0.7917, 0.5074]}, {"w": "using", "b": [0.798, 0.4877, 0.8526, 0.5074]}, {"w": "different", "b": [0.1294, 0.5082, 0.2158, 0.5279]}, {"w": "kinds", "b": [0.2221, 0.5082, 0.2768, 0.5279]}, {"w": "of", "b": [0.2831, 0.5082, 0.3041, 0.5279]}, {"w": "neural", "b": [0.3104, 0.5082, 0.3734, 0.5279]}, {"w": "layers.", "b": [0.3797, 0.5082, 0.4463, 0.5279]}, {"w": "Imagine", "b": [0.4526, 0.5082, 0.5352, 0.5279]}, {"w": "a", "b": [0.5415, 0.5082, 0.5527, 0.5279]}, {"w": "deep-learning", "b": [0.559, 0.5082, 0.6977, 0.5279]}, {"w": "model", "b": [0.704, 0.5082, 0.7671, 0.5279]}, {"w": "trying", "b": [0.7734, 0.5082, 0.8337, 0.5279]}, {"w": "to", "b": [0.84, 0.5082, 0.8596, 0.5279]}, {"w": "predict", "b": [0.1294, 0.5287, 0.1995, 0.5484]}, {"w": "the", "b": [0.2058, 0.5287, 0.2366, 0.5484]}, {"w": "most", "b": [0.2429, 0.5287, 0.292, 0.5484]}, {"w": "likely", "b": [0.2983, 0.5287, 0.3557, 0.5484]}, {"w": "market", "b": [0.362, 0.5287, 0.4321, 0.5484]}, {"w": "price", "b": [0.4384, 0.5287, 0.4888, 0.5484]}, {"w": "of", "b": [0.4951, 0.5287, 0.5161, 0.5484]}, {"w": "a", "b": [0.5225, 0.5287, 0.5337, 0.5484]}, {"w": "second-hand", "b": [0.54, 0.5287, 0.6675, 0.5484]}, {"w": "piece", "b": [0.6738, 0.5287, 0.727, 0.5484]}, {"w": "of", "b": [0.7333, 0.5287, 0.7543, 0.5484]}, {"w": "clothing,", "b": [0.7606, 0.5287, 0.8496, 0.5484]}, {"w": "using", "b": [0.1294, 0.5492, 0.1841, 0.5689]}, {"w": "the", "b": [0.1904, 0.5492, 0.2212, 0.5689]}, {"w": "following", "b": [0.2275, 0.5492, 0.3256, 0.5689]}, {"w": "inputs:", "b": [0.3319, 0.5492, 0.4006, 0.5689]}, {"w": "user-provided", "b": [0.4069, 0.5492, 0.5465, 0.5689]}, {"w": "metadata", "b": [0.5528, 0.5492, 0.6439, 0.5689]}, {"w": "(such", "b": [0.6502, 0.5492, 0.7048, 0.5689]}, {"w": "as", "b": [0.7111, 0.5492, 0.7321, 0.5689]}, {"w": "the", "b": [0.7384, 0.5492, 0.7692, 0.5689]}, {"w": "item’s", "b": [0.7756, 0.5492, 0.8372, 0.5689]}, {"w": "brand,", "b": [0.1294, 0.5697, 0.1932, 0.5894]}, {"w": "age,", "b": [0.1995, 0.5697, 0.2408, 0.5894]}, {"w": "and", "b": [0.2471, 0.5697, 0.2835, 0.5894]}, {"w": "so", "b": [0.2898, 0.5697, 0.3122, 0.5894]}, {"w": "on),", "b": [0.3186, 0.5697, 0.3585, 0.5894]}, {"w": "a", "b": [0.3648, 0.5697, 0.376, 0.5894]}, {"w": "user-provided", "b": [0.3823, 0.5697, 0.5219, 0.5894]}, {"w": "text", "b": [0.5282, 0.5697, 0.566, 0.5894]}, {"w": "description,", "b": [0.5723, 0.5697, 0.6907, 0.5894]}, {"w": "and", "b": [0.697, 0.5697, 0.7334, 0.5894]}, {"w": "a", "b": [0.7397, 0.5697, 0.7509, 0.5894]}, {"w": "picture", "b": [0.7573, 0.5697, 0.8273, 0.5894]}, {"w": "of", "b": [0.8336, 0.5697, 0.8546, 0.5894]}, {"w": "the", "b": [0.1294, 0.5902, 0.1602, 0.6099]}, {"w": "item.", "b": [0.1665, 0.5902, 0.2177, 0.6099]}, {"w": "If", "b": [0.224, 0.5902, 0.2408, 0.6099]}, {"w": "you", "b": [0.2471, 0.5902, 0.285, 0.6099]}, {"w": "had", "b": [0.2913, 0.5902, 0.3277, 0.6099]}, {"w": "only", "b": [0.334, 0.5902, 0.3788, 0.6099]}, {"w": "the", "b": [0.3852, 0.5902, 0.416, 0.6099]}, {"w": "metadata", "b": [0.4223, 0.5902, 0.5133, 0.6099]}, {"w": "available,", "b": [0.5197, 0.5902, 0.617, 0.6099]}, {"w": "you", "b": [0.6233, 0.5902, 0.6612, 0.6099]}, {"w": "could", "b": [0.6675, 0.5902, 0.7235, 0.6099]}, {"w": "one-hot", "b": [0.7298, 0.5902, 0.8069, 0.6099]}, {"w": "encode", "b": [0.1294, 0.6107, 0.2009, 0.6304]}, {"w": "it", "b": [0.2072, 0.6107, 0.2212, 0.6304]}, {"w": "and", "b": [0.2275, 0.6107, 0.2639, 0.6304]}, {"w": "use", "b": [0.2702, 0.6107, 0.3038, 0.6304]}, {"w": "a", "b": [0.3102, 0.6107, 0.3214, 0.6304]}, {"w": "densely", "b": [0.3277, 0.6107, 0.4047, 0.6304]}, {"w": "connected", "b": [0.411, 0.6107, 0.5133, 0.6304]}, {"w": "network", "b": [0.5195, 0.6107, 0.6022, 0.6304]}, {"w": "to", "b": [0.6085, 0.6107, 0.6281, 0.6304]}, {"w": "predict", "b": [0.6344, 0.6107, 0.7045, 0.6304]}, {"w": "the", "b": [0.7108, 0.6107, 0.7416, 0.6304]}, {"w": "price.", "b": [0.7479, 0.6107, 0.8047, 0.6304]}, {"w": "If", "b": [0.811, 0.6107, 0.8278, 0.6304]}, {"w": "you", "b": [0.1294, 0.6312, 0.1673, 0.6509]}, {"w": "had", "b": [0.1736, 0.6312, 0.21, 0.6509]}, {"w": "only", "b": [0.2163, 0.6312, 0.2611, 0.6509]}, {"w": "the", "b": [0.2674, 0.6312, 0.2983, 0.6509]}, {"w": "text", "b": [0.3046, 0.6312, 0.3424, 0.6509]}, {"w": "description", "b": [0.3487, 0.6312, 0.4608, 0.6509]}, {"w": "available,", "b": [0.4671, 0.6312, 0.5645, 0.6509]}, {"w": "you", "b": [0.5708, 0.6312, 0.6087, 0.6509]}, {"w": "could", "b": [0.615, 0.6312, 0.671, 0.6509]}, {"w": "use", "b": [0.6773, 0.6312, 0.7109, 0.6509]}, {"w": "an", "b": [0.7172, 0.6312, 0.7411, 0.6509]}, {"w": "RNN", "b": [0.7474, 0.6312, 0.8006, 0.6509]}, {"w": "or", "b": [0.8069, 0.6312, 0.8279, 0.6509]}, {"w": "a", "b": [0.8342, 0.6312, 0.8454, 0.6509]}, {"w": "1D", "b": [0.1294, 0.6517, 0.1602, 0.6714]}, {"w": "convnet.", "b": [0.1665, 0.6517, 0.2527, 0.6714]}, {"w": "If", "b": [0.259, 0.6517, 0.2758, 0.6714]}, {"w": "you", "b": [0.2821, 0.6517, 0.32, 0.6714]}, {"w": "had", "b": [0.3263, 0.6517, 0.3627, 0.6714]}, {"w": "only", "b": [0.369, 0.6517, 0.4138, 0.6714]}, {"w": "the", "b": [0.4201, 0.6517, 0.451, 0.6714]}, {"w": "picture,", "b": [0.4573, 0.6517, 0.5336, 0.6714]}, {"w": "you", "b": [0.5399, 0.6517, 0.5778, 0.6714]}, {"w": "could", "b": [0.5841, 0.6517, 0.6401, 0.6714]}, {"w": "use", "b": [0.6464, 0.6517, 0.6801, 0.6714]}, {"w": "a", "b": [0.6864, 0.6517, 0.6976, 0.6714]}, {"w": "2D", "b": [0.7039, 0.6517, 0.7347, 0.6714]}, {"w": "convnet.", "b": [0.741, 0.6517, 0.8272, 0.6714]}, {"w": "But", "b": [0.8335, 0.6517, 0.8699, 0.6714]}, {"w": "how", "b": [0.1294, 0.6722, 0.1729, 0.6919]}, {"w": "can", "b": [0.1792, 0.6722, 0.2142, 0.6919]}, {"w": "you", "b": [0.2205, 0.6722, 0.2583, 0.6919]}, {"w": "use", "b": [0.2646, 0.6722, 0.2982, 0.6919]}, {"w": "all", "b": [0.3046, 0.6722, 0.3298, 0.6919]}, {"w": "three", "b": [0.3361, 0.6722, 0.3865, 0.6919]}, {"w": "at", "b": [0.3928, 0.6722, 0.411, 0.6919]}, {"w": "the", "b": [0.4173, 0.6722, 0.4482, 0.6919]}, {"w": "same", "b": [0.4545, 0.6722, 0.5063, 0.6919]}, {"w": "time?", "b": [0.5126, 0.6722, 0.5687, 0.6919]}, {"w": "A", "b": [0.575, 0.6722, 0.5932, 0.6919]}, {"w": "naive", "b": [0.5995, 0.6722, 0.6541, 0.6919]}, {"w": "approach", "b": [0.6604, 0.6722, 0.7529, 0.6919]}, {"w": "would", "b": [0.7592, 0.6722, 0.8223, 0.6919]}, {"w": "be", "b": [0.8286, 0.6722, 0.8524, 0.6919]}, {"w": "to", "b": [0.1294, 0.6927, 0.149, 0.7124]}, {"w": "train", "b": [0.1553, 0.6927, 0.2016, 0.7124]}, {"w": "three", "b": [0.2079, 0.6927, 0.2583, 0.7124]}, {"w": "separate", "b": [0.2646, 0.6927, 0.3473, 0.7124]}, {"w": "models", "b": [0.3536, 0.6927, 0.4264, 0.7124]}, {"w": "and", "b": [0.4328, 0.6927, 0.4692, 0.7124]}, {"w": "then", "b": [0.4755, 0.6927, 0.5189, 0.7124]}, {"w": "do", "b": [0.5252, 0.6927, 0.5505, 0.7124]}, {"w": "a", "b": [0.5568, 0.6927, 0.568, 0.7124]}, {"w": "weighted", "b": [0.5743, 0.6927, 0.6667, 0.7124]}, {"w": "average", "b": [0.6731, 0.6927, 0.7515, 0.7124]}, {"w": "of", "b": [0.7578, 0.6927, 0.7788, 0.7124]}, {"w": "their", "b": [0.7851, 0.6927, 0.8313, 0.7124]}, {"w": "predictions.", "b": [0.1294, 0.7132, 0.2478, 0.7329]}, {"w": "But", "b": [0.2541, 0.7132, 0.2906, 0.7329]}, {"w": "this", "b": [0.2969, 0.7132, 0.3333, 0.7329]}, {"w": "may", "b": [0.3396, 0.7132, 0.3831, 0.7329]}, {"w": "be", "b": [0.3894, 0.7132, 0.4132, 0.7329]}, {"w": "suboptimal,", "b": [0.4195, 0.7132, 0.5379, 0.7329]}, {"w": "because", "b": [0.5442, 0.7132, 0.6241, 0.7329]}, {"w": "the", "b": [0.6304, 0.7132, 0.6612, 0.7329]}, {"w": "information", "b": [0.6674, 0.7132, 0.7866, 0.7329]}, {"w": "extracted", "b": [0.1294, 0.7337, 0.2219, 0.7534]}, {"w": "by", "b": [0.2282, 0.7337, 0.2534, 0.7534]}, {"w": "the", "b": [0.2597, 0.7337, 0.2905, 0.7534]}, {"w": "models", "b": [0.2968, 0.7337, 0.3697, 0.7534]}, {"w": "may", "b": [0.376, 0.7337, 0.4195, 0.7534]}, {"w": "be", "b": [0.4258, 0.7337, 0.4496, 0.7534]}, {"w": "redundant.", "b": [0.4559, 0.7337, 0.5631, 0.7534]}, {"w": "A", "b": [0.5694, 0.7337, 0.5876, 0.7534]}, {"w": "better", "b": [0.5939, 0.7337, 0.6513, 0.7534]}, {"w": "way", "b": [0.6576, 0.7337, 0.6997, 0.7534]}, {"w": "is", "b": [0.706, 0.7337, 0.7228, 0.7534]}, {"w": "to", "b": [0.7291, 0.7337, 0.7487, 0.7534]}, {"w": "jointly", "b": [0.755, 0.7337, 0.8194, 0.7534]}, {"w": "learn", "b": [0.1294, 0.7542, 0.1798, 0.7739]}, {"w": "a", "b": [0.1861, 0.7542, 0.1973, 0.7739]}, {"w": "more", "b": [0.2037, 0.7542, 0.2555, 0.7739]}, {"w": "accurate", "b": [0.2618, 0.7542, 0.3458, 0.7739]}, {"w": "model", "b": [0.3521, 0.7542, 0.4152, 0.7739]}, {"w": "of", "b": [0.4215, 0.7542, 0.4425, 0.7739]}, {"w": "the", "b": [0.4488, 0.7542, 0.4796, 0.7739]}, {"w": "data", "b": [0.486, 0.7542, 0.528, 0.7739]}, {"w": "by", "b": [0.5343, 0.7542, 0.5595, 0.7739]}, {"w": "using", "b": [0.5658, 0.7542, 0.6205, 0.7739]}, {"w": "a", "b": [0.6268, 0.7542, 0.638, 0.7739]}, {"w": "model", "b": [0.6443, 0.7542, 0.7074, 0.7739]}, {"w": "that", "b": [0.7137, 0.7542, 0.7515, 0.7739]}, {"w": "can", "b": [0.7578, 0.7542, 0.7928, 0.7739]}, {"w": "see", "b": [0.7991, 0.7542, 0.8313, 0.7739]}, {"w": "all", "b": [0.8377, 0.7542, 0.8629, 0.7739]}, {"w": "available", "b": [0.1294, 0.7747, 0.2205, 0.7944]}, {"w": "input", "b": [0.2268, 0.7747, 0.2786, 0.7944]}, {"w": "modalities", "b": [0.285, 0.7747, 0.3901, 0.7944]}, {"w": "simultaneously:", "b": [0.3964, 0.7747, 0.5562, 0.7944]}, {"w": "a", "b": [0.5625, 0.7747, 0.5737, 0.7944]}, {"w": "model", "b": [0.58, 0.7747, 0.643, 0.7944]}, {"w": "with", "b": [0.6492, 0.7747, 0.6941, 0.7944]}, {"w": "three", "b": [0.7004, 0.7747, 0.7508, 0.7944]}, {"w": "input", "b": [0.7571, 0.7747, 0.809, 0.7944]}, {"w": "branches", "b": [0.1294, 0.7952, 0.2191, 0.8149]}, {"w": "(see", "b": [0.2254, 0.7952, 0.266, 0.8149]}, {"w": "figure", "b": [0.2723, 0.7952, 0.3325, 0.8149]}, {"w": "7.2).", "b": [0.3388, 0.7952, 0.385, 0.8149]}]}, {"id": "b_2", "type": "equation", "text": "Figure 7.2. A multi-input model", "words": [{"w": "Figure", "b": [0.1294, 0.833, 0.1827, 0.8478]}, {"w": "7.2.", "b": [0.1874, 0.833, 0.2158, 0.8478]}, {"w": "A", "b": [0.2205, 0.833, 0.2341, 0.8478]}, {"w": "multi-input", "b": [0.2389, 0.833, 0.3314, 0.8478]}, {"w": "model", "b": [0.3361, 0.833, 0.3855, 0.8478]}]}]}, {"page": 307, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Similarly, some tasks need to predict multiple target attributes of input data. Given the text of a novel or short story, you might want to automatically classify it by genre (such as romance or thriller) but also predict the approximate date it was written. Of course, you could train two separate models: one for the genre and one for the date. But because these attributes aren’t statistically independent, you could build a better model by learning to jointly predict both genre and date at the same time. Such a joint model would then have two outputs, or heads (see figure 7.3). Due to correlations between genre and date, knowing the date of a novel would help the model learn rich, accurate representations of the space of novel genres, and vice versa.", "words": [{"w": "Similarly,", "b": [0.1294, 0.2693, 0.228, 0.289]}, {"w": "some", "b": [0.2343, 0.2693, 0.2875, 0.289]}, {"w": "tasks", "b": [0.2938, 0.2693, 0.3443, 0.289]}, {"w": "need", "b": [0.3506, 0.2693, 0.3982, 0.289]}, {"w": "to", "b": [0.4045, 0.2693, 0.4242, 0.289]}, {"w": "predict", "b": [0.4305, 0.2693, 0.5005, 0.289]}, {"w": "multiple", "b": [0.5068, 0.2693, 0.5909, 0.289]}, {"w": "target", "b": [0.5972, 0.2693, 0.6541, 0.289]}, {"w": "attributes", "b": [0.6605, 0.2693, 0.7543, 0.289]}, {"w": "of", "b": [0.7607, 0.2693, 0.7817, 0.289]}, {"w": "input", "b": [0.788, 0.2693, 0.8398, 0.289]}, {"w": "data.", "b": [0.1294, 0.2898, 0.1777, 0.3095]}, {"w": "Given", "b": [0.1841, 0.2898, 0.2457, 0.3095]}, {"w": "the", "b": [0.252, 0.2898, 0.2828, 0.3095]}, {"w": "text", "b": [0.2891, 0.2898, 0.327, 0.3095]}, {"w": "of", "b": [0.3333, 0.2898, 0.3543, 0.3095]}, {"w": "a", "b": [0.3606, 0.2898, 0.3718, 0.3095]}, {"w": "novel", "b": [0.3781, 0.2898, 0.4342, 0.3095]}, {"w": "or", "b": [0.4405, 0.2898, 0.4615, 0.3095]}, {"w": "short", "b": [0.4678, 0.2898, 0.5182, 0.3095]}, {"w": "story,", "b": [0.5245, 0.2898, 0.5796, 0.3095]}, {"w": "you", "b": [0.5859, 0.2898, 0.6238, 0.3095]}, {"w": "might", "b": [0.6301, 0.2898, 0.6889, 0.3095]}, {"w": "want", "b": [0.6952, 0.2898, 0.7443, 0.3095]}, {"w": "to", "b": [0.7506, 0.2898, 0.7702, 0.3095]}, {"w": "automatically", "b": [0.1294, 0.3103, 0.2667, 0.33]}, {"w": "classify", "b": [0.273, 0.3103, 0.3501, 0.33]}, {"w": "it", "b": [0.3564, 0.3103, 0.3704, 0.33]}, {"w": "by", "b": [0.3768, 0.3103, 0.402, 0.33]}, {"w": "genre", "b": [0.4083, 0.3103, 0.4643, 0.33]}, {"w": "(such", "b": [0.4706, 0.3103, 0.5253, 0.33]}, {"w": "as", "b": [0.5316, 0.3103, 0.5526, 0.33]}, {"w": "romance", "b": [0.5589, 0.3103, 0.6457, 0.33]}, {"w": "or", "b": [0.652, 0.3103, 0.6731, 0.33]}, {"w": "thriller)", "b": [0.6794, 0.3103, 0.7564, 0.33]}, {"w": "but", "b": [0.7627, 0.3103, 0.795, 0.33]}, {"w": "also", "b": [0.8013, 0.3103, 0.8419, 0.33]}, {"w": "predict", "b": [0.1294, 0.3308, 0.1995, 0.3505]}, {"w": "the", "b": [0.2058, 0.3308, 0.2366, 0.3505]}, {"w": "approximate", "b": [0.2429, 0.3308, 0.369, 0.3505]}, {"w": "date", "b": [0.3753, 0.3308, 0.4173, 0.3505]}, {"w": "it", "b": [0.4236, 0.3308, 0.4377, 0.3505]}, {"w": "was", "b": [0.4439, 0.3308, 0.4831, 0.3505]}, {"w": "written.", "b": [0.4894, 0.3308, 0.5672, 0.3505]}, {"w": "Of", "b": [0.5735, 0.3308, 0.6001, 0.3505]}, {"w": "course,", "b": [0.6064, 0.3308, 0.6786, 0.3505]}, {"w": "you", "b": [0.6849, 0.3308, 0.7227, 0.3505]}, {"w": "could", "b": [0.729, 0.3308, 0.7851, 0.3505]}, {"w": "train", "b": [0.7914, 0.3308, 0.8376, 0.3505]}, {"w": "two", "b": [0.1294, 0.3513, 0.1673, 0.371]}, {"w": "separate", "b": [0.1736, 0.3513, 0.2562, 0.371]}, {"w": "models:", "b": [0.2625, 0.3513, 0.3424, 0.371]}, {"w": "one", "b": [0.3487, 0.3513, 0.3851, 0.371]}, {"w": "for", "b": [0.3914, 0.3513, 0.4208, 0.371]}, {"w": "the", "b": [0.4272, 0.3513, 0.458, 0.371]}, {"w": "genre", "b": [0.4643, 0.3513, 0.5203, 0.371]}, {"w": "and", "b": [0.5266, 0.3513, 0.563, 0.371]}, {"w": "one", "b": [0.5693, 0.3513, 0.6058, 0.371]}, {"w": "for", "b": [0.6121, 0.3513, 0.6415, 0.371]}, {"w": "the", "b": [0.6478, 0.3513, 0.6786, 0.371]}, {"w": "date.", "b": [0.6849, 0.3513, 0.7333, 0.371]}, {"w": "But", "b": [0.7396, 0.3513, 0.776, 0.371]}, {"w": "because", "b": [0.7823, 0.3513, 0.8622, 0.371]}, {"w": "these", "b": [0.1294, 0.3718, 0.1813, 0.3915]}, {"w": "attributes", "b": [0.1876, 0.3718, 0.2814, 0.3915]}, {"w": "aren’t", "b": [0.2877, 0.3718, 0.3461, 0.3915]}, {"w": "statistically", "b": [0.3524, 0.3718, 0.4673, 0.3915]}, {"w": "independent,", "b": [0.4736, 0.3718, 0.6032, 0.3915]}, {"w": "you", "b": [0.6095, 0.3718, 0.6474, 0.3915]}, {"w": "could", "b": [0.6537, 0.3718, 0.7097, 0.3915]}, {"w": "build", "b": [0.716, 0.3718, 0.7679, 0.3915]}, {"w": "a", "b": [0.7742, 0.3718, 0.7854, 0.3915]}, {"w": "better", "b": [0.7917, 0.3718, 0.8492, 0.3915]}, {"w": "model", "b": [0.1294, 0.3923, 0.1925, 0.412]}, {"w": "by", "b": [0.1988, 0.3923, 0.224, 0.412]}, {"w": "learning", "b": [0.2303, 0.3923, 0.313, 0.412]}, {"w": "to", "b": [0.3193, 0.3923, 0.3389, 0.412]}, {"w": "jointly", "b": [0.3452, 0.3923, 0.4111, 0.412]}, {"w": "predict", "b": [0.4174, 0.3923, 0.4875, 0.412]}, {"w": "both", "b": [0.4938, 0.3923, 0.5386, 0.412]}, {"w": "genre", "b": [0.5449, 0.3923, 0.601, 0.412]}, {"w": "and", "b": [0.6073, 0.3923, 0.6437, 0.412]}, {"w": "date", "b": [0.65, 0.3923, 0.692, 0.412]}, {"w": "at", "b": [0.6983, 0.3923, 0.7165, 0.412]}, {"w": "the", "b": [0.7228, 0.3923, 0.7537, 0.412]}, {"w": "same", "b": [0.7599, 0.3923, 0.8117, 0.412]}, {"w": "time.", "b": [0.818, 0.3923, 0.8692, 0.412]}, {"w": "Such", "b": [0.1294, 0.4128, 0.1799, 0.4325]}, {"w": "a", "b": [0.1862, 0.4128, 0.1974, 0.4325]}, {"w": "joint", "b": [0.2037, 0.4128, 0.2499, 0.4325]}, {"w": "model", "b": [0.2562, 0.4128, 0.3193, 0.4325]}, {"w": "would", "b": [0.3256, 0.4128, 0.3887, 0.4325]}, {"w": "then", "b": [0.395, 0.4128, 0.4384, 0.4325]}, {"w": "have", "b": [0.4447, 0.4128, 0.4924, 0.4325]}, {"w": "two", "b": [0.4987, 0.4128, 0.5365, 0.4325]}, {"w": "outputs,", "b": [0.5428, 0.4128, 0.6234, 0.4325]}, {"w": "or", "b": [0.6297, 0.4128, 0.6507, 0.4325]}, {"w": "heads", "b": [0.657, 0.4128, 0.7158, 0.4325]}, {"w": "(see", "b": [0.7221, 0.4128, 0.7628, 0.4325]}, {"w": "figure", "b": [0.769, 0.4128, 0.8293, 0.4325]}, {"w": "7.3).", "b": [0.1294, 0.4333, 0.1757, 0.453]}, {"w": "Due", "b": [0.182, 0.4333, 0.224, 0.453]}, {"w": "to", "b": [0.2303, 0.4333, 0.2499, 0.453]}, {"w": "correlations", "b": [0.2562, 0.4333, 0.3753, 0.453]}, {"w": "between", "b": [0.3816, 0.4333, 0.4657, 0.453]}, {"w": "genre", "b": [0.472, 0.4333, 0.528, 0.453]}, {"w": "and", "b": [0.5343, 0.4333, 0.5707, 0.453]}, {"w": "date,", "b": [0.577, 0.4333, 0.6254, 0.453]}, {"w": "knowing", "b": [0.6317, 0.4333, 0.72, 0.453]}, {"w": "the", "b": [0.7263, 0.4333, 0.7571, 0.453]}, {"w": "date", "b": [0.7634, 0.4333, 0.8054, 0.453]}, {"w": "of", "b": [0.8117, 0.4333, 0.8328, 0.453]}, {"w": "a", "b": [0.8391, 0.4333, 0.8503, 0.453]}, {"w": "novel", "b": [0.1294, 0.4538, 0.1855, 0.4735]}, {"w": "would", "b": [0.1918, 0.4538, 0.2548, 0.4735]}, {"w": "help", "b": [0.2611, 0.4538, 0.3046, 0.4735]}, {"w": "the", "b": [0.3109, 0.4538, 0.3417, 0.4735]}, {"w": "model", "b": [0.348, 0.4538, 0.4111, 0.4735]}, {"w": "learn", "b": [0.4174, 0.4538, 0.4678, 0.4735]}, {"w": "rich,", "b": [0.4741, 0.4538, 0.5197, 0.4735]}, {"w": "accurate", "b": [0.526, 0.4538, 0.61, 0.4735]}, {"w": "representations", "b": [0.6163, 0.4538, 0.769, 0.4735]}, {"w": "of", "b": [0.7752, 0.4538, 0.7962, 0.4735]}, {"w": "the", "b": [0.8025, 0.4538, 0.8334, 0.4735]}, {"w": "space", "b": [0.1294, 0.4743, 0.1854, 0.494]}, {"w": "of", "b": [0.1917, 0.4743, 0.2128, 0.494]}, {"w": "novel", "b": [0.2191, 0.4743, 0.2751, 0.494]}, {"w": "genres,", "b": [0.2814, 0.4743, 0.3536, 0.494]}, {"w": "and", "b": [0.3599, 0.4743, 0.3963, 0.494]}, {"w": "vice", "b": [0.4026, 0.4743, 0.4446, 0.494]}, {"w": "versa.", "b": [0.4509, 0.4743, 0.5105, 0.494]}]}, {"id": "b_1", "type": "equation", "text": "Figure 7.3. A multi-output (or multihead) model", "words": [{"w": "Figure", "b": [0.1294, 0.5121, 0.1827, 0.5269]}, {"w": "7.3.", "b": [0.1874, 0.5121, 0.2158, 0.5269]}, {"w": "A", "b": [0.2205, 0.5121, 0.2341, 0.5269]}, {"w": "multi-output", "b": [0.2389, 0.5121, 0.3419, 0.5269]}, {"w": "(or", "b": [0.3466, 0.5121, 0.3708, 0.5269]}, {"w": "multihead)", "b": [0.3755, 0.5121, 0.4638, 0.5269]}, {"w": "model", "b": [0.4685, 0.5121, 0.5179, 0.5269]}]}, {"id": "b_2", "type": "paragraph", "text": "Additionally, many recently developed neural architectures require nonlinear network topology: networks structured as directed acyclic graphs. The Inception family of networks (developed by Szegedy et al. at Google),[1] for instance, relies on Inception modules, where the input is processed by several parallel convolutional branches whose outputs are then merged back into a single tensor (see figure 7.4). There’s also the recent trend of adding residual connections to a model, which started with the ResNet family of networks (developed by He et al. at", "words": [{"w": "Additionally,", "b": [0.1294, 0.7346, 0.2616, 0.7543]}, {"w": "many", "b": [0.2679, 0.7346, 0.324, 0.7543]}, {"w": "recently", "b": [0.3303, 0.7346, 0.4115, 0.7543]}, {"w": "developed", "b": [0.4178, 0.7346, 0.5215, 0.7543]}, {"w": "neural", "b": [0.5278, 0.7346, 0.5908, 0.7543]}, {"w": "architectures", "b": [0.5972, 0.7346, 0.726, 0.7543]}, {"w": "require", "b": [0.7323, 0.7346, 0.8038, 0.7543]}, {"w": "nonlinear", "b": [0.1294, 0.7551, 0.2247, 0.7748]}, {"w": "network", "b": [0.231, 0.7551, 0.3137, 0.7748]}, {"w": "topology:", "b": [0.32, 0.7551, 0.4167, 0.7748]}, {"w": "networks", "b": [0.423, 0.7551, 0.5155, 0.7748]}, {"w": "structured", "b": [0.5218, 0.7551, 0.6227, 0.7748]}, {"w": "as", "b": [0.629, 0.7551, 0.65, 0.7748]}, {"w": "directed", "b": [0.6563, 0.7551, 0.7375, 0.7748]}, {"w": "acyclic", "b": [0.7438, 0.7551, 0.8152, 0.7748]}, {"w": "graphs.", "b": [0.1294, 0.7756, 0.203, 0.7953]}, {"w": "The", "b": [0.2093, 0.7756, 0.2485, 0.7953]}, {"w": "Inception", "b": [0.2548, 0.7756, 0.3501, 0.7953]}, {"w": "family", "b": [0.3564, 0.7756, 0.4223, 0.7953]}, {"w": "of", "b": [0.4286, 0.7756, 0.4496, 0.7953]}, {"w": "networks", "b": [0.4559, 0.7756, 0.5484, 0.7953]}, {"w": "(developed", "b": [0.5547, 0.7756, 0.6667, 0.7953]}, {"w": "by", "b": [0.6731, 0.7756, 0.6983, 0.7953]}, {"w": "Szegedy", "b": [0.7046, 0.7756, 0.79, 0.7953]}, {"w": "et", "b": [0.7964, 0.7756, 0.8146, 0.7953]}, {"w": "al.", "b": [0.8209, 0.7756, 0.8454, 0.7953]}, {"w": "at", "b": [0.8517, 0.7756, 0.8699, 0.7953]}, {"w": "Google),[1]", "b": [0.1294, 0.7956, 0.2404, 0.8176]}, {"w": "for", "b": [0.2467, 0.7978, 0.2761, 0.8176]}, {"w": "instance,", "b": [0.2824, 0.7978, 0.3714, 0.8176]}, {"w": "relies", "b": [0.3777, 0.7978, 0.4323, 0.8176]}, {"w": "on", "b": [0.4387, 0.7978, 0.4639, 0.8176]}, {"w": "Inception", "b": [0.4702, 0.7978, 0.5654, 0.8176]}, {"w": "modules,", "b": [0.5717, 0.7978, 0.6621, 0.8176]}, {"w": "where", "b": [0.6684, 0.7978, 0.73, 0.8176]}, {"w": "the", "b": [0.7363, 0.7978, 0.7672, 0.8176]}, {"w": "input", "b": [0.7735, 0.7978, 0.8253, 0.8176]}, {"w": "is", "b": [0.8317, 0.7978, 0.8485, 0.8176]}, {"w": "processed", "b": [0.1294, 0.8183, 0.2289, 0.8381]}, {"w": "by", "b": [0.2352, 0.8183, 0.2604, 0.8381]}, {"w": "several", "b": [0.2667, 0.8183, 0.3382, 0.8381]}, {"w": "parallel", "b": [0.3445, 0.8183, 0.4201, 0.8381]}, {"w": "convolutional", "b": [0.4264, 0.8183, 0.5652, 0.8381]}, {"w": "branches", "b": [0.5715, 0.8183, 0.6611, 0.8381]}, {"w": "whose", "b": [0.6674, 0.8183, 0.7319, 0.8381]}, {"w": "outputs", "b": [0.7382, 0.8183, 0.8125, 0.8381]}, {"w": "are", "b": [0.8188, 0.8183, 0.8496, 0.8381]}, {"w": "then", "b": [0.1294, 0.8388, 0.1729, 0.8586]}, {"w": "merged", "b": [0.1792, 0.8388, 0.2543, 0.8586]}, {"w": "back", "b": [0.2606, 0.8388, 0.3083, 0.8586]}, {"w": "into", "b": [0.3146, 0.8388, 0.3538, 0.8586]}, {"w": "a", "b": [0.3601, 0.8388, 0.3713, 0.8586]}, {"w": "single", "b": [0.3776, 0.8388, 0.4379, 0.8586]}, {"w": "tensor", "b": [0.4442, 0.8388, 0.5058, 0.8586]}, {"w": "(see", "b": [0.5121, 0.8388, 0.5527, 0.8586]}, {"w": "figure", "b": [0.559, 0.8388, 0.6193, 0.8586]}, {"w": "7.4).", "b": [0.6256, 0.8388, 0.6718, 0.8586]}, {"w": "There’s", "b": [0.6781, 0.8388, 0.7537, 0.8586]}, {"w": "also", "b": [0.76, 0.8388, 0.8007, 0.8586]}, {"w": "the", "b": [0.807, 0.8388, 0.8378, 0.8586]}, {"w": "recent", "b": [0.1294, 0.8593, 0.191, 0.8791]}, {"w": "trend", "b": [0.1973, 0.8593, 0.2492, 0.8791]}, {"w": "of", "b": [0.2555, 0.8593, 0.2765, 0.8791]}, {"w": "adding", "b": [0.2828, 0.8593, 0.3515, 0.8791]}, {"w": "residual", "b": [0.3577, 0.8593, 0.4395, 0.8791]}, {"w": "connections", "b": [0.4458, 0.8593, 0.5663, 0.8791]}, {"w": "to", "b": [0.5726, 0.8593, 0.5922, 0.8791]}, {"w": "a", "b": [0.5985, 0.8593, 0.6097, 0.8791]}, {"w": "model,", "b": [0.616, 0.8593, 0.6854, 0.8791]}, {"w": "which", "b": [0.6917, 0.8593, 0.7533, 0.8791]}, {"w": "started", "b": [0.7597, 0.8593, 0.8269, 0.8791]}, {"w": "with", "b": [0.1294, 0.8798, 0.1743, 0.8996]}, {"w": "the", "b": [0.1806, 0.8798, 0.2114, 0.8996]}, {"w": "ResNet", "b": [0.2177, 0.8798, 0.292, 0.8996]}, {"w": "family", "b": [0.2983, 0.8798, 0.3641, 0.8996]}, {"w": "of", "b": [0.3704, 0.8798, 0.3915, 0.8996]}, {"w": "networks", "b": [0.3978, 0.8798, 0.4902, 0.8996]}, {"w": "(developed", "b": [0.4965, 0.8798, 0.6086, 0.8996]}, {"w": "by", "b": [0.6149, 0.8798, 0.6402, 0.8996]}, {"w": "He", "b": [0.6465, 0.8798, 0.6759, 0.8996]}, {"w": "et", "b": [0.6822, 0.8798, 0.7004, 0.8996]}, {"w": "al.", "b": [0.7067, 0.8798, 0.7312, 0.8996]}, {"w": "at", "b": [0.7375, 0.8798, 0.7557, 0.8996]}]}]}, {"page": 308, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Microsoft).[2] A residual connection consists of reinjecting previous representations into the downstream flow of data by adding a past output tensor to a later output tensor (see figure 7.5), which helps prevent information loss along the data-processing flow. There are many other examples of such graph-like networks.", "words": [{"w": "Microsoft).[2]", "b": [0.1294, 0.0852, 0.2656, 0.1072]}, {"w": "A", "b": [0.2719, 0.0875, 0.2902, 0.1072]}, {"w": "residual", "b": [0.2965, 0.0875, 0.3763, 0.1072]}, {"w": "connection", "b": [0.3826, 0.0875, 0.4933, 0.1072]}, {"w": "consists", "b": [0.4996, 0.0875, 0.5795, 0.1072]}, {"w": "of", "b": [0.5858, 0.0875, 0.6068, 0.1072]}, {"w": "reinjecting", "b": [0.6131, 0.0875, 0.721, 0.1072]}, {"w": "previous", "b": [0.7273, 0.0875, 0.8142, 0.1072]}, {"w": "representations", "b": [0.1294, 0.108, 0.2821, 0.1277]}, {"w": "into", "b": [0.2884, 0.108, 0.3277, 0.1277]}, {"w": "the", "b": [0.334, 0.108, 0.3648, 0.1277]}, {"w": "downstream", "b": [0.3711, 0.108, 0.4944, 0.1277]}, {"w": "flow", "b": [0.5007, 0.108, 0.547, 0.1277]}, {"w": "of", "b": [0.5533, 0.108, 0.5743, 0.1277]}, {"w": "data", "b": [0.5806, 0.108, 0.6226, 0.1277]}, {"w": "by", "b": [0.6289, 0.108, 0.6542, 0.1277]}, {"w": "adding", "b": [0.6605, 0.108, 0.7291, 0.1277]}, {"w": "a", "b": [0.7354, 0.108, 0.7466, 0.1277]}, {"w": "past", "b": [0.7529, 0.108, 0.7936, 0.1277]}, {"w": "output", "b": [0.7998, 0.108, 0.8643, 0.1277]}, {"w": "tensor", "b": [0.1294, 0.1285, 0.1911, 0.1482]}, {"w": "to", "b": [0.1974, 0.1285, 0.217, 0.1482]}, {"w": "a", "b": [0.2233, 0.1285, 0.2345, 0.1482]}, {"w": "later", "b": [0.2408, 0.1285, 0.2856, 0.1482]}, {"w": "output", "b": [0.2919, 0.1285, 0.3564, 0.1482]}, {"w": "tensor", "b": [0.3627, 0.1285, 0.4244, 0.1482]}, {"w": "(see", "b": [0.4307, 0.1285, 0.4713, 0.1482]}, {"w": "figure", "b": [0.4775, 0.1285, 0.5378, 0.1482]}, {"w": "7.5),", "b": [0.5441, 0.1285, 0.5903, 0.1482]}, {"w": "which", "b": [0.5966, 0.1285, 0.6583, 0.1482]}, {"w": "helps", "b": [0.6646, 0.1285, 0.7178, 0.1482]}, {"w": "prevent", "b": [0.7241, 0.1285, 0.7998, 0.1482]}, {"w": "information", "b": [0.1294, 0.149, 0.2485, 0.1687]}, {"w": "loss", "b": [0.2548, 0.149, 0.2941, 0.1687]}, {"w": "along", "b": [0.3004, 0.149, 0.3564, 0.1687]}, {"w": "the", "b": [0.3628, 0.149, 0.3936, 0.1687]}, {"w": "data-processing", "b": [0.3999, 0.149, 0.5582, 0.1687]}, {"w": "flow.", "b": [0.5645, 0.149, 0.6154, 0.1687]}, {"w": "There", "b": [0.6217, 0.149, 0.6805, 0.1687]}, {"w": "are", "b": [0.6868, 0.149, 0.7176, 0.1687]}, {"w": "many", "b": [0.7239, 0.149, 0.78, 0.1687]}, {"w": "other", "b": [0.7863, 0.149, 0.8381, 0.1687]}, {"w": "examples", "b": [0.1294, 0.1695, 0.2247, 0.1892]}, {"w": "of", "b": [0.231, 0.1695, 0.252, 0.1892]}, {"w": "such", "b": [0.2583, 0.1695, 0.3046, 0.1892]}, {"w": "graph-like", "b": [0.3109, 0.1695, 0.4145, 0.1892]}, {"w": "networks.", "b": [0.4208, 0.1695, 0.5196, 0.1892]}]}, {"id": "b_2", "type": "paragraph", "text": "Christian Szegedy et al., “Going Deeper with Convolutions,” Conference on Computer Vision and Pattern Recognition (2014), https://arxiv.org/abs/1409.4842.", "words": [{"w": "Christian", "b": [0.1483, 0.2349, 0.2177, 0.2497]}, {"w": "Szegedy", "b": [0.2224, 0.2349, 0.2865, 0.2497]}, {"w": "et", "b": [0.2913, 0.2349, 0.3049, 0.2497]}, {"w": "al.,", "b": [0.3097, 0.2349, 0.3328, 0.2497]}, {"w": "“Going", "b": [0.3375, 0.2349, 0.3932, 0.2497]}, {"w": "Deeper", "b": [0.3979, 0.2349, 0.4526, 0.2497]}, {"w": "with", "b": [0.4573, 0.2349, 0.4909, 0.2497]}, {"w": "Convolutions,”", "b": [0.4957, 0.2349, 0.6108, 0.2497]}, {"w": "Conference", "b": [0.6155, 0.2349, 0.7027, 0.2497]}, {"w": "on", "b": [0.7074, 0.2349, 0.7263, 0.2497]}, {"w": "Computer", "b": [0.7311, 0.2349, 0.8067, 0.2497]}, {"w": "Vision", "b": [0.1483, 0.2501, 0.1977, 0.2649]}, {"w": "and", "b": [0.2024, 0.2501, 0.2297, 0.2649]}, {"w": "Pattern", "b": [0.2344, 0.2501, 0.288, 0.2649]}, {"w": "Recognition", "b": [0.2928, 0.2501, 0.3853, 0.2649]}, {"w": "(2014),", "b": [0.39, 0.2501, 0.4452, 0.2649]}, {"w": "https://arxiv.org/abs/1409.4842.", "b": [0.4499, 0.2501, 0.6905, 0.2649]}]}, {"id": "b_4", "type": "paragraph", "text": "Kaiming He et al., “Deep Residual Learning for Image Recognition,” Conference on Computer Vision and Pattern Recognition (2015), https://arxiv.org/abs/1512.03385.", "words": [{"w": "Kaiming", "b": [0.1483, 0.3062, 0.2145, 0.321]}, {"w": "He", "b": [0.2193, 0.3062, 0.2413, 0.321]}, {"w": "et", "b": [0.2461, 0.3062, 0.2597, 0.321]}, {"w": "al.,", "b": [0.2645, 0.3062, 0.2876, 0.321]}, {"w": "“Deep", "b": [0.2923, 0.3062, 0.3406, 0.321]}, {"w": "Residual", "b": [0.3454, 0.3062, 0.4116, 0.321]}, {"w": "Learning", "b": [0.4163, 0.3062, 0.4846, 0.321]}, {"w": "for", "b": [0.4893, 0.3062, 0.5114, 0.321]}, {"w": "Image", "b": [0.5161, 0.3062, 0.5634, 0.321]}, {"w": "Recognition,”", "b": [0.5681, 0.3062, 0.6738, 0.321]}, {"w": "Conference", "b": [0.6785, 0.3062, 0.7657, 0.321]}, {"w": "on", "b": [0.7704, 0.3062, 0.7893, 0.321]}, {"w": "Computer", "b": [0.1483, 0.3214, 0.224, 0.3362]}, {"w": "Vision", "b": [0.2287, 0.3214, 0.2781, 0.3362]}, {"w": "and", "b": [0.2828, 0.3214, 0.3101, 0.3362]}, {"w": "Pattern", "b": [0.3148, 0.3214, 0.3684, 0.3362]}, {"w": "Recognition", "b": [0.3732, 0.3214, 0.4657, 0.3362]}, {"w": "(2015),", "b": [0.4704, 0.3214, 0.5256, 0.3362]}, {"w": "https://arxiv.org/abs/1512.03385.", "b": [0.5302, 0.3214, 0.7804, 0.3362]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 7.4. An Inception module: a subgraph of layers with several parallel convolutional branches", "words": [{"w": "Figure", "b": [0.1294, 0.3588, 0.1827, 0.3736]}, {"w": "7.4.", "b": [0.1874, 0.3588, 0.2158, 0.3736]}, {"w": "An", "b": [0.2205, 0.3588, 0.2447, 0.3736]}, {"w": "Inception", "b": [0.2494, 0.3588, 0.3261, 0.3736]}, {"w": "module:", "b": [0.3309, 0.3588, 0.3971, 0.3736]}, {"w": "a", "b": [0.4018, 0.3588, 0.4113, 0.3736]}, {"w": "subgraph", "b": [0.416, 0.3588, 0.4927, 0.3736]}, {"w": "of", "b": [0.4975, 0.3588, 0.5132, 0.3736]}, {"w": "layers", "b": [0.518, 0.3588, 0.5663, 0.3736]}, {"w": "with", "b": [0.571, 0.3588, 0.6068, 0.3736]}, {"w": "several", "b": [0.6115, 0.3588, 0.6682, 0.3736]}, {"w": "parallel", "b": [0.673, 0.3588, 0.735, 0.3736]}, {"w": "convolutional", "b": [0.7397, 0.3588, 0.8491, 0.3736]}, {"w": "branches", "b": [0.1294, 0.374, 0.203, 0.3888]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 7.5. A residual connection: reinjection of prior information downstream via feature- map addition", "words": [{"w": "Figure", "b": [0.1294, 0.7011, 0.1827, 0.7159]}, {"w": "7.5.", "b": [0.1874, 0.7011, 0.2158, 0.7159]}, {"w": "A", "b": [0.2205, 0.7011, 0.2341, 0.7159]}, {"w": "residual", "b": [0.2389, 0.7011, 0.3037, 0.7159]}, {"w": "connection:", "b": [0.3084, 0.7011, 0.402, 0.7159]}, {"w": "reinjection", "b": [0.4067, 0.7011, 0.4936, 0.7159]}, {"w": "of", "b": [0.4983, 0.7011, 0.5141, 0.7159]}, {"w": "prior", "b": [0.5188, 0.7011, 0.5608, 0.7159]}, {"w": "information", "b": [0.5656, 0.7011, 0.6623, 0.7159]}, {"w": "downstream", "b": [0.667, 0.7011, 0.7665, 0.7159]}, {"w": "via", "b": [0.7712, 0.7011, 0.7954, 0.7159]}, {"w": "feature-", "b": [0.8001, 0.7011, 0.8638, 0.7159]}, {"w": "map", "b": [0.1294, 0.7162, 0.1652, 0.731]}, {"w": "addition", "b": [0.1699, 0.7162, 0.2372, 0.731]}]}]}, {"page": 309, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "These three important use cases—multi-input models, multi-output models, and graph-like models—aren’t possible when using only the Sequential model class in Keras. But there’s another far more general and flexible way to use Keras: the functional API. This section explains in detail what it is, what it can do, and how to use it.", "words": [{"w": "These", "b": [0.1294, 0.3023, 0.1897, 0.322]}, {"w": "three", "b": [0.196, 0.3023, 0.2464, 0.322]}, {"w": "important", "b": [0.2527, 0.3023, 0.3508, 0.322]}, {"w": "use", "b": [0.3571, 0.3023, 0.3907, 0.322]}, {"w": "cases—multi-input", "b": [0.397, 0.3023, 0.589, 0.322]}, {"w": "models,", "b": [0.5953, 0.3023, 0.6745, 0.322]}, {"w": "multi-output", "b": [0.6808, 0.3023, 0.807, 0.322]}, {"w": "models,", "b": [0.1294, 0.3228, 0.2086, 0.3425]}, {"w": "and", "b": [0.2149, 0.3228, 0.2513, 0.3425]}, {"w": "graph-like", "b": [0.2576, 0.3228, 0.3613, 0.3425]}, {"w": "models—aren’t", "b": [0.3676, 0.3228, 0.524, 0.3425]}, {"w": "possible", "b": [0.5304, 0.3228, 0.613, 0.3425]}, {"w": "when", "b": [0.6194, 0.3228, 0.674, 0.3425]}, {"w": "using", "b": [0.6803, 0.3228, 0.735, 0.3425]}, {"w": "only", "b": [0.7413, 0.3228, 0.7861, 0.3425]}, {"w": "the", "b": [0.7924, 0.3228, 0.8232, 0.3425]}, {"w": "Sequential", "b": [0.1294, 0.3443, 0.2808, 0.3645]}, {"w": "model", "b": [0.2871, 0.3433, 0.3502, 0.363]}, {"w": "class", "b": [0.3565, 0.3433, 0.4055, 0.363]}, {"w": "in", "b": [0.4118, 0.3433, 0.4314, 0.363]}, {"w": "Keras.", "b": [0.4377, 0.3433, 0.5029, 0.363]}, {"w": "But", "b": [0.5092, 0.3433, 0.5456, 0.363]}, {"w": "there’s", "b": [0.5519, 0.3433, 0.6191, 0.363]}, {"w": "another", "b": [0.6255, 0.3433, 0.7011, 0.363]}, {"w": "far", "b": [0.7074, 0.3433, 0.7354, 0.363]}, {"w": "more", "b": [0.7417, 0.3433, 0.7936, 0.363]}, {"w": "general", "b": [0.1294, 0.3647, 0.2037, 0.3844]}, {"w": "and", "b": [0.21, 0.3647, 0.2464, 0.3844]}, {"w": "flexible", "b": [0.2527, 0.3647, 0.3298, 0.3844]}, {"w": "way", "b": [0.3361, 0.3647, 0.3781, 0.3844]}, {"w": "to", "b": [0.3844, 0.3647, 0.404, 0.3844]}, {"w": "use", "b": [0.4103, 0.3647, 0.444, 0.3844]}, {"w": "Keras:", "b": [0.4503, 0.3647, 0.5161, 0.3844]}, {"w": "the", "b": [0.5224, 0.3647, 0.5532, 0.3844]}, {"w": "functional", "b": [0.5595, 0.3647, 0.6618, 0.3844]}, {"w": "API.", "b": [0.6681, 0.3647, 0.7136, 0.3844]}, {"w": "This", "b": [0.7199, 0.3647, 0.7647, 0.3844]}, {"w": "section", "b": [0.771, 0.3647, 0.8425, 0.3844]}, {"w": "explains", "b": [0.1294, 0.3852, 0.2135, 0.4049]}, {"w": "in", "b": [0.2198, 0.3852, 0.2394, 0.4049]}, {"w": "detail", "b": [0.2457, 0.3852, 0.3018, 0.4049]}, {"w": "what", "b": [0.3081, 0.3852, 0.3571, 0.4049]}, {"w": "it", "b": [0.3634, 0.3852, 0.3775, 0.4049]}, {"w": "is,", "b": [0.3838, 0.3852, 0.4069, 0.4049]}, {"w": "what", "b": [0.4132, 0.3852, 0.4622, 0.4049]}, {"w": "it", "b": [0.4685, 0.3852, 0.4826, 0.4049]}, {"w": "can", "b": [0.4889, 0.3852, 0.5239, 0.4049]}, {"w": "do,", "b": [0.5302, 0.3852, 0.5617, 0.4049]}, {"w": "and", "b": [0.568, 0.3852, 0.6045, 0.4049]}, {"w": "how", "b": [0.6108, 0.3852, 0.6542, 0.4049]}, {"w": "to", "b": [0.6605, 0.3852, 0.6801, 0.4049]}, {"w": "use", "b": [0.6864, 0.3852, 0.7201, 0.4049]}, {"w": "it.", "b": [0.7264, 0.3852, 0.7467, 0.4049]}]}, {"id": "b_1", "type": "paragraph", "text": "7.1.1. Introduction to the functional API", "words": [{"w": "7.1.1.", "b": [0.1294, 0.4324, 0.1862, 0.4521]}, {"w": "Introduction", "b": [0.1925, 0.4324, 0.3294, 0.4521]}, {"w": "to", "b": [0.3357, 0.4324, 0.3567, 0.4521]}, {"w": "the", "b": [0.363, 0.4324, 0.3966, 0.4521]}, {"w": "functional", "b": [0.4029, 0.4324, 0.5123, 0.4521]}, {"w": "API", "b": [0.5186, 0.4324, 0.562, 0.4521]}]}, {"id": "b_2", "type": "paragraph", "text": "In the functional API, you directly manipulate tensors, and you use layers as functions that take tensors and return tensors (hence, the name functional API):", "words": [{"w": "In", "b": [0.1294, 0.4752, 0.1504, 0.4949]}, {"w": "the", "b": [0.1567, 0.4752, 0.1876, 0.4949]}, {"w": "functional", "b": [0.1939, 0.4752, 0.2962, 0.4949]}, {"w": "API,", "b": [0.3025, 0.4752, 0.3494, 0.4949]}, {"w": "you", "b": [0.3557, 0.4752, 0.3936, 0.4949]}, {"w": "directly", "b": [0.3999, 0.4752, 0.4769, 0.4949]}, {"w": "manipulate", "b": [0.4832, 0.4752, 0.5953, 0.4949]}, {"w": "tensors,", "b": [0.6016, 0.4752, 0.6794, 0.4949]}, {"w": "and", "b": [0.6857, 0.4752, 0.7221, 0.4949]}, {"w": "you", "b": [0.7284, 0.4752, 0.7663, 0.4949]}, {"w": "use", "b": [0.7726, 0.4752, 0.8062, 0.4949]}, {"w": "layers", "b": [0.1294, 0.4957, 0.1897, 0.5154]}, {"w": "as", "b": [0.196, 0.4957, 0.217, 0.5154]}, {"w": "functions", "b": [0.2233, 0.4957, 0.3158, 0.5154]}, {"w": "that", "b": [0.3221, 0.4957, 0.3599, 0.5154]}, {"w": "take", "b": [0.3662, 0.4957, 0.4082, 0.5154]}, {"w": "tensors", "b": [0.4145, 0.4957, 0.486, 0.5154]}, {"w": "and", "b": [0.4923, 0.4957, 0.5287, 0.5154]}, {"w": "return", "b": [0.535, 0.4957, 0.5953, 0.5154]}, {"w": "tensors", "b": [0.6016, 0.4957, 0.673, 0.5154]}, {"w": "(hence,", "b": [0.6794, 0.4957, 0.7529, 0.5154]}, {"w": "the", "b": [0.7592, 0.4957, 0.79, 0.5154]}, {"w": "name", "b": [0.7963, 0.4957, 0.851, 0.5154]}, {"w": "functional", "b": [0.1294, 0.5162, 0.2317, 0.5359]}, {"w": "API):", "b": [0.238, 0.5162, 0.2926, 0.5359]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras import Input, layers input_tensor = Input(shape=(32,)) 1 dense = layers.Dense(32, activation='relu') 2 output_tensor = dense(input_tensor) 3", "words": [{"w": "from", "b": [0.1357, 0.5539, 0.1811, 0.5691]}, {"w": "keras", "b": [0.1925, 0.5539, 0.2492, 0.5691]}, {"w": "import", "b": [0.2606, 0.5539, 0.3287, 0.5691]}, {"w": "Input,", "b": [0.34, 0.5539, 0.4082, 0.5691]}, {"w": "layers", "b": [0.4195, 0.5539, 0.4876, 0.5691]}, {"w": "input_tensor", "b": [0.1357, 0.5842, 0.2719, 0.5994]}, {"w": "=", "b": [0.2833, 0.5842, 0.2946, 0.5994]}, {"w": "Input(shape=(32,))", "b": [0.306, 0.5842, 0.5103, 0.5994]}, {"w": "1", "b": [0.7261, 0.5842, 0.7374, 0.5994]}, {"w": "dense", "b": [0.1357, 0.5994, 0.1925, 0.6145]}, {"w": "=", "b": [0.2038, 0.5994, 0.2152, 0.6145]}, {"w": "layers.Dense(32,", "b": [0.2265, 0.5994, 0.4082, 0.6145]}, {"w": "activation='relu')", "b": [0.4195, 0.5994, 0.6238, 0.6145]}, {"w": "2", "b": [0.7261, 0.5994, 0.7374, 0.6145]}, {"w": "output_tensor", "b": [0.1357, 0.6297, 0.2833, 0.6448]}, {"w": "=", "b": [0.2946, 0.6297, 0.306, 0.6448]}, {"w": "dense(input_tensor)", "b": [0.3173, 0.6297, 0.533, 0.6448]}, {"w": "3", "b": [0.7261, 0.6297, 0.7374, 0.6448]}]}, {"id": "b_4", "type": "paragraph", "text": "1 A tensor 2 A layer is a function. 3 A layer may be called on a tensor, and it returns a tensor.", "words": [{"w": "1", "b": [0.1799, 0.6632, 0.1925, 0.683]}, {"w": "A", "b": [0.1988, 0.6632, 0.217, 0.683]}, {"w": "tensor", "b": [0.2233, 0.6632, 0.2906, 0.683]}, {"w": "2", "b": [0.1799, 0.6837, 0.1925, 0.7035]}, {"w": "A", "b": [0.1988, 0.6837, 0.217, 0.7035]}, {"w": "layer", "b": [0.2233, 0.6837, 0.2779, 0.7035]}, {"w": "is", "b": [0.2842, 0.6837, 0.3011, 0.7035]}, {"w": "a", "b": [0.3074, 0.6837, 0.32, 0.7035]}, {"w": "function.", "b": [0.3263, 0.6837, 0.4223, 0.7035]}, {"w": "3", "b": [0.1799, 0.7042, 0.1925, 0.724]}, {"w": "A", "b": [0.1988, 0.7042, 0.217, 0.724]}, {"w": "layer", "b": [0.2233, 0.7042, 0.2779, 0.724]}, {"w": "may", "b": [0.2842, 0.7042, 0.3305, 0.724]}, {"w": "be", "b": [0.3368, 0.7042, 0.362, 0.724]}, {"w": "called", "b": [0.3683, 0.7042, 0.4314, 0.724]}, {"w": "on", "b": [0.4377, 0.7042, 0.4643, 0.724]}, {"w": "a", "b": [0.4706, 0.7042, 0.4833, 0.724]}, {"w": "tensor,", "b": [0.4896, 0.7042, 0.5608, 0.724]}, {"w": "and", "b": [0.5671, 0.7042, 0.6078, 0.724]}, {"w": "it", "b": [0.6141, 0.7042, 0.6295, 0.724]}, {"w": "returns", "b": [0.6358, 0.7042, 0.7152, 0.724]}, {"w": "a", "b": [0.7215, 0.7042, 0.7341, 0.724]}, {"w": "tensor.", "b": [0.7404, 0.7042, 0.8117, 0.724]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s start with a minimal example that shows side by side a simple Sequential model and its equivalent in the functional API:", "words": [{"w": "Let’s", "b": [0.1294, 0.747, 0.1798, 0.7668]}, {"w": "start", "b": [0.1862, 0.747, 0.2296, 0.7668]}, {"w": "with", "b": [0.2359, 0.747, 0.2808, 0.7668]}, {"w": "a", "b": [0.2871, 0.747, 0.2983, 0.7668]}, {"w": "minimal", "b": [0.3046, 0.747, 0.3887, 0.7668]}, {"w": "example", "b": [0.395, 0.747, 0.4804, 0.7668]}, {"w": "that", "b": [0.4867, 0.747, 0.5246, 0.7668]}, {"w": "shows", "b": [0.5309, 0.747, 0.594, 0.7668]}, {"w": "side", "b": [0.6003, 0.747, 0.6409, 0.7668]}, {"w": "by", "b": [0.6472, 0.747, 0.6724, 0.7668]}, {"w": "side", "b": [0.6787, 0.747, 0.7194, 0.7668]}, {"w": "a", "b": [0.7257, 0.747, 0.7369, 0.7668]}, {"w": "simple", "b": [0.7432, 0.747, 0.8105, 0.7668]}, {"w": "Sequential", "b": [0.1294, 0.7686, 0.2808, 0.7888]}, {"w": "model", "b": [0.2871, 0.7675, 0.3502, 0.7873]}, {"w": "and", "b": [0.3565, 0.7675, 0.3929, 0.7873]}, {"w": "its", "b": [0.3992, 0.7675, 0.423, 0.7873]}, {"w": "equivalent", "b": [0.4293, 0.7675, 0.5344, 0.7873]}, {"w": "in", "b": [0.5407, 0.7675, 0.5604, 0.7873]}, {"w": "the", "b": [0.5667, 0.7675, 0.5975, 0.7873]}, {"w": "functional", "b": [0.6038, 0.7675, 0.7061, 0.7873]}, {"w": "API:", "b": [0.7124, 0.7675, 0.7601, 0.7873]}]}, {"id": "b_6", "type": "paragraph", "text": "from keras.models import Sequential, Model from keras import layers from keras import Input seq_model = Sequential() 1 seq_model.add(layers.Dense(32, activation='relu', input_shape=", "words": [{"w": "from", "b": [0.1357, 0.8062, 0.1811, 0.8213]}, {"w": "keras.models", "b": [0.1925, 0.8062, 0.3287, 0.8213]}, {"w": "import", "b": [0.34, 0.8062, 0.4082, 0.8213]}, {"w": "Sequential,", "b": [0.4195, 0.8062, 0.5444, 0.8213]}, {"w": "Model", "b": [0.5557, 0.8062, 0.6125, 0.8213]}, {"w": "from", "b": [0.1357, 0.8213, 0.1811, 0.8365]}, {"w": "keras", "b": [0.1925, 0.8213, 0.2492, 0.8365]}, {"w": "import", "b": [0.2606, 0.8213, 0.3287, 0.8365]}, {"w": "layers", "b": [0.34, 0.8213, 0.4082, 0.8365]}, {"w": "from", "b": [0.1357, 0.8365, 0.1811, 0.8516]}, {"w": "keras", "b": [0.1925, 0.8365, 0.2492, 0.8516]}, {"w": "import", "b": [0.2606, 0.8365, 0.3287, 0.8516]}, {"w": "Input", "b": [0.34, 0.8365, 0.3968, 0.8516]}, {"w": "seq_model", "b": [0.1357, 0.8668, 0.2379, 0.8819]}, {"w": "=", "b": [0.2492, 0.8668, 0.2606, 0.8819]}, {"w": "Sequential()", "b": [0.2719, 0.8668, 0.4082, 0.8819]}, {"w": "1", "b": [0.1357, 0.8819, 0.1471, 0.8971]}, {"w": "seq_model.add(layers.Dense(32,", "b": [0.1357, 0.8971, 0.4763, 0.9122]}, {"w": "activation='relu',", "b": [0.4876, 0.8971, 0.6919, 0.9122]}, {"w": "input_shape=", "b": [0.7033, 0.8971, 0.8395, 0.9122]}]}]}, {"page": 310, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "(64,))) seq_model.add(layers.Dense(32, activation='relu')) seq_model.add(layers.Dense(10, activation='softmax')) input_tensor = Input(shape=(64,)) 2 x = layers.Dense(32, activation='relu')(input_tensor) 2 x = layers.Dense(32, activation='relu')(x) 2 output_tensor = layers.Dense(10, activation='softmax')(x) 2 model = Model(input_tensor, output_tensor) 3 model.summary() 4", "words": [{"w": "(64,)))", "b": [0.1357, 0.0851, 0.2152, 0.1002]}, {"w": "seq_model.add(layers.Dense(32,", "b": [0.1357, 0.1002, 0.4763, 0.1154]}, {"w": "activation='relu'))", "b": [0.4876, 0.1002, 0.7033, 0.1154]}, {"w": "seq_model.add(layers.Dense(10,", "b": [0.1357, 0.1154, 0.4763, 0.1305]}, {"w": "activation='softmax'))", "b": [0.4876, 0.1154, 0.7374, 0.1305]}, {"w": "input_tensor", "b": [0.1357, 0.1457, 0.2719, 0.1608]}, {"w": "=", "b": [0.2833, 0.1457, 0.2946, 0.1608]}, {"w": "Input(shape=(64,))", "b": [0.306, 0.1457, 0.5103, 0.1608]}, {"w": "2", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "x", "b": [0.1357, 0.176, 0.1471, 0.1911]}, {"w": "=", "b": [0.1584, 0.176, 0.1698, 0.1911]}, {"w": "layers.Dense(32,", "b": [0.1811, 0.176, 0.3628, 0.1911]}, {"w": "activation='relu')(input_tensor)", "b": [0.3741, 0.176, 0.7374, 0.1911]}, {"w": "2", "b": [0.1357, 0.1912, 0.1471, 0.2063]}, {"w": "x", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "=", "b": [0.1584, 0.2063, 0.1698, 0.2214]}, {"w": "layers.Dense(32,", "b": [0.1811, 0.2063, 0.3628, 0.2214]}, {"w": "activation='relu')(x)", "b": [0.3741, 0.2063, 0.6125, 0.2214]}, {"w": "2", "b": [0.1357, 0.2215, 0.1471, 0.2366]}, {"w": "output_tensor", "b": [0.1357, 0.2366, 0.2833, 0.2518]}, {"w": "=", "b": [0.2946, 0.2366, 0.306, 0.2518]}, {"w": "layers.Dense(10,", "b": [0.3173, 0.2366, 0.499, 0.2518]}, {"w": "activation='softmax')(x)", "b": [0.5103, 0.2366, 0.7828, 0.2518]}, {"w": "2", "b": [0.1357, 0.2518, 0.1471, 0.2669]}, {"w": "model", "b": [0.1357, 0.2821, 0.1925, 0.2972]}, {"w": "=", "b": [0.2038, 0.2821, 0.2152, 0.2972]}, {"w": "Model(input_tensor,", "b": [0.2265, 0.2821, 0.4422, 0.2972]}, {"w": "output_tensor)", "b": [0.4536, 0.2821, 0.6125, 0.2972]}, {"w": "3", "b": [0.1357, 0.2972, 0.1471, 0.3124]}, {"w": "model.summary()", "b": [0.1357, 0.3275, 0.306, 0.3427]}, {"w": "4", "b": [0.1357, 0.3427, 0.1471, 0.3578]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Sequential model, which you already know about 2 Its functional equivalent 3 The Model class turns an input tensor and output tensor into a model. 4 Let’s look at it!", "words": [{"w": "1", "b": [0.1799, 0.3762, 0.1925, 0.396]}, {"w": "Sequential", "b": [0.1988, 0.3762, 0.3123, 0.396]}, {"w": "model,", "b": [0.3186, 0.3762, 0.3908, 0.396]}, {"w": "which", "b": [0.3971, 0.3762, 0.4616, 0.396]}, {"w": "you", "b": [0.4679, 0.3762, 0.5071, 0.396]}, {"w": "already", "b": [0.5134, 0.3762, 0.5943, 0.396]}, {"w": "know", "b": [0.6006, 0.3762, 0.6594, 0.396]}, {"w": "about", "b": [0.6658, 0.3762, 0.7274, 0.396]}, {"w": "2", "b": [0.1799, 0.3967, 0.1925, 0.4165]}, {"w": "Its", "b": [0.1988, 0.3967, 0.2268, 0.4165]}, {"w": "functional", "b": [0.2331, 0.3967, 0.3424, 0.4165]}, {"w": "equivalent", "b": [0.3488, 0.3967, 0.4609, 0.4165]}, {"w": "3", "b": [0.1799, 0.4172, 0.1925, 0.437]}, {"w": "The", "b": [0.1988, 0.4172, 0.2408, 0.437]}, {"w": "Model", "b": [0.2471, 0.4172, 0.3158, 0.437]}, {"w": "class", "b": [0.3221, 0.4172, 0.3726, 0.437]}, {"w": "turns", "b": [0.3789, 0.4172, 0.4363, 0.437]}, {"w": "an", "b": [0.4426, 0.4172, 0.4693, 0.437]}, {"w": "input", "b": [0.4756, 0.4172, 0.5331, 0.437]}, {"w": "tensor", "b": [0.5394, 0.4172, 0.6066, 0.437]}, {"w": "and", "b": [0.6129, 0.4172, 0.6536, 0.437]}, {"w": "output", "b": [0.6599, 0.4172, 0.7314, 0.437]}, {"w": "tensor", "b": [0.7377, 0.4172, 0.805, 0.437]}, {"w": "into", "b": [0.8113, 0.4172, 0.8533, 0.437]}, {"w": "a", "b": [0.1799, 0.4377, 0.1925, 0.4575]}, {"w": "model.", "b": [0.1988, 0.4377, 0.271, 0.4575]}, {"w": "4", "b": [0.1799, 0.4582, 0.1925, 0.478]}, {"w": "Let’s", "b": [0.1988, 0.4582, 0.2525, 0.478]}, {"w": "look", "b": [0.2588, 0.4582, 0.3051, 0.478]}, {"w": "at", "b": [0.3114, 0.4582, 0.3324, 0.478]}, {"w": "it!", "b": [0.3387, 0.4582, 0.3625, 0.478]}]}, {"id": "b_2", "type": "paragraph", "text": "This is what the call to model.summary() displays:", "words": [{"w": "This", "b": [0.1294, 0.501, 0.1743, 0.5208]}, {"w": "is", "b": [0.1806, 0.501, 0.1974, 0.5208]}, {"w": "what", "b": [0.2037, 0.501, 0.2527, 0.5208]}, {"w": "the", "b": [0.259, 0.501, 0.2899, 0.5208]}, {"w": "call", "b": [0.2962, 0.501, 0.3326, 0.5208]}, {"w": "to", "b": [0.3389, 0.501, 0.3585, 0.5208]}, {"w": "model.summary()", "b": [0.3648, 0.5021, 0.5918, 0.5223]}, {"w": "displays:", "b": [0.5982, 0.501, 0.6879, 0.5208]}]}, {"id": "b_3", "type": "paragraph", "text": "_________________________________________________________________ Layer (type) Output Shape Param # ================================================================= input_1 (InputLayer) (None, 64) 0 _________________________________________________________________ dense_1 (Dense) (None, 32) 2080 _________________________________________________________________ dense_2 (Dense) (None, 32) 1056 _________________________________________________________________ dense_3 (Dense) (None, 10) 330 ================================================================= Total params: 3,466 Trainable params: 3,466 Non-trainable params: 0", "words": [{"w": "_________________________________________________________________", "b": [0.1357, 0.5397, 0.8736, 0.5548]}, {"w": "Layer", "b": [0.1357, 0.57, 0.1925, 0.5851]}, {"w": "(type)", "b": [0.2038, 0.57, 0.2719, 0.5851]}, {"w": "Output", "b": [0.4649, 0.57, 0.533, 0.5851]}, {"w": "Shape", "b": [0.5444, 0.57, 0.6011, 0.5851]}, {"w": "Param", "b": [0.7601, 0.57, 0.8168, 0.5851]}, {"w": "#", "b": [0.8282, 0.57, 0.8395, 0.5851]}, {"w": "=================================================================", "b": [0.1357, 0.5851, 0.8736, 0.6003]}, {"w": "input_1", "b": [0.1357, 0.6154, 0.2152, 0.6306]}, {"w": "(InputLayer)", "b": [0.2265, 0.6154, 0.3628, 0.6306]}, {"w": "(None,", "b": [0.4649, 0.6154, 0.533, 0.6306]}, {"w": "64)", "b": [0.5444, 0.6154, 0.5784, 0.6306]}, {"w": "0", "b": [0.7601, 0.6154, 0.7714, 0.6306]}, {"w": "_________________________________________________________________", "b": [0.1357, 0.6306, 0.8736, 0.6457]}, {"w": "dense_1", "b": [0.1357, 0.6609, 0.2152, 0.676]}, {"w": "(Dense)", "b": [0.2265, 0.6609, 0.306, 0.676]}, {"w": "(None,", "b": [0.4649, 0.6609, 0.533, 0.676]}, {"w": "32)", "b": [0.5444, 0.6609, 0.5784, 0.676]}, {"w": "2080", "b": [0.7601, 0.6609, 0.8055, 0.676]}, {"w": "_________________________________________________________________", "b": [0.1357, 0.676, 0.8736, 0.6912]}, {"w": "dense_2", "b": [0.1357, 0.7063, 0.2152, 0.7215]}, {"w": "(Dense)", "b": [0.2265, 0.7063, 0.306, 0.7215]}, {"w": "(None,", "b": [0.4649, 0.7063, 0.533, 0.7215]}, {"w": "32)", "b": [0.5444, 0.7063, 0.5784, 0.7215]}, {"w": "1056", "b": [0.7601, 0.7063, 0.8055, 0.7215]}, {"w": "_________________________________________________________________", "b": [0.1357, 0.7215, 0.8736, 0.7366]}, {"w": "dense_3", "b": [0.1357, 0.7518, 0.2152, 0.7669]}, {"w": "(Dense)", "b": [0.2265, 0.7518, 0.306, 0.7669]}, {"w": "(None,", "b": [0.4649, 0.7518, 0.533, 0.7669]}, {"w": "10)", "b": [0.5444, 0.7518, 0.5784, 0.7669]}, {"w": "330", "b": [0.7601, 0.7518, 0.7941, 0.7669]}, {"w": "=================================================================", "b": [0.1357, 0.7669, 0.8736, 0.7821]}, {"w": "Total", "b": [0.1357, 0.7972, 0.1925, 0.8124]}, {"w": "params:", "b": [0.2038, 0.7972, 0.2833, 0.8124]}, {"w": "3,466", "b": [0.2946, 0.7972, 0.3514, 0.8124]}, {"w": "Trainable", "b": [0.1357, 0.8124, 0.2379, 0.8275]}, {"w": "params:", "b": [0.2492, 0.8124, 0.3287, 0.8275]}, {"w": "3,466", "b": [0.34, 0.8124, 0.3968, 0.8275]}, {"w": "Non-trainable", "b": [0.1357, 0.8275, 0.2833, 0.8427]}, {"w": "params:", "b": [0.2946, 0.8275, 0.3741, 0.8427]}, {"w": "0", "b": [0.3855, 0.8275, 0.3968, 0.8427]}]}, {"id": "b_4", "type": "paragraph", "text": "The only part that may seem a bit magical at this point is instantiating a Model object using only an input tensor and an output tensor. Behind", "words": [{"w": "The", "b": [0.1294, 0.8656, 0.1686, 0.8853]}, {"w": "only", "b": [0.1749, 0.8656, 0.2198, 0.8853]}, {"w": "part", "b": [0.2261, 0.8656, 0.2653, 0.8853]}, {"w": "that", "b": [0.2716, 0.8656, 0.3095, 0.8853]}, {"w": "may", "b": [0.3158, 0.8656, 0.3592, 0.8853]}, {"w": "seem", "b": [0.3655, 0.8656, 0.4174, 0.8853]}, {"w": "a", "b": [0.4237, 0.8656, 0.4349, 0.8853]}, {"w": "bit", "b": [0.4412, 0.8656, 0.4678, 0.8853]}, {"w": "magical", "b": [0.4741, 0.8656, 0.554, 0.8853]}, {"w": "at", "b": [0.5603, 0.8656, 0.5785, 0.8853]}, {"w": "this", "b": [0.5848, 0.8656, 0.6213, 0.8853]}, {"w": "point", "b": [0.6276, 0.8656, 0.6794, 0.8853]}, {"w": "is", "b": [0.6857, 0.8656, 0.7026, 0.8853]}, {"w": "instantiating", "b": [0.7089, 0.8656, 0.8336, 0.8853]}, {"w": "a", "b": [0.8399, 0.8656, 0.8511, 0.8853]}, {"w": "Model", "b": [0.1294, 0.8871, 0.2051, 0.9073]}, {"w": "object", "b": [0.2114, 0.8861, 0.273, 0.9058]}, {"w": "using", "b": [0.2794, 0.8861, 0.334, 0.9058]}, {"w": "only", "b": [0.3403, 0.8861, 0.3852, 0.9058]}, {"w": "an", "b": [0.3915, 0.8861, 0.4153, 0.9058]}, {"w": "input", "b": [0.4216, 0.8861, 0.4735, 0.9058]}, {"w": "tensor", "b": [0.4798, 0.8861, 0.5414, 0.9058]}, {"w": "and", "b": [0.5477, 0.8861, 0.5842, 0.9058]}, {"w": "an", "b": [0.5905, 0.8861, 0.6143, 0.9058]}, {"w": "output", "b": [0.6206, 0.8861, 0.6851, 0.9058]}, {"w": "tensor.", "b": [0.6914, 0.8861, 0.7579, 0.9058]}, {"w": "Behind", "b": [0.7642, 0.8861, 0.8371, 0.9058]}]}]}, {"page": 311, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the scenes, Keras retrieves every layer involved in going from input_tensor to output_tensor, bringing them together into a graph-like data structure—a Model. Of course, the reason it works is that output_tensor was obtained by repeatedly transforming input_tensor. If you tried to build a model from inputs and outputs that weren’t related, you’d get a RuntimeError:", "words": [{"w": "the", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "scenes,", "b": [0.1665, 0.0857, 0.2387, 0.1054]}, {"w": "Keras", "b": [0.245, 0.0857, 0.3038, 0.1054]}, {"w": "retrieves", "b": [0.3101, 0.0857, 0.397, 0.1054]}, {"w": "every", "b": [0.4033, 0.0857, 0.4593, 0.1054]}, {"w": "layer", "b": [0.4656, 0.0857, 0.516, 0.1054]}, {"w": "involved", "b": [0.5224, 0.0857, 0.6106, 0.1054]}, {"w": "in", "b": [0.617, 0.0857, 0.6366, 0.1054]}, {"w": "going", "b": [0.6429, 0.0857, 0.7003, 0.1054]}, {"w": "from", "b": [0.7066, 0.0857, 0.7556, 0.1054]}, {"w": "input_tensor", "b": [0.1294, 0.1072, 0.311, 0.1274]}, {"w": "to", "b": [0.3174, 0.1062, 0.337, 0.1259]}, {"w": "output_tensor,", "b": [0.3433, 0.1062, 0.5464, 0.1274]}, {"w": "bringing", "b": [0.5527, 0.1062, 0.6382, 0.1259]}, {"w": "them", "b": [0.6445, 0.1062, 0.6949, 0.1259]}, {"w": "together", "b": [0.7012, 0.1062, 0.7839, 0.1259]}, {"w": "into", "b": [0.7902, 0.1062, 0.8294, 0.1259]}, {"w": "a", "b": [0.8357, 0.1062, 0.8469, 0.1259]}, {"w": "graph-like", "b": [0.1294, 0.1276, 0.2331, 0.1473]}, {"w": "data", "b": [0.2394, 0.1276, 0.2814, 0.1473]}, {"w": "structure—a", "b": [0.2877, 0.1276, 0.4124, 0.1473]}, {"w": "Model.", "b": [0.4187, 0.1276, 0.5007, 0.1488]}, {"w": "Of", "b": [0.507, 0.1276, 0.5336, 0.1473]}, {"w": "course,", "b": [0.5399, 0.1276, 0.612, 0.1473]}, {"w": "the", "b": [0.6183, 0.1276, 0.6492, 0.1473]}, {"w": "reason", "b": [0.6555, 0.1276, 0.7213, 0.1473]}, {"w": "it", "b": [0.7276, 0.1276, 0.7416, 0.1473]}, {"w": "works", "b": [0.748, 0.1276, 0.8096, 0.1473]}, {"w": "is", "b": [0.8159, 0.1276, 0.8327, 0.1473]}, {"w": "that", "b": [0.1294, 0.149, 0.1673, 0.1687]}, {"w": "output_tensor", "b": [0.1735, 0.15, 0.3703, 0.1702]}, {"w": "was", "b": [0.3766, 0.149, 0.4159, 0.1687]}, {"w": "obtained", "b": [0.4222, 0.149, 0.509, 0.1687]}, {"w": "by", "b": [0.5153, 0.149, 0.5406, 0.1687]}, {"w": "repeatedly", "b": [0.5469, 0.149, 0.6519, 0.1687]}, {"w": "transforming", "b": [0.6582, 0.149, 0.7886, 0.1687]}, {"w": "input_tensor.", "b": [0.1294, 0.1704, 0.3174, 0.1916]}, {"w": "If", "b": [0.3237, 0.1704, 0.3405, 0.1901]}, {"w": "you", "b": [0.3468, 0.1704, 0.3846, 0.1901]}, {"w": "tried", "b": [0.3909, 0.1704, 0.4372, 0.1901]}, {"w": "to", "b": [0.4435, 0.1704, 0.4631, 0.1901]}, {"w": "build", "b": [0.4694, 0.1704, 0.5213, 0.1901]}, {"w": "a", "b": [0.5276, 0.1704, 0.5388, 0.1901]}, {"w": "model", "b": [0.5451, 0.1704, 0.6081, 0.1901]}, {"w": "from", "b": [0.6144, 0.1704, 0.6635, 0.1901]}, {"w": "inputs", "b": [0.6698, 0.1704, 0.7315, 0.1901]}, {"w": "and", "b": [0.7378, 0.1704, 0.7742, 0.1901]}, {"w": "outputs", "b": [0.7805, 0.1704, 0.8548, 0.1901]}, {"w": "that", "b": [0.1294, 0.1917, 0.1673, 0.2115]}, {"w": "weren’t", "b": [0.1736, 0.1917, 0.2501, 0.2115]}, {"w": "related,", "b": [0.2564, 0.1917, 0.3314, 0.2115]}, {"w": "you’d", "b": [0.3377, 0.1917, 0.3965, 0.2115]}, {"w": "get", "b": [0.4028, 0.1917, 0.4337, 0.2115]}, {"w": "a", "b": [0.44, 0.1917, 0.4512, 0.2115]}, {"w": "RuntimeError:", "b": [0.4574, 0.1917, 0.6461, 0.213]}]}, {"id": "b_1", "type": "paragraph", "text": ">>> unrelated_input = Input(shape=(32,)) >>> bad_model = model = Model(unrelated_input, output_tensor) RuntimeError: Graph disconnected: cannot obtain value for tensor", "words": [{"w": ">>>", "b": [0.1357, 0.2304, 0.1698, 0.2455]}, {"w": "unrelated_input", "b": [0.1811, 0.2304, 0.3514, 0.2455]}, {"w": "=", "b": [0.3628, 0.2304, 0.3741, 0.2455]}, {"w": "Input(shape=(32,))", "b": [0.3855, 0.2304, 0.5898, 0.2455]}, {"w": ">>>", "b": [0.1357, 0.2455, 0.1698, 0.2607]}, {"w": "bad_model", "b": [0.1811, 0.2455, 0.2833, 0.2607]}, {"w": "=", "b": [0.2946, 0.2455, 0.306, 0.2607]}, {"w": "model", "b": [0.3173, 0.2455, 0.3741, 0.2607]}, {"w": "=", "b": [0.3855, 0.2455, 0.3968, 0.2607]}, {"w": "Model(unrelated_input,", "b": [0.4082, 0.2455, 0.6579, 0.2607]}, {"w": "output_tensor)", "b": [0.6692, 0.2455, 0.8282, 0.2607]}, {"w": "RuntimeError:", "b": [0.1357, 0.2607, 0.2833, 0.2758]}, {"w": "Graph", "b": [0.2946, 0.2607, 0.3514, 0.2758]}, {"w": "disconnected:", "b": [0.3628, 0.2607, 0.5103, 0.2758]}, {"w": "cannot", "b": [0.5217, 0.2607, 0.5898, 0.2758]}, {"w": "obtain", "b": [0.1357, 0.2758, 0.2038, 0.291]}, {"w": "value", "b": [0.2152, 0.2758, 0.2719, 0.291]}, {"w": "for", "b": [0.2833, 0.2758, 0.3173, 0.291]}, {"w": "tensor", "b": [0.3287, 0.2758, 0.3968, 0.291]}]}, {"id": "b_2", "type": "equation", "text": "Tensor(\"input_1:0\", shape=(?, 64), dtype=float32) at layer \"input_1\".", "words": [{"w": "Tensor(\"input_1:0\",", "b": [0.1647, 0.2928, 0.3804, 0.3079]}, {"w": "shape=(?,", "b": [0.3918, 0.2928, 0.4939, 0.3079]}, {"w": "64),", "b": [0.5053, 0.2928, 0.5507, 0.3079]}, {"w": "dtype=float32)", "b": [0.562, 0.2928, 0.721, 0.3079]}, {"w": "at", "b": [0.7323, 0.2928, 0.755, 0.3079]}, {"w": "layer", "b": [0.7664, 0.2928, 0.8231, 0.3079]}, {"w": "\"input_1\".", "b": [0.1357, 0.3079, 0.2492, 0.3231]}]}, {"id": "b_3", "type": "paragraph", "text": "This error tells you, in essence, that Keras couldn’t reach input_1 from the provided output tensor.", "words": [{"w": "This", "b": [0.1294, 0.3459, 0.1743, 0.3657]}, {"w": "error", "b": [0.1806, 0.3459, 0.2296, 0.3657]}, {"w": "tells", "b": [0.2359, 0.3459, 0.2779, 0.3657]}, {"w": "you,", "b": [0.2842, 0.3459, 0.3284, 0.3657]}, {"w": "in", "b": [0.3347, 0.3459, 0.3543, 0.3657]}, {"w": "essence,", "b": [0.3606, 0.3459, 0.444, 0.3657]}, {"w": "that", "b": [0.4503, 0.3459, 0.4881, 0.3657]}, {"w": "Keras", "b": [0.4944, 0.3459, 0.5533, 0.3657]}, {"w": "couldn’t", "b": [0.5596, 0.3459, 0.6431, 0.3657]}, {"w": "reach", "b": [0.6494, 0.3459, 0.7041, 0.3657]}, {"w": "input_1", "b": [0.7103, 0.347, 0.8163, 0.3672]}, {"w": "from", "b": [0.1294, 0.3673, 0.1785, 0.3871]}, {"w": "the", "b": [0.1848, 0.3673, 0.2156, 0.3871]}, {"w": "provided", "b": [0.2219, 0.3673, 0.3116, 0.3871]}, {"w": "output", "b": [0.3179, 0.3673, 0.3824, 0.3871]}, {"w": "tensor.", "b": [0.3887, 0.3673, 0.4552, 0.3871]}]}, {"id": "b_4", "type": "paragraph", "text": "When it comes to compiling, training, or evaluating such an instance of Model, the API is the same as that of Sequential:", "words": [{"w": "When", "b": [0.1294, 0.4101, 0.1897, 0.4299]}, {"w": "it", "b": [0.196, 0.4101, 0.21, 0.4299]}, {"w": "comes", "b": [0.2163, 0.4101, 0.2807, 0.4299]}, {"w": "to", "b": [0.287, 0.4101, 0.3067, 0.4299]}, {"w": "compiling,", "b": [0.313, 0.4101, 0.4216, 0.4299]}, {"w": "training,", "b": [0.4279, 0.4101, 0.5127, 0.4299]}, {"w": "or", "b": [0.519, 0.4101, 0.54, 0.4299]}, {"w": "evaluating", "b": [0.5463, 0.4101, 0.6514, 0.4299]}, {"w": "such", "b": [0.6577, 0.4101, 0.704, 0.4299]}, {"w": "an", "b": [0.7103, 0.4101, 0.7341, 0.4299]}, {"w": "instance", "b": [0.7404, 0.4101, 0.823, 0.4299]}, {"w": "of", "b": [0.8294, 0.4101, 0.8504, 0.4299]}, {"w": "Model,", "b": [0.1294, 0.4306, 0.2114, 0.4519]}, {"w": "the", "b": [0.2177, 0.4306, 0.2485, 0.4504]}, {"w": "API", "b": [0.2548, 0.4306, 0.2955, 0.4504]}, {"w": "is", "b": [0.3018, 0.4306, 0.3186, 0.4504]}, {"w": "the", "b": [0.3249, 0.4306, 0.3557, 0.4504]}, {"w": "same", "b": [0.362, 0.4306, 0.4139, 0.4504]}, {"w": "as", "b": [0.4202, 0.4306, 0.4412, 0.4504]}, {"w": "that", "b": [0.4475, 0.4306, 0.4853, 0.4504]}, {"w": "of", "b": [0.4917, 0.4306, 0.5127, 0.4504]}, {"w": "Sequential:", "b": [0.5189, 0.4306, 0.6773, 0.4519]}]}, {"id": "b_5", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss='categorical_crossentropy') 1 import numpy as np 2 x_train = np.random.random((1000, 64)) y_train = np.random.random((1000, 10)) model.fit(x_train, y_train, epochs=10, batch_size=128) 3 score = model.evaluate(x_train, y_train) 4", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.4692, 0.5217, 0.4844]}, {"w": "loss='categorical_crossentropy')", "b": [0.1357, 0.4844, 0.499, 0.4995]}, {"w": "1", "b": [0.5671, 0.4844, 0.5785, 0.4995]}, {"w": "import", "b": [0.1357, 0.4995, 0.2038, 0.5147]}, {"w": "numpy", "b": [0.2152, 0.4995, 0.2719, 0.5147]}, {"w": "as", "b": [0.2833, 0.4995, 0.306, 0.5147]}, {"w": "np", "b": [0.3173, 0.4995, 0.34, 0.5147]}, {"w": "2", "b": [0.1357, 0.5147, 0.1471, 0.5298]}, {"w": "x_train", "b": [0.1357, 0.5298, 0.2152, 0.545]}, {"w": "=", "b": [0.2265, 0.5298, 0.2379, 0.545]}, {"w": "np.random.random((1000,", "b": [0.2492, 0.5298, 0.5103, 0.545]}, {"w": "64))", "b": [0.5217, 0.5298, 0.5671, 0.545]}, {"w": "y_train", "b": [0.1357, 0.545, 0.2152, 0.5601]}, {"w": "=", "b": [0.2265, 0.545, 0.2379, 0.5601]}, {"w": "np.random.random((1000,", "b": [0.2492, 0.545, 0.5103, 0.5601]}, {"w": "10))", "b": [0.5217, 0.545, 0.5671, 0.5601]}, {"w": "model.fit(x_train,", "b": [0.1357, 0.5753, 0.34, 0.5905]}, {"w": "y_train,", "b": [0.3514, 0.5753, 0.4422, 0.5905]}, {"w": "epochs=10,", "b": [0.4536, 0.5753, 0.5671, 0.5905]}, {"w": "batch_size=128)", "b": [0.5784, 0.5753, 0.7487, 0.5905]}, {"w": "3", "b": [0.1357, 0.5905, 0.1471, 0.6056]}, {"w": "score", "b": [0.1357, 0.6208, 0.1925, 0.6359]}, {"w": "=", "b": [0.2038, 0.6208, 0.2152, 0.6359]}, {"w": "model.evaluate(x_train,", "b": [0.2265, 0.6208, 0.4876, 0.6359]}, {"w": "y_train)", "b": [0.499, 0.6208, 0.5898, 0.6359]}, {"w": "4", "b": [0.1357, 0.6359, 0.1471, 0.6511]}]}, {"id": "b_6", "type": "paragraph", "text": "1 Compiles the model 2 Generates dummy Numpy data to train on 3 Trains the model for 10 epochs 4 Evaluates the model", "words": [{"w": "1", "b": [0.1799, 0.6695, 0.1925, 0.6892]}, {"w": "Compiles", "b": [0.1988, 0.6695, 0.2997, 0.6892]}, {"w": "the", "b": [0.306, 0.6695, 0.3396, 0.6892]}, {"w": "model", "b": [0.3459, 0.6695, 0.4118, 0.6892]}, {"w": "2", "b": [0.1799, 0.69, 0.1925, 0.7097]}, {"w": "Generates", "b": [0.1988, 0.69, 0.3081, 0.7097]}, {"w": "dummy", "b": [0.3144, 0.69, 0.3971, 0.7097]}, {"w": "Numpy", "b": [0.4034, 0.69, 0.4833, 0.7097]}, {"w": "data", "b": [0.4896, 0.69, 0.5372, 0.7097]}, {"w": "to", "b": [0.5435, 0.69, 0.5645, 0.7097]}, {"w": "train", "b": [0.5708, 0.69, 0.6241, 0.7097]}, {"w": "on", "b": [0.6304, 0.69, 0.657, 0.7097]}, {"w": "3", "b": [0.1799, 0.7105, 0.1925, 0.7302]}, {"w": "Trains", "b": [0.1988, 0.7105, 0.2684, 0.7302]}, {"w": "the", "b": [0.2747, 0.7105, 0.3083, 0.7302]}, {"w": "model", "b": [0.3146, 0.7105, 0.3805, 0.7302]}, {"w": "for", "b": [0.3868, 0.7105, 0.419, 0.7302]}, {"w": "10", "b": [0.4253, 0.7105, 0.4506, 0.7302]}, {"w": "epochs", "b": [0.4569, 0.7105, 0.5297, 0.7302]}, {"w": "4", "b": [0.1799, 0.731, 0.1925, 0.7507]}, {"w": "Evaluates", "b": [0.1988, 0.731, 0.3039, 0.7507]}, {"w": "the", "b": [0.3102, 0.731, 0.3438, 0.7507]}, {"w": "model", "b": [0.3501, 0.731, 0.416, 0.7507]}]}, {"id": "b_7", "type": "equation", "text": "7.1.2. Multi-input models", "words": [{"w": "7.1.2.", "b": [0.1294, 0.7782, 0.1862, 0.798]}, {"w": "Multi-input", "b": [0.1925, 0.7782, 0.3186, 0.798]}, {"w": "models", "b": [0.3249, 0.7782, 0.4006, 0.798]}]}, {"id": "b_8", "type": "paragraph", "text": "The functional API can be used to build models that have multiple inputs. Typically, such models at some point merge their different input branches using a layer that can combine several tensors: by adding them, concatenating them, and so on. This is usually done via a Keras merge", "words": [{"w": "The", "b": [0.1294, 0.821, 0.1686, 0.8408]}, {"w": "functional", "b": [0.1749, 0.821, 0.2772, 0.8408]}, {"w": "API", "b": [0.2835, 0.821, 0.3242, 0.8408]}, {"w": "can", "b": [0.3305, 0.821, 0.3655, 0.8408]}, {"w": "be", "b": [0.3718, 0.821, 0.3956, 0.8408]}, {"w": "used", "b": [0.4019, 0.821, 0.4482, 0.8408]}, {"w": "to", "b": [0.4545, 0.821, 0.4741, 0.8408]}, {"w": "build", "b": [0.4804, 0.821, 0.5323, 0.8408]}, {"w": "models", "b": [0.5386, 0.821, 0.6115, 0.8408]}, {"w": "that", "b": [0.6178, 0.821, 0.6556, 0.8408]}, {"w": "have", "b": [0.6619, 0.821, 0.7095, 0.8408]}, {"w": "multiple", "b": [0.7158, 0.821, 0.7999, 0.8408]}, {"w": "inputs.", "b": [0.1294, 0.8415, 0.1974, 0.8613]}, {"w": "Typically,", "b": [0.2037, 0.8415, 0.3033, 0.8613]}, {"w": "such", "b": [0.3096, 0.8415, 0.3558, 0.8613]}, {"w": "models", "b": [0.3621, 0.8415, 0.435, 0.8613]}, {"w": "at", "b": [0.4413, 0.8415, 0.4595, 0.8613]}, {"w": "some", "b": [0.4658, 0.8415, 0.5191, 0.8613]}, {"w": "point", "b": [0.5254, 0.8415, 0.5772, 0.8613]}, {"w": "merge", "b": [0.5836, 0.8415, 0.6461, 0.8613]}, {"w": "their", "b": [0.6524, 0.8415, 0.6986, 0.8613]}, {"w": "different", "b": [0.7049, 0.8415, 0.7913, 0.8613]}, {"w": "input", "b": [0.7976, 0.8415, 0.8495, 0.8613]}, {"w": "branches", "b": [0.1294, 0.862, 0.2191, 0.8818]}, {"w": "using", "b": [0.2254, 0.862, 0.28, 0.8818]}, {"w": "a", "b": [0.2863, 0.862, 0.2975, 0.8818]}, {"w": "layer", "b": [0.3038, 0.862, 0.3543, 0.8818]}, {"w": "that", "b": [0.3606, 0.862, 0.3984, 0.8818]}, {"w": "can", "b": [0.4047, 0.862, 0.4397, 0.8818]}, {"w": "combine", "b": [0.446, 0.862, 0.5329, 0.8818]}, {"w": "several", "b": [0.5392, 0.862, 0.6107, 0.8818]}, {"w": "tensors:", "b": [0.617, 0.862, 0.6955, 0.8818]}, {"w": "by", "b": [0.7018, 0.862, 0.727, 0.8818]}, {"w": "adding", "b": [0.7333, 0.862, 0.802, 0.8818]}, {"w": "them,", "b": [0.8083, 0.862, 0.865, 0.8818]}, {"w": "concatenating", "b": [0.1294, 0.8825, 0.2695, 0.9023]}, {"w": "them,", "b": [0.2758, 0.8825, 0.3326, 0.9023]}, {"w": "and", "b": [0.3389, 0.8825, 0.3753, 0.9023]}, {"w": "so", "b": [0.3816, 0.8825, 0.404, 0.9023]}, {"w": "on.", "b": [0.4104, 0.8825, 0.4419, 0.9023]}, {"w": "This", "b": [0.4482, 0.8825, 0.493, 0.9023]}, {"w": "is", "b": [0.4993, 0.8825, 0.5161, 0.9023]}, {"w": "usually", "b": [0.5224, 0.8825, 0.5953, 0.9023]}, {"w": "done", "b": [0.6016, 0.8825, 0.6506, 0.9023]}, {"w": "via", "b": [0.6569, 0.8825, 0.6878, 0.9023]}, {"w": "a", "b": [0.6941, 0.8825, 0.7053, 0.9023]}, {"w": "Keras", "b": [0.7116, 0.8825, 0.7704, 0.9023]}, {"w": "merge", "b": [0.7767, 0.8825, 0.8393, 0.9023]}]}]}, {"page": 312, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "operation such as keras.layers.add, keras.layers.concatenate, and so on. Let’s look at a very simple example of a multi-input model: a question-answering model.", "words": [{"w": "operation", "b": [0.1294, 0.0857, 0.2247, 0.1054]}, {"w": "such", "b": [0.231, 0.0857, 0.2772, 0.1054]}, {"w": "as", "b": [0.2835, 0.0857, 0.3046, 0.1054]}, {"w": "keras.layers.add,", "b": [0.3108, 0.0857, 0.5594, 0.1069]}, {"w": "keras.layers.concatenate,", "b": [0.1294, 0.1071, 0.499, 0.1283]}, {"w": "and", "b": [0.5053, 0.1071, 0.5418, 0.1268]}, {"w": "so", "b": [0.5481, 0.1071, 0.5705, 0.1268]}, {"w": "on.", "b": [0.5768, 0.1071, 0.6083, 0.1268]}, {"w": "Let’s", "b": [0.6146, 0.1071, 0.6651, 0.1268]}, {"w": "look", "b": [0.6714, 0.1071, 0.7162, 0.1268]}, {"w": "at", "b": [0.7225, 0.1071, 0.7408, 0.1268]}, {"w": "a", "b": [0.7471, 0.1071, 0.7583, 0.1268]}, {"w": "very", "b": [0.7646, 0.1071, 0.8094, 0.1268]}, {"w": "simple", "b": [0.1294, 0.1285, 0.1967, 0.1482]}, {"w": "example", "b": [0.203, 0.1285, 0.2885, 0.1482]}, {"w": "of", "b": [0.2948, 0.1285, 0.3158, 0.1482]}, {"w": "a", "b": [0.3221, 0.1285, 0.3333, 0.1482]}, {"w": "multi-input", "b": [0.3396, 0.1285, 0.4531, 0.1482]}, {"w": "model:", "b": [0.4594, 0.1285, 0.5295, 0.1482]}, {"w": "a", "b": [0.5358, 0.1285, 0.547, 0.1482]}, {"w": "question-answering", "b": [0.5533, 0.1285, 0.7509, 0.1482]}, {"w": "model.", "b": [0.7572, 0.1285, 0.8266, 0.1482]}]}, {"id": "b_1", "type": "paragraph", "text": "A typical question-answering model has two inputs: a natural-language question and a text snippet (such as a news article) providing information to be used for answering the question. The model must then produce an answer: in the simplest possible setup, this is a one-word answer obtained via a softmax over some predefined vocabulary (see figure 7.6).", "words": [{"w": "A", "b": [0.1294, 0.1712, 0.1476, 0.191]}, {"w": "typical", "b": [0.1539, 0.1712, 0.2226, 0.191]}, {"w": "question-answering", "b": [0.2289, 0.1712, 0.4265, 0.191]}, {"w": "model", "b": [0.4328, 0.1712, 0.4958, 0.191]}, {"w": "has", "b": [0.5021, 0.1712, 0.5358, 0.191]}, {"w": "two", "b": [0.5421, 0.1712, 0.5799, 0.191]}, {"w": "inputs:", "b": [0.5862, 0.1712, 0.6549, 0.191]}, {"w": "a", "b": [0.6612, 0.1712, 0.6724, 0.191]}, {"w": "natural-language", "b": [0.6787, 0.1712, 0.8482, 0.191]}, {"w": "question", "b": [0.1294, 0.1917, 0.2149, 0.2115]}, {"w": "and", "b": [0.2212, 0.1917, 0.2576, 0.2115]}, {"w": "a", "b": [0.2639, 0.1917, 0.2751, 0.2115]}, {"w": "text", "b": [0.2814, 0.1917, 0.3193, 0.2115]}, {"w": "snippet", "b": [0.3256, 0.1917, 0.3985, 0.2115]}, {"w": "(such", "b": [0.4048, 0.1917, 0.4594, 0.2115]}, {"w": "as", "b": [0.4657, 0.1917, 0.4867, 0.2115]}, {"w": "a", "b": [0.493, 0.1917, 0.5042, 0.2115]}, {"w": "news", "b": [0.5105, 0.1917, 0.5624, 0.2115]}, {"w": "article)", "b": [0.5687, 0.1917, 0.6401, 0.2115]}, {"w": "providing", "b": [0.6464, 0.1917, 0.7445, 0.2115]}, {"w": "information", "b": [0.7508, 0.1917, 0.8699, 0.2115]}, {"w": "to", "b": [0.1294, 0.2122, 0.149, 0.232]}, {"w": "be", "b": [0.1553, 0.2122, 0.1792, 0.232]}, {"w": "used", "b": [0.1855, 0.2122, 0.2317, 0.232]}, {"w": "for", "b": [0.238, 0.2122, 0.2674, 0.232]}, {"w": "answering", "b": [0.2737, 0.2122, 0.3774, 0.232]}, {"w": "the", "b": [0.3837, 0.2122, 0.4145, 0.232]}, {"w": "question.", "b": [0.4208, 0.2122, 0.5126, 0.232]}, {"w": "The", "b": [0.5189, 0.2122, 0.5582, 0.232]}, {"w": "model", "b": [0.5645, 0.2122, 0.6275, 0.232]}, {"w": "must", "b": [0.6339, 0.2122, 0.6829, 0.232]}, {"w": "then", "b": [0.6892, 0.2122, 0.7327, 0.232]}, {"w": "produce", "b": [0.739, 0.2122, 0.8202, 0.232]}, {"w": "an", "b": [0.8265, 0.2122, 0.8503, 0.232]}, {"w": "answer:", "b": [0.1294, 0.2327, 0.2079, 0.2525]}, {"w": "in", "b": [0.2142, 0.2327, 0.2338, 0.2525]}, {"w": "the", "b": [0.2401, 0.2327, 0.2709, 0.2525]}, {"w": "simplest", "b": [0.2772, 0.2327, 0.3613, 0.2525]}, {"w": "possible", "b": [0.3676, 0.2327, 0.4503, 0.2525]}, {"w": "setup,", "b": [0.4566, 0.2327, 0.5162, 0.2525]}, {"w": "this", "b": [0.5225, 0.2327, 0.5589, 0.2525]}, {"w": "is", "b": [0.5652, 0.2327, 0.582, 0.2525]}, {"w": "a", "b": [0.5884, 0.2327, 0.5996, 0.2525]}, {"w": "one-word", "b": [0.6059, 0.2327, 0.7025, 0.2525]}, {"w": "answer", "b": [0.7088, 0.2327, 0.7803, 0.2525]}, {"w": "obtained", "b": [0.1294, 0.2532, 0.2163, 0.273]}, {"w": "via", "b": [0.2226, 0.2532, 0.2534, 0.273]}, {"w": "a", "b": [0.2597, 0.2532, 0.2709, 0.273]}, {"w": "softmax", "b": [0.2772, 0.2532, 0.3585, 0.273]}, {"w": "over", "b": [0.3648, 0.2532, 0.4096, 0.273]}, {"w": "some", "b": [0.416, 0.2532, 0.4692, 0.273]}, {"w": "predefined", "b": [0.4755, 0.2532, 0.5834, 0.273]}, {"w": "vocabulary", "b": [0.5897, 0.2532, 0.7018, 0.273]}, {"w": "(see", "b": [0.7081, 0.2532, 0.7487, 0.273]}, {"w": "figure", "b": [0.7549, 0.2532, 0.8151, 0.273]}, {"w": "7.6).", "b": [0.8214, 0.2532, 0.8677, 0.273]}]}, {"id": "b_2", "type": "equation", "text": "Figure 7.6. A question-answering model", "words": [{"w": "Figure", "b": [0.1294, 0.2911, 0.1827, 0.3059]}, {"w": "7.6.", "b": [0.1874, 0.2911, 0.2158, 0.3059]}, {"w": "A", "b": [0.2205, 0.2911, 0.2341, 0.3059]}, {"w": "question-answering", "b": [0.2389, 0.2911, 0.3965, 0.3059]}, {"w": "model", "b": [0.4013, 0.2911, 0.4507, 0.3059]}]}, {"id": "b_3", "type": "paragraph", "text": "Following is an example of how you can build such a model with the functional API. You set up two independent branches, encoding the text input and the question input as representation vectors; then, concatenate these vectors; and finally, add a softmax classifier on top of the concatenated representations.", "words": [{"w": "Following", "b": [0.1294, 0.5928, 0.2331, 0.6126]}, {"w": "is", "b": [0.2394, 0.5928, 0.2563, 0.6126]}, {"w": "an", "b": [0.2626, 0.5928, 0.2864, 0.6126]}, {"w": "example", "b": [0.2927, 0.5928, 0.3782, 0.6126]}, {"w": "of", "b": [0.3845, 0.5928, 0.4055, 0.6126]}, {"w": "how", "b": [0.4118, 0.5928, 0.4552, 0.6126]}, {"w": "you", "b": [0.4615, 0.5928, 0.4994, 0.6126]}, {"w": "can", "b": [0.5057, 0.5928, 0.5407, 0.6126]}, {"w": "build", "b": [0.547, 0.5928, 0.5989, 0.6126]}, {"w": "such", "b": [0.6052, 0.5928, 0.6514, 0.6126]}, {"w": "a", "b": [0.6577, 0.5928, 0.6689, 0.6126]}, {"w": "model", "b": [0.6752, 0.5928, 0.7383, 0.6126]}, {"w": "with", "b": [0.7446, 0.5928, 0.7894, 0.6126]}, {"w": "the", "b": [0.7958, 0.5928, 0.8266, 0.6126]}, {"w": "functional", "b": [0.1294, 0.6133, 0.2317, 0.6331]}, {"w": "API.", "b": [0.238, 0.6133, 0.285, 0.6331]}, {"w": "You", "b": [0.2913, 0.6133, 0.3322, 0.6331]}, {"w": "set", "b": [0.3385, 0.6133, 0.3665, 0.6331]}, {"w": "up", "b": [0.3728, 0.6133, 0.398, 0.6331]}, {"w": "two", "b": [0.4043, 0.6133, 0.4422, 0.6331]}, {"w": "independent", "b": [0.4485, 0.6133, 0.5718, 0.6331]}, {"w": "branches,", "b": [0.5781, 0.6133, 0.6741, 0.6331]}, {"w": "encoding", "b": [0.6804, 0.6133, 0.7728, 0.6331]}, {"w": "the", "b": [0.7791, 0.6133, 0.8099, 0.6331]}, {"w": "text", "b": [0.8162, 0.6133, 0.8541, 0.6331]}, {"w": "input", "b": [0.1294, 0.6338, 0.1813, 0.6536]}, {"w": "and", "b": [0.1876, 0.6338, 0.224, 0.6536]}, {"w": "the", "b": [0.2303, 0.6338, 0.2611, 0.6536]}, {"w": "question", "b": [0.2674, 0.6338, 0.3529, 0.6536]}, {"w": "input", "b": [0.3592, 0.6338, 0.4111, 0.6536]}, {"w": "as", "b": [0.4174, 0.6338, 0.4384, 0.6536]}, {"w": "representation", "b": [0.4447, 0.6338, 0.5876, 0.6536]}, {"w": "vectors;", "b": [0.5939, 0.6338, 0.6738, 0.6536]}, {"w": "then,", "b": [0.6801, 0.6338, 0.7299, 0.6536]}, {"w": "concatenate", "b": [0.7362, 0.6338, 0.8552, 0.6536]}, {"w": "these", "b": [0.1294, 0.6543, 0.1813, 0.6741]}, {"w": "vectors;", "b": [0.1876, 0.6543, 0.2674, 0.6741]}, {"w": "and", "b": [0.2737, 0.6543, 0.3102, 0.6741]}, {"w": "finally,", "b": [0.3165, 0.6543, 0.387, 0.6741]}, {"w": "add", "b": [0.3933, 0.6543, 0.4297, 0.6741]}, {"w": "a", "b": [0.436, 0.6543, 0.4472, 0.6741]}, {"w": "softmax", "b": [0.4535, 0.6543, 0.5348, 0.6741]}, {"w": "classifier", "b": [0.5411, 0.6543, 0.6321, 0.6741]}, {"w": "on", "b": [0.6384, 0.6543, 0.6637, 0.6741]}, {"w": "top", "b": [0.67, 0.6543, 0.7022, 0.6741]}, {"w": "of", "b": [0.7085, 0.6543, 0.7295, 0.6741]}, {"w": "the", "b": [0.7358, 0.6543, 0.7667, 0.6741]}, {"w": "concatenated", "b": [0.1294, 0.6748, 0.2611, 0.6946]}, {"w": "representations.", "b": [0.2674, 0.6748, 0.4264, 0.6946]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 7.1. Functional API implementation of a two-input question-answering model", "words": [{"w": "Listing", "b": [0.1294, 0.7171, 0.1862, 0.7319]}, {"w": "7.1.", "b": [0.1909, 0.7171, 0.2193, 0.7319]}, {"w": "Functional", "b": [0.224, 0.7171, 0.3113, 0.7319]}, {"w": "API", "b": [0.316, 0.7171, 0.3486, 0.7319]}, {"w": "implementation", "b": [0.3533, 0.7171, 0.4805, 0.7319]}, {"w": "of", "b": [0.4852, 0.7171, 0.501, 0.7319]}, {"w": "a", "b": [0.5057, 0.7171, 0.5152, 0.7319]}, {"w": "two-input", "b": [0.5199, 0.7171, 0.5987, 0.7319]}, {"w": "question-answering", "b": [0.6035, 0.7171, 0.7611, 0.7319]}, {"w": "model", "b": [0.7659, 0.7171, 0.8153, 0.7319]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras.models import Model from keras import layers from keras import Input text_vocabulary_size = 10000 question_vocabulary_size = 10000 answer_vocabulary_size = 500 text_input = Input(shape=(None,), dtype='int32', name='text') 1", "words": [{"w": "from", "b": [0.1357, 0.7455, 0.1811, 0.7607]}, {"w": "keras.models", "b": [0.1925, 0.7455, 0.3287, 0.7607]}, {"w": "import", "b": [0.34, 0.7455, 0.4082, 0.7607]}, {"w": "Model", "b": [0.4195, 0.7455, 0.4763, 0.7607]}, {"w": "from", "b": [0.1357, 0.7607, 0.1811, 0.7758]}, {"w": "keras", "b": [0.1925, 0.7607, 0.2492, 0.7758]}, {"w": "import", "b": [0.2606, 0.7607, 0.3287, 0.7758]}, {"w": "layers", "b": [0.34, 0.7607, 0.4082, 0.7758]}, {"w": "from", "b": [0.1357, 0.7759, 0.1811, 0.791]}, {"w": "keras", "b": [0.1925, 0.7759, 0.2492, 0.791]}, {"w": "import", "b": [0.2606, 0.7759, 0.3287, 0.791]}, {"w": "Input", "b": [0.34, 0.7759, 0.3968, 0.791]}, {"w": "text_vocabulary_size", "b": [0.1357, 0.8062, 0.3628, 0.8213]}, {"w": "=", "b": [0.3741, 0.8062, 0.3855, 0.8213]}, {"w": "10000", "b": [0.3968, 0.8062, 0.4536, 0.8213]}, {"w": "question_vocabulary_size", "b": [0.1357, 0.8213, 0.4082, 0.8365]}, {"w": "=", "b": [0.4195, 0.8213, 0.4309, 0.8365]}, {"w": "10000", "b": [0.4422, 0.8213, 0.499, 0.8365]}, {"w": "answer_vocabulary_size", "b": [0.1357, 0.8365, 0.3855, 0.8516]}, {"w": "=", "b": [0.3968, 0.8365, 0.4082, 0.8516]}, {"w": "500", "b": [0.4195, 0.8365, 0.4536, 0.8516]}, {"w": "text_input", "b": [0.1357, 0.8668, 0.2492, 0.8819]}, {"w": "=", "b": [0.2606, 0.8668, 0.2719, 0.8819]}, {"w": "Input(shape=(None,),", "b": [0.2833, 0.8668, 0.5103, 0.8819]}, {"w": "dtype='int32',", "b": [0.5217, 0.8668, 0.6806, 0.8819]}, {"w": "name='text')", "b": [0.6919, 0.8668, 0.8282, 0.8819]}, {"w": "1", "b": [0.1357, 0.8819, 0.1471, 0.8971]}]}]}, {"page": 313, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "embedded_text = layers.Embedding( 64, text_vocabulary_size)(text_input) 2 encoded_text = layers.LSTM(32)(embedded_text) 3 question_input = Input(shape=(None,), dtype='int32', name='question') 4 embedded_question = layers.Embedding( 32, question_vocabulary_size)(question_input) encoded_question = layers.LSTM(16)(embedded_question) concatenated = layers.concatenate([encoded_text, encoded_question], axis=-1) 5 answer = layers.Dense(answer_vocabulary_size, activation='softmax')(concatenated) 6 model = Model([text_input, question_input], answer) 7 model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['acc'])", "words": [{"w": "embedded_text", "b": [0.1357, 0.0851, 0.2833, 0.1002]}, {"w": "=", "b": [0.2946, 0.0851, 0.306, 0.1002]}, {"w": "layers.Embedding(", "b": [0.3173, 0.0851, 0.5103, 0.1002]}, {"w": "64,", "b": [0.1811, 0.1002, 0.2152, 0.1154]}, {"w": "text_vocabulary_size)(text_input)", "b": [0.2265, 0.1002, 0.6011, 0.1154]}, {"w": "2", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "encoded_text", "b": [0.1357, 0.1457, 0.2719, 0.1608]}, {"w": "=", "b": [0.2833, 0.1457, 0.2946, 0.1608]}, {"w": "layers.LSTM(32)(embedded_text)", "b": [0.306, 0.1457, 0.6465, 0.1608]}, {"w": "3", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "question_input", "b": [0.1357, 0.1912, 0.2946, 0.2063]}, {"w": "=", "b": [0.306, 0.1912, 0.3173, 0.2063]}, {"w": "Input(shape=(None,),", "b": [0.3287, 0.1912, 0.5557, 0.2063]}, {"w": "dtype='int32',", "b": [0.3968, 0.2063, 0.5557, 0.2214]}, {"w": "name='question')", "b": [0.3968, 0.2215, 0.5784, 0.2366]}, {"w": "4", "b": [0.1357, 0.2366, 0.1471, 0.2518]}, {"w": "embedded_question", "b": [0.1357, 0.2669, 0.3287, 0.2821]}, {"w": "=", "b": [0.34, 0.2669, 0.3514, 0.2821]}, {"w": "layers.Embedding(", "b": [0.3628, 0.2669, 0.5557, 0.2821]}, {"w": "32,", "b": [0.1811, 0.2821, 0.2152, 0.2972]}, {"w": "question_vocabulary_size)(question_input)", "b": [0.2265, 0.2821, 0.6919, 0.2972]}, {"w": "encoded_question", "b": [0.1357, 0.2972, 0.3173, 0.3124]}, {"w": "=", "b": [0.3287, 0.2972, 0.34, 0.3124]}, {"w": "layers.LSTM(16)(embedded_question)", "b": [0.3514, 0.2972, 0.7374, 0.3124]}, {"w": "concatenated", "b": [0.1357, 0.3275, 0.2719, 0.3427]}, {"w": "=", "b": [0.2833, 0.3275, 0.2946, 0.3427]}, {"w": "layers.concatenate([encoded_text,", "b": [0.306, 0.3275, 0.6806, 0.3427]}, {"w": "encoded_question],", "b": [0.1357, 0.3427, 0.34, 0.3578]}, {"w": "axis=-1)", "b": [0.5217, 0.3578, 0.6125, 0.373]}, {"w": "5", "b": [0.1357, 0.373, 0.1471, 0.3881]}, {"w": "answer", "b": [0.1357, 0.4033, 0.2038, 0.4184]}, {"w": "=", "b": [0.2152, 0.4033, 0.2265, 0.4184]}, {"w": "layers.Dense(answer_vocabulary_size,", "b": [0.2379, 0.4033, 0.6465, 0.4184]}, {"w": "activation='softmax')(concatenated)", "b": [0.3855, 0.4184, 0.7828, 0.4336]}, {"w": "6", "b": [0.1357, 0.4336, 0.1471, 0.4487]}, {"w": "model", "b": [0.1357, 0.4639, 0.1925, 0.479]}, {"w": "=", "b": [0.2038, 0.4639, 0.2152, 0.479]}, {"w": "Model([text_input,", "b": [0.2265, 0.4639, 0.4309, 0.479]}, {"w": "question_input],", "b": [0.4422, 0.4639, 0.6238, 0.479]}, {"w": "answer)", "b": [0.6352, 0.4639, 0.7146, 0.479]}, {"w": "7", "b": [0.1357, 0.479, 0.1471, 0.4942]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.4942, 0.5217, 0.5093]}, {"w": "loss='categorical_crossentropy',", "b": [0.2946, 0.5093, 0.6579, 0.5245]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.5245, 0.4763, 0.5396]}]}, {"id": "b_1", "type": "paragraph", "text": "1 The text input is a variable-length sequence of integers. Note that you can optionally name the inputs. 2 Embeds the inputs into a sequence of vectors of size 64 3 Encodes the vectors in a single vector via an LSTM 4 Same process (with different layer instances) for the question 5 Concatenates the encoded question and encoded text 6 Adds a softmax classifier on top 7 At model instantiation, you specify the two inputs and the output.", "words": [{"w": "1", "b": [0.1799, 0.5581, 0.1925, 0.5778]}, {"w": "The", "b": [0.1988, 0.5581, 0.2408, 0.5778]}, {"w": "text", "b": [0.2471, 0.5581, 0.2878, 0.5778]}, {"w": "input", "b": [0.2941, 0.5581, 0.3516, 0.5778]}, {"w": "is", "b": [0.3579, 0.5581, 0.3747, 0.5778]}, {"w": "a", "b": [0.381, 0.5581, 0.3936, 0.5778]}, {"w": "variable-length", "b": [0.3999, 0.5581, 0.5639, 0.5778]}, {"w": "sequence", "b": [0.5702, 0.5581, 0.6669, 0.5778]}, {"w": "of", "b": [0.6732, 0.5581, 0.6942, 0.5778]}, {"w": "integers.", "b": [0.7005, 0.5581, 0.7923, 0.5778]}, {"w": "Note", "b": [0.7986, 0.5581, 0.849, 0.5778]}, {"w": "that", "b": [0.1799, 0.5786, 0.2233, 0.5983]}, {"w": "you", "b": [0.2296, 0.5786, 0.2689, 0.5983]}, {"w": "can", "b": [0.2752, 0.5786, 0.313, 0.5983]}, {"w": "optionally", "b": [0.3193, 0.5786, 0.4273, 0.5983]}, {"w": "name", "b": [0.4336, 0.5786, 0.4924, 0.5983]}, {"w": "the", "b": [0.4987, 0.5786, 0.5323, 0.5983]}, {"w": "inputs.", "b": [0.5386, 0.5786, 0.6123, 0.5983]}, {"w": "2", "b": [0.1799, 0.5991, 0.1925, 0.6188]}, {"w": "Embeds", "b": [0.1988, 0.5991, 0.2857, 0.6188]}, {"w": "the", "b": [0.292, 0.5991, 0.3256, 0.6188]}, {"w": "inputs", "b": [0.3319, 0.5991, 0.3992, 0.6188]}, {"w": "into", "b": [0.4055, 0.5991, 0.4476, 0.6188]}, {"w": "a", "b": [0.4539, 0.5991, 0.4665, 0.6188]}, {"w": "sequence", "b": [0.4728, 0.5991, 0.5695, 0.6188]}, {"w": "of", "b": [0.5758, 0.5991, 0.5968, 0.6188]}, {"w": "vectors", "b": [0.6031, 0.5991, 0.6802, 0.6188]}, {"w": "of", "b": [0.6865, 0.5991, 0.7075, 0.6188]}, {"w": "size", "b": [0.7138, 0.5991, 0.753, 0.6188]}, {"w": "64", "b": [0.7593, 0.5991, 0.7846, 0.6188]}, {"w": "3", "b": [0.1799, 0.6196, 0.1925, 0.6393]}, {"w": "Encodes", "b": [0.1988, 0.6196, 0.2885, 0.6393]}, {"w": "the", "b": [0.2948, 0.6196, 0.3284, 0.6393]}, {"w": "vectors", "b": [0.3347, 0.6196, 0.4118, 0.6393]}, {"w": "in", "b": [0.4181, 0.6196, 0.4391, 0.6393]}, {"w": "a", "b": [0.4454, 0.6196, 0.458, 0.6393]}, {"w": "single", "b": [0.4643, 0.6196, 0.526, 0.6393]}, {"w": "vector", "b": [0.5323, 0.6196, 0.5995, 0.6393]}, {"w": "via", "b": [0.6059, 0.6196, 0.6381, 0.6393]}, {"w": "an", "b": [0.6444, 0.6196, 0.671, 0.6393]}, {"w": "LSTM", "b": [0.6773, 0.6196, 0.7488, 0.6393]}, {"w": "4", "b": [0.1799, 0.6401, 0.1925, 0.6598]}, {"w": "Same", "b": [0.1988, 0.6401, 0.2576, 0.6598]}, {"w": "process", "b": [0.2639, 0.6401, 0.3434, 0.6598]}, {"w": "(with", "b": [0.3497, 0.6401, 0.4057, 0.6598]}, {"w": "different", "b": [0.412, 0.6401, 0.5054, 0.6598]}, {"w": "layer", "b": [0.5117, 0.6401, 0.5664, 0.6598]}, {"w": "instances)", "b": [0.5727, 0.6401, 0.6792, 0.6598]}, {"w": "for", "b": [0.6855, 0.6401, 0.7177, 0.6598]}, {"w": "the", "b": [0.724, 0.6401, 0.7576, 0.6598]}, {"w": "question", "b": [0.7639, 0.6401, 0.8551, 0.6598]}, {"w": "5", "b": [0.1799, 0.6606, 0.1925, 0.6803]}, {"w": "Concatenates", "b": [0.1988, 0.6606, 0.3431, 0.6803]}, {"w": "the", "b": [0.3494, 0.6606, 0.383, 0.6803]}, {"w": "encoded", "b": [0.3893, 0.6606, 0.4776, 0.6803]}, {"w": "question", "b": [0.4839, 0.6606, 0.5751, 0.6803]}, {"w": "and", "b": [0.5814, 0.6606, 0.622, 0.6803]}, {"w": "encoded", "b": [0.6283, 0.6606, 0.7166, 0.6803]}, {"w": "text", "b": [0.7229, 0.6606, 0.7635, 0.6803]}, {"w": "6", "b": [0.1799, 0.6811, 0.1925, 0.7008]}, {"w": "Adds", "b": [0.1988, 0.6811, 0.2549, 0.7008]}, {"w": "a", "b": [0.2612, 0.6811, 0.2738, 0.7008]}, {"w": "softmax", "b": [0.2801, 0.6811, 0.3656, 0.7008]}, {"w": "classifier", "b": [0.3719, 0.6811, 0.4671, 0.7008]}, {"w": "on", "b": [0.4734, 0.6811, 0.5001, 0.7008]}, {"w": "top", "b": [0.5064, 0.6811, 0.5414, 0.7008]}, {"w": "7", "b": [0.1799, 0.7016, 0.1925, 0.7213]}, {"w": "At", "b": [0.1988, 0.7016, 0.2254, 0.7213]}, {"w": "model", "b": [0.2317, 0.7016, 0.2976, 0.7213]}, {"w": "instantiation,", "b": [0.3039, 0.7016, 0.4461, 0.7213]}, {"w": "you", "b": [0.4525, 0.7016, 0.4917, 0.7213]}, {"w": "specify", "b": [0.498, 0.7016, 0.5723, 0.7213]}, {"w": "the", "b": [0.5786, 0.7016, 0.6122, 0.7213]}, {"w": "two", "b": [0.6185, 0.7016, 0.6577, 0.7213]}, {"w": "inputs", "b": [0.664, 0.7016, 0.7313, 0.7213]}, {"w": "and", "b": [0.7377, 0.7016, 0.7783, 0.7213]}, {"w": "the", "b": [0.7846, 0.7016, 0.8183, 0.7213]}, {"w": "output.", "b": [0.1799, 0.7221, 0.2577, 0.7418]}]}, {"id": "b_2", "type": "paragraph", "text": "Now, how do you train this two-input model? There are two possible APIs: you can feed the model a list of Numpy arrays as inputs, or you can feed it a dictionary that maps input names to Numpy arrays. Naturally, the latter option is available only if you give names to your inputs.", "words": [{"w": "Now,", "b": [0.1294, 0.7649, 0.1831, 0.7846]}, {"w": "how", "b": [0.1894, 0.7649, 0.2329, 0.7846]}, {"w": "do", "b": [0.2392, 0.7649, 0.2644, 0.7846]}, {"w": "you", "b": [0.2707, 0.7649, 0.3086, 0.7846]}, {"w": "train", "b": [0.3149, 0.7649, 0.3611, 0.7846]}, {"w": "this", "b": [0.3674, 0.7649, 0.4039, 0.7846]}, {"w": "two-input", "b": [0.4102, 0.7649, 0.5083, 0.7846]}, {"w": "model?", "b": [0.5146, 0.7649, 0.5888, 0.7846]}, {"w": "There", "b": [0.5951, 0.7649, 0.654, 0.7846]}, {"w": "are", "b": [0.6603, 0.7649, 0.6911, 0.7846]}, {"w": "two", "b": [0.6974, 0.7649, 0.7352, 0.7846]}, {"w": "possible", "b": [0.7415, 0.7649, 0.8242, 0.7846]}, {"w": "APIs:", "b": [0.1294, 0.7854, 0.1869, 0.8051]}, {"w": "you", "b": [0.1932, 0.7854, 0.231, 0.8051]}, {"w": "can", "b": [0.2373, 0.7854, 0.2723, 0.8051]}, {"w": "feed", "b": [0.2786, 0.7854, 0.3221, 0.8051]}, {"w": "the", "b": [0.3284, 0.7854, 0.3592, 0.8051]}, {"w": "model", "b": [0.3655, 0.7854, 0.4286, 0.8051]}, {"w": "a", "b": [0.4349, 0.7854, 0.4461, 0.8051]}, {"w": "list", "b": [0.4524, 0.7854, 0.4832, 0.8051]}, {"w": "of", "b": [0.4895, 0.7854, 0.5105, 0.8051]}, {"w": "Numpy", "b": [0.5169, 0.7854, 0.5925, 0.8051]}, {"w": "arrays", "b": [0.5988, 0.7854, 0.6605, 0.8051]}, {"w": "as", "b": [0.6668, 0.7854, 0.6878, 0.8051]}, {"w": "inputs,", "b": [0.694, 0.7854, 0.762, 0.8051]}, {"w": "or", "b": [0.7683, 0.7854, 0.7893, 0.8051]}, {"w": "you", "b": [0.7956, 0.7854, 0.8335, 0.8051]}, {"w": "can", "b": [0.1294, 0.8059, 0.1644, 0.8256]}, {"w": "feed", "b": [0.1707, 0.8059, 0.2141, 0.8256]}, {"w": "it", "b": [0.2205, 0.8059, 0.2345, 0.8256]}, {"w": "a", "b": [0.2408, 0.8059, 0.252, 0.8256]}, {"w": "dictionary", "b": [0.2583, 0.8059, 0.3606, 0.8256]}, {"w": "that", "b": [0.3669, 0.8059, 0.4047, 0.8256]}, {"w": "maps", "b": [0.411, 0.8059, 0.4643, 0.8256]}, {"w": "input", "b": [0.4706, 0.8059, 0.5225, 0.8256]}, {"w": "names", "b": [0.5288, 0.8059, 0.5932, 0.8256]}, {"w": "to", "b": [0.5995, 0.8059, 0.6191, 0.8256]}, {"w": "Numpy", "b": [0.6255, 0.8059, 0.7011, 0.8256]}, {"w": "arrays.", "b": [0.7074, 0.8059, 0.7754, 0.8256]}, {"w": "Naturally,", "b": [0.1294, 0.8264, 0.2293, 0.8461]}, {"w": "the", "b": [0.2356, 0.8264, 0.2665, 0.8461]}, {"w": "latter", "b": [0.2728, 0.8264, 0.3246, 0.8461]}, {"w": "option", "b": [0.3309, 0.8264, 0.3954, 0.8461]}, {"w": "is", "b": [0.4017, 0.8264, 0.4185, 0.8461]}, {"w": "available", "b": [0.4248, 0.8264, 0.5159, 0.8461]}, {"w": "only", "b": [0.5222, 0.8264, 0.5671, 0.8461]}, {"w": "if", "b": [0.5733, 0.8264, 0.5887, 0.8461]}, {"w": "you", "b": [0.595, 0.8264, 0.6328, 0.8461]}, {"w": "give", "b": [0.6392, 0.8264, 0.6826, 0.8461]}, {"w": "names", "b": [0.6889, 0.8264, 0.7533, 0.8461]}, {"w": "to", "b": [0.7597, 0.8264, 0.7793, 0.8461]}, {"w": "your", "b": [0.7856, 0.8264, 0.8318, 0.8461]}, {"w": "inputs.", "b": [0.1294, 0.8469, 0.1974, 0.8666]}]}, {"id": "b_3", "type": "equation", "text": "Listing 7.2. Feeding data to a multi-input model", "words": [{"w": "Listing", "b": [0.1294, 0.8847, 0.1862, 0.8995]}, {"w": "7.2.", "b": [0.1909, 0.8847, 0.2193, 0.8995]}, {"w": "Feeding", "b": [0.224, 0.8847, 0.2881, 0.8995]}, {"w": "data", "b": [0.2929, 0.8847, 0.3286, 0.8995]}, {"w": "to", "b": [0.3333, 0.8847, 0.3491, 0.8995]}, {"w": "a", "b": [0.3538, 0.8847, 0.3633, 0.8995]}, {"w": "multi-input", "b": [0.368, 0.8847, 0.4605, 0.8995]}, {"w": "model", "b": [0.4652, 0.8847, 0.5146, 0.8995]}]}]}, {"page": 314, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "import numpy as np num_samples = 1000 max_length = 100 text = np.random.randint(1, text_vocabulary_size, size=(num_samples, max_length)) 1 question = np.random.randint(1, question_vocabulary_size, size=(num_samples, max_length)) answers = np.random.randint(0, 1, size=(num_samples, answer_vocabulary_size)) 2 model.fit([text, question], answers, epochs=10, batch_size=128) 3 model.fit({'text': text, 'question': question}, answers, 4 epochs=10, batch_size=128) 4", "words": [{"w": "import", "b": [0.1357, 0.0851, 0.2038, 0.1002]}, {"w": "numpy", "b": [0.2152, 0.0851, 0.2719, 0.1002]}, {"w": "as", "b": [0.2833, 0.0851, 0.306, 0.1002]}, {"w": "np", "b": [0.3173, 0.0851, 0.34, 0.1002]}, {"w": "num_samples", "b": [0.1357, 0.1154, 0.2606, 0.1305]}, {"w": "=", "b": [0.2719, 0.1154, 0.2833, 0.1305]}, {"w": "1000", "b": [0.2946, 0.1154, 0.34, 0.1305]}, {"w": "max_length", "b": [0.1357, 0.1305, 0.2492, 0.1457]}, {"w": "=", "b": [0.2606, 0.1305, 0.2719, 0.1457]}, {"w": "100", "b": [0.2833, 0.1305, 0.3173, 0.1457]}, {"w": "text", "b": [0.1357, 0.1608, 0.1811, 0.176]}, {"w": "=", "b": [0.1925, 0.1608, 0.2038, 0.176]}, {"w": "np.random.randint(1,", "b": [0.2152, 0.1608, 0.4422, 0.176]}, {"w": "text_vocabulary_size,", "b": [0.4536, 0.1608, 0.6919, 0.176]}, {"w": "size=(num_samples,", "b": [0.4195, 0.176, 0.6238, 0.1911]}, {"w": "max_length))", "b": [0.6352, 0.176, 0.7714, 0.1911]}, {"w": "1", "b": [0.1357, 0.1911, 0.1471, 0.2063]}, {"w": "question", "b": [0.1357, 0.2063, 0.2265, 0.2214]}, {"w": "=", "b": [0.2379, 0.2063, 0.2492, 0.2214]}, {"w": "np.random.randint(1,", "b": [0.2606, 0.2063, 0.4876, 0.2214]}, {"w": "question_vocabulary_size,", "b": [0.499, 0.2063, 0.7828, 0.2214]}, {"w": "size=(num_samples,", "b": [0.4649, 0.2215, 0.6692, 0.2366]}, {"w": "max_length))", "b": [0.6806, 0.2215, 0.8168, 0.2366]}, {"w": "answers", "b": [0.1357, 0.2366, 0.2152, 0.2518]}, {"w": "=", "b": [0.2265, 0.2366, 0.2379, 0.2518]}, {"w": "np.random.randint(0,", "b": [0.2492, 0.2366, 0.4763, 0.2518]}, {"w": "1,", "b": [0.4876, 0.2366, 0.5103, 0.2518]}, {"w": "size=(num_samples,", "b": [0.4536, 0.2518, 0.6579, 0.2669]}, {"w": "answer_vocabulary_size))", "b": [0.1357, 0.2669, 0.4082, 0.2821]}, {"w": "2", "b": [0.4536, 0.2669, 0.465, 0.2821]}, {"w": "model.fit([text,", "b": [0.1357, 0.2972, 0.3173, 0.3124]}, {"w": "question],", "b": [0.3287, 0.2972, 0.4422, 0.3124]}, {"w": "answers,", "b": [0.4536, 0.2972, 0.5444, 0.3124]}, {"w": "epochs=10,", "b": [0.5557, 0.2972, 0.6692, 0.3124]}, {"w": "batch_size=128)", "b": [0.6806, 0.2972, 0.8509, 0.3124]}, {"w": "3", "b": [0.1357, 0.3124, 0.1471, 0.3275]}, {"w": "model.fit({'text':", "b": [0.1357, 0.3427, 0.34, 0.3578]}, {"w": "text,", "b": [0.3514, 0.3427, 0.4082, 0.3578]}, {"w": "'question':", "b": [0.4195, 0.3427, 0.5444, 0.3578]}, {"w": "question},", "b": [0.5557, 0.3427, 0.6692, 0.3578]}, {"w": "answers,", "b": [0.6806, 0.3427, 0.7714, 0.3578]}, {"w": "4", "b": [0.1357, 0.3578, 0.1471, 0.373]}, {"w": "epochs=10,", "b": [0.2492, 0.373, 0.3628, 0.3881]}, {"w": "batch_size=128)", "b": [0.3741, 0.373, 0.5444, 0.3881]}, {"w": "4", "b": [0.1357, 0.3881, 0.1471, 0.4033]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Generates dummy Numpy data 2 Answers are one-hot encoded, not integers 3 Fitting using a list of inputs 4 Fitting using a dictionary of inputs (only if inputs are named)", "words": [{"w": "1", "b": [0.1799, 0.4217, 0.1925, 0.4414]}, {"w": "Generates", "b": [0.1988, 0.4217, 0.3081, 0.4414]}, {"w": "dummy", "b": [0.3144, 0.4217, 0.3971, 0.4414]}, {"w": "Numpy", "b": [0.4034, 0.4217, 0.4833, 0.4414]}, {"w": "data", "b": [0.4896, 0.4217, 0.5372, 0.4414]}, {"w": "2", "b": [0.1799, 0.4422, 0.1925, 0.4619]}, {"w": "Answers", "b": [0.1988, 0.4422, 0.2913, 0.4619]}, {"w": "are", "b": [0.2976, 0.4422, 0.3321, 0.4619]}, {"w": "one-hot", "b": [0.3384, 0.4422, 0.4197, 0.4619]}, {"w": "encoded,", "b": [0.426, 0.4422, 0.5206, 0.4619]}, {"w": "not", "b": [0.5269, 0.4422, 0.562, 0.4619]}, {"w": "integers", "b": [0.5683, 0.4422, 0.6537, 0.4619]}, {"w": "3", "b": [0.1799, 0.4627, 0.1925, 0.4824]}, {"w": "Fitting", "b": [0.1988, 0.4627, 0.2717, 0.4824]}, {"w": "using", "b": [0.278, 0.4627, 0.3355, 0.4824]}, {"w": "a", "b": [0.3418, 0.4627, 0.3544, 0.4824]}, {"w": "list", "b": [0.3607, 0.4627, 0.3929, 0.4824]}, {"w": "of", "b": [0.3992, 0.4627, 0.4202, 0.4824]}, {"w": "inputs", "b": [0.4265, 0.4627, 0.4938, 0.4824]}, {"w": "4", "b": [0.1799, 0.4832, 0.1925, 0.5029]}, {"w": "Fitting", "b": [0.1988, 0.4832, 0.2717, 0.5029]}, {"w": "using", "b": [0.278, 0.4832, 0.3355, 0.5029]}, {"w": "a", "b": [0.3418, 0.4832, 0.3544, 0.5029]}, {"w": "dictionary", "b": [0.3607, 0.4832, 0.4714, 0.5029]}, {"w": "of", "b": [0.4777, 0.4832, 0.4987, 0.5029]}, {"w": "inputs", "b": [0.505, 0.4832, 0.5723, 0.5029]}, {"w": "(only", "b": [0.5786, 0.4832, 0.6333, 0.5029]}, {"w": "if", "b": [0.6396, 0.4832, 0.655, 0.5029]}, {"w": "inputs", "b": [0.6613, 0.4832, 0.7286, 0.5029]}, {"w": "are", "b": [0.7349, 0.4832, 0.7695, 0.5029]}, {"w": "named)", "b": [0.7758, 0.4832, 0.8571, 0.5029]}]}, {"id": "b_2", "type": "equation", "text": "7.1.3. Multi-output models", "words": [{"w": "7.1.3.", "b": [0.1294, 0.5304, 0.1862, 0.5502]}, {"w": "Multi-output", "b": [0.1925, 0.5304, 0.3326, 0.5502]}, {"w": "models", "b": [0.3389, 0.5304, 0.4146, 0.5502]}]}, {"id": "b_3", "type": "paragraph", "text": "In the same way, you can use the functional API to build models with multiple outputs (or multiple heads). A simple example is a network that attempts to simultaneously predict different properties of the data, such as a network that takes as input a series of social media posts from a single anonymous person and tries to predict attributes of that person, such as age, gender, and income level (see figure 7.7).", "words": [{"w": "In", "b": [0.1294, 0.5732, 0.1504, 0.593]}, {"w": "the", "b": [0.1567, 0.5732, 0.1876, 0.593]}, {"w": "same", "b": [0.1939, 0.5732, 0.2457, 0.593]}, {"w": "way,", "b": [0.252, 0.5732, 0.2987, 0.593]}, {"w": "you", "b": [0.305, 0.5732, 0.3428, 0.593]}, {"w": "can", "b": [0.3491, 0.5732, 0.3842, 0.593]}, {"w": "use", "b": [0.3905, 0.5732, 0.4241, 0.593]}, {"w": "the", "b": [0.4304, 0.5732, 0.4612, 0.593]}, {"w": "functional", "b": [0.4675, 0.5732, 0.5698, 0.593]}, {"w": "API", "b": [0.5761, 0.5732, 0.6168, 0.593]}, {"w": "to", "b": [0.6231, 0.5732, 0.6427, 0.593]}, {"w": "build", "b": [0.649, 0.5732, 0.7009, 0.593]}, {"w": "models", "b": [0.7072, 0.5732, 0.78, 0.593]}, {"w": "with", "b": [0.7864, 0.5732, 0.8312, 0.593]}, {"w": "multiple", "b": [0.1294, 0.5937, 0.2135, 0.6135]}, {"w": "outputs", "b": [0.2198, 0.5937, 0.2941, 0.6135]}, {"w": "(or", "b": [0.3004, 0.5937, 0.3298, 0.6135]}, {"w": "multiple", "b": [0.3361, 0.5937, 0.4202, 0.6135]}, {"w": "heads).", "b": [0.4265, 0.5937, 0.5, 0.6135]}, {"w": "A", "b": [0.5063, 0.5937, 0.5246, 0.6135]}, {"w": "simple", "b": [0.5309, 0.5937, 0.5981, 0.6135]}, {"w": "example", "b": [0.6044, 0.5937, 0.6899, 0.6135]}, {"w": "is", "b": [0.6962, 0.5937, 0.713, 0.6135]}, {"w": "a", "b": [0.7194, 0.5937, 0.7306, 0.6135]}, {"w": "network", "b": [0.7369, 0.5937, 0.8195, 0.6135]}, {"w": "that", "b": [0.8258, 0.5937, 0.8637, 0.6135]}, {"w": "attempts", "b": [0.1294, 0.6142, 0.2149, 0.634]}, {"w": "to", "b": [0.2212, 0.6142, 0.2408, 0.634]}, {"w": "simultaneously", "b": [0.2471, 0.6142, 0.3999, 0.634]}, {"w": "predict", "b": [0.4062, 0.6142, 0.4763, 0.634]}, {"w": "different", "b": [0.4826, 0.6142, 0.5689, 0.634]}, {"w": "properties", "b": [0.5752, 0.6142, 0.6761, 0.634]}, {"w": "of", "b": [0.6824, 0.6142, 0.7034, 0.634]}, {"w": "the", "b": [0.7097, 0.6142, 0.7405, 0.634]}, {"w": "data,", "b": [0.7468, 0.6142, 0.7952, 0.634]}, {"w": "such", "b": [0.8015, 0.6142, 0.8477, 0.634]}, {"w": "as", "b": [0.1294, 0.6347, 0.1504, 0.6545]}, {"w": "a", "b": [0.1567, 0.6347, 0.1679, 0.6545]}, {"w": "network", "b": [0.1742, 0.6347, 0.2569, 0.6545]}, {"w": "that", "b": [0.2632, 0.6347, 0.301, 0.6545]}, {"w": "takes", "b": [0.3073, 0.6347, 0.3592, 0.6545]}, {"w": "as", "b": [0.3655, 0.6347, 0.3865, 0.6545]}, {"w": "input", "b": [0.3928, 0.6347, 0.4447, 0.6545]}, {"w": "a", "b": [0.451, 0.6347, 0.4622, 0.6545]}, {"w": "series", "b": [0.4685, 0.6347, 0.5259, 0.6545]}, {"w": "of", "b": [0.5322, 0.6347, 0.5532, 0.6545]}, {"w": "social", "b": [0.5595, 0.6347, 0.6184, 0.6545]}, {"w": "media", "b": [0.6247, 0.6347, 0.6863, 0.6545]}, {"w": "posts", "b": [0.6927, 0.6347, 0.7445, 0.6545]}, {"w": "from", "b": [0.7508, 0.6347, 0.7999, 0.6545]}, {"w": "a", "b": [0.8062, 0.6347, 0.8174, 0.6545]}, {"w": "single", "b": [0.1294, 0.6552, 0.1897, 0.675]}, {"w": "anonymous", "b": [0.196, 0.6552, 0.3123, 0.675]}, {"w": "person", "b": [0.3186, 0.6552, 0.3859, 0.675]}, {"w": "and", "b": [0.3922, 0.6552, 0.4286, 0.675]}, {"w": "tries", "b": [0.4349, 0.6552, 0.4783, 0.675]}, {"w": "to", "b": [0.4846, 0.6552, 0.5043, 0.675]}, {"w": "predict", "b": [0.5106, 0.6552, 0.5806, 0.675]}, {"w": "attributes", "b": [0.5869, 0.6552, 0.6808, 0.675]}, {"w": "of", "b": [0.6871, 0.6552, 0.7081, 0.675]}, {"w": "that", "b": [0.7144, 0.6552, 0.7523, 0.675]}, {"w": "person,", "b": [0.7585, 0.6552, 0.8321, 0.675]}, {"w": "such", "b": [0.1294, 0.6757, 0.1757, 0.6955]}, {"w": "as", "b": [0.182, 0.6757, 0.203, 0.6955]}, {"w": "age,", "b": [0.2093, 0.6757, 0.2506, 0.6955]}, {"w": "gender,", "b": [0.2569, 0.6757, 0.3308, 0.6955]}, {"w": "and", "b": [0.3371, 0.6757, 0.3736, 0.6955]}, {"w": "income", "b": [0.3799, 0.6757, 0.4541, 0.6955]}, {"w": "level", "b": [0.4604, 0.6757, 0.5095, 0.6955]}, {"w": "(see", "b": [0.5158, 0.6757, 0.5564, 0.6955]}, {"w": "figure", "b": [0.5626, 0.6757, 0.6229, 0.6955]}, {"w": "7.7).", "b": [0.6292, 0.6757, 0.6754, 0.6955]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 7.7. A social media model with three heads", "words": [{"w": "Figure", "b": [0.1294, 0.7136, 0.1827, 0.7284]}, {"w": "7.7.", "b": [0.1874, 0.7136, 0.2158, 0.7284]}, {"w": "A", "b": [0.2205, 0.7136, 0.2341, 0.7284]}, {"w": "social", "b": [0.2389, 0.7136, 0.2841, 0.7284]}, {"w": "media", "b": [0.2888, 0.7136, 0.3382, 0.7284]}, {"w": "model", "b": [0.3429, 0.7136, 0.3923, 0.7284]}, {"w": "with", "b": [0.3971, 0.7136, 0.4328, 0.7284]}, {"w": "three", "b": [0.4375, 0.7136, 0.4792, 0.7284]}, {"w": "heads", "b": [0.4839, 0.7136, 0.5302, 0.7284]}]}]}, {"page": 315, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Listing 7.3. Functional API implementation of a three-output model", "words": [{"w": "Listing", "b": [0.1294, 0.0852, 0.1862, 0.1]}, {"w": "7.3.", "b": [0.1909, 0.0852, 0.2193, 0.1]}, {"w": "Functional", "b": [0.224, 0.0852, 0.3113, 0.1]}, {"w": "API", "b": [0.316, 0.0852, 0.3486, 0.1]}, {"w": "implementation", "b": [0.3533, 0.0852, 0.4805, 0.1]}, {"w": "of", "b": [0.4852, 0.0852, 0.501, 0.1]}, {"w": "a", "b": [0.5057, 0.0852, 0.5152, 0.1]}, {"w": "three-output", "b": [0.5199, 0.0852, 0.6215, 0.1]}, {"w": "model", "b": [0.6262, 0.0852, 0.6756, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras import layers from keras import Input from keras.models import Model vocabulary_size = 50000 num_income_groups = 10 posts_input = Input(shape=(None,), dtype='int32', name='posts') embedded_posts = layers.Embedding(256, vocabulary_size) (posts_input) x = layers.Conv1D(128, 5, activation='relu')(embedded_posts) x = layers.MaxPooling1D(5)(x) x = layers.Conv1D(256, 5, activation='relu')(x) x = layers.Conv1D(256, 5, activation='relu')(x) x = layers.MaxPooling1D(5)(x) x = layers.Conv1D(256, 5, activation='relu')(x) x = layers.Conv1D(256, 5, activation='relu')(x) x = layers.GlobalMaxPooling1D()(x) x = layers.Dense(128, activation='relu')(x) age_prediction = layers.Dense(1, name='age')(x) 1 income_prediction = layers.Dense(num_income_groups, activation='softmax', name='income')(x) gender_prediction = layers.Dense(1, activation='sigmoid', name='gender')(x) model = Model(posts_input, [age_prediction, income_prediction, gender_prediction])", "words": [{"w": "from", "b": [0.1357, 0.1136, 0.1811, 0.1288]}, {"w": "keras", "b": [0.1925, 0.1136, 0.2492, 0.1288]}, {"w": "import", "b": [0.2606, 0.1136, 0.3287, 0.1288]}, {"w": "layers", "b": [0.34, 0.1136, 0.4082, 0.1288]}, {"w": "from", "b": [0.1357, 0.1288, 0.1811, 0.1439]}, {"w": "keras", "b": [0.1925, 0.1288, 0.2492, 0.1439]}, {"w": "import", "b": [0.2606, 0.1288, 0.3287, 0.1439]}, {"w": "Input", "b": [0.34, 0.1288, 0.3968, 0.1439]}, {"w": "from", "b": [0.1357, 0.1439, 0.1811, 0.1591]}, {"w": "keras.models", "b": [0.1925, 0.1439, 0.3287, 0.1591]}, {"w": "import", "b": [0.34, 0.1439, 0.4082, 0.1591]}, {"w": "Model", "b": [0.4195, 0.1439, 0.4763, 0.1591]}, {"w": "vocabulary_size", "b": [0.1357, 0.1591, 0.306, 0.1742]}, {"w": "=", "b": [0.3173, 0.1591, 0.3287, 0.1742]}, {"w": "50000", "b": [0.34, 0.1591, 0.3968, 0.1742]}, {"w": "num_income_groups", "b": [0.1357, 0.1742, 0.3287, 0.1894]}, {"w": "=", "b": [0.34, 0.1742, 0.3514, 0.1894]}, {"w": "10", "b": [0.3628, 0.1742, 0.3855, 0.1894]}, {"w": "posts_input", "b": [0.1357, 0.2045, 0.2606, 0.2197]}, {"w": "=", "b": [0.2719, 0.2045, 0.2833, 0.2197]}, {"w": "Input(shape=(None,),", "b": [0.2946, 0.2045, 0.5217, 0.2197]}, {"w": "dtype='int32',", "b": [0.533, 0.2045, 0.6919, 0.2197]}, {"w": "name='posts')", "b": [0.7033, 0.2045, 0.8509, 0.2197]}, {"w": "embedded_posts", "b": [0.1357, 0.2197, 0.2946, 0.2348]}, {"w": "=", "b": [0.306, 0.2197, 0.3173, 0.2348]}, {"w": "layers.Embedding(256,", "b": [0.3287, 0.2197, 0.5671, 0.2348]}, {"w": "vocabulary_size)", "b": [0.5784, 0.2197, 0.7601, 0.2348]}, {"w": "(posts_input)", "b": [0.1357, 0.2348, 0.2833, 0.25]}, {"w": "x", "b": [0.1357, 0.25, 0.1471, 0.2651]}, {"w": "=", "b": [0.1584, 0.25, 0.1698, 0.2651]}, {"w": "layers.Conv1D(128,", "b": [0.1811, 0.25, 0.3855, 0.2651]}, {"w": "5,", "b": [0.3968, 0.25, 0.4195, 0.2651]}, {"w": "activation='relu')(embedded_posts)", "b": [0.4309, 0.25, 0.8168, 0.2651]}, {"w": "x", "b": [0.1357, 0.2651, 0.1471, 0.2803]}, {"w": "=", "b": [0.1584, 0.2651, 0.1698, 0.2803]}, {"w": "layers.MaxPooling1D(5)(x)", "b": [0.1811, 0.2651, 0.4649, 0.2803]}, {"w": "x", "b": [0.1357, 0.2803, 0.1471, 0.2954]}, {"w": "=", "b": [0.1584, 0.2803, 0.1698, 0.2954]}, {"w": "layers.Conv1D(256,", "b": [0.1811, 0.2803, 0.3855, 0.2954]}, {"w": "5,", "b": [0.3968, 0.2803, 0.4195, 0.2954]}, {"w": "activation='relu')(x)", "b": [0.4309, 0.2803, 0.6692, 0.2954]}, {"w": "x", "b": [0.1357, 0.2954, 0.1471, 0.3106]}, {"w": "=", "b": [0.1584, 0.2954, 0.1698, 0.3106]}, {"w": "layers.Conv1D(256,", "b": [0.1811, 0.2954, 0.3855, 0.3106]}, {"w": "5,", "b": [0.3968, 0.2954, 0.4195, 0.3106]}, {"w": "activation='relu')(x)", "b": [0.4309, 0.2954, 0.6692, 0.3106]}, {"w": "x", "b": [0.1357, 0.3106, 0.1471, 0.3257]}, {"w": "=", "b": [0.1584, 0.3106, 0.1698, 0.3257]}, {"w": "layers.MaxPooling1D(5)(x)", "b": [0.1811, 0.3106, 0.4649, 0.3257]}, {"w": "x", "b": [0.1357, 0.3257, 0.1471, 0.3409]}, {"w": "=", "b": [0.1584, 0.3257, 0.1698, 0.3409]}, {"w": "layers.Conv1D(256,", "b": [0.1811, 0.3257, 0.3855, 0.3409]}, {"w": "5,", "b": [0.3968, 0.3257, 0.4195, 0.3409]}, {"w": "activation='relu')(x)", "b": [0.4309, 0.3257, 0.6692, 0.3409]}, {"w": "x", "b": [0.1357, 0.3409, 0.1471, 0.356]}, {"w": "=", "b": [0.1584, 0.3409, 0.1698, 0.356]}, {"w": "layers.Conv1D(256,", "b": [0.1811, 0.3409, 0.3855, 0.356]}, {"w": "5,", "b": [0.3968, 0.3409, 0.4195, 0.356]}, {"w": "activation='relu')(x)", "b": [0.4309, 0.3409, 0.6692, 0.356]}, {"w": "x", "b": [0.1357, 0.356, 0.1471, 0.3712]}, {"w": "=", "b": [0.1584, 0.356, 0.1698, 0.3712]}, {"w": "layers.GlobalMaxPooling1D()(x)", "b": [0.1811, 0.356, 0.5217, 0.3712]}, {"w": "x", "b": [0.1357, 0.3712, 0.1471, 0.3863]}, {"w": "=", "b": [0.1584, 0.3712, 0.1698, 0.3863]}, {"w": "layers.Dense(128,", "b": [0.1811, 0.3712, 0.3741, 0.3863]}, {"w": "activation='relu')(x)", "b": [0.3855, 0.3712, 0.6238, 0.3863]}, {"w": "age_prediction", "b": [0.1357, 0.4015, 0.2946, 0.4166]}, {"w": "=", "b": [0.306, 0.4015, 0.3173, 0.4166]}, {"w": "layers.Dense(1,", "b": [0.3287, 0.4015, 0.499, 0.4166]}, {"w": "name='age')(x)", "b": [0.5103, 0.4015, 0.6692, 0.4166]}, {"w": "1", "b": [0.8396, 0.4015, 0.851, 0.4166]}, {"w": "income_prediction", "b": [0.1357, 0.4167, 0.3287, 0.4318]}, {"w": "=", "b": [0.34, 0.4167, 0.3514, 0.4318]}, {"w": "layers.Dense(num_income_groups,", "b": [0.3628, 0.4167, 0.7146, 0.4318]}, {"w": "activation='softmax',", "b": [0.5103, 0.4318, 0.7487, 0.447]}, {"w": "name='income')(x)", "b": [0.5103, 0.447, 0.7033, 0.4621]}, {"w": "gender_prediction", "b": [0.1357, 0.4621, 0.3287, 0.4773]}, {"w": "=", "b": [0.34, 0.4621, 0.3514, 0.4773]}, {"w": "layers.Dense(1,", "b": [0.3628, 0.4621, 0.533, 0.4773]}, {"w": "activation='sigmoid',", "b": [0.5444, 0.4621, 0.7828, 0.4773]}, {"w": "name='gender')(x)", "b": [0.1357, 0.4773, 0.3287, 0.4924]}, {"w": "model", "b": [0.1357, 0.5076, 0.1925, 0.5227]}, {"w": "=", "b": [0.2038, 0.5076, 0.2152, 0.5227]}, {"w": "Model(posts_input,", "b": [0.2265, 0.5076, 0.4309, 0.5227]}, {"w": "[age_prediction,", "b": [0.2946, 0.5227, 0.4763, 0.5379]}, {"w": "income_prediction,", "b": [0.4876, 0.5227, 0.6919, 0.5379]}, {"w": "gender_prediction])", "b": [0.1357, 0.5379, 0.3514, 0.553]}]}, {"id": "b_2", "type": "paragraph", "text": "1 Note that the output layers are given names.", "words": [{"w": "1", "b": [0.1799, 0.5714, 0.1925, 0.5912]}, {"w": "Note", "b": [0.1988, 0.5714, 0.2492, 0.5912]}, {"w": "that", "b": [0.2555, 0.5714, 0.299, 0.5912]}, {"w": "the", "b": [0.3053, 0.5714, 0.3389, 0.5912]}, {"w": "output", "b": [0.3452, 0.5714, 0.4167, 0.5912]}, {"w": "layers", "b": [0.423, 0.5714, 0.4874, 0.5912]}, {"w": "are", "b": [0.4937, 0.5714, 0.5283, 0.5912]}, {"w": "given", "b": [0.5346, 0.5714, 0.5921, 0.5912]}, {"w": "names.", "b": [0.5984, 0.5714, 0.6734, 0.5912]}]}, {"id": "b_3", "type": "paragraph", "text": "Importantly, training such a model requires the ability to specify different loss functions for different heads of the network: for instance, age prediction is a scalar regression task, but gender prediction is a binary classification task, requiring a different training procedure. But because gradient descent requires you to minimize a scalar, you must combine these losses into a single value in order to train the model. The simplest way to combine different losses is to sum them all. In Keras, you can use either a list or a dictionary of losses in compile to specify different objects for different outputs; the resulting loss values are summed into a global loss, which is minimized during training.", "words": [{"w": "Importantly,", "b": [0.1294, 0.6142, 0.2532, 0.634]}, {"w": "training", "b": [0.2595, 0.6142, 0.338, 0.634]}, {"w": "such", "b": [0.3443, 0.6142, 0.3905, 0.634]}, {"w": "a", "b": [0.3968, 0.6142, 0.408, 0.634]}, {"w": "model", "b": [0.4143, 0.6142, 0.4774, 0.634]}, {"w": "requires", "b": [0.4837, 0.6142, 0.5649, 0.634]}, {"w": "the", "b": [0.5712, 0.6142, 0.6021, 0.634]}, {"w": "ability", "b": [0.6084, 0.6142, 0.6729, 0.634]}, {"w": "to", "b": [0.6792, 0.6142, 0.6988, 0.634]}, {"w": "specify", "b": [0.7051, 0.6142, 0.7779, 0.634]}, {"w": "different", "b": [0.7843, 0.6142, 0.8706, 0.634]}, {"w": "loss", "b": [0.1294, 0.6347, 0.1687, 0.6545]}, {"w": "functions", "b": [0.175, 0.6347, 0.2689, 0.6545]}, {"w": "for", "b": [0.2752, 0.6347, 0.3046, 0.6545]}, {"w": "different", "b": [0.3109, 0.6347, 0.3973, 0.6545]}, {"w": "heads", "b": [0.4036, 0.6347, 0.461, 0.6545]}, {"w": "of", "b": [0.4673, 0.6347, 0.4883, 0.6545]}, {"w": "the", "b": [0.4946, 0.6347, 0.5255, 0.6545]}, {"w": "network:", "b": [0.5318, 0.6347, 0.6215, 0.6545]}, {"w": "for", "b": [0.6277, 0.6347, 0.6571, 0.6545]}, {"w": "instance,", "b": [0.6634, 0.6347, 0.7524, 0.6545]}, {"w": "age", "b": [0.7587, 0.6347, 0.7937, 0.6545]}, {"w": "prediction", "b": [0.1294, 0.6552, 0.2317, 0.675]}, {"w": "is", "b": [0.238, 0.6552, 0.2548, 0.675]}, {"w": "a", "b": [0.2611, 0.6552, 0.2723, 0.675]}, {"w": "scalar", "b": [0.2786, 0.6552, 0.3375, 0.675]}, {"w": "regression", "b": [0.3438, 0.6552, 0.4475, 0.675]}, {"w": "task,", "b": [0.4538, 0.6552, 0.5007, 0.675]}, {"w": "but", "b": [0.507, 0.6552, 0.5393, 0.675]}, {"w": "gender", "b": [0.5456, 0.6552, 0.6142, 0.675]}, {"w": "prediction", "b": [0.6205, 0.6552, 0.7228, 0.675]}, {"w": "is", "b": [0.7291, 0.6552, 0.7459, 0.675]}, {"w": "a", "b": [0.7522, 0.6552, 0.7634, 0.675]}, {"w": "binary", "b": [0.7697, 0.6552, 0.8342, 0.675]}, {"w": "classification", "b": [0.1294, 0.6757, 0.2625, 0.6955]}, {"w": "task,", "b": [0.2688, 0.6757, 0.3158, 0.6955]}, {"w": "requiring", "b": [0.3221, 0.6757, 0.4146, 0.6955]}, {"w": "a", "b": [0.4208, 0.6757, 0.432, 0.6955]}, {"w": "different", "b": [0.4383, 0.6757, 0.5247, 0.6955]}, {"w": "training", "b": [0.531, 0.6757, 0.6095, 0.6955]}, {"w": "procedure.", "b": [0.6158, 0.6757, 0.723, 0.6955]}, {"w": "But", "b": [0.7293, 0.6757, 0.7657, 0.6955]}, {"w": "because", "b": [0.772, 0.6757, 0.8519, 0.6955]}, {"w": "gradient", "b": [0.1294, 0.6962, 0.2121, 0.716]}, {"w": "descent", "b": [0.2184, 0.6962, 0.294, 0.716]}, {"w": "requires", "b": [0.3003, 0.6962, 0.3816, 0.716]}, {"w": "you", "b": [0.3879, 0.6962, 0.4257, 0.716]}, {"w": "to", "b": [0.432, 0.6962, 0.4517, 0.716]}, {"w": "minimize", "b": [0.458, 0.6962, 0.5533, 0.716]}, {"w": "a", "b": [0.5596, 0.6962, 0.5708, 0.716]}, {"w": "scalar,", "b": [0.577, 0.6962, 0.6464, 0.716]}, {"w": "you", "b": [0.6527, 0.6962, 0.6905, 0.716]}, {"w": "must", "b": [0.6968, 0.6962, 0.7459, 0.716]}, {"w": "combine", "b": [0.7522, 0.6962, 0.8391, 0.716]}, {"w": "these", "b": [0.1294, 0.7167, 0.1813, 0.7365]}, {"w": "losses", "b": [0.1876, 0.7167, 0.2478, 0.7365]}, {"w": "into", "b": [0.2541, 0.7167, 0.2934, 0.7365]}, {"w": "a", "b": [0.2997, 0.7167, 0.3109, 0.7365]}, {"w": "single", "b": [0.3172, 0.7167, 0.3775, 0.7365]}, {"w": "value", "b": [0.3838, 0.7167, 0.4384, 0.7365]}, {"w": "in", "b": [0.4447, 0.7167, 0.4643, 0.7365]}, {"w": "order", "b": [0.4706, 0.7167, 0.5239, 0.7365]}, {"w": "to", "b": [0.5302, 0.7167, 0.5498, 0.7365]}, {"w": "train", "b": [0.5561, 0.7167, 0.6023, 0.7365]}, {"w": "the", "b": [0.6087, 0.7167, 0.6395, 0.7365]}, {"w": "model.", "b": [0.6458, 0.7167, 0.7152, 0.7365]}, {"w": "The", "b": [0.7215, 0.7167, 0.7607, 0.7365]}, {"w": "simplest", "b": [0.767, 0.7167, 0.8511, 0.7365]}, {"w": "way", "b": [0.1294, 0.7372, 0.1714, 0.757]}, {"w": "to", "b": [0.1777, 0.7372, 0.1974, 0.757]}, {"w": "combine", "b": [0.2037, 0.7372, 0.2906, 0.757]}, {"w": "different", "b": [0.2969, 0.7372, 0.3832, 0.757]}, {"w": "losses", "b": [0.3895, 0.7372, 0.4498, 0.757]}, {"w": "is", "b": [0.4561, 0.7372, 0.4729, 0.757]}, {"w": "to", "b": [0.4792, 0.7372, 0.4988, 0.757]}, {"w": "sum", "b": [0.5051, 0.7372, 0.5472, 0.757]}, {"w": "them", "b": [0.5535, 0.7372, 0.604, 0.757]}, {"w": "all.", "b": [0.6103, 0.7372, 0.6418, 0.757]}, {"w": "In", "b": [0.6481, 0.7372, 0.6691, 0.757]}, {"w": "Keras,", "b": [0.6754, 0.7372, 0.7406, 0.757]}, {"w": "you", "b": [0.7469, 0.7372, 0.7847, 0.757]}, {"w": "can", "b": [0.791, 0.7372, 0.826, 0.757]}, {"w": "use", "b": [0.8323, 0.7372, 0.866, 0.757]}, {"w": "either", "b": [0.1294, 0.7577, 0.1869, 0.7775]}, {"w": "a", "b": [0.1932, 0.7577, 0.2044, 0.7775]}, {"w": "list", "b": [0.2107, 0.7577, 0.2415, 0.7775]}, {"w": "or", "b": [0.2478, 0.7577, 0.2688, 0.7775]}, {"w": "a", "b": [0.2751, 0.7577, 0.2863, 0.7775]}, {"w": "dictionary", "b": [0.2926, 0.7577, 0.3949, 0.7775]}, {"w": "of", "b": [0.4012, 0.7577, 0.4223, 0.7775]}, {"w": "losses", "b": [0.4286, 0.7577, 0.4888, 0.7775]}, {"w": "in", "b": [0.4951, 0.7577, 0.5148, 0.7775]}, {"w": "compile", "b": [0.521, 0.7588, 0.627, 0.779]}, {"w": "to", "b": [0.6333, 0.7577, 0.6529, 0.7775]}, {"w": "specify", "b": [0.6592, 0.7577, 0.732, 0.7775]}, {"w": "different", "b": [0.7383, 0.7577, 0.8247, 0.7775]}, {"w": "objects", "b": [0.1294, 0.7791, 0.2009, 0.7989]}, {"w": "for", "b": [0.2072, 0.7791, 0.2366, 0.7989]}, {"w": "different", "b": [0.2429, 0.7791, 0.3293, 0.7989]}, {"w": "outputs;", "b": [0.3356, 0.7791, 0.4169, 0.7989]}, {"w": "the", "b": [0.4232, 0.7791, 0.454, 0.7989]}, {"w": "resulting", "b": [0.4603, 0.7791, 0.5486, 0.7989]}, {"w": "loss", "b": [0.5549, 0.7791, 0.5942, 0.7989]}, {"w": "values", "b": [0.6005, 0.7791, 0.6649, 0.7989]}, {"w": "are", "b": [0.6712, 0.7791, 0.702, 0.7989]}, {"w": "summed", "b": [0.7084, 0.7791, 0.7938, 0.7989]}, {"w": "into", "b": [0.8001, 0.7791, 0.8394, 0.7989]}, {"w": "a", "b": [0.8457, 0.7791, 0.8569, 0.7989]}, {"w": "global", "b": [0.1294, 0.7996, 0.1925, 0.8194]}, {"w": "loss,", "b": [0.1988, 0.7996, 0.2443, 0.8194]}, {"w": "which", "b": [0.2506, 0.7996, 0.3123, 0.8194]}, {"w": "is", "b": [0.3186, 0.7996, 0.3354, 0.8194]}, {"w": "minimized", "b": [0.3417, 0.7996, 0.4497, 0.8194]}, {"w": "during", "b": [0.4559, 0.7996, 0.5218, 0.8194]}, {"w": "training.", "b": [0.5281, 0.7996, 0.6129, 0.8194]}]}, {"id": "b_4", "type": "equation", "text": "Listing 7.4. Compilation options of a multi-output model: multiple losses", "words": [{"w": "Listing", "b": [0.1294, 0.8419, 0.1862, 0.8567]}, {"w": "7.4.", "b": [0.1909, 0.8419, 0.2193, 0.8567]}, {"w": "Compilation", "b": [0.224, 0.8419, 0.3249, 0.8567]}, {"w": "options", "b": [0.3297, 0.8419, 0.3885, 0.8567]}, {"w": "of", "b": [0.3933, 0.8419, 0.409, 0.8567]}, {"w": "a", "b": [0.4138, 0.8419, 0.4232, 0.8567]}, {"w": "multi-output", "b": [0.4279, 0.8419, 0.531, 0.8567]}, {"w": "model:", "b": [0.5357, 0.8419, 0.5914, 0.8567]}, {"w": "multiple", "b": [0.5961, 0.8419, 0.6634, 0.8567]}, {"w": "losses", "b": [0.6681, 0.8419, 0.7133, 0.8567]}]}, {"id": "b_5", "type": "equation", "text": "model.compile(optimizer='rmsprop', loss=['mse', 'categorical_crossentropy',", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.8703, 0.5217, 0.8855]}, {"w": "loss=['mse',", "b": [0.2946, 0.8855, 0.4309, 0.9006]}, {"w": "'categorical_crossentropy',", "b": [0.4422, 0.8855, 0.7487, 0.9006]}]}]}, {"page": 316, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "'binary_crossentropy']) model.compile(optimizer='rmsprop', 1 loss={'age': 'mse', 1 'income': 'categorical_crossentropy', 1 'gender': 'binary_crossentropy'}) 1", "words": [{"w": "'binary_crossentropy'])", "b": [0.1357, 0.0851, 0.3968, 0.1002]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.1154, 0.5217, 0.1305]}, {"w": "1", "b": [0.851, 0.1154, 0.8623, 0.1305]}, {"w": "loss={'age':", "b": [0.2946, 0.1305, 0.4309, 0.1457]}, {"w": "'mse',", "b": [0.4422, 0.1305, 0.5103, 0.1457]}, {"w": "1", "b": [0.851, 0.1305, 0.8623, 0.1457]}, {"w": "'income':", "b": [0.3628, 0.1457, 0.4649, 0.1608]}, {"w": "'categorical_crossentropy',", "b": [0.4763, 0.1457, 0.7828, 0.1608]}, {"w": "1", "b": [0.851, 0.1457, 0.8623, 0.1608]}, {"w": "'gender':", "b": [0.3628, 0.1608, 0.4649, 0.176]}, {"w": "'binary_crossentropy'})", "b": [0.4763, 0.1608, 0.7374, 0.176]}, {"w": "1", "b": [0.851, 0.1608, 0.8623, 0.176]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Equivalent (possible only if you give names to the output layers)", "words": [{"w": "1", "b": [0.1799, 0.1944, 0.1925, 0.2142]}, {"w": "Equivalent", "b": [0.1988, 0.1944, 0.3165, 0.2142]}, {"w": "(possible", "b": [0.3228, 0.1944, 0.4168, 0.2142]}, {"w": "only", "b": [0.4231, 0.1944, 0.4693, 0.2142]}, {"w": "if", "b": [0.4756, 0.1944, 0.491, 0.2142]}, {"w": "you", "b": [0.4974, 0.1944, 0.5366, 0.2142]}, {"w": "give", "b": [0.5429, 0.1944, 0.5864, 0.2142]}, {"w": "names", "b": [0.5927, 0.1944, 0.6613, 0.2142]}, {"w": "to", "b": [0.6676, 0.1944, 0.6886, 0.2142]}, {"w": "the", "b": [0.6949, 0.1944, 0.7286, 0.2142]}, {"w": "output", "b": [0.7349, 0.1944, 0.8064, 0.2142]}, {"w": "layers)", "b": [0.1799, 0.2149, 0.2527, 0.2347]}]}, {"id": "b_2", "type": "paragraph", "text": "Note that very imbalanced loss contributions will cause the model representations to be optimized preferentially for the task with the largest individual loss, at the expense of the other tasks. To remedy this, you can assign different levels of importance to the loss values in their contribution to the final loss. This is useful in particular if the losses’ values use different scales. For instance, the mean squared error (MSE) loss used for the age-regression task typically takes a value around 3–5, whereas the cross-entropy loss used for the gender-classification task can be as low as 0.1. In such a situation, to balance the contribution of the different losses, you can assign a weight of 10 to the crossentropy loss and a weight of 0.25 to the MSE loss.", "words": [{"w": "Note", "b": [0.1294, 0.2577, 0.1785, 0.2774]}, {"w": "that", "b": [0.1848, 0.2577, 0.2226, 0.2774]}, {"w": "very", "b": [0.2289, 0.2577, 0.2737, 0.2774]}, {"w": "imbalanced", "b": [0.28, 0.2577, 0.3963, 0.2774]}, {"w": "loss", "b": [0.4026, 0.2577, 0.4419, 0.2774]}, {"w": "contributions", "b": [0.4482, 0.2577, 0.5813, 0.2774]}, {"w": "will", "b": [0.5876, 0.2577, 0.6269, 0.2774]}, {"w": "cause", "b": [0.6332, 0.2577, 0.6892, 0.2774]}, {"w": "the", "b": [0.6955, 0.2577, 0.7264, 0.2774]}, {"w": "model", "b": [0.7327, 0.2577, 0.7957, 0.2774]}, {"w": "representations", "b": [0.1294, 0.2782, 0.2821, 0.2979]}, {"w": "to", "b": [0.2884, 0.2782, 0.3081, 0.2979]}, {"w": "be", "b": [0.3144, 0.2782, 0.3382, 0.2979]}, {"w": "optimized", "b": [0.3445, 0.2782, 0.4454, 0.2979]}, {"w": "preferentially", "b": [0.4517, 0.2782, 0.5876, 0.2979]}, {"w": "for", "b": [0.5939, 0.2782, 0.6233, 0.2979]}, {"w": "the", "b": [0.6296, 0.2782, 0.6604, 0.2979]}, {"w": "task", "b": [0.6667, 0.2782, 0.7074, 0.2979]}, {"w": "with", "b": [0.7136, 0.2782, 0.7584, 0.2979]}, {"w": "the", "b": [0.7647, 0.2782, 0.7956, 0.2979]}, {"w": "largest", "b": [0.8019, 0.2782, 0.8687, 0.2979]}, {"w": "individual", "b": [0.1294, 0.2987, 0.2317, 0.3184]}, {"w": "loss,", "b": [0.238, 0.2987, 0.2836, 0.3184]}, {"w": "at", "b": [0.2899, 0.2987, 0.3081, 0.3184]}, {"w": "the", "b": [0.3144, 0.2987, 0.3452, 0.3184]}, {"w": "expense", "b": [0.3516, 0.2987, 0.4328, 0.3184]}, {"w": "of", "b": [0.4391, 0.2987, 0.4601, 0.3184]}, {"w": "the", "b": [0.4664, 0.2987, 0.4973, 0.3184]}, {"w": "other", "b": [0.5036, 0.2987, 0.5554, 0.3184]}, {"w": "tasks.", "b": [0.5617, 0.2987, 0.6185, 0.3184]}, {"w": "To", "b": [0.6248, 0.2987, 0.651, 0.3184]}, {"w": "remedy", "b": [0.6573, 0.2987, 0.7329, 0.3184]}, {"w": "this,", "b": [0.7392, 0.2987, 0.782, 0.3184]}, {"w": "you", "b": [0.7883, 0.2987, 0.8261, 0.3184]}, {"w": "can", "b": [0.8324, 0.2987, 0.8675, 0.3184]}, {"w": "assign", "b": [0.1294, 0.3192, 0.1925, 0.3389]}, {"w": "different", "b": [0.1988, 0.3192, 0.2852, 0.3389]}, {"w": "levels", "b": [0.2915, 0.3192, 0.3503, 0.3389]}, {"w": "of", "b": [0.3566, 0.3192, 0.3777, 0.3389]}, {"w": "importance", "b": [0.384, 0.3192, 0.4975, 0.3389]}, {"w": "to", "b": [0.5037, 0.3192, 0.5233, 0.3389]}, {"w": "the", "b": [0.5296, 0.3192, 0.5605, 0.3389]}, {"w": "loss", "b": [0.5668, 0.3192, 0.606, 0.3389]}, {"w": "values", "b": [0.6123, 0.3192, 0.6768, 0.3389]}, {"w": "in", "b": [0.6831, 0.3192, 0.7027, 0.3389]}, {"w": "their", "b": [0.709, 0.3192, 0.7553, 0.3389]}, {"w": "contribution", "b": [0.1294, 0.3397, 0.2527, 0.3594]}, {"w": "to", "b": [0.259, 0.3397, 0.2787, 0.3594]}, {"w": "the", "b": [0.285, 0.3397, 0.3158, 0.3594]}, {"w": "final", "b": [0.3221, 0.3397, 0.3684, 0.3594]}, {"w": "loss.", "b": [0.3747, 0.3397, 0.4202, 0.3594]}, {"w": "This", "b": [0.4265, 0.3397, 0.4714, 0.3594]}, {"w": "is", "b": [0.4777, 0.3397, 0.4945, 0.3594]}, {"w": "useful", "b": [0.5008, 0.3397, 0.5625, 0.3594]}, {"w": "in", "b": [0.5688, 0.3397, 0.5884, 0.3594]}, {"w": "particular", "b": [0.5947, 0.3397, 0.6914, 0.3594]}, {"w": "if", "b": [0.6977, 0.3397, 0.7131, 0.3594]}, {"w": "the", "b": [0.7194, 0.3397, 0.7502, 0.3594]}, {"w": "losses’", "b": [0.7565, 0.3397, 0.8252, 0.3594]}, {"w": "values", "b": [0.1294, 0.3602, 0.1939, 0.3799]}, {"w": "use", "b": [0.2002, 0.3602, 0.2338, 0.3799]}, {"w": "different", "b": [0.2401, 0.3602, 0.3265, 0.3799]}, {"w": "scales.", "b": [0.3328, 0.3602, 0.3993, 0.3799]}, {"w": "For", "b": [0.4056, 0.3602, 0.4407, 0.3799]}, {"w": "instance,", "b": [0.447, 0.3602, 0.5359, 0.3799]}, {"w": "the", "b": [0.5422, 0.3602, 0.5731, 0.3799]}, {"w": "mean", "b": [0.5794, 0.3602, 0.634, 0.3799]}, {"w": "squared", "b": [0.6403, 0.3602, 0.7188, 0.3799]}, {"w": "error", "b": [0.7251, 0.3602, 0.7741, 0.3799]}, {"w": "(MSE)", "b": [0.7804, 0.3602, 0.8491, 0.3799]}, {"w": "loss", "b": [0.1294, 0.3807, 0.1687, 0.4004]}, {"w": "used", "b": [0.175, 0.3807, 0.2212, 0.4004]}, {"w": "for", "b": [0.2275, 0.3807, 0.2569, 0.4004]}, {"w": "the", "b": [0.2632, 0.3807, 0.2941, 0.4004]}, {"w": "age-regression", "b": [0.3004, 0.3807, 0.4475, 0.4004]}, {"w": "task", "b": [0.4538, 0.3807, 0.4944, 0.4004]}, {"w": "typically", "b": [0.5007, 0.3807, 0.589, 0.4004]}, {"w": "takes", "b": [0.5953, 0.3807, 0.6471, 0.4004]}, {"w": "a", "b": [0.6535, 0.3807, 0.6647, 0.4004]}, {"w": "value", "b": [0.671, 0.3807, 0.7256, 0.4004]}, {"w": "around", "b": [0.7319, 0.3807, 0.802, 0.4004]}, {"w": "3–5,", "b": [0.8083, 0.3807, 0.8524, 0.4004]}, {"w": "whereas", "b": [0.1294, 0.4012, 0.2121, 0.4209]}, {"w": "the", "b": [0.2184, 0.4012, 0.2492, 0.4209]}, {"w": "cross-entropy", "b": [0.2555, 0.4012, 0.3928, 0.4209]}, {"w": "loss", "b": [0.3991, 0.4012, 0.4384, 0.4209]}, {"w": "used", "b": [0.4447, 0.4012, 0.4909, 0.4209]}, {"w": "for", "b": [0.4972, 0.4012, 0.5266, 0.4209]}, {"w": "the", "b": [0.5329, 0.4012, 0.5637, 0.4209]}, {"w": "gender-classification", "b": [0.5701, 0.4012, 0.7797, 0.4209]}, {"w": "task", "b": [0.786, 0.4012, 0.8266, 0.4209]}, {"w": "can", "b": [0.8329, 0.4012, 0.8679, 0.4209]}, {"w": "be", "b": [0.1294, 0.4217, 0.1532, 0.4414]}, {"w": "as", "b": [0.1595, 0.4217, 0.1805, 0.4414]}, {"w": "low", "b": [0.1869, 0.4217, 0.2247, 0.4414]}, {"w": "as", "b": [0.231, 0.4217, 0.252, 0.4414]}, {"w": "0.1.", "b": [0.2583, 0.4217, 0.2962, 0.4414]}, {"w": "In", "b": [0.3025, 0.4217, 0.3235, 0.4414]}, {"w": "such", "b": [0.3298, 0.4217, 0.376, 0.4414]}, {"w": "a", "b": [0.3823, 0.4217, 0.3935, 0.4414]}, {"w": "situation,", "b": [0.3998, 0.4217, 0.493, 0.4414]}, {"w": "to", "b": [0.4993, 0.4217, 0.519, 0.4414]}, {"w": "balance", "b": [0.5253, 0.4217, 0.6023, 0.4414]}, {"w": "the", "b": [0.6086, 0.4217, 0.6394, 0.4414]}, {"w": "contribution", "b": [0.6457, 0.4217, 0.769, 0.4414]}, {"w": "of", "b": [0.7753, 0.4217, 0.7963, 0.4414]}, {"w": "the", "b": [0.8027, 0.4217, 0.8335, 0.4414]}, {"w": "different", "b": [0.1294, 0.4422, 0.2158, 0.4619]}, {"w": "losses,", "b": [0.2221, 0.4422, 0.2887, 0.4619]}, {"w": "you", "b": [0.295, 0.4422, 0.3328, 0.4619]}, {"w": "can", "b": [0.3391, 0.4422, 0.3741, 0.4619]}, {"w": "assign", "b": [0.3805, 0.4422, 0.4435, 0.4619]}, {"w": "a", "b": [0.4498, 0.4422, 0.461, 0.4619]}, {"w": "weight", "b": [0.4673, 0.4422, 0.536, 0.4619]}, {"w": "of", "b": [0.5423, 0.4422, 0.5633, 0.4619]}, {"w": "10", "b": [0.5696, 0.4422, 0.5948, 0.4619]}, {"w": "to", "b": [0.6012, 0.4422, 0.6208, 0.4619]}, {"w": "the", "b": [0.6271, 0.4422, 0.6579, 0.4619]}, {"w": "crossentropy", "b": [0.6642, 0.4422, 0.7931, 0.4619]}, {"w": "loss", "b": [0.7994, 0.4422, 0.8387, 0.4619]}, {"w": "and", "b": [0.1294, 0.4627, 0.1658, 0.4824]}, {"w": "a", "b": [0.1721, 0.4627, 0.1833, 0.4824]}, {"w": "weight", "b": [0.1897, 0.4627, 0.2583, 0.4824]}, {"w": "of", "b": [0.2646, 0.4627, 0.2856, 0.4824]}, {"w": "0.25", "b": [0.2919, 0.4627, 0.3361, 0.4824]}, {"w": "to", "b": [0.3424, 0.4627, 0.362, 0.4824]}, {"w": "the", "b": [0.3683, 0.4627, 0.3992, 0.4824]}, {"w": "MSE", "b": [0.4054, 0.4627, 0.4573, 0.4824]}, {"w": "loss.", "b": [0.4636, 0.4627, 0.5091, 0.4824]}]}, {"id": "b_3", "type": "equation", "text": "Listing 7.5. Compilation options of a multi-output model: loss weighting", "words": [{"w": "Listing", "b": [0.1294, 0.5005, 0.1862, 0.5154]}, {"w": "7.5.", "b": [0.1909, 0.5005, 0.2193, 0.5154]}, {"w": "Compilation", "b": [0.224, 0.5005, 0.3249, 0.5154]}, {"w": "options", "b": [0.3297, 0.5005, 0.3885, 0.5154]}, {"w": "of", "b": [0.3933, 0.5005, 0.409, 0.5154]}, {"w": "a", "b": [0.4138, 0.5005, 0.4232, 0.5154]}, {"w": "multi-output", "b": [0.4279, 0.5005, 0.531, 0.5154]}, {"w": "model:", "b": [0.5357, 0.5005, 0.5914, 0.5154]}, {"w": "loss", "b": [0.5961, 0.5005, 0.6256, 0.5154]}, {"w": "weighting", "b": [0.6303, 0.5005, 0.7091, 0.5154]}]}, {"id": "b_4", "type": "paragraph", "text": "model.compile(optimizer='rmsprop', loss=['mse', 'categorical_crossentropy', 'binary_crossentropy'], loss_weights=[0.25, 1., 10.]) model.compile(optimizer='rmsprop', 1 loss={'age': 'mse', 1 'income': 'categorical_crossentropy', 1 'gender': 'binary_crossentropy'}, 1 loss_weights={'age': 0.25, 1 'income': 1., 1 'gender': 10.}) 1", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.529, 0.5217, 0.5441]}, {"w": "loss=['mse',", "b": [0.2946, 0.5441, 0.4309, 0.5593]}, {"w": "'categorical_crossentropy',", "b": [0.4422, 0.5441, 0.7487, 0.5593]}, {"w": "'binary_crossentropy'],", "b": [0.1357, 0.5593, 0.3968, 0.5744]}, {"w": "loss_weights=[0.25,", "b": [0.2946, 0.5744, 0.5103, 0.5896]}, {"w": "1.,", "b": [0.5217, 0.5744, 0.5557, 0.5896]}, {"w": "10.])", "b": [0.5671, 0.5744, 0.6238, 0.5896]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.6047, 0.5217, 0.6199]}, {"w": "1", "b": [0.8396, 0.6047, 0.851, 0.6199]}, {"w": "loss={'age':", "b": [0.2946, 0.6199, 0.4309, 0.635]}, {"w": "'mse',", "b": [0.4422, 0.6199, 0.5103, 0.635]}, {"w": "1", "b": [0.8396, 0.6199, 0.851, 0.635]}, {"w": "'income':", "b": [0.3628, 0.635, 0.4649, 0.6502]}, {"w": "'categorical_crossentropy',", "b": [0.4763, 0.635, 0.7828, 0.6502]}, {"w": "1", "b": [0.8396, 0.635, 0.851, 0.6502]}, {"w": "'gender':", "b": [0.3628, 0.6502, 0.4649, 0.6653]}, {"w": "'binary_crossentropy'},", "b": [0.4763, 0.6502, 0.7374, 0.6653]}, {"w": "1", "b": [0.8396, 0.6502, 0.851, 0.6653]}, {"w": "loss_weights={'age':", "b": [0.2946, 0.6653, 0.5217, 0.6805]}, {"w": "0.25,", "b": [0.533, 0.6653, 0.5898, 0.6805]}, {"w": "1", "b": [0.8396, 0.6653, 0.851, 0.6805]}, {"w": "'income':", "b": [0.4536, 0.6805, 0.5557, 0.6956]}, {"w": "1.,", "b": [0.5671, 0.6805, 0.6011, 0.6956]}, {"w": "1", "b": [0.8396, 0.6805, 0.851, 0.6956]}, {"w": "'gender':", "b": [0.4536, 0.6956, 0.5557, 0.7108]}, {"w": "10.})", "b": [0.5671, 0.6956, 0.6238, 0.7108]}, {"w": "1", "b": [0.8396, 0.6956, 0.851, 0.7108]}]}, {"id": "b_5", "type": "paragraph", "text": "1 Equivalent (possible only if you give names to the output layers)", "words": [{"w": "1", "b": [0.1799, 0.7292, 0.1925, 0.7489]}, {"w": "Equivalent", "b": [0.1988, 0.7292, 0.3165, 0.7489]}, {"w": "(possible", "b": [0.3228, 0.7292, 0.4168, 0.7489]}, {"w": "only", "b": [0.4231, 0.7292, 0.4693, 0.7489]}, {"w": "if", "b": [0.4756, 0.7292, 0.491, 0.7489]}, {"w": "you", "b": [0.4974, 0.7292, 0.5366, 0.7489]}, {"w": "give", "b": [0.5429, 0.7292, 0.5864, 0.7489]}, {"w": "names", "b": [0.5927, 0.7292, 0.6613, 0.7489]}, {"w": "to", "b": [0.6676, 0.7292, 0.6886, 0.7489]}, {"w": "the", "b": [0.6949, 0.7292, 0.7286, 0.7489]}, {"w": "output", "b": [0.7349, 0.7292, 0.8064, 0.7489]}, {"w": "layers)", "b": [0.1799, 0.7497, 0.2527, 0.7694]}]}, {"id": "b_6", "type": "paragraph", "text": "Much as in the case of multi-input models, you can pass Numpy data to the model for training either via a list of arrays or via a dictionary of arrays.", "words": [{"w": "Much", "b": [0.1294, 0.7925, 0.1883, 0.8122]}, {"w": "as", "b": [0.1946, 0.7925, 0.2156, 0.8122]}, {"w": "in", "b": [0.2219, 0.7925, 0.2415, 0.8122]}, {"w": "the", "b": [0.2478, 0.7925, 0.2786, 0.8122]}, {"w": "case", "b": [0.285, 0.7925, 0.3284, 0.8122]}, {"w": "of", "b": [0.3347, 0.7925, 0.3557, 0.8122]}, {"w": "multi-input", "b": [0.362, 0.7925, 0.4755, 0.8122]}, {"w": "models,", "b": [0.4818, 0.7925, 0.561, 0.8122]}, {"w": "you", "b": [0.5673, 0.7925, 0.6052, 0.8122]}, {"w": "can", "b": [0.6115, 0.7925, 0.6465, 0.8122]}, {"w": "pass", "b": [0.6528, 0.7925, 0.6962, 0.8122]}, {"w": "Numpy", "b": [0.7025, 0.7925, 0.7782, 0.8122]}, {"w": "data", "b": [0.7845, 0.7925, 0.8266, 0.8122]}, {"w": "to", "b": [0.8329, 0.7925, 0.8525, 0.8122]}, {"w": "the", "b": [0.1294, 0.813, 0.1602, 0.8327]}, {"w": "model", "b": [0.1665, 0.813, 0.2296, 0.8327]}, {"w": "for", "b": [0.2359, 0.813, 0.2653, 0.8327]}, {"w": "training", "b": [0.2716, 0.813, 0.3501, 0.8327]}, {"w": "either", "b": [0.3564, 0.813, 0.4139, 0.8327]}, {"w": "via", "b": [0.4202, 0.813, 0.451, 0.8327]}, {"w": "a", "b": [0.4573, 0.813, 0.4685, 0.8327]}, {"w": "list", "b": [0.4748, 0.813, 0.5057, 0.8327]}, {"w": "of", "b": [0.512, 0.813, 0.533, 0.8327]}, {"w": "arrays", "b": [0.5393, 0.813, 0.6009, 0.8327]}, {"w": "or", "b": [0.6072, 0.813, 0.6282, 0.8327]}, {"w": "via", "b": [0.6344, 0.813, 0.6653, 0.8327]}, {"w": "a", "b": [0.6716, 0.813, 0.6828, 0.8327]}, {"w": "dictionary", "b": [0.6891, 0.813, 0.7914, 0.8327]}, {"w": "of", "b": [0.7977, 0.813, 0.8187, 0.8327]}, {"w": "arrays.", "b": [0.1294, 0.8335, 0.1973, 0.8532]}]}, {"id": "b_7", "type": "equation", "text": "Listing 7.6. Feeding data to a multi-output model", "words": [{"w": "Listing", "b": [0.1294, 0.8713, 0.1862, 0.8861]}, {"w": "7.6.", "b": [0.1909, 0.8713, 0.2193, 0.8861]}, {"w": "Feeding", "b": [0.224, 0.8713, 0.2881, 0.8861]}, {"w": "data", "b": [0.2929, 0.8713, 0.3286, 0.8861]}, {"w": "to", "b": [0.3333, 0.8713, 0.3491, 0.8861]}, {"w": "a", "b": [0.3538, 0.8713, 0.3633, 0.8861]}, {"w": "multi-output", "b": [0.368, 0.8713, 0.471, 0.8861]}, {"w": "model", "b": [0.4757, 0.8713, 0.5251, 0.8861]}]}]}, {"page": 317, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.fit(posts, [age_targets, income_targets, gender_targets], 1 epochs=10, batch_size=64) model.fit(posts, {'age': age_targets, 2 'income': income_targets, 2 'gender': gender_targets}, 2 epochs=10, batch_size=64) 2", "words": [{"w": "model.fit(posts,", "b": [0.1357, 0.0851, 0.3173, 0.1002]}, {"w": "[age_targets,", "b": [0.3287, 0.0851, 0.4763, 0.1002]}, {"w": "income_targets,", "b": [0.4876, 0.0851, 0.6579, 0.1002]}, {"w": "gender_targets],", "b": [0.6692, 0.0851, 0.8509, 0.1002]}, {"w": "1", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "epochs=10,", "b": [0.2492, 0.1154, 0.3628, 0.1305]}, {"w": "batch_size=64)", "b": [0.3741, 0.1154, 0.533, 0.1305]}, {"w": "model.fit(posts,", "b": [0.1357, 0.1457, 0.3173, 0.1608]}, {"w": "{'age':", "b": [0.3287, 0.1457, 0.4082, 0.1608]}, {"w": "age_targets,", "b": [0.4195, 0.1457, 0.5557, 0.1608]}, {"w": "2", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "'income':", "b": [0.34, 0.176, 0.4422, 0.1911]}, {"w": "income_targets,", "b": [0.4536, 0.176, 0.6238, 0.1911]}, {"w": "2", "b": [0.1357, 0.1911, 0.1471, 0.2063]}, {"w": "'gender':", "b": [0.34, 0.2063, 0.4422, 0.2214]}, {"w": "gender_targets},", "b": [0.4536, 0.2063, 0.6352, 0.2214]}, {"w": "2", "b": [0.1357, 0.2215, 0.1471, 0.2366]}, {"w": "epochs=10,", "b": [0.2492, 0.2366, 0.3628, 0.2518]}, {"w": "batch_size=64)", "b": [0.3741, 0.2366, 0.533, 0.2518]}, {"w": "2", "b": [0.1357, 0.2518, 0.1471, 0.2669]}]}, {"id": "b_1", "type": "paragraph", "text": "1 age_targets, income_targets, and gender_targets are assumed to be Numpy arrays. 2 Equivalent (possible only if you give names to the output layers)", "words": [{"w": "1", "b": [0.1799, 0.2853, 0.1925, 0.3051]}, {"w": "age_targets,", "b": [0.1988, 0.2853, 0.3284, 0.3051]}, {"w": "income_targets,", "b": [0.3347, 0.2853, 0.5049, 0.3051]}, {"w": "and", "b": [0.5112, 0.2853, 0.5519, 0.3051]}, {"w": "gender_targets", "b": [0.5582, 0.2853, 0.7193, 0.3051]}, {"w": "are", "b": [0.7256, 0.2853, 0.7601, 0.3051]}, {"w": "assumed", "b": [0.7664, 0.2853, 0.8589, 0.3051]}, {"w": "to", "b": [0.1799, 0.3058, 0.2009, 0.3256]}, {"w": "be", "b": [0.2072, 0.3058, 0.2324, 0.3256]}, {"w": "Numpy", "b": [0.2387, 0.3058, 0.3186, 0.3256]}, {"w": "arrays.", "b": [0.3249, 0.3058, 0.4013, 0.3256]}, {"w": "2", "b": [0.1799, 0.3263, 0.1925, 0.3461]}, {"w": "Equivalent", "b": [0.1988, 0.3263, 0.3165, 0.3461]}, {"w": "(possible", "b": [0.3228, 0.3263, 0.4168, 0.3461]}, {"w": "only", "b": [0.4231, 0.3263, 0.4693, 0.3461]}, {"w": "if", "b": [0.4756, 0.3263, 0.491, 0.3461]}, {"w": "you", "b": [0.4974, 0.3263, 0.5366, 0.3461]}, {"w": "give", "b": [0.5429, 0.3263, 0.5864, 0.3461]}, {"w": "names", "b": [0.5927, 0.3263, 0.6613, 0.3461]}, {"w": "to", "b": [0.6676, 0.3263, 0.6886, 0.3461]}, {"w": "the", "b": [0.6949, 0.3263, 0.7286, 0.3461]}, {"w": "output", "b": [0.7349, 0.3263, 0.8064, 0.3461]}, {"w": "layers)", "b": [0.1799, 0.3468, 0.2527, 0.3666]}]}, {"id": "b_2", "type": "paragraph", "text": "7.1.4. Directed acyclic graphs of layers", "words": [{"w": "7.1.4.", "b": [0.1294, 0.3941, 0.1862, 0.4138]}, {"w": "Directed", "b": [0.1925, 0.3941, 0.2845, 0.4138]}, {"w": "acyclic", "b": [0.2908, 0.3941, 0.3636, 0.4138]}, {"w": "graphs", "b": [0.3699, 0.3941, 0.4442, 0.4138]}, {"w": "of", "b": [0.4505, 0.3941, 0.4715, 0.4138]}, {"w": "layers", "b": [0.4778, 0.3941, 0.5423, 0.4138]}]}, {"id": "b_3", "type": "paragraph", "text": "With the functional API, not only can you build models with multiple inputs and multiple outputs, but you can also implement networks with a complex internal topology. Neural networks in Keras are allowed to be arbitrary directed acyclic graphs of layers. The qualifier acyclic is important: these graphs can’t have cycles. It’s impossible for a tensor x to become the input of one of the layers that generated x. The only processing loops that are allowed (that is, recurrent connections) are those internal to recurrent layers.", "words": [{"w": "With", "b": [0.1294, 0.4369, 0.1788, 0.4566]}, {"w": "the", "b": [0.1852, 0.4369, 0.216, 0.4566]}, {"w": "functional", "b": [0.2223, 0.4369, 0.3246, 0.4566]}, {"w": "API,", "b": [0.3309, 0.4369, 0.3778, 0.4566]}, {"w": "not", "b": [0.3841, 0.4369, 0.4164, 0.4566]}, {"w": "only", "b": [0.4227, 0.4369, 0.4675, 0.4566]}, {"w": "can", "b": [0.4738, 0.4369, 0.5089, 0.4566]}, {"w": "you", "b": [0.5152, 0.4369, 0.553, 0.4566]}, {"w": "build", "b": [0.5593, 0.4369, 0.6112, 0.4566]}, {"w": "models", "b": [0.6175, 0.4369, 0.6904, 0.4566]}, {"w": "with", "b": [0.6967, 0.4369, 0.7415, 0.4566]}, {"w": "multiple", "b": [0.7478, 0.4369, 0.8319, 0.4566]}, {"w": "inputs", "b": [0.1294, 0.4574, 0.1911, 0.4771]}, {"w": "and", "b": [0.1974, 0.4574, 0.2338, 0.4771]}, {"w": "multiple", "b": [0.2401, 0.4574, 0.3242, 0.4771]}, {"w": "outputs,", "b": [0.3305, 0.4574, 0.4111, 0.4771]}, {"w": "but", "b": [0.4174, 0.4574, 0.4497, 0.4771]}, {"w": "you", "b": [0.456, 0.4574, 0.4938, 0.4771]}, {"w": "can", "b": [0.5001, 0.4574, 0.5351, 0.4771]}, {"w": "also", "b": [0.5414, 0.4574, 0.5821, 0.4771]}, {"w": "implement", "b": [0.5884, 0.4574, 0.6963, 0.4771]}, {"w": "networks", "b": [0.7025, 0.4574, 0.795, 0.4771]}, {"w": "with", "b": [0.8013, 0.4574, 0.8462, 0.4771]}, {"w": "a", "b": [0.8525, 0.4574, 0.8637, 0.4771]}, {"w": "complex", "b": [0.1294, 0.4779, 0.2163, 0.4976]}, {"w": "internal", "b": [0.2226, 0.4779, 0.2997, 0.4976]}, {"w": "topology.", "b": [0.306, 0.4779, 0.4003, 0.4976]}, {"w": "Neural", "b": [0.4066, 0.4779, 0.4752, 0.4976]}, {"w": "networks", "b": [0.4815, 0.4779, 0.574, 0.4976]}, {"w": "in", "b": [0.5803, 0.4779, 0.6, 0.4976]}, {"w": "Keras", "b": [0.6063, 0.4779, 0.6651, 0.4976]}, {"w": "are", "b": [0.6714, 0.4779, 0.7022, 0.4976]}, {"w": "allowed", "b": [0.7085, 0.4779, 0.7884, 0.4976]}, {"w": "to", "b": [0.7947, 0.4779, 0.8143, 0.4976]}, {"w": "be", "b": [0.8206, 0.4779, 0.8444, 0.4976]}, {"w": "arbitrary", "b": [0.1294, 0.4984, 0.2163, 0.5181]}, {"w": "directed", "b": [0.2226, 0.4984, 0.3043, 0.5181]}, {"w": "acyclic", "b": [0.3106, 0.4984, 0.382, 0.5181]}, {"w": "graphs", "b": [0.3883, 0.4984, 0.4584, 0.5181]}, {"w": "of", "b": [0.4647, 0.4984, 0.4857, 0.5181]}, {"w": "layers.", "b": [0.492, 0.4984, 0.5585, 0.5181]}, {"w": "The", "b": [0.5648, 0.4984, 0.6041, 0.5181]}, {"w": "qualifier", "b": [0.6104, 0.4984, 0.6958, 0.5181]}, {"w": "acyclic", "b": [0.7021, 0.4984, 0.7736, 0.5181]}, {"w": "is", "b": [0.7798, 0.4984, 0.7966, 0.5181]}, {"w": "important:", "b": [0.1294, 0.5189, 0.2345, 0.5386]}, {"w": "these", "b": [0.2408, 0.5189, 0.2927, 0.5386]}, {"w": "graphs", "b": [0.299, 0.5189, 0.3662, 0.5386]}, {"w": "can’t", "b": [0.3725, 0.5189, 0.4225, 0.5386]}, {"w": "have", "b": [0.4288, 0.5189, 0.4764, 0.5386]}, {"w": "cycles.", "b": [0.4827, 0.5189, 0.5521, 0.5386]}, {"w": "It’s", "b": [0.5584, 0.5189, 0.5906, 0.5386]}, {"w": "impossible", "b": [0.5969, 0.5189, 0.7062, 0.5386]}, {"w": "for", "b": [0.7125, 0.5189, 0.7419, 0.5386]}, {"w": "a", "b": [0.7482, 0.5189, 0.7594, 0.5386]}, {"w": "tensor", "b": [0.7657, 0.5189, 0.8274, 0.5386]}, {"w": "x", "b": [0.8337, 0.5199, 0.8488, 0.5401]}, {"w": "to", "b": [0.1294, 0.5402, 0.149, 0.56]}, {"w": "become", "b": [0.1553, 0.5402, 0.2338, 0.56]}, {"w": "the", "b": [0.2401, 0.5402, 0.2709, 0.56]}, {"w": "input", "b": [0.2772, 0.5402, 0.3291, 0.56]}, {"w": "of", "b": [0.3354, 0.5402, 0.3564, 0.56]}, {"w": "one", "b": [0.3627, 0.5402, 0.3992, 0.56]}, {"w": "of", "b": [0.4055, 0.5402, 0.4265, 0.56]}, {"w": "the", "b": [0.4328, 0.5402, 0.4636, 0.56]}, {"w": "layers", "b": [0.4699, 0.5402, 0.5301, 0.56]}, {"w": "that", "b": [0.5365, 0.5402, 0.5743, 0.56]}, {"w": "generated", "b": [0.5806, 0.5402, 0.6787, 0.56]}, {"w": "x.", "b": [0.6849, 0.5402, 0.7063, 0.5615]}, {"w": "The", "b": [0.7126, 0.5402, 0.7518, 0.56]}, {"w": "only", "b": [0.7582, 0.5402, 0.803, 0.56]}, {"w": "processing", "b": [0.1294, 0.5616, 0.2373, 0.5814]}, {"w": "loops", "b": [0.2436, 0.5616, 0.2983, 0.5814]}, {"w": "that", "b": [0.3046, 0.5616, 0.3424, 0.5814]}, {"w": "are", "b": [0.3487, 0.5616, 0.3795, 0.5814]}, {"w": "allowed", "b": [0.3858, 0.5616, 0.4657, 0.5814]}, {"w": "(that", "b": [0.472, 0.5616, 0.5182, 0.5814]}, {"w": "is,", "b": [0.5245, 0.5616, 0.5477, 0.5814]}, {"w": "recurrent", "b": [0.554, 0.5616, 0.645, 0.5814]}, {"w": "connections)", "b": [0.6513, 0.5616, 0.7802, 0.5814]}, {"w": "are", "b": [0.7865, 0.5616, 0.8173, 0.5814]}, {"w": "those", "b": [0.1294, 0.5821, 0.1827, 0.6019]}, {"w": "internal", "b": [0.189, 0.5821, 0.266, 0.6019]}, {"w": "to", "b": [0.2723, 0.5821, 0.292, 0.6019]}, {"w": "recurrent", "b": [0.2983, 0.5821, 0.3893, 0.6019]}, {"w": "layers.", "b": [0.3956, 0.5821, 0.4622, 0.6019]}]}, {"id": "b_4", "type": "paragraph", "text": "Several common neural-network components are implemented as graphs. Two notable ones are Inception modules and residual connections. To better understand how the functional API can be used to build graphs of layers, let’s take a look at how you can implement both of them in Keras.", "words": [{"w": "Several", "b": [0.1294, 0.6249, 0.2051, 0.6447]}, {"w": "common", "b": [0.2114, 0.6249, 0.2997, 0.6447]}, {"w": "neural-network", "b": [0.306, 0.6249, 0.4601, 0.6447]}, {"w": "components", "b": [0.4664, 0.6249, 0.5883, 0.6447]}, {"w": "are", "b": [0.5946, 0.6249, 0.6254, 0.6447]}, {"w": "implemented", "b": [0.6317, 0.6249, 0.7634, 0.6447]}, {"w": "as", "b": [0.7697, 0.6249, 0.7908, 0.6447]}, {"w": "graphs.", "b": [0.7971, 0.6249, 0.8706, 0.6447]}, {"w": "Two", "b": [0.1294, 0.6454, 0.1739, 0.6652]}, {"w": "notable", "b": [0.1802, 0.6454, 0.2545, 0.6652]}, {"w": "ones", "b": [0.2608, 0.6454, 0.307, 0.6652]}, {"w": "are", "b": [0.3133, 0.6454, 0.3441, 0.6652]}, {"w": "Inception", "b": [0.3504, 0.6454, 0.4457, 0.6652]}, {"w": "modules", "b": [0.452, 0.6454, 0.5375, 0.6652]}, {"w": "and", "b": [0.5438, 0.6454, 0.5802, 0.6652]}, {"w": "residual", "b": [0.5865, 0.6454, 0.6664, 0.6652]}, {"w": "connections.", "b": [0.6727, 0.6454, 0.7995, 0.6652]}, {"w": "To", "b": [0.8057, 0.6454, 0.832, 0.6652]}, {"w": "better", "b": [0.1294, 0.6659, 0.1869, 0.6857]}, {"w": "understand", "b": [0.1932, 0.6659, 0.3038, 0.6857]}, {"w": "how", "b": [0.3102, 0.6659, 0.3536, 0.6857]}, {"w": "the", "b": [0.3599, 0.6659, 0.3907, 0.6857]}, {"w": "functional", "b": [0.397, 0.6659, 0.4993, 0.6857]}, {"w": "API", "b": [0.5056, 0.6659, 0.5463, 0.6857]}, {"w": "can", "b": [0.5526, 0.6659, 0.5876, 0.6857]}, {"w": "be", "b": [0.5939, 0.6659, 0.6177, 0.6857]}, {"w": "used", "b": [0.624, 0.6659, 0.6703, 0.6857]}, {"w": "to", "b": [0.6766, 0.6659, 0.6962, 0.6857]}, {"w": "build", "b": [0.7025, 0.6659, 0.7544, 0.6857]}, {"w": "graphs", "b": [0.7607, 0.6659, 0.8279, 0.6857]}, {"w": "of", "b": [0.8342, 0.6659, 0.8552, 0.6857]}, {"w": "layers,", "b": [0.1294, 0.6864, 0.196, 0.7062]}, {"w": "let’s", "b": [0.2023, 0.6864, 0.2443, 0.7062]}, {"w": "take", "b": [0.2506, 0.6864, 0.2926, 0.7062]}, {"w": "a", "b": [0.2989, 0.6864, 0.3101, 0.7062]}, {"w": "look", "b": [0.3164, 0.6864, 0.3613, 0.7062]}, {"w": "at", "b": [0.3676, 0.6864, 0.3858, 0.7062]}, {"w": "how", "b": [0.3921, 0.6864, 0.4356, 0.7062]}, {"w": "you", "b": [0.4419, 0.6864, 0.4797, 0.7062]}, {"w": "can", "b": [0.486, 0.6864, 0.521, 0.7062]}, {"w": "implement", "b": [0.5273, 0.6864, 0.6352, 0.7062]}, {"w": "both", "b": [0.6415, 0.6864, 0.6863, 0.7062]}, {"w": "of", "b": [0.6926, 0.6864, 0.7136, 0.7062]}, {"w": "them", "b": [0.72, 0.6864, 0.7704, 0.7062]}, {"w": "in", "b": [0.7767, 0.6864, 0.7963, 0.7062]}, {"w": "Keras.", "b": [0.8026, 0.6864, 0.8678, 0.7062]}]}, {"id": "b_5", "type": "paragraph", "text": "Inception modules", "words": [{"w": "Inception", "b": [0.1294, 0.7243, 0.2061, 0.7391]}, {"w": "modules", "b": [0.2109, 0.7243, 0.2782, 0.7391]}]}, {"id": "b_6", "type": "paragraph", "text": "Inception[3] is a popular type of network architecture for convolutional neural networks; it was developed by Christian Szegedy and his colleagues at Google in 2013–2014, inspired by the earlier network-in- network architecture.[4] It consists of a stack of modules that themselves look like small independent networks, split into several parallel branches. The most basic form of an Inception module has three to four branches starting with a 1 × 1 convolution, followed by a 3 × 3", "words": [{"w": "Inception[3]", "b": [0.1294, 0.7617, 0.2467, 0.7837]}, {"w": "is", "b": [0.253, 0.764, 0.2698, 0.7837]}, {"w": "a", "b": [0.2761, 0.764, 0.2873, 0.7837]}, {"w": "popular", "b": [0.2936, 0.764, 0.3707, 0.7837]}, {"w": "type", "b": [0.377, 0.764, 0.4204, 0.7837]}, {"w": "of", "b": [0.4268, 0.764, 0.4478, 0.7837]}, {"w": "network", "b": [0.4541, 0.764, 0.5367, 0.7837]}, {"w": "architecture", "b": [0.543, 0.764, 0.6621, 0.7837]}, {"w": "for", "b": [0.6684, 0.764, 0.6978, 0.7837]}, {"w": "convolutional", "b": [0.7041, 0.764, 0.8429, 0.7837]}, {"w": "neural", "b": [0.1294, 0.7845, 0.1925, 0.8042]}, {"w": "networks;", "b": [0.1988, 0.7845, 0.2982, 0.8042]}, {"w": "it", "b": [0.3046, 0.7845, 0.3186, 0.8042]}, {"w": "was", "b": [0.3249, 0.7845, 0.3641, 0.8042]}, {"w": "developed", "b": [0.3704, 0.7845, 0.4741, 0.8042]}, {"w": "by", "b": [0.4804, 0.7845, 0.5056, 0.8042]}, {"w": "Christian", "b": [0.5119, 0.7845, 0.6044, 0.8042]}, {"w": "Szegedy", "b": [0.6107, 0.7845, 0.6962, 0.8042]}, {"w": "and", "b": [0.7025, 0.7845, 0.7389, 0.8042]}, {"w": "his", "b": [0.7452, 0.7845, 0.7747, 0.8042]}, {"w": "colleagues", "b": [0.1294, 0.805, 0.2359, 0.8247]}, {"w": "at", "b": [0.2422, 0.805, 0.2604, 0.8247]}, {"w": "Google", "b": [0.2667, 0.805, 0.341, 0.8247]}, {"w": "in", "b": [0.3473, 0.805, 0.3669, 0.8247]}, {"w": "2013–2014,", "b": [0.3732, 0.805, 0.493, 0.8247]}, {"w": "inspired", "b": [0.4993, 0.805, 0.5806, 0.8247]}, {"w": "by", "b": [0.5869, 0.805, 0.6122, 0.8247]}, {"w": "the", "b": [0.6185, 0.805, 0.6493, 0.8247]}, {"w": "earlier", "b": [0.6556, 0.805, 0.72, 0.8247]}, {"w": "network-in-", "b": [0.7263, 0.805, 0.844, 0.8247]}, {"w": "network", "b": [0.1294, 0.8273, 0.2107, 0.847]}, {"w": "architecture.[4]", "b": [0.217, 0.825, 0.3644, 0.847]}, {"w": "It", "b": [0.3707, 0.8273, 0.3861, 0.847]}, {"w": "consists", "b": [0.3924, 0.8273, 0.4723, 0.847]}, {"w": "of", "b": [0.4786, 0.8273, 0.4996, 0.847]}, {"w": "a", "b": [0.5059, 0.8273, 0.5171, 0.847]}, {"w": "stack", "b": [0.5234, 0.8273, 0.5752, 0.847]}, {"w": "of", "b": [0.5815, 0.8273, 0.6026, 0.847]}, {"w": "modules", "b": [0.6089, 0.8273, 0.6944, 0.847]}, {"w": "that", "b": [0.7007, 0.8273, 0.7385, 0.847]}, {"w": "themselves", "b": [0.7448, 0.8273, 0.8569, 0.847]}, {"w": "look", "b": [0.1294, 0.8478, 0.1743, 0.8675]}, {"w": "like", "b": [0.1806, 0.8478, 0.2184, 0.8675]}, {"w": "small", "b": [0.2247, 0.8478, 0.2794, 0.8675]}, {"w": "independent", "b": [0.2857, 0.8478, 0.409, 0.8675]}, {"w": "networks,", "b": [0.4153, 0.8478, 0.5141, 0.8675]}, {"w": "split", "b": [0.5204, 0.8478, 0.5639, 0.8675]}, {"w": "into", "b": [0.5702, 0.8478, 0.6094, 0.8675]}, {"w": "several", "b": [0.6157, 0.8478, 0.6872, 0.8675]}, {"w": "parallel", "b": [0.6935, 0.8478, 0.7691, 0.8675]}, {"w": "branches.", "b": [0.1294, 0.8683, 0.2254, 0.888]}, {"w": "The", "b": [0.2317, 0.8683, 0.2709, 0.888]}, {"w": "most", "b": [0.2772, 0.8683, 0.3263, 0.888]}, {"w": "basic", "b": [0.3326, 0.8683, 0.3844, 0.888]}, {"w": "form", "b": [0.3907, 0.8683, 0.4397, 0.888]}, {"w": "of", "b": [0.446, 0.8683, 0.4671, 0.888]}, {"w": "an", "b": [0.4734, 0.8683, 0.4972, 0.888]}, {"w": "Inception", "b": [0.5035, 0.8683, 0.5988, 0.888]}, {"w": "module", "b": [0.6051, 0.8683, 0.6807, 0.888]}, {"w": "has", "b": [0.6871, 0.8683, 0.7207, 0.888]}, {"w": "three", "b": [0.727, 0.8683, 0.7774, 0.888]}, {"w": "to", "b": [0.7837, 0.8683, 0.8033, 0.888]}, {"w": "four", "b": [0.8097, 0.8683, 0.8517, 0.888]}, {"w": "branches", "b": [0.1294, 0.8888, 0.2191, 0.9085]}, {"w": "starting", "b": [0.2254, 0.8888, 0.301, 0.9085]}, {"w": "with", "b": [0.3074, 0.8888, 0.3522, 0.9085]}, {"w": "a", "b": [0.3585, 0.8888, 0.3697, 0.9085]}, {"w": "1", "b": [0.376, 0.8888, 0.3886, 0.9085]}, {"w": "×", "b": [0.3949, 0.8888, 0.4092, 0.9085]}, {"w": "1", "b": [0.4155, 0.8888, 0.4281, 0.9085]}, {"w": "convolution,", "b": [0.4344, 0.8888, 0.5612, 0.9085]}, {"w": "followed", "b": [0.5675, 0.8888, 0.6572, 0.9085]}, {"w": "by", "b": [0.6635, 0.8888, 0.6887, 0.9085]}, {"w": "a", "b": [0.695, 0.8888, 0.7062, 0.9085]}, {"w": "3", "b": [0.7126, 0.8888, 0.7252, 0.9085]}, {"w": "×", "b": [0.7315, 0.8888, 0.7457, 0.9085]}, {"w": "3", "b": [0.7519, 0.8888, 0.7645, 0.9085]}]}]}, {"page": 318, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "convolution, and ending with the concatenation of the resulting features. This setup helps the network separately learn spatial features and channel-wise features, which is more efficient than learning them jointly. More-complex versions of an Inception module are also possible, typically involving pooling operations, different spatial convolution sizes (for example, 5 × 5 instead of 3 × 3 on some branches), and branches without a spatial convolution (only a 1 × 1 convolution). An example of such a module, taken from Inception V3, is shown in figure 7.8.", "words": [{"w": "convolution,", "b": [0.1294, 0.0857, 0.2562, 0.1054]}, {"w": "and", "b": [0.2626, 0.0857, 0.299, 0.1054]}, {"w": "ending", "b": [0.3053, 0.0857, 0.374, 0.1054]}, {"w": "with", "b": [0.3803, 0.0857, 0.4251, 0.1054]}, {"w": "the", "b": [0.4314, 0.0857, 0.4622, 0.1054]}, {"w": "concatenation", "b": [0.4685, 0.0857, 0.6087, 0.1054]}, {"w": "of", "b": [0.615, 0.0857, 0.636, 0.1054]}, {"w": "the", "b": [0.6423, 0.0857, 0.6731, 0.1054]}, {"w": "resulting", "b": [0.6794, 0.0857, 0.7677, 0.1054]}, {"w": "features.", "b": [0.774, 0.0857, 0.8602, 0.1054]}, {"w": "This", "b": [0.1294, 0.1062, 0.1743, 0.1259]}, {"w": "setup", "b": [0.1806, 0.1062, 0.2338, 0.1259]}, {"w": "helps", "b": [0.2401, 0.1062, 0.2934, 0.1259]}, {"w": "the", "b": [0.2997, 0.1062, 0.3305, 0.1259]}, {"w": "network", "b": [0.3368, 0.1062, 0.4195, 0.1259]}, {"w": "separately", "b": [0.4258, 0.1062, 0.5281, 0.1259]}, {"w": "learn", "b": [0.5344, 0.1062, 0.5848, 0.1259]}, {"w": "spatial", "b": [0.591, 0.1062, 0.6569, 0.1259]}, {"w": "features", "b": [0.6632, 0.1062, 0.743, 0.1259]}, {"w": "and", "b": [0.7493, 0.1062, 0.7858, 0.1259]}, {"w": "channel-wise", "b": [0.1294, 0.1267, 0.2625, 0.1464]}, {"w": "features,", "b": [0.2688, 0.1267, 0.355, 0.1464]}, {"w": "which", "b": [0.3613, 0.1267, 0.4229, 0.1464]}, {"w": "is", "b": [0.4292, 0.1267, 0.446, 0.1464]}, {"w": "more", "b": [0.4524, 0.1267, 0.5042, 0.1464]}, {"w": "efficient", "b": [0.5105, 0.1267, 0.5941, 0.1464]}, {"w": "than", "b": [0.6004, 0.1267, 0.6438, 0.1464]}, {"w": "learning", "b": [0.6501, 0.1267, 0.7328, 0.1464]}, {"w": "them", "b": [0.7391, 0.1267, 0.7895, 0.1464]}, {"w": "jointly.", "b": [0.7958, 0.1267, 0.8663, 0.1464]}, {"w": "More-complex", "b": [0.1294, 0.1472, 0.2793, 0.1669]}, {"w": "versions", "b": [0.2856, 0.1472, 0.3697, 0.1669]}, {"w": "of", "b": [0.376, 0.1472, 0.397, 0.1669]}, {"w": "an", "b": [0.4033, 0.1472, 0.4272, 0.1669]}, {"w": "Inception", "b": [0.4334, 0.1472, 0.5287, 0.1669]}, {"w": "module", "b": [0.535, 0.1472, 0.6107, 0.1669]}, {"w": "are", "b": [0.617, 0.1472, 0.6478, 0.1669]}, {"w": "also", "b": [0.6541, 0.1472, 0.6947, 0.1669]}, {"w": "possible,", "b": [0.701, 0.1472, 0.79, 0.1669]}, {"w": "typically", "b": [0.1294, 0.1677, 0.2177, 0.1874]}, {"w": "involving", "b": [0.224, 0.1677, 0.3207, 0.1874]}, {"w": "pooling", "b": [0.327, 0.1677, 0.4041, 0.1874]}, {"w": "operations,", "b": [0.4104, 0.1677, 0.5218, 0.1874]}, {"w": "different", "b": [0.5281, 0.1677, 0.6145, 0.1874]}, {"w": "spatial", "b": [0.6208, 0.1677, 0.6866, 0.1874]}, {"w": "convolution", "b": [0.6929, 0.1677, 0.8135, 0.1874]}, {"w": "sizes", "b": [0.8198, 0.1677, 0.8688, 0.1874]}, {"w": "(for", "b": [0.1294, 0.1882, 0.1672, 0.2079]}, {"w": "example,", "b": [0.1735, 0.1882, 0.2653, 0.2079]}, {"w": "5", "b": [0.2716, 0.1882, 0.2842, 0.2079]}, {"w": "×", "b": [0.2905, 0.1882, 0.3047, 0.2079]}, {"w": "5", "b": [0.311, 0.1882, 0.3236, 0.2079]}, {"w": "instead", "b": [0.33, 0.1882, 0.4014, 0.2079]}, {"w": "of", "b": [0.4077, 0.1882, 0.4287, 0.2079]}, {"w": "3", "b": [0.435, 0.1882, 0.4477, 0.2079]}, {"w": "×", "b": [0.454, 0.1882, 0.4682, 0.2079]}, {"w": "3", "b": [0.4745, 0.1882, 0.4871, 0.2079]}, {"w": "on", "b": [0.4934, 0.1882, 0.5186, 0.2079]}, {"w": "some", "b": [0.525, 0.1882, 0.5782, 0.2079]}, {"w": "branches),", "b": [0.5845, 0.1882, 0.6889, 0.2079]}, {"w": "and", "b": [0.6952, 0.1882, 0.7316, 0.2079]}, {"w": "branches", "b": [0.7379, 0.1882, 0.8276, 0.2079]}, {"w": "without", "b": [0.1294, 0.2087, 0.2065, 0.2284]}, {"w": "a", "b": [0.2128, 0.2087, 0.224, 0.2284]}, {"w": "spatial", "b": [0.2303, 0.2087, 0.2962, 0.2284]}, {"w": "convolution", "b": [0.3025, 0.2087, 0.423, 0.2284]}, {"w": "(only", "b": [0.4293, 0.2087, 0.4826, 0.2284]}, {"w": "a", "b": [0.4889, 0.2087, 0.5001, 0.2284]}, {"w": "1", "b": [0.5064, 0.2087, 0.519, 0.2284]}, {"w": "×", "b": [0.5253, 0.2087, 0.5395, 0.2284]}, {"w": "1", "b": [0.5458, 0.2087, 0.5585, 0.2284]}, {"w": "convolution).", "b": [0.5648, 0.2087, 0.7, 0.2284]}, {"w": "An", "b": [0.7063, 0.2087, 0.7371, 0.2284]}, {"w": "example", "b": [0.7434, 0.2087, 0.8289, 0.2284]}, {"w": "of", "b": [0.8351, 0.2087, 0.8561, 0.2284]}, {"w": "such", "b": [0.1294, 0.2292, 0.1757, 0.2489]}, {"w": "a", "b": [0.182, 0.2292, 0.1932, 0.2489]}, {"w": "module,", "b": [0.1995, 0.2292, 0.2814, 0.2489]}, {"w": "taken", "b": [0.2878, 0.2292, 0.3424, 0.2489]}, {"w": "from", "b": [0.3487, 0.2292, 0.3977, 0.2489]}, {"w": "Inception", "b": [0.404, 0.2292, 0.4993, 0.2489]}, {"w": "V3,", "b": [0.5056, 0.2292, 0.5428, 0.2489]}, {"w": "is", "b": [0.5491, 0.2292, 0.5659, 0.2489]}, {"w": "shown", "b": [0.5722, 0.2292, 0.6381, 0.2489]}, {"w": "in", "b": [0.6444, 0.2292, 0.664, 0.2489]}, {"w": "figure", "b": [0.6702, 0.2292, 0.7305, 0.2489]}, {"w": "7.8.", "b": [0.7368, 0.2292, 0.7746, 0.2489]}]}, {"id": "b_2", "type": "equation", "text": "https://arxiv.org/abs/1409.4842.", "words": [{"w": "https://arxiv.org/abs/1409.4842.", "b": [0.1483, 0.2947, 0.389, 0.3095]}]}, {"id": "b_4", "type": "paragraph", "text": "Min Lin, Qiang Chen, and Shuicheng Yan, “Network in Network,” International Conference on Learning Representations (2013), https://arxiv.org/abs/1312.4400.", "words": [{"w": "Min", "b": [0.1483, 0.3508, 0.1799, 0.3656]}, {"w": "Lin,", "b": [0.1846, 0.3508, 0.2156, 0.3656]}, {"w": "Qiang", "b": [0.2203, 0.3508, 0.2666, 0.3656]}, {"w": "Chen,", "b": [0.2713, 0.3508, 0.316, 0.3656]}, {"w": "and", "b": [0.3207, 0.3508, 0.348, 0.3656]}, {"w": "Shuicheng", "b": [0.3528, 0.3508, 0.4326, 0.3656]}, {"w": "Yan,", "b": [0.4374, 0.3508, 0.4717, 0.3656]}, {"w": "“Network", "b": [0.4764, 0.3508, 0.551, 0.3656]}, {"w": "in", "b": [0.5558, 0.3508, 0.5705, 0.3656]}, {"w": "Network,”", "b": [0.5752, 0.3508, 0.6545, 0.3656]}, {"w": "International", "b": [0.6593, 0.3508, 0.7559, 0.3656]}, {"w": "Conference", "b": [0.7607, 0.3508, 0.8479, 0.3656]}, {"w": "on", "b": [0.1483, 0.366, 0.1673, 0.3808]}, {"w": "Learning", "b": [0.172, 0.366, 0.2403, 0.3808]}, {"w": "Representations", "b": [0.245, 0.366, 0.3659, 0.3808]}, {"w": "(2013),", "b": [0.3706, 0.366, 0.4258, 0.3808]}, {"w": "https://arxiv.org/abs/1312.4400.", "b": [0.4305, 0.366, 0.6711, 0.3808]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 7.8. An Inception module", "words": [{"w": "Figure", "b": [0.1294, 0.4034, 0.1827, 0.4182]}, {"w": "7.8.", "b": [0.1874, 0.4034, 0.2158, 0.4182]}, {"w": "An", "b": [0.2205, 0.4034, 0.2447, 0.4182]}, {"w": "Inception", "b": [0.2494, 0.4034, 0.3261, 0.4182]}, {"w": "module", "b": [0.3309, 0.4034, 0.3908, 0.4182]}]}, {"id": "b_6", "type": "paragraph", "text": "The purpose of 1 × 1 convolutions", "words": [{"w": "The", "b": [0.1294, 0.7399, 0.1715, 0.7596]}, {"w": "purpose", "b": [0.1778, 0.7399, 0.2647, 0.7596]}, {"w": "of", "b": [0.271, 0.7399, 0.292, 0.7596]}, {"w": "1", "b": [0.2983, 0.7399, 0.3109, 0.7596]}, {"w": "×", "b": [0.3172, 0.7399, 0.3316, 0.7596]}, {"w": "1", "b": [0.3379, 0.7399, 0.3505, 0.7596]}, {"w": "convolutions", "b": [0.3568, 0.7399, 0.4928, 0.7596]}]}, {"id": "b_7", "type": "paragraph", "text": "You already know that convolutions extract spatial patches around every tile in an input tensor and apply the same transformation to each patch. An edge case is when the patches extracted consist of a single tile. The convolution operation then becomes equivalent to running each tile vector through a Dense layer: it will compute features that mix together information from the channels of the input tensor, but it won’t mix", "words": [{"w": "You", "b": [0.1294, 0.7827, 0.1703, 0.8024]}, {"w": "already", "b": [0.1766, 0.7827, 0.2509, 0.8024]}, {"w": "know", "b": [0.2572, 0.7827, 0.3132, 0.8024]}, {"w": "that", "b": [0.3195, 0.7827, 0.3574, 0.8024]}, {"w": "convolutions", "b": [0.3637, 0.7827, 0.494, 0.8024]}, {"w": "extract", "b": [0.5003, 0.7827, 0.569, 0.8024]}, {"w": "spatial", "b": [0.5753, 0.7827, 0.6411, 0.8024]}, {"w": "patches", "b": [0.6475, 0.7827, 0.7231, 0.8024]}, {"w": "around", "b": [0.7294, 0.7827, 0.7995, 0.8024]}, {"w": "every", "b": [0.8058, 0.7827, 0.8618, 0.8024]}, {"w": "tile", "b": [0.1294, 0.8032, 0.1617, 0.8229]}, {"w": "in", "b": [0.168, 0.8032, 0.1876, 0.8229]}, {"w": "an", "b": [0.1939, 0.8032, 0.2177, 0.8229]}, {"w": "input", "b": [0.224, 0.8032, 0.2759, 0.8229]}, {"w": "tensor", "b": [0.2822, 0.8032, 0.3438, 0.8229]}, {"w": "and", "b": [0.3501, 0.8032, 0.3866, 0.8229]}, {"w": "apply", "b": [0.3929, 0.8032, 0.4489, 0.8229]}, {"w": "the", "b": [0.4552, 0.8032, 0.4861, 0.8229]}, {"w": "same", "b": [0.4924, 0.8032, 0.5442, 0.8229]}, {"w": "transformation", "b": [0.5505, 0.8032, 0.699, 0.8229]}, {"w": "to", "b": [0.7052, 0.8032, 0.7249, 0.8229]}, {"w": "each", "b": [0.7312, 0.8032, 0.7774, 0.8229]}, {"w": "patch.", "b": [0.7837, 0.8032, 0.8446, 0.8229]}, {"w": "An", "b": [0.1294, 0.8237, 0.1602, 0.8434]}, {"w": "edge", "b": [0.1665, 0.8237, 0.2142, 0.8434]}, {"w": "case", "b": [0.2205, 0.8237, 0.2639, 0.8434]}, {"w": "is", "b": [0.2702, 0.8237, 0.287, 0.8434]}, {"w": "when", "b": [0.2933, 0.8237, 0.348, 0.8434]}, {"w": "the", "b": [0.3543, 0.8237, 0.3851, 0.8434]}, {"w": "patches", "b": [0.3914, 0.8237, 0.4671, 0.8434]}, {"w": "extracted", "b": [0.4734, 0.8237, 0.5658, 0.8434]}, {"w": "consist", "b": [0.5721, 0.8237, 0.6422, 0.8434]}, {"w": "of", "b": [0.6485, 0.8237, 0.6695, 0.8434]}, {"w": "a", "b": [0.6758, 0.8237, 0.687, 0.8434]}, {"w": "single", "b": [0.6933, 0.8237, 0.7536, 0.8434]}, {"w": "tile.", "b": [0.7599, 0.8237, 0.7984, 0.8434]}, {"w": "The", "b": [0.8048, 0.8237, 0.844, 0.8434]}, {"w": "convolution", "b": [0.1294, 0.8442, 0.2499, 0.8639]}, {"w": "operation", "b": [0.2562, 0.8442, 0.3515, 0.8639]}, {"w": "then", "b": [0.3578, 0.8442, 0.4013, 0.8639]}, {"w": "becomes", "b": [0.4076, 0.8442, 0.4958, 0.8639]}, {"w": "equivalent", "b": [0.5021, 0.8442, 0.6072, 0.8639]}, {"w": "to", "b": [0.6135, 0.8442, 0.6331, 0.8639]}, {"w": "running", "b": [0.6394, 0.8442, 0.7179, 0.8639]}, {"w": "each", "b": [0.7242, 0.8442, 0.7704, 0.8639]}, {"w": "tile", "b": [0.7767, 0.8442, 0.809, 0.8639]}, {"w": "vector", "b": [0.1294, 0.8647, 0.1925, 0.8844]}, {"w": "through", "b": [0.1988, 0.8647, 0.2772, 0.8844]}, {"w": "a", "b": [0.2835, 0.8647, 0.2947, 0.8844]}, {"w": "Dense", "b": [0.301, 0.8657, 0.3767, 0.8859]}, {"w": "layer:", "b": [0.383, 0.8647, 0.4404, 0.8844]}, {"w": "it", "b": [0.4468, 0.8647, 0.4608, 0.8844]}, {"w": "will", "b": [0.4671, 0.8647, 0.5063, 0.8844]}, {"w": "compute", "b": [0.5126, 0.8647, 0.5995, 0.8844]}, {"w": "features", "b": [0.6058, 0.8647, 0.6857, 0.8844]}, {"w": "that", "b": [0.692, 0.8647, 0.7298, 0.8844]}, {"w": "mix", "b": [0.7361, 0.8647, 0.7754, 0.8844]}, {"w": "together", "b": [0.7817, 0.8647, 0.8643, 0.8844]}, {"w": "information", "b": [0.1294, 0.8861, 0.2485, 0.9058]}, {"w": "from", "b": [0.2548, 0.8861, 0.3039, 0.9058]}, {"w": "the", "b": [0.3102, 0.8861, 0.341, 0.9058]}, {"w": "channels", "b": [0.3473, 0.8861, 0.4356, 0.9058]}, {"w": "of", "b": [0.4419, 0.8861, 0.4629, 0.9058]}, {"w": "the", "b": [0.4692, 0.8861, 0.5, 0.9058]}, {"w": "input", "b": [0.5063, 0.8861, 0.5582, 0.9058]}, {"w": "tensor,", "b": [0.5645, 0.8861, 0.6314, 0.9058]}, {"w": "but", "b": [0.6377, 0.8861, 0.6699, 0.9058]}, {"w": "it", "b": [0.6762, 0.8861, 0.6903, 0.9058]}, {"w": "won’t", "b": [0.6966, 0.8861, 0.755, 0.9058]}, {"w": "mix", "b": [0.7613, 0.8861, 0.8005, 0.9058]}]}]}, {"page": 319, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "information across space (because it’s looking at one tile at a time). Such 1 × 1 convolutions (also called pointwise convolutions) are featured in Inception modules, where they contribute to factoring out channel-wise feature learning and space-wise feature learning—a reasonable thing to do if you assume that each channel is highly autocorrelated across space, but different channels may not be highly correlated with each other.", "words": [{"w": "information", "b": [0.1294, 0.0857, 0.2485, 0.1054]}, {"w": "across", "b": [0.2548, 0.0857, 0.3179, 0.1054]}, {"w": "space", "b": [0.3242, 0.0857, 0.3802, 0.1054]}, {"w": "(because", "b": [0.3865, 0.0857, 0.4747, 0.1054]}, {"w": "it’s", "b": [0.481, 0.0857, 0.5119, 0.1054]}, {"w": "looking", "b": [0.5182, 0.0857, 0.5953, 0.1054]}, {"w": "at", "b": [0.6016, 0.0857, 0.6198, 0.1054]}, {"w": "one", "b": [0.6261, 0.0857, 0.6625, 0.1054]}, {"w": "tile", "b": [0.6688, 0.0857, 0.701, 0.1054]}, {"w": "at", "b": [0.7074, 0.0857, 0.7256, 0.1054]}, {"w": "a", "b": [0.7319, 0.0857, 0.7431, 0.1054]}, {"w": "time).", "b": [0.7494, 0.0857, 0.8089, 0.1054]}, {"w": "Such", "b": [0.8152, 0.0857, 0.8657, 0.1054]}, {"w": "1", "b": [0.1294, 0.1062, 0.142, 0.1259]}, {"w": "×", "b": [0.1483, 0.1062, 0.1626, 0.1259]}, {"w": "1", "b": [0.1689, 0.1062, 0.1815, 0.1259]}, {"w": "convolutions", "b": [0.1878, 0.1062, 0.3181, 0.1259]}, {"w": "(also", "b": [0.3244, 0.1062, 0.3735, 0.1259]}, {"w": "called", "b": [0.3798, 0.1062, 0.44, 0.1259]}, {"w": "pointwise", "b": [0.4463, 0.1062, 0.543, 0.1259]}, {"w": "convolutions)", "b": [0.5493, 0.1062, 0.6866, 0.1259]}, {"w": "are", "b": [0.6929, 0.1062, 0.7237, 0.1259]}, {"w": "featured", "b": [0.73, 0.1062, 0.8126, 0.1259]}, {"w": "in", "b": [0.819, 0.1062, 0.8386, 0.1259]}, {"w": "Inception", "b": [0.1294, 0.1267, 0.2247, 0.1464]}, {"w": "modules,", "b": [0.231, 0.1267, 0.3228, 0.1464]}, {"w": "where", "b": [0.3291, 0.1267, 0.3907, 0.1464]}, {"w": "they", "b": [0.397, 0.1267, 0.4405, 0.1464]}, {"w": "contribute", "b": [0.4468, 0.1267, 0.5491, 0.1464]}, {"w": "to", "b": [0.5554, 0.1267, 0.575, 0.1464]}, {"w": "factoring", "b": [0.5813, 0.1267, 0.6724, 0.1464]}, {"w": "out", "b": [0.6787, 0.1267, 0.7109, 0.1464]}, {"w": "channel-wise", "b": [0.7172, 0.1267, 0.8503, 0.1464]}, {"w": "feature", "b": [0.1294, 0.1472, 0.1994, 0.1669]}, {"w": "learning", "b": [0.2057, 0.1472, 0.2884, 0.1669]}, {"w": "and", "b": [0.2947, 0.1472, 0.3311, 0.1669]}, {"w": "space-wise", "b": [0.3374, 0.1472, 0.4481, 0.1669]}, {"w": "feature", "b": [0.4544, 0.1472, 0.5244, 0.1669]}, {"w": "learning—a", "b": [0.5307, 0.1472, 0.6498, 0.1669]}, {"w": "reasonable", "b": [0.6561, 0.1472, 0.7639, 0.1669]}, {"w": "thing", "b": [0.7702, 0.1472, 0.8221, 0.1669]}, {"w": "to", "b": [0.8284, 0.1472, 0.848, 0.1669]}, {"w": "do", "b": [0.1294, 0.1677, 0.1546, 0.1874]}, {"w": "if", "b": [0.1609, 0.1677, 0.1764, 0.1874]}, {"w": "you", "b": [0.1827, 0.1677, 0.2205, 0.1874]}, {"w": "assume", "b": [0.2268, 0.1677, 0.3011, 0.1874]}, {"w": "that", "b": [0.3074, 0.1677, 0.3452, 0.1874]}, {"w": "each", "b": [0.3515, 0.1677, 0.3977, 0.1874]}, {"w": "channel", "b": [0.404, 0.1677, 0.4825, 0.1874]}, {"w": "is", "b": [0.4888, 0.1677, 0.5056, 0.1874]}, {"w": "highly", "b": [0.5119, 0.1677, 0.5764, 0.1874]}, {"w": "autocorrelated", "b": [0.5827, 0.1677, 0.727, 0.1874]}, {"w": "across", "b": [0.7333, 0.1677, 0.7964, 0.1874]}, {"w": "space,", "b": [0.8027, 0.1677, 0.865, 0.1874]}, {"w": "but", "b": [0.1294, 0.1882, 0.1617, 0.2079]}, {"w": "different", "b": [0.168, 0.1882, 0.2543, 0.2079]}, {"w": "channels", "b": [0.2607, 0.1882, 0.3489, 0.2079]}, {"w": "may", "b": [0.3552, 0.1882, 0.3986, 0.2079]}, {"w": "not", "b": [0.4049, 0.1882, 0.4372, 0.2079]}, {"w": "be", "b": [0.4435, 0.1882, 0.4673, 0.2079]}, {"w": "highly", "b": [0.4736, 0.1882, 0.5381, 0.2079]}, {"w": "correlated", "b": [0.5444, 0.1882, 0.6452, 0.2079]}, {"w": "with", "b": [0.6515, 0.1882, 0.6964, 0.2079]}, {"w": "each", "b": [0.7027, 0.1882, 0.7489, 0.2079]}, {"w": "other.", "b": [0.7552, 0.1882, 0.8119, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "Here’s how you’d implement the module featured in figure 7.8 using the functional API. This example assumes the existence of a 4D input tensor x:", "words": [{"w": "Here’s", "b": [0.1294, 0.2577, 0.1952, 0.2774]}, {"w": "how", "b": [0.2016, 0.2577, 0.245, 0.2774]}, {"w": "you’d", "b": [0.2513, 0.2577, 0.3101, 0.2774]}, {"w": "implement", "b": [0.3165, 0.2577, 0.4244, 0.2774]}, {"w": "the", "b": [0.4307, 0.2577, 0.4615, 0.2774]}, {"w": "module", "b": [0.4678, 0.2577, 0.5435, 0.2774]}, {"w": "featured", "b": [0.5498, 0.2577, 0.6324, 0.2774]}, {"w": "in", "b": [0.6387, 0.2577, 0.6584, 0.2774]}, {"w": "figure", "b": [0.6646, 0.2577, 0.7248, 0.2774]}, {"w": "7.8", "b": [0.7311, 0.2577, 0.7627, 0.2774]}, {"w": "using", "b": [0.769, 0.2577, 0.8236, 0.2774]}, {"w": "the", "b": [0.8299, 0.2577, 0.8608, 0.2774]}, {"w": "functional", "b": [0.1294, 0.2782, 0.2317, 0.2979]}, {"w": "API.", "b": [0.238, 0.2782, 0.285, 0.2979]}, {"w": "This", "b": [0.2913, 0.2782, 0.3361, 0.2979]}, {"w": "example", "b": [0.3424, 0.2782, 0.4279, 0.2979]}, {"w": "assumes", "b": [0.4342, 0.2782, 0.5183, 0.2979]}, {"w": "the", "b": [0.5246, 0.2782, 0.5554, 0.2979]}, {"w": "existence", "b": [0.5617, 0.2782, 0.6556, 0.2979]}, {"w": "of", "b": [0.6619, 0.2782, 0.6829, 0.2979]}, {"w": "a", "b": [0.6892, 0.2782, 0.7004, 0.2979]}, {"w": "4D", "b": [0.7067, 0.2782, 0.7375, 0.2979]}, {"w": "input", "b": [0.7438, 0.2782, 0.7957, 0.2979]}, {"w": "tensor", "b": [0.802, 0.2782, 0.8637, 0.2979]}, {"w": "x:", "b": [0.1294, 0.2987, 0.1516, 0.3199]}]}, {"id": "b_2", "type": "paragraph", "text": "from keras import layers branch_a = layers.Conv2D(128, 1, activation='relu', strides=2)(x) 1 branch_b = layers.Conv2D(128, 1, activation='relu')(x) 2 branch_b = layers.Conv2D(128, 3, activation='relu', strides=2) (branch_b) 2 branch_c = layers.AveragePooling2D(3, strides=2)(x) 3 branch_c = layers.Conv2D(128, 3, activation='relu')(branch_c) 3 branch_d = layers.Conv2D(128, 1, activation='relu')(x) branch_d = layers.Conv2D(128, 3, activation='relu')(branch_d) branch_d = layers.Conv2D(128, 3, activation='relu', strides=2) (branch_d) output = layers.concatenate( [branch_a, branch_b, branch_c, branch_d], axis=-1) 4", "words": [{"w": "from", "b": [0.1357, 0.3373, 0.1811, 0.3525]}, {"w": "keras", "b": [0.1925, 0.3373, 0.2492, 0.3525]}, {"w": "import", "b": [0.2606, 0.3373, 0.3287, 0.3525]}, {"w": "layers", "b": [0.34, 0.3373, 0.4082, 0.3525]}, {"w": "branch_a", "b": [0.1357, 0.3525, 0.2265, 0.3676]}, {"w": "=", "b": [0.2379, 0.3525, 0.2492, 0.3676]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.3525, 0.4649, 0.3676]}, {"w": "1,", "b": [0.4763, 0.3525, 0.499, 0.3676]}, {"w": "activation='relu',", "b": [0.4195, 0.3676, 0.6238, 0.3828]}, {"w": "strides=2)(x)", "b": [0.6352, 0.3676, 0.7828, 0.3828]}, {"w": "1", "b": [0.1357, 0.3828, 0.1471, 0.3979]}, {"w": "branch_b", "b": [0.1357, 0.3979, 0.2265, 0.4131]}, {"w": "=", "b": [0.2379, 0.3979, 0.2492, 0.4131]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.3979, 0.4649, 0.4131]}, {"w": "1,", "b": [0.4763, 0.3979, 0.499, 0.4131]}, {"w": "activation='relu')(x)", "b": [0.5103, 0.3979, 0.7487, 0.4131]}, {"w": "2", "b": [0.1357, 0.4131, 0.1471, 0.4282]}, {"w": "branch_b", "b": [0.1357, 0.4282, 0.2265, 0.4434]}, {"w": "=", "b": [0.2379, 0.4282, 0.2492, 0.4434]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.4282, 0.4649, 0.4434]}, {"w": "3,", "b": [0.4763, 0.4282, 0.499, 0.4434]}, {"w": "activation='relu',", "b": [0.5103, 0.4282, 0.7146, 0.4434]}, {"w": "strides=2)", "b": [0.726, 0.4282, 0.8395, 0.4434]}, {"w": "(branch_b)", "b": [0.1357, 0.4434, 0.2492, 0.4585]}, {"w": "2", "b": [0.2833, 0.4434, 0.2947, 0.4585]}, {"w": "branch_c", "b": [0.1357, 0.4737, 0.2265, 0.4888]}, {"w": "=", "b": [0.2379, 0.4737, 0.2492, 0.4888]}, {"w": "layers.AveragePooling2D(3,", "b": [0.2606, 0.4737, 0.5557, 0.4888]}, {"w": "strides=2)(x)", "b": [0.5671, 0.4737, 0.7146, 0.4888]}, {"w": "3", "b": [0.1357, 0.4888, 0.1471, 0.504]}, {"w": "branch_c", "b": [0.1357, 0.504, 0.2265, 0.5191]}, {"w": "=", "b": [0.2379, 0.504, 0.2492, 0.5191]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.504, 0.4649, 0.5191]}, {"w": "3,", "b": [0.4763, 0.504, 0.499, 0.5191]}, {"w": "activation='relu')(branch_c)", "b": [0.5103, 0.504, 0.8282, 0.5191]}, {"w": "3", "b": [0.1357, 0.5192, 0.1471, 0.5343]}, {"w": "branch_d", "b": [0.1357, 0.5495, 0.2265, 0.5646]}, {"w": "=", "b": [0.2379, 0.5495, 0.2492, 0.5646]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.5495, 0.4649, 0.5646]}, {"w": "1,", "b": [0.4763, 0.5495, 0.499, 0.5646]}, {"w": "activation='relu')(x)", "b": [0.5103, 0.5495, 0.7487, 0.5646]}, {"w": "branch_d", "b": [0.1357, 0.5646, 0.2265, 0.5798]}, {"w": "=", "b": [0.2379, 0.5646, 0.2492, 0.5798]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.5646, 0.4649, 0.5798]}, {"w": "3,", "b": [0.4763, 0.5646, 0.499, 0.5798]}, {"w": "activation='relu')(branch_d)", "b": [0.5103, 0.5646, 0.8282, 0.5798]}, {"w": "branch_d", "b": [0.1357, 0.5798, 0.2265, 0.5949]}, {"w": "=", "b": [0.2379, 0.5798, 0.2492, 0.5949]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.5798, 0.4649, 0.5949]}, {"w": "3,", "b": [0.4763, 0.5798, 0.499, 0.5949]}, {"w": "activation='relu',", "b": [0.5103, 0.5798, 0.7146, 0.5949]}, {"w": "strides=2)", "b": [0.726, 0.5798, 0.8395, 0.5949]}, {"w": "(branch_d)", "b": [0.1357, 0.5949, 0.2492, 0.6101]}, {"w": "output", "b": [0.1357, 0.6101, 0.2038, 0.6252]}, {"w": "=", "b": [0.2152, 0.6101, 0.2265, 0.6252]}, {"w": "layers.concatenate(", "b": [0.2379, 0.6101, 0.4536, 0.6252]}, {"w": "[branch_a,", "b": [0.1811, 0.6252, 0.2946, 0.6404]}, {"w": "branch_b,", "b": [0.306, 0.6252, 0.4082, 0.6404]}, {"w": "branch_c,", "b": [0.4195, 0.6252, 0.5217, 0.6404]}, {"w": "branch_d],", "b": [0.533, 0.6252, 0.6465, 0.6404]}, {"w": "axis=-1)", "b": [0.6579, 0.6252, 0.7487, 0.6404]}, {"w": "4", "b": [0.1357, 0.6404, 0.1471, 0.6555]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Every branch has the same stride value (2), which is necessary to keep all branch outputs the same size so you can concatenate them. 2 In this branch, the striding occurs in the spatial convolution layer. 3 In this branch, the striding occurs in the average pooling layer. 4 Concatenates the branch outputs to obtain the module output", "words": [{"w": "1", "b": [0.1799, 0.6739, 0.1925, 0.6937]}, {"w": "Every", "b": [0.1988, 0.6739, 0.2632, 0.6937]}, {"w": "branch", "b": [0.2695, 0.6739, 0.3466, 0.6937]}, {"w": "has", "b": [0.3529, 0.6739, 0.3894, 0.6937]}, {"w": "the", "b": [0.3957, 0.6739, 0.4293, 0.6937]}, {"w": "same", "b": [0.4356, 0.6739, 0.4903, 0.6937]}, {"w": "stride", "b": [0.4966, 0.6739, 0.5582, 0.6937]}, {"w": "value", "b": [0.5645, 0.6739, 0.622, 0.6937]}, {"w": "(2),", "b": [0.6283, 0.6739, 0.664, 0.6937]}, {"w": "which", "b": [0.6703, 0.6739, 0.7348, 0.6937]}, {"w": "is", "b": [0.7411, 0.6739, 0.7579, 0.6937]}, {"w": "necessary", "b": [0.7642, 0.6739, 0.8679, 0.6937]}, {"w": "to", "b": [0.1799, 0.6944, 0.2009, 0.7142]}, {"w": "keep", "b": [0.2072, 0.6944, 0.2576, 0.7142]}, {"w": "all", "b": [0.2639, 0.6944, 0.2906, 0.7142]}, {"w": "branch", "b": [0.2969, 0.6944, 0.374, 0.7142]}, {"w": "outputs", "b": [0.3803, 0.6944, 0.4616, 0.7142]}, {"w": "the", "b": [0.4679, 0.6944, 0.5015, 0.7142]}, {"w": "same", "b": [0.5078, 0.6944, 0.5625, 0.7142]}, {"w": "size", "b": [0.5688, 0.6944, 0.608, 0.7142]}, {"w": "so", "b": [0.6143, 0.6944, 0.6367, 0.7142]}, {"w": "you", "b": [0.643, 0.6944, 0.6823, 0.7142]}, {"w": "can", "b": [0.6886, 0.6944, 0.7264, 0.7142]}, {"w": "concatenate", "b": [0.7327, 0.6944, 0.8602, 0.7142]}, {"w": "them.", "b": [0.1799, 0.7149, 0.2408, 0.7347]}, {"w": "2", "b": [0.1799, 0.7354, 0.1925, 0.7552]}, {"w": "In", "b": [0.1988, 0.7354, 0.2226, 0.7552]}, {"w": "this", "b": [0.2289, 0.7354, 0.2682, 0.7552]}, {"w": "branch,", "b": [0.2745, 0.7354, 0.3579, 0.7552]}, {"w": "the", "b": [0.3642, 0.7354, 0.3978, 0.7552]}, {"w": "striding", "b": [0.4041, 0.7354, 0.4882, 0.7552]}, {"w": "occurs", "b": [0.4945, 0.7354, 0.5646, 0.7552]}, {"w": "in", "b": [0.5709, 0.7354, 0.5919, 0.7552]}, {"w": "the", "b": [0.5982, 0.7354, 0.6319, 0.7552]}, {"w": "spatial", "b": [0.6382, 0.7354, 0.7097, 0.7552]}, {"w": "convolution", "b": [0.716, 0.7354, 0.8421, 0.7552]}, {"w": "layer.", "b": [0.1799, 0.7559, 0.2385, 0.7757]}, {"w": "3", "b": [0.1799, 0.7764, 0.1925, 0.7962]}, {"w": "In", "b": [0.1988, 0.7764, 0.2226, 0.7962]}, {"w": "this", "b": [0.2289, 0.7764, 0.2682, 0.7962]}, {"w": "branch,", "b": [0.2745, 0.7764, 0.3579, 0.7962]}, {"w": "the", "b": [0.3642, 0.7764, 0.3978, 0.7962]}, {"w": "striding", "b": [0.4041, 0.7764, 0.4882, 0.7962]}, {"w": "occurs", "b": [0.4945, 0.7764, 0.5646, 0.7962]}, {"w": "in", "b": [0.5709, 0.7764, 0.5919, 0.7962]}, {"w": "the", "b": [0.5982, 0.7764, 0.6319, 0.7962]}, {"w": "average", "b": [0.6382, 0.7764, 0.7222, 0.7962]}, {"w": "pooling", "b": [0.7285, 0.7764, 0.8084, 0.7962]}, {"w": "layer.", "b": [0.1799, 0.7969, 0.2385, 0.8167]}, {"w": "4", "b": [0.1799, 0.8174, 0.1925, 0.8372]}, {"w": "Concatenates", "b": [0.1988, 0.8174, 0.3431, 0.8372]}, {"w": "the", "b": [0.3494, 0.8174, 0.383, 0.8372]}, {"w": "branch", "b": [0.3893, 0.8174, 0.4664, 0.8372]}, {"w": "outputs", "b": [0.4727, 0.8174, 0.554, 0.8372]}, {"w": "to", "b": [0.5603, 0.8174, 0.5814, 0.8372]}, {"w": "obtain", "b": [0.5877, 0.8174, 0.6564, 0.8372]}, {"w": "the", "b": [0.6627, 0.8174, 0.6963, 0.8372]}, {"w": "module", "b": [0.7026, 0.8174, 0.7825, 0.8372]}, {"w": "output", "b": [0.7888, 0.8174, 0.8603, 0.8372]}]}, {"id": "b_4", "type": "paragraph", "text": "Note that the full Inception V3 architecture is available in Keras as keras.applications.inception_v3.InceptionV3,", "words": [{"w": "Note", "b": [0.1294, 0.8602, 0.1785, 0.88]}, {"w": "that", "b": [0.1848, 0.8602, 0.2226, 0.88]}, {"w": "the", "b": [0.2289, 0.8602, 0.2597, 0.88]}, {"w": "full", "b": [0.266, 0.8602, 0.3011, 0.88]}, {"w": "Inception", "b": [0.3074, 0.8602, 0.4027, 0.88]}, {"w": "V3", "b": [0.409, 0.8602, 0.4398, 0.88]}, {"w": "architecture", "b": [0.4461, 0.8602, 0.5652, 0.88]}, {"w": "is", "b": [0.5715, 0.8602, 0.5883, 0.88]}, {"w": "available", "b": [0.5946, 0.8602, 0.6857, 0.88]}, {"w": "in", "b": [0.692, 0.8602, 0.7116, 0.88]}, {"w": "Keras", "b": [0.7179, 0.8602, 0.7767, 0.88]}, {"w": "as", "b": [0.783, 0.8602, 0.804, 0.88]}, {"w": "keras.applications.inception_v3.InceptionV3,", "b": [0.1294, 0.8807, 0.7866, 0.902]}]}]}, {"page": 320, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "including weights pretrained on the ImageNet dataset. Another closely related model available as part of the Keras applications module is Xception.[5] Xception, which stands for extreme inception, is a convnet architecture loosely inspired by Inception. It takes the idea of separating the learning of channel-wise and space-wise features to its logical extreme, and replaces Inception modules with depthwise separable convolutions consisting of a depthwise convolution (a spatial convolution where every input channel is handled separately) followed by a pointwise convolution (a 1 × 1 convolution)—effectively, an extreme form of an Inception module, where spatial features and channel-wise features are fully separated. Xception has roughly the same number of parameters as Inception V3, but it shows better runtime performance and higher accuracy on ImageNet as well as other large- scale datasets, due to a more efficient use of model parameters.", "words": [{"w": "including", "b": [0.1294, 0.0857, 0.2247, 0.1054]}, {"w": "weights", "b": [0.231, 0.0857, 0.3095, 0.1054]}, {"w": "pretrained", "b": [0.3158, 0.0857, 0.4181, 0.1054]}, {"w": "on", "b": [0.4244, 0.0857, 0.4496, 0.1054]}, {"w": "the", "b": [0.4559, 0.0857, 0.4867, 0.1054]}, {"w": "ImageNet", "b": [0.493, 0.0857, 0.5925, 0.1054]}, {"w": "dataset.", "b": [0.5988, 0.0857, 0.6752, 0.1054]}, {"w": "Another", "b": [0.6815, 0.0857, 0.7641, 0.1054]}, {"w": "closely", "b": [0.7704, 0.0857, 0.8419, 0.1054]}, {"w": "related", "b": [0.1294, 0.1062, 0.1981, 0.1259]}, {"w": "model", "b": [0.2044, 0.1062, 0.2674, 0.1259]}, {"w": "available", "b": [0.2737, 0.1062, 0.3648, 0.1259]}, {"w": "as", "b": [0.3711, 0.1062, 0.3921, 0.1259]}, {"w": "part", "b": [0.3984, 0.1062, 0.4376, 0.1259]}, {"w": "of", "b": [0.444, 0.1062, 0.465, 0.1259]}, {"w": "the", "b": [0.4713, 0.1062, 0.5021, 0.1259]}, {"w": "Keras", "b": [0.5084, 0.1062, 0.5672, 0.1259]}, {"w": "applications", "b": [0.5735, 0.1062, 0.6955, 0.1259]}, {"w": "module", "b": [0.7016, 0.1062, 0.7773, 0.1259]}, {"w": "is", "b": [0.7836, 0.1062, 0.8005, 0.1259]}, {"w": "Xception.[5]", "b": [0.1294, 0.1262, 0.2474, 0.1482]}, {"w": "Xception,", "b": [0.2537, 0.1285, 0.3525, 0.1482]}, {"w": "which", "b": [0.3588, 0.1285, 0.4205, 0.1482]}, {"w": "stands", "b": [0.4268, 0.1285, 0.4898, 0.1482]}, {"w": "for", "b": [0.4961, 0.1285, 0.5255, 0.1482]}, {"w": "extreme", "b": [0.5318, 0.1285, 0.6107, 0.1482]}, {"w": "inception,", "b": [0.617, 0.1285, 0.7172, 0.1482]}, {"w": "is", "b": [0.7235, 0.1285, 0.7403, 0.1482]}, {"w": "a", "b": [0.7466, 0.1285, 0.7578, 0.1482]}, {"w": "convnet", "b": [0.7641, 0.1285, 0.844, 0.1482]}, {"w": "architecture", "b": [0.1294, 0.149, 0.2485, 0.1687]}, {"w": "loosely", "b": [0.2548, 0.149, 0.3277, 0.1687]}, {"w": "inspired", "b": [0.334, 0.149, 0.4152, 0.1687]}, {"w": "by", "b": [0.4216, 0.149, 0.4468, 0.1687]}, {"w": "Inception.", "b": [0.4531, 0.149, 0.5547, 0.1687]}, {"w": "It", "b": [0.561, 0.149, 0.5764, 0.1687]}, {"w": "takes", "b": [0.5827, 0.149, 0.6345, 0.1687]}, {"w": "the", "b": [0.6408, 0.149, 0.6717, 0.1687]}, {"w": "idea", "b": [0.678, 0.149, 0.72, 0.1687]}, {"w": "of", "b": [0.7263, 0.149, 0.7473, 0.1687]}, {"w": "separating", "b": [0.7536, 0.149, 0.8573, 0.1687]}, {"w": "the", "b": [0.1294, 0.1695, 0.1602, 0.1892]}, {"w": "learning", "b": [0.1665, 0.1695, 0.2492, 0.1892]}, {"w": "of", "b": [0.2555, 0.1695, 0.2765, 0.1892]}, {"w": "channel-wise", "b": [0.2828, 0.1695, 0.4159, 0.1892]}, {"w": "and", "b": [0.4222, 0.1695, 0.4587, 0.1892]}, {"w": "space-wise", "b": [0.4649, 0.1695, 0.5756, 0.1892]}, {"w": "features", "b": [0.5819, 0.1695, 0.6617, 0.1892]}, {"w": "to", "b": [0.668, 0.1695, 0.6877, 0.1892]}, {"w": "its", "b": [0.694, 0.1695, 0.7178, 0.1892]}, {"w": "logical", "b": [0.7241, 0.1695, 0.7928, 0.1892]}, {"w": "extreme,", "b": [0.1294, 0.19, 0.217, 0.2097]}, {"w": "and", "b": [0.2233, 0.19, 0.2597, 0.2097]}, {"w": "replaces", "b": [0.266, 0.19, 0.3486, 0.2097]}, {"w": "Inception", "b": [0.355, 0.19, 0.4502, 0.2097]}, {"w": "modules", "b": [0.4565, 0.19, 0.542, 0.2097]}, {"w": "with", "b": [0.5483, 0.19, 0.5932, 0.2097]}, {"w": "depthwise", "b": [0.5995, 0.19, 0.7018, 0.2097]}, {"w": "separable", "b": [0.7081, 0.19, 0.8033, 0.2097]}, {"w": "convolutions", "b": [0.1294, 0.2105, 0.2598, 0.2302]}, {"w": "consisting", "b": [0.2661, 0.2105, 0.3684, 0.2302]}, {"w": "of", "b": [0.3747, 0.2105, 0.3957, 0.2302]}, {"w": "a", "b": [0.402, 0.2105, 0.4132, 0.2302]}, {"w": "depthwise", "b": [0.4195, 0.2105, 0.5218, 0.2302]}, {"w": "convolution", "b": [0.5281, 0.2105, 0.6486, 0.2302]}, {"w": "(a", "b": [0.6549, 0.2105, 0.6745, 0.2302]}, {"w": "spatial", "b": [0.6808, 0.2105, 0.7467, 0.2302]}, {"w": "convolution", "b": [0.1294, 0.231, 0.2499, 0.2507]}, {"w": "where", "b": [0.2562, 0.231, 0.3179, 0.2507]}, {"w": "every", "b": [0.3242, 0.231, 0.3802, 0.2507]}, {"w": "input", "b": [0.3865, 0.231, 0.4384, 0.2507]}, {"w": "channel", "b": [0.4447, 0.231, 0.5231, 0.2507]}, {"w": "is", "b": [0.5294, 0.231, 0.5463, 0.2507]}, {"w": "handled", "b": [0.5526, 0.231, 0.6324, 0.2507]}, {"w": "separately)", "b": [0.6387, 0.231, 0.7494, 0.2507]}, {"w": "followed", "b": [0.7557, 0.231, 0.8454, 0.2507]}, {"w": "by", "b": [0.1294, 0.2515, 0.1546, 0.2712]}, {"w": "a", "b": [0.1609, 0.2515, 0.1721, 0.2712]}, {"w": "pointwise", "b": [0.1785, 0.2515, 0.2766, 0.2712]}, {"w": "convolution", "b": [0.2828, 0.2515, 0.4034, 0.2712]}, {"w": "(a", "b": [0.4097, 0.2515, 0.4293, 0.2712]}, {"w": "1", "b": [0.4356, 0.2515, 0.4482, 0.2712]}, {"w": "×", "b": [0.4545, 0.2515, 0.4687, 0.2712]}, {"w": "1", "b": [0.475, 0.2515, 0.4876, 0.2712]}, {"w": "convolution)—effectively,", "b": [0.494, 0.2515, 0.7601, 0.2712]}, {"w": "an", "b": [0.7664, 0.2515, 0.7902, 0.2712]}, {"w": "extreme", "b": [0.1294, 0.272, 0.2107, 0.2917]}, {"w": "form", "b": [0.217, 0.272, 0.266, 0.2917]}, {"w": "of", "b": [0.2723, 0.272, 0.2933, 0.2917]}, {"w": "an", "b": [0.2996, 0.272, 0.3234, 0.2917]}, {"w": "Inception", "b": [0.3298, 0.272, 0.425, 0.2917]}, {"w": "module,", "b": [0.4313, 0.272, 0.5133, 0.2917]}, {"w": "where", "b": [0.5196, 0.272, 0.5813, 0.2917]}, {"w": "spatial", "b": [0.5876, 0.272, 0.6534, 0.2917]}, {"w": "features", "b": [0.6597, 0.272, 0.7396, 0.2917]}, {"w": "and", "b": [0.7459, 0.272, 0.7823, 0.2917]}, {"w": "channel-wise", "b": [0.1294, 0.2925, 0.2625, 0.3122]}, {"w": "features", "b": [0.2688, 0.2925, 0.3486, 0.3122]}, {"w": "are", "b": [0.3549, 0.2925, 0.3857, 0.3122]}, {"w": "fully", "b": [0.392, 0.2925, 0.4397, 0.3122]}, {"w": "separated.", "b": [0.446, 0.2925, 0.5476, 0.3122]}, {"w": "Xception", "b": [0.5539, 0.2925, 0.6463, 0.3122]}, {"w": "has", "b": [0.6526, 0.2925, 0.6863, 0.3122]}, {"w": "roughly", "b": [0.6926, 0.2925, 0.7711, 0.3122]}, {"w": "the", "b": [0.7774, 0.2925, 0.8082, 0.3122]}, {"w": "same", "b": [0.8145, 0.2925, 0.8663, 0.3122]}, {"w": "number", "b": [0.1294, 0.313, 0.2065, 0.3327]}, {"w": "of", "b": [0.2128, 0.313, 0.2338, 0.3327]}, {"w": "parameters", "b": [0.2401, 0.313, 0.3508, 0.3327]}, {"w": "as", "b": [0.3571, 0.313, 0.3781, 0.3327]}, {"w": "Inception", "b": [0.3844, 0.313, 0.4797, 0.3327]}, {"w": "V3,", "b": [0.486, 0.313, 0.5231, 0.3327]}, {"w": "but", "b": [0.5294, 0.313, 0.5617, 0.3327]}, {"w": "it", "b": [0.568, 0.313, 0.582, 0.3327]}, {"w": "shows", "b": [0.5883, 0.313, 0.6514, 0.3327]}, {"w": "better", "b": [0.6577, 0.313, 0.7151, 0.3327]}, {"w": "runtime", "b": [0.7214, 0.313, 0.7999, 0.3327]}, {"w": "performance", "b": [0.1294, 0.3335, 0.2569, 0.3532]}, {"w": "and", "b": [0.2632, 0.3335, 0.2996, 0.3532]}, {"w": "higher", "b": [0.3059, 0.3335, 0.3704, 0.3532]}, {"w": "accuracy", "b": [0.3767, 0.3335, 0.4663, 0.3532]}, {"w": "on", "b": [0.4726, 0.3335, 0.4978, 0.3532]}, {"w": "ImageNet", "b": [0.5041, 0.3335, 0.6036, 0.3532]}, {"w": "as", "b": [0.6099, 0.3335, 0.6309, 0.3532]}, {"w": "well", "b": [0.6372, 0.3335, 0.6807, 0.3532]}, {"w": "as", "b": [0.687, 0.3335, 0.708, 0.3532]}, {"w": "other", "b": [0.7143, 0.3335, 0.7661, 0.3532]}, {"w": "large-", "b": [0.7724, 0.3335, 0.8307, 0.3532]}, {"w": "scale", "b": [0.1294, 0.354, 0.1798, 0.3737]}, {"w": "datasets,", "b": [0.1861, 0.354, 0.2723, 0.3737]}, {"w": "due", "b": [0.2786, 0.354, 0.315, 0.3737]}, {"w": "to", "b": [0.3214, 0.354, 0.341, 0.3737]}, {"w": "a", "b": [0.3473, 0.354, 0.3585, 0.3737]}, {"w": "more", "b": [0.3648, 0.354, 0.4166, 0.3737]}, {"w": "efficient", "b": [0.4229, 0.354, 0.5065, 0.3737]}, {"w": "use", "b": [0.5128, 0.354, 0.5464, 0.3737]}, {"w": "of", "b": [0.5527, 0.354, 0.5737, 0.3737]}, {"w": "model", "b": [0.58, 0.354, 0.6431, 0.3737]}, {"w": "parameters.", "b": [0.6494, 0.354, 0.7664, 0.3737]}]}, {"id": "b_2", "type": "paragraph", "text": "François Chollet, “Xception: Deep Learning with Depthwise Separable Convolutions,” Conference on Computer Vision and Pattern Recognition (2017), https://arxiv.org/abs/1610.02357.", "words": [{"w": "François", "b": [0.1483, 0.4194, 0.2135, 0.4342]}, {"w": "Chollet,", "b": [0.2182, 0.4194, 0.2787, 0.4342]}, {"w": "“Xception:", "b": [0.2834, 0.4194, 0.3664, 0.4342]}, {"w": "Deep", "b": [0.3711, 0.4194, 0.4111, 0.4342]}, {"w": "Learning", "b": [0.4158, 0.4194, 0.4841, 0.4342]}, {"w": "with", "b": [0.4888, 0.4194, 0.5225, 0.4342]}, {"w": "Depthwise", "b": [0.5272, 0.4194, 0.6081, 0.4342]}, {"w": "Separable", "b": [0.6128, 0.4194, 0.6874, 0.4342]}, {"w": "Convolutions,”", "b": [0.6922, 0.4194, 0.8073, 0.4342]}, {"w": "Conference", "b": [0.1483, 0.4346, 0.2355, 0.4494]}, {"w": "on", "b": [0.2403, 0.4346, 0.2592, 0.4494]}, {"w": "Computer", "b": [0.2639, 0.4346, 0.3396, 0.4494]}, {"w": "Vision", "b": [0.3443, 0.4346, 0.3936, 0.4494]}, {"w": "and", "b": [0.3984, 0.4346, 0.4257, 0.4494]}, {"w": "Pattern", "b": [0.4304, 0.4346, 0.484, 0.4494]}, {"w": "Recognition", "b": [0.4887, 0.4346, 0.5812, 0.4494]}, {"w": "(2017),", "b": [0.5859, 0.4346, 0.6411, 0.4494]}, {"w": "https://arxiv.org/abs/1610.02357.", "b": [0.1483, 0.4497, 0.3985, 0.4645]}]}, {"id": "b_3", "type": "paragraph", "text": "Residual connections", "words": [{"w": "Residual", "b": [0.1294, 0.4783, 0.1998, 0.4931]}, {"w": "connections", "b": [0.2046, 0.4783, 0.2992, 0.4931]}]}, {"id": "b_4", "type": "paragraph", "text": "Residual connections are a common graph-like network component found in many post-2015 network architectures, including Xception. They were introduced by He et al. from Microsoft in their winning entry in the ILSVRC ImageNet challenge in late 2015.[6] They tackle two common problems that plague any large-scale deep-learning model: vanishing gradients and representational bottlenecks. In general, adding residual connections to any model that has more than 10 layers is likely to be beneficial.", "words": [{"w": "Residual", "b": [0.1294, 0.5162, 0.2177, 0.5359]}, {"w": "connections", "b": [0.224, 0.5162, 0.3445, 0.5359]}, {"w": "are", "b": [0.3508, 0.5162, 0.3816, 0.5359]}, {"w": "a", "b": [0.3879, 0.5162, 0.3991, 0.5359]}, {"w": "common", "b": [0.4054, 0.5162, 0.4937, 0.5359]}, {"w": "graph-like", "b": [0.5, 0.5162, 0.6037, 0.5359]}, {"w": "network", "b": [0.61, 0.5162, 0.6926, 0.5359]}, {"w": "component", "b": [0.699, 0.5162, 0.8111, 0.5359]}, {"w": "found", "b": [0.1294, 0.5367, 0.1883, 0.5564]}, {"w": "in", "b": [0.1946, 0.5367, 0.2142, 0.5564]}, {"w": "many", "b": [0.2205, 0.5367, 0.2766, 0.5564]}, {"w": "post-2015", "b": [0.2829, 0.5367, 0.3838, 0.5564]}, {"w": "network", "b": [0.3901, 0.5367, 0.4727, 0.5564]}, {"w": "architectures,", "b": [0.479, 0.5367, 0.6142, 0.5564]}, {"w": "including", "b": [0.6205, 0.5367, 0.7158, 0.5564]}, {"w": "Xception.", "b": [0.7221, 0.5367, 0.8209, 0.5564]}, {"w": "They", "b": [0.1294, 0.5572, 0.1813, 0.5769]}, {"w": "were", "b": [0.1876, 0.5572, 0.2366, 0.5769]}, {"w": "introduced", "b": [0.2429, 0.5572, 0.3508, 0.5769]}, {"w": "by", "b": [0.357, 0.5572, 0.3823, 0.5769]}, {"w": "He", "b": [0.3886, 0.5572, 0.418, 0.5769]}, {"w": "et", "b": [0.4243, 0.5572, 0.4425, 0.5769]}, {"w": "al.", "b": [0.4488, 0.5572, 0.4733, 0.5769]}, {"w": "from", "b": [0.4796, 0.5572, 0.5287, 0.5769]}, {"w": "Microsoft", "b": [0.535, 0.5572, 0.6345, 0.5769]}, {"w": "in", "b": [0.6408, 0.5572, 0.6604, 0.5769]}, {"w": "their", "b": [0.6667, 0.5572, 0.7129, 0.5769]}, {"w": "winning", "b": [0.7193, 0.5572, 0.8019, 0.5769]}, {"w": "entry", "b": [0.8082, 0.5572, 0.8601, 0.5769]}, {"w": "in", "b": [0.1294, 0.5795, 0.149, 0.5992]}, {"w": "the", "b": [0.1553, 0.5795, 0.1862, 0.5992]}, {"w": "ILSVRC", "b": [0.1925, 0.5795, 0.2822, 0.5992]}, {"w": "ImageNet", "b": [0.2885, 0.5795, 0.388, 0.5992]}, {"w": "challenge", "b": [0.3943, 0.5795, 0.4909, 0.5992]}, {"w": "in", "b": [0.4972, 0.5795, 0.5169, 0.5992]}, {"w": "late", "b": [0.5232, 0.5795, 0.5596, 0.5992]}, {"w": "2015.[6]", "b": [0.5659, 0.5772, 0.6446, 0.5992]}, {"w": "They", "b": [0.6509, 0.5795, 0.7028, 0.5992]}, {"w": "tackle", "b": [0.7091, 0.5795, 0.7693, 0.5992]}, {"w": "two", "b": [0.7756, 0.5795, 0.8134, 0.5992]}, {"w": "common", "b": [0.1294, 0.6, 0.2177, 0.6197]}, {"w": "problems", "b": [0.224, 0.6, 0.3179, 0.6197]}, {"w": "that", "b": [0.3242, 0.6, 0.362, 0.6197]}, {"w": "plague", "b": [0.3684, 0.6, 0.4356, 0.6197]}, {"w": "any", "b": [0.4419, 0.6, 0.4783, 0.6197]}, {"w": "large-scale", "b": [0.4846, 0.6, 0.5934, 0.6197]}, {"w": "deep-learning", "b": [0.5997, 0.6, 0.7384, 0.6197]}, {"w": "model:", "b": [0.7447, 0.6, 0.8148, 0.6197]}, {"w": "vanishing", "b": [0.1294, 0.6205, 0.2275, 0.6402]}, {"w": "gradients", "b": [0.2338, 0.6205, 0.3263, 0.6402]}, {"w": "and", "b": [0.3326, 0.6205, 0.369, 0.6402]}, {"w": "representational", "b": [0.3753, 0.6205, 0.5365, 0.6402]}, {"w": "bottlenecks.", "b": [0.5427, 0.6205, 0.6639, 0.6402]}, {"w": "In", "b": [0.6702, 0.6205, 0.6912, 0.6402]}, {"w": "general,", "b": [0.6975, 0.6205, 0.7781, 0.6402]}, {"w": "adding", "b": [0.7844, 0.6205, 0.8531, 0.6402]}, {"w": "residual", "b": [0.1294, 0.641, 0.2093, 0.6607]}, {"w": "connections", "b": [0.2156, 0.641, 0.3361, 0.6607]}, {"w": "to", "b": [0.3424, 0.641, 0.362, 0.6607]}, {"w": "any", "b": [0.3683, 0.641, 0.4048, 0.6607]}, {"w": "model", "b": [0.4111, 0.641, 0.4741, 0.6607]}, {"w": "that", "b": [0.4804, 0.641, 0.5183, 0.6607]}, {"w": "has", "b": [0.5246, 0.641, 0.5582, 0.6607]}, {"w": "more", "b": [0.5645, 0.641, 0.6163, 0.6607]}, {"w": "than", "b": [0.6227, 0.641, 0.6661, 0.6607]}, {"w": "10", "b": [0.6724, 0.641, 0.6976, 0.6607]}, {"w": "layers", "b": [0.7039, 0.641, 0.7642, 0.6607]}, {"w": "is", "b": [0.7705, 0.641, 0.7873, 0.6607]}, {"w": "likely", "b": [0.7936, 0.641, 0.8511, 0.6607]}, {"w": "to", "b": [0.1294, 0.6615, 0.149, 0.6812]}, {"w": "be", "b": [0.1553, 0.6615, 0.1792, 0.6812]}, {"w": "beneficial.", "b": [0.1855, 0.6615, 0.2912, 0.6812]}]}, {"id": "b_6", "type": "paragraph", "text": "He et al., “Deep Residual Learning for Image Recognition,” https://arxiv.org/abs/1512.03385.", "words": [{"w": "He", "b": [0.1483, 0.7269, 0.1704, 0.7417]}, {"w": "et", "b": [0.1751, 0.7269, 0.1888, 0.7417]}, {"w": "al.,", "b": [0.1935, 0.7269, 0.2166, 0.7417]}, {"w": "“Deep", "b": [0.2214, 0.7269, 0.2697, 0.7417]}, {"w": "Residual", "b": [0.2744, 0.7269, 0.3406, 0.7417]}, {"w": "Learning", "b": [0.3454, 0.7269, 0.4137, 0.7417]}, {"w": "for", "b": [0.4184, 0.7269, 0.4404, 0.7417]}, {"w": "Image", "b": [0.4452, 0.7269, 0.4925, 0.7417]}, {"w": "Recognition,”", "b": [0.4972, 0.7269, 0.6028, 0.7417]}, {"w": "https://arxiv.org/abs/1512.03385.", "b": [0.1483, 0.7421, 0.3985, 0.7569]}]}, {"id": "b_7", "type": "paragraph", "text": "A residual connection consists of making the output of an earlier layer available as input to a later layer, effectively creating a shortcut in a sequential network. Rather than being concatenated to the later activation, the earlier output is summed with the later activation, which assumes that both activations are the same size. If they’re different sizes, you can use a linear transformation to reshape the earlier activation into", "words": [{"w": "A", "b": [0.1294, 0.78, 0.1476, 0.7998]}, {"w": "residual", "b": [0.1539, 0.78, 0.2338, 0.7998]}, {"w": "connection", "b": [0.2401, 0.78, 0.3508, 0.7998]}, {"w": "consists", "b": [0.3571, 0.78, 0.437, 0.7998]}, {"w": "of", "b": [0.4433, 0.78, 0.4643, 0.7998]}, {"w": "making", "b": [0.4706, 0.78, 0.5463, 0.7998]}, {"w": "the", "b": [0.5526, 0.78, 0.5834, 0.7998]}, {"w": "output", "b": [0.5897, 0.78, 0.6542, 0.7998]}, {"w": "of", "b": [0.6605, 0.78, 0.6815, 0.7998]}, {"w": "an", "b": [0.6878, 0.78, 0.7116, 0.7998]}, {"w": "earlier", "b": [0.718, 0.78, 0.7824, 0.7998]}, {"w": "layer", "b": [0.7887, 0.78, 0.8391, 0.7998]}, {"w": "available", "b": [0.1294, 0.8005, 0.2205, 0.8203]}, {"w": "as", "b": [0.2268, 0.8005, 0.2478, 0.8203]}, {"w": "input", "b": [0.2541, 0.8005, 0.306, 0.8203]}, {"w": "to", "b": [0.3123, 0.8005, 0.3319, 0.8203]}, {"w": "a", "b": [0.3382, 0.8005, 0.3494, 0.8203]}, {"w": "later", "b": [0.3557, 0.8005, 0.4005, 0.8203]}, {"w": "layer,", "b": [0.4068, 0.8005, 0.4625, 0.8203]}, {"w": "effectively", "b": [0.4688, 0.8005, 0.5762, 0.8203]}, {"w": "creating", "b": [0.5825, 0.8005, 0.6638, 0.8203]}, {"w": "a", "b": [0.67, 0.8005, 0.6812, 0.8203]}, {"w": "shortcut", "b": [0.6875, 0.8005, 0.7688, 0.8203]}, {"w": "in", "b": [0.7751, 0.8005, 0.7947, 0.8203]}, {"w": "a", "b": [0.801, 0.8005, 0.8122, 0.8203]}, {"w": "sequential", "b": [0.1294, 0.821, 0.2317, 0.8408]}, {"w": "network.", "b": [0.238, 0.821, 0.327, 0.8408]}, {"w": "Rather", "b": [0.3333, 0.821, 0.4005, 0.8408]}, {"w": "than", "b": [0.4068, 0.821, 0.4503, 0.8408]}, {"w": "being", "b": [0.4566, 0.821, 0.5126, 0.8408]}, {"w": "concatenated", "b": [0.5189, 0.821, 0.6506, 0.8408]}, {"w": "to", "b": [0.6569, 0.821, 0.6766, 0.8408]}, {"w": "the", "b": [0.6829, 0.821, 0.7137, 0.8408]}, {"w": "later", "b": [0.72, 0.821, 0.7648, 0.8408]}, {"w": "activation,", "b": [0.1294, 0.8415, 0.2352, 0.8613]}, {"w": "the", "b": [0.2415, 0.8415, 0.2723, 0.8613]}, {"w": "earlier", "b": [0.2786, 0.8415, 0.3431, 0.8613]}, {"w": "output", "b": [0.3494, 0.8415, 0.4139, 0.8613]}, {"w": "is", "b": [0.4202, 0.8415, 0.437, 0.8613]}, {"w": "summed", "b": [0.4433, 0.8415, 0.5288, 0.8613]}, {"w": "with", "b": [0.5351, 0.8415, 0.5799, 0.8613]}, {"w": "the", "b": [0.5862, 0.8415, 0.617, 0.8613]}, {"w": "later", "b": [0.6233, 0.8415, 0.6681, 0.8613]}, {"w": "activation,", "b": [0.6744, 0.8415, 0.7802, 0.8613]}, {"w": "which", "b": [0.7865, 0.8415, 0.8482, 0.8613]}, {"w": "assumes", "b": [0.1294, 0.862, 0.2135, 0.8818]}, {"w": "that", "b": [0.2198, 0.862, 0.2576, 0.8818]}, {"w": "both", "b": [0.2639, 0.862, 0.3088, 0.8818]}, {"w": "activations", "b": [0.3151, 0.862, 0.4244, 0.8818]}, {"w": "are", "b": [0.4307, 0.862, 0.4615, 0.8818]}, {"w": "the", "b": [0.4678, 0.862, 0.4986, 0.8818]}, {"w": "same", "b": [0.5049, 0.862, 0.5568, 0.8818]}, {"w": "size.", "b": [0.5631, 0.862, 0.6086, 0.8818]}, {"w": "If", "b": [0.6149, 0.862, 0.6317, 0.8818]}, {"w": "they’re", "b": [0.638, 0.862, 0.7095, 0.8818]}, {"w": "different", "b": [0.7158, 0.862, 0.8021, 0.8818]}, {"w": "sizes,", "b": [0.8084, 0.862, 0.8637, 0.8818]}, {"w": "you", "b": [0.1294, 0.8825, 0.1673, 0.9023]}, {"w": "can", "b": [0.1736, 0.8825, 0.2086, 0.9023]}, {"w": "use", "b": [0.2149, 0.8825, 0.2485, 0.9023]}, {"w": "a", "b": [0.2548, 0.8825, 0.266, 0.9023]}, {"w": "linear", "b": [0.2723, 0.8825, 0.3298, 0.9023]}, {"w": "transformation", "b": [0.336, 0.8825, 0.4846, 0.9023]}, {"w": "to", "b": [0.4909, 0.8825, 0.5105, 0.9023]}, {"w": "reshape", "b": [0.5168, 0.8825, 0.5938, 0.9023]}, {"w": "the", "b": [0.6001, 0.8825, 0.631, 0.9023]}, {"w": "earlier", "b": [0.6373, 0.8825, 0.7017, 0.9023]}, {"w": "activation", "b": [0.708, 0.8825, 0.8075, 0.9023]}, {"w": "into", "b": [0.8138, 0.8825, 0.8531, 0.9023]}]}]}, {"page": 321, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "the target shape (for example, a Dense layer without an activation or, for convolutional feature maps, a 1 × 1 convolution without an activation).", "words": [{"w": "the", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "target", "b": [0.1665, 0.0857, 0.2235, 0.1054]}, {"w": "shape", "b": [0.2298, 0.0857, 0.2873, 0.1054]}, {"w": "(for", "b": [0.2936, 0.0857, 0.3314, 0.1054]}, {"w": "example,", "b": [0.3377, 0.0857, 0.4295, 0.1054]}, {"w": "a", "b": [0.4358, 0.0857, 0.447, 0.1054]}, {"w": "Dense", "b": [0.4532, 0.0867, 0.5289, 0.1069]}, {"w": "layer", "b": [0.5352, 0.0857, 0.5856, 0.1054]}, {"w": "without", "b": [0.5919, 0.0857, 0.669, 0.1054]}, {"w": "an", "b": [0.6753, 0.0857, 0.6992, 0.1054]}, {"w": "activation", "b": [0.7055, 0.0857, 0.805, 0.1054]}, {"w": "or,", "b": [0.8113, 0.0857, 0.8375, 0.1054]}, {"w": "for", "b": [0.1294, 0.1071, 0.1588, 0.1268]}, {"w": "convolutional", "b": [0.1651, 0.1071, 0.3039, 0.1268]}, {"w": "feature", "b": [0.3102, 0.1071, 0.3802, 0.1268]}, {"w": "maps,", "b": [0.3865, 0.1071, 0.4461, 0.1268]}, {"w": "a", "b": [0.4524, 0.1071, 0.4636, 0.1268]}, {"w": "1", "b": [0.4699, 0.1071, 0.4825, 0.1268]}, {"w": "×", "b": [0.4888, 0.1071, 0.503, 0.1268]}, {"w": "1", "b": [0.5093, 0.1071, 0.522, 0.1268]}, {"w": "convolution", "b": [0.5283, 0.1071, 0.6488, 0.1268]}, {"w": "without", "b": [0.6551, 0.1071, 0.7322, 0.1268]}, {"w": "an", "b": [0.7385, 0.1071, 0.7623, 0.1268]}, {"w": "activation).", "b": [0.1294, 0.1276, 0.2436, 0.1473]}]}, {"id": "b_1", "type": "paragraph", "text": "Here’s how to implement a residual connection in Keras when the feature-map sizes are the same, using identity residual connections. This example assumes the existence of a 4D input tensor x:", "words": [{"w": "Here’s", "b": [0.1294, 0.1704, 0.1952, 0.1901]}, {"w": "how", "b": [0.2016, 0.1704, 0.245, 0.1901]}, {"w": "to", "b": [0.2513, 0.1704, 0.2709, 0.1901]}, {"w": "implement", "b": [0.2772, 0.1704, 0.3851, 0.1901]}, {"w": "a", "b": [0.3914, 0.1704, 0.4026, 0.1901]}, {"w": "residual", "b": [0.409, 0.1704, 0.4888, 0.1901]}, {"w": "connection", "b": [0.4951, 0.1704, 0.6058, 0.1901]}, {"w": "in", "b": [0.6121, 0.1704, 0.6318, 0.1901]}, {"w": "Keras", "b": [0.6381, 0.1704, 0.6969, 0.1901]}, {"w": "when", "b": [0.7032, 0.1704, 0.7578, 0.1901]}, {"w": "the", "b": [0.7641, 0.1704, 0.795, 0.1901]}, {"w": "feature-map", "b": [0.1294, 0.1909, 0.2513, 0.2106]}, {"w": "sizes", "b": [0.2576, 0.1909, 0.3066, 0.2106]}, {"w": "are", "b": [0.3129, 0.1909, 0.3437, 0.2106]}, {"w": "the", "b": [0.35, 0.1909, 0.3809, 0.2106]}, {"w": "same,", "b": [0.3872, 0.1909, 0.4453, 0.2106]}, {"w": "using", "b": [0.4516, 0.1909, 0.5063, 0.2106]}, {"w": "identity", "b": [0.5126, 0.1909, 0.5897, 0.2106]}, {"w": "residual", "b": [0.596, 0.1909, 0.6759, 0.2106]}, {"w": "connections.", "b": [0.6822, 0.1909, 0.809, 0.2106]}, {"w": "This", "b": [0.8152, 0.1909, 0.86, 0.2106]}, {"w": "example", "b": [0.1294, 0.2114, 0.2149, 0.2311]}, {"w": "assumes", "b": [0.2212, 0.2114, 0.3053, 0.2311]}, {"w": "the", "b": [0.3116, 0.2114, 0.3424, 0.2311]}, {"w": "existence", "b": [0.3487, 0.2114, 0.4426, 0.2311]}, {"w": "of", "b": [0.4489, 0.2114, 0.4699, 0.2311]}, {"w": "a", "b": [0.4762, 0.2114, 0.4874, 0.2311]}, {"w": "4D", "b": [0.4937, 0.2114, 0.5245, 0.2311]}, {"w": "input", "b": [0.5308, 0.2114, 0.5827, 0.2311]}, {"w": "tensor", "b": [0.589, 0.2114, 0.6507, 0.2311]}, {"w": "x:", "b": [0.6569, 0.2114, 0.679, 0.2326]}]}, {"id": "b_2", "type": "paragraph", "text": "from keras import layers x = ... y = layers.Conv2D(128, 3, activation='relu', padding='same')(x) 1 y = layers.Conv2D(128, 3, activation='relu', padding='same')(y) y = layers.Conv2D(128, 3, activation='relu', padding='same')(y) y = layers.add([y, x]) 2", "words": [{"w": "from", "b": [0.1357, 0.25, 0.1811, 0.2651]}, {"w": "keras", "b": [0.1925, 0.25, 0.2492, 0.2651]}, {"w": "import", "b": [0.2606, 0.25, 0.3287, 0.2651]}, {"w": "layers", "b": [0.34, 0.25, 0.4082, 0.2651]}, {"w": "x", "b": [0.1357, 0.2803, 0.1471, 0.2954]}, {"w": "=", "b": [0.1584, 0.2803, 0.1698, 0.2954]}, {"w": "...", "b": [0.1811, 0.2803, 0.2152, 0.2954]}, {"w": "y", "b": [0.1357, 0.2954, 0.1471, 0.3106]}, {"w": "=", "b": [0.1584, 0.2954, 0.1698, 0.3106]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.2954, 0.3855, 0.3106]}, {"w": "3,", "b": [0.3968, 0.2954, 0.4195, 0.3106]}, {"w": "activation='relu',", "b": [0.4309, 0.2954, 0.6352, 0.3106]}, {"w": "padding='same')(x)", "b": [0.6465, 0.2954, 0.8509, 0.3106]}, {"w": "1", "b": [0.1357, 0.3106, 0.1471, 0.3257]}, {"w": "y", "b": [0.1357, 0.3257, 0.1471, 0.3409]}, {"w": "=", "b": [0.1584, 0.3257, 0.1698, 0.3409]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.3257, 0.3855, 0.3409]}, {"w": "3,", "b": [0.3968, 0.3257, 0.4195, 0.3409]}, {"w": "activation='relu',", "b": [0.4309, 0.3257, 0.6352, 0.3409]}, {"w": "padding='same')(y)", "b": [0.6465, 0.3257, 0.8509, 0.3409]}, {"w": "y", "b": [0.1357, 0.3409, 0.1471, 0.356]}, {"w": "=", "b": [0.1584, 0.3409, 0.1698, 0.356]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.3409, 0.3855, 0.356]}, {"w": "3,", "b": [0.3968, 0.3409, 0.4195, 0.356]}, {"w": "activation='relu',", "b": [0.4309, 0.3409, 0.6352, 0.356]}, {"w": "padding='same')(y)", "b": [0.6465, 0.3409, 0.8509, 0.356]}, {"w": "y", "b": [0.1357, 0.3712, 0.1471, 0.3863]}, {"w": "=", "b": [0.1584, 0.3712, 0.1698, 0.3863]}, {"w": "layers.add([y,", "b": [0.1811, 0.3712, 0.34, 0.3863]}, {"w": "x])", "b": [0.3514, 0.3712, 0.3855, 0.3863]}, {"w": "2", "b": [0.1357, 0.3863, 0.1471, 0.4015]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Applies a transformation to x 2 Adds the original x back to the output features", "words": [{"w": "1", "b": [0.1799, 0.4199, 0.1925, 0.4397]}, {"w": "Applies", "b": [0.1988, 0.4199, 0.2801, 0.4397]}, {"w": "a", "b": [0.2864, 0.4199, 0.299, 0.4397]}, {"w": "transformation", "b": [0.3053, 0.4199, 0.4693, 0.4397]}, {"w": "to", "b": [0.4756, 0.4199, 0.4966, 0.4397]}, {"w": "x", "b": [0.5029, 0.4199, 0.5155, 0.4397]}, {"w": "2", "b": [0.1799, 0.4404, 0.1925, 0.4602]}, {"w": "Adds", "b": [0.1988, 0.4404, 0.2549, 0.4602]}, {"w": "the", "b": [0.2612, 0.4404, 0.2948, 0.4602]}, {"w": "original", "b": [0.3011, 0.4404, 0.3852, 0.4602]}, {"w": "x", "b": [0.3915, 0.4404, 0.4041, 0.4602]}, {"w": "back", "b": [0.4104, 0.4404, 0.4623, 0.4602]}, {"w": "to", "b": [0.4686, 0.4404, 0.4896, 0.4602]}, {"w": "the", "b": [0.4959, 0.4404, 0.5295, 0.4602]}, {"w": "output", "b": [0.5358, 0.4404, 0.6073, 0.4602]}, {"w": "features", "b": [0.6136, 0.4404, 0.7001, 0.4602]}]}, {"id": "b_4", "type": "paragraph", "text": "And the following implements a residual connection when the feature- map sizes differ, using a linear residual connection (again, assuming the existence of a 4D input tensor x):", "words": [{"w": "And", "b": [0.1294, 0.4832, 0.1729, 0.5029]}, {"w": "the", "b": [0.1792, 0.4832, 0.21, 0.5029]}, {"w": "following", "b": [0.2163, 0.4832, 0.3144, 0.5029]}, {"w": "implements", "b": [0.3207, 0.4832, 0.4384, 0.5029]}, {"w": "a", "b": [0.4447, 0.4832, 0.4559, 0.5029]}, {"w": "residual", "b": [0.4622, 0.4832, 0.5421, 0.5029]}, {"w": "connection", "b": [0.5484, 0.4832, 0.6591, 0.5029]}, {"w": "when", "b": [0.6654, 0.4832, 0.72, 0.5029]}, {"w": "the", "b": [0.7264, 0.4832, 0.7572, 0.5029]}, {"w": "feature-", "b": [0.7635, 0.4832, 0.8419, 0.5029]}, {"w": "map", "b": [0.1294, 0.5037, 0.1729, 0.5234]}, {"w": "sizes", "b": [0.1792, 0.5037, 0.2282, 0.5234]}, {"w": "differ,", "b": [0.2345, 0.5037, 0.2954, 0.5234]}, {"w": "using", "b": [0.3017, 0.5037, 0.3563, 0.5234]}, {"w": "a", "b": [0.3626, 0.5037, 0.3738, 0.5234]}, {"w": "linear", "b": [0.3801, 0.5037, 0.4376, 0.5234]}, {"w": "residual", "b": [0.4439, 0.5037, 0.5237, 0.5234]}, {"w": "connection", "b": [0.5301, 0.5037, 0.6407, 0.5234]}, {"w": "(again,", "b": [0.647, 0.5037, 0.7164, 0.5234]}, {"w": "assuming", "b": [0.7226, 0.5037, 0.8179, 0.5234]}, {"w": "the", "b": [0.8242, 0.5037, 0.8551, 0.5234]}, {"w": "existence", "b": [0.1294, 0.5242, 0.2233, 0.5439]}, {"w": "of", "b": [0.2296, 0.5242, 0.2506, 0.5439]}, {"w": "a", "b": [0.2569, 0.5242, 0.2681, 0.5439]}, {"w": "4D", "b": [0.2744, 0.5242, 0.3052, 0.5439]}, {"w": "input", "b": [0.3115, 0.5242, 0.3634, 0.5439]}, {"w": "tensor", "b": [0.3697, 0.5242, 0.4314, 0.5439]}, {"w": "x):", "b": [0.4376, 0.5242, 0.4682, 0.5454]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras import layers x = ... y = layers.Conv2D(128, 3, activation='relu', padding='same')(x) y = layers.Conv2D(128, 3, activation='relu', padding='same')(y) y = layers.MaxPooling2D(2, strides=2)(y) residual = layers.Conv2D(128, 1, strides=2, padding='same')(x) 1 y = layers.add([y, residual]) 2", "words": [{"w": "from", "b": [0.1357, 0.5628, 0.1811, 0.578]}, {"w": "keras", "b": [0.1925, 0.5628, 0.2492, 0.578]}, {"w": "import", "b": [0.2606, 0.5628, 0.3287, 0.578]}, {"w": "layers", "b": [0.34, 0.5628, 0.4082, 0.578]}, {"w": "x", "b": [0.1357, 0.5931, 0.1471, 0.6083]}, {"w": "=", "b": [0.1584, 0.5931, 0.1698, 0.6083]}, {"w": "...", "b": [0.1811, 0.5931, 0.2152, 0.6083]}, {"w": "y", "b": [0.1357, 0.6083, 0.1471, 0.6234]}, {"w": "=", "b": [0.1584, 0.6083, 0.1698, 0.6234]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.6083, 0.3855, 0.6234]}, {"w": "3,", "b": [0.3968, 0.6083, 0.4195, 0.6234]}, {"w": "activation='relu',", "b": [0.4309, 0.6083, 0.6352, 0.6234]}, {"w": "padding='same')(x)", "b": [0.6465, 0.6083, 0.8509, 0.6234]}, {"w": "y", "b": [0.1357, 0.6234, 0.1471, 0.6386]}, {"w": "=", "b": [0.1584, 0.6234, 0.1698, 0.6386]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.6234, 0.3855, 0.6386]}, {"w": "3,", "b": [0.3968, 0.6234, 0.4195, 0.6386]}, {"w": "activation='relu',", "b": [0.4309, 0.6234, 0.6352, 0.6386]}, {"w": "padding='same')(y)", "b": [0.6465, 0.6234, 0.8509, 0.6386]}, {"w": "y", "b": [0.1357, 0.6386, 0.1471, 0.6537]}, {"w": "=", "b": [0.1584, 0.6386, 0.1698, 0.6537]}, {"w": "layers.MaxPooling2D(2,", "b": [0.1811, 0.6386, 0.4309, 0.6537]}, {"w": "strides=2)(y)", "b": [0.4422, 0.6386, 0.5898, 0.6537]}, {"w": "residual", "b": [0.1357, 0.6689, 0.2265, 0.684]}, {"w": "=", "b": [0.2379, 0.6689, 0.2492, 0.684]}, {"w": "layers.Conv2D(128,", "b": [0.2606, 0.6689, 0.4649, 0.684]}, {"w": "1,", "b": [0.4763, 0.6689, 0.499, 0.684]}, {"w": "strides=2,", "b": [0.5103, 0.6689, 0.6238, 0.684]}, {"w": "padding='same')(x)", "b": [0.6352, 0.6689, 0.8395, 0.684]}, {"w": "1", "b": [0.1357, 0.684, 0.1471, 0.6992]}, {"w": "y", "b": [0.1357, 0.7144, 0.1471, 0.7295]}, {"w": "=", "b": [0.1584, 0.7144, 0.1698, 0.7295]}, {"w": "layers.add([y,", "b": [0.1811, 0.7144, 0.34, 0.7295]}, {"w": "residual])", "b": [0.3514, 0.7144, 0.4649, 0.7295]}, {"w": "2", "b": [0.1357, 0.7295, 0.1471, 0.7446]}]}, {"id": "b_6", "type": "paragraph", "text": "1 Uses a 1 × 1 convolution to linearly downsample the original x tensor to the same shape as y 2 Adds the residual tensor back to the output features", "words": [{"w": "1", "b": [0.1799, 0.7631, 0.1925, 0.7828]}, {"w": "Uses", "b": [0.1988, 0.7631, 0.2478, 0.7828]}, {"w": "a", "b": [0.2541, 0.7631, 0.2667, 0.7828]}, {"w": "1", "b": [0.273, 0.7631, 0.2857, 0.7828]}, {"w": "×", "b": [0.292, 0.7631, 0.3063, 0.7828]}, {"w": "1", "b": [0.3127, 0.7631, 0.3253, 0.7828]}, {"w": "convolution", "b": [0.3316, 0.7631, 0.4577, 0.7828]}, {"w": "to", "b": [0.464, 0.7631, 0.485, 0.7828]}, {"w": "linearly", "b": [0.4914, 0.7631, 0.574, 0.7828]}, {"w": "downsample", "b": [0.5803, 0.7631, 0.7149, 0.7828]}, {"w": "the", "b": [0.7212, 0.7631, 0.7548, 0.7828]}, {"w": "original", "b": [0.7611, 0.7631, 0.8452, 0.7828]}, {"w": "x", "b": [0.8515, 0.7631, 0.8642, 0.7828]}, {"w": "tensor", "b": [0.1799, 0.7836, 0.2471, 0.8033]}, {"w": "to", "b": [0.2534, 0.7836, 0.2744, 0.8033]}, {"w": "the", "b": [0.2807, 0.7836, 0.3144, 0.8033]}, {"w": "same", "b": [0.3207, 0.7836, 0.3753, 0.8033]}, {"w": "shape", "b": [0.3816, 0.7836, 0.4433, 0.8033]}, {"w": "as", "b": [0.4496, 0.7836, 0.472, 0.8033]}, {"w": "y", "b": [0.4783, 0.7836, 0.4909, 0.8033]}, {"w": "2", "b": [0.1799, 0.8041, 0.1925, 0.8238]}, {"w": "Adds", "b": [0.1988, 0.8041, 0.2549, 0.8238]}, {"w": "the", "b": [0.2612, 0.8041, 0.2948, 0.8238]}, {"w": "residual", "b": [0.3011, 0.8041, 0.3876, 0.8238]}, {"w": "tensor", "b": [0.3939, 0.8041, 0.4611, 0.8238]}, {"w": "back", "b": [0.4674, 0.8041, 0.5193, 0.8238]}, {"w": "to", "b": [0.5256, 0.8041, 0.5466, 0.8238]}, {"w": "the", "b": [0.5529, 0.8041, 0.5865, 0.8238]}, {"w": "output", "b": [0.5928, 0.8041, 0.6643, 0.8238]}, {"w": "features", "b": [0.6706, 0.8041, 0.7571, 0.8238]}]}, {"id": "b_7", "type": "paragraph", "text": "Representational bottlenecks in deep learning", "words": [{"w": "Representational", "b": [0.1294, 0.8513, 0.3125, 0.8711]}, {"w": "bottlenecks", "b": [0.3188, 0.8513, 0.4407, 0.8711]}, {"w": "in", "b": [0.4471, 0.8513, 0.4681, 0.8711]}, {"w": "deep", "b": [0.4744, 0.8513, 0.5248, 0.8711]}, {"w": "learning", "b": [0.5312, 0.8513, 0.6209, 0.8711]}]}]}, {"page": 322, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In a Sequential model, each successive representation layer is built on top of the previous one, which means it only has access to information contained in the activation of the previous layer. If one layer is too small (for example, it has features that are too low-dimensional), then the model will be constrained by how much information can be crammed into the activations of this layer.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "a", "b": [0.1567, 0.0857, 0.1679, 0.1054]}, {"w": "Sequential", "b": [0.1742, 0.0867, 0.3256, 0.1069]}, {"w": "model,", "b": [0.3319, 0.0857, 0.4013, 0.1054]}, {"w": "each", "b": [0.4076, 0.0857, 0.4538, 0.1054]}, {"w": "successive", "b": [0.4601, 0.0857, 0.5666, 0.1054]}, {"w": "representation", "b": [0.5729, 0.0857, 0.7158, 0.1054]}, {"w": "layer", "b": [0.7221, 0.0857, 0.7725, 0.1054]}, {"w": "is", "b": [0.7788, 0.0857, 0.7957, 0.1054]}, {"w": "built", "b": [0.802, 0.0857, 0.8482, 0.1054]}, {"w": "on", "b": [0.1294, 0.1071, 0.1546, 0.1268]}, {"w": "top", "b": [0.1609, 0.1071, 0.1932, 0.1268]}, {"w": "of", "b": [0.1995, 0.1071, 0.2205, 0.1268]}, {"w": "the", "b": [0.2268, 0.1071, 0.2576, 0.1268]}, {"w": "previous", "b": [0.2639, 0.1071, 0.3508, 0.1268]}, {"w": "one,", "b": [0.3571, 0.1071, 0.3999, 0.1268]}, {"w": "which", "b": [0.4062, 0.1071, 0.4678, 0.1268]}, {"w": "means", "b": [0.4741, 0.1071, 0.5386, 0.1268]}, {"w": "it", "b": [0.5449, 0.1071, 0.5589, 0.1268]}, {"w": "only", "b": [0.5652, 0.1071, 0.6101, 0.1268]}, {"w": "has", "b": [0.6164, 0.1071, 0.65, 0.1268]}, {"w": "access", "b": [0.6563, 0.1071, 0.7207, 0.1268]}, {"w": "to", "b": [0.727, 0.1071, 0.7467, 0.1268]}, {"w": "information", "b": [0.1294, 0.1276, 0.2485, 0.1473]}, {"w": "contained", "b": [0.2548, 0.1276, 0.3529, 0.1473]}, {"w": "in", "b": [0.3592, 0.1276, 0.3788, 0.1473]}, {"w": "the", "b": [0.3851, 0.1276, 0.416, 0.1473]}, {"w": "activation", "b": [0.4223, 0.1276, 0.5218, 0.1473]}, {"w": "of", "b": [0.5281, 0.1276, 0.5491, 0.1473]}, {"w": "the", "b": [0.5554, 0.1276, 0.5862, 0.1473]}, {"w": "previous", "b": [0.5925, 0.1276, 0.6794, 0.1473]}, {"w": "layer.", "b": [0.6857, 0.1276, 0.7409, 0.1473]}, {"w": "If", "b": [0.7473, 0.1276, 0.7641, 0.1473]}, {"w": "one", "b": [0.7704, 0.1276, 0.8068, 0.1473]}, {"w": "layer", "b": [0.8131, 0.1276, 0.8635, 0.1473]}, {"w": "is", "b": [0.1294, 0.1481, 0.1462, 0.1678]}, {"w": "too", "b": [0.1525, 0.1481, 0.1848, 0.1678]}, {"w": "small", "b": [0.1911, 0.1481, 0.2458, 0.1678]}, {"w": "(for", "b": [0.2521, 0.1481, 0.2899, 0.1678]}, {"w": "example,", "b": [0.2962, 0.1481, 0.388, 0.1678]}, {"w": "it", "b": [0.3943, 0.1481, 0.4083, 0.1678]}, {"w": "has", "b": [0.4146, 0.1481, 0.4482, 0.1678]}, {"w": "features", "b": [0.4545, 0.1481, 0.5344, 0.1678]}, {"w": "that", "b": [0.5407, 0.1481, 0.5785, 0.1678]}, {"w": "are", "b": [0.5848, 0.1481, 0.6156, 0.1678]}, {"w": "too", "b": [0.6219, 0.1481, 0.6542, 0.1678]}, {"w": "low-dimensional),", "b": [0.6605, 0.1481, 0.8447, 0.1678]}, {"w": "then", "b": [0.1294, 0.1686, 0.1729, 0.1883]}, {"w": "the", "b": [0.1792, 0.1686, 0.21, 0.1883]}, {"w": "model", "b": [0.2163, 0.1686, 0.2794, 0.1883]}, {"w": "will", "b": [0.2857, 0.1686, 0.3249, 0.1883]}, {"w": "be", "b": [0.3312, 0.1686, 0.355, 0.1883]}, {"w": "constrained", "b": [0.3613, 0.1686, 0.4776, 0.1883]}, {"w": "by", "b": [0.4839, 0.1686, 0.5092, 0.1883]}, {"w": "how", "b": [0.5155, 0.1686, 0.5589, 0.1883]}, {"w": "much", "b": [0.5652, 0.1686, 0.6213, 0.1883]}, {"w": "information", "b": [0.6276, 0.1686, 0.7467, 0.1883]}, {"w": "can", "b": [0.753, 0.1686, 0.788, 0.1883]}, {"w": "be", "b": [0.7943, 0.1686, 0.8181, 0.1883]}, {"w": "crammed", "b": [0.1294, 0.1891, 0.2233, 0.2088]}, {"w": "into", "b": [0.2296, 0.1891, 0.2688, 0.2088]}, {"w": "the", "b": [0.2751, 0.1891, 0.306, 0.2088]}, {"w": "activations", "b": [0.3123, 0.1891, 0.4216, 0.2088]}, {"w": "of", "b": [0.4279, 0.1891, 0.4489, 0.2088]}, {"w": "this", "b": [0.4552, 0.1891, 0.4917, 0.2088]}, {"w": "layer.", "b": [0.498, 0.1891, 0.5532, 0.2088]}]}, {"id": "b_1", "type": "paragraph", "text": "You can grasp this concept with a signal-processing analogy: if you have an audio-processing pipeline that consists of a series of operations, each of which takes as input the output of the previous operation, then if one operation crops your signal to a low-frequency range (for example, 0–15 kHz), the operations downstream will never be able to recover the dropped frequencies. Any loss of information is permanent. Residual connections, by reinjecting earlier information downstream, partially solve this issue for deep-learning models.", "words": [{"w": "You", "b": [0.1294, 0.2319, 0.1703, 0.2516]}, {"w": "can", "b": [0.1766, 0.2319, 0.2116, 0.2516]}, {"w": "grasp", "b": [0.218, 0.2319, 0.2726, 0.2516]}, {"w": "this", "b": [0.2789, 0.2319, 0.3154, 0.2516]}, {"w": "concept", "b": [0.3217, 0.2319, 0.4001, 0.2516]}, {"w": "with", "b": [0.4064, 0.2319, 0.4513, 0.2516]}, {"w": "a", "b": [0.4576, 0.2319, 0.4688, 0.2516]}, {"w": "signal-processing", "b": [0.4751, 0.2319, 0.6516, 0.2516]}, {"w": "analogy:", "b": [0.6579, 0.2319, 0.7448, 0.2516]}, {"w": "if", "b": [0.7511, 0.2319, 0.7665, 0.2516]}, {"w": "you", "b": [0.7728, 0.2319, 0.8107, 0.2516]}, {"w": "have", "b": [0.817, 0.2319, 0.8646, 0.2516]}, {"w": "an", "b": [0.1294, 0.2524, 0.1532, 0.2721]}, {"w": "audio-processing", "b": [0.1595, 0.2524, 0.3319, 0.2721]}, {"w": "pipeline", "b": [0.3382, 0.2524, 0.4195, 0.2721]}, {"w": "that", "b": [0.4258, 0.2524, 0.4636, 0.2721]}, {"w": "consists", "b": [0.4699, 0.2524, 0.5498, 0.2721]}, {"w": "of", "b": [0.5561, 0.2524, 0.5771, 0.2721]}, {"w": "a", "b": [0.5834, 0.2524, 0.5946, 0.2721]}, {"w": "series", "b": [0.6009, 0.2524, 0.6584, 0.2721]}, {"w": "of", "b": [0.6646, 0.2524, 0.6856, 0.2721]}, {"w": "operations,", "b": [0.6919, 0.2524, 0.8033, 0.2721]}, {"w": "each", "b": [0.8096, 0.2524, 0.8558, 0.2721]}, {"w": "of", "b": [0.1294, 0.2729, 0.1504, 0.2926]}, {"w": "which", "b": [0.1567, 0.2729, 0.2184, 0.2926]}, {"w": "takes", "b": [0.2247, 0.2729, 0.2765, 0.2926]}, {"w": "as", "b": [0.2828, 0.2729, 0.3038, 0.2926]}, {"w": "input", "b": [0.3102, 0.2729, 0.362, 0.2926]}, {"w": "the", "b": [0.3683, 0.2729, 0.3992, 0.2926]}, {"w": "output", "b": [0.4055, 0.2729, 0.4699, 0.2926]}, {"w": "of", "b": [0.4762, 0.2729, 0.4973, 0.2926]}, {"w": "the", "b": [0.5036, 0.2729, 0.5344, 0.2926]}, {"w": "previous", "b": [0.5407, 0.2729, 0.6276, 0.2926]}, {"w": "operation,", "b": [0.6339, 0.2729, 0.7355, 0.2926]}, {"w": "then", "b": [0.7418, 0.2729, 0.7852, 0.2926]}, {"w": "if", "b": [0.7915, 0.2729, 0.8069, 0.2926]}, {"w": "one", "b": [0.8132, 0.2729, 0.8497, 0.2926]}, {"w": "operation", "b": [0.1294, 0.2934, 0.2247, 0.3131]}, {"w": "crops", "b": [0.231, 0.2934, 0.2856, 0.3131]}, {"w": "your", "b": [0.2919, 0.2934, 0.3382, 0.3131]}, {"w": "signal", "b": [0.3445, 0.2934, 0.4048, 0.3131]}, {"w": "to", "b": [0.411, 0.2934, 0.4307, 0.3131]}, {"w": "a", "b": [0.437, 0.2934, 0.4482, 0.3131]}, {"w": "low-frequency", "b": [0.4545, 0.2934, 0.6016, 0.3131]}, {"w": "range", "b": [0.6079, 0.2934, 0.6639, 0.3131]}, {"w": "(for", "b": [0.6702, 0.2934, 0.708, 0.3131]}, {"w": "example,", "b": [0.7143, 0.2934, 0.8061, 0.3131]}, {"w": "0–15", "b": [0.8124, 0.2934, 0.8629, 0.3131]}, {"w": "kHz),", "b": [0.1294, 0.3139, 0.1861, 0.3336]}, {"w": "the", "b": [0.1925, 0.3139, 0.2233, 0.3336]}, {"w": "operations", "b": [0.2296, 0.3139, 0.3347, 0.3336]}, {"w": "downstream", "b": [0.341, 0.3139, 0.4643, 0.3336]}, {"w": "will", "b": [0.4706, 0.3139, 0.5098, 0.3336]}, {"w": "never", "b": [0.5161, 0.3139, 0.5722, 0.3336]}, {"w": "be", "b": [0.5785, 0.3139, 0.6023, 0.3336]}, {"w": "able", "b": [0.6086, 0.3139, 0.6506, 0.3336]}, {"w": "to", "b": [0.6569, 0.3139, 0.6766, 0.3336]}, {"w": "recover", "b": [0.6829, 0.3139, 0.7585, 0.3336]}, {"w": "the", "b": [0.7648, 0.3139, 0.7956, 0.3336]}, {"w": "dropped", "b": [0.1294, 0.3344, 0.2121, 0.3541]}, {"w": "frequencies.", "b": [0.2184, 0.3344, 0.341, 0.3541]}, {"w": "Any", "b": [0.3472, 0.3344, 0.3907, 0.3541]}, {"w": "loss", "b": [0.397, 0.3344, 0.4362, 0.3541]}, {"w": "of", "b": [0.4425, 0.3344, 0.4636, 0.3541]}, {"w": "information", "b": [0.4699, 0.3344, 0.589, 0.3541]}, {"w": "is", "b": [0.5953, 0.3344, 0.6121, 0.3541]}, {"w": "permanent.", "b": [0.6184, 0.3344, 0.7312, 0.3541]}, {"w": "Residual", "b": [0.7375, 0.3344, 0.8258, 0.3541]}, {"w": "connections,", "b": [0.1294, 0.3549, 0.2562, 0.3746]}, {"w": "by", "b": [0.2625, 0.3549, 0.2878, 0.3746]}, {"w": "reinjecting", "b": [0.2941, 0.3549, 0.402, 0.3746]}, {"w": "earlier", "b": [0.4083, 0.3549, 0.4727, 0.3746]}, {"w": "information", "b": [0.479, 0.3549, 0.5981, 0.3746]}, {"w": "downstream,", "b": [0.6044, 0.3549, 0.734, 0.3746]}, {"w": "partially", "b": [0.7403, 0.3549, 0.8244, 0.3746]}, {"w": "solve", "b": [0.1294, 0.3754, 0.1827, 0.3951]}, {"w": "this", "b": [0.1889, 0.3754, 0.2254, 0.3951]}, {"w": "issue", "b": [0.2317, 0.3754, 0.2822, 0.3951]}, {"w": "for", "b": [0.2885, 0.3754, 0.3179, 0.3951]}, {"w": "deep-learning", "b": [0.3242, 0.3754, 0.4629, 0.3951]}, {"w": "models.", "b": [0.4692, 0.3754, 0.5484, 0.3951]}]}, {"id": "b_2", "type": "paragraph", "text": "Vanishing gradients in deep learning", "words": [{"w": "Vanishing", "b": [0.1294, 0.4538, 0.2365, 0.4735]}, {"w": "gradients", "b": [0.2428, 0.4538, 0.3437, 0.4735]}, {"w": "in", "b": [0.35, 0.4538, 0.371, 0.4735]}, {"w": "deep", "b": [0.3773, 0.4538, 0.4278, 0.4735]}, {"w": "learning", "b": [0.4341, 0.4538, 0.5238, 0.4735]}]}, {"id": "b_3", "type": "paragraph", "text": "Backpropagation, the master algorithm used to train deep neural networks, works by propagating a feedback signal from the output loss down to earlier layers. If this feedback signal has to be propagated through a deep stack of layers, the signal may become tenuous or even be lost entirely, rendering the network untrainable. This issue is known as vanishing gradients.", "words": [{"w": "Backpropagation,", "b": [0.1294, 0.4966, 0.3081, 0.5163]}, {"w": "the", "b": [0.3144, 0.4966, 0.3452, 0.5163]}, {"w": "master", "b": [0.3515, 0.4966, 0.4188, 0.5163]}, {"w": "algorithm", "b": [0.4251, 0.4966, 0.5232, 0.5163]}, {"w": "used", "b": [0.5295, 0.4966, 0.5757, 0.5163]}, {"w": "to", "b": [0.582, 0.4966, 0.6016, 0.5163]}, {"w": "train", "b": [0.6079, 0.4966, 0.6542, 0.5163]}, {"w": "deep", "b": [0.6605, 0.4966, 0.7081, 0.5163]}, {"w": "neural", "b": [0.7144, 0.4966, 0.7775, 0.5163]}, {"w": "networks,", "b": [0.1294, 0.5171, 0.2282, 0.5368]}, {"w": "works", "b": [0.2345, 0.5171, 0.2962, 0.5368]}, {"w": "by", "b": [0.3025, 0.5171, 0.3277, 0.5368]}, {"w": "propagating", "b": [0.334, 0.5171, 0.4545, 0.5368]}, {"w": "a", "b": [0.4608, 0.5171, 0.472, 0.5368]}, {"w": "feedback", "b": [0.4783, 0.5171, 0.5693, 0.5368]}, {"w": "signal", "b": [0.5757, 0.5171, 0.6359, 0.5368]}, {"w": "from", "b": [0.6422, 0.5171, 0.6913, 0.5368]}, {"w": "the", "b": [0.6976, 0.5171, 0.7284, 0.5368]}, {"w": "output", "b": [0.7347, 0.5171, 0.7991, 0.5368]}, {"w": "loss", "b": [0.8054, 0.5171, 0.8447, 0.5368]}, {"w": "down", "b": [0.1294, 0.5376, 0.1855, 0.5573]}, {"w": "to", "b": [0.1918, 0.5376, 0.2114, 0.5573]}, {"w": "earlier", "b": [0.2177, 0.5376, 0.2821, 0.5573]}, {"w": "layers.", "b": [0.2884, 0.5376, 0.355, 0.5573]}, {"w": "If", "b": [0.3613, 0.5376, 0.3781, 0.5573]}, {"w": "this", "b": [0.3844, 0.5376, 0.4208, 0.5573]}, {"w": "feedback", "b": [0.4272, 0.5376, 0.5182, 0.5573]}, {"w": "signal", "b": [0.5245, 0.5376, 0.5848, 0.5573]}, {"w": "has", "b": [0.5911, 0.5376, 0.6247, 0.5573]}, {"w": "to", "b": [0.631, 0.5376, 0.6506, 0.5573]}, {"w": "be", "b": [0.6569, 0.5376, 0.6807, 0.5573]}, {"w": "propagated", "b": [0.6871, 0.5376, 0.7991, 0.5573]}, {"w": "through", "b": [0.1294, 0.5581, 0.2079, 0.5778]}, {"w": "a", "b": [0.2142, 0.5581, 0.2254, 0.5778]}, {"w": "deep", "b": [0.2317, 0.5581, 0.2793, 0.5778]}, {"w": "stack", "b": [0.2856, 0.5581, 0.3375, 0.5778]}, {"w": "of", "b": [0.3438, 0.5581, 0.3648, 0.5778]}, {"w": "layers,", "b": [0.3711, 0.5581, 0.4376, 0.5778]}, {"w": "the", "b": [0.444, 0.5581, 0.4748, 0.5778]}, {"w": "signal", "b": [0.4811, 0.5581, 0.5413, 0.5778]}, {"w": "may", "b": [0.5476, 0.5581, 0.591, 0.5778]}, {"w": "become", "b": [0.5974, 0.5581, 0.6758, 0.5778]}, {"w": "tenuous", "b": [0.6821, 0.5581, 0.7606, 0.5778]}, {"w": "or", "b": [0.7669, 0.5581, 0.7879, 0.5778]}, {"w": "even", "b": [0.7942, 0.5581, 0.8418, 0.5778]}, {"w": "be", "b": [0.1294, 0.5786, 0.1532, 0.5983]}, {"w": "lost", "b": [0.1595, 0.5786, 0.196, 0.5983]}, {"w": "entirely,", "b": [0.2023, 0.5786, 0.284, 0.5983]}, {"w": "rendering", "b": [0.2903, 0.5786, 0.387, 0.5983]}, {"w": "the", "b": [0.3933, 0.5786, 0.4241, 0.5983]}, {"w": "network", "b": [0.4304, 0.5786, 0.5131, 0.5983]}, {"w": "untrainable.", "b": [0.5194, 0.5786, 0.6392, 0.5983]}, {"w": "This", "b": [0.6455, 0.5786, 0.6903, 0.5983]}, {"w": "issue", "b": [0.6966, 0.5786, 0.7471, 0.5983]}, {"w": "is", "b": [0.7534, 0.5786, 0.7702, 0.5983]}, {"w": "known", "b": [0.7765, 0.5786, 0.8452, 0.5983]}, {"w": "as", "b": [0.1294, 0.5991, 0.1504, 0.6188]}, {"w": "vanishing", "b": [0.1567, 0.5991, 0.2548, 0.6188]}, {"w": "gradients.", "b": [0.2611, 0.5991, 0.3627, 0.6188]}]}, {"id": "b_4", "type": "paragraph", "text": "This problem occurs both with deep networks and with recurrent networks over very long sequences—in both cases, a feedback signal must be propagated through a long series of operations. You’re already familiar with the solution that the LSTM layer uses to address this problem in recurrent networks: it introduces a carry track that propagates information parallel to the main processing track. Residual connections work in a similar way in feedforward deep networks, but they’re even simpler: they introduce a purely linear information carry track parallel to the main layer stack, thus helping to propagate gradients through arbitrarily deep stacks of layers.", "words": [{"w": "This", "b": [0.1294, 0.6419, 0.1743, 0.6616]}, {"w": "problem", "b": [0.1806, 0.6419, 0.2646, 0.6616]}, {"w": "occurs", "b": [0.271, 0.6419, 0.3368, 0.6616]}, {"w": "both", "b": [0.3431, 0.6419, 0.388, 0.6616]}, {"w": "with", "b": [0.3943, 0.6419, 0.4391, 0.6616]}, {"w": "deep", "b": [0.4454, 0.6419, 0.493, 0.6616]}, {"w": "networks", "b": [0.4993, 0.6419, 0.5918, 0.6616]}, {"w": "and", "b": [0.5981, 0.6419, 0.6346, 0.6616]}, {"w": "with", "b": [0.6409, 0.6419, 0.6857, 0.6616]}, {"w": "recurrent", "b": [0.692, 0.6419, 0.7831, 0.6616]}, {"w": "networks", "b": [0.1294, 0.6624, 0.2219, 0.6821]}, {"w": "over", "b": [0.2282, 0.6624, 0.273, 0.6821]}, {"w": "very", "b": [0.2793, 0.6624, 0.3242, 0.6821]}, {"w": "long", "b": [0.3305, 0.6624, 0.3753, 0.6821]}, {"w": "sequences—in", "b": [0.3816, 0.6624, 0.5287, 0.6821]}, {"w": "both", "b": [0.535, 0.6624, 0.5799, 0.6821]}, {"w": "cases,", "b": [0.5862, 0.6624, 0.6457, 0.6821]}, {"w": "a", "b": [0.652, 0.6624, 0.6632, 0.6821]}, {"w": "feedback", "b": [0.6695, 0.6624, 0.7606, 0.6821]}, {"w": "signal", "b": [0.7668, 0.6624, 0.8271, 0.6821]}, {"w": "must", "b": [0.1294, 0.6829, 0.1785, 0.7026]}, {"w": "be", "b": [0.1848, 0.6829, 0.2086, 0.7026]}, {"w": "propagated", "b": [0.2149, 0.6829, 0.327, 0.7026]}, {"w": "through", "b": [0.3333, 0.6829, 0.4118, 0.7026]}, {"w": "a", "b": [0.4181, 0.6829, 0.4293, 0.7026]}, {"w": "long", "b": [0.4356, 0.6829, 0.4804, 0.7026]}, {"w": "series", "b": [0.4867, 0.6829, 0.5442, 0.7026]}, {"w": "of", "b": [0.5505, 0.6829, 0.5715, 0.7026]}, {"w": "operations.", "b": [0.5778, 0.6829, 0.6892, 0.7026]}, {"w": "You’re", "b": [0.6955, 0.6829, 0.7644, 0.7026]}, {"w": "already", "b": [0.7707, 0.6829, 0.8449, 0.7026]}, {"w": "familiar", "b": [0.1294, 0.7034, 0.2093, 0.7231]}, {"w": "with", "b": [0.2156, 0.7034, 0.2604, 0.7231]}, {"w": "the", "b": [0.2667, 0.7034, 0.2976, 0.7231]}, {"w": "solution", "b": [0.3039, 0.7034, 0.3852, 0.7231]}, {"w": "that", "b": [0.3915, 0.7034, 0.4293, 0.7231]}, {"w": "the", "b": [0.4356, 0.7034, 0.4665, 0.7231]}, {"w": "LSTM", "b": [0.4727, 0.7044, 0.5332, 0.7246]}, {"w": "layer", "b": [0.5395, 0.7034, 0.59, 0.7231]}, {"w": "uses", "b": [0.5963, 0.7034, 0.6397, 0.7231]}, {"w": "to", "b": [0.646, 0.7034, 0.6656, 0.7231]}, {"w": "address", "b": [0.6719, 0.7034, 0.7476, 0.7231]}, {"w": "this", "b": [0.7539, 0.7034, 0.7903, 0.7231]}, {"w": "problem", "b": [0.1294, 0.7248, 0.2135, 0.7445]}, {"w": "in", "b": [0.2198, 0.7248, 0.2394, 0.7445]}, {"w": "recurrent", "b": [0.2457, 0.7248, 0.3368, 0.7445]}, {"w": "networks:", "b": [0.3431, 0.7248, 0.4426, 0.7445]}, {"w": "it", "b": [0.4489, 0.7248, 0.4629, 0.7445]}, {"w": "introduces", "b": [0.4692, 0.7248, 0.5743, 0.7445]}, {"w": "a", "b": [0.5806, 0.7248, 0.5918, 0.7445]}, {"w": "carry", "b": [0.598, 0.7248, 0.6527, 0.7445]}, {"w": "track", "b": [0.659, 0.7248, 0.7108, 0.7445]}, {"w": "that", "b": [0.7171, 0.7248, 0.755, 0.7445]}, {"w": "propagates", "b": [0.7613, 0.7248, 0.8705, 0.7445]}, {"w": "information", "b": [0.1294, 0.7453, 0.2485, 0.765]}, {"w": "parallel", "b": [0.2548, 0.7453, 0.3305, 0.765]}, {"w": "to", "b": [0.3368, 0.7453, 0.3564, 0.765]}, {"w": "the", "b": [0.3627, 0.7453, 0.3936, 0.765]}, {"w": "main", "b": [0.3999, 0.7453, 0.4503, 0.765]}, {"w": "processing", "b": [0.4566, 0.7453, 0.5645, 0.765]}, {"w": "track.", "b": [0.5708, 0.7453, 0.6275, 0.765]}, {"w": "Residual", "b": [0.6339, 0.7453, 0.7221, 0.765]}, {"w": "connections", "b": [0.7284, 0.7453, 0.849, 0.765]}, {"w": "work", "b": [0.1294, 0.7658, 0.1813, 0.7855]}, {"w": "in", "b": [0.1876, 0.7658, 0.2072, 0.7855]}, {"w": "a", "b": [0.2135, 0.7658, 0.2247, 0.7855]}, {"w": "similar", "b": [0.231, 0.7658, 0.3011, 0.7855]}, {"w": "way", "b": [0.3074, 0.7658, 0.3494, 0.7855]}, {"w": "in", "b": [0.3557, 0.7658, 0.3753, 0.7855]}, {"w": "feedforward", "b": [0.3816, 0.7658, 0.5049, 0.7855]}, {"w": "deep", "b": [0.5112, 0.7658, 0.5588, 0.7855]}, {"w": "networks,", "b": [0.5651, 0.7658, 0.6639, 0.7855]}, {"w": "but", "b": [0.6702, 0.7658, 0.7024, 0.7855]}, {"w": "they’re", "b": [0.7087, 0.7658, 0.7802, 0.7855]}, {"w": "even", "b": [0.7865, 0.7658, 0.8341, 0.7855]}, {"w": "simpler:", "b": [0.1294, 0.7863, 0.2121, 0.806]}, {"w": "they", "b": [0.2184, 0.7863, 0.2618, 0.806]}, {"w": "introduce", "b": [0.2682, 0.7863, 0.3634, 0.806]}, {"w": "a", "b": [0.3697, 0.7863, 0.3809, 0.806]}, {"w": "purely", "b": [0.3872, 0.7863, 0.4517, 0.806]}, {"w": "linear", "b": [0.458, 0.7863, 0.5154, 0.806]}, {"w": "information", "b": [0.5217, 0.7863, 0.6409, 0.806]}, {"w": "carry", "b": [0.6472, 0.7863, 0.699, 0.806]}, {"w": "track", "b": [0.7053, 0.7863, 0.7557, 0.806]}, {"w": "parallel", "b": [0.762, 0.7863, 0.8377, 0.806]}, {"w": "to", "b": [0.844, 0.7863, 0.8636, 0.806]}, {"w": "the", "b": [0.1294, 0.8068, 0.1602, 0.8265]}, {"w": "main", "b": [0.1665, 0.8068, 0.217, 0.8265]}, {"w": "layer", "b": [0.2233, 0.8068, 0.2737, 0.8265]}, {"w": "stack,", "b": [0.28, 0.8068, 0.3381, 0.8265]}, {"w": "thus", "b": [0.3444, 0.8068, 0.3865, 0.8265]}, {"w": "helping", "b": [0.3928, 0.8068, 0.4685, 0.8265]}, {"w": "to", "b": [0.4748, 0.8068, 0.4944, 0.8265]}, {"w": "propagate", "b": [0.5007, 0.8068, 0.6002, 0.8265]}, {"w": "gradients", "b": [0.6065, 0.8068, 0.699, 0.8265]}, {"w": "through", "b": [0.7053, 0.8068, 0.7838, 0.8265]}, {"w": "arbitrarily", "b": [0.1294, 0.8273, 0.2303, 0.847]}, {"w": "deep", "b": [0.2366, 0.8273, 0.2842, 0.847]}, {"w": "stacks", "b": [0.2905, 0.8273, 0.3522, 0.847]}, {"w": "of", "b": [0.3585, 0.8273, 0.3795, 0.847]}, {"w": "layers.", "b": [0.3858, 0.8273, 0.4524, 0.847]}]}]}, {"page": 323, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "7.1.5. Layer weight sharing", "words": [{"w": "7.1.5.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Layer", "b": [0.1925, 0.0857, 0.2569, 0.1054]}, {"w": "weight", "b": [0.2632, 0.0857, 0.3347, 0.1054]}, {"w": "sharing", "b": [0.341, 0.0857, 0.4223, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "One more important feature of the functional API is the ability to reuse a layer instance several times. When you call a layer instance twice, instead of instantiating a new layer for each call, you reuse the same weights with every call. This allows you to build models that have shared branches—several branches that all share the same knowledge and perform the same operations. That is, they share the same representations and learn these representations simultaneously for different sets of inputs.", "words": [{"w": "One", "b": [0.1294, 0.1285, 0.1714, 0.1482]}, {"w": "more", "b": [0.1777, 0.1285, 0.2296, 0.1482]}, {"w": "important", "b": [0.2359, 0.1285, 0.334, 0.1482]}, {"w": "feature", "b": [0.3403, 0.1285, 0.4103, 0.1482]}, {"w": "of", "b": [0.4166, 0.1285, 0.4376, 0.1482]}, {"w": "the", "b": [0.444, 0.1285, 0.4748, 0.1482]}, {"w": "functional", "b": [0.4811, 0.1285, 0.5834, 0.1482]}, {"w": "API", "b": [0.5897, 0.1285, 0.6303, 0.1482]}, {"w": "is", "b": [0.6366, 0.1285, 0.6535, 0.1482]}, {"w": "the", "b": [0.6598, 0.1285, 0.6906, 0.1482]}, {"w": "ability", "b": [0.6969, 0.1285, 0.7614, 0.1482]}, {"w": "to", "b": [0.7677, 0.1285, 0.7873, 0.1482]}, {"w": "reuse", "b": [0.7936, 0.1285, 0.8468, 0.1482]}, {"w": "a", "b": [0.8531, 0.1285, 0.8643, 0.1482]}, {"w": "layer", "b": [0.1294, 0.149, 0.1798, 0.1687]}, {"w": "instance", "b": [0.1861, 0.149, 0.2688, 0.1687]}, {"w": "several", "b": [0.2751, 0.149, 0.3466, 0.1687]}, {"w": "times.", "b": [0.3529, 0.149, 0.4138, 0.1687]}, {"w": "When", "b": [0.4201, 0.149, 0.4804, 0.1687]}, {"w": "you", "b": [0.4867, 0.149, 0.5245, 0.1687]}, {"w": "call", "b": [0.5308, 0.149, 0.5673, 0.1687]}, {"w": "a", "b": [0.5736, 0.149, 0.5848, 0.1687]}, {"w": "layer", "b": [0.5911, 0.149, 0.6415, 0.1687]}, {"w": "instance", "b": [0.6477, 0.149, 0.7304, 0.1687]}, {"w": "twice,", "b": [0.7367, 0.149, 0.7976, 0.1687]}, {"w": "instead", "b": [0.1294, 0.1695, 0.2009, 0.1892]}, {"w": "of", "b": [0.2072, 0.1695, 0.2282, 0.1892]}, {"w": "instantiating", "b": [0.2345, 0.1695, 0.3592, 0.1892]}, {"w": "a", "b": [0.3656, 0.1695, 0.3768, 0.1892]}, {"w": "new", "b": [0.3831, 0.1695, 0.4251, 0.1892]}, {"w": "layer", "b": [0.4314, 0.1695, 0.4818, 0.1892]}, {"w": "for", "b": [0.4881, 0.1695, 0.5175, 0.1892]}, {"w": "each", "b": [0.5238, 0.1695, 0.5701, 0.1892]}, {"w": "call,", "b": [0.5764, 0.1695, 0.6191, 0.1892]}, {"w": "you", "b": [0.6254, 0.1695, 0.6632, 0.1892]}, {"w": "reuse", "b": [0.6695, 0.1695, 0.7228, 0.1892]}, {"w": "the", "b": [0.7291, 0.1695, 0.7599, 0.1892]}, {"w": "same", "b": [0.7662, 0.1695, 0.8181, 0.1892]}, {"w": "weights", "b": [0.1294, 0.19, 0.2079, 0.2097]}, {"w": "with", "b": [0.2142, 0.19, 0.259, 0.2097]}, {"w": "every", "b": [0.2654, 0.19, 0.3214, 0.2097]}, {"w": "call.", "b": [0.3277, 0.19, 0.3704, 0.2097]}, {"w": "This", "b": [0.3767, 0.19, 0.4216, 0.2097]}, {"w": "allows", "b": [0.4279, 0.19, 0.4937, 0.2097]}, {"w": "you", "b": [0.5, 0.19, 0.5379, 0.2097]}, {"w": "to", "b": [0.5442, 0.19, 0.5638, 0.2097]}, {"w": "build", "b": [0.5701, 0.19, 0.622, 0.2097]}, {"w": "models", "b": [0.6283, 0.19, 0.7011, 0.2097]}, {"w": "that", "b": [0.7074, 0.19, 0.7453, 0.2097]}, {"w": "have", "b": [0.7516, 0.19, 0.7992, 0.2097]}, {"w": "shared", "b": [0.1294, 0.2105, 0.1953, 0.2302]}, {"w": "branches—several", "b": [0.2016, 0.2105, 0.3879, 0.2302]}, {"w": "branches", "b": [0.3942, 0.2105, 0.4838, 0.2302]}, {"w": "that", "b": [0.4901, 0.2105, 0.528, 0.2302]}, {"w": "all", "b": [0.5343, 0.2105, 0.5595, 0.2302]}, {"w": "share", "b": [0.5658, 0.2105, 0.619, 0.2302]}, {"w": "the", "b": [0.6254, 0.2105, 0.6562, 0.2302]}, {"w": "same", "b": [0.6625, 0.2105, 0.7143, 0.2302]}, {"w": "knowledge", "b": [0.7206, 0.2105, 0.8313, 0.2302]}, {"w": "and", "b": [0.1294, 0.231, 0.1658, 0.2507]}, {"w": "perform", "b": [0.1721, 0.231, 0.2534, 0.2507]}, {"w": "the", "b": [0.2597, 0.231, 0.2905, 0.2507]}, {"w": "same", "b": [0.2968, 0.231, 0.3487, 0.2507]}, {"w": "operations.", "b": [0.355, 0.231, 0.4664, 0.2507]}, {"w": "That", "b": [0.4726, 0.231, 0.5189, 0.2507]}, {"w": "is,", "b": [0.5252, 0.231, 0.5483, 0.2507]}, {"w": "they", "b": [0.5546, 0.231, 0.5981, 0.2507]}, {"w": "share", "b": [0.6044, 0.231, 0.6576, 0.2507]}, {"w": "the", "b": [0.6639, 0.231, 0.6947, 0.2507]}, {"w": "same", "b": [0.701, 0.231, 0.7529, 0.2507]}, {"w": "representations", "b": [0.1294, 0.2515, 0.2821, 0.2712]}, {"w": "and", "b": [0.2884, 0.2515, 0.3249, 0.2712]}, {"w": "learn", "b": [0.3312, 0.2515, 0.3816, 0.2712]}, {"w": "these", "b": [0.3879, 0.2515, 0.4397, 0.2712]}, {"w": "representations", "b": [0.446, 0.2515, 0.5988, 0.2712]}, {"w": "simultaneously", "b": [0.6051, 0.2515, 0.7578, 0.2712]}, {"w": "for", "b": [0.7641, 0.2515, 0.7936, 0.2712]}, {"w": "different", "b": [0.1294, 0.272, 0.2158, 0.2917]}, {"w": "sets", "b": [0.2221, 0.272, 0.2599, 0.2917]}, {"w": "of", "b": [0.2663, 0.272, 0.2873, 0.2917]}, {"w": "inputs.", "b": [0.2936, 0.272, 0.3616, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "For example, consider a model that attempts to assess the semantic similarity between two sentences. The model has two inputs (the two sentences to compare) and outputs a score between 0 and 1, where 0 means unrelated sentences and 1 means sentences that are either identical or reformulations of each other. Such a model could be useful in many applications, including deduplicating natural-language queries in a dialog system.", "words": [{"w": "For", "b": [0.1294, 0.3147, 0.1645, 0.3345]}, {"w": "example,", "b": [0.1708, 0.3147, 0.2625, 0.3345]}, {"w": "consider", "b": [0.2688, 0.3147, 0.3543, 0.3345]}, {"w": "a", "b": [0.3606, 0.3147, 0.3718, 0.3345]}, {"w": "model", "b": [0.3781, 0.3147, 0.4412, 0.3345]}, {"w": "that", "b": [0.4475, 0.3147, 0.4853, 0.3345]}, {"w": "attempts", "b": [0.4916, 0.3147, 0.5771, 0.3345]}, {"w": "to", "b": [0.5834, 0.3147, 0.6031, 0.3345]}, {"w": "assess", "b": [0.6094, 0.3147, 0.671, 0.3345]}, {"w": "the", "b": [0.6773, 0.3147, 0.7081, 0.3345]}, {"w": "semantic", "b": [0.7144, 0.3147, 0.8041, 0.3345]}, {"w": "similarity", "b": [0.1294, 0.3352, 0.2261, 0.355]}, {"w": "between", "b": [0.2324, 0.3352, 0.3165, 0.355]}, {"w": "two", "b": [0.3228, 0.3352, 0.3606, 0.355]}, {"w": "sentences.", "b": [0.3669, 0.3352, 0.4699, 0.355]}, {"w": "The", "b": [0.4762, 0.3352, 0.5154, 0.355]}, {"w": "model", "b": [0.5217, 0.3352, 0.5848, 0.355]}, {"w": "has", "b": [0.5911, 0.3352, 0.6247, 0.355]}, {"w": "two", "b": [0.6311, 0.3352, 0.6689, 0.355]}, {"w": "inputs", "b": [0.6752, 0.3352, 0.7369, 0.355]}, {"w": "(the", "b": [0.7431, 0.3352, 0.7823, 0.355]}, {"w": "two", "b": [0.7886, 0.3352, 0.8265, 0.355]}, {"w": "sentences", "b": [0.1294, 0.3557, 0.2261, 0.3755]}, {"w": "to", "b": [0.2324, 0.3557, 0.252, 0.3755]}, {"w": "compare)", "b": [0.2583, 0.3557, 0.3536, 0.3755]}, {"w": "and", "b": [0.3599, 0.3557, 0.3963, 0.3755]}, {"w": "outputs", "b": [0.4026, 0.3557, 0.4769, 0.3755]}, {"w": "a", "b": [0.4832, 0.3557, 0.4944, 0.3755]}, {"w": "score", "b": [0.5007, 0.3557, 0.5539, 0.3755]}, {"w": "between", "b": [0.5602, 0.3557, 0.6443, 0.3755]}, {"w": "0", "b": [0.6506, 0.3557, 0.6632, 0.3755]}, {"w": "and", "b": [0.6695, 0.3557, 0.7059, 0.3755]}, {"w": "1,", "b": [0.7123, 0.3557, 0.7312, 0.3755]}, {"w": "where", "b": [0.7375, 0.3557, 0.7991, 0.3755]}, {"w": "0", "b": [0.8054, 0.3557, 0.818, 0.3755]}, {"w": "means", "b": [0.1294, 0.3762, 0.1939, 0.396]}, {"w": "unrelated", "b": [0.2002, 0.3762, 0.294, 0.396]}, {"w": "sentences", "b": [0.3003, 0.3762, 0.397, 0.396]}, {"w": "and", "b": [0.4033, 0.3762, 0.4397, 0.396]}, {"w": "1", "b": [0.446, 0.3762, 0.4587, 0.396]}, {"w": "means", "b": [0.465, 0.3762, 0.5294, 0.396]}, {"w": "sentences", "b": [0.5357, 0.3762, 0.6324, 0.396]}, {"w": "that", "b": [0.6386, 0.3762, 0.6765, 0.396]}, {"w": "are", "b": [0.6828, 0.3762, 0.7136, 0.396]}, {"w": "either", "b": [0.7199, 0.3762, 0.7773, 0.396]}, {"w": "identical", "b": [0.7836, 0.3762, 0.8705, 0.396]}, {"w": "or", "b": [0.1294, 0.3967, 0.1504, 0.4165]}, {"w": "reformulations", "b": [0.1567, 0.3967, 0.3053, 0.4165]}, {"w": "of", "b": [0.3116, 0.3967, 0.3326, 0.4165]}, {"w": "each", "b": [0.3389, 0.3967, 0.3851, 0.4165]}, {"w": "other.", "b": [0.3914, 0.3967, 0.4481, 0.4165]}, {"w": "Such", "b": [0.4544, 0.3967, 0.5049, 0.4165]}, {"w": "a", "b": [0.5112, 0.3967, 0.5224, 0.4165]}, {"w": "model", "b": [0.5287, 0.3967, 0.5918, 0.4165]}, {"w": "could", "b": [0.5981, 0.3967, 0.6541, 0.4165]}, {"w": "be", "b": [0.6604, 0.3967, 0.6842, 0.4165]}, {"w": "useful", "b": [0.6905, 0.3967, 0.7522, 0.4165]}, {"w": "in", "b": [0.7585, 0.3967, 0.7781, 0.4165]}, {"w": "many", "b": [0.7844, 0.3967, 0.8405, 0.4165]}, {"w": "applications,", "b": [0.1294, 0.4172, 0.2576, 0.437]}, {"w": "including", "b": [0.2639, 0.4172, 0.3592, 0.437]}, {"w": "deduplicating", "b": [0.3656, 0.4172, 0.5029, 0.437]}, {"w": "natural-language", "b": [0.5091, 0.4172, 0.6786, 0.437]}, {"w": "queries", "b": [0.6849, 0.4172, 0.7578, 0.437]}, {"w": "in", "b": [0.7641, 0.4172, 0.7837, 0.437]}, {"w": "a", "b": [0.79, 0.4172, 0.8012, 0.437]}, {"w": "dialog", "b": [0.8075, 0.4172, 0.8706, 0.437]}, {"w": "system.", "b": [0.1294, 0.4377, 0.2058, 0.4575]}]}, {"id": "b_3", "type": "paragraph", "text": "In this setup, the two input sentences are interchangeable, because semantic similarity is a symmetrical relationship: the similarity of A to B is identical to the similarity of B to A. For this reason, it wouldn’t make sense to learn two independent models for processing each input sentence. Rather, you want to process both with a single LSTM layer. The representations of this LSTM layer (its weights) are learned based on both inputs simultaneously. This is what we call a Siamese LSTM model or a shared LSTM.", "words": [{"w": "In", "b": [0.1294, 0.4805, 0.1504, 0.5003]}, {"w": "this", "b": [0.1567, 0.4805, 0.1932, 0.5003]}, {"w": "setup,", "b": [0.1995, 0.4805, 0.259, 0.5003]}, {"w": "the", "b": [0.2654, 0.4805, 0.2962, 0.5003]}, {"w": "two", "b": [0.3025, 0.4805, 0.3403, 0.5003]}, {"w": "input", "b": [0.3466, 0.4805, 0.3985, 0.5003]}, {"w": "sentences", "b": [0.4048, 0.4805, 0.5015, 0.5003]}, {"w": "are", "b": [0.5078, 0.4805, 0.5386, 0.5003]}, {"w": "interchangeable,", "b": [0.5449, 0.4805, 0.7109, 0.5003]}, {"w": "because", "b": [0.7172, 0.4805, 0.797, 0.5003]}, {"w": "semantic", "b": [0.1294, 0.501, 0.2191, 0.5208]}, {"w": "similarity", "b": [0.2254, 0.501, 0.3221, 0.5208]}, {"w": "is", "b": [0.3284, 0.501, 0.3452, 0.5208]}, {"w": "a", "b": [0.3516, 0.501, 0.3628, 0.5208]}, {"w": "symmetrical", "b": [0.3691, 0.501, 0.4938, 0.5208]}, {"w": "relationship:", "b": [0.5001, 0.501, 0.6262, 0.5208]}, {"w": "the", "b": [0.6325, 0.501, 0.6633, 0.5208]}, {"w": "similarity", "b": [0.6695, 0.501, 0.7662, 0.5208]}, {"w": "of", "b": [0.7725, 0.501, 0.7936, 0.5208]}, {"w": "A", "b": [0.7999, 0.501, 0.8181, 0.5208]}, {"w": "to", "b": [0.8244, 0.501, 0.844, 0.5208]}, {"w": "B", "b": [0.8503, 0.501, 0.8671, 0.5208]}, {"w": "is", "b": [0.1294, 0.5215, 0.1462, 0.5413]}, {"w": "identical", "b": [0.1525, 0.5215, 0.2394, 0.5413]}, {"w": "to", "b": [0.2457, 0.5215, 0.2654, 0.5413]}, {"w": "the", "b": [0.2717, 0.5215, 0.3025, 0.5413]}, {"w": "similarity", "b": [0.3088, 0.5215, 0.4055, 0.5413]}, {"w": "of", "b": [0.4118, 0.5215, 0.4328, 0.5413]}, {"w": "B", "b": [0.4391, 0.5215, 0.456, 0.5413]}, {"w": "to", "b": [0.4623, 0.5215, 0.4819, 0.5413]}, {"w": "A.", "b": [0.4882, 0.5215, 0.5127, 0.5413]}, {"w": "For", "b": [0.519, 0.5215, 0.5541, 0.5413]}, {"w": "this", "b": [0.5604, 0.5215, 0.5968, 0.5413]}, {"w": "reason,", "b": [0.6031, 0.5215, 0.6753, 0.5413]}, {"w": "it", "b": [0.6816, 0.5215, 0.6956, 0.5413]}, {"w": "wouldn’t", "b": [0.7019, 0.5215, 0.7925, 0.5413]}, {"w": "make", "b": [0.7988, 0.5215, 0.8534, 0.5413]}, {"w": "sense", "b": [0.1294, 0.542, 0.1841, 0.5618]}, {"w": "to", "b": [0.1904, 0.542, 0.21, 0.5618]}, {"w": "learn", "b": [0.2163, 0.542, 0.2667, 0.5618]}, {"w": "two", "b": [0.273, 0.542, 0.3109, 0.5618]}, {"w": "independent", "b": [0.3172, 0.542, 0.4405, 0.5618]}, {"w": "models", "b": [0.4467, 0.542, 0.5196, 0.5618]}, {"w": "for", "b": [0.5259, 0.542, 0.5553, 0.5618]}, {"w": "processing", "b": [0.5616, 0.542, 0.6695, 0.5618]}, {"w": "each", "b": [0.6758, 0.542, 0.722, 0.5618]}, {"w": "input", "b": [0.7283, 0.542, 0.7802, 0.5618]}, {"w": "sentence.", "b": [0.1294, 0.5625, 0.2226, 0.5823]}, {"w": "Rather,", "b": [0.2289, 0.5625, 0.3014, 0.5823]}, {"w": "you", "b": [0.3077, 0.5625, 0.3455, 0.5823]}, {"w": "want", "b": [0.3518, 0.5625, 0.4009, 0.5823]}, {"w": "to", "b": [0.4072, 0.5625, 0.4268, 0.5823]}, {"w": "process", "b": [0.4331, 0.5625, 0.5088, 0.5823]}, {"w": "both", "b": [0.5151, 0.5625, 0.5599, 0.5823]}, {"w": "with", "b": [0.5662, 0.5625, 0.6111, 0.5823]}, {"w": "a", "b": [0.6174, 0.5625, 0.6286, 0.5823]}, {"w": "single", "b": [0.6349, 0.5625, 0.6952, 0.5823]}, {"w": "LSTM", "b": [0.7014, 0.5636, 0.762, 0.5838]}, {"w": "layer.", "b": [0.7683, 0.5625, 0.8236, 0.5823]}, {"w": "The", "b": [0.8299, 0.5625, 0.8692, 0.5823]}, {"w": "representations", "b": [0.1294, 0.5839, 0.2821, 0.6037]}, {"w": "of", "b": [0.2884, 0.5839, 0.3094, 0.6037]}, {"w": "this", "b": [0.3158, 0.5839, 0.3522, 0.6037]}, {"w": "LSTM", "b": [0.3585, 0.585, 0.419, 0.6052]}, {"w": "layer", "b": [0.4253, 0.5839, 0.4757, 0.6037]}, {"w": "(its", "b": [0.4821, 0.5839, 0.5143, 0.6037]}, {"w": "weights)", "b": [0.5206, 0.5839, 0.6075, 0.6037]}, {"w": "are", "b": [0.6138, 0.5839, 0.6446, 0.6037]}, {"w": "learned", "b": [0.6509, 0.5839, 0.7251, 0.6037]}, {"w": "based", "b": [0.7314, 0.5839, 0.7889, 0.6037]}, {"w": "on", "b": [0.7952, 0.5839, 0.8204, 0.6037]}, {"w": "both", "b": [0.1294, 0.6053, 0.1743, 0.6251]}, {"w": "inputs", "b": [0.1806, 0.6053, 0.2422, 0.6251]}, {"w": "simultaneously.", "b": [0.2486, 0.6053, 0.406, 0.6251]}, {"w": "This", "b": [0.4123, 0.6053, 0.4571, 0.6251]}, {"w": "is", "b": [0.4634, 0.6053, 0.4802, 0.6251]}, {"w": "what", "b": [0.4866, 0.6053, 0.5356, 0.6251]}, {"w": "we", "b": [0.5419, 0.6053, 0.5713, 0.6251]}, {"w": "call", "b": [0.5776, 0.6053, 0.614, 0.6251]}, {"w": "a", "b": [0.6204, 0.6053, 0.6316, 0.6251]}, {"w": "Siamese", "b": [0.6378, 0.6053, 0.7205, 0.6251]}, {"w": "LSTM", "b": [0.7268, 0.6053, 0.7885, 0.6251]}, {"w": "model", "b": [0.7948, 0.6053, 0.8578, 0.6251]}, {"w": "or", "b": [0.1294, 0.6258, 0.1504, 0.6456]}, {"w": "a", "b": [0.1567, 0.6258, 0.1679, 0.6456]}, {"w": "shared", "b": [0.1742, 0.6258, 0.242, 0.6456]}, {"w": "LSTM.", "b": [0.2483, 0.6258, 0.3162, 0.6456]}]}, {"id": "b_4", "type": "paragraph", "text": "Here’s how to implement such a model using layer sharing (layer reuse) in the Keras functional API:", "words": [{"w": "Here’s", "b": [0.1294, 0.6686, 0.1952, 0.6883]}, {"w": "how", "b": [0.2016, 0.6686, 0.245, 0.6883]}, {"w": "to", "b": [0.2513, 0.6686, 0.2709, 0.6883]}, {"w": "implement", "b": [0.2772, 0.6686, 0.3851, 0.6883]}, {"w": "such", "b": [0.3914, 0.6686, 0.4377, 0.6883]}, {"w": "a", "b": [0.444, 0.6686, 0.4552, 0.6883]}, {"w": "model", "b": [0.4615, 0.6686, 0.5246, 0.6883]}, {"w": "using", "b": [0.5309, 0.6686, 0.5855, 0.6883]}, {"w": "layer", "b": [0.5918, 0.6686, 0.6423, 0.6883]}, {"w": "sharing", "b": [0.6486, 0.6686, 0.7228, 0.6883]}, {"w": "(layer", "b": [0.7291, 0.6686, 0.788, 0.6883]}, {"w": "reuse)", "b": [0.7943, 0.6686, 0.8559, 0.6883]}, {"w": "in", "b": [0.1294, 0.6891, 0.149, 0.7088]}, {"w": "the", "b": [0.1553, 0.6891, 0.1862, 0.7088]}, {"w": "Keras", "b": [0.1925, 0.6891, 0.2513, 0.7088]}, {"w": "functional", "b": [0.2576, 0.6891, 0.3599, 0.7088]}, {"w": "API:", "b": [0.3662, 0.6891, 0.4139, 0.7088]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras import layers from keras import Input from keras.models import Model lstm = layers.LSTM(32) 1 left_input = Input(shape=(None, 128)) 2 left_output = lstm(left_input) 2 right_input = Input(shape=(None, 128))", "words": [{"w": "from", "b": [0.1357, 0.7268, 0.1811, 0.742]}, {"w": "keras", "b": [0.1925, 0.7268, 0.2492, 0.742]}, {"w": "import", "b": [0.2606, 0.7268, 0.3287, 0.742]}, {"w": "layers", "b": [0.34, 0.7268, 0.4082, 0.742]}, {"w": "from", "b": [0.1357, 0.742, 0.1811, 0.7571]}, {"w": "keras", "b": [0.1925, 0.742, 0.2492, 0.7571]}, {"w": "import", "b": [0.2606, 0.742, 0.3287, 0.7571]}, {"w": "Input", "b": [0.34, 0.742, 0.3968, 0.7571]}, {"w": "from", "b": [0.1357, 0.7571, 0.1811, 0.7723]}, {"w": "keras.models", "b": [0.1925, 0.7571, 0.3287, 0.7723]}, {"w": "import", "b": [0.34, 0.7571, 0.4082, 0.7723]}, {"w": "Model", "b": [0.4195, 0.7571, 0.4763, 0.7723]}, {"w": "lstm", "b": [0.1357, 0.7874, 0.1811, 0.8026]}, {"w": "=", "b": [0.1925, 0.7874, 0.2038, 0.8026]}, {"w": "layers.LSTM(32)", "b": [0.2152, 0.7874, 0.3855, 0.8026]}, {"w": "1", "b": [0.1357, 0.8026, 0.1471, 0.8177]}, {"w": "left_input", "b": [0.1357, 0.8177, 0.2492, 0.8329]}, {"w": "=", "b": [0.2606, 0.8177, 0.2719, 0.8329]}, {"w": "Input(shape=(None,", "b": [0.2833, 0.8177, 0.4876, 0.8329]}, {"w": "128))", "b": [0.499, 0.8177, 0.5557, 0.8329]}, {"w": "2", "b": [0.1357, 0.8329, 0.1471, 0.848]}, {"w": "left_output", "b": [0.1357, 0.848, 0.2606, 0.8632]}, {"w": "=", "b": [0.2719, 0.848, 0.2833, 0.8632]}, {"w": "lstm(left_input)", "b": [0.2946, 0.848, 0.4763, 0.8632]}, {"w": "2", "b": [0.1357, 0.8632, 0.1471, 0.8783]}, {"w": "right_input", "b": [0.1357, 0.8935, 0.2606, 0.9087]}, {"w": "=", "b": [0.2719, 0.8935, 0.2833, 0.9087]}, {"w": "Input(shape=(None,", "b": [0.2946, 0.8935, 0.499, 0.9087]}, {"w": "128))", "b": [0.5103, 0.8935, 0.5671, 0.9087]}]}]}, {"page": 324, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3 right_output = lstm(right_input) 3 merged = layers.concatenate([left_output, right_output], axis=-1) 4 predictions = layers.Dense(1, activation='sigmoid')(merged) 4 model = Model([left_input, right_input], predictions) 5 model.fit([left_data, right_data], targets) 5", "words": [{"w": "3", "b": [0.1357, 0.0851, 0.1471, 0.1002]}, {"w": "right_output", "b": [0.1357, 0.1002, 0.2719, 0.1154]}, {"w": "=", "b": [0.2833, 0.1002, 0.2946, 0.1154]}, {"w": "lstm(right_input)", "b": [0.306, 0.1002, 0.499, 0.1154]}, {"w": "3", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "merged", "b": [0.1357, 0.1457, 0.2038, 0.1608]}, {"w": "=", "b": [0.2152, 0.1457, 0.2265, 0.1608]}, {"w": "layers.concatenate([left_output,", "b": [0.2379, 0.1457, 0.6011, 0.1608]}, {"w": "right_output],", "b": [0.6125, 0.1457, 0.7714, 0.1608]}, {"w": "axis=-1)", "b": [0.1357, 0.1608, 0.2265, 0.176]}, {"w": "4", "b": [0.2833, 0.1608, 0.2947, 0.176]}, {"w": "predictions", "b": [0.1357, 0.176, 0.2606, 0.1911]}, {"w": "=", "b": [0.2719, 0.176, 0.2833, 0.1911]}, {"w": "layers.Dense(1,", "b": [0.2946, 0.176, 0.4649, 0.1911]}, {"w": "activation='sigmoid')(merged)", "b": [0.4763, 0.176, 0.8055, 0.1911]}, {"w": "4", "b": [0.1357, 0.1912, 0.1471, 0.2063]}, {"w": "model", "b": [0.1357, 0.2215, 0.1925, 0.2366]}, {"w": "=", "b": [0.2038, 0.2215, 0.2152, 0.2366]}, {"w": "Model([left_input,", "b": [0.2265, 0.2215, 0.4309, 0.2366]}, {"w": "right_input],", "b": [0.4422, 0.2215, 0.5898, 0.2366]}, {"w": "predictions)", "b": [0.6011, 0.2215, 0.7374, 0.2366]}, {"w": "5", "b": [0.1357, 0.2366, 0.1471, 0.2518]}, {"w": "model.fit([left_data,", "b": [0.1357, 0.2518, 0.3741, 0.2669]}, {"w": "right_data],", "b": [0.3855, 0.2518, 0.5217, 0.2669]}, {"w": "targets)", "b": [0.533, 0.2518, 0.6238, 0.2669]}, {"w": "5", "b": [0.1357, 0.2669, 0.1471, 0.2821]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Instantiates a single LSTM layer, once 2 Building the left branch of the model: inputs are variable- length sequences of vectors of size 128. 3 Building the right branch of the model: when you call an existing layer instance, you reuse its weights. 4 Builds the classifier on top 5 Instantiating and training the model: when you train such a model, the weights of the LSTM layer are updated based on both inputs.", "words": [{"w": "1", "b": [0.1799, 0.3005, 0.1925, 0.3202]}, {"w": "Instantiates", "b": [0.1988, 0.3005, 0.3249, 0.3202]}, {"w": "a", "b": [0.3312, 0.3005, 0.3438, 0.3202]}, {"w": "single", "b": [0.3501, 0.3005, 0.4118, 0.3202]}, {"w": "LSTM", "b": [0.4181, 0.3005, 0.4896, 0.3202]}, {"w": "layer,", "b": [0.4959, 0.3005, 0.5545, 0.3202]}, {"w": "once", "b": [0.5608, 0.3005, 0.6099, 0.3202]}, {"w": "2", "b": [0.1799, 0.321, 0.1925, 0.3407]}, {"w": "Building", "b": [0.1988, 0.321, 0.2913, 0.3407]}, {"w": "the", "b": [0.2976, 0.321, 0.3313, 0.3407]}, {"w": "left", "b": [0.3376, 0.321, 0.3726, 0.3407]}, {"w": "branch", "b": [0.3789, 0.321, 0.456, 0.3407]}, {"w": "of", "b": [0.4623, 0.321, 0.4833, 0.3407]}, {"w": "the", "b": [0.4896, 0.321, 0.5232, 0.3407]}, {"w": "model:", "b": [0.5295, 0.321, 0.6038, 0.3407]}, {"w": "inputs", "b": [0.6101, 0.321, 0.6774, 0.3407]}, {"w": "are", "b": [0.6837, 0.321, 0.7183, 0.3407]}, {"w": "variable-", "b": [0.7246, 0.321, 0.8213, 0.3407]}, {"w": "length", "b": [0.1799, 0.3415, 0.2471, 0.3612]}, {"w": "sequences", "b": [0.2534, 0.3415, 0.36, 0.3612]}, {"w": "of", "b": [0.3663, 0.3415, 0.3873, 0.3612]}, {"w": "vectors", "b": [0.3936, 0.3415, 0.4706, 0.3612]}, {"w": "of", "b": [0.4769, 0.3415, 0.4979, 0.3612]}, {"w": "size", "b": [0.5042, 0.3415, 0.5435, 0.3612]}, {"w": "128.", "b": [0.5498, 0.3415, 0.5939, 0.3612]}, {"w": "3", "b": [0.1799, 0.362, 0.1925, 0.3817]}, {"w": "Building", "b": [0.1988, 0.362, 0.2913, 0.3817]}, {"w": "the", "b": [0.2976, 0.362, 0.3313, 0.3817]}, {"w": "right", "b": [0.3376, 0.362, 0.3908, 0.3817]}, {"w": "branch", "b": [0.3971, 0.362, 0.4742, 0.3817]}, {"w": "of", "b": [0.4805, 0.362, 0.5015, 0.3817]}, {"w": "the", "b": [0.5078, 0.362, 0.5415, 0.3817]}, {"w": "model:", "b": [0.5478, 0.362, 0.622, 0.3817]}, {"w": "when", "b": [0.6284, 0.362, 0.6858, 0.3817]}, {"w": "you", "b": [0.6921, 0.362, 0.7314, 0.3817]}, {"w": "call", "b": [0.7377, 0.362, 0.7755, 0.3817]}, {"w": "an", "b": [0.7818, 0.362, 0.8085, 0.3817]}, {"w": "existing", "b": [0.1799, 0.3825, 0.2626, 0.4022]}, {"w": "layer", "b": [0.2689, 0.3825, 0.3235, 0.4022]}, {"w": "instance,", "b": [0.3298, 0.3825, 0.4244, 0.4022]}, {"w": "you", "b": [0.4307, 0.3825, 0.47, 0.4022]}, {"w": "reuse", "b": [0.4763, 0.3825, 0.5332, 0.4022]}, {"w": "its", "b": [0.5395, 0.3825, 0.5648, 0.4022]}, {"w": "weights.", "b": [0.5711, 0.3825, 0.6587, 0.4022]}, {"w": "4", "b": [0.1799, 0.403, 0.1925, 0.4227]}, {"w": "Builds", "b": [0.1988, 0.403, 0.2675, 0.4227]}, {"w": "the", "b": [0.2738, 0.403, 0.3074, 0.4227]}, {"w": "classifier", "b": [0.3137, 0.403, 0.409, 0.4227]}, {"w": "on", "b": [0.4153, 0.403, 0.442, 0.4227]}, {"w": "top", "b": [0.4483, 0.403, 0.4833, 0.4227]}, {"w": "5", "b": [0.1799, 0.4235, 0.1925, 0.4432]}, {"w": "Instantiating", "b": [0.1988, 0.4235, 0.3375, 0.4432]}, {"w": "and", "b": [0.3439, 0.4235, 0.3845, 0.4432]}, {"w": "training", "b": [0.3908, 0.4235, 0.4777, 0.4432]}, {"w": "the", "b": [0.484, 0.4235, 0.5177, 0.4432]}, {"w": "model:", "b": [0.524, 0.4235, 0.5982, 0.4432]}, {"w": "when", "b": [0.6045, 0.4235, 0.662, 0.4432]}, {"w": "you", "b": [0.6683, 0.4235, 0.7076, 0.4432]}, {"w": "train", "b": [0.7139, 0.4235, 0.7671, 0.4432]}, {"w": "such", "b": [0.7734, 0.4235, 0.8225, 0.4432]}, {"w": "a", "b": [0.8288, 0.4235, 0.8414, 0.4432]}, {"w": "model,", "b": [0.1799, 0.444, 0.252, 0.4637]}, {"w": "the", "b": [0.2583, 0.444, 0.292, 0.4637]}, {"w": "weights", "b": [0.2983, 0.444, 0.3796, 0.4637]}, {"w": "of", "b": [0.3859, 0.444, 0.4069, 0.4637]}, {"w": "the", "b": [0.4132, 0.444, 0.4468, 0.4637]}, {"w": "LSTM", "b": [0.4531, 0.444, 0.5246, 0.4637]}, {"w": "layer", "b": [0.5309, 0.444, 0.5855, 0.4637]}, {"w": "are", "b": [0.5919, 0.444, 0.6264, 0.4637]}, {"w": "updated", "b": [0.6327, 0.444, 0.721, 0.4637]}, {"w": "based", "b": [0.7273, 0.444, 0.789, 0.4637]}, {"w": "on", "b": [0.7953, 0.444, 0.8219, 0.4637]}, {"w": "both", "b": [0.1799, 0.4645, 0.2289, 0.4842]}, {"w": "inputs.", "b": [0.2352, 0.4645, 0.3089, 0.4842]}]}, {"id": "b_2", "type": "paragraph", "text": "Naturally, a layer instance may be used more than once—it can be called arbitrarily many times, reusing the same set of weights every time.", "words": [{"w": "Naturally,", "b": [0.1294, 0.5073, 0.2293, 0.527]}, {"w": "a", "b": [0.2356, 0.5073, 0.2468, 0.527]}, {"w": "layer", "b": [0.2532, 0.5073, 0.3036, 0.527]}, {"w": "instance", "b": [0.3099, 0.5073, 0.3926, 0.527]}, {"w": "may", "b": [0.3989, 0.5073, 0.4423, 0.527]}, {"w": "be", "b": [0.4486, 0.5073, 0.4724, 0.527]}, {"w": "used", "b": [0.4787, 0.5073, 0.525, 0.527]}, {"w": "more", "b": [0.5313, 0.5073, 0.5831, 0.527]}, {"w": "than", "b": [0.5894, 0.5073, 0.6329, 0.527]}, {"w": "once—it", "b": [0.6392, 0.5073, 0.726, 0.527]}, {"w": "can", "b": [0.7323, 0.5073, 0.7674, 0.527]}, {"w": "be", "b": [0.7737, 0.5073, 0.7975, 0.527]}, {"w": "called", "b": [0.8038, 0.5073, 0.864, 0.527]}, {"w": "arbitrarily", "b": [0.1294, 0.5278, 0.2303, 0.5475]}, {"w": "many", "b": [0.2366, 0.5278, 0.2926, 0.5475]}, {"w": "times,", "b": [0.299, 0.5278, 0.3599, 0.5475]}, {"w": "reusing", "b": [0.3662, 0.5278, 0.4405, 0.5475]}, {"w": "the", "b": [0.4468, 0.5278, 0.4776, 0.5475]}, {"w": "same", "b": [0.4839, 0.5278, 0.5358, 0.5475]}, {"w": "set", "b": [0.5421, 0.5278, 0.5701, 0.5475]}, {"w": "of", "b": [0.5764, 0.5278, 0.5974, 0.5475]}, {"w": "weights", "b": [0.6037, 0.5278, 0.6822, 0.5475]}, {"w": "every", "b": [0.6884, 0.5278, 0.7445, 0.5475]}, {"w": "time.", "b": [0.7508, 0.5278, 0.8019, 0.5475]}]}, {"id": "b_3", "type": "paragraph", "text": "7.1.6. Models as layers", "words": [{"w": "7.1.6.", "b": [0.1294, 0.575, 0.1862, 0.5947]}, {"w": "Models", "b": [0.1925, 0.575, 0.271, 0.5947]}, {"w": "as", "b": [0.2773, 0.575, 0.2997, 0.5947]}, {"w": "layers", "b": [0.306, 0.575, 0.3704, 0.5947]}]}, {"id": "b_4", "type": "paragraph", "text": "Importantly, in the functional API, models can be used as you’d use layers—effectively, you can think of a model as a “bigger layer.” This is true of both the Sequential and Model classes. This means you can call a model on an input tensor and retrieve an output tensor:", "words": [{"w": "Importantly,", "b": [0.1294, 0.6178, 0.2532, 0.6375]}, {"w": "in", "b": [0.2595, 0.6178, 0.2791, 0.6375]}, {"w": "the", "b": [0.2854, 0.6178, 0.3162, 0.6375]}, {"w": "functional", "b": [0.3225, 0.6178, 0.4248, 0.6375]}, {"w": "API,", "b": [0.4311, 0.6178, 0.4781, 0.6375]}, {"w": "models", "b": [0.4844, 0.6178, 0.5573, 0.6375]}, {"w": "can", "b": [0.5636, 0.6178, 0.5986, 0.6375]}, {"w": "be", "b": [0.6049, 0.6178, 0.6287, 0.6375]}, {"w": "used", "b": [0.635, 0.6178, 0.6813, 0.6375]}, {"w": "as", "b": [0.6876, 0.6178, 0.7086, 0.6375]}, {"w": "you’d", "b": [0.7149, 0.6178, 0.7737, 0.6375]}, {"w": "use", "b": [0.78, 0.6178, 0.8137, 0.6375]}, {"w": "layers—effectively,", "b": [0.1294, 0.6383, 0.3269, 0.658]}, {"w": "you", "b": [0.3332, 0.6383, 0.3711, 0.658]}, {"w": "can", "b": [0.3774, 0.6383, 0.4124, 0.658]}, {"w": "think", "b": [0.4187, 0.6383, 0.4706, 0.658]}, {"w": "of", "b": [0.4769, 0.6383, 0.4979, 0.658]}, {"w": "a", "b": [0.5042, 0.6383, 0.5154, 0.658]}, {"w": "model", "b": [0.5217, 0.6383, 0.5848, 0.658]}, {"w": "as", "b": [0.5911, 0.6383, 0.6121, 0.658]}, {"w": "a", "b": [0.6184, 0.6383, 0.6296, 0.658]}, {"w": "“bigger", "b": [0.6359, 0.6383, 0.7115, 0.658]}, {"w": "layer.”", "b": [0.7178, 0.6383, 0.7843, 0.658]}, {"w": "This", "b": [0.7906, 0.6383, 0.8355, 0.658]}, {"w": "is", "b": [0.8418, 0.6383, 0.8586, 0.658]}, {"w": "true", "b": [0.1294, 0.6588, 0.1686, 0.6785]}, {"w": "of", "b": [0.1749, 0.6588, 0.196, 0.6785]}, {"w": "both", "b": [0.2023, 0.6588, 0.2471, 0.6785]}, {"w": "the", "b": [0.2534, 0.6588, 0.2842, 0.6785]}, {"w": "Sequential", "b": [0.2905, 0.6598, 0.4419, 0.68]}, {"w": "and", "b": [0.4482, 0.6588, 0.4846, 0.6785]}, {"w": "Model", "b": [0.4909, 0.6598, 0.5666, 0.68]}, {"w": "classes.", "b": [0.5729, 0.6588, 0.6493, 0.6785]}, {"w": "This", "b": [0.6556, 0.6588, 0.7004, 0.6785]}, {"w": "means", "b": [0.7067, 0.6588, 0.7712, 0.6785]}, {"w": "you", "b": [0.7775, 0.6588, 0.8153, 0.6785]}, {"w": "can", "b": [0.8216, 0.6588, 0.8567, 0.6785]}, {"w": "call", "b": [0.1294, 0.6802, 0.1658, 0.6999]}, {"w": "a", "b": [0.1721, 0.6802, 0.1833, 0.6999]}, {"w": "model", "b": [0.1897, 0.6802, 0.2527, 0.6999]}, {"w": "on", "b": [0.259, 0.6802, 0.2842, 0.6999]}, {"w": "an", "b": [0.2906, 0.6802, 0.3144, 0.6999]}, {"w": "input", "b": [0.3207, 0.6802, 0.3725, 0.6999]}, {"w": "tensor", "b": [0.3788, 0.6802, 0.4405, 0.6999]}, {"w": "and", "b": [0.4468, 0.6802, 0.4832, 0.6999]}, {"w": "retrieve", "b": [0.4895, 0.6802, 0.5666, 0.6999]}, {"w": "an", "b": [0.5729, 0.6802, 0.5967, 0.6999]}, {"w": "output", "b": [0.603, 0.6802, 0.6675, 0.6999]}, {"w": "tensor:", "b": [0.6738, 0.6802, 0.7424, 0.6999]}]}, {"id": "b_5", "type": "equation", "text": "y = model(x)", "words": [{"w": "y", "b": [0.1357, 0.7179, 0.1471, 0.7331]}, {"w": "=", "b": [0.1584, 0.7179, 0.1698, 0.7331]}, {"w": "model(x)", "b": [0.1811, 0.7179, 0.2719, 0.7331]}]}, {"id": "b_6", "type": "paragraph", "text": "If the model has multiple input tensors and multiple output tensors, it should be called with a list of tensors:", "words": [{"w": "If", "b": [0.1294, 0.7559, 0.1462, 0.7757]}, {"w": "the", "b": [0.1525, 0.7559, 0.1833, 0.7757]}, {"w": "model", "b": [0.1897, 0.7559, 0.2527, 0.7757]}, {"w": "has", "b": [0.259, 0.7559, 0.2926, 0.7757]}, {"w": "multiple", "b": [0.299, 0.7559, 0.3831, 0.7757]}, {"w": "input", "b": [0.3894, 0.7559, 0.4412, 0.7757]}, {"w": "tensors", "b": [0.4475, 0.7559, 0.519, 0.7757]}, {"w": "and", "b": [0.5253, 0.7559, 0.5617, 0.7757]}, {"w": "multiple", "b": [0.568, 0.7559, 0.6521, 0.7757]}, {"w": "output", "b": [0.6584, 0.7559, 0.7229, 0.7757]}, {"w": "tensors,", "b": [0.7292, 0.7559, 0.807, 0.7757]}, {"w": "it", "b": [0.8133, 0.7559, 0.8273, 0.7757]}, {"w": "should", "b": [0.1294, 0.7764, 0.1967, 0.7962]}, {"w": "be", "b": [0.203, 0.7764, 0.2268, 0.7962]}, {"w": "called", "b": [0.2331, 0.7764, 0.2934, 0.7962]}, {"w": "with", "b": [0.2997, 0.7764, 0.3445, 0.7962]}, {"w": "a", "b": [0.3508, 0.7764, 0.362, 0.7962]}, {"w": "list", "b": [0.3683, 0.7764, 0.3992, 0.7962]}, {"w": "of", "b": [0.4055, 0.7764, 0.4265, 0.7962]}, {"w": "tensors:", "b": [0.4328, 0.7764, 0.5113, 0.7962]}]}, {"id": "b_7", "type": "equation", "text": "y1, y2 = model([x1, x2])", "words": [{"w": "y1,", "b": [0.1357, 0.8142, 0.1698, 0.8293]}, {"w": "y2", "b": [0.1811, 0.8142, 0.2038, 0.8293]}, {"w": "=", "b": [0.2152, 0.8142, 0.2265, 0.8293]}, {"w": "model([x1,", "b": [0.2379, 0.8142, 0.3514, 0.8293]}, {"w": "x2])", "b": [0.3628, 0.8142, 0.4082, 0.8293]}]}, {"id": "b_8", "type": "paragraph", "text": "When you call a model instance, you’re reusing the weights of the model —exactly like what happens when you call a layer instance. Calling an instance, whether it’s a layer instance or a model instance, will always", "words": [{"w": "When", "b": [0.1294, 0.8522, 0.1897, 0.8719]}, {"w": "you", "b": [0.196, 0.8522, 0.2338, 0.8719]}, {"w": "call", "b": [0.2401, 0.8522, 0.2765, 0.8719]}, {"w": "a", "b": [0.2828, 0.8522, 0.294, 0.8719]}, {"w": "model", "b": [0.3003, 0.8522, 0.3634, 0.8719]}, {"w": "instance,", "b": [0.3697, 0.8522, 0.4587, 0.8719]}, {"w": "you’re", "b": [0.465, 0.8522, 0.5308, 0.8719]}, {"w": "reusing", "b": [0.5371, 0.8522, 0.6114, 0.8719]}, {"w": "the", "b": [0.6177, 0.8522, 0.6485, 0.8719]}, {"w": "weights", "b": [0.6548, 0.8522, 0.7333, 0.8719]}, {"w": "of", "b": [0.7396, 0.8522, 0.7606, 0.8719]}, {"w": "the", "b": [0.7669, 0.8522, 0.7978, 0.8719]}, {"w": "model", "b": [0.8041, 0.8522, 0.8671, 0.8719]}, {"w": "—exactly", "b": [0.1294, 0.8727, 0.2275, 0.8924]}, {"w": "like", "b": [0.2338, 0.8727, 0.2716, 0.8924]}, {"w": "what", "b": [0.2779, 0.8727, 0.327, 0.8924]}, {"w": "happens", "b": [0.3333, 0.8727, 0.416, 0.8924]}, {"w": "when", "b": [0.4223, 0.8727, 0.4769, 0.8924]}, {"w": "you", "b": [0.4832, 0.8727, 0.521, 0.8924]}, {"w": "call", "b": [0.5273, 0.8727, 0.5638, 0.8924]}, {"w": "a", "b": [0.5701, 0.8727, 0.5813, 0.8924]}, {"w": "layer", "b": [0.5876, 0.8727, 0.638, 0.8924]}, {"w": "instance.", "b": [0.6443, 0.8727, 0.7333, 0.8924]}, {"w": "Calling", "b": [0.7395, 0.8727, 0.8138, 0.8924]}, {"w": "an", "b": [0.8201, 0.8727, 0.8439, 0.8924]}, {"w": "instance,", "b": [0.1294, 0.8932, 0.2184, 0.9129]}, {"w": "whether", "b": [0.2247, 0.8932, 0.3059, 0.9129]}, {"w": "it’s", "b": [0.3122, 0.8932, 0.3431, 0.9129]}, {"w": "a", "b": [0.3494, 0.8932, 0.3606, 0.9129]}, {"w": "layer", "b": [0.3669, 0.8932, 0.4173, 0.9129]}, {"w": "instance", "b": [0.4236, 0.8932, 0.5063, 0.9129]}, {"w": "or", "b": [0.5126, 0.8932, 0.5336, 0.9129]}, {"w": "a", "b": [0.5399, 0.8932, 0.5511, 0.9129]}, {"w": "model", "b": [0.5574, 0.8932, 0.6205, 0.9129]}, {"w": "instance,", "b": [0.6268, 0.8932, 0.7157, 0.9129]}, {"w": "will", "b": [0.7221, 0.8932, 0.7613, 0.9129]}, {"w": "always", "b": [0.7676, 0.8932, 0.8377, 0.9129]}]}]}, {"page": 325, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "reuse the existing learned representations of the instance—which is intuitive.", "words": [{"w": "reuse", "b": [0.1294, 0.0857, 0.1826, 0.1054]}, {"w": "the", "b": [0.1889, 0.0857, 0.2198, 0.1054]}, {"w": "existing", "b": [0.2261, 0.0857, 0.306, 0.1054]}, {"w": "learned", "b": [0.3123, 0.0857, 0.3865, 0.1054]}, {"w": "representations", "b": [0.3928, 0.0857, 0.5455, 0.1054]}, {"w": "of", "b": [0.5518, 0.0857, 0.5728, 0.1054]}, {"w": "the", "b": [0.5791, 0.0857, 0.6099, 0.1054]}, {"w": "instance—which", "b": [0.6162, 0.0857, 0.7858, 0.1054]}, {"w": "is", "b": [0.7921, 0.0857, 0.8089, 0.1054]}, {"w": "intuitive.", "b": [0.1294, 0.1062, 0.2198, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "One simple practical example of what you can build by reusing a model instance is a vision model that uses a dual camera as its input: two parallel cameras, a few centimeters (one inch) apart. Such a model can perceive depth, which can be useful in many applications. You shouldn’t need two independent models to extract visual features from the left camera and the right camera before merging the two feeds. Such low- level processing can be shared across the two inputs: that is, done via layers that use the same weights and thus share the same representations. Here’s how you’d implement a Siamese vision model (shared convolutional base) in Keras:", "words": [{"w": "One", "b": [0.1294, 0.149, 0.1714, 0.1687]}, {"w": "simple", "b": [0.1777, 0.149, 0.245, 0.1687]}, {"w": "practical", "b": [0.2513, 0.149, 0.3382, 0.1687]}, {"w": "example", "b": [0.3445, 0.149, 0.43, 0.1687]}, {"w": "of", "b": [0.4363, 0.149, 0.4573, 0.1687]}, {"w": "what", "b": [0.4636, 0.149, 0.5126, 0.1687]}, {"w": "you", "b": [0.5189, 0.149, 0.5568, 0.1687]}, {"w": "can", "b": [0.5631, 0.149, 0.5981, 0.1687]}, {"w": "build", "b": [0.6044, 0.149, 0.6563, 0.1687]}, {"w": "by", "b": [0.6626, 0.149, 0.6878, 0.1687]}, {"w": "reusing", "b": [0.6941, 0.149, 0.7684, 0.1687]}, {"w": "a", "b": [0.7747, 0.149, 0.7859, 0.1687]}, {"w": "model", "b": [0.7922, 0.149, 0.8552, 0.1687]}, {"w": "instance", "b": [0.1294, 0.1695, 0.2121, 0.1892]}, {"w": "is", "b": [0.2184, 0.1695, 0.2352, 0.1892]}, {"w": "a", "b": [0.2415, 0.1695, 0.2527, 0.1892]}, {"w": "vision", "b": [0.259, 0.1695, 0.3207, 0.1892]}, {"w": "model", "b": [0.327, 0.1695, 0.3901, 0.1892]}, {"w": "that", "b": [0.3964, 0.1695, 0.4342, 0.1892]}, {"w": "uses", "b": [0.4405, 0.1695, 0.484, 0.1892]}, {"w": "a", "b": [0.4903, 0.1695, 0.5015, 0.1892]}, {"w": "dual", "b": [0.5078, 0.1695, 0.5512, 0.1892]}, {"w": "camera", "b": [0.5575, 0.1695, 0.6303, 0.1892]}, {"w": "as", "b": [0.6367, 0.1695, 0.6577, 0.1892]}, {"w": "its", "b": [0.6639, 0.1695, 0.6877, 0.1892]}, {"w": "input:", "b": [0.694, 0.1695, 0.7529, 0.1892]}, {"w": "two", "b": [0.7592, 0.1695, 0.797, 0.1892]}, {"w": "parallel", "b": [0.1294, 0.19, 0.2051, 0.2097]}, {"w": "cameras,", "b": [0.2114, 0.19, 0.3003, 0.2097]}, {"w": "a", "b": [0.3066, 0.19, 0.3178, 0.2097]}, {"w": "few", "b": [0.3241, 0.19, 0.3619, 0.2097]}, {"w": "centimeters", "b": [0.3682, 0.19, 0.4845, 0.2097]}, {"w": "(one", "b": [0.4908, 0.19, 0.5357, 0.2097]}, {"w": "inch)", "b": [0.542, 0.19, 0.5938, 0.2097]}, {"w": "apart.", "b": [0.6001, 0.19, 0.6569, 0.2097]}, {"w": "Such", "b": [0.6632, 0.19, 0.7136, 0.2097]}, {"w": "a", "b": [0.7199, 0.19, 0.7311, 0.2097]}, {"w": "model", "b": [0.7374, 0.19, 0.8005, 0.2097]}, {"w": "can", "b": [0.8068, 0.19, 0.8418, 0.2097]}, {"w": "perceive", "b": [0.1294, 0.2105, 0.2149, 0.2302]}, {"w": "depth,", "b": [0.2212, 0.2105, 0.2835, 0.2302]}, {"w": "which", "b": [0.2898, 0.2105, 0.3515, 0.2302]}, {"w": "can", "b": [0.3578, 0.2105, 0.3928, 0.2302]}, {"w": "be", "b": [0.3991, 0.2105, 0.4229, 0.2302]}, {"w": "useful", "b": [0.4292, 0.2105, 0.4909, 0.2302]}, {"w": "in", "b": [0.4971, 0.2105, 0.5167, 0.2302]}, {"w": "many", "b": [0.523, 0.2105, 0.5791, 0.2302]}, {"w": "applications.", "b": [0.5854, 0.2105, 0.7136, 0.2302]}, {"w": "You", "b": [0.7199, 0.2105, 0.7608, 0.2302]}, {"w": "shouldn’t", "b": [0.7671, 0.2105, 0.862, 0.2302]}, {"w": "need", "b": [0.1294, 0.231, 0.177, 0.2507]}, {"w": "two", "b": [0.1833, 0.231, 0.2212, 0.2507]}, {"w": "independent", "b": [0.2275, 0.231, 0.3508, 0.2507]}, {"w": "models", "b": [0.3571, 0.231, 0.43, 0.2507]}, {"w": "to", "b": [0.4363, 0.231, 0.4559, 0.2507]}, {"w": "extract", "b": [0.4622, 0.231, 0.5309, 0.2507]}, {"w": "visual", "b": [0.5372, 0.231, 0.5974, 0.2507]}, {"w": "features", "b": [0.6037, 0.231, 0.6836, 0.2507]}, {"w": "from", "b": [0.6899, 0.231, 0.7389, 0.2507]}, {"w": "the", "b": [0.7452, 0.231, 0.776, 0.2507]}, {"w": "left", "b": [0.7824, 0.231, 0.816, 0.2507]}, {"w": "camera", "b": [0.1294, 0.2515, 0.2022, 0.2712]}, {"w": "and", "b": [0.2085, 0.2515, 0.245, 0.2712]}, {"w": "the", "b": [0.2513, 0.2515, 0.2821, 0.2712]}, {"w": "right", "b": [0.2884, 0.2515, 0.3361, 0.2712]}, {"w": "camera", "b": [0.3423, 0.2515, 0.4151, 0.2712]}, {"w": "before", "b": [0.4214, 0.2515, 0.4859, 0.2712]}, {"w": "merging", "b": [0.4922, 0.2515, 0.5758, 0.2712]}, {"w": "the", "b": [0.5821, 0.2515, 0.6129, 0.2712]}, {"w": "two", "b": [0.6192, 0.2515, 0.657, 0.2712]}, {"w": "feeds.", "b": [0.6634, 0.2515, 0.7229, 0.2712]}, {"w": "Such", "b": [0.7292, 0.2515, 0.7796, 0.2712]}, {"w": "low-", "b": [0.7859, 0.2515, 0.8322, 0.2712]}, {"w": "level", "b": [0.1294, 0.272, 0.1785, 0.2917]}, {"w": "processing", "b": [0.1848, 0.272, 0.2926, 0.2917]}, {"w": "can", "b": [0.299, 0.272, 0.334, 0.2917]}, {"w": "be", "b": [0.3403, 0.272, 0.3641, 0.2917]}, {"w": "shared", "b": [0.3704, 0.272, 0.4362, 0.2917]}, {"w": "across", "b": [0.4425, 0.272, 0.5056, 0.2917]}, {"w": "the", "b": [0.5119, 0.272, 0.5427, 0.2917]}, {"w": "two", "b": [0.549, 0.272, 0.5869, 0.2917]}, {"w": "inputs:", "b": [0.5932, 0.272, 0.6619, 0.2917]}, {"w": "that", "b": [0.6682, 0.272, 0.706, 0.2917]}, {"w": "is,", "b": [0.7123, 0.272, 0.7354, 0.2917]}, {"w": "done", "b": [0.7417, 0.272, 0.7908, 0.2917]}, {"w": "via", "b": [0.7971, 0.272, 0.8279, 0.2917]}, {"w": "layers", "b": [0.1294, 0.2925, 0.1897, 0.3122]}, {"w": "that", "b": [0.1959, 0.2925, 0.2338, 0.3122]}, {"w": "use", "b": [0.2401, 0.2925, 0.2737, 0.3122]}, {"w": "the", "b": [0.28, 0.2925, 0.3108, 0.3122]}, {"w": "same", "b": [0.3172, 0.2925, 0.369, 0.3122]}, {"w": "weights", "b": [0.3753, 0.2925, 0.4538, 0.3122]}, {"w": "and", "b": [0.4601, 0.2925, 0.4965, 0.3122]}, {"w": "thus", "b": [0.5028, 0.2925, 0.5449, 0.3122]}, {"w": "share", "b": [0.5512, 0.2925, 0.6044, 0.3122]}, {"w": "the", "b": [0.6107, 0.2925, 0.6415, 0.3122]}, {"w": "same", "b": [0.6478, 0.2925, 0.6997, 0.3122]}, {"w": "representations.", "b": [0.706, 0.2925, 0.865, 0.3122]}, {"w": "Here’s", "b": [0.1294, 0.313, 0.1952, 0.3327]}, {"w": "how", "b": [0.2016, 0.313, 0.245, 0.3327]}, {"w": "you’d", "b": [0.2513, 0.313, 0.3101, 0.3327]}, {"w": "implement", "b": [0.3165, 0.313, 0.4244, 0.3327]}, {"w": "a", "b": [0.4307, 0.313, 0.4419, 0.3327]}, {"w": "Siamese", "b": [0.4482, 0.313, 0.5323, 0.3327]}, {"w": "vision", "b": [0.5386, 0.313, 0.6002, 0.3327]}, {"w": "model", "b": [0.6065, 0.313, 0.6696, 0.3327]}, {"w": "(shared", "b": [0.6759, 0.313, 0.7502, 0.3327]}, {"w": "convolutional", "b": [0.1294, 0.3335, 0.2682, 0.3532]}, {"w": "base)", "b": [0.2745, 0.3335, 0.3277, 0.3532]}, {"w": "in", "b": [0.334, 0.3335, 0.3536, 0.3532]}, {"w": "Keras:", "b": [0.3599, 0.3335, 0.4258, 0.3532]}]}, {"id": "b_2", "type": "paragraph", "text": "from keras import layers from keras import applications from keras import Input xception_base = applications.Xception(weights=None, include_top=False) 1 left_input = Input(shape=(250, 250, 3)) 2 right_input = Input(shape=(250, 250, 3)) 2 left_features = xception_base(left_input) 3 right_input = xception_base(right_input) 3 merged_features = layers.concatenate( [left_features, right_input], axis=-1) 4", "words": [{"w": "from", "b": [0.1357, 0.3712, 0.1811, 0.3863]}, {"w": "keras", "b": [0.1925, 0.3712, 0.2492, 0.3863]}, {"w": "import", "b": [0.2606, 0.3712, 0.3287, 0.3863]}, {"w": "layers", "b": [0.34, 0.3712, 0.4082, 0.3863]}, {"w": "from", "b": [0.1357, 0.3863, 0.1811, 0.4015]}, {"w": "keras", "b": [0.1925, 0.3863, 0.2492, 0.4015]}, {"w": "import", "b": [0.2606, 0.3863, 0.3287, 0.4015]}, {"w": "applications", "b": [0.34, 0.3863, 0.4763, 0.4015]}, {"w": "from", "b": [0.1357, 0.4015, 0.1811, 0.4166]}, {"w": "keras", "b": [0.1925, 0.4015, 0.2492, 0.4166]}, {"w": "import", "b": [0.2606, 0.4015, 0.3287, 0.4166]}, {"w": "Input", "b": [0.34, 0.4015, 0.3968, 0.4166]}, {"w": "xception_base", "b": [0.1357, 0.4318, 0.2833, 0.447]}, {"w": "=", "b": [0.2946, 0.4318, 0.306, 0.447]}, {"w": "applications.Xception(weights=None,", "b": [0.3173, 0.4318, 0.7146, 0.447]}, {"w": "include_top=False)", "b": [0.5671, 0.447, 0.7714, 0.4621]}, {"w": "1", "b": [0.8396, 0.447, 0.851, 0.4621]}, {"w": "left_input", "b": [0.1357, 0.4773, 0.2492, 0.4924]}, {"w": "=", "b": [0.2606, 0.4773, 0.2719, 0.4924]}, {"w": "Input(shape=(250,", "b": [0.2833, 0.4773, 0.4763, 0.4924]}, {"w": "250,", "b": [0.4876, 0.4773, 0.533, 0.4924]}, {"w": "3))", "b": [0.5444, 0.4773, 0.5784, 0.4924]}, {"w": "2", "b": [0.8396, 0.4773, 0.851, 0.4924]}, {"w": "right_input", "b": [0.1357, 0.4924, 0.2606, 0.5076]}, {"w": "=", "b": [0.2719, 0.4924, 0.2833, 0.5076]}, {"w": "Input(shape=(250,", "b": [0.2946, 0.4924, 0.4876, 0.5076]}, {"w": "250,", "b": [0.499, 0.4924, 0.5444, 0.5076]}, {"w": "3))", "b": [0.5557, 0.4924, 0.5898, 0.5076]}, {"w": "2", "b": [0.8396, 0.4924, 0.851, 0.5076]}, {"w": "left_features", "b": [0.1357, 0.5227, 0.2833, 0.5379]}, {"w": "=", "b": [0.2946, 0.5227, 0.306, 0.5379]}, {"w": "xception_base(left_input)", "b": [0.3173, 0.5227, 0.6011, 0.5379]}, {"w": "3", "b": [0.8396, 0.5227, 0.851, 0.5379]}, {"w": "right_input", "b": [0.1357, 0.5379, 0.2606, 0.553]}, {"w": "=", "b": [0.2719, 0.5379, 0.2833, 0.553]}, {"w": "xception_base(right_input)", "b": [0.2946, 0.5379, 0.5898, 0.553]}, {"w": "3", "b": [0.8396, 0.5379, 0.851, 0.553]}, {"w": "merged_features", "b": [0.1357, 0.5682, 0.306, 0.5833]}, {"w": "=", "b": [0.3173, 0.5682, 0.3287, 0.5833]}, {"w": "layers.concatenate(", "b": [0.34, 0.5682, 0.5557, 0.5833]}, {"w": "[left_features,", "b": [0.1811, 0.5833, 0.3514, 0.5985]}, {"w": "right_input],", "b": [0.3628, 0.5833, 0.5103, 0.5985]}, {"w": "axis=-1)", "b": [0.5217, 0.5833, 0.6125, 0.5985]}, {"w": "4", "b": [0.8396, 0.5833, 0.851, 0.5985]}]}, {"id": "b_3", "type": "paragraph", "text": "1 The base image-processing model is the Xception network (convolutional base only). 2 The inputs are 250 × 250 RGB images. 3 Calls the same vision model twice 4 The merged features contain information from the right visual feed and the left visual feed.", "words": [{"w": "1", "b": [0.1799, 0.6169, 0.1925, 0.6366]}, {"w": "The", "b": [0.1988, 0.6169, 0.2408, 0.6366]}, {"w": "base", "b": [0.2471, 0.6169, 0.2948, 0.6366]}, {"w": "image-processing", "b": [0.3011, 0.6169, 0.487, 0.6366]}, {"w": "model", "b": [0.4933, 0.6169, 0.5592, 0.6366]}, {"w": "is", "b": [0.5655, 0.6169, 0.5823, 0.6366]}, {"w": "the", "b": [0.5886, 0.6169, 0.6222, 0.6366]}, {"w": "Xception", "b": [0.6285, 0.6169, 0.7252, 0.6366]}, {"w": "network", "b": [0.7315, 0.6169, 0.8212, 0.6366]}, {"w": "(convolutional", "b": [0.1799, 0.6374, 0.334, 0.6571]}, {"w": "base", "b": [0.3403, 0.6374, 0.388, 0.6571]}, {"w": "only).", "b": [0.3943, 0.6374, 0.4553, 0.6571]}, {"w": "2", "b": [0.1799, 0.6579, 0.1925, 0.6776]}, {"w": "The", "b": [0.1988, 0.6579, 0.2408, 0.6776]}, {"w": "inputs", "b": [0.2471, 0.6579, 0.3144, 0.6776]}, {"w": "are", "b": [0.3207, 0.6579, 0.3553, 0.6776]}, {"w": "250", "b": [0.3616, 0.6579, 0.3995, 0.6776]}, {"w": "×", "b": [0.4058, 0.6579, 0.4201, 0.6776]}, {"w": "250", "b": [0.4265, 0.6579, 0.4643, 0.6776]}, {"w": "RGB", "b": [0.4706, 0.6579, 0.5253, 0.6776]}, {"w": "images.", "b": [0.5316, 0.6579, 0.6121, 0.6776]}, {"w": "3", "b": [0.1799, 0.6784, 0.1925, 0.6981]}, {"w": "Calls", "b": [0.1988, 0.6784, 0.2534, 0.6981]}, {"w": "the", "b": [0.2598, 0.6784, 0.2934, 0.6981]}, {"w": "same", "b": [0.2997, 0.6784, 0.3543, 0.6981]}, {"w": "vision", "b": [0.3606, 0.6784, 0.4237, 0.6981]}, {"w": "model", "b": [0.43, 0.6784, 0.4959, 0.6981]}, {"w": "twice", "b": [0.5022, 0.6784, 0.5582, 0.6981]}, {"w": "4", "b": [0.1799, 0.6989, 0.1925, 0.7186]}, {"w": "The", "b": [0.1988, 0.6989, 0.2408, 0.7186]}, {"w": "merged", "b": [0.2471, 0.6989, 0.3284, 0.7186]}, {"w": "features", "b": [0.3347, 0.6989, 0.4211, 0.7186]}, {"w": "contain", "b": [0.4274, 0.6989, 0.5073, 0.7186]}, {"w": "information", "b": [0.5136, 0.6989, 0.6425, 0.7186]}, {"w": "from", "b": [0.6488, 0.6989, 0.7016, 0.7186]}, {"w": "the", "b": [0.7079, 0.6989, 0.7415, 0.7186]}, {"w": "right", "b": [0.7478, 0.6989, 0.8011, 0.7186]}, {"w": "visual", "b": [0.8074, 0.6989, 0.8705, 0.7186]}, {"w": "feed", "b": [0.1799, 0.7194, 0.2247, 0.7391]}, {"w": "and", "b": [0.231, 0.7194, 0.2717, 0.7391]}, {"w": "the", "b": [0.278, 0.7194, 0.3116, 0.7391]}, {"w": "left", "b": [0.3179, 0.7194, 0.3529, 0.7391]}, {"w": "visual", "b": [0.3592, 0.7194, 0.4223, 0.7391]}, {"w": "feed.", "b": [0.4286, 0.7194, 0.4797, 0.7391]}]}, {"id": "b_4", "type": "paragraph", "text": "7.1.7. Wrapping up", "words": [{"w": "7.1.7.", "b": [0.1294, 0.7666, 0.1862, 0.7864]}, {"w": "Wrapping", "b": [0.1925, 0.7666, 0.3028, 0.7864]}, {"w": "up", "b": [0.3091, 0.7666, 0.3371, 0.7864]}]}, {"id": "b_5", "type": "paragraph", "text": "This concludes our introduction to the Keras functional API—an essential tool for building advanced deep neural network architectures. Now you know the following:", "words": [{"w": "This", "b": [0.1294, 0.8094, 0.1743, 0.8292]}, {"w": "concludes", "b": [0.1806, 0.8094, 0.2814, 0.8292]}, {"w": "our", "b": [0.2878, 0.8094, 0.3214, 0.8292]}, {"w": "introduction", "b": [0.3277, 0.8094, 0.451, 0.8292]}, {"w": "to", "b": [0.4573, 0.8094, 0.4769, 0.8292]}, {"w": "the", "b": [0.4833, 0.8094, 0.5141, 0.8292]}, {"w": "Keras", "b": [0.5204, 0.8094, 0.5792, 0.8292]}, {"w": "functional", "b": [0.5855, 0.8094, 0.6878, 0.8292]}, {"w": "API—an", "b": [0.6941, 0.8094, 0.7838, 0.8292]}, {"w": "essential", "b": [0.1294, 0.8299, 0.2163, 0.8497]}, {"w": "tool", "b": [0.2226, 0.8299, 0.2618, 0.8497]}, {"w": "for", "b": [0.2682, 0.8299, 0.2976, 0.8497]}, {"w": "building", "b": [0.3039, 0.8299, 0.388, 0.8497]}, {"w": "advanced", "b": [0.3943, 0.8299, 0.4895, 0.8497]}, {"w": "deep", "b": [0.4958, 0.8299, 0.5435, 0.8497]}, {"w": "neural", "b": [0.5498, 0.8299, 0.6128, 0.8497]}, {"w": "network", "b": [0.6191, 0.8299, 0.7018, 0.8497]}, {"w": "architectures.", "b": [0.7081, 0.8299, 0.8433, 0.8497]}, {"w": "Now", "b": [0.1294, 0.8504, 0.1785, 0.8702]}, {"w": "you", "b": [0.1848, 0.8504, 0.2226, 0.8702]}, {"w": "know", "b": [0.2289, 0.8504, 0.285, 0.8702]}, {"w": "the", "b": [0.2913, 0.8504, 0.3221, 0.8702]}, {"w": "following:", "b": [0.3284, 0.8504, 0.4335, 0.8702]}]}]}, {"page": 326, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "To step out of the Sequential API whenever you need anything more than a linear stack of layers How to build Keras models with several inputs, several outputs, and complex internal network topology, using the Keras functional API How to reuse the weights of a layer or model across different processing branches, by calling the same layer or model instance several times", "words": [{"w": "To", "b": [0.1799, 0.0857, 0.2061, 0.1054]}, {"w": "step", "b": [0.2124, 0.0857, 0.2531, 0.1054]}, {"w": "out", "b": [0.2594, 0.0857, 0.2916, 0.1054]}, {"w": "of", "b": [0.2979, 0.0857, 0.3189, 0.1054]}, {"w": "the", "b": [0.3252, 0.0857, 0.3561, 0.1054]}, {"w": "Sequential", "b": [0.3624, 0.0867, 0.5137, 0.1069]}, {"w": "API", "b": [0.52, 0.0857, 0.5607, 0.1054]}, {"w": "whenever", "b": [0.567, 0.0857, 0.665, 0.1054]}, {"w": "you", "b": [0.6713, 0.0857, 0.7092, 0.1054]}, {"w": "need", "b": [0.7155, 0.0857, 0.7631, 0.1054]}, {"w": "anything", "b": [0.7694, 0.0857, 0.8577, 0.1054]}, {"w": "more", "b": [0.1799, 0.1071, 0.2317, 0.1268]}, {"w": "than", "b": [0.238, 0.1071, 0.2814, 0.1268]}, {"w": "a", "b": [0.2878, 0.1071, 0.299, 0.1268]}, {"w": "linear", "b": [0.3053, 0.1071, 0.3627, 0.1268]}, {"w": "stack", "b": [0.369, 0.1071, 0.4208, 0.1268]}, {"w": "of", "b": [0.4272, 0.1071, 0.4482, 0.1268]}, {"w": "layers", "b": [0.4545, 0.1071, 0.5147, 0.1268]}, {"w": "How", "b": [0.1799, 0.1276, 0.2289, 0.1473]}, {"w": "to", "b": [0.2352, 0.1276, 0.2548, 0.1473]}, {"w": "build", "b": [0.2611, 0.1276, 0.313, 0.1473]}, {"w": "Keras", "b": [0.3193, 0.1276, 0.3781, 0.1473]}, {"w": "models", "b": [0.3844, 0.1276, 0.4573, 0.1473]}, {"w": "with", "b": [0.4636, 0.1276, 0.5085, 0.1473]}, {"w": "several", "b": [0.5148, 0.1276, 0.5862, 0.1473]}, {"w": "inputs,", "b": [0.5925, 0.1276, 0.6605, 0.1473]}, {"w": "several", "b": [0.6668, 0.1276, 0.7383, 0.1473]}, {"w": "outputs,", "b": [0.7446, 0.1276, 0.8252, 0.1473]}, {"w": "and", "b": [0.8315, 0.1276, 0.8679, 0.1473]}, {"w": "complex", "b": [0.1799, 0.1481, 0.2667, 0.1678]}, {"w": "internal", "b": [0.273, 0.1481, 0.3501, 0.1678]}, {"w": "network", "b": [0.3564, 0.1481, 0.4391, 0.1678]}, {"w": "topology,", "b": [0.4454, 0.1481, 0.5397, 0.1678]}, {"w": "using", "b": [0.546, 0.1481, 0.6007, 0.1678]}, {"w": "the", "b": [0.607, 0.1481, 0.6378, 0.1678]}, {"w": "Keras", "b": [0.6441, 0.1481, 0.7029, 0.1678]}, {"w": "functional", "b": [0.7093, 0.1481, 0.8115, 0.1678]}, {"w": "API", "b": [0.8178, 0.1481, 0.8585, 0.1678]}, {"w": "How", "b": [0.1799, 0.1686, 0.2289, 0.1883]}, {"w": "to", "b": [0.2352, 0.1686, 0.2548, 0.1883]}, {"w": "reuse", "b": [0.2611, 0.1686, 0.3144, 0.1883]}, {"w": "the", "b": [0.3207, 0.1686, 0.3515, 0.1883]}, {"w": "weights", "b": [0.3578, 0.1686, 0.4363, 0.1883]}, {"w": "of", "b": [0.4426, 0.1686, 0.4636, 0.1883]}, {"w": "a", "b": [0.4699, 0.1686, 0.4811, 0.1883]}, {"w": "layer", "b": [0.4874, 0.1686, 0.5378, 0.1883]}, {"w": "or", "b": [0.5441, 0.1686, 0.5652, 0.1883]}, {"w": "model", "b": [0.5715, 0.1686, 0.6345, 0.1883]}, {"w": "across", "b": [0.6408, 0.1686, 0.7039, 0.1883]}, {"w": "different", "b": [0.7102, 0.1686, 0.7965, 0.1883]}, {"w": "processing", "b": [0.1799, 0.1891, 0.2878, 0.2088]}, {"w": "branches,", "b": [0.2941, 0.1891, 0.39, 0.2088]}, {"w": "by", "b": [0.3963, 0.1891, 0.4216, 0.2088]}, {"w": "calling", "b": [0.4279, 0.1891, 0.4965, 0.2088]}, {"w": "the", "b": [0.5028, 0.1891, 0.5337, 0.2088]}, {"w": "same", "b": [0.54, 0.1891, 0.5918, 0.2088]}, {"w": "layer", "b": [0.5981, 0.1891, 0.6485, 0.2088]}, {"w": "or", "b": [0.6548, 0.1891, 0.6759, 0.2088]}, {"w": "model", "b": [0.6822, 0.1891, 0.7452, 0.2088]}, {"w": "instance", "b": [0.7515, 0.1891, 0.8342, 0.2088]}, {"w": "several", "b": [0.1799, 0.2096, 0.2513, 0.2293]}, {"w": "times", "b": [0.2576, 0.2096, 0.3123, 0.2293]}]}, {"id": "b_1", "type": "paragraph", "text": "7.2. Inspecting and monitoring deep-learning models using Keras callba- acks and TensorBoard", "words": [{"w": "7.2.", "b": [0.1294, 0.2664, 0.172, 0.2886]}, {"w": "Inspecting", "b": [0.1791, 0.2664, 0.3052, 0.2886]}, {"w": "and", "b": [0.3123, 0.2664, 0.3581, 0.2886]}, {"w": "monitoring", "b": [0.3652, 0.2664, 0.5008, 0.2886]}, {"w": "deep-learning", "b": [0.5078, 0.2664, 0.675, 0.2886]}, {"w": "models", "b": [0.6821, 0.2664, 0.7672, 0.2886]}, {"w": "using", "b": [0.7743, 0.2664, 0.839, 0.2886]}, {"w": "Keras", "b": [0.1294, 0.2905, 0.2019, 0.3127]}, {"w": "callba-", "b": [0.209, 0.2905, 0.291, 0.3127]}, {"w": "acks", "b": [0.2981, 0.2905, 0.3517, 0.3127]}, {"w": "and", "b": [0.3588, 0.2905, 0.4045, 0.3127]}, {"w": "TensorBoard", "b": [0.4116, 0.2905, 0.5699, 0.3127]}]}, {"id": "b_2", "type": "paragraph", "text": "In this section, we’ll review ways to gain greater access to and control over what goes on inside your model during training. Launching a training run on a large dataset for tens of epochs using model.fit() or model.fit_generator() can be a bit like launching a paper airplane: past the initial impulse, you don’t have any control over its trajectory or its landing spot. If you want to avoid bad outcomes (and thus wasted paper airplanes), it’s smarter to use not a paper plane, but a drone that can sense its environment, send data back to its operator, and automatically make steering decisions based on its current state. The techniques we present here will transform the call to model.fit() from a paper airplane into a smart, autonomous drone that can self- introspect and dynamically take action.", "words": [{"w": "In", "b": [0.1294, 0.3361, 0.1504, 0.3559]}, {"w": "this", "b": [0.1567, 0.3361, 0.1932, 0.3559]}, {"w": "section,", "b": [0.1995, 0.3361, 0.2773, 0.3559]}, {"w": "we’ll", "b": [0.2836, 0.3361, 0.3354, 0.3559]}, {"w": "review", "b": [0.3417, 0.3361, 0.4104, 0.3559]}, {"w": "ways", "b": [0.4167, 0.3361, 0.4685, 0.3559]}, {"w": "to", "b": [0.4748, 0.3361, 0.4944, 0.3559]}, {"w": "gain", "b": [0.5007, 0.3361, 0.5442, 0.3559]}, {"w": "greater", "b": [0.5505, 0.3361, 0.6205, 0.3559]}, {"w": "access", "b": [0.6268, 0.3361, 0.6912, 0.3559]}, {"w": "to", "b": [0.6975, 0.3361, 0.7172, 0.3559]}, {"w": "and", "b": [0.7235, 0.3361, 0.7599, 0.3559]}, {"w": "control", "b": [0.7662, 0.3361, 0.8377, 0.3559]}, {"w": "over", "b": [0.1294, 0.3566, 0.1742, 0.3764]}, {"w": "what", "b": [0.1805, 0.3566, 0.2296, 0.3764]}, {"w": "goes", "b": [0.2359, 0.3566, 0.2821, 0.3764]}, {"w": "on", "b": [0.2884, 0.3566, 0.3137, 0.3764]}, {"w": "inside", "b": [0.32, 0.3566, 0.3802, 0.3764]}, {"w": "your", "b": [0.3865, 0.3566, 0.4328, 0.3764]}, {"w": "model", "b": [0.4391, 0.3566, 0.5021, 0.3764]}, {"w": "during", "b": [0.5085, 0.3566, 0.5743, 0.3764]}, {"w": "training.", "b": [0.5806, 0.3566, 0.6654, 0.3764]}, {"w": "Launching", "b": [0.6717, 0.3566, 0.7796, 0.3764]}, {"w": "a", "b": [0.7859, 0.3566, 0.7971, 0.3764]}, {"w": "training", "b": [0.1294, 0.3771, 0.2079, 0.3969]}, {"w": "run", "b": [0.2142, 0.3771, 0.2478, 0.3969]}, {"w": "on", "b": [0.2541, 0.3771, 0.2794, 0.3969]}, {"w": "a", "b": [0.2857, 0.3771, 0.2969, 0.3969]}, {"w": "large", "b": [0.3032, 0.3771, 0.3531, 0.3969]}, {"w": "dataset", "b": [0.3594, 0.3771, 0.4295, 0.3969]}, {"w": "for", "b": [0.4358, 0.3771, 0.4652, 0.3969]}, {"w": "tens", "b": [0.4715, 0.3771, 0.5121, 0.3969]}, {"w": "of", "b": [0.5184, 0.3771, 0.5395, 0.3969]}, {"w": "epochs", "b": [0.5458, 0.3771, 0.6158, 0.3969]}, {"w": "using", "b": [0.6221, 0.3771, 0.6768, 0.3969]}, {"w": "model.fit()", "b": [0.6831, 0.3782, 0.8495, 0.3984]}, {"w": "or", "b": [0.1294, 0.3985, 0.1504, 0.4183]}, {"w": "model.fit_generator()", "b": [0.1567, 0.3996, 0.4746, 0.4198]}, {"w": "can", "b": [0.4809, 0.3985, 0.5159, 0.4183]}, {"w": "be", "b": [0.5222, 0.3985, 0.5461, 0.4183]}, {"w": "a", "b": [0.5524, 0.3985, 0.5636, 0.4183]}, {"w": "bit", "b": [0.5699, 0.3985, 0.5965, 0.4183]}, {"w": "like", "b": [0.6028, 0.3985, 0.6406, 0.4183]}, {"w": "launching", "b": [0.647, 0.3985, 0.7464, 0.4183]}, {"w": "a", "b": [0.7528, 0.3985, 0.764, 0.4183]}, {"w": "paper", "b": [0.7703, 0.3985, 0.8263, 0.4183]}, {"w": "airplane:", "b": [0.1294, 0.4199, 0.2177, 0.4397]}, {"w": "past", "b": [0.224, 0.4199, 0.2646, 0.4397]}, {"w": "the", "b": [0.2709, 0.4199, 0.3018, 0.4397]}, {"w": "initial", "b": [0.3081, 0.4199, 0.3669, 0.4397]}, {"w": "impulse,", "b": [0.3732, 0.4199, 0.4594, 0.4397]}, {"w": "you", "b": [0.4657, 0.4199, 0.5036, 0.4397]}, {"w": "don’t", "b": [0.5099, 0.4199, 0.5626, 0.4397]}, {"w": "have", "b": [0.5689, 0.4199, 0.6165, 0.4397]}, {"w": "any", "b": [0.6229, 0.4199, 0.6593, 0.4397]}, {"w": "control", "b": [0.6656, 0.4199, 0.7371, 0.4397]}, {"w": "over", "b": [0.7434, 0.4199, 0.7882, 0.4397]}, {"w": "its", "b": [0.7945, 0.4199, 0.8183, 0.4397]}, {"w": "trajectory", "b": [0.1294, 0.4404, 0.2261, 0.4602]}, {"w": "or", "b": [0.2324, 0.4404, 0.2534, 0.4602]}, {"w": "its", "b": [0.2597, 0.4404, 0.2835, 0.4602]}, {"w": "landing", "b": [0.2898, 0.4404, 0.3655, 0.4602]}, {"w": "spot.", "b": [0.3718, 0.4404, 0.4202, 0.4602]}, {"w": "If", "b": [0.4265, 0.4404, 0.4433, 0.4602]}, {"w": "you", "b": [0.4496, 0.4404, 0.4874, 0.4602]}, {"w": "want", "b": [0.4937, 0.4404, 0.5428, 0.4602]}, {"w": "to", "b": [0.5491, 0.4404, 0.5687, 0.4602]}, {"w": "avoid", "b": [0.575, 0.4404, 0.6311, 0.4602]}, {"w": "bad", "b": [0.6374, 0.4404, 0.6738, 0.4602]}, {"w": "outcomes", "b": [0.6801, 0.4404, 0.7768, 0.4602]}, {"w": "(and", "b": [0.7831, 0.4404, 0.8279, 0.4602]}, {"w": "thus", "b": [0.1294, 0.4609, 0.1715, 0.4807]}, {"w": "wasted", "b": [0.1778, 0.4609, 0.2478, 0.4807]}, {"w": "paper", "b": [0.2541, 0.4609, 0.3102, 0.4807]}, {"w": "airplanes),", "b": [0.3165, 0.4609, 0.4222, 0.4807]}, {"w": "it’s", "b": [0.4285, 0.4609, 0.4594, 0.4807]}, {"w": "smarter", "b": [0.4657, 0.4609, 0.5413, 0.4807]}, {"w": "to", "b": [0.5476, 0.4609, 0.5672, 0.4807]}, {"w": "use", "b": [0.5735, 0.4609, 0.6072, 0.4807]}, {"w": "not", "b": [0.6135, 0.4609, 0.6457, 0.4807]}, {"w": "a", "b": [0.652, 0.4609, 0.6632, 0.4807]}, {"w": "paper", "b": [0.6695, 0.4609, 0.7256, 0.4807]}, {"w": "plane,", "b": [0.7319, 0.4609, 0.7928, 0.4807]}, {"w": "but", "b": [0.7991, 0.4609, 0.8313, 0.4807]}, {"w": "a", "b": [0.8376, 0.4609, 0.8488, 0.4807]}, {"w": "drone", "b": [0.1294, 0.4814, 0.1869, 0.5012]}, {"w": "that", "b": [0.1932, 0.4814, 0.231, 0.5012]}, {"w": "can", "b": [0.2373, 0.4814, 0.2723, 0.5012]}, {"w": "sense", "b": [0.2786, 0.4814, 0.3333, 0.5012]}, {"w": "its", "b": [0.3396, 0.4814, 0.3634, 0.5012]}, {"w": "environment,", "b": [0.3697, 0.4814, 0.5035, 0.5012]}, {"w": "send", "b": [0.5098, 0.4814, 0.5561, 0.5012]}, {"w": "data", "b": [0.5624, 0.4814, 0.6044, 0.5012]}, {"w": "back", "b": [0.6107, 0.4814, 0.6583, 0.5012]}, {"w": "to", "b": [0.6647, 0.4814, 0.6843, 0.5012]}, {"w": "its", "b": [0.6906, 0.4814, 0.7144, 0.5012]}, {"w": "operator,", "b": [0.7207, 0.4814, 0.81, 0.5012]}, {"w": "and", "b": [0.8163, 0.4814, 0.8527, 0.5012]}, {"w": "automatically", "b": [0.1294, 0.5019, 0.2667, 0.5217]}, {"w": "make", "b": [0.273, 0.5019, 0.3277, 0.5217]}, {"w": "steering", "b": [0.334, 0.5019, 0.4139, 0.5217]}, {"w": "decisions", "b": [0.4202, 0.5019, 0.5141, 0.5217]}, {"w": "based", "b": [0.5204, 0.5019, 0.5778, 0.5217]}, {"w": "on", "b": [0.584, 0.5019, 0.6093, 0.5217]}, {"w": "its", "b": [0.6156, 0.5019, 0.6394, 0.5217]}, {"w": "current", "b": [0.6457, 0.5019, 0.7171, 0.5217]}, {"w": "state.", "b": [0.7235, 0.5019, 0.776, 0.5217]}, {"w": "The", "b": [0.7823, 0.5019, 0.8215, 0.5217]}, {"w": "techniques", "b": [0.1294, 0.5224, 0.2373, 0.5422]}, {"w": "we", "b": [0.2436, 0.5224, 0.273, 0.5422]}, {"w": "present", "b": [0.2793, 0.5224, 0.3522, 0.5422]}, {"w": "here", "b": [0.3585, 0.5224, 0.4019, 0.5422]}, {"w": "will", "b": [0.4082, 0.5224, 0.4475, 0.5422]}, {"w": "transform", "b": [0.4538, 0.5224, 0.5518, 0.5422]}, {"w": "the", "b": [0.5581, 0.5224, 0.589, 0.5422]}, {"w": "call", "b": [0.5953, 0.5224, 0.6317, 0.5422]}, {"w": "to", "b": [0.638, 0.5224, 0.6576, 0.5422]}, {"w": "model.fit()", "b": [0.6639, 0.5235, 0.8304, 0.5437]}, {"w": "from", "b": [0.1294, 0.5438, 0.1785, 0.5636]}, {"w": "a", "b": [0.1848, 0.5438, 0.196, 0.5636]}, {"w": "paper", "b": [0.2023, 0.5438, 0.2583, 0.5636]}, {"w": "airplane", "b": [0.2646, 0.5438, 0.3458, 0.5636]}, {"w": "into", "b": [0.3522, 0.5438, 0.3914, 0.5636]}, {"w": "a", "b": [0.3977, 0.5438, 0.4089, 0.5636]}, {"w": "smart,", "b": [0.4152, 0.5438, 0.4776, 0.5636]}, {"w": "autonomous", "b": [0.4839, 0.5438, 0.6072, 0.5636]}, {"w": "drone", "b": [0.6135, 0.5438, 0.671, 0.5636]}, {"w": "that", "b": [0.6773, 0.5438, 0.7151, 0.5636]}, {"w": "can", "b": [0.7214, 0.5438, 0.7564, 0.5636]}, {"w": "self-", "b": [0.7627, 0.5438, 0.8076, 0.5636]}, {"w": "introspect", "b": [0.1294, 0.5643, 0.2289, 0.5841]}, {"w": "and", "b": [0.2352, 0.5643, 0.2716, 0.5841]}, {"w": "dynamically", "b": [0.2779, 0.5643, 0.4027, 0.5841]}, {"w": "take", "b": [0.409, 0.5643, 0.451, 0.5841]}, {"w": "action.", "b": [0.4573, 0.5643, 0.5253, 0.5841]}]}, {"id": "b_3", "type": "paragraph", "text": "7.2.1. Using callbacks to act on a model during training", "words": [{"w": "7.2.1.", "b": [0.1294, 0.6116, 0.1862, 0.6313]}, {"w": "Using", "b": [0.1925, 0.6116, 0.2542, 0.6313]}, {"w": "callbacks", "b": [0.2605, 0.6116, 0.36, 0.6313]}, {"w": "to", "b": [0.3663, 0.6116, 0.3873, 0.6313]}, {"w": "act", "b": [0.3936, 0.6116, 0.4258, 0.6313]}, {"w": "on", "b": [0.4321, 0.6116, 0.4588, 0.6313]}, {"w": "a", "b": [0.4651, 0.6116, 0.4777, 0.6313]}, {"w": "model", "b": [0.484, 0.6116, 0.5498, 0.6313]}, {"w": "during", "b": [0.5562, 0.6116, 0.6291, 0.6313]}, {"w": "training", "b": [0.6354, 0.6116, 0.7223, 0.6313]}]}, {"id": "b_4", "type": "paragraph", "text": "When you’re training a model, there are many things you can’t predict from the start. In particular, you can’t tell how many epochs will be needed to get to an optimal validation loss. The examples so far have adopted the strategy of training for enough epochs that you begin overfitting, using the first run to figure out the proper number of epochs to train for, and then finally launching a new training run from scratch using this optimal number. Of course, this approach is wasteful.", "words": [{"w": "When", "b": [0.1294, 0.6543, 0.1897, 0.6741]}, {"w": "you’re", "b": [0.196, 0.6543, 0.2618, 0.6741]}, {"w": "training", "b": [0.2681, 0.6543, 0.3466, 0.6741]}, {"w": "a", "b": [0.3529, 0.6543, 0.3641, 0.6741]}, {"w": "model,", "b": [0.3704, 0.6543, 0.4398, 0.6741]}, {"w": "there", "b": [0.4461, 0.6543, 0.4965, 0.6741]}, {"w": "are", "b": [0.5028, 0.6543, 0.5336, 0.6741]}, {"w": "many", "b": [0.5399, 0.6543, 0.596, 0.6741]}, {"w": "things", "b": [0.6023, 0.6543, 0.6639, 0.6741]}, {"w": "you", "b": [0.6703, 0.6543, 0.7081, 0.6741]}, {"w": "can’t", "b": [0.7144, 0.6543, 0.7643, 0.6741]}, {"w": "predict", "b": [0.7706, 0.6543, 0.8406, 0.6741]}, {"w": "from", "b": [0.1294, 0.6748, 0.1785, 0.6946]}, {"w": "the", "b": [0.1848, 0.6748, 0.2156, 0.6946]}, {"w": "start.", "b": [0.2219, 0.6748, 0.2716, 0.6946]}, {"w": "In", "b": [0.2779, 0.6748, 0.299, 0.6946]}, {"w": "particular,", "b": [0.3053, 0.6748, 0.4072, 0.6946]}, {"w": "you", "b": [0.4135, 0.6748, 0.4513, 0.6946]}, {"w": "can’t", "b": [0.4576, 0.6748, 0.5076, 0.6946]}, {"w": "tell", "b": [0.5139, 0.6748, 0.5461, 0.6946]}, {"w": "how", "b": [0.5524, 0.6748, 0.5959, 0.6946]}, {"w": "many", "b": [0.6022, 0.6748, 0.6582, 0.6946]}, {"w": "epochs", "b": [0.6645, 0.6748, 0.7346, 0.6946]}, {"w": "will", "b": [0.7409, 0.6748, 0.7801, 0.6946]}, {"w": "be", "b": [0.7864, 0.6748, 0.8102, 0.6946]}, {"w": "needed", "b": [0.1294, 0.6953, 0.2009, 0.7151]}, {"w": "to", "b": [0.2072, 0.6953, 0.2268, 0.7151]}, {"w": "get", "b": [0.2331, 0.6953, 0.2639, 0.7151]}, {"w": "to", "b": [0.2702, 0.6953, 0.2898, 0.7151]}, {"w": "an", "b": [0.2962, 0.6953, 0.32, 0.7151]}, {"w": "optimal", "b": [0.3263, 0.6953, 0.4034, 0.7151]}, {"w": "validation", "b": [0.4097, 0.6953, 0.5106, 0.7151]}, {"w": "loss.", "b": [0.5169, 0.6953, 0.5624, 0.7151]}, {"w": "The", "b": [0.5687, 0.6953, 0.608, 0.7151]}, {"w": "examples", "b": [0.6143, 0.6953, 0.7096, 0.7151]}, {"w": "so", "b": [0.7159, 0.6953, 0.7383, 0.7151]}, {"w": "far", "b": [0.7446, 0.6953, 0.7726, 0.7151]}, {"w": "have", "b": [0.7789, 0.6953, 0.8265, 0.7151]}, {"w": "adopted", "b": [0.1294, 0.7158, 0.2093, 0.7356]}, {"w": "the", "b": [0.2156, 0.7158, 0.2464, 0.7356]}, {"w": "strategy", "b": [0.2527, 0.7158, 0.3326, 0.7356]}, {"w": "of", "b": [0.3389, 0.7158, 0.3599, 0.7356]}, {"w": "training", "b": [0.3662, 0.7158, 0.4447, 0.7356]}, {"w": "for", "b": [0.451, 0.7158, 0.4804, 0.7356]}, {"w": "enough", "b": [0.4867, 0.7158, 0.5609, 0.7356]}, {"w": "epochs", "b": [0.5672, 0.7158, 0.6373, 0.7356]}, {"w": "that", "b": [0.6436, 0.7158, 0.6814, 0.7356]}, {"w": "you", "b": [0.6877, 0.7158, 0.7256, 0.7356]}, {"w": "begin", "b": [0.7319, 0.7158, 0.7879, 0.7356]}, {"w": "overfitting,", "b": [0.1294, 0.7363, 0.2422, 0.7561]}, {"w": "using", "b": [0.2485, 0.7363, 0.3032, 0.7561]}, {"w": "the", "b": [0.3095, 0.7363, 0.3403, 0.7561]}, {"w": "first", "b": [0.3466, 0.7363, 0.3873, 0.7561]}, {"w": "run", "b": [0.3936, 0.7363, 0.4272, 0.7561]}, {"w": "to", "b": [0.4335, 0.7363, 0.4531, 0.7561]}, {"w": "figure", "b": [0.4594, 0.7363, 0.5197, 0.7561]}, {"w": "out", "b": [0.526, 0.7363, 0.5582, 0.7561]}, {"w": "the", "b": [0.5645, 0.7363, 0.5954, 0.7561]}, {"w": "proper", "b": [0.6017, 0.7363, 0.6675, 0.7561]}, {"w": "number", "b": [0.6738, 0.7363, 0.7509, 0.7561]}, {"w": "of", "b": [0.7572, 0.7363, 0.7782, 0.7561]}, {"w": "epochs", "b": [0.7845, 0.7363, 0.8546, 0.7561]}, {"w": "to", "b": [0.1294, 0.7568, 0.149, 0.7766]}, {"w": "train", "b": [0.1553, 0.7568, 0.2016, 0.7766]}, {"w": "for,", "b": [0.2079, 0.7568, 0.2426, 0.7766]}, {"w": "and", "b": [0.2489, 0.7568, 0.2853, 0.7766]}, {"w": "then", "b": [0.2916, 0.7568, 0.335, 0.7766]}, {"w": "finally", "b": [0.3414, 0.7568, 0.4072, 0.7766]}, {"w": "launching", "b": [0.4135, 0.7568, 0.513, 0.7766]}, {"w": "a", "b": [0.5193, 0.7568, 0.5305, 0.7766]}, {"w": "new", "b": [0.5368, 0.7568, 0.5789, 0.7766]}, {"w": "training", "b": [0.5852, 0.7568, 0.6636, 0.7766]}, {"w": "run", "b": [0.6699, 0.7568, 0.7036, 0.7766]}, {"w": "from", "b": [0.7099, 0.7568, 0.7589, 0.7766]}, {"w": "scratch", "b": [0.7652, 0.7568, 0.8367, 0.7766]}, {"w": "using", "b": [0.1294, 0.7773, 0.1841, 0.7971]}, {"w": "this", "b": [0.1904, 0.7773, 0.2268, 0.7971]}, {"w": "optimal", "b": [0.2331, 0.7773, 0.3102, 0.7971]}, {"w": "number.", "b": [0.3165, 0.7773, 0.3985, 0.7971]}, {"w": "Of", "b": [0.4048, 0.7773, 0.4314, 0.7971]}, {"w": "course,", "b": [0.4377, 0.7773, 0.5099, 0.7971]}, {"w": "this", "b": [0.5162, 0.7773, 0.5526, 0.7971]}, {"w": "approach", "b": [0.5589, 0.7773, 0.6514, 0.7971]}, {"w": "is", "b": [0.6577, 0.7773, 0.6745, 0.7971]}, {"w": "wasteful.", "b": [0.6808, 0.7773, 0.7726, 0.7971]}]}, {"id": "b_5", "type": "paragraph", "text": "A much better way to handle this is to stop training when you measure that the validation loss in no longer improving. This can be achieved using a Keras callback. A callback is an object (a class instance implementing specific methods) that is passed to the model in the call to", "words": [{"w": "A", "b": [0.1294, 0.8201, 0.1476, 0.8399]}, {"w": "much", "b": [0.1539, 0.8201, 0.21, 0.8399]}, {"w": "better", "b": [0.2163, 0.8201, 0.2737, 0.8399]}, {"w": "way", "b": [0.28, 0.8201, 0.3221, 0.8399]}, {"w": "to", "b": [0.3284, 0.8201, 0.348, 0.8399]}, {"w": "handle", "b": [0.3543, 0.8201, 0.4216, 0.8399]}, {"w": "this", "b": [0.4279, 0.8201, 0.4643, 0.8399]}, {"w": "is", "b": [0.4706, 0.8201, 0.4874, 0.8399]}, {"w": "to", "b": [0.4937, 0.8201, 0.5134, 0.8399]}, {"w": "stop", "b": [0.5197, 0.8201, 0.5617, 0.8399]}, {"w": "training", "b": [0.568, 0.8201, 0.6465, 0.8399]}, {"w": "when", "b": [0.6528, 0.8201, 0.7075, 0.8399]}, {"w": "you", "b": [0.7138, 0.8201, 0.7516, 0.8399]}, {"w": "measure", "b": [0.7579, 0.8201, 0.842, 0.8399]}, {"w": "that", "b": [0.1294, 0.8406, 0.1673, 0.8604]}, {"w": "the", "b": [0.1736, 0.8406, 0.2044, 0.8604]}, {"w": "validation", "b": [0.2107, 0.8406, 0.3116, 0.8604]}, {"w": "loss", "b": [0.3179, 0.8406, 0.3572, 0.8604]}, {"w": "in", "b": [0.3635, 0.8406, 0.3831, 0.8604]}, {"w": "no", "b": [0.3894, 0.8406, 0.4146, 0.8604]}, {"w": "longer", "b": [0.4209, 0.8406, 0.4854, 0.8604]}, {"w": "improving.", "b": [0.4917, 0.8406, 0.6031, 0.8604]}, {"w": "This", "b": [0.6094, 0.8406, 0.6543, 0.8604]}, {"w": "can", "b": [0.6605, 0.8406, 0.6955, 0.8604]}, {"w": "be", "b": [0.7018, 0.8406, 0.7256, 0.8604]}, {"w": "achieved", "b": [0.7319, 0.8406, 0.8216, 0.8604]}, {"w": "using", "b": [0.1294, 0.8611, 0.1841, 0.8809]}, {"w": "a", "b": [0.1904, 0.8611, 0.2016, 0.8809]}, {"w": "Keras", "b": [0.2079, 0.8611, 0.2667, 0.8809]}, {"w": "callback.", "b": [0.273, 0.8611, 0.3634, 0.8809]}, {"w": "A", "b": [0.3697, 0.8611, 0.3879, 0.8809]}, {"w": "callback", "b": [0.3942, 0.8611, 0.4796, 0.8809]}, {"w": "is", "b": [0.4859, 0.8611, 0.5027, 0.8809]}, {"w": "an", "b": [0.5091, 0.8611, 0.5329, 0.8809]}, {"w": "object", "b": [0.5392, 0.8611, 0.6008, 0.8809]}, {"w": "(a", "b": [0.6071, 0.8611, 0.6267, 0.8809]}, {"w": "class", "b": [0.633, 0.8611, 0.6821, 0.8809]}, {"w": "instance", "b": [0.6884, 0.8611, 0.771, 0.8809]}, {"w": "implementing", "b": [0.1294, 0.8816, 0.2696, 0.9014]}, {"w": "specific", "b": [0.2759, 0.8816, 0.3543, 0.9014]}, {"w": "methods)", "b": [0.3606, 0.8816, 0.4545, 0.9014]}, {"w": "that", "b": [0.4608, 0.8816, 0.4987, 0.9014]}, {"w": "is", "b": [0.505, 0.8816, 0.5218, 0.9014]}, {"w": "passed", "b": [0.5281, 0.8816, 0.5954, 0.9014]}, {"w": "to", "b": [0.6017, 0.8816, 0.6213, 0.9014]}, {"w": "the", "b": [0.6276, 0.8816, 0.6584, 0.9014]}, {"w": "model", "b": [0.6647, 0.8816, 0.7278, 0.9014]}, {"w": "in", "b": [0.7341, 0.8816, 0.7537, 0.9014]}, {"w": "the", "b": [0.76, 0.8816, 0.7909, 0.9014]}, {"w": "call", "b": [0.7972, 0.8816, 0.8336, 0.9014]}, {"w": "to", "b": [0.8399, 0.8816, 0.8595, 0.9014]}]}]}, {"page": 327, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "fit and that is called by the model at various points during training. It has access to all the available data about the state of the model and its performance, and it can take action: interrupt training, save a model, load a different weight set, or otherwise alter the state of the model.", "words": [{"w": "fit", "b": [0.1294, 0.0867, 0.1748, 0.1069]}, {"w": "and", "b": [0.1811, 0.0857, 0.2176, 0.1054]}, {"w": "that", "b": [0.2239, 0.0857, 0.2617, 0.1054]}, {"w": "is", "b": [0.268, 0.0857, 0.2848, 0.1054]}, {"w": "called", "b": [0.2911, 0.0857, 0.3514, 0.1054]}, {"w": "by", "b": [0.3577, 0.0857, 0.3829, 0.1054]}, {"w": "the", "b": [0.3892, 0.0857, 0.42, 0.1054]}, {"w": "model", "b": [0.4263, 0.0857, 0.4894, 0.1054]}, {"w": "at", "b": [0.4957, 0.0857, 0.5139, 0.1054]}, {"w": "various", "b": [0.5202, 0.0857, 0.5945, 0.1054]}, {"w": "points", "b": [0.6008, 0.0857, 0.6625, 0.1054]}, {"w": "during", "b": [0.6688, 0.0857, 0.7347, 0.1054]}, {"w": "training.", "b": [0.741, 0.0857, 0.8257, 0.1054]}, {"w": "It", "b": [0.8321, 0.0857, 0.8475, 0.1054]}, {"w": "has", "b": [0.1294, 0.1071, 0.163, 0.1268]}, {"w": "access", "b": [0.1693, 0.1071, 0.2338, 0.1268]}, {"w": "to", "b": [0.2401, 0.1071, 0.2597, 0.1268]}, {"w": "all", "b": [0.266, 0.1071, 0.2912, 0.1268]}, {"w": "the", "b": [0.2975, 0.1071, 0.3284, 0.1268]}, {"w": "available", "b": [0.3347, 0.1071, 0.4257, 0.1268]}, {"w": "data", "b": [0.432, 0.1071, 0.4741, 0.1268]}, {"w": "about", "b": [0.4804, 0.1071, 0.5364, 0.1268]}, {"w": "the", "b": [0.5427, 0.1071, 0.5736, 0.1268]}, {"w": "state", "b": [0.5799, 0.1071, 0.6261, 0.1268]}, {"w": "of", "b": [0.6323, 0.1071, 0.6533, 0.1268]}, {"w": "the", "b": [0.6596, 0.1071, 0.6905, 0.1268]}, {"w": "model", "b": [0.6968, 0.1071, 0.7598, 0.1268]}, {"w": "and", "b": [0.7661, 0.1071, 0.8026, 0.1268]}, {"w": "its", "b": [0.8089, 0.1071, 0.8327, 0.1268]}, {"w": "performance,", "b": [0.1294, 0.1276, 0.2632, 0.1473]}, {"w": "and", "b": [0.2695, 0.1276, 0.3059, 0.1473]}, {"w": "it", "b": [0.3122, 0.1276, 0.3262, 0.1473]}, {"w": "can", "b": [0.3326, 0.1276, 0.3676, 0.1473]}, {"w": "take", "b": [0.3739, 0.1276, 0.4159, 0.1473]}, {"w": "action:", "b": [0.4222, 0.1276, 0.4909, 0.1473]}, {"w": "interrupt", "b": [0.4972, 0.1276, 0.5841, 0.1473]}, {"w": "training,", "b": [0.5904, 0.1276, 0.6751, 0.1473]}, {"w": "save", "b": [0.6815, 0.1276, 0.7263, 0.1473]}, {"w": "a", "b": [0.7326, 0.1276, 0.7438, 0.1473]}, {"w": "model,", "b": [0.7501, 0.1276, 0.8195, 0.1473]}, {"w": "load", "b": [0.8258, 0.1276, 0.8692, 0.1473]}, {"w": "a", "b": [0.1294, 0.1481, 0.1406, 0.1678]}, {"w": "different", "b": [0.1469, 0.1481, 0.2333, 0.1678]}, {"w": "weight", "b": [0.2396, 0.1481, 0.3083, 0.1678]}, {"w": "set,", "b": [0.3146, 0.1481, 0.3489, 0.1678]}, {"w": "or", "b": [0.3552, 0.1481, 0.3762, 0.1678]}, {"w": "otherwise", "b": [0.3825, 0.1481, 0.4806, 0.1678]}, {"w": "alter", "b": [0.4869, 0.1481, 0.5317, 0.1678]}, {"w": "the", "b": [0.538, 0.1481, 0.5689, 0.1678]}, {"w": "state", "b": [0.5752, 0.1481, 0.6214, 0.1678]}, {"w": "of", "b": [0.6277, 0.1481, 0.6487, 0.1678]}, {"w": "the", "b": [0.655, 0.1481, 0.6859, 0.1678]}, {"w": "model.", "b": [0.6922, 0.1481, 0.7615, 0.1678]}]}, {"id": "b_1", "type": "paragraph", "text": "Here are some examples of ways you can use callbacks:", "words": [{"w": "Here", "b": [0.1294, 0.1909, 0.1784, 0.2106]}, {"w": "are", "b": [0.1847, 0.1909, 0.2155, 0.2106]}, {"w": "some", "b": [0.2218, 0.1909, 0.2751, 0.2106]}, {"w": "examples", "b": [0.2814, 0.1909, 0.3767, 0.2106]}, {"w": "of", "b": [0.383, 0.1909, 0.404, 0.2106]}, {"w": "ways", "b": [0.4103, 0.1909, 0.4621, 0.2106]}, {"w": "you", "b": [0.4684, 0.1909, 0.5063, 0.2106]}, {"w": "can", "b": [0.5126, 0.1909, 0.5476, 0.2106]}, {"w": "use", "b": [0.5539, 0.1909, 0.5875, 0.2106]}, {"w": "callbacks:", "b": [0.5938, 0.1909, 0.6947, 0.2106]}]}, {"id": "b_2", "type": "paragraph", "text": "Model checkpointing— Saving the current weights of the model at different points during training. Early stopping— Interrupting training when the validation loss is no longer improving (and of course, saving the best model obtained during training). Dynamically adjusting the value of certain parameters during training— Such as the learning rate of the optimizer. Logging training and validation metrics during training, or visualizing the representations learned by the model as they’re updated— The Keras progress bar that you’re familiar with is a callback!", "words": [{"w": "Model", "b": [0.1799, 0.2292, 0.2457, 0.2489]}, {"w": "checkpointing—", "b": [0.252, 0.2292, 0.4244, 0.2489]}, {"w": "Saving", "b": [0.4307, 0.2292, 0.5008, 0.2489]}, {"w": "the", "b": [0.5071, 0.2292, 0.5379, 0.2489]}, {"w": "current", "b": [0.5442, 0.2292, 0.6157, 0.2489]}, {"w": "weights", "b": [0.622, 0.2292, 0.7004, 0.2489]}, {"w": "of", "b": [0.7067, 0.2292, 0.7278, 0.2489]}, {"w": "the", "b": [0.7341, 0.2292, 0.7649, 0.2489]}, {"w": "model", "b": [0.7712, 0.2292, 0.8343, 0.2489]}, {"w": "at", "b": [0.8406, 0.2292, 0.8588, 0.2489]}, {"w": "different", "b": [0.1799, 0.2497, 0.2663, 0.2694]}, {"w": "points", "b": [0.2726, 0.2497, 0.3342, 0.2694]}, {"w": "during", "b": [0.3405, 0.2497, 0.4064, 0.2694]}, {"w": "training.", "b": [0.4127, 0.2497, 0.4975, 0.2694]}, {"w": "Early", "b": [0.1799, 0.2702, 0.2373, 0.2899]}, {"w": "stopping—", "b": [0.2436, 0.2702, 0.3572, 0.2899]}, {"w": "Interrupting", "b": [0.3635, 0.2702, 0.484, 0.2899]}, {"w": "training", "b": [0.4903, 0.2702, 0.5687, 0.2899]}, {"w": "when", "b": [0.5751, 0.2702, 0.6297, 0.2899]}, {"w": "the", "b": [0.636, 0.2702, 0.6668, 0.2899]}, {"w": "validation", "b": [0.6731, 0.2702, 0.774, 0.2899]}, {"w": "loss", "b": [0.7803, 0.2702, 0.8196, 0.2899]}, {"w": "is", "b": [0.8259, 0.2702, 0.8427, 0.2899]}, {"w": "no", "b": [0.1799, 0.2907, 0.2051, 0.3104]}, {"w": "longer", "b": [0.2114, 0.2907, 0.2758, 0.3104]}, {"w": "improving", "b": [0.2822, 0.2907, 0.3873, 0.3104]}, {"w": "(and", "b": [0.3936, 0.2907, 0.4384, 0.3104]}, {"w": "of", "b": [0.4447, 0.2907, 0.4657, 0.3104]}, {"w": "course,", "b": [0.472, 0.2907, 0.5442, 0.3104]}, {"w": "saving", "b": [0.5505, 0.2907, 0.6163, 0.3104]}, {"w": "the", "b": [0.6227, 0.2907, 0.6535, 0.3104]}, {"w": "best", "b": [0.6598, 0.2907, 0.7004, 0.3104]}, {"w": "model", "b": [0.7067, 0.2907, 0.7698, 0.3104]}, {"w": "obtained", "b": [0.7761, 0.2907, 0.863, 0.3104]}, {"w": "during", "b": [0.1799, 0.3112, 0.2457, 0.3309]}, {"w": "training).", "b": [0.252, 0.3112, 0.3452, 0.3309]}, {"w": "Dynamically", "b": [0.1799, 0.3317, 0.3116, 0.3514]}, {"w": "adjusting", "b": [0.3179, 0.3317, 0.4146, 0.3514]}, {"w": "the", "b": [0.4209, 0.3317, 0.4532, 0.3514]}, {"w": "value", "b": [0.4595, 0.3317, 0.5155, 0.3514]}, {"w": "of", "b": [0.5218, 0.3317, 0.5429, 0.3514]}, {"w": "certain", "b": [0.5492, 0.3317, 0.622, 0.3514]}, {"w": "parameters", "b": [0.6284, 0.3317, 0.7447, 0.3514]}, {"w": "during", "b": [0.751, 0.3317, 0.8211, 0.3514]}, {"w": "training—", "b": [0.1799, 0.3522, 0.2892, 0.3719]}, {"w": "Such", "b": [0.2955, 0.3522, 0.346, 0.3719]}, {"w": "as", "b": [0.3523, 0.3522, 0.3733, 0.3719]}, {"w": "the", "b": [0.3796, 0.3522, 0.4104, 0.3719]}, {"w": "learning", "b": [0.4167, 0.3522, 0.4994, 0.3719]}, {"w": "rate", "b": [0.5057, 0.3522, 0.5435, 0.3719]}, {"w": "of", "b": [0.5498, 0.3522, 0.5708, 0.3719]}, {"w": "the", "b": [0.5771, 0.3522, 0.608, 0.3719]}, {"w": "optimizer.", "b": [0.6143, 0.3522, 0.7158, 0.3719]}, {"w": "Logging", "b": [0.1799, 0.3727, 0.2668, 0.3924]}, {"w": "training", "b": [0.2731, 0.3727, 0.3572, 0.3924]}, {"w": "and", "b": [0.3635, 0.3727, 0.4028, 0.3924]}, {"w": "validation", "b": [0.4091, 0.3727, 0.5128, 0.3924]}, {"w": "metrics", "b": [0.5191, 0.3727, 0.5948, 0.3924]}, {"w": "during", "b": [0.6011, 0.3727, 0.6712, 0.3924]}, {"w": "training,", "b": [0.6775, 0.3727, 0.7679, 0.3924]}, {"w": "or", "b": [0.7742, 0.3727, 0.7967, 0.3924]}, {"w": "visualizing", "b": [0.1799, 0.3932, 0.292, 0.4129]}, {"w": "the", "b": [0.2983, 0.3932, 0.3306, 0.4129]}, {"w": "representations", "b": [0.3369, 0.3932, 0.4966, 0.4129]}, {"w": "learned", "b": [0.503, 0.3932, 0.5814, 0.4129]}, {"w": "by", "b": [0.5877, 0.3932, 0.6116, 0.4129]}, {"w": "the", "b": [0.6179, 0.3932, 0.6501, 0.4129]}, {"w": "model", "b": [0.6564, 0.3932, 0.7195, 0.4129]}, {"w": "as", "b": [0.7258, 0.3932, 0.7482, 0.4129]}, {"w": "they’re", "b": [0.7545, 0.3932, 0.8274, 0.4129]}, {"w": "updated—", "b": [0.1799, 0.4137, 0.2878, 0.4334]}, {"w": "The", "b": [0.2941, 0.4137, 0.3333, 0.4334]}, {"w": "Keras", "b": [0.3396, 0.4137, 0.3984, 0.4334]}, {"w": "progress", "b": [0.4047, 0.4137, 0.4902, 0.4334]}, {"w": "bar", "b": [0.4965, 0.4137, 0.5287, 0.4334]}, {"w": "that", "b": [0.535, 0.4137, 0.5729, 0.4334]}, {"w": "you’re", "b": [0.5792, 0.4137, 0.645, 0.4334]}, {"w": "familiar", "b": [0.6513, 0.4137, 0.7312, 0.4334]}, {"w": "with", "b": [0.7375, 0.4137, 0.7823, 0.4334]}, {"w": "is", "b": [0.7886, 0.4137, 0.8055, 0.4334]}, {"w": "a", "b": [0.8118, 0.4137, 0.823, 0.4334]}, {"w": "callback!", "b": [0.1799, 0.4342, 0.2723, 0.4539]}]}, {"id": "b_3", "type": "paragraph", "text": "The keras.callbacks module includes a number of built-in callbacks (this is not an exhaustive list):", "words": [{"w": "The", "b": [0.1294, 0.477, 0.1686, 0.4967]}, {"w": "keras.callbacks", "b": [0.1749, 0.478, 0.402, 0.4982]}, {"w": "module", "b": [0.4083, 0.477, 0.484, 0.4967]}, {"w": "includes", "b": [0.4903, 0.477, 0.5744, 0.4967]}, {"w": "a", "b": [0.5807, 0.477, 0.5919, 0.4967]}, {"w": "number", "b": [0.5982, 0.477, 0.6752, 0.4967]}, {"w": "of", "b": [0.6815, 0.477, 0.7026, 0.4967]}, {"w": "built-in", "b": [0.7089, 0.477, 0.7831, 0.4967]}, {"w": "callbacks", "b": [0.1294, 0.4984, 0.2233, 0.5181]}, {"w": "(this", "b": [0.2296, 0.4984, 0.2744, 0.5181]}, {"w": "is", "b": [0.2807, 0.4984, 0.2976, 0.5181]}, {"w": "not", "b": [0.3039, 0.4984, 0.3361, 0.5181]}, {"w": "an", "b": [0.3424, 0.4984, 0.3662, 0.5181]}, {"w": "exhaustive", "b": [0.3725, 0.4984, 0.4804, 0.5181]}, {"w": "list):", "b": [0.4867, 0.4984, 0.533, 0.5181]}]}, {"id": "b_4", "type": "paragraph", "text": "keras.callbacks.ModelCheckpoint keras.callbacks.EarlyStopping keras.callbacks.LearningRateScheduler keras.callbacks.ReduceLROnPlateau keras.callbacks.CSVLogger", "words": [{"w": "keras.callbacks.ModelCheckpoint", "b": [0.1357, 0.5361, 0.4876, 0.5512]}, {"w": "keras.callbacks.EarlyStopping", "b": [0.1357, 0.5512, 0.4649, 0.5664]}, {"w": "keras.callbacks.LearningRateScheduler", "b": [0.1357, 0.5664, 0.5557, 0.5815]}, {"w": "keras.callbacks.ReduceLROnPlateau", "b": [0.1357, 0.5815, 0.5103, 0.5967]}, {"w": "keras.callbacks.CSVLogger", "b": [0.1357, 0.5967, 0.4195, 0.6118]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s review a few of them to give you an idea of how to use them: ModelCheckpoint, EarlyStopping, and ReduceLROnPlateau.", "words": [{"w": "Let’s", "b": [0.1294, 0.6347, 0.1798, 0.6545]}, {"w": "review", "b": [0.1862, 0.6347, 0.2548, 0.6545]}, {"w": "a", "b": [0.2611, 0.6347, 0.2723, 0.6545]}, {"w": "few", "b": [0.2786, 0.6347, 0.3164, 0.6545]}, {"w": "of", "b": [0.3227, 0.6347, 0.3437, 0.6545]}, {"w": "them", "b": [0.35, 0.6347, 0.4005, 0.6545]}, {"w": "to", "b": [0.4068, 0.6347, 0.4264, 0.6545]}, {"w": "give", "b": [0.4327, 0.6347, 0.4762, 0.6545]}, {"w": "you", "b": [0.4825, 0.6347, 0.5203, 0.6545]}, {"w": "an", "b": [0.5266, 0.6347, 0.5504, 0.6545]}, {"w": "idea", "b": [0.5567, 0.6347, 0.5988, 0.6545]}, {"w": "of", "b": [0.6051, 0.6347, 0.6261, 0.6545]}, {"w": "how", "b": [0.6324, 0.6347, 0.6758, 0.6545]}, {"w": "to", "b": [0.6821, 0.6347, 0.7018, 0.6545]}, {"w": "use", "b": [0.7081, 0.6347, 0.7417, 0.6545]}, {"w": "them:", "b": [0.748, 0.6347, 0.8055, 0.6545]}, {"w": "ModelCheckpoint,", "b": [0.1294, 0.6552, 0.3628, 0.6765]}, {"w": "EarlyStopping,", "b": [0.3691, 0.6552, 0.5722, 0.6765]}, {"w": "and", "b": [0.5785, 0.6552, 0.6149, 0.675]}, {"w": "ReduceLROnPlateau.", "b": [0.1294, 0.6766, 0.3931, 0.6979]}]}, {"id": "b_6", "type": "paragraph", "text": "The ModelCheckpoint and EarlyStopping callbacks", "words": [{"w": "The", "b": [0.1294, 0.7154, 0.161, 0.7302]}, {"w": "ModelCheckpoint", "b": [0.1657, 0.7154, 0.3107, 0.7302]}, {"w": "and", "b": [0.3155, 0.7154, 0.346, 0.7302]}, {"w": "EarlyStopping", "b": [0.3507, 0.7154, 0.4684, 0.7302]}, {"w": "callbacks", "b": [0.4732, 0.7154, 0.5478, 0.7302]}]}, {"id": "b_7", "type": "paragraph", "text": "You can use the EarlyStopping callback to interrupt training once a target metric being monitored has stopped improving for a fixed number of epochs. For instance, this callback allows you to interrupt training as soon as you start overfitting, thus avoiding having to retrain your model for a smaller number of epochs. This callback is typically used in combination with ModelCheckpoint, which lets you continually save the model during training (and, optionally, save only the current", "words": [{"w": "You", "b": [0.1294, 0.7533, 0.1703, 0.773]}, {"w": "can", "b": [0.1766, 0.7533, 0.2116, 0.773]}, {"w": "use", "b": [0.218, 0.7533, 0.2516, 0.773]}, {"w": "the", "b": [0.2579, 0.7533, 0.2887, 0.773]}, {"w": "EarlyStopping", "b": [0.295, 0.7543, 0.4918, 0.7745]}, {"w": "callback", "b": [0.4981, 0.7533, 0.5821, 0.773]}, {"w": "to", "b": [0.5884, 0.7533, 0.6081, 0.773]}, {"w": "interrupt", "b": [0.6144, 0.7533, 0.7013, 0.773]}, {"w": "training", "b": [0.7076, 0.7533, 0.786, 0.773]}, {"w": "once", "b": [0.7923, 0.7533, 0.84, 0.773]}, {"w": "a", "b": [0.8463, 0.7533, 0.8575, 0.773]}, {"w": "target", "b": [0.1294, 0.7747, 0.1864, 0.7944]}, {"w": "metric", "b": [0.1927, 0.7747, 0.2571, 0.7944]}, {"w": "being", "b": [0.2635, 0.7747, 0.3195, 0.7944]}, {"w": "monitored", "b": [0.3258, 0.7747, 0.4295, 0.7944]}, {"w": "has", "b": [0.4358, 0.7747, 0.4694, 0.7944]}, {"w": "stopped", "b": [0.4758, 0.7747, 0.5542, 0.7944]}, {"w": "improving", "b": [0.5605, 0.7747, 0.6657, 0.7944]}, {"w": "for", "b": [0.672, 0.7747, 0.7014, 0.7944]}, {"w": "a", "b": [0.7077, 0.7747, 0.7189, 0.7944]}, {"w": "fixed", "b": [0.7252, 0.7747, 0.777, 0.7944]}, {"w": "number", "b": [0.7833, 0.7747, 0.8604, 0.7944]}, {"w": "of", "b": [0.1294, 0.7952, 0.1504, 0.8149]}, {"w": "epochs.", "b": [0.1567, 0.7952, 0.2331, 0.8149]}, {"w": "For", "b": [0.2394, 0.7952, 0.2744, 0.8149]}, {"w": "instance,", "b": [0.2807, 0.7952, 0.3697, 0.8149]}, {"w": "this", "b": [0.376, 0.7952, 0.4125, 0.8149]}, {"w": "callback", "b": [0.4188, 0.7952, 0.5028, 0.8149]}, {"w": "allows", "b": [0.5091, 0.7952, 0.575, 0.8149]}, {"w": "you", "b": [0.5813, 0.7952, 0.6191, 0.8149]}, {"w": "to", "b": [0.6254, 0.7952, 0.6451, 0.8149]}, {"w": "interrupt", "b": [0.6514, 0.7952, 0.7382, 0.8149]}, {"w": "training", "b": [0.7446, 0.7952, 0.823, 0.8149]}, {"w": "as", "b": [0.8293, 0.7952, 0.8504, 0.8149]}, {"w": "soon", "b": [0.1294, 0.8157, 0.1771, 0.8354]}, {"w": "as", "b": [0.1834, 0.8157, 0.2044, 0.8354]}, {"w": "you", "b": [0.2107, 0.8157, 0.2485, 0.8354]}, {"w": "start", "b": [0.2548, 0.8157, 0.2983, 0.8354]}, {"w": "overfitting,", "b": [0.3046, 0.8157, 0.4174, 0.8354]}, {"w": "thus", "b": [0.4237, 0.8157, 0.4657, 0.8354]}, {"w": "avoiding", "b": [0.4721, 0.8157, 0.5603, 0.8354]}, {"w": "having", "b": [0.5667, 0.8157, 0.6353, 0.8354]}, {"w": "to", "b": [0.6416, 0.8157, 0.6612, 0.8354]}, {"w": "retrain", "b": [0.6676, 0.8157, 0.7334, 0.8354]}, {"w": "your", "b": [0.7396, 0.8157, 0.7859, 0.8354]}, {"w": "model", "b": [0.7922, 0.8157, 0.8552, 0.8354]}, {"w": "for", "b": [0.1294, 0.8362, 0.1588, 0.8559]}, {"w": "a", "b": [0.1651, 0.8362, 0.1763, 0.8559]}, {"w": "smaller", "b": [0.1826, 0.8362, 0.2569, 0.8559]}, {"w": "number", "b": [0.2632, 0.8362, 0.3403, 0.8559]}, {"w": "of", "b": [0.3466, 0.8362, 0.3676, 0.8559]}, {"w": "epochs.", "b": [0.3739, 0.8362, 0.4503, 0.8559]}, {"w": "This", "b": [0.4566, 0.8362, 0.5014, 0.8559]}, {"w": "callback", "b": [0.5077, 0.8362, 0.5918, 0.8559]}, {"w": "is", "b": [0.5981, 0.8362, 0.6149, 0.8559]}, {"w": "typically", "b": [0.6212, 0.8362, 0.7095, 0.8559]}, {"w": "used", "b": [0.7158, 0.8362, 0.762, 0.8559]}, {"w": "in", "b": [0.7684, 0.8362, 0.788, 0.8559]}, {"w": "combination", "b": [0.1294, 0.8567, 0.2555, 0.8764]}, {"w": "with", "b": [0.2618, 0.8567, 0.3067, 0.8764]}, {"w": "ModelCheckpoint,", "b": [0.313, 0.8567, 0.5463, 0.8779]}, {"w": "which", "b": [0.5526, 0.8567, 0.6143, 0.8764]}, {"w": "lets", "b": [0.6206, 0.8567, 0.6556, 0.8764]}, {"w": "you", "b": [0.6619, 0.8567, 0.6998, 0.8764]}, {"w": "continually", "b": [0.7061, 0.8567, 0.8196, 0.8764]}, {"w": "save", "b": [0.1294, 0.8781, 0.1742, 0.8978]}, {"w": "the", "b": [0.1805, 0.8781, 0.2114, 0.8978]}, {"w": "model", "b": [0.2177, 0.8781, 0.2807, 0.8978]}, {"w": "during", "b": [0.287, 0.8781, 0.3529, 0.8978]}, {"w": "training", "b": [0.3592, 0.8781, 0.4377, 0.8978]}, {"w": "(and,", "b": [0.444, 0.8781, 0.4951, 0.8978]}, {"w": "optionally,", "b": [0.5014, 0.8781, 0.6084, 0.8978]}, {"w": "save", "b": [0.6147, 0.8781, 0.6595, 0.8978]}, {"w": "only", "b": [0.6658, 0.8781, 0.7106, 0.8978]}, {"w": "the", "b": [0.717, 0.8781, 0.7478, 0.8978]}, {"w": "current", "b": [0.7541, 0.8781, 0.8255, 0.8978]}]}]}, {"page": 328, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "best model so far: the version of the model that achieved the best performance at the end of an epoch):", "words": [{"w": "best", "b": [0.1294, 0.0857, 0.1701, 0.1054]}, {"w": "model", "b": [0.1764, 0.0857, 0.2394, 0.1054]}, {"w": "so", "b": [0.2457, 0.0857, 0.2682, 0.1054]}, {"w": "far:", "b": [0.2745, 0.0857, 0.3095, 0.1054]}, {"w": "the", "b": [0.3158, 0.0857, 0.3466, 0.1054]}, {"w": "version", "b": [0.3529, 0.0857, 0.4271, 0.1054]}, {"w": "of", "b": [0.4334, 0.0857, 0.4545, 0.1054]}, {"w": "the", "b": [0.4608, 0.0857, 0.4916, 0.1054]}, {"w": "model", "b": [0.4979, 0.0857, 0.561, 0.1054]}, {"w": "that", "b": [0.5673, 0.0857, 0.6051, 0.1054]}, {"w": "achieved", "b": [0.6114, 0.0857, 0.7011, 0.1054]}, {"w": "the", "b": [0.7074, 0.0857, 0.7382, 0.1054]}, {"w": "best", "b": [0.7445, 0.0857, 0.7851, 0.1054]}, {"w": "performance", "b": [0.1294, 0.1062, 0.2569, 0.1259]}, {"w": "at", "b": [0.2632, 0.1062, 0.2814, 0.1259]}, {"w": "the", "b": [0.2877, 0.1062, 0.3185, 0.1259]}, {"w": "end", "b": [0.3248, 0.1062, 0.3613, 0.1259]}, {"w": "of", "b": [0.3676, 0.1062, 0.3886, 0.1259]}, {"w": "an", "b": [0.3949, 0.1062, 0.4187, 0.1259]}, {"w": "epoch):", "b": [0.425, 0.1062, 0.5007, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "import keras callbacks_list = [ 1 keras.callbacks.EarlyStopping( 2 monitor='acc', 3 patience=1, 4 ), keras.callbacks.ModelCheckpoint( 5 filepath='my_model.h5', 6 monitor='val_loss', 7 save_best_only=True, 7 ) ] model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) 8 model.fit(x, y, 9 epochs=10, 9 batch_size=32, 9 callbacks=callbacks_list, 9 validation_data=(x_val, y_val)) 9", "words": [{"w": "import", "b": [0.1357, 0.1439, 0.2038, 0.1591]}, {"w": "keras", "b": [0.2152, 0.1439, 0.2719, 0.1591]}, {"w": "callbacks_list", "b": [0.1357, 0.1742, 0.2946, 0.1894]}, {"w": "=", "b": [0.306, 0.1742, 0.3173, 0.1894]}, {"w": "[", "b": [0.3287, 0.1742, 0.34, 0.1894]}, {"w": "1", "b": [0.6807, 0.1742, 0.692, 0.1894]}, {"w": "keras.callbacks.EarlyStopping(", "b": [0.1811, 0.1894, 0.5217, 0.2045]}, {"w": "2", "b": [0.6807, 0.1894, 0.692, 0.2045]}, {"w": "monitor='acc',", "b": [0.2265, 0.2045, 0.3855, 0.2197]}, {"w": "3", "b": [0.6807, 0.2045, 0.692, 0.2197]}, {"w": "patience=1,", "b": [0.2265, 0.2197, 0.3514, 0.2348]}, {"w": "4", "b": [0.6807, 0.2197, 0.692, 0.2348]}, {"w": "),", "b": [0.1811, 0.2348, 0.2038, 0.25]}, {"w": "keras.callbacks.ModelCheckpoint(", "b": [0.1811, 0.25, 0.5444, 0.2651]}, {"w": "5", "b": [0.6807, 0.25, 0.692, 0.2651]}, {"w": "filepath='my_model.h5',", "b": [0.2265, 0.2651, 0.4876, 0.2803]}, {"w": "6", "b": [0.6807, 0.2651, 0.692, 0.2803]}, {"w": "monitor='val_loss',", "b": [0.2265, 0.2803, 0.4422, 0.2954]}, {"w": "7", "b": [0.6807, 0.2803, 0.692, 0.2954]}, {"w": "save_best_only=True,", "b": [0.2265, 0.2954, 0.4536, 0.3106]}, {"w": "7", "b": [0.6807, 0.2954, 0.692, 0.3106]}, {"w": ")", "b": [0.1811, 0.3106, 0.1925, 0.3257]}, {"w": "]", "b": [0.1357, 0.3257, 0.1471, 0.3409]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.356, 0.5217, 0.3712]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.3712, 0.6011, 0.3863]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.3863, 0.4763, 0.4015]}, {"w": "8", "b": [0.6807, 0.3863, 0.692, 0.4015]}, {"w": "model.fit(x,", "b": [0.1357, 0.4167, 0.2719, 0.4318]}, {"w": "y,", "b": [0.2833, 0.4167, 0.306, 0.4318]}, {"w": "9", "b": [0.6807, 0.4167, 0.692, 0.4318]}, {"w": "epochs=10,", "b": [0.2492, 0.4318, 0.3628, 0.447]}, {"w": "9", "b": [0.6807, 0.4318, 0.692, 0.447]}, {"w": "batch_size=32,", "b": [0.2492, 0.447, 0.4082, 0.4621]}, {"w": "9", "b": [0.6807, 0.447, 0.692, 0.4621]}, {"w": "callbacks=callbacks_list,", "b": [0.2492, 0.4621, 0.533, 0.4773]}, {"w": "9", "b": [0.6807, 0.4621, 0.692, 0.4773]}, {"w": "validation_data=(x_val,", "b": [0.2492, 0.4773, 0.5103, 0.4924]}, {"w": "y_val))", "b": [0.5217, 0.4773, 0.6011, 0.4924]}, {"w": "9", "b": [0.6807, 0.4773, 0.692, 0.4924]}]}, {"id": "b_2", "type": "paragraph", "text": "1 Callbacks are passed to the model via the callbacks argument in fit, which takes a list of callbacks. You can pass any number of callbacks. 2 Interrupts training when improvement stops 3 Monitors the model’s validation accuracy 4 Interrupts training when accuracy has stopped improving for more than one epoch (that is, two epochs) 5 Saves the current weights after every epoch 6 Path to the destination model file 7 These two arguments mean you won’t overwrite the model file unless val_loss has improved, which allows you to keep the best model seen during training. 8 You monitor accuracy, so it should be part of the model’s metrics. 9 Note that because the callback will monitor validation loss and validation accuracy, you need to pass validation_data to the call to fit.", "words": [{"w": "1", "b": [0.1799, 0.5108, 0.1925, 0.5306]}, {"w": "Callbacks", "b": [0.1988, 0.5108, 0.3053, 0.5306]}, {"w": "are", "b": [0.3116, 0.5108, 0.3462, 0.5306]}, {"w": "passed", "b": [0.3525, 0.5108, 0.424, 0.5306]}, {"w": "to", "b": [0.4303, 0.5108, 0.4513, 0.5306]}, {"w": "the", "b": [0.4576, 0.5108, 0.4912, 0.5306]}, {"w": "model", "b": [0.4975, 0.5108, 0.5634, 0.5306]}, {"w": "via", "b": [0.5697, 0.5108, 0.6019, 0.5306]}, {"w": "the", "b": [0.6082, 0.5108, 0.6419, 0.5306]}, {"w": "callbacks", "b": [0.6482, 0.5108, 0.7477, 0.5306]}, {"w": "argument", "b": [0.754, 0.5108, 0.8591, 0.5306]}, {"w": "in", "b": [0.1799, 0.5313, 0.2009, 0.5511]}, {"w": "fit,", "b": [0.2072, 0.5313, 0.2373, 0.5511]}, {"w": "which", "b": [0.2436, 0.5313, 0.3081, 0.5511]}, {"w": "takes", "b": [0.3144, 0.5313, 0.3705, 0.5511]}, {"w": "a", "b": [0.3768, 0.5313, 0.3894, 0.5511]}, {"w": "list", "b": [0.3957, 0.5313, 0.4279, 0.5511]}, {"w": "of", "b": [0.4342, 0.5313, 0.4553, 0.5511]}, {"w": "callbacks.", "b": [0.4616, 0.5313, 0.5674, 0.5511]}, {"w": "You", "b": [0.5737, 0.5313, 0.6157, 0.5511]}, {"w": "can", "b": [0.622, 0.5313, 0.6599, 0.5511]}, {"w": "pass", "b": [0.6662, 0.5313, 0.7125, 0.5511]}, {"w": "any", "b": [0.7188, 0.5313, 0.758, 0.5511]}, {"w": "number", "b": [0.7643, 0.5313, 0.8498, 0.5511]}, {"w": "of", "b": [0.1799, 0.5518, 0.2009, 0.5716]}, {"w": "callbacks.", "b": [0.2072, 0.5518, 0.313, 0.5716]}, {"w": "2", "b": [0.1799, 0.5723, 0.1925, 0.5921]}, {"w": "Interrupts", "b": [0.1988, 0.5723, 0.3109, 0.5921]}, {"w": "training", "b": [0.3172, 0.5723, 0.4041, 0.5921]}, {"w": "when", "b": [0.4104, 0.5723, 0.4679, 0.5921]}, {"w": "improvement", "b": [0.4742, 0.5723, 0.618, 0.5921]}, {"w": "stops", "b": [0.6243, 0.5723, 0.679, 0.5921]}, {"w": "3", "b": [0.1799, 0.5928, 0.1925, 0.6126]}, {"w": "Monitors", "b": [0.1988, 0.5928, 0.2983, 0.6126]}, {"w": "the", "b": [0.3046, 0.5928, 0.3382, 0.6126]}, {"w": "model’s", "b": [0.3445, 0.5928, 0.4276, 0.6126]}, {"w": "validation", "b": [0.434, 0.5928, 0.5419, 0.6126]}, {"w": "accuracy", "b": [0.5482, 0.5928, 0.6449, 0.6126]}, {"w": "4", "b": [0.1799, 0.6133, 0.1925, 0.6331]}, {"w": "Interrupts", "b": [0.1988, 0.6133, 0.3109, 0.6331]}, {"w": "training", "b": [0.3172, 0.6133, 0.4041, 0.6331]}, {"w": "when", "b": [0.4104, 0.6133, 0.4679, 0.6331]}, {"w": "accuracy", "b": [0.4742, 0.6133, 0.5708, 0.6331]}, {"w": "has", "b": [0.5771, 0.6133, 0.6136, 0.6331]}, {"w": "stopped", "b": [0.6199, 0.6133, 0.704, 0.6331]}, {"w": "improving", "b": [0.7103, 0.6133, 0.822, 0.6331]}, {"w": "for", "b": [0.8283, 0.6133, 0.8605, 0.6331]}, {"w": "more", "b": [0.1799, 0.6338, 0.2354, 0.6536]}, {"w": "than", "b": [0.2417, 0.6338, 0.2908, 0.6536]}, {"w": "one", "b": [0.2971, 0.6338, 0.3349, 0.6536]}, {"w": "epoch", "b": [0.3413, 0.6338, 0.4043, 0.6536]}, {"w": "(that", "b": [0.4106, 0.6338, 0.4625, 0.6536]}, {"w": "is,", "b": [0.4688, 0.6338, 0.4919, 0.6536]}, {"w": "two", "b": [0.4982, 0.6338, 0.5374, 0.6536]}, {"w": "epochs)", "b": [0.5437, 0.6338, 0.625, 0.6536]}, {"w": "5", "b": [0.1799, 0.6543, 0.1925, 0.6741]}, {"w": "Saves", "b": [0.1988, 0.6543, 0.259, 0.6741]}, {"w": "the", "b": [0.2654, 0.6543, 0.299, 0.6741]}, {"w": "current", "b": [0.3053, 0.6543, 0.3861, 0.6741]}, {"w": "weights", "b": [0.3924, 0.6543, 0.4737, 0.6741]}, {"w": "after", "b": [0.48, 0.6543, 0.5318, 0.6741]}, {"w": "every", "b": [0.5381, 0.6543, 0.5969, 0.6741]}, {"w": "epoch", "b": [0.6032, 0.6543, 0.6663, 0.6741]}, {"w": "6", "b": [0.1799, 0.6748, 0.1925, 0.6946]}, {"w": "Path", "b": [0.1988, 0.6748, 0.2492, 0.6946]}, {"w": "to", "b": [0.2555, 0.6748, 0.2766, 0.6946]}, {"w": "the", "b": [0.2829, 0.6748, 0.3165, 0.6946]}, {"w": "destination", "b": [0.3228, 0.6748, 0.4419, 0.6946]}, {"w": "model", "b": [0.4482, 0.6748, 0.5141, 0.6946]}, {"w": "file", "b": [0.5204, 0.6748, 0.554, 0.6946]}, {"w": "7", "b": [0.1799, 0.6953, 0.1925, 0.7151]}, {"w": "These", "b": [0.1988, 0.6953, 0.2618, 0.7151]}, {"w": "two", "b": [0.2682, 0.6953, 0.3074, 0.7151]}, {"w": "arguments", "b": [0.3137, 0.6953, 0.4286, 0.7151]}, {"w": "mean", "b": [0.4349, 0.6953, 0.4937, 0.7151]}, {"w": "you", "b": [0.5001, 0.6953, 0.5393, 0.7151]}, {"w": "won’t", "b": [0.5456, 0.6953, 0.6073, 0.7151]}, {"w": "overwrite", "b": [0.6136, 0.6953, 0.7172, 0.7151]}, {"w": "the", "b": [0.7235, 0.6953, 0.7572, 0.7151]}, {"w": "model", "b": [0.7635, 0.6953, 0.8293, 0.7151]}, {"w": "file", "b": [0.8356, 0.6953, 0.8693, 0.7151]}, {"w": "unless", "b": [0.1799, 0.7158, 0.2458, 0.7356]}, {"w": "val_loss", "b": [0.2521, 0.7158, 0.3362, 0.7356]}, {"w": "has", "b": [0.3425, 0.7158, 0.3789, 0.7356]}, {"w": "improved,", "b": [0.3852, 0.7158, 0.4948, 0.7356]}, {"w": "which", "b": [0.5011, 0.7158, 0.5656, 0.7356]}, {"w": "allows", "b": [0.5719, 0.7158, 0.6392, 0.7356]}, {"w": "you", "b": [0.6455, 0.7158, 0.6847, 0.7356]}, {"w": "to", "b": [0.691, 0.7158, 0.712, 0.7356]}, {"w": "keep", "b": [0.7183, 0.7158, 0.7688, 0.7356]}, {"w": "the", "b": [0.7751, 0.7158, 0.8087, 0.7356]}, {"w": "best", "b": [0.815, 0.7158, 0.8585, 0.7356]}, {"w": "model", "b": [0.1799, 0.7363, 0.2457, 0.7561]}, {"w": "seen", "b": [0.252, 0.7363, 0.2983, 0.7561]}, {"w": "during", "b": [0.3046, 0.7363, 0.3775, 0.7561]}, {"w": "training.", "b": [0.3838, 0.7363, 0.477, 0.7561]}, {"w": "8", "b": [0.1799, 0.7568, 0.1925, 0.7766]}, {"w": "You", "b": [0.1988, 0.7568, 0.2408, 0.7766]}, {"w": "monitor", "b": [0.2471, 0.7568, 0.334, 0.7766]}, {"w": "accuracy,", "b": [0.3403, 0.7568, 0.4419, 0.7766]}, {"w": "so", "b": [0.4482, 0.7568, 0.4706, 0.7766]}, {"w": "it", "b": [0.4769, 0.7568, 0.4924, 0.7766]}, {"w": "should", "b": [0.4987, 0.7568, 0.5702, 0.7766]}, {"w": "be", "b": [0.5765, 0.7568, 0.6017, 0.7766]}, {"w": "part", "b": [0.608, 0.7568, 0.6543, 0.7766]}, {"w": "of", "b": [0.6606, 0.7568, 0.6816, 0.7766]}, {"w": "the", "b": [0.6879, 0.7568, 0.7215, 0.7766]}, {"w": "model’s", "b": [0.7278, 0.7568, 0.811, 0.7766]}, {"w": "metrics.", "b": [0.1799, 0.7773, 0.266, 0.7971]}, {"w": "9", "b": [0.1799, 0.7978, 0.1925, 0.8176]}, {"w": "Note", "b": [0.1988, 0.7978, 0.2492, 0.8176]}, {"w": "that", "b": [0.2555, 0.7978, 0.299, 0.8176]}, {"w": "because", "b": [0.3053, 0.7978, 0.3893, 0.8176]}, {"w": "the", "b": [0.3956, 0.7978, 0.4293, 0.8176]}, {"w": "callback", "b": [0.4356, 0.7978, 0.5253, 0.8176]}, {"w": "will", "b": [0.5316, 0.7978, 0.5708, 0.8176]}, {"w": "monitor", "b": [0.5771, 0.7978, 0.664, 0.8176]}, {"w": "validation", "b": [0.6703, 0.7978, 0.7783, 0.8176]}, {"w": "loss", "b": [0.7846, 0.7978, 0.8238, 0.8176]}, {"w": "and", "b": [0.1799, 0.8183, 0.2205, 0.8381]}, {"w": "validation", "b": [0.2268, 0.8183, 0.3348, 0.8381]}, {"w": "accuracy,", "b": [0.3411, 0.8183, 0.4427, 0.8381]}, {"w": "you", "b": [0.449, 0.8183, 0.4882, 0.8381]}, {"w": "need", "b": [0.4945, 0.8183, 0.545, 0.8381]}, {"w": "to", "b": [0.5513, 0.8183, 0.5723, 0.8381]}, {"w": "pass", "b": [0.5786, 0.8183, 0.6249, 0.8381]}, {"w": "validation_data", "b": [0.6312, 0.8183, 0.7994, 0.8381]}, {"w": "to", "b": [0.8057, 0.8183, 0.8267, 0.8381]}, {"w": "the", "b": [0.833, 0.8183, 0.8666, 0.8381]}, {"w": "call", "b": [0.1799, 0.8388, 0.2177, 0.8586]}, {"w": "to", "b": [0.224, 0.8388, 0.245, 0.8586]}, {"w": "fit.", "b": [0.2513, 0.8388, 0.2814, 0.8586]}]}, {"id": "b_3", "type": "paragraph", "text": "The ReduceLROnPlateau callback", "words": [{"w": "The", "b": [0.1294, 0.8767, 0.161, 0.8915]}, {"w": "ReduceLROnPlateau", "b": [0.1657, 0.8767, 0.3381, 0.8915]}, {"w": "callback", "b": [0.3428, 0.8767, 0.4101, 0.8915]}]}]}, {"page": 329, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You can use this callback to reduce the learning rate when the validation loss has stopped improving. Reducing or increasing the learning rate in case of a loss plateau is is an effective strategy to get out of local minima during training. The following example uses the ReduceLROnPlateau callback:", "words": [{"w": "You", "b": [0.1294, 0.0857, 0.1703, 0.1054]}, {"w": "can", "b": [0.1766, 0.0857, 0.2116, 0.1054]}, {"w": "use", "b": [0.218, 0.0857, 0.2516, 0.1054]}, {"w": "this", "b": [0.2579, 0.0857, 0.2943, 0.1054]}, {"w": "callback", "b": [0.3006, 0.0857, 0.3847, 0.1054]}, {"w": "to", "b": [0.391, 0.0857, 0.4106, 0.1054]}, {"w": "reduce", "b": [0.4169, 0.0857, 0.4842, 0.1054]}, {"w": "the", "b": [0.4905, 0.0857, 0.5213, 0.1054]}, {"w": "learning", "b": [0.5276, 0.0857, 0.6103, 0.1054]}, {"w": "rate", "b": [0.6166, 0.0857, 0.6544, 0.1054]}, {"w": "when", "b": [0.6607, 0.0857, 0.7153, 0.1054]}, {"w": "the", "b": [0.7216, 0.0857, 0.7525, 0.1054]}, {"w": "validation", "b": [0.7588, 0.0857, 0.8597, 0.1054]}, {"w": "loss", "b": [0.1294, 0.1062, 0.1687, 0.1259]}, {"w": "has", "b": [0.175, 0.1062, 0.2086, 0.1259]}, {"w": "stopped", "b": [0.2149, 0.1062, 0.2934, 0.1259]}, {"w": "improving.", "b": [0.2997, 0.1062, 0.4111, 0.1259]}, {"w": "Reducing", "b": [0.4174, 0.1062, 0.5141, 0.1259]}, {"w": "or", "b": [0.5204, 0.1062, 0.5414, 0.1259]}, {"w": "increasing", "b": [0.5477, 0.1062, 0.6514, 0.1259]}, {"w": "the", "b": [0.6577, 0.1062, 0.6885, 0.1259]}, {"w": "learning", "b": [0.6948, 0.1062, 0.7775, 0.1259]}, {"w": "rate", "b": [0.7838, 0.1062, 0.8216, 0.1259]}, {"w": "in", "b": [0.8279, 0.1062, 0.8475, 0.1259]}, {"w": "case", "b": [0.1294, 0.1267, 0.1728, 0.1464]}, {"w": "of", "b": [0.1791, 0.1267, 0.2001, 0.1464]}, {"w": "a", "b": [0.2065, 0.1267, 0.2177, 0.1464]}, {"w": "loss", "b": [0.2239, 0.1267, 0.2632, 0.1464]}, {"w": "plateau", "b": [0.2695, 0.1267, 0.3452, 0.1464]}, {"w": "is", "b": [0.3515, 0.1267, 0.3683, 0.1464]}, {"w": "is", "b": [0.3746, 0.1267, 0.3914, 0.1464]}, {"w": "an", "b": [0.3977, 0.1267, 0.4215, 0.1464]}, {"w": "effective", "b": [0.4278, 0.1267, 0.5156, 0.1464]}, {"w": "strategy", "b": [0.5219, 0.1267, 0.6018, 0.1464]}, {"w": "to", "b": [0.6081, 0.1267, 0.6277, 0.1464]}, {"w": "get", "b": [0.634, 0.1267, 0.6649, 0.1464]}, {"w": "out", "b": [0.6712, 0.1267, 0.7034, 0.1464]}, {"w": "of", "b": [0.7097, 0.1267, 0.7307, 0.1464]}, {"w": "local", "b": [0.737, 0.1267, 0.7861, 0.1464]}, {"w": "minima", "b": [0.7924, 0.1267, 0.8695, 0.1464]}, {"w": "during", "b": [0.1294, 0.1472, 0.1953, 0.1669]}, {"w": "training.", "b": [0.2016, 0.1472, 0.2864, 0.1669]}, {"w": "The", "b": [0.2927, 0.1472, 0.3319, 0.1669]}, {"w": "following", "b": [0.3382, 0.1472, 0.4363, 0.1669]}, {"w": "example", "b": [0.4426, 0.1472, 0.5281, 0.1669]}, {"w": "uses", "b": [0.5344, 0.1472, 0.5778, 0.1669]}, {"w": "the", "b": [0.5841, 0.1472, 0.615, 0.1669]}, {"w": "ReduceLROnPlateau", "b": [0.1294, 0.1687, 0.3867, 0.1889]}, {"w": "callback:", "b": [0.3931, 0.1677, 0.4841, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "callbacks_list = [ keras.callbacks.ReduceLROnPlateau( monitor='val_loss' 1 factor=0.1, 2 patience=10, 3 ) ] model.fit(x, y, 4 epochs=10, 4 batch_size=32, 4 callbacks=callbacks_list, 4 validation_data=(x_val, y_val)) 4", "words": [{"w": "callbacks_list", "b": [0.1357, 0.2063, 0.2946, 0.2214]}, {"w": "=", "b": [0.306, 0.2063, 0.3173, 0.2214]}, {"w": "[", "b": [0.3287, 0.2063, 0.34, 0.2214]}, {"w": "keras.callbacks.ReduceLROnPlateau(", "b": [0.1811, 0.2215, 0.5671, 0.2366]}, {"w": "monitor='val_loss'", "b": [0.2265, 0.2366, 0.4309, 0.2518]}, {"w": "1", "b": [0.6353, 0.2366, 0.6466, 0.2518]}, {"w": "factor=0.1,", "b": [0.2265, 0.2518, 0.3514, 0.2669]}, {"w": "2", "b": [0.6353, 0.2518, 0.6466, 0.2669]}, {"w": "patience=10,", "b": [0.2265, 0.2669, 0.3628, 0.2821]}, {"w": "3", "b": [0.6353, 0.2669, 0.6466, 0.2821]}, {"w": ")", "b": [0.1811, 0.2821, 0.1925, 0.2972]}, {"w": "]", "b": [0.1357, 0.2972, 0.1471, 0.3124]}, {"w": "model.fit(x,", "b": [0.1357, 0.3275, 0.2719, 0.3427]}, {"w": "y,", "b": [0.2833, 0.3275, 0.306, 0.3427]}, {"w": "4", "b": [0.6353, 0.3275, 0.6466, 0.3427]}, {"w": "epochs=10,", "b": [0.2492, 0.3427, 0.3628, 0.3578]}, {"w": "4", "b": [0.6353, 0.3427, 0.6466, 0.3578]}, {"w": "batch_size=32,", "b": [0.2492, 0.3578, 0.4082, 0.373]}, {"w": "4", "b": [0.6353, 0.3578, 0.6466, 0.373]}, {"w": "callbacks=callbacks_list,", "b": [0.2492, 0.373, 0.533, 0.3881]}, {"w": "4", "b": [0.6353, 0.373, 0.6466, 0.3881]}, {"w": "validation_data=(x_val,", "b": [0.2492, 0.3881, 0.5103, 0.4033]}, {"w": "y_val))", "b": [0.5217, 0.3881, 0.6011, 0.4033]}, {"w": "4", "b": [0.6353, 0.3881, 0.6466, 0.4033]}]}, {"id": "b_2", "type": "paragraph", "text": "1 Monitors the model’s validation loss 2 Divides the learning rate by 10 when triggered 3 The callback is triggered after the validation loss has stopped improving for 10 epochs. 4 Because the callback will monitor the validation loss, you need to pass validation_data to the call to fit.", "words": [{"w": "1", "b": [0.1799, 0.4217, 0.1925, 0.4414]}, {"w": "Monitors", "b": [0.1988, 0.4217, 0.2983, 0.4414]}, {"w": "the", "b": [0.3046, 0.4217, 0.3382, 0.4414]}, {"w": "model’s", "b": [0.3445, 0.4217, 0.4276, 0.4414]}, {"w": "validation", "b": [0.434, 0.4217, 0.5419, 0.4414]}, {"w": "loss", "b": [0.5482, 0.4217, 0.5875, 0.4414]}, {"w": "2", "b": [0.1799, 0.4422, 0.1925, 0.4619]}, {"w": "Divides", "b": [0.1988, 0.4422, 0.2787, 0.4619]}, {"w": "the", "b": [0.285, 0.4422, 0.3186, 0.4619]}, {"w": "learning", "b": [0.3249, 0.4422, 0.4146, 0.4619]}, {"w": "rate", "b": [0.4209, 0.4422, 0.4643, 0.4619]}, {"w": "by", "b": [0.4706, 0.4422, 0.4973, 0.4619]}, {"w": "10", "b": [0.5036, 0.4422, 0.5288, 0.4619]}, {"w": "when", "b": [0.5351, 0.4422, 0.5926, 0.4619]}, {"w": "triggered", "b": [0.5989, 0.4422, 0.6979, 0.4619]}, {"w": "3", "b": [0.1799, 0.4627, 0.1925, 0.4824]}, {"w": "The", "b": [0.1988, 0.4627, 0.2408, 0.4824]}, {"w": "callback", "b": [0.2471, 0.4627, 0.3368, 0.4824]}, {"w": "is", "b": [0.3431, 0.4627, 0.36, 0.4824]}, {"w": "triggered", "b": [0.3663, 0.4627, 0.4653, 0.4824]}, {"w": "after", "b": [0.4716, 0.4627, 0.5234, 0.4824]}, {"w": "the", "b": [0.5297, 0.4627, 0.5633, 0.4824]}, {"w": "validation", "b": [0.5696, 0.4627, 0.6776, 0.4824]}, {"w": "loss", "b": [0.6839, 0.4627, 0.7231, 0.4824]}, {"w": "has", "b": [0.7294, 0.4627, 0.7659, 0.4824]}, {"w": "stopped", "b": [0.7722, 0.4627, 0.8563, 0.4824]}, {"w": "improving", "b": [0.1799, 0.4832, 0.2915, 0.5029]}, {"w": "for", "b": [0.2978, 0.4832, 0.3301, 0.5029]}, {"w": "10", "b": [0.3364, 0.4832, 0.3616, 0.5029]}, {"w": "epochs.", "b": [0.3679, 0.4832, 0.4471, 0.5029]}, {"w": "4", "b": [0.1799, 0.5037, 0.1925, 0.5234]}, {"w": "Because", "b": [0.1988, 0.5037, 0.2857, 0.5234]}, {"w": "the", "b": [0.292, 0.5037, 0.3256, 0.5234]}, {"w": "callback", "b": [0.3319, 0.5037, 0.4216, 0.5234]}, {"w": "will", "b": [0.4279, 0.5037, 0.4672, 0.5234]}, {"w": "monitor", "b": [0.4735, 0.5037, 0.5603, 0.5234]}, {"w": "the", "b": [0.5667, 0.5037, 0.6003, 0.5234]}, {"w": "validation", "b": [0.6066, 0.5037, 0.7145, 0.5234]}, {"w": "loss,", "b": [0.7208, 0.5037, 0.7664, 0.5234]}, {"w": "you", "b": [0.7727, 0.5037, 0.8119, 0.5234]}, {"w": "need", "b": [0.8183, 0.5037, 0.8687, 0.5234]}, {"w": "to", "b": [0.1799, 0.5242, 0.2009, 0.5439]}, {"w": "pass", "b": [0.2072, 0.5242, 0.2534, 0.5439]}, {"w": "validation_data", "b": [0.2598, 0.5242, 0.428, 0.5439]}, {"w": "to", "b": [0.4343, 0.5242, 0.4553, 0.5439]}, {"w": "the", "b": [0.4616, 0.5242, 0.4952, 0.5439]}, {"w": "call", "b": [0.5015, 0.5242, 0.5394, 0.5439]}, {"w": "to", "b": [0.5457, 0.5242, 0.5667, 0.5439]}, {"w": "fit.", "b": [0.573, 0.5242, 0.6031, 0.5439]}]}, {"id": "b_3", "type": "paragraph", "text": "Writing your own callback", "words": [{"w": "Writing", "b": [0.1294, 0.562, 0.1932, 0.5768]}, {"w": "your", "b": [0.1979, 0.562, 0.2358, 0.5768]}, {"w": "own", "b": [0.2405, 0.562, 0.2741, 0.5768]}, {"w": "callback", "b": [0.2789, 0.562, 0.3461, 0.5768]}]}, {"id": "b_4", "type": "paragraph", "text": "If you need to take a specific action during training that isn’t covered by one of the built-in callbacks, you can write your own callback. Callbacks are implemented by subclassing the class keras.callbacks.Callback. You can then implement any number of the following transparently named methods, which are called at various points during training:", "words": [{"w": "If", "b": [0.1294, 0.6, 0.1462, 0.6197]}, {"w": "you", "b": [0.1525, 0.6, 0.1904, 0.6197]}, {"w": "need", "b": [0.1967, 0.6, 0.2443, 0.6197]}, {"w": "to", "b": [0.2506, 0.6, 0.2702, 0.6197]}, {"w": "take", "b": [0.2765, 0.6, 0.3186, 0.6197]}, {"w": "a", "b": [0.3249, 0.6, 0.3361, 0.6197]}, {"w": "specific", "b": [0.3424, 0.6, 0.4208, 0.6197]}, {"w": "action", "b": [0.4271, 0.6, 0.4888, 0.6197]}, {"w": "during", "b": [0.4951, 0.6, 0.5609, 0.6197]}, {"w": "training", "b": [0.5673, 0.6, 0.6457, 0.6197]}, {"w": "that", "b": [0.652, 0.6, 0.6899, 0.6197]}, {"w": "isn’t", "b": [0.6962, 0.6, 0.7405, 0.6197]}, {"w": "covered", "b": [0.7468, 0.6, 0.8266, 0.6197]}, {"w": "by", "b": [0.8329, 0.6, 0.8582, 0.6197]}, {"w": "one", "b": [0.1294, 0.6205, 0.1658, 0.6402]}, {"w": "of", "b": [0.1721, 0.6205, 0.1932, 0.6402]}, {"w": "the", "b": [0.1995, 0.6205, 0.2303, 0.6402]}, {"w": "built-in", "b": [0.2366, 0.6205, 0.3109, 0.6402]}, {"w": "callbacks,", "b": [0.3172, 0.6205, 0.4174, 0.6402]}, {"w": "you", "b": [0.4237, 0.6205, 0.4615, 0.6402]}, {"w": "can", "b": [0.4678, 0.6205, 0.5028, 0.6402]}, {"w": "write", "b": [0.5091, 0.6205, 0.561, 0.6402]}, {"w": "your", "b": [0.5673, 0.6205, 0.6135, 0.6402]}, {"w": "own", "b": [0.6198, 0.6205, 0.6632, 0.6402]}, {"w": "callback.", "b": [0.6695, 0.6205, 0.7599, 0.6402]}, {"w": "Callbacks", "b": [0.7662, 0.6205, 0.8657, 0.6402]}, {"w": "are", "b": [0.1294, 0.641, 0.1602, 0.6607]}, {"w": "implemented", "b": [0.1665, 0.641, 0.2982, 0.6607]}, {"w": "by", "b": [0.3046, 0.641, 0.3298, 0.6607]}, {"w": "subclassing", "b": [0.3361, 0.641, 0.4524, 0.6607]}, {"w": "the", "b": [0.4587, 0.641, 0.4895, 0.6607]}, {"w": "class", "b": [0.4958, 0.641, 0.5449, 0.6607]}, {"w": "keras.callbacks.Callback.", "b": [0.1294, 0.6615, 0.499, 0.6827]}, {"w": "You", "b": [0.5053, 0.6615, 0.5463, 0.6812]}, {"w": "can", "b": [0.5526, 0.6615, 0.5876, 0.6812]}, {"w": "then", "b": [0.5939, 0.6615, 0.6373, 0.6812]}, {"w": "implement", "b": [0.6436, 0.6615, 0.7515, 0.6812]}, {"w": "any", "b": [0.7578, 0.6615, 0.7943, 0.6812]}, {"w": "number", "b": [0.1294, 0.6829, 0.2065, 0.7026]}, {"w": "of", "b": [0.2128, 0.6829, 0.2338, 0.7026]}, {"w": "the", "b": [0.2401, 0.6829, 0.2709, 0.7026]}, {"w": "following", "b": [0.2772, 0.6829, 0.3753, 0.7026]}, {"w": "transparently", "b": [0.3816, 0.6829, 0.5133, 0.7026]}, {"w": "named", "b": [0.5197, 0.6829, 0.5869, 0.7026]}, {"w": "methods,", "b": [0.5932, 0.6829, 0.685, 0.7026]}, {"w": "which", "b": [0.6913, 0.6829, 0.753, 0.7026]}, {"w": "are", "b": [0.7593, 0.6829, 0.7901, 0.7026]}, {"w": "called", "b": [0.7964, 0.6829, 0.8566, 0.7026]}, {"w": "at", "b": [0.1294, 0.7034, 0.1476, 0.7231]}, {"w": "various", "b": [0.1539, 0.7034, 0.2282, 0.7231]}, {"w": "points", "b": [0.2345, 0.7034, 0.2962, 0.7231]}, {"w": "during", "b": [0.3025, 0.7034, 0.3684, 0.7231]}, {"w": "training:", "b": [0.3746, 0.7034, 0.4601, 0.7231]}]}, {"id": "b_5", "type": "paragraph", "text": "on_epoch_begin 1 on_epoch_end 2 on_batch_begin 3 on_batch_end 4 on_train_begin 5 on_train_end 6", "words": [{"w": "on_epoch_begin", "b": [0.1357, 0.7411, 0.2946, 0.7562]}, {"w": "1", "b": [0.3968, 0.7411, 0.4082, 0.7562]}, {"w": "on_epoch_end", "b": [0.1357, 0.7562, 0.2719, 0.7714]}, {"w": "2", "b": [0.3968, 0.7562, 0.4082, 0.7714]}, {"w": "on_batch_begin", "b": [0.1357, 0.7865, 0.2946, 0.8017]}, {"w": "3", "b": [0.3968, 0.7865, 0.4082, 0.8017]}, {"w": "on_batch_end", "b": [0.1357, 0.8017, 0.2719, 0.8168]}, {"w": "4", "b": [0.3968, 0.8017, 0.4082, 0.8168]}, {"w": "on_train_begin", "b": [0.1357, 0.832, 0.2946, 0.8471]}, {"w": "5", "b": [0.3968, 0.832, 0.4082, 0.8471]}, {"w": "on_train_end", "b": [0.1357, 0.8472, 0.2719, 0.8623]}, {"w": "6", "b": [0.3968, 0.8472, 0.4082, 0.8623]}]}, {"id": "b_6", "type": "paragraph", "text": "1 Called at the start of every epoch", "words": [{"w": "1", "b": [0.1799, 0.8807, 0.1925, 0.9005]}, {"w": "Called", "b": [0.1988, 0.8807, 0.2689, 0.9005]}, {"w": "at", "b": [0.2752, 0.8807, 0.2962, 0.9005]}, {"w": "the", "b": [0.3025, 0.8807, 0.3361, 0.9005]}, {"w": "start", "b": [0.3424, 0.8807, 0.3928, 0.9005]}, {"w": "of", "b": [0.3992, 0.8807, 0.4202, 0.9005]}, {"w": "every", "b": [0.4265, 0.8807, 0.4853, 0.9005]}, {"w": "epoch", "b": [0.4916, 0.8807, 0.5547, 0.9005]}]}]}, {"page": 330, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2 Called at the end of every epoch 3 Called right before processing each batch 4 Called right after processing each batch 5 Called at the start of training 6 Called at the end of training", "words": [{"w": "2", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Called", "b": [0.1988, 0.0857, 0.2689, 0.1054]}, {"w": "at", "b": [0.2752, 0.0857, 0.2962, 0.1054]}, {"w": "the", "b": [0.3025, 0.0857, 0.3361, 0.1054]}, {"w": "end", "b": [0.3424, 0.0857, 0.3817, 0.1054]}, {"w": "of", "b": [0.388, 0.0857, 0.409, 0.1054]}, {"w": "every", "b": [0.4153, 0.0857, 0.4741, 0.1054]}, {"w": "epoch", "b": [0.4804, 0.0857, 0.5435, 0.1054]}, {"w": "3", "b": [0.1799, 0.1062, 0.1925, 0.1259]}, {"w": "Called", "b": [0.1988, 0.1062, 0.2689, 0.1259]}, {"w": "right", "b": [0.2752, 0.1062, 0.3284, 0.1259]}, {"w": "before", "b": [0.3347, 0.1062, 0.4029, 0.1259]}, {"w": "processing", "b": [0.4092, 0.1062, 0.5223, 0.1259]}, {"w": "each", "b": [0.5286, 0.1062, 0.5776, 0.1259]}, {"w": "batch", "b": [0.5839, 0.1062, 0.6442, 0.1259]}, {"w": "4", "b": [0.1799, 0.1267, 0.1925, 0.1464]}, {"w": "Called", "b": [0.1988, 0.1267, 0.2689, 0.1464]}, {"w": "right", "b": [0.2752, 0.1267, 0.3284, 0.1464]}, {"w": "after", "b": [0.3347, 0.1267, 0.3865, 0.1464]}, {"w": "processing", "b": [0.3928, 0.1267, 0.5059, 0.1464]}, {"w": "each", "b": [0.5122, 0.1267, 0.5612, 0.1464]}, {"w": "batch", "b": [0.5675, 0.1267, 0.6278, 0.1464]}, {"w": "5", "b": [0.1799, 0.1472, 0.1925, 0.1669]}, {"w": "Called", "b": [0.1988, 0.1472, 0.2689, 0.1669]}, {"w": "at", "b": [0.2752, 0.1472, 0.2962, 0.1669]}, {"w": "the", "b": [0.3025, 0.1472, 0.3361, 0.1669]}, {"w": "start", "b": [0.3424, 0.1472, 0.3928, 0.1669]}, {"w": "of", "b": [0.3992, 0.1472, 0.4202, 0.1669]}, {"w": "training", "b": [0.4265, 0.1472, 0.5134, 0.1669]}, {"w": "6", "b": [0.1799, 0.1677, 0.1925, 0.1874]}, {"w": "Called", "b": [0.1988, 0.1677, 0.2689, 0.1874]}, {"w": "at", "b": [0.2752, 0.1677, 0.2962, 0.1874]}, {"w": "the", "b": [0.3025, 0.1677, 0.3361, 0.1874]}, {"w": "end", "b": [0.3424, 0.1677, 0.3817, 0.1874]}, {"w": "of", "b": [0.388, 0.1677, 0.409, 0.1874]}, {"w": "training", "b": [0.4153, 0.1677, 0.5022, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "These methods all are called with a logs argument, which is a dictionary containing information about the previous batch, epoch, or training run: training and validation metrics, and so on. Additionally, the callback has access to the following attributes:", "words": [{"w": "These", "b": [0.1294, 0.2105, 0.1897, 0.2302]}, {"w": "methods", "b": [0.196, 0.2105, 0.2814, 0.2302]}, {"w": "all", "b": [0.2878, 0.2105, 0.313, 0.2302]}, {"w": "are", "b": [0.3193, 0.2105, 0.3501, 0.2302]}, {"w": "called", "b": [0.3564, 0.2105, 0.4166, 0.2302]}, {"w": "with", "b": [0.4229, 0.2105, 0.4678, 0.2302]}, {"w": "a", "b": [0.4741, 0.2105, 0.4853, 0.2302]}, {"w": "logs", "b": [0.4915, 0.2115, 0.5521, 0.2317]}, {"w": "argument,", "b": [0.5584, 0.2105, 0.6595, 0.2302]}, {"w": "which", "b": [0.6658, 0.2105, 0.7275, 0.2302]}, {"w": "is", "b": [0.7338, 0.2105, 0.7506, 0.2302]}, {"w": "a", "b": [0.7569, 0.2105, 0.7681, 0.2302]}, {"w": "dictionary", "b": [0.1294, 0.2319, 0.2317, 0.2516]}, {"w": "containing", "b": [0.238, 0.2319, 0.3445, 0.2516]}, {"w": "information", "b": [0.3508, 0.2319, 0.4699, 0.2516]}, {"w": "about", "b": [0.4762, 0.2319, 0.5323, 0.2516]}, {"w": "the", "b": [0.5386, 0.2319, 0.5694, 0.2516]}, {"w": "previous", "b": [0.5757, 0.2319, 0.6626, 0.2516]}, {"w": "batch,", "b": [0.6689, 0.2319, 0.7299, 0.2516]}, {"w": "epoch,", "b": [0.7362, 0.2319, 0.8027, 0.2516]}, {"w": "or", "b": [0.809, 0.2319, 0.83, 0.2516]}, {"w": "training", "b": [0.1294, 0.2524, 0.2079, 0.2721]}, {"w": "run:", "b": [0.2142, 0.2524, 0.2548, 0.2721]}, {"w": "training", "b": [0.2611, 0.2524, 0.3396, 0.2721]}, {"w": "and", "b": [0.3459, 0.2524, 0.3824, 0.2721]}, {"w": "validation", "b": [0.3887, 0.2524, 0.4896, 0.2721]}, {"w": "metrics,", "b": [0.4958, 0.2524, 0.5764, 0.2721]}, {"w": "and", "b": [0.5827, 0.2524, 0.6191, 0.2721]}, {"w": "so", "b": [0.6254, 0.2524, 0.6478, 0.2721]}, {"w": "on.", "b": [0.6541, 0.2524, 0.6857, 0.2721]}, {"w": "Additionally,", "b": [0.692, 0.2524, 0.8242, 0.2721]}, {"w": "the", "b": [0.8305, 0.2524, 0.8613, 0.2721]}, {"w": "callback", "b": [0.1294, 0.2729, 0.2135, 0.2926]}, {"w": "has", "b": [0.2198, 0.2729, 0.2534, 0.2926]}, {"w": "access", "b": [0.2597, 0.2729, 0.3241, 0.2926]}, {"w": "to", "b": [0.3304, 0.2729, 0.3501, 0.2926]}, {"w": "the", "b": [0.3564, 0.2729, 0.3872, 0.2926]}, {"w": "following", "b": [0.3935, 0.2729, 0.4916, 0.2926]}, {"w": "attributes:", "b": [0.4979, 0.2729, 0.5988, 0.2926]}]}, {"id": "b_2", "type": "paragraph", "text": "self.model—The model instance from which the callback is being called self.validation_data—The value of what was passed to fit as validation data", "words": [{"w": "self.model—The", "b": [0.1799, 0.3112, 0.3957, 0.3324]}, {"w": "model", "b": [0.402, 0.3112, 0.4651, 0.3309]}, {"w": "instance", "b": [0.4714, 0.3112, 0.554, 0.3309]}, {"w": "from", "b": [0.5603, 0.3112, 0.6094, 0.3309]}, {"w": "which", "b": [0.6157, 0.3112, 0.6773, 0.3309]}, {"w": "the", "b": [0.6836, 0.3112, 0.7145, 0.3309]}, {"w": "callback", "b": [0.7208, 0.3112, 0.8048, 0.3309]}, {"w": "is", "b": [0.8111, 0.3112, 0.828, 0.3309]}, {"w": "being", "b": [0.1799, 0.3326, 0.2359, 0.3523]}, {"w": "called", "b": [0.2422, 0.3326, 0.3025, 0.3523]}, {"w": "self.validation_data—The", "b": [0.1799, 0.3531, 0.5471, 0.3743]}, {"w": "value", "b": [0.5534, 0.3531, 0.608, 0.3728]}, {"w": "of", "b": [0.6143, 0.3531, 0.6353, 0.3728]}, {"w": "what", "b": [0.6416, 0.3531, 0.6907, 0.3728]}, {"w": "was", "b": [0.697, 0.3531, 0.7362, 0.3728]}, {"w": "passed", "b": [0.7425, 0.3531, 0.8098, 0.3728]}, {"w": "to", "b": [0.8161, 0.3531, 0.8357, 0.3728]}, {"w": "fit", "b": [0.1799, 0.3755, 0.2253, 0.3957]}, {"w": "as", "b": [0.2316, 0.3745, 0.2526, 0.3942]}, {"w": "validation", "b": [0.2589, 0.3745, 0.3598, 0.3942]}, {"w": "data", "b": [0.3661, 0.3745, 0.4081, 0.3942]}]}, {"id": "b_3", "type": "paragraph", "text": "Here’s a simple example of a custom callback that saves to disk (as Numpy arrays) the activations of every layer of the model at the end of every epoch, computed on the first sample of the validation set:", "words": [{"w": "Here’s", "b": [0.1294, 0.4181, 0.1952, 0.4379]}, {"w": "a", "b": [0.2016, 0.4181, 0.2128, 0.4379]}, {"w": "simple", "b": [0.2191, 0.4181, 0.2863, 0.4379]}, {"w": "example", "b": [0.2926, 0.4181, 0.3781, 0.4379]}, {"w": "of", "b": [0.3844, 0.4181, 0.4054, 0.4379]}, {"w": "a", "b": [0.4117, 0.4181, 0.4229, 0.4379]}, {"w": "custom", "b": [0.4292, 0.4181, 0.5021, 0.4379]}, {"w": "callback", "b": [0.5084, 0.4181, 0.5925, 0.4379]}, {"w": "that", "b": [0.5988, 0.4181, 0.6366, 0.4379]}, {"w": "saves", "b": [0.6429, 0.4181, 0.6976, 0.4379]}, {"w": "to", "b": [0.7039, 0.4181, 0.7235, 0.4379]}, {"w": "disk", "b": [0.7298, 0.4181, 0.7719, 0.4379]}, {"w": "(as", "b": [0.7782, 0.4181, 0.8076, 0.4379]}, {"w": "Numpy", "b": [0.1294, 0.4386, 0.2051, 0.4584]}, {"w": "arrays)", "b": [0.2114, 0.4386, 0.2814, 0.4584]}, {"w": "the", "b": [0.2877, 0.4386, 0.3186, 0.4584]}, {"w": "activations", "b": [0.3249, 0.4386, 0.4342, 0.4584]}, {"w": "of", "b": [0.4405, 0.4386, 0.4615, 0.4584]}, {"w": "every", "b": [0.4678, 0.4386, 0.5238, 0.4584]}, {"w": "layer", "b": [0.5301, 0.4386, 0.5805, 0.4584]}, {"w": "of", "b": [0.5869, 0.4386, 0.6079, 0.4584]}, {"w": "the", "b": [0.6142, 0.4386, 0.645, 0.4584]}, {"w": "model", "b": [0.6513, 0.4386, 0.7144, 0.4584]}, {"w": "at", "b": [0.7206, 0.4386, 0.7388, 0.4584]}, {"w": "the", "b": [0.7451, 0.4386, 0.7759, 0.4584]}, {"w": "end", "b": [0.7823, 0.4386, 0.8187, 0.4584]}, {"w": "of", "b": [0.825, 0.4386, 0.846, 0.4584]}, {"w": "every", "b": [0.1294, 0.4591, 0.1854, 0.4789]}, {"w": "epoch,", "b": [0.1917, 0.4591, 0.2583, 0.4789]}, {"w": "computed", "b": [0.2646, 0.4591, 0.3641, 0.4789]}, {"w": "on", "b": [0.3704, 0.4591, 0.3956, 0.4789]}, {"w": "the", "b": [0.4019, 0.4591, 0.4328, 0.4789]}, {"w": "first", "b": [0.4391, 0.4591, 0.4797, 0.4789]}, {"w": "sample", "b": [0.486, 0.4591, 0.5575, 0.4789]}, {"w": "of", "b": [0.5638, 0.4591, 0.5848, 0.4789]}, {"w": "the", "b": [0.5911, 0.4591, 0.6219, 0.4789]}, {"w": "validation", "b": [0.6282, 0.4591, 0.7291, 0.4789]}, {"w": "set:", "b": [0.7354, 0.4591, 0.7705, 0.4789]}]}, {"id": "b_4", "type": "paragraph", "text": "import keras import numpy as np class ActivationLogger(keras.callbacks.Callback): def set_model(self, model): self.model = model 1 layer_outputs = [layer.output for layer in model.layers] self.activations_model = keras.models.Model(model.input, layer_outputs) 2 def on_epoch_end(self, epoch, logs=None): if self.validation_data is None: raise RuntimeError('Requires validation_data.') validation_sample = self.validation_data[0][0:1] 3 activations = self.activations_model.predict(validation_sample) f = open('activations_at_epoch_' + str(epoch) + '.npz', 'w') 4 np.savez(f, activations) 4 f.close() 4", "words": [{"w": "import", "b": [0.1357, 0.4969, 0.2038, 0.512]}, {"w": "keras", "b": [0.2152, 0.4969, 0.2719, 0.512]}, {"w": "import", "b": [0.1357, 0.512, 0.2038, 0.5272]}, {"w": "numpy", "b": [0.2152, 0.512, 0.2719, 0.5272]}, {"w": "as", "b": [0.2833, 0.512, 0.306, 0.5272]}, {"w": "np", "b": [0.3173, 0.512, 0.34, 0.5272]}, {"w": "class", "b": [0.1357, 0.5423, 0.1925, 0.5575]}, {"w": "ActivationLogger(keras.callbacks.Callback):", "b": [0.2038, 0.5423, 0.6919, 0.5575]}, {"w": "def", "b": [0.1811, 0.5726, 0.2152, 0.5878]}, {"w": "set_model(self,", "b": [0.2265, 0.5726, 0.3968, 0.5878]}, {"w": "model):", "b": [0.4082, 0.5726, 0.4876, 0.5878]}, {"w": "self.model", "b": [0.2265, 0.5878, 0.34, 0.6029]}, {"w": "=", "b": [0.3514, 0.5878, 0.3628, 0.6029]}, {"w": "model", "b": [0.3741, 0.5878, 0.4309, 0.6029]}, {"w": "1", "b": [0.1357, 0.6029, 0.1471, 0.6181]}, {"w": "layer_outputs", "b": [0.2265, 0.6181, 0.3741, 0.6332]}, {"w": "=", "b": [0.3855, 0.6181, 0.3968, 0.6332]}, {"w": "[layer.output", "b": [0.4082, 0.6181, 0.5557, 0.6332]}, {"w": "for", "b": [0.5671, 0.6181, 0.6011, 0.6332]}, {"w": "layer", "b": [0.6125, 0.6181, 0.6692, 0.6332]}, {"w": "in", "b": [0.6806, 0.6181, 0.7033, 0.6332]}, {"w": "model.layers]", "b": [0.7146, 0.6181, 0.8622, 0.6332]}, {"w": "self.activations_model", "b": [0.2265, 0.6332, 0.4763, 0.6484]}, {"w": "=", "b": [0.4876, 0.6332, 0.499, 0.6484]}, {"w": "keras.models.Model(model.input,", "b": [0.5103, 0.6332, 0.8622, 0.6484]}, {"w": "layer_outputs)", "b": [0.1357, 0.6635, 0.2946, 0.6787]}, {"w": "2", "b": [0.3741, 0.6635, 0.3855, 0.6787]}, {"w": "def", "b": [0.1811, 0.6939, 0.2152, 0.709]}, {"w": "on_epoch_end(self,", "b": [0.2265, 0.6939, 0.4309, 0.709]}, {"w": "epoch,", "b": [0.4422, 0.6939, 0.5103, 0.709]}, {"w": "logs=None):", "b": [0.5217, 0.6939, 0.6465, 0.709]}, {"w": "if", "b": [0.2265, 0.709, 0.2492, 0.7242]}, {"w": "self.validation_data", "b": [0.2606, 0.709, 0.4876, 0.7242]}, {"w": "is", "b": [0.499, 0.709, 0.5217, 0.7242]}, {"w": "None:", "b": [0.533, 0.709, 0.5898, 0.7242]}, {"w": "raise", "b": [0.2719, 0.7242, 0.3287, 0.7393]}, {"w": "RuntimeError('Requires", "b": [0.34, 0.7242, 0.5898, 0.7393]}, {"w": "validation_data.')", "b": [0.6011, 0.7242, 0.8055, 0.7393]}, {"w": "validation_sample", "b": [0.2265, 0.7545, 0.4195, 0.7696]}, {"w": "=", "b": [0.4309, 0.7545, 0.4422, 0.7696]}, {"w": "self.validation_data[0][0:1]", "b": [0.4536, 0.7545, 0.7714, 0.7696]}, {"w": "3", "b": [0.1357, 0.7696, 0.1471, 0.7848]}, {"w": "activations", "b": [0.2265, 0.7848, 0.3514, 0.7999]}, {"w": "=", "b": [0.3628, 0.7848, 0.3741, 0.7999]}, {"w": "self.activations_model.predict(validation_sample)", "b": [0.1357, 0.7999, 0.6919, 0.8151]}, {"w": "f", "b": [0.2265, 0.8151, 0.2379, 0.8302]}, {"w": "=", "b": [0.2492, 0.8151, 0.2606, 0.8302]}, {"w": "open('activations_at_epoch_'", "b": [0.2719, 0.8151, 0.5898, 0.8302]}, {"w": "+", "b": [0.6011, 0.8151, 0.6125, 0.8302]}, {"w": "str(epoch)", "b": [0.6238, 0.8151, 0.7374, 0.8302]}, {"w": "+", "b": [0.7487, 0.8151, 0.7601, 0.8302]}, {"w": "'.npz',", "b": [0.7714, 0.8151, 0.8509, 0.8302]}, {"w": "'w')", "b": [0.1357, 0.8302, 0.1811, 0.8454]}, {"w": "4", "b": [0.2379, 0.8302, 0.2492, 0.8454]}, {"w": "np.savez(f,", "b": [0.2265, 0.8454, 0.3514, 0.8605]}, {"w": "activations)", "b": [0.3628, 0.8454, 0.499, 0.8605]}, {"w": "4", "b": [0.1357, 0.8605, 0.1471, 0.8757]}, {"w": "f.close()", "b": [0.2265, 0.8757, 0.3287, 0.8908]}, {"w": "4", "b": [0.1357, 0.8908, 0.1471, 0.906]}]}]}, {"page": 331, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "1 Called by the parent model before training, to inform the callback of what model will be calling it 2 Model instance that returns the activations of every layer 3 Obtains the first input sample of the validation data 4 Saves arrays to disk", "words": [{"w": "1", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Called", "b": [0.1988, 0.0857, 0.2689, 0.1054]}, {"w": "by", "b": [0.2752, 0.0857, 0.3018, 0.1054]}, {"w": "the", "b": [0.3081, 0.0857, 0.3417, 0.1054]}, {"w": "parent", "b": [0.348, 0.0857, 0.4191, 0.1054]}, {"w": "model", "b": [0.4254, 0.0857, 0.4912, 0.1054]}, {"w": "before", "b": [0.4975, 0.0857, 0.5657, 0.1054]}, {"w": "training,", "b": [0.572, 0.0857, 0.6652, 0.1054]}, {"w": "to", "b": [0.6715, 0.0857, 0.6925, 0.1054]}, {"w": "inform", "b": [0.6988, 0.0857, 0.7731, 0.1054]}, {"w": "the", "b": [0.7794, 0.0857, 0.813, 0.1054]}, {"w": "callback", "b": [0.1799, 0.1062, 0.2696, 0.1259]}, {"w": "of", "b": [0.2759, 0.1062, 0.2969, 0.1259]}, {"w": "what", "b": [0.3032, 0.1062, 0.3564, 0.1259]}, {"w": "model", "b": [0.3628, 0.1062, 0.4286, 0.1259]}, {"w": "will", "b": [0.4349, 0.1062, 0.4742, 0.1259]}, {"w": "be", "b": [0.4805, 0.1062, 0.5057, 0.1259]}, {"w": "calling", "b": [0.512, 0.1062, 0.5835, 0.1259]}, {"w": "it", "b": [0.5898, 0.1062, 0.6052, 0.1259]}, {"w": "2", "b": [0.1799, 0.1267, 0.1925, 0.1464]}, {"w": "Model", "b": [0.1988, 0.1267, 0.2674, 0.1464]}, {"w": "instance", "b": [0.2738, 0.1267, 0.362, 0.1464]}, {"w": "that", "b": [0.3684, 0.1267, 0.4118, 0.1464]}, {"w": "returns", "b": [0.4181, 0.1267, 0.4975, 0.1464]}, {"w": "the", "b": [0.5038, 0.1267, 0.5374, 0.1464]}, {"w": "activations", "b": [0.5437, 0.1267, 0.6601, 0.1464]}, {"w": "of", "b": [0.6664, 0.1267, 0.6874, 0.1464]}, {"w": "every", "b": [0.6937, 0.1267, 0.7525, 0.1464]}, {"w": "layer", "b": [0.7588, 0.1267, 0.8134, 0.1464]}, {"w": "3", "b": [0.1799, 0.1472, 0.1925, 0.1669]}, {"w": "Obtains", "b": [0.1988, 0.1472, 0.2843, 0.1669]}, {"w": "the", "b": [0.2906, 0.1472, 0.3242, 0.1669]}, {"w": "first", "b": [0.3305, 0.1472, 0.3754, 0.1669]}, {"w": "input", "b": [0.3817, 0.1472, 0.4392, 0.1669]}, {"w": "sample", "b": [0.4455, 0.1472, 0.5211, 0.1669]}, {"w": "of", "b": [0.5274, 0.1472, 0.5485, 0.1669]}, {"w": "the", "b": [0.5548, 0.1472, 0.5884, 0.1669]}, {"w": "validation", "b": [0.5947, 0.1472, 0.7026, 0.1669]}, {"w": "data", "b": [0.7089, 0.1472, 0.7566, 0.1669]}, {"w": "4", "b": [0.1799, 0.1677, 0.1925, 0.1874]}, {"w": "Saves", "b": [0.1988, 0.1677, 0.259, 0.1874]}, {"w": "arrays", "b": [0.2654, 0.1677, 0.3354, 0.1874]}, {"w": "to", "b": [0.3417, 0.1677, 0.3627, 0.1874]}, {"w": "disk", "b": [0.369, 0.1677, 0.4139, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "This is all you need to know about callbacks—the rest is technical details, which you can easily look up. Now you’re equipped to perform any sort of logging or preprogrammed intervention on a Keras model during training.", "words": [{"w": "This", "b": [0.1294, 0.2105, 0.1743, 0.2302]}, {"w": "is", "b": [0.1806, 0.2105, 0.1974, 0.2302]}, {"w": "all", "b": [0.2037, 0.2105, 0.2289, 0.2302]}, {"w": "you", "b": [0.2352, 0.2105, 0.2731, 0.2302]}, {"w": "need", "b": [0.2794, 0.2105, 0.327, 0.2302]}, {"w": "to", "b": [0.3333, 0.2105, 0.3529, 0.2302]}, {"w": "know", "b": [0.3592, 0.2105, 0.4153, 0.2302]}, {"w": "about", "b": [0.4216, 0.2105, 0.4777, 0.2302]}, {"w": "callbacks—the", "b": [0.484, 0.2105, 0.6339, 0.2302]}, {"w": "rest", "b": [0.6402, 0.2105, 0.6766, 0.2302]}, {"w": "is", "b": [0.6829, 0.2105, 0.6997, 0.2302]}, {"w": "technical", "b": [0.706, 0.2105, 0.7971, 0.2302]}, {"w": "details,", "b": [0.1294, 0.231, 0.2016, 0.2507]}, {"w": "which", "b": [0.2079, 0.231, 0.2695, 0.2507]}, {"w": "you", "b": [0.2758, 0.231, 0.3137, 0.2507]}, {"w": "can", "b": [0.32, 0.231, 0.355, 0.2507]}, {"w": "easily", "b": [0.3613, 0.231, 0.4202, 0.2507]}, {"w": "look", "b": [0.4265, 0.231, 0.4713, 0.2507]}, {"w": "up.", "b": [0.4776, 0.231, 0.5092, 0.2507]}, {"w": "Now", "b": [0.5155, 0.231, 0.5645, 0.2507]}, {"w": "you’re", "b": [0.5708, 0.231, 0.6367, 0.2507]}, {"w": "equipped", "b": [0.643, 0.231, 0.7354, 0.2507]}, {"w": "to", "b": [0.7417, 0.231, 0.7613, 0.2507]}, {"w": "perform", "b": [0.7676, 0.231, 0.8489, 0.2507]}, {"w": "any", "b": [0.1294, 0.2515, 0.1658, 0.2712]}, {"w": "sort", "b": [0.1721, 0.2515, 0.21, 0.2712]}, {"w": "of", "b": [0.2163, 0.2515, 0.2373, 0.2712]}, {"w": "logging", "b": [0.2436, 0.2515, 0.3207, 0.2712]}, {"w": "or", "b": [0.327, 0.2515, 0.348, 0.2712]}, {"w": "preprogrammed", "b": [0.3543, 0.2515, 0.5154, 0.2712]}, {"w": "intervention", "b": [0.5217, 0.2515, 0.6437, 0.2712]}, {"w": "on", "b": [0.65, 0.2515, 0.6752, 0.2712]}, {"w": "a", "b": [0.6815, 0.2515, 0.6927, 0.2712]}, {"w": "Keras", "b": [0.699, 0.2515, 0.7578, 0.2712]}, {"w": "model", "b": [0.7641, 0.2515, 0.8272, 0.2712]}, {"w": "during", "b": [0.1294, 0.272, 0.1953, 0.2917]}, {"w": "training.", "b": [0.2016, 0.272, 0.2864, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "7.2.2. Introduction to TensorBoard: the TensorFlow visualization framework", "words": [{"w": "7.2.2.", "b": [0.1294, 0.3192, 0.1862, 0.3389]}, {"w": "Introduction", "b": [0.1925, 0.3192, 0.3294, 0.3389]}, {"w": "to", "b": [0.3357, 0.3192, 0.3567, 0.3389]}, {"w": "TensorBoard:", "b": [0.363, 0.3192, 0.512, 0.3389]}, {"w": "the", "b": [0.5184, 0.3192, 0.552, 0.3389]}, {"w": "TensorFlow", "b": [0.5583, 0.3192, 0.6849, 0.3389]}, {"w": "visualization", "b": [0.6912, 0.3192, 0.8272, 0.3389]}, {"w": "framework", "b": [0.1294, 0.3397, 0.2499, 0.3594]}]}, {"id": "b_3", "type": "paragraph", "text": "To do good research or develop good models, you need rich, frequent feedback about what’s going on inside your models during your experiments. That’s the point of running experiments: to get information about how well a model performs—as much information as possible. Making progress is an iterative process, or loop: you start with an idea and express it as an experiment, attempting to validate or invalidate your idea. You run this experiment and process the information it generates. This inspires your next idea. The more iterations of this loop you’re able to run, the more refined and powerful your ideas become. Keras helps you go from idea to experiment in the least possible time, and fast GPUs can help you get from experiment to result as quickly as possible. But what about processing the experiment results? That’s where TensorBoard comes in.", "words": [{"w": "To", "b": [0.1294, 0.3825, 0.1557, 0.4022]}, {"w": "do", "b": [0.162, 0.3825, 0.1872, 0.4022]}, {"w": "good", "b": [0.1935, 0.3825, 0.244, 0.4022]}, {"w": "research", "b": [0.2503, 0.3825, 0.3343, 0.4022]}, {"w": "or", "b": [0.3406, 0.3825, 0.3616, 0.4022]}, {"w": "develop", "b": [0.3679, 0.3825, 0.4478, 0.4022]}, {"w": "good", "b": [0.4541, 0.3825, 0.5045, 0.4022]}, {"w": "models,", "b": [0.5109, 0.3825, 0.59, 0.4022]}, {"w": "you", "b": [0.5963, 0.3825, 0.6342, 0.4022]}, {"w": "need", "b": [0.6405, 0.3825, 0.6881, 0.4022]}, {"w": "rich,", "b": [0.6944, 0.3825, 0.74, 0.4022]}, {"w": "frequent", "b": [0.7463, 0.3825, 0.8303, 0.4022]}, {"w": "feedback", "b": [0.1294, 0.403, 0.2205, 0.4227]}, {"w": "about", "b": [0.2268, 0.403, 0.2828, 0.4227]}, {"w": "what’s", "b": [0.2891, 0.403, 0.3549, 0.4227]}, {"w": "going", "b": [0.3613, 0.403, 0.4187, 0.4227]}, {"w": "on", "b": [0.425, 0.403, 0.4503, 0.4227]}, {"w": "inside", "b": [0.4566, 0.403, 0.5168, 0.4227]}, {"w": "your", "b": [0.5231, 0.403, 0.5694, 0.4227]}, {"w": "models", "b": [0.5757, 0.403, 0.6486, 0.4227]}, {"w": "during", "b": [0.6549, 0.403, 0.7207, 0.4227]}, {"w": "your", "b": [0.727, 0.403, 0.7732, 0.4227]}, {"w": "experiments.", "b": [0.1294, 0.4235, 0.259, 0.4432]}, {"w": "That’s", "b": [0.2653, 0.4235, 0.3284, 0.4432]}, {"w": "the", "b": [0.3347, 0.4235, 0.3655, 0.4432]}, {"w": "point", "b": [0.3718, 0.4235, 0.4237, 0.4432]}, {"w": "of", "b": [0.43, 0.4235, 0.451, 0.4432]}, {"w": "running", "b": [0.4573, 0.4235, 0.5358, 0.4432]}, {"w": "experiments:", "b": [0.5421, 0.4235, 0.6724, 0.4432]}, {"w": "to", "b": [0.6787, 0.4235, 0.6983, 0.4432]}, {"w": "get", "b": [0.7046, 0.4235, 0.7354, 0.4432]}, {"w": "information", "b": [0.7418, 0.4235, 0.8609, 0.4432]}, {"w": "about", "b": [0.1294, 0.444, 0.1855, 0.4637]}, {"w": "how", "b": [0.1918, 0.444, 0.2352, 0.4637]}, {"w": "well", "b": [0.2415, 0.444, 0.285, 0.4637]}, {"w": "a", "b": [0.2913, 0.444, 0.3025, 0.4637]}, {"w": "model", "b": [0.3088, 0.444, 0.3718, 0.4637]}, {"w": "performs—as", "b": [0.3781, 0.444, 0.5154, 0.4637]}, {"w": "much", "b": [0.5217, 0.444, 0.5778, 0.4637]}, {"w": "information", "b": [0.5841, 0.444, 0.7032, 0.4637]}, {"w": "as", "b": [0.7095, 0.444, 0.7305, 0.4637]}, {"w": "possible.", "b": [0.7368, 0.444, 0.8258, 0.4637]}, {"w": "Making", "b": [0.1294, 0.4645, 0.2079, 0.4842]}, {"w": "progress", "b": [0.2142, 0.4645, 0.2997, 0.4842]}, {"w": "is", "b": [0.306, 0.4645, 0.3228, 0.4842]}, {"w": "an", "b": [0.3291, 0.4645, 0.3529, 0.4842]}, {"w": "iterative", "b": [0.3592, 0.4645, 0.4419, 0.4842]}, {"w": "process,", "b": [0.4482, 0.4645, 0.5301, 0.4842]}, {"w": "or", "b": [0.5365, 0.4645, 0.5575, 0.4842]}, {"w": "loop:", "b": [0.5638, 0.4645, 0.6156, 0.4842]}, {"w": "you", "b": [0.6219, 0.4645, 0.6598, 0.4842]}, {"w": "start", "b": [0.6661, 0.4645, 0.7095, 0.4842]}, {"w": "with", "b": [0.7158, 0.4645, 0.7607, 0.4842]}, {"w": "an", "b": [0.767, 0.4645, 0.7908, 0.4842]}, {"w": "idea", "b": [0.7971, 0.4645, 0.8391, 0.4842]}, {"w": "and", "b": [0.1294, 0.485, 0.1658, 0.5047]}, {"w": "express", "b": [0.1721, 0.485, 0.2478, 0.5047]}, {"w": "it", "b": [0.2541, 0.485, 0.2681, 0.5047]}, {"w": "as", "b": [0.2744, 0.485, 0.2954, 0.5047]}, {"w": "an", "b": [0.3018, 0.485, 0.3256, 0.5047]}, {"w": "experiment,", "b": [0.3319, 0.485, 0.4517, 0.5047]}, {"w": "attempting", "b": [0.458, 0.485, 0.5659, 0.5047]}, {"w": "to", "b": [0.5721, 0.485, 0.5917, 0.5047]}, {"w": "validate", "b": [0.5981, 0.485, 0.6779, 0.5047]}, {"w": "or", "b": [0.6842, 0.485, 0.7052, 0.5047]}, {"w": "invalidate", "b": [0.7115, 0.485, 0.811, 0.5047]}, {"w": "your", "b": [0.8173, 0.485, 0.8636, 0.5047]}, {"w": "idea.", "b": [0.1294, 0.5055, 0.1777, 0.5252]}, {"w": "You", "b": [0.1841, 0.5055, 0.225, 0.5252]}, {"w": "run", "b": [0.2313, 0.5055, 0.2649, 0.5252]}, {"w": "this", "b": [0.2712, 0.5055, 0.3076, 0.5252]}, {"w": "experiment", "b": [0.314, 0.5055, 0.4274, 0.5252]}, {"w": "and", "b": [0.4338, 0.5055, 0.4702, 0.5252]}, {"w": "process", "b": [0.4765, 0.5055, 0.5521, 0.5252]}, {"w": "the", "b": [0.5584, 0.5055, 0.5893, 0.5252]}, {"w": "information", "b": [0.5956, 0.5055, 0.7147, 0.5252]}, {"w": "it", "b": [0.721, 0.5055, 0.735, 0.5252]}, {"w": "generates.", "b": [0.7413, 0.5055, 0.8429, 0.5252]}, {"w": "This", "b": [0.1294, 0.526, 0.1743, 0.5457]}, {"w": "inspires", "b": [0.1806, 0.526, 0.259, 0.5457]}, {"w": "your", "b": [0.2654, 0.526, 0.3116, 0.5457]}, {"w": "next", "b": [0.3179, 0.526, 0.3613, 0.5457]}, {"w": "idea.", "b": [0.3676, 0.526, 0.416, 0.5457]}, {"w": "The", "b": [0.4223, 0.526, 0.4615, 0.5457]}, {"w": "more", "b": [0.4678, 0.526, 0.5196, 0.5457]}, {"w": "iterations", "b": [0.5259, 0.526, 0.6198, 0.5457]}, {"w": "of", "b": [0.6261, 0.526, 0.6471, 0.5457]}, {"w": "this", "b": [0.6535, 0.526, 0.6899, 0.5457]}, {"w": "loop", "b": [0.6962, 0.526, 0.7411, 0.5457]}, {"w": "you’re", "b": [0.7474, 0.526, 0.8132, 0.5457]}, {"w": "able", "b": [0.8195, 0.526, 0.8615, 0.5457]}, {"w": "to", "b": [0.1294, 0.5465, 0.149, 0.5662]}, {"w": "run,", "b": [0.1553, 0.5465, 0.1953, 0.5662]}, {"w": "the", "b": [0.2016, 0.5465, 0.2324, 0.5662]}, {"w": "more", "b": [0.2387, 0.5465, 0.2906, 0.5662]}, {"w": "refined", "b": [0.2969, 0.5465, 0.3683, 0.5662]}, {"w": "and", "b": [0.3746, 0.5465, 0.411, 0.5662]}, {"w": "powerful", "b": [0.4173, 0.5465, 0.5084, 0.5662]}, {"w": "your", "b": [0.5147, 0.5465, 0.5609, 0.5662]}, {"w": "ideas", "b": [0.5673, 0.5465, 0.6191, 0.5662]}, {"w": "become.", "b": [0.6254, 0.5465, 0.7102, 0.5662]}, {"w": "Keras", "b": [0.7165, 0.5465, 0.7753, 0.5662]}, {"w": "helps", "b": [0.7816, 0.5465, 0.8349, 0.5662]}, {"w": "you", "b": [0.1294, 0.567, 0.1673, 0.5867]}, {"w": "go", "b": [0.1736, 0.567, 0.1988, 0.5867]}, {"w": "from", "b": [0.2051, 0.567, 0.2541, 0.5867]}, {"w": "idea", "b": [0.2604, 0.567, 0.3025, 0.5867]}, {"w": "to", "b": [0.3088, 0.567, 0.3284, 0.5867]}, {"w": "experiment", "b": [0.3347, 0.567, 0.4482, 0.5867]}, {"w": "in", "b": [0.4545, 0.567, 0.4741, 0.5867]}, {"w": "the", "b": [0.4804, 0.567, 0.5113, 0.5867]}, {"w": "least", "b": [0.5176, 0.567, 0.5638, 0.5867]}, {"w": "possible", "b": [0.5701, 0.567, 0.6528, 0.5867]}, {"w": "time,", "b": [0.6591, 0.567, 0.7103, 0.5867]}, {"w": "and", "b": [0.7166, 0.567, 0.753, 0.5867]}, {"w": "fast", "b": [0.7593, 0.567, 0.7957, 0.5867]}, {"w": "GPUs", "b": [0.802, 0.567, 0.8623, 0.5867]}, {"w": "can", "b": [0.1294, 0.5875, 0.1644, 0.6072]}, {"w": "help", "b": [0.1707, 0.5875, 0.2142, 0.6072]}, {"w": "you", "b": [0.2205, 0.5875, 0.2583, 0.6072]}, {"w": "get", "b": [0.2646, 0.5875, 0.2954, 0.6072]}, {"w": "from", "b": [0.3018, 0.5875, 0.3508, 0.6072]}, {"w": "experiment", "b": [0.3571, 0.5875, 0.4706, 0.6072]}, {"w": "to", "b": [0.4769, 0.5875, 0.4965, 0.6072]}, {"w": "result", "b": [0.5028, 0.5875, 0.5589, 0.6072]}, {"w": "as", "b": [0.5652, 0.5875, 0.5862, 0.6072]}, {"w": "quickly", "b": [0.5925, 0.5875, 0.6682, 0.6072]}, {"w": "as", "b": [0.6744, 0.5875, 0.6954, 0.6072]}, {"w": "possible.", "b": [0.7017, 0.5875, 0.7907, 0.6072]}, {"w": "But", "b": [0.797, 0.5875, 0.8335, 0.6072]}, {"w": "what", "b": [0.1294, 0.608, 0.1785, 0.6277]}, {"w": "about", "b": [0.1848, 0.608, 0.2408, 0.6277]}, {"w": "processing", "b": [0.2471, 0.608, 0.355, 0.6277]}, {"w": "the", "b": [0.3613, 0.608, 0.3921, 0.6277]}, {"w": "experiment", "b": [0.3984, 0.608, 0.5119, 0.6277]}, {"w": "results?", "b": [0.5182, 0.608, 0.5953, 0.6277]}, {"w": "That’s", "b": [0.6016, 0.608, 0.6646, 0.6277]}, {"w": "where", "b": [0.6709, 0.608, 0.7325, 0.6277]}, {"w": "TensorBoard", "b": [0.7388, 0.608, 0.8688, 0.6277]}, {"w": "comes", "b": [0.1294, 0.6285, 0.1939, 0.6482]}, {"w": "in.", "b": [0.2002, 0.6285, 0.2261, 0.6482]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 7.9. The loop of progress", "words": [{"w": "Figure", "b": [0.1294, 0.6663, 0.1827, 0.6811]}, {"w": "7.9.", "b": [0.1874, 0.6663, 0.2158, 0.6811]}, {"w": "The", "b": [0.2205, 0.6663, 0.252, 0.6811]}, {"w": "loop", "b": [0.2567, 0.6663, 0.2914, 0.6811]}, {"w": "of", "b": [0.2962, 0.6663, 0.3119, 0.6811]}, {"w": "progress", "b": [0.3167, 0.6663, 0.3853, 0.6811]}]}, {"id": "b_5", "type": "paragraph", "text": "This section introduces TensorBoard, a browser-based visualization tool that comes packaged with TensorFlow. Note that it’s only available for", "words": [{"w": "This", "b": [0.1294, 0.87, 0.1743, 0.8898]}, {"w": "section", "b": [0.1806, 0.87, 0.252, 0.8898]}, {"w": "introduces", "b": [0.2583, 0.87, 0.3634, 0.8898]}, {"w": "TensorBoard,", "b": [0.3697, 0.87, 0.506, 0.8898]}, {"w": "a", "b": [0.5123, 0.87, 0.5235, 0.8898]}, {"w": "browser-based", "b": [0.5298, 0.87, 0.6764, 0.8898]}, {"w": "visualization", "b": [0.6827, 0.87, 0.8116, 0.8898]}, {"w": "tool", "b": [0.8179, 0.87, 0.8571, 0.8898]}, {"w": "that", "b": [0.1294, 0.8905, 0.1673, 0.9103]}, {"w": "comes", "b": [0.1736, 0.8905, 0.238, 0.9103]}, {"w": "packaged", "b": [0.2443, 0.8905, 0.3396, 0.9103]}, {"w": "with", "b": [0.3459, 0.8905, 0.3907, 0.9103]}, {"w": "TensorFlow.", "b": [0.397, 0.8905, 0.5218, 0.9103]}, {"w": "Note", "b": [0.5281, 0.8905, 0.5772, 0.9103]}, {"w": "that", "b": [0.5835, 0.8905, 0.6213, 0.9103]}, {"w": "it’s", "b": [0.6276, 0.8905, 0.6584, 0.9103]}, {"w": "only", "b": [0.6647, 0.8905, 0.7096, 0.9103]}, {"w": "available", "b": [0.7159, 0.8905, 0.807, 0.9103]}, {"w": "for", "b": [0.8133, 0.8905, 0.8427, 0.9103]}]}]}, {"page": 332, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Keras models when you’re using Keras with the TensorFlow backend.", "words": [{"w": "Keras", "b": [0.1294, 0.0857, 0.1882, 0.1054]}, {"w": "models", "b": [0.1945, 0.0857, 0.2674, 0.1054]}, {"w": "when", "b": [0.2737, 0.0857, 0.3284, 0.1054]}, {"w": "you’re", "b": [0.3347, 0.0857, 0.4005, 0.1054]}, {"w": "using", "b": [0.4068, 0.0857, 0.4615, 0.1054]}, {"w": "Keras", "b": [0.4678, 0.0857, 0.5266, 0.1054]}, {"w": "with", "b": [0.5329, 0.0857, 0.5778, 0.1054]}, {"w": "the", "b": [0.5841, 0.0857, 0.6149, 0.1054]}, {"w": "TensorFlow", "b": [0.6212, 0.0857, 0.7413, 0.1054]}, {"w": "backend.", "b": [0.7476, 0.0857, 0.838, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "The key purpose of TensorBoard is to help you visually monitor everything that goes on inside your model during training. If you’re monitoring more information than just the model’s final loss, you can develop a clearer vision of what the model does and doesn’t do, and you can make progress more quickly. TensorBoard gives you access to several neat features, all in your browser:", "words": [{"w": "The", "b": [0.1294, 0.1285, 0.1686, 0.1482]}, {"w": "key", "b": [0.1749, 0.1285, 0.2114, 0.1482]}, {"w": "purpose", "b": [0.2177, 0.1285, 0.2975, 0.1482]}, {"w": "of", "b": [0.3038, 0.1285, 0.3249, 0.1482]}, {"w": "TensorBoard", "b": [0.3312, 0.1285, 0.4611, 0.1482]}, {"w": "is", "b": [0.4674, 0.1285, 0.4842, 0.1482]}, {"w": "to", "b": [0.4905, 0.1285, 0.5102, 0.1482]}, {"w": "help", "b": [0.5165, 0.1285, 0.5599, 0.1482]}, {"w": "you", "b": [0.5662, 0.1285, 0.604, 0.1482]}, {"w": "visually", "b": [0.6104, 0.1285, 0.6902, 0.1482]}, {"w": "monitor", "b": [0.6966, 0.1285, 0.7764, 0.1482]}, {"w": "everything", "b": [0.1294, 0.149, 0.2373, 0.1687]}, {"w": "that", "b": [0.2436, 0.149, 0.2814, 0.1687]}, {"w": "goes", "b": [0.2878, 0.149, 0.334, 0.1687]}, {"w": "on", "b": [0.3403, 0.149, 0.3655, 0.1687]}, {"w": "inside", "b": [0.3718, 0.149, 0.4321, 0.1687]}, {"w": "your", "b": [0.4384, 0.149, 0.4846, 0.1687]}, {"w": "model", "b": [0.4909, 0.149, 0.554, 0.1687]}, {"w": "during", "b": [0.5603, 0.149, 0.6262, 0.1687]}, {"w": "training.", "b": [0.6325, 0.149, 0.7173, 0.1687]}, {"w": "If", "b": [0.7235, 0.149, 0.7403, 0.1687]}, {"w": "you’re", "b": [0.7466, 0.149, 0.8124, 0.1687]}, {"w": "monitoring", "b": [0.1294, 0.1695, 0.2415, 0.1892]}, {"w": "more", "b": [0.2478, 0.1695, 0.2997, 0.1892]}, {"w": "information", "b": [0.306, 0.1695, 0.4251, 0.1892]}, {"w": "than", "b": [0.4314, 0.1695, 0.4749, 0.1892]}, {"w": "just", "b": [0.4812, 0.1695, 0.5176, 0.1892]}, {"w": "the", "b": [0.5239, 0.1695, 0.5547, 0.1892]}, {"w": "model’s", "b": [0.5611, 0.1695, 0.6409, 0.1892]}, {"w": "final", "b": [0.6472, 0.1695, 0.6934, 0.1892]}, {"w": "loss,", "b": [0.6997, 0.1695, 0.7453, 0.1892]}, {"w": "you", "b": [0.7516, 0.1695, 0.7894, 0.1892]}, {"w": "can", "b": [0.7957, 0.1695, 0.8307, 0.1892]}, {"w": "develop", "b": [0.1294, 0.19, 0.2093, 0.2097]}, {"w": "a", "b": [0.2156, 0.19, 0.2268, 0.2097]}, {"w": "clearer", "b": [0.2331, 0.19, 0.3017, 0.2097]}, {"w": "vision", "b": [0.308, 0.19, 0.3697, 0.2097]}, {"w": "of", "b": [0.376, 0.19, 0.397, 0.2097]}, {"w": "what", "b": [0.4033, 0.19, 0.4524, 0.2097]}, {"w": "the", "b": [0.4587, 0.19, 0.4895, 0.2097]}, {"w": "model", "b": [0.4958, 0.19, 0.5589, 0.2097]}, {"w": "does", "b": [0.5651, 0.19, 0.6113, 0.2097]}, {"w": "and", "b": [0.6176, 0.19, 0.6541, 0.2097]}, {"w": "doesn’t", "b": [0.6604, 0.19, 0.7342, 0.2097]}, {"w": "do,", "b": [0.7405, 0.19, 0.772, 0.2097]}, {"w": "and", "b": [0.7783, 0.19, 0.8147, 0.2097]}, {"w": "you", "b": [0.821, 0.19, 0.8589, 0.2097]}, {"w": "can", "b": [0.1294, 0.2105, 0.1644, 0.2302]}, {"w": "make", "b": [0.1707, 0.2105, 0.2254, 0.2302]}, {"w": "progress", "b": [0.2317, 0.2105, 0.3171, 0.2302]}, {"w": "more", "b": [0.3234, 0.2105, 0.3753, 0.2302]}, {"w": "quickly.", "b": [0.3816, 0.2105, 0.4619, 0.2302]}, {"w": "TensorBoard", "b": [0.4682, 0.2105, 0.5981, 0.2302]}, {"w": "gives", "b": [0.6045, 0.2105, 0.6577, 0.2302]}, {"w": "you", "b": [0.664, 0.2105, 0.7019, 0.2302]}, {"w": "access", "b": [0.7082, 0.2105, 0.7726, 0.2302]}, {"w": "to", "b": [0.7789, 0.2105, 0.7985, 0.2302]}, {"w": "several", "b": [0.1294, 0.231, 0.2009, 0.2507]}, {"w": "neat", "b": [0.2072, 0.231, 0.2492, 0.2507]}, {"w": "features,", "b": [0.2555, 0.231, 0.3416, 0.2507]}, {"w": "all", "b": [0.3479, 0.231, 0.3732, 0.2507]}, {"w": "in", "b": [0.3795, 0.231, 0.3991, 0.2507]}, {"w": "your", "b": [0.4053, 0.231, 0.4516, 0.2507]}, {"w": "browser:", "b": [0.4579, 0.231, 0.5461, 0.2507]}]}, {"id": "b_2", "type": "paragraph", "text": "Visually monitoring metrics during training Visualizing your model architecture Visualizing histograms of activations and gradients Exploring embeddings in 3D", "words": [{"w": "Visually", "b": [0.1799, 0.2693, 0.2638, 0.289]}, {"w": "monitoring", "b": [0.2701, 0.2693, 0.3823, 0.289]}, {"w": "metrics", "b": [0.3886, 0.2693, 0.4628, 0.289]}, {"w": "during", "b": [0.4692, 0.2693, 0.535, 0.289]}, {"w": "training", "b": [0.5413, 0.2693, 0.6198, 0.289]}, {"w": "Visualizing", "b": [0.1799, 0.2898, 0.2947, 0.3095]}, {"w": "your", "b": [0.301, 0.2898, 0.3472, 0.3095]}, {"w": "model", "b": [0.3535, 0.2898, 0.4166, 0.3095]}, {"w": "architecture", "b": [0.4229, 0.2898, 0.542, 0.3095]}, {"w": "Visualizing", "b": [0.1799, 0.3103, 0.2947, 0.33]}, {"w": "histograms", "b": [0.301, 0.3103, 0.4117, 0.33]}, {"w": "of", "b": [0.418, 0.3103, 0.439, 0.33]}, {"w": "activations", "b": [0.4453, 0.3103, 0.5546, 0.33]}, {"w": "and", "b": [0.5609, 0.3103, 0.5974, 0.33]}, {"w": "gradients", "b": [0.6037, 0.3103, 0.6961, 0.33]}, {"w": "Exploring", "b": [0.1799, 0.3308, 0.2808, 0.3505]}, {"w": "embeddings", "b": [0.2871, 0.3308, 0.409, 0.3505]}, {"w": "in", "b": [0.4153, 0.3308, 0.4349, 0.3505]}, {"w": "3D", "b": [0.4412, 0.3308, 0.4721, 0.3505]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s demonstrate these features on a simple example. You’ll train a 1D convnet on the IMDB sentiment-analysis task.", "words": [{"w": "Let’s", "b": [0.1294, 0.3736, 0.1798, 0.3933]}, {"w": "demonstrate", "b": [0.1862, 0.3736, 0.3095, 0.3933]}, {"w": "these", "b": [0.3158, 0.3736, 0.3676, 0.3933]}, {"w": "features", "b": [0.3739, 0.3736, 0.4537, 0.3933]}, {"w": "on", "b": [0.4601, 0.3736, 0.4853, 0.3933]}, {"w": "a", "b": [0.4916, 0.3736, 0.5028, 0.3933]}, {"w": "simple", "b": [0.5091, 0.3736, 0.5764, 0.3933]}, {"w": "example.", "b": [0.5827, 0.3736, 0.6744, 0.3933]}, {"w": "You’ll", "b": [0.6808, 0.3736, 0.744, 0.3933]}, {"w": "train", "b": [0.7503, 0.3736, 0.7966, 0.3933]}, {"w": "a", "b": [0.8029, 0.3736, 0.8141, 0.3933]}, {"w": "1D", "b": [0.8204, 0.3736, 0.8512, 0.3933]}, {"w": "convnet", "b": [0.1294, 0.3941, 0.2093, 0.4138]}, {"w": "on", "b": [0.2156, 0.3941, 0.2408, 0.4138]}, {"w": "the", "b": [0.2471, 0.3941, 0.2779, 0.4138]}, {"w": "IMDB", "b": [0.2842, 0.3941, 0.3501, 0.4138]}, {"w": "sentiment-analysis", "b": [0.3564, 0.3941, 0.5442, 0.4138]}, {"w": "task.", "b": [0.5505, 0.3941, 0.5975, 0.4138]}]}, {"id": "b_4", "type": "paragraph", "text": "The model is similar to the one you saw in the last section of chapter 6. You’ll consider only the top 2,000 words in the IMDB vocabulary, to make visualizing word embeddings more tractable.", "words": [{"w": "The", "b": [0.1294, 0.4369, 0.1686, 0.4566]}, {"w": "model", "b": [0.1749, 0.4369, 0.238, 0.4566]}, {"w": "is", "b": [0.2443, 0.4369, 0.2611, 0.4566]}, {"w": "similar", "b": [0.2674, 0.4369, 0.3375, 0.4566]}, {"w": "to", "b": [0.3438, 0.4369, 0.3635, 0.4566]}, {"w": "the", "b": [0.3698, 0.4369, 0.4006, 0.4566]}, {"w": "one", "b": [0.4069, 0.4369, 0.4433, 0.4566]}, {"w": "you", "b": [0.4496, 0.4369, 0.4875, 0.4566]}, {"w": "saw", "b": [0.4938, 0.4369, 0.533, 0.4566]}, {"w": "in", "b": [0.5393, 0.4369, 0.5589, 0.4566]}, {"w": "the", "b": [0.5652, 0.4369, 0.5961, 0.4566]}, {"w": "last", "b": [0.6024, 0.4369, 0.6374, 0.4566]}, {"w": "section", "b": [0.6437, 0.4369, 0.7152, 0.4566]}, {"w": "of", "b": [0.7215, 0.4369, 0.7425, 0.4566]}, {"w": "chapter", "b": [0.7487, 0.4369, 0.823, 0.4566]}, {"w": "6.", "b": [0.8293, 0.4369, 0.8482, 0.4566]}, {"w": "You’ll", "b": [0.1294, 0.4574, 0.1928, 0.4771]}, {"w": "consider", "b": [0.1991, 0.4574, 0.2845, 0.4771]}, {"w": "only", "b": [0.2908, 0.4574, 0.3357, 0.4771]}, {"w": "the", "b": [0.342, 0.4574, 0.3728, 0.4771]}, {"w": "top", "b": [0.3791, 0.4574, 0.4114, 0.4771]}, {"w": "2,000", "b": [0.4177, 0.4574, 0.4744, 0.4771]}, {"w": "words", "b": [0.4807, 0.4574, 0.5424, 0.4771]}, {"w": "in", "b": [0.5487, 0.4574, 0.5683, 0.4771]}, {"w": "the", "b": [0.5746, 0.4574, 0.6054, 0.4771]}, {"w": "IMDB", "b": [0.6118, 0.4574, 0.6776, 0.4771]}, {"w": "vocabulary,", "b": [0.6839, 0.4574, 0.8006, 0.4771]}, {"w": "to", "b": [0.8069, 0.4574, 0.8266, 0.4771]}, {"w": "make", "b": [0.1294, 0.4779, 0.1841, 0.4976]}, {"w": "visualizing", "b": [0.1904, 0.4779, 0.3011, 0.4976]}, {"w": "word", "b": [0.3074, 0.4779, 0.3592, 0.4976]}, {"w": "embeddings", "b": [0.3655, 0.4779, 0.4874, 0.4976]}, {"w": "more", "b": [0.4937, 0.4779, 0.5456, 0.4976]}, {"w": "tractable.", "b": [0.5519, 0.4779, 0.6451, 0.4976]}]}, {"id": "b_5", "type": "equation", "text": "Listing 7.7. Text-classification model to use with TensorBoard", "words": [{"w": "Listing", "b": [0.1294, 0.5157, 0.1862, 0.5305]}, {"w": "7.7.", "b": [0.1909, 0.5157, 0.2193, 0.5305]}, {"w": "Text-classification", "b": [0.224, 0.5157, 0.3694, 0.5305]}, {"w": "model", "b": [0.3741, 0.5157, 0.4235, 0.5305]}, {"w": "to", "b": [0.4283, 0.5157, 0.444, 0.5305]}, {"w": "use", "b": [0.4488, 0.5157, 0.475, 0.5305]}, {"w": "with", "b": [0.4798, 0.5157, 0.5155, 0.5305]}, {"w": "TensorBoard", "b": [0.5202, 0.5157, 0.6257, 0.5305]}]}, {"id": "b_6", "type": "paragraph", "text": "import keras from keras import layers from keras.datasets import imdb from keras.preprocessing import sequence max_features = 2000 1 max_len = 500 2 (x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=max_features) x_train = sequence.pad_sequences(x_train, maxlen=max_len) x_test = sequence.pad_sequences(x_test, maxlen=max_len) model = keras.models.Sequential() model.add(layers.Embedding(max_features, 128, input_length=max_len, name='embed')) model.add(layers.Conv1D(32, 7, activation='relu')) model.add(layers.MaxPooling1D(5)) model.add(layers.Conv1D(32, 7, activation='relu')) model.add(layers.GlobalMaxPooling1D()) model.add(layers.Dense(1))", "words": [{"w": "import", "b": [0.1357, 0.5441, 0.2038, 0.5593]}, {"w": "keras", "b": [0.2152, 0.5441, 0.2719, 0.5593]}, {"w": "from", "b": [0.1357, 0.5593, 0.1811, 0.5744]}, {"w": "keras", "b": [0.1925, 0.5593, 0.2492, 0.5744]}, {"w": "import", "b": [0.2606, 0.5593, 0.3287, 0.5744]}, {"w": "layers", "b": [0.34, 0.5593, 0.4082, 0.5744]}, {"w": "from", "b": [0.1357, 0.5744, 0.1811, 0.5896]}, {"w": "keras.datasets", "b": [0.1925, 0.5744, 0.3514, 0.5896]}, {"w": "import", "b": [0.3628, 0.5744, 0.4309, 0.5896]}, {"w": "imdb", "b": [0.4422, 0.5744, 0.4876, 0.5896]}, {"w": "from", "b": [0.1357, 0.5896, 0.1811, 0.6047]}, {"w": "keras.preprocessing", "b": [0.1925, 0.5896, 0.4082, 0.6047]}, {"w": "import", "b": [0.4195, 0.5896, 0.4876, 0.6047]}, {"w": "sequence", "b": [0.499, 0.5896, 0.5898, 0.6047]}, {"w": "max_features", "b": [0.1357, 0.6199, 0.2719, 0.635]}, {"w": "=", "b": [0.2833, 0.6199, 0.2946, 0.635]}, {"w": "2000", "b": [0.306, 0.6199, 0.3514, 0.635]}, {"w": "1", "b": [0.1357, 0.635, 0.1471, 0.6502]}, {"w": "max_len", "b": [0.1357, 0.6502, 0.2152, 0.6653]}, {"w": "=", "b": [0.2265, 0.6502, 0.2379, 0.6653]}, {"w": "500", "b": [0.2492, 0.6502, 0.2833, 0.6653]}, {"w": "2", "b": [0.1357, 0.6653, 0.1471, 0.6805]}, {"w": "(x_train,", "b": [0.1357, 0.6956, 0.2379, 0.7108]}, {"w": "y_train),", "b": [0.2492, 0.6956, 0.3514, 0.7108]}, {"w": "(x_test,", "b": [0.3628, 0.6956, 0.4536, 0.7108]}, {"w": "y_test)", "b": [0.4649, 0.6956, 0.5444, 0.7108]}, {"w": "=", "b": [0.5557, 0.6956, 0.5671, 0.7108]}, {"w": "imdb.load_data(num_words=max_features)", "b": [0.1357, 0.7108, 0.5671, 0.7259]}, {"w": "x_train", "b": [0.1357, 0.7259, 0.2152, 0.7411]}, {"w": "=", "b": [0.2265, 0.7259, 0.2379, 0.7411]}, {"w": "sequence.pad_sequences(x_train,", "b": [0.2492, 0.7259, 0.6011, 0.7411]}, {"w": "maxlen=max_len)", "b": [0.6125, 0.7259, 0.7828, 0.7411]}, {"w": "x_test", "b": [0.1357, 0.7411, 0.2038, 0.7562]}, {"w": "=", "b": [0.2152, 0.7411, 0.2265, 0.7562]}, {"w": "sequence.pad_sequences(x_test,", "b": [0.2379, 0.7411, 0.5784, 0.7562]}, {"w": "maxlen=max_len)", "b": [0.5898, 0.7411, 0.7601, 0.7562]}, {"w": "model", "b": [0.1357, 0.7714, 0.1925, 0.7865]}, {"w": "=", "b": [0.2038, 0.7714, 0.2152, 0.7865]}, {"w": "keras.models.Sequential()", "b": [0.2265, 0.7714, 0.5103, 0.7865]}, {"w": "model.add(layers.Embedding(max_features,", "b": [0.1357, 0.7865, 0.5898, 0.8017]}, {"w": "128,", "b": [0.6011, 0.7865, 0.6465, 0.8017]}, {"w": "input_length=max_len,", "b": [0.4422, 0.8017, 0.6806, 0.8168]}, {"w": "name='embed'))", "b": [0.4422, 0.8169, 0.6011, 0.832]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.832, 0.4422, 0.8472]}, {"w": "7,", "b": [0.4536, 0.832, 0.4763, 0.8472]}, {"w": "activation='relu'))", "b": [0.4876, 0.832, 0.7033, 0.8472]}, {"w": "model.add(layers.MaxPooling1D(5))", "b": [0.1357, 0.8472, 0.5103, 0.8623]}, {"w": "model.add(layers.Conv1D(32,", "b": [0.1357, 0.8623, 0.4422, 0.8775]}, {"w": "7,", "b": [0.4536, 0.8623, 0.4763, 0.8775]}, {"w": "activation='relu'))", "b": [0.4876, 0.8623, 0.7033, 0.8775]}, {"w": "model.add(layers.GlobalMaxPooling1D())", "b": [0.1357, 0.8775, 0.5671, 0.8926]}, {"w": "model.add(layers.Dense(1))", "b": [0.1357, 0.8926, 0.4309, 0.9078]}]}]}, {"page": 333, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.summary() model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc'])", "words": [{"w": "model.summary()", "b": [0.1357, 0.0851, 0.306, 0.1002]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.1002, 0.5217, 0.1154]}, {"w": "loss='binary_crossentropy',", "b": [0.2946, 0.1154, 0.6011, 0.1305]}, {"w": "metrics=['acc'])", "b": [0.2946, 0.1305, 0.4763, 0.1457]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Number of words to consider as features 2 Cuts off texts after this number of words (among max_features most common words)", "words": [{"w": "1", "b": [0.1799, 0.1641, 0.1925, 0.1839]}, {"w": "Number", "b": [0.1988, 0.1641, 0.2885, 0.1839]}, {"w": "of", "b": [0.2948, 0.1641, 0.3158, 0.1839]}, {"w": "words", "b": [0.3221, 0.1641, 0.388, 0.1839]}, {"w": "to", "b": [0.3943, 0.1641, 0.4153, 0.1839]}, {"w": "consider", "b": [0.4216, 0.1641, 0.5127, 0.1839]}, {"w": "as", "b": [0.519, 0.1641, 0.5414, 0.1839]}, {"w": "features", "b": [0.5477, 0.1641, 0.6341, 0.1839]}, {"w": "2", "b": [0.1799, 0.1846, 0.1925, 0.2044]}, {"w": "Cuts", "b": [0.1988, 0.1846, 0.2492, 0.2044]}, {"w": "off", "b": [0.2555, 0.1846, 0.285, 0.2044]}, {"w": "texts", "b": [0.2913, 0.1846, 0.3417, 0.2044]}, {"w": "after", "b": [0.348, 0.1846, 0.3998, 0.2044]}, {"w": "this", "b": [0.4061, 0.1846, 0.4454, 0.2044]}, {"w": "number", "b": [0.4517, 0.1846, 0.5372, 0.2044]}, {"w": "of", "b": [0.5435, 0.1846, 0.5645, 0.2044]}, {"w": "words", "b": [0.5708, 0.1846, 0.6367, 0.2044]}, {"w": "(among", "b": [0.643, 0.1846, 0.7242, 0.2044]}, {"w": "max_features", "b": [0.1799, 0.2051, 0.3251, 0.2249]}, {"w": "most", "b": [0.3314, 0.2051, 0.3833, 0.2249]}, {"w": "common", "b": [0.3896, 0.2051, 0.482, 0.2249]}, {"w": "words)", "b": [0.4883, 0.2051, 0.5626, 0.2249]}]}, {"id": "b_2", "type": "paragraph", "text": "Before you start using TensorBoard, you need to create a directory where you’ll store the log files it generates.", "words": [{"w": "Before", "b": [0.1294, 0.2479, 0.1981, 0.2676]}, {"w": "you", "b": [0.2044, 0.2479, 0.2422, 0.2676]}, {"w": "start", "b": [0.2485, 0.2479, 0.2919, 0.2676]}, {"w": "using", "b": [0.2982, 0.2479, 0.3529, 0.2676]}, {"w": "TensorBoard,", "b": [0.3592, 0.2479, 0.4954, 0.2676]}, {"w": "you", "b": [0.5018, 0.2479, 0.5396, 0.2676]}, {"w": "need", "b": [0.5459, 0.2479, 0.5935, 0.2676]}, {"w": "to", "b": [0.5998, 0.2479, 0.6195, 0.2676]}, {"w": "create", "b": [0.6258, 0.2479, 0.686, 0.2676]}, {"w": "a", "b": [0.6923, 0.2479, 0.7035, 0.2676]}, {"w": "directory", "b": [0.7098, 0.2479, 0.8009, 0.2676]}, {"w": "where", "b": [0.8072, 0.2479, 0.8688, 0.2676]}, {"w": "you’ll", "b": [0.1294, 0.2684, 0.1897, 0.2881]}, {"w": "store", "b": [0.196, 0.2684, 0.245, 0.2881]}, {"w": "the", "b": [0.2513, 0.2684, 0.2822, 0.2881]}, {"w": "log", "b": [0.2885, 0.2684, 0.3207, 0.2881]}, {"w": "files", "b": [0.327, 0.2684, 0.3704, 0.2881]}, {"w": "it", "b": [0.3768, 0.2684, 0.3908, 0.2881]}, {"w": "generates.", "b": [0.3971, 0.2684, 0.4986, 0.2881]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 7.8. Creating a directory for TensorBoard log files", "words": [{"w": "Listing", "b": [0.1294, 0.3062, 0.1862, 0.321]}, {"w": "7.8.", "b": [0.1909, 0.3062, 0.2193, 0.321]}, {"w": "Creating", "b": [0.224, 0.3062, 0.2951, 0.321]}, {"w": "a", "b": [0.2999, 0.3062, 0.3093, 0.321]}, {"w": "directory", "b": [0.314, 0.3062, 0.3883, 0.321]}, {"w": "for", "b": [0.393, 0.3062, 0.4172, 0.321]}, {"w": "TensorBoard", "b": [0.4219, 0.3062, 0.5274, 0.321]}, {"w": "log", "b": [0.5321, 0.3062, 0.5563, 0.321]}, {"w": "files", "b": [0.561, 0.3062, 0.5936, 0.321]}]}, {"id": "b_4", "type": "equation", "text": "$ mkdir my_log_dir", "words": [{"w": "$", "b": [0.1357, 0.3346, 0.1471, 0.3498]}, {"w": "mkdir", "b": [0.1584, 0.3346, 0.2152, 0.3498]}, {"w": "my_log_dir", "b": [0.2265, 0.3346, 0.34, 0.3498]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s launch the training with a TensorBoard callback instance. This callback will write log events to disk at the specified location.", "words": [{"w": "Let’s", "b": [0.1294, 0.3727, 0.1798, 0.3924]}, {"w": "launch", "b": [0.1862, 0.3727, 0.2534, 0.3924]}, {"w": "the", "b": [0.2597, 0.3727, 0.2905, 0.3924]}, {"w": "training", "b": [0.2968, 0.3727, 0.3753, 0.3924]}, {"w": "with", "b": [0.3816, 0.3727, 0.4265, 0.3924]}, {"w": "a", "b": [0.4328, 0.3727, 0.444, 0.3924]}, {"w": "TensorBoard", "b": [0.4503, 0.3737, 0.6167, 0.3939]}, {"w": "callback", "b": [0.6231, 0.3727, 0.7071, 0.3924]}, {"w": "instance.", "b": [0.7134, 0.3727, 0.8024, 0.3924]}, {"w": "This", "b": [0.8087, 0.3727, 0.8536, 0.3924]}, {"w": "callback", "b": [0.1294, 0.3941, 0.2135, 0.4138]}, {"w": "will", "b": [0.2198, 0.3941, 0.259, 0.4138]}, {"w": "write", "b": [0.2653, 0.3941, 0.3172, 0.4138]}, {"w": "log", "b": [0.3235, 0.3941, 0.3557, 0.4138]}, {"w": "events", "b": [0.362, 0.3941, 0.4265, 0.4138]}, {"w": "to", "b": [0.4328, 0.3941, 0.4524, 0.4138]}, {"w": "disk", "b": [0.4587, 0.3941, 0.5008, 0.4138]}, {"w": "at", "b": [0.5071, 0.3941, 0.5253, 0.4138]}, {"w": "the", "b": [0.5316, 0.3941, 0.5624, 0.4138]}, {"w": "specified", "b": [0.5687, 0.3941, 0.6598, 0.4138]}, {"w": "location.", "b": [0.6661, 0.3941, 0.7537, 0.4138]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 7.9. Training the model with a TensorBoard callback", "words": [{"w": "Listing", "b": [0.1294, 0.4319, 0.1862, 0.4467]}, {"w": "7.9.", "b": [0.1909, 0.4319, 0.2193, 0.4467]}, {"w": "Training", "b": [0.224, 0.4319, 0.2941, 0.4467]}, {"w": "the", "b": [0.2988, 0.4319, 0.324, 0.4467]}, {"w": "model", "b": [0.3288, 0.4319, 0.3782, 0.4467]}, {"w": "with", "b": [0.3829, 0.4319, 0.4186, 0.4467]}, {"w": "a", "b": [0.4234, 0.4319, 0.4328, 0.4467]}, {"w": "TensorBoard", "b": [0.4376, 0.4327, 0.5624, 0.4478]}, {"w": "callback", "b": [0.5672, 0.4319, 0.6345, 0.4467]}]}, {"id": "b_7", "type": "paragraph", "text": "callbacks = [ keras.callbacks.TensorBoard( log_dir='my_log_dir', 1 histogram_freq=1, 2 embeddings_freq=1, 3 ) ] history = model.fit(x_train, y_train, epochs=20, batch_size=128, validation_split=0.2, callbacks=callbacks)", "words": [{"w": "callbacks", "b": [0.1357, 0.4612, 0.2379, 0.4764]}, {"w": "=", "b": [0.2492, 0.4612, 0.2606, 0.4764]}, {"w": "[", "b": [0.2719, 0.4612, 0.2833, 0.4764]}, {"w": "keras.callbacks.TensorBoard(", "b": [0.1811, 0.4764, 0.499, 0.4915]}, {"w": "log_dir='my_log_dir',", "b": [0.2265, 0.4915, 0.4649, 0.5067]}, {"w": "1", "b": [0.6693, 0.4915, 0.6807, 0.5067]}, {"w": "histogram_freq=1,", "b": [0.2265, 0.5067, 0.4195, 0.5218]}, {"w": "2", "b": [0.6693, 0.5067, 0.6807, 0.5218]}, {"w": "embeddings_freq=1,", "b": [0.2265, 0.5218, 0.4309, 0.537]}, {"w": "3", "b": [0.6693, 0.5218, 0.6807, 0.537]}, {"w": ")", "b": [0.1811, 0.537, 0.1925, 0.5521]}, {"w": "]", "b": [0.1357, 0.5521, 0.1471, 0.5673]}, {"w": "history", "b": [0.1357, 0.5673, 0.2152, 0.5824]}, {"w": "=", "b": [0.2265, 0.5673, 0.2379, 0.5824]}, {"w": "model.fit(x_train,", "b": [0.2492, 0.5673, 0.4536, 0.5824]}, {"w": "y_train,", "b": [0.4649, 0.5673, 0.5557, 0.5824]}, {"w": "epochs=20,", "b": [0.3628, 0.5824, 0.4763, 0.5976]}, {"w": "batch_size=128,", "b": [0.3628, 0.5976, 0.533, 0.6127]}, {"w": "validation_split=0.2,", "b": [0.3628, 0.6127, 0.6011, 0.6279]}, {"w": "callbacks=callbacks)", "b": [0.3628, 0.6279, 0.5898, 0.643]}]}, {"id": "b_8", "type": "paragraph", "text": "1 Log files will be written at this location. 2 Records activation histograms every 1 epoch 3 Records embedding data every 1 epoch", "words": [{"w": "1", "b": [0.1799, 0.6615, 0.1925, 0.6812]}, {"w": "Log", "b": [0.1988, 0.6615, 0.2408, 0.6812]}, {"w": "files", "b": [0.2471, 0.6615, 0.2906, 0.6812]}, {"w": "will", "b": [0.2969, 0.6615, 0.3361, 0.6812]}, {"w": "be", "b": [0.3424, 0.6615, 0.3677, 0.6812]}, {"w": "written", "b": [0.374, 0.6615, 0.4524, 0.6812]}, {"w": "at", "b": [0.4587, 0.6615, 0.4797, 0.6812]}, {"w": "this", "b": [0.4861, 0.6615, 0.5253, 0.6812]}, {"w": "location.", "b": [0.5316, 0.6615, 0.6234, 0.6812]}, {"w": "2", "b": [0.1799, 0.682, 0.1925, 0.7017]}, {"w": "Records", "b": [0.1988, 0.682, 0.287, 0.7017]}, {"w": "activation", "b": [0.2934, 0.682, 0.3999, 0.7017]}, {"w": "histograms", "b": [0.4062, 0.682, 0.5253, 0.7017]}, {"w": "every", "b": [0.5316, 0.682, 0.5904, 0.7017]}, {"w": "1", "b": [0.5967, 0.682, 0.6093, 0.7017]}, {"w": "epoch", "b": [0.6156, 0.682, 0.6787, 0.7017]}, {"w": "3", "b": [0.1799, 0.7025, 0.1925, 0.7222]}, {"w": "Records", "b": [0.1988, 0.7025, 0.287, 0.7222]}, {"w": "embedding", "b": [0.2934, 0.7025, 0.4125, 0.7222]}, {"w": "data", "b": [0.4188, 0.7025, 0.4665, 0.7222]}, {"w": "every", "b": [0.4728, 0.7025, 0.5316, 0.7222]}, {"w": "1", "b": [0.5379, 0.7025, 0.5505, 0.7222]}, {"w": "epoch", "b": [0.5568, 0.7025, 0.6199, 0.7222]}]}, {"id": "b_9", "type": "paragraph", "text": "At this point, you can launch the TensorBoard server from the command line, instructing it to read the logs the callback is currently writing. The tensorboard utility should have been automatically installed on your machine the moment you installed TensorFlow (for example, via pip):", "words": [{"w": "At", "b": [0.1294, 0.7452, 0.1546, 0.765]}, {"w": "this", "b": [0.1609, 0.7452, 0.1974, 0.765]}, {"w": "point,", "b": [0.2037, 0.7452, 0.2619, 0.765]}, {"w": "you", "b": [0.2682, 0.7452, 0.306, 0.765]}, {"w": "can", "b": [0.3123, 0.7452, 0.3473, 0.765]}, {"w": "launch", "b": [0.3536, 0.7452, 0.4209, 0.765]}, {"w": "the", "b": [0.4272, 0.7452, 0.458, 0.765]}, {"w": "TensorBoard", "b": [0.4643, 0.7452, 0.5942, 0.765]}, {"w": "server", "b": [0.6005, 0.7452, 0.6622, 0.765]}, {"w": "from", "b": [0.6685, 0.7452, 0.7175, 0.765]}, {"w": "the", "b": [0.7238, 0.7452, 0.7546, 0.765]}, {"w": "command", "b": [0.7609, 0.7452, 0.8604, 0.765]}, {"w": "line,", "b": [0.1294, 0.7657, 0.1736, 0.7855]}, {"w": "instructing", "b": [0.1799, 0.7657, 0.2878, 0.7855]}, {"w": "it", "b": [0.2941, 0.7657, 0.3081, 0.7855]}, {"w": "to", "b": [0.3144, 0.7657, 0.334, 0.7855]}, {"w": "read", "b": [0.3403, 0.7657, 0.3838, 0.7855]}, {"w": "the", "b": [0.3901, 0.7657, 0.4209, 0.7855]}, {"w": "logs", "b": [0.4272, 0.7657, 0.4693, 0.7855]}, {"w": "the", "b": [0.4756, 0.7657, 0.5064, 0.7855]}, {"w": "callback", "b": [0.5127, 0.7657, 0.5967, 0.7855]}, {"w": "is", "b": [0.6031, 0.7657, 0.6199, 0.7855]}, {"w": "currently", "b": [0.6261, 0.7657, 0.7171, 0.7855]}, {"w": "writing.", "b": [0.7235, 0.7657, 0.8026, 0.7855]}, {"w": "The", "b": [0.8089, 0.7657, 0.8482, 0.7855]}, {"w": "tensorboard", "b": [0.1294, 0.7873, 0.2959, 0.8075]}, {"w": "utility", "b": [0.3022, 0.7862, 0.3625, 0.806]}, {"w": "should", "b": [0.3688, 0.7862, 0.4361, 0.806]}, {"w": "have", "b": [0.4424, 0.7862, 0.49, 0.806]}, {"w": "been", "b": [0.4963, 0.7862, 0.544, 0.806]}, {"w": "automatically", "b": [0.5503, 0.7862, 0.6876, 0.806]}, {"w": "installed", "b": [0.6939, 0.7862, 0.7794, 0.806]}, {"w": "on", "b": [0.7857, 0.7862, 0.8109, 0.806]}, {"w": "your", "b": [0.8172, 0.7862, 0.8635, 0.806]}, {"w": "machine", "b": [0.1294, 0.8076, 0.2149, 0.8274]}, {"w": "the", "b": [0.2212, 0.8076, 0.252, 0.8274]}, {"w": "moment", "b": [0.2583, 0.8076, 0.341, 0.8274]}, {"w": "you", "b": [0.3473, 0.8076, 0.3852, 0.8274]}, {"w": "installed", "b": [0.3915, 0.8076, 0.4769, 0.8274]}, {"w": "TensorFlow", "b": [0.4833, 0.8076, 0.6033, 0.8274]}, {"w": "(for", "b": [0.6096, 0.8076, 0.6475, 0.8274]}, {"w": "example,", "b": [0.6538, 0.8076, 0.7455, 0.8274]}, {"w": "via", "b": [0.7518, 0.8076, 0.7827, 0.8274]}, {"w": "pip):", "b": [0.7889, 0.8076, 0.8498, 0.8289]}]}, {"id": "b_10", "type": "equation", "text": "$ tensorboard --logdir=my_log_dir", "words": [{"w": "$", "b": [0.1357, 0.8463, 0.1471, 0.8614]}, {"w": "tensorboard", "b": [0.1584, 0.8463, 0.2833, 0.8614]}, {"w": "--logdir=my_log_dir", "b": [0.2946, 0.8463, 0.5103, 0.8614]}]}]}, {"page": 334, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You can then browse to http://localhost:6006 and look at your model training (see figure 7.10). In addition to live graphs of the training and validation metrics, you get access to the Histograms tab, where you can find pretty visualizations of histograms of activation values taken by your layers (see figure 7.11).", "words": [{"w": "You", "b": [0.1294, 0.0857, 0.1703, 0.1054]}, {"w": "can", "b": [0.1766, 0.0857, 0.2116, 0.1054]}, {"w": "then", "b": [0.218, 0.0857, 0.2614, 0.1054]}, {"w": "browse", "b": [0.2677, 0.0857, 0.3406, 0.1054]}, {"w": "to", "b": [0.3469, 0.0857, 0.3665, 0.1054]}, {"w": "http://localhost:6006", "b": [0.3728, 0.0857, 0.5816, 0.1054]}, {"w": "and", "b": [0.5879, 0.0857, 0.6244, 0.1054]}, {"w": "look", "b": [0.6307, 0.0857, 0.6755, 0.1054]}, {"w": "at", "b": [0.6818, 0.0857, 0.7, 0.1054]}, {"w": "your", "b": [0.7064, 0.0857, 0.7526, 0.1054]}, {"w": "model", "b": [0.7589, 0.0857, 0.822, 0.1054]}, {"w": "training", "b": [0.1294, 0.1062, 0.2079, 0.1259]}, {"w": "(see", "b": [0.2142, 0.1062, 0.2548, 0.1259]}, {"w": "figure", "b": [0.2611, 0.1062, 0.3213, 0.1259]}, {"w": "7.10).", "b": [0.3276, 0.1062, 0.3865, 0.1259]}, {"w": "In", "b": [0.3928, 0.1062, 0.4138, 0.1259]}, {"w": "addition", "b": [0.4201, 0.1062, 0.5028, 0.1259]}, {"w": "to", "b": [0.5091, 0.1062, 0.5287, 0.1259]}, {"w": "live", "b": [0.535, 0.1062, 0.5729, 0.1259]}, {"w": "graphs", "b": [0.5792, 0.1062, 0.6464, 0.1259]}, {"w": "of", "b": [0.6527, 0.1062, 0.6737, 0.1259]}, {"w": "the", "b": [0.68, 0.1062, 0.7109, 0.1259]}, {"w": "training", "b": [0.7172, 0.1062, 0.7957, 0.1259]}, {"w": "and", "b": [0.802, 0.1062, 0.8384, 0.1259]}, {"w": "validation", "b": [0.1294, 0.1267, 0.2303, 0.1464]}, {"w": "metrics,", "b": [0.2366, 0.1267, 0.3172, 0.1464]}, {"w": "you", "b": [0.3235, 0.1267, 0.3613, 0.1464]}, {"w": "get", "b": [0.3676, 0.1267, 0.3985, 0.1464]}, {"w": "access", "b": [0.4048, 0.1267, 0.4692, 0.1464]}, {"w": "to", "b": [0.4755, 0.1267, 0.4951, 0.1464]}, {"w": "the", "b": [0.5014, 0.1267, 0.5323, 0.1464]}, {"w": "Histograms", "b": [0.5386, 0.1267, 0.6549, 0.1464]}, {"w": "tab,", "b": [0.6612, 0.1267, 0.6983, 0.1464]}, {"w": "where", "b": [0.7046, 0.1267, 0.7663, 0.1464]}, {"w": "you", "b": [0.7726, 0.1267, 0.8104, 0.1464]}, {"w": "can", "b": [0.8167, 0.1267, 0.8517, 0.1464]}, {"w": "find", "b": [0.1294, 0.1472, 0.1701, 0.1669]}, {"w": "pretty", "b": [0.1764, 0.1472, 0.2352, 0.1669]}, {"w": "visualizations", "b": [0.2415, 0.1472, 0.3803, 0.1669]}, {"w": "of", "b": [0.3866, 0.1472, 0.4076, 0.1669]}, {"w": "histograms", "b": [0.4139, 0.1472, 0.5246, 0.1669]}, {"w": "of", "b": [0.5309, 0.1472, 0.5519, 0.1669]}, {"w": "activation", "b": [0.5582, 0.1472, 0.6577, 0.1669]}, {"w": "values", "b": [0.664, 0.1472, 0.7285, 0.1669]}, {"w": "taken", "b": [0.7348, 0.1472, 0.7894, 0.1669]}, {"w": "by", "b": [0.7957, 0.1472, 0.821, 0.1669]}, {"w": "your", "b": [0.1294, 0.1677, 0.1757, 0.1874]}, {"w": "layers", "b": [0.182, 0.1677, 0.2422, 0.1874]}, {"w": "(see", "b": [0.2485, 0.1677, 0.2891, 0.1874]}, {"w": "figure", "b": [0.2954, 0.1677, 0.3556, 0.1874]}, {"w": "7.11).", "b": [0.362, 0.1677, 0.4198, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 7.10. TensorBoard: metrics monitoring", "words": [{"w": "Figure", "b": [0.1294, 0.2055, 0.1827, 0.2203]}, {"w": "7.10.", "b": [0.1874, 0.2055, 0.2252, 0.2203]}, {"w": "TensorBoard:", "b": [0.2299, 0.2055, 0.3417, 0.2203]}, {"w": "metrics", "b": [0.3464, 0.2055, 0.4063, 0.2203]}, {"w": "monitoring", "b": [0.4111, 0.2055, 0.5015, 0.2203]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 7.11. TensorBoard: activation histograms", "words": [{"w": "Figure", "b": [0.1294, 0.579, 0.1827, 0.5938]}, {"w": "7.11.", "b": [0.1874, 0.579, 0.2242, 0.5938]}, {"w": "TensorBoard:", "b": [0.2289, 0.579, 0.3407, 0.5938]}, {"w": "activation", "b": [0.3454, 0.579, 0.4253, 0.5938]}, {"w": "histograms", "b": [0.43, 0.579, 0.5193, 0.5938]}]}]}, {"page": 335, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The Embeddings tab gives you a way to inspect the embedding locations and spatial relationships of the 10,000 words in the input vocabulary, as learned by the initial Embedding layer. Because the embedding space is 128-dimensional, TensorBoard automatically reduces it to 2D or 3D using a dimensionality-reduction algorithm of your choice: either principal component analysis (PCA) or t-distributed stochastic neighbor embedding (t-SNE). In figure 7.12, in the point cloud, you can clearly see two clusters: words with a positive connotation and words with a negative connotation. The visualization makes it immediately obvious that embeddings trained jointly with a specific objective result in models that are completely specific to the underlying task—that’s the reason using pretrained generic word embeddings is rarely a good idea.", "words": [{"w": "The", "b": [0.1294, 0.4226, 0.1686, 0.4423]}, {"w": "Embeddings", "b": [0.1749, 0.4226, 0.3011, 0.4423]}, {"w": "tab", "b": [0.3074, 0.4226, 0.3382, 0.4423]}, {"w": "gives", "b": [0.3445, 0.4226, 0.3978, 0.4423]}, {"w": "you", "b": [0.4041, 0.4226, 0.4419, 0.4423]}, {"w": "a", "b": [0.4482, 0.4226, 0.4594, 0.4423]}, {"w": "way", "b": [0.4657, 0.4226, 0.5077, 0.4423]}, {"w": "to", "b": [0.5141, 0.4226, 0.5337, 0.4423]}, {"w": "inspect", "b": [0.54, 0.4226, 0.6115, 0.4423]}, {"w": "the", "b": [0.6178, 0.4226, 0.6486, 0.4423]}, {"w": "embedding", "b": [0.6549, 0.4226, 0.767, 0.4423]}, {"w": "locations", "b": [0.7733, 0.4226, 0.8644, 0.4423]}, {"w": "and", "b": [0.1294, 0.4431, 0.1658, 0.4628]}, {"w": "spatial", "b": [0.1721, 0.4431, 0.238, 0.4628]}, {"w": "relationships", "b": [0.2443, 0.4431, 0.3732, 0.4628]}, {"w": "of", "b": [0.3796, 0.4431, 0.4006, 0.4628]}, {"w": "the", "b": [0.4069, 0.4431, 0.4377, 0.4628]}, {"w": "10,000", "b": [0.444, 0.4431, 0.5134, 0.4628]}, {"w": "words", "b": [0.5197, 0.4431, 0.5813, 0.4628]}, {"w": "in", "b": [0.5876, 0.4431, 0.6073, 0.4628]}, {"w": "the", "b": [0.6136, 0.4431, 0.6444, 0.4628]}, {"w": "input", "b": [0.6506, 0.4431, 0.7025, 0.4628]}, {"w": "vocabulary,", "b": [0.7088, 0.4431, 0.8255, 0.4628]}, {"w": "as", "b": [0.8318, 0.4431, 0.8529, 0.4628]}, {"w": "learned", "b": [0.1294, 0.4636, 0.2037, 0.4833]}, {"w": "by", "b": [0.21, 0.4636, 0.2352, 0.4833]}, {"w": "the", "b": [0.2415, 0.4636, 0.2723, 0.4833]}, {"w": "initial", "b": [0.2786, 0.4636, 0.3375, 0.4833]}, {"w": "Embedding", "b": [0.3438, 0.4646, 0.48, 0.4848]}, {"w": "layer.", "b": [0.4863, 0.4636, 0.5416, 0.4833]}, {"w": "Because", "b": [0.5479, 0.4636, 0.632, 0.4833]}, {"w": "the", "b": [0.6383, 0.4636, 0.6691, 0.4833]}, {"w": "embedding", "b": [0.6754, 0.4636, 0.7875, 0.4833]}, {"w": "space", "b": [0.7938, 0.4636, 0.8499, 0.4833]}, {"w": "is", "b": [0.1294, 0.485, 0.1462, 0.5047]}, {"w": "128-dimensional,", "b": [0.1525, 0.485, 0.3284, 0.5047]}, {"w": "TensorBoard", "b": [0.3347, 0.485, 0.4646, 0.5047]}, {"w": "automatically", "b": [0.4709, 0.485, 0.6083, 0.5047]}, {"w": "reduces", "b": [0.6146, 0.485, 0.6916, 0.5047]}, {"w": "it", "b": [0.6979, 0.485, 0.712, 0.5047]}, {"w": "to", "b": [0.7183, 0.485, 0.7379, 0.5047]}, {"w": "2D", "b": [0.7442, 0.485, 0.775, 0.5047]}, {"w": "or", "b": [0.7813, 0.485, 0.8023, 0.5047]}, {"w": "3D", "b": [0.8086, 0.485, 0.8395, 0.5047]}, {"w": "using", "b": [0.1294, 0.5055, 0.1841, 0.5252]}, {"w": "a", "b": [0.1904, 0.5055, 0.2016, 0.5252]}, {"w": "dimensionality-reduction", "b": [0.2079, 0.5055, 0.4615, 0.5252]}, {"w": "algorithm", "b": [0.4678, 0.5055, 0.5659, 0.5252]}, {"w": "of", "b": [0.5722, 0.5055, 0.5932, 0.5252]}, {"w": "your", "b": [0.5995, 0.5055, 0.6458, 0.5252]}, {"w": "choice:", "b": [0.6521, 0.5055, 0.7249, 0.5252]}, {"w": "either", "b": [0.7312, 0.5055, 0.7887, 0.5252]}, {"w": "principal", "b": [0.1294, 0.526, 0.2191, 0.5457]}, {"w": "component", "b": [0.2254, 0.526, 0.3375, 0.5457]}, {"w": "analysis", "b": [0.3438, 0.526, 0.4251, 0.5457]}, {"w": "(PCA)", "b": [0.4314, 0.526, 0.4973, 0.5457]}, {"w": "or", "b": [0.5036, 0.526, 0.5246, 0.5457]}, {"w": "t-distributed", "b": [0.5309, 0.526, 0.6542, 0.5457]}, {"w": "stochastic", "b": [0.6605, 0.526, 0.76, 0.5457]}, {"w": "neighbor", "b": [0.7663, 0.526, 0.856, 0.5457]}, {"w": "embedding", "b": [0.1294, 0.5465, 0.2415, 0.5662]}, {"w": "(t-SNE).", "b": [0.2478, 0.5465, 0.334, 0.5662]}, {"w": "In", "b": [0.3403, 0.5465, 0.3613, 0.5662]}, {"w": "figure", "b": [0.3676, 0.5465, 0.4278, 0.5662]}, {"w": "7.12,", "b": [0.4341, 0.5465, 0.4846, 0.5662]}, {"w": "in", "b": [0.4909, 0.5465, 0.5105, 0.5662]}, {"w": "the", "b": [0.5168, 0.5465, 0.5476, 0.5662]}, {"w": "point", "b": [0.554, 0.5465, 0.6058, 0.5662]}, {"w": "cloud,", "b": [0.6121, 0.5465, 0.6745, 0.5662]}, {"w": "you", "b": [0.6808, 0.5465, 0.7186, 0.5662]}, {"w": "can", "b": [0.7249, 0.5465, 0.7599, 0.5662]}, {"w": "clearly", "b": [0.7663, 0.5465, 0.8349, 0.5662]}, {"w": "see", "b": [0.1294, 0.567, 0.1616, 0.5867]}, {"w": "two", "b": [0.1679, 0.567, 0.2058, 0.5867]}, {"w": "clusters:", "b": [0.2121, 0.567, 0.2962, 0.5867]}, {"w": "words", "b": [0.3025, 0.567, 0.3641, 0.5867]}, {"w": "with", "b": [0.3704, 0.567, 0.4153, 0.5867]}, {"w": "a", "b": [0.4216, 0.567, 0.4328, 0.5867]}, {"w": "positive", "b": [0.4391, 0.567, 0.519, 0.5867]}, {"w": "connotation", "b": [0.5253, 0.567, 0.6444, 0.5867]}, {"w": "and", "b": [0.6507, 0.567, 0.6871, 0.5867]}, {"w": "words", "b": [0.6934, 0.567, 0.7551, 0.5867]}, {"w": "with", "b": [0.7614, 0.567, 0.8062, 0.5867]}, {"w": "a", "b": [0.8126, 0.567, 0.8238, 0.5867]}, {"w": "negative", "b": [0.1294, 0.5875, 0.2149, 0.6072]}, {"w": "connotation.", "b": [0.2212, 0.5875, 0.3466, 0.6072]}, {"w": "The", "b": [0.3529, 0.5875, 0.3921, 0.6072]}, {"w": "visualization", "b": [0.3984, 0.5875, 0.5273, 0.6072]}, {"w": "makes", "b": [0.5336, 0.5875, 0.5981, 0.6072]}, {"w": "it", "b": [0.6044, 0.5875, 0.6184, 0.6072]}, {"w": "immediately", "b": [0.6247, 0.5875, 0.7508, 0.6072]}, {"w": "obvious", "b": [0.7572, 0.5875, 0.837, 0.6072]}, {"w": "that", "b": [0.1294, 0.608, 0.1673, 0.6277]}, {"w": "embeddings", "b": [0.1736, 0.608, 0.2955, 0.6277]}, {"w": "trained", "b": [0.3018, 0.608, 0.3718, 0.6277]}, {"w": "jointly", "b": [0.3781, 0.608, 0.444, 0.6277]}, {"w": "with", "b": [0.4503, 0.608, 0.4952, 0.6277]}, {"w": "a", "b": [0.5015, 0.608, 0.5127, 0.6277]}, {"w": "specific", "b": [0.519, 0.608, 0.5975, 0.6277]}, {"w": "objective", "b": [0.6038, 0.608, 0.6962, 0.6277]}, {"w": "result", "b": [0.7025, 0.608, 0.7586, 0.6277]}, {"w": "in", "b": [0.7649, 0.608, 0.7845, 0.6277]}, {"w": "models", "b": [0.7908, 0.608, 0.8637, 0.6277]}, {"w": "that", "b": [0.1294, 0.6285, 0.1673, 0.6482]}, {"w": "are", "b": [0.1736, 0.6285, 0.2044, 0.6482]}, {"w": "completely", "b": [0.2107, 0.6285, 0.3228, 0.6482]}, {"w": "specific", "b": [0.3291, 0.6285, 0.4075, 0.6482]}, {"w": "to", "b": [0.4138, 0.6285, 0.4335, 0.6482]}, {"w": "the", "b": [0.4398, 0.6285, 0.4706, 0.6482]}, {"w": "underlying", "b": [0.4769, 0.6285, 0.5862, 0.6482]}, {"w": "task—that’s", "b": [0.5925, 0.6285, 0.7129, 0.6482]}, {"w": "the", "b": [0.7192, 0.6285, 0.7501, 0.6482]}, {"w": "reason", "b": [0.7564, 0.6285, 0.8222, 0.6482]}, {"w": "using", "b": [0.1294, 0.649, 0.1841, 0.6687]}, {"w": "pretrained", "b": [0.1904, 0.649, 0.2926, 0.6687]}, {"w": "generic", "b": [0.299, 0.649, 0.3732, 0.6687]}, {"w": "word", "b": [0.3795, 0.649, 0.4313, 0.6687]}, {"w": "embeddings", "b": [0.4376, 0.649, 0.5596, 0.6687]}, {"w": "is", "b": [0.5659, 0.649, 0.5827, 0.6687]}, {"w": "rarely", "b": [0.589, 0.649, 0.6478, 0.6687]}, {"w": "a", "b": [0.6541, 0.649, 0.6653, 0.6687]}, {"w": "good", "b": [0.6716, 0.649, 0.722, 0.6687]}, {"w": "idea.", "b": [0.7283, 0.649, 0.7767, 0.6687]}]}, {"id": "b_1", "type": "equation", "text": "Figure 7.12. TensorBoard: interactive 3D word-embedding visualization", "words": [{"w": "Figure", "b": [0.1294, 0.6868, 0.1827, 0.7016]}, {"w": "7.12.", "b": [0.1874, 0.6868, 0.2252, 0.7016]}, {"w": "TensorBoard:", "b": [0.2299, 0.6868, 0.3417, 0.7016]}, {"w": "interactive", "b": [0.3464, 0.6868, 0.4326, 0.7016]}, {"w": "3D", "b": [0.4373, 0.6868, 0.4605, 0.7016]}, {"w": "word-embedding", "b": [0.4652, 0.6868, 0.6029, 0.7016]}, {"w": "visualization", "b": [0.6076, 0.6868, 0.7096, 0.7016]}]}]}, {"page": 336, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The Graphs tab shows an interactive visualization of the graph of low- level TensorFlow operations underlying your Keras model (see figure 7.13). As you can see, there’s a lot more going on than you would expect. The model you just built may look simple when defined in Keras —a small stack of basic layers—but under the hood, you need to construct a fairly complex graph structure to make it work. A lot of it is related to the gradient-descent process. This complexity differential between what you see and what you’re manipulating is the key motivation for using Keras as your way of building models, instead of working with raw TensorFlow to define everything from scratch. Keras makes your workflow dramatically simpler.", "words": [{"w": "The", "b": [0.1294, 0.4574, 0.1686, 0.4771]}, {"w": "Graphs", "b": [0.1749, 0.4574, 0.2478, 0.4771]}, {"w": "tab", "b": [0.2541, 0.4574, 0.2849, 0.4771]}, {"w": "shows", "b": [0.2912, 0.4574, 0.3543, 0.4771]}, {"w": "an", "b": [0.3606, 0.4574, 0.3844, 0.4771]}, {"w": "interactive", "b": [0.3907, 0.4574, 0.4972, 0.4771]}, {"w": "visualization", "b": [0.5035, 0.4574, 0.6324, 0.4771]}, {"w": "of", "b": [0.6387, 0.4574, 0.6598, 0.4771]}, {"w": "the", "b": [0.6661, 0.4574, 0.6969, 0.4771]}, {"w": "graph", "b": [0.7032, 0.4574, 0.7606, 0.4771]}, {"w": "of", "b": [0.7669, 0.4574, 0.788, 0.4771]}, {"w": "low-", "b": [0.7943, 0.4574, 0.8405, 0.4771]}, {"w": "level", "b": [0.1294, 0.4779, 0.1785, 0.4976]}, {"w": "TensorFlow", "b": [0.1848, 0.4779, 0.3049, 0.4976]}, {"w": "operations", "b": [0.3112, 0.4779, 0.4163, 0.4976]}, {"w": "underlying", "b": [0.4226, 0.4779, 0.5319, 0.4976]}, {"w": "your", "b": [0.5382, 0.4779, 0.5844, 0.4976]}, {"w": "Keras", "b": [0.5908, 0.4779, 0.6496, 0.4976]}, {"w": "model", "b": [0.6559, 0.4779, 0.7189, 0.4976]}, {"w": "(see", "b": [0.7252, 0.4779, 0.7658, 0.4976]}, {"w": "figure", "b": [0.7721, 0.4779, 0.8324, 0.4976]}, {"w": "7.13).", "b": [0.1294, 0.4984, 0.1883, 0.5181]}, {"w": "As", "b": [0.1946, 0.4984, 0.2226, 0.5181]}, {"w": "you", "b": [0.2289, 0.4984, 0.2667, 0.5181]}, {"w": "can", "b": [0.273, 0.4984, 0.3081, 0.5181]}, {"w": "see,", "b": [0.3144, 0.4984, 0.3529, 0.5181]}, {"w": "there’s", "b": [0.3592, 0.4984, 0.4264, 0.5181]}, {"w": "a", "b": [0.4327, 0.4984, 0.4439, 0.5181]}, {"w": "lot", "b": [0.4502, 0.4984, 0.4769, 0.5181]}, {"w": "more", "b": [0.4832, 0.4984, 0.535, 0.5181]}, {"w": "going", "b": [0.5413, 0.4984, 0.5988, 0.5181]}, {"w": "on", "b": [0.6051, 0.4984, 0.6303, 0.5181]}, {"w": "than", "b": [0.6366, 0.4984, 0.6801, 0.5181]}, {"w": "you", "b": [0.6864, 0.4984, 0.7242, 0.5181]}, {"w": "would", "b": [0.7305, 0.4984, 0.7936, 0.5181]}, {"w": "expect.", "b": [0.1294, 0.5189, 0.2016, 0.5386]}, {"w": "The", "b": [0.2079, 0.5189, 0.2471, 0.5386]}, {"w": "model", "b": [0.2534, 0.5189, 0.3165, 0.5386]}, {"w": "you", "b": [0.3228, 0.5189, 0.3606, 0.5386]}, {"w": "just", "b": [0.3669, 0.5189, 0.4034, 0.5386]}, {"w": "built", "b": [0.4097, 0.5189, 0.4559, 0.5386]}, {"w": "may", "b": [0.4622, 0.5189, 0.5057, 0.5386]}, {"w": "look", "b": [0.512, 0.5189, 0.5568, 0.5386]}, {"w": "simple", "b": [0.5631, 0.5189, 0.6304, 0.5386]}, {"w": "when", "b": [0.6367, 0.5189, 0.6914, 0.5386]}, {"w": "defined", "b": [0.6977, 0.5189, 0.7733, 0.5386]}, {"w": "in", "b": [0.7795, 0.5189, 0.7992, 0.5386]}, {"w": "Keras", "b": [0.8055, 0.5189, 0.8643, 0.5386]}, {"w": "—a", "b": [0.1294, 0.5394, 0.1658, 0.5591]}, {"w": "small", "b": [0.1721, 0.5394, 0.2268, 0.5591]}, {"w": "stack", "b": [0.2331, 0.5394, 0.285, 0.5591]}, {"w": "of", "b": [0.2913, 0.5394, 0.3123, 0.5591]}, {"w": "basic", "b": [0.3186, 0.5394, 0.3704, 0.5591]}, {"w": "layers—but", "b": [0.3767, 0.5394, 0.4944, 0.5591]}, {"w": "under", "b": [0.5007, 0.5394, 0.5582, 0.5591]}, {"w": "the", "b": [0.5645, 0.5394, 0.5953, 0.5591]}, {"w": "hood,", "b": [0.6016, 0.5394, 0.6584, 0.5591]}, {"w": "you", "b": [0.6647, 0.5394, 0.7025, 0.5591]}, {"w": "need", "b": [0.7088, 0.5394, 0.7564, 0.5591]}, {"w": "to", "b": [0.7628, 0.5394, 0.7824, 0.5591]}, {"w": "construct", "b": [0.1294, 0.5599, 0.2219, 0.5796]}, {"w": "a", "b": [0.2282, 0.5599, 0.2394, 0.5796]}, {"w": "fairly", "b": [0.2457, 0.5599, 0.3003, 0.5796]}, {"w": "complex", "b": [0.3066, 0.5599, 0.3935, 0.5796]}, {"w": "graph", "b": [0.3998, 0.5599, 0.4573, 0.5796]}, {"w": "structure", "b": [0.4636, 0.5599, 0.5518, 0.5796]}, {"w": "to", "b": [0.5581, 0.5599, 0.5778, 0.5796]}, {"w": "make", "b": [0.5841, 0.5599, 0.6387, 0.5796]}, {"w": "it", "b": [0.6449, 0.5599, 0.659, 0.5796]}, {"w": "work.", "b": [0.6653, 0.5599, 0.7234, 0.5796]}, {"w": "A", "b": [0.7297, 0.5599, 0.7479, 0.5796]}, {"w": "lot", "b": [0.7542, 0.5599, 0.7809, 0.5796]}, {"w": "of", "b": [0.7872, 0.5599, 0.8082, 0.5796]}, {"w": "it", "b": [0.8145, 0.5599, 0.8285, 0.5796]}, {"w": "is", "b": [0.8348, 0.5599, 0.8517, 0.5796]}, {"w": "related", "b": [0.1294, 0.5804, 0.1981, 0.6001]}, {"w": "to", "b": [0.2044, 0.5804, 0.224, 0.6001]}, {"w": "the", "b": [0.2303, 0.5804, 0.2611, 0.6001]}, {"w": "gradient-descent", "b": [0.2674, 0.5804, 0.4341, 0.6001]}, {"w": "process.", "b": [0.4404, 0.5804, 0.5224, 0.6001]}, {"w": "This", "b": [0.5287, 0.5804, 0.5736, 0.6001]}, {"w": "complexity", "b": [0.5799, 0.5804, 0.6934, 0.6001]}, {"w": "differential", "b": [0.6997, 0.5804, 0.8112, 0.6001]}, {"w": "between", "b": [0.1294, 0.6009, 0.2135, 0.6206]}, {"w": "what", "b": [0.2198, 0.6009, 0.2688, 0.6206]}, {"w": "you", "b": [0.2751, 0.6009, 0.313, 0.6206]}, {"w": "see", "b": [0.3193, 0.6009, 0.3515, 0.6206]}, {"w": "and", "b": [0.3578, 0.6009, 0.3942, 0.6206]}, {"w": "what", "b": [0.4005, 0.6009, 0.4496, 0.6206]}, {"w": "you’re", "b": [0.4558, 0.6009, 0.5217, 0.6206]}, {"w": "manipulating", "b": [0.528, 0.6009, 0.6611, 0.6206]}, {"w": "is", "b": [0.6674, 0.6009, 0.6842, 0.6206]}, {"w": "the", "b": [0.6906, 0.6009, 0.7214, 0.6206]}, {"w": "key", "b": [0.7277, 0.6009, 0.7641, 0.6206]}, {"w": "motivation", "b": [0.1294, 0.6214, 0.2387, 0.6411]}, {"w": "for", "b": [0.245, 0.6214, 0.2745, 0.6411]}, {"w": "using", "b": [0.2808, 0.6214, 0.3354, 0.6411]}, {"w": "Keras", "b": [0.3417, 0.6214, 0.4006, 0.6411]}, {"w": "as", "b": [0.4069, 0.6214, 0.4279, 0.6411]}, {"w": "your", "b": [0.4342, 0.6214, 0.4804, 0.6411]}, {"w": "way", "b": [0.4867, 0.6214, 0.5288, 0.6411]}, {"w": "of", "b": [0.5351, 0.6214, 0.5561, 0.6411]}, {"w": "building", "b": [0.5624, 0.6214, 0.6465, 0.6411]}, {"w": "models,", "b": [0.6528, 0.6214, 0.732, 0.6411]}, {"w": "instead", "b": [0.7383, 0.6214, 0.8098, 0.6411]}, {"w": "of", "b": [0.8161, 0.6214, 0.8371, 0.6411]}, {"w": "working", "b": [0.1294, 0.6419, 0.2135, 0.6616]}, {"w": "with", "b": [0.2198, 0.6419, 0.2646, 0.6616]}, {"w": "raw", "b": [0.271, 0.6419, 0.3088, 0.6616]}, {"w": "TensorFlow", "b": [0.3151, 0.6419, 0.4352, 0.6616]}, {"w": "to", "b": [0.4415, 0.6419, 0.4611, 0.6616]}, {"w": "define", "b": [0.4675, 0.6419, 0.5305, 0.6616]}, {"w": "everything", "b": [0.5368, 0.6419, 0.6447, 0.6616]}, {"w": "from", "b": [0.651, 0.6419, 0.7, 0.6616]}, {"w": "scratch.", "b": [0.7063, 0.6419, 0.7841, 0.6616]}, {"w": "Keras", "b": [0.7904, 0.6419, 0.8492, 0.6616]}, {"w": "makes", "b": [0.1294, 0.6624, 0.1939, 0.6821]}, {"w": "your", "b": [0.2002, 0.6624, 0.2464, 0.6821]}, {"w": "workflow", "b": [0.2527, 0.6624, 0.3508, 0.6821]}, {"w": "dramatically", "b": [0.3571, 0.6624, 0.4832, 0.6821]}, {"w": "simpler.", "b": [0.4895, 0.6624, 0.57, 0.6821]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 7.13. TensorBoard: TensorFlow graph visualization", "words": [{"w": "Figure", "b": [0.1294, 0.7047, 0.1827, 0.7195]}, {"w": "7.13.", "b": [0.1874, 0.7047, 0.2252, 0.7195]}, {"w": "TensorBoard:", "b": [0.2299, 0.7047, 0.3417, 0.7195]}, {"w": "TensorFlow", "b": [0.3464, 0.7047, 0.4414, 0.7195]}, {"w": "graph", "b": [0.4461, 0.7047, 0.4945, 0.7195]}, {"w": "visualization", "b": [0.4992, 0.7047, 0.6012, 0.7195]}]}]}, {"page": 337, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Note that Keras also provides another, cleaner way to plot models as graphs of layers rather than graphs of TensorFlow operations: the utility keras.utils.plot_model. Using it requires that you’ve installed the Python pydot and pydot-ng libraries as well as the graphviz library. Let’s take a quick look:", "words": [{"w": "Note", "b": [0.1294, 0.518, 0.1785, 0.5377]}, {"w": "that", "b": [0.1848, 0.518, 0.2226, 0.5377]}, {"w": "Keras", "b": [0.2289, 0.518, 0.2877, 0.5377]}, {"w": "also", "b": [0.294, 0.518, 0.3347, 0.5377]}, {"w": "provides", "b": [0.341, 0.518, 0.4279, 0.5377]}, {"w": "another,", "b": [0.4342, 0.518, 0.5151, 0.5377]}, {"w": "cleaner", "b": [0.5214, 0.518, 0.5942, 0.5377]}, {"w": "way", "b": [0.6005, 0.518, 0.6425, 0.5377]}, {"w": "to", "b": [0.6489, 0.518, 0.6685, 0.5377]}, {"w": "plot", "b": [0.6748, 0.518, 0.714, 0.5377]}, {"w": "models", "b": [0.7203, 0.518, 0.7932, 0.5377]}, {"w": "as", "b": [0.7995, 0.518, 0.8205, 0.5377]}, {"w": "graphs", "b": [0.1294, 0.5385, 0.1967, 0.5582]}, {"w": "of", "b": [0.203, 0.5385, 0.224, 0.5582]}, {"w": "layers", "b": [0.2303, 0.5385, 0.2905, 0.5582]}, {"w": "rather", "b": [0.2968, 0.5385, 0.3557, 0.5582]}, {"w": "than", "b": [0.362, 0.5385, 0.4054, 0.5582]}, {"w": "graphs", "b": [0.4117, 0.5385, 0.479, 0.5582]}, {"w": "of", "b": [0.4853, 0.5385, 0.5063, 0.5582]}, {"w": "TensorFlow", "b": [0.5126, 0.5385, 0.6327, 0.5582]}, {"w": "operations:", "b": [0.639, 0.5385, 0.7511, 0.5582]}, {"w": "the", "b": [0.7574, 0.5385, 0.7882, 0.5582]}, {"w": "utility", "b": [0.7945, 0.5385, 0.8548, 0.5582]}, {"w": "keras.utils.plot_model.", "b": [0.1294, 0.559, 0.4687, 0.5802]}, {"w": "Using", "b": [0.475, 0.559, 0.5353, 0.5787]}, {"w": "it", "b": [0.5416, 0.559, 0.5556, 0.5787]}, {"w": "requires", "b": [0.5619, 0.559, 0.6432, 0.5787]}, {"w": "that", "b": [0.6495, 0.559, 0.6873, 0.5787]}, {"w": "you’ve", "b": [0.6937, 0.559, 0.7637, 0.5787]}, {"w": "installed", "b": [0.77, 0.559, 0.8555, 0.5787]}, {"w": "the", "b": [0.1294, 0.5804, 0.1602, 0.6001]}, {"w": "Python", "b": [0.1665, 0.5804, 0.238, 0.6001]}, {"w": "pydot", "b": [0.2443, 0.5814, 0.32, 0.6016]}, {"w": "and", "b": [0.3263, 0.5804, 0.3627, 0.6001]}, {"w": "pydot-ng", "b": [0.369, 0.5814, 0.4901, 0.6016]}, {"w": "libraries", "b": [0.4964, 0.5804, 0.5791, 0.6001]}, {"w": "as", "b": [0.5854, 0.5804, 0.6064, 0.6001]}, {"w": "well", "b": [0.6127, 0.5804, 0.6562, 0.6001]}, {"w": "as", "b": [0.6625, 0.5804, 0.6835, 0.6001]}, {"w": "the", "b": [0.6898, 0.5804, 0.7206, 0.6001]}, {"w": "graphviz", "b": [0.7269, 0.5814, 0.848, 0.6016]}, {"w": "library.", "b": [0.1294, 0.6017, 0.2013, 0.6215]}, {"w": "Let’s", "b": [0.2076, 0.6017, 0.2581, 0.6215]}, {"w": "take", "b": [0.2644, 0.6017, 0.3064, 0.6215]}, {"w": "a", "b": [0.3127, 0.6017, 0.3239, 0.6215]}, {"w": "quick", "b": [0.3302, 0.6017, 0.3863, 0.6215]}, {"w": "look:", "b": [0.3926, 0.6017, 0.4444, 0.6215]}]}, {"id": "b_1", "type": "equation", "text": "from keras.utils import plot_model plot_model(model, to_file='model.png')", "words": [{"w": "from", "b": [0.1357, 0.6395, 0.1811, 0.6546]}, {"w": "keras.utils", "b": [0.1925, 0.6395, 0.3173, 0.6546]}, {"w": "import", "b": [0.3287, 0.6395, 0.3968, 0.6546]}, {"w": "plot_model", "b": [0.4082, 0.6395, 0.5217, 0.6546]}, {"w": "plot_model(model,", "b": [0.1357, 0.6698, 0.3287, 0.6849]}, {"w": "to_file='model.png')", "b": [0.34, 0.6698, 0.5671, 0.6849]}]}, {"id": "b_2", "type": "paragraph", "text": "This creates the PNG image shown in figure 7.14.", "words": [{"w": "This", "b": [0.1294, 0.7078, 0.1743, 0.7276]}, {"w": "creates", "b": [0.1806, 0.7078, 0.2506, 0.7276]}, {"w": "the", "b": [0.2569, 0.7078, 0.2877, 0.7276]}, {"w": "PNG", "b": [0.294, 0.7078, 0.3445, 0.7276]}, {"w": "image", "b": [0.3508, 0.7078, 0.4124, 0.7276]}, {"w": "shown", "b": [0.4188, 0.7078, 0.4846, 0.7276]}, {"w": "in", "b": [0.4909, 0.7078, 0.5105, 0.7276]}, {"w": "figure", "b": [0.5168, 0.7078, 0.5771, 0.7276]}, {"w": "7.14.", "b": [0.5834, 0.7078, 0.6338, 0.7276]}]}, {"id": "b_3", "type": "equation", "text": "Figure 7.14. A model plot as a graph of layers, generated with plot_model", "words": [{"w": "Figure", "b": [0.1294, 0.7501, 0.1827, 0.7649]}, {"w": "7.14.", "b": [0.1874, 0.7501, 0.2252, 0.7649]}, {"w": "A", "b": [0.2299, 0.7501, 0.2436, 0.7649]}, {"w": "model", "b": [0.2483, 0.7501, 0.2977, 0.7649]}, {"w": "plot", "b": [0.3025, 0.7501, 0.334, 0.7649]}, {"w": "as", "b": [0.3387, 0.7501, 0.3555, 0.7649]}, {"w": "a", "b": [0.3603, 0.7501, 0.3697, 0.7649]}, {"w": "graph", "b": [0.3745, 0.7501, 0.4228, 0.7649]}, {"w": "of", "b": [0.4276, 0.7501, 0.4433, 0.7649]}, {"w": "layers,", "b": [0.448, 0.7501, 0.5011, 0.7649]}, {"w": "generated", "b": [0.5058, 0.7501, 0.5857, 0.7649]}, {"w": "with", "b": [0.5904, 0.7501, 0.6262, 0.7649]}, {"w": "plot_model", "b": [0.6309, 0.7509, 0.7444, 0.766]}]}]}, {"page": 338, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You also have the option of displaying shape information in the graph of layers. This example visualizes model topology using plot_model and the show_shapes option (see figure 7.15):", "words": [{"w": "You", "b": [0.1294, 0.5153, 0.1703, 0.535]}, {"w": "also", "b": [0.1766, 0.5153, 0.2173, 0.535]}, {"w": "have", "b": [0.2236, 0.5153, 0.2712, 0.535]}, {"w": "the", "b": [0.2775, 0.5153, 0.3083, 0.535]}, {"w": "option", "b": [0.3146, 0.5153, 0.3791, 0.535]}, {"w": "of", "b": [0.3854, 0.5153, 0.4064, 0.535]}, {"w": "displaying", "b": [0.4127, 0.5153, 0.5179, 0.535]}, {"w": "shape", "b": [0.5242, 0.5153, 0.5816, 0.535]}, {"w": "information", "b": [0.5879, 0.5153, 0.707, 0.535]}, {"w": "in", "b": [0.7133, 0.5153, 0.733, 0.535]}, {"w": "the", "b": [0.7393, 0.5153, 0.7701, 0.535]}, {"w": "graph", "b": [0.7764, 0.5153, 0.8338, 0.535]}, {"w": "of", "b": [0.8401, 0.5153, 0.8612, 0.535]}, {"w": "layers.", "b": [0.1294, 0.5358, 0.196, 0.5555]}, {"w": "This", "b": [0.2023, 0.5358, 0.2471, 0.5555]}, {"w": "example", "b": [0.2534, 0.5358, 0.3389, 0.5555]}, {"w": "visualizes", "b": [0.3452, 0.5358, 0.4447, 0.5555]}, {"w": "model", "b": [0.451, 0.5358, 0.5141, 0.5555]}, {"w": "topology", "b": [0.5204, 0.5358, 0.6101, 0.5555]}, {"w": "using", "b": [0.6164, 0.5358, 0.671, 0.5555]}, {"w": "plot_model", "b": [0.6773, 0.5368, 0.8286, 0.557]}, {"w": "and", "b": [0.1294, 0.5572, 0.1658, 0.5769]}, {"w": "the", "b": [0.1721, 0.5572, 0.203, 0.5769]}, {"w": "show_shapes", "b": [0.2092, 0.5582, 0.3757, 0.5784]}, {"w": "option", "b": [0.3821, 0.5572, 0.4465, 0.5769]}, {"w": "(see", "b": [0.4528, 0.5572, 0.4935, 0.5769]}, {"w": "figure", "b": [0.4997, 0.5572, 0.56, 0.5769]}, {"w": "7.15):", "b": [0.5663, 0.5572, 0.6258, 0.5769]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras.utils import plot_model plot_model(model, show_shapes=True, to_file='model.png')", "words": [{"w": "from", "b": [0.1357, 0.5958, 0.1811, 0.611]}, {"w": "keras.utils", "b": [0.1925, 0.5958, 0.3173, 0.611]}, {"w": "import", "b": [0.3287, 0.5958, 0.3968, 0.611]}, {"w": "plot_model", "b": [0.4082, 0.5958, 0.5217, 0.611]}, {"w": "plot_model(model,", "b": [0.1357, 0.6261, 0.3287, 0.6413]}, {"w": "show_shapes=True,", "b": [0.34, 0.6261, 0.533, 0.6413]}, {"w": "to_file='model.png')", "b": [0.5444, 0.6261, 0.7714, 0.6413]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 7.15. A model plot with shape information", "words": [{"w": "Figure", "b": [0.1294, 0.6637, 0.1827, 0.6785]}, {"w": "7.15.", "b": [0.1874, 0.6637, 0.2252, 0.6785]}, {"w": "A", "b": [0.2299, 0.6637, 0.2436, 0.6785]}, {"w": "model", "b": [0.2483, 0.6637, 0.2977, 0.6785]}, {"w": "plot", "b": [0.3025, 0.6637, 0.334, 0.6785]}, {"w": "with", "b": [0.3387, 0.6637, 0.3745, 0.6785]}, {"w": "shape", "b": [0.3792, 0.6637, 0.4255, 0.6785]}, {"w": "information", "b": [0.4302, 0.6637, 0.5269, 0.6785]}]}]}, {"page": 339, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "7.2.3. Wrapping up", "words": [{"w": "7.2.3.", "b": [0.1294, 0.5206, 0.1862, 0.5404]}, {"w": "Wrapping", "b": [0.1925, 0.5206, 0.3028, 0.5404]}, {"w": "up", "b": [0.3091, 0.5206, 0.3371, 0.5404]}]}, {"id": "b_1", "type": "paragraph", "text": "Keras callbacks provide a simple way to monitor models during training and automatically take action based on the state of the model. When you’re using TensorFlow, TensorBoard is a great way to visualize model activity in your browser. You can use it in Keras models via the TensorBoard callback.", "words": [{"w": "Keras", "b": [0.1799, 0.559, 0.2387, 0.5787]}, {"w": "callbacks", "b": [0.245, 0.559, 0.3389, 0.5787]}, {"w": "provide", "b": [0.3452, 0.559, 0.4222, 0.5787]}, {"w": "a", "b": [0.4285, 0.559, 0.4397, 0.5787]}, {"w": "simple", "b": [0.446, 0.559, 0.5133, 0.5787]}, {"w": "way", "b": [0.5196, 0.559, 0.5617, 0.5787]}, {"w": "to", "b": [0.568, 0.559, 0.5876, 0.5787]}, {"w": "monitor", "b": [0.5939, 0.559, 0.6738, 0.5787]}, {"w": "models", "b": [0.6801, 0.559, 0.753, 0.5787]}, {"w": "during", "b": [0.7593, 0.559, 0.8251, 0.5787]}, {"w": "training", "b": [0.1799, 0.5795, 0.2583, 0.5992]}, {"w": "and", "b": [0.2646, 0.5795, 0.3011, 0.5992]}, {"w": "automatically", "b": [0.3074, 0.5795, 0.4447, 0.5992]}, {"w": "take", "b": [0.451, 0.5795, 0.493, 0.5992]}, {"w": "action", "b": [0.4993, 0.5795, 0.561, 0.5992]}, {"w": "based", "b": [0.5673, 0.5795, 0.6247, 0.5992]}, {"w": "on", "b": [0.6311, 0.5795, 0.6563, 0.5992]}, {"w": "the", "b": [0.6626, 0.5795, 0.6934, 0.5992]}, {"w": "state", "b": [0.6997, 0.5795, 0.746, 0.5992]}, {"w": "of", "b": [0.7523, 0.5795, 0.7733, 0.5992]}, {"w": "the", "b": [0.7795, 0.5795, 0.8103, 0.5992]}, {"w": "model.", "b": [0.1799, 0.6, 0.2492, 0.6197]}, {"w": "When", "b": [0.1799, 0.6205, 0.2401, 0.6402]}, {"w": "you’re", "b": [0.2464, 0.6205, 0.3122, 0.6402]}, {"w": "using", "b": [0.3186, 0.6205, 0.3732, 0.6402]}, {"w": "TensorFlow,", "b": [0.3795, 0.6205, 0.5043, 0.6402]}, {"w": "TensorBoard", "b": [0.5106, 0.6205, 0.6406, 0.6402]}, {"w": "is", "b": [0.6469, 0.6205, 0.6637, 0.6402]}, {"w": "a", "b": [0.67, 0.6205, 0.6812, 0.6402]}, {"w": "great", "b": [0.6875, 0.6205, 0.738, 0.6402]}, {"w": "way", "b": [0.7443, 0.6205, 0.7863, 0.6402]}, {"w": "to", "b": [0.7926, 0.6205, 0.8122, 0.6402]}, {"w": "visualize", "b": [0.1799, 0.641, 0.2695, 0.6607]}, {"w": "model", "b": [0.2758, 0.641, 0.3389, 0.6607]}, {"w": "activity", "b": [0.3452, 0.641, 0.4209, 0.6607]}, {"w": "in", "b": [0.4272, 0.641, 0.4468, 0.6607]}, {"w": "your", "b": [0.4531, 0.641, 0.4994, 0.6607]}, {"w": "browser.", "b": [0.5057, 0.641, 0.5918, 0.6607]}, {"w": "You", "b": [0.5981, 0.641, 0.639, 0.6607]}, {"w": "can", "b": [0.6453, 0.641, 0.6803, 0.6607]}, {"w": "use", "b": [0.6866, 0.641, 0.7203, 0.6607]}, {"w": "it", "b": [0.7266, 0.641, 0.7406, 0.6607]}, {"w": "in", "b": [0.7469, 0.641, 0.7665, 0.6607]}, {"w": "Keras", "b": [0.7728, 0.641, 0.8317, 0.6607]}, {"w": "models", "b": [0.1799, 0.6615, 0.2527, 0.6812]}, {"w": "via", "b": [0.259, 0.6615, 0.2899, 0.6812]}, {"w": "the", "b": [0.2962, 0.6615, 0.327, 0.6812]}, {"w": "TensorBoard", "b": [0.3333, 0.6625, 0.4998, 0.6827]}, {"w": "callback.", "b": [0.5061, 0.6615, 0.5965, 0.6812]}]}, {"id": "b_2", "type": "paragraph", "text": "7.3. Getting the most out of your models", "words": [{"w": "7.3.", "b": [0.1294, 0.7192, 0.172, 0.7414]}, {"w": "Getting", "b": [0.1791, 0.7192, 0.2705, 0.7414]}, {"w": "the", "b": [0.2776, 0.7192, 0.3154, 0.7414]}, {"w": "most", "b": [0.3225, 0.7192, 0.3808, 0.7414]}, {"w": "out", "b": [0.3879, 0.7192, 0.4274, 0.7414]}, {"w": "of", "b": [0.4345, 0.7192, 0.4581, 0.7414]}, {"w": "your", "b": [0.4652, 0.7192, 0.522, 0.7414]}, {"w": "models", "b": [0.529, 0.7192, 0.6142, 0.7414]}]}, {"id": "b_3", "type": "paragraph", "text": "Trying out architectures blindly works well enough if you just need something that works okay. In this section, we’ll go beyond “works okay” to “works great and wins machine-learning competitions” by offering you a quick guide to a set of must-know techniques for building state-of-the-art deep-learning models.", "words": [{"w": "Trying", "b": [0.1294, 0.7649, 0.1972, 0.7846]}, {"w": "out", "b": [0.2035, 0.7649, 0.2357, 0.7846]}, {"w": "architectures", "b": [0.242, 0.7649, 0.3709, 0.7846]}, {"w": "blindly", "b": [0.3772, 0.7649, 0.4487, 0.7846]}, {"w": "works", "b": [0.455, 0.7649, 0.5167, 0.7846]}, {"w": "well", "b": [0.523, 0.7649, 0.5664, 0.7846]}, {"w": "enough", "b": [0.5727, 0.7649, 0.647, 0.7846]}, {"w": "if", "b": [0.6533, 0.7649, 0.6687, 0.7846]}, {"w": "you", "b": [0.675, 0.7649, 0.7129, 0.7846]}, {"w": "just", "b": [0.7192, 0.7649, 0.7556, 0.7846]}, {"w": "need", "b": [0.7619, 0.7649, 0.8095, 0.7846]}, {"w": "something", "b": [0.1294, 0.7854, 0.2345, 0.8051]}, {"w": "that", "b": [0.2408, 0.7854, 0.2787, 0.8051]}, {"w": "works", "b": [0.285, 0.7854, 0.3466, 0.8051]}, {"w": "okay.", "b": [0.3529, 0.7854, 0.4066, 0.8051]}, {"w": "In", "b": [0.4129, 0.7854, 0.4339, 0.8051]}, {"w": "this", "b": [0.4403, 0.7854, 0.4767, 0.8051]}, {"w": "section,", "b": [0.483, 0.7854, 0.5608, 0.8051]}, {"w": "we’ll", "b": [0.5671, 0.7854, 0.6189, 0.8051]}, {"w": "go", "b": [0.6252, 0.7854, 0.6505, 0.8051]}, {"w": "beyond", "b": [0.6568, 0.7854, 0.731, 0.8051]}, {"w": "“works", "b": [0.7373, 0.7854, 0.8101, 0.8051]}, {"w": "okay”", "b": [0.1294, 0.8059, 0.1897, 0.8256]}, {"w": "to", "b": [0.196, 0.8059, 0.2156, 0.8256]}, {"w": "“works", "b": [0.2219, 0.8059, 0.2947, 0.8256]}, {"w": "great", "b": [0.301, 0.8059, 0.3515, 0.8256]}, {"w": "and", "b": [0.3578, 0.8059, 0.3942, 0.8256]}, {"w": "wins", "b": [0.4005, 0.8059, 0.4482, 0.8256]}, {"w": "machine-learning", "b": [0.4545, 0.8059, 0.631, 0.8256]}, {"w": "competitions”", "b": [0.6373, 0.8059, 0.7788, 0.8256]}, {"w": "by", "b": [0.7852, 0.8059, 0.8104, 0.8256]}, {"w": "offering", "b": [0.1294, 0.8264, 0.2102, 0.8461]}, {"w": "you", "b": [0.2165, 0.8264, 0.2544, 0.8461]}, {"w": "a", "b": [0.2607, 0.8264, 0.2719, 0.8461]}, {"w": "quick", "b": [0.2782, 0.8264, 0.3342, 0.8461]}, {"w": "guide", "b": [0.3405, 0.8264, 0.3966, 0.8461]}, {"w": "to", "b": [0.4029, 0.8264, 0.4225, 0.8461]}, {"w": "a", "b": [0.4288, 0.8264, 0.44, 0.8461]}, {"w": "set", "b": [0.4463, 0.8264, 0.4743, 0.8461]}, {"w": "of", "b": [0.4807, 0.8264, 0.5017, 0.8461]}, {"w": "must-know", "b": [0.508, 0.8264, 0.6215, 0.8461]}, {"w": "techniques", "b": [0.6278, 0.8264, 0.7357, 0.8461]}, {"w": "for", "b": [0.7419, 0.8264, 0.7713, 0.8461]}, {"w": "building", "b": [0.7776, 0.8264, 0.8617, 0.8461]}, {"w": "state-of-the-art", "b": [0.1294, 0.8469, 0.2793, 0.8666]}, {"w": "deep-learning", "b": [0.2856, 0.8469, 0.4243, 0.8666]}, {"w": "models.", "b": [0.4306, 0.8469, 0.5098, 0.8666]}]}, {"id": "b_4", "type": "paragraph", "text": "7.3.1. Advanced architecture patterns", "words": [{"w": "7.3.1.", "b": [0.1294, 0.8941, 0.1862, 0.9138]}, {"w": "Advanced", "b": [0.1925, 0.8941, 0.3004, 0.9138]}, {"w": "architecture", "b": [0.3067, 0.8941, 0.4375, 0.9138]}, {"w": "patterns", "b": [0.4438, 0.8941, 0.5334, 0.9138]}]}]}, {"page": 340, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "We covered one important design pattern in detail in the previous section: residual connections. There are two more design patterns you should know about: normalization and depthwise separable convolution. These patterns are especially relevant when you’re building high- performing deep convnets, but they’re commonly found in many other types of architectures as well.", "words": [{"w": "We", "b": [0.1294, 0.0857, 0.1624, 0.1054]}, {"w": "covered", "b": [0.1687, 0.0857, 0.2485, 0.1054]}, {"w": "one", "b": [0.2549, 0.0857, 0.2913, 0.1054]}, {"w": "important", "b": [0.2976, 0.0857, 0.3957, 0.1054]}, {"w": "design", "b": [0.402, 0.0857, 0.4679, 0.1054]}, {"w": "pattern", "b": [0.4742, 0.0857, 0.5442, 0.1054]}, {"w": "in", "b": [0.5505, 0.0857, 0.5702, 0.1054]}, {"w": "detail", "b": [0.5765, 0.0857, 0.6325, 0.1054]}, {"w": "in", "b": [0.6388, 0.0857, 0.6584, 0.1054]}, {"w": "the", "b": [0.6647, 0.0857, 0.6956, 0.1054]}, {"w": "previous", "b": [0.7019, 0.0857, 0.7888, 0.1054]}, {"w": "section:", "b": [0.1294, 0.1062, 0.2079, 0.1259]}, {"w": "residual", "b": [0.2142, 0.1062, 0.2941, 0.1259]}, {"w": "connections.", "b": [0.3004, 0.1062, 0.4272, 0.1259]}, {"w": "There", "b": [0.4335, 0.1062, 0.4923, 0.1259]}, {"w": "are", "b": [0.4986, 0.1062, 0.5294, 0.1259]}, {"w": "two", "b": [0.5357, 0.1062, 0.5736, 0.1259]}, {"w": "more", "b": [0.5799, 0.1062, 0.6317, 0.1259]}, {"w": "design", "b": [0.638, 0.1062, 0.7039, 0.1259]}, {"w": "patterns", "b": [0.7101, 0.1062, 0.79, 0.1259]}, {"w": "you", "b": [0.7963, 0.1062, 0.8341, 0.1259]}, {"w": "should", "b": [0.1294, 0.1267, 0.1967, 0.1464]}, {"w": "know", "b": [0.203, 0.1267, 0.259, 0.1464]}, {"w": "about:", "b": [0.2654, 0.1267, 0.3284, 0.1464]}, {"w": "normalization", "b": [0.3347, 0.1267, 0.4749, 0.1464]}, {"w": "and", "b": [0.4812, 0.1267, 0.5176, 0.1464]}, {"w": "depthwise", "b": [0.5239, 0.1267, 0.6262, 0.1464]}, {"w": "separable", "b": [0.6325, 0.1267, 0.7277, 0.1464]}, {"w": "convolution.", "b": [0.734, 0.1267, 0.8609, 0.1464]}, {"w": "These", "b": [0.1294, 0.1472, 0.1897, 0.1669]}, {"w": "patterns", "b": [0.196, 0.1472, 0.2758, 0.1669]}, {"w": "are", "b": [0.2821, 0.1472, 0.3129, 0.1669]}, {"w": "especially", "b": [0.3192, 0.1472, 0.4201, 0.1669]}, {"w": "relevant", "b": [0.4264, 0.1472, 0.5077, 0.1669]}, {"w": "when", "b": [0.5139, 0.1472, 0.5685, 0.1669]}, {"w": "you’re", "b": [0.5749, 0.1472, 0.6407, 0.1669]}, {"w": "building", "b": [0.647, 0.1472, 0.7311, 0.1669]}, {"w": "high-", "b": [0.7374, 0.1472, 0.7907, 0.1669]}, {"w": "performing", "b": [0.1294, 0.1677, 0.2429, 0.1874]}, {"w": "deep", "b": [0.2492, 0.1677, 0.2968, 0.1874]}, {"w": "convnets,", "b": [0.3031, 0.1677, 0.3991, 0.1874]}, {"w": "but", "b": [0.4054, 0.1677, 0.4377, 0.1874]}, {"w": "they’re", "b": [0.444, 0.1677, 0.5154, 0.1874]}, {"w": "commonly", "b": [0.5217, 0.1677, 0.6296, 0.1874]}, {"w": "found", "b": [0.6359, 0.1677, 0.6948, 0.1874]}, {"w": "in", "b": [0.7011, 0.1677, 0.7207, 0.1874]}, {"w": "many", "b": [0.727, 0.1677, 0.7831, 0.1874]}, {"w": "other", "b": [0.7894, 0.1677, 0.8412, 0.1874]}, {"w": "types", "b": [0.1294, 0.1882, 0.1827, 0.2079]}, {"w": "of", "b": [0.189, 0.1882, 0.21, 0.2079]}, {"w": "architectures", "b": [0.2163, 0.1882, 0.3452, 0.2079]}, {"w": "as", "b": [0.3515, 0.1882, 0.3725, 0.2079]}, {"w": "well.", "b": [0.3788, 0.1882, 0.4285, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "Batch normalization", "words": [{"w": "Batch", "b": [0.1294, 0.226, 0.1767, 0.2408]}, {"w": "normalization", "b": [0.1814, 0.226, 0.295, 0.2408]}]}, {"id": "b_2", "type": "paragraph", "text": "Normalization is a broad category of methods that seek to make different samples seen by a machine-learning model more similar to each other, which helps the model learn and generalize well to new data. The most common form of data normalization is one you’ve seen several times in this book already: centering the data on 0 by subtracting the mean from the data, and giving the data a unit standard deviation by dividing the data by its standard deviation. In effect, this makes the assumption that the data follows a normal (or Gaussian) distribution and makes sure this distribution is centered and scaled to unit variance:", "words": [{"w": "Normalization", "b": [0.1294, 0.2639, 0.2752, 0.2837]}, {"w": "is", "b": [0.2815, 0.2639, 0.2983, 0.2837]}, {"w": "a", "b": [0.3046, 0.2639, 0.3158, 0.2837]}, {"w": "broad", "b": [0.3221, 0.2639, 0.3796, 0.2837]}, {"w": "category", "b": [0.3859, 0.2639, 0.4727, 0.2837]}, {"w": "of", "b": [0.479, 0.2639, 0.5, 0.2837]}, {"w": "methods", "b": [0.5063, 0.2639, 0.5918, 0.2837]}, {"w": "that", "b": [0.5981, 0.2639, 0.636, 0.2837]}, {"w": "seek", "b": [0.6423, 0.2639, 0.6871, 0.2837]}, {"w": "to", "b": [0.6934, 0.2639, 0.713, 0.2837]}, {"w": "make", "b": [0.7193, 0.2639, 0.774, 0.2837]}, {"w": "different", "b": [0.7803, 0.2639, 0.8666, 0.2837]}, {"w": "samples", "b": [0.1294, 0.2844, 0.2107, 0.3042]}, {"w": "seen", "b": [0.217, 0.2844, 0.2618, 0.3042]}, {"w": "by", "b": [0.2681, 0.2844, 0.2934, 0.3042]}, {"w": "a", "b": [0.2997, 0.2844, 0.3109, 0.3042]}, {"w": "machine-learning", "b": [0.3172, 0.2844, 0.4937, 0.3042]}, {"w": "model", "b": [0.5, 0.2844, 0.5631, 0.3042]}, {"w": "more", "b": [0.5694, 0.2844, 0.6212, 0.3042]}, {"w": "similar", "b": [0.6275, 0.2844, 0.6976, 0.3042]}, {"w": "to", "b": [0.7039, 0.2844, 0.7235, 0.3042]}, {"w": "each", "b": [0.7298, 0.2844, 0.776, 0.3042]}, {"w": "other,", "b": [0.7822, 0.2844, 0.8394, 0.3042]}, {"w": "which", "b": [0.1294, 0.3049, 0.1911, 0.3247]}, {"w": "helps", "b": [0.1974, 0.3049, 0.2506, 0.3247]}, {"w": "the", "b": [0.2569, 0.3049, 0.2878, 0.3247]}, {"w": "model", "b": [0.2941, 0.3049, 0.3571, 0.3247]}, {"w": "learn", "b": [0.3634, 0.3049, 0.4139, 0.3247]}, {"w": "and", "b": [0.4202, 0.3049, 0.4566, 0.3247]}, {"w": "generalize", "b": [0.4629, 0.3049, 0.5665, 0.3247]}, {"w": "well", "b": [0.5729, 0.3049, 0.6163, 0.3247]}, {"w": "to", "b": [0.6226, 0.3049, 0.6422, 0.3247]}, {"w": "new", "b": [0.6485, 0.3049, 0.6906, 0.3247]}, {"w": "data.", "b": [0.6969, 0.3049, 0.7452, 0.3247]}, {"w": "The", "b": [0.7515, 0.3049, 0.7907, 0.3247]}, {"w": "most", "b": [0.797, 0.3049, 0.8461, 0.3247]}, {"w": "common", "b": [0.1294, 0.3254, 0.2177, 0.3452]}, {"w": "form", "b": [0.224, 0.3254, 0.273, 0.3452]}, {"w": "of", "b": [0.2794, 0.3254, 0.3004, 0.3452]}, {"w": "data", "b": [0.3067, 0.3254, 0.3487, 0.3452]}, {"w": "normalization", "b": [0.355, 0.3254, 0.4951, 0.3452]}, {"w": "is", "b": [0.5014, 0.3254, 0.5183, 0.3452]}, {"w": "one", "b": [0.5246, 0.3254, 0.561, 0.3452]}, {"w": "you’ve", "b": [0.5673, 0.3254, 0.6374, 0.3452]}, {"w": "seen", "b": [0.6436, 0.3254, 0.6884, 0.3452]}, {"w": "several", "b": [0.6947, 0.3254, 0.7662, 0.3452]}, {"w": "times", "b": [0.7725, 0.3254, 0.8271, 0.3452]}, {"w": "in", "b": [0.8334, 0.3254, 0.8531, 0.3452]}, {"w": "this", "b": [0.1294, 0.3459, 0.1659, 0.3657]}, {"w": "book", "b": [0.1722, 0.3459, 0.2226, 0.3657]}, {"w": "already:", "b": [0.2289, 0.3459, 0.3102, 0.3657]}, {"w": "centering", "b": [0.3165, 0.3459, 0.4104, 0.3657]}, {"w": "the", "b": [0.4167, 0.3459, 0.4475, 0.3657]}, {"w": "data", "b": [0.4538, 0.3459, 0.4958, 0.3657]}, {"w": "on", "b": [0.5021, 0.3459, 0.5273, 0.3657]}, {"w": "0", "b": [0.5337, 0.3459, 0.5463, 0.3657]}, {"w": "by", "b": [0.5526, 0.3459, 0.5778, 0.3657]}, {"w": "subtracting", "b": [0.5841, 0.3459, 0.6962, 0.3657]}, {"w": "the", "b": [0.7025, 0.3459, 0.7333, 0.3657]}, {"w": "mean", "b": [0.7396, 0.3459, 0.7943, 0.3657]}, {"w": "from", "b": [0.8006, 0.3459, 0.8496, 0.3657]}, {"w": "the", "b": [0.1294, 0.3664, 0.1602, 0.3862]}, {"w": "data,", "b": [0.1665, 0.3664, 0.2149, 0.3862]}, {"w": "and", "b": [0.2212, 0.3664, 0.2576, 0.3862]}, {"w": "giving", "b": [0.2639, 0.3664, 0.3284, 0.3862]}, {"w": "the", "b": [0.3347, 0.3664, 0.3655, 0.3862]}, {"w": "data", "b": [0.3718, 0.3664, 0.4139, 0.3862]}, {"w": "a", "b": [0.4201, 0.3664, 0.4313, 0.3862]}, {"w": "unit", "b": [0.4376, 0.3664, 0.4769, 0.3862]}, {"w": "standard", "b": [0.4832, 0.3664, 0.5686, 0.3862]}, {"w": "deviation", "b": [0.5749, 0.3664, 0.6688, 0.3862]}, {"w": "by", "b": [0.6751, 0.3664, 0.7004, 0.3862]}, {"w": "dividing", "b": [0.7067, 0.3664, 0.7908, 0.3862]}, {"w": "the", "b": [0.7971, 0.3664, 0.8279, 0.3862]}, {"w": "data", "b": [0.1294, 0.3869, 0.1714, 0.4067]}, {"w": "by", "b": [0.1777, 0.3869, 0.203, 0.4067]}, {"w": "its", "b": [0.2093, 0.3869, 0.2331, 0.4067]}, {"w": "standard", "b": [0.2394, 0.3869, 0.3249, 0.4067]}, {"w": "deviation.", "b": [0.3312, 0.3869, 0.4314, 0.4067]}, {"w": "In", "b": [0.4377, 0.3869, 0.4587, 0.4067]}, {"w": "effect,", "b": [0.465, 0.3869, 0.5282, 0.4067]}, {"w": "this", "b": [0.5345, 0.3869, 0.571, 0.4067]}, {"w": "makes", "b": [0.5773, 0.3869, 0.6417, 0.4067]}, {"w": "the", "b": [0.6481, 0.3869, 0.6789, 0.4067]}, {"w": "assumption", "b": [0.6852, 0.3869, 0.8001, 0.4067]}, {"w": "that", "b": [0.8064, 0.3869, 0.8443, 0.4067]}, {"w": "the", "b": [0.1294, 0.4074, 0.1602, 0.4272]}, {"w": "data", "b": [0.1665, 0.4074, 0.2086, 0.4272]}, {"w": "follows", "b": [0.2148, 0.4074, 0.2905, 0.4272]}, {"w": "a", "b": [0.2968, 0.4074, 0.308, 0.4272]}, {"w": "normal", "b": [0.3143, 0.4074, 0.3858, 0.4272]}, {"w": "(or", "b": [0.3921, 0.4074, 0.4215, 0.4272]}, {"w": "Gaussian)", "b": [0.4278, 0.4074, 0.5287, 0.4272]}, {"w": "distribution", "b": [0.535, 0.4074, 0.6514, 0.4272]}, {"w": "and", "b": [0.6577, 0.4074, 0.6941, 0.4272]}, {"w": "makes", "b": [0.7004, 0.4074, 0.7648, 0.4272]}, {"w": "sure", "b": [0.7711, 0.4074, 0.8132, 0.4272]}, {"w": "this", "b": [0.8195, 0.4074, 0.8559, 0.4272]}, {"w": "distribution", "b": [0.1294, 0.4279, 0.2458, 0.4477]}, {"w": "is", "b": [0.2521, 0.4279, 0.2689, 0.4477]}, {"w": "centered", "b": [0.2752, 0.4279, 0.3606, 0.4477]}, {"w": "and", "b": [0.3669, 0.4279, 0.4034, 0.4477]}, {"w": "scaled", "b": [0.4097, 0.4279, 0.4727, 0.4477]}, {"w": "to", "b": [0.479, 0.4279, 0.4986, 0.4477]}, {"w": "unit", "b": [0.5049, 0.4279, 0.5442, 0.4477]}, {"w": "variance:", "b": [0.5505, 0.4279, 0.643, 0.4477]}]}, {"id": "b_3", "type": "equation", "text": "normalized_data = (data - np.mean(data, axis=...)) / np.std(data, axis=...)", "words": [{"w": "normalized_data", "b": [0.1357, 0.4657, 0.306, 0.4808]}, {"w": "=", "b": [0.3173, 0.4657, 0.3287, 0.4808]}, {"w": "(data", "b": [0.34, 0.4657, 0.3968, 0.4808]}, {"w": "-", "b": [0.4082, 0.4657, 0.4195, 0.4808]}, {"w": "np.mean(data,", "b": [0.4309, 0.4657, 0.5784, 0.4808]}, {"w": "axis=...))", "b": [0.5898, 0.4657, 0.7033, 0.4808]}, {"w": "/", "b": [0.7146, 0.4657, 0.726, 0.4808]}, {"w": "np.std(data,", "b": [0.1357, 0.4808, 0.2719, 0.496]}, {"w": "axis=...)", "b": [0.2833, 0.4808, 0.3855, 0.496]}]}, {"id": "b_4", "type": "paragraph", "text": "Previous examples normalized data before feeding it into models. But data normalization should be a concern after every transformation operated by the network: even if the data entering a Dense or Conv2D network has a 0 mean and unit variance, there’s no reason to expect a priori that this will be the case for the data coming out.", "words": [{"w": "Previous", "b": [0.1294, 0.5189, 0.2177, 0.5386]}, {"w": "examples", "b": [0.224, 0.5189, 0.3193, 0.5386]}, {"w": "normalized", "b": [0.3256, 0.5189, 0.4391, 0.5386]}, {"w": "data", "b": [0.4454, 0.5189, 0.4874, 0.5386]}, {"w": "before", "b": [0.4937, 0.5189, 0.5581, 0.5386]}, {"w": "feeding", "b": [0.5645, 0.5189, 0.6401, 0.5386]}, {"w": "it", "b": [0.6464, 0.5189, 0.6604, 0.5386]}, {"w": "into", "b": [0.6667, 0.5189, 0.706, 0.5386]}, {"w": "models.", "b": [0.7123, 0.5189, 0.7915, 0.5386]}, {"w": "But", "b": [0.7978, 0.5189, 0.8342, 0.5386]}, {"w": "data", "b": [0.1294, 0.5394, 0.1714, 0.5591]}, {"w": "normalization", "b": [0.1777, 0.5394, 0.3179, 0.5591]}, {"w": "should", "b": [0.3242, 0.5394, 0.3915, 0.5591]}, {"w": "be", "b": [0.3978, 0.5394, 0.4216, 0.5591]}, {"w": "a", "b": [0.4279, 0.5394, 0.4391, 0.5591]}, {"w": "concern", "b": [0.4454, 0.5394, 0.5252, 0.5591]}, {"w": "after", "b": [0.5315, 0.5394, 0.5777, 0.5591]}, {"w": "every", "b": [0.5841, 0.5394, 0.6401, 0.5591]}, {"w": "transformation", "b": [0.6464, 0.5394, 0.7949, 0.5591]}, {"w": "operated", "b": [0.1294, 0.5599, 0.2163, 0.5796]}, {"w": "by", "b": [0.2226, 0.5599, 0.2478, 0.5796]}, {"w": "the", "b": [0.2541, 0.5599, 0.2849, 0.5796]}, {"w": "network:", "b": [0.2912, 0.5599, 0.3809, 0.5796]}, {"w": "even", "b": [0.3872, 0.5599, 0.4348, 0.5796]}, {"w": "if", "b": [0.4412, 0.5599, 0.4566, 0.5796]}, {"w": "the", "b": [0.4629, 0.5599, 0.4937, 0.5796]}, {"w": "data", "b": [0.5, 0.5599, 0.542, 0.5796]}, {"w": "entering", "b": [0.5483, 0.5599, 0.631, 0.5796]}, {"w": "a", "b": [0.6373, 0.5599, 0.6485, 0.5796]}, {"w": "Dense", "b": [0.6547, 0.5609, 0.7304, 0.5811]}, {"w": "or", "b": [0.7367, 0.5599, 0.7577, 0.5796]}, {"w": "Conv2D", "b": [0.764, 0.5609, 0.8548, 0.5811]}, {"w": "network", "b": [0.1294, 0.5812, 0.2121, 0.601]}, {"w": "has", "b": [0.2184, 0.5812, 0.252, 0.601]}, {"w": "a", "b": [0.2583, 0.5812, 0.2695, 0.601]}, {"w": "0", "b": [0.2758, 0.5812, 0.2884, 0.601]}, {"w": "mean", "b": [0.2947, 0.5812, 0.3494, 0.601]}, {"w": "and", "b": [0.3557, 0.5812, 0.3921, 0.601]}, {"w": "unit", "b": [0.3984, 0.5812, 0.4377, 0.601]}, {"w": "variance,", "b": [0.444, 0.5812, 0.5357, 0.601]}, {"w": "there’s", "b": [0.542, 0.5812, 0.6092, 0.601]}, {"w": "no", "b": [0.6155, 0.5812, 0.6407, 0.601]}, {"w": "reason", "b": [0.6471, 0.5812, 0.7129, 0.601]}, {"w": "to", "b": [0.7192, 0.5812, 0.7388, 0.601]}, {"w": "expect", "b": [0.7451, 0.5812, 0.811, 0.601]}, {"w": "a", "b": [0.8173, 0.5812, 0.8285, 0.601]}, {"w": "priori", "b": [0.1294, 0.6017, 0.1855, 0.6215]}, {"w": "that", "b": [0.1918, 0.6017, 0.2296, 0.6215]}, {"w": "this", "b": [0.2359, 0.6017, 0.2724, 0.6215]}, {"w": "will", "b": [0.2787, 0.6017, 0.3179, 0.6215]}, {"w": "be", "b": [0.3242, 0.6017, 0.348, 0.6215]}, {"w": "the", "b": [0.3544, 0.6017, 0.3852, 0.6215]}, {"w": "case", "b": [0.3915, 0.6017, 0.4349, 0.6215]}, {"w": "for", "b": [0.4412, 0.6017, 0.4706, 0.6215]}, {"w": "the", "b": [0.4769, 0.6017, 0.5077, 0.6215]}, {"w": "data", "b": [0.5141, 0.6017, 0.5561, 0.6215]}, {"w": "coming", "b": [0.5624, 0.6017, 0.6381, 0.6215]}, {"w": "out.", "b": [0.6443, 0.6017, 0.6828, 0.6215]}]}, {"id": "b_5", "type": "paragraph", "text": "Batch normalization is a type of layer (BatchNormalization in Keras) introduced in 2015 by Ioffe and Szegedy;[7] it can adaptively normalize data even as the mean and variance change over time during training. It works by internally maintaining an exponential moving average of the batch-wise mean and variance of the data seen during training. The main effect of batch normalization is that it helps with gradient propagation—much like residual connections—and thus allows for deeper networks. Some very deep networks can only be trained if they include multiple BatchNormalization layers. For instance, BatchNormalization is used liberally in many of the advanced convnet architectures that come packaged with Keras, such as ResNet50, Inception V3, and Xception.", "words": [{"w": "Batch", "b": [0.1294, 0.6445, 0.1883, 0.6643]}, {"w": "normalization", "b": [0.1946, 0.6445, 0.3347, 0.6643]}, {"w": "is", "b": [0.341, 0.6445, 0.3578, 0.6643]}, {"w": "a", "b": [0.3641, 0.6445, 0.3753, 0.6643]}, {"w": "type", "b": [0.3816, 0.6445, 0.4251, 0.6643]}, {"w": "of", "b": [0.4314, 0.6445, 0.4524, 0.6643]}, {"w": "layer", "b": [0.4587, 0.6445, 0.5091, 0.6643]}, {"w": "(BatchNormalization", "b": [0.5154, 0.6445, 0.7962, 0.6658]}, {"w": "in", "b": [0.8025, 0.6445, 0.8222, 0.6643]}, {"w": "Keras)", "b": [0.1294, 0.6677, 0.1966, 0.6874]}, {"w": "introduced", "b": [0.2029, 0.6677, 0.3108, 0.6874]}, {"w": "in", "b": [0.3171, 0.6677, 0.3368, 0.6874]}, {"w": "2015", "b": [0.3431, 0.6677, 0.3935, 0.6874]}, {"w": "by", "b": [0.3998, 0.6677, 0.4251, 0.6874]}, {"w": "Ioffe", "b": [0.4314, 0.6677, 0.4799, 0.6874]}, {"w": "and", "b": [0.4862, 0.6677, 0.5226, 0.6874]}, {"w": "Szegedy;[7]", "b": [0.5289, 0.6654, 0.6434, 0.6874]}, {"w": "it", "b": [0.6497, 0.6677, 0.6638, 0.6874]}, {"w": "can", "b": [0.6701, 0.6677, 0.7051, 0.6874]}, {"w": "adaptively", "b": [0.7114, 0.6677, 0.8165, 0.6874]}, {"w": "normalize", "b": [0.1294, 0.6882, 0.2303, 0.7079]}, {"w": "data", "b": [0.2366, 0.6882, 0.2786, 0.7079]}, {"w": "even", "b": [0.2849, 0.6882, 0.3326, 0.7079]}, {"w": "as", "b": [0.3389, 0.6882, 0.3599, 0.7079]}, {"w": "the", "b": [0.3662, 0.6882, 0.397, 0.7079]}, {"w": "mean", "b": [0.4033, 0.6882, 0.458, 0.7079]}, {"w": "and", "b": [0.4643, 0.6882, 0.5007, 0.7079]}, {"w": "variance", "b": [0.507, 0.6882, 0.5924, 0.7079]}, {"w": "change", "b": [0.5987, 0.6882, 0.6702, 0.7079]}, {"w": "over", "b": [0.6765, 0.6882, 0.7213, 0.7079]}, {"w": "time", "b": [0.7276, 0.6882, 0.7725, 0.7079]}, {"w": "during", "b": [0.7788, 0.6882, 0.8446, 0.7079]}, {"w": "training.", "b": [0.1294, 0.7087, 0.2142, 0.7284]}, {"w": "It", "b": [0.2205, 0.7087, 0.2359, 0.7284]}, {"w": "works", "b": [0.2422, 0.7087, 0.3039, 0.7284]}, {"w": "by", "b": [0.3102, 0.7087, 0.3354, 0.7284]}, {"w": "internally", "b": [0.3417, 0.7087, 0.4384, 0.7284]}, {"w": "maintaining", "b": [0.4447, 0.7087, 0.5652, 0.7284]}, {"w": "an", "b": [0.5715, 0.7087, 0.5953, 0.7284]}, {"w": "exponential", "b": [0.6016, 0.7087, 0.7193, 0.7284]}, {"w": "moving", "b": [0.7256, 0.7087, 0.8027, 0.7284]}, {"w": "average", "b": [0.1294, 0.7292, 0.2078, 0.7489]}, {"w": "of", "b": [0.2141, 0.7292, 0.2352, 0.7489]}, {"w": "the", "b": [0.2415, 0.7292, 0.2723, 0.7489]}, {"w": "batch-wise", "b": [0.2786, 0.7292, 0.3879, 0.7489]}, {"w": "mean", "b": [0.3942, 0.7292, 0.4488, 0.7489]}, {"w": "and", "b": [0.4551, 0.7292, 0.4916, 0.7489]}, {"w": "variance", "b": [0.4979, 0.7292, 0.5833, 0.7489]}, {"w": "of", "b": [0.5896, 0.7292, 0.6106, 0.7489]}, {"w": "the", "b": [0.6169, 0.7292, 0.6478, 0.7489]}, {"w": "data", "b": [0.6541, 0.7292, 0.6961, 0.7489]}, {"w": "seen", "b": [0.7024, 0.7292, 0.7472, 0.7489]}, {"w": "during", "b": [0.7535, 0.7292, 0.8194, 0.7489]}, {"w": "training.", "b": [0.1294, 0.7497, 0.2142, 0.7694]}, {"w": "The", "b": [0.2205, 0.7497, 0.2597, 0.7694]}, {"w": "main", "b": [0.266, 0.7497, 0.3165, 0.7694]}, {"w": "effect", "b": [0.3228, 0.7497, 0.3797, 0.7694]}, {"w": "of", "b": [0.386, 0.7497, 0.407, 0.7694]}, {"w": "batch", "b": [0.4133, 0.7497, 0.468, 0.7694]}, {"w": "normalization", "b": [0.4743, 0.7497, 0.6144, 0.7694]}, {"w": "is", "b": [0.6207, 0.7497, 0.6375, 0.7694]}, {"w": "that", "b": [0.6438, 0.7497, 0.6817, 0.7694]}, {"w": "it", "b": [0.688, 0.7497, 0.702, 0.7694]}, {"w": "helps", "b": [0.7083, 0.7497, 0.7616, 0.7694]}, {"w": "with", "b": [0.7679, 0.7497, 0.8127, 0.7694]}, {"w": "gradient", "b": [0.1294, 0.7702, 0.2121, 0.7899]}, {"w": "propagation—much", "b": [0.2184, 0.7702, 0.4202, 0.7899]}, {"w": "like", "b": [0.4265, 0.7702, 0.4643, 0.7899]}, {"w": "residual", "b": [0.4706, 0.7702, 0.5505, 0.7899]}, {"w": "connections—and", "b": [0.5568, 0.7702, 0.7389, 0.7899]}, {"w": "thus", "b": [0.7452, 0.7702, 0.7873, 0.7899]}, {"w": "allows", "b": [0.7936, 0.7702, 0.8595, 0.7899]}, {"w": "for", "b": [0.1294, 0.7907, 0.1588, 0.8104]}, {"w": "deeper", "b": [0.1651, 0.7907, 0.2324, 0.8104]}, {"w": "networks.", "b": [0.2387, 0.7907, 0.3374, 0.8104]}, {"w": "Some", "b": [0.3437, 0.7907, 0.4012, 0.8104]}, {"w": "very", "b": [0.4075, 0.7907, 0.4523, 0.8104]}, {"w": "deep", "b": [0.4586, 0.7907, 0.5063, 0.8104]}, {"w": "networks", "b": [0.5126, 0.7907, 0.605, 0.8104]}, {"w": "can", "b": [0.6114, 0.7907, 0.6464, 0.8104]}, {"w": "only", "b": [0.6527, 0.7907, 0.6975, 0.8104]}, {"w": "be", "b": [0.7038, 0.7907, 0.7276, 0.8104]}, {"w": "trained", "b": [0.7339, 0.7907, 0.804, 0.8104]}, {"w": "if", "b": [0.8103, 0.7907, 0.8257, 0.8104]}, {"w": "they", "b": [0.1294, 0.8112, 0.1729, 0.8309]}, {"w": "include", "b": [0.1792, 0.8112, 0.2534, 0.8309]}, {"w": "multiple", "b": [0.2597, 0.8112, 0.3438, 0.8309]}, {"w": "BatchNormalization", "b": [0.3501, 0.8123, 0.6225, 0.8324]}, {"w": "layers.", "b": [0.6289, 0.8112, 0.6954, 0.8309]}, {"w": "For", "b": [0.7017, 0.8112, 0.7368, 0.8309]}, {"w": "instance,", "b": [0.7431, 0.8112, 0.832, 0.8309]}, {"w": "BatchNormalization", "b": [0.1294, 0.8336, 0.4019, 0.8538]}, {"w": "is", "b": [0.4082, 0.8326, 0.425, 0.8523]}, {"w": "used", "b": [0.4313, 0.8326, 0.4776, 0.8523]}, {"w": "liberally", "b": [0.4839, 0.8326, 0.568, 0.8523]}, {"w": "in", "b": [0.5743, 0.8326, 0.5939, 0.8523]}, {"w": "many", "b": [0.6002, 0.8326, 0.6562, 0.8523]}, {"w": "of", "b": [0.6625, 0.8326, 0.6836, 0.8523]}, {"w": "the", "b": [0.6899, 0.8326, 0.7207, 0.8523]}, {"w": "advanced", "b": [0.727, 0.8326, 0.8223, 0.8523]}, {"w": "convnet", "b": [0.1294, 0.854, 0.2093, 0.8737]}, {"w": "architectures", "b": [0.2156, 0.854, 0.3445, 0.8737]}, {"w": "that", "b": [0.3508, 0.854, 0.3886, 0.8737]}, {"w": "come", "b": [0.3949, 0.854, 0.4496, 0.8737]}, {"w": "packaged", "b": [0.4559, 0.854, 0.5511, 0.8737]}, {"w": "with", "b": [0.5574, 0.854, 0.6023, 0.8737]}, {"w": "Keras,", "b": [0.6086, 0.854, 0.6737, 0.8737]}, {"w": "such", "b": [0.68, 0.854, 0.7263, 0.8737]}, {"w": "as", "b": [0.7326, 0.854, 0.7536, 0.8737]}, {"w": "ResNet50,", "b": [0.7599, 0.854, 0.8657, 0.8737]}, {"w": "Inception", "b": [0.1294, 0.8745, 0.2247, 0.8942]}, {"w": "V3,", "b": [0.231, 0.8745, 0.2681, 0.8942]}, {"w": "and", "b": [0.2744, 0.8745, 0.3108, 0.8942]}, {"w": "Xception.", "b": [0.3171, 0.8745, 0.4159, 0.8942]}]}]}, {"page": 341, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_1", "type": "paragraph", "text": "Sergey Ioffe and Christian Szegedy, “Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift,” Proceedings of the 32nd International Conference on Machine Learning (2015), https://arxiv.org/abs/1502.03167.", "words": [{"w": "Sergey", "b": [0.1483, 0.1128, 0.2005, 0.1276]}, {"w": "Ioffe", "b": [0.2053, 0.1128, 0.2417, 0.1276]}, {"w": "and", "b": [0.2464, 0.1128, 0.2737, 0.1276]}, {"w": "Christian", "b": [0.2785, 0.1128, 0.3478, 0.1276]}, {"w": "Szegedy,", "b": [0.3526, 0.1128, 0.4201, 0.1276]}, {"w": "“Batch", "b": [0.4249, 0.1128, 0.4774, 0.1276]}, {"w": "Normalization:", "b": [0.4821, 0.1128, 0.5967, 0.1276]}, {"w": "Accelerating", "b": [0.6014, 0.1128, 0.6981, 0.1276]}, {"w": "Deep", "b": [0.7028, 0.1128, 0.7427, 0.1276]}, {"w": "Network", "b": [0.7475, 0.1128, 0.8137, 0.1276]}, {"w": "Training", "b": [0.1483, 0.128, 0.2128, 0.1428]}, {"w": "by", "b": [0.2176, 0.128, 0.2365, 0.1428]}, {"w": "Reducing", "b": [0.2412, 0.128, 0.3137, 0.1428]}, {"w": "Internal", "b": [0.3184, 0.128, 0.3773, 0.1428]}, {"w": "Covariate", "b": [0.382, 0.128, 0.4556, 0.1428]}, {"w": "Shift,”", "b": [0.4602, 0.128, 0.5102, 0.1428]}, {"w": "Proceedings", "b": [0.5149, 0.128, 0.6088, 0.1428]}, {"w": "of", "b": [0.6135, 0.128, 0.6282, 0.1428]}, {"w": "the", "b": [0.6329, 0.128, 0.6561, 0.1428]}, {"w": "32nd", "b": [0.6608, 0.128, 0.6986, 0.1428]}, {"w": "International", "b": [0.7034, 0.128, 0.8032, 0.1428]}, {"w": "Conference", "b": [0.1483, 0.1431, 0.2348, 0.1579]}, {"w": "on", "b": [0.2396, 0.1431, 0.2585, 0.1579]}, {"w": "Machine", "b": [0.2632, 0.1431, 0.3294, 0.1579]}, {"w": "Learning", "b": [0.3342, 0.1431, 0.4035, 0.1579]}, {"w": "(2015),", "b": [0.4082, 0.1431, 0.4634, 0.1579]}, {"w": "https://arxiv.org/abs/1502.03167.", "b": [0.4681, 0.1431, 0.7183, 0.1579]}]}, {"id": "b_2", "type": "paragraph", "text": "The BatchNormalization layer is typically used after a convolutional or densely connected layer:", "words": [{"w": "The", "b": [0.1294, 0.181, 0.1686, 0.2008]}, {"w": "BatchNormalization", "b": [0.1749, 0.1821, 0.4474, 0.2023]}, {"w": "layer", "b": [0.4537, 0.181, 0.5041, 0.2008]}, {"w": "is", "b": [0.5105, 0.181, 0.5273, 0.2008]}, {"w": "typically", "b": [0.5336, 0.181, 0.6219, 0.2008]}, {"w": "used", "b": [0.6282, 0.181, 0.6744, 0.2008]}, {"w": "after", "b": [0.6807, 0.181, 0.7269, 0.2008]}, {"w": "a", "b": [0.7332, 0.181, 0.7444, 0.2008]}, {"w": "convolutional", "b": [0.1294, 0.2024, 0.2682, 0.2222]}, {"w": "or", "b": [0.2745, 0.2024, 0.2955, 0.2222]}, {"w": "densely", "b": [0.3018, 0.2024, 0.3788, 0.2222]}, {"w": "connected", "b": [0.3852, 0.2024, 0.4874, 0.2222]}, {"w": "layer:", "b": [0.4937, 0.2024, 0.5512, 0.2222]}]}, {"id": "b_3", "type": "paragraph", "text": "conv_model.add(layers.Conv2D(32, 3, activation='relu')) 1 conv_model.add(layers.BatchNormalization()) dense_model.add(layers.Dense(32, activation='relu')) 2 dense_model.add(layers.BatchNormalization())", "words": [{"w": "conv_model.add(layers.Conv2D(32,", "b": [0.1357, 0.2402, 0.499, 0.2553]}, {"w": "3,", "b": [0.5103, 0.2402, 0.533, 0.2553]}, {"w": "activation='relu'))", "b": [0.5444, 0.2402, 0.7601, 0.2553]}, {"w": "1", "b": [0.8283, 0.2402, 0.8396, 0.2553]}, {"w": "conv_model.add(layers.BatchNormalization())", "b": [0.1357, 0.2553, 0.6238, 0.2705]}, {"w": "dense_model.add(layers.Dense(32,", "b": [0.1357, 0.2856, 0.499, 0.3008]}, {"w": "activation='relu'))", "b": [0.5103, 0.2856, 0.726, 0.3008]}, {"w": "2", "b": [0.8283, 0.2856, 0.8396, 0.3008]}, {"w": "dense_model.add(layers.BatchNormalization())", "b": [0.1357, 0.3008, 0.6352, 0.3159]}]}, {"id": "b_4", "type": "paragraph", "text": "1 After a Conv layer 2 After a Dense layer", "words": [{"w": "1", "b": [0.1799, 0.3344, 0.1925, 0.3541]}, {"w": "After", "b": [0.1988, 0.3344, 0.2562, 0.3541]}, {"w": "a", "b": [0.2625, 0.3344, 0.2751, 0.3541]}, {"w": "Conv", "b": [0.2814, 0.3344, 0.3389, 0.3541]}, {"w": "layer", "b": [0.3452, 0.3344, 0.3998, 0.3541]}, {"w": "2", "b": [0.1799, 0.3549, 0.1925, 0.3746]}, {"w": "After", "b": [0.1988, 0.3549, 0.2562, 0.3746]}, {"w": "a", "b": [0.2625, 0.3549, 0.2751, 0.3746]}, {"w": "Dense", "b": [0.2814, 0.3549, 0.3459, 0.3746]}, {"w": "layer", "b": [0.3522, 0.3549, 0.4068, 0.3746]}]}, {"id": "b_5", "type": "paragraph", "text": "The BatchNormalization layer takes an axis argument, which specifies the feature axis that should be normalized. This argument defaults to -1, the last axis in the input tensor. This is the correct value when using Dense layers, Conv1D layers, RNN layers, and Conv2D layers with data_format set to \"channels_last\". But in the niche use case of Conv2D layers with data_format set to \"channels_first\", the features axis is axis 1; the axis argument in BatchNormalization should accordingly be set to 1.", "words": [{"w": "The", "b": [0.1294, 0.3976, 0.1686, 0.4174]}, {"w": "BatchNormalization", "b": [0.1749, 0.3987, 0.4474, 0.4189]}, {"w": "layer", "b": [0.4537, 0.3976, 0.5041, 0.4174]}, {"w": "takes", "b": [0.5105, 0.3976, 0.5623, 0.4174]}, {"w": "an", "b": [0.5686, 0.3976, 0.5924, 0.4174]}, {"w": "axis", "b": [0.5987, 0.3987, 0.6592, 0.4189]}, {"w": "argument,", "b": [0.6655, 0.3976, 0.7667, 0.4174]}, {"w": "which", "b": [0.773, 0.3976, 0.8346, 0.4174]}, {"w": "specifies", "b": [0.1294, 0.419, 0.2177, 0.4388]}, {"w": "the", "b": [0.224, 0.419, 0.2548, 0.4388]}, {"w": "feature", "b": [0.2611, 0.419, 0.3311, 0.4388]}, {"w": "axis", "b": [0.3374, 0.419, 0.3781, 0.4388]}, {"w": "that", "b": [0.3844, 0.419, 0.4222, 0.4388]}, {"w": "should", "b": [0.4285, 0.419, 0.4958, 0.4388]}, {"w": "be", "b": [0.5021, 0.419, 0.5259, 0.4388]}, {"w": "normalized.", "b": [0.5322, 0.419, 0.652, 0.4388]}, {"w": "This", "b": [0.6583, 0.419, 0.7032, 0.4388]}, {"w": "argument", "b": [0.7095, 0.419, 0.8042, 0.4388]}, {"w": "defaults", "b": [0.1294, 0.4395, 0.2093, 0.4593]}, {"w": "to", "b": [0.2156, 0.4395, 0.2352, 0.4593]}, {"w": "-1,", "b": [0.2415, 0.4395, 0.2688, 0.4593]}, {"w": "the", "b": [0.2751, 0.4395, 0.306, 0.4593]}, {"w": "last", "b": [0.3123, 0.4395, 0.3473, 0.4593]}, {"w": "axis", "b": [0.3536, 0.4395, 0.3943, 0.4593]}, {"w": "in", "b": [0.4006, 0.4395, 0.4202, 0.4593]}, {"w": "the", "b": [0.4265, 0.4395, 0.4573, 0.4593]}, {"w": "input", "b": [0.4636, 0.4395, 0.5154, 0.4593]}, {"w": "tensor.", "b": [0.5217, 0.4395, 0.5883, 0.4593]}, {"w": "This", "b": [0.5946, 0.4395, 0.6395, 0.4593]}, {"w": "is", "b": [0.6458, 0.4395, 0.6626, 0.4593]}, {"w": "the", "b": [0.6689, 0.4395, 0.6997, 0.4593]}, {"w": "correct", "b": [0.706, 0.4395, 0.7761, 0.4593]}, {"w": "value", "b": [0.7824, 0.4395, 0.837, 0.4593]}, {"w": "when", "b": [0.1294, 0.46, 0.1841, 0.4798]}, {"w": "using", "b": [0.1904, 0.46, 0.245, 0.4798]}, {"w": "Dense", "b": [0.2513, 0.4611, 0.327, 0.4813]}, {"w": "layers,", "b": [0.3333, 0.46, 0.3999, 0.4798]}, {"w": "Conv1D", "b": [0.4061, 0.4611, 0.497, 0.4813]}, {"w": "layers,", "b": [0.5033, 0.46, 0.5698, 0.4798]}, {"w": "RNN", "b": [0.5761, 0.46, 0.6294, 0.4798]}, {"w": "layers,", "b": [0.6357, 0.46, 0.7022, 0.4798]}, {"w": "and", "b": [0.7085, 0.46, 0.745, 0.4798]}, {"w": "Conv2D", "b": [0.7512, 0.4611, 0.8421, 0.4813]}, {"w": "layers", "b": [0.1294, 0.4814, 0.1897, 0.5012]}, {"w": "with", "b": [0.196, 0.4814, 0.2408, 0.5012]}, {"w": "data_format", "b": [0.2471, 0.4825, 0.4136, 0.5027]}, {"w": "set", "b": [0.4199, 0.4814, 0.4479, 0.5012]}, {"w": "to", "b": [0.4542, 0.4814, 0.4739, 0.5012]}, {"w": "\"channels_last\".", "b": [0.4801, 0.4814, 0.7135, 0.5027]}, {"w": "But", "b": [0.7198, 0.4814, 0.7563, 0.5012]}, {"w": "in", "b": [0.7626, 0.4814, 0.7822, 0.5012]}, {"w": "the", "b": [0.7885, 0.4814, 0.8193, 0.5012]}, {"w": "niche", "b": [0.1294, 0.5028, 0.1841, 0.5226]}, {"w": "use", "b": [0.1904, 0.5028, 0.224, 0.5226]}, {"w": "case", "b": [0.2303, 0.5028, 0.2737, 0.5226]}, {"w": "of", "b": [0.28, 0.5028, 0.301, 0.5226]}, {"w": "Conv2D", "b": [0.3073, 0.5039, 0.3981, 0.524]}, {"w": "layers", "b": [0.4044, 0.5028, 0.4647, 0.5226]}, {"w": "with", "b": [0.471, 0.5028, 0.5158, 0.5226]}, {"w": "data_format", "b": [0.5221, 0.5039, 0.6886, 0.524]}, {"w": "set", "b": [0.6949, 0.5028, 0.7229, 0.5226]}, {"w": "to", "b": [0.7292, 0.5028, 0.7489, 0.5226]}, {"w": "\"channels_first\",", "b": [0.1294, 0.5242, 0.3779, 0.5454]}, {"w": "the", "b": [0.3842, 0.5242, 0.4151, 0.5439]}, {"w": "features", "b": [0.4214, 0.5242, 0.5012, 0.5439]}, {"w": "axis", "b": [0.5075, 0.5242, 0.5481, 0.5439]}, {"w": "is", "b": [0.5545, 0.5242, 0.5713, 0.5439]}, {"w": "axis", "b": [0.5776, 0.5242, 0.6182, 0.5439]}, {"w": "1;", "b": [0.6245, 0.5242, 0.6442, 0.5439]}, {"w": "the", "b": [0.6505, 0.5242, 0.6813, 0.5439]}, {"w": "axis", "b": [0.6876, 0.5252, 0.7481, 0.5454]}, {"w": "argument", "b": [0.7544, 0.5242, 0.8492, 0.5439]}, {"w": "in", "b": [0.1294, 0.5456, 0.149, 0.5653]}, {"w": "BatchNormalization", "b": [0.1553, 0.5466, 0.4278, 0.5668]}, {"w": "should", "b": [0.4341, 0.5456, 0.5014, 0.5653]}, {"w": "accordingly", "b": [0.5077, 0.5456, 0.6268, 0.5653]}, {"w": "be", "b": [0.6331, 0.5456, 0.6569, 0.5653]}, {"w": "set", "b": [0.6632, 0.5456, 0.6912, 0.5653]}, {"w": "to", "b": [0.6975, 0.5456, 0.7172, 0.5653]}, {"w": "1.", "b": [0.7235, 0.5456, 0.7424, 0.5653]}]}, {"id": "b_6", "type": "paragraph", "text": "Batch renormalization", "words": [{"w": "Batch", "b": [0.1294, 0.5937, 0.1925, 0.6135]}, {"w": "renormalization", "b": [0.1988, 0.5937, 0.3721, 0.6135]}]}, {"id": "b_7", "type": "paragraph", "text": "A recent improvement over regular batch normalization is batch renormalization, introduced by Ioffe in 2017.[a] It offers clears benefits over batch normalization, at no apparent cost. At the time of writing, it’s too early to tell whether it will supplant batch normalization—but I think it’s likely. Even more recently, Klambauer et al. introduced self- normalizing neural networks,[b] which manage to keep data normalized after going through any Dense layer by using a specific activation function (selu) and a specific initializer (lecun_normal). This scheme, although highly interesting, is limited to densely connected networks for now, and its usefulness hasn’t yet been broadly replicated.", "words": [{"w": "A", "b": [0.1294, 0.6365, 0.1476, 0.6562]}, {"w": "recent", "b": [0.1539, 0.6365, 0.2156, 0.6562]}, {"w": "improvement", "b": [0.2219, 0.6365, 0.3564, 0.6562]}, {"w": "over", "b": [0.3627, 0.6365, 0.4075, 0.6562]}, {"w": "regular", "b": [0.4138, 0.6365, 0.4853, 0.6562]}, {"w": "batch", "b": [0.4916, 0.6365, 0.5462, 0.6562]}, {"w": "normalization", "b": [0.5525, 0.6365, 0.6927, 0.6562]}, {"w": "is", "b": [0.699, 0.6365, 0.7158, 0.6562]}, {"w": "batch", "b": [0.722, 0.6365, 0.778, 0.6562]}, {"w": "renormalization,", "b": [0.1294, 0.6588, 0.2973, 0.6785]}, {"w": "introduced", "b": [0.3036, 0.6588, 0.4115, 0.6785]}, {"w": "by", "b": [0.4178, 0.6588, 0.4431, 0.6785]}, {"w": "Ioffe", "b": [0.4494, 0.6588, 0.4979, 0.6785]}, {"w": "in", "b": [0.5042, 0.6588, 0.5239, 0.6785]}, {"w": "2017.[a]", "b": [0.5302, 0.6565, 0.6079, 0.6785]}, {"w": "It", "b": [0.6142, 0.6588, 0.6296, 0.6785]}, {"w": "offers", "b": [0.6359, 0.6588, 0.6943, 0.6785]}, {"w": "clears", "b": [0.7006, 0.6588, 0.7594, 0.6785]}, {"w": "benefits", "b": [0.7657, 0.6588, 0.8456, 0.6785]}, {"w": "over", "b": [0.1294, 0.6793, 0.1742, 0.699]}, {"w": "batch", "b": [0.1805, 0.6793, 0.2352, 0.699]}, {"w": "normalization,", "b": [0.2415, 0.6793, 0.3879, 0.699]}, {"w": "at", "b": [0.3942, 0.6793, 0.4124, 0.699]}, {"w": "no", "b": [0.4188, 0.6793, 0.444, 0.699]}, {"w": "apparent", "b": [0.4503, 0.6793, 0.5371, 0.699]}, {"w": "cost.", "b": [0.5434, 0.6793, 0.5904, 0.699]}, {"w": "At", "b": [0.5967, 0.6793, 0.6219, 0.699]}, {"w": "the", "b": [0.6282, 0.6793, 0.6591, 0.699]}, {"w": "time", "b": [0.6654, 0.6793, 0.7102, 0.699]}, {"w": "of", "b": [0.7165, 0.6793, 0.7375, 0.699]}, {"w": "writing,", "b": [0.7438, 0.6793, 0.823, 0.699]}, {"w": "it’s", "b": [0.8293, 0.6793, 0.8601, 0.699]}, {"w": "too", "b": [0.1294, 0.6998, 0.1617, 0.7195]}, {"w": "early", "b": [0.168, 0.6998, 0.2184, 0.7195]}, {"w": "to", "b": [0.2247, 0.6998, 0.2443, 0.7195]}, {"w": "tell", "b": [0.2506, 0.6998, 0.2829, 0.7195]}, {"w": "whether", "b": [0.2892, 0.6998, 0.3704, 0.7195]}, {"w": "it", "b": [0.3767, 0.6998, 0.3907, 0.7195]}, {"w": "will", "b": [0.397, 0.6998, 0.4362, 0.7195]}, {"w": "supplant", "b": [0.4426, 0.6998, 0.528, 0.7195]}, {"w": "batch", "b": [0.5344, 0.6998, 0.589, 0.7195]}, {"w": "normalization—but", "b": [0.5953, 0.6998, 0.7929, 0.7195]}, {"w": "I", "b": [0.7992, 0.6998, 0.8076, 0.7195]}, {"w": "think", "b": [0.8139, 0.6998, 0.8658, 0.7195]}, {"w": "it’s", "b": [0.1294, 0.7203, 0.1603, 0.74]}, {"w": "likely.", "b": [0.1666, 0.7203, 0.2287, 0.74]}, {"w": "Even", "b": [0.235, 0.7203, 0.2868, 0.74]}, {"w": "more", "b": [0.2931, 0.7203, 0.345, 0.74]}, {"w": "recently,", "b": [0.3513, 0.7203, 0.4372, 0.74]}, {"w": "Klambauer", "b": [0.4435, 0.7203, 0.5555, 0.74]}, {"w": "et", "b": [0.5618, 0.7203, 0.5801, 0.74]}, {"w": "al.", "b": [0.5864, 0.7203, 0.6109, 0.74]}, {"w": "introduced", "b": [0.6172, 0.7203, 0.7251, 0.74]}, {"w": "self-", "b": [0.7313, 0.7203, 0.7748, 0.74]}, {"w": "normalizing", "b": [0.1294, 0.7426, 0.2514, 0.7623]}, {"w": "neural", "b": [0.2577, 0.7426, 0.3235, 0.7623]}, {"w": "networks,[b]", "b": [0.3298, 0.7403, 0.4493, 0.7623]}, {"w": "which", "b": [0.4556, 0.7426, 0.5172, 0.7623]}, {"w": "manage", "b": [0.5235, 0.7426, 0.602, 0.7623]}, {"w": "to", "b": [0.6083, 0.7426, 0.6279, 0.7623]}, {"w": "keep", "b": [0.6342, 0.7426, 0.6818, 0.7623]}, {"w": "data", "b": [0.6881, 0.7426, 0.7302, 0.7623]}, {"w": "normalized", "b": [0.7365, 0.7426, 0.85, 0.7623]}, {"w": "after", "b": [0.1294, 0.7631, 0.1756, 0.7828]}, {"w": "going", "b": [0.1819, 0.7631, 0.2394, 0.7828]}, {"w": "through", "b": [0.2457, 0.7631, 0.3242, 0.7828]}, {"w": "any", "b": [0.3305, 0.7631, 0.3669, 0.7828]}, {"w": "Dense", "b": [0.3732, 0.7641, 0.4489, 0.7843]}, {"w": "layer", "b": [0.4552, 0.7631, 0.5056, 0.7828]}, {"w": "by", "b": [0.5119, 0.7631, 0.5371, 0.7828]}, {"w": "using", "b": [0.5434, 0.7631, 0.5981, 0.7828]}, {"w": "a", "b": [0.6044, 0.7631, 0.6156, 0.7828]}, {"w": "specific", "b": [0.6219, 0.7631, 0.7004, 0.7828]}, {"w": "activation", "b": [0.7067, 0.7631, 0.8062, 0.7828]}, {"w": "function", "b": [0.1294, 0.7845, 0.2135, 0.8042]}, {"w": "(selu)", "b": [0.2198, 0.7845, 0.2971, 0.8057]}, {"w": "and", "b": [0.3034, 0.7845, 0.3398, 0.8042]}, {"w": "a", "b": [0.3461, 0.7845, 0.3573, 0.8042]}, {"w": "specific", "b": [0.3637, 0.7845, 0.4421, 0.8042]}, {"w": "initializer", "b": [0.4484, 0.7845, 0.5451, 0.8042]}, {"w": "(lecun_normal).", "b": [0.5514, 0.7845, 0.7561, 0.8057]}, {"w": "This", "b": [0.7624, 0.7845, 0.8073, 0.8042]}, {"w": "scheme,", "b": [0.1294, 0.8059, 0.2114, 0.8256]}, {"w": "although", "b": [0.2177, 0.8059, 0.306, 0.8256]}, {"w": "highly", "b": [0.3123, 0.8059, 0.3768, 0.8256]}, {"w": "interesting,", "b": [0.3831, 0.8059, 0.4959, 0.8256]}, {"w": "is", "b": [0.5022, 0.8059, 0.519, 0.8256]}, {"w": "limited", "b": [0.5253, 0.8059, 0.5968, 0.8256]}, {"w": "to", "b": [0.6031, 0.8059, 0.6227, 0.8256]}, {"w": "densely", "b": [0.629, 0.8059, 0.7061, 0.8256]}, {"w": "connected", "b": [0.7124, 0.8059, 0.8147, 0.8256]}, {"w": "networks", "b": [0.1294, 0.8264, 0.2219, 0.8461]}, {"w": "for", "b": [0.2282, 0.8264, 0.2576, 0.8461]}, {"w": "now,", "b": [0.2639, 0.8264, 0.312, 0.8461]}, {"w": "and", "b": [0.3183, 0.8264, 0.3548, 0.8461]}, {"w": "its", "b": [0.3611, 0.8264, 0.3849, 0.8461]}, {"w": "usefulness", "b": [0.3912, 0.8264, 0.4963, 0.8461]}, {"w": "hasn’t", "b": [0.5026, 0.8264, 0.5638, 0.8461]}, {"w": "yet", "b": [0.5701, 0.8264, 0.6009, 0.8461]}, {"w": "been", "b": [0.6072, 0.8264, 0.6548, 0.8461]}, {"w": "broadly", "b": [0.6612, 0.8264, 0.7382, 0.8461]}, {"w": "replicated.", "b": [0.7445, 0.8264, 0.8503, 0.8461]}]}]}, {"page": 342, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Sergey Ioffe, “Batch Renormalization: Towards Reducing Minibatch Dependence in Batch- Normalized Models” (2017), https://arxiv.org/abs/1702.03275.", "words": [{"w": "Sergey", "b": [0.1483, 0.0852, 0.2005, 0.1]}, {"w": "Ioffe,", "b": [0.2053, 0.0852, 0.2464, 0.1]}, {"w": "“Batch", "b": [0.2511, 0.0852, 0.3037, 0.1]}, {"w": "Renormalization:", "b": [0.3084, 0.0852, 0.4398, 0.1]}, {"w": "Towards", "b": [0.4445, 0.0852, 0.5093, 0.1]}, {"w": "Reducing", "b": [0.5141, 0.0852, 0.5866, 0.1]}, {"w": "Minibatch", "b": [0.5913, 0.0852, 0.6691, 0.1]}, {"w": "Dependence", "b": [0.6738, 0.0852, 0.7673, 0.1]}, {"w": "in", "b": [0.7721, 0.0852, 0.7868, 0.1]}, {"w": "Batch-", "b": [0.7915, 0.0852, 0.8419, 0.1]}, {"w": "Normalized", "b": [0.1483, 0.1003, 0.2376, 0.1151]}, {"w": "Models”", "b": [0.2424, 0.1003, 0.3075, 0.1151]}, {"w": "(2017),", "b": [0.3123, 0.1003, 0.3674, 0.1151]}, {"w": "https://arxiv.org/abs/1702.03275.", "b": [0.3721, 0.1003, 0.6223, 0.1151]}]}, {"id": "b_2", "type": "paragraph", "text": "Günter Klambauer et al., “Self-Normalizing Neural Networks,” Conference on Neural Information Processing Systems (2017), https://arxiv.org/abs/1706.02515.", "words": [{"w": "Günter", "b": [0.1483, 0.1565, 0.2009, 0.1713]}, {"w": "Klambauer", "b": [0.2056, 0.1565, 0.2897, 0.1713]}, {"w": "et", "b": [0.2944, 0.1565, 0.308, 0.1713]}, {"w": "al.,", "b": [0.3128, 0.1565, 0.3359, 0.1713]}, {"w": "“Self-Normalizing", "b": [0.3406, 0.1565, 0.4814, 0.1713]}, {"w": "Neural", "b": [0.4862, 0.1565, 0.5377, 0.1713]}, {"w": "Networks,”", "b": [0.5424, 0.1565, 0.6291, 0.1713]}, {"w": "Conference", "b": [0.6338, 0.1565, 0.721, 0.1713]}, {"w": "on", "b": [0.7257, 0.1565, 0.7446, 0.1713]}, {"w": "Neural", "b": [0.7494, 0.1565, 0.8009, 0.1713]}, {"w": "Information", "b": [0.1483, 0.1716, 0.2387, 0.1865]}, {"w": "Processing", "b": [0.2434, 0.1716, 0.3254, 0.1865]}, {"w": "Systems", "b": [0.3301, 0.1716, 0.3932, 0.1865]}, {"w": "(2017),", "b": [0.398, 0.1716, 0.4531, 0.1865]}, {"w": "https://arxiv.org/abs/1706.02515.", "b": [0.4578, 0.1716, 0.708, 0.1865]}]}, {"id": "b_3", "type": "paragraph", "text": "Depthwise separable convolution", "words": [{"w": "Depthwise", "b": [0.1294, 0.2109, 0.2135, 0.2257]}, {"w": "separable", "b": [0.2182, 0.2109, 0.296, 0.2257]}, {"w": "convolution", "b": [0.3007, 0.2109, 0.3953, 0.2257]}]}, {"id": "b_4", "type": "paragraph", "text": "What if I told you that there’s a layer you can use as a drop-in replacement for Conv2D that will make your model lighter (fewer trainable weight parameters) and faster (fewer floating-point operations) and cause it to perform a few percentage points better on its task? That is precisely what the depthwise separable convolution layer does (- SeparableConv2D). This layer performs a spatial convolution on each channel of its input, independently, before mixing output channels via a pointwise convolution (a 1 × 1 convolution), as shown in figure 7.16. This is equivalent to separating the learning of spatial features and the learning of channel-wise features, which makes a lot of sense if you assume that spatial locations in the input are highly correlated, but different channels are fairly independent. It requires significantly fewer parameters and involves fewer computations, thus resulting in smaller, speedier models. And because it’s a more representationally efficient way to perform convolution, it tends to learn better representations using less data, resulting in better-performing models.", "words": [{"w": "What", "b": [0.1294, 0.2488, 0.1841, 0.2685]}, {"w": "if", "b": [0.1904, 0.2488, 0.2058, 0.2685]}, {"w": "I", "b": [0.2121, 0.2488, 0.2205, 0.2685]}, {"w": "told", "b": [0.2268, 0.2488, 0.266, 0.2685]}, {"w": "you", "b": [0.2723, 0.2488, 0.3102, 0.2685]}, {"w": "that", "b": [0.3165, 0.2488, 0.3543, 0.2685]}, {"w": "there’s", "b": [0.3606, 0.2488, 0.4278, 0.2685]}, {"w": "a", "b": [0.4341, 0.2488, 0.4453, 0.2685]}, {"w": "layer", "b": [0.4516, 0.2488, 0.5021, 0.2685]}, {"w": "you", "b": [0.5084, 0.2488, 0.5462, 0.2685]}, {"w": "can", "b": [0.5525, 0.2488, 0.5875, 0.2685]}, {"w": "use", "b": [0.5938, 0.2488, 0.6275, 0.2685]}, {"w": "as", "b": [0.6338, 0.2488, 0.6548, 0.2685]}, {"w": "a", "b": [0.6611, 0.2488, 0.6723, 0.2685]}, {"w": "drop-in", "b": [0.6786, 0.2488, 0.7529, 0.2685]}, {"w": "replacement", "b": [0.1294, 0.2693, 0.2527, 0.289]}, {"w": "for", "b": [0.259, 0.2693, 0.2884, 0.289]}, {"w": "Conv2D", "b": [0.2947, 0.2703, 0.3855, 0.2905]}, {"w": "that", "b": [0.3918, 0.2693, 0.4296, 0.289]}, {"w": "will", "b": [0.4359, 0.2693, 0.4752, 0.289]}, {"w": "make", "b": [0.4815, 0.2693, 0.5361, 0.289]}, {"w": "your", "b": [0.5424, 0.2693, 0.5887, 0.289]}, {"w": "model", "b": [0.595, 0.2693, 0.6581, 0.289]}, {"w": "lighter", "b": [0.6644, 0.2693, 0.7302, 0.289]}, {"w": "(fewer", "b": [0.7365, 0.2693, 0.8023, 0.289]}, {"w": "trainable", "b": [0.1294, 0.2907, 0.2177, 0.3104]}, {"w": "weight", "b": [0.224, 0.2907, 0.2926, 0.3104]}, {"w": "parameters)", "b": [0.299, 0.2907, 0.418, 0.3104]}, {"w": "and", "b": [0.4243, 0.2907, 0.4608, 0.3104]}, {"w": "faster", "b": [0.4671, 0.2907, 0.5231, 0.3104]}, {"w": "(fewer", "b": [0.5294, 0.2907, 0.5952, 0.3104]}, {"w": "floating-point", "b": [0.6015, 0.2907, 0.7403, 0.3104]}, {"w": "operations)", "b": [0.7466, 0.2907, 0.8601, 0.3104]}, {"w": "and", "b": [0.1294, 0.3112, 0.1658, 0.3309]}, {"w": "cause", "b": [0.1721, 0.3112, 0.2282, 0.3309]}, {"w": "it", "b": [0.2345, 0.3112, 0.2485, 0.3309]}, {"w": "to", "b": [0.2548, 0.3112, 0.2744, 0.3309]}, {"w": "perform", "b": [0.2807, 0.3112, 0.362, 0.3309]}, {"w": "a", "b": [0.3683, 0.3112, 0.3795, 0.3309]}, {"w": "few", "b": [0.3858, 0.3112, 0.4236, 0.3309]}, {"w": "percentage", "b": [0.4299, 0.3112, 0.5392, 0.3309]}, {"w": "points", "b": [0.5455, 0.3112, 0.6071, 0.3309]}, {"w": "better", "b": [0.6134, 0.3112, 0.6709, 0.3309]}, {"w": "on", "b": [0.6772, 0.3112, 0.7024, 0.3309]}, {"w": "its", "b": [0.7087, 0.3112, 0.7326, 0.3309]}, {"w": "task?", "b": [0.7389, 0.3112, 0.7907, 0.3309]}, {"w": "That", "b": [0.797, 0.3112, 0.8433, 0.3309]}, {"w": "is", "b": [0.8496, 0.3112, 0.8664, 0.3309]}, {"w": "precisely", "b": [0.1294, 0.3317, 0.2205, 0.3514]}, {"w": "what", "b": [0.2268, 0.3317, 0.2758, 0.3514]}, {"w": "the", "b": [0.2821, 0.3317, 0.313, 0.3514]}, {"w": "depthwise", "b": [0.3192, 0.3317, 0.4201, 0.3514]}, {"w": "separable", "b": [0.4264, 0.3317, 0.5259, 0.3514]}, {"w": "convolution", "b": [0.5322, 0.3317, 0.6513, 0.3514]}, {"w": "layer", "b": [0.6576, 0.3317, 0.708, 0.3514]}, {"w": "does", "b": [0.7143, 0.3317, 0.7606, 0.3514]}, {"w": "(-", "b": [0.7669, 0.3317, 0.7837, 0.3514]}, {"w": "SeparableConv2D).", "b": [0.1294, 0.3522, 0.3712, 0.3734]}, {"w": "This", "b": [0.3775, 0.3522, 0.4223, 0.3719]}, {"w": "layer", "b": [0.4286, 0.3522, 0.4791, 0.3719]}, {"w": "performs", "b": [0.4854, 0.3522, 0.5764, 0.3719]}, {"w": "a", "b": [0.5827, 0.3522, 0.5939, 0.3719]}, {"w": "spatial", "b": [0.6002, 0.3522, 0.6661, 0.3719]}, {"w": "convolution", "b": [0.6724, 0.3522, 0.7929, 0.3719]}, {"w": "on", "b": [0.7993, 0.3522, 0.8245, 0.3719]}, {"w": "each", "b": [0.1294, 0.3736, 0.1756, 0.3933]}, {"w": "channel", "b": [0.1819, 0.3736, 0.2604, 0.3933]}, {"w": "of", "b": [0.2667, 0.3736, 0.2877, 0.3933]}, {"w": "its", "b": [0.294, 0.3736, 0.3178, 0.3933]}, {"w": "input,", "b": [0.3242, 0.3736, 0.3823, 0.3933]}, {"w": "independently,", "b": [0.3886, 0.3736, 0.5362, 0.3933]}, {"w": "before", "b": [0.5425, 0.3736, 0.6069, 0.3933]}, {"w": "mixing", "b": [0.6132, 0.3736, 0.6847, 0.3933]}, {"w": "output", "b": [0.691, 0.3736, 0.7555, 0.3933]}, {"w": "channels", "b": [0.7618, 0.3736, 0.85, 0.3933]}, {"w": "via", "b": [0.1294, 0.3941, 0.1602, 0.4138]}, {"w": "a", "b": [0.1665, 0.3941, 0.1777, 0.4138]}, {"w": "pointwise", "b": [0.184, 0.3941, 0.2821, 0.4138]}, {"w": "convolution", "b": [0.2884, 0.3941, 0.409, 0.4138]}, {"w": "(a", "b": [0.4153, 0.3941, 0.4349, 0.4138]}, {"w": "1", "b": [0.4412, 0.3941, 0.4538, 0.4138]}, {"w": "×", "b": [0.4601, 0.3941, 0.4743, 0.4138]}, {"w": "1", "b": [0.4806, 0.3941, 0.4932, 0.4138]}, {"w": "convolution),", "b": [0.4996, 0.3941, 0.6348, 0.4138]}, {"w": "as", "b": [0.6411, 0.3941, 0.6621, 0.4138]}, {"w": "shown", "b": [0.6684, 0.3941, 0.7343, 0.4138]}, {"w": "in", "b": [0.7406, 0.3941, 0.7602, 0.4138]}, {"w": "figure", "b": [0.7665, 0.3941, 0.8267, 0.4138]}, {"w": "7.16.", "b": [0.1294, 0.4146, 0.1799, 0.4343]}, {"w": "This", "b": [0.1862, 0.4146, 0.231, 0.4343]}, {"w": "is", "b": [0.2373, 0.4146, 0.2542, 0.4343]}, {"w": "equivalent", "b": [0.2605, 0.4146, 0.3656, 0.4343]}, {"w": "to", "b": [0.3719, 0.4146, 0.3915, 0.4343]}, {"w": "separating", "b": [0.3978, 0.4146, 0.5015, 0.4343]}, {"w": "the", "b": [0.5078, 0.4146, 0.5386, 0.4343]}, {"w": "learning", "b": [0.5449, 0.4146, 0.6276, 0.4343]}, {"w": "of", "b": [0.6339, 0.4146, 0.6549, 0.4343]}, {"w": "spatial", "b": [0.6612, 0.4146, 0.7271, 0.4343]}, {"w": "features", "b": [0.7334, 0.4146, 0.8132, 0.4343]}, {"w": "and", "b": [0.8195, 0.4146, 0.8559, 0.4343]}, {"w": "the", "b": [0.1294, 0.4351, 0.1602, 0.4548]}, {"w": "learning", "b": [0.1665, 0.4351, 0.2492, 0.4548]}, {"w": "of", "b": [0.2555, 0.4351, 0.2765, 0.4548]}, {"w": "channel-wise", "b": [0.2828, 0.4351, 0.4159, 0.4548]}, {"w": "features,", "b": [0.4222, 0.4351, 0.5084, 0.4548]}, {"w": "which", "b": [0.5147, 0.4351, 0.5763, 0.4548]}, {"w": "makes", "b": [0.5826, 0.4351, 0.6471, 0.4548]}, {"w": "a", "b": [0.6533, 0.4351, 0.6645, 0.4548]}, {"w": "lot", "b": [0.6708, 0.4351, 0.6975, 0.4548]}, {"w": "of", "b": [0.7038, 0.4351, 0.7248, 0.4548]}, {"w": "sense", "b": [0.7311, 0.4351, 0.7857, 0.4548]}, {"w": "if", "b": [0.7921, 0.4351, 0.8075, 0.4548]}, {"w": "you", "b": [0.8138, 0.4351, 0.8516, 0.4548]}, {"w": "assume", "b": [0.1294, 0.4556, 0.2037, 0.4753]}, {"w": "that", "b": [0.21, 0.4556, 0.2478, 0.4753]}, {"w": "spatial", "b": [0.2541, 0.4556, 0.32, 0.4753]}, {"w": "locations", "b": [0.3263, 0.4556, 0.4174, 0.4753]}, {"w": "in", "b": [0.4237, 0.4556, 0.4433, 0.4753]}, {"w": "the", "b": [0.4496, 0.4556, 0.4805, 0.4753]}, {"w": "input", "b": [0.4868, 0.4556, 0.5386, 0.4753]}, {"w": "are", "b": [0.5449, 0.4556, 0.5757, 0.4753]}, {"w": "highly", "b": [0.582, 0.4556, 0.6465, 0.4753]}, {"w": "correlated,", "b": [0.6528, 0.4556, 0.76, 0.4753]}, {"w": "but", "b": [0.7663, 0.4556, 0.7985, 0.4753]}, {"w": "different", "b": [0.1294, 0.4761, 0.2158, 0.4958]}, {"w": "channels", "b": [0.2221, 0.4761, 0.3104, 0.4958]}, {"w": "are", "b": [0.3167, 0.4761, 0.3475, 0.4958]}, {"w": "fairly", "b": [0.3538, 0.4761, 0.4084, 0.4958]}, {"w": "independent.", "b": [0.4147, 0.4761, 0.5443, 0.4958]}, {"w": "It", "b": [0.5506, 0.4761, 0.566, 0.4958]}, {"w": "requires", "b": [0.5723, 0.4761, 0.6536, 0.4958]}, {"w": "significantly", "b": [0.6599, 0.4761, 0.786, 0.4958]}, {"w": "fewer", "b": [0.7923, 0.4761, 0.8497, 0.4958]}, {"w": "parameters", "b": [0.1294, 0.4966, 0.2401, 0.5163]}, {"w": "and", "b": [0.2464, 0.4966, 0.2828, 0.5163]}, {"w": "involves", "b": [0.2891, 0.4966, 0.3746, 0.5163]}, {"w": "fewer", "b": [0.3809, 0.4966, 0.4383, 0.5163]}, {"w": "computations,", "b": [0.4446, 0.4966, 0.5868, 0.5163]}, {"w": "thus", "b": [0.5932, 0.4966, 0.6352, 0.5163]}, {"w": "resulting", "b": [0.6415, 0.4966, 0.7298, 0.5163]}, {"w": "in", "b": [0.7361, 0.4966, 0.7557, 0.5163]}, {"w": "smaller,", "b": [0.762, 0.4966, 0.8415, 0.5163]}, {"w": "speedier", "b": [0.1294, 0.5171, 0.2135, 0.5368]}, {"w": "models.", "b": [0.2198, 0.5171, 0.299, 0.5368]}, {"w": "And", "b": [0.3053, 0.5171, 0.3487, 0.5368]}, {"w": "because", "b": [0.355, 0.5171, 0.4348, 0.5368]}, {"w": "it’s", "b": [0.4412, 0.5171, 0.472, 0.5368]}, {"w": "a", "b": [0.4783, 0.5171, 0.4895, 0.5368]}, {"w": "more", "b": [0.4958, 0.5171, 0.5476, 0.5368]}, {"w": "representationally", "b": [0.5539, 0.5171, 0.7347, 0.5368]}, {"w": "efficient", "b": [0.741, 0.5171, 0.8245, 0.5368]}, {"w": "way", "b": [0.1294, 0.5376, 0.1714, 0.5573]}, {"w": "to", "b": [0.1777, 0.5376, 0.1974, 0.5573]}, {"w": "perform", "b": [0.2037, 0.5376, 0.2849, 0.5573]}, {"w": "convolution,", "b": [0.2912, 0.5376, 0.4181, 0.5573]}, {"w": "it", "b": [0.4244, 0.5376, 0.4384, 0.5573]}, {"w": "tends", "b": [0.4447, 0.5376, 0.498, 0.5573]}, {"w": "to", "b": [0.5043, 0.5376, 0.5239, 0.5573]}, {"w": "learn", "b": [0.5302, 0.5376, 0.5806, 0.5573]}, {"w": "better", "b": [0.5869, 0.5376, 0.6444, 0.5573]}, {"w": "representations", "b": [0.6507, 0.5376, 0.8034, 0.5573]}, {"w": "using", "b": [0.8097, 0.5376, 0.8644, 0.5573]}, {"w": "less", "b": [0.1294, 0.5581, 0.1673, 0.5778]}, {"w": "data,", "b": [0.1736, 0.5581, 0.2219, 0.5778]}, {"w": "resulting", "b": [0.2282, 0.5581, 0.3165, 0.5778]}, {"w": "in", "b": [0.3228, 0.5581, 0.3424, 0.5778]}, {"w": "better-performing", "b": [0.3487, 0.5581, 0.5275, 0.5778]}, {"w": "models.", "b": [0.5338, 0.5581, 0.613, 0.5778]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 7.16. Depthwise separable convolution: a depthwise convolution followed by a pointwise convolution", "words": [{"w": "Figure", "b": [0.1294, 0.5959, 0.1827, 0.6107]}, {"w": "7.16.", "b": [0.1874, 0.5959, 0.2252, 0.6107]}, {"w": "Depthwise", "b": [0.2299, 0.5959, 0.314, 0.6107]}, {"w": "separable", "b": [0.3187, 0.5959, 0.3965, 0.6107]}, {"w": "convolution:", "b": [0.4013, 0.5959, 0.5022, 0.6107]}, {"w": "a", "b": [0.5069, 0.5959, 0.5164, 0.6107]}, {"w": "depthwise", "b": [0.5211, 0.5959, 0.602, 0.6107]}, {"w": "convolution", "b": [0.6068, 0.5959, 0.7014, 0.6107]}, {"w": "followed", "b": [0.7061, 0.5959, 0.7744, 0.6107]}, {"w": "by", "b": [0.7791, 0.5959, 0.7991, 0.6107]}, {"w": "a", "b": [0.8039, 0.5959, 0.8133, 0.6107]}, {"w": "pointwise", "b": [0.1294, 0.6111, 0.2061, 0.6259]}, {"w": "convolution", "b": [0.2109, 0.6111, 0.3055, 0.6259]}]}]}, {"page": 343, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "These advantages become especially important when you’re training small models from scratch on limited data. For instance, here’s how you can build a lightweight, depthwise separable convnet for an image- classification task (softmax categorical classification) on a small dataset:", "words": [{"w": "These", "b": [0.1294, 0.0857, 0.1897, 0.1054]}, {"w": "advantages", "b": [0.196, 0.0857, 0.308, 0.1054]}, {"w": "become", "b": [0.3143, 0.0857, 0.3928, 0.1054]}, {"w": "especially", "b": [0.3991, 0.0857, 0.5, 0.1054]}, {"w": "important", "b": [0.5063, 0.0857, 0.6044, 0.1054]}, {"w": "when", "b": [0.6107, 0.0857, 0.6653, 0.1054]}, {"w": "you’re", "b": [0.6716, 0.0857, 0.7375, 0.1054]}, {"w": "training", "b": [0.7438, 0.0857, 0.8223, 0.1054]}, {"w": "small", "b": [0.1294, 0.1062, 0.1841, 0.1259]}, {"w": "models", "b": [0.1904, 0.1062, 0.2633, 0.1259]}, {"w": "from", "b": [0.2696, 0.1062, 0.3186, 0.1259]}, {"w": "scratch", "b": [0.3249, 0.1062, 0.3964, 0.1259]}, {"w": "on", "b": [0.4027, 0.1062, 0.4279, 0.1259]}, {"w": "limited", "b": [0.4342, 0.1062, 0.5057, 0.1259]}, {"w": "data.", "b": [0.512, 0.1062, 0.5603, 0.1259]}, {"w": "For", "b": [0.5666, 0.1062, 0.6017, 0.1259]}, {"w": "instance,", "b": [0.608, 0.1062, 0.6969, 0.1259]}, {"w": "here’s", "b": [0.7032, 0.1062, 0.7634, 0.1259]}, {"w": "how", "b": [0.7697, 0.1062, 0.8131, 0.1259]}, {"w": "you", "b": [0.8194, 0.1062, 0.8573, 0.1259]}, {"w": "can", "b": [0.1294, 0.1267, 0.1644, 0.1464]}, {"w": "build", "b": [0.1707, 0.1267, 0.2226, 0.1464]}, {"w": "a", "b": [0.2289, 0.1267, 0.2401, 0.1464]}, {"w": "lightweight,", "b": [0.2464, 0.1267, 0.3676, 0.1464]}, {"w": "depthwise", "b": [0.374, 0.1267, 0.4762, 0.1464]}, {"w": "separable", "b": [0.4825, 0.1267, 0.5778, 0.1464]}, {"w": "convnet", "b": [0.5841, 0.1267, 0.664, 0.1464]}, {"w": "for", "b": [0.6703, 0.1267, 0.6997, 0.1464]}, {"w": "an", "b": [0.706, 0.1267, 0.7298, 0.1464]}, {"w": "image-", "b": [0.7361, 0.1267, 0.8062, 0.1464]}, {"w": "classification", "b": [0.1294, 0.1472, 0.2625, 0.1669]}, {"w": "task", "b": [0.2688, 0.1472, 0.3095, 0.1669]}, {"w": "(softmax", "b": [0.3158, 0.1472, 0.4055, 0.1669]}, {"w": "categorical", "b": [0.4118, 0.1472, 0.5224, 0.1669]}, {"w": "classification)", "b": [0.5286, 0.1472, 0.6702, 0.1669]}, {"w": "on", "b": [0.6765, 0.1472, 0.7017, 0.1669]}, {"w": "a", "b": [0.708, 0.1472, 0.7192, 0.1669]}, {"w": "small", "b": [0.7255, 0.1472, 0.7802, 0.1669]}, {"w": "dataset:", "b": [0.7865, 0.1472, 0.8635, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "from keras.models import Sequential, Model from keras import layers height = 64 width = 64 channels = 3 num_classes = 10 model = Sequential() model.add(layers.SeparableConv2D(32, 3, activation='relu', input_shape=(height, width, channels,))) model.add(layers.SeparableConv2D(64, 3, activation='relu')) model.add(layers.MaxPooling2D(2)) model.add(layers.SeparableConv2D(64, 3, activation='relu')) model.add(layers.SeparableConv2D(128, 3, activation='relu')) model.add(layers.MaxPooling2D(2)) model.add(layers.SeparableConv2D(64, 3, activation='relu')) model.add(layers.SeparableConv2D(128, 3, activation='relu')) model.add(layers.GlobalAveragePooling2D()) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(num_classes, activation='softmax')) model.compile(optimizer='rmsprop', loss='categorical_crossentropy')", "words": [{"w": "from", "b": [0.1357, 0.1849, 0.1811, 0.2001]}, {"w": "keras.models", "b": [0.1925, 0.1849, 0.3287, 0.2001]}, {"w": "import", "b": [0.34, 0.1849, 0.4082, 0.2001]}, {"w": "Sequential,", "b": [0.4195, 0.1849, 0.5444, 0.2001]}, {"w": "Model", "b": [0.5557, 0.1849, 0.6125, 0.2001]}, {"w": "from", "b": [0.1357, 0.2001, 0.1811, 0.2152]}, {"w": "keras", "b": [0.1925, 0.2001, 0.2492, 0.2152]}, {"w": "import", "b": [0.2606, 0.2001, 0.3287, 0.2152]}, {"w": "layers", "b": [0.34, 0.2001, 0.4082, 0.2152]}, {"w": "height", "b": [0.1357, 0.2304, 0.2038, 0.2455]}, {"w": "=", "b": [0.2152, 0.2304, 0.2265, 0.2455]}, {"w": "64", "b": [0.2379, 0.2304, 0.2606, 0.2455]}, {"w": "width", "b": [0.1357, 0.2455, 0.1925, 0.2607]}, {"w": "=", "b": [0.2038, 0.2455, 0.2152, 0.2607]}, {"w": "64", "b": [0.2265, 0.2455, 0.2492, 0.2607]}, {"w": "channels", "b": [0.1357, 0.2607, 0.2265, 0.2758]}, {"w": "=", "b": [0.2379, 0.2607, 0.2492, 0.2758]}, {"w": "3", "b": [0.2606, 0.2607, 0.2719, 0.2758]}, {"w": "num_classes", "b": [0.1357, 0.2758, 0.2606, 0.291]}, {"w": "=", "b": [0.2719, 0.2758, 0.2833, 0.291]}, {"w": "10", "b": [0.2946, 0.2758, 0.3173, 0.291]}, {"w": "model", "b": [0.1357, 0.3061, 0.1925, 0.3213]}, {"w": "=", "b": [0.2038, 0.3061, 0.2152, 0.3213]}, {"w": "Sequential()", "b": [0.2265, 0.3061, 0.3628, 0.3213]}, {"w": "model.add(layers.SeparableConv2D(32,", "b": [0.1357, 0.3213, 0.5444, 0.3364]}, {"w": "3,", "b": [0.5557, 0.3213, 0.5784, 0.3364]}, {"w": "activation='relu',", "b": [0.5103, 0.3364, 0.7146, 0.3516]}, {"w": "input_shape=(height,", "b": [0.5103, 0.3516, 0.7374, 0.3667]}, {"w": "width,", "b": [0.7487, 0.3516, 0.8168, 0.3667]}, {"w": "channels,)))", "b": [0.1357, 0.3667, 0.2719, 0.3819]}, {"w": "model.add(layers.SeparableConv2D(64,", "b": [0.1357, 0.3819, 0.5444, 0.397]}, {"w": "3,", "b": [0.5557, 0.3819, 0.5784, 0.397]}, {"w": "activation='relu'))", "b": [0.5898, 0.3819, 0.8055, 0.397]}, {"w": "model.add(layers.MaxPooling2D(2))", "b": [0.1357, 0.397, 0.5103, 0.4122]}, {"w": "model.add(layers.SeparableConv2D(64,", "b": [0.1357, 0.4273, 0.5444, 0.4425]}, {"w": "3,", "b": [0.5557, 0.4273, 0.5784, 0.4425]}, {"w": "activation='relu'))", "b": [0.5898, 0.4273, 0.8055, 0.4425]}, {"w": "model.add(layers.SeparableConv2D(128,", "b": [0.1357, 0.4425, 0.5557, 0.4576]}, {"w": "3,", "b": [0.5671, 0.4425, 0.5898, 0.4576]}, {"w": "activation='relu'))", "b": [0.6011, 0.4425, 0.8168, 0.4576]}, {"w": "model.add(layers.MaxPooling2D(2))", "b": [0.1357, 0.4577, 0.5103, 0.4728]}, {"w": "model.add(layers.SeparableConv2D(64,", "b": [0.1357, 0.488, 0.5444, 0.5031]}, {"w": "3,", "b": [0.5557, 0.488, 0.5784, 0.5031]}, {"w": "activation='relu'))", "b": [0.5898, 0.488, 0.8055, 0.5031]}, {"w": "model.add(layers.SeparableConv2D(128,", "b": [0.1357, 0.5031, 0.5557, 0.5183]}, {"w": "3,", "b": [0.5671, 0.5031, 0.5898, 0.5183]}, {"w": "activation='relu'))", "b": [0.6011, 0.5031, 0.8168, 0.5183]}, {"w": "model.add(layers.GlobalAveragePooling2D())", "b": [0.1357, 0.5183, 0.6125, 0.5334]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.5486, 0.4309, 0.5637]}, {"w": "activation='relu'))", "b": [0.4422, 0.5486, 0.6579, 0.5637]}, {"w": "model.add(layers.Dense(num_classes,", "b": [0.1357, 0.5637, 0.533, 0.5789]}, {"w": "activation='softmax'))", "b": [0.5444, 0.5637, 0.7941, 0.5789]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.594, 0.5217, 0.6092]}, {"w": "loss='categorical_crossentropy')", "b": [0.1357, 0.6092, 0.499, 0.6243]}]}, {"id": "b_2", "type": "paragraph", "text": "When it comes to larger-scale models, depthwise separable convolutions are the basis of the Xception architecture, a high-performing convnet that comes packaged with Keras. You can read more about the theoretical grounding for depthwise separable convolutions and Xception in my paper “Xception: Deep Learning with Depthwise Separable Convolutions.”[8]", "words": [{"w": "When", "b": [0.1294, 0.6472, 0.1897, 0.6669]}, {"w": "it", "b": [0.196, 0.6472, 0.21, 0.6669]}, {"w": "comes", "b": [0.2163, 0.6472, 0.2807, 0.6669]}, {"w": "to", "b": [0.287, 0.6472, 0.3067, 0.6669]}, {"w": "larger-scale", "b": [0.313, 0.6472, 0.4296, 0.6669]}, {"w": "models,", "b": [0.4359, 0.6472, 0.5151, 0.6669]}, {"w": "depthwise", "b": [0.5214, 0.6472, 0.6237, 0.6669]}, {"w": "separable", "b": [0.63, 0.6472, 0.7253, 0.6669]}, {"w": "convolutions", "b": [0.7316, 0.6472, 0.8619, 0.6669]}, {"w": "are", "b": [0.1294, 0.6677, 0.1602, 0.6874]}, {"w": "the", "b": [0.1665, 0.6677, 0.1973, 0.6874]}, {"w": "basis", "b": [0.2037, 0.6677, 0.2541, 0.6874]}, {"w": "of", "b": [0.2604, 0.6677, 0.2814, 0.6874]}, {"w": "the", "b": [0.2877, 0.6677, 0.3186, 0.6874]}, {"w": "Xception", "b": [0.3249, 0.6677, 0.4173, 0.6874]}, {"w": "architecture,", "b": [0.4236, 0.6677, 0.549, 0.6874]}, {"w": "a", "b": [0.5553, 0.6677, 0.5665, 0.6874]}, {"w": "high-performing", "b": [0.5728, 0.6677, 0.7396, 0.6874]}, {"w": "convnet", "b": [0.7458, 0.6677, 0.8257, 0.6874]}, {"w": "that", "b": [0.832, 0.6677, 0.8698, 0.6874]}, {"w": "comes", "b": [0.1294, 0.6882, 0.1939, 0.7079]}, {"w": "packaged", "b": [0.2002, 0.6882, 0.2954, 0.7079]}, {"w": "with", "b": [0.3017, 0.6882, 0.3466, 0.7079]}, {"w": "Keras.", "b": [0.3529, 0.6882, 0.418, 0.7079]}, {"w": "You", "b": [0.4243, 0.6882, 0.4652, 0.7079]}, {"w": "can", "b": [0.4715, 0.6882, 0.5065, 0.7079]}, {"w": "read", "b": [0.5128, 0.6882, 0.5563, 0.7079]}, {"w": "more", "b": [0.5626, 0.6882, 0.6144, 0.7079]}, {"w": "about", "b": [0.6207, 0.6882, 0.6768, 0.7079]}, {"w": "the", "b": [0.6831, 0.6882, 0.7139, 0.7079]}, {"w": "theoretical", "b": [0.7202, 0.6882, 0.8267, 0.7079]}, {"w": "grounding", "b": [0.1294, 0.7087, 0.2331, 0.7284]}, {"w": "for", "b": [0.2394, 0.7087, 0.2688, 0.7284]}, {"w": "depthwise", "b": [0.2751, 0.7087, 0.3774, 0.7284]}, {"w": "separable", "b": [0.3837, 0.7087, 0.479, 0.7284]}, {"w": "convolutions", "b": [0.4853, 0.7087, 0.6156, 0.7284]}, {"w": "and", "b": [0.6219, 0.7087, 0.6583, 0.7284]}, {"w": "Xception", "b": [0.6646, 0.7087, 0.7571, 0.7284]}, {"w": "in", "b": [0.7634, 0.7087, 0.783, 0.7284]}, {"w": "my", "b": [0.7894, 0.7087, 0.8216, 0.7284]}, {"w": "paper", "b": [0.1294, 0.7292, 0.1854, 0.7489]}, {"w": "“Xception:", "b": [0.1917, 0.7292, 0.3024, 0.7489]}, {"w": "Deep", "b": [0.3087, 0.7292, 0.362, 0.7489]}, {"w": "Learning", "b": [0.3683, 0.7292, 0.4593, 0.7489]}, {"w": "with", "b": [0.4656, 0.7292, 0.5105, 0.7489]}, {"w": "Depthwise", "b": [0.5168, 0.7292, 0.6247, 0.7489]}, {"w": "Separable", "b": [0.631, 0.7292, 0.7305, 0.7489]}, {"w": "Convolutions.”[8]", "b": [0.1294, 0.7492, 0.3049, 0.7712]}]}, {"id": "b_4", "type": "paragraph", "text": "See note 5 above.", "words": [{"w": "See", "b": [0.1483, 0.817, 0.1757, 0.8318]}, {"w": "note", "b": [0.1804, 0.817, 0.213, 0.8318]}, {"w": "5", "b": [0.2177, 0.817, 0.2271, 0.8318]}, {"w": "above.", "b": [0.2319, 0.817, 0.2818, 0.8318]}]}, {"id": "b_5", "type": "paragraph", "text": "7.3.2. Hyperparameter optimization", "words": [{"w": "7.3.2.", "b": [0.1294, 0.8593, 0.1862, 0.8791]}, {"w": "Hyperparameter", "b": [0.1925, 0.8593, 0.3746, 0.8791]}, {"w": "optimization", "b": [0.3809, 0.8593, 0.5169, 0.8791]}]}]}, {"page": 344, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "When building a deep-learning model, you have to make many seemingly arbitrary decisions: How many layers should you stack? How many units or filters should go in each layer? Should you use relu as activation, or a different function? Should you use BatchNormalization after a given layer? How much dropout should you use? And so on. These architecture-level parameters are called hyperparameters to distinguish them from the parameters of a model, which are trained via backpropagation.", "words": [{"w": "When", "b": [0.1294, 0.0857, 0.1897, 0.1054]}, {"w": "building", "b": [0.196, 0.0857, 0.2801, 0.1054]}, {"w": "a", "b": [0.2864, 0.0857, 0.2976, 0.1054]}, {"w": "deep-learning", "b": [0.3039, 0.0857, 0.4426, 0.1054]}, {"w": "model,", "b": [0.4489, 0.0857, 0.5182, 0.1054]}, {"w": "you", "b": [0.5245, 0.0857, 0.5624, 0.1054]}, {"w": "have", "b": [0.5687, 0.0857, 0.6163, 0.1054]}, {"w": "to", "b": [0.6226, 0.0857, 0.6423, 0.1054]}, {"w": "make", "b": [0.6486, 0.0857, 0.7032, 0.1054]}, {"w": "many", "b": [0.7095, 0.0857, 0.7656, 0.1054]}, {"w": "seemingly", "b": [0.1294, 0.1062, 0.2331, 0.1259]}, {"w": "arbitrary", "b": [0.2394, 0.1062, 0.3263, 0.1259]}, {"w": "decisions:", "b": [0.3326, 0.1062, 0.4335, 0.1259]}, {"w": "How", "b": [0.4398, 0.1062, 0.4888, 0.1259]}, {"w": "many", "b": [0.4951, 0.1062, 0.5512, 0.1259]}, {"w": "layers", "b": [0.5575, 0.1062, 0.6177, 0.1259]}, {"w": "should", "b": [0.624, 0.1062, 0.6913, 0.1259]}, {"w": "you", "b": [0.6976, 0.1062, 0.7355, 0.1259]}, {"w": "stack?", "b": [0.7418, 0.1062, 0.8048, 0.1259]}, {"w": "How", "b": [0.811, 0.1062, 0.8601, 0.1259]}, {"w": "many", "b": [0.1294, 0.1267, 0.1855, 0.1464]}, {"w": "units", "b": [0.1918, 0.1267, 0.2408, 0.1464]}, {"w": "or", "b": [0.2471, 0.1267, 0.2682, 0.1464]}, {"w": "filters", "b": [0.2745, 0.1267, 0.3333, 0.1464]}, {"w": "should", "b": [0.3396, 0.1267, 0.4069, 0.1464]}, {"w": "go", "b": [0.4132, 0.1267, 0.4384, 0.1464]}, {"w": "in", "b": [0.4447, 0.1267, 0.4644, 0.1464]}, {"w": "each", "b": [0.4707, 0.1267, 0.5169, 0.1464]}, {"w": "layer?", "b": [0.5232, 0.1267, 0.5848, 0.1464]}, {"w": "Should", "b": [0.5911, 0.1267, 0.6626, 0.1464]}, {"w": "you", "b": [0.6689, 0.1267, 0.7068, 0.1464]}, {"w": "use", "b": [0.7131, 0.1267, 0.7467, 0.1464]}, {"w": "relu", "b": [0.7529, 0.1277, 0.8135, 0.1479]}, {"w": "as", "b": [0.8198, 0.1267, 0.8408, 0.1464]}, {"w": "activation,", "b": [0.1294, 0.1481, 0.2352, 0.1678]}, {"w": "or", "b": [0.2415, 0.1481, 0.2625, 0.1678]}, {"w": "a", "b": [0.2688, 0.1481, 0.28, 0.1678]}, {"w": "different", "b": [0.2863, 0.1481, 0.3727, 0.1678]}, {"w": "function?", "b": [0.379, 0.1481, 0.4743, 0.1678]}, {"w": "Should", "b": [0.4806, 0.1481, 0.5521, 0.1678]}, {"w": "you", "b": [0.5584, 0.1481, 0.5962, 0.1678]}, {"w": "use", "b": [0.6025, 0.1481, 0.6362, 0.1678]}, {"w": "BatchNormalization", "b": [0.1294, 0.1696, 0.4019, 0.1898]}, {"w": "after", "b": [0.4082, 0.1686, 0.4544, 0.1883]}, {"w": "a", "b": [0.4607, 0.1686, 0.4719, 0.1883]}, {"w": "given", "b": [0.4782, 0.1686, 0.5343, 0.1883]}, {"w": "layer?", "b": [0.5406, 0.1686, 0.6022, 0.1883]}, {"w": "How", "b": [0.6085, 0.1686, 0.6576, 0.1883]}, {"w": "much", "b": [0.6639, 0.1686, 0.7199, 0.1883]}, {"w": "dropout", "b": [0.7262, 0.1686, 0.8047, 0.1883]}, {"w": "should", "b": [0.1294, 0.19, 0.1967, 0.2097]}, {"w": "you", "b": [0.203, 0.19, 0.2408, 0.2097]}, {"w": "use?", "b": [0.2471, 0.19, 0.292, 0.2097]}, {"w": "And", "b": [0.2983, 0.19, 0.3417, 0.2097]}, {"w": "so", "b": [0.348, 0.19, 0.3704, 0.2097]}, {"w": "on.", "b": [0.3768, 0.19, 0.4083, 0.2097]}, {"w": "These", "b": [0.4146, 0.19, 0.4748, 0.2097]}, {"w": "architecture-level", "b": [0.4811, 0.19, 0.6576, 0.2097]}, {"w": "parameters", "b": [0.6639, 0.19, 0.7746, 0.2097]}, {"w": "are", "b": [0.7809, 0.19, 0.8117, 0.2097]}, {"w": "called", "b": [0.1294, 0.2105, 0.1897, 0.2302]}, {"w": "hyperparameters", "b": [0.1959, 0.2105, 0.3683, 0.2302]}, {"w": "to", "b": [0.3746, 0.2105, 0.3942, 0.2302]}, {"w": "distinguish", "b": [0.4005, 0.2105, 0.5112, 0.2302]}, {"w": "them", "b": [0.5176, 0.2105, 0.568, 0.2302]}, {"w": "from", "b": [0.5743, 0.2105, 0.6234, 0.2302]}, {"w": "the", "b": [0.6297, 0.2105, 0.6605, 0.2302]}, {"w": "parameters", "b": [0.6668, 0.2105, 0.7775, 0.2302]}, {"w": "of", "b": [0.7838, 0.2105, 0.8048, 0.2302]}, {"w": "a", "b": [0.8111, 0.2105, 0.8223, 0.2302]}, {"w": "model,", "b": [0.1294, 0.231, 0.1988, 0.2507]}, {"w": "which", "b": [0.2051, 0.231, 0.2667, 0.2507]}, {"w": "are", "b": [0.273, 0.231, 0.3038, 0.2507]}, {"w": "trained", "b": [0.3102, 0.231, 0.3802, 0.2507]}, {"w": "via", "b": [0.3865, 0.231, 0.4173, 0.2507]}, {"w": "backpropagation.", "b": [0.4236, 0.231, 0.5981, 0.2507]}]}, {"id": "b_1", "type": "paragraph", "text": "In practice, experienced machine-learning engineers and researchers build intuition over time as to what works and what doesn’t when it comes to these choices—they develop hyperparameter-tuning skills. But there are no formal rules. If you want to get to the very limit of what can be achieved on a given task, you can’t be content with arbitrary choices made by a fallible human. Your initial decisions are almost always suboptimal, even if you have good intuition. You can refine your choices by tweaking them by hand and retraining the model repeatedly—that’s what machine-learning engineers and researchers spend most of their time doing. But it shouldn’t be your job as a human to fiddle with hyperparameters all day—that is better left to a machine.", "words": [{"w": "In", "b": [0.1294, 0.2737, 0.1504, 0.2935]}, {"w": "practice,", "b": [0.1567, 0.2737, 0.2429, 0.2935]}, {"w": "experienced", "b": [0.2492, 0.2737, 0.371, 0.2935]}, {"w": "machine-learning", "b": [0.3774, 0.2737, 0.5539, 0.2935]}, {"w": "engineers", "b": [0.5602, 0.2737, 0.6569, 0.2935]}, {"w": "and", "b": [0.6632, 0.2737, 0.6996, 0.2935]}, {"w": "researchers", "b": [0.7059, 0.2737, 0.8193, 0.2935]}, {"w": "build", "b": [0.1294, 0.2942, 0.1813, 0.314]}, {"w": "intuition", "b": [0.1876, 0.2942, 0.2731, 0.314]}, {"w": "over", "b": [0.2794, 0.2942, 0.3242, 0.314]}, {"w": "time", "b": [0.3305, 0.2942, 0.3754, 0.314]}, {"w": "as", "b": [0.3817, 0.2942, 0.4027, 0.314]}, {"w": "to", "b": [0.409, 0.2942, 0.4286, 0.314]}, {"w": "what", "b": [0.4349, 0.2942, 0.484, 0.314]}, {"w": "works", "b": [0.4903, 0.2942, 0.5519, 0.314]}, {"w": "and", "b": [0.5582, 0.2942, 0.5947, 0.314]}, {"w": "what", "b": [0.601, 0.2942, 0.65, 0.314]}, {"w": "doesn’t", "b": [0.6563, 0.2942, 0.7301, 0.314]}, {"w": "when", "b": [0.7364, 0.2942, 0.791, 0.314]}, {"w": "it", "b": [0.7973, 0.2942, 0.8113, 0.314]}, {"w": "comes", "b": [0.1294, 0.3147, 0.1939, 0.3345]}, {"w": "to", "b": [0.2002, 0.3147, 0.2198, 0.3345]}, {"w": "these", "b": [0.2261, 0.3147, 0.2779, 0.3345]}, {"w": "choices—they", "b": [0.2842, 0.3147, 0.4286, 0.3345]}, {"w": "develop", "b": [0.4349, 0.3147, 0.5147, 0.3345]}, {"w": "hyperparameter-tuning", "b": [0.521, 0.3147, 0.7516, 0.3345]}, {"w": "skills.", "b": [0.7579, 0.3147, 0.8175, 0.3345]}, {"w": "But", "b": [0.8238, 0.3147, 0.8603, 0.3345]}, {"w": "there", "b": [0.1294, 0.3352, 0.1798, 0.355]}, {"w": "are", "b": [0.1861, 0.3352, 0.2169, 0.355]}, {"w": "no", "b": [0.2233, 0.3352, 0.2485, 0.355]}, {"w": "formal", "b": [0.2548, 0.3352, 0.322, 0.355]}, {"w": "rules.", "b": [0.3283, 0.3352, 0.3837, 0.355]}, {"w": "If", "b": [0.39, 0.3352, 0.4068, 0.355]}, {"w": "you", "b": [0.4131, 0.3352, 0.4509, 0.355]}, {"w": "want", "b": [0.4572, 0.3352, 0.5063, 0.355]}, {"w": "to", "b": [0.5126, 0.3352, 0.5322, 0.355]}, {"w": "get", "b": [0.5385, 0.3352, 0.5693, 0.355]}, {"w": "to", "b": [0.5756, 0.3352, 0.5952, 0.355]}, {"w": "the", "b": [0.6015, 0.3352, 0.6324, 0.355]}, {"w": "very", "b": [0.6387, 0.3352, 0.6835, 0.355]}, {"w": "limit", "b": [0.6898, 0.3352, 0.7375, 0.355]}, {"w": "of", "b": [0.7438, 0.3352, 0.7648, 0.355]}, {"w": "what", "b": [0.7711, 0.3352, 0.8201, 0.355]}, {"w": "can", "b": [0.8264, 0.3352, 0.8615, 0.355]}, {"w": "be", "b": [0.1294, 0.3557, 0.1532, 0.3755]}, {"w": "achieved", "b": [0.1595, 0.3557, 0.2492, 0.3755]}, {"w": "on", "b": [0.2555, 0.3557, 0.2807, 0.3755]}, {"w": "a", "b": [0.287, 0.3557, 0.2982, 0.3755]}, {"w": "given", "b": [0.3045, 0.3557, 0.3606, 0.3755]}, {"w": "task,", "b": [0.3669, 0.3557, 0.4138, 0.3755]}, {"w": "you", "b": [0.4201, 0.3557, 0.458, 0.3755]}, {"w": "can’t", "b": [0.4643, 0.3557, 0.5142, 0.3755]}, {"w": "be", "b": [0.5205, 0.3557, 0.5443, 0.3755]}, {"w": "content", "b": [0.5506, 0.3557, 0.6249, 0.3755]}, {"w": "with", "b": [0.6312, 0.3557, 0.6761, 0.3755]}, {"w": "arbitrary", "b": [0.6824, 0.3557, 0.7692, 0.3755]}, {"w": "choices", "b": [0.7755, 0.3557, 0.8512, 0.3755]}, {"w": "made", "b": [0.1294, 0.3762, 0.1841, 0.396]}, {"w": "by", "b": [0.1904, 0.3762, 0.2156, 0.396]}, {"w": "a", "b": [0.2219, 0.3762, 0.2331, 0.396]}, {"w": "fallible", "b": [0.2394, 0.3762, 0.3109, 0.396]}, {"w": "human.", "b": [0.3171, 0.3762, 0.3921, 0.396]}, {"w": "Your", "b": [0.3984, 0.3762, 0.4477, 0.396]}, {"w": "initial", "b": [0.454, 0.3762, 0.5129, 0.396]}, {"w": "decisions", "b": [0.5192, 0.3762, 0.6131, 0.396]}, {"w": "are", "b": [0.6194, 0.3762, 0.6502, 0.396]}, {"w": "almost", "b": [0.6565, 0.3762, 0.7238, 0.396]}, {"w": "always", "b": [0.7301, 0.3762, 0.8001, 0.396]}, {"w": "suboptimal,", "b": [0.1294, 0.3967, 0.2478, 0.4165]}, {"w": "even", "b": [0.2542, 0.3967, 0.3018, 0.4165]}, {"w": "if", "b": [0.3081, 0.3967, 0.3235, 0.4165]}, {"w": "you", "b": [0.3298, 0.3967, 0.3676, 0.4165]}, {"w": "have", "b": [0.374, 0.3967, 0.4216, 0.4165]}, {"w": "good", "b": [0.4279, 0.3967, 0.4783, 0.4165]}, {"w": "intuition.", "b": [0.4846, 0.3967, 0.5765, 0.4165]}, {"w": "You", "b": [0.5828, 0.3967, 0.6236, 0.4165]}, {"w": "can", "b": [0.6299, 0.3967, 0.6649, 0.4165]}, {"w": "refine", "b": [0.6713, 0.3967, 0.7301, 0.4165]}, {"w": "your", "b": [0.7364, 0.3967, 0.7826, 0.4165]}, {"w": "choices", "b": [0.7889, 0.3967, 0.8646, 0.4165]}, {"w": "by", "b": [0.1294, 0.4172, 0.1546, 0.437]}, {"w": "tweaking", "b": [0.1609, 0.4172, 0.2534, 0.437]}, {"w": "them", "b": [0.2597, 0.4172, 0.3102, 0.437]}, {"w": "by", "b": [0.3165, 0.4172, 0.3417, 0.437]}, {"w": "hand", "b": [0.348, 0.4172, 0.3971, 0.437]}, {"w": "and", "b": [0.4034, 0.4172, 0.4398, 0.437]}, {"w": "retraining", "b": [0.4461, 0.4172, 0.5442, 0.437]}, {"w": "the", "b": [0.5505, 0.4172, 0.5813, 0.437]}, {"w": "model", "b": [0.5876, 0.4172, 0.6507, 0.437]}, {"w": "repeatedly—that’s", "b": [0.657, 0.4172, 0.8418, 0.437]}, {"w": "what", "b": [0.1294, 0.4377, 0.1785, 0.4575]}, {"w": "machine-learning", "b": [0.1848, 0.4377, 0.3613, 0.4575]}, {"w": "engineers", "b": [0.3676, 0.4377, 0.4643, 0.4575]}, {"w": "and", "b": [0.4706, 0.4377, 0.507, 0.4575]}, {"w": "researchers", "b": [0.5133, 0.4377, 0.6267, 0.4575]}, {"w": "spend", "b": [0.633, 0.4377, 0.6919, 0.4575]}, {"w": "most", "b": [0.6982, 0.4377, 0.7473, 0.4575]}, {"w": "of", "b": [0.7535, 0.4377, 0.7745, 0.4575]}, {"w": "their", "b": [0.7808, 0.4377, 0.8271, 0.4575]}, {"w": "time", "b": [0.1294, 0.4582, 0.1743, 0.478]}, {"w": "doing.", "b": [0.1806, 0.4582, 0.2443, 0.478]}, {"w": "But", "b": [0.2506, 0.4582, 0.2871, 0.478]}, {"w": "it", "b": [0.2934, 0.4582, 0.3074, 0.478]}, {"w": "shouldn’t", "b": [0.3137, 0.4582, 0.4086, 0.478]}, {"w": "be", "b": [0.4149, 0.4582, 0.4387, 0.478]}, {"w": "your", "b": [0.445, 0.4582, 0.4912, 0.478]}, {"w": "job", "b": [0.4975, 0.4582, 0.5298, 0.478]}, {"w": "as", "b": [0.5361, 0.4582, 0.5571, 0.478]}, {"w": "a", "b": [0.5634, 0.4582, 0.5746, 0.478]}, {"w": "human", "b": [0.5809, 0.4582, 0.6496, 0.478]}, {"w": "to", "b": [0.6559, 0.4582, 0.6755, 0.478]}, {"w": "fiddle", "b": [0.6818, 0.4582, 0.7406, 0.478]}, {"w": "with", "b": [0.747, 0.4582, 0.7918, 0.478]}, {"w": "hyperparameters", "b": [0.1294, 0.4787, 0.2975, 0.4985]}, {"w": "all", "b": [0.3038, 0.4787, 0.329, 0.4985]}, {"w": "day—that", "b": [0.3354, 0.4787, 0.4348, 0.4985]}, {"w": "is", "b": [0.4412, 0.4787, 0.458, 0.4985]}, {"w": "better", "b": [0.4643, 0.4787, 0.5217, 0.4985]}, {"w": "left", "b": [0.528, 0.4787, 0.5617, 0.4985]}, {"w": "to", "b": [0.568, 0.4787, 0.5876, 0.4985]}, {"w": "a", "b": [0.5938, 0.4787, 0.605, 0.4985]}, {"w": "machine.", "b": [0.6113, 0.4787, 0.7031, 0.4985]}]}, {"id": "b_2", "type": "paragraph", "text": "Thus you need to explore the space of possible decisions automatically, systematically, in a principled way. You need to search the architecture space and find the best-performing ones empirically. That’s what the field of automatic hyperparameter optimization is about: it’s an entire field of research, and an important one.", "words": [{"w": "Thus", "b": [0.1294, 0.5215, 0.1799, 0.5413]}, {"w": "you", "b": [0.1862, 0.5215, 0.224, 0.5413]}, {"w": "need", "b": [0.2303, 0.5215, 0.2779, 0.5413]}, {"w": "to", "b": [0.2842, 0.5215, 0.3039, 0.5413]}, {"w": "explore", "b": [0.3102, 0.5215, 0.3858, 0.5413]}, {"w": "the", "b": [0.3921, 0.5215, 0.423, 0.5413]}, {"w": "space", "b": [0.4293, 0.5215, 0.4853, 0.5413]}, {"w": "of", "b": [0.4916, 0.5215, 0.5126, 0.5413]}, {"w": "possible", "b": [0.5189, 0.5215, 0.6016, 0.5413]}, {"w": "decisions", "b": [0.6079, 0.5215, 0.7018, 0.5413]}, {"w": "automatically,", "b": [0.7081, 0.5215, 0.85, 0.5413]}, {"w": "systematically,", "b": [0.1294, 0.542, 0.2784, 0.5618]}, {"w": "in", "b": [0.2847, 0.542, 0.3043, 0.5618]}, {"w": "a", "b": [0.3106, 0.542, 0.3218, 0.5618]}, {"w": "principled", "b": [0.3281, 0.542, 0.4304, 0.5618]}, {"w": "way.", "b": [0.4367, 0.542, 0.4834, 0.5618]}, {"w": "You", "b": [0.4897, 0.542, 0.5306, 0.5618]}, {"w": "need", "b": [0.5369, 0.542, 0.5846, 0.5618]}, {"w": "to", "b": [0.5909, 0.542, 0.6105, 0.5618]}, {"w": "search", "b": [0.6168, 0.542, 0.6812, 0.5618]}, {"w": "the", "b": [0.6875, 0.542, 0.7183, 0.5618]}, {"w": "architecture", "b": [0.7246, 0.542, 0.8437, 0.5618]}, {"w": "space", "b": [0.1294, 0.5625, 0.1854, 0.5823]}, {"w": "and", "b": [0.1917, 0.5625, 0.2282, 0.5823]}, {"w": "find", "b": [0.2345, 0.5625, 0.2751, 0.5823]}, {"w": "the", "b": [0.2814, 0.5625, 0.3122, 0.5823]}, {"w": "best-performing", "b": [0.3186, 0.5625, 0.4811, 0.5823]}, {"w": "ones", "b": [0.4874, 0.5625, 0.5336, 0.5823]}, {"w": "empirically.", "b": [0.5399, 0.5625, 0.6594, 0.5823]}, {"w": "That’s", "b": [0.6657, 0.5625, 0.7288, 0.5823]}, {"w": "what", "b": [0.7351, 0.5625, 0.7841, 0.5823]}, {"w": "the", "b": [0.7904, 0.5625, 0.8213, 0.5823]}, {"w": "field", "b": [0.1294, 0.583, 0.1757, 0.6028]}, {"w": "of", "b": [0.182, 0.583, 0.203, 0.6028]}, {"w": "automatic", "b": [0.2093, 0.583, 0.3088, 0.6028]}, {"w": "hyperparameter", "b": [0.3151, 0.583, 0.4734, 0.6028]}, {"w": "optimization", "b": [0.4797, 0.583, 0.6072, 0.6028]}, {"w": "is", "b": [0.6134, 0.583, 0.6302, 0.6028]}, {"w": "about:", "b": [0.6365, 0.583, 0.6996, 0.6028]}, {"w": "it’s", "b": [0.7059, 0.583, 0.7367, 0.6028]}, {"w": "an", "b": [0.743, 0.583, 0.7669, 0.6028]}, {"w": "entire", "b": [0.7732, 0.583, 0.8306, 0.6028]}, {"w": "field", "b": [0.1294, 0.6035, 0.1757, 0.6233]}, {"w": "of", "b": [0.182, 0.6035, 0.203, 0.6233]}, {"w": "research,", "b": [0.2093, 0.6035, 0.2996, 0.6233]}, {"w": "and", "b": [0.3059, 0.6035, 0.3423, 0.6233]}, {"w": "an", "b": [0.3486, 0.6035, 0.3725, 0.6233]}, {"w": "important", "b": [0.3788, 0.6035, 0.4769, 0.6233]}, {"w": "one.", "b": [0.4832, 0.6035, 0.5259, 0.6233]}]}, {"id": "b_3", "type": "paragraph", "text": "The process of optimizing hyperparameters typically looks like this:", "words": [{"w": "The", "b": [0.1294, 0.6463, 0.1686, 0.6661]}, {"w": "process", "b": [0.1749, 0.6463, 0.2506, 0.6661]}, {"w": "of", "b": [0.2569, 0.6463, 0.2779, 0.6661]}, {"w": "optimizing", "b": [0.2842, 0.6463, 0.3936, 0.6661]}, {"w": "hyperparameters", "b": [0.3999, 0.6463, 0.568, 0.6661]}, {"w": "typically", "b": [0.5743, 0.6463, 0.6626, 0.6661]}, {"w": "looks", "b": [0.6689, 0.6463, 0.7235, 0.6661]}, {"w": "like", "b": [0.7298, 0.6463, 0.7677, 0.6661]}, {"w": "this:", "b": [0.774, 0.6463, 0.8174, 0.6661]}]}, {"id": "b_4", "type": "paragraph", "text": "1. Choose a set of hyperparameters (automatically). 2. Build the corresponding model. 3. Fit it to your training data, and measure the final performance on the validation data. 4. Choose the next set of hyperparameters to try (automatically). 5. Repeat. 6. Eventually, measure performance on your test data.", "words": [{"w": "1.", "b": [0.1551, 0.6846, 0.174, 0.7044]}, {"w": "Choose", "b": [0.1799, 0.6846, 0.2555, 0.7044]}, {"w": "a", "b": [0.2618, 0.6846, 0.273, 0.7044]}, {"w": "set", "b": [0.2794, 0.6846, 0.3074, 0.7044]}, {"w": "of", "b": [0.3137, 0.6846, 0.3347, 0.7044]}, {"w": "hyperparameters", "b": [0.341, 0.6846, 0.5091, 0.7044]}, {"w": "(automatically).", "b": [0.5154, 0.6846, 0.6759, 0.7044]}, {"w": "2.", "b": [0.1551, 0.7051, 0.174, 0.7249]}, {"w": "Build", "b": [0.1799, 0.7051, 0.2359, 0.7249]}, {"w": "the", "b": [0.2422, 0.7051, 0.2731, 0.7249]}, {"w": "corresponding", "b": [0.2794, 0.7051, 0.4237, 0.7249]}, {"w": "model.", "b": [0.43, 0.7051, 0.4994, 0.7249]}, {"w": "3.", "b": [0.1551, 0.7256, 0.174, 0.7454]}, {"w": "Fit", "b": [0.1799, 0.7256, 0.2079, 0.7454]}, {"w": "it", "b": [0.2142, 0.7256, 0.2282, 0.7454]}, {"w": "to", "b": [0.2346, 0.7256, 0.2542, 0.7454]}, {"w": "your", "b": [0.2605, 0.7256, 0.3067, 0.7454]}, {"w": "training", "b": [0.313, 0.7256, 0.3915, 0.7454]}, {"w": "data,", "b": [0.3978, 0.7256, 0.4461, 0.7454]}, {"w": "and", "b": [0.4525, 0.7256, 0.4889, 0.7454]}, {"w": "measure", "b": [0.4952, 0.7256, 0.5792, 0.7454]}, {"w": "the", "b": [0.5855, 0.7256, 0.6164, 0.7454]}, {"w": "final", "b": [0.6227, 0.7256, 0.6689, 0.7454]}, {"w": "performance", "b": [0.6752, 0.7256, 0.8027, 0.7454]}, {"w": "on", "b": [0.809, 0.7256, 0.8342, 0.7454]}, {"w": "the", "b": [0.1799, 0.7461, 0.2107, 0.7659]}, {"w": "validation", "b": [0.217, 0.7461, 0.3179, 0.7659]}, {"w": "data.", "b": [0.3242, 0.7461, 0.3725, 0.7659]}, {"w": "4.", "b": [0.1551, 0.7666, 0.174, 0.7864]}, {"w": "Choose", "b": [0.1799, 0.7666, 0.2555, 0.7864]}, {"w": "the", "b": [0.2618, 0.7666, 0.2927, 0.7864]}, {"w": "next", "b": [0.299, 0.7666, 0.3424, 0.7864]}, {"w": "set", "b": [0.3487, 0.7666, 0.3768, 0.7864]}, {"w": "of", "b": [0.3831, 0.7666, 0.4041, 0.7864]}, {"w": "hyperparameters", "b": [0.4104, 0.7666, 0.5785, 0.7864]}, {"w": "to", "b": [0.5848, 0.7666, 0.6044, 0.7864]}, {"w": "try", "b": [0.6107, 0.7666, 0.6387, 0.7864]}, {"w": "(automatically).", "b": [0.6451, 0.7666, 0.8055, 0.7864]}, {"w": "5.", "b": [0.1551, 0.7871, 0.174, 0.8069]}, {"w": "Repeat.", "b": [0.1799, 0.7871, 0.2562, 0.8069]}, {"w": "6.", "b": [0.1551, 0.8076, 0.174, 0.8274]}, {"w": "Eventually,", "b": [0.1799, 0.8076, 0.2938, 0.8274]}, {"w": "measure", "b": [0.3001, 0.8076, 0.3842, 0.8274]}, {"w": "performance", "b": [0.3905, 0.8076, 0.5179, 0.8274]}, {"w": "on", "b": [0.5242, 0.8076, 0.5495, 0.8274]}, {"w": "your", "b": [0.5558, 0.8076, 0.602, 0.8274]}, {"w": "test", "b": [0.6083, 0.8076, 0.6434, 0.8274]}, {"w": "data.", "b": [0.6497, 0.8076, 0.698, 0.8274]}]}, {"id": "b_5", "type": "paragraph", "text": "The key to this process is the algorithm that uses this history of validation performance, given various sets of hyperparameters, to choose the next set of hyperparameters to evaluate. Many different techniques", "words": [{"w": "The", "b": [0.1294, 0.8504, 0.1686, 0.8702]}, {"w": "key", "b": [0.1749, 0.8504, 0.2114, 0.8702]}, {"w": "to", "b": [0.2177, 0.8504, 0.2373, 0.8702]}, {"w": "this", "b": [0.2436, 0.8504, 0.2801, 0.8702]}, {"w": "process", "b": [0.2864, 0.8504, 0.362, 0.8702]}, {"w": "is", "b": [0.3683, 0.8504, 0.3852, 0.8702]}, {"w": "the", "b": [0.3915, 0.8504, 0.4223, 0.8702]}, {"w": "algorithm", "b": [0.4286, 0.8504, 0.5267, 0.8702]}, {"w": "that", "b": [0.533, 0.8504, 0.5708, 0.8702]}, {"w": "uses", "b": [0.5771, 0.8504, 0.6206, 0.8702]}, {"w": "this", "b": [0.6269, 0.8504, 0.6633, 0.8702]}, {"w": "history", "b": [0.6696, 0.8504, 0.7397, 0.8702]}, {"w": "of", "b": [0.746, 0.8504, 0.767, 0.8702]}, {"w": "validation", "b": [0.1294, 0.8709, 0.2303, 0.8907]}, {"w": "performance,", "b": [0.2366, 0.8709, 0.3704, 0.8907]}, {"w": "given", "b": [0.3767, 0.8709, 0.4328, 0.8907]}, {"w": "various", "b": [0.4391, 0.8709, 0.5133, 0.8907]}, {"w": "sets", "b": [0.5196, 0.8709, 0.5575, 0.8907]}, {"w": "of", "b": [0.5638, 0.8709, 0.5848, 0.8907]}, {"w": "hyperparameters,", "b": [0.5911, 0.8709, 0.7655, 0.8907]}, {"w": "to", "b": [0.7717, 0.8709, 0.7913, 0.8907]}, {"w": "choose", "b": [0.7977, 0.8709, 0.8677, 0.8907]}, {"w": "the", "b": [0.1294, 0.8914, 0.1602, 0.9112]}, {"w": "next", "b": [0.1665, 0.8914, 0.21, 0.9112]}, {"w": "set", "b": [0.2163, 0.8914, 0.2443, 0.9112]}, {"w": "of", "b": [0.2506, 0.8914, 0.2716, 0.9112]}, {"w": "hyperparameters", "b": [0.2779, 0.8914, 0.446, 0.9112]}, {"w": "to", "b": [0.4524, 0.8914, 0.472, 0.9112]}, {"w": "evaluate.", "b": [0.4783, 0.8914, 0.5686, 0.9112]}, {"w": "Many", "b": [0.5749, 0.8914, 0.6338, 0.9112]}, {"w": "different", "b": [0.6401, 0.8914, 0.7264, 0.9112]}, {"w": "techniques", "b": [0.7327, 0.8914, 0.8406, 0.9112]}]}]}, {"page": 345, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "are possible: Bayesian optimization, genetic algorithms, simple random search, and so on.", "words": [{"w": "are", "b": [0.1294, 0.0857, 0.1602, 0.1054]}, {"w": "possible:", "b": [0.1665, 0.0857, 0.2562, 0.1054]}, {"w": "Bayesian", "b": [0.2625, 0.0857, 0.355, 0.1054]}, {"w": "optimization,", "b": [0.3613, 0.0857, 0.4952, 0.1054]}, {"w": "genetic", "b": [0.5015, 0.0857, 0.5743, 0.1054]}, {"w": "algorithms,", "b": [0.5805, 0.0857, 0.6948, 0.1054]}, {"w": "simple", "b": [0.7011, 0.0857, 0.7683, 0.1054]}, {"w": "random", "b": [0.7747, 0.0857, 0.8517, 0.1054]}, {"w": "search,", "b": [0.1294, 0.1062, 0.2001, 0.1259]}, {"w": "and", "b": [0.2065, 0.1062, 0.2429, 0.1259]}, {"w": "so", "b": [0.2492, 0.1062, 0.2716, 0.1259]}, {"w": "on.", "b": [0.2779, 0.1062, 0.3094, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Training the weights of a model is relatively easy: you compute a loss function on a mini-batch of data and then use the Backpropagation algorithm to move the weights in the right direction. Updating hyperparameters, on the other hand, is extremely challenging. Consider the following:", "words": [{"w": "Training", "b": [0.1294, 0.149, 0.2154, 0.1687]}, {"w": "the", "b": [0.2217, 0.149, 0.2525, 0.1687]}, {"w": "weights", "b": [0.2588, 0.149, 0.3373, 0.1687]}, {"w": "of", "b": [0.3436, 0.149, 0.3646, 0.1687]}, {"w": "a", "b": [0.3709, 0.149, 0.3821, 0.1687]}, {"w": "model", "b": [0.3884, 0.149, 0.4515, 0.1687]}, {"w": "is", "b": [0.4578, 0.149, 0.4746, 0.1687]}, {"w": "relatively", "b": [0.481, 0.149, 0.5762, 0.1687]}, {"w": "easy:", "b": [0.5825, 0.149, 0.6344, 0.1687]}, {"w": "you", "b": [0.6407, 0.149, 0.6785, 0.1687]}, {"w": "compute", "b": [0.6848, 0.149, 0.7717, 0.1687]}, {"w": "a", "b": [0.778, 0.149, 0.7892, 0.1687]}, {"w": "loss", "b": [0.7955, 0.149, 0.8348, 0.1687]}, {"w": "function", "b": [0.1294, 0.1695, 0.2135, 0.1892]}, {"w": "on", "b": [0.2198, 0.1695, 0.245, 0.1892]}, {"w": "a", "b": [0.2513, 0.1695, 0.2625, 0.1892]}, {"w": "mini-batch", "b": [0.2688, 0.1695, 0.3781, 0.1892]}, {"w": "of", "b": [0.3844, 0.1695, 0.4055, 0.1892]}, {"w": "data", "b": [0.4118, 0.1695, 0.4538, 0.1892]}, {"w": "and", "b": [0.4601, 0.1695, 0.4965, 0.1892]}, {"w": "then", "b": [0.5028, 0.1695, 0.5463, 0.1892]}, {"w": "use", "b": [0.5526, 0.1695, 0.5862, 0.1892]}, {"w": "the", "b": [0.5925, 0.1695, 0.6233, 0.1892]}, {"w": "Backpropagation", "b": [0.6296, 0.1695, 0.802, 0.1892]}, {"w": "algorithm", "b": [0.1294, 0.19, 0.2275, 0.2097]}, {"w": "to", "b": [0.2338, 0.19, 0.2534, 0.2097]}, {"w": "move", "b": [0.2598, 0.19, 0.3158, 0.2097]}, {"w": "the", "b": [0.3221, 0.19, 0.3529, 0.2097]}, {"w": "weights", "b": [0.3592, 0.19, 0.4377, 0.2097]}, {"w": "in", "b": [0.444, 0.19, 0.4637, 0.2097]}, {"w": "the", "b": [0.47, 0.19, 0.5008, 0.2097]}, {"w": "right", "b": [0.5071, 0.19, 0.5547, 0.2097]}, {"w": "direction.", "b": [0.5611, 0.19, 0.657, 0.2097]}, {"w": "Updating", "b": [0.6633, 0.19, 0.7572, 0.2097]}, {"w": "hyperparameters,", "b": [0.1294, 0.2105, 0.3038, 0.2302]}, {"w": "on", "b": [0.3101, 0.2105, 0.3354, 0.2302]}, {"w": "the", "b": [0.3417, 0.2105, 0.3725, 0.2302]}, {"w": "other", "b": [0.3788, 0.2105, 0.4306, 0.2302]}, {"w": "hand,", "b": [0.4369, 0.2105, 0.4923, 0.2302]}, {"w": "is", "b": [0.4986, 0.2105, 0.5154, 0.2302]}, {"w": "extremely", "b": [0.5217, 0.2105, 0.6226, 0.2302]}, {"w": "challenging.", "b": [0.6289, 0.2105, 0.7529, 0.2302]}, {"w": "Consider", "b": [0.7591, 0.2105, 0.8502, 0.2302]}, {"w": "the", "b": [0.1294, 0.231, 0.1602, 0.2507]}, {"w": "following:", "b": [0.1665, 0.231, 0.2717, 0.2507]}]}, {"id": "b_2", "type": "paragraph", "text": "Computing the feedback signal (does this set of hyperparameters lead to a high-performing model on this task?) can be extremely expensive: it requires creating and training a new model from scratch on your dataset. The hyperparameter space is typically made of discrete decisions and thus isn’t continuous or differentiable. Hence, you typically can’t do gradient descent in hyperparameter space. Instead, you must rely on gradient-free optimization techniques, which naturally are far less efficient than gradient descent.", "words": [{"w": "Computing", "b": [0.1799, 0.2693, 0.2934, 0.289]}, {"w": "the", "b": [0.2997, 0.2693, 0.3305, 0.289]}, {"w": "feedback", "b": [0.3368, 0.2693, 0.4279, 0.289]}, {"w": "signal", "b": [0.4342, 0.2693, 0.4945, 0.289]}, {"w": "(does", "b": [0.5008, 0.2693, 0.5554, 0.289]}, {"w": "this", "b": [0.5617, 0.2693, 0.5982, 0.289]}, {"w": "set", "b": [0.6045, 0.2693, 0.6325, 0.289]}, {"w": "of", "b": [0.6388, 0.2693, 0.6598, 0.289]}, {"w": "hyperparameters", "b": [0.6661, 0.2693, 0.8342, 0.289]}, {"w": "lead", "b": [0.1799, 0.2898, 0.2219, 0.3095]}, {"w": "to", "b": [0.2282, 0.2898, 0.2478, 0.3095]}, {"w": "a", "b": [0.2541, 0.2898, 0.2653, 0.3095]}, {"w": "high-performing", "b": [0.2716, 0.2898, 0.4384, 0.3095]}, {"w": "model", "b": [0.4447, 0.2898, 0.5077, 0.3095]}, {"w": "on", "b": [0.5141, 0.2898, 0.5393, 0.3095]}, {"w": "this", "b": [0.5456, 0.2898, 0.582, 0.3095]}, {"w": "task?)", "b": [0.5883, 0.2898, 0.6486, 0.3095]}, {"w": "can", "b": [0.6549, 0.2898, 0.6899, 0.3095]}, {"w": "be", "b": [0.6962, 0.2898, 0.72, 0.3095]}, {"w": "extremely", "b": [0.7263, 0.2898, 0.8272, 0.3095]}, {"w": "expensive:", "b": [0.1799, 0.3103, 0.2878, 0.33]}, {"w": "it", "b": [0.2941, 0.3103, 0.3081, 0.33]}, {"w": "requires", "b": [0.3144, 0.3103, 0.3956, 0.33]}, {"w": "creating", "b": [0.402, 0.3103, 0.4832, 0.33]}, {"w": "and", "b": [0.4895, 0.3103, 0.5259, 0.33]}, {"w": "training", "b": [0.5322, 0.3103, 0.6107, 0.33]}, {"w": "a", "b": [0.617, 0.3103, 0.6282, 0.33]}, {"w": "new", "b": [0.6345, 0.3103, 0.6766, 0.33]}, {"w": "model", "b": [0.6829, 0.3103, 0.7459, 0.33]}, {"w": "from", "b": [0.7522, 0.3103, 0.8013, 0.33]}, {"w": "scratch", "b": [0.1799, 0.3308, 0.2513, 0.3505]}, {"w": "on", "b": [0.2576, 0.3308, 0.2828, 0.3505]}, {"w": "your", "b": [0.2891, 0.3308, 0.3354, 0.3505]}, {"w": "dataset.", "b": [0.3417, 0.3308, 0.418, 0.3505]}, {"w": "The", "b": [0.1799, 0.3513, 0.2191, 0.371]}, {"w": "hyperparameter", "b": [0.2254, 0.3513, 0.3837, 0.371]}, {"w": "space", "b": [0.39, 0.3513, 0.446, 0.371]}, {"w": "is", "b": [0.4523, 0.3513, 0.4692, 0.371]}, {"w": "typically", "b": [0.4755, 0.3513, 0.5637, 0.371]}, {"w": "made", "b": [0.5701, 0.3513, 0.6247, 0.371]}, {"w": "of", "b": [0.631, 0.3513, 0.652, 0.371]}, {"w": "discrete", "b": [0.6583, 0.3513, 0.7368, 0.371]}, {"w": "decisions", "b": [0.7431, 0.3513, 0.837, 0.371]}, {"w": "and", "b": [0.1799, 0.3718, 0.2163, 0.3915]}, {"w": "thus", "b": [0.2226, 0.3718, 0.2646, 0.3915]}, {"w": "isn’t", "b": [0.271, 0.3718, 0.3153, 0.3915]}, {"w": "continuous", "b": [0.3217, 0.3718, 0.4324, 0.3915]}, {"w": "or", "b": [0.4387, 0.3718, 0.4597, 0.3915]}, {"w": "differentiable.", "b": [0.466, 0.3718, 0.6077, 0.3915]}, {"w": "Hence,", "b": [0.614, 0.3718, 0.6848, 0.3915]}, {"w": "you", "b": [0.6911, 0.3718, 0.7289, 0.3915]}, {"w": "typically", "b": [0.7352, 0.3718, 0.8235, 0.3915]}, {"w": "can’t", "b": [0.1799, 0.3923, 0.2298, 0.412]}, {"w": "do", "b": [0.2361, 0.3923, 0.2614, 0.412]}, {"w": "gradient", "b": [0.2677, 0.3923, 0.3503, 0.412]}, {"w": "descent", "b": [0.3566, 0.3923, 0.4323, 0.412]}, {"w": "in", "b": [0.4386, 0.3923, 0.4582, 0.412]}, {"w": "hyperparameter", "b": [0.4645, 0.3923, 0.6228, 0.412]}, {"w": "space.", "b": [0.6291, 0.3923, 0.6915, 0.412]}, {"w": "Instead,", "b": [0.6978, 0.3923, 0.7769, 0.412]}, {"w": "you", "b": [0.7832, 0.3923, 0.8211, 0.412]}, {"w": "must", "b": [0.1799, 0.4128, 0.2289, 0.4325]}, {"w": "rely", "b": [0.2352, 0.4128, 0.2745, 0.4325]}, {"w": "on", "b": [0.2808, 0.4128, 0.306, 0.4325]}, {"w": "gradient-free", "b": [0.3123, 0.4128, 0.4426, 0.4325]}, {"w": "optimization", "b": [0.4489, 0.4128, 0.5764, 0.4325]}, {"w": "techniques,", "b": [0.5827, 0.4128, 0.6969, 0.4325]}, {"w": "which", "b": [0.7032, 0.4128, 0.7649, 0.4325]}, {"w": "naturally", "b": [0.7711, 0.4128, 0.8608, 0.4325]}, {"w": "are", "b": [0.1799, 0.4333, 0.2107, 0.453]}, {"w": "far", "b": [0.217, 0.4333, 0.245, 0.453]}, {"w": "less", "b": [0.2513, 0.4333, 0.2891, 0.453]}, {"w": "efficient", "b": [0.2954, 0.4333, 0.379, 0.453]}, {"w": "than", "b": [0.3853, 0.4333, 0.4287, 0.453]}, {"w": "gradient", "b": [0.4351, 0.4333, 0.5177, 0.453]}, {"w": "descent.", "b": [0.524, 0.4333, 0.606, 0.453]}]}, {"id": "b_3", "type": "paragraph", "text": "Because these challenges are difficult and the field is still young, we currently only have access to very limited tools to optimize models. Often, it turns out that random search (choosing hyperparameters to evaluate at random, repeatedly) is the best solution, despite being the most naive one. But one tool I have found reliably better than random search is Hyperopt (https://github.com/hyperopt/hyperopt), a Python library for hyperparameter optimization that internally uses trees of Parzen estimators to predict sets of hyperparameters that are likely to work well. Another library called Hyperas (https://github.com/maxpumperla/hyperas) integrates Hyperopt for use with Keras models. Do check it out.", "words": [{"w": "Because", "b": [0.1294, 0.4761, 0.2135, 0.4958]}, {"w": "these", "b": [0.2198, 0.4761, 0.2716, 0.4958]}, {"w": "challenges", "b": [0.2779, 0.4761, 0.3844, 0.4958]}, {"w": "are", "b": [0.3907, 0.4761, 0.4215, 0.4958]}, {"w": "difficult", "b": [0.4278, 0.4761, 0.5086, 0.4958]}, {"w": "and", "b": [0.5149, 0.4761, 0.5513, 0.4958]}, {"w": "the", "b": [0.5576, 0.4761, 0.5884, 0.4958]}, {"w": "field", "b": [0.5947, 0.4761, 0.641, 0.4958]}, {"w": "is", "b": [0.6473, 0.4761, 0.6641, 0.4958]}, {"w": "still", "b": [0.6704, 0.4761, 0.7083, 0.4958]}, {"w": "young,", "b": [0.7146, 0.4761, 0.784, 0.4958]}, {"w": "we", "b": [0.7903, 0.4761, 0.8197, 0.4958]}, {"w": "currently", "b": [0.1294, 0.4966, 0.2205, 0.5163]}, {"w": "only", "b": [0.2268, 0.4966, 0.2716, 0.5163]}, {"w": "have", "b": [0.2779, 0.4966, 0.3256, 0.5163]}, {"w": "access", "b": [0.3319, 0.4966, 0.3963, 0.5163]}, {"w": "to", "b": [0.4026, 0.4966, 0.4222, 0.5163]}, {"w": "very", "b": [0.4285, 0.4966, 0.4734, 0.5163]}, {"w": "limited", "b": [0.4797, 0.4966, 0.5512, 0.5163]}, {"w": "tools", "b": [0.5575, 0.4966, 0.6065, 0.5163]}, {"w": "to", "b": [0.6128, 0.4966, 0.6325, 0.5163]}, {"w": "optimize", "b": [0.6387, 0.4966, 0.727, 0.5163]}, {"w": "models.", "b": [0.7333, 0.4966, 0.8125, 0.5163]}, {"w": "Often,", "b": [0.1294, 0.5171, 0.1932, 0.5368]}, {"w": "it", "b": [0.1995, 0.5171, 0.2135, 0.5368]}, {"w": "turns", "b": [0.2198, 0.5171, 0.2702, 0.5368]}, {"w": "out", "b": [0.2766, 0.5171, 0.3088, 0.5368]}, {"w": "that", "b": [0.3151, 0.5171, 0.3529, 0.5368]}, {"w": "random", "b": [0.3592, 0.5171, 0.4363, 0.5368]}, {"w": "search", "b": [0.4426, 0.5171, 0.507, 0.5368]}, {"w": "(choosing", "b": [0.5133, 0.5171, 0.6128, 0.5368]}, {"w": "hyperparameters", "b": [0.6191, 0.5171, 0.7872, 0.5368]}, {"w": "to", "b": [0.7936, 0.5171, 0.8132, 0.5368]}, {"w": "evaluate", "b": [0.1294, 0.5376, 0.2135, 0.5573]}, {"w": "at", "b": [0.2198, 0.5376, 0.238, 0.5573]}, {"w": "random,", "b": [0.2443, 0.5376, 0.3277, 0.5573]}, {"w": "repeatedly)", "b": [0.334, 0.5376, 0.4474, 0.5573]}, {"w": "is", "b": [0.4537, 0.5376, 0.4706, 0.5573]}, {"w": "the", "b": [0.4769, 0.5376, 0.5077, 0.5573]}, {"w": "best", "b": [0.5139, 0.5376, 0.5546, 0.5573]}, {"w": "solution,", "b": [0.5609, 0.5376, 0.6485, 0.5573]}, {"w": "despite", "b": [0.6548, 0.5376, 0.7263, 0.5573]}, {"w": "being", "b": [0.7326, 0.5376, 0.7886, 0.5573]}, {"w": "the", "b": [0.7949, 0.5376, 0.8257, 0.5573]}, {"w": "most", "b": [0.1294, 0.5581, 0.1785, 0.5778]}, {"w": "naive", "b": [0.1848, 0.5581, 0.2394, 0.5778]}, {"w": "one.", "b": [0.2457, 0.5581, 0.2885, 0.5778]}, {"w": "But", "b": [0.2948, 0.5581, 0.3312, 0.5778]}, {"w": "one", "b": [0.3375, 0.5581, 0.374, 0.5778]}, {"w": "tool", "b": [0.3803, 0.5581, 0.4195, 0.5778]}, {"w": "I", "b": [0.4258, 0.5581, 0.4342, 0.5778]}, {"w": "have", "b": [0.4405, 0.5581, 0.4881, 0.5778]}, {"w": "found", "b": [0.4945, 0.5581, 0.5533, 0.5778]}, {"w": "reliably", "b": [0.5596, 0.5581, 0.6367, 0.5778]}, {"w": "better", "b": [0.643, 0.5581, 0.7004, 0.5778]}, {"w": "than", "b": [0.7067, 0.5581, 0.7502, 0.5778]}, {"w": "random", "b": [0.7565, 0.5581, 0.8335, 0.5778]}, {"w": "search", "b": [0.1294, 0.5786, 0.1938, 0.5983]}, {"w": "is", "b": [0.2001, 0.5786, 0.217, 0.5983]}, {"w": "Hyperopt", "b": [0.2233, 0.5786, 0.3186, 0.5983]}, {"w": "(https://github.com/hyperopt/hyperopt),", "b": [0.3248, 0.5786, 0.7256, 0.5983]}, {"w": "a", "b": [0.7319, 0.5786, 0.7431, 0.5983]}, {"w": "Python", "b": [0.7494, 0.5786, 0.8209, 0.5983]}, {"w": "library", "b": [0.1294, 0.5991, 0.1967, 0.6188]}, {"w": "for", "b": [0.203, 0.5991, 0.2324, 0.6188]}, {"w": "hyperparameter", "b": [0.2387, 0.5991, 0.397, 0.6188]}, {"w": "optimization", "b": [0.4033, 0.5991, 0.5308, 0.6188]}, {"w": "that", "b": [0.5371, 0.5991, 0.575, 0.6188]}, {"w": "internally", "b": [0.5813, 0.5991, 0.678, 0.6188]}, {"w": "uses", "b": [0.6843, 0.5991, 0.7277, 0.6188]}, {"w": "trees", "b": [0.734, 0.5991, 0.7816, 0.6188]}, {"w": "of", "b": [0.788, 0.5991, 0.809, 0.6188]}, {"w": "Parzen", "b": [0.1294, 0.6196, 0.1981, 0.6393]}, {"w": "estimators", "b": [0.2044, 0.6196, 0.3081, 0.6393]}, {"w": "to", "b": [0.3144, 0.6196, 0.334, 0.6393]}, {"w": "predict", "b": [0.3403, 0.6196, 0.4104, 0.6393]}, {"w": "sets", "b": [0.4167, 0.6196, 0.4545, 0.6393]}, {"w": "of", "b": [0.4608, 0.6196, 0.4818, 0.6393]}, {"w": "hyperparameters", "b": [0.4881, 0.6196, 0.6562, 0.6393]}, {"w": "that", "b": [0.6625, 0.6196, 0.7003, 0.6393]}, {"w": "are", "b": [0.7066, 0.6196, 0.7374, 0.6393]}, {"w": "likely", "b": [0.7437, 0.6196, 0.8012, 0.6393]}, {"w": "to", "b": [0.8075, 0.6196, 0.8271, 0.6393]}, {"w": "work", "b": [0.1294, 0.6401, 0.1813, 0.6598]}, {"w": "well.", "b": [0.1876, 0.6401, 0.2373, 0.6598]}, {"w": "Another", "b": [0.2436, 0.6401, 0.3263, 0.6598]}, {"w": "library", "b": [0.3326, 0.6401, 0.3998, 0.6598]}, {"w": "called", "b": [0.4061, 0.6401, 0.4664, 0.6598]}, {"w": "Hyperas", "b": [0.4727, 0.6401, 0.5567, 0.6598]}, {"w": "(https://github.com/maxpumperla/hyperas)", "b": [0.1294, 0.6606, 0.5616, 0.6803]}, {"w": "integrates", "b": [0.568, 0.6606, 0.666, 0.6803]}, {"w": "Hyperopt", "b": [0.6723, 0.6606, 0.7676, 0.6803]}, {"w": "for", "b": [0.7739, 0.6606, 0.8033, 0.6803]}, {"w": "use", "b": [0.8096, 0.6606, 0.8433, 0.6803]}, {"w": "with", "b": [0.1294, 0.6811, 0.1743, 0.7008]}, {"w": "Keras", "b": [0.1806, 0.6811, 0.2394, 0.7008]}, {"w": "models.", "b": [0.2457, 0.6811, 0.3249, 0.7008]}, {"w": "Do", "b": [0.3312, 0.6811, 0.362, 0.7008]}, {"w": "check", "b": [0.3683, 0.6811, 0.4272, 0.7008]}, {"w": "it", "b": [0.4335, 0.6811, 0.4475, 0.7008]}, {"w": "out.", "b": [0.4538, 0.6811, 0.4923, 0.7008]}]}, {"id": "b_4", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.7296, 0.1672, 0.7444]}]}, {"id": "b_5", "type": "paragraph", "text": "One important issue to keep in mind when doing automatic hyperparameter optimization at scale is validation-set overfitting. Because you’re updating hyperparameters based on a signal that is computed using your validation data, you’re effectively training them on the validation data, and thus they will quickly overfit to the validation data. Always keep this in mind.", "words": [{"w": "One", "b": [0.1294, 0.7631, 0.1714, 0.7828]}, {"w": "important", "b": [0.1777, 0.7631, 0.2758, 0.7828]}, {"w": "issue", "b": [0.2822, 0.7631, 0.3326, 0.7828]}, {"w": "to", "b": [0.3389, 0.7631, 0.3585, 0.7828]}, {"w": "keep", "b": [0.3648, 0.7631, 0.4125, 0.7828]}, {"w": "in", "b": [0.4188, 0.7631, 0.4384, 0.7828]}, {"w": "mind", "b": [0.4447, 0.7631, 0.4966, 0.7828]}, {"w": "when", "b": [0.5029, 0.7631, 0.5575, 0.7828]}, {"w": "doing", "b": [0.5638, 0.7631, 0.6213, 0.7828]}, {"w": "automatic", "b": [0.6276, 0.7631, 0.7271, 0.7828]}, {"w": "hyperparameter", "b": [0.1294, 0.7836, 0.2877, 0.8033]}, {"w": "optimization", "b": [0.294, 0.7836, 0.4216, 0.8033]}, {"w": "at", "b": [0.4279, 0.7836, 0.4461, 0.8033]}, {"w": "scale", "b": [0.4524, 0.7836, 0.5028, 0.8033]}, {"w": "is", "b": [0.5091, 0.7836, 0.5259, 0.8033]}, {"w": "validation-set", "b": [0.5322, 0.7836, 0.6696, 0.8033]}, {"w": "overfitting.", "b": [0.6759, 0.7836, 0.7887, 0.8033]}, {"w": "Because", "b": [0.1294, 0.8041, 0.2135, 0.8238]}, {"w": "you’re", "b": [0.2198, 0.8041, 0.2856, 0.8238]}, {"w": "updating", "b": [0.2919, 0.8041, 0.3802, 0.8238]}, {"w": "hyperparameters", "b": [0.3865, 0.8041, 0.5546, 0.8238]}, {"w": "based", "b": [0.5609, 0.8041, 0.6184, 0.8238]}, {"w": "on", "b": [0.6247, 0.8041, 0.6499, 0.8238]}, {"w": "a", "b": [0.6562, 0.8041, 0.6674, 0.8238]}, {"w": "signal", "b": [0.6737, 0.8041, 0.734, 0.8238]}, {"w": "that", "b": [0.7403, 0.8041, 0.7781, 0.8238]}, {"w": "is", "b": [0.7844, 0.8041, 0.8012, 0.8238]}, {"w": "computed", "b": [0.1294, 0.8246, 0.2289, 0.8443]}, {"w": "using", "b": [0.2352, 0.8246, 0.2899, 0.8443]}, {"w": "your", "b": [0.2962, 0.8246, 0.3424, 0.8443]}, {"w": "validation", "b": [0.3487, 0.8246, 0.4496, 0.8443]}, {"w": "data,", "b": [0.4559, 0.8246, 0.5043, 0.8443]}, {"w": "you’re", "b": [0.5106, 0.8246, 0.5764, 0.8443]}, {"w": "effectively", "b": [0.5827, 0.8246, 0.6901, 0.8443]}, {"w": "training", "b": [0.6963, 0.8246, 0.7748, 0.8443]}, {"w": "them", "b": [0.7811, 0.8246, 0.8316, 0.8443]}, {"w": "on", "b": [0.8379, 0.8246, 0.8631, 0.8443]}, {"w": "the", "b": [0.1294, 0.8451, 0.1602, 0.8648]}, {"w": "validation", "b": [0.1665, 0.8451, 0.2674, 0.8648]}, {"w": "data,", "b": [0.2738, 0.8451, 0.3221, 0.8648]}, {"w": "and", "b": [0.3284, 0.8451, 0.3648, 0.8648]}, {"w": "thus", "b": [0.3711, 0.8451, 0.4132, 0.8648]}, {"w": "they", "b": [0.4195, 0.8451, 0.4629, 0.8648]}, {"w": "will", "b": [0.4692, 0.8451, 0.5085, 0.8648]}, {"w": "quickly", "b": [0.5148, 0.8451, 0.5905, 0.8648]}, {"w": "overfit", "b": [0.5968, 0.8451, 0.664, 0.8648]}, {"w": "to", "b": [0.6703, 0.8451, 0.69, 0.8648]}, {"w": "the", "b": [0.6963, 0.8451, 0.7271, 0.8648]}, {"w": "validation", "b": [0.7334, 0.8451, 0.8343, 0.8648]}, {"w": "data.", "b": [0.1294, 0.8656, 0.1777, 0.8853]}, {"w": "Always", "b": [0.1841, 0.8656, 0.2611, 0.8853]}, {"w": "keep", "b": [0.2674, 0.8656, 0.315, 0.8853]}, {"w": "this", "b": [0.3214, 0.8656, 0.3578, 0.8853]}, {"w": "in", "b": [0.3641, 0.8656, 0.3837, 0.8853]}, {"w": "mind.", "b": [0.39, 0.8656, 0.4482, 0.8853]}]}]}, {"page": 346, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Overall, hyperparameter optimization is a powerful technique that is an absolute requirement to get to state-of-the-art models on any task or to win machine-learning competitions. Think about it: once upon a time, people handcrafted the features that went into shallow machine-learning models. That was very much suboptimal. Now, deep learning automates the task of hierarchical feature engineering—features are learned using a feedback signal, not hand-tuned, and that’s the way it should be. In the same way, you shouldn’t handcraft your model architectures; you should optimize them in a principled way. At the time of writing, the field of automatic hyperparameter optimization is very young and immature, as deep learning was some years ago, but I expect it to boom in the next few years.", "words": [{"w": "Overall,", "b": [0.1294, 0.0857, 0.2114, 0.1054]}, {"w": "hyperparameter", "b": [0.2177, 0.0857, 0.376, 0.1054]}, {"w": "optimization", "b": [0.3823, 0.0857, 0.5098, 0.1054]}, {"w": "is", "b": [0.5161, 0.0857, 0.5329, 0.1054]}, {"w": "a", "b": [0.5393, 0.0857, 0.5505, 0.1054]}, {"w": "powerful", "b": [0.5568, 0.0857, 0.6478, 0.1054]}, {"w": "technique", "b": [0.6541, 0.0857, 0.7522, 0.1054]}, {"w": "that", "b": [0.7585, 0.0857, 0.7964, 0.1054]}, {"w": "is", "b": [0.8027, 0.0857, 0.8195, 0.1054]}, {"w": "an", "b": [0.8258, 0.0857, 0.8496, 0.1054]}, {"w": "absolute", "b": [0.1294, 0.1062, 0.2135, 0.1259]}, {"w": "requirement", "b": [0.2198, 0.1062, 0.3417, 0.1259]}, {"w": "to", "b": [0.348, 0.1062, 0.3676, 0.1259]}, {"w": "get", "b": [0.3739, 0.1062, 0.4048, 0.1259]}, {"w": "to", "b": [0.4111, 0.1062, 0.4307, 0.1259]}, {"w": "state-of-the-art", "b": [0.437, 0.1062, 0.5869, 0.1259]}, {"w": "models", "b": [0.5932, 0.1062, 0.6661, 0.1259]}, {"w": "on", "b": [0.6723, 0.1062, 0.6975, 0.1259]}, {"w": "any", "b": [0.7038, 0.1062, 0.7402, 0.1259]}, {"w": "task", "b": [0.7465, 0.1062, 0.7872, 0.1259]}, {"w": "or", "b": [0.7935, 0.1062, 0.8145, 0.1259]}, {"w": "to", "b": [0.8208, 0.1062, 0.8404, 0.1259]}, {"w": "win", "b": [0.1294, 0.1267, 0.1673, 0.1464]}, {"w": "machine-learning", "b": [0.1736, 0.1267, 0.3501, 0.1464]}, {"w": "competitions.", "b": [0.3564, 0.1267, 0.493, 0.1464]}, {"w": "Think", "b": [0.4993, 0.1267, 0.5596, 0.1464]}, {"w": "about", "b": [0.5659, 0.1267, 0.622, 0.1464]}, {"w": "it:", "b": [0.6283, 0.1267, 0.6493, 0.1464]}, {"w": "once", "b": [0.6556, 0.1267, 0.7032, 0.1464]}, {"w": "upon", "b": [0.7096, 0.1267, 0.76, 0.1464]}, {"w": "a", "b": [0.7663, 0.1267, 0.7775, 0.1464]}, {"w": "time,", "b": [0.7838, 0.1267, 0.835, 0.1464]}, {"w": "people", "b": [0.1294, 0.1472, 0.1967, 0.1669]}, {"w": "handcrafted", "b": [0.203, 0.1472, 0.322, 0.1669]}, {"w": "the", "b": [0.3283, 0.1472, 0.3592, 0.1669]}, {"w": "features", "b": [0.3655, 0.1472, 0.4453, 0.1669]}, {"w": "that", "b": [0.4516, 0.1472, 0.4895, 0.1669]}, {"w": "went", "b": [0.4957, 0.1472, 0.5447, 0.1669]}, {"w": "into", "b": [0.551, 0.1472, 0.5903, 0.1669]}, {"w": "shallow", "b": [0.5966, 0.1472, 0.6751, 0.1669]}, {"w": "machine-learning", "b": [0.6814, 0.1472, 0.8579, 0.1669]}, {"w": "models.", "b": [0.1294, 0.1677, 0.2086, 0.1874]}, {"w": "That", "b": [0.2149, 0.1677, 0.2611, 0.1874]}, {"w": "was", "b": [0.2674, 0.1677, 0.3067, 0.1874]}, {"w": "very", "b": [0.313, 0.1677, 0.3578, 0.1874]}, {"w": "much", "b": [0.3641, 0.1677, 0.4202, 0.1874]}, {"w": "suboptimal.", "b": [0.4265, 0.1677, 0.5449, 0.1874]}, {"w": "Now,", "b": [0.5512, 0.1677, 0.6049, 0.1874]}, {"w": "deep", "b": [0.6112, 0.1677, 0.6588, 0.1874]}, {"w": "learning", "b": [0.6651, 0.1677, 0.7478, 0.1874]}, {"w": "automates", "b": [0.7541, 0.1677, 0.8564, 0.1874]}, {"w": "the", "b": [0.1294, 0.1882, 0.1602, 0.2079]}, {"w": "task", "b": [0.1665, 0.1882, 0.2072, 0.2079]}, {"w": "of", "b": [0.2135, 0.1882, 0.2345, 0.2079]}, {"w": "hierarchical", "b": [0.2408, 0.1882, 0.3599, 0.2079]}, {"w": "feature", "b": [0.3661, 0.1882, 0.4361, 0.2079]}, {"w": "engineering—features", "b": [0.4425, 0.1882, 0.6666, 0.2079]}, {"w": "are", "b": [0.6729, 0.1882, 0.7037, 0.2079]}, {"w": "learned", "b": [0.71, 0.1882, 0.7843, 0.2079]}, {"w": "using", "b": [0.7906, 0.1882, 0.8452, 0.2079]}, {"w": "a", "b": [0.8515, 0.1882, 0.8627, 0.2079]}, {"w": "feedback", "b": [0.1294, 0.2087, 0.2205, 0.2284]}, {"w": "signal,", "b": [0.2268, 0.2087, 0.2933, 0.2284]}, {"w": "not", "b": [0.2996, 0.2087, 0.3319, 0.2284]}, {"w": "hand-tuned,", "b": [0.3382, 0.2087, 0.458, 0.2284]}, {"w": "and", "b": [0.4643, 0.2087, 0.5007, 0.2284]}, {"w": "that’s", "b": [0.507, 0.2087, 0.5616, 0.2284]}, {"w": "the", "b": [0.5679, 0.2087, 0.5988, 0.2284]}, {"w": "way", "b": [0.6051, 0.2087, 0.6471, 0.2284]}, {"w": "it", "b": [0.6534, 0.2087, 0.6674, 0.2284]}, {"w": "should", "b": [0.6737, 0.2087, 0.741, 0.2284]}, {"w": "be.", "b": [0.7473, 0.2087, 0.7774, 0.2284]}, {"w": "In", "b": [0.7837, 0.2087, 0.8047, 0.2284]}, {"w": "the", "b": [0.8111, 0.2087, 0.8419, 0.2284]}, {"w": "same", "b": [0.1294, 0.2292, 0.1813, 0.2489]}, {"w": "way,", "b": [0.1876, 0.2292, 0.2342, 0.2489]}, {"w": "you", "b": [0.2406, 0.2292, 0.2784, 0.2489]}, {"w": "shouldn’t", "b": [0.2847, 0.2292, 0.3795, 0.2489]}, {"w": "handcraft", "b": [0.3858, 0.2292, 0.4811, 0.2489]}, {"w": "your", "b": [0.4874, 0.2292, 0.5336, 0.2489]}, {"w": "model", "b": [0.54, 0.2292, 0.603, 0.2489]}, {"w": "architectures;", "b": [0.6093, 0.2292, 0.7452, 0.2489]}, {"w": "you", "b": [0.7515, 0.2292, 0.7894, 0.2489]}, {"w": "should", "b": [0.7957, 0.2292, 0.8629, 0.2489]}, {"w": "optimize", "b": [0.1294, 0.2497, 0.2177, 0.2694]}, {"w": "them", "b": [0.224, 0.2497, 0.2745, 0.2694]}, {"w": "in", "b": [0.2808, 0.2497, 0.3004, 0.2694]}, {"w": "a", "b": [0.3067, 0.2497, 0.3179, 0.2694]}, {"w": "principled", "b": [0.3242, 0.2497, 0.4265, 0.2694]}, {"w": "way.", "b": [0.4328, 0.2497, 0.4794, 0.2694]}, {"w": "At", "b": [0.4857, 0.2497, 0.511, 0.2694]}, {"w": "the", "b": [0.5173, 0.2497, 0.5481, 0.2694]}, {"w": "time", "b": [0.5544, 0.2497, 0.5993, 0.2694]}, {"w": "of", "b": [0.6056, 0.2497, 0.6266, 0.2694]}, {"w": "writing,", "b": [0.6329, 0.2497, 0.7121, 0.2694]}, {"w": "the", "b": [0.7183, 0.2497, 0.7492, 0.2694]}, {"w": "field", "b": [0.7555, 0.2497, 0.8017, 0.2694]}, {"w": "of", "b": [0.808, 0.2497, 0.829, 0.2694]}, {"w": "automatic", "b": [0.1294, 0.2702, 0.2289, 0.2899]}, {"w": "hyperparameter", "b": [0.2352, 0.2702, 0.3935, 0.2899]}, {"w": "optimization", "b": [0.3998, 0.2702, 0.5273, 0.2899]}, {"w": "is", "b": [0.5337, 0.2702, 0.5505, 0.2899]}, {"w": "very", "b": [0.5568, 0.2702, 0.6016, 0.2899]}, {"w": "young", "b": [0.6079, 0.2702, 0.671, 0.2899]}, {"w": "and", "b": [0.6773, 0.2702, 0.7137, 0.2899]}, {"w": "immature,", "b": [0.72, 0.2702, 0.823, 0.2899]}, {"w": "as", "b": [0.8293, 0.2702, 0.8503, 0.2899]}, {"w": "deep", "b": [0.1294, 0.2907, 0.177, 0.3104]}, {"w": "learning", "b": [0.1833, 0.2907, 0.266, 0.3104]}, {"w": "was", "b": [0.2723, 0.2907, 0.3115, 0.3104]}, {"w": "some", "b": [0.3178, 0.2907, 0.3711, 0.3104]}, {"w": "years", "b": [0.3774, 0.2907, 0.4306, 0.3104]}, {"w": "ago,", "b": [0.4369, 0.2907, 0.4797, 0.3104]}, {"w": "but", "b": [0.486, 0.2907, 0.5182, 0.3104]}, {"w": "I", "b": [0.5245, 0.2907, 0.5329, 0.3104]}, {"w": "expect", "b": [0.5392, 0.2907, 0.605, 0.3104]}, {"w": "it", "b": [0.6113, 0.2907, 0.6254, 0.3104]}, {"w": "to", "b": [0.6317, 0.2907, 0.6513, 0.3104]}, {"w": "boom", "b": [0.6576, 0.2907, 0.7151, 0.3104]}, {"w": "in", "b": [0.7214, 0.2907, 0.741, 0.3104]}, {"w": "the", "b": [0.7473, 0.2907, 0.7781, 0.3104]}, {"w": "next", "b": [0.7844, 0.2907, 0.8279, 0.3104]}, {"w": "few", "b": [0.1294, 0.3112, 0.1672, 0.3309]}, {"w": "years.", "b": [0.1735, 0.3112, 0.2331, 0.3309]}]}, {"id": "b_1", "type": "paragraph", "text": "7.3.3. Model ensembling", "words": [{"w": "7.3.3.", "b": [0.1294, 0.3584, 0.1862, 0.3782]}, {"w": "Model", "b": [0.1925, 0.3584, 0.2611, 0.3782]}, {"w": "ensembling", "b": [0.2674, 0.3584, 0.3894, 0.3782]}]}, {"id": "b_2", "type": "paragraph", "text": "Another powerful technique for obtaining the best possible results on a task is model ensembling. Ensembling consists of pooling together the predictions of a set of different models, to produce better predictions. If you look at machine-learning competitions, in particular on Kaggle, you’ll see that the winners use very large ensembles of models that inevitably beat any single model, no matter how good.", "words": [{"w": "Another", "b": [0.1294, 0.4012, 0.2121, 0.4209]}, {"w": "powerful", "b": [0.2184, 0.4012, 0.3094, 0.4209]}, {"w": "technique", "b": [0.3158, 0.4012, 0.4138, 0.4209]}, {"w": "for", "b": [0.4201, 0.4012, 0.4496, 0.4209]}, {"w": "obtaining", "b": [0.4559, 0.4012, 0.5512, 0.4209]}, {"w": "the", "b": [0.5575, 0.4012, 0.5883, 0.4209]}, {"w": "best", "b": [0.5946, 0.4012, 0.6352, 0.4209]}, {"w": "possible", "b": [0.6415, 0.4012, 0.7242, 0.4209]}, {"w": "results", "b": [0.7305, 0.4012, 0.7964, 0.4209]}, {"w": "on", "b": [0.8027, 0.4012, 0.8279, 0.4209]}, {"w": "a", "b": [0.8342, 0.4012, 0.8454, 0.4209]}, {"w": "task", "b": [0.1294, 0.4217, 0.1701, 0.4414]}, {"w": "is", "b": [0.1764, 0.4217, 0.1932, 0.4414]}, {"w": "model", "b": [0.1995, 0.4217, 0.2611, 0.4414]}, {"w": "ensembling.", "b": [0.2674, 0.4217, 0.3886, 0.4414]}, {"w": "Ensembling", "b": [0.3949, 0.4217, 0.5155, 0.4414]}, {"w": "consists", "b": [0.5218, 0.4217, 0.6017, 0.4414]}, {"w": "of", "b": [0.608, 0.4217, 0.629, 0.4414]}, {"w": "pooling", "b": [0.6353, 0.4217, 0.7124, 0.4414]}, {"w": "together", "b": [0.7187, 0.4217, 0.8013, 0.4414]}, {"w": "the", "b": [0.8077, 0.4217, 0.8385, 0.4414]}, {"w": "predictions", "b": [0.1294, 0.4422, 0.2415, 0.4619]}, {"w": "of", "b": [0.2478, 0.4422, 0.2688, 0.4619]}, {"w": "a", "b": [0.2751, 0.4422, 0.2863, 0.4619]}, {"w": "set", "b": [0.2926, 0.4422, 0.3207, 0.4619]}, {"w": "of", "b": [0.327, 0.4422, 0.348, 0.4619]}, {"w": "different", "b": [0.3543, 0.4422, 0.4407, 0.4619]}, {"w": "models,", "b": [0.447, 0.4422, 0.5262, 0.4619]}, {"w": "to", "b": [0.5325, 0.4422, 0.5521, 0.4619]}, {"w": "produce", "b": [0.5584, 0.4422, 0.6396, 0.4619]}, {"w": "better", "b": [0.646, 0.4422, 0.7034, 0.4619]}, {"w": "predictions.", "b": [0.7097, 0.4422, 0.8281, 0.4619]}, {"w": "If", "b": [0.8344, 0.4422, 0.8512, 0.4619]}, {"w": "you", "b": [0.1294, 0.4627, 0.1673, 0.4824]}, {"w": "look", "b": [0.1736, 0.4627, 0.2184, 0.4824]}, {"w": "at", "b": [0.2247, 0.4627, 0.2429, 0.4824]}, {"w": "machine-learning", "b": [0.2492, 0.4627, 0.4258, 0.4824]}, {"w": "competitions,", "b": [0.4321, 0.4627, 0.5687, 0.4824]}, {"w": "in", "b": [0.5749, 0.4627, 0.5946, 0.4824]}, {"w": "particular", "b": [0.6009, 0.4627, 0.6975, 0.4824]}, {"w": "on", "b": [0.7038, 0.4627, 0.7291, 0.4824]}, {"w": "Kaggle,", "b": [0.7354, 0.4627, 0.8145, 0.4824]}, {"w": "you’ll", "b": [0.1294, 0.4832, 0.1897, 0.5029]}, {"w": "see", "b": [0.196, 0.4832, 0.2282, 0.5029]}, {"w": "that", "b": [0.2345, 0.4832, 0.2723, 0.5029]}, {"w": "the", "b": [0.2786, 0.4832, 0.3095, 0.5029]}, {"w": "winners", "b": [0.3158, 0.4832, 0.3956, 0.5029]}, {"w": "use", "b": [0.402, 0.4832, 0.4356, 0.5029]}, {"w": "very", "b": [0.4419, 0.4832, 0.4867, 0.5029]}, {"w": "large", "b": [0.493, 0.4832, 0.5429, 0.5029]}, {"w": "ensembles", "b": [0.5492, 0.4832, 0.6543, 0.5029]}, {"w": "of", "b": [0.6606, 0.4832, 0.6817, 0.5029]}, {"w": "models", "b": [0.688, 0.4832, 0.7608, 0.5029]}, {"w": "that", "b": [0.7672, 0.4832, 0.805, 0.5029]}, {"w": "inevitably", "b": [0.1294, 0.5037, 0.2303, 0.5234]}, {"w": "beat", "b": [0.2366, 0.5037, 0.2786, 0.5234]}, {"w": "any", "b": [0.285, 0.5037, 0.3214, 0.5234]}, {"w": "single", "b": [0.3277, 0.5037, 0.388, 0.5234]}, {"w": "model,", "b": [0.3943, 0.5037, 0.4636, 0.5234]}, {"w": "no", "b": [0.4699, 0.5037, 0.4951, 0.5234]}, {"w": "matter", "b": [0.5014, 0.5037, 0.5658, 0.5234]}, {"w": "how", "b": [0.5722, 0.5037, 0.6156, 0.5234]}, {"w": "good.", "b": [0.6219, 0.5037, 0.6787, 0.5234]}]}, {"id": "b_3", "type": "paragraph", "text": "Ensembling relies on the assumption that different good models trained independently are likely to be good for different reasons: each model looks at slightly different aspects of the data to make its predictions, getting part of the “truth” but not all of it. You may be familiar with the ancient parable of the blind men and the elephant: a group of blind men come across an elephant for the first time and try to understand what the elephant is by touching it. Each man touches a different part of the elephant’s body—just one part, such as the trunk or a leg. Then the men describe to each other what an elephant is: “It’s like a snake,” “Like a pillar or a tree,” and so on. The blind men are essentially machine- learning models trying to understand the manifold of the training data, each from its own perspective, using its own assumptions (provided by the unique architecture of the model and the unique random weight initialization). Each of them gets part of the truth of the data, but not the whole truth. By pooling their perspectives together, you can get a far more accurate description of the data. The elephant is a combination of", "words": [{"w": "Ensembling", "b": [0.1294, 0.5465, 0.2499, 0.5662]}, {"w": "relies", "b": [0.2562, 0.5465, 0.3109, 0.5662]}, {"w": "on", "b": [0.3172, 0.5465, 0.3424, 0.5662]}, {"w": "the", "b": [0.3487, 0.5465, 0.3796, 0.5662]}, {"w": "assumption", "b": [0.3859, 0.5465, 0.5008, 0.5662]}, {"w": "that", "b": [0.5071, 0.5465, 0.5449, 0.5662]}, {"w": "different", "b": [0.5512, 0.5465, 0.6376, 0.5662]}, {"w": "good", "b": [0.6439, 0.5465, 0.6943, 0.5662]}, {"w": "models", "b": [0.7006, 0.5465, 0.7735, 0.5662]}, {"w": "trained", "b": [0.7798, 0.5465, 0.8499, 0.5662]}, {"w": "independently", "b": [0.1294, 0.567, 0.2723, 0.5867]}, {"w": "are", "b": [0.2786, 0.567, 0.3094, 0.5867]}, {"w": "likely", "b": [0.3158, 0.567, 0.3732, 0.5867]}, {"w": "to", "b": [0.3795, 0.567, 0.3992, 0.5867]}, {"w": "be", "b": [0.4055, 0.567, 0.4293, 0.5867]}, {"w": "good", "b": [0.4356, 0.567, 0.486, 0.5867]}, {"w": "for", "b": [0.4923, 0.567, 0.5217, 0.5867]}, {"w": "different", "b": [0.528, 0.567, 0.6125, 0.5867]}, {"w": "reasons:", "b": [0.6188, 0.567, 0.7034, 0.5867]}, {"w": "each", "b": [0.7097, 0.567, 0.7559, 0.5867]}, {"w": "model", "b": [0.7622, 0.567, 0.8253, 0.5867]}, {"w": "looks", "b": [0.1294, 0.5875, 0.1841, 0.6072]}, {"w": "at", "b": [0.1904, 0.5875, 0.2086, 0.6072]}, {"w": "slightly", "b": [0.2149, 0.5875, 0.2906, 0.6072]}, {"w": "different", "b": [0.2969, 0.5875, 0.3833, 0.6072]}, {"w": "aspects", "b": [0.3896, 0.5875, 0.4624, 0.6072]}, {"w": "of", "b": [0.4687, 0.5875, 0.4898, 0.6072]}, {"w": "the", "b": [0.4961, 0.5875, 0.5269, 0.6072]}, {"w": "data", "b": [0.5332, 0.5875, 0.5752, 0.6072]}, {"w": "to", "b": [0.5815, 0.5875, 0.6012, 0.6072]}, {"w": "make", "b": [0.6075, 0.5875, 0.6621, 0.6072]}, {"w": "its", "b": [0.6684, 0.5875, 0.6922, 0.6072]}, {"w": "predictions,", "b": [0.6986, 0.5875, 0.817, 0.6072]}, {"w": "getting", "b": [0.1294, 0.608, 0.1995, 0.6277]}, {"w": "part", "b": [0.2058, 0.608, 0.245, 0.6277]}, {"w": "of", "b": [0.2513, 0.608, 0.2723, 0.6277]}, {"w": "the", "b": [0.2786, 0.608, 0.3095, 0.6277]}, {"w": "“truth”", "b": [0.3158, 0.608, 0.3858, 0.6277]}, {"w": "but", "b": [0.3921, 0.608, 0.4244, 0.6277]}, {"w": "not", "b": [0.4307, 0.608, 0.4629, 0.6277]}, {"w": "all", "b": [0.4692, 0.608, 0.4944, 0.6277]}, {"w": "of", "b": [0.5007, 0.608, 0.5217, 0.6277]}, {"w": "it.", "b": [0.528, 0.608, 0.5484, 0.6277]}, {"w": "You", "b": [0.5547, 0.608, 0.5956, 0.6277]}, {"w": "may", "b": [0.6019, 0.608, 0.6453, 0.6277]}, {"w": "be", "b": [0.6516, 0.608, 0.6754, 0.6277]}, {"w": "familiar", "b": [0.6817, 0.608, 0.7616, 0.6277]}, {"w": "with", "b": [0.7679, 0.608, 0.8128, 0.6277]}, {"w": "the", "b": [0.8191, 0.608, 0.8499, 0.6277]}, {"w": "ancient", "b": [0.1294, 0.6285, 0.2023, 0.6482]}, {"w": "parable", "b": [0.2086, 0.6285, 0.2828, 0.6482]}, {"w": "of", "b": [0.2891, 0.6285, 0.3101, 0.6482]}, {"w": "the", "b": [0.3164, 0.6285, 0.3473, 0.6482]}, {"w": "blind", "b": [0.3536, 0.6285, 0.4054, 0.6482]}, {"w": "men", "b": [0.4117, 0.6285, 0.4552, 0.6482]}, {"w": "and", "b": [0.4615, 0.6285, 0.4979, 0.6482]}, {"w": "the", "b": [0.5042, 0.6285, 0.535, 0.6482]}, {"w": "elephant:", "b": [0.5413, 0.6285, 0.6338, 0.6482]}, {"w": "a", "b": [0.6401, 0.6285, 0.6513, 0.6482]}, {"w": "group", "b": [0.6576, 0.6285, 0.7165, 0.6482]}, {"w": "of", "b": [0.7228, 0.6285, 0.7438, 0.6482]}, {"w": "blind", "b": [0.7501, 0.6285, 0.802, 0.6482]}, {"w": "men", "b": [0.8083, 0.6285, 0.8517, 0.6482]}, {"w": "come", "b": [0.1294, 0.649, 0.1841, 0.6687]}, {"w": "across", "b": [0.1904, 0.649, 0.2534, 0.6687]}, {"w": "an", "b": [0.2597, 0.649, 0.2835, 0.6687]}, {"w": "elephant", "b": [0.2898, 0.649, 0.3753, 0.6687]}, {"w": "for", "b": [0.3816, 0.649, 0.411, 0.6687]}, {"w": "the", "b": [0.4173, 0.649, 0.4481, 0.6687]}, {"w": "first", "b": [0.4544, 0.649, 0.4951, 0.6687]}, {"w": "time", "b": [0.5014, 0.649, 0.5462, 0.6687]}, {"w": "and", "b": [0.5525, 0.649, 0.589, 0.6687]}, {"w": "try", "b": [0.5953, 0.649, 0.6233, 0.6687]}, {"w": "to", "b": [0.6296, 0.649, 0.6492, 0.6687]}, {"w": "understand", "b": [0.6555, 0.649, 0.7662, 0.6687]}, {"w": "what", "b": [0.7725, 0.649, 0.8216, 0.6687]}, {"w": "the", "b": [0.8279, 0.649, 0.8587, 0.6687]}, {"w": "elephant", "b": [0.1294, 0.6695, 0.2149, 0.6892]}, {"w": "is", "b": [0.2212, 0.6695, 0.238, 0.6892]}, {"w": "by", "b": [0.2443, 0.6695, 0.2695, 0.6892]}, {"w": "touching", "b": [0.2758, 0.6695, 0.3641, 0.6892]}, {"w": "it.", "b": [0.3704, 0.6695, 0.3908, 0.6892]}, {"w": "Each", "b": [0.3971, 0.6695, 0.4475, 0.6892]}, {"w": "man", "b": [0.4538, 0.6695, 0.4973, 0.6892]}, {"w": "touches", "b": [0.5036, 0.6695, 0.5806, 0.6892]}, {"w": "a", "b": [0.5869, 0.6695, 0.5981, 0.6892]}, {"w": "different", "b": [0.6044, 0.6695, 0.6908, 0.6892]}, {"w": "part", "b": [0.6971, 0.6695, 0.7363, 0.6892]}, {"w": "of", "b": [0.7426, 0.6695, 0.7636, 0.6892]}, {"w": "the", "b": [0.7699, 0.6695, 0.8007, 0.6892]}, {"w": "elephant’s", "b": [0.1294, 0.69, 0.2317, 0.7097]}, {"w": "body—just", "b": [0.238, 0.69, 0.3501, 0.7097]}, {"w": "one", "b": [0.3564, 0.69, 0.3928, 0.7097]}, {"w": "part,", "b": [0.3992, 0.69, 0.4447, 0.7097]}, {"w": "such", "b": [0.451, 0.69, 0.4972, 0.7097]}, {"w": "as", "b": [0.5035, 0.69, 0.5245, 0.7097]}, {"w": "the", "b": [0.5309, 0.69, 0.5617, 0.7097]}, {"w": "trunk", "b": [0.568, 0.69, 0.6212, 0.7097]}, {"w": "or", "b": [0.6275, 0.69, 0.6486, 0.7097]}, {"w": "a", "b": [0.6549, 0.69, 0.6661, 0.7097]}, {"w": "leg.", "b": [0.6724, 0.69, 0.7095, 0.7097]}, {"w": "Then", "b": [0.7158, 0.69, 0.7676, 0.7097]}, {"w": "the", "b": [0.774, 0.69, 0.8048, 0.7097]}, {"w": "men", "b": [0.8111, 0.69, 0.8545, 0.7097]}, {"w": "describe", "b": [0.1294, 0.7105, 0.2135, 0.7302]}, {"w": "to", "b": [0.2198, 0.7105, 0.2394, 0.7302]}, {"w": "each", "b": [0.2457, 0.7105, 0.2919, 0.7302]}, {"w": "other", "b": [0.2982, 0.7105, 0.3501, 0.7302]}, {"w": "what", "b": [0.3564, 0.7105, 0.4054, 0.7302]}, {"w": "an", "b": [0.4117, 0.7105, 0.4355, 0.7302]}, {"w": "elephant", "b": [0.4418, 0.7105, 0.5273, 0.7302]}, {"w": "is:", "b": [0.5336, 0.7105, 0.5574, 0.7302]}, {"w": "“It’s", "b": [0.5637, 0.7105, 0.6071, 0.7302]}, {"w": "like", "b": [0.6134, 0.7105, 0.6512, 0.7302]}, {"w": "a", "b": [0.6575, 0.7105, 0.6687, 0.7302]}, {"w": "snake,”", "b": [0.6751, 0.7105, 0.75, 0.7302]}, {"w": "“Like", "b": [0.7563, 0.7105, 0.8137, 0.7302]}, {"w": "a", "b": [0.8201, 0.7105, 0.8313, 0.7302]}, {"w": "pillar", "b": [0.1294, 0.731, 0.1827, 0.7507]}, {"w": "or", "b": [0.189, 0.731, 0.21, 0.7507]}, {"w": "a", "b": [0.2163, 0.731, 0.2275, 0.7507]}, {"w": "tree,”", "b": [0.2338, 0.731, 0.2891, 0.7507]}, {"w": "and", "b": [0.2954, 0.731, 0.3318, 0.7507]}, {"w": "so", "b": [0.3382, 0.731, 0.3606, 0.7507]}, {"w": "on.", "b": [0.3669, 0.731, 0.3984, 0.7507]}, {"w": "The", "b": [0.4047, 0.731, 0.444, 0.7507]}, {"w": "blind", "b": [0.4503, 0.731, 0.5021, 0.7507]}, {"w": "men", "b": [0.5084, 0.731, 0.5519, 0.7507]}, {"w": "are", "b": [0.5582, 0.731, 0.589, 0.7507]}, {"w": "essentially", "b": [0.5953, 0.731, 0.7018, 0.7507]}, {"w": "machine-", "b": [0.7081, 0.731, 0.802, 0.7507]}, {"w": "learning", "b": [0.1294, 0.7515, 0.2121, 0.7712]}, {"w": "models", "b": [0.2184, 0.7515, 0.2913, 0.7712]}, {"w": "trying", "b": [0.2976, 0.7515, 0.3578, 0.7712]}, {"w": "to", "b": [0.3641, 0.7515, 0.3838, 0.7712]}, {"w": "understand", "b": [0.39, 0.7515, 0.5007, 0.7712]}, {"w": "the", "b": [0.507, 0.7515, 0.5378, 0.7712]}, {"w": "manifold", "b": [0.5442, 0.7515, 0.6352, 0.7712]}, {"w": "of", "b": [0.6416, 0.7515, 0.6626, 0.7712]}, {"w": "the", "b": [0.6689, 0.7515, 0.6997, 0.7712]}, {"w": "training", "b": [0.706, 0.7515, 0.7845, 0.7712]}, {"w": "data,", "b": [0.7908, 0.7515, 0.8391, 0.7712]}, {"w": "each", "b": [0.1294, 0.772, 0.1756, 0.7917]}, {"w": "from", "b": [0.1819, 0.772, 0.231, 0.7917]}, {"w": "its", "b": [0.2373, 0.772, 0.2611, 0.7917]}, {"w": "own", "b": [0.2674, 0.772, 0.3109, 0.7917]}, {"w": "perspective,", "b": [0.3172, 0.772, 0.4384, 0.7917]}, {"w": "using", "b": [0.4447, 0.772, 0.4993, 0.7917]}, {"w": "its", "b": [0.5056, 0.772, 0.5295, 0.7917]}, {"w": "own", "b": [0.5358, 0.772, 0.5792, 0.7917]}, {"w": "assumptions", "b": [0.5855, 0.772, 0.7103, 0.7917]}, {"w": "(provided", "b": [0.7166, 0.772, 0.8146, 0.7917]}, {"w": "by", "b": [0.821, 0.772, 0.8462, 0.7917]}, {"w": "the", "b": [0.1294, 0.7925, 0.1602, 0.8122]}, {"w": "unique", "b": [0.1665, 0.7925, 0.2352, 0.8122]}, {"w": "architecture", "b": [0.2415, 0.7925, 0.3606, 0.8122]}, {"w": "of", "b": [0.3669, 0.7925, 0.3879, 0.8122]}, {"w": "the", "b": [0.3942, 0.7925, 0.425, 0.8122]}, {"w": "model", "b": [0.4313, 0.7925, 0.4944, 0.8122]}, {"w": "and", "b": [0.5007, 0.7925, 0.5371, 0.8122]}, {"w": "the", "b": [0.5434, 0.7925, 0.5742, 0.8122]}, {"w": "unique", "b": [0.5805, 0.7925, 0.6492, 0.8122]}, {"w": "random", "b": [0.6555, 0.7925, 0.7326, 0.8122]}, {"w": "weight", "b": [0.7389, 0.7925, 0.8076, 0.8122]}, {"w": "initialization).", "b": [0.1294, 0.813, 0.2717, 0.8327]}, {"w": "Each", "b": [0.278, 0.813, 0.3284, 0.8327]}, {"w": "of", "b": [0.3347, 0.813, 0.3557, 0.8327]}, {"w": "them", "b": [0.362, 0.813, 0.4125, 0.8327]}, {"w": "gets", "b": [0.4188, 0.813, 0.4594, 0.8327]}, {"w": "part", "b": [0.4657, 0.813, 0.5049, 0.8327]}, {"w": "of", "b": [0.5113, 0.813, 0.5323, 0.8327]}, {"w": "the", "b": [0.5386, 0.813, 0.5694, 0.8327]}, {"w": "truth", "b": [0.5757, 0.813, 0.6234, 0.8327]}, {"w": "of", "b": [0.6297, 0.813, 0.6507, 0.8327]}, {"w": "the", "b": [0.657, 0.813, 0.6878, 0.8327]}, {"w": "data,", "b": [0.6941, 0.813, 0.7424, 0.8327]}, {"w": "but", "b": [0.7488, 0.813, 0.781, 0.8327]}, {"w": "not", "b": [0.7872, 0.813, 0.8194, 0.8327]}, {"w": "the", "b": [0.8257, 0.813, 0.8565, 0.8327]}, {"w": "whole", "b": [0.1294, 0.8335, 0.1911, 0.8532]}, {"w": "truth.", "b": [0.1974, 0.8335, 0.2513, 0.8532]}, {"w": "By", "b": [0.2576, 0.8335, 0.2871, 0.8532]}, {"w": "pooling", "b": [0.2934, 0.8335, 0.3705, 0.8532]}, {"w": "their", "b": [0.3768, 0.8335, 0.423, 0.8532]}, {"w": "perspectives", "b": [0.4293, 0.8335, 0.554, 0.8532]}, {"w": "together,", "b": [0.5603, 0.8335, 0.6482, 0.8532]}, {"w": "you", "b": [0.6545, 0.8335, 0.6924, 0.8532]}, {"w": "can", "b": [0.6987, 0.8335, 0.7337, 0.8532]}, {"w": "get", "b": [0.74, 0.8335, 0.7708, 0.8532]}, {"w": "a", "b": [0.7771, 0.8335, 0.7883, 0.8532]}, {"w": "far", "b": [0.7946, 0.8335, 0.8226, 0.8532]}, {"w": "more", "b": [0.1294, 0.854, 0.1813, 0.8737]}, {"w": "accurate", "b": [0.1876, 0.854, 0.2716, 0.8737]}, {"w": "description", "b": [0.2779, 0.854, 0.39, 0.8737]}, {"w": "of", "b": [0.3963, 0.854, 0.4173, 0.8737]}, {"w": "the", "b": [0.4236, 0.854, 0.4544, 0.8737]}, {"w": "data.", "b": [0.4608, 0.854, 0.5091, 0.8737]}, {"w": "The", "b": [0.5154, 0.854, 0.5546, 0.8737]}, {"w": "elephant", "b": [0.5608, 0.854, 0.6463, 0.8737]}, {"w": "is", "b": [0.6526, 0.854, 0.6694, 0.8737]}, {"w": "a", "b": [0.6757, 0.854, 0.6869, 0.8737]}, {"w": "combination", "b": [0.6932, 0.854, 0.8194, 0.8737]}, {"w": "of", "b": [0.8257, 0.854, 0.8467, 0.8737]}]}]}, {"page": 347, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "parts: not any single blind man gets it quite right, but, interviewed together, they can tell a fairly accurate story.", "words": [{"w": "parts:", "b": [0.1294, 0.0857, 0.1855, 0.1054]}, {"w": "not", "b": [0.1918, 0.0857, 0.224, 0.1054]}, {"w": "any", "b": [0.2303, 0.0857, 0.2667, 0.1054]}, {"w": "single", "b": [0.273, 0.0857, 0.3333, 0.1054]}, {"w": "blind", "b": [0.3396, 0.0857, 0.3915, 0.1054]}, {"w": "man", "b": [0.3978, 0.0857, 0.4412, 0.1054]}, {"w": "gets", "b": [0.4475, 0.0857, 0.4882, 0.1054]}, {"w": "it", "b": [0.4945, 0.0857, 0.5085, 0.1054]}, {"w": "quite", "b": [0.5148, 0.0857, 0.5653, 0.1054]}, {"w": "right,", "b": [0.5716, 0.0857, 0.6255, 0.1054]}, {"w": "but,", "b": [0.6318, 0.0857, 0.6704, 0.1054]}, {"w": "interviewed", "b": [0.6767, 0.0857, 0.7958, 0.1054]}, {"w": "together,", "b": [0.1294, 0.1062, 0.2174, 0.1259]}, {"w": "they", "b": [0.2237, 0.1062, 0.2671, 0.1259]}, {"w": "can", "b": [0.2734, 0.1062, 0.3084, 0.1259]}, {"w": "tell", "b": [0.3147, 0.1062, 0.347, 0.1259]}, {"w": "a", "b": [0.3532, 0.1062, 0.3644, 0.1259]}, {"w": "fairly", "b": [0.3707, 0.1062, 0.4254, 0.1259]}, {"w": "accurate", "b": [0.4317, 0.1062, 0.5157, 0.1259]}, {"w": "story.", "b": [0.522, 0.1062, 0.5771, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Let’s use classification as an example. The easiest way to pool the predictions of a set of classifiers (to ensemble the classifiers) is to average their predictions at inference time:", "words": [{"w": "Let’s", "b": [0.1294, 0.149, 0.1798, 0.1687]}, {"w": "use", "b": [0.1862, 0.149, 0.2198, 0.1687]}, {"w": "classification", "b": [0.2261, 0.149, 0.3592, 0.1687]}, {"w": "as", "b": [0.3655, 0.149, 0.3865, 0.1687]}, {"w": "an", "b": [0.3928, 0.149, 0.4166, 0.1687]}, {"w": "example.", "b": [0.4229, 0.149, 0.5147, 0.1687]}, {"w": "The", "b": [0.521, 0.149, 0.5603, 0.1687]}, {"w": "easiest", "b": [0.5666, 0.149, 0.6338, 0.1687]}, {"w": "way", "b": [0.6401, 0.149, 0.6821, 0.1687]}, {"w": "to", "b": [0.6884, 0.149, 0.7081, 0.1687]}, {"w": "pool", "b": [0.7144, 0.149, 0.7592, 0.1687]}, {"w": "the", "b": [0.7655, 0.149, 0.7964, 0.1687]}, {"w": "predictions", "b": [0.1294, 0.1695, 0.2415, 0.1892]}, {"w": "of", "b": [0.2478, 0.1695, 0.2688, 0.1892]}, {"w": "a", "b": [0.2751, 0.1695, 0.2863, 0.1892]}, {"w": "set", "b": [0.2926, 0.1695, 0.3207, 0.1892]}, {"w": "of", "b": [0.327, 0.1695, 0.348, 0.1892]}, {"w": "classifiers", "b": [0.3543, 0.1695, 0.4552, 0.1892]}, {"w": "(to", "b": [0.4615, 0.1695, 0.4895, 0.1892]}, {"w": "ensemble", "b": [0.4958, 0.1695, 0.5896, 0.1892]}, {"w": "the", "b": [0.5959, 0.1695, 0.6268, 0.1892]}, {"w": "classifiers)", "b": [0.6331, 0.1695, 0.7438, 0.1892]}, {"w": "is", "b": [0.7501, 0.1695, 0.7669, 0.1892]}, {"w": "to", "b": [0.7732, 0.1695, 0.7928, 0.1892]}, {"w": "average", "b": [0.1294, 0.19, 0.2078, 0.2097]}, {"w": "their", "b": [0.2141, 0.19, 0.2604, 0.2097]}, {"w": "predictions", "b": [0.2667, 0.19, 0.3788, 0.2097]}, {"w": "at", "b": [0.3851, 0.19, 0.4033, 0.2097]}, {"w": "inference", "b": [0.4096, 0.19, 0.5035, 0.2097]}, {"w": "time:", "b": [0.5098, 0.19, 0.5616, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "preds_a = model_a.predict(x_val) 1 preds_b = model_b.predict(x_val) 1 preds_c = model_c.predict(x_val) 1 preds_d = model_d.predict(x_val) 1 final_preds = 0.25 * (preds_a + preds_b + preds_c + preds_d) 2", "words": [{"w": "preds_a", "b": [0.1357, 0.2277, 0.2152, 0.2428]}, {"w": "=", "b": [0.2265, 0.2277, 0.2379, 0.2428]}, {"w": "model_a.predict(x_val)", "b": [0.2492, 0.2277, 0.499, 0.2428]}, {"w": "1", "b": [0.1357, 0.2428, 0.1471, 0.258]}, {"w": "preds_b", "b": [0.1357, 0.258, 0.2152, 0.2731]}, {"w": "=", "b": [0.2265, 0.258, 0.2379, 0.2731]}, {"w": "model_b.predict(x_val)", "b": [0.2492, 0.258, 0.499, 0.2731]}, {"w": "1", "b": [0.1357, 0.2732, 0.1471, 0.2883]}, {"w": "preds_c", "b": [0.1357, 0.2883, 0.2152, 0.3034]}, {"w": "=", "b": [0.2265, 0.2883, 0.2379, 0.3034]}, {"w": "model_c.predict(x_val)", "b": [0.2492, 0.2883, 0.499, 0.3034]}, {"w": "1", "b": [0.1357, 0.3035, 0.1471, 0.3186]}, {"w": "preds_d", "b": [0.1357, 0.3186, 0.2152, 0.3338]}, {"w": "=", "b": [0.2265, 0.3186, 0.2379, 0.3338]}, {"w": "model_d.predict(x_val)", "b": [0.2492, 0.3186, 0.499, 0.3338]}, {"w": "1", "b": [0.1357, 0.3338, 0.1471, 0.3489]}, {"w": "final_preds", "b": [0.1357, 0.3641, 0.2606, 0.3792]}, {"w": "=", "b": [0.2719, 0.3641, 0.2833, 0.3792]}, {"w": "0.25", "b": [0.2946, 0.3641, 0.34, 0.3792]}, {"w": "*", "b": [0.3514, 0.3641, 0.3628, 0.3792]}, {"w": "(preds_a", "b": [0.3741, 0.3641, 0.4649, 0.3792]}, {"w": "+", "b": [0.4763, 0.3641, 0.4876, 0.3792]}, {"w": "preds_b", "b": [0.499, 0.3641, 0.5784, 0.3792]}, {"w": "+", "b": [0.5898, 0.3641, 0.6011, 0.3792]}, {"w": "preds_c", "b": [0.6125, 0.3641, 0.6919, 0.3792]}, {"w": "+", "b": [0.7033, 0.3641, 0.7146, 0.3792]}, {"w": "preds_d)", "b": [0.726, 0.3641, 0.8168, 0.3792]}, {"w": "2", "b": [0.1357, 0.3792, 0.1471, 0.3944]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Use four different models to compute initial predictions. 2 This new prediction array should be more accurate than any of the initial ones.", "words": [{"w": "1", "b": [0.1799, 0.4128, 0.1925, 0.4325]}, {"w": "Use", "b": [0.1988, 0.4128, 0.238, 0.4325]}, {"w": "four", "b": [0.2443, 0.4128, 0.2906, 0.4325]}, {"w": "different", "b": [0.2969, 0.4128, 0.3903, 0.4325]}, {"w": "models", "b": [0.3966, 0.4128, 0.4723, 0.4325]}, {"w": "to", "b": [0.4786, 0.4128, 0.4996, 0.4325]}, {"w": "compute", "b": [0.5059, 0.4128, 0.5984, 0.4325]}, {"w": "initial", "b": [0.6047, 0.4128, 0.6678, 0.4325]}, {"w": "predictions.", "b": [0.6741, 0.4128, 0.8004, 0.4325]}, {"w": "2", "b": [0.1799, 0.4333, 0.1925, 0.453]}, {"w": "This", "b": [0.1988, 0.4333, 0.2465, 0.453]}, {"w": "new", "b": [0.2528, 0.4333, 0.2962, 0.453]}, {"w": "prediction", "b": [0.3025, 0.4333, 0.4128, 0.453]}, {"w": "array", "b": [0.4191, 0.4333, 0.4793, 0.453]}, {"w": "should", "b": [0.4856, 0.4333, 0.5571, 0.453]}, {"w": "be", "b": [0.5635, 0.4333, 0.5887, 0.453]}, {"w": "more", "b": [0.595, 0.4333, 0.6505, 0.453]}, {"w": "accurate", "b": [0.6569, 0.4333, 0.7493, 0.453]}, {"w": "than", "b": [0.7556, 0.4333, 0.8047, 0.453]}, {"w": "any", "b": [0.811, 0.4333, 0.8502, 0.453]}, {"w": "of", "b": [0.1799, 0.4538, 0.2009, 0.4735]}, {"w": "the", "b": [0.2072, 0.4538, 0.2408, 0.4735]}, {"w": "initial", "b": [0.2471, 0.4538, 0.3102, 0.4735]}, {"w": "ones.", "b": [0.3165, 0.4538, 0.3705, 0.4735]}]}, {"id": "b_4", "type": "paragraph", "text": "This will work only if the classifiers are more or less equally good. If one of them is significantly worse than the others, the final predictions may not be as good as the best classifier of the group.", "words": [{"w": "This", "b": [0.1294, 0.4966, 0.1743, 0.5163]}, {"w": "will", "b": [0.1806, 0.4966, 0.2198, 0.5163]}, {"w": "work", "b": [0.2261, 0.4966, 0.278, 0.5163]}, {"w": "only", "b": [0.2843, 0.4966, 0.3291, 0.5163]}, {"w": "if", "b": [0.3354, 0.4966, 0.3508, 0.5163]}, {"w": "the", "b": [0.3572, 0.4966, 0.388, 0.5163]}, {"w": "classifiers", "b": [0.3943, 0.4966, 0.4952, 0.5163]}, {"w": "are", "b": [0.5015, 0.4966, 0.5323, 0.5163]}, {"w": "more", "b": [0.5386, 0.4966, 0.5904, 0.5163]}, {"w": "or", "b": [0.5967, 0.4966, 0.6177, 0.5163]}, {"w": "less", "b": [0.624, 0.4966, 0.6619, 0.5163]}, {"w": "equally", "b": [0.6682, 0.4966, 0.7424, 0.5163]}, {"w": "good.", "b": [0.7488, 0.4966, 0.8055, 0.5163]}, {"w": "If", "b": [0.8118, 0.4966, 0.8286, 0.5163]}, {"w": "one", "b": [0.1294, 0.5171, 0.1658, 0.5368]}, {"w": "of", "b": [0.1721, 0.5171, 0.1932, 0.5368]}, {"w": "them", "b": [0.1995, 0.5171, 0.2499, 0.5368]}, {"w": "is", "b": [0.2562, 0.5171, 0.273, 0.5368]}, {"w": "significantly", "b": [0.2794, 0.5171, 0.4055, 0.5368]}, {"w": "worse", "b": [0.4118, 0.5171, 0.472, 0.5368]}, {"w": "than", "b": [0.4783, 0.5171, 0.5218, 0.5368]}, {"w": "the", "b": [0.5281, 0.5171, 0.5589, 0.5368]}, {"w": "others,", "b": [0.5652, 0.5171, 0.6332, 0.5368]}, {"w": "the", "b": [0.6394, 0.5171, 0.6702, 0.5368]}, {"w": "final", "b": [0.6765, 0.5171, 0.7228, 0.5368]}, {"w": "predictions", "b": [0.7291, 0.5171, 0.8412, 0.5368]}, {"w": "may", "b": [0.1294, 0.5376, 0.1729, 0.5573]}, {"w": "not", "b": [0.1792, 0.5376, 0.2114, 0.5573]}, {"w": "be", "b": [0.2177, 0.5376, 0.2415, 0.5573]}, {"w": "as", "b": [0.2478, 0.5376, 0.2688, 0.5573]}, {"w": "good", "b": [0.2751, 0.5376, 0.3256, 0.5573]}, {"w": "as", "b": [0.3319, 0.5376, 0.3529, 0.5573]}, {"w": "the", "b": [0.3592, 0.5376, 0.39, 0.5573]}, {"w": "best", "b": [0.3964, 0.5376, 0.437, 0.5573]}, {"w": "classifier", "b": [0.4433, 0.5376, 0.5344, 0.5573]}, {"w": "of", "b": [0.5407, 0.5376, 0.5617, 0.5573]}, {"w": "the", "b": [0.568, 0.5376, 0.5988, 0.5573]}, {"w": "group.", "b": [0.6051, 0.5376, 0.6703, 0.5573]}]}, {"id": "b_5", "type": "paragraph", "text": "A smarter way to ensemble classifiers is to do a weighted average, where the weights are learned on the validation data—typically, the better classifiers are given a higher weight, and the worse classifiers are given a lower weight. To search for a good set of ensembling weights, you can use random search or a simple optimization algorithm such as Nelder- Mead:", "words": [{"w": "A", "b": [0.1294, 0.5804, 0.1476, 0.6001]}, {"w": "smarter", "b": [0.1539, 0.5804, 0.2296, 0.6001]}, {"w": "way", "b": [0.2359, 0.5804, 0.2779, 0.6001]}, {"w": "to", "b": [0.2842, 0.5804, 0.3038, 0.6001]}, {"w": "ensemble", "b": [0.3102, 0.5804, 0.4054, 0.6001]}, {"w": "classifiers", "b": [0.4117, 0.5804, 0.5126, 0.6001]}, {"w": "is", "b": [0.5189, 0.5804, 0.5357, 0.6001]}, {"w": "to", "b": [0.5421, 0.5804, 0.5617, 0.6001]}, {"w": "do", "b": [0.568, 0.5804, 0.5932, 0.6001]}, {"w": "a", "b": [0.5995, 0.5804, 0.6107, 0.6001]}, {"w": "weighted", "b": [0.617, 0.5804, 0.7095, 0.6001]}, {"w": "average,", "b": [0.7158, 0.5804, 0.8005, 0.6001]}, {"w": "where", "b": [0.8068, 0.5804, 0.8685, 0.6001]}, {"w": "the", "b": [0.1294, 0.6009, 0.1602, 0.6206]}, {"w": "weights", "b": [0.1665, 0.6009, 0.245, 0.6206]}, {"w": "are", "b": [0.2513, 0.6009, 0.2821, 0.6206]}, {"w": "learned", "b": [0.2884, 0.6009, 0.3627, 0.6206]}, {"w": "on", "b": [0.369, 0.6009, 0.3942, 0.6206]}, {"w": "the", "b": [0.4005, 0.6009, 0.4313, 0.6206]}, {"w": "validation", "b": [0.4376, 0.6009, 0.5385, 0.6206]}, {"w": "data—typically,", "b": [0.5449, 0.6009, 0.705, 0.6206]}, {"w": "the", "b": [0.7113, 0.6009, 0.7421, 0.6206]}, {"w": "better", "b": [0.7484, 0.6009, 0.8058, 0.6206]}, {"w": "classifiers", "b": [0.1294, 0.6214, 0.2303, 0.6411]}, {"w": "are", "b": [0.2366, 0.6214, 0.2674, 0.6411]}, {"w": "given", "b": [0.2737, 0.6214, 0.3298, 0.6411]}, {"w": "a", "b": [0.3361, 0.6214, 0.3473, 0.6411]}, {"w": "higher", "b": [0.3536, 0.6214, 0.418, 0.6411]}, {"w": "weight,", "b": [0.4243, 0.6214, 0.4993, 0.6411]}, {"w": "and", "b": [0.5056, 0.6214, 0.542, 0.6411]}, {"w": "the", "b": [0.5483, 0.6214, 0.5792, 0.6411]}, {"w": "worse", "b": [0.5855, 0.6214, 0.6457, 0.6411]}, {"w": "classifiers", "b": [0.652, 0.6214, 0.7529, 0.6411]}, {"w": "are", "b": [0.7592, 0.6214, 0.79, 0.6411]}, {"w": "given", "b": [0.7963, 0.6214, 0.8524, 0.6411]}, {"w": "a", "b": [0.8587, 0.6214, 0.8699, 0.6411]}, {"w": "lower", "b": [0.1294, 0.6419, 0.1869, 0.6616]}, {"w": "weight.", "b": [0.1932, 0.6419, 0.2681, 0.6616]}, {"w": "To", "b": [0.2744, 0.6419, 0.3007, 0.6616]}, {"w": "search", "b": [0.307, 0.6419, 0.3714, 0.6616]}, {"w": "for", "b": [0.3777, 0.6419, 0.4071, 0.6616]}, {"w": "a", "b": [0.4134, 0.6419, 0.4246, 0.6616]}, {"w": "good", "b": [0.4309, 0.6419, 0.4814, 0.6616]}, {"w": "set", "b": [0.4877, 0.6419, 0.5157, 0.6616]}, {"w": "of", "b": [0.522, 0.6419, 0.543, 0.6616]}, {"w": "ensembling", "b": [0.5493, 0.6419, 0.6657, 0.6616]}, {"w": "weights,", "b": [0.672, 0.6419, 0.7568, 0.6616]}, {"w": "you", "b": [0.7631, 0.6419, 0.8009, 0.6616]}, {"w": "can", "b": [0.8072, 0.6419, 0.8422, 0.6616]}, {"w": "use", "b": [0.1294, 0.6624, 0.163, 0.6821]}, {"w": "random", "b": [0.1693, 0.6624, 0.2464, 0.6821]}, {"w": "search", "b": [0.2527, 0.6624, 0.3171, 0.6821]}, {"w": "or", "b": [0.3234, 0.6624, 0.3445, 0.6821]}, {"w": "a", "b": [0.3508, 0.6624, 0.362, 0.6821]}, {"w": "simple", "b": [0.3683, 0.6624, 0.4356, 0.6821]}, {"w": "optimization", "b": [0.4419, 0.6624, 0.5694, 0.6821]}, {"w": "algorithm", "b": [0.5757, 0.6624, 0.6738, 0.6821]}, {"w": "such", "b": [0.6801, 0.6624, 0.7264, 0.6821]}, {"w": "as", "b": [0.7327, 0.6624, 0.7537, 0.6821]}, {"w": "Nelder-", "b": [0.76, 0.6624, 0.8364, 0.6821]}, {"w": "Mead:", "b": [0.1294, 0.6829, 0.1939, 0.7026]}]}, {"id": "b_6", "type": "paragraph", "text": "preds_a = model_a.predict(x_val) preds_b = model_b.predict(x_val) preds_c = model_c.predict(x_val) preds_d = model_d.predict(x_val) final_preds = 0.5 * preds_a + 0.25 * preds_b + 0.1 * preds_c + 0.15 * preds_d 1", "words": [{"w": "preds_a", "b": [0.1357, 0.7206, 0.2152, 0.7357]}, {"w": "=", "b": [0.2265, 0.7206, 0.2379, 0.7357]}, {"w": "model_a.predict(x_val)", "b": [0.2492, 0.7206, 0.499, 0.7357]}, {"w": "preds_b", "b": [0.1357, 0.7357, 0.2152, 0.7509]}, {"w": "=", "b": [0.2265, 0.7357, 0.2379, 0.7509]}, {"w": "model_b.predict(x_val)", "b": [0.2492, 0.7357, 0.499, 0.7509]}, {"w": "preds_c", "b": [0.1357, 0.7509, 0.2152, 0.766]}, {"w": "=", "b": [0.2265, 0.7509, 0.2379, 0.766]}, {"w": "model_c.predict(x_val)", "b": [0.2492, 0.7509, 0.499, 0.766]}, {"w": "preds_d", "b": [0.1357, 0.766, 0.2152, 0.7812]}, {"w": "=", "b": [0.2265, 0.766, 0.2379, 0.7812]}, {"w": "model_d.predict(x_val)", "b": [0.2492, 0.766, 0.499, 0.7812]}, {"w": "final_preds", "b": [0.1357, 0.7964, 0.2606, 0.8115]}, {"w": "=", "b": [0.2719, 0.7964, 0.2833, 0.8115]}, {"w": "0.5", "b": [0.2946, 0.7964, 0.3287, 0.8115]}, {"w": "*", "b": [0.34, 0.7964, 0.3514, 0.8115]}, {"w": "preds_a", "b": [0.3628, 0.7964, 0.4422, 0.8115]}, {"w": "+", "b": [0.4536, 0.7964, 0.4649, 0.8115]}, {"w": "0.25", "b": [0.4763, 0.7964, 0.5217, 0.8115]}, {"w": "*", "b": [0.533, 0.7964, 0.5444, 0.8115]}, {"w": "preds_b", "b": [0.5557, 0.7964, 0.6352, 0.8115]}, {"w": "+", "b": [0.6465, 0.7964, 0.6579, 0.8115]}, {"w": "0.1", "b": [0.6692, 0.7964, 0.7033, 0.8115]}, {"w": "*", "b": [0.7146, 0.7964, 0.726, 0.8115]}, {"w": "preds_c", "b": [0.7374, 0.7964, 0.8168, 0.8115]}, {"w": "+", "b": [0.8282, 0.7964, 0.8395, 0.8115]}, {"w": "0.15", "b": [0.1357, 0.8115, 0.1811, 0.8267]}, {"w": "*", "b": [0.1925, 0.8115, 0.2038, 0.8267]}, {"w": "preds_d", "b": [0.2152, 0.8115, 0.2946, 0.8267]}, {"w": "1", "b": [0.306, 0.8115, 0.3174, 0.8267]}]}, {"id": "b_7", "type": "paragraph", "text": "1 These weights (0.5, 0.25, 0.1, 0.15) are assumed to be learned empirically.", "words": [{"w": "1", "b": [0.1799, 0.8451, 0.1925, 0.8648]}, {"w": "These", "b": [0.1988, 0.8451, 0.2618, 0.8648]}, {"w": "weights", "b": [0.2682, 0.8451, 0.3494, 0.8648]}, {"w": "(0.5,", "b": [0.3557, 0.8451, 0.402, 0.8648]}, {"w": "0.25,", "b": [0.4083, 0.8451, 0.4587, 0.8648]}, {"w": "0.1,", "b": [0.465, 0.8451, 0.5029, 0.8648]}, {"w": "0.15)", "b": [0.5092, 0.8451, 0.5617, 0.8648]}, {"w": "are", "b": [0.568, 0.8451, 0.6026, 0.8648]}, {"w": "assumed", "b": [0.6089, 0.8451, 0.7014, 0.8648]}, {"w": "to", "b": [0.7077, 0.8451, 0.7287, 0.8648]}, {"w": "be", "b": [0.735, 0.8451, 0.7603, 0.8648]}, {"w": "learned", "b": [0.7666, 0.8451, 0.8478, 0.8648]}, {"w": "empirically.", "b": [0.1799, 0.8656, 0.3067, 0.8853]}]}]}, {"page": 348, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "There are many possible variants: you can do an average of an exponential of the predictions, for instance. In general, a simple weighted average with weights optimized on the validation data provides a very strong baseline.", "words": [{"w": "There", "b": [0.1294, 0.0857, 0.1882, 0.1054]}, {"w": "are", "b": [0.1945, 0.0857, 0.2253, 0.1054]}, {"w": "many", "b": [0.2317, 0.0857, 0.2877, 0.1054]}, {"w": "possible", "b": [0.294, 0.0857, 0.3767, 0.1054]}, {"w": "variants:", "b": [0.383, 0.0857, 0.4699, 0.1054]}, {"w": "you", "b": [0.4762, 0.0857, 0.514, 0.1054]}, {"w": "can", "b": [0.5203, 0.0857, 0.5553, 0.1054]}, {"w": "do", "b": [0.5617, 0.0857, 0.5869, 0.1054]}, {"w": "an", "b": [0.5932, 0.0857, 0.617, 0.1054]}, {"w": "average", "b": [0.6233, 0.0857, 0.7017, 0.1054]}, {"w": "of", "b": [0.708, 0.0857, 0.7291, 0.1054]}, {"w": "an", "b": [0.7354, 0.0857, 0.7592, 0.1054]}, {"w": "exponential", "b": [0.1294, 0.1062, 0.2471, 0.1259]}, {"w": "of", "b": [0.2534, 0.1062, 0.2744, 0.1259]}, {"w": "the", "b": [0.2807, 0.1062, 0.3116, 0.1259]}, {"w": "predictions,", "b": [0.3179, 0.1062, 0.4363, 0.1259]}, {"w": "for", "b": [0.4426, 0.1062, 0.472, 0.1259]}, {"w": "instance.", "b": [0.4783, 0.1062, 0.5673, 0.1259]}, {"w": "In", "b": [0.5736, 0.1062, 0.5946, 0.1259]}, {"w": "general,", "b": [0.6009, 0.1062, 0.6815, 0.1259]}, {"w": "a", "b": [0.6878, 0.1062, 0.699, 0.1259]}, {"w": "simple", "b": [0.7052, 0.1062, 0.7724, 0.1259]}, {"w": "weighted", "b": [0.1294, 0.1267, 0.2219, 0.1464]}, {"w": "average", "b": [0.2282, 0.1267, 0.3066, 0.1464]}, {"w": "with", "b": [0.3129, 0.1267, 0.3578, 0.1464]}, {"w": "weights", "b": [0.3641, 0.1267, 0.4426, 0.1464]}, {"w": "optimized", "b": [0.4489, 0.1267, 0.5498, 0.1464]}, {"w": "on", "b": [0.5561, 0.1267, 0.5813, 0.1464]}, {"w": "the", "b": [0.5876, 0.1267, 0.6184, 0.1464]}, {"w": "validation", "b": [0.6247, 0.1267, 0.7256, 0.1464]}, {"w": "data", "b": [0.732, 0.1267, 0.774, 0.1464]}, {"w": "provides", "b": [0.7803, 0.1267, 0.8672, 0.1464]}, {"w": "a", "b": [0.1294, 0.1472, 0.1406, 0.1669]}, {"w": "very", "b": [0.1469, 0.1472, 0.1917, 0.1669]}, {"w": "strong", "b": [0.1981, 0.1472, 0.2611, 0.1669]}, {"w": "baseline.", "b": [0.2674, 0.1472, 0.3564, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "The key to making ensembling work is the diversity of the set of classifiers. Diversity is strength. If all the blind men only touched the elephant’s trunk, they would agree that elephants are like snakes, and they would forever stay ignorant of the truth of the elephant. Diversity is what makes ensembling work. In machine-learning terms, if all of your models are biased in the same way, then your ensemble will retain this same bias. If your models are biased in different ways, the biases will cancel each other out, and the ensemble will be more robust and more accurate.", "words": [{"w": "The", "b": [0.1294, 0.19, 0.1686, 0.2097]}, {"w": "key", "b": [0.1749, 0.19, 0.2114, 0.2097]}, {"w": "to", "b": [0.2177, 0.19, 0.2373, 0.2097]}, {"w": "making", "b": [0.2436, 0.19, 0.3193, 0.2097]}, {"w": "ensembling", "b": [0.3256, 0.19, 0.4419, 0.2097]}, {"w": "work", "b": [0.4482, 0.19, 0.5001, 0.2097]}, {"w": "is", "b": [0.5064, 0.19, 0.5232, 0.2097]}, {"w": "the", "b": [0.5295, 0.19, 0.5603, 0.2097]}, {"w": "diversity", "b": [0.5666, 0.19, 0.6534, 0.2097]}, {"w": "of", "b": [0.6597, 0.19, 0.6807, 0.2097]}, {"w": "the", "b": [0.687, 0.19, 0.7179, 0.2097]}, {"w": "set", "b": [0.7242, 0.19, 0.7522, 0.2097]}, {"w": "of", "b": [0.7585, 0.19, 0.7795, 0.2097]}, {"w": "classifiers.", "b": [0.1294, 0.2105, 0.2366, 0.2302]}, {"w": "Diversity", "b": [0.2429, 0.2105, 0.3368, 0.2302]}, {"w": "is", "b": [0.3431, 0.2105, 0.3599, 0.2302]}, {"w": "strength.", "b": [0.3662, 0.2105, 0.4538, 0.2302]}, {"w": "If", "b": [0.4601, 0.2105, 0.4769, 0.2302]}, {"w": "all", "b": [0.4832, 0.2105, 0.5085, 0.2302]}, {"w": "the", "b": [0.5148, 0.2105, 0.5456, 0.2302]}, {"w": "blind", "b": [0.5519, 0.2105, 0.6038, 0.2302]}, {"w": "men", "b": [0.6101, 0.2105, 0.6535, 0.2302]}, {"w": "only", "b": [0.6598, 0.2105, 0.7047, 0.2302]}, {"w": "touched", "b": [0.711, 0.2105, 0.7908, 0.2302]}, {"w": "the", "b": [0.7971, 0.2105, 0.828, 0.2302]}, {"w": "elephant’s", "b": [0.1294, 0.231, 0.2317, 0.2507]}, {"w": "trunk,", "b": [0.238, 0.231, 0.2975, 0.2507]}, {"w": "they", "b": [0.3038, 0.231, 0.3473, 0.2507]}, {"w": "would", "b": [0.3536, 0.231, 0.4167, 0.2507]}, {"w": "agree", "b": [0.423, 0.231, 0.4776, 0.2507]}, {"w": "that", "b": [0.4839, 0.231, 0.5217, 0.2507]}, {"w": "elephants", "b": [0.528, 0.231, 0.6233, 0.2507]}, {"w": "are", "b": [0.6296, 0.231, 0.6604, 0.2507]}, {"w": "like", "b": [0.6667, 0.231, 0.7045, 0.2507]}, {"w": "snakes,", "b": [0.7108, 0.231, 0.7844, 0.2507]}, {"w": "and", "b": [0.7907, 0.231, 0.8271, 0.2507]}, {"w": "they", "b": [0.1294, 0.2515, 0.1729, 0.2712]}, {"w": "would", "b": [0.1792, 0.2515, 0.2422, 0.2712]}, {"w": "forever", "b": [0.2485, 0.2515, 0.3214, 0.2712]}, {"w": "stay", "b": [0.3277, 0.2515, 0.3683, 0.2712]}, {"w": "ignorant", "b": [0.3746, 0.2515, 0.4587, 0.2712]}, {"w": "of", "b": [0.465, 0.2515, 0.486, 0.2712]}, {"w": "the", "b": [0.4923, 0.2515, 0.5231, 0.2712]}, {"w": "truth", "b": [0.5294, 0.2515, 0.5771, 0.2712]}, {"w": "of", "b": [0.5834, 0.2515, 0.6044, 0.2712]}, {"w": "the", "b": [0.6107, 0.2515, 0.6415, 0.2712]}, {"w": "elephant.", "b": [0.6479, 0.2515, 0.7396, 0.2712]}, {"w": "Diversity", "b": [0.7459, 0.2515, 0.8398, 0.2712]}, {"w": "is", "b": [0.8461, 0.2515, 0.863, 0.2712]}, {"w": "what", "b": [0.1294, 0.272, 0.1785, 0.2917]}, {"w": "makes", "b": [0.1848, 0.272, 0.2492, 0.2917]}, {"w": "ensembling", "b": [0.2555, 0.272, 0.3718, 0.2917]}, {"w": "work.", "b": [0.3781, 0.272, 0.4363, 0.2917]}, {"w": "In", "b": [0.4426, 0.272, 0.4636, 0.2917]}, {"w": "machine-learning", "b": [0.4699, 0.272, 0.6464, 0.2917]}, {"w": "terms,", "b": [0.6527, 0.272, 0.7151, 0.2917]}, {"w": "if", "b": [0.7214, 0.272, 0.7368, 0.2917]}, {"w": "all", "b": [0.7431, 0.272, 0.7683, 0.2917]}, {"w": "of", "b": [0.7746, 0.272, 0.7957, 0.2917]}, {"w": "your", "b": [0.802, 0.272, 0.8482, 0.2917]}, {"w": "models", "b": [0.1294, 0.2925, 0.2023, 0.3122]}, {"w": "are", "b": [0.2086, 0.2925, 0.2394, 0.3122]}, {"w": "biased", "b": [0.2457, 0.2925, 0.3102, 0.3122]}, {"w": "in", "b": [0.3165, 0.2925, 0.3361, 0.3122]}, {"w": "the", "b": [0.3424, 0.2925, 0.3732, 0.3122]}, {"w": "same", "b": [0.3795, 0.2925, 0.4314, 0.3122]}, {"w": "way,", "b": [0.4377, 0.2925, 0.4843, 0.3122]}, {"w": "then", "b": [0.4906, 0.2925, 0.5341, 0.3122]}, {"w": "your", "b": [0.5404, 0.2925, 0.5866, 0.3122]}, {"w": "ensemble", "b": [0.5929, 0.2925, 0.6882, 0.3122]}, {"w": "will", "b": [0.6945, 0.2925, 0.7338, 0.3122]}, {"w": "retain", "b": [0.7401, 0.2925, 0.7975, 0.3122]}, {"w": "this", "b": [0.8037, 0.2925, 0.8402, 0.3122]}, {"w": "same", "b": [0.1294, 0.313, 0.1813, 0.3327]}, {"w": "bias.", "b": [0.1876, 0.313, 0.2345, 0.3327]}, {"w": "If", "b": [0.2408, 0.313, 0.2576, 0.3327]}, {"w": "your", "b": [0.2639, 0.313, 0.3102, 0.3327]}, {"w": "models", "b": [0.3165, 0.313, 0.3893, 0.3327]}, {"w": "are", "b": [0.3956, 0.313, 0.4264, 0.3327]}, {"w": "biased", "b": [0.4327, 0.313, 0.4986, 0.3327]}, {"w": "in", "b": [0.5049, 0.313, 0.5245, 0.3327]}, {"w": "different", "b": [0.5308, 0.313, 0.6153, 0.3327]}, {"w": "ways,", "b": [0.6217, 0.313, 0.6784, 0.3327]}, {"w": "the", "b": [0.6847, 0.313, 0.7155, 0.3327]}, {"w": "biases", "b": [0.7218, 0.313, 0.7835, 0.3327]}, {"w": "will", "b": [0.7898, 0.313, 0.829, 0.3327]}, {"w": "cancel", "b": [0.1294, 0.3335, 0.1938, 0.3532]}, {"w": "each", "b": [0.2001, 0.3335, 0.2464, 0.3532]}, {"w": "other", "b": [0.2527, 0.3335, 0.3045, 0.3532]}, {"w": "out,", "b": [0.3108, 0.3335, 0.3494, 0.3532]}, {"w": "and", "b": [0.3557, 0.3335, 0.3921, 0.3532]}, {"w": "the", "b": [0.3984, 0.3335, 0.4292, 0.3532]}, {"w": "ensemble", "b": [0.4355, 0.3335, 0.5308, 0.3532]}, {"w": "will", "b": [0.5371, 0.3335, 0.5764, 0.3532]}, {"w": "be", "b": [0.5827, 0.3335, 0.6065, 0.3532]}, {"w": "more", "b": [0.6128, 0.3335, 0.6646, 0.3532]}, {"w": "robust", "b": [0.6709, 0.3335, 0.734, 0.3532]}, {"w": "and", "b": [0.7403, 0.3335, 0.7767, 0.3532]}, {"w": "more", "b": [0.783, 0.3335, 0.8349, 0.3532]}, {"w": "accurate.", "b": [0.1294, 0.354, 0.2197, 0.3737]}]}, {"id": "b_2", "type": "paragraph", "text": "For this reason, you should ensemble models that are as good as possible while being as different as possible. This typically means using very different architectures or even different brands of machine-learning approaches. One thing that is largely not worth doing is ensembling the same network trained several times independently, from different random initializations. If the only difference between your models is their random initialization and the order in which they were exposed to the training data, then your ensemble will be low-diversity and will provide only a tiny improvement over any single model.", "words": [{"w": "For", "b": [0.1294, 0.3967, 0.1645, 0.4165]}, {"w": "this", "b": [0.1708, 0.3967, 0.2072, 0.4165]}, {"w": "reason,", "b": [0.2135, 0.3967, 0.2857, 0.4165]}, {"w": "you", "b": [0.292, 0.3967, 0.3298, 0.4165]}, {"w": "should", "b": [0.3361, 0.3967, 0.4034, 0.4165]}, {"w": "ensemble", "b": [0.4097, 0.3967, 0.505, 0.4165]}, {"w": "models", "b": [0.5113, 0.3967, 0.5842, 0.4165]}, {"w": "that", "b": [0.5905, 0.3967, 0.6283, 0.4165]}, {"w": "are", "b": [0.6346, 0.3967, 0.6654, 0.4165]}, {"w": "as", "b": [0.6717, 0.3967, 0.6941, 0.4165]}, {"w": "good", "b": [0.7004, 0.3967, 0.7509, 0.4165]}, {"w": "as", "b": [0.7572, 0.3967, 0.7796, 0.4165]}, {"w": "possible", "b": [0.7859, 0.3967, 0.8686, 0.4165]}, {"w": "while", "b": [0.1294, 0.4172, 0.1855, 0.437]}, {"w": "being", "b": [0.1918, 0.4172, 0.2478, 0.437]}, {"w": "as", "b": [0.2541, 0.4172, 0.2765, 0.437]}, {"w": "different", "b": [0.2828, 0.4172, 0.3674, 0.437]}, {"w": "as", "b": [0.3737, 0.4172, 0.3961, 0.437]}, {"w": "possible.", "b": [0.4024, 0.4172, 0.4914, 0.437]}, {"w": "This", "b": [0.4977, 0.4172, 0.5426, 0.437]}, {"w": "typically", "b": [0.5489, 0.4172, 0.6372, 0.437]}, {"w": "means", "b": [0.6435, 0.4172, 0.7079, 0.437]}, {"w": "using", "b": [0.7142, 0.4172, 0.7689, 0.437]}, {"w": "very", "b": [0.7752, 0.4172, 0.82, 0.437]}, {"w": "different", "b": [0.1294, 0.4377, 0.2158, 0.4575]}, {"w": "architectures", "b": [0.2221, 0.4377, 0.351, 0.4575]}, {"w": "or", "b": [0.3573, 0.4377, 0.3783, 0.4575]}, {"w": "even", "b": [0.3846, 0.4377, 0.4322, 0.4575]}, {"w": "different", "b": [0.4385, 0.4377, 0.5249, 0.4575]}, {"w": "brands", "b": [0.5312, 0.4377, 0.5985, 0.4575]}, {"w": "of", "b": [0.6048, 0.4377, 0.6258, 0.4575]}, {"w": "machine-learning", "b": [0.6321, 0.4377, 0.8086, 0.4575]}, {"w": "approaches.", "b": [0.1294, 0.4582, 0.2492, 0.478]}, {"w": "One", "b": [0.2555, 0.4582, 0.2975, 0.478]}, {"w": "thing", "b": [0.3038, 0.4582, 0.3557, 0.478]}, {"w": "that", "b": [0.362, 0.4582, 0.3998, 0.478]}, {"w": "is", "b": [0.4061, 0.4582, 0.4229, 0.478]}, {"w": "largely", "b": [0.4292, 0.4582, 0.4988, 0.478]}, {"w": "not", "b": [0.5051, 0.4582, 0.5373, 0.478]}, {"w": "worth", "b": [0.5436, 0.4582, 0.6025, 0.478]}, {"w": "doing", "b": [0.6088, 0.4582, 0.6662, 0.478]}, {"w": "is", "b": [0.6726, 0.4582, 0.6894, 0.478]}, {"w": "ensembling", "b": [0.6957, 0.4582, 0.812, 0.478]}, {"w": "the", "b": [0.8183, 0.4582, 0.8491, 0.478]}, {"w": "same", "b": [0.1294, 0.4787, 0.1813, 0.4985]}, {"w": "network", "b": [0.1876, 0.4787, 0.2702, 0.4985]}, {"w": "trained", "b": [0.2765, 0.4787, 0.3466, 0.4985]}, {"w": "several", "b": [0.3529, 0.4787, 0.4243, 0.4985]}, {"w": "times", "b": [0.4306, 0.4787, 0.4853, 0.4985]}, {"w": "independently,", "b": [0.4916, 0.4787, 0.6391, 0.4985]}, {"w": "from", "b": [0.6454, 0.4787, 0.6945, 0.4985]}, {"w": "different", "b": [0.7008, 0.4787, 0.7872, 0.4985]}, {"w": "random", "b": [0.7935, 0.4787, 0.8705, 0.4985]}, {"w": "initializations.", "b": [0.1294, 0.4992, 0.2731, 0.519]}, {"w": "If", "b": [0.2794, 0.4992, 0.2962, 0.519]}, {"w": "the", "b": [0.3024, 0.4992, 0.3333, 0.519]}, {"w": "only", "b": [0.3396, 0.4992, 0.3844, 0.519]}, {"w": "difference", "b": [0.3907, 0.4992, 0.4925, 0.519]}, {"w": "between", "b": [0.4988, 0.4992, 0.5829, 0.519]}, {"w": "your", "b": [0.5892, 0.4992, 0.6354, 0.519]}, {"w": "models", "b": [0.6417, 0.4992, 0.7146, 0.519]}, {"w": "is", "b": [0.7209, 0.4992, 0.7377, 0.519]}, {"w": "their", "b": [0.744, 0.4992, 0.7903, 0.519]}, {"w": "random", "b": [0.1294, 0.5197, 0.2065, 0.5395]}, {"w": "initialization", "b": [0.2128, 0.5197, 0.3403, 0.5395]}, {"w": "and", "b": [0.3466, 0.5197, 0.3831, 0.5395]}, {"w": "the", "b": [0.3894, 0.5197, 0.4202, 0.5395]}, {"w": "order", "b": [0.4265, 0.5197, 0.4797, 0.5395]}, {"w": "in", "b": [0.486, 0.5197, 0.5057, 0.5395]}, {"w": "which", "b": [0.512, 0.5197, 0.5736, 0.5395]}, {"w": "they", "b": [0.5799, 0.5197, 0.6234, 0.5395]}, {"w": "were", "b": [0.6297, 0.5197, 0.6787, 0.5395]}, {"w": "exposed", "b": [0.685, 0.5197, 0.7676, 0.5395]}, {"w": "to", "b": [0.774, 0.5197, 0.7936, 0.5395]}, {"w": "the", "b": [0.7999, 0.5197, 0.8307, 0.5395]}, {"w": "training", "b": [0.1294, 0.5402, 0.2079, 0.56]}, {"w": "data,", "b": [0.2142, 0.5402, 0.2625, 0.56]}, {"w": "then", "b": [0.2688, 0.5402, 0.3123, 0.56]}, {"w": "your", "b": [0.3186, 0.5402, 0.3648, 0.56]}, {"w": "ensemble", "b": [0.3711, 0.5402, 0.4664, 0.56]}, {"w": "will", "b": [0.4727, 0.5402, 0.5119, 0.56]}, {"w": "be", "b": [0.5182, 0.5402, 0.5421, 0.56]}, {"w": "low-diversity", "b": [0.5484, 0.5402, 0.6829, 0.56]}, {"w": "and", "b": [0.6892, 0.5402, 0.7256, 0.56]}, {"w": "will", "b": [0.7319, 0.5402, 0.7712, 0.56]}, {"w": "provide", "b": [0.7775, 0.5402, 0.8546, 0.56]}, {"w": "only", "b": [0.1294, 0.5607, 0.1743, 0.5805]}, {"w": "a", "b": [0.1806, 0.5607, 0.1918, 0.5805]}, {"w": "tiny", "b": [0.1981, 0.5607, 0.2373, 0.5805]}, {"w": "improvement", "b": [0.2436, 0.5607, 0.3782, 0.5805]}, {"w": "over", "b": [0.3845, 0.5607, 0.4293, 0.5805]}, {"w": "any", "b": [0.4356, 0.5607, 0.472, 0.5805]}, {"w": "single", "b": [0.4783, 0.5607, 0.5386, 0.5805]}, {"w": "model.", "b": [0.5449, 0.5607, 0.6143, 0.5805]}]}, {"id": "b_3", "type": "paragraph", "text": "One thing I have found to work well in practice—but that doesn’t generalize to every problem domain—is the use of an ensemble of tree- based methods (such as random forests or gradient-boosted trees) and deep neural networks. In 2014, partner Andrei Kolev and I took fourth place in the Higgs Boson decay detection challenge on Kaggle (www.kaggle.com/c/higgs-boson) using an ensemble of various tree models and deep neural networks. Remarkably, one of the models in the ensemble originated from a different method than the others (it was a regularized greedy forest) and had a significantly worse score than the others. Unsurprisingly, it was assigned a small weight in the ensemble. But to our surprise, it turned out to improve the overall ensemble by a large factor, because it was so different from every other model: it provided information that the other models didn’t have access to. That’s precisely the point of ensembling. It’s not so much about how good your best model is; it’s about the diversity of your set of candidate models.", "words": [{"w": "One", "b": [0.1294, 0.6035, 0.1714, 0.6233]}, {"w": "thing", "b": [0.1777, 0.6035, 0.2296, 0.6233]}, {"w": "I", "b": [0.2359, 0.6035, 0.2443, 0.6233]}, {"w": "have", "b": [0.2506, 0.6035, 0.2982, 0.6233]}, {"w": "found", "b": [0.3046, 0.6035, 0.3634, 0.6233]}, {"w": "to", "b": [0.3697, 0.6035, 0.3893, 0.6233]}, {"w": "work", "b": [0.3956, 0.6035, 0.4475, 0.6233]}, {"w": "well", "b": [0.4538, 0.6035, 0.4972, 0.6233]}, {"w": "in", "b": [0.5035, 0.6035, 0.5232, 0.6233]}, {"w": "practice—but", "b": [0.5295, 0.6035, 0.6668, 0.6233]}, {"w": "that", "b": [0.6731, 0.6035, 0.7109, 0.6233]}, {"w": "doesn’t", "b": [0.7172, 0.6035, 0.791, 0.6233]}, {"w": "generalize", "b": [0.1294, 0.624, 0.2331, 0.6438]}, {"w": "to", "b": [0.2394, 0.624, 0.259, 0.6438]}, {"w": "every", "b": [0.2653, 0.624, 0.3213, 0.6438]}, {"w": "problem", "b": [0.3276, 0.624, 0.4117, 0.6438]}, {"w": "domain—is", "b": [0.418, 0.624, 0.5357, 0.6438]}, {"w": "the", "b": [0.5421, 0.624, 0.5729, 0.6438]}, {"w": "use", "b": [0.5792, 0.624, 0.6128, 0.6438]}, {"w": "of", "b": [0.6191, 0.624, 0.6401, 0.6438]}, {"w": "an", "b": [0.6464, 0.624, 0.6703, 0.6438]}, {"w": "ensemble", "b": [0.6766, 0.624, 0.7718, 0.6438]}, {"w": "of", "b": [0.778, 0.624, 0.7991, 0.6438]}, {"w": "tree-", "b": [0.8054, 0.624, 0.8516, 0.6438]}, {"w": "based", "b": [0.1294, 0.6445, 0.1869, 0.6643]}, {"w": "methods", "b": [0.1932, 0.6445, 0.2786, 0.6643]}, {"w": "(such", "b": [0.285, 0.6445, 0.3396, 0.6643]}, {"w": "as", "b": [0.3459, 0.6445, 0.3669, 0.6643]}, {"w": "random", "b": [0.3732, 0.6445, 0.4503, 0.6643]}, {"w": "forests", "b": [0.4566, 0.6445, 0.5238, 0.6643]}, {"w": "or", "b": [0.5301, 0.6445, 0.5512, 0.6643]}, {"w": "gradient-boosted", "b": [0.5575, 0.6445, 0.727, 0.6643]}, {"w": "trees)", "b": [0.7333, 0.6445, 0.7893, 0.6643]}, {"w": "and", "b": [0.7956, 0.6445, 0.8321, 0.6643]}, {"w": "deep", "b": [0.1294, 0.665, 0.177, 0.6848]}, {"w": "neural", "b": [0.1833, 0.665, 0.2464, 0.6848]}, {"w": "networks.", "b": [0.2527, 0.665, 0.3515, 0.6848]}, {"w": "In", "b": [0.3578, 0.665, 0.3788, 0.6848]}, {"w": "2014,", "b": [0.3851, 0.665, 0.4419, 0.6848]}, {"w": "partner", "b": [0.4482, 0.665, 0.5196, 0.6848]}, {"w": "Andrei", "b": [0.5259, 0.665, 0.596, 0.6848]}, {"w": "Kolev", "b": [0.6022, 0.665, 0.6639, 0.6848]}, {"w": "and", "b": [0.6702, 0.665, 0.7066, 0.6848]}, {"w": "I", "b": [0.7129, 0.665, 0.7213, 0.6848]}, {"w": "took", "b": [0.7276, 0.665, 0.7725, 0.6848]}, {"w": "fourth", "b": [0.7788, 0.665, 0.8404, 0.6848]}, {"w": "place", "b": [0.1294, 0.6855, 0.1826, 0.7053]}, {"w": "in", "b": [0.1889, 0.6855, 0.2086, 0.7053]}, {"w": "the", "b": [0.2149, 0.6855, 0.2457, 0.7053]}, {"w": "Higgs", "b": [0.252, 0.6855, 0.3123, 0.7053]}, {"w": "Boson", "b": [0.3186, 0.6855, 0.3831, 0.7053]}, {"w": "decay", "b": [0.3894, 0.6855, 0.4482, 0.7053]}, {"w": "detection", "b": [0.4545, 0.6855, 0.547, 0.7053]}, {"w": "challenge", "b": [0.5533, 0.6855, 0.6499, 0.7053]}, {"w": "on", "b": [0.6563, 0.6855, 0.6815, 0.7053]}, {"w": "Kaggle", "b": [0.6878, 0.6855, 0.7606, 0.7053]}, {"w": "(www.kaggle.com/c/higgs-boson)", "b": [0.1294, 0.706, 0.471, 0.7258]}, {"w": "using", "b": [0.4774, 0.706, 0.532, 0.7258]}, {"w": "an", "b": [0.5383, 0.706, 0.5621, 0.7258]}, {"w": "ensemble", "b": [0.5684, 0.706, 0.6637, 0.7258]}, {"w": "of", "b": [0.67, 0.706, 0.691, 0.7258]}, {"w": "various", "b": [0.6973, 0.706, 0.7716, 0.7258]}, {"w": "tree", "b": [0.7779, 0.706, 0.8157, 0.7258]}, {"w": "models", "b": [0.1294, 0.7265, 0.2023, 0.7463]}, {"w": "and", "b": [0.2086, 0.7265, 0.245, 0.7463]}, {"w": "deep", "b": [0.2513, 0.7265, 0.299, 0.7463]}, {"w": "neural", "b": [0.3053, 0.7265, 0.3683, 0.7463]}, {"w": "networks.", "b": [0.3746, 0.7265, 0.4734, 0.7463]}, {"w": "Remarkably,", "b": [0.4797, 0.7265, 0.6076, 0.7463]}, {"w": "one", "b": [0.6139, 0.7265, 0.6504, 0.7463]}, {"w": "of", "b": [0.6567, 0.7265, 0.6777, 0.7463]}, {"w": "the", "b": [0.684, 0.7265, 0.7148, 0.7463]}, {"w": "models", "b": [0.7211, 0.7265, 0.794, 0.7463]}, {"w": "in", "b": [0.8003, 0.7265, 0.8199, 0.7463]}, {"w": "the", "b": [0.8262, 0.7265, 0.857, 0.7463]}, {"w": "ensemble", "b": [0.1294, 0.747, 0.2247, 0.7668]}, {"w": "originated", "b": [0.231, 0.747, 0.3333, 0.7668]}, {"w": "from", "b": [0.3396, 0.747, 0.3886, 0.7668]}, {"w": "a", "b": [0.3949, 0.747, 0.4061, 0.7668]}, {"w": "different", "b": [0.4124, 0.747, 0.4988, 0.7668]}, {"w": "method", "b": [0.5051, 0.747, 0.5808, 0.7668]}, {"w": "than", "b": [0.5871, 0.747, 0.6305, 0.7668]}, {"w": "the", "b": [0.6368, 0.747, 0.6677, 0.7668]}, {"w": "others", "b": [0.674, 0.747, 0.7356, 0.7668]}, {"w": "(it", "b": [0.7419, 0.747, 0.7643, 0.7668]}, {"w": "was", "b": [0.7706, 0.747, 0.8099, 0.7668]}, {"w": "a", "b": [0.8162, 0.747, 0.8274, 0.7668]}, {"w": "regularized", "b": [0.1294, 0.7675, 0.2429, 0.7873]}, {"w": "greedy", "b": [0.2492, 0.7675, 0.3178, 0.7873]}, {"w": "forest)", "b": [0.3241, 0.7675, 0.39, 0.7873]}, {"w": "and", "b": [0.3963, 0.7675, 0.4327, 0.7873]}, {"w": "had", "b": [0.439, 0.7675, 0.4754, 0.7873]}, {"w": "a", "b": [0.4817, 0.7675, 0.4929, 0.7873]}, {"w": "significantly", "b": [0.4992, 0.7675, 0.6254, 0.7873]}, {"w": "worse", "b": [0.6317, 0.7675, 0.6919, 0.7873]}, {"w": "score", "b": [0.6982, 0.7675, 0.7515, 0.7873]}, {"w": "than", "b": [0.7578, 0.7675, 0.8012, 0.7873]}, {"w": "the", "b": [0.8075, 0.7675, 0.8383, 0.7873]}, {"w": "others.", "b": [0.1294, 0.788, 0.1974, 0.8078]}, {"w": "Unsurprisingly,", "b": [0.2037, 0.788, 0.3597, 0.8078]}, {"w": "it", "b": [0.366, 0.788, 0.38, 0.8078]}, {"w": "was", "b": [0.3863, 0.788, 0.4256, 0.8078]}, {"w": "assigned", "b": [0.4319, 0.788, 0.5187, 0.8078]}, {"w": "a", "b": [0.5251, 0.788, 0.5363, 0.8078]}, {"w": "small", "b": [0.5426, 0.788, 0.5972, 0.8078]}, {"w": "weight", "b": [0.6035, 0.788, 0.6722, 0.8078]}, {"w": "in", "b": [0.6785, 0.788, 0.6981, 0.8078]}, {"w": "the", "b": [0.7044, 0.788, 0.7353, 0.8078]}, {"w": "ensemble.", "b": [0.7416, 0.788, 0.8431, 0.8078]}, {"w": "But", "b": [0.1294, 0.8085, 0.1659, 0.8283]}, {"w": "to", "b": [0.1722, 0.8085, 0.1918, 0.8283]}, {"w": "our", "b": [0.1981, 0.8085, 0.2317, 0.8283]}, {"w": "surprise,", "b": [0.238, 0.8085, 0.3242, 0.8283]}, {"w": "it", "b": [0.3305, 0.8085, 0.3445, 0.8283]}, {"w": "turned", "b": [0.3508, 0.8085, 0.4153, 0.8283]}, {"w": "out", "b": [0.4216, 0.8085, 0.4538, 0.8283]}, {"w": "to", "b": [0.4601, 0.8085, 0.4798, 0.8283]}, {"w": "improve", "b": [0.4861, 0.8085, 0.5702, 0.8283]}, {"w": "the", "b": [0.5765, 0.8085, 0.6073, 0.8283]}, {"w": "overall", "b": [0.6135, 0.8085, 0.6836, 0.8283]}, {"w": "ensemble", "b": [0.6899, 0.8085, 0.7852, 0.8283]}, {"w": "by", "b": [0.7915, 0.8085, 0.8167, 0.8283]}, {"w": "a", "b": [0.823, 0.8085, 0.8342, 0.8283]}, {"w": "large", "b": [0.1294, 0.829, 0.1794, 0.8488]}, {"w": "factor,", "b": [0.1857, 0.829, 0.2498, 0.8488]}, {"w": "because", "b": [0.2561, 0.829, 0.3359, 0.8488]}, {"w": "it", "b": [0.3422, 0.829, 0.3563, 0.8488]}, {"w": "was", "b": [0.3626, 0.829, 0.4018, 0.8488]}, {"w": "so", "b": [0.4081, 0.829, 0.4305, 0.8488]}, {"w": "different", "b": [0.4368, 0.829, 0.5232, 0.8488]}, {"w": "from", "b": [0.5295, 0.829, 0.5786, 0.8488]}, {"w": "every", "b": [0.5849, 0.829, 0.6409, 0.8488]}, {"w": "other", "b": [0.6472, 0.829, 0.699, 0.8488]}, {"w": "model:", "b": [0.7053, 0.829, 0.7754, 0.8488]}, {"w": "it", "b": [0.7817, 0.829, 0.7958, 0.8488]}, {"w": "provided", "b": [0.1294, 0.8495, 0.2191, 0.8693]}, {"w": "information", "b": [0.2254, 0.8495, 0.3445, 0.8693]}, {"w": "that", "b": [0.3508, 0.8495, 0.3887, 0.8693]}, {"w": "the", "b": [0.395, 0.8495, 0.4258, 0.8693]}, {"w": "other", "b": [0.4321, 0.8495, 0.4839, 0.8693]}, {"w": "models", "b": [0.4902, 0.8495, 0.5631, 0.8693]}, {"w": "didn’t", "b": [0.5694, 0.8495, 0.6292, 0.8693]}, {"w": "have", "b": [0.6355, 0.8495, 0.6831, 0.8693]}, {"w": "access", "b": [0.6894, 0.8495, 0.7538, 0.8693]}, {"w": "to.", "b": [0.7601, 0.8495, 0.7861, 0.8693]}, {"w": "That’s", "b": [0.7924, 0.8495, 0.8554, 0.8693]}, {"w": "precisely", "b": [0.1294, 0.87, 0.2205, 0.8898]}, {"w": "the", "b": [0.2268, 0.87, 0.2576, 0.8898]}, {"w": "point", "b": [0.2639, 0.87, 0.3158, 0.8898]}, {"w": "of", "b": [0.3221, 0.87, 0.3431, 0.8898]}, {"w": "ensembling.", "b": [0.3494, 0.87, 0.472, 0.8898]}, {"w": "It’s", "b": [0.4783, 0.87, 0.5105, 0.8898]}, {"w": "not", "b": [0.5168, 0.87, 0.5491, 0.8898]}, {"w": "so", "b": [0.5554, 0.87, 0.5778, 0.8898]}, {"w": "much", "b": [0.5841, 0.87, 0.6402, 0.8898]}, {"w": "about", "b": [0.6465, 0.87, 0.7025, 0.8898]}, {"w": "how", "b": [0.7088, 0.87, 0.7523, 0.8898]}, {"w": "good", "b": [0.7586, 0.87, 0.809, 0.8898]}, {"w": "your", "b": [0.8153, 0.87, 0.8616, 0.8898]}, {"w": "best", "b": [0.1294, 0.8905, 0.1701, 0.9103]}, {"w": "model", "b": [0.1764, 0.8905, 0.2394, 0.9103]}, {"w": "is;", "b": [0.2457, 0.8905, 0.2696, 0.9103]}, {"w": "it’s", "b": [0.2758, 0.8905, 0.3067, 0.9103]}, {"w": "about", "b": [0.313, 0.8905, 0.369, 0.9103]}, {"w": "the", "b": [0.3753, 0.8905, 0.4062, 0.9103]}, {"w": "diversity", "b": [0.4125, 0.8905, 0.5008, 0.9103]}, {"w": "of", "b": [0.5071, 0.8905, 0.5281, 0.9103]}, {"w": "your", "b": [0.5344, 0.8905, 0.5806, 0.9103]}, {"w": "set", "b": [0.5869, 0.8905, 0.615, 0.9103]}, {"w": "of", "b": [0.6213, 0.8905, 0.6423, 0.9103]}, {"w": "candidate", "b": [0.6486, 0.8905, 0.7453, 0.9103]}, {"w": "models.", "b": [0.7516, 0.8905, 0.8307, 0.9103]}]}]}, {"page": 349, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In recent times, one style of basic ensemble that has been very successful in practice is the wide and deep category of models, blending deep learning with shallow learning. Such models consist of jointly training a deep neural network with a large linear model. The joint training of a family of diverse models is yet another option to achieve model ensembling.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "recent", "b": [0.1567, 0.0857, 0.2184, 0.1054]}, {"w": "times,", "b": [0.2247, 0.0857, 0.2856, 0.1054]}, {"w": "one", "b": [0.2919, 0.0857, 0.3284, 0.1054]}, {"w": "style", "b": [0.3347, 0.0857, 0.3823, 0.1054]}, {"w": "of", "b": [0.3886, 0.0857, 0.4096, 0.1054]}, {"w": "basic", "b": [0.416, 0.0857, 0.4678, 0.1054]}, {"w": "ensemble", "b": [0.4741, 0.0857, 0.5694, 0.1054]}, {"w": "that", "b": [0.5757, 0.0857, 0.6135, 0.1054]}, {"w": "has", "b": [0.6198, 0.0857, 0.6535, 0.1054]}, {"w": "been", "b": [0.6598, 0.0857, 0.7074, 0.1054]}, {"w": "very", "b": [0.7137, 0.0857, 0.7585, 0.1054]}, {"w": "successful", "b": [0.7648, 0.0857, 0.8685, 0.1054]}, {"w": "in", "b": [0.1294, 0.1062, 0.149, 0.1259]}, {"w": "practice", "b": [0.1553, 0.1062, 0.2352, 0.1259]}, {"w": "is", "b": [0.2415, 0.1062, 0.2583, 0.1259]}, {"w": "the", "b": [0.2646, 0.1062, 0.2954, 0.1259]}, {"w": "wide", "b": [0.3017, 0.1062, 0.3494, 0.1259]}, {"w": "and", "b": [0.3557, 0.1062, 0.3935, 0.1259]}, {"w": "deep", "b": [0.3998, 0.1062, 0.4474, 0.1259]}, {"w": "category", "b": [0.4537, 0.1062, 0.5406, 0.1259]}, {"w": "of", "b": [0.5469, 0.1062, 0.5679, 0.1259]}, {"w": "models,", "b": [0.5742, 0.1062, 0.6534, 0.1259]}, {"w": "blending", "b": [0.6597, 0.1062, 0.748, 0.1259]}, {"w": "deep", "b": [0.7543, 0.1062, 0.8019, 0.1259]}, {"w": "learning", "b": [0.1294, 0.1267, 0.2121, 0.1464]}, {"w": "with", "b": [0.2184, 0.1267, 0.2632, 0.1464]}, {"w": "shallow", "b": [0.2695, 0.1267, 0.348, 0.1464]}, {"w": "learning.", "b": [0.3543, 0.1267, 0.4433, 0.1464]}, {"w": "Such", "b": [0.4496, 0.1267, 0.5001, 0.1464]}, {"w": "models", "b": [0.5064, 0.1267, 0.5792, 0.1464]}, {"w": "consist", "b": [0.5855, 0.1267, 0.6556, 0.1464]}, {"w": "of", "b": [0.6619, 0.1267, 0.6829, 0.1464]}, {"w": "jointly", "b": [0.6892, 0.1267, 0.7551, 0.1464]}, {"w": "training", "b": [0.7614, 0.1267, 0.8399, 0.1464]}, {"w": "a", "b": [0.8462, 0.1267, 0.8574, 0.1464]}, {"w": "deep", "b": [0.1294, 0.1472, 0.177, 0.1669]}, {"w": "neural", "b": [0.1833, 0.1472, 0.2464, 0.1669]}, {"w": "network", "b": [0.2527, 0.1472, 0.3354, 0.1669]}, {"w": "with", "b": [0.3416, 0.1472, 0.3865, 0.1669]}, {"w": "a", "b": [0.3928, 0.1472, 0.404, 0.1669]}, {"w": "large", "b": [0.4103, 0.1472, 0.4602, 0.1669]}, {"w": "linear", "b": [0.4665, 0.1472, 0.524, 0.1669]}, {"w": "model.", "b": [0.5303, 0.1472, 0.5997, 0.1669]}, {"w": "The", "b": [0.606, 0.1472, 0.6452, 0.1669]}, {"w": "joint", "b": [0.6515, 0.1472, 0.6978, 0.1669]}, {"w": "training", "b": [0.7041, 0.1472, 0.7826, 0.1669]}, {"w": "of", "b": [0.7889, 0.1472, 0.8099, 0.1669]}, {"w": "a", "b": [0.8162, 0.1472, 0.8274, 0.1669]}, {"w": "family", "b": [0.1294, 0.1677, 0.1953, 0.1874]}, {"w": "of", "b": [0.2016, 0.1677, 0.2226, 0.1874]}, {"w": "diverse", "b": [0.2289, 0.1677, 0.3018, 0.1874]}, {"w": "models", "b": [0.3081, 0.1677, 0.3809, 0.1874]}, {"w": "is", "b": [0.3872, 0.1677, 0.4041, 0.1874]}, {"w": "yet", "b": [0.4104, 0.1677, 0.4412, 0.1874]}, {"w": "another", "b": [0.4475, 0.1677, 0.5232, 0.1874]}, {"w": "option", "b": [0.5295, 0.1677, 0.5939, 0.1874]}, {"w": "to", "b": [0.6003, 0.1677, 0.6199, 0.1874]}, {"w": "achieve", "b": [0.6262, 0.1677, 0.7032, 0.1874]}, {"w": "model", "b": [0.7095, 0.1677, 0.7726, 0.1874]}, {"w": "ensembling.", "b": [0.1294, 0.1882, 0.252, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "7.3.4. Wrapping up", "words": [{"w": "7.3.4.", "b": [0.1294, 0.2354, 0.1862, 0.2552]}, {"w": "Wrapping", "b": [0.1925, 0.2354, 0.3028, 0.2552]}, {"w": "up", "b": [0.3091, 0.2354, 0.3371, 0.2552]}]}, {"id": "b_2", "type": "paragraph", "text": "When building high-performing deep convnets, you’ll need to use residual connections, batch normalization, and depthwise separable convolutions. In the future, it’s likely that depthwise separable convolutions will completely replace regular convolutions, whether for 1D, 2D, or 3D applications, due to their higher representational efficiency. Building deep networks requires making many small hyperparameter and architecture choices, which together define how good your model will be. Rather than basing these choices on intuition or random chance, it’s better to systematically search hyperparameter space to find optimal choices. At this time, the process is expensive, and the tools to do it aren’t very good. But the Hyperopt and Hyperas libraries may be able to help you. When doing hyperparameter optimization, be mindful of validation-set overfitting! Winning machine-learning competitions or otherwise obtaining the best possible results on a task can only be done with large ensembles of models. Ensembling via a well-optimized weighted average is usually good enough. Remember: diversity is strength. It’s largely pointless to ensemble very similar models; the best ensembles are sets of models that are as dissimilar as possible (while having as much predictive power as possible, naturally).", "words": [{"w": "When", "b": [0.1799, 0.2737, 0.2401, 0.2935]}, {"w": "building", "b": [0.2464, 0.2737, 0.3305, 0.2935]}, {"w": "high-performing", "b": [0.3368, 0.2737, 0.5036, 0.2935]}, {"w": "deep", "b": [0.5099, 0.2737, 0.5575, 0.2935]}, {"w": "convnets,", "b": [0.5638, 0.2737, 0.6598, 0.2935]}, {"w": "you’ll", "b": [0.6661, 0.2737, 0.7264, 0.2935]}, {"w": "need", "b": [0.7327, 0.2737, 0.7803, 0.2935]}, {"w": "to", "b": [0.7866, 0.2737, 0.8062, 0.2935]}, {"w": "use", "b": [0.8125, 0.2737, 0.8462, 0.2935]}, {"w": "residual", "b": [0.1799, 0.2942, 0.2597, 0.314]}, {"w": "connections,", "b": [0.266, 0.2942, 0.3928, 0.314]}, {"w": "batch", "b": [0.3992, 0.2942, 0.4538, 0.314]}, {"w": "normalization,", "b": [0.4601, 0.2942, 0.6065, 0.314]}, {"w": "and", "b": [0.6128, 0.2942, 0.6493, 0.314]}, {"w": "depthwise", "b": [0.6556, 0.2942, 0.7579, 0.314]}, {"w": "separable", "b": [0.7642, 0.2942, 0.8594, 0.314]}, {"w": "convolutions.", "b": [0.1799, 0.3147, 0.3165, 0.3345]}, {"w": "In", "b": [0.3228, 0.3147, 0.3438, 0.3345]}, {"w": "the", "b": [0.3501, 0.3147, 0.381, 0.3345]}, {"w": "future,", "b": [0.3873, 0.3147, 0.4538, 0.3345]}, {"w": "it’s", "b": [0.4601, 0.3147, 0.4909, 0.3345]}, {"w": "likely", "b": [0.4972, 0.3147, 0.5547, 0.3345]}, {"w": "that", "b": [0.561, 0.3147, 0.5988, 0.3345]}, {"w": "depthwise", "b": [0.6052, 0.3147, 0.7074, 0.3345]}, {"w": "separable", "b": [0.7138, 0.3147, 0.809, 0.3345]}, {"w": "convolutions", "b": [0.1799, 0.3352, 0.3102, 0.355]}, {"w": "will", "b": [0.3165, 0.3352, 0.3558, 0.355]}, {"w": "completely", "b": [0.3621, 0.3352, 0.4742, 0.355]}, {"w": "replace", "b": [0.4805, 0.3352, 0.5533, 0.355]}, {"w": "regular", "b": [0.5596, 0.3352, 0.6311, 0.355]}, {"w": "convolutions,", "b": [0.6374, 0.3352, 0.774, 0.355]}, {"w": "whether", "b": [0.7802, 0.3352, 0.8615, 0.355]}, {"w": "for", "b": [0.1799, 0.3557, 0.2093, 0.3755]}, {"w": "1D,", "b": [0.2156, 0.3557, 0.2527, 0.3755]}, {"w": "2D,", "b": [0.259, 0.3557, 0.2962, 0.3755]}, {"w": "or", "b": [0.3025, 0.3557, 0.3235, 0.3755]}, {"w": "3D", "b": [0.3298, 0.3557, 0.3606, 0.3755]}, {"w": "applications,", "b": [0.3669, 0.3557, 0.4951, 0.3755]}, {"w": "due", "b": [0.5014, 0.3557, 0.5379, 0.3755]}, {"w": "to", "b": [0.5442, 0.3557, 0.5638, 0.3755]}, {"w": "their", "b": [0.5701, 0.3557, 0.6163, 0.3755]}, {"w": "higher", "b": [0.6227, 0.3557, 0.6871, 0.3755]}, {"w": "representational", "b": [0.6934, 0.3557, 0.8545, 0.3755]}, {"w": "efficiency.", "b": [0.1799, 0.3762, 0.2849, 0.396]}, {"w": "Building", "b": [0.1799, 0.3967, 0.2682, 0.4165]}, {"w": "deep", "b": [0.2745, 0.3967, 0.3221, 0.4165]}, {"w": "networks", "b": [0.3284, 0.3967, 0.4209, 0.4165]}, {"w": "requires", "b": [0.4272, 0.3967, 0.5085, 0.4165]}, {"w": "making", "b": [0.5148, 0.3967, 0.5904, 0.4165]}, {"w": "many", "b": [0.5967, 0.3967, 0.6528, 0.4165]}, {"w": "small", "b": [0.6591, 0.3967, 0.7138, 0.4165]}, {"w": "hyperparameter", "b": [0.1799, 0.4172, 0.3382, 0.437]}, {"w": "and", "b": [0.3445, 0.4172, 0.3809, 0.437]}, {"w": "architecture", "b": [0.3872, 0.4172, 0.5063, 0.437]}, {"w": "choices,", "b": [0.5126, 0.4172, 0.5945, 0.437]}, {"w": "which", "b": [0.6008, 0.4172, 0.6625, 0.437]}, {"w": "together", "b": [0.6688, 0.4172, 0.7515, 0.437]}, {"w": "define", "b": [0.7578, 0.4172, 0.8208, 0.437]}, {"w": "how", "b": [0.8271, 0.4172, 0.8705, 0.437]}, {"w": "good", "b": [0.1799, 0.4377, 0.2303, 0.4575]}, {"w": "your", "b": [0.2366, 0.4377, 0.2829, 0.4575]}, {"w": "model", "b": [0.2892, 0.4377, 0.3522, 0.4575]}, {"w": "will", "b": [0.3585, 0.4377, 0.3978, 0.4575]}, {"w": "be.", "b": [0.4041, 0.4377, 0.4342, 0.4575]}, {"w": "Rather", "b": [0.4405, 0.4377, 0.5078, 0.4575]}, {"w": "than", "b": [0.5141, 0.4377, 0.5575, 0.4575]}, {"w": "basing", "b": [0.5638, 0.4377, 0.6297, 0.4575]}, {"w": "these", "b": [0.636, 0.4377, 0.6878, 0.4575]}, {"w": "choices", "b": [0.6941, 0.4377, 0.7698, 0.4575]}, {"w": "on", "b": [0.7761, 0.4377, 0.8013, 0.4575]}, {"w": "intuition", "b": [0.1799, 0.4582, 0.2654, 0.478]}, {"w": "or", "b": [0.2717, 0.4582, 0.2927, 0.478]}, {"w": "random", "b": [0.299, 0.4582, 0.3761, 0.478]}, {"w": "chance,", "b": [0.3824, 0.4582, 0.4587, 0.478]}, {"w": "it’s", "b": [0.465, 0.4582, 0.4958, 0.478]}, {"w": "better", "b": [0.5021, 0.4582, 0.5596, 0.478]}, {"w": "to", "b": [0.5659, 0.4582, 0.5855, 0.478]}, {"w": "systematically", "b": [0.5918, 0.4582, 0.7361, 0.478]}, {"w": "search", "b": [0.7424, 0.4582, 0.8069, 0.478]}, {"w": "hyperparameter", "b": [0.1799, 0.4787, 0.3382, 0.4985]}, {"w": "space", "b": [0.3444, 0.4787, 0.4004, 0.4985]}, {"w": "to", "b": [0.4068, 0.4787, 0.4264, 0.4985]}, {"w": "find", "b": [0.4327, 0.4787, 0.4733, 0.4985]}, {"w": "optimal", "b": [0.4796, 0.4787, 0.5567, 0.4985]}, {"w": "choices.", "b": [0.563, 0.4787, 0.645, 0.4985]}, {"w": "At", "b": [0.6513, 0.4787, 0.6765, 0.4985]}, {"w": "this", "b": [0.6828, 0.4787, 0.7193, 0.4985]}, {"w": "time,", "b": [0.7256, 0.4787, 0.7767, 0.4985]}, {"w": "the", "b": [0.783, 0.4787, 0.8139, 0.4985]}, {"w": "process", "b": [0.1799, 0.4992, 0.2555, 0.519]}, {"w": "is", "b": [0.2618, 0.4992, 0.2786, 0.519]}, {"w": "expensive,", "b": [0.285, 0.4992, 0.3921, 0.519]}, {"w": "and", "b": [0.3984, 0.4992, 0.4349, 0.519]}, {"w": "the", "b": [0.4412, 0.4992, 0.472, 0.519]}, {"w": "tools", "b": [0.4783, 0.4992, 0.5274, 0.519]}, {"w": "to", "b": [0.5337, 0.4992, 0.5533, 0.519]}, {"w": "do", "b": [0.5596, 0.4992, 0.5848, 0.519]}, {"w": "it", "b": [0.5911, 0.4992, 0.6052, 0.519]}, {"w": "aren’t", "b": [0.6115, 0.4992, 0.6698, 0.519]}, {"w": "very", "b": [0.6761, 0.4992, 0.7209, 0.519]}, {"w": "good.", "b": [0.7272, 0.4992, 0.784, 0.519]}, {"w": "But", "b": [0.7903, 0.4992, 0.8268, 0.519]}, {"w": "the", "b": [0.8331, 0.4992, 0.8639, 0.519]}, {"w": "Hyperopt", "b": [0.1799, 0.5197, 0.2751, 0.5395]}, {"w": "and", "b": [0.2814, 0.5197, 0.3179, 0.5395]}, {"w": "Hyperas", "b": [0.3242, 0.5197, 0.4082, 0.5395]}, {"w": "libraries", "b": [0.4145, 0.5197, 0.4972, 0.5395]}, {"w": "may", "b": [0.5035, 0.5197, 0.5469, 0.5395]}, {"w": "be", "b": [0.5532, 0.5197, 0.5771, 0.5395]}, {"w": "able", "b": [0.5834, 0.5197, 0.6254, 0.5395]}, {"w": "to", "b": [0.6317, 0.5197, 0.6513, 0.5395]}, {"w": "help", "b": [0.6576, 0.5197, 0.7011, 0.5395]}, {"w": "you.", "b": [0.7074, 0.5197, 0.7515, 0.5395]}, {"w": "When", "b": [0.7578, 0.5197, 0.8181, 0.5395]}, {"w": "doing", "b": [0.1799, 0.5402, 0.2373, 0.56]}, {"w": "hyperparameter", "b": [0.2436, 0.5402, 0.4019, 0.56]}, {"w": "optimization,", "b": [0.4082, 0.5402, 0.5421, 0.56]}, {"w": "be", "b": [0.5484, 0.5402, 0.5722, 0.56]}, {"w": "mindful", "b": [0.5785, 0.5402, 0.6584, 0.56]}, {"w": "of", "b": [0.6647, 0.5402, 0.6857, 0.56]}, {"w": "validation-set", "b": [0.692, 0.5402, 0.8294, 0.56]}, {"w": "overfitting!", "b": [0.1799, 0.5607, 0.2948, 0.5805]}, {"w": "Winning", "b": [0.1799, 0.5812, 0.2671, 0.601]}, {"w": "machine-learning", "b": [0.2734, 0.5812, 0.45, 0.601]}, {"w": "competitions", "b": [0.4563, 0.5812, 0.5866, 0.601]}, {"w": "or", "b": [0.5929, 0.5812, 0.6139, 0.601]}, {"w": "otherwise", "b": [0.6203, 0.5812, 0.7183, 0.601]}, {"w": "obtaining", "b": [0.7246, 0.5812, 0.8199, 0.601]}, {"w": "the", "b": [0.8262, 0.5812, 0.8571, 0.601]}, {"w": "best", "b": [0.1799, 0.6017, 0.2205, 0.6215]}, {"w": "possible", "b": [0.2268, 0.6017, 0.3095, 0.6215]}, {"w": "results", "b": [0.3158, 0.6017, 0.3817, 0.6215]}, {"w": "on", "b": [0.388, 0.6017, 0.4132, 0.6215]}, {"w": "a", "b": [0.4195, 0.6017, 0.4307, 0.6215]}, {"w": "task", "b": [0.437, 0.6017, 0.4777, 0.6215]}, {"w": "can", "b": [0.484, 0.6017, 0.519, 0.6215]}, {"w": "only", "b": [0.5253, 0.6017, 0.5701, 0.6215]}, {"w": "be", "b": [0.5764, 0.6017, 0.6003, 0.6215]}, {"w": "done", "b": [0.6066, 0.6017, 0.6556, 0.6215]}, {"w": "with", "b": [0.6619, 0.6017, 0.7068, 0.6215]}, {"w": "large", "b": [0.7131, 0.6017, 0.763, 0.6215]}, {"w": "ensembles", "b": [0.1799, 0.6222, 0.285, 0.642]}, {"w": "of", "b": [0.2913, 0.6222, 0.3123, 0.642]}, {"w": "models.", "b": [0.3186, 0.6222, 0.3978, 0.642]}, {"w": "Ensembling", "b": [0.4041, 0.6222, 0.5246, 0.642]}, {"w": "via", "b": [0.5309, 0.6222, 0.5617, 0.642]}, {"w": "a", "b": [0.568, 0.6222, 0.5792, 0.642]}, {"w": "well-optimized", "b": [0.5855, 0.6222, 0.7383, 0.642]}, {"w": "weighted", "b": [0.7446, 0.6222, 0.8371, 0.642]}, {"w": "average", "b": [0.1799, 0.6427, 0.2583, 0.6625]}, {"w": "is", "b": [0.2646, 0.6427, 0.2814, 0.6625]}, {"w": "usually", "b": [0.2877, 0.6427, 0.3606, 0.6625]}, {"w": "good", "b": [0.3669, 0.6427, 0.4174, 0.6625]}, {"w": "enough.", "b": [0.4237, 0.6427, 0.5042, 0.6625]}, {"w": "Remember:", "b": [0.5105, 0.6427, 0.6283, 0.6625]}, {"w": "diversity", "b": [0.6346, 0.6427, 0.7228, 0.6625]}, {"w": "is", "b": [0.7292, 0.6427, 0.746, 0.6625]}, {"w": "strength.", "b": [0.7523, 0.6427, 0.8399, 0.6625]}, {"w": "It’s", "b": [0.1799, 0.6632, 0.2121, 0.683]}, {"w": "largely", "b": [0.2184, 0.6632, 0.288, 0.683]}, {"w": "pointless", "b": [0.2943, 0.6632, 0.384, 0.683]}, {"w": "to", "b": [0.3903, 0.6632, 0.4099, 0.683]}, {"w": "ensemble", "b": [0.4162, 0.6632, 0.5115, 0.683]}, {"w": "very", "b": [0.5178, 0.6632, 0.5627, 0.683]}, {"w": "similar", "b": [0.569, 0.6632, 0.639, 0.683]}, {"w": "models;", "b": [0.6453, 0.6632, 0.7252, 0.683]}, {"w": "the", "b": [0.7315, 0.6632, 0.7624, 0.683]}, {"w": "best", "b": [0.7687, 0.6632, 0.8093, 0.683]}, {"w": "ensembles", "b": [0.1799, 0.6837, 0.285, 0.7035]}, {"w": "are", "b": [0.2913, 0.6837, 0.3221, 0.7035]}, {"w": "sets", "b": [0.3284, 0.6837, 0.3662, 0.7035]}, {"w": "of", "b": [0.3725, 0.6837, 0.3935, 0.7035]}, {"w": "models", "b": [0.3998, 0.6837, 0.4727, 0.7035]}, {"w": "that", "b": [0.479, 0.6837, 0.5169, 0.7035]}, {"w": "are", "b": [0.5232, 0.6837, 0.554, 0.7035]}, {"w": "as", "b": [0.5603, 0.6837, 0.5813, 0.7035]}, {"w": "dissimilar", "b": [0.5876, 0.6837, 0.6871, 0.7035]}, {"w": "as", "b": [0.6934, 0.6837, 0.7144, 0.7035]}, {"w": "possible", "b": [0.7207, 0.6837, 0.8034, 0.7035]}, {"w": "(while", "b": [0.1799, 0.7042, 0.2443, 0.724]}, {"w": "having", "b": [0.2506, 0.7042, 0.3193, 0.724]}, {"w": "as", "b": [0.3256, 0.7042, 0.3466, 0.724]}, {"w": "much", "b": [0.3529, 0.7042, 0.409, 0.724]}, {"w": "predictive", "b": [0.4153, 0.7042, 0.5161, 0.724]}, {"w": "power", "b": [0.5225, 0.7042, 0.5855, 0.724]}, {"w": "as", "b": [0.5918, 0.7042, 0.6128, 0.724]}, {"w": "possible,", "b": [0.6191, 0.7042, 0.7081, 0.724]}, {"w": "naturally).", "b": [0.7144, 0.7042, 0.8188, 0.724]}]}, {"id": "b_3", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1294, 0.7559, 0.2191, 0.7757]}, {"w": "summary", "b": [0.2254, 0.7559, 0.3277, 0.7757]}]}, {"id": "b_4", "type": "paragraph", "text": "In this chapter, you learned the following:", "words": [{"w": "In", "b": [0.1799, 0.7943, 0.2009, 0.814]}, {"w": "this", "b": [0.2072, 0.7943, 0.2436, 0.814]}, {"w": "chapter,", "b": [0.2499, 0.7943, 0.3295, 0.814]}, {"w": "you", "b": [0.3358, 0.7943, 0.3736, 0.814]}, {"w": "learned", "b": [0.3799, 0.7943, 0.4541, 0.814]}, {"w": "the", "b": [0.4605, 0.7943, 0.4913, 0.814]}, {"w": "following:", "b": [0.4976, 0.7943, 0.6027, 0.814]}]}, {"id": "b_5", "type": "paragraph", "text": "How to build models as arbitrary graphs of layers, reuse layers (layer weight sharing), and use models as Python functions (model templating).", "words": [{"w": "How", "b": [0.2303, 0.8326, 0.2794, 0.8523]}, {"w": "to", "b": [0.2857, 0.8326, 0.3053, 0.8523]}, {"w": "build", "b": [0.3116, 0.8326, 0.3635, 0.8523]}, {"w": "models", "b": [0.3698, 0.8326, 0.4426, 0.8523]}, {"w": "as", "b": [0.4489, 0.8326, 0.47, 0.8523]}, {"w": "arbitrary", "b": [0.4763, 0.8326, 0.5631, 0.8523]}, {"w": "graphs", "b": [0.5694, 0.8326, 0.6367, 0.8523]}, {"w": "of", "b": [0.643, 0.8326, 0.664, 0.8523]}, {"w": "layers,", "b": [0.6703, 0.8326, 0.7368, 0.8523]}, {"w": "reuse", "b": [0.7432, 0.8326, 0.7964, 0.8523]}, {"w": "layers", "b": [0.8027, 0.8326, 0.8629, 0.8523]}, {"w": "(layer", "b": [0.2303, 0.8531, 0.2891, 0.8728]}, {"w": "weight", "b": [0.2954, 0.8531, 0.3641, 0.8728]}, {"w": "sharing),", "b": [0.3704, 0.8531, 0.4594, 0.8728]}, {"w": "and", "b": [0.4657, 0.8531, 0.5021, 0.8728]}, {"w": "use", "b": [0.5084, 0.8531, 0.5421, 0.8728]}, {"w": "models", "b": [0.5484, 0.8531, 0.6212, 0.8728]}, {"w": "as", "b": [0.6275, 0.8531, 0.6486, 0.8728]}, {"w": "Python", "b": [0.6549, 0.8531, 0.7264, 0.8728]}, {"w": "functions", "b": [0.7327, 0.8531, 0.8266, 0.8728]}, {"w": "(model", "b": [0.2303, 0.8736, 0.3018, 0.8933]}, {"w": "templating).", "b": [0.3081, 0.8736, 0.4307, 0.8933]}]}]}, {"page": 350, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You can use Keras callbacks to monitor your models during training and take action based on model state. TensorBoard allows you to visualize metrics, activation histograms, and even embedding spaces. What batch normalization, depthwise separable convolution, and residual connections are. Why you should use hyperparameter optimization and model ensembling. With these new tools, you’re better equipped to use deep learning in the real world and start building highly competitive deep-learning models.", "words": [{"w": "You", "b": [0.2303, 0.0857, 0.2712, 0.1054]}, {"w": "can", "b": [0.2775, 0.0857, 0.3126, 0.1054]}, {"w": "use", "b": [0.3189, 0.0857, 0.3525, 0.1054]}, {"w": "Keras", "b": [0.3588, 0.0857, 0.4176, 0.1054]}, {"w": "callbacks", "b": [0.4239, 0.0857, 0.5178, 0.1054]}, {"w": "to", "b": [0.5241, 0.0857, 0.5437, 0.1054]}, {"w": "monitor", "b": [0.55, 0.0857, 0.6299, 0.1054]}, {"w": "your", "b": [0.6362, 0.0857, 0.6825, 0.1054]}, {"w": "models", "b": [0.6888, 0.0857, 0.7616, 0.1054]}, {"w": "during", "b": [0.768, 0.0857, 0.8338, 0.1054]}, {"w": "training", "b": [0.2303, 0.1062, 0.3088, 0.1259]}, {"w": "and", "b": [0.3151, 0.1062, 0.3515, 0.1259]}, {"w": "take", "b": [0.3578, 0.1062, 0.3999, 0.1259]}, {"w": "action", "b": [0.4062, 0.1062, 0.4678, 0.1259]}, {"w": "based", "b": [0.4741, 0.1062, 0.5316, 0.1259]}, {"w": "on", "b": [0.5379, 0.1062, 0.5631, 0.1259]}, {"w": "model", "b": [0.5694, 0.1062, 0.6325, 0.1259]}, {"w": "state.", "b": [0.6388, 0.1062, 0.6913, 0.1259]}, {"w": "TensorBoard", "b": [0.2303, 0.1267, 0.3603, 0.1464]}, {"w": "allows", "b": [0.3666, 0.1267, 0.4324, 0.1464]}, {"w": "you", "b": [0.4387, 0.1267, 0.4766, 0.1464]}, {"w": "to", "b": [0.4829, 0.1267, 0.5025, 0.1464]}, {"w": "visualize", "b": [0.5088, 0.1267, 0.5985, 0.1464]}, {"w": "metrics,", "b": [0.6048, 0.1267, 0.6854, 0.1464]}, {"w": "activation", "b": [0.6917, 0.1267, 0.7912, 0.1464]}, {"w": "histograms,", "b": [0.2303, 0.1472, 0.3473, 0.1669]}, {"w": "and", "b": [0.3536, 0.1472, 0.3901, 0.1669]}, {"w": "even", "b": [0.3964, 0.1472, 0.444, 0.1669]}, {"w": "embedding", "b": [0.4503, 0.1472, 0.5624, 0.1669]}, {"w": "spaces.", "b": [0.5687, 0.1472, 0.6409, 0.1669]}, {"w": "What", "b": [0.2303, 0.1677, 0.285, 0.1874]}, {"w": "batch", "b": [0.2913, 0.1677, 0.3459, 0.1874]}, {"w": "normalization,", "b": [0.3522, 0.1677, 0.4986, 0.1874]}, {"w": "depthwise", "b": [0.5049, 0.1677, 0.6072, 0.1874]}, {"w": "separable", "b": [0.6135, 0.1677, 0.7088, 0.1874]}, {"w": "convolution,", "b": [0.7151, 0.1677, 0.8419, 0.1874]}, {"w": "and", "b": [0.2303, 0.1882, 0.2667, 0.2079]}, {"w": "residual", "b": [0.273, 0.1882, 0.3529, 0.2079]}, {"w": "connections", "b": [0.3592, 0.1882, 0.4797, 0.2079]}, {"w": "are.", "b": [0.486, 0.1882, 0.5231, 0.2079]}, {"w": "Why", "b": [0.2303, 0.2087, 0.2794, 0.2284]}, {"w": "you", "b": [0.2857, 0.2087, 0.3235, 0.2284]}, {"w": "should", "b": [0.3298, 0.2087, 0.3971, 0.2284]}, {"w": "use", "b": [0.4034, 0.2087, 0.437, 0.2284]}, {"w": "hyperparameter", "b": [0.4433, 0.2087, 0.6016, 0.2284]}, {"w": "optimization", "b": [0.6079, 0.2087, 0.7355, 0.2284]}, {"w": "and", "b": [0.7418, 0.2087, 0.7782, 0.2284]}, {"w": "model", "b": [0.7845, 0.2087, 0.8476, 0.2284]}, {"w": "ensembling.", "b": [0.2303, 0.2292, 0.3529, 0.2489]}, {"w": "With", "b": [0.1799, 0.2497, 0.2293, 0.2694]}, {"w": "these", "b": [0.2356, 0.2497, 0.2874, 0.2694]}, {"w": "new", "b": [0.2938, 0.2497, 0.3358, 0.2694]}, {"w": "tools,", "b": [0.3421, 0.2497, 0.3975, 0.2694]}, {"w": "you’re", "b": [0.4038, 0.2497, 0.4696, 0.2694]}, {"w": "better", "b": [0.4759, 0.2497, 0.5333, 0.2694]}, {"w": "equipped", "b": [0.5397, 0.2497, 0.6321, 0.2694]}, {"w": "to", "b": [0.6384, 0.2497, 0.6581, 0.2694]}, {"w": "use", "b": [0.6644, 0.2497, 0.698, 0.2694]}, {"w": "deep", "b": [0.7043, 0.2497, 0.7519, 0.2694]}, {"w": "learning", "b": [0.7582, 0.2497, 0.8409, 0.2694]}, {"w": "in", "b": [0.8472, 0.2497, 0.8668, 0.2694]}, {"w": "the", "b": [0.1799, 0.2702, 0.2107, 0.2899]}, {"w": "real", "b": [0.217, 0.2702, 0.2548, 0.2899]}, {"w": "world", "b": [0.2611, 0.2702, 0.32, 0.2899]}, {"w": "and", "b": [0.3263, 0.2702, 0.3627, 0.2899]}, {"w": "start", "b": [0.369, 0.2702, 0.4124, 0.2899]}, {"w": "building", "b": [0.4188, 0.2702, 0.5029, 0.2899]}, {"w": "highly", "b": [0.5092, 0.2702, 0.5736, 0.2899]}, {"w": "competitive", "b": [0.5799, 0.2702, 0.6991, 0.2899]}, {"w": "deep-learning", "b": [0.7053, 0.2702, 0.844, 0.2899]}, {"w": "models.", "b": [0.1799, 0.2907, 0.259, 0.3104]}]}]}, {"page": 351, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 8. Generative deep learning", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "8.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Generative", "b": [0.3011, 0.1076, 0.4697, 0.1355]}, {"w": "deep", "b": [0.4787, 0.1076, 0.5501, 0.1355]}, {"w": "learning", "b": [0.5591, 0.1076, 0.6861, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1729, 0.1785]}, {"w": "chapter", "b": [0.1792, 0.1588, 0.2562, 0.1785]}, {"w": "covers", "b": [0.2626, 0.1588, 0.3284, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Text generation with LSTM Implementing DeepDream Performing neural style transfer Variational autoencoders Understanding generative adversarial networks", "words": [{"w": "Text", "b": [0.1799, 0.1971, 0.2243, 0.2168]}, {"w": "generation", "b": [0.2306, 0.1971, 0.3371, 0.2168]}, {"w": "with", "b": [0.3434, 0.1971, 0.3883, 0.2168]}, {"w": "LSTM", "b": [0.3946, 0.1971, 0.4619, 0.2168]}, {"w": "Implementing", "b": [0.1799, 0.2176, 0.3214, 0.2373]}, {"w": "DeepDream", "b": [0.3277, 0.2176, 0.4496, 0.2373]}, {"w": "Performing", "b": [0.1799, 0.2381, 0.2948, 0.2578]}, {"w": "neural", "b": [0.3011, 0.2381, 0.3641, 0.2578]}, {"w": "style", "b": [0.3704, 0.2381, 0.4181, 0.2578]}, {"w": "transfer", "b": [0.4244, 0.2381, 0.5014, 0.2578]}, {"w": "Variational", "b": [0.1799, 0.2586, 0.2906, 0.2783]}, {"w": "autoencoders", "b": [0.2969, 0.2586, 0.43, 0.2783]}, {"w": "Understanding", "b": [0.1799, 0.2791, 0.3284, 0.2988]}, {"w": "generative", "b": [0.3347, 0.2791, 0.4398, 0.2988]}, {"w": "adversarial", "b": [0.4461, 0.2791, 0.5567, 0.2988]}, {"w": "networks", "b": [0.563, 0.2791, 0.6555, 0.2988]}]}, {"id": "b_3", "type": "paragraph", "text": "The potential of artificial intelligence to emulate human thought processes goes beyond passive tasks such as object recognition and mostly reactive tasks such as driving a car. It extends well into creative activities. When I first made the claim that in a not-so-distant future, most of the cultural content that we consume will be created with substantial help from AIs, I was met with utter disbelief, even from long- time machine-learning practitioners. That was in 2014. Fast-forward three years, and the disbelief has receded—at an incredible speed. In the summer of 2015, we were entertained by Google’s DeepDream algorithm turning an image into a psychedelic mess of dog eyes and pareidolic artifacts; in 2016, we used the Prisma application to turn photos into paintings of various styles. In the summer of 2016, an experimental short movie, Sunspring, was directed using a script written by a Long Short-Term Memory (LSTM) algorithm—complete with dialogue. Maybe you’ve recently listened to music that was tentatively generated by a neural network.", "words": [{"w": "The", "b": [0.1294, 0.3219, 0.1686, 0.3416]}, {"w": "potential", "b": [0.1749, 0.3219, 0.2632, 0.3416]}, {"w": "of", "b": [0.2695, 0.3219, 0.2906, 0.3416]}, {"w": "artificial", "b": [0.2969, 0.3219, 0.3823, 0.3416]}, {"w": "intelligence", "b": [0.3886, 0.3219, 0.5063, 0.3416]}, {"w": "to", "b": [0.5126, 0.3219, 0.5323, 0.3416]}, {"w": "emulate", "b": [0.5386, 0.3219, 0.6184, 0.3416]}, {"w": "human", "b": [0.6247, 0.3219, 0.6934, 0.3416]}, {"w": "thought", "b": [0.6997, 0.3219, 0.7768, 0.3416]}, {"w": "processes", "b": [0.1294, 0.3424, 0.2261, 0.3621]}, {"w": "goes", "b": [0.2324, 0.3424, 0.2786, 0.3621]}, {"w": "beyond", "b": [0.2849, 0.3424, 0.3592, 0.3621]}, {"w": "passive", "b": [0.3655, 0.3424, 0.4398, 0.3621]}, {"w": "tasks", "b": [0.4461, 0.3424, 0.4965, 0.3621]}, {"w": "such", "b": [0.5028, 0.3424, 0.5491, 0.3621]}, {"w": "as", "b": [0.5554, 0.3424, 0.5764, 0.3621]}, {"w": "object", "b": [0.5827, 0.3424, 0.6443, 0.3621]}, {"w": "recognition", "b": [0.6507, 0.3424, 0.7656, 0.3621]}, {"w": "and", "b": [0.7718, 0.3424, 0.8082, 0.3621]}, {"w": "mostly", "b": [0.1294, 0.3629, 0.1981, 0.3826]}, {"w": "reactive", "b": [0.2044, 0.3629, 0.2842, 0.3826]}, {"w": "tasks", "b": [0.2906, 0.3629, 0.341, 0.3826]}, {"w": "such", "b": [0.3473, 0.3629, 0.3936, 0.3826]}, {"w": "as", "b": [0.3999, 0.3629, 0.4209, 0.3826]}, {"w": "driving", "b": [0.4272, 0.3629, 0.5001, 0.3826]}, {"w": "a", "b": [0.5064, 0.3629, 0.5176, 0.3826]}, {"w": "car.", "b": [0.5239, 0.3629, 0.5595, 0.3826]}, {"w": "It", "b": [0.5658, 0.3629, 0.5813, 0.3826]}, {"w": "extends", "b": [0.5876, 0.3629, 0.6646, 0.3826]}, {"w": "well", "b": [0.6709, 0.3629, 0.7144, 0.3826]}, {"w": "into", "b": [0.7207, 0.3629, 0.7599, 0.3826]}, {"w": "creative", "b": [0.7662, 0.3629, 0.8461, 0.3826]}, {"w": "activities.", "b": [0.1294, 0.3834, 0.2268, 0.4031]}, {"w": "When", "b": [0.2331, 0.3834, 0.2934, 0.4031]}, {"w": "I", "b": [0.2997, 0.3834, 0.3081, 0.4031]}, {"w": "first", "b": [0.3144, 0.3834, 0.355, 0.4031]}, {"w": "made", "b": [0.3613, 0.3834, 0.416, 0.4031]}, {"w": "the", "b": [0.4223, 0.3834, 0.4531, 0.4031]}, {"w": "claim", "b": [0.4594, 0.3834, 0.5154, 0.4031]}, {"w": "that", "b": [0.5217, 0.3834, 0.5596, 0.4031]}, {"w": "in", "b": [0.5658, 0.3834, 0.5854, 0.4031]}, {"w": "a", "b": [0.5917, 0.3834, 0.6029, 0.4031]}, {"w": "not-so-distant", "b": [0.6092, 0.3834, 0.748, 0.4031]}, {"w": "future,", "b": [0.7543, 0.3834, 0.8208, 0.4031]}, {"w": "most", "b": [0.1294, 0.4039, 0.1785, 0.4236]}, {"w": "of", "b": [0.1848, 0.4039, 0.2058, 0.4236]}, {"w": "the", "b": [0.2121, 0.4039, 0.2429, 0.4236]}, {"w": "cultural", "b": [0.2492, 0.4039, 0.3263, 0.4236]}, {"w": "content", "b": [0.3326, 0.4039, 0.4069, 0.4236]}, {"w": "that", "b": [0.4132, 0.4039, 0.451, 0.4236]}, {"w": "we", "b": [0.4573, 0.4039, 0.4867, 0.4236]}, {"w": "consume", "b": [0.493, 0.4039, 0.5827, 0.4236]}, {"w": "will", "b": [0.589, 0.4039, 0.6283, 0.4236]}, {"w": "be", "b": [0.6346, 0.4039, 0.6584, 0.4236]}, {"w": "created", "b": [0.6647, 0.4039, 0.7375, 0.4236]}, {"w": "with", "b": [0.7438, 0.4039, 0.7887, 0.4236]}, {"w": "substantial", "b": [0.1294, 0.4244, 0.2373, 0.4441]}, {"w": "help", "b": [0.2436, 0.4244, 0.2871, 0.4441]}, {"w": "from", "b": [0.2934, 0.4244, 0.3424, 0.4441]}, {"w": "AIs,", "b": [0.3487, 0.4244, 0.3915, 0.4441]}, {"w": "I", "b": [0.3978, 0.4244, 0.4062, 0.4441]}, {"w": "was", "b": [0.4124, 0.4244, 0.4517, 0.4441]}, {"w": "met", "b": [0.458, 0.4244, 0.4958, 0.4441]}, {"w": "with", "b": [0.5021, 0.4244, 0.547, 0.4441]}, {"w": "utter", "b": [0.5533, 0.4244, 0.5995, 0.4441]}, {"w": "disbelief,", "b": [0.6058, 0.4244, 0.699, 0.4441]}, {"w": "even", "b": [0.7053, 0.4244, 0.7529, 0.4441]}, {"w": "from", "b": [0.7592, 0.4244, 0.8083, 0.4441]}, {"w": "long-", "b": [0.8146, 0.4244, 0.8678, 0.4441]}, {"w": "time", "b": [0.1294, 0.4449, 0.1743, 0.4646]}, {"w": "machine-learning", "b": [0.1806, 0.4449, 0.3571, 0.4646]}, {"w": "practitioners.", "b": [0.3634, 0.4449, 0.4958, 0.4646]}, {"w": "That", "b": [0.5021, 0.4449, 0.5484, 0.4646]}, {"w": "was", "b": [0.5547, 0.4449, 0.5939, 0.4646]}, {"w": "in", "b": [0.6002, 0.4449, 0.6198, 0.4646]}, {"w": "2014.", "b": [0.6261, 0.4449, 0.6829, 0.4646]}, {"w": "Fast-forward", "b": [0.6892, 0.4449, 0.8195, 0.4646]}, {"w": "three", "b": [0.1294, 0.4654, 0.1798, 0.4851]}, {"w": "years,", "b": [0.1861, 0.4654, 0.2457, 0.4851]}, {"w": "and", "b": [0.252, 0.4654, 0.2884, 0.4851]}, {"w": "the", "b": [0.2947, 0.4654, 0.3255, 0.4851]}, {"w": "disbelief", "b": [0.3318, 0.4654, 0.4187, 0.4851]}, {"w": "has", "b": [0.425, 0.4654, 0.4586, 0.4851]}, {"w": "receded—at", "b": [0.4649, 0.4654, 0.5868, 0.4851]}, {"w": "an", "b": [0.5931, 0.4654, 0.6169, 0.4851]}, {"w": "incredible", "b": [0.6232, 0.4654, 0.7241, 0.4851]}, {"w": "speed.", "b": [0.7304, 0.4654, 0.7942, 0.4851]}, {"w": "In", "b": [0.8005, 0.4654, 0.8215, 0.4851]}, {"w": "the", "b": [0.8278, 0.4654, 0.8586, 0.4851]}, {"w": "summer", "b": [0.1294, 0.4859, 0.2107, 0.5056]}, {"w": "of", "b": [0.217, 0.4859, 0.238, 0.5056]}, {"w": "2015,", "b": [0.2443, 0.4859, 0.3011, 0.5056]}, {"w": "we", "b": [0.3074, 0.4859, 0.3368, 0.5056]}, {"w": "were", "b": [0.3431, 0.4859, 0.3921, 0.5056]}, {"w": "entertained", "b": [0.3984, 0.4859, 0.5105, 0.5056]}, {"w": "by", "b": [0.5168, 0.4859, 0.542, 0.5056]}, {"w": "Google’s", "b": [0.5483, 0.4859, 0.6394, 0.5056]}, {"w": "DeepDream", "b": [0.6457, 0.4859, 0.7676, 0.5056]}, {"w": "algorithm", "b": [0.1294, 0.5064, 0.2275, 0.5261]}, {"w": "turning", "b": [0.2338, 0.5064, 0.3067, 0.5261]}, {"w": "an", "b": [0.313, 0.5064, 0.3368, 0.5261]}, {"w": "image", "b": [0.3431, 0.5064, 0.4047, 0.5261]}, {"w": "into", "b": [0.411, 0.5064, 0.4503, 0.5261]}, {"w": "a", "b": [0.4566, 0.5064, 0.4678, 0.5261]}, {"w": "psychedelic", "b": [0.4741, 0.5064, 0.5932, 0.5261]}, {"w": "mess", "b": [0.5995, 0.5064, 0.65, 0.5261]}, {"w": "of", "b": [0.6563, 0.5064, 0.6773, 0.5261]}, {"w": "dog", "b": [0.6836, 0.5064, 0.7214, 0.5261]}, {"w": "eyes", "b": [0.7277, 0.5064, 0.7726, 0.5261]}, {"w": "and", "b": [0.7789, 0.5064, 0.8153, 0.5261]}, {"w": "pareidolic", "b": [0.1294, 0.5269, 0.2303, 0.5466]}, {"w": "artifacts;", "b": [0.2366, 0.5269, 0.3249, 0.5466]}, {"w": "in", "b": [0.3312, 0.5269, 0.3508, 0.5466]}, {"w": "2016,", "b": [0.3571, 0.5269, 0.4139, 0.5466]}, {"w": "we", "b": [0.4202, 0.5269, 0.4496, 0.5466]}, {"w": "used", "b": [0.4559, 0.5269, 0.5021, 0.5466]}, {"w": "the", "b": [0.5084, 0.5269, 0.5393, 0.5466]}, {"w": "Prisma", "b": [0.5456, 0.5269, 0.6156, 0.5466]}, {"w": "application", "b": [0.6219, 0.5269, 0.734, 0.5466]}, {"w": "to", "b": [0.7404, 0.5269, 0.76, 0.5466]}, {"w": "turn", "b": [0.7662, 0.5269, 0.8068, 0.5466]}, {"w": "photos", "b": [0.1294, 0.5474, 0.1967, 0.5671]}, {"w": "into", "b": [0.203, 0.5474, 0.2422, 0.5671]}, {"w": "paintings", "b": [0.2486, 0.5474, 0.3411, 0.5671]}, {"w": "of", "b": [0.3474, 0.5474, 0.3684, 0.5671]}, {"w": "various", "b": [0.3747, 0.5474, 0.4489, 0.5671]}, {"w": "styles.", "b": [0.4553, 0.5474, 0.519, 0.5671]}, {"w": "In", "b": [0.5253, 0.5474, 0.5463, 0.5671]}, {"w": "the", "b": [0.5526, 0.5474, 0.5835, 0.5671]}, {"w": "summer", "b": [0.5898, 0.5474, 0.6711, 0.5671]}, {"w": "of", "b": [0.6774, 0.5474, 0.6984, 0.5671]}, {"w": "2016,", "b": [0.7047, 0.5474, 0.7614, 0.5671]}, {"w": "an", "b": [0.7677, 0.5474, 0.7916, 0.5671]}, {"w": "experimental", "b": [0.1294, 0.5679, 0.2611, 0.5876]}, {"w": "short", "b": [0.2674, 0.5679, 0.3179, 0.5876]}, {"w": "movie,", "b": [0.3242, 0.5679, 0.3936, 0.5876]}, {"w": "Sunspring,", "b": [0.3998, 0.5679, 0.5084, 0.5876]}, {"w": "was", "b": [0.5147, 0.5679, 0.5539, 0.5876]}, {"w": "directed", "b": [0.5602, 0.5679, 0.6415, 0.5876]}, {"w": "using", "b": [0.6478, 0.5679, 0.7025, 0.5876]}, {"w": "a", "b": [0.7088, 0.5679, 0.72, 0.5876]}, {"w": "script", "b": [0.7263, 0.5679, 0.7823, 0.5876]}, {"w": "written", "b": [0.7886, 0.5679, 0.8601, 0.5876]}, {"w": "by", "b": [0.1294, 0.5884, 0.1546, 0.6081]}, {"w": "a", "b": [0.1609, 0.5884, 0.1721, 0.6081]}, {"w": "Long", "b": [0.1785, 0.5884, 0.2317, 0.6081]}, {"w": "Short-Term", "b": [0.238, 0.5884, 0.3539, 0.6081]}, {"w": "Memory", "b": [0.3602, 0.5884, 0.4471, 0.6081]}, {"w": "(LSTM)", "b": [0.4534, 0.5884, 0.5375, 0.6081]}, {"w": "algorithm—complete", "b": [0.5438, 0.5884, 0.7596, 0.6081]}, {"w": "with", "b": [0.7659, 0.5884, 0.8108, 0.6081]}, {"w": "dialogue.", "b": [0.1294, 0.6089, 0.2226, 0.6286]}, {"w": "Maybe", "b": [0.2289, 0.6089, 0.299, 0.6286]}, {"w": "you’ve", "b": [0.3053, 0.6089, 0.3753, 0.6286]}, {"w": "recently", "b": [0.3816, 0.6089, 0.4629, 0.6286]}, {"w": "listened", "b": [0.4691, 0.6089, 0.5476, 0.6286]}, {"w": "to", "b": [0.5539, 0.6089, 0.5735, 0.6286]}, {"w": "music", "b": [0.5798, 0.6089, 0.6401, 0.6286]}, {"w": "that", "b": [0.6464, 0.6089, 0.6843, 0.6286]}, {"w": "was", "b": [0.6906, 0.6089, 0.7298, 0.6286]}, {"w": "tentatively", "b": [0.7361, 0.6089, 0.8426, 0.6286]}, {"w": "generated", "b": [0.1294, 0.6294, 0.2275, 0.6491]}, {"w": "by", "b": [0.2338, 0.6294, 0.259, 0.6491]}, {"w": "a", "b": [0.2653, 0.6294, 0.2765, 0.6491]}, {"w": "neural", "b": [0.2828, 0.6294, 0.3458, 0.6491]}, {"w": "network.", "b": [0.3522, 0.6294, 0.4411, 0.6491]}]}, {"id": "b_4", "type": "paragraph", "text": "Granted, the artistic productions we’ve seen from AI so far have been fairly low quality. AI isn’t anywhere close to rivaling human screenwriters, painters, and composers. But replacing humans was always beside the point: artificial intelligence isn’t about replacing our own intelligence with something else, it’s about bringing into our lives and work more intelligence—intelligence of a different kind. In many fields, but especially in creative ones, AI will be used by humans as a tool to augment their own capabilities: more augmented intelligence than artificial intelligence.", "words": [{"w": "Granted,", "b": [0.1294, 0.6722, 0.217, 0.6919]}, {"w": "the", "b": [0.2233, 0.6722, 0.2541, 0.6919]}, {"w": "artistic", "b": [0.2604, 0.6722, 0.3291, 0.6919]}, {"w": "productions", "b": [0.3354, 0.6722, 0.4545, 0.6919]}, {"w": "we’ve", "b": [0.4608, 0.6722, 0.5224, 0.6919]}, {"w": "seen", "b": [0.5287, 0.6722, 0.5736, 0.6919]}, {"w": "from", "b": [0.5799, 0.6722, 0.6289, 0.6919]}, {"w": "AI", "b": [0.6352, 0.6722, 0.6618, 0.6919]}, {"w": "so", "b": [0.6681, 0.6722, 0.6906, 0.6919]}, {"w": "far", "b": [0.6969, 0.6722, 0.7249, 0.6919]}, {"w": "have", "b": [0.7312, 0.6722, 0.7788, 0.6919]}, {"w": "been", "b": [0.7851, 0.6722, 0.8327, 0.6919]}, {"w": "fairly", "b": [0.1294, 0.6927, 0.1841, 0.7124]}, {"w": "low", "b": [0.1904, 0.6927, 0.2282, 0.7124]}, {"w": "quality.", "b": [0.2345, 0.6927, 0.3092, 0.7124]}, {"w": "AI", "b": [0.3155, 0.6927, 0.3421, 0.7124]}, {"w": "isn’t", "b": [0.3484, 0.6927, 0.3928, 0.7124]}, {"w": "anywhere", "b": [0.3992, 0.6927, 0.4972, 0.7124]}, {"w": "close", "b": [0.5035, 0.6927, 0.5553, 0.7124]}, {"w": "to", "b": [0.5617, 0.6927, 0.5813, 0.7124]}, {"w": "rivaling", "b": [0.5876, 0.6927, 0.6661, 0.7124]}, {"w": "human", "b": [0.6723, 0.6927, 0.741, 0.7124]}, {"w": "screenwriters,", "b": [0.1294, 0.7132, 0.2702, 0.7329]}, {"w": "painters,", "b": [0.2765, 0.7132, 0.3627, 0.7329]}, {"w": "and", "b": [0.369, 0.7132, 0.4054, 0.7329]}, {"w": "composers.", "b": [0.4117, 0.7132, 0.5259, 0.7329]}, {"w": "But", "b": [0.5322, 0.7132, 0.5687, 0.7329]}, {"w": "replacing", "b": [0.575, 0.7132, 0.6688, 0.7329]}, {"w": "humans", "b": [0.6751, 0.7132, 0.7536, 0.7329]}, {"w": "was", "b": [0.7599, 0.7132, 0.7992, 0.7329]}, {"w": "always", "b": [0.1294, 0.7337, 0.1995, 0.7534]}, {"w": "beside", "b": [0.2058, 0.7337, 0.2702, 0.7534]}, {"w": "the", "b": [0.2765, 0.7337, 0.3074, 0.7534]}, {"w": "point:", "b": [0.3137, 0.7337, 0.3725, 0.7534]}, {"w": "artificial", "b": [0.3788, 0.7337, 0.4643, 0.7534]}, {"w": "intelligence", "b": [0.4706, 0.7337, 0.5883, 0.7534]}, {"w": "isn’t", "b": [0.5946, 0.7337, 0.6389, 0.7534]}, {"w": "about", "b": [0.6452, 0.7337, 0.7013, 0.7534]}, {"w": "replacing", "b": [0.7076, 0.7337, 0.8014, 0.7534]}, {"w": "our", "b": [0.8077, 0.7337, 0.8414, 0.7534]}, {"w": "own", "b": [0.1294, 0.7542, 0.1729, 0.7739]}, {"w": "intelligence", "b": [0.1792, 0.7542, 0.2969, 0.7739]}, {"w": "with", "b": [0.3032, 0.7542, 0.348, 0.7739]}, {"w": "something", "b": [0.3543, 0.7542, 0.4594, 0.7739]}, {"w": "else,", "b": [0.4657, 0.7542, 0.5113, 0.7739]}, {"w": "it’s", "b": [0.5176, 0.7542, 0.5484, 0.7739]}, {"w": "about", "b": [0.5547, 0.7542, 0.6107, 0.7739]}, {"w": "bringing", "b": [0.617, 0.7542, 0.7025, 0.7739]}, {"w": "into", "b": [0.7088, 0.7542, 0.7481, 0.7739]}, {"w": "our", "b": [0.7544, 0.7542, 0.788, 0.7739]}, {"w": "lives", "b": [0.7943, 0.7542, 0.842, 0.7739]}, {"w": "and", "b": [0.1294, 0.7747, 0.1658, 0.7944]}, {"w": "work", "b": [0.1721, 0.7747, 0.224, 0.7944]}, {"w": "more", "b": [0.2303, 0.7747, 0.2812, 0.7944]}, {"w": "intelligence—intelligence", "b": [0.2875, 0.7747, 0.5481, 0.7944]}, {"w": "of", "b": [0.5544, 0.7747, 0.5754, 0.7944]}, {"w": "a", "b": [0.5817, 0.7747, 0.5929, 0.7944]}, {"w": "different", "b": [0.5993, 0.7747, 0.6856, 0.7944]}, {"w": "kind.", "b": [0.6919, 0.7747, 0.743, 0.7944]}, {"w": "In", "b": [0.7493, 0.7747, 0.7704, 0.7944]}, {"w": "many", "b": [0.7767, 0.7747, 0.8327, 0.7944]}, {"w": "fields,", "b": [0.1294, 0.7952, 0.1918, 0.8149]}, {"w": "but", "b": [0.1981, 0.7952, 0.2303, 0.8149]}, {"w": "especially", "b": [0.2366, 0.7952, 0.3375, 0.8149]}, {"w": "in", "b": [0.3438, 0.7952, 0.3634, 0.8149]}, {"w": "creative", "b": [0.3697, 0.7952, 0.4496, 0.8149]}, {"w": "ones,", "b": [0.4559, 0.7952, 0.5084, 0.8149]}, {"w": "AI", "b": [0.5147, 0.7952, 0.5413, 0.8149]}, {"w": "will", "b": [0.5477, 0.7952, 0.5869, 0.8149]}, {"w": "be", "b": [0.5932, 0.7952, 0.617, 0.8149]}, {"w": "used", "b": [0.6233, 0.7952, 0.6696, 0.8149]}, {"w": "by", "b": [0.6759, 0.7952, 0.7011, 0.8149]}, {"w": "humans", "b": [0.7074, 0.7952, 0.7859, 0.8149]}, {"w": "as", "b": [0.7921, 0.7952, 0.8131, 0.8149]}, {"w": "a", "b": [0.8194, 0.7952, 0.8306, 0.8149]}, {"w": "tool", "b": [0.1294, 0.8157, 0.1687, 0.8354]}, {"w": "to", "b": [0.175, 0.8157, 0.1946, 0.8354]}, {"w": "augment", "b": [0.2009, 0.8157, 0.2878, 0.8354]}, {"w": "their", "b": [0.2941, 0.8157, 0.3403, 0.8354]}, {"w": "own", "b": [0.3466, 0.8157, 0.3901, 0.8354]}, {"w": "capabilities:", "b": [0.3964, 0.8157, 0.5183, 0.8354]}, {"w": "more", "b": [0.5246, 0.8157, 0.5764, 0.8354]}, {"w": "augmented", "b": [0.5826, 0.8157, 0.6933, 0.8354]}, {"w": "intelligence", "b": [0.6996, 0.8157, 0.8173, 0.8354]}, {"w": "than", "b": [0.8236, 0.8157, 0.8671, 0.8354]}, {"w": "artificial", "b": [0.1294, 0.8362, 0.2177, 0.8559]}, {"w": "intelligence.", "b": [0.224, 0.8362, 0.348, 0.8559]}]}]}, {"page": 352, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "A large part of artistic creation consists of simple pattern recognition and technical skill. And that’s precisely the part of the process that many find less attractive or even dispensable. That’s where AI comes in. Our perceptual modalities, our language, and our artwork all have statistical structure. Learning this structure is what deep-learning algorithms excel at. Machine-learning models can learn the statistical latent space of images, music, and stories, and they can then sample from this space, creating new artworks with characteristics similar to those the model has seen in its training data. Naturally, such sampling is hardly an act of artistic creation in itself. It’s a mere mathematical operation: the algorithm has no grounding in human life, human emotions, or our experience of the world; instead, it learns from an experience that has little in common with ours. It’s only our interpretation, as human spectators, that will give meaning to what the model generates. But in the hands of a skilled artist, algorithmic generation can be steered to become meaningful—and beautiful. Latent space sampling can become a brush that empowers the artist, augments our creative affordances, and expands the space of what we can imagine. What’s more, it can make artistic creation more accessible by eliminating the need for technical skill and practice—setting up a new medium of pure expression, factoring art apart from craft.", "words": [{"w": "A", "b": [0.1294, 0.0857, 0.1476, 0.1054]}, {"w": "large", "b": [0.1539, 0.0857, 0.2039, 0.1054]}, {"w": "part", "b": [0.2102, 0.0857, 0.2494, 0.1054]}, {"w": "of", "b": [0.2557, 0.0857, 0.2768, 0.1054]}, {"w": "artistic", "b": [0.2831, 0.0857, 0.3517, 0.1054]}, {"w": "creation", "b": [0.358, 0.0857, 0.4393, 0.1054]}, {"w": "consists", "b": [0.4456, 0.0857, 0.5255, 0.1054]}, {"w": "of", "b": [0.5318, 0.0857, 0.5528, 0.1054]}, {"w": "simple", "b": [0.5591, 0.0857, 0.6264, 0.1054]}, {"w": "pattern", "b": [0.6327, 0.0857, 0.7027, 0.1054]}, {"w": "recognition", "b": [0.709, 0.0857, 0.8239, 0.1054]}, {"w": "and", "b": [0.8303, 0.0857, 0.8667, 0.1054]}, {"w": "technical", "b": [0.1294, 0.1062, 0.2205, 0.1259]}, {"w": "skill.", "b": [0.2268, 0.1062, 0.2766, 0.1259]}, {"w": "And", "b": [0.2829, 0.1062, 0.3263, 0.1259]}, {"w": "that’s", "b": [0.3326, 0.1062, 0.3872, 0.1259]}, {"w": "precisely", "b": [0.3935, 0.1062, 0.4846, 0.1259]}, {"w": "the", "b": [0.4909, 0.1062, 0.5217, 0.1259]}, {"w": "part", "b": [0.528, 0.1062, 0.5673, 0.1259]}, {"w": "of", "b": [0.5735, 0.1062, 0.5945, 0.1259]}, {"w": "the", "b": [0.6008, 0.1062, 0.6317, 0.1259]}, {"w": "process", "b": [0.638, 0.1062, 0.7136, 0.1259]}, {"w": "that", "b": [0.7199, 0.1062, 0.7578, 0.1259]}, {"w": "many", "b": [0.7641, 0.1062, 0.8201, 0.1259]}, {"w": "find", "b": [0.8264, 0.1062, 0.8671, 0.1259]}, {"w": "less", "b": [0.1294, 0.1267, 0.1673, 0.1464]}, {"w": "attractive", "b": [0.1736, 0.1267, 0.2674, 0.1464]}, {"w": "or", "b": [0.2737, 0.1267, 0.2947, 0.1464]}, {"w": "even", "b": [0.301, 0.1267, 0.3487, 0.1464]}, {"w": "dispensable.", "b": [0.355, 0.1267, 0.479, 0.1464]}, {"w": "That’s", "b": [0.4853, 0.1267, 0.5483, 0.1464]}, {"w": "where", "b": [0.5546, 0.1267, 0.6162, 0.1464]}, {"w": "AI", "b": [0.6225, 0.1267, 0.6491, 0.1464]}, {"w": "comes", "b": [0.6555, 0.1267, 0.7199, 0.1464]}, {"w": "in.", "b": [0.7262, 0.1267, 0.7521, 0.1464]}, {"w": "Our", "b": [0.7584, 0.1267, 0.7977, 0.1464]}, {"w": "perceptual", "b": [0.1294, 0.1472, 0.2345, 0.1669]}, {"w": "modalities,", "b": [0.2408, 0.1472, 0.3522, 0.1669]}, {"w": "our", "b": [0.3585, 0.1472, 0.3921, 0.1669]}, {"w": "language,", "b": [0.3984, 0.1472, 0.4958, 0.1669]}, {"w": "and", "b": [0.5021, 0.1472, 0.5385, 0.1669]}, {"w": "our", "b": [0.5448, 0.1472, 0.5784, 0.1669]}, {"w": "artwork", "b": [0.5847, 0.1472, 0.6632, 0.1669]}, {"w": "all", "b": [0.6695, 0.1472, 0.6947, 0.1669]}, {"w": "have", "b": [0.701, 0.1472, 0.7486, 0.1669]}, {"w": "statistical", "b": [0.7549, 0.1472, 0.8503, 0.1669]}, {"w": "structure.", "b": [0.1294, 0.1677, 0.224, 0.1874]}, {"w": "Learning", "b": [0.2303, 0.1677, 0.3214, 0.1874]}, {"w": "this", "b": [0.3277, 0.1677, 0.3641, 0.1874]}, {"w": "structure", "b": [0.3704, 0.1677, 0.4587, 0.1874]}, {"w": "is", "b": [0.465, 0.1677, 0.4818, 0.1874]}, {"w": "what", "b": [0.4881, 0.1677, 0.5372, 0.1874]}, {"w": "deep-learning", "b": [0.5435, 0.1677, 0.6822, 0.1874]}, {"w": "algorithms", "b": [0.6885, 0.1677, 0.7964, 0.1874]}, {"w": "excel", "b": [0.8027, 0.1677, 0.8559, 0.1874]}, {"w": "at.", "b": [0.1294, 0.1882, 0.1539, 0.2079]}, {"w": "Machine-learning", "b": [0.1602, 0.1882, 0.3395, 0.2079]}, {"w": "models", "b": [0.3459, 0.1882, 0.4187, 0.2079]}, {"w": "can", "b": [0.425, 0.1882, 0.46, 0.2079]}, {"w": "learn", "b": [0.4664, 0.1882, 0.5168, 0.2079]}, {"w": "the", "b": [0.5231, 0.1882, 0.5539, 0.2079]}, {"w": "statistical", "b": [0.5602, 0.1882, 0.6555, 0.2079]}, {"w": "latent", "b": [0.6617, 0.1882, 0.7192, 0.2079]}, {"w": "space", "b": [0.7255, 0.1882, 0.7829, 0.2079]}, {"w": "of", "b": [0.7892, 0.1882, 0.8102, 0.2079]}, {"w": "images,", "b": [0.1294, 0.2087, 0.2072, 0.2284]}, {"w": "music,", "b": [0.2135, 0.2087, 0.2801, 0.2284]}, {"w": "and", "b": [0.2864, 0.2087, 0.3228, 0.2284]}, {"w": "stories,", "b": [0.3291, 0.2087, 0.4013, 0.2284]}, {"w": "and", "b": [0.4076, 0.2087, 0.444, 0.2284]}, {"w": "they", "b": [0.4503, 0.2087, 0.4937, 0.2284]}, {"w": "can", "b": [0.5001, 0.2087, 0.5351, 0.2284]}, {"w": "then", "b": [0.5414, 0.2087, 0.5848, 0.2284]}, {"w": "sample", "b": [0.5911, 0.2087, 0.6625, 0.2284]}, {"w": "from", "b": [0.6688, 0.2087, 0.7179, 0.2284]}, {"w": "this", "b": [0.7242, 0.2087, 0.7606, 0.2284]}, {"w": "space,", "b": [0.7669, 0.2087, 0.8293, 0.2284]}, {"w": "creating", "b": [0.1294, 0.2292, 0.2107, 0.2489]}, {"w": "new", "b": [0.217, 0.2292, 0.259, 0.2489]}, {"w": "artworks", "b": [0.2653, 0.2292, 0.3536, 0.2489]}, {"w": "with", "b": [0.3599, 0.2292, 0.4047, 0.2489]}, {"w": "characteristics", "b": [0.411, 0.2292, 0.5553, 0.2489]}, {"w": "similar", "b": [0.5616, 0.2292, 0.6317, 0.2489]}, {"w": "to", "b": [0.638, 0.2292, 0.6576, 0.2489]}, {"w": "those", "b": [0.6639, 0.2292, 0.7172, 0.2489]}, {"w": "the", "b": [0.7235, 0.2292, 0.7543, 0.2489]}, {"w": "model", "b": [0.7606, 0.2292, 0.8237, 0.2489]}, {"w": "has", "b": [0.83, 0.2292, 0.8636, 0.2489]}, {"w": "seen", "b": [0.1294, 0.2497, 0.1742, 0.2694]}, {"w": "in", "b": [0.1805, 0.2497, 0.2002, 0.2694]}, {"w": "its", "b": [0.2065, 0.2497, 0.2303, 0.2694]}, {"w": "training", "b": [0.2366, 0.2497, 0.3151, 0.2694]}, {"w": "data.", "b": [0.3214, 0.2497, 0.3697, 0.2694]}, {"w": "Naturally,", "b": [0.376, 0.2497, 0.4759, 0.2694]}, {"w": "such", "b": [0.4822, 0.2497, 0.5285, 0.2694]}, {"w": "sampling", "b": [0.5348, 0.2497, 0.6273, 0.2694]}, {"w": "is", "b": [0.6336, 0.2497, 0.6504, 0.2694]}, {"w": "hardly", "b": [0.6567, 0.2497, 0.7212, 0.2694]}, {"w": "an", "b": [0.7275, 0.2497, 0.7513, 0.2694]}, {"w": "act", "b": [0.7576, 0.2497, 0.787, 0.2694]}, {"w": "of", "b": [0.7933, 0.2497, 0.8143, 0.2694]}, {"w": "artistic", "b": [0.1294, 0.2702, 0.1981, 0.2899]}, {"w": "creation", "b": [0.2044, 0.2702, 0.2856, 0.2899]}, {"w": "in", "b": [0.2919, 0.2702, 0.3116, 0.2899]}, {"w": "itself.", "b": [0.3179, 0.2702, 0.3746, 0.2899]}, {"w": "It’s", "b": [0.3809, 0.2702, 0.4131, 0.2899]}, {"w": "a", "b": [0.4194, 0.2702, 0.4306, 0.2899]}, {"w": "mere", "b": [0.4369, 0.2702, 0.4874, 0.2899]}, {"w": "mathematical", "b": [0.4937, 0.2702, 0.6296, 0.2899]}, {"w": "operation:", "b": [0.6359, 0.2702, 0.7382, 0.2899]}, {"w": "the", "b": [0.7445, 0.2702, 0.7753, 0.2899]}, {"w": "algorithm", "b": [0.1294, 0.2907, 0.2275, 0.3104]}, {"w": "has", "b": [0.2338, 0.2907, 0.2674, 0.3104]}, {"w": "no", "b": [0.2738, 0.2907, 0.299, 0.3104]}, {"w": "grounding", "b": [0.3053, 0.2907, 0.409, 0.3104]}, {"w": "in", "b": [0.4153, 0.2907, 0.4349, 0.3104]}, {"w": "human", "b": [0.4412, 0.2907, 0.5099, 0.3104]}, {"w": "life,", "b": [0.5162, 0.2907, 0.5561, 0.3104]}, {"w": "human", "b": [0.5624, 0.2907, 0.6311, 0.3104]}, {"w": "emotions,", "b": [0.6374, 0.2907, 0.7362, 0.3104]}, {"w": "or", "b": [0.7425, 0.2907, 0.7635, 0.3104]}, {"w": "our", "b": [0.7698, 0.2907, 0.8034, 0.3104]}, {"w": "experience", "b": [0.1294, 0.3112, 0.2387, 0.3309]}, {"w": "of", "b": [0.245, 0.3112, 0.266, 0.3309]}, {"w": "the", "b": [0.2723, 0.3112, 0.3031, 0.3309]}, {"w": "world;", "b": [0.3094, 0.3112, 0.3753, 0.3309]}, {"w": "instead,", "b": [0.3816, 0.3112, 0.4594, 0.3309]}, {"w": "it", "b": [0.4657, 0.3112, 0.4797, 0.3309]}, {"w": "learns", "b": [0.486, 0.3112, 0.5462, 0.3309]}, {"w": "from", "b": [0.5525, 0.3112, 0.6016, 0.3309]}, {"w": "an", "b": [0.6079, 0.3112, 0.6317, 0.3309]}, {"w": "experience", "b": [0.638, 0.3112, 0.7473, 0.3309]}, {"w": "that", "b": [0.7536, 0.3112, 0.7914, 0.3309]}, {"w": "has", "b": [0.7977, 0.3112, 0.8313, 0.3309]}, {"w": "little", "b": [0.1294, 0.3317, 0.1757, 0.3514]}, {"w": "in", "b": [0.182, 0.3317, 0.2016, 0.3514]}, {"w": "common", "b": [0.2079, 0.3317, 0.2962, 0.3514]}, {"w": "with", "b": [0.3025, 0.3317, 0.3473, 0.3514]}, {"w": "ours.", "b": [0.3536, 0.3317, 0.4034, 0.3514]}, {"w": "It’s", "b": [0.4097, 0.3317, 0.4419, 0.3514]}, {"w": "only", "b": [0.4482, 0.3317, 0.4931, 0.3514]}, {"w": "our", "b": [0.4994, 0.3317, 0.533, 0.3514]}, {"w": "interpretation,", "b": [0.5393, 0.3317, 0.6815, 0.3514]}, {"w": "as", "b": [0.6878, 0.3317, 0.7088, 0.3514]}, {"w": "human", "b": [0.7151, 0.3317, 0.7838, 0.3514]}, {"w": "spectators,", "b": [0.1294, 0.3522, 0.2366, 0.3719]}, {"w": "that", "b": [0.2429, 0.3522, 0.2807, 0.3719]}, {"w": "will", "b": [0.287, 0.3522, 0.3263, 0.3719]}, {"w": "give", "b": [0.3326, 0.3522, 0.376, 0.3719]}, {"w": "meaning", "b": [0.3824, 0.3522, 0.4692, 0.3719]}, {"w": "to", "b": [0.4755, 0.3522, 0.4952, 0.3719]}, {"w": "what", "b": [0.5015, 0.3522, 0.5505, 0.3719]}, {"w": "the", "b": [0.5568, 0.3522, 0.5876, 0.3719]}, {"w": "model", "b": [0.5939, 0.3522, 0.657, 0.3719]}, {"w": "generates.", "b": [0.6633, 0.3522, 0.7649, 0.3719]}, {"w": "But", "b": [0.7712, 0.3522, 0.8076, 0.3719]}, {"w": "in", "b": [0.8139, 0.3522, 0.8336, 0.3719]}, {"w": "the", "b": [0.8399, 0.3522, 0.8707, 0.3719]}, {"w": "hands", "b": [0.1294, 0.3727, 0.1883, 0.3924]}, {"w": "of", "b": [0.1946, 0.3727, 0.2156, 0.3924]}, {"w": "a", "b": [0.2219, 0.3727, 0.2331, 0.3924]}, {"w": "skilled", "b": [0.2394, 0.3727, 0.3067, 0.3924]}, {"w": "artist,", "b": [0.313, 0.3727, 0.3697, 0.3924]}, {"w": "algorithmic", "b": [0.376, 0.3727, 0.4924, 0.3924]}, {"w": "generation", "b": [0.4987, 0.3727, 0.6051, 0.3924]}, {"w": "can", "b": [0.6115, 0.3727, 0.6465, 0.3924]}, {"w": "be", "b": [0.6528, 0.3727, 0.6766, 0.3924]}, {"w": "steered", "b": [0.6829, 0.3727, 0.7543, 0.3924]}, {"w": "to", "b": [0.7606, 0.3727, 0.7803, 0.3924]}, {"w": "become", "b": [0.7866, 0.3727, 0.865, 0.3924]}, {"w": "meaningful—and", "b": [0.1294, 0.3932, 0.306, 0.4129]}, {"w": "beautiful.", "b": [0.3123, 0.3932, 0.4083, 0.4129]}, {"w": "Latent", "b": [0.4146, 0.3932, 0.479, 0.4129]}, {"w": "space", "b": [0.4853, 0.3932, 0.5413, 0.4129]}, {"w": "sampling", "b": [0.5477, 0.3932, 0.6402, 0.4129]}, {"w": "can", "b": [0.6464, 0.3932, 0.6814, 0.4129]}, {"w": "become", "b": [0.6877, 0.3932, 0.7661, 0.4129]}, {"w": "a", "b": [0.7724, 0.3932, 0.7836, 0.4129]}, {"w": "brush", "b": [0.7899, 0.3932, 0.846, 0.4129]}, {"w": "that", "b": [0.1294, 0.4137, 0.1673, 0.4334]}, {"w": "empowers", "b": [0.1736, 0.4137, 0.2772, 0.4334]}, {"w": "the", "b": [0.2835, 0.4137, 0.3144, 0.4334]}, {"w": "artist,", "b": [0.3207, 0.4137, 0.3774, 0.4334]}, {"w": "augments", "b": [0.3837, 0.4137, 0.4804, 0.4334]}, {"w": "our", "b": [0.4867, 0.4137, 0.5204, 0.4334]}, {"w": "creative", "b": [0.5267, 0.4137, 0.6065, 0.4334]}, {"w": "affordances,", "b": [0.6128, 0.4137, 0.7362, 0.4334]}, {"w": "and", "b": [0.7425, 0.4137, 0.779, 0.4334]}, {"w": "expands", "b": [0.7853, 0.4137, 0.8679, 0.4334]}, {"w": "the", "b": [0.1294, 0.4342, 0.1602, 0.4539]}, {"w": "space", "b": [0.1665, 0.4342, 0.2226, 0.4539]}, {"w": "of", "b": [0.2289, 0.4342, 0.2499, 0.4539]}, {"w": "what", "b": [0.2562, 0.4342, 0.3052, 0.4539]}, {"w": "we", "b": [0.3115, 0.4342, 0.341, 0.4539]}, {"w": "can", "b": [0.3473, 0.4342, 0.3823, 0.4539]}, {"w": "imagine.", "b": [0.3886, 0.4342, 0.4762, 0.4539]}, {"w": "What’s", "b": [0.4824, 0.4342, 0.5539, 0.4539]}, {"w": "more,", "b": [0.5602, 0.4342, 0.6183, 0.4539]}, {"w": "it", "b": [0.6246, 0.4342, 0.6386, 0.4539]}, {"w": "can", "b": [0.645, 0.4342, 0.68, 0.4539]}, {"w": "make", "b": [0.6863, 0.4342, 0.7409, 0.4539]}, {"w": "artistic", "b": [0.7472, 0.4342, 0.8159, 0.4539]}, {"w": "creation", "b": [0.1294, 0.4547, 0.2107, 0.4744]}, {"w": "more", "b": [0.217, 0.4547, 0.2688, 0.4744]}, {"w": "accessible", "b": [0.2751, 0.4547, 0.3774, 0.4744]}, {"w": "by", "b": [0.3837, 0.4547, 0.4089, 0.4744]}, {"w": "eliminating", "b": [0.4152, 0.4547, 0.5301, 0.4744]}, {"w": "the", "b": [0.5365, 0.4547, 0.5673, 0.4744]}, {"w": "need", "b": [0.5736, 0.4547, 0.6212, 0.4744]}, {"w": "for", "b": [0.6275, 0.4547, 0.6569, 0.4744]}, {"w": "technical", "b": [0.6632, 0.4547, 0.7543, 0.4744]}, {"w": "skill", "b": [0.7606, 0.4547, 0.8041, 0.4744]}, {"w": "and", "b": [0.8104, 0.4547, 0.8468, 0.4744]}, {"w": "practice—setting", "b": [0.1294, 0.4752, 0.3018, 0.4949]}, {"w": "up", "b": [0.308, 0.4752, 0.3332, 0.4949]}, {"w": "a", "b": [0.3396, 0.4752, 0.3508, 0.4949]}, {"w": "new", "b": [0.3571, 0.4752, 0.3991, 0.4949]}, {"w": "medium", "b": [0.4054, 0.4752, 0.4881, 0.4949]}, {"w": "of", "b": [0.4944, 0.4752, 0.5154, 0.4949]}, {"w": "pure", "b": [0.5217, 0.4752, 0.5665, 0.4949]}, {"w": "expression,", "b": [0.5728, 0.4752, 0.687, 0.4949]}, {"w": "factoring", "b": [0.6933, 0.4752, 0.7844, 0.4949]}, {"w": "art", "b": [0.7907, 0.4752, 0.8173, 0.4949]}, {"w": "apart", "b": [0.1294, 0.4957, 0.1798, 0.5154]}, {"w": "from", "b": [0.1861, 0.4957, 0.2352, 0.5154]}, {"w": "craft.", "b": [0.2415, 0.4957, 0.294, 0.5154]}]}, {"id": "b_1", "type": "paragraph", "text": "Iannis Xenakis, a visionary pioneer of electronic and algorithmic music, beautifully expressed this same idea in the 1960s, in the context of the application of automation technology to music composition:[1]", "words": [{"w": "Iannis", "b": [0.1294, 0.5385, 0.1911, 0.5582]}, {"w": "Xenakis,", "b": [0.1974, 0.5385, 0.2863, 0.5582]}, {"w": "a", "b": [0.2926, 0.5385, 0.3038, 0.5582]}, {"w": "visionary", "b": [0.3102, 0.5385, 0.404, 0.5582]}, {"w": "pioneer", "b": [0.4104, 0.5385, 0.486, 0.5582]}, {"w": "of", "b": [0.4923, 0.5385, 0.5133, 0.5582]}, {"w": "electronic", "b": [0.5196, 0.5385, 0.6191, 0.5582]}, {"w": "and", "b": [0.6254, 0.5385, 0.6618, 0.5582]}, {"w": "algorithmic", "b": [0.6681, 0.5385, 0.7844, 0.5582]}, {"w": "music,", "b": [0.7908, 0.5385, 0.8573, 0.5582]}, {"w": "beautifully", "b": [0.1294, 0.559, 0.2387, 0.5787]}, {"w": "expressed", "b": [0.245, 0.559, 0.3445, 0.5787]}, {"w": "this", "b": [0.3508, 0.559, 0.3872, 0.5787]}, {"w": "same", "b": [0.3936, 0.559, 0.4454, 0.5787]}, {"w": "idea", "b": [0.4517, 0.559, 0.4937, 0.5787]}, {"w": "in", "b": [0.5, 0.559, 0.5197, 0.5787]}, {"w": "the", "b": [0.526, 0.559, 0.5568, 0.5787]}, {"w": "1960s,", "b": [0.5631, 0.559, 0.6297, 0.5787]}, {"w": "in", "b": [0.6359, 0.559, 0.6555, 0.5787]}, {"w": "the", "b": [0.6618, 0.559, 0.6927, 0.5787]}, {"w": "context", "b": [0.699, 0.559, 0.7732, 0.5787]}, {"w": "of", "b": [0.7795, 0.559, 0.8005, 0.5787]}, {"w": "the", "b": [0.8069, 0.559, 0.8377, 0.5787]}, {"w": "application", "b": [0.1294, 0.5812, 0.2415, 0.601]}, {"w": "of", "b": [0.2478, 0.5812, 0.2688, 0.601]}, {"w": "automation", "b": [0.2751, 0.5812, 0.3887, 0.601]}, {"w": "technology", "b": [0.395, 0.5812, 0.5071, 0.601]}, {"w": "to", "b": [0.5134, 0.5812, 0.533, 0.601]}, {"w": "music", "b": [0.5393, 0.5812, 0.5996, 0.601]}, {"w": "composition:[1]", "b": [0.6059, 0.579, 0.7596, 0.601]}]}, {"id": "b_3", "type": "paragraph", "text": "Iannis Xenakis, “Musiques formelles: nouveaux principes formels de composition musicale,” special issue of La Revue musicale, nos. 253 -254 (1963).", "words": [{"w": "Iannis", "b": [0.1483, 0.6467, 0.1946, 0.6615]}, {"w": "Xenakis,", "b": [0.1993, 0.6467, 0.266, 0.6615]}, {"w": "“Musiques", "b": [0.2708, 0.6467, 0.3527, 0.6615]}, {"w": "formelles:", "b": [0.3575, 0.6467, 0.4342, 0.6615]}, {"w": "nouveaux", "b": [0.4389, 0.6467, 0.5125, 0.6615]}, {"w": "principes", "b": [0.5172, 0.6467, 0.5866, 0.6615]}, {"w": "formels", "b": [0.5913, 0.6467, 0.6491, 0.6615]}, {"w": "de", "b": [0.6538, 0.6467, 0.6717, 0.6615]}, {"w": "composition", "b": [0.6764, 0.6467, 0.77, 0.6615]}, {"w": "musicale,”", "b": [0.1483, 0.6619, 0.2287, 0.6767]}, {"w": "special", "b": [0.2334, 0.6619, 0.286, 0.6767]}, {"w": "issue", "b": [0.2907, 0.6619, 0.3286, 0.6767]}, {"w": "of", "b": [0.3333, 0.6619, 0.349, 0.6767]}, {"w": "La", "b": [0.3537, 0.6619, 0.3737, 0.6767]}, {"w": "Revue", "b": [0.3785, 0.6619, 0.4247, 0.6767]}, {"w": "musicale,", "b": [0.4294, 0.6619, 0.5014, 0.6767]}, {"w": "nos.", "b": [0.5061, 0.6619, 0.5371, 0.6767]}, {"w": "253", "b": [0.5418, 0.6619, 0.5702, 0.6767]}, {"w": "-254", "b": [0.575, 0.6619, 0.6096, 0.6767]}, {"w": "(1963).", "b": [0.6144, 0.6619, 0.6695, 0.6767]}]}, {"id": "b_4", "type": "paragraph", "text": "Freed from tedious calculations, the composer is able to devote himself to the general problems that the new musical form poses and to explore the nooks and crannies of this form while modifying the values of the input data. For example, he may test all instrumental combinations from soloists to chamber orchestras, to large orchestras. With the aid of electronic computers the composer becomes a sort of pilot: he presses the buttons, introduces coordinates, and supervises the controls of a cosmic vessel sailing in the space of sound, across sonic constellations and galaxies that he could formerly glimpse only as a distant dream.", "words": [{"w": "Freed", "b": [0.1546, 0.6998, 0.2139, 0.7195]}, {"w": "from", "b": [0.2202, 0.6998, 0.267, 0.7195]}, {"w": "tedious", "b": [0.2733, 0.6998, 0.3461, 0.7195]}, {"w": "calculations,", "b": [0.3524, 0.6998, 0.4821, 0.7195]}, {"w": "the", "b": [0.4884, 0.6998, 0.5192, 0.7195]}, {"w": "composer", "b": [0.5255, 0.6998, 0.6236, 0.7195]}, {"w": "is", "b": [0.6299, 0.6998, 0.6467, 0.7195]}, {"w": "able", "b": [0.653, 0.6998, 0.6965, 0.7195]}, {"w": "to", "b": [0.7028, 0.6998, 0.7224, 0.7195]}, {"w": "devote", "b": [0.7287, 0.6998, 0.7946, 0.7195]}, {"w": "himself", "b": [0.1546, 0.7203, 0.2275, 0.74]}, {"w": "to", "b": [0.2338, 0.7203, 0.2534, 0.74]}, {"w": "the", "b": [0.2598, 0.7203, 0.2906, 0.74]}, {"w": "general", "b": [0.2969, 0.7203, 0.374, 0.74]}, {"w": "problems", "b": [0.3803, 0.7203, 0.4732, 0.74]}, {"w": "that", "b": [0.4795, 0.7203, 0.5187, 0.74]}, {"w": "the", "b": [0.5251, 0.7203, 0.5559, 0.74]}, {"w": "new", "b": [0.5622, 0.7203, 0.6028, 0.74]}, {"w": "musical", "b": [0.6091, 0.7203, 0.6876, 0.74]}, {"w": "form", "b": [0.6939, 0.7203, 0.7416, 0.74]}, {"w": "poses", "b": [0.7478, 0.7203, 0.8039, 0.74]}, {"w": "and", "b": [0.1546, 0.7408, 0.1925, 0.7605]}, {"w": "to", "b": [0.1988, 0.7408, 0.2184, 0.7605]}, {"w": "explore", "b": [0.2247, 0.7408, 0.2994, 0.7605]}, {"w": "the", "b": [0.3057, 0.7408, 0.3366, 0.7605]}, {"w": "nooks", "b": [0.3429, 0.7408, 0.4017, 0.7605]}, {"w": "and", "b": [0.408, 0.7408, 0.4459, 0.7605]}, {"w": "crannies", "b": [0.4522, 0.7408, 0.539, 0.7605]}, {"w": "of", "b": [0.5453, 0.7408, 0.565, 0.7605]}, {"w": "this", "b": [0.5713, 0.7408, 0.6077, 0.7605]}, {"w": "form", "b": [0.614, 0.7408, 0.6617, 0.7605]}, {"w": "while", "b": [0.668, 0.7408, 0.7227, 0.7605]}, {"w": "modifying", "b": [0.729, 0.7408, 0.8299, 0.7605]}, {"w": "the", "b": [0.1546, 0.7613, 0.1855, 0.781]}, {"w": "values", "b": [0.1918, 0.7613, 0.2562, 0.781]}, {"w": "of", "b": [0.2625, 0.7613, 0.2822, 0.781]}, {"w": "the", "b": [0.2885, 0.7613, 0.3193, 0.781]}, {"w": "input", "b": [0.3256, 0.7613, 0.3775, 0.781]}, {"w": "data.", "b": [0.3838, 0.7613, 0.4349, 0.781]}, {"w": "For", "b": [0.4412, 0.7613, 0.4791, 0.781]}, {"w": "example,", "b": [0.4854, 0.7613, 0.5757, 0.781]}, {"w": "he", "b": [0.582, 0.7613, 0.6059, 0.781]}, {"w": "may", "b": [0.6122, 0.7613, 0.6542, 0.781]}, {"w": "test", "b": [0.6604, 0.7613, 0.6955, 0.781]}, {"w": "all", "b": [0.7018, 0.7613, 0.7284, 0.781]}, {"w": "instrumental", "b": [0.1546, 0.7818, 0.2822, 0.8015]}, {"w": "combinations", "b": [0.2885, 0.7818, 0.4244, 0.8015]}, {"w": "from", "b": [0.4307, 0.7818, 0.4774, 0.8015]}, {"w": "soloists", "b": [0.4837, 0.7818, 0.5594, 0.8015]}, {"w": "to", "b": [0.5657, 0.7818, 0.5854, 0.8015]}, {"w": "chamber", "b": [0.5917, 0.7818, 0.6799, 0.8015]}, {"w": "orchestras,", "b": [0.6863, 0.7818, 0.7981, 0.8015]}, {"w": "to", "b": [0.8044, 0.7818, 0.8241, 0.8015]}, {"w": "large", "b": [0.1546, 0.8023, 0.207, 0.822]}, {"w": "orchestras.", "b": [0.2133, 0.8023, 0.3251, 0.822]}, {"w": "With", "b": [0.3314, 0.8023, 0.3777, 0.822]}, {"w": "the", "b": [0.384, 0.8023, 0.4148, 0.822]}, {"w": "aid", "b": [0.4211, 0.8023, 0.4534, 0.822]}, {"w": "of", "b": [0.4597, 0.8023, 0.4793, 0.822]}, {"w": "electronic", "b": [0.4856, 0.8023, 0.5855, 0.822]}, {"w": "computers", "b": [0.5918, 0.8023, 0.6969, 0.822]}, {"w": "the", "b": [0.7032, 0.8023, 0.734, 0.822]}, {"w": "composer", "b": [0.7403, 0.8023, 0.8384, 0.822]}, {"w": "becomes", "b": [0.1546, 0.8228, 0.2415, 0.8425]}, {"w": "a", "b": [0.2478, 0.8228, 0.2604, 0.8425]}, {"w": "sort", "b": [0.2667, 0.8228, 0.306, 0.8425]}, {"w": "of", "b": [0.3123, 0.8228, 0.3319, 0.8425]}, {"w": "pilot:", "b": [0.3382, 0.8228, 0.3929, 0.8425]}, {"w": "he", "b": [0.3992, 0.8228, 0.423, 0.8425]}, {"w": "presses", "b": [0.4293, 0.8228, 0.5026, 0.8425]}, {"w": "the", "b": [0.5089, 0.8228, 0.5397, 0.8425]}, {"w": "buttons,", "b": [0.546, 0.8228, 0.6266, 0.8425]}, {"w": "introduces", "b": [0.6329, 0.8228, 0.7385, 0.8425]}, {"w": "coordinates,", "b": [0.1546, 0.8433, 0.2791, 0.863]}, {"w": "and", "b": [0.2854, 0.8433, 0.3233, 0.863]}, {"w": "supervises", "b": [0.3296, 0.8433, 0.4347, 0.863]}, {"w": "the", "b": [0.441, 0.8433, 0.4718, 0.863]}, {"w": "controls", "b": [0.4781, 0.8433, 0.5598, 0.863]}, {"w": "of", "b": [0.5661, 0.8433, 0.5858, 0.863]}, {"w": "a", "b": [0.5921, 0.8433, 0.6047, 0.863]}, {"w": "cosmic", "b": [0.611, 0.8433, 0.681, 0.863]}, {"w": "vessel", "b": [0.6873, 0.8433, 0.7476, 0.863]}, {"w": "sailing", "b": [0.7539, 0.8433, 0.8226, 0.863]}, {"w": "in", "b": [0.1546, 0.8638, 0.1743, 0.8835]}, {"w": "the", "b": [0.1806, 0.8638, 0.2114, 0.8835]}, {"w": "space", "b": [0.2177, 0.8638, 0.2751, 0.8835]}, {"w": "of", "b": [0.2814, 0.8638, 0.3011, 0.8835]}, {"w": "sound,", "b": [0.3074, 0.8638, 0.374, 0.8835]}, {"w": "across", "b": [0.3803, 0.8638, 0.4452, 0.8835]}, {"w": "sonic", "b": [0.4515, 0.8638, 0.5047, 0.8835]}, {"w": "constellations", "b": [0.511, 0.8638, 0.6512, 0.8835]}, {"w": "and", "b": [0.6575, 0.8638, 0.6953, 0.8835]}, {"w": "galaxies", "b": [0.7016, 0.8638, 0.7857, 0.8835]}, {"w": "that", "b": [0.792, 0.8638, 0.8313, 0.8835]}, {"w": "he", "b": [0.1546, 0.8843, 0.1785, 0.904]}, {"w": "could", "b": [0.1848, 0.8843, 0.2408, 0.904]}, {"w": "formerly", "b": [0.2471, 0.8843, 0.334, 0.904]}, {"w": "glimpse", "b": [0.3403, 0.8843, 0.4188, 0.904]}, {"w": "only", "b": [0.4251, 0.8843, 0.4685, 0.904]}, {"w": "as", "b": [0.4748, 0.8843, 0.4973, 0.904]}, {"w": "a", "b": [0.5036, 0.8843, 0.5162, 0.904]}, {"w": "distant", "b": [0.5225, 0.8843, 0.5912, 0.904]}, {"w": "dream.", "b": [0.5974, 0.8843, 0.6673, 0.904]}]}]}, {"page": 353, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In this chapter, we’ll explore from various angles the potential of deep learning to augment artistic creation. We’ll review sequence data generation (which can be used to generate text or music), DeepDream, and image generation using both variational autoencoders and generative adversarial networks. We’ll get your computer to dream up content never seen before; and maybe we’ll get you to dream, too, about the fantastic possibilities that lie at the intersection of technology and art. Let’s get started.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "this", "b": [0.1567, 0.0857, 0.1932, 0.1054]}, {"w": "chapter,", "b": [0.1995, 0.0857, 0.279, 0.1054]}, {"w": "we’ll", "b": [0.2853, 0.0857, 0.3372, 0.1054]}, {"w": "explore", "b": [0.3435, 0.0857, 0.4191, 0.1054]}, {"w": "from", "b": [0.4254, 0.0857, 0.4745, 0.1054]}, {"w": "various", "b": [0.4808, 0.0857, 0.555, 0.1054]}, {"w": "angles", "b": [0.5613, 0.0857, 0.6258, 0.1054]}, {"w": "the", "b": [0.6321, 0.0857, 0.6629, 0.1054]}, {"w": "potential", "b": [0.6692, 0.0857, 0.7575, 0.1054]}, {"w": "of", "b": [0.7638, 0.0857, 0.7848, 0.1054]}, {"w": "deep", "b": [0.7911, 0.0857, 0.8388, 0.1054]}, {"w": "learning", "b": [0.1294, 0.1062, 0.2121, 0.1259]}, {"w": "to", "b": [0.2184, 0.1062, 0.238, 0.1259]}, {"w": "augment", "b": [0.2443, 0.1062, 0.3312, 0.1259]}, {"w": "artistic", "b": [0.3375, 0.1062, 0.4062, 0.1259]}, {"w": "creation.", "b": [0.4125, 0.1062, 0.5, 0.1259]}, {"w": "We’ll", "b": [0.5063, 0.1062, 0.5617, 0.1259]}, {"w": "review", "b": [0.568, 0.1062, 0.6366, 0.1259]}, {"w": "sequence", "b": [0.6429, 0.1062, 0.7353, 0.1259]}, {"w": "data", "b": [0.7417, 0.1062, 0.7837, 0.1259]}, {"w": "generation", "b": [0.1294, 0.1267, 0.2359, 0.1464]}, {"w": "(which", "b": [0.2422, 0.1267, 0.3122, 0.1464]}, {"w": "can", "b": [0.3186, 0.1267, 0.3536, 0.1464]}, {"w": "be", "b": [0.3599, 0.1267, 0.3837, 0.1464]}, {"w": "used", "b": [0.39, 0.1267, 0.4362, 0.1464]}, {"w": "to", "b": [0.4425, 0.1267, 0.4622, 0.1464]}, {"w": "generate", "b": [0.4685, 0.1267, 0.5539, 0.1464]}, {"w": "text", "b": [0.5602, 0.1267, 0.5981, 0.1464]}, {"w": "or", "b": [0.6044, 0.1267, 0.6254, 0.1464]}, {"w": "music),", "b": [0.6317, 0.1267, 0.7067, 0.1464]}, {"w": "DeepDream,", "b": [0.713, 0.1267, 0.8411, 0.1464]}, {"w": "and", "b": [0.1294, 0.1472, 0.1658, 0.1669]}, {"w": "image", "b": [0.1721, 0.1472, 0.2338, 0.1669]}, {"w": "generation", "b": [0.2401, 0.1472, 0.3466, 0.1669]}, {"w": "using", "b": [0.3529, 0.1472, 0.4076, 0.1669]}, {"w": "both", "b": [0.4139, 0.1472, 0.4587, 0.1669]}, {"w": "variational", "b": [0.465, 0.1472, 0.5729, 0.1669]}, {"w": "autoencoders", "b": [0.5791, 0.1472, 0.7122, 0.1669]}, {"w": "and", "b": [0.7185, 0.1472, 0.755, 0.1669]}, {"w": "generative", "b": [0.7613, 0.1472, 0.8663, 0.1669]}, {"w": "adversarial", "b": [0.1294, 0.1677, 0.2401, 0.1874]}, {"w": "networks.", "b": [0.2464, 0.1677, 0.3452, 0.1874]}, {"w": "We’ll", "b": [0.3515, 0.1677, 0.4069, 0.1874]}, {"w": "get", "b": [0.4132, 0.1677, 0.444, 0.1874]}, {"w": "your", "b": [0.4503, 0.1677, 0.4965, 0.1874]}, {"w": "computer", "b": [0.5029, 0.1677, 0.5981, 0.1874]}, {"w": "to", "b": [0.6044, 0.1677, 0.6241, 0.1874]}, {"w": "dream", "b": [0.6304, 0.1677, 0.6934, 0.1874]}, {"w": "up", "b": [0.6997, 0.1677, 0.7249, 0.1874]}, {"w": "content", "b": [0.7312, 0.1677, 0.8055, 0.1874]}, {"w": "never", "b": [0.8118, 0.1677, 0.8678, 0.1874]}, {"w": "seen", "b": [0.1294, 0.1882, 0.1742, 0.2079]}, {"w": "before;", "b": [0.1805, 0.1882, 0.252, 0.2079]}, {"w": "and", "b": [0.2583, 0.1882, 0.2947, 0.2079]}, {"w": "maybe", "b": [0.301, 0.1882, 0.3683, 0.2079]}, {"w": "we’ll", "b": [0.3745, 0.1882, 0.4264, 0.2079]}, {"w": "get", "b": [0.4327, 0.1882, 0.4635, 0.2079]}, {"w": "you", "b": [0.4698, 0.1882, 0.5077, 0.2079]}, {"w": "to", "b": [0.514, 0.1882, 0.5336, 0.2079]}, {"w": "dream,", "b": [0.5399, 0.1882, 0.6092, 0.2079]}, {"w": "too,", "b": [0.6155, 0.1882, 0.6541, 0.2079]}, {"w": "about", "b": [0.6604, 0.1882, 0.7164, 0.2079]}, {"w": "the", "b": [0.7228, 0.1882, 0.7536, 0.2079]}, {"w": "fantastic", "b": [0.7599, 0.1882, 0.8453, 0.2079]}, {"w": "possibilities", "b": [0.1294, 0.2087, 0.25, 0.2284]}, {"w": "that", "b": [0.2563, 0.2087, 0.2941, 0.2284]}, {"w": "lie", "b": [0.3004, 0.2087, 0.3256, 0.2284]}, {"w": "at", "b": [0.3319, 0.2087, 0.3502, 0.2284]}, {"w": "the", "b": [0.3565, 0.2087, 0.3873, 0.2284]}, {"w": "intersection", "b": [0.3936, 0.2087, 0.5113, 0.2284]}, {"w": "of", "b": [0.5176, 0.2087, 0.5386, 0.2284]}, {"w": "technology", "b": [0.5449, 0.2087, 0.657, 0.2284]}, {"w": "and", "b": [0.6633, 0.2087, 0.6998, 0.2284]}, {"w": "art.", "b": [0.7061, 0.2087, 0.739, 0.2284]}, {"w": "Let’s", "b": [0.7453, 0.2087, 0.7956, 0.2284]}, {"w": "get", "b": [0.8019, 0.2087, 0.8328, 0.2284]}, {"w": "started.", "b": [0.1294, 0.2292, 0.203, 0.2489]}]}, {"id": "b_1", "type": "paragraph", "text": "8.1. Text generation with LSTM", "words": [{"w": "8.1.", "b": [0.1294, 0.286, 0.172, 0.3082]}, {"w": "Text", "b": [0.1791, 0.286, 0.2316, 0.3082]}, {"w": "generation", "b": [0.2387, 0.286, 0.368, 0.3082]}, {"w": "with", "b": [0.3751, 0.286, 0.4287, 0.3082]}, {"w": "LSTM", "b": [0.4358, 0.286, 0.5162, 0.3082]}]}, {"id": "b_2", "type": "paragraph", "text": "In this section, we’ll explore how recurrent neural networks can be used to generate sequence data. We’ll use text generation as an example, but the exact same techniques can be generalized to any kind of sequence data: you could apply it to sequences of musical notes in order to generate new music, to timeseries of brushstroke data (for example, recorded while an artist paints on an iPad) to generate paintings stroke by stroke, and so on.", "words": [{"w": "In", "b": [0.1294, 0.3317, 0.1504, 0.3514]}, {"w": "this", "b": [0.1567, 0.3317, 0.1932, 0.3514]}, {"w": "section,", "b": [0.1995, 0.3317, 0.2773, 0.3514]}, {"w": "we’ll", "b": [0.2836, 0.3317, 0.3354, 0.3514]}, {"w": "explore", "b": [0.3417, 0.3317, 0.4174, 0.3514]}, {"w": "how", "b": [0.4237, 0.3317, 0.4671, 0.3514]}, {"w": "recurrent", "b": [0.4734, 0.3317, 0.5645, 0.3514]}, {"w": "neural", "b": [0.5708, 0.3317, 0.6338, 0.3514]}, {"w": "networks", "b": [0.6401, 0.3317, 0.7326, 0.3514]}, {"w": "can", "b": [0.7389, 0.3317, 0.7739, 0.3514]}, {"w": "be", "b": [0.7802, 0.3317, 0.804, 0.3514]}, {"w": "used", "b": [0.8103, 0.3317, 0.8566, 0.3514]}, {"w": "to", "b": [0.1294, 0.3522, 0.149, 0.3719]}, {"w": "generate", "b": [0.1553, 0.3522, 0.2408, 0.3719]}, {"w": "sequence", "b": [0.2471, 0.3522, 0.3395, 0.3719]}, {"w": "data.", "b": [0.3458, 0.3522, 0.3942, 0.3719]}, {"w": "We’ll", "b": [0.4005, 0.3522, 0.4559, 0.3719]}, {"w": "use", "b": [0.4622, 0.3522, 0.4958, 0.3719]}, {"w": "text", "b": [0.5021, 0.3522, 0.5399, 0.3719]}, {"w": "generation", "b": [0.5462, 0.3522, 0.6527, 0.3719]}, {"w": "as", "b": [0.659, 0.3522, 0.68, 0.3719]}, {"w": "an", "b": [0.6863, 0.3522, 0.7101, 0.3719]}, {"w": "example,", "b": [0.7164, 0.3522, 0.8082, 0.3719]}, {"w": "but", "b": [0.8145, 0.3522, 0.8467, 0.3719]}, {"w": "the", "b": [0.1294, 0.3727, 0.1602, 0.3924]}, {"w": "exact", "b": [0.1665, 0.3727, 0.2198, 0.3924]}, {"w": "same", "b": [0.2261, 0.3727, 0.2779, 0.3924]}, {"w": "techniques", "b": [0.2842, 0.3727, 0.3921, 0.3924]}, {"w": "can", "b": [0.3984, 0.3727, 0.4334, 0.3924]}, {"w": "be", "b": [0.4397, 0.3727, 0.4636, 0.3924]}, {"w": "generalized", "b": [0.4699, 0.3727, 0.5861, 0.3924]}, {"w": "to", "b": [0.5924, 0.3727, 0.6121, 0.3924]}, {"w": "any", "b": [0.6184, 0.3727, 0.6548, 0.3924]}, {"w": "kind", "b": [0.6611, 0.3727, 0.7059, 0.3924]}, {"w": "of", "b": [0.7123, 0.3727, 0.7333, 0.3924]}, {"w": "sequence", "b": [0.7396, 0.3727, 0.832, 0.3924]}, {"w": "data:", "b": [0.1294, 0.3932, 0.1785, 0.4129]}, {"w": "you", "b": [0.1848, 0.3932, 0.2226, 0.4129]}, {"w": "could", "b": [0.2289, 0.3932, 0.285, 0.4129]}, {"w": "apply", "b": [0.2913, 0.3932, 0.3473, 0.4129]}, {"w": "it", "b": [0.3536, 0.3932, 0.3676, 0.4129]}, {"w": "to", "b": [0.374, 0.3932, 0.3936, 0.4129]}, {"w": "sequences", "b": [0.3999, 0.3932, 0.5021, 0.4129]}, {"w": "of", "b": [0.5084, 0.3932, 0.5294, 0.4129]}, {"w": "musical", "b": [0.5357, 0.3932, 0.6142, 0.4129]}, {"w": "notes", "b": [0.6205, 0.3932, 0.6737, 0.4129]}, {"w": "in", "b": [0.6801, 0.3932, 0.6997, 0.4129]}, {"w": "order", "b": [0.706, 0.3932, 0.7592, 0.4129]}, {"w": "to", "b": [0.7655, 0.3932, 0.7851, 0.4129]}, {"w": "generate", "b": [0.1294, 0.4137, 0.2149, 0.4334]}, {"w": "new", "b": [0.2212, 0.4137, 0.2632, 0.4334]}, {"w": "music,", "b": [0.2695, 0.4137, 0.3361, 0.4334]}, {"w": "to", "b": [0.3424, 0.4137, 0.362, 0.4334]}, {"w": "timeseries", "b": [0.3683, 0.4137, 0.4706, 0.4334]}, {"w": "of", "b": [0.4769, 0.4137, 0.4979, 0.4334]}, {"w": "brushstroke", "b": [0.5042, 0.4137, 0.6219, 0.4334]}, {"w": "data", "b": [0.6282, 0.4137, 0.6703, 0.4334]}, {"w": "(for", "b": [0.6766, 0.4137, 0.7144, 0.4334]}, {"w": "example,", "b": [0.7207, 0.4137, 0.8125, 0.4334]}, {"w": "recorded", "b": [0.1294, 0.4342, 0.2177, 0.4539]}, {"w": "while", "b": [0.224, 0.4342, 0.28, 0.4539]}, {"w": "an", "b": [0.2863, 0.4342, 0.3101, 0.4539]}, {"w": "artist", "b": [0.3164, 0.4342, 0.3669, 0.4539]}, {"w": "paints", "b": [0.3732, 0.4342, 0.4334, 0.4539]}, {"w": "on", "b": [0.4397, 0.4342, 0.465, 0.4539]}, {"w": "an", "b": [0.4713, 0.4342, 0.4951, 0.4539]}, {"w": "iPad)", "b": [0.5014, 0.4342, 0.5546, 0.4539]}, {"w": "to", "b": [0.5609, 0.4342, 0.5806, 0.4539]}, {"w": "generate", "b": [0.5869, 0.4342, 0.6723, 0.4539]}, {"w": "paintings", "b": [0.6786, 0.4342, 0.7711, 0.4539]}, {"w": "stroke", "b": [0.7774, 0.4342, 0.8391, 0.4539]}, {"w": "by", "b": [0.8454, 0.4342, 0.8706, 0.4539]}, {"w": "stroke,", "b": [0.1294, 0.4547, 0.1974, 0.4744]}, {"w": "and", "b": [0.2037, 0.4547, 0.2401, 0.4744]}, {"w": "so", "b": [0.2464, 0.4547, 0.2688, 0.4744]}, {"w": "on.", "b": [0.2751, 0.4547, 0.3067, 0.4744]}]}, {"id": "b_3", "type": "paragraph", "text": "Sequence data generation is in no way limited to artistic content generation. It has been successfully applied to speech synthesis and to dialogue generation for chatbots. The Smart Reply feature that Google released in 2016, capable of automatically generating a selection of quick replies to emails or text messages, is powered by similar techniques.", "words": [{"w": "Sequence", "b": [0.1294, 0.4975, 0.2261, 0.5172]}, {"w": "data", "b": [0.2324, 0.4975, 0.2744, 0.5172]}, {"w": "generation", "b": [0.2807, 0.4975, 0.3872, 0.5172]}, {"w": "is", "b": [0.3935, 0.4975, 0.4103, 0.5172]}, {"w": "in", "b": [0.4166, 0.4975, 0.4363, 0.5172]}, {"w": "no", "b": [0.4426, 0.4975, 0.4678, 0.5172]}, {"w": "way", "b": [0.4741, 0.4975, 0.5161, 0.5172]}, {"w": "limited", "b": [0.5224, 0.4975, 0.5939, 0.5172]}, {"w": "to", "b": [0.6002, 0.4975, 0.6199, 0.5172]}, {"w": "artistic", "b": [0.6262, 0.4975, 0.6948, 0.5172]}, {"w": "content", "b": [0.7011, 0.4975, 0.7754, 0.5172]}, {"w": "generation.", "b": [0.1294, 0.518, 0.2422, 0.5377]}, {"w": "It", "b": [0.2485, 0.518, 0.2639, 0.5377]}, {"w": "has", "b": [0.2702, 0.518, 0.3038, 0.5377]}, {"w": "been", "b": [0.3102, 0.518, 0.3578, 0.5377]}, {"w": "successfully", "b": [0.3641, 0.518, 0.4874, 0.5377]}, {"w": "applied", "b": [0.4937, 0.518, 0.568, 0.5377]}, {"w": "to", "b": [0.5743, 0.518, 0.5939, 0.5377]}, {"w": "speech", "b": [0.6002, 0.518, 0.6688, 0.5377]}, {"w": "synthesis", "b": [0.6751, 0.518, 0.7676, 0.5377]}, {"w": "and", "b": [0.7739, 0.518, 0.8103, 0.5377]}, {"w": "to", "b": [0.8166, 0.518, 0.8362, 0.5377]}, {"w": "dialogue", "b": [0.1294, 0.5385, 0.2163, 0.5582]}, {"w": "generation", "b": [0.2226, 0.5385, 0.3291, 0.5582]}, {"w": "for", "b": [0.3354, 0.5385, 0.3648, 0.5582]}, {"w": "chatbots.", "b": [0.3711, 0.5385, 0.4615, 0.5582]}, {"w": "The", "b": [0.4678, 0.5385, 0.507, 0.5582]}, {"w": "Smart", "b": [0.5133, 0.5385, 0.5736, 0.5582]}, {"w": "Reply", "b": [0.5799, 0.5385, 0.6402, 0.5582]}, {"w": "feature", "b": [0.6465, 0.5385, 0.7165, 0.5582]}, {"w": "that", "b": [0.7228, 0.5385, 0.7606, 0.5582]}, {"w": "Google", "b": [0.7669, 0.5385, 0.8412, 0.5582]}, {"w": "released", "b": [0.1294, 0.559, 0.2121, 0.5787]}, {"w": "in", "b": [0.2184, 0.559, 0.238, 0.5787]}, {"w": "2016,", "b": [0.2443, 0.559, 0.301, 0.5787]}, {"w": "capable", "b": [0.3074, 0.559, 0.3844, 0.5787]}, {"w": "of", "b": [0.3907, 0.559, 0.4117, 0.5787]}, {"w": "automatically", "b": [0.418, 0.559, 0.5553, 0.5787]}, {"w": "generating", "b": [0.5617, 0.559, 0.6681, 0.5787]}, {"w": "a", "b": [0.6743, 0.559, 0.6855, 0.5787]}, {"w": "selection", "b": [0.6918, 0.559, 0.7815, 0.5787]}, {"w": "of", "b": [0.7878, 0.559, 0.8088, 0.5787]}, {"w": "quick", "b": [0.1294, 0.5795, 0.1855, 0.5992]}, {"w": "replies", "b": [0.1918, 0.5795, 0.259, 0.5992]}, {"w": "to", "b": [0.2653, 0.5795, 0.285, 0.5992]}, {"w": "emails", "b": [0.2913, 0.5795, 0.3571, 0.5992]}, {"w": "or", "b": [0.3634, 0.5795, 0.3844, 0.5992]}, {"w": "text", "b": [0.3908, 0.5795, 0.4286, 0.5992]}, {"w": "messages,", "b": [0.4349, 0.5795, 0.5365, 0.5992]}, {"w": "is", "b": [0.5428, 0.5795, 0.5596, 0.5992]}, {"w": "powered", "b": [0.5659, 0.5795, 0.6528, 0.5992]}, {"w": "by", "b": [0.6591, 0.5795, 0.6843, 0.5992]}, {"w": "similar", "b": [0.6906, 0.5795, 0.7607, 0.5992]}, {"w": "techniques.", "b": [0.1294, 0.6, 0.2436, 0.6197]}]}, {"id": "b_4", "type": "paragraph", "text": "8.1.1. A brief history of generative recurrent networks", "words": [{"w": "8.1.1.", "b": [0.1294, 0.6472, 0.1862, 0.6669]}, {"w": "A", "b": [0.1925, 0.6472, 0.2107, 0.6669]}, {"w": "brief", "b": [0.217, 0.6472, 0.2688, 0.6669]}, {"w": "history", "b": [0.2751, 0.6472, 0.3508, 0.6669]}, {"w": "of", "b": [0.3571, 0.6472, 0.3781, 0.6669]}, {"w": "generative", "b": [0.3844, 0.6472, 0.4965, 0.6669]}, {"w": "recurrent", "b": [0.5028, 0.6472, 0.6055, 0.6669]}, {"w": "networks", "b": [0.6118, 0.6472, 0.7113, 0.6669]}]}, {"id": "b_5", "type": "paragraph", "text": "In late 2014, few people had ever seen the initials LSTM, even in the machine-learning community. Successful applications of sequence data generation with recurrent networks only began to appear in the mainstream in 2016. But these techniques have a fairly long history, starting with the development of the LSTM algorithm in 1997.[2] This new algorithm was used early on to generate text character by character.", "words": [{"w": "In", "b": [0.1294, 0.69, 0.1504, 0.7097]}, {"w": "late", "b": [0.1567, 0.69, 0.1932, 0.7097]}, {"w": "2014,", "b": [0.1995, 0.69, 0.2562, 0.7097]}, {"w": "few", "b": [0.2625, 0.69, 0.3003, 0.7097]}, {"w": "people", "b": [0.3066, 0.69, 0.3739, 0.7097]}, {"w": "had", "b": [0.3802, 0.69, 0.4166, 0.7097]}, {"w": "ever", "b": [0.4229, 0.69, 0.4664, 0.7097]}, {"w": "seen", "b": [0.4727, 0.69, 0.5175, 0.7097]}, {"w": "the", "b": [0.5238, 0.69, 0.5546, 0.7097]}, {"w": "initials", "b": [0.5609, 0.69, 0.6296, 0.7097]}, {"w": "LSTM,", "b": [0.6359, 0.69, 0.7095, 0.7097]}, {"w": "even", "b": [0.7158, 0.69, 0.7634, 0.7097]}, {"w": "in", "b": [0.7697, 0.69, 0.7894, 0.7097]}, {"w": "the", "b": [0.7957, 0.69, 0.8265, 0.7097]}, {"w": "machine-learning", "b": [0.1294, 0.7105, 0.3059, 0.7302]}, {"w": "community.", "b": [0.3122, 0.7105, 0.4318, 0.7302]}, {"w": "Successful", "b": [0.4381, 0.7105, 0.546, 0.7302]}, {"w": "applications", "b": [0.5523, 0.7105, 0.6742, 0.7302]}, {"w": "of", "b": [0.6805, 0.7105, 0.7015, 0.7302]}, {"w": "sequence", "b": [0.7078, 0.7105, 0.8002, 0.7302]}, {"w": "data", "b": [0.8066, 0.7105, 0.8486, 0.7302]}, {"w": "generation", "b": [0.1294, 0.731, 0.2359, 0.7507]}, {"w": "with", "b": [0.2422, 0.731, 0.287, 0.7507]}, {"w": "recurrent", "b": [0.2934, 0.731, 0.3844, 0.7507]}, {"w": "networks", "b": [0.3907, 0.731, 0.4832, 0.7507]}, {"w": "only", "b": [0.4895, 0.731, 0.5343, 0.7507]}, {"w": "began", "b": [0.5406, 0.731, 0.6009, 0.7507]}, {"w": "to", "b": [0.6072, 0.731, 0.6268, 0.7507]}, {"w": "appear", "b": [0.6331, 0.731, 0.7003, 0.7507]}, {"w": "in", "b": [0.7067, 0.731, 0.7263, 0.7507]}, {"w": "the", "b": [0.7326, 0.731, 0.7634, 0.7507]}, {"w": "mainstream", "b": [0.1294, 0.7515, 0.2471, 0.7712]}, {"w": "in", "b": [0.2534, 0.7515, 0.273, 0.7712]}, {"w": "2016.", "b": [0.2794, 0.7515, 0.3361, 0.7712]}, {"w": "But", "b": [0.3424, 0.7515, 0.3789, 0.7712]}, {"w": "these", "b": [0.3852, 0.7515, 0.437, 0.7712]}, {"w": "techniques", "b": [0.4433, 0.7515, 0.5512, 0.7712]}, {"w": "have", "b": [0.5575, 0.7515, 0.6051, 0.7712]}, {"w": "a", "b": [0.6114, 0.7515, 0.6226, 0.7712]}, {"w": "fairly", "b": [0.6289, 0.7515, 0.6835, 0.7712]}, {"w": "long", "b": [0.6898, 0.7515, 0.7347, 0.7712]}, {"w": "history,", "b": [0.741, 0.7515, 0.8157, 0.7712]}, {"w": "starting", "b": [0.1294, 0.7738, 0.2051, 0.7935]}, {"w": "with", "b": [0.2114, 0.7738, 0.2562, 0.7935]}, {"w": "the", "b": [0.2626, 0.7738, 0.2934, 0.7935]}, {"w": "development", "b": [0.2997, 0.7738, 0.43, 0.7935]}, {"w": "of", "b": [0.4363, 0.7738, 0.4573, 0.7935]}, {"w": "the", "b": [0.4636, 0.7738, 0.4945, 0.7935]}, {"w": "LSTM", "b": [0.5008, 0.7738, 0.568, 0.7935]}, {"w": "algorithm", "b": [0.5743, 0.7738, 0.6724, 0.7935]}, {"w": "in", "b": [0.6788, 0.7738, 0.6984, 0.7935]}, {"w": "1997.[2]", "b": [0.7047, 0.7715, 0.7834, 0.7935]}, {"w": "This", "b": [0.7897, 0.7738, 0.8345, 0.7935]}, {"w": "new", "b": [0.1294, 0.7943, 0.1714, 0.814]}, {"w": "algorithm", "b": [0.1777, 0.7943, 0.2758, 0.814]}, {"w": "was", "b": [0.2822, 0.7943, 0.3214, 0.814]}, {"w": "used", "b": [0.3277, 0.7943, 0.3739, 0.814]}, {"w": "early", "b": [0.3802, 0.7943, 0.4307, 0.814]}, {"w": "on", "b": [0.437, 0.7943, 0.4622, 0.814]}, {"w": "to", "b": [0.4685, 0.7943, 0.4881, 0.814]}, {"w": "generate", "b": [0.4944, 0.7943, 0.5799, 0.814]}, {"w": "text", "b": [0.5862, 0.7943, 0.624, 0.814]}, {"w": "character", "b": [0.6303, 0.7943, 0.7227, 0.814]}, {"w": "by", "b": [0.7291, 0.7943, 0.7543, 0.814]}, {"w": "character.", "b": [0.7606, 0.7943, 0.8578, 0.814]}]}, {"id": "b_7", "type": "paragraph", "text": "Sepp Hochreiter and Jürgen Schmidhuber, “Long Short-Term Memory,” Neural Computation 9, no. 8 (1997).", "words": [{"w": "Sepp", "b": [0.1483, 0.8597, 0.1862, 0.8746]}, {"w": "Hochreiter", "b": [0.1909, 0.8597, 0.2718, 0.8746]}, {"w": "and", "b": [0.2765, 0.8597, 0.3038, 0.8746]}, {"w": "Jürgen", "b": [0.3086, 0.8597, 0.3587, 0.8746]}, {"w": "Schmidhuber,", "b": [0.3634, 0.8597, 0.4683, 0.8746]}, {"w": "“Long", "b": [0.473, 0.8597, 0.5213, 0.8746]}, {"w": "Short-Term", "b": [0.526, 0.8597, 0.613, 0.8746]}, {"w": "Memory,”", "b": [0.6177, 0.8597, 0.6948, 0.8746]}, {"w": "Neural", "b": [0.6995, 0.8597, 0.7521, 0.8746]}, {"w": "Computation", "b": [0.1483, 0.8749, 0.2471, 0.8897]}, {"w": "9,", "b": [0.2519, 0.8749, 0.266, 0.8897]}, {"w": "no.", "b": [0.2708, 0.8749, 0.2944, 0.8897]}, {"w": "8", "b": [0.2992, 0.8749, 0.3086, 0.8897]}, {"w": "(1997).", "b": [0.3133, 0.8749, 0.3685, 0.8897]}]}]}, {"page": 354, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In 2002, Douglas Eck, then at Schmidhuber’s lab in Switzerland, applied LSTM to music generation for the first time, with promising results. Eck is now a researcher at Google Brain, and in 2016 he started a new research group there, called Magenta, focused on applying modern deep- learning techniques to produce engaging music. Sometimes, good ideas take 15 years to get started.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "2002,", "b": [0.1567, 0.0857, 0.2135, 0.1054]}, {"w": "Douglas", "b": [0.2198, 0.0857, 0.3039, 0.1054]}, {"w": "Eck,", "b": [0.3102, 0.0857, 0.3557, 0.1054]}, {"w": "then", "b": [0.362, 0.0857, 0.4055, 0.1054]}, {"w": "at", "b": [0.4118, 0.0857, 0.43, 0.1054]}, {"w": "Schmidhuber’s", "b": [0.4363, 0.0857, 0.5885, 0.1054]}, {"w": "lab", "b": [0.5948, 0.0857, 0.6257, 0.1054]}, {"w": "in", "b": [0.632, 0.0857, 0.6516, 0.1054]}, {"w": "Switzerland,", "b": [0.6579, 0.0857, 0.7847, 0.1054]}, {"w": "applied", "b": [0.791, 0.0857, 0.8653, 0.1054]}, {"w": "LSTM", "b": [0.1294, 0.1062, 0.1967, 0.1259]}, {"w": "to", "b": [0.203, 0.1062, 0.2226, 0.1259]}, {"w": "music", "b": [0.2289, 0.1062, 0.2892, 0.1259]}, {"w": "generation", "b": [0.2955, 0.1062, 0.402, 0.1259]}, {"w": "for", "b": [0.4083, 0.1062, 0.4377, 0.1259]}, {"w": "the", "b": [0.444, 0.1062, 0.4748, 0.1259]}, {"w": "first", "b": [0.4811, 0.1062, 0.5218, 0.1259]}, {"w": "time,", "b": [0.5281, 0.1062, 0.5792, 0.1259]}, {"w": "with", "b": [0.5855, 0.1062, 0.6304, 0.1259]}, {"w": "promising", "b": [0.6366, 0.1062, 0.7389, 0.1259]}, {"w": "results.", "b": [0.7452, 0.1062, 0.8174, 0.1259]}, {"w": "Eck", "b": [0.8237, 0.1062, 0.863, 0.1259]}, {"w": "is", "b": [0.1294, 0.1267, 0.1462, 0.1464]}, {"w": "now", "b": [0.1525, 0.1267, 0.196, 0.1464]}, {"w": "a", "b": [0.2023, 0.1267, 0.2135, 0.1464]}, {"w": "researcher", "b": [0.2198, 0.1267, 0.3234, 0.1464]}, {"w": "at", "b": [0.3297, 0.1267, 0.3479, 0.1464]}, {"w": "Google", "b": [0.3542, 0.1267, 0.4285, 0.1464]}, {"w": "Brain,", "b": [0.4348, 0.1267, 0.4972, 0.1464]}, {"w": "and", "b": [0.5035, 0.1267, 0.5399, 0.1464]}, {"w": "in", "b": [0.5462, 0.1267, 0.5658, 0.1464]}, {"w": "2016", "b": [0.5721, 0.1267, 0.6226, 0.1464]}, {"w": "he", "b": [0.6289, 0.1267, 0.6527, 0.1464]}, {"w": "started", "b": [0.659, 0.1267, 0.7263, 0.1464]}, {"w": "a", "b": [0.7326, 0.1267, 0.7438, 0.1464]}, {"w": "new", "b": [0.7501, 0.1267, 0.7921, 0.1464]}, {"w": "research", "b": [0.1294, 0.1472, 0.2134, 0.1669]}, {"w": "group", "b": [0.2197, 0.1472, 0.2786, 0.1669]}, {"w": "there,", "b": [0.2849, 0.1472, 0.3416, 0.1669]}, {"w": "called", "b": [0.3479, 0.1472, 0.4082, 0.1669]}, {"w": "Magenta,", "b": [0.4145, 0.1472, 0.5091, 0.1669]}, {"w": "focused", "b": [0.5153, 0.1472, 0.5938, 0.1669]}, {"w": "on", "b": [0.6001, 0.1472, 0.6253, 0.1669]}, {"w": "applying", "b": [0.6316, 0.1472, 0.7199, 0.1669]}, {"w": "modern", "b": [0.7262, 0.1472, 0.8033, 0.1669]}, {"w": "deep-", "b": [0.8096, 0.1472, 0.8656, 0.1669]}, {"w": "learning", "b": [0.1294, 0.1677, 0.2121, 0.1874]}, {"w": "techniques", "b": [0.2184, 0.1677, 0.3263, 0.1874]}, {"w": "to", "b": [0.3326, 0.1677, 0.3522, 0.1874]}, {"w": "produce", "b": [0.3585, 0.1677, 0.4398, 0.1874]}, {"w": "engaging", "b": [0.4461, 0.1677, 0.5385, 0.1874]}, {"w": "music.", "b": [0.5449, 0.1677, 0.6114, 0.1874]}, {"w": "Sometimes,", "b": [0.6177, 0.1677, 0.7362, 0.1874]}, {"w": "good", "b": [0.7425, 0.1677, 0.7929, 0.1874]}, {"w": "ideas", "b": [0.7992, 0.1677, 0.8511, 0.1874]}, {"w": "take", "b": [0.1294, 0.1882, 0.1714, 0.2079]}, {"w": "15", "b": [0.1777, 0.1882, 0.203, 0.2079]}, {"w": "years", "b": [0.2093, 0.1882, 0.2625, 0.2079]}, {"w": "to", "b": [0.2688, 0.1882, 0.2884, 0.2079]}, {"w": "get", "b": [0.2947, 0.1882, 0.3256, 0.2079]}, {"w": "started.", "b": [0.3318, 0.1882, 0.4054, 0.2079]}]}, {"id": "b_1", "type": "paragraph", "text": "In the late 2000s and early 2010s, Alex Graves did important pioneering work on using recurrent networks for sequence data generation. In particular, his 2013 work on applying recurrent mixture density networks to generate human-like handwriting using timeseries of pen positions is seen by some as a turning point.[3] This specific application of neural networks at that specific moment in time captured for me the notion of machines that dream and was a significant inspiration around the time I started developing Keras. Graves left a similar commented-out remark hidden in a 2013 LaTeX file uploaded to the preprint server arXiv: “generating sequential data is the closest computers get to dreaming.” Several years later, we take a lot of these developments for granted; but at the time, it was difficult to watch Graves’s demonstrations and not walk away awe-inspired by the possibilities.", "words": [{"w": "In", "b": [0.1294, 0.231, 0.1504, 0.2507]}, {"w": "the", "b": [0.1567, 0.231, 0.1876, 0.2507]}, {"w": "late", "b": [0.1939, 0.231, 0.2303, 0.2507]}, {"w": "2000s", "b": [0.2366, 0.231, 0.2969, 0.2507]}, {"w": "and", "b": [0.3032, 0.231, 0.3396, 0.2507]}, {"w": "early", "b": [0.3459, 0.231, 0.3963, 0.2507]}, {"w": "2010s,", "b": [0.4026, 0.231, 0.4692, 0.2507]}, {"w": "Alex", "b": [0.4755, 0.231, 0.5245, 0.2507]}, {"w": "Graves", "b": [0.5309, 0.231, 0.6023, 0.2507]}, {"w": "did", "b": [0.6086, 0.231, 0.6408, 0.2507]}, {"w": "important", "b": [0.6471, 0.231, 0.7452, 0.2507]}, {"w": "pioneering", "b": [0.7516, 0.231, 0.8594, 0.2507]}, {"w": "work", "b": [0.1294, 0.2515, 0.1813, 0.2712]}, {"w": "on", "b": [0.1876, 0.2515, 0.2128, 0.2712]}, {"w": "using", "b": [0.2191, 0.2515, 0.2738, 0.2712]}, {"w": "recurrent", "b": [0.2801, 0.2515, 0.3711, 0.2712]}, {"w": "networks", "b": [0.3774, 0.2515, 0.4699, 0.2712]}, {"w": "for", "b": [0.4762, 0.2515, 0.5056, 0.2712]}, {"w": "sequence", "b": [0.5119, 0.2515, 0.6044, 0.2712]}, {"w": "data", "b": [0.6107, 0.2515, 0.6527, 0.2712]}, {"w": "generation.", "b": [0.659, 0.2515, 0.7717, 0.2712]}, {"w": "In", "b": [0.778, 0.2515, 0.7991, 0.2712]}, {"w": "particular,", "b": [0.1294, 0.272, 0.2313, 0.2917]}, {"w": "his", "b": [0.2377, 0.272, 0.2671, 0.2917]}, {"w": "2013", "b": [0.2734, 0.272, 0.3239, 0.2917]}, {"w": "work", "b": [0.3302, 0.272, 0.382, 0.2917]}, {"w": "on", "b": [0.3883, 0.272, 0.4135, 0.2917]}, {"w": "applying", "b": [0.4198, 0.272, 0.5081, 0.2917]}, {"w": "recurrent", "b": [0.5144, 0.272, 0.6055, 0.2917]}, {"w": "mixture", "b": [0.6118, 0.272, 0.6903, 0.2917]}, {"w": "density", "b": [0.6966, 0.272, 0.7694, 0.2917]}, {"w": "networks", "b": [0.7757, 0.272, 0.8682, 0.2917]}, {"w": "to", "b": [0.1294, 0.2925, 0.149, 0.3122]}, {"w": "generate", "b": [0.1553, 0.2925, 0.2408, 0.3122]}, {"w": "human-like", "b": [0.2471, 0.2925, 0.362, 0.3122]}, {"w": "handwriting", "b": [0.3683, 0.2925, 0.4902, 0.3122]}, {"w": "using", "b": [0.4965, 0.2925, 0.5511, 0.3122]}, {"w": "timeseries", "b": [0.5574, 0.2925, 0.6597, 0.3122]}, {"w": "of", "b": [0.666, 0.2925, 0.687, 0.3122]}, {"w": "pen", "b": [0.6934, 0.2925, 0.7298, 0.3122]}, {"w": "positions", "b": [0.7361, 0.2925, 0.8272, 0.3122]}, {"w": "is", "b": [0.8335, 0.2925, 0.8503, 0.3122]}, {"w": "seen", "b": [0.1294, 0.3147, 0.1742, 0.3345]}, {"w": "by", "b": [0.1805, 0.3147, 0.2058, 0.3345]}, {"w": "some", "b": [0.2121, 0.3147, 0.2653, 0.3345]}, {"w": "as", "b": [0.2716, 0.3147, 0.2926, 0.3345]}, {"w": "a", "b": [0.299, 0.3147, 0.3102, 0.3345]}, {"w": "turning", "b": [0.3165, 0.3147, 0.3893, 0.3345]}, {"w": "point.[3]", "b": [0.3956, 0.3125, 0.4758, 0.3345]}, {"w": "This", "b": [0.4821, 0.3147, 0.527, 0.3345]}, {"w": "specific", "b": [0.5333, 0.3147, 0.6117, 0.3345]}, {"w": "application", "b": [0.618, 0.3147, 0.7301, 0.3345]}, {"w": "of", "b": [0.7364, 0.3147, 0.7575, 0.3345]}, {"w": "neural", "b": [0.7638, 0.3147, 0.8268, 0.3345]}, {"w": "networks", "b": [0.1294, 0.3352, 0.2219, 0.355]}, {"w": "at", "b": [0.2282, 0.3352, 0.2464, 0.355]}, {"w": "that", "b": [0.2527, 0.3352, 0.2906, 0.355]}, {"w": "specific", "b": [0.2969, 0.3352, 0.3753, 0.355]}, {"w": "moment", "b": [0.3816, 0.3352, 0.4643, 0.355]}, {"w": "in", "b": [0.4706, 0.3352, 0.4902, 0.355]}, {"w": "time", "b": [0.4965, 0.3352, 0.5414, 0.355]}, {"w": "captured", "b": [0.5477, 0.3352, 0.6346, 0.355]}, {"w": "for", "b": [0.6409, 0.3352, 0.6703, 0.355]}, {"w": "me", "b": [0.6766, 0.3352, 0.7074, 0.355]}, {"w": "the", "b": [0.7137, 0.3352, 0.7445, 0.355]}, {"w": "notion", "b": [0.7508, 0.3352, 0.8153, 0.355]}, {"w": "of", "b": [0.8216, 0.3352, 0.8426, 0.355]}, {"w": "machines", "b": [0.1294, 0.3557, 0.2247, 0.3755]}, {"w": "that", "b": [0.231, 0.3557, 0.2702, 0.3755]}, {"w": "dream", "b": [0.2766, 0.3557, 0.3401, 0.3755]}, {"w": "and", "b": [0.3464, 0.3557, 0.3828, 0.3755]}, {"w": "was", "b": [0.3891, 0.3557, 0.4283, 0.3755]}, {"w": "a", "b": [0.4346, 0.3557, 0.4458, 0.3755]}, {"w": "significant", "b": [0.4521, 0.3557, 0.5586, 0.3755]}, {"w": "inspiration", "b": [0.5649, 0.3557, 0.6729, 0.3755]}, {"w": "around", "b": [0.6792, 0.3557, 0.7492, 0.3755]}, {"w": "the", "b": [0.7555, 0.3557, 0.7863, 0.3755]}, {"w": "time", "b": [0.7926, 0.3557, 0.8375, 0.3755]}, {"w": "I", "b": [0.8438, 0.3557, 0.8522, 0.3755]}, {"w": "started", "b": [0.1294, 0.3762, 0.1967, 0.396]}, {"w": "developing", "b": [0.203, 0.3762, 0.3151, 0.396]}, {"w": "Keras.", "b": [0.3214, 0.3762, 0.3865, 0.396]}, {"w": "Graves", "b": [0.3928, 0.3762, 0.4643, 0.396]}, {"w": "left", "b": [0.4706, 0.3762, 0.5042, 0.396]}, {"w": "a", "b": [0.5105, 0.3762, 0.5217, 0.396]}, {"w": "similar", "b": [0.528, 0.3762, 0.5981, 0.396]}, {"w": "commented-out", "b": [0.6044, 0.3762, 0.7627, 0.396]}, {"w": "remark", "b": [0.769, 0.3762, 0.8405, 0.396]}, {"w": "hidden", "b": [0.1294, 0.3967, 0.1981, 0.4165]}, {"w": "in", "b": [0.2044, 0.3967, 0.224, 0.4165]}, {"w": "a", "b": [0.2303, 0.3967, 0.2415, 0.4165]}, {"w": "2013", "b": [0.2478, 0.3967, 0.2983, 0.4165]}, {"w": "LaTeX", "b": [0.3046, 0.3967, 0.3742, 0.4165]}, {"w": "file", "b": [0.3805, 0.3967, 0.4142, 0.4165]}, {"w": "uploaded", "b": [0.4205, 0.3967, 0.5129, 0.4165]}, {"w": "to", "b": [0.5193, 0.3967, 0.5389, 0.4165]}, {"w": "the", "b": [0.5452, 0.3967, 0.576, 0.4165]}, {"w": "preprint", "b": [0.5823, 0.3967, 0.6622, 0.4165]}, {"w": "server", "b": [0.6685, 0.3967, 0.7301, 0.4165]}, {"w": "arXiv:", "b": [0.7364, 0.3967, 0.8009, 0.4165]}, {"w": "“generating", "b": [0.1294, 0.4172, 0.2471, 0.437]}, {"w": "sequential", "b": [0.2534, 0.4172, 0.3557, 0.437]}, {"w": "data", "b": [0.362, 0.4172, 0.404, 0.437]}, {"w": "is", "b": [0.4103, 0.4172, 0.4272, 0.437]}, {"w": "the", "b": [0.4335, 0.4172, 0.4643, 0.437]}, {"w": "closest", "b": [0.4706, 0.4172, 0.5393, 0.437]}, {"w": "computers", "b": [0.5456, 0.4172, 0.6507, 0.437]}, {"w": "get", "b": [0.657, 0.4172, 0.6878, 0.437]}, {"w": "to", "b": [0.694, 0.4172, 0.7136, 0.437]}, {"w": "dreaming.”", "b": [0.7199, 0.4172, 0.8327, 0.437]}, {"w": "Several", "b": [0.1294, 0.4377, 0.2051, 0.4575]}, {"w": "years", "b": [0.2114, 0.4377, 0.2646, 0.4575]}, {"w": "later,", "b": [0.2709, 0.4377, 0.321, 0.4575]}, {"w": "we", "b": [0.3273, 0.4377, 0.3567, 0.4575]}, {"w": "take", "b": [0.363, 0.4377, 0.405, 0.4575]}, {"w": "a", "b": [0.4114, 0.4377, 0.4226, 0.4575]}, {"w": "lot", "b": [0.4289, 0.4377, 0.4555, 0.4575]}, {"w": "of", "b": [0.4618, 0.4377, 0.4828, 0.4575]}, {"w": "these", "b": [0.4891, 0.4377, 0.541, 0.4575]}, {"w": "developments", "b": [0.5473, 0.4377, 0.6874, 0.4575]}, {"w": "for", "b": [0.6937, 0.4377, 0.7231, 0.4575]}, {"w": "granted;", "b": [0.7294, 0.4377, 0.8121, 0.4575]}, {"w": "but", "b": [0.8184, 0.4377, 0.8506, 0.4575]}, {"w": "at", "b": [0.1294, 0.4582, 0.1476, 0.478]}, {"w": "the", "b": [0.1539, 0.4582, 0.1848, 0.478]}, {"w": "time,", "b": [0.1911, 0.4582, 0.2422, 0.478]}, {"w": "it", "b": [0.2485, 0.4582, 0.2626, 0.478]}, {"w": "was", "b": [0.2689, 0.4582, 0.3081, 0.478]}, {"w": "difficult", "b": [0.3144, 0.4582, 0.3952, 0.478]}, {"w": "to", "b": [0.4015, 0.4582, 0.4211, 0.478]}, {"w": "watch", "b": [0.4274, 0.4582, 0.4877, 0.478]}, {"w": "Graves’s", "b": [0.4939, 0.4582, 0.5822, 0.478]}, {"w": "demonstrations", "b": [0.5885, 0.4582, 0.7426, 0.478]}, {"w": "and", "b": [0.749, 0.4582, 0.7854, 0.478]}, {"w": "not", "b": [0.7917, 0.4582, 0.8239, 0.478]}, {"w": "walk", "b": [0.1294, 0.4787, 0.1785, 0.4985]}, {"w": "away", "b": [0.1848, 0.4787, 0.238, 0.4985]}, {"w": "awe-inspired", "b": [0.2443, 0.4787, 0.3746, 0.4985]}, {"w": "by", "b": [0.3809, 0.4787, 0.4061, 0.4985]}, {"w": "the", "b": [0.4124, 0.4787, 0.4432, 0.4985]}, {"w": "possibilities.", "b": [0.4496, 0.4787, 0.5764, 0.4985]}]}, {"id": "b_3", "type": "paragraph", "text": "Alex Graves, “Generating Sequences With Recurrent Neural Networks,” arXiv (2013), https://arxiv.org/abs/1308.0850.", "words": [{"w": "Alex", "b": [0.1483, 0.5442, 0.1851, 0.559]}, {"w": "Graves,", "b": [0.1898, 0.5442, 0.2481, 0.559]}, {"w": "“Generating", "b": [0.2529, 0.5442, 0.3453, 0.559]}, {"w": "Sequences", "b": [0.3501, 0.5442, 0.4299, 0.559]}, {"w": "With", "b": [0.4347, 0.5442, 0.4717, 0.559]}, {"w": "Recurrent", "b": [0.4764, 0.5442, 0.551, 0.559]}, {"w": "Neural", "b": [0.5558, 0.5442, 0.6073, 0.559]}, {"w": "Networks,”", "b": [0.612, 0.5442, 0.6987, 0.559]}, {"w": "arXiv", "b": [0.7034, 0.5442, 0.7465, 0.559]}, {"w": "(2013),", "b": [0.7512, 0.5442, 0.8064, 0.559]}, {"w": "https://arxiv.org/abs/1308.0850.", "b": [0.1483, 0.5594, 0.389, 0.5742]}]}, {"id": "b_4", "type": "paragraph", "text": "Since then, recurrent neural networks have been successfully used for music generation, dialogue generation, image generation, speech synthesis, and molecule design. They were even used to produce a movie script that was then cast with live actors.", "words": [{"w": "Since", "b": [0.1294, 0.5973, 0.1855, 0.617]}, {"w": "then,", "b": [0.1918, 0.5973, 0.2415, 0.617]}, {"w": "recurrent", "b": [0.2478, 0.5973, 0.3389, 0.617]}, {"w": "neural", "b": [0.3452, 0.5973, 0.4082, 0.617]}, {"w": "networks", "b": [0.4145, 0.5973, 0.507, 0.617]}, {"w": "have", "b": [0.5133, 0.5973, 0.5609, 0.617]}, {"w": "been", "b": [0.5672, 0.5973, 0.6149, 0.617]}, {"w": "successfully", "b": [0.6212, 0.5973, 0.7445, 0.617]}, {"w": "used", "b": [0.7508, 0.5973, 0.797, 0.617]}, {"w": "for", "b": [0.8033, 0.5973, 0.8327, 0.617]}, {"w": "music", "b": [0.1294, 0.6178, 0.1897, 0.6375]}, {"w": "generation,", "b": [0.196, 0.6178, 0.3088, 0.6375]}, {"w": "dialogue", "b": [0.3151, 0.6178, 0.402, 0.6375]}, {"w": "generation,", "b": [0.4083, 0.6178, 0.521, 0.6375]}, {"w": "image", "b": [0.5273, 0.6178, 0.589, 0.6375]}, {"w": "generation,", "b": [0.5953, 0.6178, 0.7081, 0.6375]}, {"w": "speech", "b": [0.7143, 0.6178, 0.7829, 0.6375]}, {"w": "synthesis,", "b": [0.1294, 0.6383, 0.2282, 0.658]}, {"w": "and", "b": [0.2345, 0.6383, 0.271, 0.658]}, {"w": "molecule", "b": [0.2773, 0.6383, 0.3697, 0.658]}, {"w": "design.", "b": [0.376, 0.6383, 0.4482, 0.658]}, {"w": "They", "b": [0.4545, 0.6383, 0.5064, 0.658]}, {"w": "were", "b": [0.5127, 0.6383, 0.5617, 0.658]}, {"w": "even", "b": [0.568, 0.6383, 0.6156, 0.658]}, {"w": "used", "b": [0.6219, 0.6383, 0.6682, 0.658]}, {"w": "to", "b": [0.6745, 0.6383, 0.6941, 0.658]}, {"w": "produce", "b": [0.7004, 0.6383, 0.7816, 0.658]}, {"w": "a", "b": [0.788, 0.6383, 0.7992, 0.658]}, {"w": "movie", "b": [0.8055, 0.6383, 0.8685, 0.658]}, {"w": "script", "b": [0.1294, 0.6588, 0.1855, 0.6785]}, {"w": "that", "b": [0.1918, 0.6588, 0.2296, 0.6785]}, {"w": "was", "b": [0.2359, 0.6588, 0.2751, 0.6785]}, {"w": "then", "b": [0.2814, 0.6588, 0.3249, 0.6785]}, {"w": "cast", "b": [0.3312, 0.6588, 0.3704, 0.6785]}, {"w": "with", "b": [0.3767, 0.6588, 0.4216, 0.6785]}, {"w": "live", "b": [0.4279, 0.6588, 0.4657, 0.6785]}, {"w": "actors.", "b": [0.472, 0.6588, 0.5386, 0.6785]}]}, {"id": "b_5", "type": "paragraph", "text": "8.1.2. How do you generate sequence data?", "words": [{"w": "8.1.2.", "b": [0.1294, 0.706, 0.1862, 0.7258]}, {"w": "How", "b": [0.1925, 0.706, 0.2429, 0.7258]}, {"w": "do", "b": [0.2492, 0.706, 0.2759, 0.7258]}, {"w": "you", "b": [0.2822, 0.706, 0.3214, 0.7258]}, {"w": "generate", "b": [0.3277, 0.706, 0.4202, 0.7258]}, {"w": "sequence", "b": [0.4265, 0.706, 0.5232, 0.7258]}, {"w": "data?", "b": [0.5295, 0.706, 0.5898, 0.7258]}]}, {"id": "b_6", "type": "paragraph", "text": "The universal way to generate sequence data in deep learning is to train a network (usually an RNN or a convnet) to predict the next token or next few tokens in a sequence, using the previous tokens as input. For instance, given the input “the cat is on the ma,” the network is trained to predict the target t, the next character. As usual when working with text data, tokens are typically words or characters, and any network that can model the probability of the next token given the previous ones is called", "words": [{"w": "The", "b": [0.1294, 0.7488, 0.1686, 0.7686]}, {"w": "universal", "b": [0.1749, 0.7488, 0.2674, 0.7686]}, {"w": "way", "b": [0.2737, 0.7488, 0.3158, 0.7686]}, {"w": "to", "b": [0.3221, 0.7488, 0.3417, 0.7686]}, {"w": "generate", "b": [0.348, 0.7488, 0.4334, 0.7686]}, {"w": "sequence", "b": [0.4397, 0.7488, 0.5322, 0.7686]}, {"w": "data", "b": [0.5385, 0.7488, 0.5805, 0.7686]}, {"w": "in", "b": [0.5868, 0.7488, 0.6065, 0.7686]}, {"w": "deep", "b": [0.6128, 0.7488, 0.6604, 0.7686]}, {"w": "learning", "b": [0.6667, 0.7488, 0.7494, 0.7686]}, {"w": "is", "b": [0.7557, 0.7488, 0.7725, 0.7686]}, {"w": "to", "b": [0.7788, 0.7488, 0.7984, 0.7686]}, {"w": "train", "b": [0.8047, 0.7488, 0.851, 0.7686]}, {"w": "a", "b": [0.8573, 0.7488, 0.8685, 0.7686]}, {"w": "network", "b": [0.1294, 0.7693, 0.2121, 0.7891]}, {"w": "(usually", "b": [0.2184, 0.7693, 0.2997, 0.7891]}, {"w": "an", "b": [0.306, 0.7693, 0.3298, 0.7891]}, {"w": "RNN", "b": [0.3361, 0.7693, 0.3893, 0.7891]}, {"w": "or", "b": [0.3956, 0.7693, 0.4167, 0.7891]}, {"w": "a", "b": [0.423, 0.7693, 0.4342, 0.7891]}, {"w": "convnet)", "b": [0.4405, 0.7693, 0.5287, 0.7891]}, {"w": "to", "b": [0.535, 0.7693, 0.5547, 0.7891]}, {"w": "predict", "b": [0.561, 0.7693, 0.631, 0.7891]}, {"w": "the", "b": [0.6373, 0.7693, 0.6681, 0.7891]}, {"w": "next", "b": [0.6744, 0.7693, 0.7178, 0.7891]}, {"w": "token", "b": [0.7242, 0.7693, 0.7802, 0.7891]}, {"w": "or", "b": [0.7865, 0.7693, 0.8075, 0.7891]}, {"w": "next", "b": [0.8138, 0.7693, 0.8573, 0.7891]}, {"w": "few", "b": [0.1294, 0.7898, 0.1672, 0.8096]}, {"w": "tokens", "b": [0.1735, 0.7898, 0.2394, 0.8096]}, {"w": "in", "b": [0.2457, 0.7898, 0.2653, 0.8096]}, {"w": "a", "b": [0.2716, 0.7898, 0.2828, 0.8096]}, {"w": "sequence,", "b": [0.2891, 0.7898, 0.3879, 0.8096]}, {"w": "using", "b": [0.3942, 0.7898, 0.4489, 0.8096]}, {"w": "the", "b": [0.4552, 0.7898, 0.486, 0.8096]}, {"w": "previous", "b": [0.4923, 0.7898, 0.5792, 0.8096]}, {"w": "tokens", "b": [0.5855, 0.7898, 0.6514, 0.8096]}, {"w": "as", "b": [0.6577, 0.7898, 0.6787, 0.8096]}, {"w": "input.", "b": [0.685, 0.7898, 0.7432, 0.8096]}, {"w": "For", "b": [0.7495, 0.7898, 0.7845, 0.8096]}, {"w": "instance,", "b": [0.1294, 0.8103, 0.2184, 0.8301]}, {"w": "given", "b": [0.2247, 0.8103, 0.2807, 0.8301]}, {"w": "the", "b": [0.287, 0.8103, 0.3179, 0.8301]}, {"w": "input", "b": [0.3242, 0.8103, 0.376, 0.8301]}, {"w": "“the", "b": [0.3824, 0.8103, 0.4244, 0.8301]}, {"w": "cat", "b": [0.4307, 0.8103, 0.4601, 0.8301]}, {"w": "is", "b": [0.4663, 0.8103, 0.4832, 0.8301]}, {"w": "on", "b": [0.4895, 0.8103, 0.5147, 0.8301]}, {"w": "the", "b": [0.521, 0.8103, 0.5518, 0.8301]}, {"w": "ma,”", "b": [0.5581, 0.8103, 0.6065, 0.8301]}, {"w": "the", "b": [0.6128, 0.8103, 0.6436, 0.8301]}, {"w": "network", "b": [0.6499, 0.8103, 0.7326, 0.8301]}, {"w": "is", "b": [0.7389, 0.8103, 0.7557, 0.8301]}, {"w": "trained", "b": [0.762, 0.8103, 0.8321, 0.8301]}, {"w": "to", "b": [0.8384, 0.8103, 0.858, 0.8301]}, {"w": "predict", "b": [0.1294, 0.8308, 0.1995, 0.8506]}, {"w": "the", "b": [0.2058, 0.8308, 0.2366, 0.8506]}, {"w": "target", "b": [0.2429, 0.8308, 0.2999, 0.8506]}, {"w": "t,", "b": [0.3061, 0.8308, 0.3195, 0.8506]}, {"w": "the", "b": [0.3258, 0.8308, 0.3566, 0.8506]}, {"w": "next", "b": [0.3629, 0.8308, 0.4063, 0.8506]}, {"w": "character.", "b": [0.4126, 0.8308, 0.5099, 0.8506]}, {"w": "As", "b": [0.5162, 0.8308, 0.5443, 0.8506]}, {"w": "usual", "b": [0.5506, 0.8308, 0.6038, 0.8506]}, {"w": "when", "b": [0.6101, 0.8308, 0.6648, 0.8506]}, {"w": "working", "b": [0.6711, 0.8308, 0.7552, 0.8506]}, {"w": "with", "b": [0.7615, 0.8308, 0.8063, 0.8506]}, {"w": "text", "b": [0.8126, 0.8308, 0.8505, 0.8506]}, {"w": "data,", "b": [0.1294, 0.8513, 0.1777, 0.8711]}, {"w": "tokens", "b": [0.184, 0.8513, 0.2485, 0.8711]}, {"w": "are", "b": [0.2548, 0.8513, 0.2856, 0.8711]}, {"w": "typically", "b": [0.2919, 0.8513, 0.3802, 0.8711]}, {"w": "words", "b": [0.3865, 0.8513, 0.4481, 0.8711]}, {"w": "or", "b": [0.4544, 0.8513, 0.4754, 0.8711]}, {"w": "characters,", "b": [0.4818, 0.8513, 0.5903, 0.8711]}, {"w": "and", "b": [0.5966, 0.8513, 0.633, 0.8711]}, {"w": "any", "b": [0.6393, 0.8513, 0.6758, 0.8711]}, {"w": "network", "b": [0.6821, 0.8513, 0.7647, 0.8711]}, {"w": "that", "b": [0.771, 0.8513, 0.8089, 0.8711]}, {"w": "can", "b": [0.8152, 0.8513, 0.8502, 0.8711]}, {"w": "model", "b": [0.1294, 0.8718, 0.1925, 0.8916]}, {"w": "the", "b": [0.1988, 0.8718, 0.2296, 0.8916]}, {"w": "probability", "b": [0.2359, 0.8718, 0.3466, 0.8916]}, {"w": "of", "b": [0.3529, 0.8718, 0.374, 0.8916]}, {"w": "the", "b": [0.3803, 0.8718, 0.4111, 0.8916]}, {"w": "next", "b": [0.4174, 0.8718, 0.4608, 0.8916]}, {"w": "token", "b": [0.4671, 0.8718, 0.5232, 0.8916]}, {"w": "given", "b": [0.5295, 0.8718, 0.5855, 0.8916]}, {"w": "the", "b": [0.5919, 0.8718, 0.6227, 0.8916]}, {"w": "previous", "b": [0.629, 0.8718, 0.7159, 0.8916]}, {"w": "ones", "b": [0.7222, 0.8718, 0.7684, 0.8916]}, {"w": "is", "b": [0.7746, 0.8718, 0.7914, 0.8916]}, {"w": "called", "b": [0.7978, 0.8718, 0.858, 0.8916]}]}]}, {"page": 355, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "a language model. A language model captures the latent space of language: its statistical structure.", "words": [{"w": "a", "b": [0.1294, 0.0857, 0.1406, 0.1054]}, {"w": "language", "b": [0.1469, 0.0857, 0.2408, 0.1054]}, {"w": "model.", "b": [0.2471, 0.0857, 0.315, 0.1054]}, {"w": "A", "b": [0.3213, 0.0857, 0.3396, 0.1054]}, {"w": "language", "b": [0.3459, 0.0857, 0.4369, 0.1054]}, {"w": "model", "b": [0.4432, 0.0857, 0.5063, 0.1054]}, {"w": "captures", "b": [0.5126, 0.0857, 0.5967, 0.1054]}, {"w": "the", "b": [0.603, 0.0857, 0.6338, 0.1054]}, {"w": "latent", "b": [0.64, 0.0857, 0.6975, 0.1054]}, {"w": "space", "b": [0.7038, 0.0857, 0.7612, 0.1054]}, {"w": "of", "b": [0.7675, 0.0857, 0.7885, 0.1054]}, {"w": "language:", "b": [0.1294, 0.1062, 0.2275, 0.1259]}, {"w": "its", "b": [0.2338, 0.1062, 0.2576, 0.1259]}, {"w": "statistical", "b": [0.2639, 0.1062, 0.3592, 0.1259]}, {"w": "structure.", "b": [0.3656, 0.1062, 0.4601, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Once you have such a trained language model, you can sample from it (generate new sequences): you feed it an initial string of text (called conditioning data), ask it to generate the next character or the next word (you can even generate several tokens at once), add the generated output back to the input data, and repeat the process many times (see figure 8.1). This loop allows you to generate sequences of arbitrary length that reflect the structure of the data on which the model was trained: sequences that look almost like human-written sentences. In the example we present in this section, you’ll take a LSTM layer, feed it strings of N characters extracted from a text corpus, and train it to predict character N + 1. The output of the model will be a softmax over all possible characters: a probability distribution for the next character. This LSTM is called a character-level neural language model.", "words": [{"w": "Once", "b": [0.1294, 0.149, 0.1826, 0.1687]}, {"w": "you", "b": [0.1889, 0.149, 0.2268, 0.1687]}, {"w": "have", "b": [0.2331, 0.149, 0.2807, 0.1687]}, {"w": "such", "b": [0.287, 0.149, 0.3333, 0.1687]}, {"w": "a", "b": [0.3396, 0.149, 0.3508, 0.1687]}, {"w": "trained", "b": [0.3571, 0.149, 0.4271, 0.1687]}, {"w": "language", "b": [0.4334, 0.149, 0.5245, 0.1687]}, {"w": "model,", "b": [0.5308, 0.149, 0.6002, 0.1687]}, {"w": "you", "b": [0.6065, 0.149, 0.6443, 0.1687]}, {"w": "can", "b": [0.6506, 0.149, 0.6856, 0.1687]}, {"w": "sample", "b": [0.6919, 0.149, 0.7633, 0.1687]}, {"w": "from", "b": [0.7696, 0.149, 0.8187, 0.1687]}, {"w": "it", "b": [0.825, 0.149, 0.839, 0.1687]}, {"w": "(generate", "b": [0.1294, 0.1695, 0.2233, 0.1892]}, {"w": "new", "b": [0.2296, 0.1695, 0.2716, 0.1892]}, {"w": "sequences):", "b": [0.2779, 0.1695, 0.3956, 0.1892]}, {"w": "you", "b": [0.4019, 0.1695, 0.4397, 0.1892]}, {"w": "feed", "b": [0.446, 0.1695, 0.4894, 0.1892]}, {"w": "it", "b": [0.4957, 0.1695, 0.5098, 0.1892]}, {"w": "an", "b": [0.5161, 0.1695, 0.5399, 0.1892]}, {"w": "initial", "b": [0.5462, 0.1695, 0.6051, 0.1892]}, {"w": "string", "b": [0.6114, 0.1695, 0.6688, 0.1892]}, {"w": "of", "b": [0.6751, 0.1695, 0.6962, 0.1892]}, {"w": "text", "b": [0.7025, 0.1695, 0.7403, 0.1892]}, {"w": "(called", "b": [0.7466, 0.1695, 0.8152, 0.1892]}, {"w": "conditioning", "b": [0.1294, 0.19, 0.257, 0.2097]}, {"w": "data),", "b": [0.2633, 0.19, 0.3228, 0.2097]}, {"w": "ask", "b": [0.3291, 0.19, 0.3627, 0.2097]}, {"w": "it", "b": [0.369, 0.19, 0.3831, 0.2097]}, {"w": "to", "b": [0.3894, 0.19, 0.409, 0.2097]}, {"w": "generate", "b": [0.4153, 0.19, 0.5007, 0.2097]}, {"w": "the", "b": [0.507, 0.19, 0.5379, 0.2097]}, {"w": "next", "b": [0.5442, 0.19, 0.5876, 0.2097]}, {"w": "character", "b": [0.5939, 0.19, 0.6863, 0.2097]}, {"w": "or", "b": [0.6926, 0.19, 0.7137, 0.2097]}, {"w": "the", "b": [0.72, 0.19, 0.7508, 0.2097]}, {"w": "next", "b": [0.7571, 0.19, 0.8005, 0.2097]}, {"w": "word", "b": [0.8068, 0.19, 0.8587, 0.2097]}, {"w": "(you", "b": [0.1294, 0.2105, 0.1757, 0.2302]}, {"w": "can", "b": [0.182, 0.2105, 0.217, 0.2302]}, {"w": "even", "b": [0.2233, 0.2105, 0.2709, 0.2302]}, {"w": "generate", "b": [0.2772, 0.2105, 0.3626, 0.2302]}, {"w": "several", "b": [0.369, 0.2105, 0.4404, 0.2302]}, {"w": "tokens", "b": [0.4467, 0.2105, 0.5126, 0.2302]}, {"w": "at", "b": [0.5189, 0.2105, 0.5371, 0.2302]}, {"w": "once),", "b": [0.5434, 0.2105, 0.6057, 0.2302]}, {"w": "add", "b": [0.612, 0.2105, 0.6485, 0.2302]}, {"w": "the", "b": [0.6548, 0.2105, 0.6856, 0.2302]}, {"w": "generated", "b": [0.6919, 0.2105, 0.7899, 0.2302]}, {"w": "output", "b": [0.7961, 0.2105, 0.8606, 0.2302]}, {"w": "back", "b": [0.1294, 0.231, 0.177, 0.2507]}, {"w": "to", "b": [0.1833, 0.231, 0.203, 0.2507]}, {"w": "the", "b": [0.2093, 0.231, 0.2401, 0.2507]}, {"w": "input", "b": [0.2464, 0.231, 0.2983, 0.2507]}, {"w": "data,", "b": [0.3046, 0.231, 0.3529, 0.2507]}, {"w": "and", "b": [0.3592, 0.231, 0.3956, 0.2507]}, {"w": "repeat", "b": [0.402, 0.231, 0.4636, 0.2507]}, {"w": "the", "b": [0.4699, 0.231, 0.5007, 0.2507]}, {"w": "process", "b": [0.507, 0.231, 0.5827, 0.2507]}, {"w": "many", "b": [0.589, 0.231, 0.645, 0.2507]}, {"w": "times", "b": [0.6513, 0.231, 0.706, 0.2507]}, {"w": "(see", "b": [0.7123, 0.231, 0.7529, 0.2507]}, {"w": "figure", "b": [0.7591, 0.231, 0.8194, 0.2507]}, {"w": "8.1).", "b": [0.1294, 0.2515, 0.1757, 0.2712]}, {"w": "This", "b": [0.182, 0.2515, 0.2268, 0.2712]}, {"w": "loop", "b": [0.2331, 0.2515, 0.278, 0.2712]}, {"w": "allows", "b": [0.2843, 0.2515, 0.3501, 0.2712]}, {"w": "you", "b": [0.3564, 0.2515, 0.3943, 0.2712]}, {"w": "to", "b": [0.4006, 0.2515, 0.4202, 0.2712]}, {"w": "generate", "b": [0.4265, 0.2515, 0.512, 0.2712]}, {"w": "sequences", "b": [0.5183, 0.2515, 0.6205, 0.2712]}, {"w": "of", "b": [0.6268, 0.2515, 0.6479, 0.2712]}, {"w": "arbitrary", "b": [0.6542, 0.2515, 0.741, 0.2712]}, {"w": "length", "b": [0.7473, 0.2515, 0.8104, 0.2712]}, {"w": "that", "b": [0.8167, 0.2515, 0.8545, 0.2712]}, {"w": "reflect", "b": [0.1294, 0.272, 0.1938, 0.2917]}, {"w": "the", "b": [0.2001, 0.272, 0.231, 0.2917]}, {"w": "structure", "b": [0.2373, 0.272, 0.3255, 0.2917]}, {"w": "of", "b": [0.3318, 0.272, 0.3529, 0.2917]}, {"w": "the", "b": [0.3592, 0.272, 0.39, 0.2917]}, {"w": "data", "b": [0.3963, 0.272, 0.4383, 0.2917]}, {"w": "on", "b": [0.4446, 0.272, 0.4699, 0.2917]}, {"w": "which", "b": [0.4762, 0.272, 0.5378, 0.2917]}, {"w": "the", "b": [0.5441, 0.272, 0.5749, 0.2917]}, {"w": "model", "b": [0.5813, 0.272, 0.6443, 0.2917]}, {"w": "was", "b": [0.6505, 0.272, 0.6898, 0.2917]}, {"w": "trained:", "b": [0.6961, 0.272, 0.7731, 0.2917]}, {"w": "sequences", "b": [0.1294, 0.2925, 0.2317, 0.3122]}, {"w": "that", "b": [0.238, 0.2925, 0.2758, 0.3122]}, {"w": "look", "b": [0.2821, 0.2925, 0.327, 0.3122]}, {"w": "almost", "b": [0.3332, 0.2925, 0.4005, 0.3122]}, {"w": "like", "b": [0.4068, 0.2925, 0.4447, 0.3122]}, {"w": "human-written", "b": [0.451, 0.2925, 0.5995, 0.3122]}, {"w": "sentences.", "b": [0.6058, 0.2925, 0.7088, 0.3122]}, {"w": "In", "b": [0.7151, 0.2925, 0.7361, 0.3122]}, {"w": "the", "b": [0.7424, 0.2925, 0.7732, 0.3122]}, {"w": "example", "b": [0.7795, 0.2925, 0.865, 0.3122]}, {"w": "we", "b": [0.1294, 0.313, 0.1588, 0.3327]}, {"w": "present", "b": [0.1651, 0.313, 0.238, 0.3327]}, {"w": "in", "b": [0.2443, 0.313, 0.2639, 0.3327]}, {"w": "this", "b": [0.2702, 0.313, 0.3067, 0.3327]}, {"w": "section,", "b": [0.313, 0.313, 0.3908, 0.3327]}, {"w": "you’ll", "b": [0.3971, 0.313, 0.4573, 0.3327]}, {"w": "take", "b": [0.4636, 0.313, 0.5057, 0.3327]}, {"w": "a", "b": [0.512, 0.313, 0.5232, 0.3327]}, {"w": "LSTM", "b": [0.5295, 0.313, 0.5967, 0.3327]}, {"w": "layer,", "b": [0.6031, 0.313, 0.6587, 0.3327]}, {"w": "feed", "b": [0.665, 0.313, 0.7084, 0.3327]}, {"w": "it", "b": [0.7147, 0.313, 0.7288, 0.3327]}, {"w": "strings", "b": [0.7351, 0.313, 0.8023, 0.3327]}, {"w": "of", "b": [0.8087, 0.313, 0.8297, 0.3327]}, {"w": "N", "b": [0.836, 0.313, 0.8528, 0.3327]}, {"w": "characters", "b": [0.1294, 0.3335, 0.2317, 0.3532]}, {"w": "extracted", "b": [0.238, 0.3335, 0.3304, 0.3532]}, {"w": "from", "b": [0.3367, 0.3335, 0.3858, 0.3532]}, {"w": "a", "b": [0.3921, 0.3335, 0.4033, 0.3532]}, {"w": "text", "b": [0.4096, 0.3335, 0.4474, 0.3532]}, {"w": "corpus,", "b": [0.4537, 0.3335, 0.5273, 0.3532]}, {"w": "and", "b": [0.5336, 0.3335, 0.57, 0.3532]}, {"w": "train", "b": [0.5763, 0.3335, 0.6226, 0.3532]}, {"w": "it", "b": [0.6289, 0.3335, 0.6429, 0.3532]}, {"w": "to", "b": [0.6492, 0.3335, 0.6688, 0.3532]}, {"w": "predict", "b": [0.6751, 0.3335, 0.7452, 0.3532]}, {"w": "character", "b": [0.7515, 0.3335, 0.8439, 0.3532]}, {"w": "N", "b": [0.8501, 0.3335, 0.8669, 0.3532]}, {"w": "+", "b": [0.1294, 0.354, 0.1436, 0.3737]}, {"w": "1.", "b": [0.1499, 0.354, 0.1689, 0.3737]}, {"w": "The", "b": [0.1752, 0.354, 0.2144, 0.3737]}, {"w": "output", "b": [0.2207, 0.354, 0.2852, 0.3737]}, {"w": "of", "b": [0.2915, 0.354, 0.3125, 0.3737]}, {"w": "the", "b": [0.3188, 0.354, 0.3496, 0.3737]}, {"w": "model", "b": [0.3559, 0.354, 0.419, 0.3737]}, {"w": "will", "b": [0.4253, 0.354, 0.4646, 0.3737]}, {"w": "be", "b": [0.4709, 0.354, 0.4947, 0.3737]}, {"w": "a", "b": [0.501, 0.354, 0.5122, 0.3737]}, {"w": "softmax", "b": [0.5185, 0.354, 0.5998, 0.3737]}, {"w": "over", "b": [0.6061, 0.354, 0.6509, 0.3737]}, {"w": "all", "b": [0.6572, 0.354, 0.6824, 0.3737]}, {"w": "possible", "b": [0.6887, 0.354, 0.7714, 0.3737]}, {"w": "characters:", "b": [0.1294, 0.3745, 0.2387, 0.3942]}, {"w": "a", "b": [0.245, 0.3745, 0.2562, 0.3942]}, {"w": "probability", "b": [0.2625, 0.3745, 0.3732, 0.3942]}, {"w": "distribution", "b": [0.3795, 0.3745, 0.4958, 0.3942]}, {"w": "for", "b": [0.5021, 0.3745, 0.5316, 0.3942]}, {"w": "the", "b": [0.5379, 0.3745, 0.5687, 0.3942]}, {"w": "next", "b": [0.575, 0.3745, 0.6184, 0.3942]}, {"w": "character.", "b": [0.6247, 0.3745, 0.722, 0.3942]}, {"w": "This", "b": [0.7283, 0.3745, 0.7731, 0.3942]}, {"w": "LSTM", "b": [0.7794, 0.3745, 0.8467, 0.3942]}, {"w": "is", "b": [0.853, 0.3745, 0.8699, 0.3942]}, {"w": "called", "b": [0.1294, 0.395, 0.1897, 0.4147]}, {"w": "a", "b": [0.196, 0.395, 0.2072, 0.4147]}, {"w": "character-level", "b": [0.2134, 0.395, 0.367, 0.4147]}, {"w": "neural", "b": [0.3733, 0.395, 0.4392, 0.4147]}, {"w": "language", "b": [0.4455, 0.395, 0.5394, 0.4147]}, {"w": "model.", "b": [0.5457, 0.395, 0.6136, 0.4147]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 8.1. The process of character-by-character text generation using a language model", "words": [{"w": "Figure", "b": [0.1294, 0.4328, 0.1827, 0.4476]}, {"w": "8.1.", "b": [0.1874, 0.4328, 0.2158, 0.4476]}, {"w": "The", "b": [0.2205, 0.4328, 0.252, 0.4476]}, {"w": "process", "b": [0.2567, 0.4328, 0.3163, 0.4476]}, {"w": "of", "b": [0.321, 0.4328, 0.3368, 0.4476]}, {"w": "character-by-character", "b": [0.3415, 0.4328, 0.5289, 0.4476]}, {"w": "text", "b": [0.5336, 0.4328, 0.5641, 0.4476]}, {"w": "generation", "b": [0.5688, 0.4328, 0.655, 0.4476]}, {"w": "using", "b": [0.6597, 0.4328, 0.7028, 0.4476]}, {"w": "a", "b": [0.7075, 0.4328, 0.717, 0.4476]}, {"w": "language", "b": [0.7217, 0.4328, 0.7943, 0.4476]}, {"w": "model", "b": [0.799, 0.4328, 0.8484, 0.4476]}]}, {"id": "b_3", "type": "paragraph", "text": "8.1.3. The importance of the sampling strategy", "words": [{"w": "8.1.3.", "b": [0.1294, 0.6632, 0.1862, 0.683]}, {"w": "The", "b": [0.1925, 0.6632, 0.2345, 0.683]}, {"w": "importance", "b": [0.2408, 0.6632, 0.3641, 0.683]}, {"w": "of", "b": [0.3704, 0.6632, 0.3915, 0.683]}, {"w": "the", "b": [0.3978, 0.6632, 0.4314, 0.683]}, {"w": "sampling", "b": [0.4377, 0.6632, 0.5358, 0.683]}, {"w": "strategy", "b": [0.5421, 0.6632, 0.629, 0.683]}]}, {"id": "b_4", "type": "paragraph", "text": "When generating text, the way you choose the next character is crucially important. A naive approach is greedy sampling, consisting of always choosing the most likely next character. But such an approach results in repetitive, predictable strings that don’t look like coherent language. A more interesting approach makes slightly more surprising choices: it introduces randomness in the sampling process, by sampling from the probability distribution for the next character. This is called stochastic sampling (recall that stochasticity is what we call randomness in this field). In such a setup, if e has a probability 0.3 of being the next character, according to the model, you’ll choose it 30% of the time. Note", "words": [{"w": "When", "b": [0.1294, 0.706, 0.1897, 0.7258]}, {"w": "generating", "b": [0.196, 0.706, 0.3024, 0.7258]}, {"w": "text,", "b": [0.3087, 0.706, 0.3529, 0.7258]}, {"w": "the", "b": [0.3592, 0.706, 0.39, 0.7258]}, {"w": "way", "b": [0.3963, 0.706, 0.4384, 0.7258]}, {"w": "you", "b": [0.4447, 0.706, 0.4825, 0.7258]}, {"w": "choose", "b": [0.4888, 0.706, 0.5589, 0.7258]}, {"w": "the", "b": [0.5652, 0.706, 0.596, 0.7258]}, {"w": "next", "b": [0.6023, 0.706, 0.6457, 0.7258]}, {"w": "character", "b": [0.652, 0.706, 0.7445, 0.7258]}, {"w": "is", "b": [0.7508, 0.706, 0.7676, 0.7258]}, {"w": "crucially", "b": [0.7739, 0.706, 0.8622, 0.7258]}, {"w": "important.", "b": [0.1294, 0.7265, 0.2338, 0.7463]}, {"w": "A", "b": [0.2401, 0.7265, 0.2583, 0.7463]}, {"w": "naive", "b": [0.2646, 0.7265, 0.3193, 0.7463]}, {"w": "approach", "b": [0.3256, 0.7265, 0.418, 0.7463]}, {"w": "is", "b": [0.4244, 0.7265, 0.4412, 0.7463]}, {"w": "greedy", "b": [0.4474, 0.7265, 0.5151, 0.7463]}, {"w": "sampling,", "b": [0.5214, 0.7265, 0.6202, 0.7463]}, {"w": "consisting", "b": [0.6265, 0.7265, 0.7289, 0.7463]}, {"w": "of", "b": [0.7352, 0.7265, 0.7562, 0.7463]}, {"w": "always", "b": [0.7625, 0.7265, 0.8325, 0.7463]}, {"w": "choosing", "b": [0.1294, 0.747, 0.2205, 0.7668]}, {"w": "the", "b": [0.2268, 0.747, 0.2576, 0.7668]}, {"w": "most", "b": [0.2639, 0.747, 0.313, 0.7668]}, {"w": "likely", "b": [0.3193, 0.747, 0.3768, 0.7668]}, {"w": "next", "b": [0.3831, 0.747, 0.4265, 0.7668]}, {"w": "character.", "b": [0.4328, 0.747, 0.5301, 0.7668]}, {"w": "But", "b": [0.5364, 0.747, 0.5729, 0.7668]}, {"w": "such", "b": [0.5792, 0.747, 0.6254, 0.7668]}, {"w": "an", "b": [0.6317, 0.747, 0.6555, 0.7668]}, {"w": "approach", "b": [0.6618, 0.747, 0.7543, 0.7668]}, {"w": "results", "b": [0.7606, 0.747, 0.8265, 0.7668]}, {"w": "in", "b": [0.8328, 0.747, 0.8524, 0.7668]}, {"w": "repetitive,", "b": [0.1294, 0.7675, 0.231, 0.7873]}, {"w": "predictable", "b": [0.2373, 0.7675, 0.3494, 0.7873]}, {"w": "strings", "b": [0.3557, 0.7675, 0.423, 0.7873]}, {"w": "that", "b": [0.4292, 0.7675, 0.467, 0.7873]}, {"w": "don’t", "b": [0.4733, 0.7675, 0.5261, 0.7873]}, {"w": "look", "b": [0.5324, 0.7675, 0.5773, 0.7873]}, {"w": "like", "b": [0.5836, 0.7675, 0.6214, 0.7873]}, {"w": "coherent", "b": [0.6277, 0.7675, 0.7146, 0.7873]}, {"w": "language.", "b": [0.7209, 0.7675, 0.8183, 0.7873]}, {"w": "A", "b": [0.8246, 0.7675, 0.8428, 0.7873]}, {"w": "more", "b": [0.1294, 0.788, 0.1813, 0.8078]}, {"w": "interesting", "b": [0.1876, 0.788, 0.2941, 0.8078]}, {"w": "approach", "b": [0.3004, 0.788, 0.3928, 0.8078]}, {"w": "makes", "b": [0.3991, 0.788, 0.4636, 0.8078]}, {"w": "slightly", "b": [0.4699, 0.788, 0.5456, 0.8078]}, {"w": "more", "b": [0.5519, 0.788, 0.6037, 0.8078]}, {"w": "surprising", "b": [0.61, 0.788, 0.7109, 0.8078]}, {"w": "choices:", "b": [0.7172, 0.788, 0.7999, 0.8078]}, {"w": "it", "b": [0.8062, 0.788, 0.8202, 0.8078]}, {"w": "introduces", "b": [0.1294, 0.8085, 0.2345, 0.8283]}, {"w": "randomness", "b": [0.2408, 0.8085, 0.3613, 0.8283]}, {"w": "in", "b": [0.3676, 0.8085, 0.3872, 0.8283]}, {"w": "the", "b": [0.3935, 0.8085, 0.4243, 0.8283]}, {"w": "sampling", "b": [0.4307, 0.8085, 0.5232, 0.8283]}, {"w": "process,", "b": [0.5295, 0.8085, 0.6114, 0.8283]}, {"w": "by", "b": [0.6177, 0.8085, 0.643, 0.8283]}, {"w": "sampling", "b": [0.6493, 0.8085, 0.7418, 0.8283]}, {"w": "from", "b": [0.7481, 0.8085, 0.7971, 0.8283]}, {"w": "the", "b": [0.8034, 0.8085, 0.8342, 0.8283]}, {"w": "probability", "b": [0.1294, 0.829, 0.2401, 0.8488]}, {"w": "distribution", "b": [0.2464, 0.829, 0.3628, 0.8488]}, {"w": "for", "b": [0.3691, 0.829, 0.3985, 0.8488]}, {"w": "the", "b": [0.4048, 0.829, 0.4356, 0.8488]}, {"w": "next", "b": [0.4419, 0.829, 0.4854, 0.8488]}, {"w": "character.", "b": [0.4917, 0.829, 0.5889, 0.8488]}, {"w": "This", "b": [0.5953, 0.829, 0.6401, 0.8488]}, {"w": "is", "b": [0.6464, 0.829, 0.6632, 0.8488]}, {"w": "called", "b": [0.6695, 0.829, 0.7298, 0.8488]}, {"w": "stochastic", "b": [0.7361, 0.829, 0.837, 0.8488]}, {"w": "sampling", "b": [0.1294, 0.8495, 0.2219, 0.8693]}, {"w": "(recall", "b": [0.2282, 0.8495, 0.2926, 0.8693]}, {"w": "that", "b": [0.2989, 0.8495, 0.3368, 0.8693]}, {"w": "stochasticity", "b": [0.343, 0.8495, 0.4692, 0.8693]}, {"w": "is", "b": [0.4754, 0.8495, 0.4923, 0.8693]}, {"w": "what", "b": [0.4986, 0.8495, 0.5476, 0.8693]}, {"w": "we", "b": [0.5539, 0.8495, 0.5833, 0.8693]}, {"w": "call", "b": [0.5896, 0.8495, 0.6261, 0.8693]}, {"w": "randomness", "b": [0.6323, 0.8495, 0.7542, 0.8693]}, {"w": "in", "b": [0.7605, 0.8495, 0.7802, 0.8693]}, {"w": "this", "b": [0.7865, 0.8495, 0.8229, 0.8693]}, {"w": "field).", "b": [0.1294, 0.87, 0.1904, 0.8898]}, {"w": "In", "b": [0.1967, 0.87, 0.2177, 0.8898]}, {"w": "such", "b": [0.224, 0.87, 0.2702, 0.8898]}, {"w": "a", "b": [0.2765, 0.87, 0.2877, 0.8898]}, {"w": "setup,", "b": [0.294, 0.87, 0.3536, 0.8898]}, {"w": "if", "b": [0.3599, 0.87, 0.3753, 0.8898]}, {"w": "e", "b": [0.3816, 0.87, 0.3928, 0.8898]}, {"w": "has", "b": [0.3991, 0.87, 0.4327, 0.8898]}, {"w": "a", "b": [0.439, 0.87, 0.4502, 0.8898]}, {"w": "probability", "b": [0.4565, 0.87, 0.5672, 0.8898]}, {"w": "0.3", "b": [0.5736, 0.87, 0.6051, 0.8898]}, {"w": "of", "b": [0.6114, 0.87, 0.6324, 0.8898]}, {"w": "being", "b": [0.6387, 0.87, 0.6948, 0.8898]}, {"w": "the", "b": [0.7011, 0.87, 0.7319, 0.8898]}, {"w": "next", "b": [0.7382, 0.87, 0.7816, 0.8898]}, {"w": "character,", "b": [0.1294, 0.8905, 0.2271, 0.9103]}, {"w": "according", "b": [0.2334, 0.8905, 0.3329, 0.9103]}, {"w": "to", "b": [0.3392, 0.8905, 0.3588, 0.9103]}, {"w": "the", "b": [0.3651, 0.8905, 0.3959, 0.9103]}, {"w": "model,", "b": [0.4023, 0.8905, 0.4716, 0.9103]}, {"w": "you’ll", "b": [0.4779, 0.8905, 0.5382, 0.9103]}, {"w": "choose", "b": [0.5445, 0.8905, 0.6146, 0.9103]}, {"w": "it", "b": [0.6209, 0.8905, 0.6349, 0.9103]}, {"w": "30%", "b": [0.6411, 0.8905, 0.6874, 0.9103]}, {"w": "of", "b": [0.6937, 0.8905, 0.7147, 0.9103]}, {"w": "the", "b": [0.721, 0.8905, 0.7518, 0.9103]}, {"w": "time.", "b": [0.7581, 0.8905, 0.8093, 0.9103]}, {"w": "Note", "b": [0.8156, 0.8905, 0.8646, 0.9103]}]}]}, {"page": 356, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "that greedy sampling can be also cast as sampling from a probability distribution: one where a certain character has probability 1 and all others have probability 0.", "words": [{"w": "that", "b": [0.1294, 0.0857, 0.1673, 0.1054]}, {"w": "greedy", "b": [0.1736, 0.0857, 0.2422, 0.1054]}, {"w": "sampling", "b": [0.2485, 0.0857, 0.341, 0.1054]}, {"w": "can", "b": [0.3473, 0.0857, 0.3823, 0.1054]}, {"w": "be", "b": [0.3886, 0.0857, 0.4124, 0.1054]}, {"w": "also", "b": [0.4188, 0.0857, 0.4594, 0.1054]}, {"w": "cast", "b": [0.4657, 0.0857, 0.5049, 0.1054]}, {"w": "as", "b": [0.5112, 0.0857, 0.5322, 0.1054]}, {"w": "sampling", "b": [0.5385, 0.0857, 0.6311, 0.1054]}, {"w": "from", "b": [0.6374, 0.0857, 0.6864, 0.1054]}, {"w": "a", "b": [0.6927, 0.0857, 0.7039, 0.1054]}, {"w": "probability", "b": [0.7102, 0.0857, 0.8209, 0.1054]}, {"w": "distribution:", "b": [0.1294, 0.1062, 0.2528, 0.1259]}, {"w": "one", "b": [0.2591, 0.1062, 0.2955, 0.1259]}, {"w": "where", "b": [0.3018, 0.1062, 0.3634, 0.1259]}, {"w": "a", "b": [0.3697, 0.1062, 0.3809, 0.1259]}, {"w": "certain", "b": [0.3872, 0.1062, 0.4559, 0.1259]}, {"w": "character", "b": [0.4621, 0.1062, 0.5546, 0.1259]}, {"w": "has", "b": [0.5609, 0.1062, 0.5945, 0.1259]}, {"w": "probability", "b": [0.6008, 0.1062, 0.7115, 0.1259]}, {"w": "1", "b": [0.7178, 0.1062, 0.7304, 0.1259]}, {"w": "and", "b": [0.7367, 0.1062, 0.7732, 0.1259]}, {"w": "all", "b": [0.7795, 0.1062, 0.8047, 0.1259]}, {"w": "others", "b": [0.1294, 0.1267, 0.1911, 0.1464]}, {"w": "have", "b": [0.1974, 0.1267, 0.245, 0.1464]}, {"w": "probability", "b": [0.2513, 0.1267, 0.362, 0.1464]}, {"w": "0.", "b": [0.3683, 0.1267, 0.3872, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "Sampling probabilistically from the softmax output of the model is neat: it allows even unlikely characters to be sampled some of the time, generating more interesting-looking sentences and sometimes showing creativity by coming up with new, realistic-sounding words that didn’t occur in the training data. But there’s one issue with this strategy: it doesn’t offer a way to control the amount of randomness in the sampling process.", "words": [{"w": "Sampling", "b": [0.1294, 0.1695, 0.2261, 0.1892]}, {"w": "probabilistically", "b": [0.2324, 0.1695, 0.3964, 0.1892]}, {"w": "from", "b": [0.4027, 0.1695, 0.4517, 0.1892]}, {"w": "the", "b": [0.4581, 0.1695, 0.4889, 0.1892]}, {"w": "softmax", "b": [0.4952, 0.1695, 0.5765, 0.1892]}, {"w": "output", "b": [0.5828, 0.1695, 0.6472, 0.1892]}, {"w": "of", "b": [0.6536, 0.1695, 0.6746, 0.1892]}, {"w": "the", "b": [0.6809, 0.1695, 0.7117, 0.1892]}, {"w": "model", "b": [0.718, 0.1695, 0.7811, 0.1892]}, {"w": "is", "b": [0.7874, 0.1695, 0.8042, 0.1892]}, {"w": "neat:", "b": [0.8105, 0.1695, 0.8595, 0.1892]}, {"w": "it", "b": [0.1294, 0.19, 0.1434, 0.2097]}, {"w": "allows", "b": [0.1497, 0.19, 0.2156, 0.2097]}, {"w": "even", "b": [0.2219, 0.19, 0.2695, 0.2097]}, {"w": "unlikely", "b": [0.2758, 0.19, 0.3585, 0.2097]}, {"w": "characters", "b": [0.3648, 0.19, 0.4671, 0.2097]}, {"w": "to", "b": [0.4734, 0.19, 0.493, 0.2097]}, {"w": "be", "b": [0.4993, 0.19, 0.5231, 0.2097]}, {"w": "sampled", "b": [0.5294, 0.19, 0.6135, 0.2097]}, {"w": "some", "b": [0.6197, 0.19, 0.673, 0.2097]}, {"w": "of", "b": [0.6793, 0.19, 0.7003, 0.2097]}, {"w": "the", "b": [0.7066, 0.19, 0.7374, 0.2097]}, {"w": "time,", "b": [0.7437, 0.19, 0.7949, 0.2097]}, {"w": "generating", "b": [0.1294, 0.2105, 0.2359, 0.2302]}, {"w": "more", "b": [0.2422, 0.2105, 0.294, 0.2302]}, {"w": "interesting-looking", "b": [0.3003, 0.2105, 0.4923, 0.2302]}, {"w": "sentences", "b": [0.4986, 0.2105, 0.5953, 0.2302]}, {"w": "and", "b": [0.6016, 0.2105, 0.638, 0.2302]}, {"w": "sometimes", "b": [0.6443, 0.2105, 0.7523, 0.2302]}, {"w": "showing", "b": [0.7586, 0.2105, 0.8441, 0.2302]}, {"w": "creativity", "b": [0.1294, 0.231, 0.2247, 0.2507]}, {"w": "by", "b": [0.231, 0.231, 0.2562, 0.2507]}, {"w": "coming", "b": [0.2625, 0.231, 0.3382, 0.2507]}, {"w": "up", "b": [0.3445, 0.231, 0.3697, 0.2507]}, {"w": "with", "b": [0.376, 0.231, 0.4209, 0.2507]}, {"w": "new,", "b": [0.4272, 0.231, 0.4739, 0.2507]}, {"w": "realistic-sounding", "b": [0.4802, 0.231, 0.6609, 0.2507]}, {"w": "words", "b": [0.6672, 0.231, 0.7288, 0.2507]}, {"w": "that", "b": [0.7352, 0.231, 0.773, 0.2507]}, {"w": "didn’t", "b": [0.7793, 0.231, 0.8391, 0.2507]}, {"w": "occur", "b": [0.1294, 0.2515, 0.1854, 0.2712]}, {"w": "in", "b": [0.1917, 0.2515, 0.2114, 0.2712]}, {"w": "the", "b": [0.2177, 0.2515, 0.2485, 0.2712]}, {"w": "training", "b": [0.2548, 0.2515, 0.3333, 0.2712]}, {"w": "data.", "b": [0.3396, 0.2515, 0.3879, 0.2712]}, {"w": "But", "b": [0.3942, 0.2515, 0.4307, 0.2712]}, {"w": "there’s", "b": [0.437, 0.2515, 0.5042, 0.2712]}, {"w": "one", "b": [0.5105, 0.2515, 0.5469, 0.2712]}, {"w": "issue", "b": [0.5532, 0.2515, 0.6037, 0.2712]}, {"w": "with", "b": [0.61, 0.2515, 0.6548, 0.2712]}, {"w": "this", "b": [0.6611, 0.2515, 0.6976, 0.2712]}, {"w": "strategy:", "b": [0.7039, 0.2515, 0.7908, 0.2712]}, {"w": "it", "b": [0.7971, 0.2515, 0.8111, 0.2712]}, {"w": "doesn’t", "b": [0.1294, 0.272, 0.2032, 0.2917]}, {"w": "offer", "b": [0.2095, 0.272, 0.2581, 0.2917]}, {"w": "a", "b": [0.2644, 0.272, 0.2756, 0.2917]}, {"w": "way", "b": [0.2819, 0.272, 0.3239, 0.2917]}, {"w": "to", "b": [0.3302, 0.272, 0.3499, 0.2917]}, {"w": "control", "b": [0.3561, 0.272, 0.4281, 0.2917]}, {"w": "the", "b": [0.4344, 0.272, 0.4652, 0.2917]}, {"w": "amount", "b": [0.4715, 0.272, 0.5472, 0.2917]}, {"w": "of", "b": [0.5535, 0.272, 0.5731, 0.2917]}, {"w": "randomness", "b": [0.5794, 0.272, 0.7014, 0.2917]}, {"w": "in", "b": [0.7077, 0.272, 0.7273, 0.2917]}, {"w": "the", "b": [0.7336, 0.272, 0.7644, 0.2917]}, {"w": "sampling", "b": [0.7707, 0.272, 0.8632, 0.2917]}, {"w": "process.", "b": [0.1294, 0.2925, 0.2114, 0.3122]}]}, {"id": "b_2", "type": "paragraph", "text": "Why would you want more or less randomness? Consider an extreme case: pure random sampling, where you draw the next character from a uniform probability distribution, and every character is equally likely. This scheme has maximum randomness; in other words, this probability distribution has maximum entropy. Naturally, it won’t produce anything interesting. At the other extreme, greedy sampling doesn’t produce anything interesting, either, and has no randomness: the corresponding probability distribution has minimum entropy. Sampling from the “real” probability distribution—the distribution that is output by the model’s softmax function—constitutes an intermediate point between these two extremes. But there are many other intermediate points of higher or lower entropy that you may want to explore. Less entropy will give the generated sequences a more predictable structure (and thus they will potentially be more realistic looking), whereas more entropy will result in more surprising and creative sequences. When sampling from generative models, it’s always good to explore different amounts of randomness in the generation process. Because we—humans—are the ultimate judges of how interesting the generated data is, interestingness is highly subjective, and there’s no telling in advance where the point of optimal entropy lies.", "words": [{"w": "Why", "b": [0.1294, 0.3352, 0.1785, 0.355]}, {"w": "would", "b": [0.1848, 0.3352, 0.2478, 0.355]}, {"w": "you", "b": [0.2541, 0.3352, 0.292, 0.355]}, {"w": "want", "b": [0.2983, 0.3352, 0.3473, 0.355]}, {"w": "more", "b": [0.3536, 0.3352, 0.4055, 0.355]}, {"w": "or", "b": [0.4118, 0.3352, 0.4328, 0.355]}, {"w": "less", "b": [0.4391, 0.3352, 0.4769, 0.355]}, {"w": "randomness?", "b": [0.4832, 0.3352, 0.6149, 0.355]}, {"w": "Consider", "b": [0.6212, 0.3352, 0.7123, 0.355]}, {"w": "an", "b": [0.7186, 0.3352, 0.7424, 0.355]}, {"w": "extreme", "b": [0.7488, 0.3352, 0.83, 0.355]}, {"w": "case:", "b": [0.1294, 0.3557, 0.1798, 0.3755]}, {"w": "pure", "b": [0.1861, 0.3557, 0.231, 0.3755]}, {"w": "random", "b": [0.2373, 0.3557, 0.3143, 0.3755]}, {"w": "sampling,", "b": [0.3206, 0.3557, 0.4195, 0.3755]}, {"w": "where", "b": [0.4258, 0.3557, 0.4874, 0.3755]}, {"w": "you", "b": [0.4937, 0.3557, 0.5315, 0.3755]}, {"w": "draw", "b": [0.5378, 0.3557, 0.5883, 0.3755]}, {"w": "the", "b": [0.5946, 0.3557, 0.6254, 0.3755]}, {"w": "next", "b": [0.6317, 0.3557, 0.6751, 0.3755]}, {"w": "character", "b": [0.6815, 0.3557, 0.7739, 0.3755]}, {"w": "from", "b": [0.7801, 0.3557, 0.8291, 0.3755]}, {"w": "a", "b": [0.8354, 0.3557, 0.8466, 0.3755]}, {"w": "uniform", "b": [0.1294, 0.3762, 0.2107, 0.396]}, {"w": "probability", "b": [0.217, 0.3762, 0.3277, 0.396]}, {"w": "distribution,", "b": [0.334, 0.3762, 0.4567, 0.396]}, {"w": "and", "b": [0.463, 0.3762, 0.4994, 0.396]}, {"w": "every", "b": [0.5057, 0.3762, 0.5617, 0.396]}, {"w": "character", "b": [0.568, 0.3762, 0.6605, 0.396]}, {"w": "is", "b": [0.6668, 0.3762, 0.6836, 0.396]}, {"w": "equally", "b": [0.6899, 0.3762, 0.7642, 0.396]}, {"w": "likely.", "b": [0.7705, 0.3762, 0.8325, 0.396]}, {"w": "This", "b": [0.1294, 0.3967, 0.1743, 0.4165]}, {"w": "scheme", "b": [0.1806, 0.3967, 0.2562, 0.4165]}, {"w": "has", "b": [0.2625, 0.3967, 0.2962, 0.4165]}, {"w": "maximum", "b": [0.3025, 0.3967, 0.4048, 0.4165]}, {"w": "randomness;", "b": [0.4111, 0.3967, 0.5386, 0.4165]}, {"w": "in", "b": [0.5449, 0.3967, 0.5645, 0.4165]}, {"w": "other", "b": [0.5708, 0.3967, 0.6227, 0.4165]}, {"w": "words,", "b": [0.6289, 0.3967, 0.6969, 0.4165]}, {"w": "this", "b": [0.7032, 0.3967, 0.7396, 0.4165]}, {"w": "probability", "b": [0.7459, 0.3967, 0.8567, 0.4165]}, {"w": "distribution", "b": [0.1294, 0.4172, 0.2458, 0.437]}, {"w": "has", "b": [0.2521, 0.4172, 0.2857, 0.437]}, {"w": "maximum", "b": [0.292, 0.4172, 0.3943, 0.437]}, {"w": "entropy.", "b": [0.4006, 0.4172, 0.4823, 0.437]}, {"w": "Naturally,", "b": [0.4886, 0.4172, 0.5885, 0.437]}, {"w": "it", "b": [0.5948, 0.4172, 0.6089, 0.437]}, {"w": "won’t", "b": [0.6152, 0.4172, 0.6736, 0.437]}, {"w": "produce", "b": [0.6799, 0.4172, 0.7611, 0.437]}, {"w": "anything", "b": [0.7674, 0.4172, 0.8557, 0.437]}, {"w": "interesting.", "b": [0.1294, 0.4377, 0.2422, 0.4575]}, {"w": "At", "b": [0.2485, 0.4377, 0.2738, 0.4575]}, {"w": "the", "b": [0.2801, 0.4377, 0.3109, 0.4575]}, {"w": "other", "b": [0.3172, 0.4377, 0.369, 0.4575]}, {"w": "extreme,", "b": [0.3753, 0.4377, 0.4629, 0.4575]}, {"w": "greedy", "b": [0.4691, 0.4377, 0.5378, 0.4575]}, {"w": "sampling", "b": [0.5441, 0.4377, 0.6366, 0.4575]}, {"w": "doesn’t", "b": [0.6429, 0.4377, 0.7167, 0.4575]}, {"w": "produce", "b": [0.723, 0.4377, 0.8042, 0.4575]}, {"w": "anything", "b": [0.1294, 0.4582, 0.2177, 0.478]}, {"w": "interesting,", "b": [0.224, 0.4582, 0.3368, 0.478]}, {"w": "either,", "b": [0.3431, 0.4582, 0.4058, 0.478]}, {"w": "and", "b": [0.4121, 0.4582, 0.4485, 0.478]}, {"w": "has", "b": [0.4549, 0.4582, 0.4885, 0.478]}, {"w": "no", "b": [0.4948, 0.4582, 0.52, 0.478]}, {"w": "randomness:", "b": [0.5263, 0.4582, 0.6538, 0.478]}, {"w": "the", "b": [0.6601, 0.4582, 0.691, 0.478]}, {"w": "corresponding", "b": [0.6973, 0.4582, 0.8416, 0.478]}, {"w": "probability", "b": [0.1294, 0.4787, 0.2401, 0.4985]}, {"w": "distribution", "b": [0.2464, 0.4787, 0.3628, 0.4985]}, {"w": "has", "b": [0.369, 0.4787, 0.4027, 0.4985]}, {"w": "minimum", "b": [0.409, 0.4787, 0.5071, 0.4985]}, {"w": "entropy.", "b": [0.5134, 0.4787, 0.5951, 0.4985]}, {"w": "Sampling", "b": [0.6014, 0.4787, 0.6981, 0.4985]}, {"w": "from", "b": [0.7044, 0.4787, 0.7535, 0.4985]}, {"w": "the", "b": [0.7598, 0.4787, 0.7906, 0.4985]}, {"w": "“real”", "b": [0.7969, 0.4787, 0.8571, 0.4985]}, {"w": "probability", "b": [0.1294, 0.4992, 0.2401, 0.519]}, {"w": "distribution—the", "b": [0.2464, 0.4992, 0.4188, 0.519]}, {"w": "distribution", "b": [0.4251, 0.4992, 0.5415, 0.519]}, {"w": "that", "b": [0.5478, 0.4992, 0.5856, 0.519]}, {"w": "is", "b": [0.5919, 0.4992, 0.6088, 0.519]}, {"w": "output", "b": [0.6151, 0.4992, 0.6795, 0.519]}, {"w": "by", "b": [0.6858, 0.4992, 0.7111, 0.519]}, {"w": "the", "b": [0.7174, 0.4992, 0.7482, 0.519]}, {"w": "model’s", "b": [0.7545, 0.4992, 0.8343, 0.519]}, {"w": "softmax", "b": [0.1294, 0.5197, 0.2107, 0.5395]}, {"w": "function—constitutes", "b": [0.217, 0.5197, 0.4342, 0.5395]}, {"w": "an", "b": [0.4405, 0.5197, 0.4643, 0.5395]}, {"w": "intermediate", "b": [0.4706, 0.5197, 0.5967, 0.5395]}, {"w": "point", "b": [0.603, 0.5197, 0.6549, 0.5395]}, {"w": "between", "b": [0.6612, 0.5197, 0.7453, 0.5395]}, {"w": "these", "b": [0.7516, 0.5197, 0.8034, 0.5395]}, {"w": "two", "b": [0.8097, 0.5197, 0.8475, 0.5395]}, {"w": "extremes.", "b": [0.1294, 0.5402, 0.2268, 0.56]}, {"w": "But", "b": [0.2331, 0.5402, 0.2695, 0.56]}, {"w": "there", "b": [0.2758, 0.5402, 0.3263, 0.56]}, {"w": "are", "b": [0.3326, 0.5402, 0.3634, 0.56]}, {"w": "many", "b": [0.3697, 0.5402, 0.4257, 0.56]}, {"w": "other", "b": [0.432, 0.5402, 0.4839, 0.56]}, {"w": "intermediate", "b": [0.4902, 0.5402, 0.6163, 0.56]}, {"w": "points", "b": [0.6226, 0.5402, 0.6843, 0.56]}, {"w": "of", "b": [0.6906, 0.5402, 0.7116, 0.56]}, {"w": "higher", "b": [0.7179, 0.5402, 0.7824, 0.56]}, {"w": "or", "b": [0.7886, 0.5402, 0.8096, 0.56]}, {"w": "lower", "b": [0.1294, 0.5607, 0.1869, 0.5805]}, {"w": "entropy", "b": [0.1932, 0.5607, 0.2702, 0.5805]}, {"w": "that", "b": [0.2765, 0.5607, 0.3144, 0.5805]}, {"w": "you", "b": [0.3207, 0.5607, 0.3585, 0.5805]}, {"w": "may", "b": [0.3648, 0.5607, 0.4083, 0.5805]}, {"w": "want", "b": [0.4146, 0.5607, 0.4636, 0.5805]}, {"w": "to", "b": [0.4699, 0.5607, 0.4895, 0.5805]}, {"w": "explore.", "b": [0.4958, 0.5607, 0.5778, 0.5805]}, {"w": "Less", "b": [0.5841, 0.5607, 0.6303, 0.5805]}, {"w": "entropy", "b": [0.6367, 0.5607, 0.7137, 0.5805]}, {"w": "will", "b": [0.72, 0.5607, 0.7593, 0.5805]}, {"w": "give", "b": [0.7656, 0.5607, 0.809, 0.5805]}, {"w": "the", "b": [0.8153, 0.5607, 0.8462, 0.5805]}, {"w": "generated", "b": [0.1294, 0.5812, 0.2275, 0.601]}, {"w": "sequences", "b": [0.2338, 0.5812, 0.336, 0.601]}, {"w": "a", "b": [0.3423, 0.5812, 0.3535, 0.601]}, {"w": "more", "b": [0.3598, 0.5812, 0.4117, 0.601]}, {"w": "predictable", "b": [0.418, 0.5812, 0.5301, 0.601]}, {"w": "structure", "b": [0.5364, 0.5812, 0.6246, 0.601]}, {"w": "(and", "b": [0.6309, 0.5812, 0.6757, 0.601]}, {"w": "thus", "b": [0.682, 0.5812, 0.7241, 0.601]}, {"w": "they", "b": [0.7304, 0.5812, 0.7738, 0.601]}, {"w": "will", "b": [0.7801, 0.5812, 0.8194, 0.601]}, {"w": "potentially", "b": [0.1294, 0.6017, 0.2373, 0.6215]}, {"w": "be", "b": [0.2436, 0.6017, 0.2674, 0.6215]}, {"w": "more", "b": [0.2738, 0.6017, 0.3256, 0.6215]}, {"w": "realistic", "b": [0.3319, 0.6017, 0.4118, 0.6215]}, {"w": "looking),", "b": [0.4181, 0.6017, 0.5099, 0.6215]}, {"w": "whereas", "b": [0.5162, 0.6017, 0.5988, 0.6215]}, {"w": "more", "b": [0.6051, 0.6017, 0.657, 0.6215]}, {"w": "entropy", "b": [0.6633, 0.6017, 0.7403, 0.6215]}, {"w": "will", "b": [0.7466, 0.6017, 0.7859, 0.6215]}, {"w": "result", "b": [0.7922, 0.6017, 0.8482, 0.6215]}, {"w": "in", "b": [0.1294, 0.6222, 0.149, 0.642]}, {"w": "more", "b": [0.1553, 0.6222, 0.2072, 0.642]}, {"w": "surprising", "b": [0.2135, 0.6222, 0.3144, 0.642]}, {"w": "and", "b": [0.3207, 0.6222, 0.3571, 0.642]}, {"w": "creative", "b": [0.3634, 0.6222, 0.4433, 0.642]}, {"w": "sequences.", "b": [0.4495, 0.6222, 0.5581, 0.642]}, {"w": "When", "b": [0.5644, 0.6222, 0.6246, 0.642]}, {"w": "sampling", "b": [0.6309, 0.6222, 0.7234, 0.642]}, {"w": "from", "b": [0.7298, 0.6222, 0.7788, 0.642]}, {"w": "generative", "b": [0.1294, 0.6427, 0.2345, 0.6625]}, {"w": "models,", "b": [0.2408, 0.6427, 0.32, 0.6625]}, {"w": "it’s", "b": [0.3263, 0.6427, 0.3571, 0.6625]}, {"w": "always", "b": [0.3634, 0.6427, 0.4334, 0.6625]}, {"w": "good", "b": [0.4397, 0.6427, 0.4902, 0.6625]}, {"w": "to", "b": [0.4965, 0.6427, 0.5161, 0.6625]}, {"w": "explore", "b": [0.5224, 0.6427, 0.5981, 0.6625]}, {"w": "different", "b": [0.6044, 0.6427, 0.6908, 0.6625]}, {"w": "amounts", "b": [0.6971, 0.6427, 0.7826, 0.6625]}, {"w": "of", "b": [0.7889, 0.6427, 0.8099, 0.6625]}, {"w": "randomness", "b": [0.1294, 0.6632, 0.2499, 0.683]}, {"w": "in", "b": [0.2562, 0.6632, 0.2758, 0.683]}, {"w": "the", "b": [0.2822, 0.6632, 0.313, 0.683]}, {"w": "generation", "b": [0.3193, 0.6632, 0.4258, 0.683]}, {"w": "process.", "b": [0.432, 0.6632, 0.514, 0.683]}, {"w": "Because", "b": [0.5203, 0.6632, 0.6043, 0.683]}, {"w": "we—humans—are", "b": [0.6106, 0.6632, 0.7998, 0.683]}, {"w": "the", "b": [0.8061, 0.6632, 0.8369, 0.683]}, {"w": "ultimate", "b": [0.1294, 0.6837, 0.2121, 0.7035]}, {"w": "judges", "b": [0.2184, 0.6837, 0.2843, 0.7035]}, {"w": "of", "b": [0.2906, 0.6837, 0.3116, 0.7035]}, {"w": "how", "b": [0.3179, 0.6837, 0.3613, 0.7035]}, {"w": "interesting", "b": [0.3676, 0.6837, 0.4741, 0.7035]}, {"w": "the", "b": [0.4805, 0.6837, 0.5113, 0.7035]}, {"w": "generated", "b": [0.5176, 0.6837, 0.6156, 0.7035]}, {"w": "data", "b": [0.6219, 0.6837, 0.664, 0.7035]}, {"w": "is,", "b": [0.6703, 0.6837, 0.6934, 0.7035]}, {"w": "interestingness", "b": [0.6997, 0.6837, 0.8497, 0.7035]}, {"w": "is", "b": [0.1294, 0.7042, 0.1462, 0.724]}, {"w": "highly", "b": [0.1525, 0.7042, 0.217, 0.724]}, {"w": "subjective,", "b": [0.2233, 0.7042, 0.3319, 0.724]}, {"w": "and", "b": [0.3382, 0.7042, 0.3746, 0.724]}, {"w": "there’s", "b": [0.3809, 0.7042, 0.4482, 0.724]}, {"w": "no", "b": [0.4545, 0.7042, 0.4797, 0.724]}, {"w": "telling", "b": [0.486, 0.7042, 0.5505, 0.724]}, {"w": "in", "b": [0.5568, 0.7042, 0.5764, 0.724]}, {"w": "advance", "b": [0.5827, 0.7042, 0.6654, 0.724]}, {"w": "where", "b": [0.6717, 0.7042, 0.7333, 0.724]}, {"w": "the", "b": [0.7396, 0.7042, 0.7704, 0.724]}, {"w": "point", "b": [0.7767, 0.7042, 0.8286, 0.724]}, {"w": "of", "b": [0.8349, 0.7042, 0.8559, 0.724]}, {"w": "optimal", "b": [0.1294, 0.7247, 0.2065, 0.7445]}, {"w": "entropy", "b": [0.2128, 0.7247, 0.2899, 0.7445]}, {"w": "lies.", "b": [0.2962, 0.7247, 0.3375, 0.7445]}]}, {"id": "b_3", "type": "paragraph", "text": "In order to control the amount of stochasticity in the sampling process, we’ll introduce a parameter called the softmax temperature that characterizes the entropy of the probability distribution used for sampling: it characterizes how surprising or predictable the choice of the next character will be. Given a temperature value, a new probability distribution is computed from the original one (the softmax output of the model) by reweighting it in the following way.", "words": [{"w": "In", "b": [0.1294, 0.7675, 0.1504, 0.7873]}, {"w": "order", "b": [0.1567, 0.7675, 0.21, 0.7873]}, {"w": "to", "b": [0.2163, 0.7675, 0.2359, 0.7873]}, {"w": "control", "b": [0.2422, 0.7675, 0.3137, 0.7873]}, {"w": "the", "b": [0.32, 0.7675, 0.3508, 0.7873]}, {"w": "amount", "b": [0.3571, 0.7675, 0.4328, 0.7873]}, {"w": "of", "b": [0.4391, 0.7675, 0.4601, 0.7873]}, {"w": "stochasticity", "b": [0.4664, 0.7675, 0.5925, 0.7873]}, {"w": "in", "b": [0.5988, 0.7675, 0.6185, 0.7873]}, {"w": "the", "b": [0.6248, 0.7675, 0.6556, 0.7873]}, {"w": "sampling", "b": [0.6619, 0.7675, 0.7544, 0.7873]}, {"w": "process,", "b": [0.7607, 0.7675, 0.8427, 0.7873]}, {"w": "we’ll", "b": [0.1294, 0.788, 0.1813, 0.8078]}, {"w": "introduce", "b": [0.1876, 0.788, 0.2828, 0.8078]}, {"w": "a", "b": [0.2891, 0.788, 0.3003, 0.8078]}, {"w": "parameter", "b": [0.3066, 0.788, 0.4075, 0.8078]}, {"w": "called", "b": [0.4138, 0.788, 0.474, 0.8078]}, {"w": "the", "b": [0.4804, 0.788, 0.5112, 0.8078]}, {"w": "softmax", "b": [0.5174, 0.788, 0.5959, 0.8078]}, {"w": "temperature", "b": [0.6022, 0.788, 0.7245, 0.8078]}, {"w": "that", "b": [0.7308, 0.788, 0.7687, 0.8078]}, {"w": "characterizes", "b": [0.1294, 0.8085, 0.2611, 0.8283]}, {"w": "the", "b": [0.2674, 0.8085, 0.2982, 0.8283]}, {"w": "entropy", "b": [0.3045, 0.8085, 0.3816, 0.8283]}, {"w": "of", "b": [0.3879, 0.8085, 0.4089, 0.8283]}, {"w": "the", "b": [0.4152, 0.8085, 0.446, 0.8283]}, {"w": "probability", "b": [0.4523, 0.8085, 0.563, 0.8283]}, {"w": "distribution", "b": [0.5693, 0.8085, 0.6857, 0.8283]}, {"w": "used", "b": [0.692, 0.8085, 0.7382, 0.8283]}, {"w": "for", "b": [0.7445, 0.8085, 0.774, 0.8283]}, {"w": "sampling:", "b": [0.1294, 0.829, 0.2289, 0.8488]}, {"w": "it", "b": [0.2352, 0.829, 0.2493, 0.8488]}, {"w": "characterizes", "b": [0.2556, 0.829, 0.3872, 0.8488]}, {"w": "how", "b": [0.3935, 0.829, 0.437, 0.8488]}, {"w": "surprising", "b": [0.4433, 0.829, 0.5442, 0.8488]}, {"w": "or", "b": [0.5505, 0.829, 0.5715, 0.8488]}, {"w": "predictable", "b": [0.5778, 0.829, 0.6899, 0.8488]}, {"w": "the", "b": [0.6961, 0.829, 0.7269, 0.8488]}, {"w": "choice", "b": [0.7332, 0.829, 0.7991, 0.8488]}, {"w": "of", "b": [0.8054, 0.829, 0.8264, 0.8488]}, {"w": "the", "b": [0.8327, 0.829, 0.8635, 0.8488]}, {"w": "next", "b": [0.1294, 0.8495, 0.1729, 0.8693]}, {"w": "character", "b": [0.1792, 0.8495, 0.2716, 0.8693]}, {"w": "will", "b": [0.2779, 0.8495, 0.3171, 0.8693]}, {"w": "be.", "b": [0.3234, 0.8495, 0.3536, 0.8693]}, {"w": "Given", "b": [0.3599, 0.8495, 0.4215, 0.8693]}, {"w": "a", "b": [0.4278, 0.8495, 0.439, 0.8693]}, {"w": "temperature", "b": [0.4453, 0.8506, 0.6118, 0.8708]}, {"w": "value,", "b": [0.6181, 0.8495, 0.679, 0.8693]}, {"w": "a", "b": [0.6854, 0.8495, 0.6966, 0.8693]}, {"w": "new", "b": [0.7029, 0.8495, 0.7449, 0.8693]}, {"w": "probability", "b": [0.7512, 0.8495, 0.8619, 0.8693]}, {"w": "distribution", "b": [0.1294, 0.8709, 0.2458, 0.8907]}, {"w": "is", "b": [0.2521, 0.8709, 0.2689, 0.8907]}, {"w": "computed", "b": [0.2752, 0.8709, 0.3747, 0.8907]}, {"w": "from", "b": [0.381, 0.8709, 0.43, 0.8907]}, {"w": "the", "b": [0.4363, 0.8709, 0.4672, 0.8907]}, {"w": "original", "b": [0.4735, 0.8709, 0.5519, 0.8907]}, {"w": "one", "b": [0.5582, 0.8709, 0.5947, 0.8907]}, {"w": "(the", "b": [0.601, 0.8709, 0.6402, 0.8907]}, {"w": "softmax", "b": [0.6465, 0.8709, 0.7278, 0.8907]}, {"w": "output", "b": [0.7341, 0.8709, 0.7986, 0.8907]}, {"w": "of", "b": [0.8049, 0.8709, 0.8259, 0.8907]}, {"w": "the", "b": [0.8322, 0.8709, 0.863, 0.8907]}, {"w": "model)", "b": [0.1294, 0.8914, 0.2009, 0.9112]}, {"w": "by", "b": [0.2072, 0.8914, 0.2324, 0.9112]}, {"w": "reweighting", "b": [0.2387, 0.8914, 0.3592, 0.9112]}, {"w": "it", "b": [0.3655, 0.8914, 0.3795, 0.9112]}, {"w": "in", "b": [0.3858, 0.8914, 0.4054, 0.9112]}, {"w": "the", "b": [0.4118, 0.8914, 0.4426, 0.9112]}, {"w": "following", "b": [0.4489, 0.8914, 0.547, 0.9112]}, {"w": "way.", "b": [0.5533, 0.8914, 0.6, 0.9112]}]}]}, {"page": 357, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 8.1. Reweighting a probability distribution to a different temperature", "words": [{"w": "Listing", "b": [0.1294, 0.0852, 0.1862, 0.1]}, {"w": "8.1.", "b": [0.1909, 0.0852, 0.2193, 0.1]}, {"w": "Reweighting", "b": [0.224, 0.0852, 0.3249, 0.1]}, {"w": "a", "b": [0.3296, 0.0852, 0.3391, 0.1]}, {"w": "probability", "b": [0.3438, 0.0852, 0.4339, 0.1]}, {"w": "distribution", "b": [0.4386, 0.0852, 0.5343, 0.1]}, {"w": "to", "b": [0.539, 0.0852, 0.5548, 0.1]}, {"w": "a", "b": [0.5595, 0.0852, 0.569, 0.1]}, {"w": "different", "b": [0.5737, 0.0852, 0.6438, 0.1]}, {"w": "temperature", "b": [0.6485, 0.0852, 0.749, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "import numpy as np def reweight_distribution(original_distribution, temperature=0.5): 1 distribution = np.log(original_distribution) / temperature distribution = np.exp(distribution) return distribution / np.sum(distribution) 2", "words": [{"w": "import", "b": [0.1357, 0.1136, 0.2038, 0.1288]}, {"w": "numpy", "b": [0.2152, 0.1136, 0.2719, 0.1288]}, {"w": "as", "b": [0.2833, 0.1136, 0.306, 0.1288]}, {"w": "np", "b": [0.3173, 0.1136, 0.34, 0.1288]}, {"w": "def", "b": [0.1357, 0.1439, 0.1698, 0.1591]}, {"w": "reweight_distribution(original_distribution,", "b": [0.1811, 0.1439, 0.6806, 0.1591]}, {"w": "temperature=0.5):", "b": [0.1357, 0.1591, 0.3287, 0.1742]}, {"w": "1", "b": [0.3741, 0.1591, 0.3855, 0.1742]}, {"w": "distribution", "b": [0.1811, 0.1742, 0.3173, 0.1894]}, {"w": "=", "b": [0.3287, 0.1742, 0.34, 0.1894]}, {"w": "np.log(original_distribution)", "b": [0.3514, 0.1742, 0.6806, 0.1894]}, {"w": "/", "b": [0.6919, 0.1742, 0.7033, 0.1894]}, {"w": "temperature", "b": [0.7146, 0.1742, 0.8395, 0.1894]}, {"w": "distribution", "b": [0.1811, 0.1894, 0.3173, 0.2045]}, {"w": "=", "b": [0.3287, 0.1894, 0.34, 0.2045]}, {"w": "np.exp(distribution)", "b": [0.3514, 0.1894, 0.5784, 0.2045]}, {"w": "return", "b": [0.1811, 0.2045, 0.2492, 0.2197]}, {"w": "distribution", "b": [0.2606, 0.2045, 0.3968, 0.2197]}, {"w": "/", "b": [0.4082, 0.2045, 0.4195, 0.2197]}, {"w": "np.sum(distribution)", "b": [0.4309, 0.2045, 0.6579, 0.2197]}, {"w": "2", "b": [0.1357, 0.2197, 0.1471, 0.2348]}]}, {"id": "b_2", "type": "paragraph", "text": "1 original_distribution is a 1D Numpy array of probability values that must sum to 1. temperature is a factor quantifying the entropy of the output distribution. 2 Returns a reweighted version of the original distribution. The sum of the distribution may no longer be 1, so you divide it by its sum to obtain the new distribution.", "words": [{"w": "1", "b": [0.1799, 0.2532, 0.1925, 0.273]}, {"w": "original_distribution", "b": [0.1988, 0.2532, 0.4231, 0.273]}, {"w": "is", "b": [0.4294, 0.2532, 0.4462, 0.273]}, {"w": "a", "b": [0.4525, 0.2532, 0.4651, 0.273]}, {"w": "1D", "b": [0.4714, 0.2532, 0.5022, 0.273]}, {"w": "Numpy", "b": [0.5086, 0.2532, 0.5884, 0.273]}, {"w": "array", "b": [0.5948, 0.2532, 0.655, 0.273]}, {"w": "of", "b": [0.6613, 0.2532, 0.6823, 0.273]}, {"w": "probability", "b": [0.6886, 0.2532, 0.8087, 0.273]}, {"w": "values", "b": [0.1799, 0.2737, 0.2471, 0.2935]}, {"w": "that", "b": [0.2534, 0.2737, 0.2969, 0.2935]}, {"w": "must", "b": [0.3032, 0.2737, 0.3564, 0.2935]}, {"w": "sum", "b": [0.3628, 0.2737, 0.4076, 0.2935]}, {"w": "to", "b": [0.4139, 0.2737, 0.4349, 0.2935]}, {"w": "1.", "b": [0.4412, 0.2737, 0.4601, 0.2935]}, {"w": "temperature", "b": [0.4665, 0.2737, 0.6005, 0.2935]}, {"w": "is", "b": [0.6068, 0.2737, 0.6236, 0.2935]}, {"w": "a", "b": [0.6299, 0.2737, 0.6425, 0.2935]}, {"w": "factor", "b": [0.6488, 0.2737, 0.7133, 0.2935]}, {"w": "quantifying", "b": [0.7196, 0.2737, 0.8443, 0.2935]}, {"w": "the", "b": [0.1799, 0.2942, 0.2135, 0.314]}, {"w": "entropy", "b": [0.2198, 0.2942, 0.3034, 0.314]}, {"w": "of", "b": [0.3097, 0.2942, 0.3307, 0.314]}, {"w": "the", "b": [0.337, 0.2942, 0.3707, 0.314]}, {"w": "output", "b": [0.377, 0.2942, 0.4485, 0.314]}, {"w": "distribution.", "b": [0.4548, 0.2942, 0.5886, 0.314]}, {"w": "2", "b": [0.1799, 0.3147, 0.1925, 0.3345]}, {"w": "Returns", "b": [0.1988, 0.3147, 0.2857, 0.3345]}, {"w": "a", "b": [0.292, 0.3147, 0.3046, 0.3345]}, {"w": "reweighted", "b": [0.3109, 0.3147, 0.4295, 0.3345]}, {"w": "version", "b": [0.4358, 0.3147, 0.5143, 0.3345]}, {"w": "of", "b": [0.5206, 0.3147, 0.5416, 0.3345]}, {"w": "the", "b": [0.5479, 0.3147, 0.5816, 0.3345]}, {"w": "original", "b": [0.5879, 0.3147, 0.672, 0.3345]}, {"w": "distribution.", "b": [0.6783, 0.3147, 0.8122, 0.3345]}, {"w": "The", "b": [0.8185, 0.3147, 0.8605, 0.3345]}, {"w": "sum", "b": [0.1799, 0.3352, 0.2247, 0.355]}, {"w": "of", "b": [0.231, 0.3352, 0.252, 0.355]}, {"w": "the", "b": [0.2583, 0.3352, 0.292, 0.355]}, {"w": "distribution", "b": [0.2983, 0.3352, 0.4258, 0.355]}, {"w": "may", "b": [0.4321, 0.3352, 0.4784, 0.355]}, {"w": "no", "b": [0.4847, 0.3352, 0.5113, 0.355]}, {"w": "longer", "b": [0.5176, 0.3352, 0.5863, 0.355]}, {"w": "be", "b": [0.5926, 0.3352, 0.6178, 0.355]}, {"w": "1,", "b": [0.6241, 0.3352, 0.6431, 0.355]}, {"w": "so", "b": [0.6494, 0.3352, 0.6718, 0.355]}, {"w": "you", "b": [0.6781, 0.3352, 0.7173, 0.355]}, {"w": "divide", "b": [0.7237, 0.3352, 0.7895, 0.355]}, {"w": "it", "b": [0.7958, 0.3352, 0.8113, 0.355]}, {"w": "by", "b": [0.8176, 0.3352, 0.8442, 0.355]}, {"w": "its", "b": [0.1799, 0.3557, 0.2051, 0.3755]}, {"w": "sum", "b": [0.2114, 0.3557, 0.2562, 0.3755]}, {"w": "to", "b": [0.2626, 0.3557, 0.2836, 0.3755]}, {"w": "obtain", "b": [0.2899, 0.3557, 0.3586, 0.3755]}, {"w": "the", "b": [0.3649, 0.3557, 0.3985, 0.3755]}, {"w": "new", "b": [0.4048, 0.3557, 0.4482, 0.3755]}, {"w": "distribution.", "b": [0.4545, 0.3557, 0.5884, 0.3755]}]}, {"id": "b_3", "type": "paragraph", "text": "Higher temperatures result in sampling distributions of higher entropy that will generate more surprising and unstructured generated data, whereas a lower temperature will result in less randomness and much more predictable generated data (see figure 8.2).", "words": [{"w": "Higher", "b": [0.1294, 0.3985, 0.1995, 0.4183]}, {"w": "temperatures", "b": [0.2058, 0.3985, 0.3361, 0.4183]}, {"w": "result", "b": [0.3424, 0.3985, 0.3984, 0.4183]}, {"w": "in", "b": [0.4047, 0.3985, 0.4244, 0.4183]}, {"w": "sampling", "b": [0.4307, 0.3985, 0.5232, 0.4183]}, {"w": "distributions", "b": [0.5295, 0.3985, 0.6556, 0.4183]}, {"w": "of", "b": [0.6619, 0.3985, 0.6829, 0.4183]}, {"w": "higher", "b": [0.6892, 0.3985, 0.7537, 0.4183]}, {"w": "entropy", "b": [0.76, 0.3985, 0.8371, 0.4183]}, {"w": "that", "b": [0.1294, 0.419, 0.1673, 0.4388]}, {"w": "will", "b": [0.1736, 0.419, 0.2128, 0.4388]}, {"w": "generate", "b": [0.2191, 0.419, 0.3046, 0.4388]}, {"w": "more", "b": [0.3109, 0.419, 0.3627, 0.4388]}, {"w": "surprising", "b": [0.369, 0.419, 0.4699, 0.4388]}, {"w": "and", "b": [0.4762, 0.419, 0.5126, 0.4388]}, {"w": "unstructured", "b": [0.5189, 0.419, 0.6451, 0.4388]}, {"w": "generated", "b": [0.6513, 0.419, 0.7493, 0.4388]}, {"w": "data,", "b": [0.7556, 0.419, 0.804, 0.4388]}, {"w": "whereas", "b": [0.1294, 0.4395, 0.2121, 0.4593]}, {"w": "a", "b": [0.2184, 0.4395, 0.2296, 0.4593]}, {"w": "lower", "b": [0.2359, 0.4395, 0.2933, 0.4593]}, {"w": "temperature", "b": [0.2996, 0.4395, 0.4201, 0.4593]}, {"w": "will", "b": [0.4264, 0.4395, 0.4656, 0.4593]}, {"w": "result", "b": [0.472, 0.4395, 0.528, 0.4593]}, {"w": "in", "b": [0.5343, 0.4395, 0.5539, 0.4593]}, {"w": "less", "b": [0.5602, 0.4395, 0.5981, 0.4593]}, {"w": "randomness", "b": [0.6044, 0.4395, 0.7249, 0.4593]}, {"w": "and", "b": [0.7312, 0.4395, 0.7676, 0.4593]}, {"w": "much", "b": [0.7739, 0.4395, 0.83, 0.4593]}, {"w": "more", "b": [0.1294, 0.46, 0.1813, 0.4798]}, {"w": "predictable", "b": [0.1876, 0.46, 0.2996, 0.4798]}, {"w": "generated", "b": [0.3059, 0.46, 0.404, 0.4798]}, {"w": "data", "b": [0.4103, 0.46, 0.4523, 0.4798]}, {"w": "(see", "b": [0.4586, 0.46, 0.4992, 0.4798]}, {"w": "figure", "b": [0.5055, 0.46, 0.5657, 0.4798]}, {"w": "8.2).", "b": [0.572, 0.46, 0.6182, 0.4798]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 8.2. Different reweightings of one probability distribution. Low temperature = more deterministic, high temperature = more random.", "words": [{"w": "Figure", "b": [0.1294, 0.4979, 0.1827, 0.5127]}, {"w": "8.2.", "b": [0.1874, 0.4979, 0.2158, 0.5127]}, {"w": "Different", "b": [0.2205, 0.4979, 0.2937, 0.5127]}, {"w": "reweightings", "b": [0.2984, 0.4979, 0.4011, 0.5127]}, {"w": "of", "b": [0.4058, 0.4979, 0.4215, 0.5127]}, {"w": "one", "b": [0.4263, 0.4979, 0.4547, 0.5127]}, {"w": "probability", "b": [0.4594, 0.4979, 0.5495, 0.5127]}, {"w": "distribution.", "b": [0.5542, 0.4979, 0.6546, 0.5127]}, {"w": "Low", "b": [0.6593, 0.4979, 0.6951, 0.5127]}, {"w": "temperature", "b": [0.6998, 0.4979, 0.8003, 0.5127]}, {"w": "=", "b": [0.805, 0.4979, 0.8158, 0.5127]}, {"w": "more", "b": [0.8205, 0.4979, 0.8622, 0.5127]}, {"w": "deterministic,", "b": [0.1294, 0.513, 0.2403, 0.5278]}, {"w": "high", "b": [0.245, 0.513, 0.2808, 0.5278]}, {"w": "temperature", "b": [0.2855, 0.513, 0.386, 0.5278]}, {"w": "=", "b": [0.3907, 0.513, 0.4015, 0.5278]}, {"w": "more", "b": [0.4062, 0.513, 0.4479, 0.5278]}, {"w": "random.", "b": [0.4526, 0.513, 0.5215, 0.5278]}]}, {"id": "b_5", "type": "equation", "text": "8.1.4. Implementing character-level LSTM text generation", "words": [{"w": "8.1.4.", "b": [0.1294, 0.8781, 0.1862, 0.8978]}, {"w": "Implementing", "b": [0.1925, 0.8781, 0.3438, 0.8978]}, {"w": "character-level", "b": [0.3501, 0.8781, 0.5103, 0.8978]}, {"w": "LSTM", "b": [0.5166, 0.8781, 0.5881, 0.8978]}, {"w": "text", "b": [0.5944, 0.8781, 0.635, 0.8978]}, {"w": "generation", "b": [0.6413, 0.8781, 0.7562, 0.8978]}]}]}, {"page": 358, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Let’s put these ideas into practice in a Keras implementation. The first thing you need is a lot of text data that you can use to learn a language model. You can use any sufficiently large text file or set of text files— Wikipedia, The Lord of the Rings, and so on. In this example, you’ll use some of the writings of Nietzsche, the late-nineteenth century German philosopher (translated into English). The language model you’ll learn will thus be specifically a model of Nietzsche’s writing style and topics of choice, rather than a more generic model of the English language.", "words": [{"w": "Let’s", "b": [0.1294, 0.0857, 0.1798, 0.1054]}, {"w": "put", "b": [0.1862, 0.0857, 0.2184, 0.1054]}, {"w": "these", "b": [0.2247, 0.0857, 0.2765, 0.1054]}, {"w": "ideas", "b": [0.2828, 0.0857, 0.3347, 0.1054]}, {"w": "into", "b": [0.341, 0.0857, 0.3802, 0.1054]}, {"w": "practice", "b": [0.3865, 0.0857, 0.4664, 0.1054]}, {"w": "in", "b": [0.4727, 0.0857, 0.4923, 0.1054]}, {"w": "a", "b": [0.4986, 0.0857, 0.5098, 0.1054]}, {"w": "Keras", "b": [0.5161, 0.0857, 0.575, 0.1054]}, {"w": "implementation.", "b": [0.5813, 0.0857, 0.7459, 0.1054]}, {"w": "The", "b": [0.7522, 0.0857, 0.7915, 0.1054]}, {"w": "first", "b": [0.7978, 0.0857, 0.8384, 0.1054]}, {"w": "thing", "b": [0.1294, 0.1062, 0.1813, 0.1259]}, {"w": "you", "b": [0.1876, 0.1062, 0.2254, 0.1259]}, {"w": "need", "b": [0.2317, 0.1062, 0.2794, 0.1259]}, {"w": "is", "b": [0.2857, 0.1062, 0.3025, 0.1259]}, {"w": "a", "b": [0.3088, 0.1062, 0.32, 0.1259]}, {"w": "lot", "b": [0.3263, 0.1062, 0.3529, 0.1259]}, {"w": "of", "b": [0.3592, 0.1062, 0.3803, 0.1259]}, {"w": "text", "b": [0.3866, 0.1062, 0.4244, 0.1259]}, {"w": "data", "b": [0.4307, 0.1062, 0.4727, 0.1259]}, {"w": "that", "b": [0.479, 0.1062, 0.5169, 0.1259]}, {"w": "you", "b": [0.5232, 0.1062, 0.561, 0.1259]}, {"w": "can", "b": [0.5673, 0.1062, 0.6023, 0.1259]}, {"w": "use", "b": [0.6086, 0.1062, 0.6422, 0.1259]}, {"w": "to", "b": [0.6485, 0.1062, 0.6681, 0.1259]}, {"w": "learn", "b": [0.6744, 0.1062, 0.7249, 0.1259]}, {"w": "a", "b": [0.7312, 0.1062, 0.7424, 0.1259]}, {"w": "language", "b": [0.7487, 0.1062, 0.8397, 0.1259]}, {"w": "model.", "b": [0.1294, 0.1267, 0.1988, 0.1464]}, {"w": "You", "b": [0.2051, 0.1267, 0.246, 0.1464]}, {"w": "can", "b": [0.2523, 0.1267, 0.2873, 0.1464]}, {"w": "use", "b": [0.2936, 0.1267, 0.3272, 0.1464]}, {"w": "any", "b": [0.3336, 0.1267, 0.37, 0.1464]}, {"w": "sufficiently", "b": [0.3763, 0.1267, 0.4907, 0.1464]}, {"w": "large", "b": [0.497, 0.1267, 0.547, 0.1464]}, {"w": "text", "b": [0.5533, 0.1267, 0.5911, 0.1464]}, {"w": "file", "b": [0.5974, 0.1267, 0.631, 0.1464]}, {"w": "or", "b": [0.6374, 0.1267, 0.6584, 0.1464]}, {"w": "set", "b": [0.6647, 0.1267, 0.6927, 0.1464]}, {"w": "of", "b": [0.699, 0.1267, 0.72, 0.1464]}, {"w": "text", "b": [0.7263, 0.1267, 0.7642, 0.1464]}, {"w": "files—", "b": [0.7705, 0.1267, 0.8391, 0.1464]}, {"w": "Wikipedia,", "b": [0.1294, 0.1472, 0.2398, 0.1669]}, {"w": "The", "b": [0.2461, 0.1472, 0.2839, 0.1669]}, {"w": "Lord", "b": [0.2902, 0.1472, 0.3384, 0.1669]}, {"w": "of", "b": [0.3447, 0.1472, 0.3643, 0.1669]}, {"w": "the", "b": [0.3706, 0.1472, 0.4014, 0.1669]}, {"w": "Rings,", "b": [0.4077, 0.1472, 0.4715, 0.1669]}, {"w": "and", "b": [0.4778, 0.1472, 0.5142, 0.1669]}, {"w": "so", "b": [0.5205, 0.1472, 0.5429, 0.1669]}, {"w": "on.", "b": [0.5492, 0.1472, 0.5808, 0.1669]}, {"w": "In", "b": [0.5871, 0.1472, 0.6081, 0.1669]}, {"w": "this", "b": [0.6144, 0.1472, 0.6509, 0.1669]}, {"w": "example,", "b": [0.6572, 0.1472, 0.7489, 0.1669]}, {"w": "you’ll", "b": [0.7552, 0.1472, 0.8155, 0.1669]}, {"w": "use", "b": [0.8218, 0.1472, 0.8554, 0.1669]}, {"w": "some", "b": [0.1294, 0.1677, 0.1827, 0.1874]}, {"w": "of", "b": [0.189, 0.1677, 0.21, 0.1874]}, {"w": "the", "b": [0.2163, 0.1677, 0.2471, 0.1874]}, {"w": "writings", "b": [0.2534, 0.1677, 0.3361, 0.1874]}, {"w": "of", "b": [0.3424, 0.1677, 0.3634, 0.1874]}, {"w": "Nietzsche,", "b": [0.3697, 0.1677, 0.4755, 0.1874]}, {"w": "the", "b": [0.4818, 0.1677, 0.5126, 0.1874]}, {"w": "late-nineteenth", "b": [0.5189, 0.1677, 0.6689, 0.1874]}, {"w": "century", "b": [0.6752, 0.1677, 0.7508, 0.1874]}, {"w": "German", "b": [0.7571, 0.1677, 0.8384, 0.1874]}, {"w": "philosopher", "b": [0.1294, 0.1882, 0.2485, 0.2079]}, {"w": "(translated", "b": [0.2548, 0.1882, 0.3613, 0.2079]}, {"w": "into", "b": [0.3676, 0.1882, 0.4068, 0.2079]}, {"w": "English).", "b": [0.4132, 0.1882, 0.505, 0.2079]}, {"w": "The", "b": [0.5113, 0.1882, 0.5505, 0.2079]}, {"w": "language", "b": [0.5568, 0.1882, 0.6479, 0.2079]}, {"w": "model", "b": [0.6542, 0.1882, 0.7172, 0.2079]}, {"w": "you’ll", "b": [0.7235, 0.1882, 0.7838, 0.2079]}, {"w": "learn", "b": [0.7901, 0.1882, 0.8405, 0.2079]}, {"w": "will", "b": [0.1294, 0.2087, 0.1687, 0.2284]}, {"w": "thus", "b": [0.175, 0.2087, 0.217, 0.2284]}, {"w": "be", "b": [0.2233, 0.2087, 0.2471, 0.2284]}, {"w": "specifically", "b": [0.2534, 0.2087, 0.3697, 0.2284]}, {"w": "a", "b": [0.376, 0.2087, 0.3872, 0.2284]}, {"w": "model", "b": [0.3936, 0.2087, 0.4566, 0.2284]}, {"w": "of", "b": [0.4629, 0.2087, 0.4839, 0.2284]}, {"w": "Nietzsche’s", "b": [0.4902, 0.2087, 0.6065, 0.2284]}, {"w": "writing", "b": [0.6128, 0.2087, 0.6856, 0.2284]}, {"w": "style", "b": [0.6919, 0.2087, 0.7396, 0.2284]}, {"w": "and", "b": [0.7459, 0.2087, 0.7823, 0.2284]}, {"w": "topics", "b": [0.7886, 0.2087, 0.8489, 0.2284]}, {"w": "of", "b": [0.1294, 0.2292, 0.1504, 0.2489]}, {"w": "choice,", "b": [0.1567, 0.2292, 0.2289, 0.2489]}, {"w": "rather", "b": [0.2352, 0.2292, 0.294, 0.2489]}, {"w": "than", "b": [0.3003, 0.2292, 0.3438, 0.2489]}, {"w": "a", "b": [0.3501, 0.2292, 0.3613, 0.2489]}, {"w": "more", "b": [0.3676, 0.2292, 0.4194, 0.2489]}, {"w": "generic", "b": [0.4257, 0.2292, 0.5, 0.2489]}, {"w": "model", "b": [0.5063, 0.2292, 0.5693, 0.2489]}, {"w": "of", "b": [0.5756, 0.2292, 0.5966, 0.2489]}, {"w": "the", "b": [0.603, 0.2292, 0.6338, 0.2489]}, {"w": "English", "b": [0.6401, 0.2292, 0.7172, 0.2489]}, {"w": "language.", "b": [0.7235, 0.2292, 0.8209, 0.2489]}]}, {"id": "b_1", "type": "paragraph", "text": "Preparing the data", "words": [{"w": "Preparing", "b": [0.1294, 0.267, 0.211, 0.2818]}, {"w": "the", "b": [0.2158, 0.267, 0.241, 0.2818]}, {"w": "data", "b": [0.2457, 0.267, 0.2815, 0.2818]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s start by downloading the corpus and converting it to lowercase.", "words": [{"w": "Let’s", "b": [0.1294, 0.3049, 0.1798, 0.3247]}, {"w": "start", "b": [0.1862, 0.3049, 0.2296, 0.3247]}, {"w": "by", "b": [0.2359, 0.3049, 0.2611, 0.3247]}, {"w": "downloading", "b": [0.2674, 0.3049, 0.3992, 0.3247]}, {"w": "the", "b": [0.4055, 0.3049, 0.4363, 0.3247]}, {"w": "corpus", "b": [0.4426, 0.3049, 0.5099, 0.3247]}, {"w": "and", "b": [0.5162, 0.3049, 0.5526, 0.3247]}, {"w": "converting", "b": [0.5589, 0.3049, 0.6668, 0.3247]}, {"w": "it", "b": [0.6731, 0.3049, 0.6871, 0.3247]}, {"w": "to", "b": [0.6934, 0.3049, 0.713, 0.3247]}, {"w": "lowercase.", "b": [0.7194, 0.3049, 0.8265, 0.3247]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 8.2. Downloading and parsing the initial text file", "words": [{"w": "Listing", "b": [0.1294, 0.3428, 0.1862, 0.3576]}, {"w": "8.2.", "b": [0.1909, 0.3428, 0.2193, 0.3576]}, {"w": "Downloading", "b": [0.224, 0.3428, 0.3312, 0.3576]}, {"w": "and", "b": [0.336, 0.3428, 0.3665, 0.3576]}, {"w": "parsing", "b": [0.3712, 0.3428, 0.4322, 0.3576]}, {"w": "the", "b": [0.4369, 0.3428, 0.4621, 0.3576]}, {"w": "initial", "b": [0.4669, 0.3428, 0.5142, 0.3576]}, {"w": "text", "b": [0.5189, 0.3428, 0.5494, 0.3576]}, {"w": "file", "b": [0.5541, 0.3428, 0.5793, 0.3576]}]}, {"id": "b_4", "type": "paragraph", "text": "import keras import numpy as np path = keras.utils.get_file( 'nietzsche.txt', origin='https://s3.amazonaws.com/text- datasets/nietzsche.txt') text = open(path).read().lower() print('Corpus length:', len(text))", "words": [{"w": "import", "b": [0.1357, 0.3712, 0.2038, 0.3863]}, {"w": "keras", "b": [0.2152, 0.3712, 0.2719, 0.3863]}, {"w": "import", "b": [0.1357, 0.3863, 0.2038, 0.4015]}, {"w": "numpy", "b": [0.2152, 0.3863, 0.2719, 0.4015]}, {"w": "as", "b": [0.2833, 0.3863, 0.306, 0.4015]}, {"w": "np", "b": [0.3173, 0.3863, 0.34, 0.4015]}, {"w": "path", "b": [0.1357, 0.4167, 0.1811, 0.4318]}, {"w": "=", "b": [0.1925, 0.4167, 0.2038, 0.4318]}, {"w": "keras.utils.get_file(", "b": [0.2152, 0.4167, 0.4536, 0.4318]}, {"w": "'nietzsche.txt',", "b": [0.1811, 0.4318, 0.3628, 0.447]}, {"w": "origin='https://s3.amazonaws.com/text-", "b": [0.1811, 0.447, 0.6125, 0.4621]}, {"w": "datasets/nietzsche.txt')", "b": [0.1357, 0.4621, 0.4082, 0.4773]}, {"w": "text", "b": [0.1357, 0.4773, 0.1811, 0.4924]}, {"w": "=", "b": [0.1925, 0.4773, 0.2038, 0.4924]}, {"w": "open(path).read().lower()", "b": [0.2152, 0.4773, 0.499, 0.4924]}, {"w": "print('Corpus", "b": [0.1357, 0.4924, 0.2833, 0.5076]}, {"w": "length:',", "b": [0.2946, 0.4924, 0.3968, 0.5076]}, {"w": "len(text))", "b": [0.4082, 0.4924, 0.5217, 0.5076]}]}, {"id": "b_5", "type": "paragraph", "text": "Next, you’ll extract partially overlapping sequences of length maxlen, one-hot encode them, and pack them in a 3D Numpy array x of shape (sequences, maxlen, unique_characters). Simultaneously, you’ll prepare an array y containing the corresponding targets: the one-hot-encoded characters that come after each extracted sequence.", "words": [{"w": "Next,", "b": [0.1294, 0.5304, 0.1848, 0.5502]}, {"w": "you’ll", "b": [0.1911, 0.5304, 0.2513, 0.5502]}, {"w": "extract", "b": [0.2576, 0.5304, 0.3263, 0.5502]}, {"w": "partially", "b": [0.3326, 0.5304, 0.4167, 0.5502]}, {"w": "overlapping", "b": [0.423, 0.5304, 0.5435, 0.5502]}, {"w": "sequences", "b": [0.5498, 0.5304, 0.652, 0.5502]}, {"w": "of", "b": [0.6583, 0.5304, 0.6794, 0.5502]}, {"w": "length", "b": [0.6857, 0.5304, 0.7487, 0.5502]}, {"w": "maxlen,", "b": [0.7549, 0.5304, 0.8521, 0.5517]}, {"w": "one-hot", "b": [0.1294, 0.5518, 0.2065, 0.5716]}, {"w": "encode", "b": [0.2128, 0.5518, 0.2842, 0.5716]}, {"w": "them,", "b": [0.2905, 0.5518, 0.3473, 0.5716]}, {"w": "and", "b": [0.3536, 0.5518, 0.39, 0.5716]}, {"w": "pack", "b": [0.3963, 0.5518, 0.444, 0.5716]}, {"w": "them", "b": [0.4503, 0.5518, 0.5007, 0.5716]}, {"w": "in", "b": [0.507, 0.5518, 0.5266, 0.5716]}, {"w": "a", "b": [0.5329, 0.5518, 0.5441, 0.5716]}, {"w": "3D", "b": [0.5505, 0.5518, 0.5813, 0.5716]}, {"w": "Numpy", "b": [0.5876, 0.5518, 0.6633, 0.5716]}, {"w": "array", "b": [0.6696, 0.5518, 0.7214, 0.5716]}, {"w": "x", "b": [0.7276, 0.5529, 0.7428, 0.5731]}, {"w": "of", "b": [0.7491, 0.5518, 0.7701, 0.5716]}, {"w": "shape", "b": [0.7764, 0.5518, 0.8338, 0.5716]}, {"w": "(sequences,", "b": [0.1294, 0.5743, 0.2959, 0.5945]}, {"w": "maxlen,", "b": [0.311, 0.5743, 0.417, 0.5945]}, {"w": "unique_characters).", "b": [0.4321, 0.5732, 0.7109, 0.5945]}, {"w": "Simultaneously,", "b": [0.1294, 0.5946, 0.291, 0.6144]}, {"w": "you’ll", "b": [0.2973, 0.5946, 0.3576, 0.6144]}, {"w": "prepare", "b": [0.3639, 0.5946, 0.4395, 0.6144]}, {"w": "an", "b": [0.4458, 0.5946, 0.4697, 0.6144]}, {"w": "array", "b": [0.476, 0.5946, 0.5278, 0.6144]}, {"w": "y", "b": [0.534, 0.5957, 0.5492, 0.6159]}, {"w": "containing", "b": [0.5555, 0.5946, 0.662, 0.6144]}, {"w": "the", "b": [0.6683, 0.5946, 0.6991, 0.6144]}, {"w": "corresponding", "b": [0.7054, 0.5946, 0.8497, 0.6144]}, {"w": "targets:", "b": [0.1294, 0.616, 0.2032, 0.6358]}, {"w": "the", "b": [0.2095, 0.616, 0.2403, 0.6358]}, {"w": "one-hot-encoded", "b": [0.2467, 0.616, 0.4162, 0.6358]}, {"w": "characters", "b": [0.4225, 0.616, 0.5247, 0.6358]}, {"w": "that", "b": [0.531, 0.616, 0.5689, 0.6358]}, {"w": "come", "b": [0.5752, 0.616, 0.6298, 0.6358]}, {"w": "after", "b": [0.6361, 0.616, 0.6823, 0.6358]}, {"w": "each", "b": [0.6886, 0.616, 0.7348, 0.6358]}, {"w": "extracted", "b": [0.7412, 0.616, 0.8336, 0.6358]}, {"w": "sequence.", "b": [0.1294, 0.6365, 0.2282, 0.6563]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 8.3. Vectorizing sequences of characters", "words": [{"w": "Listing", "b": [0.1294, 0.6744, 0.1862, 0.6892]}, {"w": "8.3.", "b": [0.1909, 0.6744, 0.2193, 0.6892]}, {"w": "Vectorizing", "b": [0.224, 0.6744, 0.3158, 0.6892]}, {"w": "sequences", "b": [0.3205, 0.6744, 0.4004, 0.6892]}, {"w": "of", "b": [0.4051, 0.6744, 0.4209, 0.6892]}, {"w": "characters", "b": [0.4256, 0.6744, 0.5107, 0.6892]}]}, {"id": "b_7", "type": "paragraph", "text": "maxlen = 60 1 step = 3 2 sentences = [] 3 next_chars = [] 4 for i in range(0, len(text) - maxlen, step): sentences.append(text[i: i + maxlen])", "words": [{"w": "maxlen", "b": [0.1357, 0.7028, 0.2038, 0.7179]}, {"w": "=", "b": [0.2152, 0.7028, 0.2265, 0.7179]}, {"w": "60", "b": [0.2379, 0.7028, 0.2606, 0.7179]}, {"w": "1", "b": [0.1357, 0.7179, 0.1471, 0.7331]}, {"w": "step", "b": [0.1357, 0.7331, 0.1811, 0.7482]}, {"w": "=", "b": [0.1925, 0.7331, 0.2038, 0.7482]}, {"w": "3", "b": [0.2152, 0.7331, 0.2265, 0.7482]}, {"w": "2", "b": [0.1357, 0.7482, 0.1471, 0.7634]}, {"w": "sentences", "b": [0.1357, 0.7785, 0.2379, 0.7937]}, {"w": "=", "b": [0.2492, 0.7785, 0.2606, 0.7937]}, {"w": "[]", "b": [0.2719, 0.7785, 0.2946, 0.7937]}, {"w": "3", "b": [0.1357, 0.7937, 0.1471, 0.8088]}, {"w": "next_chars", "b": [0.1357, 0.824, 0.2492, 0.8391]}, {"w": "=", "b": [0.2606, 0.824, 0.2719, 0.8391]}, {"w": "[]", "b": [0.2833, 0.824, 0.306, 0.8391]}, {"w": "4", "b": [0.1357, 0.8391, 0.1471, 0.8543]}, {"w": "for", "b": [0.1357, 0.8694, 0.1698, 0.8846]}, {"w": "i", "b": [0.1811, 0.8694, 0.1925, 0.8846]}, {"w": "in", "b": [0.2038, 0.8694, 0.2265, 0.8846]}, {"w": "range(0,", "b": [0.2379, 0.8694, 0.3287, 0.8846]}, {"w": "len(text)", "b": [0.34, 0.8694, 0.4422, 0.8846]}, {"w": "-", "b": [0.4536, 0.8694, 0.4649, 0.8846]}, {"w": "maxlen,", "b": [0.4763, 0.8694, 0.5557, 0.8846]}, {"w": "step):", "b": [0.5671, 0.8694, 0.6352, 0.8846]}, {"w": "sentences.append(text[i:", "b": [0.1811, 0.8846, 0.4536, 0.8997]}, {"w": "i", "b": [0.4649, 0.8846, 0.4763, 0.8997]}, {"w": "+", "b": [0.4876, 0.8846, 0.499, 0.8997]}, {"w": "maxlen])", "b": [0.5103, 0.8846, 0.6011, 0.8997]}]}]}, {"page": 359, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "next_chars.append(text[i + maxlen]) print('Number of sequences:', len(sentences)) chars = sorted(list(set(text))) 5 print('Unique characters:', len(chars)) char_indices = dict((char, chars.index(char)) for char in chars) 6 print('Vectorization...') x = np.zeros((len(sentences), maxlen, len(chars)), dtype=np.bool) 7 y = np.zeros((len(sentences), len(chars)), dtype=np.bool) 7 for i, sentence in enumerate(sentences): 7 for t, char in enumerate(sentence): 7 x[i, t, char_indices[char]] = 1 7 y[i, char_indices[next_chars[i]]] = 1 7", "words": [{"w": "next_chars.append(text[i", "b": [0.1811, 0.0851, 0.4536, 0.1002]}, {"w": "+", "b": [0.4649, 0.0851, 0.4763, 0.1002]}, {"w": "maxlen])", "b": [0.4876, 0.0851, 0.5784, 0.1002]}, {"w": "print('Number", "b": [0.1357, 0.1154, 0.2833, 0.1305]}, {"w": "of", "b": [0.2946, 0.1154, 0.3173, 0.1305]}, {"w": "sequences:',", "b": [0.3287, 0.1154, 0.4649, 0.1305]}, {"w": "len(sentences))", "b": [0.4763, 0.1154, 0.6465, 0.1305]}, {"w": "chars", "b": [0.1357, 0.1457, 0.1925, 0.1608]}, {"w": "=", "b": [0.2038, 0.1457, 0.2152, 0.1608]}, {"w": "sorted(list(set(text)))", "b": [0.2265, 0.1457, 0.4876, 0.1608]}, {"w": "5", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "print('Unique", "b": [0.1357, 0.176, 0.2833, 0.1911]}, {"w": "characters:',", "b": [0.2946, 0.176, 0.4422, 0.1911]}, {"w": "len(chars))", "b": [0.4536, 0.176, 0.5784, 0.1911]}, {"w": "char_indices", "b": [0.1357, 0.1912, 0.2719, 0.2063]}, {"w": "=", "b": [0.2833, 0.1912, 0.2946, 0.2063]}, {"w": "dict((char,", "b": [0.306, 0.1912, 0.4309, 0.2063]}, {"w": "chars.index(char))", "b": [0.4422, 0.1912, 0.6465, 0.2063]}, {"w": "for", "b": [0.6579, 0.1912, 0.6919, 0.2063]}, {"w": "char", "b": [0.7033, 0.1912, 0.7487, 0.2063]}, {"w": "in", "b": [0.7601, 0.1912, 0.7828, 0.2063]}, {"w": "chars)", "b": [0.7941, 0.1912, 0.8622, 0.2063]}, {"w": "6", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "print('Vectorization...')", "b": [0.1357, 0.2366, 0.4195, 0.2518]}, {"w": "x", "b": [0.1357, 0.2518, 0.1471, 0.2669]}, {"w": "=", "b": [0.1584, 0.2518, 0.1698, 0.2669]}, {"w": "np.zeros((len(sentences),", "b": [0.1811, 0.2518, 0.4649, 0.2669]}, {"w": "maxlen,", "b": [0.4763, 0.2518, 0.5557, 0.2669]}, {"w": "len(chars)),", "b": [0.5671, 0.2518, 0.7033, 0.2669]}, {"w": "dtype=np.bool)", "b": [0.1357, 0.2669, 0.2946, 0.2821]}, {"w": "7", "b": [0.3628, 0.2669, 0.3741, 0.2821]}, {"w": "y", "b": [0.1357, 0.2821, 0.1471, 0.2972]}, {"w": "=", "b": [0.1584, 0.2821, 0.1698, 0.2972]}, {"w": "np.zeros((len(sentences),", "b": [0.1811, 0.2821, 0.4649, 0.2972]}, {"w": "len(chars)),", "b": [0.4763, 0.2821, 0.6125, 0.2972]}, {"w": "dtype=np.bool)", "b": [0.6238, 0.2821, 0.7828, 0.2972]}, {"w": "7", "b": [0.1357, 0.2972, 0.1471, 0.3124]}, {"w": "for", "b": [0.1357, 0.3124, 0.1698, 0.3275]}, {"w": "i,", "b": [0.1811, 0.3124, 0.2038, 0.3275]}, {"w": "sentence", "b": [0.2152, 0.3124, 0.306, 0.3275]}, {"w": "in", "b": [0.3173, 0.3124, 0.34, 0.3275]}, {"w": "enumerate(sentences):", "b": [0.3514, 0.3124, 0.5898, 0.3275]}, {"w": "7", "b": [0.1357, 0.3275, 0.1471, 0.3427]}, {"w": "for", "b": [0.1811, 0.3427, 0.2152, 0.3578]}, {"w": "t,", "b": [0.2265, 0.3427, 0.2492, 0.3578]}, {"w": "char", "b": [0.2606, 0.3427, 0.306, 0.3578]}, {"w": "in", "b": [0.3173, 0.3427, 0.34, 0.3578]}, {"w": "enumerate(sentence):", "b": [0.3514, 0.3427, 0.5784, 0.3578]}, {"w": "7", "b": [0.1357, 0.3578, 0.1471, 0.373]}, {"w": "x[i,", "b": [0.2265, 0.373, 0.2719, 0.3881]}, {"w": "t,", "b": [0.2833, 0.373, 0.306, 0.3881]}, {"w": "char_indices[char]]", "b": [0.3173, 0.373, 0.533, 0.3881]}, {"w": "=", "b": [0.5444, 0.373, 0.5557, 0.3881]}, {"w": "1", "b": [0.5671, 0.373, 0.5784, 0.3881]}, {"w": "7", "b": [0.1357, 0.3881, 0.1471, 0.4033]}, {"w": "y[i,", "b": [0.1811, 0.4033, 0.2265, 0.4184]}, {"w": "char_indices[next_chars[i]]]", "b": [0.2379, 0.4033, 0.5557, 0.4184]}, {"w": "=", "b": [0.5671, 0.4033, 0.5784, 0.4184]}, {"w": "1", "b": [0.5898, 0.4033, 0.6011, 0.4184]}, {"w": "7", "b": [0.1357, 0.4184, 0.1471, 0.4336]}]}, {"id": "b_1", "type": "paragraph", "text": "1 You’ll extract sequences of 60 characters. 2 You’ll sample a new sequence every three characters. 3 Holds the extracted sequences 4 Holds the targets (the follow-up characters) 5 List of unique characters in the corpus 6 Dictionary that maps unique characters to their index in the list “chars” 7 One-hot encodes the characters into binary arrays", "words": [{"w": "1", "b": [0.1799, 0.452, 0.1925, 0.4717]}, {"w": "You’ll", "b": [0.1988, 0.452, 0.2633, 0.4717]}, {"w": "extract", "b": [0.2696, 0.452, 0.3452, 0.4717]}, {"w": "sequences", "b": [0.3515, 0.452, 0.458, 0.4717]}, {"w": "of", "b": [0.4643, 0.452, 0.4853, 0.4717]}, {"w": "60", "b": [0.4916, 0.452, 0.5169, 0.4717]}, {"w": "characters.", "b": [0.5232, 0.452, 0.6429, 0.4717]}, {"w": "2", "b": [0.1799, 0.4725, 0.1925, 0.4922]}, {"w": "You’ll", "b": [0.1988, 0.4725, 0.2633, 0.4922]}, {"w": "sample", "b": [0.2696, 0.4725, 0.3453, 0.4922]}, {"w": "a", "b": [0.3516, 0.4725, 0.3642, 0.4922]}, {"w": "new", "b": [0.3705, 0.4725, 0.4139, 0.4922]}, {"w": "sequence", "b": [0.4202, 0.4725, 0.5169, 0.4922]}, {"w": "every", "b": [0.5232, 0.4725, 0.582, 0.4922]}, {"w": "three", "b": [0.5884, 0.4725, 0.6439, 0.4922]}, {"w": "characters.", "b": [0.6502, 0.4725, 0.77, 0.4922]}, {"w": "3", "b": [0.1799, 0.493, 0.1925, 0.5127]}, {"w": "Holds", "b": [0.1988, 0.493, 0.2619, 0.5127]}, {"w": "the", "b": [0.2682, 0.493, 0.3018, 0.5127]}, {"w": "extracted", "b": [0.3081, 0.493, 0.409, 0.5127]}, {"w": "sequences", "b": [0.4153, 0.493, 0.5218, 0.5127]}, {"w": "4", "b": [0.1799, 0.5135, 0.1925, 0.5332]}, {"w": "Holds", "b": [0.1988, 0.5135, 0.2619, 0.5332]}, {"w": "the", "b": [0.2682, 0.5135, 0.3018, 0.5332]}, {"w": "targets", "b": [0.3081, 0.5135, 0.3824, 0.5332]}, {"w": "(the", "b": [0.3887, 0.5135, 0.4307, 0.5332]}, {"w": "follow-up", "b": [0.437, 0.5135, 0.5393, 0.5332]}, {"w": "characters)", "b": [0.5456, 0.5135, 0.6675, 0.5332]}, {"w": "5", "b": [0.1799, 0.534, 0.1925, 0.5537]}, {"w": "List", "b": [0.1988, 0.534, 0.2408, 0.5537]}, {"w": "of", "b": [0.2471, 0.534, 0.2682, 0.5537]}, {"w": "unique", "b": [0.2745, 0.534, 0.3488, 0.5537]}, {"w": "characters", "b": [0.3551, 0.534, 0.4685, 0.5537]}, {"w": "in", "b": [0.4749, 0.534, 0.4959, 0.5537]}, {"w": "the", "b": [0.5022, 0.534, 0.5358, 0.5537]}, {"w": "corpus", "b": [0.5421, 0.534, 0.615, 0.5537]}, {"w": "6", "b": [0.1799, 0.5545, 0.1925, 0.5742]}, {"w": "Dictionary", "b": [0.1988, 0.5545, 0.3137, 0.5742]}, {"w": "that", "b": [0.32, 0.5545, 0.3634, 0.5742]}, {"w": "maps", "b": [0.3697, 0.5545, 0.4272, 0.5742]}, {"w": "unique", "b": [0.4335, 0.5545, 0.5078, 0.5742]}, {"w": "characters", "b": [0.5141, 0.5545, 0.6276, 0.5742]}, {"w": "to", "b": [0.6339, 0.5545, 0.6549, 0.5742]}, {"w": "their", "b": [0.6612, 0.5545, 0.7131, 0.5742]}, {"w": "index", "b": [0.7194, 0.5545, 0.7782, 0.5742]}, {"w": "in", "b": [0.7846, 0.5545, 0.8056, 0.5742]}, {"w": "the", "b": [0.8119, 0.5545, 0.8455, 0.5742]}, {"w": "list", "b": [0.1799, 0.575, 0.2121, 0.5947]}, {"w": "“chars”", "b": [0.2184, 0.575, 0.3025, 0.5947]}, {"w": "7", "b": [0.1799, 0.5955, 0.1925, 0.6153]}, {"w": "One-hot", "b": [0.1988, 0.5955, 0.2871, 0.6153]}, {"w": "encodes", "b": [0.2934, 0.5955, 0.3775, 0.6153]}, {"w": "the", "b": [0.3838, 0.5955, 0.4174, 0.6153]}, {"w": "characters", "b": [0.4237, 0.5955, 0.5372, 0.6153]}, {"w": "into", "b": [0.5435, 0.5955, 0.5855, 0.6153]}, {"w": "binary", "b": [0.5918, 0.5955, 0.6633, 0.6153]}, {"w": "arrays", "b": [0.6696, 0.5955, 0.7397, 0.6153]}]}, {"id": "b_2", "type": "paragraph", "text": "Building the network", "words": [{"w": "Building", "b": [0.1294, 0.6334, 0.1988, 0.6482]}, {"w": "the", "b": [0.2036, 0.6334, 0.2288, 0.6482]}, {"w": "network", "b": [0.2335, 0.6334, 0.3008, 0.6482]}]}, {"id": "b_3", "type": "paragraph", "text": "This network is a single LSTM layer followed by a Dense classifier and softmax over all possible characters. But note that recurrent neural networks aren’t the only way to do sequence data generation; 1D convnets also have proven extremely successful at this task in recent times.", "words": [{"w": "This", "b": [0.1294, 0.6713, 0.1743, 0.691]}, {"w": "network", "b": [0.1806, 0.6713, 0.2632, 0.691]}, {"w": "is", "b": [0.2695, 0.6713, 0.2864, 0.691]}, {"w": "a", "b": [0.2927, 0.6713, 0.3039, 0.691]}, {"w": "single", "b": [0.3102, 0.6713, 0.3704, 0.691]}, {"w": "LSTM", "b": [0.3767, 0.6723, 0.4373, 0.6925]}, {"w": "layer", "b": [0.4436, 0.6713, 0.494, 0.691]}, {"w": "followed", "b": [0.5003, 0.6713, 0.59, 0.691]}, {"w": "by", "b": [0.5963, 0.6713, 0.6215, 0.691]}, {"w": "a", "b": [0.6278, 0.6713, 0.639, 0.691]}, {"w": "Dense", "b": [0.6453, 0.6723, 0.721, 0.6925]}, {"w": "classifier", "b": [0.7273, 0.6713, 0.8183, 0.691]}, {"w": "and", "b": [0.8247, 0.6713, 0.8611, 0.691]}, {"w": "softmax", "b": [0.1294, 0.6927, 0.2107, 0.7124]}, {"w": "over", "b": [0.217, 0.6927, 0.2618, 0.7124]}, {"w": "all", "b": [0.2681, 0.6927, 0.2934, 0.7124]}, {"w": "possible", "b": [0.2997, 0.6927, 0.3824, 0.7124]}, {"w": "characters.", "b": [0.3887, 0.6927, 0.4972, 0.7124]}, {"w": "But", "b": [0.5035, 0.6927, 0.54, 0.7124]}, {"w": "note", "b": [0.5463, 0.6927, 0.5897, 0.7124]}, {"w": "that", "b": [0.596, 0.6927, 0.6339, 0.7124]}, {"w": "recurrent", "b": [0.6402, 0.6927, 0.7312, 0.7124]}, {"w": "neural", "b": [0.7375, 0.6927, 0.8005, 0.7124]}, {"w": "networks", "b": [0.1294, 0.7132, 0.2219, 0.7329]}, {"w": "aren’t", "b": [0.2282, 0.7132, 0.2866, 0.7329]}, {"w": "the", "b": [0.2929, 0.7132, 0.3237, 0.7329]}, {"w": "only", "b": [0.33, 0.7132, 0.3749, 0.7329]}, {"w": "way", "b": [0.3812, 0.7132, 0.4232, 0.7329]}, {"w": "to", "b": [0.4295, 0.7132, 0.4491, 0.7329]}, {"w": "do", "b": [0.4554, 0.7132, 0.4806, 0.7329]}, {"w": "sequence", "b": [0.487, 0.7132, 0.5794, 0.7329]}, {"w": "data", "b": [0.5857, 0.7132, 0.6277, 0.7329]}, {"w": "generation;", "b": [0.634, 0.7132, 0.7475, 0.7329]}, {"w": "1D", "b": [0.7538, 0.7132, 0.7846, 0.7329]}, {"w": "convnets", "b": [0.1294, 0.7337, 0.2191, 0.7534]}, {"w": "also", "b": [0.2254, 0.7337, 0.266, 0.7534]}, {"w": "have", "b": [0.2723, 0.7337, 0.32, 0.7534]}, {"w": "proven", "b": [0.3263, 0.7337, 0.3963, 0.7534]}, {"w": "extremely", "b": [0.4026, 0.7337, 0.5035, 0.7534]}, {"w": "successful", "b": [0.5098, 0.7337, 0.6135, 0.7534]}, {"w": "at", "b": [0.6198, 0.7337, 0.638, 0.7534]}, {"w": "this", "b": [0.6443, 0.7337, 0.6808, 0.7534]}, {"w": "task", "b": [0.6871, 0.7337, 0.7277, 0.7534]}, {"w": "in", "b": [0.734, 0.7337, 0.7536, 0.7534]}, {"w": "recent", "b": [0.76, 0.7337, 0.8216, 0.7534]}, {"w": "times.", "b": [0.1294, 0.7542, 0.1904, 0.7739]}]}, {"id": "b_4", "type": "equation", "text": "Listing 8.4. Single-layer LSTM model for next-character prediction", "words": [{"w": "Listing", "b": [0.1294, 0.792, 0.1862, 0.8068]}, {"w": "8.4.", "b": [0.1909, 0.792, 0.2193, 0.8068]}, {"w": "Single-layer", "b": [0.224, 0.792, 0.3207, 0.8068]}, {"w": "LSTM", "b": [0.3254, 0.792, 0.3791, 0.8068]}, {"w": "model", "b": [0.3838, 0.792, 0.4332, 0.8068]}, {"w": "for", "b": [0.4379, 0.792, 0.4621, 0.8068]}, {"w": "next-character", "b": [0.4668, 0.792, 0.5855, 0.8068]}, {"w": "prediction", "b": [0.5902, 0.792, 0.6729, 0.8068]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras import layers model = keras.models.Sequential() model.add(layers.LSTM(128, input_shape=(maxlen, len(chars)))) model.add(layers.Dense(len(chars), activation='softmax'))", "words": [{"w": "from", "b": [0.1357, 0.8204, 0.1811, 0.8356]}, {"w": "keras", "b": [0.1925, 0.8204, 0.2492, 0.8356]}, {"w": "import", "b": [0.2606, 0.8204, 0.3287, 0.8356]}, {"w": "layers", "b": [0.34, 0.8204, 0.4082, 0.8356]}, {"w": "model", "b": [0.1357, 0.8507, 0.1925, 0.8659]}, {"w": "=", "b": [0.2038, 0.8507, 0.2152, 0.8659]}, {"w": "keras.models.Sequential()", "b": [0.2265, 0.8507, 0.5103, 0.8659]}, {"w": "model.add(layers.LSTM(128,", "b": [0.1357, 0.8659, 0.4309, 0.881]}, {"w": "input_shape=(maxlen,", "b": [0.4422, 0.8659, 0.6692, 0.881]}, {"w": "len(chars))))", "b": [0.6806, 0.8659, 0.8282, 0.881]}, {"w": "model.add(layers.Dense(len(chars),", "b": [0.1357, 0.881, 0.5217, 0.8962]}, {"w": "activation='softmax'))", "b": [0.533, 0.881, 0.7828, 0.8962]}]}]}, {"page": 360, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Because your targets are one-hot encoded, you’ll use categorical_crossentropy as the loss to train the model.", "words": [{"w": "Because", "b": [0.1294, 0.0857, 0.2135, 0.1054]}, {"w": "your", "b": [0.2198, 0.0857, 0.266, 0.1054]}, {"w": "targets", "b": [0.2723, 0.0857, 0.3391, 0.1054]}, {"w": "are", "b": [0.3454, 0.0857, 0.3762, 0.1054]}, {"w": "one-hot", "b": [0.3825, 0.0857, 0.4596, 0.1054]}, {"w": "encoded,", "b": [0.4659, 0.0857, 0.5562, 0.1054]}, {"w": "you’ll", "b": [0.5625, 0.0857, 0.6228, 0.1054]}, {"w": "use", "b": [0.6291, 0.0857, 0.6627, 0.1054]}, {"w": "categorical_crossentropy", "b": [0.1294, 0.1072, 0.4927, 0.1274]}, {"w": "as", "b": [0.499, 0.1062, 0.52, 0.1259]}, {"w": "the", "b": [0.5263, 0.1062, 0.5572, 0.1259]}, {"w": "loss", "b": [0.5635, 0.1062, 0.6027, 0.1259]}, {"w": "to", "b": [0.609, 0.1062, 0.6287, 0.1259]}, {"w": "train", "b": [0.635, 0.1062, 0.6812, 0.1259]}, {"w": "the", "b": [0.6875, 0.1062, 0.7183, 0.1259]}, {"w": "model.", "b": [0.7246, 0.1062, 0.794, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 8.5. Model compilation configuration", "words": [{"w": "Listing", "b": [0.1294, 0.1449, 0.1862, 0.1597]}, {"w": "8.5.", "b": [0.1909, 0.1449, 0.2193, 0.1597]}, {"w": "Model", "b": [0.224, 0.1449, 0.2755, 0.1597]}, {"w": "compilation", "b": [0.2802, 0.1449, 0.3759, 0.1597]}, {"w": "configuration", "b": [0.3806, 0.1449, 0.4899, 0.1597]}]}, {"id": "b_2", "type": "paragraph", "text": "optimizer = keras.optimizers.RMSprop(lr=0.01) model.compile(loss='categorical_crossentropy', optimizer=optimizer)", "words": [{"w": "optimizer", "b": [0.1357, 0.1733, 0.2379, 0.1885]}, {"w": "=", "b": [0.2492, 0.1733, 0.2606, 0.1885]}, {"w": "keras.optimizers.RMSprop(lr=0.01)", "b": [0.2719, 0.1733, 0.6465, 0.1885]}, {"w": "model.compile(loss='categorical_crossentropy',", "b": [0.1357, 0.1885, 0.6579, 0.2036]}, {"w": "optimizer=optimizer)", "b": [0.1357, 0.2036, 0.3628, 0.2188]}]}, {"id": "b_3", "type": "paragraph", "text": "Training the language model and sampling from it", "words": [{"w": "Training", "b": [0.1294, 0.2323, 0.1995, 0.2471]}, {"w": "the", "b": [0.2042, 0.2323, 0.2295, 0.2471]}, {"w": "language", "b": [0.2342, 0.2323, 0.3067, 0.2471]}, {"w": "model", "b": [0.3114, 0.2323, 0.3608, 0.2471]}, {"w": "and", "b": [0.3656, 0.2323, 0.3961, 0.2471]}, {"w": "sampling", "b": [0.4008, 0.2323, 0.4744, 0.2471]}, {"w": "from", "b": [0.4791, 0.2323, 0.5187, 0.2471]}, {"w": "it", "b": [0.5234, 0.2323, 0.535, 0.2471]}]}, {"id": "b_4", "type": "paragraph", "text": "Given a trained model and a seed text snippet, you can generate new text by doing the following repeatedly:", "words": [{"w": "Given", "b": [0.1294, 0.2702, 0.1911, 0.2899]}, {"w": "a", "b": [0.1974, 0.2702, 0.2086, 0.2899]}, {"w": "trained", "b": [0.2149, 0.2702, 0.2849, 0.2899]}, {"w": "model", "b": [0.2912, 0.2702, 0.3543, 0.2899]}, {"w": "and", "b": [0.3606, 0.2702, 0.397, 0.2899]}, {"w": "a", "b": [0.4033, 0.2702, 0.4145, 0.2899]}, {"w": "seed", "b": [0.4208, 0.2702, 0.4657, 0.2899]}, {"w": "text", "b": [0.472, 0.2702, 0.5098, 0.2899]}, {"w": "snippet,", "b": [0.5161, 0.2702, 0.5953, 0.2899]}, {"w": "you", "b": [0.6016, 0.2702, 0.6395, 0.2899]}, {"w": "can", "b": [0.6458, 0.2702, 0.6808, 0.2899]}, {"w": "generate", "b": [0.6871, 0.2702, 0.7725, 0.2899]}, {"w": "new", "b": [0.7788, 0.2702, 0.8209, 0.2899]}, {"w": "text", "b": [0.8272, 0.2702, 0.865, 0.2899]}, {"w": "by", "b": [0.1294, 0.2907, 0.1546, 0.3104]}, {"w": "doing", "b": [0.1609, 0.2907, 0.2184, 0.3104]}, {"w": "the", "b": [0.2247, 0.2907, 0.2555, 0.3104]}, {"w": "following", "b": [0.2618, 0.2907, 0.36, 0.3104]}, {"w": "repeatedly:", "b": [0.3663, 0.2907, 0.4783, 0.3104]}]}, {"id": "b_5", "type": "paragraph", "text": "1. Draw from the model a probability distribution for the next character, given the generated text available so far. 2. Reweight the distribution to a certain temperature. 3. Sample the next character at random according to the reweighted distribution. 4. Add the new character at the end of the available text.", "words": [{"w": "1.", "b": [0.1551, 0.329, 0.174, 0.3487]}, {"w": "Draw", "b": [0.1799, 0.329, 0.2359, 0.3487]}, {"w": "from", "b": [0.2422, 0.329, 0.2912, 0.3487]}, {"w": "the", "b": [0.2975, 0.329, 0.3284, 0.3487]}, {"w": "model", "b": [0.3347, 0.329, 0.3977, 0.3487]}, {"w": "a", "b": [0.404, 0.329, 0.4152, 0.3487]}, {"w": "probability", "b": [0.4216, 0.329, 0.5323, 0.3487]}, {"w": "distribution", "b": [0.5386, 0.329, 0.6549, 0.3487]}, {"w": "for", "b": [0.6612, 0.329, 0.6906, 0.3487]}, {"w": "the", "b": [0.6969, 0.329, 0.7278, 0.3487]}, {"w": "next", "b": [0.7341, 0.329, 0.7775, 0.3487]}, {"w": "character,", "b": [0.1799, 0.3495, 0.2776, 0.3692]}, {"w": "given", "b": [0.2839, 0.3495, 0.3399, 0.3692]}, {"w": "the", "b": [0.3462, 0.3495, 0.3771, 0.3692]}, {"w": "generated", "b": [0.3834, 0.3495, 0.4814, 0.3692]}, {"w": "text", "b": [0.4877, 0.3495, 0.5256, 0.3692]}, {"w": "available", "b": [0.5319, 0.3495, 0.6229, 0.3692]}, {"w": "so", "b": [0.6292, 0.3495, 0.6517, 0.3692]}, {"w": "far.", "b": [0.658, 0.3495, 0.6908, 0.3692]}, {"w": "2.", "b": [0.1551, 0.37, 0.174, 0.3897]}, {"w": "Reweight", "b": [0.1799, 0.37, 0.2766, 0.3897]}, {"w": "the", "b": [0.2829, 0.37, 0.3137, 0.3897]}, {"w": "distribution", "b": [0.32, 0.37, 0.4363, 0.3897]}, {"w": "to", "b": [0.4426, 0.37, 0.4623, 0.3897]}, {"w": "a", "b": [0.4686, 0.37, 0.4798, 0.3897]}, {"w": "certain", "b": [0.4861, 0.37, 0.5547, 0.3897]}, {"w": "temperature.", "b": [0.561, 0.37, 0.6878, 0.3897]}, {"w": "3.", "b": [0.1551, 0.3905, 0.174, 0.4102]}, {"w": "Sample", "b": [0.1799, 0.3905, 0.2555, 0.4102]}, {"w": "the", "b": [0.2618, 0.3905, 0.2927, 0.4102]}, {"w": "next", "b": [0.299, 0.3905, 0.3424, 0.4102]}, {"w": "character", "b": [0.3487, 0.3905, 0.4412, 0.4102]}, {"w": "at", "b": [0.4475, 0.3905, 0.4657, 0.4102]}, {"w": "random", "b": [0.472, 0.3905, 0.549, 0.4102]}, {"w": "according", "b": [0.5553, 0.3905, 0.6548, 0.4102]}, {"w": "to", "b": [0.6611, 0.3905, 0.6807, 0.4102]}, {"w": "the", "b": [0.6871, 0.3905, 0.7179, 0.4102]}, {"w": "reweighted", "b": [0.7242, 0.3905, 0.8363, 0.4102]}, {"w": "distribution.", "b": [0.1799, 0.411, 0.3025, 0.4307]}, {"w": "4.", "b": [0.1551, 0.4315, 0.174, 0.4512]}, {"w": "Add", "b": [0.1799, 0.4315, 0.2233, 0.4512]}, {"w": "the", "b": [0.2296, 0.4315, 0.2604, 0.4512]}, {"w": "new", "b": [0.2667, 0.4315, 0.3088, 0.4512]}, {"w": "character", "b": [0.3151, 0.4315, 0.4075, 0.4512]}, {"w": "at", "b": [0.4138, 0.4315, 0.432, 0.4512]}, {"w": "the", "b": [0.4383, 0.4315, 0.4692, 0.4512]}, {"w": "end", "b": [0.4755, 0.4315, 0.5119, 0.4512]}, {"w": "of", "b": [0.5182, 0.4315, 0.5392, 0.4512]}, {"w": "the", "b": [0.5455, 0.4315, 0.5763, 0.4512]}, {"w": "available", "b": [0.5826, 0.4315, 0.6737, 0.4512]}, {"w": "text.", "b": [0.68, 0.4315, 0.7242, 0.4512]}]}, {"id": "b_6", "type": "paragraph", "text": "This is the code you use to reweight the original probability distribution coming out of the model and draw a character index from it (the sampling function).", "words": [{"w": "This", "b": [0.1294, 0.4743, 0.1743, 0.494]}, {"w": "is", "b": [0.1806, 0.4743, 0.1974, 0.494]}, {"w": "the", "b": [0.2037, 0.4743, 0.2345, 0.494]}, {"w": "code", "b": [0.2408, 0.4743, 0.2885, 0.494]}, {"w": "you", "b": [0.2948, 0.4743, 0.3326, 0.494]}, {"w": "use", "b": [0.3389, 0.4743, 0.3725, 0.494]}, {"w": "to", "b": [0.3788, 0.4743, 0.3985, 0.494]}, {"w": "reweight", "b": [0.4048, 0.4743, 0.493, 0.494]}, {"w": "the", "b": [0.4993, 0.4743, 0.5302, 0.494]}, {"w": "original", "b": [0.5365, 0.4743, 0.615, 0.494]}, {"w": "probability", "b": [0.6213, 0.4743, 0.732, 0.494]}, {"w": "distribution", "b": [0.7383, 0.4743, 0.8546, 0.494]}, {"w": "coming", "b": [0.1294, 0.4948, 0.2051, 0.5145]}, {"w": "out", "b": [0.2114, 0.4948, 0.2436, 0.5145]}, {"w": "of", "b": [0.2499, 0.4948, 0.271, 0.5145]}, {"w": "the", "b": [0.2773, 0.4948, 0.3081, 0.5145]}, {"w": "model", "b": [0.3144, 0.4948, 0.3775, 0.5145]}, {"w": "and", "b": [0.3838, 0.4948, 0.4202, 0.5145]}, {"w": "draw", "b": [0.4265, 0.4948, 0.4769, 0.5145]}, {"w": "a", "b": [0.4832, 0.4948, 0.4944, 0.5145]}, {"w": "character", "b": [0.5007, 0.4948, 0.5932, 0.5145]}, {"w": "index", "b": [0.5995, 0.4948, 0.6555, 0.5145]}, {"w": "from", "b": [0.6617, 0.4948, 0.7108, 0.5145]}, {"w": "it", "b": [0.7171, 0.4948, 0.7311, 0.5145]}, {"w": "(the", "b": [0.7374, 0.4948, 0.7766, 0.5145]}, {"w": "sampling", "b": [0.1294, 0.5153, 0.2219, 0.535]}, {"w": "function).", "b": [0.2282, 0.5153, 0.3256, 0.535]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 8.6. Function to sample the next character given the model’s predictions", "words": [{"w": "Listing", "b": [0.1294, 0.5531, 0.1862, 0.5679]}, {"w": "8.6.", "b": [0.1909, 0.5531, 0.2193, 0.5679]}, {"w": "Function", "b": [0.224, 0.5531, 0.2965, 0.5679]}, {"w": "to", "b": [0.3013, 0.5531, 0.317, 0.5679]}, {"w": "sample", "b": [0.3218, 0.5531, 0.3785, 0.5679]}, {"w": "the", "b": [0.3833, 0.5531, 0.4085, 0.5679]}, {"w": "next", "b": [0.4132, 0.5531, 0.4479, 0.5679]}, {"w": "character", "b": [0.4526, 0.5531, 0.5304, 0.5679]}, {"w": "given", "b": [0.5351, 0.5531, 0.5782, 0.5679]}, {"w": "the", "b": [0.5829, 0.5531, 0.6081, 0.5679]}, {"w": "model’s", "b": [0.6129, 0.5531, 0.6752, 0.5679]}, {"w": "predictions", "b": [0.6799, 0.5531, 0.77, 0.5679]}]}, {"id": "b_8", "type": "paragraph", "text": "def sample(preds, temperature=1.0): preds = np.asarray(preds).astype('float64') preds = np.log(preds) / temperature exp_preds = np.exp(preds) preds = exp_preds / np.sum(exp_preds) probas = np.random.multinomial(1, preds, 1) return np.argmax(probas)", "words": [{"w": "def", "b": [0.1357, 0.5815, 0.1698, 0.5967]}, {"w": "sample(preds,", "b": [0.1811, 0.5815, 0.3287, 0.5967]}, {"w": "temperature=1.0):", "b": [0.34, 0.5815, 0.533, 0.5967]}, {"w": "preds", "b": [0.1811, 0.5967, 0.2379, 0.6118]}, {"w": "=", "b": [0.2492, 0.5967, 0.2606, 0.6118]}, {"w": "np.asarray(preds).astype('float64')", "b": [0.2719, 0.5967, 0.6692, 0.6118]}, {"w": "preds", "b": [0.1811, 0.6119, 0.2379, 0.627]}, {"w": "=", "b": [0.2492, 0.6119, 0.2606, 0.627]}, {"w": "np.log(preds)", "b": [0.2719, 0.6119, 0.4195, 0.627]}, {"w": "/", "b": [0.4309, 0.6119, 0.4422, 0.627]}, {"w": "temperature", "b": [0.4536, 0.6119, 0.5784, 0.627]}, {"w": "exp_preds", "b": [0.1811, 0.627, 0.2833, 0.6421]}, {"w": "=", "b": [0.2946, 0.627, 0.306, 0.6421]}, {"w": "np.exp(preds)", "b": [0.3173, 0.627, 0.4649, 0.6421]}, {"w": "preds", "b": [0.1811, 0.6422, 0.2379, 0.6573]}, {"w": "=", "b": [0.2492, 0.6422, 0.2606, 0.6573]}, {"w": "exp_preds", "b": [0.2719, 0.6422, 0.3741, 0.6573]}, {"w": "/", "b": [0.3855, 0.6422, 0.3968, 0.6573]}, {"w": "np.sum(exp_preds)", "b": [0.4082, 0.6422, 0.6011, 0.6573]}, {"w": "probas", "b": [0.1811, 0.6573, 0.2492, 0.6725]}, {"w": "=", "b": [0.2606, 0.6573, 0.2719, 0.6725]}, {"w": "np.random.multinomial(1,", "b": [0.2833, 0.6573, 0.5557, 0.6725]}, {"w": "preds,", "b": [0.5671, 0.6573, 0.6352, 0.6725]}, {"w": "1)", "b": [0.6465, 0.6573, 0.6692, 0.6725]}, {"w": "return", "b": [0.1811, 0.6725, 0.2492, 0.6876]}, {"w": "np.argmax(probas)", "b": [0.2606, 0.6725, 0.4536, 0.6876]}]}, {"id": "b_9", "type": "paragraph", "text": "Finally, the following loop repeatedly trains and generates text. You begin generating text using a range of different temperatures after every epoch. This allows you to see how the generated text evolves as the model begins to converge, as well as the impact of temperature in the sampling strategy.", "words": [{"w": "Finally,", "b": [0.1294, 0.7105, 0.2056, 0.7302]}, {"w": "the", "b": [0.2119, 0.7105, 0.2427, 0.7302]}, {"w": "following", "b": [0.249, 0.7105, 0.3471, 0.7302]}, {"w": "loop", "b": [0.3534, 0.7105, 0.3983, 0.7302]}, {"w": "repeatedly", "b": [0.4046, 0.7105, 0.5096, 0.7302]}, {"w": "trains", "b": [0.5159, 0.7105, 0.572, 0.7302]}, {"w": "and", "b": [0.5783, 0.7105, 0.6147, 0.7302]}, {"w": "generates", "b": [0.621, 0.7105, 0.7163, 0.7302]}, {"w": "text.", "b": [0.7226, 0.7105, 0.7667, 0.7302]}, {"w": "You", "b": [0.773, 0.7105, 0.8139, 0.7302]}, {"w": "begin", "b": [0.1294, 0.731, 0.1855, 0.7507]}, {"w": "generating", "b": [0.1918, 0.731, 0.2982, 0.7507]}, {"w": "text", "b": [0.3046, 0.731, 0.3424, 0.7507]}, {"w": "using", "b": [0.3487, 0.731, 0.4034, 0.7507]}, {"w": "a", "b": [0.4097, 0.731, 0.4209, 0.7507]}, {"w": "range", "b": [0.4272, 0.731, 0.4832, 0.7507]}, {"w": "of", "b": [0.4895, 0.731, 0.5105, 0.7507]}, {"w": "different", "b": [0.5168, 0.731, 0.6032, 0.7507]}, {"w": "temperatures", "b": [0.6095, 0.731, 0.7398, 0.7507]}, {"w": "after", "b": [0.746, 0.731, 0.7922, 0.7507]}, {"w": "every", "b": [0.7985, 0.731, 0.8546, 0.7507]}, {"w": "epoch.", "b": [0.1294, 0.7515, 0.196, 0.7712]}, {"w": "This", "b": [0.2023, 0.7515, 0.2471, 0.7712]}, {"w": "allows", "b": [0.2534, 0.7515, 0.3193, 0.7712]}, {"w": "you", "b": [0.3256, 0.7515, 0.3634, 0.7712]}, {"w": "to", "b": [0.3697, 0.7515, 0.3894, 0.7712]}, {"w": "see", "b": [0.3957, 0.7515, 0.4279, 0.7712]}, {"w": "how", "b": [0.4342, 0.7515, 0.4776, 0.7712]}, {"w": "the", "b": [0.4839, 0.7515, 0.5148, 0.7712]}, {"w": "generated", "b": [0.5211, 0.7515, 0.6191, 0.7712]}, {"w": "text", "b": [0.6254, 0.7515, 0.6633, 0.7712]}, {"w": "evolves", "b": [0.6696, 0.7515, 0.7466, 0.7712]}, {"w": "as", "b": [0.7529, 0.7515, 0.774, 0.7712]}, {"w": "the", "b": [0.7803, 0.7515, 0.8111, 0.7712]}, {"w": "model", "b": [0.1294, 0.772, 0.1925, 0.7917]}, {"w": "begins", "b": [0.1988, 0.772, 0.2646, 0.7917]}, {"w": "to", "b": [0.271, 0.772, 0.2906, 0.7917]}, {"w": "converge,", "b": [0.2969, 0.772, 0.3952, 0.7917]}, {"w": "as", "b": [0.4015, 0.772, 0.4225, 0.7917]}, {"w": "well", "b": [0.4288, 0.772, 0.4722, 0.7917]}, {"w": "as", "b": [0.4785, 0.772, 0.4995, 0.7917]}, {"w": "the", "b": [0.5059, 0.772, 0.5367, 0.7917]}, {"w": "impact", "b": [0.543, 0.772, 0.6116, 0.7917]}, {"w": "of", "b": [0.6179, 0.772, 0.6389, 0.7917]}, {"w": "temperature", "b": [0.6452, 0.772, 0.7657, 0.7917]}, {"w": "in", "b": [0.772, 0.772, 0.7916, 0.7917]}, {"w": "the", "b": [0.7979, 0.772, 0.8288, 0.7917]}, {"w": "sampling", "b": [0.1294, 0.7925, 0.2219, 0.8122]}, {"w": "strategy.", "b": [0.2282, 0.7925, 0.3127, 0.8122]}]}, {"id": "b_10", "type": "equation", "text": "Listing 8.7. Text-generation loop", "words": [{"w": "Listing", "b": [0.1294, 0.8303, 0.1862, 0.8451]}, {"w": "8.7.", "b": [0.1909, 0.8303, 0.2193, 0.8451]}, {"w": "Text-generation", "b": [0.224, 0.8303, 0.3515, 0.8451]}, {"w": "loop", "b": [0.3563, 0.8303, 0.391, 0.8451]}]}, {"id": "b_11", "type": "paragraph", "text": "import random import sys", "words": [{"w": "import", "b": [0.1357, 0.8587, 0.2038, 0.8739]}, {"w": "random", "b": [0.2152, 0.8587, 0.2833, 0.8739]}, {"w": "import", "b": [0.1357, 0.8739, 0.2038, 0.889]}, {"w": "sys", "b": [0.2152, 0.8739, 0.2492, 0.889]}]}]}, {"page": 361, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "for epoch in range(1, 60): 1 print('epoch', epoch) model.fit(x, y, batch_size=128, epochs=1) 2 start_index = random.randint(0, len(text) - maxlen - 1) 3 generated_text = text[start_index: start_index + maxlen] 3 print('--- Generating with seed: \"' + generated_text + '\"') 3 for temperature in [0.2, 0.5, 1.0, 1.2]: 4 print('------ temperature:', temperature) sys.stdout.write(generated_text) for i in range(400): 5 sampled = np.zeros((1, maxlen, len(chars))) 6 for t, char in enumerate(generated_text): 6 sampled[0, t, char_indices[char]] = 1. 6 preds = model.predict(sampled, verbose=0)[0] 7 next_index = sample(preds, temperature) 7 next_char = chars[next_index] 7 generated_text += next_char generated_text = generated_text[1:] sys.stdout.write(next_char)", "words": [{"w": "for", "b": [0.1357, 0.0851, 0.1698, 0.1002]}, {"w": "epoch", "b": [0.1811, 0.0851, 0.2379, 0.1002]}, {"w": "in", "b": [0.2492, 0.0851, 0.2719, 0.1002]}, {"w": "range(1,", "b": [0.2833, 0.0851, 0.3741, 0.1002]}, {"w": "60):", "b": [0.3855, 0.0851, 0.4309, 0.1002]}, {"w": "1", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "print('epoch',", "b": [0.1811, 0.1154, 0.34, 0.1305]}, {"w": "epoch)", "b": [0.3514, 0.1154, 0.4195, 0.1305]}, {"w": "model.fit(x,", "b": [0.1811, 0.1305, 0.3173, 0.1457]}, {"w": "y,", "b": [0.3287, 0.1305, 0.3514, 0.1457]}, {"w": "batch_size=128,", "b": [0.3628, 0.1305, 0.533, 0.1457]}, {"w": "epochs=1)", "b": [0.5444, 0.1305, 0.6465, 0.1457]}, {"w": "2", "b": [0.1357, 0.1457, 0.1471, 0.1608]}, {"w": "start_index", "b": [0.1811, 0.1608, 0.306, 0.176]}, {"w": "=", "b": [0.3173, 0.1608, 0.3287, 0.176]}, {"w": "random.randint(0,", "b": [0.34, 0.1608, 0.533, 0.176]}, {"w": "len(text)", "b": [0.5444, 0.1608, 0.6465, 0.176]}, {"w": "-", "b": [0.6579, 0.1608, 0.6692, 0.176]}, {"w": "maxlen", "b": [0.6806, 0.1608, 0.7487, 0.176]}, {"w": "-", "b": [0.7601, 0.1608, 0.7714, 0.176]}, {"w": "1)", "b": [0.7828, 0.1608, 0.8055, 0.176]}, {"w": "3", "b": [0.1357, 0.176, 0.1471, 0.1911]}, {"w": "generated_text", "b": [0.1811, 0.1911, 0.34, 0.2063]}, {"w": "=", "b": [0.3514, 0.1911, 0.3628, 0.2063]}, {"w": "text[start_index:", "b": [0.3741, 0.1911, 0.5671, 0.2063]}, {"w": "start_index", "b": [0.5784, 0.1911, 0.7033, 0.2063]}, {"w": "+", "b": [0.7146, 0.1911, 0.726, 0.2063]}, {"w": "maxlen]", "b": [0.7374, 0.1911, 0.8168, 0.2063]}, {"w": "3", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "print('---", "b": [0.1811, 0.2215, 0.2946, 0.2366]}, {"w": "Generating", "b": [0.306, 0.2215, 0.4195, 0.2366]}, {"w": "with", "b": [0.4309, 0.2215, 0.4763, 0.2366]}, {"w": "seed:", "b": [0.4876, 0.2215, 0.5444, 0.2366]}, {"w": "\"'", "b": [0.5557, 0.2215, 0.5784, 0.2366]}, {"w": "+", "b": [0.5898, 0.2215, 0.6011, 0.2366]}, {"w": "generated_text", "b": [0.6125, 0.2215, 0.7714, 0.2366]}, {"w": "+", "b": [0.7828, 0.2215, 0.7941, 0.2366]}, {"w": "'\"')", "b": [0.8055, 0.2215, 0.8509, 0.2366]}, {"w": "3", "b": [0.1357, 0.2366, 0.1471, 0.2518]}, {"w": "for", "b": [0.1811, 0.2518, 0.2152, 0.2669]}, {"w": "temperature", "b": [0.2265, 0.2518, 0.3514, 0.2669]}, {"w": "in", "b": [0.3628, 0.2518, 0.3855, 0.2669]}, {"w": "[0.2,", "b": [0.3968, 0.2518, 0.4536, 0.2669]}, {"w": "0.5,", "b": [0.4649, 0.2518, 0.5103, 0.2669]}, {"w": "1.0,", "b": [0.5217, 0.2518, 0.5671, 0.2669]}, {"w": "1.2]:", "b": [0.5784, 0.2518, 0.6352, 0.2669]}, {"w": "4", "b": [0.1357, 0.2669, 0.1471, 0.2821]}, {"w": "print('------", "b": [0.2265, 0.2821, 0.3741, 0.2972]}, {"w": "temperature:',", "b": [0.3855, 0.2821, 0.5444, 0.2972]}, {"w": "temperature)", "b": [0.5557, 0.2821, 0.6919, 0.2972]}, {"w": "sys.stdout.write(generated_text)", "b": [0.2265, 0.2972, 0.5898, 0.3124]}, {"w": "for", "b": [0.2265, 0.3275, 0.2606, 0.3427]}, {"w": "i", "b": [0.2719, 0.3275, 0.2833, 0.3427]}, {"w": "in", "b": [0.2946, 0.3275, 0.3173, 0.3427]}, {"w": "range(400):", "b": [0.3287, 0.3275, 0.4536, 0.3427]}, {"w": "5", "b": [0.1357, 0.3427, 0.1471, 0.3578]}, {"w": "sampled", "b": [0.2719, 0.3578, 0.3514, 0.373]}, {"w": "=", "b": [0.3628, 0.3578, 0.3741, 0.373]}, {"w": "np.zeros((1,", "b": [0.3855, 0.3578, 0.5217, 0.373]}, {"w": "maxlen,", "b": [0.533, 0.3578, 0.6125, 0.373]}, {"w": "len(chars)))", "b": [0.6238, 0.3578, 0.7601, 0.373]}, {"w": "6", "b": [0.1357, 0.373, 0.1471, 0.3881]}, {"w": "for", "b": [0.2719, 0.3881, 0.306, 0.4033]}, {"w": "t,", "b": [0.3173, 0.3881, 0.34, 0.4033]}, {"w": "char", "b": [0.3514, 0.3881, 0.3968, 0.4033]}, {"w": "in", "b": [0.4082, 0.3881, 0.4309, 0.4033]}, {"w": "enumerate(generated_text):", "b": [0.4422, 0.3881, 0.7374, 0.4033]}, {"w": "6", "b": [0.1357, 0.4033, 0.1471, 0.4184]}, {"w": "sampled[0,", "b": [0.3173, 0.4184, 0.4309, 0.4336]}, {"w": "t,", "b": [0.4422, 0.4184, 0.4649, 0.4336]}, {"w": "char_indices[char]]", "b": [0.4763, 0.4184, 0.6919, 0.4336]}, {"w": "=", "b": [0.7033, 0.4184, 0.7146, 0.4336]}, {"w": "1.", "b": [0.726, 0.4184, 0.7487, 0.4336]}, {"w": "6", "b": [0.1357, 0.4336, 0.1471, 0.4487]}, {"w": "preds", "b": [0.2719, 0.4639, 0.3287, 0.479]}, {"w": "=", "b": [0.34, 0.4639, 0.3514, 0.479]}, {"w": "model.predict(sampled,", "b": [0.3628, 0.4639, 0.6125, 0.479]}, {"w": "verbose=0)[0]", "b": [0.6238, 0.4639, 0.7714, 0.479]}, {"w": "7", "b": [0.1357, 0.479, 0.1471, 0.4942]}, {"w": "next_index", "b": [0.2719, 0.4942, 0.3855, 0.5093]}, {"w": "=", "b": [0.3968, 0.4942, 0.4082, 0.5093]}, {"w": "sample(preds,", "b": [0.4195, 0.4942, 0.5671, 0.5093]}, {"w": "temperature)", "b": [0.5784, 0.4942, 0.7146, 0.5093]}, {"w": "7", "b": [0.1357, 0.5093, 0.1471, 0.5245]}, {"w": "next_char", "b": [0.2719, 0.5245, 0.3741, 0.5396]}, {"w": "=", "b": [0.3855, 0.5245, 0.3968, 0.5396]}, {"w": "chars[next_index]", "b": [0.4082, 0.5245, 0.6011, 0.5396]}, {"w": "7", "b": [0.1357, 0.5397, 0.1471, 0.5548]}, {"w": "generated_text", "b": [0.2719, 0.57, 0.4309, 0.5851]}, {"w": "+=", "b": [0.4422, 0.57, 0.4649, 0.5851]}, {"w": "next_char", "b": [0.4763, 0.57, 0.5784, 0.5851]}, {"w": "generated_text", "b": [0.2719, 0.5851, 0.4309, 0.6003]}, {"w": "=", "b": [0.4422, 0.5851, 0.4536, 0.6003]}, {"w": "generated_text[1:]", "b": [0.4649, 0.5851, 0.6692, 0.6003]}, {"w": "sys.stdout.write(next_char)", "b": [0.2719, 0.6154, 0.5784, 0.6306]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Trains the model for 60 epochs 2 Fits the model for one iteration on the data 3 Selects a text seed at random 4 Tries a range of different sampling temperatures 5 Generates 400 characters, starting from the seed text 6 One-hot encodes the characters generated so far 7 Samples the next character", "words": [{"w": "1", "b": [0.1799, 0.649, 0.1925, 0.6687]}, {"w": "Trains", "b": [0.1988, 0.649, 0.2684, 0.6687]}, {"w": "the", "b": [0.2747, 0.649, 0.3083, 0.6687]}, {"w": "model", "b": [0.3146, 0.649, 0.3805, 0.6687]}, {"w": "for", "b": [0.3868, 0.649, 0.419, 0.6687]}, {"w": "60", "b": [0.4253, 0.649, 0.4506, 0.6687]}, {"w": "epochs", "b": [0.4569, 0.649, 0.5297, 0.6687]}, {"w": "2", "b": [0.1799, 0.6695, 0.1925, 0.6892]}, {"w": "Fits", "b": [0.1988, 0.6695, 0.2394, 0.6892]}, {"w": "the", "b": [0.2457, 0.6695, 0.2794, 0.6892]}, {"w": "model", "b": [0.2857, 0.6695, 0.3515, 0.6892]}, {"w": "for", "b": [0.3578, 0.6695, 0.39, 0.6892]}, {"w": "one", "b": [0.3964, 0.6695, 0.4342, 0.6892]}, {"w": "iteration", "b": [0.4405, 0.6695, 0.533, 0.6892]}, {"w": "on", "b": [0.5393, 0.6695, 0.5659, 0.6892]}, {"w": "the", "b": [0.5722, 0.6695, 0.6059, 0.6892]}, {"w": "data", "b": [0.6122, 0.6695, 0.6598, 0.6892]}, {"w": "3", "b": [0.1799, 0.69, 0.1925, 0.7097]}, {"w": "Selects", "b": [0.1988, 0.69, 0.2716, 0.7097]}, {"w": "a", "b": [0.2779, 0.69, 0.2906, 0.7097]}, {"w": "text", "b": [0.2969, 0.69, 0.3375, 0.7097]}, {"w": "seed", "b": [0.3438, 0.69, 0.39, 0.7097]}, {"w": "at", "b": [0.3963, 0.69, 0.4173, 0.7097]}, {"w": "random", "b": [0.4236, 0.69, 0.5091, 0.7097]}, {"w": "4", "b": [0.1799, 0.7105, 0.1925, 0.7302]}, {"w": "Tries", "b": [0.1988, 0.7105, 0.253, 0.7302]}, {"w": "a", "b": [0.2593, 0.7105, 0.2719, 0.7302]}, {"w": "range", "b": [0.2782, 0.7105, 0.3398, 0.7302]}, {"w": "of", "b": [0.3461, 0.7105, 0.3672, 0.7302]}, {"w": "different", "b": [0.3735, 0.7105, 0.4669, 0.7302]}, {"w": "sampling", "b": [0.4732, 0.7105, 0.5713, 0.7302]}, {"w": "temperatures", "b": [0.5776, 0.7105, 0.7214, 0.7302]}, {"w": "5", "b": [0.1799, 0.731, 0.1925, 0.7507]}, {"w": "Generates", "b": [0.1988, 0.731, 0.3081, 0.7507]}, {"w": "400", "b": [0.3144, 0.731, 0.3522, 0.7507]}, {"w": "characters,", "b": [0.3585, 0.731, 0.4783, 0.7507]}, {"w": "starting", "b": [0.4846, 0.731, 0.5687, 0.7507]}, {"w": "from", "b": [0.575, 0.731, 0.6277, 0.7507]}, {"w": "the", "b": [0.634, 0.731, 0.6677, 0.7507]}, {"w": "seed", "b": [0.674, 0.731, 0.7202, 0.7507]}, {"w": "text", "b": [0.7265, 0.731, 0.7671, 0.7507]}, {"w": "6", "b": [0.1799, 0.7515, 0.1925, 0.7712]}, {"w": "One-hot", "b": [0.1988, 0.7515, 0.2871, 0.7712]}, {"w": "encodes", "b": [0.2934, 0.7515, 0.3775, 0.7712]}, {"w": "the", "b": [0.3838, 0.7515, 0.4174, 0.7712]}, {"w": "characters", "b": [0.4237, 0.7515, 0.5372, 0.7712]}, {"w": "generated", "b": [0.5435, 0.7515, 0.6499, 0.7712]}, {"w": "so", "b": [0.6563, 0.7515, 0.6787, 0.7712]}, {"w": "far", "b": [0.685, 0.7515, 0.7172, 0.7712]}, {"w": "7", "b": [0.1799, 0.772, 0.1925, 0.7917]}, {"w": "Samples", "b": [0.1988, 0.772, 0.2885, 0.7917]}, {"w": "the", "b": [0.2948, 0.772, 0.3284, 0.7917]}, {"w": "next", "b": [0.3347, 0.772, 0.381, 0.7917]}, {"w": "character", "b": [0.3873, 0.772, 0.4909, 0.7917]}]}, {"id": "b_2", "type": "paragraph", "text": "Here, we used the random seed text “new faculty, and the jubilation reached its climax when kant.” Here’s what you get at epoch 20, long before the model has fully converged, with temperature=0.2:", "words": [{"w": "Here,", "b": [0.1294, 0.8148, 0.1847, 0.8345]}, {"w": "we", "b": [0.191, 0.8148, 0.2205, 0.8345]}, {"w": "used", "b": [0.2268, 0.8148, 0.273, 0.8345]}, {"w": "the", "b": [0.2793, 0.8148, 0.3101, 0.8345]}, {"w": "random", "b": [0.3164, 0.8148, 0.3935, 0.8345]}, {"w": "seed", "b": [0.3998, 0.8148, 0.4446, 0.8345]}, {"w": "text", "b": [0.4509, 0.8148, 0.4888, 0.8345]}, {"w": "“new", "b": [0.4951, 0.8148, 0.5483, 0.8345]}, {"w": "faculty,", "b": [0.5546, 0.8148, 0.6293, 0.8345]}, {"w": "and", "b": [0.6356, 0.8148, 0.672, 0.8345]}, {"w": "the", "b": [0.6783, 0.8148, 0.7091, 0.8345]}, {"w": "jubilation", "b": [0.7155, 0.8148, 0.8122, 0.8345]}, {"w": "reached", "b": [0.1294, 0.8353, 0.2078, 0.855]}, {"w": "its", "b": [0.2141, 0.8353, 0.238, 0.855]}, {"w": "climax", "b": [0.2443, 0.8353, 0.313, 0.855]}, {"w": "when", "b": [0.3193, 0.8353, 0.3739, 0.855]}, {"w": "kant.”", "b": [0.3802, 0.8353, 0.4412, 0.855]}, {"w": "Here’s", "b": [0.4475, 0.8353, 0.5132, 0.855]}, {"w": "what", "b": [0.5195, 0.8353, 0.5686, 0.855]}, {"w": "you", "b": [0.5749, 0.8353, 0.6127, 0.855]}, {"w": "get", "b": [0.619, 0.8353, 0.6499, 0.855]}, {"w": "at", "b": [0.6562, 0.8353, 0.6744, 0.855]}, {"w": "epoch", "b": [0.6807, 0.8353, 0.7409, 0.855]}, {"w": "20,", "b": [0.7472, 0.8353, 0.7787, 0.855]}, {"w": "long", "b": [0.785, 0.8353, 0.8299, 0.855]}, {"w": "before", "b": [0.1294, 0.8558, 0.1938, 0.8755]}, {"w": "the", "b": [0.2001, 0.8558, 0.231, 0.8755]}, {"w": "model", "b": [0.2373, 0.8558, 0.3003, 0.8755]}, {"w": "has", "b": [0.3066, 0.8558, 0.3403, 0.8755]}, {"w": "fully", "b": [0.3466, 0.8558, 0.3942, 0.8755]}, {"w": "converged,", "b": [0.4005, 0.8558, 0.5114, 0.8755]}, {"w": "with", "b": [0.5177, 0.8558, 0.5626, 0.8755]}, {"w": "temperature=0.2:", "b": [0.5689, 0.8558, 0.8029, 0.877]}]}]}, {"page": 362, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "new faculty, and the jubilation reached its climax when kant and such a man in the same time the spirit of the surely and the such the such as a man is the sunligh and subject the present to the superiority of the special pain the most man and strange the subjection of the special conscience the special and nature and such men the subjection of the special men, the most surely the subjection of the special intellect of the subjection of the same things and", "words": [{"w": "new", "b": [0.1357, 0.0851, 0.1698, 0.1002]}, {"w": "faculty,", "b": [0.1811, 0.0851, 0.2719, 0.1002]}, {"w": "and", "b": [0.2833, 0.0851, 0.3173, 0.1002]}, {"w": "the", "b": [0.3287, 0.0851, 0.3628, 0.1002]}, {"w": "jubilation", "b": [0.3741, 0.0851, 0.4876, 0.1002]}, {"w": "reached", "b": [0.499, 0.0851, 0.5784, 0.1002]}, {"w": "its", "b": [0.5898, 0.0851, 0.6238, 0.1002]}, {"w": "climax", "b": [0.6352, 0.0851, 0.7033, 0.1002]}, {"w": "when", "b": [0.7146, 0.0851, 0.7601, 0.1002]}, {"w": "kant", "b": [0.7714, 0.0851, 0.8168, 0.1002]}, {"w": "and", "b": [0.8282, 0.0851, 0.8622, 0.1002]}, {"w": "such", "b": [0.1357, 0.1002, 0.1811, 0.1154]}, {"w": "a", "b": [0.1925, 0.1002, 0.2038, 0.1154]}, {"w": "man", "b": [0.2152, 0.1002, 0.2492, 0.1154]}, {"w": "in", "b": [0.1357, 0.1154, 0.1584, 0.1305]}, {"w": "the", "b": [0.1698, 0.1154, 0.2038, 0.1305]}, {"w": "same", "b": [0.2152, 0.1154, 0.2606, 0.1305]}, {"w": "time", "b": [0.2719, 0.1154, 0.3173, 0.1305]}, {"w": "the", "b": [0.3287, 0.1154, 0.3628, 0.1305]}, {"w": "spirit", "b": [0.3741, 0.1154, 0.4422, 0.1305]}, {"w": "of", "b": [0.4536, 0.1154, 0.4763, 0.1305]}, {"w": "the", "b": [0.4876, 0.1154, 0.5217, 0.1305]}, {"w": "surely", "b": [0.533, 0.1154, 0.6011, 0.1305]}, {"w": "and", "b": [0.6125, 0.1154, 0.6465, 0.1305]}, {"w": "the", "b": [0.6579, 0.1154, 0.6919, 0.1305]}, {"w": "such", "b": [0.7033, 0.1154, 0.7487, 0.1305]}, {"w": "the", "b": [0.7601, 0.1154, 0.7941, 0.1305]}, {"w": "such", "b": [0.8055, 0.1154, 0.8509, 0.1305]}, {"w": "as", "b": [0.1357, 0.1305, 0.1584, 0.1457]}, {"w": "a", "b": [0.1698, 0.1305, 0.1811, 0.1457]}, {"w": "man", "b": [0.1925, 0.1305, 0.2265, 0.1457]}, {"w": "is", "b": [0.2379, 0.1305, 0.2606, 0.1457]}, {"w": "the", "b": [0.2719, 0.1305, 0.306, 0.1457]}, {"w": "sunligh", "b": [0.3173, 0.1305, 0.3968, 0.1457]}, {"w": "and", "b": [0.4082, 0.1305, 0.4422, 0.1457]}, {"w": "subject", "b": [0.4536, 0.1305, 0.533, 0.1457]}, {"w": "the", "b": [0.5444, 0.1305, 0.5784, 0.1457]}, {"w": "present", "b": [0.5898, 0.1305, 0.6692, 0.1457]}, {"w": "to", "b": [0.6806, 0.1305, 0.7033, 0.1457]}, {"w": "the", "b": [0.7146, 0.1305, 0.7487, 0.1457]}, {"w": "superiority", "b": [0.1357, 0.1457, 0.2606, 0.1608]}, {"w": "of", "b": [0.2719, 0.1457, 0.2946, 0.1608]}, {"w": "the", "b": [0.306, 0.1457, 0.34, 0.1608]}, {"w": "special", "b": [0.1357, 0.1608, 0.2152, 0.176]}, {"w": "pain", "b": [0.2265, 0.1608, 0.2719, 0.176]}, {"w": "the", "b": [0.2833, 0.1608, 0.3173, 0.176]}, {"w": "most", "b": [0.3287, 0.1608, 0.3741, 0.176]}, {"w": "man", "b": [0.3855, 0.1608, 0.4195, 0.176]}, {"w": "and", "b": [0.4309, 0.1608, 0.4649, 0.176]}, {"w": "strange", "b": [0.4763, 0.1608, 0.5557, 0.176]}, {"w": "the", "b": [0.5671, 0.1608, 0.6011, 0.176]}, {"w": "subjection", "b": [0.6125, 0.1608, 0.726, 0.176]}, {"w": "of", "b": [0.7374, 0.1608, 0.7601, 0.176]}, {"w": "the", "b": [0.7714, 0.1608, 0.8055, 0.176]}, {"w": "special", "b": [0.1357, 0.176, 0.2152, 0.1911]}, {"w": "conscience", "b": [0.2265, 0.176, 0.34, 0.1911]}, {"w": "the", "b": [0.3514, 0.176, 0.3855, 0.1911]}, {"w": "special", "b": [0.3968, 0.176, 0.4763, 0.1911]}, {"w": "and", "b": [0.4876, 0.176, 0.5217, 0.1911]}, {"w": "nature", "b": [0.533, 0.176, 0.6011, 0.1911]}, {"w": "and", "b": [0.6125, 0.176, 0.6465, 0.1911]}, {"w": "such", "b": [0.6579, 0.176, 0.7033, 0.1911]}, {"w": "men", "b": [0.7146, 0.176, 0.7487, 0.1911]}, {"w": "the", "b": [0.7601, 0.176, 0.7941, 0.1911]}, {"w": "subjection", "b": [0.1357, 0.1912, 0.2492, 0.2063]}, {"w": "of", "b": [0.2606, 0.1912, 0.2833, 0.2063]}, {"w": "the", "b": [0.2946, 0.1912, 0.3287, 0.2063]}, {"w": "special", "b": [0.1357, 0.2063, 0.2152, 0.2214]}, {"w": "men,", "b": [0.2265, 0.2063, 0.2719, 0.2214]}, {"w": "the", "b": [0.2833, 0.2063, 0.3173, 0.2214]}, {"w": "most", "b": [0.3287, 0.2063, 0.3741, 0.2214]}, {"w": "surely", "b": [0.3855, 0.2063, 0.4536, 0.2214]}, {"w": "the", "b": [0.4649, 0.2063, 0.499, 0.2214]}, {"w": "subjection", "b": [0.5103, 0.2063, 0.6238, 0.2214]}, {"w": "of", "b": [0.6352, 0.2063, 0.6579, 0.2214]}, {"w": "the", "b": [0.6692, 0.2063, 0.7033, 0.2214]}, {"w": "special", "b": [0.7146, 0.2063, 0.7941, 0.2214]}, {"w": "intellect", "b": [0.1357, 0.2215, 0.2379, 0.2366]}, {"w": "of", "b": [0.2492, 0.2215, 0.2719, 0.2366]}, {"w": "the", "b": [0.2833, 0.2215, 0.3173, 0.2366]}, {"w": "subjection", "b": [0.3287, 0.2215, 0.4422, 0.2366]}, {"w": "of", "b": [0.4536, 0.2215, 0.4763, 0.2366]}, {"w": "the", "b": [0.4876, 0.2215, 0.5217, 0.2366]}, {"w": "same", "b": [0.533, 0.2215, 0.5784, 0.2366]}, {"w": "things", "b": [0.5898, 0.2215, 0.6579, 0.2366]}, {"w": "and", "b": [0.6692, 0.2215, 0.7033, 0.2366]}]}, {"id": "b_1", "type": "equation", "text": "Here’s the result with temperature=0.5:", "words": [{"w": "Here’s", "b": [0.1294, 0.2595, 0.1952, 0.2792]}, {"w": "the", "b": [0.2016, 0.2595, 0.2324, 0.2792]}, {"w": "result", "b": [0.2387, 0.2595, 0.2947, 0.2792]}, {"w": "with", "b": [0.301, 0.2595, 0.3459, 0.2792]}, {"w": "temperature=0.5:", "b": [0.3522, 0.2595, 0.5862, 0.2807]}]}, {"id": "b_2", "type": "paragraph", "text": "new faculty, and the jubilation reached its climax when kant in the eterned and such man as it's also become himself the condition of the experience of off the basis the superiory and the special morty of the strength, in the langus, as which the same time life and \"even who discless the mankind, with a subject and fact all you have to be the stand and lave no comes a troveration of the man and surely the conscience the superiority, and when one must be w", "words": [{"w": "new", "b": [0.1357, 0.2981, 0.1698, 0.3133]}, {"w": "faculty,", "b": [0.1811, 0.2981, 0.2719, 0.3133]}, {"w": "and", "b": [0.2833, 0.2981, 0.3173, 0.3133]}, {"w": "the", "b": [0.3287, 0.2981, 0.3628, 0.3133]}, {"w": "jubilation", "b": [0.3741, 0.2981, 0.4876, 0.3133]}, {"w": "reached", "b": [0.499, 0.2981, 0.5784, 0.3133]}, {"w": "its", "b": [0.5898, 0.2981, 0.6238, 0.3133]}, {"w": "climax", "b": [0.6352, 0.2981, 0.7033, 0.3133]}, {"w": "when", "b": [0.7146, 0.2981, 0.7601, 0.3133]}, {"w": "kant", "b": [0.7714, 0.2981, 0.8168, 0.3133]}, {"w": "in", "b": [0.8282, 0.2981, 0.8509, 0.3133]}, {"w": "the", "b": [0.1357, 0.3133, 0.1698, 0.3284]}, {"w": "eterned", "b": [0.1811, 0.3133, 0.2606, 0.3284]}, {"w": "and", "b": [0.1357, 0.3284, 0.1698, 0.3436]}, {"w": "such", "b": [0.1811, 0.3284, 0.2265, 0.3436]}, {"w": "man", "b": [0.2379, 0.3284, 0.2719, 0.3436]}, {"w": "as", "b": [0.2833, 0.3284, 0.306, 0.3436]}, {"w": "it's", "b": [0.3173, 0.3284, 0.3628, 0.3436]}, {"w": "also", "b": [0.3741, 0.3284, 0.4195, 0.3436]}, {"w": "become", "b": [0.4309, 0.3284, 0.499, 0.3436]}, {"w": "himself", "b": [0.5103, 0.3284, 0.5898, 0.3436]}, {"w": "the", "b": [0.6011, 0.3284, 0.6352, 0.3436]}, {"w": "condition", "b": [0.6465, 0.3284, 0.7487, 0.3436]}, {"w": "of", "b": [0.7601, 0.3284, 0.7828, 0.3436]}, {"w": "the", "b": [0.7941, 0.3284, 0.8282, 0.3436]}, {"w": "experience", "b": [0.1357, 0.3436, 0.2492, 0.3587]}, {"w": "of", "b": [0.2606, 0.3436, 0.2833, 0.3587]}, {"w": "off", "b": [0.2946, 0.3436, 0.3287, 0.3587]}, {"w": "the", "b": [0.34, 0.3436, 0.3741, 0.3587]}, {"w": "basis", "b": [0.3855, 0.3436, 0.4422, 0.3587]}, {"w": "the", "b": [0.4536, 0.3436, 0.4876, 0.3587]}, {"w": "superiory", "b": [0.499, 0.3436, 0.6011, 0.3587]}, {"w": "and", "b": [0.6125, 0.3436, 0.6465, 0.3587]}, {"w": "the", "b": [0.6579, 0.3436, 0.6919, 0.3587]}, {"w": "special", "b": [0.7033, 0.3436, 0.7828, 0.3587]}, {"w": "morty", "b": [0.7941, 0.3436, 0.8509, 0.3587]}, {"w": "of", "b": [0.1357, 0.3587, 0.1584, 0.3739]}, {"w": "the", "b": [0.1698, 0.3587, 0.2038, 0.3739]}, {"w": "strength,", "b": [0.1357, 0.3739, 0.2379, 0.389]}, {"w": "in", "b": [0.2492, 0.3739, 0.2719, 0.389]}, {"w": "the", "b": [0.2833, 0.3739, 0.3173, 0.389]}, {"w": "langus,", "b": [0.3287, 0.3739, 0.4082, 0.389]}, {"w": "as", "b": [0.4195, 0.3739, 0.4422, 0.389]}, {"w": "which", "b": [0.4536, 0.3739, 0.5103, 0.389]}, {"w": "the", "b": [0.5217, 0.3739, 0.5557, 0.389]}, {"w": "same", "b": [0.5671, 0.3739, 0.6125, 0.389]}, {"w": "time", "b": [0.6238, 0.3739, 0.6692, 0.389]}, {"w": "life", "b": [0.6806, 0.3739, 0.726, 0.389]}, {"w": "and", "b": [0.7374, 0.3739, 0.7714, 0.389]}, {"w": "\"even", "b": [0.7828, 0.3739, 0.8395, 0.389]}, {"w": "who", "b": [0.1357, 0.389, 0.1698, 0.4042]}, {"w": "discless", "b": [0.1357, 0.4042, 0.2265, 0.4193]}, {"w": "the", "b": [0.2379, 0.4042, 0.2719, 0.4193]}, {"w": "mankind,", "b": [0.2833, 0.4042, 0.3741, 0.4193]}, {"w": "with", "b": [0.3855, 0.4042, 0.4309, 0.4193]}, {"w": "a", "b": [0.4422, 0.4042, 0.4536, 0.4193]}, {"w": "subject", "b": [0.4649, 0.4042, 0.5444, 0.4193]}, {"w": "and", "b": [0.5557, 0.4042, 0.5898, 0.4193]}, {"w": "fact", "b": [0.6011, 0.4042, 0.6465, 0.4193]}, {"w": "all", "b": [0.6579, 0.4042, 0.6919, 0.4193]}, {"w": "you", "b": [0.7033, 0.4042, 0.7374, 0.4193]}, {"w": "have", "b": [0.7487, 0.4042, 0.7941, 0.4193]}, {"w": "to", "b": [0.8055, 0.4042, 0.8282, 0.4193]}, {"w": "be", "b": [0.8395, 0.4042, 0.8622, 0.4193]}, {"w": "the", "b": [0.1357, 0.4193, 0.1698, 0.4345]}, {"w": "stand", "b": [0.1811, 0.4193, 0.2379, 0.4345]}, {"w": "and", "b": [0.1357, 0.4345, 0.1698, 0.4496]}, {"w": "lave", "b": [0.1811, 0.4345, 0.2265, 0.4496]}, {"w": "no", "b": [0.2379, 0.4345, 0.2606, 0.4496]}, {"w": "comes", "b": [0.2719, 0.4345, 0.3287, 0.4496]}, {"w": "a", "b": [0.34, 0.4345, 0.3514, 0.4496]}, {"w": "troveration", "b": [0.3628, 0.4345, 0.4876, 0.4496]}, {"w": "of", "b": [0.499, 0.4345, 0.5217, 0.4496]}, {"w": "the", "b": [0.533, 0.4345, 0.5671, 0.4496]}, {"w": "man", "b": [0.5784, 0.4345, 0.6125, 0.4496]}, {"w": "and", "b": [0.6238, 0.4345, 0.6579, 0.4496]}, {"w": "surely", "b": [0.6692, 0.4345, 0.7374, 0.4496]}, {"w": "the", "b": [0.7487, 0.4345, 0.7828, 0.4496]}, {"w": "conscience", "b": [0.1357, 0.4496, 0.2492, 0.4648]}, {"w": "the", "b": [0.2606, 0.4496, 0.2946, 0.4648]}, {"w": "superiority,", "b": [0.306, 0.4496, 0.4422, 0.4648]}, {"w": "and", "b": [0.4536, 0.4496, 0.4876, 0.4648]}, {"w": "when", "b": [0.499, 0.4496, 0.5444, 0.4648]}, {"w": "one", "b": [0.5557, 0.4496, 0.5898, 0.4648]}, {"w": "must", "b": [0.6011, 0.4496, 0.6465, 0.4648]}, {"w": "be", "b": [0.6579, 0.4496, 0.6806, 0.4648]}, {"w": "w", "b": [0.6919, 0.4496, 0.7033, 0.4648]}]}, {"id": "b_3", "type": "equation", "text": "And here’s what you get with temperature=1.0:", "words": [{"w": "And", "b": [0.1294, 0.4877, 0.1729, 0.5074]}, {"w": "here’s", "b": [0.1792, 0.4877, 0.2394, 0.5074]}, {"w": "what", "b": [0.2457, 0.4877, 0.2947, 0.5074]}, {"w": "you", "b": [0.301, 0.4877, 0.3389, 0.5074]}, {"w": "get", "b": [0.3452, 0.4877, 0.376, 0.5074]}, {"w": "with", "b": [0.3823, 0.4877, 0.4272, 0.5074]}, {"w": "temperature=1.0:", "b": [0.4335, 0.4877, 0.6675, 0.5089]}]}, {"id": "b_4", "type": "paragraph", "text": "new faculty, and the jubilation reached its climax when kant, as a periliting of manner to all definites and transpects it it so hicable and ont him artiar resull too such as if ever the proping to makes as cnecience. to been juden, all every could coldiciousnike hother aw passife, the plies like which might thiod was account, indifferent germin, that everythery certain destrution, intellect into the deteriorablen origin of moralian, and a lessority o", "words": [{"w": "new", "b": [0.1357, 0.5263, 0.1698, 0.5414]}, {"w": "faculty,", "b": [0.1811, 0.5263, 0.2719, 0.5414]}, {"w": "and", "b": [0.2833, 0.5263, 0.3173, 0.5414]}, {"w": "the", "b": [0.3287, 0.5263, 0.3628, 0.5414]}, {"w": "jubilation", "b": [0.3741, 0.5263, 0.4876, 0.5414]}, {"w": "reached", "b": [0.499, 0.5263, 0.5784, 0.5414]}, {"w": "its", "b": [0.5898, 0.5263, 0.6238, 0.5414]}, {"w": "climax", "b": [0.6352, 0.5263, 0.7033, 0.5414]}, {"w": "when", "b": [0.7146, 0.5263, 0.7601, 0.5414]}, {"w": "kant,", "b": [0.7714, 0.5263, 0.8282, 0.5414]}, {"w": "as", "b": [0.8395, 0.5263, 0.8622, 0.5414]}, {"w": "a", "b": [0.1357, 0.5414, 0.1471, 0.5566]}, {"w": "periliting", "b": [0.1357, 0.5566, 0.2492, 0.5717]}, {"w": "of", "b": [0.2606, 0.5566, 0.2833, 0.5717]}, {"w": "manner", "b": [0.2946, 0.5566, 0.3628, 0.5717]}, {"w": "to", "b": [0.3741, 0.5566, 0.3968, 0.5717]}, {"w": "all", "b": [0.4082, 0.5566, 0.4422, 0.5717]}, {"w": "definites", "b": [0.4536, 0.5566, 0.5557, 0.5717]}, {"w": "and", "b": [0.5671, 0.5566, 0.6011, 0.5717]}, {"w": "transpects", "b": [0.6125, 0.5566, 0.726, 0.5717]}, {"w": "it", "b": [0.7374, 0.5566, 0.7601, 0.5717]}, {"w": "it", "b": [0.7714, 0.5566, 0.7941, 0.5717]}, {"w": "so", "b": [0.8055, 0.5566, 0.8282, 0.5717]}, {"w": "hicable", "b": [0.1357, 0.5717, 0.2152, 0.5869]}, {"w": "and", "b": [0.2265, 0.5717, 0.2606, 0.5869]}, {"w": "ont", "b": [0.2719, 0.5717, 0.306, 0.5869]}, {"w": "him", "b": [0.3173, 0.5717, 0.3514, 0.5869]}, {"w": "artiar", "b": [0.3628, 0.5717, 0.4309, 0.5869]}, {"w": "resull", "b": [0.4422, 0.5717, 0.5103, 0.5869]}, {"w": "too", "b": [0.1357, 0.5869, 0.1698, 0.602]}, {"w": "such", "b": [0.1811, 0.5869, 0.2265, 0.602]}, {"w": "as", "b": [0.2379, 0.5869, 0.2606, 0.602]}, {"w": "if", "b": [0.2719, 0.5869, 0.2946, 0.602]}, {"w": "ever", "b": [0.306, 0.5869, 0.3514, 0.602]}, {"w": "the", "b": [0.3628, 0.5869, 0.3968, 0.602]}, {"w": "proping", "b": [0.4082, 0.5869, 0.4876, 0.602]}, {"w": "to", "b": [0.499, 0.5869, 0.5217, 0.602]}, {"w": "makes", "b": [0.533, 0.5869, 0.5898, 0.602]}, {"w": "as", "b": [0.6011, 0.5869, 0.6238, 0.602]}, {"w": "cnecience.", "b": [0.6352, 0.5869, 0.7487, 0.602]}, {"w": "to", "b": [0.7601, 0.5869, 0.7828, 0.602]}, {"w": "been", "b": [0.7941, 0.5869, 0.8395, 0.602]}, {"w": "juden,", "b": [0.1357, 0.602, 0.2038, 0.6172]}, {"w": "all", "b": [0.1357, 0.6172, 0.1698, 0.6323]}, {"w": "every", "b": [0.1811, 0.6172, 0.2379, 0.6323]}, {"w": "could", "b": [0.2492, 0.6172, 0.306, 0.6323]}, {"w": "coldiciousnike", "b": [0.3173, 0.6172, 0.4763, 0.6323]}, {"w": "hother", "b": [0.4876, 0.6172, 0.5557, 0.6323]}, {"w": "aw", "b": [0.5671, 0.6172, 0.5898, 0.6323]}, {"w": "passife,", "b": [0.6011, 0.6172, 0.6919, 0.6323]}, {"w": "the", "b": [0.7033, 0.6172, 0.7374, 0.6323]}, {"w": "plies", "b": [0.7487, 0.6172, 0.8055, 0.6323]}, {"w": "like", "b": [0.8168, 0.6172, 0.8622, 0.6323]}, {"w": "which", "b": [0.1357, 0.6324, 0.1925, 0.6475]}, {"w": "might", "b": [0.2038, 0.6324, 0.2606, 0.6475]}, {"w": "thiod", "b": [0.2719, 0.6324, 0.3287, 0.6475]}, {"w": "was", "b": [0.34, 0.6324, 0.3741, 0.6475]}, {"w": "account,", "b": [0.3855, 0.6324, 0.4763, 0.6475]}, {"w": "indifferent", "b": [0.4876, 0.6324, 0.6125, 0.6475]}, {"w": "germin,", "b": [0.6238, 0.6324, 0.7033, 0.6475]}, {"w": "that", "b": [0.7146, 0.6324, 0.7601, 0.6475]}, {"w": "everythery", "b": [0.1357, 0.6475, 0.2492, 0.6626]}, {"w": "certain", "b": [0.1357, 0.6627, 0.2152, 0.6778]}, {"w": "destrution,", "b": [0.2265, 0.6627, 0.3514, 0.6778]}, {"w": "intellect", "b": [0.3628, 0.6627, 0.4649, 0.6778]}, {"w": "into", "b": [0.4763, 0.6627, 0.5217, 0.6778]}, {"w": "the", "b": [0.533, 0.6627, 0.5671, 0.6778]}, {"w": "deteriorablen", "b": [0.5784, 0.6627, 0.726, 0.6778]}, {"w": "origin", "b": [0.7374, 0.6627, 0.8055, 0.6778]}, {"w": "of", "b": [0.8168, 0.6627, 0.8395, 0.6778]}, {"w": "moralian,", "b": [0.1357, 0.6778, 0.2379, 0.693]}, {"w": "and", "b": [0.1357, 0.693, 0.1698, 0.7081]}, {"w": "a", "b": [0.1811, 0.693, 0.1925, 0.7081]}, {"w": "lessority", "b": [0.2038, 0.693, 0.306, 0.7081]}, {"w": "o", "b": [0.3173, 0.693, 0.3287, 0.7081]}]}, {"id": "b_5", "type": "paragraph", "text": "At epoch 60, the model has mostly converged, and the text starts to look significantly more coherent. Here’s the result with temperature=0.2:", "words": [{"w": "At", "b": [0.1294, 0.731, 0.1546, 0.7507]}, {"w": "epoch", "b": [0.1609, 0.731, 0.2212, 0.7507]}, {"w": "60,", "b": [0.2275, 0.731, 0.259, 0.7507]}, {"w": "the", "b": [0.2653, 0.731, 0.2962, 0.7507]}, {"w": "model", "b": [0.3025, 0.731, 0.3655, 0.7507]}, {"w": "has", "b": [0.3718, 0.731, 0.4055, 0.7507]}, {"w": "mostly", "b": [0.4118, 0.731, 0.4805, 0.7507]}, {"w": "converged,", "b": [0.4868, 0.731, 0.5976, 0.7507]}, {"w": "and", "b": [0.6039, 0.731, 0.6404, 0.7507]}, {"w": "the", "b": [0.6467, 0.731, 0.6775, 0.7507]}, {"w": "text", "b": [0.6838, 0.731, 0.7216, 0.7507]}, {"w": "starts", "b": [0.7279, 0.731, 0.7812, 0.7507]}, {"w": "to", "b": [0.7875, 0.731, 0.8071, 0.7507]}, {"w": "look", "b": [0.8134, 0.731, 0.8583, 0.7507]}, {"w": "significantly", "b": [0.1294, 0.7515, 0.2555, 0.7712]}, {"w": "more", "b": [0.2618, 0.7515, 0.3137, 0.7712]}, {"w": "coherent.", "b": [0.32, 0.7515, 0.4132, 0.7712]}, {"w": "Here’s", "b": [0.4195, 0.7515, 0.4852, 0.7712]}, {"w": "the", "b": [0.4915, 0.7515, 0.5224, 0.7712]}, {"w": "result", "b": [0.5287, 0.7515, 0.5847, 0.7712]}, {"w": "with", "b": [0.591, 0.7515, 0.6359, 0.7712]}, {"w": "temperature=0.2:", "b": [0.1294, 0.772, 0.3635, 0.7932]}]}, {"id": "b_6", "type": "paragraph", "text": "cheerfulness, friendliness and kindness of a heart are the sense of the spirit is a man with the sense of the sense of the world of the self-end and self-concerning the subjection of the strengthorixes--the subjection of the subjection of the subjection of the", "words": [{"w": "cheerfulness,", "b": [0.1357, 0.8106, 0.2833, 0.8258]}, {"w": "friendliness", "b": [0.2946, 0.8106, 0.4309, 0.8258]}, {"w": "and", "b": [0.4422, 0.8106, 0.4763, 0.8258]}, {"w": "kindness", "b": [0.4876, 0.8106, 0.5784, 0.8258]}, {"w": "of", "b": [0.5898, 0.8106, 0.6125, 0.8258]}, {"w": "a", "b": [0.6238, 0.8106, 0.6352, 0.8258]}, {"w": "heart", "b": [0.6465, 0.8106, 0.7033, 0.8258]}, {"w": "are", "b": [0.7146, 0.8106, 0.7487, 0.8258]}, {"w": "the", "b": [0.7601, 0.8106, 0.7941, 0.8258]}, {"w": "sense", "b": [0.8055, 0.8106, 0.8622, 0.8258]}, {"w": "of", "b": [0.1357, 0.8258, 0.1584, 0.8409]}, {"w": "the", "b": [0.1698, 0.8258, 0.2038, 0.8409]}, {"w": "spirit", "b": [0.1357, 0.8409, 0.2038, 0.8561]}, {"w": "is", "b": [0.2152, 0.8409, 0.2379, 0.8561]}, {"w": "a", "b": [0.2492, 0.8409, 0.2606, 0.8561]}, {"w": "man", "b": [0.2719, 0.8409, 0.306, 0.8561]}, {"w": "with", "b": [0.3173, 0.8409, 0.3628, 0.8561]}, {"w": "the", "b": [0.3741, 0.8409, 0.4082, 0.8561]}, {"w": "sense", "b": [0.4195, 0.8409, 0.4763, 0.8561]}, {"w": "of", "b": [0.4876, 0.8409, 0.5103, 0.8561]}, {"w": "the", "b": [0.5217, 0.8409, 0.5557, 0.8561]}, {"w": "sense", "b": [0.5671, 0.8409, 0.6238, 0.8561]}, {"w": "of", "b": [0.6352, 0.8409, 0.6579, 0.8561]}, {"w": "the", "b": [0.6692, 0.8409, 0.7033, 0.8561]}, {"w": "world", "b": [0.7146, 0.8409, 0.7714, 0.8561]}, {"w": "of", "b": [0.7828, 0.8409, 0.8055, 0.8561]}, {"w": "the", "b": [0.8168, 0.8409, 0.8509, 0.8561]}, {"w": "self-end", "b": [0.1357, 0.8561, 0.2265, 0.8712]}, {"w": "and", "b": [0.2379, 0.8561, 0.2719, 0.8712]}, {"w": "self-concerning", "b": [0.2833, 0.8561, 0.4536, 0.8712]}, {"w": "the", "b": [0.4649, 0.8561, 0.499, 0.8712]}, {"w": "subjection", "b": [0.5103, 0.8561, 0.6238, 0.8712]}, {"w": "of", "b": [0.6352, 0.8561, 0.6579, 0.8712]}, {"w": "the", "b": [0.6692, 0.8561, 0.7033, 0.8712]}, {"w": "strengthorixes--the", "b": [0.1357, 0.8712, 0.3514, 0.8864]}, {"w": "subjection", "b": [0.1357, 0.8864, 0.2492, 0.9015]}, {"w": "of", "b": [0.2606, 0.8864, 0.2833, 0.9015]}, {"w": "the", "b": [0.2946, 0.8864, 0.3287, 0.9015]}, {"w": "subjection", "b": [0.34, 0.8864, 0.4536, 0.9015]}, {"w": "of", "b": [0.4649, 0.8864, 0.4876, 0.9015]}, {"w": "the", "b": [0.499, 0.8864, 0.533, 0.9015]}, {"w": "subjection", "b": [0.5444, 0.8864, 0.6579, 0.9015]}, {"w": "of", "b": [0.6692, 0.8864, 0.6919, 0.9015]}, {"w": "the", "b": [0.7033, 0.8864, 0.7374, 0.9015]}]}]}, {"page": 363, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "self-concerning the feelings in the superiority in the subjection of the subjection of the spirit isn't to be a man of the sense of the subjection and said to the strength of the sense of the", "words": [{"w": "self-concerning", "b": [0.1357, 0.0851, 0.306, 0.1002]}, {"w": "the", "b": [0.3173, 0.0851, 0.3514, 0.1002]}, {"w": "feelings", "b": [0.3628, 0.0851, 0.4536, 0.1002]}, {"w": "in", "b": [0.4649, 0.0851, 0.4876, 0.1002]}, {"w": "the", "b": [0.499, 0.0851, 0.533, 0.1002]}, {"w": "superiority", "b": [0.5444, 0.0851, 0.6692, 0.1002]}, {"w": "in", "b": [0.6806, 0.0851, 0.7033, 0.1002]}, {"w": "the", "b": [0.7146, 0.0851, 0.7487, 0.1002]}, {"w": "subjection", "b": [0.1357, 0.1002, 0.2492, 0.1154]}, {"w": "of", "b": [0.2606, 0.1002, 0.2833, 0.1154]}, {"w": "the", "b": [0.2946, 0.1002, 0.3287, 0.1154]}, {"w": "subjection", "b": [0.1357, 0.1154, 0.2492, 0.1305]}, {"w": "of", "b": [0.2606, 0.1154, 0.2833, 0.1305]}, {"w": "the", "b": [0.2946, 0.1154, 0.3287, 0.1305]}, {"w": "spirit", "b": [0.34, 0.1154, 0.4082, 0.1305]}, {"w": "isn't", "b": [0.4195, 0.1154, 0.4763, 0.1305]}, {"w": "to", "b": [0.4876, 0.1154, 0.5103, 0.1305]}, {"w": "be", "b": [0.5217, 0.1154, 0.5444, 0.1305]}, {"w": "a", "b": [0.5557, 0.1154, 0.5671, 0.1305]}, {"w": "man", "b": [0.5784, 0.1154, 0.6125, 0.1305]}, {"w": "of", "b": [0.6238, 0.1154, 0.6465, 0.1305]}, {"w": "the", "b": [0.6579, 0.1154, 0.6919, 0.1305]}, {"w": "sense", "b": [0.7033, 0.1154, 0.7601, 0.1305]}, {"w": "of", "b": [0.7714, 0.1154, 0.7941, 0.1305]}, {"w": "the", "b": [0.8055, 0.1154, 0.8395, 0.1305]}, {"w": "subjection", "b": [0.1357, 0.1305, 0.2492, 0.1457]}, {"w": "and", "b": [0.2606, 0.1305, 0.2946, 0.1457]}, {"w": "said", "b": [0.306, 0.1305, 0.3514, 0.1457]}, {"w": "to", "b": [0.3628, 0.1305, 0.3855, 0.1457]}, {"w": "the", "b": [0.3968, 0.1305, 0.4309, 0.1457]}, {"w": "strength", "b": [0.4422, 0.1305, 0.533, 0.1457]}, {"w": "of", "b": [0.5444, 0.1305, 0.5671, 0.1457]}, {"w": "the", "b": [0.5784, 0.1305, 0.6125, 0.1457]}, {"w": "sense", "b": [0.6238, 0.1305, 0.6806, 0.1457]}, {"w": "of", "b": [0.6919, 0.1305, 0.7146, 0.1457]}, {"w": "the", "b": [0.726, 0.1305, 0.7601, 0.1457]}]}, {"id": "b_1", "type": "equation", "text": "Here’s temperature=0.5:", "words": [{"w": "Here’s", "b": [0.1294, 0.1686, 0.1952, 0.1883]}, {"w": "temperature=0.5:", "b": [0.2015, 0.1686, 0.4356, 0.1898]}]}, {"id": "b_2", "type": "paragraph", "text": "cheerfulness, friendliness and kindness of a heart are the part of the soul who have been the art of the philosophers, and which the one won't say, which is it the higher the and with religion of the frences. the life of the spirit among the most continuess of the strengther of the sense the conscience of men of precisely before enough presumption, and can mankind, and something the conceptions, the subjection of the sense and suffering and the", "words": [{"w": "cheerfulness,", "b": [0.1357, 0.2072, 0.2833, 0.2223]}, {"w": "friendliness", "b": [0.2946, 0.2072, 0.4309, 0.2223]}, {"w": "and", "b": [0.4422, 0.2072, 0.4763, 0.2223]}, {"w": "kindness", "b": [0.4876, 0.2072, 0.5784, 0.2223]}, {"w": "of", "b": [0.5898, 0.2072, 0.6125, 0.2223]}, {"w": "a", "b": [0.6238, 0.2072, 0.6352, 0.2223]}, {"w": "heart", "b": [0.6465, 0.2072, 0.7033, 0.2223]}, {"w": "are", "b": [0.7146, 0.2072, 0.7487, 0.2223]}, {"w": "the", "b": [0.7601, 0.2072, 0.7941, 0.2223]}, {"w": "part", "b": [0.8055, 0.2072, 0.8509, 0.2223]}, {"w": "of", "b": [0.1357, 0.2223, 0.1584, 0.2375]}, {"w": "the", "b": [0.1698, 0.2223, 0.2038, 0.2375]}, {"w": "soul", "b": [0.2152, 0.2223, 0.2606, 0.2375]}, {"w": "who", "b": [0.1357, 0.2375, 0.1698, 0.2526]}, {"w": "have", "b": [0.1811, 0.2375, 0.2265, 0.2526]}, {"w": "been", "b": [0.2379, 0.2375, 0.2833, 0.2526]}, {"w": "the", "b": [0.2946, 0.2375, 0.3287, 0.2526]}, {"w": "art", "b": [0.34, 0.2375, 0.3741, 0.2526]}, {"w": "of", "b": [0.3855, 0.2375, 0.4082, 0.2526]}, {"w": "the", "b": [0.4195, 0.2375, 0.4536, 0.2526]}, {"w": "philosophers,", "b": [0.4649, 0.2375, 0.6125, 0.2526]}, {"w": "and", "b": [0.6238, 0.2375, 0.6579, 0.2526]}, {"w": "which", "b": [0.6692, 0.2375, 0.726, 0.2526]}, {"w": "the", "b": [0.7374, 0.2375, 0.7714, 0.2526]}, {"w": "one", "b": [0.7828, 0.2375, 0.8168, 0.2526]}, {"w": "won't", "b": [0.1357, 0.2526, 0.1925, 0.2678]}, {"w": "say,", "b": [0.2038, 0.2526, 0.2492, 0.2678]}, {"w": "which", "b": [0.2606, 0.2526, 0.3173, 0.2678]}, {"w": "is", "b": [0.3287, 0.2526, 0.3514, 0.2678]}, {"w": "it", "b": [0.3628, 0.2526, 0.3855, 0.2678]}, {"w": "the", "b": [0.3968, 0.2526, 0.4309, 0.2678]}, {"w": "higher", "b": [0.4422, 0.2526, 0.5103, 0.2678]}, {"w": "the", "b": [0.5217, 0.2526, 0.5557, 0.2678]}, {"w": "and", "b": [0.5671, 0.2526, 0.6011, 0.2678]}, {"w": "with", "b": [0.6125, 0.2526, 0.6579, 0.2678]}, {"w": "religion", "b": [0.6692, 0.2526, 0.7601, 0.2678]}, {"w": "of", "b": [0.7714, 0.2526, 0.7941, 0.2678]}, {"w": "the", "b": [0.8055, 0.2526, 0.8395, 0.2678]}, {"w": "frences.", "b": [0.1357, 0.2678, 0.2265, 0.2829]}, {"w": "the", "b": [0.1357, 0.283, 0.1698, 0.2981]}, {"w": "life", "b": [0.1811, 0.283, 0.2265, 0.2981]}, {"w": "of", "b": [0.2379, 0.283, 0.2606, 0.2981]}, {"w": "the", "b": [0.2719, 0.283, 0.306, 0.2981]}, {"w": "spirit", "b": [0.3173, 0.283, 0.3855, 0.2981]}, {"w": "among", "b": [0.3968, 0.283, 0.4536, 0.2981]}, {"w": "the", "b": [0.4649, 0.283, 0.499, 0.2981]}, {"w": "most", "b": [0.5103, 0.283, 0.5557, 0.2981]}, {"w": "continuess", "b": [0.5671, 0.283, 0.6806, 0.2981]}, {"w": "of", "b": [0.6919, 0.283, 0.7146, 0.2981]}, {"w": "the", "b": [0.726, 0.283, 0.7601, 0.2981]}, {"w": "strengther", "b": [0.1357, 0.2981, 0.2492, 0.3133]}, {"w": "of", "b": [0.2606, 0.2981, 0.2833, 0.3133]}, {"w": "the", "b": [0.2946, 0.2981, 0.3287, 0.3133]}, {"w": "sense", "b": [0.34, 0.2981, 0.3968, 0.3133]}, {"w": "the", "b": [0.4082, 0.2981, 0.4422, 0.3133]}, {"w": "conscience", "b": [0.4536, 0.2981, 0.5671, 0.3133]}, {"w": "of", "b": [0.5784, 0.2981, 0.6011, 0.3133]}, {"w": "men", "b": [0.6125, 0.2981, 0.6465, 0.3133]}, {"w": "of", "b": [0.6579, 0.2981, 0.6806, 0.3133]}, {"w": "precisely", "b": [0.6919, 0.2981, 0.7941, 0.3133]}, {"w": "before", "b": [0.1357, 0.3133, 0.2038, 0.3284]}, {"w": "enough", "b": [0.2152, 0.3133, 0.2833, 0.3284]}, {"w": "presumption,", "b": [0.1357, 0.3284, 0.2719, 0.3436]}, {"w": "and", "b": [0.2833, 0.3284, 0.3173, 0.3436]}, {"w": "can", "b": [0.3287, 0.3284, 0.3628, 0.3436]}, {"w": "mankind,", "b": [0.3741, 0.3284, 0.4649, 0.3436]}, {"w": "and", "b": [0.4763, 0.3284, 0.5103, 0.3436]}, {"w": "something", "b": [0.5217, 0.3284, 0.6238, 0.3436]}, {"w": "the", "b": [0.6352, 0.3284, 0.6692, 0.3436]}, {"w": "conceptions,", "b": [0.6806, 0.3284, 0.8168, 0.3436]}, {"w": "the", "b": [0.8282, 0.3284, 0.8622, 0.3436]}, {"w": "subjection", "b": [0.1357, 0.3436, 0.2492, 0.3587]}, {"w": "of", "b": [0.2606, 0.3436, 0.2833, 0.3587]}, {"w": "the", "b": [0.2946, 0.3436, 0.3287, 0.3587]}, {"w": "sense", "b": [0.34, 0.3436, 0.3968, 0.3587]}, {"w": "and", "b": [0.4082, 0.3436, 0.4422, 0.3587]}, {"w": "suffering", "b": [0.4536, 0.3436, 0.5557, 0.3587]}, {"w": "and", "b": [0.5671, 0.3436, 0.6011, 0.3587]}, {"w": "the", "b": [0.6125, 0.3436, 0.6465, 0.3587]}]}, {"id": "b_3", "type": "equation", "text": "And here’s temperature=1.0:", "words": [{"w": "And", "b": [0.1294, 0.3816, 0.1729, 0.4013]}, {"w": "here’s", "b": [0.1792, 0.3816, 0.2394, 0.4013]}, {"w": "temperature=1.0:", "b": [0.2457, 0.3816, 0.4798, 0.4028]}]}, {"id": "b_4", "type": "paragraph", "text": "cheerfulness, friendliness and kindness of a heart are spiritual by the ciuture for the entalled is, he astraged, or errors to our you idstood--and it needs, to think by spars to whole the amvives of the newoatly, prefectly raals! it was name, for example but voludd atu-especity\"--or rank onee, or even all \"solett increessic of the world and implussional tragedy experience, transf, or insiderar,--must hast if desires of the strubction is be stronges", "words": [{"w": "cheerfulness,", "b": [0.1357, 0.4202, 0.2833, 0.4354]}, {"w": "friendliness", "b": [0.2946, 0.4202, 0.4309, 0.4354]}, {"w": "and", "b": [0.4422, 0.4202, 0.4763, 0.4354]}, {"w": "kindness", "b": [0.4876, 0.4202, 0.5784, 0.4354]}, {"w": "of", "b": [0.5898, 0.4202, 0.6125, 0.4354]}, {"w": "a", "b": [0.6238, 0.4202, 0.6352, 0.4354]}, {"w": "heart", "b": [0.6465, 0.4202, 0.7033, 0.4354]}, {"w": "are", "b": [0.7146, 0.4202, 0.7487, 0.4354]}, {"w": "spiritual", "b": [0.7601, 0.4202, 0.8622, 0.4354]}, {"w": "by", "b": [0.1357, 0.4354, 0.1584, 0.4505]}, {"w": "the", "b": [0.1698, 0.4354, 0.2038, 0.4505]}, {"w": "ciuture", "b": [0.1357, 0.4505, 0.2152, 0.4657]}, {"w": "for", "b": [0.2265, 0.4505, 0.2606, 0.4657]}, {"w": "the", "b": [0.2719, 0.4505, 0.306, 0.4657]}, {"w": "entalled", "b": [0.1357, 0.4657, 0.2265, 0.4808]}, {"w": "is,", "b": [0.2379, 0.4657, 0.2719, 0.4808]}, {"w": "he", "b": [0.2833, 0.4657, 0.306, 0.4808]}, {"w": "astraged,", "b": [0.3173, 0.4657, 0.4195, 0.4808]}, {"w": "or", "b": [0.4309, 0.4657, 0.4536, 0.4808]}, {"w": "errors", "b": [0.4649, 0.4657, 0.533, 0.4808]}, {"w": "to", "b": [0.5444, 0.4657, 0.5671, 0.4808]}, {"w": "our", "b": [0.5784, 0.4657, 0.6125, 0.4808]}, {"w": "you", "b": [0.6238, 0.4657, 0.6579, 0.4808]}, {"w": "idstood--and", "b": [0.6692, 0.4657, 0.8055, 0.4808]}, {"w": "it", "b": [0.8168, 0.4657, 0.8395, 0.4808]}, {"w": "needs,", "b": [0.1357, 0.4808, 0.2038, 0.496]}, {"w": "to", "b": [0.1357, 0.496, 0.1584, 0.5111]}, {"w": "think", "b": [0.1698, 0.496, 0.2265, 0.5111]}, {"w": "by", "b": [0.2379, 0.496, 0.2606, 0.5111]}, {"w": "spars", "b": [0.2719, 0.496, 0.3287, 0.5111]}, {"w": "to", "b": [0.34, 0.496, 0.3628, 0.5111]}, {"w": "whole", "b": [0.3741, 0.496, 0.4309, 0.5111]}, {"w": "the", "b": [0.4422, 0.496, 0.4763, 0.5111]}, {"w": "amvives", "b": [0.4876, 0.496, 0.5671, 0.5111]}, {"w": "of", "b": [0.5784, 0.496, 0.6011, 0.5111]}, {"w": "the", "b": [0.6125, 0.496, 0.6465, 0.5111]}, {"w": "newoatly,", "b": [0.6579, 0.496, 0.7601, 0.5111]}, {"w": "prefectly", "b": [0.1357, 0.5111, 0.2379, 0.5263]}, {"w": "raals!", "b": [0.1357, 0.5263, 0.2038, 0.5414]}, {"w": "it", "b": [0.2152, 0.5263, 0.2379, 0.5414]}, {"w": "was", "b": [0.2492, 0.5263, 0.2833, 0.5414]}, {"w": "name,", "b": [0.1357, 0.5414, 0.1925, 0.5566]}, {"w": "for", "b": [0.2038, 0.5414, 0.2379, 0.5566]}, {"w": "example", "b": [0.2492, 0.5414, 0.3287, 0.5566]}, {"w": "but", "b": [0.34, 0.5414, 0.3741, 0.5566]}, {"w": "voludd", "b": [0.3855, 0.5414, 0.4536, 0.5566]}, {"w": "atu-especity\"--or", "b": [0.4649, 0.5414, 0.6579, 0.5566]}, {"w": "rank", "b": [0.6692, 0.5414, 0.7146, 0.5566]}, {"w": "onee,", "b": [0.726, 0.5414, 0.7828, 0.5566]}, {"w": "or", "b": [0.7941, 0.5414, 0.8168, 0.5566]}, {"w": "even", "b": [0.1357, 0.5566, 0.1811, 0.5717]}, {"w": "all", "b": [0.1925, 0.5566, 0.2265, 0.5717]}, {"w": "\"solett", "b": [0.1357, 0.5717, 0.2152, 0.5869]}, {"w": "increessic", "b": [0.2265, 0.5717, 0.34, 0.5869]}, {"w": "of", "b": [0.3514, 0.5717, 0.3741, 0.5869]}, {"w": "the", "b": [0.3855, 0.5717, 0.4195, 0.5869]}, {"w": "world", "b": [0.4309, 0.5717, 0.4876, 0.5869]}, {"w": "and", "b": [0.499, 0.5717, 0.533, 0.5869]}, {"w": "implussional", "b": [0.1357, 0.5869, 0.2719, 0.602]}, {"w": "tragedy", "b": [0.2833, 0.5869, 0.3628, 0.602]}, {"w": "experience,", "b": [0.3741, 0.5869, 0.499, 0.602]}, {"w": "transf,", "b": [0.5103, 0.5869, 0.5898, 0.602]}, {"w": "or", "b": [0.6011, 0.5869, 0.6238, 0.602]}, {"w": "insiderar,--must", "b": [0.6352, 0.5869, 0.8168, 0.602]}, {"w": "hast", "b": [0.1357, 0.602, 0.1811, 0.6172]}, {"w": "if", "b": [0.1357, 0.6172, 0.1584, 0.6323]}, {"w": "desires", "b": [0.1698, 0.6172, 0.2492, 0.6323]}, {"w": "of", "b": [0.2606, 0.6172, 0.2833, 0.6323]}, {"w": "the", "b": [0.2946, 0.6172, 0.3287, 0.6323]}, {"w": "strubction", "b": [0.34, 0.6172, 0.4536, 0.6323]}, {"w": "is", "b": [0.4649, 0.6172, 0.4876, 0.6323]}, {"w": "be", "b": [0.499, 0.6172, 0.5217, 0.6323]}, {"w": "stronges", "b": [0.533, 0.6172, 0.6238, 0.6323]}]}, {"id": "b_5", "type": "paragraph", "text": "As you can see, a low temperature value results in extremely repetitive and predictable text, but local structure is highly realistic: in particular, all words (a word being a local pattern of characters) are real English words. With higher temperatures, the generated text becomes more interesting, surprising, even creative; it sometimes invents completely new words that sound somewhat plausible (such as eterned and troveration). With a high temperature, the local structure starts to break down, and most words look like semi-random strings of characters. Without a doubt, 0.5 is the most interesting temperature for text generation in this specific setup. Always experiment with multiple sampling strategies! A clever balance between learned structure and randomness is what makes generation interesting.", "words": [{"w": "As", "b": [0.1294, 0.6552, 0.1574, 0.675]}, {"w": "you", "b": [0.1637, 0.6552, 0.2016, 0.675]}, {"w": "can", "b": [0.2079, 0.6552, 0.2429, 0.675]}, {"w": "see,", "b": [0.2492, 0.6552, 0.2877, 0.675]}, {"w": "a", "b": [0.294, 0.6552, 0.3052, 0.675]}, {"w": "low", "b": [0.3115, 0.6552, 0.3494, 0.675]}, {"w": "temperature", "b": [0.3557, 0.6552, 0.4762, 0.675]}, {"w": "value", "b": [0.4825, 0.6552, 0.5371, 0.675]}, {"w": "results", "b": [0.5434, 0.6552, 0.6093, 0.675]}, {"w": "in", "b": [0.6156, 0.6552, 0.6352, 0.675]}, {"w": "extremely", "b": [0.6415, 0.6552, 0.7424, 0.675]}, {"w": "repetitive", "b": [0.7487, 0.6552, 0.844, 0.675]}, {"w": "and", "b": [0.1294, 0.6757, 0.1658, 0.6955]}, {"w": "predictable", "b": [0.1721, 0.6757, 0.2842, 0.6955]}, {"w": "text,", "b": [0.2905, 0.6757, 0.3347, 0.6955]}, {"w": "but", "b": [0.341, 0.6757, 0.3732, 0.6955]}, {"w": "local", "b": [0.3795, 0.6757, 0.4286, 0.6955]}, {"w": "structure", "b": [0.4349, 0.6757, 0.5231, 0.6955]}, {"w": "is", "b": [0.5294, 0.6757, 0.5463, 0.6955]}, {"w": "highly", "b": [0.5526, 0.6757, 0.6171, 0.6955]}, {"w": "realistic:", "b": [0.6233, 0.6757, 0.7101, 0.6955]}, {"w": "in", "b": [0.7164, 0.6757, 0.7361, 0.6955]}, {"w": "particular,", "b": [0.7424, 0.6757, 0.8443, 0.6955]}, {"w": "all", "b": [0.1294, 0.6962, 0.1546, 0.716]}, {"w": "words", "b": [0.1609, 0.6962, 0.2226, 0.716]}, {"w": "(a", "b": [0.2289, 0.6962, 0.2485, 0.716]}, {"w": "word", "b": [0.2548, 0.6962, 0.3057, 0.716]}, {"w": "being", "b": [0.312, 0.6962, 0.3681, 0.716]}, {"w": "a", "b": [0.3744, 0.6962, 0.3856, 0.716]}, {"w": "local", "b": [0.3919, 0.6962, 0.4409, 0.716]}, {"w": "pattern", "b": [0.4472, 0.6962, 0.5173, 0.716]}, {"w": "of", "b": [0.5236, 0.6962, 0.5446, 0.716]}, {"w": "characters)", "b": [0.5509, 0.6962, 0.6616, 0.716]}, {"w": "are", "b": [0.6679, 0.6962, 0.6987, 0.716]}, {"w": "real", "b": [0.705, 0.6962, 0.7428, 0.716]}, {"w": "English", "b": [0.7491, 0.6962, 0.8262, 0.716]}, {"w": "words.", "b": [0.1294, 0.7167, 0.1974, 0.7365]}, {"w": "With", "b": [0.2037, 0.7167, 0.2531, 0.7365]}, {"w": "higher", "b": [0.2594, 0.7167, 0.3239, 0.7365]}, {"w": "temperatures,", "b": [0.3302, 0.7167, 0.4668, 0.7365]}, {"w": "the", "b": [0.4731, 0.7167, 0.5039, 0.7365]}, {"w": "generated", "b": [0.5102, 0.7167, 0.6083, 0.7365]}, {"w": "text", "b": [0.6146, 0.7167, 0.6524, 0.7365]}, {"w": "becomes", "b": [0.6587, 0.7167, 0.747, 0.7365]}, {"w": "more", "b": [0.7533, 0.7167, 0.8051, 0.7365]}, {"w": "interesting,", "b": [0.1294, 0.7372, 0.2422, 0.757]}, {"w": "surprising,", "b": [0.2485, 0.7372, 0.3557, 0.757]}, {"w": "even", "b": [0.362, 0.7372, 0.4096, 0.757]}, {"w": "creative;", "b": [0.416, 0.7372, 0.5028, 0.757]}, {"w": "it", "b": [0.5091, 0.7372, 0.5231, 0.757]}, {"w": "sometimes", "b": [0.5294, 0.7372, 0.6374, 0.757]}, {"w": "invents", "b": [0.6437, 0.7372, 0.7165, 0.757]}, {"w": "completely", "b": [0.7229, 0.7372, 0.835, 0.757]}, {"w": "new", "b": [0.1294, 0.7577, 0.1714, 0.7775]}, {"w": "words", "b": [0.1777, 0.7577, 0.2394, 0.7775]}, {"w": "that", "b": [0.2457, 0.7577, 0.2835, 0.7775]}, {"w": "sound", "b": [0.2898, 0.7577, 0.3501, 0.7775]}, {"w": "somewhat", "b": [0.3564, 0.7577, 0.4587, 0.7775]}, {"w": "plausible", "b": [0.465, 0.7577, 0.5561, 0.7775]}, {"w": "(such", "b": [0.5624, 0.7577, 0.6171, 0.7775]}, {"w": "as", "b": [0.6234, 0.7577, 0.6444, 0.7775]}, {"w": "eterned", "b": [0.6506, 0.7577, 0.7263, 0.7775]}, {"w": "and", "b": [0.7326, 0.7577, 0.769, 0.7775]}, {"w": "troveration).", "b": [0.1294, 0.7782, 0.2567, 0.798]}, {"w": "With", "b": [0.263, 0.7782, 0.3124, 0.798]}, {"w": "a", "b": [0.3187, 0.7782, 0.3299, 0.798]}, {"w": "high", "b": [0.3362, 0.7782, 0.3811, 0.798]}, {"w": "temperature,", "b": [0.3874, 0.7782, 0.5142, 0.798]}, {"w": "the", "b": [0.5205, 0.7782, 0.5513, 0.798]}, {"w": "local", "b": [0.5576, 0.7782, 0.6066, 0.798]}, {"w": "structure", "b": [0.613, 0.7782, 0.7012, 0.798]}, {"w": "starts", "b": [0.7075, 0.7782, 0.7608, 0.798]}, {"w": "to", "b": [0.7671, 0.7782, 0.7867, 0.798]}, {"w": "break", "b": [0.793, 0.7782, 0.849, 0.798]}, {"w": "down,", "b": [0.1294, 0.7987, 0.1918, 0.8185]}, {"w": "and", "b": [0.1981, 0.7987, 0.2345, 0.8185]}, {"w": "most", "b": [0.2408, 0.7987, 0.2899, 0.8185]}, {"w": "words", "b": [0.2962, 0.7987, 0.3578, 0.8185]}, {"w": "look", "b": [0.3641, 0.7987, 0.409, 0.8185]}, {"w": "like", "b": [0.4153, 0.7987, 0.4531, 0.8185]}, {"w": "semi-random", "b": [0.4594, 0.7987, 0.5926, 0.8185]}, {"w": "strings", "b": [0.5989, 0.7987, 0.6661, 0.8185]}, {"w": "of", "b": [0.6724, 0.7987, 0.6935, 0.8185]}, {"w": "characters.", "b": [0.6998, 0.7987, 0.8083, 0.8185]}, {"w": "Without", "b": [0.1294, 0.8192, 0.2111, 0.839]}, {"w": "a", "b": [0.2174, 0.8192, 0.2286, 0.839]}, {"w": "doubt,", "b": [0.2349, 0.8192, 0.2987, 0.839]}, {"w": "0.5", "b": [0.305, 0.8192, 0.3365, 0.839]}, {"w": "is", "b": [0.3428, 0.8192, 0.3596, 0.839]}, {"w": "the", "b": [0.3659, 0.8192, 0.3968, 0.839]}, {"w": "most", "b": [0.4031, 0.8192, 0.4521, 0.839]}, {"w": "interesting", "b": [0.4585, 0.8192, 0.565, 0.839]}, {"w": "temperature", "b": [0.5713, 0.8192, 0.6917, 0.839]}, {"w": "for", "b": [0.698, 0.8192, 0.7275, 0.839]}, {"w": "text", "b": [0.7338, 0.8192, 0.7716, 0.839]}, {"w": "generation", "b": [0.1294, 0.8397, 0.2359, 0.8595]}, {"w": "in", "b": [0.2422, 0.8397, 0.2618, 0.8595]}, {"w": "this", "b": [0.2681, 0.8397, 0.3046, 0.8595]}, {"w": "specific", "b": [0.3109, 0.8397, 0.3893, 0.8595]}, {"w": "setup.", "b": [0.3956, 0.8397, 0.4552, 0.8595]}, {"w": "Always", "b": [0.4615, 0.8397, 0.5386, 0.8595]}, {"w": "experiment", "b": [0.5449, 0.8397, 0.6584, 0.8595]}, {"w": "with", "b": [0.6647, 0.8397, 0.7095, 0.8595]}, {"w": "multiple", "b": [0.7158, 0.8397, 0.7999, 0.8595]}, {"w": "sampling", "b": [0.1294, 0.8602, 0.2219, 0.88]}, {"w": "strategies!", "b": [0.2282, 0.8602, 0.3319, 0.88]}, {"w": "A", "b": [0.3382, 0.8602, 0.3564, 0.88]}, {"w": "clever", "b": [0.3627, 0.8602, 0.4244, 0.88]}, {"w": "balance", "b": [0.4307, 0.8602, 0.5077, 0.88]}, {"w": "between", "b": [0.514, 0.8602, 0.5981, 0.88]}, {"w": "learned", "b": [0.6044, 0.8602, 0.6786, 0.88]}, {"w": "structure", "b": [0.6849, 0.8602, 0.7732, 0.88]}, {"w": "and", "b": [0.7795, 0.8602, 0.8159, 0.88]}, {"w": "randomness", "b": [0.1294, 0.8807, 0.2499, 0.9005]}, {"w": "is", "b": [0.2562, 0.8807, 0.273, 0.9005]}, {"w": "what", "b": [0.2794, 0.8807, 0.3284, 0.9005]}, {"w": "makes", "b": [0.3347, 0.8807, 0.3992, 0.9005]}, {"w": "generation", "b": [0.4055, 0.8807, 0.5119, 0.9005]}, {"w": "interesting.", "b": [0.5182, 0.8807, 0.6311, 0.9005]}]}]}, {"page": 364, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Note that by training a bigger model, longer, on more data, you can achieve generated samples that look much more coherent and realistic than this one. But, of course, don’t expect to ever generate any meaningful text, other than by random chance: all you’re doing is sampling data from a statistical model of which characters come after which characters. Language is a communication channel, and there’s a distinction between what communications are about and the statistical structure of the messages in which communications are encoded. To evidence this distinction, here’s a thought experiment: what if human language did a better job of compressing communications, much like computers do with most digital communications? Language would be no less meaningful, but it would lack any intrinsic statistical structure, thus making it impossible to learn a language model as you just did.", "words": [{"w": "Note", "b": [0.1294, 0.0857, 0.1785, 0.1054]}, {"w": "that", "b": [0.1848, 0.0857, 0.2226, 0.1054]}, {"w": "by", "b": [0.2289, 0.0857, 0.2541, 0.1054]}, {"w": "training", "b": [0.2604, 0.0857, 0.3389, 0.1054]}, {"w": "a", "b": [0.3452, 0.0857, 0.3564, 0.1054]}, {"w": "bigger", "b": [0.3627, 0.0857, 0.4272, 0.1054]}, {"w": "model,", "b": [0.4335, 0.0857, 0.5029, 0.1054]}, {"w": "longer,", "b": [0.5092, 0.0857, 0.5788, 0.1054]}, {"w": "on", "b": [0.5852, 0.0857, 0.6104, 0.1054]}, {"w": "more", "b": [0.6167, 0.0857, 0.6685, 0.1054]}, {"w": "data,", "b": [0.6748, 0.0857, 0.7232, 0.1054]}, {"w": "you", "b": [0.7295, 0.0857, 0.7673, 0.1054]}, {"w": "can", "b": [0.7736, 0.0857, 0.8086, 0.1054]}, {"w": "achieve", "b": [0.1294, 0.1062, 0.2065, 0.1259]}, {"w": "generated", "b": [0.2128, 0.1062, 0.3108, 0.1259]}, {"w": "samples", "b": [0.3171, 0.1062, 0.3984, 0.1259]}, {"w": "that", "b": [0.4047, 0.1062, 0.4425, 0.1259]}, {"w": "look", "b": [0.4488, 0.1062, 0.4937, 0.1259]}, {"w": "much", "b": [0.5, 0.1062, 0.5561, 0.1259]}, {"w": "more", "b": [0.5624, 0.1062, 0.6142, 0.1259]}, {"w": "coherent", "b": [0.6205, 0.1062, 0.7074, 0.1259]}, {"w": "and", "b": [0.7136, 0.1062, 0.75, 0.1259]}, {"w": "realistic", "b": [0.7563, 0.1062, 0.8362, 0.1259]}, {"w": "than", "b": [0.1294, 0.1267, 0.1729, 0.1464]}, {"w": "this", "b": [0.1792, 0.1267, 0.2156, 0.1464]}, {"w": "one.", "b": [0.2219, 0.1267, 0.2646, 0.1464]}, {"w": "But,", "b": [0.271, 0.1267, 0.3137, 0.1464]}, {"w": "of", "b": [0.32, 0.1267, 0.341, 0.1464]}, {"w": "course,", "b": [0.3473, 0.1267, 0.4195, 0.1464]}, {"w": "don’t", "b": [0.4258, 0.1267, 0.4786, 0.1464]}, {"w": "expect", "b": [0.4849, 0.1267, 0.5507, 0.1464]}, {"w": "to", "b": [0.557, 0.1267, 0.5766, 0.1464]}, {"w": "ever", "b": [0.5829, 0.1267, 0.6264, 0.1464]}, {"w": "generate", "b": [0.6327, 0.1267, 0.7181, 0.1464]}, {"w": "any", "b": [0.7244, 0.1267, 0.7608, 0.1464]}, {"w": "meaningful", "b": [0.1294, 0.1472, 0.2443, 0.1669]}, {"w": "text,", "b": [0.2506, 0.1472, 0.2948, 0.1669]}, {"w": "other", "b": [0.3011, 0.1472, 0.3529, 0.1669]}, {"w": "than", "b": [0.3592, 0.1472, 0.4027, 0.1669]}, {"w": "by", "b": [0.409, 0.1472, 0.4342, 0.1669]}, {"w": "random", "b": [0.4405, 0.1472, 0.5176, 0.1669]}, {"w": "chance:", "b": [0.5239, 0.1472, 0.6009, 0.1669]}, {"w": "all", "b": [0.6071, 0.1472, 0.6324, 0.1669]}, {"w": "you’re", "b": [0.6387, 0.1472, 0.7045, 0.1669]}, {"w": "doing", "b": [0.7108, 0.1472, 0.7683, 0.1669]}, {"w": "is", "b": [0.7746, 0.1472, 0.7914, 0.1669]}, {"w": "sampling", "b": [0.1294, 0.1677, 0.2219, 0.1874]}, {"w": "data", "b": [0.2282, 0.1677, 0.2702, 0.1874]}, {"w": "from", "b": [0.2766, 0.1677, 0.3256, 0.1874]}, {"w": "a", "b": [0.3319, 0.1677, 0.3431, 0.1874]}, {"w": "statistical", "b": [0.3494, 0.1677, 0.4447, 0.1874]}, {"w": "model", "b": [0.451, 0.1677, 0.5141, 0.1874]}, {"w": "of", "b": [0.5204, 0.1677, 0.5414, 0.1874]}, {"w": "which", "b": [0.5477, 0.1677, 0.6094, 0.1874]}, {"w": "characters", "b": [0.6157, 0.1677, 0.7179, 0.1874]}, {"w": "come", "b": [0.7242, 0.1677, 0.7788, 0.1874]}, {"w": "after", "b": [0.7852, 0.1677, 0.8314, 0.1874]}, {"w": "which", "b": [0.1294, 0.1882, 0.1911, 0.2079]}, {"w": "characters.", "b": [0.1974, 0.1882, 0.3059, 0.2079]}, {"w": "Language", "b": [0.3122, 0.1882, 0.4117, 0.2079]}, {"w": "is", "b": [0.418, 0.1882, 0.4348, 0.2079]}, {"w": "a", "b": [0.4411, 0.1882, 0.4523, 0.2079]}, {"w": "communication", "b": [0.4586, 0.1882, 0.6155, 0.2079]}, {"w": "channel,", "b": [0.6218, 0.1882, 0.7066, 0.2079]}, {"w": "and", "b": [0.7129, 0.1882, 0.7493, 0.2079]}, {"w": "there’s", "b": [0.7556, 0.1882, 0.8228, 0.2079]}, {"w": "a", "b": [0.8291, 0.1882, 0.8403, 0.2079]}, {"w": "distinction", "b": [0.1294, 0.2087, 0.2359, 0.2284]}, {"w": "between", "b": [0.2422, 0.2087, 0.3263, 0.2284]}, {"w": "what", "b": [0.3326, 0.2087, 0.3816, 0.2284]}, {"w": "communications", "b": [0.388, 0.2087, 0.5547, 0.2284]}, {"w": "are", "b": [0.561, 0.2087, 0.5918, 0.2284]}, {"w": "about", "b": [0.5981, 0.2087, 0.6542, 0.2284]}, {"w": "and", "b": [0.6605, 0.2087, 0.6969, 0.2284]}, {"w": "the", "b": [0.7032, 0.2087, 0.734, 0.2284]}, {"w": "statistical", "b": [0.7404, 0.2087, 0.8357, 0.2284]}, {"w": "structure", "b": [0.1294, 0.2292, 0.2177, 0.2489]}, {"w": "of", "b": [0.224, 0.2292, 0.245, 0.2489]}, {"w": "the", "b": [0.2513, 0.2292, 0.2821, 0.2489]}, {"w": "messages", "b": [0.2884, 0.2292, 0.3837, 0.2489]}, {"w": "in", "b": [0.39, 0.2292, 0.4096, 0.2489]}, {"w": "which", "b": [0.4159, 0.2292, 0.4776, 0.2489]}, {"w": "communications", "b": [0.4839, 0.2292, 0.6507, 0.2489]}, {"w": "are", "b": [0.657, 0.2292, 0.6878, 0.2489]}, {"w": "encoded.", "b": [0.6941, 0.2292, 0.7844, 0.2489]}, {"w": "To", "b": [0.7907, 0.2292, 0.8169, 0.2489]}, {"w": "evidence", "b": [0.1294, 0.2497, 0.2191, 0.2694]}, {"w": "this", "b": [0.2254, 0.2497, 0.2618, 0.2694]}, {"w": "distinction,", "b": [0.2681, 0.2497, 0.381, 0.2694]}, {"w": "here’s", "b": [0.3873, 0.2497, 0.4475, 0.2694]}, {"w": "a", "b": [0.4538, 0.2497, 0.465, 0.2694]}, {"w": "thought", "b": [0.4713, 0.2497, 0.5484, 0.2694]}, {"w": "experiment:", "b": [0.5547, 0.2497, 0.6752, 0.2694]}, {"w": "what", "b": [0.6815, 0.2497, 0.7305, 0.2694]}, {"w": "if", "b": [0.7368, 0.2497, 0.7522, 0.2694]}, {"w": "human", "b": [0.7585, 0.2497, 0.8272, 0.2694]}, {"w": "language", "b": [0.1294, 0.2702, 0.2205, 0.2899]}, {"w": "did", "b": [0.2268, 0.2702, 0.259, 0.2899]}, {"w": "a", "b": [0.2653, 0.2702, 0.2765, 0.2899]}, {"w": "better", "b": [0.2828, 0.2702, 0.3403, 0.2899]}, {"w": "job", "b": [0.3466, 0.2702, 0.3788, 0.2899]}, {"w": "of", "b": [0.3851, 0.2702, 0.4061, 0.2899]}, {"w": "compressing", "b": [0.4124, 0.2702, 0.5399, 0.2899]}, {"w": "communications,", "b": [0.5463, 0.2702, 0.7193, 0.2899]}, {"w": "much", "b": [0.7256, 0.2702, 0.7817, 0.2899]}, {"w": "like", "b": [0.788, 0.2702, 0.8258, 0.2899]}, {"w": "computers", "b": [0.1294, 0.2907, 0.2345, 0.3104]}, {"w": "do", "b": [0.2408, 0.2907, 0.266, 0.3104]}, {"w": "with", "b": [0.2723, 0.2907, 0.3172, 0.3104]}, {"w": "most", "b": [0.3235, 0.2907, 0.3726, 0.3104]}, {"w": "digital", "b": [0.3789, 0.2907, 0.4433, 0.3104]}, {"w": "communications?", "b": [0.4497, 0.2907, 0.6276, 0.3104]}, {"w": "Language", "b": [0.6339, 0.2907, 0.7334, 0.3104]}, {"w": "would", "b": [0.7397, 0.2907, 0.8028, 0.3104]}, {"w": "be", "b": [0.8091, 0.2907, 0.8329, 0.3104]}, {"w": "no", "b": [0.8391, 0.2907, 0.8643, 0.3104]}, {"w": "less", "b": [0.1294, 0.3112, 0.1673, 0.3309]}, {"w": "meaningful,", "b": [0.1736, 0.3112, 0.2948, 0.3309]}, {"w": "but", "b": [0.3011, 0.3112, 0.3333, 0.3309]}, {"w": "it", "b": [0.3396, 0.3112, 0.3536, 0.3309]}, {"w": "would", "b": [0.36, 0.3112, 0.423, 0.3309]}, {"w": "lack", "b": [0.4293, 0.3112, 0.4713, 0.3309]}, {"w": "any", "b": [0.4777, 0.3112, 0.5141, 0.3309]}, {"w": "intrinsic", "b": [0.5204, 0.3112, 0.6031, 0.3309]}, {"w": "statistical", "b": [0.6094, 0.3112, 0.7047, 0.3309]}, {"w": "structure,", "b": [0.711, 0.3112, 0.8056, 0.3309]}, {"w": "thus", "b": [0.8119, 0.3112, 0.8539, 0.3309]}, {"w": "making", "b": [0.1294, 0.3317, 0.2051, 0.3514]}, {"w": "it", "b": [0.2114, 0.3317, 0.2254, 0.3514]}, {"w": "impossible", "b": [0.2317, 0.3317, 0.3411, 0.3514]}, {"w": "to", "b": [0.3474, 0.3317, 0.367, 0.3514]}, {"w": "learn", "b": [0.3733, 0.3317, 0.4237, 0.3514]}, {"w": "a", "b": [0.43, 0.3317, 0.4412, 0.3514]}, {"w": "language", "b": [0.4475, 0.3317, 0.5386, 0.3514]}, {"w": "model", "b": [0.5449, 0.3317, 0.608, 0.3514]}, {"w": "as", "b": [0.6142, 0.3317, 0.6352, 0.3514]}, {"w": "you", "b": [0.6415, 0.3317, 0.6793, 0.3514]}, {"w": "just", "b": [0.6856, 0.3317, 0.7221, 0.3514]}, {"w": "did.", "b": [0.7284, 0.3317, 0.7669, 0.3514]}]}, {"id": "b_1", "type": "paragraph", "text": "8.1.5. Wrapping up", "words": [{"w": "8.1.5.", "b": [0.1294, 0.3789, 0.1862, 0.3987]}, {"w": "Wrapping", "b": [0.1925, 0.3789, 0.3028, 0.3987]}, {"w": "up", "b": [0.3091, 0.3789, 0.3371, 0.3987]}]}, {"id": "b_2", "type": "paragraph", "text": "You can generate discrete sequence data by training a model to predict the next tokens(s), given previous tokens. In the case of text, such a model is called a language model. It can be based on either words or characters. Sampling the next token requires balance between adhering to what the model judges likely, and introducing randomness. One way to handle this is the notion of softmax temperature. Always experiment with different temperatures to find the right one.", "words": [{"w": "You", "b": [0.1799, 0.4172, 0.2208, 0.437]}, {"w": "can", "b": [0.2271, 0.4172, 0.2621, 0.437]}, {"w": "generate", "b": [0.2684, 0.4172, 0.3538, 0.437]}, {"w": "discrete", "b": [0.3602, 0.4172, 0.4386, 0.437]}, {"w": "sequence", "b": [0.4449, 0.4172, 0.5374, 0.437]}, {"w": "data", "b": [0.5437, 0.4172, 0.5857, 0.437]}, {"w": "by", "b": [0.592, 0.4172, 0.6172, 0.437]}, {"w": "training", "b": [0.6235, 0.4172, 0.702, 0.437]}, {"w": "a", "b": [0.7083, 0.4172, 0.7195, 0.437]}, {"w": "model", "b": [0.7258, 0.4172, 0.7889, 0.437]}, {"w": "to", "b": [0.7952, 0.4172, 0.8148, 0.437]}, {"w": "predict", "b": [0.1799, 0.4377, 0.2499, 0.4575]}, {"w": "the", "b": [0.2562, 0.4377, 0.287, 0.4575]}, {"w": "next", "b": [0.2934, 0.4377, 0.3368, 0.4575]}, {"w": "tokens(s),", "b": [0.3431, 0.4377, 0.4419, 0.4575]}, {"w": "given", "b": [0.4482, 0.4377, 0.5042, 0.4575]}, {"w": "previous", "b": [0.5105, 0.4377, 0.5974, 0.4575]}, {"w": "tokens.", "b": [0.6037, 0.4377, 0.6759, 0.4575]}, {"w": "In", "b": [0.1799, 0.4582, 0.2009, 0.478]}, {"w": "the", "b": [0.2072, 0.4582, 0.238, 0.478]}, {"w": "case", "b": [0.2443, 0.4582, 0.2877, 0.478]}, {"w": "of", "b": [0.294, 0.4582, 0.315, 0.478]}, {"w": "text,", "b": [0.3214, 0.4582, 0.3655, 0.478]}, {"w": "such", "b": [0.3718, 0.4582, 0.418, 0.478]}, {"w": "a", "b": [0.4244, 0.4582, 0.4356, 0.478]}, {"w": "model", "b": [0.4419, 0.4582, 0.5049, 0.478]}, {"w": "is", "b": [0.5112, 0.4582, 0.5281, 0.478]}, {"w": "called", "b": [0.5344, 0.4582, 0.5946, 0.478]}, {"w": "a", "b": [0.6009, 0.4582, 0.6121, 0.478]}, {"w": "language", "b": [0.6183, 0.4582, 0.7122, 0.478]}, {"w": "model.", "b": [0.7185, 0.4582, 0.7865, 0.478]}, {"w": "It", "b": [0.7928, 0.4582, 0.8082, 0.478]}, {"w": "can", "b": [0.8145, 0.4582, 0.8495, 0.478]}, {"w": "be", "b": [0.1799, 0.4787, 0.2037, 0.4985]}, {"w": "based", "b": [0.21, 0.4787, 0.2674, 0.4985]}, {"w": "on", "b": [0.2737, 0.4787, 0.299, 0.4985]}, {"w": "either", "b": [0.3053, 0.4787, 0.3627, 0.4985]}, {"w": "words", "b": [0.369, 0.4787, 0.4307, 0.4985]}, {"w": "or", "b": [0.437, 0.4787, 0.458, 0.4985]}, {"w": "characters.", "b": [0.4643, 0.4787, 0.5728, 0.4985]}, {"w": "Sampling", "b": [0.1799, 0.4992, 0.2766, 0.519]}, {"w": "the", "b": [0.2829, 0.4992, 0.3137, 0.519]}, {"w": "next", "b": [0.32, 0.4992, 0.3635, 0.519]}, {"w": "token", "b": [0.3698, 0.4992, 0.4258, 0.519]}, {"w": "requires", "b": [0.4321, 0.4992, 0.5134, 0.519]}, {"w": "balance", "b": [0.5197, 0.4992, 0.5967, 0.519]}, {"w": "between", "b": [0.603, 0.4992, 0.6871, 0.519]}, {"w": "adhering", "b": [0.6934, 0.4992, 0.7816, 0.519]}, {"w": "to", "b": [0.788, 0.4992, 0.8076, 0.519]}, {"w": "what", "b": [0.8139, 0.4992, 0.8629, 0.519]}, {"w": "the", "b": [0.1799, 0.5197, 0.2107, 0.5395]}, {"w": "model", "b": [0.217, 0.5197, 0.2801, 0.5395]}, {"w": "judges", "b": [0.2864, 0.5197, 0.3522, 0.5395]}, {"w": "likely,", "b": [0.3585, 0.5197, 0.4206, 0.5395]}, {"w": "and", "b": [0.4269, 0.5197, 0.4634, 0.5395]}, {"w": "introducing", "b": [0.4697, 0.5197, 0.586, 0.5395]}, {"w": "randomness.", "b": [0.5923, 0.5197, 0.7191, 0.5395]}, {"w": "One", "b": [0.1799, 0.5402, 0.2219, 0.56]}, {"w": "way", "b": [0.2282, 0.5402, 0.2702, 0.56]}, {"w": "to", "b": [0.2765, 0.5402, 0.2962, 0.56]}, {"w": "handle", "b": [0.3025, 0.5402, 0.3697, 0.56]}, {"w": "this", "b": [0.376, 0.5402, 0.4125, 0.56]}, {"w": "is", "b": [0.4188, 0.5402, 0.4356, 0.56]}, {"w": "the", "b": [0.4419, 0.5402, 0.4727, 0.56]}, {"w": "notion", "b": [0.479, 0.5402, 0.5435, 0.56]}, {"w": "of", "b": [0.5498, 0.5402, 0.5708, 0.56]}, {"w": "softmax", "b": [0.5771, 0.5402, 0.6584, 0.56]}, {"w": "temperature.", "b": [0.6647, 0.5402, 0.7915, 0.56]}, {"w": "Always", "b": [0.1799, 0.5607, 0.2569, 0.5805]}, {"w": "experiment", "b": [0.2632, 0.5607, 0.3767, 0.5805]}, {"w": "with", "b": [0.383, 0.5607, 0.4279, 0.5805]}, {"w": "different", "b": [0.4342, 0.5607, 0.5206, 0.5805]}, {"w": "temperatures", "b": [0.5269, 0.5607, 0.6572, 0.5805]}, {"w": "to", "b": [0.6635, 0.5607, 0.6831, 0.5805]}, {"w": "find", "b": [0.6894, 0.5607, 0.73, 0.5805]}, {"w": "the", "b": [0.7363, 0.5607, 0.7672, 0.5805]}, {"w": "right", "b": [0.7735, 0.5607, 0.8211, 0.5805]}, {"w": "one.", "b": [0.8274, 0.5607, 0.8701, 0.5805]}]}, {"id": "b_3", "type": "paragraph", "text": "8.2. DeepDream", "words": [{"w": "8.2.", "b": [0.1294, 0.6176, 0.172, 0.6398]}, {"w": "DeepDream", "b": [0.1791, 0.6176, 0.3236, 0.6398]}]}, {"id": "b_4", "type": "paragraph", "text": "DeepDream is an artistic image-modification technique that uses the representations learned by convolutional neural networks. It was first released by Google in the summer of 2015, as an implementation written using the Caffe deep-learning library (this was several months before the first public release of TensorFlow).[4] It quickly became an internet sensation thanks to the trippy pictures it could generate (see, for example, figure 8.3), full of algorithmic pareidolia artifacts, bird feathers, and dog eyes—a byproduct of the fact that the DeepDream convnet was trained on ImageNet, where dog breeds and bird species are vastly overrepresented.", "words": [{"w": "DeepDream", "b": [0.1294, 0.6632, 0.2518, 0.683]}, {"w": "is", "b": [0.2581, 0.6632, 0.2749, 0.683]}, {"w": "an", "b": [0.2812, 0.6632, 0.305, 0.683]}, {"w": "artistic", "b": [0.3113, 0.6632, 0.38, 0.683]}, {"w": "image-modification", "b": [0.3863, 0.6632, 0.5853, 0.683]}, {"w": "technique", "b": [0.5916, 0.6632, 0.6897, 0.683]}, {"w": "that", "b": [0.696, 0.6632, 0.7338, 0.683]}, {"w": "uses", "b": [0.7401, 0.6632, 0.7835, 0.683]}, {"w": "the", "b": [0.7898, 0.6632, 0.8207, 0.683]}, {"w": "representations", "b": [0.1294, 0.6838, 0.2821, 0.7035]}, {"w": "learned", "b": [0.2884, 0.6838, 0.3627, 0.7035]}, {"w": "by", "b": [0.369, 0.6838, 0.3942, 0.7035]}, {"w": "convolutional", "b": [0.4005, 0.6838, 0.5393, 0.7035]}, {"w": "neural", "b": [0.5456, 0.6838, 0.6086, 0.7035]}, {"w": "networks.", "b": [0.6149, 0.6838, 0.7137, 0.7035]}, {"w": "It", "b": [0.72, 0.6838, 0.7354, 0.7035]}, {"w": "was", "b": [0.7417, 0.6838, 0.7809, 0.7035]}, {"w": "first", "b": [0.7872, 0.6838, 0.8278, 0.7035]}, {"w": "released", "b": [0.1294, 0.7042, 0.2121, 0.724]}, {"w": "by", "b": [0.2184, 0.7042, 0.2436, 0.724]}, {"w": "Google", "b": [0.2499, 0.7042, 0.3242, 0.724]}, {"w": "in", "b": [0.3305, 0.7042, 0.3501, 0.724]}, {"w": "the", "b": [0.3564, 0.7042, 0.3872, 0.724]}, {"w": "summer", "b": [0.3935, 0.7042, 0.4748, 0.724]}, {"w": "of", "b": [0.4811, 0.7042, 0.5021, 0.724]}, {"w": "2015,", "b": [0.5084, 0.7042, 0.5652, 0.724]}, {"w": "as", "b": [0.5715, 0.7042, 0.5925, 0.724]}, {"w": "an", "b": [0.5988, 0.7042, 0.6226, 0.724]}, {"w": "implementation", "b": [0.6289, 0.7042, 0.7873, 0.724]}, {"w": "written", "b": [0.7936, 0.7042, 0.8651, 0.724]}, {"w": "using", "b": [0.1294, 0.7248, 0.1841, 0.7445]}, {"w": "the", "b": [0.1904, 0.7248, 0.2212, 0.7445]}, {"w": "Caffe", "b": [0.2275, 0.7248, 0.2831, 0.7445]}, {"w": "deep-learning", "b": [0.2894, 0.7248, 0.4281, 0.7445]}, {"w": "library", "b": [0.4344, 0.7248, 0.5016, 0.7445]}, {"w": "(this", "b": [0.5079, 0.7248, 0.5528, 0.7445]}, {"w": "was", "b": [0.5591, 0.7248, 0.5983, 0.7445]}, {"w": "several", "b": [0.6046, 0.7248, 0.676, 0.7445]}, {"w": "months", "b": [0.6823, 0.7248, 0.7566, 0.7445]}, {"w": "before", "b": [0.7629, 0.7248, 0.8274, 0.7445]}, {"w": "the", "b": [0.8337, 0.7248, 0.8645, 0.7445]}, {"w": "first", "b": [0.1294, 0.747, 0.1701, 0.7668]}, {"w": "public", "b": [0.1764, 0.747, 0.2394, 0.7668]}, {"w": "release", "b": [0.2457, 0.747, 0.3158, 0.7668]}, {"w": "of", "b": [0.3221, 0.747, 0.3431, 0.7668]}, {"w": "TensorFlow).[4]", "b": [0.3494, 0.7448, 0.5063, 0.7668]}, {"w": "It", "b": [0.5125, 0.747, 0.528, 0.7668]}, {"w": "quickly", "b": [0.5343, 0.747, 0.6099, 0.7668]}, {"w": "became", "b": [0.6163, 0.747, 0.6933, 0.7668]}, {"w": "an", "b": [0.6996, 0.747, 0.7234, 0.7668]}, {"w": "internet", "b": [0.7297, 0.747, 0.8068, 0.7668]}, {"w": "sensation", "b": [0.1294, 0.7675, 0.2233, 0.7873]}, {"w": "thanks", "b": [0.2296, 0.7675, 0.2955, 0.7873]}, {"w": "to", "b": [0.3018, 0.7675, 0.3214, 0.7873]}, {"w": "the", "b": [0.3277, 0.7675, 0.3585, 0.7873]}, {"w": "trippy", "b": [0.3648, 0.7675, 0.4251, 0.7873]}, {"w": "pictures", "b": [0.4314, 0.7675, 0.5113, 0.7873]}, {"w": "it", "b": [0.5176, 0.7675, 0.5316, 0.7873]}, {"w": "could", "b": [0.5379, 0.7675, 0.594, 0.7873]}, {"w": "generate", "b": [0.6003, 0.7675, 0.6857, 0.7873]}, {"w": "(see,", "b": [0.692, 0.7675, 0.7389, 0.7873]}, {"w": "for", "b": [0.7452, 0.7675, 0.7747, 0.7873]}, {"w": "example,", "b": [0.1294, 0.788, 0.2212, 0.8078]}, {"w": "figure", "b": [0.2275, 0.788, 0.2877, 0.8078]}, {"w": "8.3),", "b": [0.294, 0.788, 0.3402, 0.8078]}, {"w": "full", "b": [0.3465, 0.788, 0.3816, 0.8078]}, {"w": "of", "b": [0.3879, 0.788, 0.4089, 0.8078]}, {"w": "algorithmic", "b": [0.4152, 0.788, 0.5315, 0.8078]}, {"w": "pareidolia", "b": [0.5378, 0.788, 0.6387, 0.8078]}, {"w": "artifacts,", "b": [0.645, 0.788, 0.7326, 0.8078]}, {"w": "bird", "b": [0.7389, 0.788, 0.7795, 0.8078]}, {"w": "feathers,", "b": [0.1294, 0.8085, 0.2156, 0.8283]}, {"w": "and", "b": [0.2219, 0.8085, 0.2583, 0.8283]}, {"w": "dog", "b": [0.2646, 0.8085, 0.3024, 0.8283]}, {"w": "eyes—a", "b": [0.3087, 0.8085, 0.39, 0.8283]}, {"w": "byproduct", "b": [0.3963, 0.8085, 0.4986, 0.8283]}, {"w": "of", "b": [0.5049, 0.8085, 0.5259, 0.8283]}, {"w": "the", "b": [0.5322, 0.8085, 0.563, 0.8283]}, {"w": "fact", "b": [0.5693, 0.8085, 0.6072, 0.8283]}, {"w": "that", "b": [0.6135, 0.8085, 0.6513, 0.8283]}, {"w": "the", "b": [0.6576, 0.8085, 0.6884, 0.8283]}, {"w": "DeepDream", "b": [0.6947, 0.8085, 0.8166, 0.8283]}, {"w": "convnet", "b": [0.1294, 0.829, 0.2093, 0.8488]}, {"w": "was", "b": [0.2156, 0.829, 0.2548, 0.8488]}, {"w": "trained", "b": [0.2611, 0.829, 0.3311, 0.8488]}, {"w": "on", "b": [0.3374, 0.829, 0.3627, 0.8488]}, {"w": "ImageNet,", "b": [0.369, 0.829, 0.4747, 0.8488]}, {"w": "where", "b": [0.4811, 0.829, 0.5427, 0.8488]}, {"w": "dog", "b": [0.549, 0.829, 0.5868, 0.8488]}, {"w": "breeds", "b": [0.5931, 0.829, 0.659, 0.8488]}, {"w": "and", "b": [0.6653, 0.829, 0.7017, 0.8488]}, {"w": "bird", "b": [0.708, 0.829, 0.7487, 0.8488]}, {"w": "species", "b": [0.755, 0.829, 0.8278, 0.8488]}, {"w": "are", "b": [0.8341, 0.829, 0.8649, 0.8488]}, {"w": "vastly", "b": [0.1294, 0.8495, 0.1897, 0.8693]}, {"w": "overrepresented.", "b": [0.196, 0.8495, 0.3634, 0.8693]}]}]}, {"page": 365, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Alexander Mordvintsev, Christopher Olah, and Mike Tyka, “DeepDream: A Code Example for Visualizing Neural Networks,” Google Research Blog, July 1, 2015, http://mng.bz/xXlM.", "words": [{"w": "Alexander", "b": [0.1483, 0.0852, 0.2271, 0.1]}, {"w": "Mordvintsev,", "b": [0.2319, 0.0852, 0.332, 0.1]}, {"w": "Christopher", "b": [0.3368, 0.0852, 0.4261, 0.1]}, {"w": "Olah,", "b": [0.4308, 0.0852, 0.4724, 0.1]}, {"w": "and", "b": [0.4771, 0.0852, 0.5044, 0.1]}, {"w": "Mike", "b": [0.5091, 0.0852, 0.5491, 0.1]}, {"w": "Tyka,", "b": [0.5538, 0.0852, 0.5961, 0.1]}, {"w": "“DeepDream:", "b": [0.6008, 0.0852, 0.7059, 0.1]}, {"w": "A", "b": [0.7106, 0.0852, 0.7242, 0.1]}, {"w": "Code", "b": [0.729, 0.0852, 0.7689, 0.1]}, {"w": "Example", "b": [0.7736, 0.0852, 0.8409, 0.1]}, {"w": "for", "b": [0.1483, 0.1003, 0.1704, 0.1151]}, {"w": "Visualizing", "b": [0.1751, 0.1003, 0.2612, 0.1151]}, {"w": "Neural", "b": [0.266, 0.1003, 0.3174, 0.1151]}, {"w": "Networks,”", "b": [0.3222, 0.1003, 0.4089, 0.1151]}, {"w": "Google", "b": [0.4136, 0.1003, 0.4693, 0.1151]}, {"w": "Research", "b": [0.474, 0.1003, 0.5437, 0.1151]}, {"w": "Blog,", "b": [0.5484, 0.1003, 0.5889, 0.1151]}, {"w": "July", "b": [0.5936, 0.1003, 0.6251, 0.1151]}, {"w": "1,", "b": [0.6299, 0.1003, 0.644, 0.1151]}, {"w": "2015,", "b": [0.6488, 0.1003, 0.6913, 0.1151]}, {"w": "http://mng.bz/xXlM.", "b": [0.1483, 0.1155, 0.3049, 0.1303]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.3. Example of a DeepDream output image", "words": [{"w": "Figure", "b": [0.1294, 0.144, 0.1827, 0.1588]}, {"w": "8.3.", "b": [0.1874, 0.144, 0.2158, 0.1588]}, {"w": "Example", "b": [0.2205, 0.144, 0.292, 0.1588]}, {"w": "of", "b": [0.2967, 0.144, 0.3124, 0.1588]}, {"w": "a", "b": [0.3172, 0.144, 0.3266, 0.1588]}, {"w": "DeepDream", "b": [0.3314, 0.144, 0.4277, 0.1588]}, {"w": "output", "b": [0.4324, 0.144, 0.486, 0.1588]}, {"w": "image", "b": [0.4908, 0.144, 0.5391, 0.1588]}]}, {"id": "b_2", "type": "paragraph", "text": "The DeepDream algorithm is almost identical to the convnet filter- visualization technique introduced in chapter 5, consisting of running a convnet in reverse: doing gradient ascent on the input to the convnet in order to maximize the activation of a specific filter in an upper layer of the convnet. DeepDream uses this same idea, with a few simple differences:", "words": [{"w": "The", "b": [0.1294, 0.534, 0.1686, 0.5537]}, {"w": "DeepDream", "b": [0.1749, 0.534, 0.2968, 0.5537]}, {"w": "algorithm", "b": [0.3031, 0.534, 0.4012, 0.5537]}, {"w": "is", "b": [0.4075, 0.534, 0.4244, 0.5537]}, {"w": "almost", "b": [0.4307, 0.534, 0.4979, 0.5537]}, {"w": "identical", "b": [0.5042, 0.534, 0.5911, 0.5537]}, {"w": "to", "b": [0.5974, 0.534, 0.6171, 0.5537]}, {"w": "the", "b": [0.6234, 0.534, 0.6542, 0.5537]}, {"w": "convnet", "b": [0.6605, 0.534, 0.7404, 0.5537]}, {"w": "filter-", "b": [0.7467, 0.534, 0.8035, 0.5537]}, {"w": "visualization", "b": [0.1294, 0.5545, 0.2583, 0.5742]}, {"w": "technique", "b": [0.2646, 0.5545, 0.3627, 0.5742]}, {"w": "introduced", "b": [0.369, 0.5545, 0.4769, 0.5742]}, {"w": "in", "b": [0.4832, 0.5545, 0.5029, 0.5742]}, {"w": "chapter", "b": [0.5091, 0.5545, 0.5833, 0.5742]}, {"w": "5,", "b": [0.5896, 0.5545, 0.6085, 0.5742]}, {"w": "consisting", "b": [0.6148, 0.5545, 0.7171, 0.5742]}, {"w": "of", "b": [0.7235, 0.5545, 0.7445, 0.5742]}, {"w": "running", "b": [0.7508, 0.5545, 0.8292, 0.5742]}, {"w": "a", "b": [0.8356, 0.5545, 0.8468, 0.5742]}, {"w": "convnet", "b": [0.1294, 0.575, 0.2093, 0.5947]}, {"w": "in", "b": [0.2156, 0.575, 0.2352, 0.5947]}, {"w": "reverse:", "b": [0.2415, 0.575, 0.3214, 0.5947]}, {"w": "doing", "b": [0.3277, 0.575, 0.3851, 0.5947]}, {"w": "gradient", "b": [0.3914, 0.575, 0.4741, 0.5947]}, {"w": "ascent", "b": [0.4804, 0.575, 0.5434, 0.5947]}, {"w": "on", "b": [0.5497, 0.575, 0.575, 0.5947]}, {"w": "the", "b": [0.5813, 0.575, 0.6121, 0.5947]}, {"w": "input", "b": [0.6184, 0.575, 0.6703, 0.5947]}, {"w": "to", "b": [0.6766, 0.575, 0.6962, 0.5947]}, {"w": "the", "b": [0.7025, 0.575, 0.7333, 0.5947]}, {"w": "convnet", "b": [0.7396, 0.575, 0.8195, 0.5947]}, {"w": "in", "b": [0.8258, 0.575, 0.8454, 0.5947]}, {"w": "order", "b": [0.1294, 0.5955, 0.1826, 0.6153]}, {"w": "to", "b": [0.1889, 0.5955, 0.2086, 0.6153]}, {"w": "maximize", "b": [0.2149, 0.5955, 0.3144, 0.6153]}, {"w": "the", "b": [0.3207, 0.5955, 0.3515, 0.6153]}, {"w": "activation", "b": [0.3578, 0.5955, 0.4573, 0.6153]}, {"w": "of", "b": [0.4635, 0.5955, 0.4845, 0.6153]}, {"w": "a", "b": [0.4908, 0.5955, 0.502, 0.6153]}, {"w": "specific", "b": [0.5083, 0.5955, 0.5868, 0.6153]}, {"w": "filter", "b": [0.5931, 0.5955, 0.6421, 0.6153]}, {"w": "in", "b": [0.6484, 0.5955, 0.6681, 0.6153]}, {"w": "an", "b": [0.6744, 0.5955, 0.6982, 0.6153]}, {"w": "upper", "b": [0.7045, 0.5955, 0.7619, 0.6153]}, {"w": "layer", "b": [0.7682, 0.5955, 0.8187, 0.6153]}, {"w": "of", "b": [0.825, 0.5955, 0.846, 0.6153]}, {"w": "the", "b": [0.1294, 0.616, 0.1602, 0.6357]}, {"w": "convnet.", "b": [0.1665, 0.616, 0.2527, 0.6357]}, {"w": "DeepDream", "b": [0.259, 0.616, 0.3809, 0.6357]}, {"w": "uses", "b": [0.3872, 0.616, 0.4306, 0.6357]}, {"w": "this", "b": [0.4369, 0.616, 0.4734, 0.6357]}, {"w": "same", "b": [0.4797, 0.616, 0.5315, 0.6357]}, {"w": "idea,", "b": [0.5378, 0.616, 0.5862, 0.6357]}, {"w": "with", "b": [0.5925, 0.616, 0.6373, 0.6357]}, {"w": "a", "b": [0.6436, 0.616, 0.6548, 0.6357]}, {"w": "few", "b": [0.6611, 0.616, 0.699, 0.6357]}, {"w": "simple", "b": [0.7053, 0.616, 0.7725, 0.6357]}, {"w": "differences:", "b": [0.1294, 0.6365, 0.248, 0.6563]}]}, {"id": "b_3", "type": "paragraph", "text": "With DeepDream, you try to maximize the activation of entire layers rather than that of a specific filter, thus mixing together visualizations of large numbers of features at once. You start not from blank, slightly noisy input, but rather from an existing image—thus the resulting effects latch on to preexisting visual patterns, distorting elements of the image in a somewhat artistic fashion. The input images are processed at different scales (called octaves), which improves the quality of the visualizations.", "words": [{"w": "With", "b": [0.1799, 0.6748, 0.2293, 0.6946]}, {"w": "DeepDream,", "b": [0.2356, 0.6748, 0.3638, 0.6946]}, {"w": "you", "b": [0.3701, 0.6748, 0.4079, 0.6946]}, {"w": "try", "b": [0.4142, 0.6748, 0.4423, 0.6946]}, {"w": "to", "b": [0.4486, 0.6748, 0.4682, 0.6946]}, {"w": "maximize", "b": [0.4745, 0.6748, 0.574, 0.6946]}, {"w": "the", "b": [0.5803, 0.6748, 0.6111, 0.6946]}, {"w": "activation", "b": [0.6174, 0.6748, 0.7169, 0.6946]}, {"w": "of", "b": [0.7232, 0.6748, 0.7442, 0.6946]}, {"w": "entire", "b": [0.7505, 0.6748, 0.808, 0.6946]}, {"w": "layers", "b": [0.1799, 0.6953, 0.2401, 0.7151]}, {"w": "rather", "b": [0.2464, 0.6953, 0.3052, 0.7151]}, {"w": "than", "b": [0.3115, 0.6953, 0.355, 0.7151]}, {"w": "that", "b": [0.3613, 0.6953, 0.3991, 0.7151]}, {"w": "of", "b": [0.4054, 0.6953, 0.4264, 0.7151]}, {"w": "a", "b": [0.4328, 0.6953, 0.444, 0.7151]}, {"w": "specific", "b": [0.4503, 0.6953, 0.5287, 0.7151]}, {"w": "filter,", "b": [0.535, 0.6953, 0.5893, 0.7151]}, {"w": "thus", "b": [0.5956, 0.6953, 0.6376, 0.7151]}, {"w": "mixing", "b": [0.6439, 0.6953, 0.7154, 0.7151]}, {"w": "together", "b": [0.7217, 0.6953, 0.8044, 0.7151]}, {"w": "visualizations", "b": [0.1799, 0.7158, 0.3186, 0.7356]}, {"w": "of", "b": [0.3249, 0.7158, 0.3459, 0.7356]}, {"w": "large", "b": [0.3522, 0.7158, 0.4022, 0.7356]}, {"w": "numbers", "b": [0.4085, 0.7158, 0.4954, 0.7356]}, {"w": "of", "b": [0.5017, 0.7158, 0.5227, 0.7356]}, {"w": "features", "b": [0.529, 0.7158, 0.6088, 0.7356]}, {"w": "at", "b": [0.6151, 0.7158, 0.6333, 0.7356]}, {"w": "once.", "b": [0.6396, 0.7158, 0.6936, 0.7356]}, {"w": "You", "b": [0.1799, 0.7363, 0.2208, 0.7561]}, {"w": "start", "b": [0.2271, 0.7363, 0.2705, 0.7561]}, {"w": "not", "b": [0.2768, 0.7363, 0.3091, 0.7561]}, {"w": "from", "b": [0.3154, 0.7363, 0.3644, 0.7561]}, {"w": "blank,", "b": [0.3707, 0.7363, 0.4331, 0.7561]}, {"w": "slightly", "b": [0.4394, 0.7363, 0.5151, 0.7561]}, {"w": "noisy", "b": [0.5214, 0.7363, 0.5761, 0.7561]}, {"w": "input,", "b": [0.5824, 0.7363, 0.6405, 0.7561]}, {"w": "but", "b": [0.6468, 0.7363, 0.6791, 0.7561]}, {"w": "rather", "b": [0.6854, 0.7363, 0.7442, 0.7561]}, {"w": "from", "b": [0.7505, 0.7363, 0.7996, 0.7561]}, {"w": "an", "b": [0.8059, 0.7363, 0.8297, 0.7561]}, {"w": "existing", "b": [0.1799, 0.7568, 0.2598, 0.7766]}, {"w": "image—thus", "b": [0.2661, 0.7568, 0.395, 0.7766]}, {"w": "the", "b": [0.4013, 0.7568, 0.4321, 0.7766]}, {"w": "resulting", "b": [0.4384, 0.7568, 0.5267, 0.7766]}, {"w": "effects", "b": [0.533, 0.7568, 0.5997, 0.7766]}, {"w": "latch", "b": [0.606, 0.7568, 0.6551, 0.7766]}, {"w": "on", "b": [0.6614, 0.7568, 0.6866, 0.7766]}, {"w": "to", "b": [0.6929, 0.7568, 0.7126, 0.7766]}, {"w": "preexisting", "b": [0.7189, 0.7568, 0.831, 0.7766]}, {"w": "visual", "b": [0.1799, 0.7773, 0.2401, 0.7971]}, {"w": "patterns,", "b": [0.2464, 0.7773, 0.3326, 0.7971]}, {"w": "distorting", "b": [0.3389, 0.7773, 0.4356, 0.7971]}, {"w": "elements", "b": [0.4419, 0.7773, 0.5316, 0.7971]}, {"w": "of", "b": [0.5379, 0.7773, 0.5589, 0.7971]}, {"w": "the", "b": [0.5652, 0.7773, 0.5961, 0.7971]}, {"w": "image", "b": [0.6024, 0.7773, 0.664, 0.7971]}, {"w": "in", "b": [0.6703, 0.7773, 0.69, 0.7971]}, {"w": "a", "b": [0.6963, 0.7773, 0.7075, 0.7971]}, {"w": "somewhat", "b": [0.7138, 0.7773, 0.8161, 0.7971]}, {"w": "artistic", "b": [0.1799, 0.7978, 0.2485, 0.8176]}, {"w": "fashion.", "b": [0.2548, 0.7978, 0.3354, 0.8176]}, {"w": "The", "b": [0.1799, 0.8183, 0.2191, 0.8381]}, {"w": "input", "b": [0.2254, 0.8183, 0.2773, 0.8381]}, {"w": "images", "b": [0.2836, 0.8183, 0.355, 0.8381]}, {"w": "are", "b": [0.3613, 0.8183, 0.3921, 0.8381]}, {"w": "processed", "b": [0.3984, 0.8183, 0.4979, 0.8381]}, {"w": "at", "b": [0.5042, 0.8183, 0.5224, 0.8381]}, {"w": "different", "b": [0.5287, 0.8183, 0.6151, 0.8381]}, {"w": "scales", "b": [0.6214, 0.8183, 0.6816, 0.8381]}, {"w": "(called", "b": [0.6879, 0.8183, 0.7566, 0.8381]}, {"w": "octaves),", "b": [0.7628, 0.8183, 0.8532, 0.8381]}, {"w": "which", "b": [0.1799, 0.8388, 0.2415, 0.8586]}, {"w": "improves", "b": [0.2478, 0.8388, 0.3417, 0.8586]}, {"w": "the", "b": [0.348, 0.8388, 0.3788, 0.8586]}, {"w": "quality", "b": [0.3852, 0.8388, 0.4552, 0.8586]}, {"w": "of", "b": [0.4615, 0.8388, 0.4825, 0.8586]}, {"w": "the", "b": [0.4889, 0.8388, 0.5197, 0.8586]}, {"w": "visualizations.", "b": [0.526, 0.8388, 0.671, 0.8586]}]}, {"id": "b_4", "type": "paragraph", "text": "Let’s make some DeepDreams.", "words": [{"w": "Let’s", "b": [0.1294, 0.8816, 0.1798, 0.9014]}, {"w": "make", "b": [0.1862, 0.8816, 0.2408, 0.9014]}, {"w": "some", "b": [0.2471, 0.8816, 0.3004, 0.9014]}, {"w": "DeepDreams.", "b": [0.3067, 0.8816, 0.4446, 0.9014]}]}]}, {"page": 366, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "8.2.1. Implementing DeepDream in Keras", "words": [{"w": "8.2.1.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "Implementing", "b": [0.1925, 0.0857, 0.3438, 0.1054]}, {"w": "DeepDream", "b": [0.3501, 0.0857, 0.4786, 0.1054]}, {"w": "in", "b": [0.4849, 0.0857, 0.5059, 0.1054]}, {"w": "Keras", "b": [0.5122, 0.0857, 0.5767, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "You’ll start from a convnet pretrained on ImageNet. In Keras, many such convnets are available: VGG16, VGG19, Xception, ResNet50, and so on. You can implement DeepDream with any of them, but your convnet of choice will naturally affect your visualizations, because different convnet architectures result in different learned features. The convnet used in the original DeepDream release was an Inception model, and in practice Inception is known to produce nice-looking DeepDreams, so you’ll use the Inception V3 model that comes with Keras.", "words": [{"w": "You’ll", "b": [0.1294, 0.1285, 0.1928, 0.1482]}, {"w": "start", "b": [0.1991, 0.1285, 0.2425, 0.1482]}, {"w": "from", "b": [0.2488, 0.1285, 0.2978, 0.1482]}, {"w": "a", "b": [0.3042, 0.1285, 0.3154, 0.1482]}, {"w": "convnet", "b": [0.3217, 0.1285, 0.4015, 0.1482]}, {"w": "pretrained", "b": [0.4078, 0.1285, 0.5101, 0.1482]}, {"w": "on", "b": [0.5164, 0.1285, 0.5416, 0.1482]}, {"w": "ImageNet.", "b": [0.5479, 0.1285, 0.6537, 0.1482]}, {"w": "In", "b": [0.66, 0.1285, 0.681, 0.1482]}, {"w": "Keras,", "b": [0.6873, 0.1285, 0.7525, 0.1482]}, {"w": "many", "b": [0.7588, 0.1285, 0.8148, 0.1482]}, {"w": "such", "b": [0.8211, 0.1285, 0.8674, 0.1482]}, {"w": "convnets", "b": [0.1294, 0.149, 0.2191, 0.1687]}, {"w": "are", "b": [0.2254, 0.149, 0.2562, 0.1687]}, {"w": "available:", "b": [0.2625, 0.149, 0.3606, 0.1687]}, {"w": "VGG16,", "b": [0.3669, 0.149, 0.4531, 0.1687]}, {"w": "VGG19,", "b": [0.4594, 0.149, 0.5455, 0.1687]}, {"w": "Xception,", "b": [0.5518, 0.149, 0.6506, 0.1687]}, {"w": "ResNet50,", "b": [0.6569, 0.149, 0.7627, 0.1687]}, {"w": "and", "b": [0.769, 0.149, 0.8054, 0.1687]}, {"w": "so", "b": [0.8117, 0.149, 0.8341, 0.1687]}, {"w": "on.", "b": [0.1294, 0.1695, 0.1609, 0.1892]}, {"w": "You", "b": [0.1673, 0.1695, 0.2082, 0.1892]}, {"w": "can", "b": [0.2145, 0.1695, 0.2495, 0.1892]}, {"w": "implement", "b": [0.2558, 0.1695, 0.3637, 0.1892]}, {"w": "DeepDream", "b": [0.37, 0.1695, 0.4919, 0.1892]}, {"w": "with", "b": [0.4982, 0.1695, 0.543, 0.1892]}, {"w": "any", "b": [0.5493, 0.1695, 0.5858, 0.1892]}, {"w": "of", "b": [0.5921, 0.1695, 0.6131, 0.1892]}, {"w": "them,", "b": [0.6194, 0.1695, 0.6762, 0.1892]}, {"w": "but", "b": [0.6825, 0.1695, 0.7147, 0.1892]}, {"w": "your", "b": [0.721, 0.1695, 0.7672, 0.1892]}, {"w": "convnet", "b": [0.7736, 0.1695, 0.8534, 0.1892]}, {"w": "of", "b": [0.1294, 0.19, 0.1504, 0.2097]}, {"w": "choice", "b": [0.1567, 0.19, 0.2226, 0.2097]}, {"w": "will", "b": [0.2289, 0.19, 0.2681, 0.2097]}, {"w": "naturally", "b": [0.2744, 0.19, 0.3641, 0.2097]}, {"w": "affect", "b": [0.3704, 0.19, 0.4273, 0.2097]}, {"w": "your", "b": [0.4336, 0.19, 0.4799, 0.2097]}, {"w": "visualizations,", "b": [0.4862, 0.19, 0.6312, 0.2097]}, {"w": "because", "b": [0.6375, 0.19, 0.7173, 0.2097]}, {"w": "different", "b": [0.7236, 0.19, 0.81, 0.2097]}, {"w": "convnet", "b": [0.1294, 0.2105, 0.2093, 0.2302]}, {"w": "architectures", "b": [0.2156, 0.2105, 0.3445, 0.2302]}, {"w": "result", "b": [0.3508, 0.2105, 0.4068, 0.2302]}, {"w": "in", "b": [0.4131, 0.2105, 0.4328, 0.2302]}, {"w": "different", "b": [0.4391, 0.2105, 0.5254, 0.2302]}, {"w": "learned", "b": [0.5317, 0.2105, 0.6059, 0.2302]}, {"w": "features.", "b": [0.6123, 0.2105, 0.6984, 0.2302]}, {"w": "The", "b": [0.7047, 0.2105, 0.7439, 0.2302]}, {"w": "convnet", "b": [0.7502, 0.2105, 0.8301, 0.2302]}, {"w": "used", "b": [0.1294, 0.231, 0.1757, 0.2507]}, {"w": "in", "b": [0.182, 0.231, 0.2016, 0.2507]}, {"w": "the", "b": [0.2079, 0.231, 0.2387, 0.2507]}, {"w": "original", "b": [0.245, 0.231, 0.3235, 0.2507]}, {"w": "DeepDream", "b": [0.3298, 0.231, 0.4517, 0.2507]}, {"w": "release", "b": [0.458, 0.231, 0.528, 0.2507]}, {"w": "was", "b": [0.5342, 0.231, 0.5735, 0.2507]}, {"w": "an", "b": [0.5798, 0.231, 0.6036, 0.2507]}, {"w": "Inception", "b": [0.6099, 0.231, 0.7052, 0.2507]}, {"w": "model,", "b": [0.7115, 0.231, 0.7809, 0.2507]}, {"w": "and", "b": [0.7872, 0.231, 0.8236, 0.2507]}, {"w": "in", "b": [0.8299, 0.231, 0.8495, 0.2507]}, {"w": "practice", "b": [0.1294, 0.2515, 0.2093, 0.2712]}, {"w": "Inception", "b": [0.2156, 0.2515, 0.3108, 0.2712]}, {"w": "is", "b": [0.3171, 0.2515, 0.334, 0.2712]}, {"w": "known", "b": [0.3403, 0.2515, 0.4089, 0.2712]}, {"w": "to", "b": [0.4152, 0.2515, 0.4349, 0.2712]}, {"w": "produce", "b": [0.4412, 0.2515, 0.5224, 0.2712]}, {"w": "nice-looking", "b": [0.5287, 0.2515, 0.6563, 0.2712]}, {"w": "DeepDreams,", "b": [0.6626, 0.2515, 0.8005, 0.2712]}, {"w": "so", "b": [0.8068, 0.2515, 0.8293, 0.2712]}, {"w": "you’ll", "b": [0.1294, 0.272, 0.1897, 0.2917]}, {"w": "use", "b": [0.196, 0.272, 0.2296, 0.2917]}, {"w": "the", "b": [0.2359, 0.272, 0.2667, 0.2917]}, {"w": "Inception", "b": [0.273, 0.272, 0.3683, 0.2917]}, {"w": "V3", "b": [0.3746, 0.272, 0.4054, 0.2917]}, {"w": "model", "b": [0.4117, 0.272, 0.4748, 0.2917]}, {"w": "that", "b": [0.4811, 0.272, 0.5189, 0.2917]}, {"w": "comes", "b": [0.5252, 0.272, 0.5897, 0.2917]}, {"w": "with", "b": [0.596, 0.272, 0.6409, 0.2917]}, {"w": "Keras.", "b": [0.6472, 0.272, 0.7123, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 8.8. Loading the pretrained Inception V3 model", "words": [{"w": "Listing", "b": [0.1294, 0.3098, 0.1862, 0.3246]}, {"w": "8.8.", "b": [0.1909, 0.3098, 0.2193, 0.3246]}, {"w": "Loading", "b": [0.224, 0.3098, 0.2913, 0.3246]}, {"w": "the", "b": [0.296, 0.3098, 0.3213, 0.3246]}, {"w": "pretrained", "b": [0.326, 0.3098, 0.4118, 0.3246]}, {"w": "Inception", "b": [0.4166, 0.3098, 0.4933, 0.3246]}, {"w": "V3", "b": [0.498, 0.3098, 0.5211, 0.3246]}, {"w": "model", "b": [0.5259, 0.3098, 0.5753, 0.3246]}]}, {"id": "b_3", "type": "paragraph", "text": "from keras.applications import inception_v3 from keras import backend as K K.set_learning_phase(0) 1 model = inception_v3.InceptionV3(weights='imagenet', 2 include_top=False) 2", "words": [{"w": "from", "b": [0.1357, 0.3382, 0.1811, 0.3534]}, {"w": "keras.applications", "b": [0.1925, 0.3382, 0.3968, 0.3534]}, {"w": "import", "b": [0.4082, 0.3382, 0.4763, 0.3534]}, {"w": "inception_v3", "b": [0.4876, 0.3382, 0.6238, 0.3534]}, {"w": "from", "b": [0.1357, 0.3534, 0.1811, 0.3685]}, {"w": "keras", "b": [0.1925, 0.3534, 0.2492, 0.3685]}, {"w": "import", "b": [0.2606, 0.3534, 0.3287, 0.3685]}, {"w": "backend", "b": [0.34, 0.3534, 0.4195, 0.3685]}, {"w": "as", "b": [0.4309, 0.3534, 0.4536, 0.3685]}, {"w": "K", "b": [0.4649, 0.3534, 0.4763, 0.3685]}, {"w": "K.set_learning_phase(0)", "b": [0.1357, 0.3837, 0.3968, 0.3988]}, {"w": "1", "b": [0.7715, 0.3837, 0.7829, 0.3988]}, {"w": "model", "b": [0.1357, 0.414, 0.1925, 0.4291]}, {"w": "=", "b": [0.2038, 0.414, 0.2152, 0.4291]}, {"w": "inception_v3.InceptionV3(weights='imagenet',", "b": [0.2265, 0.414, 0.726, 0.4291]}, {"w": "2", "b": [0.7715, 0.414, 0.7829, 0.4291]}, {"w": "include_top=False)", "b": [0.5103, 0.4291, 0.7146, 0.4443]}, {"w": "2", "b": [0.7715, 0.4291, 0.7829, 0.4443]}]}, {"id": "b_4", "type": "paragraph", "text": "1 You won’t be training the model, so this command disables all training-specific operations. 2 Builds the Inception V3 network, without its convolutional base. The model will be loaded with pretrained ImageNet weights.", "words": [{"w": "1", "b": [0.1799, 0.4627, 0.1925, 0.4824]}, {"w": "You", "b": [0.1988, 0.4627, 0.2408, 0.4824]}, {"w": "won’t", "b": [0.2471, 0.4627, 0.3088, 0.4824]}, {"w": "be", "b": [0.3151, 0.4627, 0.3403, 0.4824]}, {"w": "training", "b": [0.3466, 0.4627, 0.4335, 0.4824]}, {"w": "the", "b": [0.4398, 0.4627, 0.4735, 0.4824]}, {"w": "model,", "b": [0.4798, 0.4627, 0.552, 0.4824]}, {"w": "so", "b": [0.5583, 0.4627, 0.5807, 0.4824]}, {"w": "this", "b": [0.587, 0.4627, 0.6262, 0.4824]}, {"w": "command", "b": [0.6325, 0.4627, 0.7391, 0.4824]}, {"w": "disables", "b": [0.7454, 0.4627, 0.8309, 0.4824]}, {"w": "all", "b": [0.8372, 0.4627, 0.8638, 0.4824]}, {"w": "training-specific", "b": [0.1799, 0.4832, 0.355, 0.5029]}, {"w": "operations.", "b": [0.3613, 0.4832, 0.4812, 0.5029]}, {"w": "2", "b": [0.1799, 0.5037, 0.1925, 0.5234]}, {"w": "Builds", "b": [0.1988, 0.5037, 0.2675, 0.5234]}, {"w": "the", "b": [0.2738, 0.5037, 0.3074, 0.5234]}, {"w": "Inception", "b": [0.3137, 0.5037, 0.4161, 0.5234]}, {"w": "V3", "b": [0.4224, 0.5037, 0.4532, 0.5234]}, {"w": "network,", "b": [0.4595, 0.5037, 0.5555, 0.5234]}, {"w": "without", "b": [0.5618, 0.5037, 0.6445, 0.5234]}, {"w": "its", "b": [0.6508, 0.5037, 0.676, 0.5234]}, {"w": "convolutional", "b": [0.6823, 0.5037, 0.8281, 0.5234]}, {"w": "base.", "b": [0.1799, 0.5242, 0.2338, 0.5439]}, {"w": "The", "b": [0.2401, 0.5242, 0.2822, 0.5439]}, {"w": "model", "b": [0.2885, 0.5242, 0.3544, 0.5439]}, {"w": "will", "b": [0.3607, 0.5242, 0.3999, 0.5439]}, {"w": "be", "b": [0.4062, 0.5242, 0.4314, 0.5439]}, {"w": "loaded", "b": [0.4377, 0.5242, 0.5092, 0.5439]}, {"w": "with", "b": [0.5155, 0.5242, 0.5632, 0.5439]}, {"w": "pretrained", "b": [0.5695, 0.5242, 0.6839, 0.5439]}, {"w": "ImageNet", "b": [0.6902, 0.5242, 0.7953, 0.5439]}, {"w": "weights.", "b": [0.1799, 0.5447, 0.2674, 0.5644]}]}, {"id": "b_5", "type": "paragraph", "text": "Next, you’ll compute the loss: the quantity you’ll seek to maximize during the gradient-ascent process. In chapter 5, for filter visualization, you tried to maximize the value of a specific filter in a specific layer. Here, you’ll simultaneously maximize the activation of all filters in a number of layers. Specifically, you’ll maximize a weighted sum of the L2 norm of the activations of a set of high-level layers. The exact set of layers you choose (as well as their contribution to the final loss) has a major influence on the visuals you’ll be able to produce, so you want to make these parameters easily configurable. Lower layers result in geometric patterns, whereas higher layers result in visuals in which you can recognize some classes from ImageNet (for example, birds or dogs). You’ll start from a somewhat arbitrary configuration involving four layers—but you’ll definitely want to explore many different configurations later.", "words": [{"w": "Next,", "b": [0.1294, 0.5875, 0.1848, 0.6072]}, {"w": "you’ll", "b": [0.1911, 0.5875, 0.2513, 0.6072]}, {"w": "compute", "b": [0.2576, 0.5875, 0.3445, 0.6072]}, {"w": "the", "b": [0.3508, 0.5875, 0.3816, 0.6072]}, {"w": "loss:", "b": [0.3879, 0.5875, 0.4341, 0.6072]}, {"w": "the", "b": [0.4405, 0.5875, 0.4713, 0.6072]}, {"w": "quantity", "b": [0.4776, 0.5875, 0.5603, 0.6072]}, {"w": "you’ll", "b": [0.5666, 0.5875, 0.6268, 0.6072]}, {"w": "seek", "b": [0.6332, 0.5875, 0.678, 0.6072]}, {"w": "to", "b": [0.6843, 0.5875, 0.7039, 0.6072]}, {"w": "maximize", "b": [0.7102, 0.5875, 0.8097, 0.6072]}, {"w": "during", "b": [0.1294, 0.608, 0.1953, 0.6277]}, {"w": "the", "b": [0.2016, 0.608, 0.2324, 0.6277]}, {"w": "gradient-ascent", "b": [0.2387, 0.608, 0.3928, 0.6277]}, {"w": "process.", "b": [0.3991, 0.608, 0.4811, 0.6277]}, {"w": "In", "b": [0.4874, 0.608, 0.5084, 0.6277]}, {"w": "chapter", "b": [0.5147, 0.608, 0.5889, 0.6277]}, {"w": "5,", "b": [0.5952, 0.608, 0.6141, 0.6277]}, {"w": "for", "b": [0.6204, 0.608, 0.6498, 0.6277]}, {"w": "filter", "b": [0.6561, 0.608, 0.7052, 0.6277]}, {"w": "visualization,", "b": [0.7115, 0.608, 0.8467, 0.6277]}, {"w": "you", "b": [0.1294, 0.6285, 0.1673, 0.6482]}, {"w": "tried", "b": [0.1736, 0.6285, 0.2198, 0.6482]}, {"w": "to", "b": [0.2261, 0.6285, 0.2457, 0.6482]}, {"w": "maximize", "b": [0.252, 0.6285, 0.3515, 0.6482]}, {"w": "the", "b": [0.3578, 0.6285, 0.3887, 0.6482]}, {"w": "value", "b": [0.395, 0.6285, 0.4496, 0.6482]}, {"w": "of", "b": [0.4559, 0.6285, 0.4769, 0.6482]}, {"w": "a", "b": [0.4832, 0.6285, 0.4944, 0.6482]}, {"w": "specific", "b": [0.5007, 0.6285, 0.5792, 0.6482]}, {"w": "filter", "b": [0.5855, 0.6285, 0.6345, 0.6482]}, {"w": "in", "b": [0.6408, 0.6285, 0.6605, 0.6482]}, {"w": "a", "b": [0.6668, 0.6285, 0.678, 0.6482]}, {"w": "specific", "b": [0.6843, 0.6285, 0.7627, 0.6482]}, {"w": "layer.", "b": [0.769, 0.6285, 0.8242, 0.6482]}, {"w": "Here,", "b": [0.1294, 0.649, 0.1847, 0.6687]}, {"w": "you’ll", "b": [0.191, 0.649, 0.2513, 0.6687]}, {"w": "simultaneously", "b": [0.2576, 0.649, 0.4104, 0.6687]}, {"w": "maximize", "b": [0.4167, 0.649, 0.5161, 0.6687]}, {"w": "the", "b": [0.5224, 0.649, 0.5533, 0.6687]}, {"w": "activation", "b": [0.5596, 0.649, 0.6591, 0.6687]}, {"w": "of", "b": [0.6654, 0.649, 0.6864, 0.6687]}, {"w": "all", "b": [0.6927, 0.649, 0.7179, 0.6687]}, {"w": "filters", "b": [0.7242, 0.649, 0.7831, 0.6687]}, {"w": "in", "b": [0.7894, 0.649, 0.809, 0.6687]}, {"w": "a", "b": [0.8153, 0.649, 0.8265, 0.6687]}, {"w": "number", "b": [0.1294, 0.6695, 0.2065, 0.6892]}, {"w": "of", "b": [0.2128, 0.6695, 0.2338, 0.6892]}, {"w": "layers.", "b": [0.2401, 0.6695, 0.3066, 0.6892]}, {"w": "Specifically,", "b": [0.313, 0.6695, 0.4381, 0.6892]}, {"w": "you’ll", "b": [0.4444, 0.6695, 0.5047, 0.6892]}, {"w": "maximize", "b": [0.511, 0.6695, 0.6105, 0.6892]}, {"w": "a", "b": [0.6168, 0.6695, 0.628, 0.6892]}, {"w": "weighted", "b": [0.6343, 0.6695, 0.7267, 0.6892]}, {"w": "sum", "b": [0.733, 0.6695, 0.7751, 0.6892]}, {"w": "of", "b": [0.7814, 0.6695, 0.8024, 0.6892]}, {"w": "the", "b": [0.8087, 0.6695, 0.8396, 0.6892]}, {"w": "L2", "b": [0.1294, 0.69, 0.1574, 0.7097]}, {"w": "norm", "b": [0.1637, 0.69, 0.217, 0.7097]}, {"w": "of", "b": [0.2233, 0.69, 0.2443, 0.7097]}, {"w": "the", "b": [0.2506, 0.69, 0.2814, 0.7097]}, {"w": "activations", "b": [0.2877, 0.69, 0.397, 0.7097]}, {"w": "of", "b": [0.4033, 0.69, 0.4244, 0.7097]}, {"w": "a", "b": [0.4307, 0.69, 0.4419, 0.7097]}, {"w": "set", "b": [0.4482, 0.69, 0.4762, 0.7097]}, {"w": "of", "b": [0.4825, 0.69, 0.5035, 0.7097]}, {"w": "high-level", "b": [0.5098, 0.69, 0.6121, 0.7097]}, {"w": "layers.", "b": [0.6184, 0.69, 0.685, 0.7097]}, {"w": "The", "b": [0.6913, 0.69, 0.7305, 0.7097]}, {"w": "exact", "b": [0.7368, 0.69, 0.79, 0.7097]}, {"w": "set", "b": [0.7963, 0.69, 0.8244, 0.7097]}, {"w": "of", "b": [0.8307, 0.69, 0.8517, 0.7097]}, {"w": "layers", "b": [0.1294, 0.7105, 0.1897, 0.7302]}, {"w": "you", "b": [0.196, 0.7105, 0.2338, 0.7302]}, {"w": "choose", "b": [0.2401, 0.7105, 0.3102, 0.7302]}, {"w": "(as", "b": [0.3165, 0.7105, 0.3459, 0.7302]}, {"w": "well", "b": [0.3522, 0.7105, 0.3956, 0.7302]}, {"w": "as", "b": [0.4019, 0.7105, 0.4229, 0.7302]}, {"w": "their", "b": [0.4292, 0.7105, 0.4755, 0.7302]}, {"w": "contribution", "b": [0.4818, 0.7105, 0.6051, 0.7302]}, {"w": "to", "b": [0.6114, 0.7105, 0.6311, 0.7302]}, {"w": "the", "b": [0.6374, 0.7105, 0.6682, 0.7302]}, {"w": "final", "b": [0.6744, 0.7105, 0.7207, 0.7302]}, {"w": "loss)", "b": [0.727, 0.7105, 0.7746, 0.7302]}, {"w": "has", "b": [0.7809, 0.7105, 0.8146, 0.7302]}, {"w": "a", "b": [0.8209, 0.7105, 0.8321, 0.7302]}, {"w": "major", "b": [0.1294, 0.731, 0.1883, 0.7507]}, {"w": "influence", "b": [0.1946, 0.731, 0.2884, 0.7507]}, {"w": "on", "b": [0.2947, 0.731, 0.32, 0.7507]}, {"w": "the", "b": [0.3263, 0.731, 0.3571, 0.7507]}, {"w": "visuals", "b": [0.3634, 0.731, 0.4335, 0.7507]}, {"w": "you’ll", "b": [0.4398, 0.731, 0.5001, 0.7507]}, {"w": "be", "b": [0.5064, 0.731, 0.5302, 0.7507]}, {"w": "able", "b": [0.5365, 0.731, 0.5785, 0.7507]}, {"w": "to", "b": [0.5848, 0.731, 0.6044, 0.7507]}, {"w": "produce,", "b": [0.6107, 0.731, 0.6983, 0.7507]}, {"w": "so", "b": [0.7046, 0.731, 0.727, 0.7507]}, {"w": "you", "b": [0.7333, 0.731, 0.7712, 0.7507]}, {"w": "want", "b": [0.7775, 0.731, 0.8265, 0.7507]}, {"w": "to", "b": [0.8328, 0.731, 0.8525, 0.7507]}, {"w": "make", "b": [0.1294, 0.7515, 0.1841, 0.7712]}, {"w": "these", "b": [0.1904, 0.7515, 0.2422, 0.7712]}, {"w": "parameters", "b": [0.2485, 0.7515, 0.3592, 0.7712]}, {"w": "easily", "b": [0.3655, 0.7515, 0.4243, 0.7712]}, {"w": "configurable.", "b": [0.4306, 0.7515, 0.5644, 0.7712]}, {"w": "Lower", "b": [0.5707, 0.7515, 0.6365, 0.7712]}, {"w": "layers", "b": [0.6428, 0.7515, 0.7031, 0.7712]}, {"w": "result", "b": [0.7094, 0.7515, 0.7654, 0.7712]}, {"w": "in", "b": [0.7717, 0.7515, 0.7913, 0.7712]}, {"w": "geometric", "b": [0.1294, 0.772, 0.2303, 0.7917]}, {"w": "patterns,", "b": [0.2366, 0.772, 0.3228, 0.7917]}, {"w": "whereas", "b": [0.3291, 0.772, 0.4117, 0.7917]}, {"w": "higher", "b": [0.418, 0.772, 0.4825, 0.7917]}, {"w": "layers", "b": [0.4888, 0.772, 0.549, 0.7917]}, {"w": "result", "b": [0.5553, 0.772, 0.6114, 0.7917]}, {"w": "in", "b": [0.6177, 0.772, 0.6373, 0.7917]}, {"w": "visuals", "b": [0.6436, 0.772, 0.7137, 0.7917]}, {"w": "in", "b": [0.72, 0.772, 0.7396, 0.7917]}, {"w": "which", "b": [0.7459, 0.772, 0.8076, 0.7917]}, {"w": "you", "b": [0.8139, 0.772, 0.8517, 0.7917]}, {"w": "can", "b": [0.1294, 0.7925, 0.1644, 0.8122]}, {"w": "recognize", "b": [0.1707, 0.7925, 0.2688, 0.8122]}, {"w": "some", "b": [0.2751, 0.7925, 0.3283, 0.8122]}, {"w": "classes", "b": [0.3346, 0.7925, 0.4047, 0.8122]}, {"w": "from", "b": [0.411, 0.7925, 0.46, 0.8122]}, {"w": "ImageNet", "b": [0.4663, 0.7925, 0.5658, 0.8122]}, {"w": "(for", "b": [0.5721, 0.7925, 0.6099, 0.8122]}, {"w": "example,", "b": [0.6162, 0.7925, 0.708, 0.8122]}, {"w": "birds", "b": [0.7143, 0.7925, 0.7647, 0.8122]}, {"w": "or", "b": [0.771, 0.7925, 0.792, 0.8122]}, {"w": "dogs).", "b": [0.7983, 0.7925, 0.8607, 0.8122]}, {"w": "You’ll", "b": [0.1294, 0.813, 0.1928, 0.8327]}, {"w": "start", "b": [0.1991, 0.813, 0.2425, 0.8327]}, {"w": "from", "b": [0.2488, 0.813, 0.2978, 0.8327]}, {"w": "a", "b": [0.3042, 0.813, 0.3154, 0.8327]}, {"w": "somewhat", "b": [0.3217, 0.813, 0.4239, 0.8327]}, {"w": "arbitrary", "b": [0.4303, 0.813, 0.5171, 0.8327]}, {"w": "configuration", "b": [0.5234, 0.813, 0.6593, 0.8327]}, {"w": "involving", "b": [0.6656, 0.813, 0.7624, 0.8327]}, {"w": "four", "b": [0.7687, 0.813, 0.8107, 0.8327]}, {"w": "layers—but", "b": [0.1294, 0.8335, 0.2471, 0.8532]}, {"w": "you’ll", "b": [0.2534, 0.8335, 0.3137, 0.8532]}, {"w": "definitely", "b": [0.32, 0.8335, 0.4167, 0.8532]}, {"w": "want", "b": [0.423, 0.8335, 0.472, 0.8532]}, {"w": "to", "b": [0.4783, 0.8335, 0.4979, 0.8532]}, {"w": "explore", "b": [0.5042, 0.8335, 0.5799, 0.8532]}, {"w": "many", "b": [0.5862, 0.8335, 0.6422, 0.8532]}, {"w": "different", "b": [0.6486, 0.8335, 0.7349, 0.8532]}, {"w": "configurations", "b": [0.1294, 0.854, 0.2751, 0.8737]}, {"w": "later.", "b": [0.2814, 0.854, 0.3312, 0.8737]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 8.9. Setting up the DeepDream configuration", "words": [{"w": "Listing", "b": [0.1294, 0.8918, 0.1862, 0.9066]}, {"w": "8.9.", "b": [0.1909, 0.8918, 0.2193, 0.9066]}, {"w": "Setting", "b": [0.224, 0.8918, 0.2808, 0.9066]}, {"w": "up", "b": [0.2855, 0.8918, 0.3065, 0.9066]}, {"w": "the", "b": [0.3113, 0.8918, 0.3365, 0.9066]}, {"w": "DeepDream", "b": [0.3412, 0.8918, 0.4375, 0.9066]}, {"w": "configuration", "b": [0.4423, 0.8918, 0.5516, 0.9066]}]}]}, {"page": 367, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "layer_contributions = { 1 'mixed2': 0.2, 'mixed3': 3., 'mixed4': 2., 'mixed5': 1.5, }", "words": [{"w": "layer_contributions", "b": [0.1357, 0.0851, 0.3514, 0.1002]}, {"w": "=", "b": [0.3628, 0.0851, 0.3741, 0.1002]}, {"w": "{", "b": [0.3855, 0.0851, 0.3968, 0.1002]}, {"w": "1", "b": [0.5104, 0.0851, 0.5217, 0.1002]}, {"w": "'mixed2':", "b": [0.1811, 0.1002, 0.2833, 0.1154]}, {"w": "0.2,", "b": [0.2946, 0.1002, 0.34, 0.1154]}, {"w": "'mixed3':", "b": [0.1811, 0.1154, 0.2833, 0.1305]}, {"w": "3.,", "b": [0.2946, 0.1154, 0.3287, 0.1305]}, {"w": "'mixed4':", "b": [0.1811, 0.1305, 0.2833, 0.1457]}, {"w": "2.,", "b": [0.2946, 0.1305, 0.3287, 0.1457]}, {"w": "'mixed5':", "b": [0.1811, 0.1457, 0.2833, 0.1608]}, {"w": "1.5,", "b": [0.2946, 0.1457, 0.34, 0.1608]}, {"w": "}", "b": [0.1357, 0.1608, 0.1471, 0.176]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Dictionary mapping layer names to a coefficient quantifying how much the layer’s activation contributes to the loss you’ll seek to maximize. Note that the layer names are hardcoded in the built-in Inception V3 application. You can list all layer names using model.summary().", "words": [{"w": "1", "b": [0.1799, 0.1944, 0.1925, 0.2142]}, {"w": "Dictionary", "b": [0.1988, 0.1944, 0.3137, 0.2142]}, {"w": "mapping", "b": [0.32, 0.1944, 0.4153, 0.2142]}, {"w": "layer", "b": [0.4216, 0.1944, 0.4763, 0.2142]}, {"w": "names", "b": [0.4826, 0.1944, 0.5512, 0.2142]}, {"w": "to", "b": [0.5575, 0.1944, 0.5786, 0.2142]}, {"w": "a", "b": [0.5849, 0.1944, 0.5975, 0.2142]}, {"w": "coefficient", "b": [0.6038, 0.1944, 0.7144, 0.2142]}, {"w": "quantifying", "b": [0.7208, 0.1944, 0.8455, 0.2142]}, {"w": "how", "b": [0.1799, 0.2149, 0.2247, 0.2347]}, {"w": "much", "b": [0.231, 0.2149, 0.2913, 0.2347]}, {"w": "the", "b": [0.2976, 0.2149, 0.3312, 0.2347]}, {"w": "layer’s", "b": [0.3375, 0.2149, 0.4099, 0.2347]}, {"w": "activation", "b": [0.4162, 0.2149, 0.5227, 0.2347]}, {"w": "contributes", "b": [0.529, 0.2149, 0.6509, 0.2347]}, {"w": "to", "b": [0.6572, 0.2149, 0.6782, 0.2347]}, {"w": "the", "b": [0.6846, 0.2149, 0.7182, 0.2347]}, {"w": "loss", "b": [0.7245, 0.2149, 0.7637, 0.2347]}, {"w": "you’ll", "b": [0.77, 0.2149, 0.8317, 0.2347]}, {"w": "seek", "b": [0.1799, 0.2354, 0.2261, 0.2552]}, {"w": "to", "b": [0.2324, 0.2354, 0.2534, 0.2552]}, {"w": "maximize.", "b": [0.2597, 0.2354, 0.3697, 0.2552]}, {"w": "Note", "b": [0.376, 0.2354, 0.4264, 0.2552]}, {"w": "that", "b": [0.4328, 0.2354, 0.4762, 0.2552]}, {"w": "the", "b": [0.4825, 0.2354, 0.5161, 0.2552]}, {"w": "layer", "b": [0.5224, 0.2354, 0.5771, 0.2552]}, {"w": "names", "b": [0.5834, 0.2354, 0.652, 0.2552]}, {"w": "are", "b": [0.6583, 0.2354, 0.6929, 0.2552]}, {"w": "hardcoded", "b": [0.6992, 0.2354, 0.8141, 0.2552]}, {"w": "in", "b": [0.8204, 0.2354, 0.8415, 0.2552]}, {"w": "the", "b": [0.1799, 0.2559, 0.2135, 0.2757]}, {"w": "built-in", "b": [0.2198, 0.2559, 0.2997, 0.2757]}, {"w": "Inception", "b": [0.306, 0.2559, 0.4083, 0.2757]}, {"w": "V3", "b": [0.4146, 0.2559, 0.4455, 0.2757]}, {"w": "application.", "b": [0.4518, 0.2559, 0.5786, 0.2757]}, {"w": "You", "b": [0.5849, 0.2559, 0.627, 0.2757]}, {"w": "can", "b": [0.6333, 0.2559, 0.6711, 0.2757]}, {"w": "list", "b": [0.6775, 0.2559, 0.7097, 0.2757]}, {"w": "all", "b": [0.716, 0.2559, 0.7426, 0.2757]}, {"w": "layer", "b": [0.7489, 0.2559, 0.8036, 0.2757]}, {"w": "names", "b": [0.1799, 0.2764, 0.2485, 0.2962]}, {"w": "using", "b": [0.2548, 0.2764, 0.3123, 0.2962]}, {"w": "model.summary().", "b": [0.3186, 0.2764, 0.5162, 0.2962]}]}, {"id": "b_2", "type": "paragraph", "text": "Now, let’s define a tensor that contains the loss: the weighted sum of the L2 norm of the activations of the layers in listing 8.9.", "words": [{"w": "Now,", "b": [0.1294, 0.3192, 0.1831, 0.3389]}, {"w": "let’s", "b": [0.1894, 0.3192, 0.2315, 0.3389]}, {"w": "define", "b": [0.2378, 0.3192, 0.3008, 0.3389]}, {"w": "a", "b": [0.3071, 0.3192, 0.3183, 0.3389]}, {"w": "tensor", "b": [0.3246, 0.3192, 0.3863, 0.3389]}, {"w": "that", "b": [0.3926, 0.3192, 0.4304, 0.3389]}, {"w": "contains", "b": [0.4367, 0.3192, 0.5208, 0.3389]}, {"w": "the", "b": [0.5271, 0.3192, 0.5579, 0.3389]}, {"w": "loss:", "b": [0.5642, 0.3192, 0.6105, 0.3389]}, {"w": "the", "b": [0.6168, 0.3192, 0.6476, 0.3389]}, {"w": "weighted", "b": [0.6539, 0.3192, 0.7464, 0.3389]}, {"w": "sum", "b": [0.7527, 0.3192, 0.7948, 0.3389]}, {"w": "of", "b": [0.8011, 0.3192, 0.8221, 0.3389]}, {"w": "the", "b": [0.8284, 0.3192, 0.8592, 0.3389]}, {"w": "L2", "b": [0.1294, 0.3397, 0.1574, 0.3594]}, {"w": "norm", "b": [0.1637, 0.3397, 0.217, 0.3594]}, {"w": "of", "b": [0.2233, 0.3397, 0.2443, 0.3594]}, {"w": "the", "b": [0.2506, 0.3397, 0.2814, 0.3594]}, {"w": "activations", "b": [0.2878, 0.3397, 0.3971, 0.3594]}, {"w": "of", "b": [0.4034, 0.3397, 0.4244, 0.3594]}, {"w": "the", "b": [0.4307, 0.3397, 0.4615, 0.3594]}, {"w": "layers", "b": [0.4678, 0.3397, 0.5281, 0.3594]}, {"w": "in", "b": [0.5344, 0.3397, 0.554, 0.3594]}, {"w": "listing", "b": [0.5602, 0.3397, 0.6233, 0.3594]}, {"w": "8.9.", "b": [0.6296, 0.3397, 0.6674, 0.3594]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 8.10. Defining the loss to be maximized", "words": [{"w": "Listing", "b": [0.1294, 0.3775, 0.1862, 0.3923]}, {"w": "8.10.", "b": [0.1909, 0.3775, 0.2288, 0.3923]}, {"w": "Defining", "b": [0.2335, 0.3775, 0.3028, 0.3923]}, {"w": "the", "b": [0.3076, 0.3775, 0.3328, 0.3923]}, {"w": "loss", "b": [0.3375, 0.3775, 0.367, 0.3923]}, {"w": "to", "b": [0.3717, 0.3775, 0.3875, 0.3923]}, {"w": "be", "b": [0.3922, 0.3775, 0.4111, 0.3923]}, {"w": "maximized", "b": [0.4158, 0.3775, 0.5041, 0.3923]}]}, {"id": "b_4", "type": "paragraph", "text": "layer_dict = dict([(layer.name, layer) for layer in model.layers]) 1 loss = K.variable(0.) 2 for layer_name in layer_contributions: coeff = layer_contributions[layer_name] activation = layer_dict[layer_name].output 3 scaling = K.prod(K.cast(K.shape(activation), 'float32')) loss += coeff * K.sum(K.square(activation[:, 2: -2, 2: -2, :])) / scaling 4", "words": [{"w": "layer_dict", "b": [0.1357, 0.406, 0.2492, 0.4211]}, {"w": "=", "b": [0.2606, 0.406, 0.2719, 0.4211]}, {"w": "dict([(layer.name,", "b": [0.2833, 0.406, 0.4876, 0.4211]}, {"w": "layer)", "b": [0.499, 0.406, 0.5671, 0.4211]}, {"w": "for", "b": [0.5784, 0.406, 0.6125, 0.4211]}, {"w": "layer", "b": [0.6238, 0.406, 0.6806, 0.4211]}, {"w": "in", "b": [0.6919, 0.406, 0.7146, 0.4211]}, {"w": "model.layers])", "b": [0.1357, 0.4211, 0.2946, 0.4363]}, {"w": "1", "b": [0.4309, 0.4211, 0.4423, 0.4363]}, {"w": "loss", "b": [0.1357, 0.4514, 0.1811, 0.4666]}, {"w": "=", "b": [0.1925, 0.4514, 0.2038, 0.4666]}, {"w": "K.variable(0.)", "b": [0.2152, 0.4514, 0.3741, 0.4666]}, {"w": "2", "b": [0.1357, 0.4666, 0.1471, 0.4817]}, {"w": "for", "b": [0.1357, 0.4817, 0.1698, 0.4969]}, {"w": "layer_name", "b": [0.1811, 0.4817, 0.2946, 0.4969]}, {"w": "in", "b": [0.306, 0.4817, 0.3287, 0.4969]}, {"w": "layer_contributions:", "b": [0.34, 0.4817, 0.5671, 0.4969]}, {"w": "coeff", "b": [0.1811, 0.4969, 0.2379, 0.512]}, {"w": "=", "b": [0.2492, 0.4969, 0.2606, 0.512]}, {"w": "layer_contributions[layer_name]", "b": [0.2719, 0.4969, 0.6238, 0.512]}, {"w": "activation", "b": [0.1811, 0.512, 0.2946, 0.5272]}, {"w": "=", "b": [0.306, 0.512, 0.3173, 0.5272]}, {"w": "layer_dict[layer_name].output", "b": [0.3287, 0.512, 0.6579, 0.5272]}, {"w": "3", "b": [0.1357, 0.5272, 0.1471, 0.5423]}, {"w": "scaling", "b": [0.1811, 0.5575, 0.2606, 0.5726]}, {"w": "=", "b": [0.2719, 0.5575, 0.2833, 0.5726]}, {"w": "K.prod(K.cast(K.shape(activation),", "b": [0.2946, 0.5575, 0.6806, 0.5726]}, {"w": "'float32'))", "b": [0.6919, 0.5575, 0.8168, 0.5726]}, {"w": "loss", "b": [0.1811, 0.5726, 0.2265, 0.5878]}, {"w": "+=", "b": [0.2379, 0.5726, 0.2606, 0.5878]}, {"w": "coeff", "b": [0.2719, 0.5726, 0.3287, 0.5878]}, {"w": "*", "b": [0.34, 0.5726, 0.3514, 0.5878]}, {"w": "K.sum(K.square(activation[:,", "b": [0.3628, 0.5726, 0.6806, 0.5878]}, {"w": "2:", "b": [0.6919, 0.5726, 0.7146, 0.5878]}, {"w": "-2,", "b": [0.726, 0.5726, 0.7601, 0.5878]}, {"w": "2:", "b": [0.7714, 0.5726, 0.7941, 0.5878]}, {"w": "-2,", "b": [0.8055, 0.5726, 0.8395, 0.5878]}, {"w": ":]))", "b": [0.1357, 0.5878, 0.1811, 0.6029]}, {"w": "/", "b": [0.1925, 0.5878, 0.2038, 0.6029]}, {"w": "scaling", "b": [0.2152, 0.5878, 0.2946, 0.6029]}, {"w": "4", "b": [0.306, 0.5878, 0.3174, 0.6029]}]}, {"id": "b_5", "type": "paragraph", "text": "1 Creates a dictionary that maps layer names to layer instances 2 You’ll define the loss by adding layer contributions to this scalar variable. 3 Retrieves the layer’s output 4 Adds the L2 norm of the features of a layer to the loss. You avoid border artifacts by only involving nonborder pixels in the loss.", "words": [{"w": "1", "b": [0.1799, 0.6214, 0.1925, 0.6411]}, {"w": "Creates", "b": [0.1988, 0.6214, 0.281, 0.6411]}, {"w": "a", "b": [0.2873, 0.6214, 0.2999, 0.6411]}, {"w": "dictionary", "b": [0.3062, 0.6214, 0.4169, 0.6411]}, {"w": "that", "b": [0.4232, 0.6214, 0.4667, 0.6411]}, {"w": "maps", "b": [0.473, 0.6214, 0.5304, 0.6411]}, {"w": "layer", "b": [0.5367, 0.6214, 0.5914, 0.6411]}, {"w": "names", "b": [0.5977, 0.6214, 0.6663, 0.6411]}, {"w": "to", "b": [0.6726, 0.6214, 0.6937, 0.6411]}, {"w": "layer", "b": [0.7, 0.6214, 0.7546, 0.6411]}, {"w": "instances", "b": [0.7609, 0.6214, 0.859, 0.6411]}, {"w": "2", "b": [0.1799, 0.6419, 0.1925, 0.6616]}, {"w": "You’ll", "b": [0.1988, 0.6419, 0.2633, 0.6616]}, {"w": "define", "b": [0.2696, 0.6419, 0.3354, 0.6616]}, {"w": "the", "b": [0.3417, 0.6419, 0.3754, 0.6616]}, {"w": "loss", "b": [0.3817, 0.6419, 0.4209, 0.6616]}, {"w": "by", "b": [0.4272, 0.6419, 0.4539, 0.6616]}, {"w": "adding", "b": [0.4602, 0.6419, 0.5345, 0.6616]}, {"w": "layer", "b": [0.5408, 0.6419, 0.5954, 0.6616]}, {"w": "contributions", "b": [0.6017, 0.6419, 0.7461, 0.6616]}, {"w": "to", "b": [0.7524, 0.6419, 0.7734, 0.6616]}, {"w": "this", "b": [0.7797, 0.6419, 0.819, 0.6616]}, {"w": "scalar", "b": [0.1799, 0.6624, 0.2443, 0.6821]}, {"w": "variable.", "b": [0.2506, 0.6624, 0.3452, 0.6821]}, {"w": "3", "b": [0.1799, 0.6829, 0.1925, 0.7026]}, {"w": "Retrieves", "b": [0.1988, 0.6829, 0.2996, 0.7026]}, {"w": "the", "b": [0.3059, 0.6829, 0.3396, 0.7026]}, {"w": "layer’s", "b": [0.3459, 0.6829, 0.4182, 0.7026]}, {"w": "output", "b": [0.4245, 0.6829, 0.496, 0.7026]}, {"w": "4", "b": [0.1799, 0.7034, 0.1925, 0.7231]}, {"w": "Adds", "b": [0.1988, 0.7034, 0.2549, 0.7231]}, {"w": "the", "b": [0.2612, 0.7034, 0.2948, 0.7231]}, {"w": "L2", "b": [0.3011, 0.7034, 0.3305, 0.7231]}, {"w": "norm", "b": [0.3368, 0.7034, 0.3957, 0.7231]}, {"w": "of", "b": [0.402, 0.7034, 0.423, 0.7231]}, {"w": "the", "b": [0.4293, 0.7034, 0.4629, 0.7231]}, {"w": "features", "b": [0.4693, 0.7034, 0.5557, 0.7231]}, {"w": "of", "b": [0.562, 0.7034, 0.583, 0.7231]}, {"w": "a", "b": [0.5893, 0.7034, 0.6019, 0.7231]}, {"w": "layer", "b": [0.6082, 0.7034, 0.6628, 0.7231]}, {"w": "to", "b": [0.6692, 0.7034, 0.6902, 0.7231]}, {"w": "the", "b": [0.6965, 0.7034, 0.7301, 0.7231]}, {"w": "loss.", "b": [0.7364, 0.7034, 0.782, 0.7231]}, {"w": "You", "b": [0.7883, 0.7034, 0.8303, 0.7231]}, {"w": "avoid", "b": [0.1799, 0.7239, 0.2387, 0.7436]}, {"w": "border", "b": [0.245, 0.7239, 0.3193, 0.7436]}, {"w": "artifacts", "b": [0.3256, 0.7239, 0.4153, 0.7436]}, {"w": "by", "b": [0.4216, 0.7239, 0.4482, 0.7436]}, {"w": "only", "b": [0.4545, 0.7239, 0.5008, 0.7436]}, {"w": "involving", "b": [0.5071, 0.7239, 0.6066, 0.7436]}, {"w": "nonborder", "b": [0.6129, 0.7239, 0.7279, 0.7436]}, {"w": "pixels", "b": [0.7342, 0.7239, 0.7959, 0.7436]}, {"w": "in", "b": [0.8022, 0.7239, 0.8232, 0.7436]}, {"w": "the", "b": [0.8295, 0.7239, 0.8631, 0.7436]}, {"w": "loss.", "b": [0.1799, 0.7444, 0.2254, 0.7641]}]}, {"id": "b_6", "type": "equation", "text": "Next, you can set up the gradient-ascent process.", "words": [{"w": "Next,", "b": [0.1294, 0.7871, 0.1848, 0.8069]}, {"w": "you", "b": [0.1911, 0.7871, 0.2289, 0.8069]}, {"w": "can", "b": [0.2352, 0.7871, 0.2702, 0.8069]}, {"w": "set", "b": [0.2765, 0.7871, 0.3046, 0.8069]}, {"w": "up", "b": [0.3109, 0.7871, 0.3361, 0.8069]}, {"w": "the", "b": [0.3424, 0.7871, 0.3732, 0.8069]}, {"w": "gradient-ascent", "b": [0.3795, 0.7871, 0.5336, 0.8069]}, {"w": "process.", "b": [0.5399, 0.7871, 0.6219, 0.8069]}]}, {"id": "b_7", "type": "equation", "text": "Listing 8.11. Gradient-ascent process", "words": [{"w": "Listing", "b": [0.1294, 0.825, 0.1862, 0.8398]}, {"w": "8.11.", "b": [0.1909, 0.825, 0.2277, 0.8398]}, {"w": "Gradient-ascent", "b": [0.2324, 0.825, 0.3627, 0.8398]}, {"w": "process", "b": [0.3675, 0.825, 0.427, 0.8398]}]}, {"id": "b_8", "type": "equation", "text": "dream = model.input 1 grads = K.gradients(loss, dream)[0]", "words": [{"w": "dream", "b": [0.1357, 0.8534, 0.1925, 0.8685]}, {"w": "=", "b": [0.2038, 0.8534, 0.2152, 0.8685]}, {"w": "model.input", "b": [0.2265, 0.8534, 0.3514, 0.8685]}, {"w": "1", "b": [0.1357, 0.8685, 0.1471, 0.8837]}, {"w": "grads", "b": [0.1357, 0.8989, 0.1925, 0.914]}, {"w": "=", "b": [0.2038, 0.8989, 0.2152, 0.914]}, {"w": "K.gradients(loss,", "b": [0.2265, 0.8989, 0.4195, 0.914]}, {"w": "dream)[0]", "b": [0.4309, 0.8989, 0.533, 0.914]}]}]}, {"page": 368, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2 grads /= K.maximum(K.mean(K.abs(grads)), 1e-7) 3 outputs = [loss, grads] 4 fetch_loss_and_grads = K.function([dream], outputs) 4 def eval_loss_and_grads(x): outs = fetch_loss_and_grads([x]) loss_value = outs[0] grad_values = outs[1] return loss_value, grad_values def gradient_ascent(x, iterations, step, max_loss=None): 5 for i in range(iterations): 5 loss_value, grad_values = eval_loss_and_grads(x) 5 if max_loss is not None and loss_value > max_loss: 5 break 5 print('...Loss value at', i, ':', loss_value) 5 x += step * grad_values 5 return x 5", "words": [{"w": "2", "b": [0.1357, 0.0851, 0.1471, 0.1002]}, {"w": "grads", "b": [0.1357, 0.1154, 0.1925, 0.1305]}, {"w": "/=", "b": [0.2038, 0.1154, 0.2265, 0.1305]}, {"w": "K.maximum(K.mean(K.abs(grads)),", "b": [0.2379, 0.1154, 0.5898, 0.1305]}, {"w": "1e-7)", "b": [0.6011, 0.1154, 0.6579, 0.1305]}, {"w": "3", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "outputs", "b": [0.1357, 0.1608, 0.2152, 0.176]}, {"w": "=", "b": [0.2265, 0.1608, 0.2379, 0.176]}, {"w": "[loss,", "b": [0.2492, 0.1608, 0.3173, 0.176]}, {"w": "grads]", "b": [0.3287, 0.1608, 0.3968, 0.176]}, {"w": "4", "b": [0.1357, 0.176, 0.1471, 0.1911]}, {"w": "fetch_loss_and_grads", "b": [0.1357, 0.1912, 0.3628, 0.2063]}, {"w": "=", "b": [0.3741, 0.1912, 0.3855, 0.2063]}, {"w": "K.function([dream],", "b": [0.3968, 0.1912, 0.6125, 0.2063]}, {"w": "outputs)", "b": [0.6238, 0.1912, 0.7146, 0.2063]}, {"w": "4", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "def", "b": [0.1357, 0.2366, 0.1698, 0.2518]}, {"w": "eval_loss_and_grads(x):", "b": [0.1811, 0.2366, 0.4422, 0.2518]}, {"w": "outs", "b": [0.1811, 0.2518, 0.2265, 0.2669]}, {"w": "=", "b": [0.2379, 0.2518, 0.2492, 0.2669]}, {"w": "fetch_loss_and_grads([x])", "b": [0.2606, 0.2518, 0.5444, 0.2669]}, {"w": "loss_value", "b": [0.1811, 0.2669, 0.2946, 0.2821]}, {"w": "=", "b": [0.306, 0.2669, 0.3173, 0.2821]}, {"w": "outs[0]", "b": [0.3287, 0.2669, 0.4082, 0.2821]}, {"w": "grad_values", "b": [0.1811, 0.2821, 0.306, 0.2972]}, {"w": "=", "b": [0.3173, 0.2821, 0.3287, 0.2972]}, {"w": "outs[1]", "b": [0.34, 0.2821, 0.4195, 0.2972]}, {"w": "return", "b": [0.1811, 0.2972, 0.2492, 0.3124]}, {"w": "loss_value,", "b": [0.2606, 0.2972, 0.3855, 0.3124]}, {"w": "grad_values", "b": [0.3968, 0.2972, 0.5217, 0.3124]}, {"w": "def", "b": [0.1357, 0.3275, 0.1698, 0.3427]}, {"w": "gradient_ascent(x,", "b": [0.1811, 0.3275, 0.3855, 0.3427]}, {"w": "iterations,", "b": [0.3968, 0.3275, 0.5217, 0.3427]}, {"w": "step,", "b": [0.533, 0.3275, 0.5898, 0.3427]}, {"w": "max_loss=None):", "b": [0.6011, 0.3275, 0.7714, 0.3427]}, {"w": "5", "b": [0.1357, 0.3427, 0.1471, 0.3578]}, {"w": "for", "b": [0.1811, 0.3578, 0.2152, 0.373]}, {"w": "i", "b": [0.2265, 0.3578, 0.2379, 0.373]}, {"w": "in", "b": [0.2492, 0.3578, 0.2719, 0.373]}, {"w": "range(iterations):", "b": [0.2833, 0.3578, 0.4876, 0.373]}, {"w": "5", "b": [0.1357, 0.373, 0.1471, 0.3881]}, {"w": "loss_value,", "b": [0.2265, 0.3881, 0.3514, 0.4033]}, {"w": "grad_values", "b": [0.3628, 0.3881, 0.4876, 0.4033]}, {"w": "=", "b": [0.499, 0.3881, 0.5103, 0.4033]}, {"w": "eval_loss_and_grads(x)", "b": [0.5217, 0.3881, 0.7714, 0.4033]}, {"w": "5", "b": [0.1357, 0.4033, 0.1471, 0.4184]}, {"w": "if", "b": [0.2265, 0.4184, 0.2492, 0.4336]}, {"w": "max_loss", "b": [0.2606, 0.4184, 0.3514, 0.4336]}, {"w": "is", "b": [0.3628, 0.4184, 0.3855, 0.4336]}, {"w": "not", "b": [0.3968, 0.4184, 0.4309, 0.4336]}, {"w": "None", "b": [0.4422, 0.4184, 0.4876, 0.4336]}, {"w": "and", "b": [0.499, 0.4184, 0.533, 0.4336]}, {"w": "loss_value", "b": [0.5444, 0.4184, 0.6579, 0.4336]}, {"w": ">", "b": [0.6692, 0.4184, 0.6806, 0.4336]}, {"w": "max_loss:", "b": [0.6919, 0.4184, 0.7941, 0.4336]}, {"w": "5", "b": [0.1357, 0.4336, 0.1471, 0.4487]}, {"w": "break", "b": [0.2719, 0.4487, 0.3287, 0.4639]}, {"w": "5", "b": [0.1357, 0.4639, 0.1471, 0.479]}, {"w": "print('...Loss", "b": [0.2265, 0.479, 0.3855, 0.4942]}, {"w": "value", "b": [0.3968, 0.479, 0.4536, 0.4942]}, {"w": "at',", "b": [0.4649, 0.479, 0.5103, 0.4942]}, {"w": "i,", "b": [0.5217, 0.479, 0.5444, 0.4942]}, {"w": "':',", "b": [0.5557, 0.479, 0.6011, 0.4942]}, {"w": "loss_value)", "b": [0.6125, 0.479, 0.7374, 0.4942]}, {"w": "5", "b": [0.1357, 0.4942, 0.1471, 0.5093]}, {"w": "x", "b": [0.2265, 0.5094, 0.2379, 0.5245]}, {"w": "+=", "b": [0.2492, 0.5094, 0.2719, 0.5245]}, {"w": "step", "b": [0.2833, 0.5094, 0.3287, 0.5245]}, {"w": "*", "b": [0.34, 0.5094, 0.3514, 0.5245]}, {"w": "grad_values", "b": [0.3628, 0.5094, 0.4876, 0.5245]}, {"w": "5", "b": [0.1357, 0.5245, 0.1471, 0.5396]}, {"w": "return", "b": [0.1811, 0.5397, 0.2492, 0.5548]}, {"w": "x", "b": [0.2606, 0.5397, 0.2719, 0.5548]}, {"w": "5", "b": [0.1357, 0.5548, 0.1471, 0.57]}]}, {"id": "b_1", "type": "paragraph", "text": "1 This tensor holds the generated image: the dream. 2 Computes the gradients of the dream with regard to the loss 3 Normalizes the gradients (important trick) 4 Sets up a Keras function to retrieve the value of the loss and gradients, given an input image 5 This function runs gradient ascent for a number of iterations.", "words": [{"w": "1", "b": [0.1799, 0.5884, 0.1925, 0.6081]}, {"w": "This", "b": [0.1988, 0.5884, 0.2465, 0.6081]}, {"w": "tensor", "b": [0.2528, 0.5884, 0.32, 0.6081]}, {"w": "holds", "b": [0.3263, 0.5884, 0.3838, 0.6081]}, {"w": "the", "b": [0.3901, 0.5884, 0.4237, 0.6081]}, {"w": "generated", "b": [0.4301, 0.5884, 0.5365, 0.6081]}, {"w": "image:", "b": [0.5428, 0.5884, 0.6157, 0.6081]}, {"w": "the", "b": [0.622, 0.5884, 0.6556, 0.6081]}, {"w": "dream.", "b": [0.6619, 0.5884, 0.7378, 0.6081]}, {"w": "2", "b": [0.1799, 0.6089, 0.1925, 0.6286]}, {"w": "Computes", "b": [0.1988, 0.6089, 0.3081, 0.6286]}, {"w": "the", "b": [0.3144, 0.6089, 0.348, 0.6286]}, {"w": "gradients", "b": [0.3543, 0.6089, 0.4552, 0.6286]}, {"w": "of", "b": [0.4615, 0.6089, 0.4825, 0.6286]}, {"w": "the", "b": [0.4889, 0.6089, 0.5225, 0.6286]}, {"w": "dream", "b": [0.5288, 0.6089, 0.5984, 0.6286]}, {"w": "with", "b": [0.6047, 0.6089, 0.6524, 0.6286]}, {"w": "regard", "b": [0.6587, 0.6089, 0.7311, 0.6286]}, {"w": "to", "b": [0.7374, 0.6089, 0.7584, 0.6286]}, {"w": "the", "b": [0.7647, 0.6089, 0.7983, 0.6286]}, {"w": "loss", "b": [0.8046, 0.6089, 0.8439, 0.6286]}, {"w": "3", "b": [0.1799, 0.6294, 0.1925, 0.6491]}, {"w": "Normalizes", "b": [0.1988, 0.6294, 0.3207, 0.6491]}, {"w": "the", "b": [0.327, 0.6294, 0.3606, 0.6491]}, {"w": "gradients", "b": [0.3669, 0.6294, 0.4678, 0.6491]}, {"w": "(important", "b": [0.4741, 0.6294, 0.5918, 0.6491]}, {"w": "trick)", "b": [0.5981, 0.6294, 0.6584, 0.6491]}, {"w": "4", "b": [0.1799, 0.6499, 0.1925, 0.6696]}, {"w": "Sets", "b": [0.1988, 0.6499, 0.2422, 0.6696]}, {"w": "up", "b": [0.2485, 0.6499, 0.2766, 0.6696]}, {"w": "a", "b": [0.2829, 0.6499, 0.2955, 0.6696]}, {"w": "Keras", "b": [0.3018, 0.6499, 0.3663, 0.6696]}, {"w": "function", "b": [0.3726, 0.6499, 0.4623, 0.6696]}, {"w": "to", "b": [0.4686, 0.6499, 0.4896, 0.6696]}, {"w": "retrieve", "b": [0.4959, 0.6499, 0.5795, 0.6696]}, {"w": "the", "b": [0.5858, 0.6499, 0.6194, 0.6696]}, {"w": "value", "b": [0.6257, 0.6499, 0.6832, 0.6696]}, {"w": "of", "b": [0.6895, 0.6499, 0.7105, 0.6696]}, {"w": "the", "b": [0.7168, 0.6499, 0.7504, 0.6696]}, {"w": "loss", "b": [0.7567, 0.6499, 0.796, 0.6696]}, {"w": "and", "b": [0.8023, 0.6499, 0.843, 0.6696]}, {"w": "gradients,", "b": [0.1799, 0.6704, 0.2871, 0.6901]}, {"w": "given", "b": [0.2934, 0.6704, 0.3508, 0.6901]}, {"w": "an", "b": [0.3572, 0.6704, 0.3838, 0.6901]}, {"w": "input", "b": [0.3901, 0.6704, 0.4476, 0.6901]}, {"w": "image", "b": [0.4539, 0.6704, 0.5183, 0.6901]}, {"w": "5", "b": [0.1799, 0.6909, 0.1925, 0.7106]}, {"w": "This", "b": [0.1988, 0.6909, 0.2465, 0.7106]}, {"w": "function", "b": [0.2528, 0.6909, 0.3425, 0.7106]}, {"w": "runs", "b": [0.3488, 0.6909, 0.3978, 0.7106]}, {"w": "gradient", "b": [0.4041, 0.6909, 0.4952, 0.7106]}, {"w": "ascent", "b": [0.5015, 0.6909, 0.5688, 0.7106]}, {"w": "for", "b": [0.5751, 0.6909, 0.6073, 0.7106]}, {"w": "a", "b": [0.6136, 0.6909, 0.6262, 0.7106]}, {"w": "number", "b": [0.6325, 0.6909, 0.718, 0.7106]}, {"w": "of", "b": [0.7243, 0.6909, 0.7453, 0.7106]}, {"w": "iterations.", "b": [0.7517, 0.6909, 0.8603, 0.7106]}]}, {"id": "b_2", "type": "paragraph", "text": "Finally: the actual DeepDream algorithm. First, you define a list of scales (also called octaves) at which to process the images. Each successive scale is larger than the previous one by a factor of 1.4 (it’s 40% larger): you start by processing a small image and then increasingly scale it up (see figure 8.4).", "words": [{"w": "Finally:", "b": [0.1294, 0.7337, 0.2079, 0.7534]}, {"w": "the", "b": [0.2142, 0.7337, 0.245, 0.7534]}, {"w": "actual", "b": [0.2514, 0.7337, 0.3116, 0.7534]}, {"w": "DeepDream", "b": [0.3179, 0.7337, 0.4398, 0.7534]}, {"w": "algorithm.", "b": [0.4461, 0.7337, 0.5505, 0.7534]}, {"w": "First,", "b": [0.5568, 0.7337, 0.6094, 0.7534]}, {"w": "you", "b": [0.6157, 0.7337, 0.6535, 0.7534]}, {"w": "define", "b": [0.6598, 0.7337, 0.7228, 0.7534]}, {"w": "a", "b": [0.7292, 0.7337, 0.7404, 0.7534]}, {"w": "list", "b": [0.7467, 0.7337, 0.7775, 0.7534]}, {"w": "of", "b": [0.7838, 0.7337, 0.8048, 0.7534]}, {"w": "scales", "b": [0.1294, 0.7542, 0.1911, 0.7739]}, {"w": "(also", "b": [0.1974, 0.7542, 0.2464, 0.7739]}, {"w": "called", "b": [0.2527, 0.7542, 0.3129, 0.7739]}, {"w": "octaves)", "b": [0.3192, 0.7542, 0.4033, 0.7739]}, {"w": "at", "b": [0.4096, 0.7542, 0.4278, 0.7739]}, {"w": "which", "b": [0.4341, 0.7542, 0.4957, 0.7739]}, {"w": "to", "b": [0.502, 0.7542, 0.5217, 0.7739]}, {"w": "process", "b": [0.528, 0.7542, 0.6036, 0.7739]}, {"w": "the", "b": [0.6099, 0.7542, 0.6408, 0.7739]}, {"w": "images.", "b": [0.6471, 0.7542, 0.7248, 0.7739]}, {"w": "Each", "b": [0.7311, 0.7542, 0.7816, 0.7739]}, {"w": "successive", "b": [0.1294, 0.7747, 0.2359, 0.7944]}, {"w": "scale", "b": [0.2422, 0.7747, 0.2926, 0.7944]}, {"w": "is", "b": [0.2989, 0.7747, 0.3158, 0.7944]}, {"w": "larger", "b": [0.3221, 0.7747, 0.3804, 0.7944]}, {"w": "than", "b": [0.3867, 0.7747, 0.4301, 0.7944]}, {"w": "the", "b": [0.4365, 0.7747, 0.4673, 0.7944]}, {"w": "previous", "b": [0.4736, 0.7747, 0.5605, 0.7944]}, {"w": "one", "b": [0.5668, 0.7747, 0.6032, 0.7944]}, {"w": "by", "b": [0.6095, 0.7747, 0.6347, 0.7944]}, {"w": "a", "b": [0.641, 0.7747, 0.6522, 0.7944]}, {"w": "factor", "b": [0.6585, 0.7747, 0.7174, 0.7944]}, {"w": "of", "b": [0.7237, 0.7747, 0.7447, 0.7944]}, {"w": "1.4", "b": [0.751, 0.7747, 0.7825, 0.7944]}, {"w": "(it’s", "b": [0.7888, 0.7747, 0.828, 0.7944]}, {"w": "40%", "b": [0.1294, 0.7952, 0.1757, 0.8149]}, {"w": "larger):", "b": [0.182, 0.7952, 0.2557, 0.8149]}, {"w": "you", "b": [0.262, 0.7952, 0.2999, 0.8149]}, {"w": "start", "b": [0.3062, 0.7952, 0.3496, 0.8149]}, {"w": "by", "b": [0.3559, 0.7952, 0.3811, 0.8149]}, {"w": "processing", "b": [0.3874, 0.7952, 0.4953, 0.8149]}, {"w": "a", "b": [0.5016, 0.7952, 0.5128, 0.8149]}, {"w": "small", "b": [0.5192, 0.7952, 0.5738, 0.8149]}, {"w": "image", "b": [0.5801, 0.7952, 0.6418, 0.8149]}, {"w": "and", "b": [0.6481, 0.7952, 0.6845, 0.8149]}, {"w": "then", "b": [0.6908, 0.7952, 0.7343, 0.8149]}, {"w": "increasingly", "b": [0.7406, 0.7952, 0.8639, 0.8149]}, {"w": "scale", "b": [0.1294, 0.8157, 0.1798, 0.8354]}, {"w": "it", "b": [0.1861, 0.8157, 0.2002, 0.8354]}, {"w": "up", "b": [0.2065, 0.8157, 0.2317, 0.8354]}, {"w": "(see", "b": [0.238, 0.8157, 0.2786, 0.8354]}, {"w": "figure", "b": [0.2849, 0.8157, 0.3451, 0.8354]}, {"w": "8.4).", "b": [0.3515, 0.8157, 0.3977, 0.8354]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 8.4. The DeepDream process: successive scales of spatial processing (octaves) and detail reinjection upon upscaling", "words": [{"w": "Figure", "b": [0.1294, 0.8535, 0.1827, 0.8683]}, {"w": "8.4.", "b": [0.1874, 0.8535, 0.2158, 0.8683]}, {"w": "The", "b": [0.2205, 0.8535, 0.252, 0.8683]}, {"w": "DeepDream", "b": [0.2567, 0.8535, 0.3531, 0.8683]}, {"w": "process:", "b": [0.3578, 0.8535, 0.4237, 0.8683]}, {"w": "successive", "b": [0.4284, 0.8535, 0.5093, 0.8683]}, {"w": "scales", "b": [0.514, 0.8535, 0.5603, 0.8683]}, {"w": "of", "b": [0.565, 0.8535, 0.5808, 0.8683]}, {"w": "spatial", "b": [0.5855, 0.8535, 0.6391, 0.8683]}, {"w": "processing", "b": [0.6438, 0.8535, 0.7286, 0.8683]}, {"w": "(octaves)", "b": [0.7334, 0.8535, 0.8048, 0.8683]}, {"w": "and", "b": [0.8095, 0.8535, 0.84, 0.8683]}, {"w": "detail", "b": [0.1294, 0.8687, 0.1746, 0.8835]}, {"w": "reinjection", "b": [0.1793, 0.8687, 0.2662, 0.8835]}, {"w": "upon", "b": [0.2709, 0.8687, 0.312, 0.8835]}, {"w": "upscaling", "b": [0.3167, 0.8687, 0.3934, 0.8835]}]}]}, {"page": 369, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "For each successive scale, from the smallest to the largest, you run gradient ascent to maximize the loss you previously defined, at that scale. After each gradient ascent run, you upscale the resulting image by 40%.", "words": [{"w": "For", "b": [0.1294, 0.3335, 0.1645, 0.3532]}, {"w": "each", "b": [0.1708, 0.3335, 0.217, 0.3532]}, {"w": "successive", "b": [0.2233, 0.3335, 0.3298, 0.3532]}, {"w": "scale,", "b": [0.3361, 0.3335, 0.3928, 0.3532]}, {"w": "from", "b": [0.3991, 0.3335, 0.4481, 0.3532]}, {"w": "the", "b": [0.4544, 0.3335, 0.4853, 0.3532]}, {"w": "smallest", "b": [0.4916, 0.3335, 0.5743, 0.3532]}, {"w": "to", "b": [0.5806, 0.3335, 0.6002, 0.3532]}, {"w": "the", "b": [0.6065, 0.3335, 0.6373, 0.3532]}, {"w": "largest,", "b": [0.6436, 0.3335, 0.7167, 0.3532]}, {"w": "you", "b": [0.723, 0.3335, 0.7608, 0.3532]}, {"w": "run", "b": [0.7671, 0.3335, 0.8007, 0.3532]}, {"w": "gradient", "b": [0.1294, 0.354, 0.2121, 0.3737]}, {"w": "ascent", "b": [0.2184, 0.354, 0.2814, 0.3737]}, {"w": "to", "b": [0.2877, 0.354, 0.3074, 0.3737]}, {"w": "maximize", "b": [0.3137, 0.354, 0.4132, 0.3737]}, {"w": "the", "b": [0.4195, 0.354, 0.4503, 0.3737]}, {"w": "loss", "b": [0.4566, 0.354, 0.4958, 0.3737]}, {"w": "you", "b": [0.5021, 0.354, 0.54, 0.3737]}, {"w": "previously", "b": [0.5463, 0.354, 0.6528, 0.3737]}, {"w": "defined,", "b": [0.6591, 0.354, 0.7411, 0.3737]}, {"w": "at", "b": [0.7473, 0.354, 0.7655, 0.3737]}, {"w": "that", "b": [0.7718, 0.354, 0.8096, 0.3737]}, {"w": "scale.", "b": [0.1294, 0.3745, 0.1861, 0.3942]}, {"w": "After", "b": [0.1925, 0.3745, 0.2457, 0.3942]}, {"w": "each", "b": [0.252, 0.3745, 0.2982, 0.3942]}, {"w": "gradient", "b": [0.3045, 0.3745, 0.3872, 0.3942]}, {"w": "ascent", "b": [0.3935, 0.3745, 0.4565, 0.3942]}, {"w": "run,", "b": [0.4628, 0.3745, 0.5028, 0.3942]}, {"w": "you", "b": [0.5091, 0.3745, 0.5469, 0.3942]}, {"w": "upscale", "b": [0.5532, 0.3745, 0.6289, 0.3942]}, {"w": "the", "b": [0.6352, 0.3745, 0.666, 0.3942]}, {"w": "resulting", "b": [0.6723, 0.3745, 0.7606, 0.3942]}, {"w": "image", "b": [0.7669, 0.3745, 0.8285, 0.3942]}, {"w": "by", "b": [0.8349, 0.3745, 0.8601, 0.3942]}, {"w": "40%.", "b": [0.1294, 0.395, 0.182, 0.4147]}]}, {"id": "b_1", "type": "paragraph", "text": "To avoid losing a lot of image detail after each successive scale-up (resulting in increasingly blurry or pixelated images), you can use a simple trick: after each scale-up, you’ll reinject the lost details back into the image, which is possible because you know what the original image should look like at the larger scale. Given a small image size S and a larger image size L, you can compute the difference between the original image resized to size L and the original resized to size S—this difference quantifies the details lost when going from S to L.", "words": [{"w": "To", "b": [0.1294, 0.4377, 0.1557, 0.4575]}, {"w": "avoid", "b": [0.162, 0.4377, 0.218, 0.4575]}, {"w": "losing", "b": [0.2243, 0.4377, 0.286, 0.4575]}, {"w": "a", "b": [0.2923, 0.4377, 0.3035, 0.4575]}, {"w": "lot", "b": [0.3098, 0.4377, 0.3365, 0.4575]}, {"w": "of", "b": [0.3428, 0.4377, 0.3638, 0.4575]}, {"w": "image", "b": [0.3701, 0.4377, 0.4317, 0.4575]}, {"w": "detail", "b": [0.438, 0.4377, 0.4941, 0.4575]}, {"w": "after", "b": [0.5004, 0.4377, 0.5466, 0.4575]}, {"w": "each", "b": [0.5529, 0.4377, 0.5991, 0.4575]}, {"w": "successive", "b": [0.6054, 0.4377, 0.7119, 0.4575]}, {"w": "scale-up", "b": [0.7182, 0.4377, 0.8023, 0.4575]}, {"w": "(resulting", "b": [0.1294, 0.4582, 0.2261, 0.478]}, {"w": "in", "b": [0.2324, 0.4582, 0.252, 0.478]}, {"w": "increasingly", "b": [0.2583, 0.4582, 0.3816, 0.478]}, {"w": "blurry", "b": [0.388, 0.4582, 0.4496, 0.478]}, {"w": "or", "b": [0.4559, 0.4582, 0.4769, 0.478]}, {"w": "pixelated", "b": [0.4832, 0.4582, 0.5757, 0.478]}, {"w": "images),", "b": [0.582, 0.4582, 0.6682, 0.478]}, {"w": "you", "b": [0.6744, 0.4582, 0.7122, 0.478]}, {"w": "can", "b": [0.7186, 0.4582, 0.7536, 0.478]}, {"w": "use", "b": [0.7599, 0.4582, 0.7935, 0.478]}, {"w": "a", "b": [0.7998, 0.4582, 0.811, 0.478]}, {"w": "simple", "b": [0.1294, 0.4787, 0.1967, 0.4985]}, {"w": "trick:", "b": [0.203, 0.4787, 0.2562, 0.4985]}, {"w": "after", "b": [0.2626, 0.4787, 0.3088, 0.4985]}, {"w": "each", "b": [0.3151, 0.4787, 0.3613, 0.4985]}, {"w": "scale-up,", "b": [0.3676, 0.4787, 0.458, 0.4985]}, {"w": "you’ll", "b": [0.4643, 0.4787, 0.5245, 0.4985]}, {"w": "reinject", "b": [0.5308, 0.4787, 0.6065, 0.4985]}, {"w": "the", "b": [0.6128, 0.4787, 0.6436, 0.4985]}, {"w": "lost", "b": [0.6499, 0.4787, 0.6864, 0.4985]}, {"w": "details", "b": [0.6927, 0.4787, 0.7585, 0.4985]}, {"w": "back", "b": [0.7648, 0.4787, 0.8125, 0.4985]}, {"w": "into", "b": [0.8188, 0.4787, 0.858, 0.4985]}, {"w": "the", "b": [0.1294, 0.4992, 0.1602, 0.519]}, {"w": "image,", "b": [0.1665, 0.4992, 0.2345, 0.519]}, {"w": "which", "b": [0.2408, 0.4992, 0.3025, 0.519]}, {"w": "is", "b": [0.3088, 0.4992, 0.3256, 0.519]}, {"w": "possible", "b": [0.3319, 0.4992, 0.4146, 0.519]}, {"w": "because", "b": [0.4209, 0.4992, 0.5007, 0.519]}, {"w": "you", "b": [0.507, 0.4992, 0.5448, 0.519]}, {"w": "know", "b": [0.5511, 0.4992, 0.6072, 0.519]}, {"w": "what", "b": [0.6135, 0.4992, 0.6625, 0.519]}, {"w": "the", "b": [0.6688, 0.4992, 0.6997, 0.519]}, {"w": "original", "b": [0.706, 0.4992, 0.7844, 0.519]}, {"w": "image", "b": [0.7908, 0.4992, 0.8524, 0.519]}, {"w": "should", "b": [0.1294, 0.5197, 0.1967, 0.5395]}, {"w": "look", "b": [0.203, 0.5197, 0.2478, 0.5395]}, {"w": "like", "b": [0.2542, 0.5197, 0.292, 0.5395]}, {"w": "at", "b": [0.2983, 0.5197, 0.3165, 0.5395]}, {"w": "the", "b": [0.3228, 0.5197, 0.3536, 0.5395]}, {"w": "larger", "b": [0.36, 0.5197, 0.4183, 0.5395]}, {"w": "scale.", "b": [0.4246, 0.5197, 0.4813, 0.5395]}, {"w": "Given", "b": [0.4876, 0.5197, 0.5493, 0.5395]}, {"w": "a", "b": [0.5556, 0.5197, 0.5668, 0.5395]}, {"w": "small", "b": [0.5731, 0.5197, 0.6278, 0.5395]}, {"w": "image", "b": [0.6341, 0.5197, 0.6957, 0.5395]}, {"w": "size", "b": [0.702, 0.5197, 0.7412, 0.5395]}, {"w": "S", "b": [0.7475, 0.5197, 0.7601, 0.5395]}, {"w": "and", "b": [0.7664, 0.5197, 0.8028, 0.5395]}, {"w": "a", "b": [0.8091, 0.5197, 0.8203, 0.5395]}, {"w": "larger", "b": [0.1294, 0.5402, 0.1878, 0.56]}, {"w": "image", "b": [0.1941, 0.5402, 0.2557, 0.56]}, {"w": "size", "b": [0.262, 0.5402, 0.3013, 0.56]}, {"w": "L,", "b": [0.3075, 0.5402, 0.3278, 0.56]}, {"w": "you", "b": [0.3342, 0.5402, 0.372, 0.56]}, {"w": "can", "b": [0.3783, 0.5402, 0.4133, 0.56]}, {"w": "compute", "b": [0.4196, 0.5402, 0.5065, 0.56]}, {"w": "the", "b": [0.5128, 0.5402, 0.5436, 0.56]}, {"w": "difference", "b": [0.5499, 0.5402, 0.6517, 0.56]}, {"w": "between", "b": [0.658, 0.5402, 0.742, 0.56]}, {"w": "the", "b": [0.7483, 0.5402, 0.7792, 0.56]}, {"w": "original", "b": [0.7855, 0.5402, 0.864, 0.56]}, {"w": "image", "b": [0.1294, 0.5607, 0.1911, 0.5805]}, {"w": "resized", "b": [0.1974, 0.5607, 0.2688, 0.5805]}, {"w": "to", "b": [0.2751, 0.5607, 0.2947, 0.5805]}, {"w": "size", "b": [0.301, 0.5607, 0.3403, 0.5805]}, {"w": "L", "b": [0.3465, 0.5607, 0.3606, 0.5805]}, {"w": "and", "b": [0.3668, 0.5607, 0.4033, 0.5805]}, {"w": "the", "b": [0.4096, 0.5607, 0.4404, 0.5805]}, {"w": "original", "b": [0.4467, 0.5607, 0.5252, 0.5805]}, {"w": "resized", "b": [0.5315, 0.5607, 0.6029, 0.5805]}, {"w": "to", "b": [0.6092, 0.5607, 0.6289, 0.5805]}, {"w": "size", "b": [0.6352, 0.5607, 0.6744, 0.5805]}, {"w": "S—this", "b": [0.6807, 0.5607, 0.7549, 0.5805]}, {"w": "difference", "b": [0.7613, 0.5607, 0.863, 0.5805]}, {"w": "quantifies", "b": [0.1294, 0.5812, 0.2289, 0.601]}, {"w": "the", "b": [0.2352, 0.5812, 0.266, 0.601]}, {"w": "details", "b": [0.2723, 0.5812, 0.3382, 0.601]}, {"w": "lost", "b": [0.3445, 0.5812, 0.381, 0.601]}, {"w": "when", "b": [0.3873, 0.5812, 0.4419, 0.601]}, {"w": "going", "b": [0.4482, 0.5812, 0.5057, 0.601]}, {"w": "from", "b": [0.512, 0.5812, 0.561, 0.601]}, {"w": "S", "b": [0.5673, 0.5812, 0.5799, 0.601]}, {"w": "to", "b": [0.5862, 0.5812, 0.6058, 0.601]}, {"w": "L.", "b": [0.6121, 0.5812, 0.6324, 0.601]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 8.12. Running gradient ascent over different successive scales", "words": [{"w": "Listing", "b": [0.1294, 0.6191, 0.1862, 0.6339]}, {"w": "8.12.", "b": [0.1909, 0.6191, 0.2288, 0.6339]}, {"w": "Running", "b": [0.2335, 0.6191, 0.3039, 0.6339]}, {"w": "gradient", "b": [0.3087, 0.6191, 0.377, 0.6339]}, {"w": "ascent", "b": [0.3817, 0.6191, 0.4321, 0.6339]}, {"w": "over", "b": [0.4369, 0.6191, 0.4726, 0.6339]}, {"w": "different", "b": [0.4773, 0.6191, 0.5474, 0.6339]}, {"w": "successive", "b": [0.5521, 0.6191, 0.633, 0.6339]}, {"w": "scales", "b": [0.6378, 0.6191, 0.684, 0.6339]}]}, {"id": "b_3", "type": "paragraph", "text": "import numpy as np step = 0.01 12 num_octave = 3 13 octave_scale = 1.4 14 iterations = 20 5 max_loss = 10. 6 base_image_path = '...' 7", "words": [{"w": "import", "b": [0.1357, 0.6475, 0.2038, 0.6626]}, {"w": "numpy", "b": [0.2152, 0.6475, 0.2719, 0.6626]}, {"w": "as", "b": [0.2833, 0.6475, 0.306, 0.6626]}, {"w": "np", "b": [0.3173, 0.6475, 0.34, 0.6626]}, {"w": "step", "b": [0.1357, 0.6778, 0.1811, 0.693]}, {"w": "=", "b": [0.1925, 0.6778, 0.2038, 0.693]}, {"w": "0.01", "b": [0.2152, 0.6778, 0.2606, 0.693]}, {"w": "12", "b": [0.1357, 0.693, 0.1584, 0.7081]}, {"w": "num_octave", "b": [0.1357, 0.7081, 0.2492, 0.7233]}, {"w": "=", "b": [0.2606, 0.7081, 0.2719, 0.7233]}, {"w": "3", "b": [0.2833, 0.7081, 0.2946, 0.7233]}, {"w": "13", "b": [0.1357, 0.7233, 0.1584, 0.7384]}, {"w": "octave_scale", "b": [0.1357, 0.7384, 0.2719, 0.7536]}, {"w": "=", "b": [0.2833, 0.7384, 0.2946, 0.7536]}, {"w": "1.4", "b": [0.306, 0.7384, 0.34, 0.7536]}, {"w": "14", "b": [0.1357, 0.7536, 0.1584, 0.7687]}, {"w": "iterations", "b": [0.1357, 0.7687, 0.2492, 0.7839]}, {"w": "=", "b": [0.2606, 0.7687, 0.2719, 0.7839]}, {"w": "20", "b": [0.2833, 0.7687, 0.306, 0.7839]}, {"w": "5", "b": [0.1357, 0.7839, 0.1471, 0.799]}, {"w": "max_loss", "b": [0.1357, 0.8142, 0.2265, 0.8293]}, {"w": "=", "b": [0.2379, 0.8142, 0.2492, 0.8293]}, {"w": "10.", "b": [0.2606, 0.8142, 0.2946, 0.8293]}, {"w": "6", "b": [0.1357, 0.8293, 0.1471, 0.8445]}, {"w": "base_image_path", "b": [0.1357, 0.8596, 0.306, 0.8748]}, {"w": "=", "b": [0.3173, 0.8596, 0.3287, 0.8748]}, {"w": "'...'", "b": [0.34, 0.8596, 0.3968, 0.8748]}, {"w": "7", "b": [0.1357, 0.8748, 0.1471, 0.8899]}]}]}, {"page": 370, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "img = preprocess_image(base_image_path) 8 original_shape = img.shape[1:3] successive_shapes = [original_shape] 9 for i in range(1, num_octave): 9 shape = tuple([int(dim / (octave_scale ** i)) 9 for dim in original_shape]) 9 successive_shapes.append(shape) 9 successive_shapes = successive_shapes[::-1] 10 original_img = np.copy(img) 11 shrunk_original_img = resize_img(img, successive_shapes[0]) 11 for shape in successive_shapes: print('Processing image shape', shape) img = resize_img(img, shape) 12 img = gradient_ascent(img, iterations=iterations, 13 step=step, 13 max_loss=max_loss) 13 upscaled_shrunk_original_img = resize_img(shrunk_original_img, shape) 14 same_size_original = resize_img(original_img, shape) 15 lost_detail = same_size_original - upscaled_shrunk_original_img 16 img += lost_detail 17 shrunk_original_img = resize_img(original_img, shape) save_img(img, fname='dream_at_scale_' + str(shape) + '.png') save_img(img, fname='final_dream.png')", "words": [{"w": "img", "b": [0.1357, 0.0851, 0.1698, 0.1002]}, {"w": "=", "b": [0.1811, 0.0851, 0.1925, 0.1002]}, {"w": "preprocess_image(base_image_path)", "b": [0.2038, 0.0851, 0.5784, 0.1002]}, {"w": "8", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "original_shape", "b": [0.1357, 0.1305, 0.2946, 0.1457]}, {"w": "=", "b": [0.306, 0.1305, 0.3173, 0.1457]}, {"w": "img.shape[1:3]", "b": [0.3287, 0.1305, 0.4876, 0.1457]}, {"w": "successive_shapes", "b": [0.1357, 0.1457, 0.3287, 0.1608]}, {"w": "=", "b": [0.34, 0.1457, 0.3514, 0.1608]}, {"w": "[original_shape]", "b": [0.3628, 0.1457, 0.5444, 0.1608]}, {"w": "9", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "for", "b": [0.1357, 0.176, 0.1698, 0.1911]}, {"w": "i", "b": [0.1811, 0.176, 0.1925, 0.1911]}, {"w": "in", "b": [0.2038, 0.176, 0.2265, 0.1911]}, {"w": "range(1,", "b": [0.2379, 0.176, 0.3287, 0.1911]}, {"w": "num_octave):", "b": [0.34, 0.176, 0.4763, 0.1911]}, {"w": "9", "b": [0.1357, 0.1912, 0.1471, 0.2063]}, {"w": "shape", "b": [0.1811, 0.2063, 0.2379, 0.2214]}, {"w": "=", "b": [0.2492, 0.2063, 0.2606, 0.2214]}, {"w": "tuple([int(dim", "b": [0.2719, 0.2063, 0.4309, 0.2214]}, {"w": "/", "b": [0.4422, 0.2063, 0.4536, 0.2214]}, {"w": "(octave_scale", "b": [0.4649, 0.2063, 0.6125, 0.2214]}, {"w": "**", "b": [0.6238, 0.2063, 0.6465, 0.2214]}, {"w": "i))", "b": [0.6579, 0.2063, 0.6919, 0.2214]}, {"w": "9", "b": [0.1357, 0.2215, 0.1471, 0.2366]}, {"w": "for", "b": [0.1811, 0.2366, 0.2152, 0.2518]}, {"w": "dim", "b": [0.2265, 0.2366, 0.2606, 0.2518]}, {"w": "in", "b": [0.2719, 0.2366, 0.2946, 0.2518]}, {"w": "original_shape])", "b": [0.306, 0.2366, 0.4876, 0.2518]}, {"w": "9", "b": [0.1357, 0.2518, 0.1471, 0.2669]}, {"w": "successive_shapes.append(shape)", "b": [0.1811, 0.2669, 0.533, 0.2821]}, {"w": "9", "b": [0.1357, 0.2821, 0.1471, 0.2972]}, {"w": "successive_shapes", "b": [0.1357, 0.3124, 0.3287, 0.3275]}, {"w": "=", "b": [0.34, 0.3124, 0.3514, 0.3275]}, {"w": "successive_shapes[::-1]", "b": [0.3628, 0.3124, 0.6238, 0.3275]}, {"w": "10", "b": [0.1357, 0.3275, 0.1584, 0.3427]}, {"w": "original_img", "b": [0.1357, 0.3578, 0.2719, 0.373]}, {"w": "=", "b": [0.2833, 0.3578, 0.2946, 0.373]}, {"w": "np.copy(img)", "b": [0.306, 0.3578, 0.4422, 0.373]}, {"w": "11", "b": [0.1357, 0.373, 0.1584, 0.3881]}, {"w": "shrunk_original_img", "b": [0.1357, 0.3881, 0.3514, 0.4033]}, {"w": "=", "b": [0.3628, 0.3881, 0.3741, 0.4033]}, {"w": "resize_img(img,", "b": [0.3855, 0.3881, 0.5557, 0.4033]}, {"w": "successive_shapes[0])", "b": [0.5671, 0.3881, 0.8055, 0.4033]}, {"w": "11", "b": [0.1357, 0.4033, 0.1584, 0.4184]}, {"w": "for", "b": [0.1357, 0.4336, 0.1698, 0.4487]}, {"w": "shape", "b": [0.1811, 0.4336, 0.2379, 0.4487]}, {"w": "in", "b": [0.2492, 0.4336, 0.2719, 0.4487]}, {"w": "successive_shapes:", "b": [0.2833, 0.4336, 0.4876, 0.4487]}, {"w": "print('Processing", "b": [0.1811, 0.4487, 0.3741, 0.4639]}, {"w": "image", "b": [0.3855, 0.4487, 0.4422, 0.4639]}, {"w": "shape',", "b": [0.4536, 0.4487, 0.533, 0.4639]}, {"w": "shape)", "b": [0.5444, 0.4487, 0.6125, 0.4639]}, {"w": "img", "b": [0.1811, 0.4639, 0.2152, 0.479]}, {"w": "=", "b": [0.2265, 0.4639, 0.2379, 0.479]}, {"w": "resize_img(img,", "b": [0.2492, 0.4639, 0.4195, 0.479]}, {"w": "shape)", "b": [0.4309, 0.4639, 0.499, 0.479]}, {"w": "12", "b": [0.1357, 0.479, 0.1584, 0.4942]}, {"w": "img", "b": [0.1811, 0.4942, 0.2152, 0.5093]}, {"w": "=", "b": [0.2265, 0.4942, 0.2379, 0.5093]}, {"w": "gradient_ascent(img,", "b": [0.2492, 0.4942, 0.4763, 0.5093]}, {"w": "iterations=iterations,", "b": [0.4309, 0.5094, 0.6806, 0.5245]}, {"w": "13", "b": [0.1357, 0.5245, 0.1584, 0.5396]}, {"w": "step=step,", "b": [0.4309, 0.5397, 0.5444, 0.5548]}, {"w": "13", "b": [0.1357, 0.5548, 0.1584, 0.57]}, {"w": "max_loss=max_loss)", "b": [0.4309, 0.57, 0.6352, 0.5851]}, {"w": "13", "b": [0.1357, 0.5851, 0.1584, 0.6003]}, {"w": "upscaled_shrunk_original_img", "b": [0.1811, 0.6003, 0.499, 0.6154]}, {"w": "=", "b": [0.5103, 0.6003, 0.5217, 0.6154]}, {"w": "resize_img(shrunk_original_img,", "b": [0.1357, 0.6154, 0.4876, 0.6306]}, {"w": "shape)", "b": [0.499, 0.6154, 0.5671, 0.6306]}, {"w": "14", "b": [0.5785, 0.6154, 0.6012, 0.6306]}, {"w": "same_size_original", "b": [0.1811, 0.6306, 0.3855, 0.6457]}, {"w": "=", "b": [0.3968, 0.6306, 0.4082, 0.6457]}, {"w": "resize_img(original_img,", "b": [0.4195, 0.6306, 0.6919, 0.6457]}, {"w": "shape)", "b": [0.7033, 0.6306, 0.7714, 0.6457]}, {"w": "15", "b": [0.1357, 0.6457, 0.1584, 0.6609]}, {"w": "lost_detail", "b": [0.1811, 0.6609, 0.306, 0.676]}, {"w": "=", "b": [0.3173, 0.6609, 0.3287, 0.676]}, {"w": "same_size_original", "b": [0.34, 0.6609, 0.5444, 0.676]}, {"w": "-", "b": [0.5557, 0.6609, 0.5671, 0.676]}, {"w": "upscaled_shrunk_original_img", "b": [0.1357, 0.676, 0.4536, 0.6912]}, {"w": "16", "b": [0.5331, 0.676, 0.5558, 0.6912]}, {"w": "img", "b": [0.1811, 0.7063, 0.2152, 0.7215]}, {"w": "+=", "b": [0.2265, 0.7063, 0.2492, 0.7215]}, {"w": "lost_detail", "b": [0.2606, 0.7063, 0.3855, 0.7215]}, {"w": "17", "b": [0.1357, 0.7215, 0.1584, 0.7366]}, {"w": "shrunk_original_img", "b": [0.1811, 0.7366, 0.3968, 0.7518]}, {"w": "=", "b": [0.4082, 0.7366, 0.4195, 0.7518]}, {"w": "resize_img(original_img,", "b": [0.4309, 0.7366, 0.7033, 0.7518]}, {"w": "shape)", "b": [0.7146, 0.7366, 0.7828, 0.7518]}, {"w": "save_img(img,", "b": [0.1811, 0.7518, 0.3287, 0.7669]}, {"w": "fname='dream_at_scale_'", "b": [0.34, 0.7518, 0.6011, 0.7669]}, {"w": "+", "b": [0.6125, 0.7518, 0.6238, 0.7669]}, {"w": "str(shape)", "b": [0.6352, 0.7518, 0.7487, 0.7669]}, {"w": "+", "b": [0.7601, 0.7518, 0.7714, 0.7669]}, {"w": "'.png')", "b": [0.7828, 0.7518, 0.8622, 0.7669]}, {"w": "save_img(img,", "b": [0.1357, 0.7821, 0.2833, 0.7972]}, {"w": "fname='final_dream.png')", "b": [0.2946, 0.7821, 0.5671, 0.7972]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Playing with these hyperparameters will let you achieve new effects. 2 Gradient ascent step size 3 Number of scales at which to run gradient ascent", "words": [{"w": "1", "b": [0.1799, 0.8157, 0.1925, 0.8354]}, {"w": "Playing", "b": [0.1988, 0.8157, 0.2801, 0.8354]}, {"w": "with", "b": [0.2864, 0.8157, 0.334, 0.8354]}, {"w": "these", "b": [0.3403, 0.8157, 0.395, 0.8354]}, {"w": "hyperparameters", "b": [0.4013, 0.8157, 0.5876, 0.8354]}, {"w": "will", "b": [0.5939, 0.8157, 0.6332, 0.8354]}, {"w": "let", "b": [0.6395, 0.8157, 0.6661, 0.8354]}, {"w": "you", "b": [0.6724, 0.8157, 0.7117, 0.8354]}, {"w": "achieve", "b": [0.718, 0.8157, 0.7978, 0.8354]}, {"w": "new", "b": [0.8042, 0.8157, 0.8476, 0.8354]}, {"w": "effects.", "b": [0.1799, 0.8362, 0.2548, 0.8559]}, {"w": "2", "b": [0.1799, 0.8567, 0.1925, 0.8764]}, {"w": "Gradient", "b": [0.1988, 0.8567, 0.2969, 0.8764]}, {"w": "ascent", "b": [0.3032, 0.8567, 0.3704, 0.8764]}, {"w": "step", "b": [0.3768, 0.8567, 0.4202, 0.8764]}, {"w": "size", "b": [0.4265, 0.8567, 0.4657, 0.8764]}, {"w": "3", "b": [0.1799, 0.8772, 0.1925, 0.8969]}, {"w": "Number", "b": [0.1988, 0.8772, 0.2885, 0.8969]}, {"w": "of", "b": [0.2948, 0.8772, 0.3158, 0.8969]}, {"w": "scales", "b": [0.3221, 0.8772, 0.3837, 0.8969]}, {"w": "at", "b": [0.39, 0.8772, 0.4111, 0.8969]}, {"w": "which", "b": [0.4174, 0.8772, 0.4818, 0.8969]}, {"w": "to", "b": [0.4881, 0.8772, 0.5092, 0.8969]}, {"w": "run", "b": [0.5155, 0.8772, 0.5547, 0.8969]}, {"w": "gradient", "b": [0.561, 0.8772, 0.6521, 0.8969]}, {"w": "ascent", "b": [0.6584, 0.8772, 0.7257, 0.8969]}]}]}, {"page": 371, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4 Size ratio between scales 5 Number of ascent steps to run at each scale 6 If the loss grows larger than 10, you’ll interrupt the gradient- ascent process to avoid ugly artifacts. 7 Fill this with the path to the image you want to use. 8 Loads the base image into a Numpy array (function is defined in listing 8.13) 9 Prepares a list of shape tuples defining the different scales at which to run gradient ascent 10 Reverses the list of shapes so they’re in increasing order 11 Resizes the Numpy array of the image to the smallest scale 12 Scales up the dream image 13 Runs gradient ascent, altering the dream 14 Scales up the smaller version of the original image: it will be pixellated. 15 Computes the high-quality version of the original image at this size 16 The difference between the two is the detail that was lost when scaling up. 17 Reinjects lost detail into the dream", "words": [{"w": "4", "b": [0.1799, 0.0857, 0.1925, 0.1054]}, {"w": "Size", "b": [0.1988, 0.0857, 0.2422, 0.1054]}, {"w": "ratio", "b": [0.2485, 0.0857, 0.3004, 0.1054]}, {"w": "between", "b": [0.3067, 0.0857, 0.3949, 0.1054]}, {"w": "scales", "b": [0.4012, 0.0857, 0.4629, 0.1054]}, {"w": "5", "b": [0.1799, 0.1062, 0.1925, 0.1259]}, {"w": "Number", "b": [0.1988, 0.1062, 0.2885, 0.1259]}, {"w": "of", "b": [0.2948, 0.1062, 0.3158, 0.1259]}, {"w": "ascent", "b": [0.3221, 0.1062, 0.3893, 0.1259]}, {"w": "steps", "b": [0.3956, 0.1062, 0.4489, 0.1259]}, {"w": "to", "b": [0.4552, 0.1062, 0.4762, 0.1259]}, {"w": "run", "b": [0.4825, 0.1062, 0.5218, 0.1259]}, {"w": "at", "b": [0.5281, 0.1062, 0.5491, 0.1259]}, {"w": "each", "b": [0.5554, 0.1062, 0.6044, 0.1259]}, {"w": "scale", "b": [0.6107, 0.1062, 0.6626, 0.1259]}, {"w": "6", "b": [0.1799, 0.1267, 0.1925, 0.1464]}, {"w": "If", "b": [0.1988, 0.1267, 0.217, 0.1464]}, {"w": "the", "b": [0.2233, 0.1267, 0.2569, 0.1464]}, {"w": "loss", "b": [0.2632, 0.1267, 0.3025, 0.1464]}, {"w": "grows", "b": [0.3088, 0.1267, 0.3728, 0.1464]}, {"w": "larger", "b": [0.3791, 0.1267, 0.4449, 0.1464]}, {"w": "than", "b": [0.4512, 0.1267, 0.5003, 0.1464]}, {"w": "10,", "b": [0.5066, 0.1267, 0.5381, 0.1464]}, {"w": "you’ll", "b": [0.5445, 0.1267, 0.6061, 0.1464]}, {"w": "interrupt", "b": [0.6124, 0.1267, 0.7119, 0.1464]}, {"w": "the", "b": [0.7182, 0.1267, 0.7519, 0.1464]}, {"w": "gradient-", "b": [0.7582, 0.1267, 0.8577, 0.1464]}, {"w": "ascent", "b": [0.1799, 0.1472, 0.2471, 0.1669]}, {"w": "process", "b": [0.2534, 0.1472, 0.3328, 0.1669]}, {"w": "to", "b": [0.3391, 0.1472, 0.3602, 0.1669]}, {"w": "avoid", "b": [0.3665, 0.1472, 0.4253, 0.1669]}, {"w": "ugly", "b": [0.4316, 0.1472, 0.4779, 0.1669]}, {"w": "artifacts.", "b": [0.4842, 0.1472, 0.5802, 0.1669]}, {"w": "7", "b": [0.1799, 0.1677, 0.1925, 0.1874]}, {"w": "Fill", "b": [0.1988, 0.1677, 0.2352, 0.1874]}, {"w": "this", "b": [0.2415, 0.1677, 0.2808, 0.1874]}, {"w": "with", "b": [0.2871, 0.1677, 0.3347, 0.1874]}, {"w": "the", "b": [0.3411, 0.1677, 0.3747, 0.1874]}, {"w": "path", "b": [0.381, 0.1677, 0.4301, 0.1874]}, {"w": "to", "b": [0.4364, 0.1677, 0.4574, 0.1874]}, {"w": "the", "b": [0.4637, 0.1677, 0.4973, 0.1874]}, {"w": "image", "b": [0.5036, 0.1677, 0.5681, 0.1874]}, {"w": "you", "b": [0.5744, 0.1677, 0.6136, 0.1874]}, {"w": "want", "b": [0.6199, 0.1677, 0.6732, 0.1874]}, {"w": "to", "b": [0.6795, 0.1677, 0.7005, 0.1874]}, {"w": "use.", "b": [0.7068, 0.1677, 0.7481, 0.1874]}, {"w": "8", "b": [0.1799, 0.1882, 0.1925, 0.2079]}, {"w": "Loads", "b": [0.1988, 0.1882, 0.2647, 0.2079]}, {"w": "the", "b": [0.271, 0.1882, 0.3046, 0.2079]}, {"w": "base", "b": [0.3109, 0.1882, 0.3586, 0.2079]}, {"w": "image", "b": [0.3649, 0.1882, 0.4293, 0.2079]}, {"w": "into", "b": [0.4356, 0.1882, 0.4777, 0.2079]}, {"w": "a", "b": [0.484, 0.1882, 0.4966, 0.2079]}, {"w": "Numpy", "b": [0.5029, 0.1882, 0.5828, 0.2079]}, {"w": "array", "b": [0.5891, 0.1882, 0.6493, 0.2079]}, {"w": "(function", "b": [0.6556, 0.1882, 0.7537, 0.2079]}, {"w": "is", "b": [0.7601, 0.1882, 0.7769, 0.2079]}, {"w": "defined", "b": [0.7832, 0.1882, 0.8631, 0.2079]}, {"w": "in", "b": [0.1799, 0.2087, 0.2009, 0.2284]}, {"w": "listing", "b": [0.2072, 0.2087, 0.2731, 0.2284]}, {"w": "8.13)", "b": [0.2794, 0.2087, 0.3319, 0.2284]}, {"w": "9", "b": [0.1799, 0.2292, 0.1925, 0.2489]}, {"w": "Prepares", "b": [0.1988, 0.2292, 0.2945, 0.2489]}, {"w": "a", "b": [0.3008, 0.2292, 0.3134, 0.2489]}, {"w": "list", "b": [0.3198, 0.2292, 0.352, 0.2489]}, {"w": "of", "b": [0.3583, 0.2292, 0.3793, 0.2489]}, {"w": "shape", "b": [0.3856, 0.2292, 0.4473, 0.2489]}, {"w": "tuples", "b": [0.4536, 0.2292, 0.5181, 0.2489]}, {"w": "defining", "b": [0.5244, 0.2292, 0.6127, 0.2489]}, {"w": "the", "b": [0.619, 0.2292, 0.6526, 0.2489]}, {"w": "different", "b": [0.6589, 0.2292, 0.7523, 0.2489]}, {"w": "scales", "b": [0.7587, 0.2292, 0.8203, 0.2489]}, {"w": "at", "b": [0.8266, 0.2292, 0.8476, 0.2489]}, {"w": "which", "b": [0.1799, 0.2497, 0.2443, 0.2694]}, {"w": "to", "b": [0.2506, 0.2497, 0.2717, 0.2694]}, {"w": "run", "b": [0.278, 0.2497, 0.3172, 0.2694]}, {"w": "gradient", "b": [0.3235, 0.2497, 0.4146, 0.2694]}, {"w": "ascent", "b": [0.4209, 0.2497, 0.4882, 0.2694]}, {"w": "10", "b": [0.1799, 0.2702, 0.2051, 0.2899]}, {"w": "Reverses", "b": [0.2114, 0.2702, 0.3066, 0.2899]}, {"w": "the", "b": [0.313, 0.2702, 0.3466, 0.2899]}, {"w": "list", "b": [0.3529, 0.2702, 0.3851, 0.2899]}, {"w": "of", "b": [0.3914, 0.2702, 0.4124, 0.2899]}, {"w": "shapes", "b": [0.4188, 0.2702, 0.4902, 0.2899]}, {"w": "so", "b": [0.4965, 0.2702, 0.519, 0.2899]}, {"w": "they’re", "b": [0.5253, 0.2702, 0.6019, 0.2899]}, {"w": "in", "b": [0.6082, 0.2702, 0.6292, 0.2899]}, {"w": "increasing", "b": [0.6355, 0.2702, 0.7458, 0.2899]}, {"w": "order", "b": [0.7521, 0.2702, 0.8123, 0.2899]}, {"w": "11", "b": [0.1799, 0.2907, 0.2037, 0.3104]}, {"w": "Resizes", "b": [0.21, 0.2907, 0.2884, 0.3104]}, {"w": "the", "b": [0.2948, 0.2907, 0.3284, 0.3104]}, {"w": "Numpy", "b": [0.3347, 0.2907, 0.4146, 0.3104]}, {"w": "array", "b": [0.4209, 0.2907, 0.4811, 0.3104]}, {"w": "of", "b": [0.4874, 0.2907, 0.5084, 0.3104]}, {"w": "the", "b": [0.5147, 0.2907, 0.5484, 0.3104]}, {"w": "image", "b": [0.5547, 0.2907, 0.6191, 0.3104]}, {"w": "to", "b": [0.6254, 0.2907, 0.6465, 0.3104]}, {"w": "the", "b": [0.6528, 0.2907, 0.6864, 0.3104]}, {"w": "smallest", "b": [0.6927, 0.2907, 0.7796, 0.3104]}, {"w": "scale", "b": [0.7859, 0.2907, 0.8377, 0.3104]}, {"w": "12", "b": [0.1799, 0.3112, 0.2051, 0.3309]}, {"w": "Scales", "b": [0.2114, 0.3112, 0.2773, 0.3309]}, {"w": "up", "b": [0.2836, 0.3112, 0.3116, 0.3309]}, {"w": "the", "b": [0.3179, 0.3112, 0.3516, 0.3309]}, {"w": "dream", "b": [0.3579, 0.3112, 0.4275, 0.3309]}, {"w": "image", "b": [0.4338, 0.3112, 0.4982, 0.3309]}, {"w": "13", "b": [0.1799, 0.3317, 0.2051, 0.3514]}, {"w": "Runs", "b": [0.2114, 0.3317, 0.2675, 0.3514]}, {"w": "gradient", "b": [0.2738, 0.3317, 0.3649, 0.3514]}, {"w": "ascent,", "b": [0.3712, 0.3317, 0.4447, 0.3514]}, {"w": "altering", "b": [0.451, 0.3317, 0.5351, 0.3514]}, {"w": "the", "b": [0.5414, 0.3317, 0.5751, 0.3514]}, {"w": "dream", "b": [0.5814, 0.3317, 0.651, 0.3514]}, {"w": "14", "b": [0.1799, 0.3522, 0.2051, 0.3719]}, {"w": "Scales", "b": [0.2114, 0.3522, 0.2773, 0.3719]}, {"w": "up", "b": [0.2836, 0.3522, 0.3116, 0.3719]}, {"w": "the", "b": [0.3179, 0.3522, 0.3516, 0.3719]}, {"w": "smaller", "b": [0.3579, 0.3522, 0.4377, 0.3719]}, {"w": "version", "b": [0.444, 0.3522, 0.5225, 0.3719]}, {"w": "of", "b": [0.5288, 0.3522, 0.5498, 0.3719]}, {"w": "the", "b": [0.5561, 0.3522, 0.5898, 0.3719]}, {"w": "original", "b": [0.5961, 0.3522, 0.6802, 0.3719]}, {"w": "image:", "b": [0.6865, 0.3522, 0.7593, 0.3719]}, {"w": "it", "b": [0.7656, 0.3522, 0.781, 0.3719]}, {"w": "will", "b": [0.7874, 0.3522, 0.8266, 0.3719]}, {"w": "be", "b": [0.8329, 0.3522, 0.8581, 0.3719]}, {"w": "pixellated.", "b": [0.1799, 0.3727, 0.2913, 0.3924]}, {"w": "15", "b": [0.1799, 0.3932, 0.2051, 0.4129]}, {"w": "Computes", "b": [0.2114, 0.3932, 0.3207, 0.4129]}, {"w": "the", "b": [0.327, 0.3932, 0.3606, 0.4129]}, {"w": "high-quality", "b": [0.3669, 0.3932, 0.4987, 0.4129]}, {"w": "version", "b": [0.505, 0.3932, 0.5835, 0.4129]}, {"w": "of", "b": [0.5898, 0.3932, 0.6108, 0.4129]}, {"w": "the", "b": [0.6171, 0.3932, 0.6508, 0.4129]}, {"w": "original", "b": [0.6571, 0.3932, 0.7412, 0.4129]}, {"w": "image", "b": [0.7475, 0.3932, 0.8119, 0.4129]}, {"w": "at", "b": [0.8182, 0.3932, 0.8392, 0.4129]}, {"w": "this", "b": [0.1799, 0.4137, 0.2191, 0.4334]}, {"w": "size", "b": [0.2254, 0.4137, 0.2646, 0.4334]}, {"w": "16", "b": [0.1799, 0.4342, 0.2051, 0.4539]}, {"w": "The", "b": [0.2114, 0.4342, 0.2534, 0.4539]}, {"w": "difference", "b": [0.2598, 0.4342, 0.3672, 0.4539]}, {"w": "between", "b": [0.3735, 0.4342, 0.4617, 0.4539]}, {"w": "the", "b": [0.468, 0.4342, 0.5017, 0.4539]}, {"w": "two", "b": [0.508, 0.4342, 0.5472, 0.4539]}, {"w": "is", "b": [0.5535, 0.4342, 0.5703, 0.4539]}, {"w": "the", "b": [0.5766, 0.4342, 0.6103, 0.4539]}, {"w": "detail", "b": [0.6166, 0.4342, 0.6768, 0.4539]}, {"w": "that", "b": [0.6831, 0.4342, 0.7266, 0.4539]}, {"w": "was", "b": [0.7329, 0.4342, 0.7735, 0.4539]}, {"w": "lost", "b": [0.7798, 0.4342, 0.8177, 0.4539]}, {"w": "when", "b": [0.1799, 0.4547, 0.2373, 0.4744]}, {"w": "scaling", "b": [0.2436, 0.4547, 0.3179, 0.4744]}, {"w": "up.", "b": [0.3242, 0.4547, 0.3586, 0.4744]}, {"w": "17", "b": [0.1799, 0.4752, 0.2051, 0.4949]}, {"w": "Reinjects", "b": [0.2114, 0.4752, 0.3109, 0.4949]}, {"w": "lost", "b": [0.3172, 0.4752, 0.355, 0.4949]}, {"w": "detail", "b": [0.3613, 0.4752, 0.4216, 0.4949]}, {"w": "into", "b": [0.4279, 0.4752, 0.4699, 0.4949]}, {"w": "the", "b": [0.4762, 0.4752, 0.5099, 0.4949]}, {"w": "dream", "b": [0.5162, 0.4752, 0.5858, 0.4949]}]}, {"id": "b_1", "type": "paragraph", "text": "Note that this code uses the following straightforward auxiliary Numpy functions, which all do as their names suggest. They require that you have SciPy installed.", "words": [{"w": "Note", "b": [0.1294, 0.518, 0.1785, 0.5377]}, {"w": "that", "b": [0.1848, 0.518, 0.2226, 0.5377]}, {"w": "this", "b": [0.2289, 0.518, 0.2654, 0.5377]}, {"w": "code", "b": [0.2717, 0.518, 0.3193, 0.5377]}, {"w": "uses", "b": [0.3256, 0.518, 0.369, 0.5377]}, {"w": "the", "b": [0.3753, 0.518, 0.4062, 0.5377]}, {"w": "following", "b": [0.4125, 0.518, 0.5106, 0.5377]}, {"w": "straightforward", "b": [0.5169, 0.518, 0.6724, 0.5377]}, {"w": "auxiliary", "b": [0.6787, 0.518, 0.7684, 0.5377]}, {"w": "Numpy", "b": [0.7747, 0.518, 0.8504, 0.5377]}, {"w": "functions,", "b": [0.1294, 0.5385, 0.2296, 0.5582]}, {"w": "which", "b": [0.2359, 0.5385, 0.2976, 0.5582]}, {"w": "all", "b": [0.3039, 0.5385, 0.3291, 0.5582]}, {"w": "do", "b": [0.3354, 0.5385, 0.3606, 0.5582]}, {"w": "as", "b": [0.3669, 0.5385, 0.388, 0.5582]}, {"w": "their", "b": [0.3943, 0.5385, 0.4405, 0.5582]}, {"w": "names", "b": [0.4468, 0.5385, 0.5113, 0.5582]}, {"w": "suggest.", "b": [0.5176, 0.5385, 0.5995, 0.5582]}, {"w": "They", "b": [0.6059, 0.5385, 0.6577, 0.5582]}, {"w": "require", "b": [0.6639, 0.5385, 0.7354, 0.5582]}, {"w": "that", "b": [0.7417, 0.5385, 0.7795, 0.5582]}, {"w": "you", "b": [0.7858, 0.5385, 0.8237, 0.5582]}, {"w": "have", "b": [0.1294, 0.559, 0.177, 0.5787]}, {"w": "SciPy", "b": [0.1833, 0.559, 0.2422, 0.5787]}, {"w": "installed.", "b": [0.2485, 0.559, 0.3403, 0.5787]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 8.13. Auxiliary functions", "words": [{"w": "Listing", "b": [0.1294, 0.5968, 0.1862, 0.6116]}, {"w": "8.13.", "b": [0.1909, 0.5968, 0.2288, 0.6116]}, {"w": "Auxiliary", "b": [0.2335, 0.5968, 0.3102, 0.6116]}, {"w": "functions", "b": [0.3149, 0.5968, 0.3896, 0.6116]}]}, {"id": "b_3", "type": "paragraph", "text": "import scipy from keras.preprocessing import image def resize_img(img, size): img = np.copy(img) factors = (1, float(size[0]) / img.shape[1], float(size[1]) / img.shape[2], 1) return scipy.ndimage.zoom(img, factors, order=1) def save_img(img, fname): pil_img = deprocess_image(np.copy(img)) scipy.misc.imsave(fname, pil_img) def preprocess_image(image_path): 1 img = image.load_img(image_path) img = image.img_to_array(img) img = np.expand_dims(img, axis=0)", "words": [{"w": "import", "b": [0.1357, 0.6252, 0.2038, 0.6404]}, {"w": "scipy", "b": [0.2152, 0.6252, 0.2719, 0.6404]}, {"w": "from", "b": [0.1357, 0.6404, 0.1811, 0.6555]}, {"w": "keras.preprocessing", "b": [0.1925, 0.6404, 0.4082, 0.6555]}, {"w": "import", "b": [0.4195, 0.6404, 0.4876, 0.6555]}, {"w": "image", "b": [0.499, 0.6404, 0.5557, 0.6555]}, {"w": "def", "b": [0.1357, 0.6707, 0.1698, 0.6858]}, {"w": "resize_img(img,", "b": [0.1811, 0.6707, 0.3514, 0.6858]}, {"w": "size):", "b": [0.3628, 0.6707, 0.4309, 0.6858]}, {"w": "img", "b": [0.1811, 0.6858, 0.2152, 0.701]}, {"w": "=", "b": [0.2265, 0.6858, 0.2379, 0.701]}, {"w": "np.copy(img)", "b": [0.2492, 0.6858, 0.3855, 0.701]}, {"w": "factors", "b": [0.1811, 0.701, 0.2606, 0.7161]}, {"w": "=", "b": [0.2719, 0.701, 0.2833, 0.7161]}, {"w": "(1,", "b": [0.2946, 0.701, 0.3287, 0.7161]}, {"w": "float(size[0])", "b": [0.306, 0.7161, 0.4649, 0.7313]}, {"w": "/", "b": [0.4763, 0.7161, 0.4876, 0.7313]}, {"w": "img.shape[1],", "b": [0.499, 0.7161, 0.6465, 0.7313]}, {"w": "float(size[1])", "b": [0.306, 0.7313, 0.4649, 0.7464]}, {"w": "/", "b": [0.4763, 0.7313, 0.4876, 0.7464]}, {"w": "img.shape[2],", "b": [0.499, 0.7313, 0.6465, 0.7464]}, {"w": "1)", "b": [0.306, 0.7464, 0.3287, 0.7616]}, {"w": "return", "b": [0.1811, 0.7616, 0.2492, 0.7767]}, {"w": "scipy.ndimage.zoom(img,", "b": [0.2606, 0.7616, 0.5217, 0.7767]}, {"w": "factors,", "b": [0.533, 0.7616, 0.6238, 0.7767]}, {"w": "order=1)", "b": [0.6352, 0.7616, 0.726, 0.7767]}, {"w": "def", "b": [0.1357, 0.7919, 0.1698, 0.807]}, {"w": "save_img(img,", "b": [0.1811, 0.7919, 0.3287, 0.807]}, {"w": "fname):", "b": [0.34, 0.7919, 0.4195, 0.807]}, {"w": "pil_img", "b": [0.1811, 0.807, 0.2606, 0.8222]}, {"w": "=", "b": [0.2719, 0.807, 0.2833, 0.8222]}, {"w": "deprocess_image(np.copy(img))", "b": [0.2946, 0.807, 0.6238, 0.8222]}, {"w": "scipy.misc.imsave(fname,", "b": [0.1811, 0.8222, 0.4536, 0.8373]}, {"w": "pil_img)", "b": [0.4649, 0.8222, 0.5557, 0.8373]}, {"w": "def", "b": [0.1357, 0.8525, 0.1698, 0.8677]}, {"w": "preprocess_image(image_path):", "b": [0.1811, 0.8525, 0.5103, 0.8677]}, {"w": "1", "b": [0.7829, 0.8525, 0.7942, 0.8677]}, {"w": "img", "b": [0.1811, 0.8677, 0.2152, 0.8828]}, {"w": "=", "b": [0.2265, 0.8677, 0.2379, 0.8828]}, {"w": "image.load_img(image_path)", "b": [0.2492, 0.8677, 0.5444, 0.8828]}, {"w": "img", "b": [0.1811, 0.8828, 0.2152, 0.898]}, {"w": "=", "b": [0.2265, 0.8828, 0.2379, 0.898]}, {"w": "image.img_to_array(img)", "b": [0.2492, 0.8828, 0.5103, 0.898]}, {"w": "img", "b": [0.1811, 0.898, 0.2152, 0.9131]}, {"w": "=", "b": [0.2265, 0.898, 0.2379, 0.9131]}, {"w": "np.expand_dims(img,", "b": [0.2492, 0.898, 0.4649, 0.9131]}, {"w": "axis=0)", "b": [0.4763, 0.898, 0.5557, 0.9131]}]}]}, {"page": 372, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "img = inception_v3.preprocess_input(img) return img def deprocess_image(x): 2 if K.image_data_format() == 'channels_first': x = x.reshape((3, x.shape[2], x.shape[3])) x = x.transpose((1, 2, 0)) else: x = x.reshape((x.shape[1], x.shape[2], 3)) 3 x /= 2. x += 0.5 x *= 255. x = np.clip(x, 0, 255).astype('uint8') return x", "words": [{"w": "img", "b": [0.1811, 0.0851, 0.2152, 0.1002]}, {"w": "=", "b": [0.2265, 0.0851, 0.2379, 0.1002]}, {"w": "inception_v3.preprocess_input(img)", "b": [0.2492, 0.0851, 0.6352, 0.1002]}, {"w": "return", "b": [0.1811, 0.1002, 0.2492, 0.1154]}, {"w": "img", "b": [0.2606, 0.1002, 0.2946, 0.1154]}, {"w": "def", "b": [0.1357, 0.1305, 0.1698, 0.1457]}, {"w": "deprocess_image(x):", "b": [0.1811, 0.1305, 0.3968, 0.1457]}, {"w": "2", "b": [0.7829, 0.1305, 0.7942, 0.1457]}, {"w": "if", "b": [0.1811, 0.1457, 0.2038, 0.1608]}, {"w": "K.image_data_format()", "b": [0.2152, 0.1457, 0.4536, 0.1608]}, {"w": "==", "b": [0.4649, 0.1457, 0.4876, 0.1608]}, {"w": "'channels_first':", "b": [0.499, 0.1457, 0.6919, 0.1608]}, {"w": "x", "b": [0.2265, 0.1608, 0.2379, 0.176]}, {"w": "=", "b": [0.2492, 0.1608, 0.2606, 0.176]}, {"w": "x.reshape((3,", "b": [0.2719, 0.1608, 0.4195, 0.176]}, {"w": "x.shape[2],", "b": [0.4309, 0.1608, 0.5557, 0.176]}, {"w": "x.shape[3]))", "b": [0.5671, 0.1608, 0.7033, 0.176]}, {"w": "x", "b": [0.2265, 0.176, 0.2379, 0.1911]}, {"w": "=", "b": [0.2492, 0.176, 0.2606, 0.1911]}, {"w": "x.transpose((1,", "b": [0.2719, 0.176, 0.4422, 0.1911]}, {"w": "2,", "b": [0.4536, 0.176, 0.4763, 0.1911]}, {"w": "0))", "b": [0.4876, 0.176, 0.5217, 0.1911]}, {"w": "else:", "b": [0.1811, 0.1912, 0.2379, 0.2063]}, {"w": "x", "b": [0.2265, 0.2063, 0.2379, 0.2214]}, {"w": "=", "b": [0.2492, 0.2063, 0.2606, 0.2214]}, {"w": "x.reshape((x.shape[1],", "b": [0.2719, 0.2063, 0.5217, 0.2214]}, {"w": "x.shape[2],", "b": [0.533, 0.2063, 0.6579, 0.2214]}, {"w": "3))", "b": [0.6692, 0.2063, 0.7033, 0.2214]}, {"w": "3", "b": [0.7829, 0.2063, 0.7942, 0.2214]}, {"w": "x", "b": [0.1811, 0.2215, 0.1925, 0.2366]}, {"w": "/=", "b": [0.2038, 0.2215, 0.2265, 0.2366]}, {"w": "2.", "b": [0.2379, 0.2215, 0.2606, 0.2366]}, {"w": "x", "b": [0.1811, 0.2366, 0.1925, 0.2518]}, {"w": "+=", "b": [0.2038, 0.2366, 0.2265, 0.2518]}, {"w": "0.5", "b": [0.2379, 0.2366, 0.2719, 0.2518]}, {"w": "x", "b": [0.1811, 0.2518, 0.1925, 0.2669]}, {"w": "*=", "b": [0.2038, 0.2518, 0.2265, 0.2669]}, {"w": "255.", "b": [0.2379, 0.2518, 0.2833, 0.2669]}, {"w": "x", "b": [0.1811, 0.2669, 0.1925, 0.2821]}, {"w": "=", "b": [0.2038, 0.2669, 0.2152, 0.2821]}, {"w": "np.clip(x,", "b": [0.2265, 0.2669, 0.34, 0.2821]}, {"w": "0,", "b": [0.3514, 0.2669, 0.3741, 0.2821]}, {"w": "255).astype('uint8')", "b": [0.3855, 0.2669, 0.6125, 0.2821]}, {"w": "return", "b": [0.1811, 0.2821, 0.2492, 0.2972]}, {"w": "x", "b": [0.2606, 0.2821, 0.2719, 0.2972]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Util function to open, resize, and format pictures into tensors that Inception V3 can process 2 Util function to convert a tensor into a valid image 3 Undoes preprocessing that was performed by inception_v3.preprocess_input", "words": [{"w": "1", "b": [0.1799, 0.3156, 0.1925, 0.3354]}, {"w": "Util", "b": [0.1988, 0.3156, 0.2394, 0.3354]}, {"w": "function", "b": [0.2457, 0.3156, 0.3354, 0.3354]}, {"w": "to", "b": [0.3417, 0.3156, 0.3628, 0.3354]}, {"w": "open,", "b": [0.3691, 0.3156, 0.4272, 0.3354]}, {"w": "resize,", "b": [0.4335, 0.3156, 0.501, 0.3354]}, {"w": "and", "b": [0.5073, 0.3156, 0.548, 0.3354]}, {"w": "format", "b": [0.5543, 0.3156, 0.6285, 0.3354]}, {"w": "pictures", "b": [0.6348, 0.3156, 0.7212, 0.3354]}, {"w": "into", "b": [0.7276, 0.3156, 0.7696, 0.3354]}, {"w": "tensors", "b": [0.7759, 0.3156, 0.853, 0.3354]}, {"w": "that", "b": [0.1799, 0.3361, 0.2233, 0.3559]}, {"w": "Inception", "b": [0.2296, 0.3361, 0.3319, 0.3559]}, {"w": "V3", "b": [0.3382, 0.3361, 0.3691, 0.3559]}, {"w": "can", "b": [0.3754, 0.3361, 0.4132, 0.3559]}, {"w": "process", "b": [0.4195, 0.3361, 0.4989, 0.3559]}, {"w": "2", "b": [0.1799, 0.3566, 0.1925, 0.3764]}, {"w": "Util", "b": [0.1988, 0.3566, 0.2394, 0.3764]}, {"w": "function", "b": [0.2457, 0.3566, 0.3354, 0.3764]}, {"w": "to", "b": [0.3417, 0.3566, 0.3628, 0.3764]}, {"w": "convert", "b": [0.3691, 0.3566, 0.4503, 0.3764]}, {"w": "a", "b": [0.4566, 0.3566, 0.4692, 0.3764]}, {"w": "tensor", "b": [0.4755, 0.3566, 0.5428, 0.3764]}, {"w": "into", "b": [0.5491, 0.3566, 0.5911, 0.3764]}, {"w": "a", "b": [0.5975, 0.3566, 0.6101, 0.3764]}, {"w": "valid", "b": [0.6164, 0.3566, 0.6696, 0.3764]}, {"w": "image", "b": [0.676, 0.3566, 0.7404, 0.3764]}, {"w": "3", "b": [0.1799, 0.3771, 0.1925, 0.3969]}, {"w": "Undoes", "b": [0.1988, 0.3771, 0.2787, 0.3969]}, {"w": "preprocessing", "b": [0.285, 0.3771, 0.434, 0.3969]}, {"w": "that", "b": [0.4403, 0.3771, 0.4838, 0.3969]}, {"w": "was", "b": [0.4901, 0.3771, 0.5307, 0.3969]}, {"w": "performed", "b": [0.537, 0.3771, 0.6519, 0.3969]}, {"w": "by", "b": [0.6582, 0.3771, 0.6848, 0.3969]}, {"w": "inception_v3.preprocess_input", "b": [0.1799, 0.3976, 0.509, 0.4174]}]}, {"id": "b_2", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1294, 0.4462, 0.1672, 0.461]}]}, {"id": "b_3", "type": "paragraph", "text": "Because the original Inception V3 network was trained to recognize concepts in images of size 299 × 299, and given that the process involves scaling the images down by a reasonable factor, the DeepDream implementation produces much better results on images that are somewhere between 300 × 300 and 400 × 400. Regardless, you can run the same code on images of any size and any ratio.", "words": [{"w": "Because", "b": [0.1294, 0.4796, 0.2135, 0.4994]}, {"w": "the", "b": [0.2198, 0.4796, 0.2506, 0.4994]}, {"w": "original", "b": [0.2569, 0.4796, 0.3354, 0.4994]}, {"w": "Inception", "b": [0.3417, 0.4796, 0.437, 0.4994]}, {"w": "V3", "b": [0.4433, 0.4796, 0.4741, 0.4994]}, {"w": "network", "b": [0.4804, 0.4796, 0.5631, 0.4994]}, {"w": "was", "b": [0.5694, 0.4796, 0.6086, 0.4994]}, {"w": "trained", "b": [0.6149, 0.4796, 0.685, 0.4994]}, {"w": "to", "b": [0.6913, 0.4796, 0.7109, 0.4994]}, {"w": "recognize", "b": [0.7172, 0.4796, 0.8153, 0.4994]}, {"w": "concepts", "b": [0.1294, 0.5001, 0.2177, 0.5199]}, {"w": "in", "b": [0.224, 0.5001, 0.2436, 0.5199]}, {"w": "images", "b": [0.2499, 0.5001, 0.3214, 0.5199]}, {"w": "of", "b": [0.3277, 0.5001, 0.3487, 0.5199]}, {"w": "size", "b": [0.355, 0.5001, 0.3942, 0.5199]}, {"w": "299", "b": [0.4005, 0.5001, 0.4384, 0.5199]}, {"w": "×", "b": [0.4447, 0.5001, 0.4589, 0.5199]}, {"w": "299,", "b": [0.4652, 0.5001, 0.5094, 0.5199]}, {"w": "and", "b": [0.5157, 0.5001, 0.5521, 0.5199]}, {"w": "given", "b": [0.5584, 0.5001, 0.6145, 0.5199]}, {"w": "that", "b": [0.6208, 0.5001, 0.6586, 0.5199]}, {"w": "the", "b": [0.6649, 0.5001, 0.6957, 0.5199]}, {"w": "process", "b": [0.702, 0.5001, 0.7776, 0.5199]}, {"w": "involves", "b": [0.7839, 0.5001, 0.8694, 0.5199]}, {"w": "scaling", "b": [0.1294, 0.5206, 0.2009, 0.5404]}, {"w": "the", "b": [0.2072, 0.5206, 0.238, 0.5404]}, {"w": "images", "b": [0.2443, 0.5206, 0.3158, 0.5404]}, {"w": "down", "b": [0.3221, 0.5206, 0.3781, 0.5404]}, {"w": "by", "b": [0.3844, 0.5206, 0.4097, 0.5404]}, {"w": "a", "b": [0.416, 0.5206, 0.4272, 0.5404]}, {"w": "reasonable", "b": [0.4335, 0.5206, 0.5413, 0.5404]}, {"w": "factor,", "b": [0.5477, 0.5206, 0.6117, 0.5404]}, {"w": "the", "b": [0.618, 0.5206, 0.6489, 0.5404]}, {"w": "DeepDream", "b": [0.6552, 0.5206, 0.777, 0.5404]}, {"w": "implementation", "b": [0.1294, 0.5411, 0.2878, 0.5609]}, {"w": "produces", "b": [0.2941, 0.5411, 0.3852, 0.5609]}, {"w": "much", "b": [0.3915, 0.5411, 0.4475, 0.5609]}, {"w": "better", "b": [0.4538, 0.5411, 0.5113, 0.5609]}, {"w": "results", "b": [0.5176, 0.5411, 0.5834, 0.5609]}, {"w": "on", "b": [0.5896, 0.5411, 0.6149, 0.5609]}, {"w": "images", "b": [0.6212, 0.5411, 0.6926, 0.5609]}, {"w": "that", "b": [0.6989, 0.5411, 0.7368, 0.5609]}, {"w": "are", "b": [0.7431, 0.5411, 0.7739, 0.5609]}, {"w": "somewhere", "b": [0.1294, 0.5616, 0.2443, 0.5814]}, {"w": "between", "b": [0.2506, 0.5616, 0.3346, 0.5814]}, {"w": "300", "b": [0.341, 0.5616, 0.3788, 0.5814]}, {"w": "×", "b": [0.3851, 0.5616, 0.3993, 0.5814]}, {"w": "300", "b": [0.4056, 0.5616, 0.4435, 0.5814]}, {"w": "and", "b": [0.4498, 0.5616, 0.4862, 0.5814]}, {"w": "400", "b": [0.4925, 0.5616, 0.5304, 0.5814]}, {"w": "×", "b": [0.5367, 0.5616, 0.5509, 0.5814]}, {"w": "400.", "b": [0.5572, 0.5616, 0.6013, 0.5814]}, {"w": "Regardless,", "b": [0.6076, 0.5616, 0.7246, 0.5814]}, {"w": "you", "b": [0.7309, 0.5616, 0.7688, 0.5814]}, {"w": "can", "b": [0.7751, 0.5616, 0.8101, 0.5814]}, {"w": "run", "b": [0.8164, 0.5616, 0.85, 0.5814]}, {"w": "the", "b": [0.1294, 0.5821, 0.1602, 0.6019]}, {"w": "same", "b": [0.1665, 0.5821, 0.2184, 0.6019]}, {"w": "code", "b": [0.2247, 0.5821, 0.2723, 0.6019]}, {"w": "on", "b": [0.2786, 0.5821, 0.3038, 0.6019]}, {"w": "images", "b": [0.3102, 0.5821, 0.3816, 0.6019]}, {"w": "of", "b": [0.3879, 0.5821, 0.4089, 0.6019]}, {"w": "any", "b": [0.4152, 0.5821, 0.4517, 0.6019]}, {"w": "size", "b": [0.458, 0.5821, 0.4972, 0.6019]}, {"w": "and", "b": [0.5035, 0.5821, 0.5399, 0.6019]}, {"w": "any", "b": [0.5462, 0.5821, 0.5826, 0.6019]}, {"w": "ratio.", "b": [0.5889, 0.5821, 0.6415, 0.6019]}]}, {"id": "b_4", "type": "paragraph", "text": "Starting from a photograph taken in the small hills between San Francisco Bay and the Google campus, we obtained the DeepDream shown in figure 8.5.", "words": [{"w": "Starting", "b": [0.1294, 0.6517, 0.2093, 0.6714]}, {"w": "from", "b": [0.2156, 0.6517, 0.2646, 0.6714]}, {"w": "a", "b": [0.271, 0.6517, 0.2822, 0.6714]}, {"w": "photograph", "b": [0.2885, 0.6517, 0.4034, 0.6714]}, {"w": "taken", "b": [0.4097, 0.6517, 0.4643, 0.6714]}, {"w": "in", "b": [0.4706, 0.6517, 0.4902, 0.6714]}, {"w": "the", "b": [0.4965, 0.6517, 0.5274, 0.6714]}, {"w": "small", "b": [0.5337, 0.6517, 0.5883, 0.6714]}, {"w": "hills", "b": [0.5947, 0.6517, 0.6381, 0.6714]}, {"w": "between", "b": [0.6444, 0.6517, 0.7285, 0.6714]}, {"w": "San", "b": [0.7348, 0.6517, 0.7726, 0.6714]}, {"w": "Francisco", "b": [0.1294, 0.6722, 0.2275, 0.6919]}, {"w": "Bay", "b": [0.2338, 0.6722, 0.2744, 0.6919]}, {"w": "and", "b": [0.2807, 0.6722, 0.3172, 0.6919]}, {"w": "the", "b": [0.3235, 0.6722, 0.3543, 0.6919]}, {"w": "Google", "b": [0.3606, 0.6722, 0.4349, 0.6919]}, {"w": "campus,", "b": [0.4412, 0.6722, 0.5245, 0.6919]}, {"w": "we", "b": [0.5309, 0.6722, 0.5603, 0.6919]}, {"w": "obtained", "b": [0.5666, 0.6722, 0.6535, 0.6919]}, {"w": "the", "b": [0.6598, 0.6722, 0.6906, 0.6919]}, {"w": "DeepDream", "b": [0.6969, 0.6722, 0.8188, 0.6919]}, {"w": "shown", "b": [0.1294, 0.6927, 0.1953, 0.7124]}, {"w": "in", "b": [0.2016, 0.6927, 0.2212, 0.7124]}, {"w": "figure", "b": [0.2275, 0.6927, 0.2878, 0.7124]}, {"w": "8.5.", "b": [0.2941, 0.6927, 0.3319, 0.7124]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 8.5. Running the DeepDream code on an example image", "words": [{"w": "Figure", "b": [0.1294, 0.7305, 0.1827, 0.7453]}, {"w": "8.5.", "b": [0.1874, 0.7305, 0.2158, 0.7453]}, {"w": "Running", "b": [0.2205, 0.7305, 0.2909, 0.7453]}, {"w": "the", "b": [0.2957, 0.7305, 0.3209, 0.7453]}, {"w": "DeepDream", "b": [0.3256, 0.7305, 0.4219, 0.7453]}, {"w": "code", "b": [0.4267, 0.7305, 0.4635, 0.7453]}, {"w": "on", "b": [0.4682, 0.7305, 0.4882, 0.7453]}, {"w": "an", "b": [0.4929, 0.7305, 0.5129, 0.7453]}, {"w": "example", "b": [0.5176, 0.7305, 0.5849, 0.7453]}, {"w": "image", "b": [0.5896, 0.7305, 0.6379, 0.7453]}]}]}, {"page": 373, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "We strongly suggest that you explore what you can do by adjusting which layers you use in your loss. Layers that are lower in the network contain more-local, less-abstract representations and lead to dream patterns that look more geometric. Layers that are higher up lead to more-recognizable visual patterns based on the most common objects found in ImageNet, such as dog eyes, bird feathers, and so on. You can use random generation of the parameters in the layer_contributions dictionary to quickly explore many different layer combinations. Figure 8.6 shows a range of results obtained using different layer configurations, from an image of a delicious homemade pastry.", "words": [{"w": "We", "b": [0.1294, 0.3611, 0.1624, 0.3808]}, {"w": "strongly", "b": [0.1687, 0.3611, 0.2514, 0.3808]}, {"w": "suggest", "b": [0.2577, 0.3611, 0.3334, 0.3808]}, {"w": "that", "b": [0.3397, 0.3611, 0.3775, 0.3808]}, {"w": "you", "b": [0.3838, 0.3611, 0.4217, 0.3808]}, {"w": "explore", "b": [0.428, 0.3611, 0.5036, 0.3808]}, {"w": "what", "b": [0.5099, 0.3611, 0.559, 0.3808]}, {"w": "you", "b": [0.5653, 0.3611, 0.6031, 0.3808]}, {"w": "can", "b": [0.6094, 0.3611, 0.6444, 0.3808]}, {"w": "do", "b": [0.6507, 0.3611, 0.676, 0.3808]}, {"w": "by", "b": [0.6823, 0.3611, 0.7075, 0.3808]}, {"w": "adjusting", "b": [0.7138, 0.3611, 0.8063, 0.3808]}, {"w": "which", "b": [0.1294, 0.3816, 0.1911, 0.4013]}, {"w": "layers", "b": [0.1974, 0.3816, 0.2576, 0.4013]}, {"w": "you", "b": [0.2639, 0.3816, 0.3018, 0.4013]}, {"w": "use", "b": [0.3081, 0.3816, 0.3417, 0.4013]}, {"w": "in", "b": [0.348, 0.3816, 0.3676, 0.4013]}, {"w": "your", "b": [0.3739, 0.3816, 0.4202, 0.4013]}, {"w": "loss.", "b": [0.4265, 0.3816, 0.472, 0.4013]}, {"w": "Layers", "b": [0.4783, 0.3816, 0.547, 0.4013]}, {"w": "that", "b": [0.5533, 0.3816, 0.5911, 0.4013]}, {"w": "are", "b": [0.5974, 0.3816, 0.6282, 0.4013]}, {"w": "lower", "b": [0.6345, 0.3816, 0.692, 0.4013]}, {"w": "in", "b": [0.6982, 0.3816, 0.7179, 0.4013]}, {"w": "the", "b": [0.7242, 0.3816, 0.755, 0.4013]}, {"w": "network", "b": [0.7613, 0.3816, 0.844, 0.4013]}, {"w": "contain", "b": [0.1294, 0.4021, 0.2037, 0.4218]}, {"w": "more-local,", "b": [0.21, 0.4021, 0.3256, 0.4218]}, {"w": "less-abstract", "b": [0.3319, 0.4021, 0.4566, 0.4218]}, {"w": "representations", "b": [0.4629, 0.4021, 0.6156, 0.4218]}, {"w": "and", "b": [0.6219, 0.4021, 0.6583, 0.4218]}, {"w": "lead", "b": [0.6646, 0.4021, 0.7067, 0.4218]}, {"w": "to", "b": [0.713, 0.4021, 0.7326, 0.4218]}, {"w": "dream", "b": [0.7389, 0.4021, 0.8019, 0.4218]}, {"w": "patterns", "b": [0.1294, 0.4226, 0.2093, 0.4423]}, {"w": "that", "b": [0.2156, 0.4226, 0.2534, 0.4423]}, {"w": "look", "b": [0.2597, 0.4226, 0.3046, 0.4423]}, {"w": "more", "b": [0.3109, 0.4226, 0.3627, 0.4423]}, {"w": "geometric.", "b": [0.369, 0.4226, 0.4762, 0.4423]}, {"w": "Layers", "b": [0.4825, 0.4226, 0.5512, 0.4423]}, {"w": "that", "b": [0.5574, 0.4226, 0.5952, 0.4423]}, {"w": "are", "b": [0.6015, 0.4226, 0.6323, 0.4423]}, {"w": "higher", "b": [0.6386, 0.4226, 0.7031, 0.4423]}, {"w": "up", "b": [0.7094, 0.4226, 0.7346, 0.4423]}, {"w": "lead", "b": [0.7409, 0.4226, 0.783, 0.4423]}, {"w": "to", "b": [0.7893, 0.4226, 0.8089, 0.4423]}, {"w": "more-recognizable", "b": [0.1294, 0.4431, 0.3185, 0.4628]}, {"w": "visual", "b": [0.3248, 0.4431, 0.3851, 0.4628]}, {"w": "patterns", "b": [0.3914, 0.4431, 0.4713, 0.4628]}, {"w": "based", "b": [0.4776, 0.4431, 0.535, 0.4628]}, {"w": "on", "b": [0.5413, 0.4431, 0.5665, 0.4628]}, {"w": "the", "b": [0.5729, 0.4431, 0.6037, 0.4628]}, {"w": "most", "b": [0.61, 0.4431, 0.6591, 0.4628]}, {"w": "common", "b": [0.6654, 0.4431, 0.7536, 0.4628]}, {"w": "objects", "b": [0.76, 0.4431, 0.8314, 0.4628]}, {"w": "found", "b": [0.1294, 0.4636, 0.1883, 0.4833]}, {"w": "in", "b": [0.1946, 0.4636, 0.2142, 0.4833]}, {"w": "ImageNet,", "b": [0.2205, 0.4636, 0.3263, 0.4833]}, {"w": "such", "b": [0.3326, 0.4636, 0.3788, 0.4833]}, {"w": "as", "b": [0.3851, 0.4636, 0.4061, 0.4833]}, {"w": "dog", "b": [0.4124, 0.4636, 0.4503, 0.4833]}, {"w": "eyes,", "b": [0.4566, 0.4636, 0.5077, 0.4833]}, {"w": "bird", "b": [0.514, 0.4636, 0.5546, 0.4833]}, {"w": "feathers,", "b": [0.5609, 0.4636, 0.6471, 0.4833]}, {"w": "and", "b": [0.6534, 0.4636, 0.6898, 0.4833]}, {"w": "so", "b": [0.6961, 0.4636, 0.7186, 0.4833]}, {"w": "on.", "b": [0.7249, 0.4636, 0.7564, 0.4833]}, {"w": "You", "b": [0.7627, 0.4636, 0.8036, 0.4833]}, {"w": "can", "b": [0.8099, 0.4636, 0.8449, 0.4833]}, {"w": "use", "b": [0.1294, 0.4841, 0.163, 0.5038]}, {"w": "random", "b": [0.1693, 0.4841, 0.2464, 0.5038]}, {"w": "generation", "b": [0.2527, 0.4841, 0.3592, 0.5038]}, {"w": "of", "b": [0.3655, 0.4841, 0.3865, 0.5038]}, {"w": "the", "b": [0.3928, 0.4841, 0.4236, 0.5038]}, {"w": "parameters", "b": [0.43, 0.4841, 0.5406, 0.5038]}, {"w": "in", "b": [0.5469, 0.4841, 0.5665, 0.5038]}, {"w": "the", "b": [0.5729, 0.4841, 0.6037, 0.5038]}, {"w": "layer_contributions", "b": [0.1294, 0.5056, 0.417, 0.5258]}, {"w": "dictionary", "b": [0.4233, 0.5046, 0.5256, 0.5243]}, {"w": "to", "b": [0.5319, 0.5046, 0.5516, 0.5243]}, {"w": "quickly", "b": [0.5579, 0.5046, 0.6335, 0.5243]}, {"w": "explore", "b": [0.6398, 0.5046, 0.7155, 0.5243]}, {"w": "many", "b": [0.7218, 0.5046, 0.7779, 0.5243]}, {"w": "different", "b": [0.7842, 0.5046, 0.8705, 0.5243]}, {"w": "layer", "b": [0.1294, 0.526, 0.1798, 0.5457]}, {"w": "combinations.", "b": [0.1861, 0.526, 0.3284, 0.5457]}, {"w": "Figure", "b": [0.3347, 0.526, 0.4005, 0.5457]}, {"w": "8.6", "b": [0.4068, 0.526, 0.4384, 0.5457]}, {"w": "shows", "b": [0.4447, 0.526, 0.5077, 0.5457]}, {"w": "a", "b": [0.514, 0.526, 0.5252, 0.5457]}, {"w": "range", "b": [0.5315, 0.526, 0.5876, 0.5457]}, {"w": "of", "b": [0.5939, 0.526, 0.6149, 0.5457]}, {"w": "results", "b": [0.6212, 0.526, 0.687, 0.5457]}, {"w": "obtained", "b": [0.6934, 0.526, 0.7802, 0.5457]}, {"w": "using", "b": [0.7865, 0.526, 0.8412, 0.5457]}, {"w": "different", "b": [0.1294, 0.5465, 0.2158, 0.5662]}, {"w": "layer", "b": [0.2221, 0.5465, 0.2725, 0.5662]}, {"w": "configurations,", "b": [0.2788, 0.5465, 0.4309, 0.5662]}, {"w": "from", "b": [0.4372, 0.5465, 0.4862, 0.5662]}, {"w": "an", "b": [0.4925, 0.5465, 0.5163, 0.5662]}, {"w": "image", "b": [0.5227, 0.5465, 0.5843, 0.5662]}, {"w": "of", "b": [0.5906, 0.5465, 0.6116, 0.5662]}, {"w": "a", "b": [0.6179, 0.5465, 0.6291, 0.5662]}, {"w": "delicious", "b": [0.6354, 0.5465, 0.7265, 0.5662]}, {"w": "homemade", "b": [0.7328, 0.5465, 0.8435, 0.5662]}, {"w": "pastry.", "b": [0.1294, 0.567, 0.1957, 0.5867]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.6. Trying a range of DeepDream configurations on an example image", "words": [{"w": "Figure", "b": [0.1294, 0.6093, 0.1827, 0.6241]}, {"w": "8.6.", "b": [0.1874, 0.6093, 0.2158, 0.6241]}, {"w": "Trying", "b": [0.2205, 0.6093, 0.2748, 0.6241]}, {"w": "a", "b": [0.2795, 0.6093, 0.289, 0.6241]}, {"w": "range", "b": [0.2937, 0.6093, 0.34, 0.6241]}, {"w": "of", "b": [0.3447, 0.6093, 0.3604, 0.6241]}, {"w": "DeepDream", "b": [0.3652, 0.6093, 0.4615, 0.6241]}, {"w": "configurations", "b": [0.4662, 0.6093, 0.5829, 0.6241]}, {"w": "on", "b": [0.5876, 0.6093, 0.6076, 0.6241]}, {"w": "an", "b": [0.6123, 0.6093, 0.6323, 0.6241]}, {"w": "example", "b": [0.637, 0.6093, 0.7043, 0.6241]}, {"w": "image", "b": [0.709, 0.6093, 0.7574, 0.6241]}]}]}, {"page": 374, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "8.2.2. Wrapping up", "words": [{"w": "8.2.2.", "b": [0.1294, 0.5919, 0.1862, 0.6117]}, {"w": "Wrapping", "b": [0.1925, 0.5919, 0.3028, 0.6117]}, {"w": "up", "b": [0.3091, 0.5919, 0.3371, 0.6117]}]}, {"id": "b_1", "type": "paragraph", "text": "DeepDream consists of running a convnet in reverse to generate inputs based on the representations learned by the network. The results produced are fun and somewhat similar to the visual artifacts induced in humans by the disruption of the visual cortex via psychedelics. Note that the process isn’t specific to image models or even to convnets. It can be done for speech, music, and more.", "words": [{"w": "DeepDream", "b": [0.1799, 0.6303, 0.3017, 0.65]}, {"w": "consists", "b": [0.308, 0.6303, 0.3879, 0.65]}, {"w": "of", "b": [0.3942, 0.6303, 0.4152, 0.65]}, {"w": "running", "b": [0.4216, 0.6303, 0.5, 0.65]}, {"w": "a", "b": [0.5063, 0.6303, 0.5175, 0.65]}, {"w": "convnet", "b": [0.5238, 0.6303, 0.6037, 0.65]}, {"w": "in", "b": [0.61, 0.6303, 0.6296, 0.65]}, {"w": "reverse", "b": [0.6359, 0.6303, 0.7088, 0.65]}, {"w": "to", "b": [0.7151, 0.6303, 0.7347, 0.65]}, {"w": "generate", "b": [0.741, 0.6303, 0.8265, 0.65]}, {"w": "inputs", "b": [0.1799, 0.6508, 0.2415, 0.6705]}, {"w": "based", "b": [0.2478, 0.6508, 0.3053, 0.6705]}, {"w": "on", "b": [0.3116, 0.6508, 0.3368, 0.6705]}, {"w": "the", "b": [0.3431, 0.6508, 0.374, 0.6705]}, {"w": "representations", "b": [0.3803, 0.6508, 0.533, 0.6705]}, {"w": "learned", "b": [0.5393, 0.6508, 0.6135, 0.6705]}, {"w": "by", "b": [0.6198, 0.6508, 0.6451, 0.6705]}, {"w": "the", "b": [0.6514, 0.6508, 0.6822, 0.6705]}, {"w": "network.", "b": [0.6885, 0.6508, 0.7775, 0.6705]}, {"w": "The", "b": [0.1799, 0.6713, 0.2191, 0.691]}, {"w": "results", "b": [0.2254, 0.6713, 0.2913, 0.691]}, {"w": "produced", "b": [0.2976, 0.6713, 0.3914, 0.691]}, {"w": "are", "b": [0.3977, 0.6713, 0.4285, 0.691]}, {"w": "fun", "b": [0.4348, 0.6713, 0.4685, 0.691]}, {"w": "and", "b": [0.4748, 0.6713, 0.5112, 0.691]}, {"w": "somewhat", "b": [0.5175, 0.6713, 0.6198, 0.691]}, {"w": "similar", "b": [0.6261, 0.6713, 0.6962, 0.691]}, {"w": "to", "b": [0.7025, 0.6713, 0.7221, 0.691]}, {"w": "the", "b": [0.7284, 0.6713, 0.7592, 0.691]}, {"w": "visual", "b": [0.7656, 0.6713, 0.8258, 0.691]}, {"w": "artifacts", "b": [0.1799, 0.6918, 0.2611, 0.7115]}, {"w": "induced", "b": [0.2674, 0.6918, 0.3473, 0.7115]}, {"w": "in", "b": [0.3536, 0.6918, 0.3732, 0.7115]}, {"w": "humans", "b": [0.3795, 0.6918, 0.458, 0.7115]}, {"w": "by", "b": [0.4643, 0.6918, 0.4895, 0.7115]}, {"w": "the", "b": [0.4958, 0.6918, 0.5267, 0.7115]}, {"w": "disruption", "b": [0.533, 0.6918, 0.6353, 0.7115]}, {"w": "of", "b": [0.6416, 0.6918, 0.6626, 0.7115]}, {"w": "the", "b": [0.6689, 0.6918, 0.6997, 0.7115]}, {"w": "visual", "b": [0.706, 0.6918, 0.7663, 0.7115]}, {"w": "cortex", "b": [0.7725, 0.6918, 0.8356, 0.7115]}, {"w": "via", "b": [0.1799, 0.7123, 0.2107, 0.732]}, {"w": "psychedelics.", "b": [0.217, 0.7123, 0.3522, 0.732]}, {"w": "Note", "b": [0.1799, 0.7328, 0.2289, 0.7525]}, {"w": "that", "b": [0.2352, 0.7328, 0.273, 0.7525]}, {"w": "the", "b": [0.2794, 0.7328, 0.3102, 0.7525]}, {"w": "process", "b": [0.3165, 0.7328, 0.3921, 0.7525]}, {"w": "isn’t", "b": [0.3984, 0.7328, 0.4428, 0.7525]}, {"w": "specific", "b": [0.4491, 0.7328, 0.5276, 0.7525]}, {"w": "to", "b": [0.5339, 0.7328, 0.5535, 0.7525]}, {"w": "image", "b": [0.5598, 0.7328, 0.6215, 0.7525]}, {"w": "models", "b": [0.6278, 0.7328, 0.7006, 0.7525]}, {"w": "or", "b": [0.707, 0.7328, 0.728, 0.7525]}, {"w": "even", "b": [0.7343, 0.7328, 0.7819, 0.7525]}, {"w": "to", "b": [0.7882, 0.7328, 0.8078, 0.7525]}, {"w": "convnets.", "b": [0.1799, 0.7533, 0.2758, 0.773]}, {"w": "It", "b": [0.2822, 0.7533, 0.2976, 0.773]}, {"w": "can", "b": [0.3039, 0.7533, 0.3389, 0.773]}, {"w": "be", "b": [0.3452, 0.7533, 0.369, 0.773]}, {"w": "done", "b": [0.3753, 0.7533, 0.4244, 0.773]}, {"w": "for", "b": [0.4307, 0.7533, 0.4601, 0.773]}, {"w": "speech,", "b": [0.4664, 0.7533, 0.5413, 0.773]}, {"w": "music,", "b": [0.5476, 0.7533, 0.6142, 0.773]}, {"w": "and", "b": [0.6205, 0.7533, 0.6569, 0.773]}, {"w": "more.", "b": [0.6632, 0.7533, 0.7214, 0.773]}]}, {"id": "b_2", "type": "paragraph", "text": "8.3. Neural style transfer", "words": [{"w": "8.3.", "b": [0.1294, 0.8101, 0.172, 0.8323]}, {"w": "Neural", "b": [0.1791, 0.8101, 0.2626, 0.8323]}, {"w": "style", "b": [0.2697, 0.8101, 0.3249, 0.8323]}, {"w": "transfer", "b": [0.332, 0.8101, 0.4297, 0.8323]}]}, {"id": "b_3", "type": "paragraph", "text": "In addition to DeepDream, another major development in deep-learning- driven image modification is neural style transfer, introduced by Leon", "words": [{"w": "In", "b": [0.1294, 0.8558, 0.1504, 0.8755]}, {"w": "addition", "b": [0.1567, 0.8558, 0.2394, 0.8755]}, {"w": "to", "b": [0.2457, 0.8558, 0.2654, 0.8755]}, {"w": "DeepDream,", "b": [0.2717, 0.8558, 0.3998, 0.8755]}, {"w": "another", "b": [0.4061, 0.8558, 0.4818, 0.8755]}, {"w": "major", "b": [0.4881, 0.8558, 0.5469, 0.8755]}, {"w": "development", "b": [0.5533, 0.8558, 0.6836, 0.8755]}, {"w": "in", "b": [0.6899, 0.8558, 0.7095, 0.8755]}, {"w": "deep-learning-", "b": [0.7158, 0.8558, 0.8629, 0.8755]}, {"w": "driven", "b": [0.1294, 0.8763, 0.1939, 0.896]}, {"w": "image", "b": [0.2002, 0.8763, 0.2618, 0.896]}, {"w": "modification", "b": [0.2681, 0.8763, 0.3971, 0.896]}, {"w": "is", "b": [0.4034, 0.8763, 0.4202, 0.896]}, {"w": "neural", "b": [0.4264, 0.8763, 0.4923, 0.896]}, {"w": "style", "b": [0.4986, 0.8763, 0.5448, 0.896]}, {"w": "transfer,", "b": [0.5511, 0.8763, 0.6373, 0.896]}, {"w": "introduced", "b": [0.6436, 0.8763, 0.7515, 0.896]}, {"w": "by", "b": [0.7578, 0.8763, 0.783, 0.896]}, {"w": "Leon", "b": [0.7894, 0.8763, 0.8412, 0.896]}]}]}, {"page": 375, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Gatys et al. in the summer of 2015.[5] The neural style transfer algorithm has undergone many refinements and spawned many variations since its original introduction, and it has made its way into many smartphone photo apps. For simplicity, this section focuses on the formulation described in the original paper.", "words": [{"w": "Gatys", "b": [0.1294, 0.0875, 0.1883, 0.1072]}, {"w": "et", "b": [0.1946, 0.0875, 0.2128, 0.1072]}, {"w": "al.", "b": [0.2191, 0.0875, 0.2436, 0.1072]}, {"w": "in", "b": [0.2499, 0.0875, 0.2695, 0.1072]}, {"w": "the", "b": [0.2758, 0.0875, 0.3067, 0.1072]}, {"w": "summer", "b": [0.313, 0.0875, 0.3943, 0.1072]}, {"w": "of", "b": [0.4006, 0.0875, 0.4216, 0.1072]}, {"w": "2015.[5]", "b": [0.4279, 0.0852, 0.5066, 0.1072]}, {"w": "The", "b": [0.5129, 0.0875, 0.5522, 0.1072]}, {"w": "neural", "b": [0.5585, 0.0875, 0.6215, 0.1072]}, {"w": "style", "b": [0.6278, 0.0875, 0.6755, 0.1072]}, {"w": "transfer", "b": [0.6818, 0.0875, 0.7588, 0.1072]}, {"w": "algorithm", "b": [0.7651, 0.0875, 0.8632, 0.1072]}, {"w": "has", "b": [0.1294, 0.108, 0.163, 0.1277]}, {"w": "undergone", "b": [0.1693, 0.108, 0.2754, 0.1277]}, {"w": "many", "b": [0.2817, 0.108, 0.3377, 0.1277]}, {"w": "refinements", "b": [0.344, 0.108, 0.4631, 0.1277]}, {"w": "and", "b": [0.4694, 0.108, 0.5059, 0.1277]}, {"w": "spawned", "b": [0.5122, 0.108, 0.6004, 0.1277]}, {"w": "many", "b": [0.6067, 0.108, 0.6628, 0.1277]}, {"w": "variations", "b": [0.6691, 0.108, 0.7686, 0.1277]}, {"w": "since", "b": [0.7749, 0.108, 0.8267, 0.1277]}, {"w": "its", "b": [0.833, 0.108, 0.8569, 0.1277]}, {"w": "original", "b": [0.1294, 0.1285, 0.2079, 0.1482]}, {"w": "introduction,", "b": [0.2142, 0.1285, 0.3438, 0.1482]}, {"w": "and", "b": [0.3501, 0.1285, 0.3865, 0.1482]}, {"w": "it", "b": [0.3928, 0.1285, 0.4069, 0.1482]}, {"w": "has", "b": [0.4132, 0.1285, 0.4468, 0.1482]}, {"w": "made", "b": [0.4531, 0.1285, 0.5077, 0.1482]}, {"w": "its", "b": [0.514, 0.1285, 0.5379, 0.1482]}, {"w": "way", "b": [0.5442, 0.1285, 0.5862, 0.1482]}, {"w": "into", "b": [0.5925, 0.1285, 0.6318, 0.1482]}, {"w": "many", "b": [0.6381, 0.1285, 0.6941, 0.1482]}, {"w": "smartphone", "b": [0.7004, 0.1285, 0.8181, 0.1482]}, {"w": "photo", "b": [0.1294, 0.149, 0.1869, 0.1687]}, {"w": "apps.", "b": [0.1932, 0.149, 0.2457, 0.1687]}, {"w": "For", "b": [0.252, 0.149, 0.2871, 0.1687]}, {"w": "simplicity,", "b": [0.2934, 0.149, 0.399, 0.1687]}, {"w": "this", "b": [0.4053, 0.149, 0.4417, 0.1687]}, {"w": "section", "b": [0.448, 0.149, 0.5195, 0.1687]}, {"w": "focuses", "b": [0.5258, 0.149, 0.6014, 0.1687]}, {"w": "on", "b": [0.6077, 0.149, 0.633, 0.1687]}, {"w": "the", "b": [0.6393, 0.149, 0.6701, 0.1687]}, {"w": "formulation", "b": [0.6764, 0.149, 0.7955, 0.1687]}, {"w": "described", "b": [0.1294, 0.1695, 0.2261, 0.1892]}, {"w": "in", "b": [0.2324, 0.1695, 0.252, 0.1892]}, {"w": "the", "b": [0.2583, 0.1695, 0.2891, 0.1892]}, {"w": "original", "b": [0.2954, 0.1695, 0.3739, 0.1892]}, {"w": "paper.", "b": [0.3802, 0.1695, 0.4411, 0.1892]}]}, {"id": "b_2", "type": "paragraph", "text": "Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge, “A Neural Algorithm of Artistic Style,” arXiv (2015), https://arxiv.org/abs/1508.06576.", "words": [{"w": "Leon", "b": [0.1483, 0.2349, 0.1872, 0.2497]}, {"w": "A.", "b": [0.1919, 0.2349, 0.2103, 0.2497]}, {"w": "Gatys,", "b": [0.2151, 0.2349, 0.2639, 0.2497]}, {"w": "Alexander", "b": [0.2687, 0.2349, 0.3475, 0.2497]}, {"w": "S.", "b": [0.3522, 0.2349, 0.3674, 0.2497]}, {"w": "Ecker,", "b": [0.3722, 0.2349, 0.4202, 0.2497]}, {"w": "and", "b": [0.425, 0.2349, 0.4523, 0.2497]}, {"w": "Matthias", "b": [0.457, 0.2349, 0.5232, 0.2497]}, {"w": "Bethge,", "b": [0.528, 0.2349, 0.5863, 0.2497]}, {"w": "“A", "b": [0.591, 0.2349, 0.6131, 0.2497]}, {"w": "Neural", "b": [0.6178, 0.2349, 0.6693, 0.2497]}, {"w": "Algorithm", "b": [0.674, 0.2349, 0.7529, 0.2497]}, {"w": "of", "b": [0.7576, 0.2349, 0.7734, 0.2497]}, {"w": "Artistic", "b": [0.7781, 0.2349, 0.8348, 0.2497]}, {"w": "Style,”", "b": [0.1483, 0.2501, 0.2004, 0.2649]}, {"w": "arXiv", "b": [0.2051, 0.2501, 0.2482, 0.2649]}, {"w": "(2015),", "b": [0.2529, 0.2501, 0.3081, 0.2649]}, {"w": "https://arxiv.org/abs/1508.06576.", "b": [0.3128, 0.2501, 0.5629, 0.2649]}]}, {"id": "b_3", "type": "paragraph", "text": "Neural style transfer consists of applying the style of a reference image to a target image while conserving the content of the target image. Figure 8.7 shows an example.", "words": [{"w": "Neural", "b": [0.1294, 0.288, 0.1981, 0.3077]}, {"w": "style", "b": [0.2044, 0.288, 0.252, 0.3077]}, {"w": "transfer", "b": [0.2583, 0.288, 0.3354, 0.3077]}, {"w": "consists", "b": [0.3417, 0.288, 0.4216, 0.3077]}, {"w": "of", "b": [0.4279, 0.288, 0.4489, 0.3077]}, {"w": "applying", "b": [0.4552, 0.288, 0.5435, 0.3077]}, {"w": "the", "b": [0.5498, 0.288, 0.5806, 0.3077]}, {"w": "style", "b": [0.5869, 0.288, 0.6346, 0.3077]}, {"w": "of", "b": [0.6409, 0.288, 0.6619, 0.3077]}, {"w": "a", "b": [0.6682, 0.288, 0.6794, 0.3077]}, {"w": "reference", "b": [0.6857, 0.288, 0.7795, 0.3077]}, {"w": "image", "b": [0.7858, 0.288, 0.8475, 0.3077]}, {"w": "to", "b": [0.1294, 0.3085, 0.149, 0.3282]}, {"w": "a", "b": [0.1553, 0.3085, 0.1665, 0.3282]}, {"w": "target", "b": [0.1729, 0.3085, 0.2298, 0.3282]}, {"w": "image", "b": [0.2361, 0.3085, 0.2978, 0.3282]}, {"w": "while", "b": [0.3041, 0.3085, 0.3601, 0.3282]}, {"w": "conserving", "b": [0.3664, 0.3085, 0.4771, 0.3282]}, {"w": "the", "b": [0.4834, 0.3085, 0.5143, 0.3282]}, {"w": "content", "b": [0.5206, 0.3085, 0.5948, 0.3282]}, {"w": "of", "b": [0.6011, 0.3085, 0.6222, 0.3282]}, {"w": "the", "b": [0.6284, 0.3085, 0.6592, 0.3282]}, {"w": "target", "b": [0.6655, 0.3085, 0.7225, 0.3282]}, {"w": "image.", "b": [0.7288, 0.3085, 0.7968, 0.3282]}, {"w": "Figure", "b": [0.803, 0.3085, 0.8689, 0.3282]}, {"w": "8.7", "b": [0.1294, 0.329, 0.1609, 0.3487]}, {"w": "shows", "b": [0.1673, 0.329, 0.2303, 0.3487]}, {"w": "an", "b": [0.2366, 0.329, 0.2604, 0.3487]}, {"w": "example.", "b": [0.2667, 0.329, 0.3585, 0.3487]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 8.7. A style transfer example", "words": [{"w": "Figure", "b": [0.1294, 0.3668, 0.1827, 0.3817]}, {"w": "8.7.", "b": [0.1874, 0.3668, 0.2158, 0.3817]}, {"w": "A", "b": [0.2205, 0.3668, 0.2341, 0.3817]}, {"w": "style", "b": [0.2389, 0.3668, 0.2756, 0.3817]}, {"w": "transfer", "b": [0.2804, 0.3668, 0.3455, 0.3817]}, {"w": "example", "b": [0.3502, 0.3668, 0.4175, 0.3817]}]}, {"id": "b_5", "type": "paragraph", "text": "In this context, style essentially means textures, colors, and visual patterns in the image, at various spatial scales; and the content is the higher-level macrostructure of the image. For instance, blue-and-yellow circular brushstrokes are considered to be the style in figure 8.7 (using Starry Night by Vincent Van Gogh), and the buildings in the Tübingen photograph are considered to be the content.", "words": [{"w": "In", "b": [0.1294, 0.5206, 0.1504, 0.5404]}, {"w": "this", "b": [0.1567, 0.5206, 0.1932, 0.5404]}, {"w": "context,", "b": [0.1995, 0.5206, 0.2801, 0.5404]}, {"w": "style", "b": [0.2863, 0.5206, 0.3326, 0.5404]}, {"w": "essentially", "b": [0.3389, 0.5206, 0.4454, 0.5404]}, {"w": "means", "b": [0.4517, 0.5206, 0.5161, 0.5404]}, {"w": "textures,", "b": [0.5224, 0.5206, 0.6086, 0.5404]}, {"w": "colors,", "b": [0.6149, 0.5206, 0.6829, 0.5404]}, {"w": "and", "b": [0.6892, 0.5206, 0.7256, 0.5404]}, {"w": "visual", "b": [0.7319, 0.5206, 0.7922, 0.5404]}, {"w": "patterns", "b": [0.1294, 0.5411, 0.2093, 0.5609]}, {"w": "in", "b": [0.2156, 0.5411, 0.2352, 0.5609]}, {"w": "the", "b": [0.2415, 0.5411, 0.2723, 0.5609]}, {"w": "image,", "b": [0.2786, 0.5411, 0.3466, 0.5609]}, {"w": "at", "b": [0.3529, 0.5411, 0.3711, 0.5609]}, {"w": "various", "b": [0.3774, 0.5411, 0.4517, 0.5609]}, {"w": "spatial", "b": [0.458, 0.5411, 0.5239, 0.5609]}, {"w": "scales;", "b": [0.5302, 0.5411, 0.5974, 0.5609]}, {"w": "and", "b": [0.6037, 0.5411, 0.6402, 0.5609]}, {"w": "the", "b": [0.6465, 0.5411, 0.6773, 0.5609]}, {"w": "content", "b": [0.6835, 0.5411, 0.7578, 0.5609]}, {"w": "is", "b": [0.764, 0.5411, 0.7809, 0.5609]}, {"w": "the", "b": [0.7872, 0.5411, 0.818, 0.5609]}, {"w": "higher-level", "b": [0.1294, 0.5616, 0.2508, 0.5814]}, {"w": "macrostructure", "b": [0.2571, 0.5616, 0.4084, 0.5814]}, {"w": "of", "b": [0.4147, 0.5616, 0.4357, 0.5814]}, {"w": "the", "b": [0.442, 0.5616, 0.4729, 0.5814]}, {"w": "image.", "b": [0.4792, 0.5616, 0.5471, 0.5814]}, {"w": "For", "b": [0.5534, 0.5616, 0.5885, 0.5814]}, {"w": "instance,", "b": [0.5948, 0.5616, 0.6837, 0.5814]}, {"w": "blue-and-yellow", "b": [0.69, 0.5616, 0.8554, 0.5814]}, {"w": "circular", "b": [0.1294, 0.5821, 0.2065, 0.6019]}, {"w": "brushstrokes", "b": [0.2128, 0.5821, 0.3403, 0.6019]}, {"w": "are", "b": [0.3466, 0.5821, 0.3774, 0.6019]}, {"w": "considered", "b": [0.3837, 0.5821, 0.493, 0.6019]}, {"w": "to", "b": [0.4993, 0.5821, 0.5189, 0.6019]}, {"w": "be", "b": [0.5252, 0.5821, 0.549, 0.6019]}, {"w": "the", "b": [0.5553, 0.5821, 0.5861, 0.6019]}, {"w": "style", "b": [0.5924, 0.5821, 0.6401, 0.6019]}, {"w": "in", "b": [0.6464, 0.5821, 0.666, 0.6019]}, {"w": "figure", "b": [0.6723, 0.5821, 0.7325, 0.6019]}, {"w": "8.7", "b": [0.7388, 0.5821, 0.7703, 0.6019]}, {"w": "(using", "b": [0.7766, 0.5821, 0.8397, 0.6019]}, {"w": "Starry", "b": [0.1294, 0.6026, 0.1925, 0.6224]}, {"w": "Night", "b": [0.1988, 0.6026, 0.2549, 0.6224]}, {"w": "by", "b": [0.2612, 0.6026, 0.2864, 0.6224]}, {"w": "Vincent", "b": [0.2927, 0.6026, 0.371, 0.6224]}, {"w": "Van", "b": [0.3774, 0.6026, 0.4166, 0.6224]}, {"w": "Gogh),", "b": [0.4229, 0.6026, 0.4936, 0.6224]}, {"w": "and", "b": [0.4999, 0.6026, 0.5364, 0.6224]}, {"w": "the", "b": [0.5427, 0.6026, 0.5735, 0.6224]}, {"w": "buildings", "b": [0.5798, 0.6026, 0.6737, 0.6224]}, {"w": "in", "b": [0.68, 0.6026, 0.6997, 0.6224]}, {"w": "the", "b": [0.706, 0.6026, 0.7368, 0.6224]}, {"w": "Tübingen", "b": [0.7431, 0.6026, 0.8398, 0.6224]}, {"w": "photograph", "b": [0.1294, 0.6231, 0.2443, 0.6429]}, {"w": "are", "b": [0.2506, 0.6231, 0.2814, 0.6429]}, {"w": "considered", "b": [0.2877, 0.6231, 0.397, 0.6429]}, {"w": "to", "b": [0.4033, 0.6231, 0.4229, 0.6429]}, {"w": "be", "b": [0.4292, 0.6231, 0.4531, 0.6429]}, {"w": "the", "b": [0.4594, 0.6231, 0.4902, 0.6429]}, {"w": "content.", "b": [0.4965, 0.6231, 0.5771, 0.6429]}]}, {"id": "b_6", "type": "paragraph", "text": "The idea of style transfer, which is tightly related to that of texture generation, has had a long history in the image-processing community prior to the development of neural style transfer in 2015. But as it turns out, the deep-learning-based implementations of style transfer offer results unparalleled by what had been previously achieved with classical computer-vision techniques, and they triggered an amazing renaissance in creative applications of computer vision.", "words": [{"w": "The", "b": [0.1294, 0.6659, 0.1686, 0.6857]}, {"w": "idea", "b": [0.1749, 0.6659, 0.217, 0.6857]}, {"w": "of", "b": [0.2233, 0.6659, 0.2443, 0.6857]}, {"w": "style", "b": [0.2506, 0.6659, 0.2982, 0.6857]}, {"w": "transfer,", "b": [0.3046, 0.6659, 0.3869, 0.6857]}, {"w": "which", "b": [0.3932, 0.6659, 0.4548, 0.6857]}, {"w": "is", "b": [0.4611, 0.6659, 0.4779, 0.6857]}, {"w": "tightly", "b": [0.4843, 0.6659, 0.5501, 0.6857]}, {"w": "related", "b": [0.5564, 0.6659, 0.6251, 0.6857]}, {"w": "to", "b": [0.6314, 0.6659, 0.651, 0.6857]}, {"w": "that", "b": [0.6573, 0.6659, 0.6952, 0.6857]}, {"w": "of", "b": [0.7015, 0.6659, 0.7225, 0.6857]}, {"w": "texture", "b": [0.7288, 0.6659, 0.7988, 0.6857]}, {"w": "generation,", "b": [0.1294, 0.6864, 0.2422, 0.7062]}, {"w": "has", "b": [0.2485, 0.6864, 0.2821, 0.7062]}, {"w": "had", "b": [0.2884, 0.6864, 0.3249, 0.7062]}, {"w": "a", "b": [0.3312, 0.6864, 0.3424, 0.7062]}, {"w": "long", "b": [0.3487, 0.6864, 0.3935, 0.7062]}, {"w": "history", "b": [0.3998, 0.6864, 0.4699, 0.7062]}, {"w": "in", "b": [0.4762, 0.6864, 0.4958, 0.7062]}, {"w": "the", "b": [0.5021, 0.6864, 0.533, 0.7062]}, {"w": "image-processing", "b": [0.5393, 0.6864, 0.7172, 0.7062]}, {"w": "community", "b": [0.7235, 0.6864, 0.8384, 0.7062]}, {"w": "prior", "b": [0.1294, 0.7069, 0.1785, 0.7267]}, {"w": "to", "b": [0.1848, 0.7069, 0.2044, 0.7267]}, {"w": "the", "b": [0.2107, 0.7069, 0.2415, 0.7267]}, {"w": "development", "b": [0.2478, 0.7069, 0.3781, 0.7267]}, {"w": "of", "b": [0.3844, 0.7069, 0.4055, 0.7267]}, {"w": "neural", "b": [0.4118, 0.7069, 0.4748, 0.7267]}, {"w": "style", "b": [0.4811, 0.7069, 0.5288, 0.7267]}, {"w": "transfer", "b": [0.5351, 0.7069, 0.6121, 0.7267]}, {"w": "in", "b": [0.6184, 0.7069, 0.638, 0.7267]}, {"w": "2015.", "b": [0.6443, 0.7069, 0.7011, 0.7267]}, {"w": "But", "b": [0.7074, 0.7069, 0.7439, 0.7267]}, {"w": "as", "b": [0.7502, 0.7069, 0.7712, 0.7267]}, {"w": "it", "b": [0.7775, 0.7069, 0.7915, 0.7267]}, {"w": "turns", "b": [0.7978, 0.7069, 0.8483, 0.7267]}, {"w": "out,", "b": [0.1294, 0.7274, 0.168, 0.7472]}, {"w": "the", "b": [0.1743, 0.7274, 0.2051, 0.7472]}, {"w": "deep-learning-based", "b": [0.2114, 0.7274, 0.4159, 0.7472]}, {"w": "implementations", "b": [0.4222, 0.7274, 0.5904, 0.7472]}, {"w": "of", "b": [0.5966, 0.7274, 0.6177, 0.7472]}, {"w": "style", "b": [0.624, 0.7274, 0.6716, 0.7472]}, {"w": "transfer", "b": [0.6779, 0.7274, 0.755, 0.7472]}, {"w": "offer", "b": [0.7613, 0.7274, 0.8098, 0.7472]}, {"w": "results", "b": [0.1294, 0.7479, 0.1953, 0.7677]}, {"w": "unparalleled", "b": [0.2016, 0.7479, 0.3263, 0.7677]}, {"w": "by", "b": [0.3326, 0.7479, 0.3578, 0.7677]}, {"w": "what", "b": [0.3641, 0.7479, 0.4132, 0.7677]}, {"w": "had", "b": [0.4195, 0.7479, 0.4559, 0.7677]}, {"w": "been", "b": [0.4622, 0.7479, 0.5098, 0.7677]}, {"w": "previously", "b": [0.5161, 0.7479, 0.6226, 0.7677]}, {"w": "achieved", "b": [0.6289, 0.7479, 0.7186, 0.7677]}, {"w": "with", "b": [0.7249, 0.7479, 0.7697, 0.7677]}, {"w": "classical", "b": [0.776, 0.7479, 0.8615, 0.7677]}, {"w": "computer-vision", "b": [0.1294, 0.7684, 0.2942, 0.7882]}, {"w": "techniques,", "b": [0.3006, 0.7684, 0.4147, 0.7882]}, {"w": "and", "b": [0.421, 0.7684, 0.4575, 0.7882]}, {"w": "they", "b": [0.4638, 0.7684, 0.5072, 0.7882]}, {"w": "triggered", "b": [0.5135, 0.7684, 0.6046, 0.7882]}, {"w": "an", "b": [0.6109, 0.7684, 0.6347, 0.7882]}, {"w": "amazing", "b": [0.641, 0.7684, 0.7265, 0.7882]}, {"w": "renaissance", "b": [0.7328, 0.7684, 0.849, 0.7882]}, {"w": "in", "b": [0.1294, 0.7889, 0.149, 0.8087]}, {"w": "creative", "b": [0.1553, 0.7889, 0.2352, 0.8087]}, {"w": "applications", "b": [0.2415, 0.7889, 0.3634, 0.8087]}, {"w": "of", "b": [0.3697, 0.7889, 0.3907, 0.8087]}, {"w": "computer", "b": [0.397, 0.7889, 0.4923, 0.8087]}, {"w": "vision.", "b": [0.4986, 0.7889, 0.5666, 0.8087]}]}, {"id": "b_7", "type": "paragraph", "text": "The key notion behind implementing style transfer is the same idea that’s central to all deep-learning algorithms: you define a loss function to specify what you want to achieve, and you minimize this loss. You know what you want to achieve: conserving the content of the original image", "words": [{"w": "The", "b": [0.1294, 0.8317, 0.1686, 0.8514]}, {"w": "key", "b": [0.1749, 0.8317, 0.2114, 0.8514]}, {"w": "notion", "b": [0.2177, 0.8317, 0.2822, 0.8514]}, {"w": "behind", "b": [0.2885, 0.8317, 0.3571, 0.8514]}, {"w": "implementing", "b": [0.3634, 0.8317, 0.5036, 0.8514]}, {"w": "style", "b": [0.5099, 0.8317, 0.5575, 0.8514]}, {"w": "transfer", "b": [0.5639, 0.8317, 0.6409, 0.8514]}, {"w": "is", "b": [0.6472, 0.8317, 0.664, 0.8514]}, {"w": "the", "b": [0.6703, 0.8317, 0.7012, 0.8514]}, {"w": "same", "b": [0.7075, 0.8317, 0.7593, 0.8514]}, {"w": "idea", "b": [0.7656, 0.8317, 0.8076, 0.8514]}, {"w": "that’s", "b": [0.8139, 0.8317, 0.8685, 0.8514]}, {"w": "central", "b": [0.1294, 0.8522, 0.1981, 0.8719]}, {"w": "to", "b": [0.2044, 0.8522, 0.224, 0.8719]}, {"w": "all", "b": [0.2303, 0.8522, 0.2555, 0.8719]}, {"w": "deep-learning", "b": [0.2618, 0.8522, 0.4005, 0.8719]}, {"w": "algorithms:", "b": [0.4068, 0.8522, 0.5217, 0.8719]}, {"w": "you", "b": [0.5281, 0.8522, 0.5659, 0.8719]}, {"w": "define", "b": [0.5722, 0.8522, 0.6352, 0.8719]}, {"w": "a", "b": [0.6414, 0.8522, 0.6526, 0.8719]}, {"w": "loss", "b": [0.6589, 0.8522, 0.6982, 0.8719]}, {"w": "function", "b": [0.7045, 0.8522, 0.7886, 0.8719]}, {"w": "to", "b": [0.7949, 0.8522, 0.8145, 0.8719]}, {"w": "specify", "b": [0.1294, 0.8727, 0.2023, 0.8924]}, {"w": "what", "b": [0.2086, 0.8727, 0.2576, 0.8924]}, {"w": "you", "b": [0.2639, 0.8727, 0.3018, 0.8924]}, {"w": "want", "b": [0.3081, 0.8727, 0.3571, 0.8924]}, {"w": "to", "b": [0.3634, 0.8727, 0.383, 0.8924]}, {"w": "achieve,", "b": [0.3893, 0.8727, 0.4727, 0.8924]}, {"w": "and", "b": [0.479, 0.8727, 0.5154, 0.8924]}, {"w": "you", "b": [0.5217, 0.8727, 0.5596, 0.8924]}, {"w": "minimize", "b": [0.5659, 0.8727, 0.6612, 0.8924]}, {"w": "this", "b": [0.6675, 0.8727, 0.7039, 0.8924]}, {"w": "loss.", "b": [0.7102, 0.8727, 0.7558, 0.8924]}, {"w": "You", "b": [0.7621, 0.8727, 0.8029, 0.8924]}, {"w": "know", "b": [0.8093, 0.8727, 0.8653, 0.8924]}, {"w": "what", "b": [0.1294, 0.8932, 0.1785, 0.9129]}, {"w": "you", "b": [0.1848, 0.8932, 0.2226, 0.9129]}, {"w": "want", "b": [0.2289, 0.8932, 0.2779, 0.9129]}, {"w": "to", "b": [0.2842, 0.8932, 0.3039, 0.9129]}, {"w": "achieve:", "b": [0.3102, 0.8932, 0.3942, 0.9129]}, {"w": "conserving", "b": [0.4005, 0.8932, 0.5112, 0.9129]}, {"w": "the", "b": [0.5175, 0.8932, 0.5483, 0.9129]}, {"w": "content", "b": [0.5546, 0.8932, 0.6289, 0.9129]}, {"w": "of", "b": [0.6352, 0.8932, 0.6562, 0.9129]}, {"w": "the", "b": [0.6625, 0.8932, 0.6933, 0.9129]}, {"w": "original", "b": [0.6996, 0.8932, 0.7781, 0.9129]}, {"w": "image", "b": [0.7844, 0.8932, 0.8461, 0.9129]}]}]}, {"page": 376, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "while adopting the style of the reference image. If we were able to mathematically define content and style, then an appropriate loss function to minimize would be the following:", "words": [{"w": "while", "b": [0.1294, 0.0857, 0.1855, 0.1054]}, {"w": "adopting", "b": [0.1918, 0.0857, 0.2801, 0.1054]}, {"w": "the", "b": [0.2864, 0.0857, 0.3172, 0.1054]}, {"w": "style", "b": [0.3235, 0.0857, 0.3712, 0.1054]}, {"w": "of", "b": [0.3775, 0.0857, 0.3985, 0.1054]}, {"w": "the", "b": [0.4048, 0.0857, 0.4356, 0.1054]}, {"w": "reference", "b": [0.4419, 0.0857, 0.5357, 0.1054]}, {"w": "image.", "b": [0.542, 0.0857, 0.61, 0.1054]}, {"w": "If", "b": [0.6163, 0.0857, 0.6331, 0.1054]}, {"w": "we", "b": [0.6394, 0.0857, 0.6688, 0.1054]}, {"w": "were", "b": [0.6751, 0.0857, 0.7241, 0.1054]}, {"w": "able", "b": [0.7304, 0.0857, 0.7725, 0.1054]}, {"w": "to", "b": [0.7788, 0.0857, 0.7984, 0.1054]}, {"w": "mathematically", "b": [0.1294, 0.1062, 0.285, 0.1259]}, {"w": "define", "b": [0.2913, 0.1062, 0.3543, 0.1259]}, {"w": "content", "b": [0.3605, 0.1062, 0.4348, 0.1259]}, {"w": "and", "b": [0.4411, 0.1062, 0.4775, 0.1259]}, {"w": "style,", "b": [0.4838, 0.1062, 0.5363, 0.1259]}, {"w": "then", "b": [0.5426, 0.1062, 0.5861, 0.1259]}, {"w": "an", "b": [0.5924, 0.1062, 0.6162, 0.1259]}, {"w": "appropriate", "b": [0.6225, 0.1062, 0.7374, 0.1259]}, {"w": "loss", "b": [0.7437, 0.1062, 0.7829, 0.1259]}, {"w": "function", "b": [0.1294, 0.1267, 0.2135, 0.1464]}, {"w": "to", "b": [0.2198, 0.1267, 0.2394, 0.1464]}, {"w": "minimize", "b": [0.2457, 0.1267, 0.341, 0.1464]}, {"w": "would", "b": [0.3473, 0.1267, 0.4104, 0.1464]}, {"w": "be", "b": [0.4167, 0.1267, 0.4405, 0.1464]}, {"w": "the", "b": [0.4468, 0.1267, 0.4777, 0.1464]}, {"w": "following:", "b": [0.484, 0.1267, 0.5891, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "loss = distance(style(reference_image) - style(generated_image)) + distance(content(original_image) - content(generated_image))", "words": [{"w": "loss", "b": [0.1357, 0.1644, 0.1811, 0.1796]}, {"w": "=", "b": [0.1925, 0.1644, 0.2038, 0.1796]}, {"w": "distance(style(reference_image)", "b": [0.2152, 0.1644, 0.5671, 0.1796]}, {"w": "-", "b": [0.5784, 0.1644, 0.5898, 0.1796]}, {"w": "style(generated_image))", "b": [0.6011, 0.1644, 0.8622, 0.1796]}, {"w": "+", "b": [0.1357, 0.1796, 0.1471, 0.1947]}, {"w": "distance(content(original_image)", "b": [0.2152, 0.1947, 0.5784, 0.2099]}, {"w": "-", "b": [0.5898, 0.1947, 0.6011, 0.2099]}, {"w": "content(generated_image))", "b": [0.1357, 0.2099, 0.4195, 0.225]}]}, {"id": "b_2", "type": "paragraph", "text": "Here, distance is a norm function such as the L2 norm, content is a function that takes an image and computes a representation of its content, and style is a function that takes an image and computes a representation of its style. Minimizing this loss causes style(generated_image) to be close to style(reference_image), and content(- generated_image) is close to content(generated_image), thus achieving style transfer as we defined it.", "words": [{"w": "Here,", "b": [0.1294, 0.2479, 0.1847, 0.2676]}, {"w": "distance", "b": [0.191, 0.2489, 0.3121, 0.2691]}, {"w": "is", "b": [0.3184, 0.2479, 0.3353, 0.2676]}, {"w": "a", "b": [0.3416, 0.2479, 0.3528, 0.2676]}, {"w": "norm", "b": [0.3591, 0.2479, 0.4123, 0.2676]}, {"w": "function", "b": [0.4186, 0.2479, 0.5027, 0.2676]}, {"w": "such", "b": [0.509, 0.2479, 0.5552, 0.2676]}, {"w": "as", "b": [0.5616, 0.2479, 0.5826, 0.2676]}, {"w": "the", "b": [0.5889, 0.2479, 0.6197, 0.2676]}, {"w": "L2", "b": [0.626, 0.2479, 0.654, 0.2676]}, {"w": "norm,", "b": [0.6603, 0.2479, 0.7199, 0.2676]}, {"w": "content", "b": [0.7262, 0.2489, 0.8321, 0.2691]}, {"w": "is", "b": [0.8384, 0.2479, 0.8552, 0.2676]}, {"w": "a", "b": [0.1294, 0.2693, 0.1406, 0.289]}, {"w": "function", "b": [0.1469, 0.2693, 0.231, 0.289]}, {"w": "that", "b": [0.2373, 0.2693, 0.2751, 0.289]}, {"w": "takes", "b": [0.2814, 0.2693, 0.3333, 0.289]}, {"w": "an", "b": [0.3396, 0.2693, 0.3634, 0.289]}, {"w": "image", "b": [0.3697, 0.2693, 0.4314, 0.289]}, {"w": "and", "b": [0.4377, 0.2693, 0.4741, 0.289]}, {"w": "computes", "b": [0.4804, 0.2693, 0.5771, 0.289]}, {"w": "a", "b": [0.5834, 0.2693, 0.5946, 0.289]}, {"w": "representation", "b": [0.6009, 0.2693, 0.7438, 0.289]}, {"w": "of", "b": [0.7501, 0.2693, 0.7711, 0.289]}, {"w": "its", "b": [0.7774, 0.2693, 0.8013, 0.289]}, {"w": "content,", "b": [0.1294, 0.2898, 0.21, 0.3095]}, {"w": "and", "b": [0.2163, 0.2898, 0.2527, 0.3095]}, {"w": "style", "b": [0.259, 0.2908, 0.3347, 0.311]}, {"w": "is", "b": [0.341, 0.2898, 0.3578, 0.3095]}, {"w": "a", "b": [0.3641, 0.2898, 0.3753, 0.3095]}, {"w": "function", "b": [0.3816, 0.2898, 0.4657, 0.3095]}, {"w": "that", "b": [0.472, 0.2898, 0.5098, 0.3095]}, {"w": "takes", "b": [0.5161, 0.2898, 0.568, 0.3095]}, {"w": "an", "b": [0.5743, 0.2898, 0.5981, 0.3095]}, {"w": "image", "b": [0.6044, 0.2898, 0.6661, 0.3095]}, {"w": "and", "b": [0.6724, 0.2898, 0.7088, 0.3095]}, {"w": "computes", "b": [0.7151, 0.2898, 0.8118, 0.3095]}, {"w": "a", "b": [0.8181, 0.2898, 0.8293, 0.3095]}, {"w": "representation", "b": [0.1294, 0.3112, 0.2723, 0.3309]}, {"w": "of", "b": [0.2786, 0.3112, 0.2996, 0.3309]}, {"w": "its", "b": [0.3059, 0.3112, 0.3298, 0.3309]}, {"w": "style.", "b": [0.3361, 0.3112, 0.39, 0.3309]}, {"w": "Minimizing", "b": [0.3964, 0.3112, 0.5155, 0.3309]}, {"w": "this", "b": [0.5218, 0.3112, 0.5582, 0.3309]}, {"w": "loss", "b": [0.5646, 0.3112, 0.6038, 0.3309]}, {"w": "causes", "b": [0.6101, 0.3112, 0.676, 0.3309]}, {"w": "style(generated_image)", "b": [0.1294, 0.3327, 0.4624, 0.3529]}, {"w": "to", "b": [0.4687, 0.3317, 0.4884, 0.3514]}, {"w": "be", "b": [0.4947, 0.3317, 0.5185, 0.3514]}, {"w": "close", "b": [0.5248, 0.3317, 0.5766, 0.3514]}, {"w": "to", "b": [0.5829, 0.3317, 0.6026, 0.3514]}, {"w": "style(reference_image),", "b": [0.1294, 0.3531, 0.4687, 0.3743]}, {"w": "and", "b": [0.475, 0.3531, 0.5115, 0.3728]}, {"w": "content(-", "b": [0.5178, 0.3541, 0.654, 0.3743]}, {"w": "generated_image)", "b": [0.1294, 0.3755, 0.3716, 0.3957]}, {"w": "is", "b": [0.3779, 0.3745, 0.3948, 0.3942]}, {"w": "close", "b": [0.4011, 0.3745, 0.4529, 0.3942]}, {"w": "to", "b": [0.4592, 0.3745, 0.4788, 0.3942]}, {"w": "content(generated_image),", "b": [0.4851, 0.3745, 0.8547, 0.3957]}, {"w": "thus", "b": [0.1294, 0.3959, 0.1715, 0.4156]}, {"w": "achieving", "b": [0.1778, 0.3959, 0.2758, 0.4156]}, {"w": "style", "b": [0.2822, 0.3959, 0.3298, 0.4156]}, {"w": "transfer", "b": [0.3361, 0.3959, 0.4132, 0.4156]}, {"w": "as", "b": [0.4195, 0.3959, 0.4405, 0.4156]}, {"w": "we", "b": [0.4468, 0.3959, 0.4762, 0.4156]}, {"w": "defined", "b": [0.4825, 0.3959, 0.5581, 0.4156]}, {"w": "it.", "b": [0.5645, 0.3959, 0.5848, 0.4156]}]}, {"id": "b_3", "type": "paragraph", "text": "A fundamental observation made by Gatys et al. was that deep convolutional neural networks offer a way to mathematically define the style and content functions. Let’s see how.", "words": [{"w": "A", "b": [0.1294, 0.4386, 0.1476, 0.4584]}, {"w": "fundamental", "b": [0.1539, 0.4386, 0.28, 0.4584]}, {"w": "observation", "b": [0.2863, 0.4386, 0.404, 0.4584]}, {"w": "made", "b": [0.4104, 0.4386, 0.465, 0.4584]}, {"w": "by", "b": [0.4713, 0.4386, 0.4965, 0.4584]}, {"w": "Gatys", "b": [0.5028, 0.4386, 0.5617, 0.4584]}, {"w": "et", "b": [0.568, 0.4386, 0.5862, 0.4584]}, {"w": "al.", "b": [0.5925, 0.4386, 0.617, 0.4584]}, {"w": "was", "b": [0.6233, 0.4386, 0.6626, 0.4584]}, {"w": "that", "b": [0.6689, 0.4386, 0.7067, 0.4584]}, {"w": "deep", "b": [0.713, 0.4386, 0.7606, 0.4584]}, {"w": "convolutional", "b": [0.1294, 0.4591, 0.2682, 0.4789]}, {"w": "neural", "b": [0.2745, 0.4591, 0.3375, 0.4789]}, {"w": "networks", "b": [0.3438, 0.4591, 0.4363, 0.4789]}, {"w": "offer", "b": [0.4426, 0.4591, 0.4911, 0.4789]}, {"w": "a", "b": [0.4974, 0.4591, 0.5086, 0.4789]}, {"w": "way", "b": [0.5149, 0.4591, 0.557, 0.4789]}, {"w": "to", "b": [0.5633, 0.4591, 0.5829, 0.4789]}, {"w": "mathematically", "b": [0.5892, 0.4591, 0.7447, 0.4789]}, {"w": "define", "b": [0.751, 0.4591, 0.8141, 0.4789]}, {"w": "the", "b": [0.8203, 0.4591, 0.8511, 0.4789]}, {"w": "style", "b": [0.1294, 0.4807, 0.2051, 0.5009]}, {"w": "and", "b": [0.2114, 0.4796, 0.2478, 0.4994]}, {"w": "content", "b": [0.2541, 0.4807, 0.3601, 0.5009]}, {"w": "functions.", "b": [0.3664, 0.4796, 0.4666, 0.4994]}, {"w": "Let’s", "b": [0.4729, 0.4796, 0.5233, 0.4994]}, {"w": "see", "b": [0.5296, 0.4796, 0.5618, 0.4994]}, {"w": "how.", "b": [0.5681, 0.4796, 0.6162, 0.4994]}]}, {"id": "b_4", "type": "paragraph", "text": "8.3.1. The content loss", "words": [{"w": "8.3.1.", "b": [0.1294, 0.5278, 0.1862, 0.5475]}, {"w": "The", "b": [0.1925, 0.5278, 0.2345, 0.5475]}, {"w": "content", "b": [0.2408, 0.5278, 0.3207, 0.5475]}, {"w": "loss", "b": [0.327, 0.5278, 0.3663, 0.5475]}]}, {"id": "b_5", "type": "paragraph", "text": "As you already know, activations from earlier layers in a network contain local information about the image, whereas activations from higher layers contain increasingly global, abstract information. Formulated in a different way, the activations of the different layers of a convnet provide a decomposition of the contents of an image over different spatial scales. Therefore, you’d expect the content of an image, which is more global and abstract, to be captured by the representations of the upper layers in a convnet.", "words": [{"w": "As", "b": [0.1294, 0.5706, 0.1574, 0.5903]}, {"w": "you", "b": [0.1637, 0.5706, 0.2016, 0.5903]}, {"w": "already", "b": [0.2079, 0.5706, 0.2821, 0.5903]}, {"w": "know,", "b": [0.2884, 0.5706, 0.3492, 0.5903]}, {"w": "activations", "b": [0.3555, 0.5706, 0.4648, 0.5903]}, {"w": "from", "b": [0.4711, 0.5706, 0.5201, 0.5903]}, {"w": "earlier", "b": [0.5264, 0.5706, 0.5908, 0.5903]}, {"w": "layers", "b": [0.5971, 0.5706, 0.6574, 0.5903]}, {"w": "in", "b": [0.6637, 0.5706, 0.6833, 0.5903]}, {"w": "a", "b": [0.6896, 0.5706, 0.7008, 0.5903]}, {"w": "network", "b": [0.7071, 0.5706, 0.7898, 0.5903]}, {"w": "contain", "b": [0.7961, 0.5706, 0.8704, 0.5903]}, {"w": "local", "b": [0.1294, 0.5911, 0.1799, 0.6108]}, {"w": "information", "b": [0.1862, 0.5911, 0.3053, 0.6108]}, {"w": "about", "b": [0.3116, 0.5911, 0.3676, 0.6108]}, {"w": "the", "b": [0.3739, 0.5911, 0.4048, 0.6108]}, {"w": "image,", "b": [0.4111, 0.5911, 0.479, 0.6108]}, {"w": "whereas", "b": [0.4853, 0.5911, 0.568, 0.6108]}, {"w": "activations", "b": [0.5743, 0.5911, 0.6836, 0.6108]}, {"w": "from", "b": [0.6899, 0.5911, 0.7389, 0.6108]}, {"w": "higher", "b": [0.7452, 0.5911, 0.8097, 0.6108]}, {"w": "layers", "b": [0.1294, 0.6116, 0.1897, 0.6313]}, {"w": "contain", "b": [0.196, 0.6116, 0.2702, 0.6313]}, {"w": "increasingly", "b": [0.2765, 0.6116, 0.3998, 0.6313]}, {"w": "global,", "b": [0.4061, 0.6116, 0.4769, 0.6313]}, {"w": "abstract", "b": [0.4832, 0.6116, 0.5659, 0.6313]}, {"w": "information.", "b": [0.5721, 0.6116, 0.6976, 0.6313]}, {"w": "Formulated", "b": [0.7039, 0.6116, 0.8202, 0.6313]}, {"w": "in", "b": [0.8265, 0.6116, 0.8461, 0.6313]}, {"w": "a", "b": [0.8524, 0.6116, 0.8636, 0.6313]}, {"w": "different", "b": [0.1294, 0.6321, 0.2158, 0.6518]}, {"w": "way,", "b": [0.2221, 0.6321, 0.2688, 0.6518]}, {"w": "the", "b": [0.2751, 0.6321, 0.3059, 0.6518]}, {"w": "activations", "b": [0.3122, 0.6321, 0.4215, 0.6518]}, {"w": "of", "b": [0.4278, 0.6321, 0.4489, 0.6518]}, {"w": "the", "b": [0.4552, 0.6321, 0.486, 0.6518]}, {"w": "different", "b": [0.4923, 0.6321, 0.5786, 0.6518]}, {"w": "layers", "b": [0.585, 0.6321, 0.6452, 0.6518]}, {"w": "of", "b": [0.6515, 0.6321, 0.6725, 0.6518]}, {"w": "a", "b": [0.6788, 0.6321, 0.69, 0.6518]}, {"w": "convnet", "b": [0.6963, 0.6321, 0.7762, 0.6518]}, {"w": "provide", "b": [0.7825, 0.6321, 0.8596, 0.6518]}, {"w": "a", "b": [0.1294, 0.6526, 0.1406, 0.6723]}, {"w": "decomposition", "b": [0.1469, 0.6526, 0.2955, 0.6723]}, {"w": "of", "b": [0.3018, 0.6526, 0.3228, 0.6723]}, {"w": "the", "b": [0.3291, 0.6526, 0.3599, 0.6723]}, {"w": "contents", "b": [0.3662, 0.6526, 0.4503, 0.6723]}, {"w": "of", "b": [0.4566, 0.6526, 0.4776, 0.6723]}, {"w": "an", "b": [0.4839, 0.6526, 0.5077, 0.6723]}, {"w": "image", "b": [0.514, 0.6526, 0.5757, 0.6723]}, {"w": "over", "b": [0.582, 0.6526, 0.6268, 0.6723]}, {"w": "different", "b": [0.6331, 0.6526, 0.7195, 0.6723]}, {"w": "spatial", "b": [0.7258, 0.6526, 0.7916, 0.6723]}, {"w": "scales.", "b": [0.7979, 0.6526, 0.8645, 0.6723]}, {"w": "Therefore,", "b": [0.1294, 0.6731, 0.2352, 0.6928]}, {"w": "you’d", "b": [0.2415, 0.6731, 0.3003, 0.6928]}, {"w": "expect", "b": [0.3066, 0.6731, 0.3725, 0.6928]}, {"w": "the", "b": [0.3788, 0.6731, 0.4096, 0.6928]}, {"w": "content", "b": [0.4159, 0.6731, 0.4902, 0.6928]}, {"w": "of", "b": [0.4965, 0.6731, 0.5175, 0.6928]}, {"w": "an", "b": [0.5238, 0.6731, 0.5476, 0.6928]}, {"w": "image,", "b": [0.5539, 0.6731, 0.6219, 0.6928]}, {"w": "which", "b": [0.6282, 0.6731, 0.6898, 0.6928]}, {"w": "is", "b": [0.6961, 0.6731, 0.713, 0.6928]}, {"w": "more", "b": [0.7193, 0.6731, 0.7711, 0.6928]}, {"w": "global", "b": [0.7773, 0.6731, 0.8404, 0.6928]}, {"w": "and", "b": [0.1294, 0.6936, 0.1658, 0.7133]}, {"w": "abstract,", "b": [0.1721, 0.6936, 0.2569, 0.7133]}, {"w": "to", "b": [0.2632, 0.6936, 0.2828, 0.7133]}, {"w": "be", "b": [0.2891, 0.6936, 0.313, 0.7133]}, {"w": "captured", "b": [0.3193, 0.6936, 0.4061, 0.7133]}, {"w": "by", "b": [0.4124, 0.6936, 0.4376, 0.7133]}, {"w": "the", "b": [0.444, 0.6936, 0.4748, 0.7133]}, {"w": "representations", "b": [0.4811, 0.6936, 0.6338, 0.7133]}, {"w": "of", "b": [0.6401, 0.6936, 0.6611, 0.7133]}, {"w": "the", "b": [0.6674, 0.6936, 0.6983, 0.7133]}, {"w": "upper", "b": [0.7046, 0.6936, 0.762, 0.7133]}, {"w": "layers", "b": [0.7683, 0.6936, 0.8285, 0.7133]}, {"w": "in", "b": [0.8349, 0.6936, 0.8545, 0.7133]}, {"w": "a", "b": [0.1294, 0.7141, 0.1406, 0.7338]}, {"w": "convnet.", "b": [0.1469, 0.7141, 0.2331, 0.7338]}]}, {"id": "b_6", "type": "paragraph", "text": "A good candidate for content loss is thus the L2 norm between the activations of an upper layer in a pretrained convnet, computed over the target image, and the activations of the same layer computed over the generated image. This guarantees that, as seen from the upper layer, the generated image will look similar to the original target image. Assuming that what the upper layers of a convnet see is really the content of their input images, then this works as a way to preserve image content.", "words": [{"w": "A", "b": [0.1294, 0.7568, 0.1476, 0.7766]}, {"w": "good", "b": [0.1539, 0.7568, 0.2044, 0.7766]}, {"w": "candidate", "b": [0.2107, 0.7568, 0.3074, 0.7766]}, {"w": "for", "b": [0.3137, 0.7568, 0.3431, 0.7766]}, {"w": "content", "b": [0.3494, 0.7568, 0.4236, 0.7766]}, {"w": "loss", "b": [0.43, 0.7568, 0.4692, 0.7766]}, {"w": "is", "b": [0.4755, 0.7568, 0.4923, 0.7766]}, {"w": "thus", "b": [0.4986, 0.7568, 0.5407, 0.7766]}, {"w": "the", "b": [0.547, 0.7568, 0.5778, 0.7766]}, {"w": "L2", "b": [0.5841, 0.7568, 0.6122, 0.7766]}, {"w": "norm", "b": [0.6185, 0.7568, 0.6717, 0.7766]}, {"w": "between", "b": [0.678, 0.7568, 0.7621, 0.7766]}, {"w": "the", "b": [0.7684, 0.7568, 0.7992, 0.7766]}, {"w": "activations", "b": [0.1294, 0.7773, 0.2387, 0.7971]}, {"w": "of", "b": [0.245, 0.7773, 0.266, 0.7971]}, {"w": "an", "b": [0.2723, 0.7773, 0.2962, 0.7971]}, {"w": "upper", "b": [0.3025, 0.7773, 0.3599, 0.7971]}, {"w": "layer", "b": [0.3662, 0.7773, 0.4166, 0.7971]}, {"w": "in", "b": [0.4229, 0.7773, 0.4426, 0.7971]}, {"w": "a", "b": [0.4489, 0.7773, 0.4601, 0.7971]}, {"w": "pretrained", "b": [0.4664, 0.7773, 0.5686, 0.7971]}, {"w": "convnet,", "b": [0.5749, 0.7773, 0.6611, 0.7971]}, {"w": "computed", "b": [0.6674, 0.7773, 0.7669, 0.7971]}, {"w": "over", "b": [0.7731, 0.7773, 0.8179, 0.7971]}, {"w": "the", "b": [0.8243, 0.7773, 0.8551, 0.7971]}, {"w": "target", "b": [0.1294, 0.7978, 0.1864, 0.8176]}, {"w": "image,", "b": [0.1927, 0.7978, 0.2607, 0.8176]}, {"w": "and", "b": [0.267, 0.7978, 0.3034, 0.8176]}, {"w": "the", "b": [0.3097, 0.7978, 0.3405, 0.8176]}, {"w": "activations", "b": [0.3468, 0.7978, 0.4561, 0.8176]}, {"w": "of", "b": [0.4624, 0.7978, 0.4834, 0.8176]}, {"w": "the", "b": [0.4898, 0.7978, 0.5206, 0.8176]}, {"w": "same", "b": [0.5269, 0.7978, 0.5787, 0.8176]}, {"w": "layer", "b": [0.585, 0.7978, 0.6355, 0.8176]}, {"w": "computed", "b": [0.6418, 0.7978, 0.7413, 0.8176]}, {"w": "over", "b": [0.7476, 0.7978, 0.7924, 0.8176]}, {"w": "the", "b": [0.7987, 0.7978, 0.8295, 0.8176]}, {"w": "generated", "b": [0.1294, 0.8183, 0.2275, 0.8381]}, {"w": "image.", "b": [0.2338, 0.8183, 0.3017, 0.8381]}, {"w": "This", "b": [0.308, 0.8183, 0.3529, 0.8381]}, {"w": "guarantees", "b": [0.3592, 0.8183, 0.4671, 0.8381]}, {"w": "that,", "b": [0.4734, 0.8183, 0.5175, 0.8381]}, {"w": "as", "b": [0.5238, 0.8183, 0.5448, 0.8381]}, {"w": "seen", "b": [0.5511, 0.8183, 0.596, 0.8381]}, {"w": "from", "b": [0.6022, 0.8183, 0.6512, 0.8381]}, {"w": "the", "b": [0.6575, 0.8183, 0.6884, 0.8381]}, {"w": "upper", "b": [0.6947, 0.8183, 0.7521, 0.8381]}, {"w": "layer,", "b": [0.7584, 0.8183, 0.8141, 0.8381]}, {"w": "the", "b": [0.8204, 0.8183, 0.8512, 0.8381]}, {"w": "generated", "b": [0.1294, 0.8388, 0.2275, 0.8586]}, {"w": "image", "b": [0.2338, 0.8388, 0.2954, 0.8586]}, {"w": "will", "b": [0.3017, 0.8388, 0.341, 0.8586]}, {"w": "look", "b": [0.3473, 0.8388, 0.3921, 0.8586]}, {"w": "similar", "b": [0.3984, 0.8388, 0.4685, 0.8586]}, {"w": "to", "b": [0.4748, 0.8388, 0.4945, 0.8586]}, {"w": "the", "b": [0.5008, 0.8388, 0.5316, 0.8586]}, {"w": "original", "b": [0.5379, 0.8388, 0.6164, 0.8586]}, {"w": "target", "b": [0.6227, 0.8388, 0.6796, 0.8586]}, {"w": "image.", "b": [0.6859, 0.8388, 0.7538, 0.8586]}, {"w": "Assuming", "b": [0.7601, 0.8388, 0.8624, 0.8586]}, {"w": "that", "b": [0.1294, 0.8593, 0.1673, 0.8791]}, {"w": "what", "b": [0.1736, 0.8593, 0.2226, 0.8791]}, {"w": "the", "b": [0.2289, 0.8593, 0.2597, 0.8791]}, {"w": "upper", "b": [0.266, 0.8593, 0.3235, 0.8791]}, {"w": "layers", "b": [0.3298, 0.8593, 0.39, 0.8791]}, {"w": "of", "b": [0.3963, 0.8593, 0.4173, 0.8791]}, {"w": "a", "b": [0.4236, 0.8593, 0.4348, 0.8791]}, {"w": "convnet", "b": [0.4411, 0.8593, 0.521, 0.8791]}, {"w": "see", "b": [0.5273, 0.8593, 0.5595, 0.8791]}, {"w": "is", "b": [0.5658, 0.8593, 0.5826, 0.8791]}, {"w": "really", "b": [0.5889, 0.8593, 0.6464, 0.8791]}, {"w": "the", "b": [0.6527, 0.8593, 0.6835, 0.8791]}, {"w": "content", "b": [0.6898, 0.8593, 0.7641, 0.8791]}, {"w": "of", "b": [0.7704, 0.8593, 0.7914, 0.8791]}, {"w": "their", "b": [0.7977, 0.8593, 0.8439, 0.8791]}, {"w": "input", "b": [0.1294, 0.8798, 0.1813, 0.8996]}, {"w": "images,", "b": [0.1876, 0.8798, 0.2654, 0.8996]}, {"w": "then", "b": [0.2717, 0.8798, 0.3151, 0.8996]}, {"w": "this", "b": [0.3214, 0.8798, 0.3579, 0.8996]}, {"w": "works", "b": [0.3642, 0.8798, 0.4258, 0.8996]}, {"w": "as", "b": [0.4321, 0.8798, 0.4531, 0.8996]}, {"w": "a", "b": [0.4594, 0.8798, 0.4706, 0.8996]}, {"w": "way", "b": [0.4769, 0.8798, 0.519, 0.8996]}, {"w": "to", "b": [0.5253, 0.8798, 0.5449, 0.8996]}, {"w": "preserve", "b": [0.5512, 0.8798, 0.6367, 0.8996]}, {"w": "image", "b": [0.643, 0.8798, 0.7046, 0.8996]}, {"w": "content.", "b": [0.7109, 0.8798, 0.7915, 0.8996]}]}]}, {"page": 377, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "8.3.2. The style loss", "words": [{"w": "8.3.2.", "b": [0.1294, 0.0857, 0.1862, 0.1054]}, {"w": "The", "b": [0.1925, 0.0857, 0.2345, 0.1054]}, {"w": "style", "b": [0.2408, 0.0857, 0.2899, 0.1054]}, {"w": "loss", "b": [0.2962, 0.0857, 0.3354, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "The content loss only uses a single upper layer, but the style loss as defined by Gatys et al. uses multiple layers of a convnet: you try to capture the appearance of the style--reference image at all spatial scales extracted by the convnet, not just a single scale. For the style loss, Gatys et al. use the Gram matrix of a layer’s activations: the inner product of the feature maps of a given layer. This inner product can be understood as representing a map of the correlations between the layer’s features. These feature correlations capture the statistics of the patterns of a particular spatial scale, which empirically correspond to the appearance of the textures found at this scale.", "words": [{"w": "The", "b": [0.1294, 0.1285, 0.1686, 0.1482]}, {"w": "content", "b": [0.1749, 0.1285, 0.2492, 0.1482]}, {"w": "loss", "b": [0.2555, 0.1285, 0.2948, 0.1482]}, {"w": "only", "b": [0.3011, 0.1285, 0.3459, 0.1482]}, {"w": "uses", "b": [0.3522, 0.1285, 0.3957, 0.1482]}, {"w": "a", "b": [0.402, 0.1285, 0.4132, 0.1482]}, {"w": "single", "b": [0.4195, 0.1285, 0.4797, 0.1482]}, {"w": "upper", "b": [0.4861, 0.1285, 0.5435, 0.1482]}, {"w": "layer,", "b": [0.5498, 0.1285, 0.6055, 0.1482]}, {"w": "but", "b": [0.6118, 0.1285, 0.644, 0.1482]}, {"w": "the", "b": [0.6503, 0.1285, 0.6812, 0.1482]}, {"w": "style", "b": [0.6875, 0.1285, 0.7351, 0.1482]}, {"w": "loss", "b": [0.7414, 0.1285, 0.7807, 0.1482]}, {"w": "as", "b": [0.787, 0.1285, 0.808, 0.1482]}, {"w": "defined", "b": [0.1294, 0.149, 0.2051, 0.1687]}, {"w": "by", "b": [0.2114, 0.149, 0.2366, 0.1687]}, {"w": "Gatys", "b": [0.2429, 0.149, 0.3018, 0.1687]}, {"w": "et", "b": [0.3081, 0.149, 0.3263, 0.1687]}, {"w": "al.", "b": [0.3326, 0.149, 0.3571, 0.1687]}, {"w": "uses", "b": [0.3634, 0.149, 0.4068, 0.1687]}, {"w": "multiple", "b": [0.4132, 0.149, 0.4973, 0.1687]}, {"w": "layers", "b": [0.5036, 0.149, 0.5638, 0.1687]}, {"w": "of", "b": [0.5701, 0.149, 0.5911, 0.1687]}, {"w": "a", "b": [0.5974, 0.149, 0.6086, 0.1687]}, {"w": "convnet:", "b": [0.6149, 0.149, 0.7018, 0.1687]}, {"w": "you", "b": [0.708, 0.149, 0.7459, 0.1687]}, {"w": "try", "b": [0.7522, 0.149, 0.7802, 0.1687]}, {"w": "to", "b": [0.7865, 0.149, 0.8061, 0.1687]}, {"w": "capture", "b": [0.1294, 0.1695, 0.2037, 0.1892]}, {"w": "the", "b": [0.21, 0.1695, 0.2408, 0.1892]}, {"w": "appearance", "b": [0.2471, 0.1695, 0.3605, 0.1892]}, {"w": "of", "b": [0.3668, 0.1695, 0.3878, 0.1892]}, {"w": "the", "b": [0.3942, 0.1695, 0.425, 0.1892]}, {"w": "style--reference", "b": [0.4313, 0.1695, 0.5896, 0.1892]}, {"w": "image", "b": [0.5959, 0.1695, 0.6575, 0.1892]}, {"w": "at", "b": [0.6638, 0.1695, 0.682, 0.1892]}, {"w": "all", "b": [0.6883, 0.1695, 0.7136, 0.1892]}, {"w": "spatial", "b": [0.7199, 0.1695, 0.7857, 0.1892]}, {"w": "scales", "b": [0.792, 0.1695, 0.8523, 0.1892]}, {"w": "extracted", "b": [0.1294, 0.19, 0.2219, 0.2097]}, {"w": "by", "b": [0.2282, 0.19, 0.2534, 0.2097]}, {"w": "the", "b": [0.2597, 0.19, 0.2905, 0.2097]}, {"w": "convnet,", "b": [0.2968, 0.19, 0.383, 0.2097]}, {"w": "not", "b": [0.3893, 0.19, 0.4216, 0.2097]}, {"w": "just", "b": [0.4279, 0.19, 0.4643, 0.2097]}, {"w": "a", "b": [0.4706, 0.19, 0.4818, 0.2097]}, {"w": "single", "b": [0.4881, 0.19, 0.5483, 0.2097]}, {"w": "scale.", "b": [0.5546, 0.19, 0.6114, 0.2097]}, {"w": "For", "b": [0.6177, 0.19, 0.6527, 0.2097]}, {"w": "the", "b": [0.659, 0.19, 0.6898, 0.2097]}, {"w": "style", "b": [0.6961, 0.19, 0.7438, 0.2097]}, {"w": "loss,", "b": [0.7501, 0.19, 0.7957, 0.2097]}, {"w": "Gatys", "b": [0.802, 0.19, 0.8608, 0.2097]}, {"w": "et", "b": [0.1294, 0.2105, 0.1476, 0.2302]}, {"w": "al.", "b": [0.1539, 0.2105, 0.1785, 0.2302]}, {"w": "use", "b": [0.1848, 0.2105, 0.2184, 0.2302]}, {"w": "the", "b": [0.2247, 0.2105, 0.2555, 0.2302]}, {"w": "Gram", "b": [0.2618, 0.2105, 0.3206, 0.2302]}, {"w": "matrix", "b": [0.3269, 0.2105, 0.3928, 0.2302]}, {"w": "of", "b": [0.3991, 0.2105, 0.4201, 0.2302]}, {"w": "a", "b": [0.4264, 0.2105, 0.4376, 0.2302]}, {"w": "layer’s", "b": [0.4439, 0.2105, 0.5121, 0.2302]}, {"w": "activations:", "b": [0.5184, 0.2105, 0.6347, 0.2302]}, {"w": "the", "b": [0.641, 0.2105, 0.6719, 0.2302]}, {"w": "inner", "b": [0.6782, 0.2105, 0.73, 0.2302]}, {"w": "product", "b": [0.7363, 0.2105, 0.8134, 0.2302]}, {"w": "of", "b": [0.8197, 0.2105, 0.8407, 0.2302]}, {"w": "the", "b": [0.1294, 0.231, 0.1602, 0.2507]}, {"w": "feature", "b": [0.1665, 0.231, 0.2366, 0.2507]}, {"w": "maps", "b": [0.2429, 0.231, 0.2961, 0.2507]}, {"w": "of", "b": [0.3024, 0.231, 0.3234, 0.2507]}, {"w": "a", "b": [0.3298, 0.231, 0.341, 0.2507]}, {"w": "given", "b": [0.3473, 0.231, 0.4033, 0.2507]}, {"w": "layer.", "b": [0.4096, 0.231, 0.4649, 0.2507]}, {"w": "This", "b": [0.4712, 0.231, 0.5161, 0.2507]}, {"w": "inner", "b": [0.5224, 0.231, 0.5742, 0.2507]}, {"w": "product", "b": [0.5805, 0.231, 0.6576, 0.2507]}, {"w": "can", "b": [0.6639, 0.231, 0.6989, 0.2507]}, {"w": "be", "b": [0.7052, 0.231, 0.729, 0.2507]}, {"w": "understood", "b": [0.7353, 0.231, 0.8474, 0.2507]}, {"w": "as", "b": [0.1294, 0.2515, 0.1504, 0.2712]}, {"w": "representing", "b": [0.1567, 0.2515, 0.2814, 0.2712]}, {"w": "a", "b": [0.2877, 0.2515, 0.2989, 0.2712]}, {"w": "map", "b": [0.3052, 0.2515, 0.3487, 0.2712]}, {"w": "of", "b": [0.355, 0.2515, 0.376, 0.2712]}, {"w": "the", "b": [0.3823, 0.2515, 0.4131, 0.2712]}, {"w": "correlations", "b": [0.4194, 0.2515, 0.5385, 0.2712]}, {"w": "between", "b": [0.5448, 0.2515, 0.6289, 0.2712]}, {"w": "the", "b": [0.6352, 0.2515, 0.666, 0.2712]}, {"w": "layer’s", "b": [0.6723, 0.2515, 0.7404, 0.2712]}, {"w": "features.", "b": [0.7467, 0.2515, 0.8329, 0.2712]}, {"w": "These", "b": [0.1294, 0.272, 0.1897, 0.2917]}, {"w": "feature", "b": [0.196, 0.272, 0.266, 0.2917]}, {"w": "correlations", "b": [0.2723, 0.272, 0.3914, 0.2917]}, {"w": "capture", "b": [0.3977, 0.272, 0.4719, 0.2917]}, {"w": "the", "b": [0.4782, 0.272, 0.5091, 0.2917]}, {"w": "statistics", "b": [0.5154, 0.272, 0.6023, 0.2917]}, {"w": "of", "b": [0.6086, 0.272, 0.6296, 0.2917]}, {"w": "the", "b": [0.6358, 0.272, 0.6666, 0.2917]}, {"w": "patterns", "b": [0.6729, 0.272, 0.7528, 0.2917]}, {"w": "of", "b": [0.7591, 0.272, 0.7801, 0.2917]}, {"w": "a", "b": [0.7864, 0.272, 0.7976, 0.2917]}, {"w": "particular", "b": [0.1294, 0.2925, 0.2261, 0.3122]}, {"w": "spatial", "b": [0.2324, 0.2925, 0.2982, 0.3122]}, {"w": "scale,", "b": [0.3046, 0.2925, 0.3613, 0.3122]}, {"w": "which", "b": [0.3676, 0.2925, 0.4292, 0.3122]}, {"w": "empirically", "b": [0.4356, 0.2925, 0.5505, 0.3122]}, {"w": "correspond", "b": [0.5568, 0.2925, 0.6688, 0.3122]}, {"w": "to", "b": [0.6751, 0.2925, 0.6948, 0.3122]}, {"w": "the", "b": [0.7011, 0.2925, 0.7319, 0.3122]}, {"w": "appearance", "b": [0.7382, 0.2925, 0.8517, 0.3122]}, {"w": "of", "b": [0.1294, 0.313, 0.1504, 0.3327]}, {"w": "the", "b": [0.1567, 0.313, 0.1876, 0.3327]}, {"w": "textures", "b": [0.1939, 0.313, 0.2737, 0.3327]}, {"w": "found", "b": [0.28, 0.313, 0.3389, 0.3327]}, {"w": "at", "b": [0.3452, 0.313, 0.3634, 0.3327]}, {"w": "this", "b": [0.3697, 0.313, 0.4062, 0.3327]}, {"w": "scale.", "b": [0.4125, 0.313, 0.4692, 0.3327]}]}, {"id": "b_2", "type": "paragraph", "text": "Hence, the style loss aims to preserve similar internal correlations within the activations of different layers, across the style-reference image and the generated image. In turn, this guarantees that the textures found at different spatial scales look similar across the style-reference image and the generated image.", "words": [{"w": "Hence,", "b": [0.1294, 0.3557, 0.2001, 0.3755]}, {"w": "the", "b": [0.2065, 0.3557, 0.2373, 0.3755]}, {"w": "style", "b": [0.2436, 0.3557, 0.2912, 0.3755]}, {"w": "loss", "b": [0.2975, 0.3557, 0.3368, 0.3755]}, {"w": "aims", "b": [0.3431, 0.3557, 0.3908, 0.3755]}, {"w": "to", "b": [0.3971, 0.3557, 0.4167, 0.3755]}, {"w": "preserve", "b": [0.423, 0.3557, 0.5084, 0.3755]}, {"w": "similar", "b": [0.5147, 0.3557, 0.5848, 0.3755]}, {"w": "internal", "b": [0.5911, 0.3557, 0.6682, 0.3755]}, {"w": "correlations", "b": [0.6745, 0.3557, 0.7936, 0.3755]}, {"w": "within", "b": [0.7999, 0.3557, 0.8644, 0.3755]}, {"w": "the", "b": [0.1294, 0.3762, 0.1602, 0.396]}, {"w": "activations", "b": [0.1665, 0.3762, 0.2758, 0.396]}, {"w": "of", "b": [0.2822, 0.3762, 0.3032, 0.396]}, {"w": "different", "b": [0.3095, 0.3762, 0.3958, 0.396]}, {"w": "layers,", "b": [0.4021, 0.3762, 0.4687, 0.396]}, {"w": "across", "b": [0.475, 0.3762, 0.538, 0.396]}, {"w": "the", "b": [0.5443, 0.3762, 0.5752, 0.396]}, {"w": "style-reference", "b": [0.5814, 0.3762, 0.7313, 0.396]}, {"w": "image", "b": [0.7376, 0.3762, 0.7993, 0.396]}, {"w": "and", "b": [0.8056, 0.3762, 0.842, 0.396]}, {"w": "the", "b": [0.1294, 0.3967, 0.1602, 0.4165]}, {"w": "generated", "b": [0.1665, 0.3967, 0.2646, 0.4165]}, {"w": "image.", "b": [0.2709, 0.3967, 0.3389, 0.4165]}, {"w": "In", "b": [0.3452, 0.3967, 0.3662, 0.4165]}, {"w": "turn,", "b": [0.3725, 0.3967, 0.4194, 0.4165]}, {"w": "this", "b": [0.4257, 0.3967, 0.4622, 0.4165]}, {"w": "guarantees", "b": [0.4685, 0.3967, 0.5764, 0.4165]}, {"w": "that", "b": [0.5827, 0.3967, 0.6205, 0.4165]}, {"w": "the", "b": [0.6268, 0.3967, 0.6576, 0.4165]}, {"w": "textures", "b": [0.6639, 0.3967, 0.7438, 0.4165]}, {"w": "found", "b": [0.7501, 0.3967, 0.809, 0.4165]}, {"w": "at", "b": [0.8153, 0.3967, 0.8335, 0.4165]}, {"w": "different", "b": [0.1294, 0.4172, 0.2158, 0.437]}, {"w": "spatial", "b": [0.2221, 0.4172, 0.288, 0.437]}, {"w": "scales", "b": [0.2943, 0.4172, 0.3545, 0.437]}, {"w": "look", "b": [0.3608, 0.4172, 0.4056, 0.437]}, {"w": "similar", "b": [0.4119, 0.4172, 0.482, 0.437]}, {"w": "across", "b": [0.4883, 0.4172, 0.5514, 0.437]}, {"w": "the", "b": [0.5577, 0.4172, 0.5885, 0.437]}, {"w": "style-reference", "b": [0.5948, 0.4172, 0.7447, 0.437]}, {"w": "image", "b": [0.751, 0.4172, 0.8126, 0.437]}, {"w": "and", "b": [0.8189, 0.4172, 0.8554, 0.437]}, {"w": "the", "b": [0.1294, 0.4377, 0.1602, 0.4575]}, {"w": "generated", "b": [0.1665, 0.4377, 0.2646, 0.4575]}, {"w": "image.", "b": [0.2709, 0.4377, 0.3389, 0.4575]}]}, {"id": "b_3", "type": "paragraph", "text": "In short, you can use a pretrained convnet to define a loss that will do the following:", "words": [{"w": "In", "b": [0.1294, 0.4805, 0.1504, 0.5003]}, {"w": "short,", "b": [0.1567, 0.4805, 0.2135, 0.5003]}, {"w": "you", "b": [0.2198, 0.4805, 0.2576, 0.5003]}, {"w": "can", "b": [0.2639, 0.4805, 0.299, 0.5003]}, {"w": "use", "b": [0.3053, 0.4805, 0.3389, 0.5003]}, {"w": "a", "b": [0.3452, 0.4805, 0.3564, 0.5003]}, {"w": "pretrained", "b": [0.3627, 0.4805, 0.465, 0.5003]}, {"w": "convnet", "b": [0.4713, 0.4805, 0.5511, 0.5003]}, {"w": "to", "b": [0.5574, 0.4805, 0.5771, 0.5003]}, {"w": "define", "b": [0.5834, 0.4805, 0.6464, 0.5003]}, {"w": "a", "b": [0.6527, 0.4805, 0.6639, 0.5003]}, {"w": "loss", "b": [0.6702, 0.4805, 0.7095, 0.5003]}, {"w": "that", "b": [0.7158, 0.4805, 0.7536, 0.5003]}, {"w": "will", "b": [0.7599, 0.4805, 0.7992, 0.5003]}, {"w": "do", "b": [0.8055, 0.4805, 0.8307, 0.5003]}, {"w": "the", "b": [0.837, 0.4805, 0.8678, 0.5003]}, {"w": "following:", "b": [0.1294, 0.501, 0.2345, 0.5208]}]}, {"id": "b_4", "type": "paragraph", "text": "Preserve content by maintaining similar high-level layer activations between the target content image and the generated image. The convnet should “see” both the target image and the generated image as containing the same things. Preserve style by maintaining similar correlations within activations for both low-level layers and high-level layers. Feature correlations capture textures: the generated image and the style-reference image should share the same textures at different spatial scales.", "words": [{"w": "Preserve", "b": [0.1799, 0.5394, 0.2667, 0.5591]}, {"w": "content", "b": [0.273, 0.5394, 0.3473, 0.5591]}, {"w": "by", "b": [0.3536, 0.5394, 0.3788, 0.5591]}, {"w": "maintaining", "b": [0.3851, 0.5394, 0.5057, 0.5591]}, {"w": "similar", "b": [0.512, 0.5394, 0.582, 0.5591]}, {"w": "high-level", "b": [0.5883, 0.5394, 0.6906, 0.5591]}, {"w": "layer", "b": [0.6969, 0.5394, 0.7474, 0.5591]}, {"w": "activations", "b": [0.7537, 0.5394, 0.863, 0.5591]}, {"w": "between", "b": [0.1799, 0.5599, 0.2639, 0.5796]}, {"w": "the", "b": [0.2702, 0.5599, 0.301, 0.5796]}, {"w": "target", "b": [0.3074, 0.5599, 0.3643, 0.5796]}, {"w": "content", "b": [0.3706, 0.5599, 0.4449, 0.5796]}, {"w": "image", "b": [0.4512, 0.5599, 0.5128, 0.5796]}, {"w": "and", "b": [0.5191, 0.5599, 0.5556, 0.5796]}, {"w": "the", "b": [0.5619, 0.5599, 0.5927, 0.5796]}, {"w": "generated", "b": [0.599, 0.5599, 0.6971, 0.5796]}, {"w": "image.", "b": [0.7034, 0.5599, 0.7713, 0.5796]}, {"w": "The", "b": [0.7775, 0.5599, 0.8168, 0.5796]}, {"w": "convnet", "b": [0.1799, 0.5804, 0.2597, 0.6001]}, {"w": "should", "b": [0.266, 0.5804, 0.3333, 0.6001]}, {"w": "“see”", "b": [0.3396, 0.5804, 0.3942, 0.6001]}, {"w": "both", "b": [0.4005, 0.5804, 0.4454, 0.6001]}, {"w": "the", "b": [0.4517, 0.5804, 0.4825, 0.6001]}, {"w": "target", "b": [0.4888, 0.5804, 0.5458, 0.6001]}, {"w": "image", "b": [0.5521, 0.5804, 0.6137, 0.6001]}, {"w": "and", "b": [0.62, 0.5804, 0.6565, 0.6001]}, {"w": "the", "b": [0.6628, 0.5804, 0.6936, 0.6001]}, {"w": "generated", "b": [0.6999, 0.5804, 0.798, 0.6001]}, {"w": "image", "b": [0.8043, 0.5804, 0.8659, 0.6001]}, {"w": "as", "b": [0.1799, 0.6009, 0.2009, 0.6206]}, {"w": "containing", "b": [0.2072, 0.6009, 0.3137, 0.6206]}, {"w": "the", "b": [0.32, 0.6009, 0.3508, 0.6206]}, {"w": "same", "b": [0.3571, 0.6009, 0.409, 0.6206]}, {"w": "things.", "b": [0.4153, 0.6009, 0.4833, 0.6206]}, {"w": "Preserve", "b": [0.1799, 0.6214, 0.2667, 0.6411]}, {"w": "style", "b": [0.273, 0.6214, 0.3207, 0.6411]}, {"w": "by", "b": [0.327, 0.6214, 0.3522, 0.6411]}, {"w": "maintaining", "b": [0.3585, 0.6214, 0.479, 0.6411]}, {"w": "similar", "b": [0.4853, 0.6214, 0.5554, 0.6411]}, {"w": "correlations", "b": [0.5617, 0.6214, 0.6841, 0.6411]}, {"w": "within", "b": [0.6904, 0.6214, 0.7548, 0.6411]}, {"w": "activations", "b": [0.7611, 0.6214, 0.8704, 0.6411]}, {"w": "for", "b": [0.1799, 0.6419, 0.2093, 0.6616]}, {"w": "both", "b": [0.2156, 0.6419, 0.2604, 0.6616]}, {"w": "low-level", "b": [0.2667, 0.6419, 0.362, 0.6616]}, {"w": "layers", "b": [0.3683, 0.6419, 0.4286, 0.6616]}, {"w": "and", "b": [0.4349, 0.6419, 0.4713, 0.6616]}, {"w": "high-level", "b": [0.4776, 0.6419, 0.5799, 0.6616]}, {"w": "layers.", "b": [0.5862, 0.6419, 0.6527, 0.6616]}, {"w": "Feature", "b": [0.6591, 0.6419, 0.7347, 0.6616]}, {"w": "correlations", "b": [0.741, 0.6419, 0.8601, 0.6616]}, {"w": "capture", "b": [0.1799, 0.6624, 0.2541, 0.6821]}, {"w": "textures:", "b": [0.2604, 0.6624, 0.3463, 0.6821]}, {"w": "the", "b": [0.3526, 0.6624, 0.3834, 0.6821]}, {"w": "generated", "b": [0.3897, 0.6624, 0.4878, 0.6821]}, {"w": "image", "b": [0.4941, 0.6624, 0.5558, 0.6821]}, {"w": "and", "b": [0.5621, 0.6624, 0.5985, 0.6821]}, {"w": "the", "b": [0.6048, 0.6624, 0.6356, 0.6821]}, {"w": "style-reference", "b": [0.6419, 0.6624, 0.7918, 0.6821]}, {"w": "image", "b": [0.7981, 0.6624, 0.8598, 0.6821]}, {"w": "should", "b": [0.1799, 0.6829, 0.2471, 0.7026]}, {"w": "share", "b": [0.2534, 0.6829, 0.3067, 0.7026]}, {"w": "the", "b": [0.313, 0.6829, 0.3438, 0.7026]}, {"w": "same", "b": [0.3501, 0.6829, 0.402, 0.7026]}, {"w": "textures", "b": [0.4083, 0.6829, 0.4881, 0.7026]}, {"w": "at", "b": [0.4944, 0.6829, 0.5126, 0.7026]}, {"w": "different", "b": [0.5189, 0.6829, 0.6053, 0.7026]}, {"w": "spatial", "b": [0.6116, 0.6829, 0.6775, 0.7026]}, {"w": "scales.", "b": [0.6838, 0.6829, 0.7503, 0.7026]}]}, {"id": "b_5", "type": "paragraph", "text": "Now, let’s look at a Keras implementation of the original 2015 neural style transfer algorithm. As you’ll see, it shares many similarities with the DeepDream implementation developed in the previous section.", "words": [{"w": "Now,", "b": [0.1294, 0.7256, 0.1831, 0.7454]}, {"w": "let’s", "b": [0.1894, 0.7256, 0.2315, 0.7454]}, {"w": "look", "b": [0.2378, 0.7256, 0.2826, 0.7454]}, {"w": "at", "b": [0.2889, 0.7256, 0.3071, 0.7454]}, {"w": "a", "b": [0.3135, 0.7256, 0.3247, 0.7454]}, {"w": "Keras", "b": [0.331, 0.7256, 0.3898, 0.7454]}, {"w": "implementation", "b": [0.3961, 0.7256, 0.5545, 0.7454]}, {"w": "of", "b": [0.5608, 0.7256, 0.5818, 0.7454]}, {"w": "the", "b": [0.5881, 0.7256, 0.6189, 0.7454]}, {"w": "original", "b": [0.6252, 0.7256, 0.7037, 0.7454]}, {"w": "2015", "b": [0.71, 0.7256, 0.7605, 0.7454]}, {"w": "neural", "b": [0.7668, 0.7256, 0.8298, 0.7454]}, {"w": "style", "b": [0.1294, 0.7461, 0.1771, 0.7659]}, {"w": "transfer", "b": [0.1834, 0.7461, 0.2604, 0.7659]}, {"w": "algorithm.", "b": [0.2667, 0.7461, 0.3711, 0.7659]}, {"w": "As", "b": [0.3774, 0.7461, 0.4055, 0.7659]}, {"w": "you’ll", "b": [0.4118, 0.7461, 0.472, 0.7659]}, {"w": "see,", "b": [0.4783, 0.7461, 0.5169, 0.7659]}, {"w": "it", "b": [0.5232, 0.7461, 0.5372, 0.7659]}, {"w": "shares", "b": [0.5435, 0.7461, 0.6065, 0.7659]}, {"w": "many", "b": [0.6128, 0.7461, 0.6689, 0.7659]}, {"w": "similarities", "b": [0.6751, 0.7461, 0.7873, 0.7659]}, {"w": "with", "b": [0.7936, 0.7461, 0.8384, 0.7659]}, {"w": "the", "b": [0.1294, 0.7666, 0.1602, 0.7864]}, {"w": "DeepDream", "b": [0.1665, 0.7666, 0.2884, 0.7864]}, {"w": "implementation", "b": [0.2947, 0.7666, 0.4531, 0.7864]}, {"w": "developed", "b": [0.4594, 0.7666, 0.5631, 0.7864]}, {"w": "in", "b": [0.5694, 0.7666, 0.589, 0.7864]}, {"w": "the", "b": [0.5953, 0.7666, 0.6261, 0.7864]}, {"w": "previous", "b": [0.6324, 0.7666, 0.7193, 0.7864]}, {"w": "section.", "b": [0.7256, 0.7666, 0.8034, 0.7864]}]}, {"id": "b_6", "type": "paragraph", "text": "8.3.3. Neural style transfer in Keras", "words": [{"w": "8.3.3.", "b": [0.1294, 0.8139, 0.1862, 0.8336]}, {"w": "Neural", "b": [0.1925, 0.8139, 0.2667, 0.8336]}, {"w": "style", "b": [0.273, 0.8139, 0.3221, 0.8336]}, {"w": "transfer", "b": [0.3284, 0.8139, 0.4152, 0.8336]}, {"w": "in", "b": [0.4216, 0.8139, 0.4426, 0.8336]}, {"w": "Keras", "b": [0.4489, 0.8139, 0.5133, 0.8336]}]}, {"id": "b_7", "type": "paragraph", "text": "Neural style transfer can be implemented using any pretrained convnet. Here, you’ll use the VGG19 network used by Gatys et al. VGG19 is a", "words": [{"w": "Neural", "b": [0.1294, 0.8567, 0.1981, 0.8764]}, {"w": "style", "b": [0.2044, 0.8567, 0.252, 0.8764]}, {"w": "transfer", "b": [0.2583, 0.8567, 0.3354, 0.8764]}, {"w": "can", "b": [0.3417, 0.8567, 0.3767, 0.8764]}, {"w": "be", "b": [0.383, 0.8567, 0.4068, 0.8764]}, {"w": "implemented", "b": [0.4131, 0.8567, 0.5448, 0.8764]}, {"w": "using", "b": [0.5511, 0.8567, 0.6058, 0.8764]}, {"w": "any", "b": [0.6121, 0.8567, 0.6485, 0.8764]}, {"w": "pretrained", "b": [0.6548, 0.8567, 0.7571, 0.8764]}, {"w": "convnet.", "b": [0.7634, 0.8567, 0.8496, 0.8764]}, {"w": "Here,", "b": [0.1294, 0.8772, 0.1847, 0.8969]}, {"w": "you’ll", "b": [0.191, 0.8772, 0.2513, 0.8969]}, {"w": "use", "b": [0.2576, 0.8772, 0.2912, 0.8969]}, {"w": "the", "b": [0.2975, 0.8772, 0.3284, 0.8969]}, {"w": "VGG19", "b": [0.3347, 0.8772, 0.4145, 0.8969]}, {"w": "network", "b": [0.4208, 0.8772, 0.5035, 0.8969]}, {"w": "used", "b": [0.5098, 0.8772, 0.5561, 0.8969]}, {"w": "by", "b": [0.5624, 0.8772, 0.5876, 0.8969]}, {"w": "Gatys", "b": [0.5939, 0.8772, 0.6527, 0.8969]}, {"w": "et", "b": [0.6591, 0.8772, 0.6773, 0.8969]}, {"w": "al.", "b": [0.6836, 0.8772, 0.7081, 0.8969]}, {"w": "VGG19", "b": [0.7144, 0.8772, 0.7942, 0.8969]}, {"w": "is", "b": [0.8005, 0.8772, 0.8174, 0.8969]}, {"w": "a", "b": [0.8237, 0.8772, 0.8349, 0.8969]}]}]}, {"page": 378, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "simple variant of the VGG16 network introduced in chapter 5, with three more convolutional layers.", "words": [{"w": "simple", "b": [0.1294, 0.0857, 0.1967, 0.1054]}, {"w": "variant", "b": [0.203, 0.0857, 0.273, 0.1054]}, {"w": "of", "b": [0.2794, 0.0857, 0.3004, 0.1054]}, {"w": "the", "b": [0.3067, 0.0857, 0.3375, 0.1054]}, {"w": "VGG16", "b": [0.3438, 0.0857, 0.4237, 0.1054]}, {"w": "network", "b": [0.43, 0.0857, 0.5126, 0.1054]}, {"w": "introduced", "b": [0.5189, 0.0857, 0.6268, 0.1054]}, {"w": "in", "b": [0.6331, 0.0857, 0.6528, 0.1054]}, {"w": "chapter", "b": [0.659, 0.0857, 0.7333, 0.1054]}, {"w": "5,", "b": [0.7396, 0.0857, 0.7585, 0.1054]}, {"w": "with", "b": [0.7648, 0.0857, 0.8096, 0.1054]}, {"w": "three", "b": [0.8159, 0.0857, 0.8664, 0.1054]}, {"w": "more", "b": [0.1294, 0.1062, 0.1813, 0.1259]}, {"w": "convolutional", "b": [0.1876, 0.1062, 0.3263, 0.1259]}, {"w": "layers.", "b": [0.3326, 0.1062, 0.3992, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "This is the general process:", "words": [{"w": "This", "b": [0.1294, 0.149, 0.1743, 0.1687]}, {"w": "is", "b": [0.1806, 0.149, 0.1974, 0.1687]}, {"w": "the", "b": [0.2037, 0.149, 0.2345, 0.1687]}, {"w": "general", "b": [0.2408, 0.149, 0.3151, 0.1687]}, {"w": "process:", "b": [0.3214, 0.149, 0.404, 0.1687]}]}, {"id": "b_2", "type": "paragraph", "text": "1. Set up a network that computes VGG19 layer activations for the style-reference image, the target image, and the generated image at the same time. 2. Use the layer activations computed over these three images to define the loss function described earlier, which you’ll minimize in order to achieve style transfer. 3. Set up a gradient-descent process to minimize this loss function.", "words": [{"w": "1.", "b": [0.1551, 0.1873, 0.174, 0.207]}, {"w": "Set", "b": [0.1799, 0.1873, 0.2121, 0.207]}, {"w": "up", "b": [0.2184, 0.1873, 0.2436, 0.207]}, {"w": "a", "b": [0.2499, 0.1873, 0.2611, 0.207]}, {"w": "network", "b": [0.2674, 0.1873, 0.3501, 0.207]}, {"w": "that", "b": [0.3564, 0.1873, 0.3943, 0.207]}, {"w": "computes", "b": [0.4006, 0.1873, 0.4973, 0.207]}, {"w": "VGG19", "b": [0.5036, 0.1873, 0.5834, 0.207]}, {"w": "layer", "b": [0.5897, 0.1873, 0.6402, 0.207]}, {"w": "activations", "b": [0.6465, 0.1873, 0.7558, 0.207]}, {"w": "for", "b": [0.7621, 0.1873, 0.7915, 0.207]}, {"w": "the", "b": [0.7978, 0.1873, 0.8286, 0.207]}, {"w": "style-reference", "b": [0.1799, 0.2078, 0.3297, 0.2275]}, {"w": "image,", "b": [0.336, 0.2078, 0.404, 0.2275]}, {"w": "the", "b": [0.4103, 0.2078, 0.4411, 0.2275]}, {"w": "target", "b": [0.4474, 0.2078, 0.5044, 0.2275]}, {"w": "image,", "b": [0.5107, 0.2078, 0.5786, 0.2275]}, {"w": "and", "b": [0.5849, 0.2078, 0.6214, 0.2275]}, {"w": "the", "b": [0.6277, 0.2078, 0.6585, 0.2275]}, {"w": "generated", "b": [0.6648, 0.2078, 0.7628, 0.2275]}, {"w": "image", "b": [0.7691, 0.2078, 0.8307, 0.2275]}, {"w": "at", "b": [0.837, 0.2078, 0.8553, 0.2275]}, {"w": "the", "b": [0.1799, 0.2283, 0.2107, 0.248]}, {"w": "same", "b": [0.217, 0.2283, 0.2688, 0.248]}, {"w": "time.", "b": [0.2751, 0.2283, 0.3263, 0.248]}, {"w": "2.", "b": [0.1551, 0.2488, 0.174, 0.2685]}, {"w": "Use", "b": [0.1799, 0.2488, 0.2191, 0.2685]}, {"w": "the", "b": [0.2254, 0.2488, 0.2562, 0.2685]}, {"w": "layer", "b": [0.2625, 0.2488, 0.313, 0.2685]}, {"w": "activations", "b": [0.3193, 0.2488, 0.4286, 0.2685]}, {"w": "computed", "b": [0.4349, 0.2488, 0.5344, 0.2685]}, {"w": "over", "b": [0.5407, 0.2488, 0.5855, 0.2685]}, {"w": "these", "b": [0.5918, 0.2488, 0.6436, 0.2685]}, {"w": "three", "b": [0.6499, 0.2488, 0.7004, 0.2685]}, {"w": "images", "b": [0.7067, 0.2488, 0.7781, 0.2685]}, {"w": "to", "b": [0.7844, 0.2488, 0.8041, 0.2685]}, {"w": "define", "b": [0.1799, 0.2693, 0.2429, 0.289]}, {"w": "the", "b": [0.2492, 0.2693, 0.28, 0.289]}, {"w": "loss", "b": [0.2863, 0.2693, 0.3256, 0.289]}, {"w": "function", "b": [0.3319, 0.2693, 0.416, 0.289]}, {"w": "described", "b": [0.4223, 0.2693, 0.5189, 0.289]}, {"w": "earlier,", "b": [0.5253, 0.2693, 0.5949, 0.289]}, {"w": "which", "b": [0.6012, 0.2693, 0.6629, 0.289]}, {"w": "you’ll", "b": [0.6692, 0.2693, 0.7294, 0.289]}, {"w": "minimize", "b": [0.7358, 0.2693, 0.8311, 0.289]}, {"w": "in", "b": [0.8373, 0.2693, 0.8569, 0.289]}, {"w": "order", "b": [0.1799, 0.2898, 0.2331, 0.3095]}, {"w": "to", "b": [0.2394, 0.2898, 0.259, 0.3095]}, {"w": "achieve", "b": [0.2653, 0.2898, 0.3424, 0.3095]}, {"w": "style", "b": [0.3487, 0.2898, 0.3963, 0.3095]}, {"w": "transfer.", "b": [0.4026, 0.2898, 0.4845, 0.3095]}, {"w": "3.", "b": [0.1551, 0.3103, 0.174, 0.33]}, {"w": "Set", "b": [0.1799, 0.3103, 0.2121, 0.33]}, {"w": "up", "b": [0.2184, 0.3103, 0.2436, 0.33]}, {"w": "a", "b": [0.2499, 0.3103, 0.2611, 0.33]}, {"w": "gradient-descent", "b": [0.2674, 0.3103, 0.4342, 0.33]}, {"w": "process", "b": [0.4405, 0.3103, 0.5161, 0.33]}, {"w": "to", "b": [0.5224, 0.3103, 0.5421, 0.33]}, {"w": "minimize", "b": [0.5484, 0.3103, 0.6437, 0.33]}, {"w": "this", "b": [0.65, 0.3103, 0.6864, 0.33]}, {"w": "loss", "b": [0.6927, 0.3103, 0.732, 0.33]}, {"w": "function.", "b": [0.7383, 0.3103, 0.8287, 0.33]}]}, {"id": "b_3", "type": "paragraph", "text": "Let’s start by defining the paths to the style-reference image and the target image. To make sure that the processed images are a similar size (widely different sizes make style transfer more difficult), you’ll later resize them all to a shared height of 400 px.", "words": [{"w": "Let’s", "b": [0.1294, 0.3531, 0.1798, 0.3728]}, {"w": "start", "b": [0.1862, 0.3531, 0.2296, 0.3728]}, {"w": "by", "b": [0.2359, 0.3531, 0.2611, 0.3728]}, {"w": "defining", "b": [0.2674, 0.3531, 0.3515, 0.3728]}, {"w": "the", "b": [0.3578, 0.3531, 0.3886, 0.3728]}, {"w": "paths", "b": [0.3949, 0.3531, 0.4482, 0.3728]}, {"w": "to", "b": [0.4545, 0.3531, 0.4741, 0.3728]}, {"w": "the", "b": [0.4804, 0.3531, 0.5113, 0.3728]}, {"w": "style-reference", "b": [0.5176, 0.3531, 0.6674, 0.3728]}, {"w": "image", "b": [0.6737, 0.3531, 0.7354, 0.3728]}, {"w": "and", "b": [0.7417, 0.3531, 0.7781, 0.3728]}, {"w": "the", "b": [0.7844, 0.3531, 0.8153, 0.3728]}, {"w": "target", "b": [0.1294, 0.3736, 0.1864, 0.3933]}, {"w": "image.", "b": [0.1927, 0.3736, 0.2607, 0.3933]}, {"w": "To", "b": [0.267, 0.3736, 0.2932, 0.3933]}, {"w": "make", "b": [0.2995, 0.3736, 0.3541, 0.3933]}, {"w": "sure", "b": [0.3604, 0.3736, 0.4025, 0.3933]}, {"w": "that", "b": [0.4088, 0.3736, 0.4466, 0.3933]}, {"w": "the", "b": [0.4529, 0.3736, 0.4838, 0.3933]}, {"w": "processed", "b": [0.4901, 0.3736, 0.5895, 0.3933]}, {"w": "images", "b": [0.5958, 0.3736, 0.6673, 0.3933]}, {"w": "are", "b": [0.6735, 0.3736, 0.7043, 0.3933]}, {"w": "a", "b": [0.7106, 0.3736, 0.7218, 0.3933]}, {"w": "similar", "b": [0.7282, 0.3736, 0.7982, 0.3933]}, {"w": "size", "b": [0.8045, 0.3736, 0.8438, 0.3933]}, {"w": "(widely", "b": [0.1294, 0.3941, 0.2065, 0.4138]}, {"w": "different", "b": [0.2128, 0.3941, 0.2992, 0.4138]}, {"w": "sizes", "b": [0.3055, 0.3941, 0.3545, 0.4138]}, {"w": "make", "b": [0.3608, 0.3941, 0.4155, 0.4138]}, {"w": "style", "b": [0.4218, 0.3941, 0.4694, 0.4138]}, {"w": "transfer", "b": [0.4757, 0.3941, 0.5528, 0.4138]}, {"w": "more", "b": [0.5591, 0.3941, 0.6109, 0.4138]}, {"w": "difficult),", "b": [0.6172, 0.3941, 0.7127, 0.4138]}, {"w": "you’ll", "b": [0.719, 0.3941, 0.7793, 0.4138]}, {"w": "later", "b": [0.7856, 0.3941, 0.8304, 0.4138]}, {"w": "resize", "b": [0.1294, 0.4146, 0.1882, 0.4343]}, {"w": "them", "b": [0.1945, 0.4146, 0.245, 0.4343]}, {"w": "all", "b": [0.2513, 0.4146, 0.2765, 0.4343]}, {"w": "to", "b": [0.2828, 0.4146, 0.3025, 0.4343]}, {"w": "a", "b": [0.3088, 0.4146, 0.32, 0.4343]}, {"w": "shared", "b": [0.3263, 0.4146, 0.3921, 0.4343]}, {"w": "height", "b": [0.3984, 0.4146, 0.4615, 0.4343]}, {"w": "of", "b": [0.4677, 0.4146, 0.4887, 0.4343]}, {"w": "400", "b": [0.495, 0.4146, 0.5329, 0.4343]}, {"w": "px.", "b": [0.5392, 0.4146, 0.5707, 0.4343]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 8.14. Defining initial variables", "words": [{"w": "Listing", "b": [0.1294, 0.4524, 0.1862, 0.4672]}, {"w": "8.14.", "b": [0.1909, 0.4524, 0.2288, 0.4672]}, {"w": "Defining", "b": [0.2335, 0.4524, 0.3028, 0.4672]}, {"w": "initial", "b": [0.3076, 0.4524, 0.3549, 0.4672]}, {"w": "variables", "b": [0.3596, 0.4524, 0.4332, 0.4672]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras.preprocessing.image import load_img, img_to_array target_image_path = 'img/portrait.jpg' 1 style_reference_image_path = 'img/transfer_style_reference.jpg' 2 width, height = load_img(target_image_path).size 3 img_height = 400 3 img_width = int(width * img_height / height) 3", "words": [{"w": "from", "b": [0.1357, 0.4808, 0.1811, 0.496]}, {"w": "keras.preprocessing.image", "b": [0.1925, 0.4808, 0.4763, 0.496]}, {"w": "import", "b": [0.4876, 0.4808, 0.5557, 0.496]}, {"w": "load_img,", "b": [0.5671, 0.4808, 0.6692, 0.496]}, {"w": "img_to_array", "b": [0.6806, 0.4808, 0.8168, 0.496]}, {"w": "target_image_path", "b": [0.1357, 0.5111, 0.3287, 0.5263]}, {"w": "=", "b": [0.34, 0.5111, 0.3514, 0.5263]}, {"w": "'img/portrait.jpg'", "b": [0.3628, 0.5111, 0.5671, 0.5263]}, {"w": "1", "b": [0.1357, 0.5263, 0.1471, 0.5414]}, {"w": "style_reference_image_path", "b": [0.1357, 0.5414, 0.4309, 0.5566]}, {"w": "=", "b": [0.4422, 0.5414, 0.4536, 0.5566]}, {"w": "'img/transfer_style_reference.jpg'", "b": [0.4649, 0.5414, 0.8509, 0.5566]}, {"w": "2", "b": [0.1357, 0.5566, 0.1471, 0.5717]}, {"w": "width,", "b": [0.1357, 0.5869, 0.2038, 0.602]}, {"w": "height", "b": [0.2152, 0.5869, 0.2833, 0.602]}, {"w": "=", "b": [0.2946, 0.5869, 0.306, 0.602]}, {"w": "load_img(target_image_path).size", "b": [0.3173, 0.5869, 0.6806, 0.602]}, {"w": "3", "b": [0.1357, 0.602, 0.1471, 0.6172]}, {"w": "img_height", "b": [0.1357, 0.6172, 0.2492, 0.6323]}, {"w": "=", "b": [0.2606, 0.6172, 0.2719, 0.6323]}, {"w": "400", "b": [0.2833, 0.6172, 0.3173, 0.6323]}, {"w": "3", "b": [0.1357, 0.6324, 0.1471, 0.6475]}, {"w": "img_width", "b": [0.1357, 0.6475, 0.2379, 0.6626]}, {"w": "=", "b": [0.2492, 0.6475, 0.2606, 0.6626]}, {"w": "int(width", "b": [0.2719, 0.6475, 0.3741, 0.6626]}, {"w": "*", "b": [0.3855, 0.6475, 0.3968, 0.6626]}, {"w": "img_height", "b": [0.4082, 0.6475, 0.5217, 0.6626]}, {"w": "/", "b": [0.533, 0.6475, 0.5444, 0.6626]}, {"w": "height)", "b": [0.5557, 0.6475, 0.6352, 0.6626]}, {"w": "3", "b": [0.1357, 0.6627, 0.1471, 0.6778]}]}, {"id": "b_6", "type": "paragraph", "text": "1 Path to the image you want to transform 2 Path to the style image 3 Dimensions of the generated picture", "words": [{"w": "1", "b": [0.1799, 0.6962, 0.1925, 0.716]}, {"w": "Path", "b": [0.1988, 0.6962, 0.2492, 0.716]}, {"w": "to", "b": [0.2555, 0.6962, 0.2766, 0.716]}, {"w": "the", "b": [0.2829, 0.6962, 0.3165, 0.716]}, {"w": "image", "b": [0.3228, 0.6962, 0.3872, 0.716]}, {"w": "you", "b": [0.3936, 0.6962, 0.4328, 0.716]}, {"w": "want", "b": [0.4391, 0.6962, 0.4924, 0.716]}, {"w": "to", "b": [0.4987, 0.6962, 0.5197, 0.716]}, {"w": "transform", "b": [0.526, 0.6962, 0.6353, 0.716]}, {"w": "2", "b": [0.1799, 0.7167, 0.1925, 0.7365]}, {"w": "Path", "b": [0.1988, 0.7167, 0.2492, 0.7365]}, {"w": "to", "b": [0.2555, 0.7167, 0.2766, 0.7365]}, {"w": "the", "b": [0.2829, 0.7167, 0.3165, 0.7365]}, {"w": "style", "b": [0.3228, 0.7167, 0.3718, 0.7365]}, {"w": "image", "b": [0.3781, 0.7167, 0.4426, 0.7365]}, {"w": "3", "b": [0.1799, 0.7372, 0.1925, 0.757]}, {"w": "Dimensions", "b": [0.1988, 0.7372, 0.3235, 0.757]}, {"w": "of", "b": [0.3298, 0.7372, 0.3508, 0.757]}, {"w": "the", "b": [0.3572, 0.7372, 0.3908, 0.757]}, {"w": "generated", "b": [0.3971, 0.7372, 0.5036, 0.757]}, {"w": "picture", "b": [0.5099, 0.7372, 0.5865, 0.757]}]}, {"id": "b_7", "type": "paragraph", "text": "You need some auxiliary functions for loading, preprocessing, and postprocessing the images that go in and out of the VGG19 convnet.", "words": [{"w": "You", "b": [0.1294, 0.78, 0.1703, 0.7998]}, {"w": "need", "b": [0.1766, 0.78, 0.2243, 0.7998]}, {"w": "some", "b": [0.2306, 0.78, 0.2838, 0.7998]}, {"w": "auxiliary", "b": [0.2901, 0.78, 0.3798, 0.7998]}, {"w": "functions", "b": [0.3861, 0.78, 0.48, 0.7998]}, {"w": "for", "b": [0.4863, 0.78, 0.5157, 0.7998]}, {"w": "loading,", "b": [0.522, 0.78, 0.604, 0.7998]}, {"w": "preprocessing,", "b": [0.6103, 0.78, 0.7567, 0.7998]}, {"w": "and", "b": [0.763, 0.78, 0.7995, 0.7998]}, {"w": "postprocessing", "b": [0.1294, 0.8005, 0.2794, 0.8203]}, {"w": "the", "b": [0.2857, 0.8005, 0.3165, 0.8203]}, {"w": "images", "b": [0.3228, 0.8005, 0.3943, 0.8203]}, {"w": "that", "b": [0.4006, 0.8005, 0.4384, 0.8203]}, {"w": "go", "b": [0.4447, 0.8005, 0.4699, 0.8203]}, {"w": "in", "b": [0.4762, 0.8005, 0.4959, 0.8203]}, {"w": "and", "b": [0.5022, 0.8005, 0.5386, 0.8203]}, {"w": "out", "b": [0.5449, 0.8005, 0.5771, 0.8203]}, {"w": "of", "b": [0.5835, 0.8005, 0.6045, 0.8203]}, {"w": "the", "b": [0.6108, 0.8005, 0.6416, 0.8203]}, {"w": "VGG19", "b": [0.6479, 0.8005, 0.7278, 0.8203]}, {"w": "convnet.", "b": [0.734, 0.8005, 0.8202, 0.8203]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 8.15. Auxiliary functions", "words": [{"w": "Listing", "b": [0.1294, 0.8384, 0.1862, 0.8532]}, {"w": "8.15.", "b": [0.1909, 0.8384, 0.2288, 0.8532]}, {"w": "Auxiliary", "b": [0.2335, 0.8384, 0.3102, 0.8532]}, {"w": "functions", "b": [0.3149, 0.8384, 0.3896, 0.8532]}]}, {"id": "b_9", "type": "paragraph", "text": "import numpy as np from keras.applications import vgg19", "words": [{"w": "import", "b": [0.1357, 0.8668, 0.2038, 0.8819]}, {"w": "numpy", "b": [0.2152, 0.8668, 0.2719, 0.8819]}, {"w": "as", "b": [0.2833, 0.8668, 0.306, 0.8819]}, {"w": "np", "b": [0.3173, 0.8668, 0.34, 0.8819]}, {"w": "from", "b": [0.1357, 0.8819, 0.1811, 0.8971]}, {"w": "keras.applications", "b": [0.1925, 0.8819, 0.3968, 0.8971]}, {"w": "import", "b": [0.4082, 0.8819, 0.4763, 0.8971]}, {"w": "vgg19", "b": [0.4876, 0.8819, 0.5444, 0.8971]}]}]}, {"page": 379, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "def preprocess_image(image_path): img = load_img(image_path, target_size=(img_height, img_width)) img = img_to_array(img) img = np.expand_dims(img, axis=0) img = vgg19.preprocess_input(img) return img def deprocess_image(x): x[:, :, 0] += 103.939 1 x[:, :, 1] += 116.779 1 x[:, :, 2] += 123.68 1 x = x[:, :, ::-1] 2 x = np.clip(x, 0, 255).astype('uint8') return x", "words": [{"w": "def", "b": [0.1357, 0.0851, 0.1698, 0.1002]}, {"w": "preprocess_image(image_path):", "b": [0.1811, 0.0851, 0.5103, 0.1002]}, {"w": "img", "b": [0.1811, 0.1002, 0.2152, 0.1154]}, {"w": "=", "b": [0.2265, 0.1002, 0.2379, 0.1154]}, {"w": "load_img(image_path,", "b": [0.2492, 0.1002, 0.4763, 0.1154]}, {"w": "target_size=(img_height,", "b": [0.4876, 0.1002, 0.7601, 0.1154]}, {"w": "img_width))", "b": [0.1357, 0.1154, 0.2606, 0.1305]}, {"w": "img", "b": [0.1811, 0.1305, 0.2152, 0.1457]}, {"w": "=", "b": [0.2265, 0.1305, 0.2379, 0.1457]}, {"w": "img_to_array(img)", "b": [0.2492, 0.1305, 0.4422, 0.1457]}, {"w": "img", "b": [0.1811, 0.1457, 0.2152, 0.1608]}, {"w": "=", "b": [0.2265, 0.1457, 0.2379, 0.1608]}, {"w": "np.expand_dims(img,", "b": [0.2492, 0.1457, 0.4649, 0.1608]}, {"w": "axis=0)", "b": [0.4763, 0.1457, 0.5557, 0.1608]}, {"w": "img", "b": [0.1811, 0.1608, 0.2152, 0.176]}, {"w": "=", "b": [0.2265, 0.1608, 0.2379, 0.176]}, {"w": "vgg19.preprocess_input(img)", "b": [0.2492, 0.1608, 0.5557, 0.176]}, {"w": "return", "b": [0.1811, 0.176, 0.2492, 0.1911]}, {"w": "img", "b": [0.2606, 0.176, 0.2946, 0.1911]}, {"w": "def", "b": [0.1357, 0.2063, 0.1698, 0.2214]}, {"w": "deprocess_image(x):", "b": [0.1811, 0.2063, 0.3968, 0.2214]}, {"w": "x[:,", "b": [0.1811, 0.2215, 0.2265, 0.2366]}, {"w": ":,", "b": [0.2379, 0.2215, 0.2606, 0.2366]}, {"w": "0]", "b": [0.2719, 0.2215, 0.2946, 0.2366]}, {"w": "+=", "b": [0.306, 0.2215, 0.3287, 0.2366]}, {"w": "103.939", "b": [0.34, 0.2215, 0.4195, 0.2366]}, {"w": "1", "b": [0.692, 0.2215, 0.7034, 0.2366]}, {"w": "x[:,", "b": [0.1811, 0.2366, 0.2265, 0.2518]}, {"w": ":,", "b": [0.2379, 0.2366, 0.2606, 0.2518]}, {"w": "1]", "b": [0.2719, 0.2366, 0.2946, 0.2518]}, {"w": "+=", "b": [0.306, 0.2366, 0.3287, 0.2518]}, {"w": "116.779", "b": [0.34, 0.2366, 0.4195, 0.2518]}, {"w": "1", "b": [0.692, 0.2366, 0.7034, 0.2518]}, {"w": "x[:,", "b": [0.1811, 0.2518, 0.2265, 0.2669]}, {"w": ":,", "b": [0.2379, 0.2518, 0.2606, 0.2669]}, {"w": "2]", "b": [0.2719, 0.2518, 0.2946, 0.2669]}, {"w": "+=", "b": [0.306, 0.2518, 0.3287, 0.2669]}, {"w": "123.68", "b": [0.34, 0.2518, 0.4082, 0.2669]}, {"w": "1", "b": [0.692, 0.2518, 0.7034, 0.2669]}, {"w": "x", "b": [0.1811, 0.2669, 0.1925, 0.2821]}, {"w": "=", "b": [0.2038, 0.2669, 0.2152, 0.2821]}, {"w": "x[:,", "b": [0.2265, 0.2669, 0.2719, 0.2821]}, {"w": ":,", "b": [0.2833, 0.2669, 0.306, 0.2821]}, {"w": "::-1]", "b": [0.3173, 0.2669, 0.3741, 0.2821]}, {"w": "2", "b": [0.692, 0.2669, 0.7034, 0.2821]}, {"w": "x", "b": [0.1811, 0.2821, 0.1925, 0.2972]}, {"w": "=", "b": [0.2038, 0.2821, 0.2152, 0.2972]}, {"w": "np.clip(x,", "b": [0.2265, 0.2821, 0.34, 0.2972]}, {"w": "0,", "b": [0.3514, 0.2821, 0.3741, 0.2972]}, {"w": "255).astype('uint8')", "b": [0.3855, 0.2821, 0.6125, 0.2972]}, {"w": "return", "b": [0.1811, 0.2972, 0.2492, 0.3124]}, {"w": "x", "b": [0.2606, 0.2972, 0.2719, 0.3124]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Zero-centering by removing the mean pixel value from ImageNet. This reverses a transformation done by vgg19.preprocess_input. 2 Converts images from 'BGR' to 'RGB'. This is also part of the reversal of vgg19.preprocess_input.", "words": [{"w": "1", "b": [0.1799, 0.3308, 0.1925, 0.3505]}, {"w": "Zero-centering", "b": [0.1988, 0.3308, 0.3594, 0.3505]}, {"w": "by", "b": [0.3657, 0.3308, 0.3924, 0.3505]}, {"w": "removing", "b": [0.3987, 0.3308, 0.5005, 0.3505]}, {"w": "the", "b": [0.5068, 0.3308, 0.5404, 0.3505]}, {"w": "mean", "b": [0.5467, 0.3308, 0.6056, 0.3505]}, {"w": "pixel", "b": [0.6119, 0.3308, 0.6638, 0.3505]}, {"w": "value", "b": [0.6701, 0.3308, 0.7275, 0.3505]}, {"w": "from", "b": [0.7338, 0.3308, 0.7866, 0.3505]}, {"w": "ImageNet.", "b": [0.1799, 0.3513, 0.2912, 0.371]}, {"w": "This", "b": [0.2975, 0.3513, 0.3452, 0.371]}, {"w": "reverses", "b": [0.3515, 0.3513, 0.4393, 0.371]}, {"w": "a", "b": [0.4456, 0.3513, 0.4582, 0.371]}, {"w": "transformation", "b": [0.4645, 0.3513, 0.6285, 0.371]}, {"w": "done", "b": [0.6348, 0.3513, 0.6866, 0.371]}, {"w": "by", "b": [0.693, 0.3513, 0.7196, 0.371]}, {"w": "vgg19.preprocess_input.", "b": [0.1799, 0.3718, 0.441, 0.3915]}, {"w": "2", "b": [0.1799, 0.3923, 0.1925, 0.412]}, {"w": "Converts", "b": [0.1988, 0.3923, 0.2969, 0.412]}, {"w": "images", "b": [0.3032, 0.3923, 0.3774, 0.412]}, {"w": "from", "b": [0.3837, 0.3923, 0.4365, 0.412]}, {"w": "'BGR'", "b": [0.4428, 0.3923, 0.5115, 0.412]}, {"w": "to", "b": [0.5178, 0.3923, 0.5388, 0.412]}, {"w": "'RGB'.", "b": [0.5451, 0.3923, 0.6201, 0.412]}, {"w": "This", "b": [0.6264, 0.3923, 0.6741, 0.412]}, {"w": "is", "b": [0.6804, 0.3923, 0.6972, 0.412]}, {"w": "also", "b": [0.7035, 0.3923, 0.7456, 0.412]}, {"w": "part", "b": [0.7519, 0.3923, 0.7981, 0.412]}, {"w": "of", "b": [0.8044, 0.3923, 0.8255, 0.412]}, {"w": "the", "b": [0.8318, 0.3923, 0.8654, 0.412]}, {"w": "reversal", "b": [0.1799, 0.4128, 0.2663, 0.4325]}, {"w": "of", "b": [0.2726, 0.4128, 0.2936, 0.4325]}, {"w": "vgg19.preprocess_input.", "b": [0.2999, 0.4128, 0.561, 0.4325]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s set up the VGG19 network. It takes as input a batch of three images: the style--reference image, the target image, and a placeholder that will contain the generated image. A placeholder is a symbolic tensor, the values of which are provided externally via Numpy arrays. The style- reference and target image are static and thus defined using K.constant, whereas the values contained in the placeholder of the generated image will change over time.", "words": [{"w": "Let’s", "b": [0.1294, 0.4556, 0.1798, 0.4753]}, {"w": "set", "b": [0.1862, 0.4556, 0.2142, 0.4753]}, {"w": "up", "b": [0.2205, 0.4556, 0.2457, 0.4753]}, {"w": "the", "b": [0.252, 0.4556, 0.2828, 0.4753]}, {"w": "VGG19", "b": [0.2892, 0.4556, 0.369, 0.4753]}, {"w": "network.", "b": [0.3753, 0.4556, 0.4643, 0.4753]}, {"w": "It", "b": [0.4706, 0.4556, 0.486, 0.4753]}, {"w": "takes", "b": [0.4923, 0.4556, 0.5442, 0.4753]}, {"w": "as", "b": [0.5505, 0.4556, 0.5715, 0.4753]}, {"w": "input", "b": [0.5778, 0.4556, 0.6296, 0.4753]}, {"w": "a", "b": [0.636, 0.4556, 0.6472, 0.4753]}, {"w": "batch", "b": [0.6535, 0.4556, 0.7081, 0.4753]}, {"w": "of", "b": [0.7144, 0.4556, 0.7354, 0.4753]}, {"w": "three", "b": [0.7417, 0.4556, 0.7922, 0.4753]}, {"w": "images:", "b": [0.1294, 0.4761, 0.2079, 0.4958]}, {"w": "the", "b": [0.2142, 0.4761, 0.245, 0.4958]}, {"w": "style--reference", "b": [0.2513, 0.4761, 0.4096, 0.4958]}, {"w": "image,", "b": [0.4159, 0.4761, 0.4839, 0.4958]}, {"w": "the", "b": [0.4902, 0.4761, 0.521, 0.4958]}, {"w": "target", "b": [0.5273, 0.4761, 0.5842, 0.4958]}, {"w": "image,", "b": [0.5905, 0.4761, 0.6585, 0.4958]}, {"w": "and", "b": [0.6648, 0.4761, 0.7012, 0.4958]}, {"w": "a", "b": [0.7075, 0.4761, 0.7187, 0.4958]}, {"w": "placeholder", "b": [0.725, 0.4761, 0.8426, 0.4958]}, {"w": "that", "b": [0.1294, 0.4966, 0.1673, 0.5163]}, {"w": "will", "b": [0.1736, 0.4966, 0.2128, 0.5163]}, {"w": "contain", "b": [0.2191, 0.4966, 0.2934, 0.5163]}, {"w": "the", "b": [0.2997, 0.4966, 0.3305, 0.5163]}, {"w": "generated", "b": [0.3368, 0.4966, 0.4349, 0.5163]}, {"w": "image.", "b": [0.4412, 0.4966, 0.5091, 0.5163]}, {"w": "A", "b": [0.5154, 0.4966, 0.5337, 0.5163]}, {"w": "placeholder", "b": [0.54, 0.4966, 0.6576, 0.5163]}, {"w": "is", "b": [0.6639, 0.4966, 0.6808, 0.5163]}, {"w": "a", "b": [0.6871, 0.4966, 0.6983, 0.5163]}, {"w": "symbolic", "b": [0.7046, 0.4966, 0.7971, 0.5163]}, {"w": "tensor,", "b": [0.8034, 0.4966, 0.8702, 0.5163]}, {"w": "the", "b": [0.1294, 0.5171, 0.1602, 0.5368]}, {"w": "values", "b": [0.1665, 0.5171, 0.231, 0.5368]}, {"w": "of", "b": [0.2373, 0.5171, 0.2583, 0.5368]}, {"w": "which", "b": [0.2646, 0.5171, 0.3263, 0.5368]}, {"w": "are", "b": [0.3326, 0.5171, 0.3634, 0.5368]}, {"w": "provided", "b": [0.3697, 0.5171, 0.4594, 0.5368]}, {"w": "externally", "b": [0.4656, 0.5171, 0.5665, 0.5368]}, {"w": "via", "b": [0.5728, 0.5171, 0.6036, 0.5368]}, {"w": "Numpy", "b": [0.6099, 0.5171, 0.6856, 0.5368]}, {"w": "arrays.", "b": [0.6919, 0.5171, 0.7599, 0.5368]}, {"w": "The", "b": [0.7662, 0.5171, 0.8054, 0.5368]}, {"w": "style-", "b": [0.8117, 0.5171, 0.8677, 0.5368]}, {"w": "reference", "b": [0.1294, 0.5376, 0.2232, 0.5573]}, {"w": "and", "b": [0.2295, 0.5376, 0.266, 0.5573]}, {"w": "target", "b": [0.2723, 0.5376, 0.3292, 0.5573]}, {"w": "image", "b": [0.3355, 0.5376, 0.3972, 0.5573]}, {"w": "are", "b": [0.4035, 0.5376, 0.4343, 0.5573]}, {"w": "static", "b": [0.4406, 0.5376, 0.4938, 0.5573]}, {"w": "and", "b": [0.5001, 0.5376, 0.5366, 0.5573]}, {"w": "thus", "b": [0.5429, 0.5376, 0.5849, 0.5573]}, {"w": "defined", "b": [0.5912, 0.5376, 0.6669, 0.5573]}, {"w": "using", "b": [0.6732, 0.5376, 0.7279, 0.5573]}, {"w": "K.constant,", "b": [0.1294, 0.5581, 0.2871, 0.5793]}, {"w": "whereas", "b": [0.2934, 0.5581, 0.376, 0.5778]}, {"w": "the", "b": [0.3823, 0.5581, 0.4132, 0.5778]}, {"w": "values", "b": [0.4195, 0.5581, 0.4839, 0.5778]}, {"w": "contained", "b": [0.4902, 0.5581, 0.5883, 0.5778]}, {"w": "in", "b": [0.5946, 0.5581, 0.6142, 0.5778]}, {"w": "the", "b": [0.6206, 0.5581, 0.6514, 0.5778]}, {"w": "placeholder", "b": [0.6577, 0.5581, 0.7754, 0.5778]}, {"w": "of", "b": [0.7817, 0.5581, 0.8027, 0.5778]}, {"w": "the", "b": [0.809, 0.5581, 0.8398, 0.5778]}, {"w": "generated", "b": [0.1294, 0.5795, 0.2275, 0.5992]}, {"w": "image", "b": [0.2338, 0.5795, 0.2954, 0.5992]}, {"w": "will", "b": [0.3017, 0.5795, 0.341, 0.5992]}, {"w": "change", "b": [0.3473, 0.5795, 0.4187, 0.5992]}, {"w": "over", "b": [0.425, 0.5795, 0.4699, 0.5992]}, {"w": "time.", "b": [0.4762, 0.5795, 0.5273, 0.5992]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 8.16. Loading the pretrained VGG19 network and applying it to the three images", "words": [{"w": "Listing", "b": [0.1294, 0.6173, 0.1862, 0.6321]}, {"w": "8.16.", "b": [0.1909, 0.6173, 0.2288, 0.6321]}, {"w": "Loading", "b": [0.2335, 0.6173, 0.3008, 0.6321]}, {"w": "the", "b": [0.3055, 0.6173, 0.3307, 0.6321]}, {"w": "pretrained", "b": [0.3354, 0.6173, 0.4213, 0.6321]}, {"w": "VGG19", "b": [0.426, 0.6173, 0.488, 0.6321]}, {"w": "network", "b": [0.4928, 0.6173, 0.56, 0.6321]}, {"w": "and", "b": [0.5647, 0.6173, 0.5952, 0.6321]}, {"w": "applying", "b": [0.6, 0.6173, 0.6704, 0.6321]}, {"w": "it", "b": [0.6752, 0.6173, 0.6867, 0.6321]}, {"w": "to", "b": [0.6914, 0.6173, 0.7072, 0.6321]}, {"w": "the", "b": [0.7119, 0.6173, 0.7372, 0.6321]}, {"w": "three", "b": [0.7419, 0.6173, 0.7836, 0.6321]}, {"w": "images", "b": [0.7883, 0.6173, 0.844, 0.6321]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras import backend as K target_image = K.constant(preprocess_image(target_image_path)) style_reference_image = K.constant(preprocess_image(style_reference_image_path)) combination_image = K.placeholder((1, img_height, img_width, 3)) 1 input_tensor = K.concatenate([target_image, 2 style_reference_image, 2 combination_image], axis=0) 2 model = vgg19.VGG19(input_tensor=input_tensor, 3", "words": [{"w": "from", "b": [0.1357, 0.6457, 0.1811, 0.6609]}, {"w": "keras", "b": [0.1925, 0.6457, 0.2492, 0.6609]}, {"w": "import", "b": [0.2606, 0.6457, 0.3287, 0.6609]}, {"w": "backend", "b": [0.34, 0.6457, 0.4195, 0.6609]}, {"w": "as", "b": [0.4309, 0.6457, 0.4536, 0.6609]}, {"w": "K", "b": [0.4649, 0.6457, 0.4763, 0.6609]}, {"w": "target_image", "b": [0.1357, 0.676, 0.2719, 0.6912]}, {"w": "=", "b": [0.2833, 0.676, 0.2946, 0.6912]}, {"w": "K.constant(preprocess_image(target_image_path))", "b": [0.306, 0.676, 0.8395, 0.6912]}, {"w": "style_reference_image", "b": [0.1357, 0.6912, 0.3741, 0.7063]}, {"w": "=", "b": [0.3855, 0.6912, 0.3968, 0.7063]}, {"w": "K.constant(preprocess_image(style_reference_image_path))", "b": [0.1357, 0.7063, 0.7714, 0.7215]}, {"w": "combination_image", "b": [0.1357, 0.7215, 0.3287, 0.7366]}, {"w": "=", "b": [0.34, 0.7215, 0.3514, 0.7366]}, {"w": "K.placeholder((1,", "b": [0.3628, 0.7215, 0.5557, 0.7366]}, {"w": "img_height,", "b": [0.5671, 0.7215, 0.6919, 0.7366]}, {"w": "img_width,", "b": [0.7033, 0.7215, 0.8168, 0.7366]}, {"w": "3))", "b": [0.8282, 0.7215, 0.8622, 0.7366]}, {"w": "1", "b": [0.1357, 0.7366, 0.1471, 0.7518]}, {"w": "input_tensor", "b": [0.1357, 0.7669, 0.2719, 0.7821]}, {"w": "=", "b": [0.2833, 0.7669, 0.2946, 0.7821]}, {"w": "K.concatenate([target_image,", "b": [0.306, 0.7669, 0.6238, 0.7821]}, {"w": "2", "b": [0.1357, 0.7821, 0.1471, 0.7972]}, {"w": "style_reference_image,", "b": [0.4763, 0.7972, 0.726, 0.8124]}, {"w": "2", "b": [0.1357, 0.8124, 0.1471, 0.8275]}, {"w": "combination_image],", "b": [0.4763, 0.8275, 0.6919, 0.8427]}, {"w": "axis=0)", "b": [0.7033, 0.8275, 0.7828, 0.8427]}, {"w": "2", "b": [0.1357, 0.8427, 0.1471, 0.8578]}, {"w": "model", "b": [0.1357, 0.873, 0.1925, 0.8882]}, {"w": "=", "b": [0.2038, 0.873, 0.2152, 0.8882]}, {"w": "vgg19.VGG19(input_tensor=input_tensor,", "b": [0.2265, 0.873, 0.6579, 0.8882]}, {"w": "3", "b": [0.1357, 0.8882, 0.1471, 0.9033]}]}]}, {"page": 380, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "weights='imagenet', 3 include_top=False) 3 print('Model loaded.') 3", "words": [{"w": "weights='imagenet',", "b": [0.3628, 0.0851, 0.5784, 0.1002]}, {"w": "3", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "include_top=False)", "b": [0.3628, 0.1154, 0.5671, 0.1305]}, {"w": "3", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "print('Model", "b": [0.1357, 0.1457, 0.2719, 0.1608]}, {"w": "loaded.')", "b": [0.2833, 0.1457, 0.3855, 0.1608]}, {"w": "3", "b": [0.1357, 0.1608, 0.1471, 0.176]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Placeholder that will contain the generated image 2 Combines the three images in a single batch 3 Builds the VGG19 network with the batch of three images as input. The model will be loaded with pretrained ImageNet weights.", "words": [{"w": "1", "b": [0.1799, 0.1944, 0.1925, 0.2142]}, {"w": "Placeholder", "b": [0.1988, 0.1944, 0.3263, 0.2142]}, {"w": "that", "b": [0.3326, 0.1944, 0.376, 0.2142]}, {"w": "will", "b": [0.3824, 0.1944, 0.4216, 0.2142]}, {"w": "contain", "b": [0.4279, 0.1944, 0.5078, 0.2142]}, {"w": "the", "b": [0.5141, 0.1944, 0.5477, 0.2142]}, {"w": "generated", "b": [0.554, 0.1944, 0.6605, 0.2142]}, {"w": "image", "b": [0.6668, 0.1944, 0.7313, 0.2142]}, {"w": "2", "b": [0.1799, 0.2149, 0.1925, 0.2347]}, {"w": "Combines", "b": [0.1988, 0.2149, 0.3067, 0.2347]}, {"w": "the", "b": [0.313, 0.2149, 0.3466, 0.2347]}, {"w": "three", "b": [0.3529, 0.2149, 0.4085, 0.2347]}, {"w": "images", "b": [0.4148, 0.2149, 0.4891, 0.2347]}, {"w": "in", "b": [0.4954, 0.2149, 0.5164, 0.2347]}, {"w": "a", "b": [0.5227, 0.2149, 0.5354, 0.2347]}, {"w": "single", "b": [0.5417, 0.2149, 0.6033, 0.2347]}, {"w": "batch", "b": [0.6096, 0.2149, 0.6699, 0.2347]}, {"w": "3", "b": [0.1799, 0.2354, 0.1925, 0.2552]}, {"w": "Builds", "b": [0.1988, 0.2354, 0.2675, 0.2552]}, {"w": "the", "b": [0.2738, 0.2354, 0.3074, 0.2552]}, {"w": "VGG19", "b": [0.3137, 0.2354, 0.3964, 0.2552]}, {"w": "network", "b": [0.4027, 0.2354, 0.4924, 0.2552]}, {"w": "with", "b": [0.4987, 0.2354, 0.5464, 0.2552]}, {"w": "the", "b": [0.5527, 0.2354, 0.5863, 0.2552]}, {"w": "batch", "b": [0.5926, 0.2354, 0.6529, 0.2552]}, {"w": "of", "b": [0.6592, 0.2354, 0.6802, 0.2552]}, {"w": "three", "b": [0.6865, 0.2354, 0.7421, 0.2552]}, {"w": "images", "b": [0.7484, 0.2354, 0.8227, 0.2552]}, {"w": "as", "b": [0.829, 0.2354, 0.8514, 0.2552]}, {"w": "input.", "b": [0.1799, 0.2559, 0.2437, 0.2757]}, {"w": "The", "b": [0.25, 0.2559, 0.292, 0.2757]}, {"w": "model", "b": [0.2983, 0.2559, 0.3642, 0.2757]}, {"w": "will", "b": [0.3705, 0.2559, 0.4097, 0.2757]}, {"w": "be", "b": [0.4161, 0.2559, 0.4413, 0.2757]}, {"w": "loaded", "b": [0.4476, 0.2559, 0.5191, 0.2757]}, {"w": "with", "b": [0.5254, 0.2559, 0.573, 0.2757]}, {"w": "pretrained", "b": [0.5793, 0.2559, 0.6938, 0.2757]}, {"w": "ImageNet", "b": [0.7001, 0.2559, 0.8052, 0.2757]}, {"w": "weights.", "b": [0.1799, 0.2764, 0.2674, 0.2962]}]}, {"id": "b_2", "type": "paragraph", "text": "Let’s define the content loss, which will make sure the top layer of the VGG19 convnet has a similar view of the target image and the generated image.", "words": [{"w": "Let’s", "b": [0.1294, 0.3192, 0.1798, 0.3389]}, {"w": "define", "b": [0.1862, 0.3192, 0.2492, 0.3389]}, {"w": "the", "b": [0.2555, 0.3192, 0.2863, 0.3389]}, {"w": "content", "b": [0.2926, 0.3192, 0.3669, 0.3389]}, {"w": "loss,", "b": [0.3732, 0.3192, 0.4188, 0.3389]}, {"w": "which", "b": [0.4251, 0.3192, 0.4867, 0.3389]}, {"w": "will", "b": [0.493, 0.3192, 0.5323, 0.3389]}, {"w": "make", "b": [0.5386, 0.3192, 0.5932, 0.3389]}, {"w": "sure", "b": [0.5995, 0.3192, 0.6416, 0.3389]}, {"w": "the", "b": [0.6479, 0.3192, 0.6787, 0.3389]}, {"w": "top", "b": [0.685, 0.3192, 0.7172, 0.3389]}, {"w": "layer", "b": [0.7235, 0.3192, 0.774, 0.3389]}, {"w": "of", "b": [0.7803, 0.3192, 0.8013, 0.3389]}, {"w": "the", "b": [0.8076, 0.3192, 0.8384, 0.3389]}, {"w": "VGG19", "b": [0.1294, 0.3397, 0.2093, 0.3594]}, {"w": "convnet", "b": [0.2156, 0.3397, 0.2954, 0.3594]}, {"w": "has", "b": [0.3018, 0.3397, 0.3354, 0.3594]}, {"w": "a", "b": [0.3417, 0.3397, 0.3529, 0.3594]}, {"w": "similar", "b": [0.3592, 0.3397, 0.4293, 0.3594]}, {"w": "view", "b": [0.4356, 0.3397, 0.4846, 0.3594]}, {"w": "of", "b": [0.4909, 0.3397, 0.5119, 0.3594]}, {"w": "the", "b": [0.5182, 0.3397, 0.5491, 0.3594]}, {"w": "target", "b": [0.5554, 0.3397, 0.6123, 0.3594]}, {"w": "image", "b": [0.6186, 0.3397, 0.6803, 0.3594]}, {"w": "and", "b": [0.6865, 0.3397, 0.723, 0.3594]}, {"w": "the", "b": [0.7293, 0.3397, 0.7601, 0.3594]}, {"w": "generated", "b": [0.7664, 0.3397, 0.8645, 0.3594]}, {"w": "image.", "b": [0.1294, 0.3602, 0.1974, 0.3799]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 8.17. Content loss", "words": [{"w": "Listing", "b": [0.1294, 0.4025, 0.1862, 0.4173]}, {"w": "8.17.", "b": [0.1909, 0.4025, 0.2288, 0.4173]}, {"w": "Content", "b": [0.2335, 0.4025, 0.2986, 0.4173]}, {"w": "loss", "b": [0.3034, 0.4025, 0.3328, 0.4173]}]}, {"id": "b_4", "type": "equation", "text": "def content_loss(base, combination): return K.sum(K.square(combination - base))", "words": [{"w": "def", "b": [0.1357, 0.4309, 0.1698, 0.4461]}, {"w": "content_loss(base,", "b": [0.1811, 0.4309, 0.3855, 0.4461]}, {"w": "combination):", "b": [0.3968, 0.4309, 0.5444, 0.4461]}, {"w": "return", "b": [0.1811, 0.4461, 0.2492, 0.4612]}, {"w": "K.sum(K.square(combination", "b": [0.2606, 0.4461, 0.5557, 0.4612]}, {"w": "-", "b": [0.5671, 0.4461, 0.5784, 0.4612]}, {"w": "base))", "b": [0.5898, 0.4461, 0.6579, 0.4612]}]}, {"id": "b_5", "type": "paragraph", "text": "Next is the style loss. It uses an auxiliary function to compute the Gram matrix of an input matrix: a map of the correlations found in the original feature matrix.", "words": [{"w": "Next", "b": [0.1294, 0.4841, 0.1785, 0.5038]}, {"w": "is", "b": [0.1848, 0.4841, 0.2016, 0.5038]}, {"w": "the", "b": [0.2079, 0.4841, 0.2387, 0.5038]}, {"w": "style", "b": [0.245, 0.4841, 0.2927, 0.5038]}, {"w": "loss.", "b": [0.299, 0.4841, 0.3445, 0.5038]}, {"w": "It", "b": [0.3508, 0.4841, 0.3663, 0.5038]}, {"w": "uses", "b": [0.3726, 0.4841, 0.416, 0.5038]}, {"w": "an", "b": [0.4223, 0.4841, 0.4461, 0.5038]}, {"w": "auxiliary", "b": [0.4524, 0.4841, 0.5421, 0.5038]}, {"w": "function", "b": [0.5484, 0.4841, 0.6325, 0.5038]}, {"w": "to", "b": [0.6388, 0.4841, 0.6584, 0.5038]}, {"w": "compute", "b": [0.6647, 0.4841, 0.7516, 0.5038]}, {"w": "the", "b": [0.7579, 0.4841, 0.7887, 0.5038]}, {"w": "Gram", "b": [0.795, 0.4841, 0.8525, 0.5038]}, {"w": "matrix", "b": [0.1294, 0.5046, 0.1953, 0.5243]}, {"w": "of", "b": [0.2016, 0.5046, 0.2226, 0.5243]}, {"w": "an", "b": [0.2289, 0.5046, 0.2527, 0.5243]}, {"w": "input", "b": [0.259, 0.5046, 0.3109, 0.5243]}, {"w": "matrix:", "b": [0.3172, 0.5046, 0.3901, 0.5243]}, {"w": "a", "b": [0.3964, 0.5046, 0.4076, 0.5243]}, {"w": "map", "b": [0.4139, 0.5046, 0.4573, 0.5243]}, {"w": "of", "b": [0.4636, 0.5046, 0.4846, 0.5243]}, {"w": "the", "b": [0.4909, 0.5046, 0.5218, 0.5243]}, {"w": "correlations", "b": [0.5281, 0.5046, 0.6472, 0.5243]}, {"w": "found", "b": [0.6534, 0.5046, 0.7122, 0.5243]}, {"w": "in", "b": [0.7185, 0.5046, 0.7382, 0.5243]}, {"w": "the", "b": [0.7445, 0.5046, 0.7753, 0.5243]}, {"w": "original", "b": [0.7816, 0.5046, 0.8601, 0.5243]}, {"w": "feature", "b": [0.1294, 0.5251, 0.1994, 0.5448]}, {"w": "matrix.", "b": [0.2057, 0.5251, 0.2779, 0.5448]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 8.18. Style loss", "words": [{"w": "Listing", "b": [0.1294, 0.5629, 0.1862, 0.5777]}, {"w": "8.18.", "b": [0.1909, 0.5629, 0.2288, 0.5777]}, {"w": "Style", "b": [0.2335, 0.5629, 0.2734, 0.5777]}, {"w": "loss", "b": [0.2781, 0.5629, 0.3076, 0.5777]}]}, {"id": "b_7", "type": "paragraph", "text": "def gram_matrix(x): features = K.batch_flatten(K.permute_dimensions(x, (2, 0, 1))) gram = K.dot(features, K.transpose(features)) return gram def style_loss(style, combination): S = gram_matrix(style) C = gram_matrix(combination) channels = 3 size = img_height * img_width return K.sum(K.square(S - C)) / (4. * (channels ** 2) * (size ** 2))", "words": [{"w": "def", "b": [0.1357, 0.5914, 0.1698, 0.6065]}, {"w": "gram_matrix(x):", "b": [0.1811, 0.5914, 0.3514, 0.6065]}, {"w": "features", "b": [0.1811, 0.6065, 0.2719, 0.6216]}, {"w": "=", "b": [0.2833, 0.6065, 0.2946, 0.6216]}, {"w": "K.batch_flatten(K.permute_dimensions(x,", "b": [0.306, 0.6065, 0.7487, 0.6216]}, {"w": "(2,", "b": [0.7601, 0.6065, 0.7941, 0.6216]}, {"w": "0,", "b": [0.8055, 0.6065, 0.8282, 0.6216]}, {"w": "1)))", "b": [0.1357, 0.6217, 0.1811, 0.6368]}, {"w": "gram", "b": [0.1811, 0.6368, 0.2265, 0.652]}, {"w": "=", "b": [0.2379, 0.6368, 0.2492, 0.652]}, {"w": "K.dot(features,", "b": [0.2606, 0.6368, 0.4309, 0.652]}, {"w": "K.transpose(features))", "b": [0.4422, 0.6368, 0.6919, 0.652]}, {"w": "return", "b": [0.1811, 0.652, 0.2492, 0.6671]}, {"w": "gram", "b": [0.2606, 0.652, 0.306, 0.6671]}, {"w": "def", "b": [0.1357, 0.6823, 0.1698, 0.6974]}, {"w": "style_loss(style,", "b": [0.1811, 0.6823, 0.3741, 0.6974]}, {"w": "combination):", "b": [0.3855, 0.6823, 0.533, 0.6974]}, {"w": "S", "b": [0.1811, 0.6974, 0.1925, 0.7126]}, {"w": "=", "b": [0.2038, 0.6974, 0.2152, 0.7126]}, {"w": "gram_matrix(style)", "b": [0.2265, 0.6974, 0.4309, 0.7126]}, {"w": "C", "b": [0.1811, 0.7126, 0.1925, 0.7277]}, {"w": "=", "b": [0.2038, 0.7126, 0.2152, 0.7277]}, {"w": "gram_matrix(combination)", "b": [0.2265, 0.7126, 0.499, 0.7277]}, {"w": "channels", "b": [0.1811, 0.7277, 0.2719, 0.7429]}, {"w": "=", "b": [0.2833, 0.7277, 0.2946, 0.7429]}, {"w": "3", "b": [0.306, 0.7277, 0.3173, 0.7429]}, {"w": "size", "b": [0.1811, 0.7429, 0.2265, 0.758]}, {"w": "=", "b": [0.2379, 0.7429, 0.2492, 0.758]}, {"w": "img_height", "b": [0.2606, 0.7429, 0.3741, 0.758]}, {"w": "*", "b": [0.3855, 0.7429, 0.3968, 0.758]}, {"w": "img_width", "b": [0.4082, 0.7429, 0.5103, 0.758]}, {"w": "return", "b": [0.1811, 0.758, 0.2492, 0.7732]}, {"w": "K.sum(K.square(S", "b": [0.2606, 0.758, 0.4422, 0.7732]}, {"w": "-", "b": [0.4536, 0.758, 0.4649, 0.7732]}, {"w": "C))", "b": [0.4763, 0.758, 0.5103, 0.7732]}, {"w": "/", "b": [0.5217, 0.758, 0.533, 0.7732]}, {"w": "(4.", "b": [0.5444, 0.758, 0.5784, 0.7732]}, {"w": "*", "b": [0.5898, 0.758, 0.6011, 0.7732]}, {"w": "(channels", "b": [0.6125, 0.758, 0.7146, 0.7732]}, {"w": "**", "b": [0.726, 0.758, 0.7487, 0.7732]}, {"w": "2)", "b": [0.7601, 0.758, 0.7828, 0.7732]}, {"w": "*", "b": [0.7941, 0.758, 0.8055, 0.7732]}, {"w": "(size", "b": [0.1357, 0.7732, 0.1925, 0.7883]}, {"w": "**", "b": [0.2038, 0.7732, 0.2265, 0.7883]}, {"w": "2))", "b": [0.2379, 0.7732, 0.2719, 0.7883]}]}, {"id": "b_8", "type": "paragraph", "text": "To these two loss components, you add a third: the total variation loss, which operates on the pixels of the generated combination image. It encourages spatial continuity in the generated image, thus avoiding overly pixelated results. You can interpret it as a regularization loss.", "words": [{"w": "To", "b": [0.1294, 0.8112, 0.1557, 0.8309]}, {"w": "these", "b": [0.162, 0.8112, 0.2138, 0.8309]}, {"w": "two", "b": [0.2201, 0.8112, 0.258, 0.8309]}, {"w": "loss", "b": [0.2643, 0.8112, 0.3035, 0.8309]}, {"w": "components,", "b": [0.3098, 0.8112, 0.438, 0.8309]}, {"w": "you", "b": [0.4444, 0.8112, 0.4822, 0.8309]}, {"w": "add", "b": [0.4885, 0.8112, 0.5249, 0.8309]}, {"w": "a", "b": [0.5312, 0.8112, 0.5424, 0.8309]}, {"w": "third:", "b": [0.5487, 0.8112, 0.6034, 0.8309]}, {"w": "the", "b": [0.6097, 0.8112, 0.6405, 0.8309]}, {"w": "total", "b": [0.6468, 0.8112, 0.6931, 0.8309]}, {"w": "variation", "b": [0.6994, 0.8112, 0.7919, 0.8309]}, {"w": "loss,", "b": [0.7982, 0.8112, 0.8437, 0.8309]}, {"w": "which", "b": [0.1294, 0.8317, 0.1911, 0.8514]}, {"w": "operates", "b": [0.1974, 0.8317, 0.2814, 0.8514]}, {"w": "on", "b": [0.2877, 0.8317, 0.313, 0.8514]}, {"w": "the", "b": [0.3193, 0.8317, 0.3501, 0.8514]}, {"w": "pixels", "b": [0.3564, 0.8317, 0.4167, 0.8514]}, {"w": "of", "b": [0.423, 0.8317, 0.444, 0.8514]}, {"w": "the", "b": [0.4503, 0.8317, 0.4811, 0.8514]}, {"w": "generated", "b": [0.4874, 0.8317, 0.5855, 0.8514]}, {"w": "combination", "b": [0.5918, 0.8317, 0.7179, 0.8514]}, {"w": "image.", "b": [0.7242, 0.8317, 0.7922, 0.8514]}, {"w": "It", "b": [0.7985, 0.8317, 0.8139, 0.8514]}, {"w": "encourages", "b": [0.1294, 0.8522, 0.2429, 0.8719]}, {"w": "spatial", "b": [0.2492, 0.8522, 0.315, 0.8719]}, {"w": "continuity", "b": [0.3214, 0.8522, 0.4237, 0.8719]}, {"w": "in", "b": [0.43, 0.8522, 0.4496, 0.8719]}, {"w": "the", "b": [0.4559, 0.8522, 0.4867, 0.8719]}, {"w": "generated", "b": [0.493, 0.8522, 0.5911, 0.8719]}, {"w": "image,", "b": [0.5974, 0.8522, 0.6654, 0.8719]}, {"w": "thus", "b": [0.6716, 0.8522, 0.7136, 0.8719]}, {"w": "avoiding", "b": [0.7199, 0.8522, 0.8082, 0.8719]}, {"w": "overly", "b": [0.1294, 0.8727, 0.1939, 0.8924]}, {"w": "pixelated", "b": [0.2002, 0.8727, 0.2926, 0.8924]}, {"w": "results.", "b": [0.299, 0.8727, 0.3711, 0.8924]}, {"w": "You", "b": [0.3774, 0.8727, 0.4183, 0.8924]}, {"w": "can", "b": [0.4246, 0.8727, 0.4596, 0.8924]}, {"w": "interpret", "b": [0.4659, 0.8727, 0.5514, 0.8924]}, {"w": "it", "b": [0.5577, 0.8727, 0.5717, 0.8924]}, {"w": "as", "b": [0.578, 0.8727, 0.5991, 0.8924]}, {"w": "a", "b": [0.6054, 0.8727, 0.6166, 0.8924]}, {"w": "regularization", "b": [0.6229, 0.8727, 0.763, 0.8924]}, {"w": "loss.", "b": [0.7693, 0.8727, 0.8148, 0.8924]}]}]}, {"page": 381, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 8.19. Total variation loss", "words": [{"w": "Listing", "b": [0.1294, 0.0852, 0.1862, 0.1]}, {"w": "8.19.", "b": [0.1909, 0.0852, 0.2288, 0.1]}, {"w": "Total", "b": [0.2335, 0.0852, 0.2748, 0.1]}, {"w": "variation", "b": [0.2796, 0.0852, 0.3531, 0.1]}, {"w": "loss", "b": [0.3579, 0.0852, 0.3873, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "def total_variation_loss(x): a = K.square( x[:, :img_height - 1, :img_width - 1, :] - x[:, 1:, :img_width - 1, :]) b = K.square( x[:, :img_height - 1, :img_width - 1, :] - x[:, :img_height - 1, 1:, :]) return K.sum(K.pow(a + b, 1.25))", "words": [{"w": "def", "b": [0.1357, 0.1136, 0.1698, 0.1288]}, {"w": "total_variation_loss(x):", "b": [0.1811, 0.1136, 0.4536, 0.1288]}, {"w": "a", "b": [0.1811, 0.1288, 0.1925, 0.1439]}, {"w": "=", "b": [0.2038, 0.1288, 0.2152, 0.1439]}, {"w": "K.square(", "b": [0.2265, 0.1288, 0.3287, 0.1439]}, {"w": "x[:,", "b": [0.2265, 0.1439, 0.2719, 0.1591]}, {"w": ":img_height", "b": [0.2833, 0.1439, 0.4082, 0.1591]}, {"w": "-", "b": [0.4195, 0.1439, 0.4309, 0.1591]}, {"w": "1,", "b": [0.4422, 0.1439, 0.4649, 0.1591]}, {"w": ":img_width", "b": [0.4763, 0.1439, 0.5898, 0.1591]}, {"w": "-", "b": [0.6011, 0.1439, 0.6125, 0.1591]}, {"w": "1,", "b": [0.6238, 0.1439, 0.6465, 0.1591]}, {"w": ":]", "b": [0.6579, 0.1439, 0.6806, 0.1591]}, {"w": "-", "b": [0.6919, 0.1439, 0.7033, 0.1591]}, {"w": "x[:,", "b": [0.2265, 0.1591, 0.2719, 0.1742]}, {"w": "1:,", "b": [0.2833, 0.1591, 0.3173, 0.1742]}, {"w": ":img_width", "b": [0.3287, 0.1591, 0.4422, 0.1742]}, {"w": "-", "b": [0.4536, 0.1591, 0.4649, 0.1742]}, {"w": "1,", "b": [0.4763, 0.1591, 0.499, 0.1742]}, {"w": ":])", "b": [0.5103, 0.1591, 0.5444, 0.1742]}, {"w": "b", "b": [0.1811, 0.1742, 0.1925, 0.1894]}, {"w": "=", "b": [0.2038, 0.1742, 0.2152, 0.1894]}, {"w": "K.square(", "b": [0.2265, 0.1742, 0.3287, 0.1894]}, {"w": "x[:,", "b": [0.2265, 0.1894, 0.2719, 0.2045]}, {"w": ":img_height", "b": [0.2833, 0.1894, 0.4082, 0.2045]}, {"w": "-", "b": [0.4195, 0.1894, 0.4309, 0.2045]}, {"w": "1,", "b": [0.4422, 0.1894, 0.4649, 0.2045]}, {"w": ":img_width", "b": [0.4763, 0.1894, 0.5898, 0.2045]}, {"w": "-", "b": [0.6011, 0.1894, 0.6125, 0.2045]}, {"w": "1,", "b": [0.6238, 0.1894, 0.6465, 0.2045]}, {"w": ":]", "b": [0.6579, 0.1894, 0.6806, 0.2045]}, {"w": "-", "b": [0.6919, 0.1894, 0.7033, 0.2045]}, {"w": "x[:,", "b": [0.2265, 0.2045, 0.2719, 0.2197]}, {"w": ":img_height", "b": [0.2833, 0.2045, 0.4082, 0.2197]}, {"w": "-", "b": [0.4195, 0.2045, 0.4309, 0.2197]}, {"w": "1,", "b": [0.4422, 0.2045, 0.4649, 0.2197]}, {"w": "1:,", "b": [0.4763, 0.2045, 0.5103, 0.2197]}, {"w": ":])", "b": [0.5217, 0.2045, 0.5557, 0.2197]}, {"w": "return", "b": [0.1811, 0.2197, 0.2492, 0.2348]}, {"w": "K.sum(K.pow(a", "b": [0.2606, 0.2197, 0.4082, 0.2348]}, {"w": "+", "b": [0.4195, 0.2197, 0.4309, 0.2348]}, {"w": "b,", "b": [0.4422, 0.2197, 0.4649, 0.2348]}, {"w": "1.25))", "b": [0.4763, 0.2197, 0.5444, 0.2348]}]}, {"id": "b_2", "type": "paragraph", "text": "The loss that you minimize is a weighted average of these three losses. To compute the content loss, you use only one upper layer—the block5_conv2 layer—whereas for the style loss, you use a list of layers than spans both low-level and high-level layers. You add the total variation loss at the end.", "words": [{"w": "The", "b": [0.1294, 0.2577, 0.1686, 0.2774]}, {"w": "loss", "b": [0.1749, 0.2577, 0.2142, 0.2774]}, {"w": "that", "b": [0.2205, 0.2577, 0.2583, 0.2774]}, {"w": "you", "b": [0.2646, 0.2577, 0.3025, 0.2774]}, {"w": "minimize", "b": [0.3088, 0.2577, 0.4041, 0.2774]}, {"w": "is", "b": [0.4104, 0.2577, 0.4272, 0.2774]}, {"w": "a", "b": [0.4335, 0.2577, 0.4447, 0.2774]}, {"w": "weighted", "b": [0.451, 0.2577, 0.5435, 0.2774]}, {"w": "average", "b": [0.5498, 0.2577, 0.6283, 0.2774]}, {"w": "of", "b": [0.6346, 0.2577, 0.6556, 0.2774]}, {"w": "these", "b": [0.6619, 0.2577, 0.7137, 0.2774]}, {"w": "three", "b": [0.72, 0.2577, 0.7704, 0.2774]}, {"w": "losses.", "b": [0.7768, 0.2577, 0.8433, 0.2774]}, {"w": "To", "b": [0.1294, 0.2782, 0.1557, 0.2979]}, {"w": "compute", "b": [0.162, 0.2782, 0.2489, 0.2979]}, {"w": "the", "b": [0.2552, 0.2782, 0.286, 0.2979]}, {"w": "content", "b": [0.2923, 0.2782, 0.3666, 0.2979]}, {"w": "loss,", "b": [0.3729, 0.2782, 0.4184, 0.2979]}, {"w": "you", "b": [0.4247, 0.2782, 0.4626, 0.2979]}, {"w": "use", "b": [0.4689, 0.2782, 0.5025, 0.2979]}, {"w": "only", "b": [0.5088, 0.2782, 0.5537, 0.2979]}, {"w": "one", "b": [0.56, 0.2782, 0.5964, 0.2979]}, {"w": "upper", "b": [0.6027, 0.2782, 0.6601, 0.2979]}, {"w": "layer—the", "b": [0.6664, 0.2782, 0.7729, 0.2979]}, {"w": "block5_conv2", "b": [0.1294, 0.2997, 0.311, 0.3199]}, {"w": "layer—whereas", "b": [0.3174, 0.2987, 0.4757, 0.3184]}, {"w": "for", "b": [0.482, 0.2987, 0.5114, 0.3184]}, {"w": "the", "b": [0.5177, 0.2987, 0.5485, 0.3184]}, {"w": "style", "b": [0.5548, 0.2987, 0.6025, 0.3184]}, {"w": "loss,", "b": [0.6088, 0.2987, 0.6543, 0.3184]}, {"w": "you", "b": [0.6606, 0.2987, 0.6985, 0.3184]}, {"w": "use", "b": [0.7048, 0.2987, 0.7384, 0.3184]}, {"w": "a", "b": [0.7447, 0.2987, 0.7559, 0.3184]}, {"w": "list", "b": [0.7622, 0.2987, 0.7931, 0.3184]}, {"w": "of", "b": [0.7994, 0.2987, 0.8204, 0.3184]}, {"w": "layers", "b": [0.1294, 0.3201, 0.1897, 0.3398]}, {"w": "than", "b": [0.196, 0.3201, 0.2394, 0.3398]}, {"w": "spans", "b": [0.2457, 0.3201, 0.3018, 0.3398]}, {"w": "both", "b": [0.3081, 0.3201, 0.3529, 0.3398]}, {"w": "low-level", "b": [0.3592, 0.3201, 0.4545, 0.3398]}, {"w": "and", "b": [0.4608, 0.3201, 0.4972, 0.3398]}, {"w": "high-level", "b": [0.5035, 0.3201, 0.6058, 0.3398]}, {"w": "layers.", "b": [0.6121, 0.3201, 0.6787, 0.3398]}, {"w": "You", "b": [0.685, 0.3201, 0.7258, 0.3398]}, {"w": "add", "b": [0.7321, 0.3201, 0.7686, 0.3398]}, {"w": "the", "b": [0.7749, 0.3201, 0.8057, 0.3398]}, {"w": "total", "b": [0.812, 0.3201, 0.8569, 0.3398]}, {"w": "variation", "b": [0.1294, 0.3406, 0.2191, 0.3603]}, {"w": "loss", "b": [0.2254, 0.3406, 0.2646, 0.3603]}, {"w": "at", "b": [0.271, 0.3406, 0.2892, 0.3603]}, {"w": "the", "b": [0.2955, 0.3406, 0.3263, 0.3603]}, {"w": "end.", "b": [0.3326, 0.3406, 0.3753, 0.3603]}]}, {"id": "b_3", "type": "paragraph", "text": "Depending on the style-reference image and content image you’re using, you’ll likely want to tune the content_weight coefficient (the contribution of the content loss to the total loss). A higher content_weight means the target content will be more recognizable in the generated image.", "words": [{"w": "Depending", "b": [0.1294, 0.3834, 0.2401, 0.4031]}, {"w": "on", "b": [0.2464, 0.3834, 0.2716, 0.4031]}, {"w": "the", "b": [0.2779, 0.3834, 0.3088, 0.4031]}, {"w": "style-reference", "b": [0.3151, 0.3834, 0.4649, 0.4031]}, {"w": "image", "b": [0.4712, 0.3834, 0.5329, 0.4031]}, {"w": "and", "b": [0.5392, 0.3834, 0.5756, 0.4031]}, {"w": "content", "b": [0.5819, 0.3834, 0.6562, 0.4031]}, {"w": "image", "b": [0.6625, 0.3834, 0.7242, 0.4031]}, {"w": "you’re", "b": [0.7305, 0.3834, 0.7963, 0.4031]}, {"w": "using,", "b": [0.8026, 0.3834, 0.8636, 0.4031]}, {"w": "you’ll", "b": [0.1294, 0.4039, 0.1897, 0.4236]}, {"w": "likely", "b": [0.196, 0.4039, 0.2534, 0.4236]}, {"w": "want", "b": [0.2598, 0.4039, 0.3088, 0.4236]}, {"w": "to", "b": [0.3151, 0.4039, 0.3347, 0.4236]}, {"w": "tune", "b": [0.341, 0.4039, 0.3845, 0.4236]}, {"w": "the", "b": [0.3908, 0.4039, 0.4216, 0.4236]}, {"w": "content_weight", "b": [0.4278, 0.4049, 0.6397, 0.4251]}, {"w": "coefficient", "b": [0.6461, 0.4039, 0.7535, 0.4236]}, {"w": "(the", "b": [0.7598, 0.4039, 0.799, 0.4236]}, {"w": "contribution", "b": [0.1294, 0.4253, 0.2527, 0.445]}, {"w": "of", "b": [0.259, 0.4253, 0.2801, 0.445]}, {"w": "the", "b": [0.2864, 0.4253, 0.3172, 0.445]}, {"w": "content", "b": [0.3235, 0.4253, 0.3978, 0.445]}, {"w": "loss", "b": [0.4041, 0.4253, 0.4433, 0.445]}, {"w": "to", "b": [0.4496, 0.4253, 0.4693, 0.445]}, {"w": "the", "b": [0.4756, 0.4253, 0.5064, 0.445]}, {"w": "total", "b": [0.5127, 0.4253, 0.5575, 0.445]}, {"w": "loss).", "b": [0.5639, 0.4253, 0.6178, 0.445]}, {"w": "A", "b": [0.6241, 0.4253, 0.6423, 0.445]}, {"w": "higher", "b": [0.6486, 0.4253, 0.7131, 0.445]}, {"w": "content_weight", "b": [0.1294, 0.4468, 0.3413, 0.467]}, {"w": "means", "b": [0.3476, 0.4458, 0.4121, 0.4655]}, {"w": "the", "b": [0.4184, 0.4458, 0.4492, 0.4655]}, {"w": "target", "b": [0.4555, 0.4458, 0.5125, 0.4655]}, {"w": "content", "b": [0.5188, 0.4458, 0.5931, 0.4655]}, {"w": "will", "b": [0.5994, 0.4458, 0.6386, 0.4655]}, {"w": "be", "b": [0.6449, 0.4458, 0.6687, 0.4655]}, {"w": "more", "b": [0.675, 0.4458, 0.7269, 0.4655]}, {"w": "recognizable", "b": [0.7332, 0.4458, 0.8621, 0.4655]}, {"w": "in", "b": [0.1294, 0.4672, 0.149, 0.4869]}, {"w": "the", "b": [0.1553, 0.4672, 0.1862, 0.4869]}, {"w": "generated", "b": [0.1925, 0.4672, 0.2905, 0.4869]}, {"w": "image.", "b": [0.2968, 0.4672, 0.3648, 0.4869]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 8.20. Defining the final loss that you’ll minimize", "words": [{"w": "Listing", "b": [0.1294, 0.505, 0.1862, 0.5198]}, {"w": "8.20.", "b": [0.1909, 0.505, 0.2288, 0.5198]}, {"w": "Defining", "b": [0.2335, 0.505, 0.3028, 0.5198]}, {"w": "the", "b": [0.3076, 0.505, 0.3328, 0.5198]}, {"w": "final", "b": [0.3375, 0.505, 0.3743, 0.5198]}, {"w": "loss", "b": [0.3791, 0.505, 0.4085, 0.5198]}, {"w": "that", "b": [0.4132, 0.505, 0.4458, 0.5198]}, {"w": "you’ll", "b": [0.4505, 0.505, 0.4968, 0.5198]}, {"w": "minimize", "b": [0.5015, 0.505, 0.5761, 0.5198]}]}, {"id": "b_5", "type": "paragraph", "text": "outputs_dict = dict([(layer.name, layer.output) for layer in model.layers])1 content_layer = 'block5_conv2' 2 style_layers = ['block1_conv1', 3 'block2_conv1', 3 'block3_conv1', 3 'block4_conv1', 3 'block5_conv1'] 3 total_variation_weight = 1e-4 4 style_weight = 1. 4 content_weight = 0.025 4 loss = K.variable(0.) 56 layer_features = outputs_dict[content_layer] 6", "words": [{"w": "outputs_dict", "b": [0.1357, 0.5334, 0.2719, 0.5486]}, {"w": "=", "b": [0.2833, 0.5334, 0.2946, 0.5486]}, {"w": "dict([(layer.name,", "b": [0.306, 0.5334, 0.5103, 0.5486]}, {"w": "layer.output)", "b": [0.5217, 0.5334, 0.6692, 0.5486]}, {"w": "for", "b": [0.6806, 0.5334, 0.7146, 0.5486]}, {"w": "layer", "b": [0.726, 0.5334, 0.7828, 0.5486]}, {"w": "in", "b": [0.7941, 0.5334, 0.8168, 0.5486]}, {"w": "model.layers])1", "b": [0.1357, 0.5486, 0.306, 0.5637]}, {"w": "content_layer", "b": [0.1357, 0.5637, 0.2833, 0.5789]}, {"w": "=", "b": [0.2946, 0.5637, 0.306, 0.5789]}, {"w": "'block5_conv2'", "b": [0.3173, 0.5637, 0.4763, 0.5789]}, {"w": "2", "b": [0.1357, 0.5789, 0.1471, 0.594]}, {"w": "style_layers", "b": [0.1357, 0.594, 0.2719, 0.6092]}, {"w": "=", "b": [0.2833, 0.594, 0.2946, 0.6092]}, {"w": "['block1_conv1',", "b": [0.306, 0.594, 0.4876, 0.6092]}, {"w": "3", "b": [0.1357, 0.6092, 0.1471, 0.6243]}, {"w": "'block2_conv1',", "b": [0.3173, 0.6243, 0.4876, 0.6395]}, {"w": "3", "b": [0.1357, 0.6395, 0.1471, 0.6546]}, {"w": "'block3_conv1',", "b": [0.3173, 0.6546, 0.4876, 0.6698]}, {"w": "3", "b": [0.1357, 0.6698, 0.1471, 0.6849]}, {"w": "'block4_conv1',", "b": [0.3173, 0.6849, 0.4876, 0.7001]}, {"w": "3", "b": [0.1357, 0.7001, 0.1471, 0.7152]}, {"w": "'block5_conv1']", "b": [0.3173, 0.7152, 0.4876, 0.7304]}, {"w": "3", "b": [0.1357, 0.7304, 0.1471, 0.7455]}, {"w": "total_variation_weight", "b": [0.1357, 0.7455, 0.3855, 0.7607]}, {"w": "=", "b": [0.3968, 0.7455, 0.4082, 0.7607]}, {"w": "1e-4", "b": [0.4195, 0.7455, 0.4649, 0.7607]}, {"w": "4", "b": [0.1357, 0.7607, 0.1471, 0.7758]}, {"w": "style_weight", "b": [0.1357, 0.7759, 0.2719, 0.791]}, {"w": "=", "b": [0.2833, 0.7759, 0.2946, 0.791]}, {"w": "1.", "b": [0.306, 0.7759, 0.3287, 0.791]}, {"w": "4", "b": [0.1357, 0.791, 0.1471, 0.8062]}, {"w": "content_weight", "b": [0.1357, 0.8062, 0.2946, 0.8213]}, {"w": "=", "b": [0.306, 0.8062, 0.3173, 0.8213]}, {"w": "0.025", "b": [0.3287, 0.8062, 0.3855, 0.8213]}, {"w": "4", "b": [0.1357, 0.8213, 0.1471, 0.8365]}, {"w": "loss", "b": [0.1357, 0.8516, 0.1811, 0.8668]}, {"w": "=", "b": [0.1925, 0.8516, 0.2038, 0.8668]}, {"w": "K.variable(0.)", "b": [0.2152, 0.8516, 0.3741, 0.8668]}, {"w": "56", "b": [0.1357, 0.8668, 0.1584, 0.8819]}, {"w": "layer_features", "b": [0.1357, 0.8819, 0.2946, 0.8971]}, {"w": "=", "b": [0.306, 0.8819, 0.3173, 0.8971]}, {"w": "outputs_dict[content_layer]", "b": [0.3287, 0.8819, 0.6352, 0.8971]}, {"w": "6", "b": [0.1357, 0.8971, 0.1471, 0.9122]}]}]}, {"page": 382, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "target_image_features = layer_features[0, :, :, :] 6 combination_features = layer_features[2, :, :, :] 6 loss += content_weight * content_loss(target_image_features, 6 combination_features) 6 for layer_name in style_layers: 7 layer_features = outputs_dict[layer_name] style_reference_features = layer_features[1, :, :, :] combination_features = layer_features[2, :, :, :] sl = style_loss(style_reference_features, combination_features) loss += (style_weight / len(style_layers)) * sl loss += total_variation_weight * total_variation_loss(combination_image) 8", "words": [{"w": "target_image_features", "b": [0.1357, 0.0851, 0.3741, 0.1002]}, {"w": "=", "b": [0.3855, 0.0851, 0.3968, 0.1002]}, {"w": "layer_features[0,", "b": [0.4082, 0.0851, 0.6011, 0.1002]}, {"w": ":,", "b": [0.6125, 0.0851, 0.6352, 0.1002]}, {"w": ":,", "b": [0.6465, 0.0851, 0.6692, 0.1002]}, {"w": ":]", "b": [0.6806, 0.0851, 0.7033, 0.1002]}, {"w": "6", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "combination_features", "b": [0.1357, 0.1154, 0.3628, 0.1305]}, {"w": "=", "b": [0.3741, 0.1154, 0.3855, 0.1305]}, {"w": "layer_features[2,", "b": [0.3968, 0.1154, 0.5898, 0.1305]}, {"w": ":,", "b": [0.6011, 0.1154, 0.6238, 0.1305]}, {"w": ":,", "b": [0.6352, 0.1154, 0.6579, 0.1305]}, {"w": ":]", "b": [0.6692, 0.1154, 0.6919, 0.1305]}, {"w": "6", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "loss", "b": [0.1357, 0.1457, 0.1811, 0.1608]}, {"w": "+=", "b": [0.1925, 0.1457, 0.2152, 0.1608]}, {"w": "content_weight", "b": [0.2265, 0.1457, 0.3855, 0.1608]}, {"w": "*", "b": [0.3968, 0.1457, 0.4082, 0.1608]}, {"w": "content_loss(target_image_features,", "b": [0.4195, 0.1457, 0.8168, 0.1608]}, {"w": "6", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "combination_features)", "b": [0.5671, 0.176, 0.8055, 0.1911]}, {"w": "6", "b": [0.1357, 0.1912, 0.1471, 0.2063]}, {"w": "for", "b": [0.1357, 0.2063, 0.1698, 0.2214]}, {"w": "layer_name", "b": [0.1811, 0.2063, 0.2946, 0.2214]}, {"w": "in", "b": [0.306, 0.2063, 0.3287, 0.2214]}, {"w": "style_layers:", "b": [0.34, 0.2063, 0.4876, 0.2214]}, {"w": "7", "b": [0.1357, 0.2215, 0.1471, 0.2366]}, {"w": "layer_features", "b": [0.1811, 0.2366, 0.34, 0.2518]}, {"w": "=", "b": [0.3514, 0.2366, 0.3628, 0.2518]}, {"w": "outputs_dict[layer_name]", "b": [0.3741, 0.2366, 0.6465, 0.2518]}, {"w": "style_reference_features", "b": [0.1811, 0.2518, 0.4536, 0.2669]}, {"w": "=", "b": [0.4649, 0.2518, 0.4763, 0.2669]}, {"w": "layer_features[1,", "b": [0.4876, 0.2518, 0.6806, 0.2669]}, {"w": ":,", "b": [0.6919, 0.2518, 0.7146, 0.2669]}, {"w": ":,", "b": [0.726, 0.2518, 0.7487, 0.2669]}, {"w": ":]", "b": [0.7601, 0.2518, 0.7828, 0.2669]}, {"w": "combination_features", "b": [0.1811, 0.2669, 0.4082, 0.2821]}, {"w": "=", "b": [0.4195, 0.2669, 0.4309, 0.2821]}, {"w": "layer_features[2,", "b": [0.4422, 0.2669, 0.6352, 0.2821]}, {"w": ":,", "b": [0.6465, 0.2669, 0.6692, 0.2821]}, {"w": ":,", "b": [0.6806, 0.2669, 0.7033, 0.2821]}, {"w": ":]", "b": [0.7146, 0.2669, 0.7374, 0.2821]}, {"w": "sl", "b": [0.1811, 0.2821, 0.2038, 0.2972]}, {"w": "=", "b": [0.2152, 0.2821, 0.2265, 0.2972]}, {"w": "style_loss(style_reference_features,", "b": [0.2379, 0.2821, 0.6465, 0.2972]}, {"w": "combination_features)", "b": [0.1357, 0.2972, 0.3741, 0.3124]}, {"w": "loss", "b": [0.1811, 0.3124, 0.2265, 0.3275]}, {"w": "+=", "b": [0.2379, 0.3124, 0.2606, 0.3275]}, {"w": "(style_weight", "b": [0.2719, 0.3124, 0.4195, 0.3275]}, {"w": "/", "b": [0.4309, 0.3124, 0.4422, 0.3275]}, {"w": "len(style_layers))", "b": [0.4536, 0.3124, 0.6579, 0.3275]}, {"w": "*", "b": [0.6692, 0.3124, 0.6806, 0.3275]}, {"w": "sl", "b": [0.6919, 0.3124, 0.7146, 0.3275]}, {"w": "loss", "b": [0.1357, 0.3427, 0.1811, 0.3578]}, {"w": "+=", "b": [0.1925, 0.3427, 0.2152, 0.3578]}, {"w": "total_variation_weight", "b": [0.2265, 0.3427, 0.4763, 0.3578]}, {"w": "*", "b": [0.4876, 0.3427, 0.499, 0.3578]}, {"w": "total_variation_loss(combination_image)", "b": [0.1357, 0.3578, 0.5784, 0.373]}, {"w": "8", "b": [0.6125, 0.3578, 0.6239, 0.373]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Dictionary that maps layer names to activation tensors 2 Layer used for content loss 3 Layers used for style loss 4 Weights in the weighted average of the loss components 5 You’ll define the loss by adding all components to this scalar variable. 6 Adds the content loss 7 Adds a style loss component for each target layer 8 Adds the total variation loss", "words": [{"w": "1", "b": [0.1799, 0.3914, 0.1925, 0.4111]}, {"w": "Dictionary", "b": [0.1988, 0.3914, 0.3137, 0.4111]}, {"w": "that", "b": [0.32, 0.3914, 0.3634, 0.4111]}, {"w": "maps", "b": [0.3697, 0.3914, 0.4272, 0.4111]}, {"w": "layer", "b": [0.4335, 0.3914, 0.4881, 0.4111]}, {"w": "names", "b": [0.4945, 0.3914, 0.5631, 0.4111]}, {"w": "to", "b": [0.5694, 0.3914, 0.5904, 0.4111]}, {"w": "activation", "b": [0.5967, 0.3914, 0.7032, 0.4111]}, {"w": "tensors", "b": [0.7096, 0.3914, 0.7866, 0.4111]}, {"w": "2", "b": [0.1799, 0.4119, 0.1925, 0.4316]}, {"w": "Layer", "b": [0.1988, 0.4119, 0.2632, 0.4316]}, {"w": "used", "b": [0.2695, 0.4119, 0.3186, 0.4316]}, {"w": "for", "b": [0.3249, 0.4119, 0.3571, 0.4316]}, {"w": "content", "b": [0.3634, 0.4119, 0.4433, 0.4316]}, {"w": "loss", "b": [0.4496, 0.4119, 0.4889, 0.4316]}, {"w": "3", "b": [0.1799, 0.4324, 0.1925, 0.4521]}, {"w": "Layers", "b": [0.1988, 0.4324, 0.273, 0.4521]}, {"w": "used", "b": [0.2794, 0.4324, 0.3284, 0.4521]}, {"w": "for", "b": [0.3347, 0.4324, 0.3669, 0.4521]}, {"w": "style", "b": [0.3732, 0.4324, 0.4223, 0.4521]}, {"w": "loss", "b": [0.4286, 0.4324, 0.4678, 0.4521]}, {"w": "4", "b": [0.1799, 0.4529, 0.1925, 0.4726]}, {"w": "Weights", "b": [0.1988, 0.4529, 0.2857, 0.4726]}, {"w": "in", "b": [0.292, 0.4529, 0.313, 0.4726]}, {"w": "the", "b": [0.3193, 0.4529, 0.353, 0.4726]}, {"w": "weighted", "b": [0.3593, 0.4529, 0.456, 0.4726]}, {"w": "average", "b": [0.4623, 0.4529, 0.5463, 0.4726]}, {"w": "of", "b": [0.5526, 0.4529, 0.5736, 0.4726]}, {"w": "the", "b": [0.5799, 0.4529, 0.6136, 0.4726]}, {"w": "loss", "b": [0.6199, 0.4529, 0.6591, 0.4726]}, {"w": "components", "b": [0.6654, 0.4529, 0.7944, 0.4726]}, {"w": "5", "b": [0.1799, 0.4734, 0.1925, 0.4931]}, {"w": "You’ll", "b": [0.1988, 0.4734, 0.2633, 0.4931]}, {"w": "define", "b": [0.2696, 0.4734, 0.3354, 0.4931]}, {"w": "the", "b": [0.3417, 0.4734, 0.3754, 0.4931]}, {"w": "loss", "b": [0.3817, 0.4734, 0.4209, 0.4931]}, {"w": "by", "b": [0.4272, 0.4734, 0.4539, 0.4931]}, {"w": "adding", "b": [0.4602, 0.4734, 0.5345, 0.4931]}, {"w": "all", "b": [0.5408, 0.4734, 0.5674, 0.4931]}, {"w": "components", "b": [0.5737, 0.4734, 0.7027, 0.4931]}, {"w": "to", "b": [0.709, 0.4734, 0.73, 0.4931]}, {"w": "this", "b": [0.7363, 0.4734, 0.7756, 0.4931]}, {"w": "scalar", "b": [0.7819, 0.4734, 0.8463, 0.4931]}, {"w": "variable.", "b": [0.1799, 0.4939, 0.2745, 0.5136]}, {"w": "6", "b": [0.1799, 0.5144, 0.1925, 0.5341]}, {"w": "Adds", "b": [0.1988, 0.5144, 0.2549, 0.5341]}, {"w": "the", "b": [0.2612, 0.5144, 0.2948, 0.5341]}, {"w": "content", "b": [0.3011, 0.5144, 0.381, 0.5341]}, {"w": "loss", "b": [0.3873, 0.5144, 0.4265, 0.5341]}, {"w": "7", "b": [0.1799, 0.5349, 0.1925, 0.5546]}, {"w": "Adds", "b": [0.1988, 0.5349, 0.2549, 0.5546]}, {"w": "a", "b": [0.2612, 0.5349, 0.2738, 0.5546]}, {"w": "style", "b": [0.2801, 0.5349, 0.3291, 0.5546]}, {"w": "loss", "b": [0.3354, 0.5349, 0.3747, 0.5546]}, {"w": "component", "b": [0.381, 0.5349, 0.5001, 0.5546]}, {"w": "for", "b": [0.5064, 0.5349, 0.5386, 0.5546]}, {"w": "each", "b": [0.5449, 0.5349, 0.594, 0.5546]}, {"w": "target", "b": [0.6003, 0.5349, 0.6647, 0.5546]}, {"w": "layer", "b": [0.671, 0.5349, 0.7256, 0.5546]}, {"w": "8", "b": [0.1799, 0.5554, 0.1925, 0.5751]}, {"w": "Adds", "b": [0.1988, 0.5554, 0.2549, 0.5751]}, {"w": "the", "b": [0.2612, 0.5554, 0.2948, 0.5751]}, {"w": "total", "b": [0.3011, 0.5554, 0.3501, 0.5751]}, {"w": "variation", "b": [0.3564, 0.5554, 0.4545, 0.5751]}, {"w": "loss", "b": [0.4609, 0.5554, 0.5001, 0.5751]}]}, {"id": "b_2", "type": "paragraph", "text": "Finally, you’ll set up the gradient-descent process. In the original Gatys et al. paper, optimization is performed using the L-BFGS algorithm, so that’s what you’ll use here. This is a key difference from the DeepDream example in section 8.2. The L-BFGS algorithm comes packaged with SciPy, but there are two slight limitations with the SciPy implementation:", "words": [{"w": "Finally,", "b": [0.1294, 0.5982, 0.2056, 0.6179]}, {"w": "you’ll", "b": [0.2119, 0.5982, 0.2721, 0.6179]}, {"w": "set", "b": [0.2784, 0.5982, 0.3065, 0.6179]}, {"w": "up", "b": [0.3128, 0.5982, 0.338, 0.6179]}, {"w": "the", "b": [0.3443, 0.5982, 0.3751, 0.6179]}, {"w": "gradient-descent", "b": [0.3814, 0.5982, 0.5481, 0.6179]}, {"w": "process.", "b": [0.5545, 0.5982, 0.6364, 0.6179]}, {"w": "In", "b": [0.6427, 0.5982, 0.6637, 0.6179]}, {"w": "the", "b": [0.67, 0.5982, 0.7009, 0.6179]}, {"w": "original", "b": [0.7072, 0.5982, 0.7856, 0.6179]}, {"w": "Gatys", "b": [0.792, 0.5982, 0.8508, 0.6179]}, {"w": "et", "b": [0.1294, 0.6187, 0.1476, 0.6384]}, {"w": "al.", "b": [0.1539, 0.6187, 0.1785, 0.6384]}, {"w": "paper,", "b": [0.1848, 0.6187, 0.2461, 0.6384]}, {"w": "optimization", "b": [0.2524, 0.6187, 0.3799, 0.6384]}, {"w": "is", "b": [0.3862, 0.6187, 0.403, 0.6384]}, {"w": "performed", "b": [0.4093, 0.6187, 0.5144, 0.6384]}, {"w": "using", "b": [0.5207, 0.6187, 0.5754, 0.6384]}, {"w": "the", "b": [0.5817, 0.6187, 0.6125, 0.6384]}, {"w": "L-BFGS", "b": [0.6188, 0.6187, 0.7057, 0.6384]}, {"w": "algorithm,", "b": [0.712, 0.6187, 0.8164, 0.6384]}, {"w": "so", "b": [0.8227, 0.6187, 0.8451, 0.6384]}, {"w": "that’s", "b": [0.1294, 0.6392, 0.1841, 0.6589]}, {"w": "what", "b": [0.1904, 0.6392, 0.2394, 0.6589]}, {"w": "you’ll", "b": [0.2457, 0.6392, 0.306, 0.6589]}, {"w": "use", "b": [0.3123, 0.6392, 0.3459, 0.6589]}, {"w": "here.", "b": [0.3522, 0.6392, 0.4019, 0.6589]}, {"w": "This", "b": [0.4082, 0.6392, 0.4531, 0.6589]}, {"w": "is", "b": [0.4594, 0.6392, 0.4762, 0.6589]}, {"w": "a", "b": [0.4825, 0.6392, 0.4937, 0.6589]}, {"w": "key", "b": [0.5, 0.6392, 0.5365, 0.6589]}, {"w": "difference", "b": [0.5428, 0.6392, 0.6445, 0.6589]}, {"w": "from", "b": [0.6508, 0.6392, 0.6999, 0.6589]}, {"w": "the", "b": [0.7062, 0.6392, 0.737, 0.6589]}, {"w": "DeepDream", "b": [0.7433, 0.6392, 0.8652, 0.6589]}, {"w": "example", "b": [0.1294, 0.6597, 0.2149, 0.6794]}, {"w": "in", "b": [0.2212, 0.6597, 0.2408, 0.6794]}, {"w": "section", "b": [0.2471, 0.6597, 0.3186, 0.6794]}, {"w": "8.2.", "b": [0.3249, 0.6597, 0.3627, 0.6794]}, {"w": "The", "b": [0.369, 0.6597, 0.4082, 0.6794]}, {"w": "L-BFGS", "b": [0.4145, 0.6597, 0.5014, 0.6794]}, {"w": "algorithm", "b": [0.5077, 0.6597, 0.6058, 0.6794]}, {"w": "comes", "b": [0.6121, 0.6597, 0.6766, 0.6794]}, {"w": "packaged", "b": [0.6829, 0.6597, 0.7781, 0.6794]}, {"w": "with", "b": [0.7844, 0.6597, 0.8293, 0.6794]}, {"w": "SciPy,", "b": [0.1294, 0.6802, 0.193, 0.6999]}, {"w": "but", "b": [0.1993, 0.6802, 0.2315, 0.6999]}, {"w": "there", "b": [0.2378, 0.6802, 0.2882, 0.6999]}, {"w": "are", "b": [0.2945, 0.6802, 0.3253, 0.6999]}, {"w": "two", "b": [0.3316, 0.6802, 0.3695, 0.6999]}, {"w": "slight", "b": [0.3758, 0.6802, 0.4319, 0.6999]}, {"w": "limitations", "b": [0.4382, 0.6802, 0.5461, 0.6999]}, {"w": "with", "b": [0.5524, 0.6802, 0.5973, 0.6999]}, {"w": "the", "b": [0.6036, 0.6802, 0.6344, 0.6999]}, {"w": "SciPy", "b": [0.6407, 0.6802, 0.6996, 0.6999]}, {"w": "implementation:", "b": [0.1294, 0.7007, 0.2948, 0.7204]}]}, {"id": "b_3", "type": "paragraph", "text": "It requires that you pass the value of the loss function and the value of the gradients as two separate functions. It can only be applied to flat vectors, whereas you have a 3D image array.", "words": [{"w": "It", "b": [0.1799, 0.739, 0.1953, 0.7588]}, {"w": "requires", "b": [0.2016, 0.739, 0.2828, 0.7588]}, {"w": "that", "b": [0.2891, 0.739, 0.327, 0.7588]}, {"w": "you", "b": [0.3333, 0.739, 0.3711, 0.7588]}, {"w": "pass", "b": [0.3774, 0.739, 0.4209, 0.7588]}, {"w": "the", "b": [0.4272, 0.739, 0.458, 0.7588]}, {"w": "value", "b": [0.4643, 0.739, 0.5189, 0.7588]}, {"w": "of", "b": [0.5253, 0.739, 0.5463, 0.7588]}, {"w": "the", "b": [0.5526, 0.739, 0.5834, 0.7588]}, {"w": "loss", "b": [0.5897, 0.739, 0.629, 0.7588]}, {"w": "function", "b": [0.6353, 0.739, 0.7193, 0.7588]}, {"w": "and", "b": [0.7256, 0.739, 0.7621, 0.7588]}, {"w": "the", "b": [0.7684, 0.739, 0.7992, 0.7588]}, {"w": "value", "b": [0.8055, 0.739, 0.8602, 0.7588]}, {"w": "of", "b": [0.1799, 0.7595, 0.2009, 0.7793]}, {"w": "the", "b": [0.2072, 0.7595, 0.238, 0.7793]}, {"w": "gradients", "b": [0.2443, 0.7595, 0.3368, 0.7793]}, {"w": "as", "b": [0.3431, 0.7595, 0.3641, 0.7793]}, {"w": "two", "b": [0.3704, 0.7595, 0.4083, 0.7793]}, {"w": "separate", "b": [0.4146, 0.7595, 0.4972, 0.7793]}, {"w": "functions.", "b": [0.5035, 0.7595, 0.6037, 0.7793]}, {"w": "It", "b": [0.1799, 0.78, 0.1953, 0.7998]}, {"w": "can", "b": [0.2016, 0.78, 0.2366, 0.7998]}, {"w": "only", "b": [0.2429, 0.78, 0.2878, 0.7998]}, {"w": "be", "b": [0.2941, 0.78, 0.3179, 0.7998]}, {"w": "applied", "b": [0.3242, 0.78, 0.3984, 0.7998]}, {"w": "to", "b": [0.4048, 0.78, 0.4244, 0.7998]}, {"w": "flat", "b": [0.4307, 0.78, 0.4643, 0.7998]}, {"w": "vectors,", "b": [0.4706, 0.78, 0.5498, 0.7998]}, {"w": "whereas", "b": [0.5561, 0.78, 0.6387, 0.7998]}, {"w": "you", "b": [0.645, 0.78, 0.6829, 0.7998]}, {"w": "have", "b": [0.6892, 0.78, 0.7368, 0.7998]}, {"w": "a", "b": [0.7431, 0.78, 0.7543, 0.7998]}, {"w": "3D", "b": [0.7606, 0.78, 0.7914, 0.7998]}, {"w": "image", "b": [0.7977, 0.78, 0.8594, 0.7998]}, {"w": "array.", "b": [0.1799, 0.8005, 0.2363, 0.8203]}]}, {"id": "b_4", "type": "paragraph", "text": "It would be inefficient to compute the value of the loss function and the value of the gradients independently, because doing so would lead to a lot of redundant computation between the two; the process would be", "words": [{"w": "It", "b": [0.1294, 0.8433, 0.1448, 0.863]}, {"w": "would", "b": [0.1511, 0.8433, 0.2142, 0.863]}, {"w": "be", "b": [0.2205, 0.8433, 0.2443, 0.863]}, {"w": "inefficient", "b": [0.2506, 0.8433, 0.3538, 0.863]}, {"w": "to", "b": [0.3601, 0.8433, 0.3798, 0.863]}, {"w": "compute", "b": [0.3861, 0.8433, 0.4729, 0.863]}, {"w": "the", "b": [0.4793, 0.8433, 0.5101, 0.863]}, {"w": "value", "b": [0.5164, 0.8433, 0.571, 0.863]}, {"w": "of", "b": [0.5773, 0.8433, 0.5983, 0.863]}, {"w": "the", "b": [0.6046, 0.8433, 0.6355, 0.863]}, {"w": "loss", "b": [0.6418, 0.8433, 0.681, 0.863]}, {"w": "function", "b": [0.6873, 0.8433, 0.7714, 0.863]}, {"w": "and", "b": [0.7777, 0.8433, 0.8141, 0.863]}, {"w": "the", "b": [0.8205, 0.8433, 0.8513, 0.863]}, {"w": "value", "b": [0.1294, 0.8638, 0.1841, 0.8835]}, {"w": "of", "b": [0.1904, 0.8638, 0.2114, 0.8835]}, {"w": "the", "b": [0.2177, 0.8638, 0.2485, 0.8835]}, {"w": "gradients", "b": [0.2548, 0.8638, 0.3473, 0.8835]}, {"w": "independently,", "b": [0.3536, 0.8638, 0.5011, 0.8835]}, {"w": "because", "b": [0.5074, 0.8638, 0.5873, 0.8835]}, {"w": "doing", "b": [0.5936, 0.8638, 0.6511, 0.8835]}, {"w": "so", "b": [0.6573, 0.8638, 0.6798, 0.8835]}, {"w": "would", "b": [0.6861, 0.8638, 0.7491, 0.8835]}, {"w": "lead", "b": [0.7554, 0.8638, 0.7975, 0.8835]}, {"w": "to", "b": [0.8038, 0.8638, 0.8234, 0.8835]}, {"w": "a", "b": [0.8297, 0.8638, 0.8409, 0.8835]}, {"w": "lot", "b": [0.1294, 0.8843, 0.1561, 0.904]}, {"w": "of", "b": [0.1624, 0.8843, 0.1834, 0.904]}, {"w": "redundant", "b": [0.1897, 0.8843, 0.2906, 0.904]}, {"w": "computation", "b": [0.2969, 0.8843, 0.423, 0.904]}, {"w": "between", "b": [0.4293, 0.8843, 0.5133, 0.904]}, {"w": "the", "b": [0.5197, 0.8843, 0.5505, 0.904]}, {"w": "two;", "b": [0.5568, 0.8843, 0.6016, 0.904]}, {"w": "the", "b": [0.6079, 0.8843, 0.6388, 0.904]}, {"w": "process", "b": [0.6451, 0.8843, 0.7207, 0.904]}, {"w": "would", "b": [0.727, 0.8843, 0.7901, 0.904]}, {"w": "be", "b": [0.7964, 0.8843, 0.8202, 0.904]}]}]}, {"page": 383, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "almost twice as slow as computing them jointly. To bypass this, you’ll set up a Python class named Evaluator that computes both the loss value and the gradients value at once, returns the loss value when called the first time, and caches the gradients for the next call.", "words": [{"w": "almost", "b": [0.1294, 0.0857, 0.1967, 0.1054]}, {"w": "twice", "b": [0.203, 0.0857, 0.2576, 0.1054]}, {"w": "as", "b": [0.2639, 0.0857, 0.285, 0.1054]}, {"w": "slow", "b": [0.2913, 0.0857, 0.3389, 0.1054]}, {"w": "as", "b": [0.3452, 0.0857, 0.3662, 0.1054]}, {"w": "computing", "b": [0.3725, 0.0857, 0.4805, 0.1054]}, {"w": "them", "b": [0.4868, 0.0857, 0.5372, 0.1054]}, {"w": "jointly.", "b": [0.5435, 0.0857, 0.614, 0.1054]}, {"w": "To", "b": [0.6203, 0.0857, 0.6466, 0.1054]}, {"w": "bypass", "b": [0.6529, 0.0857, 0.7215, 0.1054]}, {"w": "this,", "b": [0.7279, 0.0857, 0.7706, 0.1054]}, {"w": "you’ll", "b": [0.7769, 0.0857, 0.8372, 0.1054]}, {"w": "set", "b": [0.1294, 0.1062, 0.1574, 0.1259]}, {"w": "up", "b": [0.1637, 0.1062, 0.189, 0.1259]}, {"w": "a", "b": [0.1953, 0.1062, 0.2065, 0.1259]}, {"w": "Python", "b": [0.2128, 0.1062, 0.2843, 0.1259]}, {"w": "class", "b": [0.2906, 0.1062, 0.3396, 0.1259]}, {"w": "named", "b": [0.3459, 0.1062, 0.4132, 0.1259]}, {"w": "Evaluator", "b": [0.4194, 0.1072, 0.5557, 0.1274]}, {"w": "that", "b": [0.562, 0.1062, 0.5998, 0.1259]}, {"w": "computes", "b": [0.6061, 0.1062, 0.7028, 0.1259]}, {"w": "both", "b": [0.7091, 0.1062, 0.754, 0.1259]}, {"w": "the", "b": [0.7603, 0.1062, 0.7911, 0.1259]}, {"w": "loss", "b": [0.7974, 0.1062, 0.8367, 0.1259]}, {"w": "value", "b": [0.1294, 0.1276, 0.1841, 0.1473]}, {"w": "and", "b": [0.1904, 0.1276, 0.2268, 0.1473]}, {"w": "the", "b": [0.2331, 0.1276, 0.2639, 0.1473]}, {"w": "gradients", "b": [0.2702, 0.1276, 0.3627, 0.1473]}, {"w": "value", "b": [0.369, 0.1276, 0.4236, 0.1473]}, {"w": "at", "b": [0.43, 0.1276, 0.4482, 0.1473]}, {"w": "once,", "b": [0.4545, 0.1276, 0.5084, 0.1473]}, {"w": "returns", "b": [0.5147, 0.1276, 0.5848, 0.1473]}, {"w": "the", "b": [0.5911, 0.1276, 0.6219, 0.1473]}, {"w": "loss", "b": [0.6282, 0.1276, 0.6675, 0.1473]}, {"w": "value", "b": [0.6738, 0.1276, 0.7284, 0.1473]}, {"w": "when", "b": [0.7347, 0.1276, 0.7893, 0.1473]}, {"w": "called", "b": [0.7956, 0.1276, 0.8559, 0.1473]}, {"w": "the", "b": [0.1294, 0.1481, 0.1602, 0.1678]}, {"w": "first", "b": [0.1665, 0.1481, 0.2072, 0.1678]}, {"w": "time,", "b": [0.2135, 0.1481, 0.2646, 0.1678]}, {"w": "and", "b": [0.271, 0.1481, 0.3074, 0.1678]}, {"w": "caches", "b": [0.3136, 0.1481, 0.3809, 0.1678]}, {"w": "the", "b": [0.3872, 0.1481, 0.418, 0.1678]}, {"w": "gradients", "b": [0.4243, 0.1481, 0.5168, 0.1678]}, {"w": "for", "b": [0.5231, 0.1481, 0.5525, 0.1678]}, {"w": "the", "b": [0.5588, 0.1481, 0.5896, 0.1678]}, {"w": "next", "b": [0.5959, 0.1481, 0.6394, 0.1678]}, {"w": "call.", "b": [0.6457, 0.1481, 0.6884, 0.1678]}]}, {"id": "b_1", "type": "equation", "text": "Listing 8.21. Setting up the gradient-descent process", "words": [{"w": "Listing", "b": [0.1294, 0.1904, 0.1862, 0.2052]}, {"w": "8.21.", "b": [0.1909, 0.1904, 0.2288, 0.2052]}, {"w": "Setting", "b": [0.2335, 0.1904, 0.2902, 0.2052]}, {"w": "up", "b": [0.295, 0.1904, 0.316, 0.2052]}, {"w": "the", "b": [0.3207, 0.1904, 0.3459, 0.2052]}, {"w": "gradient-descent", "b": [0.3507, 0.1904, 0.4852, 0.2052]}, {"w": "process", "b": [0.4899, 0.1904, 0.5495, 0.2052]}]}, {"id": "b_2", "type": "paragraph", "text": "grads = K.gradients(loss, combination_image)[0] 1 fetch_loss_and_grads = K.function([combination_image], [loss, grads]) 2 class Evaluator(object): 3 def __init__(self): self.loss_value = None self.grads_values = None def loss(self, x): assert self.loss_value is None x = x.reshape((1, img_height, img_width, 3)) outs = fetch_loss_and_grads([x]) loss_value = outs[0] grad_values = outs[1].flatten().astype('float64') self.loss_value = loss_value self.grad_values = grad_values return self.loss_value def grads(self, x): assert self.loss_value is not None grad_values = np.copy(self.grad_values) self.loss_value = None self.grad_values = None return grad_values evaluator = Evaluator()", "words": [{"w": "grads", "b": [0.1357, 0.2188, 0.1925, 0.2339]}, {"w": "=", "b": [0.2038, 0.2188, 0.2152, 0.2339]}, {"w": "K.gradients(loss,", "b": [0.2265, 0.2188, 0.4195, 0.2339]}, {"w": "combination_image)[0]", "b": [0.4309, 0.2188, 0.6692, 0.2339]}, {"w": "1", "b": [0.1357, 0.2339, 0.1471, 0.2491]}, {"w": "fetch_loss_and_grads", "b": [0.1357, 0.2642, 0.3628, 0.2794]}, {"w": "=", "b": [0.3741, 0.2642, 0.3855, 0.2794]}, {"w": "K.function([combination_image],", "b": [0.3968, 0.2642, 0.7487, 0.2794]}, {"w": "[loss,", "b": [0.7601, 0.2642, 0.8282, 0.2794]}, {"w": "grads])", "b": [0.1357, 0.2794, 0.2152, 0.2945]}, {"w": "2", "b": [0.2833, 0.2794, 0.2947, 0.2945]}, {"w": "class", "b": [0.1357, 0.3097, 0.1925, 0.3248]}, {"w": "Evaluator(object):", "b": [0.2038, 0.3097, 0.4082, 0.3248]}, {"w": "3", "b": [0.1357, 0.3248, 0.1471, 0.34]}, {"w": "def", "b": [0.1811, 0.3552, 0.2152, 0.3703]}, {"w": "__init__(self):", "b": [0.2265, 0.3552, 0.3968, 0.3703]}, {"w": "self.loss_value", "b": [0.2265, 0.3703, 0.3968, 0.3854]}, {"w": "=", "b": [0.4082, 0.3703, 0.4195, 0.3854]}, {"w": "None", "b": [0.4309, 0.3703, 0.4763, 0.3854]}, {"w": "self.grads_values", "b": [0.2265, 0.3855, 0.4195, 0.4006]}, {"w": "=", "b": [0.4309, 0.3855, 0.4422, 0.4006]}, {"w": "None", "b": [0.4536, 0.3855, 0.499, 0.4006]}, {"w": "def", "b": [0.1811, 0.4158, 0.2152, 0.4309]}, {"w": "loss(self,", "b": [0.2265, 0.4158, 0.34, 0.4309]}, {"w": "x):", "b": [0.3514, 0.4158, 0.3855, 0.4309]}, {"w": "assert", "b": [0.2265, 0.4309, 0.2946, 0.4461]}, {"w": "self.loss_value", "b": [0.306, 0.4309, 0.4763, 0.4461]}, {"w": "is", "b": [0.4876, 0.4309, 0.5103, 0.4461]}, {"w": "None", "b": [0.5217, 0.4309, 0.5671, 0.4461]}, {"w": "x", "b": [0.2265, 0.4461, 0.2379, 0.4612]}, {"w": "=", "b": [0.2492, 0.4461, 0.2606, 0.4612]}, {"w": "x.reshape((1,", "b": [0.2719, 0.4461, 0.4195, 0.4612]}, {"w": "img_height,", "b": [0.4309, 0.4461, 0.5557, 0.4612]}, {"w": "img_width,", "b": [0.5671, 0.4461, 0.6806, 0.4612]}, {"w": "3))", "b": [0.6919, 0.4461, 0.726, 0.4612]}, {"w": "outs", "b": [0.2265, 0.4612, 0.2719, 0.4764]}, {"w": "=", "b": [0.2833, 0.4612, 0.2946, 0.4764]}, {"w": "fetch_loss_and_grads([x])", "b": [0.306, 0.4612, 0.5898, 0.4764]}, {"w": "loss_value", "b": [0.2265, 0.4764, 0.34, 0.4915]}, {"w": "=", "b": [0.3514, 0.4764, 0.3628, 0.4915]}, {"w": "outs[0]", "b": [0.3741, 0.4764, 0.4536, 0.4915]}, {"w": "grad_values", "b": [0.2265, 0.4915, 0.3514, 0.5067]}, {"w": "=", "b": [0.3628, 0.4915, 0.3741, 0.5067]}, {"w": "outs[1].flatten().astype('float64')", "b": [0.3855, 0.4915, 0.7828, 0.5067]}, {"w": "self.loss_value", "b": [0.2265, 0.5067, 0.3968, 0.5218]}, {"w": "=", "b": [0.4082, 0.5067, 0.4195, 0.5218]}, {"w": "loss_value", "b": [0.4309, 0.5067, 0.5444, 0.5218]}, {"w": "self.grad_values", "b": [0.2265, 0.5218, 0.4082, 0.537]}, {"w": "=", "b": [0.4195, 0.5218, 0.4309, 0.537]}, {"w": "grad_values", "b": [0.4422, 0.5218, 0.5671, 0.537]}, {"w": "return", "b": [0.2265, 0.537, 0.2946, 0.5521]}, {"w": "self.loss_value", "b": [0.306, 0.537, 0.4763, 0.5521]}, {"w": "def", "b": [0.1811, 0.5673, 0.2152, 0.5824]}, {"w": "grads(self,", "b": [0.2265, 0.5673, 0.3514, 0.5824]}, {"w": "x):", "b": [0.3628, 0.5673, 0.3968, 0.5824]}, {"w": "assert", "b": [0.2265, 0.5824, 0.2946, 0.5976]}, {"w": "self.loss_value", "b": [0.306, 0.5824, 0.4763, 0.5976]}, {"w": "is", "b": [0.4876, 0.5824, 0.5103, 0.5976]}, {"w": "not", "b": [0.5217, 0.5824, 0.5557, 0.5976]}, {"w": "None", "b": [0.5671, 0.5824, 0.6125, 0.5976]}, {"w": "grad_values", "b": [0.2265, 0.5976, 0.3514, 0.6127]}, {"w": "=", "b": [0.3628, 0.5976, 0.3741, 0.6127]}, {"w": "np.copy(self.grad_values)", "b": [0.3855, 0.5976, 0.6692, 0.6127]}, {"w": "self.loss_value", "b": [0.2265, 0.6127, 0.3968, 0.6279]}, {"w": "=", "b": [0.4082, 0.6127, 0.4195, 0.6279]}, {"w": "None", "b": [0.4309, 0.6127, 0.4763, 0.6279]}, {"w": "self.grad_values", "b": [0.2265, 0.6279, 0.4082, 0.643]}, {"w": "=", "b": [0.4195, 0.6279, 0.4309, 0.643]}, {"w": "None", "b": [0.4422, 0.6279, 0.4876, 0.643]}, {"w": "return", "b": [0.2265, 0.643, 0.2946, 0.6582]}, {"w": "grad_values", "b": [0.306, 0.643, 0.4309, 0.6582]}, {"w": "evaluator", "b": [0.1357, 0.6734, 0.2379, 0.6885]}, {"w": "=", "b": [0.2492, 0.6734, 0.2606, 0.6885]}, {"w": "Evaluator()", "b": [0.2719, 0.6734, 0.3968, 0.6885]}]}, {"id": "b_3", "type": "paragraph", "text": "1 Gets the gradients of the generated image with regard to the loss 2 Function to fetch the values of the current loss and the current gradients 3 This class wraps fetch_loss_and_grads in a way that lets you retrieve the losses and gradients via two separate method calls, which is required by the SciPy optimizer you'll use.", "words": [{"w": "1", "b": [0.1799, 0.7069, 0.1925, 0.7267]}, {"w": "Gets", "b": [0.1988, 0.7069, 0.2478, 0.7267]}, {"w": "the", "b": [0.2541, 0.7069, 0.2878, 0.7267]}, {"w": "gradients", "b": [0.2941, 0.7069, 0.395, 0.7267]}, {"w": "of", "b": [0.4013, 0.7069, 0.4223, 0.7267]}, {"w": "the", "b": [0.4286, 0.7069, 0.4622, 0.7267]}, {"w": "generated", "b": [0.4685, 0.7069, 0.575, 0.7267]}, {"w": "image", "b": [0.5813, 0.7069, 0.6458, 0.7267]}, {"w": "with", "b": [0.6521, 0.7069, 0.6997, 0.7267]}, {"w": "regard", "b": [0.706, 0.7069, 0.7784, 0.7267]}, {"w": "to", "b": [0.7847, 0.7069, 0.8057, 0.7267]}, {"w": "the", "b": [0.812, 0.7069, 0.8457, 0.7267]}, {"w": "loss", "b": [0.1799, 0.7274, 0.2191, 0.7472]}, {"w": "2", "b": [0.1799, 0.7479, 0.1925, 0.7677]}, {"w": "Function", "b": [0.1988, 0.7479, 0.2955, 0.7677]}, {"w": "to", "b": [0.3018, 0.7479, 0.3228, 0.7677]}, {"w": "fetch", "b": [0.3291, 0.7479, 0.3824, 0.7677]}, {"w": "the", "b": [0.3887, 0.7479, 0.4223, 0.7677]}, {"w": "values", "b": [0.4286, 0.7479, 0.4959, 0.7677]}, {"w": "of", "b": [0.5022, 0.7479, 0.5232, 0.7677]}, {"w": "the", "b": [0.5295, 0.7479, 0.5631, 0.7677]}, {"w": "current", "b": [0.5694, 0.7479, 0.6502, 0.7677]}, {"w": "loss", "b": [0.6565, 0.7479, 0.6958, 0.7677]}, {"w": "and", "b": [0.7021, 0.7479, 0.7427, 0.7677]}, {"w": "the", "b": [0.749, 0.7479, 0.7827, 0.7677]}, {"w": "current", "b": [0.789, 0.7479, 0.8698, 0.7677]}, {"w": "gradients", "b": [0.1799, 0.7684, 0.2808, 0.7882]}, {"w": "3", "b": [0.1799, 0.7889, 0.1925, 0.8087]}, {"w": "This", "b": [0.1988, 0.7889, 0.2465, 0.8087]}, {"w": "class", "b": [0.2528, 0.7889, 0.3032, 0.8087]}, {"w": "wraps", "b": [0.3095, 0.7889, 0.3754, 0.8087]}, {"w": "fetch_loss_and_grads", "b": [0.3817, 0.7889, 0.6129, 0.8087]}, {"w": "in", "b": [0.6192, 0.7889, 0.6403, 0.8087]}, {"w": "a", "b": [0.6466, 0.7889, 0.6592, 0.8087]}, {"w": "way", "b": [0.6655, 0.7889, 0.7089, 0.8087]}, {"w": "that", "b": [0.7153, 0.7889, 0.7587, 0.8087]}, {"w": "lets", "b": [0.765, 0.7889, 0.8014, 0.8087]}, {"w": "you", "b": [0.8077, 0.7889, 0.847, 0.8087]}, {"w": "retrieve", "b": [0.1799, 0.8094, 0.2634, 0.8292]}, {"w": "the", "b": [0.2697, 0.8094, 0.3034, 0.8292]}, {"w": "losses", "b": [0.3097, 0.8094, 0.3699, 0.8292]}, {"w": "and", "b": [0.3762, 0.8094, 0.4169, 0.8292]}, {"w": "gradients", "b": [0.4232, 0.8094, 0.5241, 0.8292]}, {"w": "via", "b": [0.5304, 0.8094, 0.5627, 0.8292]}, {"w": "two", "b": [0.569, 0.8094, 0.6082, 0.8292]}, {"w": "separate", "b": [0.6145, 0.8094, 0.7056, 0.8292]}, {"w": "method", "b": [0.7119, 0.8094, 0.7931, 0.8292]}, {"w": "calls,", "b": [0.7995, 0.8094, 0.8534, 0.8292]}, {"w": "which", "b": [0.1799, 0.8299, 0.2443, 0.8497]}, {"w": "is", "b": [0.2506, 0.8299, 0.2675, 0.8497]}, {"w": "required", "b": [0.2738, 0.8299, 0.3668, 0.8497]}, {"w": "by", "b": [0.3731, 0.8299, 0.3997, 0.8497]}, {"w": "the", "b": [0.406, 0.8299, 0.4396, 0.8497]}, {"w": "SciPy", "b": [0.4459, 0.8299, 0.5062, 0.8497]}, {"w": "optimizer", "b": [0.5125, 0.8299, 0.6162, 0.8497]}, {"w": "you'll", "b": [0.6225, 0.8299, 0.6828, 0.8497]}, {"w": "use.", "b": [0.6891, 0.8299, 0.7304, 0.8497]}]}, {"id": "b_4", "type": "paragraph", "text": "Finally, you can run the gradient-ascent process using SciPy’s L-BFGS algorithm, saving the current generated image at each iteration of the", "words": [{"w": "Finally,", "b": [0.1294, 0.8727, 0.2056, 0.8924]}, {"w": "you", "b": [0.2119, 0.8727, 0.2497, 0.8924]}, {"w": "can", "b": [0.256, 0.8727, 0.291, 0.8924]}, {"w": "run", "b": [0.2973, 0.8727, 0.331, 0.8924]}, {"w": "the", "b": [0.3373, 0.8727, 0.3681, 0.8924]}, {"w": "gradient-ascent", "b": [0.3744, 0.8727, 0.5285, 0.8924]}, {"w": "process", "b": [0.5348, 0.8727, 0.6105, 0.8924]}, {"w": "using", "b": [0.6168, 0.8727, 0.6714, 0.8924]}, {"w": "SciPy’s", "b": [0.6777, 0.8727, 0.7534, 0.8924]}, {"w": "L-BFGS", "b": [0.7597, 0.8727, 0.8466, 0.8924]}, {"w": "algorithm,", "b": [0.1294, 0.8932, 0.2338, 0.9129]}, {"w": "saving", "b": [0.2401, 0.8932, 0.306, 0.9129]}, {"w": "the", "b": [0.3123, 0.8932, 0.3431, 0.9129]}, {"w": "current", "b": [0.3494, 0.8932, 0.4209, 0.9129]}, {"w": "generated", "b": [0.4272, 0.8932, 0.5252, 0.9129]}, {"w": "image", "b": [0.5315, 0.8932, 0.5932, 0.9129]}, {"w": "at", "b": [0.5995, 0.8932, 0.6177, 0.9129]}, {"w": "each", "b": [0.624, 0.8932, 0.6702, 0.9129]}, {"w": "iteration", "b": [0.6764, 0.8932, 0.7605, 0.9129]}, {"w": "of", "b": [0.7668, 0.8932, 0.7878, 0.9129]}, {"w": "the", "b": [0.7941, 0.8932, 0.8249, 0.9129]}]}]}, {"page": 384, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "algorithm (here, a single iteration represents 20 steps of gradient ascent).", "words": [{"w": "algorithm", "b": [0.1294, 0.0857, 0.2275, 0.1054]}, {"w": "(here,", "b": [0.2338, 0.0857, 0.2919, 0.1054]}, {"w": "a", "b": [0.2982, 0.0857, 0.3094, 0.1054]}, {"w": "single", "b": [0.3158, 0.0857, 0.376, 0.1054]}, {"w": "iteration", "b": [0.3823, 0.0857, 0.4664, 0.1054]}, {"w": "represents", "b": [0.4727, 0.0857, 0.575, 0.1054]}, {"w": "20", "b": [0.5813, 0.0857, 0.6065, 0.1054]}, {"w": "steps", "b": [0.6128, 0.0857, 0.6633, 0.1054]}, {"w": "of", "b": [0.6696, 0.0857, 0.6906, 0.1054]}, {"w": "gradient", "b": [0.6969, 0.0857, 0.7796, 0.1054]}, {"w": "ascent).", "b": [0.7859, 0.0857, 0.8636, 0.1054]}]}, {"id": "b_1", "type": "equation", "text": "Listing 8.22. Style-transfer loop", "words": [{"w": "Listing", "b": [0.1294, 0.1235, 0.1862, 0.1383]}, {"w": "8.22.", "b": [0.1909, 0.1235, 0.2288, 0.1383]}, {"w": "Style-transfer", "b": [0.2335, 0.1235, 0.3448, 0.1383]}, {"w": "loop", "b": [0.3496, 0.1235, 0.3843, 0.1383]}]}, {"id": "b_2", "type": "paragraph", "text": "from scipy.optimize import fmin_l_bfgs_b from scipy.misc import imsave import time result_prefix = 'my_result' iterations = 20 x = preprocess_image(target_image_path) 1 x = x.flatten() 2 for i in range(iterations): print('Start of iteration', i) start_time = time.time() x, min_val, info = fmin_l_bfgs_b(evaluator.loss, 3 x, 3 fprime=evaluator.grads, 3 maxfun=20) 3 print('Current loss value:', min_val) img = x.copy().reshape((img_height, img_width, 3)) 4 img = deprocess_image(img) 4 fname = result_prefix + '_at_iteration_%d.png' % i 4 imsave(fname, img) 4 print('Image saved as', fname) 4 end_time = time.time() 4 print('Iteration %d completed in %ds' % (i, end_time - start_time))", "words": [{"w": "from", "b": [0.1357, 0.1519, 0.1811, 0.1671]}, {"w": "scipy.optimize", "b": [0.1925, 0.1519, 0.3514, 0.1671]}, {"w": "import", "b": [0.3628, 0.1519, 0.4309, 0.1671]}, {"w": "fmin_l_bfgs_b", "b": [0.4422, 0.1519, 0.5898, 0.1671]}, {"w": "from", "b": [0.1357, 0.1671, 0.1811, 0.1822]}, {"w": "scipy.misc", "b": [0.1925, 0.1671, 0.306, 0.1822]}, {"w": "import", "b": [0.3173, 0.1671, 0.3855, 0.1822]}, {"w": "imsave", "b": [0.3968, 0.1671, 0.4649, 0.1822]}, {"w": "import", "b": [0.1357, 0.1822, 0.2038, 0.1974]}, {"w": "time", "b": [0.2152, 0.1822, 0.2606, 0.1974]}, {"w": "result_prefix", "b": [0.1357, 0.2125, 0.2833, 0.2277]}, {"w": "=", "b": [0.2946, 0.2125, 0.306, 0.2277]}, {"w": "'my_result'", "b": [0.3173, 0.2125, 0.4422, 0.2277]}, {"w": "iterations", "b": [0.1357, 0.2277, 0.2492, 0.2428]}, {"w": "=", "b": [0.2606, 0.2277, 0.2719, 0.2428]}, {"w": "20", "b": [0.2833, 0.2277, 0.306, 0.2428]}, {"w": "x", "b": [0.1357, 0.258, 0.1471, 0.2731]}, {"w": "=", "b": [0.1584, 0.258, 0.1698, 0.2731]}, {"w": "preprocess_image(target_image_path)", "b": [0.1811, 0.258, 0.5784, 0.2731]}, {"w": "1", "b": [0.1357, 0.2732, 0.1471, 0.2883]}, {"w": "x", "b": [0.1357, 0.2883, 0.1471, 0.3035]}, {"w": "=", "b": [0.1584, 0.2883, 0.1698, 0.3035]}, {"w": "x.flatten()", "b": [0.1811, 0.2883, 0.306, 0.3035]}, {"w": "2", "b": [0.1357, 0.3035, 0.1471, 0.3186]}, {"w": "for", "b": [0.1357, 0.3186, 0.1698, 0.3338]}, {"w": "i", "b": [0.1811, 0.3186, 0.1925, 0.3338]}, {"w": "in", "b": [0.2038, 0.3186, 0.2265, 0.3338]}, {"w": "range(iterations):", "b": [0.2379, 0.3186, 0.4422, 0.3338]}, {"w": "print('Start", "b": [0.1811, 0.3338, 0.3173, 0.3489]}, {"w": "of", "b": [0.3287, 0.3338, 0.3514, 0.3489]}, {"w": "iteration',", "b": [0.3628, 0.3338, 0.4876, 0.3489]}, {"w": "i)", "b": [0.499, 0.3338, 0.5217, 0.3489]}, {"w": "start_time", "b": [0.1811, 0.3489, 0.2946, 0.3641]}, {"w": "=", "b": [0.306, 0.3489, 0.3173, 0.3641]}, {"w": "time.time()", "b": [0.3287, 0.3489, 0.4536, 0.3641]}, {"w": "x,", "b": [0.1811, 0.3641, 0.2038, 0.3792]}, {"w": "min_val,", "b": [0.2152, 0.3641, 0.306, 0.3792]}, {"w": "info", "b": [0.3173, 0.3641, 0.3628, 0.3792]}, {"w": "=", "b": [0.3741, 0.3641, 0.3855, 0.3792]}, {"w": "fmin_l_bfgs_b(evaluator.loss,", "b": [0.3968, 0.3641, 0.726, 0.3792]}, {"w": "3", "b": [0.1357, 0.3792, 0.1471, 0.3944]}, {"w": "x,", "b": [0.5557, 0.3944, 0.5784, 0.4095]}, {"w": "3", "b": [0.1357, 0.4095, 0.1471, 0.4247]}, {"w": "fprime=evaluator.grads,", "b": [0.5557, 0.4247, 0.8168, 0.4398]}, {"w": "3", "b": [0.1357, 0.4398, 0.1471, 0.455]}, {"w": "maxfun=20)", "b": [0.5557, 0.455, 0.6692, 0.4701]}, {"w": "3", "b": [0.1357, 0.4701, 0.1471, 0.4853]}, {"w": "print('Current", "b": [0.1811, 0.4853, 0.34, 0.5004]}, {"w": "loss", "b": [0.3514, 0.4853, 0.3968, 0.5004]}, {"w": "value:',", "b": [0.4082, 0.4853, 0.499, 0.5004]}, {"w": "min_val)", "b": [0.5103, 0.4853, 0.6011, 0.5004]}, {"w": "img", "b": [0.1811, 0.5004, 0.2152, 0.5156]}, {"w": "=", "b": [0.2265, 0.5004, 0.2379, 0.5156]}, {"w": "x.copy().reshape((img_height,", "b": [0.2492, 0.5004, 0.5784, 0.5156]}, {"w": "img_width,", "b": [0.5898, 0.5004, 0.7033, 0.5156]}, {"w": "3))", "b": [0.7146, 0.5004, 0.7487, 0.5156]}, {"w": "4", "b": [0.1357, 0.5156, 0.1471, 0.5307]}, {"w": "img", "b": [0.1811, 0.5307, 0.2152, 0.5459]}, {"w": "=", "b": [0.2265, 0.5307, 0.2379, 0.5459]}, {"w": "deprocess_image(img)", "b": [0.2492, 0.5307, 0.4763, 0.5459]}, {"w": "4", "b": [0.1357, 0.5459, 0.1471, 0.561]}, {"w": "fname", "b": [0.1811, 0.561, 0.2379, 0.5762]}, {"w": "=", "b": [0.2492, 0.561, 0.2606, 0.5762]}, {"w": "result_prefix", "b": [0.2719, 0.561, 0.4195, 0.5762]}, {"w": "+", "b": [0.4309, 0.561, 0.4422, 0.5762]}, {"w": "'_at_iteration_%d.png'", "b": [0.4536, 0.561, 0.7033, 0.5762]}, {"w": "%", "b": [0.7146, 0.561, 0.726, 0.5762]}, {"w": "i", "b": [0.7374, 0.561, 0.7487, 0.5762]}, {"w": "4", "b": [0.1357, 0.5762, 0.1471, 0.5913]}, {"w": "imsave(fname,", "b": [0.1811, 0.5914, 0.3287, 0.6065]}, {"w": "img)", "b": [0.34, 0.5914, 0.3855, 0.6065]}, {"w": "4", "b": [0.1357, 0.6065, 0.1471, 0.6217]}, {"w": "print('Image", "b": [0.1811, 0.6217, 0.3173, 0.6368]}, {"w": "saved", "b": [0.3287, 0.6217, 0.3855, 0.6368]}, {"w": "as',", "b": [0.3968, 0.6217, 0.4422, 0.6368]}, {"w": "fname)", "b": [0.4536, 0.6217, 0.5217, 0.6368]}, {"w": "4", "b": [0.1357, 0.6368, 0.1471, 0.652]}, {"w": "end_time", "b": [0.1811, 0.652, 0.2719, 0.6671]}, {"w": "=", "b": [0.2833, 0.652, 0.2946, 0.6671]}, {"w": "time.time()", "b": [0.306, 0.652, 0.4309, 0.6671]}, {"w": "4", "b": [0.1357, 0.6671, 0.1471, 0.6823]}, {"w": "print('Iteration", "b": [0.1811, 0.6823, 0.3628, 0.6974]}, {"w": "%d", "b": [0.3741, 0.6823, 0.3968, 0.6974]}, {"w": "completed", "b": [0.4082, 0.6823, 0.5103, 0.6974]}, {"w": "in", "b": [0.5217, 0.6823, 0.5444, 0.6974]}, {"w": "%ds'", "b": [0.5557, 0.6823, 0.6011, 0.6974]}, {"w": "%", "b": [0.6125, 0.6823, 0.6238, 0.6974]}, {"w": "(i,", "b": [0.6352, 0.6823, 0.6692, 0.6974]}, {"w": "end_time", "b": [0.6806, 0.6823, 0.7714, 0.6974]}, {"w": "-", "b": [0.7828, 0.6823, 0.7941, 0.6974]}, {"w": "start_time))", "b": [0.1357, 0.6974, 0.2719, 0.7126]}]}, {"id": "b_3", "type": "paragraph", "text": "1 This is the initial state: the target image. 2 You flatten the image because scipy.optimize.fmin_l_bfgs_b can only process flat vectors. 3 Runs L-BFGS optimization over the pixels of the generated image to minimize the neural style loss. Note that you have to pass the function that computes the loss and the function that computes the gradients as two separate arguments. 4 Saves the current generated image.", "words": [{"w": "1", "b": [0.1799, 0.731, 0.1925, 0.7507]}, {"w": "This", "b": [0.1988, 0.731, 0.2465, 0.7507]}, {"w": "is", "b": [0.2528, 0.731, 0.2696, 0.7507]}, {"w": "the", "b": [0.2759, 0.731, 0.3095, 0.7507]}, {"w": "initial", "b": [0.3158, 0.731, 0.3789, 0.7507]}, {"w": "state:", "b": [0.3852, 0.731, 0.4441, 0.7507]}, {"w": "the", "b": [0.4504, 0.731, 0.484, 0.7507]}, {"w": "target", "b": [0.4903, 0.731, 0.5547, 0.7507]}, {"w": "image.", "b": [0.561, 0.731, 0.6318, 0.7507]}, {"w": "2", "b": [0.1799, 0.7515, 0.1925, 0.7712]}, {"w": "You", "b": [0.1988, 0.7515, 0.2408, 0.7712]}, {"w": "flatten", "b": [0.2471, 0.7515, 0.3172, 0.7712]}, {"w": "the", "b": [0.3235, 0.7515, 0.3571, 0.7712]}, {"w": "image", "b": [0.3634, 0.7515, 0.4279, 0.7712]}, {"w": "because", "b": [0.4342, 0.7515, 0.5183, 0.7712]}, {"w": "scipy.optimize.fmin_l_bfgs_b", "b": [0.5246, 0.7515, 0.8371, 0.7712]}, {"w": "can", "b": [0.1799, 0.772, 0.2177, 0.7917]}, {"w": "only", "b": [0.224, 0.772, 0.2703, 0.7917]}, {"w": "process", "b": [0.2766, 0.772, 0.356, 0.7917]}, {"w": "flat", "b": [0.3623, 0.772, 0.3987, 0.7917]}, {"w": "vectors.", "b": [0.405, 0.772, 0.4884, 0.7917]}, {"w": "3", "b": [0.1799, 0.7925, 0.1925, 0.8122]}, {"w": "Runs", "b": [0.1988, 0.7925, 0.2549, 0.8122]}, {"w": "L-BFGS", "b": [0.2612, 0.7925, 0.3523, 0.8122]}, {"w": "optimization", "b": [0.3586, 0.7925, 0.4945, 0.8122]}, {"w": "over", "b": [0.5008, 0.7925, 0.5485, 0.8122]}, {"w": "the", "b": [0.5548, 0.7925, 0.5884, 0.8122]}, {"w": "pixels", "b": [0.5947, 0.7925, 0.6564, 0.8122]}, {"w": "of", "b": [0.6627, 0.7925, 0.6837, 0.8122]}, {"w": "the", "b": [0.69, 0.7925, 0.7236, 0.8122]}, {"w": "generated", "b": [0.7299, 0.7925, 0.8364, 0.8122]}, {"w": "image", "b": [0.1799, 0.813, 0.2443, 0.8327]}, {"w": "to", "b": [0.2506, 0.813, 0.2716, 0.8327]}, {"w": "minimize", "b": [0.2779, 0.813, 0.3774, 0.8327]}, {"w": "the", "b": [0.3837, 0.813, 0.4174, 0.8327]}, {"w": "neural", "b": [0.4237, 0.813, 0.4937, 0.8327]}, {"w": "style", "b": [0.5001, 0.813, 0.5491, 0.8327]}, {"w": "loss.", "b": [0.5554, 0.813, 0.601, 0.8327]}, {"w": "Note", "b": [0.6073, 0.813, 0.6577, 0.8327]}, {"w": "that", "b": [0.664, 0.813, 0.7074, 0.8327]}, {"w": "you", "b": [0.7137, 0.813, 0.753, 0.8327]}, {"w": "have", "b": [0.7593, 0.813, 0.8098, 0.8327]}, {"w": "to", "b": [0.8161, 0.813, 0.8371, 0.8327]}, {"w": "pass", "b": [0.1799, 0.8335, 0.2261, 0.8532]}, {"w": "the", "b": [0.2324, 0.8335, 0.2661, 0.8532]}, {"w": "function", "b": [0.2724, 0.8335, 0.3621, 0.8532]}, {"w": "that", "b": [0.3684, 0.8335, 0.4118, 0.8532]}, {"w": "computes", "b": [0.4181, 0.8335, 0.5204, 0.8532]}, {"w": "the", "b": [0.5267, 0.8335, 0.5603, 0.8532]}, {"w": "loss", "b": [0.5667, 0.8335, 0.6059, 0.8532]}, {"w": "and", "b": [0.6122, 0.8335, 0.6529, 0.8532]}, {"w": "the", "b": [0.6592, 0.8335, 0.6928, 0.8532]}, {"w": "function", "b": [0.6991, 0.8335, 0.7888, 0.8532]}, {"w": "that", "b": [0.7951, 0.8335, 0.8386, 0.8532]}, {"w": "computes", "b": [0.1799, 0.854, 0.2822, 0.8737]}, {"w": "the", "b": [0.2885, 0.854, 0.3221, 0.8737]}, {"w": "gradients", "b": [0.3284, 0.854, 0.4293, 0.8737]}, {"w": "as", "b": [0.4356, 0.854, 0.458, 0.8737]}, {"w": "two", "b": [0.4643, 0.854, 0.5036, 0.8737]}, {"w": "separate", "b": [0.5099, 0.854, 0.6009, 0.8737]}, {"w": "arguments.", "b": [0.6072, 0.854, 0.7284, 0.8737]}, {"w": "4", "b": [0.1799, 0.8745, 0.1925, 0.8942]}, {"w": "Saves", "b": [0.1988, 0.8745, 0.259, 0.8942]}, {"w": "the", "b": [0.2654, 0.8745, 0.299, 0.8942]}, {"w": "current", "b": [0.3053, 0.8745, 0.3861, 0.8942]}, {"w": "generated", "b": [0.3924, 0.8745, 0.4989, 0.8942]}, {"w": "image.", "b": [0.5052, 0.8745, 0.5759, 0.8942]}]}]}, {"page": 385, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 8.8 shows what you get. Keep in mind that what this technique achieves is merely a form of image retexturing, or texture transfer. It works best with style--reference images that are strongly textured and highly self-similar, and with content targets that don’t require high levels of detail in order to be recognizable. It typically can’t achieve fairly abstract feats such as transferring the style of one portrait to another. The algorithm is closer to classical signal processing than to AI, so don’t expect it to work like magic!", "words": [{"w": "Figure", "b": [0.1294, 0.0857, 0.1953, 0.1054]}, {"w": "8.8", "b": [0.2016, 0.0857, 0.2331, 0.1054]}, {"w": "shows", "b": [0.2394, 0.0857, 0.3025, 0.1054]}, {"w": "what", "b": [0.3088, 0.0857, 0.3578, 0.1054]}, {"w": "you", "b": [0.3641, 0.0857, 0.402, 0.1054]}, {"w": "get.", "b": [0.4083, 0.0857, 0.4454, 0.1054]}, {"w": "Keep", "b": [0.4517, 0.0857, 0.5049, 0.1054]}, {"w": "in", "b": [0.5112, 0.0857, 0.5309, 0.1054]}, {"w": "mind", "b": [0.5372, 0.0857, 0.589, 0.1054]}, {"w": "that", "b": [0.5953, 0.0857, 0.6332, 0.1054]}, {"w": "what", "b": [0.6395, 0.0857, 0.6885, 0.1054]}, {"w": "this", "b": [0.6948, 0.0857, 0.7313, 0.1054]}, {"w": "technique", "b": [0.7376, 0.0857, 0.8357, 0.1054]}, {"w": "achieves", "b": [0.1294, 0.1062, 0.2163, 0.1259]}, {"w": "is", "b": [0.2226, 0.1062, 0.2394, 0.1259]}, {"w": "merely", "b": [0.2457, 0.1062, 0.3158, 0.1259]}, {"w": "a", "b": [0.3221, 0.1062, 0.3333, 0.1259]}, {"w": "form", "b": [0.3396, 0.1062, 0.3886, 0.1259]}, {"w": "of", "b": [0.3949, 0.1062, 0.4159, 0.1259]}, {"w": "image", "b": [0.4222, 0.1062, 0.4839, 0.1259]}, {"w": "retexturing,", "b": [0.4902, 0.1062, 0.6072, 0.1259]}, {"w": "or", "b": [0.6135, 0.1062, 0.6345, 0.1259]}, {"w": "texture", "b": [0.6408, 0.1062, 0.7109, 0.1259]}, {"w": "transfer.", "b": [0.7172, 0.1062, 0.799, 0.1259]}, {"w": "It", "b": [0.8053, 0.1062, 0.8207, 0.1259]}, {"w": "works", "b": [0.1294, 0.1267, 0.1911, 0.1464]}, {"w": "best", "b": [0.1974, 0.1267, 0.238, 0.1464]}, {"w": "with", "b": [0.2443, 0.1267, 0.2892, 0.1464]}, {"w": "style--reference", "b": [0.2955, 0.1267, 0.4537, 0.1464]}, {"w": "images", "b": [0.46, 0.1267, 0.5315, 0.1464]}, {"w": "that", "b": [0.5378, 0.1267, 0.5757, 0.1464]}, {"w": "are", "b": [0.582, 0.1267, 0.6128, 0.1464]}, {"w": "strongly", "b": [0.6191, 0.1267, 0.7018, 0.1464]}, {"w": "textured", "b": [0.7081, 0.1267, 0.7907, 0.1464]}, {"w": "and", "b": [0.797, 0.1267, 0.8335, 0.1464]}, {"w": "highly", "b": [0.1294, 0.1472, 0.1939, 0.1669]}, {"w": "self-similar,", "b": [0.2002, 0.1472, 0.3204, 0.1669]}, {"w": "and", "b": [0.3267, 0.1472, 0.3631, 0.1669]}, {"w": "with", "b": [0.3694, 0.1472, 0.4143, 0.1669]}, {"w": "content", "b": [0.4206, 0.1472, 0.4948, 0.1669]}, {"w": "targets", "b": [0.5011, 0.1472, 0.5679, 0.1669]}, {"w": "that", "b": [0.5742, 0.1472, 0.612, 0.1669]}, {"w": "don’t", "b": [0.6183, 0.1472, 0.6711, 0.1669]}, {"w": "require", "b": [0.6774, 0.1472, 0.7489, 0.1669]}, {"w": "high", "b": [0.7552, 0.1472, 0.8, 0.1669]}, {"w": "levels", "b": [0.8063, 0.1472, 0.8652, 0.1669]}, {"w": "of", "b": [0.1294, 0.1677, 0.1504, 0.1874]}, {"w": "detail", "b": [0.1567, 0.1677, 0.2128, 0.1874]}, {"w": "in", "b": [0.2191, 0.1677, 0.2387, 0.1874]}, {"w": "order", "b": [0.245, 0.1677, 0.2982, 0.1874]}, {"w": "to", "b": [0.3046, 0.1677, 0.3242, 0.1874]}, {"w": "be", "b": [0.3305, 0.1677, 0.3543, 0.1874]}, {"w": "recognizable.", "b": [0.3606, 0.1677, 0.4958, 0.1874]}, {"w": "It", "b": [0.5021, 0.1677, 0.5175, 0.1874]}, {"w": "typically", "b": [0.5238, 0.1677, 0.6121, 0.1874]}, {"w": "can’t", "b": [0.6184, 0.1677, 0.6683, 0.1874]}, {"w": "achieve", "b": [0.6746, 0.1677, 0.7516, 0.1874]}, {"w": "fairly", "b": [0.7579, 0.1677, 0.8126, 0.1874]}, {"w": "abstract", "b": [0.1294, 0.1882, 0.2079, 0.2079]}, {"w": "feats", "b": [0.2142, 0.1882, 0.2618, 0.2079]}, {"w": "such", "b": [0.2681, 0.1882, 0.3143, 0.2079]}, {"w": "as", "b": [0.3206, 0.1882, 0.3417, 0.2079]}, {"w": "transferring", "b": [0.3479, 0.1882, 0.4656, 0.2079]}, {"w": "the", "b": [0.4719, 0.1882, 0.5027, 0.2079]}, {"w": "style", "b": [0.509, 0.1882, 0.5567, 0.2079]}, {"w": "of", "b": [0.563, 0.1882, 0.584, 0.2079]}, {"w": "one", "b": [0.5903, 0.1882, 0.6268, 0.2079]}, {"w": "portrait", "b": [0.6331, 0.1882, 0.7073, 0.2079]}, {"w": "to", "b": [0.7136, 0.1882, 0.7333, 0.2079]}, {"w": "another.", "b": [0.7396, 0.1882, 0.8201, 0.2079]}, {"w": "The", "b": [0.8264, 0.1882, 0.8656, 0.2079]}, {"w": "algorithm", "b": [0.1294, 0.2087, 0.2275, 0.2284]}, {"w": "is", "b": [0.2338, 0.2087, 0.2506, 0.2284]}, {"w": "closer", "b": [0.257, 0.2087, 0.3172, 0.2284]}, {"w": "to", "b": [0.3235, 0.2087, 0.3431, 0.2284]}, {"w": "classical", "b": [0.3494, 0.2087, 0.4349, 0.2284]}, {"w": "signal", "b": [0.4412, 0.2087, 0.5015, 0.2284]}, {"w": "processing", "b": [0.5078, 0.2087, 0.6157, 0.2284]}, {"w": "than", "b": [0.622, 0.2087, 0.6654, 0.2284]}, {"w": "to", "b": [0.6717, 0.2087, 0.6913, 0.2284]}, {"w": "AI,", "b": [0.6976, 0.2087, 0.7306, 0.2284]}, {"w": "so", "b": [0.7369, 0.2087, 0.7593, 0.2284]}, {"w": "don’t", "b": [0.7656, 0.2087, 0.8183, 0.2284]}, {"w": "expect", "b": [0.1294, 0.2292, 0.1953, 0.2489]}, {"w": "it", "b": [0.2016, 0.2292, 0.2156, 0.2489]}, {"w": "to", "b": [0.2219, 0.2292, 0.2415, 0.2489]}, {"w": "work", "b": [0.2478, 0.2292, 0.2997, 0.2489]}, {"w": "like", "b": [0.306, 0.2292, 0.3438, 0.2489]}, {"w": "magic!", "b": [0.3501, 0.2292, 0.4202, 0.2489]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.8. Some example results", "words": [{"w": "Figure", "b": [0.1294, 0.2715, 0.1827, 0.2863]}, {"w": "8.8.", "b": [0.1874, 0.2715, 0.2158, 0.2863]}, {"w": "Some", "b": [0.2205, 0.2715, 0.2646, 0.2863]}, {"w": "example", "b": [0.2693, 0.2715, 0.3366, 0.2863]}, {"w": "results", "b": [0.3413, 0.2715, 0.3946, 0.2863]}]}]}, {"page": 386, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": []}, {"page": 387, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Additionally, note that running this style-transfer algorithm is slow. But the transformation operated by the setup is simple enough that it can be learned by a small, fast feedforward convnet as well—as long as you have appropriate training data available. Fast style transfer can thus be achieved by first spending a lot of compute cycles to generate input- output training examples for a fixed style-reference image, using the method outlined here, and then training a simple convnet to learn this style-specific transformation. Once that’s done, stylizing a given image is instantaneous: it’s just a forward pass of this small convnet.", "words": [{"w": "Additionally,", "b": [0.1294, 0.0857, 0.2616, 0.1054]}, {"w": "note", "b": [0.2679, 0.0857, 0.3113, 0.1054]}, {"w": "that", "b": [0.3177, 0.0857, 0.3555, 0.1054]}, {"w": "running", "b": [0.3618, 0.0857, 0.4403, 0.1054]}, {"w": "this", "b": [0.4466, 0.0857, 0.483, 0.1054]}, {"w": "style-transfer", "b": [0.4893, 0.0857, 0.6224, 0.1054]}, {"w": "algorithm", "b": [0.6287, 0.0857, 0.7268, 0.1054]}, {"w": "is", "b": [0.7331, 0.0857, 0.75, 0.1054]}, {"w": "slow.", "b": [0.7563, 0.0857, 0.8085, 0.1054]}, {"w": "But", "b": [0.8148, 0.0857, 0.8513, 0.1054]}, {"w": "the", "b": [0.1294, 0.1062, 0.1602, 0.1259]}, {"w": "transformation", "b": [0.1665, 0.1062, 0.3151, 0.1259]}, {"w": "operated", "b": [0.3214, 0.1062, 0.4082, 0.1259]}, {"w": "by", "b": [0.4145, 0.1062, 0.4398, 0.1259]}, {"w": "the", "b": [0.4461, 0.1062, 0.4769, 0.1259]}, {"w": "setup", "b": [0.4832, 0.1062, 0.5365, 0.1259]}, {"w": "is", "b": [0.5428, 0.1062, 0.5596, 0.1259]}, {"w": "simple", "b": [0.5659, 0.1062, 0.6332, 0.1259]}, {"w": "enough", "b": [0.6394, 0.1062, 0.7137, 0.1259]}, {"w": "that", "b": [0.72, 0.1062, 0.7578, 0.1259]}, {"w": "it", "b": [0.7641, 0.1062, 0.7781, 0.1259]}, {"w": "can", "b": [0.7845, 0.1062, 0.8195, 0.1259]}, {"w": "be", "b": [0.8258, 0.1062, 0.8496, 0.1259]}, {"w": "learned", "b": [0.1294, 0.1267, 0.2037, 0.1464]}, {"w": "by", "b": [0.21, 0.1267, 0.2352, 0.1464]}, {"w": "a", "b": [0.2415, 0.1267, 0.2527, 0.1464]}, {"w": "small,", "b": [0.259, 0.1267, 0.32, 0.1464]}, {"w": "fast", "b": [0.3263, 0.1267, 0.3627, 0.1464]}, {"w": "feedforward", "b": [0.369, 0.1267, 0.4923, 0.1464]}, {"w": "convnet", "b": [0.4986, 0.1267, 0.5784, 0.1464]}, {"w": "as", "b": [0.5847, 0.1267, 0.6058, 0.1464]}, {"w": "well—as", "b": [0.6121, 0.1267, 0.7017, 0.1464]}, {"w": "long", "b": [0.708, 0.1267, 0.7529, 0.1464]}, {"w": "as", "b": [0.7592, 0.1267, 0.7802, 0.1464]}, {"w": "you", "b": [0.7865, 0.1267, 0.8244, 0.1464]}, {"w": "have", "b": [0.1294, 0.1472, 0.177, 0.1669]}, {"w": "appropriate", "b": [0.1833, 0.1472, 0.2982, 0.1669]}, {"w": "training", "b": [0.3045, 0.1472, 0.383, 0.1669]}, {"w": "data", "b": [0.3893, 0.1472, 0.4313, 0.1669]}, {"w": "available.", "b": [0.4376, 0.1472, 0.535, 0.1669]}, {"w": "Fast", "b": [0.5412, 0.1472, 0.5833, 0.1669]}, {"w": "style", "b": [0.5896, 0.1472, 0.6372, 0.1669]}, {"w": "transfer", "b": [0.6435, 0.1472, 0.7206, 0.1669]}, {"w": "can", "b": [0.7269, 0.1472, 0.7619, 0.1669]}, {"w": "thus", "b": [0.7682, 0.1472, 0.8103, 0.1669]}, {"w": "be", "b": [0.8166, 0.1472, 0.8404, 0.1669]}, {"w": "achieved", "b": [0.1294, 0.1677, 0.2191, 0.1874]}, {"w": "by", "b": [0.2254, 0.1677, 0.2506, 0.1874]}, {"w": "first", "b": [0.2569, 0.1677, 0.2975, 0.1874]}, {"w": "spending", "b": [0.3038, 0.1677, 0.3949, 0.1874]}, {"w": "a", "b": [0.4012, 0.1677, 0.4124, 0.1874]}, {"w": "lot", "b": [0.4188, 0.1677, 0.4454, 0.1874]}, {"w": "of", "b": [0.4517, 0.1677, 0.4727, 0.1874]}, {"w": "compute", "b": [0.479, 0.1677, 0.5659, 0.1874]}, {"w": "cycles", "b": [0.5722, 0.1677, 0.6352, 0.1874]}, {"w": "to", "b": [0.6415, 0.1677, 0.6612, 0.1874]}, {"w": "generate", "b": [0.6675, 0.1677, 0.7529, 0.1874]}, {"w": "input-", "b": [0.7592, 0.1677, 0.8195, 0.1874]}, {"w": "output", "b": [0.1294, 0.1882, 0.1939, 0.2079]}, {"w": "training", "b": [0.2002, 0.1882, 0.2787, 0.2079]}, {"w": "examples", "b": [0.285, 0.1882, 0.3803, 0.2079]}, {"w": "for", "b": [0.3865, 0.1882, 0.4159, 0.2079]}, {"w": "a", "b": [0.4222, 0.1882, 0.4334, 0.2079]}, {"w": "fixed", "b": [0.4397, 0.1882, 0.4916, 0.2079]}, {"w": "style-reference", "b": [0.4979, 0.1882, 0.6478, 0.2079]}, {"w": "image,", "b": [0.6541, 0.1882, 0.722, 0.2079]}, {"w": "using", "b": [0.7283, 0.1882, 0.783, 0.2079]}, {"w": "the", "b": [0.7893, 0.1882, 0.8201, 0.2079]}, {"w": "method", "b": [0.1294, 0.2087, 0.2051, 0.2284]}, {"w": "outlined", "b": [0.2114, 0.2087, 0.2941, 0.2284]}, {"w": "here,", "b": [0.3004, 0.2087, 0.3501, 0.2284]}, {"w": "and", "b": [0.3564, 0.2087, 0.3928, 0.2284]}, {"w": "then", "b": [0.3992, 0.2087, 0.4426, 0.2284]}, {"w": "training", "b": [0.4489, 0.2087, 0.5274, 0.2284]}, {"w": "a", "b": [0.5337, 0.2087, 0.5449, 0.2284]}, {"w": "simple", "b": [0.5512, 0.2087, 0.6185, 0.2284]}, {"w": "convnet", "b": [0.6248, 0.2087, 0.7046, 0.2284]}, {"w": "to", "b": [0.7109, 0.2087, 0.7306, 0.2284]}, {"w": "learn", "b": [0.7369, 0.2087, 0.7873, 0.2284]}, {"w": "this", "b": [0.7936, 0.2087, 0.8301, 0.2284]}, {"w": "style-specific", "b": [0.1294, 0.2292, 0.2639, 0.2489]}, {"w": "transformation.", "b": [0.2702, 0.2292, 0.425, 0.2489]}, {"w": "Once", "b": [0.4313, 0.2292, 0.4846, 0.2489]}, {"w": "that’s", "b": [0.4909, 0.2292, 0.5455, 0.2489]}, {"w": "done,", "b": [0.5518, 0.2292, 0.6071, 0.2489]}, {"w": "stylizing", "b": [0.6134, 0.2292, 0.7003, 0.2489]}, {"w": "a", "b": [0.7067, 0.2292, 0.7179, 0.2489]}, {"w": "given", "b": [0.7242, 0.2292, 0.7802, 0.2489]}, {"w": "image", "b": [0.7865, 0.2292, 0.8482, 0.2489]}, {"w": "is", "b": [0.1294, 0.2497, 0.1462, 0.2694]}, {"w": "instantaneous:", "b": [0.1525, 0.2497, 0.2969, 0.2694]}, {"w": "it’s", "b": [0.3032, 0.2497, 0.334, 0.2694]}, {"w": "just", "b": [0.3403, 0.2497, 0.3768, 0.2694]}, {"w": "a", "b": [0.3831, 0.2497, 0.3943, 0.2694]}, {"w": "forward", "b": [0.4006, 0.2497, 0.4804, 0.2694]}, {"w": "pass", "b": [0.4867, 0.2497, 0.5302, 0.2694]}, {"w": "of", "b": [0.5365, 0.2497, 0.5575, 0.2694]}, {"w": "this", "b": [0.5638, 0.2497, 0.6002, 0.2694]}, {"w": "small", "b": [0.6065, 0.2497, 0.6612, 0.2694]}, {"w": "convnet.", "b": [0.6675, 0.2497, 0.7537, 0.2694]}]}, {"id": "b_1", "type": "paragraph", "text": "8.3.4. Wrapping up", "words": [{"w": "8.3.4.", "b": [0.1294, 0.2969, 0.1862, 0.3167]}, {"w": "Wrapping", "b": [0.1925, 0.2969, 0.3028, 0.3167]}, {"w": "up", "b": [0.3091, 0.2969, 0.3371, 0.3167]}]}, {"id": "b_2", "type": "paragraph", "text": "Style transfer consists of creating a new image that preserves the contents of a target image while also capturing the style of a reference image. Content can be captured by the high-level activations of a convnet. Style can be captured by the internal correlations of the activations of different layers of a convnet. Hence, deep learning allows style transfer to be formulated as an optimization process using a loss defined with a pretrained convnet. Starting from this basic idea, many variants and refinements are possible.", "words": [{"w": "Style", "b": [0.1799, 0.3352, 0.2317, 0.355]}, {"w": "transfer", "b": [0.238, 0.3352, 0.3151, 0.355]}, {"w": "consists", "b": [0.3214, 0.3352, 0.4013, 0.355]}, {"w": "of", "b": [0.4076, 0.3352, 0.4286, 0.355]}, {"w": "creating", "b": [0.4349, 0.3352, 0.5161, 0.355]}, {"w": "a", "b": [0.5225, 0.3352, 0.5337, 0.355]}, {"w": "new", "b": [0.54, 0.3352, 0.582, 0.355]}, {"w": "image", "b": [0.5883, 0.3352, 0.6499, 0.355]}, {"w": "that", "b": [0.6563, 0.3352, 0.6941, 0.355]}, {"w": "preserves", "b": [0.7004, 0.3352, 0.7956, 0.355]}, {"w": "the", "b": [0.802, 0.3352, 0.8328, 0.355]}, {"w": "contents", "b": [0.1799, 0.3557, 0.2639, 0.3755]}, {"w": "of", "b": [0.2702, 0.3557, 0.2913, 0.3755]}, {"w": "a", "b": [0.2976, 0.3557, 0.3088, 0.3755]}, {"w": "target", "b": [0.3151, 0.3557, 0.372, 0.3755]}, {"w": "image", "b": [0.3783, 0.3557, 0.44, 0.3755]}, {"w": "while", "b": [0.4463, 0.3557, 0.5023, 0.3755]}, {"w": "also", "b": [0.5087, 0.3557, 0.5493, 0.3755]}, {"w": "capturing", "b": [0.5556, 0.3557, 0.6509, 0.3755]}, {"w": "the", "b": [0.6572, 0.3557, 0.688, 0.3755]}, {"w": "style", "b": [0.6943, 0.3557, 0.742, 0.3755]}, {"w": "of", "b": [0.7482, 0.3557, 0.7692, 0.3755]}, {"w": "a", "b": [0.7755, 0.3557, 0.7867, 0.3755]}, {"w": "reference", "b": [0.1799, 0.3762, 0.2737, 0.396]}, {"w": "image.", "b": [0.28, 0.3762, 0.3479, 0.396]}, {"w": "Content", "b": [0.1799, 0.3967, 0.2598, 0.4165]}, {"w": "can", "b": [0.2661, 0.3967, 0.3011, 0.4165]}, {"w": "be", "b": [0.3074, 0.3967, 0.3312, 0.4165]}, {"w": "captured", "b": [0.3375, 0.3967, 0.4244, 0.4165]}, {"w": "by", "b": [0.4307, 0.3967, 0.4559, 0.4165]}, {"w": "the", "b": [0.4622, 0.3967, 0.493, 0.4165]}, {"w": "high-level", "b": [0.4993, 0.3967, 0.6016, 0.4165]}, {"w": "activations", "b": [0.6079, 0.3967, 0.7172, 0.4165]}, {"w": "of", "b": [0.7235, 0.3967, 0.7445, 0.4165]}, {"w": "a", "b": [0.7508, 0.3967, 0.762, 0.4165]}, {"w": "convnet.", "b": [0.7684, 0.3967, 0.8545, 0.4165]}, {"w": "Style", "b": [0.1799, 0.4172, 0.2317, 0.437]}, {"w": "can", "b": [0.238, 0.4172, 0.273, 0.437]}, {"w": "be", "b": [0.2794, 0.4172, 0.3032, 0.437]}, {"w": "captured", "b": [0.3095, 0.4172, 0.3963, 0.437]}, {"w": "by", "b": [0.4026, 0.4172, 0.4279, 0.437]}, {"w": "the", "b": [0.4342, 0.4172, 0.465, 0.437]}, {"w": "internal", "b": [0.4713, 0.4172, 0.5484, 0.437]}, {"w": "correlations", "b": [0.5547, 0.4172, 0.6738, 0.437]}, {"w": "of", "b": [0.6801, 0.4172, 0.7011, 0.437]}, {"w": "the", "b": [0.7074, 0.4172, 0.7382, 0.437]}, {"w": "activations", "b": [0.7445, 0.4172, 0.8538, 0.437]}, {"w": "of", "b": [0.1799, 0.4377, 0.2009, 0.4575]}, {"w": "different", "b": [0.2072, 0.4377, 0.2936, 0.4575]}, {"w": "layers", "b": [0.2999, 0.4377, 0.3601, 0.4575]}, {"w": "of", "b": [0.3664, 0.4377, 0.3874, 0.4575]}, {"w": "a", "b": [0.3937, 0.4377, 0.4049, 0.4575]}, {"w": "convnet.", "b": [0.4113, 0.4377, 0.4974, 0.4575]}, {"w": "Hence,", "b": [0.1799, 0.4582, 0.2506, 0.478]}, {"w": "deep", "b": [0.2569, 0.4582, 0.3045, 0.478]}, {"w": "learning", "b": [0.3108, 0.4582, 0.3935, 0.478]}, {"w": "allows", "b": [0.3998, 0.4582, 0.4657, 0.478]}, {"w": "style", "b": [0.472, 0.4582, 0.5196, 0.478]}, {"w": "transfer", "b": [0.5259, 0.4582, 0.603, 0.478]}, {"w": "to", "b": [0.6093, 0.4582, 0.6289, 0.478]}, {"w": "be", "b": [0.6352, 0.4582, 0.659, 0.478]}, {"w": "formulated", "b": [0.6653, 0.4582, 0.776, 0.478]}, {"w": "as", "b": [0.7823, 0.4582, 0.8033, 0.478]}, {"w": "an", "b": [0.8096, 0.4582, 0.8335, 0.478]}, {"w": "optimization", "b": [0.1799, 0.4787, 0.3074, 0.4985]}, {"w": "process", "b": [0.3137, 0.4787, 0.3894, 0.4985]}, {"w": "using", "b": [0.3957, 0.4787, 0.4503, 0.4985]}, {"w": "a", "b": [0.4566, 0.4787, 0.4678, 0.4985]}, {"w": "loss", "b": [0.4741, 0.4787, 0.5134, 0.4985]}, {"w": "defined", "b": [0.5197, 0.4787, 0.5954, 0.4985]}, {"w": "with", "b": [0.6017, 0.4787, 0.6465, 0.4985]}, {"w": "a", "b": [0.6528, 0.4787, 0.664, 0.4985]}, {"w": "pretrained", "b": [0.6703, 0.4787, 0.7726, 0.4985]}, {"w": "convnet.", "b": [0.7788, 0.4787, 0.865, 0.4985]}, {"w": "Starting", "b": [0.1799, 0.4992, 0.2598, 0.519]}, {"w": "from", "b": [0.2661, 0.4992, 0.3151, 0.519]}, {"w": "this", "b": [0.3214, 0.4992, 0.3579, 0.519]}, {"w": "basic", "b": [0.3642, 0.4992, 0.416, 0.519]}, {"w": "idea,", "b": [0.4223, 0.4992, 0.4706, 0.519]}, {"w": "many", "b": [0.4769, 0.4992, 0.533, 0.519]}, {"w": "variants", "b": [0.5393, 0.4992, 0.6192, 0.519]}, {"w": "and", "b": [0.6255, 0.4992, 0.6619, 0.519]}, {"w": "refinements", "b": [0.6682, 0.4992, 0.7873, 0.519]}, {"w": "are", "b": [0.7936, 0.4992, 0.8244, 0.519]}, {"w": "possible.", "b": [0.1799, 0.5197, 0.2689, 0.5395]}]}, {"id": "b_3", "type": "paragraph", "text": "8.4. Generating images with variational autoencoders", "words": [{"w": "8.4.", "b": [0.1294, 0.5766, 0.172, 0.5988]}, {"w": "Generating", "b": [0.1791, 0.5766, 0.3162, 0.5988]}, {"w": "images", "b": [0.3233, 0.5766, 0.4069, 0.5988]}, {"w": "with", "b": [0.414, 0.5766, 0.4676, 0.5988]}, {"w": "variational", "b": [0.4747, 0.5766, 0.6071, 0.5988]}, {"w": "autoencoders", "b": [0.6142, 0.5766, 0.775, 0.5988]}]}, {"id": "b_4", "type": "paragraph", "text": "Sampling from a latent space of images to create entirely new images or edit existing ones is currently the most popular and successful application of creative AI. In this section and the next, we’ll review some high-level concepts pertaining to image generation, alongside implementations details relative to the two main techniques in this domain: variational autoencoders (VAEs) and generative adversarial networks (GANs). The techniques we present here aren’t specific to images—you could develop latent spaces of sound, music, or even text, using GANs and VAEs—but in practice, the most interesting results have been obtained with pictures, and that’s what we focus on here.", "words": [{"w": "Sampling", "b": [0.1294, 0.6222, 0.2261, 0.642]}, {"w": "from", "b": [0.2324, 0.6222, 0.2815, 0.642]}, {"w": "a", "b": [0.2878, 0.6222, 0.299, 0.642]}, {"w": "latent", "b": [0.3053, 0.6222, 0.3613, 0.642]}, {"w": "space", "b": [0.3676, 0.6222, 0.4237, 0.642]}, {"w": "of", "b": [0.43, 0.6222, 0.451, 0.642]}, {"w": "images", "b": [0.4573, 0.6222, 0.5288, 0.642]}, {"w": "to", "b": [0.5351, 0.6222, 0.5547, 0.642]}, {"w": "create", "b": [0.561, 0.6222, 0.6212, 0.642]}, {"w": "entirely", "b": [0.6275, 0.6222, 0.7046, 0.642]}, {"w": "new", "b": [0.7109, 0.6222, 0.7529, 0.642]}, {"w": "images", "b": [0.7592, 0.6222, 0.8307, 0.642]}, {"w": "or", "b": [0.837, 0.6222, 0.858, 0.642]}, {"w": "edit", "b": [0.1294, 0.6427, 0.1673, 0.6625]}, {"w": "existing", "b": [0.1736, 0.6427, 0.2534, 0.6625]}, {"w": "ones", "b": [0.2598, 0.6427, 0.306, 0.6625]}, {"w": "is", "b": [0.3123, 0.6427, 0.3291, 0.6625]}, {"w": "currently", "b": [0.3354, 0.6427, 0.4265, 0.6625]}, {"w": "the", "b": [0.4328, 0.6427, 0.4636, 0.6625]}, {"w": "most", "b": [0.4699, 0.6427, 0.519, 0.6625]}, {"w": "popular", "b": [0.5253, 0.6427, 0.6024, 0.6625]}, {"w": "and", "b": [0.6087, 0.6427, 0.6451, 0.6625]}, {"w": "successful", "b": [0.6513, 0.6427, 0.755, 0.6625]}, {"w": "application", "b": [0.1294, 0.6632, 0.2415, 0.683]}, {"w": "of", "b": [0.2478, 0.6632, 0.2688, 0.683]}, {"w": "creative", "b": [0.2751, 0.6632, 0.355, 0.683]}, {"w": "AI.", "b": [0.3613, 0.6632, 0.3942, 0.683]}, {"w": "In", "b": [0.4005, 0.6632, 0.4215, 0.683]}, {"w": "this", "b": [0.4278, 0.6632, 0.4643, 0.683]}, {"w": "section", "b": [0.4706, 0.6632, 0.5421, 0.683]}, {"w": "and", "b": [0.5484, 0.6632, 0.5848, 0.683]}, {"w": "the", "b": [0.5911, 0.6632, 0.6219, 0.683]}, {"w": "next,", "b": [0.6282, 0.6632, 0.678, 0.683]}, {"w": "we’ll", "b": [0.6843, 0.6632, 0.7361, 0.683]}, {"w": "review", "b": [0.7424, 0.6632, 0.8111, 0.683]}, {"w": "some", "b": [0.8174, 0.6632, 0.8706, 0.683]}, {"w": "high-level", "b": [0.1294, 0.6837, 0.2317, 0.7035]}, {"w": "concepts", "b": [0.238, 0.6837, 0.3263, 0.7035]}, {"w": "pertaining", "b": [0.3326, 0.6837, 0.4349, 0.7035]}, {"w": "to", "b": [0.4412, 0.6837, 0.4608, 0.7035]}, {"w": "image", "b": [0.4671, 0.6837, 0.5288, 0.7035]}, {"w": "generation,", "b": [0.535, 0.6837, 0.6478, 0.7035]}, {"w": "alongside", "b": [0.6541, 0.6837, 0.7508, 0.7035]}, {"w": "implementations", "b": [0.1294, 0.7042, 0.2976, 0.724]}, {"w": "details", "b": [0.3039, 0.7042, 0.3698, 0.724]}, {"w": "relative", "b": [0.3761, 0.7042, 0.4517, 0.724]}, {"w": "to", "b": [0.458, 0.7042, 0.4777, 0.724]}, {"w": "the", "b": [0.484, 0.7042, 0.5148, 0.724]}, {"w": "two", "b": [0.5211, 0.7042, 0.5589, 0.724]}, {"w": "main", "b": [0.5652, 0.7042, 0.6157, 0.724]}, {"w": "techniques", "b": [0.622, 0.7042, 0.7299, 0.724]}, {"w": "in", "b": [0.7362, 0.7042, 0.7558, 0.724]}, {"w": "this", "b": [0.7621, 0.7042, 0.7986, 0.724]}, {"w": "domain:", "b": [0.1294, 0.7247, 0.2121, 0.7445]}, {"w": "variational", "b": [0.2184, 0.7247, 0.3305, 0.7445]}, {"w": "autoencoders", "b": [0.3368, 0.7247, 0.4727, 0.7445]}, {"w": "(VAEs)", "b": [0.479, 0.7247, 0.5542, 0.7445]}, {"w": "and", "b": [0.5605, 0.7247, 0.597, 0.7445]}, {"w": "generative", "b": [0.6033, 0.7247, 0.7097, 0.7445]}, {"w": "adversarial", "b": [0.716, 0.7247, 0.8324, 0.7445]}, {"w": "networks", "b": [0.1294, 0.7452, 0.2205, 0.765]}, {"w": "(GANs).", "b": [0.2268, 0.7452, 0.3143, 0.765]}, {"w": "The", "b": [0.3207, 0.7452, 0.3599, 0.765]}, {"w": "techniques", "b": [0.3662, 0.7452, 0.4741, 0.765]}, {"w": "we", "b": [0.4804, 0.7452, 0.5098, 0.765]}, {"w": "present", "b": [0.5161, 0.7452, 0.589, 0.765]}, {"w": "here", "b": [0.5953, 0.7452, 0.6387, 0.765]}, {"w": "aren’t", "b": [0.645, 0.7452, 0.7033, 0.765]}, {"w": "specific", "b": [0.7096, 0.7452, 0.7881, 0.765]}, {"w": "to", "b": [0.7944, 0.7452, 0.814, 0.765]}, {"w": "images—you", "b": [0.1294, 0.7657, 0.2639, 0.7855]}, {"w": "could", "b": [0.2702, 0.7657, 0.3263, 0.7855]}, {"w": "develop", "b": [0.3326, 0.7657, 0.4125, 0.7855]}, {"w": "latent", "b": [0.4188, 0.7657, 0.4748, 0.7855]}, {"w": "spaces", "b": [0.4811, 0.7657, 0.547, 0.7855]}, {"w": "of", "b": [0.5533, 0.7657, 0.5743, 0.7855]}, {"w": "sound,", "b": [0.5806, 0.7657, 0.6472, 0.7855]}, {"w": "music,", "b": [0.6535, 0.7657, 0.72, 0.7855]}, {"w": "or", "b": [0.7264, 0.7657, 0.7474, 0.7855]}, {"w": "even", "b": [0.7537, 0.7657, 0.8013, 0.7855]}, {"w": "text,", "b": [0.8075, 0.7657, 0.8517, 0.7855]}, {"w": "using", "b": [0.1294, 0.7862, 0.1841, 0.806]}, {"w": "GANs", "b": [0.1904, 0.7862, 0.2548, 0.806]}, {"w": "and", "b": [0.2611, 0.7862, 0.2976, 0.806]}, {"w": "VAEs—but", "b": [0.3039, 0.7862, 0.4198, 0.806]}, {"w": "in", "b": [0.4261, 0.7862, 0.4457, 0.806]}, {"w": "practice,", "b": [0.452, 0.7862, 0.5381, 0.806]}, {"w": "the", "b": [0.5444, 0.7862, 0.5753, 0.806]}, {"w": "most", "b": [0.5816, 0.7862, 0.6306, 0.806]}, {"w": "interesting", "b": [0.6369, 0.7862, 0.7435, 0.806]}, {"w": "results", "b": [0.7498, 0.7862, 0.8156, 0.806]}, {"w": "have", "b": [0.8219, 0.7862, 0.8696, 0.806]}, {"w": "been", "b": [0.1294, 0.8067, 0.177, 0.8265]}, {"w": "obtained", "b": [0.1833, 0.8067, 0.2702, 0.8265]}, {"w": "with", "b": [0.2765, 0.8067, 0.3214, 0.8265]}, {"w": "pictures,", "b": [0.3277, 0.8067, 0.4139, 0.8265]}, {"w": "and", "b": [0.4202, 0.8067, 0.4566, 0.8265]}, {"w": "that’s", "b": [0.4629, 0.8067, 0.5175, 0.8265]}, {"w": "what", "b": [0.5238, 0.8067, 0.5728, 0.8265]}, {"w": "we", "b": [0.5791, 0.8067, 0.6086, 0.8265]}, {"w": "focus", "b": [0.6149, 0.8067, 0.6695, 0.8265]}, {"w": "on", "b": [0.6758, 0.8067, 0.701, 0.8265]}, {"w": "here.", "b": [0.7073, 0.8067, 0.7571, 0.8265]}]}, {"id": "b_5", "type": "paragraph", "text": "8.4.1. Sampling from latent spaces of images", "words": [{"w": "8.4.1.", "b": [0.1294, 0.854, 0.1862, 0.8737]}, {"w": "Sampling", "b": [0.1925, 0.854, 0.2948, 0.8737]}, {"w": "from", "b": [0.3011, 0.854, 0.3539, 0.8737]}, {"w": "latent", "b": [0.3602, 0.854, 0.4219, 0.8737]}, {"w": "spaces", "b": [0.4282, 0.854, 0.4968, 0.8737]}, {"w": "of", "b": [0.5031, 0.854, 0.5241, 0.8737]}, {"w": "images", "b": [0.5304, 0.854, 0.6047, 0.8737]}]}]}, {"page": 388, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "The key idea of image generation is to develop a low-dimensional latent space of representations (which naturally is a vector space) where any point can be mapped to a realistic-looking image. The module capable of realizing this mapping, taking as input a latent point and outputting an image (a grid of pixels), is called a generator (in the case of GANs) or a decoder (in the case of VAEs). Once such a latent space has been developed, you can sample points from it, either deliberately or at random, and, by mapping them to image space, generate images that have never been seen before (see figure 8.9).", "words": [{"w": "The", "b": [0.1294, 0.0857, 0.1686, 0.1054]}, {"w": "key", "b": [0.1749, 0.0857, 0.2114, 0.1054]}, {"w": "idea", "b": [0.2177, 0.0857, 0.2597, 0.1054]}, {"w": "of", "b": [0.266, 0.0857, 0.287, 0.1054]}, {"w": "image", "b": [0.2933, 0.0857, 0.355, 0.1054]}, {"w": "generation", "b": [0.3613, 0.0857, 0.4678, 0.1054]}, {"w": "is", "b": [0.4741, 0.0857, 0.4909, 0.1054]}, {"w": "to", "b": [0.4972, 0.0857, 0.5168, 0.1054]}, {"w": "develop", "b": [0.5231, 0.0857, 0.603, 0.1054]}, {"w": "a", "b": [0.6093, 0.0857, 0.6205, 0.1054]}, {"w": "low-dimensional", "b": [0.6268, 0.0857, 0.7964, 0.1054]}, {"w": "latent", "b": [0.8026, 0.0857, 0.86, 0.1054]}, {"w": "space", "b": [0.1294, 0.1062, 0.1869, 0.1259]}, {"w": "of", "b": [0.1931, 0.1062, 0.2142, 0.1259]}, {"w": "representations", "b": [0.2205, 0.1062, 0.3732, 0.1259]}, {"w": "(which", "b": [0.3795, 0.1062, 0.4495, 0.1259]}, {"w": "naturally", "b": [0.4558, 0.1062, 0.5455, 0.1259]}, {"w": "is", "b": [0.5518, 0.1062, 0.5687, 0.1259]}, {"w": "a", "b": [0.575, 0.1062, 0.5862, 0.1259]}, {"w": "vector", "b": [0.5925, 0.1062, 0.6555, 0.1259]}, {"w": "space)", "b": [0.6618, 0.1062, 0.7262, 0.1259]}, {"w": "where", "b": [0.7325, 0.1062, 0.7942, 0.1259]}, {"w": "any", "b": [0.8005, 0.1062, 0.8369, 0.1259]}, {"w": "point", "b": [0.1294, 0.1267, 0.1813, 0.1464]}, {"w": "can", "b": [0.1876, 0.1267, 0.2226, 0.1464]}, {"w": "be", "b": [0.2289, 0.1267, 0.2527, 0.1464]}, {"w": "mapped", "b": [0.259, 0.1267, 0.3389, 0.1464]}, {"w": "to", "b": [0.3452, 0.1267, 0.3648, 0.1464]}, {"w": "a", "b": [0.3711, 0.1267, 0.3823, 0.1464]}, {"w": "realistic-looking", "b": [0.3886, 0.1267, 0.554, 0.1464]}, {"w": "image.", "b": [0.5603, 0.1267, 0.6283, 0.1464]}, {"w": "The", "b": [0.6346, 0.1267, 0.6738, 0.1464]}, {"w": "module", "b": [0.6801, 0.1267, 0.7558, 0.1464]}, {"w": "capable", "b": [0.7619, 0.1267, 0.839, 0.1464]}, {"w": "of", "b": [0.8453, 0.1267, 0.8663, 0.1464]}, {"w": "realizing", "b": [0.1294, 0.1472, 0.2177, 0.1669]}, {"w": "this", "b": [0.224, 0.1472, 0.2604, 0.1669]}, {"w": "mapping,", "b": [0.2667, 0.1472, 0.3613, 0.1669]}, {"w": "taking", "b": [0.3676, 0.1472, 0.4307, 0.1669]}, {"w": "as", "b": [0.437, 0.1472, 0.458, 0.1669]}, {"w": "input", "b": [0.4643, 0.1472, 0.5162, 0.1669]}, {"w": "a", "b": [0.5225, 0.1472, 0.5337, 0.1669]}, {"w": "latent", "b": [0.54, 0.1472, 0.5961, 0.1669]}, {"w": "point", "b": [0.6024, 0.1472, 0.6542, 0.1669]}, {"w": "and", "b": [0.6605, 0.1472, 0.697, 0.1669]}, {"w": "outputting", "b": [0.7033, 0.1472, 0.807, 0.1669]}, {"w": "an", "b": [0.8133, 0.1472, 0.8371, 0.1669]}, {"w": "image", "b": [0.1294, 0.1677, 0.1911, 0.1874]}, {"w": "(a", "b": [0.1974, 0.1677, 0.217, 0.1874]}, {"w": "grid", "b": [0.2233, 0.1677, 0.2639, 0.1874]}, {"w": "of", "b": [0.2702, 0.1677, 0.2912, 0.1874]}, {"w": "pixels),", "b": [0.2975, 0.1677, 0.3725, 0.1874]}, {"w": "is", "b": [0.3788, 0.1677, 0.3956, 0.1874]}, {"w": "called", "b": [0.402, 0.1677, 0.4622, 0.1874]}, {"w": "a", "b": [0.4685, 0.1677, 0.4797, 0.1874]}, {"w": "generator", "b": [0.4859, 0.1677, 0.5854, 0.1874]}, {"w": "(in", "b": [0.5917, 0.1677, 0.6198, 0.1874]}, {"w": "the", "b": [0.6261, 0.1677, 0.6569, 0.1874]}, {"w": "case", "b": [0.6632, 0.1677, 0.7066, 0.1874]}, {"w": "of", "b": [0.7129, 0.1677, 0.7339, 0.1874]}, {"w": "GANs)", "b": [0.7402, 0.1677, 0.8131, 0.1874]}, {"w": "or", "b": [0.8194, 0.1677, 0.8404, 0.1874]}, {"w": "a", "b": [0.8467, 0.1677, 0.8579, 0.1874]}, {"w": "decoder", "b": [0.1294, 0.1882, 0.2107, 0.2079]}, {"w": "(in", "b": [0.217, 0.1882, 0.245, 0.2079]}, {"w": "the", "b": [0.2513, 0.1882, 0.2821, 0.2079]}, {"w": "case", "b": [0.2884, 0.1882, 0.3318, 0.2079]}, {"w": "of", "b": [0.3381, 0.1882, 0.3592, 0.2079]}, {"w": "VAEs).", "b": [0.3655, 0.1882, 0.4385, 0.2079]}, {"w": "Once", "b": [0.4449, 0.1882, 0.4981, 0.2079]}, {"w": "such", "b": [0.5044, 0.1882, 0.5506, 0.2079]}, {"w": "a", "b": [0.5569, 0.1882, 0.5681, 0.2079]}, {"w": "latent", "b": [0.5744, 0.1882, 0.6305, 0.2079]}, {"w": "space", "b": [0.6368, 0.1882, 0.6928, 0.2079]}, {"w": "has", "b": [0.6991, 0.1882, 0.7328, 0.2079]}, {"w": "been", "b": [0.7391, 0.1882, 0.7867, 0.2079]}, {"w": "developed,", "b": [0.1294, 0.2087, 0.2394, 0.2284]}, {"w": "you", "b": [0.2457, 0.2087, 0.2835, 0.2284]}, {"w": "can", "b": [0.2898, 0.2087, 0.3249, 0.2284]}, {"w": "sample", "b": [0.3312, 0.2087, 0.4026, 0.2284]}, {"w": "points", "b": [0.4089, 0.2087, 0.4706, 0.2284]}, {"w": "from", "b": [0.4769, 0.2087, 0.526, 0.2284]}, {"w": "it,", "b": [0.5323, 0.2087, 0.5526, 0.2284]}, {"w": "either", "b": [0.5589, 0.2087, 0.6163, 0.2284]}, {"w": "deliberately", "b": [0.6227, 0.2087, 0.7417, 0.2284]}, {"w": "or", "b": [0.748, 0.2087, 0.7691, 0.2284]}, {"w": "at", "b": [0.7753, 0.2087, 0.7935, 0.2284]}, {"w": "random,", "b": [0.1294, 0.2292, 0.2128, 0.2489]}, {"w": "and,", "b": [0.2191, 0.2292, 0.2618, 0.2489]}, {"w": "by", "b": [0.2681, 0.2292, 0.2934, 0.2489]}, {"w": "mapping", "b": [0.2997, 0.2292, 0.388, 0.2489]}, {"w": "them", "b": [0.3943, 0.2292, 0.4447, 0.2489]}, {"w": "to", "b": [0.451, 0.2292, 0.4706, 0.2489]}, {"w": "image", "b": [0.4769, 0.2292, 0.5386, 0.2489]}, {"w": "space,", "b": [0.5449, 0.2292, 0.6072, 0.2489]}, {"w": "generate", "b": [0.6135, 0.2292, 0.699, 0.2489]}, {"w": "images", "b": [0.7053, 0.2292, 0.7768, 0.2489]}, {"w": "that", "b": [0.7831, 0.2292, 0.8209, 0.2489]}, {"w": "have", "b": [0.1294, 0.2497, 0.177, 0.2694]}, {"w": "never", "b": [0.1833, 0.2497, 0.2394, 0.2694]}, {"w": "been", "b": [0.2457, 0.2497, 0.2933, 0.2694]}, {"w": "seen", "b": [0.2996, 0.2497, 0.3444, 0.2694]}, {"w": "before", "b": [0.3507, 0.2497, 0.4152, 0.2694]}, {"w": "(see", "b": [0.4215, 0.2497, 0.4621, 0.2694]}, {"w": "figure", "b": [0.4683, 0.2497, 0.5286, 0.2694]}, {"w": "8.9).", "b": [0.5349, 0.2497, 0.5811, 0.2694]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.9. Learning a latent vector space of images, and using it to sample new images", "words": [{"w": "Figure", "b": [0.1294, 0.2875, 0.1827, 0.3023]}, {"w": "8.9.", "b": [0.1874, 0.2875, 0.2158, 0.3023]}, {"w": "Learning", "b": [0.2205, 0.2875, 0.2951, 0.3023]}, {"w": "a", "b": [0.2998, 0.2875, 0.3093, 0.3023]}, {"w": "latent", "b": [0.314, 0.2875, 0.3603, 0.3023]}, {"w": "vector", "b": [0.365, 0.2875, 0.4154, 0.3023]}, {"w": "space", "b": [0.4202, 0.2875, 0.4643, 0.3023]}, {"w": "of", "b": [0.469, 0.2875, 0.4848, 0.3023]}, {"w": "images,", "b": [0.4895, 0.2875, 0.5499, 0.3023]}, {"w": "and", "b": [0.5547, 0.2875, 0.5852, 0.3023]}, {"w": "using", "b": [0.5899, 0.2875, 0.633, 0.3023]}, {"w": "it", "b": [0.6377, 0.2875, 0.6493, 0.3023]}, {"w": "to", "b": [0.654, 0.2875, 0.6698, 0.3023]}, {"w": "sample", "b": [0.6745, 0.2875, 0.7313, 0.3023]}, {"w": "new", "b": [0.736, 0.2875, 0.7686, 0.3023]}, {"w": "images", "b": [0.7733, 0.2875, 0.829, 0.3023]}]}, {"id": "b_2", "type": "paragraph", "text": "GANs and VAEs are two different strategies for learning such latent spaces of image representations, each with its own characteristics. VAEs are great for learning latent spaces that are well structured, where specific directions encode a meaningful axis of variation in the data. GANs generate images that can potentially be highly realistic, but the latent space they come from may not have as much structure and continuity.", "words": [{"w": "GANs", "b": [0.1294, 0.6009, 0.1939, 0.6206]}, {"w": "and", "b": [0.2002, 0.6009, 0.2366, 0.6206]}, {"w": "VAEs", "b": [0.2429, 0.6009, 0.3013, 0.6206]}, {"w": "are", "b": [0.3076, 0.6009, 0.3384, 0.6206]}, {"w": "two", "b": [0.3447, 0.6009, 0.3826, 0.6206]}, {"w": "different", "b": [0.3889, 0.6009, 0.4753, 0.6206]}, {"w": "strategies", "b": [0.4816, 0.6009, 0.5769, 0.6206]}, {"w": "for", "b": [0.5832, 0.6009, 0.6126, 0.6206]}, {"w": "learning", "b": [0.6189, 0.6009, 0.7015, 0.6206]}, {"w": "such", "b": [0.7078, 0.6009, 0.7541, 0.6206]}, {"w": "latent", "b": [0.7604, 0.6009, 0.8164, 0.6206]}, {"w": "spaces", "b": [0.1294, 0.6214, 0.1953, 0.6411]}, {"w": "of", "b": [0.2016, 0.6214, 0.2226, 0.6411]}, {"w": "image", "b": [0.2289, 0.6214, 0.2905, 0.6411]}, {"w": "representations,", "b": [0.2968, 0.6214, 0.4559, 0.6411]}, {"w": "each", "b": [0.4622, 0.6214, 0.5084, 0.6411]}, {"w": "with", "b": [0.5147, 0.6214, 0.5595, 0.6411]}, {"w": "its", "b": [0.5658, 0.6214, 0.5897, 0.6411]}, {"w": "own", "b": [0.596, 0.6214, 0.6394, 0.6411]}, {"w": "characteristics.", "b": [0.6457, 0.6214, 0.7963, 0.6411]}, {"w": "VAEs", "b": [0.8025, 0.6214, 0.8609, 0.6411]}, {"w": "are", "b": [0.1294, 0.6419, 0.1602, 0.6616]}, {"w": "great", "b": [0.1665, 0.6419, 0.2169, 0.6616]}, {"w": "for", "b": [0.2233, 0.6419, 0.2527, 0.6616]}, {"w": "learning", "b": [0.259, 0.6419, 0.3416, 0.6616]}, {"w": "latent", "b": [0.3479, 0.6419, 0.404, 0.6616]}, {"w": "spaces", "b": [0.4103, 0.6419, 0.4761, 0.6616]}, {"w": "that", "b": [0.4824, 0.6419, 0.5203, 0.6616]}, {"w": "are", "b": [0.5266, 0.6419, 0.5574, 0.6616]}, {"w": "well", "b": [0.5637, 0.6419, 0.6071, 0.6616]}, {"w": "structured,", "b": [0.6134, 0.6419, 0.7206, 0.6616]}, {"w": "where", "b": [0.7269, 0.6419, 0.7886, 0.6616]}, {"w": "specific", "b": [0.1294, 0.6624, 0.2079, 0.6821]}, {"w": "directions", "b": [0.2142, 0.6624, 0.3137, 0.6821]}, {"w": "encode", "b": [0.32, 0.6624, 0.3914, 0.6821]}, {"w": "a", "b": [0.3977, 0.6624, 0.4089, 0.6821]}, {"w": "meaningful", "b": [0.4152, 0.6624, 0.5301, 0.6821]}, {"w": "axis", "b": [0.5364, 0.6624, 0.5771, 0.6821]}, {"w": "of", "b": [0.5834, 0.6624, 0.6044, 0.6821]}, {"w": "variation", "b": [0.6106, 0.6624, 0.7003, 0.6821]}, {"w": "in", "b": [0.7066, 0.6624, 0.7262, 0.6821]}, {"w": "the", "b": [0.7325, 0.6624, 0.7634, 0.6821]}, {"w": "data.", "b": [0.7697, 0.6624, 0.818, 0.6821]}, {"w": "GANs", "b": [0.1294, 0.6829, 0.1939, 0.7026]}, {"w": "generate", "b": [0.2002, 0.6829, 0.2856, 0.7026]}, {"w": "images", "b": [0.2919, 0.6829, 0.3634, 0.7026]}, {"w": "that", "b": [0.3697, 0.6829, 0.4075, 0.7026]}, {"w": "can", "b": [0.4138, 0.6829, 0.4488, 0.7026]}, {"w": "potentially", "b": [0.4552, 0.6829, 0.5631, 0.7026]}, {"w": "be", "b": [0.5694, 0.6829, 0.5932, 0.7026]}, {"w": "highly", "b": [0.5995, 0.6829, 0.664, 0.7026]}, {"w": "realistic,", "b": [0.6703, 0.6829, 0.7564, 0.7026]}, {"w": "but", "b": [0.7628, 0.6829, 0.795, 0.7026]}, {"w": "the", "b": [0.8013, 0.6829, 0.8321, 0.7026]}, {"w": "latent", "b": [0.1294, 0.7034, 0.1855, 0.7231]}, {"w": "space", "b": [0.1918, 0.7034, 0.2478, 0.7231]}, {"w": "they", "b": [0.2541, 0.7034, 0.2975, 0.7231]}, {"w": "come", "b": [0.3038, 0.7034, 0.3585, 0.7231]}, {"w": "from", "b": [0.3648, 0.7034, 0.4138, 0.7231]}, {"w": "may", "b": [0.4201, 0.7034, 0.4635, 0.7231]}, {"w": "not", "b": [0.4698, 0.7034, 0.5021, 0.7231]}, {"w": "have", "b": [0.5084, 0.7034, 0.556, 0.7231]}, {"w": "as", "b": [0.5623, 0.7034, 0.5833, 0.7231]}, {"w": "much", "b": [0.5896, 0.7034, 0.6457, 0.7231]}, {"w": "structure", "b": [0.652, 0.7034, 0.7402, 0.7231]}, {"w": "and", "b": [0.7466, 0.7034, 0.783, 0.7231]}, {"w": "continuity.", "b": [0.1294, 0.7239, 0.2364, 0.7436]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 8.10. A continuous space of faces generated by Tom White using VAEs", "words": [{"w": "Figure", "b": [0.1294, 0.7662, 0.1827, 0.781]}, {"w": "8.10.", "b": [0.1874, 0.7662, 0.2252, 0.781]}, {"w": "A", "b": [0.2299, 0.7662, 0.2436, 0.781]}, {"w": "continuous", "b": [0.2483, 0.7662, 0.3366, 0.781]}, {"w": "space", "b": [0.3414, 0.7662, 0.3855, 0.781]}, {"w": "of", "b": [0.3902, 0.7662, 0.406, 0.781]}, {"w": "faces", "b": [0.4107, 0.7662, 0.4507, 0.781]}, {"w": "generated", "b": [0.4554, 0.7662, 0.5352, 0.781]}, {"w": "by", "b": [0.54, 0.7662, 0.56, 0.781]}, {"w": "Tom", "b": [0.5647, 0.7662, 0.6008, 0.781]}, {"w": "White", "b": [0.6055, 0.7662, 0.6549, 0.781]}, {"w": "using", "b": [0.6596, 0.7662, 0.7028, 0.781]}, {"w": "VAEs", "b": [0.7075, 0.7662, 0.7524, 0.781]}]}]}, {"page": 389, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "8.4.2. Concept vectors for image editing", "words": [{"w": "8.4.2.", "b": [0.1294, 0.3959, 0.1862, 0.4156]}, {"w": "Concept", "b": [0.1925, 0.3959, 0.2822, 0.4156]}, {"w": "vectors", "b": [0.2885, 0.3959, 0.3655, 0.4156]}, {"w": "for", "b": [0.3718, 0.3959, 0.404, 0.4156]}, {"w": "image", "b": [0.4103, 0.3959, 0.4748, 0.4156]}, {"w": "editing", "b": [0.4811, 0.3959, 0.5554, 0.4156]}]}, {"id": "b_1", "type": "paragraph", "text": "We already hinted at the idea of a concept vector when we covered word embeddings in chapter 6. The idea is still the same: given a latent space of representations, or an embedding space, certain directions in the space may encode interesting axes of variation in the original data. In a latent space of images of faces, for instance, there may be a smile vectors, such that if latent point z is the embedded representation of a certain face, then latent point z + s is the embedded representation of the same face, smiling. Once you’ve identified such a vector, it then becomes possible to edit images by projecting them into the latent space, moving their representation in a meaningful way, and then decoding them back to image space. There are concept vectors for essentially any independent dimension of variation in image space—in the case of faces, you may discover vectors for adding sunglasses to a face, removing glasses, turning a male face into as female face, and so on. Figure 8.11 is an example of a smile vector, a concept vector discovered by Tom White from the Victoria University School of Design in New Zealand, using VAEs trained on a dataset of faces of celebrities (the CelebA dataset).", "words": [{"w": "We", "b": [0.1294, 0.4386, 0.1624, 0.4584]}, {"w": "already", "b": [0.1687, 0.4386, 0.2429, 0.4584]}, {"w": "hinted", "b": [0.2493, 0.4386, 0.3123, 0.4584]}, {"w": "at", "b": [0.3186, 0.4386, 0.3368, 0.4584]}, {"w": "the", "b": [0.3431, 0.4386, 0.374, 0.4584]}, {"w": "idea", "b": [0.3803, 0.4386, 0.4223, 0.4584]}, {"w": "of", "b": [0.4286, 0.4386, 0.4496, 0.4584]}, {"w": "a", "b": [0.4559, 0.4386, 0.4671, 0.4584]}, {"w": "concept", "b": [0.4734, 0.4386, 0.5518, 0.4584]}, {"w": "vector", "b": [0.5581, 0.4386, 0.6212, 0.4584]}, {"w": "when", "b": [0.6274, 0.4386, 0.6821, 0.4584]}, {"w": "we", "b": [0.6884, 0.4386, 0.7178, 0.4584]}, {"w": "covered", "b": [0.7241, 0.4386, 0.8039, 0.4584]}, {"w": "word", "b": [0.8103, 0.4386, 0.8621, 0.4584]}, {"w": "embeddings", "b": [0.1294, 0.4591, 0.2513, 0.4789]}, {"w": "in", "b": [0.2576, 0.4591, 0.2773, 0.4789]}, {"w": "chapter", "b": [0.2835, 0.4591, 0.3578, 0.4789]}, {"w": "6.", "b": [0.3641, 0.4591, 0.383, 0.4789]}, {"w": "The", "b": [0.3893, 0.4591, 0.4285, 0.4789]}, {"w": "idea", "b": [0.4348, 0.4591, 0.4769, 0.4789]}, {"w": "is", "b": [0.4832, 0.4591, 0.5, 0.4789]}, {"w": "still", "b": [0.5063, 0.4591, 0.5442, 0.4789]}, {"w": "the", "b": [0.5505, 0.4591, 0.5813, 0.4789]}, {"w": "same:", "b": [0.5876, 0.4591, 0.6464, 0.4789]}, {"w": "given", "b": [0.6528, 0.4591, 0.7088, 0.4789]}, {"w": "a", "b": [0.7151, 0.4591, 0.7263, 0.4789]}, {"w": "latent", "b": [0.7326, 0.4591, 0.7887, 0.4789]}, {"w": "space", "b": [0.795, 0.4591, 0.851, 0.4789]}, {"w": "of", "b": [0.1294, 0.4796, 0.1504, 0.4994]}, {"w": "representations,", "b": [0.1567, 0.4796, 0.3158, 0.4994]}, {"w": "or", "b": [0.3221, 0.4796, 0.3431, 0.4994]}, {"w": "an", "b": [0.3494, 0.4796, 0.3732, 0.4994]}, {"w": "embedding", "b": [0.3795, 0.4796, 0.4916, 0.4994]}, {"w": "space,", "b": [0.4979, 0.4796, 0.5602, 0.4994]}, {"w": "certain", "b": [0.5665, 0.4796, 0.6352, 0.4994]}, {"w": "directions", "b": [0.6415, 0.4796, 0.741, 0.4994]}, {"w": "in", "b": [0.7473, 0.4796, 0.7669, 0.4994]}, {"w": "the", "b": [0.7732, 0.4796, 0.804, 0.4994]}, {"w": "space", "b": [0.8104, 0.4796, 0.8664, 0.4994]}, {"w": "may", "b": [0.1294, 0.5001, 0.1729, 0.5199]}, {"w": "encode", "b": [0.1792, 0.5001, 0.2506, 0.5199]}, {"w": "interesting", "b": [0.2569, 0.5001, 0.3634, 0.5199]}, {"w": "axes", "b": [0.3697, 0.5001, 0.4145, 0.5199]}, {"w": "of", "b": [0.4208, 0.5001, 0.4419, 0.5199]}, {"w": "variation", "b": [0.4482, 0.5001, 0.5378, 0.5199]}, {"w": "in", "b": [0.5441, 0.5001, 0.5638, 0.5199]}, {"w": "the", "b": [0.5701, 0.5001, 0.6009, 0.5199]}, {"w": "original", "b": [0.6072, 0.5001, 0.6857, 0.5199]}, {"w": "data.", "b": [0.692, 0.5001, 0.7403, 0.5199]}, {"w": "In", "b": [0.7466, 0.5001, 0.7676, 0.5199]}, {"w": "a", "b": [0.774, 0.5001, 0.7852, 0.5199]}, {"w": "latent", "b": [0.7915, 0.5001, 0.8475, 0.5199]}, {"w": "space", "b": [0.1294, 0.5206, 0.1854, 0.5404]}, {"w": "of", "b": [0.1917, 0.5206, 0.2128, 0.5404]}, {"w": "images", "b": [0.2191, 0.5206, 0.2905, 0.5404]}, {"w": "of", "b": [0.2968, 0.5206, 0.3178, 0.5404]}, {"w": "faces,", "b": [0.3242, 0.5206, 0.3823, 0.5404]}, {"w": "for", "b": [0.3886, 0.5206, 0.418, 0.5404]}, {"w": "instance,", "b": [0.4243, 0.5206, 0.5133, 0.5404]}, {"w": "there", "b": [0.5196, 0.5206, 0.57, 0.5404]}, {"w": "may", "b": [0.5763, 0.5206, 0.6198, 0.5404]}, {"w": "be", "b": [0.626, 0.5206, 0.6498, 0.5404]}, {"w": "a", "b": [0.6561, 0.5206, 0.6673, 0.5404]}, {"w": "smile", "b": [0.6736, 0.5206, 0.7269, 0.5404]}, {"w": "vectors,", "b": [0.7332, 0.5206, 0.8176, 0.5419]}, {"w": "such", "b": [0.8239, 0.5206, 0.8702, 0.5404]}, {"w": "that", "b": [0.1294, 0.542, 0.1673, 0.5618]}, {"w": "if", "b": [0.1736, 0.542, 0.189, 0.5618]}, {"w": "latent", "b": [0.1953, 0.542, 0.2513, 0.5618]}, {"w": "point", "b": [0.2576, 0.542, 0.3095, 0.5618]}, {"w": "z", "b": [0.3157, 0.5431, 0.3309, 0.5633]}, {"w": "is", "b": [0.3372, 0.542, 0.354, 0.5618]}, {"w": "the", "b": [0.3603, 0.542, 0.3911, 0.5618]}, {"w": "embedded", "b": [0.3975, 0.542, 0.5011, 0.5618]}, {"w": "representation", "b": [0.5074, 0.542, 0.6503, 0.5618]}, {"w": "of", "b": [0.6566, 0.542, 0.6777, 0.5618]}, {"w": "a", "b": [0.684, 0.542, 0.6952, 0.5618]}, {"w": "certain", "b": [0.7015, 0.542, 0.7701, 0.5618]}, {"w": "face,", "b": [0.7764, 0.542, 0.8247, 0.5618]}, {"w": "then", "b": [0.1294, 0.5634, 0.1729, 0.5832]}, {"w": "latent", "b": [0.1792, 0.5634, 0.2352, 0.5832]}, {"w": "point", "b": [0.2415, 0.5634, 0.2934, 0.5832]}, {"w": "z", "b": [0.2996, 0.5645, 0.3148, 0.5847]}, {"w": "+", "b": [0.3299, 0.5645, 0.3451, 0.5847]}, {"w": "s", "b": [0.3602, 0.5645, 0.3753, 0.5847]}, {"w": "is", "b": [0.3816, 0.5634, 0.3985, 0.5832]}, {"w": "the", "b": [0.4048, 0.5634, 0.4356, 0.5832]}, {"w": "embedded", "b": [0.4419, 0.5634, 0.5456, 0.5832]}, {"w": "representation", "b": [0.5519, 0.5634, 0.6948, 0.5832]}, {"w": "of", "b": [0.7011, 0.5634, 0.7221, 0.5832]}, {"w": "the", "b": [0.7284, 0.5634, 0.7592, 0.5832]}, {"w": "same", "b": [0.7655, 0.5634, 0.8174, 0.5832]}, {"w": "face,", "b": [0.1294, 0.5848, 0.1777, 0.6046]}, {"w": "smiling.", "b": [0.184, 0.5848, 0.266, 0.6046]}, {"w": "Once", "b": [0.2723, 0.5848, 0.3256, 0.6046]}, {"w": "you’ve", "b": [0.3319, 0.5848, 0.4019, 0.6046]}, {"w": "identified", "b": [0.4082, 0.5848, 0.5049, 0.6046]}, {"w": "such", "b": [0.5112, 0.5848, 0.5575, 0.6046]}, {"w": "a", "b": [0.5638, 0.5848, 0.575, 0.6046]}, {"w": "vector,", "b": [0.5813, 0.5848, 0.6495, 0.6046]}, {"w": "it", "b": [0.6559, 0.5848, 0.6699, 0.6046]}, {"w": "then", "b": [0.6762, 0.5848, 0.7196, 0.6046]}, {"w": "becomes", "b": [0.7259, 0.5848, 0.8142, 0.6046]}, {"w": "possible", "b": [0.1294, 0.6053, 0.2121, 0.6251]}, {"w": "to", "b": [0.2184, 0.6053, 0.238, 0.6251]}, {"w": "edit", "b": [0.2443, 0.6053, 0.2822, 0.6251]}, {"w": "images", "b": [0.2885, 0.6053, 0.3599, 0.6251]}, {"w": "by", "b": [0.3662, 0.6053, 0.3915, 0.6251]}, {"w": "projecting", "b": [0.3978, 0.6053, 0.5001, 0.6251]}, {"w": "them", "b": [0.5064, 0.6053, 0.5568, 0.6251]}, {"w": "into", "b": [0.5631, 0.6053, 0.6024, 0.6251]}, {"w": "the", "b": [0.6087, 0.6053, 0.6395, 0.6251]}, {"w": "latent", "b": [0.6458, 0.6053, 0.7019, 0.6251]}, {"w": "space,", "b": [0.7082, 0.6053, 0.7705, 0.6251]}, {"w": "moving", "b": [0.7768, 0.6053, 0.8539, 0.6251]}, {"w": "their", "b": [0.1294, 0.6258, 0.1757, 0.6456]}, {"w": "representation", "b": [0.182, 0.6258, 0.3249, 0.6456]}, {"w": "in", "b": [0.3312, 0.6258, 0.3508, 0.6456]}, {"w": "a", "b": [0.3571, 0.6258, 0.3683, 0.6456]}, {"w": "meaningful", "b": [0.3746, 0.6258, 0.4895, 0.6456]}, {"w": "way,", "b": [0.4958, 0.6258, 0.5424, 0.6456]}, {"w": "and", "b": [0.5488, 0.6258, 0.5852, 0.6456]}, {"w": "then", "b": [0.5915, 0.6258, 0.6349, 0.6456]}, {"w": "decoding", "b": [0.6412, 0.6258, 0.7337, 0.6456]}, {"w": "them", "b": [0.74, 0.6258, 0.7904, 0.6456]}, {"w": "back", "b": [0.7967, 0.6258, 0.8444, 0.6456]}, {"w": "to", "b": [0.8507, 0.6258, 0.8703, 0.6456]}, {"w": "image", "b": [0.1294, 0.6463, 0.1911, 0.6661]}, {"w": "space.", "b": [0.1974, 0.6463, 0.2597, 0.6661]}, {"w": "There", "b": [0.266, 0.6463, 0.3248, 0.6661]}, {"w": "are", "b": [0.3311, 0.6463, 0.3619, 0.6661]}, {"w": "concept", "b": [0.3682, 0.6463, 0.4467, 0.6661]}, {"w": "vectors", "b": [0.453, 0.6463, 0.5259, 0.6661]}, {"w": "for", "b": [0.5322, 0.6463, 0.5616, 0.6661]}, {"w": "essentially", "b": [0.5679, 0.6463, 0.6744, 0.6661]}, {"w": "any", "b": [0.6807, 0.6463, 0.7171, 0.6661]}, {"w": "independent", "b": [0.7234, 0.6463, 0.8467, 0.6661]}, {"w": "dimension", "b": [0.1294, 0.6668, 0.2345, 0.6866]}, {"w": "of", "b": [0.2408, 0.6668, 0.2618, 0.6866]}, {"w": "variation", "b": [0.2682, 0.6668, 0.3578, 0.6866]}, {"w": "in", "b": [0.3641, 0.6668, 0.3838, 0.6866]}, {"w": "image", "b": [0.3901, 0.6668, 0.4517, 0.6866]}, {"w": "space—in", "b": [0.458, 0.6668, 0.5589, 0.6866]}, {"w": "the", "b": [0.5651, 0.6668, 0.596, 0.6866]}, {"w": "case", "b": [0.6023, 0.6668, 0.6457, 0.6866]}, {"w": "of", "b": [0.652, 0.6668, 0.673, 0.6866]}, {"w": "faces,", "b": [0.6793, 0.6668, 0.7374, 0.6866]}, {"w": "you", "b": [0.7437, 0.6668, 0.7816, 0.6866]}, {"w": "may", "b": [0.7879, 0.6668, 0.8313, 0.6866]}, {"w": "discover", "b": [0.1294, 0.6873, 0.2149, 0.7071]}, {"w": "vectors", "b": [0.2212, 0.6873, 0.294, 0.7071]}, {"w": "for", "b": [0.3003, 0.6873, 0.3298, 0.7071]}, {"w": "adding", "b": [0.3361, 0.6873, 0.4047, 0.7071]}, {"w": "sunglasses", "b": [0.411, 0.6873, 0.5175, 0.7071]}, {"w": "to", "b": [0.5238, 0.6873, 0.5435, 0.7071]}, {"w": "a", "b": [0.5498, 0.6873, 0.561, 0.7071]}, {"w": "face,", "b": [0.5673, 0.6873, 0.6156, 0.7071]}, {"w": "removing", "b": [0.6219, 0.6873, 0.7186, 0.7071]}, {"w": "glasses,", "b": [0.7249, 0.6873, 0.8027, 0.7071]}, {"w": "turning", "b": [0.1294, 0.7078, 0.2023, 0.7276]}, {"w": "a", "b": [0.2086, 0.7078, 0.2198, 0.7276]}, {"w": "male", "b": [0.2261, 0.7078, 0.2751, 0.7276]}, {"w": "face", "b": [0.2814, 0.7078, 0.3234, 0.7276]}, {"w": "into", "b": [0.3298, 0.7078, 0.369, 0.7276]}, {"w": "as", "b": [0.3753, 0.7078, 0.3963, 0.7276]}, {"w": "female", "b": [0.4026, 0.7078, 0.4712, 0.7276]}, {"w": "face,", "b": [0.4775, 0.7078, 0.5258, 0.7276]}, {"w": "and", "b": [0.5321, 0.7078, 0.5686, 0.7276]}, {"w": "so", "b": [0.5749, 0.7078, 0.5973, 0.7276]}, {"w": "on.", "b": [0.6036, 0.7078, 0.6351, 0.7276]}, {"w": "Figure", "b": [0.6414, 0.7078, 0.7073, 0.7276]}, {"w": "8.11", "b": [0.7136, 0.7078, 0.7568, 0.7276]}, {"w": "is", "b": [0.7631, 0.7078, 0.7799, 0.7276]}, {"w": "an", "b": [0.7862, 0.7078, 0.81, 0.7276]}, {"w": "example", "b": [0.1294, 0.7283, 0.2149, 0.7481]}, {"w": "of", "b": [0.2212, 0.7283, 0.2422, 0.7481]}, {"w": "a", "b": [0.2485, 0.7283, 0.2597, 0.7481]}, {"w": "smile", "b": [0.266, 0.7283, 0.3207, 0.7481]}, {"w": "vector,", "b": [0.327, 0.7283, 0.3953, 0.7481]}, {"w": "a", "b": [0.4016, 0.7283, 0.4128, 0.7481]}, {"w": "concept", "b": [0.4191, 0.7283, 0.4975, 0.7481]}, {"w": "vector", "b": [0.5038, 0.7283, 0.5669, 0.7481]}, {"w": "discovered", "b": [0.5732, 0.7283, 0.6825, 0.7481]}, {"w": "by", "b": [0.6888, 0.7283, 0.714, 0.7481]}, {"w": "Tom", "b": [0.7203, 0.7283, 0.7661, 0.7481]}, {"w": "White", "b": [0.7725, 0.7283, 0.8341, 0.7481]}, {"w": "from", "b": [0.1294, 0.7488, 0.1785, 0.7686]}, {"w": "the", "b": [0.1848, 0.7488, 0.2156, 0.7686]}, {"w": "Victoria", "b": [0.2219, 0.7488, 0.303, 0.7686]}, {"w": "University", "b": [0.3093, 0.7488, 0.4158, 0.7686]}, {"w": "School", "b": [0.4221, 0.7488, 0.4922, 0.7686]}, {"w": "of", "b": [0.4985, 0.7488, 0.5195, 0.7686]}, {"w": "Design", "b": [0.5259, 0.7488, 0.5973, 0.7686]}, {"w": "in", "b": [0.6036, 0.7488, 0.6232, 0.7686]}, {"w": "New", "b": [0.6295, 0.7488, 0.6771, 0.7686]}, {"w": "Zealand,", "b": [0.6834, 0.7488, 0.771, 0.7686]}, {"w": "using", "b": [0.7773, 0.7488, 0.832, 0.7686]}, {"w": "VAEs", "b": [0.1294, 0.7693, 0.1878, 0.7891]}, {"w": "trained", "b": [0.1941, 0.7693, 0.2642, 0.7891]}, {"w": "on", "b": [0.2705, 0.7693, 0.2957, 0.7891]}, {"w": "a", "b": [0.302, 0.7693, 0.3132, 0.7891]}, {"w": "dataset", "b": [0.3195, 0.7693, 0.3896, 0.7891]}, {"w": "of", "b": [0.3959, 0.7693, 0.4169, 0.7891]}, {"w": "faces", "b": [0.4232, 0.7693, 0.475, 0.7891]}, {"w": "of", "b": [0.4813, 0.7693, 0.5023, 0.7891]}, {"w": "celebrities", "b": [0.5086, 0.7693, 0.6123, 0.7891]}, {"w": "(the", "b": [0.6186, 0.7693, 0.6578, 0.7891]}, {"w": "CelebA", "b": [0.6642, 0.7693, 0.7412, 0.7891]}, {"w": "dataset).", "b": [0.7475, 0.7693, 0.8323, 0.7891]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 8.11. The smile vector", "words": [{"w": "Figure", "b": [0.1294, 0.8116, 0.1827, 0.8264]}, {"w": "8.11.", "b": [0.1874, 0.8116, 0.2242, 0.8264]}, {"w": "The", "b": [0.2289, 0.8116, 0.2604, 0.8264]}, {"w": "smile", "b": [0.2652, 0.8116, 0.3072, 0.8264]}, {"w": "vector", "b": [0.3119, 0.8116, 0.3624, 0.8264]}]}]}, {"page": 390, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "8.4.3. Variational autoencoders", "words": [{"w": "8.4.3.", "b": [0.1294, 0.3085, 0.1862, 0.3282]}, {"w": "Variational", "b": [0.1925, 0.3085, 0.3135, 0.3282]}, {"w": "autoencoders", "b": [0.3198, 0.3085, 0.4627, 0.3282]}]}, {"id": "b_1", "type": "paragraph", "text": "Variational autoencoders, simultaneously discovered by Kingma and Welling in December 2013[6] and Rezende, Mohamed, and Wierstra in January 2014,[7] are a kind of generative model that’s especially appropriate for the task of image editing via concept vectors. They’re a modern take on autoencoders—a type of network that aims to encode an input to a low-dimensional latent space and then decode it back—that mixes ideas from deep learning with Bayesian inference.", "words": [{"w": "Variational", "b": [0.1294, 0.3513, 0.2401, 0.371]}, {"w": "autoencoders,", "b": [0.2464, 0.3513, 0.3858, 0.371]}, {"w": "simultaneously", "b": [0.3921, 0.3513, 0.5449, 0.371]}, {"w": "discovered", "b": [0.5512, 0.3513, 0.6605, 0.371]}, {"w": "by", "b": [0.6668, 0.3513, 0.692, 0.371]}, {"w": "Kingma", "b": [0.6983, 0.3513, 0.7796, 0.371]}, {"w": "and", "b": [0.7859, 0.3513, 0.8223, 0.371]}, {"w": "Welling", "b": [0.1294, 0.3736, 0.2087, 0.3933]}, {"w": "in", "b": [0.215, 0.3736, 0.2346, 0.3933]}, {"w": "December", "b": [0.2409, 0.3736, 0.3446, 0.3933]}, {"w": "2013[6]", "b": [0.3509, 0.3713, 0.4233, 0.3933]}, {"w": "and", "b": [0.4296, 0.3736, 0.466, 0.3933]}, {"w": "Rezende,", "b": [0.4724, 0.3736, 0.5655, 0.3933]}, {"w": "Mohamed,", "b": [0.5718, 0.3736, 0.6804, 0.3933]}, {"w": "and", "b": [0.6867, 0.3736, 0.7231, 0.3933]}, {"w": "Wierstra", "b": [0.7295, 0.3736, 0.8153, 0.3933]}, {"w": "in", "b": [0.8216, 0.3736, 0.8412, 0.3933]}, {"w": "January", "b": [0.1294, 0.3959, 0.2079, 0.4156]}, {"w": "2014,[7]", "b": [0.2142, 0.3936, 0.293, 0.4156]}, {"w": "are", "b": [0.2993, 0.3959, 0.3301, 0.4156]}, {"w": "a", "b": [0.3364, 0.3959, 0.3476, 0.4156]}, {"w": "kind", "b": [0.3539, 0.3959, 0.3987, 0.4156]}, {"w": "of", "b": [0.405, 0.3959, 0.426, 0.4156]}, {"w": "generative", "b": [0.4323, 0.3959, 0.5374, 0.4156]}, {"w": "model", "b": [0.5437, 0.3959, 0.6068, 0.4156]}, {"w": "that’s", "b": [0.6131, 0.3959, 0.6677, 0.4156]}, {"w": "especially", "b": [0.674, 0.3959, 0.7749, 0.4156]}, {"w": "appropriate", "b": [0.1294, 0.4164, 0.2443, 0.4361]}, {"w": "for", "b": [0.2506, 0.4164, 0.28, 0.4361]}, {"w": "the", "b": [0.2863, 0.4164, 0.3171, 0.4361]}, {"w": "task", "b": [0.3234, 0.4164, 0.3641, 0.4361]}, {"w": "of", "b": [0.3704, 0.4164, 0.3914, 0.4361]}, {"w": "image", "b": [0.3977, 0.4164, 0.4594, 0.4361]}, {"w": "editing", "b": [0.4657, 0.4164, 0.5357, 0.4361]}, {"w": "via", "b": [0.5421, 0.4164, 0.5729, 0.4361]}, {"w": "concept", "b": [0.5792, 0.4164, 0.6576, 0.4361]}, {"w": "vectors.", "b": [0.6639, 0.4164, 0.7431, 0.4361]}, {"w": "They’re", "b": [0.7494, 0.4164, 0.8293, 0.4361]}, {"w": "a", "b": [0.8356, 0.4164, 0.8468, 0.4361]}, {"w": "modern", "b": [0.1294, 0.4369, 0.2065, 0.4566]}, {"w": "take", "b": [0.2128, 0.4369, 0.2548, 0.4566]}, {"w": "on", "b": [0.2611, 0.4369, 0.2863, 0.4566]}, {"w": "autoencoders—a", "b": [0.2926, 0.4369, 0.4622, 0.4566]}, {"w": "type", "b": [0.4685, 0.4369, 0.5119, 0.4566]}, {"w": "of", "b": [0.5182, 0.4369, 0.5392, 0.4566]}, {"w": "network", "b": [0.5455, 0.4369, 0.6282, 0.4566]}, {"w": "that", "b": [0.6345, 0.4369, 0.6723, 0.4566]}, {"w": "aims", "b": [0.6787, 0.4369, 0.7263, 0.4566]}, {"w": "to", "b": [0.7326, 0.4369, 0.7522, 0.4566]}, {"w": "encode", "b": [0.7585, 0.4369, 0.83, 0.4566]}, {"w": "an", "b": [0.8363, 0.4369, 0.8601, 0.4566]}, {"w": "input", "b": [0.1294, 0.4574, 0.1813, 0.4771]}, {"w": "to", "b": [0.1876, 0.4574, 0.2072, 0.4771]}, {"w": "a", "b": [0.2135, 0.4574, 0.2247, 0.4771]}, {"w": "low-dimensional", "b": [0.231, 0.4574, 0.4006, 0.4771]}, {"w": "latent", "b": [0.4069, 0.4574, 0.4629, 0.4771]}, {"w": "space", "b": [0.4693, 0.4574, 0.5253, 0.4771]}, {"w": "and", "b": [0.5316, 0.4574, 0.568, 0.4771]}, {"w": "then", "b": [0.5743, 0.4574, 0.6178, 0.4771]}, {"w": "decode", "b": [0.6241, 0.4574, 0.6955, 0.4771]}, {"w": "it", "b": [0.7017, 0.4574, 0.7157, 0.4771]}, {"w": "back—that", "b": [0.7221, 0.4574, 0.8327, 0.4771]}, {"w": "mixes", "b": [0.1294, 0.4779, 0.1897, 0.4976]}, {"w": "ideas", "b": [0.196, 0.4779, 0.2478, 0.4976]}, {"w": "from", "b": [0.2541, 0.4779, 0.3032, 0.4976]}, {"w": "deep", "b": [0.3095, 0.4779, 0.3571, 0.4976]}, {"w": "learning", "b": [0.3634, 0.4779, 0.4461, 0.4976]}, {"w": "with", "b": [0.4524, 0.4779, 0.4972, 0.4976]}, {"w": "Bayesian", "b": [0.5035, 0.4779, 0.596, 0.4976]}, {"w": "inference.", "b": [0.6023, 0.4779, 0.7025, 0.4976]}]}, {"id": "b_3", "type": "paragraph", "text": "Diederik P. Kingma and Max Welling, “Auto-Encoding Variational Bayes, arXiv (2013), https://arxiv.org/abs/1312.6114.", "words": [{"w": "Diederik", "b": [0.1483, 0.5433, 0.2145, 0.5581]}, {"w": "P.", "b": [0.2193, 0.5433, 0.2324, 0.5581]}, {"w": "Kingma", "b": [0.2371, 0.5433, 0.2981, 0.5581]}, {"w": "and", "b": [0.3028, 0.5433, 0.3301, 0.5581]}, {"w": "Max", "b": [0.3349, 0.5433, 0.3696, 0.5581]}, {"w": "Welling,", "b": [0.3743, 0.5433, 0.4384, 0.5581]}, {"w": "“Auto-Encoding", "b": [0.4432, 0.5433, 0.5682, 0.5581]}, {"w": "Variational", "b": [0.573, 0.5433, 0.656, 0.5581]}, {"w": "Bayes,", "b": [0.6607, 0.5433, 0.7117, 0.5581]}, {"w": "arXiv", "b": [0.7164, 0.5433, 0.7595, 0.5581]}, {"w": "(2013),", "b": [0.7642, 0.5433, 0.8194, 0.5581]}, {"w": "https://arxiv.org/abs/1312.6114.", "b": [0.1483, 0.5585, 0.3883, 0.5733]}]}, {"id": "b_5", "type": "paragraph", "text": "Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra, “Stochastic Backpropagation and Approximate Inference in Deep Generative Models,” arXiv (2014), https://arxiv.org/abs/1401.4082.", "words": [{"w": "Danilo", "b": [0.1483, 0.6146, 0.1998, 0.6294]}, {"w": "Jimenez", "b": [0.2046, 0.6146, 0.2666, 0.6294]}, {"w": "Rezende,", "b": [0.2713, 0.6146, 0.3412, 0.6294]}, {"w": "Shakir", "b": [0.3459, 0.6146, 0.3953, 0.6294]}, {"w": "Mohamed,", "b": [0.4, 0.6146, 0.4815, 0.6294]}, {"w": "and", "b": [0.4862, 0.6146, 0.5135, 0.6294]}, {"w": "Daan", "b": [0.5182, 0.6146, 0.5582, 0.6294]}, {"w": "Wierstra,", "b": [0.5629, 0.6146, 0.632, 0.6294]}, {"w": "“Stochastic", "b": [0.6367, 0.6146, 0.7229, 0.6294]}, {"w": "Backpropagation", "b": [0.1483, 0.6298, 0.2776, 0.6446]}, {"w": "and", "b": [0.2823, 0.6298, 0.3096, 0.6446]}, {"w": "Approximate", "b": [0.3144, 0.6298, 0.4142, 0.6446]}, {"w": "Inference", "b": [0.4189, 0.6298, 0.4904, 0.6446]}, {"w": "in", "b": [0.4951, 0.6298, 0.5098, 0.6446]}, {"w": "Deep", "b": [0.5145, 0.6298, 0.5545, 0.6446]}, {"w": "Generative", "b": [0.5592, 0.6298, 0.6422, 0.6446]}, {"w": "Models,”", "b": [0.6468, 0.6298, 0.7167, 0.6446]}, {"w": "arXiv", "b": [0.7215, 0.6298, 0.7645, 0.6446]}, {"w": "(2014),", "b": [0.7693, 0.6298, 0.8244, 0.6446]}, {"w": "https://arxiv.org/abs/1401.4082.", "b": [0.1483, 0.6449, 0.389, 0.6597]}]}, {"id": "b_6", "type": "paragraph", "text": "A classical image autoencoder takes an image, maps it to a latent vector space via an encoder module, and then decodes it back to an output with the same dimensions as the original image, via a decoder module (see figure 8.12). It’s then trained by using as target data the same images as the input images, meaning the autoencoder learns to reconstruct the original inputs. By imposing various constraints on the code (the output of the encoder), you can get the autoencoder to learn more-or-less interesting latent representations of the data. Most commonly, you’ll constrain the code to be low-dimensional and sparse (mostly zeros), in which case the encoder acts as a way to compress the input data into fewer bits of information.", "words": [{"w": "A", "b": [0.1294, 0.6829, 0.1476, 0.7026]}, {"w": "classical", "b": [0.1539, 0.6829, 0.2394, 0.7026]}, {"w": "image", "b": [0.2457, 0.6829, 0.3074, 0.7026]}, {"w": "autoencoder", "b": [0.3137, 0.6829, 0.4369, 0.7026]}, {"w": "takes", "b": [0.4432, 0.6829, 0.4951, 0.7026]}, {"w": "an", "b": [0.5014, 0.6829, 0.5252, 0.7026]}, {"w": "image,", "b": [0.5315, 0.6829, 0.5995, 0.7026]}, {"w": "maps", "b": [0.6058, 0.6829, 0.659, 0.7026]}, {"w": "it", "b": [0.6653, 0.6829, 0.6794, 0.7026]}, {"w": "to", "b": [0.6857, 0.6829, 0.7053, 0.7026]}, {"w": "a", "b": [0.7116, 0.6829, 0.7228, 0.7026]}, {"w": "latent", "b": [0.7291, 0.6829, 0.7852, 0.7026]}, {"w": "vector", "b": [0.7915, 0.6829, 0.8545, 0.7026]}, {"w": "space", "b": [0.1294, 0.7034, 0.1854, 0.7231]}, {"w": "via", "b": [0.1917, 0.7034, 0.2226, 0.7231]}, {"w": "an", "b": [0.2289, 0.7034, 0.2527, 0.7231]}, {"w": "encoder", "b": [0.259, 0.7034, 0.3388, 0.7231]}, {"w": "module,", "b": [0.3451, 0.7034, 0.4271, 0.7231]}, {"w": "and", "b": [0.4334, 0.7034, 0.4699, 0.7231]}, {"w": "then", "b": [0.4762, 0.7034, 0.5196, 0.7231]}, {"w": "decodes", "b": [0.5259, 0.7034, 0.6072, 0.7231]}, {"w": "it", "b": [0.6135, 0.7034, 0.6275, 0.7231]}, {"w": "back", "b": [0.6337, 0.7034, 0.6814, 0.7231]}, {"w": "to", "b": [0.6877, 0.7034, 0.7073, 0.7231]}, {"w": "an", "b": [0.7136, 0.7034, 0.7374, 0.7231]}, {"w": "output", "b": [0.7437, 0.7034, 0.8082, 0.7231]}, {"w": "with", "b": [0.8145, 0.7034, 0.8593, 0.7231]}, {"w": "the", "b": [0.1294, 0.7239, 0.1602, 0.7436]}, {"w": "same", "b": [0.1665, 0.7239, 0.2184, 0.7436]}, {"w": "dimensions", "b": [0.2247, 0.7239, 0.3396, 0.7436]}, {"w": "as", "b": [0.3459, 0.7239, 0.3669, 0.7436]}, {"w": "the", "b": [0.3732, 0.7239, 0.4041, 0.7436]}, {"w": "original", "b": [0.4104, 0.7239, 0.4889, 0.7436]}, {"w": "image,", "b": [0.4952, 0.7239, 0.5631, 0.7436]}, {"w": "via", "b": [0.5694, 0.7239, 0.6003, 0.7436]}, {"w": "a", "b": [0.6066, 0.7239, 0.6178, 0.7436]}, {"w": "decoder", "b": [0.6241, 0.7239, 0.7039, 0.7436]}, {"w": "module", "b": [0.7102, 0.7239, 0.7859, 0.7436]}, {"w": "(see", "b": [0.7922, 0.7239, 0.8328, 0.7436]}, {"w": "figure", "b": [0.1294, 0.7444, 0.1897, 0.7641]}, {"w": "8.12).", "b": [0.196, 0.7444, 0.2548, 0.7641]}, {"w": "It’s", "b": [0.2611, 0.7444, 0.2933, 0.7641]}, {"w": "then", "b": [0.2996, 0.7444, 0.3431, 0.7641]}, {"w": "trained", "b": [0.3494, 0.7444, 0.4194, 0.7641]}, {"w": "by", "b": [0.4257, 0.7444, 0.451, 0.7641]}, {"w": "using", "b": [0.4573, 0.7444, 0.5119, 0.7641]}, {"w": "as", "b": [0.5182, 0.7444, 0.5393, 0.7641]}, {"w": "target", "b": [0.5456, 0.7444, 0.6025, 0.7641]}, {"w": "data", "b": [0.6088, 0.7444, 0.6509, 0.7641]}, {"w": "the", "b": [0.6572, 0.7444, 0.688, 0.7641]}, {"w": "same", "b": [0.6943, 0.7444, 0.7461, 0.7641]}, {"w": "images", "b": [0.7524, 0.7444, 0.8239, 0.7641]}, {"w": "as", "b": [0.8302, 0.7444, 0.8512, 0.7641]}, {"w": "the", "b": [0.1294, 0.7649, 0.1602, 0.7846]}, {"w": "input", "b": [0.1665, 0.7649, 0.2184, 0.7846]}, {"w": "images,", "b": [0.2247, 0.7649, 0.3025, 0.7846]}, {"w": "meaning", "b": [0.3088, 0.7649, 0.3957, 0.7846]}, {"w": "the", "b": [0.402, 0.7649, 0.4328, 0.7846]}, {"w": "autoencoder", "b": [0.4391, 0.7649, 0.5624, 0.7846]}, {"w": "learns", "b": [0.5687, 0.7649, 0.6289, 0.7846]}, {"w": "to", "b": [0.6352, 0.7649, 0.6549, 0.7846]}, {"w": "reconstruct", "b": [0.6612, 0.7649, 0.7732, 0.7846]}, {"w": "the", "b": [0.7796, 0.7649, 0.8104, 0.7846]}, {"w": "original", "b": [0.1294, 0.7854, 0.2079, 0.8051]}, {"w": "inputs.", "b": [0.2142, 0.7854, 0.2822, 0.8051]}, {"w": "By", "b": [0.2885, 0.7854, 0.3179, 0.8051]}, {"w": "imposing", "b": [0.3242, 0.7854, 0.4181, 0.8051]}, {"w": "various", "b": [0.4245, 0.7854, 0.4987, 0.8051]}, {"w": "constraints", "b": [0.505, 0.7854, 0.6143, 0.8051]}, {"w": "on", "b": [0.6206, 0.7854, 0.6459, 0.8051]}, {"w": "the", "b": [0.6521, 0.7854, 0.6829, 0.8051]}, {"w": "code", "b": [0.6892, 0.7854, 0.7369, 0.8051]}, {"w": "(the", "b": [0.7432, 0.7854, 0.7824, 0.8051]}, {"w": "output", "b": [0.7887, 0.7854, 0.8532, 0.8051]}, {"w": "of", "b": [0.1294, 0.8059, 0.1504, 0.8256]}, {"w": "the", "b": [0.1567, 0.8059, 0.1876, 0.8256]}, {"w": "encoder),", "b": [0.1939, 0.8059, 0.2884, 0.8256]}, {"w": "you", "b": [0.2947, 0.8059, 0.3326, 0.8256]}, {"w": "can", "b": [0.3389, 0.8059, 0.3739, 0.8256]}, {"w": "get", "b": [0.3802, 0.8059, 0.411, 0.8256]}, {"w": "the", "b": [0.4173, 0.8059, 0.4481, 0.8256]}, {"w": "autoencoder", "b": [0.4544, 0.8059, 0.5777, 0.8256]}, {"w": "to", "b": [0.584, 0.8059, 0.6037, 0.8256]}, {"w": "learn", "b": [0.61, 0.8059, 0.6604, 0.8256]}, {"w": "more-or-less", "b": [0.6667, 0.8059, 0.7936, 0.8256]}, {"w": "interesting", "b": [0.1294, 0.8264, 0.2359, 0.8461]}, {"w": "latent", "b": [0.2422, 0.8264, 0.2983, 0.8461]}, {"w": "representations", "b": [0.3046, 0.8264, 0.4573, 0.8461]}, {"w": "of", "b": [0.4635, 0.8264, 0.4845, 0.8461]}, {"w": "the", "b": [0.4909, 0.8264, 0.5217, 0.8461]}, {"w": "data.", "b": [0.528, 0.8264, 0.5763, 0.8461]}, {"w": "Most", "b": [0.5826, 0.8264, 0.6345, 0.8461]}, {"w": "commonly,", "b": [0.6408, 0.8264, 0.7533, 0.8461]}, {"w": "you’ll", "b": [0.7597, 0.8264, 0.8199, 0.8461]}, {"w": "constrain", "b": [0.1294, 0.8469, 0.2219, 0.8666]}, {"w": "the", "b": [0.2282, 0.8469, 0.259, 0.8666]}, {"w": "code", "b": [0.2653, 0.8469, 0.313, 0.8666]}, {"w": "to", "b": [0.3193, 0.8469, 0.3389, 0.8666]}, {"w": "be", "b": [0.3452, 0.8469, 0.369, 0.8666]}, {"w": "low-dimensional", "b": [0.3753, 0.8469, 0.5449, 0.8666]}, {"w": "and", "b": [0.5512, 0.8469, 0.5876, 0.8666]}, {"w": "sparse", "b": [0.5939, 0.8469, 0.657, 0.8666]}, {"w": "(mostly", "b": [0.6633, 0.8469, 0.7404, 0.8666]}, {"w": "zeros),", "b": [0.7467, 0.8469, 0.8146, 0.8666]}, {"w": "in", "b": [0.8209, 0.8469, 0.8405, 0.8666]}, {"w": "which", "b": [0.1294, 0.8674, 0.1911, 0.8871]}, {"w": "case", "b": [0.1974, 0.8674, 0.2408, 0.8871]}, {"w": "the", "b": [0.2471, 0.8674, 0.2779, 0.8871]}, {"w": "encoder", "b": [0.2842, 0.8674, 0.3641, 0.8871]}, {"w": "acts", "b": [0.3703, 0.8674, 0.4096, 0.8871]}, {"w": "as", "b": [0.4159, 0.8674, 0.4369, 0.8871]}, {"w": "a", "b": [0.4432, 0.8674, 0.4544, 0.8871]}, {"w": "way", "b": [0.4607, 0.8674, 0.5027, 0.8871]}, {"w": "to", "b": [0.509, 0.8674, 0.5287, 0.8871]}, {"w": "compress", "b": [0.535, 0.8674, 0.6302, 0.8871]}, {"w": "the", "b": [0.6365, 0.8674, 0.6674, 0.8871]}, {"w": "input", "b": [0.6737, 0.8674, 0.7255, 0.8871]}, {"w": "data", "b": [0.7318, 0.8674, 0.7739, 0.8871]}, {"w": "into", "b": [0.7802, 0.8674, 0.8194, 0.8871]}, {"w": "fewer", "b": [0.1294, 0.8879, 0.1868, 0.9076]}, {"w": "bits", "b": [0.1931, 0.8879, 0.2296, 0.9076]}, {"w": "of", "b": [0.2359, 0.8879, 0.2569, 0.9076]}, {"w": "information.", "b": [0.2632, 0.8879, 0.3886, 0.9076]}]}]}, {"page": 391, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 8.12. An autoencoder: mapping an input x to a compressed representation and then decoding it back as x'", "words": [{"w": "Figure", "b": [0.1294, 0.0852, 0.1827, 0.1]}, {"w": "8.12.", "b": [0.1874, 0.0852, 0.2252, 0.1]}, {"w": "An", "b": [0.2299, 0.0852, 0.2541, 0.1]}, {"w": "autoencoder:", "b": [0.2588, 0.0852, 0.365, 0.1]}, {"w": "mapping", "b": [0.3697, 0.0852, 0.4412, 0.1]}, {"w": "an", "b": [0.4459, 0.0852, 0.4659, 0.1]}, {"w": "input", "b": [0.4707, 0.0852, 0.5138, 0.1]}, {"w": "x", "b": [0.5185, 0.086, 0.5299, 0.1011]}, {"w": "to", "b": [0.5346, 0.0852, 0.5503, 0.1]}, {"w": "a", "b": [0.5551, 0.0852, 0.5645, 0.1]}, {"w": "compressed", "b": [0.5693, 0.0852, 0.6635, 0.1]}, {"w": "representation", "b": [0.6682, 0.0852, 0.7852, 0.1]}, {"w": "and", "b": [0.79, 0.0852, 0.8205, 0.1]}, {"w": "then", "b": [0.8252, 0.0852, 0.8609, 0.1]}, {"w": "decoding", "b": [0.1294, 0.1012, 0.2019, 0.116]}, {"w": "it", "b": [0.2067, 0.1012, 0.2182, 0.116]}, {"w": "back", "b": [0.223, 0.1012, 0.2619, 0.116]}, {"w": "as", "b": [0.2666, 0.1012, 0.2834, 0.116]}, {"w": "x'", "b": [0.2881, 0.102, 0.3108, 0.1172]}]}, {"id": "b_1", "type": "paragraph", "text": "In practice, such classical autoencoders don’t lead to particularly useful or nicely structured latent spaces. They’re not much good at compression, either. For these reasons, they have largely fallen out of fashion. VAEs, however, augment autoencoders with a little bit of statistical magic that forces them to learn continuous, highly structured latent spaces. They have turned out to be a powerful tool for image generation.", "words": [{"w": "In", "b": [0.1294, 0.255, 0.1504, 0.2748]}, {"w": "practice,", "b": [0.1567, 0.255, 0.2429, 0.2748]}, {"w": "such", "b": [0.2492, 0.255, 0.2954, 0.2748]}, {"w": "classical", "b": [0.3017, 0.255, 0.3872, 0.2748]}, {"w": "autoencoders", "b": [0.3935, 0.255, 0.5266, 0.2748]}, {"w": "don’t", "b": [0.5329, 0.255, 0.5856, 0.2748]}, {"w": "lead", "b": [0.5919, 0.255, 0.634, 0.2748]}, {"w": "to", "b": [0.6403, 0.255, 0.6599, 0.2748]}, {"w": "particularly", "b": [0.6662, 0.255, 0.7825, 0.2748]}, {"w": "useful", "b": [0.7888, 0.255, 0.8505, 0.2748]}, {"w": "or", "b": [0.1294, 0.2755, 0.1504, 0.2953]}, {"w": "nicely", "b": [0.1567, 0.2755, 0.2184, 0.2953]}, {"w": "structured", "b": [0.2247, 0.2755, 0.3256, 0.2953]}, {"w": "latent", "b": [0.3319, 0.2755, 0.3879, 0.2953]}, {"w": "spaces.", "b": [0.3942, 0.2755, 0.4664, 0.2953]}, {"w": "They’re", "b": [0.4727, 0.2755, 0.5525, 0.2953]}, {"w": "not", "b": [0.5588, 0.2755, 0.5911, 0.2953]}, {"w": "much", "b": [0.5973, 0.2755, 0.6533, 0.2953]}, {"w": "good", "b": [0.6596, 0.2755, 0.7101, 0.2953]}, {"w": "at", "b": [0.7164, 0.2755, 0.7346, 0.2953]}, {"w": "compression,", "b": [0.1294, 0.296, 0.2632, 0.3158]}, {"w": "either.", "b": [0.2695, 0.296, 0.3319, 0.3158]}, {"w": "For", "b": [0.3382, 0.296, 0.3732, 0.3158]}, {"w": "these", "b": [0.3795, 0.296, 0.4314, 0.3158]}, {"w": "reasons,", "b": [0.4377, 0.296, 0.5196, 0.3158]}, {"w": "they", "b": [0.5259, 0.296, 0.5694, 0.3158]}, {"w": "have", "b": [0.5757, 0.296, 0.6233, 0.3158]}, {"w": "largely", "b": [0.6296, 0.296, 0.6992, 0.3158]}, {"w": "fallen", "b": [0.7055, 0.296, 0.7629, 0.3158]}, {"w": "out", "b": [0.7692, 0.296, 0.8015, 0.3158]}, {"w": "of", "b": [0.8078, 0.296, 0.8288, 0.3158]}, {"w": "fashion.", "b": [0.1294, 0.3165, 0.21, 0.3363]}, {"w": "VAEs,", "b": [0.2163, 0.3165, 0.281, 0.3363]}, {"w": "however,", "b": [0.2873, 0.3165, 0.3795, 0.3363]}, {"w": "augment", "b": [0.3858, 0.3165, 0.4726, 0.3363]}, {"w": "autoencoders", "b": [0.4789, 0.3165, 0.612, 0.3363]}, {"w": "with", "b": [0.6183, 0.3165, 0.6632, 0.3363]}, {"w": "a", "b": [0.6695, 0.3165, 0.6807, 0.3363]}, {"w": "little", "b": [0.687, 0.3165, 0.7332, 0.3363]}, {"w": "bit", "b": [0.7395, 0.3165, 0.7662, 0.3363]}, {"w": "of", "b": [0.7725, 0.3165, 0.7935, 0.3363]}, {"w": "statistical", "b": [0.1294, 0.337, 0.2247, 0.3568]}, {"w": "magic", "b": [0.231, 0.337, 0.2927, 0.3568]}, {"w": "that", "b": [0.299, 0.337, 0.3368, 0.3568]}, {"w": "forces", "b": [0.3431, 0.337, 0.4048, 0.3568]}, {"w": "them", "b": [0.4111, 0.337, 0.4615, 0.3568]}, {"w": "to", "b": [0.4678, 0.337, 0.4874, 0.3568]}, {"w": "learn", "b": [0.4937, 0.337, 0.5442, 0.3568]}, {"w": "continuous,", "b": [0.5505, 0.337, 0.6675, 0.3568]}, {"w": "highly", "b": [0.6738, 0.337, 0.7383, 0.3568]}, {"w": "structured", "b": [0.7446, 0.337, 0.8455, 0.3568]}, {"w": "latent", "b": [0.1294, 0.3575, 0.1855, 0.3773]}, {"w": "spaces.", "b": [0.1918, 0.3575, 0.2639, 0.3773]}, {"w": "They", "b": [0.2702, 0.3575, 0.3221, 0.3773]}, {"w": "have", "b": [0.3284, 0.3575, 0.376, 0.3773]}, {"w": "turned", "b": [0.3823, 0.3575, 0.4468, 0.3773]}, {"w": "out", "b": [0.453, 0.3575, 0.4852, 0.3773]}, {"w": "to", "b": [0.4916, 0.3575, 0.5112, 0.3773]}, {"w": "be", "b": [0.5175, 0.3575, 0.5413, 0.3773]}, {"w": "a", "b": [0.5476, 0.3575, 0.5588, 0.3773]}, {"w": "powerful", "b": [0.5651, 0.3575, 0.6562, 0.3773]}, {"w": "tool", "b": [0.6625, 0.3575, 0.7017, 0.3773]}, {"w": "for", "b": [0.708, 0.3575, 0.7375, 0.3773]}, {"w": "image", "b": [0.7438, 0.3575, 0.8054, 0.3773]}, {"w": "generation.", "b": [0.1294, 0.378, 0.2422, 0.3978]}]}, {"id": "b_2", "type": "paragraph", "text": "A VAE, instead of compressing its input image into a fixed code in the latent space, turns the image into the parameters of a statistical distribution: a mean and a variance. Essentially, this means you’re assuming the input image has been generated by a statistical process, and that the randomness of this process should be taken into accounting during encoding and decoding. The VAE then uses the mean and variance parameters to randomly sample one element of the distribution, and decodes that element back to the original input (see figure 8.13). The stochasticity of this process improves robustness and forces the latent space to encode meaningful representations everywhere: every point sampled in the latent space is decoded to a valid output.", "words": [{"w": "A", "b": [0.1294, 0.4208, 0.1476, 0.4406]}, {"w": "VAE,", "b": [0.1539, 0.4208, 0.2088, 0.4406]}, {"w": "instead", "b": [0.2151, 0.4208, 0.2866, 0.4406]}, {"w": "of", "b": [0.2929, 0.4208, 0.3139, 0.4406]}, {"w": "compressing", "b": [0.3202, 0.4208, 0.4477, 0.4406]}, {"w": "its", "b": [0.4541, 0.4208, 0.4779, 0.4406]}, {"w": "input", "b": [0.4842, 0.4208, 0.5361, 0.4406]}, {"w": "image", "b": [0.5424, 0.4208, 0.604, 0.4406]}, {"w": "into", "b": [0.6103, 0.4208, 0.6496, 0.4406]}, {"w": "a", "b": [0.6559, 0.4208, 0.6671, 0.4406]}, {"w": "fixed", "b": [0.6734, 0.4208, 0.7252, 0.4406]}, {"w": "code", "b": [0.7315, 0.4208, 0.7792, 0.4406]}, {"w": "in", "b": [0.7855, 0.4208, 0.8051, 0.4406]}, {"w": "the", "b": [0.8114, 0.4208, 0.8422, 0.4406]}, {"w": "latent", "b": [0.1294, 0.4413, 0.1855, 0.4611]}, {"w": "space,", "b": [0.1918, 0.4413, 0.2541, 0.4611]}, {"w": "turns", "b": [0.2604, 0.4413, 0.3109, 0.4611]}, {"w": "the", "b": [0.3172, 0.4413, 0.348, 0.4611]}, {"w": "image", "b": [0.3543, 0.4413, 0.416, 0.4611]}, {"w": "into", "b": [0.4223, 0.4413, 0.4615, 0.4611]}, {"w": "the", "b": [0.4678, 0.4413, 0.4986, 0.4611]}, {"w": "parameters", "b": [0.5049, 0.4413, 0.6156, 0.4611]}, {"w": "of", "b": [0.6219, 0.4413, 0.6429, 0.4611]}, {"w": "a", "b": [0.6491, 0.4413, 0.6603, 0.4611]}, {"w": "statistical", "b": [0.6666, 0.4413, 0.762, 0.4611]}, {"w": "distribution:", "b": [0.1294, 0.4618, 0.2528, 0.4816]}, {"w": "a", "b": [0.2591, 0.4618, 0.2703, 0.4816]}, {"w": "mean", "b": [0.2766, 0.4618, 0.3312, 0.4816]}, {"w": "and", "b": [0.3375, 0.4618, 0.374, 0.4816]}, {"w": "a", "b": [0.3803, 0.4618, 0.3915, 0.4816]}, {"w": "variance.", "b": [0.3978, 0.4618, 0.4895, 0.4816]}, {"w": "Essentially,", "b": [0.4958, 0.4618, 0.6111, 0.4816]}, {"w": "this", "b": [0.6174, 0.4618, 0.6539, 0.4816]}, {"w": "means", "b": [0.6602, 0.4618, 0.7246, 0.4816]}, {"w": "you’re", "b": [0.7309, 0.4618, 0.7968, 0.4816]}, {"w": "assuming", "b": [0.1294, 0.4823, 0.2247, 0.502]}, {"w": "the", "b": [0.231, 0.4823, 0.2618, 0.502]}, {"w": "input", "b": [0.2682, 0.4823, 0.32, 0.502]}, {"w": "image", "b": [0.3263, 0.4823, 0.388, 0.502]}, {"w": "has", "b": [0.3943, 0.4823, 0.4279, 0.502]}, {"w": "been", "b": [0.4342, 0.4823, 0.4818, 0.502]}, {"w": "generated", "b": [0.4881, 0.4823, 0.5862, 0.502]}, {"w": "by", "b": [0.5924, 0.4823, 0.6177, 0.502]}, {"w": "a", "b": [0.624, 0.4823, 0.6352, 0.502]}, {"w": "statistical", "b": [0.6415, 0.4823, 0.7368, 0.502]}, {"w": "process,", "b": [0.7431, 0.4823, 0.825, 0.502]}, {"w": "and", "b": [0.8314, 0.4823, 0.8678, 0.502]}, {"w": "that", "b": [0.1294, 0.5028, 0.1673, 0.5226]}, {"w": "the", "b": [0.1736, 0.5028, 0.2044, 0.5226]}, {"w": "randomness", "b": [0.2107, 0.5028, 0.3312, 0.5226]}, {"w": "of", "b": [0.3375, 0.5028, 0.3585, 0.5226]}, {"w": "this", "b": [0.3648, 0.5028, 0.4013, 0.5226]}, {"w": "process", "b": [0.4076, 0.5028, 0.4832, 0.5226]}, {"w": "should", "b": [0.4895, 0.5028, 0.5568, 0.5226]}, {"w": "be", "b": [0.5631, 0.5028, 0.5869, 0.5226]}, {"w": "taken", "b": [0.5932, 0.5028, 0.6479, 0.5226]}, {"w": "into", "b": [0.6542, 0.5028, 0.6934, 0.5226]}, {"w": "accounting", "b": [0.6997, 0.5028, 0.8104, 0.5226]}, {"w": "during", "b": [0.1294, 0.5233, 0.1953, 0.5431]}, {"w": "encoding", "b": [0.2016, 0.5233, 0.2941, 0.5431]}, {"w": "and", "b": [0.3004, 0.5233, 0.3368, 0.5431]}, {"w": "decoding.", "b": [0.3431, 0.5233, 0.4419, 0.5431]}, {"w": "The", "b": [0.4481, 0.5233, 0.4874, 0.5431]}, {"w": "VAE", "b": [0.4937, 0.5233, 0.5423, 0.5431]}, {"w": "then", "b": [0.5486, 0.5233, 0.592, 0.5431]}, {"w": "uses", "b": [0.5983, 0.5233, 0.6417, 0.5431]}, {"w": "the", "b": [0.6481, 0.5233, 0.6789, 0.5431]}, {"w": "mean", "b": [0.6852, 0.5233, 0.7398, 0.5431]}, {"w": "and", "b": [0.7461, 0.5233, 0.7826, 0.5431]}, {"w": "variance", "b": [0.1294, 0.5438, 0.2149, 0.5636]}, {"w": "parameters", "b": [0.2212, 0.5438, 0.3318, 0.5636]}, {"w": "to", "b": [0.3381, 0.5438, 0.3578, 0.5636]}, {"w": "randomly", "b": [0.3641, 0.5438, 0.4608, 0.5636]}, {"w": "sample", "b": [0.4671, 0.5438, 0.5385, 0.5636]}, {"w": "one", "b": [0.5448, 0.5438, 0.5813, 0.5636]}, {"w": "element", "b": [0.5876, 0.5438, 0.6674, 0.5636]}, {"w": "of", "b": [0.6737, 0.5438, 0.6947, 0.5636]}, {"w": "the", "b": [0.7011, 0.5438, 0.7319, 0.5636]}, {"w": "distribution,", "b": [0.7382, 0.5438, 0.8608, 0.5636]}, {"w": "and", "b": [0.1294, 0.5643, 0.1658, 0.5841]}, {"w": "decodes", "b": [0.1721, 0.5643, 0.2534, 0.5841]}, {"w": "that", "b": [0.2597, 0.5643, 0.2975, 0.5841]}, {"w": "element", "b": [0.3038, 0.5643, 0.3837, 0.5841]}, {"w": "back", "b": [0.39, 0.5643, 0.4376, 0.5841]}, {"w": "to", "b": [0.4439, 0.5643, 0.4635, 0.5841]}, {"w": "the", "b": [0.4698, 0.5643, 0.5007, 0.5841]}, {"w": "original", "b": [0.507, 0.5643, 0.5854, 0.5841]}, {"w": "input", "b": [0.5917, 0.5643, 0.6436, 0.5841]}, {"w": "(see", "b": [0.6499, 0.5643, 0.6905, 0.5841]}, {"w": "figure", "b": [0.6968, 0.5643, 0.757, 0.5841]}, {"w": "8.13).", "b": [0.7633, 0.5643, 0.8222, 0.5841]}, {"w": "The", "b": [0.8285, 0.5643, 0.8677, 0.5841]}, {"w": "stochasticity", "b": [0.1294, 0.5848, 0.2555, 0.6046]}, {"w": "of", "b": [0.2618, 0.5848, 0.2829, 0.6046]}, {"w": "this", "b": [0.2892, 0.5848, 0.3256, 0.6046]}, {"w": "process", "b": [0.3319, 0.5848, 0.4076, 0.6046]}, {"w": "improves", "b": [0.4139, 0.5848, 0.5078, 0.6046]}, {"w": "robustness", "b": [0.5141, 0.5848, 0.6206, 0.6046]}, {"w": "and", "b": [0.6269, 0.5848, 0.6633, 0.6046]}, {"w": "forces", "b": [0.6696, 0.5848, 0.7312, 0.6046]}, {"w": "the", "b": [0.7376, 0.5848, 0.7684, 0.6046]}, {"w": "latent", "b": [0.7747, 0.5848, 0.8307, 0.6046]}, {"w": "space", "b": [0.1294, 0.6053, 0.1854, 0.6251]}, {"w": "to", "b": [0.1917, 0.6053, 0.2114, 0.6251]}, {"w": "encode", "b": [0.2177, 0.6053, 0.2891, 0.6251]}, {"w": "meaningful", "b": [0.2954, 0.6053, 0.4103, 0.6251]}, {"w": "representations", "b": [0.4166, 0.6053, 0.5693, 0.6251]}, {"w": "everywhere:", "b": [0.5756, 0.6053, 0.7003, 0.6251]}, {"w": "every", "b": [0.7066, 0.6053, 0.7626, 0.6251]}, {"w": "point", "b": [0.7689, 0.6053, 0.8208, 0.6251]}, {"w": "sampled", "b": [0.1294, 0.6258, 0.2135, 0.6456]}, {"w": "in", "b": [0.2198, 0.6258, 0.2394, 0.6456]}, {"w": "the", "b": [0.2457, 0.6258, 0.2766, 0.6456]}, {"w": "latent", "b": [0.2829, 0.6258, 0.3389, 0.6456]}, {"w": "space", "b": [0.3452, 0.6258, 0.4012, 0.6456]}, {"w": "is", "b": [0.4076, 0.6258, 0.4244, 0.6456]}, {"w": "decoded", "b": [0.4307, 0.6258, 0.5147, 0.6456]}, {"w": "to", "b": [0.521, 0.6258, 0.5407, 0.6456]}, {"w": "a", "b": [0.547, 0.6258, 0.5582, 0.6456]}, {"w": "valid", "b": [0.5645, 0.6258, 0.6149, 0.6456]}, {"w": "output.", "b": [0.6212, 0.6258, 0.692, 0.6456]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 8.13. A VAE maps an image to two vectors, z_mean and z_log_sigma, which define a probability distribution over the latent space, used to sample a latent point to decode.", "words": [{"w": "Figure", "b": [0.1294, 0.6637, 0.1827, 0.6785]}, {"w": "8.13.", "b": [0.1874, 0.6637, 0.2252, 0.6785]}, {"w": "A", "b": [0.2299, 0.6637, 0.2436, 0.6785]}, {"w": "VAE", "b": [0.2483, 0.6637, 0.2858, 0.6785]}, {"w": "maps", "b": [0.2906, 0.6637, 0.3337, 0.6785]}, {"w": "an", "b": [0.3384, 0.6637, 0.3584, 0.6785]}, {"w": "image", "b": [0.3631, 0.6637, 0.4114, 0.6785]}, {"w": "to", "b": [0.4162, 0.6637, 0.4319, 0.6785]}, {"w": "two", "b": [0.4367, 0.6637, 0.4661, 0.6785]}, {"w": "vectors,", "b": [0.4708, 0.6637, 0.5333, 0.6785]}, {"w": "z_mean", "b": [0.538, 0.6644, 0.6062, 0.6796]}, {"w": "and", "b": [0.6109, 0.6637, 0.6414, 0.6785]}, {"w": "z_log_sigma,", "b": [0.6461, 0.6637, 0.7757, 0.6796]}, {"w": "which", "b": [0.7805, 0.6637, 0.8288, 0.6785]}, {"w": "define", "b": [0.1294, 0.6797, 0.1788, 0.6945]}, {"w": "a", "b": [0.1835, 0.6797, 0.193, 0.6945]}, {"w": "probability", "b": [0.1977, 0.6797, 0.2878, 0.6945]}, {"w": "distribution", "b": [0.2925, 0.6797, 0.3882, 0.6945]}, {"w": "over", "b": [0.3929, 0.6797, 0.4287, 0.6945]}, {"w": "the", "b": [0.4334, 0.6797, 0.4586, 0.6945]}, {"w": "latent", "b": [0.4633, 0.6797, 0.5096, 0.6945]}, {"w": "space,", "b": [0.5143, 0.6797, 0.5632, 0.6945]}, {"w": "used", "b": [0.5679, 0.6797, 0.6047, 0.6945]}, {"w": "to", "b": [0.6094, 0.6797, 0.6252, 0.6945]}, {"w": "sample", "b": [0.6299, 0.6797, 0.6867, 0.6945]}, {"w": "a", "b": [0.6914, 0.6797, 0.7009, 0.6945]}, {"w": "latent", "b": [0.7056, 0.6797, 0.7518, 0.6945]}, {"w": "point", "b": [0.7566, 0.6797, 0.7986, 0.6945]}, {"w": "to", "b": [0.8034, 0.6797, 0.8191, 0.6945]}, {"w": "decode.", "b": [0.1294, 0.6948, 0.1898, 0.7097]}]}]}, {"page": 392, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In technical terms, here’s how a VAE works:", "words": [{"w": "In", "b": [0.1294, 0.3139, 0.1504, 0.3336]}, {"w": "technical", "b": [0.1567, 0.3139, 0.2478, 0.3336]}, {"w": "terms,", "b": [0.2541, 0.3139, 0.3165, 0.3336]}, {"w": "here’s", "b": [0.3228, 0.3139, 0.383, 0.3336]}, {"w": "how", "b": [0.3893, 0.3139, 0.4327, 0.3336]}, {"w": "a", "b": [0.439, 0.3139, 0.4502, 0.3336]}, {"w": "VAE", "b": [0.4565, 0.3139, 0.5051, 0.3336]}, {"w": "works:", "b": [0.5114, 0.3139, 0.5801, 0.3336]}]}, {"id": "b_1", "type": "paragraph", "text": "1. An encoder module turns the input samples input_img into two parameters in a latent space of representations, z_mean and z_log_variance. 2. You randomly sample a point z from the latent normal distribution that’s assumed to generate the input image, via z = z_mean + exp(z_log_variance) * epsilon, where epsilon is a random tensor of small values. 3. A decoder module maps this point in the latent space back to the original input image.", "words": [{"w": "1.", "b": [0.1551, 0.3522, 0.174, 0.3719]}, {"w": "An", "b": [0.1799, 0.3522, 0.2107, 0.3719]}, {"w": "encoder", "b": [0.217, 0.3522, 0.2968, 0.3719]}, {"w": "module", "b": [0.3031, 0.3522, 0.3788, 0.3719]}, {"w": "turns", "b": [0.3851, 0.3522, 0.4356, 0.3719]}, {"w": "the", "b": [0.4419, 0.3522, 0.4727, 0.3719]}, {"w": "input", "b": [0.479, 0.3522, 0.5309, 0.3719]}, {"w": "samples", "b": [0.5372, 0.3522, 0.6185, 0.3719]}, {"w": "input_img", "b": [0.6247, 0.3532, 0.7609, 0.3734]}, {"w": "into", "b": [0.7673, 0.3522, 0.8065, 0.3719]}, {"w": "two", "b": [0.8128, 0.3522, 0.8507, 0.3719]}, {"w": "parameters", "b": [0.1799, 0.3736, 0.2905, 0.3933]}, {"w": "in", "b": [0.2968, 0.3736, 0.3165, 0.3933]}, {"w": "a", "b": [0.3228, 0.3736, 0.334, 0.3933]}, {"w": "latent", "b": [0.3403, 0.3736, 0.3963, 0.3933]}, {"w": "space", "b": [0.4026, 0.3736, 0.4587, 0.3933]}, {"w": "of", "b": [0.465, 0.3736, 0.486, 0.3933]}, {"w": "representations,", "b": [0.4923, 0.3736, 0.6513, 0.3933]}, {"w": "z_mean", "b": [0.6575, 0.3746, 0.7483, 0.3948]}, {"w": "and", "b": [0.7547, 0.3736, 0.7911, 0.3933]}, {"w": "z_log_variance.", "b": [0.1799, 0.395, 0.3956, 0.4162]}, {"w": "2.", "b": [0.1551, 0.4164, 0.174, 0.4361]}, {"w": "You", "b": [0.1799, 0.4164, 0.2208, 0.4361]}, {"w": "randomly", "b": [0.2271, 0.4164, 0.3238, 0.4361]}, {"w": "sample", "b": [0.3301, 0.4164, 0.4015, 0.4361]}, {"w": "a", "b": [0.4079, 0.4164, 0.4191, 0.4361]}, {"w": "point", "b": [0.4254, 0.4164, 0.4772, 0.4361]}, {"w": "z", "b": [0.4835, 0.4174, 0.4986, 0.4376]}, {"w": "from", "b": [0.5049, 0.4164, 0.554, 0.4361]}, {"w": "the", "b": [0.5603, 0.4164, 0.5911, 0.4361]}, {"w": "latent", "b": [0.5974, 0.4164, 0.6535, 0.4361]}, {"w": "normal", "b": [0.6598, 0.4164, 0.7312, 0.4361]}, {"w": "distribution", "b": [0.7375, 0.4164, 0.8539, 0.4361]}, {"w": "that’s", "b": [0.1799, 0.4377, 0.2345, 0.4575]}, {"w": "assumed", "b": [0.2408, 0.4377, 0.3277, 0.4575]}, {"w": "to", "b": [0.334, 0.4377, 0.3536, 0.4575]}, {"w": "generate", "b": [0.3599, 0.4377, 0.4454, 0.4575]}, {"w": "the", "b": [0.4517, 0.4377, 0.4825, 0.4575]}, {"w": "input", "b": [0.4888, 0.4377, 0.5407, 0.4575]}, {"w": "image,", "b": [0.547, 0.4377, 0.6149, 0.4575]}, {"w": "via", "b": [0.6212, 0.4377, 0.6521, 0.4575]}, {"w": "z", "b": [0.6583, 0.4388, 0.6734, 0.459]}, {"w": "=", "b": [0.6886, 0.4388, 0.7037, 0.459]}, {"w": "z_mean", "b": [0.7188, 0.4388, 0.8097, 0.459]}, {"w": "+", "b": [0.8248, 0.4388, 0.8399, 0.459]}, {"w": "exp(z_log_variance)", "b": [0.1799, 0.4602, 0.4674, 0.4804]}, {"w": "*", "b": [0.4826, 0.4602, 0.4977, 0.4804]}, {"w": "epsilon,", "b": [0.5128, 0.4591, 0.6252, 0.4804]}, {"w": "where", "b": [0.6315, 0.4591, 0.6931, 0.4789]}, {"w": "epsilon", "b": [0.6994, 0.4602, 0.8053, 0.4804]}, {"w": "is", "b": [0.8116, 0.4591, 0.8285, 0.4789]}, {"w": "a", "b": [0.8348, 0.4591, 0.846, 0.4789]}, {"w": "random", "b": [0.1799, 0.4805, 0.2569, 0.5003]}, {"w": "tensor", "b": [0.2632, 0.4805, 0.3249, 0.5003]}, {"w": "of", "b": [0.3312, 0.4805, 0.3522, 0.5003]}, {"w": "small", "b": [0.3585, 0.4805, 0.4132, 0.5003]}, {"w": "values.", "b": [0.4195, 0.4805, 0.4902, 0.5003]}, {"w": "3.", "b": [0.1551, 0.501, 0.174, 0.5208]}, {"w": "A", "b": [0.1799, 0.501, 0.1981, 0.5208]}, {"w": "decoder", "b": [0.2044, 0.501, 0.2842, 0.5208]}, {"w": "module", "b": [0.2905, 0.501, 0.3662, 0.5208]}, {"w": "maps", "b": [0.3725, 0.501, 0.4258, 0.5208]}, {"w": "this", "b": [0.4321, 0.501, 0.4685, 0.5208]}, {"w": "point", "b": [0.4748, 0.501, 0.5267, 0.5208]}, {"w": "in", "b": [0.533, 0.501, 0.5526, 0.5208]}, {"w": "the", "b": [0.5589, 0.501, 0.5898, 0.5208]}, {"w": "latent", "b": [0.5961, 0.501, 0.6521, 0.5208]}, {"w": "space", "b": [0.6584, 0.501, 0.7144, 0.5208]}, {"w": "back", "b": [0.7208, 0.501, 0.7684, 0.5208]}, {"w": "to", "b": [0.7747, 0.501, 0.7943, 0.5208]}, {"w": "the", "b": [0.8006, 0.501, 0.8314, 0.5208]}, {"w": "original", "b": [0.1799, 0.5215, 0.2583, 0.5413]}, {"w": "input", "b": [0.2646, 0.5215, 0.3165, 0.5413]}, {"w": "image.", "b": [0.3228, 0.5215, 0.3908, 0.5413]}]}, {"id": "b_2", "type": "paragraph", "text": "Because epsilon is random, the process ensures that every point that’s close to the latent location where you encoded input_img (z-mean) can be decoded to something similar to input_img, thus forcing the latent space to be continuously meaningful. Any two close points in the latent space will decode to highly similar images. Continuity, combined with the low dimensionality of the latent space, forces every direction in the latent space to encode a meaningful axis of variation of the data, making the latent space very structured and thus highly suitable to manipulation via concept vectors.", "words": [{"w": "Because", "b": [0.1294, 0.5643, 0.2135, 0.5841]}, {"w": "epsilon", "b": [0.2198, 0.5654, 0.3257, 0.5856]}, {"w": "is", "b": [0.332, 0.5643, 0.3488, 0.5841]}, {"w": "random,", "b": [0.3551, 0.5643, 0.4385, 0.5841]}, {"w": "the", "b": [0.4448, 0.5643, 0.4756, 0.5841]}, {"w": "process", "b": [0.4819, 0.5643, 0.5576, 0.5841]}, {"w": "ensures", "b": [0.5639, 0.5643, 0.6396, 0.5841]}, {"w": "that", "b": [0.6459, 0.5643, 0.6837, 0.5841]}, {"w": "every", "b": [0.69, 0.5643, 0.746, 0.5841]}, {"w": "point", "b": [0.7523, 0.5643, 0.8042, 0.5841]}, {"w": "that’s", "b": [0.8105, 0.5643, 0.8651, 0.5841]}, {"w": "close", "b": [0.1294, 0.5857, 0.1813, 0.6054]}, {"w": "to", "b": [0.1876, 0.5857, 0.2072, 0.6054]}, {"w": "the", "b": [0.2135, 0.5857, 0.2443, 0.6054]}, {"w": "latent", "b": [0.2506, 0.5857, 0.3067, 0.6054]}, {"w": "location", "b": [0.313, 0.5857, 0.3943, 0.6054]}, {"w": "where", "b": [0.4006, 0.5857, 0.4622, 0.6054]}, {"w": "you", "b": [0.4685, 0.5857, 0.5063, 0.6054]}, {"w": "encoded", "b": [0.5126, 0.5857, 0.5967, 0.6054]}, {"w": "input_img", "b": [0.6029, 0.5867, 0.7391, 0.6069]}, {"w": "(z-mean)", "b": [0.7455, 0.5857, 0.8531, 0.6069]}, {"w": "can", "b": [0.1294, 0.6071, 0.1644, 0.6268]}, {"w": "be", "b": [0.1707, 0.6071, 0.1945, 0.6268]}, {"w": "decoded", "b": [0.2009, 0.6071, 0.2849, 0.6268]}, {"w": "to", "b": [0.2912, 0.6071, 0.3108, 0.6268]}, {"w": "something", "b": [0.3171, 0.6071, 0.4223, 0.6268]}, {"w": "similar", "b": [0.4286, 0.6071, 0.4986, 0.6268]}, {"w": "to", "b": [0.5049, 0.6071, 0.5246, 0.6268]}, {"w": "input_img,", "b": [0.5308, 0.6071, 0.6734, 0.6283]}, {"w": "thus", "b": [0.6797, 0.6071, 0.7217, 0.6268]}, {"w": "forcing", "b": [0.728, 0.6071, 0.8009, 0.6268]}, {"w": "the", "b": [0.8072, 0.6071, 0.838, 0.6268]}, {"w": "latent", "b": [0.1294, 0.6285, 0.1855, 0.6482]}, {"w": "space", "b": [0.1918, 0.6285, 0.2478, 0.6482]}, {"w": "to", "b": [0.2541, 0.6285, 0.2737, 0.6482]}, {"w": "be", "b": [0.28, 0.6285, 0.3038, 0.6482]}, {"w": "continuously", "b": [0.3102, 0.6285, 0.4405, 0.6482]}, {"w": "meaningful.", "b": [0.4468, 0.6285, 0.568, 0.6482]}, {"w": "Any", "b": [0.5743, 0.6285, 0.6178, 0.6482]}, {"w": "two", "b": [0.6241, 0.6285, 0.6619, 0.6482]}, {"w": "close", "b": [0.6682, 0.6285, 0.72, 0.6482]}, {"w": "points", "b": [0.7264, 0.6285, 0.788, 0.6482]}, {"w": "in", "b": [0.7943, 0.6285, 0.814, 0.6482]}, {"w": "the", "b": [0.8203, 0.6285, 0.8511, 0.6482]}, {"w": "latent", "b": [0.1294, 0.649, 0.1855, 0.6687]}, {"w": "space", "b": [0.1918, 0.649, 0.2478, 0.6687]}, {"w": "will", "b": [0.2541, 0.649, 0.2934, 0.6687]}, {"w": "decode", "b": [0.2997, 0.649, 0.3711, 0.6687]}, {"w": "to", "b": [0.3774, 0.649, 0.397, 0.6687]}, {"w": "highly", "b": [0.4033, 0.649, 0.4678, 0.6687]}, {"w": "similar", "b": [0.4741, 0.649, 0.5441, 0.6687]}, {"w": "images.", "b": [0.5504, 0.649, 0.6282, 0.6687]}, {"w": "Continuity,", "b": [0.6345, 0.649, 0.7471, 0.6687]}, {"w": "combined", "b": [0.7534, 0.649, 0.8529, 0.6687]}, {"w": "with", "b": [0.1294, 0.6695, 0.1743, 0.6892]}, {"w": "the", "b": [0.1806, 0.6695, 0.2114, 0.6892]}, {"w": "low", "b": [0.2177, 0.6695, 0.2555, 0.6892]}, {"w": "dimensionality", "b": [0.2618, 0.6695, 0.4118, 0.6892]}, {"w": "of", "b": [0.4181, 0.6695, 0.4391, 0.6892]}, {"w": "the", "b": [0.4454, 0.6695, 0.4763, 0.6892]}, {"w": "latent", "b": [0.4826, 0.6695, 0.5386, 0.6892]}, {"w": "space,", "b": [0.5449, 0.6695, 0.6073, 0.6892]}, {"w": "forces", "b": [0.6136, 0.6695, 0.6752, 0.6892]}, {"w": "every", "b": [0.6815, 0.6695, 0.7375, 0.6892]}, {"w": "direction", "b": [0.7438, 0.6695, 0.8335, 0.6892]}, {"w": "in", "b": [0.8398, 0.6695, 0.8594, 0.6892]}, {"w": "the", "b": [0.1294, 0.69, 0.1602, 0.7097]}, {"w": "latent", "b": [0.1665, 0.69, 0.2226, 0.7097]}, {"w": "space", "b": [0.2289, 0.69, 0.2849, 0.7097]}, {"w": "to", "b": [0.2912, 0.69, 0.3108, 0.7097]}, {"w": "encode", "b": [0.3171, 0.69, 0.3886, 0.7097]}, {"w": "a", "b": [0.3949, 0.69, 0.4061, 0.7097]}, {"w": "meaningful", "b": [0.4124, 0.69, 0.5273, 0.7097]}, {"w": "axis", "b": [0.5336, 0.69, 0.5742, 0.7097]}, {"w": "of", "b": [0.5805, 0.69, 0.6015, 0.7097]}, {"w": "variation", "b": [0.6078, 0.69, 0.6975, 0.7097]}, {"w": "of", "b": [0.7038, 0.69, 0.7248, 0.7097]}, {"w": "the", "b": [0.7312, 0.69, 0.762, 0.7097]}, {"w": "data,", "b": [0.7683, 0.69, 0.8166, 0.7097]}, {"w": "making", "b": [0.1294, 0.7105, 0.2051, 0.7302]}, {"w": "the", "b": [0.2114, 0.7105, 0.2422, 0.7302]}, {"w": "latent", "b": [0.2485, 0.7105, 0.3046, 0.7302]}, {"w": "space", "b": [0.3109, 0.7105, 0.3669, 0.7302]}, {"w": "very", "b": [0.3732, 0.7105, 0.418, 0.7302]}, {"w": "structured", "b": [0.4244, 0.7105, 0.5252, 0.7302]}, {"w": "and", "b": [0.5315, 0.7105, 0.568, 0.7302]}, {"w": "thus", "b": [0.5743, 0.7105, 0.6163, 0.7302]}, {"w": "highly", "b": [0.6226, 0.7105, 0.6871, 0.7302]}, {"w": "suitable", "b": [0.6934, 0.7105, 0.7719, 0.7302]}, {"w": "to", "b": [0.7781, 0.7105, 0.7977, 0.7302]}, {"w": "manipulation", "b": [0.1294, 0.731, 0.2626, 0.7507]}, {"w": "via", "b": [0.2689, 0.731, 0.2997, 0.7507]}, {"w": "concept", "b": [0.306, 0.731, 0.3844, 0.7507]}, {"w": "vectors.", "b": [0.3908, 0.731, 0.4699, 0.7507]}]}, {"id": "b_3", "type": "paragraph", "text": "The parameters of a VAE are trained via two loss functions: a reconstruction loss that forces the decoded samples to match the initial inputs, and a regularization loss that helps learn well-formed latent spaces and reduce overfitting to the training data. Let’s quickly go over a Keras implementation of a VAE. Schematically, it looks like this:", "words": [{"w": "The", "b": [0.1294, 0.7738, 0.1686, 0.7935]}, {"w": "parameters", "b": [0.1749, 0.7738, 0.2856, 0.7935]}, {"w": "of", "b": [0.2919, 0.7738, 0.3129, 0.7935]}, {"w": "a", "b": [0.3192, 0.7738, 0.3304, 0.7935]}, {"w": "VAE", "b": [0.3367, 0.7738, 0.3853, 0.7935]}, {"w": "are", "b": [0.3916, 0.7738, 0.4224, 0.7935]}, {"w": "trained", "b": [0.4287, 0.7738, 0.4988, 0.7935]}, {"w": "via", "b": [0.5051, 0.7738, 0.5359, 0.7935]}, {"w": "two", "b": [0.5422, 0.7738, 0.58, 0.7935]}, {"w": "loss", "b": [0.5864, 0.7738, 0.6256, 0.7935]}, {"w": "functions:", "b": [0.6319, 0.7738, 0.7328, 0.7935]}, {"w": "a", "b": [0.7391, 0.7738, 0.7503, 0.7935]}, {"w": "reconstruction", "b": [0.1294, 0.7943, 0.2756, 0.814]}, {"w": "loss", "b": [0.2819, 0.7943, 0.3212, 0.814]}, {"w": "that", "b": [0.3275, 0.7943, 0.3653, 0.814]}, {"w": "forces", "b": [0.3716, 0.7943, 0.4332, 0.814]}, {"w": "the", "b": [0.4396, 0.7943, 0.4704, 0.814]}, {"w": "decoded", "b": [0.4767, 0.7943, 0.5607, 0.814]}, {"w": "samples", "b": [0.567, 0.7943, 0.6483, 0.814]}, {"w": "to", "b": [0.6546, 0.7943, 0.6743, 0.814]}, {"w": "match", "b": [0.6806, 0.7943, 0.7422, 0.814]}, {"w": "the", "b": [0.7485, 0.7943, 0.7793, 0.814]}, {"w": "initial", "b": [0.7856, 0.7943, 0.8445, 0.814]}, {"w": "inputs,", "b": [0.1294, 0.8148, 0.1974, 0.8345]}, {"w": "and", "b": [0.2037, 0.8148, 0.2401, 0.8345]}, {"w": "a", "b": [0.2464, 0.8148, 0.2576, 0.8345]}, {"w": "regularization", "b": [0.2639, 0.8148, 0.4074, 0.8345]}, {"w": "loss", "b": [0.4137, 0.8148, 0.4529, 0.8345]}, {"w": "that", "b": [0.4592, 0.8148, 0.497, 0.8345]}, {"w": "helps", "b": [0.5033, 0.8148, 0.5566, 0.8345]}, {"w": "learn", "b": [0.5629, 0.8148, 0.6133, 0.8345]}, {"w": "well-formed", "b": [0.6196, 0.8148, 0.7443, 0.8345]}, {"w": "latent", "b": [0.7506, 0.8148, 0.8067, 0.8345]}, {"w": "spaces", "b": [0.1294, 0.8353, 0.1953, 0.855]}, {"w": "and", "b": [0.2016, 0.8353, 0.238, 0.855]}, {"w": "reduce", "b": [0.2443, 0.8353, 0.3115, 0.855]}, {"w": "overfitting", "b": [0.3178, 0.8353, 0.4243, 0.855]}, {"w": "to", "b": [0.4306, 0.8353, 0.4503, 0.855]}, {"w": "the", "b": [0.4566, 0.8353, 0.4874, 0.855]}, {"w": "training", "b": [0.4937, 0.8353, 0.5722, 0.855]}, {"w": "data.", "b": [0.5785, 0.8353, 0.6268, 0.855]}, {"w": "Let’s", "b": [0.6331, 0.8353, 0.6835, 0.855]}, {"w": "quickly", "b": [0.6898, 0.8353, 0.7655, 0.855]}, {"w": "go", "b": [0.7718, 0.8353, 0.797, 0.855]}, {"w": "over", "b": [0.8033, 0.8353, 0.8481, 0.855]}, {"w": "a", "b": [0.8544, 0.8353, 0.8656, 0.855]}, {"w": "Keras", "b": [0.1294, 0.8558, 0.1882, 0.8755]}, {"w": "implementation", "b": [0.1945, 0.8558, 0.3529, 0.8755]}, {"w": "of", "b": [0.3592, 0.8558, 0.3802, 0.8755]}, {"w": "a", "b": [0.3865, 0.8558, 0.3977, 0.8755]}, {"w": "VAE.", "b": [0.404, 0.8558, 0.4589, 0.8755]}, {"w": "Schematically,", "b": [0.4652, 0.8558, 0.6128, 0.8755]}, {"w": "it", "b": [0.6191, 0.8558, 0.6331, 0.8755]}, {"w": "looks", "b": [0.6394, 0.8558, 0.6941, 0.8755]}, {"w": "like", "b": [0.7004, 0.8558, 0.7382, 0.8755]}, {"w": "this:", "b": [0.7445, 0.8558, 0.788, 0.8755]}]}]}, {"page": 393, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "z_mean, z_log_variance = encoder(input_img) 1 z = z_mean + exp(z_log_variance) * epsilon 2 reconstructed_img = decoder(z) 3 model = Model(input_img, reconstructed_img) 4", "words": [{"w": "z_mean,", "b": [0.1357, 0.0851, 0.2152, 0.1002]}, {"w": "z_log_variance", "b": [0.2265, 0.0851, 0.3855, 0.1002]}, {"w": "=", "b": [0.3968, 0.0851, 0.4082, 0.1002]}, {"w": "encoder(input_img)", "b": [0.4195, 0.0851, 0.6238, 0.1002]}, {"w": "1", "b": [0.7261, 0.0851, 0.7374, 0.1002]}, {"w": "z", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "=", "b": [0.1584, 0.1154, 0.1698, 0.1305]}, {"w": "z_mean", "b": [0.1811, 0.1154, 0.2492, 0.1305]}, {"w": "+", "b": [0.2606, 0.1154, 0.2719, 0.1305]}, {"w": "exp(z_log_variance)", "b": [0.2833, 0.1154, 0.499, 0.1305]}, {"w": "*", "b": [0.5103, 0.1154, 0.5217, 0.1305]}, {"w": "epsilon", "b": [0.533, 0.1154, 0.6125, 0.1305]}, {"w": "2", "b": [0.7261, 0.1154, 0.7374, 0.1305]}, {"w": "reconstructed_img", "b": [0.1357, 0.1457, 0.3287, 0.1608]}, {"w": "=", "b": [0.34, 0.1457, 0.3514, 0.1608]}, {"w": "decoder(z)", "b": [0.3628, 0.1457, 0.4763, 0.1608]}, {"w": "3", "b": [0.7261, 0.1457, 0.7374, 0.1608]}, {"w": "model", "b": [0.1357, 0.176, 0.1925, 0.1911]}, {"w": "=", "b": [0.2038, 0.176, 0.2152, 0.1911]}, {"w": "Model(input_img,", "b": [0.2265, 0.176, 0.4082, 0.1911]}, {"w": "reconstructed_img)", "b": [0.4195, 0.176, 0.6238, 0.1911]}, {"w": "4", "b": [0.7261, 0.176, 0.7374, 0.1911]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Encodes the input into a mean and variance parameter 2 Draws a latent point using a small random epsilon 3 Decodes z back to an image 4 Instantiates the autoencoder model, which maps an input image to its reconstruction", "words": [{"w": "1", "b": [0.1799, 0.2096, 0.1925, 0.2293]}, {"w": "Encodes", "b": [0.1988, 0.2096, 0.2885, 0.2293]}, {"w": "the", "b": [0.2948, 0.2096, 0.3284, 0.2293]}, {"w": "input", "b": [0.3347, 0.2096, 0.3922, 0.2293]}, {"w": "into", "b": [0.3985, 0.2096, 0.4406, 0.2293]}, {"w": "a", "b": [0.4469, 0.2096, 0.4595, 0.2293]}, {"w": "mean", "b": [0.4658, 0.2096, 0.5246, 0.2293]}, {"w": "and", "b": [0.531, 0.2096, 0.5716, 0.2293]}, {"w": "variance", "b": [0.5779, 0.2096, 0.6704, 0.2293]}, {"w": "parameter", "b": [0.6767, 0.2096, 0.7902, 0.2293]}, {"w": "2", "b": [0.1799, 0.2301, 0.1925, 0.2498]}, {"w": "Draws", "b": [0.1988, 0.2301, 0.2688, 0.2498]}, {"w": "a", "b": [0.2751, 0.2301, 0.2878, 0.2498]}, {"w": "latent", "b": [0.2941, 0.2301, 0.3557, 0.2498]}, {"w": "point", "b": [0.362, 0.2301, 0.4181, 0.2498]}, {"w": "using", "b": [0.4244, 0.2301, 0.4819, 0.2498]}, {"w": "a", "b": [0.4882, 0.2301, 0.5008, 0.2498]}, {"w": "small", "b": [0.5071, 0.2301, 0.5646, 0.2498]}, {"w": "random", "b": [0.5709, 0.2301, 0.6564, 0.2498]}, {"w": "epsilon", "b": [0.6627, 0.2301, 0.7384, 0.2498]}, {"w": "3", "b": [0.1799, 0.2506, 0.1925, 0.2703]}, {"w": "Decodes", "b": [0.1988, 0.2506, 0.287, 0.2703]}, {"w": "z", "b": [0.2934, 0.2506, 0.3046, 0.2703]}, {"w": "back", "b": [0.3109, 0.2506, 0.3627, 0.2703]}, {"w": "to", "b": [0.369, 0.2506, 0.39, 0.2703]}, {"w": "an", "b": [0.3964, 0.2506, 0.423, 0.2703]}, {"w": "image", "b": [0.4293, 0.2506, 0.4937, 0.2703]}, {"w": "4", "b": [0.1799, 0.2711, 0.1925, 0.2908]}, {"w": "Instantiates", "b": [0.1988, 0.2711, 0.3249, 0.2908]}, {"w": "the", "b": [0.3312, 0.2711, 0.3648, 0.2908]}, {"w": "autoencoder", "b": [0.3712, 0.2711, 0.5043, 0.2908]}, {"w": "model,", "b": [0.5106, 0.2711, 0.5827, 0.2908]}, {"w": "which", "b": [0.5891, 0.2711, 0.6535, 0.2908]}, {"w": "maps", "b": [0.6598, 0.2711, 0.7173, 0.2908]}, {"w": "an", "b": [0.7236, 0.2711, 0.7502, 0.2908]}, {"w": "input", "b": [0.7565, 0.2711, 0.814, 0.2908]}, {"w": "image", "b": [0.1799, 0.2916, 0.2443, 0.3113]}, {"w": "to", "b": [0.2506, 0.2916, 0.2716, 0.3113]}, {"w": "its", "b": [0.2779, 0.2916, 0.3032, 0.3113]}, {"w": "reconstruction", "b": [0.3095, 0.2916, 0.4659, 0.3113]}]}, {"id": "b_2", "type": "paragraph", "text": "You can then train the model using the reconstruction loss and the regularization loss.", "words": [{"w": "You", "b": [0.1294, 0.3344, 0.1703, 0.3541]}, {"w": "can", "b": [0.1766, 0.3344, 0.2116, 0.3541]}, {"w": "then", "b": [0.218, 0.3344, 0.2614, 0.3541]}, {"w": "train", "b": [0.2677, 0.3344, 0.3139, 0.3541]}, {"w": "the", "b": [0.3202, 0.3344, 0.3511, 0.3541]}, {"w": "model", "b": [0.3574, 0.3344, 0.4204, 0.3541]}, {"w": "using", "b": [0.4267, 0.3344, 0.4814, 0.3541]}, {"w": "the", "b": [0.4877, 0.3344, 0.5185, 0.3541]}, {"w": "reconstruction", "b": [0.5249, 0.3344, 0.6692, 0.3541]}, {"w": "loss", "b": [0.6755, 0.3344, 0.7147, 0.3541]}, {"w": "and", "b": [0.721, 0.3344, 0.7575, 0.3541]}, {"w": "the", "b": [0.7638, 0.3344, 0.7946, 0.3541]}, {"w": "regularization", "b": [0.1294, 0.3549, 0.2695, 0.3746]}, {"w": "loss.", "b": [0.2758, 0.3549, 0.3214, 0.3746]}]}, {"id": "b_3", "type": "paragraph", "text": "The following listing shows the encoder network you’ll use, mapping images to the parameters of a probability distribution over the latent space. It’s a simple convnet that maps the input image x to two vectors, z_mean and z_log_var.", "words": [{"w": "The", "b": [0.1294, 0.3976, 0.1686, 0.4174]}, {"w": "following", "b": [0.1749, 0.3976, 0.273, 0.4174]}, {"w": "listing", "b": [0.2794, 0.3976, 0.3424, 0.4174]}, {"w": "shows", "b": [0.3487, 0.3976, 0.4118, 0.4174]}, {"w": "the", "b": [0.4181, 0.3976, 0.4489, 0.4174]}, {"w": "encoder", "b": [0.4553, 0.3976, 0.5351, 0.4174]}, {"w": "network", "b": [0.5414, 0.3976, 0.6241, 0.4174]}, {"w": "you’ll", "b": [0.6304, 0.3976, 0.6906, 0.4174]}, {"w": "use,", "b": [0.6969, 0.3976, 0.7369, 0.4174]}, {"w": "mapping", "b": [0.7432, 0.3976, 0.8315, 0.4174]}, {"w": "images", "b": [0.1294, 0.4181, 0.2009, 0.4379]}, {"w": "to", "b": [0.2072, 0.4181, 0.2268, 0.4379]}, {"w": "the", "b": [0.2331, 0.4181, 0.2639, 0.4379]}, {"w": "parameters", "b": [0.2702, 0.4181, 0.3809, 0.4379]}, {"w": "of", "b": [0.3872, 0.4181, 0.4082, 0.4379]}, {"w": "a", "b": [0.4145, 0.4181, 0.4257, 0.4379]}, {"w": "probability", "b": [0.432, 0.4181, 0.5428, 0.4379]}, {"w": "distribution", "b": [0.5491, 0.4181, 0.6654, 0.4379]}, {"w": "over", "b": [0.6716, 0.4181, 0.7165, 0.4379]}, {"w": "the", "b": [0.7228, 0.4181, 0.7536, 0.4379]}, {"w": "latent", "b": [0.7599, 0.4181, 0.8159, 0.4379]}, {"w": "space.", "b": [0.1294, 0.4386, 0.1917, 0.4584]}, {"w": "It’s", "b": [0.1981, 0.4386, 0.2303, 0.4584]}, {"w": "a", "b": [0.2366, 0.4386, 0.2478, 0.4584]}, {"w": "simple", "b": [0.2541, 0.4386, 0.3214, 0.4584]}, {"w": "convnet", "b": [0.3277, 0.4386, 0.4075, 0.4584]}, {"w": "that", "b": [0.4138, 0.4386, 0.4517, 0.4584]}, {"w": "maps", "b": [0.458, 0.4386, 0.5112, 0.4584]}, {"w": "the", "b": [0.5175, 0.4386, 0.5484, 0.4584]}, {"w": "input", "b": [0.5547, 0.4386, 0.6065, 0.4584]}, {"w": "image", "b": [0.6128, 0.4386, 0.6745, 0.4584]}, {"w": "x", "b": [0.6807, 0.4397, 0.6959, 0.4599]}, {"w": "to", "b": [0.7022, 0.4386, 0.7218, 0.4584]}, {"w": "two", "b": [0.7281, 0.4386, 0.7659, 0.4584]}, {"w": "vectors,", "b": [0.7723, 0.4386, 0.8514, 0.4584]}, {"w": "z_mean", "b": [0.1294, 0.4611, 0.2202, 0.4813]}, {"w": "and", "b": [0.2265, 0.46, 0.263, 0.4798]}, {"w": "z_log_var.", "b": [0.2693, 0.46, 0.4118, 0.4813]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 8.23. VAE encoder network", "words": [{"w": "Listing", "b": [0.1294, 0.4988, 0.1862, 0.5136]}, {"w": "8.23.", "b": [0.1909, 0.4988, 0.2288, 0.5136]}, {"w": "VAE", "b": [0.2335, 0.4988, 0.271, 0.5136]}, {"w": "encoder", "b": [0.2757, 0.4988, 0.3398, 0.5136]}, {"w": "network", "b": [0.3445, 0.4988, 0.4118, 0.5136]}]}, {"id": "b_5", "type": "paragraph", "text": "import keras from keras import layers from keras import backend as K from keras.models import Model import numpy as np img_shape = (28, 28, 1) batch_size = 16 latent_dim = 2 1 input_img = keras.Input(shape=img_shape) x = layers.Conv2D(32, 3, padding='same', activation='relu')(input_img) x = layers.Conv2D(64, 3, padding='same', activation='relu', strides=(2, 2))(x) x = layers.Conv2D(64, 3, padding='same', activation='relu')(x) x = layers.Conv2D(64, 3, padding='same', activation='relu')(x) shape_before_flattening = K.int_shape(x) x = layers.Flatten()(x) x = layers.Dense(32, activation='relu')(x)", "words": [{"w": "import", "b": [0.1357, 0.5272, 0.2038, 0.5423]}, {"w": "keras", "b": [0.2152, 0.5272, 0.2719, 0.5423]}, {"w": "from", "b": [0.1357, 0.5423, 0.1811, 0.5575]}, {"w": "keras", "b": [0.1925, 0.5423, 0.2492, 0.5575]}, {"w": "import", "b": [0.2606, 0.5423, 0.3287, 0.5575]}, {"w": "layers", "b": [0.34, 0.5423, 0.4082, 0.5575]}, {"w": "from", "b": [0.1357, 0.5575, 0.1811, 0.5726]}, {"w": "keras", "b": [0.1925, 0.5575, 0.2492, 0.5726]}, {"w": "import", "b": [0.2606, 0.5575, 0.3287, 0.5726]}, {"w": "backend", "b": [0.34, 0.5575, 0.4195, 0.5726]}, {"w": "as", "b": [0.4309, 0.5575, 0.4536, 0.5726]}, {"w": "K", "b": [0.4649, 0.5575, 0.4763, 0.5726]}, {"w": "from", "b": [0.1357, 0.5726, 0.1811, 0.5878]}, {"w": "keras.models", "b": [0.1925, 0.5726, 0.3287, 0.5878]}, {"w": "import", "b": [0.34, 0.5726, 0.4082, 0.5878]}, {"w": "Model", "b": [0.4195, 0.5726, 0.4763, 0.5878]}, {"w": "import", "b": [0.1357, 0.5878, 0.2038, 0.6029]}, {"w": "numpy", "b": [0.2152, 0.5878, 0.2719, 0.6029]}, {"w": "as", "b": [0.2833, 0.5878, 0.306, 0.6029]}, {"w": "np", "b": [0.3173, 0.5878, 0.34, 0.6029]}, {"w": "img_shape", "b": [0.1357, 0.6181, 0.2379, 0.6332]}, {"w": "=", "b": [0.2492, 0.6181, 0.2606, 0.6332]}, {"w": "(28,", "b": [0.2719, 0.6181, 0.3173, 0.6332]}, {"w": "28,", "b": [0.3287, 0.6181, 0.3628, 0.6332]}, {"w": "1)", "b": [0.3741, 0.6181, 0.3968, 0.6332]}, {"w": "batch_size", "b": [0.1357, 0.6332, 0.2492, 0.6484]}, {"w": "=", "b": [0.2606, 0.6332, 0.2719, 0.6484]}, {"w": "16", "b": [0.2833, 0.6332, 0.306, 0.6484]}, {"w": "latent_dim", "b": [0.1357, 0.6484, 0.2492, 0.6635]}, {"w": "=", "b": [0.2606, 0.6484, 0.2719, 0.6635]}, {"w": "2", "b": [0.2833, 0.6484, 0.2946, 0.6635]}, {"w": "1", "b": [0.7147, 0.6484, 0.7261, 0.6635]}, {"w": "input_img", "b": [0.1357, 0.6787, 0.2379, 0.6938]}, {"w": "=", "b": [0.2492, 0.6787, 0.2606, 0.6938]}, {"w": "keras.Input(shape=img_shape)", "b": [0.2719, 0.6787, 0.5898, 0.6938]}, {"w": "x", "b": [0.1357, 0.709, 0.1471, 0.7242]}, {"w": "=", "b": [0.1584, 0.709, 0.1698, 0.7242]}, {"w": "layers.Conv2D(32,", "b": [0.1811, 0.709, 0.3741, 0.7242]}, {"w": "3,", "b": [0.3855, 0.709, 0.4082, 0.7242]}, {"w": "padding='same',", "b": [0.34, 0.7242, 0.5103, 0.7393]}, {"w": "activation='relu')(input_img)", "b": [0.5217, 0.7242, 0.8509, 0.7393]}, {"w": "x", "b": [0.1357, 0.7393, 0.1471, 0.7545]}, {"w": "=", "b": [0.1584, 0.7393, 0.1698, 0.7545]}, {"w": "layers.Conv2D(64,", "b": [0.1811, 0.7393, 0.3741, 0.7545]}, {"w": "3,", "b": [0.3855, 0.7393, 0.4082, 0.7545]}, {"w": "padding='same',", "b": [0.34, 0.7545, 0.5103, 0.7696]}, {"w": "activation='relu',", "b": [0.5217, 0.7545, 0.726, 0.7696]}, {"w": "strides=(2,", "b": [0.34, 0.7696, 0.4649, 0.7848]}, {"w": "2))(x)", "b": [0.4763, 0.7696, 0.5444, 0.7848]}, {"w": "x", "b": [0.1357, 0.7848, 0.1471, 0.7999]}, {"w": "=", "b": [0.1584, 0.7848, 0.1698, 0.7999]}, {"w": "layers.Conv2D(64,", "b": [0.1811, 0.7848, 0.3741, 0.7999]}, {"w": "3,", "b": [0.3855, 0.7848, 0.4082, 0.7999]}, {"w": "padding='same',", "b": [0.34, 0.7999, 0.5103, 0.8151]}, {"w": "activation='relu')(x)", "b": [0.5217, 0.7999, 0.7601, 0.8151]}, {"w": "x", "b": [0.1357, 0.8151, 0.1471, 0.8302]}, {"w": "=", "b": [0.1584, 0.8151, 0.1698, 0.8302]}, {"w": "layers.Conv2D(64,", "b": [0.1811, 0.8151, 0.3741, 0.8302]}, {"w": "3,", "b": [0.3855, 0.8151, 0.4082, 0.8302]}, {"w": "padding='same',", "b": [0.34, 0.8302, 0.5103, 0.8454]}, {"w": "activation='relu')(x)", "b": [0.5217, 0.8302, 0.7601, 0.8454]}, {"w": "shape_before_flattening", "b": [0.1357, 0.8454, 0.3968, 0.8605]}, {"w": "=", "b": [0.4082, 0.8454, 0.4195, 0.8605]}, {"w": "K.int_shape(x)", "b": [0.4309, 0.8454, 0.5898, 0.8605]}, {"w": "x", "b": [0.1357, 0.8757, 0.1471, 0.8908]}, {"w": "=", "b": [0.1584, 0.8757, 0.1698, 0.8908]}, {"w": "layers.Flatten()(x)", "b": [0.1811, 0.8757, 0.3968, 0.8908]}, {"w": "x", "b": [0.1357, 0.8908, 0.1471, 0.906]}, {"w": "=", "b": [0.1584, 0.8908, 0.1698, 0.906]}, {"w": "layers.Dense(32,", "b": [0.1811, 0.8908, 0.3628, 0.906]}, {"w": "activation='relu')(x)", "b": [0.3741, 0.8908, 0.6125, 0.906]}]}]}, {"page": 394, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "z_mean = layers.Dense(latent_dim)(x) 2 z_log_var = layers.Dense(latent_dim)(x) 2", "words": [{"w": "z_mean", "b": [0.1357, 0.1002, 0.2038, 0.1154]}, {"w": "=", "b": [0.2152, 0.1002, 0.2265, 0.1154]}, {"w": "layers.Dense(latent_dim)(x)", "b": [0.2379, 0.1002, 0.5444, 0.1154]}, {"w": "2", "b": [0.7147, 0.1002, 0.7261, 0.1154]}, {"w": "z_log_var", "b": [0.1357, 0.1154, 0.2379, 0.1305]}, {"w": "=", "b": [0.2492, 0.1154, 0.2606, 0.1305]}, {"w": "layers.Dense(latent_dim)(x)", "b": [0.2719, 0.1154, 0.5784, 0.1305]}, {"w": "2", "b": [0.7147, 0.1154, 0.7261, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Dimensionality of the latent space: a 2D plane 2 The input image ends up being encoded into these two parameters.", "words": [{"w": "1", "b": [0.1799, 0.149, 0.1925, 0.1687]}, {"w": "Dimensionality", "b": [0.1988, 0.149, 0.3614, 0.1687]}, {"w": "of", "b": [0.3677, 0.149, 0.3887, 0.1687]}, {"w": "the", "b": [0.395, 0.149, 0.4286, 0.1687]}, {"w": "latent", "b": [0.4349, 0.149, 0.4966, 0.1687]}, {"w": "space:", "b": [0.5029, 0.149, 0.5701, 0.1687]}, {"w": "a", "b": [0.5764, 0.149, 0.5891, 0.1687]}, {"w": "2D", "b": [0.5954, 0.149, 0.6262, 0.1687]}, {"w": "plane", "b": [0.6325, 0.149, 0.6914, 0.1687]}, {"w": "2", "b": [0.1799, 0.1695, 0.1925, 0.1892]}, {"w": "The", "b": [0.1988, 0.1695, 0.2408, 0.1892]}, {"w": "input", "b": [0.2471, 0.1695, 0.3046, 0.1892]}, {"w": "image", "b": [0.3109, 0.1695, 0.3754, 0.1892]}, {"w": "ends", "b": [0.3817, 0.1695, 0.4308, 0.1892]}, {"w": "up", "b": [0.4371, 0.1695, 0.4651, 0.1892]}, {"w": "being", "b": [0.4714, 0.1695, 0.5303, 0.1892]}, {"w": "encoded", "b": [0.5366, 0.1695, 0.6249, 0.1892]}, {"w": "into", "b": [0.6312, 0.1695, 0.6733, 0.1892]}, {"w": "these", "b": [0.6796, 0.1695, 0.7342, 0.1892]}, {"w": "two", "b": [0.7405, 0.1695, 0.7797, 0.1892]}, {"w": "parameters.", "b": [0.1799, 0.19, 0.3094, 0.2097]}]}, {"id": "b_2", "type": "paragraph", "text": "Next is the code for using z_mean and z_log_var, the parameters of the statistical distribution assumed to have produced input_img, to generate a latent space point z. Here, you wrap some arbitrary code (built on top of Keras backend primitives) into a Lambda layer. In Keras, everything needs to be a layer, so code that isn’t part of a built-in layer should be wrapped in a Lambda (or in a custom layer).", "words": [{"w": "Next", "b": [0.1294, 0.2327, 0.1785, 0.2525]}, {"w": "is", "b": [0.1848, 0.2327, 0.2016, 0.2525]}, {"w": "the", "b": [0.2079, 0.2327, 0.2387, 0.2525]}, {"w": "code", "b": [0.245, 0.2327, 0.2926, 0.2525]}, {"w": "for", "b": [0.299, 0.2327, 0.3284, 0.2525]}, {"w": "using", "b": [0.3347, 0.2327, 0.3893, 0.2525]}, {"w": "z_mean", "b": [0.3956, 0.2338, 0.4864, 0.254]}, {"w": "and", "b": [0.4927, 0.2327, 0.5292, 0.2525]}, {"w": "z_log_var,", "b": [0.5355, 0.2327, 0.678, 0.254]}, {"w": "the", "b": [0.6843, 0.2327, 0.7151, 0.2525]}, {"w": "parameters", "b": [0.7215, 0.2327, 0.8321, 0.2525]}, {"w": "of", "b": [0.8384, 0.2327, 0.8594, 0.2525]}, {"w": "the", "b": [0.1294, 0.2541, 0.1602, 0.2739]}, {"w": "statistical", "b": [0.1665, 0.2541, 0.2618, 0.2739]}, {"w": "distribution", "b": [0.2682, 0.2541, 0.3845, 0.2739]}, {"w": "assumed", "b": [0.3908, 0.2541, 0.4777, 0.2739]}, {"w": "to", "b": [0.484, 0.2541, 0.5036, 0.2739]}, {"w": "have", "b": [0.5099, 0.2541, 0.5575, 0.2739]}, {"w": "produced", "b": [0.5639, 0.2541, 0.6577, 0.2739]}, {"w": "input_img,", "b": [0.6639, 0.2541, 0.8065, 0.2754]}, {"w": "to", "b": [0.8128, 0.2541, 0.8324, 0.2739]}, {"w": "generate", "b": [0.1294, 0.2755, 0.2149, 0.2953]}, {"w": "a", "b": [0.2212, 0.2755, 0.2324, 0.2953]}, {"w": "latent", "b": [0.2387, 0.2755, 0.2947, 0.2953]}, {"w": "space", "b": [0.301, 0.2755, 0.357, 0.2953]}, {"w": "point", "b": [0.3634, 0.2755, 0.4152, 0.2953]}, {"w": "z.", "b": [0.4215, 0.2755, 0.4429, 0.2968]}, {"w": "Here,", "b": [0.4492, 0.2755, 0.5045, 0.2953]}, {"w": "you", "b": [0.5108, 0.2755, 0.5487, 0.2953]}, {"w": "wrap", "b": [0.555, 0.2755, 0.6054, 0.2953]}, {"w": "some", "b": [0.6117, 0.2755, 0.665, 0.2953]}, {"w": "arbitrary", "b": [0.6713, 0.2755, 0.7581, 0.2953]}, {"w": "code", "b": [0.7644, 0.2755, 0.8121, 0.2953]}, {"w": "(built", "b": [0.1294, 0.2969, 0.1841, 0.3167]}, {"w": "on", "b": [0.1904, 0.2969, 0.2156, 0.3167]}, {"w": "top", "b": [0.2219, 0.2969, 0.2542, 0.3167]}, {"w": "of", "b": [0.2605, 0.2969, 0.2815, 0.3167]}, {"w": "Keras", "b": [0.2878, 0.2969, 0.3466, 0.3167]}, {"w": "backend", "b": [0.3529, 0.2969, 0.437, 0.3167]}, {"w": "primitives)", "b": [0.4433, 0.2969, 0.554, 0.3167]}, {"w": "into", "b": [0.5603, 0.2969, 0.5995, 0.3167]}, {"w": "a", "b": [0.6059, 0.2969, 0.6171, 0.3167]}, {"w": "Lambda", "b": [0.6233, 0.298, 0.7141, 0.3182]}, {"w": "layer.", "b": [0.7204, 0.2969, 0.7757, 0.3167]}, {"w": "In", "b": [0.782, 0.2969, 0.8031, 0.3167]}, {"w": "Keras,", "b": [0.1294, 0.3183, 0.1945, 0.3381]}, {"w": "everything", "b": [0.2009, 0.3183, 0.3087, 0.3381]}, {"w": "needs", "b": [0.315, 0.3183, 0.3725, 0.3381]}, {"w": "to", "b": [0.3788, 0.3183, 0.3984, 0.3381]}, {"w": "be", "b": [0.4047, 0.3183, 0.4285, 0.3381]}, {"w": "a", "b": [0.4348, 0.3183, 0.446, 0.3381]}, {"w": "layer,", "b": [0.4524, 0.3183, 0.508, 0.3381]}, {"w": "so", "b": [0.5143, 0.3183, 0.5368, 0.3381]}, {"w": "code", "b": [0.5431, 0.3183, 0.5907, 0.3381]}, {"w": "that", "b": [0.597, 0.3183, 0.6348, 0.3381]}, {"w": "isn’t", "b": [0.6411, 0.3183, 0.6855, 0.3381]}, {"w": "part", "b": [0.6918, 0.3183, 0.7311, 0.3381]}, {"w": "of", "b": [0.7374, 0.3183, 0.7584, 0.3381]}, {"w": "a", "b": [0.7647, 0.3183, 0.7759, 0.3381]}, {"w": "built-in", "b": [0.7822, 0.3183, 0.8565, 0.3381]}, {"w": "layer", "b": [0.1294, 0.3388, 0.1798, 0.3586]}, {"w": "should", "b": [0.1861, 0.3388, 0.2534, 0.3586]}, {"w": "be", "b": [0.2597, 0.3388, 0.2835, 0.3586]}, {"w": "wrapped", "b": [0.2898, 0.3388, 0.3767, 0.3586]}, {"w": "in", "b": [0.383, 0.3388, 0.4026, 0.3586]}, {"w": "a", "b": [0.4089, 0.3388, 0.4201, 0.3586]}, {"w": "Lambda", "b": [0.4264, 0.3399, 0.5172, 0.36]}, {"w": "(or", "b": [0.5235, 0.3388, 0.5529, 0.3586]}, {"w": "in", "b": [0.5592, 0.3388, 0.5789, 0.3586]}, {"w": "a", "b": [0.5852, 0.3388, 0.5964, 0.3586]}, {"w": "custom", "b": [0.6027, 0.3388, 0.6756, 0.3586]}, {"w": "layer).", "b": [0.6819, 0.3388, 0.747, 0.3586]}]}, {"id": "b_3", "type": "equation", "text": "Listing 8.24. Latent-space-sampling function", "words": [{"w": "Listing", "b": [0.1294, 0.3775, 0.1862, 0.3924]}, {"w": "8.24.", "b": [0.1909, 0.3775, 0.2288, 0.3924]}, {"w": "Latent-space-sampling", "b": [0.2335, 0.3775, 0.4174, 0.3924]}, {"w": "function", "b": [0.4221, 0.3775, 0.4894, 0.3924]}]}, {"id": "b_4", "type": "paragraph", "text": "def sampling(args): z_mean, z_log_var = args epsilon = K.random_normal(shape=(K.shape(z_mean)[0], latent_dim), mean=0., stddev=1.) return z_mean + K.exp(z_log_var) * epsilon z = layers.Lambda(sampling)([z_mean, z_log_var])", "words": [{"w": "def", "b": [0.1357, 0.406, 0.1698, 0.4211]}, {"w": "sampling(args):", "b": [0.1811, 0.406, 0.3514, 0.4211]}, {"w": "z_mean,", "b": [0.1811, 0.4211, 0.2606, 0.4363]}, {"w": "z_log_var", "b": [0.2719, 0.4211, 0.3741, 0.4363]}, {"w": "=", "b": [0.3855, 0.4211, 0.3968, 0.4363]}, {"w": "args", "b": [0.4082, 0.4211, 0.4536, 0.4363]}, {"w": "epsilon", "b": [0.1811, 0.4363, 0.2606, 0.4514]}, {"w": "=", "b": [0.2719, 0.4363, 0.2833, 0.4514]}, {"w": "K.random_normal(shape=(K.shape(z_mean)[0],", "b": [0.2946, 0.4363, 0.7714, 0.4514]}, {"w": "latent_dim),", "b": [0.1357, 0.4514, 0.2719, 0.4666]}, {"w": "mean=0.,", "b": [0.4763, 0.4666, 0.5671, 0.4817]}, {"w": "stddev=1.)", "b": [0.5784, 0.4666, 0.6919, 0.4817]}, {"w": "return", "b": [0.1811, 0.4817, 0.2492, 0.4969]}, {"w": "z_mean", "b": [0.2606, 0.4817, 0.3287, 0.4969]}, {"w": "+", "b": [0.34, 0.4817, 0.3514, 0.4969]}, {"w": "K.exp(z_log_var)", "b": [0.3628, 0.4817, 0.5444, 0.4969]}, {"w": "*", "b": [0.5557, 0.4817, 0.5671, 0.4969]}, {"w": "epsilon", "b": [0.5784, 0.4817, 0.6579, 0.4969]}, {"w": "z", "b": [0.1357, 0.512, 0.1471, 0.5272]}, {"w": "=", "b": [0.1584, 0.512, 0.1698, 0.5272]}, {"w": "layers.Lambda(sampling)([z_mean,", "b": [0.1811, 0.512, 0.5444, 0.5272]}, {"w": "z_log_var])", "b": [0.5557, 0.512, 0.6806, 0.5272]}]}, {"id": "b_5", "type": "paragraph", "text": "The following listing shows the decoder implementation. You reshape the vector z to the dimensions of an image and then use a few convolution layers to obtain a final image output that has the same dimensions as the original input_img.", "words": [{"w": "The", "b": [0.1294, 0.5501, 0.1686, 0.5698]}, {"w": "following", "b": [0.1749, 0.5501, 0.273, 0.5698]}, {"w": "listing", "b": [0.2794, 0.5501, 0.3424, 0.5698]}, {"w": "shows", "b": [0.3487, 0.5501, 0.4118, 0.5698]}, {"w": "the", "b": [0.4181, 0.5501, 0.4489, 0.5698]}, {"w": "decoder", "b": [0.4553, 0.5501, 0.5351, 0.5698]}, {"w": "implementation.", "b": [0.5414, 0.5501, 0.7061, 0.5698]}, {"w": "You", "b": [0.7124, 0.5501, 0.7532, 0.5698]}, {"w": "reshape", "b": [0.7595, 0.5501, 0.8366, 0.5698]}, {"w": "the", "b": [0.1294, 0.5706, 0.1602, 0.5903]}, {"w": "vector", "b": [0.1665, 0.5706, 0.2296, 0.5903]}, {"w": "z", "b": [0.2359, 0.5716, 0.251, 0.5918]}, {"w": "to", "b": [0.2573, 0.5706, 0.2769, 0.5903]}, {"w": "the", "b": [0.2832, 0.5706, 0.3141, 0.5903]}, {"w": "dimensions", "b": [0.3204, 0.5706, 0.4353, 0.5903]}, {"w": "of", "b": [0.4416, 0.5706, 0.4626, 0.5903]}, {"w": "an", "b": [0.4689, 0.5706, 0.4927, 0.5903]}, {"w": "image", "b": [0.499, 0.5706, 0.5607, 0.5903]}, {"w": "and", "b": [0.567, 0.5706, 0.6034, 0.5903]}, {"w": "then", "b": [0.6097, 0.5706, 0.6532, 0.5903]}, {"w": "use", "b": [0.6595, 0.5706, 0.6931, 0.5903]}, {"w": "a", "b": [0.6994, 0.5706, 0.7106, 0.5903]}, {"w": "few", "b": [0.7169, 0.5706, 0.7547, 0.5903]}, {"w": "convolution", "b": [0.1294, 0.5919, 0.2499, 0.6117]}, {"w": "layers", "b": [0.2562, 0.5919, 0.3165, 0.6117]}, {"w": "to", "b": [0.3228, 0.5919, 0.3424, 0.6117]}, {"w": "obtain", "b": [0.3487, 0.5919, 0.4118, 0.6117]}, {"w": "a", "b": [0.4181, 0.5919, 0.4293, 0.6117]}, {"w": "final", "b": [0.4356, 0.5919, 0.4818, 0.6117]}, {"w": "image", "b": [0.4881, 0.5919, 0.5498, 0.6117]}, {"w": "output", "b": [0.5561, 0.5919, 0.6206, 0.6117]}, {"w": "that", "b": [0.6269, 0.5919, 0.6647, 0.6117]}, {"w": "has", "b": [0.671, 0.5919, 0.7047, 0.6117]}, {"w": "the", "b": [0.711, 0.5919, 0.7418, 0.6117]}, {"w": "same", "b": [0.7481, 0.5919, 0.7999, 0.6117]}, {"w": "dimensions", "b": [0.1294, 0.6124, 0.2443, 0.6322]}, {"w": "as", "b": [0.2506, 0.6124, 0.2716, 0.6322]}, {"w": "the", "b": [0.278, 0.6124, 0.3088, 0.6322]}, {"w": "original", "b": [0.3151, 0.6124, 0.3936, 0.6322]}, {"w": "input_img.", "b": [0.3998, 0.6124, 0.5424, 0.6337]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 8.25. VAE decoder network, mapping latent space points to images", "words": [{"w": "Listing", "b": [0.1294, 0.6512, 0.1862, 0.666]}, {"w": "8.25.", "b": [0.1909, 0.6512, 0.2288, 0.666]}, {"w": "VAE", "b": [0.2335, 0.6512, 0.271, 0.666]}, {"w": "decoder", "b": [0.2757, 0.6512, 0.3398, 0.666]}, {"w": "network,", "b": [0.3445, 0.6512, 0.4165, 0.666]}, {"w": "mapping", "b": [0.4212, 0.6512, 0.4927, 0.666]}, {"w": "latent", "b": [0.4975, 0.6512, 0.5437, 0.666]}, {"w": "space", "b": [0.5484, 0.6512, 0.5926, 0.666]}, {"w": "points", "b": [0.5973, 0.6512, 0.6467, 0.666]}, {"w": "to", "b": [0.6515, 0.6512, 0.6672, 0.666]}, {"w": "images", "b": [0.6719, 0.6512, 0.7276, 0.666]}]}, {"id": "b_7", "type": "paragraph", "text": "decoder_input = layers.Input(K.int_shape(z)[1:]) 1 x = layers.Dense(np.prod(shape_before_flattening[1:]), 2 activation='relu')(decoder_input) 2 x = layers.Reshape(shape_before_flattening[1:])(x) 3 x = layers.Conv2DTranspose(32, 3, 4 padding='same', 4 activation='relu',", "words": [{"w": "decoder_input", "b": [0.1357, 0.6796, 0.2833, 0.6947]}, {"w": "=", "b": [0.2946, 0.6796, 0.306, 0.6947]}, {"w": "layers.Input(K.int_shape(z)[1:])", "b": [0.3173, 0.6796, 0.6806, 0.6947]}, {"w": "1", "b": [0.1357, 0.6947, 0.1471, 0.7099]}, {"w": "x", "b": [0.1357, 0.725, 0.1471, 0.7402]}, {"w": "=", "b": [0.1584, 0.725, 0.1698, 0.7402]}, {"w": "layers.Dense(np.prod(shape_before_flattening[1:]),", "b": [0.1811, 0.725, 0.7487, 0.7402]}, {"w": "2", "b": [0.1357, 0.7402, 0.1471, 0.7553]}, {"w": "activation='relu')(decoder_input)", "b": [0.3287, 0.7554, 0.7033, 0.7705]}, {"w": "2", "b": [0.1357, 0.7705, 0.1471, 0.7856]}, {"w": "x", "b": [0.1357, 0.8008, 0.1471, 0.816]}, {"w": "=", "b": [0.1584, 0.8008, 0.1698, 0.816]}, {"w": "layers.Reshape(shape_before_flattening[1:])(x)", "b": [0.1811, 0.8008, 0.7033, 0.816]}, {"w": "3", "b": [0.1357, 0.816, 0.1471, 0.8311]}, {"w": "x", "b": [0.1357, 0.8311, 0.1471, 0.8463]}, {"w": "=", "b": [0.1584, 0.8311, 0.1698, 0.8463]}, {"w": "layers.Conv2DTranspose(32,", "b": [0.1811, 0.8311, 0.4763, 0.8463]}, {"w": "3,", "b": [0.4876, 0.8311, 0.5103, 0.8463]}, {"w": "4", "b": [0.1357, 0.8463, 0.1471, 0.8614]}, {"w": "padding='same',", "b": [0.4422, 0.8614, 0.6125, 0.8766]}, {"w": "4", "b": [0.1357, 0.8766, 0.1471, 0.8917]}, {"w": "activation='relu',", "b": [0.4422, 0.8917, 0.6465, 0.9069]}]}]}, {"page": 395, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4 strides=(2, 2))(x) 4 x = layers.Conv2D(1, 3, 4 padding='same', 4 activation='sigmoid')(x) 4 decoder = Model(decoder_input, x) 5 z_decoded = decoder(z) 6", "words": [{"w": "4", "b": [0.1357, 0.0851, 0.1471, 0.1002]}, {"w": "strides=(2,", "b": [0.4422, 0.1002, 0.5671, 0.1154]}, {"w": "2))(x)", "b": [0.5784, 0.1002, 0.6465, 0.1154]}, {"w": "4", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "x", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "=", "b": [0.1584, 0.1305, 0.1698, 0.1457]}, {"w": "layers.Conv2D(1,", "b": [0.1811, 0.1305, 0.3628, 0.1457]}, {"w": "3,", "b": [0.3741, 0.1305, 0.3968, 0.1457]}, {"w": "4", "b": [0.1357, 0.1457, 0.1471, 0.1608]}, {"w": "padding='same',", "b": [0.34, 0.1608, 0.5103, 0.176]}, {"w": "4", "b": [0.1357, 0.176, 0.1471, 0.1911]}, {"w": "activation='sigmoid')(x)", "b": [0.34, 0.1911, 0.6125, 0.2063]}, {"w": "4", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "decoder", "b": [0.1357, 0.2366, 0.2152, 0.2518]}, {"w": "=", "b": [0.2265, 0.2366, 0.2379, 0.2518]}, {"w": "Model(decoder_input,", "b": [0.2492, 0.2366, 0.4763, 0.2518]}, {"w": "x)", "b": [0.4876, 0.2366, 0.5103, 0.2518]}, {"w": "5", "b": [0.1357, 0.2518, 0.1471, 0.2669]}, {"w": "z_decoded", "b": [0.1357, 0.2821, 0.2379, 0.2972]}, {"w": "=", "b": [0.2492, 0.2821, 0.2606, 0.2972]}, {"w": "decoder(z)", "b": [0.2719, 0.2821, 0.3855, 0.2972]}, {"w": "6", "b": [0.1357, 0.2972, 0.1471, 0.3124]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Input where you’ll feed z 2 Upsamples the input 3 Reshapes z into a feature map of the same shape as the feature map just before the last Flatten layer in the encoder model 4 Uses a Conv2DTranspose layer and Conv2D layer to decode z into a feature map the same size as the original image input 5 Instantiates the decoder model, which turns “decoder_input” into the decoded image 6 Applies it to z to recover the decoded z", "words": [{"w": "1", "b": [0.1799, 0.3308, 0.1925, 0.3505]}, {"w": "Input", "b": [0.1988, 0.3308, 0.2591, 0.3505]}, {"w": "where", "b": [0.2654, 0.3308, 0.3308, 0.3505]}, {"w": "you’ll", "b": [0.3371, 0.3308, 0.3988, 0.3505]}, {"w": "feed", "b": [0.4051, 0.3308, 0.4499, 0.3505]}, {"w": "z", "b": [0.4562, 0.3308, 0.4674, 0.3505]}, {"w": "2", "b": [0.1799, 0.3513, 0.1925, 0.371]}, {"w": "Upsamples", "b": [0.1988, 0.3513, 0.3165, 0.371]}, {"w": "the", "b": [0.3228, 0.3513, 0.3564, 0.371]}, {"w": "input", "b": [0.3628, 0.3513, 0.4202, 0.371]}, {"w": "3", "b": [0.1799, 0.3718, 0.1925, 0.3915]}, {"w": "Reshapes", "b": [0.1988, 0.3718, 0.2997, 0.3915]}, {"w": "z", "b": [0.306, 0.3718, 0.3172, 0.3915]}, {"w": "into", "b": [0.3235, 0.3718, 0.3656, 0.3915]}, {"w": "a", "b": [0.3719, 0.3718, 0.3845, 0.3915]}, {"w": "feature", "b": [0.3908, 0.3718, 0.4674, 0.3915]}, {"w": "map", "b": [0.4737, 0.3718, 0.5213, 0.3915]}, {"w": "of", "b": [0.5276, 0.3718, 0.5486, 0.3915]}, {"w": "the", "b": [0.5549, 0.3718, 0.5886, 0.3915]}, {"w": "same", "b": [0.5949, 0.3718, 0.6495, 0.3915]}, {"w": "shape", "b": [0.6558, 0.3718, 0.7175, 0.3915]}, {"w": "as", "b": [0.7238, 0.3718, 0.7462, 0.3915]}, {"w": "the", "b": [0.7525, 0.3718, 0.7862, 0.3915]}, {"w": "feature", "b": [0.7925, 0.3718, 0.8691, 0.3915]}, {"w": "map", "b": [0.1799, 0.3923, 0.2275, 0.412]}, {"w": "just", "b": [0.2338, 0.3923, 0.2745, 0.412]}, {"w": "before", "b": [0.2808, 0.3923, 0.349, 0.412]}, {"w": "the", "b": [0.3553, 0.3923, 0.3889, 0.412]}, {"w": "last", "b": [0.3952, 0.3923, 0.433, 0.412]}, {"w": "Flatten", "b": [0.4393, 0.3923, 0.5164, 0.412]}, {"w": "layer", "b": [0.5227, 0.3923, 0.5774, 0.412]}, {"w": "in", "b": [0.5837, 0.3923, 0.6047, 0.412]}, {"w": "the", "b": [0.611, 0.3923, 0.6446, 0.412]}, {"w": "encoder", "b": [0.6509, 0.3923, 0.7364, 0.412]}, {"w": "model", "b": [0.7427, 0.3923, 0.8086, 0.412]}, {"w": "4", "b": [0.1799, 0.4128, 0.1925, 0.4325]}, {"w": "Uses", "b": [0.1988, 0.4128, 0.2478, 0.4325]}, {"w": "a", "b": [0.2541, 0.4128, 0.2667, 0.4325]}, {"w": "Conv2DTranspose", "b": [0.273, 0.4128, 0.4716, 0.4325]}, {"w": "layer", "b": [0.4779, 0.4128, 0.5326, 0.4325]}, {"w": "and", "b": [0.5389, 0.4128, 0.5795, 0.4325]}, {"w": "Conv2D", "b": [0.5858, 0.4128, 0.6741, 0.4325]}, {"w": "layer", "b": [0.6804, 0.4128, 0.7351, 0.4325]}, {"w": "to", "b": [0.7414, 0.4128, 0.7624, 0.4325]}, {"w": "decode", "b": [0.7687, 0.4128, 0.843, 0.4325]}, {"w": "z", "b": [0.8493, 0.4128, 0.8605, 0.4325]}, {"w": "into", "b": [0.1799, 0.4333, 0.2219, 0.453]}, {"w": "a", "b": [0.2282, 0.4333, 0.2408, 0.453]}, {"w": "feature", "b": [0.2471, 0.4333, 0.3237, 0.453]}, {"w": "map", "b": [0.33, 0.4333, 0.3777, 0.453]}, {"w": "the", "b": [0.384, 0.4333, 0.4176, 0.453]}, {"w": "same", "b": [0.4239, 0.4333, 0.4786, 0.453]}, {"w": "size", "b": [0.4849, 0.4333, 0.5241, 0.453]}, {"w": "as", "b": [0.5304, 0.4333, 0.5528, 0.453]}, {"w": "the", "b": [0.5591, 0.4333, 0.5928, 0.453]}, {"w": "original", "b": [0.5991, 0.4333, 0.6832, 0.453]}, {"w": "image", "b": [0.6895, 0.4333, 0.7539, 0.453]}, {"w": "input", "b": [0.7602, 0.4333, 0.8177, 0.453]}, {"w": "5", "b": [0.1799, 0.4538, 0.1925, 0.4735]}, {"w": "Instantiates", "b": [0.1988, 0.4538, 0.3249, 0.4735]}, {"w": "the", "b": [0.3312, 0.4538, 0.3648, 0.4735]}, {"w": "decoder", "b": [0.3712, 0.4538, 0.4566, 0.4735]}, {"w": "model,", "b": [0.4629, 0.4538, 0.5351, 0.4735]}, {"w": "which", "b": [0.5414, 0.4538, 0.6059, 0.4735]}, {"w": "turns", "b": [0.6122, 0.4538, 0.6696, 0.4735]}, {"w": "“decoder_input”", "b": [0.676, 0.4538, 0.8567, 0.4735]}, {"w": "into", "b": [0.1799, 0.4743, 0.2219, 0.494]}, {"w": "the", "b": [0.2282, 0.4743, 0.2618, 0.494]}, {"w": "decoded", "b": [0.2682, 0.4743, 0.3564, 0.494]}, {"w": "image", "b": [0.3628, 0.4743, 0.4272, 0.494]}, {"w": "6", "b": [0.1799, 0.4948, 0.1925, 0.5145]}, {"w": "Applies", "b": [0.1988, 0.4948, 0.2801, 0.5145]}, {"w": "it", "b": [0.2864, 0.4948, 0.3018, 0.5145]}, {"w": "to", "b": [0.3081, 0.4948, 0.3291, 0.5145]}, {"w": "z", "b": [0.3354, 0.4948, 0.3466, 0.5145]}, {"w": "to", "b": [0.3529, 0.4948, 0.374, 0.5145]}, {"w": "recover", "b": [0.3803, 0.4948, 0.461, 0.5145]}, {"w": "the", "b": [0.4673, 0.4948, 0.501, 0.5145]}, {"w": "decoded", "b": [0.5073, 0.4948, 0.5955, 0.5145]}, {"w": "z", "b": [0.6019, 0.4948, 0.6131, 0.5145]}]}, {"id": "b_2", "type": "paragraph", "text": "The dual loss of a VAE doesn’t fit the traditional expectation of a sample-wise function of the form loss(input, target). Thus, you’ll set up the loss by writing a custom layer that internally uses the built-in add_loss layer method to create an arbitrary loss.", "words": [{"w": "The", "b": [0.1294, 0.5376, 0.1686, 0.5573]}, {"w": "dual", "b": [0.1749, 0.5376, 0.2184, 0.5573]}, {"w": "loss", "b": [0.2247, 0.5376, 0.2639, 0.5573]}, {"w": "of", "b": [0.2702, 0.5376, 0.2913, 0.5573]}, {"w": "a", "b": [0.2976, 0.5376, 0.3088, 0.5573]}, {"w": "VAE", "b": [0.3151, 0.5376, 0.3636, 0.5573]}, {"w": "doesn’t", "b": [0.37, 0.5376, 0.4438, 0.5573]}, {"w": "fit", "b": [0.4501, 0.5376, 0.4725, 0.5573]}, {"w": "the", "b": [0.4788, 0.5376, 0.5096, 0.5573]}, {"w": "traditional", "b": [0.5159, 0.5376, 0.6196, 0.5573]}, {"w": "expectation", "b": [0.6259, 0.5376, 0.7422, 0.5573]}, {"w": "of", "b": [0.7485, 0.5376, 0.7696, 0.5573]}, {"w": "a", "b": [0.7759, 0.5376, 0.7871, 0.5573]}, {"w": "sample-wise", "b": [0.1294, 0.5581, 0.2555, 0.5778]}, {"w": "function", "b": [0.2618, 0.5581, 0.3459, 0.5778]}, {"w": "of", "b": [0.3522, 0.5581, 0.3732, 0.5778]}, {"w": "the", "b": [0.3795, 0.5581, 0.4104, 0.5778]}, {"w": "form", "b": [0.4167, 0.5581, 0.4657, 0.5778]}, {"w": "loss(input,", "b": [0.472, 0.5591, 0.6384, 0.5793]}, {"w": "target).", "b": [0.6536, 0.5581, 0.7659, 0.5793]}, {"w": "Thus,", "b": [0.7722, 0.5581, 0.8289, 0.5778]}, {"w": "you’ll", "b": [0.1294, 0.5795, 0.1897, 0.5992]}, {"w": "set", "b": [0.196, 0.5795, 0.224, 0.5992]}, {"w": "up", "b": [0.2303, 0.5795, 0.2555, 0.5992]}, {"w": "the", "b": [0.2618, 0.5795, 0.2927, 0.5992]}, {"w": "loss", "b": [0.299, 0.5795, 0.3382, 0.5992]}, {"w": "by", "b": [0.3445, 0.5795, 0.3698, 0.5992]}, {"w": "writing", "b": [0.3761, 0.5795, 0.4489, 0.5992]}, {"w": "a", "b": [0.4553, 0.5795, 0.4665, 0.5992]}, {"w": "custom", "b": [0.4728, 0.5795, 0.5456, 0.5992]}, {"w": "layer", "b": [0.5519, 0.5795, 0.6024, 0.5992]}, {"w": "that", "b": [0.6087, 0.5795, 0.6465, 0.5992]}, {"w": "internally", "b": [0.6528, 0.5795, 0.7495, 0.5992]}, {"w": "uses", "b": [0.7558, 0.5795, 0.7993, 0.5992]}, {"w": "the", "b": [0.8056, 0.5795, 0.8364, 0.5992]}, {"w": "built-in", "b": [0.1294, 0.6, 0.2037, 0.6197]}, {"w": "add_loss", "b": [0.21, 0.601, 0.3311, 0.6212]}, {"w": "layer", "b": [0.3374, 0.6, 0.3878, 0.6197]}, {"w": "method", "b": [0.3941, 0.6, 0.4698, 0.6197]}, {"w": "to", "b": [0.4761, 0.6, 0.4957, 0.6197]}, {"w": "create", "b": [0.502, 0.6, 0.5622, 0.6197]}, {"w": "an", "b": [0.5686, 0.6, 0.5924, 0.6197]}, {"w": "arbitrary", "b": [0.5987, 0.6, 0.6855, 0.6197]}, {"w": "loss.", "b": [0.6918, 0.6, 0.7374, 0.6197]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 8.26. Custom layer used to compute the VAE loss", "words": [{"w": "Listing", "b": [0.1294, 0.6387, 0.1862, 0.6535]}, {"w": "8.26.", "b": [0.1909, 0.6387, 0.2288, 0.6535]}, {"w": "Custom", "b": [0.2335, 0.6387, 0.2965, 0.6535]}, {"w": "layer", "b": [0.3013, 0.6387, 0.3422, 0.6535]}, {"w": "used", "b": [0.347, 0.6387, 0.3838, 0.6535]}, {"w": "to", "b": [0.3885, 0.6387, 0.4043, 0.6535]}, {"w": "compute", "b": [0.409, 0.6387, 0.4783, 0.6535]}, {"w": "the", "b": [0.4831, 0.6387, 0.5083, 0.6535]}, {"w": "VAE", "b": [0.513, 0.6387, 0.5505, 0.6535]}, {"w": "loss", "b": [0.5553, 0.6387, 0.5847, 0.6535]}]}, {"id": "b_4", "type": "paragraph", "text": "class CustomVariationalLayer(keras.layers.Layer): def vae_loss(self, x, z_decoded): x = K.flatten(x) z_decoded = K.flatten(z_decoded) xent_loss = keras.metrics.binary_crossentropy(x, z_decoded) kl_loss = -5e-4 * K.mean( 1 + z_log_var - K.square(z_mean) - K.exp(z_log_var), axis=-1) return K.mean(xent_loss + kl_loss) def call(self, inputs): 1 x = inputs[0] z_decoded = inputs[1] loss = self.vae_loss(x, z_decoded)", "words": [{"w": "class", "b": [0.1357, 0.6671, 0.1925, 0.6823]}, {"w": "CustomVariationalLayer(keras.layers.Layer):", "b": [0.2038, 0.6671, 0.6919, 0.6823]}, {"w": "def", "b": [0.1811, 0.6974, 0.2152, 0.7126]}, {"w": "vae_loss(self,", "b": [0.2265, 0.6974, 0.3855, 0.7126]}, {"w": "x,", "b": [0.3968, 0.6974, 0.4195, 0.7126]}, {"w": "z_decoded):", "b": [0.4309, 0.6974, 0.5557, 0.7126]}, {"w": "x", "b": [0.2265, 0.7126, 0.2379, 0.7277]}, {"w": "=", "b": [0.2492, 0.7126, 0.2606, 0.7277]}, {"w": "K.flatten(x)", "b": [0.2719, 0.7126, 0.4082, 0.7277]}, {"w": "z_decoded", "b": [0.2265, 0.7277, 0.3287, 0.7429]}, {"w": "=", "b": [0.34, 0.7277, 0.3514, 0.7429]}, {"w": "K.flatten(z_decoded)", "b": [0.3628, 0.7277, 0.5898, 0.7429]}, {"w": "xent_loss", "b": [0.2265, 0.7429, 0.3287, 0.758]}, {"w": "=", "b": [0.34, 0.7429, 0.3514, 0.758]}, {"w": "keras.metrics.binary_crossentropy(x,", "b": [0.3628, 0.7429, 0.7714, 0.758]}, {"w": "z_decoded)", "b": [0.1357, 0.758, 0.2492, 0.7732]}, {"w": "kl_loss", "b": [0.2265, 0.7732, 0.306, 0.7883]}, {"w": "=", "b": [0.3173, 0.7732, 0.3287, 0.7883]}, {"w": "-5e-4", "b": [0.34, 0.7732, 0.3968, 0.7883]}, {"w": "*", "b": [0.4082, 0.7732, 0.4195, 0.7883]}, {"w": "K.mean(", "b": [0.4309, 0.7732, 0.5103, 0.7883]}, {"w": "1", "b": [0.2719, 0.7883, 0.2833, 0.8035]}, {"w": "+", "b": [0.2946, 0.7883, 0.306, 0.8035]}, {"w": "z_log_var", "b": [0.3173, 0.7883, 0.4195, 0.8035]}, {"w": "-", "b": [0.4309, 0.7883, 0.4422, 0.8035]}, {"w": "K.square(z_mean)", "b": [0.4536, 0.7883, 0.6352, 0.8035]}, {"w": "-", "b": [0.6465, 0.7883, 0.6579, 0.8035]}, {"w": "K.exp(z_log_var),", "b": [0.6692, 0.7883, 0.8622, 0.8035]}, {"w": "axis=-1)", "b": [0.1357, 0.8035, 0.2265, 0.8186]}, {"w": "return", "b": [0.2265, 0.8186, 0.2946, 0.8338]}, {"w": "K.mean(xent_loss", "b": [0.306, 0.8186, 0.4876, 0.8338]}, {"w": "+", "b": [0.499, 0.8186, 0.5103, 0.8338]}, {"w": "kl_loss)", "b": [0.5217, 0.8186, 0.6125, 0.8338]}, {"w": "def", "b": [0.1811, 0.8489, 0.2152, 0.8641]}, {"w": "call(self,", "b": [0.2265, 0.8489, 0.34, 0.8641]}, {"w": "inputs):", "b": [0.3514, 0.8489, 0.4422, 0.8641]}, {"w": "1", "b": [0.7942, 0.8489, 0.8056, 0.8641]}, {"w": "x", "b": [0.2265, 0.8641, 0.2379, 0.8792]}, {"w": "=", "b": [0.2492, 0.8641, 0.2606, 0.8792]}, {"w": "inputs[0]", "b": [0.2719, 0.8641, 0.3741, 0.8792]}, {"w": "z_decoded", "b": [0.2265, 0.8792, 0.3287, 0.8944]}, {"w": "=", "b": [0.34, 0.8792, 0.3514, 0.8944]}, {"w": "inputs[1]", "b": [0.3628, 0.8792, 0.4649, 0.8944]}, {"w": "loss", "b": [0.2265, 0.8944, 0.2719, 0.9095]}, {"w": "=", "b": [0.2833, 0.8944, 0.2946, 0.9095]}, {"w": "self.vae_loss(x,", "b": [0.306, 0.8944, 0.4876, 0.9095]}, {"w": "z_decoded)", "b": [0.499, 0.8944, 0.6125, 0.9095]}]}]}, {"page": 396, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "self.add_loss(loss, inputs=inputs) return x 2 y = CustomVariationalLayer()([input_img, z_decoded]) 3", "words": [{"w": "self.add_loss(loss,", "b": [0.2265, 0.0851, 0.4422, 0.1002]}, {"w": "inputs=inputs)", "b": [0.4536, 0.0851, 0.6125, 0.1002]}, {"w": "return", "b": [0.2265, 0.1002, 0.2946, 0.1154]}, {"w": "x", "b": [0.306, 0.1002, 0.3173, 0.1154]}, {"w": "2", "b": [0.7942, 0.1002, 0.8056, 0.1154]}, {"w": "y", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "=", "b": [0.1584, 0.1305, 0.1698, 0.1457]}, {"w": "CustomVariationalLayer()([input_img,", "b": [0.1811, 0.1305, 0.5898, 0.1457]}, {"w": "z_decoded])", "b": [0.6011, 0.1305, 0.726, 0.1457]}, {"w": "3", "b": [0.7942, 0.1305, 0.8056, 0.1457]}]}, {"id": "b_1", "type": "paragraph", "text": "1 You implement custom layers by writing a call method. 2 You don't use this output, but the layer must return something. 3 Calls the custom layer on the input and the decoded output to obtain the final model output", "words": [{"w": "1", "b": [0.1799, 0.1641, 0.1925, 0.1839]}, {"w": "You", "b": [0.1988, 0.1641, 0.2408, 0.1839]}, {"w": "implement", "b": [0.2471, 0.1641, 0.3621, 0.1839]}, {"w": "custom", "b": [0.3684, 0.1641, 0.4454, 0.1839]}, {"w": "layers", "b": [0.4517, 0.1641, 0.5162, 0.1839]}, {"w": "by", "b": [0.5225, 0.1641, 0.5491, 0.1839]}, {"w": "writing", "b": [0.5554, 0.1641, 0.6339, 0.1839]}, {"w": "a", "b": [0.6402, 0.1641, 0.6528, 0.1839]}, {"w": "call", "b": [0.6591, 0.1641, 0.697, 0.1839]}, {"w": "method.", "b": [0.7033, 0.1641, 0.7909, 0.1839]}, {"w": "2", "b": [0.1799, 0.1846, 0.1925, 0.2044]}, {"w": "You", "b": [0.1988, 0.1846, 0.2408, 0.2044]}, {"w": "don't", "b": [0.2471, 0.1846, 0.3032, 0.2044]}, {"w": "use", "b": [0.3095, 0.1846, 0.3446, 0.2044]}, {"w": "this", "b": [0.3509, 0.1846, 0.3901, 0.2044]}, {"w": "output,", "b": [0.3964, 0.1846, 0.4742, 0.2044]}, {"w": "but", "b": [0.4805, 0.1846, 0.517, 0.2044]}, {"w": "the", "b": [0.5233, 0.1846, 0.5569, 0.2044]}, {"w": "layer", "b": [0.5632, 0.1846, 0.6179, 0.2044]}, {"w": "must", "b": [0.6242, 0.1846, 0.6774, 0.2044]}, {"w": "return", "b": [0.6837, 0.1846, 0.7534, 0.2044]}, {"w": "something.", "b": [0.1799, 0.2051, 0.2969, 0.2249]}, {"w": "3", "b": [0.1799, 0.2256, 0.1925, 0.2454]}, {"w": "Calls", "b": [0.1988, 0.2256, 0.2534, 0.2454]}, {"w": "the", "b": [0.2598, 0.2256, 0.2934, 0.2454]}, {"w": "custom", "b": [0.2997, 0.2256, 0.3768, 0.2454]}, {"w": "layer", "b": [0.3831, 0.2256, 0.4377, 0.2454]}, {"w": "on", "b": [0.444, 0.2256, 0.4706, 0.2454]}, {"w": "the", "b": [0.4769, 0.2256, 0.5106, 0.2454]}, {"w": "input", "b": [0.5169, 0.2256, 0.5744, 0.2454]}, {"w": "and", "b": [0.5807, 0.2256, 0.6213, 0.2454]}, {"w": "the", "b": [0.6276, 0.2256, 0.6613, 0.2454]}, {"w": "decoded", "b": [0.6676, 0.2256, 0.7559, 0.2454]}, {"w": "output", "b": [0.7622, 0.2256, 0.8337, 0.2454]}, {"w": "to", "b": [0.84, 0.2256, 0.861, 0.2454]}, {"w": "obtain", "b": [0.1799, 0.2461, 0.2486, 0.2659]}, {"w": "the", "b": [0.2549, 0.2461, 0.2885, 0.2659]}, {"w": "final", "b": [0.2948, 0.2461, 0.3439, 0.2659]}, {"w": "model", "b": [0.3502, 0.2461, 0.416, 0.2659]}, {"w": "output", "b": [0.4223, 0.2461, 0.4938, 0.2659]}]}, {"id": "b_2", "type": "paragraph", "text": "Finally, you’re ready to instantiate and train the model. Because the loss is taken care of in the custom layer, you don’t specify an external loss at compile time (loss=None), which in turn means you won’t pass target data during training (as you can see, you only pass x_train to the model in fit).", "words": [{"w": "Finally,", "b": [0.1294, 0.2889, 0.2056, 0.3086]}, {"w": "you’re", "b": [0.2119, 0.2889, 0.2777, 0.3086]}, {"w": "ready", "b": [0.284, 0.2889, 0.34, 0.3086]}, {"w": "to", "b": [0.3463, 0.2889, 0.366, 0.3086]}, {"w": "instantiate", "b": [0.3723, 0.2889, 0.476, 0.3086]}, {"w": "and", "b": [0.4823, 0.2889, 0.5187, 0.3086]}, {"w": "train", "b": [0.525, 0.2889, 0.5713, 0.3086]}, {"w": "the", "b": [0.5776, 0.2889, 0.6084, 0.3086]}, {"w": "model.", "b": [0.6147, 0.2889, 0.6841, 0.3086]}, {"w": "Because", "b": [0.6904, 0.2889, 0.7744, 0.3086]}, {"w": "the", "b": [0.7807, 0.2889, 0.8116, 0.3086]}, {"w": "loss", "b": [0.8179, 0.2889, 0.8571, 0.3086]}, {"w": "is", "b": [0.1294, 0.3094, 0.1462, 0.3291]}, {"w": "taken", "b": [0.1525, 0.3094, 0.2072, 0.3291]}, {"w": "care", "b": [0.2135, 0.3094, 0.2555, 0.3291]}, {"w": "of", "b": [0.2618, 0.3094, 0.2828, 0.3291]}, {"w": "in", "b": [0.2891, 0.3094, 0.3087, 0.3291]}, {"w": "the", "b": [0.315, 0.3094, 0.3459, 0.3291]}, {"w": "custom", "b": [0.3522, 0.3094, 0.4251, 0.3291]}, {"w": "layer,", "b": [0.4314, 0.3094, 0.487, 0.3291]}, {"w": "you", "b": [0.4933, 0.3094, 0.5312, 0.3291]}, {"w": "don’t", "b": [0.5375, 0.3094, 0.5903, 0.3291]}, {"w": "specify", "b": [0.5966, 0.3094, 0.6694, 0.3291]}, {"w": "an", "b": [0.6757, 0.3094, 0.6996, 0.3291]}, {"w": "external", "b": [0.7059, 0.3094, 0.7871, 0.3291]}, {"w": "loss", "b": [0.7934, 0.3094, 0.8327, 0.3291]}, {"w": "at", "b": [0.839, 0.3094, 0.8572, 0.3291]}, {"w": "compile", "b": [0.1294, 0.3299, 0.2107, 0.3496]}, {"w": "time", "b": [0.217, 0.3299, 0.2618, 0.3496]}, {"w": "(loss=None),", "b": [0.2682, 0.3299, 0.4275, 0.3511]}, {"w": "which", "b": [0.4338, 0.3299, 0.4954, 0.3496]}, {"w": "in", "b": [0.5017, 0.3299, 0.5213, 0.3496]}, {"w": "turn", "b": [0.5276, 0.3299, 0.5683, 0.3496]}, {"w": "means", "b": [0.5746, 0.3299, 0.639, 0.3496]}, {"w": "you", "b": [0.6454, 0.3299, 0.6832, 0.3496]}, {"w": "won’t", "b": [0.6895, 0.3299, 0.7479, 0.3496]}, {"w": "pass", "b": [0.7542, 0.3299, 0.7976, 0.3496]}, {"w": "target", "b": [0.8039, 0.3299, 0.8609, 0.3496]}, {"w": "data", "b": [0.1294, 0.3513, 0.1714, 0.371]}, {"w": "during", "b": [0.1777, 0.3513, 0.2436, 0.371]}, {"w": "training", "b": [0.2499, 0.3513, 0.3284, 0.371]}, {"w": "(as", "b": [0.3347, 0.3513, 0.3641, 0.371]}, {"w": "you", "b": [0.3704, 0.3513, 0.4083, 0.371]}, {"w": "can", "b": [0.4146, 0.3513, 0.4496, 0.371]}, {"w": "see,", "b": [0.4559, 0.3513, 0.4944, 0.371]}, {"w": "you", "b": [0.5007, 0.3513, 0.5385, 0.371]}, {"w": "only", "b": [0.5449, 0.3513, 0.5897, 0.371]}, {"w": "pass", "b": [0.596, 0.3513, 0.6395, 0.371]}, {"w": "x_train", "b": [0.6457, 0.3523, 0.7517, 0.3725]}, {"w": "to", "b": [0.758, 0.3513, 0.7776, 0.371]}, {"w": "the", "b": [0.7839, 0.3513, 0.8147, 0.371]}, {"w": "model", "b": [0.1294, 0.3727, 0.1925, 0.3924]}, {"w": "in", "b": [0.1988, 0.3727, 0.2184, 0.3924]}, {"w": "fit).", "b": [0.2247, 0.3727, 0.2848, 0.3939]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 8.27. Training the VAE", "words": [{"w": "Listing", "b": [0.1294, 0.4114, 0.1862, 0.4262]}, {"w": "8.27.", "b": [0.1909, 0.4114, 0.2288, 0.4262]}, {"w": "Training", "b": [0.2335, 0.4114, 0.3036, 0.4262]}, {"w": "the", "b": [0.3083, 0.4114, 0.3335, 0.4262]}, {"w": "VAE", "b": [0.3382, 0.4114, 0.3757, 0.4262]}]}, {"id": "b_4", "type": "paragraph", "text": "from keras.datasets import mnist vae = Model(input_img, y) vae.compile(optimizer='rmsprop', loss=None) vae.summary() (x_train, _), (x_test, y_test) = mnist.load_data() x_train = x_train.astype('float32') / 255. x_train = x_train.reshape(x_train.shape + (1,)) x_test = x_test.astype('float32') / 255. x_test = x_test.reshape(x_test.shape + (1,)) vae.fit(x=x_train, y=None, shuffle=True, epochs=10, batch_size=batch_size, validation_data=(x_test, None))", "words": [{"w": "from", "b": [0.1357, 0.4398, 0.1811, 0.455]}, {"w": "keras.datasets", "b": [0.1925, 0.4398, 0.3514, 0.455]}, {"w": "import", "b": [0.3628, 0.4398, 0.4309, 0.455]}, {"w": "mnist", "b": [0.4422, 0.4398, 0.499, 0.455]}, {"w": "vae", "b": [0.1357, 0.4701, 0.1698, 0.4853]}, {"w": "=", "b": [0.1811, 0.4701, 0.1925, 0.4853]}, {"w": "Model(input_img,", "b": [0.2038, 0.4701, 0.3855, 0.4853]}, {"w": "y)", "b": [0.3968, 0.4701, 0.4195, 0.4853]}, {"w": "vae.compile(optimizer='rmsprop',", "b": [0.1357, 0.4853, 0.499, 0.5004]}, {"w": "loss=None)", "b": [0.5103, 0.4853, 0.6238, 0.5004]}, {"w": "vae.summary()", "b": [0.1357, 0.5004, 0.2833, 0.5156]}, {"w": "(x_train,", "b": [0.1357, 0.5307, 0.2379, 0.5459]}, {"w": "_),", "b": [0.2492, 0.5307, 0.2833, 0.5459]}, {"w": "(x_test,", "b": [0.2946, 0.5307, 0.3855, 0.5459]}, {"w": "y_test)", "b": [0.3968, 0.5307, 0.4763, 0.5459]}, {"w": "=", "b": [0.4876, 0.5307, 0.499, 0.5459]}, {"w": "mnist.load_data()", "b": [0.5103, 0.5307, 0.7033, 0.5459]}, {"w": "x_train", "b": [0.1357, 0.561, 0.2152, 0.5762]}, {"w": "=", "b": [0.2265, 0.561, 0.2379, 0.5762]}, {"w": "x_train.astype('float32')", "b": [0.2492, 0.561, 0.533, 0.5762]}, {"w": "/", "b": [0.5444, 0.561, 0.5557, 0.5762]}, {"w": "255.", "b": [0.5671, 0.561, 0.6125, 0.5762]}, {"w": "x_train", "b": [0.1357, 0.5762, 0.2152, 0.5913]}, {"w": "=", "b": [0.2265, 0.5762, 0.2379, 0.5913]}, {"w": "x_train.reshape(x_train.shape", "b": [0.2492, 0.5762, 0.5784, 0.5913]}, {"w": "+", "b": [0.5898, 0.5762, 0.6011, 0.5913]}, {"w": "(1,))", "b": [0.6125, 0.5762, 0.6692, 0.5913]}, {"w": "x_test", "b": [0.1357, 0.5914, 0.2038, 0.6065]}, {"w": "=", "b": [0.2152, 0.5914, 0.2265, 0.6065]}, {"w": "x_test.astype('float32')", "b": [0.2379, 0.5914, 0.5103, 0.6065]}, {"w": "/", "b": [0.5217, 0.5914, 0.533, 0.6065]}, {"w": "255.", "b": [0.5444, 0.5914, 0.5898, 0.6065]}, {"w": "x_test", "b": [0.1357, 0.6065, 0.2038, 0.6216]}, {"w": "=", "b": [0.2152, 0.6065, 0.2265, 0.6216]}, {"w": "x_test.reshape(x_test.shape", "b": [0.2379, 0.6065, 0.5444, 0.6216]}, {"w": "+", "b": [0.5557, 0.6065, 0.5671, 0.6216]}, {"w": "(1,))", "b": [0.5784, 0.6065, 0.6352, 0.6216]}, {"w": "vae.fit(x=x_train,", "b": [0.1357, 0.6368, 0.34, 0.652]}, {"w": "y=None,", "b": [0.3514, 0.6368, 0.4309, 0.652]}, {"w": "shuffle=True,", "b": [0.2265, 0.652, 0.3741, 0.6671]}, {"w": "epochs=10,", "b": [0.2265, 0.6671, 0.34, 0.6823]}, {"w": "batch_size=batch_size,", "b": [0.2265, 0.6823, 0.4763, 0.6974]}, {"w": "validation_data=(x_test,", "b": [0.2265, 0.6974, 0.499, 0.7126]}, {"w": "None))", "b": [0.5103, 0.6974, 0.5784, 0.7126]}]}, {"id": "b_5", "type": "paragraph", "text": "Once such a model is trained—on MNIST, in this case—you can use the decoder network to turn arbitrary latent space vectors into images.", "words": [{"w": "Once", "b": [0.1294, 0.7354, 0.1826, 0.7552]}, {"w": "such", "b": [0.1889, 0.7354, 0.2352, 0.7552]}, {"w": "a", "b": [0.2415, 0.7354, 0.2527, 0.7552]}, {"w": "model", "b": [0.259, 0.7354, 0.3221, 0.7552]}, {"w": "is", "b": [0.3284, 0.7354, 0.3452, 0.7552]}, {"w": "trained—on", "b": [0.3515, 0.7354, 0.472, 0.7552]}, {"w": "MNIST,", "b": [0.4783, 0.7354, 0.5612, 0.7552]}, {"w": "in", "b": [0.5675, 0.7354, 0.5871, 0.7552]}, {"w": "this", "b": [0.5934, 0.7354, 0.6299, 0.7552]}, {"w": "case—you", "b": [0.6362, 0.7354, 0.7427, 0.7552]}, {"w": "can", "b": [0.749, 0.7354, 0.784, 0.7552]}, {"w": "use", "b": [0.7903, 0.7354, 0.8239, 0.7552]}, {"w": "the", "b": [0.8302, 0.7354, 0.8611, 0.7552]}, {"w": "decoder", "b": [0.1294, 0.757, 0.2354, 0.7772]}, {"w": "network", "b": [0.2417, 0.7559, 0.3243, 0.7757]}, {"w": "to", "b": [0.3306, 0.7559, 0.3503, 0.7757]}, {"w": "turn", "b": [0.3566, 0.7559, 0.3972, 0.7757]}, {"w": "arbitrary", "b": [0.4035, 0.7559, 0.4904, 0.7757]}, {"w": "latent", "b": [0.4967, 0.7559, 0.5527, 0.7757]}, {"w": "space", "b": [0.559, 0.7559, 0.6151, 0.7757]}, {"w": "vectors", "b": [0.6214, 0.7559, 0.6942, 0.7757]}, {"w": "into", "b": [0.7005, 0.7559, 0.7398, 0.7757]}, {"w": "images.", "b": [0.7461, 0.7559, 0.8239, 0.7757]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 8.28. Sampling a grid of points from the 2D latent space and decoding them to images", "words": [{"w": "Listing", "b": [0.1294, 0.7947, 0.1862, 0.8095]}, {"w": "8.28.", "b": [0.1909, 0.7947, 0.2288, 0.8095]}, {"w": "Sampling", "b": [0.2335, 0.7947, 0.3102, 0.8095]}, {"w": "a", "b": [0.315, 0.7947, 0.3244, 0.8095]}, {"w": "grid", "b": [0.3291, 0.7947, 0.3628, 0.8095]}, {"w": "of", "b": [0.3675, 0.7947, 0.3833, 0.8095]}, {"w": "points", "b": [0.388, 0.7947, 0.4374, 0.8095]}, {"w": "from", "b": [0.4421, 0.7947, 0.4817, 0.8095]}, {"w": "the", "b": [0.4865, 0.7947, 0.5117, 0.8095]}, {"w": "2D", "b": [0.5164, 0.7947, 0.5395, 0.8095]}, {"w": "latent", "b": [0.5443, 0.7947, 0.5905, 0.8095]}, {"w": "space", "b": [0.5952, 0.7947, 0.6394, 0.8095]}, {"w": "and", "b": [0.6441, 0.7947, 0.6746, 0.8095]}, {"w": "decoding", "b": [0.6793, 0.7947, 0.7519, 0.8095]}, {"w": "them", "b": [0.7566, 0.7947, 0.7976, 0.8095]}, {"w": "to", "b": [0.8023, 0.7947, 0.8181, 0.8095]}, {"w": "images", "b": [0.1294, 0.8098, 0.1851, 0.8246]}]}, {"id": "b_7", "type": "equation", "text": "import matplotlib.pyplot as plt from scipy.stats import norm n = 15 1", "words": [{"w": "import", "b": [0.1357, 0.8382, 0.2038, 0.8534]}, {"w": "matplotlib.pyplot", "b": [0.2152, 0.8382, 0.4082, 0.8534]}, {"w": "as", "b": [0.4195, 0.8382, 0.4422, 0.8534]}, {"w": "plt", "b": [0.4536, 0.8382, 0.4876, 0.8534]}, {"w": "from", "b": [0.1357, 0.8534, 0.1811, 0.8685]}, {"w": "scipy.stats", "b": [0.1925, 0.8534, 0.3173, 0.8685]}, {"w": "import", "b": [0.3287, 0.8534, 0.3968, 0.8685]}, {"w": "norm", "b": [0.4082, 0.8534, 0.4536, 0.8685]}, {"w": "n", "b": [0.1357, 0.8837, 0.1471, 0.8988]}, {"w": "=", "b": [0.1584, 0.8837, 0.1698, 0.8988]}, {"w": "15", "b": [0.1811, 0.8837, 0.2038, 0.8988]}, {"w": "1", "b": [0.1357, 0.8989, 0.1471, 0.914]}]}]}, {"page": 397, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "digit_size = 28 figure = np.zeros((digit_size * n, digit_size * n)) grid_x = norm.ppf(np.linspace(0.05, 0.95, n)) 2 grid_y = norm.ppf(np.linspace(0.05, 0.95, n)) 2 for i, yi in enumerate(grid_x): for j, xi in enumerate(grid_y): z_sample = np.array([[xi, yi]]) z_sample = np.tile(z_sample, batch_size).reshape(batch_size, 2) 3 x_decoded = decoder.predict(z_sample, batch_size=batch_size) 4 digit = x_decoded[0].reshape(digit_size, digit_size) 5 figure[i * digit_size: (i + 1) * digit_size, j * digit_size: (j + 1) * digit_size] = digit plt.figure(figsize=(10, 10)) plt.imshow(figure, cmap='Greys_r') plt.show()", "words": [{"w": "digit_size", "b": [0.1357, 0.0851, 0.2492, 0.1002]}, {"w": "=", "b": [0.2606, 0.0851, 0.2719, 0.1002]}, {"w": "28", "b": [0.2833, 0.0851, 0.306, 0.1002]}, {"w": "figure", "b": [0.1357, 0.1002, 0.2038, 0.1154]}, {"w": "=", "b": [0.2152, 0.1002, 0.2265, 0.1154]}, {"w": "np.zeros((digit_size", "b": [0.2379, 0.1002, 0.4649, 0.1154]}, {"w": "*", "b": [0.4763, 0.1002, 0.4876, 0.1154]}, {"w": "n,", "b": [0.499, 0.1002, 0.5217, 0.1154]}, {"w": "digit_size", "b": [0.533, 0.1002, 0.6465, 0.1154]}, {"w": "*", "b": [0.6579, 0.1002, 0.6692, 0.1154]}, {"w": "n))", "b": [0.6806, 0.1002, 0.7146, 0.1154]}, {"w": "grid_x", "b": [0.1357, 0.1154, 0.2038, 0.1305]}, {"w": "=", "b": [0.2152, 0.1154, 0.2265, 0.1305]}, {"w": "norm.ppf(np.linspace(0.05,", "b": [0.2379, 0.1154, 0.533, 0.1305]}, {"w": "0.95,", "b": [0.5444, 0.1154, 0.6011, 0.1305]}, {"w": "n))", "b": [0.6125, 0.1154, 0.6465, 0.1305]}, {"w": "2", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "grid_y", "b": [0.1357, 0.1457, 0.2038, 0.1608]}, {"w": "=", "b": [0.2152, 0.1457, 0.2265, 0.1608]}, {"w": "norm.ppf(np.linspace(0.05,", "b": [0.2379, 0.1457, 0.533, 0.1608]}, {"w": "0.95,", "b": [0.5444, 0.1457, 0.6011, 0.1608]}, {"w": "n))", "b": [0.6125, 0.1457, 0.6465, 0.1608]}, {"w": "2", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "for", "b": [0.1357, 0.1912, 0.1698, 0.2063]}, {"w": "i,", "b": [0.1811, 0.1912, 0.2038, 0.2063]}, {"w": "yi", "b": [0.2152, 0.1912, 0.2379, 0.2063]}, {"w": "in", "b": [0.2492, 0.1912, 0.2719, 0.2063]}, {"w": "enumerate(grid_x):", "b": [0.2833, 0.1912, 0.4876, 0.2063]}, {"w": "for", "b": [0.1811, 0.2063, 0.2152, 0.2214]}, {"w": "j,", "b": [0.2265, 0.2063, 0.2492, 0.2214]}, {"w": "xi", "b": [0.2606, 0.2063, 0.2833, 0.2214]}, {"w": "in", "b": [0.2946, 0.2063, 0.3173, 0.2214]}, {"w": "enumerate(grid_y):", "b": [0.3287, 0.2063, 0.533, 0.2214]}, {"w": "z_sample", "b": [0.2265, 0.2215, 0.3173, 0.2366]}, {"w": "=", "b": [0.3287, 0.2215, 0.34, 0.2366]}, {"w": "np.array([[xi,", "b": [0.3514, 0.2215, 0.5103, 0.2366]}, {"w": "yi]])", "b": [0.5217, 0.2215, 0.5784, 0.2366]}, {"w": "z_sample", "b": [0.2265, 0.2366, 0.3173, 0.2518]}, {"w": "=", "b": [0.3287, 0.2366, 0.34, 0.2518]}, {"w": "np.tile(z_sample,", "b": [0.3514, 0.2366, 0.5444, 0.2518]}, {"w": "batch_size).reshape(batch_size,", "b": [0.1357, 0.2518, 0.4876, 0.2669]}, {"w": "2)", "b": [0.499, 0.2518, 0.5217, 0.2669]}, {"w": "3", "b": [0.5558, 0.2518, 0.5671, 0.2669]}, {"w": "x_decoded", "b": [0.2265, 0.2669, 0.3287, 0.2821]}, {"w": "=", "b": [0.34, 0.2669, 0.3514, 0.2821]}, {"w": "decoder.predict(z_sample,", "b": [0.3628, 0.2669, 0.6465, 0.2821]}, {"w": "batch_size=batch_size)", "b": [0.1357, 0.2821, 0.3855, 0.2972]}, {"w": "4", "b": [0.4536, 0.2821, 0.465, 0.2972]}, {"w": "digit", "b": [0.2265, 0.2972, 0.2833, 0.3124]}, {"w": "=", "b": [0.2946, 0.2972, 0.306, 0.3124]}, {"w": "x_decoded[0].reshape(digit_size,", "b": [0.3173, 0.2972, 0.6806, 0.3124]}, {"w": "digit_size)", "b": [0.6919, 0.2972, 0.8168, 0.3124]}, {"w": "5", "b": [0.1357, 0.3124, 0.1471, 0.3275]}, {"w": "figure[i", "b": [0.2265, 0.3275, 0.3173, 0.3427]}, {"w": "*", "b": [0.3287, 0.3275, 0.34, 0.3427]}, {"w": "digit_size:", "b": [0.3514, 0.3275, 0.4763, 0.3427]}, {"w": "(i", "b": [0.4876, 0.3275, 0.5103, 0.3427]}, {"w": "+", "b": [0.5217, 0.3275, 0.533, 0.3427]}, {"w": "1)", "b": [0.5444, 0.3275, 0.5671, 0.3427]}, {"w": "*", "b": [0.5784, 0.3275, 0.5898, 0.3427]}, {"w": "digit_size,", "b": [0.6011, 0.3275, 0.726, 0.3427]}, {"w": "j", "b": [0.306, 0.3427, 0.3173, 0.3578]}, {"w": "*", "b": [0.3287, 0.3427, 0.34, 0.3578]}, {"w": "digit_size:", "b": [0.3514, 0.3427, 0.4763, 0.3578]}, {"w": "(j", "b": [0.4876, 0.3427, 0.5103, 0.3578]}, {"w": "+", "b": [0.5217, 0.3427, 0.533, 0.3578]}, {"w": "1)", "b": [0.5444, 0.3427, 0.5671, 0.3578]}, {"w": "*", "b": [0.5784, 0.3427, 0.5898, 0.3578]}, {"w": "digit_size]", "b": [0.6011, 0.3427, 0.726, 0.3578]}, {"w": "=", "b": [0.7374, 0.3427, 0.7487, 0.3578]}, {"w": "digit", "b": [0.7601, 0.3427, 0.8168, 0.3578]}, {"w": "plt.figure(figsize=(10,", "b": [0.1357, 0.373, 0.3968, 0.3881]}, {"w": "10))", "b": [0.4082, 0.373, 0.4536, 0.3881]}, {"w": "plt.imshow(figure,", "b": [0.1357, 0.3881, 0.34, 0.4033]}, {"w": "cmap='Greys_r')", "b": [0.3514, 0.3881, 0.5217, 0.4033]}, {"w": "plt.show()", "b": [0.1357, 0.4033, 0.2492, 0.4184]}]}, {"id": "b_1", "type": "paragraph", "text": "1 You’ll display a grid of 15 × 15 digits (255 digits total). 2 Transforms linearly spaced coordinates using the SciPy ppf function to produce values of the latent variable z (because the prior of the latent space is Gaussian) 3 Repeats z multiple times to form a complete batch 4 Decodes the batch into digit images 5 Reshapes the first digit in the batch from 28 × 28 × 1 to 28 × 28", "words": [{"w": "1", "b": [0.1799, 0.4369, 0.1925, 0.4566]}, {"w": "You’ll", "b": [0.1988, 0.4369, 0.2633, 0.4566]}, {"w": "display", "b": [0.2696, 0.4369, 0.3467, 0.4566]}, {"w": "a", "b": [0.353, 0.4369, 0.3656, 0.4566]}, {"w": "grid", "b": [0.3719, 0.4369, 0.4168, 0.4566]}, {"w": "of", "b": [0.4231, 0.4369, 0.4441, 0.4566]}, {"w": "15", "b": [0.4504, 0.4369, 0.4756, 0.4566]}, {"w": "×", "b": [0.4819, 0.4369, 0.4963, 0.4566]}, {"w": "15", "b": [0.5026, 0.4369, 0.5278, 0.4566]}, {"w": "digits", "b": [0.5341, 0.4369, 0.593, 0.4566]}, {"w": "(255", "b": [0.5993, 0.4369, 0.6456, 0.4566]}, {"w": "digits", "b": [0.6519, 0.4369, 0.7107, 0.4566]}, {"w": "total).", "b": [0.7171, 0.4369, 0.7808, 0.4566]}, {"w": "2", "b": [0.1799, 0.4574, 0.1925, 0.4771]}, {"w": "Transforms", "b": [0.1988, 0.4574, 0.3244, 0.4771]}, {"w": "linearly", "b": [0.3307, 0.4574, 0.4134, 0.4771]}, {"w": "spaced", "b": [0.4197, 0.4574, 0.4926, 0.4771]}, {"w": "coordinates", "b": [0.4989, 0.4574, 0.6236, 0.4771]}, {"w": "using", "b": [0.6299, 0.4574, 0.6874, 0.4771]}, {"w": "the", "b": [0.6937, 0.4574, 0.7274, 0.4771]}, {"w": "SciPy", "b": [0.7337, 0.4574, 0.7939, 0.4771]}, {"w": "ppf", "b": [0.8002, 0.4574, 0.8367, 0.4771]}, {"w": "function", "b": [0.1799, 0.4779, 0.2696, 0.4976]}, {"w": "to", "b": [0.2759, 0.4779, 0.2969, 0.4976]}, {"w": "produce", "b": [0.3032, 0.4779, 0.391, 0.4976]}, {"w": "values", "b": [0.3973, 0.4779, 0.4646, 0.4976]}, {"w": "of", "b": [0.4709, 0.4779, 0.4919, 0.4976]}, {"w": "the", "b": [0.4982, 0.4779, 0.5319, 0.4976]}, {"w": "latent", "b": [0.5382, 0.4779, 0.5998, 0.4976]}, {"w": "variable", "b": [0.6061, 0.4779, 0.6944, 0.4976]}, {"w": "z", "b": [0.7007, 0.4779, 0.7119, 0.4976]}, {"w": "(because", "b": [0.7182, 0.4779, 0.8107, 0.4976]}, {"w": "the", "b": [0.817, 0.4779, 0.8506, 0.4976]}, {"w": "prior", "b": [0.1799, 0.4984, 0.2359, 0.5181]}, {"w": "of", "b": [0.2422, 0.4984, 0.2632, 0.5181]}, {"w": "the", "b": [0.2695, 0.4984, 0.3032, 0.5181]}, {"w": "latent", "b": [0.3095, 0.4984, 0.3711, 0.5181]}, {"w": "space", "b": [0.3774, 0.4984, 0.4363, 0.5181]}, {"w": "is", "b": [0.4426, 0.4984, 0.4594, 0.5181]}, {"w": "Gaussian)", "b": [0.4657, 0.4984, 0.5737, 0.5181]}, {"w": "3", "b": [0.1799, 0.5189, 0.1925, 0.5386]}, {"w": "Repeats", "b": [0.1988, 0.5189, 0.2842, 0.5386]}, {"w": "z", "b": [0.2906, 0.5189, 0.3018, 0.5386]}, {"w": "multiple", "b": [0.3081, 0.5189, 0.3978, 0.5386]}, {"w": "times", "b": [0.4041, 0.5189, 0.4615, 0.5386]}, {"w": "to", "b": [0.4678, 0.5189, 0.4888, 0.5386]}, {"w": "form", "b": [0.4951, 0.5189, 0.5484, 0.5386]}, {"w": "a", "b": [0.5547, 0.5189, 0.5673, 0.5386]}, {"w": "complete", "b": [0.5736, 0.5189, 0.6703, 0.5386]}, {"w": "batch", "b": [0.6766, 0.5189, 0.7368, 0.5386]}, {"w": "4", "b": [0.1799, 0.5394, 0.1925, 0.5591]}, {"w": "Decodes", "b": [0.1988, 0.5394, 0.287, 0.5591]}, {"w": "the", "b": [0.2934, 0.5394, 0.327, 0.5591]}, {"w": "batch", "b": [0.3333, 0.5394, 0.3936, 0.5591]}, {"w": "into", "b": [0.3999, 0.5394, 0.4419, 0.5591]}, {"w": "digit", "b": [0.4482, 0.5394, 0.4973, 0.5591]}, {"w": "images", "b": [0.5036, 0.5394, 0.5779, 0.5591]}, {"w": "5", "b": [0.1799, 0.5599, 0.1925, 0.5796]}, {"w": "Reshapes", "b": [0.1988, 0.5599, 0.2997, 0.5796]}, {"w": "the", "b": [0.306, 0.5599, 0.3396, 0.5796]}, {"w": "first", "b": [0.3459, 0.5599, 0.3908, 0.5796]}, {"w": "digit", "b": [0.3971, 0.5599, 0.4461, 0.5796]}, {"w": "in", "b": [0.4524, 0.5599, 0.4735, 0.5796]}, {"w": "the", "b": [0.4798, 0.5599, 0.5134, 0.5796]}, {"w": "batch", "b": [0.5197, 0.5599, 0.58, 0.5796]}, {"w": "from", "b": [0.5863, 0.5599, 0.6391, 0.5796]}, {"w": "28", "b": [0.6454, 0.5599, 0.6706, 0.5796]}, {"w": "×", "b": [0.6769, 0.5599, 0.6913, 0.5796]}, {"w": "28", "b": [0.6976, 0.5599, 0.7228, 0.5796]}, {"w": "×", "b": [0.7291, 0.5599, 0.7435, 0.5796]}, {"w": "1", "b": [0.7498, 0.5599, 0.7624, 0.5796]}, {"w": "to", "b": [0.7687, 0.5599, 0.7897, 0.5796]}, {"w": "28", "b": [0.796, 0.5599, 0.8213, 0.5796]}, {"w": "×", "b": [0.8276, 0.5599, 0.8419, 0.5796]}, {"w": "28", "b": [0.1799, 0.5804, 0.2051, 0.6001]}]}, {"id": "b_2", "type": "paragraph", "text": "The grid of sampled digits (see figure 8.14) shows a completely continuous distribution of the different digit classes, with one digit morphing into another as you follow a path through latent space. Specific directions in this space have a meaning: for example, there’s a direction for “four-ness,” “one-ness,” and so on.", "words": [{"w": "The", "b": [0.1294, 0.6231, 0.1686, 0.6429]}, {"w": "grid", "b": [0.1749, 0.6231, 0.2156, 0.6429]}, {"w": "of", "b": [0.2219, 0.6231, 0.2429, 0.6429]}, {"w": "sampled", "b": [0.2492, 0.6231, 0.3333, 0.6429]}, {"w": "digits", "b": [0.3396, 0.6231, 0.3957, 0.6429]}, {"w": "(see", "b": [0.402, 0.6231, 0.4426, 0.6429]}, {"w": "figure", "b": [0.4489, 0.6231, 0.5091, 0.6429]}, {"w": "8.14)", "b": [0.5154, 0.6231, 0.5679, 0.6429]}, {"w": "shows", "b": [0.5742, 0.6231, 0.6373, 0.6429]}, {"w": "a", "b": [0.6436, 0.6231, 0.6548, 0.6429]}, {"w": "completely", "b": [0.6611, 0.6231, 0.7732, 0.6429]}, {"w": "continuous", "b": [0.1294, 0.6436, 0.2401, 0.6634]}, {"w": "distribution", "b": [0.2464, 0.6436, 0.3628, 0.6634]}, {"w": "of", "b": [0.3691, 0.6436, 0.3901, 0.6634]}, {"w": "the", "b": [0.3964, 0.6436, 0.4272, 0.6634]}, {"w": "different", "b": [0.4335, 0.6436, 0.5199, 0.6634]}, {"w": "digit", "b": [0.5262, 0.6436, 0.5725, 0.6634]}, {"w": "classes,", "b": [0.5788, 0.6436, 0.6551, 0.6634]}, {"w": "with", "b": [0.6614, 0.6436, 0.7063, 0.6634]}, {"w": "one", "b": [0.7126, 0.6436, 0.749, 0.6634]}, {"w": "digit", "b": [0.7553, 0.6436, 0.8016, 0.6634]}, {"w": "morphing", "b": [0.1294, 0.6641, 0.2275, 0.6839]}, {"w": "into", "b": [0.2338, 0.6641, 0.2731, 0.6839]}, {"w": "another", "b": [0.2794, 0.6641, 0.355, 0.6839]}, {"w": "as", "b": [0.3613, 0.6641, 0.3824, 0.6839]}, {"w": "you", "b": [0.3887, 0.6641, 0.4265, 0.6839]}, {"w": "follow", "b": [0.4328, 0.6641, 0.4987, 0.6839]}, {"w": "a", "b": [0.5049, 0.6641, 0.5161, 0.6839]}, {"w": "path", "b": [0.5224, 0.6641, 0.5659, 0.6839]}, {"w": "through", "b": [0.5722, 0.6641, 0.6507, 0.6839]}, {"w": "latent", "b": [0.657, 0.6641, 0.713, 0.6839]}, {"w": "space.", "b": [0.7193, 0.6641, 0.7817, 0.6839]}, {"w": "Specific", "b": [0.788, 0.6641, 0.8706, 0.6839]}, {"w": "directions", "b": [0.1294, 0.6846, 0.2289, 0.7044]}, {"w": "in", "b": [0.2352, 0.6846, 0.2548, 0.7044]}, {"w": "this", "b": [0.2611, 0.6846, 0.2976, 0.7044]}, {"w": "space", "b": [0.3039, 0.6846, 0.3599, 0.7044]}, {"w": "have", "b": [0.3662, 0.6846, 0.4139, 0.7044]}, {"w": "a", "b": [0.4202, 0.6846, 0.4314, 0.7044]}, {"w": "meaning:", "b": [0.4377, 0.6846, 0.5316, 0.7044]}, {"w": "for", "b": [0.5379, 0.6846, 0.5673, 0.7044]}, {"w": "example,", "b": [0.5736, 0.6846, 0.6654, 0.7044]}, {"w": "there’s", "b": [0.6717, 0.6846, 0.7388, 0.7044]}, {"w": "a", "b": [0.7451, 0.6846, 0.7563, 0.7044]}, {"w": "direction", "b": [0.7626, 0.6846, 0.8523, 0.7044]}, {"w": "for", "b": [0.1294, 0.7051, 0.1588, 0.7249]}, {"w": "“four-ness,”", "b": [0.1651, 0.7051, 0.2872, 0.7249]}, {"w": "“one-ness,”", "b": [0.2935, 0.7051, 0.4105, 0.7249]}, {"w": "and", "b": [0.4168, 0.7051, 0.4532, 0.7249]}, {"w": "so", "b": [0.4595, 0.7051, 0.4819, 0.7249]}, {"w": "on.", "b": [0.4882, 0.7051, 0.5198, 0.7249]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 8.14. Grid of digits decoded from the latent space", "words": [{"w": "Figure", "b": [0.1294, 0.743, 0.1827, 0.7578]}, {"w": "8.14.", "b": [0.1874, 0.743, 0.2252, 0.7578]}, {"w": "Grid", "b": [0.2299, 0.743, 0.2688, 0.7578]}, {"w": "of", "b": [0.2736, 0.743, 0.2893, 0.7578]}, {"w": "digits", "b": [0.2941, 0.743, 0.3382, 0.7578]}, {"w": "decoded", "b": [0.3429, 0.743, 0.4092, 0.7578]}, {"w": "from", "b": [0.4139, 0.743, 0.4535, 0.7578]}, {"w": "the", "b": [0.4582, 0.743, 0.4834, 0.7578]}, {"w": "latent", "b": [0.4881, 0.743, 0.5344, 0.7578]}, {"w": "space", "b": [0.5391, 0.743, 0.5832, 0.7578]}]}]}, {"page": 398, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In the next section, we’ll cover in detail the other major tool for generating artificial images: generative adversarial networks (GANs).", "words": [{"w": "In", "b": [0.1294, 0.3923, 0.1504, 0.412]}, {"w": "the", "b": [0.1567, 0.3923, 0.1876, 0.412]}, {"w": "next", "b": [0.1939, 0.3923, 0.2373, 0.412]}, {"w": "section,", "b": [0.2436, 0.3923, 0.3214, 0.412]}, {"w": "we’ll", "b": [0.3277, 0.3923, 0.3795, 0.412]}, {"w": "cover", "b": [0.3858, 0.3923, 0.4419, 0.412]}, {"w": "in", "b": [0.4482, 0.3923, 0.4678, 0.412]}, {"w": "detail", "b": [0.4741, 0.3923, 0.5301, 0.412]}, {"w": "the", "b": [0.5365, 0.3923, 0.5673, 0.412]}, {"w": "other", "b": [0.5736, 0.3923, 0.6254, 0.412]}, {"w": "major", "b": [0.6317, 0.3923, 0.6906, 0.412]}, {"w": "tool", "b": [0.6969, 0.3923, 0.7361, 0.412]}, {"w": "for", "b": [0.7424, 0.3923, 0.7719, 0.412]}, {"w": "generating", "b": [0.1294, 0.4128, 0.2359, 0.4325]}, {"w": "artificial", "b": [0.2422, 0.4128, 0.3277, 0.4325]}, {"w": "images:", "b": [0.334, 0.4128, 0.4124, 0.4325]}, {"w": "generative", "b": [0.4188, 0.4128, 0.5238, 0.4325]}, {"w": "adversarial", "b": [0.5301, 0.4128, 0.6408, 0.4325]}, {"w": "networks", "b": [0.6471, 0.4128, 0.7396, 0.4325]}, {"w": "(GANs).", "b": [0.7458, 0.4128, 0.8333, 0.4325]}]}, {"id": "b_1", "type": "paragraph", "text": "8.4.4. Wrapping up", "words": [{"w": "8.4.4.", "b": [0.1294, 0.46, 0.1862, 0.4798]}, {"w": "Wrapping", "b": [0.1925, 0.46, 0.3028, 0.4798]}, {"w": "up", "b": [0.3091, 0.46, 0.3371, 0.4798]}]}, {"id": "b_2", "type": "paragraph", "text": "Image generation with deep learning is done by learning latent spaces that capture statistical information about a dataset of images. By sampling and decoding points from the latent space, you can generate never-before-seen images. There are two major tools to do this: VAEs and GANs. VAEs result in highly structured, continuous latent representations. For this reason, they work well for doing all sorts of image editing in latent space: face swapping, turning a frowning face into a smiling face, and so on. They also work nicely for doing latent- space-based animations, such as animating a walk along a cross section of the latent space, showing a starting image slowly morphing into different images in a continuous way. GANs enable the generation of realistic single-frame images but may not induce latent spaces with solid structure and high continuity.", "words": [{"w": "Image", "b": [0.1799, 0.4984, 0.2429, 0.5181]}, {"w": "generation", "b": [0.2492, 0.4984, 0.3557, 0.5181]}, {"w": "with", "b": [0.362, 0.4984, 0.4068, 0.5181]}, {"w": "deep", "b": [0.4132, 0.4984, 0.4608, 0.5181]}, {"w": "learning", "b": [0.4671, 0.4984, 0.5497, 0.5181]}, {"w": "is", "b": [0.5561, 0.4984, 0.5729, 0.5181]}, {"w": "done", "b": [0.5792, 0.4984, 0.6282, 0.5181]}, {"w": "by", "b": [0.6345, 0.4984, 0.6598, 0.5181]}, {"w": "learning", "b": [0.6661, 0.4984, 0.7487, 0.5181]}, {"w": "latent", "b": [0.755, 0.4984, 0.8111, 0.5181]}, {"w": "spaces", "b": [0.1799, 0.5189, 0.2457, 0.5386]}, {"w": "that", "b": [0.252, 0.5189, 0.2898, 0.5386]}, {"w": "capture", "b": [0.2962, 0.5189, 0.3704, 0.5386]}, {"w": "statistical", "b": [0.3767, 0.5189, 0.472, 0.5386]}, {"w": "information", "b": [0.4783, 0.5189, 0.5974, 0.5386]}, {"w": "about", "b": [0.6037, 0.5189, 0.6598, 0.5386]}, {"w": "a", "b": [0.6661, 0.5189, 0.6773, 0.5386]}, {"w": "dataset", "b": [0.6836, 0.5189, 0.7536, 0.5386]}, {"w": "of", "b": [0.7598, 0.5189, 0.7809, 0.5386]}, {"w": "images.", "b": [0.7872, 0.5189, 0.8649, 0.5386]}, {"w": "By", "b": [0.1799, 0.5394, 0.2093, 0.5591]}, {"w": "sampling", "b": [0.2156, 0.5394, 0.3081, 0.5591]}, {"w": "and", "b": [0.3144, 0.5394, 0.3508, 0.5591]}, {"w": "decoding", "b": [0.3572, 0.5394, 0.4496, 0.5591]}, {"w": "points", "b": [0.4559, 0.5394, 0.5176, 0.5591]}, {"w": "from", "b": [0.5239, 0.5394, 0.573, 0.5591]}, {"w": "the", "b": [0.5793, 0.5394, 0.6101, 0.5591]}, {"w": "latent", "b": [0.6164, 0.5394, 0.6724, 0.5591]}, {"w": "space,", "b": [0.6788, 0.5394, 0.7411, 0.5591]}, {"w": "you", "b": [0.7474, 0.5394, 0.7852, 0.5591]}, {"w": "can", "b": [0.7915, 0.5394, 0.8266, 0.5591]}, {"w": "generate", "b": [0.1799, 0.5599, 0.2653, 0.5796]}, {"w": "never-before-seen", "b": [0.2716, 0.5599, 0.4532, 0.5796]}, {"w": "images.", "b": [0.4595, 0.5599, 0.5372, 0.5796]}, {"w": "There", "b": [0.5435, 0.5599, 0.6024, 0.5796]}, {"w": "are", "b": [0.6087, 0.5599, 0.6395, 0.5796]}, {"w": "two", "b": [0.6458, 0.5599, 0.6836, 0.5796]}, {"w": "major", "b": [0.6899, 0.5599, 0.7487, 0.5796]}, {"w": "tools", "b": [0.755, 0.5599, 0.8041, 0.5796]}, {"w": "to", "b": [0.8104, 0.5599, 0.83, 0.5796]}, {"w": "do", "b": [0.8363, 0.5599, 0.8616, 0.5796]}, {"w": "this:", "b": [0.1799, 0.5804, 0.2233, 0.6001]}, {"w": "VAEs", "b": [0.2296, 0.5804, 0.288, 0.6001]}, {"w": "and", "b": [0.2943, 0.5804, 0.3308, 0.6001]}, {"w": "GANs.", "b": [0.3371, 0.5804, 0.4078, 0.6001]}, {"w": "VAEs", "b": [0.1799, 0.6009, 0.2383, 0.6206]}, {"w": "result", "b": [0.2446, 0.6009, 0.3006, 0.6206]}, {"w": "in", "b": [0.3069, 0.6009, 0.3266, 0.6206]}, {"w": "highly", "b": [0.3329, 0.6009, 0.3973, 0.6206]}, {"w": "structured,", "b": [0.4036, 0.6009, 0.5108, 0.6206]}, {"w": "continuous", "b": [0.5171, 0.6009, 0.6279, 0.6206]}, {"w": "latent", "b": [0.6342, 0.6009, 0.6902, 0.6206]}, {"w": "representations.", "b": [0.6965, 0.6009, 0.8555, 0.6206]}, {"w": "For", "b": [0.1799, 0.6214, 0.2149, 0.6411]}, {"w": "this", "b": [0.2212, 0.6214, 0.2577, 0.6411]}, {"w": "reason,", "b": [0.264, 0.6214, 0.3361, 0.6411]}, {"w": "they", "b": [0.3424, 0.6214, 0.3859, 0.6411]}, {"w": "work", "b": [0.3922, 0.6214, 0.444, 0.6411]}, {"w": "well", "b": [0.4503, 0.6214, 0.4937, 0.6411]}, {"w": "for", "b": [0.5001, 0.6214, 0.5295, 0.6411]}, {"w": "doing", "b": [0.5358, 0.6214, 0.5932, 0.6411]}, {"w": "all", "b": [0.5995, 0.6214, 0.6248, 0.6411]}, {"w": "sorts", "b": [0.6311, 0.6214, 0.6787, 0.6411]}, {"w": "of", "b": [0.685, 0.6214, 0.706, 0.6411]}, {"w": "image", "b": [0.7123, 0.6214, 0.774, 0.6411]}, {"w": "editing", "b": [0.7803, 0.6214, 0.8504, 0.6411]}, {"w": "in", "b": [0.1799, 0.6419, 0.1995, 0.6616]}, {"w": "latent", "b": [0.2058, 0.6419, 0.2618, 0.6616]}, {"w": "space:", "b": [0.2682, 0.6419, 0.3312, 0.6616]}, {"w": "face", "b": [0.3375, 0.6419, 0.3795, 0.6616]}, {"w": "swapping,", "b": [0.3858, 0.6419, 0.4888, 0.6616]}, {"w": "turning", "b": [0.4951, 0.6419, 0.568, 0.6616]}, {"w": "a", "b": [0.5743, 0.6419, 0.5855, 0.6616]}, {"w": "frowning", "b": [0.5918, 0.6419, 0.6843, 0.6616]}, {"w": "face", "b": [0.6906, 0.6419, 0.7326, 0.6616]}, {"w": "into", "b": [0.7389, 0.6419, 0.7781, 0.6616]}, {"w": "a", "b": [0.7844, 0.6419, 0.7956, 0.6616]}, {"w": "smiling", "b": [0.1799, 0.6624, 0.2556, 0.6821]}, {"w": "face,", "b": [0.2619, 0.6624, 0.3102, 0.6821]}, {"w": "and", "b": [0.3165, 0.6624, 0.3529, 0.6821]}, {"w": "so", "b": [0.3592, 0.6624, 0.3816, 0.6821]}, {"w": "on.", "b": [0.388, 0.6624, 0.4195, 0.6821]}, {"w": "They", "b": [0.4258, 0.6624, 0.4776, 0.6821]}, {"w": "also", "b": [0.4839, 0.6624, 0.5246, 0.6821]}, {"w": "work", "b": [0.5309, 0.6624, 0.5827, 0.6821]}, {"w": "nicely", "b": [0.589, 0.6624, 0.6507, 0.6821]}, {"w": "for", "b": [0.6569, 0.6624, 0.6863, 0.6821]}, {"w": "doing", "b": [0.6926, 0.6624, 0.7501, 0.6821]}, {"w": "latent-", "b": [0.7564, 0.6624, 0.8209, 0.6821]}, {"w": "space-based", "b": [0.1799, 0.6829, 0.3017, 0.7026]}, {"w": "animations,", "b": [0.308, 0.6829, 0.4251, 0.7026]}, {"w": "such", "b": [0.4314, 0.6829, 0.4776, 0.7026]}, {"w": "as", "b": [0.4839, 0.6829, 0.5049, 0.7026]}, {"w": "animating", "b": [0.5112, 0.6829, 0.6121, 0.7026]}, {"w": "a", "b": [0.6184, 0.6829, 0.6296, 0.7026]}, {"w": "walk", "b": [0.6359, 0.6829, 0.685, 0.7026]}, {"w": "along", "b": [0.6913, 0.6829, 0.7473, 0.7026]}, {"w": "a", "b": [0.7536, 0.6829, 0.7648, 0.7026]}, {"w": "cross", "b": [0.7712, 0.6829, 0.823, 0.7026]}, {"w": "section", "b": [0.1799, 0.7034, 0.2513, 0.7231]}, {"w": "of", "b": [0.2576, 0.7034, 0.2786, 0.7231]}, {"w": "the", "b": [0.285, 0.7034, 0.3158, 0.7231]}, {"w": "latent", "b": [0.3221, 0.7034, 0.3781, 0.7231]}, {"w": "space,", "b": [0.3844, 0.7034, 0.4468, 0.7231]}, {"w": "showing", "b": [0.4531, 0.7034, 0.5386, 0.7231]}, {"w": "a", "b": [0.5449, 0.7034, 0.5561, 0.7231]}, {"w": "starting", "b": [0.5624, 0.7034, 0.6381, 0.7231]}, {"w": "image", "b": [0.6443, 0.7034, 0.7059, 0.7231]}, {"w": "slowly", "b": [0.7123, 0.7034, 0.7795, 0.7231]}, {"w": "morphing", "b": [0.1799, 0.7239, 0.278, 0.7436]}, {"w": "into", "b": [0.2843, 0.7239, 0.3235, 0.7436]}, {"w": "different", "b": [0.3298, 0.7239, 0.4162, 0.7436]}, {"w": "images", "b": [0.4225, 0.7239, 0.494, 0.7436]}, {"w": "in", "b": [0.5003, 0.7239, 0.5199, 0.7436]}, {"w": "a", "b": [0.5262, 0.7239, 0.5374, 0.7436]}, {"w": "continuous", "b": [0.5437, 0.7239, 0.6544, 0.7436]}, {"w": "way.", "b": [0.6607, 0.7239, 0.7074, 0.7436]}, {"w": "GANs", "b": [0.1799, 0.7444, 0.2443, 0.7641]}, {"w": "enable", "b": [0.2506, 0.7444, 0.3165, 0.7641]}, {"w": "the", "b": [0.3228, 0.7444, 0.3536, 0.7641]}, {"w": "generation", "b": [0.3599, 0.7444, 0.4664, 0.7641]}, {"w": "of", "b": [0.4727, 0.7444, 0.4937, 0.7641]}, {"w": "realistic", "b": [0.5, 0.7444, 0.5799, 0.7641]}, {"w": "single-frame", "b": [0.5862, 0.7444, 0.7137, 0.7641]}, {"w": "images", "b": [0.72, 0.7444, 0.7914, 0.7641]}, {"w": "but", "b": [0.7977, 0.7444, 0.83, 0.7641]}, {"w": "may", "b": [0.1799, 0.7649, 0.2233, 0.7846]}, {"w": "not", "b": [0.2296, 0.7649, 0.2618, 0.7846]}, {"w": "induce", "b": [0.2682, 0.7649, 0.3354, 0.7846]}, {"w": "latent", "b": [0.3417, 0.7649, 0.3978, 0.7846]}, {"w": "spaces", "b": [0.4041, 0.7649, 0.4699, 0.7846]}, {"w": "with", "b": [0.4762, 0.7649, 0.5211, 0.7846]}, {"w": "solid", "b": [0.5274, 0.7649, 0.5764, 0.7846]}, {"w": "structure", "b": [0.5827, 0.7649, 0.671, 0.7846]}, {"w": "and", "b": [0.6773, 0.7649, 0.7137, 0.7846]}, {"w": "high", "b": [0.72, 0.7649, 0.7649, 0.7846]}, {"w": "continuity.", "b": [0.1799, 0.7854, 0.2868, 0.8051]}]}, {"id": "b_3", "type": "paragraph", "text": "Most successful practical applications I have seen with images rely on VAEs, but GANs are extremely popular in the world of academic research—at least, circa 2016–2017. You’ll find out how they work and how to implement one in the next section.", "words": [{"w": "Most", "b": [0.1294, 0.8281, 0.1813, 0.8479]}, {"w": "successful", "b": [0.1876, 0.8281, 0.2913, 0.8479]}, {"w": "practical", "b": [0.2976, 0.8281, 0.3844, 0.8479]}, {"w": "applications", "b": [0.3907, 0.8281, 0.5126, 0.8479]}, {"w": "I", "b": [0.5189, 0.8281, 0.5273, 0.8479]}, {"w": "have", "b": [0.5337, 0.8281, 0.5813, 0.8479]}, {"w": "seen", "b": [0.5876, 0.8281, 0.6324, 0.8479]}, {"w": "with", "b": [0.6387, 0.8281, 0.6836, 0.8479]}, {"w": "images", "b": [0.6899, 0.8281, 0.7613, 0.8479]}, {"w": "rely", "b": [0.7676, 0.8281, 0.8069, 0.8479]}, {"w": "on", "b": [0.8132, 0.8281, 0.8384, 0.8479]}, {"w": "VAEs,", "b": [0.1294, 0.8486, 0.1941, 0.8684]}, {"w": "but", "b": [0.2004, 0.8486, 0.2327, 0.8684]}, {"w": "GANs", "b": [0.239, 0.8486, 0.3034, 0.8684]}, {"w": "are", "b": [0.3097, 0.8486, 0.3405, 0.8684]}, {"w": "extremely", "b": [0.3468, 0.8486, 0.4477, 0.8684]}, {"w": "popular", "b": [0.454, 0.8486, 0.5311, 0.8684]}, {"w": "in", "b": [0.5374, 0.8486, 0.557, 0.8684]}, {"w": "the", "b": [0.5633, 0.8486, 0.5942, 0.8684]}, {"w": "world", "b": [0.6005, 0.8486, 0.6593, 0.8684]}, {"w": "of", "b": [0.6656, 0.8486, 0.6866, 0.8684]}, {"w": "academic", "b": [0.6929, 0.8486, 0.7881, 0.8684]}, {"w": "research—at", "b": [0.1294, 0.8691, 0.2569, 0.8889]}, {"w": "least,", "b": [0.2632, 0.8691, 0.3157, 0.8889]}, {"w": "circa", "b": [0.322, 0.8691, 0.371, 0.8889]}, {"w": "2016–2017.", "b": [0.3774, 0.8691, 0.4972, 0.8889]}, {"w": "You’ll", "b": [0.5035, 0.8691, 0.5668, 0.8889]}, {"w": "find", "b": [0.5731, 0.8691, 0.6137, 0.8889]}, {"w": "out", "b": [0.62, 0.8691, 0.6523, 0.8889]}, {"w": "how", "b": [0.6586, 0.8691, 0.702, 0.8889]}, {"w": "they", "b": [0.7083, 0.8691, 0.7518, 0.8889]}, {"w": "work", "b": [0.7581, 0.8691, 0.8099, 0.8889]}, {"w": "and", "b": [0.8162, 0.8691, 0.8526, 0.8889]}, {"w": "how", "b": [0.1294, 0.8896, 0.1729, 0.9094]}, {"w": "to", "b": [0.1792, 0.8896, 0.1988, 0.9094]}, {"w": "implement", "b": [0.2051, 0.8896, 0.313, 0.9094]}, {"w": "one", "b": [0.3193, 0.8896, 0.3557, 0.9094]}, {"w": "in", "b": [0.362, 0.8896, 0.3817, 0.9094]}, {"w": "the", "b": [0.388, 0.8896, 0.4188, 0.9094]}, {"w": "next", "b": [0.4251, 0.8896, 0.4685, 0.9094]}, {"w": "section.", "b": [0.4749, 0.8896, 0.5526, 0.9094]}]}]}, {"page": 399, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Tip", "words": [{"w": "Tip", "b": [0.1294, 0.0959, 0.1575, 0.1107]}]}, {"id": "b_1", "type": "paragraph", "text": "To play further with image generation, I suggest working with the Large- scale Celeb Faces Attributes (CelebA) dataset. It’s a free-to-download image dataset containing more than 200,000 celebrity portraits. It’s great for experimenting with concept vectors in particular—it definitely beats MNIST.", "words": [{"w": "To", "b": [0.1294, 0.1293, 0.1557, 0.1491]}, {"w": "play", "b": [0.162, 0.1293, 0.2054, 0.1491]}, {"w": "further", "b": [0.2117, 0.1293, 0.2804, 0.1491]}, {"w": "with", "b": [0.2867, 0.1293, 0.3315, 0.1491]}, {"w": "image", "b": [0.3378, 0.1293, 0.3995, 0.1491]}, {"w": "generation,", "b": [0.4058, 0.1293, 0.5186, 0.1491]}, {"w": "I", "b": [0.5249, 0.1293, 0.5333, 0.1491]}, {"w": "suggest", "b": [0.5396, 0.1293, 0.6153, 0.1491]}, {"w": "working", "b": [0.6216, 0.1293, 0.7056, 0.1491]}, {"w": "with", "b": [0.712, 0.1293, 0.7568, 0.1491]}, {"w": "the", "b": [0.7631, 0.1293, 0.7939, 0.1491]}, {"w": "Large-", "b": [0.8002, 0.1293, 0.8669, 0.1491]}, {"w": "scale", "b": [0.1294, 0.1498, 0.1798, 0.1696]}, {"w": "Celeb", "b": [0.1861, 0.1498, 0.245, 0.1696]}, {"w": "Faces", "b": [0.2513, 0.1498, 0.3087, 0.1696]}, {"w": "Attributes", "b": [0.315, 0.1498, 0.416, 0.1696]}, {"w": "(CelebA)", "b": [0.4223, 0.1498, 0.5161, 0.1696]}, {"w": "dataset.", "b": [0.5224, 0.1498, 0.5988, 0.1696]}, {"w": "It’s", "b": [0.6051, 0.1498, 0.6373, 0.1696]}, {"w": "a", "b": [0.6436, 0.1498, 0.6548, 0.1696]}, {"w": "free-to-download", "b": [0.6611, 0.1498, 0.8362, 0.1696]}, {"w": "image", "b": [0.1294, 0.1703, 0.1911, 0.1901]}, {"w": "dataset", "b": [0.1974, 0.1703, 0.2674, 0.1901]}, {"w": "containing", "b": [0.2737, 0.1703, 0.3802, 0.1901]}, {"w": "more", "b": [0.3865, 0.1703, 0.4384, 0.1901]}, {"w": "than", "b": [0.4447, 0.1703, 0.4881, 0.1901]}, {"w": "200,000", "b": [0.4944, 0.1703, 0.5764, 0.1901]}, {"w": "celebrity", "b": [0.5827, 0.1703, 0.671, 0.1901]}, {"w": "portraits.", "b": [0.6773, 0.1703, 0.7677, 0.1901]}, {"w": "It’s", "b": [0.774, 0.1703, 0.8061, 0.1901]}, {"w": "great", "b": [0.8124, 0.1703, 0.8628, 0.1901]}, {"w": "for", "b": [0.1294, 0.1909, 0.1588, 0.2106]}, {"w": "experimenting", "b": [0.1651, 0.1909, 0.3109, 0.2106]}, {"w": "with", "b": [0.3172, 0.1909, 0.362, 0.2106]}, {"w": "concept", "b": [0.3683, 0.1909, 0.4468, 0.2106]}, {"w": "vectors", "b": [0.453, 0.1909, 0.5259, 0.2106]}, {"w": "in", "b": [0.5322, 0.1909, 0.5518, 0.2106]}, {"w": "particular—it", "b": [0.5581, 0.1909, 0.694, 0.2106]}, {"w": "definitely", "b": [0.7003, 0.1909, 0.797, 0.2106]}, {"w": "beats", "b": [0.8033, 0.1909, 0.8552, 0.2106]}, {"w": "MNIST.", "b": [0.1294, 0.2113, 0.2123, 0.2311]}]}, {"id": "b_2", "type": "paragraph", "text": "8.5. Introduction to generative adversarial networks", "words": [{"w": "8.5.", "b": [0.1294, 0.2949, 0.172, 0.3171]}, {"w": "Introduction", "b": [0.1791, 0.2949, 0.3331, 0.3171]}, {"w": "to", "b": [0.3402, 0.2949, 0.3638, 0.3171]}, {"w": "generative", "b": [0.3709, 0.2949, 0.497, 0.3171]}, {"w": "adversarial", "b": [0.5041, 0.2949, 0.6413, 0.3171]}, {"w": "networks", "b": [0.6484, 0.2949, 0.7603, 0.3171]}]}, {"id": "b_3", "type": "paragraph", "text": "Generative adversarial networks (GANs), introduced in 2014 by Goodfellow et al.,[8] are an alternative to VAEs for learning latent spaces of images. They enable the generation of fairly realistic synthetic images by forcing the generated images to be statistically almost indistinguishable from real ones.", "words": [{"w": "Generative", "b": [0.1294, 0.3406, 0.2401, 0.3603]}, {"w": "adversarial", "b": [0.2464, 0.3406, 0.357, 0.3603]}, {"w": "networks", "b": [0.3634, 0.3406, 0.4558, 0.3603]}, {"w": "(GANs),", "b": [0.4621, 0.3406, 0.5497, 0.3603]}, {"w": "introduced", "b": [0.556, 0.3406, 0.6639, 0.3603]}, {"w": "in", "b": [0.6702, 0.3406, 0.6898, 0.3603]}, {"w": "2014", "b": [0.6961, 0.3406, 0.7466, 0.3603]}, {"w": "by", "b": [0.7529, 0.3406, 0.7781, 0.3603]}, {"w": "Goodfellow", "b": [0.1294, 0.3629, 0.2499, 0.3826]}, {"w": "et", "b": [0.2562, 0.3629, 0.2744, 0.3826]}, {"w": "al.,[8]", "b": [0.2807, 0.3606, 0.3336, 0.3826]}, {"w": "are", "b": [0.3399, 0.3629, 0.3707, 0.3826]}, {"w": "an", "b": [0.377, 0.3629, 0.4008, 0.3826]}, {"w": "alternative", "b": [0.4071, 0.3629, 0.5136, 0.3826]}, {"w": "to", "b": [0.5199, 0.3629, 0.5395, 0.3826]}, {"w": "VAEs", "b": [0.5458, 0.3629, 0.6042, 0.3826]}, {"w": "for", "b": [0.6105, 0.3629, 0.6399, 0.3826]}, {"w": "learning", "b": [0.6462, 0.3629, 0.7289, 0.3826]}, {"w": "latent", "b": [0.7352, 0.3629, 0.7912, 0.3826]}, {"w": "spaces", "b": [0.7975, 0.3629, 0.8634, 0.3826]}, {"w": "of", "b": [0.1294, 0.3834, 0.1504, 0.4031]}, {"w": "images.", "b": [0.1567, 0.3834, 0.2345, 0.4031]}, {"w": "They", "b": [0.2408, 0.3834, 0.2926, 0.4031]}, {"w": "enable", "b": [0.299, 0.3834, 0.3648, 0.4031]}, {"w": "the", "b": [0.3711, 0.3834, 0.4019, 0.4031]}, {"w": "generation", "b": [0.4082, 0.3834, 0.5147, 0.4031]}, {"w": "of", "b": [0.521, 0.3834, 0.542, 0.4031]}, {"w": "fairly", "b": [0.5483, 0.3834, 0.603, 0.4031]}, {"w": "realistic", "b": [0.6093, 0.3834, 0.6891, 0.4031]}, {"w": "synthetic", "b": [0.6955, 0.3834, 0.7865, 0.4031]}, {"w": "images", "b": [0.7927, 0.3834, 0.8642, 0.4031]}, {"w": "by", "b": [0.1294, 0.4039, 0.1546, 0.4236]}, {"w": "forcing", "b": [0.1609, 0.4039, 0.2338, 0.4236]}, {"w": "the", "b": [0.2401, 0.4039, 0.2709, 0.4236]}, {"w": "generated", "b": [0.2772, 0.4039, 0.3753, 0.4236]}, {"w": "images", "b": [0.3816, 0.4039, 0.4531, 0.4236]}, {"w": "to", "b": [0.4594, 0.4039, 0.479, 0.4236]}, {"w": "be", "b": [0.4853, 0.4039, 0.5091, 0.4236]}, {"w": "statistically", "b": [0.5154, 0.4039, 0.6303, 0.4236]}, {"w": "almost", "b": [0.6367, 0.4039, 0.7039, 0.4236]}, {"w": "indistinguishable", "b": [0.1294, 0.4244, 0.3018, 0.4441]}, {"w": "from", "b": [0.3081, 0.4244, 0.3572, 0.4441]}, {"w": "real", "b": [0.3635, 0.4244, 0.4013, 0.4441]}, {"w": "ones.", "b": [0.4076, 0.4244, 0.4601, 0.4441]}]}, {"id": "b_5", "type": "paragraph", "text": "Ian Goodfellow et al., “Generative Adversarial Networks,” arXiv (2014), https://arxiv.org/abs/1406.2661.", "words": [{"w": "Ian", "b": [0.1483, 0.4898, 0.1725, 0.5047]}, {"w": "Goodfellow", "b": [0.1772, 0.4898, 0.2676, 0.5047]}, {"w": "et", "b": [0.2723, 0.4898, 0.286, 0.5047]}, {"w": "al.,", "b": [0.2907, 0.4898, 0.3138, 0.5047]}, {"w": "“Generative", "b": [0.3186, 0.4898, 0.41, 0.5047]}, {"w": "Adversarial", "b": [0.4147, 0.4898, 0.503, 0.5047]}, {"w": "Networks,”", "b": [0.5077, 0.4898, 0.5944, 0.5047]}, {"w": "arXiv", "b": [0.5991, 0.4898, 0.6422, 0.5047]}, {"w": "(2014),", "b": [0.6469, 0.4898, 0.7021, 0.5047]}, {"w": "https://arxiv.org/abs/1406.2661.", "b": [0.1483, 0.505, 0.389, 0.5198]}]}, {"id": "b_6", "type": "paragraph", "text": "An intuitive way to understand GANs is to imagine a forger trying to create a fake Picasso painting. At first, the forger is pretty bad at the task. He mixes some of his fakes with authentic Picassos and shows them all to an art dealer. The art dealer makes an authenticity assessment for each painting and gives the forger feedback about what makes a Picasso look like a Picasso. The forger goes back to his studio to prepare some new fakes. As times goes on, the forger becomes increasingly competent at imitating the style of Picasso, and the art dealer becomes increasingly expert at spotting fakes. In the end, they have on their hands some excellent fake Picassos.", "words": [{"w": "An", "b": [0.1294, 0.5429, 0.1602, 0.5627]}, {"w": "intuitive", "b": [0.1665, 0.5429, 0.2506, 0.5627]}, {"w": "way", "b": [0.257, 0.5429, 0.299, 0.5627]}, {"w": "to", "b": [0.3053, 0.5429, 0.3249, 0.5627]}, {"w": "understand", "b": [0.3312, 0.5429, 0.4419, 0.5627]}, {"w": "GANs", "b": [0.4482, 0.5429, 0.5127, 0.5627]}, {"w": "is", "b": [0.519, 0.5429, 0.5358, 0.5627]}, {"w": "to", "b": [0.5421, 0.5429, 0.5617, 0.5627]}, {"w": "imagine", "b": [0.568, 0.5429, 0.6493, 0.5627]}, {"w": "a", "b": [0.6556, 0.5429, 0.6668, 0.5627]}, {"w": "forger", "b": [0.6731, 0.5429, 0.7343, 0.5627]}, {"w": "trying", "b": [0.7406, 0.5429, 0.8008, 0.5627]}, {"w": "to", "b": [0.8071, 0.5429, 0.8268, 0.5627]}, {"w": "create", "b": [0.1294, 0.5634, 0.1896, 0.5832]}, {"w": "a", "b": [0.1959, 0.5634, 0.2071, 0.5832]}, {"w": "fake", "b": [0.2134, 0.5634, 0.2569, 0.5832]}, {"w": "Picasso", "b": [0.2632, 0.5634, 0.3388, 0.5832]}, {"w": "painting.", "b": [0.3451, 0.5634, 0.4341, 0.5832]}, {"w": "At", "b": [0.4404, 0.5634, 0.4657, 0.5832]}, {"w": "first,", "b": [0.472, 0.5634, 0.5189, 0.5832]}, {"w": "the", "b": [0.5252, 0.5634, 0.5561, 0.5832]}, {"w": "forger", "b": [0.5624, 0.5634, 0.6235, 0.5832]}, {"w": "is", "b": [0.6298, 0.5634, 0.6466, 0.5832]}, {"w": "pretty", "b": [0.6529, 0.5634, 0.7118, 0.5832]}, {"w": "bad", "b": [0.7181, 0.5634, 0.7545, 0.5832]}, {"w": "at", "b": [0.7608, 0.5634, 0.779, 0.5832]}, {"w": "the", "b": [0.7853, 0.5634, 0.8161, 0.5832]}, {"w": "task.", "b": [0.8224, 0.5634, 0.8694, 0.5832]}, {"w": "He", "b": [0.1294, 0.5839, 0.1588, 0.6037]}, {"w": "mixes", "b": [0.1651, 0.5839, 0.2254, 0.6037]}, {"w": "some", "b": [0.2317, 0.5839, 0.285, 0.6037]}, {"w": "of", "b": [0.2913, 0.5839, 0.3123, 0.6037]}, {"w": "his", "b": [0.3186, 0.5839, 0.348, 0.6037]}, {"w": "fakes", "b": [0.3543, 0.5839, 0.4076, 0.6037]}, {"w": "with", "b": [0.4139, 0.5839, 0.4587, 0.6037]}, {"w": "authentic", "b": [0.465, 0.5839, 0.5575, 0.6037]}, {"w": "Picassos", "b": [0.5638, 0.5839, 0.6493, 0.6037]}, {"w": "and", "b": [0.6556, 0.5839, 0.692, 0.6037]}, {"w": "shows", "b": [0.6983, 0.5839, 0.7614, 0.6037]}, {"w": "them", "b": [0.7677, 0.5839, 0.8182, 0.6037]}, {"w": "all", "b": [0.8245, 0.5839, 0.8497, 0.6037]}, {"w": "to", "b": [0.1294, 0.6044, 0.149, 0.6242]}, {"w": "an", "b": [0.1553, 0.6044, 0.1792, 0.6242]}, {"w": "art", "b": [0.1855, 0.6044, 0.2121, 0.6242]}, {"w": "dealer.", "b": [0.2184, 0.6044, 0.2849, 0.6242]}, {"w": "The", "b": [0.2912, 0.6044, 0.3304, 0.6242]}, {"w": "art", "b": [0.3367, 0.6044, 0.3633, 0.6242]}, {"w": "dealer", "b": [0.3696, 0.6044, 0.4313, 0.6242]}, {"w": "makes", "b": [0.4376, 0.6044, 0.502, 0.6242]}, {"w": "an", "b": [0.5083, 0.6044, 0.5321, 0.6242]}, {"w": "authenticity", "b": [0.5384, 0.6044, 0.6576, 0.6242]}, {"w": "assessment", "b": [0.6639, 0.6044, 0.776, 0.6242]}, {"w": "for", "b": [0.7823, 0.6044, 0.8117, 0.6242]}, {"w": "each", "b": [0.818, 0.6044, 0.8642, 0.6242]}, {"w": "painting", "b": [0.1294, 0.6249, 0.2121, 0.6447]}, {"w": "and", "b": [0.2184, 0.6249, 0.2548, 0.6447]}, {"w": "gives", "b": [0.2611, 0.6249, 0.3144, 0.6447]}, {"w": "the", "b": [0.3207, 0.6249, 0.3515, 0.6447]}, {"w": "forger", "b": [0.3578, 0.6249, 0.419, 0.6447]}, {"w": "feedback", "b": [0.4253, 0.6249, 0.5163, 0.6447]}, {"w": "about", "b": [0.5226, 0.6249, 0.5787, 0.6447]}, {"w": "what", "b": [0.585, 0.6249, 0.634, 0.6447]}, {"w": "makes", "b": [0.6403, 0.6249, 0.7048, 0.6447]}, {"w": "a", "b": [0.7111, 0.6249, 0.7223, 0.6447]}, {"w": "Picasso", "b": [0.7286, 0.6249, 0.8043, 0.6447]}, {"w": "look", "b": [0.8106, 0.6249, 0.8554, 0.6447]}, {"w": "like", "b": [0.1294, 0.6454, 0.1673, 0.6652]}, {"w": "a", "b": [0.1735, 0.6454, 0.1847, 0.6652]}, {"w": "Picasso.", "b": [0.191, 0.6454, 0.273, 0.6652]}, {"w": "The", "b": [0.2793, 0.6454, 0.3186, 0.6652]}, {"w": "forger", "b": [0.3249, 0.6454, 0.386, 0.6652]}, {"w": "goes", "b": [0.3923, 0.6454, 0.4386, 0.6652]}, {"w": "back", "b": [0.4449, 0.6454, 0.4925, 0.6652]}, {"w": "to", "b": [0.4988, 0.6454, 0.5184, 0.6652]}, {"w": "his", "b": [0.5247, 0.6454, 0.5542, 0.6652]}, {"w": "studio", "b": [0.5605, 0.6454, 0.6222, 0.6652]}, {"w": "to", "b": [0.6285, 0.6454, 0.6481, 0.6652]}, {"w": "prepare", "b": [0.6544, 0.6454, 0.73, 0.6652]}, {"w": "some", "b": [0.7363, 0.6454, 0.7896, 0.6652]}, {"w": "new", "b": [0.7959, 0.6454, 0.8379, 0.6652]}, {"w": "fakes.", "b": [0.1294, 0.6659, 0.1889, 0.6857]}, {"w": "As", "b": [0.1953, 0.6659, 0.2233, 0.6857]}, {"w": "times", "b": [0.2296, 0.6659, 0.2842, 0.6857]}, {"w": "goes", "b": [0.2906, 0.6659, 0.3368, 0.6857]}, {"w": "on,", "b": [0.3431, 0.6659, 0.3746, 0.6857]}, {"w": "the", "b": [0.3809, 0.6659, 0.4118, 0.6857]}, {"w": "forger", "b": [0.4181, 0.6659, 0.4792, 0.6857]}, {"w": "becomes", "b": [0.4855, 0.6659, 0.5738, 0.6857]}, {"w": "increasingly", "b": [0.5801, 0.6659, 0.7034, 0.6857]}, {"w": "competent", "b": [0.7097, 0.6659, 0.8148, 0.6857]}, {"w": "at", "b": [0.8211, 0.6659, 0.8393, 0.6857]}, {"w": "imitating", "b": [0.1294, 0.6864, 0.2205, 0.7062]}, {"w": "the", "b": [0.2268, 0.6864, 0.2577, 0.7062]}, {"w": "style", "b": [0.264, 0.6864, 0.3116, 0.7062]}, {"w": "of", "b": [0.3179, 0.6864, 0.3389, 0.7062]}, {"w": "Picasso,", "b": [0.3452, 0.6864, 0.4272, 0.7062]}, {"w": "and", "b": [0.4335, 0.6864, 0.47, 0.7062]}, {"w": "the", "b": [0.4763, 0.6864, 0.5071, 0.7062]}, {"w": "art", "b": [0.5134, 0.6864, 0.54, 0.7062]}, {"w": "dealer", "b": [0.5463, 0.6864, 0.6079, 0.7062]}, {"w": "becomes", "b": [0.6143, 0.6864, 0.7025, 0.7062]}, {"w": "increasingly", "b": [0.7088, 0.6864, 0.8321, 0.7062]}, {"w": "expert", "b": [0.1294, 0.7069, 0.1925, 0.7267]}, {"w": "at", "b": [0.1988, 0.7069, 0.217, 0.7267]}, {"w": "spotting", "b": [0.2233, 0.7069, 0.3046, 0.7267]}, {"w": "fakes.", "b": [0.3109, 0.7069, 0.3704, 0.7267]}, {"w": "In", "b": [0.3767, 0.7069, 0.3977, 0.7267]}, {"w": "the", "b": [0.404, 0.7069, 0.4349, 0.7267]}, {"w": "end,", "b": [0.4412, 0.7069, 0.4839, 0.7267]}, {"w": "they", "b": [0.4902, 0.7069, 0.5336, 0.7267]}, {"w": "have", "b": [0.5399, 0.7069, 0.5875, 0.7267]}, {"w": "on", "b": [0.5938, 0.7069, 0.6191, 0.7267]}, {"w": "their", "b": [0.6254, 0.7069, 0.6716, 0.7267]}, {"w": "hands", "b": [0.6779, 0.7069, 0.7368, 0.7267]}, {"w": "some", "b": [0.7431, 0.7069, 0.7963, 0.7267]}, {"w": "excellent", "b": [0.1294, 0.7274, 0.2205, 0.7472]}, {"w": "fake", "b": [0.2268, 0.7274, 0.2702, 0.7472]}, {"w": "Picassos.", "b": [0.2765, 0.7274, 0.3683, 0.7472]}]}, {"id": "b_7", "type": "paragraph", "text": "That’s what a GAN is: a forger network and an expert network, each being trained to best the other. As such, a GAN is made of two parts:", "words": [{"w": "That’s", "b": [0.1294, 0.7702, 0.1925, 0.7899]}, {"w": "what", "b": [0.1988, 0.7702, 0.2478, 0.7899]}, {"w": "a", "b": [0.2541, 0.7702, 0.2653, 0.7899]}, {"w": "GAN", "b": [0.2716, 0.7702, 0.3263, 0.7899]}, {"w": "is:", "b": [0.3326, 0.7702, 0.3564, 0.7899]}, {"w": "a", "b": [0.3627, 0.7702, 0.3739, 0.7899]}, {"w": "forger", "b": [0.3802, 0.7702, 0.4414, 0.7899]}, {"w": "network", "b": [0.4477, 0.7702, 0.5304, 0.7899]}, {"w": "and", "b": [0.5367, 0.7702, 0.5731, 0.7899]}, {"w": "an", "b": [0.5794, 0.7702, 0.6032, 0.7899]}, {"w": "expert", "b": [0.6095, 0.7702, 0.6726, 0.7899]}, {"w": "network,", "b": [0.6789, 0.7702, 0.7678, 0.7899]}, {"w": "each", "b": [0.7741, 0.7702, 0.8204, 0.7899]}, {"w": "being", "b": [0.1294, 0.7907, 0.1855, 0.8104]}, {"w": "trained", "b": [0.1918, 0.7907, 0.2618, 0.8104]}, {"w": "to", "b": [0.2681, 0.7907, 0.2878, 0.8104]}, {"w": "best", "b": [0.2941, 0.7907, 0.3347, 0.8104]}, {"w": "the", "b": [0.341, 0.7907, 0.3718, 0.8104]}, {"w": "other.", "b": [0.3781, 0.7907, 0.4348, 0.8104]}, {"w": "As", "b": [0.4411, 0.7907, 0.4692, 0.8104]}, {"w": "such,", "b": [0.4755, 0.7907, 0.528, 0.8104]}, {"w": "a", "b": [0.5343, 0.7907, 0.5455, 0.8104]}, {"w": "GAN", "b": [0.5518, 0.7907, 0.6065, 0.8104]}, {"w": "is", "b": [0.6128, 0.7907, 0.6296, 0.8104]}, {"w": "made", "b": [0.6359, 0.7907, 0.6906, 0.8104]}, {"w": "of", "b": [0.6969, 0.7907, 0.7179, 0.8104]}, {"w": "two", "b": [0.7242, 0.7907, 0.762, 0.8104]}, {"w": "parts:", "b": [0.7683, 0.7907, 0.8244, 0.8104]}]}, {"id": "b_8", "type": "paragraph", "text": "Generator network— Takes as input a random vector (a random point in the latent space), and decodes it into a synthetic image Discriminator network (or adversary)— Takes as input an image (real or synthetic), and predicts whether the image came from the", "words": [{"w": "Generator", "b": [0.1799, 0.829, 0.2864, 0.8488]}, {"w": "network—", "b": [0.2927, 0.829, 0.402, 0.8488]}, {"w": "Takes", "b": [0.4083, 0.829, 0.4668, 0.8488]}, {"w": "as", "b": [0.4731, 0.829, 0.4941, 0.8488]}, {"w": "input", "b": [0.5004, 0.829, 0.5523, 0.8488]}, {"w": "a", "b": [0.5586, 0.829, 0.5698, 0.8488]}, {"w": "random", "b": [0.5761, 0.829, 0.6531, 0.8488]}, {"w": "vector", "b": [0.6594, 0.829, 0.7225, 0.8488]}, {"w": "(a", "b": [0.7288, 0.829, 0.7484, 0.8488]}, {"w": "random", "b": [0.7547, 0.829, 0.8318, 0.8488]}, {"w": "point", "b": [0.1799, 0.8495, 0.2317, 0.8693]}, {"w": "in", "b": [0.238, 0.8495, 0.2577, 0.8693]}, {"w": "the", "b": [0.264, 0.8495, 0.2948, 0.8693]}, {"w": "latent", "b": [0.3011, 0.8495, 0.3572, 0.8693]}, {"w": "space),", "b": [0.3635, 0.8495, 0.4342, 0.8693]}, {"w": "and", "b": [0.4405, 0.8495, 0.4769, 0.8693]}, {"w": "decodes", "b": [0.4832, 0.8495, 0.5645, 0.8693]}, {"w": "it", "b": [0.5708, 0.8495, 0.5848, 0.8693]}, {"w": "into", "b": [0.5911, 0.8495, 0.6304, 0.8693]}, {"w": "a", "b": [0.6367, 0.8495, 0.6479, 0.8693]}, {"w": "synthetic", "b": [0.6542, 0.8495, 0.7453, 0.8693]}, {"w": "image", "b": [0.7516, 0.8495, 0.8132, 0.8693]}, {"w": "Discriminator", "b": [0.1799, 0.87, 0.3256, 0.8898]}, {"w": "network", "b": [0.3319, 0.87, 0.4161, 0.8898]}, {"w": "(or", "b": [0.4224, 0.87, 0.4532, 0.8898]}, {"w": "adversary)—", "b": [0.4595, 0.87, 0.594, 0.8898]}, {"w": "Takes", "b": [0.6003, 0.87, 0.6588, 0.8898]}, {"w": "as", "b": [0.6651, 0.87, 0.6861, 0.8898]}, {"w": "input", "b": [0.6924, 0.87, 0.7443, 0.8898]}, {"w": "an", "b": [0.7506, 0.87, 0.7744, 0.8898]}, {"w": "image", "b": [0.7807, 0.87, 0.8423, 0.8898]}, {"w": "(real", "b": [0.1799, 0.8905, 0.2261, 0.9103]}, {"w": "or", "b": [0.2324, 0.8905, 0.2534, 0.9103]}, {"w": "synthetic),", "b": [0.2597, 0.8905, 0.3655, 0.9103]}, {"w": "and", "b": [0.3718, 0.8905, 0.4082, 0.9103]}, {"w": "predicts", "b": [0.4145, 0.8905, 0.4944, 0.9103]}, {"w": "whether", "b": [0.5007, 0.8905, 0.582, 0.9103]}, {"w": "the", "b": [0.5883, 0.8905, 0.6191, 0.9103]}, {"w": "image", "b": [0.6254, 0.8905, 0.6871, 0.9103]}, {"w": "came", "b": [0.6934, 0.8905, 0.7466, 0.9103]}, {"w": "from", "b": [0.7529, 0.8905, 0.8019, 0.9103]}, {"w": "the", "b": [0.8082, 0.8905, 0.8391, 0.9103]}]}]}, {"page": 400, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "training set or was created by the generator network.", "words": [{"w": "training", "b": [0.1799, 0.0857, 0.2583, 0.1054]}, {"w": "set", "b": [0.2646, 0.0857, 0.2927, 0.1054]}, {"w": "or", "b": [0.299, 0.0857, 0.32, 0.1054]}, {"w": "was", "b": [0.3263, 0.0857, 0.3655, 0.1054]}, {"w": "created", "b": [0.3718, 0.0857, 0.4447, 0.1054]}, {"w": "by", "b": [0.451, 0.0857, 0.4762, 0.1054]}, {"w": "the", "b": [0.4825, 0.0857, 0.5133, 0.1054]}, {"w": "generator", "b": [0.5196, 0.0857, 0.6148, 0.1054]}, {"w": "network.", "b": [0.6211, 0.0857, 0.7101, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "The generator network is trained to be able to fool the discriminator network, and thus it evolves toward generating increasingly realistic images as training goes on: artificial images that look indistinguishable from real ones, to the extent that it’s impossible for the discriminator network to tell the two apart (see figure 8.15). Meanwhile, the discriminator is constantly adapting to the gradually improving capabilities of the generator, setting a high bar of realism for the generated images. Once training is over, the generator is capable of turning any point in its input space into a believable image. Unlike VAEs, this latent space has fewer explicit guarantees of meaningful structure; in particular, it isn’t continuous.", "words": [{"w": "The", "b": [0.1294, 0.1285, 0.1686, 0.1482]}, {"w": "generator", "b": [0.1749, 0.1285, 0.2702, 0.1482]}, {"w": "network", "b": [0.2765, 0.1285, 0.3592, 0.1482]}, {"w": "is", "b": [0.3655, 0.1285, 0.3823, 0.1482]}, {"w": "trained", "b": [0.3886, 0.1285, 0.4587, 0.1482]}, {"w": "to", "b": [0.465, 0.1285, 0.4846, 0.1482]}, {"w": "be", "b": [0.4909, 0.1285, 0.5147, 0.1482]}, {"w": "able", "b": [0.521, 0.1285, 0.563, 0.1482]}, {"w": "to", "b": [0.5693, 0.1285, 0.589, 0.1482]}, {"w": "fool", "b": [0.5953, 0.1285, 0.6359, 0.1482]}, {"w": "the", "b": [0.6422, 0.1285, 0.6731, 0.1482]}, {"w": "discriminator", "b": [0.6794, 0.1285, 0.8139, 0.1482]}, {"w": "network,", "b": [0.1294, 0.149, 0.2184, 0.1687]}, {"w": "and", "b": [0.2247, 0.149, 0.2611, 0.1687]}, {"w": "thus", "b": [0.2674, 0.149, 0.3095, 0.1687]}, {"w": "it", "b": [0.3158, 0.149, 0.3298, 0.1687]}, {"w": "evolves", "b": [0.3361, 0.149, 0.4132, 0.1687]}, {"w": "toward", "b": [0.4195, 0.149, 0.4895, 0.1687]}, {"w": "generating", "b": [0.4958, 0.149, 0.6023, 0.1687]}, {"w": "increasingly", "b": [0.6086, 0.149, 0.7319, 0.1687]}, {"w": "realistic", "b": [0.7382, 0.149, 0.818, 0.1687]}, {"w": "images", "b": [0.1294, 0.1695, 0.2009, 0.1892]}, {"w": "as", "b": [0.2072, 0.1695, 0.2282, 0.1892]}, {"w": "training", "b": [0.2345, 0.1695, 0.313, 0.1892]}, {"w": "goes", "b": [0.3193, 0.1695, 0.3655, 0.1892]}, {"w": "on:", "b": [0.3718, 0.1695, 0.4041, 0.1892]}, {"w": "artificial", "b": [0.4104, 0.1695, 0.4958, 0.1892]}, {"w": "images", "b": [0.5021, 0.1695, 0.5736, 0.1892]}, {"w": "that", "b": [0.5799, 0.1695, 0.6178, 0.1892]}, {"w": "look", "b": [0.6241, 0.1695, 0.6689, 0.1892]}, {"w": "indistinguishable", "b": [0.6752, 0.1695, 0.8476, 0.1892]}, {"w": "from", "b": [0.1294, 0.19, 0.1785, 0.2097]}, {"w": "real", "b": [0.1848, 0.19, 0.2226, 0.2097]}, {"w": "ones,", "b": [0.2289, 0.19, 0.2814, 0.2097]}, {"w": "to", "b": [0.2877, 0.19, 0.3074, 0.2097]}, {"w": "the", "b": [0.3137, 0.19, 0.3445, 0.2097]}, {"w": "extent", "b": [0.3508, 0.19, 0.4124, 0.2097]}, {"w": "that", "b": [0.4188, 0.19, 0.4566, 0.2097]}, {"w": "it’s", "b": [0.4629, 0.19, 0.4937, 0.2097]}, {"w": "impossible", "b": [0.5, 0.19, 0.6093, 0.2097]}, {"w": "for", "b": [0.6156, 0.19, 0.645, 0.2097]}, {"w": "the", "b": [0.6513, 0.19, 0.6822, 0.2097]}, {"w": "discriminator", "b": [0.6885, 0.19, 0.823, 0.2097]}, {"w": "network", "b": [0.1294, 0.2105, 0.2121, 0.2302]}, {"w": "to", "b": [0.2184, 0.2105, 0.238, 0.2302]}, {"w": "tell", "b": [0.2443, 0.2105, 0.2766, 0.2302]}, {"w": "the", "b": [0.2829, 0.2105, 0.3137, 0.2302]}, {"w": "two", "b": [0.32, 0.2105, 0.3578, 0.2302]}, {"w": "apart", "b": [0.3641, 0.2105, 0.4146, 0.2302]}, {"w": "(see", "b": [0.4209, 0.2105, 0.4615, 0.2302]}, {"w": "figure", "b": [0.4677, 0.2105, 0.528, 0.2302]}, {"w": "8.15).", "b": [0.5343, 0.2105, 0.5931, 0.2302]}, {"w": "Meanwhile,", "b": [0.5994, 0.2105, 0.7192, 0.2302]}, {"w": "the", "b": [0.7255, 0.2105, 0.7564, 0.2302]}, {"w": "discriminator", "b": [0.1294, 0.231, 0.2639, 0.2507]}, {"w": "is", "b": [0.2702, 0.231, 0.2871, 0.2507]}, {"w": "constantly", "b": [0.2934, 0.231, 0.3971, 0.2507]}, {"w": "adapting", "b": [0.4034, 0.231, 0.4903, 0.2507]}, {"w": "to", "b": [0.4966, 0.231, 0.5162, 0.2507]}, {"w": "the", "b": [0.5225, 0.231, 0.5533, 0.2507]}, {"w": "gradually", "b": [0.5596, 0.231, 0.6549, 0.2507]}, {"w": "improving", "b": [0.6612, 0.231, 0.7663, 0.2507]}, {"w": "capabilities", "b": [0.1294, 0.2515, 0.2443, 0.2712]}, {"w": "of", "b": [0.2506, 0.2515, 0.2716, 0.2712]}, {"w": "the", "b": [0.2779, 0.2515, 0.3088, 0.2712]}, {"w": "generator,", "b": [0.3151, 0.2515, 0.4156, 0.2712]}, {"w": "setting", "b": [0.4219, 0.2515, 0.4892, 0.2712]}, {"w": "a", "b": [0.4955, 0.2515, 0.5067, 0.2712]}, {"w": "high", "b": [0.5129, 0.2515, 0.5578, 0.2712]}, {"w": "bar", "b": [0.5641, 0.2515, 0.5963, 0.2712]}, {"w": "of", "b": [0.6026, 0.2515, 0.6236, 0.2712]}, {"w": "realism", "b": [0.6299, 0.2515, 0.7042, 0.2712]}, {"w": "for", "b": [0.7105, 0.2515, 0.7399, 0.2712]}, {"w": "the", "b": [0.7462, 0.2515, 0.7771, 0.2712]}, {"w": "generated", "b": [0.1294, 0.272, 0.2275, 0.2917]}, {"w": "images.", "b": [0.2338, 0.272, 0.3115, 0.2917]}, {"w": "Once", "b": [0.3178, 0.272, 0.3711, 0.2917]}, {"w": "training", "b": [0.3774, 0.272, 0.4559, 0.2917]}, {"w": "is", "b": [0.4622, 0.272, 0.479, 0.2917]}, {"w": "over,", "b": [0.4853, 0.272, 0.5354, 0.2917]}, {"w": "the", "b": [0.5417, 0.272, 0.5725, 0.2917]}, {"w": "generator", "b": [0.5788, 0.272, 0.6741, 0.2917]}, {"w": "is", "b": [0.6804, 0.272, 0.6972, 0.2917]}, {"w": "capable", "b": [0.7035, 0.272, 0.7805, 0.2917]}, {"w": "of", "b": [0.7868, 0.272, 0.8079, 0.2917]}, {"w": "turning", "b": [0.1294, 0.2925, 0.2023, 0.3122]}, {"w": "any", "b": [0.2086, 0.2925, 0.245, 0.3122]}, {"w": "point", "b": [0.2513, 0.2925, 0.3032, 0.3122]}, {"w": "in", "b": [0.3095, 0.2925, 0.3291, 0.3122]}, {"w": "its", "b": [0.3354, 0.2925, 0.3593, 0.3122]}, {"w": "input", "b": [0.3655, 0.2925, 0.4174, 0.3122]}, {"w": "space", "b": [0.4237, 0.2925, 0.4797, 0.3122]}, {"w": "into", "b": [0.486, 0.2925, 0.5253, 0.3122]}, {"w": "a", "b": [0.5316, 0.2925, 0.5428, 0.3122]}, {"w": "believable", "b": [0.5491, 0.2925, 0.6528, 0.3122]}, {"w": "image.", "b": [0.6591, 0.2925, 0.727, 0.3122]}, {"w": "Unlike", "b": [0.7333, 0.2925, 0.802, 0.3122]}, {"w": "VAEs,", "b": [0.1294, 0.313, 0.1941, 0.3327]}, {"w": "this", "b": [0.2004, 0.313, 0.2369, 0.3327]}, {"w": "latent", "b": [0.2432, 0.313, 0.2992, 0.3327]}, {"w": "space", "b": [0.3055, 0.313, 0.3616, 0.3327]}, {"w": "has", "b": [0.3679, 0.313, 0.4015, 0.3327]}, {"w": "fewer", "b": [0.4078, 0.313, 0.4652, 0.3327]}, {"w": "explicit", "b": [0.4715, 0.313, 0.5472, 0.3327]}, {"w": "guarantees", "b": [0.5535, 0.313, 0.6614, 0.3327]}, {"w": "of", "b": [0.6677, 0.313, 0.6887, 0.3327]}, {"w": "meaningful", "b": [0.695, 0.313, 0.8099, 0.3327]}, {"w": "structure;", "b": [0.1294, 0.3335, 0.2247, 0.3532]}, {"w": "in", "b": [0.231, 0.3335, 0.2506, 0.3532]}, {"w": "particular,", "b": [0.2569, 0.3335, 0.3588, 0.3532]}, {"w": "it", "b": [0.3651, 0.3335, 0.3792, 0.3532]}, {"w": "isn’t", "b": [0.3855, 0.3335, 0.4299, 0.3532]}, {"w": "continuous.", "b": [0.4362, 0.3335, 0.5532, 0.3532]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 8.15. A generator transforms random latent vectors into images, and a discriminator seeks to tell real images from generated ones. The generator is trained to fool the discriminator.", "words": [{"w": "Figure", "b": [0.1294, 0.3758, 0.1827, 0.3906]}, {"w": "8.15.", "b": [0.1874, 0.3758, 0.2252, 0.3906]}, {"w": "A", "b": [0.2299, 0.3758, 0.2436, 0.3906]}, {"w": "generator", "b": [0.2483, 0.3758, 0.3271, 0.3906]}, {"w": "transforms", "b": [0.3319, 0.3758, 0.4212, 0.3906]}, {"w": "random", "b": [0.4259, 0.3758, 0.49, 0.3906]}, {"w": "latent", "b": [0.4948, 0.3758, 0.541, 0.3906]}, {"w": "vectors", "b": [0.5457, 0.3758, 0.6035, 0.3906]}, {"w": "into", "b": [0.6082, 0.3758, 0.6398, 0.3906]}, {"w": "images,", "b": [0.6445, 0.3758, 0.7049, 0.3906]}, {"w": "and", "b": [0.7097, 0.3758, 0.7402, 0.3906]}, {"w": "a", "b": [0.7449, 0.3758, 0.7543, 0.3906]}, {"w": "discriminator", "b": [0.7591, 0.3758, 0.8694, 0.3906]}, {"w": "seeks", "b": [0.1294, 0.3909, 0.1715, 0.4057]}, {"w": "to", "b": [0.1762, 0.3909, 0.1919, 0.4057]}, {"w": "tell", "b": [0.1967, 0.3909, 0.2219, 0.4057]}, {"w": "real", "b": [0.2266, 0.3909, 0.2578, 0.4057]}, {"w": "images", "b": [0.2625, 0.3909, 0.3182, 0.4057]}, {"w": "from", "b": [0.3229, 0.3909, 0.3625, 0.4057]}, {"w": "generated", "b": [0.3672, 0.3909, 0.4471, 0.4057]}, {"w": "ones.", "b": [0.4518, 0.3909, 0.4923, 0.4057]}, {"w": "The", "b": [0.497, 0.3909, 0.5286, 0.4057]}, {"w": "generator", "b": [0.5333, 0.3909, 0.6121, 0.4057]}, {"w": "is", "b": [0.6168, 0.3909, 0.6294, 0.4057]}, {"w": "trained", "b": [0.6342, 0.3909, 0.693, 0.4057]}, {"w": "to", "b": [0.6978, 0.3909, 0.7135, 0.4057]}, {"w": "fool", "b": [0.7182, 0.3909, 0.7487, 0.4057]}, {"w": "the", "b": [0.7535, 0.3909, 0.7787, 0.4057]}, {"w": "discriminator.", "b": [0.1294, 0.4061, 0.2428, 0.4209]}]}, {"id": "b_3", "type": "paragraph", "text": "Remarkably, a GAN is a system where the optimization minimum isn’t fixed, unlike in any other training setup you’ve encountered in this book. Normally, gradient descent consists of rolling down hills in a static loss landscape. But with a GAN, every step taken down the hill changes the entire landscape a little. It’s a dynamic system where the optimization process is seeking not a minimum, but an equilibrium between two forces. For this reason, GANs are notoriously difficult to train—getting a GAN to work requires lots of careful tuning of the model architecture and training parameters.", "words": [{"w": "Remarkably,", "b": [0.1294, 0.7051, 0.2574, 0.7249]}, {"w": "a", "b": [0.2637, 0.7051, 0.2749, 0.7249]}, {"w": "GAN", "b": [0.2812, 0.7051, 0.3358, 0.7249]}, {"w": "is", "b": [0.3421, 0.7051, 0.3589, 0.7249]}, {"w": "a", "b": [0.3653, 0.7051, 0.3765, 0.7249]}, {"w": "system", "b": [0.3828, 0.7051, 0.4528, 0.7249]}, {"w": "where", "b": [0.4591, 0.7051, 0.5208, 0.7249]}, {"w": "the", "b": [0.5271, 0.7051, 0.5579, 0.7249]}, {"w": "optimization", "b": [0.5642, 0.7051, 0.6918, 0.7249]}, {"w": "minimum", "b": [0.6981, 0.7051, 0.7962, 0.7249]}, {"w": "isn’t", "b": [0.8025, 0.7051, 0.8468, 0.7249]}, {"w": "fixed,", "b": [0.1294, 0.7256, 0.1876, 0.7454]}, {"w": "unlike", "b": [0.1939, 0.7256, 0.2569, 0.7454]}, {"w": "in", "b": [0.2632, 0.7256, 0.2829, 0.7454]}, {"w": "any", "b": [0.2892, 0.7256, 0.3256, 0.7454]}, {"w": "other", "b": [0.3319, 0.7256, 0.3837, 0.7454]}, {"w": "training", "b": [0.39, 0.7256, 0.4685, 0.7454]}, {"w": "setup", "b": [0.4748, 0.7256, 0.5281, 0.7454]}, {"w": "you’ve", "b": [0.5344, 0.7256, 0.6044, 0.7454]}, {"w": "encountered", "b": [0.6107, 0.7256, 0.734, 0.7454]}, {"w": "in", "b": [0.7402, 0.7256, 0.7599, 0.7454]}, {"w": "this", "b": [0.7662, 0.7256, 0.8026, 0.7454]}, {"w": "book.", "b": [0.8089, 0.7256, 0.8657, 0.7454]}, {"w": "Normally,", "b": [0.1294, 0.7461, 0.2308, 0.7659]}, {"w": "gradient", "b": [0.2371, 0.7461, 0.3197, 0.7659]}, {"w": "descent", "b": [0.326, 0.7461, 0.4017, 0.7659]}, {"w": "consists", "b": [0.408, 0.7461, 0.4879, 0.7659]}, {"w": "of", "b": [0.4942, 0.7461, 0.5152, 0.7659]}, {"w": "rolling", "b": [0.5215, 0.7461, 0.5888, 0.7659]}, {"w": "down", "b": [0.5951, 0.7461, 0.6511, 0.7659]}, {"w": "hills", "b": [0.6575, 0.7461, 0.7009, 0.7659]}, {"w": "in", "b": [0.7072, 0.7461, 0.7268, 0.7659]}, {"w": "a", "b": [0.7332, 0.7461, 0.7444, 0.7659]}, {"w": "static", "b": [0.7507, 0.7461, 0.8039, 0.7659]}, {"w": "loss", "b": [0.8102, 0.7461, 0.8495, 0.7659]}, {"w": "landscape.", "b": [0.1294, 0.7666, 0.2352, 0.7864]}, {"w": "But", "b": [0.2415, 0.7666, 0.2779, 0.7864]}, {"w": "with", "b": [0.2842, 0.7666, 0.3291, 0.7864]}, {"w": "a", "b": [0.3354, 0.7666, 0.3466, 0.7864]}, {"w": "GAN,", "b": [0.3529, 0.7666, 0.4139, 0.7864]}, {"w": "every", "b": [0.4202, 0.7666, 0.4762, 0.7864]}, {"w": "step", "b": [0.4825, 0.7666, 0.5231, 0.7864]}, {"w": "taken", "b": [0.5294, 0.7666, 0.5841, 0.7864]}, {"w": "down", "b": [0.5904, 0.7666, 0.6464, 0.7864]}, {"w": "the", "b": [0.6527, 0.7666, 0.6835, 0.7864]}, {"w": "hill", "b": [0.6899, 0.7666, 0.7235, 0.7864]}, {"w": "changes", "b": [0.7298, 0.7666, 0.8111, 0.7864]}, {"w": "the", "b": [0.8174, 0.7666, 0.8482, 0.7864]}, {"w": "entire", "b": [0.1294, 0.7871, 0.1869, 0.8069]}, {"w": "landscape", "b": [0.1932, 0.7871, 0.2926, 0.8069]}, {"w": "a", "b": [0.2989, 0.7871, 0.3101, 0.8069]}, {"w": "little.", "b": [0.3164, 0.7871, 0.369, 0.8069]}, {"w": "It’s", "b": [0.3753, 0.7871, 0.4075, 0.8069]}, {"w": "a", "b": [0.4138, 0.7871, 0.425, 0.8069]}, {"w": "dynamic", "b": [0.4313, 0.7871, 0.5182, 0.8069]}, {"w": "system", "b": [0.5245, 0.7871, 0.5946, 0.8069]}, {"w": "where", "b": [0.6009, 0.7871, 0.6625, 0.8069]}, {"w": "the", "b": [0.6688, 0.7871, 0.6996, 0.8069]}, {"w": "optimization", "b": [0.7059, 0.7871, 0.8335, 0.8069]}, {"w": "process", "b": [0.1294, 0.8076, 0.2051, 0.8274]}, {"w": "is", "b": [0.2114, 0.8076, 0.2282, 0.8274]}, {"w": "seeking", "b": [0.2345, 0.8076, 0.3116, 0.8274]}, {"w": "not", "b": [0.3179, 0.8076, 0.3501, 0.8274]}, {"w": "a", "b": [0.3564, 0.8076, 0.3676, 0.8274]}, {"w": "minimum,", "b": [0.3739, 0.8076, 0.4783, 0.8274]}, {"w": "but", "b": [0.4846, 0.8076, 0.5169, 0.8274]}, {"w": "an", "b": [0.5232, 0.8076, 0.547, 0.8274]}, {"w": "equilibrium", "b": [0.5533, 0.8076, 0.671, 0.8274]}, {"w": "between", "b": [0.6773, 0.8076, 0.7614, 0.8274]}, {"w": "two", "b": [0.7677, 0.8076, 0.8055, 0.8274]}, {"w": "forces.", "b": [0.1294, 0.8281, 0.1973, 0.8479]}, {"w": "For", "b": [0.2037, 0.8281, 0.2387, 0.8479]}, {"w": "this", "b": [0.245, 0.8281, 0.2814, 0.8479]}, {"w": "reason,", "b": [0.2878, 0.8281, 0.3599, 0.8479]}, {"w": "GANs", "b": [0.3662, 0.8281, 0.4307, 0.8479]}, {"w": "are", "b": [0.437, 0.8281, 0.4678, 0.8479]}, {"w": "notoriously", "b": [0.4741, 0.8281, 0.589, 0.8479]}, {"w": "difficult", "b": [0.5953, 0.8281, 0.6761, 0.8479]}, {"w": "to", "b": [0.6824, 0.8281, 0.702, 0.8479]}, {"w": "train—getting", "b": [0.7084, 0.8281, 0.8499, 0.8479]}, {"w": "a", "b": [0.8562, 0.8281, 0.8674, 0.8479]}, {"w": "GAN", "b": [0.1294, 0.8486, 0.1841, 0.8684]}, {"w": "to", "b": [0.1904, 0.8486, 0.21, 0.8684]}, {"w": "work", "b": [0.2163, 0.8486, 0.2681, 0.8684]}, {"w": "requires", "b": [0.2744, 0.8486, 0.3557, 0.8684]}, {"w": "lots", "b": [0.362, 0.8486, 0.3985, 0.8684]}, {"w": "of", "b": [0.4048, 0.8486, 0.4258, 0.8684]}, {"w": "careful", "b": [0.4321, 0.8486, 0.5021, 0.8684]}, {"w": "tuning", "b": [0.5084, 0.8486, 0.5729, 0.8684]}, {"w": "of", "b": [0.5792, 0.8486, 0.6002, 0.8684]}, {"w": "the", "b": [0.6065, 0.8486, 0.6373, 0.8684]}, {"w": "model", "b": [0.6436, 0.8486, 0.7067, 0.8684]}, {"w": "architecture", "b": [0.713, 0.8486, 0.8321, 0.8684]}, {"w": "and", "b": [0.1294, 0.8691, 0.1658, 0.8889]}, {"w": "training", "b": [0.1721, 0.8691, 0.2506, 0.8889]}, {"w": "parameters.", "b": [0.2569, 0.8691, 0.3739, 0.8889]}]}]}, {"page": 401, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 8.16. Latent space dwellers. Images generated by Mike Tyka using a multistaged GAN trained on a dataset of faces (www.miketyka.com).", "words": [{"w": "Figure", "b": [0.1294, 0.0852, 0.1827, 0.1]}, {"w": "8.16.", "b": [0.1874, 0.0852, 0.2252, 0.1]}, {"w": "Latent", "b": [0.2299, 0.0852, 0.2835, 0.1]}, {"w": "space", "b": [0.2883, 0.0852, 0.3324, 0.1]}, {"w": "dwellers.", "b": [0.3371, 0.0852, 0.4091, 0.1]}, {"w": "Images", "b": [0.4139, 0.0852, 0.4717, 0.1]}, {"w": "generated", "b": [0.4764, 0.0852, 0.5562, 0.1]}, {"w": "by", "b": [0.561, 0.0852, 0.581, 0.1]}, {"w": "Mike", "b": [0.5857, 0.0852, 0.6277, 0.1]}, {"w": "Tyka", "b": [0.6324, 0.0852, 0.6731, 0.1]}, {"w": "using", "b": [0.6778, 0.0852, 0.7209, 0.1]}, {"w": "a", "b": [0.7257, 0.0852, 0.7351, 0.1]}, {"w": "multistaged", "b": [0.7399, 0.0852, 0.8345, 0.1]}, {"w": "GAN", "b": [0.1294, 0.1003, 0.1715, 0.1151]}, {"w": "trained", "b": [0.1762, 0.1003, 0.235, 0.1151]}, {"w": "on", "b": [0.2398, 0.1003, 0.2597, 0.1151]}, {"w": "a", "b": [0.2645, 0.1003, 0.2739, 0.1151]}, {"w": "dataset", "b": [0.2787, 0.1003, 0.3365, 0.1151]}, {"w": "of", "b": [0.3412, 0.1003, 0.357, 0.1151]}, {"w": "faces", "b": [0.3617, 0.1003, 0.4016, 0.1151]}, {"w": "(www.miketyka.com).", "b": [0.4063, 0.1003, 0.5823, 0.1151]}]}, {"id": "b_1", "type": "paragraph", "text": "8.5.1. A schematic GAN implementation", "words": [{"w": "8.5.1.", "b": [0.1294, 0.3522, 0.1862, 0.3719]}, {"w": "A", "b": [0.1925, 0.3522, 0.2107, 0.3719]}, {"w": "schematic", "b": [0.217, 0.3522, 0.3235, 0.3719]}, {"w": "GAN", "b": [0.3298, 0.3522, 0.3858, 0.3719]}, {"w": "implementation", "b": [0.3921, 0.3522, 0.5617, 0.3719]}]}, {"id": "b_2", "type": "paragraph", "text": "In this section, we’ll explain how to implement a GAN in Keras, in its barest form—because GANs are advanced, diving deeply into the technical details would be out of scope for this book. The specific implementation is a deep convolutional GAN (DCGAN): a GAN where the generator and discriminator are deep convnets. In particular, it uses a Conv2DTranspose layer for image upsampling in the generator.", "words": [{"w": "In", "b": [0.1294, 0.395, 0.1504, 0.4147]}, {"w": "this", "b": [0.1567, 0.395, 0.1932, 0.4147]}, {"w": "section,", "b": [0.1995, 0.395, 0.2773, 0.4147]}, {"w": "we’ll", "b": [0.2836, 0.395, 0.3354, 0.4147]}, {"w": "explain", "b": [0.3417, 0.395, 0.416, 0.4147]}, {"w": "how", "b": [0.4223, 0.395, 0.4657, 0.4147]}, {"w": "to", "b": [0.472, 0.395, 0.4917, 0.4147]}, {"w": "implement", "b": [0.498, 0.395, 0.6059, 0.4147]}, {"w": "a", "b": [0.6122, 0.395, 0.6234, 0.4147]}, {"w": "GAN", "b": [0.6297, 0.395, 0.6843, 0.4147]}, {"w": "in", "b": [0.6906, 0.395, 0.7103, 0.4147]}, {"w": "Keras,", "b": [0.7166, 0.395, 0.7817, 0.4147]}, {"w": "in", "b": [0.788, 0.395, 0.8076, 0.4147]}, {"w": "its", "b": [0.8139, 0.395, 0.8378, 0.4147]}, {"w": "barest", "b": [0.1294, 0.4155, 0.1897, 0.4352]}, {"w": "form—because", "b": [0.196, 0.4155, 0.3501, 0.4352]}, {"w": "GANs", "b": [0.3564, 0.4155, 0.4208, 0.4352]}, {"w": "are", "b": [0.4271, 0.4155, 0.4579, 0.4352]}, {"w": "advanced,", "b": [0.4642, 0.4155, 0.5658, 0.4352]}, {"w": "diving", "b": [0.5721, 0.4155, 0.6366, 0.4352]}, {"w": "deeply", "b": [0.6429, 0.4155, 0.7101, 0.4352]}, {"w": "into", "b": [0.7164, 0.4155, 0.7556, 0.4352]}, {"w": "the", "b": [0.7619, 0.4155, 0.7928, 0.4352]}, {"w": "technical", "b": [0.1294, 0.436, 0.2205, 0.4557]}, {"w": "details", "b": [0.2268, 0.436, 0.2926, 0.4557]}, {"w": "would", "b": [0.299, 0.436, 0.362, 0.4557]}, {"w": "be", "b": [0.3683, 0.436, 0.3921, 0.4557]}, {"w": "out", "b": [0.3984, 0.436, 0.4307, 0.4557]}, {"w": "of", "b": [0.437, 0.436, 0.458, 0.4557]}, {"w": "scope", "b": [0.4643, 0.436, 0.5217, 0.4557]}, {"w": "for", "b": [0.5281, 0.436, 0.5575, 0.4557]}, {"w": "this", "b": [0.5638, 0.436, 0.6002, 0.4557]}, {"w": "book.", "b": [0.6065, 0.436, 0.6633, 0.4557]}, {"w": "The", "b": [0.6696, 0.436, 0.7088, 0.4557]}, {"w": "specific", "b": [0.7151, 0.436, 0.7936, 0.4557]}, {"w": "implementation", "b": [0.1294, 0.4565, 0.2878, 0.4762]}, {"w": "is", "b": [0.2941, 0.4565, 0.3109, 0.4762]}, {"w": "a", "b": [0.3172, 0.4565, 0.3284, 0.4762]}, {"w": "deep", "b": [0.3347, 0.4565, 0.3823, 0.4762]}, {"w": "convolutional", "b": [0.3886, 0.4565, 0.5273, 0.4762]}, {"w": "GAN", "b": [0.5336, 0.4565, 0.5841, 0.4762]}, {"w": "(DCGAN):", "b": [0.5904, 0.4565, 0.7039, 0.4762]}, {"w": "a", "b": [0.7102, 0.4565, 0.7214, 0.4762]}, {"w": "GAN", "b": [0.7277, 0.4565, 0.7823, 0.4762]}, {"w": "where", "b": [0.7886, 0.4565, 0.8502, 0.4762]}, {"w": "the", "b": [0.1294, 0.477, 0.1602, 0.4967]}, {"w": "generator", "b": [0.1665, 0.477, 0.2618, 0.4967]}, {"w": "and", "b": [0.2681, 0.477, 0.3045, 0.4967]}, {"w": "discriminator", "b": [0.3108, 0.477, 0.4454, 0.4967]}, {"w": "are", "b": [0.4517, 0.477, 0.4825, 0.4967]}, {"w": "deep", "b": [0.4888, 0.477, 0.5364, 0.4967]}, {"w": "convnets.", "b": [0.5427, 0.477, 0.6387, 0.4967]}, {"w": "In", "b": [0.645, 0.477, 0.666, 0.4967]}, {"w": "particular,", "b": [0.6723, 0.477, 0.7742, 0.4967]}, {"w": "it", "b": [0.7805, 0.477, 0.7945, 0.4967]}, {"w": "uses", "b": [0.8008, 0.477, 0.8443, 0.4967]}, {"w": "a", "b": [0.8506, 0.477, 0.8618, 0.4967]}, {"w": "Conv2DTranspose", "b": [0.1294, 0.4985, 0.3564, 0.5187]}, {"w": "layer", "b": [0.3628, 0.4975, 0.4132, 0.5172]}, {"w": "for", "b": [0.4195, 0.4975, 0.4489, 0.5172]}, {"w": "image", "b": [0.4552, 0.4975, 0.5169, 0.5172]}, {"w": "upsampling", "b": [0.5232, 0.4975, 0.6409, 0.5172]}, {"w": "in", "b": [0.6472, 0.4975, 0.6668, 0.5172]}, {"w": "the", "b": [0.6731, 0.4975, 0.704, 0.5172]}, {"w": "generator.", "b": [0.7103, 0.4975, 0.8104, 0.5172]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ll train the GAN on images from CIFAR10, a dataset of 50,000 32 × 32 RGB images belonging to 10 classes (5,000 images per class). To make things easier, you’ll only use images belonging to the class “frog.”", "words": [{"w": "You’ll", "b": [0.1294, 0.5411, 0.1928, 0.5609]}, {"w": "train", "b": [0.1991, 0.5411, 0.2453, 0.5609]}, {"w": "the", "b": [0.2516, 0.5411, 0.2824, 0.5609]}, {"w": "GAN", "b": [0.2887, 0.5411, 0.3434, 0.5609]}, {"w": "on", "b": [0.3497, 0.5411, 0.3749, 0.5609]}, {"w": "images", "b": [0.3812, 0.5411, 0.4527, 0.5609]}, {"w": "from", "b": [0.459, 0.5411, 0.508, 0.5609]}, {"w": "CIFAR10,", "b": [0.5143, 0.5411, 0.6183, 0.5609]}, {"w": "a", "b": [0.6246, 0.5411, 0.6358, 0.5609]}, {"w": "dataset", "b": [0.6421, 0.5411, 0.7121, 0.5609]}, {"w": "of", "b": [0.7184, 0.5411, 0.7394, 0.5609]}, {"w": "50,000", "b": [0.7457, 0.5411, 0.8151, 0.5609]}, {"w": "32", "b": [0.8214, 0.5411, 0.8466, 0.5609]}, {"w": "×", "b": [0.853, 0.5411, 0.8672, 0.5609]}, {"w": "32", "b": [0.1294, 0.5616, 0.1546, 0.5814]}, {"w": "RGB", "b": [0.1609, 0.5616, 0.2128, 0.5814]}, {"w": "images", "b": [0.2191, 0.5616, 0.2906, 0.5814]}, {"w": "belonging", "b": [0.2969, 0.5616, 0.3978, 0.5814]}, {"w": "to", "b": [0.4041, 0.5616, 0.4237, 0.5814]}, {"w": "10", "b": [0.43, 0.5616, 0.4553, 0.5814]}, {"w": "classes", "b": [0.4616, 0.5616, 0.5316, 0.5814]}, {"w": "(5,000", "b": [0.5379, 0.5616, 0.6031, 0.5814]}, {"w": "images", "b": [0.6094, 0.5616, 0.6808, 0.5814]}, {"w": "per", "b": [0.6871, 0.5616, 0.7193, 0.5814]}, {"w": "class).", "b": [0.7256, 0.5616, 0.7894, 0.5814]}, {"w": "To", "b": [0.7957, 0.5616, 0.8219, 0.5814]}, {"w": "make", "b": [0.1294, 0.5821, 0.1841, 0.6019]}, {"w": "things", "b": [0.1904, 0.5821, 0.252, 0.6019]}, {"w": "easier,", "b": [0.2583, 0.5821, 0.3224, 0.6019]}, {"w": "you’ll", "b": [0.3287, 0.5821, 0.389, 0.6019]}, {"w": "only", "b": [0.3953, 0.5821, 0.4402, 0.6019]}, {"w": "use", "b": [0.4465, 0.5821, 0.4801, 0.6019]}, {"w": "images", "b": [0.4864, 0.5821, 0.5579, 0.6019]}, {"w": "belonging", "b": [0.5642, 0.5821, 0.6651, 0.6019]}, {"w": "to", "b": [0.6714, 0.5821, 0.691, 0.6019]}, {"w": "the", "b": [0.6973, 0.5821, 0.7281, 0.6019]}, {"w": "class", "b": [0.7344, 0.5821, 0.7835, 0.6019]}, {"w": "“frog.”", "b": [0.7898, 0.5821, 0.8605, 0.6019]}]}, {"id": "b_4", "type": "paragraph", "text": "Schematically, the GAN looks like this:", "words": [{"w": "Schematically,", "b": [0.1294, 0.6249, 0.277, 0.6447]}, {"w": "the", "b": [0.2833, 0.6249, 0.3141, 0.6447]}, {"w": "GAN", "b": [0.3204, 0.6249, 0.3751, 0.6447]}, {"w": "looks", "b": [0.3814, 0.6249, 0.436, 0.6447]}, {"w": "like", "b": [0.4423, 0.6249, 0.4802, 0.6447]}, {"w": "this:", "b": [0.4865, 0.6249, 0.5299, 0.6447]}]}, {"id": "b_5", "type": "paragraph", "text": "1. A generator network maps vectors of shape (latent_dim,) to images of shape (32, 32, 3). 2. A discriminator network maps images of shape (32, 32, 3) to a binary score estimating the probability that the image is real. 3. A gan network chains the generator and the discriminator together: gan(x) = discriminator(generator(x)). Thus this gan network maps latent space vectors to the discriminator’s assessment of the realism of these latent vectors as decoded by the generator.", "words": [{"w": "1.", "b": [0.1551, 0.6632, 0.174, 0.683]}, {"w": "A", "b": [0.1799, 0.6632, 0.1981, 0.683]}, {"w": "generator", "b": [0.2044, 0.6643, 0.3406, 0.6845]}, {"w": "network", "b": [0.3469, 0.6632, 0.4296, 0.683]}, {"w": "maps", "b": [0.4359, 0.6632, 0.4891, 0.683]}, {"w": "vectors", "b": [0.4955, 0.6632, 0.5683, 0.683]}, {"w": "of", "b": [0.5746, 0.6632, 0.5956, 0.683]}, {"w": "shape", "b": [0.6019, 0.6632, 0.6594, 0.683]}, {"w": "(latent_dim,)", "b": [0.6657, 0.6643, 0.8624, 0.6845]}, {"w": "to", "b": [0.1799, 0.6846, 0.1995, 0.7044]}, {"w": "images", "b": [0.2058, 0.6846, 0.2773, 0.7044]}, {"w": "of", "b": [0.2836, 0.6846, 0.3046, 0.7044]}, {"w": "shape", "b": [0.3109, 0.6846, 0.3683, 0.7044]}, {"w": "(32,", "b": [0.3746, 0.6857, 0.4351, 0.7059]}, {"w": "32,", "b": [0.4503, 0.6857, 0.4957, 0.7059]}, {"w": "3).", "b": [0.5108, 0.6846, 0.5474, 0.7059]}, {"w": "2.", "b": [0.1551, 0.706, 0.174, 0.7258]}, {"w": "A", "b": [0.1799, 0.706, 0.1981, 0.7258]}, {"w": "discriminator", "b": [0.2044, 0.7071, 0.4011, 0.7273]}, {"w": "network", "b": [0.4075, 0.706, 0.4901, 0.7258]}, {"w": "maps", "b": [0.4964, 0.706, 0.5497, 0.7258]}, {"w": "images", "b": [0.556, 0.706, 0.6275, 0.7258]}, {"w": "of", "b": [0.6338, 0.706, 0.6548, 0.7258]}, {"w": "shape", "b": [0.6611, 0.706, 0.7185, 0.7258]}, {"w": "(32,", "b": [0.7248, 0.7071, 0.7853, 0.7273]}, {"w": "32,", "b": [0.8005, 0.7071, 0.8459, 0.7273]}, {"w": "3)", "b": [0.1799, 0.7285, 0.2101, 0.7487]}, {"w": "to", "b": [0.2164, 0.7274, 0.2361, 0.7472]}, {"w": "a", "b": [0.2424, 0.7274, 0.2536, 0.7472]}, {"w": "binary", "b": [0.2599, 0.7274, 0.3243, 0.7472]}, {"w": "score", "b": [0.3306, 0.7274, 0.3839, 0.7472]}, {"w": "estimating", "b": [0.3902, 0.7274, 0.4953, 0.7472]}, {"w": "the", "b": [0.5016, 0.7274, 0.5324, 0.7472]}, {"w": "probability", "b": [0.5387, 0.7274, 0.6494, 0.7472]}, {"w": "that", "b": [0.6557, 0.7274, 0.6936, 0.7472]}, {"w": "the", "b": [0.6999, 0.7274, 0.7307, 0.7472]}, {"w": "image", "b": [0.737, 0.7274, 0.7987, 0.7472]}, {"w": "is", "b": [0.805, 0.7274, 0.8218, 0.7472]}, {"w": "real.", "b": [0.1799, 0.7488, 0.224, 0.7686]}, {"w": "3.", "b": [0.1551, 0.7693, 0.174, 0.7891]}, {"w": "A", "b": [0.1799, 0.7693, 0.1981, 0.7891]}, {"w": "gan", "b": [0.2044, 0.7704, 0.2498, 0.7906]}, {"w": "network", "b": [0.2561, 0.7693, 0.3388, 0.7891]}, {"w": "chains", "b": [0.3451, 0.7693, 0.4095, 0.7891]}, {"w": "the", "b": [0.4158, 0.7693, 0.4466, 0.7891]}, {"w": "generator", "b": [0.453, 0.7693, 0.5482, 0.7891]}, {"w": "and", "b": [0.5545, 0.7693, 0.5909, 0.7891]}, {"w": "the", "b": [0.5972, 0.7693, 0.6281, 0.7891]}, {"w": "discriminator", "b": [0.6344, 0.7693, 0.7689, 0.7891]}, {"w": "together:", "b": [0.7752, 0.7693, 0.8649, 0.7891]}, {"w": "gan(x)", "b": [0.1799, 0.7918, 0.2707, 0.8119]}, {"w": "=", "b": [0.2858, 0.7918, 0.3009, 0.8119]}, {"w": "discriminator(generator(x)).", "b": [0.3161, 0.7907, 0.7311, 0.8119]}, {"w": "Thus", "b": [0.7374, 0.7907, 0.7879, 0.8104]}, {"w": "this", "b": [0.7942, 0.7907, 0.8306, 0.8104]}, {"w": "gan", "b": [0.1799, 0.8131, 0.2253, 0.8333]}, {"w": "network", "b": [0.2316, 0.8121, 0.3142, 0.8318]}, {"w": "maps", "b": [0.3205, 0.8121, 0.3738, 0.8318]}, {"w": "latent", "b": [0.3801, 0.8121, 0.4362, 0.8318]}, {"w": "space", "b": [0.4425, 0.8121, 0.4985, 0.8318]}, {"w": "vectors", "b": [0.5048, 0.8121, 0.5776, 0.8318]}, {"w": "to", "b": [0.584, 0.8121, 0.6036, 0.8318]}, {"w": "the", "b": [0.6099, 0.8121, 0.6407, 0.8318]}, {"w": "discriminator’s", "b": [0.647, 0.8121, 0.7992, 0.8318]}, {"w": "assessment", "b": [0.1799, 0.8335, 0.292, 0.8532]}, {"w": "of", "b": [0.2983, 0.8335, 0.3193, 0.8532]}, {"w": "the", "b": [0.3256, 0.8335, 0.3564, 0.8532]}, {"w": "realism", "b": [0.3627, 0.8335, 0.437, 0.8532]}, {"w": "of", "b": [0.4433, 0.8335, 0.4643, 0.8532]}, {"w": "these", "b": [0.4706, 0.8335, 0.5225, 0.8532]}, {"w": "latent", "b": [0.5288, 0.8335, 0.5848, 0.8532]}, {"w": "vectors", "b": [0.5911, 0.8335, 0.664, 0.8532]}, {"w": "as", "b": [0.6703, 0.8335, 0.6913, 0.8532]}, {"w": "decoded", "b": [0.6976, 0.8335, 0.7816, 0.8532]}, {"w": "by", "b": [0.788, 0.8335, 0.8132, 0.8532]}, {"w": "the", "b": [0.8194, 0.8335, 0.8502, 0.8532]}, {"w": "generator.", "b": [0.1799, 0.854, 0.28, 0.8737]}]}]}, {"page": 402, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4. You train the discriminator using examples of real and fake images along with “real”/“fake” labels, just as you train any regular image- classification model. 5. To train the generator, you use the gradients of the generator’s weights with regard to the loss of the gan model. This means, at every step, you move the weights of the generator in a direction that makes the discriminator more likely to classify as “real” the images decoded by the generator. In other words, you train the generator to fool the discriminator.", "words": [{"w": "4.", "b": [0.1551, 0.0857, 0.174, 0.1054]}, {"w": "You", "b": [0.1799, 0.0857, 0.2208, 0.1054]}, {"w": "train", "b": [0.2271, 0.0857, 0.2733, 0.1054]}, {"w": "the", "b": [0.2796, 0.0857, 0.3105, 0.1054]}, {"w": "discriminator", "b": [0.3168, 0.0857, 0.4513, 0.1054]}, {"w": "using", "b": [0.4576, 0.0857, 0.5123, 0.1054]}, {"w": "examples", "b": [0.5186, 0.0857, 0.6138, 0.1054]}, {"w": "of", "b": [0.6202, 0.0857, 0.6412, 0.1054]}, {"w": "real", "b": [0.6475, 0.0857, 0.6853, 0.1054]}, {"w": "and", "b": [0.6916, 0.0857, 0.728, 0.1054]}, {"w": "fake", "b": [0.7343, 0.0857, 0.7777, 0.1054]}, {"w": "images", "b": [0.784, 0.0857, 0.8555, 0.1054]}, {"w": "along", "b": [0.1799, 0.1062, 0.2359, 0.1259]}, {"w": "with", "b": [0.2422, 0.1062, 0.2871, 0.1259]}, {"w": "“real”/“fake”", "b": [0.2934, 0.1062, 0.4264, 0.1259]}, {"w": "labels,", "b": [0.4327, 0.1062, 0.4979, 0.1259]}, {"w": "just", "b": [0.5042, 0.1062, 0.5406, 0.1259]}, {"w": "as", "b": [0.5469, 0.1062, 0.568, 0.1259]}, {"w": "you", "b": [0.5743, 0.1062, 0.6121, 0.1259]}, {"w": "train", "b": [0.6184, 0.1062, 0.6647, 0.1259]}, {"w": "any", "b": [0.671, 0.1062, 0.7074, 0.1259]}, {"w": "regular", "b": [0.7136, 0.1062, 0.785, 0.1259]}, {"w": "image-", "b": [0.7914, 0.1062, 0.8614, 0.1259]}, {"w": "classification", "b": [0.1799, 0.1267, 0.313, 0.1464]}, {"w": "model.", "b": [0.3193, 0.1267, 0.3887, 0.1464]}, {"w": "5.", "b": [0.1551, 0.1472, 0.174, 0.1669]}, {"w": "To", "b": [0.1799, 0.1472, 0.2061, 0.1669]}, {"w": "train", "b": [0.2124, 0.1472, 0.2587, 0.1669]}, {"w": "the", "b": [0.265, 0.1472, 0.2958, 0.1669]}, {"w": "generator,", "b": [0.3021, 0.1472, 0.4026, 0.1669]}, {"w": "you", "b": [0.4089, 0.1472, 0.4468, 0.1669]}, {"w": "use", "b": [0.4531, 0.1472, 0.4867, 0.1669]}, {"w": "the", "b": [0.493, 0.1472, 0.5238, 0.1669]}, {"w": "gradients", "b": [0.5301, 0.1472, 0.6226, 0.1669]}, {"w": "of", "b": [0.6289, 0.1472, 0.6499, 0.1669]}, {"w": "the", "b": [0.6562, 0.1472, 0.6871, 0.1669]}, {"w": "generator’s", "b": [0.6934, 0.1472, 0.8063, 0.1669]}, {"w": "weights", "b": [0.1799, 0.1677, 0.2583, 0.1874]}, {"w": "with", "b": [0.2646, 0.1677, 0.3095, 0.1874]}, {"w": "regard", "b": [0.3158, 0.1677, 0.3802, 0.1874]}, {"w": "to", "b": [0.3865, 0.1677, 0.4062, 0.1874]}, {"w": "the", "b": [0.4125, 0.1677, 0.4433, 0.1874]}, {"w": "loss", "b": [0.4496, 0.1677, 0.4889, 0.1874]}, {"w": "of", "b": [0.4952, 0.1677, 0.5162, 0.1874]}, {"w": "the", "b": [0.5225, 0.1677, 0.5533, 0.1874]}, {"w": "gan", "b": [0.5596, 0.1687, 0.605, 0.1889]}, {"w": "model.", "b": [0.6113, 0.1677, 0.6807, 0.1874]}, {"w": "This", "b": [0.687, 0.1677, 0.7318, 0.1874]}, {"w": "means,", "b": [0.7381, 0.1677, 0.8089, 0.1874]}, {"w": "at", "b": [0.8152, 0.1677, 0.8334, 0.1874]}, {"w": "every", "b": [0.1799, 0.1891, 0.2359, 0.2088]}, {"w": "step,", "b": [0.2422, 0.1891, 0.2891, 0.2088]}, {"w": "you", "b": [0.2954, 0.1891, 0.3333, 0.2088]}, {"w": "move", "b": [0.3396, 0.1891, 0.3956, 0.2088]}, {"w": "the", "b": [0.402, 0.1891, 0.4328, 0.2088]}, {"w": "weights", "b": [0.4391, 0.1891, 0.5176, 0.2088]}, {"w": "of", "b": [0.5239, 0.1891, 0.5449, 0.2088]}, {"w": "the", "b": [0.5512, 0.1891, 0.582, 0.2088]}, {"w": "generator", "b": [0.5883, 0.1891, 0.6836, 0.2088]}, {"w": "in", "b": [0.6899, 0.1891, 0.7095, 0.2088]}, {"w": "a", "b": [0.7158, 0.1891, 0.727, 0.2088]}, {"w": "direction", "b": [0.7333, 0.1891, 0.823, 0.2088]}, {"w": "that", "b": [0.8293, 0.1891, 0.8671, 0.2088]}, {"w": "makes", "b": [0.1799, 0.2096, 0.2443, 0.2293]}, {"w": "the", "b": [0.2506, 0.2096, 0.2814, 0.2293]}, {"w": "discriminator", "b": [0.2878, 0.2096, 0.4223, 0.2293]}, {"w": "more", "b": [0.4286, 0.2096, 0.4804, 0.2293]}, {"w": "likely", "b": [0.4867, 0.2096, 0.5441, 0.2293]}, {"w": "to", "b": [0.5504, 0.2096, 0.5701, 0.2293]}, {"w": "classify", "b": [0.5764, 0.2096, 0.6534, 0.2293]}, {"w": "as", "b": [0.6597, 0.2096, 0.6808, 0.2293]}, {"w": "“real”", "b": [0.6871, 0.2096, 0.7473, 0.2293]}, {"w": "the", "b": [0.7536, 0.2096, 0.7844, 0.2293]}, {"w": "images", "b": [0.7907, 0.2096, 0.8622, 0.2293]}, {"w": "decoded", "b": [0.1799, 0.2301, 0.2639, 0.2498]}, {"w": "by", "b": [0.2702, 0.2301, 0.2954, 0.2498]}, {"w": "the", "b": [0.3018, 0.2301, 0.3326, 0.2498]}, {"w": "generator.", "b": [0.3389, 0.2301, 0.439, 0.2498]}, {"w": "In", "b": [0.4453, 0.2301, 0.4663, 0.2498]}, {"w": "other", "b": [0.4726, 0.2301, 0.5245, 0.2498]}, {"w": "words,", "b": [0.5308, 0.2301, 0.5987, 0.2498]}, {"w": "you", "b": [0.6051, 0.2301, 0.6429, 0.2498]}, {"w": "train", "b": [0.6492, 0.2301, 0.6954, 0.2498]}, {"w": "the", "b": [0.7017, 0.2301, 0.7326, 0.2498]}, {"w": "generator", "b": [0.7389, 0.2301, 0.8341, 0.2498]}, {"w": "to", "b": [0.8404, 0.2301, 0.8601, 0.2498]}, {"w": "fool", "b": [0.1799, 0.2506, 0.2205, 0.2703]}, {"w": "the", "b": [0.2268, 0.2506, 0.2576, 0.2703]}, {"w": "discriminator.", "b": [0.2639, 0.2506, 0.4033, 0.2703]}]}, {"id": "b_1", "type": "paragraph", "text": "8.5.2. A bag of tricks", "words": [{"w": "8.5.2.", "b": [0.1294, 0.2978, 0.1862, 0.3176]}, {"w": "A", "b": [0.1925, 0.2978, 0.2107, 0.3176]}, {"w": "bag", "b": [0.217, 0.2978, 0.2562, 0.3176]}, {"w": "of", "b": [0.2626, 0.2978, 0.2836, 0.3176]}, {"w": "tricks", "b": [0.2899, 0.2978, 0.3515, 0.3176]}]}, {"id": "b_2", "type": "paragraph", "text": "The process of training GANs and tuning GAN implementations is notoriously difficult. There are a number of known tricks you should keep in mind. Like most things in deep learning, it’s more alchemy than science: these tricks are heuristics, not theory-backed guidelines. They’re supported by a level of intuitive understanding of the phenomenon at hand, and they’re known to work well empirically, although not necessarily in every context.", "words": [{"w": "The", "b": [0.1294, 0.3406, 0.1686, 0.3603]}, {"w": "process", "b": [0.1749, 0.3406, 0.2506, 0.3603]}, {"w": "of", "b": [0.2569, 0.3406, 0.2779, 0.3603]}, {"w": "training", "b": [0.2842, 0.3406, 0.3627, 0.3603]}, {"w": "GANs", "b": [0.369, 0.3406, 0.4335, 0.3603]}, {"w": "and", "b": [0.4398, 0.3406, 0.4762, 0.3603]}, {"w": "tuning", "b": [0.4825, 0.3406, 0.547, 0.3603]}, {"w": "GAN", "b": [0.5533, 0.3406, 0.6079, 0.3603]}, {"w": "implementations", "b": [0.6142, 0.3406, 0.7824, 0.3603]}, {"w": "is", "b": [0.7887, 0.3406, 0.8055, 0.3603]}, {"w": "notoriously", "b": [0.1294, 0.3611, 0.2443, 0.3808]}, {"w": "difficult.", "b": [0.2506, 0.3611, 0.3378, 0.3808]}, {"w": "There", "b": [0.3441, 0.3611, 0.4029, 0.3808]}, {"w": "are", "b": [0.4092, 0.3611, 0.44, 0.3808]}, {"w": "a", "b": [0.4463, 0.3611, 0.4575, 0.3808]}, {"w": "number", "b": [0.4638, 0.3611, 0.5409, 0.3808]}, {"w": "of", "b": [0.5472, 0.3611, 0.5682, 0.3808]}, {"w": "known", "b": [0.5745, 0.3611, 0.6432, 0.3808]}, {"w": "tricks", "b": [0.6495, 0.3611, 0.7055, 0.3808]}, {"w": "you", "b": [0.7118, 0.3611, 0.7497, 0.3808]}, {"w": "should", "b": [0.7559, 0.3611, 0.8232, 0.3808]}, {"w": "keep", "b": [0.1294, 0.3816, 0.177, 0.4013]}, {"w": "in", "b": [0.1833, 0.3816, 0.203, 0.4013]}, {"w": "mind.", "b": [0.2093, 0.3816, 0.2674, 0.4013]}, {"w": "Like", "b": [0.2738, 0.3816, 0.32, 0.4013]}, {"w": "most", "b": [0.3263, 0.3816, 0.3754, 0.4013]}, {"w": "things", "b": [0.3817, 0.3816, 0.4433, 0.4013]}, {"w": "in", "b": [0.4497, 0.3816, 0.4693, 0.4013]}, {"w": "deep", "b": [0.4756, 0.3816, 0.5232, 0.4013]}, {"w": "learning,", "b": [0.5295, 0.3816, 0.6185, 0.4013]}, {"w": "it’s", "b": [0.6248, 0.3816, 0.6556, 0.4013]}, {"w": "more", "b": [0.6619, 0.3816, 0.7137, 0.4013]}, {"w": "alchemy", "b": [0.72, 0.3816, 0.8055, 0.4013]}, {"w": "than", "b": [0.8118, 0.3816, 0.8552, 0.4013]}, {"w": "science:", "b": [0.1294, 0.4021, 0.2107, 0.4218]}, {"w": "these", "b": [0.217, 0.4021, 0.2688, 0.4218]}, {"w": "tricks", "b": [0.2751, 0.4021, 0.3312, 0.4218]}, {"w": "are", "b": [0.3375, 0.4021, 0.3683, 0.4218]}, {"w": "heuristics,", "b": [0.3746, 0.4021, 0.4776, 0.4218]}, {"w": "not", "b": [0.4839, 0.4021, 0.5161, 0.4218]}, {"w": "theory-backed", "b": [0.5224, 0.4021, 0.6667, 0.4218]}, {"w": "guidelines.", "b": [0.6729, 0.4021, 0.783, 0.4218]}, {"w": "They’re", "b": [0.7893, 0.4021, 0.8691, 0.4218]}, {"w": "supported", "b": [0.1294, 0.4226, 0.2289, 0.4423]}, {"w": "by", "b": [0.2352, 0.4226, 0.2604, 0.4423]}, {"w": "a", "b": [0.2667, 0.4226, 0.2779, 0.4423]}, {"w": "level", "b": [0.2842, 0.4226, 0.3333, 0.4423]}, {"w": "of", "b": [0.3396, 0.4226, 0.3606, 0.4423]}, {"w": "intuitive", "b": [0.3669, 0.4226, 0.451, 0.4423]}, {"w": "understanding", "b": [0.4573, 0.4226, 0.6003, 0.4423]}, {"w": "of", "b": [0.6066, 0.4226, 0.6276, 0.4423]}, {"w": "the", "b": [0.6339, 0.4226, 0.6647, 0.4423]}, {"w": "phenomenon", "b": [0.671, 0.4226, 0.8013, 0.4423]}, {"w": "at", "b": [0.8076, 0.4226, 0.8258, 0.4423]}, {"w": "hand,", "b": [0.1294, 0.4431, 0.1848, 0.4628]}, {"w": "and", "b": [0.1911, 0.4431, 0.2275, 0.4628]}, {"w": "they’re", "b": [0.2338, 0.4431, 0.3052, 0.4628]}, {"w": "known", "b": [0.3115, 0.4431, 0.3802, 0.4628]}, {"w": "to", "b": [0.3865, 0.4431, 0.4061, 0.4628]}, {"w": "work", "b": [0.4124, 0.4431, 0.4643, 0.4628]}, {"w": "well", "b": [0.4706, 0.4431, 0.514, 0.4628]}, {"w": "empirically,", "b": [0.5203, 0.4431, 0.6399, 0.4628]}, {"w": "although", "b": [0.6462, 0.4431, 0.7344, 0.4628]}, {"w": "not", "b": [0.7408, 0.4431, 0.773, 0.4628]}, {"w": "necessarily", "b": [0.1294, 0.4636, 0.2415, 0.4833]}, {"w": "in", "b": [0.2478, 0.4636, 0.2674, 0.4833]}, {"w": "every", "b": [0.2737, 0.4636, 0.3298, 0.4833]}, {"w": "context.", "b": [0.3361, 0.4636, 0.4166, 0.4833]}]}, {"id": "b_3", "type": "paragraph", "text": "Here are a few of the tricks used in the implementation of the GAN generator and discriminator in this section. It isn’t an exhaustive list of GAN-related tips; you’ll find many more across the GAN literature:", "words": [{"w": "Here", "b": [0.1294, 0.5064, 0.1784, 0.5261]}, {"w": "are", "b": [0.1847, 0.5064, 0.2155, 0.5261]}, {"w": "a", "b": [0.2218, 0.5064, 0.233, 0.5261]}, {"w": "few", "b": [0.2393, 0.5064, 0.2772, 0.5261]}, {"w": "of", "b": [0.2835, 0.5064, 0.3045, 0.5261]}, {"w": "the", "b": [0.3108, 0.5064, 0.3416, 0.5261]}, {"w": "tricks", "b": [0.3479, 0.5064, 0.404, 0.5261]}, {"w": "used", "b": [0.4103, 0.5064, 0.4565, 0.5261]}, {"w": "in", "b": [0.4628, 0.5064, 0.4824, 0.5261]}, {"w": "the", "b": [0.4888, 0.5064, 0.5196, 0.5261]}, {"w": "implementation", "b": [0.5259, 0.5064, 0.6843, 0.5261]}, {"w": "of", "b": [0.6906, 0.5064, 0.7116, 0.5261]}, {"w": "the", "b": [0.7179, 0.5064, 0.7487, 0.5261]}, {"w": "GAN", "b": [0.755, 0.5064, 0.8096, 0.5261]}, {"w": "generator", "b": [0.1294, 0.5269, 0.2247, 0.5466]}, {"w": "and", "b": [0.231, 0.5269, 0.2674, 0.5466]}, {"w": "discriminator", "b": [0.2737, 0.5269, 0.4082, 0.5466]}, {"w": "in", "b": [0.4145, 0.5269, 0.4342, 0.5466]}, {"w": "this", "b": [0.4405, 0.5269, 0.4769, 0.5466]}, {"w": "section.", "b": [0.4832, 0.5269, 0.561, 0.5466]}, {"w": "It", "b": [0.5673, 0.5269, 0.5827, 0.5466]}, {"w": "isn’t", "b": [0.589, 0.5269, 0.6334, 0.5466]}, {"w": "an", "b": [0.6397, 0.5269, 0.6635, 0.5466]}, {"w": "exhaustive", "b": [0.6698, 0.5269, 0.7776, 0.5466]}, {"w": "list", "b": [0.784, 0.5269, 0.8148, 0.5466]}, {"w": "of", "b": [0.8211, 0.5269, 0.8421, 0.5466]}, {"w": "GAN-related", "b": [0.1294, 0.5474, 0.2611, 0.5671]}, {"w": "tips;", "b": [0.2674, 0.5474, 0.3109, 0.5671]}, {"w": "you’ll", "b": [0.3172, 0.5474, 0.3774, 0.5671]}, {"w": "find", "b": [0.3837, 0.5474, 0.4244, 0.5671]}, {"w": "many", "b": [0.4307, 0.5474, 0.4867, 0.5671]}, {"w": "more", "b": [0.493, 0.5474, 0.5449, 0.5671]}, {"w": "across", "b": [0.5512, 0.5474, 0.6142, 0.5671]}, {"w": "the", "b": [0.6205, 0.5474, 0.6514, 0.5671]}, {"w": "GAN", "b": [0.6577, 0.5474, 0.7123, 0.5671]}, {"w": "literature:", "b": [0.7186, 0.5474, 0.8167, 0.5671]}]}, {"id": "b_4", "type": "paragraph", "text": "We use tanh as the last activation in the generator, instead of sigmoid, which is more commonly found in other types of models. We sample points from the latent space using a normal distribution (Gaussian distribution), not a uniform distribution. Stochasticity is good to induce robustness. Because GAN training results in a dynamic equilibrium, GANs are likely to get stuck in all sorts of ways. Introducing randomness during training helps prevent this. We introduce randomness in two ways: by using dropout in the discriminator and by adding random noise to the labels for the discriminator. Sparse gradients can hinder GAN training. In deep learning, sparsity is often a desirable property, but not in GANs. Two things can induce gradient sparsity: max pooling operations and ReLU activations. Instead of max pooling, we recommend using strided", "words": [{"w": "We", "b": [0.1799, 0.5857, 0.2129, 0.6054]}, {"w": "use", "b": [0.2192, 0.5857, 0.2528, 0.6054]}, {"w": "tanh", "b": [0.2591, 0.5868, 0.3196, 0.6069]}, {"w": "as", "b": [0.3259, 0.5857, 0.3469, 0.6054]}, {"w": "the", "b": [0.3533, 0.5857, 0.3841, 0.6054]}, {"w": "last", "b": [0.3904, 0.5857, 0.4254, 0.6054]}, {"w": "activation", "b": [0.4317, 0.5857, 0.5312, 0.6054]}, {"w": "in", "b": [0.5375, 0.5857, 0.5572, 0.6054]}, {"w": "the", "b": [0.5635, 0.5857, 0.5943, 0.6054]}, {"w": "generator,", "b": [0.6006, 0.5857, 0.7011, 0.6054]}, {"w": "instead", "b": [0.7074, 0.5857, 0.7788, 0.6054]}, {"w": "of", "b": [0.7851, 0.5857, 0.8062, 0.6054]}, {"w": "sigmoid,", "b": [0.1799, 0.6071, 0.2921, 0.6283]}, {"w": "which", "b": [0.2984, 0.6071, 0.3601, 0.6268]}, {"w": "is", "b": [0.3664, 0.6071, 0.3832, 0.6268]}, {"w": "more", "b": [0.3895, 0.6071, 0.4414, 0.6268]}, {"w": "commonly", "b": [0.4477, 0.6071, 0.5556, 0.6268]}, {"w": "found", "b": [0.5619, 0.6071, 0.6207, 0.6268]}, {"w": "in", "b": [0.627, 0.6071, 0.6467, 0.6268]}, {"w": "other", "b": [0.653, 0.6071, 0.7048, 0.6268]}, {"w": "types", "b": [0.7111, 0.6071, 0.7644, 0.6268]}, {"w": "of", "b": [0.7707, 0.6071, 0.7917, 0.6268]}, {"w": "models.", "b": [0.1799, 0.6285, 0.259, 0.6482]}, {"w": "We", "b": [0.1799, 0.649, 0.2129, 0.6687]}, {"w": "sample", "b": [0.2192, 0.649, 0.2906, 0.6687]}, {"w": "points", "b": [0.2969, 0.649, 0.3586, 0.6687]}, {"w": "from", "b": [0.3649, 0.649, 0.414, 0.6687]}, {"w": "the", "b": [0.4203, 0.649, 0.4511, 0.6687]}, {"w": "latent", "b": [0.4574, 0.649, 0.5134, 0.6687]}, {"w": "space", "b": [0.5197, 0.649, 0.5758, 0.6687]}, {"w": "using", "b": [0.5821, 0.649, 0.6367, 0.6687]}, {"w": "a", "b": [0.6431, 0.649, 0.6543, 0.6687]}, {"w": "normal", "b": [0.6605, 0.649, 0.7334, 0.6687]}, {"w": "distribution", "b": [0.7397, 0.649, 0.8574, 0.6687]}, {"w": "(Gaussian", "b": [0.1799, 0.6695, 0.2807, 0.6892]}, {"w": "distribution),", "b": [0.287, 0.6695, 0.4181, 0.6892]}, {"w": "not", "b": [0.4244, 0.6695, 0.4566, 0.6892]}, {"w": "a", "b": [0.4629, 0.6695, 0.4741, 0.6892]}, {"w": "uniform", "b": [0.4805, 0.6695, 0.5617, 0.6892]}, {"w": "distribution.", "b": [0.568, 0.6695, 0.6907, 0.6892]}, {"w": "Stochasticity", "b": [0.1799, 0.69, 0.3102, 0.7097]}, {"w": "is", "b": [0.3165, 0.69, 0.3333, 0.7097]}, {"w": "good", "b": [0.3396, 0.69, 0.3901, 0.7097]}, {"w": "to", "b": [0.3964, 0.69, 0.416, 0.7097]}, {"w": "induce", "b": [0.4223, 0.69, 0.4896, 0.7097]}, {"w": "robustness.", "b": [0.4959, 0.69, 0.6087, 0.7097]}, {"w": "Because", "b": [0.615, 0.69, 0.6991, 0.7097]}, {"w": "GAN", "b": [0.7054, 0.69, 0.76, 0.7097]}, {"w": "training", "b": [0.7663, 0.69, 0.8448, 0.7097]}, {"w": "results", "b": [0.1799, 0.7105, 0.2457, 0.7302]}, {"w": "in", "b": [0.252, 0.7105, 0.2717, 0.7302]}, {"w": "a", "b": [0.278, 0.7105, 0.2892, 0.7302]}, {"w": "dynamic", "b": [0.2955, 0.7105, 0.3824, 0.7302]}, {"w": "equilibrium,", "b": [0.3887, 0.7105, 0.5127, 0.7302]}, {"w": "GANs", "b": [0.519, 0.7105, 0.5835, 0.7302]}, {"w": "are", "b": [0.5898, 0.7105, 0.6206, 0.7302]}, {"w": "likely", "b": [0.6269, 0.7105, 0.6843, 0.7302]}, {"w": "to", "b": [0.6906, 0.7105, 0.7103, 0.7302]}, {"w": "get", "b": [0.7166, 0.7105, 0.7474, 0.7302]}, {"w": "stuck", "b": [0.7536, 0.7105, 0.8069, 0.7302]}, {"w": "in", "b": [0.8132, 0.7105, 0.8328, 0.7302]}, {"w": "all", "b": [0.8391, 0.7105, 0.8643, 0.7302]}, {"w": "sorts", "b": [0.1799, 0.731, 0.2275, 0.7507]}, {"w": "of", "b": [0.2338, 0.731, 0.2548, 0.7507]}, {"w": "ways.", "b": [0.2611, 0.731, 0.3193, 0.7507]}, {"w": "Introducing", "b": [0.3256, 0.731, 0.4433, 0.7507]}, {"w": "randomness", "b": [0.4496, 0.731, 0.5701, 0.7507]}, {"w": "during", "b": [0.5764, 0.731, 0.6423, 0.7507]}, {"w": "training", "b": [0.6486, 0.731, 0.7271, 0.7507]}, {"w": "helps", "b": [0.7334, 0.731, 0.7866, 0.7507]}, {"w": "prevent", "b": [0.7929, 0.731, 0.8686, 0.7507]}, {"w": "this.", "b": [0.1799, 0.7515, 0.2226, 0.7712]}, {"w": "We", "b": [0.2289, 0.7515, 0.2619, 0.7712]}, {"w": "introduce", "b": [0.2682, 0.7515, 0.3635, 0.7712]}, {"w": "randomness", "b": [0.3698, 0.7515, 0.4903, 0.7712]}, {"w": "in", "b": [0.4966, 0.7515, 0.5162, 0.7712]}, {"w": "two", "b": [0.5225, 0.7515, 0.5604, 0.7712]}, {"w": "ways:", "b": [0.5667, 0.7515, 0.6255, 0.7712]}, {"w": "by", "b": [0.6318, 0.7515, 0.657, 0.7712]}, {"w": "using", "b": [0.6634, 0.7515, 0.718, 0.7712]}, {"w": "dropout", "b": [0.7243, 0.7515, 0.8028, 0.7712]}, {"w": "in", "b": [0.8091, 0.7515, 0.8287, 0.7712]}, {"w": "the", "b": [0.835, 0.7515, 0.8659, 0.7712]}, {"w": "discriminator", "b": [0.1799, 0.772, 0.3144, 0.7917]}, {"w": "and", "b": [0.3207, 0.772, 0.3571, 0.7917]}, {"w": "by", "b": [0.3634, 0.772, 0.3887, 0.7917]}, {"w": "adding", "b": [0.395, 0.772, 0.4636, 0.7917]}, {"w": "random", "b": [0.4699, 0.772, 0.547, 0.7917]}, {"w": "noise", "b": [0.5533, 0.772, 0.6066, 0.7917]}, {"w": "to", "b": [0.6129, 0.772, 0.6325, 0.7917]}, {"w": "the", "b": [0.6388, 0.772, 0.6696, 0.7917]}, {"w": "labels", "b": [0.6759, 0.772, 0.7348, 0.7917]}, {"w": "for", "b": [0.7411, 0.772, 0.7705, 0.7917]}, {"w": "the", "b": [0.7768, 0.772, 0.8076, 0.7917]}, {"w": "discriminator.", "b": [0.1799, 0.7925, 0.3193, 0.8122]}, {"w": "Sparse", "b": [0.1799, 0.813, 0.2471, 0.8327]}, {"w": "gradients", "b": [0.2534, 0.813, 0.3459, 0.8327]}, {"w": "can", "b": [0.3522, 0.813, 0.3872, 0.8327]}, {"w": "hinder", "b": [0.3935, 0.813, 0.458, 0.8327]}, {"w": "GAN", "b": [0.4643, 0.813, 0.5189, 0.8327]}, {"w": "training.", "b": [0.5252, 0.813, 0.61, 0.8327]}, {"w": "In", "b": [0.6163, 0.813, 0.6373, 0.8327]}, {"w": "deep", "b": [0.6436, 0.813, 0.6913, 0.8327]}, {"w": "learning,", "b": [0.6976, 0.813, 0.7865, 0.8327]}, {"w": "sparsity", "b": [0.1799, 0.8335, 0.2583, 0.8532]}, {"w": "is", "b": [0.2646, 0.8335, 0.2815, 0.8532]}, {"w": "often", "b": [0.2878, 0.8335, 0.3396, 0.8532]}, {"w": "a", "b": [0.3459, 0.8335, 0.3571, 0.8532]}, {"w": "desirable", "b": [0.3634, 0.8335, 0.4545, 0.8532]}, {"w": "property,", "b": [0.4608, 0.8335, 0.5509, 0.8532]}, {"w": "but", "b": [0.5572, 0.8335, 0.5894, 0.8532]}, {"w": "not", "b": [0.5957, 0.8335, 0.628, 0.8532]}, {"w": "in", "b": [0.6343, 0.8335, 0.6539, 0.8532]}, {"w": "GANs.", "b": [0.6602, 0.8335, 0.731, 0.8532]}, {"w": "Two", "b": [0.7373, 0.8335, 0.7818, 0.8532]}, {"w": "things", "b": [0.7881, 0.8335, 0.8498, 0.8532]}, {"w": "can", "b": [0.1799, 0.854, 0.2149, 0.8737]}, {"w": "induce", "b": [0.2212, 0.854, 0.2884, 0.8737]}, {"w": "gradient", "b": [0.2947, 0.854, 0.3774, 0.8737]}, {"w": "sparsity:", "b": [0.3837, 0.854, 0.4692, 0.8737]}, {"w": "max", "b": [0.4755, 0.854, 0.5189, 0.8737]}, {"w": "pooling", "b": [0.5253, 0.854, 0.6023, 0.8737]}, {"w": "operations", "b": [0.6087, 0.854, 0.7137, 0.8737]}, {"w": "and", "b": [0.72, 0.854, 0.7565, 0.8737]}, {"w": "ReLU", "b": [0.7627, 0.855, 0.8232, 0.8752]}, {"w": "activations.", "b": [0.1799, 0.8754, 0.2955, 0.8951]}, {"w": "Instead", "b": [0.3018, 0.8754, 0.3746, 0.8951]}, {"w": "of", "b": [0.3809, 0.8754, 0.402, 0.8951]}, {"w": "max", "b": [0.4083, 0.8754, 0.4517, 0.8951]}, {"w": "pooling,", "b": [0.458, 0.8754, 0.5414, 0.8951]}, {"w": "we", "b": [0.5477, 0.8754, 0.5771, 0.8951]}, {"w": "recommend", "b": [0.5834, 0.8754, 0.7025, 0.8951]}, {"w": "using", "b": [0.7088, 0.8754, 0.7635, 0.8951]}, {"w": "strided", "b": [0.7698, 0.8754, 0.8385, 0.8951]}]}]}, {"page": 403, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "convolutions for downsampling, and we recommend using a LeakyReLU layer instead of a ReLU activation. It’s similar to ReLU, but it relaxes sparsity constraints by allowing small negative activation values. In generated images, it’s common to see checkerboard artifacts caused by unequal coverage of the pixel space in the generator (see figure 8.17). To fix this, we use a kernel size that’s divisible by the stride size whenever we use a strided Conv2DTranpose or Conv2D in both the generator and the discriminator.", "words": [{"w": "convolutions", "b": [0.1799, 0.0857, 0.3102, 0.1054]}, {"w": "for", "b": [0.3165, 0.0857, 0.3459, 0.1054]}, {"w": "downsampling,", "b": [0.3522, 0.0857, 0.5071, 0.1054]}, {"w": "and", "b": [0.5134, 0.0857, 0.5498, 0.1054]}, {"w": "we", "b": [0.5561, 0.0857, 0.5855, 0.1054]}, {"w": "recommend", "b": [0.5919, 0.0857, 0.7109, 0.1054]}, {"w": "using", "b": [0.7172, 0.0857, 0.7719, 0.1054]}, {"w": "a", "b": [0.7782, 0.0857, 0.7894, 0.1054]}, {"w": "LeakyReLU", "b": [0.1799, 0.1072, 0.3161, 0.1274]}, {"w": "layer", "b": [0.3224, 0.1062, 0.3728, 0.1259]}, {"w": "instead", "b": [0.3791, 0.1062, 0.4506, 0.1259]}, {"w": "of", "b": [0.4569, 0.1062, 0.4779, 0.1259]}, {"w": "a", "b": [0.4842, 0.1062, 0.4954, 0.1259]}, {"w": "ReLU", "b": [0.5017, 0.1072, 0.5623, 0.1274]}, {"w": "activation.", "b": [0.5686, 0.1062, 0.6744, 0.1259]}, {"w": "It’s", "b": [0.6807, 0.1062, 0.7129, 0.1259]}, {"w": "similar", "b": [0.7192, 0.1062, 0.7892, 0.1259]}, {"w": "to", "b": [0.7956, 0.1062, 0.8152, 0.1259]}, {"w": "ReLU,", "b": [0.1799, 0.1276, 0.2467, 0.1488]}, {"w": "but", "b": [0.253, 0.1276, 0.2853, 0.1473]}, {"w": "it", "b": [0.2916, 0.1276, 0.3056, 0.1473]}, {"w": "relaxes", "b": [0.3119, 0.1276, 0.3833, 0.1473]}, {"w": "sparsity", "b": [0.3896, 0.1276, 0.4681, 0.1473]}, {"w": "constraints", "b": [0.4744, 0.1276, 0.5837, 0.1473]}, {"w": "by", "b": [0.59, 0.1276, 0.6153, 0.1473]}, {"w": "allowing", "b": [0.6216, 0.1276, 0.7099, 0.1473]}, {"w": "small", "b": [0.7162, 0.1276, 0.7708, 0.1473]}, {"w": "negative", "b": [0.7771, 0.1276, 0.8626, 0.1473]}, {"w": "activation", "b": [0.1799, 0.149, 0.2794, 0.1687]}, {"w": "values.", "b": [0.2857, 0.149, 0.3564, 0.1687]}, {"w": "In", "b": [0.1799, 0.1695, 0.2009, 0.1892]}, {"w": "generated", "b": [0.2072, 0.1695, 0.3052, 0.1892]}, {"w": "images,", "b": [0.3115, 0.1695, 0.3893, 0.1892]}, {"w": "it’s", "b": [0.3956, 0.1695, 0.4264, 0.1892]}, {"w": "common", "b": [0.4327, 0.1695, 0.521, 0.1892]}, {"w": "to", "b": [0.5273, 0.1695, 0.547, 0.1892]}, {"w": "see", "b": [0.5533, 0.1695, 0.5855, 0.1892]}, {"w": "checkerboard", "b": [0.5918, 0.1695, 0.7276, 0.1892]}, {"w": "artifacts", "b": [0.734, 0.1695, 0.8152, 0.1892]}, {"w": "caused", "b": [0.1799, 0.19, 0.2485, 0.2097]}, {"w": "by", "b": [0.2548, 0.19, 0.28, 0.2097]}, {"w": "unequal", "b": [0.2863, 0.19, 0.3662, 0.2097]}, {"w": "coverage", "b": [0.3725, 0.19, 0.4636, 0.2097]}, {"w": "of", "b": [0.4699, 0.19, 0.4909, 0.2097]}, {"w": "the", "b": [0.4972, 0.19, 0.528, 0.2097]}, {"w": "pixel", "b": [0.5343, 0.19, 0.5848, 0.2097]}, {"w": "space", "b": [0.5911, 0.19, 0.6471, 0.2097]}, {"w": "in", "b": [0.6534, 0.19, 0.673, 0.2097]}, {"w": "the", "b": [0.6793, 0.19, 0.7102, 0.2097]}, {"w": "generator", "b": [0.7165, 0.19, 0.8117, 0.2097]}, {"w": "(see", "b": [0.8179, 0.19, 0.8585, 0.2097]}, {"w": "figure", "b": [0.1799, 0.2105, 0.2401, 0.2302]}, {"w": "8.17).", "b": [0.2464, 0.2105, 0.3052, 0.2302]}, {"w": "To", "b": [0.3116, 0.2105, 0.3378, 0.2302]}, {"w": "fix", "b": [0.3441, 0.2105, 0.3721, 0.2302]}, {"w": "this,", "b": [0.3785, 0.2105, 0.4212, 0.2302]}, {"w": "we", "b": [0.4275, 0.2105, 0.4569, 0.2302]}, {"w": "use", "b": [0.4632, 0.2105, 0.4969, 0.2302]}, {"w": "a", "b": [0.5032, 0.2105, 0.5144, 0.2302]}, {"w": "kernel", "b": [0.5207, 0.2105, 0.5837, 0.2302]}, {"w": "size", "b": [0.59, 0.2105, 0.6292, 0.2302]}, {"w": "that’s", "b": [0.6356, 0.2105, 0.6902, 0.2302]}, {"w": "divisible", "b": [0.6965, 0.2105, 0.7834, 0.2302]}, {"w": "by", "b": [0.7897, 0.2105, 0.8149, 0.2302]}, {"w": "the", "b": [0.8212, 0.2105, 0.852, 0.2302]}, {"w": "stride", "b": [0.1799, 0.231, 0.2359, 0.2507]}, {"w": "size", "b": [0.2422, 0.231, 0.2814, 0.2507]}, {"w": "whenever", "b": [0.2878, 0.231, 0.3858, 0.2507]}, {"w": "we", "b": [0.3921, 0.231, 0.4215, 0.2507]}, {"w": "use", "b": [0.4278, 0.231, 0.4615, 0.2507]}, {"w": "a", "b": [0.4678, 0.231, 0.479, 0.2507]}, {"w": "strided", "b": [0.4853, 0.231, 0.5539, 0.2507]}, {"w": "Conv2DTranpose", "b": [0.5602, 0.232, 0.7721, 0.2522]}, {"w": "or", "b": [0.7784, 0.231, 0.7994, 0.2507]}, {"w": "Conv2D", "b": [0.1799, 0.2534, 0.2707, 0.2736]}, {"w": "in", "b": [0.277, 0.2524, 0.2966, 0.2721]}, {"w": "both", "b": [0.3029, 0.2524, 0.3478, 0.2721]}, {"w": "the", "b": [0.3541, 0.2524, 0.3849, 0.2721]}, {"w": "generator", "b": [0.3912, 0.2524, 0.4865, 0.2721]}, {"w": "and", "b": [0.4928, 0.2524, 0.5292, 0.2721]}, {"w": "the", "b": [0.5355, 0.2524, 0.5663, 0.2721]}, {"w": "discriminator.", "b": [0.5726, 0.2524, 0.712, 0.2721]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.17. Checkerboard artifacts caused by mismatching strides and kernel sizes, resulting in unequal pixel-space coverage: one of the many gotchas of GANs", "words": [{"w": "Figure", "b": [0.1294, 0.2911, 0.1827, 0.3059]}, {"w": "8.17.", "b": [0.1874, 0.2911, 0.2252, 0.3059]}, {"w": "Checkerboard", "b": [0.2299, 0.2911, 0.3466, 0.3059]}, {"w": "artifacts", "b": [0.3513, 0.2911, 0.4186, 0.3059]}, {"w": "caused", "b": [0.4233, 0.2911, 0.478, 0.3059]}, {"w": "by", "b": [0.4827, 0.2911, 0.5027, 0.3059]}, {"w": "mismatching", "b": [0.5074, 0.2911, 0.6114, 0.3059]}, {"w": "strides", "b": [0.6162, 0.2911, 0.6698, 0.3059]}, {"w": "and", "b": [0.6745, 0.2911, 0.705, 0.3059]}, {"w": "kernel", "b": [0.7097, 0.2911, 0.7612, 0.3059]}, {"w": "sizes,", "b": [0.766, 0.2911, 0.8075, 0.3059]}, {"w": "resulting", "b": [0.1294, 0.3062, 0.2005, 0.321]}, {"w": "in", "b": [0.2053, 0.3062, 0.2211, 0.321]}, {"w": "unequal", "b": [0.2258, 0.3062, 0.291, 0.321]}, {"w": "pixel-space", "b": [0.2957, 0.3062, 0.385, 0.321]}, {"w": "coverage:", "b": [0.3898, 0.3062, 0.4675, 0.321]}, {"w": "one", "b": [0.4722, 0.3062, 0.5006, 0.321]}, {"w": "of", "b": [0.5054, 0.3062, 0.5211, 0.321]}, {"w": "the", "b": [0.5258, 0.3062, 0.5511, 0.321]}, {"w": "many", "b": [0.5558, 0.3062, 0.601, 0.321]}, {"w": "gotchas", "b": [0.6057, 0.3062, 0.6667, 0.321]}, {"w": "of", "b": [0.6714, 0.3062, 0.6871, 0.321]}, {"w": "GANs", "b": [0.6919, 0.3062, 0.7413, 0.321]}]}, {"id": "b_2", "type": "paragraph", "text": "8.5.3. The generator", "words": [{"w": "8.5.3.", "b": [0.1294, 0.4957, 0.1862, 0.5154]}, {"w": "The", "b": [0.1925, 0.4957, 0.2345, 0.5154]}, {"w": "generator", "b": [0.2408, 0.4957, 0.3459, 0.5154]}]}, {"id": "b_3", "type": "paragraph", "text": "First, let’s develop a generator model that turns a vector (from the latent space—during training it will be sampled at random) into a candidate image. One of the many issues that commonly arise with GANs is that the generator gets stuck with generated images that look like noise. A possible solution is to use dropout on both the discriminator and the generator.", "words": [{"w": "First,", "b": [0.1294, 0.5385, 0.182, 0.5582]}, {"w": "let’s", "b": [0.1883, 0.5385, 0.2303, 0.5582]}, {"w": "develop", "b": [0.2366, 0.5385, 0.3165, 0.5582]}, {"w": "a", "b": [0.3228, 0.5385, 0.334, 0.5582]}, {"w": "generator", "b": [0.3403, 0.5395, 0.4765, 0.5597]}, {"w": "model", "b": [0.4828, 0.5385, 0.5459, 0.5582]}, {"w": "that", "b": [0.5522, 0.5385, 0.59, 0.5582]}, {"w": "turns", "b": [0.5963, 0.5385, 0.6468, 0.5582]}, {"w": "a", "b": [0.6531, 0.5385, 0.6643, 0.5582]}, {"w": "vector", "b": [0.6706, 0.5385, 0.7336, 0.5582]}, {"w": "(from", "b": [0.74, 0.5385, 0.7974, 0.5582]}, {"w": "the", "b": [0.8037, 0.5385, 0.8345, 0.5582]}, {"w": "latent", "b": [0.1294, 0.5599, 0.1855, 0.5796]}, {"w": "space—during", "b": [0.1918, 0.5599, 0.3389, 0.5796]}, {"w": "training", "b": [0.3452, 0.5599, 0.4237, 0.5796]}, {"w": "it", "b": [0.43, 0.5599, 0.444, 0.5796]}, {"w": "will", "b": [0.4503, 0.5599, 0.4896, 0.5796]}, {"w": "be", "b": [0.4959, 0.5599, 0.5197, 0.5796]}, {"w": "sampled", "b": [0.526, 0.5599, 0.6101, 0.5796]}, {"w": "at", "b": [0.6164, 0.5599, 0.6346, 0.5796]}, {"w": "random)", "b": [0.6409, 0.5599, 0.7264, 0.5796]}, {"w": "into", "b": [0.7327, 0.5599, 0.7719, 0.5796]}, {"w": "a", "b": [0.7782, 0.5599, 0.7894, 0.5796]}, {"w": "candidate", "b": [0.1294, 0.5804, 0.2261, 0.6001]}, {"w": "image.", "b": [0.2324, 0.5804, 0.3003, 0.6001]}, {"w": "One", "b": [0.3066, 0.5804, 0.3487, 0.6001]}, {"w": "of", "b": [0.3549, 0.5804, 0.3759, 0.6001]}, {"w": "the", "b": [0.3822, 0.5804, 0.4131, 0.6001]}, {"w": "many", "b": [0.4194, 0.5804, 0.4754, 0.6001]}, {"w": "issues", "b": [0.4817, 0.5804, 0.542, 0.6001]}, {"w": "that", "b": [0.5483, 0.5804, 0.5861, 0.6001]}, {"w": "commonly", "b": [0.5925, 0.5804, 0.7004, 0.6001]}, {"w": "arise", "b": [0.7067, 0.5804, 0.7543, 0.6001]}, {"w": "with", "b": [0.7606, 0.5804, 0.8055, 0.6001]}, {"w": "GANs", "b": [0.1294, 0.6009, 0.1939, 0.6206]}, {"w": "is", "b": [0.2002, 0.6009, 0.217, 0.6206]}, {"w": "that", "b": [0.2233, 0.6009, 0.2611, 0.6206]}, {"w": "the", "b": [0.2674, 0.6009, 0.2983, 0.6206]}, {"w": "generator", "b": [0.3046, 0.6009, 0.3998, 0.6206]}, {"w": "gets", "b": [0.4061, 0.6009, 0.4468, 0.6206]}, {"w": "stuck", "b": [0.4531, 0.6009, 0.5063, 0.6206]}, {"w": "with", "b": [0.5126, 0.6009, 0.5575, 0.6206]}, {"w": "generated", "b": [0.5638, 0.6009, 0.6619, 0.6206]}, {"w": "images", "b": [0.6682, 0.6009, 0.7396, 0.6206]}, {"w": "that", "b": [0.7459, 0.6009, 0.7838, 0.6206]}, {"w": "look", "b": [0.7901, 0.6009, 0.8349, 0.6206]}, {"w": "like", "b": [0.1294, 0.6214, 0.1673, 0.6411]}, {"w": "noise.", "b": [0.1736, 0.6214, 0.2331, 0.6411]}, {"w": "A", "b": [0.2394, 0.6214, 0.2576, 0.6411]}, {"w": "possible", "b": [0.2639, 0.6214, 0.3466, 0.6411]}, {"w": "solution", "b": [0.3529, 0.6214, 0.4342, 0.6411]}, {"w": "is", "b": [0.4405, 0.6214, 0.4574, 0.6411]}, {"w": "to", "b": [0.4637, 0.6214, 0.4833, 0.6411]}, {"w": "use", "b": [0.4896, 0.6214, 0.5232, 0.6411]}, {"w": "dropout", "b": [0.5295, 0.6214, 0.608, 0.6411]}, {"w": "on", "b": [0.6143, 0.6214, 0.6395, 0.6411]}, {"w": "both", "b": [0.6458, 0.6214, 0.6907, 0.6411]}, {"w": "the", "b": [0.697, 0.6214, 0.7278, 0.6411]}, {"w": "discriminator", "b": [0.7341, 0.6214, 0.8687, 0.6411]}, {"w": "and", "b": [0.1294, 0.6419, 0.1658, 0.6616]}, {"w": "the", "b": [0.1721, 0.6419, 0.203, 0.6616]}, {"w": "generator.", "b": [0.2093, 0.6419, 0.3094, 0.6616]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 8.29. GAN generator network", "words": [{"w": "Listing", "b": [0.1294, 0.6797, 0.1862, 0.6945]}, {"w": "8.29.", "b": [0.1909, 0.6797, 0.2288, 0.6945]}, {"w": "GAN", "b": [0.2335, 0.6797, 0.2755, 0.6945]}, {"w": "generator", "b": [0.2802, 0.6797, 0.359, 0.6945]}, {"w": "network", "b": [0.3638, 0.6797, 0.431, 0.6945]}]}, {"id": "b_5", "type": "paragraph", "text": "import keras from keras import layers import numpy as np latent_dim = 32 height = 32 width = 32 channels = 3 generator_input = keras.Input(shape=(latent_dim,)) x = layers.Dense(128 * 16 * 16)(generator_input) 1", "words": [{"w": "import", "b": [0.1357, 0.7081, 0.2038, 0.7233]}, {"w": "keras", "b": [0.2152, 0.7081, 0.2719, 0.7233]}, {"w": "from", "b": [0.1357, 0.7233, 0.1811, 0.7384]}, {"w": "keras", "b": [0.1925, 0.7233, 0.2492, 0.7384]}, {"w": "import", "b": [0.2606, 0.7233, 0.3287, 0.7384]}, {"w": "layers", "b": [0.34, 0.7233, 0.4082, 0.7384]}, {"w": "import", "b": [0.1357, 0.7384, 0.2038, 0.7536]}, {"w": "numpy", "b": [0.2152, 0.7384, 0.2719, 0.7536]}, {"w": "as", "b": [0.2833, 0.7384, 0.306, 0.7536]}, {"w": "np", "b": [0.3173, 0.7384, 0.34, 0.7536]}, {"w": "latent_dim", "b": [0.1357, 0.7687, 0.2492, 0.7839]}, {"w": "=", "b": [0.2606, 0.7687, 0.2719, 0.7839]}, {"w": "32", "b": [0.2833, 0.7687, 0.306, 0.7839]}, {"w": "height", "b": [0.1357, 0.7839, 0.2038, 0.799]}, {"w": "=", "b": [0.2152, 0.7839, 0.2265, 0.799]}, {"w": "32", "b": [0.2379, 0.7839, 0.2606, 0.799]}, {"w": "width", "b": [0.1357, 0.799, 0.1925, 0.8142]}, {"w": "=", "b": [0.2038, 0.799, 0.2152, 0.8142]}, {"w": "32", "b": [0.2265, 0.799, 0.2492, 0.8142]}, {"w": "channels", "b": [0.1357, 0.8142, 0.2265, 0.8293]}, {"w": "=", "b": [0.2379, 0.8142, 0.2492, 0.8293]}, {"w": "3", "b": [0.2606, 0.8142, 0.2719, 0.8293]}, {"w": "generator_input", "b": [0.1357, 0.8445, 0.306, 0.8596]}, {"w": "=", "b": [0.3173, 0.8445, 0.3287, 0.8596]}, {"w": "keras.Input(shape=(latent_dim,))", "b": [0.34, 0.8445, 0.7033, 0.8596]}, {"w": "x", "b": [0.1357, 0.8748, 0.1471, 0.8899]}, {"w": "=", "b": [0.1584, 0.8748, 0.1698, 0.8899]}, {"w": "layers.Dense(128", "b": [0.1811, 0.8748, 0.3628, 0.8899]}, {"w": "*", "b": [0.3741, 0.8748, 0.3855, 0.8899]}, {"w": "16", "b": [0.3968, 0.8748, 0.4195, 0.8899]}, {"w": "*", "b": [0.4309, 0.8748, 0.4422, 0.8899]}, {"w": "16)(generator_input)", "b": [0.4536, 0.8748, 0.6806, 0.8899]}, {"w": "1", "b": [0.1357, 0.8899, 0.1471, 0.9051]}]}]}, {"page": 404, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "x = layers.LeakyReLU()(x) 1 x = layers.Reshape((16, 16, 128))(x) 1 x = layers.Conv2D(256, 5, padding='same')(x) x = layers.LeakyReLU()(x) x = layers.Conv2DTranspose(256, 4, strides=2, padding='same')(x) 2 x = layers.LeakyReLU()(x) 2 x = layers.Conv2D(256, 5, padding='same')(x) x = layers.LeakyReLU()(x) x = layers.Conv2D(256, 5, padding='same')(x) x = layers.LeakyReLU()(x) x = layers.Conv2D(channels, 7, activation='tanh', padding='same')(x) 3 generator = keras.models.Model(generator_input, x) 34 generator.summary() 3", "words": [{"w": "x", "b": [0.1357, 0.0851, 0.1471, 0.1002]}, {"w": "=", "b": [0.1584, 0.0851, 0.1698, 0.1002]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.0851, 0.4195, 0.1002]}, {"w": "1", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "x", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "=", "b": [0.1584, 0.1154, 0.1698, 0.1305]}, {"w": "layers.Reshape((16,", "b": [0.1811, 0.1154, 0.3968, 0.1305]}, {"w": "16,", "b": [0.4082, 0.1154, 0.4422, 0.1305]}, {"w": "128))(x)", "b": [0.4536, 0.1154, 0.5444, 0.1305]}, {"w": "1", "b": [0.1357, 0.1305, 0.1471, 0.1457]}, {"w": "x", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "=", "b": [0.1584, 0.1608, 0.1698, 0.176]}, {"w": "layers.Conv2D(256,", "b": [0.1811, 0.1608, 0.3855, 0.176]}, {"w": "5,", "b": [0.3968, 0.1608, 0.4195, 0.176]}, {"w": "padding='same')(x)", "b": [0.4309, 0.1608, 0.6352, 0.176]}, {"w": "x", "b": [0.1357, 0.176, 0.1471, 0.1911]}, {"w": "=", "b": [0.1584, 0.176, 0.1698, 0.1911]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.176, 0.4195, 0.1911]}, {"w": "x", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "=", "b": [0.1584, 0.2063, 0.1698, 0.2214]}, {"w": "layers.Conv2DTranspose(256,", "b": [0.1811, 0.2063, 0.4876, 0.2214]}, {"w": "4,", "b": [0.499, 0.2063, 0.5217, 0.2214]}, {"w": "strides=2,", "b": [0.533, 0.2063, 0.6465, 0.2214]}, {"w": "padding='same')(x)", "b": [0.6579, 0.2063, 0.8622, 0.2214]}, {"w": "2", "b": [0.1357, 0.2215, 0.1471, 0.2366]}, {"w": "x", "b": [0.1357, 0.2366, 0.1471, 0.2518]}, {"w": "=", "b": [0.1584, 0.2366, 0.1698, 0.2518]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.2366, 0.4195, 0.2518]}, {"w": "2", "b": [0.1357, 0.2518, 0.1471, 0.2669]}, {"w": "x", "b": [0.1357, 0.2821, 0.1471, 0.2972]}, {"w": "=", "b": [0.1584, 0.2821, 0.1698, 0.2972]}, {"w": "layers.Conv2D(256,", "b": [0.1811, 0.2821, 0.3855, 0.2972]}, {"w": "5,", "b": [0.3968, 0.2821, 0.4195, 0.2972]}, {"w": "padding='same')(x)", "b": [0.4309, 0.2821, 0.6352, 0.2972]}, {"w": "x", "b": [0.1357, 0.2972, 0.1471, 0.3124]}, {"w": "=", "b": [0.1584, 0.2972, 0.1698, 0.3124]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.2972, 0.4195, 0.3124]}, {"w": "x", "b": [0.1357, 0.3124, 0.1471, 0.3275]}, {"w": "=", "b": [0.1584, 0.3124, 0.1698, 0.3275]}, {"w": "layers.Conv2D(256,", "b": [0.1811, 0.3124, 0.3855, 0.3275]}, {"w": "5,", "b": [0.3968, 0.3124, 0.4195, 0.3275]}, {"w": "padding='same')(x)", "b": [0.4309, 0.3124, 0.6352, 0.3275]}, {"w": "x", "b": [0.1357, 0.3275, 0.1471, 0.3427]}, {"w": "=", "b": [0.1584, 0.3275, 0.1698, 0.3427]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.3275, 0.4195, 0.3427]}, {"w": "x", "b": [0.1357, 0.3578, 0.1471, 0.373]}, {"w": "=", "b": [0.1584, 0.3578, 0.1698, 0.373]}, {"w": "layers.Conv2D(channels,", "b": [0.1811, 0.3578, 0.4422, 0.373]}, {"w": "7,", "b": [0.4536, 0.3578, 0.4763, 0.373]}, {"w": "activation='tanh',", "b": [0.4876, 0.3578, 0.6919, 0.373]}, {"w": "padding='same')(x)", "b": [0.1357, 0.373, 0.34, 0.3881]}, {"w": "3", "b": [0.3514, 0.373, 0.3628, 0.3881]}, {"w": "generator", "b": [0.1357, 0.3881, 0.2379, 0.4033]}, {"w": "=", "b": [0.2492, 0.3881, 0.2606, 0.4033]}, {"w": "keras.models.Model(generator_input,", "b": [0.2719, 0.3881, 0.6692, 0.4033]}, {"w": "x)", "b": [0.6806, 0.3881, 0.7033, 0.4033]}, {"w": "34", "b": [0.1357, 0.4033, 0.1584, 0.4184]}, {"w": "generator.summary()", "b": [0.1357, 0.4184, 0.3514, 0.4336]}, {"w": "3", "b": [0.1357, 0.4336, 0.1471, 0.4487]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Transforms the input into a 16 × 16 128-channel feature map 2 Upsamples to 32 × 32 3 Produces a 32 × 32 1-channel feature map (shape of a CIFAR10 image) 4 Instantiates the generator model, which maps the input of shape (latent_dim,) into an image of shape (32, 32, 3)", "words": [{"w": "1", "b": [0.1799, 0.4672, 0.1925, 0.4869]}, {"w": "Transforms", "b": [0.1988, 0.4672, 0.3244, 0.4869]}, {"w": "the", "b": [0.3307, 0.4672, 0.3644, 0.4869]}, {"w": "input", "b": [0.3707, 0.4672, 0.4282, 0.4869]}, {"w": "into", "b": [0.4345, 0.4672, 0.4765, 0.4869]}, {"w": "a", "b": [0.4828, 0.4672, 0.4954, 0.4869]}, {"w": "16", "b": [0.5017, 0.4672, 0.527, 0.4869]}, {"w": "×", "b": [0.5333, 0.4672, 0.5476, 0.4869]}, {"w": "16", "b": [0.554, 0.4672, 0.5792, 0.4869]}, {"w": "128-channel", "b": [0.5855, 0.4672, 0.7158, 0.4869]}, {"w": "feature", "b": [0.7221, 0.4672, 0.7987, 0.4869]}, {"w": "map", "b": [0.805, 0.4672, 0.8527, 0.4869]}, {"w": "2", "b": [0.1799, 0.4877, 0.1925, 0.5074]}, {"w": "Upsamples", "b": [0.1988, 0.4877, 0.3165, 0.5074]}, {"w": "to", "b": [0.3228, 0.4877, 0.3438, 0.5074]}, {"w": "32", "b": [0.3501, 0.4877, 0.3754, 0.5074]}, {"w": "×", "b": [0.3817, 0.4877, 0.396, 0.5074]}, {"w": "32", "b": [0.4024, 0.4877, 0.4276, 0.5074]}, {"w": "3", "b": [0.1799, 0.5082, 0.1925, 0.5279]}, {"w": "Produces", "b": [0.1988, 0.5082, 0.2978, 0.5279]}, {"w": "a", "b": [0.3041, 0.5082, 0.3167, 0.5279]}, {"w": "32", "b": [0.323, 0.5082, 0.3483, 0.5279]}, {"w": "×", "b": [0.3546, 0.5082, 0.3689, 0.5279]}, {"w": "32", "b": [0.3753, 0.5082, 0.4005, 0.5279]}, {"w": "1-channel", "b": [0.4068, 0.5082, 0.5119, 0.5279]}, {"w": "feature", "b": [0.5182, 0.5082, 0.5948, 0.5279]}, {"w": "map", "b": [0.6011, 0.5082, 0.6487, 0.5279]}, {"w": "(shape", "b": [0.6551, 0.5082, 0.7251, 0.5279]}, {"w": "of", "b": [0.7314, 0.5082, 0.7524, 0.5279]}, {"w": "a", "b": [0.7588, 0.5082, 0.7714, 0.5279]}, {"w": "CIFAR10", "b": [0.1799, 0.5287, 0.2831, 0.5484]}, {"w": "image)", "b": [0.2894, 0.5287, 0.3622, 0.5484]}, {"w": "4", "b": [0.1799, 0.5492, 0.1925, 0.5689]}, {"w": "Instantiates", "b": [0.1988, 0.5492, 0.3249, 0.5689]}, {"w": "the", "b": [0.3312, 0.5492, 0.3648, 0.5689]}, {"w": "generator", "b": [0.3712, 0.5492, 0.4762, 0.5689]}, {"w": "model,", "b": [0.4825, 0.5492, 0.5547, 0.5689]}, {"w": "which", "b": [0.561, 0.5492, 0.6255, 0.5689]}, {"w": "maps", "b": [0.6318, 0.5492, 0.6892, 0.5689]}, {"w": "the", "b": [0.6956, 0.5492, 0.7292, 0.5689]}, {"w": "input", "b": [0.7355, 0.5492, 0.793, 0.5689]}, {"w": "of", "b": [0.7993, 0.5492, 0.8203, 0.5689]}, {"w": "shape", "b": [0.1799, 0.5697, 0.2415, 0.5894]}, {"w": "(latent_dim,)", "b": [0.2478, 0.5697, 0.3873, 0.5894]}, {"w": "into", "b": [0.3936, 0.5697, 0.4356, 0.5894]}, {"w": "an", "b": [0.4419, 0.5697, 0.4686, 0.5894]}, {"w": "image", "b": [0.4749, 0.5697, 0.5393, 0.5894]}, {"w": "of", "b": [0.5456, 0.5697, 0.5667, 0.5894]}, {"w": "shape", "b": [0.573, 0.5697, 0.6346, 0.5894]}, {"w": "(32,", "b": [0.6409, 0.5697, 0.6809, 0.5894]}, {"w": "32,", "b": [0.6872, 0.5697, 0.7187, 0.5894]}, {"w": "3)", "b": [0.725, 0.5697, 0.746, 0.5894]}]}, {"id": "b_2", "type": "paragraph", "text": "8.5.4. The discriminator", "words": [{"w": "8.5.4.", "b": [0.1294, 0.6169, 0.1862, 0.6366]}, {"w": "The", "b": [0.1925, 0.6169, 0.2345, 0.6366]}, {"w": "discriminator", "b": [0.2408, 0.6169, 0.388, 0.6366]}]}, {"id": "b_3", "type": "paragraph", "text": "Next, you’ll develop a discriminator model that takes as input a candidate image (real or synthetic) and classifies it into one of two classes: “generated image” or “real image that comes from the training set.��", "words": [{"w": "Next,", "b": [0.1294, 0.6597, 0.1848, 0.6794]}, {"w": "you’ll", "b": [0.1911, 0.6597, 0.2513, 0.6794]}, {"w": "develop", "b": [0.2576, 0.6597, 0.3375, 0.6794]}, {"w": "a", "b": [0.3438, 0.6597, 0.355, 0.6794]}, {"w": "discriminator", "b": [0.3613, 0.6607, 0.558, 0.6809]}, {"w": "model", "b": [0.5644, 0.6597, 0.6274, 0.6794]}, {"w": "that", "b": [0.6337, 0.6597, 0.6716, 0.6794]}, {"w": "takes", "b": [0.6779, 0.6597, 0.7297, 0.6794]}, {"w": "as", "b": [0.736, 0.6597, 0.757, 0.6794]}, {"w": "input", "b": [0.7633, 0.6597, 0.8152, 0.6794]}, {"w": "a", "b": [0.8215, 0.6597, 0.8327, 0.6794]}, {"w": "candidate", "b": [0.1294, 0.6811, 0.2261, 0.7008]}, {"w": "image", "b": [0.2324, 0.6811, 0.294, 0.7008]}, {"w": "(real", "b": [0.3003, 0.6811, 0.3466, 0.7008]}, {"w": "or", "b": [0.3529, 0.6811, 0.3739, 0.7008]}, {"w": "synthetic)", "b": [0.3802, 0.6811, 0.4797, 0.7008]}, {"w": "and", "b": [0.486, 0.6811, 0.5224, 0.7008]}, {"w": "classifies", "b": [0.5287, 0.6811, 0.6212, 0.7008]}, {"w": "it", "b": [0.6275, 0.6811, 0.6415, 0.7008]}, {"w": "into", "b": [0.6478, 0.6811, 0.6871, 0.7008]}, {"w": "one", "b": [0.6934, 0.6811, 0.7298, 0.7008]}, {"w": "of", "b": [0.7361, 0.6811, 0.7571, 0.7008]}, {"w": "two", "b": [0.7634, 0.6811, 0.8013, 0.7008]}, {"w": "classes:", "b": [0.1294, 0.7016, 0.2065, 0.7213]}, {"w": "“generated", "b": [0.2128, 0.7016, 0.322, 0.7213]}, {"w": "image”", "b": [0.3283, 0.7016, 0.4012, 0.7213]}, {"w": "or", "b": [0.4074, 0.7016, 0.4285, 0.7213]}, {"w": "“real", "b": [0.4348, 0.7016, 0.4838, 0.7213]}, {"w": "image", "b": [0.4901, 0.7016, 0.5517, 0.7213]}, {"w": "that", "b": [0.558, 0.7016, 0.5959, 0.7213]}, {"w": "comes", "b": [0.6022, 0.7016, 0.6666, 0.7213]}, {"w": "from", "b": [0.6729, 0.7016, 0.722, 0.7213]}, {"w": "the", "b": [0.7283, 0.7016, 0.7591, 0.7213]}, {"w": "training", "b": [0.7654, 0.7016, 0.8439, 0.7213]}, {"w": "set.”", "b": [0.1294, 0.7221, 0.1749, 0.7418]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 8.30. The GAN discriminator network", "words": [{"w": "Listing", "b": [0.1294, 0.7599, 0.1862, 0.7747]}, {"w": "8.30.", "b": [0.1909, 0.7599, 0.2288, 0.7747]}, {"w": "The", "b": [0.2335, 0.7599, 0.265, 0.7747]}, {"w": "GAN", "b": [0.2697, 0.7599, 0.3118, 0.7747]}, {"w": "discriminator", "b": [0.3165, 0.7599, 0.4269, 0.7747]}, {"w": "network", "b": [0.4316, 0.7599, 0.4988, 0.7747]}]}, {"id": "b_5", "type": "paragraph", "text": "discriminator_input = layers.Input(shape=(height, width, channels)) x = layers.Conv2D(128, 3)(discriminator_input) x = layers.LeakyReLU()(x) x = layers.Conv2D(128, 4, strides=2)(x) x = layers.LeakyReLU()(x) x = layers.Conv2D(128, 4, strides=2)(x) x = layers.LeakyReLU()(x)", "words": [{"w": "discriminator_input", "b": [0.1357, 0.7883, 0.3514, 0.8035]}, {"w": "=", "b": [0.3628, 0.7883, 0.3741, 0.8035]}, {"w": "layers.Input(shape=(height,", "b": [0.3855, 0.7883, 0.6919, 0.8035]}, {"w": "width,", "b": [0.7033, 0.7883, 0.7714, 0.8035]}, {"w": "channels))", "b": [0.1357, 0.8035, 0.2492, 0.8186]}, {"w": "x", "b": [0.1357, 0.8186, 0.1471, 0.8338]}, {"w": "=", "b": [0.1584, 0.8186, 0.1698, 0.8338]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.8186, 0.3855, 0.8338]}, {"w": "3)(discriminator_input)", "b": [0.3968, 0.8186, 0.6579, 0.8338]}, {"w": "x", "b": [0.1357, 0.8338, 0.1471, 0.8489]}, {"w": "=", "b": [0.1584, 0.8338, 0.1698, 0.8489]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.8338, 0.4195, 0.8489]}, {"w": "x", "b": [0.1357, 0.8489, 0.1471, 0.8641]}, {"w": "=", "b": [0.1584, 0.8489, 0.1698, 0.8641]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.8489, 0.3855, 0.8641]}, {"w": "4,", "b": [0.3968, 0.8489, 0.4195, 0.8641]}, {"w": "strides=2)(x)", "b": [0.4309, 0.8489, 0.5784, 0.8641]}, {"w": "x", "b": [0.1357, 0.8641, 0.1471, 0.8792]}, {"w": "=", "b": [0.1584, 0.8641, 0.1698, 0.8792]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.8641, 0.4195, 0.8792]}, {"w": "x", "b": [0.1357, 0.8792, 0.1471, 0.8944]}, {"w": "=", "b": [0.1584, 0.8792, 0.1698, 0.8944]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.8792, 0.3855, 0.8944]}, {"w": "4,", "b": [0.3968, 0.8792, 0.4195, 0.8944]}, {"w": "strides=2)(x)", "b": [0.4309, 0.8792, 0.5784, 0.8944]}, {"w": "x", "b": [0.1357, 0.8944, 0.1471, 0.9095]}, {"w": "=", "b": [0.1584, 0.8944, 0.1698, 0.9095]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.8944, 0.4195, 0.9095]}]}]}, {"page": 405, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "x = layers.Conv2D(128, 4, strides=2)(x) x = layers.LeakyReLU()(x) x = layers.Flatten()(x) x = layers.Dropout(0.4)(x) 1 x = layers.Dense(1, activation='sigmoid')(x) 2 discriminator = keras.models.Model(discriminator_input, x) 3 discriminator.summary() discriminator_optimizer = keras.optimizers.RMSprop( lr=0.0008, clipvalue=1.0, 4 decay=1e-8) 5 discriminator.compile(optimizer=discriminator_optimizer, loss='binary_crossentropy')", "words": [{"w": "x", "b": [0.1357, 0.0851, 0.1471, 0.1002]}, {"w": "=", "b": [0.1584, 0.0851, 0.1698, 0.1002]}, {"w": "layers.Conv2D(128,", "b": [0.1811, 0.0851, 0.3855, 0.1002]}, {"w": "4,", "b": [0.3968, 0.0851, 0.4195, 0.1002]}, {"w": "strides=2)(x)", "b": [0.4309, 0.0851, 0.5784, 0.1002]}, {"w": "x", "b": [0.1357, 0.1002, 0.1471, 0.1154]}, {"w": "=", "b": [0.1584, 0.1002, 0.1698, 0.1154]}, {"w": "layers.LeakyReLU()(x)", "b": [0.1811, 0.1002, 0.4195, 0.1154]}, {"w": "x", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "=", "b": [0.1584, 0.1154, 0.1698, 0.1305]}, {"w": "layers.Flatten()(x)", "b": [0.1811, 0.1154, 0.3968, 0.1305]}, {"w": "x", "b": [0.1357, 0.1457, 0.1471, 0.1608]}, {"w": "=", "b": [0.1584, 0.1457, 0.1698, 0.1608]}, {"w": "layers.Dropout(0.4)(x)", "b": [0.1811, 0.1457, 0.4309, 0.1608]}, {"w": "1", "b": [0.1357, 0.1608, 0.1471, 0.176]}, {"w": "x", "b": [0.1357, 0.1912, 0.1471, 0.2063]}, {"w": "=", "b": [0.1584, 0.1912, 0.1698, 0.2063]}, {"w": "layers.Dense(1,", "b": [0.1811, 0.1912, 0.3514, 0.2063]}, {"w": "activation='sigmoid')(x)", "b": [0.3628, 0.1912, 0.6352, 0.2063]}, {"w": "2", "b": [0.1357, 0.2063, 0.1471, 0.2214]}, {"w": "discriminator", "b": [0.1357, 0.2366, 0.2833, 0.2518]}, {"w": "=", "b": [0.2946, 0.2366, 0.306, 0.2518]}, {"w": "keras.models.Model(discriminator_input,", "b": [0.3173, 0.2366, 0.7601, 0.2518]}, {"w": "x)", "b": [0.7714, 0.2366, 0.7941, 0.2518]}, {"w": "3", "b": [0.1357, 0.2518, 0.1471, 0.2669]}, {"w": "discriminator.summary()", "b": [0.1357, 0.2669, 0.3968, 0.2821]}, {"w": "discriminator_optimizer", "b": [0.1357, 0.2972, 0.3968, 0.3124]}, {"w": "=", "b": [0.4082, 0.2972, 0.4195, 0.3124]}, {"w": "keras.optimizers.RMSprop(", "b": [0.4309, 0.2972, 0.7146, 0.3124]}, {"w": "lr=0.0008,", "b": [0.1811, 0.3124, 0.2946, 0.3275]}, {"w": "clipvalue=1.0,", "b": [0.1811, 0.3275, 0.34, 0.3427]}, {"w": "4", "b": [0.1357, 0.3427, 0.1471, 0.3578]}, {"w": "decay=1e-8)", "b": [0.1811, 0.3578, 0.306, 0.373]}, {"w": "5", "b": [0.1357, 0.373, 0.1471, 0.3881]}, {"w": "discriminator.compile(optimizer=discriminator_optimizer,", "b": [0.1357, 0.3881, 0.7714, 0.4033]}, {"w": "loss='binary_crossentropy')", "b": [0.3741, 0.4033, 0.6806, 0.4184]}]}, {"id": "b_1", "type": "paragraph", "text": "1 One dropout layer: an important trick! 2 Classification layer 3 Instantiates the discrim-inator model, which turns a (32, 32, 3) input into a binary classification decision (fake/real) 4 Uses gradient clipping (by value) in the optimizer 5 To stabilize training, uses learning-rate decay", "words": [{"w": "1", "b": [0.1799, 0.4369, 0.1925, 0.4566]}, {"w": "One", "b": [0.1988, 0.4369, 0.2436, 0.4566]}, {"w": "dropout", "b": [0.2499, 0.4369, 0.3364, 0.4566]}, {"w": "layer:", "b": [0.3427, 0.4369, 0.4057, 0.4566]}, {"w": "an", "b": [0.412, 0.4369, 0.4387, 0.4566]}, {"w": "important", "b": [0.445, 0.4369, 0.5543, 0.4566]}, {"w": "trick!", "b": [0.5606, 0.4369, 0.6208, 0.4566]}, {"w": "2", "b": [0.1799, 0.4574, 0.1925, 0.4771]}, {"w": "Classification", "b": [0.1988, 0.4574, 0.3445, 0.4771]}, {"w": "layer", "b": [0.3508, 0.4574, 0.4055, 0.4771]}, {"w": "3", "b": [0.1799, 0.4779, 0.1925, 0.4976]}, {"w": "Instantiates", "b": [0.1988, 0.4779, 0.3249, 0.4976]}, {"w": "the", "b": [0.3312, 0.4779, 0.3648, 0.4976]}, {"w": "discrim-inator", "b": [0.3712, 0.4779, 0.5267, 0.4976]}, {"w": "model,", "b": [0.533, 0.4779, 0.6052, 0.4976]}, {"w": "which", "b": [0.6115, 0.4779, 0.676, 0.4976]}, {"w": "turns", "b": [0.6823, 0.4779, 0.7397, 0.4976]}, {"w": "a", "b": [0.746, 0.4779, 0.7586, 0.4976]}, {"w": "(32,", "b": [0.7649, 0.4779, 0.8049, 0.4976]}, {"w": "32,", "b": [0.8112, 0.4779, 0.8427, 0.4976]}, {"w": "3)", "b": [0.849, 0.4779, 0.87, 0.4976]}, {"w": "input", "b": [0.1799, 0.4984, 0.2374, 0.5181]}, {"w": "into", "b": [0.2437, 0.4984, 0.2857, 0.5181]}, {"w": "a", "b": [0.292, 0.4984, 0.3046, 0.5181]}, {"w": "binary", "b": [0.3109, 0.4984, 0.3824, 0.5181]}, {"w": "classification", "b": [0.3887, 0.4984, 0.5275, 0.5181]}, {"w": "decision", "b": [0.5338, 0.4984, 0.6207, 0.5181]}, {"w": "(fake/real)", "b": [0.627, 0.4984, 0.7386, 0.5181]}, {"w": "4", "b": [0.1799, 0.5189, 0.1925, 0.5386]}, {"w": "Uses", "b": [0.1988, 0.5189, 0.2478, 0.5386]}, {"w": "gradient", "b": [0.2541, 0.5189, 0.3452, 0.5386]}, {"w": "clipping", "b": [0.3515, 0.5189, 0.4385, 0.5386]}, {"w": "(by", "b": [0.4448, 0.5189, 0.4798, 0.5386]}, {"w": "value)", "b": [0.4861, 0.5189, 0.552, 0.5386]}, {"w": "in", "b": [0.5583, 0.5189, 0.5793, 0.5386]}, {"w": "the", "b": [0.5856, 0.5189, 0.6192, 0.5386]}, {"w": "optimizer", "b": [0.6256, 0.5189, 0.7292, 0.5386]}, {"w": "5", "b": [0.1799, 0.5394, 0.1925, 0.5591]}, {"w": "To", "b": [0.1988, 0.5394, 0.2259, 0.5591]}, {"w": "stabilize", "b": [0.2322, 0.5394, 0.3205, 0.5591]}, {"w": "training,", "b": [0.3268, 0.5394, 0.42, 0.5591]}, {"w": "uses", "b": [0.4263, 0.5394, 0.4712, 0.5591]}, {"w": "learning-rate", "b": [0.4775, 0.5394, 0.619, 0.5591]}, {"w": "decay", "b": [0.6253, 0.5394, 0.687, 0.5591]}]}, {"id": "b_2", "type": "paragraph", "text": "8.5.5. The adversarial network", "words": [{"w": "8.5.5.", "b": [0.1294, 0.5866, 0.1862, 0.6063]}, {"w": "The", "b": [0.1925, 0.5866, 0.2345, 0.6063]}, {"w": "adversarial", "b": [0.2408, 0.5866, 0.3628, 0.6063]}, {"w": "network", "b": [0.3691, 0.5866, 0.4587, 0.6063]}]}, {"id": "b_3", "type": "paragraph", "text": "Finally, you’ll set up the GAN, which chains the generator and the discriminator. When trained, this model will move the generator in a direction that improves its ability to fool the discriminator. This model turns latent-space points into a classification decision—“fake” or “real”—and it’s meant to be trained with labels that are always “these are real images.” So, training gan will update the weights of generator in a way that makes discriminator more likely to predict “real” when looking at fake images. It’s very important to note that you set the discriminator to be frozen during training (non-trainable): its weights won’t be updated when training gan. If the discriminator weights could be updated during this process, then you’d be training the discriminator to always predict “real,” which isn’t what you want!", "words": [{"w": "Finally,", "b": [0.1294, 0.6294, 0.2056, 0.6491]}, {"w": "you’ll", "b": [0.2119, 0.6294, 0.2721, 0.6491]}, {"w": "set", "b": [0.2784, 0.6294, 0.3065, 0.6491]}, {"w": "up", "b": [0.3128, 0.6294, 0.338, 0.6491]}, {"w": "the", "b": [0.3443, 0.6294, 0.3751, 0.6491]}, {"w": "GAN,", "b": [0.3814, 0.6294, 0.4424, 0.6491]}, {"w": "which", "b": [0.4487, 0.6294, 0.5103, 0.6491]}, {"w": "chains", "b": [0.5166, 0.6294, 0.5811, 0.6491]}, {"w": "the", "b": [0.5874, 0.6294, 0.6182, 0.6491]}, {"w": "generator", "b": [0.6245, 0.6294, 0.7198, 0.6491]}, {"w": "and", "b": [0.7261, 0.6294, 0.7625, 0.6491]}, {"w": "the", "b": [0.7688, 0.6294, 0.7996, 0.6491]}, {"w": "discriminator.", "b": [0.1294, 0.6499, 0.2688, 0.6696]}, {"w": "When", "b": [0.2751, 0.6499, 0.3354, 0.6696]}, {"w": "trained,", "b": [0.3417, 0.6499, 0.418, 0.6696]}, {"w": "this", "b": [0.4243, 0.6499, 0.4608, 0.6696]}, {"w": "model", "b": [0.4671, 0.6499, 0.5302, 0.6696]}, {"w": "will", "b": [0.5365, 0.6499, 0.5757, 0.6696]}, {"w": "move", "b": [0.582, 0.6499, 0.6381, 0.6696]}, {"w": "the", "b": [0.6444, 0.6499, 0.6752, 0.6696]}, {"w": "generator", "b": [0.6815, 0.6499, 0.7768, 0.6696]}, {"w": "in", "b": [0.783, 0.6499, 0.8026, 0.6696]}, {"w": "a", "b": [0.8089, 0.6499, 0.8201, 0.6696]}, {"w": "direction", "b": [0.1294, 0.6704, 0.2191, 0.6901]}, {"w": "that", "b": [0.2254, 0.6704, 0.2632, 0.6901]}, {"w": "improves", "b": [0.2695, 0.6704, 0.3634, 0.6901]}, {"w": "its", "b": [0.3697, 0.6704, 0.3936, 0.6901]}, {"w": "ability", "b": [0.3999, 0.6704, 0.4644, 0.6901]}, {"w": "to", "b": [0.4707, 0.6704, 0.4903, 0.6901]}, {"w": "fool", "b": [0.4966, 0.6704, 0.5372, 0.6901]}, {"w": "the", "b": [0.5435, 0.6704, 0.5744, 0.6901]}, {"w": "discriminator.", "b": [0.5807, 0.6704, 0.72, 0.6901]}, {"w": "This", "b": [0.7263, 0.6704, 0.7712, 0.6901]}, {"w": "model", "b": [0.7775, 0.6704, 0.8405, 0.6901]}, {"w": "turns", "b": [0.1294, 0.6909, 0.1799, 0.7106]}, {"w": "latent-space", "b": [0.1862, 0.6909, 0.3066, 0.7106]}, {"w": "points", "b": [0.313, 0.6909, 0.3746, 0.7106]}, {"w": "into", "b": [0.3809, 0.6909, 0.4202, 0.7106]}, {"w": "a", "b": [0.4265, 0.6909, 0.4377, 0.7106]}, {"w": "classification", "b": [0.444, 0.6909, 0.5771, 0.7106]}, {"w": "decision—“fake”", "b": [0.5833, 0.6909, 0.7585, 0.7106]}, {"w": "or", "b": [0.7648, 0.6909, 0.7858, 0.7106]}, {"w": "“real”—and", "b": [0.1294, 0.7114, 0.2513, 0.7311]}, {"w": "it’s", "b": [0.2576, 0.7114, 0.2884, 0.7311]}, {"w": "meant", "b": [0.2947, 0.7114, 0.3564, 0.7311]}, {"w": "to", "b": [0.3627, 0.7114, 0.3823, 0.7311]}, {"w": "be", "b": [0.3886, 0.7114, 0.4124, 0.7311]}, {"w": "trained", "b": [0.4187, 0.7114, 0.4888, 0.7311]}, {"w": "with", "b": [0.4951, 0.7114, 0.5399, 0.7311]}, {"w": "labels", "b": [0.5462, 0.7114, 0.6051, 0.7311]}, {"w": "that", "b": [0.6114, 0.7114, 0.6492, 0.7311]}, {"w": "are", "b": [0.6555, 0.7114, 0.6863, 0.7311]}, {"w": "always", "b": [0.6926, 0.7114, 0.7627, 0.7311]}, {"w": "“these", "b": [0.769, 0.7114, 0.832, 0.7311]}, {"w": "are", "b": [0.8383, 0.7114, 0.8691, 0.7311]}, {"w": "real", "b": [0.1294, 0.7319, 0.1672, 0.7516]}, {"w": "images.”", "b": [0.1735, 0.7319, 0.2625, 0.7516]}, {"w": "So,", "b": [0.2688, 0.7319, 0.3018, 0.7516]}, {"w": "training", "b": [0.3081, 0.7319, 0.3865, 0.7516]}, {"w": "gan", "b": [0.3928, 0.7329, 0.4382, 0.7531]}, {"w": "will", "b": [0.4445, 0.7319, 0.4838, 0.7516]}, {"w": "update", "b": [0.4901, 0.7319, 0.5573, 0.7516]}, {"w": "the", "b": [0.5636, 0.7319, 0.5945, 0.7516]}, {"w": "weights", "b": [0.6008, 0.7319, 0.6792, 0.7516]}, {"w": "of", "b": [0.6855, 0.7319, 0.7066, 0.7516]}, {"w": "generator", "b": [0.7128, 0.7329, 0.8491, 0.7531]}, {"w": "in", "b": [0.1294, 0.7533, 0.149, 0.773]}, {"w": "a", "b": [0.1553, 0.7533, 0.1665, 0.773]}, {"w": "way", "b": [0.1729, 0.7533, 0.2149, 0.773]}, {"w": "that", "b": [0.2212, 0.7533, 0.259, 0.773]}, {"w": "makes", "b": [0.2653, 0.7533, 0.3298, 0.773]}, {"w": "discriminator", "b": [0.336, 0.7543, 0.5328, 0.7745]}, {"w": "more", "b": [0.5391, 0.7533, 0.591, 0.773]}, {"w": "likely", "b": [0.5973, 0.7533, 0.6547, 0.773]}, {"w": "to", "b": [0.661, 0.7533, 0.6807, 0.773]}, {"w": "predict", "b": [0.687, 0.7533, 0.757, 0.773]}, {"w": "“real”", "b": [0.7633, 0.7533, 0.8236, 0.773]}, {"w": "when", "b": [0.1294, 0.7747, 0.1841, 0.7944]}, {"w": "looking", "b": [0.1904, 0.7747, 0.2674, 0.7944]}, {"w": "at", "b": [0.2738, 0.7747, 0.292, 0.7944]}, {"w": "fake", "b": [0.2983, 0.7747, 0.3417, 0.7944]}, {"w": "images.", "b": [0.348, 0.7747, 0.4258, 0.7944]}, {"w": "It’s", "b": [0.4321, 0.7747, 0.4643, 0.7944]}, {"w": "very", "b": [0.4706, 0.7747, 0.5154, 0.7944]}, {"w": "important", "b": [0.5217, 0.7747, 0.6198, 0.7944]}, {"w": "to", "b": [0.6261, 0.7747, 0.6457, 0.7944]}, {"w": "note", "b": [0.652, 0.7747, 0.6955, 0.7944]}, {"w": "that", "b": [0.7018, 0.7747, 0.7396, 0.7944]}, {"w": "you", "b": [0.7459, 0.7747, 0.7838, 0.7944]}, {"w": "set", "b": [0.7901, 0.7747, 0.8181, 0.7944]}, {"w": "the", "b": [0.8244, 0.7747, 0.8552, 0.7944]}, {"w": "discriminator", "b": [0.1294, 0.7952, 0.2639, 0.8149]}, {"w": "to", "b": [0.2702, 0.7952, 0.2899, 0.8149]}, {"w": "be", "b": [0.2961, 0.7952, 0.32, 0.8149]}, {"w": "frozen", "b": [0.3263, 0.7952, 0.3907, 0.8149]}, {"w": "during", "b": [0.397, 0.7952, 0.4629, 0.8149]}, {"w": "training", "b": [0.4692, 0.7952, 0.5476, 0.8149]}, {"w": "(non-trainable):", "b": [0.5539, 0.7952, 0.7123, 0.8149]}, {"w": "its", "b": [0.7186, 0.7952, 0.7424, 0.8149]}, {"w": "weights", "b": [0.7487, 0.7952, 0.8272, 0.8149]}, {"w": "won’t", "b": [0.1294, 0.8157, 0.1878, 0.8354]}, {"w": "be", "b": [0.1941, 0.8157, 0.2179, 0.8354]}, {"w": "updated", "b": [0.2242, 0.8157, 0.3041, 0.8354]}, {"w": "when", "b": [0.3104, 0.8157, 0.365, 0.8354]}, {"w": "training", "b": [0.3714, 0.8157, 0.4498, 0.8354]}, {"w": "gan.", "b": [0.4561, 0.8157, 0.5078, 0.8369]}, {"w": "If", "b": [0.5141, 0.8157, 0.5309, 0.8354]}, {"w": "the", "b": [0.5372, 0.8157, 0.568, 0.8354]}, {"w": "discriminator", "b": [0.5743, 0.8157, 0.7089, 0.8354]}, {"w": "weights", "b": [0.7152, 0.8157, 0.7937, 0.8354]}, {"w": "could", "b": [0.8, 0.8157, 0.856, 0.8354]}, {"w": "be", "b": [0.1294, 0.8371, 0.1532, 0.8568]}, {"w": "updated", "b": [0.1595, 0.8371, 0.2394, 0.8568]}, {"w": "during", "b": [0.2457, 0.8371, 0.3116, 0.8568]}, {"w": "this", "b": [0.3179, 0.8371, 0.3543, 0.8568]}, {"w": "process,", "b": [0.3606, 0.8371, 0.4426, 0.8568]}, {"w": "then", "b": [0.4489, 0.8371, 0.4923, 0.8568]}, {"w": "you’d", "b": [0.4986, 0.8371, 0.5575, 0.8568]}, {"w": "be", "b": [0.5638, 0.8371, 0.5876, 0.8568]}, {"w": "training", "b": [0.5939, 0.8371, 0.6724, 0.8568]}, {"w": "the", "b": [0.6787, 0.8371, 0.7095, 0.8568]}, {"w": "discriminator", "b": [0.7158, 0.8371, 0.8504, 0.8568]}, {"w": "to", "b": [0.1294, 0.8576, 0.149, 0.8773]}, {"w": "always", "b": [0.1553, 0.8576, 0.2254, 0.8773]}, {"w": "predict", "b": [0.2317, 0.8576, 0.3018, 0.8773]}, {"w": "“real,”", "b": [0.308, 0.8576, 0.3745, 0.8773]}, {"w": "which", "b": [0.3808, 0.8576, 0.4425, 0.8773]}, {"w": "isn’t", "b": [0.4488, 0.8576, 0.4932, 0.8773]}, {"w": "what", "b": [0.4995, 0.8576, 0.5485, 0.8773]}, {"w": "you", "b": [0.5548, 0.8576, 0.5927, 0.8773]}, {"w": "want!", "b": [0.599, 0.8576, 0.6564, 0.8773]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 8.31. Adversarial network", "words": [{"w": "Listing", "b": [0.1294, 0.8954, 0.1862, 0.9102]}, {"w": "8.31.", "b": [0.1909, 0.8954, 0.2288, 0.9102]}, {"w": "Adversarial", "b": [0.2335, 0.8954, 0.3291, 0.9102]}, {"w": "network", "b": [0.3338, 0.8954, 0.4011, 0.9102]}]}]}, {"page": 406, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "discriminator.trainable = False 1 gan_input = keras.Input(shape=(latent_dim,)) gan_output = discriminator(generator(gan_input)) gan = keras.models.Model(gan_input, gan_output) gan_optimizer = keras.optimizers.RMSprop(lr=0.0004, clipvalue=1.0, decay=1e-8) gan.compile(optimizer=gan_optimizer, loss='binary_crossentropy')", "words": [{"w": "discriminator.trainable", "b": [0.1357, 0.0851, 0.3968, 0.1002]}, {"w": "=", "b": [0.4082, 0.0851, 0.4195, 0.1002]}, {"w": "False", "b": [0.4309, 0.0851, 0.4876, 0.1002]}, {"w": "1", "b": [0.7488, 0.0851, 0.7602, 0.1002]}, {"w": "gan_input", "b": [0.1357, 0.1154, 0.2379, 0.1305]}, {"w": "=", "b": [0.2492, 0.1154, 0.2606, 0.1305]}, {"w": "keras.Input(shape=(latent_dim,))", "b": [0.2719, 0.1154, 0.6352, 0.1305]}, {"w": "gan_output", "b": [0.1357, 0.1305, 0.2492, 0.1457]}, {"w": "=", "b": [0.2606, 0.1305, 0.2719, 0.1457]}, {"w": "discriminator(generator(gan_input))", "b": [0.2833, 0.1305, 0.6806, 0.1457]}, {"w": "gan", "b": [0.1357, 0.1457, 0.1698, 0.1608]}, {"w": "=", "b": [0.1811, 0.1457, 0.1925, 0.1608]}, {"w": "keras.models.Model(gan_input,", "b": [0.2038, 0.1457, 0.533, 0.1608]}, {"w": "gan_output)", "b": [0.5444, 0.1457, 0.6692, 0.1608]}, {"w": "gan_optimizer", "b": [0.1357, 0.176, 0.2833, 0.1911]}, {"w": "=", "b": [0.2946, 0.176, 0.306, 0.1911]}, {"w": "keras.optimizers.RMSprop(lr=0.0004,", "b": [0.3173, 0.176, 0.7146, 0.1911]}, {"w": "clipvalue=1.0,", "b": [0.1357, 0.1911, 0.2946, 0.2063]}, {"w": "decay=1e-8)", "b": [0.306, 0.1911, 0.4309, 0.2063]}, {"w": "gan.compile(optimizer=gan_optimizer,", "b": [0.1357, 0.2063, 0.5444, 0.2214]}, {"w": "loss='binary_crossentropy')", "b": [0.5557, 0.2063, 0.8622, 0.2214]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Sets discriminator weights to non-trainable (this will only apply to the gan model)", "words": [{"w": "1", "b": [0.1799, 0.2399, 0.1925, 0.2596]}, {"w": "Sets", "b": [0.1988, 0.2399, 0.2422, 0.2596]}, {"w": "discriminator", "b": [0.2485, 0.2399, 0.3957, 0.2596]}, {"w": "weights", "b": [0.402, 0.2399, 0.4833, 0.2596]}, {"w": "to", "b": [0.4896, 0.2399, 0.5106, 0.2596]}, {"w": "non-trainable", "b": [0.5169, 0.2399, 0.664, 0.2596]}, {"w": "(this", "b": [0.6704, 0.2399, 0.718, 0.2596]}, {"w": "will", "b": [0.7243, 0.2399, 0.7636, 0.2596]}, {"w": "only", "b": [0.7699, 0.2399, 0.8161, 0.2596]}, {"w": "apply", "b": [0.1799, 0.2604, 0.2402, 0.2801]}, {"w": "to", "b": [0.2465, 0.2604, 0.2675, 0.2801]}, {"w": "the", "b": [0.2738, 0.2604, 0.3074, 0.2801]}, {"w": "gan", "b": [0.3137, 0.2604, 0.353, 0.2801]}, {"w": "model)", "b": [0.3593, 0.2604, 0.4335, 0.2801]}]}, {"id": "b_2", "type": "paragraph", "text": "8.5.6. How to train your DCGAN", "words": [{"w": "8.5.6.", "b": [0.1294, 0.3076, 0.1862, 0.3274]}, {"w": "How", "b": [0.1925, 0.3076, 0.2429, 0.3274]}, {"w": "to", "b": [0.2492, 0.3076, 0.2702, 0.3274]}, {"w": "train", "b": [0.2766, 0.3076, 0.3298, 0.3274]}, {"w": "your", "b": [0.3361, 0.3076, 0.3866, 0.3274]}, {"w": "DCGAN", "b": [0.3929, 0.3076, 0.4853, 0.3274]}]}, {"id": "b_3", "type": "paragraph", "text": "Now you can begin training. To recapitulate, this is what the training loop looks like schematically. For each epoch, you do the following:", "words": [{"w": "Now", "b": [0.1294, 0.3504, 0.1785, 0.3701]}, {"w": "you", "b": [0.1848, 0.3504, 0.2226, 0.3701]}, {"w": "can", "b": [0.2289, 0.3504, 0.2639, 0.3701]}, {"w": "begin", "b": [0.2702, 0.3504, 0.3263, 0.3701]}, {"w": "training.", "b": [0.3326, 0.3504, 0.4174, 0.3701]}, {"w": "To", "b": [0.4237, 0.3504, 0.4499, 0.3701]}, {"w": "recapitulate,", "b": [0.4562, 0.3504, 0.5802, 0.3701]}, {"w": "this", "b": [0.5865, 0.3504, 0.623, 0.3701]}, {"w": "is", "b": [0.6293, 0.3504, 0.6461, 0.3701]}, {"w": "what", "b": [0.6524, 0.3504, 0.7014, 0.3701]}, {"w": "the", "b": [0.7077, 0.3504, 0.7386, 0.3701]}, {"w": "training", "b": [0.7449, 0.3504, 0.8233, 0.3701]}, {"w": "loop", "b": [0.1294, 0.3709, 0.1743, 0.3906]}, {"w": "looks", "b": [0.1806, 0.3709, 0.2352, 0.3906]}, {"w": "like", "b": [0.2415, 0.3709, 0.2794, 0.3906]}, {"w": "schematically.", "b": [0.2857, 0.3709, 0.429, 0.3906]}, {"w": "For", "b": [0.4353, 0.3709, 0.4704, 0.3906]}, {"w": "each", "b": [0.4767, 0.3709, 0.5229, 0.3906]}, {"w": "epoch,", "b": [0.5292, 0.3709, 0.5957, 0.3906]}, {"w": "you", "b": [0.602, 0.3709, 0.6399, 0.3906]}, {"w": "do", "b": [0.6462, 0.3709, 0.6714, 0.3906]}, {"w": "the", "b": [0.6777, 0.3709, 0.7085, 0.3906]}, {"w": "following:", "b": [0.7148, 0.3709, 0.8199, 0.3906]}]}, {"id": "b_4", "type": "paragraph", "text": "1. Draw random points in the latent space (random noise). 2. Generate images with generator using this random noise. 3. Mix the generated images with real ones. 4. Train discriminator using these mixed images, with corresponding targets: either “real” (for the real images) or “fake” (for the generated images). 5. Draw new random points in the latent space. 6. Train gan using these random vectors, with targets that all say “these are real images.” This updates the weights of the generator (only, because the discriminator is frozen inside gan) to move them toward getting the discriminator to predict “these are real images” for generated images: this trains the generator to fool the discriminator.", "words": [{"w": "1.", "b": [0.1551, 0.4092, 0.174, 0.429]}, {"w": "Draw", "b": [0.1799, 0.4092, 0.2359, 0.429]}, {"w": "random", "b": [0.2422, 0.4092, 0.3193, 0.429]}, {"w": "points", "b": [0.3256, 0.4092, 0.3872, 0.429]}, {"w": "in", "b": [0.3936, 0.4092, 0.4132, 0.429]}, {"w": "the", "b": [0.4195, 0.4092, 0.4503, 0.429]}, {"w": "latent", "b": [0.4566, 0.4092, 0.5127, 0.429]}, {"w": "space", "b": [0.519, 0.4092, 0.575, 0.429]}, {"w": "(random", "b": [0.5813, 0.4092, 0.6668, 0.429]}, {"w": "noise).", "b": [0.6731, 0.4092, 0.741, 0.429]}, {"w": "2.", "b": [0.1551, 0.4297, 0.174, 0.4495]}, {"w": "Generate", "b": [0.1799, 0.4297, 0.2709, 0.4495]}, {"w": "images", "b": [0.2772, 0.4297, 0.3487, 0.4495]}, {"w": "with", "b": [0.355, 0.4297, 0.3998, 0.4495]}, {"w": "generator", "b": [0.4061, 0.4308, 0.5423, 0.451]}, {"w": "using", "b": [0.5487, 0.4297, 0.6033, 0.4495]}, {"w": "this", "b": [0.6096, 0.4297, 0.6461, 0.4495]}, {"w": "random", "b": [0.6524, 0.4297, 0.7294, 0.4495]}, {"w": "noise.", "b": [0.7358, 0.4297, 0.7953, 0.4495]}, {"w": "3.", "b": [0.1551, 0.4511, 0.174, 0.4709]}, {"w": "Mix", "b": [0.1799, 0.4511, 0.2219, 0.4709]}, {"w": "the", "b": [0.2282, 0.4511, 0.259, 0.4709]}, {"w": "generated", "b": [0.2654, 0.4511, 0.3634, 0.4709]}, {"w": "images", "b": [0.3697, 0.4511, 0.4412, 0.4709]}, {"w": "with", "b": [0.4475, 0.4511, 0.4923, 0.4709]}, {"w": "real", "b": [0.4986, 0.4511, 0.5365, 0.4709]}, {"w": "ones.", "b": [0.5428, 0.4511, 0.5953, 0.4709]}, {"w": "4.", "b": [0.1551, 0.4716, 0.174, 0.4914]}, {"w": "Train", "b": [0.1799, 0.4716, 0.2336, 0.4914]}, {"w": "discriminator", "b": [0.2399, 0.4727, 0.4367, 0.4929]}, {"w": "using", "b": [0.443, 0.4716, 0.4976, 0.4914]}, {"w": "these", "b": [0.504, 0.4716, 0.5558, 0.4914]}, {"w": "mixed", "b": [0.5621, 0.4716, 0.6252, 0.4914]}, {"w": "images,", "b": [0.6315, 0.4716, 0.7092, 0.4914]}, {"w": "with", "b": [0.7155, 0.4716, 0.7604, 0.4914]}, {"w": "corresponding", "b": [0.1799, 0.493, 0.3242, 0.5127]}, {"w": "targets:", "b": [0.3305, 0.493, 0.4043, 0.5127]}, {"w": "either", "b": [0.4106, 0.493, 0.468, 0.5127]}, {"w": "“real”", "b": [0.4743, 0.493, 0.5345, 0.5127]}, {"w": "(for", "b": [0.5409, 0.493, 0.5787, 0.5127]}, {"w": "the", "b": [0.585, 0.493, 0.6158, 0.5127]}, {"w": "real", "b": [0.6221, 0.493, 0.6599, 0.5127]}, {"w": "images)", "b": [0.6662, 0.493, 0.7461, 0.5127]}, {"w": "or", "b": [0.7524, 0.493, 0.7734, 0.5127]}, {"w": "“fake”", "b": [0.7797, 0.493, 0.8455, 0.5127]}, {"w": "(for", "b": [0.1799, 0.5135, 0.2177, 0.5332]}, {"w": "the", "b": [0.224, 0.5135, 0.2548, 0.5332]}, {"w": "generated", "b": [0.2611, 0.5135, 0.3592, 0.5332]}, {"w": "images).", "b": [0.3655, 0.5135, 0.4516, 0.5332]}, {"w": "5.", "b": [0.1551, 0.534, 0.174, 0.5537]}, {"w": "Draw", "b": [0.1799, 0.534, 0.2359, 0.5537]}, {"w": "new", "b": [0.2422, 0.534, 0.2842, 0.5537]}, {"w": "random", "b": [0.2905, 0.534, 0.3676, 0.5537]}, {"w": "points", "b": [0.3739, 0.534, 0.4356, 0.5537]}, {"w": "in", "b": [0.4419, 0.534, 0.4615, 0.5537]}, {"w": "the", "b": [0.4678, 0.534, 0.4986, 0.5537]}, {"w": "latent", "b": [0.5049, 0.534, 0.561, 0.5537]}, {"w": "space.", "b": [0.5673, 0.534, 0.6296, 0.5537]}, {"w": "6.", "b": [0.1551, 0.5545, 0.174, 0.5742]}, {"w": "Train", "b": [0.1799, 0.5545, 0.2336, 0.5742]}, {"w": "gan", "b": [0.2399, 0.5555, 0.2853, 0.5757]}, {"w": "using", "b": [0.2916, 0.5545, 0.3463, 0.5742]}, {"w": "these", "b": [0.3526, 0.5545, 0.4044, 0.5742]}, {"w": "random", "b": [0.4107, 0.5545, 0.4878, 0.5742]}, {"w": "vectors,", "b": [0.4941, 0.5545, 0.5733, 0.5742]}, {"w": "with", "b": [0.5796, 0.5545, 0.6244, 0.5742]}, {"w": "targets", "b": [0.6307, 0.5545, 0.6975, 0.5742]}, {"w": "that", "b": [0.7038, 0.5545, 0.7416, 0.5742]}, {"w": "all", "b": [0.7479, 0.5545, 0.7732, 0.5742]}, {"w": "say", "b": [0.7795, 0.5545, 0.8131, 0.5742]}, {"w": "“these", "b": [0.1799, 0.5759, 0.2429, 0.5956]}, {"w": "are", "b": [0.2492, 0.5759, 0.28, 0.5956]}, {"w": "real", "b": [0.2863, 0.5759, 0.3241, 0.5956]}, {"w": "images.”", "b": [0.3304, 0.5759, 0.4194, 0.5956]}, {"w": "This", "b": [0.4257, 0.5759, 0.4706, 0.5956]}, {"w": "updates", "b": [0.4769, 0.5759, 0.5539, 0.5956]}, {"w": "the", "b": [0.5602, 0.5759, 0.5911, 0.5956]}, {"w": "weights", "b": [0.5974, 0.5759, 0.6759, 0.5956]}, {"w": "of", "b": [0.6822, 0.5759, 0.7032, 0.5956]}, {"w": "the", "b": [0.7095, 0.5759, 0.7403, 0.5956]}, {"w": "generator", "b": [0.7466, 0.5759, 0.8419, 0.5956]}, {"w": "(only,", "b": [0.1799, 0.5964, 0.2378, 0.6161]}, {"w": "because", "b": [0.2441, 0.5964, 0.3239, 0.6161]}, {"w": "the", "b": [0.3302, 0.5964, 0.3611, 0.6161]}, {"w": "discriminator", "b": [0.3674, 0.5964, 0.5019, 0.6161]}, {"w": "is", "b": [0.5082, 0.5964, 0.525, 0.6161]}, {"w": "frozen", "b": [0.5313, 0.5964, 0.5958, 0.6161]}, {"w": "inside", "b": [0.6021, 0.5964, 0.6623, 0.6161]}, {"w": "gan)", "b": [0.6686, 0.5964, 0.7224, 0.6176]}, {"w": "to", "b": [0.7287, 0.5964, 0.7483, 0.6161]}, {"w": "move", "b": [0.7546, 0.5964, 0.8107, 0.6161]}, {"w": "them", "b": [0.817, 0.5964, 0.8674, 0.6161]}, {"w": "toward", "b": [0.1799, 0.6178, 0.2499, 0.6375]}, {"w": "getting", "b": [0.2562, 0.6178, 0.3263, 0.6375]}, {"w": "the", "b": [0.3326, 0.6178, 0.3634, 0.6375]}, {"w": "discriminator", "b": [0.3697, 0.6178, 0.5043, 0.6375]}, {"w": "to", "b": [0.5106, 0.6178, 0.5302, 0.6375]}, {"w": "predict", "b": [0.5365, 0.6178, 0.6066, 0.6375]}, {"w": "“these", "b": [0.6129, 0.6178, 0.6759, 0.6375]}, {"w": "are", "b": [0.6822, 0.6178, 0.713, 0.6375]}, {"w": "real", "b": [0.7193, 0.6178, 0.7571, 0.6375]}, {"w": "images”", "b": [0.7634, 0.6178, 0.8461, 0.6375]}, {"w": "for", "b": [0.1799, 0.6383, 0.2093, 0.658]}, {"w": "generated", "b": [0.2156, 0.6383, 0.3136, 0.658]}, {"w": "images:", "b": [0.3199, 0.6383, 0.3984, 0.658]}, {"w": "this", "b": [0.4047, 0.6383, 0.4412, 0.658]}, {"w": "trains", "b": [0.4475, 0.6383, 0.5035, 0.658]}, {"w": "the", "b": [0.5098, 0.6383, 0.5407, 0.658]}, {"w": "generator", "b": [0.547, 0.6383, 0.6422, 0.658]}, {"w": "to", "b": [0.6485, 0.6383, 0.6681, 0.658]}, {"w": "fool", "b": [0.6744, 0.6383, 0.715, 0.658]}, {"w": "the", "b": [0.7213, 0.6383, 0.7522, 0.658]}, {"w": "discriminator.", "b": [0.1799, 0.6588, 0.3193, 0.6785]}]}, {"id": "b_5", "type": "paragraph", "text": "Let’s implement it.", "words": [{"w": "Let’s", "b": [0.1294, 0.7016, 0.1798, 0.7213]}, {"w": "implement", "b": [0.1862, 0.7016, 0.2941, 0.7213]}, {"w": "it.", "b": [0.3004, 0.7016, 0.3207, 0.7213]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 8.32. Implementing GAN training", "words": [{"w": "Listing", "b": [0.1294, 0.7394, 0.1862, 0.7542]}, {"w": "8.32.", "b": [0.1909, 0.7394, 0.2288, 0.7542]}, {"w": "Implementing", "b": [0.2335, 0.7394, 0.347, 0.7542]}, {"w": "GAN", "b": [0.3517, 0.7394, 0.3938, 0.7542]}, {"w": "training", "b": [0.3985, 0.7394, 0.4637, 0.7542]}]}, {"id": "b_7", "type": "paragraph", "text": "import os from keras.preprocessing import image (x_train, y_train), (_, _) = keras.datasets.cifar10.load_data() 1 x_train = x_train[y_train.flatten() == 6] 2", "words": [{"w": "import", "b": [0.1357, 0.7678, 0.2038, 0.783]}, {"w": "os", "b": [0.2152, 0.7678, 0.2379, 0.783]}, {"w": "from", "b": [0.1357, 0.783, 0.1811, 0.7981]}, {"w": "keras.preprocessing", "b": [0.1925, 0.783, 0.4082, 0.7981]}, {"w": "import", "b": [0.4195, 0.783, 0.4876, 0.7981]}, {"w": "image", "b": [0.499, 0.783, 0.5557, 0.7981]}, {"w": "(x_train,", "b": [0.1357, 0.8133, 0.2379, 0.8284]}, {"w": "y_train),", "b": [0.2492, 0.8133, 0.3514, 0.8284]}, {"w": "(_,", "b": [0.3628, 0.8133, 0.3968, 0.8284]}, {"w": "_)", "b": [0.4082, 0.8133, 0.4309, 0.8284]}, {"w": "=", "b": [0.4422, 0.8133, 0.4536, 0.8284]}, {"w": "keras.datasets.cifar10.load_data()", "b": [0.4649, 0.8133, 0.8509, 0.8284]}, {"w": "1", "b": [0.1357, 0.8284, 0.1471, 0.8436]}, {"w": "x_train", "b": [0.1357, 0.8587, 0.2152, 0.8739]}, {"w": "=", "b": [0.2265, 0.8587, 0.2379, 0.8739]}, {"w": "x_train[y_train.flatten()", "b": [0.2492, 0.8587, 0.533, 0.8739]}, {"w": "==", "b": [0.5444, 0.8587, 0.5671, 0.8739]}, {"w": "6]", "b": [0.5784, 0.8587, 0.6011, 0.8739]}, {"w": "2", "b": [0.1357, 0.8739, 0.1471, 0.889]}]}]}, {"page": 407, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "x_train = x_train.reshape( (x_train.shape[0],) + 3 (height, width, channels)).astype('float32') / 255. 3 iterations = 10000 batch_size = 20 save_dir = 'your_dir' 4 start = 0 for step in range(iterations): random_latent_vectors = np.random.normal(size=(batch_size, 5 latent_dim)) 5 generated_images = generator.predict(random_latent_vectors) 6 stop = start + batch_size 7 real_images = x_train[start: stop] 7 combined_images = np.concatenate([generated_images, real_images]) 7 labels = np.concatenate([np.ones((batch_size, 1)), 8 np.zeros((batch_size, 1))]) 8 labels += 0.05 * np.random.random(labels.shape) 9 d_loss = discriminator.train_on_batch(combined_images, labels) 10 random_latent_vectors = np.random.normal(size=(batch_size, 11 latent_dim)) 11 misleading_targets = np.zeros((batch_size, 1)) 12 a_loss = gan.train_on_batch(random_latent_vectors, 13 misleading_targets) 13 start += batch_size if start > len(x_train) - batch_size: start = 0", "words": [{"w": "x_train", "b": [0.1357, 0.0851, 0.2152, 0.1002]}, {"w": "=", "b": [0.2265, 0.0851, 0.2379, 0.1002]}, {"w": "x_train.reshape(", "b": [0.2492, 0.0851, 0.4309, 0.1002]}, {"w": "(x_train.shape[0],)", "b": [0.1811, 0.1002, 0.3968, 0.1154]}, {"w": "+", "b": [0.4082, 0.1002, 0.4195, 0.1154]}, {"w": "3", "b": [0.1357, 0.1154, 0.1471, 0.1305]}, {"w": "(height,", "b": [0.1811, 0.1305, 0.2719, 0.1457]}, {"w": "width,", "b": [0.2833, 0.1305, 0.3514, 0.1457]}, {"w": "channels)).astype('float32')", "b": [0.3628, 0.1305, 0.6806, 0.1457]}, {"w": "/", "b": [0.6919, 0.1305, 0.7033, 0.1457]}, {"w": "255.", "b": [0.7146, 0.1305, 0.7601, 0.1457]}, {"w": "3", "b": [0.1357, 0.1457, 0.1471, 0.1608]}, {"w": "iterations", "b": [0.1357, 0.176, 0.2492, 0.1911]}, {"w": "=", "b": [0.2606, 0.176, 0.2719, 0.1911]}, {"w": "10000", "b": [0.2833, 0.176, 0.34, 0.1911]}, {"w": "batch_size", "b": [0.1357, 0.1911, 0.2492, 0.2063]}, {"w": "=", "b": [0.2606, 0.1911, 0.2719, 0.2063]}, {"w": "20", "b": [0.2833, 0.1911, 0.306, 0.2063]}, {"w": "save_dir", "b": [0.1357, 0.2063, 0.2265, 0.2214]}, {"w": "=", "b": [0.2379, 0.2063, 0.2492, 0.2214]}, {"w": "'your_dir'", "b": [0.2606, 0.2063, 0.3741, 0.2214]}, {"w": "4", "b": [0.1357, 0.2215, 0.1471, 0.2366]}, {"w": "start", "b": [0.1357, 0.2518, 0.1925, 0.2669]}, {"w": "=", "b": [0.2038, 0.2518, 0.2152, 0.2669]}, {"w": "0", "b": [0.2265, 0.2518, 0.2379, 0.2669]}, {"w": "for", "b": [0.1357, 0.2669, 0.1698, 0.2821]}, {"w": "step", "b": [0.1811, 0.2669, 0.2265, 0.2821]}, {"w": "in", "b": [0.2379, 0.2669, 0.2606, 0.2821]}, {"w": "range(iterations):", "b": [0.2719, 0.2669, 0.4763, 0.2821]}, {"w": "random_latent_vectors", "b": [0.1811, 0.2821, 0.4195, 0.2972]}, {"w": "=", "b": [0.4309, 0.2821, 0.4422, 0.2972]}, {"w": "np.random.normal(size=(batch_size,", "b": [0.4536, 0.2821, 0.8395, 0.2972]}, {"w": "5", "b": [0.1357, 0.2972, 0.1471, 0.3124]}, {"w": "latent_dim))", "b": [0.6352, 0.3124, 0.7714, 0.3275]}, {"w": "5", "b": [0.1357, 0.3275, 0.1471, 0.3427]}, {"w": "generated_images", "b": [0.1811, 0.3578, 0.3628, 0.373]}, {"w": "=", "b": [0.3741, 0.3578, 0.3855, 0.373]}, {"w": "generator.predict(random_latent_vectors)", "b": [0.3968, 0.3578, 0.8509, 0.373]}, {"w": "6", "b": [0.1357, 0.373, 0.1471, 0.3881]}, {"w": "stop", "b": [0.1811, 0.4033, 0.2265, 0.4184]}, {"w": "=", "b": [0.2379, 0.4033, 0.2492, 0.4184]}, {"w": "start", "b": [0.2606, 0.4033, 0.3173, 0.4184]}, {"w": "+", "b": [0.3287, 0.4033, 0.34, 0.4184]}, {"w": "batch_size", "b": [0.3514, 0.4033, 0.4649, 0.4184]}, {"w": "7", "b": [0.1357, 0.4184, 0.1471, 0.4336]}, {"w": "real_images", "b": [0.1811, 0.4336, 0.306, 0.4487]}, {"w": "=", "b": [0.3173, 0.4336, 0.3287, 0.4487]}, {"w": "x_train[start:", "b": [0.34, 0.4336, 0.499, 0.4487]}, {"w": "stop]", "b": [0.5103, 0.4336, 0.5671, 0.4487]}, {"w": "7", "b": [0.1357, 0.4487, 0.1471, 0.4639]}, {"w": "combined_images", "b": [0.1811, 0.4639, 0.3514, 0.479]}, {"w": "=", "b": [0.3628, 0.4639, 0.3741, 0.479]}, {"w": "np.concatenate([generated_images,", "b": [0.3855, 0.4639, 0.7601, 0.479]}, {"w": "real_images])", "b": [0.1357, 0.479, 0.2833, 0.4942]}, {"w": "7", "b": [0.3514, 0.479, 0.3628, 0.4942]}, {"w": "labels", "b": [0.1811, 0.5093, 0.2492, 0.5245]}, {"w": "=", "b": [0.2606, 0.5093, 0.2719, 0.5245]}, {"w": "np.concatenate([np.ones((batch_size,", "b": [0.2833, 0.5093, 0.6919, 0.5245]}, {"w": "1)),", "b": [0.7033, 0.5093, 0.7487, 0.5245]}, {"w": "8", "b": [0.1357, 0.5245, 0.1471, 0.5396]}, {"w": "np.zeros((batch_size,", "b": [0.4649, 0.5397, 0.7033, 0.5548]}, {"w": "1))])", "b": [0.7146, 0.5397, 0.7714, 0.5548]}, {"w": "8", "b": [0.1357, 0.5548, 0.1471, 0.57]}, {"w": "labels", "b": [0.1811, 0.57, 0.2492, 0.5851]}, {"w": "+=", "b": [0.2606, 0.57, 0.2833, 0.5851]}, {"w": "0.05", "b": [0.2946, 0.57, 0.34, 0.5851]}, {"w": "*", "b": [0.3514, 0.57, 0.3628, 0.5851]}, {"w": "np.random.random(labels.shape)", "b": [0.3741, 0.57, 0.7146, 0.5851]}, {"w": "9", "b": [0.1357, 0.5851, 0.1471, 0.6003]}, {"w": "d_loss", "b": [0.1811, 0.6154, 0.2492, 0.6306]}, {"w": "=", "b": [0.2606, 0.6154, 0.2719, 0.6306]}, {"w": "discriminator.train_on_batch(combined_images,", "b": [0.2833, 0.6154, 0.7941, 0.6306]}, {"w": "labels)", "b": [0.1357, 0.6306, 0.2152, 0.6457]}, {"w": "10", "b": [0.3174, 0.6306, 0.3401, 0.6457]}, {"w": "random_latent_vectors", "b": [0.1811, 0.6609, 0.4195, 0.676]}, {"w": "=", "b": [0.4309, 0.6609, 0.4422, 0.676]}, {"w": "np.random.normal(size=(batch_size,", "b": [0.4536, 0.6609, 0.8395, 0.676]}, {"w": "11", "b": [0.1357, 0.676, 0.1584, 0.6912]}, {"w": "latent_dim))", "b": [0.6352, 0.6912, 0.7714, 0.7063]}, {"w": "11", "b": [0.1357, 0.7063, 0.1584, 0.7215]}, {"w": "misleading_targets", "b": [0.1811, 0.7366, 0.3855, 0.7518]}, {"w": "=", "b": [0.3968, 0.7366, 0.4082, 0.7518]}, {"w": "np.zeros((batch_size,", "b": [0.4195, 0.7366, 0.6579, 0.7518]}, {"w": "1))", "b": [0.6692, 0.7366, 0.7033, 0.7518]}, {"w": "12", "b": [0.1357, 0.7518, 0.1584, 0.7669]}, {"w": "a_loss", "b": [0.1811, 0.7821, 0.2492, 0.7972]}, {"w": "=", "b": [0.2606, 0.7821, 0.2719, 0.7972]}, {"w": "gan.train_on_batch(random_latent_vectors,", "b": [0.2833, 0.7821, 0.7487, 0.7972]}, {"w": "13", "b": [0.1357, 0.7972, 0.1584, 0.8124]}, {"w": "misleading_targets)", "b": [0.499, 0.8124, 0.7146, 0.8275]}, {"w": "13", "b": [0.1357, 0.8275, 0.1584, 0.8427]}, {"w": "start", "b": [0.1811, 0.8579, 0.2379, 0.873]}, {"w": "+=", "b": [0.2492, 0.8579, 0.2719, 0.873]}, {"w": "batch_size", "b": [0.2833, 0.8579, 0.3968, 0.873]}, {"w": "if", "b": [0.1811, 0.873, 0.2038, 0.8882]}, {"w": "start", "b": [0.2152, 0.873, 0.2719, 0.8882]}, {"w": ">", "b": [0.2833, 0.873, 0.2946, 0.8882]}, {"w": "len(x_train)", "b": [0.306, 0.873, 0.4422, 0.8882]}, {"w": "-", "b": [0.4536, 0.873, 0.4649, 0.8882]}, {"w": "batch_size:", "b": [0.4763, 0.873, 0.6011, 0.8882]}, {"w": "start", "b": [0.2038, 0.8882, 0.2606, 0.9033]}, {"w": "=", "b": [0.2719, 0.8882, 0.2833, 0.9033]}, {"w": "0", "b": [0.2946, 0.8882, 0.306, 0.9033]}]}]}, {"page": 408, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "if step % 100 == 0: 14 gan.save_weights('gan.h5') 15 print('discriminator loss:', d_loss) 16 print('adversarial loss:', a_loss) 16 img = image.array_to_img(generated_images[0] * 255., scale=False) 17 img.save(os.path.join(save_dir, 17 'generated_frog' + str(step) + '.png')) 17 img = image.array_to_img(real_images[0] * 255., scale=False) 18 img.save(os.path.join(save_dir, 18 'real_frog' + str(step) + '.png')) 18", "words": [{"w": "if", "b": [0.1811, 0.0851, 0.2038, 0.1002]}, {"w": "step", "b": [0.2152, 0.0851, 0.2606, 0.1002]}, {"w": "%", "b": [0.2719, 0.0851, 0.2833, 0.1002]}, {"w": "100", "b": [0.2946, 0.0851, 0.3287, 0.1002]}, {"w": "==", "b": [0.34, 0.0851, 0.3628, 0.1002]}, {"w": "0:", "b": [0.3741, 0.0851, 0.3968, 0.1002]}, {"w": "14", "b": [0.1357, 0.1002, 0.1584, 0.1154]}, {"w": "gan.save_weights('gan.h5')", "b": [0.2265, 0.1154, 0.5217, 0.1305]}, {"w": "15", "b": [0.1357, 0.1305, 0.1584, 0.1457]}, {"w": "print('discriminator", "b": [0.2265, 0.1608, 0.4536, 0.176]}, {"w": "loss:',", "b": [0.4649, 0.1608, 0.5444, 0.176]}, {"w": "d_loss)", "b": [0.5557, 0.1608, 0.6352, 0.176]}, {"w": "16", "b": [0.1357, 0.176, 0.1584, 0.1911]}, {"w": "print('adversarial", "b": [0.2265, 0.1911, 0.4309, 0.2063]}, {"w": "loss:',", "b": [0.4422, 0.1911, 0.5217, 0.2063]}, {"w": "a_loss)", "b": [0.533, 0.1911, 0.6125, 0.2063]}, {"w": "16", "b": [0.1357, 0.2063, 0.1584, 0.2214]}, {"w": "img", "b": [0.2265, 0.2366, 0.2606, 0.2518]}, {"w": "=", "b": [0.2719, 0.2366, 0.2833, 0.2518]}, {"w": "image.array_to_img(generated_images[0]", "b": [0.2946, 0.2366, 0.726, 0.2518]}, {"w": "*", "b": [0.7374, 0.2366, 0.7487, 0.2518]}, {"w": "255.,", "b": [0.7601, 0.2366, 0.8168, 0.2518]}, {"w": "scale=False)", "b": [0.1357, 0.2518, 0.2719, 0.2669]}, {"w": "17", "b": [0.2947, 0.2518, 0.3174, 0.2669]}, {"w": "img.save(os.path.join(save_dir,", "b": [0.2265, 0.2669, 0.5784, 0.2821]}, {"w": "17", "b": [0.1357, 0.2821, 0.1584, 0.2972]}, {"w": "'generated_frog'", "b": [0.3855, 0.2972, 0.5671, 0.3124]}, {"w": "+", "b": [0.5784, 0.2972, 0.5898, 0.3124]}, {"w": "str(step)", "b": [0.6011, 0.2972, 0.7033, 0.3124]}, {"w": "+", "b": [0.7146, 0.2972, 0.726, 0.3124]}, {"w": "'.png'))", "b": [0.7374, 0.2972, 0.8282, 0.3124]}, {"w": "17", "b": [0.1357, 0.3124, 0.1584, 0.3275]}, {"w": "img", "b": [0.2265, 0.3427, 0.2606, 0.3578]}, {"w": "=", "b": [0.2719, 0.3427, 0.2833, 0.3578]}, {"w": "image.array_to_img(real_images[0]", "b": [0.2946, 0.3427, 0.6692, 0.3578]}, {"w": "*", "b": [0.6806, 0.3427, 0.6919, 0.3578]}, {"w": "255.,", "b": [0.7033, 0.3427, 0.7601, 0.3578]}, {"w": "scale=False)", "b": [0.1357, 0.3578, 0.2719, 0.373]}, {"w": "18", "b": [0.3514, 0.3578, 0.3741, 0.373]}, {"w": "img.save(os.path.join(save_dir,", "b": [0.2265, 0.373, 0.5784, 0.3881]}, {"w": "18", "b": [0.1357, 0.3881, 0.1584, 0.4033]}, {"w": "'real_frog'", "b": [0.3855, 0.4033, 0.5103, 0.4184]}, {"w": "+", "b": [0.5217, 0.4033, 0.533, 0.4184]}, {"w": "str(step)", "b": [0.5444, 0.4033, 0.6465, 0.4184]}, {"w": "+", "b": [0.6579, 0.4033, 0.6692, 0.4184]}, {"w": "'.png'))", "b": [0.6806, 0.4033, 0.7714, 0.4184]}, {"w": "18", "b": [0.1357, 0.4184, 0.1584, 0.4336]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Loads CIFAR10 data 2 Selects frog images (class 6) 3 Normalizes data 4 Specifies where you want to save generated images 5 Samples random points in the latent space 6 Decodes them to fake images 7 Combines them with real images 8 Assembles labels, discrim-inating real from fake images 9 Adds random noise to the labels—an important trick! 10 Trains the discriminator 11 Samples random points in the latent space 12 Assembles labels that say “these are all real images” (it’s a lie!) 13 Trains the generator (via the gan model, where the discrim- inator weights are frozen) 14 Occasionally saves and plots (every 100 steps) 15 Saves model weights 16 Prints metrics 17 Saves one generated image 18 Saves one real image for comparison", "words": [{"w": "1", "b": [0.1799, 0.452, 0.1925, 0.4717]}, {"w": "Loads", "b": [0.1988, 0.452, 0.2647, 0.4717]}, {"w": "CIFAR10", "b": [0.271, 0.452, 0.3742, 0.4717]}, {"w": "data", "b": [0.3805, 0.452, 0.4282, 0.4717]}, {"w": "2", "b": [0.1799, 0.4725, 0.1925, 0.4922]}, {"w": "Selects", "b": [0.1988, 0.4725, 0.2716, 0.4922]}, {"w": "frog", "b": [0.2779, 0.4725, 0.3223, 0.4922]}, {"w": "images", "b": [0.3286, 0.4725, 0.4029, 0.4922]}, {"w": "(class", "b": [0.4092, 0.4725, 0.468, 0.4922]}, {"w": "6)", "b": [0.4743, 0.4725, 0.4953, 0.4922]}, {"w": "3", "b": [0.1799, 0.493, 0.1925, 0.5127]}, {"w": "Normalizes", "b": [0.1988, 0.493, 0.3207, 0.5127]}, {"w": "data", "b": [0.327, 0.493, 0.3746, 0.5127]}, {"w": "4", "b": [0.1799, 0.5135, 0.1925, 0.5332]}, {"w": "Specifies", "b": [0.1988, 0.5135, 0.2927, 0.5332]}, {"w": "where", "b": [0.299, 0.5135, 0.3644, 0.5332]}, {"w": "you", "b": [0.3707, 0.5135, 0.4099, 0.5332]}, {"w": "want", "b": [0.4162, 0.5135, 0.4695, 0.5332]}, {"w": "to", "b": [0.4758, 0.5135, 0.4968, 0.5332]}, {"w": "save", "b": [0.5031, 0.5135, 0.5493, 0.5332]}, {"w": "generated", "b": [0.5556, 0.5135, 0.6621, 0.5332]}, {"w": "images", "b": [0.6684, 0.5135, 0.7427, 0.5332]}, {"w": "5", "b": [0.1799, 0.534, 0.1925, 0.5537]}, {"w": "Samples", "b": [0.1988, 0.534, 0.2885, 0.5537]}, {"w": "random", "b": [0.2948, 0.534, 0.3803, 0.5537]}, {"w": "points", "b": [0.3866, 0.534, 0.4525, 0.5537]}, {"w": "in", "b": [0.4588, 0.534, 0.4798, 0.5537]}, {"w": "the", "b": [0.4861, 0.534, 0.5198, 0.5537]}, {"w": "latent", "b": [0.5261, 0.534, 0.5877, 0.5537]}, {"w": "space", "b": [0.594, 0.534, 0.6529, 0.5537]}, {"w": "6", "b": [0.1799, 0.5545, 0.1925, 0.5742]}, {"w": "Decodes", "b": [0.1988, 0.5545, 0.287, 0.5742]}, {"w": "them", "b": [0.2934, 0.5545, 0.348, 0.5742]}, {"w": "to", "b": [0.3543, 0.5545, 0.3753, 0.5742]}, {"w": "fake", "b": [0.3816, 0.5545, 0.4279, 0.5742]}, {"w": "images", "b": [0.4342, 0.5545, 0.5084, 0.5742]}, {"w": "7", "b": [0.1799, 0.575, 0.1925, 0.5947]}, {"w": "Combines", "b": [0.1988, 0.575, 0.3067, 0.5947]}, {"w": "them", "b": [0.313, 0.575, 0.3676, 0.5947]}, {"w": "with", "b": [0.374, 0.575, 0.4216, 0.5947]}, {"w": "real", "b": [0.4279, 0.575, 0.4695, 0.5947]}, {"w": "images", "b": [0.4758, 0.575, 0.5501, 0.5947]}, {"w": "8", "b": [0.1799, 0.5955, 0.1925, 0.6152]}, {"w": "Assembles", "b": [0.1988, 0.5955, 0.3109, 0.6152]}, {"w": "labels,", "b": [0.3172, 0.5955, 0.3852, 0.6152]}, {"w": "discrim-inating", "b": [0.3915, 0.5955, 0.5569, 0.6152]}, {"w": "real", "b": [0.5632, 0.5955, 0.6047, 0.6152]}, {"w": "from", "b": [0.611, 0.5955, 0.6638, 0.6152]}, {"w": "fake", "b": [0.6701, 0.5955, 0.7163, 0.6152]}, {"w": "images", "b": [0.7226, 0.5955, 0.7969, 0.6152]}, {"w": "9", "b": [0.1799, 0.616, 0.1925, 0.6357]}, {"w": "Adds", "b": [0.1988, 0.616, 0.2549, 0.6357]}, {"w": "random", "b": [0.2612, 0.616, 0.3467, 0.6357]}, {"w": "noise", "b": [0.353, 0.616, 0.4076, 0.6357]}, {"w": "to", "b": [0.4139, 0.616, 0.4349, 0.6357]}, {"w": "the", "b": [0.4413, 0.616, 0.4749, 0.6357]}, {"w": "labels—an", "b": [0.4812, 0.616, 0.5947, 0.6357]}, {"w": "important", "b": [0.601, 0.616, 0.7103, 0.6357]}, {"w": "trick!", "b": [0.7166, 0.616, 0.7769, 0.6357]}, {"w": "10", "b": [0.1799, 0.6365, 0.2051, 0.6562]}, {"w": "Trains", "b": [0.2114, 0.6365, 0.281, 0.6562]}, {"w": "the", "b": [0.2873, 0.6365, 0.3209, 0.6562]}, {"w": "discriminator", "b": [0.3273, 0.6365, 0.4744, 0.6562]}, {"w": "11", "b": [0.1799, 0.657, 0.2037, 0.6767]}, {"w": "Samples", "b": [0.21, 0.657, 0.2997, 0.6767]}, {"w": "random", "b": [0.306, 0.657, 0.3915, 0.6767]}, {"w": "points", "b": [0.3978, 0.657, 0.4637, 0.6767]}, {"w": "in", "b": [0.47, 0.657, 0.491, 0.6767]}, {"w": "the", "b": [0.4973, 0.657, 0.531, 0.6767]}, {"w": "latent", "b": [0.5373, 0.657, 0.5989, 0.6767]}, {"w": "space", "b": [0.6052, 0.657, 0.6641, 0.6767]}, {"w": "12", "b": [0.1799, 0.6775, 0.2051, 0.6972]}, {"w": "Assembles", "b": [0.2114, 0.6775, 0.3235, 0.6972]}, {"w": "labels", "b": [0.3298, 0.6775, 0.3915, 0.6972]}, {"w": "that", "b": [0.3978, 0.6775, 0.4412, 0.6972]}, {"w": "say", "b": [0.4475, 0.6775, 0.4826, 0.6972]}, {"w": "“these", "b": [0.4889, 0.6775, 0.5561, 0.6972]}, {"w": "are", "b": [0.5624, 0.6775, 0.597, 0.6972]}, {"w": "all", "b": [0.6033, 0.6775, 0.6299, 0.6972]}, {"w": "real", "b": [0.6363, 0.6775, 0.6778, 0.6972]}, {"w": "images”", "b": [0.6841, 0.6775, 0.771, 0.6972]}, {"w": "(it’s", "b": [0.7773, 0.6775, 0.8184, 0.6972]}, {"w": "a", "b": [0.8247, 0.6775, 0.8373, 0.6972]}, {"w": "lie!)", "b": [0.1799, 0.698, 0.2219, 0.7177]}, {"w": "13", "b": [0.1799, 0.7185, 0.2051, 0.7382]}, {"w": "Trains", "b": [0.2114, 0.7185, 0.281, 0.7382]}, {"w": "the", "b": [0.2873, 0.7185, 0.3209, 0.7382]}, {"w": "generator", "b": [0.3273, 0.7185, 0.4323, 0.7382]}, {"w": "(via", "b": [0.4386, 0.7185, 0.4793, 0.7382]}, {"w": "the", "b": [0.4856, 0.7185, 0.5192, 0.7382]}, {"w": "gan", "b": [0.5255, 0.7185, 0.5648, 0.7382]}, {"w": "model,", "b": [0.5711, 0.7185, 0.6432, 0.7382]}, {"w": "where", "b": [0.6495, 0.7185, 0.7149, 0.7382]}, {"w": "the", "b": [0.7212, 0.7185, 0.7548, 0.7382]}, {"w": "discrim-", "b": [0.7611, 0.7185, 0.8508, 0.7382]}, {"w": "inator", "b": [0.1799, 0.739, 0.2457, 0.7587]}, {"w": "weights", "b": [0.252, 0.739, 0.3333, 0.7587]}, {"w": "are", "b": [0.3396, 0.739, 0.3742, 0.7587]}, {"w": "frozen)", "b": [0.3805, 0.739, 0.4571, 0.7587]}, {"w": "14", "b": [0.1799, 0.7595, 0.2051, 0.7793]}, {"w": "Occasionally", "b": [0.2114, 0.7595, 0.3488, 0.7793]}, {"w": "saves", "b": [0.3551, 0.7595, 0.4111, 0.7793]}, {"w": "and", "b": [0.4174, 0.7595, 0.4581, 0.7793]}, {"w": "plots", "b": [0.4644, 0.7595, 0.5162, 0.7793]}, {"w": "(every", "b": [0.5226, 0.7595, 0.5898, 0.7793]}, {"w": "100", "b": [0.5961, 0.7595, 0.6339, 0.7793]}, {"w": "steps)", "b": [0.6402, 0.7595, 0.7019, 0.7793]}, {"w": "15", "b": [0.1799, 0.78, 0.2051, 0.7997]}, {"w": "Saves", "b": [0.2114, 0.78, 0.2717, 0.7997]}, {"w": "model", "b": [0.278, 0.78, 0.3438, 0.7997]}, {"w": "weights", "b": [0.3501, 0.78, 0.4314, 0.7997]}, {"w": "16", "b": [0.1799, 0.8005, 0.2051, 0.8203]}, {"w": "Prints", "b": [0.2114, 0.8005, 0.2773, 0.8203]}, {"w": "metrics", "b": [0.2836, 0.8005, 0.3634, 0.8203]}, {"w": "17", "b": [0.1799, 0.821, 0.2051, 0.8407]}, {"w": "Saves", "b": [0.2114, 0.821, 0.2717, 0.8407]}, {"w": "one", "b": [0.278, 0.821, 0.3158, 0.8407]}, {"w": "generated", "b": [0.3221, 0.821, 0.4286, 0.8407]}, {"w": "image", "b": [0.4349, 0.821, 0.4993, 0.8407]}, {"w": "18", "b": [0.1799, 0.8415, 0.2051, 0.8612]}, {"w": "Saves", "b": [0.2114, 0.8415, 0.2717, 0.8612]}, {"w": "one", "b": [0.278, 0.8415, 0.3158, 0.8612]}, {"w": "real", "b": [0.3221, 0.8415, 0.3637, 0.8612]}, {"w": "image", "b": [0.37, 0.8415, 0.4344, 0.8612]}, {"w": "for", "b": [0.4407, 0.8415, 0.473, 0.8612]}, {"w": "comparison", "b": [0.4793, 0.8415, 0.6054, 0.8612]}]}]}, {"page": 409, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "When training, you may see the adversarial loss begin to increase considerably, while the discriminative loss tends to zero—the discriminator may end up dominating the generator. If that’s the case, try reducing the discriminator learning rate, and increase the dropout rate of the discriminator.", "words": [{"w": "When", "b": [0.1294, 0.0857, 0.1897, 0.1054]}, {"w": "training,", "b": [0.196, 0.0857, 0.2807, 0.1054]}, {"w": "you", "b": [0.287, 0.0857, 0.3249, 0.1054]}, {"w": "may", "b": [0.3312, 0.0857, 0.3746, 0.1054]}, {"w": "see", "b": [0.3809, 0.0857, 0.4132, 0.1054]}, {"w": "the", "b": [0.4195, 0.0857, 0.4503, 0.1054]}, {"w": "adversarial", "b": [0.4566, 0.0857, 0.5673, 0.1054]}, {"w": "loss", "b": [0.5736, 0.0857, 0.6128, 0.1054]}, {"w": "begin", "b": [0.6191, 0.0857, 0.6752, 0.1054]}, {"w": "to", "b": [0.6815, 0.0857, 0.7011, 0.1054]}, {"w": "increase", "b": [0.7074, 0.0857, 0.79, 0.1054]}, {"w": "considerably,", "b": [0.1294, 0.1062, 0.263, 0.1259]}, {"w": "while", "b": [0.2693, 0.1062, 0.3253, 0.1259]}, {"w": "the", "b": [0.3316, 0.1062, 0.3625, 0.1259]}, {"w": "discriminative", "b": [0.3688, 0.1062, 0.5131, 0.1259]}, {"w": "loss", "b": [0.5194, 0.1062, 0.5587, 0.1259]}, {"w": "tends", "b": [0.565, 0.1062, 0.6182, 0.1259]}, {"w": "to", "b": [0.6245, 0.1062, 0.6442, 0.1259]}, {"w": "zero—the", "b": [0.6505, 0.1062, 0.7499, 0.1259]}, {"w": "discriminator", "b": [0.1294, 0.1267, 0.2639, 0.1464]}, {"w": "may", "b": [0.2702, 0.1267, 0.3137, 0.1464]}, {"w": "end", "b": [0.32, 0.1267, 0.3564, 0.1464]}, {"w": "up", "b": [0.3627, 0.1267, 0.388, 0.1464]}, {"w": "dominating", "b": [0.3943, 0.1267, 0.5092, 0.1464]}, {"w": "the", "b": [0.5155, 0.1267, 0.5463, 0.1464]}, {"w": "generator.", "b": [0.5526, 0.1267, 0.6527, 0.1464]}, {"w": "If", "b": [0.659, 0.1267, 0.6758, 0.1464]}, {"w": "that’s", "b": [0.6821, 0.1267, 0.7368, 0.1464]}, {"w": "the", "b": [0.7431, 0.1267, 0.7739, 0.1464]}, {"w": "case,", "b": [0.7802, 0.1267, 0.8299, 0.1464]}, {"w": "try", "b": [0.8362, 0.1267, 0.8643, 0.1464]}, {"w": "reducing", "b": [0.1294, 0.1472, 0.2177, 0.1669]}, {"w": "the", "b": [0.224, 0.1472, 0.2548, 0.1669]}, {"w": "discriminator", "b": [0.2611, 0.1472, 0.3956, 0.1669]}, {"w": "learning", "b": [0.402, 0.1472, 0.4846, 0.1669]}, {"w": "rate,", "b": [0.4909, 0.1472, 0.535, 0.1669]}, {"w": "and", "b": [0.5413, 0.1472, 0.5778, 0.1669]}, {"w": "increase", "b": [0.5841, 0.1472, 0.6667, 0.1669]}, {"w": "the", "b": [0.6729, 0.1472, 0.7038, 0.1669]}, {"w": "dropout", "b": [0.7101, 0.1472, 0.7885, 0.1669]}, {"w": "rate", "b": [0.7948, 0.1472, 0.8327, 0.1669]}, {"w": "of", "b": [0.839, 0.1472, 0.86, 0.1669]}, {"w": "the", "b": [0.1294, 0.1677, 0.1602, 0.1874]}, {"w": "discriminator.", "b": [0.1665, 0.1677, 0.306, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.18. Play the discriminator: in each row, two images were dreamed up by the GAN, and one image comes from the training set. Can you tell them apart? (Answers: the real images in each column are middle, top, bottom, middle.)", "words": [{"w": "Figure", "b": [0.1294, 0.21, 0.1827, 0.2248]}, {"w": "8.18.", "b": [0.1874, 0.21, 0.2252, 0.2248]}, {"w": "Play", "b": [0.2299, 0.21, 0.2657, 0.2248]}, {"w": "the", "b": [0.2704, 0.21, 0.2956, 0.2248]}, {"w": "discriminator:", "b": [0.3004, 0.21, 0.417, 0.2248]}, {"w": "in", "b": [0.4217, 0.21, 0.4375, 0.2248]}, {"w": "each", "b": [0.4423, 0.21, 0.479, 0.2248]}, {"w": "row,", "b": [0.4838, 0.21, 0.5186, 0.2248]}, {"w": "two", "b": [0.5233, 0.21, 0.5528, 0.2248]}, {"w": "images", "b": [0.5575, 0.21, 0.6132, 0.2248]}, {"w": "were", "b": [0.6179, 0.21, 0.6564, 0.2248]}, {"w": "dreamed", "b": [0.6612, 0.21, 0.7323, 0.2248]}, {"w": "up", "b": [0.737, 0.21, 0.758, 0.2248]}, {"w": "by", "b": [0.7628, 0.21, 0.7828, 0.2248]}, {"w": "the", "b": [0.7875, 0.21, 0.8127, 0.2248]}, {"w": "GAN,", "b": [0.8174, 0.21, 0.8642, 0.2248]}, {"w": "and", "b": [0.1294, 0.2251, 0.1599, 0.2399]}, {"w": "one", "b": [0.1646, 0.2251, 0.193, 0.2399]}, {"w": "image", "b": [0.1977, 0.2251, 0.2461, 0.2399]}, {"w": "comes", "b": [0.2508, 0.2251, 0.3002, 0.2399]}, {"w": "from", "b": [0.3049, 0.2251, 0.3445, 0.2399]}, {"w": "the", "b": [0.3492, 0.2251, 0.3744, 0.2399]}, {"w": "training", "b": [0.3792, 0.2251, 0.4444, 0.2399]}, {"w": "set.", "b": [0.4491, 0.2251, 0.4759, 0.2399]}, {"w": "Can", "b": [0.4806, 0.2251, 0.5142, 0.2399]}, {"w": "you", "b": [0.519, 0.2251, 0.5484, 0.2399]}, {"w": "tell", "b": [0.5531, 0.2251, 0.5784, 0.2399]}, {"w": "them", "b": [0.5831, 0.2251, 0.6241, 0.2399]}, {"w": "apart?", "b": [0.6288, 0.2251, 0.6824, 0.2399]}, {"w": "(Answers:", "b": [0.6871, 0.2251, 0.7691, 0.2399]}, {"w": "the", "b": [0.7738, 0.2251, 0.799, 0.2399]}, {"w": "real", "b": [0.8038, 0.2251, 0.8349, 0.2399]}, {"w": "images", "b": [0.1294, 0.2403, 0.1851, 0.2551]}, {"w": "in", "b": [0.1898, 0.2403, 0.2056, 0.2551]}, {"w": "each", "b": [0.2103, 0.2403, 0.2471, 0.2551]}, {"w": "column", "b": [0.2519, 0.2403, 0.3118, 0.2551]}, {"w": "are", "b": [0.3165, 0.2403, 0.3424, 0.2551]}, {"w": "middle,", "b": [0.3471, 0.2403, 0.4076, 0.2551]}, {"w": "top,", "b": [0.4123, 0.2403, 0.4433, 0.2551]}, {"w": "bottom,", "b": [0.4481, 0.2403, 0.5106, 0.2551]}, {"w": "middle.)", "b": [0.5153, 0.2403, 0.5821, 0.2551]}]}, {"id": "b_2", "type": "paragraph", "text": "8.5.7. Wrapping up", "words": [{"w": "8.5.7.", "b": [0.1294, 0.624, 0.1862, 0.6438]}, {"w": "Wrapping", "b": [0.1925, 0.624, 0.3028, 0.6438]}, {"w": "up", "b": [0.3091, 0.624, 0.3371, 0.6438]}]}, {"id": "b_3", "type": "paragraph", "text": "A GAN consists of a generator network coupled with a discriminator network. The discriminator is trained to differenciate between the output of the generator and real images from a training dataset, and the generator is trained to fool the discriminator. Remarkably, the generator nevers sees images from the training set directly; the information it has about the data comes from the discriminator. GANs are difficult to train, because training a GAN is a dynamic process rather than a simple gradient descent process with a fixed loss landscape. Getting a GAN to train correctly requires using a number of heuristic tricks, as well as extensive tuning.", "words": [{"w": "A", "b": [0.1799, 0.6624, 0.1981, 0.6821]}, {"w": "GAN", "b": [0.2044, 0.6624, 0.259, 0.6821]}, {"w": "consists", "b": [0.2653, 0.6624, 0.3452, 0.6821]}, {"w": "of", "b": [0.3515, 0.6624, 0.3725, 0.6821]}, {"w": "a", "b": [0.3788, 0.6624, 0.39, 0.6821]}, {"w": "generator", "b": [0.3964, 0.6624, 0.4916, 0.6821]}, {"w": "network", "b": [0.4979, 0.6624, 0.5806, 0.6821]}, {"w": "coupled", "b": [0.5869, 0.6624, 0.6667, 0.6821]}, {"w": "with", "b": [0.6731, 0.6624, 0.7179, 0.6821]}, {"w": "a", "b": [0.7242, 0.6624, 0.7354, 0.6821]}, {"w": "discriminator", "b": [0.1799, 0.6829, 0.3144, 0.7026]}, {"w": "network.", "b": [0.3207, 0.6829, 0.4097, 0.7026]}, {"w": "The", "b": [0.416, 0.6829, 0.4552, 0.7026]}, {"w": "discriminator", "b": [0.4615, 0.6829, 0.596, 0.7026]}, {"w": "is", "b": [0.6023, 0.6829, 0.6192, 0.7026]}, {"w": "trained", "b": [0.6255, 0.6829, 0.6955, 0.7026]}, {"w": "to", "b": [0.7018, 0.6829, 0.7215, 0.7026]}, {"w": "differenciate", "b": [0.7278, 0.6829, 0.8547, 0.7026]}, {"w": "between", "b": [0.1799, 0.7034, 0.2639, 0.7231]}, {"w": "the", "b": [0.2702, 0.7034, 0.301, 0.7231]}, {"w": "output", "b": [0.3074, 0.7034, 0.3718, 0.7231]}, {"w": "of", "b": [0.3781, 0.7034, 0.3992, 0.7231]}, {"w": "the", "b": [0.4055, 0.7034, 0.4363, 0.7231]}, {"w": "generator", "b": [0.4426, 0.7034, 0.5378, 0.7231]}, {"w": "and", "b": [0.5441, 0.7034, 0.5806, 0.7231]}, {"w": "real", "b": [0.5869, 0.7034, 0.6247, 0.7231]}, {"w": "images", "b": [0.631, 0.7034, 0.7025, 0.7231]}, {"w": "from", "b": [0.7088, 0.7034, 0.7578, 0.7231]}, {"w": "a", "b": [0.7641, 0.7034, 0.7753, 0.7231]}, {"w": "training", "b": [0.7816, 0.7034, 0.8601, 0.7231]}, {"w": "dataset,", "b": [0.1799, 0.7239, 0.2562, 0.7436]}, {"w": "and", "b": [0.2625, 0.7239, 0.299, 0.7436]}, {"w": "the", "b": [0.3053, 0.7239, 0.3361, 0.7436]}, {"w": "generator", "b": [0.3424, 0.7239, 0.4376, 0.7436]}, {"w": "is", "b": [0.444, 0.7239, 0.4608, 0.7436]}, {"w": "trained", "b": [0.4671, 0.7239, 0.5371, 0.7436]}, {"w": "to", "b": [0.5434, 0.7239, 0.5631, 0.7436]}, {"w": "fool", "b": [0.5694, 0.7239, 0.61, 0.7436]}, {"w": "the", "b": [0.6163, 0.7239, 0.6471, 0.7436]}, {"w": "discriminator.", "b": [0.6535, 0.7239, 0.7928, 0.7436]}, {"w": "Remarkably,", "b": [0.1799, 0.7444, 0.3078, 0.7641]}, {"w": "the", "b": [0.3141, 0.7444, 0.3449, 0.7641]}, {"w": "generator", "b": [0.3513, 0.7444, 0.4465, 0.7641]}, {"w": "nevers", "b": [0.4528, 0.7444, 0.5187, 0.7641]}, {"w": "sees", "b": [0.525, 0.7444, 0.567, 0.7641]}, {"w": "images", "b": [0.5733, 0.7444, 0.6448, 0.7641]}, {"w": "from", "b": [0.6511, 0.7444, 0.7001, 0.7641]}, {"w": "the", "b": [0.7064, 0.7444, 0.7372, 0.7641]}, {"w": "training", "b": [0.7435, 0.7444, 0.822, 0.7641]}, {"w": "set", "b": [0.8283, 0.7444, 0.8563, 0.7641]}, {"w": "directly;", "b": [0.1799, 0.7649, 0.2639, 0.7846]}, {"w": "the", "b": [0.2702, 0.7649, 0.3011, 0.7846]}, {"w": "information", "b": [0.3074, 0.7649, 0.4265, 0.7846]}, {"w": "it", "b": [0.4328, 0.7649, 0.4468, 0.7846]}, {"w": "has", "b": [0.4531, 0.7649, 0.4868, 0.7846]}, {"w": "about", "b": [0.4931, 0.7649, 0.5491, 0.7846]}, {"w": "the", "b": [0.5554, 0.7649, 0.5863, 0.7846]}, {"w": "data", "b": [0.5926, 0.7649, 0.6346, 0.7846]}, {"w": "comes", "b": [0.6409, 0.7649, 0.7053, 0.7846]}, {"w": "from", "b": [0.7116, 0.7649, 0.7607, 0.7846]}, {"w": "the", "b": [0.7669, 0.7649, 0.7977, 0.7846]}, {"w": "discriminator.", "b": [0.1799, 0.7854, 0.3193, 0.8051]}, {"w": "GANs", "b": [0.1799, 0.8059, 0.2443, 0.8256]}, {"w": "are", "b": [0.2506, 0.8059, 0.2814, 0.8256]}, {"w": "difficult", "b": [0.2877, 0.8059, 0.3686, 0.8256]}, {"w": "to", "b": [0.3749, 0.8059, 0.3945, 0.8256]}, {"w": "train,", "b": [0.4008, 0.8059, 0.4533, 0.8256]}, {"w": "because", "b": [0.4596, 0.8059, 0.5395, 0.8256]}, {"w": "training", "b": [0.5458, 0.8059, 0.6243, 0.8256]}, {"w": "a", "b": [0.6306, 0.8059, 0.6418, 0.8256]}, {"w": "GAN", "b": [0.6481, 0.8059, 0.7027, 0.8256]}, {"w": "is", "b": [0.709, 0.8059, 0.7259, 0.8256]}, {"w": "a", "b": [0.7322, 0.8059, 0.7434, 0.8256]}, {"w": "dynamic", "b": [0.7497, 0.8059, 0.8365, 0.8256]}, {"w": "process", "b": [0.1799, 0.8264, 0.2555, 0.8461]}, {"w": "rather", "b": [0.2618, 0.8264, 0.3206, 0.8461]}, {"w": "than", "b": [0.327, 0.8264, 0.3704, 0.8461]}, {"w": "a", "b": [0.3767, 0.8264, 0.3879, 0.8461]}, {"w": "simple", "b": [0.3942, 0.8264, 0.4615, 0.8461]}, {"w": "gradient", "b": [0.4678, 0.8264, 0.5505, 0.8461]}, {"w": "descent", "b": [0.5568, 0.8264, 0.6324, 0.8461]}, {"w": "process", "b": [0.6387, 0.8264, 0.7144, 0.8461]}, {"w": "with", "b": [0.7207, 0.8264, 0.7655, 0.8461]}, {"w": "a", "b": [0.7718, 0.8264, 0.783, 0.8461]}, {"w": "fixed", "b": [0.7893, 0.8264, 0.8411, 0.8461]}, {"w": "loss", "b": [0.1799, 0.8469, 0.2191, 0.8666]}, {"w": "landscape.", "b": [0.2254, 0.8469, 0.3312, 0.8666]}, {"w": "Getting", "b": [0.3375, 0.8469, 0.4132, 0.8666]}, {"w": "a", "b": [0.4195, 0.8469, 0.4307, 0.8666]}, {"w": "GAN", "b": [0.437, 0.8469, 0.4916, 0.8666]}, {"w": "to", "b": [0.4979, 0.8469, 0.5176, 0.8666]}, {"w": "train", "b": [0.5239, 0.8469, 0.5701, 0.8666]}, {"w": "correctly", "b": [0.5764, 0.8469, 0.6661, 0.8666]}, {"w": "requires", "b": [0.6724, 0.8469, 0.7536, 0.8666]}, {"w": "using", "b": [0.7599, 0.8469, 0.8146, 0.8666]}, {"w": "a", "b": [0.8209, 0.8469, 0.8321, 0.8666]}, {"w": "number", "b": [0.1799, 0.8674, 0.2569, 0.8871]}, {"w": "of", "b": [0.2632, 0.8674, 0.2842, 0.8871]}, {"w": "heuristic", "b": [0.2906, 0.8674, 0.3774, 0.8871]}, {"w": "tricks,", "b": [0.3837, 0.8674, 0.4461, 0.8871]}, {"w": "as", "b": [0.4524, 0.8674, 0.4734, 0.8871]}, {"w": "well", "b": [0.4797, 0.8674, 0.5232, 0.8871]}, {"w": "as", "b": [0.5295, 0.8674, 0.5505, 0.8871]}, {"w": "extensive", "b": [0.5568, 0.8674, 0.6521, 0.8871]}, {"w": "tuning.", "b": [0.6583, 0.8674, 0.7291, 0.8871]}]}]}, {"page": 410, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "GANs can potentially produce highly realistic images. But unlike VAEs, the latent space they learn doesn’t have a neat continuous structure and thus may not be suited for certain practical applications, such as image editing via latent-space concept vectors.", "words": [{"w": "GANs", "b": [0.1799, 0.0857, 0.2443, 0.1054]}, {"w": "can", "b": [0.2506, 0.0857, 0.2856, 0.1054]}, {"w": "potentially", "b": [0.2919, 0.0857, 0.3999, 0.1054]}, {"w": "produce", "b": [0.4062, 0.0857, 0.4874, 0.1054]}, {"w": "highly", "b": [0.4937, 0.0857, 0.5582, 0.1054]}, {"w": "realistic", "b": [0.5645, 0.0857, 0.6444, 0.1054]}, {"w": "images.", "b": [0.6507, 0.0857, 0.7284, 0.1054]}, {"w": "But", "b": [0.7348, 0.0857, 0.7712, 0.1054]}, {"w": "unlike", "b": [0.7775, 0.0857, 0.8406, 0.1054]}, {"w": "VAEs,", "b": [0.1799, 0.1062, 0.2446, 0.1259]}, {"w": "the", "b": [0.2509, 0.1062, 0.2817, 0.1259]}, {"w": "latent", "b": [0.288, 0.1062, 0.3441, 0.1259]}, {"w": "space", "b": [0.3504, 0.1062, 0.4064, 0.1259]}, {"w": "they", "b": [0.4127, 0.1062, 0.4561, 0.1259]}, {"w": "learn", "b": [0.4624, 0.1062, 0.5129, 0.1259]}, {"w": "doesn’t", "b": [0.5192, 0.1062, 0.5929, 0.1259]}, {"w": "have", "b": [0.5992, 0.1062, 0.6469, 0.1259]}, {"w": "a", "b": [0.6532, 0.1062, 0.6644, 0.1259]}, {"w": "neat", "b": [0.6707, 0.1062, 0.7127, 0.1259]}, {"w": "continuous", "b": [0.719, 0.1062, 0.8297, 0.1259]}, {"w": "structure", "b": [0.1799, 0.1267, 0.2681, 0.1464]}, {"w": "and", "b": [0.2744, 0.1267, 0.3109, 0.1464]}, {"w": "thus", "b": [0.3172, 0.1267, 0.3592, 0.1464]}, {"w": "may", "b": [0.3655, 0.1267, 0.409, 0.1464]}, {"w": "not", "b": [0.4153, 0.1267, 0.4475, 0.1464]}, {"w": "be", "b": [0.4538, 0.1267, 0.4776, 0.1464]}, {"w": "suited", "b": [0.4839, 0.1267, 0.5442, 0.1464]}, {"w": "for", "b": [0.5505, 0.1267, 0.5799, 0.1464]}, {"w": "certain", "b": [0.5862, 0.1267, 0.6549, 0.1464]}, {"w": "practical", "b": [0.6612, 0.1267, 0.748, 0.1464]}, {"w": "applications,", "b": [0.1799, 0.1472, 0.3081, 0.1669]}, {"w": "such", "b": [0.3144, 0.1472, 0.3606, 0.1669]}, {"w": "as", "b": [0.3669, 0.1472, 0.388, 0.1669]}, {"w": "image", "b": [0.3943, 0.1472, 0.4559, 0.1669]}, {"w": "editing", "b": [0.4622, 0.1472, 0.5323, 0.1669]}, {"w": "via", "b": [0.5386, 0.1472, 0.5694, 0.1669]}, {"w": "latent-space", "b": [0.5757, 0.1472, 0.6962, 0.1669]}, {"w": "concept", "b": [0.7025, 0.1472, 0.781, 0.1669]}, {"w": "vectors.", "b": [0.7873, 0.1472, 0.8664, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapter summary", "words": [{"w": "Chapter", "b": [0.1294, 0.1989, 0.2191, 0.2186]}, {"w": "summary", "b": [0.2254, 0.1989, 0.3277, 0.2186]}]}, {"id": "b_2", "type": "paragraph", "text": "With creative applications of deep learning, deep networks go beyond annotating existing content and start generating their own. You learned the following:", "words": [{"w": "With", "b": [0.1799, 0.2372, 0.2293, 0.2569]}, {"w": "creative", "b": [0.2356, 0.2372, 0.3154, 0.2569]}, {"w": "applications", "b": [0.3218, 0.2372, 0.4437, 0.2569]}, {"w": "of", "b": [0.45, 0.2372, 0.471, 0.2569]}, {"w": "deep", "b": [0.4773, 0.2372, 0.5249, 0.2569]}, {"w": "learning,", "b": [0.5312, 0.2372, 0.6202, 0.2569]}, {"w": "deep", "b": [0.6265, 0.2372, 0.6741, 0.2569]}, {"w": "networks", "b": [0.6804, 0.2372, 0.7729, 0.2569]}, {"w": "go", "b": [0.7792, 0.2372, 0.8044, 0.2569]}, {"w": "beyond", "b": [0.1799, 0.2577, 0.2541, 0.2774]}, {"w": "annotating", "b": [0.2604, 0.2577, 0.3669, 0.2774]}, {"w": "existing", "b": [0.3732, 0.2577, 0.4531, 0.2774]}, {"w": "content", "b": [0.4594, 0.2577, 0.5337, 0.2774]}, {"w": "and", "b": [0.54, 0.2577, 0.5764, 0.2774]}, {"w": "start", "b": [0.5827, 0.2577, 0.6262, 0.2774]}, {"w": "generating", "b": [0.6325, 0.2577, 0.739, 0.2774]}, {"w": "their", "b": [0.7453, 0.2577, 0.7915, 0.2774]}, {"w": "own.", "b": [0.7977, 0.2577, 0.8475, 0.2774]}, {"w": "You", "b": [0.1799, 0.2782, 0.2208, 0.2979]}, {"w": "learned", "b": [0.2271, 0.2782, 0.3013, 0.2979]}, {"w": "the", "b": [0.3076, 0.2782, 0.3385, 0.2979]}, {"w": "following:", "b": [0.3448, 0.2782, 0.4499, 0.2979]}]}, {"id": "b_3", "type": "paragraph", "text": "How to generate sequence data, one timestep at a time. This is applicable to text generation and also to note-by-note music generation or any other type of timeseries data. How DeepDream works: by maximizing convnet layer activations through gradient ascent in input space. How to perform style transfer, where a content image and a style image are combined to produce interesting-looking results. What GANs and VAEs are, how they can be used to dream up new images, and how latent-space concept vectors can be used for image editing. These few techniques cover only the basics of this fast-expanding field.", "words": [{"w": "How", "b": [0.2303, 0.3165, 0.2794, 0.3363]}, {"w": "to", "b": [0.2857, 0.3165, 0.3053, 0.3363]}, {"w": "generate", "b": [0.3116, 0.3165, 0.397, 0.3363]}, {"w": "sequence", "b": [0.4033, 0.3165, 0.4958, 0.3363]}, {"w": "data,", "b": [0.5021, 0.3165, 0.5504, 0.3363]}, {"w": "one", "b": [0.5567, 0.3165, 0.5932, 0.3363]}, {"w": "timestep", "b": [0.5995, 0.3165, 0.685, 0.3363]}, {"w": "at", "b": [0.6913, 0.3165, 0.7095, 0.3363]}, {"w": "a", "b": [0.7158, 0.3165, 0.727, 0.3363]}, {"w": "time.", "b": [0.7333, 0.3165, 0.7844, 0.3363]}, {"w": "This", "b": [0.7908, 0.3165, 0.8356, 0.3363]}, {"w": "is", "b": [0.8419, 0.3165, 0.8587, 0.3363]}, {"w": "applicable", "b": [0.2303, 0.337, 0.334, 0.3568]}, {"w": "to", "b": [0.3403, 0.337, 0.3599, 0.3568]}, {"w": "text", "b": [0.3662, 0.337, 0.4041, 0.3568]}, {"w": "generation", "b": [0.4104, 0.337, 0.5169, 0.3568]}, {"w": "and", "b": [0.5232, 0.337, 0.5596, 0.3568]}, {"w": "also", "b": [0.5659, 0.337, 0.6065, 0.3568]}, {"w": "to", "b": [0.6128, 0.337, 0.6325, 0.3568]}, {"w": "note-by-note", "b": [0.6388, 0.337, 0.7677, 0.3568]}, {"w": "music", "b": [0.774, 0.337, 0.8342, 0.3568]}, {"w": "generation", "b": [0.2303, 0.3575, 0.3368, 0.3773]}, {"w": "or", "b": [0.3431, 0.3575, 0.3641, 0.3773]}, {"w": "any", "b": [0.3704, 0.3575, 0.4068, 0.3773]}, {"w": "other", "b": [0.4132, 0.3575, 0.465, 0.3773]}, {"w": "type", "b": [0.4713, 0.3575, 0.5147, 0.3773]}, {"w": "of", "b": [0.521, 0.3575, 0.5421, 0.3773]}, {"w": "timeseries", "b": [0.5484, 0.3575, 0.6507, 0.3773]}, {"w": "data.", "b": [0.657, 0.3575, 0.7053, 0.3773]}, {"w": "How", "b": [0.2303, 0.378, 0.2794, 0.3978]}, {"w": "DeepDream", "b": [0.2857, 0.378, 0.4075, 0.3978]}, {"w": "works:", "b": [0.4138, 0.378, 0.4825, 0.3978]}, {"w": "by", "b": [0.4888, 0.378, 0.514, 0.3978]}, {"w": "maximizing", "b": [0.5203, 0.378, 0.6409, 0.3978]}, {"w": "convnet", "b": [0.6472, 0.378, 0.727, 0.3978]}, {"w": "layer", "b": [0.7333, 0.378, 0.7838, 0.3978]}, {"w": "activations", "b": [0.2303, 0.3985, 0.3396, 0.4183]}, {"w": "through", "b": [0.3459, 0.3985, 0.4244, 0.4183]}, {"w": "gradient", "b": [0.4307, 0.3985, 0.5134, 0.4183]}, {"w": "ascent", "b": [0.5197, 0.3985, 0.5827, 0.4183]}, {"w": "in", "b": [0.589, 0.3985, 0.6087, 0.4183]}, {"w": "input", "b": [0.615, 0.3985, 0.6668, 0.4183]}, {"w": "space.", "b": [0.6731, 0.3985, 0.7355, 0.4183]}, {"w": "How", "b": [0.2303, 0.419, 0.2794, 0.4388]}, {"w": "to", "b": [0.2857, 0.419, 0.3053, 0.4388]}, {"w": "perform", "b": [0.3116, 0.419, 0.3928, 0.4388]}, {"w": "style", "b": [0.3992, 0.419, 0.4468, 0.4388]}, {"w": "transfer,", "b": [0.4531, 0.419, 0.5354, 0.4388]}, {"w": "where", "b": [0.5417, 0.419, 0.6034, 0.4388]}, {"w": "a", "b": [0.6097, 0.419, 0.6209, 0.4388]}, {"w": "content", "b": [0.6272, 0.419, 0.7014, 0.4388]}, {"w": "image", "b": [0.7077, 0.419, 0.7694, 0.4388]}, {"w": "and", "b": [0.7757, 0.419, 0.8121, 0.4388]}, {"w": "a", "b": [0.8184, 0.419, 0.8296, 0.4388]}, {"w": "style", "b": [0.2303, 0.4395, 0.278, 0.4593]}, {"w": "image", "b": [0.2843, 0.4395, 0.3459, 0.4593]}, {"w": "are", "b": [0.3522, 0.4395, 0.383, 0.4593]}, {"w": "combined", "b": [0.3893, 0.4395, 0.4888, 0.4593]}, {"w": "to", "b": [0.4951, 0.4395, 0.5148, 0.4593]}, {"w": "produce", "b": [0.5211, 0.4395, 0.6023, 0.4593]}, {"w": "interesting-looking", "b": [0.6086, 0.4395, 0.8006, 0.4593]}, {"w": "results.", "b": [0.2303, 0.46, 0.3025, 0.4798]}, {"w": "What", "b": [0.2303, 0.4805, 0.285, 0.5003]}, {"w": "GANs", "b": [0.2913, 0.4805, 0.3557, 0.5003]}, {"w": "and", "b": [0.362, 0.4805, 0.3984, 0.5003]}, {"w": "VAEs", "b": [0.4048, 0.4805, 0.4632, 0.5003]}, {"w": "are,", "b": [0.4695, 0.4805, 0.5066, 0.5003]}, {"w": "how", "b": [0.5129, 0.4805, 0.5563, 0.5003]}, {"w": "they", "b": [0.5626, 0.4805, 0.6061, 0.5003]}, {"w": "can", "b": [0.6124, 0.4805, 0.6474, 0.5003]}, {"w": "be", "b": [0.6537, 0.4805, 0.6775, 0.5003]}, {"w": "used", "b": [0.6838, 0.4805, 0.73, 0.5003]}, {"w": "to", "b": [0.7364, 0.4805, 0.756, 0.5003]}, {"w": "dream", "b": [0.7623, 0.4805, 0.8253, 0.5003]}, {"w": "up", "b": [0.8316, 0.4805, 0.8569, 0.5003]}, {"w": "new", "b": [0.2303, 0.501, 0.2723, 0.5208]}, {"w": "images,", "b": [0.2786, 0.501, 0.3564, 0.5208]}, {"w": "and", "b": [0.3627, 0.501, 0.3992, 0.5208]}, {"w": "how", "b": [0.4055, 0.501, 0.4489, 0.5208]}, {"w": "latent-space", "b": [0.4552, 0.501, 0.5757, 0.5208]}, {"w": "concept", "b": [0.582, 0.501, 0.6604, 0.5208]}, {"w": "vectors", "b": [0.6667, 0.501, 0.7396, 0.5208]}, {"w": "can", "b": [0.7459, 0.501, 0.7809, 0.5208]}, {"w": "be", "b": [0.7872, 0.501, 0.811, 0.5208]}, {"w": "used", "b": [0.8173, 0.501, 0.8636, 0.5208]}, {"w": "for", "b": [0.2303, 0.5215, 0.2597, 0.5413]}, {"w": "image", "b": [0.266, 0.5215, 0.3277, 0.5413]}, {"w": "editing.", "b": [0.334, 0.5215, 0.4104, 0.5413]}, {"w": "These", "b": [0.1799, 0.542, 0.2401, 0.5618]}, {"w": "few", "b": [0.2464, 0.542, 0.2842, 0.5618]}, {"w": "techniques", "b": [0.2905, 0.542, 0.3984, 0.5618]}, {"w": "cover", "b": [0.4047, 0.542, 0.4608, 0.5618]}, {"w": "only", "b": [0.4671, 0.542, 0.5119, 0.5618]}, {"w": "the", "b": [0.5182, 0.542, 0.549, 0.5618]}, {"w": "basics", "b": [0.5553, 0.542, 0.617, 0.5618]}, {"w": "of", "b": [0.6233, 0.542, 0.6443, 0.5618]}, {"w": "this", "b": [0.6506, 0.542, 0.6871, 0.5618]}, {"w": "fast-expanding", "b": [0.6934, 0.542, 0.8433, 0.5618]}, {"w": "field.", "b": [0.1799, 0.5625, 0.2324, 0.5823]}]}]}, {"page": 411, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 9. Conclusions", "words": [{"w": "Chapter", "b": [0.1294, 0.1076, 0.2564, 0.1355]}, {"w": "9.", "b": [0.2654, 0.1076, 0.2922, 0.1355]}, {"w": "Conclusions", "b": [0.3011, 0.1076, 0.4857, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "This chapter covers", "words": [{"w": "This", "b": [0.1294, 0.1588, 0.1729, 0.1785]}, {"w": "chapter", "b": [0.1792, 0.1588, 0.2562, 0.1785]}, {"w": "covers", "b": [0.2626, 0.1588, 0.3284, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Important takeaways from this book The limitations of deep learning The future of deep learning, machine learning, and AI Resources for learning further and working in the field", "words": [{"w": "Important", "b": [0.1799, 0.1971, 0.2794, 0.2168]}, {"w": "takeaways", "b": [0.2857, 0.1971, 0.3907, 0.2168]}, {"w": "from", "b": [0.397, 0.1971, 0.4461, 0.2168]}, {"w": "this", "b": [0.4524, 0.1971, 0.4888, 0.2168]}, {"w": "book", "b": [0.4951, 0.1971, 0.5456, 0.2168]}, {"w": "The", "b": [0.1799, 0.2176, 0.2191, 0.2373]}, {"w": "limitations", "b": [0.2254, 0.2176, 0.3333, 0.2373]}, {"w": "of", "b": [0.3396, 0.2176, 0.3607, 0.2373]}, {"w": "deep", "b": [0.367, 0.2176, 0.4146, 0.2373]}, {"w": "learning", "b": [0.4209, 0.2176, 0.5036, 0.2373]}, {"w": "The", "b": [0.1799, 0.2381, 0.2191, 0.2578]}, {"w": "future", "b": [0.2254, 0.2381, 0.2856, 0.2578]}, {"w": "of", "b": [0.2919, 0.2381, 0.313, 0.2578]}, {"w": "deep", "b": [0.3193, 0.2381, 0.3669, 0.2578]}, {"w": "learning,", "b": [0.3732, 0.2381, 0.4622, 0.2578]}, {"w": "machine", "b": [0.4685, 0.2381, 0.5539, 0.2578]}, {"w": "learning,", "b": [0.5602, 0.2381, 0.6492, 0.2578]}, {"w": "and", "b": [0.6555, 0.2381, 0.6919, 0.2578]}, {"w": "AI", "b": [0.6983, 0.2381, 0.7249, 0.2578]}, {"w": "Resources", "b": [0.1799, 0.2586, 0.2835, 0.2783]}, {"w": "for", "b": [0.2898, 0.2586, 0.3193, 0.2783]}, {"w": "learning", "b": [0.3256, 0.2586, 0.4082, 0.2783]}, {"w": "further", "b": [0.4145, 0.2586, 0.4832, 0.2783]}, {"w": "and", "b": [0.4895, 0.2586, 0.5259, 0.2783]}, {"w": "working", "b": [0.5322, 0.2586, 0.6163, 0.2783]}, {"w": "in", "b": [0.6226, 0.2586, 0.6422, 0.2783]}, {"w": "the", "b": [0.6485, 0.2586, 0.6794, 0.2783]}, {"w": "field", "b": [0.6857, 0.2586, 0.7319, 0.2783]}]}, {"id": "b_3", "type": "paragraph", "text": "You’ve almost reached the end of this book. This last chapter will summarize and review core concepts while also expanding your horizons beyond the relatively basic notions you’ve learned so far. Understanding deep learning and AI is a journey, and finishing this book is merely the first step on it. I want to make sure you realize this and are properly equipped to take the next steps of this journey on your own.", "words": [{"w": "You’ve", "b": [0.1294, 0.3014, 0.2025, 0.3211]}, {"w": "almost", "b": [0.2088, 0.3014, 0.2761, 0.3211]}, {"w": "reached", "b": [0.2824, 0.3014, 0.3609, 0.3211]}, {"w": "the", "b": [0.3672, 0.3014, 0.398, 0.3211]}, {"w": "end", "b": [0.4043, 0.3014, 0.4407, 0.3211]}, {"w": "of", "b": [0.447, 0.3014, 0.468, 0.3211]}, {"w": "this", "b": [0.4744, 0.3014, 0.5108, 0.3211]}, {"w": "book.", "b": [0.5171, 0.3014, 0.5739, 0.3211]}, {"w": "This", "b": [0.5802, 0.3014, 0.625, 0.3211]}, {"w": "last", "b": [0.6313, 0.3014, 0.6664, 0.3211]}, {"w": "chapter", "b": [0.6727, 0.3014, 0.7469, 0.3211]}, {"w": "will", "b": [0.7532, 0.3014, 0.7925, 0.3211]}, {"w": "summarize", "b": [0.1294, 0.3219, 0.2401, 0.3416]}, {"w": "and", "b": [0.2464, 0.3219, 0.2828, 0.3416]}, {"w": "review", "b": [0.2891, 0.3219, 0.3578, 0.3416]}, {"w": "core", "b": [0.3641, 0.3219, 0.4075, 0.3416]}, {"w": "concepts", "b": [0.4138, 0.3219, 0.5021, 0.3416]}, {"w": "while", "b": [0.5084, 0.3219, 0.5644, 0.3416]}, {"w": "also", "b": [0.5707, 0.3219, 0.6114, 0.3416]}, {"w": "expanding", "b": [0.6177, 0.3219, 0.7228, 0.3416]}, {"w": "your", "b": [0.729, 0.3219, 0.7752, 0.3416]}, {"w": "horizons", "b": [0.7815, 0.3219, 0.8684, 0.3416]}, {"w": "beyond", "b": [0.1294, 0.3424, 0.2037, 0.3621]}, {"w": "the", "b": [0.21, 0.3424, 0.2408, 0.3621]}, {"w": "relatively", "b": [0.2471, 0.3424, 0.3424, 0.3621]}, {"w": "basic", "b": [0.3487, 0.3424, 0.4005, 0.3621]}, {"w": "notions", "b": [0.4068, 0.3424, 0.4811, 0.3621]}, {"w": "you’ve", "b": [0.4874, 0.3424, 0.5575, 0.3621]}, {"w": "learned", "b": [0.5638, 0.3424, 0.638, 0.3621]}, {"w": "so", "b": [0.6443, 0.3424, 0.6668, 0.3621]}, {"w": "far.", "b": [0.6731, 0.3424, 0.7059, 0.3621]}, {"w": "Understanding", "b": [0.7122, 0.3424, 0.8608, 0.3621]}, {"w": "deep", "b": [0.1294, 0.3629, 0.177, 0.3826]}, {"w": "learning", "b": [0.1833, 0.3629, 0.266, 0.3826]}, {"w": "and", "b": [0.2723, 0.3629, 0.3087, 0.3826]}, {"w": "AI", "b": [0.315, 0.3629, 0.3417, 0.3826]}, {"w": "is", "b": [0.348, 0.3629, 0.3648, 0.3826]}, {"w": "a", "b": [0.3711, 0.3629, 0.3823, 0.3826]}, {"w": "journey,", "b": [0.3886, 0.3629, 0.4703, 0.3826]}, {"w": "and", "b": [0.4766, 0.3629, 0.513, 0.3826]}, {"w": "finishing", "b": [0.5193, 0.3629, 0.609, 0.3826]}, {"w": "this", "b": [0.6153, 0.3629, 0.6518, 0.3826]}, {"w": "book", "b": [0.6581, 0.3629, 0.7086, 0.3826]}, {"w": "is", "b": [0.7149, 0.3629, 0.7317, 0.3826]}, {"w": "merely", "b": [0.738, 0.3629, 0.808, 0.3826]}, {"w": "the", "b": [0.8143, 0.3629, 0.8452, 0.3826]}, {"w": "first", "b": [0.1294, 0.3834, 0.1701, 0.4031]}, {"w": "step", "b": [0.1764, 0.3834, 0.217, 0.4031]}, {"w": "on", "b": [0.2233, 0.3834, 0.2485, 0.4031]}, {"w": "it.", "b": [0.2548, 0.3834, 0.2752, 0.4031]}, {"w": "I", "b": [0.2815, 0.3834, 0.2899, 0.4031]}, {"w": "want", "b": [0.2962, 0.3834, 0.3452, 0.4031]}, {"w": "to", "b": [0.3515, 0.3834, 0.3712, 0.4031]}, {"w": "make", "b": [0.3775, 0.3834, 0.4321, 0.4031]}, {"w": "sure", "b": [0.4384, 0.3834, 0.4804, 0.4031]}, {"w": "you", "b": [0.4867, 0.3834, 0.5246, 0.4031]}, {"w": "realize", "b": [0.5309, 0.3834, 0.5981, 0.4031]}, {"w": "this", "b": [0.6044, 0.3834, 0.6409, 0.4031]}, {"w": "and", "b": [0.6472, 0.3834, 0.6836, 0.4031]}, {"w": "are", "b": [0.6899, 0.3834, 0.7207, 0.4031]}, {"w": "properly", "b": [0.727, 0.3834, 0.8125, 0.4031]}, {"w": "equipped", "b": [0.1294, 0.4039, 0.2219, 0.4236]}, {"w": "to", "b": [0.2282, 0.4039, 0.2478, 0.4236]}, {"w": "take", "b": [0.2541, 0.4039, 0.2961, 0.4236]}, {"w": "the", "b": [0.3024, 0.4039, 0.3333, 0.4236]}, {"w": "next", "b": [0.3396, 0.4039, 0.383, 0.4236]}, {"w": "steps", "b": [0.3893, 0.4039, 0.4398, 0.4236]}, {"w": "of", "b": [0.4461, 0.4039, 0.4671, 0.4236]}, {"w": "this", "b": [0.4734, 0.4039, 0.5098, 0.4236]}, {"w": "journey", "b": [0.5161, 0.4039, 0.5932, 0.4236]}, {"w": "on", "b": [0.5995, 0.4039, 0.6247, 0.4236]}, {"w": "your", "b": [0.6311, 0.4039, 0.6773, 0.4236]}, {"w": "own.", "b": [0.6836, 0.4039, 0.7333, 0.4236]}]}, {"id": "b_4", "type": "paragraph", "text": "We’ll start with a bird’s-eye view of what you should take away from this book. This should refresh your memory regarding some of the concepts you’ve learned. Next, we’ll present an overview of some key limitations of deep learning. To use a tool appropriately, you should not only understand what it can do but also be aware of what it can’t do. Finally, I’ll offer some speculative thoughts about the future evolution of the fields of deep learning, machine learning, and AI. This should be especially interesting to you if you’d like to get into fundamental research. The chapter ends with a short list of resources and strategies for learning further about AI and staying up to date with new advances.", "words": [{"w": "We’ll", "b": [0.1294, 0.4467, 0.1848, 0.4664]}, {"w": "start", "b": [0.1911, 0.4467, 0.2346, 0.4664]}, {"w": "with", "b": [0.2409, 0.4467, 0.2857, 0.4664]}, {"w": "a", "b": [0.292, 0.4467, 0.3032, 0.4664]}, {"w": "bird’s-eye", "b": [0.3095, 0.4467, 0.4104, 0.4664]}, {"w": "view", "b": [0.4167, 0.4467, 0.4657, 0.4664]}, {"w": "of", "b": [0.472, 0.4467, 0.493, 0.4664]}, {"w": "what", "b": [0.4994, 0.4467, 0.5484, 0.4664]}, {"w": "you", "b": [0.5547, 0.4467, 0.5925, 0.4664]}, {"w": "should", "b": [0.5988, 0.4467, 0.6661, 0.4664]}, {"w": "take", "b": [0.6724, 0.4467, 0.7145, 0.4664]}, {"w": "away", "b": [0.7208, 0.4467, 0.774, 0.4664]}, {"w": "from", "b": [0.7803, 0.4467, 0.8293, 0.4664]}, {"w": "this", "b": [0.1294, 0.4672, 0.1659, 0.4869]}, {"w": "book.", "b": [0.1722, 0.4672, 0.2289, 0.4869]}, {"w": "This", "b": [0.2352, 0.4672, 0.2801, 0.4869]}, {"w": "should", "b": [0.2864, 0.4672, 0.3537, 0.4869]}, {"w": "refresh", "b": [0.36, 0.4672, 0.43, 0.4869]}, {"w": "your", "b": [0.4363, 0.4672, 0.4825, 0.4869]}, {"w": "memory", "b": [0.4889, 0.4672, 0.5729, 0.4869]}, {"w": "regarding", "b": [0.5792, 0.4672, 0.6759, 0.4869]}, {"w": "some", "b": [0.6822, 0.4672, 0.7354, 0.4869]}, {"w": "of", "b": [0.7417, 0.4672, 0.7627, 0.4869]}, {"w": "the", "b": [0.769, 0.4672, 0.7999, 0.4869]}, {"w": "concepts", "b": [0.1294, 0.4877, 0.2177, 0.5074]}, {"w": "you’ve", "b": [0.224, 0.4877, 0.294, 0.5074]}, {"w": "learned.", "b": [0.3003, 0.4877, 0.3809, 0.5074]}, {"w": "Next,", "b": [0.3872, 0.4877, 0.4425, 0.5074]}, {"w": "we’ll", "b": [0.4488, 0.4877, 0.5007, 0.5074]}, {"w": "present", "b": [0.507, 0.4877, 0.5798, 0.5074]}, {"w": "an", "b": [0.5861, 0.4877, 0.61, 0.5074]}, {"w": "overview", "b": [0.6163, 0.4877, 0.7101, 0.5074]}, {"w": "of", "b": [0.7164, 0.4877, 0.7375, 0.5074]}, {"w": "some", "b": [0.7438, 0.4877, 0.797, 0.5074]}, {"w": "key", "b": [0.8033, 0.4877, 0.8397, 0.5074]}, {"w": "limitations", "b": [0.1294, 0.5082, 0.2374, 0.5279]}, {"w": "of", "b": [0.2437, 0.5082, 0.2647, 0.5279]}, {"w": "deep", "b": [0.271, 0.5082, 0.3186, 0.5279]}, {"w": "learning.", "b": [0.3249, 0.5082, 0.4139, 0.5279]}, {"w": "To", "b": [0.4202, 0.5082, 0.4464, 0.5279]}, {"w": "use", "b": [0.4527, 0.5082, 0.4863, 0.5279]}, {"w": "a", "b": [0.4926, 0.5082, 0.5038, 0.5279]}, {"w": "tool", "b": [0.5101, 0.5082, 0.5494, 0.5279]}, {"w": "appropriately,", "b": [0.5557, 0.5082, 0.6948, 0.5279]}, {"w": "you", "b": [0.7011, 0.5082, 0.739, 0.5279]}, {"w": "should", "b": [0.7453, 0.5082, 0.8126, 0.5279]}, {"w": "not", "b": [0.8189, 0.5082, 0.8511, 0.5279]}, {"w": "only", "b": [0.1294, 0.5287, 0.1743, 0.5484]}, {"w": "understand", "b": [0.1806, 0.5287, 0.2913, 0.5484]}, {"w": "what", "b": [0.2976, 0.5287, 0.3466, 0.5484]}, {"w": "it", "b": [0.3529, 0.5287, 0.3669, 0.5484]}, {"w": "can", "b": [0.3732, 0.5287, 0.4096, 0.5484]}, {"w": "do", "b": [0.4159, 0.5287, 0.4412, 0.5484]}, {"w": "but", "b": [0.4475, 0.5287, 0.4797, 0.5484]}, {"w": "also", "b": [0.486, 0.5287, 0.5267, 0.5484]}, {"w": "be", "b": [0.533, 0.5287, 0.5568, 0.5484]}, {"w": "aware", "b": [0.5631, 0.5287, 0.6233, 0.5484]}, {"w": "of", "b": [0.6296, 0.5287, 0.6506, 0.5484]}, {"w": "what", "b": [0.6569, 0.5287, 0.706, 0.5484]}, {"w": "it", "b": [0.7123, 0.5287, 0.7263, 0.5484]}, {"w": "can’t", "b": [0.7326, 0.5287, 0.7816, 0.5484]}, {"w": "do.", "b": [0.7879, 0.5287, 0.8194, 0.5484]}, {"w": "Finally,", "b": [0.1294, 0.5492, 0.2056, 0.5689]}, {"w": "I’ll", "b": [0.2119, 0.5492, 0.2427, 0.5689]}, {"w": "offer", "b": [0.249, 0.5492, 0.2975, 0.5689]}, {"w": "some", "b": [0.3039, 0.5492, 0.3571, 0.5689]}, {"w": "speculative", "b": [0.3634, 0.5492, 0.4769, 0.5689]}, {"w": "thoughts", "b": [0.4832, 0.5492, 0.5701, 0.5689]}, {"w": "about", "b": [0.5764, 0.5492, 0.6325, 0.5689]}, {"w": "the", "b": [0.6388, 0.5492, 0.6696, 0.5689]}, {"w": "future", "b": [0.6759, 0.5492, 0.7361, 0.5689]}, {"w": "evolution", "b": [0.7425, 0.5492, 0.8378, 0.5689]}, {"w": "of", "b": [0.8441, 0.5492, 0.8651, 0.5689]}, {"w": "the", "b": [0.1294, 0.5697, 0.1602, 0.5894]}, {"w": "fields", "b": [0.1665, 0.5697, 0.2226, 0.5894]}, {"w": "of", "b": [0.2289, 0.5697, 0.2499, 0.5894]}, {"w": "deep", "b": [0.2562, 0.5697, 0.3038, 0.5894]}, {"w": "learning,", "b": [0.3102, 0.5697, 0.3991, 0.5894]}, {"w": "machine", "b": [0.4054, 0.5697, 0.4909, 0.5894]}, {"w": "learning,", "b": [0.4972, 0.5697, 0.5862, 0.5894]}, {"w": "and", "b": [0.5924, 0.5697, 0.6288, 0.5894]}, {"w": "AI.", "b": [0.6351, 0.5697, 0.6681, 0.5894]}, {"w": "This", "b": [0.6744, 0.5697, 0.7192, 0.5894]}, {"w": "should", "b": [0.7255, 0.5697, 0.7928, 0.5894]}, {"w": "be", "b": [0.7991, 0.5697, 0.8229, 0.5894]}, {"w": "especially", "b": [0.1294, 0.5902, 0.2303, 0.6099]}, {"w": "interesting", "b": [0.2366, 0.5902, 0.3431, 0.6099]}, {"w": "to", "b": [0.3494, 0.5902, 0.369, 0.6099]}, {"w": "you", "b": [0.3753, 0.5902, 0.4132, 0.6099]}, {"w": "if", "b": [0.4195, 0.5902, 0.4349, 0.6099]}, {"w": "you’d", "b": [0.4412, 0.5902, 0.5001, 0.6099]}, {"w": "like", "b": [0.5064, 0.5902, 0.5442, 0.6099]}, {"w": "to", "b": [0.5505, 0.5902, 0.5701, 0.6099]}, {"w": "get", "b": [0.5764, 0.5902, 0.6073, 0.6099]}, {"w": "into", "b": [0.6136, 0.5902, 0.6528, 0.6099]}, {"w": "fundamental", "b": [0.6591, 0.5902, 0.7852, 0.6099]}, {"w": "research.", "b": [0.1294, 0.6107, 0.2197, 0.6304]}, {"w": "The", "b": [0.2261, 0.6107, 0.2653, 0.6304]}, {"w": "chapter", "b": [0.2716, 0.6107, 0.3458, 0.6304]}, {"w": "ends", "b": [0.3521, 0.6107, 0.3984, 0.6304]}, {"w": "with", "b": [0.4047, 0.6107, 0.4495, 0.6304]}, {"w": "a", "b": [0.4558, 0.6107, 0.467, 0.6304]}, {"w": "short", "b": [0.4733, 0.6107, 0.5237, 0.6304]}, {"w": "list", "b": [0.5301, 0.6107, 0.5609, 0.6304]}, {"w": "of", "b": [0.5672, 0.6107, 0.5882, 0.6304]}, {"w": "resources", "b": [0.5945, 0.6107, 0.6898, 0.6304]}, {"w": "and", "b": [0.6961, 0.6107, 0.7325, 0.6304]}, {"w": "strategies", "b": [0.7388, 0.6107, 0.8341, 0.6304]}, {"w": "for", "b": [0.8404, 0.6107, 0.8698, 0.6304]}, {"w": "learning", "b": [0.1294, 0.6312, 0.2121, 0.6509]}, {"w": "further", "b": [0.2184, 0.6312, 0.287, 0.6509]}, {"w": "about", "b": [0.2933, 0.6312, 0.3494, 0.6509]}, {"w": "AI", "b": [0.3557, 0.6312, 0.3823, 0.6509]}, {"w": "and", "b": [0.3886, 0.6312, 0.425, 0.6509]}, {"w": "staying", "b": [0.4313, 0.6312, 0.5042, 0.6509]}, {"w": "up", "b": [0.5105, 0.6312, 0.5357, 0.6509]}, {"w": "to", "b": [0.5421, 0.6312, 0.5617, 0.6509]}, {"w": "date", "b": [0.568, 0.6312, 0.61, 0.6509]}, {"w": "with", "b": [0.6163, 0.6312, 0.6612, 0.6509]}, {"w": "new", "b": [0.6675, 0.6312, 0.7095, 0.6509]}, {"w": "advances.", "b": [0.7158, 0.6312, 0.8146, 0.6509]}]}, {"id": "b_5", "type": "paragraph", "text": "9.1. Key concepts in review", "words": [{"w": "9.1.", "b": [0.1294, 0.688, 0.172, 0.7102]}, {"w": "Key", "b": [0.1791, 0.688, 0.2279, 0.7102]}, {"w": "concepts", "b": [0.235, 0.688, 0.3391, 0.7102]}, {"w": "in", "b": [0.3462, 0.688, 0.3698, 0.7102]}, {"w": "review", "b": [0.3769, 0.688, 0.4568, 0.7102]}]}, {"id": "b_6", "type": "paragraph", "text": "This section briefly synthesizes the key takeaways from this book. If you ever need a quick refresher to help you recall what you’ve learned, you can read these few pages.", "words": [{"w": "This", "b": [0.1294, 0.7337, 0.1743, 0.7534]}, {"w": "section", "b": [0.1806, 0.7337, 0.252, 0.7534]}, {"w": "briefly", "b": [0.2583, 0.7337, 0.3256, 0.7534]}, {"w": "synthesizes", "b": [0.3319, 0.7337, 0.4468, 0.7534]}, {"w": "the", "b": [0.4531, 0.7337, 0.4839, 0.7534]}, {"w": "key", "b": [0.4902, 0.7337, 0.5267, 0.7534]}, {"w": "takeaways", "b": [0.533, 0.7337, 0.638, 0.7534]}, {"w": "from", "b": [0.6443, 0.7337, 0.6934, 0.7534]}, {"w": "this", "b": [0.6997, 0.7337, 0.7361, 0.7534]}, {"w": "book.", "b": [0.7424, 0.7337, 0.7992, 0.7534]}, {"w": "If", "b": [0.8055, 0.7337, 0.8223, 0.7534]}, {"w": "you", "b": [0.8286, 0.7337, 0.8665, 0.7534]}, {"w": "ever", "b": [0.1294, 0.7542, 0.1728, 0.7739]}, {"w": "need", "b": [0.1791, 0.7542, 0.2268, 0.7739]}, {"w": "a", "b": [0.2331, 0.7542, 0.2443, 0.7739]}, {"w": "quick", "b": [0.2506, 0.7542, 0.3066, 0.7739]}, {"w": "refresher", "b": [0.3129, 0.7542, 0.4026, 0.7739]}, {"w": "to", "b": [0.4089, 0.7542, 0.4285, 0.7739]}, {"w": "help", "b": [0.4348, 0.7542, 0.4782, 0.7739]}, {"w": "you", "b": [0.4845, 0.7542, 0.5224, 0.7739]}, {"w": "recall", "b": [0.5287, 0.7542, 0.5847, 0.7739]}, {"w": "what", "b": [0.591, 0.7542, 0.6401, 0.7739]}, {"w": "you’ve", "b": [0.6463, 0.7542, 0.7163, 0.7739]}, {"w": "learned,", "b": [0.7226, 0.7542, 0.8032, 0.7739]}, {"w": "you", "b": [0.8095, 0.7542, 0.8473, 0.7739]}, {"w": "can", "b": [0.1294, 0.7747, 0.1644, 0.7944]}, {"w": "read", "b": [0.1707, 0.7747, 0.2141, 0.7944]}, {"w": "these", "b": [0.2205, 0.7747, 0.2723, 0.7944]}, {"w": "few", "b": [0.2786, 0.7747, 0.3164, 0.7944]}, {"w": "pages.", "b": [0.3227, 0.7747, 0.3865, 0.7944]}]}, {"id": "b_7", "type": "paragraph", "text": "9.1.1. Various approaches to AI", "words": [{"w": "9.1.1.", "b": [0.1294, 0.8219, 0.1862, 0.8416]}, {"w": "Various", "b": [0.1925, 0.8219, 0.2757, 0.8416]}, {"w": "approaches", "b": [0.282, 0.8219, 0.4048, 0.8416]}, {"w": "to", "b": [0.4111, 0.8219, 0.4322, 0.8416]}, {"w": "AI", "b": [0.4385, 0.8219, 0.4665, 0.8416]}]}, {"id": "b_8", "type": "paragraph", "text": "First of all, deep learning isn’t synonymous with AI or even with machine learning. Artificial intelligence is an ancient, broad field that", "words": [{"w": "First", "b": [0.1294, 0.8647, 0.1757, 0.8844]}, {"w": "of", "b": [0.182, 0.8647, 0.203, 0.8844]}, {"w": "all,", "b": [0.2093, 0.8647, 0.2408, 0.8844]}, {"w": "deep", "b": [0.2471, 0.8647, 0.2948, 0.8844]}, {"w": "learning", "b": [0.3011, 0.8647, 0.3837, 0.8844]}, {"w": "isn’t", "b": [0.39, 0.8647, 0.4344, 0.8844]}, {"w": "synonymous", "b": [0.4407, 0.8647, 0.5683, 0.8844]}, {"w": "with", "b": [0.5746, 0.8647, 0.6194, 0.8844]}, {"w": "AI", "b": [0.6257, 0.8647, 0.6523, 0.8844]}, {"w": "or", "b": [0.6586, 0.8647, 0.6796, 0.8844]}, {"w": "even", "b": [0.686, 0.8647, 0.7336, 0.8844]}, {"w": "with", "b": [0.7399, 0.8647, 0.7847, 0.8844]}, {"w": "machine", "b": [0.1294, 0.8852, 0.2149, 0.9049]}, {"w": "learning.", "b": [0.2212, 0.8852, 0.3102, 0.9049]}, {"w": "Artificial", "b": [0.3164, 0.8852, 0.4075, 0.9049]}, {"w": "intelligence", "b": [0.4138, 0.8852, 0.5315, 0.9049]}, {"w": "is", "b": [0.5378, 0.8852, 0.5546, 0.9049]}, {"w": "an", "b": [0.5609, 0.8852, 0.5847, 0.9049]}, {"w": "ancient,", "b": [0.591, 0.8852, 0.6702, 0.9049]}, {"w": "broad", "b": [0.6765, 0.8852, 0.7339, 0.9049]}, {"w": "field", "b": [0.7402, 0.8852, 0.7865, 0.9049]}, {"w": "that", "b": [0.7928, 0.8852, 0.8306, 0.9049]}]}]}, {"page": 412, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "can generally be defined as “all attempts to automate cognitive processes”—in other words, the automation of thought. This can range from the very basic, such as an Excel spreadsheet, to the very advanced, like a humanoid robot that can walk and talk.", "words": [{"w": "can", "b": [0.1294, 0.0857, 0.1644, 0.1054]}, {"w": "generally", "b": [0.1707, 0.0857, 0.2646, 0.1054]}, {"w": "be", "b": [0.2709, 0.0857, 0.2947, 0.1054]}, {"w": "defined", "b": [0.301, 0.0857, 0.3767, 0.1054]}, {"w": "as", "b": [0.383, 0.0857, 0.404, 0.1054]}, {"w": "“all", "b": [0.4103, 0.0857, 0.4467, 0.1054]}, {"w": "attempts", "b": [0.453, 0.0857, 0.5385, 0.1054]}, {"w": "to", "b": [0.5448, 0.0857, 0.5645, 0.1054]}, {"w": "automate", "b": [0.5708, 0.0857, 0.6632, 0.1054]}, {"w": "cognitive", "b": [0.6695, 0.0857, 0.7634, 0.1054]}, {"w": "processes”—in", "b": [0.1294, 0.1062, 0.2821, 0.1259]}, {"w": "other", "b": [0.2884, 0.1062, 0.3403, 0.1259]}, {"w": "words,", "b": [0.3466, 0.1062, 0.4145, 0.1259]}, {"w": "the", "b": [0.4208, 0.1062, 0.4517, 0.1259]}, {"w": "automation", "b": [0.458, 0.1062, 0.5715, 0.1259]}, {"w": "of", "b": [0.5778, 0.1062, 0.5988, 0.1259]}, {"w": "thought.", "b": [0.6051, 0.1062, 0.6885, 0.1259]}, {"w": "This", "b": [0.6948, 0.1062, 0.7397, 0.1259]}, {"w": "can", "b": [0.746, 0.1062, 0.781, 0.1259]}, {"w": "range", "b": [0.7873, 0.1062, 0.8433, 0.1259]}, {"w": "from", "b": [0.1294, 0.1267, 0.1785, 0.1464]}, {"w": "the", "b": [0.1848, 0.1267, 0.2156, 0.1464]}, {"w": "very", "b": [0.2219, 0.1267, 0.2667, 0.1464]}, {"w": "basic,", "b": [0.273, 0.1267, 0.3312, 0.1464]}, {"w": "such", "b": [0.3375, 0.1267, 0.3837, 0.1464]}, {"w": "as", "b": [0.39, 0.1267, 0.411, 0.1464]}, {"w": "an", "b": [0.4173, 0.1267, 0.4412, 0.1464]}, {"w": "Excel", "b": [0.4475, 0.1267, 0.5049, 0.1464]}, {"w": "spreadsheet,", "b": [0.5112, 0.1267, 0.6352, 0.1464]}, {"w": "to", "b": [0.6415, 0.1267, 0.6611, 0.1464]}, {"w": "the", "b": [0.6674, 0.1267, 0.6983, 0.1464]}, {"w": "very", "b": [0.7046, 0.1267, 0.7494, 0.1464]}, {"w": "advanced,", "b": [0.7557, 0.1267, 0.8573, 0.1464]}, {"w": "like", "b": [0.1294, 0.1472, 0.1673, 0.1669]}, {"w": "a", "b": [0.1736, 0.1472, 0.1848, 0.1669]}, {"w": "humanoid", "b": [0.191, 0.1472, 0.2919, 0.1669]}, {"w": "robot", "b": [0.2982, 0.1472, 0.3515, 0.1669]}, {"w": "that", "b": [0.3578, 0.1472, 0.3956, 0.1669]}, {"w": "can", "b": [0.402, 0.1472, 0.437, 0.1669]}, {"w": "walk", "b": [0.4433, 0.1472, 0.4923, 0.1669]}, {"w": "and", "b": [0.4986, 0.1472, 0.535, 0.1669]}, {"w": "talk.", "b": [0.5413, 0.1472, 0.5855, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Machine learning is a specific subfield of AI that aims at automatically developing programs (called models) purely from exposure to training data. This process of turning data into a program is called learning. Although machine learning has been around for a long time, it only started to take off in the 1990s.", "words": [{"w": "Machine", "b": [0.1294, 0.19, 0.2177, 0.2097]}, {"w": "learning", "b": [0.224, 0.19, 0.3095, 0.2097]}, {"w": "is", "b": [0.3157, 0.19, 0.3326, 0.2097]}, {"w": "a", "b": [0.3389, 0.19, 0.3501, 0.2097]}, {"w": "specific", "b": [0.3564, 0.19, 0.4348, 0.2097]}, {"w": "subfield", "b": [0.4411, 0.19, 0.5224, 0.2097]}, {"w": "of", "b": [0.5287, 0.19, 0.5497, 0.2097]}, {"w": "AI", "b": [0.556, 0.19, 0.5827, 0.2097]}, {"w": "that", "b": [0.589, 0.19, 0.6268, 0.2097]}, {"w": "aims", "b": [0.6331, 0.19, 0.6808, 0.2097]}, {"w": "at", "b": [0.6871, 0.19, 0.7053, 0.2097]}, {"w": "automatically", "b": [0.7116, 0.19, 0.8489, 0.2097]}, {"w": "developing", "b": [0.1294, 0.2105, 0.2415, 0.2302]}, {"w": "programs", "b": [0.2478, 0.2105, 0.3431, 0.2302]}, {"w": "(called", "b": [0.3494, 0.2105, 0.418, 0.2302]}, {"w": "models)", "b": [0.4243, 0.2105, 0.5042, 0.2302]}, {"w": "purely", "b": [0.5105, 0.2105, 0.5749, 0.2302]}, {"w": "from", "b": [0.5812, 0.2105, 0.6303, 0.2302]}, {"w": "exposure", "b": [0.6366, 0.2105, 0.7276, 0.2302]}, {"w": "to", "b": [0.7339, 0.2105, 0.7536, 0.2302]}, {"w": "training", "b": [0.7599, 0.2105, 0.8383, 0.2302]}, {"w": "data.", "b": [0.1294, 0.231, 0.1777, 0.2507]}, {"w": "This", "b": [0.1841, 0.231, 0.2289, 0.2507]}, {"w": "process", "b": [0.2352, 0.231, 0.3109, 0.2507]}, {"w": "of", "b": [0.3172, 0.231, 0.3382, 0.2507]}, {"w": "turning", "b": [0.3445, 0.231, 0.4174, 0.2507]}, {"w": "data", "b": [0.4237, 0.231, 0.4657, 0.2507]}, {"w": "into", "b": [0.472, 0.231, 0.5113, 0.2507]}, {"w": "a", "b": [0.5176, 0.231, 0.5288, 0.2507]}, {"w": "program", "b": [0.5351, 0.231, 0.6205, 0.2507]}, {"w": "is", "b": [0.6268, 0.231, 0.6437, 0.2507]}, {"w": "called", "b": [0.65, 0.231, 0.7102, 0.2507]}, {"w": "learning.", "b": [0.7164, 0.231, 0.8082, 0.2507]}, {"w": "Although", "b": [0.1294, 0.2515, 0.2247, 0.2712]}, {"w": "machine", "b": [0.231, 0.2515, 0.3165, 0.2712]}, {"w": "learning", "b": [0.3228, 0.2515, 0.4055, 0.2712]}, {"w": "has", "b": [0.4118, 0.2515, 0.4454, 0.2712]}, {"w": "been", "b": [0.4517, 0.2515, 0.4993, 0.2712]}, {"w": "around", "b": [0.5056, 0.2515, 0.5757, 0.2712]}, {"w": "for", "b": [0.582, 0.2515, 0.6114, 0.2712]}, {"w": "a", "b": [0.6177, 0.2515, 0.6289, 0.2712]}, {"w": "long", "b": [0.6352, 0.2515, 0.6801, 0.2712]}, {"w": "time,", "b": [0.6864, 0.2515, 0.7375, 0.2712]}, {"w": "it", "b": [0.7438, 0.2515, 0.7579, 0.2712]}, {"w": "only", "b": [0.7642, 0.2515, 0.809, 0.2712]}, {"w": "started", "b": [0.1294, 0.272, 0.1967, 0.2917]}, {"w": "to", "b": [0.203, 0.272, 0.2226, 0.2917]}, {"w": "take", "b": [0.2289, 0.272, 0.2709, 0.2917]}, {"w": "off", "b": [0.2772, 0.272, 0.3062, 0.2917]}, {"w": "in", "b": [0.3125, 0.272, 0.3321, 0.2917]}, {"w": "the", "b": [0.3384, 0.272, 0.3692, 0.2917]}, {"w": "1990s.", "b": [0.3755, 0.272, 0.4421, 0.2917]}]}, {"id": "b_2", "type": "paragraph", "text": "Deep learning is one of many branches of machine learning, where the models are long chains of geometric functions, applied one after the other. These operations are structured into modules called layers: deep- learning models are typically stacks of layers—or, more generally, graphs of layers. These layers are parameterized by weights, which are the parameters learned during training. The knowledge of a model is stored in its weights, and the process of learning consists of finding good values for these weights.", "words": [{"w": "Deep", "b": [0.1294, 0.3147, 0.1826, 0.3345]}, {"w": "learning", "b": [0.1889, 0.3147, 0.2744, 0.3345]}, {"w": "is", "b": [0.2807, 0.3147, 0.2976, 0.3345]}, {"w": "one", "b": [0.3039, 0.3147, 0.3403, 0.3345]}, {"w": "of", "b": [0.3466, 0.3147, 0.3676, 0.3345]}, {"w": "many", "b": [0.3739, 0.3147, 0.43, 0.3345]}, {"w": "branches", "b": [0.4363, 0.3147, 0.5259, 0.3345]}, {"w": "of", "b": [0.5322, 0.3147, 0.5532, 0.3345]}, {"w": "machine", "b": [0.5595, 0.3147, 0.645, 0.3345]}, {"w": "learning,", "b": [0.6513, 0.3147, 0.7403, 0.3345]}, {"w": "where", "b": [0.7466, 0.3147, 0.8082, 0.3345]}, {"w": "the", "b": [0.8145, 0.3147, 0.8454, 0.3345]}, {"w": "models", "b": [0.1294, 0.3352, 0.2023, 0.355]}, {"w": "are", "b": [0.2086, 0.3352, 0.2394, 0.355]}, {"w": "long", "b": [0.2457, 0.3352, 0.2906, 0.355]}, {"w": "chains", "b": [0.2969, 0.3352, 0.3613, 0.355]}, {"w": "of", "b": [0.3676, 0.3352, 0.3886, 0.355]}, {"w": "geometric", "b": [0.3949, 0.3352, 0.4958, 0.355]}, {"w": "functions,", "b": [0.5021, 0.3352, 0.6023, 0.355]}, {"w": "applied", "b": [0.6086, 0.3352, 0.6829, 0.355]}, {"w": "one", "b": [0.6892, 0.3352, 0.7256, 0.355]}, {"w": "after", "b": [0.7319, 0.3352, 0.7781, 0.355]}, {"w": "the", "b": [0.7844, 0.3352, 0.8153, 0.355]}, {"w": "other.", "b": [0.1294, 0.3557, 0.1862, 0.3755]}, {"w": "These", "b": [0.1925, 0.3557, 0.2527, 0.3755]}, {"w": "operations", "b": [0.259, 0.3557, 0.3641, 0.3755]}, {"w": "are", "b": [0.3704, 0.3557, 0.4012, 0.3755]}, {"w": "structured", "b": [0.4075, 0.3557, 0.5084, 0.3755]}, {"w": "into", "b": [0.5147, 0.3557, 0.5539, 0.3755]}, {"w": "modules", "b": [0.5603, 0.3557, 0.6457, 0.3755]}, {"w": "called", "b": [0.6521, 0.3557, 0.7123, 0.3755]}, {"w": "layers:", "b": [0.7185, 0.3557, 0.7872, 0.3755]}, {"w": "deep-", "b": [0.7935, 0.3557, 0.8495, 0.3755]}, {"w": "learning", "b": [0.1294, 0.3762, 0.2121, 0.396]}, {"w": "models", "b": [0.2184, 0.3762, 0.2913, 0.396]}, {"w": "are", "b": [0.2976, 0.3762, 0.3284, 0.396]}, {"w": "typically", "b": [0.3347, 0.3762, 0.423, 0.396]}, {"w": "stacks", "b": [0.4293, 0.3762, 0.4909, 0.396]}, {"w": "of", "b": [0.4972, 0.3762, 0.5182, 0.396]}, {"w": "layers—or,", "b": [0.5245, 0.3762, 0.6363, 0.396]}, {"w": "more", "b": [0.6426, 0.3762, 0.6944, 0.396]}, {"w": "generally,", "b": [0.7007, 0.3762, 0.7992, 0.396]}, {"w": "graphs", "b": [0.1294, 0.3967, 0.1967, 0.4165]}, {"w": "of", "b": [0.203, 0.3967, 0.224, 0.4165]}, {"w": "layers.", "b": [0.2303, 0.3967, 0.2968, 0.4165]}, {"w": "These", "b": [0.3031, 0.3967, 0.3634, 0.4165]}, {"w": "layers", "b": [0.3697, 0.3967, 0.4299, 0.4165]}, {"w": "are", "b": [0.4362, 0.3967, 0.467, 0.4165]}, {"w": "parameterized", "b": [0.4733, 0.3967, 0.6162, 0.4165]}, {"w": "by", "b": [0.6225, 0.3967, 0.6477, 0.4165]}, {"w": "weights,", "b": [0.654, 0.3967, 0.7374, 0.4165]}, {"w": "which", "b": [0.7437, 0.3967, 0.8053, 0.4165]}, {"w": "are", "b": [0.8116, 0.3967, 0.8424, 0.4165]}, {"w": "the", "b": [0.1294, 0.4172, 0.1602, 0.437]}, {"w": "parameters", "b": [0.1665, 0.4172, 0.2772, 0.437]}, {"w": "learned", "b": [0.2835, 0.4172, 0.3578, 0.437]}, {"w": "during", "b": [0.3641, 0.4172, 0.4299, 0.437]}, {"w": "training.", "b": [0.4362, 0.4172, 0.521, 0.437]}, {"w": "The", "b": [0.5273, 0.4172, 0.5665, 0.437]}, {"w": "knowledge", "b": [0.5728, 0.4172, 0.6807, 0.437]}, {"w": "of", "b": [0.6869, 0.4172, 0.708, 0.437]}, {"w": "a", "b": [0.7143, 0.4172, 0.7255, 0.437]}, {"w": "model", "b": [0.7318, 0.4172, 0.7948, 0.437]}, {"w": "is", "b": [0.8011, 0.4172, 0.818, 0.437]}, {"w": "stored", "b": [0.1294, 0.4377, 0.1911, 0.4575]}, {"w": "in", "b": [0.1974, 0.4377, 0.217, 0.4575]}, {"w": "its", "b": [0.2233, 0.4377, 0.2471, 0.4575]}, {"w": "weights,", "b": [0.2534, 0.4377, 0.3382, 0.4575]}, {"w": "and", "b": [0.3445, 0.4377, 0.381, 0.4575]}, {"w": "the", "b": [0.3873, 0.4377, 0.4181, 0.4575]}, {"w": "process", "b": [0.4244, 0.4377, 0.5001, 0.4575]}, {"w": "of", "b": [0.5064, 0.4377, 0.5274, 0.4575]}, {"w": "learning", "b": [0.5337, 0.4377, 0.6163, 0.4575]}, {"w": "consists", "b": [0.6227, 0.4377, 0.7025, 0.4575]}, {"w": "of", "b": [0.7088, 0.4377, 0.7299, 0.4575]}, {"w": "finding", "b": [0.7362, 0.4377, 0.809, 0.4575]}, {"w": "good", "b": [0.8154, 0.4377, 0.8658, 0.4575]}, {"w": "values", "b": [0.1294, 0.4582, 0.1939, 0.478]}, {"w": "for", "b": [0.2002, 0.4582, 0.2296, 0.478]}, {"w": "these", "b": [0.2359, 0.4582, 0.2877, 0.478]}, {"w": "weights.", "b": [0.294, 0.4582, 0.3788, 0.478]}]}, {"id": "b_3", "type": "paragraph", "text": "Even though deep learning is just one among many approaches to machine learning, it isn’t on an equal footing with the others. Deep learning is a breakout success. Here’s why.", "words": [{"w": "Even", "b": [0.1294, 0.501, 0.1813, 0.5208]}, {"w": "though", "b": [0.1876, 0.501, 0.2576, 0.5208]}, {"w": "deep", "b": [0.2639, 0.501, 0.3116, 0.5208]}, {"w": "learning", "b": [0.3179, 0.501, 0.4005, 0.5208]}, {"w": "is", "b": [0.4068, 0.501, 0.4237, 0.5208]}, {"w": "just", "b": [0.43, 0.501, 0.4664, 0.5208]}, {"w": "one", "b": [0.4727, 0.501, 0.5092, 0.5208]}, {"w": "among", "b": [0.5155, 0.501, 0.5841, 0.5208]}, {"w": "many", "b": [0.5904, 0.501, 0.6465, 0.5208]}, {"w": "approaches", "b": [0.6528, 0.501, 0.7663, 0.5208]}, {"w": "to", "b": [0.7726, 0.501, 0.7922, 0.5208]}, {"w": "machine", "b": [0.1294, 0.5215, 0.2149, 0.5413]}, {"w": "learning,", "b": [0.2212, 0.5215, 0.3102, 0.5413]}, {"w": "it", "b": [0.3165, 0.5215, 0.3305, 0.5413]}, {"w": "isn’t", "b": [0.3368, 0.5215, 0.3811, 0.5413]}, {"w": "on", "b": [0.3875, 0.5215, 0.4127, 0.5413]}, {"w": "an", "b": [0.419, 0.5215, 0.4428, 0.5413]}, {"w": "equal", "b": [0.4491, 0.5215, 0.5037, 0.5413]}, {"w": "footing", "b": [0.51, 0.5215, 0.5829, 0.5413]}, {"w": "with", "b": [0.5892, 0.5215, 0.6341, 0.5413]}, {"w": "the", "b": [0.6404, 0.5215, 0.6712, 0.5413]}, {"w": "others.", "b": [0.6775, 0.5215, 0.7455, 0.5413]}, {"w": "Deep", "b": [0.7517, 0.5215, 0.805, 0.5413]}, {"w": "learning", "b": [0.1294, 0.542, 0.2121, 0.5618]}, {"w": "is", "b": [0.2184, 0.542, 0.2352, 0.5618]}, {"w": "a", "b": [0.2415, 0.542, 0.2527, 0.5618]}, {"w": "breakout", "b": [0.259, 0.542, 0.3473, 0.5618]}, {"w": "success.", "b": [0.3536, 0.542, 0.4356, 0.5618]}, {"w": "Here’s", "b": [0.4419, 0.542, 0.5077, 0.5618]}, {"w": "why.", "b": [0.514, 0.542, 0.5621, 0.5618]}]}, {"id": "b_4", "type": "paragraph", "text": "9.1.2. What makes deep learning special within the field of machine learning", "words": [{"w": "9.1.2.", "b": [0.1294, 0.5893, 0.1862, 0.609]}, {"w": "What", "b": [0.1925, 0.5893, 0.2527, 0.609]}, {"w": "makes", "b": [0.259, 0.5893, 0.3277, 0.609]}, {"w": "deep", "b": [0.334, 0.5893, 0.3845, 0.609]}, {"w": "learning", "b": [0.3908, 0.5893, 0.4805, 0.609]}, {"w": "special", "b": [0.4868, 0.5893, 0.5597, 0.609]}, {"w": "within", "b": [0.566, 0.5893, 0.6347, 0.609]}, {"w": "the", "b": [0.641, 0.5893, 0.6746, 0.609]}, {"w": "field", "b": [0.6809, 0.5893, 0.7285, 0.609]}, {"w": "of", "b": [0.7349, 0.5893, 0.7559, 0.609]}, {"w": "machine", "b": [0.7622, 0.5893, 0.8533, 0.609]}, {"w": "learning", "b": [0.1294, 0.6098, 0.2191, 0.6295]}]}, {"id": "b_5", "type": "paragraph", "text": "In the span of only a few years, deep learning has achieved tremendous breakthroughs across a wide range of tasks that have been historically perceived as extremely difficult for computers, especially in the area of machine perception: extracting useful information from images, videos, sound, and more. Given sufficient training data (in particular, training data appropriately labeled by humans), it’s possible to extract from perceptual data almost anything that a human could extract. Hence, it’s sometimes said that deep learning has solved perception, although that’s true only for a fairly narrow definition of perception.", "words": [{"w": "In", "b": [0.1294, 0.6526, 0.1504, 0.6723]}, {"w": "the", "b": [0.1567, 0.6526, 0.1876, 0.6723]}, {"w": "span", "b": [0.1939, 0.6526, 0.2401, 0.6723]}, {"w": "of", "b": [0.2464, 0.6526, 0.2674, 0.6723]}, {"w": "only", "b": [0.2737, 0.6526, 0.3186, 0.6723]}, {"w": "a", "b": [0.3249, 0.6526, 0.3361, 0.6723]}, {"w": "few", "b": [0.3424, 0.6526, 0.3802, 0.6723]}, {"w": "years,", "b": [0.3865, 0.6526, 0.446, 0.6723]}, {"w": "deep", "b": [0.4524, 0.6526, 0.5, 0.6723]}, {"w": "learning", "b": [0.5063, 0.6526, 0.5889, 0.6723]}, {"w": "has", "b": [0.5953, 0.6526, 0.6289, 0.6723]}, {"w": "achieved", "b": [0.6352, 0.6526, 0.7248, 0.6723]}, {"w": "tremendous", "b": [0.7311, 0.6526, 0.8489, 0.6723]}, {"w": "breakthroughs", "b": [0.1294, 0.6731, 0.2737, 0.6928]}, {"w": "across", "b": [0.28, 0.6731, 0.3431, 0.6928]}, {"w": "a", "b": [0.3494, 0.6731, 0.3606, 0.6928]}, {"w": "wide", "b": [0.3669, 0.6731, 0.4159, 0.6928]}, {"w": "range", "b": [0.4222, 0.6731, 0.4783, 0.6928]}, {"w": "of", "b": [0.4846, 0.6731, 0.5056, 0.6928]}, {"w": "tasks", "b": [0.5119, 0.6731, 0.5623, 0.6928]}, {"w": "that", "b": [0.5686, 0.6731, 0.6065, 0.6928]}, {"w": "have", "b": [0.6128, 0.6731, 0.6604, 0.6928]}, {"w": "been", "b": [0.6667, 0.6731, 0.7143, 0.6928]}, {"w": "historically", "b": [0.7206, 0.6731, 0.8341, 0.6928]}, {"w": "perceived", "b": [0.1294, 0.6936, 0.2275, 0.7133]}, {"w": "as", "b": [0.2338, 0.6936, 0.2548, 0.7133]}, {"w": "extremely", "b": [0.2611, 0.6936, 0.362, 0.7133]}, {"w": "difficult", "b": [0.3683, 0.6936, 0.449, 0.7133]}, {"w": "for", "b": [0.4554, 0.6936, 0.4848, 0.7133]}, {"w": "computers,", "b": [0.4911, 0.6936, 0.6025, 0.7133]}, {"w": "especially", "b": [0.6088, 0.6936, 0.7097, 0.7133]}, {"w": "in", "b": [0.716, 0.6936, 0.7356, 0.7133]}, {"w": "the", "b": [0.7419, 0.6936, 0.7727, 0.7133]}, {"w": "area", "b": [0.779, 0.6936, 0.821, 0.7133]}, {"w": "of", "b": [0.8273, 0.6936, 0.8483, 0.7133]}, {"w": "machine", "b": [0.1294, 0.7141, 0.2149, 0.7338]}, {"w": "perception:", "b": [0.2212, 0.7141, 0.3347, 0.7338]}, {"w": "extracting", "b": [0.341, 0.7141, 0.4419, 0.7338]}, {"w": "useful", "b": [0.4481, 0.7141, 0.5097, 0.7338]}, {"w": "information", "b": [0.516, 0.7141, 0.6352, 0.7338]}, {"w": "from", "b": [0.6415, 0.7141, 0.6905, 0.7338]}, {"w": "images,", "b": [0.6968, 0.7141, 0.7746, 0.7338]}, {"w": "videos,", "b": [0.7809, 0.7141, 0.8531, 0.7338]}, {"w": "sound,", "b": [0.1294, 0.7346, 0.196, 0.7543]}, {"w": "and", "b": [0.2023, 0.7346, 0.2387, 0.7543]}, {"w": "more.", "b": [0.245, 0.7346, 0.3032, 0.7543]}, {"w": "Given", "b": [0.3095, 0.7346, 0.3711, 0.7543]}, {"w": "sufficient", "b": [0.3774, 0.7346, 0.4722, 0.7543]}, {"w": "training", "b": [0.4786, 0.7346, 0.557, 0.7543]}, {"w": "data", "b": [0.5633, 0.7346, 0.6054, 0.7543]}, {"w": "(in", "b": [0.6117, 0.7346, 0.6397, 0.7543]}, {"w": "particular,", "b": [0.646, 0.7346, 0.7479, 0.7543]}, {"w": "training", "b": [0.7542, 0.7346, 0.8327, 0.7543]}, {"w": "data", "b": [0.1294, 0.7551, 0.1714, 0.7748]}, {"w": "appropriately", "b": [0.1777, 0.7551, 0.3122, 0.7748]}, {"w": "labeled", "b": [0.3185, 0.7551, 0.3914, 0.7748]}, {"w": "by", "b": [0.3977, 0.7551, 0.4229, 0.7748]}, {"w": "humans),", "b": [0.4292, 0.7551, 0.5224, 0.7748]}, {"w": "it’s", "b": [0.5287, 0.7551, 0.5595, 0.7748]}, {"w": "possible", "b": [0.5658, 0.7551, 0.6485, 0.7748]}, {"w": "to", "b": [0.6548, 0.7551, 0.6744, 0.7748]}, {"w": "extract", "b": [0.6807, 0.7551, 0.7494, 0.7748]}, {"w": "from", "b": [0.7557, 0.7551, 0.8047, 0.7748]}, {"w": "perceptual", "b": [0.1294, 0.7756, 0.2345, 0.7953]}, {"w": "data", "b": [0.2408, 0.7756, 0.2828, 0.7953]}, {"w": "almost", "b": [0.2891, 0.7756, 0.3564, 0.7953]}, {"w": "anything", "b": [0.3627, 0.7756, 0.451, 0.7953]}, {"w": "that", "b": [0.4573, 0.7756, 0.4951, 0.7953]}, {"w": "a", "b": [0.5014, 0.7756, 0.5126, 0.7953]}, {"w": "human", "b": [0.5189, 0.7756, 0.5876, 0.7953]}, {"w": "could", "b": [0.5939, 0.7756, 0.65, 0.7953]}, {"w": "extract.", "b": [0.6563, 0.7756, 0.7312, 0.7953]}, {"w": "Hence,", "b": [0.7375, 0.7756, 0.8083, 0.7953]}, {"w": "it’s", "b": [0.8146, 0.7756, 0.8453, 0.7953]}, {"w": "sometimes", "b": [0.1294, 0.7961, 0.2373, 0.8158]}, {"w": "said", "b": [0.2436, 0.7961, 0.2843, 0.8158]}, {"w": "that", "b": [0.2906, 0.7961, 0.3284, 0.8158]}, {"w": "deep", "b": [0.3347, 0.7961, 0.3824, 0.8158]}, {"w": "learning", "b": [0.3887, 0.7961, 0.4713, 0.8158]}, {"w": "has", "b": [0.4776, 0.7961, 0.5113, 0.8158]}, {"w": "solved", "b": [0.5175, 0.7961, 0.5819, 0.8158]}, {"w": "perception,", "b": [0.5883, 0.7961, 0.7015, 0.8158]}, {"w": "although", "b": [0.7078, 0.7961, 0.7961, 0.8158]}, {"w": "that’s", "b": [0.8024, 0.7961, 0.857, 0.8158]}, {"w": "true", "b": [0.1294, 0.8166, 0.1686, 0.8363]}, {"w": "only", "b": [0.1749, 0.8166, 0.2198, 0.8363]}, {"w": "for", "b": [0.2261, 0.8166, 0.2555, 0.8363]}, {"w": "a", "b": [0.2618, 0.8166, 0.273, 0.8363]}, {"w": "fairly", "b": [0.2793, 0.8166, 0.334, 0.8363]}, {"w": "narrow", "b": [0.3403, 0.8166, 0.4117, 0.8363]}, {"w": "definition", "b": [0.418, 0.8166, 0.5161, 0.8363]}, {"w": "of", "b": [0.5224, 0.8166, 0.5434, 0.8363]}, {"w": "perception.", "b": [0.5497, 0.8166, 0.6629, 0.8363]}]}, {"id": "b_6", "type": "paragraph", "text": "Due to its unprecedented technical successes, deep learning has singlehandedly brought about the third and by far the largest AI summer:", "words": [{"w": "Due", "b": [0.1294, 0.8593, 0.1714, 0.8791]}, {"w": "to", "b": [0.1777, 0.8593, 0.1974, 0.8791]}, {"w": "its", "b": [0.2037, 0.8593, 0.2275, 0.8791]}, {"w": "unprecedented", "b": [0.2338, 0.8593, 0.3809, 0.8791]}, {"w": "technical", "b": [0.3872, 0.8593, 0.4783, 0.8791]}, {"w": "successes,", "b": [0.4846, 0.8593, 0.5876, 0.8791]}, {"w": "deep", "b": [0.5939, 0.8593, 0.6415, 0.8791]}, {"w": "learning", "b": [0.6478, 0.8593, 0.7305, 0.8791]}, {"w": "has", "b": [0.7368, 0.8593, 0.7704, 0.8791]}, {"w": "singlehandedly", "b": [0.1294, 0.8798, 0.2822, 0.8996]}, {"w": "brought", "b": [0.2885, 0.8798, 0.3669, 0.8996]}, {"w": "about", "b": [0.3732, 0.8798, 0.4293, 0.8996]}, {"w": "the", "b": [0.4356, 0.8798, 0.4664, 0.8996]}, {"w": "third", "b": [0.4727, 0.8798, 0.5204, 0.8996]}, {"w": "and", "b": [0.5267, 0.8798, 0.5631, 0.8996]}, {"w": "by", "b": [0.5694, 0.8798, 0.5947, 0.8996]}, {"w": "far", "b": [0.601, 0.8798, 0.629, 0.8996]}, {"w": "the", "b": [0.6353, 0.8798, 0.6661, 0.8996]}, {"w": "largest", "b": [0.6724, 0.8798, 0.7391, 0.8996]}, {"w": "AI", "b": [0.7454, 0.8798, 0.7692, 0.8996]}, {"w": "summer:", "b": [0.7755, 0.8798, 0.8624, 0.8996]}]}]}, {"page": 413, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "a period of intense interest, investment, and hype in the field of AI. As this book is being written, we’re in the middle of it. Whether this period will end in the near future, and what happens after it ends, are topics of debate. One thing is certain: in stark contrast with previous AI summers, deep learning has provided enormous business value to a number of large technology companies, enabling human-level speech recognition, smart assistants, human-level image classification, vastly improved machine translation, and more. The hype may (and likely will) recede, but the sustained economic and technological impact of deep learning will remain. In that sense, deep learning could be analogous to the internet: it may be overly hyped up for a few years, but in the longer term it will still be a major revolution that will transform our economy and our lives.", "words": [{"w": "a", "b": [0.1294, 0.0857, 0.1406, 0.1054]}, {"w": "period", "b": [0.1469, 0.0857, 0.2114, 0.1054]}, {"w": "of", "b": [0.2177, 0.0857, 0.2387, 0.1054]}, {"w": "intense", "b": [0.245, 0.0857, 0.3165, 0.1054]}, {"w": "interest,", "b": [0.3228, 0.0857, 0.4033, 0.1054]}, {"w": "investment,", "b": [0.4096, 0.0857, 0.5267, 0.1054]}, {"w": "and", "b": [0.533, 0.0857, 0.5694, 0.1054]}, {"w": "hype", "b": [0.5757, 0.0857, 0.6247, 0.1054]}, {"w": "in", "b": [0.6311, 0.0857, 0.6507, 0.1054]}, {"w": "the", "b": [0.657, 0.0857, 0.6878, 0.1054]}, {"w": "field", "b": [0.6941, 0.0857, 0.7404, 0.1054]}, {"w": "of", "b": [0.7467, 0.0857, 0.7677, 0.1054]}, {"w": "AI.", "b": [0.774, 0.0857, 0.8069, 0.1054]}, {"w": "As", "b": [0.8132, 0.0857, 0.8412, 0.1054]}, {"w": "this", "b": [0.1294, 0.1062, 0.1659, 0.1259]}, {"w": "book", "b": [0.1722, 0.1062, 0.2226, 0.1259]}, {"w": "is", "b": [0.2289, 0.1062, 0.2458, 0.1259]}, {"w": "being", "b": [0.2521, 0.1062, 0.3081, 0.1259]}, {"w": "written,", "b": [0.3144, 0.1062, 0.3922, 0.1259]}, {"w": "we’re", "b": [0.3985, 0.1062, 0.4559, 0.1259]}, {"w": "in", "b": [0.4622, 0.1062, 0.4818, 0.1259]}, {"w": "the", "b": [0.4881, 0.1062, 0.519, 0.1259]}, {"w": "middle", "b": [0.5253, 0.1062, 0.5954, 0.1259]}, {"w": "of", "b": [0.6016, 0.1062, 0.6226, 0.1259]}, {"w": "it.", "b": [0.6289, 0.1062, 0.6493, 0.1259]}, {"w": "Whether", "b": [0.6556, 0.1062, 0.7424, 0.1259]}, {"w": "this", "b": [0.7487, 0.1062, 0.7852, 0.1259]}, {"w": "period", "b": [0.7915, 0.1062, 0.8559, 0.1259]}, {"w": "will", "b": [0.1294, 0.1267, 0.1687, 0.1464]}, {"w": "end", "b": [0.175, 0.1267, 0.2114, 0.1464]}, {"w": "in", "b": [0.2177, 0.1267, 0.2373, 0.1464]}, {"w": "the", "b": [0.2436, 0.1267, 0.2745, 0.1464]}, {"w": "near", "b": [0.2808, 0.1267, 0.3242, 0.1464]}, {"w": "future,", "b": [0.3305, 0.1267, 0.397, 0.1464]}, {"w": "and", "b": [0.4033, 0.1267, 0.4398, 0.1464]}, {"w": "what", "b": [0.4461, 0.1267, 0.4951, 0.1464]}, {"w": "happens", "b": [0.5014, 0.1267, 0.5841, 0.1464]}, {"w": "after", "b": [0.5904, 0.1267, 0.6366, 0.1464]}, {"w": "it", "b": [0.6429, 0.1267, 0.6569, 0.1464]}, {"w": "ends,", "b": [0.6632, 0.1267, 0.7158, 0.1464]}, {"w": "are", "b": [0.7221, 0.1267, 0.7529, 0.1464]}, {"w": "topics", "b": [0.7592, 0.1267, 0.8195, 0.1464]}, {"w": "of", "b": [0.8258, 0.1267, 0.8468, 0.1464]}, {"w": "debate.", "b": [0.1294, 0.1472, 0.2016, 0.1669]}, {"w": "One", "b": [0.2079, 0.1472, 0.2499, 0.1669]}, {"w": "thing", "b": [0.2562, 0.1472, 0.3081, 0.1669]}, {"w": "is", "b": [0.3144, 0.1472, 0.3312, 0.1669]}, {"w": "certain:", "b": [0.3375, 0.1472, 0.4131, 0.1669]}, {"w": "in", "b": [0.4194, 0.1472, 0.439, 0.1669]}, {"w": "stark", "b": [0.4454, 0.1472, 0.4944, 0.1669]}, {"w": "contrast", "b": [0.5007, 0.1472, 0.5806, 0.1669]}, {"w": "with", "b": [0.5869, 0.1472, 0.6317, 0.1669]}, {"w": "previous", "b": [0.638, 0.1472, 0.7249, 0.1669]}, {"w": "AI", "b": [0.7312, 0.1472, 0.7578, 0.1669]}, {"w": "summers,", "b": [0.7641, 0.1472, 0.8615, 0.1669]}, {"w": "deep", "b": [0.1294, 0.1677, 0.177, 0.1874]}, {"w": "learning", "b": [0.1833, 0.1677, 0.266, 0.1874]}, {"w": "has", "b": [0.2723, 0.1677, 0.3059, 0.1874]}, {"w": "provided", "b": [0.3122, 0.1677, 0.4019, 0.1874]}, {"w": "enormous", "b": [0.4082, 0.1677, 0.5077, 0.1874]}, {"w": "business", "b": [0.514, 0.1677, 0.5995, 0.1874]}, {"w": "value", "b": [0.6058, 0.1677, 0.6605, 0.1874]}, {"w": "to", "b": [0.6668, 0.1677, 0.6864, 0.1874]}, {"w": "a", "b": [0.6927, 0.1677, 0.7039, 0.1874]}, {"w": "number", "b": [0.7102, 0.1677, 0.7873, 0.1874]}, {"w": "of", "b": [0.7936, 0.1677, 0.8146, 0.1874]}, {"w": "large", "b": [0.1294, 0.1882, 0.1794, 0.2079]}, {"w": "technology", "b": [0.1857, 0.1882, 0.2978, 0.2079]}, {"w": "companies,", "b": [0.3041, 0.1882, 0.4183, 0.2079]}, {"w": "enabling", "b": [0.4246, 0.1882, 0.5115, 0.2079]}, {"w": "human-level", "b": [0.5178, 0.1882, 0.6439, 0.2079]}, {"w": "speech", "b": [0.6502, 0.1882, 0.7188, 0.2079]}, {"w": "recognition,", "b": [0.7251, 0.1882, 0.8463, 0.2079]}, {"w": "smart", "b": [0.1294, 0.2087, 0.1855, 0.2284]}, {"w": "assistants,", "b": [0.1918, 0.2087, 0.2934, 0.2284]}, {"w": "human-level", "b": [0.2997, 0.2087, 0.4258, 0.2284]}, {"w": "image", "b": [0.4321, 0.2087, 0.4937, 0.2284]}, {"w": "classification,", "b": [0.5001, 0.2087, 0.6395, 0.2284]}, {"w": "vastly", "b": [0.6458, 0.2087, 0.706, 0.2284]}, {"w": "improved", "b": [0.7123, 0.2087, 0.809, 0.2284]}, {"w": "machine", "b": [0.1294, 0.2292, 0.2149, 0.2489]}, {"w": "translation,", "b": [0.2212, 0.2292, 0.334, 0.2489]}, {"w": "and", "b": [0.3403, 0.2292, 0.3767, 0.2489]}, {"w": "more.", "b": [0.383, 0.2292, 0.4412, 0.2489]}, {"w": "The", "b": [0.4475, 0.2292, 0.4867, 0.2489]}, {"w": "hype", "b": [0.493, 0.2292, 0.5421, 0.2489]}, {"w": "may", "b": [0.5484, 0.2292, 0.5918, 0.2489]}, {"w": "(and", "b": [0.5981, 0.2292, 0.6429, 0.2489]}, {"w": "likely", "b": [0.6492, 0.2292, 0.7067, 0.2489]}, {"w": "will)", "b": [0.713, 0.2292, 0.7607, 0.2489]}, {"w": "recede,", "b": [0.767, 0.2292, 0.8391, 0.2489]}, {"w": "but", "b": [0.1294, 0.2497, 0.1617, 0.2694]}, {"w": "the", "b": [0.168, 0.2497, 0.1988, 0.2694]}, {"w": "sustained", "b": [0.2051, 0.2497, 0.299, 0.2694]}, {"w": "economic", "b": [0.3053, 0.2497, 0.4034, 0.2694]}, {"w": "and", "b": [0.4097, 0.2497, 0.4461, 0.2694]}, {"w": "technological", "b": [0.4524, 0.2497, 0.5883, 0.2694]}, {"w": "impact", "b": [0.5945, 0.2497, 0.6632, 0.2694]}, {"w": "of", "b": [0.6695, 0.2497, 0.6905, 0.2694]}, {"w": "deep", "b": [0.6968, 0.2497, 0.7444, 0.2694]}, {"w": "learning", "b": [0.7508, 0.2497, 0.8334, 0.2694]}, {"w": "will", "b": [0.1294, 0.2702, 0.1687, 0.2899]}, {"w": "remain.", "b": [0.175, 0.2702, 0.2513, 0.2899]}, {"w": "In", "b": [0.2576, 0.2702, 0.2786, 0.2899]}, {"w": "that", "b": [0.285, 0.2702, 0.3228, 0.2899]}, {"w": "sense,", "b": [0.3291, 0.2702, 0.39, 0.2899]}, {"w": "deep", "b": [0.3964, 0.2702, 0.444, 0.2899]}, {"w": "learning", "b": [0.4503, 0.2702, 0.5329, 0.2899]}, {"w": "could", "b": [0.5393, 0.2702, 0.5953, 0.2899]}, {"w": "be", "b": [0.6016, 0.2702, 0.6254, 0.2899]}, {"w": "analogous", "b": [0.6317, 0.2702, 0.734, 0.2899]}, {"w": "to", "b": [0.7403, 0.2702, 0.76, 0.2899]}, {"w": "the", "b": [0.7663, 0.2702, 0.7971, 0.2899]}, {"w": "internet:", "b": [0.1294, 0.2907, 0.2135, 0.3104]}, {"w": "it", "b": [0.2198, 0.2907, 0.2338, 0.3104]}, {"w": "may", "b": [0.2401, 0.2907, 0.2836, 0.3104]}, {"w": "be", "b": [0.2899, 0.2907, 0.3137, 0.3104]}, {"w": "overly", "b": [0.32, 0.2907, 0.3844, 0.3104]}, {"w": "hyped", "b": [0.3908, 0.2907, 0.4524, 0.3104]}, {"w": "up", "b": [0.4586, 0.2907, 0.4839, 0.3104]}, {"w": "for", "b": [0.4902, 0.2907, 0.5196, 0.3104]}, {"w": "a", "b": [0.5259, 0.2907, 0.5371, 0.3104]}, {"w": "few", "b": [0.5434, 0.2907, 0.5812, 0.3104]}, {"w": "years,", "b": [0.5875, 0.2907, 0.6471, 0.3104]}, {"w": "but", "b": [0.6534, 0.2907, 0.6856, 0.3104]}, {"w": "in", "b": [0.6919, 0.2907, 0.7115, 0.3104]}, {"w": "the", "b": [0.7178, 0.2907, 0.7487, 0.3104]}, {"w": "longer", "b": [0.755, 0.2907, 0.8194, 0.3104]}, {"w": "term", "b": [0.1294, 0.3112, 0.1757, 0.3309]}, {"w": "it", "b": [0.182, 0.3112, 0.196, 0.3309]}, {"w": "will", "b": [0.2023, 0.3112, 0.2415, 0.3309]}, {"w": "still", "b": [0.2478, 0.3112, 0.2857, 0.3309]}, {"w": "be", "b": [0.292, 0.3112, 0.3158, 0.3309]}, {"w": "a", "b": [0.3221, 0.3112, 0.3333, 0.3309]}, {"w": "major", "b": [0.3396, 0.3112, 0.3985, 0.3309]}, {"w": "revolution", "b": [0.4048, 0.3112, 0.5085, 0.3309]}, {"w": "that", "b": [0.5148, 0.3112, 0.5526, 0.3309]}, {"w": "will", "b": [0.559, 0.3112, 0.5982, 0.3309]}, {"w": "transform", "b": [0.6045, 0.3112, 0.7026, 0.3309]}, {"w": "our", "b": [0.7089, 0.3112, 0.7425, 0.3309]}, {"w": "economy", "b": [0.7488, 0.3112, 0.8413, 0.3309]}, {"w": "and", "b": [0.1294, 0.3317, 0.1658, 0.3514]}, {"w": "our", "b": [0.1721, 0.3317, 0.2058, 0.3514]}, {"w": "lives.", "b": [0.2121, 0.3317, 0.266, 0.3514]}]}, {"id": "b_1", "type": "paragraph", "text": "I’m particularly optimistic about deep learning because even if we were to make no further technological progress in the next decade, deploying existing algorithms to every applicable problem would be a game changer for most industries. Deep learning is nothing short of a revolution, and progress is currently happening at an incredibly fast rate, due to an exponential investment in resources and headcount. From where I stand, the future looks bright, although short-term expectations are somewhat overoptimistic; deploying deep learning to the full extent of its potential will take well over a decade.", "words": [{"w": "I’m", "b": [0.1294, 0.3745, 0.1658, 0.3942]}, {"w": "particularly", "b": [0.1721, 0.3745, 0.2884, 0.3942]}, {"w": "optimistic", "b": [0.2947, 0.3745, 0.3957, 0.3942]}, {"w": "about", "b": [0.402, 0.3745, 0.458, 0.3942]}, {"w": "deep", "b": [0.4643, 0.3745, 0.512, 0.3942]}, {"w": "learning", "b": [0.5183, 0.3745, 0.6009, 0.3942]}, {"w": "because", "b": [0.6072, 0.3745, 0.6871, 0.3942]}, {"w": "even", "b": [0.6934, 0.3745, 0.741, 0.3942]}, {"w": "if", "b": [0.7473, 0.3745, 0.7627, 0.3942]}, {"w": "we", "b": [0.769, 0.3745, 0.7984, 0.3942]}, {"w": "were", "b": [0.8048, 0.3745, 0.8538, 0.3942]}, {"w": "to", "b": [0.1294, 0.395, 0.149, 0.4147]}, {"w": "make", "b": [0.1553, 0.395, 0.21, 0.4147]}, {"w": "no", "b": [0.2163, 0.395, 0.2415, 0.4147]}, {"w": "further", "b": [0.2478, 0.395, 0.3165, 0.4147]}, {"w": "technological", "b": [0.3228, 0.395, 0.4587, 0.4147]}, {"w": "progress", "b": [0.465, 0.395, 0.5505, 0.4147]}, {"w": "in", "b": [0.5568, 0.395, 0.5764, 0.4147]}, {"w": "the", "b": [0.5827, 0.395, 0.6135, 0.4147]}, {"w": "next", "b": [0.6198, 0.395, 0.6633, 0.4147]}, {"w": "decade,", "b": [0.6695, 0.395, 0.7458, 0.4147]}, {"w": "deploying", "b": [0.7521, 0.395, 0.853, 0.4147]}, {"w": "existing", "b": [0.1294, 0.4155, 0.2093, 0.4352]}, {"w": "algorithms", "b": [0.2156, 0.4155, 0.3235, 0.4352]}, {"w": "to", "b": [0.3298, 0.4155, 0.3495, 0.4352]}, {"w": "every", "b": [0.3558, 0.4155, 0.4118, 0.4352]}, {"w": "applicable", "b": [0.4181, 0.4155, 0.5218, 0.4352]}, {"w": "problem", "b": [0.5281, 0.4155, 0.6122, 0.4352]}, {"w": "would", "b": [0.6185, 0.4155, 0.6815, 0.4352]}, {"w": "be", "b": [0.6878, 0.4155, 0.7116, 0.4352]}, {"w": "a", "b": [0.718, 0.4155, 0.7292, 0.4352]}, {"w": "game", "b": [0.7355, 0.4155, 0.7901, 0.4352]}, {"w": "changer", "b": [0.1294, 0.436, 0.2093, 0.4557]}, {"w": "for", "b": [0.2156, 0.436, 0.245, 0.4557]}, {"w": "most", "b": [0.2513, 0.436, 0.3003, 0.4557]}, {"w": "industries.", "b": [0.3066, 0.436, 0.4111, 0.4557]}, {"w": "Deep", "b": [0.4174, 0.436, 0.4706, 0.4557]}, {"w": "learning", "b": [0.4769, 0.436, 0.5596, 0.4557]}, {"w": "is", "b": [0.5658, 0.436, 0.5826, 0.4557]}, {"w": "nothing", "b": [0.5889, 0.436, 0.666, 0.4557]}, {"w": "short", "b": [0.6723, 0.436, 0.7228, 0.4557]}, {"w": "of", "b": [0.7291, 0.436, 0.7501, 0.4557]}, {"w": "a", "b": [0.7564, 0.436, 0.7676, 0.4557]}, {"w": "revolution,", "b": [0.1294, 0.4565, 0.2394, 0.4762]}, {"w": "and", "b": [0.2457, 0.4565, 0.2822, 0.4762]}, {"w": "progress", "b": [0.2885, 0.4565, 0.3739, 0.4762]}, {"w": "is", "b": [0.3802, 0.4565, 0.3971, 0.4762]}, {"w": "currently", "b": [0.4034, 0.4565, 0.4944, 0.4762]}, {"w": "happening", "b": [0.5007, 0.4565, 0.6058, 0.4762]}, {"w": "at", "b": [0.6121, 0.4565, 0.6303, 0.4762]}, {"w": "an", "b": [0.6367, 0.4565, 0.6605, 0.4762]}, {"w": "incredibly", "b": [0.6668, 0.4565, 0.7691, 0.4762]}, {"w": "fast", "b": [0.7754, 0.4565, 0.8118, 0.4762]}, {"w": "rate,", "b": [0.8181, 0.4565, 0.8622, 0.4762]}, {"w": "due", "b": [0.1294, 0.477, 0.1658, 0.4967]}, {"w": "to", "b": [0.1721, 0.477, 0.1918, 0.4967]}, {"w": "an", "b": [0.1981, 0.477, 0.2219, 0.4967]}, {"w": "exponential", "b": [0.2282, 0.477, 0.3459, 0.4967]}, {"w": "investment", "b": [0.3522, 0.477, 0.4629, 0.4967]}, {"w": "in", "b": [0.4692, 0.477, 0.4888, 0.4967]}, {"w": "resources", "b": [0.4951, 0.477, 0.5904, 0.4967]}, {"w": "and", "b": [0.5967, 0.477, 0.6331, 0.4967]}, {"w": "headcount.", "b": [0.6394, 0.477, 0.7494, 0.4967]}, {"w": "From", "b": [0.7557, 0.477, 0.8103, 0.4967]}, {"w": "where", "b": [0.1294, 0.4975, 0.191, 0.5172]}, {"w": "I", "b": [0.1973, 0.4975, 0.2057, 0.5172]}, {"w": "stand,", "b": [0.2121, 0.4975, 0.2716, 0.5172]}, {"w": "the", "b": [0.2779, 0.4975, 0.3087, 0.5172]}, {"w": "future", "b": [0.315, 0.4975, 0.3753, 0.5172]}, {"w": "looks", "b": [0.3816, 0.4975, 0.4363, 0.5172]}, {"w": "bright,", "b": [0.4426, 0.4975, 0.5091, 0.5172]}, {"w": "although", "b": [0.5154, 0.4975, 0.6037, 0.5172]}, {"w": "short-term", "b": [0.61, 0.4975, 0.7151, 0.5172]}, {"w": "expectations", "b": [0.7214, 0.4975, 0.8475, 0.5172]}, {"w": "are", "b": [0.1294, 0.518, 0.1602, 0.5377]}, {"w": "somewhat", "b": [0.1665, 0.518, 0.2688, 0.5377]}, {"w": "overoptimistic;", "b": [0.2751, 0.518, 0.4279, 0.5377]}, {"w": "deploying", "b": [0.4341, 0.518, 0.535, 0.5377]}, {"w": "deep", "b": [0.5413, 0.518, 0.589, 0.5377]}, {"w": "learning", "b": [0.5953, 0.518, 0.6779, 0.5377]}, {"w": "to", "b": [0.6842, 0.518, 0.7039, 0.5377]}, {"w": "the", "b": [0.7102, 0.518, 0.741, 0.5377]}, {"w": "full", "b": [0.7473, 0.518, 0.7823, 0.5377]}, {"w": "extent", "b": [0.7887, 0.518, 0.8503, 0.5377]}, {"w": "of", "b": [0.1294, 0.5385, 0.1504, 0.5582]}, {"w": "its", "b": [0.1567, 0.5385, 0.1806, 0.5582]}, {"w": "potential", "b": [0.1869, 0.5385, 0.2752, 0.5582]}, {"w": "will", "b": [0.2815, 0.5385, 0.3207, 0.5582]}, {"w": "take", "b": [0.327, 0.5385, 0.3691, 0.5582]}, {"w": "well", "b": [0.3754, 0.5385, 0.4188, 0.5582]}, {"w": "over", "b": [0.4251, 0.5385, 0.4699, 0.5582]}, {"w": "a", "b": [0.4762, 0.5385, 0.4874, 0.5582]}, {"w": "decade.", "b": [0.4937, 0.5385, 0.5701, 0.5582]}]}, {"id": "b_2", "type": "paragraph", "text": "9.1.3. How to think about deep learning", "words": [{"w": "9.1.3.", "b": [0.1294, 0.5857, 0.1862, 0.6054]}, {"w": "How", "b": [0.1925, 0.5857, 0.2429, 0.6054]}, {"w": "to", "b": [0.2492, 0.5857, 0.2702, 0.6054]}, {"w": "think", "b": [0.2766, 0.5857, 0.334, 0.6054]}, {"w": "about", "b": [0.3403, 0.5857, 0.402, 0.6054]}, {"w": "deep", "b": [0.4083, 0.5857, 0.4588, 0.6054]}, {"w": "learning", "b": [0.4651, 0.5857, 0.5548, 0.6054]}]}, {"id": "b_3", "type": "paragraph", "text": "The most surprising thing about deep learning is how simple it is. Ten years ago, no one expected that we would achieve such amazing results on machine-perception problems by using simple parametric models trained with gradient descent. Now, it turns out that all you need is sufficiently large parametric models trained with gradient descent on sufficiently many examples. As Feynman once said about the universe, “It’s not complicated, it’s just a lot of it.”[1]", "words": [{"w": "The", "b": [0.1294, 0.6285, 0.1686, 0.6482]}, {"w": "most", "b": [0.1749, 0.6285, 0.224, 0.6482]}, {"w": "surprising", "b": [0.2303, 0.6285, 0.3312, 0.6482]}, {"w": "thing", "b": [0.3375, 0.6285, 0.3894, 0.6482]}, {"w": "about", "b": [0.3957, 0.6285, 0.4517, 0.6482]}, {"w": "deep", "b": [0.4581, 0.6285, 0.5057, 0.6482]}, {"w": "learning", "b": [0.512, 0.6285, 0.5947, 0.6482]}, {"w": "is", "b": [0.601, 0.6285, 0.6178, 0.6482]}, {"w": "how", "b": [0.6241, 0.6285, 0.6675, 0.6482]}, {"w": "simple", "b": [0.6738, 0.6285, 0.7411, 0.6482]}, {"w": "it", "b": [0.7474, 0.6285, 0.7614, 0.6482]}, {"w": "is.", "b": [0.7677, 0.6285, 0.7909, 0.6482]}, {"w": "Ten", "b": [0.7972, 0.6285, 0.8346, 0.6482]}, {"w": "years", "b": [0.1294, 0.649, 0.1826, 0.6687]}, {"w": "ago,", "b": [0.1889, 0.649, 0.2317, 0.6687]}, {"w": "no", "b": [0.238, 0.649, 0.2632, 0.6687]}, {"w": "one", "b": [0.2695, 0.649, 0.3059, 0.6687]}, {"w": "expected", "b": [0.3122, 0.649, 0.4019, 0.6687]}, {"w": "that", "b": [0.4082, 0.649, 0.446, 0.6687]}, {"w": "we", "b": [0.4524, 0.649, 0.4818, 0.6687]}, {"w": "would", "b": [0.4881, 0.649, 0.5511, 0.6687]}, {"w": "achieve", "b": [0.5574, 0.649, 0.6345, 0.6687]}, {"w": "such", "b": [0.6408, 0.649, 0.687, 0.6687]}, {"w": "amazing", "b": [0.6933, 0.649, 0.7787, 0.6687]}, {"w": "results", "b": [0.785, 0.649, 0.8509, 0.6687]}, {"w": "on", "b": [0.1294, 0.6695, 0.1546, 0.6892]}, {"w": "machine-perception", "b": [0.1609, 0.6695, 0.3613, 0.6892]}, {"w": "problems", "b": [0.3676, 0.6695, 0.4615, 0.6892]}, {"w": "by", "b": [0.4678, 0.6695, 0.493, 0.6892]}, {"w": "using", "b": [0.4993, 0.6695, 0.554, 0.6892]}, {"w": "simple", "b": [0.5603, 0.6695, 0.6276, 0.6892]}, {"w": "parametric", "b": [0.6339, 0.6695, 0.7417, 0.6892]}, {"w": "models", "b": [0.748, 0.6695, 0.8209, 0.6892]}, {"w": "trained", "b": [0.1294, 0.69, 0.1995, 0.7097]}, {"w": "with", "b": [0.2058, 0.69, 0.2506, 0.7097]}, {"w": "gradient", "b": [0.2569, 0.69, 0.3396, 0.7097]}, {"w": "descent.", "b": [0.3459, 0.69, 0.4279, 0.7097]}, {"w": "Now,", "b": [0.4342, 0.69, 0.4878, 0.7097]}, {"w": "it", "b": [0.4941, 0.69, 0.5082, 0.7097]}, {"w": "turns", "b": [0.5145, 0.69, 0.5649, 0.7097]}, {"w": "out", "b": [0.5712, 0.69, 0.6035, 0.7097]}, {"w": "that", "b": [0.6098, 0.69, 0.6476, 0.7097]}, {"w": "all", "b": [0.6539, 0.69, 0.6791, 0.7097]}, {"w": "you", "b": [0.6854, 0.69, 0.7233, 0.7097]}, {"w": "need", "b": [0.7296, 0.69, 0.7772, 0.7097]}, {"w": "is", "b": [0.7835, 0.69, 0.8003, 0.7097]}, {"w": "sufficiently", "b": [0.1294, 0.7105, 0.2439, 0.7302]}, {"w": "large", "b": [0.2502, 0.7105, 0.3001, 0.7302]}, {"w": "parametric", "b": [0.3064, 0.7105, 0.4143, 0.7302]}, {"w": "models", "b": [0.4206, 0.7105, 0.4935, 0.7302]}, {"w": "trained", "b": [0.4998, 0.7105, 0.5698, 0.7302]}, {"w": "with", "b": [0.5761, 0.7105, 0.621, 0.7302]}, {"w": "gradient", "b": [0.6273, 0.7105, 0.71, 0.7302]}, {"w": "descent", "b": [0.7163, 0.7105, 0.7919, 0.7302]}, {"w": "on", "b": [0.7982, 0.7105, 0.8234, 0.7302]}, {"w": "sufficiently", "b": [0.1294, 0.731, 0.2439, 0.7507]}, {"w": "many", "b": [0.2502, 0.731, 0.3062, 0.7507]}, {"w": "examples.", "b": [0.3125, 0.731, 0.4141, 0.7507]}, {"w": "As", "b": [0.4204, 0.731, 0.4484, 0.7507]}, {"w": "Feynman", "b": [0.4547, 0.731, 0.5486, 0.7507]}, {"w": "once", "b": [0.5549, 0.731, 0.6025, 0.7507]}, {"w": "said", "b": [0.6088, 0.731, 0.6495, 0.7507]}, {"w": "about", "b": [0.6558, 0.731, 0.7118, 0.7507]}, {"w": "the", "b": [0.7181, 0.731, 0.7489, 0.7507]}, {"w": "universe,", "b": [0.7553, 0.731, 0.847, 0.7507]}, {"w": "“It’s", "b": [0.1294, 0.7533, 0.1728, 0.773]}, {"w": "not", "b": [0.1791, 0.7533, 0.2114, 0.773]}, {"w": "complicated,", "b": [0.2177, 0.7533, 0.3473, 0.773]}, {"w": "it’s", "b": [0.3536, 0.7533, 0.3844, 0.773]}, {"w": "just", "b": [0.3907, 0.7533, 0.4272, 0.773]}, {"w": "a", "b": [0.4335, 0.7533, 0.4447, 0.773]}, {"w": "lot", "b": [0.451, 0.7533, 0.4776, 0.773]}, {"w": "of", "b": [0.4839, 0.7533, 0.5049, 0.773]}, {"w": "it.”[1]", "b": [0.5112, 0.751, 0.5648, 0.773]}]}, {"id": "b_5", "type": "paragraph", "text": "Richard Feynman, interview, The World from Another Point of View, Yorkshire Television, 1972.", "words": [{"w": "Richard", "b": [0.1483, 0.8187, 0.2082, 0.8336]}, {"w": "Feynman,", "b": [0.213, 0.8187, 0.2881, 0.8336]}, {"w": "interview,", "b": [0.2928, 0.8187, 0.3678, 0.8336]}, {"w": "The", "b": [0.3725, 0.8187, 0.4009, 0.8336]}, {"w": "World", "b": [0.4056, 0.8187, 0.4512, 0.8336]}, {"w": "from", "b": [0.4559, 0.8187, 0.4909, 0.8336]}, {"w": "Another", "b": [0.4957, 0.8187, 0.5566, 0.8336]}, {"w": "Point", "b": [0.5613, 0.8187, 0.6023, 0.8336]}, {"w": "of", "b": [0.6071, 0.8187, 0.6218, 0.8336]}, {"w": "View,", "b": [0.6265, 0.8187, 0.6676, 0.8336]}, {"w": "Yorkshire", "b": [0.6724, 0.8187, 0.7461, 0.8336]}, {"w": "Television,", "b": [0.7509, 0.8187, 0.8342, 0.8336]}, {"w": "1972.", "b": [0.1483, 0.8339, 0.1909, 0.8487]}]}, {"id": "b_6", "type": "paragraph", "text": "In deep learning, everything is a vector: everything is a point in a geometric space. Model inputs (text, images, and so on) and targets are", "words": [{"w": "In", "b": [0.1294, 0.8718, 0.1504, 0.8916]}, {"w": "deep", "b": [0.1567, 0.8718, 0.2044, 0.8916]}, {"w": "learning,", "b": [0.2107, 0.8718, 0.2996, 0.8916]}, {"w": "everything", "b": [0.3059, 0.8718, 0.4138, 0.8916]}, {"w": "is", "b": [0.4201, 0.8718, 0.437, 0.8916]}, {"w": "a", "b": [0.4433, 0.8718, 0.4545, 0.8916]}, {"w": "vector:", "b": [0.4608, 0.8718, 0.5308, 0.8916]}, {"w": "everything", "b": [0.5371, 0.8718, 0.645, 0.8916]}, {"w": "is", "b": [0.6513, 0.8718, 0.6682, 0.8916]}, {"w": "a", "b": [0.6745, 0.8718, 0.6857, 0.8916]}, {"w": "point", "b": [0.6919, 0.8718, 0.7438, 0.8916]}, {"w": "in", "b": [0.75, 0.8718, 0.7697, 0.8916]}, {"w": "a", "b": [0.776, 0.8718, 0.7872, 0.8916]}, {"w": "geometric", "b": [0.1294, 0.8923, 0.2303, 0.9121]}, {"w": "space.", "b": [0.2366, 0.8923, 0.3003, 0.9121]}, {"w": "Model", "b": [0.3066, 0.8923, 0.3725, 0.9121]}, {"w": "inputs", "b": [0.3788, 0.8923, 0.4405, 0.9121]}, {"w": "(text,", "b": [0.4468, 0.8923, 0.4993, 0.9121]}, {"w": "images,", "b": [0.5056, 0.8923, 0.5834, 0.9121]}, {"w": "and", "b": [0.5897, 0.8923, 0.6261, 0.9121]}, {"w": "so", "b": [0.6324, 0.8923, 0.6549, 0.9121]}, {"w": "on)", "b": [0.6612, 0.8923, 0.6948, 0.9121]}, {"w": "and", "b": [0.7011, 0.8923, 0.7375, 0.9121]}, {"w": "targets", "b": [0.7438, 0.8923, 0.8106, 0.9121]}, {"w": "are", "b": [0.8169, 0.8923, 0.8477, 0.9121]}]}]}, {"page": 414, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "first vectorized: turned into an initial input vector space and target vector space. Each layer in a deep-learning model operates one simple geometric transformation on the data that goes through it. Together, the chain of layers in the model forms one complex geometric transformation, broken down into a series of simple ones. This complex transformation attempts to map the input space to the target space, one point at a time. This transformation is parameterized by the weights of the layers, which are iteratively updated based on how well the model is currently performing. A key characteristic of this geometric transformation is that it must be differentiable, which is required in order for us to be able to learn its parameters via gradient descent. Intuitively, this means the geometric morphing from inputs to outputs must be smooth and continuous—a significant constraint.", "words": [{"w": "first", "b": [0.1294, 0.0857, 0.1701, 0.1054]}, {"w": "vectorized:", "b": [0.1763, 0.0857, 0.287, 0.1054]}, {"w": "turned", "b": [0.2933, 0.0857, 0.3578, 0.1054]}, {"w": "into", "b": [0.3641, 0.0857, 0.4033, 0.1054]}, {"w": "an", "b": [0.4096, 0.0857, 0.4334, 0.1054]}, {"w": "initial", "b": [0.4398, 0.0857, 0.4986, 0.1054]}, {"w": "input", "b": [0.5049, 0.0857, 0.5568, 0.1054]}, {"w": "vector", "b": [0.5631, 0.0857, 0.6261, 0.1054]}, {"w": "space", "b": [0.6325, 0.0857, 0.6885, 0.1054]}, {"w": "and", "b": [0.6948, 0.0857, 0.7312, 0.1054]}, {"w": "target", "b": [0.7375, 0.0857, 0.7944, 0.1054]}, {"w": "vector", "b": [0.8007, 0.0857, 0.8638, 0.1054]}, {"w": "space.", "b": [0.1294, 0.1062, 0.1917, 0.1259]}, {"w": "Each", "b": [0.1981, 0.1062, 0.2485, 0.1259]}, {"w": "layer", "b": [0.2548, 0.1062, 0.3052, 0.1259]}, {"w": "in", "b": [0.3115, 0.1062, 0.3311, 0.1259]}, {"w": "a", "b": [0.3374, 0.1062, 0.3486, 0.1259]}, {"w": "deep-learning", "b": [0.355, 0.1062, 0.4936, 0.1259]}, {"w": "model", "b": [0.5, 0.1062, 0.563, 0.1259]}, {"w": "operates", "b": [0.5693, 0.1062, 0.6534, 0.1259]}, {"w": "one", "b": [0.6597, 0.1062, 0.6961, 0.1259]}, {"w": "simple", "b": [0.7024, 0.1062, 0.7697, 0.1259]}, {"w": "geometric", "b": [0.1294, 0.1267, 0.2303, 0.1464]}, {"w": "transformation", "b": [0.2366, 0.1267, 0.3851, 0.1464]}, {"w": "on", "b": [0.3914, 0.1267, 0.4167, 0.1464]}, {"w": "the", "b": [0.423, 0.1267, 0.4538, 0.1464]}, {"w": "data", "b": [0.4601, 0.1267, 0.5021, 0.1464]}, {"w": "that", "b": [0.5084, 0.1267, 0.5463, 0.1464]}, {"w": "goes", "b": [0.5526, 0.1267, 0.5988, 0.1464]}, {"w": "through", "b": [0.6051, 0.1267, 0.6836, 0.1464]}, {"w": "it.", "b": [0.6899, 0.1267, 0.7102, 0.1464]}, {"w": "Together,", "b": [0.7165, 0.1267, 0.811, 0.1464]}, {"w": "the", "b": [0.8173, 0.1267, 0.8482, 0.1464]}, {"w": "chain", "b": [0.1294, 0.1472, 0.1841, 0.1669]}, {"w": "of", "b": [0.1904, 0.1472, 0.2114, 0.1669]}, {"w": "layers", "b": [0.2177, 0.1472, 0.2779, 0.1669]}, {"w": "in", "b": [0.2842, 0.1472, 0.3038, 0.1669]}, {"w": "the", "b": [0.3102, 0.1472, 0.341, 0.1669]}, {"w": "model", "b": [0.3473, 0.1472, 0.4104, 0.1669]}, {"w": "forms", "b": [0.4167, 0.1472, 0.4755, 0.1669]}, {"w": "one", "b": [0.4818, 0.1472, 0.5182, 0.1669]}, {"w": "complex", "b": [0.5245, 0.1472, 0.6114, 0.1669]}, {"w": "geometric", "b": [0.6177, 0.1472, 0.7186, 0.1669]}, {"w": "transformation,", "b": [0.1294, 0.1677, 0.2842, 0.1874]}, {"w": "broken", "b": [0.2906, 0.1677, 0.3606, 0.1874]}, {"w": "down", "b": [0.3669, 0.1677, 0.423, 0.1874]}, {"w": "into", "b": [0.4293, 0.1677, 0.4685, 0.1874]}, {"w": "a", "b": [0.4748, 0.1677, 0.486, 0.1874]}, {"w": "series", "b": [0.4923, 0.1677, 0.5498, 0.1874]}, {"w": "of", "b": [0.5561, 0.1677, 0.5771, 0.1874]}, {"w": "simple", "b": [0.5834, 0.1677, 0.6507, 0.1874]}, {"w": "ones.", "b": [0.657, 0.1677, 0.7095, 0.1874]}, {"w": "This", "b": [0.7158, 0.1677, 0.7607, 0.1874]}, {"w": "complex", "b": [0.767, 0.1677, 0.8539, 0.1874]}, {"w": "transformation", "b": [0.1294, 0.1882, 0.2779, 0.2079]}, {"w": "attempts", "b": [0.2842, 0.1882, 0.3697, 0.2079]}, {"w": "to", "b": [0.376, 0.1882, 0.3957, 0.2079]}, {"w": "map", "b": [0.402, 0.1882, 0.4454, 0.2079]}, {"w": "the", "b": [0.4517, 0.1882, 0.4825, 0.2079]}, {"w": "input", "b": [0.4889, 0.1882, 0.5407, 0.2079]}, {"w": "space", "b": [0.547, 0.1882, 0.6031, 0.2079]}, {"w": "to", "b": [0.6094, 0.1882, 0.629, 0.2079]}, {"w": "the", "b": [0.6353, 0.1882, 0.6661, 0.2079]}, {"w": "target", "b": [0.6723, 0.1882, 0.7293, 0.2079]}, {"w": "space,", "b": [0.7356, 0.1882, 0.7979, 0.2079]}, {"w": "one", "b": [0.8042, 0.1882, 0.8407, 0.2079]}, {"w": "point", "b": [0.1294, 0.2087, 0.1813, 0.2284]}, {"w": "at", "b": [0.1876, 0.2087, 0.2058, 0.2284]}, {"w": "a", "b": [0.2121, 0.2087, 0.2233, 0.2284]}, {"w": "time.", "b": [0.2296, 0.2087, 0.2808, 0.2284]}, {"w": "This", "b": [0.2871, 0.2087, 0.3319, 0.2284]}, {"w": "transformation", "b": [0.3382, 0.2087, 0.4868, 0.2284]}, {"w": "is", "b": [0.4931, 0.2087, 0.5099, 0.2284]}, {"w": "parameterized", "b": [0.5162, 0.2087, 0.6591, 0.2284]}, {"w": "by", "b": [0.6654, 0.2087, 0.6906, 0.2284]}, {"w": "the", "b": [0.6969, 0.2087, 0.7277, 0.2284]}, {"w": "weights", "b": [0.734, 0.2087, 0.8125, 0.2284]}, {"w": "of", "b": [0.8188, 0.2087, 0.8398, 0.2284]}, {"w": "the", "b": [0.1294, 0.2292, 0.1602, 0.2489]}, {"w": "layers,", "b": [0.1665, 0.2292, 0.2331, 0.2489]}, {"w": "which", "b": [0.2394, 0.2292, 0.301, 0.2489]}, {"w": "are", "b": [0.3074, 0.2292, 0.3382, 0.2489]}, {"w": "iteratively", "b": [0.3445, 0.2292, 0.4468, 0.2489]}, {"w": "updated", "b": [0.453, 0.2292, 0.5329, 0.2489]}, {"w": "based", "b": [0.5392, 0.2292, 0.5966, 0.2489]}, {"w": "on", "b": [0.6029, 0.2292, 0.6281, 0.2489]}, {"w": "how", "b": [0.6344, 0.2292, 0.6779, 0.2489]}, {"w": "well", "b": [0.6842, 0.2292, 0.7276, 0.2489]}, {"w": "the", "b": [0.7339, 0.2292, 0.7648, 0.2489]}, {"w": "model", "b": [0.7711, 0.2292, 0.8341, 0.2489]}, {"w": "is", "b": [0.8404, 0.2292, 0.8573, 0.2489]}, {"w": "currently", "b": [0.1294, 0.2497, 0.2205, 0.2694]}, {"w": "performing.", "b": [0.2268, 0.2497, 0.3466, 0.2694]}, {"w": "A", "b": [0.3529, 0.2497, 0.3711, 0.2694]}, {"w": "key", "b": [0.3774, 0.2497, 0.4138, 0.2694]}, {"w": "characteristic", "b": [0.4201, 0.2497, 0.5546, 0.2694]}, {"w": "of", "b": [0.5609, 0.2497, 0.5819, 0.2694]}, {"w": "this", "b": [0.5882, 0.2497, 0.6247, 0.2694]}, {"w": "geometric", "b": [0.631, 0.2497, 0.7319, 0.2694]}, {"w": "transformation", "b": [0.1294, 0.2702, 0.2779, 0.2899]}, {"w": "is", "b": [0.2842, 0.2702, 0.3011, 0.2899]}, {"w": "that", "b": [0.3074, 0.2702, 0.3452, 0.2899]}, {"w": "it", "b": [0.3515, 0.2702, 0.3655, 0.2899]}, {"w": "must", "b": [0.3718, 0.2702, 0.4209, 0.2899]}, {"w": "be", "b": [0.4272, 0.2702, 0.451, 0.2899]}, {"w": "differentiable,", "b": [0.4573, 0.2702, 0.5985, 0.2899]}, {"w": "which", "b": [0.6048, 0.2702, 0.6665, 0.2899]}, {"w": "is", "b": [0.6728, 0.2702, 0.6896, 0.2899]}, {"w": "required", "b": [0.6959, 0.2702, 0.78, 0.2899]}, {"w": "in", "b": [0.7863, 0.2702, 0.8059, 0.2899]}, {"w": "order", "b": [0.8122, 0.2702, 0.8654, 0.2899]}, {"w": "for", "b": [0.1294, 0.2907, 0.1588, 0.3104]}, {"w": "us", "b": [0.1651, 0.2907, 0.1876, 0.3104]}, {"w": "to", "b": [0.1939, 0.2907, 0.2135, 0.3104]}, {"w": "be", "b": [0.2198, 0.2907, 0.2436, 0.3104]}, {"w": "able", "b": [0.2499, 0.2907, 0.2919, 0.3104]}, {"w": "to", "b": [0.2982, 0.2907, 0.3179, 0.3104]}, {"w": "learn", "b": [0.3242, 0.2907, 0.3746, 0.3104]}, {"w": "its", "b": [0.3809, 0.2907, 0.4048, 0.3104]}, {"w": "parameters", "b": [0.4111, 0.2907, 0.5217, 0.3104]}, {"w": "via", "b": [0.528, 0.2907, 0.5589, 0.3104]}, {"w": "gradient", "b": [0.5652, 0.2907, 0.6478, 0.3104]}, {"w": "descent.", "b": [0.6541, 0.2907, 0.7361, 0.3104]}, {"w": "Intuitively,", "b": [0.7424, 0.2907, 0.8521, 0.3104]}, {"w": "this", "b": [0.1294, 0.3112, 0.1659, 0.3309]}, {"w": "means", "b": [0.1722, 0.3112, 0.2366, 0.3309]}, {"w": "the", "b": [0.2429, 0.3112, 0.2738, 0.3309]}, {"w": "geometric", "b": [0.2801, 0.3112, 0.3809, 0.3309]}, {"w": "morphing", "b": [0.3872, 0.3112, 0.4853, 0.3309]}, {"w": "from", "b": [0.4916, 0.3112, 0.5406, 0.3309]}, {"w": "inputs", "b": [0.5469, 0.3112, 0.6086, 0.3309]}, {"w": "to", "b": [0.6149, 0.3112, 0.6346, 0.3309]}, {"w": "outputs", "b": [0.6409, 0.3112, 0.7151, 0.3309]}, {"w": "must", "b": [0.7215, 0.3112, 0.7705, 0.3309]}, {"w": "be", "b": [0.7768, 0.3112, 0.8006, 0.3309]}, {"w": "smooth", "b": [0.1294, 0.3317, 0.2037, 0.3514]}, {"w": "and", "b": [0.21, 0.3317, 0.2464, 0.3514]}, {"w": "continuous—a", "b": [0.2527, 0.3317, 0.3999, 0.3514]}, {"w": "significant", "b": [0.4062, 0.3317, 0.5127, 0.3514]}, {"w": "constraint.", "b": [0.519, 0.3317, 0.6248, 0.3514]}]}, {"id": "b_1", "type": "paragraph", "text": "The entire process of applying this complex geometric transformation to the input data can be visualized in 3D by imagining a person trying to uncrumple a paper ball: the crumpled paper ball is the manifold of the input data that the model starts with. Each movement operated by the person on the paper ball is similar to a simple geometric transformation operated by one layer. The full uncrumpling gesture sequence is the complex transformation of the entire model. Deep-learning models are mathematical machines for uncrumpling complicated manifolds of high- dimensional data.", "words": [{"w": "The", "b": [0.1294, 0.3745, 0.1686, 0.3942]}, {"w": "entire", "b": [0.1749, 0.3745, 0.2324, 0.3942]}, {"w": "process", "b": [0.2387, 0.3745, 0.3143, 0.3942]}, {"w": "of", "b": [0.3206, 0.3745, 0.3417, 0.3942]}, {"w": "applying", "b": [0.348, 0.3745, 0.4363, 0.3942]}, {"w": "this", "b": [0.4426, 0.3745, 0.479, 0.3942]}, {"w": "complex", "b": [0.4853, 0.3745, 0.5722, 0.3942]}, {"w": "geometric", "b": [0.5785, 0.3745, 0.6794, 0.3942]}, {"w": "transformation", "b": [0.6857, 0.3745, 0.8342, 0.3942]}, {"w": "to", "b": [0.8405, 0.3745, 0.8602, 0.3942]}, {"w": "the", "b": [0.1294, 0.395, 0.1602, 0.4147]}, {"w": "input", "b": [0.1665, 0.395, 0.2184, 0.4147]}, {"w": "data", "b": [0.2247, 0.395, 0.2667, 0.4147]}, {"w": "can", "b": [0.273, 0.395, 0.3081, 0.4147]}, {"w": "be", "b": [0.3144, 0.395, 0.3382, 0.4147]}, {"w": "visualized", "b": [0.3445, 0.395, 0.4468, 0.4147]}, {"w": "in", "b": [0.4531, 0.395, 0.4727, 0.4147]}, {"w": "3D", "b": [0.479, 0.395, 0.5098, 0.4147]}, {"w": "by", "b": [0.5161, 0.395, 0.5414, 0.4147]}, {"w": "imagining", "b": [0.5477, 0.395, 0.65, 0.4147]}, {"w": "a", "b": [0.6562, 0.395, 0.6674, 0.4147]}, {"w": "person", "b": [0.6737, 0.395, 0.741, 0.4147]}, {"w": "trying", "b": [0.7473, 0.395, 0.8075, 0.4147]}, {"w": "to", "b": [0.8139, 0.395, 0.8335, 0.4147]}, {"w": "uncrumple", "b": [0.1294, 0.4155, 0.2373, 0.4352]}, {"w": "a", "b": [0.2436, 0.4155, 0.2548, 0.4352]}, {"w": "paper", "b": [0.2611, 0.4155, 0.3171, 0.4352]}, {"w": "ball:", "b": [0.3234, 0.4155, 0.3683, 0.4352]}, {"w": "the", "b": [0.3746, 0.4155, 0.4054, 0.4352]}, {"w": "crumpled", "b": [0.4117, 0.4155, 0.507, 0.4352]}, {"w": "paper", "b": [0.5133, 0.4155, 0.5693, 0.4352]}, {"w": "ball", "b": [0.5757, 0.4155, 0.6135, 0.4352]}, {"w": "is", "b": [0.6198, 0.4155, 0.6366, 0.4352]}, {"w": "the", "b": [0.6429, 0.4155, 0.6738, 0.4352]}, {"w": "manifold", "b": [0.6801, 0.4155, 0.7712, 0.4352]}, {"w": "of", "b": [0.7775, 0.4155, 0.7985, 0.4352]}, {"w": "the", "b": [0.8048, 0.4155, 0.8356, 0.4352]}, {"w": "input", "b": [0.1294, 0.436, 0.1813, 0.4557]}, {"w": "data", "b": [0.1876, 0.436, 0.2296, 0.4557]}, {"w": "that", "b": [0.2359, 0.436, 0.2738, 0.4557]}, {"w": "the", "b": [0.2801, 0.436, 0.3109, 0.4557]}, {"w": "model", "b": [0.3172, 0.436, 0.3803, 0.4557]}, {"w": "starts", "b": [0.3866, 0.436, 0.4398, 0.4557]}, {"w": "with.", "b": [0.4461, 0.436, 0.4972, 0.4557]}, {"w": "Each", "b": [0.5035, 0.436, 0.5539, 0.4557]}, {"w": "movement", "b": [0.5603, 0.436, 0.6668, 0.4557]}, {"w": "operated", "b": [0.6731, 0.436, 0.7599, 0.4557]}, {"w": "by", "b": [0.7662, 0.436, 0.7914, 0.4557]}, {"w": "the", "b": [0.7978, 0.436, 0.8286, 0.4557]}, {"w": "person", "b": [0.1294, 0.4565, 0.1967, 0.4762]}, {"w": "on", "b": [0.203, 0.4565, 0.2282, 0.4762]}, {"w": "the", "b": [0.2345, 0.4565, 0.2653, 0.4762]}, {"w": "paper", "b": [0.2716, 0.4565, 0.3277, 0.4762]}, {"w": "ball", "b": [0.334, 0.4565, 0.3718, 0.4762]}, {"w": "is", "b": [0.3781, 0.4565, 0.3949, 0.4762]}, {"w": "similar", "b": [0.4012, 0.4565, 0.4713, 0.4762]}, {"w": "to", "b": [0.4776, 0.4565, 0.4973, 0.4762]}, {"w": "a", "b": [0.5036, 0.4565, 0.5148, 0.4762]}, {"w": "simple", "b": [0.5211, 0.4565, 0.5883, 0.4762]}, {"w": "geometric", "b": [0.5947, 0.4565, 0.6955, 0.4762]}, {"w": "transformation", "b": [0.7018, 0.4565, 0.8504, 0.4762]}, {"w": "operated", "b": [0.1294, 0.477, 0.2163, 0.4967]}, {"w": "by", "b": [0.2226, 0.477, 0.2478, 0.4967]}, {"w": "one", "b": [0.2541, 0.477, 0.2905, 0.4967]}, {"w": "layer.", "b": [0.2968, 0.477, 0.3521, 0.4967]}, {"w": "The", "b": [0.3584, 0.477, 0.3977, 0.4967]}, {"w": "full", "b": [0.404, 0.477, 0.439, 0.4967]}, {"w": "uncrumpling", "b": [0.4453, 0.477, 0.5743, 0.4967]}, {"w": "gesture", "b": [0.5806, 0.477, 0.6534, 0.4967]}, {"w": "sequence", "b": [0.6597, 0.477, 0.7522, 0.4967]}, {"w": "is", "b": [0.7585, 0.477, 0.7753, 0.4967]}, {"w": "the", "b": [0.7816, 0.477, 0.8124, 0.4967]}, {"w": "complex", "b": [0.1294, 0.4975, 0.2163, 0.5172]}, {"w": "transformation", "b": [0.2226, 0.4975, 0.3711, 0.5172]}, {"w": "of", "b": [0.3774, 0.4975, 0.3984, 0.5172]}, {"w": "the", "b": [0.4048, 0.4975, 0.4356, 0.5172]}, {"w": "entire", "b": [0.4419, 0.4975, 0.4993, 0.5172]}, {"w": "model.", "b": [0.5056, 0.4975, 0.575, 0.5172]}, {"w": "Deep-learning", "b": [0.5813, 0.4975, 0.7256, 0.5172]}, {"w": "models", "b": [0.7319, 0.4975, 0.8048, 0.5172]}, {"w": "are", "b": [0.8111, 0.4975, 0.8419, 0.5172]}, {"w": "mathematical", "b": [0.1294, 0.518, 0.2653, 0.5377]}, {"w": "machines", "b": [0.2716, 0.518, 0.3669, 0.5377]}, {"w": "for", "b": [0.3732, 0.518, 0.4026, 0.5377]}, {"w": "uncrumpling", "b": [0.4089, 0.518, 0.5378, 0.5377]}, {"w": "complicated", "b": [0.5441, 0.518, 0.6674, 0.5377]}, {"w": "manifolds", "b": [0.6737, 0.518, 0.7746, 0.5377]}, {"w": "of", "b": [0.7809, 0.518, 0.802, 0.5377]}, {"w": "high-", "b": [0.8083, 0.518, 0.8615, 0.5377]}, {"w": "dimensional", "b": [0.1294, 0.5385, 0.2527, 0.5582]}, {"w": "data.", "b": [0.259, 0.5385, 0.3074, 0.5582]}]}, {"id": "b_2", "type": "paragraph", "text": "That’s the magic of deep learning: turning meaning into vectors, into geometric spaces, and then incrementally learning complex geometric transformations that map one space to another. All you need are spaces of sufficiently high dimensionality in order to capture the full scope of the relationships found in the original data.", "words": [{"w": "That’s", "b": [0.1294, 0.5812, 0.1925, 0.601]}, {"w": "the", "b": [0.1988, 0.5812, 0.2296, 0.601]}, {"w": "magic", "b": [0.2359, 0.5812, 0.2976, 0.601]}, {"w": "of", "b": [0.3039, 0.5812, 0.3249, 0.601]}, {"w": "deep", "b": [0.3312, 0.5812, 0.3788, 0.601]}, {"w": "learning:", "b": [0.3851, 0.5812, 0.4748, 0.601]}, {"w": "turning", "b": [0.4811, 0.5812, 0.554, 0.601]}, {"w": "meaning", "b": [0.5603, 0.5812, 0.6472, 0.601]}, {"w": "into", "b": [0.6535, 0.5812, 0.6927, 0.601]}, {"w": "vectors,", "b": [0.699, 0.5812, 0.7782, 0.601]}, {"w": "into", "b": [0.7845, 0.5812, 0.8237, 0.601]}, {"w": "geometric", "b": [0.1294, 0.6017, 0.2303, 0.6215]}, {"w": "spaces,", "b": [0.2366, 0.6017, 0.3087, 0.6215]}, {"w": "and", "b": [0.315, 0.6017, 0.3515, 0.6215]}, {"w": "then", "b": [0.3578, 0.6017, 0.4012, 0.6215]}, {"w": "incrementally", "b": [0.4075, 0.6017, 0.5462, 0.6215]}, {"w": "learning", "b": [0.5525, 0.6017, 0.6352, 0.6215]}, {"w": "complex", "b": [0.6415, 0.6017, 0.7284, 0.6215]}, {"w": "geometric", "b": [0.7346, 0.6017, 0.8355, 0.6215]}, {"w": "transformations", "b": [0.1294, 0.6222, 0.2878, 0.642]}, {"w": "that", "b": [0.2941, 0.6222, 0.3319, 0.642]}, {"w": "map", "b": [0.3382, 0.6222, 0.3816, 0.642]}, {"w": "one", "b": [0.388, 0.6222, 0.4244, 0.642]}, {"w": "space", "b": [0.4307, 0.6222, 0.4867, 0.642]}, {"w": "to", "b": [0.493, 0.6222, 0.5126, 0.642]}, {"w": "another.", "b": [0.5189, 0.6222, 0.5995, 0.642]}, {"w": "All", "b": [0.6058, 0.6222, 0.638, 0.642]}, {"w": "you", "b": [0.6443, 0.6222, 0.6821, 0.642]}, {"w": "need", "b": [0.6884, 0.6222, 0.7361, 0.642]}, {"w": "are", "b": [0.7424, 0.6222, 0.7732, 0.642]}, {"w": "spaces", "b": [0.7795, 0.6222, 0.8453, 0.642]}, {"w": "of", "b": [0.1294, 0.6427, 0.1504, 0.6625]}, {"w": "sufficiently", "b": [0.1567, 0.6427, 0.2712, 0.6625]}, {"w": "high", "b": [0.2775, 0.6427, 0.3223, 0.6625]}, {"w": "dimensionality", "b": [0.3286, 0.6427, 0.4786, 0.6625]}, {"w": "in", "b": [0.4849, 0.6427, 0.5045, 0.6625]}, {"w": "order", "b": [0.5109, 0.6427, 0.5641, 0.6625]}, {"w": "to", "b": [0.5703, 0.6427, 0.5899, 0.6625]}, {"w": "capture", "b": [0.5962, 0.6427, 0.6705, 0.6625]}, {"w": "the", "b": [0.6768, 0.6427, 0.7076, 0.6625]}, {"w": "full", "b": [0.7139, 0.6427, 0.749, 0.6625]}, {"w": "scope", "b": [0.7553, 0.6427, 0.8127, 0.6625]}, {"w": "of", "b": [0.819, 0.6427, 0.84, 0.6625]}, {"w": "the", "b": [0.1294, 0.6632, 0.1602, 0.683]}, {"w": "relationships", "b": [0.1665, 0.6632, 0.2955, 0.683]}, {"w": "found", "b": [0.3018, 0.6632, 0.3606, 0.683]}, {"w": "in", "b": [0.3669, 0.6632, 0.3866, 0.683]}, {"w": "the", "b": [0.3929, 0.6632, 0.4237, 0.683]}, {"w": "original", "b": [0.43, 0.6632, 0.5085, 0.683]}, {"w": "data.", "b": [0.5148, 0.6632, 0.5631, 0.683]}]}, {"id": "b_3", "type": "paragraph", "text": "The whole thing hinges on a single core idea: that meaning is derived from the pairwise relationship between things (between words in a language, between pixels in an image, and so on) and that these relationships can be captured by a distance function. But note that whether the brain implements meaning via geometric spaces is an entirely separate question. Vector spaces are efficient to work with from a computational standpoint, but different data structures for intelligence can easily be envisioned—in particular, graphs. Neural networks initially emerged from the idea of using graphs as a way to encode meaning, which is why they’re named neural networks; the surrounding field of", "words": [{"w": "The", "b": [0.1294, 0.706, 0.1686, 0.7258]}, {"w": "whole", "b": [0.1749, 0.706, 0.2366, 0.7258]}, {"w": "thing", "b": [0.2429, 0.706, 0.2948, 0.7258]}, {"w": "hinges", "b": [0.3011, 0.706, 0.3669, 0.7258]}, {"w": "on", "b": [0.3732, 0.706, 0.3985, 0.7258]}, {"w": "a", "b": [0.4048, 0.706, 0.416, 0.7258]}, {"w": "single", "b": [0.4223, 0.706, 0.4825, 0.7258]}, {"w": "core", "b": [0.4889, 0.706, 0.5323, 0.7258]}, {"w": "idea:", "b": [0.5386, 0.706, 0.5876, 0.7258]}, {"w": "that", "b": [0.5938, 0.706, 0.6331, 0.7258]}, {"w": "meaning", "b": [0.6394, 0.706, 0.7263, 0.7258]}, {"w": "is", "b": [0.7326, 0.706, 0.7494, 0.7258]}, {"w": "derived", "b": [0.7557, 0.706, 0.8314, 0.7258]}, {"w": "from", "b": [0.1294, 0.7265, 0.1761, 0.7463]}, {"w": "the", "b": [0.1824, 0.7265, 0.2133, 0.7463]}, {"w": "pairwise", "b": [0.2196, 0.7265, 0.3065, 0.7463]}, {"w": "relationship", "b": [0.3128, 0.7265, 0.4338, 0.7463]}, {"w": "between", "b": [0.4401, 0.7265, 0.5227, 0.7463]}, {"w": "things", "b": [0.5291, 0.7265, 0.5907, 0.7463]}, {"w": "(between", "b": [0.597, 0.7265, 0.6894, 0.7463]}, {"w": "words", "b": [0.6958, 0.7265, 0.7574, 0.7463]}, {"w": "in", "b": [0.7637, 0.7265, 0.7833, 0.7463]}, {"w": "a", "b": [0.7896, 0.7265, 0.8008, 0.7463]}, {"w": "language,", "b": [0.1294, 0.747, 0.2268, 0.7668]}, {"w": "between", "b": [0.2331, 0.747, 0.3171, 0.7668]}, {"w": "pixels", "b": [0.3234, 0.747, 0.3837, 0.7668]}, {"w": "in", "b": [0.39, 0.747, 0.4096, 0.7668]}, {"w": "an", "b": [0.416, 0.747, 0.4398, 0.7668]}, {"w": "image,", "b": [0.4461, 0.747, 0.514, 0.7668]}, {"w": "and", "b": [0.5203, 0.747, 0.5568, 0.7668]}, {"w": "so", "b": [0.5631, 0.747, 0.5855, 0.7668]}, {"w": "on)", "b": [0.5918, 0.747, 0.6254, 0.7668]}, {"w": "and", "b": [0.6317, 0.747, 0.6682, 0.7668]}, {"w": "that", "b": [0.6745, 0.747, 0.7123, 0.7668]}, {"w": "these", "b": [0.7185, 0.747, 0.7704, 0.7668]}, {"w": "relationships", "b": [0.1294, 0.7675, 0.2602, 0.7873]}, {"w": "can", "b": [0.2665, 0.7675, 0.303, 0.7873]}, {"w": "be", "b": [0.3093, 0.7675, 0.3331, 0.7873]}, {"w": "captured", "b": [0.3394, 0.7675, 0.4281, 0.7873]}, {"w": "by", "b": [0.4344, 0.7675, 0.4582, 0.7873]}, {"w": "a", "b": [0.4645, 0.7675, 0.4771, 0.7873]}, {"w": "distance", "b": [0.4835, 0.7675, 0.5675, 0.7873]}, {"w": "function.", "b": [0.5738, 0.7675, 0.6628, 0.7873]}, {"w": "But", "b": [0.6691, 0.7675, 0.7056, 0.7873]}, {"w": "note", "b": [0.7119, 0.7675, 0.7553, 0.7873]}, {"w": "that", "b": [0.7616, 0.7675, 0.7994, 0.7873]}, {"w": "whether", "b": [0.1294, 0.788, 0.2107, 0.8078]}, {"w": "the", "b": [0.217, 0.788, 0.2478, 0.8078]}, {"w": "brain", "b": [0.2541, 0.788, 0.3059, 0.8078]}, {"w": "implements", "b": [0.3122, 0.788, 0.43, 0.8078]}, {"w": "meaning", "b": [0.4363, 0.788, 0.5232, 0.8078]}, {"w": "via", "b": [0.5295, 0.788, 0.5603, 0.8078]}, {"w": "geometric", "b": [0.5666, 0.788, 0.6675, 0.8078]}, {"w": "spaces", "b": [0.6738, 0.788, 0.7396, 0.8078]}, {"w": "is", "b": [0.7459, 0.788, 0.7628, 0.8078]}, {"w": "an", "b": [0.7691, 0.788, 0.7929, 0.8078]}, {"w": "entirely", "b": [0.1294, 0.8085, 0.2065, 0.8283]}, {"w": "separate", "b": [0.2128, 0.8085, 0.2954, 0.8283]}, {"w": "question.", "b": [0.3017, 0.8085, 0.3935, 0.8283]}, {"w": "Vector", "b": [0.3998, 0.8085, 0.4656, 0.8283]}, {"w": "spaces", "b": [0.4719, 0.8085, 0.5378, 0.8283]}, {"w": "are", "b": [0.5441, 0.8085, 0.5749, 0.8283]}, {"w": "efficient", "b": [0.5812, 0.8085, 0.6648, 0.8283]}, {"w": "to", "b": [0.6711, 0.8085, 0.6907, 0.8283]}, {"w": "work", "b": [0.697, 0.8085, 0.7488, 0.8283]}, {"w": "with", "b": [0.7551, 0.8085, 0.8, 0.8283]}, {"w": "from", "b": [0.8063, 0.8085, 0.8553, 0.8283]}, {"w": "a", "b": [0.1294, 0.829, 0.1406, 0.8488]}, {"w": "computational", "b": [0.1469, 0.829, 0.2913, 0.8488]}, {"w": "standpoint,", "b": [0.2976, 0.829, 0.409, 0.8488]}, {"w": "but", "b": [0.4153, 0.829, 0.4475, 0.8488]}, {"w": "different", "b": [0.4538, 0.829, 0.5402, 0.8488]}, {"w": "data", "b": [0.5465, 0.829, 0.5885, 0.8488]}, {"w": "structures", "b": [0.5948, 0.829, 0.6929, 0.8488]}, {"w": "for", "b": [0.6992, 0.829, 0.7286, 0.8488]}, {"w": "intelligence", "b": [0.7349, 0.829, 0.8526, 0.8488]}, {"w": "can", "b": [0.1294, 0.8495, 0.1644, 0.8693]}, {"w": "easily", "b": [0.1707, 0.8495, 0.2296, 0.8693]}, {"w": "be", "b": [0.2359, 0.8495, 0.2597, 0.8693]}, {"w": "envisioned—in", "b": [0.266, 0.8495, 0.4202, 0.8693]}, {"w": "particular,", "b": [0.4264, 0.8495, 0.5284, 0.8693]}, {"w": "graphs.", "b": [0.5347, 0.8495, 0.6082, 0.8693]}, {"w": "Neural", "b": [0.6145, 0.8495, 0.6832, 0.8693]}, {"w": "networks", "b": [0.6895, 0.8495, 0.782, 0.8693]}, {"w": "initially", "b": [0.7883, 0.8495, 0.8668, 0.8693]}, {"w": "emerged", "b": [0.1294, 0.87, 0.2158, 0.8898]}, {"w": "from", "b": [0.2221, 0.87, 0.2711, 0.8898]}, {"w": "the", "b": [0.2774, 0.87, 0.3083, 0.8898]}, {"w": "idea", "b": [0.3146, 0.87, 0.3566, 0.8898]}, {"w": "of", "b": [0.3629, 0.87, 0.3839, 0.8898]}, {"w": "using", "b": [0.3902, 0.87, 0.4449, 0.8898]}, {"w": "graphs", "b": [0.4512, 0.87, 0.5185, 0.8898]}, {"w": "as", "b": [0.5248, 0.87, 0.5458, 0.8898]}, {"w": "a", "b": [0.5521, 0.87, 0.5633, 0.8898]}, {"w": "way", "b": [0.5696, 0.87, 0.6116, 0.8898]}, {"w": "to", "b": [0.6179, 0.87, 0.6375, 0.8898]}, {"w": "encode", "b": [0.6439, 0.87, 0.7153, 0.8898]}, {"w": "meaning,", "b": [0.7216, 0.87, 0.8148, 0.8898]}, {"w": "which", "b": [0.1294, 0.8905, 0.1911, 0.9103]}, {"w": "is", "b": [0.1974, 0.8905, 0.2142, 0.9103]}, {"w": "why", "b": [0.2205, 0.8905, 0.2639, 0.9103]}, {"w": "they’re", "b": [0.2702, 0.8905, 0.3417, 0.9103]}, {"w": "named", "b": [0.348, 0.8905, 0.4152, 0.9103]}, {"w": "neural", "b": [0.4215, 0.8905, 0.4874, 0.9103]}, {"w": "networks;", "b": [0.4937, 0.8905, 0.5918, 0.9103]}, {"w": "the", "b": [0.5981, 0.8905, 0.6289, 0.9103]}, {"w": "surrounding", "b": [0.6352, 0.8905, 0.7571, 0.9103]}, {"w": "field", "b": [0.7634, 0.8905, 0.8097, 0.9103]}, {"w": "of", "b": [0.816, 0.8905, 0.837, 0.9103]}]}]}, {"page": 415, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "research used to be called connectionism. Nowadays the name neural network exists purely for historical reasons—it’s an extremely misleading name because they’re neither neural nor networks. In particular, neural networks have hardly anything to do with the brain. A more appropriate name would have been layered representations learning or hierarchical representations learning, or maybe even deep differentiable models or chained geometric transforms, to emphasize the fact that continuous geometric space manipulation is at their core.", "words": [{"w": "research", "b": [0.1294, 0.0857, 0.2134, 0.1054]}, {"w": "used", "b": [0.2197, 0.0857, 0.266, 0.1054]}, {"w": "to", "b": [0.2723, 0.0857, 0.2919, 0.1054]}, {"w": "be", "b": [0.2982, 0.0857, 0.322, 0.1054]}, {"w": "called", "b": [0.3283, 0.0857, 0.3886, 0.1054]}, {"w": "connectionism.", "b": [0.3948, 0.0857, 0.5468, 0.1054]}, {"w": "Nowadays", "b": [0.5531, 0.0857, 0.6596, 0.1054]}, {"w": "the", "b": [0.6659, 0.0857, 0.6968, 0.1054]}, {"w": "name", "b": [0.7031, 0.0857, 0.7577, 0.1054]}, {"w": "neural", "b": [0.764, 0.0857, 0.8298, 0.1054]}, {"w": "network", "b": [0.1294, 0.1062, 0.2107, 0.1259]}, {"w": "exists", "b": [0.217, 0.1062, 0.2744, 0.1259]}, {"w": "purely", "b": [0.2807, 0.1062, 0.3452, 0.1259]}, {"w": "for", "b": [0.3515, 0.1062, 0.3809, 0.1259]}, {"w": "historical", "b": [0.3872, 0.1062, 0.4811, 0.1259]}, {"w": "reasons—it’s", "b": [0.4874, 0.1062, 0.6191, 0.1259]}, {"w": "an", "b": [0.6254, 0.1062, 0.6492, 0.1259]}, {"w": "extremely", "b": [0.6555, 0.1062, 0.7564, 0.1259]}, {"w": "misleading", "b": [0.1294, 0.1267, 0.2401, 0.1464]}, {"w": "name", "b": [0.2464, 0.1267, 0.3011, 0.1464]}, {"w": "because", "b": [0.3074, 0.1267, 0.3872, 0.1464]}, {"w": "they’re", "b": [0.3935, 0.1267, 0.465, 0.1464]}, {"w": "neither", "b": [0.4713, 0.1267, 0.5413, 0.1464]}, {"w": "neural", "b": [0.5476, 0.1267, 0.6107, 0.1464]}, {"w": "nor", "b": [0.617, 0.1267, 0.6506, 0.1464]}, {"w": "networks.", "b": [0.6569, 0.1267, 0.7557, 0.1464]}, {"w": "In", "b": [0.762, 0.1267, 0.783, 0.1464]}, {"w": "particular,", "b": [0.1294, 0.1472, 0.2313, 0.1669]}, {"w": "neural", "b": [0.2376, 0.1472, 0.3007, 0.1669]}, {"w": "networks", "b": [0.307, 0.1472, 0.3995, 0.1669]}, {"w": "have", "b": [0.4058, 0.1472, 0.4534, 0.1669]}, {"w": "hardly", "b": [0.4597, 0.1472, 0.5242, 0.1669]}, {"w": "anything", "b": [0.5305, 0.1472, 0.6188, 0.1669]}, {"w": "to", "b": [0.6251, 0.1472, 0.6447, 0.1669]}, {"w": "do", "b": [0.651, 0.1472, 0.6762, 0.1669]}, {"w": "with", "b": [0.6825, 0.1472, 0.7274, 0.1669]}, {"w": "the", "b": [0.7337, 0.1472, 0.7645, 0.1669]}, {"w": "brain.", "b": [0.7708, 0.1472, 0.829, 0.1669]}, {"w": "A", "b": [0.8353, 0.1472, 0.8535, 0.1669]}, {"w": "more", "b": [0.1294, 0.1677, 0.1813, 0.1874]}, {"w": "appropriate", "b": [0.1876, 0.1677, 0.3024, 0.1874]}, {"w": "name", "b": [0.3087, 0.1677, 0.3634, 0.1874]}, {"w": "would", "b": [0.3697, 0.1677, 0.4328, 0.1874]}, {"w": "have", "b": [0.4391, 0.1677, 0.4867, 0.1874]}, {"w": "been", "b": [0.493, 0.1677, 0.5406, 0.1874]}, {"w": "layered", "b": [0.5469, 0.1677, 0.6216, 0.1874]}, {"w": "representations", "b": [0.6279, 0.1677, 0.783, 0.1874]}, {"w": "learning", "b": [0.1294, 0.1882, 0.2149, 0.2079]}, {"w": "or", "b": [0.2212, 0.1882, 0.2422, 0.2079]}, {"w": "hierarchical", "b": [0.2485, 0.1882, 0.3723, 0.2079]}, {"w": "representations", "b": [0.3786, 0.1882, 0.5337, 0.2079]}, {"w": "learning,", "b": [0.54, 0.1882, 0.6317, 0.2079]}, {"w": "or", "b": [0.638, 0.1882, 0.6591, 0.2079]}, {"w": "maybe", "b": [0.6654, 0.1882, 0.7326, 0.2079]}, {"w": "even", "b": [0.7389, 0.1882, 0.7866, 0.2079]}, {"w": "deep", "b": [0.7928, 0.1882, 0.8405, 0.2079]}, {"w": "differentiable", "b": [0.1294, 0.2087, 0.2644, 0.2284]}, {"w": "models", "b": [0.2707, 0.2087, 0.3422, 0.2284]}, {"w": "or", "b": [0.3485, 0.2087, 0.3695, 0.2284]}, {"w": "chained", "b": [0.3758, 0.2087, 0.4556, 0.2284]}, {"w": "geometric", "b": [0.4619, 0.2087, 0.5628, 0.2284]}, {"w": "transforms,", "b": [0.5691, 0.2087, 0.6848, 0.2284]}, {"w": "to", "b": [0.6911, 0.2087, 0.7107, 0.2284]}, {"w": "emphasize", "b": [0.717, 0.2087, 0.8235, 0.2284]}, {"w": "the", "b": [0.8298, 0.2087, 0.8606, 0.2284]}, {"w": "fact", "b": [0.1294, 0.2292, 0.1672, 0.2489]}, {"w": "that", "b": [0.1735, 0.2292, 0.2114, 0.2489]}, {"w": "continuous", "b": [0.2177, 0.2292, 0.3284, 0.2489]}, {"w": "geometric", "b": [0.3347, 0.2292, 0.4356, 0.2489]}, {"w": "space", "b": [0.4419, 0.2292, 0.4979, 0.2489]}, {"w": "manipulation", "b": [0.5042, 0.2292, 0.6374, 0.2489]}, {"w": "is", "b": [0.6437, 0.2292, 0.6605, 0.2489]}, {"w": "at", "b": [0.6668, 0.2292, 0.685, 0.2489]}, {"w": "their", "b": [0.6913, 0.2292, 0.7376, 0.2489]}, {"w": "core.", "b": [0.7439, 0.2292, 0.7936, 0.2489]}]}, {"id": "b_1", "type": "paragraph", "text": "9.1.4. Key enabling technologies", "words": [{"w": "9.1.4.", "b": [0.1294, 0.2764, 0.1862, 0.2962]}, {"w": "Key", "b": [0.1925, 0.2764, 0.2359, 0.2962]}, {"w": "enabling", "b": [0.2422, 0.2764, 0.3347, 0.2962]}, {"w": "technologies", "b": [0.3411, 0.2764, 0.4728, 0.2962]}]}, {"id": "b_2", "type": "paragraph", "text": "The technological revolution that’s currently unfolding didn’t start with any single breakthrough invention. Rather, like any other revolution, it’s the product of a vast accumulation of enabling factors—slowly at first, and then suddenly. In the case of deep learning, we can point out the following key factors:", "words": [{"w": "The", "b": [0.1294, 0.3192, 0.1686, 0.3389]}, {"w": "technological", "b": [0.1749, 0.3192, 0.3109, 0.3389]}, {"w": "revolution", "b": [0.3172, 0.3192, 0.4209, 0.3389]}, {"w": "that’s", "b": [0.4272, 0.3192, 0.4818, 0.3389]}, {"w": "currently", "b": [0.4881, 0.3192, 0.5791, 0.3389]}, {"w": "unfolding", "b": [0.5854, 0.3192, 0.6835, 0.3389]}, {"w": "didn’t", "b": [0.6899, 0.3192, 0.7496, 0.3389]}, {"w": "start", "b": [0.7559, 0.3192, 0.7994, 0.3389]}, {"w": "with", "b": [0.8057, 0.3192, 0.8505, 0.3389]}, {"w": "any", "b": [0.1294, 0.3397, 0.1658, 0.3594]}, {"w": "single", "b": [0.1721, 0.3397, 0.2324, 0.3594]}, {"w": "breakthrough", "b": [0.2387, 0.3397, 0.3732, 0.3594]}, {"w": "invention.", "b": [0.3795, 0.3397, 0.4811, 0.3594]}, {"w": "Rather,", "b": [0.4874, 0.3397, 0.5599, 0.3594]}, {"w": "like", "b": [0.5662, 0.3397, 0.6041, 0.3594]}, {"w": "any", "b": [0.6104, 0.3397, 0.6468, 0.3594]}, {"w": "other", "b": [0.6531, 0.3397, 0.7049, 0.3594]}, {"w": "revolution,", "b": [0.7113, 0.3397, 0.8213, 0.3594]}, {"w": "it’s", "b": [0.8276, 0.3397, 0.8584, 0.3594]}, {"w": "the", "b": [0.1294, 0.3602, 0.1602, 0.3799]}, {"w": "product", "b": [0.1665, 0.3602, 0.2436, 0.3799]}, {"w": "of", "b": [0.2499, 0.3602, 0.2709, 0.3799]}, {"w": "a", "b": [0.2772, 0.3602, 0.2884, 0.3799]}, {"w": "vast", "b": [0.2947, 0.3602, 0.3354, 0.3799]}, {"w": "accumulation", "b": [0.3417, 0.3602, 0.4776, 0.3799]}, {"w": "of", "b": [0.4839, 0.3602, 0.5049, 0.3799]}, {"w": "enabling", "b": [0.5112, 0.3602, 0.5981, 0.3799]}, {"w": "factors—slowly", "b": [0.6044, 0.3602, 0.7656, 0.3799]}, {"w": "at", "b": [0.7719, 0.3602, 0.7901, 0.3799]}, {"w": "first,", "b": [0.7964, 0.3602, 0.8433, 0.3799]}, {"w": "and", "b": [0.1294, 0.3807, 0.1658, 0.4004]}, {"w": "then", "b": [0.1721, 0.3807, 0.2156, 0.4004]}, {"w": "suddenly.", "b": [0.2219, 0.3807, 0.3176, 0.4004]}, {"w": "In", "b": [0.3239, 0.3807, 0.345, 0.4004]}, {"w": "the", "b": [0.3513, 0.3807, 0.3821, 0.4004]}, {"w": "case", "b": [0.3884, 0.3807, 0.4318, 0.4004]}, {"w": "of", "b": [0.4381, 0.3807, 0.4591, 0.4004]}, {"w": "deep", "b": [0.4654, 0.3807, 0.513, 0.4004]}, {"w": "learning,", "b": [0.5193, 0.3807, 0.6083, 0.4004]}, {"w": "we", "b": [0.6146, 0.3807, 0.644, 0.4004]}, {"w": "can", "b": [0.6503, 0.3807, 0.6854, 0.4004]}, {"w": "point", "b": [0.6917, 0.3807, 0.7435, 0.4004]}, {"w": "out", "b": [0.7498, 0.3807, 0.7821, 0.4004]}, {"w": "the", "b": [0.7884, 0.3807, 0.8192, 0.4004]}, {"w": "following", "b": [0.1294, 0.4012, 0.2275, 0.4209]}, {"w": "key", "b": [0.2338, 0.4012, 0.2702, 0.4209]}, {"w": "factors:", "b": [0.2766, 0.4012, 0.3522, 0.4209]}]}, {"id": "b_3", "type": "paragraph", "text": "Incremental algorithmic innovations, first spread over two decades (starting with backpropagation) and then happening increasingly faster as more research effort was poured into deep learning after 2012. The availability of large amounts of perceptual data, which is a requirement in order to realize that sufficiently large models trained on sufficiently large data are all we need. This is in turn a byproduct of the rise of the consumer internet and Moore’s law applied to storage media. The availability of fast, highly parallel computation hardware at a low price, especially the GPUs produced by NVIDIA—first gaming GPUs and then chips designed from the ground up for deep learning. Early on, NVIDIA CEO Jensen Huang took note of the deep-learning boom and decided to bet the company’s future on it. A complex stack of software layers that makes this computational power available to humans: the CUDA language, frameworks like TensorFlow that do automatic differentiation, and Keras, which makes deep learning accessible to most people.", "words": [{"w": "Incremental", "b": [0.1799, 0.4395, 0.3003, 0.4593]}, {"w": "algorithmic", "b": [0.3066, 0.4395, 0.423, 0.4593]}, {"w": "innovations,", "b": [0.4293, 0.4395, 0.5533, 0.4593]}, {"w": "first", "b": [0.5596, 0.4395, 0.6003, 0.4593]}, {"w": "spread", "b": [0.6066, 0.4395, 0.6724, 0.4593]}, {"w": "over", "b": [0.6787, 0.4395, 0.7235, 0.4593]}, {"w": "two", "b": [0.7298, 0.4395, 0.7677, 0.4593]}, {"w": "decades", "b": [0.774, 0.4395, 0.8538, 0.4593]}, {"w": "(starting", "b": [0.1799, 0.46, 0.2639, 0.4798]}, {"w": "with", "b": [0.2702, 0.46, 0.3151, 0.4798]}, {"w": "backpropagation)", "b": [0.3214, 0.46, 0.4979, 0.4798]}, {"w": "and", "b": [0.5042, 0.46, 0.5407, 0.4798]}, {"w": "then", "b": [0.547, 0.46, 0.5904, 0.4798]}, {"w": "happening", "b": [0.5967, 0.46, 0.7018, 0.4798]}, {"w": "increasingly", "b": [0.7081, 0.46, 0.8314, 0.4798]}, {"w": "faster", "b": [0.1799, 0.4805, 0.2359, 0.5003]}, {"w": "as", "b": [0.2422, 0.4805, 0.2632, 0.5003]}, {"w": "more", "b": [0.2695, 0.4805, 0.3214, 0.5003]}, {"w": "research", "b": [0.3277, 0.4805, 0.4117, 0.5003]}, {"w": "effort", "b": [0.418, 0.4805, 0.4735, 0.5003]}, {"w": "was", "b": [0.4798, 0.4805, 0.5191, 0.5003]}, {"w": "poured", "b": [0.5254, 0.4805, 0.5954, 0.5003]}, {"w": "into", "b": [0.6017, 0.4805, 0.641, 0.5003]}, {"w": "deep", "b": [0.6473, 0.4805, 0.6949, 0.5003]}, {"w": "learning", "b": [0.7012, 0.4805, 0.7839, 0.5003]}, {"w": "after", "b": [0.7902, 0.4805, 0.8364, 0.5003]}, {"w": "2012.", "b": [0.1799, 0.501, 0.2366, 0.5208]}, {"w": "The", "b": [0.1799, 0.5215, 0.2191, 0.5413]}, {"w": "availability", "b": [0.2254, 0.5215, 0.3389, 0.5413]}, {"w": "of", "b": [0.3452, 0.5215, 0.3662, 0.5413]}, {"w": "large", "b": [0.3725, 0.5215, 0.4225, 0.5413]}, {"w": "amounts", "b": [0.4288, 0.5215, 0.5143, 0.5413]}, {"w": "of", "b": [0.5206, 0.5215, 0.5416, 0.5413]}, {"w": "perceptual", "b": [0.5479, 0.5215, 0.6529, 0.5413]}, {"w": "data,", "b": [0.6593, 0.5215, 0.7076, 0.5413]}, {"w": "which", "b": [0.7139, 0.5215, 0.7755, 0.5413]}, {"w": "is", "b": [0.7818, 0.5215, 0.7987, 0.5413]}, {"w": "a", "b": [0.805, 0.5215, 0.8162, 0.5413]}, {"w": "requirement", "b": [0.1799, 0.542, 0.3018, 0.5618]}, {"w": "in", "b": [0.3081, 0.542, 0.3277, 0.5618]}, {"w": "order", "b": [0.334, 0.542, 0.3872, 0.5618]}, {"w": "to", "b": [0.3935, 0.542, 0.4132, 0.5618]}, {"w": "realize", "b": [0.4195, 0.542, 0.4867, 0.5618]}, {"w": "that", "b": [0.493, 0.542, 0.5308, 0.5618]}, {"w": "sufficiently", "b": [0.5371, 0.542, 0.6515, 0.5618]}, {"w": "large", "b": [0.6578, 0.542, 0.7078, 0.5618]}, {"w": "models", "b": [0.7141, 0.542, 0.7869, 0.5618]}, {"w": "trained", "b": [0.7932, 0.542, 0.8633, 0.5618]}, {"w": "on", "b": [0.1799, 0.5625, 0.2051, 0.5823]}, {"w": "sufficiently", "b": [0.2114, 0.5625, 0.3258, 0.5823]}, {"w": "large", "b": [0.3322, 0.5625, 0.3821, 0.5823]}, {"w": "data", "b": [0.3884, 0.5625, 0.4304, 0.5823]}, {"w": "are", "b": [0.4367, 0.5625, 0.4675, 0.5823]}, {"w": "all", "b": [0.4738, 0.5625, 0.4991, 0.5823]}, {"w": "we", "b": [0.5054, 0.5625, 0.5348, 0.5823]}, {"w": "need.", "b": [0.5411, 0.5625, 0.595, 0.5823]}, {"w": "This", "b": [0.6013, 0.5625, 0.6462, 0.5823]}, {"w": "is", "b": [0.6525, 0.5625, 0.6693, 0.5823]}, {"w": "in", "b": [0.6756, 0.5625, 0.6952, 0.5823]}, {"w": "turn", "b": [0.7016, 0.5625, 0.7422, 0.5823]}, {"w": "a", "b": [0.7485, 0.5625, 0.7597, 0.5823]}, {"w": "byproduct", "b": [0.766, 0.5625, 0.8683, 0.5823]}, {"w": "of", "b": [0.1799, 0.583, 0.2009, 0.6028]}, {"w": "the", "b": [0.2072, 0.583, 0.238, 0.6028]}, {"w": "rise", "b": [0.2443, 0.583, 0.2807, 0.6028]}, {"w": "of", "b": [0.287, 0.583, 0.3081, 0.6028]}, {"w": "the", "b": [0.3144, 0.583, 0.3452, 0.6028]}, {"w": "consumer", "b": [0.3515, 0.583, 0.4496, 0.6028]}, {"w": "internet", "b": [0.4559, 0.583, 0.5329, 0.6028]}, {"w": "and", "b": [0.5393, 0.583, 0.5757, 0.6028]}, {"w": "Moore’s", "b": [0.582, 0.583, 0.666, 0.6028]}, {"w": "law", "b": [0.6723, 0.583, 0.7087, 0.6028]}, {"w": "applied", "b": [0.7151, 0.583, 0.7893, 0.6028]}, {"w": "to", "b": [0.7956, 0.583, 0.8152, 0.6028]}, {"w": "storage", "b": [0.1799, 0.6035, 0.2527, 0.6233]}, {"w": "media.", "b": [0.259, 0.6035, 0.327, 0.6233]}, {"w": "The", "b": [0.1799, 0.624, 0.2191, 0.6438]}, {"w": "availability", "b": [0.2254, 0.624, 0.3389, 0.6438]}, {"w": "of", "b": [0.3452, 0.624, 0.3662, 0.6438]}, {"w": "fast,", "b": [0.3725, 0.624, 0.4153, 0.6438]}, {"w": "highly", "b": [0.4216, 0.624, 0.4861, 0.6438]}, {"w": "parallel", "b": [0.4924, 0.624, 0.568, 0.6438]}, {"w": "computation", "b": [0.5743, 0.624, 0.7004, 0.6438]}, {"w": "hardware", "b": [0.7068, 0.624, 0.8006, 0.6438]}, {"w": "at", "b": [0.8069, 0.624, 0.8251, 0.6438]}, {"w": "a", "b": [0.8314, 0.624, 0.8426, 0.6438]}, {"w": "low", "b": [0.1799, 0.6445, 0.2177, 0.6643]}, {"w": "price,", "b": [0.224, 0.6445, 0.2807, 0.6643]}, {"w": "especially", "b": [0.287, 0.6445, 0.3879, 0.6643]}, {"w": "the", "b": [0.3942, 0.6445, 0.4251, 0.6643]}, {"w": "GPUs", "b": [0.4314, 0.6445, 0.4916, 0.6643]}, {"w": "produced", "b": [0.4979, 0.6445, 0.5918, 0.6643]}, {"w": "by", "b": [0.5981, 0.6445, 0.6233, 0.6643]}, {"w": "NVIDIA—first", "b": [0.6296, 0.6445, 0.7852, 0.6643]}, {"w": "gaming", "b": [0.7914, 0.6445, 0.8671, 0.6643]}, {"w": "GPUs", "b": [0.1799, 0.665, 0.2401, 0.6848]}, {"w": "and", "b": [0.2464, 0.665, 0.2829, 0.6848]}, {"w": "then", "b": [0.2892, 0.665, 0.3326, 0.6848]}, {"w": "chips", "b": [0.3389, 0.665, 0.3922, 0.6848]}, {"w": "designed", "b": [0.3985, 0.665, 0.4881, 0.6848]}, {"w": "from", "b": [0.4945, 0.665, 0.5435, 0.6848]}, {"w": "the", "b": [0.5498, 0.665, 0.5806, 0.6848]}, {"w": "ground", "b": [0.5869, 0.665, 0.6584, 0.6848]}, {"w": "up", "b": [0.6647, 0.665, 0.6899, 0.6848]}, {"w": "for", "b": [0.6962, 0.665, 0.7256, 0.6848]}, {"w": "deep", "b": [0.732, 0.665, 0.7796, 0.6848]}, {"w": "learning.", "b": [0.1799, 0.6855, 0.2688, 0.7053]}, {"w": "Early", "b": [0.2751, 0.6855, 0.3298, 0.7053]}, {"w": "on,", "b": [0.3361, 0.6855, 0.3676, 0.7053]}, {"w": "NVIDIA", "b": [0.3739, 0.6855, 0.4636, 0.7053]}, {"w": "CEO", "b": [0.4699, 0.6855, 0.5203, 0.7053]}, {"w": "Jensen", "b": [0.5266, 0.6855, 0.5939, 0.7053]}, {"w": "Huang", "b": [0.6002, 0.6855, 0.6675, 0.7053]}, {"w": "took", "b": [0.6738, 0.6855, 0.7186, 0.7053]}, {"w": "note", "b": [0.7249, 0.6855, 0.7684, 0.7053]}, {"w": "of", "b": [0.7747, 0.6855, 0.7957, 0.7053]}, {"w": "the", "b": [0.802, 0.6855, 0.8328, 0.7053]}, {"w": "deep-learning", "b": [0.1799, 0.706, 0.3186, 0.7258]}, {"w": "boom", "b": [0.3249, 0.706, 0.3823, 0.7258]}, {"w": "and", "b": [0.3886, 0.706, 0.4251, 0.7258]}, {"w": "decided", "b": [0.4314, 0.706, 0.5098, 0.7258]}, {"w": "to", "b": [0.5161, 0.706, 0.5357, 0.7258]}, {"w": "bet", "b": [0.5421, 0.706, 0.5729, 0.7258]}, {"w": "the", "b": [0.5792, 0.706, 0.61, 0.7258]}, {"w": "company’s", "b": [0.6163, 0.706, 0.7255, 0.7258]}, {"w": "future", "b": [0.7318, 0.706, 0.7921, 0.7258]}, {"w": "on", "b": [0.7984, 0.706, 0.8236, 0.7258]}, {"w": "it.", "b": [0.8299, 0.706, 0.8503, 0.7258]}, {"w": "A", "b": [0.1799, 0.7265, 0.1981, 0.7463]}, {"w": "complex", "b": [0.2044, 0.7265, 0.2913, 0.7463]}, {"w": "stack", "b": [0.2976, 0.7265, 0.3494, 0.7463]}, {"w": "of", "b": [0.3557, 0.7265, 0.3767, 0.7463]}, {"w": "software", "b": [0.383, 0.7265, 0.4699, 0.7463]}, {"w": "layers", "b": [0.4762, 0.7265, 0.5364, 0.7463]}, {"w": "that", "b": [0.5427, 0.7265, 0.5806, 0.7463]}, {"w": "makes", "b": [0.5869, 0.7265, 0.6513, 0.7463]}, {"w": "this", "b": [0.6576, 0.7265, 0.6941, 0.7463]}, {"w": "computational", "b": [0.7004, 0.7265, 0.8447, 0.7463]}, {"w": "power", "b": [0.1799, 0.747, 0.2429, 0.7668]}, {"w": "available", "b": [0.2492, 0.747, 0.3403, 0.7668]}, {"w": "to", "b": [0.3466, 0.747, 0.3662, 0.7668]}, {"w": "humans:", "b": [0.3725, 0.747, 0.458, 0.7668]}, {"w": "the", "b": [0.4643, 0.747, 0.4951, 0.7668]}, {"w": "CUDA", "b": [0.5014, 0.747, 0.5729, 0.7668]}, {"w": "language,", "b": [0.5792, 0.747, 0.6766, 0.7668]}, {"w": "frameworks", "b": [0.6829, 0.747, 0.8034, 0.7668]}, {"w": "like", "b": [0.8096, 0.747, 0.8475, 0.7668]}, {"w": "TensorFlow", "b": [0.1799, 0.7675, 0.3, 0.7873]}, {"w": "that", "b": [0.3063, 0.7675, 0.3442, 0.7873]}, {"w": "do", "b": [0.3505, 0.7675, 0.3757, 0.7873]}, {"w": "automatic", "b": [0.382, 0.7675, 0.4815, 0.7873]}, {"w": "differentiation,", "b": [0.4878, 0.7675, 0.6379, 0.7873]}, {"w": "and", "b": [0.6442, 0.7675, 0.6807, 0.7873]}, {"w": "Keras,", "b": [0.687, 0.7675, 0.7521, 0.7873]}, {"w": "which", "b": [0.7584, 0.7675, 0.8201, 0.7873]}, {"w": "makes", "b": [0.1799, 0.788, 0.2443, 0.8078]}, {"w": "deep", "b": [0.2506, 0.788, 0.2982, 0.8078]}, {"w": "learning", "b": [0.3046, 0.788, 0.3872, 0.8078]}, {"w": "accessible", "b": [0.3935, 0.788, 0.4958, 0.8078]}, {"w": "to", "b": [0.5021, 0.788, 0.5217, 0.8078]}, {"w": "most", "b": [0.528, 0.788, 0.5771, 0.8078]}, {"w": "people.", "b": [0.5834, 0.788, 0.657, 0.8078]}]}, {"id": "b_4", "type": "paragraph", "text": "In the future, deep learning will not only be used by specialists— researchers, graduate students, and engineers with an academic profile— but will also be a tool in the toolbox of every developer, much like web technology today. Everyone needs to build intelligent apps: just as every", "words": [{"w": "In", "b": [0.1294, 0.8308, 0.1504, 0.8506]}, {"w": "the", "b": [0.1567, 0.8308, 0.1876, 0.8506]}, {"w": "future,", "b": [0.1939, 0.8308, 0.2604, 0.8506]}, {"w": "deep", "b": [0.2667, 0.8308, 0.3143, 0.8506]}, {"w": "learning", "b": [0.3206, 0.8308, 0.4033, 0.8506]}, {"w": "will", "b": [0.4096, 0.8308, 0.4489, 0.8506]}, {"w": "not", "b": [0.4552, 0.8308, 0.4874, 0.8506]}, {"w": "only", "b": [0.4937, 0.8308, 0.5386, 0.8506]}, {"w": "be", "b": [0.5449, 0.8308, 0.5687, 0.8506]}, {"w": "used", "b": [0.575, 0.8308, 0.6212, 0.8506]}, {"w": "by", "b": [0.6275, 0.8308, 0.6528, 0.8506]}, {"w": "specialists—", "b": [0.6591, 0.8308, 0.788, 0.8506]}, {"w": "researchers,", "b": [0.1294, 0.8513, 0.2492, 0.8711]}, {"w": "graduate", "b": [0.2555, 0.8513, 0.3423, 0.8711]}, {"w": "students,", "b": [0.3486, 0.8513, 0.4376, 0.8711]}, {"w": "and", "b": [0.4439, 0.8513, 0.4804, 0.8711]}, {"w": "engineers", "b": [0.4867, 0.8513, 0.5833, 0.8711]}, {"w": "with", "b": [0.5896, 0.8513, 0.6345, 0.8711]}, {"w": "an", "b": [0.6408, 0.8513, 0.6646, 0.8711]}, {"w": "academic", "b": [0.6709, 0.8513, 0.7662, 0.8711]}, {"w": "profile—", "b": [0.7724, 0.8513, 0.8649, 0.8711]}, {"w": "but", "b": [0.1294, 0.8718, 0.1617, 0.8916]}, {"w": "will", "b": [0.168, 0.8718, 0.2072, 0.8916]}, {"w": "also", "b": [0.2135, 0.8718, 0.2542, 0.8916]}, {"w": "be", "b": [0.2605, 0.8718, 0.2843, 0.8916]}, {"w": "a", "b": [0.2906, 0.8718, 0.3018, 0.8916]}, {"w": "tool", "b": [0.3081, 0.8718, 0.3473, 0.8916]}, {"w": "in", "b": [0.3536, 0.8718, 0.3733, 0.8916]}, {"w": "the", "b": [0.3796, 0.8718, 0.4104, 0.8916]}, {"w": "toolbox", "b": [0.4167, 0.8718, 0.4938, 0.8916]}, {"w": "of", "b": [0.5001, 0.8718, 0.5211, 0.8916]}, {"w": "every", "b": [0.5274, 0.8718, 0.5835, 0.8916]}, {"w": "developer,", "b": [0.5898, 0.8718, 0.6944, 0.8916]}, {"w": "much", "b": [0.7007, 0.8718, 0.7568, 0.8916]}, {"w": "like", "b": [0.7631, 0.8718, 0.8009, 0.8916]}, {"w": "web", "b": [0.8073, 0.8718, 0.8493, 0.8916]}, {"w": "technology", "b": [0.1294, 0.8923, 0.2415, 0.9121]}, {"w": "today.", "b": [0.2478, 0.8923, 0.3085, 0.9121]}, {"w": "Everyone", "b": [0.3148, 0.8923, 0.4115, 0.9121]}, {"w": "needs", "b": [0.4178, 0.8923, 0.4752, 0.9121]}, {"w": "to", "b": [0.4815, 0.8923, 0.5012, 0.9121]}, {"w": "build", "b": [0.5075, 0.8923, 0.5593, 0.9121]}, {"w": "intelligent", "b": [0.5656, 0.8923, 0.6679, 0.9121]}, {"w": "apps:", "b": [0.6742, 0.8923, 0.7275, 0.9121]}, {"w": "just", "b": [0.7338, 0.8923, 0.7702, 0.9121]}, {"w": "as", "b": [0.7765, 0.8923, 0.7976, 0.9121]}, {"w": "every", "b": [0.8039, 0.8923, 0.8599, 0.9121]}]}]}, {"page": 416, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "business today needs a website, every product will need to intelligently make sense of user-generated data. Bringing about this future will require us to build tools that make deep learning radically easy to use and accessible to anyone with basic coding abilities. Keras is the first major step in that direction.", "words": [{"w": "business", "b": [0.1294, 0.0857, 0.2149, 0.1054]}, {"w": "today", "b": [0.2212, 0.0857, 0.2773, 0.1054]}, {"w": "needs", "b": [0.2836, 0.0857, 0.341, 0.1054]}, {"w": "a", "b": [0.3473, 0.0857, 0.3585, 0.1054]}, {"w": "website,", "b": [0.3648, 0.0857, 0.4482, 0.1054]}, {"w": "every", "b": [0.4545, 0.0857, 0.5105, 0.1054]}, {"w": "product", "b": [0.5168, 0.0857, 0.5939, 0.1054]}, {"w": "will", "b": [0.6002, 0.0857, 0.6395, 0.1054]}, {"w": "need", "b": [0.6458, 0.0857, 0.6934, 0.1054]}, {"w": "to", "b": [0.6997, 0.0857, 0.7193, 0.1054]}, {"w": "intelligently", "b": [0.7256, 0.0857, 0.8476, 0.1054]}, {"w": "make", "b": [0.1294, 0.1062, 0.1841, 0.1259]}, {"w": "sense", "b": [0.1904, 0.1062, 0.245, 0.1259]}, {"w": "of", "b": [0.2513, 0.1062, 0.2723, 0.1259]}, {"w": "user-generated", "b": [0.2786, 0.1062, 0.4266, 0.1259]}, {"w": "data.", "b": [0.4329, 0.1062, 0.4812, 0.1259]}, {"w": "Bringing", "b": [0.4875, 0.1062, 0.5772, 0.1259]}, {"w": "about", "b": [0.5835, 0.1062, 0.6396, 0.1259]}, {"w": "this", "b": [0.6459, 0.1062, 0.6823, 0.1259]}, {"w": "future", "b": [0.6886, 0.1062, 0.7489, 0.1259]}, {"w": "will", "b": [0.7552, 0.1062, 0.7944, 0.1259]}, {"w": "require", "b": [0.1294, 0.1267, 0.2009, 0.1464]}, {"w": "us", "b": [0.2072, 0.1267, 0.2296, 0.1464]}, {"w": "to", "b": [0.2359, 0.1267, 0.2555, 0.1464]}, {"w": "build", "b": [0.2618, 0.1267, 0.3137, 0.1464]}, {"w": "tools", "b": [0.32, 0.1267, 0.3691, 0.1464]}, {"w": "that", "b": [0.3754, 0.1267, 0.4132, 0.1464]}, {"w": "make", "b": [0.4195, 0.1267, 0.4741, 0.1464]}, {"w": "deep", "b": [0.4805, 0.1267, 0.5281, 0.1464]}, {"w": "learning", "b": [0.5344, 0.1267, 0.6171, 0.1464]}, {"w": "radically", "b": [0.6234, 0.1267, 0.7116, 0.1464]}, {"w": "easy", "b": [0.7179, 0.1267, 0.7628, 0.1464]}, {"w": "to", "b": [0.7691, 0.1267, 0.7887, 0.1464]}, {"w": "use", "b": [0.795, 0.1267, 0.8286, 0.1464]}, {"w": "and", "b": [0.1294, 0.1472, 0.1658, 0.1669]}, {"w": "accessible", "b": [0.1721, 0.1472, 0.2744, 0.1669]}, {"w": "to", "b": [0.2807, 0.1472, 0.3003, 0.1669]}, {"w": "anyone", "b": [0.3066, 0.1472, 0.3795, 0.1669]}, {"w": "with", "b": [0.3858, 0.1472, 0.4306, 0.1669]}, {"w": "basic", "b": [0.4369, 0.1472, 0.4888, 0.1669]}, {"w": "coding", "b": [0.4951, 0.1472, 0.5637, 0.1669]}, {"w": "abilities.", "b": [0.5701, 0.1472, 0.6562, 0.1669]}, {"w": "Keras", "b": [0.6626, 0.1472, 0.7214, 0.1669]}, {"w": "is", "b": [0.7277, 0.1472, 0.7445, 0.1669]}, {"w": "the", "b": [0.7508, 0.1472, 0.7816, 0.1669]}, {"w": "first", "b": [0.788, 0.1472, 0.8286, 0.1669]}, {"w": "major", "b": [0.1294, 0.1677, 0.1883, 0.1874]}, {"w": "step", "b": [0.1946, 0.1677, 0.2352, 0.1874]}, {"w": "in", "b": [0.2415, 0.1677, 0.2611, 0.1874]}, {"w": "that", "b": [0.2674, 0.1677, 0.3053, 0.1874]}, {"w": "direction.", "b": [0.3116, 0.1677, 0.4076, 0.1874]}]}, {"id": "b_1", "type": "equation", "text": "9.1.5. The universal machine-learning workflow", "words": [{"w": "9.1.5.", "b": [0.1294, 0.2149, 0.1862, 0.2347]}, {"w": "The", "b": [0.1925, 0.2149, 0.2345, 0.2347]}, {"w": "universal", "b": [0.2408, 0.2149, 0.3403, 0.2347]}, {"w": "machine-learning", "b": [0.3467, 0.2149, 0.5358, 0.2347]}, {"w": "workflow", "b": [0.5422, 0.2149, 0.6444, 0.2347]}]}, {"id": "b_2", "type": "paragraph", "text": "Having access to an extremely powerful tool for creating models that map any input space to any target space is great, but the difficult part of the machine-learning workflow is often everything that comes before designing and training such models (and, for production models, what comes after, as well). Understanding the problem domain so as to be able to determine what to attempt to predict, given what data, and how to measure success, is a prerequisite for any successful application of machine learning, and it isn’t something that advanced tools like Keras and TensorFlow can help you with. As a reminder, here’s a quick summary of the typical machine-learning workflow as described in chapter 4:", "words": [{"w": "Having", "b": [0.1294, 0.2577, 0.2037, 0.2774]}, {"w": "access", "b": [0.21, 0.2577, 0.2744, 0.2774]}, {"w": "to", "b": [0.2807, 0.2577, 0.3003, 0.2774]}, {"w": "an", "b": [0.3066, 0.2577, 0.3305, 0.2774]}, {"w": "extremely", "b": [0.3368, 0.2577, 0.4376, 0.2774]}, {"w": "powerful", "b": [0.444, 0.2577, 0.535, 0.2774]}, {"w": "tool", "b": [0.5413, 0.2577, 0.5806, 0.2774]}, {"w": "for", "b": [0.5869, 0.2577, 0.6163, 0.2774]}, {"w": "creating", "b": [0.6226, 0.2577, 0.7039, 0.2774]}, {"w": "models", "b": [0.7102, 0.2577, 0.783, 0.2774]}, {"w": "that", "b": [0.7893, 0.2577, 0.8272, 0.2774]}, {"w": "map", "b": [0.1294, 0.2782, 0.1729, 0.2979]}, {"w": "any", "b": [0.1792, 0.2782, 0.2156, 0.2979]}, {"w": "input", "b": [0.2219, 0.2782, 0.2738, 0.2979]}, {"w": "space", "b": [0.2801, 0.2782, 0.3361, 0.2979]}, {"w": "to", "b": [0.3424, 0.2782, 0.362, 0.2979]}, {"w": "any", "b": [0.3683, 0.2782, 0.4048, 0.2979]}, {"w": "target", "b": [0.4111, 0.2782, 0.468, 0.2979]}, {"w": "space", "b": [0.4743, 0.2782, 0.5303, 0.2979]}, {"w": "is", "b": [0.5366, 0.2782, 0.5535, 0.2979]}, {"w": "great,", "b": [0.5598, 0.2782, 0.6165, 0.2979]}, {"w": "but", "b": [0.6228, 0.2782, 0.655, 0.2979]}, {"w": "the", "b": [0.6613, 0.2782, 0.6921, 0.2979]}, {"w": "difficult", "b": [0.6985, 0.2782, 0.7793, 0.2979]}, {"w": "part", "b": [0.7856, 0.2782, 0.8248, 0.2979]}, {"w": "of", "b": [0.8311, 0.2782, 0.8521, 0.2979]}, {"w": "the", "b": [0.1294, 0.2987, 0.1602, 0.3184]}, {"w": "machine-learning", "b": [0.1665, 0.2987, 0.3431, 0.3184]}, {"w": "workflow", "b": [0.3494, 0.2987, 0.4475, 0.3184]}, {"w": "is", "b": [0.4538, 0.2987, 0.4706, 0.3184]}, {"w": "often", "b": [0.4769, 0.2987, 0.5287, 0.3184]}, {"w": "everything", "b": [0.535, 0.2987, 0.6429, 0.3184]}, {"w": "that", "b": [0.6492, 0.2987, 0.6871, 0.3184]}, {"w": "comes", "b": [0.6934, 0.2987, 0.7578, 0.3184]}, {"w": "before", "b": [0.7641, 0.2987, 0.8286, 0.3184]}, {"w": "designing", "b": [0.1294, 0.3192, 0.2275, 0.3389]}, {"w": "and", "b": [0.2338, 0.3192, 0.2702, 0.3389]}, {"w": "training", "b": [0.2766, 0.3192, 0.355, 0.3389]}, {"w": "such", "b": [0.3613, 0.3192, 0.4076, 0.3389]}, {"w": "models", "b": [0.4139, 0.3192, 0.4868, 0.3389]}, {"w": "(and,", "b": [0.493, 0.3192, 0.5442, 0.3389]}, {"w": "for", "b": [0.5505, 0.3192, 0.5799, 0.3389]}, {"w": "production", "b": [0.5862, 0.3192, 0.6955, 0.3389]}, {"w": "models,", "b": [0.7018, 0.3192, 0.781, 0.3389]}, {"w": "what", "b": [0.7873, 0.3192, 0.8363, 0.3389]}, {"w": "comes", "b": [0.1294, 0.3397, 0.1939, 0.3594]}, {"w": "after,", "b": [0.2002, 0.3397, 0.2517, 0.3594]}, {"w": "as", "b": [0.258, 0.3397, 0.279, 0.3594]}, {"w": "well).", "b": [0.2853, 0.3397, 0.3434, 0.3594]}, {"w": "Understanding", "b": [0.3497, 0.3397, 0.4983, 0.3594]}, {"w": "the", "b": [0.5046, 0.3397, 0.5354, 0.3594]}, {"w": "problem", "b": [0.5417, 0.3397, 0.6258, 0.3594]}, {"w": "domain", "b": [0.6321, 0.3397, 0.7078, 0.3594]}, {"w": "so", "b": [0.7141, 0.3397, 0.7365, 0.3594]}, {"w": "as", "b": [0.7428, 0.3397, 0.7638, 0.3594]}, {"w": "to", "b": [0.7701, 0.3397, 0.7898, 0.3594]}, {"w": "be", "b": [0.7961, 0.3397, 0.8199, 0.3594]}, {"w": "able", "b": [0.8262, 0.3397, 0.8682, 0.3594]}, {"w": "to", "b": [0.1294, 0.3602, 0.149, 0.3799]}, {"w": "determine", "b": [0.1553, 0.3602, 0.2562, 0.3799]}, {"w": "what", "b": [0.2625, 0.3602, 0.3116, 0.3799]}, {"w": "to", "b": [0.3178, 0.3602, 0.3375, 0.3799]}, {"w": "attempt", "b": [0.3438, 0.3602, 0.4194, 0.3799]}, {"w": "to", "b": [0.4258, 0.3602, 0.4454, 0.3799]}, {"w": "predict,", "b": [0.4517, 0.3602, 0.528, 0.3799]}, {"w": "given", "b": [0.5343, 0.3602, 0.5904, 0.3799]}, {"w": "what", "b": [0.5967, 0.3602, 0.6457, 0.3799]}, {"w": "data,", "b": [0.6521, 0.3602, 0.7004, 0.3799]}, {"w": "and", "b": [0.7067, 0.3602, 0.7431, 0.3799]}, {"w": "how", "b": [0.7494, 0.3602, 0.7929, 0.3799]}, {"w": "to", "b": [0.7992, 0.3602, 0.8188, 0.3799]}, {"w": "measure", "b": [0.1294, 0.3807, 0.2135, 0.4004]}, {"w": "success,", "b": [0.2198, 0.3807, 0.3017, 0.4004]}, {"w": "is", "b": [0.308, 0.3807, 0.3249, 0.4004]}, {"w": "a", "b": [0.3312, 0.3807, 0.3424, 0.4004]}, {"w": "prerequisite", "b": [0.3487, 0.3807, 0.4678, 0.4004]}, {"w": "for", "b": [0.4741, 0.3807, 0.5035, 0.4004]}, {"w": "any", "b": [0.5098, 0.3807, 0.5462, 0.4004]}, {"w": "successful", "b": [0.5525, 0.3807, 0.6562, 0.4004]}, {"w": "application", "b": [0.6625, 0.3807, 0.7746, 0.4004]}, {"w": "of", "b": [0.7809, 0.3807, 0.8019, 0.4004]}, {"w": "machine", "b": [0.1294, 0.4012, 0.2149, 0.4209]}, {"w": "learning,", "b": [0.2212, 0.4012, 0.3101, 0.4209]}, {"w": "and", "b": [0.3164, 0.4012, 0.3529, 0.4209]}, {"w": "it", "b": [0.3592, 0.4012, 0.3732, 0.4209]}, {"w": "isn’t", "b": [0.3795, 0.4012, 0.4239, 0.4209]}, {"w": "something", "b": [0.4302, 0.4012, 0.5353, 0.4209]}, {"w": "that", "b": [0.5416, 0.4012, 0.5794, 0.4209]}, {"w": "advanced", "b": [0.5857, 0.4012, 0.681, 0.4209]}, {"w": "tools", "b": [0.6873, 0.4012, 0.7364, 0.4209]}, {"w": "like", "b": [0.7427, 0.4012, 0.7805, 0.4209]}, {"w": "Keras", "b": [0.7868, 0.4012, 0.8456, 0.4209]}, {"w": "and", "b": [0.1294, 0.4217, 0.1658, 0.4414]}, {"w": "TensorFlow", "b": [0.1721, 0.4217, 0.2923, 0.4414]}, {"w": "can", "b": [0.2986, 0.4217, 0.3336, 0.4414]}, {"w": "help", "b": [0.3399, 0.4217, 0.3834, 0.4414]}, {"w": "you", "b": [0.3897, 0.4217, 0.4275, 0.4414]}, {"w": "with.", "b": [0.4338, 0.4217, 0.485, 0.4414]}, {"w": "As", "b": [0.4913, 0.4217, 0.5193, 0.4414]}, {"w": "a", "b": [0.5256, 0.4217, 0.5368, 0.4414]}, {"w": "reminder,", "b": [0.5431, 0.4217, 0.6394, 0.4414]}, {"w": "here’s", "b": [0.6458, 0.4217, 0.706, 0.4414]}, {"w": "a", "b": [0.7123, 0.4217, 0.7235, 0.4414]}, {"w": "quick", "b": [0.7298, 0.4217, 0.7858, 0.4414]}, {"w": "summary", "b": [0.1294, 0.4422, 0.2233, 0.4619]}, {"w": "of", "b": [0.2296, 0.4422, 0.2506, 0.4619]}, {"w": "the", "b": [0.2569, 0.4422, 0.2878, 0.4619]}, {"w": "typical", "b": [0.2941, 0.4422, 0.3627, 0.4619]}, {"w": "machine-learning", "b": [0.369, 0.4422, 0.5456, 0.4619]}, {"w": "workflow", "b": [0.5519, 0.4422, 0.6499, 0.4619]}, {"w": "as", "b": [0.6563, 0.4422, 0.6773, 0.4619]}, {"w": "described", "b": [0.6836, 0.4422, 0.7802, 0.4619]}, {"w": "in", "b": [0.7865, 0.4422, 0.8062, 0.4619]}, {"w": "chapter", "b": [0.1294, 0.4627, 0.2037, 0.4824]}, {"w": "4:", "b": [0.21, 0.4627, 0.2296, 0.4824]}]}, {"id": "b_3", "type": "paragraph", "text": "1. Define the problem: What data is available, and what are you trying to predict? Will you need to collect more data or hire people to manually label a dataset? 2. Identify a way to reliably measure success on your goal. For simple tasks, this may be prediction accuracy, but in many cases it will require sophisticated domain-specific metrics. 3. Prepare the validation process that you’ll use to evaluate your models. In particular, you should define a training set, a validation set, and a test set. The validation- and test-set labels shouldn’t leak into the training data: for instance, with temporal prediction, the validation and test data should be posterior to the training data. 4. Vectorize the data by turning it into vectors and preprocessing it in a way that makes it more easily approachable by a neural network (normalization, and so on). 5. Develop a first model that beats a trivial common-sense baseline, thus demonstrating that machine learning can work on your problem. This may not always be the case! 6. Gradually refine your model architecture by tuning hyperparameters and adding regularization. Make changes based on performance on the validation data only, not the test data or the training data.", "words": [{"w": "1.", "b": [0.1551, 0.501, 0.174, 0.5208]}, {"w": "Define", "b": [0.1799, 0.501, 0.2485, 0.5208]}, {"w": "the", "b": [0.2548, 0.501, 0.2856, 0.5208]}, {"w": "problem:", "b": [0.2919, 0.501, 0.383, 0.5208]}, {"w": "What", "b": [0.3893, 0.501, 0.444, 0.5208]}, {"w": "data", "b": [0.4503, 0.501, 0.4923, 0.5208]}, {"w": "is", "b": [0.4986, 0.501, 0.5154, 0.5208]}, {"w": "available,", "b": [0.5217, 0.501, 0.6191, 0.5208]}, {"w": "and", "b": [0.6254, 0.501, 0.6619, 0.5208]}, {"w": "what", "b": [0.6682, 0.501, 0.7172, 0.5208]}, {"w": "are", "b": [0.7235, 0.501, 0.7543, 0.5208]}, {"w": "you", "b": [0.7606, 0.501, 0.7984, 0.5208]}, {"w": "trying", "b": [0.8048, 0.501, 0.865, 0.5208]}, {"w": "to", "b": [0.1799, 0.5215, 0.1995, 0.5413]}, {"w": "predict?", "b": [0.2058, 0.5215, 0.287, 0.5413]}, {"w": "Will", "b": [0.2934, 0.5215, 0.3372, 0.5413]}, {"w": "you", "b": [0.3435, 0.5215, 0.3813, 0.5413]}, {"w": "need", "b": [0.3876, 0.5215, 0.4352, 0.5413]}, {"w": "to", "b": [0.4416, 0.5215, 0.4612, 0.5413]}, {"w": "collect", "b": [0.4675, 0.5215, 0.5347, 0.5413]}, {"w": "more", "b": [0.541, 0.5215, 0.5929, 0.5413]}, {"w": "data", "b": [0.5992, 0.5215, 0.6412, 0.5413]}, {"w": "or", "b": [0.6475, 0.5215, 0.6685, 0.5413]}, {"w": "hire", "b": [0.6748, 0.5215, 0.7141, 0.5413]}, {"w": "people", "b": [0.7203, 0.5215, 0.7875, 0.5413]}, {"w": "to", "b": [0.7938, 0.5215, 0.8135, 0.5413]}, {"w": "manually", "b": [0.1799, 0.542, 0.2738, 0.5618]}, {"w": "label", "b": [0.2801, 0.542, 0.3291, 0.5618]}, {"w": "a", "b": [0.3354, 0.542, 0.3466, 0.5618]}, {"w": "dataset?", "b": [0.3529, 0.542, 0.4342, 0.5618]}, {"w": "2.", "b": [0.1551, 0.5625, 0.174, 0.5823]}, {"w": "Identify", "b": [0.1799, 0.5625, 0.2597, 0.5823]}, {"w": "a", "b": [0.266, 0.5625, 0.2772, 0.5823]}, {"w": "way", "b": [0.2835, 0.5625, 0.3256, 0.5823]}, {"w": "to", "b": [0.3319, 0.5625, 0.3515, 0.5823]}, {"w": "reliably", "b": [0.3578, 0.5625, 0.4349, 0.5823]}, {"w": "measure", "b": [0.4412, 0.5625, 0.5252, 0.5823]}, {"w": "success", "b": [0.5315, 0.5625, 0.6072, 0.5823]}, {"w": "on", "b": [0.6135, 0.5625, 0.6387, 0.5823]}, {"w": "your", "b": [0.645, 0.5625, 0.6913, 0.5823]}, {"w": "goal.", "b": [0.6976, 0.5625, 0.7473, 0.5823]}, {"w": "For", "b": [0.7536, 0.5625, 0.7887, 0.5823]}, {"w": "simple", "b": [0.795, 0.5625, 0.8622, 0.5823]}, {"w": "tasks,", "b": [0.1799, 0.583, 0.2366, 0.6028]}, {"w": "this", "b": [0.2429, 0.583, 0.2794, 0.6028]}, {"w": "may", "b": [0.2857, 0.583, 0.3291, 0.6028]}, {"w": "be", "b": [0.3354, 0.583, 0.3592, 0.6028]}, {"w": "prediction", "b": [0.3656, 0.583, 0.4678, 0.6028]}, {"w": "accuracy,", "b": [0.4741, 0.583, 0.5684, 0.6028]}, {"w": "but", "b": [0.5747, 0.583, 0.6069, 0.6028]}, {"w": "in", "b": [0.6132, 0.583, 0.6329, 0.6028]}, {"w": "many", "b": [0.6392, 0.583, 0.6952, 0.6028]}, {"w": "cases", "b": [0.7015, 0.583, 0.7548, 0.6028]}, {"w": "it", "b": [0.761, 0.583, 0.7751, 0.6028]}, {"w": "will", "b": [0.7814, 0.583, 0.8206, 0.6028]}, {"w": "require", "b": [0.1799, 0.6035, 0.2513, 0.6233]}, {"w": "sophisticated", "b": [0.2576, 0.6035, 0.3893, 0.6233]}, {"w": "domain-specific", "b": [0.3956, 0.6035, 0.5582, 0.6233]}, {"w": "metrics.", "b": [0.5645, 0.6035, 0.6451, 0.6233]}, {"w": "3.", "b": [0.1551, 0.624, 0.174, 0.6438]}, {"w": "Prepare", "b": [0.1799, 0.624, 0.2569, 0.6438]}, {"w": "the", "b": [0.2632, 0.624, 0.294, 0.6438]}, {"w": "validation", "b": [0.3003, 0.624, 0.4012, 0.6438]}, {"w": "process", "b": [0.4076, 0.624, 0.4832, 0.6438]}, {"w": "that", "b": [0.4895, 0.624, 0.5273, 0.6438]}, {"w": "you’ll", "b": [0.5337, 0.624, 0.5939, 0.6438]}, {"w": "use", "b": [0.6002, 0.624, 0.6339, 0.6438]}, {"w": "to", "b": [0.6402, 0.624, 0.6598, 0.6438]}, {"w": "evaluate", "b": [0.6661, 0.624, 0.7501, 0.6438]}, {"w": "your", "b": [0.7564, 0.624, 0.8027, 0.6438]}, {"w": "models.", "b": [0.1799, 0.6445, 0.259, 0.6643]}, {"w": "In", "b": [0.2654, 0.6445, 0.2864, 0.6643]}, {"w": "particular,", "b": [0.2927, 0.6445, 0.3946, 0.6643]}, {"w": "you", "b": [0.4009, 0.6445, 0.4387, 0.6643]}, {"w": "should", "b": [0.4451, 0.6445, 0.5123, 0.6643]}, {"w": "define", "b": [0.5186, 0.6445, 0.5817, 0.6643]}, {"w": "a", "b": [0.588, 0.6445, 0.5992, 0.6643]}, {"w": "training", "b": [0.6055, 0.6445, 0.684, 0.6643]}, {"w": "set,", "b": [0.6903, 0.6445, 0.7246, 0.6643]}, {"w": "a", "b": [0.7309, 0.6445, 0.7421, 0.6643]}, {"w": "validation", "b": [0.7484, 0.6445, 0.8493, 0.6643]}, {"w": "set,", "b": [0.1799, 0.665, 0.2142, 0.6848]}, {"w": "and", "b": [0.2205, 0.665, 0.2569, 0.6848]}, {"w": "a", "b": [0.2632, 0.665, 0.2744, 0.6848]}, {"w": "test", "b": [0.2807, 0.665, 0.3158, 0.6848]}, {"w": "set.", "b": [0.3221, 0.665, 0.3564, 0.6848]}, {"w": "The", "b": [0.3627, 0.665, 0.402, 0.6848]}, {"w": "validation-", "b": [0.4083, 0.665, 0.5176, 0.6848]}, {"w": "and", "b": [0.5239, 0.665, 0.5603, 0.6848]}, {"w": "test-set", "b": [0.5666, 0.665, 0.6381, 0.6848]}, {"w": "labels", "b": [0.6444, 0.665, 0.7032, 0.6848]}, {"w": "shouldn’t", "b": [0.7095, 0.665, 0.8043, 0.6848]}, {"w": "leak", "b": [0.8106, 0.665, 0.8526, 0.6848]}, {"w": "into", "b": [0.1799, 0.6855, 0.2191, 0.7053]}, {"w": "the", "b": [0.2254, 0.6855, 0.2562, 0.7053]}, {"w": "training", "b": [0.2626, 0.6855, 0.341, 0.7053]}, {"w": "data:", "b": [0.3473, 0.6855, 0.3964, 0.7053]}, {"w": "for", "b": [0.4027, 0.6855, 0.4321, 0.7053]}, {"w": "instance,", "b": [0.4384, 0.6855, 0.5274, 0.7053]}, {"w": "with", "b": [0.5337, 0.6855, 0.5785, 0.7053]}, {"w": "temporal", "b": [0.5848, 0.6855, 0.6744, 0.7053]}, {"w": "prediction,", "b": [0.6807, 0.6855, 0.7893, 0.7053]}, {"w": "the", "b": [0.7956, 0.6855, 0.8265, 0.7053]}, {"w": "validation", "b": [0.1799, 0.706, 0.2808, 0.7258]}, {"w": "and", "b": [0.2871, 0.706, 0.3235, 0.7258]}, {"w": "test", "b": [0.3298, 0.706, 0.3648, 0.7258]}, {"w": "data", "b": [0.3712, 0.706, 0.4132, 0.7258]}, {"w": "should", "b": [0.4195, 0.706, 0.4868, 0.7258]}, {"w": "be", "b": [0.4931, 0.706, 0.5169, 0.7258]}, {"w": "posterior", "b": [0.5232, 0.706, 0.6129, 0.7258]}, {"w": "to", "b": [0.6192, 0.706, 0.6388, 0.7258]}, {"w": "the", "b": [0.6451, 0.706, 0.6759, 0.7258]}, {"w": "training", "b": [0.6822, 0.706, 0.7607, 0.7258]}, {"w": "data.", "b": [0.767, 0.706, 0.8154, 0.7258]}, {"w": "4.", "b": [0.1551, 0.7265, 0.174, 0.7463]}, {"w": "Vectorize", "b": [0.1799, 0.7265, 0.2751, 0.7463]}, {"w": "the", "b": [0.2814, 0.7265, 0.3123, 0.7463]}, {"w": "data", "b": [0.3186, 0.7265, 0.3606, 0.7463]}, {"w": "by", "b": [0.3669, 0.7265, 0.3921, 0.7463]}, {"w": "turning", "b": [0.3984, 0.7265, 0.4713, 0.7463]}, {"w": "it", "b": [0.4776, 0.7265, 0.4916, 0.7463]}, {"w": "into", "b": [0.4979, 0.7265, 0.5372, 0.7463]}, {"w": "vectors", "b": [0.5435, 0.7265, 0.6164, 0.7463]}, {"w": "and", "b": [0.6227, 0.7265, 0.6591, 0.7463]}, {"w": "preprocessing", "b": [0.6654, 0.7265, 0.8055, 0.7463]}, {"w": "it", "b": [0.8118, 0.7265, 0.8258, 0.7463]}, {"w": "in", "b": [0.8321, 0.7265, 0.8518, 0.7463]}, {"w": "a", "b": [0.8581, 0.7265, 0.8693, 0.7463]}, {"w": "way", "b": [0.1799, 0.747, 0.2219, 0.7668]}, {"w": "that", "b": [0.2282, 0.747, 0.266, 0.7668]}, {"w": "makes", "b": [0.2723, 0.747, 0.3368, 0.7668]}, {"w": "it", "b": [0.3431, 0.747, 0.3571, 0.7668]}, {"w": "more", "b": [0.3634, 0.747, 0.4153, 0.7668]}, {"w": "easily", "b": [0.4216, 0.747, 0.4804, 0.7668]}, {"w": "approachable", "b": [0.4867, 0.747, 0.6212, 0.7668]}, {"w": "by", "b": [0.6275, 0.747, 0.6527, 0.7668]}, {"w": "a", "b": [0.6591, 0.747, 0.6703, 0.7668]}, {"w": "neural", "b": [0.6766, 0.747, 0.7396, 0.7668]}, {"w": "network", "b": [0.7458, 0.747, 0.8285, 0.7668]}, {"w": "(normalization,", "b": [0.1799, 0.7675, 0.3347, 0.7873]}, {"w": "and", "b": [0.341, 0.7675, 0.3774, 0.7873]}, {"w": "so", "b": [0.3837, 0.7675, 0.4062, 0.7873]}, {"w": "on).", "b": [0.4125, 0.7675, 0.4524, 0.7873]}, {"w": "5.", "b": [0.1551, 0.788, 0.174, 0.8078]}, {"w": "Develop", "b": [0.1799, 0.788, 0.2653, 0.8078]}, {"w": "a", "b": [0.2716, 0.788, 0.2828, 0.8078]}, {"w": "first", "b": [0.2891, 0.788, 0.3298, 0.8078]}, {"w": "model", "b": [0.3361, 0.788, 0.3992, 0.8078]}, {"w": "that", "b": [0.4055, 0.788, 0.4433, 0.8078]}, {"w": "beats", "b": [0.4496, 0.788, 0.5014, 0.8078]}, {"w": "a", "b": [0.5077, 0.788, 0.5189, 0.8078]}, {"w": "trivial", "b": [0.5253, 0.788, 0.5855, 0.8078]}, {"w": "common-sense", "b": [0.5918, 0.788, 0.7432, 0.8078]}, {"w": "baseline,", "b": [0.7495, 0.788, 0.8384, 0.8078]}, {"w": "thus", "b": [0.1799, 0.8085, 0.2219, 0.8283]}, {"w": "demonstrating", "b": [0.2282, 0.8085, 0.3726, 0.8283]}, {"w": "that", "b": [0.3789, 0.8085, 0.4167, 0.8283]}, {"w": "machine", "b": [0.423, 0.8085, 0.5085, 0.8283]}, {"w": "learning", "b": [0.5148, 0.8085, 0.5975, 0.8283]}, {"w": "can", "b": [0.6038, 0.8085, 0.6388, 0.8283]}, {"w": "work", "b": [0.6451, 0.8085, 0.6969, 0.8283]}, {"w": "on", "b": [0.7032, 0.8085, 0.7284, 0.8283]}, {"w": "your", "b": [0.7348, 0.8085, 0.781, 0.8283]}, {"w": "problem.", "b": [0.1799, 0.829, 0.2702, 0.8488]}, {"w": "This", "b": [0.2766, 0.829, 0.3214, 0.8488]}, {"w": "may", "b": [0.3277, 0.829, 0.3712, 0.8488]}, {"w": "not", "b": [0.3775, 0.829, 0.4097, 0.8488]}, {"w": "always", "b": [0.416, 0.829, 0.4861, 0.8488]}, {"w": "be", "b": [0.4924, 0.829, 0.5162, 0.8488]}, {"w": "the", "b": [0.5225, 0.829, 0.5533, 0.8488]}, {"w": "case!", "b": [0.5596, 0.829, 0.6114, 0.8488]}, {"w": "6.", "b": [0.1551, 0.8495, 0.174, 0.8693]}, {"w": "Gradually", "b": [0.1799, 0.8495, 0.2807, 0.8693]}, {"w": "refine", "b": [0.287, 0.8495, 0.3459, 0.8693]}, {"w": "your", "b": [0.3522, 0.8495, 0.3984, 0.8693]}, {"w": "model", "b": [0.4047, 0.8495, 0.4678, 0.8693]}, {"w": "architecture", "b": [0.4741, 0.8495, 0.5932, 0.8693]}, {"w": "by", "b": [0.5995, 0.8495, 0.6247, 0.8693]}, {"w": "tuning", "b": [0.631, 0.8495, 0.6955, 0.8693]}, {"w": "hyperparameters", "b": [0.7018, 0.8495, 0.8699, 0.8693]}, {"w": "and", "b": [0.1799, 0.87, 0.2163, 0.8898]}, {"w": "adding", "b": [0.2226, 0.87, 0.2913, 0.8898]}, {"w": "regularization.", "b": [0.2976, 0.87, 0.444, 0.8898]}, {"w": "Make", "b": [0.4503, 0.87, 0.5077, 0.8898]}, {"w": "changes", "b": [0.514, 0.87, 0.5953, 0.8898]}, {"w": "based", "b": [0.6016, 0.87, 0.659, 0.8898]}, {"w": "on", "b": [0.6653, 0.87, 0.6906, 0.8898]}, {"w": "performance", "b": [0.6969, 0.87, 0.8243, 0.8898]}, {"w": "on", "b": [0.8306, 0.87, 0.8558, 0.8898]}, {"w": "the", "b": [0.1799, 0.8905, 0.2107, 0.9103]}, {"w": "validation", "b": [0.217, 0.8905, 0.3179, 0.9103]}, {"w": "data", "b": [0.3242, 0.8905, 0.3662, 0.9103]}, {"w": "only,", "b": [0.3725, 0.8905, 0.422, 0.9103]}, {"w": "not", "b": [0.4283, 0.8905, 0.4606, 0.9103]}, {"w": "the", "b": [0.4669, 0.8905, 0.4977, 0.9103]}, {"w": "test", "b": [0.504, 0.8905, 0.539, 0.9103]}, {"w": "data", "b": [0.5453, 0.8905, 0.5874, 0.9103]}, {"w": "or", "b": [0.5937, 0.8905, 0.6147, 0.9103]}, {"w": "the", "b": [0.621, 0.8905, 0.6518, 0.9103]}, {"w": "training", "b": [0.6581, 0.8905, 0.7366, 0.9103]}, {"w": "data.", "b": [0.7429, 0.8905, 0.7912, 0.9103]}]}]}, {"page": 417, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Remember that you should get your model to overfit (thus identifying a model capacity level that’s greater than you need) and only then begin to add regularization or downsize your model. 7. Be aware of validation-set overfitting when turning hyperparameters: the fact that your hyperparameters may end up being overspecialized to the validation set. Avoiding this is the purpose of having a separate test set!", "words": [{"w": "Remember", "b": [0.1799, 0.0857, 0.2906, 0.1054]}, {"w": "that", "b": [0.2969, 0.0857, 0.3347, 0.1054]}, {"w": "you", "b": [0.341, 0.0857, 0.3788, 0.1054]}, {"w": "should", "b": [0.3852, 0.0857, 0.4524, 0.1054]}, {"w": "get", "b": [0.4587, 0.0857, 0.4896, 0.1054]}, {"w": "your", "b": [0.4959, 0.0857, 0.5421, 0.1054]}, {"w": "model", "b": [0.5484, 0.0857, 0.6115, 0.1054]}, {"w": "to", "b": [0.6178, 0.0857, 0.6374, 0.1054]}, {"w": "overfit", "b": [0.6437, 0.0857, 0.711, 0.1054]}, {"w": "(thus", "b": [0.7173, 0.0857, 0.7677, 0.1054]}, {"w": "identifying", "b": [0.1799, 0.1062, 0.2906, 0.1259]}, {"w": "a", "b": [0.2969, 0.1062, 0.3081, 0.1259]}, {"w": "model", "b": [0.3144, 0.1062, 0.3775, 0.1259]}, {"w": "capacity", "b": [0.3838, 0.1062, 0.4678, 0.1259]}, {"w": "level", "b": [0.4741, 0.1062, 0.5232, 0.1259]}, {"w": "that’s", "b": [0.5295, 0.1062, 0.584, 0.1259]}, {"w": "greater", "b": [0.5903, 0.1062, 0.6604, 0.1259]}, {"w": "than", "b": [0.6667, 0.1062, 0.7101, 0.1259]}, {"w": "you", "b": [0.7164, 0.1062, 0.7543, 0.1259]}, {"w": "need)", "b": [0.7606, 0.1062, 0.8166, 0.1259]}, {"w": "and", "b": [0.8229, 0.1062, 0.8593, 0.1259]}, {"w": "only", "b": [0.1799, 0.1267, 0.2247, 0.1464]}, {"w": "then", "b": [0.231, 0.1267, 0.2745, 0.1464]}, {"w": "begin", "b": [0.2808, 0.1267, 0.3368, 0.1464]}, {"w": "to", "b": [0.3431, 0.1267, 0.3628, 0.1464]}, {"w": "add", "b": [0.3691, 0.1267, 0.4055, 0.1464]}, {"w": "regularization", "b": [0.4118, 0.1267, 0.5519, 0.1464]}, {"w": "or", "b": [0.5582, 0.1267, 0.5792, 0.1464]}, {"w": "downsize", "b": [0.5855, 0.1267, 0.6808, 0.1464]}, {"w": "your", "b": [0.6871, 0.1267, 0.7333, 0.1464]}, {"w": "model.", "b": [0.7396, 0.1267, 0.809, 0.1464]}, {"w": "7.", "b": [0.1551, 0.1472, 0.174, 0.1669]}, {"w": "Be", "b": [0.1799, 0.1472, 0.2079, 0.1669]}, {"w": "aware", "b": [0.2142, 0.1472, 0.2744, 0.1669]}, {"w": "of", "b": [0.2807, 0.1472, 0.3017, 0.1669]}, {"w": "validation-set", "b": [0.308, 0.1472, 0.4454, 0.1669]}, {"w": "overfitting", "b": [0.4517, 0.1472, 0.5582, 0.1669]}, {"w": "when", "b": [0.5645, 0.1472, 0.6191, 0.1669]}, {"w": "turning", "b": [0.6254, 0.1472, 0.6983, 0.1669]}, {"w": "hyperparameters:", "b": [0.1799, 0.1677, 0.355, 0.1874]}, {"w": "the", "b": [0.3613, 0.1677, 0.3921, 0.1874]}, {"w": "fact", "b": [0.3984, 0.1677, 0.4362, 0.1874]}, {"w": "that", "b": [0.4425, 0.1677, 0.4804, 0.1874]}, {"w": "your", "b": [0.4867, 0.1677, 0.5329, 0.1874]}, {"w": "hyperparameters", "b": [0.5392, 0.1677, 0.7073, 0.1874]}, {"w": "may", "b": [0.7136, 0.1677, 0.7571, 0.1874]}, {"w": "end", "b": [0.7634, 0.1677, 0.7998, 0.1874]}, {"w": "up", "b": [0.8061, 0.1677, 0.8313, 0.1874]}, {"w": "being", "b": [0.1799, 0.1882, 0.2359, 0.2079]}, {"w": "overspecialized", "b": [0.2422, 0.1882, 0.3991, 0.2079]}, {"w": "to", "b": [0.4054, 0.1882, 0.425, 0.2079]}, {"w": "the", "b": [0.4313, 0.1882, 0.4621, 0.2079]}, {"w": "validation", "b": [0.4684, 0.1882, 0.5693, 0.2079]}, {"w": "set.", "b": [0.5757, 0.1882, 0.61, 0.2079]}, {"w": "Avoiding", "b": [0.6163, 0.1882, 0.7097, 0.2079]}, {"w": "this", "b": [0.716, 0.1882, 0.7524, 0.2079]}, {"w": "is", "b": [0.7587, 0.1882, 0.7756, 0.2079]}, {"w": "the", "b": [0.7819, 0.1882, 0.8127, 0.2079]}, {"w": "purpose", "b": [0.1799, 0.2087, 0.2597, 0.2284]}, {"w": "of", "b": [0.266, 0.2087, 0.287, 0.2284]}, {"w": "having", "b": [0.2934, 0.2087, 0.362, 0.2284]}, {"w": "a", "b": [0.3683, 0.2087, 0.3795, 0.2284]}, {"w": "separate", "b": [0.3858, 0.2087, 0.4685, 0.2284]}, {"w": "test", "b": [0.4748, 0.2087, 0.5098, 0.2284]}, {"w": "set!", "b": [0.5161, 0.2087, 0.5525, 0.2284]}]}, {"id": "b_1", "type": "paragraph", "text": "9.1.6. Key network architectures", "words": [{"w": "9.1.6.", "b": [0.1294, 0.2559, 0.1862, 0.2757]}, {"w": "Key", "b": [0.1925, 0.2559, 0.2359, 0.2757]}, {"w": "network", "b": [0.2422, 0.2559, 0.3319, 0.2757]}, {"w": "architectures", "b": [0.3382, 0.2559, 0.4788, 0.2757]}]}, {"id": "b_2", "type": "paragraph", "text": "The three families of network architectures that you should be familiar with are densely connected networks, convolutional networks, and recurrent networks. Each type of network is meant for a specific input modality: a network architecture (dense, convolutional, recurrent) encodes assumptions about the structure of the data: a hypothesis space within which the search for a good model will proceed. Whether a given architecture will work on a given problem depends entirely on the match between the structure of the data and the assumptions of the network architecture.", "words": [{"w": "The", "b": [0.1294, 0.2987, 0.1686, 0.3184]}, {"w": "three", "b": [0.1749, 0.2987, 0.2254, 0.3184]}, {"w": "families", "b": [0.2317, 0.2987, 0.313, 0.3184]}, {"w": "of", "b": [0.3193, 0.2987, 0.3403, 0.3184]}, {"w": "network", "b": [0.3466, 0.2987, 0.4292, 0.3184]}, {"w": "architectures", "b": [0.4356, 0.2987, 0.5644, 0.3184]}, {"w": "that", "b": [0.5707, 0.2987, 0.6086, 0.3184]}, {"w": "you", "b": [0.6149, 0.2987, 0.6527, 0.3184]}, {"w": "should", "b": [0.659, 0.2987, 0.7263, 0.3184]}, {"w": "be", "b": [0.7326, 0.2987, 0.7564, 0.3184]}, {"w": "familiar", "b": [0.7627, 0.2987, 0.8426, 0.3184]}, {"w": "with", "b": [0.1294, 0.3192, 0.1743, 0.3389]}, {"w": "are", "b": [0.1806, 0.3192, 0.2114, 0.3389]}, {"w": "densely", "b": [0.2177, 0.3192, 0.2933, 0.3389]}, {"w": "connected", "b": [0.2996, 0.3192, 0.4019, 0.3389]}, {"w": "networks,", "b": [0.4082, 0.3192, 0.5056, 0.3389]}, {"w": "convolutional", "b": [0.5119, 0.3192, 0.6506, 0.3389]}, {"w": "networks,", "b": [0.6569, 0.3192, 0.7543, 0.3389]}, {"w": "and", "b": [0.7606, 0.3192, 0.797, 0.3389]}, {"w": "recurrent", "b": [0.1294, 0.3397, 0.2228, 0.3594]}, {"w": "networks.", "b": [0.2291, 0.3397, 0.3265, 0.3594]}, {"w": "Each", "b": [0.3328, 0.3397, 0.3832, 0.3594]}, {"w": "type", "b": [0.3895, 0.3397, 0.433, 0.3594]}, {"w": "of", "b": [0.4393, 0.3397, 0.4603, 0.3594]}, {"w": "network", "b": [0.4666, 0.3397, 0.5493, 0.3594]}, {"w": "is", "b": [0.5556, 0.3397, 0.5724, 0.3594]}, {"w": "meant", "b": [0.5787, 0.3397, 0.6404, 0.3594]}, {"w": "for", "b": [0.6467, 0.3397, 0.6761, 0.3594]}, {"w": "a", "b": [0.6824, 0.3397, 0.6936, 0.3594]}, {"w": "specific", "b": [0.6999, 0.3397, 0.7784, 0.3594]}, {"w": "input", "b": [0.7847, 0.3397, 0.8365, 0.3594]}, {"w": "modality:", "b": [0.1294, 0.3602, 0.2261, 0.3799]}, {"w": "a", "b": [0.2324, 0.3602, 0.2436, 0.3799]}, {"w": "network", "b": [0.2499, 0.3602, 0.3326, 0.3799]}, {"w": "architecture", "b": [0.3389, 0.3602, 0.458, 0.3799]}, {"w": "(dense,", "b": [0.4643, 0.3602, 0.5364, 0.3799]}, {"w": "convolutional,", "b": [0.5427, 0.3602, 0.6878, 0.3799]}, {"w": "recurrent)", "b": [0.6941, 0.3602, 0.7935, 0.3799]}, {"w": "encodes", "b": [0.1294, 0.3807, 0.2107, 0.4004]}, {"w": "assumptions", "b": [0.217, 0.3807, 0.3417, 0.4004]}, {"w": "about", "b": [0.348, 0.3807, 0.4041, 0.4004]}, {"w": "the", "b": [0.4104, 0.3807, 0.4412, 0.4004]}, {"w": "structure", "b": [0.4475, 0.3807, 0.5358, 0.4004]}, {"w": "of", "b": [0.5421, 0.3807, 0.5631, 0.4004]}, {"w": "the", "b": [0.5694, 0.3807, 0.6002, 0.4004]}, {"w": "data:", "b": [0.6065, 0.3807, 0.6556, 0.4004]}, {"w": "a", "b": [0.6619, 0.3807, 0.6731, 0.4004]}, {"w": "hypothesis", "b": [0.6793, 0.3807, 0.7858, 0.4004]}, {"w": "space", "b": [0.7921, 0.3807, 0.8496, 0.4004]}, {"w": "within", "b": [0.1294, 0.4012, 0.1939, 0.4209]}, {"w": "which", "b": [0.2002, 0.4012, 0.2618, 0.4209]}, {"w": "the", "b": [0.2682, 0.4012, 0.299, 0.4209]}, {"w": "search", "b": [0.3053, 0.4012, 0.3697, 0.4209]}, {"w": "for", "b": [0.376, 0.4012, 0.4054, 0.4209]}, {"w": "a", "b": [0.4117, 0.4012, 0.4229, 0.4209]}, {"w": "good", "b": [0.4292, 0.4012, 0.4797, 0.4209]}, {"w": "model", "b": [0.486, 0.4012, 0.5491, 0.4209]}, {"w": "will", "b": [0.5554, 0.4012, 0.5946, 0.4209]}, {"w": "proceed.", "b": [0.6009, 0.4012, 0.6871, 0.4209]}, {"w": "Whether", "b": [0.6934, 0.4012, 0.7802, 0.4209]}, {"w": "a", "b": [0.7865, 0.4012, 0.7977, 0.4209]}, {"w": "given", "b": [0.804, 0.4012, 0.8601, 0.4209]}, {"w": "architecture", "b": [0.1294, 0.4217, 0.2485, 0.4414]}, {"w": "will", "b": [0.2548, 0.4217, 0.294, 0.4414]}, {"w": "work", "b": [0.3003, 0.4217, 0.3522, 0.4414]}, {"w": "on", "b": [0.3585, 0.4217, 0.3837, 0.4414]}, {"w": "a", "b": [0.39, 0.4217, 0.4012, 0.4414]}, {"w": "given", "b": [0.4075, 0.4217, 0.4636, 0.4414]}, {"w": "problem", "b": [0.4699, 0.4217, 0.554, 0.4414]}, {"w": "depends", "b": [0.5603, 0.4217, 0.6429, 0.4414]}, {"w": "entirely", "b": [0.6492, 0.4217, 0.7262, 0.4414]}, {"w": "on", "b": [0.7325, 0.4217, 0.7578, 0.4414]}, {"w": "the", "b": [0.7641, 0.4217, 0.7949, 0.4414]}, {"w": "match", "b": [0.8012, 0.4217, 0.8628, 0.4414]}, {"w": "between", "b": [0.1294, 0.4422, 0.2135, 0.4619]}, {"w": "the", "b": [0.2198, 0.4422, 0.2506, 0.4619]}, {"w": "structure", "b": [0.2569, 0.4422, 0.3452, 0.4619]}, {"w": "of", "b": [0.3515, 0.4422, 0.3725, 0.4619]}, {"w": "the", "b": [0.3788, 0.4422, 0.4096, 0.4619]}, {"w": "data", "b": [0.4159, 0.4422, 0.458, 0.4619]}, {"w": "and", "b": [0.4643, 0.4422, 0.5007, 0.4619]}, {"w": "the", "b": [0.507, 0.4422, 0.5378, 0.4619]}, {"w": "assumptions", "b": [0.5441, 0.4422, 0.6689, 0.4619]}, {"w": "of", "b": [0.6752, 0.4422, 0.6962, 0.4619]}, {"w": "the", "b": [0.7025, 0.4422, 0.7333, 0.4619]}, {"w": "network", "b": [0.7396, 0.4422, 0.8223, 0.4619]}, {"w": "architecture.", "b": [0.1294, 0.4627, 0.2548, 0.4824]}]}, {"id": "b_3", "type": "paragraph", "text": "These different network types can easily be combined to achieve larger multimodal networks, much as you combine LEGO bricks. In a way, deep-learning layers are LEGO bricks for information processing. Here’s a quick overview of the mapping between input modalities and appropriate network architectures:", "words": [{"w": "These", "b": [0.1294, 0.5055, 0.1897, 0.5252]}, {"w": "different", "b": [0.196, 0.5055, 0.2823, 0.5252]}, {"w": "network", "b": [0.2886, 0.5055, 0.3713, 0.5252]}, {"w": "types", "b": [0.3776, 0.5055, 0.4309, 0.5252]}, {"w": "can", "b": [0.4372, 0.5055, 0.4722, 0.5252]}, {"w": "easily", "b": [0.4785, 0.5055, 0.5373, 0.5252]}, {"w": "be", "b": [0.5437, 0.5055, 0.5675, 0.5252]}, {"w": "combined", "b": [0.5738, 0.5055, 0.6733, 0.5252]}, {"w": "to", "b": [0.6796, 0.5055, 0.6992, 0.5252]}, {"w": "achieve", "b": [0.7055, 0.5055, 0.7825, 0.5252]}, {"w": "larger", "b": [0.7889, 0.5055, 0.8471, 0.5252]}, {"w": "multimodal", "b": [0.1294, 0.526, 0.2458, 0.5457]}, {"w": "networks,", "b": [0.2521, 0.526, 0.3508, 0.5457]}, {"w": "much", "b": [0.3572, 0.526, 0.4132, 0.5457]}, {"w": "as", "b": [0.4195, 0.526, 0.4405, 0.5457]}, {"w": "you", "b": [0.4468, 0.526, 0.4847, 0.5457]}, {"w": "combine", "b": [0.491, 0.526, 0.5779, 0.5457]}, {"w": "LEGO", "b": [0.5842, 0.526, 0.6514, 0.5457]}, {"w": "bricks.", "b": [0.6577, 0.526, 0.7257, 0.5457]}, {"w": "In", "b": [0.7319, 0.526, 0.7529, 0.5457]}, {"w": "a", "b": [0.7592, 0.526, 0.7704, 0.5457]}, {"w": "way,", "b": [0.7767, 0.526, 0.8234, 0.5457]}, {"w": "deep-learning", "b": [0.1294, 0.5465, 0.2681, 0.5662]}, {"w": "layers", "b": [0.2744, 0.5465, 0.3346, 0.5662]}, {"w": "are", "b": [0.341, 0.5465, 0.3718, 0.5662]}, {"w": "LEGO", "b": [0.3781, 0.5465, 0.4453, 0.5662]}, {"w": "bricks", "b": [0.4516, 0.5465, 0.5133, 0.5662]}, {"w": "for", "b": [0.5196, 0.5465, 0.549, 0.5662]}, {"w": "information", "b": [0.5553, 0.5465, 0.6744, 0.5662]}, {"w": "processing.", "b": [0.6807, 0.5465, 0.7949, 0.5662]}, {"w": "Here’s", "b": [0.8012, 0.5465, 0.867, 0.5662]}, {"w": "a", "b": [0.1294, 0.567, 0.1406, 0.5867]}, {"w": "quick", "b": [0.1469, 0.567, 0.203, 0.5867]}, {"w": "overview", "b": [0.2093, 0.567, 0.3031, 0.5867]}, {"w": "of", "b": [0.3094, 0.567, 0.3305, 0.5867]}, {"w": "the", "b": [0.3368, 0.567, 0.3676, 0.5867]}, {"w": "mapping", "b": [0.3739, 0.567, 0.4622, 0.5867]}, {"w": "between", "b": [0.4685, 0.567, 0.5525, 0.5867]}, {"w": "input", "b": [0.5588, 0.567, 0.6107, 0.5867]}, {"w": "modalities", "b": [0.617, 0.567, 0.7221, 0.5867]}, {"w": "and", "b": [0.7284, 0.567, 0.7648, 0.5867]}, {"w": "appropriate", "b": [0.1294, 0.5875, 0.2443, 0.6072]}, {"w": "network", "b": [0.2506, 0.5875, 0.3333, 0.6072]}, {"w": "architectures:", "b": [0.3396, 0.5875, 0.4755, 0.6072]}]}, {"id": "b_4", "type": "paragraph", "text": "Vector data— Densely connected network (Dense layers). Image data— 2D convnets. Sound data (for example, waveform)— Either 1D convnets (preferred) or RNNs. Text data— Either 1D convnets (preferred) or RNNs. Timeseries data— Either RNNs (preferred) or 1D convnets. Other types of sequence data— Either RNNs or 1D convnets. Prefer RNNs if data ordering is strongly meaningful (for example, for timeseries, but not for text). Video data— Either 3D convnets (if you need to capture motion effects) or a combination of a frame-level 2D convnet for feature extraction followed by either an RNN or a 1D convnet to process the resulting sequences. Volumetric data— 3D convnets.", "words": [{"w": "Vector", "b": [0.1799, 0.6258, 0.2457, 0.6456]}, {"w": "data—", "b": [0.252, 0.6258, 0.3221, 0.6456]}, {"w": "Densely", "b": [0.3284, 0.6258, 0.4111, 0.6456]}, {"w": "connected", "b": [0.4174, 0.6258, 0.5196, 0.6456]}, {"w": "network", "b": [0.5259, 0.6258, 0.6086, 0.6456]}, {"w": "(Dense", "b": [0.6149, 0.6258, 0.699, 0.6471]}, {"w": "layers).", "b": [0.7053, 0.6258, 0.7802, 0.6456]}, {"w": "Image", "b": [0.1799, 0.6472, 0.2457, 0.6669]}, {"w": "data—", "b": [0.252, 0.6472, 0.3221, 0.6669]}, {"w": "2D", "b": [0.3284, 0.6472, 0.3592, 0.6669]}, {"w": "convnets.", "b": [0.3655, 0.6472, 0.4615, 0.6669]}, {"w": "Sound", "b": [0.1799, 0.6677, 0.2472, 0.6874]}, {"w": "data", "b": [0.2535, 0.6677, 0.2983, 0.6874]}, {"w": "(for", "b": [0.3046, 0.6677, 0.3439, 0.6874]}, {"w": "example,", "b": [0.3502, 0.6677, 0.4433, 0.6874]}, {"w": "waveform)—", "b": [0.4497, 0.6677, 0.5856, 0.6874]}, {"w": "Either", "b": [0.5919, 0.6677, 0.6535, 0.6874]}, {"w": "1D", "b": [0.6598, 0.6677, 0.6906, 0.6874]}, {"w": "convnets", "b": [0.6969, 0.6677, 0.7866, 0.6874]}, {"w": "(preferred)", "b": [0.1799, 0.6882, 0.2891, 0.7079]}, {"w": "or", "b": [0.2954, 0.6882, 0.3164, 0.7079]}, {"w": "RNNs.", "b": [0.3227, 0.6882, 0.3921, 0.7079]}, {"w": "Text", "b": [0.1799, 0.7087, 0.2238, 0.7284]}, {"w": "data—", "b": [0.2301, 0.7087, 0.3002, 0.7284]}, {"w": "Either", "b": [0.3064, 0.7087, 0.3681, 0.7284]}, {"w": "1D", "b": [0.3744, 0.7087, 0.4052, 0.7284]}, {"w": "convnets", "b": [0.4115, 0.7087, 0.5012, 0.7284]}, {"w": "(preferred)", "b": [0.5075, 0.7087, 0.6167, 0.7284]}, {"w": "or", "b": [0.6231, 0.7087, 0.6441, 0.7284]}, {"w": "RNNs.", "b": [0.6504, 0.7087, 0.7197, 0.7284]}, {"w": "Timeseries", "b": [0.1799, 0.7292, 0.291, 0.7489]}, {"w": "data—", "b": [0.2973, 0.7292, 0.3674, 0.7489]}, {"w": "Either", "b": [0.3737, 0.7292, 0.4353, 0.7489]}, {"w": "RNNs", "b": [0.4416, 0.7292, 0.5047, 0.7489]}, {"w": "(preferred)", "b": [0.511, 0.7292, 0.6202, 0.7489]}, {"w": "or", "b": [0.6266, 0.7292, 0.6476, 0.7489]}, {"w": "1D", "b": [0.6539, 0.7292, 0.6847, 0.7489]}, {"w": "convnets.", "b": [0.691, 0.7292, 0.787, 0.7489]}, {"w": "Other", "b": [0.1799, 0.7497, 0.2401, 0.7694]}, {"w": "types", "b": [0.2464, 0.7497, 0.2983, 0.7694]}, {"w": "of", "b": [0.3046, 0.7497, 0.3256, 0.7694]}, {"w": "sequence", "b": [0.3319, 0.7497, 0.4272, 0.7694]}, {"w": "data—", "b": [0.4335, 0.7497, 0.5036, 0.7694]}, {"w": "Either", "b": [0.5098, 0.7497, 0.5715, 0.7694]}, {"w": "RNNs", "b": [0.5778, 0.7497, 0.6409, 0.7694]}, {"w": "or", "b": [0.6472, 0.7497, 0.6682, 0.7694]}, {"w": "1D", "b": [0.6745, 0.7497, 0.7053, 0.7694]}, {"w": "convnets.", "b": [0.7116, 0.7497, 0.8076, 0.7694]}, {"w": "Prefer", "b": [0.1799, 0.7702, 0.2415, 0.7899]}, {"w": "RNNs", "b": [0.2478, 0.7702, 0.3109, 0.7899]}, {"w": "if", "b": [0.3172, 0.7702, 0.3326, 0.7899]}, {"w": "data", "b": [0.3389, 0.7702, 0.3809, 0.7899]}, {"w": "ordering", "b": [0.3872, 0.7702, 0.4727, 0.7899]}, {"w": "is", "b": [0.479, 0.7702, 0.4958, 0.7899]}, {"w": "strongly", "b": [0.5021, 0.7702, 0.5848, 0.7899]}, {"w": "meaningful", "b": [0.5911, 0.7702, 0.706, 0.7899]}, {"w": "(for", "b": [0.7123, 0.7702, 0.7501, 0.7899]}, {"w": "example,", "b": [0.7564, 0.7702, 0.8482, 0.7899]}, {"w": "for", "b": [0.1799, 0.7907, 0.2093, 0.8104]}, {"w": "timeseries,", "b": [0.2156, 0.7907, 0.3242, 0.8104]}, {"w": "but", "b": [0.3305, 0.7907, 0.3627, 0.8104]}, {"w": "not", "b": [0.369, 0.7907, 0.4013, 0.8104]}, {"w": "for", "b": [0.4076, 0.7907, 0.437, 0.8104]}, {"w": "text).", "b": [0.4433, 0.7907, 0.4958, 0.8104]}, {"w": "Video", "b": [0.1799, 0.8112, 0.2387, 0.8309]}, {"w": "data—", "b": [0.245, 0.8112, 0.3151, 0.8309]}, {"w": "Either", "b": [0.3214, 0.8112, 0.3831, 0.8309]}, {"w": "3D", "b": [0.3894, 0.8112, 0.4202, 0.8309]}, {"w": "convnets", "b": [0.4265, 0.8112, 0.5162, 0.8309]}, {"w": "(if", "b": [0.5225, 0.8112, 0.5463, 0.8309]}, {"w": "you", "b": [0.5526, 0.8112, 0.5904, 0.8309]}, {"w": "need", "b": [0.5967, 0.8112, 0.6444, 0.8309]}, {"w": "to", "b": [0.6507, 0.8112, 0.6703, 0.8309]}, {"w": "capture", "b": [0.6766, 0.8112, 0.7508, 0.8309]}, {"w": "motion", "b": [0.7572, 0.8112, 0.8286, 0.8309]}, {"w": "effects)", "b": [0.1799, 0.8317, 0.255, 0.8514]}, {"w": "or", "b": [0.2613, 0.8317, 0.2824, 0.8514]}, {"w": "a", "b": [0.2887, 0.8317, 0.2999, 0.8514]}, {"w": "combination", "b": [0.3062, 0.8317, 0.4323, 0.8514]}, {"w": "of", "b": [0.4386, 0.8317, 0.4596, 0.8514]}, {"w": "a", "b": [0.4659, 0.8317, 0.4771, 0.8514]}, {"w": "frame-level", "b": [0.4834, 0.8317, 0.5997, 0.8514]}, {"w": "2D", "b": [0.606, 0.8317, 0.6368, 0.8514]}, {"w": "convnet", "b": [0.6431, 0.8317, 0.723, 0.8514]}, {"w": "for", "b": [0.7293, 0.8317, 0.7587, 0.8514]}, {"w": "feature", "b": [0.765, 0.8317, 0.835, 0.8514]}, {"w": "extraction", "b": [0.1799, 0.8522, 0.2807, 0.8719]}, {"w": "followed", "b": [0.287, 0.8522, 0.3767, 0.8719]}, {"w": "by", "b": [0.383, 0.8522, 0.4082, 0.8719]}, {"w": "either", "b": [0.4145, 0.8522, 0.472, 0.8719]}, {"w": "an", "b": [0.4783, 0.8522, 0.5021, 0.8719]}, {"w": "RNN", "b": [0.5084, 0.8522, 0.5616, 0.8719]}, {"w": "or", "b": [0.568, 0.8522, 0.589, 0.8719]}, {"w": "a", "b": [0.5953, 0.8522, 0.6065, 0.8719]}, {"w": "1D", "b": [0.6128, 0.8522, 0.6436, 0.8719]}, {"w": "convnet", "b": [0.6499, 0.8522, 0.7298, 0.8719]}, {"w": "to", "b": [0.7361, 0.8522, 0.7557, 0.8719]}, {"w": "process", "b": [0.762, 0.8522, 0.8377, 0.8719]}, {"w": "the", "b": [0.1799, 0.8727, 0.2107, 0.8924]}, {"w": "resulting", "b": [0.217, 0.8727, 0.3053, 0.8924]}, {"w": "sequences.", "b": [0.3116, 0.8727, 0.4202, 0.8924]}, {"w": "Volumetric", "b": [0.1799, 0.8932, 0.2934, 0.9129]}, {"w": "data—", "b": [0.2997, 0.8932, 0.3698, 0.9129]}, {"w": "3D", "b": [0.3761, 0.8932, 0.4069, 0.9129]}, {"w": "convnets.", "b": [0.4132, 0.8932, 0.5092, 0.9129]}]}]}, {"page": 418, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Now, let’s quickly review the specificities of each network architecture.", "words": [{"w": "Now,", "b": [0.1294, 0.0857, 0.1831, 0.1054]}, {"w": "let’s", "b": [0.1894, 0.0857, 0.2315, 0.1054]}, {"w": "quickly", "b": [0.2378, 0.0857, 0.3135, 0.1054]}, {"w": "review", "b": [0.3198, 0.0857, 0.3884, 0.1054]}, {"w": "the", "b": [0.3947, 0.0857, 0.4255, 0.1054]}, {"w": "specificities", "b": [0.4318, 0.0857, 0.5523, 0.1054]}, {"w": "of", "b": [0.5586, 0.0857, 0.5797, 0.1054]}, {"w": "each", "b": [0.586, 0.0857, 0.6322, 0.1054]}, {"w": "network", "b": [0.6385, 0.0857, 0.7212, 0.1054]}, {"w": "architecture.", "b": [0.7275, 0.0857, 0.8528, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Densely connected networks", "words": [{"w": "Densely", "b": [0.1294, 0.1235, 0.1925, 0.1383]}, {"w": "connected", "b": [0.1972, 0.1235, 0.2781, 0.1383]}, {"w": "networks", "b": [0.2828, 0.1235, 0.3575, 0.1383]}]}, {"id": "b_2", "type": "paragraph", "text": "A densely connected network is a stack of Dense layers, meant to process vector data (batches of vectors). Such networks assume no specific structure in the input features: they’re called densely connected because the units of a Dense layer are connected to every other unit. The layer attempts to map relationships between any two input features; this is unlike a 2D convolution layer, for instance, which only looks at local relationships.", "words": [{"w": "A", "b": [0.1294, 0.1614, 0.1476, 0.1812]}, {"w": "densely", "b": [0.1539, 0.1614, 0.231, 0.1812]}, {"w": "connected", "b": [0.2373, 0.1614, 0.3396, 0.1812]}, {"w": "network", "b": [0.3459, 0.1614, 0.4285, 0.1812]}, {"w": "is", "b": [0.4348, 0.1614, 0.4517, 0.1812]}, {"w": "a", "b": [0.458, 0.1614, 0.4692, 0.1812]}, {"w": "stack", "b": [0.4755, 0.1614, 0.5273, 0.1812]}, {"w": "of", "b": [0.5336, 0.1614, 0.5546, 0.1812]}, {"w": "Dense", "b": [0.5609, 0.1625, 0.6366, 0.1827]}, {"w": "layers,", "b": [0.6429, 0.1614, 0.7094, 0.1812]}, {"w": "meant", "b": [0.7157, 0.1614, 0.7774, 0.1812]}, {"w": "to", "b": [0.7837, 0.1614, 0.8033, 0.1812]}, {"w": "process", "b": [0.1294, 0.1828, 0.2051, 0.2026]}, {"w": "vector", "b": [0.2114, 0.1828, 0.2744, 0.2026]}, {"w": "data", "b": [0.2807, 0.1828, 0.3227, 0.2026]}, {"w": "(batches", "b": [0.329, 0.1828, 0.4131, 0.2026]}, {"w": "of", "b": [0.4194, 0.1828, 0.4404, 0.2026]}, {"w": "vectors).", "b": [0.4467, 0.1828, 0.5343, 0.2026]}, {"w": "Such", "b": [0.5406, 0.1828, 0.591, 0.2026]}, {"w": "networks", "b": [0.5973, 0.1828, 0.6898, 0.2026]}, {"w": "assume", "b": [0.6961, 0.1828, 0.7704, 0.2026]}, {"w": "no", "b": [0.7767, 0.1828, 0.8019, 0.2026]}, {"w": "specific", "b": [0.1294, 0.2033, 0.2079, 0.2231]}, {"w": "structure", "b": [0.2142, 0.2033, 0.3024, 0.2231]}, {"w": "in", "b": [0.3087, 0.2033, 0.3284, 0.2231]}, {"w": "the", "b": [0.3347, 0.2033, 0.3655, 0.2231]}, {"w": "input", "b": [0.3718, 0.2033, 0.4237, 0.2231]}, {"w": "features:", "b": [0.43, 0.2033, 0.5168, 0.2231]}, {"w": "they’re", "b": [0.5231, 0.2033, 0.5945, 0.2231]}, {"w": "called", "b": [0.6008, 0.2033, 0.6611, 0.2231]}, {"w": "densely", "b": [0.6673, 0.2033, 0.743, 0.2231]}, {"w": "connected", "b": [0.7493, 0.2033, 0.8516, 0.2231]}, {"w": "because", "b": [0.1294, 0.2238, 0.2093, 0.2436]}, {"w": "the", "b": [0.2156, 0.2238, 0.2464, 0.2436]}, {"w": "units", "b": [0.2527, 0.2238, 0.3018, 0.2436]}, {"w": "of", "b": [0.3081, 0.2238, 0.3291, 0.2436]}, {"w": "a", "b": [0.3354, 0.2238, 0.3466, 0.2436]}, {"w": "Dense", "b": [0.3529, 0.2249, 0.4285, 0.2451]}, {"w": "layer", "b": [0.4348, 0.2238, 0.4853, 0.2436]}, {"w": "are", "b": [0.4916, 0.2238, 0.5224, 0.2436]}, {"w": "connected", "b": [0.5287, 0.2238, 0.6309, 0.2436]}, {"w": "to", "b": [0.6373, 0.2238, 0.6569, 0.2436]}, {"w": "every", "b": [0.6632, 0.2238, 0.7192, 0.2436]}, {"w": "other", "b": [0.7255, 0.2238, 0.7774, 0.2436]}, {"w": "unit.", "b": [0.7837, 0.2238, 0.8292, 0.2436]}, {"w": "The", "b": [0.1294, 0.2452, 0.1686, 0.265]}, {"w": "layer", "b": [0.1749, 0.2452, 0.2254, 0.265]}, {"w": "attempts", "b": [0.2317, 0.2452, 0.3172, 0.265]}, {"w": "to", "b": [0.3235, 0.2452, 0.3431, 0.265]}, {"w": "map", "b": [0.3494, 0.2452, 0.3928, 0.265]}, {"w": "relationships", "b": [0.3992, 0.2452, 0.5281, 0.265]}, {"w": "between", "b": [0.5344, 0.2452, 0.6184, 0.265]}, {"w": "any", "b": [0.6247, 0.2452, 0.6612, 0.265]}, {"w": "two", "b": [0.6675, 0.2452, 0.7053, 0.265]}, {"w": "input", "b": [0.7116, 0.2452, 0.7635, 0.265]}, {"w": "features;", "b": [0.7698, 0.2452, 0.8566, 0.265]}, {"w": "this", "b": [0.1294, 0.2657, 0.1659, 0.2855]}, {"w": "is", "b": [0.1722, 0.2657, 0.189, 0.2855]}, {"w": "unlike", "b": [0.1953, 0.2657, 0.2584, 0.2855]}, {"w": "a", "b": [0.2647, 0.2657, 0.2759, 0.2855]}, {"w": "2D", "b": [0.2822, 0.2657, 0.313, 0.2855]}, {"w": "convolution", "b": [0.3193, 0.2657, 0.4398, 0.2855]}, {"w": "layer,", "b": [0.4461, 0.2657, 0.5018, 0.2855]}, {"w": "for", "b": [0.5081, 0.2657, 0.5375, 0.2855]}, {"w": "instance,", "b": [0.5438, 0.2657, 0.6328, 0.2855]}, {"w": "which", "b": [0.6391, 0.2657, 0.7008, 0.2855]}, {"w": "only", "b": [0.7071, 0.2657, 0.7519, 0.2855]}, {"w": "looks", "b": [0.7582, 0.2657, 0.8129, 0.2855]}, {"w": "at", "b": [0.8192, 0.2657, 0.8374, 0.2855]}, {"w": "local", "b": [0.1294, 0.2862, 0.1799, 0.306]}, {"w": "relationships.", "b": [0.1862, 0.2862, 0.3214, 0.306]}]}, {"id": "b_3", "type": "paragraph", "text": "Densely connected networks are most commonly used for categorical data (for example, where the input features are lists of attributes), such as the Boston Housing Price dataset used in chapter 3. They’re also used as the final classification or regression stage of most networks. For instance, the convnets covered in chapter 5 typically end with one or two Dense layers, and so do the recurrent networks in chapter 6.", "words": [{"w": "Densely", "b": [0.1294, 0.329, 0.2121, 0.3487]}, {"w": "connected", "b": [0.2184, 0.329, 0.3206, 0.3487]}, {"w": "networks", "b": [0.327, 0.329, 0.4194, 0.3487]}, {"w": "are", "b": [0.4257, 0.329, 0.4565, 0.3487]}, {"w": "most", "b": [0.4628, 0.329, 0.5119, 0.3487]}, {"w": "commonly", "b": [0.5182, 0.329, 0.6261, 0.3487]}, {"w": "used", "b": [0.6324, 0.329, 0.6787, 0.3487]}, {"w": "for", "b": [0.685, 0.329, 0.7144, 0.3487]}, {"w": "categorical", "b": [0.7207, 0.329, 0.8314, 0.3487]}, {"w": "data", "b": [0.1294, 0.3495, 0.1714, 0.3692]}, {"w": "(for", "b": [0.1777, 0.3495, 0.2156, 0.3692]}, {"w": "example,", "b": [0.2219, 0.3495, 0.3136, 0.3692]}, {"w": "where", "b": [0.3199, 0.3495, 0.3816, 0.3692]}, {"w": "the", "b": [0.3879, 0.3495, 0.4187, 0.3692]}, {"w": "input", "b": [0.425, 0.3495, 0.4769, 0.3692]}, {"w": "features", "b": [0.4832, 0.3495, 0.563, 0.3692]}, {"w": "are", "b": [0.5693, 0.3495, 0.6001, 0.3692]}, {"w": "lists", "b": [0.6064, 0.3495, 0.6471, 0.3692]}, {"w": "of", "b": [0.6534, 0.3495, 0.6744, 0.3692]}, {"w": "attributes),", "b": [0.6806, 0.3495, 0.7892, 0.3692]}, {"w": "such", "b": [0.7955, 0.3495, 0.8418, 0.3692]}, {"w": "as", "b": [0.8481, 0.3495, 0.8691, 0.3692]}, {"w": "the", "b": [0.1294, 0.37, 0.1602, 0.3897]}, {"w": "Boston", "b": [0.1665, 0.37, 0.238, 0.3897]}, {"w": "Housing", "b": [0.2443, 0.37, 0.3298, 0.3897]}, {"w": "Price", "b": [0.3361, 0.37, 0.388, 0.3897]}, {"w": "dataset", "b": [0.3943, 0.37, 0.4643, 0.3897]}, {"w": "used", "b": [0.4706, 0.37, 0.5169, 0.3897]}, {"w": "in", "b": [0.5232, 0.37, 0.5428, 0.3897]}, {"w": "chapter", "b": [0.5491, 0.37, 0.6233, 0.3897]}, {"w": "3.", "b": [0.6296, 0.37, 0.6485, 0.3897]}, {"w": "They’re", "b": [0.6548, 0.37, 0.7347, 0.3897]}, {"w": "also", "b": [0.741, 0.37, 0.7816, 0.3897]}, {"w": "used", "b": [0.7879, 0.37, 0.8342, 0.3897]}, {"w": "as", "b": [0.8405, 0.37, 0.8615, 0.3897]}, {"w": "the", "b": [0.1294, 0.3905, 0.1602, 0.4102]}, {"w": "final", "b": [0.1665, 0.3905, 0.2128, 0.4102]}, {"w": "classification", "b": [0.2191, 0.3905, 0.3522, 0.4102]}, {"w": "or", "b": [0.3585, 0.3905, 0.3795, 0.4102]}, {"w": "regression", "b": [0.3858, 0.3905, 0.4895, 0.4102]}, {"w": "stage", "b": [0.4958, 0.3905, 0.5477, 0.4102]}, {"w": "of", "b": [0.554, 0.3905, 0.575, 0.4102]}, {"w": "most", "b": [0.5813, 0.3905, 0.6303, 0.4102]}, {"w": "networks.", "b": [0.6367, 0.3905, 0.7354, 0.4102]}, {"w": "For", "b": [0.7417, 0.3905, 0.7768, 0.4102]}, {"w": "instance,", "b": [0.1294, 0.411, 0.2184, 0.4307]}, {"w": "the", "b": [0.2247, 0.411, 0.2555, 0.4307]}, {"w": "convnets", "b": [0.2618, 0.411, 0.3515, 0.4307]}, {"w": "covered", "b": [0.3578, 0.411, 0.4376, 0.4307]}, {"w": "in", "b": [0.444, 0.411, 0.4636, 0.4307]}, {"w": "chapter", "b": [0.4698, 0.411, 0.5441, 0.4307]}, {"w": "5", "b": [0.5504, 0.411, 0.563, 0.4307]}, {"w": "typically", "b": [0.5693, 0.411, 0.6576, 0.4307]}, {"w": "end", "b": [0.6639, 0.411, 0.7003, 0.4307]}, {"w": "with", "b": [0.7066, 0.411, 0.7514, 0.4307]}, {"w": "one", "b": [0.7578, 0.411, 0.7942, 0.4307]}, {"w": "or", "b": [0.8005, 0.411, 0.8215, 0.4307]}, {"w": "two", "b": [0.8278, 0.411, 0.8656, 0.4307]}, {"w": "Dense", "b": [0.1294, 0.4326, 0.2051, 0.4527]}, {"w": "layers,", "b": [0.2114, 0.4315, 0.2779, 0.4512]}, {"w": "and", "b": [0.2842, 0.4315, 0.3207, 0.4512]}, {"w": "so", "b": [0.327, 0.4315, 0.3494, 0.4512]}, {"w": "do", "b": [0.3557, 0.4315, 0.3809, 0.4512]}, {"w": "the", "b": [0.3872, 0.4315, 0.4181, 0.4512]}, {"w": "recurrent", "b": [0.4244, 0.4315, 0.5154, 0.4512]}, {"w": "networks", "b": [0.5217, 0.4315, 0.6142, 0.4512]}, {"w": "in", "b": [0.6205, 0.4315, 0.6401, 0.4512]}, {"w": "chapter", "b": [0.6464, 0.4315, 0.7206, 0.4512]}, {"w": "6.", "b": [0.7269, 0.4315, 0.7458, 0.4512]}]}, {"id": "b_4", "type": "paragraph", "text": "Remember: to perform binary classification, end your stack of layers with a Dense layer with a single unit and a sigmoid activation, and use binary_crossentropy as the loss. Your targets should be either 0 or 1:", "words": [{"w": "Remember:", "b": [0.1294, 0.4752, 0.2471, 0.4949]}, {"w": "to", "b": [0.2534, 0.4752, 0.273, 0.4949]}, {"w": "perform", "b": [0.2794, 0.4752, 0.3606, 0.4949]}, {"w": "binary", "b": [0.3669, 0.4752, 0.4327, 0.4949]}, {"w": "classification,", "b": [0.439, 0.4752, 0.5799, 0.4949]}, {"w": "end", "b": [0.5862, 0.4752, 0.6226, 0.4949]}, {"w": "your", "b": [0.6289, 0.4752, 0.6751, 0.4949]}, {"w": "stack", "b": [0.6815, 0.4752, 0.7333, 0.4949]}, {"w": "of", "b": [0.7396, 0.4752, 0.7606, 0.4949]}, {"w": "layers", "b": [0.7669, 0.4752, 0.8272, 0.4949]}, {"w": "with", "b": [0.1294, 0.4957, 0.1743, 0.5154]}, {"w": "a", "b": [0.1806, 0.4957, 0.1918, 0.5154]}, {"w": "Dense", "b": [0.1981, 0.4967, 0.2737, 0.5169]}, {"w": "layer", "b": [0.28, 0.4957, 0.3305, 0.5154]}, {"w": "with", "b": [0.3368, 0.4957, 0.3816, 0.5154]}, {"w": "a", "b": [0.3879, 0.4957, 0.3991, 0.5154]}, {"w": "single", "b": [0.4054, 0.4957, 0.4657, 0.5154]}, {"w": "unit", "b": [0.472, 0.4957, 0.5113, 0.5154]}, {"w": "and", "b": [0.5176, 0.4957, 0.554, 0.5154]}, {"w": "a", "b": [0.5603, 0.4957, 0.5715, 0.5154]}, {"w": "sigmoid", "b": [0.5777, 0.4967, 0.6837, 0.5169]}, {"w": "activation,", "b": [0.69, 0.4957, 0.7958, 0.5154]}, {"w": "and", "b": [0.8021, 0.4957, 0.8385, 0.5154]}, {"w": "use", "b": [0.1294, 0.5171, 0.163, 0.5368]}, {"w": "binary_crossentropy", "b": [0.1693, 0.5181, 0.4569, 0.5383]}, {"w": "as", "b": [0.4633, 0.5171, 0.4843, 0.5368]}, {"w": "the", "b": [0.4906, 0.5171, 0.5214, 0.5368]}, {"w": "loss.", "b": [0.5277, 0.5171, 0.5733, 0.5368]}, {"w": "Your", "b": [0.5796, 0.5171, 0.6289, 0.5368]}, {"w": "targets", "b": [0.6352, 0.5171, 0.702, 0.5368]}, {"w": "should", "b": [0.7083, 0.5171, 0.7756, 0.5368]}, {"w": "be", "b": [0.7819, 0.5171, 0.8057, 0.5368]}, {"w": "either", "b": [0.812, 0.5171, 0.8694, 0.5368]}, {"w": "0", "b": [0.1294, 0.5385, 0.142, 0.5582]}, {"w": "or", "b": [0.1483, 0.5385, 0.1693, 0.5582]}, {"w": "1:", "b": [0.1757, 0.5385, 0.1953, 0.5582]}]}, {"id": "b_5", "type": "paragraph", "text": "from keras import models from keras import layers model = models.Sequential() model.add(layers.Dense(32, activation='relu', input_shape= (num_input_features,))) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy')", "words": [{"w": "from", "b": [0.1357, 0.5762, 0.1811, 0.5913]}, {"w": "keras", "b": [0.1925, 0.5762, 0.2492, 0.5913]}, {"w": "import", "b": [0.2606, 0.5762, 0.3287, 0.5913]}, {"w": "models", "b": [0.34, 0.5762, 0.4082, 0.5913]}, {"w": "from", "b": [0.1357, 0.5914, 0.1811, 0.6065]}, {"w": "keras", "b": [0.1925, 0.5914, 0.2492, 0.6065]}, {"w": "import", "b": [0.2606, 0.5914, 0.3287, 0.6065]}, {"w": "layers", "b": [0.34, 0.5914, 0.4082, 0.6065]}, {"w": "model", "b": [0.1357, 0.6217, 0.1925, 0.6368]}, {"w": "=", "b": [0.2038, 0.6217, 0.2152, 0.6368]}, {"w": "models.Sequential()", "b": [0.2265, 0.6217, 0.4422, 0.6368]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.6368, 0.4309, 0.652]}, {"w": "activation='relu',", "b": [0.4422, 0.6368, 0.6465, 0.652]}, {"w": "input_shape=", "b": [0.6579, 0.6368, 0.7941, 0.652]}, {"w": "(num_input_features,)))", "b": [0.1357, 0.652, 0.3968, 0.6671]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.6671, 0.4309, 0.6823]}, {"w": "activation='relu'))", "b": [0.4422, 0.6671, 0.6579, 0.6823]}, {"w": "model.add(layers.Dense(1,", "b": [0.1357, 0.6823, 0.4195, 0.6974]}, {"w": "activation='sigmoid'))", "b": [0.4309, 0.6823, 0.6806, 0.6974]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.7126, 0.5217, 0.7277]}, {"w": "loss='binary_crossentropy')", "b": [0.533, 0.7126, 0.8395, 0.7277]}]}, {"id": "b_6", "type": "paragraph", "text": "To perform single-label categorical classification (where each sample has exactly one class, no more), end your stack of layers with a Dense layer with a number of units equal to the number of classes, and a softmax activation. If your targets are one-hot encoded, use categorical_crossentropy as the loss; if they’re integers, use sparse_categorical_crossentropy:", "words": [{"w": "To", "b": [0.1294, 0.7506, 0.1557, 0.7703]}, {"w": "perform", "b": [0.162, 0.7506, 0.2432, 0.7703]}, {"w": "single-label", "b": [0.2495, 0.7506, 0.3686, 0.7703]}, {"w": "categorical", "b": [0.375, 0.7506, 0.4899, 0.7703]}, {"w": "classification", "b": [0.4962, 0.7506, 0.6307, 0.7703]}, {"w": "(where", "b": [0.6369, 0.7506, 0.707, 0.7703]}, {"w": "each", "b": [0.7133, 0.7506, 0.7595, 0.7703]}, {"w": "sample", "b": [0.7658, 0.7506, 0.8373, 0.7703]}, {"w": "has", "b": [0.1294, 0.7711, 0.163, 0.7908]}, {"w": "exactly", "b": [0.1693, 0.7711, 0.2422, 0.7908]}, {"w": "one", "b": [0.2485, 0.7711, 0.2849, 0.7908]}, {"w": "class,", "b": [0.2912, 0.7711, 0.3466, 0.7908]}, {"w": "no", "b": [0.3529, 0.7711, 0.3781, 0.7908]}, {"w": "more),", "b": [0.3844, 0.7711, 0.451, 0.7908]}, {"w": "end", "b": [0.4573, 0.7711, 0.4937, 0.7908]}, {"w": "your", "b": [0.5, 0.7711, 0.5462, 0.7908]}, {"w": "stack", "b": [0.5525, 0.7711, 0.6044, 0.7908]}, {"w": "of", "b": [0.6107, 0.7711, 0.6317, 0.7908]}, {"w": "layers", "b": [0.638, 0.7711, 0.6983, 0.7908]}, {"w": "with", "b": [0.7046, 0.7711, 0.7494, 0.7908]}, {"w": "a", "b": [0.7557, 0.7711, 0.7669, 0.7908]}, {"w": "Dense", "b": [0.7732, 0.7721, 0.8488, 0.7923]}, {"w": "layer", "b": [0.1294, 0.7925, 0.1798, 0.8122]}, {"w": "with", "b": [0.1861, 0.7925, 0.231, 0.8122]}, {"w": "a", "b": [0.2373, 0.7925, 0.2485, 0.8122]}, {"w": "number", "b": [0.2548, 0.7925, 0.3319, 0.8122]}, {"w": "of", "b": [0.3382, 0.7925, 0.3592, 0.8122]}, {"w": "units", "b": [0.3655, 0.7925, 0.4146, 0.8122]}, {"w": "equal", "b": [0.4209, 0.7925, 0.4755, 0.8122]}, {"w": "to", "b": [0.4818, 0.7925, 0.5014, 0.8122]}, {"w": "the", "b": [0.5077, 0.7925, 0.5386, 0.8122]}, {"w": "number", "b": [0.5449, 0.7925, 0.6219, 0.8122]}, {"w": "of", "b": [0.6283, 0.7925, 0.6493, 0.8122]}, {"w": "classes,", "b": [0.6556, 0.7925, 0.7319, 0.8122]}, {"w": "and", "b": [0.7382, 0.7925, 0.7747, 0.8122]}, {"w": "a", "b": [0.781, 0.7925, 0.7922, 0.8122]}, {"w": "softmax", "b": [0.1294, 0.814, 0.2354, 0.8342]}, {"w": "activation.", "b": [0.2417, 0.813, 0.3475, 0.8327]}, {"w": "If", "b": [0.3538, 0.813, 0.3706, 0.8327]}, {"w": "your", "b": [0.3769, 0.813, 0.4231, 0.8327]}, {"w": "targets", "b": [0.4294, 0.813, 0.4962, 0.8327]}, {"w": "are", "b": [0.5025, 0.813, 0.5333, 0.8327]}, {"w": "one-hot", "b": [0.5396, 0.813, 0.6167, 0.8327]}, {"w": "encoded,", "b": [0.623, 0.813, 0.7133, 0.8327]}, {"w": "use", "b": [0.7196, 0.813, 0.7533, 0.8327]}, {"w": "categorical_crossentropy", "b": [0.1294, 0.8354, 0.4927, 0.8556]}, {"w": "as", "b": [0.499, 0.8344, 0.52, 0.8541]}, {"w": "the", "b": [0.5263, 0.8344, 0.5572, 0.8541]}, {"w": "loss;", "b": [0.5635, 0.8344, 0.6097, 0.8541]}, {"w": "if", "b": [0.6161, 0.8344, 0.6315, 0.8541]}, {"w": "they’re", "b": [0.6378, 0.8344, 0.7092, 0.8541]}, {"w": "integers,", "b": [0.7155, 0.8344, 0.8017, 0.8541]}, {"w": "use", "b": [0.808, 0.8344, 0.8416, 0.8541]}, {"w": "sparse_categorical_crossentropy:", "b": [0.1294, 0.8558, 0.6057, 0.877]}]}]}, {"page": 419, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(32, activation='relu', input_shape= (num_input_features,))) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(num_classes, activation='softmax')) model.compile(optimizer='rmsprop', loss='categorical_crossentropy')", "words": [{"w": "model", "b": [0.1357, 0.0851, 0.1925, 0.1002]}, {"w": "=", "b": [0.2038, 0.0851, 0.2152, 0.1002]}, {"w": "models.Sequential()", "b": [0.2265, 0.0851, 0.4422, 0.1002]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.1002, 0.4309, 0.1154]}, {"w": "activation='relu',", "b": [0.4422, 0.1002, 0.6465, 0.1154]}, {"w": "input_shape=", "b": [0.6579, 0.1002, 0.7941, 0.1154]}, {"w": "(num_input_features,)))", "b": [0.1357, 0.1154, 0.3968, 0.1305]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.1305, 0.4309, 0.1457]}, {"w": "activation='relu'))", "b": [0.4422, 0.1305, 0.6579, 0.1457]}, {"w": "model.add(layers.Dense(num_classes,", "b": [0.1357, 0.1457, 0.533, 0.1608]}, {"w": "activation='softmax'))", "b": [0.5444, 0.1457, 0.7941, 0.1608]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.176, 0.5217, 0.1911]}, {"w": "loss='categorical_crossentropy')", "b": [0.1357, 0.1912, 0.499, 0.2063]}]}, {"id": "b_1", "type": "paragraph", "text": "To perform multilabel categorical classification (where each sample can have several classes), end your stack of layers with a Dense layer with a number of units equal to the number of classes and a sigmoid activation, and use binary_crossentropy as the loss. Your targets should be k-hot encoded:", "words": [{"w": "To", "b": [0.1294, 0.2292, 0.1557, 0.2489]}, {"w": "perform", "b": [0.162, 0.2292, 0.2432, 0.2489]}, {"w": "multilabel", "b": [0.2495, 0.2292, 0.3518, 0.2489]}, {"w": "categorical", "b": [0.3582, 0.2292, 0.4731, 0.2489]}, {"w": "classification", "b": [0.4794, 0.2292, 0.6139, 0.2489]}, {"w": "(where", "b": [0.6202, 0.2292, 0.6902, 0.2489]}, {"w": "each", "b": [0.6965, 0.2292, 0.7427, 0.2489]}, {"w": "sample", "b": [0.749, 0.2292, 0.8205, 0.2489]}, {"w": "can", "b": [0.8268, 0.2292, 0.8618, 0.2489]}, {"w": "have", "b": [0.1294, 0.2497, 0.177, 0.2694]}, {"w": "several", "b": [0.1833, 0.2497, 0.2548, 0.2694]}, {"w": "classes),", "b": [0.2611, 0.2497, 0.3458, 0.2694]}, {"w": "end", "b": [0.3522, 0.2497, 0.3886, 0.2694]}, {"w": "your", "b": [0.3949, 0.2497, 0.4411, 0.2694]}, {"w": "stack", "b": [0.4474, 0.2497, 0.4993, 0.2694]}, {"w": "of", "b": [0.5056, 0.2497, 0.5266, 0.2694]}, {"w": "layers", "b": [0.5329, 0.2497, 0.5931, 0.2694]}, {"w": "with", "b": [0.5994, 0.2497, 0.6443, 0.2694]}, {"w": "a", "b": [0.6506, 0.2497, 0.6618, 0.2694]}, {"w": "Dense", "b": [0.668, 0.2507, 0.7437, 0.2709]}, {"w": "layer", "b": [0.75, 0.2497, 0.8005, 0.2694]}, {"w": "with", "b": [0.8068, 0.2497, 0.8516, 0.2694]}, {"w": "a", "b": [0.8579, 0.2497, 0.8691, 0.2694]}, {"w": "number", "b": [0.1294, 0.2711, 0.2065, 0.2908]}, {"w": "of", "b": [0.2128, 0.2711, 0.2338, 0.2908]}, {"w": "units", "b": [0.2401, 0.2711, 0.2892, 0.2908]}, {"w": "equal", "b": [0.2955, 0.2711, 0.3501, 0.2908]}, {"w": "to", "b": [0.3564, 0.2711, 0.376, 0.2908]}, {"w": "the", "b": [0.3824, 0.2711, 0.4132, 0.2908]}, {"w": "number", "b": [0.4195, 0.2711, 0.4965, 0.2908]}, {"w": "of", "b": [0.5029, 0.2711, 0.5239, 0.2908]}, {"w": "classes", "b": [0.5302, 0.2711, 0.6002, 0.2908]}, {"w": "and", "b": [0.6065, 0.2711, 0.643, 0.2908]}, {"w": "a", "b": [0.6493, 0.2711, 0.6605, 0.2908]}, {"w": "sigmoid", "b": [0.6667, 0.2721, 0.7726, 0.2923]}, {"w": "activation,", "b": [0.1294, 0.2925, 0.2352, 0.3122]}, {"w": "and", "b": [0.2415, 0.2925, 0.2779, 0.3122]}, {"w": "use", "b": [0.2842, 0.2925, 0.3179, 0.3122]}, {"w": "binary_crossentropy", "b": [0.3241, 0.2935, 0.6117, 0.3137]}, {"w": "as", "b": [0.6181, 0.2925, 0.6391, 0.3122]}, {"w": "the", "b": [0.6454, 0.2925, 0.6762, 0.3122]}, {"w": "loss.", "b": [0.6825, 0.2925, 0.7281, 0.3122]}, {"w": "Your", "b": [0.7344, 0.2925, 0.7837, 0.3122]}, {"w": "targets", "b": [0.79, 0.2925, 0.8568, 0.3122]}, {"w": "should", "b": [0.1294, 0.3139, 0.1967, 0.3336]}, {"w": "be", "b": [0.203, 0.3139, 0.2268, 0.3336]}, {"w": "k-hot", "b": [0.2331, 0.3139, 0.2864, 0.3336]}, {"w": "encoded:", "b": [0.2927, 0.3139, 0.3837, 0.3336]}]}, {"id": "b_2", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(32, activation='relu', input_shape= (num_input_features,))) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(num_classes, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy')", "words": [{"w": "model", "b": [0.1357, 0.3516, 0.1925, 0.3667]}, {"w": "=", "b": [0.2038, 0.3516, 0.2152, 0.3667]}, {"w": "models.Sequential()", "b": [0.2265, 0.3516, 0.4422, 0.3667]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.3667, 0.4309, 0.3819]}, {"w": "activation='relu',", "b": [0.4422, 0.3667, 0.6465, 0.3819]}, {"w": "input_shape=", "b": [0.6579, 0.3667, 0.7941, 0.3819]}, {"w": "(num_input_features,)))", "b": [0.1357, 0.3819, 0.3968, 0.397]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.397, 0.4309, 0.4122]}, {"w": "activation='relu'))", "b": [0.4422, 0.397, 0.6579, 0.4122]}, {"w": "model.add(layers.Dense(num_classes,", "b": [0.1357, 0.4122, 0.533, 0.4273]}, {"w": "activation='sigmoid'))", "b": [0.5444, 0.4122, 0.7941, 0.4273]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.4425, 0.5217, 0.4576]}, {"w": "loss='binary_crossentropy')", "b": [0.533, 0.4425, 0.8395, 0.4576]}]}, {"id": "b_3", "type": "paragraph", "text": "To perform regression toward a vector of continuous values, end your stack of layers with a Dense layer with a number of units equal to the number of values you’re trying to predict (often a single one, such as the price of a house), and no activation. Several losses can be used for regression, most commonly mean_squared_error (MSE) and mean_absolute_error (MAE):", "words": [{"w": "To", "b": [0.1294, 0.4805, 0.1557, 0.5003]}, {"w": "perform", "b": [0.162, 0.4805, 0.2432, 0.5003]}, {"w": "regression", "b": [0.2495, 0.4805, 0.3542, 0.5003]}, {"w": "toward", "b": [0.3605, 0.4805, 0.4305, 0.5003]}, {"w": "a", "b": [0.4368, 0.4805, 0.448, 0.5003]}, {"w": "vector", "b": [0.4543, 0.4805, 0.5174, 0.5003]}, {"w": "of", "b": [0.5237, 0.4805, 0.5447, 0.5003]}, {"w": "continuous", "b": [0.551, 0.4805, 0.6617, 0.5003]}, {"w": "values,", "b": [0.668, 0.4805, 0.7388, 0.5003]}, {"w": "end", "b": [0.7451, 0.4805, 0.7815, 0.5003]}, {"w": "your", "b": [0.7878, 0.4805, 0.8341, 0.5003]}, {"w": "stack", "b": [0.1294, 0.501, 0.1813, 0.5208]}, {"w": "of", "b": [0.1876, 0.501, 0.2086, 0.5208]}, {"w": "layers", "b": [0.2149, 0.501, 0.2751, 0.5208]}, {"w": "with", "b": [0.2814, 0.501, 0.3263, 0.5208]}, {"w": "a", "b": [0.3326, 0.501, 0.3438, 0.5208]}, {"w": "Dense", "b": [0.3501, 0.5021, 0.4257, 0.5223]}, {"w": "layer", "b": [0.432, 0.501, 0.4825, 0.5208]}, {"w": "with", "b": [0.4888, 0.501, 0.5336, 0.5208]}, {"w": "a", "b": [0.5399, 0.501, 0.5511, 0.5208]}, {"w": "number", "b": [0.5574, 0.501, 0.6345, 0.5208]}, {"w": "of", "b": [0.6408, 0.501, 0.6618, 0.5208]}, {"w": "units", "b": [0.6681, 0.501, 0.7172, 0.5208]}, {"w": "equal", "b": [0.7235, 0.501, 0.7781, 0.5208]}, {"w": "to", "b": [0.7844, 0.501, 0.8041, 0.5208]}, {"w": "the", "b": [0.8104, 0.501, 0.8412, 0.5208]}, {"w": "number", "b": [0.1294, 0.5224, 0.2065, 0.5422]}, {"w": "of", "b": [0.2128, 0.5224, 0.2338, 0.5422]}, {"w": "values", "b": [0.2401, 0.5224, 0.3046, 0.5422]}, {"w": "you’re", "b": [0.3109, 0.5224, 0.3767, 0.5422]}, {"w": "trying", "b": [0.383, 0.5224, 0.4433, 0.5422]}, {"w": "to", "b": [0.4496, 0.5224, 0.4692, 0.5422]}, {"w": "predict", "b": [0.4755, 0.5224, 0.5456, 0.5422]}, {"w": "(often", "b": [0.5519, 0.5224, 0.6121, 0.5422]}, {"w": "a", "b": [0.6184, 0.5224, 0.6296, 0.5422]}, {"w": "single", "b": [0.6359, 0.5224, 0.6962, 0.5422]}, {"w": "one,", "b": [0.7025, 0.5224, 0.7452, 0.5422]}, {"w": "such", "b": [0.7515, 0.5224, 0.7978, 0.5422]}, {"w": "as", "b": [0.8041, 0.5224, 0.8251, 0.5422]}, {"w": "the", "b": [0.8314, 0.5224, 0.8622, 0.5422]}, {"w": "price", "b": [0.1294, 0.5429, 0.1798, 0.5627]}, {"w": "of", "b": [0.1861, 0.5429, 0.2071, 0.5627]}, {"w": "a", "b": [0.2135, 0.5429, 0.2247, 0.5627]}, {"w": "house),", "b": [0.231, 0.5429, 0.3045, 0.5627]}, {"w": "and", "b": [0.3108, 0.5429, 0.3472, 0.5627]}, {"w": "no", "b": [0.3536, 0.5429, 0.3788, 0.5627]}, {"w": "activation.", "b": [0.3851, 0.5429, 0.4909, 0.5627]}, {"w": "Several", "b": [0.4972, 0.5429, 0.5728, 0.5627]}, {"w": "losses", "b": [0.5791, 0.5429, 0.6394, 0.5627]}, {"w": "can", "b": [0.6457, 0.5429, 0.6807, 0.5627]}, {"w": "be", "b": [0.687, 0.5429, 0.7109, 0.5627]}, {"w": "used", "b": [0.7172, 0.5429, 0.7634, 0.5627]}, {"w": "for", "b": [0.7697, 0.5429, 0.7991, 0.5627]}, {"w": "regression,", "b": [0.1294, 0.5634, 0.2394, 0.5832]}, {"w": "most", "b": [0.2457, 0.5634, 0.2948, 0.5832]}, {"w": "commonly", "b": [0.3011, 0.5634, 0.409, 0.5832]}, {"w": "mean_squared_error", "b": [0.4153, 0.5645, 0.6877, 0.5847]}, {"w": "(MSE)", "b": [0.6941, 0.5634, 0.7627, 0.5832]}, {"w": "and", "b": [0.769, 0.5634, 0.8055, 0.5832]}, {"w": "mean_absolute_error", "b": [0.1294, 0.5859, 0.417, 0.6061]}, {"w": "(MAE):", "b": [0.4233, 0.5848, 0.5032, 0.6046]}]}, {"id": "b_4", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.Dense(32, activation='relu', input_shape= (num_input_features,))) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(num_values)) model.compile(optimizer='rmsprop', loss='mse')", "words": [{"w": "model", "b": [0.1357, 0.6234, 0.1925, 0.6386]}, {"w": "=", "b": [0.2038, 0.6234, 0.2152, 0.6386]}, {"w": "models.Sequential()", "b": [0.2265, 0.6234, 0.4422, 0.6386]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.6386, 0.4309, 0.6537]}, {"w": "activation='relu',", "b": [0.4422, 0.6386, 0.6465, 0.6537]}, {"w": "input_shape=", "b": [0.6579, 0.6386, 0.7941, 0.6537]}, {"w": "(num_input_features,)))", "b": [0.1357, 0.6537, 0.3968, 0.6689]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.6689, 0.4309, 0.684]}, {"w": "activation='relu'))", "b": [0.4422, 0.6689, 0.6579, 0.684]}, {"w": "model.add(layers.Dense(num_values))", "b": [0.1357, 0.684, 0.533, 0.6992]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.7144, 0.5217, 0.7295]}, {"w": "loss='mse')", "b": [0.533, 0.7144, 0.6579, 0.7295]}]}, {"id": "b_5", "type": "paragraph", "text": "Convnets", "words": [{"w": "Convnets", "b": [0.1294, 0.743, 0.2051, 0.7578]}]}, {"id": "b_6", "type": "paragraph", "text": "Convolution layers look at spatially local patterns by applying the same geometric transformation to different spatial locations (patches) in an input tensor. This results in representations that are translation invariant, making convolution layers highly data efficient and modular. This idea is applicable to spaces of any dimensionality: 1D (sequences), 2D (images), 3D (volumes), and so on. You can use the Conv1D layer to", "words": [{"w": "Convolution", "b": [0.1294, 0.7809, 0.2556, 0.8006]}, {"w": "layers", "b": [0.2619, 0.7809, 0.3221, 0.8006]}, {"w": "look", "b": [0.3284, 0.7809, 0.3733, 0.8006]}, {"w": "at", "b": [0.3796, 0.7809, 0.3978, 0.8006]}, {"w": "spatially", "b": [0.4041, 0.7809, 0.4896, 0.8006]}, {"w": "local", "b": [0.4959, 0.7809, 0.5449, 0.8006]}, {"w": "patterns", "b": [0.5512, 0.7809, 0.6311, 0.8006]}, {"w": "by", "b": [0.6374, 0.7809, 0.6626, 0.8006]}, {"w": "applying", "b": [0.6689, 0.7809, 0.7572, 0.8006]}, {"w": "the", "b": [0.7635, 0.7809, 0.7944, 0.8006]}, {"w": "same", "b": [0.8007, 0.7809, 0.8525, 0.8006]}, {"w": "geometric", "b": [0.1294, 0.8014, 0.2303, 0.8211]}, {"w": "transformation", "b": [0.2366, 0.8014, 0.3851, 0.8211]}, {"w": "to", "b": [0.3914, 0.8014, 0.4111, 0.8211]}, {"w": "different", "b": [0.4174, 0.8014, 0.5037, 0.8211]}, {"w": "spatial", "b": [0.51, 0.8014, 0.5759, 0.8211]}, {"w": "locations", "b": [0.5822, 0.8014, 0.6733, 0.8211]}, {"w": "(patches)", "b": [0.6795, 0.8014, 0.7734, 0.8211]}, {"w": "in", "b": [0.7797, 0.8014, 0.7993, 0.8211]}, {"w": "an", "b": [0.8056, 0.8014, 0.8294, 0.8211]}, {"w": "input", "b": [0.1294, 0.8219, 0.1813, 0.8416]}, {"w": "tensor.", "b": [0.1876, 0.8219, 0.2541, 0.8416]}, {"w": "This", "b": [0.2604, 0.8219, 0.3053, 0.8416]}, {"w": "results", "b": [0.3116, 0.8219, 0.3775, 0.8416]}, {"w": "in", "b": [0.3838, 0.8219, 0.4034, 0.8416]}, {"w": "representations", "b": [0.4097, 0.8219, 0.5624, 0.8416]}, {"w": "that", "b": [0.5687, 0.8219, 0.6066, 0.8416]}, {"w": "are", "b": [0.6129, 0.8219, 0.6437, 0.8416]}, {"w": "translation", "b": [0.6499, 0.8219, 0.7607, 0.8416]}, {"w": "invariant,", "b": [0.767, 0.8219, 0.8657, 0.8416]}, {"w": "making", "b": [0.1294, 0.8424, 0.2051, 0.8621]}, {"w": "convolution", "b": [0.2114, 0.8424, 0.3319, 0.8621]}, {"w": "layers", "b": [0.3382, 0.8424, 0.3985, 0.8621]}, {"w": "highly", "b": [0.4048, 0.8424, 0.4693, 0.8621]}, {"w": "data", "b": [0.4756, 0.8424, 0.5176, 0.8621]}, {"w": "efficient", "b": [0.5239, 0.8424, 0.6074, 0.8621]}, {"w": "and", "b": [0.6137, 0.8424, 0.6502, 0.8621]}, {"w": "modular.", "b": [0.6565, 0.8424, 0.7454, 0.8621]}, {"w": "This", "b": [0.7517, 0.8424, 0.7966, 0.8621]}, {"w": "idea", "b": [0.8029, 0.8424, 0.8449, 0.8621]}, {"w": "is", "b": [0.8512, 0.8424, 0.868, 0.8621]}, {"w": "applicable", "b": [0.1294, 0.8629, 0.2331, 0.8826]}, {"w": "to", "b": [0.2394, 0.8629, 0.259, 0.8826]}, {"w": "spaces", "b": [0.2653, 0.8629, 0.3312, 0.8826]}, {"w": "of", "b": [0.3375, 0.8629, 0.3585, 0.8826]}, {"w": "any", "b": [0.3648, 0.8629, 0.4012, 0.8826]}, {"w": "dimensionality:", "b": [0.4075, 0.8629, 0.5645, 0.8826]}, {"w": "1D", "b": [0.5708, 0.8629, 0.6016, 0.8826]}, {"w": "(sequences),", "b": [0.6079, 0.8629, 0.7332, 0.8826]}, {"w": "2D", "b": [0.7396, 0.8629, 0.7704, 0.8826]}, {"w": "(images),", "b": [0.1294, 0.8834, 0.224, 0.9031]}, {"w": "3D", "b": [0.2303, 0.8834, 0.2611, 0.9031]}, {"w": "(volumes),", "b": [0.2674, 0.8834, 0.376, 0.9031]}, {"w": "and", "b": [0.3823, 0.8834, 0.4188, 0.9031]}, {"w": "so", "b": [0.4251, 0.8834, 0.4475, 0.9031]}, {"w": "on.", "b": [0.4538, 0.8834, 0.4853, 0.9031]}, {"w": "You", "b": [0.4916, 0.8834, 0.5325, 0.9031]}, {"w": "can", "b": [0.5388, 0.8834, 0.5739, 0.9031]}, {"w": "use", "b": [0.5802, 0.8834, 0.6138, 0.9031]}, {"w": "the", "b": [0.6201, 0.8834, 0.6509, 0.9031]}, {"w": "Conv1D", "b": [0.6572, 0.8844, 0.748, 0.9046]}, {"w": "layer", "b": [0.7543, 0.8834, 0.8047, 0.9031]}, {"w": "to", "b": [0.8111, 0.8834, 0.8307, 0.9031]}]}]}, {"page": 420, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "process sequences (especially text—it doesn’t work as well on timeseries, which often don’t follow the translation-invariance assumption), the Conv2D layer to process images, and the Conv3D layers to process volumes.", "words": [{"w": "process", "b": [0.1294, 0.0857, 0.2051, 0.1054]}, {"w": "sequences", "b": [0.2114, 0.0857, 0.3136, 0.1054]}, {"w": "(especially", "b": [0.3199, 0.0857, 0.4292, 0.1054]}, {"w": "text—it", "b": [0.4355, 0.0857, 0.5126, 0.1054]}, {"w": "doesn’t", "b": [0.5189, 0.0857, 0.5927, 0.1054]}, {"w": "work", "b": [0.599, 0.0857, 0.6508, 0.1054]}, {"w": "as", "b": [0.6571, 0.0857, 0.6781, 0.1054]}, {"w": "well", "b": [0.6845, 0.0857, 0.7279, 0.1054]}, {"w": "on", "b": [0.7342, 0.0857, 0.7594, 0.1054]}, {"w": "timeseries,", "b": [0.1294, 0.1062, 0.238, 0.1259]}, {"w": "which", "b": [0.2443, 0.1062, 0.306, 0.1259]}, {"w": "often", "b": [0.3123, 0.1062, 0.3641, 0.1259]}, {"w": "don’t", "b": [0.3704, 0.1062, 0.4232, 0.1259]}, {"w": "follow", "b": [0.4295, 0.1062, 0.4954, 0.1259]}, {"w": "the", "b": [0.5017, 0.1062, 0.5325, 0.1259]}, {"w": "translation-invariance", "b": [0.5388, 0.1062, 0.7588, 0.1259]}, {"w": "assumption),", "b": [0.1294, 0.1267, 0.259, 0.1464]}, {"w": "the", "b": [0.2654, 0.1267, 0.2962, 0.1464]}, {"w": "Conv2D", "b": [0.3025, 0.1277, 0.3933, 0.1479]}, {"w": "layer", "b": [0.3996, 0.1267, 0.45, 0.1464]}, {"w": "to", "b": [0.4563, 0.1267, 0.4759, 0.1464]}, {"w": "process", "b": [0.4822, 0.1267, 0.5579, 0.1464]}, {"w": "images,", "b": [0.5642, 0.1267, 0.642, 0.1464]}, {"w": "and", "b": [0.6483, 0.1267, 0.6847, 0.1464]}, {"w": "the", "b": [0.691, 0.1267, 0.7218, 0.1464]}, {"w": "Conv3D", "b": [0.7281, 0.1277, 0.8189, 0.1479]}, {"w": "layers", "b": [0.1294, 0.1481, 0.1897, 0.1678]}, {"w": "to", "b": [0.196, 0.1481, 0.2156, 0.1678]}, {"w": "process", "b": [0.2219, 0.1481, 0.2975, 0.1678]}, {"w": "volumes.", "b": [0.3038, 0.1481, 0.3956, 0.1678]}]}, {"id": "b_1", "type": "paragraph", "text": "Convnets, or convolutional networks, consist of stacks of convolution and max-pooling layers. The pooling layers let you spatially downsample the data, which is required to keep feature maps to a reasonable size as the number of features grows, and to allow subsequent convolution layers to “see” a greater spatial extent of the inputs. Convnets are often ended with either a Flatten operation or a global pooling layer, turning spatial feature maps into vectors, followed by Dense layers to achieve classification or regression.", "words": [{"w": "Convnets,", "b": [0.1294, 0.1909, 0.2296, 0.2106]}, {"w": "or", "b": [0.2359, 0.1909, 0.2569, 0.2106]}, {"w": "convolutional", "b": [0.2632, 0.1909, 0.4019, 0.2106]}, {"w": "networks,", "b": [0.4083, 0.1909, 0.5056, 0.2106]}, {"w": "consist", "b": [0.5119, 0.1909, 0.582, 0.2106]}, {"w": "of", "b": [0.5883, 0.1909, 0.6093, 0.2106]}, {"w": "stacks", "b": [0.6156, 0.1909, 0.6773, 0.2106]}, {"w": "of", "b": [0.6836, 0.1909, 0.7046, 0.2106]}, {"w": "convolution", "b": [0.7109, 0.1909, 0.8314, 0.2106]}, {"w": "and", "b": [0.1294, 0.2114, 0.1658, 0.2311]}, {"w": "max-pooling", "b": [0.1721, 0.2114, 0.3011, 0.2311]}, {"w": "layers.", "b": [0.3074, 0.2114, 0.3739, 0.2311]}, {"w": "The", "b": [0.3802, 0.2114, 0.4195, 0.2311]}, {"w": "pooling", "b": [0.4258, 0.2114, 0.5029, 0.2311]}, {"w": "layers", "b": [0.5092, 0.2114, 0.5694, 0.2311]}, {"w": "let", "b": [0.5757, 0.2114, 0.6009, 0.2311]}, {"w": "you", "b": [0.6072, 0.2114, 0.6451, 0.2311]}, {"w": "spatially", "b": [0.6514, 0.2114, 0.7369, 0.2311]}, {"w": "downsample", "b": [0.7432, 0.2114, 0.8707, 0.2311]}, {"w": "the", "b": [0.1294, 0.2319, 0.1602, 0.2516]}, {"w": "data,", "b": [0.1665, 0.2319, 0.2149, 0.2516]}, {"w": "which", "b": [0.2212, 0.2319, 0.2828, 0.2516]}, {"w": "is", "b": [0.2891, 0.2319, 0.3059, 0.2516]}, {"w": "required", "b": [0.3122, 0.2319, 0.3963, 0.2516]}, {"w": "to", "b": [0.4026, 0.2319, 0.4222, 0.2516]}, {"w": "keep", "b": [0.4285, 0.2319, 0.4762, 0.2516]}, {"w": "feature", "b": [0.4825, 0.2319, 0.5525, 0.2516]}, {"w": "maps", "b": [0.5588, 0.2319, 0.612, 0.2516]}, {"w": "to", "b": [0.6183, 0.2319, 0.638, 0.2516]}, {"w": "a", "b": [0.6443, 0.2319, 0.6555, 0.2516]}, {"w": "reasonable", "b": [0.6618, 0.2319, 0.7697, 0.2516]}, {"w": "size", "b": [0.776, 0.2319, 0.8152, 0.2516]}, {"w": "as", "b": [0.8215, 0.2319, 0.8425, 0.2516]}, {"w": "the", "b": [0.1294, 0.2524, 0.1602, 0.2721]}, {"w": "number", "b": [0.1665, 0.2524, 0.2436, 0.2721]}, {"w": "of", "b": [0.2499, 0.2524, 0.2709, 0.2721]}, {"w": "features", "b": [0.2772, 0.2524, 0.3571, 0.2721]}, {"w": "grows,", "b": [0.3634, 0.2524, 0.4313, 0.2721]}, {"w": "and", "b": [0.4376, 0.2524, 0.4741, 0.2721]}, {"w": "to", "b": [0.4804, 0.2524, 0.5, 0.2721]}, {"w": "allow", "b": [0.5063, 0.2524, 0.5624, 0.2721]}, {"w": "subsequent", "b": [0.5687, 0.2524, 0.6808, 0.2721]}, {"w": "convolution", "b": [0.6871, 0.2524, 0.8076, 0.2721]}, {"w": "layers", "b": [0.1294, 0.2729, 0.1897, 0.2926]}, {"w": "to", "b": [0.196, 0.2729, 0.2156, 0.2926]}, {"w": "“see”", "b": [0.2219, 0.2729, 0.2765, 0.2926]}, {"w": "a", "b": [0.2828, 0.2729, 0.294, 0.2926]}, {"w": "greater", "b": [0.3003, 0.2729, 0.3703, 0.2926]}, {"w": "spatial", "b": [0.3766, 0.2729, 0.4425, 0.2926]}, {"w": "extent", "b": [0.4488, 0.2729, 0.5105, 0.2926]}, {"w": "of", "b": [0.5168, 0.2729, 0.5378, 0.2926]}, {"w": "the", "b": [0.5441, 0.2729, 0.5749, 0.2926]}, {"w": "inputs.", "b": [0.5812, 0.2729, 0.6492, 0.2926]}, {"w": "Convnets", "b": [0.6555, 0.2729, 0.7508, 0.2926]}, {"w": "are", "b": [0.7571, 0.2729, 0.7879, 0.2926]}, {"w": "often", "b": [0.7942, 0.2729, 0.8461, 0.2926]}, {"w": "ended", "b": [0.1294, 0.2934, 0.1897, 0.3131]}, {"w": "with", "b": [0.196, 0.2934, 0.2408, 0.3131]}, {"w": "either", "b": [0.2471, 0.2934, 0.3046, 0.3131]}, {"w": "a", "b": [0.3109, 0.2934, 0.3221, 0.3131]}, {"w": "Flatten", "b": [0.3283, 0.2944, 0.4343, 0.3146]}, {"w": "operation", "b": [0.4406, 0.2934, 0.5359, 0.3131]}, {"w": "or", "b": [0.5422, 0.2934, 0.5632, 0.3131]}, {"w": "a", "b": [0.5695, 0.2934, 0.5807, 0.3131]}, {"w": "global", "b": [0.587, 0.2934, 0.6501, 0.3131]}, {"w": "pooling", "b": [0.6564, 0.2934, 0.7334, 0.3131]}, {"w": "layer,", "b": [0.7398, 0.2934, 0.7954, 0.3131]}, {"w": "turning", "b": [0.1294, 0.3147, 0.2023, 0.3345]}, {"w": "spatial", "b": [0.2086, 0.3147, 0.2745, 0.3345]}, {"w": "feature", "b": [0.2808, 0.3147, 0.3508, 0.3345]}, {"w": "maps", "b": [0.3571, 0.3147, 0.4104, 0.3345]}, {"w": "into", "b": [0.4167, 0.3147, 0.4559, 0.3345]}, {"w": "vectors,", "b": [0.4622, 0.3147, 0.5414, 0.3345]}, {"w": "followed", "b": [0.5477, 0.3147, 0.6374, 0.3345]}, {"w": "by", "b": [0.6437, 0.3147, 0.6689, 0.3345]}, {"w": "Dense", "b": [0.6751, 0.3158, 0.7508, 0.336]}, {"w": "layers", "b": [0.7571, 0.3147, 0.8173, 0.3345]}, {"w": "to", "b": [0.8236, 0.3147, 0.8433, 0.3345]}, {"w": "achieve", "b": [0.1294, 0.3361, 0.2065, 0.3559]}, {"w": "classification", "b": [0.2128, 0.3361, 0.3459, 0.3559]}, {"w": "or", "b": [0.3522, 0.3361, 0.3732, 0.3559]}, {"w": "regression.", "b": [0.3795, 0.3361, 0.4895, 0.3559]}]}, {"id": "b_2", "type": "paragraph", "text": "Note that it’s highly likely that regular convolutions will soon be mostly (or completely) replaced by an equivalent but faster and representationally efficient alternative: the depthwise separable convolution (SeparableConv2D layer). This is true for 3D, 2D, and 1D inputs. When you’re building a new network from scratch, using depthwise separable convolutions is definitely the way to go. The SeparableConv2D layer can be used as a drop-in replacement for Conv2D, resulting in a smaller, faster network that also performs better on its task.", "words": [{"w": "Note", "b": [0.1294, 0.3789, 0.1785, 0.3987]}, {"w": "that", "b": [0.1848, 0.3789, 0.2226, 0.3987]}, {"w": "it’s", "b": [0.2289, 0.3789, 0.2597, 0.3987]}, {"w": "highly", "b": [0.266, 0.3789, 0.3305, 0.3987]}, {"w": "likely", "b": [0.3368, 0.3789, 0.3943, 0.3987]}, {"w": "that", "b": [0.4006, 0.3789, 0.4384, 0.3987]}, {"w": "regular", "b": [0.4447, 0.3789, 0.5162, 0.3987]}, {"w": "convolutions", "b": [0.5225, 0.3789, 0.6528, 0.3987]}, {"w": "will", "b": [0.6591, 0.3789, 0.6984, 0.3987]}, {"w": "soon", "b": [0.7047, 0.3789, 0.7523, 0.3987]}, {"w": "be", "b": [0.7586, 0.3789, 0.7825, 0.3987]}, {"w": "mostly", "b": [0.7888, 0.3789, 0.8574, 0.3987]}, {"w": "(or", "b": [0.1294, 0.3994, 0.1588, 0.4192]}, {"w": "completely)", "b": [0.1651, 0.3994, 0.2856, 0.4192]}, {"w": "replaced", "b": [0.2919, 0.3994, 0.3774, 0.4192]}, {"w": "by", "b": [0.3837, 0.3994, 0.4089, 0.4192]}, {"w": "an", "b": [0.4152, 0.3994, 0.439, 0.4192]}, {"w": "equivalent", "b": [0.4453, 0.3994, 0.5504, 0.4192]}, {"w": "but", "b": [0.5567, 0.3994, 0.589, 0.4192]}, {"w": "faster", "b": [0.5953, 0.3994, 0.6513, 0.4192]}, {"w": "and", "b": [0.6575, 0.3994, 0.6939, 0.4192]}, {"w": "representationally", "b": [0.1294, 0.4199, 0.3102, 0.4397]}, {"w": "efficient", "b": [0.3165, 0.4199, 0.4, 0.4397]}, {"w": "alternative:", "b": [0.4063, 0.4199, 0.5198, 0.4397]}, {"w": "the", "b": [0.5261, 0.4199, 0.5569, 0.4397]}, {"w": "depthwise", "b": [0.5632, 0.4199, 0.6641, 0.4397]}, {"w": "separable", "b": [0.6704, 0.4199, 0.7699, 0.4397]}, {"w": "convolution", "b": [0.1294, 0.4404, 0.2485, 0.4602]}, {"w": "(SeparableConv2D", "b": [0.2548, 0.4404, 0.4902, 0.4617]}, {"w": "layer).", "b": [0.4966, 0.4404, 0.5617, 0.4602]}, {"w": "This", "b": [0.568, 0.4404, 0.6129, 0.4602]}, {"w": "is", "b": [0.6192, 0.4404, 0.636, 0.4602]}, {"w": "true", "b": [0.6423, 0.4404, 0.6815, 0.4602]}, {"w": "for", "b": [0.6878, 0.4404, 0.7172, 0.4602]}, {"w": "3D,", "b": [0.7235, 0.4404, 0.7607, 0.4602]}, {"w": "2D,", "b": [0.767, 0.4404, 0.8041, 0.4602]}, {"w": "and", "b": [0.8104, 0.4404, 0.8469, 0.4602]}, {"w": "1D", "b": [0.1294, 0.4618, 0.1602, 0.4816]}, {"w": "inputs.", "b": [0.1665, 0.4618, 0.2345, 0.4816]}, {"w": "When", "b": [0.2408, 0.4618, 0.3011, 0.4816]}, {"w": "you’re", "b": [0.3074, 0.4618, 0.3732, 0.4816]}, {"w": "building", "b": [0.3795, 0.4618, 0.4636, 0.4816]}, {"w": "a", "b": [0.4699, 0.4618, 0.4811, 0.4816]}, {"w": "new", "b": [0.4874, 0.4618, 0.5295, 0.4816]}, {"w": "network", "b": [0.5358, 0.4618, 0.6184, 0.4816]}, {"w": "from", "b": [0.6247, 0.4618, 0.6738, 0.4816]}, {"w": "scratch,", "b": [0.6801, 0.4618, 0.7578, 0.4816]}, {"w": "using", "b": [0.7641, 0.4618, 0.8188, 0.4816]}, {"w": "depthwise", "b": [0.1294, 0.4823, 0.2317, 0.5021]}, {"w": "separable", "b": [0.238, 0.4823, 0.3333, 0.5021]}, {"w": "convolutions", "b": [0.3395, 0.4823, 0.4699, 0.5021]}, {"w": "is", "b": [0.4762, 0.4823, 0.493, 0.5021]}, {"w": "definitely", "b": [0.4993, 0.4823, 0.596, 0.5021]}, {"w": "the", "b": [0.6023, 0.4823, 0.6331, 0.5021]}, {"w": "way", "b": [0.6394, 0.4823, 0.6815, 0.5021]}, {"w": "to", "b": [0.6878, 0.4823, 0.7074, 0.5021]}, {"w": "go.", "b": [0.7137, 0.4823, 0.7452, 0.5021]}, {"w": "The", "b": [0.7515, 0.4823, 0.7908, 0.5021]}, {"w": "SeparableConv2D", "b": [0.1294, 0.5039, 0.3564, 0.5241]}, {"w": "layer", "b": [0.3628, 0.5028, 0.4132, 0.5226]}, {"w": "can", "b": [0.4195, 0.5028, 0.4545, 0.5226]}, {"w": "be", "b": [0.4608, 0.5028, 0.4846, 0.5226]}, {"w": "used", "b": [0.4909, 0.5028, 0.5372, 0.5226]}, {"w": "as", "b": [0.5435, 0.5028, 0.5645, 0.5226]}, {"w": "a", "b": [0.5708, 0.5028, 0.582, 0.5226]}, {"w": "drop-in", "b": [0.5883, 0.5028, 0.6626, 0.5226]}, {"w": "replacement", "b": [0.6689, 0.5028, 0.7922, 0.5226]}, {"w": "for", "b": [0.7985, 0.5028, 0.8279, 0.5226]}, {"w": "Conv2D,", "b": [0.1294, 0.5242, 0.2265, 0.5454]}, {"w": "resulting", "b": [0.2328, 0.5242, 0.3211, 0.5439]}, {"w": "in", "b": [0.3274, 0.5242, 0.3471, 0.5439]}, {"w": "a", "b": [0.3534, 0.5242, 0.3646, 0.5439]}, {"w": "smaller,", "b": [0.3709, 0.5242, 0.4504, 0.5439]}, {"w": "faster", "b": [0.4567, 0.5242, 0.5127, 0.5439]}, {"w": "network", "b": [0.519, 0.5242, 0.6017, 0.5439]}, {"w": "that", "b": [0.608, 0.5242, 0.6458, 0.5439]}, {"w": "also", "b": [0.6522, 0.5242, 0.6928, 0.5439]}, {"w": "performs", "b": [0.6991, 0.5242, 0.7902, 0.5439]}, {"w": "better", "b": [0.7965, 0.5242, 0.8539, 0.5439]}, {"w": "on", "b": [0.1294, 0.5456, 0.1546, 0.5653]}, {"w": "its", "b": [0.1609, 0.5456, 0.1848, 0.5653]}, {"w": "task.", "b": [0.1911, 0.5456, 0.238, 0.5653]}]}, {"id": "b_3", "type": "paragraph", "text": "Here’s a typical image-classification network (categorical classification, in this case):", "words": [{"w": "Here’s", "b": [0.1294, 0.5884, 0.1952, 0.6081]}, {"w": "a", "b": [0.2016, 0.5884, 0.2128, 0.6081]}, {"w": "typical", "b": [0.2191, 0.5884, 0.2877, 0.6081]}, {"w": "image-classification", "b": [0.294, 0.5884, 0.4972, 0.6081]}, {"w": "network", "b": [0.5035, 0.5884, 0.5862, 0.6081]}, {"w": "(categorical", "b": [0.5925, 0.5884, 0.7115, 0.6081]}, {"w": "classification,", "b": [0.7178, 0.5884, 0.8573, 0.6081]}, {"w": "in", "b": [0.1294, 0.6089, 0.149, 0.6286]}, {"w": "this", "b": [0.1553, 0.6089, 0.1918, 0.6286]}, {"w": "case):", "b": [0.1981, 0.6089, 0.2569, 0.6286]}]}, {"id": "b_4", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.SeparableConv2D(32, 3, activation='relu', input_shape=(height, width, channels))) model.add(layers.SeparableConv2D(64, 3, activation='relu')) model.add(layers.MaxPooling2D(2)) model.add(layers.SeparableConv2D(64, 3, activation='relu')) model.add(layers.SeparableConv2D(128, 3, activation='relu')) model.add(layers.MaxPooling2D(2)) model.add(layers.SeparableConv2D(64, 3, activation='relu')) model.add(layers.SeparableConv2D(128, 3, activation='relu')) model.add(layers.GlobalAveragePooling2D()) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(num_classes, activation='softmax'))", "words": [{"w": "model", "b": [0.1357, 0.6466, 0.1925, 0.6618]}, {"w": "=", "b": [0.2038, 0.6466, 0.2152, 0.6618]}, {"w": "models.Sequential()", "b": [0.2265, 0.6466, 0.4422, 0.6618]}, {"w": "model.add(layers.SeparableConv2D(32,", "b": [0.1357, 0.6618, 0.5444, 0.6769]}, {"w": "3,", "b": [0.5557, 0.6618, 0.5784, 0.6769]}, {"w": "activation='relu',", "b": [0.5898, 0.6618, 0.7941, 0.6769]}, {"w": "input_shape=(height,", "b": [0.5217, 0.6769, 0.7487, 0.6921]}, {"w": "width,", "b": [0.7601, 0.6769, 0.8282, 0.6921]}, {"w": "channels)))", "b": [0.1357, 0.6921, 0.2606, 0.7072]}, {"w": "model.add(layers.SeparableConv2D(64,", "b": [0.1357, 0.7072, 0.5444, 0.7224]}, {"w": "3,", "b": [0.5557, 0.7072, 0.5784, 0.7224]}, {"w": "activation='relu'))", "b": [0.5898, 0.7072, 0.8055, 0.7224]}, {"w": "model.add(layers.MaxPooling2D(2))", "b": [0.1357, 0.7224, 0.5103, 0.7375]}, {"w": "model.add(layers.SeparableConv2D(64,", "b": [0.1357, 0.7527, 0.5444, 0.7678]}, {"w": "3,", "b": [0.5557, 0.7527, 0.5784, 0.7678]}, {"w": "activation='relu'))", "b": [0.5898, 0.7527, 0.8055, 0.7678]}, {"w": "model.add(layers.SeparableConv2D(128,", "b": [0.1357, 0.7678, 0.5557, 0.783]}, {"w": "3,", "b": [0.5671, 0.7678, 0.5898, 0.783]}, {"w": "activation='relu'))", "b": [0.6011, 0.7678, 0.8168, 0.783]}, {"w": "model.add(layers.MaxPooling2D(2))", "b": [0.1357, 0.783, 0.5103, 0.7981]}, {"w": "model.add(layers.SeparableConv2D(64,", "b": [0.1357, 0.8133, 0.5444, 0.8284]}, {"w": "3,", "b": [0.5557, 0.8133, 0.5784, 0.8284]}, {"w": "activation='relu'))", "b": [0.5898, 0.8133, 0.8055, 0.8284]}, {"w": "model.add(layers.SeparableConv2D(128,", "b": [0.1357, 0.8284, 0.5557, 0.8436]}, {"w": "3,", "b": [0.5671, 0.8284, 0.5898, 0.8436]}, {"w": "activation='relu'))", "b": [0.6011, 0.8284, 0.8168, 0.8436]}, {"w": "model.add(layers.GlobalAveragePooling2D())", "b": [0.1357, 0.8436, 0.6125, 0.8587]}, {"w": "model.add(layers.Dense(32,", "b": [0.1357, 0.8739, 0.4309, 0.889]}, {"w": "activation='relu'))", "b": [0.4422, 0.8739, 0.6579, 0.889]}, {"w": "model.add(layers.Dense(num_classes,", "b": [0.1357, 0.889, 0.533, 0.9042]}, {"w": "activation='softmax'))", "b": [0.5444, 0.889, 0.7941, 0.9042]}]}]}, {"page": 421, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "model.compile(optimizer='rmsprop', loss='categorical_crossentropy')", "words": [{"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.1002, 0.5217, 0.1154]}, {"w": "loss='categorical_crossentropy')", "b": [0.1357, 0.1154, 0.499, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "RNNs", "words": [{"w": "RNNs", "b": [0.1294, 0.144, 0.1778, 0.1588]}]}, {"id": "b_2", "type": "paragraph", "text": "Recurrent neural networks (RNNs) work by processing sequences of inputs one timestep at a time and maintaining a state throughout (a state is typically a vector or set of vectors: a point in a geometric space of states). They should be used preferentially over 1D convnets in the case of sequences where patterns of interest aren’t invariant by temporal translation (for instance, timeseries data where the recent past is more important than the distant past).", "words": [{"w": "Recurrent", "b": [0.1294, 0.1819, 0.2294, 0.2017]}, {"w": "neural", "b": [0.2357, 0.1819, 0.3015, 0.2017]}, {"w": "networks", "b": [0.3078, 0.1819, 0.3989, 0.2017]}, {"w": "(RNNs)", "b": [0.4052, 0.1819, 0.4851, 0.2017]}, {"w": "work", "b": [0.4914, 0.1819, 0.5432, 0.2017]}, {"w": "by", "b": [0.5495, 0.1819, 0.5747, 0.2017]}, {"w": "processing", "b": [0.581, 0.1819, 0.6889, 0.2017]}, {"w": "sequences", "b": [0.6952, 0.1819, 0.7975, 0.2017]}, {"w": "of", "b": [0.8038, 0.1819, 0.8248, 0.2017]}, {"w": "inputs", "b": [0.1294, 0.2024, 0.1911, 0.2222]}, {"w": "one", "b": [0.1974, 0.2024, 0.2338, 0.2222]}, {"w": "timestep", "b": [0.2401, 0.2024, 0.3256, 0.2222]}, {"w": "at", "b": [0.3319, 0.2024, 0.3501, 0.2222]}, {"w": "a", "b": [0.3564, 0.2024, 0.3676, 0.2222]}, {"w": "time", "b": [0.374, 0.2024, 0.4188, 0.2222]}, {"w": "and", "b": [0.4251, 0.2024, 0.4615, 0.2222]}, {"w": "maintaining", "b": [0.4678, 0.2024, 0.5884, 0.2222]}, {"w": "a", "b": [0.5947, 0.2024, 0.6059, 0.2222]}, {"w": "state", "b": [0.6121, 0.2024, 0.6597, 0.2222]}, {"w": "throughout", "b": [0.666, 0.2024, 0.7767, 0.2222]}, {"w": "(a", "b": [0.783, 0.2024, 0.8026, 0.2222]}, {"w": "state", "b": [0.8089, 0.2024, 0.8552, 0.2222]}, {"w": "is", "b": [0.1294, 0.2229, 0.1462, 0.2427]}, {"w": "typically", "b": [0.1525, 0.2229, 0.2408, 0.2427]}, {"w": "a", "b": [0.2471, 0.2229, 0.2583, 0.2427]}, {"w": "vector", "b": [0.2646, 0.2229, 0.3277, 0.2427]}, {"w": "or", "b": [0.334, 0.2229, 0.355, 0.2427]}, {"w": "set", "b": [0.3613, 0.2229, 0.3893, 0.2427]}, {"w": "of", "b": [0.3956, 0.2229, 0.4167, 0.2427]}, {"w": "vectors:", "b": [0.423, 0.2229, 0.5028, 0.2427]}, {"w": "a", "b": [0.5091, 0.2229, 0.5203, 0.2427]}, {"w": "point", "b": [0.5266, 0.2229, 0.5785, 0.2427]}, {"w": "in", "b": [0.5848, 0.2229, 0.6044, 0.2427]}, {"w": "a", "b": [0.6107, 0.2229, 0.6219, 0.2427]}, {"w": "geometric", "b": [0.6282, 0.2229, 0.7291, 0.2427]}, {"w": "space", "b": [0.7354, 0.2229, 0.7914, 0.2427]}, {"w": "of", "b": [0.7977, 0.2229, 0.8187, 0.2427]}, {"w": "states).", "b": [0.1294, 0.2434, 0.2002, 0.2632]}, {"w": "They", "b": [0.2065, 0.2434, 0.2583, 0.2632]}, {"w": "should", "b": [0.2646, 0.2434, 0.3319, 0.2632]}, {"w": "be", "b": [0.3382, 0.2434, 0.362, 0.2632]}, {"w": "used", "b": [0.3683, 0.2434, 0.4146, 0.2632]}, {"w": "preferentially", "b": [0.4209, 0.2434, 0.5568, 0.2632]}, {"w": "over", "b": [0.5631, 0.2434, 0.6079, 0.2632]}, {"w": "1D", "b": [0.6142, 0.2434, 0.645, 0.2632]}, {"w": "convnets", "b": [0.6513, 0.2434, 0.741, 0.2632]}, {"w": "in", "b": [0.7473, 0.2434, 0.7669, 0.2632]}, {"w": "the", "b": [0.7732, 0.2434, 0.8041, 0.2632]}, {"w": "case", "b": [0.8104, 0.2434, 0.8538, 0.2632]}, {"w": "of", "b": [0.1294, 0.2639, 0.1504, 0.2837]}, {"w": "sequences", "b": [0.1567, 0.2639, 0.259, 0.2837]}, {"w": "where", "b": [0.2653, 0.2639, 0.3269, 0.2837]}, {"w": "patterns", "b": [0.3332, 0.2639, 0.4131, 0.2837]}, {"w": "of", "b": [0.4194, 0.2639, 0.4404, 0.2837]}, {"w": "interest", "b": [0.4467, 0.2639, 0.521, 0.2837]}, {"w": "aren’t", "b": [0.5273, 0.2639, 0.5856, 0.2837]}, {"w": "invariant", "b": [0.5919, 0.2639, 0.6816, 0.2837]}, {"w": "by", "b": [0.6879, 0.2639, 0.7131, 0.2837]}, {"w": "temporal", "b": [0.7194, 0.2639, 0.8091, 0.2837]}, {"w": "translation", "b": [0.1294, 0.2844, 0.2359, 0.3042]}, {"w": "(for", "b": [0.2422, 0.2844, 0.28, 0.3042]}, {"w": "instance,", "b": [0.2863, 0.2844, 0.3753, 0.3042]}, {"w": "timeseries", "b": [0.3816, 0.2844, 0.4839, 0.3042]}, {"w": "data", "b": [0.4902, 0.2844, 0.5322, 0.3042]}, {"w": "where", "b": [0.5385, 0.2844, 0.6002, 0.3042]}, {"w": "the", "b": [0.6065, 0.2844, 0.6373, 0.3042]}, {"w": "recent", "b": [0.6436, 0.2844, 0.7052, 0.3042]}, {"w": "past", "b": [0.7115, 0.2844, 0.7522, 0.3042]}, {"w": "is", "b": [0.7585, 0.2844, 0.7753, 0.3042]}, {"w": "more", "b": [0.7816, 0.2844, 0.8335, 0.3042]}, {"w": "important", "b": [0.1294, 0.3049, 0.2275, 0.3247]}, {"w": "than", "b": [0.2338, 0.3049, 0.2773, 0.3247]}, {"w": "the", "b": [0.2836, 0.3049, 0.3144, 0.3247]}, {"w": "distant", "b": [0.3207, 0.3049, 0.388, 0.3247]}, {"w": "past).", "b": [0.3943, 0.3049, 0.4496, 0.3247]}]}, {"id": "b_3", "type": "paragraph", "text": "Three RNN layers are available in Keras: SimpleRNN, GRU, and LSTM. For most practical purposes, you should use either GRU or LSTM. LSTM is the more powerful of the two but is also more expensive; you can think of GRU as a simpler, cheaper alternative to it.", "words": [{"w": "Three", "b": [0.1294, 0.3477, 0.1882, 0.3675]}, {"w": "RNN", "b": [0.1945, 0.3477, 0.2478, 0.3675]}, {"w": "layers", "b": [0.2541, 0.3477, 0.3143, 0.3675]}, {"w": "are", "b": [0.3206, 0.3477, 0.3514, 0.3675]}, {"w": "available", "b": [0.3578, 0.3477, 0.4488, 0.3675]}, {"w": "in", "b": [0.4551, 0.3477, 0.4748, 0.3675]}, {"w": "Keras:", "b": [0.4811, 0.3477, 0.5469, 0.3675]}, {"w": "SimpleRNN,", "b": [0.5531, 0.3477, 0.6957, 0.369]}, {"w": "GRU,", "b": [0.702, 0.3477, 0.7537, 0.369]}, {"w": "and", "b": [0.76, 0.3477, 0.7964, 0.3675]}, {"w": "LSTM.", "b": [0.8027, 0.3477, 0.8696, 0.369]}, {"w": "For", "b": [0.1294, 0.3691, 0.1645, 0.3889]}, {"w": "most", "b": [0.1708, 0.3691, 0.2198, 0.3889]}, {"w": "practical", "b": [0.2261, 0.3691, 0.313, 0.3889]}, {"w": "purposes,", "b": [0.3193, 0.3691, 0.4153, 0.3889]}, {"w": "you", "b": [0.4216, 0.3691, 0.4594, 0.3889]}, {"w": "should", "b": [0.4657, 0.3691, 0.533, 0.3889]}, {"w": "use", "b": [0.5393, 0.3691, 0.5729, 0.3889]}, {"w": "either", "b": [0.5792, 0.3691, 0.6367, 0.3889]}, {"w": "GRU", "b": [0.6429, 0.3702, 0.6883, 0.3904]}, {"w": "or", "b": [0.6946, 0.3691, 0.7157, 0.3889]}, {"w": "LSTM.", "b": [0.722, 0.3691, 0.7888, 0.3904]}, {"w": "LSTM", "b": [0.7951, 0.3702, 0.8557, 0.3904]}, {"w": "is", "b": [0.1294, 0.3905, 0.1462, 0.4102]}, {"w": "the", "b": [0.1525, 0.3905, 0.1834, 0.4102]}, {"w": "more", "b": [0.1897, 0.3905, 0.2415, 0.4102]}, {"w": "powerful", "b": [0.2478, 0.3905, 0.3389, 0.4102]}, {"w": "of", "b": [0.3452, 0.3905, 0.3662, 0.4102]}, {"w": "the", "b": [0.3725, 0.3905, 0.4033, 0.4102]}, {"w": "two", "b": [0.4096, 0.3905, 0.4475, 0.4102]}, {"w": "but", "b": [0.4538, 0.3905, 0.486, 0.4102]}, {"w": "is", "b": [0.4923, 0.3905, 0.5092, 0.4102]}, {"w": "also", "b": [0.5155, 0.3905, 0.5561, 0.4102]}, {"w": "more", "b": [0.5624, 0.3905, 0.6143, 0.4102]}, {"w": "expensive;", "b": [0.6206, 0.3905, 0.7284, 0.4102]}, {"w": "you", "b": [0.7348, 0.3905, 0.7726, 0.4102]}, {"w": "can", "b": [0.7789, 0.3905, 0.8139, 0.4102]}, {"w": "think", "b": [0.1294, 0.411, 0.1813, 0.4307]}, {"w": "of", "b": [0.1876, 0.411, 0.2086, 0.4307]}, {"w": "GRU", "b": [0.2149, 0.4121, 0.2603, 0.4322]}, {"w": "as", "b": [0.2666, 0.411, 0.2876, 0.4307]}, {"w": "a", "b": [0.2939, 0.411, 0.3051, 0.4307]}, {"w": "simpler,", "b": [0.3114, 0.411, 0.3924, 0.4307]}, {"w": "cheaper", "b": [0.3987, 0.411, 0.4771, 0.4307]}, {"w": "alternative", "b": [0.4834, 0.411, 0.5899, 0.4307]}, {"w": "to", "b": [0.5962, 0.411, 0.6158, 0.4307]}, {"w": "it.", "b": [0.6221, 0.411, 0.6425, 0.4307]}]}, {"id": "b_4", "type": "paragraph", "text": "In order to stack multiple RNN layers on top of each other, each layer prior to the last layer in the stack should return the full sequence of its outputs (each input timestep will correspond to an output timestep); if you aren’t stacking any further RNN layers, then it’s common to return only the last output, which contains information about the entire sequence.", "words": [{"w": "In", "b": [0.1294, 0.4547, 0.1504, 0.4744]}, {"w": "order", "b": [0.1567, 0.4547, 0.21, 0.4744]}, {"w": "to", "b": [0.2163, 0.4547, 0.2359, 0.4744]}, {"w": "stack", "b": [0.2422, 0.4547, 0.294, 0.4744]}, {"w": "multiple", "b": [0.3003, 0.4547, 0.3844, 0.4744]}, {"w": "RNN", "b": [0.3908, 0.4547, 0.444, 0.4744]}, {"w": "layers", "b": [0.4503, 0.4547, 0.5105, 0.4744]}, {"w": "on", "b": [0.5169, 0.4547, 0.5421, 0.4744]}, {"w": "top", "b": [0.5484, 0.4547, 0.5806, 0.4744]}, {"w": "of", "b": [0.5869, 0.4547, 0.6079, 0.4744]}, {"w": "each", "b": [0.6143, 0.4547, 0.6605, 0.4744]}, {"w": "other,", "b": [0.6668, 0.4547, 0.7238, 0.4744]}, {"w": "each", "b": [0.7301, 0.4547, 0.7764, 0.4744]}, {"w": "layer", "b": [0.7827, 0.4547, 0.8331, 0.4744]}, {"w": "prior", "b": [0.1294, 0.4752, 0.1785, 0.4949]}, {"w": "to", "b": [0.1848, 0.4752, 0.2044, 0.4949]}, {"w": "the", "b": [0.2107, 0.4752, 0.2415, 0.4949]}, {"w": "last", "b": [0.2478, 0.4752, 0.2829, 0.4949]}, {"w": "layer", "b": [0.2892, 0.4752, 0.3396, 0.4949]}, {"w": "in", "b": [0.3459, 0.4752, 0.3655, 0.4949]}, {"w": "the", "b": [0.3718, 0.4752, 0.4027, 0.4949]}, {"w": "stack", "b": [0.409, 0.4752, 0.4608, 0.4949]}, {"w": "should", "b": [0.4671, 0.4752, 0.5344, 0.4949]}, {"w": "return", "b": [0.5407, 0.4752, 0.6009, 0.4949]}, {"w": "the", "b": [0.6072, 0.4752, 0.638, 0.4949]}, {"w": "full", "b": [0.6443, 0.4752, 0.6793, 0.4949]}, {"w": "sequence", "b": [0.6856, 0.4752, 0.7781, 0.4949]}, {"w": "of", "b": [0.7844, 0.4752, 0.8054, 0.4949]}, {"w": "its", "b": [0.8117, 0.4752, 0.8356, 0.4949]}, {"w": "outputs", "b": [0.1294, 0.4957, 0.2037, 0.5154]}, {"w": "(each", "b": [0.21, 0.4957, 0.2646, 0.5154]}, {"w": "input", "b": [0.2709, 0.4957, 0.3228, 0.5154]}, {"w": "timestep", "b": [0.3291, 0.4957, 0.4146, 0.5154]}, {"w": "will", "b": [0.4209, 0.4957, 0.4601, 0.5154]}, {"w": "correspond", "b": [0.4665, 0.4957, 0.5785, 0.5154]}, {"w": "to", "b": [0.5848, 0.4957, 0.6045, 0.5154]}, {"w": "an", "b": [0.6108, 0.4957, 0.6346, 0.5154]}, {"w": "output", "b": [0.6409, 0.4957, 0.7054, 0.5154]}, {"w": "timestep);", "b": [0.7117, 0.4957, 0.8126, 0.5154]}, {"w": "if", "b": [0.8189, 0.4957, 0.8343, 0.5154]}, {"w": "you", "b": [0.1294, 0.5162, 0.1673, 0.5359]}, {"w": "aren’t", "b": [0.1736, 0.5162, 0.2319, 0.5359]}, {"w": "stacking", "b": [0.2382, 0.5162, 0.3223, 0.5359]}, {"w": "any", "b": [0.3286, 0.5162, 0.365, 0.5359]}, {"w": "further", "b": [0.3713, 0.5162, 0.44, 0.5359]}, {"w": "RNN", "b": [0.4463, 0.5162, 0.4995, 0.5359]}, {"w": "layers,", "b": [0.5058, 0.5162, 0.5724, 0.5359]}, {"w": "then", "b": [0.5787, 0.5162, 0.6221, 0.5359]}, {"w": "it’s", "b": [0.6284, 0.5162, 0.6592, 0.5359]}, {"w": "common", "b": [0.6655, 0.5162, 0.7538, 0.5359]}, {"w": "to", "b": [0.7601, 0.5162, 0.7798, 0.5359]}, {"w": "return", "b": [0.7861, 0.5162, 0.8463, 0.5359]}, {"w": "only", "b": [0.1294, 0.5367, 0.1743, 0.5564]}, {"w": "the", "b": [0.1806, 0.5367, 0.2114, 0.5564]}, {"w": "last", "b": [0.2177, 0.5367, 0.2527, 0.5564]}, {"w": "output,", "b": [0.259, 0.5367, 0.3298, 0.5564]}, {"w": "which", "b": [0.3361, 0.5367, 0.3978, 0.5564]}, {"w": "contains", "b": [0.4041, 0.5367, 0.4882, 0.5564]}, {"w": "information", "b": [0.4945, 0.5367, 0.6136, 0.5564]}, {"w": "about", "b": [0.6199, 0.5367, 0.676, 0.5564]}, {"w": "the", "b": [0.6823, 0.5367, 0.7131, 0.5564]}, {"w": "entire", "b": [0.7194, 0.5367, 0.7768, 0.5564]}, {"w": "sequence.", "b": [0.1294, 0.5572, 0.2282, 0.5769]}]}, {"id": "b_5", "type": "paragraph", "text": "Following is a single RNN layer for binary classification of vector sequences:", "words": [{"w": "Following", "b": [0.1294, 0.6, 0.2331, 0.6197]}, {"w": "is", "b": [0.2394, 0.6, 0.2563, 0.6197]}, {"w": "a", "b": [0.2626, 0.6, 0.2738, 0.6197]}, {"w": "single", "b": [0.2801, 0.6, 0.3403, 0.6197]}, {"w": "RNN", "b": [0.3467, 0.6, 0.3999, 0.6197]}, {"w": "layer", "b": [0.4062, 0.6, 0.4566, 0.6197]}, {"w": "for", "b": [0.4629, 0.6, 0.4924, 0.6197]}, {"w": "binary", "b": [0.4987, 0.6, 0.5631, 0.6197]}, {"w": "classification", "b": [0.5694, 0.6, 0.7025, 0.6197]}, {"w": "of", "b": [0.7088, 0.6, 0.7299, 0.6197]}, {"w": "vector", "b": [0.7362, 0.6, 0.7992, 0.6197]}, {"w": "sequences:", "b": [0.1294, 0.6205, 0.2387, 0.6402]}]}, {"id": "b_6", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.LSTM(32, input_shape=(num_timesteps, num_features))) model.add(layers.Dense(num_classes, activation='sigmoid')) 50model.compile(optimizer='rmsprop', loss='binary_crossentropy')", "words": [{"w": "model", "b": [0.1357, 0.6582, 0.1925, 0.6733]}, {"w": "=", "b": [0.2038, 0.6582, 0.2152, 0.6733]}, {"w": "models.Sequential()", "b": [0.2265, 0.6582, 0.4422, 0.6733]}, {"w": "model.add(layers.LSTM(32,", "b": [0.1357, 0.6734, 0.4195, 0.6885]}, {"w": "input_shape=(num_timesteps,", "b": [0.4309, 0.6734, 0.7374, 0.6885]}, {"w": "num_features)))", "b": [0.1357, 0.6885, 0.306, 0.7036]}, {"w": "model.add(layers.Dense(num_classes,", "b": [0.1357, 0.7037, 0.533, 0.7188]}, {"w": "activation='sigmoid'))", "b": [0.5444, 0.7037, 0.7941, 0.7188]}, {"w": "50model.compile(optimizer='rmsprop',", "b": [0.1357, 0.734, 0.5444, 0.7491]}, {"w": "loss='binary_crossentropy')", "b": [0.5557, 0.734, 0.8622, 0.7491]}]}, {"id": "b_7", "type": "paragraph", "text": "And this is a stacked RNN layer for binary classification of vector sequences:", "words": [{"w": "And", "b": [0.1294, 0.772, 0.1729, 0.7917]}, {"w": "this", "b": [0.1792, 0.772, 0.2156, 0.7917]}, {"w": "is", "b": [0.2219, 0.772, 0.2387, 0.7917]}, {"w": "a", "b": [0.245, 0.772, 0.2562, 0.7917]}, {"w": "stacked", "b": [0.2626, 0.772, 0.3382, 0.7917]}, {"w": "RNN", "b": [0.3445, 0.772, 0.3978, 0.7917]}, {"w": "layer", "b": [0.4041, 0.772, 0.4545, 0.7917]}, {"w": "for", "b": [0.4608, 0.772, 0.4902, 0.7917]}, {"w": "binary", "b": [0.4965, 0.772, 0.561, 0.7917]}, {"w": "classification", "b": [0.5673, 0.772, 0.7004, 0.7917]}, {"w": "of", "b": [0.7067, 0.772, 0.7277, 0.7917]}, {"w": "vector", "b": [0.734, 0.772, 0.7971, 0.7917]}, {"w": "sequences:", "b": [0.1294, 0.7925, 0.2387, 0.8122]}]}, {"id": "b_8", "type": "paragraph", "text": "model = models.Sequential() model.add(layers.LSTM(32, return_sequences=True, input_shape=(num_timesteps, num_features))) model.add(layers.LSTM(32, return_sequences=True)) model.add(layers.LSTM(32))", "words": [{"w": "model", "b": [0.1357, 0.8302, 0.1925, 0.8454]}, {"w": "=", "b": [0.2038, 0.8302, 0.2152, 0.8454]}, {"w": "models.Sequential()", "b": [0.2265, 0.8302, 0.4422, 0.8454]}, {"w": "model.add(layers.LSTM(32,", "b": [0.1357, 0.8454, 0.4195, 0.8605]}, {"w": "return_sequences=True,", "b": [0.4309, 0.8454, 0.6806, 0.8605]}, {"w": "input_shape=(num_timesteps,", "b": [0.306, 0.8605, 0.6125, 0.8757]}, {"w": "num_features)))", "b": [0.6238, 0.8605, 0.7941, 0.8757]}, {"w": "model.add(layers.LSTM(32,", "b": [0.1357, 0.8757, 0.4195, 0.8908]}, {"w": "return_sequences=True))", "b": [0.4309, 0.8757, 0.6919, 0.8908]}, {"w": "model.add(layers.LSTM(32))", "b": [0.1357, 0.8908, 0.4309, 0.906]}]}]}, {"page": 422, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "model.add(layers.Dense(num_classes, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy')", "words": [{"w": "model.add(layers.Dense(num_classes,", "b": [0.1357, 0.0851, 0.533, 0.1002]}, {"w": "activation='sigmoid'))", "b": [0.5444, 0.0851, 0.7941, 0.1002]}, {"w": "model.compile(optimizer='rmsprop',", "b": [0.1357, 0.1154, 0.5217, 0.1305]}, {"w": "loss='binary_crossentropy')", "b": [0.533, 0.1154, 0.8395, 0.1305]}]}, {"id": "b_1", "type": "paragraph", "text": "9.1.7. The space of possibilities", "words": [{"w": "9.1.7.", "b": [0.1294, 0.1579, 0.1862, 0.1776]}, {"w": "The", "b": [0.1925, 0.1579, 0.2345, 0.1776]}, {"w": "space", "b": [0.2408, 0.1579, 0.2997, 0.1776]}, {"w": "of", "b": [0.306, 0.1579, 0.327, 0.1776]}, {"w": "possibilities", "b": [0.3333, 0.1579, 0.4581, 0.1776]}]}, {"id": "b_2", "type": "paragraph", "text": "What will you build with deep learning? Remember, building deep- learning models is like playing with LEGO bricks: layers can be plugged together to map essentially anything to anything, given that you have appropriate training data available and that the mapping is achievable via a continuous geometric transformation of reasonable complexity. The space of possibilities is infinite. This section offers a few examples to inspire you to think beyond the basic classification and regression tasks that have traditionally been the bread and butter of machine learning.", "words": [{"w": "What", "b": [0.1294, 0.2007, 0.1841, 0.2204]}, {"w": "will", "b": [0.1904, 0.2007, 0.2296, 0.2204]}, {"w": "you", "b": [0.2359, 0.2007, 0.2738, 0.2204]}, {"w": "build", "b": [0.2801, 0.2007, 0.3319, 0.2204]}, {"w": "with", "b": [0.3382, 0.2007, 0.3831, 0.2204]}, {"w": "deep", "b": [0.3894, 0.2007, 0.437, 0.2204]}, {"w": "learning?", "b": [0.4433, 0.2007, 0.5372, 0.2204]}, {"w": "Remember,", "b": [0.5435, 0.2007, 0.6594, 0.2204]}, {"w": "building", "b": [0.6657, 0.2007, 0.7498, 0.2204]}, {"w": "deep-", "b": [0.7561, 0.2007, 0.8121, 0.2204]}, {"w": "learning", "b": [0.1294, 0.2212, 0.2121, 0.2409]}, {"w": "models", "b": [0.2184, 0.2212, 0.2913, 0.2409]}, {"w": "is", "b": [0.2976, 0.2212, 0.3144, 0.2409]}, {"w": "like", "b": [0.3207, 0.2212, 0.3585, 0.2409]}, {"w": "playing", "b": [0.3648, 0.2212, 0.4405, 0.2409]}, {"w": "with", "b": [0.4468, 0.2212, 0.4917, 0.2409]}, {"w": "LEGO", "b": [0.498, 0.2212, 0.5652, 0.2409]}, {"w": "bricks:", "b": [0.5715, 0.2212, 0.6402, 0.2409]}, {"w": "layers", "b": [0.6465, 0.2212, 0.7068, 0.2409]}, {"w": "can", "b": [0.7131, 0.2212, 0.7481, 0.2409]}, {"w": "be", "b": [0.7543, 0.2212, 0.7781, 0.2409]}, {"w": "plugged", "b": [0.7844, 0.2212, 0.8657, 0.2409]}, {"w": "together", "b": [0.1294, 0.2417, 0.2121, 0.2614]}, {"w": "to", "b": [0.2184, 0.2417, 0.238, 0.2614]}, {"w": "map", "b": [0.2443, 0.2417, 0.2878, 0.2614]}, {"w": "essentially", "b": [0.2941, 0.2417, 0.4006, 0.2614]}, {"w": "anything", "b": [0.4069, 0.2417, 0.4952, 0.2614]}, {"w": "to", "b": [0.5015, 0.2417, 0.5211, 0.2614]}, {"w": "anything,", "b": [0.5274, 0.2417, 0.622, 0.2614]}, {"w": "given", "b": [0.6283, 0.2417, 0.6844, 0.2614]}, {"w": "that", "b": [0.6907, 0.2417, 0.7285, 0.2614]}, {"w": "you", "b": [0.7348, 0.2417, 0.7726, 0.2614]}, {"w": "have", "b": [0.779, 0.2417, 0.8266, 0.2614]}, {"w": "appropriate", "b": [0.1294, 0.2622, 0.2443, 0.2819]}, {"w": "training", "b": [0.2506, 0.2622, 0.3291, 0.2819]}, {"w": "data", "b": [0.3354, 0.2622, 0.3774, 0.2819]}, {"w": "available", "b": [0.3837, 0.2622, 0.4748, 0.2819]}, {"w": "and", "b": [0.4811, 0.2622, 0.5175, 0.2819]}, {"w": "that", "b": [0.5238, 0.2622, 0.5617, 0.2819]}, {"w": "the", "b": [0.5679, 0.2622, 0.5987, 0.2819]}, {"w": "mapping", "b": [0.605, 0.2622, 0.6933, 0.2819]}, {"w": "is", "b": [0.6996, 0.2622, 0.7164, 0.2819]}, {"w": "achievable", "b": [0.7227, 0.2622, 0.8306, 0.2819]}, {"w": "via", "b": [0.8369, 0.2622, 0.8677, 0.2819]}, {"w": "a", "b": [0.1294, 0.2827, 0.1406, 0.3024]}, {"w": "continuous", "b": [0.1469, 0.2827, 0.2576, 0.3024]}, {"w": "geometric", "b": [0.2639, 0.2827, 0.3648, 0.3024]}, {"w": "transformation", "b": [0.3711, 0.2827, 0.5197, 0.3024]}, {"w": "of", "b": [0.526, 0.2827, 0.547, 0.3024]}, {"w": "reasonable", "b": [0.5533, 0.2827, 0.6611, 0.3024]}, {"w": "complexity.", "b": [0.6675, 0.2827, 0.7855, 0.3024]}, {"w": "The", "b": [0.7918, 0.2827, 0.8311, 0.3024]}, {"w": "space", "b": [0.1294, 0.3032, 0.1854, 0.3229]}, {"w": "of", "b": [0.1917, 0.3032, 0.2128, 0.3229]}, {"w": "possibilities", "b": [0.2191, 0.3032, 0.3396, 0.3229]}, {"w": "is", "b": [0.3459, 0.3032, 0.3628, 0.3229]}, {"w": "infinite.", "b": [0.369, 0.3032, 0.4482, 0.3229]}, {"w": "This", "b": [0.4545, 0.3032, 0.4994, 0.3229]}, {"w": "section", "b": [0.5057, 0.3032, 0.5771, 0.3229]}, {"w": "offers", "b": [0.5834, 0.3032, 0.6418, 0.3229]}, {"w": "a", "b": [0.6481, 0.3032, 0.6593, 0.3229]}, {"w": "few", "b": [0.6656, 0.3032, 0.7034, 0.3229]}, {"w": "examples", "b": [0.7097, 0.3032, 0.805, 0.3229]}, {"w": "to", "b": [0.8113, 0.3032, 0.8309, 0.3229]}, {"w": "inspire", "b": [0.1294, 0.3237, 0.1981, 0.3434]}, {"w": "you", "b": [0.2044, 0.3237, 0.2422, 0.3434]}, {"w": "to", "b": [0.2485, 0.3237, 0.2682, 0.3434]}, {"w": "think", "b": [0.2745, 0.3237, 0.3263, 0.3434]}, {"w": "beyond", "b": [0.3326, 0.3237, 0.4069, 0.3434]}, {"w": "the", "b": [0.4132, 0.3237, 0.444, 0.3434]}, {"w": "basic", "b": [0.4503, 0.3237, 0.5022, 0.3434]}, {"w": "classification", "b": [0.5085, 0.3237, 0.6416, 0.3434]}, {"w": "and", "b": [0.6479, 0.3237, 0.6843, 0.3434]}, {"w": "regression", "b": [0.6906, 0.3237, 0.7943, 0.3434]}, {"w": "tasks", "b": [0.8006, 0.3237, 0.8511, 0.3434]}, {"w": "that", "b": [0.1294, 0.3442, 0.1673, 0.3639]}, {"w": "have", "b": [0.1736, 0.3442, 0.2212, 0.3639]}, {"w": "traditionally", "b": [0.2275, 0.3442, 0.3508, 0.3639]}, {"w": "been", "b": [0.3571, 0.3442, 0.4048, 0.3639]}, {"w": "the", "b": [0.4111, 0.3442, 0.4419, 0.3639]}, {"w": "bread", "b": [0.4482, 0.3442, 0.5042, 0.3639]}, {"w": "and", "b": [0.5105, 0.3442, 0.5469, 0.3639]}, {"w": "butter", "b": [0.5533, 0.3442, 0.6121, 0.3639]}, {"w": "of", "b": [0.6184, 0.3442, 0.6394, 0.3639]}, {"w": "machine", "b": [0.6457, 0.3442, 0.7312, 0.3639]}, {"w": "learning.", "b": [0.7375, 0.3442, 0.8265, 0.3639]}]}, {"id": "b_3", "type": "paragraph", "text": "I’ve sorted my suggested applications by input and output modalities. Note that quite a few of them stretch the limits of what is possible— although a model could be trained on all of these tasks, in some cases such a model probably wouldn’t generalize far from its training data. Sections 9.2 and 9.3 will address how these limitations could be lifted in the future.", "words": [{"w": "I’ve", "b": [0.1294, 0.3869, 0.17, 0.4067]}, {"w": "sorted", "b": [0.1763, 0.3869, 0.238, 0.4067]}, {"w": "my", "b": [0.2443, 0.3869, 0.2765, 0.4067]}, {"w": "suggested", "b": [0.2828, 0.3869, 0.3823, 0.4067]}, {"w": "applications", "b": [0.3886, 0.3869, 0.5105, 0.4067]}, {"w": "by", "b": [0.5169, 0.3869, 0.5421, 0.4067]}, {"w": "input", "b": [0.5484, 0.3869, 0.6003, 0.4067]}, {"w": "and", "b": [0.6066, 0.3869, 0.643, 0.4067]}, {"w": "output", "b": [0.6493, 0.3869, 0.7138, 0.4067]}, {"w": "modalities.", "b": [0.7201, 0.3869, 0.8315, 0.4067]}, {"w": "Note", "b": [0.1294, 0.4074, 0.1785, 0.4272]}, {"w": "that", "b": [0.1848, 0.4074, 0.2226, 0.4272]}, {"w": "quite", "b": [0.2289, 0.4074, 0.2794, 0.4272]}, {"w": "a", "b": [0.2857, 0.4074, 0.2969, 0.4272]}, {"w": "few", "b": [0.3032, 0.4074, 0.341, 0.4272]}, {"w": "of", "b": [0.3473, 0.4074, 0.3683, 0.4272]}, {"w": "them", "b": [0.3746, 0.4074, 0.4251, 0.4272]}, {"w": "stretch", "b": [0.4314, 0.4074, 0.4986, 0.4272]}, {"w": "the", "b": [0.5049, 0.4074, 0.5357, 0.4272]}, {"w": "limits", "b": [0.5421, 0.4074, 0.5995, 0.4272]}, {"w": "of", "b": [0.6059, 0.4074, 0.6269, 0.4272]}, {"w": "what", "b": [0.6331, 0.4074, 0.6821, 0.4272]}, {"w": "is", "b": [0.6884, 0.4074, 0.7053, 0.4272]}, {"w": "possible—", "b": [0.7116, 0.4074, 0.8195, 0.4272]}, {"w": "although", "b": [0.1294, 0.4279, 0.2177, 0.4477]}, {"w": "a", "b": [0.224, 0.4279, 0.2352, 0.4477]}, {"w": "model", "b": [0.2415, 0.4279, 0.3046, 0.4477]}, {"w": "could", "b": [0.3109, 0.4279, 0.3669, 0.4477]}, {"w": "be", "b": [0.3732, 0.4279, 0.3971, 0.4477]}, {"w": "trained", "b": [0.4034, 0.4279, 0.4734, 0.4477]}, {"w": "on", "b": [0.4797, 0.4279, 0.5049, 0.4477]}, {"w": "all", "b": [0.5113, 0.4279, 0.5365, 0.4477]}, {"w": "of", "b": [0.5428, 0.4279, 0.5638, 0.4477]}, {"w": "these", "b": [0.5701, 0.4279, 0.6219, 0.4477]}, {"w": "tasks,", "b": [0.6283, 0.4279, 0.685, 0.4477]}, {"w": "in", "b": [0.6913, 0.4279, 0.7109, 0.4477]}, {"w": "some", "b": [0.7172, 0.4279, 0.7705, 0.4477]}, {"w": "cases", "b": [0.7768, 0.4279, 0.83, 0.4477]}, {"w": "such", "b": [0.1294, 0.4484, 0.1757, 0.4682]}, {"w": "a", "b": [0.182, 0.4484, 0.1932, 0.4682]}, {"w": "model", "b": [0.1995, 0.4484, 0.2625, 0.4682]}, {"w": "probably", "b": [0.2688, 0.4484, 0.3585, 0.4682]}, {"w": "wouldn’t", "b": [0.3648, 0.4484, 0.4554, 0.4682]}, {"w": "generalize", "b": [0.4617, 0.4484, 0.5654, 0.4682]}, {"w": "far", "b": [0.5717, 0.4484, 0.5997, 0.4682]}, {"w": "from", "b": [0.606, 0.4484, 0.655, 0.4682]}, {"w": "its", "b": [0.6613, 0.4484, 0.6851, 0.4682]}, {"w": "training", "b": [0.6914, 0.4484, 0.7699, 0.4682]}, {"w": "data.", "b": [0.7762, 0.4484, 0.8246, 0.4682]}, {"w": "Sections", "b": [0.1294, 0.4689, 0.2149, 0.4887]}, {"w": "9.2", "b": [0.2212, 0.4689, 0.2527, 0.4887]}, {"w": "and", "b": [0.259, 0.4689, 0.2955, 0.4887]}, {"w": "9.3", "b": [0.3018, 0.4689, 0.3333, 0.4887]}, {"w": "will", "b": [0.3396, 0.4689, 0.3788, 0.4887]}, {"w": "address", "b": [0.3852, 0.4689, 0.4608, 0.4887]}, {"w": "how", "b": [0.4671, 0.4689, 0.5105, 0.4887]}, {"w": "these", "b": [0.5169, 0.4689, 0.5687, 0.4887]}, {"w": "limitations", "b": [0.575, 0.4689, 0.6829, 0.4887]}, {"w": "could", "b": [0.6892, 0.4689, 0.7453, 0.4887]}, {"w": "be", "b": [0.7516, 0.4689, 0.7754, 0.4887]}, {"w": "lifted", "b": [0.7817, 0.4689, 0.835, 0.4887]}, {"w": "in", "b": [0.8413, 0.4689, 0.8609, 0.4887]}, {"w": "the", "b": [0.1294, 0.4894, 0.1602, 0.5092]}, {"w": "future.", "b": [0.1665, 0.4894, 0.2331, 0.5092]}]}, {"id": "b_4", "type": "paragraph", "text": "Mapping vector data to vector data", "words": [{"w": "Mapping", "b": [0.1799, 0.5278, 0.271, 0.5475]}, {"w": "vector", "b": [0.2773, 0.5278, 0.3403, 0.5475]}, {"w": "data", "b": [0.3466, 0.5278, 0.3886, 0.5475]}, {"w": "to", "b": [0.3949, 0.5278, 0.4146, 0.5475]}, {"w": "vector", "b": [0.4209, 0.5278, 0.4839, 0.5475]}, {"w": "data", "b": [0.4902, 0.5278, 0.5322, 0.5475]}]}, {"id": "b_5", "type": "paragraph", "text": "Predictive healthcare— Mapping patient medical records to predictions of patient outcomes Behavioral targeting— Mapping a set of website attributes with data on how long a user will spend on the website Product quality control— Mapping a set of attributes relative to an instance of a manufactured product with the probability that the product will fail by next year Mapping image data to vector data", "words": [{"w": "Predictive", "b": [0.2303, 0.5661, 0.334, 0.5858]}, {"w": "healthcare—", "b": [0.3403, 0.5661, 0.4762, 0.5858]}, {"w": "Mapping", "b": [0.4825, 0.5661, 0.5736, 0.5858]}, {"w": "patient", "b": [0.5799, 0.5661, 0.6486, 0.5858]}, {"w": "medical", "b": [0.6549, 0.5661, 0.7347, 0.5858]}, {"w": "records", "b": [0.741, 0.5661, 0.8153, 0.5858]}, {"w": "to", "b": [0.8216, 0.5661, 0.8412, 0.5858]}, {"w": "predictions", "b": [0.2303, 0.5866, 0.3424, 0.6063]}, {"w": "of", "b": [0.3487, 0.5866, 0.3697, 0.6063]}, {"w": "patient", "b": [0.376, 0.5866, 0.4447, 0.6063]}, {"w": "outcomes", "b": [0.451, 0.5866, 0.5477, 0.6063]}, {"w": "Behavioral", "b": [0.2303, 0.6071, 0.3452, 0.6268]}, {"w": "targeting—", "b": [0.3516, 0.6071, 0.4707, 0.6268]}, {"w": "Mapping", "b": [0.477, 0.6071, 0.5681, 0.6268]}, {"w": "a", "b": [0.5744, 0.6071, 0.5856, 0.6268]}, {"w": "set", "b": [0.5919, 0.6071, 0.6199, 0.6268]}, {"w": "of", "b": [0.6262, 0.6071, 0.6472, 0.6268]}, {"w": "website", "b": [0.6535, 0.6071, 0.7306, 0.6268]}, {"w": "attributes", "b": [0.7369, 0.6071, 0.8308, 0.6268]}, {"w": "with", "b": [0.2303, 0.6276, 0.2752, 0.6473]}, {"w": "data", "b": [0.2815, 0.6276, 0.3235, 0.6473]}, {"w": "on", "b": [0.3298, 0.6276, 0.355, 0.6473]}, {"w": "how", "b": [0.3613, 0.6276, 0.4048, 0.6473]}, {"w": "long", "b": [0.4111, 0.6276, 0.4559, 0.6473]}, {"w": "a", "b": [0.4622, 0.6276, 0.4734, 0.6473]}, {"w": "user", "b": [0.4797, 0.6276, 0.5218, 0.6473]}, {"w": "will", "b": [0.5281, 0.6276, 0.5673, 0.6473]}, {"w": "spend", "b": [0.5736, 0.6276, 0.6325, 0.6473]}, {"w": "on", "b": [0.6388, 0.6276, 0.664, 0.6473]}, {"w": "the", "b": [0.6703, 0.6276, 0.7012, 0.6473]}, {"w": "website", "b": [0.7075, 0.6276, 0.7845, 0.6473]}, {"w": "Product", "b": [0.2303, 0.6481, 0.313, 0.6678]}, {"w": "quality", "b": [0.3193, 0.6481, 0.3908, 0.6678]}, {"w": "control—", "b": [0.3971, 0.6481, 0.4966, 0.6678]}, {"w": "Mapping", "b": [0.5029, 0.6481, 0.594, 0.6678]}, {"w": "a", "b": [0.6003, 0.6481, 0.6115, 0.6678]}, {"w": "set", "b": [0.6178, 0.6481, 0.6458, 0.6678]}, {"w": "of", "b": [0.6521, 0.6481, 0.6731, 0.6678]}, {"w": "attributes", "b": [0.6794, 0.6481, 0.7733, 0.6678]}, {"w": "relative", "b": [0.7796, 0.6481, 0.8553, 0.6678]}, {"w": "to", "b": [0.2303, 0.6686, 0.2499, 0.6883]}, {"w": "an", "b": [0.2562, 0.6686, 0.2801, 0.6883]}, {"w": "instance", "b": [0.2864, 0.6686, 0.369, 0.6883]}, {"w": "of", "b": [0.3753, 0.6686, 0.3964, 0.6883]}, {"w": "a", "b": [0.4027, 0.6686, 0.4139, 0.6883]}, {"w": "manufactured", "b": [0.4202, 0.6686, 0.5589, 0.6883]}, {"w": "product", "b": [0.5652, 0.6686, 0.6422, 0.6883]}, {"w": "with", "b": [0.6485, 0.6686, 0.6934, 0.6883]}, {"w": "the", "b": [0.6997, 0.6686, 0.7305, 0.6883]}, {"w": "probability", "b": [0.7368, 0.6686, 0.8475, 0.6883]}, {"w": "that", "b": [0.2303, 0.6891, 0.2682, 0.7088]}, {"w": "the", "b": [0.2745, 0.6891, 0.3053, 0.7088]}, {"w": "product", "b": [0.3116, 0.6891, 0.3887, 0.7088]}, {"w": "will", "b": [0.395, 0.6891, 0.4342, 0.7088]}, {"w": "fail", "b": [0.4405, 0.6891, 0.4741, 0.7088]}, {"w": "by", "b": [0.4804, 0.6891, 0.5056, 0.7088]}, {"w": "next", "b": [0.5119, 0.6891, 0.5554, 0.7088]}, {"w": "year", "b": [0.5617, 0.6891, 0.6051, 0.7088]}, {"w": "Mapping", "b": [0.1799, 0.7096, 0.271, 0.7293]}, {"w": "image", "b": [0.2773, 0.7096, 0.3389, 0.7293]}, {"w": "data", "b": [0.3452, 0.7096, 0.3872, 0.7293]}, {"w": "to", "b": [0.3936, 0.7096, 0.4132, 0.7293]}, {"w": "vector", "b": [0.4195, 0.7096, 0.4825, 0.7293]}, {"w": "data", "b": [0.4888, 0.7096, 0.5309, 0.7293]}]}, {"id": "b_6", "type": "paragraph", "text": "Doctor assistant— Mapping slides of medical images with a prediction about the presence of a tumor Self-driving vehicle— Mapping car dash-cam video frames to steering wheel angle commands Board game AI— Mapping Go and chess boards to the next player move Diet helper— Mapping pictures of a dish to its calorie count Age prediction— Mapping selfies to the age of the person", "words": [{"w": "Doctor", "b": [0.2303, 0.7479, 0.3018, 0.7677]}, {"w": "assistant—", "b": [0.3081, 0.7479, 0.423, 0.7677]}, {"w": "Mapping", "b": [0.4293, 0.7479, 0.5204, 0.7677]}, {"w": "slides", "b": [0.5267, 0.7479, 0.5842, 0.7677]}, {"w": "of", "b": [0.5905, 0.7479, 0.6115, 0.7677]}, {"w": "medical", "b": [0.6178, 0.7479, 0.6977, 0.7677]}, {"w": "images", "b": [0.704, 0.7479, 0.7755, 0.7677]}, {"w": "with", "b": [0.7818, 0.7479, 0.8266, 0.7677]}, {"w": "a", "b": [0.8329, 0.7479, 0.8441, 0.7677]}, {"w": "prediction", "b": [0.2303, 0.7684, 0.3326, 0.7882]}, {"w": "about", "b": [0.3389, 0.7684, 0.395, 0.7882]}, {"w": "the", "b": [0.4013, 0.7684, 0.4321, 0.7882]}, {"w": "presence", "b": [0.4384, 0.7684, 0.5266, 0.7882]}, {"w": "of", "b": [0.5329, 0.7684, 0.554, 0.7882]}, {"w": "a", "b": [0.5603, 0.7684, 0.5715, 0.7882]}, {"w": "tumor", "b": [0.5778, 0.7684, 0.638, 0.7882]}, {"w": "Self-driving", "b": [0.2303, 0.7889, 0.3536, 0.8087]}, {"w": "vehicle—", "b": [0.36, 0.7889, 0.458, 0.8087]}, {"w": "Mapping", "b": [0.4643, 0.7889, 0.5554, 0.8087]}, {"w": "car", "b": [0.5617, 0.7889, 0.5925, 0.8087]}, {"w": "dash-cam", "b": [0.5988, 0.7889, 0.6955, 0.8087]}, {"w": "video", "b": [0.7018, 0.7889, 0.7578, 0.8087]}, {"w": "frames", "b": [0.7641, 0.7889, 0.8328, 0.8087]}, {"w": "to", "b": [0.8391, 0.7889, 0.8587, 0.8087]}, {"w": "steering", "b": [0.2303, 0.8094, 0.3102, 0.8292]}, {"w": "wheel", "b": [0.3165, 0.8094, 0.3767, 0.8292]}, {"w": "angle", "b": [0.383, 0.8094, 0.4377, 0.8292]}, {"w": "commands", "b": [0.444, 0.8094, 0.5533, 0.8292]}, {"w": "Board", "b": [0.2303, 0.8299, 0.2948, 0.8497]}, {"w": "game", "b": [0.3011, 0.8299, 0.3572, 0.8497]}, {"w": "AI—", "b": [0.3635, 0.8299, 0.4153, 0.8497]}, {"w": "Mapping", "b": [0.4216, 0.8299, 0.5127, 0.8497]}, {"w": "Go", "b": [0.519, 0.8299, 0.5498, 0.8497]}, {"w": "and", "b": [0.5561, 0.8299, 0.5926, 0.8497]}, {"w": "chess", "b": [0.5989, 0.8299, 0.6535, 0.8497]}, {"w": "boards", "b": [0.6598, 0.8299, 0.7271, 0.8497]}, {"w": "to", "b": [0.7334, 0.8299, 0.753, 0.8497]}, {"w": "the", "b": [0.7593, 0.8299, 0.7901, 0.8497]}, {"w": "next", "b": [0.7964, 0.8299, 0.8399, 0.8497]}, {"w": "player", "b": [0.2303, 0.8504, 0.2934, 0.8702]}, {"w": "move", "b": [0.2997, 0.8504, 0.3557, 0.8702]}, {"w": "Diet", "b": [0.2303, 0.8709, 0.2738, 0.8907]}, {"w": "helper—", "b": [0.2801, 0.8709, 0.3712, 0.8907]}, {"w": "Mapping", "b": [0.3774, 0.8709, 0.4685, 0.8907]}, {"w": "pictures", "b": [0.4748, 0.8709, 0.5547, 0.8907]}, {"w": "of", "b": [0.561, 0.8709, 0.582, 0.8907]}, {"w": "a", "b": [0.5883, 0.8709, 0.5995, 0.8907]}, {"w": "dish", "b": [0.6058, 0.8709, 0.6479, 0.8907]}, {"w": "to", "b": [0.6542, 0.8709, 0.6738, 0.8907]}, {"w": "its", "b": [0.6801, 0.8709, 0.704, 0.8907]}, {"w": "calorie", "b": [0.7103, 0.8709, 0.7789, 0.8907]}, {"w": "count", "b": [0.7852, 0.8709, 0.8413, 0.8907]}, {"w": "Age", "b": [0.2303, 0.8914, 0.271, 0.9112]}, {"w": "prediction—", "b": [0.2773, 0.8914, 0.4076, 0.9112]}, {"w": "Mapping", "b": [0.4139, 0.8914, 0.505, 0.9112]}, {"w": "selfies", "b": [0.5113, 0.8914, 0.5757, 0.9112]}, {"w": "to", "b": [0.582, 0.8914, 0.6017, 0.9112]}, {"w": "the", "b": [0.608, 0.8914, 0.6388, 0.9112]}, {"w": "age", "b": [0.6451, 0.8914, 0.6801, 0.9112]}, {"w": "of", "b": [0.6864, 0.8914, 0.7074, 0.9112]}, {"w": "the", "b": [0.7138, 0.8914, 0.7446, 0.9112]}, {"w": "person", "b": [0.7509, 0.8914, 0.8181, 0.9112]}]}]}, {"page": 423, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Mapping timeseries data to vector data", "words": [{"w": "Mapping", "b": [0.1799, 0.0857, 0.271, 0.1054]}, {"w": "timeseries", "b": [0.2773, 0.0857, 0.3796, 0.1054]}, {"w": "data", "b": [0.3859, 0.0857, 0.4279, 0.1054]}, {"w": "to", "b": [0.4342, 0.0857, 0.4538, 0.1054]}, {"w": "vector", "b": [0.4601, 0.0857, 0.5232, 0.1054]}, {"w": "data", "b": [0.5295, 0.0857, 0.5715, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Weather prediction— Mapping timeseries of weather data in a grid of locations of weather data the following week at a specific location Brain-computer interfaces— Mapping timeseries of magnetoencephalogram (MEG) data to computer commands Behavioral targeting— Mapping timeseries of user interactions on a website to the probability that a user will buy something Mapping text to text", "words": [{"w": "Weather", "b": [0.2303, 0.124, 0.3167, 0.1437]}, {"w": "prediction—", "b": [0.323, 0.124, 0.4534, 0.1437]}, {"w": "Mapping", "b": [0.4597, 0.124, 0.5508, 0.1437]}, {"w": "timeseries", "b": [0.5571, 0.124, 0.6594, 0.1437]}, {"w": "of", "b": [0.6657, 0.124, 0.6867, 0.1437]}, {"w": "weather", "b": [0.693, 0.124, 0.7728, 0.1437]}, {"w": "data", "b": [0.7791, 0.124, 0.8212, 0.1437]}, {"w": "in", "b": [0.8275, 0.124, 0.8471, 0.1437]}, {"w": "a", "b": [0.8534, 0.124, 0.8646, 0.1437]}, {"w": "grid", "b": [0.2303, 0.1445, 0.271, 0.1642]}, {"w": "of", "b": [0.2773, 0.1445, 0.2983, 0.1642]}, {"w": "locations", "b": [0.3046, 0.1445, 0.3957, 0.1642]}, {"w": "of", "b": [0.402, 0.1445, 0.423, 0.1642]}, {"w": "weather", "b": [0.4293, 0.1445, 0.5091, 0.1642]}, {"w": "data", "b": [0.5154, 0.1445, 0.5575, 0.1642]}, {"w": "the", "b": [0.5638, 0.1445, 0.5946, 0.1642]}, {"w": "following", "b": [0.6009, 0.1445, 0.699, 0.1642]}, {"w": "week", "b": [0.7053, 0.1445, 0.7585, 0.1642]}, {"w": "at", "b": [0.7648, 0.1445, 0.7831, 0.1642]}, {"w": "a", "b": [0.7894, 0.1445, 0.8006, 0.1642]}, {"w": "specific", "b": [0.2303, 0.165, 0.3088, 0.1847]}, {"w": "location", "b": [0.3151, 0.165, 0.3964, 0.1847]}, {"w": "Brain-computer", "b": [0.2303, 0.1855, 0.3971, 0.2052]}, {"w": "interfaces—", "b": [0.4034, 0.1855, 0.5309, 0.2052]}, {"w": "Mapping", "b": [0.5372, 0.1855, 0.6283, 0.2052]}, {"w": "timeseries", "b": [0.6346, 0.1855, 0.7369, 0.2052]}, {"w": "of", "b": [0.7432, 0.1855, 0.7642, 0.2052]}, {"w": "magnetoencephalogram", "b": [0.2303, 0.206, 0.4713, 0.2257]}, {"w": "(MEG)", "b": [0.4776, 0.206, 0.5505, 0.2257]}, {"w": "data", "b": [0.5568, 0.206, 0.5988, 0.2257]}, {"w": "to", "b": [0.6051, 0.206, 0.6247, 0.2257]}, {"w": "computer", "b": [0.631, 0.206, 0.7263, 0.2257]}, {"w": "commands", "b": [0.7326, 0.206, 0.8419, 0.2257]}, {"w": "Behavioral", "b": [0.2303, 0.2265, 0.3452, 0.2462]}, {"w": "targeting—", "b": [0.3516, 0.2265, 0.4707, 0.2462]}, {"w": "Mapping", "b": [0.477, 0.2265, 0.5681, 0.2462]}, {"w": "timeseries", "b": [0.5744, 0.2265, 0.6767, 0.2462]}, {"w": "of", "b": [0.683, 0.2265, 0.704, 0.2462]}, {"w": "user", "b": [0.7103, 0.2265, 0.7523, 0.2462]}, {"w": "interactions", "b": [0.2303, 0.247, 0.348, 0.2667]}, {"w": "on", "b": [0.3543, 0.247, 0.3796, 0.2667]}, {"w": "a", "b": [0.3859, 0.247, 0.3971, 0.2667]}, {"w": "website", "b": [0.4034, 0.247, 0.4804, 0.2667]}, {"w": "to", "b": [0.4867, 0.247, 0.5064, 0.2667]}, {"w": "the", "b": [0.5127, 0.247, 0.5435, 0.2667]}, {"w": "probability", "b": [0.5498, 0.247, 0.6605, 0.2667]}, {"w": "that", "b": [0.6668, 0.247, 0.7047, 0.2667]}, {"w": "a", "b": [0.711, 0.247, 0.7222, 0.2667]}, {"w": "user", "b": [0.7285, 0.247, 0.7705, 0.2667]}, {"w": "will", "b": [0.7768, 0.247, 0.8161, 0.2667]}, {"w": "buy", "b": [0.8224, 0.247, 0.8602, 0.2667]}, {"w": "something", "b": [0.2303, 0.2675, 0.3354, 0.2872]}, {"w": "Mapping", "b": [0.1799, 0.288, 0.271, 0.3077]}, {"w": "text", "b": [0.2773, 0.288, 0.3151, 0.3077]}, {"w": "to", "b": [0.3214, 0.288, 0.341, 0.3077]}, {"w": "text", "b": [0.3473, 0.288, 0.3852, 0.3077]}]}, {"id": "b_2", "type": "paragraph", "text": "Smart reply— Mapping emails to possible one-line replies Answering questions— Mapping general-knowledge questions to answers Summarization— Mapping a long article to a short summary of the article Mapping images to text", "words": [{"w": "Smart", "b": [0.2303, 0.3263, 0.2934, 0.3461]}, {"w": "reply—", "b": [0.2997, 0.3263, 0.3768, 0.3461]}, {"w": "Mapping", "b": [0.3831, 0.3263, 0.4742, 0.3461]}, {"w": "emails", "b": [0.4805, 0.3263, 0.5463, 0.3461]}, {"w": "to", "b": [0.5526, 0.3263, 0.5723, 0.3461]}, {"w": "possible", "b": [0.5786, 0.3263, 0.6613, 0.3461]}, {"w": "one-line", "b": [0.6676, 0.3263, 0.7502, 0.3461]}, {"w": "replies", "b": [0.7565, 0.3263, 0.8238, 0.3461]}, {"w": "Answering", "b": [0.2303, 0.3468, 0.3425, 0.3666]}, {"w": "questions—", "b": [0.3488, 0.3468, 0.4721, 0.3666]}, {"w": "Mapping", "b": [0.4784, 0.3468, 0.5695, 0.3666]}, {"w": "general-knowledge", "b": [0.5758, 0.3468, 0.7692, 0.3666]}, {"w": "questions", "b": [0.2303, 0.3673, 0.3256, 0.3871]}, {"w": "to", "b": [0.3319, 0.3673, 0.3516, 0.3871]}, {"w": "answers", "b": [0.3579, 0.3673, 0.4391, 0.3871]}, {"w": "Summarization—", "b": [0.2303, 0.3878, 0.4154, 0.4076]}, {"w": "Mapping", "b": [0.4217, 0.3878, 0.5128, 0.4076]}, {"w": "a", "b": [0.5191, 0.3878, 0.5303, 0.4076]}, {"w": "long", "b": [0.5366, 0.3878, 0.5814, 0.4076]}, {"w": "article", "b": [0.5877, 0.3878, 0.6508, 0.4076]}, {"w": "to", "b": [0.6571, 0.3878, 0.6767, 0.4076]}, {"w": "a", "b": [0.683, 0.3878, 0.6942, 0.4076]}, {"w": "short", "b": [0.7005, 0.3878, 0.751, 0.4076]}, {"w": "summary", "b": [0.7573, 0.3878, 0.8512, 0.4076]}, {"w": "of", "b": [0.2303, 0.4083, 0.2513, 0.4281]}, {"w": "the", "b": [0.2576, 0.4083, 0.2885, 0.4281]}, {"w": "article", "b": [0.2948, 0.4083, 0.3578, 0.4281]}, {"w": "Mapping", "b": [0.1799, 0.4288, 0.271, 0.4486]}, {"w": "images", "b": [0.2773, 0.4288, 0.3487, 0.4486]}, {"w": "to", "b": [0.355, 0.4288, 0.3747, 0.4486]}, {"w": "text", "b": [0.381, 0.4288, 0.4188, 0.4486]}]}, {"id": "b_3", "type": "paragraph", "text": "Captioning— Mapping images to short captions describing the contents of the images Mapping text to images", "words": [{"w": "Captioning—", "b": [0.2303, 0.4672, 0.3719, 0.4869]}, {"w": "Mapping", "b": [0.3782, 0.4672, 0.4693, 0.4869]}, {"w": "images", "b": [0.4756, 0.4672, 0.5471, 0.4869]}, {"w": "to", "b": [0.5534, 0.4672, 0.573, 0.4869]}, {"w": "short", "b": [0.5793, 0.4672, 0.6298, 0.4869]}, {"w": "captions", "b": [0.6361, 0.4672, 0.7201, 0.4869]}, {"w": "describing", "b": [0.7264, 0.4672, 0.8315, 0.4869]}, {"w": "the", "b": [0.8378, 0.4672, 0.8687, 0.4869]}, {"w": "contents", "b": [0.2303, 0.4877, 0.3144, 0.5074]}, {"w": "of", "b": [0.3207, 0.4877, 0.3417, 0.5074]}, {"w": "the", "b": [0.348, 0.4877, 0.3788, 0.5074]}, {"w": "images", "b": [0.3852, 0.4877, 0.4566, 0.5074]}, {"w": "Mapping", "b": [0.1799, 0.5082, 0.271, 0.5279]}, {"w": "text", "b": [0.2773, 0.5082, 0.3151, 0.5279]}, {"w": "to", "b": [0.3214, 0.5082, 0.341, 0.5279]}, {"w": "images", "b": [0.3473, 0.5082, 0.4188, 0.5279]}]}, {"id": "b_4", "type": "paragraph", "text": "Conditioned image generation— Mapping a short text description to images matching the description Logo generation/selection— Mapping the name and description of a company to the company’s logo Mapping images to images", "words": [{"w": "Conditioned", "b": [0.2303, 0.5465, 0.3579, 0.5662]}, {"w": "image", "b": [0.3642, 0.5465, 0.4273, 0.5662]}, {"w": "generation—", "b": [0.4336, 0.5465, 0.5709, 0.5662]}, {"w": "Mapping", "b": [0.5772, 0.5465, 0.6683, 0.5662]}, {"w": "a", "b": [0.6746, 0.5465, 0.6858, 0.5662]}, {"w": "short", "b": [0.6921, 0.5465, 0.7425, 0.5662]}, {"w": "text", "b": [0.7489, 0.5465, 0.7867, 0.5662]}, {"w": "description", "b": [0.2303, 0.567, 0.3424, 0.5867]}, {"w": "to", "b": [0.3487, 0.567, 0.3684, 0.5867]}, {"w": "images", "b": [0.3747, 0.567, 0.4461, 0.5867]}, {"w": "matching", "b": [0.4524, 0.567, 0.5463, 0.5867]}, {"w": "the", "b": [0.5526, 0.567, 0.5835, 0.5867]}, {"w": "description", "b": [0.5898, 0.567, 0.7019, 0.5867]}, {"w": "Logo", "b": [0.2303, 0.5875, 0.2836, 0.6072]}, {"w": "generation/selection—", "b": [0.2899, 0.5875, 0.5253, 0.6072]}, {"w": "Mapping", "b": [0.5316, 0.5875, 0.6227, 0.6072]}, {"w": "the", "b": [0.629, 0.5875, 0.6598, 0.6072]}, {"w": "name", "b": [0.6661, 0.5875, 0.7208, 0.6072]}, {"w": "and", "b": [0.7271, 0.5875, 0.7635, 0.6072]}, {"w": "description", "b": [0.2303, 0.608, 0.3424, 0.6277]}, {"w": "of", "b": [0.3487, 0.608, 0.3697, 0.6277]}, {"w": "a", "b": [0.376, 0.608, 0.3872, 0.6277]}, {"w": "company", "b": [0.3936, 0.608, 0.486, 0.6277]}, {"w": "to", "b": [0.4923, 0.608, 0.512, 0.6277]}, {"w": "the", "b": [0.5183, 0.608, 0.5491, 0.6277]}, {"w": "company’s", "b": [0.5554, 0.608, 0.6646, 0.6277]}, {"w": "logo", "b": [0.6709, 0.608, 0.7158, 0.6277]}, {"w": "Mapping", "b": [0.1799, 0.6285, 0.271, 0.6482]}, {"w": "images", "b": [0.2773, 0.6285, 0.3487, 0.6482]}, {"w": "to", "b": [0.355, 0.6285, 0.3747, 0.6482]}, {"w": "images", "b": [0.381, 0.6285, 0.4524, 0.6482]}]}, {"id": "b_5", "type": "paragraph", "text": "Super-resolution— Mapping downsized images to higher- resolution versions of the same images Visual depth sensing— Mapping images of indoor environments to maps of depth predictions Mapping images and text to text", "words": [{"w": "Super-resolution—", "b": [0.2303, 0.6668, 0.4308, 0.6866]}, {"w": "Mapping", "b": [0.4371, 0.6668, 0.5282, 0.6866]}, {"w": "downsized", "b": [0.5345, 0.6668, 0.6424, 0.6866]}, {"w": "images", "b": [0.6487, 0.6668, 0.7201, 0.6866]}, {"w": "to", "b": [0.7264, 0.6668, 0.7461, 0.6866]}, {"w": "higher-", "b": [0.7524, 0.6668, 0.8247, 0.6866]}, {"w": "resolution", "b": [0.2303, 0.6873, 0.3312, 0.7071]}, {"w": "versions", "b": [0.3375, 0.6873, 0.4216, 0.7071]}, {"w": "of", "b": [0.4279, 0.6873, 0.4489, 0.7071]}, {"w": "the", "b": [0.4552, 0.6873, 0.4861, 0.7071]}, {"w": "same", "b": [0.4924, 0.6873, 0.5442, 0.7071]}, {"w": "images", "b": [0.5505, 0.6873, 0.622, 0.7071]}, {"w": "Visual", "b": [0.2303, 0.7078, 0.2962, 0.7276]}, {"w": "depth", "b": [0.3025, 0.7078, 0.36, 0.7276]}, {"w": "sensing—", "b": [0.3663, 0.7078, 0.47, 0.7276]}, {"w": "Mapping", "b": [0.4763, 0.7078, 0.5674, 0.7276]}, {"w": "images", "b": [0.5737, 0.7078, 0.6452, 0.7276]}, {"w": "of", "b": [0.6515, 0.7078, 0.6725, 0.7276]}, {"w": "indoor", "b": [0.6788, 0.7078, 0.7447, 0.7276]}, {"w": "environments", "b": [0.2303, 0.7283, 0.3676, 0.7481]}, {"w": "to", "b": [0.374, 0.7283, 0.3936, 0.7481]}, {"w": "maps", "b": [0.3999, 0.7283, 0.4531, 0.7481]}, {"w": "of", "b": [0.4594, 0.7283, 0.4805, 0.7481]}, {"w": "depth", "b": [0.4868, 0.7283, 0.5428, 0.7481]}, {"w": "predictions", "b": [0.5491, 0.7283, 0.6612, 0.7481]}, {"w": "Mapping", "b": [0.1799, 0.7488, 0.271, 0.7686]}, {"w": "images", "b": [0.2773, 0.7488, 0.3487, 0.7686]}, {"w": "and", "b": [0.355, 0.7488, 0.3915, 0.7686]}, {"w": "text", "b": [0.3978, 0.7488, 0.4356, 0.7686]}, {"w": "to", "b": [0.4419, 0.7488, 0.4615, 0.7686]}, {"w": "text", "b": [0.4678, 0.7488, 0.5057, 0.7686]}]}, {"id": "b_6", "type": "paragraph", "text": "Visual QA— Mapping images and natural-language questions about the contents of images to natural-language answers Mapping video and text to text", "words": [{"w": "Visual", "b": [0.2303, 0.7871, 0.2962, 0.8069]}, {"w": "QA—", "b": [0.3025, 0.7871, 0.3628, 0.8069]}, {"w": "Mapping", "b": [0.3691, 0.7871, 0.4602, 0.8069]}, {"w": "images", "b": [0.4665, 0.7871, 0.538, 0.8069]}, {"w": "and", "b": [0.5443, 0.7871, 0.5807, 0.8069]}, {"w": "natural-language", "b": [0.587, 0.7871, 0.7565, 0.8069]}, {"w": "questions", "b": [0.7628, 0.7871, 0.8581, 0.8069]}, {"w": "about", "b": [0.2303, 0.8076, 0.2864, 0.8274]}, {"w": "the", "b": [0.2927, 0.8076, 0.3235, 0.8274]}, {"w": "contents", "b": [0.3298, 0.8076, 0.4139, 0.8274]}, {"w": "of", "b": [0.4202, 0.8076, 0.4412, 0.8274]}, {"w": "images", "b": [0.4475, 0.8076, 0.519, 0.8274]}, {"w": "to", "b": [0.5253, 0.8076, 0.5449, 0.8274]}, {"w": "natural-language", "b": [0.5512, 0.8076, 0.7207, 0.8274]}, {"w": "answers", "b": [0.727, 0.8076, 0.8083, 0.8274]}, {"w": "Mapping", "b": [0.1799, 0.8281, 0.271, 0.8479]}, {"w": "video", "b": [0.2773, 0.8281, 0.3333, 0.8479]}, {"w": "and", "b": [0.3396, 0.8281, 0.376, 0.8479]}, {"w": "text", "b": [0.3824, 0.8281, 0.4202, 0.8479]}, {"w": "to", "b": [0.4265, 0.8281, 0.4461, 0.8479]}, {"w": "text", "b": [0.4524, 0.8281, 0.4903, 0.8479]}]}, {"id": "b_7", "type": "paragraph", "text": "Video QA— Mapping short videos and natural-language questions about the contents of videos to natural-language", "words": [{"w": "Video", "b": [0.2303, 0.8665, 0.2892, 0.8862]}, {"w": "QA—", "b": [0.2955, 0.8665, 0.3558, 0.8862]}, {"w": "Mapping", "b": [0.3621, 0.8665, 0.4532, 0.8862]}, {"w": "short", "b": [0.4595, 0.8665, 0.5099, 0.8862]}, {"w": "videos", "b": [0.5162, 0.8665, 0.5821, 0.8862]}, {"w": "and", "b": [0.5884, 0.8665, 0.6248, 0.8862]}, {"w": "natural-language", "b": [0.6311, 0.8665, 0.8006, 0.8862]}, {"w": "questions", "b": [0.2303, 0.887, 0.3256, 0.9067]}, {"w": "about", "b": [0.3319, 0.887, 0.388, 0.9067]}, {"w": "the", "b": [0.3943, 0.887, 0.4251, 0.9067]}, {"w": "contents", "b": [0.4314, 0.887, 0.5155, 0.9067]}, {"w": "of", "b": [0.5218, 0.887, 0.5428, 0.9067]}, {"w": "videos", "b": [0.5491, 0.887, 0.615, 0.9067]}, {"w": "to", "b": [0.6213, 0.887, 0.6409, 0.9067]}, {"w": "natural-language", "b": [0.6472, 0.887, 0.8167, 0.9067]}]}]}, {"page": 424, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "answers", "words": [{"w": "answers", "b": [0.2303, 0.0857, 0.3116, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Almost anything is possible—but not quite anything. Let’s see in the next section what we can’t do with deep learning.", "words": [{"w": "Almost", "b": [0.1294, 0.1285, 0.1995, 0.1482]}, {"w": "anything", "b": [0.2058, 0.1285, 0.2941, 0.1482]}, {"w": "is", "b": [0.3004, 0.1285, 0.3172, 0.1482]}, {"w": "possible—but", "b": [0.3235, 0.1285, 0.4637, 0.1482]}, {"w": "not", "b": [0.47, 0.1285, 0.5022, 0.1482]}, {"w": "quite", "b": [0.5085, 0.1285, 0.559, 0.1482]}, {"w": "anything.", "b": [0.5652, 0.1285, 0.6598, 0.1482]}, {"w": "Let’s", "b": [0.6661, 0.1285, 0.7165, 0.1482]}, {"w": "see", "b": [0.7229, 0.1285, 0.7551, 0.1482]}, {"w": "in", "b": [0.7614, 0.1285, 0.781, 0.1482]}, {"w": "the", "b": [0.7873, 0.1285, 0.8181, 0.1482]}, {"w": "next", "b": [0.8244, 0.1285, 0.8679, 0.1482]}, {"w": "section", "b": [0.1294, 0.149, 0.2009, 0.1687]}, {"w": "what", "b": [0.2072, 0.149, 0.2562, 0.1687]}, {"w": "we", "b": [0.2625, 0.149, 0.2919, 0.1687]}, {"w": "can’t", "b": [0.2982, 0.149, 0.3473, 0.1687]}, {"w": "do", "b": [0.3536, 0.149, 0.3788, 0.1687]}, {"w": "with", "b": [0.3851, 0.149, 0.43, 0.1687]}, {"w": "deep", "b": [0.4363, 0.149, 0.4839, 0.1687]}, {"w": "learning.", "b": [0.4902, 0.149, 0.5792, 0.1687]}]}, {"id": "b_2", "type": "paragraph", "text": "9.2. The limitations of deep learning", "words": [{"w": "9.2.", "b": [0.1294, 0.2058, 0.172, 0.228]}, {"w": "The", "b": [0.1791, 0.2058, 0.2264, 0.228]}, {"w": "limitations", "b": [0.2335, 0.2058, 0.3628, 0.228]}, {"w": "of", "b": [0.3699, 0.2058, 0.3935, 0.228]}, {"w": "deep", "b": [0.4006, 0.2058, 0.4574, 0.228]}, {"w": "learning", "b": [0.4645, 0.2058, 0.5654, 0.228]}]}, {"id": "b_3", "type": "paragraph", "text": "The space of applications that can be implemented with deep learning is nearly infinite. And yet, many applications are completely out of reach for current deep-learning techniques—even given vast amounts of human-annotated data. Say, for instance, that you could assemble a dataset of hundreds of thousands—even millions—of English-language descriptions of the features of a software product, written by a product manager, as well as the corresponding source code developed by a team of engineers to meet these requirements. Even with this data, you could not train a deep-learning model to read a product description and generate the appropriate codebase. That’s just one example among many. In general, anything that requires reasoning—like programming or applying the scientific method—long-term planning, and algorithmic data manipulation is out of reach for deep-learning models, no matter how much data you throw at them. Even learning a sorting algorithm with a deep neural network is tremendously difficult.", "words": [{"w": "The", "b": [0.1294, 0.2515, 0.1686, 0.2712]}, {"w": "space", "b": [0.1749, 0.2515, 0.231, 0.2712]}, {"w": "of", "b": [0.2373, 0.2515, 0.2583, 0.2712]}, {"w": "applications", "b": [0.2646, 0.2515, 0.3865, 0.2712]}, {"w": "that", "b": [0.3928, 0.2515, 0.4307, 0.2712]}, {"w": "can", "b": [0.437, 0.2515, 0.472, 0.2712]}, {"w": "be", "b": [0.4783, 0.2515, 0.5021, 0.2712]}, {"w": "implemented", "b": [0.5084, 0.2515, 0.6401, 0.2712]}, {"w": "with", "b": [0.6464, 0.2515, 0.6913, 0.2712]}, {"w": "deep", "b": [0.6976, 0.2515, 0.7452, 0.2712]}, {"w": "learning", "b": [0.7515, 0.2515, 0.8342, 0.2712]}, {"w": "is", "b": [0.8405, 0.2515, 0.8573, 0.2712]}, {"w": "nearly", "b": [0.1294, 0.272, 0.1925, 0.2917]}, {"w": "infinite.", "b": [0.1988, 0.272, 0.2779, 0.2917]}, {"w": "And", "b": [0.2842, 0.272, 0.3277, 0.2917]}, {"w": "yet,", "b": [0.334, 0.272, 0.3711, 0.2917]}, {"w": "many", "b": [0.3774, 0.272, 0.4335, 0.2917]}, {"w": "applications", "b": [0.4398, 0.272, 0.5617, 0.2917]}, {"w": "are", "b": [0.568, 0.272, 0.5988, 0.2917]}, {"w": "completely", "b": [0.6051, 0.272, 0.7172, 0.2917]}, {"w": "out", "b": [0.7234, 0.272, 0.7557, 0.2917]}, {"w": "of", "b": [0.762, 0.272, 0.783, 0.2917]}, {"w": "reach", "b": [0.7893, 0.272, 0.8439, 0.2917]}, {"w": "for", "b": [0.1294, 0.2925, 0.1588, 0.3122]}, {"w": "current", "b": [0.1651, 0.2925, 0.2366, 0.3122]}, {"w": "deep-learning", "b": [0.2429, 0.2925, 0.3816, 0.3122]}, {"w": "techniques—even", "b": [0.3879, 0.2925, 0.5686, 0.3122]}, {"w": "given", "b": [0.5749, 0.2925, 0.631, 0.3122]}, {"w": "vast", "b": [0.6373, 0.2925, 0.6779, 0.3122]}, {"w": "amounts", "b": [0.6842, 0.2925, 0.7697, 0.3122]}, {"w": "of", "b": [0.776, 0.2925, 0.797, 0.3122]}, {"w": "human-annotated", "b": [0.1294, 0.313, 0.3046, 0.3327]}, {"w": "data.", "b": [0.3109, 0.313, 0.3592, 0.3327]}, {"w": "Say,", "b": [0.3655, 0.313, 0.408, 0.3327]}, {"w": "for", "b": [0.4143, 0.313, 0.4437, 0.3327]}, {"w": "instance,", "b": [0.45, 0.313, 0.539, 0.3327]}, {"w": "that", "b": [0.5453, 0.313, 0.5831, 0.3327]}, {"w": "you", "b": [0.5894, 0.313, 0.6272, 0.3327]}, {"w": "could", "b": [0.6335, 0.313, 0.6896, 0.3327]}, {"w": "assemble", "b": [0.6959, 0.313, 0.7884, 0.3327]}, {"w": "a", "b": [0.7947, 0.313, 0.8059, 0.3327]}, {"w": "dataset", "b": [0.1294, 0.3335, 0.1995, 0.3532]}, {"w": "of", "b": [0.2058, 0.3335, 0.2268, 0.3532]}, {"w": "hundreds", "b": [0.2331, 0.3335, 0.3256, 0.3532]}, {"w": "of", "b": [0.3319, 0.3335, 0.3529, 0.3532]}, {"w": "thousands—even", "b": [0.3592, 0.3335, 0.5329, 0.3532]}, {"w": "millions—of", "b": [0.5393, 0.3335, 0.6682, 0.3532]}, {"w": "English-language", "b": [0.6745, 0.3335, 0.8511, 0.3532]}, {"w": "descriptions", "b": [0.1294, 0.354, 0.2513, 0.3737]}, {"w": "of", "b": [0.2576, 0.354, 0.2786, 0.3737]}, {"w": "the", "b": [0.285, 0.354, 0.3158, 0.3737]}, {"w": "features", "b": [0.3221, 0.354, 0.4019, 0.3737]}, {"w": "of", "b": [0.4082, 0.354, 0.4292, 0.3737]}, {"w": "a", "b": [0.4356, 0.354, 0.4468, 0.3737]}, {"w": "software", "b": [0.453, 0.354, 0.5399, 0.3737]}, {"w": "product,", "b": [0.5462, 0.354, 0.6295, 0.3737]}, {"w": "written", "b": [0.6358, 0.354, 0.7073, 0.3737]}, {"w": "by", "b": [0.7136, 0.354, 0.7388, 0.3737]}, {"w": "a", "b": [0.7452, 0.354, 0.7564, 0.3737]}, {"w": "product", "b": [0.7627, 0.354, 0.8397, 0.3737]}, {"w": "manager,", "b": [0.1294, 0.3745, 0.2215, 0.3942]}, {"w": "as", "b": [0.2279, 0.3745, 0.2489, 0.3942]}, {"w": "well", "b": [0.2552, 0.3745, 0.2986, 0.3942]}, {"w": "as", "b": [0.3049, 0.3745, 0.3259, 0.3942]}, {"w": "the", "b": [0.3322, 0.3745, 0.3631, 0.3942]}, {"w": "corresponding", "b": [0.3694, 0.3745, 0.5137, 0.3942]}, {"w": "source", "b": [0.52, 0.3745, 0.5858, 0.3942]}, {"w": "code", "b": [0.5921, 0.3745, 0.6398, 0.3942]}, {"w": "developed", "b": [0.6461, 0.3745, 0.7497, 0.3942]}, {"w": "by", "b": [0.7561, 0.3745, 0.7813, 0.3942]}, {"w": "a", "b": [0.7876, 0.3745, 0.7988, 0.3942]}, {"w": "team", "b": [0.8051, 0.3745, 0.8541, 0.3942]}, {"w": "of", "b": [0.1294, 0.395, 0.1504, 0.4147]}, {"w": "engineers", "b": [0.1567, 0.395, 0.2534, 0.4147]}, {"w": "to", "b": [0.2597, 0.395, 0.2793, 0.4147]}, {"w": "meet", "b": [0.2856, 0.395, 0.3347, 0.4147]}, {"w": "these", "b": [0.341, 0.395, 0.3928, 0.4147]}, {"w": "requirements.", "b": [0.3991, 0.395, 0.5371, 0.4147]}, {"w": "Even", "b": [0.5434, 0.395, 0.5953, 0.4147]}, {"w": "with", "b": [0.6016, 0.395, 0.6464, 0.4147]}, {"w": "this", "b": [0.6527, 0.395, 0.6892, 0.4147]}, {"w": "data,", "b": [0.6955, 0.395, 0.7438, 0.4147]}, {"w": "you", "b": [0.7501, 0.395, 0.788, 0.4147]}, {"w": "could", "b": [0.7943, 0.395, 0.8503, 0.4147]}, {"w": "not", "b": [0.1294, 0.4155, 0.1617, 0.4352]}, {"w": "train", "b": [0.1679, 0.4155, 0.2142, 0.4352]}, {"w": "a", "b": [0.2205, 0.4155, 0.2317, 0.4352]}, {"w": "deep-learning", "b": [0.238, 0.4155, 0.3767, 0.4352]}, {"w": "model", "b": [0.383, 0.4155, 0.4461, 0.4352]}, {"w": "to", "b": [0.4524, 0.4155, 0.472, 0.4352]}, {"w": "read", "b": [0.4783, 0.4155, 0.5217, 0.4352]}, {"w": "a", "b": [0.528, 0.4155, 0.5392, 0.4352]}, {"w": "product", "b": [0.5455, 0.4155, 0.6226, 0.4352]}, {"w": "description", "b": [0.6289, 0.4155, 0.741, 0.4352]}, {"w": "and", "b": [0.7473, 0.4155, 0.7837, 0.4352]}, {"w": "generate", "b": [0.1294, 0.436, 0.2149, 0.4557]}, {"w": "the", "b": [0.2212, 0.436, 0.252, 0.4557]}, {"w": "appropriate", "b": [0.2583, 0.436, 0.3732, 0.4557]}, {"w": "codebase.", "b": [0.3795, 0.436, 0.4782, 0.4557]}, {"w": "That’s", "b": [0.4845, 0.436, 0.5475, 0.4557]}, {"w": "just", "b": [0.5538, 0.436, 0.5903, 0.4557]}, {"w": "one", "b": [0.5966, 0.436, 0.633, 0.4557]}, {"w": "example", "b": [0.6393, 0.436, 0.7248, 0.4557]}, {"w": "among", "b": [0.7311, 0.436, 0.7997, 0.4557]}, {"w": "many.", "b": [0.806, 0.436, 0.8667, 0.4557]}, {"w": "In", "b": [0.1294, 0.4565, 0.1504, 0.4762]}, {"w": "general,", "b": [0.1567, 0.4565, 0.2373, 0.4762]}, {"w": "anything", "b": [0.2436, 0.4565, 0.3319, 0.4762]}, {"w": "that", "b": [0.3382, 0.4565, 0.376, 0.4762]}, {"w": "requires", "b": [0.3823, 0.4565, 0.4636, 0.4762]}, {"w": "reasoning—like", "b": [0.4699, 0.4565, 0.631, 0.4762]}, {"w": "programming", "b": [0.6373, 0.4565, 0.7747, 0.4762]}, {"w": "or", "b": [0.781, 0.4565, 0.802, 0.4762]}, {"w": "applying", "b": [0.1294, 0.477, 0.2177, 0.4967]}, {"w": "the", "b": [0.224, 0.477, 0.2548, 0.4967]}, {"w": "scientific", "b": [0.2611, 0.477, 0.3536, 0.4967]}, {"w": "method—long-term", "b": [0.3599, 0.477, 0.5603, 0.4967]}, {"w": "planning,", "b": [0.5666, 0.477, 0.6612, 0.4967]}, {"w": "and", "b": [0.6674, 0.477, 0.7039, 0.4967]}, {"w": "algorithmic", "b": [0.7102, 0.477, 0.8265, 0.4967]}, {"w": "data", "b": [0.1294, 0.4975, 0.1714, 0.5172]}, {"w": "manipulation", "b": [0.1777, 0.4975, 0.3109, 0.5172]}, {"w": "is", "b": [0.3172, 0.4975, 0.334, 0.5172]}, {"w": "out", "b": [0.3403, 0.4975, 0.3726, 0.5172]}, {"w": "of", "b": [0.3789, 0.4975, 0.3999, 0.5172]}, {"w": "reach", "b": [0.4062, 0.4975, 0.4608, 0.5172]}, {"w": "for", "b": [0.4671, 0.4975, 0.4965, 0.5172]}, {"w": "deep-learning", "b": [0.5028, 0.4975, 0.6415, 0.5172]}, {"w": "models,", "b": [0.6478, 0.4975, 0.727, 0.5172]}, {"w": "no", "b": [0.7333, 0.4975, 0.7585, 0.5172]}, {"w": "matter", "b": [0.7648, 0.4975, 0.8293, 0.5172]}, {"w": "how", "b": [0.1294, 0.518, 0.1729, 0.5377]}, {"w": "much", "b": [0.1792, 0.518, 0.2352, 0.5377]}, {"w": "data", "b": [0.2415, 0.518, 0.2835, 0.5377]}, {"w": "you", "b": [0.2898, 0.518, 0.3277, 0.5377]}, {"w": "throw", "b": [0.334, 0.518, 0.3928, 0.5377]}, {"w": "at", "b": [0.3992, 0.518, 0.4174, 0.5377]}, {"w": "them.", "b": [0.4237, 0.518, 0.4804, 0.5377]}, {"w": "Even", "b": [0.4867, 0.518, 0.5386, 0.5377]}, {"w": "learning", "b": [0.5448, 0.518, 0.6275, 0.5377]}, {"w": "a", "b": [0.6338, 0.518, 0.645, 0.5377]}, {"w": "sorting", "b": [0.6513, 0.518, 0.7214, 0.5377]}, {"w": "algorithm", "b": [0.7277, 0.518, 0.8258, 0.5377]}, {"w": "with", "b": [0.1294, 0.5385, 0.1743, 0.5582]}, {"w": "a", "b": [0.1806, 0.5385, 0.1918, 0.5582]}, {"w": "deep", "b": [0.1981, 0.5385, 0.2457, 0.5582]}, {"w": "neural", "b": [0.252, 0.5385, 0.315, 0.5582]}, {"w": "network", "b": [0.3214, 0.5385, 0.404, 0.5582]}, {"w": "is", "b": [0.4103, 0.5385, 0.4272, 0.5582]}, {"w": "tremendously", "b": [0.4335, 0.5385, 0.5708, 0.5582]}, {"w": "difficult.", "b": [0.5771, 0.5385, 0.6642, 0.5582]}]}, {"id": "b_4", "type": "paragraph", "text": "This is because a deep-learning model is just a chain of simple, continuous geometric transformations mapping one vector space into another. All it can do is map one data manifold X into another manifold Y, assuming the existence of a learnable continuous transform from X to Y. A deep-learning model can be interpreted as a kind of program; but, inversely, most programs can’t be expressed as deep-learning models— for most tasks, either there exists no corresponding deep-neural network that solves the task or, even if one exists, it may not be learnable: the corresponding geometric transform may be far too complex, or there may not be appropriate data available to learn it.", "words": [{"w": "This", "b": [0.1294, 0.5812, 0.1743, 0.601]}, {"w": "is", "b": [0.1806, 0.5812, 0.1974, 0.601]}, {"w": "because", "b": [0.2037, 0.5812, 0.2835, 0.601]}, {"w": "a", "b": [0.2898, 0.5812, 0.301, 0.601]}, {"w": "deep-learning", "b": [0.3074, 0.5812, 0.446, 0.601]}, {"w": "model", "b": [0.4524, 0.5812, 0.5154, 0.601]}, {"w": "is", "b": [0.5217, 0.5812, 0.5385, 0.601]}, {"w": "just", "b": [0.5449, 0.5812, 0.5813, 0.601]}, {"w": "a", "b": [0.5875, 0.5812, 0.6001, 0.601]}, {"w": "chain", "b": [0.6065, 0.5812, 0.6625, 0.601]}, {"w": "of", "b": [0.6688, 0.5812, 0.6884, 0.601]}, {"w": "simple,", "b": [0.6947, 0.5812, 0.7669, 0.601]}, {"w": "continuous", "b": [0.1294, 0.6017, 0.2401, 0.6215]}, {"w": "geometric", "b": [0.2464, 0.6017, 0.3473, 0.6215]}, {"w": "transformations", "b": [0.3536, 0.6017, 0.5148, 0.6215]}, {"w": "mapping", "b": [0.5211, 0.6017, 0.6094, 0.6215]}, {"w": "one", "b": [0.6157, 0.6017, 0.6521, 0.6215]}, {"w": "vector", "b": [0.6584, 0.6017, 0.7215, 0.6215]}, {"w": "space", "b": [0.7278, 0.6017, 0.7838, 0.6215]}, {"w": "into", "b": [0.7901, 0.6017, 0.8294, 0.6215]}, {"w": "another.", "b": [0.1294, 0.6222, 0.21, 0.642]}, {"w": "All", "b": [0.2163, 0.6222, 0.2485, 0.642]}, {"w": "it", "b": [0.2548, 0.6222, 0.2688, 0.642]}, {"w": "can", "b": [0.2752, 0.6222, 0.3102, 0.642]}, {"w": "do", "b": [0.3165, 0.6222, 0.3417, 0.642]}, {"w": "is", "b": [0.348, 0.6222, 0.3648, 0.642]}, {"w": "map", "b": [0.3711, 0.6222, 0.4146, 0.642]}, {"w": "one", "b": [0.4209, 0.6222, 0.4573, 0.642]}, {"w": "data", "b": [0.4636, 0.6222, 0.5056, 0.642]}, {"w": "manifold", "b": [0.5119, 0.6222, 0.603, 0.642]}, {"w": "X", "b": [0.6093, 0.6222, 0.6276, 0.642]}, {"w": "into", "b": [0.6339, 0.6222, 0.6731, 0.642]}, {"w": "another", "b": [0.6794, 0.6222, 0.7551, 0.642]}, {"w": "manifold", "b": [0.7614, 0.6222, 0.8525, 0.642]}, {"w": "Y,", "b": [0.1294, 0.6427, 0.1507, 0.6625]}, {"w": "assuming", "b": [0.157, 0.6427, 0.2523, 0.6625]}, {"w": "the", "b": [0.2586, 0.6427, 0.2894, 0.6625]}, {"w": "existence", "b": [0.2957, 0.6427, 0.3896, 0.6625]}, {"w": "of", "b": [0.3959, 0.6427, 0.4169, 0.6625]}, {"w": "a", "b": [0.4232, 0.6427, 0.4344, 0.6625]}, {"w": "learnable", "b": [0.4407, 0.6427, 0.5331, 0.6625]}, {"w": "continuous", "b": [0.5394, 0.6427, 0.6502, 0.6625]}, {"w": "transform", "b": [0.6565, 0.6427, 0.7545, 0.6625]}, {"w": "from", "b": [0.7609, 0.6427, 0.8099, 0.6625]}, {"w": "X", "b": [0.8162, 0.6427, 0.8344, 0.6625]}, {"w": "to", "b": [0.8407, 0.6427, 0.8603, 0.6625]}, {"w": "Y.", "b": [0.1294, 0.6632, 0.1507, 0.683]}, {"w": "A", "b": [0.157, 0.6632, 0.1752, 0.683]}, {"w": "deep-learning", "b": [0.1815, 0.6632, 0.3202, 0.683]}, {"w": "model", "b": [0.3265, 0.6632, 0.3896, 0.683]}, {"w": "can", "b": [0.3959, 0.6632, 0.4309, 0.683]}, {"w": "be", "b": [0.4372, 0.6632, 0.461, 0.683]}, {"w": "interpreted", "b": [0.4673, 0.6632, 0.5766, 0.683]}, {"w": "as", "b": [0.5829, 0.6632, 0.6039, 0.683]}, {"w": "a", "b": [0.6102, 0.6632, 0.6214, 0.683]}, {"w": "kind", "b": [0.6277, 0.6632, 0.6726, 0.683]}, {"w": "of", "b": [0.6789, 0.6632, 0.6999, 0.683]}, {"w": "program;", "b": [0.7062, 0.6632, 0.7987, 0.683]}, {"w": "but,", "b": [0.805, 0.6632, 0.8435, 0.683]}, {"w": "inversely,", "b": [0.1294, 0.6838, 0.2265, 0.7035]}, {"w": "most", "b": [0.2328, 0.6838, 0.2805, 0.7035]}, {"w": "programs", "b": [0.2868, 0.6838, 0.384, 0.7035]}, {"w": "can’t", "b": [0.3903, 0.6838, 0.4393, 0.7035]}, {"w": "be", "b": [0.4456, 0.6838, 0.4694, 0.7035]}, {"w": "expressed", "b": [0.4758, 0.6838, 0.5743, 0.7035]}, {"w": "as", "b": [0.5806, 0.6838, 0.603, 0.7035]}, {"w": "deep-learning", "b": [0.6093, 0.6838, 0.7508, 0.7035]}, {"w": "models—", "b": [0.7571, 0.6838, 0.8538, 0.7035]}, {"w": "for", "b": [0.1294, 0.7042, 0.1588, 0.724]}, {"w": "most", "b": [0.1651, 0.7042, 0.2142, 0.724]}, {"w": "tasks,", "b": [0.2205, 0.7042, 0.2773, 0.724]}, {"w": "either", "b": [0.2836, 0.7042, 0.341, 0.724]}, {"w": "there", "b": [0.3473, 0.7042, 0.3977, 0.724]}, {"w": "exists", "b": [0.404, 0.7042, 0.4615, 0.724]}, {"w": "no", "b": [0.4678, 0.7042, 0.493, 0.724]}, {"w": "corresponding", "b": [0.4993, 0.7042, 0.6437, 0.724]}, {"w": "deep-neural", "b": [0.65, 0.7042, 0.769, 0.724]}, {"w": "network", "b": [0.7753, 0.7042, 0.858, 0.724]}, {"w": "that", "b": [0.1294, 0.7248, 0.1673, 0.7445]}, {"w": "solves", "b": [0.1736, 0.7248, 0.2366, 0.7445]}, {"w": "the", "b": [0.2429, 0.7248, 0.2738, 0.7445]}, {"w": "task", "b": [0.2801, 0.7248, 0.3207, 0.7445]}, {"w": "or,", "b": [0.327, 0.7248, 0.3533, 0.7445]}, {"w": "even", "b": [0.3596, 0.7248, 0.4072, 0.7445]}, {"w": "if", "b": [0.4135, 0.7248, 0.4289, 0.7445]}, {"w": "one", "b": [0.4352, 0.7248, 0.4717, 0.7445]}, {"w": "exists,", "b": [0.478, 0.7248, 0.5418, 0.7445]}, {"w": "it", "b": [0.5481, 0.7248, 0.5621, 0.7445]}, {"w": "may", "b": [0.5684, 0.7248, 0.6118, 0.7445]}, {"w": "not", "b": [0.6181, 0.7248, 0.6503, 0.7445]}, {"w": "be", "b": [0.6567, 0.7248, 0.6805, 0.7445]}, {"w": "learnable:", "b": [0.6867, 0.7248, 0.7904, 0.7445]}, {"w": "the", "b": [0.7967, 0.7248, 0.8276, 0.7445]}, {"w": "corresponding", "b": [0.1294, 0.7453, 0.2737, 0.765]}, {"w": "geometric", "b": [0.28, 0.7453, 0.3809, 0.765]}, {"w": "transform", "b": [0.3872, 0.7453, 0.4853, 0.765]}, {"w": "may", "b": [0.4916, 0.7453, 0.535, 0.765]}, {"w": "be", "b": [0.5413, 0.7453, 0.5652, 0.765]}, {"w": "far", "b": [0.5715, 0.7453, 0.5995, 0.765]}, {"w": "too", "b": [0.6058, 0.7453, 0.638, 0.765]}, {"w": "complex,", "b": [0.6443, 0.7453, 0.7375, 0.765]}, {"w": "or", "b": [0.7438, 0.7453, 0.7648, 0.765]}, {"w": "there", "b": [0.7711, 0.7453, 0.8216, 0.765]}, {"w": "may", "b": [0.1294, 0.7658, 0.1729, 0.7855]}, {"w": "not", "b": [0.1792, 0.7658, 0.2114, 0.7855]}, {"w": "be", "b": [0.2177, 0.7658, 0.2415, 0.7855]}, {"w": "appropriate", "b": [0.2478, 0.7658, 0.3627, 0.7855]}, {"w": "data", "b": [0.369, 0.7658, 0.411, 0.7855]}, {"w": "available", "b": [0.4173, 0.7658, 0.5084, 0.7855]}, {"w": "to", "b": [0.5147, 0.7658, 0.5343, 0.7855]}, {"w": "learn", "b": [0.5406, 0.7658, 0.5911, 0.7855]}, {"w": "it.", "b": [0.5974, 0.7658, 0.6177, 0.7855]}]}, {"id": "b_5", "type": "paragraph", "text": "Scaling up current deep-learning techniques by stacking more layers and using more training data can only superficially palliate some of these issues. It won’t solve the more fundamental problems that deep-learning models are limited in what they can represent and that most of the", "words": [{"w": "Scaling", "b": [0.1294, 0.8085, 0.2051, 0.8283]}, {"w": "up", "b": [0.2114, 0.8085, 0.2366, 0.8283]}, {"w": "current", "b": [0.2429, 0.8085, 0.3144, 0.8283]}, {"w": "deep-learning", "b": [0.3207, 0.8085, 0.4594, 0.8283]}, {"w": "techniques", "b": [0.4657, 0.8085, 0.5736, 0.8283]}, {"w": "by", "b": [0.5799, 0.8085, 0.6051, 0.8283]}, {"w": "stacking", "b": [0.6114, 0.8085, 0.6955, 0.8283]}, {"w": "more", "b": [0.7018, 0.8085, 0.7536, 0.8283]}, {"w": "layers", "b": [0.7599, 0.8085, 0.8202, 0.8283]}, {"w": "and", "b": [0.8265, 0.8085, 0.8629, 0.8283]}, {"w": "using", "b": [0.1294, 0.829, 0.1841, 0.8488]}, {"w": "more", "b": [0.1904, 0.829, 0.2422, 0.8488]}, {"w": "training", "b": [0.2485, 0.829, 0.327, 0.8488]}, {"w": "data", "b": [0.3333, 0.829, 0.3753, 0.8488]}, {"w": "can", "b": [0.3816, 0.829, 0.4167, 0.8488]}, {"w": "only", "b": [0.423, 0.829, 0.4678, 0.8488]}, {"w": "superficially", "b": [0.4741, 0.829, 0.6002, 0.8488]}, {"w": "palliate", "b": [0.6065, 0.829, 0.6808, 0.8488]}, {"w": "some", "b": [0.687, 0.829, 0.7403, 0.8488]}, {"w": "of", "b": [0.7466, 0.829, 0.7676, 0.8488]}, {"w": "these", "b": [0.7739, 0.829, 0.8257, 0.8488]}, {"w": "issues.", "b": [0.1294, 0.8495, 0.196, 0.8693]}, {"w": "It", "b": [0.2023, 0.8495, 0.2177, 0.8693]}, {"w": "won’t", "b": [0.224, 0.8495, 0.2824, 0.8693]}, {"w": "solve", "b": [0.2887, 0.8495, 0.342, 0.8693]}, {"w": "the", "b": [0.3483, 0.8495, 0.3791, 0.8693]}, {"w": "more", "b": [0.3854, 0.8495, 0.4372, 0.8693]}, {"w": "fundamental", "b": [0.4436, 0.8495, 0.5697, 0.8693]}, {"w": "problems", "b": [0.576, 0.8495, 0.6699, 0.8693]}, {"w": "that", "b": [0.6762, 0.8495, 0.714, 0.8693]}, {"w": "deep-learning", "b": [0.7203, 0.8495, 0.859, 0.8693]}, {"w": "models", "b": [0.1294, 0.87, 0.2023, 0.8898]}, {"w": "are", "b": [0.2086, 0.87, 0.2394, 0.8898]}, {"w": "limited", "b": [0.2457, 0.87, 0.3172, 0.8898]}, {"w": "in", "b": [0.3235, 0.87, 0.3431, 0.8898]}, {"w": "what", "b": [0.3494, 0.87, 0.3985, 0.8898]}, {"w": "they", "b": [0.4048, 0.87, 0.4482, 0.8898]}, {"w": "can", "b": [0.4545, 0.87, 0.4895, 0.8898]}, {"w": "represent", "b": [0.4958, 0.87, 0.5882, 0.8898]}, {"w": "and", "b": [0.5945, 0.87, 0.631, 0.8898]}, {"w": "that", "b": [0.6373, 0.87, 0.6751, 0.8898]}, {"w": "most", "b": [0.6814, 0.87, 0.7305, 0.8898]}, {"w": "of", "b": [0.7368, 0.87, 0.7578, 0.8898]}, {"w": "the", "b": [0.7641, 0.87, 0.7949, 0.8898]}]}]}, {"page": 425, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "programs you may wish to learn can’t be expressed as a continuous geometric morphing of a data manifold.", "words": [{"w": "programs", "b": [0.1294, 0.0857, 0.2247, 0.1054]}, {"w": "you", "b": [0.231, 0.0857, 0.2688, 0.1054]}, {"w": "may", "b": [0.2751, 0.0857, 0.3186, 0.1054]}, {"w": "wish", "b": [0.3249, 0.0857, 0.3725, 0.1054]}, {"w": "to", "b": [0.3788, 0.0857, 0.3985, 0.1054]}, {"w": "learn", "b": [0.4048, 0.0857, 0.4552, 0.1054]}, {"w": "can’t", "b": [0.4615, 0.0857, 0.5114, 0.1054]}, {"w": "be", "b": [0.5178, 0.0857, 0.5416, 0.1054]}, {"w": "expressed", "b": [0.5479, 0.0857, 0.6473, 0.1054]}, {"w": "as", "b": [0.6536, 0.0857, 0.6747, 0.1054]}, {"w": "a", "b": [0.681, 0.0857, 0.6922, 0.1054]}, {"w": "continuous", "b": [0.6985, 0.0857, 0.8092, 0.1054]}, {"w": "geometric", "b": [0.1294, 0.1062, 0.2303, 0.1259]}, {"w": "morphing", "b": [0.2366, 0.1062, 0.3347, 0.1259]}, {"w": "of", "b": [0.341, 0.1062, 0.362, 0.1259]}, {"w": "a", "b": [0.3683, 0.1062, 0.3795, 0.1259]}, {"w": "data", "b": [0.3858, 0.1062, 0.4279, 0.1259]}, {"w": "manifold.", "b": [0.4341, 0.1062, 0.5315, 0.1259]}]}, {"id": "b_1", "type": "equation", "text": "9.2.1. The risk of anthropomorphizing machine-learning models", "words": [{"w": "9.2.1.", "b": [0.1294, 0.1534, 0.1862, 0.1732]}, {"w": "The", "b": [0.1925, 0.1534, 0.2345, 0.1732]}, {"w": "risk", "b": [0.2408, 0.1534, 0.2829, 0.1732]}, {"w": "of", "b": [0.2892, 0.1534, 0.3102, 0.1732]}, {"w": "anthropomorphizing", "b": [0.3165, 0.1534, 0.5403, 0.1732]}, {"w": "machine-learning", "b": [0.5466, 0.1534, 0.7358, 0.1732]}, {"w": "models", "b": [0.7421, 0.1534, 0.8178, 0.1732]}]}, {"id": "b_2", "type": "paragraph", "text": "One real risk with contemporary AI is misinterpreting what deep- learning models do and overestimating their abilities. A fundamental feature of humans is our theory of mind: our tendency to project intentions, beliefs, and knowledge on the things around us. Drawing a smiley face on a rock suddenly makes it “happy”—in our minds. Applied to deep learning, this means that, for instance, when we’re able to somewhat successfully train a model to generate captions to describe pictures, we’re led to believe that the model “understands” the contents of the pictures and the captions it generates. Then we’re surprised when any slight departure from the sort of images present in the training data causes the model to generate completely absurd captions (see figure 9.1).", "words": [{"w": "One", "b": [0.1294, 0.1962, 0.1714, 0.2159]}, {"w": "real", "b": [0.1777, 0.1962, 0.2156, 0.2159]}, {"w": "risk", "b": [0.2219, 0.1962, 0.2597, 0.2159]}, {"w": "with", "b": [0.266, 0.1962, 0.3109, 0.2159]}, {"w": "contemporary", "b": [0.3172, 0.1962, 0.4573, 0.2159]}, {"w": "AI", "b": [0.4636, 0.1962, 0.4902, 0.2159]}, {"w": "is", "b": [0.4965, 0.1962, 0.5133, 0.2159]}, {"w": "misinterpreting", "b": [0.5196, 0.1962, 0.6738, 0.2159]}, {"w": "what", "b": [0.6801, 0.1962, 0.7291, 0.2159]}, {"w": "deep-", "b": [0.7354, 0.1962, 0.7915, 0.2159]}, {"w": "learning", "b": [0.1294, 0.2167, 0.2121, 0.2364]}, {"w": "models", "b": [0.2184, 0.2167, 0.2913, 0.2364]}, {"w": "do", "b": [0.2976, 0.2167, 0.3228, 0.2364]}, {"w": "and", "b": [0.3291, 0.2167, 0.3655, 0.2364]}, {"w": "overestimating", "b": [0.3718, 0.2167, 0.5218, 0.2364]}, {"w": "their", "b": [0.5281, 0.2167, 0.5743, 0.2364]}, {"w": "abilities.", "b": [0.5806, 0.2167, 0.6668, 0.2364]}, {"w": "A", "b": [0.6731, 0.2167, 0.6913, 0.2364]}, {"w": "fundamental", "b": [0.6976, 0.2167, 0.8238, 0.2364]}, {"w": "feature", "b": [0.1294, 0.2372, 0.1994, 0.2569]}, {"w": "of", "b": [0.2057, 0.2372, 0.2268, 0.2569]}, {"w": "humans", "b": [0.2331, 0.2372, 0.3115, 0.2569]}, {"w": "is", "b": [0.3178, 0.2372, 0.3347, 0.2569]}, {"w": "our", "b": [0.341, 0.2372, 0.3746, 0.2569]}, {"w": "theory", "b": [0.3809, 0.2372, 0.4453, 0.2569]}, {"w": "of", "b": [0.4516, 0.2372, 0.4713, 0.2569]}, {"w": "mind:", "b": [0.4776, 0.2372, 0.535, 0.2569]}, {"w": "our", "b": [0.5413, 0.2372, 0.5749, 0.2569]}, {"w": "tendency", "b": [0.5813, 0.2372, 0.6723, 0.2569]}, {"w": "to", "b": [0.6786, 0.2372, 0.6982, 0.2569]}, {"w": "project", "b": [0.7046, 0.2372, 0.7746, 0.2569]}, {"w": "intentions,", "b": [0.1294, 0.2577, 0.2352, 0.2774]}, {"w": "beliefs,", "b": [0.2415, 0.2577, 0.3151, 0.2774]}, {"w": "and", "b": [0.3214, 0.2577, 0.3578, 0.2774]}, {"w": "knowledge", "b": [0.3641, 0.2577, 0.4748, 0.2774]}, {"w": "on", "b": [0.4811, 0.2577, 0.5064, 0.2774]}, {"w": "the", "b": [0.5127, 0.2577, 0.5435, 0.2774]}, {"w": "things", "b": [0.5498, 0.2577, 0.6115, 0.2774]}, {"w": "around", "b": [0.6178, 0.2577, 0.6878, 0.2774]}, {"w": "us.", "b": [0.6941, 0.2577, 0.7229, 0.2774]}, {"w": "Drawing", "b": [0.7292, 0.2577, 0.8174, 0.2774]}, {"w": "a", "b": [0.8238, 0.2577, 0.835, 0.2774]}, {"w": "smiley", "b": [0.1294, 0.2782, 0.1967, 0.2979]}, {"w": "face", "b": [0.203, 0.2782, 0.245, 0.2979]}, {"w": "on", "b": [0.2513, 0.2782, 0.2765, 0.2979]}, {"w": "a", "b": [0.2828, 0.2782, 0.294, 0.2979]}, {"w": "rock", "b": [0.3003, 0.2782, 0.3452, 0.2979]}, {"w": "suddenly", "b": [0.3515, 0.2782, 0.4426, 0.2979]}, {"w": "makes", "b": [0.4488, 0.2782, 0.5133, 0.2979]}, {"w": "it", "b": [0.5196, 0.2782, 0.5336, 0.2979]}, {"w": "“happy”—in", "b": [0.5399, 0.2782, 0.6688, 0.2979]}, {"w": "our", "b": [0.6751, 0.2782, 0.7088, 0.2979]}, {"w": "minds.", "b": [0.7151, 0.2782, 0.783, 0.2979]}, {"w": "Applied", "b": [0.7894, 0.2782, 0.8706, 0.2979]}, {"w": "to", "b": [0.1294, 0.2987, 0.149, 0.3184]}, {"w": "deep", "b": [0.1553, 0.2987, 0.203, 0.3184]}, {"w": "learning,", "b": [0.2093, 0.2987, 0.2982, 0.3184]}, {"w": "this", "b": [0.3046, 0.2987, 0.341, 0.3184]}, {"w": "means", "b": [0.3473, 0.2987, 0.4118, 0.3184]}, {"w": "that,", "b": [0.4181, 0.2987, 0.4622, 0.3184]}, {"w": "for", "b": [0.4685, 0.2987, 0.4979, 0.3184]}, {"w": "instance,", "b": [0.5042, 0.2987, 0.5932, 0.3184]}, {"w": "when", "b": [0.5995, 0.2987, 0.6542, 0.3184]}, {"w": "we’re", "b": [0.6605, 0.2987, 0.7179, 0.3184]}, {"w": "able", "b": [0.7242, 0.2987, 0.7662, 0.3184]}, {"w": "to", "b": [0.7725, 0.2987, 0.7921, 0.3184]}, {"w": "somewhat", "b": [0.1294, 0.3192, 0.2317, 0.3389]}, {"w": "successfully", "b": [0.238, 0.3192, 0.3613, 0.3389]}, {"w": "train", "b": [0.3676, 0.3192, 0.4138, 0.3389]}, {"w": "a", "b": [0.4201, 0.3192, 0.4313, 0.3389]}, {"w": "model", "b": [0.4377, 0.3192, 0.5007, 0.3389]}, {"w": "to", "b": [0.507, 0.3192, 0.5266, 0.3389]}, {"w": "generate", "b": [0.533, 0.3192, 0.6184, 0.3389]}, {"w": "captions", "b": [0.6247, 0.3192, 0.7088, 0.3389]}, {"w": "to", "b": [0.7151, 0.3192, 0.7347, 0.3389]}, {"w": "describe", "b": [0.741, 0.3192, 0.8251, 0.3389]}, {"w": "pictures,", "b": [0.1294, 0.3397, 0.2156, 0.3594]}, {"w": "we’re", "b": [0.2219, 0.3397, 0.2793, 0.3594]}, {"w": "led", "b": [0.2856, 0.3397, 0.3164, 0.3594]}, {"w": "to", "b": [0.3227, 0.3397, 0.3424, 0.3594]}, {"w": "believe", "b": [0.3487, 0.3397, 0.4215, 0.3594]}, {"w": "that", "b": [0.4278, 0.3397, 0.4657, 0.3594]}, {"w": "the", "b": [0.472, 0.3397, 0.5028, 0.3594]}, {"w": "model", "b": [0.5091, 0.3397, 0.5722, 0.3594]}, {"w": "“understands”", "b": [0.5785, 0.3397, 0.7214, 0.3594]}, {"w": "the", "b": [0.7277, 0.3397, 0.7585, 0.3594]}, {"w": "contents", "b": [0.7648, 0.3397, 0.8489, 0.3594]}, {"w": "of", "b": [0.1294, 0.3602, 0.1504, 0.3799]}, {"w": "the", "b": [0.1567, 0.3602, 0.1876, 0.3799]}, {"w": "pictures", "b": [0.1939, 0.3602, 0.2737, 0.3799]}, {"w": "and", "b": [0.28, 0.3602, 0.3165, 0.3799]}, {"w": "the", "b": [0.3228, 0.3602, 0.3536, 0.3799]}, {"w": "captions", "b": [0.3599, 0.3602, 0.444, 0.3799]}, {"w": "it", "b": [0.4503, 0.3602, 0.4643, 0.3799]}, {"w": "generates.", "b": [0.4706, 0.3602, 0.5722, 0.3799]}, {"w": "Then", "b": [0.5785, 0.3602, 0.6303, 0.3799]}, {"w": "we’re", "b": [0.6366, 0.3602, 0.694, 0.3799]}, {"w": "surprised", "b": [0.7003, 0.3602, 0.7928, 0.3799]}, {"w": "when", "b": [0.7991, 0.3602, 0.8538, 0.3799]}, {"w": "any", "b": [0.1294, 0.3807, 0.1658, 0.4004]}, {"w": "slight", "b": [0.1721, 0.3807, 0.2282, 0.4004]}, {"w": "departure", "b": [0.2345, 0.3807, 0.3298, 0.4004]}, {"w": "from", "b": [0.3361, 0.3807, 0.3851, 0.4004]}, {"w": "the", "b": [0.3914, 0.3807, 0.4223, 0.4004]}, {"w": "sort", "b": [0.4286, 0.3807, 0.4664, 0.4004]}, {"w": "of", "b": [0.4727, 0.3807, 0.4937, 0.4004]}, {"w": "images", "b": [0.5, 0.3807, 0.5715, 0.4004]}, {"w": "present", "b": [0.5778, 0.3807, 0.6507, 0.4004]}, {"w": "in", "b": [0.6569, 0.3807, 0.6765, 0.4004]}, {"w": "the", "b": [0.6828, 0.3807, 0.7136, 0.4004]}, {"w": "training", "b": [0.72, 0.3807, 0.7984, 0.4004]}, {"w": "data", "b": [0.8047, 0.3807, 0.8468, 0.4004]}, {"w": "causes", "b": [0.1294, 0.4012, 0.1953, 0.4209]}, {"w": "the", "b": [0.2016, 0.4012, 0.2324, 0.4209]}, {"w": "model", "b": [0.2387, 0.4012, 0.3018, 0.4209]}, {"w": "to", "b": [0.3081, 0.4012, 0.3277, 0.4209]}, {"w": "generate", "b": [0.334, 0.4012, 0.4194, 0.4209]}, {"w": "completely", "b": [0.4257, 0.4012, 0.5378, 0.4209]}, {"w": "absurd", "b": [0.5441, 0.4012, 0.6114, 0.4209]}, {"w": "captions", "b": [0.6177, 0.4012, 0.7018, 0.4209]}, {"w": "(see", "b": [0.7081, 0.4012, 0.7487, 0.4209]}, {"w": "figure", "b": [0.7549, 0.4012, 0.8152, 0.4209]}, {"w": "9.1).", "b": [0.8215, 0.4012, 0.8677, 0.4209]}]}, {"id": "b_3", "type": "equation", "text": "Figure 9.1. Failure of an image-captioning system based on deep learning", "words": [{"w": "Figure", "b": [0.1294, 0.4435, 0.1827, 0.4583]}, {"w": "9.1.", "b": [0.1874, 0.4435, 0.2158, 0.4583]}, {"w": "Failure", "b": [0.2205, 0.4435, 0.279, 0.4583]}, {"w": "of", "b": [0.2837, 0.4435, 0.2995, 0.4583]}, {"w": "an", "b": [0.3042, 0.4435, 0.3242, 0.4583]}, {"w": "image-captioning", "b": [0.3289, 0.4435, 0.4687, 0.4583]}, {"w": "system", "b": [0.4734, 0.4435, 0.5281, 0.4583]}, {"w": "based", "b": [0.5328, 0.4435, 0.5791, 0.4583]}, {"w": "on", "b": [0.5838, 0.4435, 0.6038, 0.4583]}, {"w": "deep", "b": [0.6085, 0.4435, 0.6463, 0.4583]}, {"w": "learning", "b": [0.6511, 0.4435, 0.7184, 0.4583]}]}, {"id": "b_4", "type": "paragraph", "text": "In particular, this is highlighted by adversarial examples, which are samples fed to a deep-learning network that are designed to trick the model into misclassifying them. You’re already aware that, for instance, it’s possible to do gradient ascent in input space to generate inputs that maximize the activation of some convnet filter—this is the basis of the filter-visualization technique introduced in chapter 5, as well as the DeepDream algorithm in chapter 8. Similarly, through gradient ascent, you can slightly modify an image in order to maximize the class prediction for a given class. By taking a picture of a panda and adding to it a gibbon gradient, we can get a neural network to classify the panda as", "words": [{"w": "In", "b": [0.1294, 0.69, 0.1504, 0.7097]}, {"w": "particular,", "b": [0.1567, 0.69, 0.2587, 0.7097]}, {"w": "this", "b": [0.265, 0.69, 0.3014, 0.7097]}, {"w": "is", "b": [0.3077, 0.69, 0.3246, 0.7097]}, {"w": "highlighted", "b": [0.3309, 0.69, 0.4458, 0.7097]}, {"w": "by", "b": [0.4521, 0.69, 0.4773, 0.7097]}, {"w": "adversarial", "b": [0.4836, 0.69, 0.5999, 0.7097]}, {"w": "examples,", "b": [0.6062, 0.69, 0.7064, 0.7097]}, {"w": "which", "b": [0.7127, 0.69, 0.7743, 0.7097]}, {"w": "are", "b": [0.7806, 0.69, 0.8114, 0.7097]}, {"w": "samples", "b": [0.1294, 0.7105, 0.2107, 0.7302]}, {"w": "fed", "b": [0.217, 0.7105, 0.2492, 0.7302]}, {"w": "to", "b": [0.2555, 0.7105, 0.2751, 0.7302]}, {"w": "a", "b": [0.2814, 0.7105, 0.2926, 0.7302]}, {"w": "deep-learning", "b": [0.299, 0.7105, 0.4376, 0.7302]}, {"w": "network", "b": [0.444, 0.7105, 0.5266, 0.7302]}, {"w": "that", "b": [0.5329, 0.7105, 0.5708, 0.7302]}, {"w": "are", "b": [0.5771, 0.7105, 0.6079, 0.7302]}, {"w": "designed", "b": [0.6142, 0.7105, 0.7039, 0.7302]}, {"w": "to", "b": [0.7102, 0.7105, 0.7298, 0.7302]}, {"w": "trick", "b": [0.7361, 0.7105, 0.7823, 0.7302]}, {"w": "the", "b": [0.7886, 0.7105, 0.8195, 0.7302]}, {"w": "model", "b": [0.1294, 0.731, 0.1925, 0.7507]}, {"w": "into", "b": [0.1988, 0.731, 0.238, 0.7507]}, {"w": "misclassifying", "b": [0.2443, 0.731, 0.3901, 0.7507]}, {"w": "them.", "b": [0.3964, 0.731, 0.4532, 0.7507]}, {"w": "You’re", "b": [0.4595, 0.731, 0.5283, 0.7507]}, {"w": "already", "b": [0.5346, 0.731, 0.6089, 0.7507]}, {"w": "aware", "b": [0.6152, 0.731, 0.6754, 0.7507]}, {"w": "that,", "b": [0.6817, 0.731, 0.7258, 0.7507]}, {"w": "for", "b": [0.7321, 0.731, 0.7616, 0.7507]}, {"w": "instance,", "b": [0.7679, 0.731, 0.8568, 0.7507]}, {"w": "it’s", "b": [0.1294, 0.7515, 0.1603, 0.7712]}, {"w": "possible", "b": [0.1666, 0.7515, 0.2492, 0.7712]}, {"w": "to", "b": [0.2556, 0.7515, 0.2752, 0.7712]}, {"w": "do", "b": [0.2815, 0.7515, 0.3067, 0.7712]}, {"w": "gradient", "b": [0.313, 0.7515, 0.3957, 0.7712]}, {"w": "ascent", "b": [0.402, 0.7515, 0.465, 0.7712]}, {"w": "in", "b": [0.4713, 0.7515, 0.491, 0.7712]}, {"w": "input", "b": [0.4973, 0.7515, 0.5491, 0.7712]}, {"w": "space", "b": [0.5554, 0.7515, 0.6115, 0.7712]}, {"w": "to", "b": [0.6178, 0.7515, 0.6374, 0.7712]}, {"w": "generate", "b": [0.6437, 0.7515, 0.7291, 0.7712]}, {"w": "inputs", "b": [0.7354, 0.7515, 0.7971, 0.7712]}, {"w": "that", "b": [0.8034, 0.7515, 0.8413, 0.7712]}, {"w": "maximize", "b": [0.1294, 0.772, 0.2289, 0.7917]}, {"w": "the", "b": [0.2352, 0.772, 0.266, 0.7917]}, {"w": "activation", "b": [0.2723, 0.772, 0.3718, 0.7917]}, {"w": "of", "b": [0.3781, 0.772, 0.3991, 0.7917]}, {"w": "some", "b": [0.4054, 0.772, 0.4586, 0.7917]}, {"w": "convnet", "b": [0.4649, 0.772, 0.5448, 0.7917]}, {"w": "filter—this", "b": [0.5511, 0.772, 0.6618, 0.7917]}, {"w": "is", "b": [0.6681, 0.772, 0.685, 0.7917]}, {"w": "the", "b": [0.6913, 0.772, 0.7221, 0.7917]}, {"w": "basis", "b": [0.7284, 0.772, 0.7789, 0.7917]}, {"w": "of", "b": [0.7852, 0.772, 0.8062, 0.7917]}, {"w": "the", "b": [0.8125, 0.772, 0.8433, 0.7917]}, {"w": "filter-visualization", "b": [0.1294, 0.7925, 0.3153, 0.8122]}, {"w": "technique", "b": [0.3216, 0.7925, 0.4196, 0.8122]}, {"w": "introduced", "b": [0.4259, 0.7925, 0.5338, 0.8122]}, {"w": "in", "b": [0.5401, 0.7925, 0.5598, 0.8122]}, {"w": "chapter", "b": [0.566, 0.7925, 0.6402, 0.8122]}, {"w": "5,", "b": [0.6465, 0.7925, 0.6654, 0.8122]}, {"w": "as", "b": [0.6717, 0.7925, 0.6928, 0.8122]}, {"w": "well", "b": [0.6991, 0.7925, 0.7425, 0.8122]}, {"w": "as", "b": [0.7488, 0.7925, 0.7698, 0.8122]}, {"w": "the", "b": [0.7761, 0.7925, 0.807, 0.8122]}, {"w": "DeepDream", "b": [0.1294, 0.813, 0.2513, 0.8327]}, {"w": "algorithm", "b": [0.2576, 0.813, 0.3557, 0.8327]}, {"w": "in", "b": [0.362, 0.813, 0.3816, 0.8327]}, {"w": "chapter", "b": [0.3879, 0.813, 0.4621, 0.8327]}, {"w": "8.", "b": [0.4684, 0.813, 0.4873, 0.8327]}, {"w": "Similarly,", "b": [0.4936, 0.813, 0.5922, 0.8327]}, {"w": "through", "b": [0.5985, 0.813, 0.677, 0.8327]}, {"w": "gradient", "b": [0.6833, 0.813, 0.7659, 0.8327]}, {"w": "ascent,", "b": [0.7723, 0.813, 0.8416, 0.8327]}, {"w": "you", "b": [0.1294, 0.8335, 0.1673, 0.8532]}, {"w": "can", "b": [0.1736, 0.8335, 0.2086, 0.8532]}, {"w": "slightly", "b": [0.2149, 0.8335, 0.2906, 0.8532]}, {"w": "modify", "b": [0.2969, 0.8335, 0.3698, 0.8532]}, {"w": "an", "b": [0.3761, 0.8335, 0.3999, 0.8532]}, {"w": "image", "b": [0.4062, 0.8335, 0.4678, 0.8532]}, {"w": "in", "b": [0.4741, 0.8335, 0.4938, 0.8532]}, {"w": "order", "b": [0.5001, 0.8335, 0.5533, 0.8532]}, {"w": "to", "b": [0.5596, 0.8335, 0.5792, 0.8532]}, {"w": "maximize", "b": [0.5855, 0.8335, 0.685, 0.8532]}, {"w": "the", "b": [0.6913, 0.8335, 0.7222, 0.8532]}, {"w": "class", "b": [0.7285, 0.8335, 0.7775, 0.8532]}, {"w": "prediction", "b": [0.1294, 0.854, 0.2317, 0.8737]}, {"w": "for", "b": [0.238, 0.854, 0.2674, 0.8737]}, {"w": "a", "b": [0.2737, 0.854, 0.2849, 0.8737]}, {"w": "given", "b": [0.2912, 0.854, 0.3473, 0.8737]}, {"w": "class.", "b": [0.3535, 0.854, 0.4089, 0.8737]}, {"w": "By", "b": [0.4152, 0.854, 0.4446, 0.8737]}, {"w": "taking", "b": [0.4509, 0.854, 0.514, 0.8737]}, {"w": "a", "b": [0.5203, 0.854, 0.5315, 0.8737]}, {"w": "picture", "b": [0.5378, 0.854, 0.6079, 0.8737]}, {"w": "of", "b": [0.6142, 0.854, 0.6352, 0.8737]}, {"w": "a", "b": [0.6415, 0.854, 0.6527, 0.8737]}, {"w": "panda", "b": [0.659, 0.854, 0.7192, 0.8737]}, {"w": "and", "b": [0.7256, 0.854, 0.762, 0.8737]}, {"w": "adding", "b": [0.7683, 0.854, 0.8369, 0.8737]}, {"w": "to", "b": [0.8433, 0.854, 0.8629, 0.8737]}, {"w": "it", "b": [0.1294, 0.8745, 0.1434, 0.8942]}, {"w": "a", "b": [0.1497, 0.8745, 0.1609, 0.8942]}, {"w": "gibbon", "b": [0.1673, 0.8745, 0.2373, 0.8942]}, {"w": "gradient,", "b": [0.2436, 0.8745, 0.3326, 0.8942]}, {"w": "we", "b": [0.3389, 0.8745, 0.3683, 0.8942]}, {"w": "can", "b": [0.3746, 0.8745, 0.4096, 0.8942]}, {"w": "get", "b": [0.416, 0.8745, 0.4468, 0.8942]}, {"w": "a", "b": [0.4531, 0.8745, 0.4643, 0.8942]}, {"w": "neural", "b": [0.4706, 0.8745, 0.5336, 0.8942]}, {"w": "network", "b": [0.5399, 0.8745, 0.6226, 0.8942]}, {"w": "to", "b": [0.6289, 0.8745, 0.6485, 0.8942]}, {"w": "classify", "b": [0.6548, 0.8745, 0.7319, 0.8942]}, {"w": "the", "b": [0.7382, 0.8745, 0.769, 0.8942]}, {"w": "panda", "b": [0.7753, 0.8745, 0.8356, 0.8942]}, {"w": "as", "b": [0.8418, 0.8745, 0.8628, 0.8942]}]}]}, {"page": 426, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "a gibbon (see figure 9.2). This evidences both the brittleness of these models and the deep difference between their input-to-output mapping and our human perception.", "words": [{"w": "a", "b": [0.1294, 0.0857, 0.1406, 0.1054]}, {"w": "gibbon", "b": [0.1469, 0.0857, 0.217, 0.1054]}, {"w": "(see", "b": [0.2233, 0.0857, 0.2639, 0.1054]}, {"w": "figure", "b": [0.2702, 0.0857, 0.3304, 0.1054]}, {"w": "9.2).", "b": [0.3367, 0.0857, 0.383, 0.1054]}, {"w": "This", "b": [0.3893, 0.0857, 0.4341, 0.1054]}, {"w": "evidences", "b": [0.4404, 0.0857, 0.5399, 0.1054]}, {"w": "both", "b": [0.5462, 0.0857, 0.5911, 0.1054]}, {"w": "the", "b": [0.5974, 0.0857, 0.6282, 0.1054]}, {"w": "brittleness", "b": [0.6345, 0.0857, 0.7382, 0.1054]}, {"w": "of", "b": [0.7445, 0.0857, 0.7655, 0.1054]}, {"w": "these", "b": [0.7718, 0.0857, 0.8237, 0.1054]}, {"w": "models", "b": [0.1294, 0.1062, 0.2023, 0.1259]}, {"w": "and", "b": [0.2086, 0.1062, 0.245, 0.1259]}, {"w": "the", "b": [0.2513, 0.1062, 0.2822, 0.1259]}, {"w": "deep", "b": [0.2885, 0.1062, 0.3361, 0.1259]}, {"w": "difference", "b": [0.3424, 0.1062, 0.4441, 0.1259]}, {"w": "between", "b": [0.4505, 0.1062, 0.5345, 0.1259]}, {"w": "their", "b": [0.5408, 0.1062, 0.587, 0.1259]}, {"w": "input-to-output", "b": [0.5934, 0.1062, 0.7461, 0.1259]}, {"w": "mapping", "b": [0.7524, 0.1062, 0.8407, 0.1259]}, {"w": "and", "b": [0.1294, 0.1267, 0.1658, 0.1464]}, {"w": "our", "b": [0.1721, 0.1267, 0.2058, 0.1464]}, {"w": "human", "b": [0.2121, 0.1267, 0.2807, 0.1464]}, {"w": "perception.", "b": [0.287, 0.1267, 0.3998, 0.1464]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 9.2. An adversarial example: imperceptible changes in an image can upend a model’s classification of the image.", "words": [{"w": "Figure", "b": [0.1294, 0.1645, 0.1827, 0.1793]}, {"w": "9.2.", "b": [0.1874, 0.1645, 0.2158, 0.1793]}, {"w": "An", "b": [0.2205, 0.1645, 0.2447, 0.1793]}, {"w": "adversarial", "b": [0.2494, 0.1645, 0.3408, 0.1793]}, {"w": "example:", "b": [0.3456, 0.1645, 0.4191, 0.1793]}, {"w": "imperceptible", "b": [0.4238, 0.1645, 0.5349, 0.1793]}, {"w": "changes", "b": [0.5396, 0.1645, 0.6037, 0.1793]}, {"w": "in", "b": [0.6085, 0.1645, 0.6242, 0.1793]}, {"w": "an", "b": [0.629, 0.1645, 0.6489, 0.1793]}, {"w": "image", "b": [0.6537, 0.1645, 0.702, 0.1793]}, {"w": "can", "b": [0.7067, 0.1645, 0.7351, 0.1793]}, {"w": "upend", "b": [0.7399, 0.1645, 0.7903, 0.1793]}, {"w": "a", "b": [0.7951, 0.1645, 0.8045, 0.1793]}, {"w": "model’s", "b": [0.1294, 0.1797, 0.1918, 0.1945]}, {"w": "classification", "b": [0.1965, 0.1797, 0.3006, 0.1945]}, {"w": "of", "b": [0.3053, 0.1797, 0.321, 0.1945]}, {"w": "the", "b": [0.3258, 0.1797, 0.351, 0.1945]}, {"w": "image.", "b": [0.3557, 0.1797, 0.4088, 0.1945]}]}, {"id": "b_2", "type": "paragraph", "text": "In short, deep-learning models don’t have any understanding of their input—at least, not in a human sense. Our own understanding of images, sounds, and language is grounded in our sensorimotor experience as humans. Machine-learning models have no access to such experiences and thus can’t understand their inputs in a human-relatable way. By annotating large numbers of training examples to feed into our models, we get them to learn a geometric transform that maps data to human concepts on a specific set of examples, but this mapping is a simplistic sketch of the original model in our minds—the one developed from our experience as embodied agents. It’s like a dim image in a mirror (see figure 9.3).", "words": [{"w": "In", "b": [0.1294, 0.5804, 0.1504, 0.6001]}, {"w": "short,", "b": [0.1567, 0.5804, 0.2135, 0.6001]}, {"w": "deep-learning", "b": [0.2198, 0.5804, 0.3585, 0.6001]}, {"w": "models", "b": [0.3648, 0.5804, 0.4377, 0.6001]}, {"w": "don’t", "b": [0.444, 0.5804, 0.4967, 0.6001]}, {"w": "have", "b": [0.503, 0.5804, 0.5507, 0.6001]}, {"w": "any", "b": [0.557, 0.5804, 0.5934, 0.6001]}, {"w": "understanding", "b": [0.5997, 0.5804, 0.7426, 0.6001]}, {"w": "of", "b": [0.7489, 0.5804, 0.77, 0.6001]}, {"w": "their", "b": [0.7763, 0.5804, 0.8225, 0.6001]}, {"w": "input—at", "b": [0.1294, 0.6009, 0.2247, 0.6206]}, {"w": "least,", "b": [0.231, 0.6009, 0.2836, 0.6206]}, {"w": "not", "b": [0.2899, 0.6009, 0.3221, 0.6206]}, {"w": "in", "b": [0.3284, 0.6009, 0.348, 0.6206]}, {"w": "a", "b": [0.3544, 0.6009, 0.3656, 0.6206]}, {"w": "human", "b": [0.3719, 0.6009, 0.4405, 0.6206]}, {"w": "sense.", "b": [0.4468, 0.6009, 0.5078, 0.6206]}, {"w": "Our", "b": [0.5141, 0.6009, 0.5533, 0.6206]}, {"w": "own", "b": [0.5596, 0.6009, 0.6031, 0.6206]}, {"w": "understanding", "b": [0.6094, 0.6009, 0.7523, 0.6206]}, {"w": "of", "b": [0.7585, 0.6009, 0.7796, 0.6206]}, {"w": "images,", "b": [0.7859, 0.6009, 0.8636, 0.6206]}, {"w": "sounds,", "b": [0.1294, 0.6214, 0.2058, 0.6411]}, {"w": "and", "b": [0.2121, 0.6214, 0.2485, 0.6411]}, {"w": "language", "b": [0.2548, 0.6214, 0.3459, 0.6411]}, {"w": "is", "b": [0.3522, 0.6214, 0.369, 0.6411]}, {"w": "grounded", "b": [0.3753, 0.6214, 0.4706, 0.6411]}, {"w": "in", "b": [0.4769, 0.6214, 0.4965, 0.6411]}, {"w": "our", "b": [0.5029, 0.6214, 0.5365, 0.6411]}, {"w": "sensorimotor", "b": [0.5428, 0.6214, 0.6745, 0.6411]}, {"w": "experience", "b": [0.6808, 0.6214, 0.7901, 0.6411]}, {"w": "as", "b": [0.7964, 0.6214, 0.8174, 0.6411]}, {"w": "humans.", "b": [0.1294, 0.6419, 0.2142, 0.6616]}, {"w": "Machine-learning", "b": [0.2205, 0.6419, 0.3998, 0.6616]}, {"w": "models", "b": [0.4061, 0.6419, 0.479, 0.6616]}, {"w": "have", "b": [0.4853, 0.6419, 0.5329, 0.6616]}, {"w": "no", "b": [0.5393, 0.6419, 0.5645, 0.6616]}, {"w": "access", "b": [0.5708, 0.6419, 0.6352, 0.6616]}, {"w": "to", "b": [0.6415, 0.6419, 0.6611, 0.6616]}, {"w": "such", "b": [0.6674, 0.6419, 0.7136, 0.6616]}, {"w": "experiences", "b": [0.7199, 0.6419, 0.839, 0.6616]}, {"w": "and", "b": [0.1294, 0.6624, 0.1658, 0.6821]}, {"w": "thus", "b": [0.1721, 0.6624, 0.2142, 0.6821]}, {"w": "can’t", "b": [0.2205, 0.6624, 0.2705, 0.6821]}, {"w": "understand", "b": [0.2768, 0.6624, 0.3875, 0.6821]}, {"w": "their", "b": [0.3938, 0.6624, 0.44, 0.6821]}, {"w": "inputs", "b": [0.4463, 0.6624, 0.508, 0.6821]}, {"w": "in", "b": [0.5143, 0.6624, 0.5339, 0.6821]}, {"w": "a", "b": [0.5402, 0.6624, 0.5514, 0.6821]}, {"w": "human-relatable", "b": [0.5577, 0.6624, 0.7216, 0.6821]}, {"w": "way.", "b": [0.728, 0.6624, 0.7746, 0.6821]}, {"w": "By", "b": [0.7809, 0.6624, 0.8103, 0.6821]}, {"w": "annotating", "b": [0.1294, 0.6829, 0.2359, 0.7026]}, {"w": "large", "b": [0.2422, 0.6829, 0.2922, 0.7026]}, {"w": "numbers", "b": [0.2985, 0.6829, 0.3853, 0.7026]}, {"w": "of", "b": [0.3917, 0.6829, 0.4127, 0.7026]}, {"w": "training", "b": [0.419, 0.6829, 0.4975, 0.7026]}, {"w": "examples", "b": [0.5037, 0.6829, 0.599, 0.7026]}, {"w": "to", "b": [0.6053, 0.6829, 0.6249, 0.7026]}, {"w": "feed", "b": [0.6312, 0.6829, 0.6746, 0.7026]}, {"w": "into", "b": [0.681, 0.6829, 0.7202, 0.7026]}, {"w": "our", "b": [0.7265, 0.6829, 0.7601, 0.7026]}, {"w": "models,", "b": [0.7664, 0.6829, 0.8456, 0.7026]}, {"w": "we", "b": [0.1294, 0.7034, 0.1588, 0.7231]}, {"w": "get", "b": [0.1651, 0.7034, 0.196, 0.7231]}, {"w": "them", "b": [0.2023, 0.7034, 0.2527, 0.7231]}, {"w": "to", "b": [0.259, 0.7034, 0.2786, 0.7231]}, {"w": "learn", "b": [0.285, 0.7034, 0.3354, 0.7231]}, {"w": "a", "b": [0.3417, 0.7034, 0.3529, 0.7231]}, {"w": "geometric", "b": [0.3592, 0.7034, 0.4601, 0.7231]}, {"w": "transform", "b": [0.4664, 0.7034, 0.5645, 0.7231]}, {"w": "that", "b": [0.5708, 0.7034, 0.6086, 0.7231]}, {"w": "maps", "b": [0.6149, 0.7034, 0.6682, 0.7231]}, {"w": "data", "b": [0.6745, 0.7034, 0.7165, 0.7231]}, {"w": "to", "b": [0.7228, 0.7034, 0.7424, 0.7231]}, {"w": "human", "b": [0.7487, 0.7034, 0.8174, 0.7231]}, {"w": "concepts", "b": [0.1294, 0.7239, 0.2177, 0.7436]}, {"w": "on", "b": [0.224, 0.7239, 0.2492, 0.7436]}, {"w": "a", "b": [0.2555, 0.7239, 0.2667, 0.7436]}, {"w": "specific", "b": [0.273, 0.7239, 0.3515, 0.7436]}, {"w": "set", "b": [0.3577, 0.7239, 0.3858, 0.7436]}, {"w": "of", "b": [0.3921, 0.7239, 0.4131, 0.7436]}, {"w": "examples,", "b": [0.4194, 0.7239, 0.521, 0.7436]}, {"w": "but", "b": [0.5273, 0.7239, 0.5595, 0.7436]}, {"w": "this", "b": [0.5658, 0.7239, 0.6023, 0.7436]}, {"w": "mapping", "b": [0.6086, 0.7239, 0.6969, 0.7436]}, {"w": "is", "b": [0.7032, 0.7239, 0.72, 0.7436]}, {"w": "a", "b": [0.7263, 0.7239, 0.7375, 0.7436]}, {"w": "simplistic", "b": [0.7438, 0.7239, 0.842, 0.7436]}, {"w": "sketch", "b": [0.1294, 0.7444, 0.1939, 0.7641]}, {"w": "of", "b": [0.2002, 0.7444, 0.2212, 0.7641]}, {"w": "the", "b": [0.2275, 0.7444, 0.2583, 0.7641]}, {"w": "original", "b": [0.2646, 0.7444, 0.3431, 0.7641]}, {"w": "model", "b": [0.3494, 0.7444, 0.4125, 0.7641]}, {"w": "in", "b": [0.4188, 0.7444, 0.4384, 0.7641]}, {"w": "our", "b": [0.4447, 0.7444, 0.4783, 0.7641]}, {"w": "minds—the", "b": [0.4846, 0.7444, 0.6024, 0.7641]}, {"w": "one", "b": [0.6087, 0.7444, 0.6451, 0.7641]}, {"w": "developed", "b": [0.6514, 0.7444, 0.7551, 0.7641]}, {"w": "from", "b": [0.7614, 0.7444, 0.8104, 0.7641]}, {"w": "our", "b": [0.8167, 0.7444, 0.8504, 0.7641]}, {"w": "experience", "b": [0.1294, 0.7649, 0.2387, 0.7846]}, {"w": "as", "b": [0.2449, 0.7649, 0.266, 0.7846]}, {"w": "embodied", "b": [0.2723, 0.7649, 0.3717, 0.7846]}, {"w": "agents.", "b": [0.3781, 0.7649, 0.4488, 0.7846]}, {"w": "It’s", "b": [0.4551, 0.7649, 0.4873, 0.7846]}, {"w": "like", "b": [0.4936, 0.7649, 0.5315, 0.7846]}, {"w": "a", "b": [0.5378, 0.7649, 0.549, 0.7846]}, {"w": "dim", "b": [0.5553, 0.7649, 0.5945, 0.7846]}, {"w": "image", "b": [0.6008, 0.7649, 0.6625, 0.7846]}, {"w": "in", "b": [0.6688, 0.7649, 0.6884, 0.7846]}, {"w": "a", "b": [0.6947, 0.7649, 0.7059, 0.7846]}, {"w": "mirror", "b": [0.7122, 0.7649, 0.7767, 0.7846]}, {"w": "(see", "b": [0.783, 0.7649, 0.8236, 0.7846]}, {"w": "figure", "b": [0.1294, 0.7854, 0.1897, 0.8051]}, {"w": "9.3).", "b": [0.196, 0.7854, 0.2422, 0.8051]}]}, {"id": "b_3", "type": "equation", "text": "Figure 9.3. Current machine-learning models: like a dim image in a mirror", "words": [{"w": "Figure", "b": [0.1294, 0.8232, 0.1827, 0.838]}, {"w": "9.3.", "b": [0.1874, 0.8232, 0.2158, 0.838]}, {"w": "Current", "b": [0.2205, 0.8232, 0.2863, 0.838]}, {"w": "machine-learning", "b": [0.2911, 0.8232, 0.433, 0.838]}, {"w": "models:", "b": [0.4377, 0.8232, 0.5008, 0.838]}, {"w": "like", "b": [0.5055, 0.8232, 0.5349, 0.838]}, {"w": "a", "b": [0.5396, 0.8232, 0.5491, 0.838]}, {"w": "dim", "b": [0.5538, 0.8232, 0.5854, 0.838]}, {"w": "image", "b": [0.5901, 0.8232, 0.6384, 0.838]}, {"w": "in", "b": [0.6432, 0.8232, 0.659, 0.838]}, {"w": "a", "b": [0.6637, 0.8232, 0.6731, 0.838]}, {"w": "mirror", "b": [0.6779, 0.8232, 0.7332, 0.838]}]}]}, {"page": 427, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "As a machine-learning practitioner, always be mindful of this, and never fall into the trap of believing that neural networks understand the task they perform—they don’t, at least not in a way that would make sense to us. They were trained on a different, far narrower task than the one we wanted to teach them: that of mapping training inputs to training targets, point by point. Show them anything that deviates from their training data, and they will break in absurd ways.", "words": [{"w": "As", "b": [0.1294, 0.2996, 0.1574, 0.3193]}, {"w": "a", "b": [0.1637, 0.2996, 0.1749, 0.3193]}, {"w": "machine-learning", "b": [0.1813, 0.2996, 0.3578, 0.3193]}, {"w": "practitioner,", "b": [0.3641, 0.2996, 0.4856, 0.3193]}, {"w": "always", "b": [0.4919, 0.2996, 0.562, 0.3193]}, {"w": "be", "b": [0.5683, 0.2996, 0.5921, 0.3193]}, {"w": "mindful", "b": [0.5984, 0.2996, 0.6783, 0.3193]}, {"w": "of", "b": [0.6846, 0.2996, 0.7056, 0.3193]}, {"w": "this,", "b": [0.7119, 0.2996, 0.7547, 0.3193]}, {"w": "and", "b": [0.761, 0.2996, 0.7974, 0.3193]}, {"w": "never", "b": [0.8037, 0.2996, 0.8597, 0.3193]}, {"w": "fall", "b": [0.1294, 0.3201, 0.163, 0.3398]}, {"w": "into", "b": [0.1693, 0.3201, 0.2086, 0.3398]}, {"w": "the", "b": [0.2149, 0.3201, 0.2457, 0.3398]}, {"w": "trap", "b": [0.252, 0.3201, 0.2913, 0.3398]}, {"w": "of", "b": [0.2976, 0.3201, 0.3186, 0.3398]}, {"w": "believing", "b": [0.3249, 0.3201, 0.4188, 0.3398]}, {"w": "that", "b": [0.4251, 0.3201, 0.4629, 0.3398]}, {"w": "neural", "b": [0.4692, 0.3201, 0.5323, 0.3398]}, {"w": "networks", "b": [0.5386, 0.3201, 0.6311, 0.3398]}, {"w": "understand", "b": [0.6373, 0.3201, 0.748, 0.3398]}, {"w": "the", "b": [0.7543, 0.3201, 0.7851, 0.3398]}, {"w": "task", "b": [0.7914, 0.3201, 0.832, 0.3398]}, {"w": "they", "b": [0.1294, 0.3406, 0.1729, 0.3603]}, {"w": "perform—they", "b": [0.1792, 0.3406, 0.3291, 0.3603]}, {"w": "don’t,", "b": [0.3354, 0.3406, 0.3945, 0.3603]}, {"w": "at", "b": [0.4008, 0.3406, 0.419, 0.3603]}, {"w": "least", "b": [0.4253, 0.3406, 0.4715, 0.3603]}, {"w": "not", "b": [0.4778, 0.3406, 0.5101, 0.3603]}, {"w": "in", "b": [0.5164, 0.3406, 0.536, 0.3603]}, {"w": "a", "b": [0.5423, 0.3406, 0.5535, 0.3603]}, {"w": "way", "b": [0.5598, 0.3406, 0.6018, 0.3603]}, {"w": "that", "b": [0.6081, 0.3406, 0.646, 0.3603]}, {"w": "would", "b": [0.6523, 0.3406, 0.7154, 0.3603]}, {"w": "make", "b": [0.7217, 0.3406, 0.7763, 0.3603]}, {"w": "sense", "b": [0.7826, 0.3406, 0.8372, 0.3603]}, {"w": "to", "b": [0.8436, 0.3406, 0.8632, 0.3603]}, {"w": "us.", "b": [0.1294, 0.3611, 0.1581, 0.3808]}, {"w": "They", "b": [0.1645, 0.3611, 0.2163, 0.3808]}, {"w": "were", "b": [0.2226, 0.3611, 0.2716, 0.3808]}, {"w": "trained", "b": [0.2779, 0.3611, 0.348, 0.3808]}, {"w": "on", "b": [0.3543, 0.3611, 0.3795, 0.3808]}, {"w": "a", "b": [0.3858, 0.3611, 0.397, 0.3808]}, {"w": "different,", "b": [0.4033, 0.3611, 0.496, 0.3808]}, {"w": "far", "b": [0.5023, 0.3611, 0.5303, 0.3808]}, {"w": "narrower", "b": [0.5366, 0.3611, 0.6276, 0.3808]}, {"w": "task", "b": [0.6339, 0.3611, 0.6746, 0.3808]}, {"w": "than", "b": [0.6809, 0.3611, 0.7243, 0.3808]}, {"w": "the", "b": [0.7306, 0.3611, 0.7614, 0.3808]}, {"w": "one", "b": [0.7678, 0.3611, 0.8042, 0.3808]}, {"w": "we", "b": [0.8105, 0.3611, 0.8399, 0.3808]}, {"w": "wanted", "b": [0.1294, 0.3816, 0.2023, 0.4013]}, {"w": "to", "b": [0.2086, 0.3816, 0.2282, 0.4013]}, {"w": "teach", "b": [0.2345, 0.3816, 0.2877, 0.4013]}, {"w": "them:", "b": [0.294, 0.3816, 0.3515, 0.4013]}, {"w": "that", "b": [0.3578, 0.3816, 0.3956, 0.4013]}, {"w": "of", "b": [0.402, 0.3816, 0.423, 0.4013]}, {"w": "mapping", "b": [0.4293, 0.3816, 0.5176, 0.4013]}, {"w": "training", "b": [0.5239, 0.3816, 0.6023, 0.4013]}, {"w": "inputs", "b": [0.6087, 0.3816, 0.6703, 0.4013]}, {"w": "to", "b": [0.6766, 0.3816, 0.6963, 0.4013]}, {"w": "training", "b": [0.7026, 0.3816, 0.781, 0.4013]}, {"w": "targets,", "b": [0.7874, 0.3816, 0.8603, 0.4013]}, {"w": "point", "b": [0.1294, 0.4021, 0.1813, 0.4218]}, {"w": "by", "b": [0.1876, 0.4021, 0.2128, 0.4218]}, {"w": "point.", "b": [0.2191, 0.4021, 0.2773, 0.4218]}, {"w": "Show", "b": [0.2836, 0.4021, 0.341, 0.4218]}, {"w": "them", "b": [0.3473, 0.4021, 0.3978, 0.4218]}, {"w": "anything", "b": [0.4041, 0.4021, 0.4924, 0.4218]}, {"w": "that", "b": [0.4987, 0.4021, 0.5365, 0.4218]}, {"w": "deviates", "b": [0.5428, 0.4021, 0.6255, 0.4218]}, {"w": "from", "b": [0.6318, 0.4021, 0.6808, 0.4218]}, {"w": "their", "b": [0.6872, 0.4021, 0.7334, 0.4218]}, {"w": "training", "b": [0.7397, 0.4021, 0.8182, 0.4218]}, {"w": "data,", "b": [0.1294, 0.4226, 0.1777, 0.4423]}, {"w": "and", "b": [0.1841, 0.4226, 0.2205, 0.4423]}, {"w": "they", "b": [0.2268, 0.4226, 0.2702, 0.4423]}, {"w": "will", "b": [0.2765, 0.4226, 0.3158, 0.4423]}, {"w": "break", "b": [0.3221, 0.4226, 0.3781, 0.4423]}, {"w": "in", "b": [0.3844, 0.4226, 0.404, 0.4423]}, {"w": "absurd", "b": [0.4104, 0.4226, 0.4776, 0.4423]}, {"w": "ways.", "b": [0.4839, 0.4226, 0.5421, 0.4423]}]}, {"id": "b_1", "type": "paragraph", "text": "9.2.2. Local generalization vs. extreme generalization", "words": [{"w": "9.2.2.", "b": [0.1294, 0.4698, 0.1862, 0.4896]}, {"w": "Local", "b": [0.1925, 0.4698, 0.2527, 0.4896]}, {"w": "generalization", "b": [0.259, 0.4698, 0.4118, 0.4896]}, {"w": "vs.", "b": [0.4181, 0.4698, 0.4468, 0.4896]}, {"w": "extreme", "b": [0.4531, 0.4698, 0.5395, 0.4896]}, {"w": "generalization", "b": [0.5458, 0.4698, 0.6985, 0.4896]}]}, {"id": "b_2", "type": "paragraph", "text": "There are fundamental differences between the straightforward geometric morphing from input to output that deep-learning models do, and the way humans think and learn. It isn’t only the fact that humans learn by themselves from embodied experience instead of being presented with explicit training examples. In addition to the different learning processes, there’s a basic difference in the nature of the underlying representations.", "words": [{"w": "There", "b": [0.1294, 0.5126, 0.1882, 0.5324]}, {"w": "are", "b": [0.1945, 0.5126, 0.2253, 0.5324]}, {"w": "fundamental", "b": [0.2317, 0.5126, 0.3578, 0.5324]}, {"w": "differences", "b": [0.3641, 0.5126, 0.4756, 0.5324]}, {"w": "between", "b": [0.4819, 0.5126, 0.566, 0.5324]}, {"w": "the", "b": [0.5723, 0.5126, 0.6031, 0.5324]}, {"w": "straightforward", "b": [0.6094, 0.5126, 0.7649, 0.5324]}, {"w": "geometric", "b": [0.1294, 0.5331, 0.2303, 0.5529]}, {"w": "morphing", "b": [0.2366, 0.5331, 0.3347, 0.5529]}, {"w": "from", "b": [0.341, 0.5331, 0.39, 0.5529]}, {"w": "input", "b": [0.3964, 0.5331, 0.4482, 0.5529]}, {"w": "to", "b": [0.4545, 0.5331, 0.4741, 0.5529]}, {"w": "output", "b": [0.4805, 0.5331, 0.5449, 0.5529]}, {"w": "that", "b": [0.5512, 0.5331, 0.5891, 0.5529]}, {"w": "deep-learning", "b": [0.5954, 0.5331, 0.7341, 0.5529]}, {"w": "models", "b": [0.7404, 0.5331, 0.8133, 0.5529]}, {"w": "do,", "b": [0.8195, 0.5331, 0.851, 0.5529]}, {"w": "and", "b": [0.1294, 0.5536, 0.1658, 0.5734]}, {"w": "the", "b": [0.1721, 0.5536, 0.203, 0.5734]}, {"w": "way", "b": [0.2093, 0.5536, 0.2513, 0.5734]}, {"w": "humans", "b": [0.2576, 0.5536, 0.3361, 0.5734]}, {"w": "think", "b": [0.3424, 0.5536, 0.3943, 0.5734]}, {"w": "and", "b": [0.4006, 0.5536, 0.437, 0.5734]}, {"w": "learn.", "b": [0.4433, 0.5536, 0.5, 0.5734]}, {"w": "It", "b": [0.5063, 0.5536, 0.5217, 0.5734]}, {"w": "isn’t", "b": [0.5281, 0.5536, 0.5724, 0.5734]}, {"w": "only", "b": [0.5787, 0.5536, 0.6236, 0.5734]}, {"w": "the", "b": [0.6299, 0.5536, 0.6607, 0.5734]}, {"w": "fact", "b": [0.667, 0.5536, 0.7048, 0.5734]}, {"w": "that", "b": [0.7111, 0.5536, 0.749, 0.5734]}, {"w": "humans", "b": [0.7553, 0.5536, 0.8337, 0.5734]}, {"w": "learn", "b": [0.1294, 0.5741, 0.1798, 0.5939]}, {"w": "by", "b": [0.1861, 0.5741, 0.2114, 0.5939]}, {"w": "themselves", "b": [0.2177, 0.5741, 0.3298, 0.5939]}, {"w": "from", "b": [0.3361, 0.5741, 0.3851, 0.5939]}, {"w": "embodied", "b": [0.3914, 0.5741, 0.4909, 0.5939]}, {"w": "experience", "b": [0.4972, 0.5741, 0.6065, 0.5939]}, {"w": "instead", "b": [0.6128, 0.5741, 0.6843, 0.5939]}, {"w": "of", "b": [0.6905, 0.5741, 0.7115, 0.5939]}, {"w": "being", "b": [0.7178, 0.5741, 0.7738, 0.5939]}, {"w": "presented", "b": [0.1294, 0.5946, 0.2261, 0.6144]}, {"w": "with", "b": [0.2324, 0.5946, 0.2772, 0.6144]}, {"w": "explicit", "b": [0.2835, 0.5946, 0.3592, 0.6144]}, {"w": "training", "b": [0.3655, 0.5946, 0.444, 0.6144]}, {"w": "examples.", "b": [0.4503, 0.5946, 0.5519, 0.6144]}, {"w": "In", "b": [0.5582, 0.5946, 0.5792, 0.6144]}, {"w": "addition", "b": [0.5855, 0.5946, 0.6682, 0.6144]}, {"w": "to", "b": [0.6745, 0.5946, 0.6941, 0.6144]}, {"w": "the", "b": [0.7004, 0.5946, 0.7313, 0.6144]}, {"w": "different", "b": [0.7376, 0.5946, 0.8239, 0.6144]}, {"w": "learning", "b": [0.1294, 0.6151, 0.2121, 0.6349]}, {"w": "processes,", "b": [0.2184, 0.6151, 0.3214, 0.6349]}, {"w": "there’s", "b": [0.3277, 0.6151, 0.3949, 0.6349]}, {"w": "a", "b": [0.4012, 0.6151, 0.4124, 0.6349]}, {"w": "basic", "b": [0.4187, 0.6151, 0.4705, 0.6349]}, {"w": "difference", "b": [0.4768, 0.6151, 0.5786, 0.6349]}, {"w": "in", "b": [0.5849, 0.6151, 0.6045, 0.6349]}, {"w": "the", "b": [0.6108, 0.6151, 0.6417, 0.6349]}, {"w": "nature", "b": [0.648, 0.6151, 0.711, 0.6349]}, {"w": "of", "b": [0.7173, 0.6151, 0.7383, 0.6349]}, {"w": "the", "b": [0.7446, 0.6151, 0.7755, 0.6349]}, {"w": "underlying", "b": [0.1294, 0.6356, 0.2387, 0.6554]}, {"w": "representations.", "b": [0.245, 0.6356, 0.404, 0.6554]}]}, {"id": "b_3", "type": "paragraph", "text": "Humans are capable of far more than mapping immediate stimuli to immediate responses, as a deep network, or maybe an insect, would. We maintain complex, abstract models of our current situation, of ourselves, and of other people, and can use these models to anticipate different possible futures and perform long-term planning. We can merge together known concepts to represent something we’ve never experienced before —like picturing a horse wearing jeans, for instance, or imagining what we’d do if we won the lottery. This ability to handle hypotheticals, to expand our mental model space far beyond what we can experience directly—to perform abstraction and reasoning—is arguably the defining characteristic of human cognition. I call it extreme", "words": [{"w": "Humans", "b": [0.1294, 0.6784, 0.2135, 0.6981]}, {"w": "are", "b": [0.2198, 0.6784, 0.2506, 0.6981]}, {"w": "capable", "b": [0.2569, 0.6784, 0.3339, 0.6981]}, {"w": "of", "b": [0.3402, 0.6784, 0.3613, 0.6981]}, {"w": "far", "b": [0.3676, 0.6784, 0.3956, 0.6981]}, {"w": "more", "b": [0.4019, 0.6784, 0.4537, 0.6981]}, {"w": "than", "b": [0.46, 0.6784, 0.5035, 0.6981]}, {"w": "mapping", "b": [0.5098, 0.6784, 0.5981, 0.6981]}, {"w": "immediate", "b": [0.6044, 0.6784, 0.7109, 0.6981]}, {"w": "stimuli", "b": [0.7172, 0.6784, 0.7873, 0.6981]}, {"w": "to", "b": [0.7936, 0.6784, 0.8132, 0.6981]}, {"w": "immediate", "b": [0.1294, 0.6989, 0.2359, 0.7186]}, {"w": "responses,", "b": [0.2422, 0.6989, 0.3466, 0.7186]}, {"w": "as", "b": [0.3529, 0.6989, 0.3739, 0.7186]}, {"w": "a", "b": [0.3802, 0.6989, 0.3914, 0.7186]}, {"w": "deep", "b": [0.3977, 0.6989, 0.4454, 0.7186]}, {"w": "network,", "b": [0.4517, 0.6989, 0.5406, 0.7186]}, {"w": "or", "b": [0.5469, 0.6989, 0.568, 0.7186]}, {"w": "maybe", "b": [0.5743, 0.6989, 0.6415, 0.7186]}, {"w": "an", "b": [0.6478, 0.6989, 0.6716, 0.7186]}, {"w": "insect,", "b": [0.6779, 0.6989, 0.7431, 0.7186]}, {"w": "would.", "b": [0.7493, 0.6989, 0.8187, 0.7186]}, {"w": "We", "b": [0.825, 0.6989, 0.858, 0.7186]}, {"w": "maintain", "b": [0.1294, 0.7194, 0.2177, 0.7391]}, {"w": "complex,", "b": [0.224, 0.7194, 0.3172, 0.7391]}, {"w": "abstract", "b": [0.3235, 0.7194, 0.4061, 0.7391]}, {"w": "models", "b": [0.4124, 0.7194, 0.4839, 0.7391]}, {"w": "of", "b": [0.4902, 0.7194, 0.5112, 0.7391]}, {"w": "our", "b": [0.5175, 0.7194, 0.5511, 0.7391]}, {"w": "current", "b": [0.5575, 0.7194, 0.6289, 0.7391]}, {"w": "situation,", "b": [0.6352, 0.7194, 0.7284, 0.7391]}, {"w": "of", "b": [0.7347, 0.7194, 0.7557, 0.7391]}, {"w": "ourselves,", "b": [0.762, 0.7194, 0.8636, 0.7391]}, {"w": "and", "b": [0.1294, 0.7399, 0.1658, 0.7596]}, {"w": "of", "b": [0.1721, 0.7399, 0.1932, 0.7596]}, {"w": "other", "b": [0.1995, 0.7399, 0.2513, 0.7596]}, {"w": "people,", "b": [0.2576, 0.7399, 0.3312, 0.7596]}, {"w": "and", "b": [0.3375, 0.7399, 0.3739, 0.7596]}, {"w": "can", "b": [0.3802, 0.7399, 0.4152, 0.7596]}, {"w": "use", "b": [0.4215, 0.7399, 0.4552, 0.7596]}, {"w": "these", "b": [0.4615, 0.7399, 0.5133, 0.7596]}, {"w": "models", "b": [0.5196, 0.7399, 0.5925, 0.7596]}, {"w": "to", "b": [0.5988, 0.7399, 0.6184, 0.7596]}, {"w": "anticipate", "b": [0.6247, 0.7399, 0.7228, 0.7596]}, {"w": "different", "b": [0.7291, 0.7399, 0.8154, 0.7596]}, {"w": "possible", "b": [0.1294, 0.7604, 0.2121, 0.7801]}, {"w": "futures", "b": [0.2184, 0.7604, 0.2885, 0.7801]}, {"w": "and", "b": [0.2948, 0.7604, 0.3312, 0.7801]}, {"w": "perform", "b": [0.3375, 0.7604, 0.4187, 0.7801]}, {"w": "long-term", "b": [0.4251, 0.7604, 0.5245, 0.7801]}, {"w": "planning.", "b": [0.5308, 0.7604, 0.6254, 0.7801]}, {"w": "We", "b": [0.6317, 0.7604, 0.6647, 0.7801]}, {"w": "can", "b": [0.671, 0.7604, 0.706, 0.7801]}, {"w": "merge", "b": [0.7123, 0.7604, 0.7749, 0.7801]}, {"w": "together", "b": [0.7812, 0.7604, 0.8639, 0.7801]}, {"w": "known", "b": [0.1294, 0.7809, 0.1981, 0.8006]}, {"w": "concepts", "b": [0.2044, 0.7809, 0.2926, 0.8006]}, {"w": "to", "b": [0.299, 0.7809, 0.3186, 0.8006]}, {"w": "represent", "b": [0.3249, 0.7809, 0.4173, 0.8006]}, {"w": "something", "b": [0.4236, 0.7809, 0.5288, 0.8006]}, {"w": "we’ve", "b": [0.5351, 0.7809, 0.5967, 0.8006]}, {"w": "never", "b": [0.603, 0.7809, 0.659, 0.8006]}, {"w": "experienced", "b": [0.6653, 0.7809, 0.7872, 0.8006]}, {"w": "before", "b": [0.7934, 0.7809, 0.8578, 0.8006]}, {"w": "—like", "b": [0.1294, 0.8014, 0.1925, 0.8211]}, {"w": "picturing", "b": [0.1988, 0.8014, 0.2899, 0.8211]}, {"w": "a", "b": [0.2962, 0.8014, 0.3074, 0.8211]}, {"w": "horse", "b": [0.3137, 0.8014, 0.3683, 0.8211]}, {"w": "wearing", "b": [0.3746, 0.8014, 0.4559, 0.8211]}, {"w": "jeans,", "b": [0.4622, 0.8014, 0.5203, 0.8211]}, {"w": "for", "b": [0.5266, 0.8014, 0.5561, 0.8211]}, {"w": "instance,", "b": [0.5624, 0.8014, 0.6513, 0.8211]}, {"w": "or", "b": [0.6576, 0.8014, 0.6787, 0.8211]}, {"w": "imagining", "b": [0.685, 0.8014, 0.7873, 0.8211]}, {"w": "what", "b": [0.7936, 0.8014, 0.8426, 0.8211]}, {"w": "we’d", "b": [0.1294, 0.8219, 0.1798, 0.8416]}, {"w": "do", "b": [0.1861, 0.8219, 0.2114, 0.8416]}, {"w": "if", "b": [0.2177, 0.8219, 0.2331, 0.8416]}, {"w": "we", "b": [0.2394, 0.8219, 0.2688, 0.8416]}, {"w": "won", "b": [0.2751, 0.8219, 0.3186, 0.8416]}, {"w": "the", "b": [0.3249, 0.8219, 0.3557, 0.8416]}, {"w": "lottery.", "b": [0.362, 0.8219, 0.4325, 0.8416]}, {"w": "This", "b": [0.4388, 0.8219, 0.4837, 0.8416]}, {"w": "ability", "b": [0.49, 0.8219, 0.5544, 0.8416]}, {"w": "to", "b": [0.5608, 0.8219, 0.5804, 0.8416]}, {"w": "handle", "b": [0.5866, 0.8219, 0.6539, 0.8416]}, {"w": "hypotheticals,", "b": [0.6602, 0.8219, 0.801, 0.8416]}, {"w": "to", "b": [0.8073, 0.8219, 0.827, 0.8416]}, {"w": "expand", "b": [0.1294, 0.8424, 0.2023, 0.8621]}, {"w": "our", "b": [0.2086, 0.8424, 0.2422, 0.8621]}, {"w": "mental", "b": [0.2485, 0.8424, 0.3172, 0.8621]}, {"w": "model", "b": [0.3235, 0.8424, 0.3865, 0.8621]}, {"w": "space", "b": [0.3928, 0.8424, 0.4489, 0.8621]}, {"w": "far", "b": [0.4552, 0.8424, 0.4832, 0.8621]}, {"w": "beyond", "b": [0.4895, 0.8424, 0.5637, 0.8621]}, {"w": "what", "b": [0.5701, 0.8424, 0.6191, 0.8621]}, {"w": "we", "b": [0.6254, 0.8424, 0.6548, 0.8621]}, {"w": "can", "b": [0.6611, 0.8424, 0.6961, 0.8621]}, {"w": "experience", "b": [0.7024, 0.8424, 0.8117, 0.8621]}, {"w": "directly—to", "b": [0.1294, 0.8629, 0.2513, 0.8826]}, {"w": "perform", "b": [0.2576, 0.8629, 0.3389, 0.8826]}, {"w": "abstraction", "b": [0.3452, 0.8629, 0.4601, 0.8826]}, {"w": "and", "b": [0.4664, 0.8629, 0.5028, 0.8826]}, {"w": "reasoning—is", "b": [0.5091, 0.8629, 0.6511, 0.8826]}, {"w": "arguably", "b": [0.6574, 0.8629, 0.7452, 0.8826]}, {"w": "the", "b": [0.7515, 0.8629, 0.7824, 0.8826]}, {"w": "defining", "b": [0.1294, 0.8834, 0.2135, 0.9031]}, {"w": "characteristic", "b": [0.2198, 0.8834, 0.3543, 0.9031]}, {"w": "of", "b": [0.3606, 0.8834, 0.3816, 0.9031]}, {"w": "human", "b": [0.3879, 0.8834, 0.4566, 0.9031]}, {"w": "cognition.", "b": [0.4629, 0.8834, 0.5645, 0.9031]}, {"w": "I", "b": [0.5708, 0.8834, 0.5792, 0.9031]}, {"w": "call", "b": [0.5855, 0.8834, 0.6219, 0.9031]}, {"w": "it", "b": [0.6282, 0.8834, 0.6423, 0.9031]}, {"w": "extreme", "b": [0.6485, 0.8834, 0.7273, 0.9031]}]}]}, {"page": 428, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "generalization: an ability to adapt to novel, never-before-experienced situations using little data or even no new data at all.", "words": [{"w": "generalization:", "b": [0.1294, 0.0857, 0.2822, 0.1054]}, {"w": "an", "b": [0.2885, 0.0857, 0.3123, 0.1054]}, {"w": "ability", "b": [0.3186, 0.0857, 0.3831, 0.1054]}, {"w": "to", "b": [0.3894, 0.0857, 0.409, 0.1054]}, {"w": "adapt", "b": [0.4153, 0.0857, 0.4699, 0.1054]}, {"w": "to", "b": [0.4762, 0.0857, 0.4959, 0.1054]}, {"w": "novel,", "b": [0.5022, 0.0857, 0.5645, 0.1054]}, {"w": "never-before-experienced", "b": [0.5708, 0.0857, 0.8294, 0.1054]}, {"w": "situations", "b": [0.1294, 0.1062, 0.2261, 0.1259]}, {"w": "using", "b": [0.2324, 0.1062, 0.2871, 0.1259]}, {"w": "little", "b": [0.2934, 0.1062, 0.3397, 0.1259]}, {"w": "data", "b": [0.346, 0.1062, 0.388, 0.1259]}, {"w": "or", "b": [0.3943, 0.1062, 0.4153, 0.1259]}, {"w": "even", "b": [0.4216, 0.1062, 0.4693, 0.1259]}, {"w": "no", "b": [0.4756, 0.1062, 0.5008, 0.1259]}, {"w": "new", "b": [0.5071, 0.1062, 0.5491, 0.1259]}, {"w": "data", "b": [0.5554, 0.1062, 0.5975, 0.1259]}, {"w": "at", "b": [0.6038, 0.1062, 0.622, 0.1259]}, {"w": "all.", "b": [0.6283, 0.1062, 0.6598, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "This stands in sharp contrast with what deep nets do, which I call local generalization (see figure 9.4). The mapping from inputs to outputs performed by a deep net quickly stops making sense if new inputs differ even slightly from what the net saw at training time. Consider, for instance, the problem of learning the appropriate launch parameters to get a rocket to land on the moon. If you used a deep net for this task and trained it using supervised learning or reinforcement learning, you’d have to feed it thousands or even millions of launch trials: you’d need to expose it to a dense sampling of the input space, in order for it to learn a reliable mapping from input space to output space. In contrast, as humans we can use our power of abstraction to come up with physical models—rocket science—and derive an exact solution that will land the rocket on the moon in one or a few trials. Similarly, if you developed a deep net controlling a human body, and you wanted it to learn to safely navigate a city without getting hit by cars, the net would have to die many thousands of times in various situations until it could infer that cars are dangerous, and develop appropriate avoidance behaviors. Dropped into a new city, the net would have to relearn most of what it knows. On the other hand, humans are able to learn safe behaviors without having to die even once—again, thanks to our power of abstract modeling of hypothetical situations.", "words": [{"w": "This", "b": [0.1294, 0.149, 0.1743, 0.1687]}, {"w": "stands", "b": [0.1806, 0.149, 0.2436, 0.1687]}, {"w": "in", "b": [0.2499, 0.149, 0.2696, 0.1687]}, {"w": "sharp", "b": [0.2759, 0.149, 0.3305, 0.1687]}, {"w": "contrast", "b": [0.3368, 0.149, 0.4167, 0.1687]}, {"w": "with", "b": [0.423, 0.149, 0.4678, 0.1687]}, {"w": "what", "b": [0.4741, 0.149, 0.5232, 0.1687]}, {"w": "deep", "b": [0.5295, 0.149, 0.5771, 0.1687]}, {"w": "nets", "b": [0.5834, 0.149, 0.6241, 0.1687]}, {"w": "do,", "b": [0.6304, 0.149, 0.6619, 0.1687]}, {"w": "which", "b": [0.6682, 0.149, 0.7299, 0.1687]}, {"w": "I", "b": [0.7362, 0.149, 0.7446, 0.1687]}, {"w": "call", "b": [0.7509, 0.149, 0.7873, 0.1687]}, {"w": "local", "b": [0.7935, 0.149, 0.844, 0.1687]}, {"w": "generalization", "b": [0.1294, 0.1695, 0.2752, 0.1892]}, {"w": "(see", "b": [0.2815, 0.1695, 0.3221, 0.1892]}, {"w": "figure", "b": [0.3284, 0.1695, 0.3886, 0.1892]}, {"w": "9.4).", "b": [0.3949, 0.1695, 0.4411, 0.1892]}, {"w": "The", "b": [0.4474, 0.1695, 0.4867, 0.1892]}, {"w": "mapping", "b": [0.493, 0.1695, 0.5813, 0.1892]}, {"w": "from", "b": [0.5876, 0.1695, 0.6366, 0.1892]}, {"w": "inputs", "b": [0.6429, 0.1695, 0.7046, 0.1892]}, {"w": "to", "b": [0.7109, 0.1695, 0.7305, 0.1892]}, {"w": "outputs", "b": [0.7368, 0.1695, 0.8111, 0.1892]}, {"w": "performed", "b": [0.1294, 0.19, 0.2345, 0.2097]}, {"w": "by", "b": [0.2408, 0.19, 0.266, 0.2097]}, {"w": "a", "b": [0.2723, 0.19, 0.2835, 0.2097]}, {"w": "deep", "b": [0.2898, 0.19, 0.3374, 0.2097]}, {"w": "net", "b": [0.3438, 0.19, 0.3746, 0.2097]}, {"w": "quickly", "b": [0.3809, 0.19, 0.4566, 0.2097]}, {"w": "stops", "b": [0.4629, 0.19, 0.5147, 0.2097]}, {"w": "making", "b": [0.521, 0.19, 0.5967, 0.2097]}, {"w": "sense", "b": [0.603, 0.19, 0.6577, 0.2097]}, {"w": "if", "b": [0.664, 0.19, 0.6794, 0.2097]}, {"w": "new", "b": [0.6857, 0.19, 0.7277, 0.2097]}, {"w": "inputs", "b": [0.734, 0.19, 0.7957, 0.2097]}, {"w": "differ", "b": [0.802, 0.19, 0.8575, 0.2097]}, {"w": "even", "b": [0.1294, 0.2105, 0.177, 0.2302]}, {"w": "slightly", "b": [0.1833, 0.2105, 0.259, 0.2302]}, {"w": "from", "b": [0.2653, 0.2105, 0.3144, 0.2302]}, {"w": "what", "b": [0.3207, 0.2105, 0.3697, 0.2302]}, {"w": "the", "b": [0.376, 0.2105, 0.4068, 0.2302]}, {"w": "net", "b": [0.4131, 0.2105, 0.444, 0.2302]}, {"w": "saw", "b": [0.4503, 0.2105, 0.4895, 0.2302]}, {"w": "at", "b": [0.4958, 0.2105, 0.514, 0.2302]}, {"w": "training", "b": [0.5203, 0.2105, 0.5988, 0.2302]}, {"w": "time.", "b": [0.6051, 0.2105, 0.6563, 0.2302]}, {"w": "Consider,", "b": [0.6626, 0.2105, 0.7589, 0.2302]}, {"w": "for", "b": [0.7652, 0.2105, 0.7946, 0.2302]}, {"w": "instance,", "b": [0.1294, 0.231, 0.2184, 0.2507]}, {"w": "the", "b": [0.2247, 0.231, 0.2555, 0.2507]}, {"w": "problem", "b": [0.2618, 0.231, 0.3459, 0.2507]}, {"w": "of", "b": [0.3522, 0.231, 0.3732, 0.2507]}, {"w": "learning", "b": [0.3795, 0.231, 0.4622, 0.2507]}, {"w": "the", "b": [0.4685, 0.231, 0.4993, 0.2507]}, {"w": "appropriate", "b": [0.5056, 0.231, 0.6205, 0.2507]}, {"w": "launch", "b": [0.6268, 0.231, 0.6941, 0.2507]}, {"w": "parameters", "b": [0.7004, 0.231, 0.811, 0.2507]}, {"w": "to", "b": [0.8172, 0.231, 0.8369, 0.2507]}, {"w": "get", "b": [0.1294, 0.2515, 0.1602, 0.2712]}, {"w": "a", "b": [0.1665, 0.2515, 0.1777, 0.2712]}, {"w": "rocket", "b": [0.1841, 0.2515, 0.2471, 0.2712]}, {"w": "to", "b": [0.2534, 0.2515, 0.273, 0.2712]}, {"w": "land", "b": [0.2793, 0.2515, 0.3228, 0.2712]}, {"w": "on", "b": [0.3291, 0.2515, 0.3543, 0.2712]}, {"w": "the", "b": [0.3606, 0.2515, 0.3914, 0.2712]}, {"w": "moon.", "b": [0.3977, 0.2515, 0.4615, 0.2712]}, {"w": "If", "b": [0.4678, 0.2515, 0.4846, 0.2712]}, {"w": "you", "b": [0.4909, 0.2515, 0.5288, 0.2712]}, {"w": "used", "b": [0.5351, 0.2515, 0.5813, 0.2712]}, {"w": "a", "b": [0.5876, 0.2515, 0.5988, 0.2712]}, {"w": "deep", "b": [0.6051, 0.2515, 0.6527, 0.2712]}, {"w": "net", "b": [0.6591, 0.2515, 0.6899, 0.2712]}, {"w": "for", "b": [0.6962, 0.2515, 0.7256, 0.2712]}, {"w": "this", "b": [0.7319, 0.2515, 0.7684, 0.2712]}, {"w": "task", "b": [0.7747, 0.2515, 0.8153, 0.2712]}, {"w": "and", "b": [0.8216, 0.2515, 0.858, 0.2712]}, {"w": "trained", "b": [0.1294, 0.272, 0.1995, 0.2917]}, {"w": "it", "b": [0.2058, 0.272, 0.2198, 0.2917]}, {"w": "using", "b": [0.2261, 0.272, 0.2808, 0.2917]}, {"w": "supervised", "b": [0.2871, 0.272, 0.395, 0.2917]}, {"w": "learning", "b": [0.4013, 0.272, 0.4839, 0.2917]}, {"w": "or", "b": [0.4902, 0.272, 0.5113, 0.2917]}, {"w": "reinforcement", "b": [0.5176, 0.272, 0.6591, 0.2917]}, {"w": "learning,", "b": [0.6653, 0.272, 0.7543, 0.2917]}, {"w": "you’d", "b": [0.7606, 0.272, 0.8194, 0.2917]}, {"w": "have", "b": [0.1294, 0.2925, 0.177, 0.3122]}, {"w": "to", "b": [0.1833, 0.2925, 0.203, 0.3122]}, {"w": "feed", "b": [0.2093, 0.2925, 0.2527, 0.3122]}, {"w": "it", "b": [0.259, 0.2925, 0.273, 0.3122]}, {"w": "thousands", "b": [0.2793, 0.2925, 0.3802, 0.3122]}, {"w": "or", "b": [0.3865, 0.2925, 0.4076, 0.3122]}, {"w": "even", "b": [0.4139, 0.2925, 0.4615, 0.3122]}, {"w": "millions", "b": [0.4678, 0.2925, 0.5505, 0.3122]}, {"w": "of", "b": [0.5568, 0.2925, 0.5778, 0.3122]}, {"w": "launch", "b": [0.5841, 0.2925, 0.6514, 0.3122]}, {"w": "trials:", "b": [0.6577, 0.2925, 0.7152, 0.3122]}, {"w": "you’d", "b": [0.7215, 0.2925, 0.7803, 0.3122]}, {"w": "need", "b": [0.7866, 0.2925, 0.8342, 0.3122]}, {"w": "to", "b": [0.8406, 0.2925, 0.8602, 0.3122]}, {"w": "expose", "b": [0.1294, 0.313, 0.1995, 0.3327]}, {"w": "it", "b": [0.2058, 0.313, 0.2198, 0.3327]}, {"w": "to", "b": [0.2261, 0.313, 0.2457, 0.3327]}, {"w": "a", "b": [0.252, 0.313, 0.2632, 0.3327]}, {"w": "dense", "b": [0.2695, 0.313, 0.327, 0.3327]}, {"w": "sampling", "b": [0.3333, 0.313, 0.4258, 0.3327]}, {"w": "of", "b": [0.4321, 0.313, 0.4531, 0.3327]}, {"w": "the", "b": [0.4594, 0.313, 0.4902, 0.3327]}, {"w": "input", "b": [0.4965, 0.313, 0.5484, 0.3327]}, {"w": "space,", "b": [0.5547, 0.313, 0.617, 0.3327]}, {"w": "in", "b": [0.6233, 0.313, 0.6429, 0.3327]}, {"w": "order", "b": [0.6493, 0.313, 0.7025, 0.3327]}, {"w": "for", "b": [0.7088, 0.313, 0.7382, 0.3327]}, {"w": "it", "b": [0.7445, 0.313, 0.7585, 0.3327]}, {"w": "to", "b": [0.7648, 0.313, 0.7845, 0.3327]}, {"w": "learn", "b": [0.7908, 0.313, 0.8412, 0.3327]}, {"w": "a", "b": [0.8475, 0.313, 0.8587, 0.3327]}, {"w": "reliable", "b": [0.1294, 0.3335, 0.2051, 0.3532]}, {"w": "mapping", "b": [0.2114, 0.3335, 0.2997, 0.3532]}, {"w": "from", "b": [0.306, 0.3335, 0.355, 0.3532]}, {"w": "input", "b": [0.3613, 0.3335, 0.4132, 0.3532]}, {"w": "space", "b": [0.4195, 0.3335, 0.4755, 0.3532]}, {"w": "to", "b": [0.4818, 0.3335, 0.5014, 0.3532]}, {"w": "output", "b": [0.5077, 0.3335, 0.5722, 0.3532]}, {"w": "space.", "b": [0.5785, 0.3335, 0.6409, 0.3532]}, {"w": "In", "b": [0.6472, 0.3335, 0.6682, 0.3532]}, {"w": "contrast,", "b": [0.6745, 0.3335, 0.7607, 0.3532]}, {"w": "as", "b": [0.767, 0.3335, 0.788, 0.3532]}, {"w": "humans", "b": [0.1294, 0.354, 0.2079, 0.3737]}, {"w": "we", "b": [0.2142, 0.354, 0.2436, 0.3737]}, {"w": "can", "b": [0.2499, 0.354, 0.2849, 0.3737]}, {"w": "use", "b": [0.2912, 0.354, 0.3248, 0.3737]}, {"w": "our", "b": [0.3311, 0.354, 0.3648, 0.3737]}, {"w": "power", "b": [0.3711, 0.354, 0.4341, 0.3737]}, {"w": "of", "b": [0.4404, 0.354, 0.4614, 0.3737]}, {"w": "abstraction", "b": [0.4677, 0.354, 0.5784, 0.3737]}, {"w": "to", "b": [0.5847, 0.354, 0.6044, 0.3737]}, {"w": "come", "b": [0.6107, 0.354, 0.6653, 0.3737]}, {"w": "up", "b": [0.6716, 0.354, 0.6968, 0.3737]}, {"w": "with", "b": [0.7032, 0.354, 0.748, 0.3737]}, {"w": "physical", "b": [0.7543, 0.354, 0.8384, 0.3737]}, {"w": "models—rocket", "b": [0.1294, 0.3745, 0.2906, 0.3942]}, {"w": "science—and", "b": [0.2969, 0.3745, 0.4328, 0.3942]}, {"w": "derive", "b": [0.4391, 0.3745, 0.5021, 0.3942]}, {"w": "an", "b": [0.5084, 0.3745, 0.5322, 0.3942]}, {"w": "exact", "b": [0.5385, 0.3745, 0.5917, 0.3942]}, {"w": "solution", "b": [0.598, 0.3745, 0.6793, 0.3942]}, {"w": "that", "b": [0.6856, 0.3745, 0.7234, 0.3942]}, {"w": "will", "b": [0.7297, 0.3745, 0.769, 0.3942]}, {"w": "land", "b": [0.7753, 0.3745, 0.8187, 0.3942]}, {"w": "the", "b": [0.825, 0.3745, 0.8559, 0.3942]}, {"w": "rocket", "b": [0.1294, 0.395, 0.1925, 0.4147]}, {"w": "on", "b": [0.1988, 0.395, 0.224, 0.4147]}, {"w": "the", "b": [0.2303, 0.395, 0.2611, 0.4147]}, {"w": "moon", "b": [0.2674, 0.395, 0.3249, 0.4147]}, {"w": "in", "b": [0.3312, 0.395, 0.3508, 0.4147]}, {"w": "one", "b": [0.3571, 0.395, 0.3936, 0.4147]}, {"w": "or", "b": [0.3999, 0.395, 0.4209, 0.4147]}, {"w": "a", "b": [0.4272, 0.395, 0.4384, 0.4147]}, {"w": "few", "b": [0.4447, 0.395, 0.4825, 0.4147]}, {"w": "trials.", "b": [0.4888, 0.395, 0.5456, 0.4147]}, {"w": "Similarly,", "b": [0.5519, 0.395, 0.6504, 0.4147]}, {"w": "if", "b": [0.6567, 0.395, 0.6721, 0.4147]}, {"w": "you", "b": [0.6784, 0.395, 0.7162, 0.4147]}, {"w": "developed", "b": [0.7226, 0.395, 0.8262, 0.4147]}, {"w": "a", "b": [0.8325, 0.395, 0.8437, 0.4147]}, {"w": "deep", "b": [0.1294, 0.4155, 0.177, 0.4352]}, {"w": "net", "b": [0.1833, 0.4155, 0.2142, 0.4352]}, {"w": "controlling", "b": [0.2205, 0.4155, 0.3312, 0.4352]}, {"w": "a", "b": [0.3374, 0.4155, 0.3486, 0.4352]}, {"w": "human", "b": [0.355, 0.4155, 0.4236, 0.4352]}, {"w": "body,", "b": [0.4299, 0.4155, 0.485, 0.4352]}, {"w": "and", "b": [0.4913, 0.4155, 0.5278, 0.4352]}, {"w": "you", "b": [0.5341, 0.4155, 0.5719, 0.4352]}, {"w": "wanted", "b": [0.5782, 0.4155, 0.6511, 0.4352]}, {"w": "it", "b": [0.6574, 0.4155, 0.6714, 0.4352]}, {"w": "to", "b": [0.6777, 0.4155, 0.6973, 0.4352]}, {"w": "learn", "b": [0.7036, 0.4155, 0.7541, 0.4352]}, {"w": "to", "b": [0.7604, 0.4155, 0.78, 0.4352]}, {"w": "safely", "b": [0.7863, 0.4155, 0.8465, 0.4352]}, {"w": "navigate", "b": [0.1294, 0.436, 0.2149, 0.4557]}, {"w": "a", "b": [0.2212, 0.436, 0.2324, 0.4557]}, {"w": "city", "b": [0.2387, 0.436, 0.2765, 0.4557]}, {"w": "without", "b": [0.2828, 0.436, 0.3599, 0.4557]}, {"w": "getting", "b": [0.3662, 0.436, 0.4363, 0.4557]}, {"w": "hit", "b": [0.4426, 0.436, 0.4693, 0.4557]}, {"w": "by", "b": [0.4756, 0.436, 0.5008, 0.4557]}, {"w": "cars,", "b": [0.5071, 0.436, 0.554, 0.4557]}, {"w": "the", "b": [0.5603, 0.436, 0.5911, 0.4557]}, {"w": "net", "b": [0.5975, 0.436, 0.6283, 0.4557]}, {"w": "would", "b": [0.6346, 0.436, 0.6976, 0.4557]}, {"w": "have", "b": [0.704, 0.436, 0.7516, 0.4557]}, {"w": "to", "b": [0.7579, 0.436, 0.7775, 0.4557]}, {"w": "die", "b": [0.7838, 0.436, 0.8146, 0.4557]}, {"w": "many", "b": [0.1294, 0.4565, 0.1855, 0.4762]}, {"w": "thousands", "b": [0.1918, 0.4565, 0.2927, 0.4762]}, {"w": "of", "b": [0.299, 0.4565, 0.32, 0.4762]}, {"w": "times", "b": [0.3263, 0.4565, 0.381, 0.4762]}, {"w": "in", "b": [0.3873, 0.4565, 0.4069, 0.4762]}, {"w": "various", "b": [0.4132, 0.4565, 0.4875, 0.4762]}, {"w": "situations", "b": [0.4938, 0.4565, 0.5905, 0.4762]}, {"w": "until", "b": [0.5968, 0.4565, 0.6431, 0.4762]}, {"w": "it", "b": [0.6494, 0.4565, 0.6634, 0.4762]}, {"w": "could", "b": [0.6697, 0.4565, 0.7257, 0.4762]}, {"w": "infer", "b": [0.7321, 0.4565, 0.7797, 0.4762]}, {"w": "that", "b": [0.786, 0.4565, 0.8238, 0.4762]}, {"w": "cars", "b": [0.8301, 0.4565, 0.8707, 0.4762]}, {"w": "are", "b": [0.1294, 0.477, 0.1602, 0.4967]}, {"w": "dangerous,", "b": [0.1665, 0.477, 0.2765, 0.4967]}, {"w": "and", "b": [0.2828, 0.477, 0.3192, 0.4967]}, {"w": "develop", "b": [0.3255, 0.477, 0.4054, 0.4967]}, {"w": "appropriate", "b": [0.4117, 0.477, 0.5266, 0.4967]}, {"w": "avoidance", "b": [0.5329, 0.477, 0.6352, 0.4967]}, {"w": "behaviors.", "b": [0.6414, 0.477, 0.7458, 0.4967]}, {"w": "Dropped", "b": [0.7521, 0.477, 0.8404, 0.4967]}, {"w": "into", "b": [0.1294, 0.4975, 0.1687, 0.5172]}, {"w": "a", "b": [0.175, 0.4975, 0.1862, 0.5172]}, {"w": "new", "b": [0.1925, 0.4975, 0.2345, 0.5172]}, {"w": "city,", "b": [0.2408, 0.4975, 0.2833, 0.5172]}, {"w": "the", "b": [0.2896, 0.4975, 0.3204, 0.5172]}, {"w": "net", "b": [0.3267, 0.4975, 0.3576, 0.5172]}, {"w": "would", "b": [0.3639, 0.4975, 0.4269, 0.5172]}, {"w": "have", "b": [0.4332, 0.4975, 0.4809, 0.5172]}, {"w": "to", "b": [0.4872, 0.4975, 0.5068, 0.5172]}, {"w": "relearn", "b": [0.5131, 0.4975, 0.5831, 0.5172]}, {"w": "most", "b": [0.5894, 0.4975, 0.6385, 0.5172]}, {"w": "of", "b": [0.6448, 0.4975, 0.6658, 0.5172]}, {"w": "what", "b": [0.6721, 0.4975, 0.7212, 0.5172]}, {"w": "it", "b": [0.7275, 0.4975, 0.7415, 0.5172]}, {"w": "knows.", "b": [0.7478, 0.4975, 0.82, 0.5172]}, {"w": "On", "b": [0.8263, 0.4975, 0.8571, 0.5172]}, {"w": "the", "b": [0.1294, 0.518, 0.1602, 0.5377]}, {"w": "other", "b": [0.1665, 0.518, 0.2184, 0.5377]}, {"w": "hand,", "b": [0.2247, 0.518, 0.28, 0.5377]}, {"w": "humans", "b": [0.2863, 0.518, 0.3648, 0.5377]}, {"w": "are", "b": [0.3711, 0.518, 0.4019, 0.5377]}, {"w": "able", "b": [0.4082, 0.518, 0.4503, 0.5377]}, {"w": "to", "b": [0.4565, 0.518, 0.4761, 0.5377]}, {"w": "learn", "b": [0.4825, 0.518, 0.5329, 0.5377]}, {"w": "safe", "b": [0.5392, 0.518, 0.5798, 0.5377]}, {"w": "behaviors", "b": [0.5861, 0.518, 0.6842, 0.5377]}, {"w": "without", "b": [0.6905, 0.518, 0.7676, 0.5377]}, {"w": "having", "b": [0.7739, 0.518, 0.8425, 0.5377]}, {"w": "to", "b": [0.8489, 0.518, 0.8685, 0.5377]}, {"w": "die", "b": [0.1294, 0.5385, 0.1602, 0.5582]}, {"w": "even", "b": [0.1665, 0.5385, 0.2142, 0.5582]}, {"w": "once—again,", "b": [0.2205, 0.5385, 0.3543, 0.5582]}, {"w": "thanks", "b": [0.3606, 0.5385, 0.4264, 0.5582]}, {"w": "to", "b": [0.4328, 0.5385, 0.4524, 0.5582]}, {"w": "our", "b": [0.4587, 0.5385, 0.4923, 0.5582]}, {"w": "power", "b": [0.4986, 0.5385, 0.5617, 0.5582]}, {"w": "of", "b": [0.568, 0.5385, 0.589, 0.5582]}, {"w": "abstract", "b": [0.5953, 0.5385, 0.6737, 0.5582]}, {"w": "modeling", "b": [0.68, 0.5385, 0.7753, 0.5582]}, {"w": "of", "b": [0.7816, 0.5385, 0.8027, 0.5582]}, {"w": "hypothetical", "b": [0.1294, 0.559, 0.2541, 0.5787]}, {"w": "situations.", "b": [0.2604, 0.559, 0.3635, 0.5787]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 9.4. Local generalization vs. extreme generalization", "words": [{"w": "Figure", "b": [0.1294, 0.5968, 0.1827, 0.6116]}, {"w": "9.4.", "b": [0.1874, 0.5968, 0.2158, 0.6116]}, {"w": "Local", "b": [0.2205, 0.5968, 0.2657, 0.6116]}, {"w": "generalization", "b": [0.2704, 0.5968, 0.385, 0.6116]}, {"w": "vs.", "b": [0.3897, 0.5968, 0.4112, 0.6116]}, {"w": "extreme", "b": [0.416, 0.5968, 0.4807, 0.6116]}, {"w": "generalization", "b": [0.4855, 0.5968, 0.6, 0.6116]}]}]}, {"page": 429, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In short, despite our progress on machine perception, we’re still far from human-level AI. Our models can only perform local generalization, adapting to new situations that must be similar to past data, whereas human cognition is capable of extreme generalization, quickly adapting to radically novel situations and planning for long-term future situations.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "short,", "b": [0.1567, 0.0857, 0.2135, 0.1054]}, {"w": "despite", "b": [0.2198, 0.0857, 0.2913, 0.1054]}, {"w": "our", "b": [0.2976, 0.0857, 0.3312, 0.1054]}, {"w": "progress", "b": [0.3375, 0.0857, 0.423, 0.1054]}, {"w": "on", "b": [0.4293, 0.0857, 0.4545, 0.1054]}, {"w": "machine", "b": [0.4608, 0.0857, 0.5463, 0.1054]}, {"w": "perception,", "b": [0.5526, 0.0857, 0.6654, 0.1054]}, {"w": "we’re", "b": [0.6717, 0.0857, 0.7291, 0.1054]}, {"w": "still", "b": [0.7354, 0.0857, 0.7732, 0.1054]}, {"w": "far", "b": [0.7796, 0.0857, 0.8076, 0.1054]}, {"w": "from", "b": [0.8139, 0.0857, 0.8629, 0.1054]}, {"w": "human-level", "b": [0.1294, 0.1062, 0.2555, 0.1259]}, {"w": "AI.", "b": [0.2618, 0.1062, 0.2947, 0.1259]}, {"w": "Our", "b": [0.301, 0.1062, 0.3403, 0.1259]}, {"w": "models", "b": [0.3466, 0.1062, 0.4195, 0.1259]}, {"w": "can", "b": [0.4258, 0.1062, 0.4608, 0.1259]}, {"w": "only", "b": [0.4671, 0.1062, 0.5119, 0.1259]}, {"w": "perform", "b": [0.5182, 0.1062, 0.5995, 0.1259]}, {"w": "local", "b": [0.6058, 0.1062, 0.6548, 0.1259]}, {"w": "generalization,", "b": [0.6611, 0.1062, 0.8103, 0.1259]}, {"w": "adapting", "b": [0.1294, 0.1267, 0.2163, 0.1464]}, {"w": "to", "b": [0.2226, 0.1267, 0.2422, 0.1464]}, {"w": "new", "b": [0.2485, 0.1267, 0.2906, 0.1464]}, {"w": "situations", "b": [0.2969, 0.1267, 0.3936, 0.1464]}, {"w": "that", "b": [0.3999, 0.1267, 0.4377, 0.1464]}, {"w": "must", "b": [0.444, 0.1267, 0.4931, 0.1464]}, {"w": "be", "b": [0.4994, 0.1267, 0.5232, 0.1464]}, {"w": "similar", "b": [0.5295, 0.1267, 0.5996, 0.1464]}, {"w": "to", "b": [0.6059, 0.1267, 0.6255, 0.1464]}, {"w": "past", "b": [0.6318, 0.1267, 0.6725, 0.1464]}, {"w": "data,", "b": [0.6788, 0.1267, 0.7271, 0.1464]}, {"w": "whereas", "b": [0.7334, 0.1267, 0.8161, 0.1464]}, {"w": "human", "b": [0.1294, 0.1472, 0.1981, 0.1669]}, {"w": "cognition", "b": [0.2044, 0.1472, 0.2997, 0.1669]}, {"w": "is", "b": [0.306, 0.1472, 0.3228, 0.1669]}, {"w": "capable", "b": [0.3291, 0.1472, 0.4062, 0.1669]}, {"w": "of", "b": [0.4125, 0.1472, 0.4335, 0.1669]}, {"w": "extreme", "b": [0.4398, 0.1472, 0.521, 0.1669]}, {"w": "generalization,", "b": [0.5273, 0.1472, 0.6765, 0.1669]}, {"w": "quickly", "b": [0.6828, 0.1472, 0.7585, 0.1669]}, {"w": "adapting", "b": [0.7648, 0.1472, 0.8516, 0.1669]}, {"w": "to", "b": [0.1294, 0.1677, 0.149, 0.1874]}, {"w": "radically", "b": [0.1553, 0.1677, 0.2436, 0.1874]}, {"w": "novel", "b": [0.2499, 0.1677, 0.306, 0.1874]}, {"w": "situations", "b": [0.3123, 0.1677, 0.409, 0.1874]}, {"w": "and", "b": [0.4153, 0.1677, 0.4517, 0.1874]}, {"w": "planning", "b": [0.458, 0.1677, 0.5463, 0.1874]}, {"w": "for", "b": [0.5526, 0.1677, 0.582, 0.1874]}, {"w": "long-term", "b": [0.5883, 0.1677, 0.6878, 0.1874]}, {"w": "future", "b": [0.6941, 0.1677, 0.7544, 0.1874]}, {"w": "situations.", "b": [0.7607, 0.1677, 0.8637, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "9.2.3. Wrapping up", "words": [{"w": "9.2.3.", "b": [0.1294, 0.2149, 0.1862, 0.2347]}, {"w": "Wrapping", "b": [0.1925, 0.2149, 0.3028, 0.2347]}, {"w": "up", "b": [0.3091, 0.2149, 0.3371, 0.2347]}]}, {"id": "b_2", "type": "paragraph", "text": "Here’s what you should remember: the only real success of deep learning so far has been the ability to map space X to space Y using a continuous geometric transform, given large amounts of human-annotated data. Doing this well is a game-changer for essentially every industry, but it’s still a long way from human-level AI.", "words": [{"w": "Here’s", "b": [0.1294, 0.2577, 0.1952, 0.2774]}, {"w": "what", "b": [0.2016, 0.2577, 0.2506, 0.2774]}, {"w": "you", "b": [0.2569, 0.2577, 0.2947, 0.2774]}, {"w": "should", "b": [0.301, 0.2577, 0.3683, 0.2774]}, {"w": "remember:", "b": [0.3746, 0.2577, 0.4839, 0.2774]}, {"w": "the", "b": [0.4902, 0.2577, 0.521, 0.2774]}, {"w": "only", "b": [0.5273, 0.2577, 0.5722, 0.2774]}, {"w": "real", "b": [0.5785, 0.2577, 0.6163, 0.2774]}, {"w": "success", "b": [0.6226, 0.2577, 0.6983, 0.2774]}, {"w": "of", "b": [0.7046, 0.2577, 0.7256, 0.2774]}, {"w": "deep", "b": [0.7319, 0.2577, 0.7795, 0.2774]}, {"w": "learning", "b": [0.7858, 0.2577, 0.8685, 0.2774]}, {"w": "so", "b": [0.1294, 0.2782, 0.1518, 0.2979]}, {"w": "far", "b": [0.1581, 0.2782, 0.1861, 0.2979]}, {"w": "has", "b": [0.1925, 0.2782, 0.2261, 0.2979]}, {"w": "been", "b": [0.2324, 0.2782, 0.28, 0.2979]}, {"w": "the", "b": [0.2863, 0.2782, 0.3171, 0.2979]}, {"w": "ability", "b": [0.3234, 0.2782, 0.3879, 0.2979]}, {"w": "to", "b": [0.3942, 0.2782, 0.4139, 0.2979]}, {"w": "map", "b": [0.4202, 0.2782, 0.4636, 0.2979]}, {"w": "space", "b": [0.4699, 0.2782, 0.5259, 0.2979]}, {"w": "X", "b": [0.5322, 0.2782, 0.5505, 0.2979]}, {"w": "to", "b": [0.5568, 0.2782, 0.5764, 0.2979]}, {"w": "space", "b": [0.5827, 0.2782, 0.6387, 0.2979]}, {"w": "Y", "b": [0.645, 0.2782, 0.6632, 0.2979]}, {"w": "using", "b": [0.6695, 0.2782, 0.7241, 0.2979]}, {"w": "a", "b": [0.7305, 0.2782, 0.7417, 0.2979]}, {"w": "continuous", "b": [0.748, 0.2782, 0.8587, 0.2979]}, {"w": "geometric", "b": [0.1294, 0.2987, 0.2303, 0.3184]}, {"w": "transform,", "b": [0.2366, 0.2987, 0.341, 0.3184]}, {"w": "given", "b": [0.3473, 0.2987, 0.4033, 0.3184]}, {"w": "large", "b": [0.4096, 0.2987, 0.4596, 0.3184]}, {"w": "amounts", "b": [0.4659, 0.2987, 0.5514, 0.3184]}, {"w": "of", "b": [0.5577, 0.2987, 0.5787, 0.3184]}, {"w": "human-annotated", "b": [0.585, 0.2987, 0.7601, 0.3184]}, {"w": "data.", "b": [0.7664, 0.2987, 0.8148, 0.3184]}, {"w": "Doing", "b": [0.1294, 0.3192, 0.1925, 0.3389]}, {"w": "this", "b": [0.1988, 0.3192, 0.2352, 0.3389]}, {"w": "well", "b": [0.2415, 0.3192, 0.285, 0.3389]}, {"w": "is", "b": [0.2913, 0.3192, 0.3081, 0.3389]}, {"w": "a", "b": [0.3144, 0.3192, 0.3256, 0.3389]}, {"w": "game-changer", "b": [0.3319, 0.3192, 0.4748, 0.3389]}, {"w": "for", "b": [0.4811, 0.3192, 0.5105, 0.3389]}, {"w": "essentially", "b": [0.5168, 0.3192, 0.6233, 0.3389]}, {"w": "every", "b": [0.6296, 0.3192, 0.6856, 0.3389]}, {"w": "industry,", "b": [0.6919, 0.3192, 0.7793, 0.3389]}, {"w": "but", "b": [0.7856, 0.3192, 0.8178, 0.3389]}, {"w": "it’s", "b": [0.8241, 0.3192, 0.8549, 0.3389]}, {"w": "still", "b": [0.1294, 0.3397, 0.1673, 0.3594]}, {"w": "a", "b": [0.1736, 0.3397, 0.1848, 0.3594]}, {"w": "long", "b": [0.1911, 0.3397, 0.2359, 0.3594]}, {"w": "way", "b": [0.2422, 0.3397, 0.2843, 0.3594]}, {"w": "from", "b": [0.2906, 0.3397, 0.3396, 0.3594]}, {"w": "human-level", "b": [0.3459, 0.3397, 0.472, 0.3594]}, {"w": "AI.", "b": [0.4783, 0.3397, 0.5113, 0.3594]}]}, {"id": "b_3", "type": "paragraph", "text": "To lift some of the limitations we have discussed and create AI that can compete with human brains, we need to move away from straightforward input-to-output mappings and on to reasoning and abstraction. A likely appropriate substrate for abstract modeling of various situations and concepts is that of computer programs. We said previously that machine- learning models can be defined as learnable programs; currently we can only learn programs that belong to a narrow and specific subset of all possible programs. But what if we could learn any program, in a modular and reusable way? Let’s see in the next section what the road ahead may look like.", "words": [{"w": "To", "b": [0.1294, 0.3825, 0.1557, 0.4022]}, {"w": "lift", "b": [0.162, 0.3825, 0.1914, 0.4022]}, {"w": "some", "b": [0.1977, 0.3825, 0.251, 0.4022]}, {"w": "of", "b": [0.2573, 0.3825, 0.2783, 0.4022]}, {"w": "the", "b": [0.2846, 0.3825, 0.3154, 0.4022]}, {"w": "limitations", "b": [0.3217, 0.3825, 0.4297, 0.4022]}, {"w": "we", "b": [0.436, 0.3825, 0.4654, 0.4022]}, {"w": "have", "b": [0.4717, 0.3825, 0.5193, 0.4022]}, {"w": "discussed", "b": [0.5256, 0.3825, 0.6223, 0.4022]}, {"w": "and", "b": [0.6286, 0.3825, 0.6651, 0.4022]}, {"w": "create", "b": [0.6714, 0.3825, 0.7316, 0.4022]}, {"w": "AI", "b": [0.7379, 0.3825, 0.7645, 0.4022]}, {"w": "that", "b": [0.7708, 0.3825, 0.8086, 0.4022]}, {"w": "can", "b": [0.8149, 0.3825, 0.85, 0.4022]}, {"w": "compete", "b": [0.1294, 0.403, 0.2149, 0.4227]}, {"w": "with", "b": [0.2212, 0.403, 0.266, 0.4227]}, {"w": "human", "b": [0.2723, 0.403, 0.341, 0.4227]}, {"w": "brains,", "b": [0.3473, 0.403, 0.4153, 0.4227]}, {"w": "we", "b": [0.4216, 0.403, 0.451, 0.4227]}, {"w": "need", "b": [0.4573, 0.403, 0.5049, 0.4227]}, {"w": "to", "b": [0.5112, 0.403, 0.5309, 0.4227]}, {"w": "move", "b": [0.5372, 0.403, 0.5932, 0.4227]}, {"w": "away", "b": [0.5995, 0.403, 0.6527, 0.4227]}, {"w": "from", "b": [0.6591, 0.403, 0.7081, 0.4227]}, {"w": "straightforward", "b": [0.7143, 0.403, 0.8699, 0.4227]}, {"w": "input-to-output", "b": [0.1294, 0.4235, 0.2822, 0.4432]}, {"w": "mappings", "b": [0.2885, 0.4235, 0.3866, 0.4432]}, {"w": "and", "b": [0.3929, 0.4235, 0.4293, 0.4432]}, {"w": "on", "b": [0.4356, 0.4235, 0.4609, 0.4432]}, {"w": "to", "b": [0.4672, 0.4235, 0.4868, 0.4432]}, {"w": "reasoning", "b": [0.493, 0.4235, 0.593, 0.4432]}, {"w": "and", "b": [0.5993, 0.4235, 0.6357, 0.4432]}, {"w": "abstraction.", "b": [0.642, 0.4235, 0.7632, 0.4432]}, {"w": "A", "b": [0.7696, 0.4235, 0.7878, 0.4432]}, {"w": "likely", "b": [0.7941, 0.4235, 0.8515, 0.4432]}, {"w": "appropriate", "b": [0.1294, 0.444, 0.2443, 0.4637]}, {"w": "substrate", "b": [0.2506, 0.444, 0.3403, 0.4637]}, {"w": "for", "b": [0.3466, 0.444, 0.376, 0.4637]}, {"w": "abstract", "b": [0.3823, 0.444, 0.4608, 0.4637]}, {"w": "modeling", "b": [0.4671, 0.444, 0.5624, 0.4637]}, {"w": "of", "b": [0.5687, 0.444, 0.5897, 0.4637]}, {"w": "various", "b": [0.596, 0.444, 0.6703, 0.4637]}, {"w": "situations", "b": [0.6766, 0.444, 0.7733, 0.4637]}, {"w": "and", "b": [0.7796, 0.444, 0.816, 0.4637]}, {"w": "concepts", "b": [0.1294, 0.4645, 0.2177, 0.4842]}, {"w": "is", "b": [0.224, 0.4645, 0.2408, 0.4842]}, {"w": "that", "b": [0.2471, 0.4645, 0.285, 0.4842]}, {"w": "of", "b": [0.2913, 0.4645, 0.3123, 0.4842]}, {"w": "computer", "b": [0.3186, 0.4645, 0.4139, 0.4842]}, {"w": "programs.", "b": [0.4202, 0.4645, 0.5217, 0.4842]}, {"w": "We", "b": [0.5281, 0.4645, 0.561, 0.4842]}, {"w": "said", "b": [0.5673, 0.4645, 0.6079, 0.4842]}, {"w": "previously", "b": [0.6142, 0.4645, 0.7207, 0.4842]}, {"w": "that", "b": [0.7271, 0.4645, 0.7649, 0.4842]}, {"w": "machine-", "b": [0.7712, 0.4645, 0.8651, 0.4842]}, {"w": "learning", "b": [0.1294, 0.485, 0.2121, 0.5047]}, {"w": "models", "b": [0.2184, 0.485, 0.2913, 0.5047]}, {"w": "can", "b": [0.2976, 0.485, 0.3326, 0.5047]}, {"w": "be", "b": [0.3389, 0.485, 0.3627, 0.5047]}, {"w": "defined", "b": [0.369, 0.485, 0.4447, 0.5047]}, {"w": "as", "b": [0.451, 0.485, 0.472, 0.5047]}, {"w": "learnable", "b": [0.4782, 0.485, 0.5749, 0.5047]}, {"w": "programs;", "b": [0.5812, 0.485, 0.6854, 0.5047]}, {"w": "currently", "b": [0.6917, 0.485, 0.7828, 0.5047]}, {"w": "we", "b": [0.7891, 0.485, 0.8185, 0.5047]}, {"w": "can", "b": [0.8248, 0.485, 0.8598, 0.5047]}, {"w": "only", "b": [0.1294, 0.5055, 0.1743, 0.5252]}, {"w": "learn", "b": [0.1806, 0.5055, 0.231, 0.5252]}, {"w": "programs", "b": [0.2373, 0.5055, 0.3326, 0.5252]}, {"w": "that", "b": [0.3389, 0.5055, 0.3767, 0.5252]}, {"w": "belong", "b": [0.383, 0.5055, 0.4517, 0.5252]}, {"w": "to", "b": [0.458, 0.5055, 0.4776, 0.5252]}, {"w": "a", "b": [0.4839, 0.5055, 0.4951, 0.5252]}, {"w": "narrow", "b": [0.5014, 0.5055, 0.5729, 0.5252]}, {"w": "and", "b": [0.5792, 0.5055, 0.6156, 0.5252]}, {"w": "specific", "b": [0.6219, 0.5055, 0.7004, 0.5252]}, {"w": "subset", "b": [0.7067, 0.5055, 0.7697, 0.5252]}, {"w": "of", "b": [0.776, 0.5055, 0.7971, 0.5252]}, {"w": "all", "b": [0.8034, 0.5055, 0.8286, 0.5252]}, {"w": "possible", "b": [0.1294, 0.526, 0.2121, 0.5457]}, {"w": "programs.", "b": [0.2184, 0.526, 0.32, 0.5457]}, {"w": "But", "b": [0.3263, 0.526, 0.3628, 0.5457]}, {"w": "what", "b": [0.3691, 0.526, 0.4181, 0.5457]}, {"w": "if", "b": [0.4244, 0.526, 0.4398, 0.5457]}, {"w": "we", "b": [0.4461, 0.526, 0.4755, 0.5457]}, {"w": "could", "b": [0.4818, 0.526, 0.5379, 0.5457]}, {"w": "learn", "b": [0.5442, 0.526, 0.5946, 0.5457]}, {"w": "any", "b": [0.6009, 0.526, 0.6373, 0.5457]}, {"w": "program,", "b": [0.6436, 0.526, 0.7354, 0.5457]}, {"w": "in", "b": [0.7417, 0.526, 0.7613, 0.5457]}, {"w": "a", "b": [0.7676, 0.526, 0.7788, 0.5457]}, {"w": "modular", "b": [0.7851, 0.526, 0.8692, 0.5457]}, {"w": "and", "b": [0.1294, 0.5465, 0.1658, 0.5662]}, {"w": "reusable", "b": [0.1721, 0.5465, 0.2562, 0.5662]}, {"w": "way?", "b": [0.2625, 0.5465, 0.3157, 0.5662]}, {"w": "Let’s", "b": [0.322, 0.5465, 0.3725, 0.5662]}, {"w": "see", "b": [0.3788, 0.5465, 0.411, 0.5662]}, {"w": "in", "b": [0.4173, 0.5465, 0.4369, 0.5662]}, {"w": "the", "b": [0.4432, 0.5465, 0.474, 0.5662]}, {"w": "next", "b": [0.4803, 0.5465, 0.5238, 0.5662]}, {"w": "section", "b": [0.5301, 0.5465, 0.6016, 0.5662]}, {"w": "what", "b": [0.6079, 0.5465, 0.6569, 0.5662]}, {"w": "the", "b": [0.6632, 0.5465, 0.694, 0.5662]}, {"w": "road", "b": [0.7003, 0.5465, 0.7452, 0.5662]}, {"w": "ahead", "b": [0.7515, 0.5465, 0.8103, 0.5662]}, {"w": "may", "b": [0.8166, 0.5465, 0.86, 0.5662]}, {"w": "look", "b": [0.1294, 0.567, 0.1743, 0.5867]}, {"w": "like.", "b": [0.1806, 0.567, 0.2247, 0.5867]}]}, {"id": "b_4", "type": "paragraph", "text": "9.3. The future of deep learning", "words": [{"w": "9.3.", "b": [0.1294, 0.6238, 0.172, 0.646]}, {"w": "The", "b": [0.1791, 0.6238, 0.2264, 0.646]}, {"w": "future", "b": [0.2335, 0.6238, 0.3086, 0.646]}, {"w": "of", "b": [0.3157, 0.6238, 0.3394, 0.646]}, {"w": "deep", "b": [0.3465, 0.6238, 0.4032, 0.646]}, {"w": "learning", "b": [0.4103, 0.6238, 0.5112, 0.646]}]}, {"id": "b_5", "type": "paragraph", "text": "This is a more speculative section aimed at opening horizons for people who want to join a research program or begin doing independent research. Given what we know of how deep nets work, their limitations, and the current state of the research landscape, can we predict where things are headed in the medium term? Following are some purely personal thoughts. Note that I don’t have a crystal ball, so a lot of what I anticipate may fail to become reality. I’m sharing these predictions not because I expect them to be proven completely right in the future, but because they’re interesting and actionable in the present.", "words": [{"w": "This", "b": [0.1294, 0.6695, 0.1743, 0.6892]}, {"w": "is", "b": [0.1806, 0.6695, 0.1974, 0.6892]}, {"w": "a", "b": [0.2037, 0.6695, 0.2149, 0.6892]}, {"w": "more", "b": [0.2212, 0.6695, 0.273, 0.6892]}, {"w": "speculative", "b": [0.2794, 0.6695, 0.3928, 0.6892]}, {"w": "section", "b": [0.3992, 0.6695, 0.4706, 0.6892]}, {"w": "aimed", "b": [0.4769, 0.6695, 0.5386, 0.6892]}, {"w": "at", "b": [0.5449, 0.6695, 0.5631, 0.6892]}, {"w": "opening", "b": [0.5694, 0.6695, 0.6507, 0.6892]}, {"w": "horizons", "b": [0.657, 0.6695, 0.7439, 0.6892]}, {"w": "for", "b": [0.7502, 0.6695, 0.7796, 0.6892]}, {"w": "people", "b": [0.7859, 0.6695, 0.8531, 0.6892]}, {"w": "who", "b": [0.1294, 0.69, 0.1729, 0.7097]}, {"w": "want", "b": [0.1792, 0.69, 0.2282, 0.7097]}, {"w": "to", "b": [0.2345, 0.69, 0.2541, 0.7097]}, {"w": "join", "b": [0.2604, 0.69, 0.2997, 0.7097]}, {"w": "a", "b": [0.306, 0.69, 0.3172, 0.7097]}, {"w": "research", "b": [0.3235, 0.69, 0.4075, 0.7097]}, {"w": "program", "b": [0.4138, 0.69, 0.4993, 0.7097]}, {"w": "or", "b": [0.5056, 0.69, 0.5266, 0.7097]}, {"w": "begin", "b": [0.5329, 0.69, 0.589, 0.7097]}, {"w": "doing", "b": [0.5953, 0.69, 0.6527, 0.7097]}, {"w": "independent", "b": [0.659, 0.69, 0.7823, 0.7097]}, {"w": "research.", "b": [0.1294, 0.7105, 0.2197, 0.7302]}, {"w": "Given", "b": [0.2261, 0.7105, 0.2877, 0.7302]}, {"w": "what", "b": [0.294, 0.7105, 0.343, 0.7302]}, {"w": "we", "b": [0.3494, 0.7105, 0.3788, 0.7302]}, {"w": "know", "b": [0.3851, 0.7105, 0.4411, 0.7302]}, {"w": "of", "b": [0.4474, 0.7105, 0.4684, 0.7302]}, {"w": "how", "b": [0.4748, 0.7105, 0.5182, 0.7302]}, {"w": "deep", "b": [0.5245, 0.7105, 0.5721, 0.7302]}, {"w": "nets", "b": [0.5784, 0.7105, 0.6191, 0.7302]}, {"w": "work,", "b": [0.6254, 0.7105, 0.6835, 0.7302]}, {"w": "their", "b": [0.6898, 0.7105, 0.7361, 0.7302]}, {"w": "limitations,", "b": [0.7424, 0.7105, 0.8566, 0.7302]}, {"w": "and", "b": [0.1294, 0.731, 0.1658, 0.7507]}, {"w": "the", "b": [0.1721, 0.731, 0.203, 0.7507]}, {"w": "current", "b": [0.2093, 0.731, 0.2807, 0.7507]}, {"w": "state", "b": [0.287, 0.731, 0.3333, 0.7507]}, {"w": "of", "b": [0.3396, 0.731, 0.3606, 0.7507]}, {"w": "the", "b": [0.3669, 0.731, 0.3977, 0.7507]}, {"w": "research", "b": [0.404, 0.731, 0.488, 0.7507]}, {"w": "landscape,", "b": [0.4944, 0.731, 0.6001, 0.7507]}, {"w": "can", "b": [0.6064, 0.731, 0.6414, 0.7507]}, {"w": "we", "b": [0.6477, 0.731, 0.6771, 0.7507]}, {"w": "predict", "b": [0.6834, 0.731, 0.7534, 0.7507]}, {"w": "where", "b": [0.7598, 0.731, 0.8214, 0.7507]}, {"w": "things", "b": [0.1294, 0.7515, 0.1911, 0.7712]}, {"w": "are", "b": [0.1974, 0.7515, 0.2282, 0.7712]}, {"w": "headed", "b": [0.2345, 0.7515, 0.3059, 0.7712]}, {"w": "in", "b": [0.3122, 0.7515, 0.3319, 0.7712]}, {"w": "the", "b": [0.3382, 0.7515, 0.369, 0.7712]}, {"w": "medium", "b": [0.3753, 0.7515, 0.458, 0.7712]}, {"w": "term?", "b": [0.4643, 0.7515, 0.5217, 0.7712]}, {"w": "Following", "b": [0.5281, 0.7515, 0.6318, 0.7712]}, {"w": "are", "b": [0.6381, 0.7515, 0.6689, 0.7712]}, {"w": "some", "b": [0.6752, 0.7515, 0.7284, 0.7712]}, {"w": "purely", "b": [0.7348, 0.7515, 0.7992, 0.7712]}, {"w": "personal", "b": [0.1294, 0.772, 0.2149, 0.7917]}, {"w": "thoughts.", "b": [0.2212, 0.772, 0.3144, 0.7917]}, {"w": "Note", "b": [0.3207, 0.772, 0.3697, 0.7917]}, {"w": "that", "b": [0.376, 0.772, 0.4139, 0.7917]}, {"w": "I", "b": [0.4202, 0.772, 0.4286, 0.7917]}, {"w": "don’t", "b": [0.4349, 0.772, 0.4877, 0.7917]}, {"w": "have", "b": [0.494, 0.772, 0.5416, 0.7917]}, {"w": "a", "b": [0.5479, 0.772, 0.5591, 0.7917]}, {"w": "crystal", "b": [0.5654, 0.772, 0.6327, 0.7917]}, {"w": "ball,", "b": [0.639, 0.772, 0.6831, 0.7917]}, {"w": "so", "b": [0.6894, 0.772, 0.7118, 0.7917]}, {"w": "a", "b": [0.7181, 0.772, 0.7293, 0.7917]}, {"w": "lot", "b": [0.7357, 0.772, 0.7623, 0.7917]}, {"w": "of", "b": [0.7686, 0.772, 0.7896, 0.7917]}, {"w": "what", "b": [0.7959, 0.772, 0.845, 0.7917]}, {"w": "I", "b": [0.8513, 0.772, 0.8597, 0.7917]}, {"w": "anticipate", "b": [0.1294, 0.7925, 0.2275, 0.8122]}, {"w": "may", "b": [0.2338, 0.7925, 0.2772, 0.8122]}, {"w": "fail", "b": [0.2835, 0.7925, 0.3172, 0.8122]}, {"w": "to", "b": [0.3235, 0.7925, 0.3431, 0.8122]}, {"w": "become", "b": [0.3494, 0.7925, 0.4279, 0.8122]}, {"w": "reality.", "b": [0.4342, 0.7925, 0.5032, 0.8122]}, {"w": "I’m", "b": [0.5095, 0.7925, 0.5459, 0.8122]}, {"w": "sharing", "b": [0.5522, 0.7925, 0.6265, 0.8122]}, {"w": "these", "b": [0.6328, 0.7925, 0.6846, 0.8122]}, {"w": "predictions", "b": [0.6909, 0.7925, 0.8031, 0.8122]}, {"w": "not", "b": [0.8094, 0.7925, 0.8416, 0.8122]}, {"w": "because", "b": [0.1294, 0.813, 0.2093, 0.8327]}, {"w": "I", "b": [0.2156, 0.813, 0.224, 0.8327]}, {"w": "expect", "b": [0.2302, 0.813, 0.2961, 0.8327]}, {"w": "them", "b": [0.3024, 0.813, 0.3528, 0.8327]}, {"w": "to", "b": [0.3591, 0.813, 0.3788, 0.8327]}, {"w": "be", "b": [0.3851, 0.813, 0.4089, 0.8327]}, {"w": "proven", "b": [0.4152, 0.813, 0.4852, 0.8327]}, {"w": "completely", "b": [0.4915, 0.813, 0.6037, 0.8327]}, {"w": "right", "b": [0.61, 0.813, 0.6576, 0.8327]}, {"w": "in", "b": [0.6639, 0.813, 0.6835, 0.8327]}, {"w": "the", "b": [0.6898, 0.813, 0.7207, 0.8327]}, {"w": "future,", "b": [0.727, 0.813, 0.7935, 0.8327]}, {"w": "but", "b": [0.7998, 0.813, 0.8321, 0.8327]}, {"w": "because", "b": [0.1294, 0.8335, 0.2093, 0.8532]}, {"w": "they’re", "b": [0.2156, 0.8335, 0.287, 0.8532]}, {"w": "interesting", "b": [0.2933, 0.8335, 0.3998, 0.8532]}, {"w": "and", "b": [0.4061, 0.8335, 0.4425, 0.8532]}, {"w": "actionable", "b": [0.4488, 0.8335, 0.5525, 0.8532]}, {"w": "in", "b": [0.5588, 0.8335, 0.5785, 0.8532]}, {"w": "the", "b": [0.5848, 0.8335, 0.6156, 0.8532]}, {"w": "present.", "b": [0.6219, 0.8335, 0.7011, 0.8532]}]}, {"id": "b_6", "type": "paragraph", "text": "At a high level, these are the main directions in which I see promise:", "words": [{"w": "At", "b": [0.1294, 0.8763, 0.1546, 0.896]}, {"w": "a", "b": [0.1609, 0.8763, 0.1721, 0.896]}, {"w": "high", "b": [0.1785, 0.8763, 0.2233, 0.896]}, {"w": "level,", "b": [0.2296, 0.8763, 0.285, 0.896]}, {"w": "these", "b": [0.2913, 0.8763, 0.3431, 0.896]}, {"w": "are", "b": [0.3494, 0.8763, 0.3802, 0.896]}, {"w": "the", "b": [0.3865, 0.8763, 0.4173, 0.896]}, {"w": "main", "b": [0.4236, 0.8763, 0.4741, 0.896]}, {"w": "directions", "b": [0.4804, 0.8763, 0.5799, 0.896]}, {"w": "in", "b": [0.5862, 0.8763, 0.6058, 0.896]}, {"w": "which", "b": [0.6121, 0.8763, 0.6738, 0.896]}, {"w": "I", "b": [0.6801, 0.8763, 0.6885, 0.896]}, {"w": "see", "b": [0.6948, 0.8763, 0.727, 0.896]}, {"w": "promise:", "b": [0.7333, 0.8763, 0.8216, 0.896]}]}]}, {"page": 430, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Models closer to general-purpose computer programs, built on top of far richer primitives than the current differentiable layers. This is how we’ll get to reasoning and abstraction, the lack of which is the fundamental weakness of current models. New forms of learning that make the previous point possible, allowing models to move away from differentiable transforms. Models that require less involvement from human engineers. It shouldn’t be your job to tune knobs endlessly. Greater, systematic reuse of previously learned features and architectures, such as meta-learning systems using reusable and modular program subroutines.", "words": [{"w": "Models", "b": [0.1799, 0.0857, 0.2541, 0.1054]}, {"w": "closer", "b": [0.2604, 0.0857, 0.3221, 0.1054]}, {"w": "to", "b": [0.3284, 0.0857, 0.348, 0.1054]}, {"w": "general-purpose", "b": [0.3543, 0.0857, 0.5211, 0.1054]}, {"w": "computer", "b": [0.5274, 0.0857, 0.6227, 0.1054]}, {"w": "programs,", "b": [0.629, 0.0857, 0.7324, 0.1054]}, {"w": "built", "b": [0.7387, 0.0857, 0.785, 0.1054]}, {"w": "on", "b": [0.7913, 0.0857, 0.8165, 0.1054]}, {"w": "top", "b": [0.8228, 0.0857, 0.8551, 0.1054]}, {"w": "of", "b": [0.1799, 0.1062, 0.2009, 0.1259]}, {"w": "far", "b": [0.2072, 0.1062, 0.2352, 0.1259]}, {"w": "richer", "b": [0.2415, 0.1062, 0.3003, 0.1259]}, {"w": "primitives", "b": [0.3066, 0.1062, 0.4089, 0.1259]}, {"w": "than", "b": [0.4152, 0.1062, 0.4587, 0.1259]}, {"w": "the", "b": [0.465, 0.1062, 0.4958, 0.1259]}, {"w": "current", "b": [0.5021, 0.1062, 0.5736, 0.1259]}, {"w": "differentiable", "b": [0.5799, 0.1062, 0.7152, 0.1259]}, {"w": "layers.", "b": [0.7215, 0.1062, 0.7881, 0.1259]}, {"w": "This", "b": [0.7944, 0.1062, 0.8392, 0.1259]}, {"w": "is", "b": [0.8456, 0.1062, 0.8624, 0.1259]}, {"w": "how", "b": [0.1799, 0.1267, 0.2233, 0.1464]}, {"w": "we’ll", "b": [0.2296, 0.1267, 0.2814, 0.1464]}, {"w": "get", "b": [0.2878, 0.1267, 0.3186, 0.1464]}, {"w": "to", "b": [0.3249, 0.1267, 0.3445, 0.1464]}, {"w": "reasoning", "b": [0.3508, 0.1267, 0.4508, 0.1464]}, {"w": "and", "b": [0.4571, 0.1267, 0.4935, 0.1464]}, {"w": "abstraction,", "b": [0.4998, 0.1267, 0.621, 0.1464]}, {"w": "the", "b": [0.6273, 0.1267, 0.6581, 0.1464]}, {"w": "lack", "b": [0.6644, 0.1267, 0.7065, 0.1464]}, {"w": "of", "b": [0.7128, 0.1267, 0.7338, 0.1464]}, {"w": "which", "b": [0.7401, 0.1267, 0.8017, 0.1464]}, {"w": "is", "b": [0.808, 0.1267, 0.8249, 0.1464]}, {"w": "the", "b": [0.8312, 0.1267, 0.862, 0.1464]}, {"w": "fundamental", "b": [0.1799, 0.1472, 0.306, 0.1669]}, {"w": "weakness", "b": [0.3123, 0.1472, 0.4089, 0.1669]}, {"w": "of", "b": [0.4152, 0.1472, 0.4363, 0.1669]}, {"w": "current", "b": [0.4426, 0.1472, 0.514, 0.1669]}, {"w": "models.", "b": [0.5203, 0.1472, 0.5995, 0.1669]}, {"w": "New", "b": [0.1799, 0.1677, 0.2247, 0.1874]}, {"w": "forms", "b": [0.231, 0.1677, 0.2885, 0.1874]}, {"w": "of", "b": [0.2948, 0.1677, 0.3144, 0.1874]}, {"w": "learning", "b": [0.3207, 0.1677, 0.4062, 0.1874]}, {"w": "that", "b": [0.4125, 0.1677, 0.4518, 0.1874]}, {"w": "make", "b": [0.4581, 0.1677, 0.5113, 0.1874]}, {"w": "the", "b": [0.5176, 0.1677, 0.5484, 0.1874]}, {"w": "previous", "b": [0.5547, 0.1677, 0.6407, 0.1874]}, {"w": "point", "b": [0.647, 0.1677, 0.6988, 0.1874]}, {"w": "possible,", "b": [0.7051, 0.1677, 0.7941, 0.1874]}, {"w": "allowing", "b": [0.1799, 0.1882, 0.2682, 0.2079]}, {"w": "models", "b": [0.2745, 0.1882, 0.3473, 0.2079]}, {"w": "to", "b": [0.3536, 0.1882, 0.3733, 0.2079]}, {"w": "move", "b": [0.3796, 0.1882, 0.4356, 0.2079]}, {"w": "away", "b": [0.4419, 0.1882, 0.4952, 0.2079]}, {"w": "from", "b": [0.5015, 0.1882, 0.5505, 0.2079]}, {"w": "differentiable", "b": [0.5568, 0.1882, 0.6922, 0.2079]}, {"w": "transforms.", "b": [0.6985, 0.1882, 0.8127, 0.2079]}, {"w": "Models", "b": [0.1799, 0.2087, 0.2541, 0.2284]}, {"w": "that", "b": [0.2604, 0.2087, 0.2997, 0.2284]}, {"w": "require", "b": [0.306, 0.2087, 0.3784, 0.2284]}, {"w": "less", "b": [0.3847, 0.2087, 0.4225, 0.2284]}, {"w": "involvement", "b": [0.4288, 0.2087, 0.5507, 0.2284]}, {"w": "from", "b": [0.557, 0.2087, 0.6037, 0.2284]}, {"w": "human", "b": [0.61, 0.2087, 0.6787, 0.2284]}, {"w": "engineers.", "b": [0.685, 0.2087, 0.7894, 0.2284]}, {"w": "It", "b": [0.7957, 0.2087, 0.8111, 0.2284]}, {"w": "shouldn’t", "b": [0.1799, 0.2292, 0.2747, 0.2489]}, {"w": "be", "b": [0.281, 0.2292, 0.3048, 0.2489]}, {"w": "your", "b": [0.3111, 0.2292, 0.3574, 0.2489]}, {"w": "job", "b": [0.3637, 0.2292, 0.3959, 0.2489]}, {"w": "to", "b": [0.4022, 0.2292, 0.4219, 0.2489]}, {"w": "tune", "b": [0.4282, 0.2292, 0.4716, 0.2489]}, {"w": "knobs", "b": [0.4779, 0.2292, 0.5382, 0.2489]}, {"w": "endlessly.", "b": [0.5445, 0.2292, 0.643, 0.2489]}, {"w": "Greater,", "b": [0.1799, 0.2497, 0.2623, 0.2694]}, {"w": "systematic", "b": [0.2686, 0.2497, 0.3737, 0.2694]}, {"w": "reuse", "b": [0.38, 0.2497, 0.4337, 0.2694]}, {"w": "of", "b": [0.44, 0.2497, 0.4596, 0.2694]}, {"w": "previously", "b": [0.4659, 0.2497, 0.5701, 0.2694]}, {"w": "learned", "b": [0.5764, 0.2497, 0.6535, 0.2694]}, {"w": "features", "b": [0.6598, 0.2497, 0.7401, 0.2694]}, {"w": "and", "b": [0.7464, 0.2497, 0.7842, 0.2694]}, {"w": "architectures,", "b": [0.1799, 0.2702, 0.3174, 0.2899]}, {"w": "such", "b": [0.3237, 0.2702, 0.3699, 0.2899]}, {"w": "as", "b": [0.3762, 0.2702, 0.3972, 0.2899]}, {"w": "meta-learning", "b": [0.4036, 0.2702, 0.5437, 0.2899]}, {"w": "systems", "b": [0.55, 0.2702, 0.6299, 0.2899]}, {"w": "using", "b": [0.6362, 0.2702, 0.6908, 0.2899]}, {"w": "reusable", "b": [0.6971, 0.2702, 0.7812, 0.2899]}, {"w": "and", "b": [0.7875, 0.2702, 0.8239, 0.2899]}, {"w": "modular", "b": [0.1799, 0.2907, 0.2639, 0.3104]}, {"w": "program", "b": [0.2702, 0.2907, 0.3557, 0.3104]}, {"w": "subroutines.", "b": [0.362, 0.2907, 0.4846, 0.3104]}]}, {"id": "b_1", "type": "paragraph", "text": "Additionally, note that these considerations aren’t specific to the sort of supervised learning that has been the bread and butter of deep learning so far—rather, they’re applicable to any form of machine learning, including unsupervised, self-supervised, and reinforcement learning. It isn’t fundamentally important where your labels come from or what your training loop looks like; these different branches of machine learning are different facets of the same construct. Let’s dive in.", "words": [{"w": "Additionally,", "b": [0.1294, 0.3335, 0.2616, 0.3532]}, {"w": "note", "b": [0.2679, 0.3335, 0.3113, 0.3532]}, {"w": "that", "b": [0.3177, 0.3335, 0.3555, 0.3532]}, {"w": "these", "b": [0.3618, 0.3335, 0.4136, 0.3532]}, {"w": "considerations", "b": [0.4199, 0.3335, 0.5657, 0.3532]}, {"w": "aren’t", "b": [0.572, 0.3335, 0.6303, 0.3532]}, {"w": "specific", "b": [0.6366, 0.3335, 0.7151, 0.3532]}, {"w": "to", "b": [0.7214, 0.3335, 0.741, 0.3532]}, {"w": "the", "b": [0.7473, 0.3335, 0.7781, 0.3532]}, {"w": "sort", "b": [0.7844, 0.3335, 0.8223, 0.3532]}, {"w": "of", "b": [0.8286, 0.3335, 0.8496, 0.3532]}, {"w": "supervised", "b": [0.1294, 0.354, 0.2373, 0.3737]}, {"w": "learning", "b": [0.2436, 0.354, 0.3263, 0.3737]}, {"w": "that", "b": [0.3326, 0.354, 0.3704, 0.3737]}, {"w": "has", "b": [0.3767, 0.354, 0.4104, 0.3737]}, {"w": "been", "b": [0.4167, 0.354, 0.4643, 0.3737]}, {"w": "the", "b": [0.4706, 0.354, 0.5014, 0.3737]}, {"w": "bread", "b": [0.5077, 0.354, 0.5637, 0.3737]}, {"w": "and", "b": [0.5701, 0.354, 0.6065, 0.3737]}, {"w": "butter", "b": [0.6127, 0.354, 0.6716, 0.3737]}, {"w": "of", "b": [0.6779, 0.354, 0.6989, 0.3737]}, {"w": "deep", "b": [0.7052, 0.354, 0.7528, 0.3737]}, {"w": "learning", "b": [0.7591, 0.354, 0.8418, 0.3737]}, {"w": "so", "b": [0.8481, 0.354, 0.8705, 0.3737]}, {"w": "far—rather,", "b": [0.1294, 0.3745, 0.2467, 0.3942]}, {"w": "they’re", "b": [0.2531, 0.3745, 0.3245, 0.3942]}, {"w": "applicable", "b": [0.3308, 0.3745, 0.4345, 0.3942]}, {"w": "to", "b": [0.4408, 0.3745, 0.4604, 0.3942]}, {"w": "any", "b": [0.4667, 0.3745, 0.5031, 0.3942]}, {"w": "form", "b": [0.5094, 0.3745, 0.5585, 0.3942]}, {"w": "of", "b": [0.5648, 0.3745, 0.5858, 0.3942]}, {"w": "machine", "b": [0.5921, 0.3745, 0.6776, 0.3942]}, {"w": "learning,", "b": [0.6839, 0.3745, 0.7729, 0.3942]}, {"w": "including", "b": [0.1294, 0.395, 0.2247, 0.4147]}, {"w": "unsupervised,", "b": [0.231, 0.395, 0.3704, 0.4147]}, {"w": "self-supervised,", "b": [0.3768, 0.395, 0.5358, 0.4147]}, {"w": "and", "b": [0.5421, 0.395, 0.5785, 0.4147]}, {"w": "reinforcement", "b": [0.5848, 0.395, 0.7263, 0.4147]}, {"w": "learning.", "b": [0.7326, 0.395, 0.8216, 0.4147]}, {"w": "It", "b": [0.8279, 0.395, 0.8433, 0.4147]}, {"w": "isn’t", "b": [0.1294, 0.4155, 0.1738, 0.4352]}, {"w": "fundamentally", "b": [0.1801, 0.4155, 0.3258, 0.4352]}, {"w": "important", "b": [0.3321, 0.4155, 0.4303, 0.4352]}, {"w": "where", "b": [0.4366, 0.4155, 0.4982, 0.4352]}, {"w": "your", "b": [0.5045, 0.4155, 0.5507, 0.4352]}, {"w": "labels", "b": [0.557, 0.4155, 0.6159, 0.4352]}, {"w": "come", "b": [0.6222, 0.4155, 0.6768, 0.4352]}, {"w": "from", "b": [0.6831, 0.4155, 0.7322, 0.4352]}, {"w": "or", "b": [0.7385, 0.4155, 0.7595, 0.4352]}, {"w": "what", "b": [0.7658, 0.4155, 0.8148, 0.4352]}, {"w": "your", "b": [0.8212, 0.4155, 0.8674, 0.4352]}, {"w": "training", "b": [0.1294, 0.436, 0.2079, 0.4557]}, {"w": "loop", "b": [0.2142, 0.436, 0.259, 0.4557]}, {"w": "looks", "b": [0.2654, 0.436, 0.32, 0.4557]}, {"w": "like;", "b": [0.3263, 0.436, 0.3711, 0.4557]}, {"w": "these", "b": [0.3774, 0.436, 0.4293, 0.4557]}, {"w": "different", "b": [0.4356, 0.436, 0.522, 0.4557]}, {"w": "branches", "b": [0.5283, 0.436, 0.6179, 0.4557]}, {"w": "of", "b": [0.6242, 0.436, 0.6452, 0.4557]}, {"w": "machine", "b": [0.6515, 0.436, 0.737, 0.4557]}, {"w": "learning", "b": [0.7433, 0.436, 0.826, 0.4557]}, {"w": "are", "b": [0.8323, 0.436, 0.8631, 0.4557]}, {"w": "different", "b": [0.1294, 0.4565, 0.2158, 0.4762]}, {"w": "facets", "b": [0.2221, 0.4565, 0.2809, 0.4762]}, {"w": "of", "b": [0.2872, 0.4565, 0.3083, 0.4762]}, {"w": "the", "b": [0.3146, 0.4565, 0.3454, 0.4762]}, {"w": "same", "b": [0.3517, 0.4565, 0.4035, 0.4762]}, {"w": "construct.", "b": [0.4098, 0.4565, 0.5086, 0.4762]}, {"w": "Let’s", "b": [0.5149, 0.4565, 0.5653, 0.4762]}, {"w": "dive", "b": [0.5716, 0.4565, 0.6151, 0.4762]}, {"w": "in.", "b": [0.6214, 0.4565, 0.6473, 0.4762]}]}, {"id": "b_2", "type": "paragraph", "text": "9.3.1. Models as programs", "words": [{"w": "9.3.1.", "b": [0.1294, 0.5037, 0.1862, 0.5234]}, {"w": "Models", "b": [0.1925, 0.5037, 0.271, 0.5234]}, {"w": "as", "b": [0.2773, 0.5037, 0.2997, 0.5234]}, {"w": "programs", "b": [0.306, 0.5037, 0.4106, 0.5234]}]}, {"id": "b_3", "type": "paragraph", "text": "As noted in the previous section, a necessary transformational development that we can expect in the field of machine learning is a move away from models that perform purely pattern recognition and can only achieve local generalization, toward models capable of abstraction and reasoning that can achieve extreme generalization. Current AI programs that are capable of basic forms of reasoning are all hardcoded by human programmers: for instance, software that relies on search algorithms, graph manipulation, and formal logic. In DeepMind’s AlphaGo, for example, most of the intelligence on display is designed and hardcoded by expert programmers (such as Monte Carlo Tree Search); learning from data happens only in specialized submodules (value networks and policy networks). But in the future, such AI systems may be fully learned, with no human involvement.", "words": [{"w": "As", "b": [0.1294, 0.5465, 0.1574, 0.5662]}, {"w": "noted", "b": [0.1637, 0.5465, 0.2198, 0.5662]}, {"w": "in", "b": [0.2261, 0.5465, 0.2457, 0.5662]}, {"w": "the", "b": [0.252, 0.5465, 0.2829, 0.5662]}, {"w": "previous", "b": [0.2892, 0.5465, 0.376, 0.5662]}, {"w": "section,", "b": [0.3824, 0.5465, 0.4601, 0.5662]}, {"w": "a", "b": [0.4664, 0.5465, 0.4776, 0.5662]}, {"w": "necessary", "b": [0.4839, 0.5465, 0.582, 0.5662]}, {"w": "transformational", "b": [0.5883, 0.5465, 0.755, 0.5662]}, {"w": "development", "b": [0.1294, 0.567, 0.2597, 0.5867]}, {"w": "that", "b": [0.266, 0.567, 0.3039, 0.5867]}, {"w": "we", "b": [0.3102, 0.567, 0.3396, 0.5867]}, {"w": "can", "b": [0.3459, 0.567, 0.3809, 0.5867]}, {"w": "expect", "b": [0.3872, 0.567, 0.4531, 0.5867]}, {"w": "in", "b": [0.4594, 0.567, 0.479, 0.5867]}, {"w": "the", "b": [0.4853, 0.567, 0.5161, 0.5867]}, {"w": "field", "b": [0.5224, 0.567, 0.5687, 0.5867]}, {"w": "of", "b": [0.575, 0.567, 0.596, 0.5867]}, {"w": "machine", "b": [0.6023, 0.567, 0.6878, 0.5867]}, {"w": "learning", "b": [0.6941, 0.567, 0.7767, 0.5867]}, {"w": "is", "b": [0.7829, 0.567, 0.7997, 0.5867]}, {"w": "a", "b": [0.806, 0.567, 0.8172, 0.5867]}, {"w": "move", "b": [0.1294, 0.5875, 0.1855, 0.6072]}, {"w": "away", "b": [0.1918, 0.5875, 0.245, 0.6072]}, {"w": "from", "b": [0.2513, 0.5875, 0.3003, 0.6072]}, {"w": "models", "b": [0.3066, 0.5875, 0.3795, 0.6072]}, {"w": "that", "b": [0.3858, 0.5875, 0.4237, 0.6072]}, {"w": "perform", "b": [0.43, 0.5875, 0.5112, 0.6072]}, {"w": "purely", "b": [0.5175, 0.5875, 0.582, 0.6072]}, {"w": "pattern", "b": [0.5882, 0.5875, 0.6611, 0.6072]}, {"w": "recognition", "b": [0.6674, 0.5875, 0.7828, 0.6072]}, {"w": "and", "b": [0.7891, 0.5875, 0.8255, 0.6072]}, {"w": "can", "b": [0.8318, 0.5875, 0.8668, 0.6072]}, {"w": "only", "b": [0.1294, 0.608, 0.1743, 0.6277]}, {"w": "achieve", "b": [0.1806, 0.608, 0.2576, 0.6277]}, {"w": "local", "b": [0.2639, 0.608, 0.3143, 0.6277]}, {"w": "generalization,", "b": [0.3206, 0.608, 0.4727, 0.6277]}, {"w": "toward", "b": [0.479, 0.608, 0.549, 0.6277]}, {"w": "models", "b": [0.5553, 0.608, 0.6282, 0.6277]}, {"w": "capable", "b": [0.6345, 0.608, 0.7115, 0.6277]}, {"w": "of", "b": [0.7179, 0.608, 0.7389, 0.6277]}, {"w": "abstraction", "b": [0.7451, 0.608, 0.8601, 0.6277]}, {"w": "and", "b": [0.1294, 0.6285, 0.1658, 0.6482]}, {"w": "reasoning", "b": [0.1721, 0.6285, 0.2721, 0.6482]}, {"w": "that", "b": [0.2784, 0.6285, 0.3162, 0.6482]}, {"w": "can", "b": [0.3225, 0.6285, 0.3576, 0.6482]}, {"w": "achieve", "b": [0.3639, 0.6285, 0.4409, 0.6482]}, {"w": "extreme", "b": [0.4472, 0.6285, 0.5261, 0.6482]}, {"w": "generalization.", "b": [0.5324, 0.6285, 0.6844, 0.6482]}, {"w": "Current", "b": [0.6907, 0.6285, 0.7678, 0.6482]}, {"w": "AI", "b": [0.7741, 0.6285, 0.8007, 0.6482]}, {"w": "programs", "b": [0.1294, 0.649, 0.2247, 0.6687]}, {"w": "that", "b": [0.231, 0.649, 0.2688, 0.6687]}, {"w": "are", "b": [0.2751, 0.649, 0.3059, 0.6687]}, {"w": "capable", "b": [0.3122, 0.649, 0.3893, 0.6687]}, {"w": "of", "b": [0.3956, 0.649, 0.4166, 0.6687]}, {"w": "basic", "b": [0.4229, 0.649, 0.4748, 0.6687]}, {"w": "forms", "b": [0.4811, 0.649, 0.5399, 0.6687]}, {"w": "of", "b": [0.5462, 0.649, 0.5672, 0.6687]}, {"w": "reasoning", "b": [0.5735, 0.649, 0.6716, 0.6687]}, {"w": "are", "b": [0.6779, 0.649, 0.7087, 0.6687]}, {"w": "all", "b": [0.715, 0.649, 0.7403, 0.6687]}, {"w": "hardcoded", "b": [0.7466, 0.649, 0.8516, 0.6687]}, {"w": "by", "b": [0.1294, 0.6695, 0.1546, 0.6892]}, {"w": "human", "b": [0.1609, 0.6695, 0.2296, 0.6892]}, {"w": "programmers:", "b": [0.2359, 0.6695, 0.3774, 0.6892]}, {"w": "for", "b": [0.3837, 0.6695, 0.4132, 0.6892]}, {"w": "instance,", "b": [0.4195, 0.6695, 0.5084, 0.6892]}, {"w": "software", "b": [0.5147, 0.6695, 0.6016, 0.6892]}, {"w": "that", "b": [0.6078, 0.6695, 0.6457, 0.6892]}, {"w": "relies", "b": [0.652, 0.6695, 0.7066, 0.6892]}, {"w": "on", "b": [0.7129, 0.6695, 0.7382, 0.6892]}, {"w": "search", "b": [0.7445, 0.6695, 0.8089, 0.6892]}, {"w": "algorithms,", "b": [0.1294, 0.69, 0.2436, 0.7097]}, {"w": "graph", "b": [0.2499, 0.69, 0.3074, 0.7097]}, {"w": "manipulation,", "b": [0.3137, 0.69, 0.4531, 0.7097]}, {"w": "and", "b": [0.4594, 0.69, 0.4959, 0.7097]}, {"w": "formal", "b": [0.5022, 0.69, 0.5694, 0.7097]}, {"w": "logic.", "b": [0.5757, 0.69, 0.6325, 0.7097]}, {"w": "In", "b": [0.6388, 0.69, 0.6598, 0.7097]}, {"w": "DeepMind’s", "b": [0.6661, 0.69, 0.7907, 0.7097]}, {"w": "AlphaGo,", "b": [0.1294, 0.7105, 0.2282, 0.7302]}, {"w": "for", "b": [0.2345, 0.7105, 0.2639, 0.7302]}, {"w": "example,", "b": [0.2702, 0.7105, 0.362, 0.7302]}, {"w": "most", "b": [0.3683, 0.7105, 0.4174, 0.7302]}, {"w": "of", "b": [0.4237, 0.7105, 0.4447, 0.7302]}, {"w": "the", "b": [0.451, 0.7105, 0.4818, 0.7302]}, {"w": "intelligence", "b": [0.4881, 0.7105, 0.6058, 0.7302]}, {"w": "on", "b": [0.6121, 0.7105, 0.6373, 0.7302]}, {"w": "display", "b": [0.6436, 0.7105, 0.7165, 0.7302]}, {"w": "is", "b": [0.7228, 0.7105, 0.7396, 0.7302]}, {"w": "designed", "b": [0.7459, 0.7105, 0.8356, 0.7302]}, {"w": "and", "b": [0.1294, 0.731, 0.1658, 0.7507]}, {"w": "hardcoded", "b": [0.1721, 0.731, 0.2772, 0.7507]}, {"w": "by", "b": [0.2835, 0.731, 0.3087, 0.7507]}, {"w": "expert", "b": [0.315, 0.731, 0.3781, 0.7507]}, {"w": "programmers", "b": [0.3844, 0.731, 0.5189, 0.7507]}, {"w": "(such", "b": [0.5252, 0.731, 0.5798, 0.7507]}, {"w": "as", "b": [0.5861, 0.731, 0.6072, 0.7507]}, {"w": "Monte", "b": [0.6135, 0.731, 0.6793, 0.7507]}, {"w": "Carlo", "b": [0.6856, 0.731, 0.7417, 0.7507]}, {"w": "Tree", "b": [0.748, 0.731, 0.7933, 0.7507]}, {"w": "Search);", "b": [0.1294, 0.7515, 0.2135, 0.7712]}, {"w": "learning", "b": [0.2198, 0.7515, 0.3024, 0.7712]}, {"w": "from", "b": [0.3087, 0.7515, 0.3578, 0.7712]}, {"w": "data", "b": [0.3641, 0.7515, 0.4061, 0.7712]}, {"w": "happens", "b": [0.4124, 0.7515, 0.4951, 0.7712]}, {"w": "only", "b": [0.5014, 0.7515, 0.5462, 0.7712]}, {"w": "in", "b": [0.5525, 0.7515, 0.5721, 0.7712]}, {"w": "specialized", "b": [0.5784, 0.7515, 0.6905, 0.7712]}, {"w": "submodules", "b": [0.6968, 0.7515, 0.8173, 0.7712]}, {"w": "(value", "b": [0.1294, 0.772, 0.1925, 0.7917]}, {"w": "networks", "b": [0.1988, 0.772, 0.2912, 0.7917]}, {"w": "and", "b": [0.2975, 0.772, 0.334, 0.7917]}, {"w": "policy", "b": [0.3403, 0.772, 0.4033, 0.7917]}, {"w": "networks).", "b": [0.4096, 0.772, 0.5168, 0.7917]}, {"w": "But", "b": [0.5231, 0.772, 0.5596, 0.7917]}, {"w": "in", "b": [0.5659, 0.772, 0.5855, 0.7917]}, {"w": "the", "b": [0.5918, 0.772, 0.6227, 0.7917]}, {"w": "future,", "b": [0.629, 0.772, 0.6955, 0.7917]}, {"w": "such", "b": [0.7018, 0.772, 0.748, 0.7917]}, {"w": "AI", "b": [0.7544, 0.772, 0.781, 0.7917]}, {"w": "systems", "b": [0.7873, 0.772, 0.8672, 0.7917]}, {"w": "may", "b": [0.1294, 0.7925, 0.1729, 0.8122]}, {"w": "be", "b": [0.1792, 0.7925, 0.203, 0.8122]}, {"w": "fully", "b": [0.2093, 0.7925, 0.2569, 0.8122]}, {"w": "learned,", "b": [0.2632, 0.7925, 0.3438, 0.8122]}, {"w": "with", "b": [0.3501, 0.7925, 0.3949, 0.8122]}, {"w": "no", "b": [0.4012, 0.7925, 0.4264, 0.8122]}, {"w": "human", "b": [0.4327, 0.7925, 0.5014, 0.8122]}, {"w": "involvement.", "b": [0.5077, 0.7925, 0.6401, 0.8122]}]}, {"id": "b_4", "type": "paragraph", "text": "What path could make this happen? Consider a well-known type of network: RNNs. It’s important to note that RNNs have slightly fewer limitations than feedforward networks. That’s because RNNs are a bit", "words": [{"w": "What", "b": [0.1294, 0.8353, 0.1841, 0.855]}, {"w": "path", "b": [0.1904, 0.8353, 0.2338, 0.855]}, {"w": "could", "b": [0.2401, 0.8353, 0.2962, 0.855]}, {"w": "make", "b": [0.3025, 0.8353, 0.3571, 0.855]}, {"w": "this", "b": [0.3634, 0.8353, 0.3999, 0.855]}, {"w": "happen?", "b": [0.4062, 0.8353, 0.4902, 0.855]}, {"w": "Consider", "b": [0.4965, 0.8353, 0.5876, 0.855]}, {"w": "a", "b": [0.5939, 0.8353, 0.6051, 0.855]}, {"w": "well-known", "b": [0.6114, 0.8353, 0.7319, 0.855]}, {"w": "type", "b": [0.7382, 0.8353, 0.7817, 0.855]}, {"w": "of", "b": [0.788, 0.8353, 0.809, 0.855]}, {"w": "network:", "b": [0.1294, 0.8558, 0.2191, 0.8755]}, {"w": "RNNs.", "b": [0.2254, 0.8558, 0.2948, 0.8755]}, {"w": "It’s", "b": [0.3011, 0.8558, 0.3333, 0.8755]}, {"w": "important", "b": [0.3396, 0.8558, 0.4377, 0.8755]}, {"w": "to", "b": [0.444, 0.8558, 0.4636, 0.8755]}, {"w": "note", "b": [0.47, 0.8558, 0.5134, 0.8755]}, {"w": "that", "b": [0.5197, 0.8558, 0.5575, 0.8755]}, {"w": "RNNs", "b": [0.5638, 0.8558, 0.6269, 0.8755]}, {"w": "have", "b": [0.6332, 0.8558, 0.6808, 0.8755]}, {"w": "slightly", "b": [0.6871, 0.8558, 0.7629, 0.8755]}, {"w": "fewer", "b": [0.7691, 0.8558, 0.8265, 0.8755]}, {"w": "limitations", "b": [0.1294, 0.8763, 0.2374, 0.896]}, {"w": "than", "b": [0.2437, 0.8763, 0.2871, 0.896]}, {"w": "feedforward", "b": [0.2934, 0.8763, 0.4167, 0.896]}, {"w": "networks.", "b": [0.423, 0.8763, 0.5217, 0.896]}, {"w": "That’s", "b": [0.5281, 0.8763, 0.5911, 0.896]}, {"w": "because", "b": [0.5974, 0.8763, 0.6772, 0.896]}, {"w": "RNNs", "b": [0.6835, 0.8763, 0.7466, 0.896]}, {"w": "are", "b": [0.7529, 0.8763, 0.7837, 0.896]}, {"w": "a", "b": [0.79, 0.8763, 0.8012, 0.896]}, {"w": "bit", "b": [0.8075, 0.8763, 0.8341, 0.896]}]}]}, {"page": 431, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "more than mere geometric transformations: they’re geometric transformations repeatedly applied inside a for loop. The temporal for loop is itself hardcoded by human developers: it’s a built-in assumption of the network. Naturally, RNNs are still extremely limited in what they can represent, primarily because each step they perform is a differentiable geometric transformation, and they carry information from step to step via points in a continuous geometric space (state vectors). Now imagine a neural network that’s augmented in a similar way with programming primitives—but instead of a single hardcoded for loop with hardcoded geometric memory, the network includes a large set of programming primitives that the model is free to manipulate to expand its processing function, such as if branches, while statements, variable creation, disk storage for long-term memory, sorting operators, advanced data structures (such as lists, graphs, and hash tables), and many more. The space of programs that such a network could represent would be far broader than what can be represented with current deep- learning models, and some of these programs could achieve superior generalization power.", "words": [{"w": "more", "b": [0.1294, 0.0857, 0.1813, 0.1054]}, {"w": "than", "b": [0.1876, 0.0857, 0.231, 0.1054]}, {"w": "mere", "b": [0.2373, 0.0857, 0.2877, 0.1054]}, {"w": "geometric", "b": [0.294, 0.0857, 0.3949, 0.1054]}, {"w": "transformations:", "b": [0.4012, 0.0857, 0.5666, 0.1054]}, {"w": "they’re", "b": [0.5728, 0.0857, 0.6442, 0.1054]}, {"w": "geometric", "b": [0.6505, 0.0857, 0.7514, 0.1054]}, {"w": "transformations", "b": [0.1294, 0.1062, 0.2878, 0.1259]}, {"w": "repeatedly", "b": [0.294, 0.1062, 0.3996, 0.1259]}, {"w": "applied", "b": [0.4059, 0.1062, 0.4816, 0.1259]}, {"w": "inside", "b": [0.4879, 0.1062, 0.5481, 0.1259]}, {"w": "a", "b": [0.5544, 0.1062, 0.567, 0.1259]}, {"w": "for", "b": [0.5733, 0.1072, 0.6187, 0.1274]}, {"w": "loop.", "b": [0.625, 0.1062, 0.6762, 0.1259]}, {"w": "The", "b": [0.6825, 0.1062, 0.7217, 0.1259]}, {"w": "temporal", "b": [0.728, 0.1062, 0.8177, 0.1259]}, {"w": "for", "b": [0.8239, 0.1072, 0.8694, 0.1274]}, {"w": "loop", "b": [0.1294, 0.1276, 0.1743, 0.1473]}, {"w": "is", "b": [0.1806, 0.1276, 0.1974, 0.1473]}, {"w": "itself", "b": [0.2037, 0.1276, 0.2542, 0.1473]}, {"w": "hardcoded", "b": [0.2605, 0.1276, 0.3655, 0.1473]}, {"w": "by", "b": [0.3718, 0.1276, 0.3971, 0.1473]}, {"w": "human", "b": [0.4034, 0.1276, 0.472, 0.1473]}, {"w": "developers:", "b": [0.4783, 0.1276, 0.5946, 0.1473]}, {"w": "it’s", "b": [0.6009, 0.1276, 0.6317, 0.1473]}, {"w": "a", "b": [0.638, 0.1276, 0.6492, 0.1473]}, {"w": "built-in", "b": [0.6555, 0.1276, 0.7298, 0.1473]}, {"w": "assumption", "b": [0.7361, 0.1276, 0.8511, 0.1473]}, {"w": "of", "b": [0.1294, 0.1481, 0.1504, 0.1678]}, {"w": "the", "b": [0.1567, 0.1481, 0.1876, 0.1678]}, {"w": "network.", "b": [0.1939, 0.1481, 0.2828, 0.1678]}, {"w": "Naturally,", "b": [0.2891, 0.1481, 0.3891, 0.1678]}, {"w": "RNNs", "b": [0.3954, 0.1481, 0.4584, 0.1678]}, {"w": "are", "b": [0.4647, 0.1481, 0.4955, 0.1678]}, {"w": "still", "b": [0.5018, 0.1481, 0.5397, 0.1678]}, {"w": "extremely", "b": [0.546, 0.1481, 0.6469, 0.1678]}, {"w": "limited", "b": [0.6532, 0.1481, 0.7247, 0.1678]}, {"w": "in", "b": [0.731, 0.1481, 0.7506, 0.1678]}, {"w": "what", "b": [0.7569, 0.1481, 0.8059, 0.1678]}, {"w": "they", "b": [0.8122, 0.1481, 0.8557, 0.1678]}, {"w": "can", "b": [0.1294, 0.1686, 0.1644, 0.1883]}, {"w": "represent,", "b": [0.1707, 0.1686, 0.2695, 0.1883]}, {"w": "primarily", "b": [0.2758, 0.1686, 0.3697, 0.1883]}, {"w": "because", "b": [0.376, 0.1686, 0.4558, 0.1883]}, {"w": "each", "b": [0.4621, 0.1686, 0.5084, 0.1883]}, {"w": "step", "b": [0.5147, 0.1686, 0.5553, 0.1883]}, {"w": "they", "b": [0.5616, 0.1686, 0.605, 0.1883]}, {"w": "perform", "b": [0.6114, 0.1686, 0.6926, 0.1883]}, {"w": "is", "b": [0.6989, 0.1686, 0.7157, 0.1883]}, {"w": "a", "b": [0.722, 0.1686, 0.7332, 0.1883]}, {"w": "differentiable", "b": [0.1294, 0.1891, 0.2648, 0.2088]}, {"w": "geometric", "b": [0.2711, 0.1891, 0.372, 0.2088]}, {"w": "transformation,", "b": [0.3783, 0.1891, 0.5332, 0.2088]}, {"w": "and", "b": [0.5394, 0.1891, 0.5758, 0.2088]}, {"w": "they", "b": [0.5821, 0.1891, 0.6256, 0.2088]}, {"w": "carry", "b": [0.6319, 0.1891, 0.6837, 0.2088]}, {"w": "information", "b": [0.69, 0.1891, 0.8091, 0.2088]}, {"w": "from", "b": [0.8154, 0.1891, 0.8644, 0.2088]}, {"w": "step", "b": [0.1294, 0.2096, 0.1701, 0.2293]}, {"w": "to", "b": [0.1764, 0.2096, 0.196, 0.2293]}, {"w": "step", "b": [0.2023, 0.2096, 0.2429, 0.2293]}, {"w": "via", "b": [0.2492, 0.2096, 0.2801, 0.2293]}, {"w": "points", "b": [0.2864, 0.2096, 0.348, 0.2293]}, {"w": "in", "b": [0.3544, 0.2096, 0.374, 0.2293]}, {"w": "a", "b": [0.3803, 0.2096, 0.3915, 0.2293]}, {"w": "continuous", "b": [0.3978, 0.2096, 0.5085, 0.2293]}, {"w": "geometric", "b": [0.5148, 0.2096, 0.6157, 0.2293]}, {"w": "space", "b": [0.622, 0.2096, 0.678, 0.2293]}, {"w": "(state", "b": [0.6843, 0.2096, 0.739, 0.2293]}, {"w": "vectors).", "b": [0.7453, 0.2096, 0.8328, 0.2293]}, {"w": "Now", "b": [0.1294, 0.2301, 0.1785, 0.2498]}, {"w": "imagine", "b": [0.1848, 0.2301, 0.266, 0.2498]}, {"w": "a", "b": [0.2723, 0.2301, 0.2835, 0.2498]}, {"w": "neural", "b": [0.2898, 0.2301, 0.3529, 0.2498]}, {"w": "network", "b": [0.3592, 0.2301, 0.4418, 0.2498]}, {"w": "that’s", "b": [0.4481, 0.2301, 0.5028, 0.2498]}, {"w": "augmented", "b": [0.5091, 0.2301, 0.6198, 0.2498]}, {"w": "in", "b": [0.6261, 0.2301, 0.6457, 0.2498]}, {"w": "a", "b": [0.652, 0.2301, 0.6632, 0.2498]}, {"w": "similar", "b": [0.6695, 0.2301, 0.7396, 0.2498]}, {"w": "way", "b": [0.7459, 0.2301, 0.7879, 0.2498]}, {"w": "with", "b": [0.7942, 0.2301, 0.8391, 0.2498]}, {"w": "programming", "b": [0.1294, 0.2506, 0.2667, 0.2703]}, {"w": "primitives—but", "b": [0.273, 0.2506, 0.4328, 0.2703]}, {"w": "instead", "b": [0.4391, 0.2506, 0.5106, 0.2703]}, {"w": "of", "b": [0.5169, 0.2506, 0.5379, 0.2703]}, {"w": "a", "b": [0.5442, 0.2506, 0.5554, 0.2703]}, {"w": "single", "b": [0.5617, 0.2506, 0.622, 0.2703]}, {"w": "hardcoded", "b": [0.6283, 0.2506, 0.7334, 0.2703]}, {"w": "for", "b": [0.7396, 0.2516, 0.785, 0.2718]}, {"w": "loop", "b": [0.7913, 0.2506, 0.8361, 0.2703]}, {"w": "with", "b": [0.1294, 0.272, 0.1743, 0.2917]}, {"w": "hardcoded", "b": [0.1806, 0.272, 0.2856, 0.2917]}, {"w": "geometric", "b": [0.2919, 0.272, 0.3928, 0.2917]}, {"w": "memory,", "b": [0.3991, 0.272, 0.4878, 0.2917]}, {"w": "the", "b": [0.4941, 0.272, 0.525, 0.2917]}, {"w": "network", "b": [0.5313, 0.272, 0.6139, 0.2917]}, {"w": "includes", "b": [0.6202, 0.272, 0.7043, 0.2917]}, {"w": "a", "b": [0.7106, 0.272, 0.7218, 0.2917]}, {"w": "large", "b": [0.7281, 0.272, 0.7781, 0.2917]}, {"w": "set", "b": [0.7844, 0.272, 0.8124, 0.2917]}, {"w": "of", "b": [0.8187, 0.272, 0.8397, 0.2917]}, {"w": "programming", "b": [0.1294, 0.2925, 0.2667, 0.3122]}, {"w": "primitives", "b": [0.273, 0.2925, 0.3754, 0.3122]}, {"w": "that", "b": [0.3817, 0.2925, 0.4195, 0.3122]}, {"w": "the", "b": [0.4258, 0.2925, 0.4566, 0.3122]}, {"w": "model", "b": [0.4629, 0.2925, 0.526, 0.3122]}, {"w": "is", "b": [0.5323, 0.2925, 0.5491, 0.3122]}, {"w": "free", "b": [0.5554, 0.2925, 0.5947, 0.3122]}, {"w": "to", "b": [0.601, 0.2925, 0.6206, 0.3122]}, {"w": "manipulate", "b": [0.6268, 0.2925, 0.7389, 0.3122]}, {"w": "to", "b": [0.7452, 0.2925, 0.7648, 0.3122]}, {"w": "expand", "b": [0.7711, 0.2925, 0.844, 0.3122]}, {"w": "its", "b": [0.1294, 0.313, 0.1533, 0.3327]}, {"w": "processing", "b": [0.1596, 0.313, 0.2674, 0.3327]}, {"w": "function,", "b": [0.2738, 0.313, 0.3641, 0.3327]}, {"w": "such", "b": [0.3704, 0.313, 0.4167, 0.3327]}, {"w": "as", "b": [0.423, 0.313, 0.444, 0.3327]}, {"w": "if", "b": [0.4503, 0.314, 0.4805, 0.3342]}, {"w": "branches,", "b": [0.4868, 0.313, 0.5828, 0.3327]}, {"w": "while", "b": [0.5891, 0.314, 0.6648, 0.3342]}, {"w": "statements,", "b": [0.6711, 0.313, 0.7839, 0.3327]}, {"w": "variable", "b": [0.1294, 0.3344, 0.2107, 0.3541]}, {"w": "creation,", "b": [0.217, 0.3344, 0.3045, 0.3541]}, {"w": "disk", "b": [0.3108, 0.3344, 0.3529, 0.3541]}, {"w": "storage", "b": [0.3592, 0.3344, 0.432, 0.3541]}, {"w": "for", "b": [0.4384, 0.3344, 0.4678, 0.3541]}, {"w": "long-term", "b": [0.4741, 0.3344, 0.5736, 0.3541]}, {"w": "memory,", "b": [0.5799, 0.3344, 0.6685, 0.3541]}, {"w": "sorting", "b": [0.6748, 0.3344, 0.7449, 0.3541]}, {"w": "operators,", "b": [0.7512, 0.3344, 0.8514, 0.3541]}, {"w": "advanced", "b": [0.1294, 0.3549, 0.2247, 0.3746]}, {"w": "data", "b": [0.231, 0.3549, 0.273, 0.3746]}, {"w": "structures", "b": [0.2793, 0.3549, 0.3774, 0.3746]}, {"w": "(such", "b": [0.3837, 0.3549, 0.4383, 0.3746]}, {"w": "as", "b": [0.4446, 0.3549, 0.4656, 0.3746]}, {"w": "lists,", "b": [0.472, 0.3549, 0.5189, 0.3746]}, {"w": "graphs,", "b": [0.5252, 0.3549, 0.5987, 0.3746]}, {"w": "and", "b": [0.605, 0.3549, 0.6415, 0.3746]}, {"w": "hash", "b": [0.6478, 0.3549, 0.694, 0.3746]}, {"w": "tables),", "b": [0.7003, 0.3549, 0.7739, 0.3746]}, {"w": "and", "b": [0.7802, 0.3549, 0.8166, 0.3746]}, {"w": "many", "b": [0.1294, 0.3754, 0.1855, 0.3951]}, {"w": "more.", "b": [0.1918, 0.3754, 0.2499, 0.3951]}, {"w": "The", "b": [0.2562, 0.3754, 0.2954, 0.3951]}, {"w": "space", "b": [0.3018, 0.3754, 0.3578, 0.3951]}, {"w": "of", "b": [0.3641, 0.3754, 0.3851, 0.3951]}, {"w": "programs", "b": [0.3914, 0.3754, 0.4867, 0.3951]}, {"w": "that", "b": [0.493, 0.3754, 0.5308, 0.3951]}, {"w": "such", "b": [0.5371, 0.3754, 0.5834, 0.3951]}, {"w": "a", "b": [0.5897, 0.3754, 0.6009, 0.3951]}, {"w": "network", "b": [0.6072, 0.3754, 0.6899, 0.3951]}, {"w": "could", "b": [0.6962, 0.3754, 0.7522, 0.3951]}, {"w": "represent", "b": [0.7585, 0.3754, 0.851, 0.3951]}, {"w": "would", "b": [0.1294, 0.3959, 0.1925, 0.4156]}, {"w": "be", "b": [0.1988, 0.3959, 0.2226, 0.4156]}, {"w": "far", "b": [0.2289, 0.3959, 0.2569, 0.4156]}, {"w": "broader", "b": [0.2632, 0.3959, 0.3402, 0.4156]}, {"w": "than", "b": [0.3466, 0.3959, 0.39, 0.4156]}, {"w": "what", "b": [0.3963, 0.3959, 0.4453, 0.4156]}, {"w": "can", "b": [0.4516, 0.3959, 0.4866, 0.4156]}, {"w": "be", "b": [0.4929, 0.3959, 0.5168, 0.4156]}, {"w": "represented", "b": [0.5231, 0.3959, 0.6393, 0.4156]}, {"w": "with", "b": [0.6456, 0.3959, 0.6905, 0.4156]}, {"w": "current", "b": [0.6968, 0.3959, 0.7682, 0.4156]}, {"w": "deep-", "b": [0.7745, 0.3959, 0.8306, 0.4156]}, {"w": "learning", "b": [0.1294, 0.4164, 0.2121, 0.4361]}, {"w": "models,", "b": [0.2184, 0.4164, 0.2976, 0.4361]}, {"w": "and", "b": [0.3039, 0.4164, 0.3403, 0.4361]}, {"w": "some", "b": [0.3466, 0.4164, 0.3999, 0.4361]}, {"w": "of", "b": [0.4062, 0.4164, 0.4272, 0.4361]}, {"w": "these", "b": [0.4335, 0.4164, 0.4853, 0.4361]}, {"w": "programs", "b": [0.4916, 0.4164, 0.5869, 0.4361]}, {"w": "could", "b": [0.5932, 0.4164, 0.6493, 0.4361]}, {"w": "achieve", "b": [0.6556, 0.4164, 0.7326, 0.4361]}, {"w": "superior", "b": [0.7389, 0.4164, 0.8216, 0.4361]}, {"w": "generalization", "b": [0.1294, 0.4369, 0.2723, 0.4566]}, {"w": "power.", "b": [0.2786, 0.4369, 0.3465, 0.4566]}]}, {"id": "b_1", "type": "paragraph", "text": "We’ll move away from having, on one hand, hardcoded algorithmic intelligence (handcrafted software) and, on the other hand, learned geometric intelligence (deep learning). Instead, we’ll have a blend of formal algorithmic modules that provide reasoning and abstraction capabilities, and geometric modules that provide informal intuition and pattern-recognition capabilities. The entire system will be learned with little or no human involvement.", "words": [{"w": "We’ll", "b": [0.1294, 0.4796, 0.1848, 0.4994]}, {"w": "move", "b": [0.1911, 0.4796, 0.2472, 0.4994]}, {"w": "away", "b": [0.2535, 0.4796, 0.3067, 0.4994]}, {"w": "from", "b": [0.313, 0.4796, 0.3621, 0.4994]}, {"w": "having,", "b": [0.3684, 0.4796, 0.4433, 0.4994]}, {"w": "on", "b": [0.4496, 0.4796, 0.4749, 0.4994]}, {"w": "one", "b": [0.4812, 0.4796, 0.5176, 0.4994]}, {"w": "hand,", "b": [0.5239, 0.4796, 0.5793, 0.4994]}, {"w": "hardcoded", "b": [0.5856, 0.4796, 0.6906, 0.4994]}, {"w": "algorithmic", "b": [0.6969, 0.4796, 0.8133, 0.4994]}, {"w": "intelligence", "b": [0.1294, 0.5001, 0.2471, 0.5199]}, {"w": "(handcrafted", "b": [0.2534, 0.5001, 0.3809, 0.5199]}, {"w": "software)", "b": [0.3872, 0.5001, 0.4824, 0.5199]}, {"w": "and,", "b": [0.4888, 0.5001, 0.5315, 0.5199]}, {"w": "on", "b": [0.5378, 0.5001, 0.563, 0.5199]}, {"w": "the", "b": [0.5693, 0.5001, 0.6002, 0.5199]}, {"w": "other", "b": [0.6065, 0.5001, 0.6583, 0.5199]}, {"w": "hand,", "b": [0.6646, 0.5001, 0.7199, 0.5199]}, {"w": "learned", "b": [0.7262, 0.5001, 0.8004, 0.5199]}, {"w": "geometric", "b": [0.1294, 0.5206, 0.2303, 0.5404]}, {"w": "intelligence", "b": [0.2366, 0.5206, 0.3543, 0.5404]}, {"w": "(deep", "b": [0.3606, 0.5206, 0.4166, 0.5404]}, {"w": "learning).", "b": [0.4229, 0.5206, 0.5203, 0.5404]}, {"w": "Instead,", "b": [0.5266, 0.5206, 0.6058, 0.5404]}, {"w": "we’ll", "b": [0.6121, 0.5206, 0.6639, 0.5404]}, {"w": "have", "b": [0.6702, 0.5206, 0.7179, 0.5404]}, {"w": "a", "b": [0.7242, 0.5206, 0.7354, 0.5404]}, {"w": "blend", "b": [0.7417, 0.5206, 0.7977, 0.5404]}, {"w": "of", "b": [0.804, 0.5206, 0.825, 0.5404]}, {"w": "formal", "b": [0.1294, 0.5411, 0.1967, 0.5609]}, {"w": "algorithmic", "b": [0.203, 0.5411, 0.3193, 0.5609]}, {"w": "modules", "b": [0.3256, 0.5411, 0.4111, 0.5609]}, {"w": "that", "b": [0.4174, 0.5411, 0.4552, 0.5609]}, {"w": "provide", "b": [0.4615, 0.5411, 0.5386, 0.5609]}, {"w": "reasoning", "b": [0.5449, 0.5411, 0.643, 0.5609]}, {"w": "and", "b": [0.6492, 0.5411, 0.6856, 0.5609]}, {"w": "abstraction", "b": [0.6919, 0.5411, 0.8026, 0.5609]}, {"w": "capabilities,", "b": [0.1294, 0.5616, 0.2506, 0.5814]}, {"w": "and", "b": [0.2569, 0.5616, 0.2934, 0.5814]}, {"w": "geometric", "b": [0.2997, 0.5616, 0.4005, 0.5814]}, {"w": "modules", "b": [0.4068, 0.5616, 0.4923, 0.5814]}, {"w": "that", "b": [0.4986, 0.5616, 0.5365, 0.5814]}, {"w": "provide", "b": [0.5428, 0.5616, 0.6199, 0.5814]}, {"w": "informal", "b": [0.6262, 0.5616, 0.713, 0.5814]}, {"w": "intuition", "b": [0.7193, 0.5616, 0.8049, 0.5814]}, {"w": "and", "b": [0.8112, 0.5616, 0.8476, 0.5814]}, {"w": "pattern-recognition", "b": [0.1294, 0.5821, 0.3228, 0.6019]}, {"w": "capabilities.", "b": [0.3291, 0.5821, 0.4503, 0.6019]}, {"w": "The", "b": [0.4565, 0.5821, 0.4957, 0.6019]}, {"w": "entire", "b": [0.5021, 0.5821, 0.5595, 0.6019]}, {"w": "system", "b": [0.5658, 0.5821, 0.6359, 0.6019]}, {"w": "will", "b": [0.6422, 0.5821, 0.6814, 0.6019]}, {"w": "be", "b": [0.6877, 0.5821, 0.7116, 0.6019]}, {"w": "learned", "b": [0.7179, 0.5821, 0.7921, 0.6019]}, {"w": "with", "b": [0.7984, 0.5821, 0.8433, 0.6019]}, {"w": "little", "b": [0.1294, 0.6026, 0.1757, 0.6224]}, {"w": "or", "b": [0.182, 0.6026, 0.203, 0.6224]}, {"w": "no", "b": [0.2093, 0.6026, 0.2345, 0.6224]}, {"w": "human", "b": [0.2408, 0.6026, 0.3095, 0.6224]}, {"w": "involvement.", "b": [0.3158, 0.6026, 0.4482, 0.6224]}]}, {"id": "b_2", "type": "paragraph", "text": "A related subfield of AI that I think may be about to take off in a big way is program synthesis, in particular neural program synthesis. Program synthesis consists of automatically generating simple programs by using a search algorithm (possibly genetic search, as in genetic programming) to explore a large space of possible programs. The search stops when a program is found that matches the required specifications, often provided as a set of input-output pairs. This is highly reminiscent of machine learning: given training data provided as input-output pairs, we find a program that matches inputs to outputs and can generalize to new inputs. The difference is that instead of learning parameter values in a hardcoded program (a neural network), we generate source code via a discrete search process.", "words": [{"w": "A", "b": [0.1294, 0.6454, 0.1476, 0.6652]}, {"w": "related", "b": [0.1539, 0.6454, 0.2226, 0.6652]}, {"w": "subfield", "b": [0.2289, 0.6454, 0.3102, 0.6652]}, {"w": "of", "b": [0.3165, 0.6454, 0.3375, 0.6652]}, {"w": "AI", "b": [0.3438, 0.6454, 0.3704, 0.6652]}, {"w": "that", "b": [0.3767, 0.6454, 0.4145, 0.6652]}, {"w": "I", "b": [0.4208, 0.6454, 0.4292, 0.6652]}, {"w": "think", "b": [0.4356, 0.6454, 0.4874, 0.6652]}, {"w": "may", "b": [0.4937, 0.6454, 0.5372, 0.6652]}, {"w": "be", "b": [0.5435, 0.6454, 0.5673, 0.6652]}, {"w": "about", "b": [0.5736, 0.6454, 0.6296, 0.6652]}, {"w": "to", "b": [0.6359, 0.6454, 0.6556, 0.6652]}, {"w": "take", "b": [0.6619, 0.6454, 0.7039, 0.6652]}, {"w": "off", "b": [0.7102, 0.6454, 0.7391, 0.6652]}, {"w": "in", "b": [0.7454, 0.6454, 0.765, 0.6652]}, {"w": "a", "b": [0.7713, 0.6454, 0.7825, 0.6652]}, {"w": "big", "b": [0.7888, 0.6454, 0.8211, 0.6652]}, {"w": "way", "b": [0.8274, 0.6454, 0.8694, 0.6652]}, {"w": "is", "b": [0.1294, 0.6659, 0.1462, 0.6857]}, {"w": "program", "b": [0.1525, 0.6659, 0.2399, 0.6857]}, {"w": "synthesis,", "b": [0.2462, 0.6659, 0.3436, 0.6857]}, {"w": "in", "b": [0.3499, 0.6659, 0.3695, 0.6857]}, {"w": "particular", "b": [0.3758, 0.6659, 0.4725, 0.6857]}, {"w": "neural", "b": [0.4788, 0.6659, 0.5418, 0.6857]}, {"w": "program", "b": [0.5482, 0.6659, 0.6336, 0.6857]}, {"w": "synthesis.", "b": [0.6399, 0.6659, 0.7387, 0.6857]}, {"w": "Program", "b": [0.745, 0.6659, 0.8319, 0.6857]}, {"w": "synthesis", "b": [0.1294, 0.6864, 0.2219, 0.7062]}, {"w": "consists", "b": [0.2282, 0.6864, 0.3081, 0.7062]}, {"w": "of", "b": [0.3144, 0.6864, 0.3354, 0.7062]}, {"w": "automatically", "b": [0.3417, 0.6864, 0.4791, 0.7062]}, {"w": "generating", "b": [0.4854, 0.6864, 0.5919, 0.7062]}, {"w": "simple", "b": [0.5982, 0.6864, 0.6654, 0.7062]}, {"w": "programs", "b": [0.6717, 0.6864, 0.767, 0.7062]}, {"w": "by", "b": [0.7733, 0.6864, 0.7986, 0.7062]}, {"w": "using", "b": [0.8049, 0.6864, 0.8595, 0.7062]}, {"w": "a", "b": [0.1294, 0.7069, 0.1406, 0.7267]}, {"w": "search", "b": [0.1469, 0.7069, 0.2113, 0.7267]}, {"w": "algorithm", "b": [0.2177, 0.7069, 0.3158, 0.7267]}, {"w": "(possibly", "b": [0.3221, 0.7069, 0.4146, 0.7267]}, {"w": "genetic", "b": [0.4209, 0.7069, 0.4937, 0.7267]}, {"w": "search,", "b": [0.5, 0.7069, 0.5708, 0.7267]}, {"w": "as", "b": [0.5771, 0.7069, 0.5981, 0.7267]}, {"w": "in", "b": [0.6044, 0.7069, 0.624, 0.7267]}, {"w": "genetic", "b": [0.6303, 0.7069, 0.7032, 0.7267]}, {"w": "programming)", "b": [0.7095, 0.7069, 0.8552, 0.7267]}, {"w": "to", "b": [0.1294, 0.7274, 0.149, 0.7472]}, {"w": "explore", "b": [0.1553, 0.7274, 0.231, 0.7472]}, {"w": "a", "b": [0.2373, 0.7274, 0.2485, 0.7472]}, {"w": "large", "b": [0.2548, 0.7274, 0.3048, 0.7472]}, {"w": "space", "b": [0.3111, 0.7274, 0.3671, 0.7472]}, {"w": "of", "b": [0.3734, 0.7274, 0.3944, 0.7472]}, {"w": "possible", "b": [0.4007, 0.7274, 0.4834, 0.7472]}, {"w": "programs.", "b": [0.4897, 0.7274, 0.5913, 0.7472]}, {"w": "The", "b": [0.5976, 0.7274, 0.6368, 0.7472]}, {"w": "search", "b": [0.6431, 0.7274, 0.7075, 0.7472]}, {"w": "stops", "b": [0.7138, 0.7274, 0.7657, 0.7472]}, {"w": "when", "b": [0.772, 0.7274, 0.8266, 0.7472]}, {"w": "a", "b": [0.8329, 0.7274, 0.8441, 0.7472]}, {"w": "program", "b": [0.1294, 0.7479, 0.2149, 0.7677]}, {"w": "is", "b": [0.2212, 0.7479, 0.238, 0.7677]}, {"w": "found", "b": [0.2443, 0.7479, 0.3032, 0.7677]}, {"w": "that", "b": [0.3095, 0.7479, 0.3473, 0.7677]}, {"w": "matches", "b": [0.3536, 0.7479, 0.4363, 0.7677]}, {"w": "the", "b": [0.4426, 0.7479, 0.4734, 0.7677]}, {"w": "required", "b": [0.4797, 0.7479, 0.5638, 0.7677]}, {"w": "specifications,", "b": [0.5701, 0.7479, 0.7151, 0.7677]}, {"w": "often", "b": [0.7214, 0.7479, 0.7732, 0.7677]}, {"w": "provided", "b": [0.7796, 0.7479, 0.8692, 0.7677]}, {"w": "as", "b": [0.1294, 0.7684, 0.1504, 0.7882]}, {"w": "a", "b": [0.1567, 0.7684, 0.1679, 0.7882]}, {"w": "set", "b": [0.1742, 0.7684, 0.2023, 0.7882]}, {"w": "of", "b": [0.2086, 0.7684, 0.2296, 0.7882]}, {"w": "input-output", "b": [0.2359, 0.7684, 0.3606, 0.7882]}, {"w": "pairs.", "b": [0.3669, 0.7684, 0.4223, 0.7882]}, {"w": "This", "b": [0.4286, 0.7684, 0.4734, 0.7882]}, {"w": "is", "b": [0.4797, 0.7684, 0.4965, 0.7882]}, {"w": "highly", "b": [0.5028, 0.7684, 0.5673, 0.7882]}, {"w": "reminiscent", "b": [0.5736, 0.7684, 0.6913, 0.7882]}, {"w": "of", "b": [0.6976, 0.7684, 0.7187, 0.7882]}, {"w": "machine", "b": [0.725, 0.7684, 0.8104, 0.7882]}, {"w": "learning:", "b": [0.1294, 0.7889, 0.2191, 0.8087]}, {"w": "given", "b": [0.2254, 0.7889, 0.2814, 0.8087]}, {"w": "training", "b": [0.2878, 0.7889, 0.3662, 0.8087]}, {"w": "data", "b": [0.3725, 0.7889, 0.4146, 0.8087]}, {"w": "provided", "b": [0.4209, 0.7889, 0.5105, 0.8087]}, {"w": "as", "b": [0.5169, 0.7889, 0.5379, 0.8087]}, {"w": "input-output", "b": [0.5442, 0.7889, 0.6689, 0.8087]}, {"w": "pairs,", "b": [0.6752, 0.7889, 0.7306, 0.8087]}, {"w": "we", "b": [0.7369, 0.7889, 0.7663, 0.8087]}, {"w": "find", "b": [0.7726, 0.7889, 0.8132, 0.8087]}, {"w": "a", "b": [0.8195, 0.7889, 0.8307, 0.8087]}, {"w": "program", "b": [0.1294, 0.8094, 0.2149, 0.8292]}, {"w": "that", "b": [0.2212, 0.8094, 0.259, 0.8292]}, {"w": "matches", "b": [0.2653, 0.8094, 0.348, 0.8292]}, {"w": "inputs", "b": [0.3543, 0.8094, 0.4159, 0.8292]}, {"w": "to", "b": [0.4223, 0.8094, 0.4419, 0.8292]}, {"w": "outputs", "b": [0.4482, 0.8094, 0.5225, 0.8292]}, {"w": "and", "b": [0.5288, 0.8094, 0.5652, 0.8292]}, {"w": "can", "b": [0.5715, 0.8094, 0.6065, 0.8292]}, {"w": "generalize", "b": [0.6128, 0.8094, 0.7165, 0.8292]}, {"w": "to", "b": [0.7228, 0.8094, 0.7424, 0.8292]}, {"w": "new", "b": [0.7487, 0.8094, 0.7907, 0.8292]}, {"w": "inputs.", "b": [0.7971, 0.8094, 0.865, 0.8292]}, {"w": "The", "b": [0.1294, 0.8299, 0.1686, 0.8497]}, {"w": "difference", "b": [0.1749, 0.8299, 0.2767, 0.8497]}, {"w": "is", "b": [0.283, 0.8299, 0.2998, 0.8497]}, {"w": "that", "b": [0.3062, 0.8299, 0.344, 0.8497]}, {"w": "instead", "b": [0.3503, 0.8299, 0.4218, 0.8497]}, {"w": "of", "b": [0.4281, 0.8299, 0.4491, 0.8497]}, {"w": "learning", "b": [0.4554, 0.8299, 0.5381, 0.8497]}, {"w": "parameter", "b": [0.5444, 0.8299, 0.6452, 0.8497]}, {"w": "values", "b": [0.6515, 0.8299, 0.716, 0.8497]}, {"w": "in", "b": [0.7223, 0.8299, 0.7419, 0.8497]}, {"w": "a", "b": [0.7481, 0.8299, 0.7593, 0.8497]}, {"w": "hardcoded", "b": [0.7656, 0.8299, 0.8707, 0.8497]}, {"w": "program", "b": [0.1294, 0.8504, 0.2149, 0.8702]}, {"w": "(a", "b": [0.2212, 0.8504, 0.2408, 0.8702]}, {"w": "neural", "b": [0.2471, 0.8504, 0.3101, 0.8702]}, {"w": "network),", "b": [0.3164, 0.8504, 0.4138, 0.8702]}, {"w": "we", "b": [0.4201, 0.8504, 0.4495, 0.8702]}, {"w": "generate", "b": [0.4558, 0.8504, 0.5413, 0.8702]}, {"w": "source", "b": [0.5476, 0.8504, 0.6134, 0.8702]}, {"w": "code", "b": [0.6197, 0.8504, 0.6674, 0.8702]}, {"w": "via", "b": [0.6737, 0.8504, 0.7045, 0.8702]}, {"w": "a", "b": [0.7108, 0.8504, 0.722, 0.8702]}, {"w": "discrete", "b": [0.7283, 0.8504, 0.8067, 0.8702]}, {"w": "search", "b": [0.1294, 0.8709, 0.1938, 0.8907]}, {"w": "process.", "b": [0.2001, 0.8709, 0.2821, 0.8907]}]}]}, {"page": 432, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "I definitely expect this subfield to see a wave of renewed interest in the next few years. In particular, I expect the emergence of a crossover subfield between deep learning and program synthesis, where instead of generating programs in a general-purpose language, we’ll generate neural networks (geometric data-processing flows) augmented with a rich set of algorithmic primitives, such as for loops and many others (see figure 9.5). This should be far more tractable and useful than directly generating source code, and it will dramatically expand the scope of problems that can be solved with machine learning—the space of programs that we can generate automatically, given appropriate training data. Contemporary RNNs can be seen as a prehistoric ancestor of such hybrid algorithmic-geometric models.", "words": [{"w": "I", "b": [0.1294, 0.0857, 0.1378, 0.1054]}, {"w": "definitely", "b": [0.1441, 0.0857, 0.2408, 0.1054]}, {"w": "expect", "b": [0.2471, 0.0857, 0.313, 0.1054]}, {"w": "this", "b": [0.3193, 0.0857, 0.3557, 0.1054]}, {"w": "subfield", "b": [0.362, 0.0857, 0.4433, 0.1054]}, {"w": "to", "b": [0.4496, 0.0857, 0.4692, 0.1054]}, {"w": "see", "b": [0.4755, 0.0857, 0.5077, 0.1054]}, {"w": "a", "b": [0.5141, 0.0857, 0.5253, 0.1054]}, {"w": "wave", "b": [0.5316, 0.0857, 0.5848, 0.1054]}, {"w": "of", "b": [0.5911, 0.0857, 0.6121, 0.1054]}, {"w": "renewed", "b": [0.6184, 0.0857, 0.7039, 0.1054]}, {"w": "interest", "b": [0.7102, 0.0857, 0.7844, 0.1054]}, {"w": "in", "b": [0.7907, 0.0857, 0.8104, 0.1054]}, {"w": "the", "b": [0.8167, 0.0857, 0.8475, 0.1054]}, {"w": "next", "b": [0.1294, 0.1062, 0.1729, 0.1259]}, {"w": "few", "b": [0.1792, 0.1062, 0.217, 0.1259]}, {"w": "years.", "b": [0.2233, 0.1062, 0.2828, 0.1259]}, {"w": "In", "b": [0.2891, 0.1062, 0.3101, 0.1259]}, {"w": "particular,", "b": [0.3164, 0.1062, 0.4184, 0.1259]}, {"w": "I", "b": [0.4247, 0.1062, 0.4331, 0.1259]}, {"w": "expect", "b": [0.4394, 0.1062, 0.5052, 0.1259]}, {"w": "the", "b": [0.5115, 0.1062, 0.5423, 0.1259]}, {"w": "emergence", "b": [0.5487, 0.1062, 0.6574, 0.1259]}, {"w": "of", "b": [0.6637, 0.1062, 0.6847, 0.1259]}, {"w": "a", "b": [0.691, 0.1062, 0.7022, 0.1259]}, {"w": "crossover", "b": [0.7085, 0.1062, 0.8052, 0.1259]}, {"w": "subfield", "b": [0.1294, 0.1267, 0.2107, 0.1464]}, {"w": "between", "b": [0.217, 0.1267, 0.301, 0.1464]}, {"w": "deep", "b": [0.3074, 0.1267, 0.355, 0.1464]}, {"w": "learning", "b": [0.3613, 0.1267, 0.444, 0.1464]}, {"w": "and", "b": [0.4503, 0.1267, 0.4867, 0.1464]}, {"w": "program", "b": [0.493, 0.1267, 0.5785, 0.1464]}, {"w": "synthesis,", "b": [0.5848, 0.1267, 0.6836, 0.1464]}, {"w": "where", "b": [0.6899, 0.1267, 0.7515, 0.1464]}, {"w": "instead", "b": [0.7578, 0.1267, 0.8293, 0.1464]}, {"w": "of", "b": [0.8356, 0.1267, 0.8566, 0.1464]}, {"w": "generating", "b": [0.1294, 0.1472, 0.2359, 0.1669]}, {"w": "programs", "b": [0.2422, 0.1472, 0.3375, 0.1669]}, {"w": "in", "b": [0.3438, 0.1472, 0.3634, 0.1669]}, {"w": "a", "b": [0.3697, 0.1472, 0.3809, 0.1669]}, {"w": "general-purpose", "b": [0.3872, 0.1472, 0.5497, 0.1669]}, {"w": "language,", "b": [0.556, 0.1472, 0.6534, 0.1669]}, {"w": "we’ll", "b": [0.6597, 0.1472, 0.7115, 0.1669]}, {"w": "generate", "b": [0.7178, 0.1472, 0.8032, 0.1669]}, {"w": "neural", "b": [0.1294, 0.1677, 0.1925, 0.1874]}, {"w": "networks", "b": [0.1988, 0.1677, 0.2912, 0.1874]}, {"w": "(geometric", "b": [0.2975, 0.1677, 0.4068, 0.1874]}, {"w": "data-processing", "b": [0.4131, 0.1677, 0.5714, 0.1874]}, {"w": "flows)", "b": [0.5777, 0.1677, 0.6422, 0.1874]}, {"w": "augmented", "b": [0.6485, 0.1677, 0.7592, 0.1874]}, {"w": "with", "b": [0.7655, 0.1677, 0.8104, 0.1874]}, {"w": "a", "b": [0.8167, 0.1677, 0.8279, 0.1874]}, {"w": "rich", "b": [0.1294, 0.1882, 0.1686, 0.2079]}, {"w": "set", "b": [0.1749, 0.1882, 0.203, 0.2079]}, {"w": "of", "b": [0.2093, 0.1882, 0.2303, 0.2079]}, {"w": "algorithmic", "b": [0.2366, 0.1882, 0.3529, 0.2079]}, {"w": "primitives,", "b": [0.3592, 0.1882, 0.4678, 0.2079]}, {"w": "such", "b": [0.4741, 0.1882, 0.5203, 0.2079]}, {"w": "as", "b": [0.5266, 0.1882, 0.5476, 0.2079]}, {"w": "for", "b": [0.5539, 0.1892, 0.5993, 0.2094]}, {"w": "loops", "b": [0.6056, 0.1882, 0.6603, 0.2079]}, {"w": "and", "b": [0.6666, 0.1882, 0.703, 0.2079]}, {"w": "many", "b": [0.7093, 0.1882, 0.7654, 0.2079]}, {"w": "others", "b": [0.7717, 0.1882, 0.8334, 0.2079]}, {"w": "(see", "b": [0.1294, 0.2096, 0.17, 0.2293]}, {"w": "figure", "b": [0.1763, 0.2096, 0.2366, 0.2293]}, {"w": "9.5).", "b": [0.2429, 0.2096, 0.2891, 0.2293]}, {"w": "This", "b": [0.2954, 0.2096, 0.3402, 0.2293]}, {"w": "should", "b": [0.3466, 0.2096, 0.4138, 0.2293]}, {"w": "be", "b": [0.4201, 0.2096, 0.4439, 0.2293]}, {"w": "far", "b": [0.4503, 0.2096, 0.4783, 0.2293]}, {"w": "more", "b": [0.4846, 0.2096, 0.5364, 0.2293]}, {"w": "tractable", "b": [0.5427, 0.2096, 0.6296, 0.2293]}, {"w": "and", "b": [0.6359, 0.2096, 0.6723, 0.2293]}, {"w": "useful", "b": [0.6786, 0.2096, 0.7403, 0.2293]}, {"w": "than", "b": [0.7466, 0.2096, 0.79, 0.2293]}, {"w": "directly", "b": [0.1294, 0.2301, 0.2065, 0.2498]}, {"w": "generating", "b": [0.2128, 0.2301, 0.3193, 0.2498]}, {"w": "source", "b": [0.3256, 0.2301, 0.3914, 0.2498]}, {"w": "code,", "b": [0.3977, 0.2301, 0.4516, 0.2498]}, {"w": "and", "b": [0.458, 0.2301, 0.4944, 0.2498]}, {"w": "it", "b": [0.5007, 0.2301, 0.5147, 0.2498]}, {"w": "will", "b": [0.521, 0.2301, 0.5603, 0.2498]}, {"w": "dramatically", "b": [0.5666, 0.2301, 0.6927, 0.2498]}, {"w": "expand", "b": [0.699, 0.2301, 0.7718, 0.2498]}, {"w": "the", "b": [0.7781, 0.2301, 0.809, 0.2498]}, {"w": "scope", "b": [0.1294, 0.2506, 0.1869, 0.2703]}, {"w": "of", "b": [0.1932, 0.2506, 0.2142, 0.2703]}, {"w": "problems", "b": [0.2205, 0.2506, 0.3144, 0.2703]}, {"w": "that", "b": [0.3207, 0.2506, 0.3585, 0.2703]}, {"w": "can", "b": [0.3648, 0.2506, 0.3998, 0.2703]}, {"w": "be", "b": [0.4061, 0.2506, 0.43, 0.2703]}, {"w": "solved", "b": [0.4363, 0.2506, 0.5021, 0.2703]}, {"w": "with", "b": [0.5084, 0.2506, 0.5533, 0.2703]}, {"w": "machine", "b": [0.5596, 0.2506, 0.6451, 0.2703]}, {"w": "learning—the", "b": [0.6514, 0.2506, 0.7901, 0.2703]}, {"w": "space", "b": [0.7964, 0.2506, 0.8524, 0.2703]}, {"w": "of", "b": [0.1294, 0.2711, 0.1504, 0.2908]}, {"w": "programs", "b": [0.1567, 0.2711, 0.252, 0.2908]}, {"w": "that", "b": [0.2583, 0.2711, 0.2962, 0.2908]}, {"w": "we", "b": [0.3025, 0.2711, 0.3319, 0.2908]}, {"w": "can", "b": [0.3382, 0.2711, 0.3732, 0.2908]}, {"w": "generate", "b": [0.3795, 0.2711, 0.4649, 0.2908]}, {"w": "automatically,", "b": [0.4712, 0.2711, 0.6132, 0.2908]}, {"w": "given", "b": [0.6195, 0.2711, 0.6755, 0.2908]}, {"w": "appropriate", "b": [0.6818, 0.2711, 0.7967, 0.2908]}, {"w": "training", "b": [0.1294, 0.2916, 0.2079, 0.3113]}, {"w": "data.", "b": [0.2142, 0.2916, 0.2625, 0.3113]}, {"w": "Contemporary", "b": [0.2688, 0.2916, 0.4146, 0.3113]}, {"w": "RNNs", "b": [0.4209, 0.2916, 0.4839, 0.3113]}, {"w": "can", "b": [0.4902, 0.2916, 0.5253, 0.3113]}, {"w": "be", "b": [0.5316, 0.2916, 0.5554, 0.3113]}, {"w": "seen", "b": [0.5617, 0.2916, 0.6065, 0.3113]}, {"w": "as", "b": [0.6128, 0.2916, 0.6338, 0.3113]}, {"w": "a", "b": [0.6401, 0.2916, 0.6513, 0.3113]}, {"w": "prehistoric", "b": [0.6576, 0.2916, 0.7655, 0.3113]}, {"w": "ancestor", "b": [0.7718, 0.2916, 0.8559, 0.3113]}, {"w": "of", "b": [0.1294, 0.3121, 0.1504, 0.3318]}, {"w": "such", "b": [0.1567, 0.3121, 0.203, 0.3318]}, {"w": "hybrid", "b": [0.2093, 0.3121, 0.2751, 0.3318]}, {"w": "algorithmic-geometric", "b": [0.2814, 0.3121, 0.507, 0.3318]}, {"w": "models.", "b": [0.5133, 0.3121, 0.5925, 0.3318]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 9.5. A learned program relying on both geometric primitives (pattern recognition, intuition) and algorithmic primitives (reasoning, search, memory)", "words": [{"w": "Figure", "b": [0.1294, 0.3544, 0.1827, 0.3692]}, {"w": "9.5.", "b": [0.1874, 0.3544, 0.2158, 0.3692]}, {"w": "A", "b": [0.2205, 0.3544, 0.2341, 0.3692]}, {"w": "learned", "b": [0.2389, 0.3544, 0.2998, 0.3692]}, {"w": "program", "b": [0.3046, 0.3544, 0.3757, 0.3692]}, {"w": "relying", "b": [0.3804, 0.3544, 0.4368, 0.3692]}, {"w": "on", "b": [0.4415, 0.3544, 0.4615, 0.3692]}, {"w": "both", "b": [0.4663, 0.3544, 0.503, 0.3692]}, {"w": "geometric", "b": [0.5078, 0.3544, 0.5876, 0.3692]}, {"w": "primitives", "b": [0.5923, 0.3544, 0.6743, 0.3692]}, {"w": "(pattern", "b": [0.6791, 0.3544, 0.7453, 0.3692]}, {"w": "recognition,", "b": [0.75, 0.3544, 0.8458, 0.3692]}, {"w": "intuition)", "b": [0.1294, 0.3695, 0.2051, 0.3843]}, {"w": "and", "b": [0.2098, 0.3695, 0.2403, 0.3843]}, {"w": "algorithmic", "b": [0.2451, 0.3695, 0.3386, 0.3843]}, {"w": "primitives", "b": [0.3433, 0.3695, 0.4253, 0.3843]}, {"w": "(reasoning,", "b": [0.43, 0.3695, 0.5195, 0.3843]}, {"w": "search,", "b": [0.5243, 0.3695, 0.5812, 0.3843]}, {"w": "memory)", "b": [0.5859, 0.3695, 0.6595, 0.3843]}]}, {"id": "b_2", "type": "paragraph", "text": "9.3.2. Beyond backpropagation and differentiable layers", "words": [{"w": "9.3.2.", "b": [0.1294, 0.5643, 0.1862, 0.5841]}, {"w": "Beyond", "b": [0.1925, 0.5643, 0.2738, 0.5841]}, {"w": "backpropagation", "b": [0.2801, 0.5643, 0.4633, 0.5841]}, {"w": "and", "b": [0.4696, 0.5643, 0.5102, 0.5841]}, {"w": "differentiable", "b": [0.5165, 0.5643, 0.6618, 0.5841]}, {"w": "layers", "b": [0.6681, 0.5643, 0.7326, 0.5841]}]}, {"id": "b_3", "type": "paragraph", "text": "If machine-learning models become more like programs, then they will mostly no longer be differentiable—these programs will still use continuous geometric layers as subroutines, which will be differentiable, but the model as a whole won’t be. As a result, using backpropagation to adjust weight values in a fixed, hardcoded network can’t be the method of choice for training models in the future—at least, it can’t be the entire story. We need to figure out how to train non-differentiable systems efficiently. Current approaches include genetic algorithms, evolution strategies, certain reinforcement-learning methods, and alternating direction method of multipliers (ADMM). Naturally, gradient descent isn’t going anywhere; gradient information will always be useful for optimizing differentiable parametric functions. But our models will become increasingly more ambitious than mere differentiable parametric functions, and thus their automatic development (the learning in machine learning) will require more than backpropagation.", "words": [{"w": "If", "b": [0.1294, 0.6071, 0.1462, 0.6268]}, {"w": "machine-learning", "b": [0.1525, 0.6071, 0.329, 0.6268]}, {"w": "models", "b": [0.3354, 0.6071, 0.4082, 0.6268]}, {"w": "become", "b": [0.4145, 0.6071, 0.493, 0.6268]}, {"w": "more", "b": [0.4993, 0.6071, 0.5511, 0.6268]}, {"w": "like", "b": [0.5574, 0.6071, 0.5953, 0.6268]}, {"w": "programs,", "b": [0.6016, 0.6071, 0.7032, 0.6268]}, {"w": "then", "b": [0.7095, 0.6071, 0.7529, 0.6268]}, {"w": "they", "b": [0.7592, 0.6071, 0.8027, 0.6268]}, {"w": "will", "b": [0.809, 0.6071, 0.8482, 0.6268]}, {"w": "mostly", "b": [0.1294, 0.6276, 0.1981, 0.6473]}, {"w": "no", "b": [0.2044, 0.6276, 0.2296, 0.6473]}, {"w": "longer", "b": [0.2359, 0.6276, 0.3004, 0.6473]}, {"w": "be", "b": [0.3067, 0.6276, 0.3305, 0.6473]}, {"w": "differentiable—these", "b": [0.3368, 0.6276, 0.5493, 0.6473]}, {"w": "programs", "b": [0.5556, 0.6276, 0.6509, 0.6473]}, {"w": "will", "b": [0.6572, 0.6276, 0.6964, 0.6473]}, {"w": "still", "b": [0.7027, 0.6276, 0.7406, 0.6473]}, {"w": "use", "b": [0.7469, 0.6276, 0.7805, 0.6473]}, {"w": "continuous", "b": [0.1294, 0.6481, 0.2401, 0.6678]}, {"w": "geometric", "b": [0.2464, 0.6481, 0.3473, 0.6678]}, {"w": "layers", "b": [0.3536, 0.6481, 0.4139, 0.6678]}, {"w": "as", "b": [0.4202, 0.6481, 0.4412, 0.6678]}, {"w": "subroutines,", "b": [0.4475, 0.6481, 0.5701, 0.6678]}, {"w": "which", "b": [0.5764, 0.6481, 0.6381, 0.6678]}, {"w": "will", "b": [0.6444, 0.6481, 0.6836, 0.6678]}, {"w": "be", "b": [0.6899, 0.6481, 0.7137, 0.6678]}, {"w": "differentiable,", "b": [0.72, 0.6481, 0.8617, 0.6678]}, {"w": "but", "b": [0.1294, 0.6686, 0.1617, 0.6883]}, {"w": "the", "b": [0.168, 0.6686, 0.1988, 0.6883]}, {"w": "model", "b": [0.2051, 0.6686, 0.2682, 0.6883]}, {"w": "as", "b": [0.2745, 0.6686, 0.2955, 0.6883]}, {"w": "a", "b": [0.3018, 0.6686, 0.313, 0.6883]}, {"w": "whole", "b": [0.3193, 0.6686, 0.3809, 0.6883]}, {"w": "won’t", "b": [0.3872, 0.6686, 0.4456, 0.6883]}, {"w": "be.", "b": [0.4519, 0.6686, 0.482, 0.6883]}, {"w": "As", "b": [0.4883, 0.6686, 0.5164, 0.6883]}, {"w": "a", "b": [0.5227, 0.6686, 0.5339, 0.6883]}, {"w": "result,", "b": [0.5402, 0.6686, 0.6025, 0.6883]}, {"w": "using", "b": [0.6088, 0.6686, 0.6635, 0.6883]}, {"w": "backpropagation", "b": [0.6698, 0.6686, 0.8379, 0.6883]}, {"w": "to", "b": [0.8443, 0.6686, 0.8639, 0.6883]}, {"w": "adjust", "b": [0.1294, 0.6891, 0.1897, 0.7088]}, {"w": "weight", "b": [0.196, 0.6891, 0.2646, 0.7088]}, {"w": "values", "b": [0.271, 0.6891, 0.3354, 0.7088]}, {"w": "in", "b": [0.3417, 0.6891, 0.3613, 0.7088]}, {"w": "a", "b": [0.3676, 0.6891, 0.3788, 0.7088]}, {"w": "fixed,", "b": [0.3852, 0.6891, 0.4433, 0.7088]}, {"w": "hardcoded", "b": [0.4496, 0.6891, 0.5547, 0.7088]}, {"w": "network", "b": [0.561, 0.6891, 0.6436, 0.7088]}, {"w": "can’t", "b": [0.6499, 0.6891, 0.6999, 0.7088]}, {"w": "be", "b": [0.7062, 0.6891, 0.73, 0.7088]}, {"w": "the", "b": [0.7363, 0.6891, 0.7671, 0.7088]}, {"w": "method", "b": [0.7734, 0.6891, 0.8491, 0.7088]}, {"w": "of", "b": [0.1294, 0.7096, 0.1504, 0.7293]}, {"w": "choice", "b": [0.1567, 0.7096, 0.2226, 0.7293]}, {"w": "for", "b": [0.2289, 0.7096, 0.2583, 0.7293]}, {"w": "training", "b": [0.2646, 0.7096, 0.3431, 0.7293]}, {"w": "models", "b": [0.3493, 0.7096, 0.4222, 0.7293]}, {"w": "in", "b": [0.4285, 0.7096, 0.4482, 0.7293]}, {"w": "the", "b": [0.4545, 0.7096, 0.4853, 0.7293]}, {"w": "future—at", "b": [0.4916, 0.7096, 0.5953, 0.7293]}, {"w": "least,", "b": [0.6016, 0.7096, 0.6541, 0.7293]}, {"w": "it", "b": [0.6604, 0.7096, 0.6745, 0.7293]}, {"w": "can’t", "b": [0.6808, 0.7096, 0.7307, 0.7293]}, {"w": "be", "b": [0.737, 0.7096, 0.7608, 0.7293]}, {"w": "the", "b": [0.7671, 0.7096, 0.7979, 0.7293]}, {"w": "entire", "b": [0.8042, 0.7096, 0.8617, 0.7293]}, {"w": "story.", "b": [0.1294, 0.7301, 0.1845, 0.7498]}, {"w": "We", "b": [0.1908, 0.7301, 0.2238, 0.7498]}, {"w": "need", "b": [0.2301, 0.7301, 0.2778, 0.7498]}, {"w": "to", "b": [0.2841, 0.7301, 0.3037, 0.7498]}, {"w": "figure", "b": [0.31, 0.7301, 0.3702, 0.7498]}, {"w": "out", "b": [0.3765, 0.7301, 0.4088, 0.7498]}, {"w": "how", "b": [0.4151, 0.7301, 0.4585, 0.7498]}, {"w": "to", "b": [0.4648, 0.7301, 0.4845, 0.7498]}, {"w": "train", "b": [0.4908, 0.7301, 0.537, 0.7498]}, {"w": "non-differentiable", "b": [0.5433, 0.7301, 0.7249, 0.7498]}, {"w": "systems", "b": [0.7312, 0.7301, 0.8111, 0.7498]}, {"w": "efficiently.", "b": [0.1294, 0.7506, 0.2373, 0.7703]}, {"w": "Current", "b": [0.2436, 0.7506, 0.3206, 0.7703]}, {"w": "approaches", "b": [0.327, 0.7506, 0.4404, 0.7703]}, {"w": "include", "b": [0.4467, 0.7506, 0.521, 0.7703]}, {"w": "genetic", "b": [0.5273, 0.7506, 0.6001, 0.7703]}, {"w": "algorithms,", "b": [0.6065, 0.7506, 0.7207, 0.7703]}, {"w": "evolution", "b": [0.727, 0.7506, 0.8223, 0.7703]}, {"w": "strategies,", "b": [0.1294, 0.7711, 0.231, 0.7908]}, {"w": "certain", "b": [0.2373, 0.7711, 0.3059, 0.7908]}, {"w": "reinforcement-learning", "b": [0.3122, 0.7711, 0.5448, 0.7908]}, {"w": "methods,", "b": [0.5511, 0.7711, 0.6429, 0.7908]}, {"w": "and", "b": [0.6491, 0.7711, 0.6855, 0.7908]}, {"w": "alternating", "b": [0.6919, 0.7711, 0.7997, 0.7908]}, {"w": "direction", "b": [0.1294, 0.7916, 0.2191, 0.8113]}, {"w": "method", "b": [0.2254, 0.7916, 0.3011, 0.8113]}, {"w": "of", "b": [0.3074, 0.7916, 0.3284, 0.8113]}, {"w": "multipliers", "b": [0.3347, 0.7916, 0.444, 0.8113]}, {"w": "(ADMM).", "b": [0.4503, 0.7916, 0.5547, 0.8113]}, {"w": "Naturally,", "b": [0.561, 0.7916, 0.6609, 0.8113]}, {"w": "gradient", "b": [0.6672, 0.7916, 0.7499, 0.8113]}, {"w": "descent", "b": [0.7562, 0.7916, 0.8318, 0.8113]}, {"w": "isn’t", "b": [0.1294, 0.8121, 0.1738, 0.8318]}, {"w": "going", "b": [0.1801, 0.8121, 0.2376, 0.8318]}, {"w": "anywhere;", "b": [0.2439, 0.8121, 0.349, 0.8318]}, {"w": "gradient", "b": [0.3553, 0.8121, 0.4379, 0.8318]}, {"w": "information", "b": [0.4442, 0.8121, 0.5633, 0.8318]}, {"w": "will", "b": [0.5696, 0.8121, 0.6088, 0.8318]}, {"w": "always", "b": [0.6151, 0.8121, 0.6852, 0.8318]}, {"w": "be", "b": [0.6915, 0.8121, 0.7153, 0.8318]}, {"w": "useful", "b": [0.7216, 0.8121, 0.7833, 0.8318]}, {"w": "for", "b": [0.7896, 0.8121, 0.819, 0.8318]}, {"w": "optimizing", "b": [0.1294, 0.8326, 0.2387, 0.8523]}, {"w": "differentiable", "b": [0.245, 0.8326, 0.3805, 0.8523]}, {"w": "parametric", "b": [0.3868, 0.8326, 0.4946, 0.8523]}, {"w": "functions.", "b": [0.5009, 0.8326, 0.6011, 0.8523]}, {"w": "But", "b": [0.6074, 0.8326, 0.6439, 0.8523]}, {"w": "our", "b": [0.6502, 0.8326, 0.6838, 0.8523]}, {"w": "models", "b": [0.6901, 0.8326, 0.763, 0.8523]}, {"w": "will", "b": [0.7693, 0.8326, 0.8086, 0.8523]}, {"w": "become", "b": [0.1294, 0.8531, 0.2079, 0.8728]}, {"w": "increasingly", "b": [0.2142, 0.8531, 0.3375, 0.8728]}, {"w": "more", "b": [0.3438, 0.8531, 0.3956, 0.8728]}, {"w": "ambitious", "b": [0.4019, 0.8531, 0.5014, 0.8728]}, {"w": "than", "b": [0.5077, 0.8531, 0.5511, 0.8728]}, {"w": "mere", "b": [0.5574, 0.8531, 0.6079, 0.8728]}, {"w": "differentiable", "b": [0.6142, 0.8531, 0.7496, 0.8728]}, {"w": "parametric", "b": [0.7559, 0.8531, 0.8637, 0.8728]}, {"w": "functions,", "b": [0.1294, 0.8736, 0.2296, 0.8933]}, {"w": "and", "b": [0.2359, 0.8736, 0.2723, 0.8933]}, {"w": "thus", "b": [0.2786, 0.8736, 0.3207, 0.8933]}, {"w": "their", "b": [0.327, 0.8736, 0.3732, 0.8933]}, {"w": "automatic", "b": [0.3796, 0.8736, 0.479, 0.8933]}, {"w": "development", "b": [0.4853, 0.8736, 0.6157, 0.8933]}, {"w": "(the", "b": [0.622, 0.8736, 0.6612, 0.8933]}, {"w": "learning", "b": [0.6674, 0.8736, 0.7529, 0.8933]}, {"w": "in", "b": [0.7592, 0.8736, 0.7788, 0.8933]}, {"w": "machine", "b": [0.7851, 0.8736, 0.8706, 0.8933]}, {"w": "learning)", "b": [0.1294, 0.8941, 0.2233, 0.9138]}, {"w": "will", "b": [0.2296, 0.8941, 0.2688, 0.9138]}, {"w": "require", "b": [0.2751, 0.8941, 0.3466, 0.9138]}, {"w": "more", "b": [0.3529, 0.8941, 0.4047, 0.9138]}, {"w": "than", "b": [0.411, 0.8941, 0.4545, 0.9138]}, {"w": "backpropagation.", "b": [0.4608, 0.8941, 0.6352, 0.9138]}]}]}, {"page": 433, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "In addition, backpropagation is end to end, which is a great thing for learning good chained transformations but is computationally inefficient because it doesn’t fully take advantage of the modularity of deep networks. To make something more efficient, there’s one universal recipe: introduce modularity and hierarchy. So we can make backpropagation more efficient by introducing decoupled training modules with a synchronization mechanism between them, organized in a hierarchical fashion. This strategy is somewhat reflected in DeepMind’s recent work on synthetic gradients. I expect more along these lines in the near future. I can imagine a future where models that are globally non-differentiable (but feature differentiable parts) are trained—grown—using an efficient search process that doesn’t use gradients, whereas the differentiable parts are trained even faster by taking advantage of gradients using a more efficient version of backpropagation.", "words": [{"w": "In", "b": [0.1294, 0.0857, 0.1504, 0.1054]}, {"w": "addition,", "b": [0.1567, 0.0857, 0.2457, 0.1054]}, {"w": "backpropagation", "b": [0.252, 0.0857, 0.4202, 0.1054]}, {"w": "is", "b": [0.4265, 0.0857, 0.4433, 0.1054]}, {"w": "end", "b": [0.4496, 0.0857, 0.486, 0.1054]}, {"w": "to", "b": [0.4923, 0.0857, 0.512, 0.1054]}, {"w": "end,", "b": [0.5183, 0.0857, 0.561, 0.1054]}, {"w": "which", "b": [0.5673, 0.0857, 0.629, 0.1054]}, {"w": "is", "b": [0.6353, 0.0857, 0.6521, 0.1054]}, {"w": "a", "b": [0.6584, 0.0857, 0.6696, 0.1054]}, {"w": "great", "b": [0.6759, 0.0857, 0.7263, 0.1054]}, {"w": "thing", "b": [0.7326, 0.0857, 0.7845, 0.1054]}, {"w": "for", "b": [0.7908, 0.0857, 0.8202, 0.1054]}, {"w": "learning", "b": [0.1294, 0.1062, 0.2121, 0.1259]}, {"w": "good", "b": [0.2184, 0.1062, 0.2688, 0.1259]}, {"w": "chained", "b": [0.2751, 0.1062, 0.3536, 0.1259]}, {"w": "transformations", "b": [0.3599, 0.1062, 0.5182, 0.1259]}, {"w": "but", "b": [0.5245, 0.1062, 0.5568, 0.1259]}, {"w": "is", "b": [0.5631, 0.1062, 0.5799, 0.1259]}, {"w": "computationally", "b": [0.5862, 0.1062, 0.7502, 0.1259]}, {"w": "inefficient", "b": [0.7564, 0.1062, 0.8596, 0.1259]}, {"w": "because", "b": [0.1294, 0.1267, 0.2093, 0.1464]}, {"w": "it", "b": [0.2156, 0.1267, 0.2296, 0.1464]}, {"w": "doesn’t", "b": [0.2359, 0.1267, 0.3097, 0.1464]}, {"w": "fully", "b": [0.316, 0.1267, 0.3636, 0.1464]}, {"w": "take", "b": [0.3699, 0.1267, 0.412, 0.1464]}, {"w": "advantage", "b": [0.4183, 0.1267, 0.5205, 0.1464]}, {"w": "of", "b": [0.5268, 0.1267, 0.5479, 0.1464]}, {"w": "the", "b": [0.5542, 0.1267, 0.585, 0.1464]}, {"w": "modularity", "b": [0.5913, 0.1267, 0.702, 0.1464]}, {"w": "of", "b": [0.7083, 0.1267, 0.7293, 0.1464]}, {"w": "deep", "b": [0.7356, 0.1267, 0.7833, 0.1464]}, {"w": "networks.", "b": [0.1294, 0.1472, 0.2282, 0.1669]}, {"w": "To", "b": [0.2345, 0.1472, 0.2608, 0.1669]}, {"w": "make", "b": [0.2671, 0.1472, 0.3217, 0.1669]}, {"w": "something", "b": [0.328, 0.1472, 0.4331, 0.1669]}, {"w": "more", "b": [0.4394, 0.1472, 0.4913, 0.1669]}, {"w": "efficient,", "b": [0.4976, 0.1472, 0.5874, 0.1669]}, {"w": "there’s", "b": [0.5937, 0.1472, 0.661, 0.1669]}, {"w": "one", "b": [0.6673, 0.1472, 0.7037, 0.1669]}, {"w": "universal", "b": [0.71, 0.1472, 0.8025, 0.1669]}, {"w": "recipe:", "b": [0.1294, 0.1677, 0.1981, 0.1874]}, {"w": "introduce", "b": [0.2044, 0.1677, 0.2996, 0.1874]}, {"w": "modularity", "b": [0.3059, 0.1677, 0.4167, 0.1874]}, {"w": "and", "b": [0.423, 0.1677, 0.4594, 0.1874]}, {"w": "hierarchy.", "b": [0.4657, 0.1677, 0.5655, 0.1874]}, {"w": "So", "b": [0.5718, 0.1677, 0.5985, 0.1874]}, {"w": "we", "b": [0.6048, 0.1677, 0.6342, 0.1874]}, {"w": "can", "b": [0.6405, 0.1677, 0.6755, 0.1874]}, {"w": "make", "b": [0.6818, 0.1677, 0.7365, 0.1874]}, {"w": "backpropagation", "b": [0.1294, 0.1882, 0.2975, 0.2079]}, {"w": "more", "b": [0.3038, 0.1882, 0.3557, 0.2079]}, {"w": "efficient", "b": [0.362, 0.1882, 0.4456, 0.2079]}, {"w": "by", "b": [0.4519, 0.1882, 0.4771, 0.2079]}, {"w": "introducing", "b": [0.4834, 0.1882, 0.5997, 0.2079]}, {"w": "decoupled", "b": [0.606, 0.1882, 0.7096, 0.2079]}, {"w": "training", "b": [0.7159, 0.1882, 0.7944, 0.2079]}, {"w": "modules", "b": [0.1294, 0.2087, 0.2149, 0.2284]}, {"w": "with", "b": [0.2212, 0.2087, 0.2661, 0.2284]}, {"w": "a", "b": [0.2724, 0.2087, 0.2836, 0.2284]}, {"w": "synchronization", "b": [0.2899, 0.2087, 0.451, 0.2284]}, {"w": "mechanism", "b": [0.4573, 0.2087, 0.5722, 0.2284]}, {"w": "between", "b": [0.5785, 0.2087, 0.6626, 0.2284]}, {"w": "them,", "b": [0.6689, 0.2087, 0.7256, 0.2284]}, {"w": "organized", "b": [0.732, 0.2087, 0.8309, 0.2284]}, {"w": "in", "b": [0.8372, 0.2087, 0.8568, 0.2284]}, {"w": "a", "b": [0.1294, 0.2292, 0.1406, 0.2489]}, {"w": "hierarchical", "b": [0.1469, 0.2292, 0.266, 0.2489]}, {"w": "fashion.", "b": [0.2723, 0.2292, 0.3529, 0.2489]}, {"w": "This", "b": [0.3592, 0.2292, 0.404, 0.2489]}, {"w": "strategy", "b": [0.4103, 0.2292, 0.4902, 0.2489]}, {"w": "is", "b": [0.4964, 0.2292, 0.5133, 0.2489]}, {"w": "somewhat", "b": [0.5196, 0.2292, 0.6218, 0.2489]}, {"w": "reflected", "b": [0.6282, 0.2292, 0.7164, 0.2489]}, {"w": "in", "b": [0.7227, 0.2292, 0.7423, 0.2489]}, {"w": "DeepMind’s", "b": [0.1294, 0.2497, 0.2541, 0.2694]}, {"w": "recent", "b": [0.2604, 0.2497, 0.3221, 0.2694]}, {"w": "work", "b": [0.3284, 0.2497, 0.3802, 0.2694]}, {"w": "on", "b": [0.3865, 0.2497, 0.4117, 0.2694]}, {"w": "synthetic", "b": [0.418, 0.2497, 0.5091, 0.2694]}, {"w": "gradients.", "b": [0.5154, 0.2497, 0.6142, 0.2694]}, {"w": "I", "b": [0.6205, 0.2497, 0.6289, 0.2694]}, {"w": "expect", "b": [0.6352, 0.2497, 0.7011, 0.2694]}, {"w": "more", "b": [0.7074, 0.2497, 0.7592, 0.2694]}, {"w": "along", "b": [0.7655, 0.2497, 0.8216, 0.2694]}, {"w": "these", "b": [0.1294, 0.2702, 0.1813, 0.2899]}, {"w": "lines", "b": [0.1876, 0.2702, 0.2352, 0.2899]}, {"w": "in", "b": [0.2415, 0.2702, 0.2611, 0.2899]}, {"w": "the", "b": [0.2674, 0.2702, 0.2983, 0.2899]}, {"w": "near", "b": [0.3046, 0.2702, 0.348, 0.2899]}, {"w": "future.", "b": [0.3543, 0.2702, 0.4208, 0.2899]}, {"w": "I", "b": [0.4271, 0.2702, 0.4355, 0.2899]}, {"w": "can", "b": [0.4418, 0.2702, 0.4768, 0.2899]}, {"w": "imagine", "b": [0.4831, 0.2702, 0.5644, 0.2899]}, {"w": "a", "b": [0.5707, 0.2702, 0.5819, 0.2899]}, {"w": "future", "b": [0.5882, 0.2702, 0.6485, 0.2899]}, {"w": "where", "b": [0.6548, 0.2702, 0.7164, 0.2899]}, {"w": "models", "b": [0.7227, 0.2702, 0.7956, 0.2899]}, {"w": "that", "b": [0.8019, 0.2702, 0.8397, 0.2899]}, {"w": "are", "b": [0.1294, 0.2907, 0.1602, 0.3104]}, {"w": "globally", "b": [0.1665, 0.2907, 0.2492, 0.3104]}, {"w": "non-differentiable", "b": [0.2555, 0.2907, 0.4372, 0.3104]}, {"w": "(but", "b": [0.4435, 0.2907, 0.4841, 0.3104]}, {"w": "feature", "b": [0.4904, 0.2907, 0.5604, 0.3104]}, {"w": "differentiable", "b": [0.5667, 0.2907, 0.7021, 0.3104]}, {"w": "parts)", "b": [0.7084, 0.2907, 0.7659, 0.3104]}, {"w": "are", "b": [0.7722, 0.2907, 0.803, 0.3104]}, {"w": "trained—grown—using", "b": [0.1294, 0.3112, 0.369, 0.3309]}, {"w": "an", "b": [0.3753, 0.3112, 0.3991, 0.3309]}, {"w": "efficient", "b": [0.4054, 0.3112, 0.489, 0.3309]}, {"w": "search", "b": [0.4953, 0.3112, 0.5598, 0.3309]}, {"w": "process", "b": [0.5661, 0.3112, 0.6417, 0.3309]}, {"w": "that", "b": [0.648, 0.3112, 0.6859, 0.3309]}, {"w": "doesn’t", "b": [0.6922, 0.3112, 0.7659, 0.3309]}, {"w": "use", "b": [0.7723, 0.3112, 0.8059, 0.3309]}, {"w": "gradients,", "b": [0.1294, 0.3317, 0.2282, 0.3514]}, {"w": "whereas", "b": [0.2345, 0.3317, 0.3171, 0.3514]}, {"w": "the", "b": [0.3234, 0.3317, 0.3543, 0.3514]}, {"w": "differentiable", "b": [0.3606, 0.3317, 0.496, 0.3514]}, {"w": "parts", "b": [0.5023, 0.3317, 0.5513, 0.3514]}, {"w": "are", "b": [0.5576, 0.3317, 0.5884, 0.3514]}, {"w": "trained", "b": [0.5947, 0.3317, 0.6648, 0.3514]}, {"w": "even", "b": [0.6711, 0.3317, 0.7187, 0.3514]}, {"w": "faster", "b": [0.725, 0.3317, 0.7811, 0.3514]}, {"w": "by", "b": [0.7874, 0.3317, 0.8126, 0.3514]}, {"w": "taking", "b": [0.1294, 0.3522, 0.1925, 0.3719]}, {"w": "advantage", "b": [0.1988, 0.3522, 0.301, 0.3719]}, {"w": "of", "b": [0.3073, 0.3522, 0.3283, 0.3719]}, {"w": "gradients", "b": [0.3347, 0.3522, 0.4271, 0.3719]}, {"w": "using", "b": [0.4334, 0.3522, 0.4881, 0.3719]}, {"w": "a", "b": [0.4944, 0.3522, 0.5056, 0.3719]}, {"w": "more", "b": [0.5119, 0.3522, 0.5638, 0.3719]}, {"w": "efficient", "b": [0.5701, 0.3522, 0.6536, 0.3719]}, {"w": "version", "b": [0.6599, 0.3522, 0.7342, 0.3719]}, {"w": "of", "b": [0.7405, 0.3522, 0.7615, 0.3719]}, {"w": "backpropagation.", "b": [0.1294, 0.3727, 0.3038, 0.3924]}]}, {"id": "b_1", "type": "paragraph", "text": "9.3.3. Automated machine learning", "words": [{"w": "9.3.3.", "b": [0.1294, 0.4199, 0.1862, 0.4397]}, {"w": "Automated", "b": [0.1925, 0.4199, 0.313, 0.4397]}, {"w": "machine", "b": [0.3193, 0.4199, 0.4104, 0.4397]}, {"w": "learning", "b": [0.4167, 0.4199, 0.5064, 0.4397]}]}, {"id": "b_2", "type": "paragraph", "text": "In the future, model architectures will be learned rather than be handcrafted by engineer-artisans. Learning architectures goes hand in hand with the use of richer sets of primitives and program-like machine- learning models.", "words": [{"w": "In", "b": [0.1294, 0.4627, 0.1504, 0.4824]}, {"w": "the", "b": [0.1567, 0.4627, 0.1876, 0.4824]}, {"w": "future,", "b": [0.1939, 0.4627, 0.2604, 0.4824]}, {"w": "model", "b": [0.2667, 0.4627, 0.3298, 0.4824]}, {"w": "architectures", "b": [0.3361, 0.4627, 0.465, 0.4824]}, {"w": "will", "b": [0.4713, 0.4627, 0.5105, 0.4824]}, {"w": "be", "b": [0.5168, 0.4627, 0.5406, 0.4824]}, {"w": "learned", "b": [0.5469, 0.4627, 0.6212, 0.4824]}, {"w": "rather", "b": [0.6275, 0.4627, 0.6863, 0.4824]}, {"w": "than", "b": [0.6926, 0.4627, 0.7361, 0.4824]}, {"w": "be", "b": [0.7424, 0.4627, 0.7662, 0.4824]}, {"w": "handcrafted", "b": [0.1294, 0.4832, 0.2485, 0.5029]}, {"w": "by", "b": [0.2548, 0.4832, 0.28, 0.5029]}, {"w": "engineer-artisans.", "b": [0.2863, 0.4832, 0.4644, 0.5029]}, {"w": "Learning", "b": [0.4707, 0.4832, 0.5618, 0.5029]}, {"w": "architectures", "b": [0.5681, 0.4832, 0.697, 0.5029]}, {"w": "goes", "b": [0.7032, 0.4832, 0.7494, 0.5029]}, {"w": "hand", "b": [0.7557, 0.4832, 0.8048, 0.5029]}, {"w": "in", "b": [0.8111, 0.4832, 0.8307, 0.5029]}, {"w": "hand", "b": [0.1294, 0.5037, 0.1785, 0.5234]}, {"w": "with", "b": [0.1848, 0.5037, 0.2296, 0.5234]}, {"w": "the", "b": [0.2359, 0.5037, 0.2667, 0.5234]}, {"w": "use", "b": [0.273, 0.5037, 0.3067, 0.5234]}, {"w": "of", "b": [0.313, 0.5037, 0.334, 0.5234]}, {"w": "richer", "b": [0.3403, 0.5037, 0.3991, 0.5234]}, {"w": "sets", "b": [0.4054, 0.5037, 0.4433, 0.5234]}, {"w": "of", "b": [0.4496, 0.5037, 0.4706, 0.5234]}, {"w": "primitives", "b": [0.4769, 0.5037, 0.5792, 0.5234]}, {"w": "and", "b": [0.5855, 0.5037, 0.6219, 0.5234]}, {"w": "program-like", "b": [0.6283, 0.5037, 0.76, 0.5234]}, {"w": "machine-", "b": [0.7663, 0.5037, 0.8601, 0.5234]}, {"w": "learning", "b": [0.1294, 0.5242, 0.2121, 0.5439]}, {"w": "models.", "b": [0.2184, 0.5242, 0.2976, 0.5439]}]}, {"id": "b_3", "type": "paragraph", "text": "Currently, most of the job of a deep-learning engineer consists of munging data with Python scripts and then tuning the architecture and hyperparameters of a deep network at length to get a working model—or even to get a state-of-the-art model, if the engineer is that ambitious. Needless to say, that isn’t an optimal setup. But AI can help. Unfortunately, the data-munging part is tough to automate, because it often requires domain knowledge as well as a clear, high-level understanding of what the engineer wants to achieve. Hyperparameter tuning, however, is a simple search procedure; and in that case we know what the engineer wants to achieve: it’s defined by the loss function of the network being tuned. It’s already common practice to set up basic AutoML systems that take care of most model knob tuning. I even set up my own, years ago, to win Kaggle competitions.", "words": [{"w": "Currently,", "b": [0.1294, 0.567, 0.2308, 0.5867]}, {"w": "most", "b": [0.2371, 0.567, 0.2861, 0.5867]}, {"w": "of", "b": [0.2924, 0.567, 0.3134, 0.5867]}, {"w": "the", "b": [0.3198, 0.567, 0.3506, 0.5867]}, {"w": "job", "b": [0.3569, 0.567, 0.3891, 0.5867]}, {"w": "of", "b": [0.3954, 0.567, 0.4164, 0.5867]}, {"w": "a", "b": [0.4228, 0.567, 0.434, 0.5867]}, {"w": "deep-learning", "b": [0.4403, 0.567, 0.5789, 0.5867]}, {"w": "engineer", "b": [0.5853, 0.567, 0.6721, 0.5867]}, {"w": "consists", "b": [0.6784, 0.567, 0.7583, 0.5867]}, {"w": "of", "b": [0.7646, 0.567, 0.7856, 0.5867]}, {"w": "munging", "b": [0.1294, 0.5875, 0.2191, 0.6072]}, {"w": "data", "b": [0.2254, 0.5875, 0.2674, 0.6072]}, {"w": "with", "b": [0.2738, 0.5875, 0.3186, 0.6072]}, {"w": "Python", "b": [0.3249, 0.5875, 0.3964, 0.6072]}, {"w": "scripts", "b": [0.4027, 0.5875, 0.4686, 0.6072]}, {"w": "and", "b": [0.4749, 0.5875, 0.5113, 0.6072]}, {"w": "then", "b": [0.5176, 0.5875, 0.5611, 0.6072]}, {"w": "tuning", "b": [0.5674, 0.5875, 0.6318, 0.6072]}, {"w": "the", "b": [0.6381, 0.5875, 0.669, 0.6072]}, {"w": "architecture", "b": [0.6753, 0.5875, 0.7943, 0.6072]}, {"w": "and", "b": [0.8006, 0.5875, 0.837, 0.6072]}, {"w": "hyperparameters", "b": [0.1294, 0.608, 0.2975, 0.6277]}, {"w": "of", "b": [0.3038, 0.608, 0.3248, 0.6277]}, {"w": "a", "b": [0.3311, 0.608, 0.3423, 0.6277]}, {"w": "deep", "b": [0.3486, 0.608, 0.3963, 0.6277]}, {"w": "network", "b": [0.4026, 0.608, 0.4852, 0.6277]}, {"w": "at", "b": [0.4916, 0.608, 0.5098, 0.6277]}, {"w": "length", "b": [0.5161, 0.608, 0.5791, 0.6277]}, {"w": "to", "b": [0.5854, 0.608, 0.6051, 0.6277]}, {"w": "get", "b": [0.6114, 0.608, 0.6422, 0.6277]}, {"w": "a", "b": [0.6485, 0.608, 0.6597, 0.6277]}, {"w": "working", "b": [0.666, 0.608, 0.7501, 0.6277]}, {"w": "model—or", "b": [0.7564, 0.608, 0.8657, 0.6277]}, {"w": "even", "b": [0.1294, 0.6285, 0.177, 0.6482]}, {"w": "to", "b": [0.1833, 0.6285, 0.203, 0.6482]}, {"w": "get", "b": [0.2093, 0.6285, 0.2401, 0.6482]}, {"w": "a", "b": [0.2464, 0.6285, 0.2576, 0.6482]}, {"w": "state-of-the-art", "b": [0.2639, 0.6285, 0.4138, 0.6482]}, {"w": "model,", "b": [0.4201, 0.6285, 0.4895, 0.6482]}, {"w": "if", "b": [0.4958, 0.6285, 0.5112, 0.6482]}, {"w": "the", "b": [0.5175, 0.6285, 0.5483, 0.6482]}, {"w": "engineer", "b": [0.5546, 0.6285, 0.6415, 0.6482]}, {"w": "is", "b": [0.6477, 0.6285, 0.6645, 0.6482]}, {"w": "that", "b": [0.6708, 0.6285, 0.7087, 0.6482]}, {"w": "ambitious.", "b": [0.715, 0.6285, 0.8208, 0.6482]}, {"w": "Needless", "b": [0.1294, 0.649, 0.2205, 0.6687]}, {"w": "to", "b": [0.2268, 0.649, 0.2464, 0.6687]}, {"w": "say,", "b": [0.2527, 0.649, 0.291, 0.6687]}, {"w": "that", "b": [0.2973, 0.649, 0.3351, 0.6687]}, {"w": "isn’t", "b": [0.3415, 0.649, 0.3858, 0.6687]}, {"w": "an", "b": [0.3921, 0.649, 0.416, 0.6687]}, {"w": "optimal", "b": [0.4223, 0.649, 0.4994, 0.6687]}, {"w": "setup.", "b": [0.5057, 0.649, 0.5652, 0.6687]}, {"w": "But", "b": [0.5715, 0.649, 0.608, 0.6687]}, {"w": "AI", "b": [0.6143, 0.649, 0.6409, 0.6687]}, {"w": "can", "b": [0.6472, 0.649, 0.6822, 0.6687]}, {"w": "help.", "b": [0.6885, 0.649, 0.7383, 0.6687]}, {"w": "Unfortunately,", "b": [0.1294, 0.6695, 0.2756, 0.6892]}, {"w": "the", "b": [0.2819, 0.6695, 0.3127, 0.6892]}, {"w": "data-munging", "b": [0.319, 0.6695, 0.4591, 0.6892]}, {"w": "part", "b": [0.4655, 0.6695, 0.5047, 0.6892]}, {"w": "is", "b": [0.511, 0.6695, 0.5278, 0.6892]}, {"w": "tough", "b": [0.5341, 0.6695, 0.5915, 0.6892]}, {"w": "to", "b": [0.5978, 0.6695, 0.6175, 0.6892]}, {"w": "automate,", "b": [0.6238, 0.6695, 0.7226, 0.6892]}, {"w": "because", "b": [0.7289, 0.6695, 0.8087, 0.6892]}, {"w": "it", "b": [0.815, 0.6695, 0.829, 0.6892]}, {"w": "often", "b": [0.1294, 0.69, 0.1813, 0.7097]}, {"w": "requires", "b": [0.1876, 0.69, 0.2688, 0.7097]}, {"w": "domain", "b": [0.2751, 0.69, 0.3508, 0.7097]}, {"w": "knowledge", "b": [0.3571, 0.69, 0.4678, 0.7097]}, {"w": "as", "b": [0.4741, 0.69, 0.4951, 0.7097]}, {"w": "well", "b": [0.5014, 0.69, 0.5449, 0.7097]}, {"w": "as", "b": [0.5512, 0.69, 0.5722, 0.7097]}, {"w": "a", "b": [0.5785, 0.69, 0.5897, 0.7097]}, {"w": "clear,", "b": [0.596, 0.69, 0.6502, 0.7097]}, {"w": "high-level", "b": [0.6565, 0.69, 0.7588, 0.7097]}, {"w": "understanding", "b": [0.1294, 0.7105, 0.2723, 0.7302]}, {"w": "of", "b": [0.2786, 0.7105, 0.2997, 0.7302]}, {"w": "what", "b": [0.306, 0.7105, 0.355, 0.7302]}, {"w": "the", "b": [0.3613, 0.7105, 0.3921, 0.7302]}, {"w": "engineer", "b": [0.3984, 0.7105, 0.4853, 0.7302]}, {"w": "wants", "b": [0.4916, 0.7105, 0.5504, 0.7302]}, {"w": "to", "b": [0.5567, 0.7105, 0.5763, 0.7302]}, {"w": "achieve.", "b": [0.5826, 0.7105, 0.666, 0.7302]}, {"w": "Hyperparameter", "b": [0.6723, 0.7105, 0.8362, 0.7302]}, {"w": "tuning,", "b": [0.1294, 0.731, 0.2002, 0.7507]}, {"w": "however,", "b": [0.2065, 0.731, 0.2986, 0.7507]}, {"w": "is", "b": [0.3049, 0.731, 0.3218, 0.7507]}, {"w": "a", "b": [0.3281, 0.731, 0.3393, 0.7507]}, {"w": "simple", "b": [0.3456, 0.731, 0.4129, 0.7507]}, {"w": "search", "b": [0.4192, 0.731, 0.4836, 0.7507]}, {"w": "procedure;", "b": [0.4899, 0.731, 0.5978, 0.7507]}, {"w": "and", "b": [0.6041, 0.731, 0.6405, 0.7507]}, {"w": "in", "b": [0.6468, 0.731, 0.6664, 0.7507]}, {"w": "that", "b": [0.6727, 0.731, 0.7106, 0.7507]}, {"w": "case", "b": [0.7169, 0.731, 0.7603, 0.7507]}, {"w": "we", "b": [0.7666, 0.731, 0.796, 0.7507]}, {"w": "know", "b": [0.8023, 0.731, 0.8584, 0.7507]}, {"w": "what", "b": [0.1294, 0.7515, 0.1785, 0.7712]}, {"w": "the", "b": [0.1848, 0.7515, 0.2156, 0.7712]}, {"w": "engineer", "b": [0.2219, 0.7515, 0.3087, 0.7712]}, {"w": "wants", "b": [0.315, 0.7515, 0.3739, 0.7712]}, {"w": "to", "b": [0.3802, 0.7515, 0.3998, 0.7712]}, {"w": "achieve:", "b": [0.4061, 0.7515, 0.4902, 0.7712]}, {"w": "it’s", "b": [0.4965, 0.7515, 0.5273, 0.7712]}, {"w": "defined", "b": [0.5336, 0.7515, 0.6092, 0.7712]}, {"w": "by", "b": [0.6155, 0.7515, 0.6408, 0.7712]}, {"w": "the", "b": [0.6471, 0.7515, 0.6779, 0.7712]}, {"w": "loss", "b": [0.6842, 0.7515, 0.7235, 0.7712]}, {"w": "function", "b": [0.7298, 0.7515, 0.8138, 0.7712]}, {"w": "of", "b": [0.8201, 0.7515, 0.8412, 0.7712]}, {"w": "the", "b": [0.1294, 0.772, 0.1602, 0.7917]}, {"w": "network", "b": [0.1665, 0.772, 0.2492, 0.7917]}, {"w": "being", "b": [0.2555, 0.772, 0.3116, 0.7917]}, {"w": "tuned.", "b": [0.3179, 0.772, 0.3802, 0.7917]}, {"w": "It’s", "b": [0.3865, 0.772, 0.4187, 0.7917]}, {"w": "already", "b": [0.425, 0.772, 0.4993, 0.7917]}, {"w": "common", "b": [0.5056, 0.772, 0.5939, 0.7917]}, {"w": "practice", "b": [0.6002, 0.772, 0.68, 0.7917]}, {"w": "to", "b": [0.6863, 0.772, 0.706, 0.7917]}, {"w": "set", "b": [0.7123, 0.772, 0.7403, 0.7917]}, {"w": "up", "b": [0.7466, 0.772, 0.7718, 0.7917]}, {"w": "basic", "b": [0.7781, 0.772, 0.83, 0.7917]}, {"w": "AutoML", "b": [0.1294, 0.7925, 0.2121, 0.8122]}, {"w": "systems", "b": [0.2184, 0.7925, 0.2983, 0.8122]}, {"w": "that", "b": [0.3046, 0.7925, 0.3424, 0.8122]}, {"w": "take", "b": [0.3487, 0.7925, 0.3908, 0.8122]}, {"w": "care", "b": [0.3971, 0.7925, 0.4391, 0.8122]}, {"w": "of", "b": [0.4454, 0.7925, 0.4664, 0.8122]}, {"w": "most", "b": [0.4727, 0.7925, 0.5218, 0.8122]}, {"w": "model", "b": [0.5281, 0.7925, 0.5911, 0.8122]}, {"w": "knob", "b": [0.5974, 0.7925, 0.6479, 0.8122]}, {"w": "tuning.", "b": [0.6542, 0.7925, 0.725, 0.8122]}, {"w": "I", "b": [0.7313, 0.7925, 0.7397, 0.8122]}, {"w": "even", "b": [0.746, 0.7925, 0.7936, 0.8122]}, {"w": "set", "b": [0.7999, 0.7925, 0.8279, 0.8122]}, {"w": "up", "b": [0.8343, 0.7925, 0.8595, 0.8122]}, {"w": "my", "b": [0.1294, 0.813, 0.1617, 0.8327]}, {"w": "own,", "b": [0.168, 0.813, 0.2177, 0.8327]}, {"w": "years", "b": [0.224, 0.813, 0.2772, 0.8327]}, {"w": "ago,", "b": [0.2835, 0.813, 0.3263, 0.8327]}, {"w": "to", "b": [0.3326, 0.813, 0.3522, 0.8327]}, {"w": "win", "b": [0.3585, 0.813, 0.3964, 0.8327]}, {"w": "Kaggle", "b": [0.4027, 0.813, 0.4755, 0.8327]}, {"w": "competitions.", "b": [0.4818, 0.813, 0.6185, 0.8327]}]}, {"id": "b_4", "type": "paragraph", "text": "At the most basic level, such a system would tune the number of layers in a stack, their order, and the number of units or filters in each layer.", "words": [{"w": "At", "b": [0.1294, 0.8558, 0.1546, 0.8755]}, {"w": "the", "b": [0.1609, 0.8558, 0.1918, 0.8755]}, {"w": "most", "b": [0.1981, 0.8558, 0.2471, 0.8755]}, {"w": "basic", "b": [0.2534, 0.8558, 0.3053, 0.8755]}, {"w": "level,", "b": [0.3116, 0.8558, 0.3669, 0.8755]}, {"w": "such", "b": [0.3732, 0.8558, 0.4195, 0.8755]}, {"w": "a", "b": [0.4258, 0.8558, 0.437, 0.8755]}, {"w": "system", "b": [0.4433, 0.8558, 0.5134, 0.8755]}, {"w": "would", "b": [0.5197, 0.8558, 0.5827, 0.8755]}, {"w": "tune", "b": [0.5891, 0.8558, 0.6325, 0.8755]}, {"w": "the", "b": [0.6388, 0.8558, 0.6696, 0.8755]}, {"w": "number", "b": [0.6759, 0.8558, 0.753, 0.8755]}, {"w": "of", "b": [0.7593, 0.8558, 0.7803, 0.8755]}, {"w": "layers", "b": [0.7866, 0.8558, 0.8469, 0.8755]}, {"w": "in", "b": [0.1294, 0.8763, 0.149, 0.896]}, {"w": "a", "b": [0.1553, 0.8763, 0.1665, 0.896]}, {"w": "stack,", "b": [0.1729, 0.8763, 0.231, 0.896]}, {"w": "their", "b": [0.2373, 0.8763, 0.2835, 0.896]}, {"w": "order,", "b": [0.2898, 0.8763, 0.3483, 0.896]}, {"w": "and", "b": [0.3546, 0.8763, 0.3911, 0.896]}, {"w": "the", "b": [0.3974, 0.8763, 0.4282, 0.896]}, {"w": "number", "b": [0.4345, 0.8763, 0.5116, 0.896]}, {"w": "of", "b": [0.5179, 0.8763, 0.5389, 0.896]}, {"w": "units", "b": [0.5452, 0.8763, 0.5943, 0.896]}, {"w": "or", "b": [0.6006, 0.8763, 0.6216, 0.896]}, {"w": "filters", "b": [0.6279, 0.8763, 0.6867, 0.896]}, {"w": "in", "b": [0.693, 0.8763, 0.7126, 0.896]}, {"w": "each", "b": [0.7189, 0.8763, 0.7652, 0.896]}, {"w": "layer.", "b": [0.7715, 0.8763, 0.8268, 0.896]}]}]}, {"page": 434, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This is commonly done with libraries such as Hyperopt, which we discussed in chapter 7. But we can also be far more ambitious and attempt to learn an appropriate architecture from scratch, with as few constraints as possible: for instance, via reinforcement learning or genetic algorithms.", "words": [{"w": "This", "b": [0.1294, 0.0857, 0.1743, 0.1054]}, {"w": "is", "b": [0.1806, 0.0857, 0.1974, 0.1054]}, {"w": "commonly", "b": [0.2037, 0.0857, 0.3116, 0.1054]}, {"w": "done", "b": [0.3179, 0.0857, 0.367, 0.1054]}, {"w": "with", "b": [0.3733, 0.0857, 0.4181, 0.1054]}, {"w": "libraries", "b": [0.4244, 0.0857, 0.5071, 0.1054]}, {"w": "such", "b": [0.5134, 0.0857, 0.5596, 0.1054]}, {"w": "as", "b": [0.5659, 0.0857, 0.587, 0.1054]}, {"w": "Hyperopt,", "b": [0.5933, 0.0857, 0.6948, 0.1054]}, {"w": "which", "b": [0.7012, 0.0857, 0.7628, 0.1054]}, {"w": "we", "b": [0.7691, 0.0857, 0.7985, 0.1054]}, {"w": "discussed", "b": [0.1294, 0.1062, 0.2261, 0.1259]}, {"w": "in", "b": [0.2324, 0.1062, 0.252, 0.1259]}, {"w": "chapter", "b": [0.2583, 0.1062, 0.3326, 0.1259]}, {"w": "7.", "b": [0.3389, 0.1062, 0.3578, 0.1259]}, {"w": "But", "b": [0.3641, 0.1062, 0.4005, 0.1259]}, {"w": "we", "b": [0.4068, 0.1062, 0.4362, 0.1259]}, {"w": "can", "b": [0.4425, 0.1062, 0.4776, 0.1259]}, {"w": "also", "b": [0.4839, 0.1062, 0.5245, 0.1259]}, {"w": "be", "b": [0.5308, 0.1062, 0.5546, 0.1259]}, {"w": "far", "b": [0.5609, 0.1062, 0.5889, 0.1259]}, {"w": "more", "b": [0.5952, 0.1062, 0.6471, 0.1259]}, {"w": "ambitious", "b": [0.6534, 0.1062, 0.7529, 0.1259]}, {"w": "and", "b": [0.7592, 0.1062, 0.7956, 0.1259]}, {"w": "attempt", "b": [0.1294, 0.1267, 0.2051, 0.1464]}, {"w": "to", "b": [0.2114, 0.1267, 0.231, 0.1464]}, {"w": "learn", "b": [0.2373, 0.1267, 0.2878, 0.1464]}, {"w": "an", "b": [0.2941, 0.1267, 0.3179, 0.1464]}, {"w": "appropriate", "b": [0.3242, 0.1267, 0.4391, 0.1464]}, {"w": "architecture", "b": [0.4454, 0.1267, 0.5644, 0.1464]}, {"w": "from", "b": [0.5707, 0.1267, 0.6198, 0.1464]}, {"w": "scratch,", "b": [0.6261, 0.1267, 0.7038, 0.1464]}, {"w": "with", "b": [0.7101, 0.1267, 0.755, 0.1464]}, {"w": "as", "b": [0.7613, 0.1267, 0.7823, 0.1464]}, {"w": "few", "b": [0.7886, 0.1267, 0.8264, 0.1464]}, {"w": "constraints", "b": [0.1294, 0.1472, 0.2387, 0.1669]}, {"w": "as", "b": [0.245, 0.1472, 0.266, 0.1669]}, {"w": "possible:", "b": [0.2723, 0.1472, 0.362, 0.1669]}, {"w": "for", "b": [0.3683, 0.1472, 0.3977, 0.1669]}, {"w": "instance,", "b": [0.404, 0.1472, 0.493, 0.1669]}, {"w": "via", "b": [0.4993, 0.1472, 0.5301, 0.1669]}, {"w": "reinforcement", "b": [0.5365, 0.1472, 0.6779, 0.1669]}, {"w": "learning", "b": [0.6843, 0.1472, 0.7669, 0.1669]}, {"w": "or", "b": [0.7732, 0.1472, 0.7942, 0.1669]}, {"w": "genetic", "b": [0.1294, 0.1677, 0.2023, 0.1874]}, {"w": "algorithms.", "b": [0.2086, 0.1677, 0.3228, 0.1874]}]}, {"id": "b_1", "type": "paragraph", "text": "Another important AutoML direction involves learning model architecture jointly with model weights. Because training a new model from scratch every time we try a slightly different architecture is tremendously inefficient, a truly powerful AutoML system would evolve architectures at the same time the features of the model were being tuned via backpropagation on the training data. Such approaches are beginning to emerge as I write these lines.", "words": [{"w": "Another", "b": [0.1294, 0.2105, 0.2121, 0.2302]}, {"w": "important", "b": [0.2184, 0.2105, 0.3165, 0.2302]}, {"w": "AutoML", "b": [0.3228, 0.2105, 0.4111, 0.2302]}, {"w": "direction", "b": [0.4174, 0.2105, 0.5071, 0.2302]}, {"w": "involves", "b": [0.5134, 0.2105, 0.5989, 0.2302]}, {"w": "learning", "b": [0.6052, 0.2105, 0.6878, 0.2302]}, {"w": "model", "b": [0.6941, 0.2105, 0.7572, 0.2302]}, {"w": "architecture", "b": [0.1294, 0.231, 0.2485, 0.2507]}, {"w": "jointly", "b": [0.2548, 0.231, 0.3207, 0.2507]}, {"w": "with", "b": [0.327, 0.231, 0.3718, 0.2507]}, {"w": "model", "b": [0.3781, 0.231, 0.4412, 0.2507]}, {"w": "weights.", "b": [0.4475, 0.231, 0.5323, 0.2507]}, {"w": "Because", "b": [0.5386, 0.231, 0.6227, 0.2507]}, {"w": "training", "b": [0.629, 0.231, 0.7074, 0.2507]}, {"w": "a", "b": [0.7137, 0.231, 0.7249, 0.2507]}, {"w": "new", "b": [0.7312, 0.231, 0.7733, 0.2507]}, {"w": "model", "b": [0.7795, 0.231, 0.8425, 0.2507]}, {"w": "from", "b": [0.1294, 0.2515, 0.1785, 0.2712]}, {"w": "scratch", "b": [0.1848, 0.2515, 0.2562, 0.2712]}, {"w": "every", "b": [0.2625, 0.2515, 0.3185, 0.2712]}, {"w": "time", "b": [0.3248, 0.2515, 0.3697, 0.2712]}, {"w": "we", "b": [0.376, 0.2515, 0.4054, 0.2712]}, {"w": "try", "b": [0.4117, 0.2515, 0.4397, 0.2712]}, {"w": "a", "b": [0.446, 0.2515, 0.4572, 0.2712]}, {"w": "slightly", "b": [0.4636, 0.2515, 0.5393, 0.2712]}, {"w": "different", "b": [0.5456, 0.2515, 0.6319, 0.2712]}, {"w": "architecture", "b": [0.6382, 0.2515, 0.7573, 0.2712]}, {"w": "is", "b": [0.7636, 0.2515, 0.7804, 0.2712]}, {"w": "tremendously", "b": [0.1294, 0.272, 0.2667, 0.2917]}, {"w": "inefficient,", "b": [0.273, 0.272, 0.3826, 0.2917]}, {"w": "a", "b": [0.3889, 0.272, 0.4001, 0.2917]}, {"w": "truly", "b": [0.4064, 0.272, 0.454, 0.2917]}, {"w": "powerful", "b": [0.4603, 0.272, 0.5514, 0.2917]}, {"w": "AutoML", "b": [0.5577, 0.272, 0.646, 0.2917]}, {"w": "system", "b": [0.6523, 0.272, 0.7223, 0.2917]}, {"w": "would", "b": [0.7286, 0.272, 0.7917, 0.2917]}, {"w": "evolve", "b": [0.798, 0.272, 0.8653, 0.2917]}, {"w": "architectures", "b": [0.1294, 0.2925, 0.2583, 0.3122]}, {"w": "at", "b": [0.2646, 0.2925, 0.2828, 0.3122]}, {"w": "the", "b": [0.2891, 0.2925, 0.3199, 0.3122]}, {"w": "same", "b": [0.3262, 0.2925, 0.3781, 0.3122]}, {"w": "time", "b": [0.3844, 0.2925, 0.4292, 0.3122]}, {"w": "the", "b": [0.4356, 0.2925, 0.4664, 0.3122]}, {"w": "features", "b": [0.4727, 0.2925, 0.5525, 0.3122]}, {"w": "of", "b": [0.5588, 0.2925, 0.5798, 0.3122]}, {"w": "the", "b": [0.5861, 0.2925, 0.617, 0.3122]}, {"w": "model", "b": [0.6233, 0.2925, 0.6863, 0.3122]}, {"w": "were", "b": [0.6927, 0.2925, 0.7417, 0.3122]}, {"w": "being", "b": [0.748, 0.2925, 0.804, 0.3122]}, {"w": "tuned", "b": [0.8103, 0.2925, 0.8664, 0.3122]}, {"w": "via", "b": [0.1294, 0.313, 0.1602, 0.3327]}, {"w": "backpropagation", "b": [0.1665, 0.313, 0.3347, 0.3327]}, {"w": "on", "b": [0.341, 0.313, 0.3662, 0.3327]}, {"w": "the", "b": [0.3725, 0.313, 0.4033, 0.3327]}, {"w": "training", "b": [0.4096, 0.313, 0.4881, 0.3327]}, {"w": "data.", "b": [0.4944, 0.313, 0.5427, 0.3327]}, {"w": "Such", "b": [0.549, 0.313, 0.5994, 0.3327]}, {"w": "approaches", "b": [0.6058, 0.313, 0.7192, 0.3327]}, {"w": "are", "b": [0.7255, 0.313, 0.7563, 0.3327]}, {"w": "beginning", "b": [0.7626, 0.313, 0.8635, 0.3327]}, {"w": "to", "b": [0.1294, 0.3335, 0.149, 0.3532]}, {"w": "emerge", "b": [0.1553, 0.3335, 0.2291, 0.3532]}, {"w": "as", "b": [0.2354, 0.3335, 0.2564, 0.3532]}, {"w": "I", "b": [0.2627, 0.3335, 0.2711, 0.3532]}, {"w": "write", "b": [0.2774, 0.3335, 0.3293, 0.3532]}, {"w": "these", "b": [0.3356, 0.3335, 0.3874, 0.3532]}, {"w": "lines.", "b": [0.3937, 0.3335, 0.4477, 0.3532]}]}, {"id": "b_2", "type": "paragraph", "text": "When this starts to happen, the jobs of machine-learning engineers won’t disappear—rather, engineers will move up the value-creation chain. They will begin to put much more effort into crafting complex loss functions that truly reflect business goals and understanding how their models impact the digital ecosystems in which they’re deployed (for example, the users who consume the model’s predictions and generate the model’s training data)—problems that only the largest companies can afford to consider at present.", "words": [{"w": "When", "b": [0.1294, 0.3762, 0.1897, 0.396]}, {"w": "this", "b": [0.196, 0.3762, 0.2324, 0.396]}, {"w": "starts", "b": [0.2387, 0.3762, 0.292, 0.396]}, {"w": "to", "b": [0.2983, 0.3762, 0.3179, 0.396]}, {"w": "happen,", "b": [0.3242, 0.3762, 0.4034, 0.396]}, {"w": "the", "b": [0.4097, 0.3762, 0.4405, 0.396]}, {"w": "jobs", "b": [0.4468, 0.3762, 0.4889, 0.396]}, {"w": "of", "b": [0.4952, 0.3762, 0.5162, 0.396]}, {"w": "machine-learning", "b": [0.5225, 0.3762, 0.699, 0.396]}, {"w": "engineers", "b": [0.7053, 0.3762, 0.802, 0.396]}, {"w": "won’t", "b": [0.8083, 0.3762, 0.8666, 0.396]}, {"w": "disappear—rather,", "b": [0.1294, 0.3967, 0.3154, 0.4165]}, {"w": "engineers", "b": [0.3217, 0.3967, 0.4184, 0.4165]}, {"w": "will", "b": [0.4247, 0.3967, 0.4639, 0.4165]}, {"w": "move", "b": [0.4702, 0.3967, 0.5263, 0.4165]}, {"w": "up", "b": [0.5326, 0.3967, 0.5578, 0.4165]}, {"w": "the", "b": [0.5641, 0.3967, 0.595, 0.4165]}, {"w": "value-creation", "b": [0.6013, 0.3967, 0.7456, 0.4165]}, {"w": "chain.", "b": [0.7518, 0.3967, 0.8127, 0.4165]}, {"w": "They", "b": [0.1294, 0.4172, 0.1813, 0.437]}, {"w": "will", "b": [0.1876, 0.4172, 0.2268, 0.437]}, {"w": "begin", "b": [0.2331, 0.4172, 0.2892, 0.437]}, {"w": "to", "b": [0.2955, 0.4172, 0.3151, 0.437]}, {"w": "put", "b": [0.3214, 0.4172, 0.3536, 0.437]}, {"w": "much", "b": [0.36, 0.4172, 0.416, 0.437]}, {"w": "more", "b": [0.4223, 0.4172, 0.4741, 0.437]}, {"w": "effort", "b": [0.4805, 0.4172, 0.536, 0.437]}, {"w": "into", "b": [0.5423, 0.4172, 0.5815, 0.437]}, {"w": "crafting", "b": [0.5878, 0.4172, 0.6663, 0.437]}, {"w": "complex", "b": [0.6726, 0.4172, 0.7595, 0.437]}, {"w": "loss", "b": [0.7658, 0.4172, 0.805, 0.437]}, {"w": "functions", "b": [0.1294, 0.4377, 0.2233, 0.4575]}, {"w": "that", "b": [0.2296, 0.4377, 0.2674, 0.4575]}, {"w": "truly", "b": [0.2738, 0.4377, 0.3214, 0.4575]}, {"w": "reflect", "b": [0.3277, 0.4377, 0.3921, 0.4575]}, {"w": "business", "b": [0.3984, 0.4377, 0.4839, 0.4575]}, {"w": "goals", "b": [0.4902, 0.4377, 0.5435, 0.4575]}, {"w": "and", "b": [0.5498, 0.4377, 0.5862, 0.4575]}, {"w": "understanding", "b": [0.5925, 0.4377, 0.7354, 0.4575]}, {"w": "how", "b": [0.7417, 0.4377, 0.7851, 0.4575]}, {"w": "their", "b": [0.7914, 0.4377, 0.8377, 0.4575]}, {"w": "models", "b": [0.1294, 0.4582, 0.2023, 0.478]}, {"w": "impact", "b": [0.2086, 0.4582, 0.2773, 0.478]}, {"w": "the", "b": [0.2836, 0.4582, 0.3144, 0.478]}, {"w": "digital", "b": [0.3207, 0.4582, 0.3852, 0.478]}, {"w": "ecosystems", "b": [0.3915, 0.4582, 0.5064, 0.478]}, {"w": "in", "b": [0.5127, 0.4582, 0.5323, 0.478]}, {"w": "which", "b": [0.5386, 0.4582, 0.6003, 0.478]}, {"w": "they’re", "b": [0.6066, 0.4582, 0.678, 0.478]}, {"w": "deployed", "b": [0.6843, 0.4582, 0.7768, 0.478]}, {"w": "(for", "b": [0.7831, 0.4582, 0.8209, 0.478]}, {"w": "example,", "b": [0.1294, 0.4787, 0.2212, 0.4985]}, {"w": "the", "b": [0.2275, 0.4787, 0.2583, 0.4985]}, {"w": "users", "b": [0.2646, 0.4787, 0.3165, 0.4985]}, {"w": "who", "b": [0.3228, 0.4787, 0.3662, 0.4985]}, {"w": "consume", "b": [0.3725, 0.4787, 0.4622, 0.4985]}, {"w": "the", "b": [0.4685, 0.4787, 0.4993, 0.4985]}, {"w": "model’s", "b": [0.5056, 0.4787, 0.5855, 0.4985]}, {"w": "predictions", "b": [0.5918, 0.4787, 0.7039, 0.4985]}, {"w": "and", "b": [0.7102, 0.4787, 0.7466, 0.4985]}, {"w": "generate", "b": [0.7529, 0.4787, 0.8383, 0.4985]}, {"w": "the", "b": [0.1294, 0.4992, 0.1602, 0.519]}, {"w": "model’s", "b": [0.1665, 0.4992, 0.2464, 0.519]}, {"w": "training", "b": [0.2527, 0.4992, 0.3312, 0.519]}, {"w": "data)—problems", "b": [0.3375, 0.4992, 0.507, 0.519]}, {"w": "that", "b": [0.5133, 0.4992, 0.5512, 0.519]}, {"w": "only", "b": [0.5575, 0.4992, 0.6023, 0.519]}, {"w": "the", "b": [0.6087, 0.4992, 0.6395, 0.519]}, {"w": "largest", "b": [0.6458, 0.4992, 0.7125, 0.519]}, {"w": "companies", "b": [0.7188, 0.4992, 0.8267, 0.519]}, {"w": "can", "b": [0.833, 0.4992, 0.868, 0.519]}, {"w": "afford", "b": [0.1294, 0.5197, 0.1906, 0.5395]}, {"w": "to", "b": [0.1969, 0.5197, 0.2165, 0.5395]}, {"w": "consider", "b": [0.2228, 0.5197, 0.3083, 0.5395]}, {"w": "at", "b": [0.3146, 0.5197, 0.3328, 0.5395]}, {"w": "present.", "b": [0.3391, 0.5197, 0.4182, 0.5395]}]}, {"id": "b_3", "type": "paragraph", "text": "9.3.4. Lifelong learning and modular subroutine reuse", "words": [{"w": "9.3.4.", "b": [0.1294, 0.567, 0.1862, 0.5867]}, {"w": "Lifelong", "b": [0.1925, 0.567, 0.2822, 0.5867]}, {"w": "learning", "b": [0.2885, 0.567, 0.3782, 0.5867]}, {"w": "and", "b": [0.3845, 0.567, 0.4252, 0.5867]}, {"w": "modular", "b": [0.4315, 0.567, 0.524, 0.5867]}, {"w": "subroutine", "b": [0.5303, 0.567, 0.6462, 0.5867]}, {"w": "reuse", "b": [0.6525, 0.567, 0.7094, 0.5867]}]}, {"id": "b_4", "type": "paragraph", "text": "If models become more complex and are built on top of richer algorithmic primitives, then this increased complexity will require higher reuse between tasks, rather than training a new model from scratch every time we have a new task or a new dataset. Many datasets don’t contain enough information for us to develop a new, complex model from scratch, and it will be necessary to use information from previously encountered datasets (much as you don’t learn English from scratch every time you open a new book—that would be impossible). Training models from scratch on every new task is also inefficient due to the large overlap between the current tasks and previously encountered tasks.", "words": [{"w": "If", "b": [0.1294, 0.6098, 0.1462, 0.6295]}, {"w": "models", "b": [0.1525, 0.6098, 0.2254, 0.6295]}, {"w": "become", "b": [0.2317, 0.6098, 0.3102, 0.6295]}, {"w": "more", "b": [0.3165, 0.6098, 0.3683, 0.6295]}, {"w": "complex", "b": [0.3746, 0.6098, 0.4615, 0.6295]}, {"w": "and", "b": [0.4678, 0.6098, 0.5042, 0.6295]}, {"w": "are", "b": [0.5105, 0.6098, 0.5413, 0.6295]}, {"w": "built", "b": [0.5476, 0.6098, 0.5939, 0.6295]}, {"w": "on", "b": [0.6002, 0.6098, 0.6254, 0.6295]}, {"w": "top", "b": [0.6317, 0.6098, 0.664, 0.6295]}, {"w": "of", "b": [0.6703, 0.6098, 0.6913, 0.6295]}, {"w": "richer", "b": [0.6976, 0.6098, 0.7564, 0.6295]}, {"w": "algorithmic", "b": [0.1294, 0.6303, 0.2457, 0.65]}, {"w": "primitives,", "b": [0.252, 0.6303, 0.3607, 0.65]}, {"w": "then", "b": [0.367, 0.6303, 0.4104, 0.65]}, {"w": "this", "b": [0.4167, 0.6303, 0.4532, 0.65]}, {"w": "increased", "b": [0.4595, 0.6303, 0.5547, 0.65]}, {"w": "complexity", "b": [0.561, 0.6303, 0.6745, 0.65]}, {"w": "will", "b": [0.6808, 0.6303, 0.7201, 0.65]}, {"w": "require", "b": [0.7264, 0.6303, 0.7978, 0.65]}, {"w": "higher", "b": [0.804, 0.6303, 0.8685, 0.65]}, {"w": "reuse", "b": [0.1294, 0.6508, 0.1826, 0.6705]}, {"w": "between", "b": [0.1889, 0.6508, 0.273, 0.6705]}, {"w": "tasks,", "b": [0.2793, 0.6508, 0.3361, 0.6705]}, {"w": "rather", "b": [0.3424, 0.6508, 0.4012, 0.6705]}, {"w": "than", "b": [0.4075, 0.6508, 0.4509, 0.6705]}, {"w": "training", "b": [0.4572, 0.6508, 0.5357, 0.6705]}, {"w": "a", "b": [0.542, 0.6508, 0.5532, 0.6705]}, {"w": "new", "b": [0.5595, 0.6508, 0.6016, 0.6705]}, {"w": "model", "b": [0.6079, 0.6508, 0.6709, 0.6705]}, {"w": "from", "b": [0.6772, 0.6508, 0.7263, 0.6705]}, {"w": "scratch", "b": [0.7326, 0.6508, 0.804, 0.6705]}, {"w": "every", "b": [0.8103, 0.6508, 0.8664, 0.6705]}, {"w": "time", "b": [0.1294, 0.6713, 0.1743, 0.691]}, {"w": "we", "b": [0.1806, 0.6713, 0.21, 0.691]}, {"w": "have", "b": [0.2163, 0.6713, 0.2639, 0.691]}, {"w": "a", "b": [0.2702, 0.6713, 0.2814, 0.691]}, {"w": "new", "b": [0.2877, 0.6713, 0.3298, 0.691]}, {"w": "task", "b": [0.3361, 0.6713, 0.3767, 0.691]}, {"w": "or", "b": [0.383, 0.6713, 0.404, 0.691]}, {"w": "a", "b": [0.4103, 0.6713, 0.4215, 0.691]}, {"w": "new", "b": [0.4278, 0.6713, 0.4699, 0.691]}, {"w": "dataset.", "b": [0.4762, 0.6713, 0.5525, 0.691]}, {"w": "Many", "b": [0.5588, 0.6713, 0.6176, 0.691]}, {"w": "datasets", "b": [0.6239, 0.6713, 0.7038, 0.691]}, {"w": "don’t", "b": [0.7101, 0.6713, 0.7629, 0.691]}, {"w": "contain", "b": [0.7692, 0.6713, 0.8434, 0.691]}, {"w": "enough", "b": [0.1294, 0.6918, 0.2037, 0.7115]}, {"w": "information", "b": [0.21, 0.6918, 0.3291, 0.7115]}, {"w": "for", "b": [0.3354, 0.6918, 0.3648, 0.7115]}, {"w": "us", "b": [0.3711, 0.6918, 0.3936, 0.7115]}, {"w": "to", "b": [0.3999, 0.6918, 0.4195, 0.7115]}, {"w": "develop", "b": [0.4258, 0.6918, 0.5057, 0.7115]}, {"w": "a", "b": [0.512, 0.6918, 0.5232, 0.7115]}, {"w": "new,", "b": [0.5295, 0.6918, 0.5761, 0.7115]}, {"w": "complex", "b": [0.5824, 0.6918, 0.6693, 0.7115]}, {"w": "model", "b": [0.6756, 0.6918, 0.7387, 0.7115]}, {"w": "from", "b": [0.745, 0.6918, 0.794, 0.7115]}, {"w": "scratch,", "b": [0.1294, 0.7123, 0.2072, 0.732]}, {"w": "and", "b": [0.2135, 0.7123, 0.2499, 0.732]}, {"w": "it", "b": [0.2562, 0.7123, 0.2702, 0.732]}, {"w": "will", "b": [0.2765, 0.7123, 0.3158, 0.732]}, {"w": "be", "b": [0.3221, 0.7123, 0.3459, 0.732]}, {"w": "necessary", "b": [0.3522, 0.7123, 0.4503, 0.732]}, {"w": "to", "b": [0.4565, 0.7123, 0.4761, 0.732]}, {"w": "use", "b": [0.4825, 0.7123, 0.5161, 0.732]}, {"w": "information", "b": [0.5224, 0.7123, 0.6415, 0.732]}, {"w": "from", "b": [0.6478, 0.7123, 0.6968, 0.732]}, {"w": "previously", "b": [0.7032, 0.7123, 0.8097, 0.732]}, {"w": "encountered", "b": [0.1294, 0.7328, 0.2527, 0.7525]}, {"w": "datasets", "b": [0.259, 0.7328, 0.3389, 0.7525]}, {"w": "(much", "b": [0.3452, 0.7328, 0.4096, 0.7525]}, {"w": "as", "b": [0.4159, 0.7328, 0.4369, 0.7525]}, {"w": "you", "b": [0.4432, 0.7328, 0.4811, 0.7525]}, {"w": "don’t", "b": [0.4874, 0.7328, 0.5401, 0.7525]}, {"w": "learn", "b": [0.5465, 0.7328, 0.5969, 0.7525]}, {"w": "English", "b": [0.6032, 0.7328, 0.6803, 0.7525]}, {"w": "from", "b": [0.6866, 0.7328, 0.7356, 0.7525]}, {"w": "scratch", "b": [0.7419, 0.7328, 0.8134, 0.7525]}, {"w": "every", "b": [0.1294, 0.7533, 0.1854, 0.773]}, {"w": "time", "b": [0.1917, 0.7533, 0.2366, 0.773]}, {"w": "you", "b": [0.2429, 0.7533, 0.2807, 0.773]}, {"w": "open", "b": [0.287, 0.7533, 0.3361, 0.773]}, {"w": "a", "b": [0.3424, 0.7533, 0.3536, 0.773]}, {"w": "new", "b": [0.3599, 0.7533, 0.4019, 0.773]}, {"w": "book—that", "b": [0.4082, 0.7533, 0.5217, 0.773]}, {"w": "would", "b": [0.528, 0.7533, 0.5911, 0.773]}, {"w": "be", "b": [0.5974, 0.7533, 0.6212, 0.773]}, {"w": "impossible).", "b": [0.6275, 0.7533, 0.7515, 0.773]}, {"w": "Training", "b": [0.7578, 0.7533, 0.8438, 0.773]}, {"w": "models", "b": [0.1294, 0.7738, 0.2023, 0.7935]}, {"w": "from", "b": [0.2086, 0.7738, 0.2576, 0.7935]}, {"w": "scratch", "b": [0.2639, 0.7738, 0.3354, 0.7935]}, {"w": "on", "b": [0.3417, 0.7738, 0.3669, 0.7935]}, {"w": "every", "b": [0.3732, 0.7738, 0.4292, 0.7935]}, {"w": "new", "b": [0.4356, 0.7738, 0.4776, 0.7935]}, {"w": "task", "b": [0.4839, 0.7738, 0.5245, 0.7935]}, {"w": "is", "b": [0.5308, 0.7738, 0.5477, 0.7935]}, {"w": "also", "b": [0.554, 0.7738, 0.5946, 0.7935]}, {"w": "inefficient", "b": [0.6009, 0.7738, 0.7041, 0.7935]}, {"w": "due", "b": [0.7104, 0.7738, 0.7468, 0.7935]}, {"w": "to", "b": [0.7531, 0.7738, 0.7727, 0.7935]}, {"w": "the", "b": [0.7791, 0.7738, 0.8099, 0.7935]}, {"w": "large", "b": [0.8162, 0.7738, 0.8661, 0.7935]}, {"w": "overlap", "b": [0.1294, 0.7943, 0.2051, 0.814]}, {"w": "between", "b": [0.2114, 0.7943, 0.2954, 0.814]}, {"w": "the", "b": [0.3017, 0.7943, 0.3326, 0.814]}, {"w": "current", "b": [0.3389, 0.7943, 0.4103, 0.814]}, {"w": "tasks", "b": [0.4166, 0.7943, 0.4671, 0.814]}, {"w": "and", "b": [0.4734, 0.7943, 0.5098, 0.814]}, {"w": "previously", "b": [0.5161, 0.7943, 0.6226, 0.814]}, {"w": "encountered", "b": [0.6289, 0.7943, 0.7522, 0.814]}, {"w": "tasks.", "b": [0.7585, 0.7943, 0.8153, 0.814]}]}, {"id": "b_5", "type": "paragraph", "text": "A remarkable observation has been made repeatedly in recent years: training the same model to do several loosely connected tasks at the same time results in a model that’s better at each task. For instance,", "words": [{"w": "A", "b": [0.1294, 0.8371, 0.1476, 0.8568]}, {"w": "remarkable", "b": [0.1539, 0.8371, 0.2674, 0.8568]}, {"w": "observation", "b": [0.2737, 0.8371, 0.3914, 0.8568]}, {"w": "has", "b": [0.3977, 0.8371, 0.4313, 0.8568]}, {"w": "been", "b": [0.4376, 0.8371, 0.4853, 0.8568]}, {"w": "made", "b": [0.4916, 0.8371, 0.5462, 0.8568]}, {"w": "repeatedly", "b": [0.5525, 0.8371, 0.6576, 0.8568]}, {"w": "in", "b": [0.6639, 0.8371, 0.6835, 0.8568]}, {"w": "recent", "b": [0.6898, 0.8371, 0.7515, 0.8568]}, {"w": "years:", "b": [0.7578, 0.8371, 0.818, 0.8568]}, {"w": "training", "b": [0.1294, 0.8576, 0.2079, 0.8773]}, {"w": "the", "b": [0.2142, 0.8576, 0.245, 0.8773]}, {"w": "same", "b": [0.2513, 0.8576, 0.3031, 0.8773]}, {"w": "model", "b": [0.3094, 0.8576, 0.3725, 0.8773]}, {"w": "to", "b": [0.3788, 0.8576, 0.3984, 0.8773]}, {"w": "do", "b": [0.4047, 0.8576, 0.43, 0.8773]}, {"w": "several", "b": [0.4363, 0.8576, 0.5077, 0.8773]}, {"w": "loosely", "b": [0.514, 0.8576, 0.5869, 0.8773]}, {"w": "connected", "b": [0.5932, 0.8576, 0.6955, 0.8773]}, {"w": "tasks", "b": [0.7018, 0.8576, 0.7522, 0.8773]}, {"w": "at", "b": [0.7585, 0.8576, 0.7767, 0.8773]}, {"w": "the", "b": [0.7831, 0.8576, 0.8139, 0.8773]}, {"w": "same", "b": [0.1294, 0.8781, 0.1813, 0.8978]}, {"w": "time", "b": [0.1876, 0.8781, 0.2324, 0.8978]}, {"w": "results", "b": [0.2387, 0.8781, 0.3046, 0.8978]}, {"w": "in", "b": [0.3109, 0.8781, 0.3305, 0.8978]}, {"w": "a", "b": [0.3368, 0.8781, 0.348, 0.8978]}, {"w": "model", "b": [0.3543, 0.8781, 0.4174, 0.8978]}, {"w": "that’s", "b": [0.4237, 0.8781, 0.4783, 0.8978]}, {"w": "better", "b": [0.4846, 0.8781, 0.5435, 0.8978]}, {"w": "at", "b": [0.5498, 0.8781, 0.5694, 0.8978]}, {"w": "each", "b": [0.5757, 0.8781, 0.6233, 0.8978]}, {"w": "task.", "b": [0.6296, 0.8781, 0.6765, 0.8978]}, {"w": "For", "b": [0.6828, 0.8781, 0.7179, 0.8978]}, {"w": "instance,", "b": [0.7242, 0.8781, 0.8132, 0.8978]}]}]}, {"page": 435, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "training the same neural machine-translation model to perform both English-to-German translation and French-to-Italian translation will result in a model that’s better at each language pair. Similarly, training an image-classification model jointly with an image-segmentation model, sharing the same convolutional base, results in a model that’s better at both tasks. This is fairly intuitive: there’s always some information overlap between seemingly disconnected tasks, and a joint model has access to a greater amount of information about each individual task than a model trained on that specific task only.", "words": [{"w": "training", "b": [0.1294, 0.0857, 0.2079, 0.1054]}, {"w": "the", "b": [0.2142, 0.0857, 0.245, 0.1054]}, {"w": "same", "b": [0.2513, 0.0857, 0.3032, 0.1054]}, {"w": "neural", "b": [0.3095, 0.0857, 0.3725, 0.1054]}, {"w": "machine-translation", "b": [0.3788, 0.0857, 0.5792, 0.1054]}, {"w": "model", "b": [0.5855, 0.0857, 0.6486, 0.1054]}, {"w": "to", "b": [0.6549, 0.0857, 0.6745, 0.1054]}, {"w": "perform", "b": [0.6808, 0.0857, 0.762, 0.1054]}, {"w": "both", "b": [0.7684, 0.0857, 0.8132, 0.1054]}, {"w": "English-to-German", "b": [0.1294, 0.1062, 0.3242, 0.1259]}, {"w": "translation", "b": [0.3305, 0.1062, 0.437, 0.1259]}, {"w": "and", "b": [0.4433, 0.1062, 0.4797, 0.1259]}, {"w": "French-to-Italian", "b": [0.486, 0.1062, 0.657, 0.1259]}, {"w": "translation", "b": [0.6632, 0.1062, 0.7697, 0.1259]}, {"w": "will", "b": [0.776, 0.1062, 0.8153, 0.1259]}, {"w": "result", "b": [0.1294, 0.1267, 0.1855, 0.1464]}, {"w": "in", "b": [0.1918, 0.1267, 0.2114, 0.1464]}, {"w": "a", "b": [0.2177, 0.1267, 0.2289, 0.1464]}, {"w": "model", "b": [0.2352, 0.1267, 0.2983, 0.1464]}, {"w": "that’s", "b": [0.3046, 0.1267, 0.3592, 0.1464]}, {"w": "better", "b": [0.3655, 0.1267, 0.4229, 0.1464]}, {"w": "at", "b": [0.4293, 0.1267, 0.4475, 0.1464]}, {"w": "each", "b": [0.4538, 0.1267, 0.5, 0.1464]}, {"w": "language", "b": [0.5063, 0.1267, 0.5974, 0.1464]}, {"w": "pair.", "b": [0.6037, 0.1267, 0.6477, 0.1464]}, {"w": "Similarly,", "b": [0.6541, 0.1267, 0.7526, 0.1464]}, {"w": "training", "b": [0.7589, 0.1267, 0.8374, 0.1464]}, {"w": "an", "b": [0.8437, 0.1267, 0.8675, 0.1464]}, {"w": "image-classification", "b": [0.1294, 0.1472, 0.3326, 0.1669]}, {"w": "model", "b": [0.3389, 0.1472, 0.402, 0.1669]}, {"w": "jointly", "b": [0.4082, 0.1472, 0.4741, 0.1669]}, {"w": "with", "b": [0.4804, 0.1472, 0.5252, 0.1669]}, {"w": "an", "b": [0.5316, 0.1472, 0.5554, 0.1669]}, {"w": "image-segmentation", "b": [0.5617, 0.1472, 0.7663, 0.1669]}, {"w": "model,", "b": [0.7726, 0.1472, 0.8419, 0.1669]}, {"w": "sharing", "b": [0.1294, 0.1677, 0.2037, 0.1874]}, {"w": "the", "b": [0.21, 0.1677, 0.2408, 0.1874]}, {"w": "same", "b": [0.2471, 0.1677, 0.299, 0.1874]}, {"w": "convolutional", "b": [0.3053, 0.1677, 0.444, 0.1874]}, {"w": "base,", "b": [0.4503, 0.1677, 0.5014, 0.1874]}, {"w": "results", "b": [0.5077, 0.1677, 0.5736, 0.1874]}, {"w": "in", "b": [0.5799, 0.1677, 0.5995, 0.1874]}, {"w": "a", "b": [0.6059, 0.1677, 0.6171, 0.1874]}, {"w": "model", "b": [0.6234, 0.1677, 0.6864, 0.1874]}, {"w": "that’s", "b": [0.6927, 0.1677, 0.7473, 0.1874]}, {"w": "better", "b": [0.7536, 0.1677, 0.811, 0.1874]}, {"w": "at", "b": [0.8174, 0.1677, 0.8356, 0.1874]}, {"w": "both", "b": [0.1294, 0.1882, 0.1743, 0.2079]}, {"w": "tasks.", "b": [0.1806, 0.1882, 0.2373, 0.2079]}, {"w": "This", "b": [0.2436, 0.1882, 0.2885, 0.2079]}, {"w": "is", "b": [0.2948, 0.1882, 0.3116, 0.2079]}, {"w": "fairly", "b": [0.3179, 0.1882, 0.3725, 0.2079]}, {"w": "intuitive:", "b": [0.3789, 0.1882, 0.47, 0.2079]}, {"w": "there’s", "b": [0.4763, 0.1882, 0.5435, 0.2079]}, {"w": "always", "b": [0.5498, 0.1882, 0.6198, 0.2079]}, {"w": "some", "b": [0.6261, 0.1882, 0.678, 0.2079]}, {"w": "information", "b": [0.6843, 0.1882, 0.8034, 0.2079]}, {"w": "overlap", "b": [0.1294, 0.2087, 0.2051, 0.2284]}, {"w": "between", "b": [0.2114, 0.2087, 0.2954, 0.2284]}, {"w": "seemingly", "b": [0.3017, 0.2087, 0.4054, 0.2284]}, {"w": "disconnected", "b": [0.4117, 0.2087, 0.5434, 0.2284]}, {"w": "tasks,", "b": [0.5497, 0.2087, 0.6065, 0.2284]}, {"w": "and", "b": [0.6128, 0.2087, 0.6492, 0.2284]}, {"w": "a", "b": [0.6555, 0.2087, 0.6667, 0.2284]}, {"w": "joint", "b": [0.6731, 0.2087, 0.7193, 0.2284]}, {"w": "model", "b": [0.7256, 0.2087, 0.7887, 0.2284]}, {"w": "has", "b": [0.795, 0.2087, 0.8286, 0.2284]}, {"w": "access", "b": [0.1294, 0.2292, 0.1938, 0.2489]}, {"w": "to", "b": [0.2001, 0.2292, 0.2198, 0.2489]}, {"w": "a", "b": [0.2261, 0.2292, 0.2373, 0.2489]}, {"w": "greater", "b": [0.2436, 0.2292, 0.3136, 0.2489]}, {"w": "amount", "b": [0.3199, 0.2292, 0.3956, 0.2489]}, {"w": "of", "b": [0.4019, 0.2292, 0.4229, 0.2489]}, {"w": "information", "b": [0.4292, 0.2292, 0.5483, 0.2489]}, {"w": "about", "b": [0.5546, 0.2292, 0.6106, 0.2489]}, {"w": "each", "b": [0.6169, 0.2292, 0.6631, 0.2489]}, {"w": "individual", "b": [0.6694, 0.2292, 0.7718, 0.2489]}, {"w": "task", "b": [0.7781, 0.2292, 0.8187, 0.2489]}, {"w": "than", "b": [0.825, 0.2292, 0.8684, 0.2489]}, {"w": "a", "b": [0.1294, 0.2497, 0.1406, 0.2694]}, {"w": "model", "b": [0.1469, 0.2497, 0.21, 0.2694]}, {"w": "trained", "b": [0.2163, 0.2497, 0.2863, 0.2694]}, {"w": "on", "b": [0.2926, 0.2497, 0.3179, 0.2694]}, {"w": "that", "b": [0.3242, 0.2497, 0.362, 0.2694]}, {"w": "specific", "b": [0.3683, 0.2497, 0.4468, 0.2694]}, {"w": "task", "b": [0.4531, 0.2497, 0.4937, 0.2694]}, {"w": "only.", "b": [0.5, 0.2497, 0.5495, 0.2694]}]}, {"id": "b_1", "type": "paragraph", "text": "Currently, when it comes to model reuse across tasks, we use pretrained weights for models that perform common functions, such as visual feature extraction. You saw this in action in chapter 5. In the future, I expect a generalized version of this to be commonplace: we’ll use not only previously learned features (submodel weights) but also model architectures and training procedures. As models become more like programs, we’ll begin to reuse program subroutines like the functions and classes found in human programming languages.", "words": [{"w": "Currently,", "b": [0.1294, 0.2925, 0.2308, 0.3122]}, {"w": "when", "b": [0.2371, 0.2925, 0.2917, 0.3122]}, {"w": "it", "b": [0.298, 0.2925, 0.312, 0.3122]}, {"w": "comes", "b": [0.3183, 0.2925, 0.3828, 0.3122]}, {"w": "to", "b": [0.3891, 0.2925, 0.4087, 0.3122]}, {"w": "model", "b": [0.415, 0.2925, 0.4781, 0.3122]}, {"w": "reuse", "b": [0.4844, 0.2925, 0.5376, 0.3122]}, {"w": "across", "b": [0.5439, 0.2925, 0.607, 0.3122]}, {"w": "tasks,", "b": [0.6133, 0.2925, 0.67, 0.3122]}, {"w": "we", "b": [0.6763, 0.2925, 0.7058, 0.3122]}, {"w": "use", "b": [0.7121, 0.2925, 0.7457, 0.3122]}, {"w": "pretrained", "b": [0.752, 0.2925, 0.8543, 0.3122]}, {"w": "weights", "b": [0.1294, 0.313, 0.2079, 0.3327]}, {"w": "for", "b": [0.2142, 0.313, 0.2436, 0.3327]}, {"w": "models", "b": [0.2499, 0.313, 0.3228, 0.3327]}, {"w": "that", "b": [0.3291, 0.313, 0.3669, 0.3327]}, {"w": "perform", "b": [0.3732, 0.313, 0.4545, 0.3327]}, {"w": "common", "b": [0.4608, 0.313, 0.5491, 0.3327]}, {"w": "functions,", "b": [0.5554, 0.313, 0.6556, 0.3327]}, {"w": "such", "b": [0.6618, 0.313, 0.7081, 0.3327]}, {"w": "as", "b": [0.7144, 0.313, 0.7354, 0.3327]}, {"w": "visual", "b": [0.7417, 0.313, 0.802, 0.3327]}, {"w": "feature", "b": [0.1294, 0.3335, 0.1994, 0.3532]}, {"w": "extraction.", "b": [0.2057, 0.3335, 0.3129, 0.3532]}, {"w": "You", "b": [0.3192, 0.3335, 0.3601, 0.3532]}, {"w": "saw", "b": [0.3664, 0.3335, 0.4056, 0.3532]}, {"w": "this", "b": [0.412, 0.3335, 0.4484, 0.3532]}, {"w": "in", "b": [0.4547, 0.3335, 0.4743, 0.3532]}, {"w": "action", "b": [0.4806, 0.3335, 0.5423, 0.3532]}, {"w": "in", "b": [0.5486, 0.3335, 0.5682, 0.3532]}, {"w": "chapter", "b": [0.5745, 0.3335, 0.6487, 0.3532]}, {"w": "5.", "b": [0.6551, 0.3335, 0.674, 0.3532]}, {"w": "In", "b": [0.6803, 0.3335, 0.7013, 0.3532]}, {"w": "the", "b": [0.7076, 0.3335, 0.7384, 0.3532]}, {"w": "future,", "b": [0.7447, 0.3335, 0.8113, 0.3532]}, {"w": "I", "b": [0.8176, 0.3335, 0.826, 0.3532]}, {"w": "expect", "b": [0.1294, 0.354, 0.1953, 0.3737]}, {"w": "a", "b": [0.2016, 0.354, 0.2128, 0.3737]}, {"w": "generalized", "b": [0.2191, 0.354, 0.3353, 0.3737]}, {"w": "version", "b": [0.3416, 0.354, 0.4159, 0.3737]}, {"w": "of", "b": [0.4222, 0.354, 0.4432, 0.3737]}, {"w": "this", "b": [0.4495, 0.354, 0.486, 0.3737]}, {"w": "to", "b": [0.4923, 0.354, 0.5119, 0.3737]}, {"w": "be", "b": [0.5182, 0.354, 0.542, 0.3737]}, {"w": "commonplace:", "b": [0.5483, 0.354, 0.6969, 0.3737]}, {"w": "we’ll", "b": [0.7032, 0.354, 0.755, 0.3737]}, {"w": "use", "b": [0.7613, 0.354, 0.7949, 0.3737]}, {"w": "not", "b": [0.8012, 0.354, 0.8335, 0.3737]}, {"w": "only", "b": [0.1294, 0.3745, 0.1743, 0.3942]}, {"w": "previously", "b": [0.1806, 0.3745, 0.2871, 0.3942]}, {"w": "learned", "b": [0.2934, 0.3745, 0.3676, 0.3942]}, {"w": "features", "b": [0.3739, 0.3745, 0.4538, 0.3942]}, {"w": "(submodel", "b": [0.46, 0.3745, 0.5665, 0.3942]}, {"w": "weights)", "b": [0.5728, 0.3745, 0.6597, 0.3942]}, {"w": "but", "b": [0.666, 0.3745, 0.6983, 0.3942]}, {"w": "also", "b": [0.7046, 0.3745, 0.7452, 0.3942]}, {"w": "model", "b": [0.7515, 0.3745, 0.8146, 0.3942]}, {"w": "architectures", "b": [0.1294, 0.395, 0.2583, 0.4147]}, {"w": "and", "b": [0.2646, 0.395, 0.301, 0.4147]}, {"w": "training", "b": [0.3073, 0.395, 0.3858, 0.4147]}, {"w": "procedures.", "b": [0.3921, 0.395, 0.5091, 0.4147]}, {"w": "As", "b": [0.5154, 0.395, 0.5434, 0.4147]}, {"w": "models", "b": [0.5497, 0.395, 0.6226, 0.4147]}, {"w": "become", "b": [0.6289, 0.395, 0.7074, 0.4147]}, {"w": "more", "b": [0.7137, 0.395, 0.7655, 0.4147]}, {"w": "like", "b": [0.7718, 0.395, 0.8096, 0.4147]}, {"w": "programs,", "b": [0.1294, 0.4155, 0.231, 0.4352]}, {"w": "we’ll", "b": [0.2373, 0.4155, 0.2891, 0.4352]}, {"w": "begin", "b": [0.2954, 0.4155, 0.3515, 0.4352]}, {"w": "to", "b": [0.3578, 0.4155, 0.3774, 0.4352]}, {"w": "reuse", "b": [0.3837, 0.4155, 0.4369, 0.4352]}, {"w": "program", "b": [0.4432, 0.4155, 0.5306, 0.4352]}, {"w": "subroutines", "b": [0.5369, 0.4155, 0.6537, 0.4352]}, {"w": "like", "b": [0.66, 0.4155, 0.6978, 0.4352]}, {"w": "the", "b": [0.7041, 0.4155, 0.735, 0.4352]}, {"w": "functions", "b": [0.7413, 0.4155, 0.8352, 0.4352]}, {"w": "and", "b": [0.1294, 0.436, 0.1658, 0.4557]}, {"w": "classes", "b": [0.1721, 0.436, 0.2422, 0.4557]}, {"w": "found", "b": [0.2485, 0.436, 0.3074, 0.4557]}, {"w": "in", "b": [0.3137, 0.436, 0.3333, 0.4557]}, {"w": "human", "b": [0.3396, 0.436, 0.4083, 0.4557]}, {"w": "programming", "b": [0.4146, 0.436, 0.5519, 0.4557]}, {"w": "languages.", "b": [0.5582, 0.436, 0.6654, 0.4557]}]}, {"id": "b_2", "type": "paragraph", "text": "Think of the process of software development today: once an engineer solves a specific problem (HTTP queries in Python, for instance), they package it as an abstract, reusable library. Engineers who face a similar problem in the future will be able to search for existing libraries, download one, and use it in their own project. In a similar way, in the future, metalearning systems will be able to assemble new programs by sifting through a global library of high-level reusable blocks. When the system finds itself developing similar program subroutines for several different tasks, it can come up with an abstract, reusable version of the subroutine and store it in the global library (see figure 9.6). Such a process will implement abstraction: a necessary component for achieving extreme generalization. A subroutine that��s useful across different tasks and domains can be said to abstract some aspect of problem solving. This definition of abstraction is similar to the notion of abstraction in software engineering. These subroutines can be either geometric (deep-learning modules with pretrained representations) or algorithmic (closer to the libraries that contemporary software engineers manipulate).", "words": [{"w": "Think", "b": [0.1294, 0.4787, 0.1897, 0.4985]}, {"w": "of", "b": [0.196, 0.4787, 0.217, 0.4985]}, {"w": "the", "b": [0.2233, 0.4787, 0.2541, 0.4985]}, {"w": "process", "b": [0.2604, 0.4787, 0.3361, 0.4985]}, {"w": "of", "b": [0.3424, 0.4787, 0.3634, 0.4985]}, {"w": "software", "b": [0.3697, 0.4787, 0.4566, 0.4985]}, {"w": "development", "b": [0.4629, 0.4787, 0.5932, 0.4985]}, {"w": "today:", "b": [0.5995, 0.4787, 0.6626, 0.4985]}, {"w": "once", "b": [0.6689, 0.4787, 0.7165, 0.4985]}, {"w": "an", "b": [0.7228, 0.4787, 0.7466, 0.4985]}, {"w": "engineer", "b": [0.7529, 0.4787, 0.8398, 0.4985]}, {"w": "solves", "b": [0.1294, 0.4992, 0.1925, 0.519]}, {"w": "a", "b": [0.1988, 0.4992, 0.21, 0.519]}, {"w": "specific", "b": [0.2163, 0.4992, 0.2947, 0.519]}, {"w": "problem", "b": [0.301, 0.4992, 0.3851, 0.519]}, {"w": "(HTTP", "b": [0.3914, 0.4992, 0.4629, 0.519]}, {"w": "queries", "b": [0.4692, 0.4992, 0.5421, 0.519]}, {"w": "in", "b": [0.5484, 0.4992, 0.568, 0.519]}, {"w": "Python,", "b": [0.5743, 0.4992, 0.6521, 0.519]}, {"w": "for", "b": [0.6584, 0.4992, 0.6878, 0.519]}, {"w": "instance),", "b": [0.6941, 0.4992, 0.7914, 0.519]}, {"w": "they", "b": [0.7977, 0.4992, 0.8412, 0.519]}, {"w": "package", "b": [0.1294, 0.5197, 0.2121, 0.5395]}, {"w": "it", "b": [0.2184, 0.5197, 0.2324, 0.5395]}, {"w": "as", "b": [0.2387, 0.5197, 0.2597, 0.5395]}, {"w": "an", "b": [0.266, 0.5197, 0.2898, 0.5395]}, {"w": "abstract,", "b": [0.2961, 0.5197, 0.3809, 0.5395]}, {"w": "reusable", "b": [0.3872, 0.5197, 0.4712, 0.5395]}, {"w": "library.", "b": [0.4776, 0.5197, 0.5494, 0.5395]}, {"w": "Engineers", "b": [0.5557, 0.5197, 0.6566, 0.5395]}, {"w": "who", "b": [0.6629, 0.5197, 0.7063, 0.5395]}, {"w": "face", "b": [0.7126, 0.5197, 0.7546, 0.5395]}, {"w": "a", "b": [0.7609, 0.5197, 0.7721, 0.5395]}, {"w": "similar", "b": [0.7785, 0.5197, 0.8485, 0.5395]}, {"w": "problem", "b": [0.1294, 0.5402, 0.2135, 0.56]}, {"w": "in", "b": [0.2198, 0.5402, 0.2394, 0.56]}, {"w": "the", "b": [0.2457, 0.5402, 0.2766, 0.56]}, {"w": "future", "b": [0.2829, 0.5402, 0.3431, 0.56]}, {"w": "will", "b": [0.3494, 0.5402, 0.3887, 0.56]}, {"w": "be", "b": [0.395, 0.5402, 0.4188, 0.56]}, {"w": "able", "b": [0.4251, 0.5402, 0.4671, 0.56]}, {"w": "to", "b": [0.4733, 0.5402, 0.493, 0.56]}, {"w": "search", "b": [0.4993, 0.5402, 0.5637, 0.56]}, {"w": "for", "b": [0.57, 0.5402, 0.5994, 0.56]}, {"w": "existing", "b": [0.6057, 0.5402, 0.6856, 0.56]}, {"w": "libraries,", "b": [0.6919, 0.5402, 0.7809, 0.56]}, {"w": "download", "b": [0.1294, 0.5607, 0.2289, 0.5805]}, {"w": "one,", "b": [0.2352, 0.5607, 0.2779, 0.5805]}, {"w": "and", "b": [0.2842, 0.5607, 0.3207, 0.5805]}, {"w": "use", "b": [0.327, 0.5607, 0.3606, 0.5805]}, {"w": "it", "b": [0.3669, 0.5607, 0.3809, 0.5805]}, {"w": "in", "b": [0.3872, 0.5607, 0.4069, 0.5805]}, {"w": "their", "b": [0.4132, 0.5607, 0.4594, 0.5805]}, {"w": "own", "b": [0.4657, 0.5607, 0.5092, 0.5805]}, {"w": "project.", "b": [0.5155, 0.5607, 0.5918, 0.5805]}, {"w": "In", "b": [0.5981, 0.5607, 0.6191, 0.5805]}, {"w": "a", "b": [0.6255, 0.5607, 0.6367, 0.5805]}, {"w": "similar", "b": [0.643, 0.5607, 0.713, 0.5805]}, {"w": "way,", "b": [0.7193, 0.5607, 0.766, 0.5805]}, {"w": "in", "b": [0.7723, 0.5607, 0.7919, 0.5805]}, {"w": "the", "b": [0.7982, 0.5607, 0.829, 0.5805]}, {"w": "future,", "b": [0.1294, 0.5812, 0.196, 0.601]}, {"w": "metalearning", "b": [0.2023, 0.5812, 0.334, 0.601]}, {"w": "systems", "b": [0.3402, 0.5812, 0.4201, 0.601]}, {"w": "will", "b": [0.4264, 0.5812, 0.4657, 0.601]}, {"w": "be", "b": [0.472, 0.5812, 0.4958, 0.601]}, {"w": "able", "b": [0.5021, 0.5812, 0.5441, 0.601]}, {"w": "to", "b": [0.5504, 0.5812, 0.5701, 0.601]}, {"w": "assemble", "b": [0.5764, 0.5812, 0.6688, 0.601]}, {"w": "new", "b": [0.6751, 0.5812, 0.7172, 0.601]}, {"w": "programs", "b": [0.7235, 0.5812, 0.8188, 0.601]}, {"w": "by", "b": [0.8251, 0.5812, 0.8503, 0.601]}, {"w": "sifting", "b": [0.1294, 0.6017, 0.1939, 0.6215]}, {"w": "through", "b": [0.2002, 0.6017, 0.2787, 0.6215]}, {"w": "a", "b": [0.285, 0.6017, 0.2962, 0.6215]}, {"w": "global", "b": [0.3025, 0.6017, 0.3656, 0.6215]}, {"w": "library", "b": [0.3719, 0.6017, 0.4391, 0.6215]}, {"w": "of", "b": [0.4454, 0.6017, 0.4664, 0.6215]}, {"w": "high-level", "b": [0.4727, 0.6017, 0.575, 0.6215]}, {"w": "reusable", "b": [0.5813, 0.6017, 0.6654, 0.6215]}, {"w": "blocks.", "b": [0.6717, 0.6017, 0.7439, 0.6215]}, {"w": "When", "b": [0.7502, 0.6017, 0.8104, 0.6215]}, {"w": "the", "b": [0.8167, 0.6017, 0.8475, 0.6215]}, {"w": "system", "b": [0.1294, 0.6222, 0.1995, 0.642]}, {"w": "finds", "b": [0.2058, 0.6222, 0.2562, 0.642]}, {"w": "itself", "b": [0.2626, 0.6222, 0.313, 0.642]}, {"w": "developing", "b": [0.3193, 0.6222, 0.4314, 0.642]}, {"w": "similar", "b": [0.4377, 0.6222, 0.5078, 0.642]}, {"w": "program", "b": [0.5141, 0.6222, 0.5996, 0.642]}, {"w": "subroutines", "b": [0.6059, 0.6222, 0.7222, 0.642]}, {"w": "for", "b": [0.7285, 0.6222, 0.7579, 0.642]}, {"w": "several", "b": [0.7642, 0.6222, 0.8357, 0.642]}, {"w": "different", "b": [0.1294, 0.6427, 0.2158, 0.6625]}, {"w": "tasks,", "b": [0.2221, 0.6427, 0.2789, 0.6625]}, {"w": "it", "b": [0.2852, 0.6427, 0.2992, 0.6625]}, {"w": "can", "b": [0.3055, 0.6427, 0.3405, 0.6625]}, {"w": "come", "b": [0.3468, 0.6427, 0.4015, 0.6625]}, {"w": "up", "b": [0.4078, 0.6427, 0.433, 0.6625]}, {"w": "with", "b": [0.4393, 0.6427, 0.4842, 0.6625]}, {"w": "an", "b": [0.4905, 0.6427, 0.5143, 0.6625]}, {"w": "abstract,", "b": [0.5206, 0.6427, 0.6053, 0.6625]}, {"w": "reusable", "b": [0.6116, 0.6427, 0.6957, 0.6625]}, {"w": "version", "b": [0.7019, 0.6427, 0.7762, 0.6625]}, {"w": "of", "b": [0.7825, 0.6427, 0.8035, 0.6625]}, {"w": "the", "b": [0.8098, 0.6427, 0.8406, 0.6625]}, {"w": "subroutine", "b": [0.1294, 0.6632, 0.2359, 0.683]}, {"w": "and", "b": [0.2422, 0.6632, 0.2786, 0.683]}, {"w": "store", "b": [0.285, 0.6632, 0.334, 0.683]}, {"w": "it", "b": [0.3403, 0.6632, 0.3543, 0.683]}, {"w": "in", "b": [0.3606, 0.6632, 0.3803, 0.683]}, {"w": "the", "b": [0.3866, 0.6632, 0.4174, 0.683]}, {"w": "global", "b": [0.4237, 0.6632, 0.4868, 0.683]}, {"w": "library", "b": [0.4931, 0.6632, 0.5603, 0.683]}, {"w": "(see", "b": [0.5666, 0.6632, 0.6072, 0.683]}, {"w": "figure", "b": [0.6135, 0.6632, 0.6737, 0.683]}, {"w": "9.6).", "b": [0.68, 0.6632, 0.7262, 0.683]}, {"w": "Such", "b": [0.7325, 0.6632, 0.783, 0.683]}, {"w": "a", "b": [0.7893, 0.6632, 0.8005, 0.683]}, {"w": "process", "b": [0.1294, 0.6837, 0.2051, 0.7035]}, {"w": "will", "b": [0.2114, 0.6837, 0.2506, 0.7035]}, {"w": "implement", "b": [0.2569, 0.6837, 0.3648, 0.7035]}, {"w": "abstraction:", "b": [0.3711, 0.6837, 0.493, 0.7035]}, {"w": "a", "b": [0.4993, 0.6837, 0.5105, 0.7035]}, {"w": "necessary", "b": [0.5168, 0.6837, 0.6149, 0.7035]}, {"w": "component", "b": [0.6212, 0.6837, 0.7333, 0.7035]}, {"w": "for", "b": [0.7396, 0.6837, 0.769, 0.7035]}, {"w": "achieving", "b": [0.1294, 0.7042, 0.2275, 0.724]}, {"w": "extreme", "b": [0.2338, 0.7042, 0.315, 0.724]}, {"w": "generalization.", "b": [0.3214, 0.7042, 0.4706, 0.724]}, {"w": "A", "b": [0.4769, 0.7042, 0.4951, 0.724]}, {"w": "subroutine", "b": [0.5014, 0.7042, 0.6079, 0.724]}, {"w": "that’s", "b": [0.6142, 0.7042, 0.6688, 0.724]}, {"w": "useful", "b": [0.6751, 0.7042, 0.7367, 0.724]}, {"w": "across", "b": [0.743, 0.7042, 0.8061, 0.724]}, {"w": "different", "b": [0.1294, 0.7247, 0.2158, 0.7445]}, {"w": "tasks", "b": [0.2221, 0.7247, 0.2726, 0.7445]}, {"w": "and", "b": [0.2789, 0.7247, 0.3153, 0.7445]}, {"w": "domains", "b": [0.3216, 0.7247, 0.4071, 0.7445]}, {"w": "can", "b": [0.4134, 0.7247, 0.4484, 0.7445]}, {"w": "be", "b": [0.4547, 0.7247, 0.4785, 0.7445]}, {"w": "said", "b": [0.4848, 0.7247, 0.5254, 0.7445]}, {"w": "to", "b": [0.5317, 0.7247, 0.5514, 0.7445]}, {"w": "abstract", "b": [0.5576, 0.7247, 0.6403, 0.7445]}, {"w": "some", "b": [0.6466, 0.7247, 0.6999, 0.7445]}, {"w": "aspect", "b": [0.7062, 0.7247, 0.7692, 0.7445]}, {"w": "of", "b": [0.7755, 0.7247, 0.7965, 0.7445]}, {"w": "problem", "b": [0.1294, 0.7452, 0.2135, 0.765]}, {"w": "solving.", "b": [0.2198, 0.7452, 0.3004, 0.765]}, {"w": "This", "b": [0.3067, 0.7452, 0.3516, 0.765]}, {"w": "definition", "b": [0.3579, 0.7452, 0.456, 0.765]}, {"w": "of", "b": [0.4623, 0.7452, 0.4833, 0.765]}, {"w": "abstraction", "b": [0.4896, 0.7452, 0.6003, 0.765]}, {"w": "is", "b": [0.6066, 0.7452, 0.6234, 0.765]}, {"w": "similar", "b": [0.6297, 0.7452, 0.6998, 0.765]}, {"w": "to", "b": [0.7061, 0.7452, 0.7257, 0.765]}, {"w": "the", "b": [0.732, 0.7452, 0.7629, 0.765]}, {"w": "notion", "b": [0.7692, 0.7452, 0.8336, 0.765]}, {"w": "of", "b": [0.8399, 0.7452, 0.861, 0.765]}, {"w": "abstraction", "b": [0.1294, 0.7657, 0.2401, 0.7855]}, {"w": "in", "b": [0.2464, 0.7657, 0.266, 0.7855]}, {"w": "software", "b": [0.2723, 0.7657, 0.3592, 0.7855]}, {"w": "engineering.", "b": [0.3655, 0.7657, 0.4909, 0.7855]}, {"w": "These", "b": [0.4972, 0.7657, 0.5574, 0.7855]}, {"w": "subroutines", "b": [0.5637, 0.7657, 0.68, 0.7855]}, {"w": "can", "b": [0.6863, 0.7657, 0.7213, 0.7855]}, {"w": "be", "b": [0.7276, 0.7657, 0.7515, 0.7855]}, {"w": "either", "b": [0.7578, 0.7657, 0.8152, 0.7855]}, {"w": "geometric", "b": [0.1294, 0.7862, 0.2303, 0.806]}, {"w": "(deep-learning", "b": [0.2366, 0.7862, 0.3837, 0.806]}, {"w": "modules", "b": [0.39, 0.7862, 0.4755, 0.806]}, {"w": "with", "b": [0.4818, 0.7862, 0.5266, 0.806]}, {"w": "pretrained", "b": [0.5329, 0.7862, 0.6352, 0.806]}, {"w": "representations)", "b": [0.6415, 0.7862, 0.8026, 0.806]}, {"w": "or", "b": [0.8089, 0.7862, 0.83, 0.806]}, {"w": "algorithmic", "b": [0.1294, 0.8067, 0.2457, 0.8265]}, {"w": "(closer", "b": [0.252, 0.8067, 0.3207, 0.8265]}, {"w": "to", "b": [0.327, 0.8067, 0.3466, 0.8265]}, {"w": "the", "b": [0.3529, 0.8067, 0.3837, 0.8265]}, {"w": "libraries", "b": [0.39, 0.8067, 0.4727, 0.8265]}, {"w": "that", "b": [0.479, 0.8067, 0.5168, 0.8265]}, {"w": "contemporary", "b": [0.5231, 0.8067, 0.6632, 0.8265]}, {"w": "software", "b": [0.6695, 0.8067, 0.7564, 0.8265]}, {"w": "engineers", "b": [0.7627, 0.8067, 0.8593, 0.8265]}, {"w": "manipulate).", "b": [0.1294, 0.8272, 0.2562, 0.847]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 9.6. A meta-learner capable of quickly developing task-specific models using reusable primitives (both algorithmic and geometric), thus achieving extreme generalization", "words": [{"w": "Figure", "b": [0.1294, 0.8695, 0.1827, 0.8844]}, {"w": "9.6.", "b": [0.1874, 0.8695, 0.2158, 0.8844]}, {"w": "A", "b": [0.2205, 0.8695, 0.2341, 0.8844]}, {"w": "meta-learner", "b": [0.2389, 0.8695, 0.3439, 0.8844]}, {"w": "capable", "b": [0.3487, 0.8695, 0.4107, 0.8844]}, {"w": "of", "b": [0.4154, 0.8695, 0.4312, 0.8844]}, {"w": "quickly", "b": [0.4359, 0.8695, 0.4958, 0.8844]}, {"w": "developing", "b": [0.5006, 0.8695, 0.5878, 0.8844]}, {"w": "task-specific", "b": [0.5925, 0.8695, 0.6924, 0.8844]}, {"w": "models", "b": [0.6971, 0.8695, 0.7539, 0.8844]}, {"w": "using", "b": [0.7586, 0.8695, 0.8017, 0.8844]}, {"w": "reusable", "b": [0.1294, 0.8847, 0.1974, 0.8995]}, {"w": "primitives", "b": [0.2021, 0.8847, 0.2841, 0.8995]}, {"w": "(both", "b": [0.2888, 0.8847, 0.3319, 0.8995]}, {"w": "algorithmic", "b": [0.3367, 0.8847, 0.4302, 0.8995]}, {"w": "and", "b": [0.4349, 0.8847, 0.4654, 0.8995]}, {"w": "geometric),", "b": [0.4701, 0.8847, 0.561, 0.8995]}, {"w": "thus", "b": [0.5657, 0.8847, 0.6004, 0.8995]}, {"w": "achieving", "b": [0.6051, 0.8847, 0.6819, 0.8995]}, {"w": "extreme", "b": [0.6866, 0.8847, 0.7514, 0.8995]}, {"w": "generalization", "b": [0.7561, 0.8847, 0.8707, 0.8995]}]}]}, {"page": 436, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "9.3.5. The long-term vision", "words": [{"w": "9.3.5.", "b": [0.1294, 0.3789, 0.1862, 0.3987]}, {"w": "The", "b": [0.1925, 0.3789, 0.2345, 0.3987]}, {"w": "long-term", "b": [0.2408, 0.3789, 0.3473, 0.3987]}, {"w": "vision", "b": [0.3536, 0.3789, 0.4167, 0.3987]}]}, {"id": "b_1", "type": "equation", "text": "In short, here’s my long-term vision for machine learning:", "words": [{"w": "In", "b": [0.1294, 0.4217, 0.1504, 0.4414]}, {"w": "short,", "b": [0.1567, 0.4217, 0.2135, 0.4414]}, {"w": "here’s", "b": [0.2198, 0.4217, 0.28, 0.4414]}, {"w": "my", "b": [0.2863, 0.4217, 0.3186, 0.4414]}, {"w": "long-term", "b": [0.3249, 0.4217, 0.4244, 0.4414]}, {"w": "vision", "b": [0.4307, 0.4217, 0.4923, 0.4414]}, {"w": "for", "b": [0.4987, 0.4217, 0.5281, 0.4414]}, {"w": "machine", "b": [0.5344, 0.4217, 0.6198, 0.4414]}, {"w": "learning:", "b": [0.6261, 0.4217, 0.7158, 0.4414]}]}, {"id": "b_2", "type": "paragraph", "text": "Models will be more like programs and will have capabilities that go far beyond the continuous geometric transformations of the input data we currently work with. These programs will arguably be much closer to the abstract mental models that humans maintain about their surroundings and themselves, and they will be capable of stronger generalization due to their rich algorithmic nature. In particular, models will blend algorithmic modules providing formal reasoning, search, and abstraction capabilities with geometric modules providing informal intuition and pattern- recognition capabilities. AlphaGo (a system that required a lot of manual software engineering and human-made design decisions) provides an early example of what such a blend of symbolic and geometric AI could look like. Such models will be grown automatically rather than hardcoded by human engineers, using modular parts stored in a global library of reusable subroutines—a library evolved by learning high- performing models on thousands of previous tasks and datasets. As frequent problem-solving patterns are identified by the meta- learning system, they will be turned into reusable subroutines— much like functions and classes in software engineering—and added to the global library. This will achieve abstraction.", "words": [{"w": "Models", "b": [0.1799, 0.46, 0.2555, 0.4798]}, {"w": "will", "b": [0.2618, 0.46, 0.3011, 0.4798]}, {"w": "be", "b": [0.3074, 0.46, 0.3312, 0.4798]}, {"w": "more", "b": [0.3375, 0.46, 0.3894, 0.4798]}, {"w": "like", "b": [0.3957, 0.46, 0.4335, 0.4798]}, {"w": "programs", "b": [0.4398, 0.46, 0.5351, 0.4798]}, {"w": "and", "b": [0.5414, 0.46, 0.5778, 0.4798]}, {"w": "will", "b": [0.5841, 0.46, 0.6234, 0.4798]}, {"w": "have", "b": [0.6297, 0.46, 0.6773, 0.4798]}, {"w": "capabilities", "b": [0.6836, 0.46, 0.7985, 0.4798]}, {"w": "that", "b": [0.8048, 0.46, 0.8427, 0.4798]}, {"w": "go", "b": [0.1799, 0.4805, 0.2051, 0.5003]}, {"w": "far", "b": [0.2114, 0.4805, 0.2394, 0.5003]}, {"w": "beyond", "b": [0.2457, 0.4805, 0.32, 0.5003]}, {"w": "the", "b": [0.3263, 0.4805, 0.3571, 0.5003]}, {"w": "continuous", "b": [0.3634, 0.4805, 0.4741, 0.5003]}, {"w": "geometric", "b": [0.4804, 0.4805, 0.5813, 0.5003]}, {"w": "transformations", "b": [0.5876, 0.4805, 0.746, 0.5003]}, {"w": "of", "b": [0.7523, 0.4805, 0.7733, 0.5003]}, {"w": "the", "b": [0.7795, 0.4805, 0.8103, 0.5003]}, {"w": "input", "b": [0.8166, 0.4805, 0.8685, 0.5003]}, {"w": "data", "b": [0.1799, 0.501, 0.2219, 0.5208]}, {"w": "we", "b": [0.2282, 0.501, 0.2576, 0.5208]}, {"w": "currently", "b": [0.2639, 0.501, 0.355, 0.5208]}, {"w": "work", "b": [0.3613, 0.501, 0.4131, 0.5208]}, {"w": "with.", "b": [0.4194, 0.501, 0.4706, 0.5208]}, {"w": "These", "b": [0.4769, 0.501, 0.5371, 0.5208]}, {"w": "programs", "b": [0.5434, 0.501, 0.6387, 0.5208]}, {"w": "will", "b": [0.645, 0.501, 0.6843, 0.5208]}, {"w": "arguably", "b": [0.6906, 0.501, 0.7783, 0.5208]}, {"w": "be", "b": [0.7846, 0.501, 0.8085, 0.5208]}, {"w": "much", "b": [0.1799, 0.5215, 0.2359, 0.5413]}, {"w": "closer", "b": [0.2422, 0.5215, 0.3025, 0.5413]}, {"w": "to", "b": [0.3088, 0.5215, 0.3284, 0.5413]}, {"w": "the", "b": [0.3347, 0.5215, 0.3655, 0.5413]}, {"w": "abstract", "b": [0.3718, 0.5215, 0.4503, 0.5413]}, {"w": "mental", "b": [0.4566, 0.5215, 0.5253, 0.5413]}, {"w": "models", "b": [0.5316, 0.5215, 0.6044, 0.5413]}, {"w": "that", "b": [0.6107, 0.5215, 0.6486, 0.5413]}, {"w": "humans", "b": [0.6549, 0.5215, 0.7334, 0.5413]}, {"w": "maintain", "b": [0.7396, 0.5215, 0.8279, 0.5413]}, {"w": "about", "b": [0.1799, 0.542, 0.2359, 0.5618]}, {"w": "their", "b": [0.2422, 0.542, 0.2885, 0.5618]}, {"w": "surroundings", "b": [0.2948, 0.542, 0.4265, 0.5618]}, {"w": "and", "b": [0.4328, 0.542, 0.4692, 0.5618]}, {"w": "themselves,", "b": [0.4755, 0.542, 0.5939, 0.5618]}, {"w": "and", "b": [0.6003, 0.542, 0.6367, 0.5618]}, {"w": "they", "b": [0.643, 0.542, 0.6864, 0.5618]}, {"w": "will", "b": [0.6927, 0.542, 0.732, 0.5618]}, {"w": "be", "b": [0.7383, 0.542, 0.7621, 0.5618]}, {"w": "capable", "b": [0.7684, 0.542, 0.8454, 0.5618]}, {"w": "of", "b": [0.1799, 0.5625, 0.2009, 0.5823]}, {"w": "stronger", "b": [0.2072, 0.5625, 0.2898, 0.5823]}, {"w": "generalization", "b": [0.2962, 0.5625, 0.4391, 0.5823]}, {"w": "due", "b": [0.4454, 0.5625, 0.4818, 0.5823]}, {"w": "to", "b": [0.4881, 0.5625, 0.5077, 0.5823]}, {"w": "their", "b": [0.514, 0.5625, 0.5603, 0.5823]}, {"w": "rich", "b": [0.5666, 0.5625, 0.6058, 0.5823]}, {"w": "algorithmic", "b": [0.6121, 0.5625, 0.7284, 0.5823]}, {"w": "nature.", "b": [0.7346, 0.5625, 0.804, 0.5823]}, {"w": "In", "b": [0.1799, 0.583, 0.2009, 0.6028]}, {"w": "particular,", "b": [0.2072, 0.583, 0.3091, 0.6028]}, {"w": "models", "b": [0.3154, 0.583, 0.3883, 0.6028]}, {"w": "will", "b": [0.3946, 0.583, 0.4339, 0.6028]}, {"w": "blend", "b": [0.4402, 0.583, 0.4962, 0.6028]}, {"w": "algorithmic", "b": [0.5025, 0.583, 0.6202, 0.6028]}, {"w": "modules", "b": [0.6265, 0.583, 0.7106, 0.6028]}, {"w": "providing", "b": [0.7169, 0.583, 0.815, 0.6028]}, {"w": "formal", "b": [0.1799, 0.6035, 0.2471, 0.6233]}, {"w": "reasoning,", "b": [0.2534, 0.6035, 0.3578, 0.6233]}, {"w": "search,", "b": [0.3641, 0.6035, 0.4348, 0.6233]}, {"w": "and", "b": [0.4412, 0.6035, 0.4776, 0.6233]}, {"w": "abstraction", "b": [0.4839, 0.6035, 0.5946, 0.6233]}, {"w": "capabilities", "b": [0.6009, 0.6035, 0.7158, 0.6233]}, {"w": "with", "b": [0.7221, 0.6035, 0.7669, 0.6233]}, {"w": "geometric", "b": [0.1799, 0.624, 0.2807, 0.6438]}, {"w": "modules", "b": [0.287, 0.624, 0.3711, 0.6438]}, {"w": "providing", "b": [0.3774, 0.624, 0.4755, 0.6438]}, {"w": "informal", "b": [0.4818, 0.624, 0.5687, 0.6438]}, {"w": "intuition", "b": [0.575, 0.624, 0.6605, 0.6438]}, {"w": "and", "b": [0.6668, 0.624, 0.7033, 0.6438]}, {"w": "pattern-", "b": [0.7096, 0.624, 0.788, 0.6438]}, {"w": "recognition", "b": [0.1799, 0.6445, 0.2948, 0.6643]}, {"w": "capabilities.", "b": [0.3011, 0.6445, 0.4223, 0.6643]}, {"w": "AlphaGo", "b": [0.4286, 0.6445, 0.5211, 0.6643]}, {"w": "(a", "b": [0.5274, 0.6445, 0.547, 0.6643]}, {"w": "system", "b": [0.5533, 0.6445, 0.6234, 0.6643]}, {"w": "that", "b": [0.6297, 0.6445, 0.6675, 0.6643]}, {"w": "required", "b": [0.6738, 0.6445, 0.7579, 0.6643]}, {"w": "a", "b": [0.7642, 0.6445, 0.7754, 0.6643]}, {"w": "lot", "b": [0.7817, 0.6445, 0.8083, 0.6643]}, {"w": "of", "b": [0.8146, 0.6445, 0.8356, 0.6643]}, {"w": "manual", "b": [0.1799, 0.665, 0.2541, 0.6848]}, {"w": "software", "b": [0.2604, 0.665, 0.3473, 0.6848]}, {"w": "engineering", "b": [0.3536, 0.665, 0.4727, 0.6848]}, {"w": "and", "b": [0.479, 0.665, 0.5154, 0.6848]}, {"w": "human-made", "b": [0.5217, 0.665, 0.6534, 0.6848]}, {"w": "design", "b": [0.6597, 0.665, 0.7256, 0.6848]}, {"w": "decisions)", "b": [0.7319, 0.665, 0.8342, 0.6848]}, {"w": "provides", "b": [0.1799, 0.6855, 0.2667, 0.7053]}, {"w": "an", "b": [0.273, 0.6855, 0.2969, 0.7053]}, {"w": "early", "b": [0.3032, 0.6855, 0.3536, 0.7053]}, {"w": "example", "b": [0.3599, 0.6855, 0.4454, 0.7053]}, {"w": "of", "b": [0.4517, 0.6855, 0.4727, 0.7053]}, {"w": "what", "b": [0.479, 0.6855, 0.528, 0.7053]}, {"w": "such", "b": [0.5343, 0.6855, 0.5806, 0.7053]}, {"w": "a", "b": [0.5869, 0.6855, 0.5981, 0.7053]}, {"w": "blend", "b": [0.6044, 0.6855, 0.6604, 0.7053]}, {"w": "of", "b": [0.6667, 0.6855, 0.6878, 0.7053]}, {"w": "symbolic", "b": [0.6941, 0.6855, 0.7866, 0.7053]}, {"w": "and", "b": [0.7929, 0.6855, 0.8293, 0.7053]}, {"w": "geometric", "b": [0.1799, 0.706, 0.2807, 0.7258]}, {"w": "AI", "b": [0.287, 0.706, 0.3137, 0.7258]}, {"w": "could", "b": [0.32, 0.706, 0.376, 0.7258]}, {"w": "look", "b": [0.3823, 0.706, 0.4271, 0.7258]}, {"w": "like.", "b": [0.4334, 0.706, 0.4776, 0.7258]}, {"w": "Such", "b": [0.1799, 0.7265, 0.2303, 0.7463]}, {"w": "models", "b": [0.2366, 0.7265, 0.3095, 0.7463]}, {"w": "will", "b": [0.3158, 0.7265, 0.3551, 0.7463]}, {"w": "be", "b": [0.3614, 0.7265, 0.3852, 0.7463]}, {"w": "grown", "b": [0.3914, 0.7265, 0.455, 0.7463]}, {"w": "automatically", "b": [0.4613, 0.7265, 0.5986, 0.7463]}, {"w": "rather", "b": [0.6049, 0.7265, 0.6638, 0.7463]}, {"w": "than", "b": [0.6701, 0.7265, 0.7135, 0.7463]}, {"w": "hardcoded", "b": [0.7198, 0.7265, 0.8249, 0.7463]}, {"w": "by", "b": [0.8312, 0.7265, 0.8564, 0.7463]}, {"w": "human", "b": [0.1799, 0.747, 0.2485, 0.7668]}, {"w": "engineers,", "b": [0.2548, 0.747, 0.3578, 0.7668]}, {"w": "using", "b": [0.3641, 0.747, 0.4188, 0.7668]}, {"w": "modular", "b": [0.4251, 0.747, 0.5092, 0.7668]}, {"w": "parts", "b": [0.5155, 0.747, 0.5645, 0.7668]}, {"w": "stored", "b": [0.5708, 0.747, 0.6325, 0.7668]}, {"w": "in", "b": [0.6388, 0.747, 0.6584, 0.7668]}, {"w": "a", "b": [0.6647, 0.747, 0.6759, 0.7668]}, {"w": "global", "b": [0.6822, 0.747, 0.7453, 0.7668]}, {"w": "library", "b": [0.7516, 0.747, 0.8188, 0.7668]}, {"w": "of", "b": [0.8251, 0.747, 0.8462, 0.7668]}, {"w": "reusable", "b": [0.1799, 0.7675, 0.2639, 0.7873]}, {"w": "subroutines—a", "b": [0.2702, 0.7675, 0.423, 0.7873]}, {"w": "library", "b": [0.4292, 0.7675, 0.4965, 0.7873]}, {"w": "evolved", "b": [0.5028, 0.7675, 0.5827, 0.7873]}, {"w": "by", "b": [0.589, 0.7675, 0.6142, 0.7873]}, {"w": "learning", "b": [0.6205, 0.7675, 0.7032, 0.7873]}, {"w": "high-", "b": [0.7095, 0.7675, 0.7627, 0.7873]}, {"w": "performing", "b": [0.1799, 0.788, 0.2934, 0.8078]}, {"w": "models", "b": [0.2997, 0.788, 0.3725, 0.8078]}, {"w": "on", "b": [0.3788, 0.788, 0.4041, 0.8078]}, {"w": "thousands", "b": [0.4104, 0.788, 0.5113, 0.8078]}, {"w": "of", "b": [0.5176, 0.788, 0.5386, 0.8078]}, {"w": "previous", "b": [0.5449, 0.788, 0.6318, 0.8078]}, {"w": "tasks", "b": [0.6381, 0.788, 0.6885, 0.8078]}, {"w": "and", "b": [0.6948, 0.788, 0.7313, 0.8078]}, {"w": "datasets.", "b": [0.7376, 0.788, 0.8238, 0.8078]}, {"w": "As", "b": [0.8301, 0.788, 0.8581, 0.8078]}, {"w": "frequent", "b": [0.1799, 0.8085, 0.2639, 0.8283]}, {"w": "problem-solving", "b": [0.2702, 0.8085, 0.437, 0.8283]}, {"w": "patterns", "b": [0.4433, 0.8085, 0.5231, 0.8283]}, {"w": "are", "b": [0.5294, 0.8085, 0.5602, 0.8283]}, {"w": "identified", "b": [0.5665, 0.8085, 0.6632, 0.8283]}, {"w": "by", "b": [0.6695, 0.8085, 0.6948, 0.8283]}, {"w": "the", "b": [0.7011, 0.8085, 0.7319, 0.8283]}, {"w": "meta-", "b": [0.7382, 0.8085, 0.7956, 0.8283]}, {"w": "learning", "b": [0.1799, 0.829, 0.2625, 0.8488]}, {"w": "system,", "b": [0.2688, 0.829, 0.3452, 0.8488]}, {"w": "they", "b": [0.3515, 0.829, 0.395, 0.8488]}, {"w": "will", "b": [0.4013, 0.829, 0.4405, 0.8488]}, {"w": "be", "b": [0.4468, 0.829, 0.4706, 0.8488]}, {"w": "turned", "b": [0.4769, 0.829, 0.5414, 0.8488]}, {"w": "into", "b": [0.5477, 0.829, 0.587, 0.8488]}, {"w": "reusable", "b": [0.5933, 0.829, 0.6773, 0.8488]}, {"w": "subroutines—", "b": [0.6836, 0.829, 0.8252, 0.8488]}, {"w": "much", "b": [0.1799, 0.8495, 0.2359, 0.8693]}, {"w": "like", "b": [0.2422, 0.8495, 0.2801, 0.8693]}, {"w": "functions", "b": [0.2864, 0.8495, 0.3803, 0.8693]}, {"w": "and", "b": [0.3866, 0.8495, 0.423, 0.8693]}, {"w": "classes", "b": [0.4293, 0.8495, 0.4993, 0.8693]}, {"w": "in", "b": [0.5056, 0.8495, 0.5252, 0.8693]}, {"w": "software", "b": [0.5316, 0.8495, 0.6184, 0.8693]}, {"w": "engineering—and", "b": [0.6247, 0.8495, 0.8055, 0.8693]}, {"w": "added", "b": [0.1799, 0.87, 0.2401, 0.8898]}, {"w": "to", "b": [0.2464, 0.87, 0.266, 0.8898]}, {"w": "the", "b": [0.2723, 0.87, 0.3032, 0.8898]}, {"w": "global", "b": [0.3095, 0.87, 0.3725, 0.8898]}, {"w": "library.", "b": [0.3788, 0.87, 0.4507, 0.8898]}, {"w": "This", "b": [0.457, 0.87, 0.5019, 0.8898]}, {"w": "will", "b": [0.5082, 0.87, 0.5474, 0.8898]}, {"w": "achieve", "b": [0.5537, 0.87, 0.6308, 0.8898]}, {"w": "abstraction.", "b": [0.637, 0.87, 0.7583, 0.8898]}]}]}, {"page": 437, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "This global library and associated model-growing system will be able to achieve some form of human-like extreme generalization: given a new task or situation, the system will be able to assemble a new working model appropriate for the task using very little data, thanks to rich program-like primitives that generalize well, and extensive experience with similar tasks. In the same way, humans can quickly learn to play a complex new video game if they have experience with many previous games, because the models derived from this previous experience are abstract and program-like, rather than a basic mapping between stimuli and action. As such, this perpetually learning model-growing system can be interpreted as an artificial general intelligence (AGI). But don’t expect any singularitarian robot apocalypse to ensue: that’s pure fantasy, coming from a long series of profound misunderstandings of both intelligence and technology. Such a critique, however, doesn’t belong in this book.", "words": [{"w": "This", "b": [0.1799, 0.0857, 0.2247, 0.1054]}, {"w": "global", "b": [0.231, 0.0857, 0.2941, 0.1054]}, {"w": "library", "b": [0.3004, 0.0857, 0.3676, 0.1054]}, {"w": "and", "b": [0.374, 0.0857, 0.4104, 0.1054]}, {"w": "associated", "b": [0.4167, 0.0857, 0.5204, 0.1054]}, {"w": "model-growing", "b": [0.5267, 0.0857, 0.6822, 0.1054]}, {"w": "system", "b": [0.6885, 0.0857, 0.7586, 0.1054]}, {"w": "will", "b": [0.7649, 0.0857, 0.8042, 0.1054]}, {"w": "be", "b": [0.8105, 0.0857, 0.8343, 0.1054]}, {"w": "able", "b": [0.1799, 0.1062, 0.2219, 0.1259]}, {"w": "to", "b": [0.2282, 0.1062, 0.2478, 0.1259]}, {"w": "achieve", "b": [0.2541, 0.1062, 0.3312, 0.1259]}, {"w": "some", "b": [0.3375, 0.1062, 0.3907, 0.1259]}, {"w": "form", "b": [0.397, 0.1062, 0.4461, 0.1259]}, {"w": "of", "b": [0.4524, 0.1062, 0.4734, 0.1259]}, {"w": "human-like", "b": [0.4797, 0.1062, 0.5946, 0.1259]}, {"w": "extreme", "b": [0.6009, 0.1062, 0.6822, 0.1259]}, {"w": "generalization:", "b": [0.6885, 0.1062, 0.8384, 0.1259]}, {"w": "given", "b": [0.1799, 0.1267, 0.2359, 0.1464]}, {"w": "a", "b": [0.2422, 0.1267, 0.2534, 0.1464]}, {"w": "new", "b": [0.2597, 0.1267, 0.3018, 0.1464]}, {"w": "task", "b": [0.3081, 0.1267, 0.3487, 0.1464]}, {"w": "or", "b": [0.355, 0.1267, 0.376, 0.1464]}, {"w": "situation,", "b": [0.3823, 0.1267, 0.4755, 0.1464]}, {"w": "the", "b": [0.4818, 0.1267, 0.5127, 0.1464]}, {"w": "system", "b": [0.519, 0.1267, 0.5891, 0.1464]}, {"w": "will", "b": [0.5954, 0.1267, 0.6346, 0.1464]}, {"w": "be", "b": [0.6409, 0.1267, 0.6647, 0.1464]}, {"w": "able", "b": [0.671, 0.1267, 0.7131, 0.1464]}, {"w": "to", "b": [0.7194, 0.1267, 0.739, 0.1464]}, {"w": "assemble", "b": [0.7453, 0.1267, 0.8378, 0.1464]}, {"w": "a", "b": [0.8441, 0.1267, 0.8553, 0.1464]}, {"w": "new", "b": [0.1799, 0.1472, 0.2219, 0.1669]}, {"w": "working", "b": [0.2282, 0.1472, 0.3123, 0.1669]}, {"w": "model", "b": [0.3186, 0.1472, 0.3816, 0.1669]}, {"w": "appropriate", "b": [0.388, 0.1472, 0.5028, 0.1669]}, {"w": "for", "b": [0.5091, 0.1472, 0.5385, 0.1669]}, {"w": "the", "b": [0.5449, 0.1472, 0.5757, 0.1669]}, {"w": "task", "b": [0.582, 0.1472, 0.6226, 0.1669]}, {"w": "using", "b": [0.6289, 0.1472, 0.6836, 0.1669]}, {"w": "very", "b": [0.6899, 0.1472, 0.7347, 0.1669]}, {"w": "little", "b": [0.741, 0.1472, 0.7872, 0.1669]}, {"w": "data,", "b": [0.7935, 0.1472, 0.8419, 0.1669]}, {"w": "thanks", "b": [0.1799, 0.1677, 0.2457, 0.1874]}, {"w": "to", "b": [0.252, 0.1677, 0.2717, 0.1874]}, {"w": "rich", "b": [0.278, 0.1677, 0.3172, 0.1874]}, {"w": "program-like", "b": [0.3235, 0.1677, 0.4552, 0.1874]}, {"w": "primitives", "b": [0.4615, 0.1677, 0.5638, 0.1874]}, {"w": "that", "b": [0.5701, 0.1677, 0.608, 0.1874]}, {"w": "generalize", "b": [0.6143, 0.1677, 0.7179, 0.1874]}, {"w": "well,", "b": [0.7242, 0.1677, 0.774, 0.1874]}, {"w": "and", "b": [0.7803, 0.1677, 0.8167, 0.1874]}, {"w": "extensive", "b": [0.1799, 0.1882, 0.2751, 0.2079]}, {"w": "experience", "b": [0.2814, 0.1882, 0.3907, 0.2079]}, {"w": "with", "b": [0.397, 0.1882, 0.4419, 0.2079]}, {"w": "similar", "b": [0.4482, 0.1882, 0.5182, 0.2079]}, {"w": "tasks.", "b": [0.5245, 0.1882, 0.5813, 0.2079]}, {"w": "In", "b": [0.5876, 0.1882, 0.6086, 0.2079]}, {"w": "the", "b": [0.6149, 0.1882, 0.6457, 0.2079]}, {"w": "same", "b": [0.652, 0.1882, 0.7038, 0.2079]}, {"w": "way,", "b": [0.7101, 0.1882, 0.7568, 0.2079]}, {"w": "humans", "b": [0.7631, 0.1882, 0.8416, 0.2079]}, {"w": "can", "b": [0.1799, 0.2087, 0.2149, 0.2284]}, {"w": "quickly", "b": [0.2212, 0.2087, 0.2969, 0.2284]}, {"w": "learn", "b": [0.3032, 0.2087, 0.3536, 0.2284]}, {"w": "to", "b": [0.3599, 0.2087, 0.3795, 0.2284]}, {"w": "play", "b": [0.3858, 0.2087, 0.4293, 0.2284]}, {"w": "a", "b": [0.4356, 0.2087, 0.4468, 0.2284]}, {"w": "complex", "b": [0.4531, 0.2087, 0.54, 0.2284]}, {"w": "new", "b": [0.5463, 0.2087, 0.5883, 0.2284]}, {"w": "video", "b": [0.5946, 0.2087, 0.6507, 0.2284]}, {"w": "game", "b": [0.657, 0.2087, 0.7116, 0.2284]}, {"w": "if", "b": [0.7179, 0.2087, 0.7333, 0.2284]}, {"w": "they", "b": [0.7396, 0.2087, 0.7831, 0.2284]}, {"w": "have", "b": [0.7894, 0.2087, 0.837, 0.2284]}, {"w": "experience", "b": [0.1799, 0.2292, 0.2891, 0.2489]}, {"w": "with", "b": [0.2954, 0.2292, 0.3403, 0.2489]}, {"w": "many", "b": [0.3466, 0.2292, 0.4026, 0.2489]}, {"w": "previous", "b": [0.4089, 0.2292, 0.4958, 0.2489]}, {"w": "games,", "b": [0.5021, 0.2292, 0.5729, 0.2489]}, {"w": "because", "b": [0.5791, 0.2292, 0.659, 0.2489]}, {"w": "the", "b": [0.6653, 0.2292, 0.6961, 0.2489]}, {"w": "models", "b": [0.7024, 0.2292, 0.7753, 0.2489]}, {"w": "derived", "b": [0.7816, 0.2292, 0.8573, 0.2489]}, {"w": "from", "b": [0.1799, 0.2497, 0.2289, 0.2694]}, {"w": "this", "b": [0.2352, 0.2497, 0.2717, 0.2694]}, {"w": "previous", "b": [0.278, 0.2497, 0.3648, 0.2694]}, {"w": "experience", "b": [0.3712, 0.2497, 0.4804, 0.2694]}, {"w": "are", "b": [0.4867, 0.2497, 0.5175, 0.2694]}, {"w": "abstract", "b": [0.5238, 0.2497, 0.6023, 0.2694]}, {"w": "and", "b": [0.6086, 0.2497, 0.645, 0.2694]}, {"w": "program-like,", "b": [0.6513, 0.2497, 0.7893, 0.2694]}, {"w": "rather", "b": [0.7956, 0.2497, 0.8545, 0.2694]}, {"w": "than", "b": [0.1799, 0.2702, 0.2233, 0.2899]}, {"w": "a", "b": [0.2296, 0.2702, 0.2408, 0.2899]}, {"w": "basic", "b": [0.2471, 0.2702, 0.299, 0.2899]}, {"w": "mapping", "b": [0.3053, 0.2702, 0.3936, 0.2899]}, {"w": "between", "b": [0.3999, 0.2702, 0.4839, 0.2899]}, {"w": "stimuli", "b": [0.4902, 0.2702, 0.5603, 0.2899]}, {"w": "and", "b": [0.5666, 0.2702, 0.603, 0.2899]}, {"w": "action.", "b": [0.6093, 0.2702, 0.6773, 0.2899]}, {"w": "As", "b": [0.1799, 0.2907, 0.2079, 0.3104]}, {"w": "such,", "b": [0.2142, 0.2907, 0.2667, 0.3104]}, {"w": "this", "b": [0.273, 0.2907, 0.3095, 0.3104]}, {"w": "perpetually", "b": [0.3158, 0.2907, 0.4293, 0.3104]}, {"w": "learning", "b": [0.4356, 0.2907, 0.5183, 0.3104]}, {"w": "model-growing", "b": [0.5246, 0.2907, 0.6801, 0.3104]}, {"w": "system", "b": [0.6864, 0.2907, 0.7565, 0.3104]}, {"w": "can", "b": [0.7628, 0.2907, 0.7978, 0.3104]}, {"w": "be", "b": [0.8041, 0.2907, 0.8279, 0.3104]}, {"w": "interpreted", "b": [0.1799, 0.3112, 0.2891, 0.3309]}, {"w": "as", "b": [0.2954, 0.3112, 0.3165, 0.3309]}, {"w": "an", "b": [0.3228, 0.3112, 0.3466, 0.3309]}, {"w": "artificial", "b": [0.3529, 0.3112, 0.4412, 0.3309]}, {"w": "general", "b": [0.4475, 0.3112, 0.5245, 0.3309]}, {"w": "intelligence", "b": [0.5309, 0.3112, 0.6486, 0.3309]}, {"w": "(AGI).", "b": [0.6548, 0.3112, 0.7227, 0.3309]}, {"w": "But", "b": [0.729, 0.3112, 0.7655, 0.3309]}, {"w": "don’t", "b": [0.7718, 0.3112, 0.8246, 0.3309]}, {"w": "expect", "b": [0.1799, 0.3317, 0.2457, 0.3514]}, {"w": "any", "b": [0.252, 0.3317, 0.2884, 0.3514]}, {"w": "singularitarian", "b": [0.2947, 0.3317, 0.4405, 0.3514]}, {"w": "robot", "b": [0.4468, 0.3317, 0.5, 0.3514]}, {"w": "apocalypse", "b": [0.5063, 0.3317, 0.6184, 0.3514]}, {"w": "to", "b": [0.6247, 0.3317, 0.6443, 0.3514]}, {"w": "ensue:", "b": [0.6507, 0.3317, 0.7151, 0.3514]}, {"w": "that’s", "b": [0.7214, 0.3317, 0.776, 0.3514]}, {"w": "pure", "b": [0.7823, 0.3317, 0.8271, 0.3514]}, {"w": "fantasy,", "b": [0.1799, 0.3522, 0.2574, 0.3719]}, {"w": "coming", "b": [0.2637, 0.3522, 0.3394, 0.3719]}, {"w": "from", "b": [0.3457, 0.3522, 0.3947, 0.3719]}, {"w": "a", "b": [0.401, 0.3522, 0.4122, 0.3719]}, {"w": "long", "b": [0.4185, 0.3522, 0.4634, 0.3719]}, {"w": "series", "b": [0.4697, 0.3522, 0.5271, 0.3719]}, {"w": "of", "b": [0.5334, 0.3522, 0.5544, 0.3719]}, {"w": "profound", "b": [0.5607, 0.3522, 0.6532, 0.3719]}, {"w": "misunderstandings", "b": [0.6595, 0.3522, 0.8487, 0.3719]}, {"w": "of", "b": [0.1799, 0.3727, 0.2009, 0.3924]}, {"w": "both", "b": [0.2072, 0.3727, 0.252, 0.3924]}, {"w": "intelligence", "b": [0.2583, 0.3727, 0.376, 0.3924]}, {"w": "and", "b": [0.3824, 0.3727, 0.4188, 0.3924]}, {"w": "technology.", "b": [0.4251, 0.3727, 0.5418, 0.3924]}, {"w": "Such", "b": [0.5481, 0.3727, 0.5986, 0.3924]}, {"w": "a", "b": [0.6049, 0.3727, 0.6161, 0.3924]}, {"w": "critique,", "b": [0.6224, 0.3727, 0.7057, 0.3924]}, {"w": "however,", "b": [0.712, 0.3727, 0.8042, 0.3924]}, {"w": "doesn’t", "b": [0.1799, 0.3932, 0.2537, 0.4129]}, {"w": "belong", "b": [0.26, 0.3932, 0.3286, 0.4129]}, {"w": "in", "b": [0.335, 0.3932, 0.3546, 0.4129]}, {"w": "this", "b": [0.3609, 0.3932, 0.3973, 0.4129]}, {"w": "book.", "b": [0.4036, 0.3932, 0.4604, 0.4129]}]}, {"id": "b_1", "type": "equation", "text": "9.4. Staying up to date in a fast-moving field", "words": [{"w": "9.4.", "b": [0.1294, 0.45, 0.172, 0.4722]}, {"w": "Staying", "b": [0.1791, 0.45, 0.2705, 0.4722]}, {"w": "up", "b": [0.2776, 0.45, 0.3092, 0.4722]}, {"w": "to", "b": [0.3163, 0.45, 0.3399, 0.4722]}, {"w": "date", "b": [0.347, 0.45, 0.399, 0.4722]}, {"w": "in", "b": [0.4061, 0.45, 0.4298, 0.4722]}, {"w": "a", "b": [0.4369, 0.45, 0.4511, 0.4722]}, {"w": "fast-moving", "b": [0.4582, 0.45, 0.6016, 0.4722]}, {"w": "field", "b": [0.6087, 0.45, 0.6623, 0.4722]}]}, {"id": "b_2", "type": "paragraph", "text": "As final parting words, I want to give you some pointers about how to keep learning and updating your knowledge and skills after you’ve turned the last page of this book. The field of modern deep learning, as we know it today, is only a few years old, despite a long, slow prehistory stretching back decades. With an exponential increase in financial resources and research headcount since 2013, the field as a whole is now moving at a frenetic pace. What you’ve learned in this book won’t stay relevant forever, and it isn’t all you’ll need for the rest of your career.", "words": [{"w": "As", "b": [0.1294, 0.4957, 0.1574, 0.5154]}, {"w": "final", "b": [0.1637, 0.4957, 0.21, 0.5154]}, {"w": "parting", "b": [0.2163, 0.4957, 0.2878, 0.5154]}, {"w": "words,", "b": [0.2941, 0.4957, 0.362, 0.5154]}, {"w": "I", "b": [0.3683, 0.4957, 0.3767, 0.5154]}, {"w": "want", "b": [0.383, 0.4957, 0.4321, 0.5154]}, {"w": "to", "b": [0.4384, 0.4957, 0.458, 0.5154]}, {"w": "give", "b": [0.4643, 0.4957, 0.5077, 0.5154]}, {"w": "you", "b": [0.5141, 0.4957, 0.5519, 0.5154]}, {"w": "some", "b": [0.5582, 0.4957, 0.6115, 0.5154]}, {"w": "pointers", "b": [0.6178, 0.4957, 0.699, 0.5154]}, {"w": "about", "b": [0.7053, 0.4957, 0.7614, 0.5154]}, {"w": "how", "b": [0.7677, 0.4957, 0.8111, 0.5154]}, {"w": "to", "b": [0.8174, 0.4957, 0.8371, 0.5154]}, {"w": "keep", "b": [0.1294, 0.5162, 0.177, 0.5359]}, {"w": "learning", "b": [0.1833, 0.5162, 0.266, 0.5359]}, {"w": "and", "b": [0.2723, 0.5162, 0.3087, 0.5359]}, {"w": "updating", "b": [0.315, 0.5162, 0.4033, 0.5359]}, {"w": "your", "b": [0.4096, 0.5162, 0.4559, 0.5359]}, {"w": "knowledge", "b": [0.4622, 0.5162, 0.5729, 0.5359]}, {"w": "and", "b": [0.5792, 0.5162, 0.6156, 0.5359]}, {"w": "skills", "b": [0.6219, 0.5162, 0.6752, 0.5359]}, {"w": "after", "b": [0.6814, 0.5162, 0.7277, 0.5359]}, {"w": "you’ve", "b": [0.734, 0.5162, 0.804, 0.5359]}, {"w": "turned", "b": [0.1294, 0.5367, 0.1939, 0.5564]}, {"w": "the", "b": [0.2002, 0.5367, 0.231, 0.5564]}, {"w": "last", "b": [0.2373, 0.5367, 0.2723, 0.5564]}, {"w": "page", "b": [0.2786, 0.5367, 0.3263, 0.5564]}, {"w": "of", "b": [0.3326, 0.5367, 0.3536, 0.5564]}, {"w": "this", "b": [0.3599, 0.5367, 0.3964, 0.5564]}, {"w": "book.", "b": [0.4027, 0.5367, 0.4594, 0.5564]}, {"w": "The", "b": [0.4657, 0.5367, 0.5049, 0.5564]}, {"w": "field", "b": [0.5113, 0.5367, 0.5575, 0.5564]}, {"w": "of", "b": [0.5638, 0.5367, 0.5848, 0.5564]}, {"w": "modern", "b": [0.5911, 0.5367, 0.6682, 0.5564]}, {"w": "deep", "b": [0.6745, 0.5367, 0.7221, 0.5564]}, {"w": "learning,", "b": [0.7284, 0.5367, 0.8174, 0.5564]}, {"w": "as", "b": [0.8237, 0.5367, 0.8447, 0.5564]}, {"w": "we", "b": [0.1294, 0.5572, 0.1588, 0.5769]}, {"w": "know", "b": [0.1651, 0.5572, 0.2212, 0.5769]}, {"w": "it", "b": [0.2275, 0.5572, 0.2415, 0.5769]}, {"w": "today,", "b": [0.2478, 0.5572, 0.3085, 0.5769]}, {"w": "is", "b": [0.3148, 0.5572, 0.3317, 0.5769]}, {"w": "only", "b": [0.338, 0.5572, 0.3828, 0.5769]}, {"w": "a", "b": [0.3891, 0.5572, 0.4003, 0.5769]}, {"w": "few", "b": [0.4066, 0.5572, 0.4444, 0.5769]}, {"w": "years", "b": [0.4508, 0.5572, 0.504, 0.5769]}, {"w": "old,", "b": [0.5103, 0.5572, 0.5488, 0.5769]}, {"w": "despite", "b": [0.5551, 0.5572, 0.6266, 0.5769]}, {"w": "a", "b": [0.6329, 0.5572, 0.6441, 0.5769]}, {"w": "long,", "b": [0.6504, 0.5572, 0.7015, 0.5769]}, {"w": "slow", "b": [0.7079, 0.5572, 0.7555, 0.5769]}, {"w": "prehistory", "b": [0.7618, 0.5572, 0.8641, 0.5769]}, {"w": "stretching", "b": [0.1294, 0.5777, 0.2289, 0.5974]}, {"w": "back", "b": [0.2352, 0.5777, 0.2828, 0.5974]}, {"w": "decades.", "b": [0.2891, 0.5777, 0.3753, 0.5974]}, {"w": "With", "b": [0.3816, 0.5777, 0.431, 0.5974]}, {"w": "an", "b": [0.4373, 0.5777, 0.4611, 0.5974]}, {"w": "exponential", "b": [0.4674, 0.5777, 0.5851, 0.5974]}, {"w": "increase", "b": [0.5914, 0.5777, 0.6741, 0.5974]}, {"w": "in", "b": [0.6804, 0.5777, 0.7, 0.5974]}, {"w": "financial", "b": [0.7063, 0.5777, 0.7946, 0.5974]}, {"w": "resources", "b": [0.1294, 0.5982, 0.2247, 0.6179]}, {"w": "and", "b": [0.231, 0.5982, 0.2674, 0.6179]}, {"w": "research", "b": [0.2737, 0.5982, 0.3577, 0.6179]}, {"w": "headcount", "b": [0.364, 0.5982, 0.4677, 0.6179]}, {"w": "since", "b": [0.474, 0.5982, 0.5258, 0.6179]}, {"w": "2013,", "b": [0.5321, 0.5982, 0.5889, 0.6179]}, {"w": "the", "b": [0.5952, 0.5982, 0.626, 0.6179]}, {"w": "field", "b": [0.6323, 0.5982, 0.6786, 0.6179]}, {"w": "as", "b": [0.6849, 0.5982, 0.7059, 0.6179]}, {"w": "a", "b": [0.7122, 0.5982, 0.7234, 0.6179]}, {"w": "whole", "b": [0.7297, 0.5982, 0.7914, 0.6179]}, {"w": "is", "b": [0.7977, 0.5982, 0.8145, 0.6179]}, {"w": "now", "b": [0.8208, 0.5982, 0.8642, 0.6179]}, {"w": "moving", "b": [0.1294, 0.6187, 0.2065, 0.6384]}, {"w": "at", "b": [0.2128, 0.6187, 0.231, 0.6384]}, {"w": "a", "b": [0.2373, 0.6187, 0.2485, 0.6384]}, {"w": "frenetic", "b": [0.2548, 0.6187, 0.3319, 0.6384]}, {"w": "pace.", "b": [0.3382, 0.6187, 0.3907, 0.6384]}, {"w": "What", "b": [0.397, 0.6187, 0.4516, 0.6384]}, {"w": "you’ve", "b": [0.458, 0.6187, 0.528, 0.6384]}, {"w": "learned", "b": [0.5343, 0.6187, 0.6086, 0.6384]}, {"w": "in", "b": [0.6149, 0.6187, 0.6345, 0.6384]}, {"w": "this", "b": [0.6408, 0.6187, 0.6772, 0.6384]}, {"w": "book", "b": [0.6835, 0.6187, 0.734, 0.6384]}, {"w": "won’t", "b": [0.7403, 0.6187, 0.7986, 0.6384]}, {"w": "stay", "b": [0.8049, 0.6187, 0.8456, 0.6384]}, {"w": "relevant", "b": [0.1294, 0.6392, 0.2107, 0.6589]}, {"w": "forever,", "b": [0.2169, 0.6392, 0.295, 0.6589]}, {"w": "and", "b": [0.3014, 0.6392, 0.3378, 0.6589]}, {"w": "it", "b": [0.3441, 0.6392, 0.3581, 0.6589]}, {"w": "isn’t", "b": [0.3644, 0.6392, 0.4088, 0.6589]}, {"w": "all", "b": [0.4151, 0.6392, 0.4403, 0.6589]}, {"w": "you’ll", "b": [0.4466, 0.6392, 0.5069, 0.6589]}, {"w": "need", "b": [0.5132, 0.6392, 0.5608, 0.6589]}, {"w": "for", "b": [0.5671, 0.6392, 0.5966, 0.6589]}, {"w": "the", "b": [0.6029, 0.6392, 0.6337, 0.6589]}, {"w": "rest", "b": [0.64, 0.6392, 0.6764, 0.6589]}, {"w": "of", "b": [0.6827, 0.6392, 0.7037, 0.6589]}, {"w": "your", "b": [0.71, 0.6392, 0.7563, 0.6589]}, {"w": "career.", "b": [0.7626, 0.6392, 0.8291, 0.6589]}]}, {"id": "b_3", "type": "paragraph", "text": "Fortunately, there are plenty of free online resources that you can use to stay up to date and expand your horizons. Here are a few.", "words": [{"w": "Fortunately,", "b": [0.1294, 0.682, 0.2504, 0.7017]}, {"w": "there", "b": [0.2567, 0.682, 0.3071, 0.7017]}, {"w": "are", "b": [0.3134, 0.682, 0.3442, 0.7017]}, {"w": "plenty", "b": [0.3505, 0.682, 0.4136, 0.7017]}, {"w": "of", "b": [0.4199, 0.682, 0.4409, 0.7017]}, {"w": "free", "b": [0.4472, 0.682, 0.4864, 0.7017]}, {"w": "online", "b": [0.4927, 0.682, 0.5558, 0.7017]}, {"w": "resources", "b": [0.5621, 0.682, 0.6573, 0.7017]}, {"w": "that", "b": [0.6637, 0.682, 0.7015, 0.7017]}, {"w": "you", "b": [0.7078, 0.682, 0.7456, 0.7017]}, {"w": "can", "b": [0.7519, 0.682, 0.787, 0.7017]}, {"w": "use", "b": [0.7933, 0.682, 0.8269, 0.7017]}, {"w": "to", "b": [0.8332, 0.682, 0.8528, 0.7017]}, {"w": "stay", "b": [0.1294, 0.7025, 0.1701, 0.7222]}, {"w": "up", "b": [0.1764, 0.7025, 0.2016, 0.7222]}, {"w": "to", "b": [0.2079, 0.7025, 0.2275, 0.7222]}, {"w": "date", "b": [0.2338, 0.7025, 0.2758, 0.7222]}, {"w": "and", "b": [0.2822, 0.7025, 0.3186, 0.7222]}, {"w": "expand", "b": [0.3249, 0.7025, 0.3977, 0.7222]}, {"w": "your", "b": [0.404, 0.7025, 0.4503, 0.7222]}, {"w": "horizons.", "b": [0.4566, 0.7025, 0.5498, 0.7222]}, {"w": "Here", "b": [0.5561, 0.7025, 0.6051, 0.7222]}, {"w": "are", "b": [0.6114, 0.7025, 0.6422, 0.7222]}, {"w": "a", "b": [0.6485, 0.7025, 0.6597, 0.7222]}, {"w": "few.", "b": [0.666, 0.7025, 0.7084, 0.7222]}]}, {"id": "b_4", "type": "equation", "text": "9.4.1. Practice on real-world problems using Kaggle", "words": [{"w": "9.4.1.", "b": [0.1294, 0.7497, 0.1862, 0.7694]}, {"w": "Practice", "b": [0.1925, 0.7497, 0.2807, 0.7694]}, {"w": "on", "b": [0.287, 0.7497, 0.3137, 0.7694]}, {"w": "real-world", "b": [0.32, 0.7497, 0.433, 0.7694]}, {"w": "problems", "b": [0.4393, 0.7497, 0.5397, 0.7694]}, {"w": "using", "b": [0.546, 0.7497, 0.6035, 0.7694]}, {"w": "Kaggle", "b": [0.6098, 0.7497, 0.6855, 0.7694]}]}, {"id": "b_5", "type": "paragraph", "text": "One effective way to acquire real-world experience is to try your hand at machine-learning competitions on Kaggle (https://kaggle.com). The only real way to learn is through practice and actual coding—that’s the philosophy of this book, and Kaggle competitions are the natural continuation of this. On Kaggle, you’ll find an array of constantly", "words": [{"w": "One", "b": [0.1294, 0.7925, 0.1714, 0.8122]}, {"w": "effective", "b": [0.1777, 0.7925, 0.2655, 0.8122]}, {"w": "way", "b": [0.2718, 0.7925, 0.3139, 0.8122]}, {"w": "to", "b": [0.3202, 0.7925, 0.3398, 0.8122]}, {"w": "acquire", "b": [0.3461, 0.7925, 0.4203, 0.8122]}, {"w": "real-world", "b": [0.4266, 0.7925, 0.5317, 0.8122]}, {"w": "experience", "b": [0.538, 0.7925, 0.6473, 0.8122]}, {"w": "is", "b": [0.6536, 0.7925, 0.6704, 0.8122]}, {"w": "to", "b": [0.6767, 0.7925, 0.6963, 0.8122]}, {"w": "try", "b": [0.7026, 0.7925, 0.7307, 0.8122]}, {"w": "your", "b": [0.737, 0.7925, 0.7832, 0.8122]}, {"w": "hand", "b": [0.7895, 0.7925, 0.8386, 0.8122]}, {"w": "at", "b": [0.8449, 0.7925, 0.8631, 0.8122]}, {"w": "machine-learning", "b": [0.1294, 0.813, 0.3059, 0.8327]}, {"w": "competitions", "b": [0.3122, 0.813, 0.4426, 0.8327]}, {"w": "on", "b": [0.4489, 0.813, 0.4741, 0.8327]}, {"w": "Kaggle", "b": [0.4804, 0.813, 0.5533, 0.8327]}, {"w": "(https://kaggle.com).", "b": [0.5596, 0.813, 0.7697, 0.8327]}, {"w": "The", "b": [0.776, 0.813, 0.8152, 0.8327]}, {"w": "only", "b": [0.8215, 0.813, 0.8663, 0.8327]}, {"w": "real", "b": [0.1294, 0.8335, 0.1672, 0.8532]}, {"w": "way", "b": [0.1735, 0.8335, 0.2156, 0.8532]}, {"w": "to", "b": [0.2219, 0.8335, 0.2415, 0.8532]}, {"w": "learn", "b": [0.2478, 0.8335, 0.2982, 0.8532]}, {"w": "is", "b": [0.3045, 0.8335, 0.3214, 0.8532]}, {"w": "through", "b": [0.3277, 0.8335, 0.4061, 0.8532]}, {"w": "practice", "b": [0.4124, 0.8335, 0.4923, 0.8532]}, {"w": "and", "b": [0.4986, 0.8335, 0.535, 0.8532]}, {"w": "actual", "b": [0.5413, 0.8335, 0.6016, 0.8532]}, {"w": "coding—that’s", "b": [0.6079, 0.8335, 0.7563, 0.8532]}, {"w": "the", "b": [0.7626, 0.8335, 0.7935, 0.8532]}, {"w": "philosophy", "b": [0.1294, 0.854, 0.2415, 0.8737]}, {"w": "of", "b": [0.2478, 0.854, 0.2689, 0.8737]}, {"w": "this", "b": [0.2752, 0.854, 0.3116, 0.8737]}, {"w": "book,", "b": [0.3179, 0.854, 0.3747, 0.8737]}, {"w": "and", "b": [0.381, 0.854, 0.4174, 0.8737]}, {"w": "Kaggle", "b": [0.4237, 0.854, 0.4966, 0.8737]}, {"w": "competitions", "b": [0.5029, 0.854, 0.6332, 0.8737]}, {"w": "are", "b": [0.6395, 0.854, 0.6703, 0.8737]}, {"w": "the", "b": [0.6766, 0.854, 0.7074, 0.8737]}, {"w": "natural", "b": [0.7137, 0.854, 0.7838, 0.8737]}, {"w": "continuation", "b": [0.1294, 0.8745, 0.2555, 0.8942]}, {"w": "of", "b": [0.2618, 0.8745, 0.2829, 0.8942]}, {"w": "this.", "b": [0.2892, 0.8745, 0.3319, 0.8942]}, {"w": "On", "b": [0.3382, 0.8745, 0.3691, 0.8942]}, {"w": "Kaggle,", "b": [0.3754, 0.8745, 0.4545, 0.8942]}, {"w": "you’ll", "b": [0.4608, 0.8745, 0.5211, 0.8942]}, {"w": "find", "b": [0.5274, 0.8745, 0.568, 0.8942]}, {"w": "an", "b": [0.5743, 0.8745, 0.5982, 0.8942]}, {"w": "array", "b": [0.6045, 0.8745, 0.6563, 0.8942]}, {"w": "of", "b": [0.6626, 0.8745, 0.6836, 0.8942]}, {"w": "constantly", "b": [0.6899, 0.8745, 0.7936, 0.8942]}]}]}, {"page": 438, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "renewed data-science competitions, many of which involve deep learning, prepared by companies interested in obtaining novel solutions to some of their most challenging machine-learning problems. Fairly large monetary prizes are offered to top entrants.", "words": [{"w": "renewed", "b": [0.1294, 0.0857, 0.2149, 0.1054]}, {"w": "data-science", "b": [0.2212, 0.0857, 0.3458, 0.1054]}, {"w": "competitions,", "b": [0.3521, 0.0857, 0.4888, 0.1054]}, {"w": "many", "b": [0.4951, 0.0857, 0.5511, 0.1054]}, {"w": "of", "b": [0.5574, 0.0857, 0.5784, 0.1054]}, {"w": "which", "b": [0.5847, 0.0857, 0.6463, 0.1054]}, {"w": "involve", "b": [0.6526, 0.0857, 0.7283, 0.1054]}, {"w": "deep", "b": [0.7346, 0.0857, 0.7823, 0.1054]}, {"w": "learning,", "b": [0.1294, 0.1062, 0.2184, 0.1259]}, {"w": "prepared", "b": [0.2247, 0.1062, 0.3129, 0.1259]}, {"w": "by", "b": [0.3192, 0.1062, 0.3445, 0.1259]}, {"w": "companies", "b": [0.3508, 0.1062, 0.4587, 0.1259]}, {"w": "interested", "b": [0.465, 0.1062, 0.563, 0.1259]}, {"w": "in", "b": [0.5693, 0.1062, 0.589, 0.1259]}, {"w": "obtaining", "b": [0.5953, 0.1062, 0.6906, 0.1259]}, {"w": "novel", "b": [0.6969, 0.1062, 0.7529, 0.1259]}, {"w": "solutions", "b": [0.7592, 0.1062, 0.8504, 0.1259]}, {"w": "to", "b": [0.1294, 0.1267, 0.149, 0.1464]}, {"w": "some", "b": [0.1553, 0.1267, 0.2086, 0.1464]}, {"w": "of", "b": [0.2149, 0.1267, 0.2359, 0.1464]}, {"w": "their", "b": [0.2422, 0.1267, 0.2885, 0.1464]}, {"w": "most", "b": [0.2948, 0.1267, 0.3438, 0.1464]}, {"w": "challenging", "b": [0.3501, 0.1267, 0.4678, 0.1464]}, {"w": "machine-learning", "b": [0.4741, 0.1267, 0.6506, 0.1464]}, {"w": "problems.", "b": [0.6569, 0.1267, 0.7571, 0.1464]}, {"w": "Fairly", "b": [0.7634, 0.1267, 0.8237, 0.1464]}, {"w": "large", "b": [0.1294, 0.1472, 0.1794, 0.1669]}, {"w": "monetary", "b": [0.1857, 0.1472, 0.281, 0.1669]}, {"w": "prizes", "b": [0.2873, 0.1472, 0.3475, 0.1669]}, {"w": "are", "b": [0.3538, 0.1472, 0.3846, 0.1669]}, {"w": "offered", "b": [0.3909, 0.1472, 0.4633, 0.1669]}, {"w": "to", "b": [0.4696, 0.1472, 0.4892, 0.1669]}, {"w": "top", "b": [0.4955, 0.1472, 0.5277, 0.1669]}, {"w": "entrants.", "b": [0.534, 0.1472, 0.6202, 0.1669]}]}, {"id": "b_1", "type": "paragraph", "text": "Most competitions are won using either the XGBoost library (for shallow machine learning) or Keras (for deep learning). So you’ll fit right in! By participating in a few competitions, maybe as part of a team, you’ll become more familiar with the practical side of some of the advanced best practices described in this book, especially hyperparameter tuning, avoiding validation-set overfitting, and model ensembling.", "words": [{"w": "Most", "b": [0.1294, 0.19, 0.1813, 0.2097]}, {"w": "competitions", "b": [0.1876, 0.19, 0.3179, 0.2097]}, {"w": "are", "b": [0.3242, 0.19, 0.355, 0.2097]}, {"w": "won", "b": [0.3613, 0.19, 0.4048, 0.2097]}, {"w": "using", "b": [0.4111, 0.19, 0.4657, 0.2097]}, {"w": "either", "b": [0.4721, 0.19, 0.5295, 0.2097]}, {"w": "the", "b": [0.5358, 0.19, 0.5666, 0.2097]}, {"w": "XGBoost", "b": [0.5729, 0.19, 0.6682, 0.2097]}, {"w": "library", "b": [0.6745, 0.19, 0.7418, 0.2097]}, {"w": "(for", "b": [0.7481, 0.19, 0.7859, 0.2097]}, {"w": "shallow", "b": [0.7922, 0.19, 0.8707, 0.2097]}, {"w": "machine", "b": [0.1294, 0.2105, 0.2149, 0.2302]}, {"w": "learning)", "b": [0.2212, 0.2105, 0.3122, 0.2302]}, {"w": "or", "b": [0.3186, 0.2105, 0.3396, 0.2302]}, {"w": "Keras", "b": [0.3459, 0.2105, 0.4047, 0.2302]}, {"w": "(for", "b": [0.411, 0.2105, 0.4488, 0.2302]}, {"w": "deep", "b": [0.4551, 0.2105, 0.5028, 0.2302]}, {"w": "learning).", "b": [0.5091, 0.2105, 0.6064, 0.2302]}, {"w": "So", "b": [0.6127, 0.2105, 0.6394, 0.2302]}, {"w": "you’ll", "b": [0.6456, 0.2105, 0.7059, 0.2302]}, {"w": "fit", "b": [0.7122, 0.2105, 0.7346, 0.2302]}, {"w": "right", "b": [0.7409, 0.2105, 0.7886, 0.2302]}, {"w": "in!", "b": [0.7949, 0.2105, 0.8229, 0.2302]}, {"w": "By", "b": [0.8292, 0.2105, 0.8586, 0.2302]}, {"w": "participating", "b": [0.1294, 0.231, 0.2569, 0.2507]}, {"w": "in", "b": [0.2632, 0.231, 0.2829, 0.2507]}, {"w": "a", "b": [0.2892, 0.231, 0.3004, 0.2507]}, {"w": "few", "b": [0.3067, 0.231, 0.3445, 0.2507]}, {"w": "competitions,", "b": [0.3508, 0.231, 0.4874, 0.2507]}, {"w": "maybe", "b": [0.4937, 0.231, 0.561, 0.2507]}, {"w": "as", "b": [0.5673, 0.231, 0.5883, 0.2507]}, {"w": "part", "b": [0.5946, 0.231, 0.6339, 0.2507]}, {"w": "of", "b": [0.6402, 0.231, 0.6612, 0.2507]}, {"w": "a", "b": [0.6675, 0.231, 0.6787, 0.2507]}, {"w": "team,", "b": [0.685, 0.231, 0.7403, 0.2507]}, {"w": "you’ll", "b": [0.7466, 0.231, 0.8069, 0.2507]}, {"w": "become", "b": [0.1294, 0.2515, 0.2079, 0.2712]}, {"w": "more", "b": [0.2142, 0.2515, 0.266, 0.2712]}, {"w": "familiar", "b": [0.2723, 0.2515, 0.3522, 0.2712]}, {"w": "with", "b": [0.3585, 0.2515, 0.4033, 0.2712]}, {"w": "the", "b": [0.4096, 0.2515, 0.4405, 0.2712]}, {"w": "practical", "b": [0.4467, 0.2515, 0.5336, 0.2712]}, {"w": "side", "b": [0.5399, 0.2515, 0.5805, 0.2712]}, {"w": "of", "b": [0.5868, 0.2515, 0.6078, 0.2712]}, {"w": "some", "b": [0.6141, 0.2515, 0.6674, 0.2712]}, {"w": "of", "b": [0.6737, 0.2515, 0.6947, 0.2712]}, {"w": "the", "b": [0.701, 0.2515, 0.7318, 0.2712]}, {"w": "advanced", "b": [0.7381, 0.2515, 0.8334, 0.2712]}, {"w": "best", "b": [0.1294, 0.272, 0.1701, 0.2917]}, {"w": "practices", "b": [0.1764, 0.272, 0.266, 0.2917]}, {"w": "described", "b": [0.2723, 0.272, 0.369, 0.2917]}, {"w": "in", "b": [0.3753, 0.272, 0.3949, 0.2917]}, {"w": "this", "b": [0.4012, 0.272, 0.4377, 0.2917]}, {"w": "book,", "b": [0.444, 0.272, 0.5007, 0.2917]}, {"w": "especially", "b": [0.507, 0.272, 0.6079, 0.2917]}, {"w": "hyperparameter", "b": [0.6142, 0.272, 0.7725, 0.2917]}, {"w": "tuning,", "b": [0.7788, 0.272, 0.8496, 0.2917]}, {"w": "avoiding", "b": [0.1294, 0.2925, 0.2177, 0.3122]}, {"w": "validation-set", "b": [0.224, 0.2925, 0.3613, 0.3122]}, {"w": "overfitting,", "b": [0.3676, 0.2925, 0.4804, 0.3122]}, {"w": "and", "b": [0.4867, 0.2925, 0.5231, 0.3122]}, {"w": "model", "b": [0.5294, 0.2925, 0.5925, 0.3122]}, {"w": "ensembling.", "b": [0.5988, 0.2925, 0.7214, 0.3122]}]}, {"id": "b_2", "type": "paragraph", "text": "9.4.2. Read about the latest developments on arXiv", "words": [{"w": "9.4.2.", "b": [0.1294, 0.3397, 0.1862, 0.3594]}, {"w": "Read", "b": [0.1925, 0.3397, 0.2485, 0.3594]}, {"w": "about", "b": [0.2548, 0.3397, 0.3165, 0.3594]}, {"w": "the", "b": [0.3228, 0.3397, 0.3564, 0.3594]}, {"w": "latest", "b": [0.3628, 0.3397, 0.4202, 0.3594]}, {"w": "developments", "b": [0.4265, 0.3397, 0.5736, 0.3594]}, {"w": "on", "b": [0.5799, 0.3397, 0.6066, 0.3594]}, {"w": "arXiv", "b": [0.6129, 0.3397, 0.6745, 0.3594]}]}, {"id": "b_3", "type": "paragraph", "text": "Deep-learning research, in contrast with some other scientific fields, takes places completely in the open. Papers are made publicly and freely accessible as soon as they’re finalized, and a lot of related software is open source. arXiv (https://arxiv.org)—pronounced “archive” (the X stands for the Greek chi)—is an open-access preprint server for physics, mathematics, and computer science research papers. It has become the de facto way to stay up to date on the bleeding edge of machine learning and deep learning. The large majority of deep-learning researchers upload any paper they write to arXiv shortly after completion. This allows them to plant a flag and claim a specific finding without waiting for a conference acceptance (which takes months), which is necessary given the fast pace of research and the intense competition in the field. It also allows the field to move extremely fast: all new findings are immediately available for all to see and to build on.", "words": [{"w": "Deep-learning", "b": [0.1294, 0.3825, 0.2737, 0.4022]}, {"w": "research,", "b": [0.28, 0.3825, 0.3703, 0.4022]}, {"w": "in", "b": [0.3766, 0.3825, 0.3963, 0.4022]}, {"w": "contrast", "b": [0.4026, 0.3825, 0.4824, 0.4022]}, {"w": "with", "b": [0.4888, 0.3825, 0.5336, 0.4022]}, {"w": "some", "b": [0.5399, 0.3825, 0.5932, 0.4022]}, {"w": "other", "b": [0.5995, 0.3825, 0.6513, 0.4022]}, {"w": "scientific", "b": [0.6576, 0.3825, 0.7501, 0.4022]}, {"w": "fields,", "b": [0.7564, 0.3825, 0.8188, 0.4022]}, {"w": "takes", "b": [0.1294, 0.403, 0.1813, 0.4227]}, {"w": "places", "b": [0.1876, 0.403, 0.2506, 0.4227]}, {"w": "completely", "b": [0.2569, 0.403, 0.369, 0.4227]}, {"w": "in", "b": [0.3753, 0.403, 0.3949, 0.4227]}, {"w": "the", "b": [0.4012, 0.403, 0.4321, 0.4227]}, {"w": "open.", "b": [0.4384, 0.403, 0.4937, 0.4227]}, {"w": "Papers", "b": [0.5, 0.403, 0.5673, 0.4227]}, {"w": "are", "b": [0.5736, 0.403, 0.6044, 0.4227]}, {"w": "made", "b": [0.6107, 0.403, 0.6653, 0.4227]}, {"w": "publicly", "b": [0.6715, 0.403, 0.7542, 0.4227]}, {"w": "and", "b": [0.7605, 0.403, 0.797, 0.4227]}, {"w": "freely", "b": [0.8033, 0.403, 0.8621, 0.4227]}, {"w": "accessible", "b": [0.1294, 0.4235, 0.2317, 0.4432]}, {"w": "as", "b": [0.238, 0.4235, 0.259, 0.4432]}, {"w": "soon", "b": [0.2653, 0.4235, 0.313, 0.4432]}, {"w": "as", "b": [0.3193, 0.4235, 0.3403, 0.4432]}, {"w": "they’re", "b": [0.3466, 0.4235, 0.418, 0.4432]}, {"w": "finalized,", "b": [0.4243, 0.4235, 0.5189, 0.4432]}, {"w": "and", "b": [0.5252, 0.4235, 0.5616, 0.4432]}, {"w": "a", "b": [0.5679, 0.4235, 0.5791, 0.4432]}, {"w": "lot", "b": [0.5854, 0.4235, 0.6121, 0.4432]}, {"w": "of", "b": [0.6184, 0.4235, 0.6394, 0.4432]}, {"w": "related", "b": [0.6457, 0.4235, 0.7143, 0.4432]}, {"w": "software", "b": [0.7207, 0.4235, 0.8075, 0.4432]}, {"w": "is", "b": [0.8138, 0.4235, 0.8306, 0.4432]}, {"w": "open", "b": [0.1294, 0.444, 0.1785, 0.4637]}, {"w": "source.", "b": [0.1848, 0.444, 0.2569, 0.4637]}, {"w": "arXiv", "b": [0.2632, 0.444, 0.3206, 0.4637]}, {"w": "(https://arxiv.org)—pronounced", "b": [0.327, 0.444, 0.6478, 0.4637]}, {"w": "“archive”", "b": [0.6541, 0.444, 0.7508, 0.4637]}, {"w": "(the", "b": [0.7571, 0.444, 0.7963, 0.4637]}, {"w": "X", "b": [0.8025, 0.444, 0.818, 0.4637]}, {"w": "stands", "b": [0.1294, 0.4645, 0.1925, 0.4842]}, {"w": "for", "b": [0.1988, 0.4645, 0.2282, 0.4842]}, {"w": "the", "b": [0.2345, 0.4645, 0.2653, 0.4842]}, {"w": "Greek", "b": [0.2716, 0.4645, 0.3333, 0.4842]}, {"w": "chi)—is", "b": [0.3396, 0.4645, 0.4208, 0.4842]}, {"w": "an", "b": [0.4271, 0.4645, 0.4509, 0.4842]}, {"w": "open-access", "b": [0.4572, 0.4645, 0.5791, 0.4842]}, {"w": "preprint", "b": [0.5854, 0.4645, 0.6653, 0.4842]}, {"w": "server", "b": [0.6716, 0.4645, 0.7332, 0.4842]}, {"w": "for", "b": [0.7395, 0.4645, 0.7689, 0.4842]}, {"w": "physics,", "b": [0.7752, 0.4645, 0.8572, 0.4842]}, {"w": "mathematics,", "b": [0.1294, 0.485, 0.2632, 0.5047]}, {"w": "and", "b": [0.2695, 0.485, 0.306, 0.5047]}, {"w": "computer", "b": [0.3123, 0.485, 0.4076, 0.5047]}, {"w": "science", "b": [0.4139, 0.485, 0.4881, 0.5047]}, {"w": "research", "b": [0.4944, 0.485, 0.5784, 0.5047]}, {"w": "papers.", "b": [0.5847, 0.485, 0.6569, 0.5047]}, {"w": "It", "b": [0.6632, 0.485, 0.6786, 0.5047]}, {"w": "has", "b": [0.6849, 0.485, 0.7185, 0.5047]}, {"w": "become", "b": [0.7248, 0.485, 0.8033, 0.5047]}, {"w": "the", "b": [0.8096, 0.485, 0.8404, 0.5047]}, {"w": "de", "b": [0.8467, 0.485, 0.8705, 0.5047]}, {"w": "facto", "b": [0.1294, 0.5055, 0.1798, 0.5252]}, {"w": "way", "b": [0.1861, 0.5055, 0.2282, 0.5252]}, {"w": "to", "b": [0.2345, 0.5055, 0.2541, 0.5252]}, {"w": "stay", "b": [0.2604, 0.5055, 0.301, 0.5252]}, {"w": "up", "b": [0.3073, 0.5055, 0.3326, 0.5252]}, {"w": "to", "b": [0.3389, 0.5055, 0.3585, 0.5252]}, {"w": "date", "b": [0.3648, 0.5055, 0.4068, 0.5252]}, {"w": "on", "b": [0.4131, 0.5055, 0.4384, 0.5252]}, {"w": "the", "b": [0.4447, 0.5055, 0.4755, 0.5252]}, {"w": "bleeding", "b": [0.4818, 0.5055, 0.5687, 0.5252]}, {"w": "edge", "b": [0.575, 0.5055, 0.6226, 0.5252]}, {"w": "of", "b": [0.6289, 0.5055, 0.6499, 0.5252]}, {"w": "machine", "b": [0.6562, 0.5055, 0.7417, 0.5252]}, {"w": "learning", "b": [0.748, 0.5055, 0.8307, 0.5252]}, {"w": "and", "b": [0.1294, 0.526, 0.1658, 0.5457]}, {"w": "deep", "b": [0.1721, 0.526, 0.2198, 0.5457]}, {"w": "learning.", "b": [0.2261, 0.526, 0.315, 0.5457]}, {"w": "The", "b": [0.3214, 0.526, 0.3606, 0.5457]}, {"w": "large", "b": [0.3669, 0.526, 0.4168, 0.5457]}, {"w": "majority", "b": [0.4231, 0.526, 0.5086, 0.5457]}, {"w": "of", "b": [0.5149, 0.526, 0.5359, 0.5457]}, {"w": "deep-learning", "b": [0.5422, 0.526, 0.6809, 0.5457]}, {"w": "researchers", "b": [0.6872, 0.526, 0.8007, 0.5457]}, {"w": "upload", "b": [0.1294, 0.5465, 0.1981, 0.5662]}, {"w": "any", "b": [0.2044, 0.5465, 0.2408, 0.5662]}, {"w": "paper", "b": [0.2471, 0.5465, 0.3031, 0.5662]}, {"w": "they", "b": [0.3094, 0.5465, 0.3529, 0.5662]}, {"w": "write", "b": [0.3592, 0.5465, 0.411, 0.5662]}, {"w": "to", "b": [0.4173, 0.5465, 0.437, 0.5662]}, {"w": "arXiv", "b": [0.4433, 0.5465, 0.5007, 0.5662]}, {"w": "shortly", "b": [0.507, 0.5465, 0.5771, 0.5662]}, {"w": "after", "b": [0.5834, 0.5465, 0.6296, 0.5662]}, {"w": "completion.", "b": [0.6359, 0.5465, 0.7557, 0.5662]}, {"w": "This", "b": [0.762, 0.5465, 0.8069, 0.5662]}, {"w": "allows", "b": [0.1294, 0.567, 0.1953, 0.5867]}, {"w": "them", "b": [0.2016, 0.567, 0.252, 0.5867]}, {"w": "to", "b": [0.2583, 0.567, 0.278, 0.5867]}, {"w": "plant", "b": [0.2843, 0.567, 0.3347, 0.5867]}, {"w": "a", "b": [0.341, 0.567, 0.3522, 0.5867]}, {"w": "flag", "b": [0.3585, 0.567, 0.3978, 0.5867]}, {"w": "and", "b": [0.4041, 0.567, 0.4405, 0.5867]}, {"w": "claim", "b": [0.4468, 0.567, 0.5029, 0.5867]}, {"w": "a", "b": [0.5092, 0.567, 0.5204, 0.5867]}, {"w": "specific", "b": [0.5267, 0.567, 0.6051, 0.5867]}, {"w": "finding", "b": [0.6114, 0.567, 0.6843, 0.5867]}, {"w": "without", "b": [0.6905, 0.567, 0.7676, 0.5867]}, {"w": "waiting", "b": [0.7739, 0.567, 0.8496, 0.5867]}, {"w": "for", "b": [0.1294, 0.5875, 0.1588, 0.6072]}, {"w": "a", "b": [0.1651, 0.5875, 0.1763, 0.6072]}, {"w": "conference", "b": [0.1826, 0.5875, 0.2933, 0.6072]}, {"w": "acceptance", "b": [0.2996, 0.5875, 0.4102, 0.6072]}, {"w": "(which", "b": [0.4165, 0.5875, 0.4866, 0.6072]}, {"w": "takes", "b": [0.4929, 0.5875, 0.5447, 0.6072]}, {"w": "months),", "b": [0.551, 0.5875, 0.64, 0.6072]}, {"w": "which", "b": [0.6463, 0.5875, 0.708, 0.6072]}, {"w": "is", "b": [0.7143, 0.5875, 0.7311, 0.6072]}, {"w": "necessary", "b": [0.7374, 0.5875, 0.8355, 0.6072]}, {"w": "given", "b": [0.1294, 0.608, 0.1855, 0.6277]}, {"w": "the", "b": [0.1918, 0.608, 0.2226, 0.6277]}, {"w": "fast", "b": [0.2289, 0.608, 0.2653, 0.6277]}, {"w": "pace", "b": [0.2716, 0.608, 0.3178, 0.6277]}, {"w": "of", "b": [0.3242, 0.608, 0.3452, 0.6277]}, {"w": "research", "b": [0.3515, 0.608, 0.4355, 0.6277]}, {"w": "and", "b": [0.4418, 0.608, 0.4782, 0.6277]}, {"w": "the", "b": [0.4845, 0.608, 0.5154, 0.6277]}, {"w": "intense", "b": [0.5216, 0.608, 0.5931, 0.6277]}, {"w": "competition", "b": [0.5994, 0.608, 0.7199, 0.6277]}, {"w": "in", "b": [0.7262, 0.608, 0.7458, 0.6277]}, {"w": "the", "b": [0.7522, 0.608, 0.783, 0.6277]}, {"w": "field.", "b": [0.7893, 0.608, 0.8418, 0.6277]}, {"w": "It", "b": [0.8481, 0.608, 0.8635, 0.6277]}, {"w": "also", "b": [0.1294, 0.6285, 0.1701, 0.6482]}, {"w": "allows", "b": [0.1764, 0.6285, 0.2422, 0.6482]}, {"w": "the", "b": [0.2485, 0.6285, 0.2794, 0.6482]}, {"w": "field", "b": [0.2857, 0.6285, 0.3319, 0.6482]}, {"w": "to", "b": [0.3382, 0.6285, 0.3578, 0.6482]}, {"w": "move", "b": [0.3641, 0.6285, 0.4202, 0.6482]}, {"w": "extremely", "b": [0.4265, 0.6285, 0.5274, 0.6482]}, {"w": "fast:", "b": [0.5337, 0.6285, 0.5771, 0.6482]}, {"w": "all", "b": [0.5834, 0.6285, 0.6087, 0.6482]}, {"w": "new", "b": [0.615, 0.6285, 0.657, 0.6482]}, {"w": "findings", "b": [0.6633, 0.6285, 0.746, 0.6482]}, {"w": "are", "b": [0.7523, 0.6285, 0.7831, 0.6482]}, {"w": "immediately", "b": [0.1294, 0.649, 0.2555, 0.6687]}, {"w": "available", "b": [0.2618, 0.649, 0.3529, 0.6687]}, {"w": "for", "b": [0.3591, 0.649, 0.3886, 0.6687]}, {"w": "all", "b": [0.3949, 0.649, 0.4201, 0.6687]}, {"w": "to", "b": [0.4264, 0.649, 0.446, 0.6687]}, {"w": "see", "b": [0.4523, 0.649, 0.4845, 0.6687]}, {"w": "and", "b": [0.4908, 0.649, 0.5273, 0.6687]}, {"w": "to", "b": [0.5336, 0.649, 0.5532, 0.6687]}, {"w": "build", "b": [0.5595, 0.649, 0.6114, 0.6687]}, {"w": "on.", "b": [0.6177, 0.649, 0.6492, 0.6687]}]}, {"id": "b_4", "type": "paragraph", "text": "An important downside is that the sheer quantity of new papers posted every day on arXiv makes it impossible to even skim them all; and the fact that they aren’t peer reviewed makes it difficult to identify those that are both important and high quality. It’s difficult, and becoming increasingly more so, to find the signal in the noise. Currently, there isn’t a good solution to this problem. But some tools can help: an auxiliary website called arXiv Sanity Preserver (http://arxiv-sanity.com) serves as a recommendation engine for new papers and can help you keep track of new developments within a specific narrow vertical of deep learning.", "words": [{"w": "An", "b": [0.1294, 0.6918, 0.1602, 0.7115]}, {"w": "important", "b": [0.1665, 0.6918, 0.2646, 0.7115]}, {"w": "downside", "b": [0.271, 0.6918, 0.3676, 0.7115]}, {"w": "is", "b": [0.374, 0.6918, 0.3908, 0.7115]}, {"w": "that", "b": [0.3971, 0.6918, 0.4349, 0.7115]}, {"w": "the", "b": [0.4412, 0.6918, 0.4721, 0.7115]}, {"w": "sheer", "b": [0.4784, 0.6918, 0.5316, 0.7115]}, {"w": "quantity", "b": [0.5379, 0.6918, 0.6206, 0.7115]}, {"w": "of", "b": [0.6269, 0.6918, 0.6479, 0.7115]}, {"w": "new", "b": [0.6542, 0.6918, 0.6962, 0.7115]}, {"w": "papers", "b": [0.7025, 0.6918, 0.7684, 0.7115]}, {"w": "posted", "b": [0.7747, 0.6918, 0.8406, 0.7115]}, {"w": "every", "b": [0.1294, 0.7123, 0.1854, 0.732]}, {"w": "day", "b": [0.1917, 0.7123, 0.2282, 0.732]}, {"w": "on", "b": [0.2345, 0.7123, 0.2597, 0.732]}, {"w": "arXiv", "b": [0.266, 0.7123, 0.3234, 0.732]}, {"w": "makes", "b": [0.3298, 0.7123, 0.3942, 0.732]}, {"w": "it", "b": [0.4005, 0.7123, 0.4145, 0.732]}, {"w": "impossible", "b": [0.4208, 0.7123, 0.5302, 0.732]}, {"w": "to", "b": [0.5365, 0.7123, 0.5561, 0.732]}, {"w": "even", "b": [0.5624, 0.7123, 0.61, 0.732]}, {"w": "skim", "b": [0.6163, 0.7123, 0.6654, 0.732]}, {"w": "them", "b": [0.6716, 0.7123, 0.7221, 0.732]}, {"w": "all;", "b": [0.7284, 0.7123, 0.7606, 0.732]}, {"w": "and", "b": [0.767, 0.7123, 0.8034, 0.732]}, {"w": "the", "b": [0.8097, 0.7123, 0.8405, 0.732]}, {"w": "fact", "b": [0.1294, 0.7328, 0.1672, 0.7525]}, {"w": "that", "b": [0.1735, 0.7328, 0.2114, 0.7525]}, {"w": "they", "b": [0.2177, 0.7328, 0.2611, 0.7525]}, {"w": "aren’t", "b": [0.2674, 0.7328, 0.3258, 0.7525]}, {"w": "peer", "b": [0.3321, 0.7328, 0.3755, 0.7525]}, {"w": "reviewed", "b": [0.3818, 0.7328, 0.4742, 0.7525]}, {"w": "makes", "b": [0.4805, 0.7328, 0.545, 0.7525]}, {"w": "it", "b": [0.5513, 0.7328, 0.5653, 0.7525]}, {"w": "difficult", "b": [0.5716, 0.7328, 0.6524, 0.7525]}, {"w": "to", "b": [0.6587, 0.7328, 0.6783, 0.7525]}, {"w": "identify", "b": [0.6846, 0.7328, 0.7631, 0.7525]}, {"w": "those", "b": [0.7694, 0.7328, 0.8227, 0.7525]}, {"w": "that", "b": [0.829, 0.7328, 0.8668, 0.7525]}, {"w": "are", "b": [0.1294, 0.7533, 0.1602, 0.773]}, {"w": "both", "b": [0.1665, 0.7533, 0.2114, 0.773]}, {"w": "important", "b": [0.2177, 0.7533, 0.3158, 0.773]}, {"w": "and", "b": [0.3221, 0.7533, 0.3585, 0.773]}, {"w": "high", "b": [0.3648, 0.7533, 0.4097, 0.773]}, {"w": "quality.", "b": [0.4159, 0.7533, 0.4907, 0.773]}, {"w": "It’s", "b": [0.4969, 0.7533, 0.5292, 0.773]}, {"w": "difficult,", "b": [0.5355, 0.7533, 0.6226, 0.773]}, {"w": "and", "b": [0.6289, 0.7533, 0.6653, 0.773]}, {"w": "becoming", "b": [0.6716, 0.7533, 0.7711, 0.773]}, {"w": "increasingly", "b": [0.1294, 0.7738, 0.2527, 0.7935]}, {"w": "more", "b": [0.259, 0.7738, 0.3109, 0.7935]}, {"w": "so,", "b": [0.3172, 0.7738, 0.3459, 0.7935]}, {"w": "to", "b": [0.3522, 0.7738, 0.3718, 0.7935]}, {"w": "find", "b": [0.3781, 0.7738, 0.4188, 0.7935]}, {"w": "the", "b": [0.4251, 0.7738, 0.4559, 0.7935]}, {"w": "signal", "b": [0.4622, 0.7738, 0.5225, 0.7935]}, {"w": "in", "b": [0.5288, 0.7738, 0.5484, 0.7935]}, {"w": "the", "b": [0.5547, 0.7738, 0.5855, 0.7935]}, {"w": "noise.", "b": [0.5919, 0.7738, 0.6514, 0.7935]}, {"w": "Currently,", "b": [0.6577, 0.7738, 0.759, 0.7935]}, {"w": "there", "b": [0.7653, 0.7738, 0.8157, 0.7935]}, {"w": "isn’t", "b": [0.822, 0.7738, 0.8664, 0.7935]}, {"w": "a", "b": [0.1294, 0.7943, 0.1406, 0.814]}, {"w": "good", "b": [0.1469, 0.7943, 0.1974, 0.814]}, {"w": "solution", "b": [0.2037, 0.7943, 0.285, 0.814]}, {"w": "to", "b": [0.2913, 0.7943, 0.3109, 0.814]}, {"w": "this", "b": [0.3172, 0.7943, 0.3537, 0.814]}, {"w": "problem.", "b": [0.36, 0.7943, 0.4503, 0.814]}, {"w": "But", "b": [0.4567, 0.7943, 0.4931, 0.814]}, {"w": "some", "b": [0.4994, 0.7943, 0.5527, 0.814]}, {"w": "tools", "b": [0.559, 0.7943, 0.608, 0.814]}, {"w": "can", "b": [0.6143, 0.7943, 0.6494, 0.814]}, {"w": "help:", "b": [0.6557, 0.7943, 0.7061, 0.814]}, {"w": "an", "b": [0.7124, 0.7943, 0.7362, 0.814]}, {"w": "auxiliary", "b": [0.7425, 0.7943, 0.8322, 0.814]}, {"w": "website", "b": [0.1294, 0.8148, 0.2065, 0.8345]}, {"w": "called", "b": [0.2128, 0.8148, 0.273, 0.8345]}, {"w": "arXiv", "b": [0.2793, 0.8148, 0.3368, 0.8345]}, {"w": "Sanity", "b": [0.3431, 0.8148, 0.4076, 0.8345]}, {"w": "Preserver", "b": [0.4139, 0.8148, 0.5091, 0.8345]}, {"w": "(http://arxiv-sanity.com)", "b": [0.5154, 0.8148, 0.761, 0.8345]}, {"w": "serves", "b": [0.7673, 0.8148, 0.8304, 0.8345]}, {"w": "as", "b": [0.8367, 0.8148, 0.8577, 0.8345]}, {"w": "a", "b": [0.1294, 0.8353, 0.1406, 0.855]}, {"w": "recommendation", "b": [0.1469, 0.8353, 0.3165, 0.855]}, {"w": "engine", "b": [0.3228, 0.8353, 0.39, 0.855]}, {"w": "for", "b": [0.3963, 0.8353, 0.4257, 0.855]}, {"w": "new", "b": [0.432, 0.8353, 0.4741, 0.855]}, {"w": "papers", "b": [0.4804, 0.8353, 0.5462, 0.855]}, {"w": "and", "b": [0.5525, 0.8353, 0.5889, 0.855]}, {"w": "can", "b": [0.5953, 0.8353, 0.6303, 0.855]}, {"w": "help", "b": [0.6366, 0.8353, 0.68, 0.855]}, {"w": "you", "b": [0.6863, 0.8353, 0.7242, 0.855]}, {"w": "keep", "b": [0.7305, 0.8353, 0.7781, 0.855]}, {"w": "track", "b": [0.7844, 0.8353, 0.8348, 0.855]}, {"w": "of", "b": [0.8411, 0.8353, 0.8621, 0.855]}, {"w": "new", "b": [0.1294, 0.8558, 0.1714, 0.8755]}, {"w": "developments", "b": [0.1777, 0.8558, 0.3179, 0.8755]}, {"w": "within", "b": [0.3242, 0.8558, 0.3887, 0.8755]}, {"w": "a", "b": [0.395, 0.8558, 0.4062, 0.8755]}, {"w": "specific", "b": [0.4125, 0.8558, 0.4909, 0.8755]}, {"w": "narrow", "b": [0.4972, 0.8558, 0.5687, 0.8755]}, {"w": "vertical", "b": [0.5749, 0.8558, 0.6506, 0.8755]}, {"w": "of", "b": [0.6569, 0.8558, 0.6779, 0.8755]}, {"w": "deep", "b": [0.6842, 0.8558, 0.7318, 0.8755]}, {"w": "learning.", "b": [0.7381, 0.8558, 0.8271, 0.8755]}]}]}, {"page": 439, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Additionally, you can use Google Scholar (https://scholar.google.com) to keep track of publications by your favorite authors.", "words": [{"w": "Additionally,", "b": [0.1294, 0.0857, 0.2616, 0.1054]}, {"w": "you", "b": [0.2679, 0.0857, 0.3057, 0.1054]}, {"w": "can", "b": [0.3121, 0.0857, 0.3471, 0.1054]}, {"w": "use", "b": [0.3534, 0.0857, 0.387, 0.1054]}, {"w": "Google", "b": [0.3933, 0.0857, 0.4676, 0.1054]}, {"w": "Scholar", "b": [0.4739, 0.0857, 0.5509, 0.1054]}, {"w": "(https://scholar.google.com)", "b": [0.5572, 0.0857, 0.8403, 0.1054]}, {"w": "to", "b": [0.8466, 0.0857, 0.8662, 0.1054]}, {"w": "keep", "b": [0.1294, 0.1062, 0.177, 0.1259]}, {"w": "track", "b": [0.1833, 0.1062, 0.2338, 0.1259]}, {"w": "of", "b": [0.2401, 0.1062, 0.2611, 0.1259]}, {"w": "publications", "b": [0.2674, 0.1062, 0.3907, 0.1259]}, {"w": "by", "b": [0.397, 0.1062, 0.4223, 0.1259]}, {"w": "your", "b": [0.4286, 0.1062, 0.4748, 0.1259]}, {"w": "favorite", "b": [0.4811, 0.1062, 0.5596, 0.1259]}, {"w": "authors.", "b": [0.5659, 0.1062, 0.6464, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "9.4.3. Explore the Keras ecosystem", "words": [{"w": "9.4.3.", "b": [0.1294, 0.1534, 0.1862, 0.1732]}, {"w": "Explore", "b": [0.1925, 0.1534, 0.2775, 0.1732]}, {"w": "the", "b": [0.2838, 0.1534, 0.3174, 0.1732]}, {"w": "Keras", "b": [0.3237, 0.1534, 0.3882, 0.1732]}, {"w": "ecosystem", "b": [0.3945, 0.1534, 0.5024, 0.1732]}]}, {"id": "b_2", "type": "paragraph", "text": "With about 200,000 users as of November 2017 and growing fast, Keras has a large ecosystem of tutorials, guides, and related open source projects:", "words": [{"w": "With", "b": [0.1294, 0.1962, 0.1788, 0.2159]}, {"w": "about", "b": [0.1852, 0.1962, 0.2412, 0.2159]}, {"w": "200,000", "b": [0.2475, 0.1962, 0.3295, 0.2159]}, {"w": "users", "b": [0.3358, 0.1962, 0.3876, 0.2159]}, {"w": "as", "b": [0.3939, 0.1962, 0.415, 0.2159]}, {"w": "of", "b": [0.4213, 0.1962, 0.4423, 0.2159]}, {"w": "November", "b": [0.4486, 0.1962, 0.5551, 0.2159]}, {"w": "2017", "b": [0.5614, 0.1962, 0.6118, 0.2159]}, {"w": "and", "b": [0.6181, 0.1962, 0.6546, 0.2159]}, {"w": "growing", "b": [0.6609, 0.1962, 0.7449, 0.2159]}, {"w": "fast,", "b": [0.7512, 0.1962, 0.794, 0.2159]}, {"w": "Keras", "b": [0.8003, 0.1962, 0.8591, 0.2159]}, {"w": "has", "b": [0.1294, 0.2167, 0.163, 0.2364]}, {"w": "a", "b": [0.1693, 0.2167, 0.1805, 0.2364]}, {"w": "large", "b": [0.1869, 0.2167, 0.2368, 0.2364]}, {"w": "ecosystem", "b": [0.2431, 0.2167, 0.3482, 0.2364]}, {"w": "of", "b": [0.3545, 0.2167, 0.3755, 0.2364]}, {"w": "tutorials,", "b": [0.3818, 0.2167, 0.4708, 0.2364]}, {"w": "guides,", "b": [0.4771, 0.2167, 0.5493, 0.2364]}, {"w": "and", "b": [0.5556, 0.2167, 0.592, 0.2364]}, {"w": "related", "b": [0.5983, 0.2167, 0.667, 0.2364]}, {"w": "open", "b": [0.6732, 0.2167, 0.7223, 0.2364]}, {"w": "source", "b": [0.7286, 0.2167, 0.7944, 0.2364]}, {"w": "projects:", "b": [0.1294, 0.2372, 0.2163, 0.2569]}]}, {"id": "b_3", "type": "paragraph", "text": "Your main reference for working with Keras is the online documentation at https://keras.io. The Keras source code can be found at https://github.com/fchollet/keras. You can ask for help and join deep-learning discussions on the Keras Slack channel: https://kerasteam.slack.com. The Keras blog, https://blog.keras.io, offers Keras tutorials and other articles related to deep learning. You can follow me on Twitter: @fchollet.", "words": [{"w": "Your", "b": [0.1799, 0.2755, 0.2292, 0.2953]}, {"w": "main", "b": [0.2355, 0.2755, 0.2859, 0.2953]}, {"w": "reference", "b": [0.2922, 0.2755, 0.3861, 0.2953]}, {"w": "for", "b": [0.3924, 0.2755, 0.4218, 0.2953]}, {"w": "working", "b": [0.4281, 0.2755, 0.5122, 0.2953]}, {"w": "with", "b": [0.5185, 0.2755, 0.5633, 0.2953]}, {"w": "Keras", "b": [0.5696, 0.2755, 0.6285, 0.2953]}, {"w": "is", "b": [0.6348, 0.2755, 0.6516, 0.2953]}, {"w": "the", "b": [0.6579, 0.2755, 0.6887, 0.2953]}, {"w": "online", "b": [0.695, 0.2755, 0.7581, 0.2953]}, {"w": "documentation", "b": [0.1799, 0.296, 0.3298, 0.3158]}, {"w": "at", "b": [0.3361, 0.296, 0.3543, 0.3158]}, {"w": "https://keras.io.", "b": [0.3606, 0.296, 0.5161, 0.3158]}, {"w": "The", "b": [0.5224, 0.296, 0.5616, 0.3158]}, {"w": "Keras", "b": [0.568, 0.296, 0.6268, 0.3158]}, {"w": "source", "b": [0.6331, 0.296, 0.6989, 0.3158]}, {"w": "code", "b": [0.7052, 0.296, 0.7529, 0.3158]}, {"w": "can", "b": [0.7592, 0.296, 0.7942, 0.3158]}, {"w": "be", "b": [0.8005, 0.296, 0.8243, 0.3158]}, {"w": "found", "b": [0.1799, 0.3165, 0.2387, 0.3363]}, {"w": "at", "b": [0.245, 0.3165, 0.2632, 0.3363]}, {"w": "https://github.com/fchollet/keras.", "b": [0.2695, 0.3165, 0.6044, 0.3363]}, {"w": "You", "b": [0.1799, 0.337, 0.2208, 0.3568]}, {"w": "can", "b": [0.2271, 0.337, 0.2621, 0.3568]}, {"w": "ask", "b": [0.2684, 0.337, 0.302, 0.3568]}, {"w": "for", "b": [0.3083, 0.337, 0.3378, 0.3568]}, {"w": "help", "b": [0.3441, 0.337, 0.3875, 0.3568]}, {"w": "and", "b": [0.3938, 0.337, 0.4302, 0.3568]}, {"w": "join", "b": [0.4365, 0.337, 0.4758, 0.3568]}, {"w": "deep-learning", "b": [0.4821, 0.337, 0.6208, 0.3568]}, {"w": "discussions", "b": [0.6271, 0.337, 0.742, 0.3568]}, {"w": "on", "b": [0.7483, 0.337, 0.7736, 0.3568]}, {"w": "the", "b": [0.7799, 0.337, 0.8107, 0.3568]}, {"w": "Keras", "b": [0.1799, 0.3575, 0.2387, 0.3773]}, {"w": "Slack", "b": [0.245, 0.3575, 0.301, 0.3773]}, {"w": "channel:", "b": [0.3074, 0.3575, 0.3928, 0.3773]}, {"w": "https://kerasteam.slack.com.", "b": [0.3991, 0.3575, 0.6856, 0.3773]}, {"w": "The", "b": [0.1799, 0.378, 0.2191, 0.3978]}, {"w": "Keras", "b": [0.2254, 0.378, 0.2842, 0.3978]}, {"w": "blog,", "b": [0.2905, 0.378, 0.3417, 0.3978]}, {"w": "https://blog.keras.io,", "b": [0.348, 0.378, 0.5547, 0.3978]}, {"w": "offers", "b": [0.561, 0.378, 0.6193, 0.3978]}, {"w": "Keras", "b": [0.6256, 0.378, 0.6845, 0.3978]}, {"w": "tutorials", "b": [0.6908, 0.378, 0.7735, 0.3978]}, {"w": "and", "b": [0.7798, 0.378, 0.8162, 0.3978]}, {"w": "other", "b": [0.1799, 0.3985, 0.2317, 0.4183]}, {"w": "articles", "b": [0.238, 0.3985, 0.3109, 0.4183]}, {"w": "related", "b": [0.3172, 0.3985, 0.3858, 0.4183]}, {"w": "to", "b": [0.3921, 0.3985, 0.4117, 0.4183]}, {"w": "deep", "b": [0.418, 0.3985, 0.4657, 0.4183]}, {"w": "learning.", "b": [0.472, 0.3985, 0.5609, 0.4183]}, {"w": "You", "b": [0.1799, 0.419, 0.2208, 0.4388]}, {"w": "can", "b": [0.2271, 0.419, 0.2621, 0.4388]}, {"w": "follow", "b": [0.2684, 0.419, 0.3343, 0.4388]}, {"w": "me", "b": [0.3406, 0.419, 0.3714, 0.4388]}, {"w": "on", "b": [0.3777, 0.419, 0.4029, 0.4388]}, {"w": "Twitter:", "b": [0.4092, 0.419, 0.4887, 0.4388]}, {"w": "@fchollet.", "b": [0.495, 0.419, 0.6016, 0.4388]}]}, {"id": "b_4", "type": "paragraph", "text": "9.5. Final words", "words": [{"w": "9.5.", "b": [0.1294, 0.4759, 0.172, 0.4981]}, {"w": "Final", "b": [0.1791, 0.4759, 0.2422, 0.4981]}, {"w": "words", "b": [0.2493, 0.4759, 0.3234, 0.4981]}]}, {"id": "b_5", "type": "paragraph", "text": "This is the end of Deep Learning with Python! I hope you’ve learned a thing or two about machine learning, deep learning, Keras, and maybe even cognition in general. Learning is a lifelong journey, especially in the field of AI, where we have far more unknowns on our hands than certitudes. So please go on learning, questioning, and researching. Never stop. Because even given the progress made so far, most of the fundamental questions in AI remain unanswered. Many haven’t even been properly asked yet.", "words": [{"w": "This", "b": [0.1294, 0.5215, 0.1743, 0.5413]}, {"w": "is", "b": [0.1806, 0.5215, 0.1974, 0.5413]}, {"w": "the", "b": [0.2037, 0.5215, 0.2345, 0.5413]}, {"w": "end", "b": [0.2408, 0.5215, 0.2773, 0.5413]}, {"w": "of", "b": [0.2836, 0.5215, 0.3046, 0.5413]}, {"w": "Deep", "b": [0.3109, 0.5215, 0.3641, 0.5413]}, {"w": "Learning", "b": [0.3704, 0.5215, 0.4629, 0.5413]}, {"w": "with", "b": [0.4692, 0.5215, 0.5127, 0.5413]}, {"w": "Python!", "b": [0.519, 0.5215, 0.5988, 0.5413]}, {"w": "I", "b": [0.6051, 0.5215, 0.6135, 0.5413]}, {"w": "hope", "b": [0.6198, 0.5215, 0.6689, 0.5413]}, {"w": "you’ve", "b": [0.6752, 0.5215, 0.7452, 0.5413]}, {"w": "learned", "b": [0.7515, 0.5215, 0.8258, 0.5413]}, {"w": "a", "b": [0.8321, 0.5215, 0.8433, 0.5413]}, {"w": "thing", "b": [0.1294, 0.542, 0.1813, 0.5618]}, {"w": "or", "b": [0.1876, 0.542, 0.2086, 0.5618]}, {"w": "two", "b": [0.2149, 0.542, 0.2527, 0.5618]}, {"w": "about", "b": [0.259, 0.542, 0.3151, 0.5618]}, {"w": "machine", "b": [0.3214, 0.542, 0.4069, 0.5618]}, {"w": "learning,", "b": [0.4132, 0.542, 0.5021, 0.5618]}, {"w": "deep", "b": [0.5085, 0.542, 0.5561, 0.5618]}, {"w": "learning,", "b": [0.5624, 0.542, 0.6514, 0.5618]}, {"w": "Keras,", "b": [0.6577, 0.542, 0.7228, 0.5618]}, {"w": "and", "b": [0.7291, 0.542, 0.7655, 0.5618]}, {"w": "maybe", "b": [0.7718, 0.542, 0.8391, 0.5618]}, {"w": "even", "b": [0.1294, 0.5625, 0.177, 0.5823]}, {"w": "cognition", "b": [0.1833, 0.5625, 0.2786, 0.5823]}, {"w": "in", "b": [0.285, 0.5625, 0.3046, 0.5823]}, {"w": "general.", "b": [0.3109, 0.5625, 0.3914, 0.5823]}, {"w": "Learning", "b": [0.3977, 0.5625, 0.4888, 0.5823]}, {"w": "is", "b": [0.4951, 0.5625, 0.5119, 0.5823]}, {"w": "a", "b": [0.5182, 0.5625, 0.5294, 0.5823]}, {"w": "lifelong", "b": [0.5357, 0.5625, 0.6142, 0.5823]}, {"w": "journey,", "b": [0.6205, 0.5625, 0.7022, 0.5823]}, {"w": "especially", "b": [0.7085, 0.5625, 0.8094, 0.5823]}, {"w": "in", "b": [0.8157, 0.5625, 0.8353, 0.5823]}, {"w": "the", "b": [0.1294, 0.583, 0.1602, 0.6028]}, {"w": "field", "b": [0.1665, 0.583, 0.2128, 0.6028]}, {"w": "of", "b": [0.2191, 0.583, 0.2401, 0.6028]}, {"w": "AI,", "b": [0.2464, 0.583, 0.2793, 0.6028]}, {"w": "where", "b": [0.2856, 0.583, 0.3473, 0.6028]}, {"w": "we", "b": [0.3536, 0.583, 0.383, 0.6028]}, {"w": "have", "b": [0.3893, 0.583, 0.4369, 0.6028]}, {"w": "far", "b": [0.4432, 0.583, 0.4712, 0.6028]}, {"w": "more", "b": [0.4775, 0.583, 0.5294, 0.6028]}, {"w": "unknowns", "b": [0.5357, 0.583, 0.6394, 0.6028]}, {"w": "on", "b": [0.6457, 0.583, 0.6709, 0.6028]}, {"w": "our", "b": [0.6772, 0.583, 0.7108, 0.6028]}, {"w": "hands", "b": [0.7171, 0.583, 0.776, 0.6028]}, {"w": "than", "b": [0.7823, 0.583, 0.8257, 0.6028]}, {"w": "certitudes.", "b": [0.1294, 0.6035, 0.2338, 0.6233]}, {"w": "So", "b": [0.2401, 0.6035, 0.2667, 0.6233]}, {"w": "please", "b": [0.273, 0.6035, 0.3361, 0.6233]}, {"w": "go", "b": [0.3424, 0.6035, 0.3676, 0.6233]}, {"w": "on", "b": [0.3739, 0.6035, 0.3991, 0.6233]}, {"w": "learning,", "b": [0.4054, 0.6035, 0.4944, 0.6233]}, {"w": "questioning,", "b": [0.5007, 0.6035, 0.6247, 0.6233]}, {"w": "and", "b": [0.631, 0.6035, 0.6675, 0.6233]}, {"w": "researching.", "b": [0.6738, 0.6035, 0.7963, 0.6233]}, {"w": "Never", "b": [0.8027, 0.6035, 0.8643, 0.6233]}, {"w": "stop.", "b": [0.1294, 0.624, 0.1778, 0.6438]}, {"w": "Because", "b": [0.1841, 0.624, 0.2681, 0.6438]}, {"w": "even", "b": [0.2744, 0.624, 0.3221, 0.6438]}, {"w": "given", "b": [0.3284, 0.624, 0.3844, 0.6438]}, {"w": "the", "b": [0.3907, 0.624, 0.4216, 0.6438]}, {"w": "progress", "b": [0.4279, 0.624, 0.5133, 0.6438]}, {"w": "made", "b": [0.5196, 0.624, 0.5743, 0.6438]}, {"w": "so", "b": [0.5806, 0.624, 0.603, 0.6438]}, {"w": "far,", "b": [0.6093, 0.624, 0.6426, 0.6438]}, {"w": "most", "b": [0.6489, 0.624, 0.6979, 0.6438]}, {"w": "of", "b": [0.7042, 0.624, 0.7253, 0.6438]}, {"w": "the", "b": [0.7316, 0.624, 0.7624, 0.6438]}, {"w": "fundamental", "b": [0.1294, 0.6445, 0.2555, 0.6643]}, {"w": "questions", "b": [0.2618, 0.6445, 0.3571, 0.6643]}, {"w": "in", "b": [0.3634, 0.6445, 0.3831, 0.6643]}, {"w": "AI", "b": [0.3894, 0.6445, 0.416, 0.6643]}, {"w": "remain", "b": [0.4223, 0.6445, 0.4923, 0.6643]}, {"w": "unanswered.", "b": [0.4986, 0.6445, 0.6254, 0.6643]}, {"w": "Many", "b": [0.6317, 0.6445, 0.6906, 0.6643]}, {"w": "haven’t", "b": [0.6969, 0.6445, 0.772, 0.6643]}, {"w": "even", "b": [0.7783, 0.6445, 0.826, 0.6643]}, {"w": "been", "b": [0.1294, 0.665, 0.177, 0.6848]}, {"w": "properly", "b": [0.1833, 0.665, 0.2688, 0.6848]}, {"w": "asked", "b": [0.2751, 0.665, 0.3326, 0.6848]}, {"w": "yet.", "b": [0.3389, 0.665, 0.376, 0.6848]}]}]}, {"page": 440, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Appendix A. Installing Keras and its dependencies on Ubuntu", "words": [{"w": "Appendix", "b": [0.1287, 0.1058, 0.2654, 0.1314]}, {"w": "A.", "b": [0.2736, 0.1058, 0.3054, 0.1314]}, {"w": "Installing", "b": [0.3136, 0.1058, 0.4466, 0.1314]}, {"w": "Keras", "b": [0.4548, 0.1058, 0.5386, 0.1314]}, {"w": "and", "b": [0.5468, 0.1058, 0.5996, 0.1314]}, {"w": "its", "b": [0.6078, 0.1058, 0.6406, 0.1314]}, {"w": "dependencies", "b": [0.6488, 0.1058, 0.8346, 0.1314]}, {"w": "on", "b": [0.1287, 0.1328, 0.1633, 0.1584]}, {"w": "Ubuntu", "b": [0.1715, 0.1328, 0.2791, 0.1584]}]}, {"id": "b_1", "type": "paragraph", "text": "The process of setting up a deep-learning workstation is fairly involved and consists of the following steps, which this appendix will cover in detail:", "words": [{"w": "The", "b": [0.1287, 0.1797, 0.1647, 0.1978]}, {"w": "process", "b": [0.1705, 0.1797, 0.2399, 0.1978]}, {"w": "of", "b": [0.2457, 0.1797, 0.265, 0.1978]}, {"w": "setting", "b": [0.2708, 0.1797, 0.3325, 0.1978]}, {"w": "up", "b": [0.3383, 0.1797, 0.3614, 0.1978]}, {"w": "a", "b": [0.3672, 0.1797, 0.3775, 0.1978]}, {"w": "deep-learning", "b": [0.3833, 0.1797, 0.5105, 0.1978]}, {"w": "workstation", "b": [0.5163, 0.1797, 0.6256, 0.1978]}, {"w": "is", "b": [0.6314, 0.1797, 0.6468, 0.1978]}, {"w": "fairly", "b": [0.6526, 0.1797, 0.7028, 0.1978]}, {"w": "involved", "b": [0.7086, 0.1797, 0.7896, 0.1978]}, {"w": "and", "b": [0.7954, 0.1797, 0.8288, 0.1978]}, {"w": "consists", "b": [0.1287, 0.1985, 0.202, 0.2166]}, {"w": "of", "b": [0.2078, 0.1985, 0.2271, 0.2166]}, {"w": "the", "b": [0.2329, 0.1985, 0.2612, 0.2166]}, {"w": "following", "b": [0.2669, 0.1985, 0.357, 0.2166]}, {"w": "steps,", "b": [0.3627, 0.1985, 0.4148, 0.2166]}, {"w": "which", "b": [0.4206, 0.1985, 0.4772, 0.2166]}, {"w": "this", "b": [0.483, 0.1985, 0.5164, 0.2166]}, {"w": "appendix", "b": [0.5222, 0.1985, 0.6071, 0.2166]}, {"w": "will", "b": [0.6128, 0.1985, 0.6488, 0.2166]}, {"w": "cover", "b": [0.6546, 0.1985, 0.706, 0.2166]}, {"w": "in", "b": [0.7118, 0.1985, 0.7298, 0.2166]}, {"w": "detail:", "b": [0.7356, 0.1985, 0.7935, 0.2166]}]}, {"id": "b_2", "type": "paragraph", "text": "1. Install the Python scientific suite—Numpy and SciPy—and make sure you have a Basic Linear Algebra Subprogram (BLAS) library installed so your models run fast on CPU. 2. Install two extras packages that come in handy when using Keras: HDF5 (for saving large neural-network files) and Graphviz (for visualizing neural--network architectures). 3. Make sure your GPU can run deep-learning code, by installing CUDA drivers and cuDNN. 4. Install a backend for Keras: TensorFlow, CNTK, or Theano. 5. Install Keras.", "words": [{"w": "1.", "b": [0.1523, 0.2337, 0.1696, 0.2518]}, {"w": "Install", "b": [0.175, 0.2337, 0.2329, 0.2518]}, {"w": "the", "b": [0.2387, 0.2337, 0.2669, 0.2518]}, {"w": "Python", "b": [0.2727, 0.2337, 0.3383, 0.2518]}, {"w": "scientific", "b": [0.3441, 0.2337, 0.429, 0.2518]}, {"w": "suite—Numpy", "b": [0.4348, 0.2337, 0.5711, 0.2518]}, {"w": "and", "b": [0.5769, 0.2337, 0.6103, 0.2518]}, {"w": "SciPy—and", "b": [0.6161, 0.2337, 0.7267, 0.2518]}, {"w": "make", "b": [0.7324, 0.2337, 0.7826, 0.2518]}, {"w": "sure", "b": [0.7884, 0.2337, 0.8269, 0.2518]}, {"w": "you", "b": [0.8327, 0.2337, 0.8674, 0.2518]}, {"w": "have", "b": [0.175, 0.2525, 0.2187, 0.2706]}, {"w": "a", "b": [0.2245, 0.2525, 0.2348, 0.2706]}, {"w": "Basic", "b": [0.2406, 0.2525, 0.292, 0.2706]}, {"w": "Linear", "b": [0.2978, 0.2525, 0.3582, 0.2706]}, {"w": "Algebra", "b": [0.364, 0.2525, 0.4385, 0.2706]}, {"w": "Subprogram", "b": [0.4443, 0.2525, 0.5588, 0.2706]}, {"w": "(BLAS)", "b": [0.5645, 0.2525, 0.6391, 0.2706]}, {"w": "library", "b": [0.6449, 0.2525, 0.7066, 0.2706]}, {"w": "installed", "b": [0.7123, 0.2525, 0.7908, 0.2706]}, {"w": "so", "b": [0.7966, 0.2525, 0.8172, 0.2706]}, {"w": "your", "b": [0.8229, 0.2525, 0.8654, 0.2706]}, {"w": "models", "b": [0.175, 0.2713, 0.2419, 0.2894]}, {"w": "run", "b": [0.2477, 0.2713, 0.2785, 0.2894]}, {"w": "fast", "b": [0.2843, 0.2713, 0.3177, 0.2894]}, {"w": "on", "b": [0.3235, 0.2713, 0.3467, 0.2894]}, {"w": "CPU.", "b": [0.3524, 0.2713, 0.4033, 0.2894]}, {"w": "2.", "b": [0.1523, 0.2901, 0.1696, 0.3082]}, {"w": "Install", "b": [0.175, 0.2901, 0.2329, 0.3082]}, {"w": "two", "b": [0.2387, 0.2901, 0.2734, 0.3082]}, {"w": "extras", "b": [0.2792, 0.2901, 0.3344, 0.3082]}, {"w": "packages", "b": [0.3402, 0.2901, 0.4251, 0.3082]}, {"w": "that", "b": [0.4308, 0.2901, 0.4656, 0.3082]}, {"w": "come", "b": [0.4714, 0.2901, 0.5215, 0.3082]}, {"w": "in", "b": [0.5273, 0.2901, 0.5453, 0.3082]}, {"w": "handy", "b": [0.5511, 0.2901, 0.6076, 0.3082]}, {"w": "when", "b": [0.6134, 0.2901, 0.6636, 0.3082]}, {"w": "using", "b": [0.6693, 0.2901, 0.7195, 0.3082]}, {"w": "Keras:", "b": [0.7253, 0.2901, 0.7857, 0.3082]}, {"w": "HDF5", "b": [0.7915, 0.2901, 0.8494, 0.3082]}, {"w": "(for", "b": [0.175, 0.3089, 0.2097, 0.327]}, {"w": "saving", "b": [0.2155, 0.3089, 0.2759, 0.327]}, {"w": "large", "b": [0.2817, 0.3089, 0.3276, 0.327]}, {"w": "neural-network", "b": [0.3333, 0.3089, 0.4747, 0.327]}, {"w": "files)", "b": [0.4805, 0.3089, 0.5281, 0.327]}, {"w": "and", "b": [0.5339, 0.3089, 0.5673, 0.327]}, {"w": "Graphviz", "b": [0.5731, 0.3089, 0.6592, 0.327]}, {"w": "(for", "b": [0.665, 0.3089, 0.6997, 0.327]}, {"w": "visualizing", "b": [0.7055, 0.3089, 0.807, 0.327]}, {"w": "neural--network", "b": [0.175, 0.3277, 0.3241, 0.3459]}, {"w": "architectures).", "b": [0.3299, 0.3277, 0.4617, 0.3459]}, {"w": "3.", "b": [0.1523, 0.3466, 0.1696, 0.3647]}, {"w": "Make", "b": [0.175, 0.3466, 0.2277, 0.3647]}, {"w": "sure", "b": [0.2335, 0.3466, 0.2721, 0.3647]}, {"w": "your", "b": [0.2779, 0.3466, 0.3203, 0.3647]}, {"w": "GPU", "b": [0.3261, 0.3466, 0.3724, 0.3647]}, {"w": "can", "b": [0.3781, 0.3466, 0.4103, 0.3647]}, {"w": "run", "b": [0.4161, 0.3466, 0.4469, 0.3647]}, {"w": "deep-learning", "b": [0.4527, 0.3466, 0.58, 0.3647]}, {"w": "code,", "b": [0.5857, 0.3466, 0.6352, 0.3647]}, {"w": "by", "b": [0.641, 0.3466, 0.6642, 0.3647]}, {"w": "installing", "b": [0.6699, 0.3466, 0.7561, 0.3647]}, {"w": "CUDA", "b": [0.7619, 0.3466, 0.8275, 0.3647]}, {"w": "drivers", "b": [0.175, 0.3654, 0.2393, 0.3835]}, {"w": "and", "b": [0.2451, 0.3654, 0.2785, 0.3835]}, {"w": "cuDNN.", "b": [0.2843, 0.3654, 0.3621, 0.3835]}, {"w": "4.", "b": [0.1523, 0.3842, 0.1696, 0.4023]}, {"w": "Install", "b": [0.175, 0.3842, 0.2329, 0.4023]}, {"w": "a", "b": [0.2387, 0.3842, 0.2489, 0.4023]}, {"w": "backend", "b": [0.2547, 0.3842, 0.3318, 0.4023]}, {"w": "for", "b": [0.3376, 0.3842, 0.3646, 0.4023]}, {"w": "Keras:", "b": [0.3704, 0.3842, 0.4308, 0.4023]}, {"w": "TensorFlow,", "b": [0.4366, 0.3842, 0.5511, 0.4023]}, {"w": "CNTK,", "b": [0.5569, 0.3842, 0.6257, 0.4023]}, {"w": "or", "b": [0.6315, 0.3842, 0.6508, 0.4023]}, {"w": "Theano.", "b": [0.6565, 0.3842, 0.7317, 0.4023]}, {"w": "5.", "b": [0.1523, 0.403, 0.1696, 0.4211]}, {"w": "Install", "b": [0.175, 0.403, 0.2329, 0.4211]}, {"w": "Keras.", "b": [0.2387, 0.403, 0.2984, 0.4211]}]}, {"id": "b_3", "type": "paragraph", "text": "It may seem like a daunting process. In fact, the only difficult part is setting up GPU support—otherwise, the entire process can be done with a few commands and takes only a couple of minutes.", "words": [{"w": "It", "b": [0.1287, 0.4422, 0.1429, 0.4604]}, {"w": "may", "b": [0.1486, 0.4422, 0.1885, 0.4604]}, {"w": "seem", "b": [0.1943, 0.4422, 0.2419, 0.4604]}, {"w": "like", "b": [0.2476, 0.4422, 0.2824, 0.4604]}, {"w": "a", "b": [0.2882, 0.4422, 0.2984, 0.4604]}, {"w": "daunting", "b": [0.3042, 0.4422, 0.3852, 0.4604]}, {"w": "process.", "b": [0.391, 0.4422, 0.4662, 0.4604]}, {"w": "In", "b": [0.472, 0.4422, 0.4913, 0.4604]}, {"w": "fact,", "b": [0.4971, 0.4422, 0.5375, 0.4604]}, {"w": "the", "b": [0.5433, 0.4422, 0.5716, 0.4604]}, {"w": "only", "b": [0.5774, 0.4422, 0.6186, 0.4604]}, {"w": "difficult", "b": [0.6243, 0.4422, 0.6984, 0.4604]}, {"w": "part", "b": [0.7042, 0.4422, 0.7402, 0.4604]}, {"w": "is", "b": [0.746, 0.4422, 0.7614, 0.4604]}, {"w": "setting", "b": [0.7672, 0.4422, 0.829, 0.4604]}, {"w": "up", "b": [0.8347, 0.4422, 0.8579, 0.4604]}, {"w": "GPU", "b": [0.1287, 0.461, 0.175, 0.4792]}, {"w": "support—otherwise,", "b": [0.1808, 0.461, 0.3692, 0.4792]}, {"w": "the", "b": [0.3749, 0.461, 0.4032, 0.4792]}, {"w": "entire", "b": [0.409, 0.461, 0.4617, 0.4792]}, {"w": "process", "b": [0.4675, 0.461, 0.5369, 0.4792]}, {"w": "can", "b": [0.5427, 0.461, 0.5748, 0.4792]}, {"w": "be", "b": [0.5806, 0.461, 0.6025, 0.4792]}, {"w": "done", "b": [0.6082, 0.461, 0.6532, 0.4792]}, {"w": "with", "b": [0.659, 0.461, 0.7002, 0.4792]}, {"w": "a", "b": [0.706, 0.461, 0.7162, 0.4792]}, {"w": "few", "b": [0.722, 0.461, 0.7567, 0.4792]}, {"w": "commands", "b": [0.7625, 0.461, 0.8628, 0.4792]}, {"w": "and", "b": [0.1287, 0.4799, 0.1621, 0.498]}, {"w": "takes", "b": [0.1679, 0.4799, 0.2155, 0.498]}, {"w": "only", "b": [0.2213, 0.4799, 0.2624, 0.498]}, {"w": "a", "b": [0.2682, 0.4799, 0.2785, 0.498]}, {"w": "couple", "b": [0.2843, 0.4799, 0.346, 0.498]}, {"w": "of", "b": [0.3518, 0.4799, 0.3711, 0.498]}, {"w": "minutes.", "b": [0.3768, 0.4799, 0.4559, 0.498]}]}, {"id": "b_4", "type": "paragraph", "text": "We’ll assume you have a fresh installation of Ubuntu, with an NVIDIA GPU available. Before you start, make sure you have pip installed and that your package manager is up to date:", "words": [{"w": "We’ll", "b": [0.1287, 0.5191, 0.1796, 0.5372]}, {"w": "assume", "b": [0.1854, 0.5191, 0.2535, 0.5372]}, {"w": "you", "b": [0.2593, 0.5191, 0.294, 0.5372]}, {"w": "have", "b": [0.2998, 0.5191, 0.3435, 0.5372]}, {"w": "a", "b": [0.3493, 0.5191, 0.3596, 0.5372]}, {"w": "fresh", "b": [0.3653, 0.5191, 0.4116, 0.5372]}, {"w": "installation", "b": [0.4174, 0.5191, 0.5203, 0.5372]}, {"w": "of", "b": [0.5261, 0.5191, 0.5453, 0.5372]}, {"w": "Ubuntu,", "b": [0.5511, 0.5191, 0.6264, 0.5372]}, {"w": "with", "b": [0.6321, 0.5191, 0.6733, 0.5372]}, {"w": "an", "b": [0.6791, 0.5191, 0.7009, 0.5372]}, {"w": "NVIDIA", "b": [0.7067, 0.5191, 0.789, 0.5372]}, {"w": "GPU", "b": [0.7948, 0.5191, 0.8411, 0.5372]}, {"w": "available.", "b": [0.1287, 0.5379, 0.2181, 0.556]}, {"w": "Before", "b": [0.2239, 0.5379, 0.2868, 0.556]}, {"w": "you", "b": [0.2926, 0.5379, 0.3273, 0.556]}, {"w": "start,", "b": [0.3331, 0.5379, 0.3788, 0.556]}, {"w": "make", "b": [0.3846, 0.5379, 0.4347, 0.556]}, {"w": "sure", "b": [0.4405, 0.5379, 0.479, 0.556]}, {"w": "you", "b": [0.4848, 0.5379, 0.5195, 0.556]}, {"w": "have", "b": [0.5253, 0.5379, 0.569, 0.556]}, {"w": "pip", "b": [0.5748, 0.5389, 0.6164, 0.5574]}, {"w": "installed", "b": [0.6222, 0.5379, 0.7006, 0.556]}, {"w": "and", "b": [0.7064, 0.5379, 0.7399, 0.556]}, {"w": "that", "b": [0.7456, 0.5379, 0.7804, 0.556]}, {"w": "your", "b": [0.7861, 0.5379, 0.8286, 0.556]}, {"w": "package", "b": [0.1287, 0.5576, 0.2045, 0.5757]}, {"w": "manager", "b": [0.2103, 0.5576, 0.29, 0.5757]}, {"w": "is", "b": [0.2958, 0.5576, 0.3112, 0.5757]}, {"w": "up", "b": [0.317, 0.5576, 0.3402, 0.5757]}, {"w": "to", "b": [0.346, 0.5576, 0.364, 0.5757]}, {"w": "date:", "b": [0.3698, 0.5576, 0.4148, 0.5757]}]}, {"id": "b_5", "type": "paragraph", "text": "$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install python-pip python-dev", "words": [{"w": "$", "b": [0.1345, 0.5922, 0.1449, 0.6061]}, {"w": "sudo", "b": [0.1553, 0.5922, 0.197, 0.6061]}, {"w": "apt-get", "b": [0.2074, 0.5922, 0.2803, 0.6061]}, {"w": "update", "b": [0.2907, 0.5922, 0.3532, 0.6061]}, {"w": "$", "b": [0.1345, 0.6061, 0.1449, 0.62]}, {"w": "sudo", "b": [0.1553, 0.6061, 0.197, 0.62]}, {"w": "apt-get", "b": [0.2074, 0.6061, 0.2803, 0.62]}, {"w": "upgrade", "b": [0.2907, 0.6061, 0.3637, 0.62]}, {"w": "$", "b": [0.1345, 0.62, 0.1449, 0.6339]}, {"w": "sudo", "b": [0.1553, 0.62, 0.197, 0.6339]}, {"w": "apt-get", "b": [0.2074, 0.62, 0.2803, 0.6339]}, {"w": "install", "b": [0.2907, 0.62, 0.3637, 0.6339]}, {"w": "python-pip", "b": [0.3741, 0.62, 0.4782, 0.6339]}, {"w": "python-dev", "b": [0.4886, 0.62, 0.5928, 0.6339]}]}, {"id": "b_6", "type": "paragraph", "text": "Python 2 vs. Python 3", "words": [{"w": "Python", "b": [0.1287, 0.6631, 0.1995, 0.6812]}, {"w": "2", "b": [0.2052, 0.6631, 0.2168, 0.6812]}, {"w": "vs.", "b": [0.2226, 0.6631, 0.249, 0.6812]}, {"w": "Python", "b": [0.2548, 0.6631, 0.3255, 0.6812]}, {"w": "3", "b": [0.3313, 0.6631, 0.3428, 0.6812]}]}, {"id": "b_7", "type": "paragraph", "text": "By default, Ubuntu uses Python 2 when it installs Python packages such as python-pip. If you wish to use Python 3 instead, you should use the python3 prefix instead of python. For instance:", "words": [{"w": "By", "b": [0.1287, 0.7023, 0.1557, 0.7204]}, {"w": "default,", "b": [0.1615, 0.7023, 0.2316, 0.7204]}, {"w": "Ubuntu", "b": [0.2374, 0.7023, 0.3068, 0.7204]}, {"w": "uses", "b": [0.3126, 0.7023, 0.3524, 0.7204]}, {"w": "Python", "b": [0.3582, 0.7023, 0.4238, 0.7204]}, {"w": "2", "b": [0.4296, 0.7023, 0.4412, 0.7204]}, {"w": "when", "b": [0.447, 0.7023, 0.4971, 0.7204]}, {"w": "it", "b": [0.5029, 0.7023, 0.5158, 0.7204]}, {"w": "installs", "b": [0.5216, 0.7023, 0.5872, 0.7204]}, {"w": "Python", "b": [0.5929, 0.7023, 0.6585, 0.7204]}, {"w": "packages", "b": [0.6643, 0.7023, 0.7492, 0.7204]}, {"w": "such", "b": [0.7549, 0.7023, 0.7974, 0.7204]}, {"w": "as", "b": [0.8032, 0.7023, 0.8224, 0.7204]}, {"w": "python-pip.", "b": [0.1287, 0.7211, 0.2734, 0.7406]}, {"w": "If", "b": [0.2792, 0.7211, 0.2946, 0.7392]}, {"w": "you", "b": [0.3004, 0.7211, 0.3351, 0.7392]}, {"w": "wish", "b": [0.3409, 0.7211, 0.3846, 0.7392]}, {"w": "to", "b": [0.3904, 0.7211, 0.4084, 0.7392]}, {"w": "use", "b": [0.4142, 0.7211, 0.4451, 0.7392]}, {"w": "Python", "b": [0.4508, 0.7211, 0.5164, 0.7392]}, {"w": "3", "b": [0.5222, 0.7211, 0.5338, 0.7392]}, {"w": "instead,", "b": [0.5396, 0.7211, 0.6109, 0.7392]}, {"w": "you", "b": [0.6167, 0.7211, 0.6514, 0.7392]}, {"w": "should", "b": [0.6572, 0.7211, 0.719, 0.7392]}, {"w": "use", "b": [0.7247, 0.7211, 0.7556, 0.7392]}, {"w": "the", "b": [0.7614, 0.7211, 0.7897, 0.7392]}, {"w": "python3", "b": [0.1287, 0.7417, 0.2259, 0.7602]}, {"w": "prefix", "b": [0.2317, 0.7407, 0.287, 0.7589]}, {"w": "instead", "b": [0.2928, 0.7407, 0.3584, 0.7589]}, {"w": "of", "b": [0.3641, 0.7407, 0.3834, 0.7589]}, {"w": "python.", "b": [0.3892, 0.7407, 0.4783, 0.7602]}, {"w": "For", "b": [0.4841, 0.7407, 0.5162, 0.7589]}, {"w": "instance:", "b": [0.522, 0.7407, 0.6043, 0.7589]}]}, {"id": "b_8", "type": "equation", "text": "$ sudo apt-get install python3-pip python3-dev", "words": [{"w": "$", "b": [0.1345, 0.7762, 0.1449, 0.7901]}, {"w": "sudo", "b": [0.1553, 0.7762, 0.197, 0.7901]}, {"w": "apt-get", "b": [0.2074, 0.7762, 0.2803, 0.7901]}, {"w": "install", "b": [0.2907, 0.7762, 0.3637, 0.7901]}, {"w": "python3-pip", "b": [0.3741, 0.7762, 0.4886, 0.7901]}, {"w": "python3-dev", "b": [0.4991, 0.7762, 0.6136, 0.7901]}]}, {"id": "b_9", "type": "paragraph", "text": "When you’re installing packages using pip, keep in mind that by default, it targets Python 2. To target Python 3, you should use pip3:", "words": [{"w": "When", "b": [0.1287, 0.8111, 0.184, 0.8292]}, {"w": "you’re", "b": [0.1898, 0.8111, 0.2502, 0.8292]}, {"w": "installing", "b": [0.256, 0.8111, 0.3421, 0.8292]}, {"w": "packages", "b": [0.3479, 0.8111, 0.4328, 0.8292]}, {"w": "using", "b": [0.4386, 0.8111, 0.4887, 0.8292]}, {"w": "pip,", "b": [0.4944, 0.8111, 0.5419, 0.8306]}, {"w": "keep", "b": [0.5477, 0.8111, 0.5914, 0.8292]}, {"w": "in", "b": [0.5972, 0.8111, 0.6152, 0.8292]}, {"w": "mind", "b": [0.621, 0.8111, 0.6686, 0.8292]}, {"w": "that", "b": [0.6743, 0.8111, 0.7091, 0.8292]}, {"w": "by", "b": [0.7148, 0.8111, 0.738, 0.8292]}, {"w": "default,", "b": [0.7438, 0.8111, 0.8138, 0.8292]}, {"w": "it", "b": [0.8196, 0.8111, 0.8325, 0.8292]}, {"w": "targets", "b": [0.1287, 0.8307, 0.19, 0.8488]}, {"w": "Python", "b": [0.1958, 0.8307, 0.2614, 0.8488]}, {"w": "2.", "b": [0.2672, 0.8307, 0.2845, 0.8488]}, {"w": "To", "b": [0.2903, 0.8307, 0.3144, 0.8488]}, {"w": "target", "b": [0.3202, 0.8307, 0.3725, 0.8488]}, {"w": "Python", "b": [0.3783, 0.8307, 0.4439, 0.8488]}, {"w": "3,", "b": [0.4496, 0.8307, 0.467, 0.8488]}, {"w": "you", "b": [0.4728, 0.8307, 0.5075, 0.8488]}, {"w": "should", "b": [0.5133, 0.8307, 0.575, 0.8488]}, {"w": "use", "b": [0.5808, 0.8307, 0.6117, 0.8488]}, {"w": "pip3:", "b": [0.6174, 0.8307, 0.6794, 0.8502]}]}, {"id": "b_10", "type": "equation", "text": "$ sudo pip3 install tensorflow-gpu", "words": [{"w": "$", "b": [0.1345, 0.8662, 0.1449, 0.88]}, {"w": "sudo", "b": [0.1553, 0.8662, 0.197, 0.88]}, {"w": "pip3", "b": [0.2074, 0.8662, 0.2491, 0.88]}, {"w": "install", "b": [0.2595, 0.8662, 0.3324, 0.88]}, {"w": "tensorflow-gpu", "b": [0.3428, 0.8662, 0.4886, 0.88]}]}]}, {"page": 441, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "A.1. Installing the Python scientific suite", "words": [{"w": "A.1.", "b": [0.1287, 0.0863, 0.1736, 0.1067]}, {"w": "Installing", "b": [0.1801, 0.0863, 0.2857, 0.1067]}, {"w": "the", "b": [0.2922, 0.0863, 0.3269, 0.1067]}, {"w": "Python", "b": [0.3334, 0.0863, 0.413, 0.1067]}, {"w": "scientific", "b": [0.4195, 0.0863, 0.5179, 0.1067]}, {"w": "suite", "b": [0.5244, 0.0863, 0.5765, 0.1067]}]}, {"id": "b_1", "type": "paragraph", "text": "If you use a Mac, we recommend that you install the Python scientific suite via Anaconda, which you can get at www.continuum.io/downloads. Note that this won’t include HDF5 and Graphviz, which you have to install manually. Following are the steps for a manual installation of the Python scientific suite on Ubuntu:", "words": [{"w": "If", "b": [0.1287, 0.1282, 0.1441, 0.1463]}, {"w": "you", "b": [0.1499, 0.1282, 0.1846, 0.1463]}, {"w": "use", "b": [0.1904, 0.1282, 0.2213, 0.1463]}, {"w": "a", "b": [0.2271, 0.1282, 0.2373, 0.1463]}, {"w": "Mac,", "b": [0.2431, 0.1282, 0.29, 0.1463]}, {"w": "we", "b": [0.2958, 0.1282, 0.3228, 0.1463]}, {"w": "recommend", "b": [0.3286, 0.1282, 0.4379, 0.1463]}, {"w": "that", "b": [0.4437, 0.1282, 0.4784, 0.1463]}, {"w": "you", "b": [0.4842, 0.1282, 0.5189, 0.1463]}, {"w": "install", "b": [0.5247, 0.1282, 0.5813, 0.1463]}, {"w": "the", "b": [0.5871, 0.1282, 0.6153, 0.1463]}, {"w": "Python", "b": [0.6211, 0.1282, 0.6867, 0.1463]}, {"w": "scientific", "b": [0.6925, 0.1282, 0.7774, 0.1463]}, {"w": "suite", "b": [0.7832, 0.1282, 0.8269, 0.1463]}, {"w": "via", "b": [0.8327, 0.1282, 0.8609, 0.1463]}, {"w": "Anaconda,", "b": [0.1287, 0.147, 0.2283, 0.1651]}, {"w": "which", "b": [0.2341, 0.147, 0.2907, 0.1651]}, {"w": "you", "b": [0.2965, 0.147, 0.3312, 0.1651]}, {"w": "can", "b": [0.337, 0.147, 0.3691, 0.1651]}, {"w": "get", "b": [0.3749, 0.147, 0.4032, 0.1651]}, {"w": "at", "b": [0.409, 0.147, 0.4257, 0.1651]}, {"w": "www.continuum.io/downloads.", "b": [0.4314, 0.147, 0.7212, 0.1651]}, {"w": "Note", "b": [0.7269, 0.147, 0.7719, 0.1651]}, {"w": "that", "b": [0.7777, 0.147, 0.8124, 0.1651]}, {"w": "this", "b": [0.8182, 0.147, 0.8517, 0.1651]}, {"w": "won’t", "b": [0.1287, 0.1658, 0.1823, 0.1839]}, {"w": "include", "b": [0.1881, 0.1658, 0.2562, 0.1839]}, {"w": "HDF5", "b": [0.262, 0.1658, 0.3199, 0.1839]}, {"w": "and", "b": [0.3257, 0.1658, 0.3591, 0.1839]}, {"w": "Graphviz,", "b": [0.3649, 0.1658, 0.4568, 0.1839]}, {"w": "which", "b": [0.4626, 0.1658, 0.5192, 0.1839]}, {"w": "you", "b": [0.5249, 0.1658, 0.5597, 0.1839]}, {"w": "have", "b": [0.5654, 0.1658, 0.6091, 0.1839]}, {"w": "to", "b": [0.6149, 0.1658, 0.6329, 0.1839]}, {"w": "install", "b": [0.6387, 0.1658, 0.6953, 0.1839]}, {"w": "manually.", "b": [0.7011, 0.1658, 0.7915, 0.1839]}, {"w": "Following", "b": [0.1287, 0.1846, 0.2239, 0.2027]}, {"w": "are", "b": [0.2297, 0.1846, 0.2579, 0.2027]}, {"w": "the", "b": [0.2637, 0.1846, 0.292, 0.2027]}, {"w": "steps", "b": [0.2978, 0.1846, 0.3441, 0.2027]}, {"w": "for", "b": [0.3499, 0.1846, 0.3769, 0.2027]}, {"w": "a", "b": [0.3827, 0.1846, 0.3929, 0.2027]}, {"w": "manual", "b": [0.3987, 0.1846, 0.4681, 0.2027]}, {"w": "installation", "b": [0.4739, 0.1846, 0.5768, 0.2027]}, {"w": "of", "b": [0.5826, 0.1846, 0.6019, 0.2027]}, {"w": "the", "b": [0.6077, 0.1846, 0.6359, 0.2027]}, {"w": "Python", "b": [0.6417, 0.1846, 0.7073, 0.2027]}, {"w": "scientific", "b": [0.7131, 0.1846, 0.798, 0.2027]}, {"w": "suite", "b": [0.8038, 0.1846, 0.8475, 0.2027]}, {"w": "on", "b": [0.1287, 0.2034, 0.1519, 0.2215]}, {"w": "Ubuntu:", "b": [0.1577, 0.2034, 0.2335, 0.2215]}]}, {"id": "b_2", "type": "paragraph", "text": "1. Install a BLAS library (OpenBLAS, in this case), to ensure that you can run fast tensor operations on your CPU:", "words": [{"w": "1.", "b": [0.1523, 0.2386, 0.1696, 0.2567]}, {"w": "Install", "b": [0.175, 0.2386, 0.2329, 0.2567]}, {"w": "a", "b": [0.2387, 0.2386, 0.2489, 0.2567]}, {"w": "BLAS", "b": [0.2547, 0.2386, 0.3139, 0.2567]}, {"w": "library", "b": [0.3197, 0.2386, 0.3814, 0.2567]}, {"w": "(OpenBLAS,", "b": [0.3872, 0.2386, 0.51, 0.2567]}, {"w": "in", "b": [0.5157, 0.2386, 0.5338, 0.2567]}, {"w": "this", "b": [0.5395, 0.2386, 0.573, 0.2567]}, {"w": "case),", "b": [0.5788, 0.2386, 0.6321, 0.2567]}, {"w": "to", "b": [0.6379, 0.2386, 0.6559, 0.2567]}, {"w": "ensure", "b": [0.6617, 0.2386, 0.7221, 0.2567]}, {"w": "that", "b": [0.7279, 0.2386, 0.7626, 0.2567]}, {"w": "you", "b": [0.7684, 0.2386, 0.8031, 0.2567]}, {"w": "can", "b": [0.8089, 0.2386, 0.841, 0.2567]}, {"w": "run", "b": [0.175, 0.2574, 0.2059, 0.2755]}, {"w": "fast", "b": [0.2117, 0.2574, 0.2451, 0.2755]}, {"w": "tensor", "b": [0.2509, 0.2574, 0.3074, 0.2755]}, {"w": "operations", "b": [0.3132, 0.2574, 0.4096, 0.2755]}, {"w": "on", "b": [0.4154, 0.2574, 0.4386, 0.2755]}, {"w": "your", "b": [0.4444, 0.2574, 0.4868, 0.2755]}, {"w": "CPU:", "b": [0.4926, 0.2574, 0.544, 0.2755]}]}, {"id": "b_3", "type": "paragraph", "text": "$ sudo apt-get install build-essential cmake git unzip \\ pkg-config libopenblas-dev liblapack-dev", "words": [{"w": "$", "b": [0.1808, 0.2879, 0.1912, 0.3018]}, {"w": "sudo", "b": [0.2016, 0.2879, 0.2433, 0.3018]}, {"w": "apt-get", "b": [0.2537, 0.2879, 0.3266, 0.3018]}, {"w": "install", "b": [0.337, 0.2879, 0.4099, 0.3018]}, {"w": "build-essential", "b": [0.4204, 0.2879, 0.5766, 0.3018]}, {"w": "cmake", "b": [0.587, 0.2879, 0.6391, 0.3018]}, {"w": "git", "b": [0.6495, 0.2879, 0.6808, 0.3018]}, {"w": "unzip", "b": [0.6912, 0.2879, 0.7432, 0.3018]}, {"w": "\\", "b": [0.7537, 0.2879, 0.7641, 0.3018]}, {"w": "pkg-config", "b": [0.2329, 0.3018, 0.337, 0.3157]}, {"w": "libopenblas-dev", "b": [0.3475, 0.3018, 0.5037, 0.3157]}, {"w": "liblapack-dev", "b": [0.5141, 0.3018, 0.6495, 0.3157]}]}, {"id": "b_4", "type": "paragraph", "text": "2. Install the Python scientific suite: Numpy, SciPy and Matplotlib. This is necessary in order to perform any kind of machine learning or scientific computing in Python, regardless of whether you’re doing deep learning:", "words": [{"w": "2.", "b": [0.1523, 0.3286, 0.1696, 0.3467]}, {"w": "Install", "b": [0.175, 0.3286, 0.2329, 0.3467]}, {"w": "the", "b": [0.2387, 0.3286, 0.2669, 0.3467]}, {"w": "Python", "b": [0.2727, 0.3286, 0.3383, 0.3467]}, {"w": "scientific", "b": [0.3441, 0.3286, 0.429, 0.3467]}, {"w": "suite:", "b": [0.4348, 0.3286, 0.4849, 0.3467]}, {"w": "Numpy,", "b": [0.4907, 0.3286, 0.5644, 0.3467]}, {"w": "SciPy", "b": [0.5702, 0.3286, 0.6242, 0.3467]}, {"w": "and", "b": [0.63, 0.3286, 0.6634, 0.3467]}, {"w": "Matplotlib.", "b": [0.6692, 0.3286, 0.7727, 0.3467]}, {"w": "This", "b": [0.7785, 0.3286, 0.8196, 0.3467]}, {"w": "is", "b": [0.8254, 0.3286, 0.8409, 0.3467]}, {"w": "necessary", "b": [0.175, 0.3474, 0.265, 0.3655]}, {"w": "in", "b": [0.2708, 0.3474, 0.2888, 0.3655]}, {"w": "order", "b": [0.2946, 0.3474, 0.3434, 0.3655]}, {"w": "to", "b": [0.3492, 0.3474, 0.3672, 0.3655]}, {"w": "perform", "b": [0.373, 0.3474, 0.4475, 0.3655]}, {"w": "any", "b": [0.4533, 0.3474, 0.4867, 0.3655]}, {"w": "kind", "b": [0.4925, 0.3474, 0.5337, 0.3655]}, {"w": "of", "b": [0.5395, 0.3474, 0.5588, 0.3655]}, {"w": "machine", "b": [0.5645, 0.3474, 0.643, 0.3655]}, {"w": "learning", "b": [0.6487, 0.3474, 0.7245, 0.3655]}, {"w": "or", "b": [0.7303, 0.3474, 0.7496, 0.3655]}, {"w": "scientific", "b": [0.7554, 0.3474, 0.8402, 0.3655]}, {"w": "computing", "b": [0.175, 0.3662, 0.274, 0.3843]}, {"w": "in", "b": [0.2798, 0.3662, 0.2978, 0.3843]}, {"w": "Python,", "b": [0.3036, 0.3662, 0.375, 0.3843]}, {"w": "regardless", "b": [0.3808, 0.3662, 0.4746, 0.3843]}, {"w": "of", "b": [0.4804, 0.3662, 0.4997, 0.3843]}, {"w": "whether", "b": [0.5055, 0.3662, 0.58, 0.3843]}, {"w": "you’re", "b": [0.5858, 0.3662, 0.6462, 0.3843]}, {"w": "doing", "b": [0.652, 0.3662, 0.7047, 0.3843]}, {"w": "deep", "b": [0.7105, 0.3662, 0.7542, 0.3843]}, {"w": "learning:", "b": [0.76, 0.3662, 0.8423, 0.3843]}]}, {"id": "b_5", "type": "equation", "text": "$ sudo apt-get install python-numpy python-scipy python- matplotlib", "words": [{"w": "$", "b": [0.1808, 0.3967, 0.1912, 0.4106]}, {"w": "sudo", "b": [0.2016, 0.3967, 0.2433, 0.4106]}, {"w": "apt-get", "b": [0.2537, 0.3967, 0.3266, 0.4106]}, {"w": "install", "b": [0.337, 0.3967, 0.4099, 0.4106]}, {"w": "python-numpy", "b": [0.4204, 0.3967, 0.5453, 0.4106]}, {"w": "python-scipy", "b": [0.5558, 0.3967, 0.6808, 0.4106]}, {"w": "python-", "b": [0.6912, 0.3967, 0.7641, 0.4106]}, {"w": "matplotlib", "b": [0.1808, 0.4106, 0.285, 0.4245]}]}, {"id": "b_6", "type": "equation", "text": "python-yaml", "words": [{"w": "python-yaml", "b": [0.2074, 0.4262, 0.322, 0.4401]}]}, {"id": "b_7", "type": "paragraph", "text": "3. Install HDF5. This library, originally developed by NASA, stores large files of numeric data in an efficient binary format. It will allow you to save your Keras models to disk quickly and efficiently:", "words": [{"w": "3.", "b": [0.1523, 0.4529, 0.1696, 0.471]}, {"w": "Install", "b": [0.175, 0.4529, 0.2329, 0.471]}, {"w": "HDF5.", "b": [0.2387, 0.4529, 0.3023, 0.471]}, {"w": "This", "b": [0.3081, 0.4529, 0.3493, 0.471]}, {"w": "library,", "b": [0.355, 0.4529, 0.421, 0.471]}, {"w": "originally", "b": [0.4268, 0.4529, 0.5168, 0.471]}, {"w": "developed", "b": [0.5226, 0.4529, 0.6177, 0.471]}, {"w": "by", "b": [0.6235, 0.4529, 0.6467, 0.471]}, {"w": "NASA,", "b": [0.6525, 0.4529, 0.7212, 0.471]}, {"w": "stores", "b": [0.727, 0.4529, 0.781, 0.471]}, {"w": "large", "b": [0.7868, 0.4529, 0.8326, 0.471]}, {"w": "files", "b": [0.175, 0.4717, 0.2149, 0.4898]}, {"w": "of", "b": [0.2207, 0.4717, 0.2399, 0.4898]}, {"w": "numeric", "b": [0.2457, 0.4717, 0.3216, 0.4898]}, {"w": "data", "b": [0.3274, 0.4717, 0.3659, 0.4898]}, {"w": "in", "b": [0.3717, 0.4717, 0.3897, 0.4898]}, {"w": "an", "b": [0.3955, 0.4717, 0.4174, 0.4898]}, {"w": "efficient", "b": [0.4231, 0.4717, 0.4998, 0.4898]}, {"w": "binary", "b": [0.5056, 0.4717, 0.5647, 0.4898]}, {"w": "format.", "b": [0.5705, 0.4717, 0.638, 0.4898]}, {"w": "It", "b": [0.6437, 0.4717, 0.6579, 0.4898]}, {"w": "will", "b": [0.6637, 0.4717, 0.6997, 0.4898]}, {"w": "allow", "b": [0.7055, 0.4717, 0.7569, 0.4898]}, {"w": "you", "b": [0.7627, 0.4717, 0.7974, 0.4898]}, {"w": "to", "b": [0.8032, 0.4717, 0.8212, 0.4898]}, {"w": "save", "b": [0.827, 0.4717, 0.8681, 0.4898]}, {"w": "your", "b": [0.175, 0.4905, 0.2174, 0.5086]}, {"w": "Keras", "b": [0.2232, 0.4905, 0.2772, 0.5086]}, {"w": "models", "b": [0.283, 0.4905, 0.3499, 0.5086]}, {"w": "to", "b": [0.3556, 0.4905, 0.3737, 0.5086]}, {"w": "disk", "b": [0.3794, 0.4905, 0.418, 0.5086]}, {"w": "quickly", "b": [0.4238, 0.4905, 0.4932, 0.5086]}, {"w": "and", "b": [0.499, 0.4905, 0.5325, 0.5086]}, {"w": "efficiently:", "b": [0.5382, 0.4905, 0.6394, 0.5086]}]}, {"id": "b_8", "type": "equation", "text": "$ sudo apt-get install libhdf5-serial-dev python-h5py", "words": [{"w": "$", "b": [0.1808, 0.521, 0.1912, 0.5349]}, {"w": "sudo", "b": [0.2016, 0.521, 0.2433, 0.5349]}, {"w": "apt-get", "b": [0.2537, 0.521, 0.3266, 0.5349]}, {"w": "install", "b": [0.337, 0.521, 0.4099, 0.5349]}, {"w": "libhdf5-serial-dev", "b": [0.4204, 0.521, 0.6078, 0.5349]}, {"w": "python-h5py", "b": [0.6183, 0.521, 0.7328, 0.5349]}]}, {"id": "b_9", "type": "paragraph", "text": "4. Install Graphviz and pydot-ng, two packages that will let you visualize Keras models. They aren’t necessary to run Keras, so you could skip this step and install these packages when you need them. Here are the commands:", "words": [{"w": "4.", "b": [0.1523, 0.5477, 0.1696, 0.5659]}, {"w": "Install", "b": [0.175, 0.5477, 0.2329, 0.5659]}, {"w": "Graphviz", "b": [0.2387, 0.5477, 0.3248, 0.5659]}, {"w": "and", "b": [0.3306, 0.5477, 0.364, 0.5659]}, {"w": "pydot-ng,", "b": [0.3698, 0.5477, 0.4592, 0.5659]}, {"w": "two", "b": [0.4649, 0.5477, 0.4997, 0.5659]}, {"w": "packages", "b": [0.5054, 0.5477, 0.5903, 0.5659]}, {"w": "that", "b": [0.5961, 0.5477, 0.6308, 0.5659]}, {"w": "will", "b": [0.6366, 0.5477, 0.6726, 0.5659]}, {"w": "let", "b": [0.6784, 0.5477, 0.7015, 0.5659]}, {"w": "you", "b": [0.7073, 0.5477, 0.742, 0.5659]}, {"w": "visualize", "b": [0.7478, 0.5477, 0.8301, 0.5659]}, {"w": "Keras", "b": [0.175, 0.5665, 0.229, 0.5847]}, {"w": "models.", "b": [0.2348, 0.5665, 0.3074, 0.5847]}, {"w": "They", "b": [0.3132, 0.5665, 0.3608, 0.5847]}, {"w": "aren’t", "b": [0.3666, 0.5665, 0.4201, 0.5847]}, {"w": "necessary", "b": [0.4259, 0.5665, 0.5159, 0.5847]}, {"w": "to", "b": [0.5216, 0.5665, 0.5397, 0.5847]}, {"w": "run", "b": [0.5454, 0.5665, 0.5763, 0.5847]}, {"w": "Keras,", "b": [0.5821, 0.5665, 0.6418, 0.5847]}, {"w": "so", "b": [0.6476, 0.5665, 0.6682, 0.5847]}, {"w": "you", "b": [0.674, 0.5665, 0.7087, 0.5847]}, {"w": "could", "b": [0.7145, 0.5665, 0.7659, 0.5847]}, {"w": "skip", "b": [0.7717, 0.5665, 0.8103, 0.5847]}, {"w": "this", "b": [0.8161, 0.5665, 0.8495, 0.5847]}, {"w": "step", "b": [0.175, 0.5854, 0.2123, 0.6035]}, {"w": "and", "b": [0.2181, 0.5854, 0.2515, 0.6035]}, {"w": "install", "b": [0.2573, 0.5854, 0.3139, 0.6035]}, {"w": "these", "b": [0.3197, 0.5854, 0.3672, 0.6035]}, {"w": "packages", "b": [0.373, 0.5854, 0.4579, 0.6035]}, {"w": "when", "b": [0.4636, 0.5854, 0.5138, 0.6035]}, {"w": "you", "b": [0.5196, 0.5854, 0.5543, 0.6035]}, {"w": "need", "b": [0.5601, 0.5854, 0.6038, 0.6035]}, {"w": "them.", "b": [0.6096, 0.5854, 0.6616, 0.6035]}, {"w": "Here", "b": [0.6674, 0.5854, 0.7124, 0.6035]}, {"w": "are", "b": [0.7182, 0.5854, 0.7464, 0.6035]}, {"w": "the", "b": [0.7522, 0.5854, 0.7805, 0.6035]}, {"w": "commands:", "b": [0.175, 0.6042, 0.2817, 0.6223]}]}, {"id": "b_10", "type": "equation", "text": "$ sudo apt-get install graphviz $ sudo pip install pydot-ng", "words": [{"w": "$", "b": [0.1808, 0.6347, 0.1912, 0.6486]}, {"w": "sudo", "b": [0.2016, 0.6347, 0.2433, 0.6486]}, {"w": "apt-get", "b": [0.2537, 0.6347, 0.3266, 0.6486]}, {"w": "install", "b": [0.337, 0.6347, 0.4099, 0.6486]}, {"w": "graphviz", "b": [0.4204, 0.6347, 0.5037, 0.6486]}, {"w": "$", "b": [0.1808, 0.6486, 0.1912, 0.6625]}, {"w": "sudo", "b": [0.2016, 0.6486, 0.2433, 0.6625]}, {"w": "pip", "b": [0.2537, 0.6486, 0.285, 0.6625]}, {"w": "install", "b": [0.2954, 0.6486, 0.3683, 0.6625]}, {"w": "pydot-ng", "b": [0.3787, 0.6486, 0.462, 0.6625]}]}, {"id": "b_11", "type": "paragraph", "text": "5. Install additional packages that are used in some of our code examples:", "words": [{"w": "5.", "b": [0.1523, 0.6753, 0.1696, 0.6934]}, {"w": "Install", "b": [0.175, 0.6753, 0.2329, 0.6934]}, {"w": "additional", "b": [0.2387, 0.6753, 0.3312, 0.6934]}, {"w": "packages", "b": [0.337, 0.6753, 0.4219, 0.6934]}, {"w": "that", "b": [0.4277, 0.6753, 0.4624, 0.6934]}, {"w": "are", "b": [0.4682, 0.6753, 0.4964, 0.6934]}, {"w": "used", "b": [0.5022, 0.6753, 0.5446, 0.6934]}, {"w": "in", "b": [0.5504, 0.6753, 0.5684, 0.6934]}, {"w": "some", "b": [0.5742, 0.6753, 0.6231, 0.6934]}, {"w": "of", "b": [0.6289, 0.6753, 0.6481, 0.6934]}, {"w": "our", "b": [0.6539, 0.6753, 0.6848, 0.6934]}, {"w": "code", "b": [0.6906, 0.6753, 0.7343, 0.6934]}, {"w": "examples:", "b": [0.7401, 0.6753, 0.8339, 0.6934]}]}, {"id": "b_12", "type": "equation", "text": "$ sudo apt-get install python-opencv", "words": [{"w": "$", "b": [0.1808, 0.7059, 0.1912, 0.7198]}, {"w": "sudo", "b": [0.2016, 0.7059, 0.2433, 0.7198]}, {"w": "apt-get", "b": [0.2537, 0.7059, 0.3266, 0.7198]}, {"w": "install", "b": [0.337, 0.7059, 0.4099, 0.7198]}, {"w": "python-opencv", "b": [0.4204, 0.7059, 0.5558, 0.7198]}]}, {"id": "b_13", "type": "paragraph", "text": "A.2. Setting up GPU support", "words": [{"w": "A.2.", "b": [0.1287, 0.7536, 0.1736, 0.774]}, {"w": "Setting", "b": [0.1801, 0.7536, 0.2582, 0.774]}, {"w": "up", "b": [0.2647, 0.7536, 0.2937, 0.774]}, {"w": "GPU", "b": [0.3002, 0.7536, 0.3551, 0.774]}, {"w": "support", "b": [0.3616, 0.7536, 0.4485, 0.774]}]}, {"id": "b_14", "type": "paragraph", "text": "Using a GPU isn’t strictly necessary, but it’s strongly recommended. All the code examples found in this book can be run on a laptop CPU, but you may sometimes have to wait for several hours for a model to train, instead of mere minutes on a good GPU. If you don’t have a modern NVIDIA GPU, you can skip this step and go directly to section A.3.", "words": [{"w": "Using", "b": [0.1287, 0.7955, 0.184, 0.8137]}, {"w": "a", "b": [0.1898, 0.7955, 0.2001, 0.8137]}, {"w": "GPU", "b": [0.2059, 0.7955, 0.2522, 0.8137]}, {"w": "isn’t", "b": [0.2579, 0.7955, 0.2987, 0.8137]}, {"w": "strictly", "b": [0.3045, 0.7955, 0.3688, 0.8137]}, {"w": "necessary,", "b": [0.3746, 0.7955, 0.4688, 0.8137]}, {"w": "but", "b": [0.4746, 0.7955, 0.5042, 0.8137]}, {"w": "it’s", "b": [0.5099, 0.7955, 0.5382, 0.8137]}, {"w": "strongly", "b": [0.544, 0.7955, 0.6199, 0.8137]}, {"w": "recommended.", "b": [0.6257, 0.7955, 0.7626, 0.8137]}, {"w": "All", "b": [0.7684, 0.7955, 0.798, 0.8137]}, {"w": "the", "b": [0.8037, 0.7955, 0.832, 0.8137]}, {"w": "code", "b": [0.1287, 0.8144, 0.1724, 0.8325]}, {"w": "examples", "b": [0.1782, 0.8144, 0.2656, 0.8325]}, {"w": "found", "b": [0.2714, 0.8144, 0.3254, 0.8325]}, {"w": "in", "b": [0.3312, 0.8144, 0.3492, 0.8325]}, {"w": "this", "b": [0.355, 0.8144, 0.3884, 0.8325]}, {"w": "book", "b": [0.3942, 0.8144, 0.4405, 0.8325]}, {"w": "can", "b": [0.4463, 0.8144, 0.4784, 0.8325]}, {"w": "be", "b": [0.4842, 0.8144, 0.5061, 0.8325]}, {"w": "run", "b": [0.5119, 0.8144, 0.5427, 0.8325]}, {"w": "on", "b": [0.5485, 0.8144, 0.5716, 0.8325]}, {"w": "a", "b": [0.5774, 0.8144, 0.5877, 0.8325]}, {"w": "laptop", "b": [0.5934, 0.8144, 0.6513, 0.8325]}, {"w": "CPU,", "b": [0.6571, 0.8144, 0.7079, 0.8325]}, {"w": "but", "b": [0.7137, 0.8144, 0.7433, 0.8325]}, {"w": "you", "b": [0.749, 0.8144, 0.7838, 0.8325]}, {"w": "may", "b": [0.7896, 0.8144, 0.8294, 0.8325]}, {"w": "sometimes", "b": [0.1287, 0.8332, 0.2277, 0.8513]}, {"w": "have", "b": [0.2335, 0.8332, 0.2772, 0.8513]}, {"w": "to", "b": [0.283, 0.8332, 0.301, 0.8513]}, {"w": "wait", "b": [0.3068, 0.8332, 0.3467, 0.8513]}, {"w": "for", "b": [0.3524, 0.8332, 0.3794, 0.8513]}, {"w": "several", "b": [0.3852, 0.8332, 0.4508, 0.8513]}, {"w": "hours", "b": [0.4566, 0.8332, 0.508, 0.8513]}, {"w": "for", "b": [0.5138, 0.8332, 0.5408, 0.8513]}, {"w": "a", "b": [0.5466, 0.8332, 0.5568, 0.8513]}, {"w": "model", "b": [0.5626, 0.8332, 0.6205, 0.8513]}, {"w": "to", "b": [0.6263, 0.8332, 0.6443, 0.8513]}, {"w": "train,", "b": [0.6501, 0.8332, 0.6983, 0.8513]}, {"w": "instead", "b": [0.7041, 0.8332, 0.7696, 0.8513]}, {"w": "of", "b": [0.7754, 0.8332, 0.7947, 0.8513]}, {"w": "mere", "b": [0.8005, 0.8332, 0.8468, 0.8513]}, {"w": "minutes", "b": [0.1287, 0.852, 0.202, 0.8701]}, {"w": "on", "b": [0.2078, 0.852, 0.231, 0.8701]}, {"w": "a", "b": [0.2367, 0.852, 0.247, 0.8701]}, {"w": "good", "b": [0.2528, 0.852, 0.2991, 0.8701]}, {"w": "GPU.", "b": [0.3049, 0.852, 0.3569, 0.8701]}, {"w": "If", "b": [0.3627, 0.852, 0.3781, 0.8701]}, {"w": "you", "b": [0.3839, 0.852, 0.4187, 0.8701]}, {"w": "don’t", "b": [0.4244, 0.852, 0.4729, 0.8701]}, {"w": "have", "b": [0.4787, 0.852, 0.5224, 0.8701]}, {"w": "a", "b": [0.5282, 0.852, 0.5384, 0.8701]}, {"w": "modern", "b": [0.5442, 0.852, 0.6149, 0.8701]}, {"w": "NVIDIA", "b": [0.6207, 0.852, 0.703, 0.8701]}, {"w": "GPU,", "b": [0.7088, 0.852, 0.7609, 0.8701]}, {"w": "you", "b": [0.7666, 0.852, 0.8014, 0.8701]}, {"w": "can", "b": [0.8071, 0.852, 0.8393, 0.8701]}, {"w": "skip", "b": [0.1287, 0.8708, 0.1673, 0.8889]}, {"w": "this", "b": [0.1731, 0.8708, 0.2065, 0.8889]}, {"w": "step", "b": [0.2123, 0.8708, 0.2496, 0.8889]}, {"w": "and", "b": [0.2554, 0.8708, 0.2888, 0.8889]}, {"w": "go", "b": [0.2946, 0.8708, 0.3178, 0.8889]}, {"w": "directly", "b": [0.3235, 0.8708, 0.3943, 0.8889]}, {"w": "to", "b": [0.4, 0.8708, 0.418, 0.8889]}, {"w": "section", "b": [0.4238, 0.8708, 0.4894, 0.8889]}, {"w": "A.3.", "b": [0.4952, 0.8708, 0.535, 0.8889]}]}]}, {"page": 442, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "To use your NVIDIA GPU for deep learning, you need to install two things:", "words": [{"w": "To", "b": [0.1287, 0.0857, 0.1528, 0.1038]}, {"w": "use", "b": [0.1586, 0.0857, 0.1895, 0.1038]}, {"w": "your", "b": [0.1952, 0.0857, 0.2377, 0.1038]}, {"w": "NVIDIA", "b": [0.2435, 0.0857, 0.3257, 0.1038]}, {"w": "GPU", "b": [0.3315, 0.0857, 0.3778, 0.1038]}, {"w": "for", "b": [0.3836, 0.0857, 0.4106, 0.1038]}, {"w": "deep", "b": [0.4164, 0.0857, 0.4601, 0.1038]}, {"w": "learning,", "b": [0.4658, 0.0857, 0.5475, 0.1038]}, {"w": "you", "b": [0.5533, 0.0857, 0.588, 0.1038]}, {"w": "need", "b": [0.5938, 0.0857, 0.6375, 0.1038]}, {"w": "to", "b": [0.6433, 0.0857, 0.6613, 0.1038]}, {"w": "install", "b": [0.6671, 0.0857, 0.7236, 0.1038]}, {"w": "two", "b": [0.7294, 0.0857, 0.7641, 0.1038]}, {"w": "things:", "b": [0.7699, 0.0857, 0.833, 0.1038]}]}, {"id": "b_1", "type": "paragraph", "text": "CUDA— A set of drivers for your GPU that allows it to run a low-level programming language for parallel computing. cuDNN— A library of highly optimized primitives for deep learning. When using cuDNN and running on a GPU, you can typically increase the training speed of your models by 50% to 100%.", "words": [{"w": "CUDA—", "b": [0.175, 0.1208, 0.2625, 0.1389]}, {"w": "A", "b": [0.2682, 0.1208, 0.285, 0.1389]}, {"w": "set", "b": [0.2907, 0.1208, 0.3165, 0.1389]}, {"w": "of", "b": [0.3222, 0.1208, 0.3415, 0.1389]}, {"w": "drivers", "b": [0.3473, 0.1208, 0.4116, 0.1389]}, {"w": "for", "b": [0.4174, 0.1208, 0.4444, 0.1389]}, {"w": "your", "b": [0.4502, 0.1208, 0.4926, 0.1389]}, {"w": "GPU", "b": [0.4984, 0.1208, 0.5447, 0.1389]}, {"w": "that", "b": [0.5504, 0.1208, 0.5852, 0.1389]}, {"w": "allows", "b": [0.591, 0.1208, 0.6514, 0.1389]}, {"w": "it", "b": [0.6572, 0.1208, 0.67, 0.1389]}, {"w": "to", "b": [0.6758, 0.1208, 0.6938, 0.1389]}, {"w": "run", "b": [0.6996, 0.1208, 0.7305, 0.1389]}, {"w": "a", "b": [0.7363, 0.1208, 0.7465, 0.1389]}, {"w": "low-level", "b": [0.7523, 0.1208, 0.8397, 0.1389]}, {"w": "programming", "b": [0.175, 0.1396, 0.301, 0.1578]}, {"w": "language", "b": [0.3068, 0.1396, 0.3904, 0.1578]}, {"w": "for", "b": [0.3961, 0.1396, 0.4231, 0.1578]}, {"w": "parallel", "b": [0.4289, 0.1396, 0.4983, 0.1578]}, {"w": "computing.", "b": [0.5041, 0.1396, 0.6089, 0.1578]}, {"w": "cuDNN—", "b": [0.175, 0.1585, 0.2714, 0.1766]}, {"w": "A", "b": [0.2772, 0.1585, 0.2939, 0.1766]}, {"w": "library", "b": [0.2997, 0.1585, 0.3614, 0.1766]}, {"w": "of", "b": [0.3672, 0.1585, 0.3865, 0.1766]}, {"w": "highly", "b": [0.3923, 0.1585, 0.4515, 0.1766]}, {"w": "optimized", "b": [0.4572, 0.1585, 0.5498, 0.1766]}, {"w": "primitives", "b": [0.5556, 0.1585, 0.6495, 0.1766]}, {"w": "for", "b": [0.6553, 0.1585, 0.6823, 0.1766]}, {"w": "deep", "b": [0.6881, 0.1585, 0.7318, 0.1766]}, {"w": "learning.", "b": [0.7375, 0.1585, 0.8192, 0.1766]}, {"w": "When", "b": [0.175, 0.1773, 0.2303, 0.1954]}, {"w": "using", "b": [0.2361, 0.1773, 0.2862, 0.1954]}, {"w": "cuDNN", "b": [0.292, 0.1773, 0.364, 0.1954]}, {"w": "and", "b": [0.3698, 0.1773, 0.4032, 0.1954]}, {"w": "running", "b": [0.409, 0.1773, 0.481, 0.1954]}, {"w": "on", "b": [0.4868, 0.1773, 0.5099, 0.1954]}, {"w": "a", "b": [0.5157, 0.1773, 0.526, 0.1954]}, {"w": "GPU,", "b": [0.5318, 0.1773, 0.5839, 0.1954]}, {"w": "you", "b": [0.5897, 0.1773, 0.6244, 0.1954]}, {"w": "can", "b": [0.6302, 0.1773, 0.6623, 0.1954]}, {"w": "typically", "b": [0.6681, 0.1773, 0.7491, 0.1954]}, {"w": "increase", "b": [0.7549, 0.1773, 0.8307, 0.1954]}, {"w": "the", "b": [0.8364, 0.1773, 0.8647, 0.1954]}, {"w": "training", "b": [0.175, 0.1961, 0.247, 0.2142]}, {"w": "speed", "b": [0.2528, 0.1961, 0.3055, 0.2142]}, {"w": "of", "b": [0.3113, 0.1961, 0.3306, 0.2142]}, {"w": "your", "b": [0.3364, 0.1961, 0.3788, 0.2142]}, {"w": "models", "b": [0.3846, 0.1961, 0.4514, 0.2142]}, {"w": "by", "b": [0.4572, 0.1961, 0.4804, 0.2142]}, {"w": "50%", "b": [0.4862, 0.1961, 0.5286, 0.2142]}, {"w": "to", "b": [0.5344, 0.1961, 0.5524, 0.2142]}, {"w": "100%.", "b": [0.5582, 0.1961, 0.618, 0.2142]}]}, {"id": "b_2", "type": "paragraph", "text": "TensorFlow depends on particular versions of CUDA and the cuDNN library. At the time of writing, it uses CUDA version 8 and cuDNN version 6. Please consult the Tensor-Flow website for detailed instructions about which versions are currently recommended: www.tensorflow.org/install/install_linux.", "words": [{"w": "TensorFlow", "b": [0.1287, 0.2353, 0.239, 0.2534]}, {"w": "depends", "b": [0.2448, 0.2353, 0.3206, 0.2534]}, {"w": "on", "b": [0.3264, 0.2353, 0.3495, 0.2534]}, {"w": "particular", "b": [0.3553, 0.2353, 0.444, 0.2534]}, {"w": "versions", "b": [0.4498, 0.2353, 0.5269, 0.2534]}, {"w": "of", "b": [0.5327, 0.2353, 0.552, 0.2534]}, {"w": "CUDA", "b": [0.5578, 0.2353, 0.6234, 0.2534]}, {"w": "and", "b": [0.6292, 0.2353, 0.6626, 0.2534]}, {"w": "the", "b": [0.6684, 0.2353, 0.6967, 0.2534]}, {"w": "cuDNN", "b": [0.7024, 0.2353, 0.7744, 0.2534]}, {"w": "library.", "b": [0.7802, 0.2353, 0.8462, 0.2534]}, {"w": "At", "b": [0.1287, 0.2541, 0.1519, 0.2723]}, {"w": "the", "b": [0.1577, 0.2541, 0.1859, 0.2723]}, {"w": "time", "b": [0.1917, 0.2541, 0.2329, 0.2723]}, {"w": "of", "b": [0.2387, 0.2541, 0.2579, 0.2723]}, {"w": "writing,", "b": [0.2637, 0.2541, 0.3364, 0.2723]}, {"w": "it", "b": [0.3422, 0.2541, 0.355, 0.2723]}, {"w": "uses", "b": [0.3608, 0.2541, 0.4007, 0.2723]}, {"w": "CUDA", "b": [0.4065, 0.2541, 0.472, 0.2723]}, {"w": "version", "b": [0.4778, 0.2541, 0.546, 0.2723]}, {"w": "8", "b": [0.5518, 0.2541, 0.5633, 0.2723]}, {"w": "and", "b": [0.5691, 0.2541, 0.6025, 0.2723]}, {"w": "cuDNN", "b": [0.6083, 0.2541, 0.6803, 0.2723]}, {"w": "version", "b": [0.6861, 0.2541, 0.7542, 0.2723]}, {"w": "6.", "b": [0.76, 0.2541, 0.7774, 0.2723]}, {"w": "Please", "b": [0.7831, 0.2541, 0.8423, 0.2723]}, {"w": "consult", "b": [0.1287, 0.2729, 0.1956, 0.2911]}, {"w": "the", "b": [0.2014, 0.2729, 0.2297, 0.2911]}, {"w": "Tensor-Flow", "b": [0.2354, 0.2729, 0.3529, 0.2911]}, {"w": "website", "b": [0.3587, 0.2729, 0.4294, 0.2911]}, {"w": "for", "b": [0.4352, 0.2729, 0.4622, 0.2911]}, {"w": "detailed", "b": [0.468, 0.2729, 0.5413, 0.2911]}, {"w": "instructions", "b": [0.547, 0.2729, 0.6551, 0.2911]}, {"w": "about", "b": [0.6609, 0.2729, 0.7123, 0.2911]}, {"w": "which", "b": [0.7181, 0.2729, 0.7746, 0.2911]}, {"w": "versions", "b": [0.7804, 0.2729, 0.8576, 0.2911]}, {"w": "are", "b": [0.1287, 0.2918, 0.157, 0.3099]}, {"w": "currently", "b": [0.1628, 0.2918, 0.2463, 0.3099]}, {"w": "recommended:", "b": [0.2521, 0.2918, 0.3897, 0.3099]}, {"w": "www.tensorflow.org/install/install_linux.", "b": [0.3954, 0.2918, 0.7745, 0.3099]}]}, {"id": "b_3", "type": "paragraph", "text": "Follow these steps:", "words": [{"w": "Follow", "b": [0.1287, 0.331, 0.1943, 0.3491]}, {"w": "these", "b": [0.2001, 0.331, 0.2477, 0.3491]}, {"w": "steps:", "b": [0.2535, 0.331, 0.3062, 0.3491]}]}, {"id": "b_4", "type": "paragraph", "text": "1. Download CUDA. For Ubuntu (and other Linux flavors), NVIDIA provides a ready-to-use package that you can download from https://developer.nvidia.com/cuda-downloads:", "words": [{"w": "1.", "b": [0.1523, 0.3662, 0.1696, 0.3843]}, {"w": "Download", "b": [0.175, 0.3662, 0.2714, 0.3843]}, {"w": "CUDA.", "b": [0.2772, 0.3662, 0.3486, 0.3843]}, {"w": "For", "b": [0.3544, 0.3662, 0.3865, 0.3843]}, {"w": "Ubuntu", "b": [0.3923, 0.3662, 0.4617, 0.3843]}, {"w": "(and", "b": [0.4675, 0.3662, 0.5087, 0.3843]}, {"w": "other", "b": [0.5144, 0.3662, 0.562, 0.3843]}, {"w": "Linux", "b": [0.5678, 0.3662, 0.6231, 0.3843]}, {"w": "flavors),", "b": [0.6289, 0.3662, 0.7067, 0.3843]}, {"w": "NVIDIA", "b": [0.7124, 0.3662, 0.7947, 0.3843]}, {"w": "provides", "b": [0.175, 0.385, 0.2547, 0.4031]}, {"w": "a", "b": [0.2605, 0.385, 0.2708, 0.4031]}, {"w": "ready-to-use", "b": [0.2766, 0.385, 0.3923, 0.4031]}, {"w": "package", "b": [0.398, 0.385, 0.4739, 0.4031]}, {"w": "that", "b": [0.4797, 0.385, 0.5144, 0.4031]}, {"w": "you", "b": [0.5202, 0.385, 0.5549, 0.4031]}, {"w": "can", "b": [0.5607, 0.385, 0.5928, 0.4031]}, {"w": "download", "b": [0.5986, 0.385, 0.6899, 0.4031]}, {"w": "from", "b": [0.6957, 0.385, 0.7407, 0.4031]}, {"w": "https://developer.nvidia.com/cuda-downloads:", "b": [0.175, 0.4038, 0.6031, 0.4219]}]}, {"id": "b_5", "type": "equation", "text": "$ wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/", "words": [{"w": "$", "b": [0.1808, 0.4343, 0.1912, 0.4482]}, {"w": "wget", "b": [0.2016, 0.4343, 0.2433, 0.4482]}, {"w": "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/", "b": [0.1808, 0.4482, 0.8787, 0.4621]}]}, {"id": "b_6", "type": "equation", "text": "x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb", "words": [{"w": "x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb", "b": [0.2074, 0.4777, 0.697, 0.4916]}]}, {"id": "b_7", "type": "paragraph", "text": "2. Install CUDA. The easiest way to do so is to use Ubuntu’s apt on this package. This will allow you to easily install updates via apt as they become available:", "words": [{"w": "2.", "b": [0.1523, 0.5044, 0.1696, 0.5225]}, {"w": "Install", "b": [0.175, 0.5044, 0.2329, 0.5225]}, {"w": "CUDA.", "b": [0.2387, 0.5044, 0.31, 0.5225]}, {"w": "The", "b": [0.3158, 0.5044, 0.3518, 0.5225]}, {"w": "easiest", "b": [0.3576, 0.5044, 0.4193, 0.5225]}, {"w": "way", "b": [0.4251, 0.5044, 0.4636, 0.5225]}, {"w": "to", "b": [0.4694, 0.5044, 0.4874, 0.5225]}, {"w": "do", "b": [0.4932, 0.5044, 0.5164, 0.5225]}, {"w": "so", "b": [0.5222, 0.5044, 0.5427, 0.5225]}, {"w": "is", "b": [0.5485, 0.5044, 0.564, 0.5225]}, {"w": "to", "b": [0.5697, 0.5044, 0.5878, 0.5225]}, {"w": "use", "b": [0.5935, 0.5044, 0.6244, 0.5225]}, {"w": "Ubuntu’s", "b": [0.6302, 0.5044, 0.715, 0.5225]}, {"w": "apt", "b": [0.7208, 0.5054, 0.7625, 0.5239]}, {"w": "on", "b": [0.7683, 0.5044, 0.7914, 0.5225]}, {"w": "this", "b": [0.7972, 0.5044, 0.8306, 0.5225]}, {"w": "package.", "b": [0.175, 0.524, 0.2566, 0.5421]}, {"w": "This", "b": [0.2624, 0.524, 0.3036, 0.5421]}, {"w": "will", "b": [0.3094, 0.524, 0.3454, 0.5421]}, {"w": "allow", "b": [0.3512, 0.524, 0.4026, 0.5421]}, {"w": "you", "b": [0.4084, 0.524, 0.4431, 0.5421]}, {"w": "to", "b": [0.4489, 0.524, 0.4669, 0.5421]}, {"w": "easily", "b": [0.4727, 0.524, 0.5267, 0.5421]}, {"w": "install", "b": [0.5325, 0.524, 0.589, 0.5421]}, {"w": "updates", "b": [0.5948, 0.524, 0.6655, 0.5421]}, {"w": "via", "b": [0.6713, 0.524, 0.6996, 0.5421]}, {"w": "apt", "b": [0.7053, 0.525, 0.747, 0.5435]}, {"w": "as", "b": [0.7528, 0.524, 0.772, 0.5421]}, {"w": "they", "b": [0.7778, 0.524, 0.8177, 0.5421]}, {"w": "become", "b": [0.175, 0.5437, 0.247, 0.5618]}, {"w": "available:", "b": [0.2528, 0.5437, 0.3428, 0.5618]}]}, {"id": "b_8", "type": "paragraph", "text": "$ sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb $ sudo apt-key adv --fetch-keys", "words": [{"w": "$", "b": [0.1808, 0.5742, 0.1912, 0.5881]}, {"w": "sudo", "b": [0.2016, 0.5742, 0.2433, 0.5881]}, {"w": "dpkg", "b": [0.2537, 0.5742, 0.2954, 0.5881]}, {"w": "-i", "b": [0.3058, 0.5742, 0.3266, 0.5881]}, {"w": "cuda-repo-ubuntu1604_9.0.176-1_amd64.deb", "b": [0.337, 0.5742, 0.7537, 0.5881]}, {"w": "$", "b": [0.1808, 0.5881, 0.1912, 0.602]}, {"w": "sudo", "b": [0.2016, 0.5881, 0.2433, 0.602]}, {"w": "apt-key", "b": [0.2537, 0.5881, 0.3266, 0.602]}, {"w": "adv", "b": [0.337, 0.5881, 0.3683, 0.602]}, {"w": "--fetch-keys", "b": [0.3787, 0.5881, 0.5037, 0.602]}]}, {"id": "b_9", "type": "equation", "text": "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/", "words": [{"w": "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/", "b": [0.1808, 0.6134, 0.8787, 0.6273]}]}, {"id": "b_10", "type": "equation", "text": "x86_64/7fa2af80.pub $ sudo apt-get update $ sudo apt-get install cuda-8-0", "words": [{"w": "x86_64/7fa2af80.pub", "b": [0.2074, 0.6429, 0.4053, 0.6568]}, {"w": "$", "b": [0.1808, 0.6568, 0.1912, 0.6707]}, {"w": "sudo", "b": [0.2016, 0.6568, 0.2433, 0.6707]}, {"w": "apt-get", "b": [0.2537, 0.6568, 0.3266, 0.6707]}, {"w": "update", "b": [0.337, 0.6568, 0.3995, 0.6707]}, {"w": "$", "b": [0.1808, 0.6707, 0.1912, 0.6846]}, {"w": "sudo", "b": [0.2016, 0.6707, 0.2433, 0.6846]}, {"w": "apt-get", "b": [0.2537, 0.6707, 0.3266, 0.6846]}, {"w": "install", "b": [0.337, 0.6707, 0.4099, 0.6846]}, {"w": "cuda-8-0", "b": [0.4204, 0.6707, 0.5037, 0.6846]}]}, {"id": "b_11", "type": "paragraph", "text": "3. Install cuDNN:", "words": [{"w": "3.", "b": [0.1523, 0.6974, 0.1696, 0.7155]}, {"w": "Install", "b": [0.175, 0.6974, 0.2329, 0.7155]}, {"w": "cuDNN:", "b": [0.2387, 0.6974, 0.3171, 0.7155]}]}, {"id": "b_12", "type": "paragraph", "text": "1. Register for a free NVIDIA developer account (unfortunately, this is necessary in order to gain access to the cuDNN download), and download cuDNN at https://developer.NVIDIA.com/cudnn (select the version of cuDNN compatible with TensorFlow). Like CUDA, NVIDIA provides packages for different Linux flavors—we’ll use the version for Ubuntu 16.04. Note that if you’re working with an EC2 install, you won’t be able to download the cuDNN archive directly to your instance; instead, download it to your local machine and then upload it to your EC2 instance (via scp).", "words": [{"w": "1.", "b": [0.1986, 0.7326, 0.2159, 0.7507]}, {"w": "Register", "b": [0.2213, 0.7326, 0.2985, 0.7507]}, {"w": "for", "b": [0.3042, 0.7326, 0.3312, 0.7507]}, {"w": "a", "b": [0.337, 0.7326, 0.3473, 0.7507]}, {"w": "free", "b": [0.3531, 0.7326, 0.389, 0.7507]}, {"w": "NVIDIA", "b": [0.3948, 0.7326, 0.4771, 0.7507]}, {"w": "developer", "b": [0.4829, 0.7326, 0.5741, 0.7507]}, {"w": "account", "b": [0.5799, 0.7326, 0.6519, 0.7507]}, {"w": "(unfortunately,", "b": [0.6577, 0.7326, 0.7944, 0.7507]}, {"w": "this", "b": [0.8001, 0.7326, 0.8336, 0.7507]}, {"w": "is", "b": [0.8394, 0.7326, 0.8548, 0.7507]}, {"w": "necessary", "b": [0.2213, 0.7514, 0.3113, 0.7695]}, {"w": "in", "b": [0.3171, 0.7514, 0.3351, 0.7695]}, {"w": "order", "b": [0.3409, 0.7514, 0.3897, 0.7695]}, {"w": "to", "b": [0.3955, 0.7514, 0.4135, 0.7695]}, {"w": "gain", "b": [0.4193, 0.7514, 0.4591, 0.7695]}, {"w": "access", "b": [0.4649, 0.7514, 0.524, 0.7695]}, {"w": "to", "b": [0.5298, 0.7514, 0.5478, 0.7695]}, {"w": "the", "b": [0.5536, 0.7514, 0.5819, 0.7695]}, {"w": "cuDNN", "b": [0.5877, 0.7514, 0.6597, 0.7695]}, {"w": "download),", "b": [0.6655, 0.7514, 0.7702, 0.7695]}, {"w": "and", "b": [0.776, 0.7514, 0.8094, 0.7695]}, {"w": "download", "b": [0.2213, 0.7702, 0.3126, 0.7883]}, {"w": "cuDNN", "b": [0.3184, 0.7702, 0.3904, 0.7883]}, {"w": "at", "b": [0.3961, 0.7702, 0.4129, 0.7883]}, {"w": "https://developer.NVIDIA.com/cudnn", "b": [0.4186, 0.7702, 0.7696, 0.7883]}, {"w": "(select", "b": [0.7754, 0.7702, 0.8358, 0.7883]}, {"w": "the", "b": [0.8416, 0.7702, 0.8699, 0.7883]}, {"w": "version", "b": [0.2213, 0.789, 0.2894, 0.8071]}, {"w": "of", "b": [0.2952, 0.789, 0.3145, 0.8071]}, {"w": "cuDNN", "b": [0.3203, 0.789, 0.3923, 0.8071]}, {"w": "compatible", "b": [0.3981, 0.789, 0.5009, 0.8071]}, {"w": "with", "b": [0.5067, 0.789, 0.5479, 0.8071]}, {"w": "TensorFlow).", "b": [0.5537, 0.789, 0.6774, 0.8071]}, {"w": "Like", "b": [0.6832, 0.789, 0.7256, 0.8071]}, {"w": "CUDA,", "b": [0.7314, 0.789, 0.8027, 0.8071]}, {"w": "NVIDIA", "b": [0.2213, 0.8078, 0.3036, 0.8259]}, {"w": "provides", "b": [0.3094, 0.8078, 0.3891, 0.8259]}, {"w": "packages", "b": [0.3949, 0.8078, 0.4797, 0.8259]}, {"w": "for", "b": [0.4855, 0.8078, 0.5125, 0.8259]}, {"w": "different", "b": [0.5182, 0.8078, 0.5975, 0.8259]}, {"w": "Linux", "b": [0.6033, 0.8078, 0.6586, 0.8259]}, {"w": "flavors—we’ll", "b": [0.6644, 0.8078, 0.7994, 0.8259]}, {"w": "use", "b": [0.8051, 0.8078, 0.836, 0.8259]}, {"w": "the", "b": [0.8418, 0.8078, 0.8701, 0.8259]}, {"w": "version", "b": [0.2213, 0.8266, 0.2894, 0.8447]}, {"w": "for", "b": [0.2952, 0.8266, 0.3222, 0.8447]}, {"w": "Ubuntu", "b": [0.328, 0.8266, 0.3974, 0.8447]}, {"w": "16.04.", "b": [0.4032, 0.8266, 0.4611, 0.8447]}, {"w": "Note", "b": [0.4669, 0.8266, 0.5119, 0.8447]}, {"w": "that", "b": [0.5177, 0.8266, 0.5524, 0.8447]}, {"w": "if", "b": [0.5582, 0.8266, 0.5723, 0.8447]}, {"w": "you’re", "b": [0.5781, 0.8266, 0.6385, 0.8447]}, {"w": "working", "b": [0.6443, 0.8266, 0.7214, 0.8447]}, {"w": "with", "b": [0.7272, 0.8266, 0.7684, 0.8447]}, {"w": "an", "b": [0.7742, 0.8266, 0.796, 0.8447]}, {"w": "EC2", "b": [0.8018, 0.8266, 0.843, 0.8447]}, {"w": "install,", "b": [0.2213, 0.8454, 0.2837, 0.8635]}, {"w": "you", "b": [0.2895, 0.8454, 0.3242, 0.8635]}, {"w": "won’t", "b": [0.33, 0.8454, 0.3835, 0.8635]}, {"w": "be", "b": [0.3893, 0.8454, 0.4112, 0.8635]}, {"w": "able", "b": [0.417, 0.8454, 0.4555, 0.8635]}, {"w": "to", "b": [0.4613, 0.8454, 0.4793, 0.8635]}, {"w": "download", "b": [0.4851, 0.8454, 0.5764, 0.8635]}, {"w": "the", "b": [0.5822, 0.8454, 0.6105, 0.8635]}, {"w": "cuDNN", "b": [0.6163, 0.8454, 0.6882, 0.8635]}, {"w": "archive", "b": [0.694, 0.8454, 0.7621, 0.8635]}, {"w": "directly", "b": [0.7679, 0.8454, 0.8386, 0.8635]}, {"w": "to", "b": [0.8444, 0.8454, 0.8624, 0.8635]}, {"w": "your", "b": [0.2213, 0.8642, 0.2637, 0.8824]}, {"w": "instance;", "b": [0.2695, 0.8642, 0.3518, 0.8824]}, {"w": "instead,", "b": [0.3576, 0.8642, 0.4289, 0.8824]}, {"w": "download", "b": [0.4347, 0.8642, 0.526, 0.8824]}, {"w": "it", "b": [0.5318, 0.8642, 0.5447, 0.8824]}, {"w": "to", "b": [0.5505, 0.8642, 0.5685, 0.8824]}, {"w": "your", "b": [0.5743, 0.8642, 0.6167, 0.8824]}, {"w": "local", "b": [0.6225, 0.8642, 0.6675, 0.8824]}, {"w": "machine", "b": [0.6733, 0.8642, 0.7517, 0.8824]}, {"w": "and", "b": [0.7575, 0.8642, 0.7909, 0.8824]}, {"w": "then", "b": [0.7967, 0.8642, 0.8365, 0.8824]}, {"w": "upload", "b": [0.2213, 0.8831, 0.2843, 0.9012]}, {"w": "it", "b": [0.2901, 0.8831, 0.303, 0.9012]}, {"w": "to", "b": [0.3088, 0.8831, 0.3268, 0.9012]}, {"w": "your", "b": [0.3325, 0.8831, 0.375, 0.9012]}, {"w": "EC2", "b": [0.3808, 0.8831, 0.4219, 0.9012]}, {"w": "instance", "b": [0.4277, 0.8831, 0.5035, 0.9012]}, {"w": "(via", "b": [0.5093, 0.8831, 0.5453, 0.9012]}, {"w": "scp).", "b": [0.5511, 0.8831, 0.6062, 0.9025]}]}]}, {"page": 443, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "2. Install cuDNN:", "words": [{"w": "2.", "b": [0.1986, 0.0857, 0.2159, 0.1038]}, {"w": "Install", "b": [0.2213, 0.0857, 0.2792, 0.1038]}, {"w": "cuDNN:", "b": [0.285, 0.0857, 0.3634, 0.1038]}]}, {"id": "b_1", "type": "equation", "text": "$ sudo dpkg -i dpkg -i libcudnn6*.deb", "words": [{"w": "$", "b": [0.2271, 0.1162, 0.2375, 0.1301]}, {"w": "sudo", "b": [0.2479, 0.1162, 0.2896, 0.1301]}, {"w": "dpkg", "b": [0.3, 0.1162, 0.3417, 0.1301]}, {"w": "-i", "b": [0.3521, 0.1162, 0.3729, 0.1301]}, {"w": "dpkg", "b": [0.3833, 0.1162, 0.425, 0.1301]}, {"w": "-i", "b": [0.4354, 0.1162, 0.4562, 0.1301]}, {"w": "libcudnn6*.deb", "b": [0.4667, 0.1162, 0.6125, 0.1301]}]}, {"id": "b_2", "type": "paragraph", "text": "4. Install TensorFlow:", "words": [{"w": "4.", "b": [0.1523, 0.1429, 0.1696, 0.161]}, {"w": "Install", "b": [0.175, 0.1429, 0.2329, 0.161]}, {"w": "TensorFlow:", "b": [0.2387, 0.1429, 0.3553, 0.161]}]}, {"id": "b_3", "type": "paragraph", "text": "1. TensorFlow with or without GPU support can be installed from PyPI using Pip. Here’s the command without GPU support:", "words": [{"w": "1.", "b": [0.1986, 0.1781, 0.2159, 0.1962]}, {"w": "TensorFlow", "b": [0.2213, 0.1781, 0.3315, 0.1962]}, {"w": "with", "b": [0.3373, 0.1781, 0.3785, 0.1962]}, {"w": "or", "b": [0.3843, 0.1781, 0.4036, 0.1962]}, {"w": "without", "b": [0.4093, 0.1781, 0.4801, 0.1962]}, {"w": "GPU", "b": [0.4859, 0.1781, 0.5322, 0.1962]}, {"w": "support", "b": [0.5379, 0.1781, 0.6074, 0.1962]}, {"w": "can", "b": [0.6132, 0.1781, 0.6453, 0.1962]}, {"w": "be", "b": [0.6511, 0.1781, 0.6729, 0.1962]}, {"w": "installed", "b": [0.6787, 0.1781, 0.7572, 0.1962]}, {"w": "from", "b": [0.7629, 0.1781, 0.8079, 0.1962]}, {"w": "PyPI", "b": [0.8137, 0.1781, 0.8587, 0.1962]}, {"w": "using", "b": [0.2213, 0.1969, 0.2715, 0.215]}, {"w": "Pip.", "b": [0.2772, 0.1969, 0.3139, 0.215]}, {"w": "Here’s", "b": [0.3197, 0.1969, 0.3801, 0.215]}, {"w": "the", "b": [0.3859, 0.1969, 0.4142, 0.215]}, {"w": "command", "b": [0.42, 0.1969, 0.5112, 0.215]}, {"w": "without", "b": [0.517, 0.1969, 0.5878, 0.215]}, {"w": "GPU", "b": [0.5936, 0.1969, 0.6398, 0.215]}, {"w": "support:", "b": [0.6456, 0.1969, 0.7215, 0.215]}]}, {"id": "b_4", "type": "paragraph", "text": "$ sudo pip install tensorflow", "words": [{"w": "$", "b": [0.2271, 0.2274, 0.2375, 0.2413]}, {"w": "sudo", "b": [0.2479, 0.2274, 0.2896, 0.2413]}, {"w": "pip", "b": [0.3, 0.2274, 0.3312, 0.2413]}, {"w": "install", "b": [0.3417, 0.2274, 0.4146, 0.2413]}, {"w": "tensorflow", "b": [0.425, 0.2274, 0.5291, 0.2413]}]}, {"id": "b_5", "type": "paragraph", "text": "2. Here’s the command to install TensorFlow with GPU support:", "words": [{"w": "2.", "b": [0.1986, 0.2541, 0.2159, 0.2723]}, {"w": "Here’s", "b": [0.2213, 0.2541, 0.2817, 0.2723]}, {"w": "the", "b": [0.2875, 0.2541, 0.3158, 0.2723]}, {"w": "command", "b": [0.3216, 0.2541, 0.4129, 0.2723]}, {"w": "to", "b": [0.4186, 0.2541, 0.4366, 0.2723]}, {"w": "install", "b": [0.4424, 0.2541, 0.499, 0.2723]}, {"w": "TensorFlow", "b": [0.5048, 0.2541, 0.615, 0.2723]}, {"w": "with", "b": [0.6208, 0.2541, 0.662, 0.2723]}, {"w": "GPU", "b": [0.6677, 0.2541, 0.714, 0.2723]}, {"w": "support:", "b": [0.7198, 0.2541, 0.7957, 0.2723]}]}, {"id": "b_6", "type": "equation", "text": "$ sudo pip install tensorflow-gpu", "words": [{"w": "$", "b": [0.2271, 0.2847, 0.2375, 0.2986]}, {"w": "sudo", "b": [0.2479, 0.2847, 0.2896, 0.2986]}, {"w": "pip", "b": [0.3, 0.2847, 0.3312, 0.2986]}, {"w": "install", "b": [0.3417, 0.2847, 0.4146, 0.2986]}, {"w": "tensorflow-gpu", "b": [0.425, 0.2847, 0.5708, 0.2986]}]}, {"id": "b_7", "type": "paragraph", "text": "A.3. Installing Theano (optional)", "words": [{"w": "A.3.", "b": [0.1287, 0.3325, 0.1736, 0.3528]}, {"w": "Installing", "b": [0.1801, 0.3325, 0.2857, 0.3528]}, {"w": "Theano", "b": [0.2922, 0.3325, 0.3761, 0.3528]}, {"w": "(optional)", "b": [0.3827, 0.3325, 0.4912, 0.3528]}]}, {"id": "b_8", "type": "paragraph", "text": "Because you’ve already installed TensorFlow, you don’t have to install Theano in order to run Keras code. But it can sometimes be useful to switch back and forth from Tensor-Flow to Theano when building Keras models.", "words": [{"w": "Because", "b": [0.1287, 0.3744, 0.2058, 0.3925]}, {"w": "you’ve", "b": [0.2116, 0.3744, 0.2759, 0.3925]}, {"w": "already", "b": [0.2817, 0.3744, 0.3498, 0.3925]}, {"w": "installed", "b": [0.3556, 0.3744, 0.434, 0.3925]}, {"w": "TensorFlow,", "b": [0.4398, 0.3744, 0.5543, 0.3925]}, {"w": "you", "b": [0.5601, 0.3744, 0.5948, 0.3925]}, {"w": "don’t", "b": [0.6006, 0.3744, 0.649, 0.3925]}, {"w": "have", "b": [0.6548, 0.3744, 0.6985, 0.3925]}, {"w": "to", "b": [0.7043, 0.3744, 0.7223, 0.3925]}, {"w": "install", "b": [0.7281, 0.3744, 0.7847, 0.3925]}, {"w": "Theano", "b": [0.7905, 0.3744, 0.8599, 0.3925]}, {"w": "in", "b": [0.1287, 0.3932, 0.1467, 0.4113]}, {"w": "order", "b": [0.1525, 0.3932, 0.2014, 0.4113]}, {"w": "to", "b": [0.2071, 0.3932, 0.2251, 0.4113]}, {"w": "run", "b": [0.2309, 0.3932, 0.2618, 0.4113]}, {"w": "Keras", "b": [0.2676, 0.3932, 0.3215, 0.4113]}, {"w": "code.", "b": [0.3273, 0.3932, 0.3768, 0.4113]}, {"w": "But", "b": [0.3826, 0.3932, 0.4161, 0.4113]}, {"w": "it", "b": [0.4218, 0.3932, 0.4347, 0.4113]}, {"w": "can", "b": [0.4405, 0.3932, 0.4726, 0.4113]}, {"w": "sometimes", "b": [0.4784, 0.3932, 0.5774, 0.4113]}, {"w": "be", "b": [0.5832, 0.3932, 0.605, 0.4113]}, {"w": "useful", "b": [0.6108, 0.3932, 0.6674, 0.4113]}, {"w": "to", "b": [0.6732, 0.3932, 0.6912, 0.4113]}, {"w": "switch", "b": [0.6969, 0.3932, 0.7574, 0.4113]}, {"w": "back", "b": [0.7632, 0.3932, 0.8069, 0.4113]}, {"w": "and", "b": [0.8127, 0.3932, 0.8461, 0.4113]}, {"w": "forth", "b": [0.1287, 0.412, 0.1737, 0.4301]}, {"w": "from", "b": [0.1795, 0.412, 0.2245, 0.4301]}, {"w": "Tensor-Flow", "b": [0.2303, 0.412, 0.3478, 0.4301]}, {"w": "to", "b": [0.3536, 0.412, 0.3716, 0.4301]}, {"w": "Theano", "b": [0.3773, 0.412, 0.4468, 0.4301]}, {"w": "when", "b": [0.4525, 0.412, 0.5027, 0.4301]}, {"w": "building", "b": [0.5085, 0.412, 0.5856, 0.4301]}, {"w": "Keras", "b": [0.5914, 0.412, 0.6454, 0.4301]}, {"w": "models.", "b": [0.6512, 0.412, 0.7238, 0.4301]}]}, {"id": "b_9", "type": "paragraph", "text": "Theano can also be installed from PyPI:", "words": [{"w": "Theano", "b": [0.1287, 0.4512, 0.1981, 0.4693]}, {"w": "can", "b": [0.2039, 0.4512, 0.236, 0.4693]}, {"w": "also", "b": [0.2418, 0.4512, 0.2791, 0.4693]}, {"w": "be", "b": [0.2849, 0.4512, 0.3068, 0.4693]}, {"w": "installed", "b": [0.3125, 0.4512, 0.391, 0.4693]}, {"w": "from", "b": [0.3968, 0.4512, 0.4418, 0.4693]}, {"w": "PyPI:", "b": [0.4476, 0.4512, 0.499, 0.4693]}]}, {"id": "b_10", "type": "paragraph", "text": "$ sudo pip install theano", "words": [{"w": "$", "b": [0.1345, 0.4859, 0.1449, 0.4998]}, {"w": "sudo", "b": [0.1553, 0.4859, 0.197, 0.4998]}, {"w": "pip", "b": [0.2074, 0.4859, 0.2387, 0.4998]}, {"w": "install", "b": [0.2491, 0.4859, 0.322, 0.4998]}, {"w": "theano", "b": [0.3324, 0.4859, 0.3949, 0.4998]}]}, {"id": "b_11", "type": "paragraph", "text": "If you’re using a GPU, then you should configure Theano to use your GPU. You can create a Theano configuration file with this command:", "words": [{"w": "If", "b": [0.1287, 0.5208, 0.1441, 0.5389]}, {"w": "you’re", "b": [0.1499, 0.5208, 0.2103, 0.5389]}, {"w": "using", "b": [0.2161, 0.5208, 0.2663, 0.5389]}, {"w": "a", "b": [0.2721, 0.5208, 0.2823, 0.5389]}, {"w": "GPU,", "b": [0.2881, 0.5208, 0.3402, 0.5389]}, {"w": "then", "b": [0.346, 0.5208, 0.3858, 0.5389]}, {"w": "you", "b": [0.3916, 0.5208, 0.4264, 0.5389]}, {"w": "should", "b": [0.4321, 0.5208, 0.4939, 0.5389]}, {"w": "configure", "b": [0.4997, 0.5208, 0.5884, 0.5389]}, {"w": "Theano", "b": [0.5941, 0.5208, 0.6636, 0.5389]}, {"w": "to", "b": [0.6693, 0.5208, 0.6874, 0.5389]}, {"w": "use", "b": [0.6931, 0.5208, 0.724, 0.5389]}, {"w": "your", "b": [0.7298, 0.5208, 0.7722, 0.5389]}, {"w": "GPU.", "b": [0.778, 0.5208, 0.8301, 0.5389]}, {"w": "You", "b": [0.1287, 0.5396, 0.1663, 0.5577]}, {"w": "can", "b": [0.1721, 0.5396, 0.2042, 0.5577]}, {"w": "create", "b": [0.21, 0.5396, 0.2652, 0.5577]}, {"w": "a", "b": [0.271, 0.5396, 0.2813, 0.5577]}, {"w": "Theano", "b": [0.2871, 0.5396, 0.3565, 0.5577]}, {"w": "configuration", "b": [0.3623, 0.5396, 0.487, 0.5577]}, {"w": "file", "b": [0.4928, 0.5396, 0.5236, 0.5577]}, {"w": "with", "b": [0.5294, 0.5396, 0.5706, 0.5577]}, {"w": "this", "b": [0.5763, 0.5396, 0.6098, 0.5577]}, {"w": "command:", "b": [0.6155, 0.5396, 0.7132, 0.5577]}]}, {"id": "b_12", "type": "equation", "text": "nano ~/.theanorc", "words": [{"w": "nano", "b": [0.1345, 0.5742, 0.1762, 0.5881]}, {"w": "~/.theanorc", "b": [0.1866, 0.5742, 0.3012, 0.5881]}]}, {"id": "b_13", "type": "paragraph", "text": "Then, fill in the file with the following configuration:", "words": [{"w": "Then,", "b": [0.1287, 0.6091, 0.1821, 0.6272]}, {"w": "fill", "b": [0.1879, 0.6091, 0.2149, 0.6272]}, {"w": "in", "b": [0.2207, 0.6091, 0.2387, 0.6272]}, {"w": "the", "b": [0.2445, 0.6091, 0.2727, 0.6272]}, {"w": "file", "b": [0.2785, 0.6091, 0.3094, 0.6272]}, {"w": "with", "b": [0.3152, 0.6091, 0.3563, 0.6272]}, {"w": "the", "b": [0.3621, 0.6091, 0.3904, 0.6272]}, {"w": "following", "b": [0.3962, 0.6091, 0.4862, 0.6272]}, {"w": "configuration:", "b": [0.492, 0.6091, 0.6231, 0.6272]}]}, {"id": "b_14", "type": "equation", "text": "[global] floatX = float32 device = gpu0 [nvcc] fastmath = True", "words": [{"w": "[global]", "b": [0.1345, 0.6437, 0.2178, 0.6576]}, {"w": "floatX", "b": [0.1345, 0.6576, 0.197, 0.6715]}, {"w": "=", "b": [0.2074, 0.6576, 0.2178, 0.6715]}, {"w": "float32", "b": [0.2282, 0.6576, 0.3012, 0.6715]}, {"w": "device", "b": [0.1345, 0.6715, 0.197, 0.6854]}, {"w": "=", "b": [0.2074, 0.6715, 0.2178, 0.6854]}, {"w": "gpu0", "b": [0.2282, 0.6715, 0.2699, 0.6854]}, {"w": "[nvcc]", "b": [0.1345, 0.6993, 0.197, 0.7132]}, {"w": "fastmath", "b": [0.1345, 0.7132, 0.2178, 0.7271]}, {"w": "=", "b": [0.2282, 0.7132, 0.2387, 0.7271]}, {"w": "True", "b": [0.2491, 0.7132, 0.2907, 0.7271]}]}, {"id": "b_15", "type": "paragraph", "text": "A.4. Installing Keras", "words": [{"w": "A.4.", "b": [0.1287, 0.761, 0.1736, 0.7814]}, {"w": "Installing", "b": [0.1801, 0.761, 0.2857, 0.7814]}, {"w": "Keras", "b": [0.2922, 0.761, 0.3588, 0.7814]}]}, {"id": "b_16", "type": "paragraph", "text": "You can install Keras from PyPI:", "words": [{"w": "You", "b": [0.1287, 0.8029, 0.1663, 0.821]}, {"w": "can", "b": [0.1721, 0.8029, 0.2042, 0.821]}, {"w": "install", "b": [0.21, 0.8029, 0.2666, 0.821]}, {"w": "Keras", "b": [0.2723, 0.8029, 0.3263, 0.821]}, {"w": "from", "b": [0.3321, 0.8029, 0.3771, 0.821]}, {"w": "PyPI:", "b": [0.3829, 0.8029, 0.4343, 0.821]}]}, {"id": "b_17", "type": "paragraph", "text": "$ sudo pip install keras", "words": [{"w": "$", "b": [0.1345, 0.8375, 0.1449, 0.8514]}, {"w": "sudo", "b": [0.1553, 0.8375, 0.197, 0.8514]}, {"w": "pip", "b": [0.2074, 0.8375, 0.2387, 0.8514]}, {"w": "install", "b": [0.2491, 0.8375, 0.322, 0.8514]}, {"w": "keras", "b": [0.3324, 0.8375, 0.3845, 0.8514]}]}, {"id": "b_18", "type": "paragraph", "text": "Alternatively, you can install Keras from GitHub. Doing so will allow you to access the keras/examples folder, which contains many example scripts for you", "words": [{"w": "Alternatively,", "b": [0.1287, 0.8724, 0.2551, 0.8905]}, {"w": "you", "b": [0.2609, 0.8724, 0.2956, 0.8905]}, {"w": "can", "b": [0.3014, 0.8724, 0.3335, 0.8905]}, {"w": "install", "b": [0.3393, 0.8724, 0.3959, 0.8905]}, {"w": "Keras", "b": [0.4017, 0.8724, 0.4557, 0.8905]}, {"w": "from", "b": [0.4615, 0.8724, 0.5065, 0.8905]}, {"w": "GitHub.", "b": [0.5122, 0.8724, 0.5875, 0.8905]}, {"w": "Doing", "b": [0.5933, 0.8724, 0.6511, 0.8905]}, {"w": "so", "b": [0.6569, 0.8724, 0.6775, 0.8905]}, {"w": "will", "b": [0.6833, 0.8724, 0.7193, 0.8905]}, {"w": "allow", "b": [0.7251, 0.8724, 0.7765, 0.8905]}, {"w": "you", "b": [0.7823, 0.8724, 0.817, 0.8905]}, {"w": "to", "b": [0.8228, 0.8724, 0.8408, 0.8905]}, {"w": "access", "b": [0.1287, 0.8912, 0.1878, 0.9093]}, {"w": "the", "b": [0.1936, 0.8912, 0.2219, 0.9093]}, {"w": "keras/examples", "b": [0.2277, 0.8912, 0.3704, 0.9093]}, {"w": "folder,", "b": [0.3762, 0.8912, 0.4363, 0.9093]}, {"w": "which", "b": [0.4421, 0.8912, 0.4986, 0.9093]}, {"w": "contains", "b": [0.5044, 0.8912, 0.5816, 0.9093]}, {"w": "many", "b": [0.5873, 0.8912, 0.6388, 0.9093]}, {"w": "example", "b": [0.6445, 0.8912, 0.723, 0.9093]}, {"w": "scripts", "b": [0.7287, 0.8912, 0.7892, 0.9093]}, {"w": "for", "b": [0.795, 0.8912, 0.822, 0.9093]}, {"w": "you", "b": [0.8277, 0.8912, 0.8625, 0.9093]}]}]}, {"page": 444, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "to learn from:", "words": [{"w": "to", "b": [0.1287, 0.0857, 0.1467, 0.1038]}, {"w": "learn", "b": [0.1525, 0.0857, 0.1988, 0.1038]}, {"w": "from:", "b": [0.2046, 0.0857, 0.256, 0.1038]}]}, {"id": "b_1", "type": "paragraph", "text": "$ git clone https://github.com/fchollet/keras $ cd keras $ sudo python setup.py install", "words": [{"w": "$", "b": [0.1345, 0.1203, 0.1449, 0.1342]}, {"w": "git", "b": [0.1553, 0.1203, 0.1866, 0.1342]}, {"w": "clone", "b": [0.197, 0.1203, 0.2491, 0.1342]}, {"w": "https://github.com/fchollet/keras", "b": [0.2595, 0.1203, 0.6032, 0.1342]}, {"w": "$", "b": [0.1345, 0.1342, 0.1449, 0.1481]}, {"w": "cd", "b": [0.1553, 0.1342, 0.1762, 0.1481]}, {"w": "keras", "b": [0.1866, 0.1342, 0.2387, 0.1481]}, {"w": "$", "b": [0.1345, 0.1481, 0.1449, 0.162]}, {"w": "sudo", "b": [0.1553, 0.1481, 0.197, 0.162]}, {"w": "python", "b": [0.2074, 0.1481, 0.2699, 0.162]}, {"w": "setup.py", "b": [0.2803, 0.1481, 0.3637, 0.162]}, {"w": "install", "b": [0.3741, 0.1481, 0.447, 0.162]}]}, {"id": "b_2", "type": "paragraph", "text": "You can now try to run a Keras script, such as this MNIST example:", "words": [{"w": "You", "b": [0.1287, 0.183, 0.1663, 0.2011]}, {"w": "can", "b": [0.1721, 0.183, 0.2042, 0.2011]}, {"w": "now", "b": [0.21, 0.183, 0.2498, 0.2011]}, {"w": "try", "b": [0.2556, 0.183, 0.2813, 0.2011]}, {"w": "to", "b": [0.2871, 0.183, 0.3051, 0.2011]}, {"w": "run", "b": [0.3109, 0.183, 0.3418, 0.2011]}, {"w": "a", "b": [0.3475, 0.183, 0.3578, 0.2011]}, {"w": "Keras", "b": [0.3636, 0.183, 0.4176, 0.2011]}, {"w": "script,", "b": [0.4234, 0.183, 0.4806, 0.2011]}, {"w": "such", "b": [0.4864, 0.183, 0.5288, 0.2011]}, {"w": "as", "b": [0.5346, 0.183, 0.5539, 0.2011]}, {"w": "this", "b": [0.5597, 0.183, 0.5931, 0.2011]}, {"w": "MNIST", "b": [0.5989, 0.183, 0.6709, 0.2011]}, {"w": "example:", "b": [0.6767, 0.183, 0.7615, 0.2011]}]}, {"id": "b_3", "type": "equation", "text": "python examples/mnist_cnn.py", "words": [{"w": "python", "b": [0.1345, 0.2176, 0.197, 0.2315]}, {"w": "examples/mnist_cnn.py", "b": [0.2074, 0.2176, 0.4261, 0.2315]}]}, {"id": "b_4", "type": "paragraph", "text": "Note that running this example to completion may take a few minutes, so feel free to force-quit it (Ctrl-C) once you’ve verified that it’s working normally.", "words": [{"w": "Note", "b": [0.1287, 0.2525, 0.1737, 0.2706]}, {"w": "that", "b": [0.1795, 0.2525, 0.2142, 0.2706]}, {"w": "running", "b": [0.22, 0.2525, 0.292, 0.2706]}, {"w": "this", "b": [0.2978, 0.2525, 0.3312, 0.2706]}, {"w": "example", "b": [0.337, 0.2525, 0.4155, 0.2706]}, {"w": "to", "b": [0.4212, 0.2525, 0.4392, 0.2706]}, {"w": "completion", "b": [0.445, 0.2525, 0.5492, 0.2706]}, {"w": "may", "b": [0.555, 0.2525, 0.5948, 0.2706]}, {"w": "take", "b": [0.6006, 0.2525, 0.6392, 0.2706]}, {"w": "a", "b": [0.645, 0.2525, 0.6552, 0.2706]}, {"w": "few", "b": [0.661, 0.2525, 0.6957, 0.2706]}, {"w": "minutes,", "b": [0.7015, 0.2525, 0.7806, 0.2706]}, {"w": "so", "b": [0.7864, 0.2525, 0.807, 0.2706]}, {"w": "feel", "b": [0.8128, 0.2525, 0.8475, 0.2706]}, {"w": "free", "b": [0.1287, 0.2713, 0.1647, 0.2894]}, {"w": "to", "b": [0.1705, 0.2713, 0.1885, 0.2894]}, {"w": "force-quit", "b": [0.1943, 0.2713, 0.2855, 0.2894]}, {"w": "it", "b": [0.2913, 0.2713, 0.3042, 0.2894]}, {"w": "(Ctrl-C)", "b": [0.31, 0.2713, 0.3846, 0.2894]}, {"w": "once", "b": [0.3903, 0.2713, 0.434, 0.2894]}, {"w": "you’ve", "b": [0.4398, 0.2713, 0.5041, 0.2894]}, {"w": "verified", "b": [0.5099, 0.2713, 0.5819, 0.2894]}, {"w": "that", "b": [0.5876, 0.2713, 0.6223, 0.2894]}, {"w": "it’s", "b": [0.6281, 0.2713, 0.6564, 0.2894]}, {"w": "working", "b": [0.6622, 0.2713, 0.7393, 0.2894]}, {"w": "normally.", "b": [0.7451, 0.2713, 0.833, 0.2894]}]}, {"id": "b_5", "type": "paragraph", "text": "After you’ve run Keras at least once, the Keras configuration file can be found at ~/.keras/keras.json. You can edit it to select the backend that Keras runs on: tensorflow, theano, or cntk. Your configuration file should like this:", "words": [{"w": "After", "b": [0.1287, 0.3106, 0.1776, 0.3287]}, {"w": "you’ve", "b": [0.1833, 0.3106, 0.2476, 0.3287]}, {"w": "run", "b": [0.2534, 0.3106, 0.2843, 0.3287]}, {"w": "Keras", "b": [0.29, 0.3106, 0.344, 0.3287]}, {"w": "at", "b": [0.3498, 0.3106, 0.3665, 0.3287]}, {"w": "least", "b": [0.3723, 0.3106, 0.4147, 0.3287]}, {"w": "once,", "b": [0.4205, 0.3106, 0.47, 0.3287]}, {"w": "the", "b": [0.4758, 0.3106, 0.5041, 0.3287]}, {"w": "Keras", "b": [0.5099, 0.3106, 0.5638, 0.3287]}, {"w": "configuration", "b": [0.5696, 0.3106, 0.6943, 0.3287]}, {"w": "file", "b": [0.7001, 0.3106, 0.731, 0.3287]}, {"w": "can", "b": [0.7368, 0.3106, 0.7689, 0.3287]}, {"w": "be", "b": [0.7747, 0.3106, 0.7965, 0.3287]}, {"w": "found", "b": [0.8023, 0.3106, 0.8563, 0.3287]}, {"w": "at", "b": [0.1287, 0.3294, 0.1454, 0.3475]}, {"w": "~/.keras/keras.json.", "b": [0.1512, 0.3294, 0.3302, 0.3475]}, {"w": "You", "b": [0.336, 0.3294, 0.3735, 0.3475]}, {"w": "can", "b": [0.3793, 0.3294, 0.4115, 0.3475]}, {"w": "edit", "b": [0.4172, 0.3294, 0.452, 0.3475]}, {"w": "it", "b": [0.4577, 0.3294, 0.4706, 0.3475]}, {"w": "to", "b": [0.4764, 0.3294, 0.4944, 0.3475]}, {"w": "select", "b": [0.5002, 0.3294, 0.5529, 0.3475]}, {"w": "the", "b": [0.5587, 0.3294, 0.5869, 0.3475]}, {"w": "backend", "b": [0.5927, 0.3294, 0.6698, 0.3475]}, {"w": "that", "b": [0.6756, 0.3294, 0.7103, 0.3475]}, {"w": "Keras", "b": [0.7161, 0.3294, 0.7701, 0.3475]}, {"w": "runs", "b": [0.7759, 0.3294, 0.8158, 0.3475]}, {"w": "on:", "b": [0.8215, 0.3294, 0.8511, 0.3475]}, {"w": "tensorflow,", "b": [0.1287, 0.3482, 0.2734, 0.3677]}, {"w": "theano,", "b": [0.2792, 0.3482, 0.3683, 0.3677]}, {"w": "or", "b": [0.3741, 0.3482, 0.3934, 0.3663]}, {"w": "cntk.", "b": [0.3991, 0.3482, 0.4605, 0.3677]}, {"w": "Your", "b": [0.4663, 0.3482, 0.5115, 0.3663]}, {"w": "configuration", "b": [0.5173, 0.3482, 0.642, 0.3663]}, {"w": "file", "b": [0.6478, 0.3482, 0.6787, 0.3663]}, {"w": "should", "b": [0.6844, 0.3482, 0.7462, 0.3663]}, {"w": "like", "b": [0.752, 0.3482, 0.7867, 0.3663]}, {"w": "this:", "b": [0.7925, 0.3482, 0.8324, 0.3663]}]}, {"id": "b_6", "type": "paragraph", "text": "{ \"image_data_format\": \"channels_last\", \"epsilon\": 1e-07, \"floatx\": \"float32\", \"backend\": \"tensorflow\" }", "words": [{"w": "{", "b": [0.1345, 0.3836, 0.1449, 0.3975]}, {"w": "\"image_data_format\":", "b": [0.1762, 0.3975, 0.3845, 0.4114]}, {"w": "\"channels_last\",", "b": [0.3949, 0.3975, 0.5616, 0.4114]}, {"w": "\"epsilon\":", "b": [0.1762, 0.4114, 0.2803, 0.4253]}, {"w": "1e-07,", "b": [0.2907, 0.4114, 0.3532, 0.4253]}, {"w": "\"floatx\":", "b": [0.1762, 0.4253, 0.2699, 0.4392]}, {"w": "\"float32\",", "b": [0.2803, 0.4253, 0.3845, 0.4392]}, {"w": "\"backend\":", "b": [0.1762, 0.4392, 0.2803, 0.4531]}, {"w": "\"tensorflow\"", "b": [0.2907, 0.4392, 0.4157, 0.4531]}, {"w": "}", "b": [0.1345, 0.4531, 0.1449, 0.467]}]}, {"id": "b_7", "type": "paragraph", "text": "While the Keras script examples/mnist_cnn.py is running, you can monitor GPU utilization in a different shell window:", "words": [{"w": "While", "b": [0.1287, 0.488, 0.1853, 0.5062]}, {"w": "the", "b": [0.1911, 0.488, 0.2194, 0.5062]}, {"w": "Keras", "b": [0.2251, 0.488, 0.2791, 0.5062]}, {"w": "script", "b": [0.2849, 0.488, 0.3363, 0.5062]}, {"w": "examples/mnist_cnn.py", "b": [0.3421, 0.488, 0.5614, 0.5062]}, {"w": "is", "b": [0.5672, 0.488, 0.5826, 0.5062]}, {"w": "running,", "b": [0.5884, 0.488, 0.6662, 0.5062]}, {"w": "you", "b": [0.672, 0.488, 0.7067, 0.5062]}, {"w": "can", "b": [0.7125, 0.488, 0.7446, 0.5062]}, {"w": "monitor", "b": [0.7504, 0.488, 0.8237, 0.5062]}, {"w": "GPU", "b": [0.1287, 0.5068, 0.175, 0.525]}, {"w": "utilization", "b": [0.1808, 0.5068, 0.2747, 0.525]}, {"w": "in", "b": [0.2805, 0.5068, 0.2985, 0.525]}, {"w": "a", "b": [0.3043, 0.5068, 0.3145, 0.525]}, {"w": "different", "b": [0.3203, 0.5068, 0.3996, 0.525]}, {"w": "shell", "b": [0.4054, 0.5068, 0.4491, 0.525]}, {"w": "window:", "b": [0.4549, 0.5068, 0.5359, 0.525]}]}, {"id": "b_8", "type": "equation", "text": "$ watch -n 5 NVIDIA-smi -a --display=utilization", "words": [{"w": "$", "b": [0.1345, 0.5415, 0.1449, 0.5554]}, {"w": "watch", "b": [0.1553, 0.5415, 0.2074, 0.5554]}, {"w": "-n", "b": [0.2178, 0.5415, 0.2387, 0.5554]}, {"w": "5", "b": [0.2491, 0.5415, 0.2595, 0.5554]}, {"w": "NVIDIA-smi", "b": [0.2699, 0.5415, 0.3741, 0.5554]}, {"w": "-a", "b": [0.3845, 0.5415, 0.4053, 0.5554]}, {"w": "--display=utilization", "b": [0.4157, 0.5415, 0.6345, 0.5554]}]}, {"id": "b_9", "type": "paragraph", "text": "You’re all set! Congratulations—you can now begin building deep-learning applications.", "words": [{"w": "You’re", "b": [0.1287, 0.5764, 0.192, 0.5945]}, {"w": "all", "b": [0.1977, 0.5764, 0.2209, 0.5945]}, {"w": "set!", "b": [0.2267, 0.5764, 0.2601, 0.5945]}, {"w": "Congratulations—you", "b": [0.2659, 0.5764, 0.4716, 0.5945]}, {"w": "can", "b": [0.4774, 0.5764, 0.5095, 0.5945]}, {"w": "now", "b": [0.5153, 0.5764, 0.5552, 0.5945]}, {"w": "begin", "b": [0.561, 0.5764, 0.6124, 0.5945]}, {"w": "building", "b": [0.6182, 0.5764, 0.6954, 0.5945]}, {"w": "deep-learning", "b": [0.7011, 0.5764, 0.8284, 0.5945]}, {"w": "applications.", "b": [0.1287, 0.5952, 0.2464, 0.6133]}]}]}, {"page": 445, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Appendix B. Running Jupyter notebooks on an EC2 GPU instance", "words": [{"w": "Appendix", "b": [0.1289, 0.1063, 0.2695, 0.1327]}, {"w": "B.", "b": [0.2779, 0.1063, 0.3088, 0.1327]}, {"w": "Running", "b": [0.3172, 0.1063, 0.4428, 0.1327]}, {"w": "Jupyter", "b": [0.4512, 0.1063, 0.5636, 0.1327]}, {"w": "notebooks", "b": [0.572, 0.1063, 0.7181, 0.1327]}, {"w": "on", "b": [0.7265, 0.1063, 0.7621, 0.1327]}, {"w": "an", "b": [0.7706, 0.1063, 0.8062, 0.1327]}, {"w": "EC2", "b": [0.1289, 0.1341, 0.1926, 0.1605]}, {"w": "GPU", "b": [0.2011, 0.1341, 0.2722, 0.1605]}, {"w": "instance", "b": [0.2806, 0.1341, 0.3986, 0.1605]}]}, {"id": "b_1", "type": "paragraph", "text": "This appendix provides a step-by-step guide to running deep-learning Jupyter notebooks on an AWS GPU instance and editing the notebooks from anywhere in your browser. This is the perfect setup for deep-learning research if you don’t have a GPU on your local machine. The original (and up-to-date) version of this guide can be found at https://blog.keras.io.", "words": [{"w": "This", "b": [0.1289, 0.1824, 0.1713, 0.201]}, {"w": "appendix", "b": [0.1772, 0.1824, 0.2645, 0.201]}, {"w": "provides", "b": [0.2704, 0.1824, 0.3524, 0.201]}, {"w": "a", "b": [0.3583, 0.1824, 0.3689, 0.201]}, {"w": "step-by-step", "b": [0.3748, 0.1824, 0.4912, 0.201]}, {"w": "guide", "b": [0.4971, 0.1824, 0.55, 0.201]}, {"w": "to", "b": [0.556, 0.1824, 0.5745, 0.201]}, {"w": "running", "b": [0.5804, 0.1824, 0.6545, 0.201]}, {"w": "deep-learning", "b": [0.6604, 0.1824, 0.7913, 0.201]}, {"w": "Jupyter", "b": [0.7972, 0.1824, 0.8673, 0.201]}, {"w": "notebooks", "b": [0.1289, 0.2017, 0.2268, 0.2203]}, {"w": "on", "b": [0.2327, 0.2017, 0.2565, 0.2203]}, {"w": "an", "b": [0.2625, 0.2017, 0.2849, 0.2203]}, {"w": "AWS", "b": [0.2909, 0.2017, 0.3419, 0.2203]}, {"w": "GPU", "b": [0.3478, 0.2017, 0.3954, 0.2203]}, {"w": "instance", "b": [0.4014, 0.2017, 0.4794, 0.2203]}, {"w": "and", "b": [0.4853, 0.2017, 0.5197, 0.2203]}, {"w": "editing", "b": [0.5256, 0.2017, 0.5917, 0.2203]}, {"w": "the", "b": [0.5977, 0.2017, 0.6268, 0.2203]}, {"w": "notebooks", "b": [0.6327, 0.2017, 0.7305, 0.2203]}, {"w": "from", "b": [0.7365, 0.2017, 0.7828, 0.2203]}, {"w": "anywhere", "b": [0.1289, 0.2211, 0.2214, 0.2397]}, {"w": "in", "b": [0.2274, 0.2211, 0.2459, 0.2397]}, {"w": "your", "b": [0.2519, 0.2211, 0.2955, 0.2397]}, {"w": "browser.", "b": [0.3014, 0.2211, 0.3827, 0.2397]}, {"w": "This", "b": [0.3887, 0.2211, 0.431, 0.2397]}, {"w": "is", "b": [0.4369, 0.2211, 0.4528, 0.2397]}, {"w": "the", "b": [0.4588, 0.2211, 0.4879, 0.2397]}, {"w": "perfect", "b": [0.4938, 0.2211, 0.5599, 0.2397]}, {"w": "setup", "b": [0.5658, 0.2211, 0.6161, 0.2397]}, {"w": "for", "b": [0.622, 0.2211, 0.6498, 0.2397]}, {"w": "deep-learning", "b": [0.6557, 0.2211, 0.7866, 0.2397]}, {"w": "research", "b": [0.1289, 0.2404, 0.2082, 0.259]}, {"w": "if", "b": [0.2142, 0.2404, 0.2287, 0.259]}, {"w": "you", "b": [0.2347, 0.2404, 0.2704, 0.259]}, {"w": "don’t", "b": [0.2763, 0.2404, 0.3261, 0.259]}, {"w": "have", "b": [0.3321, 0.2404, 0.377, 0.259]}, {"w": "a", "b": [0.3829, 0.2404, 0.3935, 0.259]}, {"w": "GPU", "b": [0.3995, 0.2404, 0.4471, 0.259]}, {"w": "on", "b": [0.453, 0.2404, 0.4768, 0.259]}, {"w": "your", "b": [0.4827, 0.2404, 0.5264, 0.259]}, {"w": "local", "b": [0.5323, 0.2404, 0.5786, 0.259]}, {"w": "machine.", "b": [0.5845, 0.2404, 0.6711, 0.259]}, {"w": "The", "b": [0.6771, 0.2404, 0.7141, 0.259]}, {"w": "original", "b": [0.72, 0.2404, 0.7941, 0.259]}, {"w": "(and", "b": [0.8, 0.2404, 0.8423, 0.259]}, {"w": "up-to-date)", "b": [0.1289, 0.2597, 0.2347, 0.2784]}, {"w": "version", "b": [0.2406, 0.2597, 0.3107, 0.2784]}, {"w": "of", "b": [0.3166, 0.2597, 0.3365, 0.2784]}, {"w": "this", "b": [0.3424, 0.2597, 0.3768, 0.2784]}, {"w": "guide", "b": [0.3828, 0.2597, 0.4356, 0.2784]}, {"w": "can", "b": [0.4416, 0.2597, 0.4746, 0.2784]}, {"w": "be", "b": [0.4806, 0.2597, 0.5031, 0.2784]}, {"w": "found", "b": [0.509, 0.2597, 0.5645, 0.2784]}, {"w": "at", "b": [0.5705, 0.2597, 0.5877, 0.2784]}, {"w": "https://blog.keras.io.", "b": [0.5936, 0.2597, 0.7886, 0.2784]}]}, {"id": "b_2", "type": "paragraph", "text": "B.1. What are Jupyter notebooks? Why run Jupyter notebooks on AWS GPUs?", "words": [{"w": "B.1.", "b": [0.1289, 0.3134, 0.1736, 0.3343]}, {"w": "What", "b": [0.1803, 0.3134, 0.2442, 0.3343]}, {"w": "are", "b": [0.2509, 0.3134, 0.2876, 0.3343]}, {"w": "Jupyter", "b": [0.2943, 0.3134, 0.3835, 0.3343]}, {"w": "notebooks?", "b": [0.3902, 0.3134, 0.5197, 0.3343]}, {"w": "Why", "b": [0.5264, 0.3134, 0.5814, 0.3343]}, {"w": "run", "b": [0.5881, 0.3134, 0.6298, 0.3343]}, {"w": "Jupyter", "b": [0.6365, 0.3134, 0.7257, 0.3343]}, {"w": "notebooks", "b": [0.7324, 0.3134, 0.8484, 0.3343]}, {"w": "on", "b": [0.1289, 0.3361, 0.1572, 0.357]}, {"w": "AWS", "b": [0.1639, 0.3361, 0.2219, 0.357]}, {"w": "GPUs?", "b": [0.2286, 0.3361, 0.309, 0.357]}]}, {"id": "b_3", "type": "paragraph", "text": "A Jupyter notebook is a web app that allows you to write and annotate Python code interactively. It’s a great way to experiment, do research, and share what you’re working on.", "words": [{"w": "A", "b": [0.1289, 0.3792, 0.1461, 0.3978]}, {"w": "Jupyter", "b": [0.1521, 0.3792, 0.2234, 0.3978]}, {"w": "notebook", "b": [0.2294, 0.3792, 0.3166, 0.3978]}, {"w": "is", "b": [0.3226, 0.3792, 0.3384, 0.3978]}, {"w": "a", "b": [0.3444, 0.3792, 0.355, 0.3978]}, {"w": "web", "b": [0.3609, 0.3792, 0.4006, 0.3978]}, {"w": "app", "b": [0.4065, 0.3792, 0.4409, 0.3978]}, {"w": "that", "b": [0.4468, 0.3792, 0.4825, 0.3978]}, {"w": "allows", "b": [0.4885, 0.3792, 0.5506, 0.3978]}, {"w": "you", "b": [0.5566, 0.3792, 0.5923, 0.3978]}, {"w": "to", "b": [0.5982, 0.3792, 0.6167, 0.3978]}, {"w": "write", "b": [0.6227, 0.3792, 0.6716, 0.3978]}, {"w": "and", "b": [0.6776, 0.3792, 0.7119, 0.3978]}, {"w": "annotate", "b": [0.7179, 0.3792, 0.7985, 0.3978]}, {"w": "Python", "b": [0.1289, 0.3985, 0.1964, 0.4171]}, {"w": "code", "b": [0.2023, 0.3985, 0.2473, 0.4171]}, {"w": "interactively.", "b": [0.2532, 0.3985, 0.3766, 0.4171]}, {"w": "It’s", "b": [0.3825, 0.3985, 0.4129, 0.4171]}, {"w": "a", "b": [0.4189, 0.3985, 0.4294, 0.4171]}, {"w": "great", "b": [0.4354, 0.3985, 0.483, 0.4171]}, {"w": "way", "b": [0.4889, 0.3985, 0.5286, 0.4171]}, {"w": "to", "b": [0.5345, 0.3985, 0.553, 0.4171]}, {"w": "experiment,", "b": [0.559, 0.3985, 0.672, 0.4171]}, {"w": "do", "b": [0.678, 0.3985, 0.7018, 0.4171]}, {"w": "research,", "b": [0.7077, 0.3985, 0.7929, 0.4171]}, {"w": "and", "b": [0.7988, 0.3985, 0.8332, 0.4171]}, {"w": "share", "b": [0.1289, 0.4178, 0.1792, 0.4365]}, {"w": "what", "b": [0.1851, 0.4178, 0.2314, 0.4365]}, {"w": "you’re", "b": [0.2373, 0.4178, 0.2994, 0.4365]}, {"w": "working", "b": [0.3054, 0.4178, 0.3847, 0.4365]}, {"w": "on.", "b": [0.3907, 0.4178, 0.4204, 0.4365]}]}, {"id": "b_4", "type": "paragraph", "text": "Many deep-learning applications are very computationally intensive and can take hours or even days when running on a laptop’s CPU cores. Running on a GPU can speed up training and inference by a considerable factor (often 5 to 10 times, when going from a modern CPU to a single modern GPU). But you may not have access to a GPU on your local machine. Running Jupyter notebooks on AWS gives you the same experience as running on your local machine, while allowing you to use one or several GPUs on AWS. And you only pay for what you use, which can compare favorably to investing in your own GPU(s) if you use deep learning only occasionally.", "words": [{"w": "Many", "b": [0.1289, 0.4582, 0.1845, 0.4768]}, {"w": "deep-learning", "b": [0.1904, 0.4582, 0.3213, 0.4768]}, {"w": "applications", "b": [0.3272, 0.4582, 0.4422, 0.4768]}, {"w": "are", "b": [0.4482, 0.4582, 0.4773, 0.4768]}, {"w": "very", "b": [0.4832, 0.4582, 0.5255, 0.4768]}, {"w": "computationally", "b": [0.5314, 0.4582, 0.6861, 0.4768]}, {"w": "intensive", "b": [0.6921, 0.4582, 0.778, 0.4768]}, {"w": "and", "b": [0.784, 0.4582, 0.8184, 0.4768]}, {"w": "can", "b": [0.8243, 0.4582, 0.8573, 0.4768]}, {"w": "take", "b": [0.1289, 0.4775, 0.1686, 0.4962]}, {"w": "hours", "b": [0.1745, 0.4775, 0.2274, 0.4962]}, {"w": "or", "b": [0.2334, 0.4775, 0.2532, 0.4962]}, {"w": "even", "b": [0.2591, 0.4775, 0.3041, 0.4962]}, {"w": "days", "b": [0.31, 0.4775, 0.3537, 0.4962]}, {"w": "when", "b": [0.3596, 0.4775, 0.4112, 0.4962]}, {"w": "running", "b": [0.4171, 0.4775, 0.4912, 0.4962]}, {"w": "on", "b": [0.4971, 0.4775, 0.5209, 0.4962]}, {"w": "a", "b": [0.5269, 0.4775, 0.5374, 0.4962]}, {"w": "laptop’s", "b": [0.5434, 0.4775, 0.6187, 0.4962]}, {"w": "CPU", "b": [0.6246, 0.4775, 0.6709, 0.4962]}, {"w": "cores.", "b": [0.6769, 0.4775, 0.7331, 0.4962]}, {"w": "Running", "b": [0.739, 0.4775, 0.821, 0.4962]}, {"w": "on", "b": [0.827, 0.4775, 0.8508, 0.4962]}, {"w": "a", "b": [0.8567, 0.4775, 0.8673, 0.4962]}, {"w": "GPU", "b": [0.1289, 0.4969, 0.1765, 0.5155]}, {"w": "can", "b": [0.1825, 0.4969, 0.2155, 0.5155]}, {"w": "speed", "b": [0.2215, 0.4969, 0.2757, 0.5155]}, {"w": "up", "b": [0.2816, 0.4969, 0.3054, 0.5155]}, {"w": "training", "b": [0.3114, 0.4969, 0.3854, 0.5155]}, {"w": "and", "b": [0.3914, 0.4969, 0.4257, 0.5155]}, {"w": "inference", "b": [0.4317, 0.4969, 0.5202, 0.5155]}, {"w": "by", "b": [0.5262, 0.4969, 0.55, 0.5155]}, {"w": "a", "b": [0.5559, 0.4969, 0.5665, 0.5155]}, {"w": "considerable", "b": [0.5724, 0.4969, 0.6927, 0.5155]}, {"w": "factor", "b": [0.6987, 0.4969, 0.7542, 0.5155]}, {"w": "(often", "b": [0.7601, 0.4969, 0.817, 0.5155]}, {"w": "5", "b": [0.8229, 0.4969, 0.8348, 0.5155]}, {"w": "to", "b": [0.8408, 0.4969, 0.8593, 0.5155]}, {"w": "10", "b": [0.1289, 0.5162, 0.1527, 0.5349]}, {"w": "times,", "b": [0.1587, 0.5162, 0.2162, 0.5349]}, {"w": "when", "b": [0.2222, 0.5162, 0.2737, 0.5349]}, {"w": "going", "b": [0.2797, 0.5162, 0.3339, 0.5349]}, {"w": "from", "b": [0.3398, 0.5162, 0.3861, 0.5349]}, {"w": "a", "b": [0.392, 0.5162, 0.4026, 0.5349]}, {"w": "modern", "b": [0.4085, 0.5162, 0.4813, 0.5349]}, {"w": "CPU", "b": [0.4872, 0.5162, 0.5335, 0.5349]}, {"w": "to", "b": [0.5394, 0.5162, 0.558, 0.5349]}, {"w": "a", "b": [0.5639, 0.5162, 0.5745, 0.5349]}, {"w": "single", "b": [0.5804, 0.5162, 0.6373, 0.5349]}, {"w": "modern", "b": [0.6432, 0.5162, 0.7159, 0.5349]}, {"w": "GPU).", "b": [0.7219, 0.5162, 0.7834, 0.5349]}, {"w": "But", "b": [0.7893, 0.5162, 0.8237, 0.5349]}, {"w": "you", "b": [0.8297, 0.5162, 0.8654, 0.5349]}, {"w": "may", "b": [0.1289, 0.5356, 0.1699, 0.5542]}, {"w": "not", "b": [0.1759, 0.5356, 0.2063, 0.5542]}, {"w": "have", "b": [0.2122, 0.5356, 0.2572, 0.5542]}, {"w": "access", "b": [0.2631, 0.5356, 0.3239, 0.5542]}, {"w": "to", "b": [0.3299, 0.5356, 0.3484, 0.5542]}, {"w": "a", "b": [0.3543, 0.5356, 0.3649, 0.5542]}, {"w": "GPU", "b": [0.3708, 0.5356, 0.4184, 0.5542]}, {"w": "on", "b": [0.4244, 0.5356, 0.4482, 0.5542]}, {"w": "your", "b": [0.4541, 0.5356, 0.4978, 0.5542]}, {"w": "local", "b": [0.5037, 0.5356, 0.55, 0.5542]}, {"w": "machine.", "b": [0.5559, 0.5356, 0.6425, 0.5542]}, {"w": "Running", "b": [0.6485, 0.5356, 0.7305, 0.5542]}, {"w": "Jupyter", "b": [0.7364, 0.5356, 0.8065, 0.5542]}, {"w": "notebooks", "b": [0.1289, 0.5549, 0.2268, 0.5735]}, {"w": "on", "b": [0.2327, 0.5549, 0.2565, 0.5735]}, {"w": "AWS", "b": [0.2625, 0.5549, 0.3134, 0.5735]}, {"w": "gives", "b": [0.3194, 0.5549, 0.3696, 0.5735]}, {"w": "you", "b": [0.3756, 0.5549, 0.4113, 0.5735]}, {"w": "the", "b": [0.4172, 0.5549, 0.4463, 0.5735]}, {"w": "same", "b": [0.4523, 0.5549, 0.5012, 0.5735]}, {"w": "experience", "b": [0.5071, 0.5549, 0.6102, 0.5735]}, {"w": "as", "b": [0.6162, 0.5549, 0.636, 0.5735]}, {"w": "running", "b": [0.6419, 0.5549, 0.716, 0.5735]}, {"w": "on", "b": [0.7219, 0.5549, 0.7457, 0.5735]}, {"w": "your", "b": [0.7517, 0.5549, 0.7953, 0.5735]}, {"w": "local", "b": [0.8012, 0.5549, 0.8475, 0.5735]}, {"w": "machine,", "b": [0.1289, 0.5743, 0.2155, 0.5929]}, {"w": "while", "b": [0.2215, 0.5743, 0.2744, 0.5929]}, {"w": "allowing", "b": [0.2803, 0.5743, 0.3636, 0.5929]}, {"w": "you", "b": [0.3696, 0.5743, 0.4053, 0.5929]}, {"w": "to", "b": [0.4112, 0.5743, 0.4297, 0.5929]}, {"w": "use", "b": [0.4357, 0.5743, 0.4674, 0.5929]}, {"w": "one", "b": [0.4733, 0.5743, 0.5077, 0.5929]}, {"w": "or", "b": [0.5137, 0.5743, 0.5335, 0.5929]}, {"w": "several", "b": [0.5394, 0.5743, 0.6068, 0.5929]}, {"w": "GPUs", "b": [0.6128, 0.5743, 0.6697, 0.5929]}, {"w": "on", "b": [0.6756, 0.5743, 0.6994, 0.5929]}, {"w": "AWS.", "b": [0.7054, 0.5743, 0.7622, 0.5929]}, {"w": "And", "b": [0.7682, 0.5743, 0.8092, 0.5929]}, {"w": "you", "b": [0.8151, 0.5743, 0.8508, 0.5929]}, {"w": "only", "b": [0.1289, 0.5936, 0.1713, 0.6122]}, {"w": "pay", "b": [0.1772, 0.5936, 0.2116, 0.6122]}, {"w": "for", "b": [0.2175, 0.5936, 0.2453, 0.6122]}, {"w": "what", "b": [0.2512, 0.5936, 0.2975, 0.6122]}, {"w": "you", "b": [0.3034, 0.5936, 0.3391, 0.6122]}, {"w": "use,", "b": [0.3451, 0.5936, 0.3828, 0.6122]}, {"w": "which", "b": [0.3887, 0.5936, 0.4469, 0.6122]}, {"w": "can", "b": [0.4528, 0.5936, 0.4859, 0.6122]}, {"w": "compare", "b": [0.4918, 0.5936, 0.5738, 0.6122]}, {"w": "favorably", "b": [0.5797, 0.5936, 0.6709, 0.6122]}, {"w": "to", "b": [0.6769, 0.5936, 0.6954, 0.6122]}, {"w": "investing", "b": [0.7013, 0.5936, 0.7886, 0.6122]}, {"w": "in", "b": [0.7946, 0.5936, 0.8131, 0.6122]}, {"w": "your", "b": [0.819, 0.5936, 0.8626, 0.6122]}, {"w": "own", "b": [0.1289, 0.6129, 0.1699, 0.6316]}, {"w": "GPU(s)", "b": [0.1759, 0.6129, 0.2486, 0.6316]}, {"w": "if", "b": [0.2545, 0.6129, 0.2691, 0.6316]}, {"w": "you", "b": [0.275, 0.6129, 0.3107, 0.6316]}, {"w": "use", "b": [0.3167, 0.6129, 0.3484, 0.6316]}, {"w": "deep", "b": [0.3543, 0.6129, 0.3993, 0.6316]}, {"w": "learning", "b": [0.4052, 0.6129, 0.4832, 0.6316]}, {"w": "only", "b": [0.4892, 0.6129, 0.5315, 0.6316]}, {"w": "occasionally.", "b": [0.5374, 0.6129, 0.6608, 0.6316]}]}, {"id": "b_5", "type": "paragraph", "text": "B.2. Why would you not want to use Jupyter on AWS for deep learning?", "words": [{"w": "B.2.", "b": [0.1289, 0.6666, 0.1736, 0.6875]}, {"w": "Why", "b": [0.1803, 0.6666, 0.2353, 0.6875]}, {"w": "would", "b": [0.242, 0.6666, 0.3119, 0.6875]}, {"w": "you", "b": [0.3186, 0.6666, 0.3603, 0.6875]}, {"w": "not", "b": [0.367, 0.6666, 0.4042, 0.6875]}, {"w": "want", "b": [0.4109, 0.6666, 0.4674, 0.6875]}, {"w": "to", "b": [0.4741, 0.6666, 0.4964, 0.6875]}, {"w": "use", "b": [0.5031, 0.6666, 0.5403, 0.6875]}, {"w": "Jupyter", "b": [0.547, 0.6666, 0.6362, 0.6875]}, {"w": "on", "b": [0.6429, 0.6666, 0.6712, 0.6875]}, {"w": "AWS", "b": [0.6779, 0.6666, 0.736, 0.6875]}, {"w": "for", "b": [0.7426, 0.6666, 0.7768, 0.6875]}, {"w": "deep", "b": [0.7835, 0.6666, 0.8371, 0.6875]}, {"w": "learning?", "b": [0.1289, 0.6893, 0.2375, 0.7102]}]}, {"id": "b_6", "type": "paragraph", "text": "AWS GPU instances can quickly become expensive. The one we suggest using costs $0.90 per hour. This is fine for occasional use; but if you’re going to run experiments for several hours per day every day, then you’re better off building your own deep-learning machine with a TITAN X or GTX 1080 Ti.", "words": [{"w": "AWS", "b": [0.1289, 0.7324, 0.1799, 0.751]}, {"w": "GPU", "b": [0.1859, 0.7324, 0.2335, 0.751]}, {"w": "instances", "b": [0.2394, 0.7324, 0.3267, 0.751]}, {"w": "can", "b": [0.3326, 0.7324, 0.3657, 0.751]}, {"w": "quickly", "b": [0.3716, 0.7324, 0.443, 0.751]}, {"w": "become", "b": [0.449, 0.7324, 0.523, 0.751]}, {"w": "expensive.", "b": [0.5289, 0.7324, 0.6301, 0.751]}, {"w": "The", "b": [0.636, 0.7324, 0.673, 0.751]}, {"w": "one", "b": [0.679, 0.7324, 0.7133, 0.751]}, {"w": "we", "b": [0.7193, 0.7324, 0.747, 0.751]}, {"w": "suggest", "b": [0.753, 0.7324, 0.8244, 0.751]}, {"w": "using", "b": [0.1289, 0.7517, 0.1805, 0.7703]}, {"w": "costs", "b": [0.1865, 0.7517, 0.2341, 0.7703]}, {"w": "$0.90", "b": [0.24, 0.7517, 0.2936, 0.7703]}, {"w": "per", "b": [0.2995, 0.7517, 0.3299, 0.7703]}, {"w": "hour.", "b": [0.3359, 0.7517, 0.3841, 0.7703]}, {"w": "This", "b": [0.3901, 0.7517, 0.4324, 0.7703]}, {"w": "is", "b": [0.4383, 0.7517, 0.4542, 0.7703]}, {"w": "fine", "b": [0.4602, 0.7517, 0.4972, 0.7703]}, {"w": "for", "b": [0.5031, 0.7517, 0.5309, 0.7703]}, {"w": "occasional", "b": [0.5368, 0.7517, 0.6373, 0.7703]}, {"w": "use;", "b": [0.6432, 0.7517, 0.6815, 0.7703]}, {"w": "but", "b": [0.6875, 0.7517, 0.7179, 0.7703]}, {"w": "if", "b": [0.7238, 0.7517, 0.7384, 0.7703]}, {"w": "you’re", "b": [0.7443, 0.7517, 0.8065, 0.7703]}, {"w": "going", "b": [0.8124, 0.7517, 0.8666, 0.7703]}, {"w": "to", "b": [0.1289, 0.771, 0.1475, 0.7897]}, {"w": "run", "b": [0.1534, 0.771, 0.1851, 0.7897]}, {"w": "experiments", "b": [0.1911, 0.771, 0.3074, 0.7897]}, {"w": "for", "b": [0.3134, 0.771, 0.3411, 0.7897]}, {"w": "several", "b": [0.3471, 0.771, 0.4145, 0.7897]}, {"w": "hours", "b": [0.4204, 0.771, 0.4733, 0.7897]}, {"w": "per", "b": [0.4793, 0.771, 0.5096, 0.7897]}, {"w": "day", "b": [0.5156, 0.771, 0.55, 0.7897]}, {"w": "every", "b": [0.5559, 0.771, 0.6088, 0.7897]}, {"w": "day,", "b": [0.6147, 0.771, 0.6534, 0.7897]}, {"w": "then", "b": [0.6594, 0.771, 0.7004, 0.7897]}, {"w": "you’re", "b": [0.7063, 0.771, 0.7684, 0.7897]}, {"w": "better", "b": [0.7744, 0.771, 0.8286, 0.7897]}, {"w": "off", "b": [0.8345, 0.771, 0.8618, 0.7897]}, {"w": "building", "b": [0.1289, 0.7904, 0.2083, 0.809]}, {"w": "your", "b": [0.2142, 0.7904, 0.2579, 0.809]}, {"w": "own", "b": [0.2638, 0.7904, 0.3048, 0.809]}, {"w": "deep-learning", "b": [0.3107, 0.7904, 0.4416, 0.809]}, {"w": "machine", "b": [0.4475, 0.7904, 0.5282, 0.809]}, {"w": "with", "b": [0.5341, 0.7904, 0.5764, 0.809]}, {"w": "a", "b": [0.5824, 0.7904, 0.593, 0.809]}, {"w": "TITAN", "b": [0.5989, 0.7904, 0.6683, 0.809]}, {"w": "X", "b": [0.6743, 0.7904, 0.6914, 0.809]}, {"w": "or", "b": [0.6974, 0.7904, 0.7172, 0.809]}, {"w": "GTX", "b": [0.7232, 0.7904, 0.7721, 0.809]}, {"w": "1080", "b": [0.778, 0.7904, 0.8256, 0.809]}, {"w": "Ti.", "b": [0.8316, 0.7904, 0.8579, 0.809]}]}, {"id": "b_7", "type": "paragraph", "text": "In summary, use the Jupyter-on-EC2 setup if you don’t have access to a local GPU or if you don’t want to deal with installing Keras dependencies, in particular GPU drivers. If you have a access to a local GPU, we recommend", "words": [{"w": "In", "b": [0.1289, 0.8307, 0.1488, 0.8494]}, {"w": "summary,", "b": [0.1547, 0.8307, 0.2477, 0.8494]}, {"w": "use", "b": [0.2536, 0.8307, 0.2854, 0.8494]}, {"w": "the", "b": [0.2913, 0.8307, 0.3204, 0.8494]}, {"w": "Jupyter-on-EC2", "b": [0.3264, 0.8307, 0.4779, 0.8494]}, {"w": "setup", "b": [0.4839, 0.8307, 0.5341, 0.8494]}, {"w": "if", "b": [0.54, 0.8307, 0.5546, 0.8494]}, {"w": "you", "b": [0.5605, 0.8307, 0.5962, 0.8494]}, {"w": "don’t", "b": [0.6022, 0.8307, 0.652, 0.8494]}, {"w": "have", "b": [0.6579, 0.8307, 0.7029, 0.8494]}, {"w": "access", "b": [0.7088, 0.8307, 0.7696, 0.8494]}, {"w": "to", "b": [0.7756, 0.8307, 0.7941, 0.8494]}, {"w": "a", "b": [0.8, 0.8307, 0.8106, 0.8494]}, {"w": "local", "b": [0.8165, 0.8307, 0.8628, 0.8494]}, {"w": "GPU", "b": [0.1289, 0.8501, 0.1765, 0.8687]}, {"w": "or", "b": [0.1825, 0.8501, 0.2023, 0.8687]}, {"w": "if", "b": [0.2083, 0.8501, 0.2228, 0.8687]}, {"w": "you", "b": [0.2288, 0.8501, 0.2645, 0.8687]}, {"w": "don’t", "b": [0.2704, 0.8501, 0.3202, 0.8687]}, {"w": "want", "b": [0.3262, 0.8501, 0.3724, 0.8687]}, {"w": "to", "b": [0.3784, 0.8501, 0.3969, 0.8687]}, {"w": "deal", "b": [0.4029, 0.8501, 0.4425, 0.8687]}, {"w": "with", "b": [0.4485, 0.8501, 0.4908, 0.8687]}, {"w": "installing", "b": [0.4967, 0.8501, 0.5853, 0.8687]}, {"w": "Keras", "b": [0.5912, 0.8501, 0.6467, 0.8687]}, {"w": "dependencies,", "b": [0.6527, 0.8501, 0.7868, 0.8687]}, {"w": "in", "b": [0.7928, 0.8501, 0.8113, 0.8687]}, {"w": "particular", "b": [0.1289, 0.8694, 0.2201, 0.8881]}, {"w": "GPU", "b": [0.2261, 0.8694, 0.2737, 0.8881]}, {"w": "drivers.", "b": [0.2796, 0.8694, 0.3517, 0.8881]}, {"w": "If", "b": [0.3576, 0.8694, 0.3735, 0.8881]}, {"w": "you", "b": [0.3794, 0.8694, 0.4151, 0.8881]}, {"w": "have", "b": [0.4211, 0.8694, 0.466, 0.8881]}, {"w": "a", "b": [0.472, 0.8694, 0.4825, 0.8881]}, {"w": "access", "b": [0.4885, 0.8694, 0.5493, 0.8881]}, {"w": "to", "b": [0.5552, 0.8694, 0.5737, 0.8881]}, {"w": "a", "b": [0.5797, 0.8694, 0.5903, 0.8881]}, {"w": "local", "b": [0.5962, 0.8694, 0.6425, 0.8881]}, {"w": "GPU,", "b": [0.6484, 0.8694, 0.702, 0.8881]}, {"w": "we", "b": [0.7079, 0.8694, 0.7357, 0.8881]}, {"w": "recommend", "b": [0.7416, 0.8694, 0.854, 0.8881]}]}]}, {"page": 446, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "running your models locally, instead. In that case, use the installation guide in appendix A.", "words": [{"w": "running", "b": [0.1289, 0.0857, 0.203, 0.1043]}, {"w": "your", "b": [0.2089, 0.0857, 0.2526, 0.1043]}, {"w": "models", "b": [0.2585, 0.0857, 0.3273, 0.1043]}, {"w": "locally,", "b": [0.3332, 0.0857, 0.4024, 0.1043]}, {"w": "instead.", "b": [0.4083, 0.0857, 0.4817, 0.1043]}, {"w": "In", "b": [0.4876, 0.0857, 0.5075, 0.1043]}, {"w": "that", "b": [0.5134, 0.0857, 0.5491, 0.1043]}, {"w": "case,", "b": [0.5551, 0.0857, 0.602, 0.1043]}, {"w": "use", "b": [0.6079, 0.0857, 0.6396, 0.1043]}, {"w": "the", "b": [0.6456, 0.0857, 0.6747, 0.1043]}, {"w": "installation", "b": [0.6806, 0.0857, 0.7864, 0.1043]}, {"w": "guide", "b": [0.7924, 0.0857, 0.8453, 0.1043]}, {"w": "in", "b": [0.8512, 0.0857, 0.8697, 0.1043]}, {"w": "appendix", "b": [0.1289, 0.105, 0.2162, 0.1236]}, {"w": "A.", "b": [0.2221, 0.105, 0.2453, 0.1236]}]}, {"id": "b_1", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1289, 0.1508, 0.1646, 0.1648]}]}, {"id": "b_2", "type": "paragraph", "text": "You’ll need an active AWS account. Some familiarity with AWS EC2 will help, but it isn’t mandatory.", "words": [{"w": "You’ll", "b": [0.1289, 0.1824, 0.1887, 0.201]}, {"w": "need", "b": [0.1947, 0.1824, 0.2396, 0.201]}, {"w": "an", "b": [0.2455, 0.1824, 0.268, 0.201]}, {"w": "active", "b": [0.274, 0.1824, 0.3308, 0.201]}, {"w": "AWS", "b": [0.3367, 0.1824, 0.3877, 0.201]}, {"w": "account.", "b": [0.3936, 0.1824, 0.4736, 0.201]}, {"w": "Some", "b": [0.4796, 0.1824, 0.5338, 0.201]}, {"w": "familiarity", "b": [0.5397, 0.1824, 0.6402, 0.201]}, {"w": "with", "b": [0.6462, 0.1824, 0.6885, 0.201]}, {"w": "AWS", "b": [0.6944, 0.1824, 0.7453, 0.201]}, {"w": "EC2", "b": [0.7513, 0.1824, 0.7936, 0.201]}, {"w": "will", "b": [0.7996, 0.1824, 0.8366, 0.201]}, {"w": "help,", "b": [0.1289, 0.2017, 0.1759, 0.2203]}, {"w": "but", "b": [0.1818, 0.2017, 0.2122, 0.2203]}, {"w": "it", "b": [0.2182, 0.2017, 0.2314, 0.2203]}, {"w": "isn’t", "b": [0.2374, 0.2017, 0.2792, 0.2203]}, {"w": "mandatory.", "b": [0.2852, 0.2017, 0.3914, 0.2203]}]}, {"id": "b_3", "type": "paragraph", "text": "B.3. Setting up an AWS GPU instance", "words": [{"w": "B.3.", "b": [0.1289, 0.2806, 0.1736, 0.3015]}, {"w": "Setting", "b": [0.1803, 0.2806, 0.2606, 0.3015]}, {"w": "up", "b": [0.2673, 0.2806, 0.2971, 0.3015]}, {"w": "an", "b": [0.3038, 0.2806, 0.332, 0.3015]}, {"w": "AWS", "b": [0.3387, 0.2806, 0.3968, 0.3015]}, {"w": "GPU", "b": [0.4035, 0.2806, 0.46, 0.3015]}, {"w": "instance", "b": [0.4667, 0.2806, 0.5604, 0.3015]}]}, {"id": "b_4", "type": "paragraph", "text": "The following setup process will take 5 to 10 minutes:", "words": [{"w": "The", "b": [0.1289, 0.3237, 0.1659, 0.3423]}, {"w": "following", "b": [0.1719, 0.3237, 0.2645, 0.3423]}, {"w": "setup", "b": [0.2704, 0.3237, 0.3206, 0.3423]}, {"w": "process", "b": [0.3266, 0.3237, 0.398, 0.3423]}, {"w": "will", "b": [0.4039, 0.3237, 0.441, 0.3423]}, {"w": "take", "b": [0.4469, 0.3237, 0.4866, 0.3423]}, {"w": "5", "b": [0.4925, 0.3237, 0.5044, 0.3423]}, {"w": "to", "b": [0.5104, 0.3237, 0.5289, 0.3423]}, {"w": "10", "b": [0.5348, 0.3237, 0.5586, 0.3423]}, {"w": "minutes:", "b": [0.5646, 0.3237, 0.6466, 0.3423]}]}, {"id": "b_5", "type": "paragraph", "text": "1. Navigate to the EC2 control panel at https://console.aws.amazon.com/ec2/v2, and click the Launch Instance link (see figure B.1). Figure B.1. The EC2 control panel", "words": [{"w": "1.", "b": [0.1531, 0.3598, 0.171, 0.3784]}, {"w": "Navigate", "b": [0.1765, 0.3598, 0.2625, 0.3784]}, {"w": "to", "b": [0.2684, 0.3598, 0.2869, 0.3784]}, {"w": "the", "b": [0.2929, 0.3598, 0.322, 0.3784]}, {"w": "EC2", "b": [0.3279, 0.3598, 0.3702, 0.3784]}, {"w": "control", "b": [0.3762, 0.3598, 0.4436, 0.3784]}, {"w": "panel", "b": [0.4495, 0.3598, 0.5011, 0.3784]}, {"w": "at", "b": [0.5071, 0.3598, 0.5242, 0.3784]}, {"w": "https://console.aws.amazon.com/ec2/v2,", "b": [0.1765, 0.3792, 0.5612, 0.3978]}, {"w": "and", "b": [0.5672, 0.3792, 0.6015, 0.3978]}, {"w": "click", "b": [0.6075, 0.3792, 0.6537, 0.3978]}, {"w": "the", "b": [0.6597, 0.3792, 0.6888, 0.3978]}, {"w": "Launch", "b": [0.6947, 0.3792, 0.7661, 0.3978]}, {"w": "Instance", "b": [0.7721, 0.3792, 0.8514, 0.3978]}, {"w": "link", "b": [0.1765, 0.3985, 0.2136, 0.4171]}, {"w": "(see", "b": [0.2195, 0.3985, 0.2578, 0.4171]}, {"w": "figure", "b": [0.2638, 0.3985, 0.3206, 0.4171]}, {"w": "B.1).", "b": [0.3265, 0.3985, 0.3741, 0.4171]}, {"w": "Figure", "b": [0.1765, 0.4191, 0.2268, 0.433]}, {"w": "B.1.", "b": [0.2312, 0.4191, 0.261, 0.433]}, {"w": "The", "b": [0.2655, 0.4191, 0.2952, 0.433]}, {"w": "EC2", "b": [0.2997, 0.4191, 0.3334, 0.433]}, {"w": "control", "b": [0.3379, 0.4191, 0.3921, 0.433]}, {"w": "panel", "b": [0.3965, 0.4191, 0.4382, 0.433]}]}, {"id": "b_6", "type": "paragraph", "text": "2. Select AWS Marketplace (see figure B.2), and search for “deep learning” in the search box. Scroll down until you find the AMI named Deep Learning AMI Ubuntu Version (see figure B.3); select it. Figure B.2. The EC2 AMI Marketplace", "words": [{"w": "2.", "b": [0.1531, 0.5667, 0.171, 0.5853]}, {"w": "Select", "b": [0.1765, 0.5667, 0.2347, 0.5853]}, {"w": "AWS", "b": [0.2407, 0.5667, 0.2916, 0.5853]}, {"w": "Marketplace", "b": [0.2976, 0.5667, 0.4165, 0.5853]}, {"w": "(see", "b": [0.4225, 0.5667, 0.4608, 0.5853]}, {"w": "figure", "b": [0.4667, 0.5667, 0.5235, 0.5853]}, {"w": "B.2),", "b": [0.5295, 0.5667, 0.5771, 0.5853]}, {"w": "and", "b": [0.583, 0.5667, 0.6174, 0.5853]}, {"w": "search", "b": [0.6234, 0.5667, 0.6841, 0.5853]}, {"w": "for", "b": [0.6901, 0.5667, 0.7178, 0.5853]}, {"w": "“deep", "b": [0.7238, 0.5667, 0.7793, 0.5853]}, {"w": "learning”", "b": [0.1765, 0.586, 0.2651, 0.6047]}, {"w": "in", "b": [0.271, 0.586, 0.2896, 0.6047]}, {"w": "the", "b": [0.2955, 0.586, 0.3246, 0.6047]}, {"w": "search", "b": [0.3305, 0.586, 0.3913, 0.6047]}, {"w": "box.", "b": [0.3973, 0.586, 0.4389, 0.6047]}, {"w": "Scroll", "b": [0.4449, 0.586, 0.5017, 0.6047]}, {"w": "down", "b": [0.5077, 0.586, 0.5606, 0.6047]}, {"w": "until", "b": [0.5665, 0.586, 0.6102, 0.6047]}, {"w": "you", "b": [0.6161, 0.586, 0.6518, 0.6047]}, {"w": "find", "b": [0.6578, 0.586, 0.6961, 0.6047]}, {"w": "the", "b": [0.7021, 0.586, 0.7312, 0.6047]}, {"w": "AMI", "b": [0.7371, 0.586, 0.7834, 0.6047]}, {"w": "named", "b": [0.7893, 0.586, 0.8528, 0.6047]}, {"w": "Deep", "b": [0.1765, 0.6054, 0.2268, 0.624]}, {"w": "Learning", "b": [0.2327, 0.6054, 0.3186, 0.624]}, {"w": "AMI", "b": [0.3246, 0.6054, 0.3708, 0.624]}, {"w": "Ubuntu", "b": [0.3768, 0.6054, 0.4482, 0.624]}, {"w": "Version", "b": [0.4541, 0.6054, 0.5268, 0.624]}, {"w": "(see", "b": [0.5328, 0.6054, 0.5711, 0.624]}, {"w": "figure", "b": [0.577, 0.6054, 0.6339, 0.624]}, {"w": "B.3);", "b": [0.6398, 0.6054, 0.6881, 0.624]}, {"w": "select", "b": [0.694, 0.6054, 0.7482, 0.624]}, {"w": "it.", "b": [0.7542, 0.6054, 0.7734, 0.624]}, {"w": "Figure", "b": [0.1765, 0.6259, 0.2268, 0.6399]}, {"w": "B.2.", "b": [0.2312, 0.6259, 0.261, 0.6399]}, {"w": "The", "b": [0.2655, 0.6259, 0.2952, 0.6399]}, {"w": "EC2", "b": [0.2997, 0.6259, 0.3334, 0.6399]}, {"w": "AMI", "b": [0.3379, 0.6259, 0.3745, 0.6399]}, {"w": "Marketplace", "b": [0.379, 0.6259, 0.4762, 0.6399]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure B.3. The EC2 Deep Learning AMI", "words": [{"w": "Figure", "b": [0.1765, 0.8244, 0.2268, 0.8384]}, {"w": "B.3.", "b": [0.2312, 0.8244, 0.261, 0.8384]}, {"w": "The", "b": [0.2655, 0.8244, 0.2952, 0.8384]}, {"w": "EC2", "b": [0.2997, 0.8244, 0.3334, 0.8384]}, {"w": "Deep", "b": [0.3379, 0.8244, 0.3765, 0.8384]}, {"w": "Learning", "b": [0.381, 0.8244, 0.4514, 0.8384]}, {"w": "AMI", "b": [0.4559, 0.8244, 0.4925, 0.8384]}]}]}, {"page": 447, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "3. Select the p2.xlarge instance (see figure B.4). This instance type provides access to a single GPU and costs $0.90 per hour of usage (as of March 2017). Figure B.4. The p2.xlarge instance", "words": [{"w": "3.", "b": [0.1531, 0.3009, 0.171, 0.3196]}, {"w": "Select", "b": [0.1765, 0.3009, 0.2347, 0.3196]}, {"w": "the", "b": [0.2407, 0.3009, 0.2697, 0.3196]}, {"w": "p2.xlarge", "b": [0.2757, 0.3009, 0.3645, 0.3196]}, {"w": "instance", "b": [0.3704, 0.3009, 0.4484, 0.3196]}, {"w": "(see", "b": [0.4543, 0.3009, 0.4927, 0.3196]}, {"w": "figure", "b": [0.4986, 0.3009, 0.5554, 0.3196]}, {"w": "B.4).", "b": [0.5614, 0.3009, 0.609, 0.3196]}, {"w": "This", "b": [0.6149, 0.3009, 0.6572, 0.3196]}, {"w": "instance", "b": [0.6632, 0.3009, 0.7412, 0.3196]}, {"w": "type", "b": [0.7471, 0.3009, 0.7881, 0.3196]}, {"w": "provides", "b": [0.1765, 0.3203, 0.2585, 0.3389]}, {"w": "access", "b": [0.2645, 0.3203, 0.3252, 0.3389]}, {"w": "to", "b": [0.3312, 0.3203, 0.3497, 0.3389]}, {"w": "a", "b": [0.3557, 0.3203, 0.3662, 0.3389]}, {"w": "single", "b": [0.3722, 0.3203, 0.429, 0.3389]}, {"w": "GPU", "b": [0.435, 0.3203, 0.4826, 0.3389]}, {"w": "and", "b": [0.4885, 0.3203, 0.5229, 0.3389]}, {"w": "costs", "b": [0.5289, 0.3203, 0.5765, 0.3389]}, {"w": "$0.90", "b": [0.5824, 0.3203, 0.636, 0.3389]}, {"w": "per", "b": [0.6419, 0.3203, 0.6723, 0.3389]}, {"w": "hour", "b": [0.6782, 0.3203, 0.7219, 0.3389]}, {"w": "of", "b": [0.7278, 0.3203, 0.7476, 0.3389]}, {"w": "usage", "b": [0.7536, 0.3203, 0.8078, 0.3389]}, {"w": "(as", "b": [0.8137, 0.3203, 0.8415, 0.3389]}, {"w": "of", "b": [0.8474, 0.3203, 0.8673, 0.3389]}, {"w": "March", "b": [0.1765, 0.3396, 0.2387, 0.3583]}, {"w": "2017).", "b": [0.2446, 0.3396, 0.3061, 0.3583]}, {"w": "Figure", "b": [0.1765, 0.3602, 0.2268, 0.3742]}, {"w": "B.4.", "b": [0.2312, 0.3602, 0.261, 0.3742]}, {"w": "The", "b": [0.2655, 0.3602, 0.2952, 0.3742]}, {"w": "p2.xlarge", "b": [0.2997, 0.3602, 0.3706, 0.3742]}, {"w": "instance", "b": [0.375, 0.3602, 0.4375, 0.3742]}]}, {"id": "b_1", "type": "paragraph", "text": "4. You can keep the default configuration for the steps Configure Instance, Add Storage, and Add Tags, but you’ll customize the Configure Security Group step. Create a custom TCP rule to allow port 8888 (see figure B.5): this rule can be allowed either for your current public IP (such as that of your laptop) or for any IP (such as 0.0.0.0/0) if the former isn’t possible. Note that if you allow port 8888 for any IP, then literally anyone will be able to listen to that port on your instance (which is where you’ll run IPython notebooks). You’ll add password protection to the notebooks to mitigate the risk of random strangers modifying them, but that may be pretty weak protection. If at all possible, you should consider restricting access to a specific IP. But if your IP address changes constantly, then that isn’t a practical choice. If you’re going to leave access open to any IP, then remember not to leave sensitive data on the instance. Figure B.5. Configure a new security group.", "words": [{"w": "4.", "b": [0.1531, 0.5919, 0.171, 0.6105]}, {"w": "You", "b": [0.1765, 0.5919, 0.2151, 0.6105]}, {"w": "can", "b": [0.2211, 0.5919, 0.2541, 0.6105]}, {"w": "keep", "b": [0.2601, 0.5919, 0.305, 0.6105]}, {"w": "the", "b": [0.311, 0.5919, 0.34, 0.6105]}, {"w": "default", "b": [0.346, 0.5919, 0.4121, 0.6105]}, {"w": "configuration", "b": [0.418, 0.5919, 0.5463, 0.6105]}, {"w": "for", "b": [0.5522, 0.5919, 0.58, 0.6105]}, {"w": "the", "b": [0.5859, 0.5919, 0.615, 0.6105]}, {"w": "steps", "b": [0.621, 0.5919, 0.6686, 0.6105]}, {"w": "Configure", "b": [0.6745, 0.5919, 0.771, 0.6105]}, {"w": "Instance,", "b": [0.777, 0.5919, 0.8622, 0.6105]}, {"w": "Add", "b": [0.1765, 0.6113, 0.2175, 0.6299]}, {"w": "Storage,", "b": [0.2235, 0.6113, 0.3021, 0.6299]}, {"w": "and", "b": [0.3081, 0.6113, 0.3424, 0.6299]}, {"w": "Add", "b": [0.3484, 0.6113, 0.3894, 0.6299]}, {"w": "Tags,", "b": [0.3953, 0.6113, 0.4459, 0.6299]}, {"w": "but", "b": [0.4518, 0.6113, 0.4822, 0.6299]}, {"w": "you’ll", "b": [0.4882, 0.6113, 0.5451, 0.6299]}, {"w": "customize", "b": [0.551, 0.6113, 0.6475, 0.6299]}, {"w": "the", "b": [0.6535, 0.6113, 0.6825, 0.6299]}, {"w": "Configure", "b": [0.6884, 0.6113, 0.785, 0.6299]}, {"w": "Security", "b": [0.7909, 0.6113, 0.8702, 0.6299]}, {"w": "Group", "b": [0.1765, 0.6306, 0.2373, 0.6492]}, {"w": "step.", "b": [0.2433, 0.6306, 0.2876, 0.6492]}, {"w": "Create", "b": [0.2935, 0.6306, 0.3557, 0.6492]}, {"w": "a", "b": [0.3616, 0.6306, 0.3722, 0.6492]}, {"w": "custom", "b": [0.3781, 0.6306, 0.4469, 0.6492]}, {"w": "TCP", "b": [0.4528, 0.6306, 0.4965, 0.6492]}, {"w": "rule", "b": [0.5024, 0.6306, 0.5394, 0.6492]}, {"w": "to", "b": [0.5454, 0.6306, 0.5639, 0.6492]}, {"w": "allow", "b": [0.5699, 0.6306, 0.6227, 0.6492]}, {"w": "port", "b": [0.6287, 0.6306, 0.667, 0.6492]}, {"w": "8888", "b": [0.673, 0.6306, 0.7206, 0.6492]}, {"w": "(see", "b": [0.7265, 0.6306, 0.7649, 0.6492]}, {"w": "figure", "b": [0.7707, 0.6306, 0.8276, 0.6492]}, {"w": "B.5):", "b": [0.1765, 0.6499, 0.2248, 0.6686]}, {"w": "this", "b": [0.2307, 0.6499, 0.2651, 0.6686]}, {"w": "rule", "b": [0.2711, 0.6499, 0.3081, 0.6686]}, {"w": "can", "b": [0.314, 0.6499, 0.3471, 0.6686]}, {"w": "be", "b": [0.353, 0.6499, 0.3755, 0.6686]}, {"w": "allowed", "b": [0.3814, 0.6499, 0.4568, 0.6686]}, {"w": "either", "b": [0.4627, 0.6499, 0.5169, 0.6686]}, {"w": "for", "b": [0.5229, 0.6499, 0.5506, 0.6686]}, {"w": "your", "b": [0.5566, 0.6499, 0.6002, 0.6686]}, {"w": "current", "b": [0.6062, 0.6499, 0.6736, 0.6686]}, {"w": "public", "b": [0.6795, 0.6499, 0.739, 0.6686]}, {"w": "IP", "b": [0.745, 0.6499, 0.7661, 0.6686]}, {"w": "(such", "b": [0.7721, 0.6499, 0.8236, 0.6686]}, {"w": "as", "b": [0.8296, 0.6499, 0.8494, 0.6686]}, {"w": "that", "b": [0.1765, 0.6693, 0.2122, 0.6879]}, {"w": "of", "b": [0.2182, 0.6693, 0.238, 0.6879]}, {"w": "your", "b": [0.244, 0.6693, 0.2876, 0.6879]}, {"w": "laptop)", "b": [0.2935, 0.6693, 0.361, 0.6879]}, {"w": "or", "b": [0.3669, 0.6693, 0.3867, 0.6879]}, {"w": "for", "b": [0.3927, 0.6693, 0.4204, 0.6879]}, {"w": "any", "b": [0.4264, 0.6693, 0.4608, 0.6879]}, {"w": "IP", "b": [0.4667, 0.6693, 0.4879, 0.6879]}, {"w": "(such", "b": [0.4938, 0.6693, 0.5454, 0.6879]}, {"w": "as", "b": [0.5513, 0.6693, 0.5711, 0.6879]}, {"w": "0.0.0.0/0)", "b": [0.5771, 0.6693, 0.669, 0.6879]}, {"w": "if", "b": [0.6749, 0.6693, 0.6895, 0.6879]}, {"w": "the", "b": [0.6954, 0.6693, 0.7245, 0.6879]}, {"w": "former", "b": [0.7304, 0.6693, 0.7952, 0.6879]}, {"w": "isn’t", "b": [0.8011, 0.6693, 0.843, 0.6879]}, {"w": "possible.", "b": [0.1765, 0.6886, 0.2605, 0.7072]}, {"w": "Note", "b": [0.2665, 0.6886, 0.3127, 0.7072]}, {"w": "that", "b": [0.3187, 0.6886, 0.3544, 0.7072]}, {"w": "if", "b": [0.3603, 0.6886, 0.3749, 0.7072]}, {"w": "you", "b": [0.3808, 0.6886, 0.4165, 0.7072]}, {"w": "allow", "b": [0.4225, 0.6886, 0.4753, 0.7072]}, {"w": "port", "b": [0.4813, 0.6886, 0.5196, 0.7072]}, {"w": "8888", "b": [0.5256, 0.6886, 0.5732, 0.7072]}, {"w": "for", "b": [0.5791, 0.6886, 0.6069, 0.7072]}, {"w": "any", "b": [0.6128, 0.6886, 0.6472, 0.7072]}, {"w": "IP,", "b": [0.6532, 0.6886, 0.6776, 0.7072]}, {"w": "then", "b": [0.6835, 0.6886, 0.7245, 0.7072]}, {"w": "literally", "b": [0.7305, 0.6886, 0.8045, 0.7072]}, {"w": "anyone", "b": [0.1765, 0.708, 0.2453, 0.7266]}, {"w": "will", "b": [0.2512, 0.708, 0.2883, 0.7266]}, {"w": "be", "b": [0.2942, 0.708, 0.3167, 0.7266]}, {"w": "able", "b": [0.3226, 0.708, 0.3623, 0.7266]}, {"w": "to", "b": [0.3682, 0.708, 0.3867, 0.7266]}, {"w": "listen", "b": [0.3927, 0.708, 0.4443, 0.7266]}, {"w": "to", "b": [0.4502, 0.708, 0.4687, 0.7266]}, {"w": "that", "b": [0.4746, 0.708, 0.5103, 0.7266]}, {"w": "port", "b": [0.5163, 0.708, 0.5546, 0.7266]}, {"w": "on", "b": [0.5606, 0.708, 0.5844, 0.7266]}, {"w": "your", "b": [0.5903, 0.708, 0.6339, 0.7266]}, {"w": "instance", "b": [0.6399, 0.708, 0.7179, 0.7266]}, {"w": "(which", "b": [0.7238, 0.708, 0.7899, 0.7266]}, {"w": "is", "b": [0.7959, 0.708, 0.8117, 0.7266]}, {"w": "where", "b": [0.1765, 0.7273, 0.2347, 0.7459]}, {"w": "you’ll", "b": [0.2406, 0.7273, 0.2975, 0.7459]}, {"w": "run", "b": [0.3034, 0.7273, 0.3352, 0.7459]}, {"w": "IPython", "b": [0.3411, 0.7273, 0.4165, 0.7459]}, {"w": "notebooks).", "b": [0.4224, 0.7273, 0.5342, 0.7459]}, {"w": "You’ll", "b": [0.5401, 0.7273, 0.5999, 0.7459]}, {"w": "add", "b": [0.6058, 0.7273, 0.6402, 0.7459]}, {"w": "password", "b": [0.6461, 0.7273, 0.736, 0.7459]}, {"w": "protection", "b": [0.742, 0.7273, 0.8385, 0.7459]}, {"w": "to", "b": [0.8444, 0.7273, 0.8629, 0.7459]}, {"w": "the", "b": [0.1765, 0.7466, 0.2056, 0.7653]}, {"w": "notebooks", "b": [0.2116, 0.7466, 0.3094, 0.7653]}, {"w": "to", "b": [0.3153, 0.7466, 0.3339, 0.7653]}, {"w": "mitigate", "b": [0.3398, 0.7466, 0.4178, 0.7653]}, {"w": "the", "b": [0.4238, 0.7466, 0.4529, 0.7653]}, {"w": "risk", "b": [0.4588, 0.7466, 0.4945, 0.7653]}, {"w": "of", "b": [0.5005, 0.7466, 0.5203, 0.7653]}, {"w": "random", "b": [0.5262, 0.7466, 0.5989, 0.7653]}, {"w": "strangers", "b": [0.6049, 0.7466, 0.6908, 0.7653]}, {"w": "modifying", "b": [0.6968, 0.7466, 0.7959, 0.7653]}, {"w": "them,", "b": [0.8019, 0.7466, 0.8554, 0.7653]}, {"w": "but", "b": [0.1765, 0.766, 0.207, 0.7846]}, {"w": "that", "b": [0.2129, 0.766, 0.2486, 0.7846]}, {"w": "may", "b": [0.2546, 0.766, 0.2955, 0.7846]}, {"w": "be", "b": [0.3015, 0.766, 0.324, 0.7846]}, {"w": "pretty", "b": [0.3299, 0.766, 0.3854, 0.7846]}, {"w": "weak", "b": [0.3914, 0.766, 0.4416, 0.7846]}, {"w": "protection.", "b": [0.4475, 0.766, 0.55, 0.7846]}, {"w": "If", "b": [0.556, 0.766, 0.5718, 0.7846]}, {"w": "at", "b": [0.5778, 0.766, 0.5949, 0.7846]}, {"w": "all", "b": [0.6009, 0.766, 0.6247, 0.7846]}, {"w": "possible,", "b": [0.6306, 0.766, 0.7146, 0.7846]}, {"w": "you", "b": [0.7206, 0.766, 0.7563, 0.7846]}, {"w": "should", "b": [0.7622, 0.766, 0.8257, 0.7846]}, {"w": "consider", "b": [0.1765, 0.7853, 0.2572, 0.804]}, {"w": "restricting", "b": [0.2631, 0.7853, 0.3596, 0.804]}, {"w": "access", "b": [0.3656, 0.7853, 0.4264, 0.804]}, {"w": "to", "b": [0.4323, 0.7853, 0.4508, 0.804]}, {"w": "a", "b": [0.4568, 0.7853, 0.4674, 0.804]}, {"w": "specific", "b": [0.4733, 0.7853, 0.5473, 0.804]}, {"w": "IP.", "b": [0.5533, 0.7853, 0.5777, 0.804]}, {"w": "But", "b": [0.5836, 0.7853, 0.618, 0.804]}, {"w": "if", "b": [0.624, 0.7853, 0.6385, 0.804]}, {"w": "your", "b": [0.6445, 0.7853, 0.6881, 0.804]}, {"w": "IP", "b": [0.694, 0.7853, 0.7152, 0.804]}, {"w": "address", "b": [0.7212, 0.7853, 0.7925, 0.804]}, {"w": "changes", "b": [0.1765, 0.8047, 0.2532, 0.8233]}, {"w": "constantly,", "b": [0.2591, 0.8047, 0.3614, 0.8233]}, {"w": "then", "b": [0.3673, 0.8047, 0.4083, 0.8233]}, {"w": "that", "b": [0.4143, 0.8047, 0.45, 0.8233]}, {"w": "isn’t", "b": [0.4559, 0.8047, 0.4978, 0.8233]}, {"w": "a", "b": [0.5037, 0.8047, 0.5143, 0.8233]}, {"w": "practical", "b": [0.5202, 0.8047, 0.6022, 0.8233]}, {"w": "choice.", "b": [0.6081, 0.8047, 0.6762, 0.8233]}, {"w": "If", "b": [0.6821, 0.8047, 0.698, 0.8233]}, {"w": "you’re", "b": [0.7039, 0.8047, 0.766, 0.8233]}, {"w": "going", "b": [0.772, 0.8047, 0.8262, 0.8233]}, {"w": "to", "b": [0.8321, 0.8047, 0.8507, 0.8233]}, {"w": "leave", "b": [0.1765, 0.824, 0.2268, 0.8426]}, {"w": "access", "b": [0.2327, 0.824, 0.2935, 0.8426]}, {"w": "open", "b": [0.2994, 0.824, 0.3457, 0.8426]}, {"w": "to", "b": [0.3517, 0.824, 0.3702, 0.8426]}, {"w": "any", "b": [0.3761, 0.824, 0.4105, 0.8426]}, {"w": "IP,", "b": [0.4164, 0.824, 0.4409, 0.8426]}, {"w": "then", "b": [0.4468, 0.824, 0.4878, 0.8426]}, {"w": "remember", "b": [0.4938, 0.824, 0.5903, 0.8426]}, {"w": "not", "b": [0.5962, 0.824, 0.6266, 0.8426]}, {"w": "to", "b": [0.6326, 0.824, 0.6511, 0.8426]}, {"w": "leave", "b": [0.657, 0.824, 0.7073, 0.8426]}, {"w": "sensitive", "b": [0.7132, 0.824, 0.7965, 0.8426]}, {"w": "data", "b": [0.8025, 0.824, 0.8421, 0.8426]}, {"w": "on", "b": [0.1765, 0.8434, 0.2003, 0.862]}, {"w": "the", "b": [0.2063, 0.8434, 0.2354, 0.862]}, {"w": "instance.", "b": [0.2413, 0.8434, 0.3253, 0.862]}, {"w": "Figure", "b": [0.1765, 0.8639, 0.2268, 0.8779]}, {"w": "B.5.", "b": [0.2312, 0.8639, 0.261, 0.8779]}, {"w": "Configure", "b": [0.2655, 0.8639, 0.3425, 0.8779]}, {"w": "a", "b": [0.3469, 0.8639, 0.3559, 0.8779]}, {"w": "new", "b": [0.3603, 0.8639, 0.3911, 0.8779]}, {"w": "security", "b": [0.3955, 0.8639, 0.456, 0.8779]}, {"w": "group.", "b": [0.4605, 0.8639, 0.5102, 0.8779]}]}]}, {"page": 448, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1765, 0.2484, 0.2122, 0.2623]}]}, {"id": "b_1", "type": "paragraph", "text": "At the end of the launch process, you’ll be asked if you want to create new connection keys or if you want to reuse existing keys. If you’ve never used EC2 before, create new keys and download them.", "words": [{"w": "At", "b": [0.1765, 0.2799, 0.2003, 0.2986]}, {"w": "the", "b": [0.2063, 0.2799, 0.2354, 0.2986]}, {"w": "end", "b": [0.2413, 0.2799, 0.2757, 0.2986]}, {"w": "of", "b": [0.2816, 0.2799, 0.3015, 0.2986]}, {"w": "the", "b": [0.3074, 0.2799, 0.3365, 0.2986]}, {"w": "launch", "b": [0.3424, 0.2799, 0.4059, 0.2986]}, {"w": "process,", "b": [0.4118, 0.2799, 0.4892, 0.2986]}, {"w": "you’ll", "b": [0.4951, 0.2799, 0.552, 0.2986]}, {"w": "be", "b": [0.5579, 0.2799, 0.5804, 0.2986]}, {"w": "asked", "b": [0.5864, 0.2799, 0.6405, 0.2986]}, {"w": "if", "b": [0.6465, 0.2799, 0.661, 0.2986]}, {"w": "you", "b": [0.667, 0.2799, 0.7027, 0.2986]}, {"w": "want", "b": [0.7086, 0.2799, 0.7549, 0.2986]}, {"w": "to", "b": [0.7609, 0.2799, 0.7794, 0.2986]}, {"w": "create", "b": [0.7853, 0.2799, 0.8421, 0.2986]}, {"w": "new", "b": [0.1765, 0.2993, 0.2162, 0.3179]}, {"w": "connection", "b": [0.2221, 0.2993, 0.3266, 0.3179]}, {"w": "keys", "b": [0.3325, 0.2993, 0.3761, 0.3179]}, {"w": "or", "b": [0.3821, 0.2993, 0.4019, 0.3179]}, {"w": "if", "b": [0.4079, 0.2993, 0.4224, 0.3179]}, {"w": "you", "b": [0.4284, 0.2993, 0.4641, 0.3179]}, {"w": "want", "b": [0.47, 0.2993, 0.5163, 0.3179]}, {"w": "to", "b": [0.5222, 0.2993, 0.5408, 0.3179]}, {"w": "reuse", "b": [0.5467, 0.2993, 0.5969, 0.3179]}, {"w": "existing", "b": [0.6029, 0.2993, 0.6782, 0.3179]}, {"w": "keys.", "b": [0.6841, 0.2993, 0.7337, 0.3179]}, {"w": "If", "b": [0.7397, 0.2993, 0.7555, 0.3179]}, {"w": "you’ve", "b": [0.7615, 0.2993, 0.8276, 0.3179]}, {"w": "never", "b": [0.1765, 0.3186, 0.2294, 0.3372]}, {"w": "used", "b": [0.2353, 0.3186, 0.279, 0.3372]}, {"w": "EC2", "b": [0.2849, 0.3186, 0.3272, 0.3372]}, {"w": "before,", "b": [0.3332, 0.3186, 0.3999, 0.3372]}, {"w": "create", "b": [0.4059, 0.3186, 0.4627, 0.3372]}, {"w": "new", "b": [0.4686, 0.3186, 0.5083, 0.3372]}, {"w": "keys", "b": [0.5142, 0.3186, 0.5579, 0.3372]}, {"w": "and", "b": [0.5638, 0.3186, 0.5982, 0.3372]}, {"w": "download", "b": [0.6041, 0.3186, 0.698, 0.3372]}, {"w": "them.", "b": [0.7039, 0.3186, 0.7575, 0.3372]}]}, {"id": "b_2", "type": "paragraph", "text": "5. To connect to your instance, select it on the EC2 control panel, click the Connect button, and follow the instructions (see figure B.6). Note that it may take a few minutes for the instance to boot up. If you can’t connect at first, wait a bit and try again. Figure B.6. Connection instructions", "words": [{"w": "5.", "b": [0.1531, 0.3632, 0.171, 0.3818]}, {"w": "To", "b": [0.1765, 0.3632, 0.2013, 0.3818]}, {"w": "connect", "b": [0.2073, 0.3632, 0.2813, 0.3818]}, {"w": "to", "b": [0.2872, 0.3632, 0.3057, 0.3818]}, {"w": "your", "b": [0.3117, 0.3632, 0.3553, 0.3818]}, {"w": "instance,", "b": [0.3613, 0.3632, 0.4452, 0.3818]}, {"w": "select", "b": [0.4512, 0.3632, 0.5054, 0.3818]}, {"w": "it", "b": [0.5113, 0.3632, 0.5245, 0.3818]}, {"w": "on", "b": [0.5305, 0.3632, 0.5543, 0.3818]}, {"w": "the", "b": [0.5602, 0.3632, 0.5893, 0.3818]}, {"w": "EC2", "b": [0.5953, 0.3632, 0.6376, 0.3818]}, {"w": "control", "b": [0.6435, 0.3632, 0.711, 0.3818]}, {"w": "panel,", "b": [0.7169, 0.3632, 0.7744, 0.3818]}, {"w": "click", "b": [0.7804, 0.3632, 0.8266, 0.3818]}, {"w": "the", "b": [0.8326, 0.3632, 0.8617, 0.3818]}, {"w": "Connect", "b": [0.1765, 0.3825, 0.2559, 0.4011]}, {"w": "button,", "b": [0.2618, 0.3825, 0.3286, 0.4011]}, {"w": "and", "b": [0.3345, 0.3825, 0.3689, 0.4011]}, {"w": "follow", "b": [0.3749, 0.3825, 0.437, 0.4011]}, {"w": "the", "b": [0.443, 0.3825, 0.472, 0.4011]}, {"w": "instructions", "b": [0.478, 0.3825, 0.5891, 0.4011]}, {"w": "(see", "b": [0.595, 0.3825, 0.6333, 0.4011]}, {"w": "figure", "b": [0.6392, 0.3825, 0.6961, 0.4011]}, {"w": "B.6).", "b": [0.702, 0.3825, 0.7496, 0.4011]}, {"w": "Note", "b": [0.7556, 0.3825, 0.8018, 0.4011]}, {"w": "that", "b": [0.8078, 0.3825, 0.8435, 0.4011]}, {"w": "it", "b": [0.8494, 0.3825, 0.8627, 0.4011]}, {"w": "may", "b": [0.1765, 0.4019, 0.2175, 0.4205]}, {"w": "take", "b": [0.2235, 0.4019, 0.2631, 0.4205]}, {"w": "a", "b": [0.2691, 0.4019, 0.2796, 0.4205]}, {"w": "few", "b": [0.2856, 0.4019, 0.3213, 0.4205]}, {"w": "minutes", "b": [0.3272, 0.4019, 0.4026, 0.4205]}, {"w": "for", "b": [0.4085, 0.4019, 0.4363, 0.4205]}, {"w": "the", "b": [0.4422, 0.4019, 0.4713, 0.4205]}, {"w": "instance", "b": [0.4773, 0.4019, 0.5553, 0.4205]}, {"w": "to", "b": [0.5612, 0.4019, 0.5797, 0.4205]}, {"w": "boot", "b": [0.5857, 0.4019, 0.628, 0.4205]}, {"w": "up.", "b": [0.634, 0.4019, 0.6637, 0.4205]}, {"w": "If", "b": [0.6697, 0.4019, 0.6855, 0.4205]}, {"w": "you", "b": [0.6915, 0.4019, 0.7272, 0.4205]}, {"w": "can’t", "b": [0.7331, 0.4019, 0.7802, 0.4205]}, {"w": "connect", "b": [0.7861, 0.4019, 0.8601, 0.4205]}, {"w": "at", "b": [0.1765, 0.4212, 0.1937, 0.4398]}, {"w": "first,", "b": [0.1997, 0.4212, 0.244, 0.4398]}, {"w": "wait", "b": [0.2499, 0.4212, 0.2909, 0.4398]}, {"w": "a", "b": [0.2968, 0.4212, 0.3074, 0.4398]}, {"w": "bit", "b": [0.3134, 0.4212, 0.3385, 0.4398]}, {"w": "and", "b": [0.3444, 0.4212, 0.3788, 0.4398]}, {"w": "try", "b": [0.3848, 0.4212, 0.4112, 0.4398]}, {"w": "again.", "b": [0.4172, 0.4212, 0.4747, 0.4398]}, {"w": "Figure", "b": [0.1765, 0.4418, 0.2268, 0.4557]}, {"w": "B.6.", "b": [0.2312, 0.4418, 0.261, 0.4557]}, {"w": "Connection", "b": [0.2655, 0.4418, 0.3527, 0.4557]}, {"w": "instructions", "b": [0.3572, 0.4418, 0.4474, 0.4557]}]}, {"id": "b_3", "type": "paragraph", "text": "6. Once you’re logged in to the instance via SSH, create an ssl directory at the root of the instance, and cd to it (not mandatory, but cleaner):", "words": [{"w": "6.", "b": [0.1531, 0.8055, 0.171, 0.8241]}, {"w": "Once", "b": [0.1765, 0.8055, 0.2268, 0.8241]}, {"w": "you’re", "b": [0.2327, 0.8055, 0.2948, 0.8241]}, {"w": "logged", "b": [0.3008, 0.8055, 0.3656, 0.8241]}, {"w": "in", "b": [0.3715, 0.8055, 0.39, 0.8241]}, {"w": "to", "b": [0.396, 0.8055, 0.4145, 0.8241]}, {"w": "the", "b": [0.4204, 0.8055, 0.4495, 0.8241]}, {"w": "instance", "b": [0.4555, 0.8055, 0.5335, 0.8241]}, {"w": "via", "b": [0.5394, 0.8055, 0.5685, 0.8241]}, {"w": "SSH,", "b": [0.5745, 0.8055, 0.6241, 0.8241]}, {"w": "create", "b": [0.63, 0.8055, 0.6868, 0.8241]}, {"w": "an", "b": [0.6928, 0.8055, 0.7152, 0.8241]}, {"w": "ssl", "b": [0.7212, 0.8055, 0.7463, 0.8241]}, {"w": "directory", "b": [0.7523, 0.8055, 0.8382, 0.8241]}, {"w": "at", "b": [0.8441, 0.8055, 0.8613, 0.8241]}, {"w": "the", "b": [0.1765, 0.8249, 0.2056, 0.8435]}, {"w": "root", "b": [0.2116, 0.8249, 0.2499, 0.8435]}, {"w": "of", "b": [0.2559, 0.8249, 0.2757, 0.8435]}, {"w": "the", "b": [0.2816, 0.8249, 0.3107, 0.8435]}, {"w": "instance,", "b": [0.3167, 0.8249, 0.4006, 0.8435]}, {"w": "and", "b": [0.4066, 0.8249, 0.4409, 0.8435]}, {"w": "cd", "b": [0.4468, 0.8258, 0.4754, 0.8449]}, {"w": "to", "b": [0.4813, 0.8249, 0.4999, 0.8435]}, {"w": "it", "b": [0.5058, 0.8249, 0.519, 0.8435]}, {"w": "(not", "b": [0.525, 0.8249, 0.5633, 0.8435]}, {"w": "mandatory,", "b": [0.5693, 0.8249, 0.6755, 0.8435]}, {"w": "but", "b": [0.6814, 0.8249, 0.7118, 0.8435]}, {"w": "cleaner):", "b": [0.7178, 0.8249, 0.801, 0.8435]}]}, {"id": "b_4", "type": "paragraph", "text": "$ mkdir ssl $ cd ssl", "words": [{"w": "$", "b": [0.1825, 0.8571, 0.1932, 0.8714]}, {"w": "mkdir", "b": [0.2039, 0.8571, 0.2575, 0.8714]}, {"w": "ssl", "b": [0.2682, 0.8571, 0.3003, 0.8714]}, {"w": "$", "b": [0.1825, 0.8714, 0.1932, 0.8857]}, {"w": "cd", "b": [0.2039, 0.8714, 0.2253, 0.8857]}, {"w": "ssl", "b": [0.236, 0.8714, 0.2682, 0.8857]}]}]}, {"page": 449, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "7. Create a new SSL certificate using OpenSSL, and create cert.key and cert.pem files in the current ssl directory:", "words": [{"w": "7.", "b": [0.1531, 0.0857, 0.171, 0.1043]}, {"w": "Create", "b": [0.1765, 0.0857, 0.2387, 0.1043]}, {"w": "a", "b": [0.2446, 0.0857, 0.2552, 0.1043]}, {"w": "new", "b": [0.2611, 0.0857, 0.3008, 0.1043]}, {"w": "SSL", "b": [0.3067, 0.0857, 0.3477, 0.1043]}, {"w": "certificate", "b": [0.3537, 0.0857, 0.4488, 0.1043]}, {"w": "using", "b": [0.4548, 0.0857, 0.5064, 0.1043]}, {"w": "OpenSSL,", "b": [0.5123, 0.0857, 0.6108, 0.1043]}, {"w": "and", "b": [0.6168, 0.0857, 0.6511, 0.1043]}, {"w": "create", "b": [0.6571, 0.0857, 0.7139, 0.1043]}, {"w": "cert.key", "b": [0.7198, 0.0857, 0.7958, 0.1043]}, {"w": "and", "b": [0.8018, 0.0857, 0.8362, 0.1043]}, {"w": "cert.pem", "b": [0.1765, 0.105, 0.2591, 0.1236]}, {"w": "files", "b": [0.2651, 0.105, 0.3061, 0.1236]}, {"w": "in", "b": [0.312, 0.105, 0.3305, 0.1236]}, {"w": "the", "b": [0.3365, 0.105, 0.3656, 0.1236]}, {"w": "current", "b": [0.3715, 0.105, 0.4389, 0.1236]}, {"w": "ssl", "b": [0.4449, 0.105, 0.47, 0.1236]}, {"w": "directory:", "b": [0.476, 0.105, 0.5685, 0.1236]}]}, {"id": "b_1", "type": "equation", "text": "$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout \"cert.key\" -out", "words": [{"w": "$", "b": [0.1825, 0.1364, 0.1932, 0.1507]}, {"w": "openssl", "b": [0.2039, 0.1364, 0.2789, 0.1507]}, {"w": "req", "b": [0.2896, 0.1364, 0.3217, 0.1507]}, {"w": "-x509", "b": [0.3324, 0.1364, 0.386, 0.1507]}, {"w": "-nodes", "b": [0.3967, 0.1364, 0.4609, 0.1507]}, {"w": "-days", "b": [0.4717, 0.1364, 0.5252, 0.1507]}, {"w": "365", "b": [0.5359, 0.1364, 0.568, 0.1507]}, {"w": "-newkey", "b": [0.5788, 0.1364, 0.6537, 0.1507]}, {"w": "rsa:1024", "b": [0.6644, 0.1364, 0.7501, 0.1507]}, {"w": "-keyout", "b": [0.7608, 0.1364, 0.8358, 0.1507]}, {"w": "\"cert.key\"", "b": [0.1825, 0.1507, 0.2896, 0.165]}, {"w": "-out", "b": [0.3003, 0.1507, 0.3431, 0.165]}]}, {"id": "b_2", "type": "equation", "text": "\"cert.pem\" -batch", "words": [{"w": "\"cert.pem\"", "b": [0.2099, 0.1667, 0.317, 0.181]}, {"w": "-batch", "b": [0.3277, 0.1667, 0.3919, 0.181]}]}, {"id": "b_3", "type": "paragraph", "text": "B.3.1. Configuring Jupyter", "words": [{"w": "B.3.1.", "b": [0.1289, 0.2068, 0.1865, 0.2254]}, {"w": "Configuring", "b": [0.1924, 0.2068, 0.3167, 0.2254]}, {"w": "Jupyter", "b": [0.3227, 0.2068, 0.402, 0.2254]}]}, {"id": "b_4", "type": "paragraph", "text": "Before you use Jupyter, you need to touch up its default configuration. Follow these steps:", "words": [{"w": "Before", "b": [0.1289, 0.2471, 0.1937, 0.2658]}, {"w": "you", "b": [0.1996, 0.2471, 0.2353, 0.2658]}, {"w": "use", "b": [0.2413, 0.2471, 0.273, 0.2658]}, {"w": "Jupyter,", "b": [0.279, 0.2471, 0.354, 0.2658]}, {"w": "you", "b": [0.36, 0.2471, 0.3957, 0.2658]}, {"w": "need", "b": [0.4016, 0.2471, 0.4466, 0.2658]}, {"w": "to", "b": [0.4525, 0.2471, 0.471, 0.2658]}, {"w": "touch", "b": [0.477, 0.2471, 0.5299, 0.2658]}, {"w": "up", "b": [0.5358, 0.2471, 0.5596, 0.2658]}, {"w": "its", "b": [0.5656, 0.2471, 0.5881, 0.2658]}, {"w": "default", "b": [0.594, 0.2471, 0.6601, 0.2658]}, {"w": "configuration.", "b": [0.666, 0.2471, 0.8002, 0.2658]}, {"w": "Follow", "b": [0.1289, 0.2665, 0.1964, 0.2851]}, {"w": "these", "b": [0.2023, 0.2665, 0.2512, 0.2851]}, {"w": "steps:", "b": [0.2572, 0.2665, 0.3114, 0.2851]}]}, {"id": "b_5", "type": "paragraph", "text": "1. Generate a new Jupyter config file (still on the remote instance):", "words": [{"w": "1.", "b": [0.1531, 0.3026, 0.171, 0.3213]}, {"w": "Generate", "b": [0.1765, 0.3026, 0.2624, 0.3213]}, {"w": "a", "b": [0.2684, 0.3026, 0.2789, 0.3213]}, {"w": "new", "b": [0.2849, 0.3026, 0.3246, 0.3213]}, {"w": "Jupyter", "b": [0.3305, 0.3026, 0.4006, 0.3213]}, {"w": "config", "b": [0.4065, 0.3026, 0.4673, 0.3213]}, {"w": "file", "b": [0.4733, 0.3026, 0.505, 0.3213]}, {"w": "(still", "b": [0.511, 0.3026, 0.5546, 0.3213]}, {"w": "on", "b": [0.5606, 0.3026, 0.5844, 0.3213]}, {"w": "the", "b": [0.5903, 0.3026, 0.6194, 0.3213]}, {"w": "remote", "b": [0.6253, 0.3026, 0.6914, 0.3213]}, {"w": "instance):", "b": [0.6974, 0.3026, 0.7899, 0.3213]}]}, {"id": "b_6", "type": "equation", "text": "$ jupyter notebook --generate-config", "words": [{"w": "$", "b": [0.1825, 0.334, 0.1932, 0.3483]}, {"w": "jupyter", "b": [0.2039, 0.334, 0.2789, 0.3483]}, {"w": "notebook", "b": [0.2896, 0.334, 0.3753, 0.3483]}, {"w": "--generate-config", "b": [0.386, 0.334, 0.568, 0.3483]}]}, {"id": "b_7", "type": "paragraph", "text": "2. Optionally, you can generate a Jupyter password for your notebooks. Because your instance may be configured to be accessible from any IP (depending on the choice you made when configuring the security group), it’s better to restrict access to Jupyter via a password. To generate a password, open an IPython shell (ipython command) and run the following:", "words": [{"w": "2.", "b": [0.1531, 0.3615, 0.171, 0.3801]}, {"w": "Optionally,", "b": [0.1765, 0.3615, 0.2827, 0.3801]}, {"w": "you", "b": [0.2887, 0.3615, 0.3244, 0.3801]}, {"w": "can", "b": [0.3303, 0.3615, 0.3634, 0.3801]}, {"w": "generate", "b": [0.3693, 0.3615, 0.4499, 0.3801]}, {"w": "a", "b": [0.4559, 0.3615, 0.4665, 0.3801]}, {"w": "Jupyter", "b": [0.4724, 0.3615, 0.5425, 0.3801]}, {"w": "password", "b": [0.5484, 0.3615, 0.6383, 0.3801]}, {"w": "for", "b": [0.6443, 0.3615, 0.672, 0.3801]}, {"w": "your", "b": [0.678, 0.3615, 0.7216, 0.3801]}, {"w": "notebooks.", "b": [0.7275, 0.3615, 0.8313, 0.3801]}, {"w": "Because", "b": [0.1765, 0.3808, 0.2558, 0.3995]}, {"w": "your", "b": [0.2618, 0.3808, 0.3054, 0.3995]}, {"w": "instance", "b": [0.3114, 0.3808, 0.3894, 0.3995]}, {"w": "may", "b": [0.3953, 0.3808, 0.4363, 0.3995]}, {"w": "be", "b": [0.4422, 0.3808, 0.4647, 0.3995]}, {"w": "configured", "b": [0.4707, 0.3808, 0.5738, 0.3995]}, {"w": "to", "b": [0.5797, 0.3808, 0.5982, 0.3995]}, {"w": "be", "b": [0.6042, 0.3808, 0.6266, 0.3995]}, {"w": "accessible", "b": [0.6326, 0.3808, 0.7291, 0.3995]}, {"w": "from", "b": [0.7349, 0.3808, 0.7812, 0.3995]}, {"w": "any", "b": [0.7872, 0.3808, 0.8215, 0.3995]}, {"w": "IP", "b": [0.8275, 0.3808, 0.8486, 0.3995]}, {"w": "(depending", "b": [0.1765, 0.4002, 0.2836, 0.4188]}, {"w": "on", "b": [0.2896, 0.4002, 0.3134, 0.4188]}, {"w": "the", "b": [0.3193, 0.4002, 0.3484, 0.4188]}, {"w": "choice", "b": [0.3543, 0.4002, 0.4165, 0.4188]}, {"w": "you", "b": [0.4224, 0.4002, 0.4581, 0.4188]}, {"w": "made", "b": [0.4641, 0.4002, 0.5156, 0.4188]}, {"w": "when", "b": [0.5216, 0.4002, 0.5731, 0.4188]}, {"w": "configuring", "b": [0.5791, 0.4002, 0.6901, 0.4188]}, {"w": "the", "b": [0.6961, 0.4002, 0.7252, 0.4188]}, {"w": "security", "b": [0.7311, 0.4002, 0.8065, 0.4188]}, {"w": "group),", "b": [0.1765, 0.4195, 0.2459, 0.4381]}, {"w": "it’s", "b": [0.2519, 0.4195, 0.281, 0.4381]}, {"w": "better", "b": [0.2869, 0.4195, 0.3411, 0.4381]}, {"w": "to", "b": [0.3471, 0.4195, 0.3656, 0.4381]}, {"w": "restrict", "b": [0.3715, 0.4195, 0.4376, 0.4381]}, {"w": "access", "b": [0.4436, 0.4195, 0.5044, 0.4381]}, {"w": "to", "b": [0.5103, 0.4195, 0.5288, 0.4381]}, {"w": "Jupyter", "b": [0.5348, 0.4195, 0.6049, 0.4381]}, {"w": "via", "b": [0.6108, 0.4195, 0.6398, 0.4381]}, {"w": "a", "b": [0.6458, 0.4195, 0.6564, 0.4381]}, {"w": "password.", "b": [0.6623, 0.4195, 0.7582, 0.4381]}, {"w": "To", "b": [0.7641, 0.4195, 0.7889, 0.4381]}, {"w": "generate", "b": [0.1765, 0.4389, 0.2571, 0.4575]}, {"w": "a", "b": [0.2631, 0.4389, 0.2737, 0.4575]}, {"w": "password,", "b": [0.2796, 0.4389, 0.3755, 0.4575]}, {"w": "open", "b": [0.3814, 0.4389, 0.4277, 0.4575]}, {"w": "an", "b": [0.4336, 0.4389, 0.4561, 0.4575]}, {"w": "IPython", "b": [0.462, 0.4389, 0.5374, 0.4575]}, {"w": "shell", "b": [0.5434, 0.4389, 0.5883, 0.4575]}, {"w": "(ipython", "b": [0.5943, 0.4389, 0.7021, 0.4589]}, {"w": "command)", "b": [0.7081, 0.4389, 0.8099, 0.4575]}, {"w": "and", "b": [0.8158, 0.4389, 0.8502, 0.4575]}, {"w": "run", "b": [0.1765, 0.459, 0.2083, 0.4777]}, {"w": "the", "b": [0.2142, 0.459, 0.2433, 0.4777]}, {"w": "following:", "b": [0.2492, 0.459, 0.3484, 0.4777]}]}, {"id": "b_8", "type": "paragraph", "text": "from IPython.lib import passwd passwd() exit", "words": [{"w": "from", "b": [0.1825, 0.4904, 0.2253, 0.5047]}, {"w": "IPython.lib", "b": [0.236, 0.4904, 0.3538, 0.5047]}, {"w": "import", "b": [0.3646, 0.4904, 0.4288, 0.5047]}, {"w": "passwd", "b": [0.4395, 0.4904, 0.5038, 0.5047]}, {"w": "passwd()", "b": [0.1825, 0.5047, 0.2682, 0.519]}, {"w": "exit", "b": [0.1825, 0.519, 0.2253, 0.5333]}]}, {"id": "b_9", "type": "paragraph", "text": "3. The passwd() command will ask you to enter and verify a password. After you do, it will display a hash of your password. Copy that hash— you’ll need it soon. It looks something like this:", "words": [{"w": "3.", "b": [0.1531, 0.5465, 0.171, 0.5651]}, {"w": "The", "b": [0.1765, 0.5465, 0.2135, 0.5651]}, {"w": "passwd()", "b": [0.2195, 0.5475, 0.3337, 0.5665]}, {"w": "command", "b": [0.3397, 0.5465, 0.4336, 0.5651]}, {"w": "will", "b": [0.4395, 0.5465, 0.4765, 0.5651]}, {"w": "ask", "b": [0.4825, 0.5465, 0.5142, 0.5651]}, {"w": "you", "b": [0.5202, 0.5465, 0.5559, 0.5651]}, {"w": "to", "b": [0.5618, 0.5465, 0.5803, 0.5651]}, {"w": "enter", "b": [0.5863, 0.5465, 0.6339, 0.5651]}, {"w": "and", "b": [0.6398, 0.5465, 0.6742, 0.5651]}, {"w": "verify", "b": [0.6801, 0.5465, 0.737, 0.5651]}, {"w": "a", "b": [0.7429, 0.5465, 0.7535, 0.5651]}, {"w": "password.", "b": [0.7594, 0.5465, 0.8553, 0.5651]}, {"w": "After", "b": [0.1765, 0.5667, 0.2268, 0.5853]}, {"w": "you", "b": [0.2327, 0.5667, 0.2684, 0.5853]}, {"w": "do,", "b": [0.2744, 0.5667, 0.3041, 0.5853]}, {"w": "it", "b": [0.3101, 0.5667, 0.3233, 0.5853]}, {"w": "will", "b": [0.3292, 0.5667, 0.3663, 0.5853]}, {"w": "display", "b": [0.3722, 0.5667, 0.441, 0.5853]}, {"w": "a", "b": [0.4469, 0.5667, 0.4575, 0.5853]}, {"w": "hash", "b": [0.4634, 0.5667, 0.5071, 0.5853]}, {"w": "of", "b": [0.513, 0.5667, 0.5328, 0.5853]}, {"w": "your", "b": [0.5388, 0.5667, 0.5824, 0.5853]}, {"w": "password.", "b": [0.5884, 0.5667, 0.6842, 0.5853]}, {"w": "Copy", "b": [0.6902, 0.5667, 0.7417, 0.5853]}, {"w": "that", "b": [0.7477, 0.5667, 0.7834, 0.5853]}, {"w": "hash—", "b": [0.7893, 0.5667, 0.8568, 0.5853]}, {"w": "you’ll", "b": [0.1765, 0.586, 0.2334, 0.6047]}, {"w": "need", "b": [0.2393, 0.586, 0.2843, 0.6047]}, {"w": "it", "b": [0.2902, 0.586, 0.3034, 0.6047]}, {"w": "soon.", "b": [0.3094, 0.586, 0.3603, 0.6047]}, {"w": "It", "b": [0.3663, 0.586, 0.3808, 0.6047]}, {"w": "looks", "b": [0.3867, 0.586, 0.4383, 0.6047]}, {"w": "something", "b": [0.4443, 0.586, 0.5434, 0.6047]}, {"w": "like", "b": [0.5494, 0.586, 0.5851, 0.6047]}, {"w": "this:", "b": [0.591, 0.586, 0.6321, 0.6047]}]}, {"id": "b_10", "type": "paragraph", "text": "sha1:b592a9cf2ec6:b99edb2fd3d0727e336185a0b0eab561aa533a43", "words": [{"w": "sha1:b592a9cf2ec6:b99edb2fd3d0727e336185a0b0eab561aa533a43", "b": [0.1825, 0.6174, 0.8037, 0.6317]}]}, {"id": "b_11", "type": "paragraph", "text": "Note that this is a hash of the word password, which isn’t a password you should be using. 4. Use vi (or your favorite available text editor) to edit the Jupyter config file:", "words": [{"w": "Note", "b": [0.1765, 0.6449, 0.2228, 0.6635]}, {"w": "that", "b": [0.2288, 0.6449, 0.2645, 0.6635]}, {"w": "this", "b": [0.2704, 0.6449, 0.3048, 0.6635]}, {"w": "is", "b": [0.3107, 0.6449, 0.3266, 0.6635]}, {"w": "a", "b": [0.3326, 0.6449, 0.3431, 0.6635]}, {"w": "hash", "b": [0.3491, 0.6449, 0.3927, 0.6635]}, {"w": "of", "b": [0.3987, 0.6449, 0.4185, 0.6635]}, {"w": "the", "b": [0.4244, 0.6449, 0.4535, 0.6635]}, {"w": "word", "b": [0.4595, 0.6449, 0.5084, 0.6635]}, {"w": "password,", "b": [0.5143, 0.6449, 0.6106, 0.6635]}, {"w": "which", "b": [0.6166, 0.6449, 0.6747, 0.6635]}, {"w": "isn’t", "b": [0.6807, 0.6449, 0.7226, 0.6635]}, {"w": "a", "b": [0.7285, 0.6449, 0.7391, 0.6635]}, {"w": "password", "b": [0.745, 0.6449, 0.8349, 0.6635]}, {"w": "you", "b": [0.1765, 0.6642, 0.2122, 0.6829]}, {"w": "should", "b": [0.2182, 0.6642, 0.2817, 0.6829]}, {"w": "be", "b": [0.2876, 0.6642, 0.3101, 0.6829]}, {"w": "using.", "b": [0.316, 0.6642, 0.3736, 0.6829]}, {"w": "4.", "b": [0.1531, 0.6836, 0.171, 0.7022]}, {"w": "Use", "b": [0.1765, 0.6836, 0.2135, 0.7022]}, {"w": "vi", "b": [0.2195, 0.6836, 0.238, 0.7022]}, {"w": "(or", "b": [0.244, 0.6836, 0.2717, 0.7022]}, {"w": "your", "b": [0.2777, 0.6836, 0.3213, 0.7022]}, {"w": "favorite", "b": [0.3272, 0.6836, 0.4013, 0.7022]}, {"w": "available", "b": [0.4072, 0.6836, 0.4931, 0.7022]}, {"w": "text", "b": [0.4991, 0.6836, 0.5348, 0.7022]}, {"w": "editor)", "b": [0.5407, 0.6836, 0.6042, 0.7022]}, {"w": "to", "b": [0.6101, 0.6836, 0.6286, 0.7022]}, {"w": "edit", "b": [0.6346, 0.6836, 0.6703, 0.7022]}, {"w": "the", "b": [0.6762, 0.6836, 0.7053, 0.7022]}, {"w": "Jupyter", "b": [0.7113, 0.6836, 0.7813, 0.7022]}, {"w": "config", "b": [0.7873, 0.6836, 0.8481, 0.7022]}, {"w": "file:", "b": [0.1765, 0.7029, 0.2149, 0.7215]}]}, {"id": "b_12", "type": "equation", "text": "$ vi ~/.jupyter/jupyter_notebook_config.py", "words": [{"w": "$", "b": [0.1825, 0.7343, 0.1932, 0.7486]}, {"w": "vi", "b": [0.2039, 0.7343, 0.2253, 0.7486]}, {"w": "~/.jupyter/jupyter_notebook_config.py", "b": [0.236, 0.7343, 0.6323, 0.7486]}]}, {"id": "b_13", "type": "paragraph", "text": "5. The config file is a Python file with all lines commented out. Insert the following lines of Python code at the beginning of the file:", "words": [{"w": "5.", "b": [0.1531, 0.7618, 0.171, 0.7804]}, {"w": "The", "b": [0.1765, 0.7618, 0.2135, 0.7804]}, {"w": "config", "b": [0.2195, 0.7618, 0.2803, 0.7804]}, {"w": "file", "b": [0.2863, 0.7618, 0.318, 0.7804]}, {"w": "is", "b": [0.3239, 0.7618, 0.3398, 0.7804]}, {"w": "a", "b": [0.3458, 0.7618, 0.3563, 0.7804]}, {"w": "Python", "b": [0.3623, 0.7618, 0.4297, 0.7804]}, {"w": "file", "b": [0.4357, 0.7618, 0.4674, 0.7804]}, {"w": "with", "b": [0.4733, 0.7618, 0.5157, 0.7804]}, {"w": "all", "b": [0.5216, 0.7618, 0.5454, 0.7804]}, {"w": "lines", "b": [0.5514, 0.7618, 0.5963, 0.7804]}, {"w": "commented", "b": [0.6023, 0.7618, 0.7133, 0.7804]}, {"w": "out.", "b": [0.7193, 0.7618, 0.7556, 0.7804]}, {"w": "Insert", "b": [0.7616, 0.7618, 0.8158, 0.7804]}, {"w": "the", "b": [0.8217, 0.7618, 0.8508, 0.7804]}, {"w": "following", "b": [0.1765, 0.7811, 0.2691, 0.7998]}, {"w": "lines", "b": [0.275, 0.7811, 0.32, 0.7998]}, {"w": "of", "b": [0.326, 0.7811, 0.3458, 0.7998]}, {"w": "Python", "b": [0.3517, 0.7811, 0.4192, 0.7998]}, {"w": "code", "b": [0.4251, 0.7811, 0.4701, 0.7998]}, {"w": "at", "b": [0.476, 0.7811, 0.4932, 0.7998]}, {"w": "the", "b": [0.4991, 0.7811, 0.5282, 0.7998]}, {"w": "beginning", "b": [0.5342, 0.7811, 0.6294, 0.7998]}, {"w": "of", "b": [0.6353, 0.7811, 0.6551, 0.7998]}, {"w": "the", "b": [0.661, 0.7811, 0.6901, 0.7998]}, {"w": "file:", "b": [0.6961, 0.7811, 0.7344, 0.7998]}]}, {"id": "b_14", "type": "paragraph", "text": "c = get_config() 1 c.NotebookApp.certfile = u'/home/ubuntu/ssl/cert.pem' 2 c.NotebookApp.keyfile = u'/home/ubuntu/ssl/cert.key' 3 c.IPKernelApp.pylab = 'inline'", "words": [{"w": "c", "b": [0.1825, 0.8125, 0.1932, 0.8268]}, {"w": "=", "b": [0.2039, 0.8125, 0.2146, 0.8268]}, {"w": "get_config()", "b": [0.2253, 0.8125, 0.3538, 0.8268]}, {"w": "1", "b": [0.1825, 0.8268, 0.1932, 0.8411]}, {"w": "c.NotebookApp.certfile", "b": [0.1825, 0.8411, 0.4181, 0.8554]}, {"w": "=", "b": [0.4288, 0.8411, 0.4395, 0.8554]}, {"w": "u'/home/ubuntu/ssl/cert.pem'", "b": [0.4502, 0.8411, 0.7501, 0.8554]}, {"w": "2", "b": [0.1825, 0.8554, 0.1932, 0.8697]}, {"w": "c.NotebookApp.keyfile", "b": [0.1825, 0.8697, 0.4074, 0.884]}, {"w": "=", "b": [0.4181, 0.8697, 0.4288, 0.884]}, {"w": "u'/home/ubuntu/ssl/cert.key'", "b": [0.4395, 0.8697, 0.7394, 0.884]}, {"w": "3", "b": [0.1825, 0.884, 0.1932, 0.8983]}, {"w": "c.IPKernelApp.pylab", "b": [0.1825, 0.8983, 0.386, 0.9126]}, {"w": "=", "b": [0.3967, 0.8983, 0.4074, 0.9126]}, {"w": "'inline'", "b": [0.4181, 0.8983, 0.5038, 0.9126]}]}]}, {"page": 450, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "4 c.NotebookApp.ip = '*' 5 c.NotebookApp.open_browser = False 6 c.NotebookApp.password = 7 'sha1:b592a9cf2ec6:b99edb2fd3d0727e336185a0b0eab561aa533a43' 7", "words": [{"w": "4", "b": [0.1825, 0.0851, 0.1932, 0.0994]}, {"w": "c.NotebookApp.ip", "b": [0.1825, 0.0994, 0.3538, 0.1137]}, {"w": "=", "b": [0.3646, 0.0994, 0.3753, 0.1137]}, {"w": "'*'", "b": [0.386, 0.0994, 0.4181, 0.1137]}, {"w": "5", "b": [0.1825, 0.1137, 0.1932, 0.128]}, {"w": "c.NotebookApp.open_browser", "b": [0.1825, 0.1423, 0.4609, 0.1566]}, {"w": "=", "b": [0.4717, 0.1423, 0.4824, 0.1566]}, {"w": "False", "b": [0.4931, 0.1423, 0.5466, 0.1566]}, {"w": "6", "b": [0.1825, 0.1566, 0.1932, 0.1709]}, {"w": "c.NotebookApp.password", "b": [0.1825, 0.1709, 0.4181, 0.1852]}, {"w": "=", "b": [0.4288, 0.1709, 0.4395, 0.1852]}, {"w": "7", "b": [0.1825, 0.1852, 0.1932, 0.1995]}, {"w": "'sha1:b592a9cf2ec6:b99edb2fd3d0727e336185a0b0eab561aa533a43'", "b": [0.2099, 0.2012, 0.8525, 0.2154]}, {"w": "7", "b": [0.1825, 0.2155, 0.1932, 0.2297]}]}, {"id": "b_1", "type": "paragraph", "text": "1 Gets the config object 2 Path to the certificate you generated 3 Path to the private key you generated for the certificate 4 Inline figure when using Matplotlib 5 Serves the notebooks locally 6 Don’t open a browser window by default when using notebooks. 7 Password hash you generated earlier", "words": [{"w": "1", "b": [0.2241, 0.2471, 0.236, 0.2658]}, {"w": "Gets", "b": [0.242, 0.2471, 0.2883, 0.2658]}, {"w": "the", "b": [0.2942, 0.2471, 0.3259, 0.2658]}, {"w": "config", "b": [0.3319, 0.2471, 0.394, 0.2658]}, {"w": "object", "b": [0.4, 0.2471, 0.4621, 0.2658]}, {"w": "2", "b": [0.2241, 0.2665, 0.236, 0.2851]}, {"w": "Path", "b": [0.242, 0.2665, 0.2896, 0.2851]}, {"w": "to", "b": [0.2955, 0.2665, 0.3154, 0.2851]}, {"w": "the", "b": [0.3213, 0.2665, 0.353, 0.2851]}, {"w": "certificate", "b": [0.359, 0.2665, 0.4607, 0.2851]}, {"w": "you", "b": [0.4667, 0.2665, 0.5037, 0.2851]}, {"w": "generated", "b": [0.5097, 0.2665, 0.6101, 0.2851]}, {"w": "3", "b": [0.2241, 0.2858, 0.236, 0.3044]}, {"w": "Path", "b": [0.242, 0.2858, 0.2896, 0.3044]}, {"w": "to", "b": [0.2955, 0.2858, 0.3154, 0.3044]}, {"w": "the", "b": [0.3213, 0.2858, 0.353, 0.3044]}, {"w": "private", "b": [0.359, 0.2858, 0.4317, 0.3044]}, {"w": "key", "b": [0.4376, 0.2858, 0.4733, 0.3044]}, {"w": "you", "b": [0.4793, 0.2858, 0.5163, 0.3044]}, {"w": "generated", "b": [0.5223, 0.2858, 0.6227, 0.3044]}, {"w": "for", "b": [0.6287, 0.2858, 0.6591, 0.3044]}, {"w": "the", "b": [0.665, 0.2858, 0.6968, 0.3044]}, {"w": "certificate", "b": [0.7027, 0.2858, 0.8045, 0.3044]}, {"w": "4", "b": [0.2241, 0.3052, 0.236, 0.3238]}, {"w": "Inline", "b": [0.242, 0.3052, 0.3015, 0.3238]}, {"w": "figure", "b": [0.3075, 0.3052, 0.3678, 0.3238]}, {"w": "when", "b": [0.3738, 0.3052, 0.428, 0.3238]}, {"w": "using", "b": [0.434, 0.3052, 0.4882, 0.3238]}, {"w": "Matplotlib", "b": [0.4941, 0.3052, 0.6026, 0.3238]}, {"w": "5", "b": [0.2241, 0.3245, 0.236, 0.3431]}, {"w": "Serves", "b": [0.242, 0.3245, 0.3081, 0.3431]}, {"w": "the", "b": [0.314, 0.3245, 0.3458, 0.3431]}, {"w": "notebooks", "b": [0.3517, 0.3245, 0.4549, 0.3431]}, {"w": "locally", "b": [0.4608, 0.3245, 0.5269, 0.3431]}, {"w": "6", "b": [0.2241, 0.3438, 0.236, 0.3625]}, {"w": "Don’t", "b": [0.242, 0.3438, 0.3002, 0.3625]}, {"w": "open", "b": [0.3061, 0.3438, 0.355, 0.3625]}, {"w": "a", "b": [0.361, 0.3438, 0.3729, 0.3625]}, {"w": "browser", "b": [0.3788, 0.3438, 0.4617, 0.3625]}, {"w": "window", "b": [0.4676, 0.3438, 0.547, 0.3625]}, {"w": "by", "b": [0.5529, 0.3438, 0.5781, 0.3625]}, {"w": "default", "b": [0.584, 0.3438, 0.6554, 0.3625]}, {"w": "when", "b": [0.6614, 0.3438, 0.7156, 0.3625]}, {"w": "using", "b": [0.7215, 0.3438, 0.7758, 0.3625]}, {"w": "notebooks.", "b": [0.2241, 0.3632, 0.3332, 0.3818]}, {"w": "7", "b": [0.2241, 0.3825, 0.236, 0.4011]}, {"w": "Password", "b": [0.242, 0.3825, 0.3398, 0.4011]}, {"w": "hash", "b": [0.3458, 0.3825, 0.3934, 0.4011]}, {"w": "you", "b": [0.3994, 0.3825, 0.4364, 0.4011]}, {"w": "generated", "b": [0.4423, 0.3825, 0.5428, 0.4011]}, {"w": "earlier", "b": [0.5487, 0.3825, 0.6162, 0.4011]}]}, {"id": "b_2", "type": "paragraph", "text": "Note", "words": [{"w": "Note", "b": [0.1289, 0.4283, 0.1646, 0.4423]}]}, {"id": "b_3", "type": "paragraph", "text": "In case you aren’t accustomed to using vi, remember that you need to press I to begin inserting content. When you’re finished, press Esc, enter :wq, and press Enter to quit vi and save your changes (:wq stands for write-quit).", "words": [{"w": "In", "b": [0.1289, 0.4599, 0.1488, 0.4785]}, {"w": "case", "b": [0.1547, 0.4599, 0.1957, 0.4785]}, {"w": "you", "b": [0.2016, 0.4599, 0.2373, 0.4785]}, {"w": "aren’t", "b": [0.2433, 0.4599, 0.2983, 0.4785]}, {"w": "accustomed", "b": [0.3043, 0.4599, 0.4166, 0.4785]}, {"w": "to", "b": [0.4226, 0.4599, 0.4411, 0.4785]}, {"w": "using", "b": [0.4471, 0.4599, 0.4986, 0.4785]}, {"w": "vi,", "b": [0.5046, 0.4599, 0.529, 0.4785]}, {"w": "remember", "b": [0.535, 0.4599, 0.6315, 0.4785]}, {"w": "that", "b": [0.6374, 0.4599, 0.6731, 0.4785]}, {"w": "you", "b": [0.6791, 0.4599, 0.7148, 0.4785]}, {"w": "need", "b": [0.7207, 0.4599, 0.7657, 0.4785]}, {"w": "to", "b": [0.7716, 0.4599, 0.7901, 0.4785]}, {"w": "press", "b": [0.7961, 0.4599, 0.845, 0.4785]}, {"w": "I", "b": [0.8509, 0.4599, 0.8589, 0.4785]}, {"w": "to", "b": [0.1289, 0.4792, 0.1475, 0.4979]}, {"w": "begin", "b": [0.1534, 0.4792, 0.2063, 0.4979]}, {"w": "inserting", "b": [0.2122, 0.4792, 0.2955, 0.4979]}, {"w": "content.", "b": [0.3015, 0.4792, 0.3775, 0.4979]}, {"w": "When", "b": [0.3835, 0.4792, 0.4403, 0.4979]}, {"w": "you’re", "b": [0.4462, 0.4792, 0.5084, 0.4979]}, {"w": "finished,", "b": [0.5143, 0.4792, 0.5969, 0.4979]}, {"w": "press", "b": [0.6028, 0.4792, 0.6517, 0.4979]}, {"w": "Esc,", "b": [0.6577, 0.4792, 0.698, 0.4979]}, {"w": "enter", "b": [0.7039, 0.4792, 0.7515, 0.4979]}, {"w": ":wq,", "b": [0.7574, 0.4792, 0.8062, 0.4993]}, {"w": "and", "b": [0.8122, 0.4792, 0.8466, 0.4979]}, {"w": "press", "b": [0.1289, 0.4994, 0.1778, 0.518]}, {"w": "Enter", "b": [0.1838, 0.4994, 0.2353, 0.518]}, {"w": "to", "b": [0.2413, 0.4994, 0.2598, 0.518]}, {"w": "quit", "b": [0.2658, 0.4994, 0.3028, 0.518]}, {"w": "vi", "b": [0.3087, 0.4994, 0.3273, 0.518]}, {"w": "and", "b": [0.3332, 0.4994, 0.3676, 0.518]}, {"w": "save", "b": [0.3735, 0.4994, 0.4158, 0.518]}, {"w": "your", "b": [0.4218, 0.4994, 0.4654, 0.518]}, {"w": "changes", "b": [0.4714, 0.4994, 0.548, 0.518]}, {"w": "(:wq", "b": [0.554, 0.4994, 0.6047, 0.5194]}, {"w": "stands", "b": [0.6106, 0.4994, 0.6701, 0.518]}, {"w": "for", "b": [0.6761, 0.4994, 0.7038, 0.518]}, {"w": "write-quit).", "b": [0.7098, 0.4994, 0.8175, 0.518]}]}, {"id": "b_4", "type": "paragraph", "text": "B.4. Installing Keras", "words": [{"w": "B.4.", "b": [0.1289, 0.5791, 0.1736, 0.6001]}, {"w": "Installing", "b": [0.1803, 0.5791, 0.2889, 0.6001]}, {"w": "Keras", "b": [0.2956, 0.5791, 0.364, 0.6001]}]}, {"id": "b_5", "type": "paragraph", "text": "You’re almost ready to start using Jupyter. But first, you need to update Keras. A version of Keras is preinstalled on the AMI, but it may not necessarily be up to date. On the remote instance, run this command:", "words": [{"w": "You’re", "b": [0.1289, 0.6222, 0.194, 0.6408]}, {"w": "almost", "b": [0.1999, 0.6222, 0.2634, 0.6408]}, {"w": "ready", "b": [0.2693, 0.6222, 0.3222, 0.6408]}, {"w": "to", "b": [0.3281, 0.6222, 0.3467, 0.6408]}, {"w": "start", "b": [0.3526, 0.6222, 0.3936, 0.6408]}, {"w": "using", "b": [0.3995, 0.6222, 0.4511, 0.6408]}, {"w": "Jupyter.", "b": [0.4571, 0.6222, 0.5317, 0.6408]}, {"w": "But", "b": [0.5377, 0.6222, 0.5721, 0.6408]}, {"w": "first,", "b": [0.578, 0.6222, 0.6223, 0.6408]}, {"w": "you", "b": [0.6283, 0.6222, 0.664, 0.6408]}, {"w": "need", "b": [0.6699, 0.6222, 0.7149, 0.6408]}, {"w": "to", "b": [0.7208, 0.6222, 0.7393, 0.6408]}, {"w": "update", "b": [0.7453, 0.6222, 0.8087, 0.6408]}, {"w": "Keras.", "b": [0.1289, 0.6415, 0.1904, 0.6602]}, {"w": "A", "b": [0.1963, 0.6415, 0.2135, 0.6602]}, {"w": "version", "b": [0.2195, 0.6415, 0.2895, 0.6602]}, {"w": "of", "b": [0.2955, 0.6415, 0.3153, 0.6602]}, {"w": "Keras", "b": [0.3213, 0.6415, 0.3768, 0.6602]}, {"w": "is", "b": [0.3827, 0.6415, 0.3986, 0.6602]}, {"w": "preinstalled", "b": [0.4045, 0.6415, 0.5156, 0.6602]}, {"w": "on", "b": [0.5215, 0.6415, 0.5453, 0.6602]}, {"w": "the", "b": [0.5513, 0.6415, 0.5804, 0.6602]}, {"w": "AMI,", "b": [0.5863, 0.6415, 0.6385, 0.6602]}, {"w": "but", "b": [0.6445, 0.6415, 0.6749, 0.6602]}, {"w": "it", "b": [0.6808, 0.6415, 0.6941, 0.6602]}, {"w": "may", "b": [0.7, 0.6415, 0.741, 0.6602]}, {"w": "not", "b": [0.7469, 0.6415, 0.7774, 0.6602]}, {"w": "necessarily", "b": [0.1289, 0.6609, 0.2347, 0.6795]}, {"w": "be", "b": [0.2406, 0.6609, 0.2631, 0.6795]}, {"w": "up", "b": [0.269, 0.6609, 0.2928, 0.6795]}, {"w": "to", "b": [0.2988, 0.6609, 0.3173, 0.6795]}, {"w": "date.", "b": [0.3233, 0.6609, 0.3689, 0.6795]}, {"w": "On", "b": [0.3748, 0.6609, 0.4039, 0.6795]}, {"w": "the", "b": [0.4099, 0.6609, 0.4389, 0.6795]}, {"w": "remote", "b": [0.4449, 0.6609, 0.511, 0.6795]}, {"w": "instance,", "b": [0.5169, 0.6609, 0.6009, 0.6795]}, {"w": "run", "b": [0.6068, 0.6609, 0.6385, 0.6795]}, {"w": "this", "b": [0.6445, 0.6609, 0.6789, 0.6795]}, {"w": "command:", "b": [0.6848, 0.6609, 0.7853, 0.6795]}]}, {"id": "b_6", "type": "equation", "text": "$ sudo pip install keras --upgrade", "words": [{"w": "$", "b": [0.1349, 0.6965, 0.1456, 0.7108]}, {"w": "sudo", "b": [0.1563, 0.6965, 0.1991, 0.7108]}, {"w": "pip", "b": [0.2099, 0.6965, 0.242, 0.7108]}, {"w": "install", "b": [0.2527, 0.6965, 0.3277, 0.7108]}, {"w": "keras", "b": [0.3384, 0.6965, 0.3919, 0.7108]}, {"w": "--upgrade", "b": [0.4026, 0.6965, 0.499, 0.7108]}]}, {"id": "b_7", "type": "paragraph", "text": "Because you’ll probably use Python 3 (the notebooks provided with this book use Python 3), you should also update Keras using pip3:", "words": [{"w": "Because", "b": [0.1289, 0.7324, 0.2082, 0.751]}, {"w": "you’ll", "b": [0.2142, 0.7324, 0.271, 0.751]}, {"w": "probably", "b": [0.277, 0.7324, 0.3616, 0.751]}, {"w": "use", "b": [0.3676, 0.7324, 0.3993, 0.751]}, {"w": "Python", "b": [0.4052, 0.7324, 0.4727, 0.751]}, {"w": "3", "b": [0.4786, 0.7324, 0.4905, 0.751]}, {"w": "(the", "b": [0.4965, 0.7324, 0.5335, 0.751]}, {"w": "notebooks", "b": [0.5394, 0.7324, 0.6373, 0.751]}, {"w": "provided", "b": [0.6432, 0.7324, 0.7278, 0.751]}, {"w": "with", "b": [0.7338, 0.7324, 0.7761, 0.751]}, {"w": "this", "b": [0.7821, 0.7324, 0.8165, 0.751]}, {"w": "book", "b": [0.8224, 0.7324, 0.87, 0.751]}, {"w": "use", "b": [0.1289, 0.7517, 0.1607, 0.7703]}, {"w": "Python", "b": [0.1666, 0.7517, 0.2341, 0.7703]}, {"w": "3),", "b": [0.24, 0.7517, 0.2658, 0.7703]}, {"w": "you", "b": [0.2717, 0.7517, 0.3074, 0.7703]}, {"w": "should", "b": [0.3134, 0.7517, 0.3769, 0.7703]}, {"w": "also", "b": [0.3828, 0.7517, 0.4212, 0.7703]}, {"w": "update", "b": [0.4271, 0.7517, 0.4906, 0.7703]}, {"w": "Keras", "b": [0.4965, 0.7517, 0.552, 0.7703]}, {"w": "using", "b": [0.558, 0.7517, 0.6095, 0.7703]}, {"w": "pip3:", "b": [0.6155, 0.7517, 0.6792, 0.7717]}]}, {"id": "b_8", "type": "equation", "text": "$ sudo pip3 install keras --upgrade", "words": [{"w": "$", "b": [0.1349, 0.7881, 0.1456, 0.8024]}, {"w": "sudo", "b": [0.1563, 0.7881, 0.1991, 0.8024]}, {"w": "pip3", "b": [0.2099, 0.7881, 0.2527, 0.8024]}, {"w": "install", "b": [0.2634, 0.7881, 0.3384, 0.8024]}, {"w": "keras", "b": [0.3491, 0.7881, 0.4026, 0.8024]}, {"w": "--upgrade", "b": [0.4133, 0.7881, 0.5097, 0.8024]}]}, {"id": "b_9", "type": "paragraph", "text": "If there’s an existing Keras configuration file on the instance (there shouldn’t be, but the AMI may have changed since I wrote this), you should delete it, just in case. Keras will re-create a standard configuration file when it’s launched for the first time.", "words": [{"w": "If", "b": [0.1289, 0.824, 0.1448, 0.8426]}, {"w": "there’s", "b": [0.1507, 0.824, 0.2142, 0.8426]}, {"w": "an", "b": [0.2201, 0.824, 0.2426, 0.8426]}, {"w": "existing", "b": [0.2485, 0.824, 0.3239, 0.8426]}, {"w": "Keras", "b": [0.3299, 0.824, 0.3854, 0.8426]}, {"w": "configuration", "b": [0.3913, 0.824, 0.5196, 0.8426]}, {"w": "file", "b": [0.5255, 0.824, 0.5572, 0.8426]}, {"w": "on", "b": [0.5632, 0.824, 0.587, 0.8426]}, {"w": "the", "b": [0.5929, 0.824, 0.622, 0.8426]}, {"w": "instance", "b": [0.628, 0.824, 0.706, 0.8426]}, {"w": "(there", "b": [0.7119, 0.824, 0.7674, 0.8426]}, {"w": "shouldn’t", "b": [0.7734, 0.824, 0.8628, 0.8426]}, {"w": "be,", "b": [0.1289, 0.8434, 0.1574, 0.862]}, {"w": "but", "b": [0.1633, 0.8434, 0.1937, 0.862]}, {"w": "the", "b": [0.1997, 0.8434, 0.2288, 0.862]}, {"w": "AMI", "b": [0.2347, 0.8434, 0.281, 0.862]}, {"w": "may", "b": [0.2869, 0.8434, 0.3279, 0.862]}, {"w": "have", "b": [0.3339, 0.8434, 0.3788, 0.862]}, {"w": "changed", "b": [0.3847, 0.8434, 0.464, 0.862]}, {"w": "since", "b": [0.47, 0.8434, 0.5189, 0.862]}, {"w": "I", "b": [0.5249, 0.8434, 0.5328, 0.862]}, {"w": "wrote", "b": [0.5387, 0.8434, 0.5929, 0.862]}, {"w": "this),", "b": [0.5988, 0.8434, 0.6471, 0.862]}, {"w": "you", "b": [0.653, 0.8434, 0.6887, 0.862]}, {"w": "should", "b": [0.6947, 0.8434, 0.7582, 0.862]}, {"w": "delete", "b": [0.7641, 0.8434, 0.8209, 0.862]}, {"w": "it,", "b": [0.8269, 0.8434, 0.8461, 0.862]}, {"w": "just", "b": [0.1289, 0.8627, 0.1633, 0.8813]}, {"w": "in", "b": [0.1693, 0.8627, 0.1878, 0.8813]}, {"w": "case.", "b": [0.1937, 0.8627, 0.2407, 0.8813]}, {"w": "Keras", "b": [0.2466, 0.8627, 0.3021, 0.8813]}, {"w": "will", "b": [0.3081, 0.8627, 0.3451, 0.8813]}, {"w": "re-create", "b": [0.351, 0.8627, 0.4343, 0.8813]}, {"w": "a", "b": [0.4402, 0.8627, 0.4508, 0.8813]}, {"w": "standard", "b": [0.4567, 0.8627, 0.5374, 0.8813]}, {"w": "configuration", "b": [0.5433, 0.8627, 0.6716, 0.8813]}, {"w": "file", "b": [0.6775, 0.8627, 0.7092, 0.8813]}, {"w": "when", "b": [0.7152, 0.8627, 0.7667, 0.8813]}, {"w": "it’s", "b": [0.7727, 0.8627, 0.8017, 0.8813]}, {"w": "launched", "b": [0.1289, 0.882, 0.2149, 0.9007]}, {"w": "for", "b": [0.2208, 0.882, 0.2486, 0.9007]}, {"w": "the", "b": [0.2545, 0.882, 0.2836, 0.9007]}, {"w": "first", "b": [0.2895, 0.882, 0.3279, 0.9007]}, {"w": "time.", "b": [0.3338, 0.882, 0.3821, 0.9007]}]}]}, {"page": 451, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "If the following code snippet returns an error saying that the file doesn’t exist, you can ignore it:", "words": [{"w": "If", "b": [0.1289, 0.0857, 0.1448, 0.1043]}, {"w": "the", "b": [0.1507, 0.0857, 0.1798, 0.1043]}, {"w": "following", "b": [0.1858, 0.0857, 0.2783, 0.1043]}, {"w": "code", "b": [0.2843, 0.0857, 0.3292, 0.1043]}, {"w": "snippet", "b": [0.3352, 0.0857, 0.4039, 0.1043]}, {"w": "returns", "b": [0.4099, 0.0857, 0.476, 0.1043]}, {"w": "an", "b": [0.4819, 0.0857, 0.5044, 0.1043]}, {"w": "error", "b": [0.5103, 0.0857, 0.5566, 0.1043]}, {"w": "saying", "b": [0.5625, 0.0857, 0.6247, 0.1043]}, {"w": "that", "b": [0.6306, 0.0857, 0.6663, 0.1043]}, {"w": "the", "b": [0.6723, 0.0857, 0.7014, 0.1043]}, {"w": "file", "b": [0.7073, 0.0857, 0.739, 0.1043]}, {"w": "doesn’t", "b": [0.745, 0.0857, 0.8145, 0.1043]}, {"w": "exist,", "b": [0.1289, 0.105, 0.1798, 0.1236]}, {"w": "you", "b": [0.1858, 0.105, 0.2215, 0.1236]}, {"w": "can", "b": [0.2274, 0.105, 0.2605, 0.1236]}, {"w": "ignore", "b": [0.2664, 0.105, 0.3272, 0.1236]}, {"w": "it:", "b": [0.3332, 0.105, 0.353, 0.1236]}]}, {"id": "b_1", "type": "equation", "text": "$ rm -f ~/.keras/keras.json", "words": [{"w": "$", "b": [0.1349, 0.1406, 0.1456, 0.1549]}, {"w": "rm", "b": [0.1563, 0.1406, 0.1777, 0.1549]}, {"w": "-f", "b": [0.1884, 0.1406, 0.2099, 0.1549]}, {"w": "~/.keras/keras.json", "b": [0.2206, 0.1406, 0.4241, 0.1549]}]}, {"id": "b_2", "type": "paragraph", "text": "B.5. Setting up local port forwarding", "words": [{"w": "B.5.", "b": [0.1289, 0.1898, 0.1736, 0.2107]}, {"w": "Setting", "b": [0.1803, 0.1898, 0.2606, 0.2107]}, {"w": "up", "b": [0.2673, 0.1898, 0.2971, 0.2107]}, {"w": "local", "b": [0.3038, 0.1898, 0.3573, 0.2107]}, {"w": "port", "b": [0.364, 0.1898, 0.4131, 0.2107]}, {"w": "forwarding", "b": [0.4198, 0.1898, 0.5492, 0.2107]}]}, {"id": "b_3", "type": "paragraph", "text": "In a shell on your local machine (not the remote instance), start forwarding your local port 443 (the HTTPS port) to port 8888 of the remote instance:", "words": [{"w": "In", "b": [0.1289, 0.2328, 0.1488, 0.2515]}, {"w": "a", "b": [0.1547, 0.2328, 0.1653, 0.2515]}, {"w": "shell", "b": [0.1712, 0.2328, 0.2162, 0.2515]}, {"w": "on", "b": [0.2221, 0.2328, 0.2459, 0.2515]}, {"w": "your", "b": [0.2519, 0.2328, 0.2955, 0.2515]}, {"w": "local", "b": [0.3014, 0.2328, 0.349, 0.2515]}, {"w": "machine", "b": [0.355, 0.2328, 0.4356, 0.2515]}, {"w": "(not", "b": [0.4415, 0.2328, 0.4799, 0.2515]}, {"w": "the", "b": [0.4858, 0.2328, 0.5149, 0.2515]}, {"w": "remote", "b": [0.5208, 0.2328, 0.5869, 0.2515]}, {"w": "instance),", "b": [0.5929, 0.2328, 0.6848, 0.2515]}, {"w": "start", "b": [0.6907, 0.2328, 0.7317, 0.2515]}, {"w": "forwarding", "b": [0.7376, 0.2328, 0.8434, 0.2515]}, {"w": "your", "b": [0.1289, 0.2522, 0.1726, 0.2708]}, {"w": "local", "b": [0.1785, 0.2522, 0.2248, 0.2708]}, {"w": "port", "b": [0.2307, 0.2522, 0.2691, 0.2708]}, {"w": "443", "b": [0.275, 0.2522, 0.3107, 0.2708]}, {"w": "(the", "b": [0.3167, 0.2522, 0.3537, 0.2708]}, {"w": "HTTPS", "b": [0.3596, 0.2522, 0.4324, 0.2708]}, {"w": "port)", "b": [0.4383, 0.2522, 0.4846, 0.2708]}, {"w": "to", "b": [0.4905, 0.2522, 0.509, 0.2708]}, {"w": "port", "b": [0.515, 0.2522, 0.5533, 0.2708]}, {"w": "8888", "b": [0.5593, 0.2522, 0.6069, 0.2708]}, {"w": "of", "b": [0.6128, 0.2522, 0.6327, 0.2708]}, {"w": "the", "b": [0.6386, 0.2522, 0.6677, 0.2708]}, {"w": "remote", "b": [0.6737, 0.2522, 0.7397, 0.2708]}, {"w": "instance:", "b": [0.7457, 0.2522, 0.8303, 0.2708]}]}, {"id": "b_4", "type": "paragraph", "text": "$ sudo ssh -i awsKeys.pem -L local_port:local_machine:remote_port remote_machine", "words": [{"w": "$", "b": [0.1349, 0.2878, 0.1456, 0.3021]}, {"w": "sudo", "b": [0.1563, 0.2878, 0.1991, 0.3021]}, {"w": "ssh", "b": [0.2099, 0.2878, 0.242, 0.3021]}, {"w": "-i", "b": [0.2527, 0.2878, 0.2741, 0.3021]}, {"w": "awsKeys.pem", "b": [0.2848, 0.2878, 0.4026, 0.3021]}, {"w": "-L", "b": [0.4133, 0.2878, 0.4348, 0.3021]}, {"w": "local_port:local_machine:remote_port", "b": [0.4455, 0.2878, 0.831, 0.3021]}, {"w": "remote_machine", "b": [0.1349, 0.3021, 0.2848, 0.3164]}]}, {"id": "b_5", "type": "paragraph", "text": "In my case, it would look like the following:", "words": [{"w": "In", "b": [0.1289, 0.338, 0.1488, 0.3566]}, {"w": "my", "b": [0.1547, 0.338, 0.1851, 0.3566]}, {"w": "case,", "b": [0.1911, 0.338, 0.238, 0.3566]}, {"w": "it", "b": [0.2439, 0.338, 0.2572, 0.3566]}, {"w": "would", "b": [0.2631, 0.338, 0.3226, 0.3566]}, {"w": "look", "b": [0.3286, 0.338, 0.3709, 0.3566]}, {"w": "like", "b": [0.3768, 0.338, 0.4125, 0.3566]}, {"w": "the", "b": [0.4185, 0.338, 0.4476, 0.3566]}, {"w": "following:", "b": [0.4535, 0.338, 0.5527, 0.3566]}]}, {"id": "b_6", "type": "equation", "text": "$ sudo ssh -i awsKeys.pem -L", "words": [{"w": "$", "b": [0.1349, 0.3736, 0.1456, 0.3878]}, {"w": "sudo", "b": [0.1563, 0.3736, 0.1991, 0.3878]}, {"w": "ssh", "b": [0.2099, 0.3736, 0.242, 0.3878]}, {"w": "-i", "b": [0.2527, 0.3736, 0.2741, 0.3878]}, {"w": "awsKeys.pem", "b": [0.2848, 0.3736, 0.4026, 0.3878]}, {"w": "-L", "b": [0.4133, 0.3736, 0.4348, 0.3878]}]}, {"id": "b_7", "type": "equation", "text": "443:127.0.0.1:8888 ubuntu@ec2-54-147-126-214.compute- 1.amazonaws.com", "words": [{"w": "443:127.0.0.1:8888", "b": [0.173, 0.3895, 0.3657, 0.4038]}, {"w": "ubuntu@ec2-54-147-126-214.compute-", "b": [0.3765, 0.3895, 0.7406, 0.4038]}, {"w": "1.amazonaws.com", "b": [0.1349, 0.4038, 0.2955, 0.4181]}]}, {"id": "b_8", "type": "paragraph", "text": "B.6. Using Jupyter from your local browser", "words": [{"w": "B.6.", "b": [0.1289, 0.453, 0.1736, 0.4739]}, {"w": "Using", "b": [0.1803, 0.453, 0.2457, 0.4739]}, {"w": "Jupyter", "b": [0.2524, 0.453, 0.3417, 0.4739]}, {"w": "from", "b": [0.3484, 0.453, 0.4044, 0.4739]}, {"w": "your", "b": [0.4111, 0.453, 0.4646, 0.4739]}, {"w": "local", "b": [0.4713, 0.453, 0.5249, 0.4739]}, {"w": "browser", "b": [0.5316, 0.453, 0.6247, 0.4739]}]}, {"id": "b_9", "type": "paragraph", "text": "On the remote instance, clone the GitHub repository containing the Jupyter notebooks associated with this book:", "words": [{"w": "On", "b": [0.1289, 0.496, 0.158, 0.5147]}, {"w": "the", "b": [0.164, 0.496, 0.1931, 0.5147]}, {"w": "remote", "b": [0.199, 0.496, 0.2651, 0.5147]}, {"w": "instance,", "b": [0.271, 0.496, 0.355, 0.5147]}, {"w": "clone", "b": [0.3609, 0.496, 0.4125, 0.5147]}, {"w": "the", "b": [0.4184, 0.496, 0.4475, 0.5147]}, {"w": "GitHub", "b": [0.4535, 0.496, 0.5249, 0.5147]}, {"w": "repository", "b": [0.5308, 0.496, 0.6273, 0.5147]}, {"w": "containing", "b": [0.6333, 0.496, 0.7338, 0.5147]}, {"w": "the", "b": [0.7397, 0.496, 0.7688, 0.5147]}, {"w": "Jupyter", "b": [0.7748, 0.496, 0.8448, 0.5147]}, {"w": "notebooks", "b": [0.1289, 0.5154, 0.2268, 0.534]}, {"w": "associated", "b": [0.2327, 0.5154, 0.3305, 0.534]}, {"w": "with", "b": [0.3365, 0.5154, 0.3788, 0.534]}, {"w": "this", "b": [0.3848, 0.5154, 0.4192, 0.534]}, {"w": "book:", "b": [0.4251, 0.5154, 0.4793, 0.534]}]}, {"id": "b_10", "type": "paragraph", "text": "$ git clone https://github.com/fchollet/deep-learning-with-python- notebooks.git cd deep-learning-with-python-notebooks", "words": [{"w": "$", "b": [0.1349, 0.551, 0.1456, 0.5653]}, {"w": "git", "b": [0.1563, 0.551, 0.1884, 0.5653]}, {"w": "clone", "b": [0.1991, 0.551, 0.2527, 0.5653]}, {"w": "https://github.com/fchollet/deep-learning-with-python-", "b": [0.2634, 0.551, 0.8418, 0.5653]}, {"w": "notebooks.git", "b": [0.1349, 0.5653, 0.2741, 0.5796]}, {"w": "cd", "b": [0.1349, 0.5796, 0.1563, 0.5939]}, {"w": "deep-learning-with-python-notebooks", "b": [0.167, 0.5796, 0.5419, 0.5939]}]}, {"id": "b_11", "type": "paragraph", "text": "Start Jupyter Notebook by running this command, still on the remote instance:", "words": [{"w": "Start", "b": [0.1289, 0.6155, 0.1739, 0.6341]}, {"w": "Jupyter", "b": [0.1798, 0.6155, 0.2499, 0.6341]}, {"w": "Notebook", "b": [0.2559, 0.6155, 0.3497, 0.6341]}, {"w": "by", "b": [0.3557, 0.6155, 0.3795, 0.6341]}, {"w": "running", "b": [0.3854, 0.6155, 0.4595, 0.6341]}, {"w": "this", "b": [0.4654, 0.6155, 0.4998, 0.6341]}, {"w": "command,", "b": [0.5058, 0.6155, 0.6056, 0.6341]}, {"w": "still", "b": [0.6115, 0.6155, 0.6473, 0.6341]}, {"w": "on", "b": [0.6532, 0.6155, 0.677, 0.6341]}, {"w": "the", "b": [0.683, 0.6155, 0.712, 0.6341]}, {"w": "remote", "b": [0.718, 0.6155, 0.7841, 0.6341]}, {"w": "instance:", "b": [0.1289, 0.6348, 0.2135, 0.6534]}]}, {"id": "b_12", "type": "paragraph", "text": "$ jupyter notebook", "words": [{"w": "$", "b": [0.1349, 0.6704, 0.1456, 0.6847]}, {"w": "jupyter", "b": [0.1563, 0.6704, 0.2313, 0.6847]}, {"w": "notebook", "b": [0.242, 0.6704, 0.3277, 0.6847]}]}, {"id": "b_13", "type": "paragraph", "text": "Then, in your local browser, navigate to the local address you’re forwarding to the remote notebook process (https://127.0.0.1). Be sure you use HTTPS in the address, or you’ll get an SSL error.", "words": [{"w": "Then,", "b": [0.1289, 0.7063, 0.1838, 0.7249]}, {"w": "in", "b": [0.1897, 0.7063, 0.2083, 0.7249]}, {"w": "your", "b": [0.2142, 0.7063, 0.2578, 0.7249]}, {"w": "local", "b": [0.2638, 0.7063, 0.3101, 0.7249]}, {"w": "browser,", "b": [0.316, 0.7063, 0.3976, 0.7249]}, {"w": "navigate", "b": [0.4036, 0.7063, 0.4842, 0.7249]}, {"w": "to", "b": [0.4902, 0.7063, 0.5087, 0.7249]}, {"w": "the", "b": [0.5146, 0.7063, 0.5437, 0.7249]}, {"w": "local", "b": [0.5497, 0.7063, 0.5959, 0.7249]}, {"w": "address", "b": [0.6019, 0.7063, 0.6733, 0.7249]}, {"w": "you’re", "b": [0.6792, 0.7063, 0.7413, 0.7249]}, {"w": "forwarding", "b": [0.7473, 0.7063, 0.853, 0.7249]}, {"w": "to", "b": [0.1289, 0.7256, 0.1475, 0.7443]}, {"w": "the", "b": [0.1534, 0.7256, 0.1825, 0.7443]}, {"w": "remote", "b": [0.1884, 0.7256, 0.2545, 0.7443]}, {"w": "notebook", "b": [0.2605, 0.7256, 0.3491, 0.7443]}, {"w": "process", "b": [0.355, 0.7256, 0.4264, 0.7443]}, {"w": "(https://127.0.0.1).", "b": [0.4323, 0.7256, 0.6095, 0.7443]}, {"w": "Be", "b": [0.6154, 0.7256, 0.6419, 0.7443]}, {"w": "sure", "b": [0.6478, 0.7256, 0.6875, 0.7443]}, {"w": "you", "b": [0.6934, 0.7256, 0.7291, 0.7443]}, {"w": "use", "b": [0.7351, 0.7256, 0.7668, 0.7443]}, {"w": "HTTPS", "b": [0.7727, 0.7256, 0.8455, 0.7443]}, {"w": "in", "b": [0.8514, 0.7256, 0.8699, 0.7443]}, {"w": "the", "b": [0.1289, 0.745, 0.158, 0.7636]}, {"w": "address,", "b": [0.164, 0.745, 0.2413, 0.7636]}, {"w": "or", "b": [0.2472, 0.745, 0.2671, 0.7636]}, {"w": "you’ll", "b": [0.273, 0.745, 0.3299, 0.7636]}, {"w": "get", "b": [0.3358, 0.745, 0.3649, 0.7636]}, {"w": "an", "b": [0.3709, 0.745, 0.3933, 0.7636]}, {"w": "SSL", "b": [0.3993, 0.745, 0.4403, 0.7636]}, {"w": "error.", "b": [0.4462, 0.745, 0.4971, 0.7636]}]}, {"id": "b_14", "type": "paragraph", "text": "You should see the safety warning shown in figure B.7. This warning is due to the fact that the SSL certificate you generated isn’t verified by a trusted authority (obviously—you generated your own). Click Advanced, and proceed to navigate.", "words": [{"w": "You", "b": [0.1289, 0.7853, 0.1675, 0.804]}, {"w": "should", "b": [0.1735, 0.7853, 0.237, 0.804]}, {"w": "see", "b": [0.2429, 0.7853, 0.2733, 0.804]}, {"w": "the", "b": [0.2793, 0.7853, 0.3083, 0.804]}, {"w": "safety", "b": [0.3143, 0.7853, 0.3711, 0.804]}, {"w": "warning", "b": [0.3771, 0.7853, 0.4551, 0.804]}, {"w": "shown", "b": [0.461, 0.7853, 0.5232, 0.804]}, {"w": "in", "b": [0.5291, 0.7853, 0.5476, 0.804]}, {"w": "figure", "b": [0.5535, 0.7853, 0.6104, 0.804]}, {"w": "B.7.", "b": [0.6163, 0.7853, 0.656, 0.804]}, {"w": "This", "b": [0.6619, 0.7853, 0.7043, 0.804]}, {"w": "warning", "b": [0.7102, 0.7853, 0.7882, 0.804]}, {"w": "is", "b": [0.7942, 0.7853, 0.81, 0.804]}, {"w": "due", "b": [0.816, 0.7853, 0.8504, 0.804]}, {"w": "to", "b": [0.1289, 0.8047, 0.1475, 0.8233]}, {"w": "the", "b": [0.1534, 0.8047, 0.1825, 0.8233]}, {"w": "fact", "b": [0.1884, 0.8047, 0.2241, 0.8233]}, {"w": "that", "b": [0.2301, 0.8047, 0.2658, 0.8233]}, {"w": "the", "b": [0.2717, 0.8047, 0.3008, 0.8233]}, {"w": "SSL", "b": [0.3067, 0.8047, 0.3478, 0.8233]}, {"w": "certificate", "b": [0.3537, 0.8047, 0.4489, 0.8233]}, {"w": "you", "b": [0.4548, 0.8047, 0.4905, 0.8233]}, {"w": "generated", "b": [0.4965, 0.8047, 0.589, 0.8233]}, {"w": "isn’t", "b": [0.5949, 0.8047, 0.6367, 0.8233]}, {"w": "verified", "b": [0.6427, 0.8047, 0.7167, 0.8233]}, {"w": "by", "b": [0.7226, 0.8047, 0.7464, 0.8233]}, {"w": "a", "b": [0.7524, 0.8047, 0.763, 0.8233]}, {"w": "trusted", "b": [0.7689, 0.8047, 0.8337, 0.8233]}, {"w": "authority", "b": [0.1289, 0.824, 0.2149, 0.8426]}, {"w": "(obviously—you", "b": [0.2208, 0.824, 0.3821, 0.8426]}, {"w": "generated", "b": [0.3881, 0.824, 0.4806, 0.8426]}, {"w": "your", "b": [0.4865, 0.824, 0.5301, 0.8426]}, {"w": "own).", "b": [0.5361, 0.824, 0.591, 0.8426]}, {"w": "Click", "b": [0.5969, 0.824, 0.6485, 0.8426]}, {"w": "Advanced,", "b": [0.6544, 0.824, 0.7569, 0.8426]}, {"w": "and", "b": [0.7628, 0.824, 0.7972, 0.8426]}, {"w": "proceed", "b": [0.1289, 0.8434, 0.2043, 0.862]}, {"w": "to", "b": [0.2102, 0.8434, 0.2287, 0.862]}, {"w": "navigate.", "b": [0.2347, 0.8434, 0.3213, 0.862]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure B.7. A safety warning you can ignore", "words": [{"w": "Figure", "b": [0.1289, 0.8791, 0.1792, 0.893]}, {"w": "B.7.", "b": [0.1836, 0.8791, 0.2134, 0.893]}, {"w": "A", "b": [0.2179, 0.8791, 0.2307, 0.893]}, {"w": "safety", "b": [0.2352, 0.8791, 0.2798, 0.893]}, {"w": "warning", "b": [0.2843, 0.8791, 0.3477, 0.893]}, {"w": "you", "b": [0.3522, 0.8791, 0.38, 0.893]}, {"w": "can", "b": [0.3844, 0.8791, 0.4112, 0.893]}, {"w": "ignore", "b": [0.4157, 0.8791, 0.464, 0.893]}]}]}, {"page": 452, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "You should be prompted to enter your Jupyter password. You’ll then arrive at the Jupyter dashboard (see figure B.8).", "words": [{"w": "You", "b": [0.1289, 0.3674, 0.1675, 0.386]}, {"w": "should", "b": [0.1735, 0.3674, 0.237, 0.386]}, {"w": "be", "b": [0.2429, 0.3674, 0.2654, 0.386]}, {"w": "prompted", "b": [0.2713, 0.3674, 0.3626, 0.386]}, {"w": "to", "b": [0.3685, 0.3674, 0.387, 0.386]}, {"w": "enter", "b": [0.393, 0.3674, 0.4406, 0.386]}, {"w": "your", "b": [0.4465, 0.3674, 0.4901, 0.386]}, {"w": "Jupyter", "b": [0.4961, 0.3674, 0.5661, 0.386]}, {"w": "password.", "b": [0.5721, 0.3674, 0.6679, 0.386]}, {"w": "You’ll", "b": [0.6739, 0.3674, 0.7336, 0.386]}, {"w": "then", "b": [0.7396, 0.3674, 0.7806, 0.386]}, {"w": "arrive", "b": [0.7865, 0.3674, 0.842, 0.386]}, {"w": "at", "b": [0.848, 0.3674, 0.8651, 0.386]}, {"w": "the", "b": [0.1289, 0.3867, 0.158, 0.4054]}, {"w": "Jupyter", "b": [0.164, 0.3867, 0.234, 0.4054]}, {"w": "dashboard", "b": [0.24, 0.3867, 0.3378, 0.4054]}, {"w": "(see", "b": [0.3438, 0.3867, 0.3821, 0.4054]}, {"w": "figure", "b": [0.388, 0.3867, 0.4448, 0.4054]}, {"w": "B.8).", "b": [0.4508, 0.3867, 0.4984, 0.4054]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure B.8. The Jupyter dashboard", "words": [{"w": "Figure", "b": [0.1289, 0.4224, 0.1792, 0.4364]}, {"w": "B.8.", "b": [0.1836, 0.4224, 0.2134, 0.4364]}, {"w": "The", "b": [0.2179, 0.4224, 0.2476, 0.4364]}, {"w": "Jupyter", "b": [0.2521, 0.4224, 0.3116, 0.4364]}, {"w": "dashboard", "b": [0.316, 0.4224, 0.3974, 0.4364]}]}, {"id": "b_2", "type": "paragraph", "text": "Choose New > Notebook to get started (see figure B.9). You can use the Python version of your choice. All set!", "words": [{"w": "Choose", "b": [0.1289, 0.565, 0.2003, 0.5836]}, {"w": "New", "b": [0.2063, 0.565, 0.2512, 0.5836]}, {"w": ">", "b": [0.2572, 0.565, 0.2706, 0.5836]}, {"w": "Notebook", "b": [0.2765, 0.565, 0.3704, 0.5836]}, {"w": "to", "b": [0.3764, 0.565, 0.3949, 0.5836]}, {"w": "get", "b": [0.4008, 0.565, 0.4299, 0.5836]}, {"w": "started", "b": [0.4359, 0.565, 0.4993, 0.5836]}, {"w": "(see", "b": [0.5053, 0.565, 0.5436, 0.5836]}, {"w": "figure", "b": [0.5495, 0.565, 0.6063, 0.5836]}, {"w": "B.9).", "b": [0.6123, 0.565, 0.6599, 0.5836]}, {"w": "You", "b": [0.6658, 0.565, 0.7044, 0.5836]}, {"w": "can", "b": [0.7104, 0.565, 0.7434, 0.5836]}, {"w": "use", "b": [0.7494, 0.565, 0.7811, 0.5836]}, {"w": "the", "b": [0.787, 0.565, 0.8161, 0.5836]}, {"w": "Python", "b": [0.1289, 0.5843, 0.1964, 0.603]}, {"w": "version", "b": [0.2023, 0.5843, 0.2724, 0.603]}, {"w": "of", "b": [0.2784, 0.5843, 0.2982, 0.603]}, {"w": "your", "b": [0.3041, 0.5843, 0.3478, 0.603]}, {"w": "choice.", "b": [0.3537, 0.5843, 0.4218, 0.603]}, {"w": "All", "b": [0.4277, 0.5843, 0.4581, 0.603]}, {"w": "set!", "b": [0.4641, 0.5843, 0.4985, 0.603]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure B.9. Create a new notebook.", "words": [{"w": "Figure", "b": [0.1289, 0.62, 0.1792, 0.634]}, {"w": "B.9.", "b": [0.1836, 0.62, 0.2134, 0.634]}, {"w": "Create", "b": [0.2179, 0.62, 0.2691, 0.634]}, {"w": "a", "b": [0.2735, 0.62, 0.2825, 0.634]}, {"w": "new", "b": [0.2869, 0.62, 0.3177, 0.634]}, {"w": "notebook.", "b": [0.3221, 0.62, 0.397, 0.634]}]}]}, {"page": 453, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Index", "words": [{"w": "Index", "b": [0.1294, 0.1076, 0.2168, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "[SYMBOL][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y] [Z]", "words": [{"w": "[SYMBOL][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y]", "b": [0.1294, 0.1538, 0.8518, 0.1686]}, {"w": "[Z]", "b": [0.1294, 0.169, 0.1535, 0.1838]}]}, {"id": "b_2", "type": "paragraph", "text": "SYMBOL", "words": [{"w": "SYMBOL", "b": [0.1294, 0.2114, 0.2387, 0.2311]}]}, {"id": "b_3", "type": "paragraph", "text": "* operator + operator 0D tensors. See scalars. 1D convolutions 1D pooling, for sequence data 1D tensors. See vectors. 2D tensors. See matrices. 3D embeddings", "words": [{"w": "*", "b": [0.1294, 0.2492, 0.1389, 0.264]}, {"w": "operator", "b": [0.1436, 0.2492, 0.2066, 0.264]}, {"w": "+", "b": [0.1294, 0.2652, 0.1401, 0.28]}, {"w": "operator", "b": [0.1448, 0.2652, 0.2079, 0.28]}, {"w": "0D", "b": [0.1294, 0.2813, 0.1525, 0.2961]}, {"w": "tensors.", "b": [0.1573, 0.2813, 0.2222, 0.2972]}, {"w": "See", "b": [0.1748, 0.2972, 0.2089, 0.3124]}, {"w": "scalars.", "b": [0.2202, 0.2972, 0.311, 0.3124]}, {"w": "1D", "b": [0.1294, 0.3125, 0.1525, 0.3273]}, {"w": "convolutions", "b": [0.1573, 0.3125, 0.255, 0.3273]}, {"w": "1D", "b": [0.1294, 0.3285, 0.1525, 0.3433]}, {"w": "pooling,", "b": [0.1573, 0.3285, 0.2198, 0.3433]}, {"w": "for", "b": [0.2245, 0.3285, 0.2466, 0.3433]}, {"w": "sequence", "b": [0.2513, 0.3285, 0.3207, 0.3433]}, {"w": "data", "b": [0.3254, 0.3285, 0.3569, 0.3433]}, {"w": "1D", "b": [0.1294, 0.3446, 0.1525, 0.3594]}, {"w": "tensors.", "b": [0.1573, 0.3446, 0.2222, 0.3605]}, {"w": "See", "b": [0.1748, 0.3605, 0.2089, 0.3756]}, {"w": "vectors.", "b": [0.2202, 0.3605, 0.311, 0.3756]}, {"w": "2D", "b": [0.1294, 0.3758, 0.1525, 0.3906]}, {"w": "tensors.", "b": [0.1573, 0.3758, 0.2222, 0.3917]}, {"w": "See", "b": [0.1748, 0.3917, 0.2089, 0.4068]}, {"w": "matrices.", "b": [0.2202, 0.3917, 0.3224, 0.4068]}, {"w": "3D", "b": [0.1294, 0.407, 0.1525, 0.4218]}, {"w": "embeddings", "b": [0.1573, 0.407, 0.2487, 0.4218]}]}, {"id": "b_5", "type": "paragraph", "text": "activation activation functions ad targeting add_loss method ADMM (alternating direction method of multipliers) adversarial networks.", "words": [{"w": "activation", "b": [0.1294, 0.4872, 0.204, 0.502]}, {"w": "activation", "b": [0.1294, 0.5032, 0.204, 0.518]}, {"w": "functions", "b": [0.2088, 0.5032, 0.2792, 0.518]}, {"w": "ad", "b": [0.1294, 0.5193, 0.1473, 0.5341]}, {"w": "targeting", "b": [0.152, 0.5193, 0.2189, 0.5341]}, {"w": "add_loss", "b": [0.1294, 0.5353, 0.1956, 0.5501]}, {"w": "method", "b": [0.2004, 0.5353, 0.2571, 0.5501]}, {"w": "ADMM", "b": [0.1294, 0.5513, 0.1904, 0.5662]}, {"w": "(alternating", "b": [0.1951, 0.5513, 0.2823, 0.5662]}, {"w": "direction", "b": [0.287, 0.5513, 0.3543, 0.5662]}, {"w": "method", "b": [0.359, 0.5513, 0.4158, 0.5662]}, {"w": "of", "b": [0.4205, 0.5513, 0.4363, 0.5662]}, {"w": "multipliers)", "b": [0.441, 0.5513, 0.5293, 0.5662]}, {"w": "adversarial", "b": [0.1294, 0.5674, 0.2124, 0.5822]}, {"w": "networks.", "b": [0.2171, 0.5674, 0.2978, 0.5833]}]}, {"id": "b_6", "type": "paragraph", "text": "See also generative deep learning; ; generative adversarial networks. adversary network affine transformations Amazon Web Services. See AWS. AMD Analytical Engine annotations, 2nd application program interfaces.", "words": [{"w": "See", "b": [0.1748, 0.5833, 0.2089, 0.5985]}, {"w": "also", "b": [0.2202, 0.5833, 0.2656, 0.5985]}, {"w": "generative", "b": [0.277, 0.5833, 0.3905, 0.5985]}, {"w": "deep", "b": [0.4019, 0.5833, 0.4473, 0.5985]}, {"w": "learning;", "b": [0.4586, 0.5833, 0.5608, 0.5985]}, {"w": ";", "b": [0.5721, 0.5833, 0.5835, 0.5985]}, {"w": "generative", "b": [0.5948, 0.5833, 0.7083, 0.5985]}, {"w": "adversarial", "b": [0.7197, 0.5833, 0.8446, 0.5985]}, {"w": "networks.", "b": [0.1294, 0.5985, 0.2316, 0.6136]}, {"w": "adversary", "b": [0.1294, 0.6137, 0.203, 0.6285]}, {"w": "network", "b": [0.2077, 0.6137, 0.2697, 0.6285]}, {"w": "affine", "b": [0.1294, 0.6298, 0.1732, 0.6446]}, {"w": "transformations", "b": [0.1779, 0.6298, 0.2967, 0.6446]}, {"w": "Amazon", "b": [0.1294, 0.6458, 0.1935, 0.6606]}, {"w": "Web", "b": [0.1982, 0.6458, 0.2324, 0.6606]}, {"w": "Services.", "b": [0.2372, 0.6458, 0.3126, 0.6618]}, {"w": "See", "b": [0.1748, 0.6618, 0.2089, 0.6769]}, {"w": "AWS.", "b": [0.2202, 0.6618, 0.2656, 0.6769]}, {"w": "AMD", "b": [0.1294, 0.677, 0.1736, 0.6918]}, {"w": "Analytical", "b": [0.1294, 0.6931, 0.2082, 0.7079]}, {"w": "Engine", "b": [0.213, 0.6931, 0.2666, 0.7079]}, {"w": "annotations,", "b": [0.1294, 0.7091, 0.228, 0.725]}, {"w": "2nd", "b": [0.2393, 0.7091, 0.2593, 0.7239]}, {"w": "application", "b": [0.1294, 0.7252, 0.2135, 0.74]}, {"w": "program", "b": [0.2182, 0.7252, 0.2823, 0.74]}, {"w": "interfaces.", "b": [0.287, 0.7252, 0.3719, 0.7411]}]}, {"id": "b_7", "type": "paragraph", "text": "See functional APIs. architecture of networks", "words": [{"w": "See", "b": [0.1748, 0.7411, 0.2089, 0.7562]}, {"w": "functional", "b": [0.2202, 0.7411, 0.3337, 0.7562]}, {"w": "APIs.", "b": [0.3451, 0.7411, 0.4019, 0.7562]}, {"w": "architecture", "b": [0.1294, 0.7564, 0.2187, 0.7712]}, {"w": "of", "b": [0.2234, 0.7564, 0.2392, 0.7712]}, {"w": "networks", "b": [0.2439, 0.7564, 0.3133, 0.7712]}]}, {"id": "b_8", "type": "paragraph", "text": "convnets densely connected networks", "words": [{"w": "convnets", "b": [0.1521, 0.7715, 0.2194, 0.7863]}, {"w": "densely", "b": [0.1521, 0.7875, 0.2099, 0.8024]}, {"w": "connected", "b": [0.2146, 0.7875, 0.2913, 0.8024]}, {"w": "networks", "b": [0.2961, 0.7875, 0.3654, 0.8024]}]}, {"id": "b_9", "type": "paragraph", "text": "recurrent neural networks architecture patterns of models batch normalization depthwise separable convolution", "words": [{"w": "recurrent", "b": [0.1521, 0.8036, 0.2204, 0.8184]}, {"w": "neural", "b": [0.2251, 0.8036, 0.2724, 0.8184]}, {"w": "networks", "b": [0.2771, 0.8036, 0.3465, 0.8184]}, {"w": "architecture", "b": [0.1294, 0.8196, 0.2187, 0.8344]}, {"w": "patterns", "b": [0.2234, 0.8196, 0.2833, 0.8344]}, {"w": "of", "b": [0.2881, 0.8196, 0.3038, 0.8344]}, {"w": "models", "b": [0.3086, 0.8196, 0.3632, 0.8344]}, {"w": "batch", "b": [0.1521, 0.8348, 0.1931, 0.8496]}, {"w": "normalization", "b": [0.1978, 0.8348, 0.3029, 0.8496]}, {"w": "depthwise", "b": [0.1521, 0.8508, 0.2288, 0.8656]}, {"w": "separable", "b": [0.2336, 0.8508, 0.305, 0.8656]}, {"w": "convolution", "b": [0.3097, 0.8508, 0.4001, 0.8656]}]}, {"id": "b_10", "type": "paragraph", "text": "residual connections, 2nd arrow of time", "words": [{"w": "residual", "b": [0.1521, 0.8695, 0.212, 0.8844]}, {"w": "connections,", "b": [0.2167, 0.8695, 0.3184, 0.8855]}, {"w": "2nd", "b": [0.3298, 0.8669, 0.354, 0.8844]}, {"w": "arrow", "b": [0.1294, 0.8856, 0.1735, 0.9004]}, {"w": "of", "b": [0.1783, 0.8856, 0.194, 0.9004]}, {"w": "time", "b": [0.1988, 0.8856, 0.2324, 0.9004]}]}]}, {"page": 454, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "artificial intelligence, 2nd", "words": [{"w": "artificial", "b": [0.1294, 0.0852, 0.1935, 0.1]}, {"w": "intelligence,", "b": [0.1982, 0.0852, 0.2978, 0.1011]}, {"w": "2nd", "b": [0.3092, 0.0851, 0.3291, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "expectations for history of arXiv preprint server, 2nd assembling datasets augmented intelligence augmenting data", "words": [{"w": "expectations", "b": [0.1521, 0.1012, 0.2467, 0.116]}, {"w": "for", "b": [0.2514, 0.1012, 0.2735, 0.116]}, {"w": "history", "b": [0.1521, 0.1173, 0.2047, 0.1321]}, {"w": "of", "b": [0.2094, 0.1173, 0.2252, 0.1321]}, {"w": "arXiv", "b": [0.1294, 0.1333, 0.1725, 0.1481]}, {"w": "preprint", "b": [0.1772, 0.1333, 0.2371, 0.1481]}, {"w": "server,", "b": [0.2418, 0.1333, 0.2994, 0.1493]}, {"w": "2nd", "b": [0.3107, 0.1333, 0.3307, 0.1481]}, {"w": "assembling", "b": [0.1294, 0.1494, 0.2145, 0.1642]}, {"w": "datasets", "b": [0.2193, 0.1494, 0.2792, 0.1642]}, {"w": "augmented", "b": [0.1294, 0.1654, 0.2124, 0.1802]}, {"w": "intelligence", "b": [0.2172, 0.1654, 0.3054, 0.1802]}, {"w": "augmenting", "b": [0.1294, 0.1815, 0.2187, 0.1963]}, {"w": "data", "b": [0.2235, 0.1815, 0.255, 0.1963]}]}, {"id": "b_2", "type": "paragraph", "text": "feature extraction with", "words": [{"w": "feature", "b": [0.1521, 0.1966, 0.2046, 0.2114]}, {"w": "extraction", "b": [0.2094, 0.1966, 0.285, 0.2114]}, {"w": "with", "b": [0.2898, 0.1966, 0.3234, 0.2114]}]}, {"id": "b_3", "type": "paragraph", "text": "feature extraction without autoencoders.", "words": [{"w": "feature", "b": [0.1521, 0.2126, 0.2046, 0.2275]}, {"w": "extraction", "b": [0.2094, 0.2126, 0.285, 0.2275]}, {"w": "without", "b": [0.2898, 0.2126, 0.3476, 0.2275]}, {"w": "autoencoders.", "b": [0.1294, 0.2287, 0.2406, 0.2446]}]}, {"id": "b_4", "type": "paragraph", "text": "See VAEs (variational autoencoders). AutoML systems autonomous driving AWS (Amazon Web Services)", "words": [{"w": "See", "b": [0.1748, 0.2446, 0.2089, 0.2598]}, {"w": "VAEs", "b": [0.2202, 0.2446, 0.2656, 0.2598]}, {"w": "(variational", "b": [0.277, 0.2446, 0.4132, 0.2598]}, {"w": "autoencoders).", "b": [0.4246, 0.2446, 0.5835, 0.2598]}, {"w": "AutoML", "b": [0.1294, 0.2599, 0.1956, 0.2747]}, {"w": "systems", "b": [0.2004, 0.2599, 0.2603, 0.2747]}, {"w": "autonomous", "b": [0.1294, 0.2759, 0.2219, 0.2907]}, {"w": "driving", "b": [0.2266, 0.2759, 0.2813, 0.2907]}, {"w": "AWS", "b": [0.1294, 0.292, 0.1699, 0.3068]}, {"w": "(Amazon", "b": [0.1747, 0.292, 0.2451, 0.3068]}, {"w": "Web", "b": [0.2498, 0.292, 0.284, 0.3068]}, {"w": "Services)", "b": [0.2887, 0.292, 0.3591, 0.3068]}]}, {"id": "b_5", "type": "paragraph", "text": "GPU instances", "words": [{"w": "GPU", "b": [0.1521, 0.307, 0.1862, 0.3222]}, {"w": "instances", "b": [0.1975, 0.307, 0.2997, 0.3222]}]}, {"id": "b_6", "type": "paragraph", "text": "running Jupyter on setting up", "words": [{"w": "running", "b": [0.1748, 0.3223, 0.2337, 0.3371]}, {"w": "Jupyter", "b": [0.2384, 0.3223, 0.2941, 0.3371]}, {"w": "on", "b": [0.2988, 0.3223, 0.3178, 0.3371]}, {"w": "setting", "b": [0.1748, 0.3383, 0.2253, 0.3531]}, {"w": "up", "b": [0.23, 0.3383, 0.2489, 0.3531]}]}, {"id": "b_7", "type": "paragraph", "text": "using Jupyter on", "words": [{"w": "using", "b": [0.1521, 0.3544, 0.1931, 0.3692]}, {"w": "Jupyter", "b": [0.1978, 0.3544, 0.2535, 0.3692]}, {"w": "on", "b": [0.2583, 0.3544, 0.2772, 0.3692]}]}, {"id": "b_9", "type": "paragraph", "text": "Babbage, Charles backend engine, Keras backpropagation algorithm, 2nd, 3rd backward pass bag-of-2-grams bag-of-3-grams bag-of-words Baidu batch axis batch normalization BatchNormalization layer batch_size Bengio, Yoshua, 2nd, 3rd bidirectional layers binary classifications, 2nd binary crossentropy, 2nd black boxes BLAS (Basic Linear Algebra Subprograms), 2nd border effects broadcasting operations browsers, local, using Jupyter from", "words": [{"w": "Babbage,", "b": [0.1294, 0.4355, 0.2003, 0.4503]}, {"w": "Charles", "b": [0.2051, 0.4355, 0.2629, 0.4503]}, {"w": "backend", "b": [0.1294, 0.4515, 0.1925, 0.4663]}, {"w": "engine,", "b": [0.1972, 0.4515, 0.2523, 0.4663]}, {"w": "Keras", "b": [0.2571, 0.4515, 0.3012, 0.4663]}, {"w": "backpropagation", "b": [0.1294, 0.4676, 0.2555, 0.4824]}, {"w": "algorithm,", "b": [0.2602, 0.4676, 0.3451, 0.4835]}, {"w": "2nd,", "b": [0.3565, 0.4675, 0.3878, 0.4835]}, {"w": "3rd", "b": [0.3992, 0.4675, 0.4174, 0.4824]}, {"w": "backward", "b": [0.1294, 0.4836, 0.203, 0.4984]}, {"w": "pass", "b": [0.2077, 0.4836, 0.2403, 0.4984]}, {"w": "bag-of-2-grams", "b": [0.1294, 0.4997, 0.2471, 0.5145]}, {"w": "bag-of-3-grams", "b": [0.1294, 0.5157, 0.2471, 0.5305]}, {"w": "bag-of-words", "b": [0.1294, 0.5317, 0.2313, 0.5465]}, {"w": "Baidu", "b": [0.1294, 0.5478, 0.1746, 0.5626]}, {"w": "batch", "b": [0.1294, 0.5638, 0.1704, 0.5786]}, {"w": "axis", "b": [0.1751, 0.5638, 0.2056, 0.5786]}, {"w": "batch", "b": [0.1294, 0.5799, 0.1704, 0.5947]}, {"w": "normalization", "b": [0.1751, 0.5799, 0.2802, 0.5947]}, {"w": "BatchNormalization", "b": [0.1294, 0.5959, 0.2828, 0.6107]}, {"w": "layer", "b": [0.2876, 0.5959, 0.3254, 0.6107]}, {"w": "batch_size", "b": [0.1294, 0.612, 0.2093, 0.6268]}, {"w": "Bengio,", "b": [0.1294, 0.628, 0.1888, 0.6428]}, {"w": "Yoshua,", "b": [0.1935, 0.628, 0.2608, 0.6439]}, {"w": "2nd,", "b": [0.2721, 0.628, 0.3035, 0.6439]}, {"w": "3rd", "b": [0.3148, 0.628, 0.333, 0.6428]}, {"w": "bidirectional", "b": [0.1294, 0.644, 0.225, 0.6589]}, {"w": "layers", "b": [0.2298, 0.644, 0.275, 0.6589]}, {"w": "binary", "b": [0.1294, 0.6601, 0.1778, 0.6749]}, {"w": "classifications,", "b": [0.1825, 0.6601, 0.301, 0.676]}, {"w": "2nd", "b": [0.3123, 0.66, 0.3323, 0.6749]}, {"w": "binary", "b": [0.1294, 0.6761, 0.1778, 0.6909]}, {"w": "crossentropy,", "b": [0.1825, 0.6761, 0.2905, 0.6921]}, {"w": "2nd", "b": [0.3018, 0.6761, 0.3218, 0.6909]}, {"w": "black", "b": [0.1294, 0.6922, 0.1704, 0.707]}, {"w": "boxes", "b": [0.1751, 0.6922, 0.2193, 0.707]}, {"w": "BLAS", "b": [0.1294, 0.7082, 0.1778, 0.723]}, {"w": "(Basic", "b": [0.1825, 0.7082, 0.2308, 0.723]}, {"w": "Linear", "b": [0.2356, 0.7082, 0.2849, 0.723]}, {"w": "Algebra", "b": [0.2897, 0.7082, 0.3506, 0.723]}, {"w": "Subprograms),", "b": [0.3553, 0.7082, 0.4739, 0.7241]}, {"w": "2nd", "b": [0.4852, 0.7082, 0.5052, 0.723]}, {"w": "border", "b": [0.1294, 0.7243, 0.1788, 0.7391]}, {"w": "effects", "b": [0.1835, 0.7243, 0.2336, 0.7391]}, {"w": "broadcasting", "b": [0.1294, 0.7403, 0.2261, 0.7551]}, {"w": "operations", "b": [0.2308, 0.7403, 0.3096, 0.7551]}, {"w": "browsers,", "b": [0.1294, 0.7564, 0.2024, 0.7712]}, {"w": "local,", "b": [0.2072, 0.7564, 0.2487, 0.7712]}, {"w": "using", "b": [0.2534, 0.7564, 0.2944, 0.7712]}, {"w": "Jupyter", "b": [0.2991, 0.7564, 0.3548, 0.7712]}, {"w": "from", "b": [0.3596, 0.7564, 0.3963, 0.7712]}]}, {"id": "b_11", "type": "paragraph", "text": "callbacks, writing CAM (class activation map) categorical encoding categorical_crossentropy function, 2nd, 3rd", "words": [{"w": "callbacks,", "b": [0.1294, 0.8366, 0.2045, 0.8514]}, {"w": "writing", "b": [0.2093, 0.8366, 0.2639, 0.8514]}, {"w": "CAM", "b": [0.1294, 0.8526, 0.1725, 0.8674]}, {"w": "(class", "b": [0.1772, 0.8526, 0.2203, 0.8674]}, {"w": "activation", "b": [0.225, 0.8526, 0.2997, 0.8674]}, {"w": "map)", "b": [0.3044, 0.8526, 0.3433, 0.8674]}, {"w": "categorical", "b": [0.1294, 0.8687, 0.2124, 0.8835]}, {"w": "encoding", "b": [0.2171, 0.8687, 0.2865, 0.8835]}, {"w": "categorical_crossentropy", "b": [0.1294, 0.8847, 0.3185, 0.8995]}, {"w": "function,", "b": [0.3233, 0.8847, 0.3977, 0.9006]}, {"w": "2nd,", "b": [0.409, 0.8847, 0.4403, 0.9006]}, {"w": "3rd", "b": [0.4517, 0.8847, 0.4699, 0.8995]}]}]}, {"page": 455, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "CERN channels axis channels-first convention channels-last convention character-level neural language model Ciresan, Dan, 2nd class activation, visualizing heatmaps of classes, 2nd classification cloud, running jobs in clustering CNNs.", "words": [{"w": "CERN", "b": [0.1294, 0.0852, 0.1799, 0.1]}, {"w": "channels", "b": [0.1294, 0.1012, 0.1956, 0.116]}, {"w": "axis", "b": [0.2003, 0.1012, 0.2308, 0.116]}, {"w": "channels-first", "b": [0.1294, 0.1173, 0.2324, 0.1321]}, {"w": "convention", "b": [0.2371, 0.1173, 0.3212, 0.1321]}, {"w": "channels-last", "b": [0.1294, 0.1333, 0.2282, 0.1481]}, {"w": "convention", "b": [0.2329, 0.1333, 0.317, 0.1481]}, {"w": "character-level", "b": [0.1294, 0.1494, 0.2414, 0.1642]}, {"w": "neural", "b": [0.2461, 0.1494, 0.2934, 0.1642]}, {"w": "language", "b": [0.2982, 0.1494, 0.3665, 0.1642]}, {"w": "model", "b": [0.3712, 0.1494, 0.4185, 0.1642]}, {"w": "Ciresan,", "b": [0.1294, 0.1654, 0.1919, 0.1802]}, {"w": "Dan,", "b": [0.1967, 0.1654, 0.2395, 0.1813]}, {"w": "2nd", "b": [0.2509, 0.1654, 0.2708, 0.1802]}, {"w": "class", "b": [0.1294, 0.1815, 0.1662, 0.1963]}, {"w": "activation,", "b": [0.1709, 0.1815, 0.2503, 0.1963]}, {"w": "visualizing", "b": [0.255, 0.1815, 0.338, 0.1963]}, {"w": "heatmaps", "b": [0.3428, 0.1815, 0.4142, 0.1963]}, {"w": "of", "b": [0.419, 0.1815, 0.4347, 0.1963]}, {"w": "classes,", "b": [0.1294, 0.1975, 0.1933, 0.2134]}, {"w": "2nd", "b": [0.2046, 0.1974, 0.2246, 0.2123]}, {"w": "classification", "b": [0.1294, 0.2135, 0.2292, 0.2283]}, {"w": "cloud,", "b": [0.1294, 0.2296, 0.1762, 0.2444]}, {"w": "running", "b": [0.1809, 0.2296, 0.2398, 0.2444]}, {"w": "jobs", "b": [0.2445, 0.2296, 0.276, 0.2444]}, {"w": "in", "b": [0.2808, 0.2296, 0.2955, 0.2444]}, {"w": "clustering", "b": [0.1294, 0.2456, 0.204, 0.2604]}, {"w": "CNNs.", "b": [0.1294, 0.2617, 0.1881, 0.2776]}]}, {"id": "b_1", "type": "paragraph", "text": "See convnets (convolutional neural networks). CNTK (Microsoft Cognitive Toolkit) compilation step concept vectors, for editing images conditioning data Connect button, EC2 control panel connections, residual content loss Conv1D layer Conv2D layer, 2nd, 3rd convnets (convolutional neural networks) 1D combining with recurrent neural networks", "words": [{"w": "See", "b": [0.1748, 0.2776, 0.2089, 0.2928]}, {"w": "convnets", "b": [0.2202, 0.2776, 0.311, 0.2928]}, {"w": "(convolutional", "b": [0.3224, 0.2776, 0.4813, 0.2928]}, {"w": "neural", "b": [0.4927, 0.2776, 0.5608, 0.2928]}, {"w": "networks).", "b": [0.5721, 0.2776, 0.6856, 0.2928]}, {"w": "CNTK", "b": [0.1294, 0.2929, 0.1809, 0.3077]}, {"w": "(Microsoft", "b": [0.1856, 0.2929, 0.2666, 0.3077]}, {"w": "Cognitive", "b": [0.2713, 0.2929, 0.3459, 0.3077]}, {"w": "Toolkit)", "b": [0.3507, 0.2929, 0.4113, 0.3077]}, {"w": "compilation", "b": [0.1294, 0.3089, 0.2198, 0.3237]}, {"w": "step", "b": [0.2245, 0.3089, 0.255, 0.3237]}, {"w": "concept", "b": [0.1294, 0.325, 0.1883, 0.3398]}, {"w": "vectors,", "b": [0.193, 0.325, 0.2523, 0.3398]}, {"w": "for", "b": [0.2571, 0.325, 0.2791, 0.3398]}, {"w": "editing", "b": [0.2839, 0.325, 0.3364, 0.3398]}, {"w": "images", "b": [0.3412, 0.325, 0.3948, 0.3398]}, {"w": "conditioning", "b": [0.1294, 0.341, 0.2251, 0.3558]}, {"w": "data", "b": [0.2298, 0.341, 0.2613, 0.3558]}, {"w": "Connect", "b": [0.1294, 0.357, 0.1925, 0.3718]}, {"w": "button,", "b": [0.1972, 0.357, 0.2503, 0.3718]}, {"w": "EC2", "b": [0.255, 0.357, 0.2887, 0.3718]}, {"w": "control", "b": [0.2934, 0.357, 0.347, 0.3718]}, {"w": "panel", "b": [0.3517, 0.357, 0.3927, 0.3718]}, {"w": "connections,", "b": [0.1294, 0.3731, 0.2245, 0.3879]}, {"w": "residual", "b": [0.2292, 0.3731, 0.2891, 0.3879]}, {"w": "content", "b": [0.1294, 0.3891, 0.1851, 0.4039]}, {"w": "loss", "b": [0.1898, 0.3891, 0.2193, 0.4039]}, {"w": "Conv1D", "b": [0.1294, 0.4052, 0.1935, 0.42]}, {"w": "layer", "b": [0.1983, 0.4052, 0.2361, 0.42]}, {"w": "Conv2D", "b": [0.1294, 0.4212, 0.1935, 0.436]}, {"w": "layer,", "b": [0.1983, 0.4212, 0.2474, 0.4371]}, {"w": "2nd,", "b": [0.2588, 0.4212, 0.2901, 0.4371]}, {"w": "3rd", "b": [0.3014, 0.4212, 0.3197, 0.436]}, {"w": "convnets", "b": [0.1294, 0.4373, 0.1967, 0.4521]}, {"w": "(convolutional", "b": [0.2014, 0.4373, 0.3118, 0.4521]}, {"w": "neural", "b": [0.3165, 0.4373, 0.3638, 0.4521]}, {"w": "networks)", "b": [0.3685, 0.4373, 0.4442, 0.4521]}, {"w": "1D", "b": [0.1521, 0.4524, 0.1752, 0.4672]}, {"w": "combining", "b": [0.1521, 0.4685, 0.2331, 0.4833]}, {"w": "with", "b": [0.2378, 0.4685, 0.2714, 0.4833]}, {"w": "recurrent", "b": [0.2762, 0.4685, 0.3444, 0.4833]}, {"w": "neural", "b": [0.3492, 0.4685, 0.3964, 0.4833]}, {"w": "networks", "b": [0.4012, 0.4685, 0.4705, 0.4833]}]}, {"id": "b_2", "type": "paragraph", "text": "overview", "words": [{"w": "overview", "b": [0.1521, 0.4845, 0.2225, 0.4993]}]}, {"id": "b_3", "type": "equation", "text": "convolution operations max-pooling operations", "words": [{"w": "convolution", "b": [0.1748, 0.5005, 0.2652, 0.5154]}, {"w": "operations", "b": [0.2699, 0.5005, 0.3488, 0.5154]}, {"w": "max-pooling", "b": [0.1748, 0.5166, 0.2715, 0.5314]}, {"w": "operations", "b": [0.2762, 0.5166, 0.3551, 0.5314]}]}, {"id": "b_4", "type": "paragraph", "text": "processing sequences with", "words": [{"w": "processing", "b": [0.1521, 0.5326, 0.233, 0.5474]}, {"w": "sequences", "b": [0.2378, 0.5326, 0.3145, 0.5474]}, {"w": "with", "b": [0.3192, 0.5326, 0.3528, 0.5474]}]}, {"id": "b_5", "type": "paragraph", "text": "training on small datasets", "words": [{"w": "training", "b": [0.1521, 0.5487, 0.211, 0.5635]}, {"w": "on", "b": [0.2157, 0.5487, 0.2346, 0.5635]}, {"w": "small", "b": [0.2394, 0.5487, 0.2804, 0.5635]}, {"w": "datasets", "b": [0.2851, 0.5487, 0.345, 0.5635]}]}, {"id": "b_6", "type": "paragraph", "text": "building networks", "words": [{"w": "building", "b": [0.1748, 0.5647, 0.2379, 0.5795]}, {"w": "networks", "b": [0.2426, 0.5647, 0.312, 0.5795]}]}, {"id": "b_7", "type": "paragraph", "text": "data preprocessing", "words": [{"w": "data", "b": [0.1748, 0.5808, 0.2063, 0.5956]}, {"w": "preprocessing", "b": [0.2111, 0.5808, 0.3161, 0.5956]}]}, {"id": "b_8", "type": "equation", "text": "relevance for small-data problems", "words": [{"w": "relevance", "b": [0.1748, 0.5968, 0.2473, 0.6116]}, {"w": "for", "b": [0.252, 0.5968, 0.2741, 0.6116]}, {"w": "small-data", "b": [0.2788, 0.5968, 0.3576, 0.6116]}, {"w": "problems", "b": [0.3624, 0.5968, 0.4328, 0.6116]}]}, {"id": "b_9", "type": "paragraph", "text": "using data augmentation", "words": [{"w": "using", "b": [0.1748, 0.6129, 0.2158, 0.6277]}, {"w": "data", "b": [0.2205, 0.6129, 0.2521, 0.6277]}, {"w": "augmentation", "b": [0.2568, 0.6129, 0.3598, 0.6277]}]}, {"id": "b_10", "type": "paragraph", "text": "using pretrained convnets", "words": [{"w": "using", "b": [0.1521, 0.6289, 0.1931, 0.6437]}, {"w": "pretrained", "b": [0.1978, 0.6289, 0.2745, 0.6437]}, {"w": "convnets", "b": [0.2793, 0.6289, 0.3465, 0.6437]}]}, {"id": "b_11", "type": "paragraph", "text": "feature extraction", "words": [{"w": "feature", "b": [0.1748, 0.6449, 0.2273, 0.6597]}, {"w": "extraction", "b": [0.2321, 0.6449, 0.3077, 0.6597]}]}, {"id": "b_12", "type": "equation", "text": "fine-tuning", "words": [{"w": "fine-tuning", "b": [0.1748, 0.661, 0.2589, 0.6758]}]}, {"id": "b_13", "type": "paragraph", "text": "visualizing convnet learning", "words": [{"w": "visualizing", "b": [0.1521, 0.677, 0.2352, 0.6918]}, {"w": "convnet", "b": [0.2399, 0.677, 0.2998, 0.6918]}, {"w": "learning", "b": [0.3045, 0.677, 0.3665, 0.6918]}]}, {"id": "b_14", "type": "paragraph", "text": "convnet filters", "words": [{"w": "convnet", "b": [0.1748, 0.6931, 0.2347, 0.7079]}, {"w": "filters", "b": [0.2394, 0.6931, 0.2836, 0.7079]}]}, {"id": "b_15", "type": "paragraph", "text": "heatmaps of class activation", "words": [{"w": "heatmaps", "b": [0.1748, 0.7091, 0.2463, 0.7239]}, {"w": "of", "b": [0.251, 0.7091, 0.2668, 0.7239]}, {"w": "class", "b": [0.2715, 0.7091, 0.3083, 0.7239]}, {"w": "activation", "b": [0.313, 0.7091, 0.3876, 0.7239]}]}, {"id": "b_16", "type": "paragraph", "text": "intermediate activations convnets filters convolution base convolution operations", "words": [{"w": "intermediate", "b": [0.1748, 0.7252, 0.2694, 0.74]}, {"w": "activations", "b": [0.2741, 0.7252, 0.3561, 0.74]}, {"w": "convnets", "b": [0.1294, 0.7412, 0.1967, 0.756]}, {"w": "filters", "b": [0.2014, 0.7412, 0.2455, 0.756]}, {"w": "convolution", "b": [0.1294, 0.7572, 0.2198, 0.772]}, {"w": "base", "b": [0.2245, 0.7572, 0.2582, 0.772]}, {"w": "convolution", "b": [0.1294, 0.7733, 0.2198, 0.7881]}, {"w": "operations", "b": [0.2245, 0.7733, 0.3034, 0.7881]}]}, {"id": "b_17", "type": "paragraph", "text": "border effects", "words": [{"w": "border", "b": [0.1521, 0.7884, 0.2015, 0.8032]}, {"w": "effects", "b": [0.2062, 0.7884, 0.2563, 0.8032]}]}, {"id": "b_18", "type": "paragraph", "text": "convolution strides", "words": [{"w": "convolution", "b": [0.1521, 0.8045, 0.2425, 0.8193]}, {"w": "strides", "b": [0.2472, 0.8045, 0.2966, 0.8193]}]}, {"id": "b_19", "type": "paragraph", "text": "paddling convolution strides convolutions 1D", "words": [{"w": "paddling", "b": [0.1521, 0.8205, 0.2183, 0.8353]}, {"w": "convolution", "b": [0.1294, 0.8366, 0.2198, 0.8514]}, {"w": "strides", "b": [0.2245, 0.8366, 0.2739, 0.8514]}, {"w": "convolutions", "b": [0.1294, 0.8677, 0.2656, 0.8828]}, {"w": "1D", "b": [0.1521, 0.8829, 0.1752, 0.8977]}]}]}, {"page": 456, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "depthwise separable Cortes, Corinna crossentropy CUDA drivers, 2nd, 3rd cuDNN library, 2nd, 3rd curvature", "words": [{"w": "depthwise", "b": [0.1521, 0.0852, 0.2288, 0.1]}, {"w": "separable", "b": [0.2336, 0.0852, 0.305, 0.1]}, {"w": "Cortes,", "b": [0.1294, 0.1012, 0.1835, 0.116]}, {"w": "Corinna", "b": [0.1883, 0.1012, 0.2492, 0.116]}, {"w": "crossentropy", "b": [0.1294, 0.1173, 0.2261, 0.1321]}, {"w": "CUDA", "b": [0.1294, 0.1333, 0.183, 0.1481]}, {"w": "drivers,", "b": [0.1877, 0.1333, 0.2516, 0.1493]}, {"w": "2nd,", "b": [0.263, 0.1333, 0.2943, 0.1493]}, {"w": "3rd", "b": [0.3056, 0.1333, 0.3238, 0.1481]}, {"w": "cuDNN", "b": [0.1294, 0.1494, 0.1883, 0.1642]}, {"w": "library,", "b": [0.193, 0.1494, 0.2548, 0.1653]}, {"w": "2nd,", "b": [0.2661, 0.1493, 0.2974, 0.1653]}, {"w": "3rd", "b": [0.3088, 0.1493, 0.327, 0.1642]}, {"w": "curvature", "b": [0.1294, 0.1654, 0.2009, 0.1802]}]}, {"id": "b_2", "type": "paragraph", "text": "data", "words": [{"w": "data", "b": [0.1294, 0.2758, 0.1748, 0.291]}]}, {"id": "b_3", "type": "paragraph", "text": "augmenting feature extraction with", "words": [{"w": "augmenting", "b": [0.1521, 0.2911, 0.2415, 0.3059]}, {"w": "feature", "b": [0.1748, 0.3071, 0.2273, 0.3219]}, {"w": "extraction", "b": [0.2321, 0.3071, 0.3077, 0.3219]}, {"w": "with", "b": [0.3125, 0.3071, 0.3461, 0.3219]}]}, {"id": "b_4", "type": "paragraph", "text": "feature extraction without", "words": [{"w": "feature", "b": [0.1748, 0.3232, 0.2273, 0.338]}, {"w": "extraction", "b": [0.2321, 0.3232, 0.3077, 0.338]}, {"w": "without", "b": [0.3125, 0.3232, 0.3703, 0.338]}]}, {"id": "b_5", "type": "paragraph", "text": "batches of generating sequence data", "words": [{"w": "batches", "b": [0.1521, 0.3392, 0.2089, 0.354]}, {"w": "of", "b": [0.2136, 0.3392, 0.2293, 0.354]}, {"w": "generating", "b": [0.1521, 0.3553, 0.232, 0.3701]}, {"w": "sequence", "b": [0.2367, 0.3553, 0.306, 0.3701]}, {"w": "data", "b": [0.3108, 0.3553, 0.3423, 0.3701]}]}, {"id": "b_6", "type": "paragraph", "text": "heterogeneous", "words": [{"w": "heterogeneous", "b": [0.1521, 0.3713, 0.2614, 0.3861]}]}, {"id": "b_7", "type": "paragraph", "text": "homogenous learning representations from", "words": [{"w": "homogenous", "b": [0.1521, 0.3873, 0.2488, 0.4022]}, {"w": "learning", "b": [0.1521, 0.4034, 0.2141, 0.4182]}, {"w": "representations", "b": [0.2188, 0.4034, 0.3334, 0.4182]}, {"w": "from", "b": [0.3381, 0.4034, 0.3749, 0.4182]}]}, {"id": "b_8", "type": "paragraph", "text": "missing", "words": [{"w": "missing", "b": [0.1521, 0.4194, 0.211, 0.4342]}]}, {"id": "b_9", "type": "equation", "text": "preparing for character-level LSTM text generation", "words": [{"w": "preparing", "b": [0.1521, 0.4355, 0.2246, 0.4503]}, {"w": "for", "b": [0.1748, 0.4515, 0.1969, 0.4663]}, {"w": "character-level", "b": [0.2016, 0.4515, 0.3136, 0.4663]}, {"w": "LSTM", "b": [0.3183, 0.4515, 0.3688, 0.4663]}, {"w": "text", "b": [0.3735, 0.4515, 0.4019, 0.4663]}, {"w": "generation", "b": [0.4066, 0.4515, 0.4865, 0.4663]}]}, {"id": "b_10", "type": "paragraph", "text": "for recurrent neural networks", "words": [{"w": "for", "b": [0.1748, 0.4676, 0.1969, 0.4824]}, {"w": "recurrent", "b": [0.2016, 0.4676, 0.2699, 0.4824]}, {"w": "neural", "b": [0.2746, 0.4676, 0.3219, 0.4824]}, {"w": "networks", "b": [0.3266, 0.4676, 0.396, 0.4824]}]}, {"id": "b_11", "type": "paragraph", "text": "preprocessing, 2nd", "words": [{"w": "preprocessing,", "b": [0.1521, 0.4863, 0.2685, 0.5022]}, {"w": "2nd", "b": [0.2799, 0.4836, 0.304, 0.5011]}]}, {"id": "b_12", "type": "paragraph", "text": "redundancy representations for neural networks", "words": [{"w": "redundancy", "b": [0.1521, 0.5023, 0.2404, 0.5171]}, {"w": "representations", "b": [0.1521, 0.5184, 0.2667, 0.5332]}, {"w": "for", "b": [0.2714, 0.5184, 0.2934, 0.5332]}, {"w": "neural", "b": [0.2982, 0.5184, 0.3455, 0.5332]}, {"w": "networks", "b": [0.3502, 0.5184, 0.4195, 0.5332]}]}, {"id": "b_13", "type": "paragraph", "text": "3D tensors data batches examples of data tensors", "words": [{"w": "3D", "b": [0.1748, 0.5344, 0.1979, 0.5492]}, {"w": "tensors", "b": [0.2027, 0.5344, 0.2563, 0.5492]}, {"w": "data", "b": [0.1748, 0.5505, 0.2063, 0.5653]}, {"w": "batches", "b": [0.2111, 0.5505, 0.2678, 0.5653]}, {"w": "examples", "b": [0.1748, 0.5665, 0.2463, 0.5813]}, {"w": "of", "b": [0.251, 0.5665, 0.2668, 0.5813]}, {"w": "data", "b": [0.2715, 0.5665, 0.303, 0.5813]}, {"w": "tensors", "b": [0.3077, 0.5665, 0.3613, 0.5813]}]}, {"id": "b_14", "type": "equation", "text": "higher-dimensional tensors image data key attributes of tensors", "words": [{"w": "higher-dimensional", "b": [0.1748, 0.5825, 0.3216, 0.5974]}, {"w": "tensors", "b": [0.3263, 0.5825, 0.3799, 0.5974]}, {"w": "image", "b": [0.1748, 0.5986, 0.2211, 0.6134]}, {"w": "data", "b": [0.2258, 0.5986, 0.2573, 0.6134]}, {"w": "key", "b": [0.1748, 0.6146, 0.2021, 0.6294]}, {"w": "attributes", "b": [0.2069, 0.6146, 0.2773, 0.6294]}, {"w": "of", "b": [0.282, 0.6146, 0.2978, 0.6294]}, {"w": "tensors", "b": [0.3025, 0.6146, 0.3561, 0.6294]}]}, {"id": "b_15", "type": "paragraph", "text": "manipulating tensors in Numpy matrices (2D tensors) scalars (0D tensors)", "words": [{"w": "manipulating", "b": [0.1748, 0.6307, 0.2747, 0.6455]}, {"w": "tensors", "b": [0.2794, 0.6307, 0.333, 0.6455]}, {"w": "in", "b": [0.3377, 0.6307, 0.3525, 0.6455]}, {"w": "Numpy", "b": [0.3572, 0.6307, 0.4139, 0.6455]}, {"w": "matrices", "b": [0.1748, 0.6467, 0.2389, 0.6615]}, {"w": "(2D", "b": [0.2436, 0.6467, 0.2731, 0.6615]}, {"w": "tensors)", "b": [0.2778, 0.6467, 0.3377, 0.6615]}, {"w": "scalars", "b": [0.1748, 0.6628, 0.2263, 0.6776]}, {"w": "(0D", "b": [0.231, 0.6628, 0.2604, 0.6776]}, {"w": "tensors)", "b": [0.2652, 0.6628, 0.3251, 0.6776]}]}, {"id": "b_16", "type": "paragraph", "text": "sequence data timeseries data", "words": [{"w": "sequence", "b": [0.1748, 0.6788, 0.2442, 0.6936]}, {"w": "data", "b": [0.2489, 0.6788, 0.2804, 0.6936]}, {"w": "timeseries", "b": [0.1748, 0.6949, 0.2515, 0.7097]}, {"w": "data", "b": [0.2563, 0.6949, 0.2878, 0.7097]}]}, {"id": "b_17", "type": "paragraph", "text": "vector data", "words": [{"w": "vector", "b": [0.1748, 0.7109, 0.2221, 0.7257]}, {"w": "data", "b": [0.2268, 0.7109, 0.2583, 0.7257]}]}, {"id": "b_18", "type": "paragraph", "text": "vectors (1D tensors) video data", "words": [{"w": "vectors", "b": [0.1748, 0.7269, 0.2295, 0.7417]}, {"w": "(1D", "b": [0.2342, 0.7269, 0.2636, 0.7417]}, {"w": "tensors)", "b": [0.2683, 0.7269, 0.3282, 0.7417]}, {"w": "video", "b": [0.1748, 0.743, 0.2169, 0.7578]}, {"w": "data", "b": [0.2216, 0.743, 0.2531, 0.7578]}]}, {"id": "b_19", "type": "paragraph", "text": "shuffling, 2nd", "words": [{"w": "shuffling,", "b": [0.1521, 0.7617, 0.2314, 0.7776]}, {"w": "2nd", "b": [0.2428, 0.759, 0.267, 0.7765]}]}, {"id": "b_20", "type": "paragraph", "text": "splitting tokenizing transformations", "words": [{"w": "splitting", "b": [0.1521, 0.7777, 0.2142, 0.7925]}, {"w": "tokenizing", "b": [0.1521, 0.7938, 0.232, 0.8086]}, {"w": "transformations", "b": [0.1521, 0.8098, 0.2709, 0.8246]}]}, {"id": "b_21", "type": "paragraph", "text": "transforming vectorization data augmentation data distillation data points, 2nd", "words": [{"w": "transforming", "b": [0.1521, 0.8259, 0.2499, 0.8407]}, {"w": "vectorization", "b": [0.1521, 0.8419, 0.2509, 0.8567]}, {"w": "data", "b": [0.1294, 0.858, 0.1609, 0.8728]}, {"w": "augmentation", "b": [0.1657, 0.858, 0.2687, 0.8728]}, {"w": "data", "b": [0.1294, 0.874, 0.1609, 0.8888]}, {"w": "distillation", "b": [0.1657, 0.874, 0.2466, 0.8888]}, {"w": "data", "b": [0.1294, 0.89, 0.1609, 0.9049]}, {"w": "points,", "b": [0.1657, 0.89, 0.2232, 0.906]}, {"w": "2nd", "b": [0.2346, 0.89, 0.2546, 0.9049]}]}]}, {"page": 457, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "data representativeness data tensors, examples of datasets, assembling DCGANs (deep convolutional GANs) overview training decision boundaries decision trees deep convnets deep learning, 2nd", "words": [{"w": "data", "b": [0.1294, 0.0852, 0.1609, 0.1]}, {"w": "representativeness", "b": [0.1657, 0.0852, 0.3044, 0.1]}, {"w": "data", "b": [0.1294, 0.1012, 0.1609, 0.116]}, {"w": "tensors,", "b": [0.1657, 0.1012, 0.224, 0.116]}, {"w": "examples", "b": [0.2287, 0.1012, 0.3002, 0.116]}, {"w": "of", "b": [0.3049, 0.1012, 0.3207, 0.116]}, {"w": "datasets,", "b": [0.1294, 0.1173, 0.194, 0.1321]}, {"w": "assembling", "b": [0.1988, 0.1173, 0.2839, 0.1321]}, {"w": "DCGANs", "b": [0.1294, 0.1484, 0.1975, 0.1635]}, {"w": "(deep", "b": [0.2089, 0.1484, 0.2656, 0.1635]}, {"w": "convolutional", "b": [0.277, 0.1484, 0.4246, 0.1635]}, {"w": "GANs)", "b": [0.4359, 0.1484, 0.4927, 0.1635]}, {"w": "overview", "b": [0.1521, 0.1636, 0.2225, 0.1784]}, {"w": "training", "b": [0.1521, 0.1797, 0.211, 0.1945]}, {"w": "decision", "b": [0.1294, 0.1957, 0.1925, 0.2105]}, {"w": "boundaries", "b": [0.1972, 0.1957, 0.2802, 0.2105]}, {"w": "decision", "b": [0.1294, 0.2118, 0.1925, 0.2266]}, {"w": "trees", "b": [0.1972, 0.2118, 0.2329, 0.2266]}, {"w": "deep", "b": [0.1294, 0.2278, 0.1651, 0.2426]}, {"w": "convnets", "b": [0.1699, 0.2278, 0.2371, 0.2426]}, {"w": "deep", "b": [0.1294, 0.2438, 0.1651, 0.2587]}, {"w": "learning,", "b": [0.1699, 0.2438, 0.2432, 0.2598]}, {"w": "2nd", "b": [0.2545, 0.2438, 0.2745, 0.2587]}]}, {"id": "b_1", "type": "paragraph", "text": "accomplishments of", "words": [{"w": "accomplishments", "b": [0.1521, 0.2599, 0.2835, 0.2747]}, {"w": "of", "b": [0.2882, 0.2599, 0.304, 0.2747]}]}, {"id": "b_2", "type": "paragraph", "text": "achievements of", "words": [{"w": "achievements", "b": [0.1521, 0.2759, 0.2551, 0.2907]}, {"w": "of", "b": [0.2598, 0.2759, 0.2756, 0.2907]}]}, {"id": "b_3", "type": "paragraph", "text": "democratization of enabling technologies", "words": [{"w": "democratization", "b": [0.1521, 0.292, 0.274, 0.3068]}, {"w": "of", "b": [0.2787, 0.292, 0.2945, 0.3068]}, {"w": "enabling", "b": [0.1521, 0.308, 0.2173, 0.3228]}, {"w": "technologies", "b": [0.222, 0.308, 0.3176, 0.3228]}]}, {"id": "b_4", "type": "paragraph", "text": "future of, 2nd", "words": [{"w": "future", "b": [0.1521, 0.3267, 0.1973, 0.3415]}, {"w": "of,", "b": [0.202, 0.3267, 0.2291, 0.3427]}, {"w": "2nd", "b": [0.2405, 0.324, 0.2646, 0.3415]}]}, {"id": "b_5", "type": "equation", "text": "automated machine learning lifelong learning long-term vision", "words": [{"w": "automated", "b": [0.1748, 0.3428, 0.2536, 0.3576]}, {"w": "machine", "b": [0.2584, 0.3428, 0.3225, 0.3576]}, {"w": "learning", "b": [0.3272, 0.3428, 0.3892, 0.3576]}, {"w": "lifelong", "b": [0.1748, 0.3588, 0.2337, 0.3736]}, {"w": "learning", "b": [0.2384, 0.3588, 0.3004, 0.3736]}, {"w": "long-term", "b": [0.1748, 0.3749, 0.2494, 0.3897]}, {"w": "vision", "b": [0.2542, 0.3749, 0.3004, 0.3897]}]}, {"id": "b_6", "type": "paragraph", "text": "models as programs modular subroutine reuse geometric interpretation of", "words": [{"w": "models", "b": [0.1748, 0.3909, 0.2295, 0.4057]}, {"w": "as", "b": [0.2342, 0.3909, 0.25, 0.4057]}, {"w": "programs", "b": [0.2547, 0.3909, 0.3262, 0.4057]}, {"w": "modular", "b": [0.1748, 0.407, 0.2379, 0.4218]}, {"w": "subroutine", "b": [0.2426, 0.407, 0.3225, 0.4218]}, {"w": "reuse", "b": [0.3272, 0.407, 0.3671, 0.4218]}, {"w": "geometric", "b": [0.1521, 0.423, 0.2278, 0.4378]}, {"w": "interpretation", "b": [0.2325, 0.423, 0.3344, 0.4378]}, {"w": "of", "b": [0.3392, 0.423, 0.3549, 0.4378]}]}, {"id": "b_7", "type": "paragraph", "text": "hardware and investment in limitations of", "words": [{"w": "hardware", "b": [0.1521, 0.439, 0.2225, 0.4538]}, {"w": "and", "b": [0.2272, 0.439, 0.2545, 0.4538]}, {"w": "investment", "b": [0.1521, 0.4551, 0.2352, 0.4699]}, {"w": "in", "b": [0.2399, 0.4551, 0.2546, 0.4699]}, {"w": "limitations", "b": [0.1521, 0.4711, 0.2331, 0.4859]}, {"w": "of", "b": [0.2378, 0.4711, 0.2536, 0.4859]}]}, {"id": "b_8", "type": "paragraph", "text": "local generalization vs. extreme generalization risk of anthropomorphizing machine-learning models overview, 2nd", "words": [{"w": "local", "b": [0.1748, 0.4872, 0.2116, 0.502]}, {"w": "generalization", "b": [0.2163, 0.4872, 0.3235, 0.502]}, {"w": "vs.", "b": [0.3282, 0.4872, 0.3498, 0.502]}, {"w": "extreme", "b": [0.3545, 0.4872, 0.4155, 0.502]}, {"w": "generalization", "b": [0.4202, 0.4872, 0.5274, 0.502]}, {"w": "risk", "b": [0.1748, 0.5032, 0.2032, 0.518]}, {"w": "of", "b": [0.2079, 0.5032, 0.2237, 0.518]}, {"w": "anthropomorphizing", "b": [0.2284, 0.5032, 0.3829, 0.518]}, {"w": "machine-learning", "b": [0.3876, 0.5032, 0.52, 0.518]}, {"w": "models", "b": [0.5248, 0.5032, 0.5794, 0.518]}, {"w": "overview,", "b": [0.1521, 0.5219, 0.2338, 0.5379]}, {"w": "2nd", "b": [0.2452, 0.5192, 0.2694, 0.5367]}]}, {"id": "b_9", "type": "paragraph", "text": "possible uses of reasons for interest in. See also generative deep learning. Deep Learning AMI, EC2 DeepDream technique overview implementing in Keras DeepMind, Google, 2nd Dense layers, 2nd, 3rd, 4th, 5th, 6th, 7th, 8th dense sampling densely connected networks depthwise separable convolution derivatives, defined developer account, NVIDIA digital assistants dimension dimensionality, 2nd directed acyclic graphs of layers inception modules residual connections discriminator networks", "words": [{"w": "possible", "b": [0.1521, 0.538, 0.2141, 0.5528]}, {"w": "uses", "b": [0.2189, 0.538, 0.2514, 0.5528]}, {"w": "of", "b": [0.2562, 0.538, 0.2719, 0.5528]}, {"w": "reasons", "b": [0.1521, 0.554, 0.2089, 0.5688]}, {"w": "for", "b": [0.2136, 0.554, 0.2356, 0.5688]}, {"w": "interest", "b": [0.2404, 0.554, 0.2961, 0.5688]}, {"w": "in.", "b": [0.3008, 0.554, 0.3268, 0.57]}, {"w": "See", "b": [0.1748, 0.57, 0.2089, 0.5851]}, {"w": "also", "b": [0.2202, 0.57, 0.2656, 0.5851]}, {"w": "generative", "b": [0.277, 0.57, 0.3905, 0.5851]}, {"w": "deep", "b": [0.4019, 0.57, 0.4473, 0.5851]}, {"w": "learning.", "b": [0.4586, 0.57, 0.5608, 0.5851]}, {"w": "Deep", "b": [0.1294, 0.5852, 0.1693, 0.6]}, {"w": "Learning", "b": [0.1741, 0.5852, 0.2424, 0.6]}, {"w": "AMI,", "b": [0.2471, 0.5852, 0.2886, 0.6]}, {"w": "EC2", "b": [0.2933, 0.5852, 0.327, 0.6]}, {"w": "DeepDream", "b": [0.1294, 0.6013, 0.2208, 0.6161]}, {"w": "technique", "b": [0.2255, 0.6013, 0.2991, 0.6161]}, {"w": "overview", "b": [0.1521, 0.6164, 0.2225, 0.6312]}, {"w": "implementing", "b": [0.1521, 0.6325, 0.2572, 0.6473]}, {"w": "in", "b": [0.262, 0.6325, 0.2767, 0.6473]}, {"w": "Keras", "b": [0.2814, 0.6325, 0.3255, 0.6473]}, {"w": "DeepMind,", "b": [0.1294, 0.6485, 0.2151, 0.6633]}, {"w": "Google,", "b": [0.2198, 0.6485, 0.2868, 0.6644]}, {"w": "2nd", "b": [0.2982, 0.6485, 0.3181, 0.6633]}, {"w": "Dense", "b": [0.1294, 0.6645, 0.1767, 0.6794]}, {"w": "layers,", "b": [0.1814, 0.6645, 0.2379, 0.6805]}, {"w": "2nd,", "b": [0.2493, 0.6645, 0.2806, 0.6805]}, {"w": "3rd,", "b": [0.292, 0.6645, 0.3215, 0.6805]}, {"w": "4th,", "b": [0.3329, 0.6645, 0.3618, 0.6805]}, {"w": "5th,", "b": [0.3732, 0.6645, 0.4021, 0.6805]}, {"w": "6th,", "b": [0.4135, 0.6645, 0.4425, 0.6805]}, {"w": "7th,", "b": [0.4538, 0.6645, 0.4828, 0.6805]}, {"w": "8th", "b": [0.4941, 0.6645, 0.5118, 0.6794]}, {"w": "dense", "b": [0.1294, 0.6806, 0.1725, 0.6954]}, {"w": "sampling", "b": [0.1772, 0.6806, 0.2466, 0.6954]}, {"w": "densely", "b": [0.1294, 0.6966, 0.1872, 0.7114]}, {"w": "connected", "b": [0.1919, 0.6966, 0.2686, 0.7114]}, {"w": "networks", "b": [0.2734, 0.6966, 0.3427, 0.7114]}, {"w": "depthwise", "b": [0.1294, 0.7127, 0.2061, 0.7275]}, {"w": "separable", "b": [0.2109, 0.7127, 0.2823, 0.7275]}, {"w": "convolution", "b": [0.287, 0.7127, 0.3774, 0.7275]}, {"w": "derivatives,", "b": [0.1294, 0.7287, 0.2172, 0.7435]}, {"w": "defined", "b": [0.2219, 0.7287, 0.2786, 0.7435]}, {"w": "developer", "b": [0.1294, 0.7448, 0.204, 0.7596]}, {"w": "account,", "b": [0.2087, 0.7448, 0.2723, 0.7596]}, {"w": "NVIDIA", "b": [0.277, 0.7448, 0.3443, 0.7596]}, {"w": "digital", "b": [0.1294, 0.7608, 0.1778, 0.7756]}, {"w": "assistants", "b": [0.1825, 0.7608, 0.254, 0.7756]}, {"w": "dimension", "b": [0.1294, 0.7769, 0.2082, 0.7917]}, {"w": "dimensionality,", "b": [0.1294, 0.7929, 0.2532, 0.8088]}, {"w": "2nd", "b": [0.2646, 0.7928, 0.2845, 0.8077]}, {"w": "directed", "b": [0.1294, 0.8089, 0.1904, 0.8237]}, {"w": "acyclic", "b": [0.1951, 0.8089, 0.2487, 0.8237]}, {"w": "graphs", "b": [0.2534, 0.8089, 0.3038, 0.8237]}, {"w": "of", "b": [0.3086, 0.8089, 0.3243, 0.8237]}, {"w": "layers", "b": [0.329, 0.8089, 0.3742, 0.8237]}, {"w": "inception", "b": [0.1521, 0.8241, 0.2225, 0.8389]}, {"w": "modules", "b": [0.2273, 0.8241, 0.2914, 0.8389]}, {"w": "residual", "b": [0.1521, 0.8401, 0.212, 0.8549]}, {"w": "connections", "b": [0.2167, 0.8401, 0.3071, 0.8549]}, {"w": "discriminator", "b": [0.1294, 0.8712, 0.277, 0.8864]}, {"w": "networks", "b": [0.2883, 0.8712, 0.3791, 0.8864]}]}, {"id": "b_10", "type": "paragraph", "text": "overview", "words": [{"w": "overview", "b": [0.1521, 0.8865, 0.2225, 0.9013]}]}]}, {"page": 458, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "implementing distance function dot operations dot product downloading GloVe word embeddings raw text Dropout layer dtype attribute", "words": [{"w": "implementing", "b": [0.1521, 0.0852, 0.2572, 0.1]}, {"w": "distance", "b": [0.1294, 0.1012, 0.1914, 0.116]}, {"w": "function", "b": [0.1961, 0.1012, 0.2592, 0.116]}, {"w": "dot", "b": [0.1294, 0.1173, 0.1536, 0.1321]}, {"w": "operations", "b": [0.1583, 0.1173, 0.2371, 0.1321]}, {"w": "dot", "b": [0.1294, 0.1333, 0.1536, 0.1481]}, {"w": "product", "b": [0.1583, 0.1333, 0.2161, 0.1481]}, {"w": "downloading", "b": [0.1294, 0.1644, 0.2543, 0.1796]}, {"w": "GloVe", "b": [0.1521, 0.1797, 0.2005, 0.1945]}, {"w": "word", "b": [0.2052, 0.1797, 0.2441, 0.1945]}, {"w": "embeddings", "b": [0.2488, 0.1797, 0.3402, 0.1945]}, {"w": "raw", "b": [0.1521, 0.1957, 0.1805, 0.2105]}, {"w": "text", "b": [0.1852, 0.1957, 0.2136, 0.2105]}, {"w": "Dropout", "b": [0.1294, 0.2118, 0.1925, 0.2266]}, {"w": "layer", "b": [0.1972, 0.2118, 0.235, 0.2266]}, {"w": "dtype", "b": [0.1294, 0.2278, 0.1715, 0.2426]}, {"w": "attribute", "b": [0.1762, 0.2278, 0.2392, 0.2426]}]}, {"id": "b_2", "type": "paragraph", "text": "EarlyStopping callbacks Eck, Douglas editing images, concept vectors for Eigen element-wise operations embedding layers, learning word embeddings with engineering features ensembling models epochs, 2nd, 3rd, 4th epsilon evaluating models evaluation protocols, choosing, 2nd expert systems extreme generalization, local generalization vs. extreme inception", "words": [{"w": "EarlyStopping", "b": [0.1294, 0.308, 0.2387, 0.3228]}, {"w": "callbacks", "b": [0.2435, 0.308, 0.3139, 0.3228]}, {"w": "Eck,", "b": [0.1294, 0.3241, 0.1636, 0.3389]}, {"w": "Douglas", "b": [0.1683, 0.3241, 0.2313, 0.3389]}, {"w": "editing", "b": [0.1294, 0.3401, 0.182, 0.3549]}, {"w": "images,", "b": [0.1867, 0.3401, 0.245, 0.3549]}, {"w": "concept", "b": [0.2498, 0.3401, 0.3086, 0.3549]}, {"w": "vectors", "b": [0.3133, 0.3401, 0.368, 0.3549]}, {"w": "for", "b": [0.3727, 0.3401, 0.3948, 0.3549]}, {"w": "Eigen", "b": [0.1294, 0.3562, 0.1736, 0.371]}, {"w": "element-wise", "b": [0.1294, 0.3722, 0.2303, 0.387]}, {"w": "operations", "b": [0.235, 0.3722, 0.3138, 0.387]}, {"w": "embedding", "b": [0.1294, 0.3882, 0.2135, 0.403]}, {"w": "layers,", "b": [0.2182, 0.3882, 0.2681, 0.403]}, {"w": "learning", "b": [0.2729, 0.3882, 0.3349, 0.403]}, {"w": "word", "b": [0.3396, 0.3882, 0.3785, 0.403]}, {"w": "embeddings", "b": [0.3832, 0.3882, 0.4746, 0.403]}, {"w": "with", "b": [0.4794, 0.3882, 0.513, 0.403]}, {"w": "engineering", "b": [0.1294, 0.4043, 0.2187, 0.4191]}, {"w": "features", "b": [0.2235, 0.4043, 0.2833, 0.4191]}, {"w": "ensembling", "b": [0.1294, 0.4203, 0.2166, 0.4351]}, {"w": "models", "b": [0.2214, 0.4203, 0.276, 0.4351]}, {"w": "epochs,", "b": [0.1294, 0.4364, 0.1933, 0.4523]}, {"w": "2nd,", "b": [0.2046, 0.4363, 0.236, 0.4523]}, {"w": "3rd,", "b": [0.2473, 0.4363, 0.2768, 0.4523]}, {"w": "4th", "b": [0.2882, 0.4363, 0.3058, 0.4512]}, {"w": "epsilon", "b": [0.1294, 0.4524, 0.1841, 0.4672]}, {"w": "evaluating", "b": [0.1294, 0.4685, 0.2082, 0.4833]}, {"w": "models", "b": [0.213, 0.4685, 0.2676, 0.4833]}, {"w": "evaluation", "b": [0.1294, 0.4845, 0.2082, 0.4993]}, {"w": "protocols,", "b": [0.213, 0.4845, 0.2881, 0.4993]}, {"w": "choosing,", "b": [0.2928, 0.4845, 0.3725, 0.5004]}, {"w": "2nd", "b": [0.3838, 0.4845, 0.4038, 0.4993]}, {"w": "expert", "b": [0.1294, 0.5005, 0.1767, 0.5154]}, {"w": "systems", "b": [0.1814, 0.5005, 0.2413, 0.5154]}, {"w": "extreme", "b": [0.1294, 0.5166, 0.1904, 0.5314]}, {"w": "generalization,", "b": [0.1951, 0.5166, 0.307, 0.5314]}, {"w": "local", "b": [0.3117, 0.5166, 0.3485, 0.5314]}, {"w": "generalization", "b": [0.3532, 0.5166, 0.4604, 0.5314]}, {"w": "vs.", "b": [0.4651, 0.5166, 0.4867, 0.5314]}, {"w": "extreme", "b": [0.1294, 0.5326, 0.1904, 0.5474]}, {"w": "inception", "b": [0.1951, 0.5326, 0.2655, 0.5474]}]}, {"id": "b_4", "type": "paragraph", "text": "feature engineering, 2nd feature learning feature maps, 2nd features engineering", "words": [{"w": "feature", "b": [0.1294, 0.6128, 0.1819, 0.6277]}, {"w": "engineering,", "b": [0.1867, 0.6128, 0.2873, 0.6288]}, {"w": "2nd", "b": [0.2986, 0.6128, 0.3186, 0.6277]}, {"w": "feature", "b": [0.1294, 0.6289, 0.1819, 0.6437]}, {"w": "learning", "b": [0.1867, 0.6289, 0.2487, 0.6437]}, {"w": "feature", "b": [0.1294, 0.6449, 0.1819, 0.6597]}, {"w": "maps,", "b": [0.1867, 0.6449, 0.2379, 0.6609]}, {"w": "2nd", "b": [0.2493, 0.6449, 0.2692, 0.6597]}, {"w": "features", "b": [0.1294, 0.676, 0.2202, 0.6912]}, {"w": "engineering", "b": [0.1521, 0.6913, 0.2414, 0.7061]}]}, {"id": "b_5", "type": "paragraph", "text": "extracting", "words": [{"w": "extracting", "b": [0.1521, 0.7073, 0.2278, 0.7221]}]}, {"id": "b_6", "type": "paragraph", "text": "with data augmentation without data augmentation features axis feedforward networks, 2nd Feynman, Richard fill_mode filter visualizations filters overview convnets, visualizing fine-tuning", "words": [{"w": "with", "b": [0.1748, 0.7234, 0.2085, 0.7382]}, {"w": "data", "b": [0.2132, 0.7234, 0.2447, 0.7382]}, {"w": "augmentation", "b": [0.2494, 0.7234, 0.3524, 0.7382]}, {"w": "without", "b": [0.1748, 0.7394, 0.2326, 0.7542]}, {"w": "data", "b": [0.2374, 0.7394, 0.2689, 0.7542]}, {"w": "augmentation", "b": [0.2736, 0.7394, 0.3766, 0.7542]}, {"w": "features", "b": [0.1294, 0.7555, 0.1893, 0.7703]}, {"w": "axis", "b": [0.194, 0.7555, 0.2245, 0.7703]}, {"w": "feedforward", "b": [0.1294, 0.7715, 0.2219, 0.7863]}, {"w": "networks,", "b": [0.2266, 0.7715, 0.3073, 0.7874]}, {"w": "2nd", "b": [0.3186, 0.7715, 0.3386, 0.7863]}, {"w": "Feynman,", "b": [0.1294, 0.7875, 0.2046, 0.8024]}, {"w": "Richard", "b": [0.2093, 0.7875, 0.2692, 0.8024]}, {"w": "fill_mode", "b": [0.1294, 0.8036, 0.203, 0.8184]}, {"w": "filter", "b": [0.1294, 0.8196, 0.1662, 0.8344]}, {"w": "visualizations", "b": [0.1709, 0.8196, 0.275, 0.8344]}, {"w": "filters", "b": [0.1294, 0.8507, 0.2089, 0.8659]}, {"w": "overview", "b": [0.1521, 0.866, 0.2225, 0.8808]}, {"w": "convnets,", "b": [0.1521, 0.882, 0.2241, 0.8968]}, {"w": "visualizing", "b": [0.2288, 0.882, 0.3119, 0.8968]}, {"w": "fine-tuning", "b": [0.1294, 0.8981, 0.2135, 0.9129]}]}]}, {"page": 459, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "fit method fit_generator method Flatten layer Flickr float32, 2nd, 3rd for loop, 2nd, 3rd forward pass freezing layers fully connected layers functional APIs, Keras directed acyclic graphs of layers layer weight sharing models as layers", "words": [{"w": "fit", "b": [0.1294, 0.0852, 0.1462, 0.1]}, {"w": "method", "b": [0.151, 0.0852, 0.2077, 0.1]}, {"w": "fit_generator", "b": [0.1294, 0.1012, 0.2271, 0.116]}, {"w": "method", "b": [0.2319, 0.1012, 0.2886, 0.116]}, {"w": "Flatten", "b": [0.1294, 0.1173, 0.182, 0.1321]}, {"w": "layer", "b": [0.1867, 0.1173, 0.2245, 0.1321]}, {"w": "Flickr", "b": [0.1294, 0.1333, 0.1746, 0.1481]}, {"w": "float32,", "b": [0.1294, 0.1494, 0.1943, 0.1653]}, {"w": "2nd,", "b": [0.2057, 0.1493, 0.237, 0.1653]}, {"w": "3rd", "b": [0.2484, 0.1493, 0.2666, 0.1642]}, {"w": "for", "b": [0.1294, 0.1654, 0.1515, 0.1802]}, {"w": "loop,", "b": [0.1562, 0.1654, 0.2012, 0.1813]}, {"w": "2nd,", "b": [0.2125, 0.1654, 0.2439, 0.1813]}, {"w": "3rd", "b": [0.2552, 0.1654, 0.2734, 0.1802]}, {"w": "forward", "b": [0.1294, 0.1815, 0.1893, 0.1963]}, {"w": "pass", "b": [0.194, 0.1815, 0.2266, 0.1963]}, {"w": "freezing", "b": [0.1294, 0.1975, 0.1914, 0.2123]}, {"w": "layers", "b": [0.1961, 0.1975, 0.2413, 0.2123]}, {"w": "fully", "b": [0.1294, 0.2135, 0.1652, 0.2283]}, {"w": "connected", "b": [0.1699, 0.2135, 0.2466, 0.2283]}, {"w": "layers", "b": [0.2513, 0.2135, 0.2965, 0.2283]}, {"w": "functional", "b": [0.1294, 0.2296, 0.2061, 0.2444]}, {"w": "APIs,", "b": [0.2109, 0.2296, 0.2534, 0.2444]}, {"w": "Keras", "b": [0.2582, 0.2296, 0.3023, 0.2444]}, {"w": "directed", "b": [0.1521, 0.2447, 0.2131, 0.2595]}, {"w": "acyclic", "b": [0.2178, 0.2447, 0.2714, 0.2595]}, {"w": "graphs", "b": [0.2761, 0.2447, 0.3265, 0.2595]}, {"w": "of", "b": [0.3313, 0.2447, 0.347, 0.2595]}, {"w": "layers", "b": [0.3518, 0.2447, 0.3969, 0.2595]}, {"w": "layer", "b": [0.1521, 0.2608, 0.1899, 0.2756]}, {"w": "weight", "b": [0.1947, 0.2608, 0.2462, 0.2756]}, {"w": "sharing", "b": [0.2509, 0.2608, 0.3066, 0.2756]}, {"w": "models", "b": [0.1521, 0.2768, 0.2068, 0.2916]}, {"w": "as", "b": [0.2115, 0.2768, 0.2273, 0.2916]}, {"w": "layers", "b": [0.232, 0.2768, 0.2772, 0.2916]}]}, {"id": "b_1", "type": "equation", "text": "multi-input models multi-output models", "words": [{"w": "multi-input", "b": [0.1521, 0.2929, 0.2373, 0.3077]}, {"w": "models", "b": [0.242, 0.2929, 0.2967, 0.3077]}, {"w": "multi-output", "b": [0.1521, 0.3089, 0.2467, 0.3237]}, {"w": "models", "b": [0.2515, 0.3089, 0.3061, 0.3237]}]}, {"id": "b_3", "type": "paragraph", "text": "Gal, Yarin GANs (generative adversarial networks), 2nd gated recurrent unit layers. See GRU layers. Gatys, Leon Gaussian distribution generalization, 2nd generative deep learning generating images with variational autoencoders concept vectors for image editing sampling from latent spaces of images generating text with LSTM generating sequence data history of generative recurrent networks implementing character-level LSTM text generation sampling strategy generative adversarial networks adversarial networks discriminator networks generator networks schematic implementation of training DCGANs neural style transfer content loss in Keras style loss generative deep learning, DeepDream generative recurrent networks, history of generator function, 2nd generator networks, implementing", "words": [{"w": "Gal,", "b": [0.1294, 0.39, 0.1615, 0.4048]}, {"w": "Yarin", "b": [0.1662, 0.39, 0.2074, 0.4048]}, {"w": "GANs", "b": [0.1294, 0.4061, 0.1778, 0.4209]}, {"w": "(generative", "b": [0.1825, 0.4061, 0.2676, 0.4209]}, {"w": "adversarial", "b": [0.2723, 0.4061, 0.3553, 0.4209]}, {"w": "networks),", "b": [0.36, 0.4061, 0.447, 0.422]}, {"w": "2nd", "b": [0.4584, 0.406, 0.4783, 0.4209]}, {"w": "gated", "b": [0.1294, 0.4221, 0.1704, 0.4369]}, {"w": "recurrent", "b": [0.1751, 0.4221, 0.2434, 0.4369]}, {"w": "unit", "b": [0.2481, 0.4221, 0.2776, 0.4369]}, {"w": "layers.", "b": [0.2823, 0.4221, 0.3388, 0.438]}, {"w": "See", "b": [0.1748, 0.438, 0.2089, 0.4532]}, {"w": "GRU", "b": [0.2202, 0.438, 0.2543, 0.4532]}, {"w": "layers.", "b": [0.2656, 0.438, 0.3451, 0.4532]}, {"w": "Gatys,", "b": [0.1294, 0.4533, 0.1783, 0.4681]}, {"w": "Leon", "b": [0.183, 0.4533, 0.2219, 0.4681]}, {"w": "Gaussian", "b": [0.1294, 0.4693, 0.1988, 0.4842]}, {"w": "distribution", "b": [0.2035, 0.4693, 0.2908, 0.4842]}, {"w": "generalization,", "b": [0.1294, 0.4854, 0.2479, 0.5013]}, {"w": "2nd", "b": [0.2593, 0.4853, 0.2792, 0.5002]}, {"w": "generative", "b": [0.1294, 0.5165, 0.2429, 0.5316]}, {"w": "deep", "b": [0.2543, 0.5165, 0.2997, 0.5316]}, {"w": "learning", "b": [0.311, 0.5165, 0.4019, 0.5316]}, {"w": "generating", "b": [0.1521, 0.5317, 0.232, 0.5465]}, {"w": "images", "b": [0.2367, 0.5317, 0.2903, 0.5465]}, {"w": "with", "b": [0.295, 0.5317, 0.3287, 0.5465]}, {"w": "variational", "b": [0.3334, 0.5317, 0.4143, 0.5465]}, {"w": "autoencoders", "b": [0.419, 0.5317, 0.5189, 0.5465]}, {"w": "concept", "b": [0.1748, 0.5478, 0.2337, 0.5626]}, {"w": "vectors", "b": [0.2384, 0.5478, 0.293, 0.5626]}, {"w": "for", "b": [0.2978, 0.5478, 0.3198, 0.5626]}, {"w": "image", "b": [0.3245, 0.5478, 0.3708, 0.5626]}, {"w": "editing", "b": [0.3755, 0.5478, 0.4281, 0.5626]}, {"w": "sampling", "b": [0.1748, 0.5638, 0.2442, 0.5786]}, {"w": "from", "b": [0.2489, 0.5638, 0.2857, 0.5786]}, {"w": "latent", "b": [0.2904, 0.5638, 0.3325, 0.5786]}, {"w": "spaces", "b": [0.3372, 0.5638, 0.3866, 0.5786]}, {"w": "of", "b": [0.3913, 0.5638, 0.4071, 0.5786]}, {"w": "images", "b": [0.4118, 0.5638, 0.4654, 0.5786]}, {"w": "generating", "b": [0.1521, 0.5799, 0.232, 0.5947]}, {"w": "text", "b": [0.2367, 0.5799, 0.2651, 0.5947]}, {"w": "with", "b": [0.2698, 0.5799, 0.3035, 0.5947]}, {"w": "LSTM", "b": [0.3082, 0.5799, 0.3586, 0.5947]}, {"w": "generating", "b": [0.1748, 0.5959, 0.2547, 0.6107]}, {"w": "sequence", "b": [0.2594, 0.5959, 0.3287, 0.6107]}, {"w": "data", "b": [0.3335, 0.5959, 0.365, 0.6107]}, {"w": "history", "b": [0.1748, 0.612, 0.2274, 0.6268]}, {"w": "of", "b": [0.2321, 0.612, 0.2479, 0.6268]}, {"w": "generative", "b": [0.2526, 0.612, 0.3314, 0.6268]}, {"w": "recurrent", "b": [0.3361, 0.612, 0.4044, 0.6268]}, {"w": "networks", "b": [0.4091, 0.612, 0.4785, 0.6268]}, {"w": "implementing", "b": [0.1748, 0.628, 0.2799, 0.6428]}, {"w": "character-level", "b": [0.2847, 0.628, 0.3966, 0.6428]}, {"w": "LSTM", "b": [0.4014, 0.628, 0.4518, 0.6428]}, {"w": "text", "b": [0.4566, 0.628, 0.4849, 0.6428]}, {"w": "generation", "b": [0.4897, 0.628, 0.5695, 0.6428]}, {"w": "sampling", "b": [0.1748, 0.644, 0.2442, 0.6589]}, {"w": "strategy", "b": [0.2489, 0.644, 0.3088, 0.6589]}, {"w": "generative", "b": [0.1521, 0.6601, 0.2309, 0.6749]}, {"w": "adversarial", "b": [0.2356, 0.6601, 0.3186, 0.6749]}, {"w": "networks", "b": [0.3234, 0.6601, 0.3927, 0.6749]}, {"w": "adversarial", "b": [0.1748, 0.6761, 0.2578, 0.6909]}, {"w": "networks", "b": [0.2625, 0.6761, 0.3319, 0.6909]}, {"w": "discriminator", "b": [0.1748, 0.6922, 0.2757, 0.707]}, {"w": "networks", "b": [0.2804, 0.6922, 0.3498, 0.707]}, {"w": "generator", "b": [0.1748, 0.7082, 0.2463, 0.723]}, {"w": "networks", "b": [0.251, 0.7082, 0.3203, 0.723]}, {"w": "schematic", "b": [0.1748, 0.7243, 0.2505, 0.7391]}, {"w": "implementation", "b": [0.2552, 0.7243, 0.374, 0.7391]}, {"w": "of", "b": [0.3787, 0.7243, 0.3945, 0.7391]}, {"w": "training", "b": [0.1748, 0.7403, 0.2337, 0.7551]}, {"w": "DCGANs", "b": [0.2384, 0.7403, 0.313, 0.7551]}, {"w": "neural", "b": [0.1521, 0.7564, 0.1994, 0.7712]}, {"w": "style", "b": [0.2041, 0.7564, 0.2399, 0.7712]}, {"w": "transfer", "b": [0.2446, 0.7564, 0.3024, 0.7712]}, {"w": "content", "b": [0.1748, 0.7724, 0.2305, 0.7872]}, {"w": "loss", "b": [0.2352, 0.7724, 0.2647, 0.7872]}, {"w": "in", "b": [0.1748, 0.7884, 0.1895, 0.8032]}, {"w": "Keras", "b": [0.1943, 0.7884, 0.2384, 0.8032]}, {"w": "style", "b": [0.1748, 0.8045, 0.2106, 0.8193]}, {"w": "loss", "b": [0.2153, 0.8045, 0.2447, 0.8193]}, {"w": "generative", "b": [0.1294, 0.8205, 0.2082, 0.8353]}, {"w": "deep", "b": [0.2129, 0.8205, 0.2487, 0.8353]}, {"w": "learning,", "b": [0.2534, 0.8205, 0.3201, 0.8353]}, {"w": "DeepDream", "b": [0.3248, 0.8205, 0.4162, 0.8353]}, {"w": "generative", "b": [0.1294, 0.8366, 0.2082, 0.8514]}, {"w": "recurrent", "b": [0.2129, 0.8366, 0.2812, 0.8514]}, {"w": "networks,", "b": [0.286, 0.8366, 0.36, 0.8514]}, {"w": "history", "b": [0.3648, 0.8366, 0.4173, 0.8514]}, {"w": "of", "b": [0.4221, 0.8366, 0.4378, 0.8514]}, {"w": "generator", "b": [0.1294, 0.8526, 0.2009, 0.8674]}, {"w": "function,", "b": [0.2056, 0.8526, 0.28, 0.8685]}, {"w": "2nd", "b": [0.2913, 0.8526, 0.3113, 0.8674]}, {"w": "generator", "b": [0.1294, 0.8687, 0.2009, 0.8835]}, {"w": "networks,", "b": [0.2056, 0.8687, 0.2797, 0.8835]}, {"w": "implementing", "b": [0.2844, 0.8687, 0.3895, 0.8835]}]}]}, {"page": 460, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "geometric interpretation", "words": [{"w": "geometric", "b": [0.1294, 0.0851, 0.2316, 0.1002]}, {"w": "interpretation", "b": [0.2429, 0.0851, 0.4019, 0.1002]}]}, {"id": "b_1", "type": "paragraph", "text": "of deep learning of tensor operations geometric space GloVe (Global Vectors for Word Representation)", "words": [{"w": "of", "b": [0.1521, 0.1003, 0.1679, 0.1151]}, {"w": "deep", "b": [0.1726, 0.1003, 0.2083, 0.1151]}, {"w": "learning", "b": [0.2131, 0.1003, 0.2751, 0.1151]}, {"w": "of", "b": [0.1521, 0.1164, 0.1679, 0.1312]}, {"w": "tensor", "b": [0.1726, 0.1164, 0.2188, 0.1312]}, {"w": "operations", "b": [0.2236, 0.1164, 0.3024, 0.1312]}, {"w": "geometric", "b": [0.1294, 0.1324, 0.2051, 0.1472]}, {"w": "space", "b": [0.2098, 0.1324, 0.2518, 0.1472]}, {"w": "GloVe", "b": [0.1294, 0.1635, 0.1862, 0.1787]}, {"w": "(Global", "b": [0.1975, 0.1635, 0.277, 0.1787]}, {"w": "Vectors", "b": [0.2883, 0.1635, 0.3678, 0.1787]}, {"w": "for", "b": [0.3791, 0.1635, 0.4132, 0.1787]}, {"w": "Word", "b": [0.4246, 0.1635, 0.47, 0.1787]}, {"w": "Representation)", "b": [0.4813, 0.1635, 0.6516, 0.1787]}]}, {"id": "b_2", "type": "paragraph", "text": "downloading word embeddings loading embeddings in models Goodfellow, Ian GPUs (graphics processing units)", "words": [{"w": "downloading", "b": [0.1521, 0.1788, 0.2509, 0.1936]}, {"w": "word", "b": [0.2556, 0.1788, 0.2945, 0.1936]}, {"w": "embeddings", "b": [0.2993, 0.1788, 0.3907, 0.1936]}, {"w": "loading", "b": [0.1521, 0.1948, 0.2089, 0.2096]}, {"w": "embeddings", "b": [0.2136, 0.1948, 0.305, 0.2096]}, {"w": "in", "b": [0.3098, 0.1948, 0.3245, 0.2096]}, {"w": "models", "b": [0.3292, 0.1948, 0.3839, 0.2096]}, {"w": "Goodfellow,", "b": [0.1294, 0.2109, 0.2233, 0.2257]}, {"w": "Ian", "b": [0.228, 0.2109, 0.2522, 0.2257]}, {"w": "GPUs", "b": [0.1294, 0.242, 0.1748, 0.2571]}, {"w": "(graphics", "b": [0.1862, 0.242, 0.2883, 0.2571]}, {"w": "processing", "b": [0.2997, 0.242, 0.4132, 0.2571]}, {"w": "units)", "b": [0.4246, 0.242, 0.4927, 0.2571]}]}, {"id": "b_3", "type": "paragraph", "text": "installing on AWS instances, on AWS overview", "words": [{"w": "installing", "b": [0.1521, 0.2572, 0.2226, 0.272]}, {"w": "on", "b": [0.2273, 0.2572, 0.2462, 0.272]}, {"w": "AWS", "b": [0.2509, 0.2572, 0.2914, 0.272]}, {"w": "instances,", "b": [0.1521, 0.2733, 0.2262, 0.2881]}, {"w": "on", "b": [0.2309, 0.2733, 0.2499, 0.2881]}, {"w": "AWS", "b": [0.2546, 0.2733, 0.2951, 0.2881]}, {"w": "overview", "b": [0.1521, 0.2893, 0.2225, 0.3041]}]}, {"id": "b_4", "type": "paragraph", "text": "selecting support, setting up on Ubuntu gradient boosting machines gradient descent gradient propagation gradient-based optimization", "words": [{"w": "selecting", "b": [0.1521, 0.3053, 0.2194, 0.3202]}, {"w": "support,", "b": [0.1521, 0.3214, 0.2136, 0.3362]}, {"w": "setting", "b": [0.2183, 0.3214, 0.2688, 0.3362]}, {"w": "up", "b": [0.2735, 0.3214, 0.2924, 0.3362]}, {"w": "on", "b": [0.2972, 0.3214, 0.3161, 0.3362]}, {"w": "Ubuntu", "b": [0.3208, 0.3214, 0.3776, 0.3362]}, {"w": "gradient", "b": [0.1294, 0.3374, 0.1914, 0.3522]}, {"w": "boosting", "b": [0.1961, 0.3374, 0.2613, 0.3522]}, {"w": "machines", "b": [0.266, 0.3374, 0.3375, 0.3522]}, {"w": "gradient", "b": [0.1294, 0.3535, 0.1914, 0.3683]}, {"w": "descent", "b": [0.1961, 0.3535, 0.2529, 0.3683]}, {"w": "gradient", "b": [0.1294, 0.3695, 0.1914, 0.3843]}, {"w": "propagation", "b": [0.1961, 0.3695, 0.2865, 0.3843]}, {"w": "gradient-based", "b": [0.1294, 0.3856, 0.2408, 0.4004]}, {"w": "optimization", "b": [0.2455, 0.3856, 0.3412, 0.4004]}]}, {"id": "b_5", "type": "paragraph", "text": "backpropagation algorithm derivatives, defined gradients stochastic gradient descent gradients Gram matrix graphs, directed acyclic of layers Graphviz, 2nd Graves, Alex greedy sampling ground-truth GRU (gated recurrent unit) layers, 2nd", "words": [{"w": "backpropagation", "b": [0.1521, 0.4007, 0.2782, 0.4155]}, {"w": "algorithm", "b": [0.2829, 0.4007, 0.3565, 0.4155]}, {"w": "derivatives,", "b": [0.1521, 0.4168, 0.2399, 0.4316]}, {"w": "defined", "b": [0.2446, 0.4168, 0.3013, 0.4316]}, {"w": "gradients", "b": [0.1521, 0.4328, 0.2215, 0.4476]}, {"w": "stochastic", "b": [0.1521, 0.4488, 0.2267, 0.4637]}, {"w": "gradient", "b": [0.2315, 0.4488, 0.2935, 0.4637]}, {"w": "descent", "b": [0.2982, 0.4488, 0.3549, 0.4637]}, {"w": "gradients", "b": [0.1294, 0.4649, 0.1988, 0.4797]}, {"w": "Gram", "b": [0.1294, 0.4809, 0.1725, 0.4957]}, {"w": "matrix", "b": [0.1772, 0.4809, 0.2266, 0.4957]}, {"w": "graphs,", "b": [0.1294, 0.497, 0.1846, 0.5118]}, {"w": "directed", "b": [0.1893, 0.497, 0.2502, 0.5118]}, {"w": "acyclic", "b": [0.255, 0.497, 0.3086, 0.5118]}, {"w": "of", "b": [0.3133, 0.497, 0.329, 0.5118]}, {"w": "layers", "b": [0.3338, 0.497, 0.379, 0.5118]}, {"w": "Graphviz,", "b": [0.1294, 0.513, 0.2111, 0.529]}, {"w": "2nd", "b": [0.2225, 0.513, 0.2425, 0.5278]}, {"w": "Graves,", "b": [0.1294, 0.5291, 0.1877, 0.5439]}, {"w": "Alex", "b": [0.1925, 0.5291, 0.2292, 0.5439]}, {"w": "greedy", "b": [0.1294, 0.5451, 0.1809, 0.5599]}, {"w": "sampling", "b": [0.1856, 0.5451, 0.255, 0.5599]}, {"w": "ground-truth", "b": [0.1294, 0.5612, 0.225, 0.576]}, {"w": "GRU", "b": [0.1294, 0.5772, 0.1694, 0.592]}, {"w": "(gated", "b": [0.1741, 0.5772, 0.2214, 0.592]}, {"w": "recurrent", "b": [0.2261, 0.5772, 0.2944, 0.592]}, {"w": "unit)", "b": [0.2991, 0.5772, 0.3348, 0.592]}, {"w": "layers,", "b": [0.3396, 0.5772, 0.3961, 0.5931]}, {"w": "2nd", "b": [0.4074, 0.5771, 0.4274, 0.592]}]}, {"id": "b_7", "type": "paragraph", "text": "handwriting transcription hardware hash collisions HDF5 heatmaps of class activation, visualizing", "words": [{"w": "handwriting", "b": [0.1294, 0.6583, 0.2208, 0.6731]}, {"w": "transcription", "b": [0.2256, 0.6583, 0.3212, 0.6731]}, {"w": "hardware", "b": [0.1294, 0.6744, 0.1998, 0.6892]}, {"w": "hash", "b": [0.1294, 0.6904, 0.1641, 0.7052]}, {"w": "collisions", "b": [0.1688, 0.6904, 0.2414, 0.7052]}, {"w": "HDF5", "b": [0.1294, 0.7064, 0.1767, 0.7212]}, {"w": "heatmaps", "b": [0.1294, 0.7375, 0.2202, 0.7527]}, {"w": "of", "b": [0.1521, 0.7528, 0.1679, 0.7676]}, {"w": "class", "b": [0.1726, 0.7528, 0.2094, 0.7676]}, {"w": "activation,", "b": [0.2141, 0.7528, 0.2935, 0.7676]}, {"w": "visualizing", "b": [0.2982, 0.7528, 0.3812, 0.7676]}]}, {"id": "b_8", "type": "paragraph", "text": "overview height_shift range heterogeneous data hidden layers hidden unit hierarchical representation learning Hinton, Geoffrey, 2nd Hochreiter, Sepp hold-out validation", "words": [{"w": "overview", "b": [0.1521, 0.7688, 0.2225, 0.7836]}, {"w": "height_shift", "b": [0.1294, 0.7849, 0.2198, 0.7997]}, {"w": "range", "b": [0.2245, 0.7849, 0.2666, 0.7997]}, {"w": "heterogeneous", "b": [0.1294, 0.8009, 0.2387, 0.8157]}, {"w": "data", "b": [0.2434, 0.8009, 0.2749, 0.8157]}, {"w": "hidden", "b": [0.1294, 0.817, 0.1809, 0.8318]}, {"w": "layers", "b": [0.1856, 0.817, 0.2308, 0.8318]}, {"w": "hidden", "b": [0.1294, 0.833, 0.1809, 0.8478]}, {"w": "unit", "b": [0.1856, 0.833, 0.2151, 0.8478]}, {"w": "hierarchical", "b": [0.1294, 0.849, 0.2187, 0.8639]}, {"w": "representation", "b": [0.2234, 0.849, 0.3306, 0.8639]}, {"w": "learning", "b": [0.3353, 0.849, 0.3973, 0.8639]}, {"w": "Hinton,", "b": [0.1294, 0.8651, 0.1867, 0.8799]}, {"w": "Geoffrey,", "b": [0.1914, 0.8651, 0.2707, 0.881]}, {"w": "2nd", "b": [0.282, 0.865, 0.302, 0.8799]}, {"w": "Hochreiter,", "b": [0.1294, 0.8811, 0.2143, 0.8959]}, {"w": "Sepp", "b": [0.219, 0.8811, 0.2568, 0.8959]}, {"w": "hold-out", "b": [0.1294, 0.8972, 0.1935, 0.912]}, {"w": "validation", "b": [0.1983, 0.8972, 0.2739, 0.912]}]}]}, {"page": 461, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "homogenous data horizontal_flip HSV (hue-saturation-value) format Hyperas library Hyperopt hyperparameters optimizing overview", "words": [{"w": "homogenous", "b": [0.1294, 0.0852, 0.2261, 0.1]}, {"w": "data", "b": [0.2308, 0.0852, 0.2624, 0.1]}, {"w": "horizontal_flip", "b": [0.1294, 0.1012, 0.2419, 0.116]}, {"w": "HSV", "b": [0.1294, 0.1173, 0.1673, 0.1321]}, {"w": "(hue-saturation-value)", "b": [0.172, 0.1173, 0.3401, 0.1321]}, {"w": "format", "b": [0.3448, 0.1173, 0.3953, 0.1321]}, {"w": "Hyperas", "b": [0.1294, 0.1333, 0.1925, 0.1481]}, {"w": "library", "b": [0.1972, 0.1333, 0.2476, 0.1481]}, {"w": "Hyperopt", "b": [0.1294, 0.1494, 0.2009, 0.1642]}, {"w": "hyperparameters", "b": [0.1294, 0.1805, 0.2997, 0.1956]}, {"w": "optimizing", "b": [0.1521, 0.1957, 0.2341, 0.2105]}, {"w": "overview", "b": [0.1521, 0.2118, 0.2225, 0.2266]}]}, {"id": "b_1", "type": "paragraph", "text": "tuning hyperplanes hypothesis space, 2nd, 3rd", "words": [{"w": "tuning", "b": [0.1521, 0.2278, 0.2005, 0.2426]}, {"w": "hyperplanes", "b": [0.1294, 0.2438, 0.2208, 0.2587]}, {"w": "hypothesis", "b": [0.1294, 0.2599, 0.2103, 0.2747]}, {"w": "space,", "b": [0.2151, 0.2599, 0.2684, 0.2758]}, {"w": "2nd,", "b": [0.2798, 0.2598, 0.3111, 0.2758]}, {"w": "3rd", "b": [0.3224, 0.2598, 0.3407, 0.2747]}]}, {"id": "b_3", "type": "paragraph", "text": "IDSIA ILSVRC (ImageNet Large Scale Visual Recognition Challenge) image classification image data, 2nd image segmentation image-classification task ImageDataGenerator class, 2nd, 3rd ImageNet class, 2nd, 3rd images editing concept vectors for flipping generating with variational autoencoders concept vectors for image editing overview sampling from latent spaces of inception blocks Inception modules, 2nd, 3rd include_top argument information bottlenecks, 2nd information distillation pipeline information leaks initial state input data, 2nd, 3rd input_shape argument input_tensor installing CUDA cuDNN Keras, 2nd", "words": [{"w": "IDSIA", "b": [0.1294, 0.341, 0.1799, 0.3558]}, {"w": "ILSVRC", "b": [0.1294, 0.357, 0.1967, 0.3718]}, {"w": "(ImageNet", "b": [0.2014, 0.357, 0.2823, 0.3718]}, {"w": "Large", "b": [0.287, 0.357, 0.3308, 0.3718]}, {"w": "Scale", "b": [0.3355, 0.357, 0.3765, 0.3718]}, {"w": "Visual", "b": [0.3813, 0.357, 0.4295, 0.3718]}, {"w": "Recognition", "b": [0.4342, 0.357, 0.5267, 0.3718]}, {"w": "Challenge)", "b": [0.5315, 0.357, 0.6145, 0.3718]}, {"w": "image", "b": [0.1294, 0.3731, 0.1757, 0.3879]}, {"w": "classification", "b": [0.1804, 0.3731, 0.2802, 0.3879]}, {"w": "image", "b": [0.1294, 0.3891, 0.1757, 0.4039]}, {"w": "data,", "b": [0.1804, 0.3891, 0.2232, 0.4051]}, {"w": "2nd", "b": [0.2346, 0.3891, 0.2545, 0.4039]}, {"w": "image", "b": [0.1294, 0.4052, 0.1757, 0.42]}, {"w": "segmentation", "b": [0.1804, 0.4052, 0.2813, 0.42]}, {"w": "image-classification", "b": [0.1294, 0.4212, 0.2818, 0.436]}, {"w": "task", "b": [0.2865, 0.4212, 0.317, 0.436]}, {"w": "ImageDataGenerator", "b": [0.1294, 0.4373, 0.2881, 0.4521]}, {"w": "class,", "b": [0.2928, 0.4373, 0.3409, 0.4532]}, {"w": "2nd,", "b": [0.3522, 0.4372, 0.3835, 0.4532]}, {"w": "3rd", "b": [0.3949, 0.4372, 0.4131, 0.4521]}, {"w": "ImageNet", "b": [0.1294, 0.4533, 0.204, 0.4681]}, {"w": "class,", "b": [0.2087, 0.4533, 0.2568, 0.4692]}, {"w": "2nd,", "b": [0.2682, 0.4533, 0.2995, 0.4692]}, {"w": "3rd", "b": [0.3109, 0.4533, 0.3291, 0.4681]}, {"w": "images", "b": [0.1294, 0.4844, 0.1975, 0.4995]}, {"w": "editing", "b": [0.1521, 0.4997, 0.2047, 0.5145]}, {"w": "concept", "b": [0.2094, 0.4997, 0.2682, 0.5145]}, {"w": "vectors", "b": [0.273, 0.4997, 0.3276, 0.5145]}, {"w": "for", "b": [0.3323, 0.4997, 0.3544, 0.5145]}, {"w": "flipping", "b": [0.1521, 0.5157, 0.212, 0.5305]}, {"w": "generating", "b": [0.1521, 0.5317, 0.232, 0.5465]}, {"w": "with", "b": [0.2367, 0.5317, 0.2703, 0.5465]}, {"w": "variational", "b": [0.2751, 0.5317, 0.356, 0.5465]}, {"w": "autoencoders", "b": [0.3607, 0.5317, 0.4605, 0.5465]}, {"w": "concept", "b": [0.1748, 0.5478, 0.2337, 0.5626]}, {"w": "vectors", "b": [0.2384, 0.5478, 0.293, 0.5626]}, {"w": "for", "b": [0.2978, 0.5478, 0.3198, 0.5626]}, {"w": "image", "b": [0.3245, 0.5478, 0.3708, 0.5626]}, {"w": "editing", "b": [0.3755, 0.5478, 0.4281, 0.5626]}, {"w": "overview", "b": [0.1748, 0.5638, 0.2452, 0.5786]}, {"w": "sampling", "b": [0.1521, 0.5799, 0.2215, 0.5947]}, {"w": "from", "b": [0.2262, 0.5799, 0.263, 0.5947]}, {"w": "latent", "b": [0.2677, 0.5799, 0.3098, 0.5947]}, {"w": "spaces", "b": [0.3145, 0.5799, 0.3639, 0.5947]}, {"w": "of", "b": [0.3686, 0.5799, 0.3844, 0.5947]}, {"w": "inception", "b": [0.1294, 0.5959, 0.1998, 0.6107]}, {"w": "blocks", "b": [0.2046, 0.5959, 0.254, 0.6107]}, {"w": "Inception", "b": [0.1294, 0.612, 0.2009, 0.6268]}, {"w": "modules,", "b": [0.2056, 0.612, 0.281, 0.6279]}, {"w": "2nd,", "b": [0.2924, 0.6119, 0.3237, 0.6279]}, {"w": "3rd", "b": [0.3351, 0.6119, 0.3533, 0.6268]}, {"w": "include_top", "b": [0.1294, 0.628, 0.2187, 0.6428]}, {"w": "argument", "b": [0.2235, 0.628, 0.2946, 0.6428]}, {"w": "information", "b": [0.1294, 0.644, 0.2187, 0.6589]}, {"w": "bottlenecks,", "b": [0.2235, 0.644, 0.321, 0.66]}, {"w": "2nd", "b": [0.3323, 0.644, 0.3523, 0.6589]}, {"w": "information", "b": [0.1294, 0.6601, 0.2187, 0.6749]}, {"w": "distillation", "b": [0.2235, 0.6601, 0.3044, 0.6749]}, {"w": "pipeline", "b": [0.3092, 0.6601, 0.3701, 0.6749]}, {"w": "information", "b": [0.1294, 0.6761, 0.2187, 0.6909]}, {"w": "leaks", "b": [0.2235, 0.6761, 0.2624, 0.6909]}, {"w": "initial", "b": [0.1294, 0.6922, 0.1736, 0.707]}, {"w": "state", "b": [0.1783, 0.6922, 0.213, 0.707]}, {"w": "input", "b": [0.1294, 0.7082, 0.1683, 0.723]}, {"w": "data,", "b": [0.173, 0.7082, 0.2159, 0.7241]}, {"w": "2nd,", "b": [0.2272, 0.7082, 0.2586, 0.7241]}, {"w": "3rd", "b": [0.2699, 0.7082, 0.2881, 0.723]}, {"w": "input_shape", "b": [0.1294, 0.7243, 0.2208, 0.7391]}, {"w": "argument", "b": [0.2256, 0.7243, 0.2967, 0.7391]}, {"w": "input_tensor", "b": [0.1294, 0.7403, 0.224, 0.7551]}, {"w": "installing", "b": [0.1294, 0.7714, 0.2429, 0.7865]}, {"w": "CUDA", "b": [0.1521, 0.7867, 0.2057, 0.8015]}, {"w": "cuDNN", "b": [0.1521, 0.8027, 0.211, 0.8175]}, {"w": "Keras,", "b": [0.1521, 0.8214, 0.2076, 0.8373]}, {"w": "2nd", "b": [0.2189, 0.8187, 0.2431, 0.8362]}]}, {"id": "b_4", "type": "paragraph", "text": "OpenBLAS", "words": [{"w": "OpenBLAS", "b": [0.1521, 0.8375, 0.2415, 0.8523]}]}, {"id": "b_5", "type": "paragraph", "text": "OpenCV Python scientific suite on Ubuntu TensorFLow", "words": [{"w": "OpenCV", "b": [0.1521, 0.8535, 0.2194, 0.8683]}, {"w": "Python", "b": [0.1521, 0.8695, 0.2057, 0.8844]}, {"w": "scientific", "b": [0.2105, 0.8695, 0.2798, 0.8844]}, {"w": "suite", "b": [0.2846, 0.8695, 0.3203, 0.8844]}, {"w": "on", "b": [0.325, 0.8695, 0.3439, 0.8844]}, {"w": "Ubuntu", "b": [0.3487, 0.8695, 0.4054, 0.8844]}, {"w": "TensorFLow", "b": [0.1521, 0.8856, 0.2485, 0.9004]}]}]}, {"page": 462, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Theano on Ubuntu Intel intermediate activations, visualizing investments in deep learning ipython command", "words": [{"w": "Theano", "b": [0.1521, 0.0852, 0.2089, 0.1]}, {"w": "on", "b": [0.2136, 0.0852, 0.2325, 0.1]}, {"w": "Ubuntu", "b": [0.2372, 0.0852, 0.294, 0.1]}, {"w": "Intel", "b": [0.1294, 0.1012, 0.1641, 0.116]}, {"w": "intermediate", "b": [0.1294, 0.1173, 0.224, 0.1321]}, {"w": "activations,", "b": [0.2287, 0.1173, 0.3154, 0.1321]}, {"w": "visualizing", "b": [0.3202, 0.1173, 0.4032, 0.1321]}, {"w": "investments", "b": [0.1294, 0.1333, 0.2198, 0.1481]}, {"w": "in", "b": [0.2245, 0.1333, 0.2393, 0.1481]}, {"w": "deep", "b": [0.244, 0.1333, 0.2797, 0.1481]}, {"w": "learning", "b": [0.2844, 0.1333, 0.3464, 0.1481]}, {"w": "ipython", "b": [0.1294, 0.1494, 0.1872, 0.1642]}, {"w": "command", "b": [0.192, 0.1494, 0.2666, 0.1642]}]}, {"id": "b_2", "type": "paragraph", "text": "joint feature learning Jupyter notebooks configuring overview running on AWS GPU instances", "words": [{"w": "joint", "b": [0.1294, 0.2296, 0.1641, 0.2444]}, {"w": "feature", "b": [0.1688, 0.2296, 0.2214, 0.2444]}, {"w": "learning", "b": [0.2261, 0.2296, 0.2881, 0.2444]}, {"w": "Jupyter", "b": [0.1294, 0.2456, 0.1851, 0.2604]}, {"w": "notebooks", "b": [0.1898, 0.2456, 0.2676, 0.2604]}, {"w": "configuring", "b": [0.1521, 0.2608, 0.2404, 0.2756]}, {"w": "overview", "b": [0.1521, 0.2768, 0.2225, 0.2916]}, {"w": "running", "b": [0.1521, 0.2928, 0.2316, 0.3079]}, {"w": "on", "b": [0.2429, 0.2928, 0.2656, 0.3079]}, {"w": "AWS", "b": [0.277, 0.2928, 0.311, 0.3079]}, {"w": "GPU", "b": [0.3224, 0.2928, 0.3564, 0.3079]}, {"w": "instances", "b": [0.3678, 0.2928, 0.47, 0.3079]}]}, {"id": "b_3", "type": "paragraph", "text": "installing Keras setting up AWS GPU instances setting up local port forwarding", "words": [{"w": "installing", "b": [0.1748, 0.308, 0.2453, 0.3228]}, {"w": "Keras", "b": [0.25, 0.308, 0.2941, 0.3228]}, {"w": "setting", "b": [0.1748, 0.3241, 0.2253, 0.3389]}, {"w": "up", "b": [0.23, 0.3241, 0.2489, 0.3389]}, {"w": "AWS", "b": [0.2537, 0.3241, 0.2942, 0.3389]}, {"w": "GPU", "b": [0.2989, 0.3241, 0.3367, 0.3389]}, {"w": "instances", "b": [0.3415, 0.3241, 0.4108, 0.3389]}, {"w": "setting", "b": [0.1748, 0.3401, 0.2253, 0.3549]}, {"w": "up", "b": [0.23, 0.3401, 0.2489, 0.3549]}, {"w": "local", "b": [0.2537, 0.3401, 0.2904, 0.3549]}, {"w": "port", "b": [0.2952, 0.3401, 0.3256, 0.3549]}, {"w": "forwarding", "b": [0.3304, 0.3401, 0.4144, 0.3549]}]}, {"id": "b_4", "type": "paragraph", "text": "using from local browsers using on AWS", "words": [{"w": "using", "b": [0.1521, 0.3562, 0.1931, 0.371]}, {"w": "from", "b": [0.1978, 0.3562, 0.2346, 0.371]}, {"w": "local", "b": [0.2394, 0.3562, 0.2761, 0.371]}, {"w": "browsers", "b": [0.2809, 0.3562, 0.3492, 0.371]}, {"w": "using", "b": [0.1521, 0.3722, 0.1931, 0.387]}, {"w": "on", "b": [0.1978, 0.3722, 0.2168, 0.387]}, {"w": "AWS", "b": [0.2215, 0.3722, 0.262, 0.387]}]}, {"id": "b_6", "type": "paragraph", "text": "K80, NVIDIA Kaggle platform", "words": [{"w": "K80,", "b": [0.1294, 0.4533, 0.1667, 0.4681]}, {"w": "NVIDIA", "b": [0.1715, 0.4533, 0.2387, 0.4681]}, {"w": "Kaggle", "b": [0.1294, 0.4844, 0.1975, 0.4995]}, {"w": "platform", "b": [0.2089, 0.4844, 0.2997, 0.4995]}]}, {"id": "b_7", "type": "paragraph", "text": "overview, 2nd, 3rd", "words": [{"w": "overview,", "b": [0.1521, 0.5023, 0.2338, 0.5183]}, {"w": "2nd,", "b": [0.2452, 0.4996, 0.2807, 0.5183]}, {"w": "3rd", "b": [0.2921, 0.4996, 0.3138, 0.5171]}]}, {"id": "b_8", "type": "paragraph", "text": "practice on real-world problems using Keras API directed acyclic graphs of layers", "words": [{"w": "practice", "b": [0.1521, 0.5184, 0.212, 0.5332]}, {"w": "on", "b": [0.2167, 0.5184, 0.2356, 0.5332]}, {"w": "real-world", "b": [0.2404, 0.5184, 0.3192, 0.5332]}, {"w": "problems", "b": [0.3239, 0.5184, 0.3943, 0.5332]}, {"w": "using", "b": [0.3991, 0.5184, 0.44, 0.5332]}, {"w": "Keras", "b": [0.1294, 0.5344, 0.1735, 0.5492]}, {"w": "API", "b": [0.1783, 0.5344, 0.2087, 0.5492]}, {"w": "directed", "b": [0.1521, 0.5496, 0.2131, 0.5644]}, {"w": "acyclic", "b": [0.2178, 0.5496, 0.2714, 0.5644]}, {"w": "graphs", "b": [0.2761, 0.5496, 0.3265, 0.5644]}, {"w": "of", "b": [0.3313, 0.5496, 0.347, 0.5644]}, {"w": "layers", "b": [0.3518, 0.5496, 0.3969, 0.5644]}]}, {"id": "b_9", "type": "paragraph", "text": "exploring functional APIs implementing DeepDream in", "words": [{"w": "exploring", "b": [0.1521, 0.5656, 0.2246, 0.5804]}, {"w": "functional", "b": [0.1521, 0.5817, 0.2288, 0.5965]}, {"w": "APIs", "b": [0.2336, 0.5817, 0.2714, 0.5965]}, {"w": "implementing", "b": [0.1521, 0.5977, 0.2572, 0.6125]}, {"w": "DeepDream", "b": [0.262, 0.5977, 0.3534, 0.6125]}, {"w": "in", "b": [0.3581, 0.5977, 0.3728, 0.6125]}]}, {"id": "b_10", "type": "paragraph", "text": "installing, 2nd", "words": [{"w": "installing,", "b": [0.1521, 0.6164, 0.2339, 0.6323]}, {"w": "2nd", "b": [0.2452, 0.6137, 0.2694, 0.6312]}]}, {"id": "b_11", "type": "equation", "text": "layer weight sharing models as layers multi-input models", "words": [{"w": "layer", "b": [0.1521, 0.6325, 0.1899, 0.6473]}, {"w": "weight", "b": [0.1947, 0.6325, 0.2462, 0.6473]}, {"w": "sharing", "b": [0.2509, 0.6325, 0.3066, 0.6473]}, {"w": "models", "b": [0.1521, 0.6485, 0.2068, 0.6633]}, {"w": "as", "b": [0.2115, 0.6485, 0.2273, 0.6633]}, {"w": "layers", "b": [0.232, 0.6485, 0.2772, 0.6633]}, {"w": "multi-input", "b": [0.1521, 0.6645, 0.2373, 0.6794]}, {"w": "models", "b": [0.242, 0.6645, 0.2967, 0.6794]}]}, {"id": "b_12", "type": "equation", "text": "multi-output models neural style transfer in recurrent layers in", "words": [{"w": "multi-output", "b": [0.1521, 0.6806, 0.2467, 0.6954]}, {"w": "models", "b": [0.2515, 0.6806, 0.3061, 0.6954]}, {"w": "neural", "b": [0.1521, 0.6966, 0.1994, 0.7114]}, {"w": "style", "b": [0.2041, 0.6966, 0.2399, 0.7114]}, {"w": "transfer", "b": [0.2446, 0.6966, 0.3024, 0.7114]}, {"w": "in", "b": [0.3071, 0.6966, 0.3218, 0.7114]}, {"w": "recurrent", "b": [0.1521, 0.7127, 0.2204, 0.7275]}, {"w": "layers", "b": [0.2251, 0.7127, 0.2703, 0.7275]}, {"w": "in", "b": [0.275, 0.7127, 0.2898, 0.7275]}]}, {"id": "b_13", "type": "paragraph", "text": "using callbacks Keras framework CNTK developing with running TensorFlow Theano Keras library keras.applications module keras.callbacks module, 2nd keras.preprocessing.image", "words": [{"w": "using", "b": [0.1521, 0.7287, 0.1931, 0.7435]}, {"w": "callbacks", "b": [0.1978, 0.7287, 0.2682, 0.7435]}, {"w": "Keras", "b": [0.1294, 0.7448, 0.1735, 0.7596]}, {"w": "framework", "b": [0.1783, 0.7448, 0.2613, 0.7596]}, {"w": "CNTK", "b": [0.1521, 0.7599, 0.2036, 0.7747]}, {"w": "developing", "b": [0.1521, 0.776, 0.2362, 0.7908]}, {"w": "with", "b": [0.2409, 0.776, 0.2746, 0.7908]}, {"w": "running", "b": [0.1521, 0.792, 0.211, 0.8068]}, {"w": "TensorFlow", "b": [0.1521, 0.808, 0.2422, 0.8229]}, {"w": "Theano", "b": [0.1521, 0.8241, 0.2089, 0.8389]}, {"w": "Keras", "b": [0.1294, 0.8401, 0.1735, 0.8549]}, {"w": "library", "b": [0.1783, 0.8401, 0.2287, 0.8549]}, {"w": "keras.applications", "b": [0.1294, 0.8562, 0.2655, 0.871]}, {"w": "module", "b": [0.2702, 0.8562, 0.327, 0.871]}, {"w": "keras.callbacks", "b": [0.1294, 0.8722, 0.2445, 0.887]}, {"w": "module,", "b": [0.2492, 0.8722, 0.3173, 0.8882]}, {"w": "2nd", "b": [0.3286, 0.8722, 0.3486, 0.887]}, {"w": "keras.preprocessing.image", "b": [0.1294, 0.8883, 0.3301, 0.9031]}]}]}, {"page": 463, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "kernel methods kernel trick K-fold validation, iterated with shuffling Kingma, Diederik P. Krizhevsky, Alex", "words": [{"w": "kernel", "b": [0.1294, 0.0852, 0.1767, 0.1]}, {"w": "methods", "b": [0.1814, 0.0852, 0.2455, 0.1]}, {"w": "kernel", "b": [0.1294, 0.1012, 0.1767, 0.116]}, {"w": "trick", "b": [0.1814, 0.1012, 0.2161, 0.116]}, {"w": "K-fold", "b": [0.1294, 0.1173, 0.1799, 0.1321]}, {"w": "validation,", "b": [0.1846, 0.1173, 0.265, 0.1321]}, {"w": "iterated", "b": [0.2697, 0.1173, 0.3265, 0.1321]}, {"w": "with", "b": [0.3312, 0.1173, 0.3648, 0.1321]}, {"w": "shuffling", "b": [0.3696, 0.1173, 0.4375, 0.1321]}, {"w": "Kingma,", "b": [0.1294, 0.1333, 0.1951, 0.1481]}, {"w": "Diederik", "b": [0.1998, 0.1333, 0.266, 0.1481]}, {"w": "P.", "b": [0.2708, 0.1333, 0.2839, 0.1481]}, {"w": "Krizhevsky,", "b": [0.1294, 0.1494, 0.2201, 0.1642]}, {"w": "Alex", "b": [0.2249, 0.1494, 0.2616, 0.1642]}]}, {"id": "b_2", "type": "paragraph", "text": "L1 regularization L2 regularization label, 2nd Lambda layer language models sampling from training last-layer activation latent spaces of images, sampling from overview layer compatibility layered representations learning layers differentiable", "words": [{"w": "L1", "b": [0.1294, 0.2296, 0.1504, 0.2444]}, {"w": "regularization", "b": [0.1552, 0.2296, 0.2602, 0.2444]}, {"w": "L2", "b": [0.1294, 0.2456, 0.1504, 0.2604]}, {"w": "regularization", "b": [0.1552, 0.2456, 0.2602, 0.2604]}, {"w": "label,", "b": [0.1294, 0.2617, 0.1775, 0.2776]}, {"w": "2nd", "b": [0.1889, 0.2616, 0.2088, 0.2765]}, {"w": "Lambda", "b": [0.1294, 0.2777, 0.1914, 0.2925]}, {"w": "layer", "b": [0.1961, 0.2777, 0.234, 0.2925]}, {"w": "language", "b": [0.1294, 0.3088, 0.2202, 0.3239]}, {"w": "models", "b": [0.2316, 0.3088, 0.2997, 0.3239]}, {"w": "sampling", "b": [0.1521, 0.3241, 0.2215, 0.3389]}, {"w": "from", "b": [0.2262, 0.3241, 0.263, 0.3389]}, {"w": "training", "b": [0.1521, 0.3401, 0.211, 0.3549]}, {"w": "last-layer", "b": [0.1294, 0.3562, 0.1998, 0.371]}, {"w": "activation", "b": [0.2045, 0.3562, 0.2792, 0.371]}, {"w": "latent", "b": [0.1294, 0.3872, 0.1975, 0.4024]}, {"w": "spaces", "b": [0.2089, 0.3872, 0.277, 0.4024]}, {"w": "of", "b": [0.1521, 0.4025, 0.1679, 0.4173]}, {"w": "images,", "b": [0.1726, 0.4025, 0.2309, 0.4173]}, {"w": "sampling", "b": [0.2357, 0.4025, 0.305, 0.4173]}, {"w": "from", "b": [0.3098, 0.4025, 0.3465, 0.4173]}, {"w": "overview", "b": [0.1521, 0.4185, 0.2225, 0.4333]}, {"w": "layer", "b": [0.1294, 0.4346, 0.1672, 0.4494]}, {"w": "compatibility", "b": [0.172, 0.4346, 0.2729, 0.4494]}, {"w": "layered", "b": [0.1294, 0.4506, 0.1851, 0.4654]}, {"w": "representations", "b": [0.1898, 0.4506, 0.3044, 0.4654]}, {"w": "learning", "b": [0.3091, 0.4506, 0.3711, 0.4654]}, {"w": "layers", "b": [0.1294, 0.4817, 0.1975, 0.4969]}, {"w": "differentiable", "b": [0.1521, 0.497, 0.2537, 0.5118]}]}, {"id": "b_3", "type": "paragraph", "text": "directed acyclic graphs of inception modules residual connections", "words": [{"w": "directed", "b": [0.1521, 0.513, 0.2131, 0.5278]}, {"w": "acyclic", "b": [0.2178, 0.513, 0.2714, 0.5278]}, {"w": "graphs", "b": [0.2761, 0.513, 0.3265, 0.5278]}, {"w": "of", "b": [0.3313, 0.513, 0.347, 0.5278]}, {"w": "inception", "b": [0.1748, 0.5291, 0.2452, 0.5439]}, {"w": "modules", "b": [0.25, 0.5291, 0.3141, 0.5439]}, {"w": "residual", "b": [0.1748, 0.5451, 0.2347, 0.5599]}, {"w": "connections", "b": [0.2394, 0.5451, 0.3298, 0.5599]}]}, {"id": "b_4", "type": "paragraph", "text": "freezing models as overview, 2nd", "words": [{"w": "freezing", "b": [0.1521, 0.5612, 0.2141, 0.576]}, {"w": "models", "b": [0.1521, 0.5772, 0.2068, 0.592]}, {"w": "as", "b": [0.2115, 0.5772, 0.2273, 0.592]}, {"w": "overview,", "b": [0.1521, 0.5959, 0.2338, 0.6118]}, {"w": "2nd", "b": [0.2452, 0.5932, 0.2694, 0.6107]}]}, {"id": "b_5", "type": "paragraph", "text": "recurrent", "words": [{"w": "recurrent", "b": [0.1521, 0.6119, 0.2543, 0.627]}]}, {"id": "b_6", "type": "paragraph", "text": "in Keras stacking unfreezing", "words": [{"w": "in", "b": [0.1748, 0.6271, 0.1895, 0.6419]}, {"w": "Keras", "b": [0.1943, 0.6271, 0.2384, 0.6419]}, {"w": "stacking", "b": [0.1748, 0.6432, 0.2379, 0.658]}, {"w": "unfreezing", "b": [0.1521, 0.6592, 0.233, 0.674]}]}, {"id": "b_7", "type": "paragraph", "text": "weight sharing layer-wise pretraining LeakyReLU layer LeCun, Yann, 2nd LeNet network LHC (Large Hadron Collider) lifelong learning linear transformations local generalization, extreme generalization vs. local port forwarding, setting up logistic regression algorithm logreg (logistic regression) logs argument lookback parameter", "words": [{"w": "weight", "b": [0.1521, 0.6752, 0.2036, 0.69]}, {"w": "sharing", "b": [0.2083, 0.6752, 0.264, 0.69]}, {"w": "layer-wise", "b": [0.1294, 0.6913, 0.2078, 0.7061]}, {"w": "pretraining", "b": [0.2126, 0.6913, 0.2956, 0.7061]}, {"w": "LeakyReLU", "b": [0.1294, 0.7073, 0.2229, 0.7221]}, {"w": "layer", "b": [0.2277, 0.7073, 0.2655, 0.7221]}, {"w": "LeCun,", "b": [0.1294, 0.7234, 0.1856, 0.7382]}, {"w": "Yann,", "b": [0.1904, 0.7234, 0.2408, 0.7393]}, {"w": "2nd", "b": [0.2522, 0.7233, 0.2721, 0.7382]}, {"w": "LeNet", "b": [0.1294, 0.7394, 0.1767, 0.7542]}, {"w": "network", "b": [0.1814, 0.7394, 0.2434, 0.7542]}, {"w": "LHC", "b": [0.1294, 0.7555, 0.1673, 0.7703]}, {"w": "(Large", "b": [0.172, 0.7555, 0.2221, 0.7703]}, {"w": "Hadron", "b": [0.2268, 0.7555, 0.2835, 0.7703]}, {"w": "Collider)", "b": [0.2883, 0.7555, 0.3566, 0.7703]}, {"w": "lifelong", "b": [0.1294, 0.7715, 0.1883, 0.7863]}, {"w": "learning", "b": [0.193, 0.7715, 0.255, 0.7863]}, {"w": "linear", "b": [0.1294, 0.7875, 0.1725, 0.8024]}, {"w": "transformations", "b": [0.1772, 0.7875, 0.296, 0.8024]}, {"w": "local", "b": [0.1294, 0.8036, 0.1662, 0.8184]}, {"w": "generalization,", "b": [0.1709, 0.8036, 0.2828, 0.8184]}, {"w": "extreme", "b": [0.2876, 0.8036, 0.3485, 0.8184]}, {"w": "generalization", "b": [0.3532, 0.8036, 0.4604, 0.8184]}, {"w": "vs.", "b": [0.4651, 0.8036, 0.4867, 0.8184]}, {"w": "local", "b": [0.1294, 0.8196, 0.1662, 0.8344]}, {"w": "port", "b": [0.1709, 0.8196, 0.2014, 0.8344]}, {"w": "forwarding,", "b": [0.2061, 0.8196, 0.2949, 0.8344]}, {"w": "setting", "b": [0.2996, 0.8196, 0.3501, 0.8344]}, {"w": "up", "b": [0.3548, 0.8196, 0.3738, 0.8344]}, {"w": "logistic", "b": [0.1294, 0.8357, 0.1851, 0.8505]}, {"w": "regression", "b": [0.1899, 0.8357, 0.2676, 0.8505]}, {"w": "algorithm", "b": [0.2723, 0.8357, 0.3459, 0.8505]}, {"w": "logreg", "b": [0.1294, 0.8517, 0.1778, 0.8665]}, {"w": "(logistic", "b": [0.1825, 0.8517, 0.2445, 0.8665]}, {"w": "regression)", "b": [0.2492, 0.8517, 0.3333, 0.8665]}, {"w": "logs", "b": [0.1294, 0.8678, 0.161, 0.8826]}, {"w": "argument", "b": [0.1657, 0.8678, 0.2368, 0.8826]}, {"w": "lookback", "b": [0.1294, 0.8838, 0.1988, 0.8986]}, {"w": "parameter", "b": [0.2035, 0.8838, 0.2791, 0.8986]}]}]}, {"page": 464, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "lookback timesteps loss function, 2nd, 3rd, 4th, 5th loss plateau loss value Lovelace, Ada LSTM (long short-term memory), 2nd", "words": [{"w": "lookback", "b": [0.1294, 0.0852, 0.1988, 0.1]}, {"w": "timesteps", "b": [0.2035, 0.0852, 0.275, 0.1]}, {"w": "loss", "b": [0.1294, 0.1012, 0.1589, 0.116]}, {"w": "function,", "b": [0.1636, 0.1012, 0.238, 0.1172]}, {"w": "2nd,", "b": [0.2493, 0.1012, 0.2806, 0.1172]}, {"w": "3rd,", "b": [0.292, 0.1012, 0.3215, 0.1172]}, {"w": "4th,", "b": [0.3329, 0.1012, 0.3619, 0.1172]}, {"w": "5th", "b": [0.3732, 0.1012, 0.3908, 0.116]}, {"w": "loss", "b": [0.1294, 0.1173, 0.1589, 0.1321]}, {"w": "plateau", "b": [0.1636, 0.1173, 0.2182, 0.1321]}, {"w": "loss", "b": [0.1294, 0.1333, 0.1589, 0.1481]}, {"w": "value", "b": [0.1636, 0.1333, 0.2046, 0.1481]}, {"w": "Lovelace,", "b": [0.1294, 0.1494, 0.2035, 0.1642]}, {"w": "Ada", "b": [0.2082, 0.1494, 0.2397, 0.1642]}, {"w": "LSTM", "b": [0.1294, 0.1654, 0.1799, 0.1802]}, {"w": "(long", "b": [0.1846, 0.1654, 0.2245, 0.1802]}, {"w": "short-term", "b": [0.2293, 0.1654, 0.3081, 0.1802]}, {"w": "memory),", "b": [0.3128, 0.1654, 0.3935, 0.1813]}, {"w": "2nd", "b": [0.4048, 0.1654, 0.4248, 0.1802]}]}, {"id": "b_1", "type": "paragraph", "text": "generating text with generating sequence data", "words": [{"w": "generating", "b": [0.1521, 0.1815, 0.232, 0.1963]}, {"w": "text", "b": [0.2367, 0.1815, 0.2651, 0.1963]}, {"w": "with", "b": [0.2698, 0.1815, 0.3035, 0.1963]}, {"w": "generating", "b": [0.1748, 0.1975, 0.2547, 0.2123]}, {"w": "sequence", "b": [0.2594, 0.1975, 0.3287, 0.2123]}, {"w": "data", "b": [0.3335, 0.1975, 0.365, 0.2123]}]}, {"id": "b_2", "type": "paragraph", "text": "history of generative recurrent networks implementing character-level text generation sampling strategy", "words": [{"w": "history", "b": [0.1748, 0.2135, 0.2274, 0.2283]}, {"w": "of", "b": [0.2321, 0.2135, 0.2479, 0.2283]}, {"w": "generative", "b": [0.2526, 0.2135, 0.3314, 0.2283]}, {"w": "recurrent", "b": [0.3361, 0.2135, 0.4044, 0.2283]}, {"w": "networks", "b": [0.4091, 0.2135, 0.4785, 0.2283]}, {"w": "implementing", "b": [0.1748, 0.2296, 0.2799, 0.2444]}, {"w": "character-level", "b": [0.2847, 0.2296, 0.3966, 0.2444]}, {"w": "text", "b": [0.4014, 0.2296, 0.4298, 0.2444]}, {"w": "generation", "b": [0.4345, 0.2296, 0.5143, 0.2444]}, {"w": "sampling", "b": [0.1748, 0.2456, 0.2442, 0.2604]}, {"w": "strategy", "b": [0.2489, 0.2456, 0.3088, 0.2604]}]}, {"id": "b_3", "type": "paragraph", "text": "overview, 2nd", "words": [{"w": "overview,", "b": [0.1521, 0.2643, 0.2338, 0.2803]}, {"w": "2nd", "b": [0.2452, 0.2617, 0.2694, 0.2792]}]}, {"id": "b_5", "type": "paragraph", "text": "machine learning automated basic approaches branches of reinforcement learning self-supervised learning supervised learning unsupervised learning data preprocessing deep learning vs. evaluating models of choosing evaluation protocols test sets training sets validation sets feature engineering feature learning history of decision trees gradient boosting machines", "words": [{"w": "machine", "b": [0.1294, 0.3757, 0.2089, 0.3908]}, {"w": "learning", "b": [0.2202, 0.3757, 0.311, 0.3908]}, {"w": "automated", "b": [0.1521, 0.3909, 0.2309, 0.4057]}, {"w": "basic", "b": [0.1521, 0.407, 0.191, 0.4218]}, {"w": "approaches", "b": [0.1957, 0.407, 0.2808, 0.4218]}, {"w": "branches", "b": [0.1521, 0.423, 0.2194, 0.4378]}, {"w": "of", "b": [0.2241, 0.423, 0.2398, 0.4378]}, {"w": "reinforcement", "b": [0.1748, 0.439, 0.2809, 0.4538]}, {"w": "learning", "b": [0.2857, 0.439, 0.3477, 0.4538]}, {"w": "self-supervised", "b": [0.1748, 0.4551, 0.2894, 0.4699]}, {"w": "learning", "b": [0.2941, 0.4551, 0.3561, 0.4699]}, {"w": "supervised", "b": [0.1748, 0.4711, 0.2557, 0.4859]}, {"w": "learning", "b": [0.2605, 0.4711, 0.3225, 0.4859]}, {"w": "unsupervised", "b": [0.1748, 0.4872, 0.2747, 0.502]}, {"w": "learning", "b": [0.2794, 0.4872, 0.3414, 0.502]}, {"w": "data", "b": [0.1521, 0.5032, 0.1836, 0.518]}, {"w": "preprocessing", "b": [0.1884, 0.5032, 0.2934, 0.518]}, {"w": "deep", "b": [0.1521, 0.5193, 0.1878, 0.5341]}, {"w": "learning", "b": [0.1926, 0.5193, 0.2546, 0.5341]}, {"w": "vs.", "b": [0.2593, 0.5193, 0.2808, 0.5341]}, {"w": "evaluating", "b": [0.1521, 0.5353, 0.2309, 0.5501]}, {"w": "models", "b": [0.2357, 0.5353, 0.2903, 0.5501]}, {"w": "of", "b": [0.2951, 0.5353, 0.3108, 0.5501]}, {"w": "choosing", "b": [0.1748, 0.5513, 0.2431, 0.5662]}, {"w": "evaluation", "b": [0.2479, 0.5513, 0.3267, 0.5662]}, {"w": "protocols", "b": [0.3314, 0.5513, 0.4018, 0.5662]}, {"w": "test", "b": [0.1748, 0.5674, 0.2011, 0.5822]}, {"w": "sets", "b": [0.2058, 0.5674, 0.2342, 0.5822]}, {"w": "training", "b": [0.1748, 0.5834, 0.2337, 0.5982]}, {"w": "sets", "b": [0.2384, 0.5834, 0.2668, 0.5982]}, {"w": "validation", "b": [0.1748, 0.5995, 0.2505, 0.6143]}, {"w": "sets", "b": [0.2552, 0.5995, 0.2836, 0.6143]}, {"w": "feature", "b": [0.1521, 0.6155, 0.2046, 0.6303]}, {"w": "engineering", "b": [0.2094, 0.6155, 0.2987, 0.6303]}, {"w": "feature", "b": [0.1521, 0.6316, 0.2046, 0.6464]}, {"w": "learning", "b": [0.2094, 0.6316, 0.2714, 0.6464]}, {"w": "history", "b": [0.1521, 0.6476, 0.2047, 0.6624]}, {"w": "of", "b": [0.2094, 0.6476, 0.2252, 0.6624]}, {"w": "decision", "b": [0.1748, 0.6637, 0.2379, 0.6785]}, {"w": "trees", "b": [0.2426, 0.6637, 0.2783, 0.6785]}, {"w": "gradient", "b": [0.1748, 0.6797, 0.2368, 0.6945]}, {"w": "boosting", "b": [0.2415, 0.6797, 0.3067, 0.6945]}, {"w": "machines", "b": [0.3115, 0.6797, 0.3829, 0.6945]}]}, {"id": "b_6", "type": "paragraph", "text": "kernel methods neural networks, 2nd probabilistic modeling random forests learning representations from data models, risk of anthropo-morphizing overfitting and underfitting adding dropout adding weight regularization reducing network size workflow of, 2nd", "words": [{"w": "kernel", "b": [0.1748, 0.6957, 0.2221, 0.7105]}, {"w": "methods", "b": [0.2268, 0.6957, 0.2909, 0.7105]}, {"w": "neural", "b": [0.1748, 0.7118, 0.2221, 0.7266]}, {"w": "networks,", "b": [0.2268, 0.7118, 0.3075, 0.7277]}, {"w": "2nd", "b": [0.3189, 0.7126, 0.3529, 0.7277]}, {"w": "probabilistic", "b": [0.1748, 0.7278, 0.2694, 0.7426]}, {"w": "modeling", "b": [0.2741, 0.7278, 0.3456, 0.7426]}, {"w": "random", "b": [0.1748, 0.7439, 0.2326, 0.7587]}, {"w": "forests", "b": [0.2373, 0.7439, 0.2878, 0.7587]}, {"w": "learning", "b": [0.1521, 0.7599, 0.2141, 0.7747]}, {"w": "representations", "b": [0.2188, 0.7599, 0.3334, 0.7747]}, {"w": "from", "b": [0.3381, 0.7599, 0.3749, 0.7747]}, {"w": "data", "b": [0.3796, 0.7599, 0.4111, 0.7747]}, {"w": "models,", "b": [0.1521, 0.776, 0.2115, 0.7908]}, {"w": "risk", "b": [0.2162, 0.776, 0.2446, 0.7908]}, {"w": "of", "b": [0.2493, 0.776, 0.2651, 0.7908]}, {"w": "anthropo-morphizing", "b": [0.2698, 0.776, 0.4306, 0.7908]}, {"w": "overfitting", "b": [0.1521, 0.792, 0.232, 0.8068]}, {"w": "and", "b": [0.2367, 0.792, 0.264, 0.8068]}, {"w": "underfitting", "b": [0.2688, 0.792, 0.3581, 0.8068]}, {"w": "adding", "b": [0.1748, 0.808, 0.2263, 0.8229]}, {"w": "dropout", "b": [0.231, 0.808, 0.2899, 0.8229]}, {"w": "adding", "b": [0.1748, 0.8241, 0.2263, 0.8389]}, {"w": "weight", "b": [0.231, 0.8241, 0.2825, 0.8389]}, {"w": "regularization", "b": [0.2873, 0.8241, 0.3924, 0.8389]}, {"w": "reducing", "b": [0.1748, 0.8401, 0.241, 0.8549]}, {"w": "network", "b": [0.2457, 0.8401, 0.3077, 0.8549]}, {"w": "size", "b": [0.3125, 0.8401, 0.3419, 0.8549]}, {"w": "workflow", "b": [0.1521, 0.8589, 0.2257, 0.8737]}, {"w": "of,", "b": [0.2304, 0.8589, 0.2575, 0.8748]}, {"w": "2nd", "b": [0.2689, 0.8562, 0.293, 0.8737]}]}, {"id": "b_7", "type": "paragraph", "text": "assembling datasets choosing evaluation protocol", "words": [{"w": "assembling", "b": [0.1748, 0.8749, 0.26, 0.8897]}, {"w": "datasets", "b": [0.2647, 0.8749, 0.3246, 0.8897]}, {"w": "choosing", "b": [0.1748, 0.8909, 0.2431, 0.9057]}, {"w": "evaluation", "b": [0.2479, 0.8909, 0.3267, 0.9057]}, {"w": "protocol", "b": [0.3314, 0.8909, 0.3945, 0.9057]}]}]}, {"page": 465, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "choosing measure of success defining problems developing models preparing data regularizing models tuning hyperparameters. See non-machine learning. MAE (mean absolute error), 2nd, 3rd, 4th Matplotlib library, 2nd, 3rd matrices (2D tensors) maximum operation max-pooling operations MaxPooling1D layer, 2nd MaxPooling2D layer, 2nd, 3rd mean_squared_error memorization capacity metrics metrics, logging Microsoft Cognitive Toolkit. See CNTK. Mikolov, Tomas mini-batch mini-batch SGD (mini-batch stochastic gradient descent) Minsky, Marvin MNIST dataset, 2nd model checkpointing Model class model depth model plot model.fit() function model.fit_generator() function ModelCheckpoint callbacks models architecture patterns batch normalization depthwise separable convolution residual connections, 2nd as layers as programs defining developing achieving statistical power", "words": [{"w": "choosing", "b": [0.1748, 0.0852, 0.2431, 0.1]}, {"w": "measure", "b": [0.2479, 0.0852, 0.3109, 0.1]}, {"w": "of", "b": [0.3156, 0.0852, 0.3314, 0.1]}, {"w": "success", "b": [0.3361, 0.0852, 0.3929, 0.1]}, {"w": "defining", "b": [0.1748, 0.1012, 0.2379, 0.116]}, {"w": "problems", "b": [0.2426, 0.1012, 0.313, 0.116]}, {"w": "developing", "b": [0.1748, 0.1173, 0.2589, 0.1321]}, {"w": "models", "b": [0.2636, 0.1173, 0.3183, 0.1321]}, {"w": "preparing", "b": [0.1748, 0.1333, 0.2473, 0.1481]}, {"w": "data", "b": [0.252, 0.1333, 0.2836, 0.1481]}, {"w": "regularizing", "b": [0.1748, 0.1494, 0.2662, 0.1642]}, {"w": "models", "b": [0.271, 0.1494, 0.3256, 0.1642]}, {"w": "tuning", "b": [0.1748, 0.1654, 0.2232, 0.1802]}, {"w": "hyperparameters.", "b": [0.2279, 0.1654, 0.3653, 0.1813]}, {"w": "See", "b": [0.1748, 0.1813, 0.2089, 0.1965]}, {"w": "non-machine", "b": [0.2202, 0.1813, 0.3451, 0.1965]}, {"w": "learning.", "b": [0.3564, 0.1813, 0.4586, 0.1965]}, {"w": "MAE", "b": [0.1294, 0.1966, 0.1715, 0.2114]}, {"w": "(mean", "b": [0.1762, 0.1966, 0.2235, 0.2114]}, {"w": "absolute", "b": [0.2282, 0.1966, 0.2912, 0.2114]}, {"w": "error),", "b": [0.296, 0.1966, 0.3504, 0.2125]}, {"w": "2nd,", "b": [0.3617, 0.1966, 0.393, 0.2125]}, {"w": "3rd,", "b": [0.4044, 0.1966, 0.4339, 0.2125]}, {"w": "4th", "b": [0.4453, 0.1966, 0.4629, 0.2114]}, {"w": "Matplotlib", "b": [0.1294, 0.2126, 0.2093, 0.2275]}, {"w": "library,", "b": [0.214, 0.2126, 0.2758, 0.2286]}, {"w": "2nd,", "b": [0.2872, 0.2126, 0.3185, 0.2286]}, {"w": "3rd", "b": [0.3298, 0.2126, 0.348, 0.2275]}, {"w": "matrices", "b": [0.1294, 0.2287, 0.1935, 0.2435]}, {"w": "(2D", "b": [0.1982, 0.2287, 0.2277, 0.2435]}, {"w": "tensors)", "b": [0.2324, 0.2287, 0.2923, 0.2435]}, {"w": "maximum", "b": [0.1294, 0.2447, 0.2061, 0.2595]}, {"w": "operation", "b": [0.2109, 0.2447, 0.2823, 0.2595]}, {"w": "max-pooling", "b": [0.1294, 0.2608, 0.2261, 0.2756]}, {"w": "operations", "b": [0.2308, 0.2608, 0.3097, 0.2756]}, {"w": "MaxPooling1D", "b": [0.1294, 0.2768, 0.2461, 0.2916]}, {"w": "layer,", "b": [0.2508, 0.2768, 0.3, 0.2928]}, {"w": "2nd", "b": [0.3113, 0.2768, 0.3313, 0.2916]}, {"w": "MaxPooling2D", "b": [0.1294, 0.2929, 0.2461, 0.3077]}, {"w": "layer,", "b": [0.2508, 0.2929, 0.3, 0.3088]}, {"w": "2nd,", "b": [0.3113, 0.2928, 0.3426, 0.3088]}, {"w": "3rd", "b": [0.354, 0.2928, 0.3722, 0.3077]}, {"w": "mean_squared_error", "b": [0.1294, 0.3089, 0.2849, 0.3237]}, {"w": "memorization", "b": [0.1294, 0.325, 0.2345, 0.3398]}, {"w": "capacity", "b": [0.2392, 0.325, 0.3023, 0.3398]}, {"w": "metrics", "b": [0.1294, 0.341, 0.1851, 0.3558]}, {"w": "metrics,", "b": [0.1294, 0.357, 0.1898, 0.3718]}, {"w": "logging", "b": [0.1946, 0.357, 0.2524, 0.3718]}, {"w": "Microsoft", "b": [0.1294, 0.3731, 0.204, 0.3879]}, {"w": "Cognitive", "b": [0.2088, 0.3731, 0.2834, 0.3879]}, {"w": "Toolkit.", "b": [0.2881, 0.3731, 0.3538, 0.389]}, {"w": "See", "b": [0.1748, 0.389, 0.2089, 0.4042]}, {"w": "CNTK.", "b": [0.2202, 0.389, 0.277, 0.4042]}, {"w": "Mikolov,", "b": [0.1294, 0.4043, 0.1981, 0.4191]}, {"w": "Tomas", "b": [0.2028, 0.4043, 0.253, 0.4191]}, {"w": "mini-batch", "b": [0.1294, 0.4203, 0.2114, 0.4351]}, {"w": "mini-batch", "b": [0.1294, 0.4364, 0.2114, 0.4512]}, {"w": "SGD", "b": [0.2161, 0.4364, 0.254, 0.4512]}, {"w": "(mini-batch", "b": [0.2587, 0.4364, 0.347, 0.4512]}, {"w": "stochastic", "b": [0.3517, 0.4364, 0.4263, 0.4512]}, {"w": "gradient", "b": [0.431, 0.4364, 0.493, 0.4512]}, {"w": "descent)", "b": [0.4978, 0.4364, 0.5608, 0.4512]}, {"w": "Minsky,", "b": [0.1294, 0.4524, 0.1907, 0.4672]}, {"w": "Marvin", "b": [0.1955, 0.4524, 0.2512, 0.4672]}, {"w": "MNIST", "b": [0.1294, 0.4685, 0.1883, 0.4833]}, {"w": "dataset,", "b": [0.193, 0.4685, 0.2569, 0.4844]}, {"w": "2nd", "b": [0.2682, 0.4684, 0.2882, 0.4833]}, {"w": "model", "b": [0.1294, 0.4845, 0.1767, 0.4993]}, {"w": "checkpointing", "b": [0.1814, 0.4845, 0.2886, 0.4993]}, {"w": "Model", "b": [0.1294, 0.5005, 0.1788, 0.5153]}, {"w": "class", "b": [0.1835, 0.5005, 0.2203, 0.5153]}, {"w": "model", "b": [0.1294, 0.5166, 0.1767, 0.5314]}, {"w": "depth", "b": [0.1814, 0.5166, 0.2235, 0.5314]}, {"w": "model", "b": [0.1294, 0.5326, 0.1767, 0.5474]}, {"w": "plot", "b": [0.1814, 0.5326, 0.2109, 0.5474]}, {"w": "model.fit()", "b": [0.1294, 0.5487, 0.2109, 0.5635]}, {"w": "function", "b": [0.2156, 0.5487, 0.2786, 0.5635]}, {"w": "model.fit_generator()", "b": [0.1294, 0.5647, 0.2918, 0.5795]}, {"w": "function", "b": [0.2965, 0.5647, 0.3595, 0.5795]}, {"w": "ModelCheckpoint", "b": [0.1294, 0.5808, 0.266, 0.5956]}, {"w": "callbacks", "b": [0.2708, 0.5808, 0.3412, 0.5956]}, {"w": "models", "b": [0.1294, 0.6119, 0.1975, 0.627]}, {"w": "architecture", "b": [0.1521, 0.6271, 0.2414, 0.6419]}, {"w": "patterns", "b": [0.2461, 0.6271, 0.306, 0.6419]}, {"w": "batch", "b": [0.1748, 0.6432, 0.2158, 0.658]}, {"w": "normalization", "b": [0.2205, 0.6432, 0.3256, 0.658]}, {"w": "depthwise", "b": [0.1748, 0.6592, 0.2515, 0.674]}, {"w": "separable", "b": [0.2563, 0.6592, 0.3277, 0.674]}, {"w": "convolution", "b": [0.3324, 0.6592, 0.4228, 0.674]}, {"w": "residual", "b": [0.1748, 0.6752, 0.2347, 0.69]}, {"w": "connections,", "b": [0.2394, 0.6752, 0.3412, 0.6912]}, {"w": "2nd", "b": [0.3525, 0.676, 0.3866, 0.6912]}, {"w": "as", "b": [0.1521, 0.6913, 0.1679, 0.7061]}, {"w": "layers", "b": [0.1726, 0.6913, 0.2178, 0.7061]}, {"w": "as", "b": [0.1521, 0.7073, 0.1679, 0.7221]}, {"w": "programs", "b": [0.1726, 0.7073, 0.2441, 0.7221]}, {"w": "defining", "b": [0.1521, 0.7234, 0.2152, 0.7382]}, {"w": "developing", "b": [0.1521, 0.7393, 0.2656, 0.7545]}, {"w": "achieving", "b": [0.1748, 0.7546, 0.2484, 0.7694]}, {"w": "statistical", "b": [0.2531, 0.7546, 0.3246, 0.7694]}, {"w": "power", "b": [0.3293, 0.7546, 0.3766, 0.7694]}]}, {"id": "b_1", "type": "paragraph", "text": "determining capacity ensembling evaluating", "words": [{"w": "determining", "b": [0.1748, 0.7706, 0.2663, 0.7854]}, {"w": "capacity", "b": [0.271, 0.7706, 0.334, 0.7854]}, {"w": "ensembling", "b": [0.1521, 0.7867, 0.2394, 0.8015]}, {"w": "evaluating", "b": [0.1521, 0.8027, 0.2309, 0.8175]}]}, {"id": "b_2", "type": "paragraph", "text": "hyperparameter optimization language sampling from training loading GloVe embeddings in machine learning, risk of anthropomorphizing", "words": [{"w": "hyperparameter", "b": [0.1521, 0.8187, 0.2708, 0.8335]}, {"w": "optimization", "b": [0.2756, 0.8187, 0.3712, 0.8335]}, {"w": "language", "b": [0.1521, 0.8347, 0.2429, 0.8498]}, {"w": "sampling", "b": [0.1748, 0.8499, 0.2442, 0.8647]}, {"w": "from", "b": [0.2489, 0.8499, 0.2857, 0.8647]}, {"w": "training", "b": [0.1748, 0.866, 0.2337, 0.8808]}, {"w": "loading", "b": [0.1521, 0.882, 0.2089, 0.8968]}, {"w": "GloVe", "b": [0.2136, 0.882, 0.2619, 0.8968]}, {"w": "embeddings", "b": [0.2667, 0.882, 0.3581, 0.8968]}, {"w": "in", "b": [0.3628, 0.882, 0.3776, 0.8968]}, {"w": "machine", "b": [0.1521, 0.8981, 0.2162, 0.9129]}, {"w": "learning,", "b": [0.2209, 0.8981, 0.2877, 0.9129]}, {"w": "risk", "b": [0.2924, 0.8981, 0.3208, 0.9129]}, {"w": "of", "b": [0.3255, 0.8981, 0.3413, 0.9129]}, {"w": "anthropomorphizing", "b": [0.346, 0.8981, 0.5005, 0.9129]}]}]}, {"page": 466, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "multi-input multi-output regularizing training using Keras callbacks using TensorBoard modular subroutines, reusing modules, inception momentum Moore’s law, 2nd MSE (mean squared error), 2nd, 3rd, 4th, 5th multiclass classifications multihead networks multi-input models multilabel classification, 2nd, 3rd multimodal inputs multi-output models", "words": [{"w": "multi-input", "b": [0.1521, 0.0852, 0.2373, 0.1]}, {"w": "multi-output", "b": [0.1521, 0.1012, 0.2467, 0.116]}, {"w": "regularizing", "b": [0.1521, 0.1173, 0.2435, 0.1321]}, {"w": "training", "b": [0.1521, 0.1333, 0.211, 0.1481]}, {"w": "using", "b": [0.1521, 0.1494, 0.1931, 0.1642]}, {"w": "Keras", "b": [0.1978, 0.1494, 0.242, 0.1642]}, {"w": "callbacks", "b": [0.2467, 0.1494, 0.3171, 0.1642]}, {"w": "using", "b": [0.1521, 0.1654, 0.1931, 0.1802]}, {"w": "TensorBoard", "b": [0.1978, 0.1654, 0.2953, 0.1802]}, {"w": "modular", "b": [0.1294, 0.1815, 0.1925, 0.1963]}, {"w": "subroutines,", "b": [0.1972, 0.1815, 0.2892, 0.1963]}, {"w": "reusing", "b": [0.2939, 0.1815, 0.3496, 0.1963]}, {"w": "modules,", "b": [0.1294, 0.1975, 0.1983, 0.2123]}, {"w": "inception", "b": [0.203, 0.1975, 0.2734, 0.2123]}, {"w": "momentum", "b": [0.1294, 0.2135, 0.2156, 0.2283]}, {"w": "Moore’s", "b": [0.1294, 0.2296, 0.1925, 0.2444]}, {"w": "law,", "b": [0.1972, 0.2296, 0.2359, 0.2455]}, {"w": "2nd", "b": [0.2472, 0.2295, 0.2672, 0.2444]}, {"w": "MSE", "b": [0.1294, 0.2456, 0.1683, 0.2604]}, {"w": "(mean", "b": [0.173, 0.2456, 0.2203, 0.2604]}, {"w": "squared", "b": [0.225, 0.2456, 0.2839, 0.2604]}, {"w": "error),", "b": [0.2886, 0.2456, 0.343, 0.2616]}, {"w": "2nd,", "b": [0.3544, 0.2456, 0.3857, 0.2616]}, {"w": "3rd,", "b": [0.397, 0.2456, 0.4266, 0.2616]}, {"w": "4th,", "b": [0.4379, 0.2456, 0.4669, 0.2616]}, {"w": "5th", "b": [0.4782, 0.2456, 0.4959, 0.2604]}, {"w": "multiclass", "b": [0.1294, 0.2617, 0.2061, 0.2765]}, {"w": "classifications", "b": [0.2109, 0.2617, 0.3181, 0.2765]}, {"w": "multihead", "b": [0.1294, 0.2777, 0.2051, 0.2925]}, {"w": "networks", "b": [0.2098, 0.2777, 0.2792, 0.2925]}, {"w": "multi-input", "b": [0.1294, 0.2938, 0.2146, 0.3086]}, {"w": "models", "b": [0.2193, 0.2938, 0.274, 0.3086]}, {"w": "multilabel", "b": [0.1294, 0.3098, 0.2061, 0.3246]}, {"w": "classification,", "b": [0.2109, 0.3098, 0.322, 0.3257]}, {"w": "2nd,", "b": [0.3334, 0.3098, 0.3647, 0.3257]}, {"w": "3rd", "b": [0.376, 0.3098, 0.3942, 0.3246]}, {"w": "multimodal", "b": [0.1294, 0.3258, 0.2167, 0.3407]}, {"w": "inputs", "b": [0.2214, 0.3258, 0.2677, 0.3407]}, {"w": "multi-output", "b": [0.1294, 0.3419, 0.224, 0.3567]}, {"w": "models", "b": [0.2288, 0.3419, 0.2834, 0.3567]}]}, {"id": "b_2", "type": "paragraph", "text": "N classes Naive Bayes algorithm naive_add National Institute of Standards and Technology. See NIST. ndim attribute Nervana Systems neural layers neural networks", "words": [{"w": "N", "b": [0.1294, 0.4221, 0.1431, 0.4369]}, {"w": "classes", "b": [0.1478, 0.4221, 0.2003, 0.4369]}, {"w": "Naive", "b": [0.1294, 0.4382, 0.1746, 0.453]}, {"w": "Bayes", "b": [0.1793, 0.4382, 0.2256, 0.453]}, {"w": "algorithm", "b": [0.2303, 0.4382, 0.3039, 0.453]}, {"w": "naive_add", "b": [0.1294, 0.4542, 0.2072, 0.469]}, {"w": "National", "b": [0.1294, 0.4702, 0.1946, 0.485]}, {"w": "Institute", "b": [0.1993, 0.4702, 0.2613, 0.485]}, {"w": "of", "b": [0.266, 0.4702, 0.2818, 0.485]}, {"w": "Standards", "b": [0.2865, 0.4702, 0.3612, 0.485]}, {"w": "and", "b": [0.3659, 0.4702, 0.3932, 0.485]}, {"w": "Technology.", "b": [0.3979, 0.4702, 0.4983, 0.4862]}, {"w": "See", "b": [0.1748, 0.4862, 0.2089, 0.5013]}, {"w": "NIST.", "b": [0.2202, 0.4862, 0.277, 0.5013]}, {"w": "ndim", "b": [0.1294, 0.5014, 0.1683, 0.5162]}, {"w": "attribute", "b": [0.173, 0.5014, 0.2361, 0.5162]}, {"w": "Nervana", "b": [0.1294, 0.5175, 0.1935, 0.5323]}, {"w": "Systems", "b": [0.1982, 0.5175, 0.2613, 0.5323]}, {"w": "neural", "b": [0.1294, 0.5335, 0.1767, 0.5483]}, {"w": "layers", "b": [0.1814, 0.5335, 0.2266, 0.5483]}, {"w": "neural", "b": [0.1294, 0.5646, 0.1975, 0.5798]}, {"w": "networks", "b": [0.2089, 0.5646, 0.2997, 0.5798]}]}, {"id": "b_3", "type": "paragraph", "text": "anatomy of layers loss functions", "words": [{"w": "anatomy", "b": [0.1521, 0.5799, 0.2173, 0.5947]}, {"w": "of", "b": [0.222, 0.5799, 0.2378, 0.5947]}, {"w": "layers", "b": [0.1748, 0.5959, 0.22, 0.6107]}, {"w": "loss", "b": [0.1748, 0.612, 0.2043, 0.6268]}, {"w": "functions", "b": [0.209, 0.612, 0.2794, 0.6268]}]}, {"id": "b_4", "type": "paragraph", "text": "models optimizers binary classifications", "words": [{"w": "models", "b": [0.1748, 0.628, 0.2295, 0.6428]}, {"w": "optimizers", "b": [0.1748, 0.644, 0.2547, 0.6589]}, {"w": "binary", "b": [0.1521, 0.6601, 0.2005, 0.6749]}, {"w": "classifications", "b": [0.2052, 0.6601, 0.3124, 0.6749]}]}, {"id": "b_5", "type": "paragraph", "text": "breakthroughs in data preprocessing for handling missing values", "words": [{"w": "breakthroughs", "b": [0.1521, 0.6761, 0.2604, 0.6909]}, {"w": "in", "b": [0.2651, 0.6761, 0.2798, 0.6909]}, {"w": "data", "b": [0.1521, 0.6922, 0.1836, 0.707]}, {"w": "preprocessing", "b": [0.1884, 0.6922, 0.2934, 0.707]}, {"w": "for", "b": [0.2982, 0.6922, 0.3202, 0.707]}, {"w": "handling", "b": [0.1748, 0.7082, 0.241, 0.723]}, {"w": "missing", "b": [0.2458, 0.7082, 0.3046, 0.723]}, {"w": "values", "b": [0.3094, 0.7082, 0.3577, 0.723]}]}, {"id": "b_6", "type": "paragraph", "text": "value normalization vectorization data representations for", "words": [{"w": "value", "b": [0.1748, 0.7243, 0.2158, 0.7391]}, {"w": "normalization", "b": [0.2205, 0.7243, 0.3256, 0.7391]}, {"w": "vectorization", "b": [0.1748, 0.7403, 0.2736, 0.7551]}, {"w": "data", "b": [0.1521, 0.7564, 0.1836, 0.7712]}, {"w": "representations", "b": [0.1884, 0.7564, 0.3029, 0.7712]}, {"w": "for", "b": [0.3076, 0.7564, 0.3297, 0.7712]}]}, {"id": "b_7", "type": "paragraph", "text": "3D tensors data batches examples of data tensors", "words": [{"w": "3D", "b": [0.1748, 0.7724, 0.1979, 0.7872]}, {"w": "tensors", "b": [0.2027, 0.7724, 0.2563, 0.7872]}, {"w": "data", "b": [0.1748, 0.7884, 0.2063, 0.8032]}, {"w": "batches", "b": [0.2111, 0.7884, 0.2678, 0.8032]}, {"w": "examples", "b": [0.1748, 0.8045, 0.2463, 0.8193]}, {"w": "of", "b": [0.251, 0.8045, 0.2668, 0.8193]}, {"w": "data", "b": [0.2715, 0.8045, 0.303, 0.8193]}, {"w": "tensors", "b": [0.3077, 0.8045, 0.3613, 0.8193]}]}, {"id": "b_8", "type": "equation", "text": "higher-dimensional tensors image data key attributes of tensors", "words": [{"w": "higher-dimensional", "b": [0.1748, 0.8205, 0.3216, 0.8353]}, {"w": "tensors", "b": [0.3263, 0.8205, 0.3799, 0.8353]}, {"w": "image", "b": [0.1748, 0.8366, 0.2211, 0.8514]}, {"w": "data", "b": [0.2258, 0.8366, 0.2573, 0.8514]}, {"w": "key", "b": [0.1748, 0.8526, 0.2021, 0.8674]}, {"w": "attributes", "b": [0.2069, 0.8526, 0.2773, 0.8674]}, {"w": "of", "b": [0.282, 0.8526, 0.2978, 0.8674]}, {"w": "tensors", "b": [0.3025, 0.8526, 0.3561, 0.8674]}]}, {"id": "b_9", "type": "paragraph", "text": "manipulating tensors in Numpy matrices (2D tensors)", "words": [{"w": "manipulating", "b": [0.1748, 0.8687, 0.2747, 0.8835]}, {"w": "tensors", "b": [0.2794, 0.8687, 0.333, 0.8835]}, {"w": "in", "b": [0.3377, 0.8687, 0.3525, 0.8835]}, {"w": "Numpy", "b": [0.3572, 0.8687, 0.4139, 0.8835]}, {"w": "matrices", "b": [0.1748, 0.8847, 0.2389, 0.8995]}, {"w": "(2D", "b": [0.2436, 0.8847, 0.2731, 0.8995]}, {"w": "tensors)", "b": [0.2778, 0.8847, 0.3377, 0.8995]}]}]}, {"page": 467, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "scalars (0D tensors) sequence data", "words": [{"w": "scalars", "b": [0.1748, 0.0852, 0.2263, 0.1]}, {"w": "(0D", "b": [0.231, 0.0852, 0.2604, 0.1]}, {"w": "tensors)", "b": [0.2652, 0.0852, 0.3251, 0.1]}, {"w": "sequence", "b": [0.1748, 0.1012, 0.2442, 0.116]}, {"w": "data", "b": [0.2489, 0.1012, 0.2804, 0.116]}]}, {"id": "b_1", "type": "paragraph", "text": "timeseries data vector data vectors (1D tensors)", "words": [{"w": "timeseries", "b": [0.1748, 0.1173, 0.2515, 0.1321]}, {"w": "data", "b": [0.2563, 0.1173, 0.2878, 0.1321]}, {"w": "vector", "b": [0.1748, 0.1333, 0.2221, 0.1481]}, {"w": "data", "b": [0.2268, 0.1333, 0.2583, 0.1481]}, {"w": "vectors", "b": [0.1748, 0.1494, 0.2295, 0.1642]}, {"w": "(1D", "b": [0.2342, 0.1494, 0.2636, 0.1642]}, {"w": "tensors)", "b": [0.2683, 0.1494, 0.3282, 0.1642]}]}, {"id": "b_2", "type": "equation", "text": "video data gradient-based optimization backpropagation algorithm", "words": [{"w": "video", "b": [0.1748, 0.1654, 0.2169, 0.1802]}, {"w": "data", "b": [0.2216, 0.1654, 0.2531, 0.1802]}, {"w": "gradient-based", "b": [0.1521, 0.1815, 0.2635, 0.1963]}, {"w": "optimization", "b": [0.2682, 0.1815, 0.3639, 0.1963]}, {"w": "backpropagation", "b": [0.1748, 0.1975, 0.3009, 0.2123]}, {"w": "algorithm", "b": [0.3056, 0.1975, 0.3792, 0.2123]}]}, {"id": "b_3", "type": "paragraph", "text": "derivatives gradients stochastic gradient descent", "words": [{"w": "derivatives", "b": [0.1748, 0.2135, 0.2578, 0.2283]}, {"w": "gradients", "b": [0.1748, 0.2296, 0.2442, 0.2444]}, {"w": "stochastic", "b": [0.1748, 0.2456, 0.2494, 0.2604]}, {"w": "gradient", "b": [0.2542, 0.2456, 0.3162, 0.2604]}, {"w": "descent", "b": [0.3209, 0.2456, 0.3776, 0.2604]}]}, {"id": "b_4", "type": "paragraph", "text": "Keras CNTK developing with", "words": [{"w": "Keras", "b": [0.1521, 0.2617, 0.1962, 0.2765]}, {"w": "CNTK", "b": [0.1748, 0.2777, 0.2263, 0.2925]}, {"w": "developing", "b": [0.1748, 0.2938, 0.2589, 0.3086]}, {"w": "with", "b": [0.2636, 0.2938, 0.2973, 0.3086]}]}, {"id": "b_5", "type": "paragraph", "text": "TensorFlow Theano multiclass classifications", "words": [{"w": "TensorFlow", "b": [0.1748, 0.3098, 0.2649, 0.3246]}, {"w": "Theano", "b": [0.1748, 0.3258, 0.2316, 0.3407]}, {"w": "multiclass", "b": [0.1521, 0.3419, 0.2289, 0.3567]}, {"w": "classifications", "b": [0.2336, 0.3419, 0.3408, 0.3567]}]}, {"id": "b_6", "type": "paragraph", "text": "regression setting up workstations GPUs for deep learning", "words": [{"w": "regression", "b": [0.1521, 0.3579, 0.2299, 0.3727]}, {"w": "setting", "b": [0.1521, 0.374, 0.2026, 0.3888]}, {"w": "up", "b": [0.2073, 0.374, 0.2262, 0.3888]}, {"w": "workstations", "b": [0.231, 0.374, 0.3276, 0.3888]}, {"w": "GPUs", "b": [0.1748, 0.39, 0.22, 0.4048]}, {"w": "for", "b": [0.2247, 0.39, 0.2468, 0.4048]}, {"w": "deep", "b": [0.2515, 0.39, 0.2873, 0.4048]}, {"w": "learning", "b": [0.292, 0.39, 0.354, 0.4048]}]}, {"id": "b_7", "type": "paragraph", "text": "Jupyter notebooks running jobs in cloud running Keras", "words": [{"w": "Jupyter", "b": [0.1748, 0.4061, 0.2305, 0.4209]}, {"w": "notebooks", "b": [0.2352, 0.4061, 0.313, 0.4209]}, {"w": "running", "b": [0.1748, 0.4221, 0.2337, 0.4369]}, {"w": "jobs", "b": [0.2384, 0.4221, 0.2699, 0.4369]}, {"w": "in", "b": [0.2747, 0.4221, 0.2894, 0.4369]}, {"w": "cloud", "b": [0.2941, 0.4221, 0.3362, 0.4369]}, {"w": "running", "b": [0.1748, 0.4382, 0.2337, 0.453]}, {"w": "Keras", "b": [0.2384, 0.4382, 0.2825, 0.453]}]}, {"id": "b_8", "type": "paragraph", "text": "tensor operations broadcasting dot", "words": [{"w": "tensor", "b": [0.1521, 0.4542, 0.1984, 0.469]}, {"w": "operations", "b": [0.2031, 0.4542, 0.2819, 0.469]}, {"w": "broadcasting", "b": [0.1748, 0.4702, 0.2715, 0.485]}, {"w": "dot", "b": [0.1748, 0.4863, 0.199, 0.5011]}]}, {"id": "b_9", "type": "paragraph", "text": "element-wise geometric interpretation of geometric interpretation of deep learning", "words": [{"w": "element-wise", "b": [0.1748, 0.5023, 0.2757, 0.5171]}, {"w": "geometric", "b": [0.1748, 0.5184, 0.2505, 0.5332]}, {"w": "interpretation", "b": [0.2552, 0.5184, 0.3571, 0.5332]}, {"w": "of", "b": [0.3619, 0.5184, 0.3776, 0.5332]}, {"w": "geometric", "b": [0.1748, 0.5344, 0.2505, 0.5492]}, {"w": "interpretation", "b": [0.2552, 0.5344, 0.3571, 0.5492]}, {"w": "of", "b": [0.3619, 0.5344, 0.3776, 0.5492]}, {"w": "deep", "b": [0.3824, 0.5344, 0.4181, 0.5492]}, {"w": "learning", "b": [0.4228, 0.5344, 0.4848, 0.5492]}]}, {"id": "b_10", "type": "paragraph", "text": "reshaping neural style transfer content loss in Keras style loss N-grams NIST (National Institute of Standards and Technology) non-linearity function non-machine learning, baselines nonstationary problems normalizing batches normalizing values Numpy arrays, 2nd Numpy library, manipulating tensors in Numpy matrix Numpy tensors NVIDIA, 2nd", "words": [{"w": "reshaping", "b": [0.1748, 0.5505, 0.2484, 0.5653]}, {"w": "neural", "b": [0.1294, 0.5665, 0.1767, 0.5813]}, {"w": "style", "b": [0.1814, 0.5665, 0.2172, 0.5813]}, {"w": "transfer", "b": [0.2219, 0.5665, 0.2797, 0.5813]}, {"w": "content", "b": [0.1521, 0.5817, 0.2078, 0.5965]}, {"w": "loss", "b": [0.2125, 0.5817, 0.242, 0.5965]}, {"w": "in", "b": [0.1521, 0.5977, 0.1668, 0.6125]}, {"w": "Keras", "b": [0.1716, 0.5977, 0.2157, 0.6125]}, {"w": "style", "b": [0.1521, 0.6137, 0.1879, 0.6285]}, {"w": "loss", "b": [0.1926, 0.6137, 0.222, 0.6285]}, {"w": "N-grams", "b": [0.1294, 0.6298, 0.1956, 0.6446]}, {"w": "NIST", "b": [0.1294, 0.6458, 0.1715, 0.6606]}, {"w": "(National", "b": [0.1762, 0.6458, 0.2476, 0.6606]}, {"w": "Institute", "b": [0.2524, 0.6458, 0.3144, 0.6606]}, {"w": "of", "b": [0.3191, 0.6458, 0.3349, 0.6606]}, {"w": "Standards", "b": [0.3396, 0.6458, 0.4142, 0.6606]}, {"w": "and", "b": [0.419, 0.6458, 0.4463, 0.6606]}, {"w": "Technology)", "b": [0.451, 0.6458, 0.5463, 0.6606]}, {"w": "non-linearity", "b": [0.1294, 0.6619, 0.2271, 0.6767]}, {"w": "function", "b": [0.2319, 0.6619, 0.2949, 0.6767]}, {"w": "non-machine", "b": [0.1294, 0.6779, 0.2282, 0.6927]}, {"w": "learning,", "b": [0.2329, 0.6779, 0.2996, 0.6927]}, {"w": "baselines", "b": [0.3044, 0.6779, 0.3737, 0.6927]}, {"w": "nonstationary", "b": [0.1294, 0.694, 0.2324, 0.7088]}, {"w": "problems", "b": [0.2371, 0.694, 0.3076, 0.7088]}, {"w": "normalizing", "b": [0.1294, 0.71, 0.2208, 0.7248]}, {"w": "batches", "b": [0.2256, 0.71, 0.2823, 0.7248]}, {"w": "normalizing", "b": [0.1294, 0.726, 0.2208, 0.7409]}, {"w": "values", "b": [0.2256, 0.726, 0.2739, 0.7409]}, {"w": "Numpy", "b": [0.1294, 0.7421, 0.1862, 0.7569]}, {"w": "arrays,", "b": [0.1909, 0.7421, 0.2485, 0.758]}, {"w": "2nd", "b": [0.2598, 0.742, 0.2798, 0.7569]}, {"w": "Numpy", "b": [0.1294, 0.7581, 0.1862, 0.7729]}, {"w": "library,", "b": [0.1909, 0.7581, 0.2448, 0.7729]}, {"w": "manipulating", "b": [0.2496, 0.7581, 0.3494, 0.7729]}, {"w": "tensors", "b": [0.3541, 0.7581, 0.4077, 0.7729]}, {"w": "in", "b": [0.4125, 0.7581, 0.4272, 0.7729]}, {"w": "Numpy", "b": [0.1294, 0.7742, 0.1862, 0.789]}, {"w": "matrix", "b": [0.1909, 0.7742, 0.2403, 0.789]}, {"w": "Numpy", "b": [0.1294, 0.7902, 0.1862, 0.805]}, {"w": "tensors", "b": [0.1909, 0.7902, 0.2445, 0.805]}, {"w": "NVIDIA,", "b": [0.1294, 0.8063, 0.208, 0.8222]}, {"w": "2nd", "b": [0.2194, 0.8062, 0.2393, 0.8211]}]}]}, {"page": 468, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "object detection objective function, 2nd Occam’s razor principle octaves one-hot encoding of characters of words overview, 2nd, 3rd online documentation, Keras optimization, 2nd, 3rd, 4th, 5th optimizer argument, 2nd, 3rd, 4th optimizers output classes", "words": [{"w": "object", "b": [0.1294, 0.0852, 0.1757, 0.1]}, {"w": "detection", "b": [0.1804, 0.0852, 0.2497, 0.1]}, {"w": "objective", "b": [0.1294, 0.1012, 0.1988, 0.116]}, {"w": "function,", "b": [0.2035, 0.1012, 0.2779, 0.1172]}, {"w": "2nd", "b": [0.2892, 0.1012, 0.3092, 0.116]}, {"w": "Occam’s", "b": [0.1294, 0.1173, 0.1956, 0.1321]}, {"w": "razor", "b": [0.2003, 0.1173, 0.2392, 0.1321]}, {"w": "principle", "b": [0.2439, 0.1173, 0.3112, 0.1321]}, {"w": "octaves", "b": [0.1294, 0.1333, 0.1862, 0.1481]}, {"w": "one-hot", "b": [0.1294, 0.1644, 0.2089, 0.1796]}, {"w": "encoding", "b": [0.2202, 0.1644, 0.311, 0.1796]}, {"w": "of", "b": [0.1521, 0.1797, 0.1679, 0.1945]}, {"w": "characters", "b": [0.1726, 0.1797, 0.2493, 0.1945]}, {"w": "of", "b": [0.1521, 0.1957, 0.1679, 0.2105]}, {"w": "words", "b": [0.1726, 0.1957, 0.2188, 0.2105]}, {"w": "overview,", "b": [0.1521, 0.2144, 0.2338, 0.2304]}, {"w": "2nd,", "b": [0.2452, 0.2117, 0.2807, 0.2304]}, {"w": "3rd", "b": [0.2921, 0.2117, 0.3138, 0.2292]}, {"w": "online", "b": [0.1294, 0.2305, 0.1767, 0.2453]}, {"w": "documentation,", "b": [0.1814, 0.2305, 0.2986, 0.2453]}, {"w": "Keras", "b": [0.3034, 0.2305, 0.3475, 0.2453]}, {"w": "optimization,", "b": [0.1294, 0.2465, 0.2364, 0.2624]}, {"w": "2nd,", "b": [0.2477, 0.2465, 0.2791, 0.2624]}, {"w": "3rd,", "b": [0.2904, 0.2465, 0.3199, 0.2624]}, {"w": "4th,", "b": [0.3313, 0.2465, 0.3603, 0.2624]}, {"w": "5th", "b": [0.3716, 0.2465, 0.3893, 0.2613]}, {"w": "optimizer", "b": [0.1294, 0.2626, 0.2019, 0.2774]}, {"w": "argument,", "b": [0.2067, 0.2626, 0.2891, 0.2785]}, {"w": "2nd,", "b": [0.3004, 0.2625, 0.3318, 0.2785]}, {"w": "3rd,", "b": [0.3431, 0.2625, 0.3726, 0.2785]}, {"w": "4th", "b": [0.384, 0.2625, 0.4016, 0.2774]}, {"w": "optimizers", "b": [0.1294, 0.2786, 0.2093, 0.2934]}, {"w": "output", "b": [0.1294, 0.3097, 0.1975, 0.3248]}, {"w": "classes", "b": [0.1521, 0.325, 0.2047, 0.3398]}]}, {"id": "b_1", "type": "paragraph", "text": "overview tensor overfitting adding dropout adding weight regularization reducing network size using recurrent dropout to fight", "words": [{"w": "overview", "b": [0.1521, 0.341, 0.2225, 0.3558]}, {"w": "tensor", "b": [0.1521, 0.357, 0.1984, 0.3718]}, {"w": "overfitting", "b": [0.1294, 0.3881, 0.2543, 0.4033]}, {"w": "adding", "b": [0.1521, 0.4034, 0.2036, 0.4182]}, {"w": "dropout", "b": [0.2083, 0.4034, 0.2672, 0.4182]}, {"w": "adding", "b": [0.1521, 0.4194, 0.2036, 0.4342]}, {"w": "weight", "b": [0.2083, 0.4194, 0.2598, 0.4342]}, {"w": "regularization", "b": [0.2646, 0.4194, 0.3696, 0.4342]}, {"w": "reducing", "b": [0.1521, 0.4355, 0.2183, 0.4503]}, {"w": "network", "b": [0.223, 0.4355, 0.285, 0.4503]}, {"w": "size", "b": [0.2898, 0.4355, 0.3192, 0.4503]}, {"w": "using", "b": [0.1521, 0.4515, 0.1931, 0.4663]}, {"w": "recurrent", "b": [0.1978, 0.4515, 0.2661, 0.4663]}, {"w": "dropout", "b": [0.2709, 0.4515, 0.3297, 0.4663]}, {"w": "to", "b": [0.3344, 0.4515, 0.3492, 0.4663]}, {"w": "fight", "b": [0.3539, 0.4515, 0.3896, 0.4663]}]}, {"id": "b_3", "type": "paragraph", "text": "padding parameterized layers parameters adjusting overview partitions passwd() command PCA (principal component analysis) Pichai, Sundar pip plot_model plotting code pointwise convolutions pooling 1D, for sequence data predict method, 2nd, 3rd prediction error predictions preparing data preprocessing data, 2nd", "words": [{"w": "padding", "b": [0.1294, 0.5326, 0.1904, 0.5474]}, {"w": "parameterized", "b": [0.1294, 0.5487, 0.2366, 0.5635]}, {"w": "layers", "b": [0.2413, 0.5487, 0.2865, 0.5635]}, {"w": "parameters", "b": [0.1294, 0.5798, 0.2429, 0.5949]}, {"w": "adjusting", "b": [0.1521, 0.595, 0.2215, 0.6098]}, {"w": "overview", "b": [0.1521, 0.6111, 0.2225, 0.6259]}, {"w": "partitions", "b": [0.1294, 0.6271, 0.2009, 0.6419]}, {"w": "passwd()", "b": [0.1294, 0.6432, 0.1977, 0.658]}, {"w": "command", "b": [0.2024, 0.6432, 0.2771, 0.658]}, {"w": "PCA", "b": [0.1294, 0.6592, 0.1662, 0.674]}, {"w": "(principal", "b": [0.1709, 0.6592, 0.2445, 0.674]}, {"w": "component", "b": [0.2492, 0.6592, 0.3333, 0.674]}, {"w": "analysis)", "b": [0.338, 0.6592, 0.4053, 0.674]}, {"w": "Pichai,", "b": [0.1294, 0.6752, 0.1814, 0.69]}, {"w": "Sundar", "b": [0.1862, 0.6752, 0.2398, 0.69]}, {"w": "pip", "b": [0.1294, 0.6913, 0.1536, 0.7061]}, {"w": "plot_model", "b": [0.1294, 0.7073, 0.2156, 0.7221]}, {"w": "plotting", "b": [0.1294, 0.7234, 0.1883, 0.7382]}, {"w": "code", "b": [0.193, 0.7234, 0.2287, 0.7382]}, {"w": "pointwise", "b": [0.1294, 0.7394, 0.203, 0.7542]}, {"w": "convolutions", "b": [0.2077, 0.7394, 0.3055, 0.7542]}, {"w": "pooling", "b": [0.1294, 0.7555, 0.1872, 0.7703]}, {"w": "1D,", "b": [0.192, 0.7555, 0.2198, 0.7703]}, {"w": "for", "b": [0.2245, 0.7555, 0.2466, 0.7703]}, {"w": "sequence", "b": [0.2513, 0.7555, 0.3207, 0.7703]}, {"w": "data", "b": [0.3254, 0.7555, 0.3569, 0.7703]}, {"w": "predict", "b": [0.1294, 0.7715, 0.182, 0.7863]}, {"w": "method,", "b": [0.1867, 0.7715, 0.2548, 0.7874]}, {"w": "2nd,", "b": [0.2661, 0.7715, 0.2974, 0.7874]}, {"w": "3rd", "b": [0.3088, 0.7715, 0.327, 0.7863]}, {"w": "prediction", "b": [0.1294, 0.7875, 0.2061, 0.8024]}, {"w": "error", "b": [0.2109, 0.7875, 0.2476, 0.8024]}, {"w": "predictions", "b": [0.1294, 0.8036, 0.2135, 0.8184]}, {"w": "preparing", "b": [0.1294, 0.8196, 0.2019, 0.8344]}, {"w": "data", "b": [0.2066, 0.8196, 0.2382, 0.8344]}, {"w": "preprocessing", "b": [0.1294, 0.8507, 0.277, 0.8659]}, {"w": "data,", "b": [0.1521, 0.8687, 0.195, 0.8846]}, {"w": "2nd", "b": [0.2063, 0.866, 0.2305, 0.8835]}]}, {"id": "b_4", "type": "paragraph", "text": "for neural networks", "words": [{"w": "for", "b": [0.1748, 0.8847, 0.1969, 0.8995]}, {"w": "neural", "b": [0.2016, 0.8847, 0.2489, 0.8995]}, {"w": "networks", "b": [0.2536, 0.8847, 0.323, 0.8995]}]}]}, {"page": 469, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "overview embeddings pretrained convnets feature extraction with data augmentation without data augmentation fine-tuning with small datasets pretrained networks, 2nd pretrained word embeddings probabilistic modeling probability distribution problems, defining processing sequences with convnets 1D convolution for sequence data", "words": [{"w": "overview", "b": [0.1748, 0.0852, 0.2452, 0.1]}, {"w": "embeddings", "b": [0.1521, 0.1012, 0.2436, 0.116]}, {"w": "pretrained", "b": [0.1294, 0.1173, 0.2061, 0.1321]}, {"w": "convnets", "b": [0.2108, 0.1173, 0.2781, 0.1321]}, {"w": "feature", "b": [0.1521, 0.1324, 0.2046, 0.1472]}, {"w": "extraction", "b": [0.2094, 0.1324, 0.285, 0.1472]}, {"w": "with", "b": [0.1748, 0.1485, 0.2085, 0.1633]}, {"w": "data", "b": [0.2132, 0.1485, 0.2447, 0.1633]}, {"w": "augmentation", "b": [0.2494, 0.1485, 0.3524, 0.1633]}, {"w": "without", "b": [0.1748, 0.1645, 0.2326, 0.1793]}, {"w": "data", "b": [0.2374, 0.1645, 0.2689, 0.1793]}, {"w": "augmentation", "b": [0.2736, 0.1645, 0.3766, 0.1793]}, {"w": "fine-tuning", "b": [0.1521, 0.1806, 0.2362, 0.1954]}, {"w": "with", "b": [0.1521, 0.1966, 0.1858, 0.2114]}, {"w": "small", "b": [0.1905, 0.1966, 0.2315, 0.2114]}, {"w": "datasets", "b": [0.2362, 0.1966, 0.2961, 0.2114]}, {"w": "pretrained", "b": [0.1294, 0.2126, 0.2061, 0.2275]}, {"w": "networks,", "b": [0.2108, 0.2126, 0.2915, 0.2286]}, {"w": "2nd", "b": [0.3029, 0.2126, 0.3228, 0.2275]}, {"w": "pretrained", "b": [0.1294, 0.2287, 0.2061, 0.2435]}, {"w": "word", "b": [0.2108, 0.2287, 0.2497, 0.2435]}, {"w": "embeddings", "b": [0.2544, 0.2287, 0.3459, 0.2435]}, {"w": "probabilistic", "b": [0.1294, 0.2447, 0.224, 0.2595]}, {"w": "modeling", "b": [0.2287, 0.2447, 0.3002, 0.2595]}, {"w": "probability", "b": [0.1294, 0.2608, 0.2124, 0.2756]}, {"w": "distribution", "b": [0.2172, 0.2608, 0.3044, 0.2756]}, {"w": "problems,", "b": [0.1294, 0.2768, 0.2046, 0.2916]}, {"w": "defining", "b": [0.2093, 0.2768, 0.2723, 0.2916]}, {"w": "processing", "b": [0.1294, 0.2929, 0.2103, 0.3077]}, {"w": "sequences", "b": [0.2151, 0.2929, 0.2918, 0.3077]}, {"w": "with", "b": [0.2965, 0.2929, 0.3301, 0.3077]}, {"w": "convnets", "b": [0.3349, 0.2929, 0.4021, 0.3077]}, {"w": "1D", "b": [0.1521, 0.308, 0.1752, 0.3228]}, {"w": "convolution", "b": [0.18, 0.308, 0.2704, 0.3228]}, {"w": "for", "b": [0.2751, 0.308, 0.2972, 0.3228]}, {"w": "sequence", "b": [0.3019, 0.308, 0.3712, 0.3228]}, {"w": "data", "b": [0.3759, 0.308, 0.4075, 0.3228]}]}, {"id": "b_1", "type": "paragraph", "text": "1D pooling for sequence data combining with recurrent neural networks to process long sequences implementing 1D convnets program subroutines program synthesis PyCharm pydot library pydot-ng Python installing scientific suite on Ubuntu overview python-pip package", "words": [{"w": "1D", "b": [0.1521, 0.3241, 0.1752, 0.3389]}, {"w": "pooling", "b": [0.18, 0.3241, 0.2378, 0.3389]}, {"w": "for", "b": [0.2425, 0.3241, 0.2646, 0.3389]}, {"w": "sequence", "b": [0.2693, 0.3241, 0.3386, 0.3389]}, {"w": "data", "b": [0.3434, 0.3241, 0.3749, 0.3389]}, {"w": "combining", "b": [0.1521, 0.3401, 0.2331, 0.3549]}, {"w": "with", "b": [0.2378, 0.3401, 0.2714, 0.3549]}, {"w": "recurrent", "b": [0.2762, 0.3401, 0.3444, 0.3549]}, {"w": "neural", "b": [0.3492, 0.3401, 0.3964, 0.3549]}, {"w": "networks", "b": [0.4012, 0.3401, 0.4705, 0.3549]}, {"w": "to", "b": [0.4753, 0.3401, 0.49, 0.3549]}, {"w": "process", "b": [0.4947, 0.3401, 0.5514, 0.3549]}, {"w": "long", "b": [0.5562, 0.3401, 0.5898, 0.3549]}, {"w": "sequences", "b": [0.5945, 0.3401, 0.6712, 0.3549]}, {"w": "implementing", "b": [0.1521, 0.3562, 0.2572, 0.371]}, {"w": "1D", "b": [0.262, 0.3562, 0.2851, 0.371]}, {"w": "convnets", "b": [0.2898, 0.3562, 0.3571, 0.371]}, {"w": "program", "b": [0.1294, 0.3722, 0.1935, 0.387]}, {"w": "subroutines", "b": [0.1982, 0.3722, 0.2855, 0.387]}, {"w": "program", "b": [0.1294, 0.3882, 0.1935, 0.403]}, {"w": "synthesis", "b": [0.1982, 0.3882, 0.2676, 0.403]}, {"w": "PyCharm", "b": [0.1294, 0.4043, 0.2009, 0.4191]}, {"w": "pydot", "b": [0.1294, 0.4203, 0.1725, 0.4351]}, {"w": "library", "b": [0.1772, 0.4203, 0.2277, 0.4351]}, {"w": "pydot-ng", "b": [0.1294, 0.4364, 0.1977, 0.4512]}, {"w": "Python", "b": [0.1294, 0.4675, 0.1975, 0.4826]}, {"w": "installing", "b": [0.1521, 0.4827, 0.2226, 0.4975]}, {"w": "scientific", "b": [0.2273, 0.4827, 0.2966, 0.4975]}, {"w": "suite", "b": [0.3014, 0.4827, 0.3371, 0.4975]}, {"w": "on", "b": [0.3418, 0.4827, 0.3608, 0.4975]}, {"w": "Ubuntu", "b": [0.3655, 0.4827, 0.4222, 0.4975]}, {"w": "overview", "b": [0.1521, 0.4988, 0.2225, 0.5136]}, {"w": "python-pip", "b": [0.1294, 0.5148, 0.2124, 0.5296]}, {"w": "package", "b": [0.2172, 0.5148, 0.2792, 0.5296]}]}, {"id": "b_3", "type": "equation", "text": "question-answering model", "words": [{"w": "question-answering", "b": [0.1294, 0.595, 0.2776, 0.6098]}, {"w": "model", "b": [0.2823, 0.595, 0.3296, 0.6098]}]}, {"id": "b_5", "type": "paragraph", "text": "random forests randomly shuffle data randomness rank recurrent dropout, 2nd recurrent layers, bidirectional recurrent neural networks, 2nd, 3rd", "words": [{"w": "random", "b": [0.1294, 0.6752, 0.1872, 0.69]}, {"w": "forests", "b": [0.1919, 0.6752, 0.2424, 0.69]}, {"w": "randomly", "b": [0.1294, 0.6913, 0.2019, 0.7061]}, {"w": "shuffle", "b": [0.2067, 0.6913, 0.2589, 0.7061]}, {"w": "data", "b": [0.2636, 0.6913, 0.2951, 0.7061]}, {"w": "randomness", "b": [0.1294, 0.7073, 0.2198, 0.7221]}, {"w": "rank", "b": [0.1294, 0.7234, 0.163, 0.7382]}, {"w": "recurrent", "b": [0.1294, 0.7394, 0.1977, 0.7542]}, {"w": "dropout,", "b": [0.2024, 0.7394, 0.2726, 0.7553]}, {"w": "2nd", "b": [0.284, 0.7394, 0.3039, 0.7542]}, {"w": "recurrent", "b": [0.1294, 0.7555, 0.1977, 0.7703]}, {"w": "layers,", "b": [0.2024, 0.7555, 0.2523, 0.7703]}, {"w": "bidirectional", "b": [0.2571, 0.7555, 0.3527, 0.7703]}, {"w": "recurrent", "b": [0.1294, 0.7715, 0.1977, 0.7863]}, {"w": "neural", "b": [0.2024, 0.7715, 0.2497, 0.7863]}, {"w": "networks,", "b": [0.2544, 0.7715, 0.3351, 0.7874]}, {"w": "2nd,", "b": [0.3465, 0.7715, 0.3778, 0.7874]}, {"w": "3rd", "b": [0.3891, 0.7715, 0.4073, 0.7863]}]}, {"id": "b_6", "type": "paragraph", "text": "basic machine-learning approach bidirectional combining with convnets first recurrent baseline generative, history of GRU layers LSTM layers", "words": [{"w": "basic", "b": [0.1521, 0.7875, 0.191, 0.8024]}, {"w": "machine-learning", "b": [0.1957, 0.7875, 0.3281, 0.8024]}, {"w": "approach", "b": [0.3329, 0.7875, 0.4022, 0.8024]}, {"w": "bidirectional", "b": [0.1521, 0.8036, 0.2478, 0.8184]}, {"w": "combining", "b": [0.1521, 0.8196, 0.2331, 0.8344]}, {"w": "with", "b": [0.2378, 0.8196, 0.2714, 0.8344]}, {"w": "convnets", "b": [0.2762, 0.8196, 0.3434, 0.8344]}, {"w": "first", "b": [0.1521, 0.8357, 0.1826, 0.8505]}, {"w": "recurrent", "b": [0.1873, 0.8357, 0.2556, 0.8505]}, {"w": "baseline", "b": [0.2603, 0.8357, 0.3223, 0.8505]}, {"w": "generative,", "b": [0.1521, 0.8517, 0.2356, 0.8665]}, {"w": "history", "b": [0.2404, 0.8517, 0.2929, 0.8665]}, {"w": "of", "b": [0.2977, 0.8517, 0.3134, 0.8665]}, {"w": "GRU", "b": [0.1521, 0.8678, 0.1921, 0.8826]}, {"w": "layers", "b": [0.1968, 0.8678, 0.242, 0.8826]}, {"w": "LSTM", "b": [0.1521, 0.8838, 0.2026, 0.8986]}, {"w": "layers", "b": [0.2073, 0.8838, 0.2525, 0.8986]}]}]}, {"page": 470, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "non-machine-learning baselines preparing data for recurrent layers in Keras", "words": [{"w": "non-machine-learning", "b": [0.1521, 0.0852, 0.3192, 0.1]}, {"w": "baselines", "b": [0.3239, 0.0852, 0.3933, 0.1]}, {"w": "preparing", "b": [0.1521, 0.1012, 0.2246, 0.116]}, {"w": "data", "b": [0.2293, 0.1012, 0.2609, 0.116]}, {"w": "for", "b": [0.2656, 0.1012, 0.2877, 0.116]}, {"w": "recurrent", "b": [0.1521, 0.1173, 0.2204, 0.1321]}, {"w": "layers", "b": [0.2251, 0.1173, 0.2703, 0.1321]}, {"w": "in", "b": [0.275, 0.1173, 0.2898, 0.1321]}, {"w": "Keras", "b": [0.2945, 0.1173, 0.3386, 0.1321]}]}, {"id": "b_1", "type": "paragraph", "text": "stacking recurrent layers using recurrent dropout to fight overfitting ReduceLROnPlateau callbacks regression, 2nd, 3rd regularization loss function regularizing models reinforcement learning relu (rectified linear unit) representations extracting overview reshaping tensors residual connections response map return_sequences argument reusability reverse-mode differentiation RGB (red-green-blue) format RMSProp optimizer, 2nd, 3rd, 4th, 5th, 6th RNN (recurrent neural network) rotation_range", "words": [{"w": "stacking", "b": [0.1521, 0.1333, 0.2152, 0.1481]}, {"w": "recurrent", "b": [0.2199, 0.1333, 0.2882, 0.1481]}, {"w": "layers", "b": [0.2929, 0.1333, 0.3381, 0.1481]}, {"w": "using", "b": [0.1521, 0.1494, 0.1931, 0.1642]}, {"w": "recurrent", "b": [0.1978, 0.1494, 0.2661, 0.1642]}, {"w": "dropout", "b": [0.2709, 0.1494, 0.3297, 0.1642]}, {"w": "to", "b": [0.3344, 0.1494, 0.3492, 0.1642]}, {"w": "fight", "b": [0.3539, 0.1494, 0.3896, 0.1642]}, {"w": "overfitting", "b": [0.3944, 0.1494, 0.4742, 0.1642]}, {"w": "ReduceLROnPlateau", "b": [0.1294, 0.1654, 0.2891, 0.1802]}, {"w": "callbacks", "b": [0.2939, 0.1654, 0.3643, 0.1802]}, {"w": "regression,", "b": [0.1294, 0.1815, 0.2185, 0.1974]}, {"w": "2nd,", "b": [0.2299, 0.1814, 0.2612, 0.1974]}, {"w": "3rd", "b": [0.2725, 0.1814, 0.2907, 0.1963]}, {"w": "regularization", "b": [0.1294, 0.1975, 0.2345, 0.2123]}, {"w": "loss", "b": [0.2392, 0.1975, 0.2687, 0.2123]}, {"w": "function", "b": [0.2734, 0.1975, 0.3364, 0.2123]}, {"w": "regularizing", "b": [0.1294, 0.2135, 0.2208, 0.2283]}, {"w": "models", "b": [0.2256, 0.2135, 0.2802, 0.2283]}, {"w": "reinforcement", "b": [0.1294, 0.2296, 0.2355, 0.2444]}, {"w": "learning", "b": [0.2403, 0.2296, 0.3023, 0.2444]}, {"w": "relu", "b": [0.1294, 0.2456, 0.1588, 0.2604]}, {"w": "(rectified", "b": [0.1636, 0.2456, 0.2329, 0.2604]}, {"w": "linear", "b": [0.2376, 0.2456, 0.2807, 0.2604]}, {"w": "unit)", "b": [0.2854, 0.2456, 0.3212, 0.2604]}, {"w": "representations", "b": [0.1294, 0.2767, 0.2997, 0.2919]}, {"w": "extracting", "b": [0.1521, 0.292, 0.2278, 0.3068]}, {"w": "overview", "b": [0.1521, 0.308, 0.2225, 0.3228]}, {"w": "reshaping", "b": [0.1294, 0.3241, 0.203, 0.3389]}, {"w": "tensors", "b": [0.2077, 0.3241, 0.2613, 0.3389]}, {"w": "residual", "b": [0.1294, 0.3401, 0.1893, 0.3549]}, {"w": "connections", "b": [0.194, 0.3401, 0.2844, 0.3549]}, {"w": "response", "b": [0.1294, 0.3562, 0.1956, 0.371]}, {"w": "map", "b": [0.2003, 0.3562, 0.2329, 0.371]}, {"w": "return_sequences", "b": [0.1294, 0.3722, 0.2607, 0.387]}, {"w": "argument", "b": [0.2655, 0.3722, 0.3366, 0.387]}, {"w": "reusability", "b": [0.1294, 0.3882, 0.2093, 0.403]}, {"w": "reverse-mode", "b": [0.1294, 0.4043, 0.2324, 0.4191]}, {"w": "differentiation", "b": [0.2371, 0.4043, 0.345, 0.4191]}, {"w": "RGB", "b": [0.1294, 0.4203, 0.1683, 0.4351]}, {"w": "(red-green-blue)", "b": [0.173, 0.4203, 0.297, 0.4351]}, {"w": "format", "b": [0.3017, 0.4203, 0.3522, 0.4351]}, {"w": "RMSProp", "b": [0.1294, 0.4364, 0.2051, 0.4512]}, {"w": "optimizer,", "b": [0.2098, 0.4364, 0.2937, 0.4523]}, {"w": "2nd,", "b": [0.305, 0.4363, 0.3364, 0.4523]}, {"w": "3rd,", "b": [0.3477, 0.4363, 0.3773, 0.4523]}, {"w": "4th,", "b": [0.3886, 0.4363, 0.4176, 0.4523]}, {"w": "5th,", "b": [0.4289, 0.4363, 0.4579, 0.4523]}, {"w": "6th", "b": [0.4693, 0.4363, 0.4869, 0.4512]}, {"w": "RNN", "b": [0.1294, 0.4524, 0.1694, 0.4672]}, {"w": "(recurrent", "b": [0.1741, 0.4524, 0.2487, 0.4672]}, {"w": "neural", "b": [0.2534, 0.4524, 0.3007, 0.4672]}, {"w": "network)", "b": [0.3054, 0.4524, 0.3737, 0.4672]}, {"w": "rotation_range", "b": [0.1294, 0.4685, 0.2397, 0.4833]}]}, {"id": "b_3", "type": "paragraph", "text": "samples axis samples dimension sampling from language models from latent spaces of images strategies Sanity Preserver, arXiv scalar regression, 2nd scalar tensor scalars (0D tensors) schematic implementation, of GAN Schmidhuber, Jürgen Scikit-Learn SciPy, 2nd self-supervised learning selu function SeparableConv2D layer, 2nd separation hyperplane sequence data generating overview", "words": [{"w": "samples", "b": [0.1294, 0.5487, 0.1904, 0.5635]}, {"w": "axis", "b": [0.1951, 0.5487, 0.2256, 0.5635]}, {"w": "samples", "b": [0.1294, 0.5647, 0.1904, 0.5795]}, {"w": "dimension", "b": [0.1951, 0.5647, 0.2739, 0.5795]}, {"w": "sampling", "b": [0.1294, 0.5958, 0.2202, 0.611]}, {"w": "from", "b": [0.1521, 0.6111, 0.1889, 0.6259]}, {"w": "language", "b": [0.1936, 0.6111, 0.2619, 0.6259]}, {"w": "models", "b": [0.2667, 0.6111, 0.3213, 0.6259]}, {"w": "from", "b": [0.1521, 0.6271, 0.1889, 0.6419]}, {"w": "latent", "b": [0.1936, 0.6271, 0.2357, 0.6419]}, {"w": "spaces", "b": [0.2404, 0.6271, 0.2898, 0.6419]}, {"w": "of", "b": [0.2945, 0.6271, 0.3103, 0.6419]}, {"w": "images", "b": [0.315, 0.6271, 0.3686, 0.6419]}, {"w": "strategies", "b": [0.1521, 0.6432, 0.2236, 0.658]}, {"w": "Sanity", "b": [0.1294, 0.6592, 0.1778, 0.674]}, {"w": "Preserver,", "b": [0.1825, 0.6592, 0.2579, 0.674]}, {"w": "arXiv", "b": [0.2626, 0.6592, 0.3057, 0.674]}, {"w": "scalar", "b": [0.1294, 0.6752, 0.1735, 0.69]}, {"w": "regression,", "b": [0.1783, 0.6752, 0.2673, 0.6912]}, {"w": "2nd", "b": [0.2787, 0.6752, 0.2987, 0.69]}, {"w": "scalar", "b": [0.1294, 0.6913, 0.1735, 0.7061]}, {"w": "tensor", "b": [0.1783, 0.6913, 0.2245, 0.7061]}, {"w": "scalars", "b": [0.1294, 0.7073, 0.1809, 0.7221]}, {"w": "(0D", "b": [0.1856, 0.7073, 0.215, 0.7221]}, {"w": "tensors)", "b": [0.2198, 0.7073, 0.2797, 0.7221]}, {"w": "schematic", "b": [0.1294, 0.7234, 0.2051, 0.7382]}, {"w": "implementation,", "b": [0.2098, 0.7234, 0.3333, 0.7382]}, {"w": "of", "b": [0.338, 0.7234, 0.3538, 0.7382]}, {"w": "GAN", "b": [0.3585, 0.7234, 0.3995, 0.7382]}, {"w": "Schmidhuber,", "b": [0.1294, 0.7394, 0.2343, 0.7542]}, {"w": "Jürgen", "b": [0.239, 0.7394, 0.2891, 0.7542]}, {"w": "Scikit-Learn", "b": [0.1294, 0.7555, 0.224, 0.7703]}, {"w": "SciPy,", "b": [0.1294, 0.7715, 0.1849, 0.7874]}, {"w": "2nd", "b": [0.1963, 0.7715, 0.2162, 0.7863]}, {"w": "self-supervised", "b": [0.1294, 0.7875, 0.2439, 0.8024]}, {"w": "learning", "b": [0.2487, 0.7875, 0.3107, 0.8024]}, {"w": "selu", "b": [0.1294, 0.8036, 0.1599, 0.8184]}, {"w": "function", "b": [0.1646, 0.8036, 0.2277, 0.8184]}, {"w": "SeparableConv2D", "b": [0.1294, 0.8196, 0.2681, 0.8344]}, {"w": "layer,", "b": [0.2729, 0.8196, 0.322, 0.8356]}, {"w": "2nd", "b": [0.3333, 0.8196, 0.3533, 0.8344]}, {"w": "separation", "b": [0.1294, 0.8357, 0.2072, 0.8505]}, {"w": "hyperplane", "b": [0.2119, 0.8357, 0.296, 0.8505]}, {"w": "sequence", "b": [0.1294, 0.8668, 0.2202, 0.8819]}, {"w": "data", "b": [0.2316, 0.8668, 0.277, 0.8819]}, {"w": "generating", "b": [0.1521, 0.882, 0.232, 0.8968]}, {"w": "overview", "b": [0.1521, 0.8981, 0.2225, 0.9129]}]}]}, {"page": 471, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "sequence generation sequence prediction sequences, processing with convnets", "words": [{"w": "sequence", "b": [0.1294, 0.0852, 0.1988, 0.1]}, {"w": "generation", "b": [0.2035, 0.0852, 0.2833, 0.1]}, {"w": "sequence", "b": [0.1294, 0.1012, 0.1988, 0.116]}, {"w": "prediction", "b": [0.2035, 0.1012, 0.2802, 0.116]}, {"w": "sequences,", "b": [0.1294, 0.1173, 0.2108, 0.1321]}, {"w": "processing", "b": [0.2156, 0.1173, 0.2965, 0.1321]}, {"w": "with", "b": [0.3012, 0.1173, 0.3349, 0.1321]}, {"w": "convnets", "b": [0.3396, 0.1173, 0.4068, 0.1321]}]}, {"id": "b_1", "type": "paragraph", "text": "1D convolution for sequence data 1D pooling for sequence data", "words": [{"w": "1D", "b": [0.1521, 0.1324, 0.1752, 0.1472]}, {"w": "convolution", "b": [0.18, 0.1324, 0.2704, 0.1472]}, {"w": "for", "b": [0.2751, 0.1324, 0.2972, 0.1472]}, {"w": "sequence", "b": [0.3019, 0.1324, 0.3712, 0.1472]}, {"w": "data", "b": [0.3759, 0.1324, 0.4075, 0.1472]}, {"w": "1D", "b": [0.1521, 0.1485, 0.1752, 0.1633]}, {"w": "pooling", "b": [0.18, 0.1485, 0.2378, 0.1633]}, {"w": "for", "b": [0.2425, 0.1485, 0.2646, 0.1633]}, {"w": "sequence", "b": [0.2693, 0.1485, 0.3386, 0.1633]}, {"w": "data", "b": [0.3434, 0.1485, 0.3749, 0.1633]}]}, {"id": "b_2", "type": "paragraph", "text": "combining with recurrent neural networks implementing 1D convnets Sequential class, 2nd Sequential model, 2nd SGD (stochastic gradient descent), 2nd shallow learning shared LSTM shear_range show_shapes option shuffling, iterated K-fold validation with Siamese LSTM model sigmoid function, 2nd, 3rd Simonyan, Karen SimpleRNN layer, 2nd single-label categorical classification multiclass classification sliding windows Smart Reply feature, Google smile vector softmax, 2nd, 3rd, 4th, 5th sound data sparse_categorical_crossentropy spatially hierarchical patterns speech recognition ssl directory stacking recurrent layers statistical power, developing models with steps_per_epoch stochastic gradient descent. See SGD. stochastic sampling stochasticity, 2nd strided convolutions strides style function style loss subroutines, reusing modular supervised learning SVM (support vector machine) symbolic AI, 2nd symbolic differentiation syntax tree prediction Szegedy, Christian", "words": [{"w": "combining", "b": [0.1521, 0.1645, 0.2331, 0.1793]}, {"w": "with", "b": [0.2378, 0.1645, 0.2714, 0.1793]}, {"w": "recurrent", "b": [0.2762, 0.1645, 0.3444, 0.1793]}, {"w": "neural", "b": [0.3492, 0.1645, 0.3964, 0.1793]}, {"w": "networks", "b": [0.4012, 0.1645, 0.4705, 0.1793]}, {"w": "implementing", "b": [0.1521, 0.1806, 0.2572, 0.1954]}, {"w": "1D", "b": [0.262, 0.1806, 0.2851, 0.1954]}, {"w": "convnets", "b": [0.2898, 0.1806, 0.3571, 0.1954]}, {"w": "Sequential", "b": [0.1294, 0.1966, 0.2093, 0.2114]}, {"w": "class,", "b": [0.214, 0.1966, 0.2621, 0.2125]}, {"w": "2nd", "b": [0.2735, 0.1966, 0.2934, 0.2114]}, {"w": "Sequential", "b": [0.1294, 0.2126, 0.2093, 0.2275]}, {"w": "model,", "b": [0.214, 0.2126, 0.2726, 0.2286]}, {"w": "2nd", "b": [0.284, 0.2126, 0.3039, 0.2275]}, {"w": "SGD", "b": [0.1294, 0.2287, 0.1673, 0.2435]}, {"w": "(stochastic", "b": [0.172, 0.2287, 0.2529, 0.2435]}, {"w": "gradient", "b": [0.2576, 0.2287, 0.3196, 0.2435]}, {"w": "descent),", "b": [0.3244, 0.2287, 0.3987, 0.2446]}, {"w": "2nd", "b": [0.4101, 0.2286, 0.43, 0.2435]}, {"w": "shallow", "b": [0.1294, 0.2447, 0.1883, 0.2595]}, {"w": "learning", "b": [0.193, 0.2447, 0.255, 0.2595]}, {"w": "shared", "b": [0.1294, 0.2608, 0.1788, 0.2756]}, {"w": "LSTM", "b": [0.1835, 0.2608, 0.234, 0.2756]}, {"w": "shear_range", "b": [0.1294, 0.2768, 0.2208, 0.2916]}, {"w": "show_shapes", "b": [0.1294, 0.2929, 0.2292, 0.3077]}, {"w": "option", "b": [0.234, 0.2929, 0.2823, 0.3077]}, {"w": "shuffling,", "b": [0.1294, 0.3089, 0.2021, 0.3237]}, {"w": "iterated", "b": [0.2069, 0.3089, 0.2636, 0.3237]}, {"w": "K-fold", "b": [0.2683, 0.3089, 0.3188, 0.3237]}, {"w": "validation", "b": [0.3235, 0.3089, 0.3992, 0.3237]}, {"w": "with", "b": [0.4039, 0.3089, 0.4375, 0.3237]}, {"w": "Siamese", "b": [0.1294, 0.325, 0.1925, 0.3398]}, {"w": "LSTM", "b": [0.1972, 0.325, 0.2477, 0.3398]}, {"w": "model", "b": [0.2524, 0.325, 0.2997, 0.3398]}, {"w": "sigmoid", "b": [0.1294, 0.341, 0.1904, 0.3558]}, {"w": "function,", "b": [0.1951, 0.341, 0.2695, 0.3569]}, {"w": "2nd,", "b": [0.2808, 0.3409, 0.3122, 0.3569]}, {"w": "3rd", "b": [0.3235, 0.3409, 0.3417, 0.3558]}, {"w": "Simonyan,", "b": [0.1294, 0.357, 0.2109, 0.3718]}, {"w": "Karen", "b": [0.2156, 0.357, 0.2618, 0.3718]}, {"w": "SimpleRNN", "b": [0.1294, 0.3731, 0.223, 0.3879]}, {"w": "layer,", "b": [0.2277, 0.3731, 0.2768, 0.389]}, {"w": "2nd", "b": [0.2882, 0.373, 0.3082, 0.3879]}, {"w": "single-label", "b": [0.1294, 0.4042, 0.2656, 0.4193]}, {"w": "categorical", "b": [0.1521, 0.4194, 0.2351, 0.4342]}, {"w": "classification", "b": [0.2398, 0.4194, 0.3397, 0.4342]}, {"w": "multiclass", "b": [0.1521, 0.4355, 0.2289, 0.4503]}, {"w": "classification", "b": [0.2336, 0.4355, 0.3334, 0.4503]}, {"w": "sliding", "b": [0.1294, 0.4515, 0.1809, 0.4663]}, {"w": "windows", "b": [0.1857, 0.4515, 0.254, 0.4663]}, {"w": "Smart", "b": [0.1294, 0.4676, 0.1746, 0.4824]}, {"w": "Reply", "b": [0.1793, 0.4676, 0.2245, 0.4824]}, {"w": "feature,", "b": [0.2293, 0.4676, 0.2865, 0.4824]}, {"w": "Google", "b": [0.2912, 0.4676, 0.3469, 0.4824]}, {"w": "smile", "b": [0.1294, 0.4836, 0.1704, 0.4984]}, {"w": "vector", "b": [0.1751, 0.4836, 0.2224, 0.4984]}, {"w": "softmax,", "b": [0.1294, 0.4997, 0.2017, 0.5156]}, {"w": "2nd,", "b": [0.2131, 0.4996, 0.2444, 0.5156]}, {"w": "3rd,", "b": [0.2557, 0.4996, 0.2853, 0.5156]}, {"w": "4th,", "b": [0.2966, 0.4996, 0.3256, 0.5156]}, {"w": "5th", "b": [0.3369, 0.4996, 0.3546, 0.5145]}, {"w": "sound", "b": [0.1294, 0.5157, 0.1746, 0.5305]}, {"w": "data", "b": [0.1793, 0.5157, 0.2109, 0.5305]}, {"w": "sparse_categorical_crossentropy", "b": [0.1294, 0.5317, 0.3753, 0.5465]}, {"w": "spatially", "b": [0.1294, 0.5478, 0.1935, 0.5626]}, {"w": "hierarchical", "b": [0.1983, 0.5478, 0.2876, 0.5626]}, {"w": "patterns", "b": [0.2923, 0.5478, 0.3522, 0.5626]}, {"w": "speech", "b": [0.1294, 0.5638, 0.1809, 0.5786]}, {"w": "recognition", "b": [0.1856, 0.5638, 0.2718, 0.5786]}, {"w": "ssl", "b": [0.1294, 0.5799, 0.1494, 0.5947]}, {"w": "directory", "b": [0.1541, 0.5799, 0.2224, 0.5947]}, {"w": "stacking", "b": [0.1294, 0.5959, 0.1925, 0.6107]}, {"w": "recurrent", "b": [0.1972, 0.5959, 0.2655, 0.6107]}, {"w": "layers", "b": [0.2702, 0.5959, 0.3154, 0.6107]}, {"w": "statistical", "b": [0.1294, 0.612, 0.2009, 0.6268]}, {"w": "power,", "b": [0.2056, 0.612, 0.2568, 0.6268]}, {"w": "developing", "b": [0.2616, 0.612, 0.3457, 0.6268]}, {"w": "models", "b": [0.3504, 0.612, 0.405, 0.6268]}, {"w": "with", "b": [0.4098, 0.612, 0.4434, 0.6268]}, {"w": "steps_per_epoch", "b": [0.1294, 0.628, 0.2555, 0.6428]}, {"w": "stochastic", "b": [0.1294, 0.644, 0.204, 0.6589]}, {"w": "gradient", "b": [0.2088, 0.644, 0.2708, 0.6589]}, {"w": "descent.", "b": [0.2755, 0.644, 0.3435, 0.66]}, {"w": "See", "b": [0.1748, 0.66, 0.2089, 0.6751]}, {"w": "SGD.", "b": [0.2202, 0.66, 0.2656, 0.6751]}, {"w": "stochastic", "b": [0.1294, 0.6752, 0.204, 0.69]}, {"w": "sampling", "b": [0.2088, 0.6752, 0.2781, 0.69]}, {"w": "stochasticity,", "b": [0.1294, 0.6913, 0.2353, 0.7072]}, {"w": "2nd", "b": [0.2467, 0.6912, 0.2667, 0.7061]}, {"w": "strided", "b": [0.1294, 0.7073, 0.1809, 0.7221]}, {"w": "convolutions", "b": [0.1856, 0.7073, 0.2834, 0.7221]}, {"w": "strides", "b": [0.1294, 0.7234, 0.1788, 0.7382]}, {"w": "style", "b": [0.1294, 0.7394, 0.1652, 0.7542]}, {"w": "function", "b": [0.1699, 0.7394, 0.2329, 0.7542]}, {"w": "style", "b": [0.1294, 0.7555, 0.1652, 0.7703]}, {"w": "loss", "b": [0.1699, 0.7555, 0.1993, 0.7703]}, {"w": "subroutines,", "b": [0.1294, 0.7715, 0.2214, 0.7863]}, {"w": "reusing", "b": [0.2261, 0.7715, 0.2818, 0.7863]}, {"w": "modular", "b": [0.2865, 0.7715, 0.3496, 0.7863]}, {"w": "supervised", "b": [0.1294, 0.7875, 0.2103, 0.8024]}, {"w": "learning", "b": [0.2151, 0.7875, 0.2771, 0.8024]}, {"w": "SVM", "b": [0.1294, 0.8036, 0.1704, 0.8184]}, {"w": "(support", "b": [0.1751, 0.8036, 0.2382, 0.8184]}, {"w": "vector", "b": [0.2429, 0.8036, 0.2902, 0.8184]}, {"w": "machine)", "b": [0.2949, 0.8036, 0.3653, 0.8184]}, {"w": "symbolic", "b": [0.1294, 0.8196, 0.1988, 0.8344]}, {"w": "AI,", "b": [0.2035, 0.8196, 0.2348, 0.8356]}, {"w": "2nd", "b": [0.2462, 0.8196, 0.2661, 0.8344]}, {"w": "symbolic", "b": [0.1294, 0.8357, 0.1988, 0.8505]}, {"w": "differentiation", "b": [0.2035, 0.8357, 0.3114, 0.8505]}, {"w": "syntax", "b": [0.1294, 0.8517, 0.1788, 0.8665]}, {"w": "tree", "b": [0.1835, 0.8517, 0.2119, 0.8665]}, {"w": "prediction", "b": [0.2166, 0.8517, 0.2933, 0.8665]}, {"w": "Szegedy,", "b": [0.1294, 0.8678, 0.197, 0.8826]}, {"w": "Christian", "b": [0.2017, 0.8678, 0.2711, 0.8826]}]}]}, {"page": 472, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_1", "type": "paragraph", "text": "tanh activation target temporal leak temporally supervised learning TensorBoard applications, 2nd TensorFlow visualization framework tensors higher-dimensional key attributes of manipulating in Numpy operations of broadcasting dot element-wise geometric interpretation of geometric interpretation of deep learning reshaping reshaping slicing. See also data tensors. test sets hold-out validation iterated K-fold validation with shuffling K-fold validation text data, 2nd", "words": [{"w": "tanh", "b": [0.1294, 0.1235, 0.162, 0.1383]}, {"w": "activation", "b": [0.1667, 0.1235, 0.2413, 0.1383]}, {"w": "target", "b": [0.1294, 0.1396, 0.1721, 0.1544]}, {"w": "temporal", "b": [0.1294, 0.1556, 0.1967, 0.1704]}, {"w": "leak", "b": [0.2014, 0.1556, 0.2329, 0.1704]}, {"w": "temporally", "b": [0.1294, 0.1716, 0.2114, 0.1865]}, {"w": "supervised", "b": [0.2161, 0.1716, 0.297, 0.1865]}, {"w": "learning", "b": [0.3018, 0.1716, 0.3638, 0.1865]}, {"w": "TensorBoard", "b": [0.1294, 0.1877, 0.2269, 0.2025]}, {"w": "applications,", "b": [0.2316, 0.1877, 0.3344, 0.2036]}, {"w": "2nd", "b": [0.3457, 0.1876, 0.3657, 0.2025]}, {"w": "TensorFlow", "b": [0.1294, 0.2037, 0.2195, 0.2185]}, {"w": "visualization", "b": [0.2243, 0.2037, 0.321, 0.2185]}, {"w": "framework", "b": [0.3257, 0.2037, 0.4087, 0.2185]}, {"w": "tensors", "b": [0.1294, 0.2348, 0.2089, 0.25]}, {"w": "higher-dimensional", "b": [0.1521, 0.2501, 0.2989, 0.2649]}, {"w": "key", "b": [0.1521, 0.2661, 0.1794, 0.2809]}, {"w": "attributes", "b": [0.1842, 0.2661, 0.2546, 0.2809]}, {"w": "of", "b": [0.2593, 0.2661, 0.2751, 0.2809]}, {"w": "manipulating", "b": [0.1521, 0.2822, 0.252, 0.297]}, {"w": "in", "b": [0.2567, 0.2822, 0.2714, 0.297]}, {"w": "Numpy", "b": [0.2762, 0.2822, 0.3329, 0.297]}, {"w": "operations", "b": [0.1521, 0.2982, 0.2309, 0.313]}, {"w": "of", "b": [0.2357, 0.2982, 0.2514, 0.313]}, {"w": "broadcasting", "b": [0.1748, 0.3143, 0.2715, 0.3291]}, {"w": "dot", "b": [0.1748, 0.3303, 0.199, 0.3451]}, {"w": "element-wise", "b": [0.1748, 0.3463, 0.2757, 0.3612]}, {"w": "geometric", "b": [0.1748, 0.3624, 0.2505, 0.3772]}, {"w": "interpretation", "b": [0.2552, 0.3624, 0.3571, 0.3772]}, {"w": "of", "b": [0.3619, 0.3624, 0.3776, 0.3772]}, {"w": "geometric", "b": [0.1748, 0.3784, 0.2505, 0.3932]}, {"w": "interpretation", "b": [0.2552, 0.3784, 0.3571, 0.3932]}, {"w": "of", "b": [0.3619, 0.3784, 0.3776, 0.3932]}, {"w": "deep", "b": [0.3824, 0.3784, 0.4181, 0.3932]}, {"w": "learning", "b": [0.4228, 0.3784, 0.4848, 0.3932]}, {"w": "reshaping", "b": [0.1748, 0.3945, 0.2484, 0.4093]}, {"w": "reshaping", "b": [0.1521, 0.4105, 0.2257, 0.4253]}, {"w": "slicing.", "b": [0.1521, 0.4266, 0.2139, 0.4425]}, {"w": "See", "b": [0.1748, 0.4425, 0.2089, 0.4576]}, {"w": "also", "b": [0.2202, 0.4425, 0.2656, 0.4576]}, {"w": "data", "b": [0.277, 0.4425, 0.3224, 0.4576]}, {"w": "tensors.", "b": [0.3337, 0.4425, 0.4246, 0.4576]}, {"w": "test", "b": [0.1294, 0.4578, 0.1557, 0.4726]}, {"w": "sets", "b": [0.1604, 0.4578, 0.1888, 0.4726]}, {"w": "hold-out", "b": [0.1521, 0.4729, 0.2162, 0.4877]}, {"w": "validation", "b": [0.221, 0.4729, 0.2966, 0.4877]}, {"w": "iterated", "b": [0.1521, 0.489, 0.2089, 0.5038]}, {"w": "K-fold", "b": [0.2136, 0.489, 0.264, 0.5038]}, {"w": "validation", "b": [0.2688, 0.489, 0.3444, 0.5038]}, {"w": "with", "b": [0.3492, 0.489, 0.3828, 0.5038]}, {"w": "shuffling", "b": [0.3875, 0.489, 0.4555, 0.5038]}, {"w": "K-fold", "b": [0.1521, 0.505, 0.2026, 0.5198]}, {"w": "validation", "b": [0.2073, 0.505, 0.283, 0.5198]}, {"w": "text", "b": [0.1294, 0.521, 0.1578, 0.5359]}, {"w": "data,", "b": [0.1625, 0.521, 0.2054, 0.537]}, {"w": "2nd", "b": [0.2167, 0.521, 0.2367, 0.5359]}]}, {"id": "b_2", "type": "paragraph", "text": "downloading raw text one-hot encoding of words and characters word embeddings defining models downloading GloVe word embeddings learning with embedding layers loading GloVe embeddings in models preprocessing pretrained tokenizing data training and evaluating models text, generating with LSTM generating sequence data history of generative recurrent networks", "words": [{"w": "downloading", "b": [0.1521, 0.5371, 0.2509, 0.5519]}, {"w": "raw", "b": [0.2556, 0.5371, 0.284, 0.5519]}, {"w": "text", "b": [0.2887, 0.5371, 0.3171, 0.5519]}, {"w": "one-hot", "b": [0.1521, 0.5531, 0.2099, 0.5679]}, {"w": "encoding", "b": [0.2146, 0.5531, 0.284, 0.5679]}, {"w": "of", "b": [0.2887, 0.5531, 0.3045, 0.5679]}, {"w": "words", "b": [0.3092, 0.5531, 0.3555, 0.5679]}, {"w": "and", "b": [0.3602, 0.5531, 0.3875, 0.5679]}, {"w": "characters", "b": [0.3922, 0.5531, 0.4689, 0.5679]}, {"w": "word", "b": [0.1521, 0.5692, 0.191, 0.584]}, {"w": "embeddings", "b": [0.1957, 0.5692, 0.2872, 0.584]}, {"w": "defining", "b": [0.1748, 0.5852, 0.2379, 0.6]}, {"w": "models", "b": [0.2426, 0.5852, 0.2973, 0.6]}, {"w": "downloading", "b": [0.1748, 0.6013, 0.2736, 0.6161]}, {"w": "GloVe", "b": [0.2783, 0.6013, 0.3267, 0.6161]}, {"w": "word", "b": [0.3314, 0.6013, 0.3703, 0.6161]}, {"w": "embeddings", "b": [0.375, 0.6013, 0.4665, 0.6161]}, {"w": "learning", "b": [0.1748, 0.6173, 0.2368, 0.6321]}, {"w": "with", "b": [0.2415, 0.6173, 0.2752, 0.6321]}, {"w": "embedding", "b": [0.2799, 0.6173, 0.364, 0.6321]}, {"w": "layers", "b": [0.3687, 0.6173, 0.4139, 0.6321]}, {"w": "loading", "b": [0.1748, 0.6334, 0.2316, 0.6482]}, {"w": "GloVe", "b": [0.2363, 0.6334, 0.2846, 0.6482]}, {"w": "embeddings", "b": [0.2894, 0.6334, 0.3808, 0.6482]}, {"w": "in", "b": [0.3855, 0.6334, 0.4003, 0.6482]}, {"w": "models", "b": [0.405, 0.6334, 0.4596, 0.6482]}, {"w": "preprocessing", "b": [0.1748, 0.6494, 0.2799, 0.6642]}, {"w": "pretrained", "b": [0.1748, 0.6654, 0.2515, 0.6802]}, {"w": "tokenizing", "b": [0.1748, 0.6815, 0.2547, 0.6963]}, {"w": "data", "b": [0.2594, 0.6815, 0.2909, 0.6963]}, {"w": "training", "b": [0.1748, 0.6975, 0.2337, 0.7123]}, {"w": "and", "b": [0.2384, 0.6975, 0.2657, 0.7123]}, {"w": "evaluating", "b": [0.2705, 0.6975, 0.3493, 0.7123]}, {"w": "models", "b": [0.354, 0.6975, 0.4087, 0.7123]}, {"w": "text,", "b": [0.1294, 0.7136, 0.1625, 0.7284]}, {"w": "generating", "b": [0.1673, 0.7136, 0.2471, 0.7284]}, {"w": "with", "b": [0.2518, 0.7136, 0.2855, 0.7284]}, {"w": "LSTM", "b": [0.2902, 0.7136, 0.3407, 0.7284]}, {"w": "generating", "b": [0.1521, 0.7287, 0.232, 0.7435]}, {"w": "sequence", "b": [0.2367, 0.7287, 0.306, 0.7435]}, {"w": "data", "b": [0.3108, 0.7287, 0.3423, 0.7435]}, {"w": "history", "b": [0.1521, 0.7448, 0.2047, 0.7596]}, {"w": "of", "b": [0.2094, 0.7448, 0.2252, 0.7596]}, {"w": "generative", "b": [0.2299, 0.7448, 0.3087, 0.7596]}, {"w": "recurrent", "b": [0.3134, 0.7448, 0.3817, 0.7596]}, {"w": "networks", "b": [0.3864, 0.7448, 0.4558, 0.7596]}]}, {"id": "b_3", "type": "paragraph", "text": "implementing character-level text generation sampling strategy text-to-speech conversion Theano installing on Ubuntu overview, 2nd timeseries data, 2nd timesteps", "words": [{"w": "implementing", "b": [0.1521, 0.7608, 0.2572, 0.7756]}, {"w": "character-level", "b": [0.262, 0.7608, 0.3739, 0.7756]}, {"w": "text", "b": [0.3787, 0.7608, 0.407, 0.7756]}, {"w": "generation", "b": [0.4118, 0.7608, 0.4916, 0.7756]}, {"w": "sampling", "b": [0.1521, 0.7769, 0.2215, 0.7917]}, {"w": "strategy", "b": [0.2262, 0.7769, 0.2861, 0.7917]}, {"w": "text-to-speech", "b": [0.1294, 0.7929, 0.2366, 0.8077]}, {"w": "conversion", "b": [0.2413, 0.7929, 0.3243, 0.8077]}, {"w": "Theano", "b": [0.1294, 0.824, 0.1975, 0.8391]}, {"w": "installing", "b": [0.1521, 0.8392, 0.2226, 0.8541]}, {"w": "on", "b": [0.2273, 0.8392, 0.2462, 0.8541]}, {"w": "Ubuntu", "b": [0.2509, 0.8392, 0.3077, 0.8541]}, {"w": "overview,", "b": [0.1521, 0.858, 0.2338, 0.8739]}, {"w": "2nd", "b": [0.2452, 0.8553, 0.2694, 0.8728]}, {"w": "timeseries", "b": [0.1294, 0.874, 0.2061, 0.8888]}, {"w": "data,", "b": [0.2109, 0.874, 0.2537, 0.8899]}, {"w": "2nd", "b": [0.265, 0.874, 0.285, 0.8888]}, {"w": "timesteps", "b": [0.1294, 0.89, 0.2009, 0.9049]}]}]}, {"page": 473, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "TITAN X, NVIDIA token embedding tokenizing data, word embeddings total variation loss TPU (tensor processing unit) trainable attribute training convnets on small datasets building networks", "words": [{"w": "TITAN", "b": [0.1294, 0.0852, 0.1846, 0.1]}, {"w": "X,", "b": [0.1894, 0.0852, 0.2077, 0.1]}, {"w": "NVIDIA", "b": [0.2125, 0.0852, 0.2797, 0.1]}, {"w": "token", "b": [0.1294, 0.1012, 0.1715, 0.116]}, {"w": "embedding", "b": [0.1762, 0.1012, 0.2603, 0.116]}, {"w": "tokenizing", "b": [0.1294, 0.1173, 0.2093, 0.1321]}, {"w": "data,", "b": [0.214, 0.1173, 0.2503, 0.1321]}, {"w": "word", "b": [0.255, 0.1173, 0.2939, 0.1321]}, {"w": "embeddings", "b": [0.2986, 0.1173, 0.39, 0.1321]}, {"w": "total", "b": [0.1294, 0.1333, 0.1631, 0.1481]}, {"w": "variation", "b": [0.1678, 0.1333, 0.235, 0.1481]}, {"w": "loss", "b": [0.2398, 0.1333, 0.2692, 0.1481]}, {"w": "TPU", "b": [0.1294, 0.1494, 0.1652, 0.1642]}, {"w": "(tensor", "b": [0.1699, 0.1494, 0.2224, 0.1642]}, {"w": "processing", "b": [0.2271, 0.1494, 0.3081, 0.1642]}, {"w": "unit)", "b": [0.3128, 0.1494, 0.3485, 0.1642]}, {"w": "trainable", "b": [0.1294, 0.1654, 0.1956, 0.1802]}, {"w": "attribute", "b": [0.2003, 0.1654, 0.2634, 0.1802]}, {"w": "training", "b": [0.1294, 0.1965, 0.2202, 0.2116]}, {"w": "convnets", "b": [0.1521, 0.2118, 0.2194, 0.2266]}, {"w": "on", "b": [0.2241, 0.2118, 0.243, 0.2266]}, {"w": "small", "b": [0.2478, 0.2118, 0.2888, 0.2266]}, {"w": "datasets", "b": [0.2935, 0.2118, 0.3534, 0.2266]}, {"w": "building", "b": [0.1748, 0.2278, 0.2379, 0.2426]}, {"w": "networks", "b": [0.2426, 0.2278, 0.312, 0.2426]}]}, {"id": "b_1", "type": "equation", "text": "data preprocessing downloading data relevance for small-data problems", "words": [{"w": "data", "b": [0.1748, 0.2438, 0.2063, 0.2587]}, {"w": "preprocessing", "b": [0.2111, 0.2438, 0.3161, 0.2587]}, {"w": "downloading", "b": [0.1748, 0.2599, 0.2736, 0.2747]}, {"w": "data", "b": [0.2783, 0.2599, 0.3099, 0.2747]}, {"w": "relevance", "b": [0.1748, 0.2759, 0.2473, 0.2907]}, {"w": "for", "b": [0.252, 0.2759, 0.2741, 0.2907]}, {"w": "small-data", "b": [0.2788, 0.2759, 0.3576, 0.2907]}, {"w": "problems", "b": [0.3624, 0.2759, 0.4328, 0.2907]}]}, {"id": "b_2", "type": "paragraph", "text": "using data augmentation interrupting language models", "words": [{"w": "using", "b": [0.1748, 0.292, 0.2158, 0.3068]}, {"w": "data", "b": [0.2205, 0.292, 0.2521, 0.3068]}, {"w": "augmentation", "b": [0.2568, 0.292, 0.3598, 0.3068]}, {"w": "interrupting", "b": [0.1521, 0.308, 0.2415, 0.3228]}, {"w": "language", "b": [0.1521, 0.3241, 0.2204, 0.3389]}, {"w": "models", "b": [0.2251, 0.3241, 0.2798, 0.3389]}]}, {"id": "b_3", "type": "paragraph", "text": "models training loop, 2nd training sets", "words": [{"w": "models", "b": [0.1521, 0.3401, 0.2068, 0.3549]}, {"w": "training", "b": [0.1294, 0.3562, 0.1883, 0.371]}, {"w": "loop,", "b": [0.193, 0.3562, 0.238, 0.3721]}, {"w": "2nd", "b": [0.2493, 0.3561, 0.2693, 0.371]}, {"w": "training", "b": [0.1294, 0.3722, 0.1883, 0.387]}, {"w": "sets", "b": [0.193, 0.3722, 0.2214, 0.387]}]}, {"id": "b_4", "type": "paragraph", "text": "hold-out validation iterated K-fold validation with shuffling K-fold validation train_labels variable, 2nd translation-invariant patterns, 2nd transposition Turing test Turing, Alan two-branch networks Tyka, Mike, 2nd", "words": [{"w": "hold-out", "b": [0.1521, 0.3873, 0.2162, 0.4022]}, {"w": "validation", "b": [0.221, 0.3873, 0.2966, 0.4022]}, {"w": "iterated", "b": [0.1521, 0.4034, 0.2089, 0.4182]}, {"w": "K-fold", "b": [0.2136, 0.4034, 0.264, 0.4182]}, {"w": "validation", "b": [0.2688, 0.4034, 0.3444, 0.4182]}, {"w": "with", "b": [0.3492, 0.4034, 0.3828, 0.4182]}, {"w": "shuffling", "b": [0.3875, 0.4034, 0.4555, 0.4182]}, {"w": "K-fold", "b": [0.1521, 0.4194, 0.2026, 0.4342]}, {"w": "validation", "b": [0.2073, 0.4194, 0.283, 0.4342]}, {"w": "train_labels", "b": [0.1294, 0.4355, 0.2177, 0.4503]}, {"w": "variable,", "b": [0.2224, 0.4355, 0.2947, 0.4514]}, {"w": "2nd", "b": [0.306, 0.4354, 0.326, 0.4503]}, {"w": "translation-invariant", "b": [0.1294, 0.4515, 0.2828, 0.4663]}, {"w": "patterns,", "b": [0.2876, 0.4515, 0.3588, 0.4674]}, {"w": "2nd", "b": [0.3701, 0.4515, 0.3901, 0.4663]}, {"w": "transposition", "b": [0.1294, 0.4676, 0.2272, 0.4824]}, {"w": "Turing", "b": [0.1294, 0.4836, 0.1802, 0.4984]}, {"w": "test", "b": [0.185, 0.4836, 0.2113, 0.4984]}, {"w": "Turing,", "b": [0.1294, 0.4997, 0.185, 0.5145]}, {"w": "Alan", "b": [0.1897, 0.4997, 0.2265, 0.5145]}, {"w": "two-branch", "b": [0.1294, 0.5157, 0.2156, 0.5305]}, {"w": "networks", "b": [0.2203, 0.5157, 0.2897, 0.5305]}, {"w": "Tyka,", "b": [0.1294, 0.5317, 0.1717, 0.5465]}, {"w": "Mike,", "b": [0.1764, 0.5317, 0.2277, 0.5477]}, {"w": "2nd", "b": [0.239, 0.5317, 0.259, 0.5465]}]}, {"id": "b_6", "type": "paragraph", "text": "Ubuntu installing Keras on installing Python scientific suite on installing Theano on setting up GPU support underfitting adding dropout adding weight regularization reducing network size unfreezing layers Unix workstation unsupervised learning", "words": [{"w": "Ubuntu", "b": [0.1294, 0.643, 0.1975, 0.6582]}, {"w": "installing", "b": [0.1521, 0.6583, 0.2226, 0.6731]}, {"w": "Keras", "b": [0.2273, 0.6583, 0.2714, 0.6731]}, {"w": "on", "b": [0.2761, 0.6583, 0.2951, 0.6731]}, {"w": "installing", "b": [0.1521, 0.6743, 0.2226, 0.6892]}, {"w": "Python", "b": [0.2273, 0.6743, 0.2809, 0.6892]}, {"w": "scientific", "b": [0.2856, 0.6743, 0.355, 0.6892]}, {"w": "suite", "b": [0.3597, 0.6743, 0.3955, 0.6892]}, {"w": "on", "b": [0.4002, 0.6743, 0.4191, 0.6892]}, {"w": "installing", "b": [0.1521, 0.6904, 0.2226, 0.7052]}, {"w": "Theano", "b": [0.2273, 0.6904, 0.284, 0.7052]}, {"w": "on", "b": [0.2888, 0.6904, 0.3077, 0.7052]}, {"w": "setting", "b": [0.1521, 0.7064, 0.2026, 0.7212]}, {"w": "up", "b": [0.2073, 0.7064, 0.2262, 0.7212]}, {"w": "GPU", "b": [0.231, 0.7064, 0.2688, 0.7212]}, {"w": "support", "b": [0.2735, 0.7064, 0.3303, 0.7212]}, {"w": "underfitting", "b": [0.1294, 0.7225, 0.2187, 0.7373]}, {"w": "adding", "b": [0.1521, 0.7376, 0.2036, 0.7524]}, {"w": "dropout", "b": [0.2083, 0.7376, 0.2672, 0.7524]}, {"w": "adding", "b": [0.1521, 0.7537, 0.2036, 0.7685]}, {"w": "weight", "b": [0.2083, 0.7537, 0.2598, 0.7685]}, {"w": "regularization", "b": [0.2646, 0.7537, 0.3696, 0.7685]}, {"w": "reducing", "b": [0.1521, 0.7697, 0.2183, 0.7845]}, {"w": "network", "b": [0.223, 0.7697, 0.285, 0.7845]}, {"w": "size", "b": [0.2898, 0.7697, 0.3192, 0.7845]}, {"w": "unfreezing", "b": [0.1294, 0.7858, 0.2103, 0.8006]}, {"w": "layers", "b": [0.215, 0.7858, 0.2602, 0.8006]}, {"w": "Unix", "b": [0.1294, 0.8018, 0.1673, 0.8166]}, {"w": "workstation", "b": [0.172, 0.8018, 0.2613, 0.8166]}, {"w": "unsupervised", "b": [0.1294, 0.8179, 0.2292, 0.8327]}, {"w": "learning", "b": [0.234, 0.8179, 0.296, 0.8327]}]}]}, {"page": 474, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "VAEs (variational autoencoders), generating images with", "words": [{"w": "VAEs", "b": [0.1294, 0.0852, 0.1732, 0.1]}, {"w": "(variational", "b": [0.1779, 0.0852, 0.2652, 0.1]}, {"w": "autoencoders),", "b": [0.2699, 0.0852, 0.3807, 0.1]}, {"w": "generating", "b": [0.3855, 0.0852, 0.4653, 0.1]}, {"w": "images", "b": [0.4701, 0.0852, 0.5237, 0.1]}, {"w": "with", "b": [0.5284, 0.0852, 0.562, 0.1]}]}, {"id": "b_1", "type": "paragraph", "text": "concept vectors for image editing sampling from latent spaces of images validation scores validation sets hold-out validation iterated K-fold validation with shuffling K-fold validation overfitting overview validation_data argument, 2nd validation_steps argument values handling missing normalizing vanishing gradient problem Vapnik, Vladimir vector data, 2nd vector regression vectorization vectorized data vectorized implementations vectorizing text vectors (1D tensors) versatility vi video data, 2nd visual concepts visualizing convnet filters convnet learning heatmaps of class activation intermediate activations volumetric data", "words": [{"w": "concept", "b": [0.1521, 0.1003, 0.211, 0.1152]}, {"w": "vectors", "b": [0.2157, 0.1003, 0.2703, 0.1152]}, {"w": "for", "b": [0.2751, 0.1003, 0.2971, 0.1152]}, {"w": "image", "b": [0.3018, 0.1003, 0.3481, 0.1152]}, {"w": "editing", "b": [0.3528, 0.1003, 0.4054, 0.1152]}, {"w": "sampling", "b": [0.1521, 0.1164, 0.2215, 0.1312]}, {"w": "from", "b": [0.2262, 0.1164, 0.263, 0.1312]}, {"w": "latent", "b": [0.2677, 0.1164, 0.3098, 0.1312]}, {"w": "spaces", "b": [0.3145, 0.1164, 0.3639, 0.1312]}, {"w": "of", "b": [0.3686, 0.1164, 0.3844, 0.1312]}, {"w": "images", "b": [0.3891, 0.1164, 0.4427, 0.1312]}, {"w": "validation", "b": [0.1294, 0.1324, 0.2051, 0.1472]}, {"w": "scores", "b": [0.2098, 0.1324, 0.2571, 0.1472]}, {"w": "validation", "b": [0.1294, 0.1485, 0.2051, 0.1633]}, {"w": "sets", "b": [0.2098, 0.1485, 0.2382, 0.1633]}, {"w": "hold-out", "b": [0.1521, 0.1636, 0.2162, 0.1784]}, {"w": "validation", "b": [0.221, 0.1636, 0.2966, 0.1784]}, {"w": "iterated", "b": [0.1521, 0.1797, 0.2089, 0.1945]}, {"w": "K-fold", "b": [0.2136, 0.1797, 0.264, 0.1945]}, {"w": "validation", "b": [0.2688, 0.1797, 0.3444, 0.1945]}, {"w": "with", "b": [0.3492, 0.1797, 0.3828, 0.1945]}, {"w": "shuffling", "b": [0.3875, 0.1797, 0.4555, 0.1945]}, {"w": "K-fold", "b": [0.1521, 0.1957, 0.2026, 0.2105]}, {"w": "validation", "b": [0.2073, 0.1957, 0.283, 0.2105]}, {"w": "overfitting", "b": [0.1521, 0.2118, 0.232, 0.2266]}, {"w": "overview", "b": [0.1521, 0.2278, 0.2225, 0.2426]}, {"w": "validation_data", "b": [0.1294, 0.2438, 0.2461, 0.2587]}, {"w": "argument,", "b": [0.2508, 0.2438, 0.3332, 0.2598]}, {"w": "2nd", "b": [0.3446, 0.2438, 0.3645, 0.2587]}, {"w": "validation_steps", "b": [0.1294, 0.2599, 0.2524, 0.2747]}, {"w": "argument", "b": [0.2571, 0.2599, 0.3282, 0.2747]}, {"w": "values", "b": [0.1294, 0.291, 0.1975, 0.3061]}, {"w": "handling", "b": [0.1521, 0.3062, 0.2183, 0.321]}, {"w": "missing", "b": [0.2231, 0.3062, 0.2819, 0.321]}, {"w": "normalizing", "b": [0.1521, 0.3223, 0.2436, 0.3371]}, {"w": "vanishing", "b": [0.1294, 0.3383, 0.203, 0.3531]}, {"w": "gradient", "b": [0.2077, 0.3383, 0.2697, 0.3531]}, {"w": "problem", "b": [0.2744, 0.3383, 0.3375, 0.3531]}, {"w": "Vapnik,", "b": [0.1294, 0.3544, 0.1877, 0.3692]}, {"w": "Vladimir", "b": [0.1925, 0.3544, 0.2608, 0.3692]}, {"w": "vector", "b": [0.1294, 0.3704, 0.1767, 0.3852]}, {"w": "data,", "b": [0.1814, 0.3704, 0.2243, 0.3863]}, {"w": "2nd", "b": [0.2356, 0.3704, 0.2556, 0.3852]}, {"w": "vector", "b": [0.1294, 0.3865, 0.1767, 0.4013]}, {"w": "regression", "b": [0.1814, 0.3865, 0.2592, 0.4013]}, {"w": "vectorization", "b": [0.1294, 0.4025, 0.2282, 0.4173]}, {"w": "vectorized", "b": [0.1294, 0.4185, 0.2082, 0.4333]}, {"w": "data", "b": [0.2129, 0.4185, 0.2445, 0.4333]}, {"w": "vectorized", "b": [0.1294, 0.4346, 0.2082, 0.4494]}, {"w": "implementations", "b": [0.2129, 0.4346, 0.3391, 0.4494]}, {"w": "vectorizing", "b": [0.1294, 0.4506, 0.2145, 0.4654]}, {"w": "text", "b": [0.2193, 0.4506, 0.2476, 0.4654]}, {"w": "vectors", "b": [0.1294, 0.4667, 0.1841, 0.4815]}, {"w": "(1D", "b": [0.1888, 0.4667, 0.2182, 0.4815]}, {"w": "tensors)", "b": [0.2229, 0.4667, 0.2828, 0.4815]}, {"w": "versatility", "b": [0.1294, 0.4827, 0.2051, 0.4975]}, {"w": "vi", "b": [0.1294, 0.4988, 0.1441, 0.5136]}, {"w": "video", "b": [0.1294, 0.5148, 0.1715, 0.5296]}, {"w": "data,", "b": [0.1762, 0.5148, 0.219, 0.5307]}, {"w": "2nd", "b": [0.2304, 0.5148, 0.2503, 0.5296]}, {"w": "visual", "b": [0.1294, 0.5308, 0.1746, 0.5457]}, {"w": "concepts", "b": [0.1793, 0.5308, 0.2455, 0.5457]}, {"w": "visualizing", "b": [0.1294, 0.5619, 0.2543, 0.5771]}, {"w": "convnet", "b": [0.1521, 0.5772, 0.212, 0.592]}, {"w": "filters", "b": [0.2167, 0.5772, 0.2609, 0.592]}, {"w": "convnet", "b": [0.1521, 0.5932, 0.212, 0.608]}, {"w": "learning", "b": [0.2167, 0.5932, 0.2787, 0.608]}, {"w": "heatmaps", "b": [0.1521, 0.6093, 0.2236, 0.6241]}, {"w": "of", "b": [0.2283, 0.6093, 0.2441, 0.6241]}, {"w": "class", "b": [0.2488, 0.6093, 0.2856, 0.6241]}, {"w": "activation", "b": [0.2903, 0.6093, 0.3649, 0.6241]}, {"w": "intermediate", "b": [0.1521, 0.6253, 0.2467, 0.6401]}, {"w": "activations", "b": [0.2514, 0.6253, 0.3334, 0.6401]}, {"w": "volumetric", "b": [0.1294, 0.6414, 0.2114, 0.6562]}, {"w": "data", "b": [0.2161, 0.6414, 0.2476, 0.6562]}]}, {"id": "b_3", "type": "paragraph", "text": "weight decay weight regularization, adding weight sharing of layers weight-initialization schemes weights argument, VGG16, 2nd weights, layers Welling, Max width_shift range word embeddings defining models downloading GloVe word embeddings evaluating models", "words": [{"w": "weight", "b": [0.1294, 0.7216, 0.1809, 0.7364]}, {"w": "decay", "b": [0.1856, 0.7216, 0.2298, 0.7364]}, {"w": "weight", "b": [0.1294, 0.7376, 0.1809, 0.7524]}, {"w": "regularization,", "b": [0.1856, 0.7376, 0.2954, 0.7524]}, {"w": "adding", "b": [0.3002, 0.7376, 0.3517, 0.7524]}, {"w": "weight", "b": [0.1294, 0.7537, 0.1809, 0.7685]}, {"w": "sharing", "b": [0.1856, 0.7537, 0.2413, 0.7685]}, {"w": "of", "b": [0.2461, 0.7537, 0.2618, 0.7685]}, {"w": "layers", "b": [0.2666, 0.7537, 0.3117, 0.7685]}, {"w": "weight-initialization", "b": [0.1294, 0.7697, 0.2829, 0.7845]}, {"w": "schemes", "b": [0.2876, 0.7697, 0.3517, 0.7845]}, {"w": "weights", "b": [0.1294, 0.7858, 0.1883, 0.8006]}, {"w": "argument,", "b": [0.193, 0.7858, 0.2688, 0.8006]}, {"w": "VGG16,", "b": [0.2736, 0.7858, 0.3448, 0.8017]}, {"w": "2nd", "b": [0.3562, 0.7857, 0.3761, 0.8006]}, {"w": "weights,", "b": [0.1294, 0.8018, 0.193, 0.8166]}, {"w": "layers", "b": [0.1977, 0.8018, 0.2429, 0.8166]}, {"w": "Welling,", "b": [0.1294, 0.8179, 0.1936, 0.8327]}, {"w": "Max", "b": [0.1983, 0.8179, 0.233, 0.8327]}, {"w": "width_shift", "b": [0.1294, 0.8339, 0.2156, 0.8487]}, {"w": "range", "b": [0.2203, 0.8339, 0.2624, 0.8487]}, {"w": "word", "b": [0.1294, 0.8499, 0.1683, 0.8647]}, {"w": "embeddings", "b": [0.173, 0.8499, 0.2645, 0.8647]}, {"w": "defining", "b": [0.1521, 0.8651, 0.2152, 0.8799]}, {"w": "models", "b": [0.2199, 0.8651, 0.2746, 0.8799]}, {"w": "downloading", "b": [0.1521, 0.8811, 0.2509, 0.8959]}, {"w": "GloVe", "b": [0.2556, 0.8811, 0.304, 0.8959]}, {"w": "word", "b": [0.3087, 0.8811, 0.3476, 0.8959]}, {"w": "embeddings", "b": [0.3523, 0.8811, 0.4438, 0.8959]}, {"w": "evaluating", "b": [0.1521, 0.8972, 0.2309, 0.912]}, {"w": "models", "b": [0.2357, 0.8972, 0.2903, 0.912]}]}]}, {"page": 475, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "learning embedding layers loading GloVe embeddings in models preprocessing embeddings tokenizing data training models using pretrained word embeddings word vectors Word2vec algorithm word-embedding space word_index workflow of machine learning, 2nd", "words": [{"w": "learning", "b": [0.1521, 0.0852, 0.2141, 0.1]}, {"w": "embedding", "b": [0.2188, 0.0852, 0.3029, 0.1]}, {"w": "layers", "b": [0.3077, 0.0852, 0.3528, 0.1]}, {"w": "loading", "b": [0.1521, 0.1012, 0.2089, 0.116]}, {"w": "GloVe", "b": [0.2136, 0.1012, 0.2619, 0.116]}, {"w": "embeddings", "b": [0.2667, 0.1012, 0.3581, 0.116]}, {"w": "in", "b": [0.3628, 0.1012, 0.3776, 0.116]}, {"w": "models", "b": [0.3823, 0.1012, 0.4369, 0.116]}, {"w": "preprocessing", "b": [0.1521, 0.1173, 0.2572, 0.1321]}, {"w": "embeddings", "b": [0.2619, 0.1173, 0.3534, 0.1321]}, {"w": "tokenizing", "b": [0.1521, 0.1333, 0.232, 0.1481]}, {"w": "data", "b": [0.2367, 0.1333, 0.2682, 0.1481]}, {"w": "training", "b": [0.1521, 0.1494, 0.211, 0.1642]}, {"w": "models", "b": [0.2157, 0.1494, 0.2704, 0.1642]}, {"w": "using", "b": [0.1521, 0.1654, 0.1931, 0.1802]}, {"w": "pretrained", "b": [0.1978, 0.1654, 0.2745, 0.1802]}, {"w": "word", "b": [0.2793, 0.1654, 0.3182, 0.1802]}, {"w": "embeddings", "b": [0.3229, 0.1654, 0.4143, 0.1802]}, {"w": "word", "b": [0.1294, 0.1815, 0.1683, 0.1963]}, {"w": "vectors", "b": [0.173, 0.1815, 0.2277, 0.1963]}, {"w": "Word2vec", "b": [0.1294, 0.1975, 0.2067, 0.2123]}, {"w": "algorithm", "b": [0.2114, 0.1975, 0.285, 0.2123]}, {"w": "word-embedding", "b": [0.1294, 0.2135, 0.2587, 0.2283]}, {"w": "space", "b": [0.2634, 0.2135, 0.3054, 0.2283]}, {"w": "word_index", "b": [0.1294, 0.2296, 0.2198, 0.2444]}, {"w": "workflow", "b": [0.1294, 0.2456, 0.203, 0.2604]}, {"w": "of", "b": [0.2077, 0.2456, 0.2235, 0.2604]}, {"w": "machine", "b": [0.2282, 0.2456, 0.2923, 0.2604]}, {"w": "learning,", "b": [0.297, 0.2456, 0.3703, 0.2616]}, {"w": "2nd", "b": [0.3817, 0.2456, 0.4017, 0.2604]}]}, {"id": "b_1", "type": "paragraph", "text": "assembling datasets choosing evaluation protocol choosing measure of success defining problems developing models preparing data regularizing models tuning hyperparameters workflows workstations, setting up Jupyter notebooks running jobs in cloud running Keras", "words": [{"w": "assembling", "b": [0.1521, 0.2617, 0.2373, 0.2765]}, {"w": "datasets", "b": [0.242, 0.2617, 0.3019, 0.2765]}, {"w": "choosing", "b": [0.1521, 0.2777, 0.2204, 0.2925]}, {"w": "evaluation", "b": [0.2252, 0.2777, 0.304, 0.2925]}, {"w": "protocol", "b": [0.3087, 0.2777, 0.3718, 0.2925]}, {"w": "choosing", "b": [0.1521, 0.2938, 0.2204, 0.3086]}, {"w": "measure", "b": [0.2252, 0.2938, 0.2882, 0.3086]}, {"w": "of", "b": [0.2929, 0.2938, 0.3087, 0.3086]}, {"w": "success", "b": [0.3134, 0.2938, 0.3702, 0.3086]}, {"w": "defining", "b": [0.1521, 0.3098, 0.2152, 0.3246]}, {"w": "problems", "b": [0.2199, 0.3098, 0.2903, 0.3246]}, {"w": "developing", "b": [0.1521, 0.3258, 0.2362, 0.3407]}, {"w": "models", "b": [0.2409, 0.3258, 0.2956, 0.3407]}, {"w": "preparing", "b": [0.1521, 0.3419, 0.2246, 0.3567]}, {"w": "data", "b": [0.2293, 0.3419, 0.2609, 0.3567]}, {"w": "regularizing", "b": [0.1521, 0.3579, 0.2435, 0.3727]}, {"w": "models", "b": [0.2483, 0.3579, 0.3029, 0.3727]}, {"w": "tuning", "b": [0.1521, 0.374, 0.2005, 0.3888]}, {"w": "hyperparameters", "b": [0.2052, 0.374, 0.3313, 0.3888]}, {"w": "workflows", "b": [0.1294, 0.39, 0.2103, 0.4048]}, {"w": "workstations,", "b": [0.1294, 0.4061, 0.2308, 0.4209]}, {"w": "setting", "b": [0.2356, 0.4061, 0.286, 0.4209]}, {"w": "up", "b": [0.2908, 0.4061, 0.3097, 0.4209]}, {"w": "Jupyter", "b": [0.1521, 0.4212, 0.2078, 0.436]}, {"w": "notebooks", "b": [0.2125, 0.4212, 0.2903, 0.436]}, {"w": "running", "b": [0.1521, 0.4373, 0.211, 0.4521]}, {"w": "jobs", "b": [0.2157, 0.4373, 0.2472, 0.4521]}, {"w": "in", "b": [0.252, 0.4373, 0.2667, 0.4521]}, {"w": "cloud", "b": [0.2714, 0.4373, 0.3135, 0.4521]}, {"w": "running", "b": [0.1521, 0.4533, 0.211, 0.4681]}, {"w": "Keras", "b": [0.2157, 0.4533, 0.2598, 0.4681]}]}, {"id": "b_2", "type": "paragraph", "text": "selecting GPUs writing callbacks", "words": [{"w": "selecting", "b": [0.1521, 0.4693, 0.2194, 0.4842]}, {"w": "GPUs", "b": [0.2241, 0.4693, 0.2693, 0.4842]}, {"w": "writing", "b": [0.1294, 0.4854, 0.1841, 0.5002]}, {"w": "callbacks", "b": [0.1888, 0.4854, 0.2592, 0.5002]}]}, {"id": "b_4", "type": "paragraph", "text": "Xception, 2nd XGBoost library, 2nd", "words": [{"w": "Xception,", "b": [0.1294, 0.5656, 0.2101, 0.5815]}, {"w": "2nd", "b": [0.2214, 0.5656, 0.2414, 0.5804]}, {"w": "XGBoost", "b": [0.1294, 0.5817, 0.2009, 0.5965]}, {"w": "library,", "b": [0.2056, 0.5817, 0.2674, 0.5976]}, {"w": "2nd", "b": [0.2788, 0.5816, 0.2987, 0.5965]}]}, {"id": "b_6", "type": "paragraph", "text": "yield operator", "words": [{"w": "yield", "b": [0.1294, 0.6628, 0.1673, 0.6776]}, {"w": "operator", "b": [0.172, 0.6628, 0.235, 0.6776]}]}, {"id": "b_8", "type": "equation", "text": "Zisserman, Andrew zoom_range", "words": [{"w": "Zisserman,", "b": [0.1294, 0.743, 0.213, 0.7578]}, {"w": "Andrew", "b": [0.2177, 0.743, 0.2786, 0.7578]}, {"w": "zoom_range", "b": [0.1294, 0.759, 0.2229, 0.7738]}]}]}, {"page": 476, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "List of Figures", "words": [{"w": "List", "b": [0.1294, 0.1076, 0.189, 0.1355]}, {"w": "of", "b": [0.1979, 0.1076, 0.2277, 0.1355]}, {"w": "Figures", "b": [0.2366, 0.1076, 0.3511, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapter 1. What is deep learning?", "words": [{"w": "Chapter", "b": [0.1294, 0.1588, 0.2093, 0.1785]}, {"w": "1.", "b": [0.2156, 0.1588, 0.2345, 0.1785]}, {"w": "What", "b": [0.2408, 0.1588, 0.2954, 0.1785]}, {"w": "is", "b": [0.3018, 0.1588, 0.3186, 0.1785]}, {"w": "deep", "b": [0.3249, 0.1588, 0.3725, 0.1785]}, {"w": "learning?", "b": [0.3788, 0.1588, 0.4727, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 1.1. Artificial intelligence, machine learning, and deep learning", "words": [{"w": "Figure", "b": [0.1483, 0.1971, 0.2142, 0.2168]}, {"w": "1.1.", "b": [0.2205, 0.1971, 0.2583, 0.2168]}, {"w": "Artificial", "b": [0.2646, 0.1971, 0.3571, 0.2168]}, {"w": "intelligence,", "b": [0.3634, 0.1971, 0.4874, 0.2168]}, {"w": "machine", "b": [0.4937, 0.1971, 0.5792, 0.2168]}, {"w": "learning,", "b": [0.5855, 0.1971, 0.6745, 0.2168]}, {"w": "and", "b": [0.6808, 0.1971, 0.7172, 0.2168]}, {"w": "deep", "b": [0.7235, 0.1971, 0.7712, 0.2168]}, {"w": "learning", "b": [0.1483, 0.2176, 0.231, 0.2373]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 1.2. Machine learning: a new programming paradigm", "words": [{"w": "Figure", "b": [0.1483, 0.2452, 0.2142, 0.265]}, {"w": "1.2.", "b": [0.2205, 0.2452, 0.2583, 0.265]}, {"w": "Machine", "b": [0.2646, 0.2452, 0.3529, 0.265]}, {"w": "learning:", "b": [0.3592, 0.2452, 0.4489, 0.265]}, {"w": "a", "b": [0.4552, 0.2452, 0.4664, 0.265]}, {"w": "new", "b": [0.4727, 0.2452, 0.5147, 0.265]}, {"w": "programming", "b": [0.521, 0.2452, 0.6584, 0.265]}, {"w": "paradigm", "b": [0.6647, 0.2452, 0.76, 0.265]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 1.3. Some sample data", "words": [{"w": "Figure", "b": [0.1483, 0.2729, 0.2142, 0.2926]}, {"w": "1.3.", "b": [0.2205, 0.2729, 0.2583, 0.2926]}, {"w": "Some", "b": [0.2646, 0.2729, 0.3221, 0.2926]}, {"w": "sample", "b": [0.3284, 0.2729, 0.3999, 0.2926]}, {"w": "data", "b": [0.4062, 0.2729, 0.4482, 0.2926]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 1.4. Coordinate change", "words": [{"w": "Figure", "b": [0.1483, 0.3005, 0.2142, 0.3202]}, {"w": "1.4.", "b": [0.2205, 0.3005, 0.2583, 0.3202]}, {"w": "Coordinate", "b": [0.2646, 0.3005, 0.3768, 0.3202]}, {"w": "change", "b": [0.3831, 0.3005, 0.4545, 0.3202]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 1.5. A deep neural network for digit classification", "words": [{"w": "Figure", "b": [0.1483, 0.3281, 0.2142, 0.3479]}, {"w": "1.5.", "b": [0.2205, 0.3281, 0.2583, 0.3479]}, {"w": "A", "b": [0.2646, 0.3281, 0.2829, 0.3479]}, {"w": "deep", "b": [0.2892, 0.3281, 0.3368, 0.3479]}, {"w": "neural", "b": [0.3431, 0.3281, 0.4061, 0.3479]}, {"w": "network", "b": [0.4124, 0.3281, 0.4951, 0.3479]}, {"w": "for", "b": [0.5014, 0.3281, 0.5308, 0.3479]}, {"w": "digit", "b": [0.5371, 0.3281, 0.5834, 0.3479]}, {"w": "classification", "b": [0.5897, 0.3281, 0.7228, 0.3479]}]}, {"id": "b_7", "type": "equation", "text": "Figure 1.6. Deep representations learned by a digit-classification model", "words": [{"w": "Figure", "b": [0.1483, 0.3557, 0.2142, 0.3755]}, {"w": "1.6.", "b": [0.2205, 0.3557, 0.2583, 0.3755]}, {"w": "Deep", "b": [0.2646, 0.3557, 0.3179, 0.3755]}, {"w": "representations", "b": [0.3242, 0.3557, 0.4769, 0.3755]}, {"w": "learned", "b": [0.4832, 0.3557, 0.5574, 0.3755]}, {"w": "by", "b": [0.5637, 0.3557, 0.589, 0.3755]}, {"w": "a", "b": [0.5953, 0.3557, 0.6065, 0.3755]}, {"w": "digit-classification", "b": [0.6128, 0.3557, 0.8006, 0.3755]}, {"w": "model", "b": [0.1483, 0.3762, 0.2114, 0.396]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 1.7. A neural network is parameterized by its weights.", "words": [{"w": "Figure", "b": [0.1483, 0.4039, 0.2142, 0.4236]}, {"w": "1.7.", "b": [0.2205, 0.4039, 0.2583, 0.4236]}, {"w": "A", "b": [0.2646, 0.4039, 0.2829, 0.4236]}, {"w": "neural", "b": [0.2892, 0.4039, 0.3522, 0.4236]}, {"w": "network", "b": [0.3585, 0.4039, 0.4412, 0.4236]}, {"w": "is", "b": [0.4475, 0.4039, 0.4643, 0.4236]}, {"w": "parameterized", "b": [0.4706, 0.4039, 0.6135, 0.4236]}, {"w": "by", "b": [0.6198, 0.4039, 0.645, 0.4236]}, {"w": "its", "b": [0.6513, 0.4039, 0.6752, 0.4236]}, {"w": "weights.", "b": [0.6815, 0.4039, 0.7663, 0.4236]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure 1.8. A loss function measures the quality of the network’s output.", "words": [{"w": "Figure", "b": [0.1483, 0.4315, 0.2142, 0.4512]}, {"w": "1.8.", "b": [0.2205, 0.4315, 0.2583, 0.4512]}, {"w": "A", "b": [0.2646, 0.4315, 0.2829, 0.4512]}, {"w": "loss", "b": [0.2892, 0.4315, 0.3284, 0.4512]}, {"w": "function", "b": [0.3347, 0.4315, 0.4188, 0.4512]}, {"w": "measures", "b": [0.4251, 0.4315, 0.519, 0.4512]}, {"w": "the", "b": [0.5253, 0.4315, 0.5561, 0.4512]}, {"w": "quality", "b": [0.5624, 0.4315, 0.6325, 0.4512]}, {"w": "of", "b": [0.6388, 0.4315, 0.6598, 0.4512]}, {"w": "the", "b": [0.6661, 0.4315, 0.6969, 0.4512]}, {"w": "network’s", "b": [0.7032, 0.4315, 0.8027, 0.4512]}, {"w": "output.", "b": [0.1483, 0.452, 0.2191, 0.4717]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 1.9. The loss score is used as a feedback signal to adjust the weights.", "words": [{"w": "Figure", "b": [0.1483, 0.4796, 0.2142, 0.4994]}, {"w": "1.9.", "b": [0.2205, 0.4796, 0.2583, 0.4994]}, {"w": "The", "b": [0.2646, 0.4796, 0.3039, 0.4994]}, {"w": "loss", "b": [0.3102, 0.4796, 0.3494, 0.4994]}, {"w": "score", "b": [0.3557, 0.4796, 0.409, 0.4994]}, {"w": "is", "b": [0.4153, 0.4796, 0.4321, 0.4994]}, {"w": "used", "b": [0.4384, 0.4796, 0.4846, 0.4994]}, {"w": "as", "b": [0.4909, 0.4796, 0.512, 0.4994]}, {"w": "a", "b": [0.5183, 0.4796, 0.5295, 0.4994]}, {"w": "feedback", "b": [0.5358, 0.4796, 0.6268, 0.4994]}, {"w": "signal", "b": [0.6331, 0.4796, 0.6934, 0.4994]}, {"w": "to", "b": [0.6997, 0.4796, 0.7193, 0.4994]}, {"w": "adjust", "b": [0.7256, 0.4796, 0.7859, 0.4994]}, {"w": "the", "b": [0.7922, 0.4796, 0.823, 0.4994]}, {"w": "weights.", "b": [0.1483, 0.5001, 0.2331, 0.5199]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure 1.10. A decision boundary", "words": [{"w": "Figure", "b": [0.1483, 0.5278, 0.2142, 0.5475]}, {"w": "1.10.", "b": [0.2205, 0.5278, 0.271, 0.5475]}, {"w": "A", "b": [0.2773, 0.5278, 0.2955, 0.5475]}, {"w": "decision", "b": [0.3018, 0.5278, 0.3859, 0.5475]}, {"w": "boundary", "b": [0.3922, 0.5278, 0.4874, 0.5475]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure 1.11. A decision tree: the parameters that are learned are the questions about the data. A question could be, for instance, “Is coefficient 2 in the data greater than 3.5?”", "words": [{"w": "Figure", "b": [0.1483, 0.5554, 0.2142, 0.5751]}, {"w": "1.11.", "b": [0.2205, 0.5554, 0.27, 0.5751]}, {"w": "A", "b": [0.2763, 0.5554, 0.2945, 0.5751]}, {"w": "decision", "b": [0.3008, 0.5554, 0.3849, 0.5751]}, {"w": "tree:", "b": [0.3912, 0.5554, 0.436, 0.5751]}, {"w": "the", "b": [0.4424, 0.5554, 0.4732, 0.5751]}, {"w": "parameters", "b": [0.4795, 0.5554, 0.5902, 0.5751]}, {"w": "that", "b": [0.5965, 0.5554, 0.6343, 0.5751]}, {"w": "are", "b": [0.6406, 0.5554, 0.6714, 0.5751]}, {"w": "learned", "b": [0.6777, 0.5554, 0.752, 0.5751]}, {"w": "are", "b": [0.7583, 0.5554, 0.7891, 0.5751]}, {"w": "the", "b": [0.7954, 0.5554, 0.8262, 0.5751]}, {"w": "questions", "b": [0.1483, 0.5759, 0.2436, 0.5956]}, {"w": "about", "b": [0.2499, 0.5759, 0.306, 0.5956]}, {"w": "the", "b": [0.3123, 0.5759, 0.3431, 0.5956]}, {"w": "data.", "b": [0.3494, 0.5759, 0.3978, 0.5956]}, {"w": "A", "b": [0.4041, 0.5759, 0.4223, 0.5956]}, {"w": "question", "b": [0.4286, 0.5759, 0.5141, 0.5956]}, {"w": "could", "b": [0.5204, 0.5759, 0.5764, 0.5956]}, {"w": "be,", "b": [0.5827, 0.5759, 0.6129, 0.5956]}, {"w": "for", "b": [0.6192, 0.5759, 0.6486, 0.5956]}, {"w": "instance,", "b": [0.6549, 0.5759, 0.7439, 0.5956]}, {"w": "“Is", "b": [0.7501, 0.5759, 0.7795, 0.5956]}, {"w": "coefficient", "b": [0.1483, 0.5964, 0.2557, 0.6161]}, {"w": "2", "b": [0.262, 0.5964, 0.2747, 0.6161]}, {"w": "in", "b": [0.281, 0.5964, 0.3006, 0.6161]}, {"w": "the", "b": [0.3069, 0.5964, 0.3377, 0.6161]}, {"w": "data", "b": [0.344, 0.5964, 0.386, 0.6161]}, {"w": "greater", "b": [0.3924, 0.5964, 0.4624, 0.6161]}, {"w": "than", "b": [0.4687, 0.5964, 0.5121, 0.6161]}, {"w": "3.5?”", "b": [0.5184, 0.5964, 0.5724, 0.6161]}]}, {"id": "b_13", "type": "paragraph", "text": "Chapter 2. Before we begin: the mathematical building blocks of neural networks", "words": [{"w": "Chapter", "b": [0.1294, 0.6392, 0.2093, 0.6589]}, {"w": "2.", "b": [0.2156, 0.6392, 0.2345, 0.6589]}, {"w": "Before", "b": [0.2408, 0.6392, 0.3094, 0.6589]}, {"w": "we", "b": [0.3158, 0.6392, 0.3452, 0.6589]}, {"w": "begin:", "b": [0.3515, 0.6392, 0.4145, 0.6589]}, {"w": "the", "b": [0.4208, 0.6392, 0.4517, 0.6589]}, {"w": "mathematical", "b": [0.458, 0.6392, 0.5939, 0.6589]}, {"w": "building", "b": [0.6002, 0.6392, 0.6843, 0.6589]}, {"w": "blocks", "b": [0.6906, 0.6392, 0.7565, 0.6589]}, {"w": "of", "b": [0.7628, 0.6392, 0.7838, 0.6589]}, {"w": "neural", "b": [0.7901, 0.6392, 0.8531, 0.6589]}, {"w": "networks", "b": [0.1294, 0.6597, 0.2219, 0.6794]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure 2.1. MNIST sample digits", "words": [{"w": "Figure", "b": [0.1483, 0.698, 0.2142, 0.7178]}, {"w": "2.1.", "b": [0.2205, 0.698, 0.2583, 0.7178]}, {"w": "MNIST", "b": [0.2646, 0.698, 0.3431, 0.7178]}, {"w": "sample", "b": [0.3494, 0.698, 0.4209, 0.7178]}, {"w": "digits", "b": [0.4272, 0.698, 0.4833, 0.7178]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure 2.2. The fourth sample in our dataset", "words": [{"w": "Figure", "b": [0.1483, 0.7256, 0.2142, 0.7454]}, {"w": "2.2.", "b": [0.2205, 0.7256, 0.2583, 0.7454]}, {"w": "The", "b": [0.2646, 0.7256, 0.3039, 0.7454]}, {"w": "fourth", "b": [0.3102, 0.7256, 0.3718, 0.7454]}, {"w": "sample", "b": [0.3781, 0.7256, 0.4496, 0.7454]}, {"w": "in", "b": [0.4559, 0.7256, 0.4755, 0.7454]}, {"w": "our", "b": [0.4818, 0.7256, 0.5155, 0.7454]}, {"w": "dataset", "b": [0.5218, 0.7256, 0.5918, 0.7454]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure 2.3. A 3D timeseries data tensor", "words": [{"w": "Figure", "b": [0.1483, 0.7533, 0.2142, 0.773]}, {"w": "2.3.", "b": [0.2205, 0.7533, 0.2583, 0.773]}, {"w": "A", "b": [0.2646, 0.7533, 0.2829, 0.773]}, {"w": "3D", "b": [0.2892, 0.7533, 0.32, 0.773]}, {"w": "timeseries", "b": [0.3263, 0.7533, 0.4286, 0.773]}, {"w": "data", "b": [0.4349, 0.7533, 0.4769, 0.773]}, {"w": "tensor", "b": [0.4832, 0.7533, 0.5449, 0.773]}]}, {"id": "b_17", "type": "equation", "text": "Figure 2.4. A 4D image data tensor (channels-first convention)", "words": [{"w": "Figure", "b": [0.1483, 0.7809, 0.2142, 0.8006]}, {"w": "2.4.", "b": [0.2205, 0.7809, 0.2583, 0.8006]}, {"w": "A", "b": [0.2646, 0.7809, 0.2829, 0.8006]}, {"w": "4D", "b": [0.2892, 0.7809, 0.32, 0.8006]}, {"w": "image", "b": [0.3263, 0.7809, 0.388, 0.8006]}, {"w": "data", "b": [0.3943, 0.7809, 0.4363, 0.8006]}, {"w": "tensor", "b": [0.4426, 0.7809, 0.5042, 0.8006]}, {"w": "(channels-first", "b": [0.5105, 0.7809, 0.6563, 0.8006]}, {"w": "convention)", "b": [0.6626, 0.7809, 0.7831, 0.8006]}]}, {"id": "b_18", "type": "equation", "text": "Figure 2.5. Matrix dot-product box diagram", "words": [{"w": "Figure", "b": [0.1483, 0.8085, 0.2142, 0.8283]}, {"w": "2.5.", "b": [0.2205, 0.8085, 0.2583, 0.8283]}, {"w": "Matrix", "b": [0.2646, 0.8085, 0.3333, 0.8283]}, {"w": "dot-product", "b": [0.3396, 0.8085, 0.4573, 0.8283]}, {"w": "box", "b": [0.4636, 0.8085, 0.5015, 0.8283]}, {"w": "diagram", "b": [0.5078, 0.8085, 0.5904, 0.8283]}]}, {"id": "b_19", "type": "paragraph", "text": "Figure 2.6. A point in a 2D space", "words": [{"w": "Figure", "b": [0.1483, 0.8362, 0.2142, 0.8559]}, {"w": "2.6.", "b": [0.2205, 0.8362, 0.2583, 0.8559]}, {"w": "A", "b": [0.2646, 0.8362, 0.2829, 0.8559]}, {"w": "point", "b": [0.2892, 0.8362, 0.341, 0.8559]}, {"w": "in", "b": [0.3473, 0.8362, 0.367, 0.8559]}, {"w": "a", "b": [0.3733, 0.8362, 0.3845, 0.8559]}, {"w": "2D", "b": [0.3908, 0.8362, 0.4216, 0.8559]}, {"w": "space", "b": [0.4279, 0.8362, 0.4839, 0.8559]}]}, {"id": "b_20", "type": "paragraph", "text": "Figure 2.7. A point in a 2D space pictured as an arrow", "words": [{"w": "Figure", "b": [0.1483, 0.8638, 0.2142, 0.8835]}, {"w": "2.7.", "b": [0.2205, 0.8638, 0.2583, 0.8835]}, {"w": "A", "b": [0.2646, 0.8638, 0.2829, 0.8835]}, {"w": "point", "b": [0.2892, 0.8638, 0.341, 0.8835]}, {"w": "in", "b": [0.3473, 0.8638, 0.367, 0.8835]}, {"w": "a", "b": [0.3733, 0.8638, 0.3845, 0.8835]}, {"w": "2D", "b": [0.3908, 0.8638, 0.4216, 0.8835]}, {"w": "space", "b": [0.4279, 0.8638, 0.4839, 0.8835]}, {"w": "pictured", "b": [0.4902, 0.8638, 0.5729, 0.8835]}, {"w": "as", "b": [0.5792, 0.8638, 0.6002, 0.8835]}, {"w": "an", "b": [0.6065, 0.8638, 0.6303, 0.8835]}, {"w": "arrow", "b": [0.6367, 0.8638, 0.6955, 0.8835]}]}, {"id": "b_21", "type": "paragraph", "text": "Figure 2.8. Geometric interpretation of the sum of two vectors", "words": [{"w": "Figure", "b": [0.1483, 0.8914, 0.2142, 0.9112]}, {"w": "2.8.", "b": [0.2205, 0.8914, 0.2583, 0.9112]}, {"w": "Geometric", "b": [0.2646, 0.8914, 0.3711, 0.9112]}, {"w": "interpretation", "b": [0.3774, 0.8914, 0.5133, 0.9112]}, {"w": "of", "b": [0.5197, 0.8914, 0.5407, 0.9112]}, {"w": "the", "b": [0.547, 0.8914, 0.5778, 0.9112]}, {"w": "sum", "b": [0.5841, 0.8914, 0.6262, 0.9112]}, {"w": "of", "b": [0.6325, 0.8914, 0.6535, 0.9112]}, {"w": "two", "b": [0.6598, 0.8914, 0.6976, 0.9112]}, {"w": "vectors", "b": [0.7039, 0.8914, 0.7768, 0.9112]}]}]}, {"page": 477, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 2.9. Uncrumpling a complicated manifold of data", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "2.9.", "b": [0.2205, 0.0857, 0.2583, 0.1054]}, {"w": "Uncrumpling", "b": [0.2646, 0.0857, 0.3992, 0.1054]}, {"w": "a", "b": [0.4055, 0.0857, 0.4167, 0.1054]}, {"w": "complicated", "b": [0.423, 0.0857, 0.5463, 0.1054]}, {"w": "manifold", "b": [0.5526, 0.0857, 0.6437, 0.1054]}, {"w": "of", "b": [0.65, 0.0857, 0.671, 0.1054]}, {"w": "data", "b": [0.6773, 0.0857, 0.7193, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 2.10. Derivative of f in p", "words": [{"w": "Figure", "b": [0.1483, 0.1133, 0.2142, 0.133]}, {"w": "2.10.", "b": [0.2205, 0.1133, 0.271, 0.133]}, {"w": "Derivative", "b": [0.2773, 0.1133, 0.3837, 0.133]}, {"w": "of", "b": [0.39, 0.1133, 0.4111, 0.133]}, {"w": "f", "b": [0.4174, 0.1133, 0.4258, 0.133]}, {"w": "in", "b": [0.4321, 0.1133, 0.4517, 0.133]}, {"w": "p", "b": [0.458, 0.1133, 0.4706, 0.133]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 2.11. SGD down a 1D loss curve (one learnable parameter)", "words": [{"w": "Figure", "b": [0.1483, 0.1409, 0.2142, 0.1607]}, {"w": "2.11.", "b": [0.2205, 0.1409, 0.27, 0.1607]}, {"w": "SGD", "b": [0.2763, 0.1409, 0.3268, 0.1607]}, {"w": "down", "b": [0.3331, 0.1409, 0.3891, 0.1607]}, {"w": "a", "b": [0.3954, 0.1409, 0.4066, 0.1607]}, {"w": "1D", "b": [0.4129, 0.1409, 0.4438, 0.1607]}, {"w": "loss", "b": [0.4501, 0.1409, 0.4893, 0.1607]}, {"w": "curve", "b": [0.4956, 0.1409, 0.5517, 0.1607]}, {"w": "(one", "b": [0.558, 0.1409, 0.6028, 0.1607]}, {"w": "learnable", "b": [0.6091, 0.1409, 0.7016, 0.1607]}, {"w": "parameter)", "b": [0.7079, 0.1409, 0.8171, 0.1607]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 2.12. Gradient descent down a 2D loss surface (two learnable parameters)", "words": [{"w": "Figure", "b": [0.1483, 0.1686, 0.2142, 0.1883]}, {"w": "2.12.", "b": [0.2205, 0.1686, 0.271, 0.1883]}, {"w": "Gradient", "b": [0.2773, 0.1686, 0.3655, 0.1883]}, {"w": "descent", "b": [0.3718, 0.1686, 0.4475, 0.1883]}, {"w": "down", "b": [0.4538, 0.1686, 0.5098, 0.1883]}, {"w": "a", "b": [0.5161, 0.1686, 0.5273, 0.1883]}, {"w": "2D", "b": [0.5337, 0.1686, 0.5645, 0.1883]}, {"w": "loss", "b": [0.5708, 0.1686, 0.61, 0.1883]}, {"w": "surface", "b": [0.6163, 0.1686, 0.6892, 0.1883]}, {"w": "(two", "b": [0.6955, 0.1686, 0.7417, 0.1883]}, {"w": "learnable", "b": [0.748, 0.1686, 0.8405, 0.1883]}, {"w": "parameters)", "b": [0.1483, 0.1891, 0.2674, 0.2088]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 2.13. A local minimum and a global minimum", "words": [{"w": "Figure", "b": [0.1483, 0.2167, 0.2142, 0.2364]}, {"w": "2.13.", "b": [0.2205, 0.2167, 0.271, 0.2364]}, {"w": "A", "b": [0.2773, 0.2167, 0.2955, 0.2364]}, {"w": "local", "b": [0.3018, 0.2167, 0.3508, 0.2364]}, {"w": "minimum", "b": [0.3571, 0.2167, 0.4553, 0.2364]}, {"w": "and", "b": [0.4616, 0.2167, 0.498, 0.2364]}, {"w": "a", "b": [0.5043, 0.2167, 0.5155, 0.2364]}, {"w": "global", "b": [0.5218, 0.2167, 0.5849, 0.2364]}, {"w": "minimum", "b": [0.5912, 0.2167, 0.6893, 0.2364]}]}, {"id": "b_6", "type": "paragraph", "text": "Chapter 3. Getting started with neural networks", "words": [{"w": "Chapter", "b": [0.1294, 0.2595, 0.2093, 0.2792]}, {"w": "3.", "b": [0.2156, 0.2595, 0.2345, 0.2792]}, {"w": "Getting", "b": [0.2408, 0.2595, 0.3165, 0.2792]}, {"w": "started", "b": [0.3228, 0.2595, 0.39, 0.2792]}, {"w": "with", "b": [0.3964, 0.2595, 0.4412, 0.2792]}, {"w": "neural", "b": [0.4475, 0.2595, 0.5105, 0.2792]}, {"w": "networks", "b": [0.5169, 0.2595, 0.6093, 0.2792]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 3.1. Relationship between the network, layers, loss function, and optimizer", "words": [{"w": "Figure", "b": [0.1483, 0.2978, 0.2142, 0.3176]}, {"w": "3.1.", "b": [0.2205, 0.2978, 0.2583, 0.3176]}, {"w": "Relationship", "b": [0.2646, 0.2978, 0.3922, 0.3176]}, {"w": "between", "b": [0.3985, 0.2978, 0.4825, 0.3176]}, {"w": "the", "b": [0.4889, 0.2978, 0.5197, 0.3176]}, {"w": "network,", "b": [0.526, 0.2978, 0.615, 0.3176]}, {"w": "layers,", "b": [0.6213, 0.2978, 0.6878, 0.3176]}, {"w": "loss", "b": [0.6941, 0.2978, 0.7334, 0.3176]}, {"w": "function,", "b": [0.7397, 0.2978, 0.8301, 0.3176]}, {"w": "and", "b": [0.1483, 0.3183, 0.1848, 0.3381]}, {"w": "optimizer", "b": [0.1911, 0.3183, 0.2878, 0.3381]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 3.2. Google web search interest for different deep-learning frameworks over time", "words": [{"w": "Figure", "b": [0.1483, 0.3459, 0.2142, 0.3657]}, {"w": "3.2.", "b": [0.2205, 0.3459, 0.2583, 0.3657]}, {"w": "Google", "b": [0.2646, 0.3459, 0.3389, 0.3657]}, {"w": "web", "b": [0.3452, 0.3459, 0.3872, 0.3657]}, {"w": "search", "b": [0.3936, 0.3459, 0.458, 0.3657]}, {"w": "interest", "b": [0.4643, 0.3459, 0.5385, 0.3657]}, {"w": "for", "b": [0.5449, 0.3459, 0.5743, 0.3657]}, {"w": "different", "b": [0.5806, 0.3459, 0.6669, 0.3657]}, {"w": "deep-learning", "b": [0.6732, 0.3459, 0.8119, 0.3657]}, {"w": "frameworks", "b": [0.1483, 0.3664, 0.2688, 0.3862]}, {"w": "over", "b": [0.2751, 0.3664, 0.3199, 0.3862]}, {"w": "time", "b": [0.3262, 0.3664, 0.3711, 0.3862]}]}, {"id": "b_9", "type": "equation", "text": "Figure 3.3. The deep-learning software and hardware stack", "words": [{"w": "Figure", "b": [0.1483, 0.3941, 0.2142, 0.4138]}, {"w": "3.3.", "b": [0.2205, 0.3941, 0.2583, 0.4138]}, {"w": "The", "b": [0.2646, 0.3941, 0.3039, 0.4138]}, {"w": "deep-learning", "b": [0.3102, 0.3941, 0.4489, 0.4138]}, {"w": "software", "b": [0.4552, 0.3941, 0.542, 0.4138]}, {"w": "and", "b": [0.5483, 0.3941, 0.5848, 0.4138]}, {"w": "hardware", "b": [0.5911, 0.3941, 0.6849, 0.4138]}, {"w": "stack", "b": [0.6912, 0.3941, 0.7431, 0.4138]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 3.4. The rectified linear unit function", "words": [{"w": "Figure", "b": [0.1483, 0.4217, 0.2142, 0.4414]}, {"w": "3.4.", "b": [0.2205, 0.4217, 0.2583, 0.4414]}, {"w": "The", "b": [0.2646, 0.4217, 0.3039, 0.4414]}, {"w": "rectified", "b": [0.3102, 0.4217, 0.3942, 0.4414]}, {"w": "linear", "b": [0.4005, 0.4217, 0.458, 0.4414]}, {"w": "unit", "b": [0.4643, 0.4217, 0.5035, 0.4414]}, {"w": "function", "b": [0.5098, 0.4217, 0.5939, 0.4414]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure 3.5. The sigmoid function", "words": [{"w": "Figure", "b": [0.1483, 0.4493, 0.2142, 0.4691]}, {"w": "3.5.", "b": [0.2205, 0.4493, 0.2583, 0.4691]}, {"w": "The", "b": [0.2646, 0.4493, 0.3039, 0.4691]}, {"w": "sigmoid", "b": [0.3102, 0.4493, 0.3915, 0.4691]}, {"w": "function", "b": [0.3978, 0.4493, 0.4819, 0.4691]}]}, {"id": "b_12", "type": "equation", "text": "Figure 3.6. The three-layer network", "words": [{"w": "Figure", "b": [0.1483, 0.477, 0.2142, 0.4967]}, {"w": "3.6.", "b": [0.2205, 0.477, 0.2583, 0.4967]}, {"w": "The", "b": [0.2646, 0.477, 0.3039, 0.4967]}, {"w": "three-layer", "b": [0.3102, 0.477, 0.4194, 0.4967]}, {"w": "network", "b": [0.4257, 0.477, 0.5084, 0.4967]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure 3.7. Training and validation loss", "words": [{"w": "Figure", "b": [0.1483, 0.5046, 0.2142, 0.5243]}, {"w": "3.7.", "b": [0.2205, 0.5046, 0.2583, 0.5243]}, {"w": "Training", "b": [0.2646, 0.5046, 0.3506, 0.5243]}, {"w": "and", "b": [0.3569, 0.5046, 0.3934, 0.5243]}, {"w": "validation", "b": [0.3997, 0.5046, 0.5006, 0.5243]}, {"w": "loss", "b": [0.5069, 0.5046, 0.5461, 0.5243]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure 3.8. Training and validation accuracy", "words": [{"w": "Figure", "b": [0.1483, 0.5322, 0.2142, 0.552]}, {"w": "3.8.", "b": [0.2205, 0.5322, 0.2583, 0.552]}, {"w": "Training", "b": [0.2646, 0.5322, 0.3506, 0.552]}, {"w": "and", "b": [0.3569, 0.5322, 0.3934, 0.552]}, {"w": "validation", "b": [0.3997, 0.5322, 0.5006, 0.552]}, {"w": "accuracy", "b": [0.5069, 0.5322, 0.5965, 0.552]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure 3.9. Training and validation loss", "words": [{"w": "Figure", "b": [0.1483, 0.5599, 0.2142, 0.5796]}, {"w": "3.9.", "b": [0.2205, 0.5599, 0.2583, 0.5796]}, {"w": "Training", "b": [0.2646, 0.5599, 0.3506, 0.5796]}, {"w": "and", "b": [0.3569, 0.5599, 0.3934, 0.5796]}, {"w": "validation", "b": [0.3997, 0.5599, 0.5006, 0.5796]}, {"w": "loss", "b": [0.5069, 0.5599, 0.5461, 0.5796]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure 3.10. Training and validation accuracy", "words": [{"w": "Figure", "b": [0.1483, 0.5875, 0.2142, 0.6072]}, {"w": "3.10.", "b": [0.2205, 0.5875, 0.271, 0.6072]}, {"w": "Training", "b": [0.2773, 0.5875, 0.3632, 0.6072]}, {"w": "and", "b": [0.3695, 0.5875, 0.406, 0.6072]}, {"w": "validation", "b": [0.4123, 0.5875, 0.5132, 0.6072]}, {"w": "accuracy", "b": [0.5195, 0.5875, 0.6091, 0.6072]}]}, {"id": "b_17", "type": "equation", "text": "Figure 3.11. 3-fold cross-validation", "words": [{"w": "Figure", "b": [0.1483, 0.6151, 0.2142, 0.6349]}, {"w": "3.11.", "b": [0.2205, 0.6151, 0.27, 0.6349]}, {"w": "3-fold", "b": [0.2763, 0.6151, 0.338, 0.6349]}, {"w": "cross-validation", "b": [0.3443, 0.6151, 0.5054, 0.6349]}]}, {"id": "b_18", "type": "paragraph", "text": "Figure 3.12. Validation MAE by epoch", "words": [{"w": "Figure", "b": [0.1483, 0.6427, 0.2142, 0.6625]}, {"w": "3.12.", "b": [0.2205, 0.6427, 0.271, 0.6625]}, {"w": "Validation", "b": [0.2773, 0.6427, 0.381, 0.6625]}, {"w": "MAE", "b": [0.3873, 0.6427, 0.4433, 0.6625]}, {"w": "by", "b": [0.4496, 0.6427, 0.4749, 0.6625]}, {"w": "epoch", "b": [0.4812, 0.6427, 0.5414, 0.6625]}]}, {"id": "b_19", "type": "paragraph", "text": "Figure 3.13. Validation MAE by epoch, excluding the first 10 data points", "words": [{"w": "Figure", "b": [0.1483, 0.6704, 0.2142, 0.6901]}, {"w": "3.13.", "b": [0.2205, 0.6704, 0.271, 0.6901]}, {"w": "Validation", "b": [0.2773, 0.6704, 0.381, 0.6901]}, {"w": "MAE", "b": [0.3873, 0.6704, 0.4433, 0.6901]}, {"w": "by", "b": [0.4496, 0.6704, 0.4749, 0.6901]}, {"w": "epoch,", "b": [0.4812, 0.6704, 0.5477, 0.6901]}, {"w": "excluding", "b": [0.554, 0.6704, 0.6535, 0.6901]}, {"w": "the", "b": [0.6598, 0.6704, 0.6906, 0.6901]}, {"w": "first", "b": [0.6969, 0.6704, 0.7376, 0.6901]}, {"w": "10", "b": [0.7439, 0.6704, 0.7691, 0.6901]}, {"w": "data", "b": [0.7754, 0.6704, 0.8174, 0.6901]}, {"w": "points", "b": [0.1483, 0.6909, 0.21, 0.7106]}]}, {"id": "b_20", "type": "paragraph", "text": "Chapter 4. Fundamentals of machine learning", "words": [{"w": "Chapter", "b": [0.1294, 0.7337, 0.2093, 0.7534]}, {"w": "4.", "b": [0.2156, 0.7337, 0.2345, 0.7534]}, {"w": "Fundamentals", "b": [0.2408, 0.7337, 0.3824, 0.7534]}, {"w": "of", "b": [0.3887, 0.7337, 0.4097, 0.7534]}, {"w": "machine", "b": [0.416, 0.7337, 0.5014, 0.7534]}, {"w": "learning", "b": [0.5077, 0.7337, 0.5904, 0.7534]}]}, {"id": "b_21", "type": "equation", "text": "Figure 4.1. Simple hold-out validation split", "words": [{"w": "Figure", "b": [0.1483, 0.772, 0.2142, 0.7917]}, {"w": "4.1.", "b": [0.2205, 0.772, 0.2583, 0.7917]}, {"w": "Simple", "b": [0.2646, 0.772, 0.3361, 0.7917]}, {"w": "hold-out", "b": [0.3424, 0.772, 0.4279, 0.7917]}, {"w": "validation", "b": [0.4342, 0.772, 0.5351, 0.7917]}, {"w": "split", "b": [0.5414, 0.772, 0.5849, 0.7917]}]}, {"id": "b_22", "type": "equation", "text": "Figure 4.2. Three-fold validation", "words": [{"w": "Figure", "b": [0.1483, 0.7996, 0.2142, 0.8194]}, {"w": "4.2.", "b": [0.2205, 0.7996, 0.2583, 0.8194]}, {"w": "Three-fold", "b": [0.2646, 0.7996, 0.3725, 0.8194]}, {"w": "validation", "b": [0.3788, 0.7996, 0.4797, 0.8194]}]}, {"id": "b_23", "type": "paragraph", "text": "Figure 4.3. Feature engineering for reading the time on a clock", "words": [{"w": "Figure", "b": [0.1483, 0.8273, 0.2142, 0.847]}, {"w": "4.3.", "b": [0.2205, 0.8273, 0.2583, 0.847]}, {"w": "Feature", "b": [0.2646, 0.8273, 0.3403, 0.847]}, {"w": "engineering", "b": [0.3466, 0.8273, 0.4657, 0.847]}, {"w": "for", "b": [0.472, 0.8273, 0.5014, 0.847]}, {"w": "reading", "b": [0.5077, 0.8273, 0.5834, 0.847]}, {"w": "the", "b": [0.5897, 0.8273, 0.6205, 0.847]}, {"w": "time", "b": [0.6268, 0.8273, 0.6717, 0.847]}, {"w": "on", "b": [0.678, 0.8273, 0.7032, 0.847]}, {"w": "a", "b": [0.7095, 0.8273, 0.7207, 0.847]}, {"w": "clock", "b": [0.727, 0.8273, 0.7816, 0.847]}]}, {"id": "b_24", "type": "paragraph", "text": "Figure 4.4. Effect of model capacity on validation loss: trying a smaller model", "words": [{"w": "Figure", "b": [0.1483, 0.8549, 0.2142, 0.8746]}, {"w": "4.4.", "b": [0.2205, 0.8549, 0.2583, 0.8746]}, {"w": "Effect", "b": [0.2646, 0.8549, 0.3258, 0.8746]}, {"w": "of", "b": [0.3321, 0.8549, 0.3531, 0.8746]}, {"w": "model", "b": [0.3594, 0.8549, 0.4225, 0.8746]}, {"w": "capacity", "b": [0.4288, 0.8549, 0.5129, 0.8746]}, {"w": "on", "b": [0.5192, 0.8549, 0.5444, 0.8746]}, {"w": "validation", "b": [0.5507, 0.8549, 0.6516, 0.8746]}, {"w": "loss:", "b": [0.6579, 0.8549, 0.7042, 0.8746]}, {"w": "trying", "b": [0.7105, 0.8549, 0.7707, 0.8746]}, {"w": "a", "b": [0.777, 0.8549, 0.7882, 0.8746]}, {"w": "smaller", "b": [0.1483, 0.8754, 0.2226, 0.8951]}, {"w": "model", "b": [0.2289, 0.8754, 0.292, 0.8951]}]}]}, {"page": 478, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 4.5. Effect of model capacity on validation loss: trying a bigger model", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "4.5.", "b": [0.2205, 0.0857, 0.2583, 0.1054]}, {"w": "Effect", "b": [0.2646, 0.0857, 0.3258, 0.1054]}, {"w": "of", "b": [0.3321, 0.0857, 0.3531, 0.1054]}, {"w": "model", "b": [0.3594, 0.0857, 0.4225, 0.1054]}, {"w": "capacity", "b": [0.4288, 0.0857, 0.5129, 0.1054]}, {"w": "on", "b": [0.5192, 0.0857, 0.5444, 0.1054]}, {"w": "validation", "b": [0.5507, 0.0857, 0.6516, 0.1054]}, {"w": "loss:", "b": [0.6579, 0.0857, 0.7042, 0.1054]}, {"w": "trying", "b": [0.7105, 0.0857, 0.7707, 0.1054]}, {"w": "a", "b": [0.777, 0.0857, 0.7882, 0.1054]}, {"w": "bigger", "b": [0.1483, 0.1062, 0.2128, 0.1259]}, {"w": "model", "b": [0.2191, 0.1062, 0.2822, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 4.6. Effect of model capacity on training loss: trying a bigger model", "words": [{"w": "Figure", "b": [0.1483, 0.1338, 0.2142, 0.1535]}, {"w": "4.6.", "b": [0.2205, 0.1338, 0.2583, 0.1535]}, {"w": "Effect", "b": [0.2646, 0.1338, 0.3258, 0.1535]}, {"w": "of", "b": [0.3321, 0.1338, 0.3531, 0.1535]}, {"w": "model", "b": [0.3594, 0.1338, 0.4225, 0.1535]}, {"w": "capacity", "b": [0.4288, 0.1338, 0.5129, 0.1535]}, {"w": "on", "b": [0.5192, 0.1338, 0.5444, 0.1535]}, {"w": "training", "b": [0.5507, 0.1338, 0.6292, 0.1535]}, {"w": "loss:", "b": [0.6355, 0.1338, 0.6817, 0.1535]}, {"w": "trying", "b": [0.6881, 0.1338, 0.7483, 0.1535]}, {"w": "a", "b": [0.7546, 0.1338, 0.7658, 0.1535]}, {"w": "bigger", "b": [0.7721, 0.1338, 0.8366, 0.1535]}, {"w": "model", "b": [0.1483, 0.1543, 0.2114, 0.174]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 4.7. Effect of L2 weight regularization on validation loss", "words": [{"w": "Figure", "b": [0.1483, 0.1819, 0.2142, 0.2017]}, {"w": "4.7.", "b": [0.2205, 0.1819, 0.2583, 0.2017]}, {"w": "Effect", "b": [0.2646, 0.1819, 0.3258, 0.2017]}, {"w": "of", "b": [0.3321, 0.1819, 0.3531, 0.2017]}, {"w": "L2", "b": [0.3594, 0.1819, 0.3875, 0.2017]}, {"w": "weight", "b": [0.3938, 0.1819, 0.4624, 0.2017]}, {"w": "regularization", "b": [0.4687, 0.1819, 0.6088, 0.2017]}, {"w": "on", "b": [0.6151, 0.1819, 0.6404, 0.2017]}, {"w": "validation", "b": [0.6467, 0.1819, 0.7476, 0.2017]}, {"w": "loss", "b": [0.7539, 0.1819, 0.7931, 0.2017]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 4.8. Dropout applied to an activation matrix at training time, with rescaling happening during training. At test time, the activation matrix is unchanged.", "words": [{"w": "Figure", "b": [0.1483, 0.2096, 0.2142, 0.2293]}, {"w": "4.8.", "b": [0.2205, 0.2096, 0.2583, 0.2293]}, {"w": "Dropout", "b": [0.2646, 0.2096, 0.3487, 0.2293]}, {"w": "applied", "b": [0.355, 0.2096, 0.4293, 0.2293]}, {"w": "to", "b": [0.4356, 0.2096, 0.4552, 0.2293]}, {"w": "an", "b": [0.4615, 0.2096, 0.4853, 0.2293]}, {"w": "activation", "b": [0.4917, 0.2096, 0.5911, 0.2293]}, {"w": "matrix", "b": [0.5975, 0.2096, 0.6633, 0.2293]}, {"w": "at", "b": [0.6696, 0.2096, 0.6878, 0.2293]}, {"w": "training", "b": [0.6941, 0.2096, 0.7726, 0.2293]}, {"w": "time,", "b": [0.7789, 0.2096, 0.8301, 0.2293]}, {"w": "with", "b": [0.1483, 0.2301, 0.1932, 0.2498]}, {"w": "rescaling", "b": [0.1995, 0.2301, 0.2906, 0.2498]}, {"w": "happening", "b": [0.2969, 0.2301, 0.402, 0.2498]}, {"w": "during", "b": [0.4083, 0.2301, 0.4741, 0.2498]}, {"w": "training.", "b": [0.4804, 0.2301, 0.5652, 0.2498]}, {"w": "At", "b": [0.5715, 0.2301, 0.5967, 0.2498]}, {"w": "test", "b": [0.6031, 0.2301, 0.6381, 0.2498]}, {"w": "time,", "b": [0.6444, 0.2301, 0.6956, 0.2498]}, {"w": "the", "b": [0.7018, 0.2301, 0.7326, 0.2498]}, {"w": "activation", "b": [0.7389, 0.2301, 0.8384, 0.2498]}, {"w": "matrix", "b": [0.1483, 0.2506, 0.2142, 0.2703]}, {"w": "is", "b": [0.2205, 0.2506, 0.2373, 0.2703]}, {"w": "unchanged.", "b": [0.2436, 0.2506, 0.3592, 0.2703]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 4.9. Effect of dropout on validation loss", "words": [{"w": "Figure", "b": [0.1483, 0.2782, 0.2142, 0.2979]}, {"w": "4.9.", "b": [0.2205, 0.2782, 0.2583, 0.2979]}, {"w": "Effect", "b": [0.2646, 0.2782, 0.3258, 0.2979]}, {"w": "of", "b": [0.3321, 0.2782, 0.3531, 0.2979]}, {"w": "dropout", "b": [0.3594, 0.2782, 0.4379, 0.2979]}, {"w": "on", "b": [0.4442, 0.2782, 0.4694, 0.2979]}, {"w": "validation", "b": [0.4758, 0.2782, 0.5767, 0.2979]}, {"w": "loss", "b": [0.583, 0.2782, 0.6222, 0.2979]}]}, {"id": "b_5", "type": "paragraph", "text": "Chapter 5. Deep learning for computer vision", "words": [{"w": "Chapter", "b": [0.1294, 0.321, 0.2093, 0.3407]}, {"w": "5.", "b": [0.2156, 0.321, 0.2345, 0.3407]}, {"w": "Deep", "b": [0.2408, 0.321, 0.294, 0.3407]}, {"w": "learning", "b": [0.3003, 0.321, 0.383, 0.3407]}, {"w": "for", "b": [0.3893, 0.321, 0.4187, 0.3407]}, {"w": "computer", "b": [0.425, 0.321, 0.5203, 0.3407]}, {"w": "vision", "b": [0.5266, 0.321, 0.5883, 0.3407]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 5.1. Images can be broken into local patterns such as edges, textures, and so on.", "words": [{"w": "Figure", "b": [0.1483, 0.3593, 0.2142, 0.3791]}, {"w": "5.1.", "b": [0.2205, 0.3593, 0.2583, 0.3791]}, {"w": "Images", "b": [0.2646, 0.3593, 0.3375, 0.3791]}, {"w": "can", "b": [0.3438, 0.3593, 0.3788, 0.3791]}, {"w": "be", "b": [0.3851, 0.3593, 0.4089, 0.3791]}, {"w": "broken", "b": [0.4152, 0.3593, 0.4853, 0.3791]}, {"w": "into", "b": [0.4916, 0.3593, 0.5309, 0.3791]}, {"w": "local", "b": [0.5372, 0.3593, 0.5862, 0.3791]}, {"w": "patterns", "b": [0.5925, 0.3593, 0.6724, 0.3791]}, {"w": "such", "b": [0.6787, 0.3593, 0.7249, 0.3791]}, {"w": "as", "b": [0.7312, 0.3593, 0.7522, 0.3791]}, {"w": "edges,", "b": [0.7585, 0.3593, 0.8223, 0.3791]}, {"w": "textures,", "b": [0.1483, 0.3798, 0.2345, 0.3996]}, {"w": "and", "b": [0.2408, 0.3798, 0.2772, 0.3996]}, {"w": "so", "b": [0.2835, 0.3798, 0.306, 0.3996]}, {"w": "on.", "b": [0.3123, 0.3798, 0.3438, 0.3996]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 5.2. The visual world forms a spatial hierarchy of visual modules: hyperlocal edges combine into local objects such as eyes or ears, which combine into high-level concepts such as “cat.”", "words": [{"w": "Figure", "b": [0.1483, 0.4074, 0.2142, 0.4272]}, {"w": "5.2.", "b": [0.2205, 0.4074, 0.2583, 0.4272]}, {"w": "The", "b": [0.2646, 0.4074, 0.3039, 0.4272]}, {"w": "visual", "b": [0.3102, 0.4074, 0.3704, 0.4272]}, {"w": "world", "b": [0.3768, 0.4074, 0.4356, 0.4272]}, {"w": "forms", "b": [0.4419, 0.4074, 0.5008, 0.4272]}, {"w": "a", "b": [0.5071, 0.4074, 0.5183, 0.4272]}, {"w": "spatial", "b": [0.5246, 0.4074, 0.5904, 0.4272]}, {"w": "hierarchy", "b": [0.5967, 0.4074, 0.692, 0.4272]}, {"w": "of", "b": [0.6983, 0.4074, 0.7193, 0.4272]}, {"w": "visual", "b": [0.7256, 0.4074, 0.7859, 0.4272]}, {"w": "modules:", "b": [0.1483, 0.4279, 0.2408, 0.4477]}, {"w": "hyperlocal", "b": [0.2471, 0.4279, 0.3536, 0.4477]}, {"w": "edges", "b": [0.3599, 0.4279, 0.4174, 0.4477]}, {"w": "combine", "b": [0.4237, 0.4279, 0.5105, 0.4477]}, {"w": "into", "b": [0.5169, 0.4279, 0.5561, 0.4477]}, {"w": "local", "b": [0.5624, 0.4279, 0.6115, 0.4477]}, {"w": "objects", "b": [0.6178, 0.4279, 0.6892, 0.4477]}, {"w": "such", "b": [0.6955, 0.4279, 0.7418, 0.4477]}, {"w": "as", "b": [0.748, 0.4279, 0.769, 0.4477]}, {"w": "eyes", "b": [0.7753, 0.4279, 0.8201, 0.4477]}, {"w": "or", "b": [0.1483, 0.4484, 0.1693, 0.4682]}, {"w": "ears,", "b": [0.1757, 0.4484, 0.2226, 0.4682]}, {"w": "which", "b": [0.2289, 0.4484, 0.2905, 0.4682]}, {"w": "combine", "b": [0.2968, 0.4484, 0.3837, 0.4682]}, {"w": "into", "b": [0.39, 0.4484, 0.4293, 0.4682]}, {"w": "high-level", "b": [0.4356, 0.4484, 0.5379, 0.4682]}, {"w": "concepts", "b": [0.5442, 0.4484, 0.6324, 0.4682]}, {"w": "such", "b": [0.6387, 0.4484, 0.685, 0.4682]}, {"w": "as", "b": [0.6913, 0.4484, 0.7123, 0.4682]}, {"w": "“cat.”", "b": [0.7186, 0.4484, 0.7767, 0.4682]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 5.3. The concept of a response map: a 2D map of the presence of a pattern at different locations in an input", "words": [{"w": "Figure", "b": [0.1483, 0.4761, 0.2142, 0.4958]}, {"w": "5.3.", "b": [0.2205, 0.4761, 0.2583, 0.4958]}, {"w": "The", "b": [0.2646, 0.4761, 0.3039, 0.4958]}, {"w": "concept", "b": [0.3102, 0.4761, 0.3886, 0.4958]}, {"w": "of", "b": [0.3949, 0.4761, 0.416, 0.4958]}, {"w": "a", "b": [0.4223, 0.4761, 0.4335, 0.4958]}, {"w": "response", "b": [0.4398, 0.4761, 0.528, 0.4958]}, {"w": "map:", "b": [0.5343, 0.4761, 0.5848, 0.4958]}, {"w": "a", "b": [0.5911, 0.4761, 0.6023, 0.4958]}, {"w": "2D", "b": [0.6086, 0.4761, 0.6394, 0.4958]}, {"w": "map", "b": [0.6457, 0.4761, 0.6892, 0.4958]}, {"w": "of", "b": [0.6955, 0.4761, 0.7165, 0.4958]}, {"w": "the", "b": [0.7228, 0.4761, 0.7536, 0.4958]}, {"w": "presence", "b": [0.1483, 0.4966, 0.2366, 0.5163]}, {"w": "of", "b": [0.2429, 0.4966, 0.2639, 0.5163]}, {"w": "a", "b": [0.2702, 0.4966, 0.2814, 0.5163]}, {"w": "pattern", "b": [0.2877, 0.4966, 0.3578, 0.5163]}, {"w": "at", "b": [0.3641, 0.4966, 0.3823, 0.5163]}, {"w": "different", "b": [0.3886, 0.4966, 0.4749, 0.5163]}, {"w": "locations", "b": [0.4812, 0.4966, 0.5723, 0.5163]}, {"w": "in", "b": [0.5786, 0.4966, 0.5983, 0.5163]}, {"w": "an", "b": [0.6046, 0.4966, 0.6284, 0.5163]}, {"w": "input", "b": [0.6347, 0.4966, 0.6866, 0.5163]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure 5.4. How convolution works", "words": [{"w": "Figure", "b": [0.1483, 0.5242, 0.2142, 0.5439]}, {"w": "5.4.", "b": [0.2205, 0.5242, 0.2583, 0.5439]}, {"w": "How", "b": [0.2646, 0.5242, 0.3137, 0.5439]}, {"w": "convolution", "b": [0.32, 0.5242, 0.4405, 0.5439]}, {"w": "works", "b": [0.4468, 0.5242, 0.5085, 0.5439]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 5.5. Valid locations of 3 × 3 patches in a 5 × 5 input feature map", "words": [{"w": "Figure", "b": [0.1483, 0.5518, 0.2142, 0.5716]}, {"w": "5.5.", "b": [0.2205, 0.5518, 0.2583, 0.5716]}, {"w": "Valid", "b": [0.2646, 0.5518, 0.3179, 0.5716]}, {"w": "locations", "b": [0.3242, 0.5518, 0.4153, 0.5716]}, {"w": "of", "b": [0.4216, 0.5518, 0.4426, 0.5716]}, {"w": "3", "b": [0.4489, 0.5518, 0.4615, 0.5716]}, {"w": "×", "b": [0.4678, 0.5518, 0.4821, 0.5716]}, {"w": "3", "b": [0.4884, 0.5518, 0.501, 0.5716]}, {"w": "patches", "b": [0.5073, 0.5518, 0.583, 0.5716]}, {"w": "in", "b": [0.5893, 0.5518, 0.6089, 0.5716]}, {"w": "a", "b": [0.6152, 0.5518, 0.6264, 0.5716]}, {"w": "5", "b": [0.6327, 0.5518, 0.6453, 0.5716]}, {"w": "×", "b": [0.6516, 0.5518, 0.6658, 0.5716]}, {"w": "5", "b": [0.6721, 0.5518, 0.6848, 0.5716]}, {"w": "input", "b": [0.6911, 0.5518, 0.7429, 0.5716]}, {"w": "feature", "b": [0.7492, 0.5518, 0.8193, 0.5716]}, {"w": "map", "b": [0.1483, 0.5723, 0.1918, 0.5921]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure 5.6. Padding a 5 × 5 input in order to be able to extract 25 3 × 3 patches Figure 5.7. 3 × 3 convolution patches with 2 × 2 strides", "words": [{"w": "Figure", "b": [0.1483, 0.6, 0.2142, 0.6197]}, {"w": "5.6.", "b": [0.2205, 0.6, 0.2583, 0.6197]}, {"w": "Padding", "b": [0.2646, 0.6, 0.3473, 0.6197]}, {"w": "a", "b": [0.3536, 0.6, 0.3648, 0.6197]}, {"w": "5", "b": [0.3712, 0.6, 0.3838, 0.6197]}, {"w": "×", "b": [0.3901, 0.6, 0.4043, 0.6197]}, {"w": "5", "b": [0.4106, 0.6, 0.4232, 0.6197]}, {"w": "input", "b": [0.4295, 0.6, 0.4814, 0.6197]}, {"w": "in", "b": [0.4877, 0.6, 0.5073, 0.6197]}, {"w": "order", "b": [0.5136, 0.6, 0.5669, 0.6197]}, {"w": "to", "b": [0.5732, 0.6, 0.5928, 0.6197]}, {"w": "be", "b": [0.5991, 0.6, 0.6229, 0.6197]}, {"w": "able", "b": [0.6292, 0.6, 0.6712, 0.6197]}, {"w": "to", "b": [0.6775, 0.6, 0.6972, 0.6197]}, {"w": "extract", "b": [0.7035, 0.6, 0.7721, 0.6197]}, {"w": "25", "b": [0.7784, 0.6, 0.8036, 0.6197]}, {"w": "3", "b": [0.81, 0.6, 0.8226, 0.6197]}, {"w": "×", "b": [0.8289, 0.6, 0.8431, 0.6197]}, {"w": "3", "b": [0.1483, 0.6205, 0.1609, 0.6402]}, {"w": "patches", "b": [0.1673, 0.6205, 0.2429, 0.6402]}, {"w": "Figure", "b": [0.1483, 0.6481, 0.2142, 0.6678]}, {"w": "5.7.", "b": [0.2205, 0.6481, 0.2583, 0.6678]}, {"w": "3", "b": [0.2646, 0.6481, 0.2773, 0.6678]}, {"w": "×", "b": [0.2836, 0.6481, 0.2978, 0.6678]}, {"w": "3", "b": [0.3041, 0.6481, 0.3167, 0.6678]}, {"w": "convolution", "b": [0.323, 0.6481, 0.4435, 0.6678]}, {"w": "patches", "b": [0.4499, 0.6481, 0.5255, 0.6678]}, {"w": "with", "b": [0.5318, 0.6481, 0.5767, 0.6678]}, {"w": "2", "b": [0.583, 0.6481, 0.5956, 0.6678]}, {"w": "×", "b": [0.6019, 0.6481, 0.6161, 0.6678]}, {"w": "2", "b": [0.6224, 0.6481, 0.635, 0.6678]}, {"w": "strides", "b": [0.6413, 0.6481, 0.7072, 0.6678]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure 5.8. Samples from the Dogs vs. Cats dataset. Sizes weren’t modified: the samples are heterogeneous in size, appearance, and so on.", "words": [{"w": "Figure", "b": [0.1483, 0.6757, 0.2142, 0.6955]}, {"w": "5.8.", "b": [0.2205, 0.6757, 0.2583, 0.6955]}, {"w": "Samples", "b": [0.2646, 0.6757, 0.3501, 0.6955]}, {"w": "from", "b": [0.3564, 0.6757, 0.4055, 0.6955]}, {"w": "the", "b": [0.4118, 0.6757, 0.4426, 0.6955]}, {"w": "Dogs", "b": [0.4489, 0.6757, 0.5022, 0.6955]}, {"w": "vs.", "b": [0.5085, 0.6757, 0.5372, 0.6955]}, {"w": "Cats", "b": [0.5435, 0.6757, 0.5884, 0.6955]}, {"w": "dataset.", "b": [0.5947, 0.6757, 0.671, 0.6955]}, {"w": "Sizes", "b": [0.6773, 0.6757, 0.7306, 0.6955]}, {"w": "weren’t", "b": [0.7369, 0.6757, 0.8134, 0.6955]}, {"w": "modified:", "b": [0.1483, 0.6962, 0.2464, 0.716]}, {"w": "the", "b": [0.2527, 0.6962, 0.2836, 0.716]}, {"w": "samples", "b": [0.2899, 0.6962, 0.3712, 0.716]}, {"w": "are", "b": [0.3775, 0.6962, 0.4083, 0.716]}, {"w": "heterogeneous", "b": [0.4146, 0.6962, 0.5603, 0.716]}, {"w": "in", "b": [0.5666, 0.6962, 0.5862, 0.716]}, {"w": "size,", "b": [0.5925, 0.6962, 0.638, 0.716]}, {"w": "appearance,", "b": [0.6443, 0.6962, 0.7641, 0.716]}, {"w": "and", "b": [0.7703, 0.6962, 0.8067, 0.716]}, {"w": "so", "b": [0.813, 0.6962, 0.8355, 0.716]}, {"w": "on.", "b": [0.1483, 0.7167, 0.1799, 0.7365]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure 5.9. augmenting dataconvnets (convolutional neural networks)training on small datasetsusing data augmentationdataaugmentingtrainingconvnets on small datasetsusing data augmentationTraining and validation accuracy", "words": [{"w": "Figure", "b": [0.1483, 0.7444, 0.2142, 0.7641]}, {"w": "5.9.", "b": [0.2205, 0.7444, 0.2583, 0.7641]}, {"w": "augmenting", "b": [0.2646, 0.7444, 0.3838, 0.7641]}, {"w": "dataconvnets", "b": [0.3901, 0.7444, 0.5218, 0.7641]}, {"w": "(convolutional", "b": [0.5281, 0.7444, 0.6752, 0.7641]}, {"w": "neural", "b": [0.6815, 0.7444, 0.7446, 0.7641]}, {"w": "networks)training", "b": [0.1483, 0.7649, 0.3277, 0.7846]}, {"w": "on", "b": [0.334, 0.7649, 0.3592, 0.7846]}, {"w": "small", "b": [0.3655, 0.7649, 0.4202, 0.7846]}, {"w": "datasetsusing", "b": [0.4265, 0.7649, 0.561, 0.7846]}, {"w": "data", "b": [0.5673, 0.7649, 0.6094, 0.7846]}, {"w": "augmentationdataaugmentingtrainingconvnets", "b": [0.1483, 0.7854, 0.615, 0.8051]}, {"w": "on", "b": [0.6212, 0.7854, 0.6464, 0.8051]}, {"w": "small", "b": [0.6527, 0.7854, 0.7074, 0.8051]}, {"w": "datasetsusing", "b": [0.1483, 0.8059, 0.2829, 0.8256]}, {"w": "data", "b": [0.2892, 0.8059, 0.3312, 0.8256]}, {"w": "augmentationTraining", "b": [0.3375, 0.8059, 0.5608, 0.8256]}, {"w": "and", "b": [0.5671, 0.8059, 0.6035, 0.8256]}, {"w": "validation", "b": [0.6098, 0.8059, 0.7107, 0.8256]}, {"w": "accuracy", "b": [0.717, 0.8059, 0.8066, 0.8256]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure 5.10. Training and validation loss", "words": [{"w": "Figure", "b": [0.1483, 0.8335, 0.2142, 0.8532]}, {"w": "5.10.", "b": [0.2205, 0.8335, 0.271, 0.8532]}, {"w": "Training", "b": [0.2773, 0.8335, 0.3632, 0.8532]}, {"w": "and", "b": [0.3695, 0.8335, 0.406, 0.8532]}, {"w": "validation", "b": [0.4123, 0.8335, 0.5132, 0.8532]}, {"w": "loss", "b": [0.5195, 0.8335, 0.5587, 0.8532]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure 5.11. Generation of cat pictures via random data augmentation", "words": [{"w": "Figure", "b": [0.1483, 0.8611, 0.2142, 0.8809]}, {"w": "5.11.", "b": [0.2205, 0.8611, 0.27, 0.8809]}, {"w": "Generation", "b": [0.2763, 0.8611, 0.3884, 0.8809]}, {"w": "of", "b": [0.3947, 0.8611, 0.4157, 0.8809]}, {"w": "cat", "b": [0.422, 0.8611, 0.4514, 0.8809]}, {"w": "pictures", "b": [0.4577, 0.8611, 0.5376, 0.8809]}, {"w": "via", "b": [0.5439, 0.8611, 0.5747, 0.8809]}, {"w": "random", "b": [0.581, 0.8611, 0.6581, 0.8809]}, {"w": "data", "b": [0.6644, 0.8611, 0.7064, 0.8809]}, {"w": "augmentation", "b": [0.1483, 0.8816, 0.2857, 0.9014]}]}]}, {"page": 479, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 5.12. Training and validation accuracy with data augmentation", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "5.12.", "b": [0.2205, 0.0857, 0.271, 0.1054]}, {"w": "Training", "b": [0.2773, 0.0857, 0.3632, 0.1054]}, {"w": "and", "b": [0.3695, 0.0857, 0.406, 0.1054]}, {"w": "validation", "b": [0.4123, 0.0857, 0.5132, 0.1054]}, {"w": "accuracy", "b": [0.5195, 0.0857, 0.6091, 0.1054]}, {"w": "with", "b": [0.6154, 0.0857, 0.6603, 0.1054]}, {"w": "data", "b": [0.6666, 0.0857, 0.7086, 0.1054]}, {"w": "augmentation", "b": [0.1483, 0.1062, 0.2857, 0.1259]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 5.13. Training and validation loss with data augmentation", "words": [{"w": "Figure", "b": [0.1483, 0.1338, 0.2142, 0.1535]}, {"w": "5.13.", "b": [0.2205, 0.1338, 0.271, 0.1535]}, {"w": "Training", "b": [0.2773, 0.1338, 0.3632, 0.1535]}, {"w": "and", "b": [0.3695, 0.1338, 0.406, 0.1535]}, {"w": "validation", "b": [0.4123, 0.1338, 0.5132, 0.1535]}, {"w": "loss", "b": [0.5195, 0.1338, 0.5587, 0.1535]}, {"w": "with", "b": [0.565, 0.1338, 0.6099, 0.1535]}, {"w": "data", "b": [0.6162, 0.1338, 0.6582, 0.1535]}, {"w": "augmentation", "b": [0.6645, 0.1338, 0.8019, 0.1535]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 5.14. Swapping classifiers while keeping the same convolutional base", "words": [{"w": "Figure", "b": [0.1483, 0.1614, 0.2142, 0.1812]}, {"w": "5.14.", "b": [0.2205, 0.1614, 0.271, 0.1812]}, {"w": "Swapping", "b": [0.2773, 0.1614, 0.3782, 0.1812]}, {"w": "classifiers", "b": [0.3845, 0.1614, 0.4853, 0.1812]}, {"w": "while", "b": [0.4917, 0.1614, 0.5477, 0.1812]}, {"w": "keeping", "b": [0.554, 0.1614, 0.6339, 0.1812]}, {"w": "the", "b": [0.6402, 0.1614, 0.671, 0.1812]}, {"w": "same", "b": [0.6773, 0.1614, 0.7292, 0.1812]}, {"w": "convolutional", "b": [0.1483, 0.1819, 0.2871, 0.2017]}, {"w": "base", "b": [0.2934, 0.1819, 0.3382, 0.2017]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 5.15. Training and validation accuracy for simple feature extraction", "words": [{"w": "Figure", "b": [0.1483, 0.2096, 0.2142, 0.2293]}, {"w": "5.15.", "b": [0.2205, 0.2096, 0.271, 0.2293]}, {"w": "Training", "b": [0.2773, 0.2096, 0.3632, 0.2293]}, {"w": "and", "b": [0.3695, 0.2096, 0.406, 0.2293]}, {"w": "validation", "b": [0.4123, 0.2096, 0.5132, 0.2293]}, {"w": "accuracy", "b": [0.5195, 0.2096, 0.6091, 0.2293]}, {"w": "for", "b": [0.6154, 0.2096, 0.6448, 0.2293]}, {"w": "simple", "b": [0.6511, 0.2096, 0.7184, 0.2293]}, {"w": "feature", "b": [0.7247, 0.2096, 0.7948, 0.2293]}, {"w": "extraction", "b": [0.1483, 0.2301, 0.2492, 0.2498]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 5.16. Training and validation loss for simple feature extraction", "words": [{"w": "Figure", "b": [0.1483, 0.2577, 0.2142, 0.2774]}, {"w": "5.16.", "b": [0.2205, 0.2577, 0.271, 0.2774]}, {"w": "Training", "b": [0.2773, 0.2577, 0.3632, 0.2774]}, {"w": "and", "b": [0.3695, 0.2577, 0.406, 0.2774]}, {"w": "validation", "b": [0.4123, 0.2577, 0.5132, 0.2774]}, {"w": "loss", "b": [0.5195, 0.2577, 0.5587, 0.2774]}, {"w": "for", "b": [0.565, 0.2577, 0.5945, 0.2774]}, {"w": "simple", "b": [0.6008, 0.2577, 0.668, 0.2774]}, {"w": "feature", "b": [0.6744, 0.2577, 0.7444, 0.2774]}, {"w": "extraction", "b": [0.1483, 0.2782, 0.2492, 0.2979]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 5.17. Training and validation accuracy for feature extraction with data augmentation", "words": [{"w": "Figure", "b": [0.1483, 0.3058, 0.2142, 0.3256]}, {"w": "5.17.", "b": [0.2205, 0.3058, 0.271, 0.3256]}, {"w": "Training", "b": [0.2773, 0.3058, 0.3632, 0.3256]}, {"w": "and", "b": [0.3695, 0.3058, 0.406, 0.3256]}, {"w": "validation", "b": [0.4123, 0.3058, 0.5132, 0.3256]}, {"w": "accuracy", "b": [0.5195, 0.3058, 0.6091, 0.3256]}, {"w": "for", "b": [0.6154, 0.3058, 0.6448, 0.3256]}, {"w": "feature", "b": [0.6511, 0.3058, 0.7212, 0.3256]}, {"w": "extraction", "b": [0.7275, 0.3058, 0.8284, 0.3256]}, {"w": "with", "b": [0.1483, 0.3263, 0.1932, 0.3461]}, {"w": "data", "b": [0.1995, 0.3263, 0.2415, 0.3461]}, {"w": "augmentation", "b": [0.2478, 0.3263, 0.3852, 0.3461]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 5.18. Training and validation loss for feature extraction with data augmentation", "words": [{"w": "Figure", "b": [0.1483, 0.354, 0.2142, 0.3737]}, {"w": "5.18.", "b": [0.2205, 0.354, 0.271, 0.3737]}, {"w": "Training", "b": [0.2773, 0.354, 0.3632, 0.3737]}, {"w": "and", "b": [0.3695, 0.354, 0.406, 0.3737]}, {"w": "validation", "b": [0.4123, 0.354, 0.5132, 0.3737]}, {"w": "loss", "b": [0.5195, 0.354, 0.5587, 0.3737]}, {"w": "for", "b": [0.565, 0.354, 0.5945, 0.3737]}, {"w": "feature", "b": [0.6008, 0.354, 0.6708, 0.3737]}, {"w": "extraction", "b": [0.6771, 0.354, 0.778, 0.3737]}, {"w": "with", "b": [0.7843, 0.354, 0.8291, 0.3737]}, {"w": "data", "b": [0.1483, 0.3745, 0.1904, 0.3942]}, {"w": "augmentation", "b": [0.1967, 0.3745, 0.334, 0.3942]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 5.19. layersunfreezingunfreezing layersFine-tuning the last convolutional block of the VGG16 network", "words": [{"w": "Figure", "b": [0.1483, 0.4021, 0.2142, 0.4218]}, {"w": "5.19.", "b": [0.2205, 0.4021, 0.271, 0.4218]}, {"w": "layersunfreezingunfreezing", "b": [0.2773, 0.4021, 0.5532, 0.4218]}, {"w": "layersFine-tuning", "b": [0.5595, 0.4021, 0.7375, 0.4218]}, {"w": "the", "b": [0.7438, 0.4021, 0.7746, 0.4218]}, {"w": "last", "b": [0.7809, 0.4021, 0.816, 0.4218]}, {"w": "convolutional", "b": [0.1483, 0.4226, 0.2871, 0.4423]}, {"w": "block", "b": [0.2934, 0.4226, 0.3494, 0.4423]}, {"w": "of", "b": [0.3557, 0.4226, 0.3768, 0.4423]}, {"w": "the", "b": [0.3831, 0.4226, 0.4139, 0.4423]}, {"w": "VGG16", "b": [0.4202, 0.4226, 0.5001, 0.4423]}, {"w": "network", "b": [0.5064, 0.4226, 0.589, 0.4423]}]}, {"id": "b_8", "type": "equation", "text": "Figure 5.20. Training and validation accuracy for fine-tuning", "words": [{"w": "Figure", "b": [0.1483, 0.4502, 0.2142, 0.47]}, {"w": "5.20.", "b": [0.2205, 0.4502, 0.271, 0.47]}, {"w": "Training", "b": [0.2773, 0.4502, 0.3632, 0.47]}, {"w": "and", "b": [0.3695, 0.4502, 0.406, 0.47]}, {"w": "validation", "b": [0.4123, 0.4502, 0.5132, 0.47]}, {"w": "accuracy", "b": [0.5195, 0.4502, 0.6091, 0.47]}, {"w": "for", "b": [0.6154, 0.4502, 0.6448, 0.47]}, {"w": "fine-tuning", "b": [0.6511, 0.4502, 0.7632, 0.47]}]}, {"id": "b_9", "type": "equation", "text": "Figure 5.21. Training and validation loss for fine-tuning", "words": [{"w": "Figure", "b": [0.1483, 0.4779, 0.2142, 0.4976]}, {"w": "5.21.", "b": [0.2205, 0.4779, 0.271, 0.4976]}, {"w": "Training", "b": [0.2773, 0.4779, 0.3632, 0.4976]}, {"w": "and", "b": [0.3695, 0.4779, 0.406, 0.4976]}, {"w": "validation", "b": [0.4123, 0.4779, 0.5132, 0.4976]}, {"w": "loss", "b": [0.5195, 0.4779, 0.5587, 0.4976]}, {"w": "for", "b": [0.565, 0.4779, 0.5945, 0.4976]}, {"w": "fine-tuning", "b": [0.6008, 0.4779, 0.7129, 0.4976]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 5.22. Smoothed curves for training and validation accuracy for fine-tuning", "words": [{"w": "Figure", "b": [0.1483, 0.5055, 0.2142, 0.5252]}, {"w": "5.22.", "b": [0.2205, 0.5055, 0.271, 0.5252]}, {"w": "Smoothed", "b": [0.2773, 0.5055, 0.3796, 0.5252]}, {"w": "curves", "b": [0.3859, 0.5055, 0.4517, 0.5252]}, {"w": "for", "b": [0.458, 0.5055, 0.4874, 0.5252]}, {"w": "training", "b": [0.4937, 0.5055, 0.5722, 0.5252]}, {"w": "and", "b": [0.5785, 0.5055, 0.615, 0.5252]}, {"w": "validation", "b": [0.6213, 0.5055, 0.7222, 0.5252]}, {"w": "accuracy", "b": [0.7285, 0.5055, 0.8181, 0.5252]}, {"w": "for", "b": [0.1483, 0.526, 0.1777, 0.5457]}, {"w": "fine-tuning", "b": [0.1841, 0.526, 0.2962, 0.5457]}]}, {"id": "b_11", "type": "equation", "text": "Figure 5.23. Smoothed curves for training and validation loss for fine-tuning", "words": [{"w": "Figure", "b": [0.1483, 0.5536, 0.2142, 0.5734]}, {"w": "5.23.", "b": [0.2205, 0.5536, 0.271, 0.5734]}, {"w": "Smoothed", "b": [0.2773, 0.5536, 0.3796, 0.5734]}, {"w": "curves", "b": [0.3859, 0.5536, 0.4517, 0.5734]}, {"w": "for", "b": [0.458, 0.5536, 0.4874, 0.5734]}, {"w": "training", "b": [0.4937, 0.5536, 0.5722, 0.5734]}, {"w": "and", "b": [0.5785, 0.5536, 0.615, 0.5734]}, {"w": "validation", "b": [0.6213, 0.5536, 0.7222, 0.5734]}, {"w": "loss", "b": [0.7285, 0.5536, 0.7677, 0.5734]}, {"w": "for", "b": [0.774, 0.5536, 0.8034, 0.5734]}, {"w": "fine-tuning", "b": [0.1483, 0.5741, 0.2604, 0.5939]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure 5.24. The test cat picture", "words": [{"w": "Figure", "b": [0.1483, 0.6017, 0.2142, 0.6215]}, {"w": "5.24.", "b": [0.2205, 0.6017, 0.271, 0.6215]}, {"w": "The", "b": [0.2773, 0.6017, 0.3165, 0.6215]}, {"w": "test", "b": [0.3228, 0.6017, 0.3578, 0.6215]}, {"w": "cat", "b": [0.3641, 0.6017, 0.3936, 0.6215]}, {"w": "picture", "b": [0.3999, 0.6017, 0.4699, 0.6215]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure 5.25. Fourth channel of the activation of the first layer on the test cat picture", "words": [{"w": "Figure", "b": [0.1483, 0.6294, 0.2142, 0.6491]}, {"w": "5.25.", "b": [0.2205, 0.6294, 0.271, 0.6491]}, {"w": "Fourth", "b": [0.2773, 0.6294, 0.3445, 0.6491]}, {"w": "channel", "b": [0.3508, 0.6294, 0.4293, 0.6491]}, {"w": "of", "b": [0.4356, 0.6294, 0.4566, 0.6491]}, {"w": "the", "b": [0.4629, 0.6294, 0.4937, 0.6491]}, {"w": "activation", "b": [0.5001, 0.6294, 0.5995, 0.6491]}, {"w": "of", "b": [0.6059, 0.6294, 0.6269, 0.6491]}, {"w": "the", "b": [0.6332, 0.6294, 0.664, 0.6491]}, {"w": "first", "b": [0.6703, 0.6294, 0.7109, 0.6491]}, {"w": "layer", "b": [0.7172, 0.6294, 0.7677, 0.6491]}, {"w": "on", "b": [0.774, 0.6294, 0.7992, 0.6491]}, {"w": "the", "b": [0.8055, 0.6294, 0.8363, 0.6491]}, {"w": "test", "b": [0.1483, 0.6499, 0.1834, 0.6696]}, {"w": "cat", "b": [0.1897, 0.6499, 0.2191, 0.6696]}, {"w": "picture", "b": [0.2254, 0.6499, 0.2954, 0.6696]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure 5.26. Seventh channel of the activation of the first layer on the test cat picture", "words": [{"w": "Figure", "b": [0.1483, 0.6775, 0.2142, 0.6973]}, {"w": "5.26.", "b": [0.2205, 0.6775, 0.271, 0.6973]}, {"w": "Seventh", "b": [0.2773, 0.6775, 0.3585, 0.6973]}, {"w": "channel", "b": [0.3648, 0.6775, 0.4433, 0.6973]}, {"w": "of", "b": [0.4496, 0.6775, 0.4706, 0.6973]}, {"w": "the", "b": [0.4769, 0.6775, 0.5077, 0.6973]}, {"w": "activation", "b": [0.5141, 0.6775, 0.6135, 0.6973]}, {"w": "of", "b": [0.6199, 0.6775, 0.6409, 0.6973]}, {"w": "the", "b": [0.6472, 0.6775, 0.678, 0.6973]}, {"w": "first", "b": [0.6843, 0.6775, 0.7249, 0.6973]}, {"w": "layer", "b": [0.7312, 0.6775, 0.7817, 0.6973]}, {"w": "on", "b": [0.788, 0.6775, 0.8132, 0.6973]}, {"w": "the", "b": [0.1483, 0.698, 0.1792, 0.7178]}, {"w": "test", "b": [0.1855, 0.698, 0.2205, 0.7178]}, {"w": "cat", "b": [0.2268, 0.698, 0.2562, 0.7178]}, {"w": "picture", "b": [0.2625, 0.698, 0.3326, 0.7178]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure 5.27. information distillation pipelineEvery channel of every layer activation on the test cat picture", "words": [{"w": "Figure", "b": [0.1483, 0.7256, 0.2142, 0.7454]}, {"w": "5.27.", "b": [0.2205, 0.7256, 0.271, 0.7454]}, {"w": "information", "b": [0.2773, 0.7256, 0.3964, 0.7454]}, {"w": "distillation", "b": [0.4027, 0.7256, 0.5106, 0.7454]}, {"w": "pipelineEvery", "b": [0.5169, 0.7256, 0.6584, 0.7454]}, {"w": "channel", "b": [0.6648, 0.7256, 0.7432, 0.7454]}, {"w": "of", "b": [0.7495, 0.7256, 0.7705, 0.7454]}, {"w": "every", "b": [0.7768, 0.7256, 0.8329, 0.7454]}, {"w": "layer", "b": [0.1483, 0.7461, 0.1988, 0.7659]}, {"w": "activation", "b": [0.2051, 0.7461, 0.3046, 0.7659]}, {"w": "on", "b": [0.3109, 0.7461, 0.3361, 0.7659]}, {"w": "the", "b": [0.3424, 0.7461, 0.3732, 0.7659]}, {"w": "test", "b": [0.3795, 0.7461, 0.4146, 0.7659]}, {"w": "cat", "b": [0.4209, 0.7461, 0.4503, 0.7659]}, {"w": "picture", "b": [0.4566, 0.7461, 0.5266, 0.7659]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure 5.28. Left: attempts to draw a bicycle from memory. Right: what a schematic bicycle should look like.", "words": [{"w": "Figure", "b": [0.1483, 0.7738, 0.2142, 0.7935]}, {"w": "5.28.", "b": [0.2205, 0.7738, 0.271, 0.7935]}, {"w": "Left:", "b": [0.2773, 0.7738, 0.3263, 0.7935]}, {"w": "attempts", "b": [0.3326, 0.7738, 0.4181, 0.7935]}, {"w": "to", "b": [0.4244, 0.7738, 0.444, 0.7935]}, {"w": "draw", "b": [0.4503, 0.7738, 0.5008, 0.7935]}, {"w": "a", "b": [0.5071, 0.7738, 0.5183, 0.7935]}, {"w": "bicycle", "b": [0.5246, 0.7738, 0.5974, 0.7935]}, {"w": "from", "b": [0.6037, 0.7738, 0.6528, 0.7935]}, {"w": "memory.", "b": [0.6591, 0.7738, 0.7477, 0.7935]}, {"w": "Right:", "b": [0.754, 0.7738, 0.8171, 0.7935]}, {"w": "what", "b": [0.1483, 0.7943, 0.1974, 0.814]}, {"w": "a", "b": [0.2037, 0.7943, 0.2149, 0.814]}, {"w": "schematic", "b": [0.2212, 0.7943, 0.3221, 0.814]}, {"w": "bicycle", "b": [0.3284, 0.7943, 0.4012, 0.814]}, {"w": "should", "b": [0.4075, 0.7943, 0.4748, 0.814]}, {"w": "look", "b": [0.4811, 0.7943, 0.526, 0.814]}, {"w": "like.", "b": [0.5323, 0.7943, 0.5764, 0.814]}]}, {"id": "b_17", "type": "paragraph", "text": "Figure 5.29. Pattern that the zeroth channel in layer block3_conv1 responds to maximally", "words": [{"w": "Figure", "b": [0.1483, 0.8219, 0.2142, 0.8416]}, {"w": "5.29.", "b": [0.2205, 0.8219, 0.271, 0.8416]}, {"w": "Pattern", "b": [0.2773, 0.8219, 0.3487, 0.8416]}, {"w": "that", "b": [0.355, 0.8219, 0.3929, 0.8416]}, {"w": "the", "b": [0.3992, 0.8219, 0.43, 0.8416]}, {"w": "zeroth", "b": [0.4363, 0.8219, 0.4993, 0.8416]}, {"w": "channel", "b": [0.5057, 0.8219, 0.5841, 0.8416]}, {"w": "in", "b": [0.5904, 0.8219, 0.61, 0.8416]}, {"w": "layer", "b": [0.6163, 0.8219, 0.6668, 0.8416]}, {"w": "block3_conv1", "b": [0.6731, 0.8219, 0.816, 0.8416]}, {"w": "responds", "b": [0.1483, 0.8424, 0.238, 0.8621]}, {"w": "to", "b": [0.2443, 0.8424, 0.2639, 0.8621]}, {"w": "maximally", "b": [0.2702, 0.8424, 0.3782, 0.8621]}]}, {"id": "b_18", "type": "equation", "text": "Figure 5.30. Filter patterns for layer block1_conv1", "words": [{"w": "Figure", "b": [0.1483, 0.87, 0.2142, 0.8898]}, {"w": "5.30.", "b": [0.2205, 0.87, 0.271, 0.8898]}, {"w": "Filter", "b": [0.2773, 0.87, 0.3319, 0.8898]}, {"w": "patterns", "b": [0.3382, 0.87, 0.4181, 0.8898]}, {"w": "for", "b": [0.4244, 0.87, 0.4538, 0.8898]}, {"w": "layer", "b": [0.4601, 0.87, 0.5105, 0.8898]}, {"w": "block1_conv1", "b": [0.5169, 0.87, 0.6598, 0.8898]}]}]}, {"page": 480, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Figure 5.31. Filter patterns for layer block2_conv1", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "5.31.", "b": [0.2205, 0.0857, 0.271, 0.1054]}, {"w": "Filter", "b": [0.2773, 0.0857, 0.3319, 0.1054]}, {"w": "patterns", "b": [0.3382, 0.0857, 0.4181, 0.1054]}, {"w": "for", "b": [0.4244, 0.0857, 0.4538, 0.1054]}, {"w": "layer", "b": [0.4601, 0.0857, 0.5105, 0.1054]}, {"w": "block2_conv1", "b": [0.5169, 0.0857, 0.6598, 0.1054]}]}, {"id": "b_1", "type": "equation", "text": "Figure 5.32. float32Filter patterns for layer block3_conv1", "words": [{"w": "Figure", "b": [0.1483, 0.1133, 0.2142, 0.133]}, {"w": "5.32.", "b": [0.2205, 0.1133, 0.271, 0.133]}, {"w": "float32Filter", "b": [0.2773, 0.1133, 0.4034, 0.133]}, {"w": "patterns", "b": [0.4097, 0.1133, 0.4896, 0.133]}, {"w": "for", "b": [0.4959, 0.1133, 0.5253, 0.133]}, {"w": "layer", "b": [0.5316, 0.1133, 0.582, 0.133]}, {"w": "block3_conv1", "b": [0.5883, 0.1133, 0.7312, 0.133]}]}, {"id": "b_2", "type": "equation", "text": "Figure 5.33. Filter patterns for layer block4_conv1", "words": [{"w": "Figure", "b": [0.1483, 0.1409, 0.2142, 0.1607]}, {"w": "5.33.", "b": [0.2205, 0.1409, 0.271, 0.1607]}, {"w": "Filter", "b": [0.2773, 0.1409, 0.3319, 0.1607]}, {"w": "patterns", "b": [0.3382, 0.1409, 0.4181, 0.1607]}, {"w": "for", "b": [0.4244, 0.1409, 0.4538, 0.1607]}, {"w": "layer", "b": [0.4601, 0.1409, 0.5105, 0.1607]}, {"w": "block4_conv1", "b": [0.5169, 0.1409, 0.6598, 0.1607]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 5.34. Test picture of African elephants", "words": [{"w": "Figure", "b": [0.1483, 0.1686, 0.2142, 0.1883]}, {"w": "5.34.", "b": [0.2205, 0.1686, 0.271, 0.1883]}, {"w": "Test", "b": [0.2773, 0.1686, 0.3189, 0.1883]}, {"w": "picture", "b": [0.3252, 0.1686, 0.3953, 0.1883]}, {"w": "of", "b": [0.4016, 0.1686, 0.4226, 0.1883]}, {"w": "African", "b": [0.4289, 0.1686, 0.506, 0.1883]}, {"w": "elephants", "b": [0.5123, 0.1686, 0.6075, 0.1883]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 5.35. African elephant class activation heatmap over the test picture", "words": [{"w": "Figure", "b": [0.1483, 0.1962, 0.2142, 0.2159]}, {"w": "5.35.", "b": [0.2205, 0.1962, 0.271, 0.2159]}, {"w": "African", "b": [0.2773, 0.1962, 0.3543, 0.2159]}, {"w": "elephant", "b": [0.3606, 0.1962, 0.4461, 0.2159]}, {"w": "class", "b": [0.4524, 0.1962, 0.5014, 0.2159]}, {"w": "activation", "b": [0.5077, 0.1962, 0.6072, 0.2159]}, {"w": "heatmap", "b": [0.6135, 0.1962, 0.699, 0.2159]}, {"w": "over", "b": [0.7053, 0.1962, 0.7501, 0.2159]}, {"w": "the", "b": [0.7564, 0.1962, 0.7872, 0.2159]}, {"w": "test", "b": [0.7936, 0.1962, 0.8286, 0.2159]}, {"w": "picture", "b": [0.1483, 0.2167, 0.2184, 0.2364]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 5.36. Superimposing the class activation heatmap on the original picture", "words": [{"w": "Figure", "b": [0.1483, 0.2443, 0.2142, 0.2641]}, {"w": "5.36.", "b": [0.2205, 0.2443, 0.271, 0.2641]}, {"w": "Superimposing", "b": [0.2773, 0.2443, 0.43, 0.2641]}, {"w": "the", "b": [0.4363, 0.2443, 0.4672, 0.2641]}, {"w": "class", "b": [0.4735, 0.2443, 0.5225, 0.2641]}, {"w": "activation", "b": [0.5288, 0.2443, 0.6283, 0.2641]}, {"w": "heatmap", "b": [0.6346, 0.2443, 0.7201, 0.2641]}, {"w": "on", "b": [0.7264, 0.2443, 0.7516, 0.2641]}, {"w": "the", "b": [0.7579, 0.2443, 0.7887, 0.2641]}, {"w": "original", "b": [0.1483, 0.2648, 0.2268, 0.2846]}, {"w": "picture", "b": [0.2331, 0.2648, 0.3032, 0.2846]}]}, {"id": "b_6", "type": "paragraph", "text": "Chapter 6. Deep learning for text and sequences", "words": [{"w": "Chapter", "b": [0.1294, 0.3076, 0.2093, 0.3274]}, {"w": "6.", "b": [0.2156, 0.3076, 0.2345, 0.3274]}, {"w": "Deep", "b": [0.2408, 0.3076, 0.294, 0.3274]}, {"w": "learning", "b": [0.3003, 0.3076, 0.383, 0.3274]}, {"w": "for", "b": [0.3893, 0.3076, 0.4187, 0.3274]}, {"w": "text", "b": [0.425, 0.3076, 0.4629, 0.3274]}, {"w": "and", "b": [0.4692, 0.3076, 0.5056, 0.3274]}, {"w": "sequences", "b": [0.5119, 0.3076, 0.6142, 0.3274]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 6.1. From text to tokens to vectors", "words": [{"w": "Figure", "b": [0.1483, 0.3459, 0.2142, 0.3657]}, {"w": "6.1.", "b": [0.2205, 0.3459, 0.2583, 0.3657]}, {"w": "From", "b": [0.2646, 0.3459, 0.3193, 0.3657]}, {"w": "text", "b": [0.3256, 0.3459, 0.3635, 0.3657]}, {"w": "to", "b": [0.3698, 0.3459, 0.3894, 0.3657]}, {"w": "tokens", "b": [0.3957, 0.3459, 0.4616, 0.3657]}, {"w": "to", "b": [0.4679, 0.3459, 0.4875, 0.3657]}, {"w": "vectors", "b": [0.4938, 0.3459, 0.5667, 0.3657]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 6.2. Whereas word representations obtained from one-hot encoding or hashing are sparse, high-dimensional, and hardcoded, word embeddings are dense, relatively lowdimensional, and learned from data.", "words": [{"w": "Figure", "b": [0.1483, 0.3736, 0.2142, 0.3933]}, {"w": "6.2.", "b": [0.2205, 0.3736, 0.2583, 0.3933]}, {"w": "Whereas", "b": [0.2646, 0.3736, 0.3529, 0.3933]}, {"w": "word", "b": [0.3592, 0.3736, 0.411, 0.3933]}, {"w": "representations", "b": [0.4173, 0.3736, 0.5701, 0.3933]}, {"w": "obtained", "b": [0.5764, 0.3736, 0.6632, 0.3933]}, {"w": "from", "b": [0.6695, 0.3736, 0.7186, 0.3933]}, {"w": "one-hot", "b": [0.7249, 0.3736, 0.802, 0.3933]}, {"w": "encoding", "b": [0.1483, 0.3941, 0.2408, 0.4138]}, {"w": "or", "b": [0.2471, 0.3941, 0.2681, 0.4138]}, {"w": "hashing", "b": [0.2744, 0.3941, 0.3529, 0.4138]}, {"w": "are", "b": [0.3592, 0.3941, 0.39, 0.4138]}, {"w": "sparse,", "b": [0.3963, 0.3941, 0.4657, 0.4138]}, {"w": "high-dimensional,", "b": [0.472, 0.3941, 0.6549, 0.4138]}, {"w": "and", "b": [0.6612, 0.3941, 0.6976, 0.4138]}, {"w": "hardcoded,", "b": [0.7039, 0.3941, 0.8153, 0.4138]}, {"w": "word", "b": [0.1483, 0.4146, 0.2002, 0.4343]}, {"w": "embeddings", "b": [0.2065, 0.4146, 0.3284, 0.4343]}, {"w": "are", "b": [0.3347, 0.4146, 0.3655, 0.4343]}, {"w": "dense,", "b": [0.3718, 0.4146, 0.4356, 0.4343]}, {"w": "relatively", "b": [0.4419, 0.4146, 0.5371, 0.4343]}, {"w": "lowdimensional,", "b": [0.5434, 0.4146, 0.7109, 0.4343]}, {"w": "and", "b": [0.7172, 0.4146, 0.7536, 0.4343]}, {"w": "learned", "b": [0.76, 0.4146, 0.8342, 0.4343]}, {"w": "from", "b": [0.1483, 0.4351, 0.1974, 0.4548]}, {"w": "data.", "b": [0.2037, 0.4351, 0.252, 0.4548]}]}, {"id": "b_9", "type": "equation", "text": "Figure 6.3. A toy example of a word-embedding space", "words": [{"w": "Figure", "b": [0.1483, 0.4627, 0.2142, 0.4824]}, {"w": "6.3.", "b": [0.2205, 0.4627, 0.2583, 0.4824]}, {"w": "A", "b": [0.2646, 0.4627, 0.2829, 0.4824]}, {"w": "toy", "b": [0.2892, 0.4627, 0.3214, 0.4824]}, {"w": "example", "b": [0.3277, 0.4627, 0.4132, 0.4824]}, {"w": "of", "b": [0.4195, 0.4627, 0.4405, 0.4824]}, {"w": "a", "b": [0.4468, 0.4627, 0.458, 0.4824]}, {"w": "word-embedding", "b": [0.4643, 0.4627, 0.6367, 0.4824]}, {"w": "space", "b": [0.643, 0.4627, 0.699, 0.4824]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 6.4. The embedding layer", "words": [{"w": "Figure", "b": [0.1483, 0.4903, 0.2142, 0.5101]}, {"w": "6.4.", "b": [0.2205, 0.4903, 0.2583, 0.5101]}, {"w": "The", "b": [0.2646, 0.4903, 0.3039, 0.5101]}, {"w": "embedding", "b": [0.3102, 0.4903, 0.4223, 0.5101]}, {"w": "layer", "b": [0.4286, 0.4903, 0.479, 0.5101]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure 6.5. Training and validation loss when using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1483, 0.518, 0.2142, 0.5377]}, {"w": "6.5.", "b": [0.2205, 0.518, 0.2583, 0.5377]}, {"w": "Training", "b": [0.2646, 0.518, 0.3506, 0.5377]}, {"w": "and", "b": [0.3569, 0.518, 0.3934, 0.5377]}, {"w": "validation", "b": [0.3997, 0.518, 0.5006, 0.5377]}, {"w": "loss", "b": [0.5069, 0.518, 0.5461, 0.5377]}, {"w": "when", "b": [0.5524, 0.518, 0.6071, 0.5377]}, {"w": "using", "b": [0.6134, 0.518, 0.668, 0.5377]}, {"w": "pretrained", "b": [0.6744, 0.518, 0.7766, 0.5377]}, {"w": "word", "b": [0.7829, 0.518, 0.8348, 0.5377]}, {"w": "embeddings", "b": [0.1483, 0.5385, 0.2702, 0.5582]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure 6.6. Training and validation accuracy when using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1483, 0.5661, 0.2142, 0.5858]}, {"w": "6.6.", "b": [0.2205, 0.5661, 0.2583, 0.5858]}, {"w": "Training", "b": [0.2646, 0.5661, 0.3506, 0.5858]}, {"w": "and", "b": [0.3569, 0.5661, 0.3934, 0.5858]}, {"w": "validation", "b": [0.3997, 0.5661, 0.5006, 0.5858]}, {"w": "accuracy", "b": [0.5069, 0.5661, 0.5965, 0.5858]}, {"w": "when", "b": [0.6028, 0.5661, 0.6575, 0.5858]}, {"w": "using", "b": [0.6638, 0.5661, 0.7184, 0.5858]}, {"w": "pretrained", "b": [0.7247, 0.5661, 0.827, 0.5858]}, {"w": "word", "b": [0.1483, 0.5866, 0.2002, 0.6063]}, {"w": "embeddings", "b": [0.2065, 0.5866, 0.3284, 0.6063]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure 6.7. Training and validation loss without using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1483, 0.6142, 0.2142, 0.634]}, {"w": "6.7.", "b": [0.2205, 0.6142, 0.2583, 0.634]}, {"w": "Training", "b": [0.2646, 0.6142, 0.3506, 0.634]}, {"w": "and", "b": [0.3569, 0.6142, 0.3934, 0.634]}, {"w": "validation", "b": [0.3997, 0.6142, 0.5006, 0.634]}, {"w": "loss", "b": [0.5069, 0.6142, 0.5461, 0.634]}, {"w": "without", "b": [0.5524, 0.6142, 0.6295, 0.634]}, {"w": "using", "b": [0.6358, 0.6142, 0.6905, 0.634]}, {"w": "pretrained", "b": [0.6968, 0.6142, 0.7991, 0.634]}, {"w": "word", "b": [0.1483, 0.6347, 0.2002, 0.6545]}, {"w": "embeddings", "b": [0.2065, 0.6347, 0.3284, 0.6545]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure 6.8. Training and validation accuracy without using pretrained word embeddings", "words": [{"w": "Figure", "b": [0.1483, 0.6624, 0.2142, 0.6821]}, {"w": "6.8.", "b": [0.2205, 0.6624, 0.2583, 0.6821]}, {"w": "Training", "b": [0.2646, 0.6624, 0.3506, 0.6821]}, {"w": "and", "b": [0.3569, 0.6624, 0.3934, 0.6821]}, {"w": "validation", "b": [0.3997, 0.6624, 0.5006, 0.6821]}, {"w": "accuracy", "b": [0.5069, 0.6624, 0.5965, 0.6821]}, {"w": "without", "b": [0.6028, 0.6624, 0.6799, 0.6821]}, {"w": "using", "b": [0.6862, 0.6624, 0.7409, 0.6821]}, {"w": "pretrained", "b": [0.1483, 0.6829, 0.2506, 0.7026]}, {"w": "word", "b": [0.2569, 0.6829, 0.3087, 0.7026]}, {"w": "embeddings", "b": [0.315, 0.6829, 0.437, 0.7026]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure 6.9. A recurrent network: a network with a loop", "words": [{"w": "Figure", "b": [0.1483, 0.7105, 0.2142, 0.7302]}, {"w": "6.9.", "b": [0.2205, 0.7105, 0.2583, 0.7302]}, {"w": "A", "b": [0.2646, 0.7105, 0.2829, 0.7302]}, {"w": "recurrent", "b": [0.2892, 0.7105, 0.3802, 0.7302]}, {"w": "network:", "b": [0.3865, 0.7105, 0.4762, 0.7302]}, {"w": "a", "b": [0.4825, 0.7105, 0.4937, 0.7302]}, {"w": "network", "b": [0.5, 0.7105, 0.5827, 0.7302]}, {"w": "with", "b": [0.589, 0.7105, 0.6338, 0.7302]}, {"w": "a", "b": [0.6401, 0.7105, 0.6513, 0.7302]}, {"w": "loop", "b": [0.6576, 0.7105, 0.7025, 0.7302]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure 6.10. A simple RNN, unrolled over time", "words": [{"w": "Figure", "b": [0.1483, 0.7381, 0.2142, 0.7579]}, {"w": "6.10.", "b": [0.2205, 0.7381, 0.271, 0.7579]}, {"w": "A", "b": [0.2773, 0.7381, 0.2955, 0.7579]}, {"w": "simple", "b": [0.3018, 0.7381, 0.3691, 0.7579]}, {"w": "RNN,", "b": [0.3754, 0.7381, 0.4349, 0.7579]}, {"w": "unrolled", "b": [0.4412, 0.7381, 0.5253, 0.7579]}, {"w": "over", "b": [0.5316, 0.7381, 0.5764, 0.7579]}, {"w": "time", "b": [0.5827, 0.7381, 0.6276, 0.7579]}]}, {"id": "b_17", "type": "paragraph", "text": "Figure 6.11. Training and validation loss on IMDB with simplernn", "words": [{"w": "Figure", "b": [0.1483, 0.7658, 0.2142, 0.7855]}, {"w": "6.11.", "b": [0.2205, 0.7658, 0.27, 0.7855]}, {"w": "Training", "b": [0.2763, 0.7658, 0.3623, 0.7855]}, {"w": "and", "b": [0.3686, 0.7658, 0.405, 0.7855]}, {"w": "validation", "b": [0.4113, 0.7658, 0.5122, 0.7855]}, {"w": "loss", "b": [0.5186, 0.7658, 0.5578, 0.7855]}, {"w": "on", "b": [0.5641, 0.7658, 0.5893, 0.7855]}, {"w": "IMDB", "b": [0.5956, 0.7658, 0.6615, 0.7855]}, {"w": "with", "b": [0.6678, 0.7658, 0.7127, 0.7855]}, {"w": "simplernn", "b": [0.719, 0.7658, 0.8199, 0.7855]}]}, {"id": "b_18", "type": "paragraph", "text": "Figure 6.12. Training and validation accuracy on IMDB with simplernn", "words": [{"w": "Figure", "b": [0.1483, 0.7934, 0.2142, 0.8131]}, {"w": "6.12.", "b": [0.2205, 0.7934, 0.271, 0.8131]}, {"w": "Training", "b": [0.2773, 0.7934, 0.3632, 0.8131]}, {"w": "and", "b": [0.3695, 0.7934, 0.406, 0.8131]}, {"w": "validation", "b": [0.4123, 0.7934, 0.5132, 0.8131]}, {"w": "accuracy", "b": [0.5195, 0.7934, 0.6091, 0.8131]}, {"w": "on", "b": [0.6154, 0.7934, 0.6407, 0.8131]}, {"w": "IMDB", "b": [0.647, 0.7934, 0.7128, 0.8131]}, {"w": "with", "b": [0.7191, 0.7934, 0.764, 0.8131]}, {"w": "simplernn", "b": [0.1483, 0.8139, 0.2492, 0.8336]}]}, {"id": "b_19", "type": "paragraph", "text": "Figure 6.13. The starting point of an lstm layer: a simplernn", "words": [{"w": "Figure", "b": [0.1483, 0.8415, 0.2142, 0.8613]}, {"w": "6.13.", "b": [0.2205, 0.8415, 0.271, 0.8613]}, {"w": "The", "b": [0.2773, 0.8415, 0.3165, 0.8613]}, {"w": "starting", "b": [0.3228, 0.8415, 0.3985, 0.8613]}, {"w": "point", "b": [0.4048, 0.8415, 0.4566, 0.8613]}, {"w": "of", "b": [0.4629, 0.8415, 0.484, 0.8613]}, {"w": "an", "b": [0.4903, 0.8415, 0.5141, 0.8613]}, {"w": "lstm", "b": [0.5204, 0.8415, 0.5639, 0.8613]}, {"w": "layer:", "b": [0.5702, 0.8415, 0.6276, 0.8613]}, {"w": "a", "b": [0.6339, 0.8415, 0.6451, 0.8613]}, {"w": "simplernn", "b": [0.6514, 0.8415, 0.7523, 0.8613]}]}, {"id": "b_20", "type": "paragraph", "text": "Figure 6.14. Going from a simplernn to an lstm: adding a carry track", "words": [{"w": "Figure", "b": [0.1483, 0.8691, 0.2142, 0.8889]}, {"w": "6.14.", "b": [0.2205, 0.8691, 0.271, 0.8889]}, {"w": "Going", "b": [0.2773, 0.8691, 0.3403, 0.8889]}, {"w": "from", "b": [0.3466, 0.8691, 0.3957, 0.8889]}, {"w": "a", "b": [0.402, 0.8691, 0.4132, 0.8889]}, {"w": "simplernn", "b": [0.4195, 0.8691, 0.5204, 0.8889]}, {"w": "to", "b": [0.5267, 0.8691, 0.5463, 0.8889]}, {"w": "an", "b": [0.5526, 0.8691, 0.5764, 0.8889]}, {"w": "lstm:", "b": [0.5827, 0.8691, 0.6332, 0.8889]}, {"w": "adding", "b": [0.6395, 0.8691, 0.7082, 0.8889]}, {"w": "a", "b": [0.7145, 0.8691, 0.7257, 0.8889]}, {"w": "carry", "b": [0.732, 0.8691, 0.7838, 0.8889]}, {"w": "track", "b": [0.7901, 0.8691, 0.8406, 0.8889]}]}]}, {"page": 481, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 6.15. Anatomy of an lstm", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "6.15.", "b": [0.2205, 0.0857, 0.271, 0.1054]}, {"w": "Anatomy", "b": [0.2773, 0.0857, 0.3712, 0.1054]}, {"w": "of", "b": [0.3775, 0.0857, 0.3985, 0.1054]}, {"w": "an", "b": [0.4048, 0.0857, 0.4286, 0.1054]}, {"w": "lstm", "b": [0.4349, 0.0857, 0.4784, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 6.16. Training and validation loss on IMDB with LSTM", "words": [{"w": "Figure", "b": [0.1483, 0.1133, 0.2142, 0.133]}, {"w": "6.16.", "b": [0.2205, 0.1133, 0.271, 0.133]}, {"w": "Training", "b": [0.2773, 0.1133, 0.3632, 0.133]}, {"w": "and", "b": [0.3695, 0.1133, 0.406, 0.133]}, {"w": "validation", "b": [0.4123, 0.1133, 0.5132, 0.133]}, {"w": "loss", "b": [0.5195, 0.1133, 0.5587, 0.133]}, {"w": "on", "b": [0.565, 0.1133, 0.5903, 0.133]}, {"w": "IMDB", "b": [0.5966, 0.1133, 0.6624, 0.133]}, {"w": "with", "b": [0.6688, 0.1133, 0.7136, 0.133]}, {"w": "LSTM", "b": [0.7199, 0.1133, 0.7872, 0.133]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 6.17. Training and validation accuracy on IMDB with LSTM", "words": [{"w": "Figure", "b": [0.1483, 0.1409, 0.2142, 0.1607]}, {"w": "6.17.", "b": [0.2205, 0.1409, 0.271, 0.1607]}, {"w": "Training", "b": [0.2773, 0.1409, 0.3632, 0.1607]}, {"w": "and", "b": [0.3695, 0.1409, 0.406, 0.1607]}, {"w": "validation", "b": [0.4123, 0.1409, 0.5132, 0.1607]}, {"w": "accuracy", "b": [0.5195, 0.1409, 0.6091, 0.1607]}, {"w": "on", "b": [0.6154, 0.1409, 0.6407, 0.1607]}, {"w": "IMDB", "b": [0.647, 0.1409, 0.7128, 0.1607]}, {"w": "with", "b": [0.7191, 0.1409, 0.764, 0.1607]}, {"w": "LSTM", "b": [0.7703, 0.1409, 0.8376, 0.1607]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 6.18. Temperature over the full temporal range of the dataset (°C)", "words": [{"w": "Figure", "b": [0.1483, 0.1686, 0.2142, 0.1883]}, {"w": "6.18.", "b": [0.2205, 0.1686, 0.271, 0.1883]}, {"w": "Temperature", "b": [0.2773, 0.1686, 0.4044, 0.1883]}, {"w": "over", "b": [0.4107, 0.1686, 0.4555, 0.1883]}, {"w": "the", "b": [0.4618, 0.1686, 0.4926, 0.1883]}, {"w": "full", "b": [0.4989, 0.1686, 0.534, 0.1883]}, {"w": "temporal", "b": [0.5403, 0.1686, 0.63, 0.1883]}, {"w": "range", "b": [0.6363, 0.1686, 0.6923, 0.1883]}, {"w": "of", "b": [0.6986, 0.1686, 0.7196, 0.1883]}, {"w": "the", "b": [0.7259, 0.1686, 0.7567, 0.1883]}, {"w": "dataset", "b": [0.7631, 0.1686, 0.8331, 0.1883]}, {"w": "(°C)", "b": [0.1483, 0.1891, 0.192, 0.2088]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 6.19. Temperature over the first 10 days of the dataset (°C)", "words": [{"w": "Figure", "b": [0.1483, 0.2167, 0.2142, 0.2364]}, {"w": "6.19.", "b": [0.2205, 0.2167, 0.271, 0.2364]}, {"w": "Temperature", "b": [0.2773, 0.2167, 0.4044, 0.2364]}, {"w": "over", "b": [0.4107, 0.2167, 0.4555, 0.2364]}, {"w": "the", "b": [0.4618, 0.2167, 0.4926, 0.2364]}, {"w": "first", "b": [0.4989, 0.2167, 0.5396, 0.2364]}, {"w": "10", "b": [0.5459, 0.2167, 0.5711, 0.2364]}, {"w": "days", "b": [0.5774, 0.2167, 0.6237, 0.2364]}, {"w": "of", "b": [0.63, 0.2167, 0.651, 0.2364]}, {"w": "the", "b": [0.6573, 0.2167, 0.6881, 0.2364]}, {"w": "dataset", "b": [0.6944, 0.2167, 0.7645, 0.2364]}, {"w": "(°C)", "b": [0.7708, 0.2167, 0.8145, 0.2364]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 6.20. Training and validation loss on the Jena temperature- forecasting task with a simple, densely connected network", "words": [{"w": "Figure", "b": [0.1483, 0.2443, 0.2142, 0.2641]}, {"w": "6.20.", "b": [0.2205, 0.2443, 0.271, 0.2641]}, {"w": "Training", "b": [0.2773, 0.2443, 0.3632, 0.2641]}, {"w": "and", "b": [0.3695, 0.2443, 0.406, 0.2641]}, {"w": "validation", "b": [0.4123, 0.2443, 0.5132, 0.2641]}, {"w": "loss", "b": [0.5195, 0.2443, 0.5587, 0.2641]}, {"w": "on", "b": [0.565, 0.2443, 0.5903, 0.2641]}, {"w": "the", "b": [0.5966, 0.2443, 0.6274, 0.2641]}, {"w": "Jena", "b": [0.6337, 0.2443, 0.6785, 0.2641]}, {"w": "temperature-", "b": [0.6848, 0.2443, 0.8137, 0.2641]}, {"w": "forecasting", "b": [0.1483, 0.2648, 0.2604, 0.2846]}, {"w": "task", "b": [0.2667, 0.2648, 0.3074, 0.2846]}, {"w": "with", "b": [0.3137, 0.2648, 0.3585, 0.2846]}, {"w": "a", "b": [0.3648, 0.2648, 0.376, 0.2846]}, {"w": "simple,", "b": [0.3823, 0.2648, 0.4559, 0.2846]}, {"w": "densely", "b": [0.4622, 0.2648, 0.5393, 0.2846]}, {"w": "connected", "b": [0.5456, 0.2648, 0.6479, 0.2846]}, {"w": "network", "b": [0.6542, 0.2648, 0.7368, 0.2846]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 6.21. Training and validation loss on the Jena temperature- forecasting task with a GRU", "words": [{"w": "Figure", "b": [0.1483, 0.2925, 0.2142, 0.3122]}, {"w": "6.21.", "b": [0.2205, 0.2925, 0.271, 0.3122]}, {"w": "Training", "b": [0.2773, 0.2925, 0.3632, 0.3122]}, {"w": "and", "b": [0.3695, 0.2925, 0.406, 0.3122]}, {"w": "validation", "b": [0.4123, 0.2925, 0.5132, 0.3122]}, {"w": "loss", "b": [0.5195, 0.2925, 0.5587, 0.3122]}, {"w": "on", "b": [0.565, 0.2925, 0.5903, 0.3122]}, {"w": "the", "b": [0.5966, 0.2925, 0.6274, 0.3122]}, {"w": "Jena", "b": [0.6337, 0.2925, 0.6785, 0.3122]}, {"w": "temperature-", "b": [0.6848, 0.2925, 0.8137, 0.3122]}, {"w": "forecasting", "b": [0.1483, 0.313, 0.2604, 0.3327]}, {"w": "task", "b": [0.2667, 0.313, 0.3074, 0.3327]}, {"w": "with", "b": [0.3137, 0.313, 0.3585, 0.3327]}, {"w": "a", "b": [0.3648, 0.313, 0.376, 0.3327]}, {"w": "GRU", "b": [0.3823, 0.313, 0.4356, 0.3327]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 6.22. Training and validation loss on the Jena temperature- forecasting task with a dropout-regularized GRU", "words": [{"w": "Figure", "b": [0.1483, 0.3406, 0.2142, 0.3603]}, {"w": "6.22.", "b": [0.2205, 0.3406, 0.271, 0.3603]}, {"w": "Training", "b": [0.2773, 0.3406, 0.3632, 0.3603]}, {"w": "and", "b": [0.3695, 0.3406, 0.406, 0.3603]}, {"w": "validation", "b": [0.4123, 0.3406, 0.5132, 0.3603]}, {"w": "loss", "b": [0.5195, 0.3406, 0.5587, 0.3603]}, {"w": "on", "b": [0.565, 0.3406, 0.5903, 0.3603]}, {"w": "the", "b": [0.5966, 0.3406, 0.6274, 0.3603]}, {"w": "Jena", "b": [0.6337, 0.3406, 0.6785, 0.3603]}, {"w": "temperature-", "b": [0.6848, 0.3406, 0.8137, 0.3603]}, {"w": "forecasting", "b": [0.1483, 0.3611, 0.2604, 0.3808]}, {"w": "task", "b": [0.2667, 0.3611, 0.3074, 0.3808]}, {"w": "with", "b": [0.3137, 0.3611, 0.3585, 0.3808]}, {"w": "a", "b": [0.3648, 0.3611, 0.376, 0.3808]}, {"w": "dropout-regularized", "b": [0.3823, 0.3611, 0.5827, 0.3808]}, {"w": "GRU", "b": [0.589, 0.3611, 0.6422, 0.3808]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 6.23. Training and validation loss on the Jena temperature- forecasting task with a stacked GRU network", "words": [{"w": "Figure", "b": [0.1483, 0.3887, 0.2142, 0.4085]}, {"w": "6.23.", "b": [0.2205, 0.3887, 0.271, 0.4085]}, {"w": "Training", "b": [0.2773, 0.3887, 0.3632, 0.4085]}, {"w": "and", "b": [0.3695, 0.3887, 0.406, 0.4085]}, {"w": "validation", "b": [0.4123, 0.3887, 0.5132, 0.4085]}, {"w": "loss", "b": [0.5195, 0.3887, 0.5587, 0.4085]}, {"w": "on", "b": [0.565, 0.3887, 0.5903, 0.4085]}, {"w": "the", "b": [0.5966, 0.3887, 0.6274, 0.4085]}, {"w": "Jena", "b": [0.6337, 0.3887, 0.6785, 0.4085]}, {"w": "temperature-", "b": [0.6848, 0.3887, 0.8137, 0.4085]}, {"w": "forecasting", "b": [0.1483, 0.4092, 0.2604, 0.429]}, {"w": "task", "b": [0.2667, 0.4092, 0.3074, 0.429]}, {"w": "with", "b": [0.3137, 0.4092, 0.3585, 0.429]}, {"w": "a", "b": [0.3648, 0.4092, 0.376, 0.429]}, {"w": "stacked", "b": [0.3823, 0.4092, 0.458, 0.429]}, {"w": "GRU", "b": [0.4643, 0.4092, 0.5175, 0.429]}, {"w": "network", "b": [0.5238, 0.4092, 0.6065, 0.429]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure 6.24. Training and validation loss on the Jena temperature- forecasting task with a GRU trained on reversed sequences", "words": [{"w": "Figure", "b": [0.1483, 0.4369, 0.2142, 0.4566]}, {"w": "6.24.", "b": [0.2205, 0.4369, 0.271, 0.4566]}, {"w": "Training", "b": [0.2773, 0.4369, 0.3632, 0.4566]}, {"w": "and", "b": [0.3695, 0.4369, 0.406, 0.4566]}, {"w": "validation", "b": [0.4123, 0.4369, 0.5132, 0.4566]}, {"w": "loss", "b": [0.5195, 0.4369, 0.5587, 0.4566]}, {"w": "on", "b": [0.565, 0.4369, 0.5903, 0.4566]}, {"w": "the", "b": [0.5966, 0.4369, 0.6274, 0.4566]}, {"w": "Jena", "b": [0.6337, 0.4369, 0.6785, 0.4566]}, {"w": "temperature-", "b": [0.6848, 0.4369, 0.8137, 0.4566]}, {"w": "forecasting", "b": [0.1483, 0.4574, 0.2604, 0.4771]}, {"w": "task", "b": [0.2667, 0.4574, 0.3074, 0.4771]}, {"w": "with", "b": [0.3137, 0.4574, 0.3585, 0.4771]}, {"w": "a", "b": [0.3648, 0.4574, 0.376, 0.4771]}, {"w": "GRU", "b": [0.3823, 0.4574, 0.4356, 0.4771]}, {"w": "trained", "b": [0.4419, 0.4574, 0.5119, 0.4771]}, {"w": "on", "b": [0.5182, 0.4574, 0.5435, 0.4771]}, {"w": "reversed", "b": [0.5498, 0.4574, 0.6352, 0.4771]}, {"w": "sequences", "b": [0.6415, 0.4574, 0.7438, 0.4771]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 6.25. How a bidirectional RNN layer works", "words": [{"w": "Figure", "b": [0.1483, 0.485, 0.2142, 0.5047]}, {"w": "6.25.", "b": [0.2205, 0.485, 0.271, 0.5047]}, {"w": "How", "b": [0.2773, 0.485, 0.3263, 0.5047]}, {"w": "a", "b": [0.3326, 0.485, 0.3438, 0.5047]}, {"w": "bidirectional", "b": [0.3501, 0.485, 0.4776, 0.5047]}, {"w": "RNN", "b": [0.4839, 0.485, 0.5372, 0.5047]}, {"w": "layer", "b": [0.5435, 0.485, 0.5939, 0.5047]}, {"w": "works", "b": [0.6002, 0.485, 0.6619, 0.5047]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure 6.26. How 1D convolution works: each output timestep is obtained from a temporal patch in the input sequence.", "words": [{"w": "Figure", "b": [0.1483, 0.5126, 0.2142, 0.5324]}, {"w": "6.26.", "b": [0.2205, 0.5126, 0.271, 0.5324]}, {"w": "How", "b": [0.2773, 0.5126, 0.3263, 0.5324]}, {"w": "1D", "b": [0.3326, 0.5126, 0.3634, 0.5324]}, {"w": "convolution", "b": [0.3697, 0.5126, 0.4903, 0.5324]}, {"w": "works:", "b": [0.4966, 0.5126, 0.5652, 0.5324]}, {"w": "each", "b": [0.5715, 0.5126, 0.6178, 0.5324]}, {"w": "output", "b": [0.6241, 0.5126, 0.6885, 0.5324]}, {"w": "timestep", "b": [0.6948, 0.5126, 0.7803, 0.5324]}, {"w": "is", "b": [0.7866, 0.5126, 0.8035, 0.5324]}, {"w": "obtained", "b": [0.1483, 0.5331, 0.2352, 0.5529]}, {"w": "from", "b": [0.2415, 0.5331, 0.2906, 0.5529]}, {"w": "a", "b": [0.2969, 0.5331, 0.3081, 0.5529]}, {"w": "temporal", "b": [0.3144, 0.5331, 0.404, 0.5529]}, {"w": "patch", "b": [0.4104, 0.5331, 0.465, 0.5529]}, {"w": "in", "b": [0.4713, 0.5331, 0.4909, 0.5529]}, {"w": "the", "b": [0.4972, 0.5331, 0.5281, 0.5529]}, {"w": "input", "b": [0.5344, 0.5331, 0.5862, 0.5529]}, {"w": "sequence.", "b": [0.5925, 0.5331, 0.6913, 0.5529]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure 6.27. Training and validation loss on IMDB with a simple 1D convnet", "words": [{"w": "Figure", "b": [0.1483, 0.5607, 0.2142, 0.5805]}, {"w": "6.27.", "b": [0.2205, 0.5607, 0.271, 0.5805]}, {"w": "Training", "b": [0.2773, 0.5607, 0.3632, 0.5805]}, {"w": "and", "b": [0.3695, 0.5607, 0.406, 0.5805]}, {"w": "validation", "b": [0.4123, 0.5607, 0.5132, 0.5805]}, {"w": "loss", "b": [0.5195, 0.5607, 0.5587, 0.5805]}, {"w": "on", "b": [0.565, 0.5607, 0.5903, 0.5805]}, {"w": "IMDB", "b": [0.5966, 0.5607, 0.6624, 0.5805]}, {"w": "with", "b": [0.6688, 0.5607, 0.7136, 0.5805]}, {"w": "a", "b": [0.7199, 0.5607, 0.7311, 0.5805]}, {"w": "simple", "b": [0.7374, 0.5607, 0.8047, 0.5805]}, {"w": "1D", "b": [0.811, 0.5607, 0.8418, 0.5805]}, {"w": "convnet", "b": [0.1483, 0.5812, 0.2282, 0.601]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure 6.28. Training and validation accuracy on IMDB with a simple 1D convnet", "words": [{"w": "Figure", "b": [0.1483, 0.6089, 0.2142, 0.6286]}, {"w": "6.28.", "b": [0.2205, 0.6089, 0.271, 0.6286]}, {"w": "Training", "b": [0.2773, 0.6089, 0.3632, 0.6286]}, {"w": "and", "b": [0.3695, 0.6089, 0.406, 0.6286]}, {"w": "validation", "b": [0.4123, 0.6089, 0.5132, 0.6286]}, {"w": "accuracy", "b": [0.5195, 0.6089, 0.6091, 0.6286]}, {"w": "on", "b": [0.6154, 0.6089, 0.6407, 0.6286]}, {"w": "IMDB", "b": [0.647, 0.6089, 0.7128, 0.6286]}, {"w": "with", "b": [0.7191, 0.6089, 0.764, 0.6286]}, {"w": "a", "b": [0.7703, 0.6089, 0.7815, 0.6286]}, {"w": "simple", "b": [0.1483, 0.6294, 0.2156, 0.6491]}, {"w": "1D", "b": [0.2219, 0.6294, 0.2527, 0.6491]}, {"w": "convnet", "b": [0.259, 0.6294, 0.3389, 0.6491]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure 6.29. Training and validation loss on the Jena temperature- forecasting task with a simple 1D convnet", "words": [{"w": "Figure", "b": [0.1483, 0.657, 0.2142, 0.6768]}, {"w": "6.29.", "b": [0.2205, 0.657, 0.271, 0.6768]}, {"w": "Training", "b": [0.2773, 0.657, 0.3632, 0.6768]}, {"w": "and", "b": [0.3695, 0.657, 0.406, 0.6768]}, {"w": "validation", "b": [0.4123, 0.657, 0.5132, 0.6768]}, {"w": "loss", "b": [0.5195, 0.657, 0.5587, 0.6768]}, {"w": "on", "b": [0.565, 0.657, 0.5903, 0.6768]}, {"w": "the", "b": [0.5966, 0.657, 0.6274, 0.6768]}, {"w": "Jena", "b": [0.6337, 0.657, 0.6785, 0.6768]}, {"w": "temperature-", "b": [0.6848, 0.657, 0.8137, 0.6768]}, {"w": "forecasting", "b": [0.1483, 0.6775, 0.2604, 0.6973]}, {"w": "task", "b": [0.2667, 0.6775, 0.3074, 0.6973]}, {"w": "with", "b": [0.3137, 0.6775, 0.3585, 0.6973]}, {"w": "a", "b": [0.3648, 0.6775, 0.376, 0.6973]}, {"w": "simple", "b": [0.3823, 0.6775, 0.4496, 0.6973]}, {"w": "1D", "b": [0.4559, 0.6775, 0.4867, 0.6973]}, {"w": "convnet", "b": [0.493, 0.6775, 0.5729, 0.6973]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure 6.30. Combining a 1D convnet and an RNN for processing long sequences", "words": [{"w": "Figure", "b": [0.1483, 0.7051, 0.2142, 0.7249]}, {"w": "6.30.", "b": [0.2205, 0.7051, 0.271, 0.7249]}, {"w": "Combining", "b": [0.2773, 0.7051, 0.3908, 0.7249]}, {"w": "a", "b": [0.3971, 0.7051, 0.4083, 0.7249]}, {"w": "1D", "b": [0.4146, 0.7051, 0.4454, 0.7249]}, {"w": "convnet", "b": [0.4517, 0.7051, 0.5316, 0.7249]}, {"w": "and", "b": [0.5379, 0.7051, 0.5743, 0.7249]}, {"w": "an", "b": [0.5807, 0.7051, 0.6045, 0.7249]}, {"w": "RNN", "b": [0.6108, 0.7051, 0.664, 0.7249]}, {"w": "for", "b": [0.6703, 0.7051, 0.6997, 0.7249]}, {"w": "processing", "b": [0.706, 0.7051, 0.8139, 0.7249]}, {"w": "long", "b": [0.1483, 0.7256, 0.1932, 0.7454]}, {"w": "sequences", "b": [0.1995, 0.7256, 0.3018, 0.7454]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure 6.31. Training and validation loss on the Jena temperature- forecasting task with a 1D convnet followed by a gru", "words": [{"w": "Figure", "b": [0.1483, 0.7533, 0.2142, 0.773]}, {"w": "6.31.", "b": [0.2205, 0.7533, 0.271, 0.773]}, {"w": "Training", "b": [0.2773, 0.7533, 0.3632, 0.773]}, {"w": "and", "b": [0.3695, 0.7533, 0.406, 0.773]}, {"w": "validation", "b": [0.4123, 0.7533, 0.5132, 0.773]}, {"w": "loss", "b": [0.5195, 0.7533, 0.5587, 0.773]}, {"w": "on", "b": [0.565, 0.7533, 0.5903, 0.773]}, {"w": "the", "b": [0.5966, 0.7533, 0.6274, 0.773]}, {"w": "Jena", "b": [0.6337, 0.7533, 0.6785, 0.773]}, {"w": "temperature-", "b": [0.6848, 0.7533, 0.8137, 0.773]}, {"w": "forecasting", "b": [0.1483, 0.7738, 0.2604, 0.7935]}, {"w": "task", "b": [0.2667, 0.7738, 0.3074, 0.7935]}, {"w": "with", "b": [0.3137, 0.7738, 0.3585, 0.7935]}, {"w": "a", "b": [0.3648, 0.7738, 0.376, 0.7935]}, {"w": "1D", "b": [0.3823, 0.7738, 0.4132, 0.7935]}, {"w": "convnet", "b": [0.4195, 0.7738, 0.4993, 0.7935]}, {"w": "followed", "b": [0.5056, 0.7738, 0.5953, 0.7935]}, {"w": "by", "b": [0.6016, 0.7738, 0.6268, 0.7935]}, {"w": "a", "b": [0.6331, 0.7738, 0.6443, 0.7935]}, {"w": "gru", "b": [0.6507, 0.7738, 0.6843, 0.7935]}]}, {"id": "b_18", "type": "equation", "text": "Chapter 7. Advanced deep-learning best practices", "words": [{"w": "Chapter", "b": [0.1294, 0.8166, 0.2093, 0.8363]}, {"w": "7.", "b": [0.2156, 0.8166, 0.2345, 0.8363]}, {"w": "Advanced", "b": [0.2408, 0.8166, 0.3431, 0.8363]}, {"w": "deep-learning", "b": [0.3494, 0.8166, 0.4881, 0.8363]}, {"w": "best", "b": [0.4944, 0.8166, 0.535, 0.8363]}, {"w": "practices", "b": [0.5413, 0.8166, 0.631, 0.8363]}]}, {"id": "b_19", "type": "paragraph", "text": "Figure 7.1. A sequential model: a linear stack of layers", "words": [{"w": "Figure", "b": [0.1483, 0.8549, 0.2142, 0.8746]}, {"w": "7.1.", "b": [0.2205, 0.8549, 0.2583, 0.8746]}, {"w": "A", "b": [0.2646, 0.8549, 0.2829, 0.8746]}, {"w": "sequential", "b": [0.2892, 0.8549, 0.3915, 0.8746]}, {"w": "model:", "b": [0.3978, 0.8549, 0.4678, 0.8746]}, {"w": "a", "b": [0.4741, 0.8549, 0.4853, 0.8746]}, {"w": "linear", "b": [0.4917, 0.8549, 0.5491, 0.8746]}, {"w": "stack", "b": [0.5554, 0.8549, 0.6072, 0.8746]}, {"w": "of", "b": [0.6135, 0.8549, 0.6346, 0.8746]}, {"w": "layers", "b": [0.6409, 0.8549, 0.7011, 0.8746]}]}, {"id": "b_20", "type": "equation", "text": "Figure 7.2. A multi-input model", "words": [{"w": "Figure", "b": [0.1483, 0.8825, 0.2142, 0.9023]}, {"w": "7.2.", "b": [0.2205, 0.8825, 0.2583, 0.9023]}, {"w": "A", "b": [0.2646, 0.8825, 0.2829, 0.9023]}, {"w": "multi-input", "b": [0.2892, 0.8825, 0.4027, 0.9023]}, {"w": "model", "b": [0.409, 0.8825, 0.4721, 0.9023]}]}]}, {"page": 482, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Figure 7.3. A multi-output (or multihead) model", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "7.3.", "b": [0.2205, 0.0857, 0.2583, 0.1054]}, {"w": "A", "b": [0.2646, 0.0857, 0.2829, 0.1054]}, {"w": "multi-output", "b": [0.2892, 0.0857, 0.4153, 0.1054]}, {"w": "(or", "b": [0.4216, 0.0857, 0.451, 0.1054]}, {"w": "multihead)", "b": [0.4573, 0.0857, 0.5667, 0.1054]}, {"w": "model", "b": [0.573, 0.0857, 0.636, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 7.4. An Inception module: a subgraph of layers with several parallel convolutional branches", "words": [{"w": "Figure", "b": [0.1483, 0.1133, 0.2142, 0.133]}, {"w": "7.4.", "b": [0.2205, 0.1133, 0.2583, 0.133]}, {"w": "An", "b": [0.2646, 0.1133, 0.2955, 0.133]}, {"w": "Inception", "b": [0.3018, 0.1133, 0.3971, 0.133]}, {"w": "module:", "b": [0.4034, 0.1133, 0.4861, 0.133]}, {"w": "a", "b": [0.4924, 0.1133, 0.5036, 0.133]}, {"w": "subgraph", "b": [0.5099, 0.1133, 0.6023, 0.133]}, {"w": "of", "b": [0.6087, 0.1133, 0.6297, 0.133]}, {"w": "layers", "b": [0.636, 0.1133, 0.6962, 0.133]}, {"w": "with", "b": [0.7025, 0.1133, 0.7474, 0.133]}, {"w": "several", "b": [0.7537, 0.1133, 0.8251, 0.133]}, {"w": "parallel", "b": [0.1483, 0.1338, 0.224, 0.1535]}, {"w": "convolutional", "b": [0.2303, 0.1338, 0.369, 0.1535]}, {"w": "branches", "b": [0.3753, 0.1338, 0.465, 0.1535]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 7.5. A residual connection: reinjection of prior information downstream via feature-map addition", "words": [{"w": "Figure", "b": [0.1483, 0.1614, 0.2142, 0.1812]}, {"w": "7.5.", "b": [0.2205, 0.1614, 0.2583, 0.1812]}, {"w": "A", "b": [0.2646, 0.1614, 0.2829, 0.1812]}, {"w": "residual", "b": [0.2892, 0.1614, 0.369, 0.1812]}, {"w": "connection:", "b": [0.3753, 0.1614, 0.493, 0.1812]}, {"w": "reinjection", "b": [0.4993, 0.1614, 0.6072, 0.1812]}, {"w": "of", "b": [0.6135, 0.1614, 0.6346, 0.1812]}, {"w": "prior", "b": [0.6409, 0.1614, 0.6899, 0.1812]}, {"w": "information", "b": [0.6962, 0.1614, 0.8153, 0.1812]}, {"w": "downstream", "b": [0.1483, 0.1819, 0.2716, 0.2017]}, {"w": "via", "b": [0.2779, 0.1819, 0.3088, 0.2017]}, {"w": "feature-map", "b": [0.3151, 0.1819, 0.4369, 0.2017]}, {"w": "addition", "b": [0.4432, 0.1819, 0.5259, 0.2017]}]}, {"id": "b_3", "type": "equation", "text": "Figure 7.6. A question-answering model", "words": [{"w": "Figure", "b": [0.1483, 0.2096, 0.2142, 0.2293]}, {"w": "7.6.", "b": [0.2205, 0.2096, 0.2583, 0.2293]}, {"w": "A", "b": [0.2646, 0.2096, 0.2829, 0.2293]}, {"w": "question-answering", "b": [0.2892, 0.2096, 0.4867, 0.2293]}, {"w": "model", "b": [0.493, 0.2096, 0.5561, 0.2293]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 7.7. A social media model with three heads", "words": [{"w": "Figure", "b": [0.1483, 0.2372, 0.2142, 0.2569]}, {"w": "7.7.", "b": [0.2205, 0.2372, 0.2583, 0.2569]}, {"w": "A", "b": [0.2646, 0.2372, 0.2829, 0.2569]}, {"w": "social", "b": [0.2892, 0.2372, 0.348, 0.2569]}, {"w": "media", "b": [0.3543, 0.2372, 0.416, 0.2569]}, {"w": "model", "b": [0.4223, 0.2372, 0.4853, 0.2569]}, {"w": "with", "b": [0.4917, 0.2372, 0.5365, 0.2569]}, {"w": "three", "b": [0.5428, 0.2372, 0.5932, 0.2569]}, {"w": "heads", "b": [0.5995, 0.2372, 0.657, 0.2569]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 7.8. An Inception module", "words": [{"w": "Figure", "b": [0.1483, 0.2648, 0.2142, 0.2846]}, {"w": "7.8.", "b": [0.2205, 0.2648, 0.2583, 0.2846]}, {"w": "An", "b": [0.2646, 0.2648, 0.2955, 0.2846]}, {"w": "Inception", "b": [0.3018, 0.2648, 0.3971, 0.2846]}, {"w": "module", "b": [0.4034, 0.2648, 0.479, 0.2846]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 7.9. The loop of progress", "words": [{"w": "Figure", "b": [0.1483, 0.2925, 0.2142, 0.3122]}, {"w": "7.9.", "b": [0.2205, 0.2925, 0.2583, 0.3122]}, {"w": "The", "b": [0.2646, 0.2925, 0.3039, 0.3122]}, {"w": "loop", "b": [0.3102, 0.2925, 0.355, 0.3122]}, {"w": "of", "b": [0.3613, 0.2925, 0.3824, 0.3122]}, {"w": "progress", "b": [0.3887, 0.2925, 0.4741, 0.3122]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 7.10. TensorBoard: metrics monitoring", "words": [{"w": "Figure", "b": [0.1483, 0.3201, 0.2142, 0.3398]}, {"w": "7.10.", "b": [0.2205, 0.3201, 0.271, 0.3398]}, {"w": "TensorBoard:", "b": [0.2773, 0.3201, 0.4142, 0.3398]}, {"w": "metrics", "b": [0.4205, 0.3201, 0.4948, 0.3398]}, {"w": "monitoring", "b": [0.5011, 0.3201, 0.6132, 0.3398]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 7.11. TensorBoard: activation histograms", "words": [{"w": "Figure", "b": [0.1483, 0.3477, 0.2142, 0.3675]}, {"w": "7.11.", "b": [0.2205, 0.3477, 0.27, 0.3675]}, {"w": "TensorBoard:", "b": [0.2763, 0.3477, 0.4133, 0.3675]}, {"w": "activation", "b": [0.4196, 0.3477, 0.5191, 0.3675]}, {"w": "histograms", "b": [0.5254, 0.3477, 0.6361, 0.3675]}]}, {"id": "b_9", "type": "equation", "text": "Figure 7.12. TensorBoard: interactive 3D word-embedding visualization", "words": [{"w": "Figure", "b": [0.1483, 0.3754, 0.2142, 0.3951]}, {"w": "7.12.", "b": [0.2205, 0.3754, 0.271, 0.3951]}, {"w": "TensorBoard:", "b": [0.2773, 0.3754, 0.4142, 0.3951]}, {"w": "interactive", "b": [0.4205, 0.3754, 0.527, 0.3951]}, {"w": "3D", "b": [0.5333, 0.3754, 0.5641, 0.3951]}, {"w": "word-embedding", "b": [0.5704, 0.3754, 0.7428, 0.3951]}, {"w": "visualization", "b": [0.1483, 0.3959, 0.2773, 0.4156]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 7.13. TensorBoard: TensorFlow graph visualization", "words": [{"w": "Figure", "b": [0.1483, 0.4235, 0.2142, 0.4432]}, {"w": "7.13.", "b": [0.2205, 0.4235, 0.271, 0.4432]}, {"w": "TensorBoard:", "b": [0.2773, 0.4235, 0.4142, 0.4432]}, {"w": "TensorFlow", "b": [0.4205, 0.4235, 0.5407, 0.4432]}, {"w": "graph", "b": [0.547, 0.4235, 0.6044, 0.4432]}, {"w": "visualization", "b": [0.6107, 0.4235, 0.7396, 0.4432]}]}, {"id": "b_11", "type": "equation", "text": "Figure 7.14. A model plot as a graph of layers, generated with plot_model", "words": [{"w": "Figure", "b": [0.1483, 0.4511, 0.2142, 0.4709]}, {"w": "7.14.", "b": [0.2205, 0.4511, 0.271, 0.4709]}, {"w": "A", "b": [0.2773, 0.4511, 0.2955, 0.4709]}, {"w": "model", "b": [0.3018, 0.4511, 0.3648, 0.4709]}, {"w": "plot", "b": [0.3712, 0.4511, 0.4104, 0.4709]}, {"w": "as", "b": [0.4167, 0.4511, 0.4377, 0.4709]}, {"w": "a", "b": [0.444, 0.4511, 0.4552, 0.4709]}, {"w": "graph", "b": [0.4615, 0.4511, 0.519, 0.4709]}, {"w": "of", "b": [0.5253, 0.4511, 0.5463, 0.4709]}, {"w": "layers,", "b": [0.5526, 0.4511, 0.6191, 0.4709]}, {"w": "generated", "b": [0.6255, 0.4511, 0.7235, 0.4709]}, {"w": "with", "b": [0.7298, 0.4511, 0.7747, 0.4709]}, {"w": "plot_model", "b": [0.1483, 0.4716, 0.2633, 0.4914]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure 7.15. A model plot with shape information", "words": [{"w": "Figure", "b": [0.1483, 0.4992, 0.2142, 0.519]}, {"w": "7.15.", "b": [0.2205, 0.4992, 0.271, 0.519]}, {"w": "A", "b": [0.2773, 0.4992, 0.2955, 0.519]}, {"w": "model", "b": [0.3018, 0.4992, 0.3648, 0.519]}, {"w": "plot", "b": [0.3712, 0.4992, 0.4104, 0.519]}, {"w": "with", "b": [0.4167, 0.4992, 0.4616, 0.519]}, {"w": "shape", "b": [0.4679, 0.4992, 0.5253, 0.519]}, {"w": "information", "b": [0.5316, 0.4992, 0.6507, 0.519]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure 7.16. Depthwise separable convolution: a depthwise convolution followed by a pointwise convolution", "words": [{"w": "Figure", "b": [0.1483, 0.5269, 0.2142, 0.5466]}, {"w": "7.16.", "b": [0.2205, 0.5269, 0.271, 0.5466]}, {"w": "Depthwise", "b": [0.2773, 0.5269, 0.3852, 0.5466]}, {"w": "separable", "b": [0.3915, 0.5269, 0.4867, 0.5466]}, {"w": "convolution:", "b": [0.493, 0.5269, 0.6206, 0.5466]}, {"w": "a", "b": [0.6269, 0.5269, 0.6381, 0.5466]}, {"w": "depthwise", "b": [0.6444, 0.5269, 0.7467, 0.5466]}, {"w": "convolution", "b": [0.1483, 0.5474, 0.2689, 0.5671]}, {"w": "followed", "b": [0.2752, 0.5474, 0.3648, 0.5671]}, {"w": "by", "b": [0.3712, 0.5474, 0.3964, 0.5671]}, {"w": "a", "b": [0.4027, 0.5474, 0.4139, 0.5671]}, {"w": "pointwise", "b": [0.4202, 0.5474, 0.5183, 0.5671]}, {"w": "convolution", "b": [0.5246, 0.5474, 0.6451, 0.5671]}]}, {"id": "b_15", "type": "paragraph", "text": "Chapter 8. Generative deep learning", "words": [{"w": "Chapter", "b": [0.1294, 0.5902, 0.2093, 0.6099]}, {"w": "8.", "b": [0.2156, 0.5902, 0.2345, 0.6099]}, {"w": "Generative", "b": [0.2408, 0.5902, 0.3515, 0.6099]}, {"w": "deep", "b": [0.3578, 0.5902, 0.4054, 0.6099]}, {"w": "learning", "b": [0.4117, 0.5902, 0.4944, 0.6099]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure 8.1. The process of character-by-character text generation using a language model", "words": [{"w": "Figure", "b": [0.1483, 0.6285, 0.2142, 0.6482]}, {"w": "8.1.", "b": [0.2205, 0.6285, 0.2583, 0.6482]}, {"w": "The", "b": [0.2646, 0.6285, 0.3039, 0.6482]}, {"w": "process", "b": [0.3102, 0.6285, 0.3858, 0.6482]}, {"w": "of", "b": [0.3921, 0.6285, 0.4132, 0.6482]}, {"w": "character-by-character", "b": [0.4195, 0.6285, 0.6458, 0.6482]}, {"w": "text", "b": [0.6521, 0.6285, 0.6899, 0.6482]}, {"w": "generation", "b": [0.6963, 0.6285, 0.8027, 0.6482]}, {"w": "using", "b": [0.1483, 0.649, 0.203, 0.6687]}, {"w": "a", "b": [0.2093, 0.649, 0.2205, 0.6687]}, {"w": "language", "b": [0.2268, 0.649, 0.3179, 0.6687]}, {"w": "model", "b": [0.3242, 0.649, 0.3872, 0.6687]}]}, {"id": "b_17", "type": "paragraph", "text": "Figure 8.2. Different reweightings of one probability distribution. Low temperature = more deterministic, high temperature = more random.", "words": [{"w": "Figure", "b": [0.1483, 0.6766, 0.2142, 0.6964]}, {"w": "8.2.", "b": [0.2205, 0.6766, 0.2583, 0.6964]}, {"w": "Different", "b": [0.2646, 0.6766, 0.3566, 0.6964]}, {"w": "reweightings", "b": [0.3629, 0.6766, 0.4933, 0.6964]}, {"w": "of", "b": [0.4996, 0.6766, 0.5206, 0.6964]}, {"w": "one", "b": [0.5269, 0.6766, 0.5633, 0.6964]}, {"w": "probability", "b": [0.5696, 0.6766, 0.6803, 0.6964]}, {"w": "distribution.", "b": [0.6866, 0.6766, 0.8093, 0.6964]}, {"w": "Low", "b": [0.1483, 0.6971, 0.1946, 0.7169]}, {"w": "temperature", "b": [0.2009, 0.6971, 0.3214, 0.7169]}, {"w": "=", "b": [0.3277, 0.6971, 0.3419, 0.7169]}, {"w": "more", "b": [0.3482, 0.6971, 0.4, 0.7169]}, {"w": "deterministic,", "b": [0.4063, 0.6971, 0.5444, 0.7169]}, {"w": "high", "b": [0.5507, 0.6971, 0.5955, 0.7169]}, {"w": "temperature", "b": [0.6018, 0.6971, 0.7223, 0.7169]}, {"w": "=", "b": [0.7285, 0.6971, 0.7428, 0.7169]}, {"w": "more", "b": [0.7491, 0.6971, 0.8009, 0.7169]}, {"w": "random.", "b": [0.1483, 0.7176, 0.2317, 0.7374]}]}, {"id": "b_18", "type": "paragraph", "text": "Figure 8.3. Example of a DeepDream output image", "words": [{"w": "Figure", "b": [0.1483, 0.7452, 0.2142, 0.765]}, {"w": "8.3.", "b": [0.2205, 0.7452, 0.2583, 0.765]}, {"w": "Example", "b": [0.2646, 0.7452, 0.3543, 0.765]}, {"w": "of", "b": [0.3606, 0.7452, 0.3816, 0.765]}, {"w": "a", "b": [0.388, 0.7452, 0.3992, 0.765]}, {"w": "DeepDream", "b": [0.4055, 0.7452, 0.5273, 0.765]}, {"w": "output", "b": [0.5336, 0.7452, 0.5981, 0.765]}, {"w": "image", "b": [0.6044, 0.7452, 0.6661, 0.765]}]}, {"id": "b_19", "type": "paragraph", "text": "Figure 8.4. The DeepDream process: successive scales of spatial processing (octaves) and detail reinjection upon upscaling", "words": [{"w": "Figure", "b": [0.1483, 0.7729, 0.2142, 0.7926]}, {"w": "8.4.", "b": [0.2205, 0.7729, 0.2583, 0.7926]}, {"w": "The", "b": [0.2646, 0.7729, 0.3039, 0.7926]}, {"w": "DeepDream", "b": [0.3102, 0.7729, 0.432, 0.7926]}, {"w": "process:", "b": [0.4384, 0.7729, 0.521, 0.7926]}, {"w": "successive", "b": [0.5273, 0.7729, 0.6338, 0.7926]}, {"w": "scales", "b": [0.6401, 0.7729, 0.7003, 0.7926]}, {"w": "of", "b": [0.7067, 0.7729, 0.7277, 0.7926]}, {"w": "spatial", "b": [0.734, 0.7729, 0.7998, 0.7926]}, {"w": "processing", "b": [0.1483, 0.7934, 0.2562, 0.8131]}, {"w": "(octaves)", "b": [0.2625, 0.7934, 0.355, 0.8131]}, {"w": "and", "b": [0.3613, 0.7934, 0.3977, 0.8131]}, {"w": "detail", "b": [0.404, 0.7934, 0.4601, 0.8131]}, {"w": "reinjection", "b": [0.4664, 0.7934, 0.5743, 0.8131]}, {"w": "upon", "b": [0.5806, 0.7934, 0.631, 0.8131]}, {"w": "upscaling", "b": [0.6373, 0.7934, 0.734, 0.8131]}]}, {"id": "b_20", "type": "paragraph", "text": "Figure 8.5. Running the DeepDream code on an example image", "words": [{"w": "Figure", "b": [0.1483, 0.821, 0.2142, 0.8408]}, {"w": "8.5.", "b": [0.2205, 0.821, 0.2583, 0.8408]}, {"w": "Running", "b": [0.2646, 0.821, 0.3516, 0.8408]}, {"w": "the", "b": [0.3579, 0.821, 0.3887, 0.8408]}, {"w": "DeepDream", "b": [0.395, 0.821, 0.5169, 0.8408]}, {"w": "code", "b": [0.5232, 0.821, 0.5708, 0.8408]}, {"w": "on", "b": [0.5771, 0.821, 0.6023, 0.8408]}, {"w": "an", "b": [0.6086, 0.821, 0.6324, 0.8408]}, {"w": "example", "b": [0.6387, 0.821, 0.7242, 0.8408]}, {"w": "image", "b": [0.7305, 0.821, 0.7922, 0.8408]}]}, {"id": "b_21", "type": "paragraph", "text": "Figure 8.6. Trying a range of DeepDream configurations on an example image", "words": [{"w": "Figure", "b": [0.1483, 0.8486, 0.2142, 0.8684]}, {"w": "8.6.", "b": [0.2205, 0.8486, 0.2583, 0.8684]}, {"w": "Trying", "b": [0.2646, 0.8486, 0.3324, 0.8684]}, {"w": "a", "b": [0.3387, 0.8486, 0.3499, 0.8684]}, {"w": "range", "b": [0.3562, 0.8486, 0.4123, 0.8684]}, {"w": "of", "b": [0.4186, 0.8486, 0.4396, 0.8684]}, {"w": "DeepDream", "b": [0.4459, 0.8486, 0.5677, 0.8684]}, {"w": "configurations", "b": [0.5741, 0.8486, 0.7198, 0.8684]}, {"w": "on", "b": [0.7261, 0.8486, 0.7513, 0.8684]}, {"w": "an", "b": [0.7576, 0.8486, 0.7814, 0.8684]}, {"w": "example", "b": [0.1483, 0.8691, 0.2338, 0.8889]}, {"w": "image", "b": [0.2401, 0.8691, 0.3018, 0.8889]}]}]}, {"page": 483, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Figure 8.7. A style transfer example", "words": [{"w": "Figure", "b": [0.1483, 0.0857, 0.2142, 0.1054]}, {"w": "8.7.", "b": [0.2205, 0.0857, 0.2583, 0.1054]}, {"w": "A", "b": [0.2646, 0.0857, 0.2829, 0.1054]}, {"w": "style", "b": [0.2892, 0.0857, 0.3368, 0.1054]}, {"w": "transfer", "b": [0.3431, 0.0857, 0.4202, 0.1054]}, {"w": "example", "b": [0.4265, 0.0857, 0.5119, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Figure 8.8. autoencoders VAEs (variational autoencoders).GANs (generative adversarial networks)generative deep learninggenerating images with variational autoencodersgenerative deep learninggenerating images with variational autoencoderssampling from latent spaces of imagesimagesgenerating with variational autoencodersimagesgenerating with variational autoencodersoverviewimagessampling from latent spaces oflatent spacesof images, sampling fromsamplingfrom latent spaces of imagesVAEs (variational autoencoders), generating images withVAEs (variational autoencoders), generating images withsampling from latent spaces of imagesSome example results", "words": [{"w": "Figure", "b": [0.1483, 0.1133, 0.2142, 0.133]}, {"w": "8.8.", "b": [0.2205, 0.1133, 0.2583, 0.133]}, {"w": "autoencoders", "b": [0.2646, 0.1133, 0.3977, 0.133]}, {"w": "VAEs", "b": [0.404, 0.1133, 0.4624, 0.133]}, {"w": "(variational", "b": [0.4687, 0.1133, 0.585, 0.133]}, {"w": "autoencoders).GANs", "b": [0.5913, 0.1133, 0.8036, 0.133]}, {"w": "(generative", "b": [0.1483, 0.1338, 0.2618, 0.1535]}, {"w": "adversarial", "b": [0.2681, 0.1338, 0.3788, 0.1535]}, {"w": "networks)generative", "b": [0.3851, 0.1338, 0.591, 0.1535]}, {"w": "deep", "b": [0.5973, 0.1338, 0.645, 0.1535]}, {"w": "learninggenerating", "b": [0.6513, 0.1338, 0.8404, 0.1535]}, {"w": "images", "b": [0.1483, 0.1543, 0.2198, 0.174]}, {"w": "with", "b": [0.2261, 0.1543, 0.271, 0.174]}, {"w": "variational", "b": [0.2773, 0.1543, 0.3852, 0.174]}, {"w": "autoencodersgenerative", "b": [0.3915, 0.1543, 0.6296, 0.174]}, {"w": "deep", "b": [0.6359, 0.1543, 0.6835, 0.174]}, {"w": "learninggenerating", "b": [0.1483, 0.1748, 0.3375, 0.1945]}, {"w": "images", "b": [0.3438, 0.1748, 0.4152, 0.1945]}, {"w": "with", "b": [0.4216, 0.1748, 0.4664, 0.1945]}, {"w": "variational", "b": [0.4727, 0.1748, 0.5806, 0.1945]}, {"w": "autoencoderssampling", "b": [0.5869, 0.1748, 0.8125, 0.1945]}, {"w": "from", "b": [0.1483, 0.1953, 0.1974, 0.215]}, {"w": "latent", "b": [0.2037, 0.1953, 0.2597, 0.215]}, {"w": "spaces", "b": [0.266, 0.1953, 0.3318, 0.215]}, {"w": "of", "b": [0.3382, 0.1953, 0.3592, 0.215]}, {"w": "imagesimagesgenerating", "b": [0.3655, 0.1953, 0.6149, 0.215]}, {"w": "with", "b": [0.6212, 0.1953, 0.666, 0.215]}, {"w": "variational", "b": [0.6723, 0.1953, 0.7802, 0.215]}, {"w": "autoencodersimagesgenerating", "b": [0.1483, 0.2158, 0.4594, 0.2356]}, {"w": "with", "b": [0.4657, 0.2158, 0.5105, 0.2356]}, {"w": "variational", "b": [0.5168, 0.2158, 0.6247, 0.2356]}, {"w": "autoencodersoverviewimagessampling", "b": [0.1483, 0.2363, 0.5393, 0.2561]}, {"w": "from", "b": [0.5455, 0.2363, 0.5945, 0.2561]}, {"w": "latent", "b": [0.6008, 0.2363, 0.6569, 0.2561]}, {"w": "spaces", "b": [0.6632, 0.2363, 0.729, 0.2561]}, {"w": "oflatent", "b": [0.7353, 0.2363, 0.8124, 0.2561]}, {"w": "spacesof", "b": [0.1483, 0.2568, 0.2352, 0.2766]}, {"w": "images,", "b": [0.2415, 0.2568, 0.3193, 0.2766]}, {"w": "sampling", "b": [0.3256, 0.2568, 0.4181, 0.2766]}, {"w": "fromsamplingfrom", "b": [0.4244, 0.2568, 0.615, 0.2766]}, {"w": "latent", "b": [0.6213, 0.2568, 0.6773, 0.2766]}, {"w": "spaces", "b": [0.6836, 0.2568, 0.7495, 0.2766]}, {"w": "of", "b": [0.7558, 0.2568, 0.7768, 0.2766]}, {"w": "imagesVAEs", "b": [0.1483, 0.2773, 0.2782, 0.2971]}, {"w": "(variational", "b": [0.2845, 0.2773, 0.4008, 0.2971]}, {"w": "autoencoders),", "b": [0.4071, 0.2773, 0.5549, 0.2971]}, {"w": "generating", "b": [0.5611, 0.2773, 0.6676, 0.2971]}, {"w": "images", "b": [0.6739, 0.2773, 0.7454, 0.2971]}, {"w": "withVAEs", "b": [0.1483, 0.2978, 0.2516, 0.3176]}, {"w": "(variational", "b": [0.2579, 0.2978, 0.3742, 0.3176]}, {"w": "autoencoders),", "b": [0.3805, 0.2978, 0.5283, 0.3176]}, {"w": "generating", "b": [0.5346, 0.2978, 0.6411, 0.3176]}, {"w": "images", "b": [0.6474, 0.2978, 0.7188, 0.3176]}, {"w": "withsampling", "b": [0.1483, 0.3183, 0.2857, 0.3381]}, {"w": "from", "b": [0.292, 0.3183, 0.341, 0.3381]}, {"w": "latent", "b": [0.3473, 0.3183, 0.4034, 0.3381]}, {"w": "spaces", "b": [0.4097, 0.3183, 0.4755, 0.3381]}, {"w": "of", "b": [0.4818, 0.3183, 0.5029, 0.3381]}, {"w": "imagesSome", "b": [0.5092, 0.3183, 0.6381, 0.3381]}, {"w": "example", "b": [0.6444, 0.3183, 0.7299, 0.3381]}, {"w": "results", "b": [0.7361, 0.3183, 0.8019, 0.3381]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 8.9. Learning a latent vector space of images, and using it to sample new images", "words": [{"w": "Figure", "b": [0.1483, 0.3459, 0.2142, 0.3657]}, {"w": "8.9.", "b": [0.2205, 0.3459, 0.2583, 0.3657]}, {"w": "Learning", "b": [0.2646, 0.3459, 0.3557, 0.3657]}, {"w": "a", "b": [0.362, 0.3459, 0.3732, 0.3657]}, {"w": "latent", "b": [0.3795, 0.3459, 0.4356, 0.3657]}, {"w": "vector", "b": [0.4419, 0.3459, 0.5049, 0.3657]}, {"w": "space", "b": [0.5112, 0.3459, 0.5673, 0.3657]}, {"w": "of", "b": [0.5736, 0.3459, 0.5946, 0.3657]}, {"w": "images,", "b": [0.6009, 0.3459, 0.6787, 0.3657]}, {"w": "and", "b": [0.685, 0.3459, 0.7214, 0.3657]}, {"w": "using", "b": [0.7277, 0.3459, 0.7824, 0.3657]}, {"w": "it", "b": [0.7887, 0.3459, 0.8027, 0.3657]}, {"w": "to", "b": [0.809, 0.3459, 0.8286, 0.3657]}, {"w": "sample", "b": [0.1483, 0.3664, 0.2198, 0.3862]}, {"w": "new", "b": [0.2261, 0.3664, 0.2681, 0.3862]}, {"w": "images", "b": [0.2744, 0.3664, 0.3459, 0.3862]}]}, {"id": "b_3", "type": "paragraph", "text": "Figure 8.10. A continuous space of faces generated by Tom White using VAEs", "words": [{"w": "Figure", "b": [0.1483, 0.3941, 0.2142, 0.4138]}, {"w": "8.10.", "b": [0.2205, 0.3941, 0.271, 0.4138]}, {"w": "A", "b": [0.2773, 0.3941, 0.2955, 0.4138]}, {"w": "continuous", "b": [0.3018, 0.3941, 0.4125, 0.4138]}, {"w": "space", "b": [0.4188, 0.3941, 0.4748, 0.4138]}, {"w": "of", "b": [0.4811, 0.3941, 0.5021, 0.4138]}, {"w": "faces", "b": [0.5085, 0.3941, 0.5603, 0.4138]}, {"w": "generated", "b": [0.5666, 0.3941, 0.6646, 0.4138]}, {"w": "by", "b": [0.6709, 0.3941, 0.6962, 0.4138]}, {"w": "Tom", "b": [0.7025, 0.3941, 0.7483, 0.4138]}, {"w": "White", "b": [0.7546, 0.3941, 0.8163, 0.4138]}, {"w": "using", "b": [0.1483, 0.4146, 0.203, 0.4343]}, {"w": "VAEs", "b": [0.2093, 0.4146, 0.2677, 0.4343]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 8.11. The smile vector", "words": [{"w": "Figure", "b": [0.1483, 0.4422, 0.2142, 0.4619]}, {"w": "8.11.", "b": [0.2205, 0.4422, 0.27, 0.4619]}, {"w": "The", "b": [0.2763, 0.4422, 0.3155, 0.4619]}, {"w": "smile", "b": [0.3219, 0.4422, 0.3765, 0.4619]}, {"w": "vector", "b": [0.3828, 0.4422, 0.4459, 0.4619]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 8.12. An autoencoder: mapping an input x to a compressed representation and then decoding it back as x'", "words": [{"w": "Figure", "b": [0.1483, 0.4698, 0.2142, 0.4896]}, {"w": "8.12.", "b": [0.2205, 0.4698, 0.271, 0.4896]}, {"w": "An", "b": [0.2773, 0.4698, 0.3081, 0.4896]}, {"w": "autoencoder:", "b": [0.3144, 0.4698, 0.4447, 0.4896]}, {"w": "mapping", "b": [0.451, 0.4698, 0.5393, 0.4896]}, {"w": "an", "b": [0.5456, 0.4698, 0.5694, 0.4896]}, {"w": "input", "b": [0.5757, 0.4698, 0.6276, 0.4896]}, {"w": "x", "b": [0.6339, 0.4698, 0.6465, 0.4896]}, {"w": "to", "b": [0.6528, 0.4698, 0.6724, 0.4896]}, {"w": "a", "b": [0.6787, 0.4698, 0.6899, 0.4896]}, {"w": "compressed", "b": [0.6962, 0.4698, 0.8153, 0.4896]}, {"w": "representation", "b": [0.1483, 0.4903, 0.2912, 0.5101]}, {"w": "and", "b": [0.2975, 0.4903, 0.334, 0.5101]}, {"w": "then", "b": [0.3403, 0.4903, 0.3837, 0.5101]}, {"w": "decoding", "b": [0.39, 0.4903, 0.4825, 0.5101]}, {"w": "it", "b": [0.4888, 0.4903, 0.5028, 0.5101]}, {"w": "back", "b": [0.5091, 0.4903, 0.5568, 0.5101]}, {"w": "as", "b": [0.5631, 0.4903, 0.5841, 0.5101]}, {"w": "x'", "b": [0.5904, 0.4903, 0.6075, 0.5101]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 8.13. A VAE maps an image to two vectors, z_mean and z_log_sigma, which define a probability distribution over the latent space, used to sample a latent point to decode.", "words": [{"w": "Figure", "b": [0.1483, 0.518, 0.2142, 0.5377]}, {"w": "8.13.", "b": [0.2205, 0.518, 0.271, 0.5377]}, {"w": "A", "b": [0.2773, 0.518, 0.2955, 0.5377]}, {"w": "VAE", "b": [0.3018, 0.518, 0.3504, 0.5377]}, {"w": "maps", "b": [0.3567, 0.518, 0.4099, 0.5377]}, {"w": "an", "b": [0.4162, 0.518, 0.44, 0.5377]}, {"w": "image", "b": [0.4464, 0.518, 0.508, 0.5377]}, {"w": "to", "b": [0.5143, 0.518, 0.5339, 0.5377]}, {"w": "two", "b": [0.5402, 0.518, 0.5781, 0.5377]}, {"w": "vectors,", "b": [0.5844, 0.518, 0.6635, 0.5377]}, {"w": "z_mean", "b": [0.6699, 0.518, 0.7483, 0.5377]}, {"w": "and", "b": [0.7546, 0.518, 0.791, 0.5377]}, {"w": "z_log_sigma,", "b": [0.1483, 0.5385, 0.2836, 0.5582]}, {"w": "which", "b": [0.2899, 0.5385, 0.3515, 0.5582]}, {"w": "define", "b": [0.3578, 0.5385, 0.4209, 0.5582]}, {"w": "a", "b": [0.4272, 0.5385, 0.4384, 0.5582]}, {"w": "probability", "b": [0.4447, 0.5385, 0.5554, 0.5582]}, {"w": "distribution", "b": [0.5617, 0.5385, 0.678, 0.5582]}, {"w": "over", "b": [0.6844, 0.5385, 0.7292, 0.5582]}, {"w": "the", "b": [0.7355, 0.5385, 0.7663, 0.5582]}, {"w": "latent", "b": [0.7725, 0.5385, 0.8286, 0.5582]}, {"w": "space,", "b": [0.1483, 0.559, 0.2107, 0.5787]}, {"w": "used", "b": [0.217, 0.559, 0.2632, 0.5787]}, {"w": "to", "b": [0.2695, 0.559, 0.2891, 0.5787]}, {"w": "sample", "b": [0.2954, 0.559, 0.3669, 0.5787]}, {"w": "a", "b": [0.3732, 0.559, 0.3844, 0.5787]}, {"w": "latent", "b": [0.3907, 0.559, 0.4468, 0.5787]}, {"w": "point", "b": [0.4531, 0.559, 0.5049, 0.5787]}, {"w": "to", "b": [0.5113, 0.559, 0.5309, 0.5787]}, {"w": "decode.", "b": [0.5372, 0.559, 0.6149, 0.5787]}]}, {"id": "b_7", "type": "paragraph", "text": "Figure 8.14. Grid of digits decoded from the latent space", "words": [{"w": "Figure", "b": [0.1483, 0.5866, 0.2142, 0.6063]}, {"w": "8.14.", "b": [0.2205, 0.5866, 0.271, 0.6063]}, {"w": "Grid", "b": [0.2773, 0.5866, 0.3235, 0.6063]}, {"w": "of", "b": [0.3298, 0.5866, 0.3508, 0.6063]}, {"w": "digits", "b": [0.3571, 0.5866, 0.4132, 0.6063]}, {"w": "decoded", "b": [0.4195, 0.5866, 0.5036, 0.6063]}, {"w": "from", "b": [0.5099, 0.5866, 0.5589, 0.6063]}, {"w": "the", "b": [0.5652, 0.5866, 0.596, 0.6063]}, {"w": "latent", "b": [0.6023, 0.5866, 0.6584, 0.6063]}, {"w": "space", "b": [0.6647, 0.5866, 0.7207, 0.6063]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure 8.15. A generator transforms random latent vectors into images, and a discriminator seeks to tell real images from generated ones. The generator is trained to fool the discriminator.", "words": [{"w": "Figure", "b": [0.1483, 0.6142, 0.2142, 0.634]}, {"w": "8.15.", "b": [0.2205, 0.6142, 0.271, 0.634]}, {"w": "A", "b": [0.2773, 0.6142, 0.2955, 0.634]}, {"w": "generator", "b": [0.3018, 0.6142, 0.397, 0.634]}, {"w": "transforms", "b": [0.4033, 0.6142, 0.5112, 0.634]}, {"w": "random", "b": [0.5175, 0.6142, 0.5946, 0.634]}, {"w": "latent", "b": [0.6009, 0.6142, 0.657, 0.634]}, {"w": "vectors", "b": [0.6633, 0.6142, 0.7361, 0.634]}, {"w": "into", "b": [0.7424, 0.6142, 0.7817, 0.634]}, {"w": "images,", "b": [0.1483, 0.6347, 0.2261, 0.6545]}, {"w": "and", "b": [0.2324, 0.6347, 0.2688, 0.6545]}, {"w": "a", "b": [0.2751, 0.6347, 0.2863, 0.6545]}, {"w": "discriminator", "b": [0.2926, 0.6347, 0.4272, 0.6545]}, {"w": "seeks", "b": [0.4335, 0.6347, 0.4881, 0.6545]}, {"w": "to", "b": [0.4944, 0.6347, 0.5141, 0.6545]}, {"w": "tell", "b": [0.5204, 0.6347, 0.5526, 0.6545]}, {"w": "real", "b": [0.5589, 0.6347, 0.5967, 0.6545]}, {"w": "images", "b": [0.603, 0.6347, 0.6745, 0.6545]}, {"w": "from", "b": [0.6808, 0.6347, 0.7298, 0.6545]}, {"w": "generated", "b": [0.736, 0.6347, 0.8341, 0.6545]}, {"w": "ones.", "b": [0.1483, 0.6552, 0.2009, 0.675]}, {"w": "The", "b": [0.2072, 0.6552, 0.2464, 0.675]}, {"w": "generator", "b": [0.2527, 0.6552, 0.348, 0.675]}, {"w": "is", "b": [0.3543, 0.6552, 0.3711, 0.675]}, {"w": "trained", "b": [0.3774, 0.6552, 0.4475, 0.675]}, {"w": "to", "b": [0.4538, 0.6552, 0.4734, 0.675]}, {"w": "fool", "b": [0.4797, 0.6552, 0.5203, 0.675]}, {"w": "the", "b": [0.5266, 0.6552, 0.5575, 0.675]}, {"w": "discriminator.", "b": [0.5638, 0.6552, 0.7031, 0.675]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure 8.16. Latent space dwellers. Images generated by Mike Tyka using a multistaged GAN trained on a dataset of faces (www.miketyka.com).", "words": [{"w": "Figure", "b": [0.1483, 0.6829, 0.2142, 0.7026]}, {"w": "8.16.", "b": [0.2205, 0.6829, 0.271, 0.7026]}, {"w": "Latent", "b": [0.2773, 0.6829, 0.3417, 0.7026]}, {"w": "space", "b": [0.348, 0.6829, 0.404, 0.7026]}, {"w": "dwellers.", "b": [0.4104, 0.6829, 0.5021, 0.7026]}, {"w": "Images", "b": [0.5084, 0.6829, 0.5813, 0.7026]}, {"w": "generated", "b": [0.5876, 0.6829, 0.6856, 0.7026]}, {"w": "by", "b": [0.6919, 0.6829, 0.7172, 0.7026]}, {"w": "Mike", "b": [0.7235, 0.6829, 0.7767, 0.7026]}, {"w": "Tyka", "b": [0.783, 0.6829, 0.833, 0.7026]}, {"w": "using", "b": [0.1483, 0.7034, 0.203, 0.7231]}, {"w": "a", "b": [0.2093, 0.7034, 0.2205, 0.7231]}, {"w": "multistaged", "b": [0.2268, 0.7034, 0.3445, 0.7231]}, {"w": "GAN", "b": [0.3508, 0.7034, 0.4055, 0.7231]}, {"w": "trained", "b": [0.4118, 0.7034, 0.4818, 0.7231]}, {"w": "on", "b": [0.4881, 0.7034, 0.5134, 0.7231]}, {"w": "a", "b": [0.5197, 0.7034, 0.5309, 0.7231]}, {"w": "dataset", "b": [0.5372, 0.7034, 0.6072, 0.7231]}, {"w": "of", "b": [0.6135, 0.7034, 0.6346, 0.7231]}, {"w": "faces", "b": [0.6409, 0.7034, 0.6927, 0.7231]}, {"w": "(www.miketyka.com).", "b": [0.1483, 0.7239, 0.3744, 0.7436]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure 8.17. Checkerboard artifacts caused by mismatching strides and kernel sizes, resulting in unequal pixel-space coverage: one of the many gotchas of GANs", "words": [{"w": "Figure", "b": [0.1483, 0.7515, 0.2142, 0.7712]}, {"w": "8.17.", "b": [0.2205, 0.7515, 0.271, 0.7712]}, {"w": "Checkerboard", "b": [0.2773, 0.7515, 0.4188, 0.7712]}, {"w": "artifacts", "b": [0.4251, 0.7515, 0.5063, 0.7712]}, {"w": "caused", "b": [0.5126, 0.7515, 0.5813, 0.7712]}, {"w": "by", "b": [0.5876, 0.7515, 0.6128, 0.7712]}, {"w": "mismatching", "b": [0.6191, 0.7515, 0.7494, 0.7712]}, {"w": "strides", "b": [0.7557, 0.7515, 0.8216, 0.7712]}, {"w": "and", "b": [0.1483, 0.772, 0.1848, 0.7917]}, {"w": "kernel", "b": [0.1911, 0.772, 0.2541, 0.7917]}, {"w": "sizes,", "b": [0.2604, 0.772, 0.3158, 0.7917]}, {"w": "resulting", "b": [0.3221, 0.772, 0.4104, 0.7917]}, {"w": "in", "b": [0.4167, 0.772, 0.4363, 0.7917]}, {"w": "unequal", "b": [0.4426, 0.772, 0.5225, 0.7917]}, {"w": "pixel-space", "b": [0.5288, 0.772, 0.6436, 0.7917]}, {"w": "coverage:", "b": [0.6499, 0.772, 0.748, 0.7917]}, {"w": "one", "b": [0.7542, 0.772, 0.7906, 0.7917]}, {"w": "of", "b": [0.7969, 0.772, 0.8179, 0.7917]}, {"w": "the", "b": [0.1483, 0.7925, 0.1792, 0.8122]}, {"w": "many", "b": [0.1855, 0.7925, 0.2415, 0.8122]}, {"w": "gotchas", "b": [0.2478, 0.7925, 0.3249, 0.8122]}, {"w": "of", "b": [0.3312, 0.7925, 0.3522, 0.8122]}, {"w": "GANs", "b": [0.3585, 0.7925, 0.423, 0.8122]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure 8.18. Play the discriminator: in each row, two images were dreamed up by the GAN, and one image comes from the training set. Can you tell them apart? (Answers: the real images in each column are middle, top, bottom, middle.)", "words": [{"w": "Figure", "b": [0.1483, 0.8201, 0.2142, 0.8399]}, {"w": "8.18.", "b": [0.2205, 0.8201, 0.271, 0.8399]}, {"w": "Play", "b": [0.2773, 0.8201, 0.3221, 0.8399]}, {"w": "the", "b": [0.3284, 0.8201, 0.3592, 0.8399]}, {"w": "discriminator:", "b": [0.3656, 0.8201, 0.5071, 0.8399]}, {"w": "in", "b": [0.5134, 0.8201, 0.533, 0.8399]}, {"w": "each", "b": [0.5393, 0.8201, 0.5855, 0.8399]}, {"w": "row,", "b": [0.5919, 0.8201, 0.6357, 0.8399]}, {"w": "two", "b": [0.642, 0.8201, 0.6798, 0.8399]}, {"w": "images", "b": [0.6861, 0.8201, 0.7576, 0.8399]}, {"w": "were", "b": [0.7639, 0.8201, 0.8129, 0.8399]}, {"w": "dreamed", "b": [0.1483, 0.8406, 0.2352, 0.8604]}, {"w": "up", "b": [0.2415, 0.8406, 0.2667, 0.8604]}, {"w": "by", "b": [0.273, 0.8406, 0.2982, 0.8604]}, {"w": "the", "b": [0.3046, 0.8406, 0.3354, 0.8604]}, {"w": "GAN,", "b": [0.3417, 0.8406, 0.4026, 0.8604]}, {"w": "and", "b": [0.4089, 0.8406, 0.4454, 0.8604]}, {"w": "one", "b": [0.4517, 0.8406, 0.4881, 0.8604]}, {"w": "image", "b": [0.4944, 0.8406, 0.5561, 0.8604]}, {"w": "comes", "b": [0.5624, 0.8406, 0.6268, 0.8604]}, {"w": "from", "b": [0.6331, 0.8406, 0.6822, 0.8604]}, {"w": "the", "b": [0.6885, 0.8406, 0.7193, 0.8604]}, {"w": "training", "b": [0.7256, 0.8406, 0.8041, 0.8604]}, {"w": "set.", "b": [0.8103, 0.8406, 0.8446, 0.8604]}, {"w": "Can", "b": [0.1483, 0.8611, 0.189, 0.8809]}, {"w": "you", "b": [0.1953, 0.8611, 0.2331, 0.8809]}, {"w": "tell", "b": [0.2394, 0.8611, 0.2717, 0.8809]}, {"w": "them", "b": [0.278, 0.8611, 0.3284, 0.8809]}, {"w": "apart?", "b": [0.3347, 0.8611, 0.3964, 0.8809]}, {"w": "(Answers:", "b": [0.4027, 0.8611, 0.5063, 0.8809]}, {"w": "the", "b": [0.5126, 0.8611, 0.5435, 0.8809]}, {"w": "real", "b": [0.5498, 0.8611, 0.5876, 0.8809]}, {"w": "images", "b": [0.5939, 0.8611, 0.6654, 0.8809]}, {"w": "in", "b": [0.6717, 0.8611, 0.6913, 0.8809]}, {"w": "each", "b": [0.6976, 0.8611, 0.7438, 0.8809]}, {"w": "column", "b": [0.7501, 0.8611, 0.8258, 0.8809]}, {"w": "are", "b": [0.1483, 0.8816, 0.1791, 0.9014]}, {"w": "middle,", "b": [0.1854, 0.8816, 0.2618, 0.9014]}, {"w": "top,", "b": [0.2681, 0.8816, 0.3067, 0.9014]}, {"w": "bottom,", "b": [0.313, 0.8816, 0.3908, 0.9014]}, {"w": "middle.)", "b": [0.3971, 0.8816, 0.4819, 0.9014]}]}]}, {"page": 484, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Chapter 9. Conclusions", "words": [{"w": "Chapter", "b": [0.1294, 0.0857, 0.2093, 0.1054]}, {"w": "9.", "b": [0.2156, 0.0857, 0.2345, 0.1054]}, {"w": "Conclusions", "b": [0.2408, 0.0857, 0.3656, 0.1054]}]}, {"id": "b_1", "type": "equation", "text": "Figure 9.1. Failure of an image-captioning system based on deep learning", "words": [{"w": "Figure", "b": [0.1483, 0.124, 0.2142, 0.1437]}, {"w": "9.1.", "b": [0.2205, 0.124, 0.2583, 0.1437]}, {"w": "Failure", "b": [0.2646, 0.124, 0.3361, 0.1437]}, {"w": "of", "b": [0.3424, 0.124, 0.3634, 0.1437]}, {"w": "an", "b": [0.3697, 0.124, 0.3936, 0.1437]}, {"w": "image-captioning", "b": [0.3999, 0.124, 0.5764, 0.1437]}, {"w": "system", "b": [0.5827, 0.124, 0.6528, 0.1437]}, {"w": "based", "b": [0.6591, 0.124, 0.7165, 0.1437]}, {"w": "on", "b": [0.7228, 0.124, 0.7481, 0.1437]}, {"w": "deep", "b": [0.7544, 0.124, 0.802, 0.1437]}, {"w": "learning", "b": [0.1483, 0.1445, 0.231, 0.1642]}]}, {"id": "b_2", "type": "paragraph", "text": "Figure 9.2. An adversarial example: imperceptible changes in an image can upend a model’s classification of the image.", "words": [{"w": "Figure", "b": [0.1483, 0.1721, 0.2142, 0.1919]}, {"w": "9.2.", "b": [0.2205, 0.1721, 0.2583, 0.1919]}, {"w": "An", "b": [0.2646, 0.1721, 0.2955, 0.1919]}, {"w": "adversarial", "b": [0.3018, 0.1721, 0.4124, 0.1919]}, {"w": "example:", "b": [0.4188, 0.1721, 0.5112, 0.1919]}, {"w": "imperceptible", "b": [0.5175, 0.1721, 0.6563, 0.1919]}, {"w": "changes", "b": [0.6626, 0.1721, 0.7438, 0.1919]}, {"w": "in", "b": [0.7501, 0.1721, 0.7697, 0.1919]}, {"w": "an", "b": [0.776, 0.1721, 0.7999, 0.1919]}, {"w": "image", "b": [0.1483, 0.1926, 0.21, 0.2124]}, {"w": "can", "b": [0.2163, 0.1926, 0.2513, 0.2124]}, {"w": "upend", "b": [0.2576, 0.1926, 0.3193, 0.2124]}, {"w": "a", "b": [0.3256, 0.1926, 0.3368, 0.2124]}, {"w": "model’s", "b": [0.3431, 0.1926, 0.4229, 0.2124]}, {"w": "classification", "b": [0.4292, 0.1926, 0.5623, 0.2124]}, {"w": "of", "b": [0.5686, 0.1926, 0.5897, 0.2124]}, {"w": "the", "b": [0.596, 0.1926, 0.6268, 0.2124]}, {"w": "image.", "b": [0.6331, 0.1926, 0.7011, 0.2124]}]}, {"id": "b_3", "type": "equation", "text": "Figure 9.3. Current machine-learning models: like a dim image in a mirror", "words": [{"w": "Figure", "b": [0.1483, 0.2203, 0.2142, 0.24]}, {"w": "9.3.", "b": [0.2205, 0.2203, 0.2583, 0.24]}, {"w": "Current", "b": [0.2646, 0.2203, 0.3417, 0.24]}, {"w": "machine-learning", "b": [0.348, 0.2203, 0.5245, 0.24]}, {"w": "models:", "b": [0.5309, 0.2203, 0.6107, 0.24]}, {"w": "like", "b": [0.6171, 0.2203, 0.6549, 0.24]}, {"w": "a", "b": [0.6612, 0.2203, 0.6724, 0.24]}, {"w": "dim", "b": [0.6787, 0.2203, 0.718, 0.24]}, {"w": "image", "b": [0.7243, 0.2203, 0.7859, 0.24]}, {"w": "in", "b": [0.7922, 0.2203, 0.8118, 0.24]}, {"w": "a", "b": [0.8182, 0.2203, 0.8294, 0.24]}, {"w": "mirror", "b": [0.1483, 0.2408, 0.2128, 0.2605]}]}, {"id": "b_4", "type": "paragraph", "text": "Figure 9.4. Local generalization vs. extreme generalization", "words": [{"w": "Figure", "b": [0.1483, 0.2684, 0.2142, 0.2881]}, {"w": "9.4.", "b": [0.2205, 0.2684, 0.2583, 0.2881]}, {"w": "Local", "b": [0.2646, 0.2684, 0.3221, 0.2881]}, {"w": "generalization", "b": [0.3284, 0.2684, 0.4713, 0.2881]}, {"w": "vs.", "b": [0.4776, 0.2684, 0.5063, 0.2881]}, {"w": "extreme", "b": [0.5126, 0.2684, 0.5939, 0.2881]}, {"w": "generalization", "b": [0.6002, 0.2684, 0.7431, 0.2881]}]}, {"id": "b_5", "type": "paragraph", "text": "Figure 9.5. A learned program relying on both geometric primitives (pattern recognition, intuition) and algorithmic primitives (reasoning, search, memory)", "words": [{"w": "Figure", "b": [0.1483, 0.296, 0.2142, 0.3158]}, {"w": "9.5.", "b": [0.2205, 0.296, 0.2583, 0.3158]}, {"w": "A", "b": [0.2646, 0.296, 0.2829, 0.3158]}, {"w": "learned", "b": [0.2892, 0.296, 0.3634, 0.3158]}, {"w": "program", "b": [0.3697, 0.296, 0.4552, 0.3158]}, {"w": "relying", "b": [0.4615, 0.296, 0.5329, 0.3158]}, {"w": "on", "b": [0.5393, 0.296, 0.5645, 0.3158]}, {"w": "both", "b": [0.5708, 0.296, 0.6156, 0.3158]}, {"w": "geometric", "b": [0.6219, 0.296, 0.7228, 0.3158]}, {"w": "primitives", "b": [0.7291, 0.296, 0.8314, 0.3158]}, {"w": "(pattern", "b": [0.1483, 0.3165, 0.2268, 0.3363]}, {"w": "recognition,", "b": [0.2331, 0.3165, 0.3543, 0.3363]}, {"w": "intuition)", "b": [0.3606, 0.3165, 0.4545, 0.3363]}, {"w": "and", "b": [0.4608, 0.3165, 0.4973, 0.3363]}, {"w": "algorithmic", "b": [0.5036, 0.3165, 0.6199, 0.3363]}, {"w": "primitives", "b": [0.6262, 0.3165, 0.7285, 0.3363]}, {"w": "(reasoning,", "b": [0.1483, 0.337, 0.2611, 0.3568]}, {"w": "search,", "b": [0.2674, 0.337, 0.3382, 0.3568]}, {"w": "memory)", "b": [0.3445, 0.337, 0.4369, 0.3568]}]}, {"id": "b_6", "type": "paragraph", "text": "Figure 9.6. A meta-learner capable of quickly developing task- specific models using reusable primitives (both algorithmic and geometric), thus achieving extreme generalization", "words": [{"w": "Figure", "b": [0.1483, 0.3647, 0.2142, 0.3844]}, {"w": "9.6.", "b": [0.2205, 0.3647, 0.2583, 0.3844]}, {"w": "A", "b": [0.2646, 0.3647, 0.2829, 0.3844]}, {"w": "meta-learner", "b": [0.2892, 0.3647, 0.4166, 0.3844]}, {"w": "capable", "b": [0.4229, 0.3647, 0.5, 0.3844]}, {"w": "of", "b": [0.5063, 0.3647, 0.5273, 0.3844]}, {"w": "quickly", "b": [0.5336, 0.3647, 0.6093, 0.3844]}, {"w": "developing", "b": [0.6156, 0.3647, 0.7277, 0.3844]}, {"w": "task-", "b": [0.734, 0.3647, 0.783, 0.3844]}, {"w": "specific", "b": [0.1483, 0.3852, 0.2268, 0.4049]}, {"w": "models", "b": [0.2331, 0.3852, 0.306, 0.4049]}, {"w": "using", "b": [0.3123, 0.3852, 0.3669, 0.4049]}, {"w": "reusable", "b": [0.3732, 0.3852, 0.4573, 0.4049]}, {"w": "primitives", "b": [0.4636, 0.3852, 0.5659, 0.4049]}, {"w": "(both", "b": [0.5722, 0.3852, 0.6255, 0.4049]}, {"w": "algorithmic", "b": [0.6318, 0.3852, 0.7481, 0.4049]}, {"w": "and", "b": [0.7543, 0.3852, 0.7907, 0.4049]}, {"w": "geometric),", "b": [0.1483, 0.4057, 0.2639, 0.4254]}, {"w": "thus", "b": [0.2702, 0.4057, 0.3123, 0.4254]}, {"w": "achieving", "b": [0.3186, 0.4057, 0.4167, 0.4254]}, {"w": "extreme", "b": [0.423, 0.4057, 0.5042, 0.4254]}, {"w": "generalization", "b": [0.5105, 0.4057, 0.6534, 0.4254]}]}, {"id": "b_7", "type": "paragraph", "text": "Appendix B. Running Jupyter notebooks on an EC2 GPU instance", "words": [{"w": "Appendix", "b": [0.1294, 0.4484, 0.2289, 0.4682]}, {"w": "B.", "b": [0.2352, 0.4484, 0.2583, 0.4682]}, {"w": "Running", "b": [0.2646, 0.4484, 0.3516, 0.4682]}, {"w": "Jupyter", "b": [0.3579, 0.4484, 0.4321, 0.4682]}, {"w": "notebooks", "b": [0.4384, 0.4484, 0.5421, 0.4682]}, {"w": "on", "b": [0.5484, 0.4484, 0.5737, 0.4682]}, {"w": "an", "b": [0.58, 0.4484, 0.6038, 0.4682]}, {"w": "EC2", "b": [0.6101, 0.4484, 0.6549, 0.4682]}, {"w": "GPU", "b": [0.6612, 0.4484, 0.7117, 0.4682]}, {"w": "instance", "b": [0.718, 0.4484, 0.8007, 0.4682]}]}, {"id": "b_8", "type": "paragraph", "text": "Figure B.1. The EC2 control panel", "words": [{"w": "Figure", "b": [0.1483, 0.4868, 0.2142, 0.5065]}, {"w": "B.1.", "b": [0.2205, 0.4868, 0.2626, 0.5065]}, {"w": "The", "b": [0.2689, 0.4868, 0.3081, 0.5065]}, {"w": "EC2", "b": [0.3144, 0.4868, 0.3592, 0.5065]}, {"w": "control", "b": [0.3656, 0.4868, 0.437, 0.5065]}, {"w": "panel", "b": [0.4433, 0.4868, 0.498, 0.5065]}]}, {"id": "b_9", "type": "paragraph", "text": "Figure B.2. The EC2 AMI Marketplace", "words": [{"w": "Figure", "b": [0.1483, 0.5144, 0.2142, 0.5341]}, {"w": "B.2.", "b": [0.2205, 0.5144, 0.2626, 0.5341]}, {"w": "The", "b": [0.2689, 0.5144, 0.3081, 0.5341]}, {"w": "EC2", "b": [0.3144, 0.5144, 0.3592, 0.5341]}, {"w": "AMI", "b": [0.3656, 0.5144, 0.4146, 0.5341]}, {"w": "Marketplace", "b": [0.4209, 0.5144, 0.547, 0.5341]}]}, {"id": "b_10", "type": "paragraph", "text": "Figure B.3. The EC2 Deep Learning AMI", "words": [{"w": "Figure", "b": [0.1483, 0.542, 0.2142, 0.5618]}, {"w": "B.3.", "b": [0.2205, 0.542, 0.2626, 0.5618]}, {"w": "The", "b": [0.2689, 0.542, 0.3081, 0.5618]}, {"w": "EC2", "b": [0.3144, 0.542, 0.3592, 0.5618]}, {"w": "Deep", "b": [0.3656, 0.542, 0.4188, 0.5618]}, {"w": "Learning", "b": [0.4251, 0.542, 0.5161, 0.5618]}, {"w": "AMI", "b": [0.5225, 0.542, 0.5715, 0.5618]}]}, {"id": "b_11", "type": "paragraph", "text": "Figure B.4. The p2.xlarge instance", "words": [{"w": "Figure", "b": [0.1483, 0.5697, 0.2142, 0.5894]}, {"w": "B.4.", "b": [0.2205, 0.5697, 0.2626, 0.5894]}, {"w": "The", "b": [0.2689, 0.5697, 0.3081, 0.5894]}, {"w": "p2.xlarge", "b": [0.3144, 0.5697, 0.4085, 0.5894]}, {"w": "instance", "b": [0.4148, 0.5697, 0.4975, 0.5894]}]}, {"id": "b_12", "type": "paragraph", "text": "Figure B.5. Configure a new security group.", "words": [{"w": "Figure", "b": [0.1483, 0.5973, 0.2142, 0.617]}, {"w": "B.5.", "b": [0.2205, 0.5973, 0.2626, 0.617]}, {"w": "Configure", "b": [0.2689, 0.5973, 0.3712, 0.617]}, {"w": "a", "b": [0.3775, 0.5973, 0.3887, 0.617]}, {"w": "new", "b": [0.395, 0.5973, 0.437, 0.617]}, {"w": "security", "b": [0.4433, 0.5973, 0.5232, 0.617]}, {"w": "group.", "b": [0.5295, 0.5973, 0.5946, 0.617]}]}, {"id": "b_13", "type": "paragraph", "text": "Figure B.6. Connection instructions", "words": [{"w": "Figure", "b": [0.1483, 0.6249, 0.2142, 0.6447]}, {"w": "B.6.", "b": [0.2205, 0.6249, 0.2626, 0.6447]}, {"w": "Connection", "b": [0.2689, 0.6249, 0.3852, 0.6447]}, {"w": "instructions", "b": [0.3915, 0.6249, 0.5092, 0.6447]}]}, {"id": "b_14", "type": "paragraph", "text": "Figure B.7. A safety warning you can ignore", "words": [{"w": "Figure", "b": [0.1483, 0.6526, 0.2142, 0.6723]}, {"w": "B.7.", "b": [0.2205, 0.6526, 0.2626, 0.6723]}, {"w": "A", "b": [0.2689, 0.6526, 0.2871, 0.6723]}, {"w": "safety", "b": [0.2934, 0.6526, 0.3536, 0.6723]}, {"w": "warning", "b": [0.3599, 0.6526, 0.4426, 0.6723]}, {"w": "you", "b": [0.4489, 0.6526, 0.4867, 0.6723]}, {"w": "can", "b": [0.493, 0.6526, 0.5281, 0.6723]}, {"w": "ignore", "b": [0.5344, 0.6526, 0.5988, 0.6723]}]}, {"id": "b_15", "type": "paragraph", "text": "Figure B.8. The Jupyter dashboard", "words": [{"w": "Figure", "b": [0.1483, 0.6802, 0.2142, 0.6999]}, {"w": "B.8.", "b": [0.2205, 0.6802, 0.2626, 0.6999]}, {"w": "The", "b": [0.2689, 0.6802, 0.3081, 0.6999]}, {"w": "Jupyter", "b": [0.3144, 0.6802, 0.3887, 0.6999]}, {"w": "dashboard", "b": [0.395, 0.6802, 0.4986, 0.6999]}]}, {"id": "b_16", "type": "paragraph", "text": "Figure B.9. Create a new notebook.", "words": [{"w": "Figure", "b": [0.1483, 0.7078, 0.2142, 0.7276]}, {"w": "B.9.", "b": [0.2205, 0.7078, 0.2626, 0.7276]}, {"w": "Create", "b": [0.2689, 0.7078, 0.3347, 0.7276]}, {"w": "a", "b": [0.341, 0.7078, 0.3522, 0.7276]}, {"w": "new", "b": [0.3585, 0.7078, 0.4005, 0.7276]}, {"w": "notebook.", "b": [0.4068, 0.7078, 0.507, 0.7276]}]}]}, {"page": 485, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "List of Tables", "words": [{"w": "List", "b": [0.1294, 0.1076, 0.189, 0.1355]}, {"w": "of", "b": [0.1979, 0.1076, 0.2277, 0.1355]}, {"w": "Tables", "b": [0.2366, 0.1076, 0.3346, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapter 4. Fundamentals of machine learning", "words": [{"w": "Chapter", "b": [0.1294, 0.1588, 0.2093, 0.1785]}, {"w": "4.", "b": [0.2156, 0.1588, 0.2345, 0.1785]}, {"w": "Fundamentals", "b": [0.2408, 0.1588, 0.3824, 0.1785]}, {"w": "of", "b": [0.3887, 0.1588, 0.4097, 0.1785]}, {"w": "machine", "b": [0.416, 0.1588, 0.5014, 0.1785]}, {"w": "learning", "b": [0.5077, 0.1588, 0.5904, 0.1785]}]}, {"id": "b_2", "type": "paragraph", "text": "Table 4.1. Choosing the right last-layer activation and loss function for your model", "words": [{"w": "Table", "b": [0.1483, 0.1971, 0.204, 0.2168]}, {"w": "4.1.", "b": [0.2103, 0.1971, 0.2482, 0.2168]}, {"w": "Choosing", "b": [0.2545, 0.1971, 0.3512, 0.2168]}, {"w": "the", "b": [0.3575, 0.1971, 0.3883, 0.2168]}, {"w": "right", "b": [0.3946, 0.1971, 0.4423, 0.2168]}, {"w": "last-layer", "b": [0.4486, 0.1971, 0.5424, 0.2168]}, {"w": "activation", "b": [0.5487, 0.1971, 0.6482, 0.2168]}, {"w": "and", "b": [0.6545, 0.1971, 0.691, 0.2168]}, {"w": "loss", "b": [0.6973, 0.1971, 0.7365, 0.2168]}, {"w": "function", "b": [0.7428, 0.1971, 0.8269, 0.2168]}, {"w": "for", "b": [0.1483, 0.2176, 0.1777, 0.2373]}, {"w": "your", "b": [0.1841, 0.2176, 0.2303, 0.2373]}, {"w": "model", "b": [0.2366, 0.2176, 0.2997, 0.2373]}]}]}, {"page": 486, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "List of Listings", "words": [{"w": "List", "b": [0.1294, 0.1076, 0.189, 0.1355]}, {"w": "of", "b": [0.1979, 0.1076, 0.2277, 0.1355]}, {"w": "Listings", "b": [0.2366, 0.1076, 0.3577, 0.1355]}]}, {"id": "b_1", "type": "paragraph", "text": "Chapter 2. Before we begin: the mathematical building blocks of neural networks", "words": [{"w": "Chapter", "b": [0.1294, 0.1588, 0.2093, 0.1785]}, {"w": "2.", "b": [0.2156, 0.1588, 0.2345, 0.1785]}, {"w": "Before", "b": [0.2408, 0.1588, 0.3094, 0.1785]}, {"w": "we", "b": [0.3158, 0.1588, 0.3452, 0.1785]}, {"w": "begin:", "b": [0.3515, 0.1588, 0.4145, 0.1785]}, {"w": "the", "b": [0.4208, 0.1588, 0.4517, 0.1785]}, {"w": "mathematical", "b": [0.458, 0.1588, 0.5939, 0.1785]}, {"w": "building", "b": [0.6002, 0.1588, 0.6843, 0.1785]}, {"w": "blocks", "b": [0.6906, 0.1588, 0.7565, 0.1785]}, {"w": "of", "b": [0.7628, 0.1588, 0.7838, 0.1785]}, {"w": "neural", "b": [0.7901, 0.1588, 0.8531, 0.1785]}, {"w": "networks", "b": [0.1294, 0.1793, 0.2219, 0.199]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 2.1. Loading the MNIST dataset in Keras", "words": [{"w": "Listing", "b": [0.1483, 0.2176, 0.2198, 0.2373]}, {"w": "2.1.", "b": [0.2261, 0.2176, 0.264, 0.2373]}, {"w": "Loading", "b": [0.2703, 0.2176, 0.3544, 0.2373]}, {"w": "the", "b": [0.3607, 0.2176, 0.3915, 0.2373]}, {"w": "MNIST", "b": [0.3978, 0.2176, 0.4763, 0.2373]}, {"w": "dataset", "b": [0.4826, 0.2176, 0.5526, 0.2373]}, {"w": "in", "b": [0.5589, 0.2176, 0.5786, 0.2373]}, {"w": "Keras", "b": [0.5849, 0.2176, 0.6437, 0.2373]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 2.2. The network architecture", "words": [{"w": "Listing", "b": [0.1483, 0.2452, 0.2198, 0.265]}, {"w": "2.2.", "b": [0.2261, 0.2452, 0.264, 0.265]}, {"w": "The", "b": [0.2703, 0.2452, 0.3095, 0.265]}, {"w": "network", "b": [0.3158, 0.2452, 0.3985, 0.265]}, {"w": "architecture", "b": [0.4048, 0.2452, 0.5238, 0.265]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 2.3. The compilation step", "words": [{"w": "Listing", "b": [0.1483, 0.2729, 0.2198, 0.2926]}, {"w": "2.3.", "b": [0.2261, 0.2729, 0.264, 0.2926]}, {"w": "The", "b": [0.2703, 0.2729, 0.3095, 0.2926]}, {"w": "compilation", "b": [0.3158, 0.2729, 0.4363, 0.2926]}, {"w": "step", "b": [0.4426, 0.2729, 0.4833, 0.2926]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 2.4. Preparing the image data", "words": [{"w": "Listing", "b": [0.1483, 0.3005, 0.2198, 0.3202]}, {"w": "2.4.", "b": [0.2261, 0.3005, 0.264, 0.3202]}, {"w": "Preparing", "b": [0.2703, 0.3005, 0.3684, 0.3202]}, {"w": "the", "b": [0.3747, 0.3005, 0.4055, 0.3202]}, {"w": "image", "b": [0.4118, 0.3005, 0.4734, 0.3202]}, {"w": "data", "b": [0.4797, 0.3005, 0.5218, 0.3202]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 2.5. Preparing the labels", "words": [{"w": "Listing", "b": [0.1483, 0.3281, 0.2198, 0.3479]}, {"w": "2.5.", "b": [0.2261, 0.3281, 0.264, 0.3479]}, {"w": "Preparing", "b": [0.2703, 0.3281, 0.3684, 0.3479]}, {"w": "the", "b": [0.3747, 0.3281, 0.4055, 0.3479]}, {"w": "labels", "b": [0.4118, 0.3281, 0.4706, 0.3479]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 2.6. Displaying the fourth digit", "words": [{"w": "Listing", "b": [0.1483, 0.3557, 0.2198, 0.3755]}, {"w": "2.6.", "b": [0.2261, 0.3557, 0.264, 0.3755]}, {"w": "Displaying", "b": [0.2703, 0.3557, 0.381, 0.3755]}, {"w": "the", "b": [0.3873, 0.3557, 0.4181, 0.3755]}, {"w": "fourth", "b": [0.4244, 0.3557, 0.4861, 0.3755]}, {"w": "digit", "b": [0.4924, 0.3557, 0.5386, 0.3755]}]}, {"id": "b_9", "type": "paragraph", "text": "Chapter 3. Getting started with neural networks", "words": [{"w": "Chapter", "b": [0.1294, 0.3985, 0.2093, 0.4183]}, {"w": "3.", "b": [0.2156, 0.3985, 0.2345, 0.4183]}, {"w": "Getting", "b": [0.2408, 0.3985, 0.3165, 0.4183]}, {"w": "started", "b": [0.3228, 0.3985, 0.39, 0.4183]}, {"w": "with", "b": [0.3964, 0.3985, 0.4412, 0.4183]}, {"w": "neural", "b": [0.4475, 0.3985, 0.5105, 0.4183]}, {"w": "networks", "b": [0.5169, 0.3985, 0.6093, 0.4183]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 3.1. Loading the IMDB dataset", "words": [{"w": "Listing", "b": [0.1483, 0.4369, 0.2198, 0.4566]}, {"w": "3.1.", "b": [0.2261, 0.4369, 0.264, 0.4566]}, {"w": "Loading", "b": [0.2703, 0.4369, 0.3544, 0.4566]}, {"w": "the", "b": [0.3607, 0.4369, 0.3915, 0.4566]}, {"w": "IMDB", "b": [0.3978, 0.4369, 0.4637, 0.4566]}, {"w": "dataset", "b": [0.47, 0.4369, 0.54, 0.4566]}]}, {"id": "b_11", "type": "paragraph", "text": "Listing 3.2. Encoding the integer sequences into a binary matrix", "words": [{"w": "Listing", "b": [0.1483, 0.4645, 0.2198, 0.4842]}, {"w": "3.2.", "b": [0.2261, 0.4645, 0.264, 0.4842]}, {"w": "Encoding", "b": [0.2703, 0.4645, 0.367, 0.4842]}, {"w": "the", "b": [0.3733, 0.4645, 0.4041, 0.4842]}, {"w": "integer", "b": [0.4104, 0.4645, 0.4805, 0.4842]}, {"w": "sequences", "b": [0.4868, 0.4645, 0.589, 0.4842]}, {"w": "into", "b": [0.5953, 0.4645, 0.6346, 0.4842]}, {"w": "a", "b": [0.6409, 0.4645, 0.6521, 0.4842]}, {"w": "binary", "b": [0.6584, 0.4645, 0.7228, 0.4842]}, {"w": "matrix", "b": [0.7292, 0.4645, 0.795, 0.4842]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 3.3. The model definition", "words": [{"w": "Listing", "b": [0.1483, 0.4921, 0.2198, 0.5119]}, {"w": "3.3.", "b": [0.2261, 0.4921, 0.264, 0.5119]}, {"w": "The", "b": [0.2703, 0.4921, 0.3095, 0.5119]}, {"w": "model", "b": [0.3158, 0.4921, 0.3789, 0.5119]}, {"w": "definition", "b": [0.3852, 0.4921, 0.4833, 0.5119]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 3.4. Compiling the model", "words": [{"w": "Listing", "b": [0.1483, 0.5197, 0.2198, 0.5395]}, {"w": "3.4.", "b": [0.2261, 0.5197, 0.264, 0.5395]}, {"w": "Compiling", "b": [0.2703, 0.5197, 0.3782, 0.5395]}, {"w": "the", "b": [0.3845, 0.5197, 0.4153, 0.5395]}, {"w": "model", "b": [0.4217, 0.5197, 0.4847, 0.5395]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 3.5. Configuring the optimizer", "words": [{"w": "Listing", "b": [0.1483, 0.5474, 0.2198, 0.5671]}, {"w": "3.5.", "b": [0.2261, 0.5474, 0.264, 0.5671]}, {"w": "Configuring", "b": [0.2703, 0.5474, 0.3936, 0.5671]}, {"w": "the", "b": [0.3999, 0.5474, 0.4307, 0.5671]}, {"w": "optimizer", "b": [0.437, 0.5474, 0.5337, 0.5671]}]}, {"id": "b_15", "type": "paragraph", "text": "Listing 3.6. Using custom losses and metrics", "words": [{"w": "Listing", "b": [0.1483, 0.575, 0.2198, 0.5948]}, {"w": "3.6.", "b": [0.2261, 0.575, 0.264, 0.5948]}, {"w": "Using", "b": [0.2703, 0.575, 0.3305, 0.5948]}, {"w": "custom", "b": [0.3368, 0.575, 0.4097, 0.5948]}, {"w": "losses", "b": [0.416, 0.575, 0.4763, 0.5948]}, {"w": "and", "b": [0.4826, 0.575, 0.519, 0.5948]}, {"w": "metrics", "b": [0.5253, 0.575, 0.5996, 0.5948]}]}, {"id": "b_16", "type": "paragraph", "text": "Listing 3.7. Setting aside a validation set", "words": [{"w": "Listing", "b": [0.1483, 0.6026, 0.2198, 0.6224]}, {"w": "3.7.", "b": [0.2261, 0.6026, 0.264, 0.6224]}, {"w": "Setting", "b": [0.2703, 0.6026, 0.3418, 0.6224]}, {"w": "aside", "b": [0.3481, 0.6026, 0.3999, 0.6224]}, {"w": "a", "b": [0.4062, 0.6026, 0.4174, 0.6224]}, {"w": "validation", "b": [0.4237, 0.6026, 0.5246, 0.6224]}, {"w": "set", "b": [0.5309, 0.6026, 0.559, 0.6224]}]}, {"id": "b_17", "type": "paragraph", "text": "Listing 3.8. Training your model", "words": [{"w": "Listing", "b": [0.1483, 0.6303, 0.2198, 0.65]}, {"w": "3.8.", "b": [0.2261, 0.6303, 0.264, 0.65]}, {"w": "Training", "b": [0.2703, 0.6303, 0.3562, 0.65]}, {"w": "your", "b": [0.3626, 0.6303, 0.4088, 0.65]}, {"w": "model", "b": [0.4151, 0.6303, 0.4782, 0.65]}]}, {"id": "b_18", "type": "paragraph", "text": "Listing 3.9. Plotting the training and validation loss", "words": [{"w": "Listing", "b": [0.1483, 0.6579, 0.2198, 0.6776]}, {"w": "3.9.", "b": [0.2261, 0.6579, 0.264, 0.6776]}, {"w": "Plotting", "b": [0.2703, 0.6579, 0.3502, 0.6776]}, {"w": "the", "b": [0.3565, 0.6579, 0.3873, 0.6776]}, {"w": "training", "b": [0.3936, 0.6579, 0.4721, 0.6776]}, {"w": "and", "b": [0.4784, 0.6579, 0.5148, 0.6776]}, {"w": "validation", "b": [0.5211, 0.6579, 0.622, 0.6776]}, {"w": "loss", "b": [0.6284, 0.6579, 0.6676, 0.6776]}]}, {"id": "b_19", "type": "paragraph", "text": "Listing 3.10. Plotting the training and validation accuracy", "words": [{"w": "Listing", "b": [0.1483, 0.6855, 0.2198, 0.7053]}, {"w": "3.10.", "b": [0.2261, 0.6855, 0.2766, 0.7053]}, {"w": "Plotting", "b": [0.2829, 0.6855, 0.3628, 0.7053]}, {"w": "the", "b": [0.3691, 0.6855, 0.3999, 0.7053]}, {"w": "training", "b": [0.4062, 0.6855, 0.4847, 0.7053]}, {"w": "and", "b": [0.491, 0.6855, 0.5274, 0.7053]}, {"w": "validation", "b": [0.5338, 0.6855, 0.6347, 0.7053]}, {"w": "accuracy", "b": [0.641, 0.6855, 0.7306, 0.7053]}]}, {"id": "b_20", "type": "paragraph", "text": "Listing 3.11. Retraining a model from scratch", "words": [{"w": "Listing", "b": [0.1483, 0.7132, 0.2198, 0.7329]}, {"w": "3.11.", "b": [0.2261, 0.7132, 0.2756, 0.7329]}, {"w": "Retraining", "b": [0.2819, 0.7132, 0.3884, 0.7329]}, {"w": "a", "b": [0.3947, 0.7132, 0.4059, 0.7329]}, {"w": "model", "b": [0.4123, 0.7132, 0.4753, 0.7329]}, {"w": "from", "b": [0.4816, 0.7132, 0.5307, 0.7329]}, {"w": "scratch", "b": [0.537, 0.7132, 0.6084, 0.7329]}]}, {"id": "b_21", "type": "paragraph", "text": "Listing 3.12. Loading the Reuters dataset", "words": [{"w": "Listing", "b": [0.1483, 0.7408, 0.2198, 0.7605]}, {"w": "3.12.", "b": [0.2261, 0.7408, 0.2766, 0.7605]}, {"w": "Loading", "b": [0.2829, 0.7408, 0.367, 0.7605]}, {"w": "the", "b": [0.3733, 0.7408, 0.4041, 0.7605]}, {"w": "Reuters", "b": [0.4104, 0.7408, 0.4875, 0.7605]}, {"w": "dataset", "b": [0.4938, 0.7408, 0.5638, 0.7605]}]}, {"id": "b_22", "type": "paragraph", "text": "Listing 3.13. Decoding newswires back to text", "words": [{"w": "Listing", "b": [0.1483, 0.7684, 0.2198, 0.7882]}, {"w": "3.13.", "b": [0.2261, 0.7684, 0.2766, 0.7882]}, {"w": "Decoding", "b": [0.2829, 0.7684, 0.381, 0.7882]}, {"w": "newswires", "b": [0.3873, 0.7684, 0.4937, 0.7882]}, {"w": "back", "b": [0.5001, 0.7684, 0.5477, 0.7882]}, {"w": "to", "b": [0.554, 0.7684, 0.5736, 0.7882]}, {"w": "text", "b": [0.5799, 0.7684, 0.6178, 0.7882]}]}, {"id": "b_23", "type": "paragraph", "text": "Listing 3.14. Encoding the data", "words": [{"w": "Listing", "b": [0.1483, 0.7961, 0.2198, 0.8158]}, {"w": "3.14.", "b": [0.2261, 0.7961, 0.2766, 0.8158]}, {"w": "Encoding", "b": [0.2829, 0.7961, 0.3796, 0.8158]}, {"w": "the", "b": [0.3859, 0.7961, 0.4167, 0.8158]}, {"w": "data", "b": [0.423, 0.7961, 0.465, 0.8158]}]}, {"id": "b_24", "type": "paragraph", "text": "Listing 3.15. Model definition", "words": [{"w": "Listing", "b": [0.1483, 0.8237, 0.2198, 0.8434]}, {"w": "3.15.", "b": [0.2261, 0.8237, 0.2766, 0.8434]}, {"w": "Model", "b": [0.2829, 0.8237, 0.3488, 0.8434]}, {"w": "definition", "b": [0.3551, 0.8237, 0.4532, 0.8434]}]}, {"id": "b_25", "type": "paragraph", "text": "Listing 3.16. Compiling the model", "words": [{"w": "Listing", "b": [0.1483, 0.8513, 0.2198, 0.8711]}, {"w": "3.16.", "b": [0.2261, 0.8513, 0.2766, 0.8711]}, {"w": "Compiling", "b": [0.2829, 0.8513, 0.3908, 0.8711]}, {"w": "the", "b": [0.3971, 0.8513, 0.428, 0.8711]}, {"w": "model", "b": [0.4343, 0.8513, 0.4973, 0.8711]}]}, {"id": "b_26", "type": "paragraph", "text": "Listing 3.17. Setting aside a validation set", "words": [{"w": "Listing", "b": [0.1483, 0.8789, 0.2198, 0.8987]}, {"w": "3.17.", "b": [0.2261, 0.8789, 0.2766, 0.8987]}, {"w": "Setting", "b": [0.2829, 0.8789, 0.3544, 0.8987]}, {"w": "aside", "b": [0.3607, 0.8789, 0.4125, 0.8987]}, {"w": "a", "b": [0.4188, 0.8789, 0.43, 0.8987]}, {"w": "validation", "b": [0.4363, 0.8789, 0.5372, 0.8987]}, {"w": "set", "b": [0.5435, 0.8789, 0.5716, 0.8987]}]}]}, {"page": 487, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 3.18. Training the model", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "3.18.", "b": [0.2261, 0.0857, 0.2766, 0.1054]}, {"w": "Training", "b": [0.2829, 0.0857, 0.3689, 0.1054]}, {"w": "the", "b": [0.3752, 0.0857, 0.406, 0.1054]}, {"w": "model", "b": [0.4123, 0.0857, 0.4754, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 3.19. Plotting the training and validation loss", "words": [{"w": "Listing", "b": [0.1483, 0.1133, 0.2198, 0.133]}, {"w": "3.19.", "b": [0.2261, 0.1133, 0.2766, 0.133]}, {"w": "Plotting", "b": [0.2829, 0.1133, 0.3628, 0.133]}, {"w": "the", "b": [0.3691, 0.1133, 0.3999, 0.133]}, {"w": "training", "b": [0.4062, 0.1133, 0.4847, 0.133]}, {"w": "and", "b": [0.491, 0.1133, 0.5274, 0.133]}, {"w": "validation", "b": [0.5338, 0.1133, 0.6347, 0.133]}, {"w": "loss", "b": [0.641, 0.1133, 0.6802, 0.133]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 3.20. Plotting the training and validation accuracy", "words": [{"w": "Listing", "b": [0.1483, 0.1409, 0.2198, 0.1607]}, {"w": "3.20.", "b": [0.2261, 0.1409, 0.2766, 0.1607]}, {"w": "Plotting", "b": [0.2829, 0.1409, 0.3628, 0.1607]}, {"w": "the", "b": [0.3691, 0.1409, 0.3999, 0.1607]}, {"w": "training", "b": [0.4062, 0.1409, 0.4847, 0.1607]}, {"w": "and", "b": [0.491, 0.1409, 0.5274, 0.1607]}, {"w": "validation", "b": [0.5338, 0.1409, 0.6347, 0.1607]}, {"w": "accuracy", "b": [0.641, 0.1409, 0.7306, 0.1607]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 3.21. Retraining a model from scratch", "words": [{"w": "Listing", "b": [0.1483, 0.1686, 0.2198, 0.1883]}, {"w": "3.21.", "b": [0.2261, 0.1686, 0.2766, 0.1883]}, {"w": "Retraining", "b": [0.2829, 0.1686, 0.3894, 0.1883]}, {"w": "a", "b": [0.3957, 0.1686, 0.4069, 0.1883]}, {"w": "model", "b": [0.4132, 0.1686, 0.4763, 0.1883]}, {"w": "from", "b": [0.4826, 0.1686, 0.5316, 0.1883]}, {"w": "scratch", "b": [0.5379, 0.1686, 0.6094, 0.1883]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 3.22. Generating predictions for new data", "words": [{"w": "Listing", "b": [0.1483, 0.1962, 0.2198, 0.2159]}, {"w": "3.22.", "b": [0.2261, 0.1962, 0.2766, 0.2159]}, {"w": "Generating", "b": [0.2829, 0.1962, 0.395, 0.2159]}, {"w": "predictions", "b": [0.4013, 0.1962, 0.5134, 0.2159]}, {"w": "for", "b": [0.5197, 0.1962, 0.5491, 0.2159]}, {"w": "new", "b": [0.5554, 0.1962, 0.5974, 0.2159]}, {"w": "data", "b": [0.6037, 0.1962, 0.6458, 0.2159]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 3.23. A model with an information bottleneck", "words": [{"w": "Listing", "b": [0.1483, 0.2238, 0.2198, 0.2436]}, {"w": "3.23.", "b": [0.2261, 0.2238, 0.2766, 0.2436]}, {"w": "A", "b": [0.2829, 0.2238, 0.3011, 0.2436]}, {"w": "model", "b": [0.3074, 0.2238, 0.3705, 0.2436]}, {"w": "with", "b": [0.3768, 0.2238, 0.4216, 0.2436]}, {"w": "an", "b": [0.4279, 0.2238, 0.4517, 0.2436]}, {"w": "information", "b": [0.4581, 0.2238, 0.5772, 0.2436]}, {"w": "bottleneck", "b": [0.5835, 0.2238, 0.6886, 0.2436]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 3.24. Loading the Boston housing dataset", "words": [{"w": "Listing", "b": [0.1483, 0.2515, 0.2198, 0.2712]}, {"w": "3.24.", "b": [0.2261, 0.2515, 0.2766, 0.2712]}, {"w": "Loading", "b": [0.2829, 0.2515, 0.367, 0.2712]}, {"w": "the", "b": [0.3733, 0.2515, 0.4041, 0.2712]}, {"w": "Boston", "b": [0.4104, 0.2515, 0.4819, 0.2712]}, {"w": "housing", "b": [0.4882, 0.2515, 0.5681, 0.2712]}, {"w": "dataset", "b": [0.5744, 0.2515, 0.6444, 0.2712]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 3.25. Normalizing the data", "words": [{"w": "Listing", "b": [0.1483, 0.2791, 0.2198, 0.2988]}, {"w": "3.25.", "b": [0.2261, 0.2791, 0.2766, 0.2988]}, {"w": "Normalizing", "b": [0.2829, 0.2791, 0.4104, 0.2988]}, {"w": "the", "b": [0.4167, 0.2791, 0.4475, 0.2988]}, {"w": "data", "b": [0.4538, 0.2791, 0.4959, 0.2988]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 3.26. Model definition", "words": [{"w": "Listing", "b": [0.1483, 0.3067, 0.2198, 0.3265]}, {"w": "3.26.", "b": [0.2261, 0.3067, 0.2766, 0.3265]}, {"w": "Model", "b": [0.2829, 0.3067, 0.3488, 0.3265]}, {"w": "definition", "b": [0.3551, 0.3067, 0.4532, 0.3265]}]}, {"id": "b_9", "type": "equation", "text": "Listing 3.27. K-fold validation", "words": [{"w": "Listing", "b": [0.1483, 0.3344, 0.2198, 0.3541]}, {"w": "3.27.", "b": [0.2261, 0.3344, 0.2766, 0.3541]}, {"w": "K-fold", "b": [0.2829, 0.3344, 0.3501, 0.3541]}, {"w": "validation", "b": [0.3564, 0.3344, 0.4573, 0.3541]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 3.28. Saving the validation logs at each fold", "words": [{"w": "Listing", "b": [0.1483, 0.362, 0.2198, 0.3817]}, {"w": "3.28.", "b": [0.2261, 0.362, 0.2766, 0.3817]}, {"w": "Saving", "b": [0.2829, 0.362, 0.353, 0.3817]}, {"w": "the", "b": [0.3593, 0.362, 0.3901, 0.3817]}, {"w": "validation", "b": [0.3964, 0.362, 0.4973, 0.3817]}, {"w": "logs", "b": [0.5036, 0.362, 0.5457, 0.3817]}, {"w": "at", "b": [0.552, 0.362, 0.5702, 0.3817]}, {"w": "each", "b": [0.5765, 0.362, 0.6227, 0.3817]}, {"w": "fold", "b": [0.629, 0.362, 0.6696, 0.3817]}]}, {"id": "b_11", "type": "equation", "text": "Listing 3.29. Building the history of successive mean K-fold validation scores", "words": [{"w": "Listing", "b": [0.1483, 0.3896, 0.2198, 0.4094]}, {"w": "3.29.", "b": [0.2261, 0.3896, 0.2766, 0.4094]}, {"w": "Building", "b": [0.2829, 0.3896, 0.3712, 0.4094]}, {"w": "the", "b": [0.3775, 0.3896, 0.4083, 0.4094]}, {"w": "history", "b": [0.4146, 0.3896, 0.4847, 0.4094]}, {"w": "of", "b": [0.491, 0.3896, 0.512, 0.4094]}, {"w": "successive", "b": [0.5183, 0.3896, 0.6248, 0.4094]}, {"w": "mean", "b": [0.6311, 0.3896, 0.6858, 0.4094]}, {"w": "K-fold", "b": [0.6921, 0.3896, 0.7593, 0.4094]}, {"w": "validation", "b": [0.1483, 0.4101, 0.2492, 0.4299]}, {"w": "scores", "b": [0.2555, 0.4101, 0.3186, 0.4299]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 3.30. Plotting validation scores", "words": [{"w": "Listing", "b": [0.1483, 0.4377, 0.2198, 0.4575]}, {"w": "3.30.", "b": [0.2261, 0.4377, 0.2766, 0.4575]}, {"w": "Plotting", "b": [0.2829, 0.4377, 0.3628, 0.4575]}, {"w": "validation", "b": [0.3691, 0.4377, 0.47, 0.4575]}, {"w": "scores", "b": [0.4763, 0.4377, 0.5394, 0.4575]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 3.31. Plotting validation scores, excluding the first 10 data points", "words": [{"w": "Listing", "b": [0.1483, 0.4654, 0.2198, 0.4851]}, {"w": "3.31.", "b": [0.2261, 0.4654, 0.2766, 0.4851]}, {"w": "Plotting", "b": [0.2829, 0.4654, 0.3628, 0.4851]}, {"w": "validation", "b": [0.3691, 0.4654, 0.47, 0.4851]}, {"w": "scores,", "b": [0.4763, 0.4654, 0.5457, 0.4851]}, {"w": "excluding", "b": [0.552, 0.4654, 0.6515, 0.4851]}, {"w": "the", "b": [0.6578, 0.4654, 0.6886, 0.4851]}, {"w": "first", "b": [0.6949, 0.4654, 0.7355, 0.4851]}, {"w": "10", "b": [0.7418, 0.4654, 0.7671, 0.4851]}, {"w": "data", "b": [0.7734, 0.4654, 0.8154, 0.4851]}, {"w": "points", "b": [0.1483, 0.4859, 0.21, 0.5056]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 3.32. Training the final model", "words": [{"w": "Listing", "b": [0.1483, 0.5135, 0.2198, 0.5332]}, {"w": "3.32.", "b": [0.2261, 0.5135, 0.2766, 0.5332]}, {"w": "Training", "b": [0.2829, 0.5135, 0.3689, 0.5332]}, {"w": "the", "b": [0.3752, 0.5135, 0.406, 0.5332]}, {"w": "final", "b": [0.4123, 0.5135, 0.4585, 0.5332]}, {"w": "model", "b": [0.4648, 0.5135, 0.5279, 0.5332]}]}, {"id": "b_15", "type": "paragraph", "text": "Chapter 4. Fundamentals of machine learning", "words": [{"w": "Chapter", "b": [0.1294, 0.5563, 0.2093, 0.576]}, {"w": "4.", "b": [0.2156, 0.5563, 0.2345, 0.576]}, {"w": "Fundamentals", "b": [0.2408, 0.5563, 0.3824, 0.576]}, {"w": "of", "b": [0.3887, 0.5563, 0.4097, 0.576]}, {"w": "machine", "b": [0.416, 0.5563, 0.5014, 0.576]}, {"w": "learning", "b": [0.5077, 0.5563, 0.5904, 0.576]}]}, {"id": "b_16", "type": "equation", "text": "Listing 4.1. Hold-out validation", "words": [{"w": "Listing", "b": [0.1483, 0.5946, 0.2198, 0.6144]}, {"w": "4.1.", "b": [0.2261, 0.5946, 0.264, 0.6144]}, {"w": "Hold-out", "b": [0.2703, 0.5946, 0.3614, 0.6144]}, {"w": "validation", "b": [0.3677, 0.5946, 0.4686, 0.6144]}]}, {"id": "b_17", "type": "equation", "text": "Listing 4.2. K-fold cross-validation", "words": [{"w": "Listing", "b": [0.1483, 0.6222, 0.2198, 0.642]}, {"w": "4.2.", "b": [0.2261, 0.6222, 0.264, 0.642]}, {"w": "K-fold", "b": [0.2703, 0.6222, 0.3375, 0.642]}, {"w": "cross-validation", "b": [0.3438, 0.6222, 0.505, 0.642]}]}, {"id": "b_18", "type": "paragraph", "text": "Listing 4.3. Original model", "words": [{"w": "Listing", "b": [0.1483, 0.6499, 0.2198, 0.6696]}, {"w": "4.3.", "b": [0.2261, 0.6499, 0.264, 0.6696]}, {"w": "Original", "b": [0.2703, 0.6499, 0.3544, 0.6696]}, {"w": "model", "b": [0.3607, 0.6499, 0.4237, 0.6696]}]}, {"id": "b_19", "type": "paragraph", "text": "Listing 4.4. Version of the model with lower capacity", "words": [{"w": "Listing", "b": [0.1483, 0.6775, 0.2198, 0.6973]}, {"w": "4.4.", "b": [0.2261, 0.6775, 0.264, 0.6973]}, {"w": "Version", "b": [0.2703, 0.6775, 0.3473, 0.6973]}, {"w": "of", "b": [0.3536, 0.6775, 0.3747, 0.6973]}, {"w": "the", "b": [0.381, 0.6775, 0.4118, 0.6973]}, {"w": "model", "b": [0.4181, 0.6775, 0.4812, 0.6973]}, {"w": "with", "b": [0.4875, 0.6775, 0.5323, 0.6973]}, {"w": "lower", "b": [0.5386, 0.6775, 0.5961, 0.6973]}, {"w": "capacity", "b": [0.6024, 0.6775, 0.6864, 0.6973]}]}, {"id": "b_20", "type": "paragraph", "text": "Listing 4.5. Version of the model with higher capacity", "words": [{"w": "Listing", "b": [0.1483, 0.7051, 0.2198, 0.7249]}, {"w": "4.5.", "b": [0.2261, 0.7051, 0.264, 0.7249]}, {"w": "Version", "b": [0.2703, 0.7051, 0.3473, 0.7249]}, {"w": "of", "b": [0.3536, 0.7051, 0.3747, 0.7249]}, {"w": "the", "b": [0.381, 0.7051, 0.4118, 0.7249]}, {"w": "model", "b": [0.4181, 0.7051, 0.4812, 0.7249]}, {"w": "with", "b": [0.4875, 0.7051, 0.5323, 0.7249]}, {"w": "higher", "b": [0.5386, 0.7051, 0.6031, 0.7249]}, {"w": "capacity", "b": [0.6094, 0.7051, 0.6934, 0.7249]}]}, {"id": "b_21", "type": "paragraph", "text": "Listing 4.6. Adding L2 weight regularization to the model", "words": [{"w": "Listing", "b": [0.1483, 0.7328, 0.2198, 0.7525]}, {"w": "4.6.", "b": [0.2261, 0.7328, 0.264, 0.7525]}, {"w": "Adding", "b": [0.2703, 0.7328, 0.3459, 0.7525]}, {"w": "L2", "b": [0.3523, 0.7328, 0.3803, 0.7525]}, {"w": "weight", "b": [0.3866, 0.7328, 0.4553, 0.7525]}, {"w": "regularization", "b": [0.4616, 0.7328, 0.6017, 0.7525]}, {"w": "to", "b": [0.608, 0.7328, 0.6276, 0.7525]}, {"w": "the", "b": [0.6339, 0.7328, 0.6647, 0.7525]}, {"w": "model", "b": [0.671, 0.7328, 0.7341, 0.7525]}]}, {"id": "b_22", "type": "paragraph", "text": "Listing 4.7. Different weight regularizers available in Keras", "words": [{"w": "Listing", "b": [0.1483, 0.7604, 0.2198, 0.7801]}, {"w": "4.7.", "b": [0.2261, 0.7604, 0.264, 0.7801]}, {"w": "Different", "b": [0.2703, 0.7604, 0.3623, 0.7801]}, {"w": "weight", "b": [0.3686, 0.7604, 0.4372, 0.7801]}, {"w": "regularizers", "b": [0.4435, 0.7604, 0.5626, 0.7801]}, {"w": "available", "b": [0.5689, 0.7604, 0.66, 0.7801]}, {"w": "in", "b": [0.6663, 0.7604, 0.6859, 0.7801]}, {"w": "Keras", "b": [0.6922, 0.7604, 0.751, 0.7801]}]}, {"id": "b_23", "type": "paragraph", "text": "Listing 4.8. Adding dropout to the IMDB network", "words": [{"w": "Listing", "b": [0.1483, 0.788, 0.2198, 0.8078]}, {"w": "4.8.", "b": [0.2261, 0.788, 0.264, 0.8078]}, {"w": "Adding", "b": [0.2703, 0.788, 0.3459, 0.8078]}, {"w": "dropout", "b": [0.3523, 0.788, 0.4307, 0.8078]}, {"w": "to", "b": [0.437, 0.788, 0.4567, 0.8078]}, {"w": "the", "b": [0.463, 0.788, 0.4938, 0.8078]}, {"w": "IMDB", "b": [0.5001, 0.788, 0.566, 0.8078]}, {"w": "network", "b": [0.5723, 0.788, 0.6549, 0.8078]}]}, {"id": "b_24", "type": "paragraph", "text": "Chapter 5. Deep learning for computer vision", "words": [{"w": "Chapter", "b": [0.1294, 0.8308, 0.2093, 0.8506]}, {"w": "5.", "b": [0.2156, 0.8308, 0.2345, 0.8506]}, {"w": "Deep", "b": [0.2408, 0.8308, 0.294, 0.8506]}, {"w": "learning", "b": [0.3003, 0.8308, 0.383, 0.8506]}, {"w": "for", "b": [0.3893, 0.8308, 0.4187, 0.8506]}, {"w": "computer", "b": [0.425, 0.8308, 0.5203, 0.8506]}, {"w": "vision", "b": [0.5266, 0.8308, 0.5883, 0.8506]}]}, {"id": "b_25", "type": "paragraph", "text": "Listing 5.1. Instantiating a small convnet", "words": [{"w": "Listing", "b": [0.1483, 0.8691, 0.2198, 0.8889]}, {"w": "5.1.", "b": [0.2261, 0.8691, 0.264, 0.8889]}, {"w": "Instantiating", "b": [0.2703, 0.8691, 0.3964, 0.8889]}, {"w": "a", "b": [0.4027, 0.8691, 0.4139, 0.8889]}, {"w": "small", "b": [0.4202, 0.8691, 0.4749, 0.8889]}, {"w": "convnet", "b": [0.4812, 0.8691, 0.5611, 0.8889]}]}]}, {"page": 488, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 5.2. Adding a classifier on top of the convnet", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "5.2.", "b": [0.2261, 0.0857, 0.264, 0.1054]}, {"w": "Adding", "b": [0.2703, 0.0857, 0.3459, 0.1054]}, {"w": "a", "b": [0.3523, 0.0857, 0.3635, 0.1054]}, {"w": "classifier", "b": [0.3698, 0.0857, 0.4608, 0.1054]}, {"w": "on", "b": [0.4671, 0.0857, 0.4924, 0.1054]}, {"w": "top", "b": [0.4987, 0.0857, 0.5309, 0.1054]}, {"w": "of", "b": [0.5372, 0.0857, 0.5582, 0.1054]}, {"w": "the", "b": [0.5645, 0.0857, 0.5954, 0.1054]}, {"w": "convnet", "b": [0.6017, 0.0857, 0.6815, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 5.3. Training the convnet on MNIST images", "words": [{"w": "Listing", "b": [0.1483, 0.1133, 0.2198, 0.133]}, {"w": "5.3.", "b": [0.2261, 0.1133, 0.264, 0.133]}, {"w": "Training", "b": [0.2703, 0.1133, 0.3562, 0.133]}, {"w": "the", "b": [0.3626, 0.1133, 0.3934, 0.133]}, {"w": "convnet", "b": [0.3997, 0.1133, 0.4796, 0.133]}, {"w": "on", "b": [0.4859, 0.1133, 0.5111, 0.133]}, {"w": "MNIST", "b": [0.5174, 0.1133, 0.5959, 0.133]}, {"w": "images", "b": [0.6022, 0.1133, 0.6736, 0.133]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.4. Copying images to training, validation, and test directories", "words": [{"w": "Listing", "b": [0.1483, 0.1409, 0.2198, 0.1607]}, {"w": "5.4.", "b": [0.2261, 0.1409, 0.264, 0.1607]}, {"w": "Copying", "b": [0.2703, 0.1409, 0.3572, 0.1607]}, {"w": "images", "b": [0.3635, 0.1409, 0.4349, 0.1607]}, {"w": "to", "b": [0.4413, 0.1409, 0.4609, 0.1607]}, {"w": "training,", "b": [0.4672, 0.1409, 0.552, 0.1607]}, {"w": "validation,", "b": [0.5583, 0.1409, 0.6655, 0.1607]}, {"w": "and", "b": [0.6718, 0.1409, 0.7082, 0.1607]}, {"w": "test", "b": [0.7145, 0.1409, 0.7496, 0.1607]}, {"w": "directories", "b": [0.1483, 0.1614, 0.2548, 0.1812]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.5. Instantiating a small convnet for dogs vs. cats classification", "words": [{"w": "Listing", "b": [0.1483, 0.1891, 0.2198, 0.2088]}, {"w": "5.5.", "b": [0.2261, 0.1891, 0.264, 0.2088]}, {"w": "Instantiating", "b": [0.2703, 0.1891, 0.3964, 0.2088]}, {"w": "a", "b": [0.4027, 0.1891, 0.4139, 0.2088]}, {"w": "small", "b": [0.4202, 0.1891, 0.4749, 0.2088]}, {"w": "convnet", "b": [0.4812, 0.1891, 0.5611, 0.2088]}, {"w": "for", "b": [0.5674, 0.1891, 0.5968, 0.2088]}, {"w": "dogs", "b": [0.6031, 0.1891, 0.6507, 0.2088]}, {"w": "vs.", "b": [0.657, 0.1891, 0.6858, 0.2088]}, {"w": "cats", "b": [0.6921, 0.1891, 0.7313, 0.2088]}, {"w": "classification", "b": [0.1483, 0.2096, 0.2814, 0.2293]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 5.6. Configuring the model for training", "words": [{"w": "Listing", "b": [0.1483, 0.2372, 0.2198, 0.2569]}, {"w": "5.6.", "b": [0.2261, 0.2372, 0.264, 0.2569]}, {"w": "Configuring", "b": [0.2703, 0.2372, 0.3936, 0.2569]}, {"w": "the", "b": [0.3999, 0.2372, 0.4307, 0.2569]}, {"w": "model", "b": [0.437, 0.2372, 0.5001, 0.2569]}, {"w": "for", "b": [0.5064, 0.2372, 0.5358, 0.2569]}, {"w": "training", "b": [0.5421, 0.2372, 0.6206, 0.2569]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.7. Using ImageDataGenerator to read images from directories", "words": [{"w": "Listing", "b": [0.1483, 0.2648, 0.2198, 0.2846]}, {"w": "5.7.", "b": [0.2261, 0.2648, 0.264, 0.2846]}, {"w": "Using", "b": [0.2703, 0.2648, 0.3305, 0.2846]}, {"w": "ImageDataGenerator", "b": [0.3368, 0.2648, 0.5484, 0.2846]}, {"w": "to", "b": [0.5547, 0.2648, 0.5743, 0.2846]}, {"w": "read", "b": [0.5806, 0.2648, 0.624, 0.2846]}, {"w": "images", "b": [0.6303, 0.2648, 0.7018, 0.2846]}, {"w": "from", "b": [0.7081, 0.2648, 0.7571, 0.2846]}, {"w": "directories", "b": [0.1483, 0.2853, 0.2548, 0.3051]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.8. Fitting the model using a batch generator", "words": [{"w": "Listing", "b": [0.1483, 0.313, 0.2198, 0.3327]}, {"w": "5.8.", "b": [0.2261, 0.313, 0.264, 0.3327]}, {"w": "Fitting", "b": [0.2703, 0.313, 0.3376, 0.3327]}, {"w": "the", "b": [0.3439, 0.313, 0.3747, 0.3327]}, {"w": "model", "b": [0.381, 0.313, 0.4441, 0.3327]}, {"w": "using", "b": [0.4504, 0.313, 0.505, 0.3327]}, {"w": "a", "b": [0.5114, 0.313, 0.5226, 0.3327]}, {"w": "batch", "b": [0.5289, 0.313, 0.5835, 0.3327]}, {"w": "generator", "b": [0.5898, 0.313, 0.6851, 0.3327]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 5.9. Saving the model", "words": [{"w": "Listing", "b": [0.1483, 0.3406, 0.2198, 0.3603]}, {"w": "5.9.", "b": [0.2261, 0.3406, 0.264, 0.3603]}, {"w": "Saving", "b": [0.2703, 0.3406, 0.3403, 0.3603]}, {"w": "the", "b": [0.3467, 0.3406, 0.3775, 0.3603]}, {"w": "model", "b": [0.3838, 0.3406, 0.4469, 0.3603]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 5.10. Displaying curves of loss and accuracy during training", "words": [{"w": "Listing", "b": [0.1483, 0.3682, 0.2198, 0.388]}, {"w": "5.10.", "b": [0.2261, 0.3682, 0.2766, 0.388]}, {"w": "Displaying", "b": [0.2829, 0.3682, 0.3936, 0.388]}, {"w": "curves", "b": [0.3999, 0.3682, 0.4657, 0.388]}, {"w": "of", "b": [0.4721, 0.3682, 0.4931, 0.388]}, {"w": "loss", "b": [0.4994, 0.3682, 0.5386, 0.388]}, {"w": "and", "b": [0.5449, 0.3682, 0.5814, 0.388]}, {"w": "accuracy", "b": [0.5877, 0.3682, 0.6773, 0.388]}, {"w": "during", "b": [0.6836, 0.3682, 0.7495, 0.388]}, {"w": "training", "b": [0.7558, 0.3682, 0.8342, 0.388]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 5.11. Setting up a data augmentation configuration via ImageDataGenerator", "words": [{"w": "Listing", "b": [0.1483, 0.3959, 0.2198, 0.4156]}, {"w": "5.11.", "b": [0.2261, 0.3959, 0.2756, 0.4156]}, {"w": "Setting", "b": [0.2819, 0.3959, 0.3534, 0.4156]}, {"w": "up", "b": [0.3597, 0.3959, 0.385, 0.4156]}, {"w": "a", "b": [0.3913, 0.3959, 0.4025, 0.4156]}, {"w": "data", "b": [0.4088, 0.3959, 0.4508, 0.4156]}, {"w": "augmentation", "b": [0.4571, 0.3959, 0.5944, 0.4156]}, {"w": "configuration", "b": [0.6007, 0.3959, 0.7367, 0.4156]}, {"w": "via", "b": [0.743, 0.3959, 0.7738, 0.4156]}, {"w": "ImageDataGenerator", "b": [0.1483, 0.4164, 0.3598, 0.4361]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 5.12. Displaying some randomly augmented training images", "words": [{"w": "Listing", "b": [0.1483, 0.444, 0.2198, 0.4637]}, {"w": "5.12.", "b": [0.2261, 0.444, 0.2766, 0.4637]}, {"w": "Displaying", "b": [0.2829, 0.444, 0.3936, 0.4637]}, {"w": "some", "b": [0.3999, 0.444, 0.4532, 0.4637]}, {"w": "randomly", "b": [0.4595, 0.444, 0.5562, 0.4637]}, {"w": "augmented", "b": [0.5625, 0.444, 0.6732, 0.4637]}, {"w": "training", "b": [0.6795, 0.444, 0.7579, 0.4637]}, {"w": "images", "b": [0.7642, 0.444, 0.8357, 0.4637]}]}, {"id": "b_11", "type": "paragraph", "text": "Listing 5.13. Defining a new convnet that includes dropout", "words": [{"w": "Listing", "b": [0.1483, 0.4716, 0.2198, 0.4914]}, {"w": "5.13.", "b": [0.2261, 0.4716, 0.2766, 0.4914]}, {"w": "Defining", "b": [0.2829, 0.4716, 0.3726, 0.4914]}, {"w": "a", "b": [0.3789, 0.4716, 0.3901, 0.4914]}, {"w": "new", "b": [0.3964, 0.4716, 0.4384, 0.4914]}, {"w": "convnet", "b": [0.4447, 0.4716, 0.5246, 0.4914]}, {"w": "that", "b": [0.5309, 0.4716, 0.5687, 0.4914]}, {"w": "includes", "b": [0.575, 0.4716, 0.6591, 0.4914]}, {"w": "dropout", "b": [0.6654, 0.4716, 0.7439, 0.4914]}]}, {"id": "b_12", "type": "equation", "text": "Listing 5.14. Training the convnet using data-augmentation generators", "words": [{"w": "Listing", "b": [0.1483, 0.4992, 0.2198, 0.519]}, {"w": "5.14.", "b": [0.2261, 0.4992, 0.2766, 0.519]}, {"w": "Training", "b": [0.2829, 0.4992, 0.3689, 0.519]}, {"w": "the", "b": [0.3752, 0.4992, 0.406, 0.519]}, {"w": "convnet", "b": [0.4123, 0.4992, 0.4922, 0.519]}, {"w": "using", "b": [0.4985, 0.4992, 0.5531, 0.519]}, {"w": "data-augmentation", "b": [0.5594, 0.4992, 0.7472, 0.519]}, {"w": "generators", "b": [0.1483, 0.5197, 0.2534, 0.5395]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 5.15. Saving the model", "words": [{"w": "Listing", "b": [0.1483, 0.5474, 0.2198, 0.5671]}, {"w": "5.15.", "b": [0.2261, 0.5474, 0.2766, 0.5671]}, {"w": "Saving", "b": [0.2829, 0.5474, 0.353, 0.5671]}, {"w": "the", "b": [0.3593, 0.5474, 0.3901, 0.5671]}, {"w": "model", "b": [0.3964, 0.5474, 0.4595, 0.5671]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 5.16. Instantiating the VGG16 convolutional base", "words": [{"w": "Listing", "b": [0.1483, 0.575, 0.2198, 0.5948]}, {"w": "5.16.", "b": [0.2261, 0.575, 0.2766, 0.5948]}, {"w": "Instantiating", "b": [0.2829, 0.575, 0.409, 0.5948]}, {"w": "the", "b": [0.4153, 0.575, 0.4461, 0.5948]}, {"w": "VGG16", "b": [0.4525, 0.575, 0.5323, 0.5948]}, {"w": "convolutional", "b": [0.5386, 0.575, 0.6774, 0.5948]}, {"w": "base", "b": [0.6837, 0.575, 0.7285, 0.5948]}]}, {"id": "b_15", "type": "paragraph", "text": "Listing 5.17. Extracting features using the pretrained convolutional base", "words": [{"w": "Listing", "b": [0.1483, 0.6026, 0.2198, 0.6224]}, {"w": "5.17.", "b": [0.2261, 0.6026, 0.2766, 0.6224]}, {"w": "Extracting", "b": [0.2829, 0.6026, 0.388, 0.6224]}, {"w": "features", "b": [0.3943, 0.6026, 0.4741, 0.6224]}, {"w": "using", "b": [0.4804, 0.6026, 0.5351, 0.6224]}, {"w": "the", "b": [0.5414, 0.6026, 0.5722, 0.6224]}, {"w": "pretrained", "b": [0.5785, 0.6026, 0.6808, 0.6224]}, {"w": "convolutional", "b": [0.6871, 0.6026, 0.8258, 0.6224]}, {"w": "base", "b": [0.1483, 0.6231, 0.1932, 0.6429]}]}, {"id": "b_16", "type": "paragraph", "text": "Listing 5.18. Defining and training the densely connected classifier", "words": [{"w": "Listing", "b": [0.1483, 0.6508, 0.2198, 0.6705]}, {"w": "5.18.", "b": [0.2261, 0.6508, 0.2766, 0.6705]}, {"w": "Defining", "b": [0.2829, 0.6508, 0.3726, 0.6705]}, {"w": "and", "b": [0.3789, 0.6508, 0.4153, 0.6705]}, {"w": "training", "b": [0.4216, 0.6508, 0.5001, 0.6705]}, {"w": "the", "b": [0.5064, 0.6508, 0.5372, 0.6705]}, {"w": "densely", "b": [0.5435, 0.6508, 0.6206, 0.6705]}, {"w": "connected", "b": [0.6269, 0.6508, 0.7292, 0.6705]}, {"w": "classifier", "b": [0.7355, 0.6508, 0.8265, 0.6705]}]}, {"id": "b_17", "type": "paragraph", "text": "Listing 5.19. Plotting the results", "words": [{"w": "Listing", "b": [0.1483, 0.6784, 0.2198, 0.6981]}, {"w": "5.19.", "b": [0.2261, 0.6784, 0.2766, 0.6981]}, {"w": "Plotting", "b": [0.2829, 0.6784, 0.3628, 0.6981]}, {"w": "the", "b": [0.3691, 0.6784, 0.3999, 0.6981]}, {"w": "results", "b": [0.4062, 0.6784, 0.4721, 0.6981]}]}, {"id": "b_18", "type": "paragraph", "text": "Listing 5.20. Adding a densely connected classifier on top of the convolutional base", "words": [{"w": "Listing", "b": [0.1483, 0.706, 0.2198, 0.7258]}, {"w": "5.20.", "b": [0.2261, 0.706, 0.2766, 0.7258]}, {"w": "Adding", "b": [0.2829, 0.706, 0.3586, 0.7258]}, {"w": "a", "b": [0.3649, 0.706, 0.3761, 0.7258]}, {"w": "densely", "b": [0.3824, 0.706, 0.4594, 0.7258]}, {"w": "connected", "b": [0.4657, 0.706, 0.568, 0.7258]}, {"w": "classifier", "b": [0.5743, 0.706, 0.6654, 0.7258]}, {"w": "on", "b": [0.6717, 0.706, 0.6969, 0.7258]}, {"w": "top", "b": [0.7032, 0.706, 0.7355, 0.7258]}, {"w": "of", "b": [0.7418, 0.706, 0.7628, 0.7258]}, {"w": "the", "b": [0.7691, 0.706, 0.7999, 0.7258]}, {"w": "convolutional", "b": [0.1483, 0.7265, 0.2871, 0.7463]}, {"w": "base", "b": [0.2934, 0.7265, 0.3382, 0.7463]}]}, {"id": "b_19", "type": "paragraph", "text": "Listing 5.21. Training the model end to end with a frozen convolutional base", "words": [{"w": "Listing", "b": [0.1483, 0.7542, 0.2198, 0.7739]}, {"w": "5.21.", "b": [0.2261, 0.7542, 0.2766, 0.7739]}, {"w": "Training", "b": [0.2829, 0.7542, 0.3689, 0.7739]}, {"w": "the", "b": [0.3752, 0.7542, 0.406, 0.7739]}, {"w": "model", "b": [0.4123, 0.7542, 0.4754, 0.7739]}, {"w": "end", "b": [0.4817, 0.7542, 0.5181, 0.7739]}, {"w": "to", "b": [0.5244, 0.7542, 0.544, 0.7739]}, {"w": "end", "b": [0.5503, 0.7542, 0.5868, 0.7739]}, {"w": "with", "b": [0.5931, 0.7542, 0.6379, 0.7739]}, {"w": "a", "b": [0.6442, 0.7542, 0.6554, 0.7739]}, {"w": "frozen", "b": [0.6617, 0.7542, 0.7262, 0.7739]}, {"w": "convolutional", "b": [0.1483, 0.7747, 0.2871, 0.7944]}, {"w": "base", "b": [0.2934, 0.7747, 0.3382, 0.7944]}]}, {"id": "b_20", "type": "paragraph", "text": "Listing 5.22. Freezing all layers up to a specific one", "words": [{"w": "Listing", "b": [0.1483, 0.8023, 0.2198, 0.822]}, {"w": "5.22.", "b": [0.2261, 0.8023, 0.2766, 0.822]}, {"w": "Freezing", "b": [0.2829, 0.8023, 0.3712, 0.822]}, {"w": "all", "b": [0.3775, 0.8023, 0.4027, 0.822]}, {"w": "layers", "b": [0.409, 0.8023, 0.4692, 0.822]}, {"w": "up", "b": [0.4755, 0.8023, 0.5008, 0.822]}, {"w": "to", "b": [0.5071, 0.8023, 0.5267, 0.822]}, {"w": "a", "b": [0.533, 0.8023, 0.5442, 0.822]}, {"w": "specific", "b": [0.5505, 0.8023, 0.629, 0.822]}, {"w": "one", "b": [0.6353, 0.8023, 0.6717, 0.822]}]}, {"id": "b_21", "type": "equation", "text": "Listing 5.23. Fine-tuning the model", "words": [{"w": "Listing", "b": [0.1483, 0.8299, 0.2198, 0.8497]}, {"w": "5.23.", "b": [0.2261, 0.8299, 0.2766, 0.8497]}, {"w": "Fine-tuning", "b": [0.2829, 0.8299, 0.4006, 0.8497]}, {"w": "the", "b": [0.4069, 0.8299, 0.4377, 0.8497]}, {"w": "model", "b": [0.4441, 0.8299, 0.5071, 0.8497]}]}, {"id": "b_22", "type": "paragraph", "text": "Listing 5.24. Smoothing the plots", "words": [{"w": "Listing", "b": [0.1483, 0.8576, 0.2198, 0.8773]}, {"w": "5.24.", "b": [0.2261, 0.8576, 0.2766, 0.8773]}, {"w": "Smoothing", "b": [0.2829, 0.8576, 0.3936, 0.8773]}, {"w": "the", "b": [0.3999, 0.8576, 0.4308, 0.8773]}, {"w": "plots", "b": [0.4371, 0.8576, 0.4861, 0.8773]}]}, {"id": "b_23", "type": "paragraph", "text": "Listing 5.25. Preprocessing a single image", "words": [{"w": "Listing", "b": [0.1483, 0.8852, 0.2198, 0.9049]}, {"w": "5.25.", "b": [0.2261, 0.8852, 0.2766, 0.9049]}, {"w": "Preprocessing", "b": [0.2829, 0.8852, 0.4244, 0.9049]}, {"w": "a", "b": [0.4307, 0.8852, 0.4419, 0.9049]}, {"w": "single", "b": [0.4482, 0.8852, 0.5085, 0.9049]}, {"w": "image", "b": [0.5148, 0.8852, 0.5764, 0.9049]}]}]}, {"page": 489, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 5.26. Displaying the test picture", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "5.26.", "b": [0.2261, 0.0857, 0.2766, 0.1054]}, {"w": "Displaying", "b": [0.2829, 0.0857, 0.3936, 0.1054]}, {"w": "the", "b": [0.3999, 0.0857, 0.4307, 0.1054]}, {"w": "test", "b": [0.437, 0.0857, 0.4721, 0.1054]}, {"w": "picture", "b": [0.4784, 0.0857, 0.5484, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 5.27. Instantiating a model from an input tensor and a list of output tensors", "words": [{"w": "Listing", "b": [0.1483, 0.1133, 0.2198, 0.133]}, {"w": "5.27.", "b": [0.2261, 0.1133, 0.2766, 0.133]}, {"w": "Instantiating", "b": [0.2829, 0.1133, 0.409, 0.133]}, {"w": "a", "b": [0.4153, 0.1133, 0.4265, 0.133]}, {"w": "model", "b": [0.4328, 0.1133, 0.4959, 0.133]}, {"w": "from", "b": [0.5022, 0.1133, 0.5512, 0.133]}, {"w": "an", "b": [0.5575, 0.1133, 0.5814, 0.133]}, {"w": "input", "b": [0.5877, 0.1133, 0.6395, 0.133]}, {"w": "tensor", "b": [0.6458, 0.1133, 0.7075, 0.133]}, {"w": "and", "b": [0.7138, 0.1133, 0.7502, 0.133]}, {"w": "a", "b": [0.7565, 0.1133, 0.7677, 0.133]}, {"w": "list", "b": [0.774, 0.1133, 0.8049, 0.133]}, {"w": "of", "b": [0.8112, 0.1133, 0.8322, 0.133]}, {"w": "output", "b": [0.1483, 0.1338, 0.2128, 0.1535]}, {"w": "tensors", "b": [0.2191, 0.1338, 0.2906, 0.1535]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 5.28. Running the model in predict mode", "words": [{"w": "Listing", "b": [0.1483, 0.1614, 0.2198, 0.1812]}, {"w": "5.28.", "b": [0.2261, 0.1614, 0.2766, 0.1812]}, {"w": "Running", "b": [0.2829, 0.1614, 0.3698, 0.1812]}, {"w": "the", "b": [0.3761, 0.1614, 0.4069, 0.1812]}, {"w": "model", "b": [0.4132, 0.1614, 0.4763, 0.1812]}, {"w": "in", "b": [0.4826, 0.1614, 0.5022, 0.1812]}, {"w": "predict", "b": [0.5085, 0.1614, 0.5786, 0.1812]}, {"w": "mode", "b": [0.5849, 0.1614, 0.6409, 0.1812]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 5.29. Visualizing the fourth channel", "words": [{"w": "Listing", "b": [0.1483, 0.1891, 0.2198, 0.2088]}, {"w": "5.29.", "b": [0.2261, 0.1891, 0.2766, 0.2088]}, {"w": "Visualizing", "b": [0.2829, 0.1891, 0.3977, 0.2088]}, {"w": "the", "b": [0.404, 0.1891, 0.4348, 0.2088]}, {"w": "fourth", "b": [0.4411, 0.1891, 0.5028, 0.2088]}, {"w": "channel", "b": [0.5091, 0.1891, 0.5875, 0.2088]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 5.30. Visualizing the seventh channel", "words": [{"w": "Listing", "b": [0.1483, 0.2167, 0.2198, 0.2364]}, {"w": "5.30.", "b": [0.2261, 0.2167, 0.2766, 0.2364]}, {"w": "Visualizing", "b": [0.2829, 0.2167, 0.3977, 0.2364]}, {"w": "the", "b": [0.404, 0.2167, 0.4348, 0.2364]}, {"w": "seventh", "b": [0.4411, 0.2167, 0.5182, 0.2364]}, {"w": "channel", "b": [0.5245, 0.2167, 0.6029, 0.2364]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 5.31. Visualizing every channel in every intermediate activation", "words": [{"w": "Listing", "b": [0.1483, 0.2443, 0.2198, 0.2641]}, {"w": "5.31.", "b": [0.2261, 0.2443, 0.2766, 0.2641]}, {"w": "Visualizing", "b": [0.2829, 0.2443, 0.3977, 0.2641]}, {"w": "every", "b": [0.404, 0.2443, 0.46, 0.2641]}, {"w": "channel", "b": [0.4663, 0.2443, 0.5448, 0.2641]}, {"w": "in", "b": [0.5511, 0.2443, 0.5707, 0.2641]}, {"w": "every", "b": [0.577, 0.2443, 0.633, 0.2641]}, {"w": "intermediate", "b": [0.6393, 0.2443, 0.7654, 0.2641]}, {"w": "activation", "b": [0.1483, 0.2648, 0.2478, 0.2846]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 5.32. Defining the loss tensor for filter visualization", "words": [{"w": "Listing", "b": [0.1483, 0.2925, 0.2198, 0.3122]}, {"w": "5.32.", "b": [0.2261, 0.2925, 0.2766, 0.3122]}, {"w": "Defining", "b": [0.2829, 0.2925, 0.3726, 0.3122]}, {"w": "the", "b": [0.3789, 0.2925, 0.4097, 0.3122]}, {"w": "loss", "b": [0.416, 0.2925, 0.4553, 0.3122]}, {"w": "tensor", "b": [0.4616, 0.2925, 0.5232, 0.3122]}, {"w": "for", "b": [0.5295, 0.2925, 0.5589, 0.3122]}, {"w": "filter", "b": [0.5652, 0.2925, 0.6143, 0.3122]}, {"w": "visualization", "b": [0.6206, 0.2925, 0.7495, 0.3122]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 5.33. Obtaining the gradient of the loss with regard to the input", "words": [{"w": "Listing", "b": [0.1483, 0.3201, 0.2198, 0.3398]}, {"w": "5.33.", "b": [0.2261, 0.3201, 0.2766, 0.3398]}, {"w": "Obtaining", "b": [0.2829, 0.3201, 0.3838, 0.3398]}, {"w": "the", "b": [0.3901, 0.3201, 0.4209, 0.3398]}, {"w": "gradient", "b": [0.4272, 0.3201, 0.5099, 0.3398]}, {"w": "of", "b": [0.5162, 0.3201, 0.5372, 0.3398]}, {"w": "the", "b": [0.5435, 0.3201, 0.5743, 0.3398]}, {"w": "loss", "b": [0.5807, 0.3201, 0.6199, 0.3398]}, {"w": "with", "b": [0.6262, 0.3201, 0.6711, 0.3398]}, {"w": "regard", "b": [0.6774, 0.3201, 0.7418, 0.3398]}, {"w": "to", "b": [0.7481, 0.3201, 0.7677, 0.3398]}, {"w": "the", "b": [0.774, 0.3201, 0.8049, 0.3398]}, {"w": "input", "b": [0.1483, 0.3406, 0.2002, 0.3603]}]}, {"id": "b_8", "type": "equation", "text": "Listing 5.34. Gradient-normalization trick", "words": [{"w": "Listing", "b": [0.1483, 0.3682, 0.2198, 0.388]}, {"w": "5.34.", "b": [0.2261, 0.3682, 0.2766, 0.388]}, {"w": "Gradient-normalization", "b": [0.2829, 0.3682, 0.5197, 0.388]}, {"w": "trick", "b": [0.526, 0.3682, 0.5722, 0.388]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 5.35. Fetching Numpy output values given Numpy input values", "words": [{"w": "Listing", "b": [0.1483, 0.3959, 0.2198, 0.4156]}, {"w": "5.35.", "b": [0.2261, 0.3959, 0.2766, 0.4156]}, {"w": "Fetching", "b": [0.2829, 0.3959, 0.3712, 0.4156]}, {"w": "Numpy", "b": [0.3775, 0.3959, 0.4532, 0.4156]}, {"w": "output", "b": [0.4595, 0.3959, 0.5239, 0.4156]}, {"w": "values", "b": [0.5302, 0.3959, 0.5947, 0.4156]}, {"w": "given", "b": [0.601, 0.3959, 0.6571, 0.4156]}, {"w": "Numpy", "b": [0.6634, 0.3959, 0.739, 0.4156]}, {"w": "input", "b": [0.7453, 0.3959, 0.7972, 0.4156]}, {"w": "values", "b": [0.1483, 0.4164, 0.2128, 0.4361]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 5.36. Loss maximization via stochastic gradient descent", "words": [{"w": "Listing", "b": [0.1483, 0.444, 0.2198, 0.4637]}, {"w": "5.36.", "b": [0.2261, 0.444, 0.2766, 0.4637]}, {"w": "Loss", "b": [0.2829, 0.444, 0.3305, 0.4637]}, {"w": "maximization", "b": [0.3368, 0.444, 0.4756, 0.4637]}, {"w": "via", "b": [0.4819, 0.444, 0.5127, 0.4637]}, {"w": "stochastic", "b": [0.519, 0.444, 0.6185, 0.4637]}, {"w": "gradient", "b": [0.6248, 0.444, 0.7075, 0.4637]}, {"w": "descent", "b": [0.7138, 0.444, 0.7894, 0.4637]}]}, {"id": "b_11", "type": "paragraph", "text": "Listing 5.37. Utility function to convert a tensor into a valid image", "words": [{"w": "Listing", "b": [0.1483, 0.4716, 0.2198, 0.4914]}, {"w": "5.37.", "b": [0.2261, 0.4716, 0.2766, 0.4914]}, {"w": "Utility", "b": [0.2829, 0.4716, 0.3488, 0.4914]}, {"w": "function", "b": [0.3551, 0.4716, 0.4392, 0.4914]}, {"w": "to", "b": [0.4455, 0.4716, 0.4651, 0.4914]}, {"w": "convert", "b": [0.4714, 0.4716, 0.547, 0.4914]}, {"w": "a", "b": [0.5534, 0.4716, 0.5646, 0.4914]}, {"w": "tensor", "b": [0.5709, 0.4716, 0.6325, 0.4914]}, {"w": "into", "b": [0.6388, 0.4716, 0.6781, 0.4914]}, {"w": "a", "b": [0.6844, 0.4716, 0.6956, 0.4914]}, {"w": "valid", "b": [0.7019, 0.4716, 0.7523, 0.4914]}, {"w": "image", "b": [0.7586, 0.4716, 0.8203, 0.4914]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 5.38. Function to generate filter visualizations", "words": [{"w": "Listing", "b": [0.1483, 0.4992, 0.2198, 0.519]}, {"w": "5.38.", "b": [0.2261, 0.4992, 0.2766, 0.519]}, {"w": "Function", "b": [0.2829, 0.4992, 0.3726, 0.519]}, {"w": "to", "b": [0.3789, 0.4992, 0.3985, 0.519]}, {"w": "generate", "b": [0.4048, 0.4992, 0.4903, 0.519]}, {"w": "filter", "b": [0.4966, 0.4992, 0.5456, 0.519]}, {"w": "visualizations", "b": [0.5519, 0.4992, 0.6907, 0.519]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 5.39. Generating a grid of all filter response patterns in a layer", "words": [{"w": "Listing", "b": [0.1483, 0.5269, 0.2198, 0.5466]}, {"w": "5.39.", "b": [0.2261, 0.5269, 0.2766, 0.5466]}, {"w": "Generating", "b": [0.2829, 0.5269, 0.395, 0.5466]}, {"w": "a", "b": [0.4013, 0.5269, 0.4125, 0.5466]}, {"w": "grid", "b": [0.4188, 0.5269, 0.4594, 0.5466]}, {"w": "of", "b": [0.4657, 0.5269, 0.4867, 0.5466]}, {"w": "all", "b": [0.493, 0.5269, 0.5183, 0.5466]}, {"w": "filter", "b": [0.5246, 0.5269, 0.5736, 0.5466]}, {"w": "response", "b": [0.5799, 0.5269, 0.6682, 0.5466]}, {"w": "patterns", "b": [0.6745, 0.5269, 0.7544, 0.5466]}, {"w": "in", "b": [0.7607, 0.5269, 0.7803, 0.5466]}, {"w": "a", "b": [0.7866, 0.5269, 0.7978, 0.5466]}, {"w": "layer", "b": [0.1483, 0.5474, 0.1988, 0.5671]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 5.40. Loading the VGG16 network with pretrained weights", "words": [{"w": "Listing", "b": [0.1483, 0.575, 0.2198, 0.5948]}, {"w": "5.40.", "b": [0.2261, 0.575, 0.2766, 0.5948]}, {"w": "Loading", "b": [0.2829, 0.575, 0.367, 0.5948]}, {"w": "the", "b": [0.3733, 0.575, 0.4041, 0.5948]}, {"w": "VGG16", "b": [0.4104, 0.575, 0.4903, 0.5948]}, {"w": "network", "b": [0.4966, 0.575, 0.5792, 0.5948]}, {"w": "with", "b": [0.5855, 0.575, 0.6304, 0.5948]}, {"w": "pretrained", "b": [0.6367, 0.575, 0.739, 0.5948]}, {"w": "weights", "b": [0.7453, 0.575, 0.8238, 0.5948]}]}, {"id": "b_15", "type": "paragraph", "text": "Listing 5.41. Preprocessing an input image for VGG16", "words": [{"w": "Listing", "b": [0.1483, 0.6026, 0.2198, 0.6224]}, {"w": "5.41.", "b": [0.2261, 0.6026, 0.2766, 0.6224]}, {"w": "Preprocessing", "b": [0.2829, 0.6026, 0.4244, 0.6224]}, {"w": "an", "b": [0.4307, 0.6026, 0.4545, 0.6224]}, {"w": "input", "b": [0.4608, 0.6026, 0.5127, 0.6224]}, {"w": "image", "b": [0.519, 0.6026, 0.5807, 0.6224]}, {"w": "for", "b": [0.587, 0.6026, 0.6164, 0.6224]}, {"w": "VGG16", "b": [0.6227, 0.6026, 0.7025, 0.6224]}]}, {"id": "b_16", "type": "equation", "text": "Listing 5.42. Setting up the Grad-CAM algorithm", "words": [{"w": "Listing", "b": [0.1483, 0.6303, 0.2198, 0.65]}, {"w": "5.42.", "b": [0.2261, 0.6303, 0.2766, 0.65]}, {"w": "Setting", "b": [0.2829, 0.6303, 0.3544, 0.65]}, {"w": "up", "b": [0.3607, 0.6303, 0.3859, 0.65]}, {"w": "the", "b": [0.3922, 0.6303, 0.423, 0.65]}, {"w": "Grad-CAM", "b": [0.4293, 0.6303, 0.5456, 0.65]}, {"w": "algorithm", "b": [0.5519, 0.6303, 0.65, 0.65]}]}, {"id": "b_17", "type": "equation", "text": "Listing 5.43. Heatmap post-processing", "words": [{"w": "Listing", "b": [0.1483, 0.6579, 0.2198, 0.6776]}, {"w": "5.43.", "b": [0.2261, 0.6579, 0.2766, 0.6776]}, {"w": "Heatmap", "b": [0.2829, 0.6579, 0.374, 0.6776]}, {"w": "post-processing", "b": [0.3803, 0.6579, 0.5386, 0.6776]}]}, {"id": "b_18", "type": "paragraph", "text": "Listing 5.44. Superimposing the heatmap with the original picture", "words": [{"w": "Listing", "b": [0.1483, 0.6855, 0.2198, 0.7053]}, {"w": "5.44.", "b": [0.2261, 0.6855, 0.2766, 0.7053]}, {"w": "Superimposing", "b": [0.2829, 0.6855, 0.4357, 0.7053]}, {"w": "the", "b": [0.442, 0.6855, 0.4728, 0.7053]}, {"w": "heatmap", "b": [0.4791, 0.6855, 0.5646, 0.7053]}, {"w": "with", "b": [0.5709, 0.6855, 0.6157, 0.7053]}, {"w": "the", "b": [0.622, 0.6855, 0.6528, 0.7053]}, {"w": "original", "b": [0.6592, 0.6855, 0.7376, 0.7053]}, {"w": "picture", "b": [0.7439, 0.6855, 0.814, 0.7053]}]}, {"id": "b_19", "type": "paragraph", "text": "Chapter 6. Deep learning for text and sequences", "words": [{"w": "Chapter", "b": [0.1294, 0.7283, 0.2093, 0.7481]}, {"w": "6.", "b": [0.2156, 0.7283, 0.2345, 0.7481]}, {"w": "Deep", "b": [0.2408, 0.7283, 0.294, 0.7481]}, {"w": "learning", "b": [0.3003, 0.7283, 0.383, 0.7481]}, {"w": "for", "b": [0.3893, 0.7283, 0.4187, 0.7481]}, {"w": "text", "b": [0.425, 0.7283, 0.4629, 0.7481]}, {"w": "and", "b": [0.4692, 0.7283, 0.5056, 0.7481]}, {"w": "sequences", "b": [0.5119, 0.7283, 0.6142, 0.7481]}]}, {"id": "b_20", "type": "equation", "text": "Listing 6.1. Word-level one-hot encoding (toy example)", "words": [{"w": "Listing", "b": [0.1483, 0.7666, 0.2198, 0.7864]}, {"w": "6.1.", "b": [0.2261, 0.7666, 0.264, 0.7864]}, {"w": "Word-level", "b": [0.2703, 0.7666, 0.3831, 0.7864]}, {"w": "one-hot", "b": [0.3894, 0.7666, 0.4665, 0.7864]}, {"w": "encoding", "b": [0.4728, 0.7666, 0.5653, 0.7864]}, {"w": "(toy", "b": [0.5716, 0.7666, 0.6122, 0.7864]}, {"w": "example)", "b": [0.6185, 0.7666, 0.7124, 0.7864]}]}, {"id": "b_21", "type": "equation", "text": "Listing 6.2. Character-level one-hot encoding (toy example)", "words": [{"w": "Listing", "b": [0.1483, 0.7943, 0.2198, 0.814]}, {"w": "6.2.", "b": [0.2261, 0.7943, 0.264, 0.814]}, {"w": "Character-level", "b": [0.2703, 0.7943, 0.4252, 0.814]}, {"w": "one-hot", "b": [0.4315, 0.7943, 0.5086, 0.814]}, {"w": "encoding", "b": [0.5149, 0.7943, 0.6074, 0.814]}, {"w": "(toy", "b": [0.6137, 0.7943, 0.6543, 0.814]}, {"w": "example)", "b": [0.6606, 0.7943, 0.7545, 0.814]}]}, {"id": "b_22", "type": "equation", "text": "Listing 6.3. Using Keras for word-level one-hot encoding", "words": [{"w": "Listing", "b": [0.1483, 0.8219, 0.2198, 0.8416]}, {"w": "6.3.", "b": [0.2261, 0.8219, 0.264, 0.8416]}, {"w": "Using", "b": [0.2703, 0.8219, 0.3305, 0.8416]}, {"w": "Keras", "b": [0.3368, 0.8219, 0.3957, 0.8416]}, {"w": "for", "b": [0.402, 0.8219, 0.4314, 0.8416]}, {"w": "word-level", "b": [0.4377, 0.8219, 0.547, 0.8416]}, {"w": "one-hot", "b": [0.5533, 0.8219, 0.6303, 0.8416]}, {"w": "encoding", "b": [0.6367, 0.8219, 0.7291, 0.8416]}]}, {"id": "b_23", "type": "equation", "text": "Listing 6.4. Word-level one-hot encoding with hashing trick (toy example)", "words": [{"w": "Listing", "b": [0.1483, 0.8495, 0.2198, 0.8693]}, {"w": "6.4.", "b": [0.2261, 0.8495, 0.264, 0.8693]}, {"w": "Word-level", "b": [0.2703, 0.8495, 0.3831, 0.8693]}, {"w": "one-hot", "b": [0.3894, 0.8495, 0.4665, 0.8693]}, {"w": "encoding", "b": [0.4728, 0.8495, 0.5653, 0.8693]}, {"w": "with", "b": [0.5716, 0.8495, 0.6164, 0.8693]}, {"w": "hashing", "b": [0.6227, 0.8495, 0.7012, 0.8693]}, {"w": "trick", "b": [0.7075, 0.8495, 0.7538, 0.8693]}, {"w": "(toy", "b": [0.7601, 0.8495, 0.8007, 0.8693]}, {"w": "example)", "b": [0.1483, 0.87, 0.2422, 0.8898]}]}]}, {"page": 490, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 6.5. Instantiating an Embedding layer", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "6.5.", "b": [0.2261, 0.0857, 0.264, 0.1054]}, {"w": "Instantiating", "b": [0.2703, 0.0857, 0.3964, 0.1054]}, {"w": "an", "b": [0.4027, 0.0857, 0.4265, 0.1054]}, {"w": "Embedding", "b": [0.4328, 0.0857, 0.5491, 0.1054]}, {"w": "layer", "b": [0.5554, 0.0857, 0.6059, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 6.6. Loading the IMDB data for use with an Embedding layer", "words": [{"w": "Listing", "b": [0.1483, 0.1133, 0.2198, 0.133]}, {"w": "6.6.", "b": [0.2261, 0.1133, 0.264, 0.133]}, {"w": "Loading", "b": [0.2703, 0.1133, 0.3544, 0.133]}, {"w": "the", "b": [0.3607, 0.1133, 0.3915, 0.133]}, {"w": "IMDB", "b": [0.3978, 0.1133, 0.4637, 0.133]}, {"w": "data", "b": [0.47, 0.1133, 0.512, 0.133]}, {"w": "for", "b": [0.5183, 0.1133, 0.5477, 0.133]}, {"w": "use", "b": [0.554, 0.1133, 0.5876, 0.133]}, {"w": "with", "b": [0.5939, 0.1133, 0.6388, 0.133]}, {"w": "an", "b": [0.6451, 0.1133, 0.6689, 0.133]}, {"w": "Embedding", "b": [0.6752, 0.1133, 0.7915, 0.133]}, {"w": "layer", "b": [0.1483, 0.1338, 0.1988, 0.1535]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.7. Using an Embedding layer and classifier on the IMDB data", "words": [{"w": "Listing", "b": [0.1483, 0.1614, 0.2198, 0.1812]}, {"w": "6.7.", "b": [0.2261, 0.1614, 0.264, 0.1812]}, {"w": "Using", "b": [0.2703, 0.1614, 0.3305, 0.1812]}, {"w": "an", "b": [0.3368, 0.1614, 0.3607, 0.1812]}, {"w": "Embedding", "b": [0.367, 0.1614, 0.4833, 0.1812]}, {"w": "layer", "b": [0.4896, 0.1614, 0.54, 0.1812]}, {"w": "and", "b": [0.5463, 0.1614, 0.5827, 0.1812]}, {"w": "classifier", "b": [0.5891, 0.1614, 0.6801, 0.1812]}, {"w": "on", "b": [0.6864, 0.1614, 0.7116, 0.1812]}, {"w": "the", "b": [0.718, 0.1614, 0.7488, 0.1812]}, {"w": "IMDB", "b": [0.7551, 0.1614, 0.821, 0.1812]}, {"w": "data", "b": [0.1483, 0.1819, 0.1904, 0.2017]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.8. Processing the labels of the raw IMDB data", "words": [{"w": "Listing", "b": [0.1483, 0.2096, 0.2198, 0.2293]}, {"w": "6.8.", "b": [0.2261, 0.2096, 0.264, 0.2293]}, {"w": "Processing", "b": [0.2703, 0.2096, 0.3796, 0.2293]}, {"w": "the", "b": [0.3859, 0.2096, 0.4167, 0.2293]}, {"w": "labels", "b": [0.423, 0.2096, 0.4819, 0.2293]}, {"w": "of", "b": [0.4882, 0.2096, 0.5092, 0.2293]}, {"w": "the", "b": [0.5155, 0.2096, 0.5463, 0.2293]}, {"w": "raw", "b": [0.5526, 0.2096, 0.5904, 0.2293]}, {"w": "IMDB", "b": [0.5967, 0.2096, 0.6626, 0.2293]}, {"w": "data", "b": [0.6689, 0.2096, 0.7109, 0.2293]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 6.9. Tokenizing the text of the raw IMDB data", "words": [{"w": "Listing", "b": [0.1483, 0.2372, 0.2198, 0.2569]}, {"w": "6.9.", "b": [0.2261, 0.2372, 0.264, 0.2569]}, {"w": "Tokenizing", "b": [0.2703, 0.2372, 0.3834, 0.2569]}, {"w": "the", "b": [0.3897, 0.2372, 0.4205, 0.2569]}, {"w": "text", "b": [0.4268, 0.2372, 0.4647, 0.2569]}, {"w": "of", "b": [0.471, 0.2372, 0.492, 0.2569]}, {"w": "the", "b": [0.4983, 0.2372, 0.5291, 0.2569]}, {"w": "raw", "b": [0.5354, 0.2372, 0.5732, 0.2569]}, {"w": "IMDB", "b": [0.5796, 0.2372, 0.6454, 0.2569]}, {"w": "data", "b": [0.6517, 0.2372, 0.6938, 0.2569]}]}, {"id": "b_5", "type": "equation", "text": "Listing 6.10. Parsing the GloVe word-embeddings file", "words": [{"w": "Listing", "b": [0.1483, 0.2648, 0.2198, 0.2846]}, {"w": "6.10.", "b": [0.2261, 0.2648, 0.2766, 0.2846]}, {"w": "Parsing", "b": [0.2829, 0.2648, 0.3586, 0.2846]}, {"w": "the", "b": [0.3649, 0.2648, 0.3957, 0.2846]}, {"w": "GloVe", "b": [0.402, 0.2648, 0.4664, 0.2846]}, {"w": "word-embeddings", "b": [0.4727, 0.2648, 0.6549, 0.2846]}, {"w": "file", "b": [0.6612, 0.2648, 0.6948, 0.2846]}]}, {"id": "b_6", "type": "equation", "text": "Listing 6.11. Preparing the GloVe word-embeddings matrix", "words": [{"w": "Listing", "b": [0.1483, 0.2925, 0.2198, 0.3122]}, {"w": "6.11.", "b": [0.2261, 0.2925, 0.2756, 0.3122]}, {"w": "Preparing", "b": [0.2819, 0.2925, 0.38, 0.3122]}, {"w": "the", "b": [0.3863, 0.2925, 0.4171, 0.3122]}, {"w": "GloVe", "b": [0.4235, 0.2925, 0.4879, 0.3122]}, {"w": "word-embeddings", "b": [0.4942, 0.2925, 0.6764, 0.3122]}, {"w": "matrix", "b": [0.6827, 0.2925, 0.7485, 0.3122]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 6.12. Model definition", "words": [{"w": "Listing", "b": [0.1483, 0.3201, 0.2198, 0.3398]}, {"w": "6.12.", "b": [0.2261, 0.3201, 0.2766, 0.3398]}, {"w": "Model", "b": [0.2829, 0.3201, 0.3488, 0.3398]}, {"w": "definition", "b": [0.3551, 0.3201, 0.4532, 0.3398]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 6.13. Loading pretrained word embeddings into the Embedding layer", "words": [{"w": "Listing", "b": [0.1483, 0.3477, 0.2198, 0.3675]}, {"w": "6.13.", "b": [0.2261, 0.3477, 0.2766, 0.3675]}, {"w": "Loading", "b": [0.2829, 0.3477, 0.367, 0.3675]}, {"w": "pretrained", "b": [0.3733, 0.3477, 0.4755, 0.3675]}, {"w": "word", "b": [0.4818, 0.3477, 0.5337, 0.3675]}, {"w": "embeddings", "b": [0.54, 0.3477, 0.6619, 0.3675]}, {"w": "into", "b": [0.6682, 0.3477, 0.7075, 0.3675]}, {"w": "the", "b": [0.7138, 0.3477, 0.7446, 0.3675]}, {"w": "Embedding", "b": [0.1483, 0.3682, 0.2646, 0.388]}, {"w": "layer", "b": [0.271, 0.3682, 0.3214, 0.388]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 6.14. Training and evaluation", "words": [{"w": "Listing", "b": [0.1483, 0.3959, 0.2198, 0.4156]}, {"w": "6.14.", "b": [0.2261, 0.3959, 0.2766, 0.4156]}, {"w": "Training", "b": [0.2829, 0.3959, 0.3689, 0.4156]}, {"w": "and", "b": [0.3752, 0.3959, 0.4116, 0.4156]}, {"w": "evaluation", "b": [0.4179, 0.3959, 0.523, 0.4156]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 6.15. Plotting the results", "words": [{"w": "Listing", "b": [0.1483, 0.4235, 0.2198, 0.4432]}, {"w": "6.15.", "b": [0.2261, 0.4235, 0.2766, 0.4432]}, {"w": "Plotting", "b": [0.2829, 0.4235, 0.3628, 0.4432]}, {"w": "the", "b": [0.3691, 0.4235, 0.3999, 0.4432]}, {"w": "results", "b": [0.4062, 0.4235, 0.4721, 0.4432]}]}, {"id": "b_11", "type": "paragraph", "text": "Listing 6.16. Training the same model without pretrained word embeddings", "words": [{"w": "Listing", "b": [0.1483, 0.4511, 0.2198, 0.4709]}, {"w": "6.16.", "b": [0.2261, 0.4511, 0.2766, 0.4709]}, {"w": "Training", "b": [0.2829, 0.4511, 0.3689, 0.4709]}, {"w": "the", "b": [0.3752, 0.4511, 0.406, 0.4709]}, {"w": "same", "b": [0.4123, 0.4511, 0.4641, 0.4709]}, {"w": "model", "b": [0.4704, 0.4511, 0.5335, 0.4709]}, {"w": "without", "b": [0.5398, 0.4511, 0.6169, 0.4709]}, {"w": "pretrained", "b": [0.6232, 0.4511, 0.7255, 0.4709]}, {"w": "word", "b": [0.7318, 0.4511, 0.7836, 0.4709]}, {"w": "embeddings", "b": [0.1483, 0.4716, 0.2702, 0.4914]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 6.17. Tokenizing the data of the test set", "words": [{"w": "Listing", "b": [0.1483, 0.4992, 0.2198, 0.519]}, {"w": "6.17.", "b": [0.2261, 0.4992, 0.2766, 0.519]}, {"w": "Tokenizing", "b": [0.2829, 0.4992, 0.396, 0.519]}, {"w": "the", "b": [0.4023, 0.4992, 0.4331, 0.519]}, {"w": "data", "b": [0.4394, 0.4992, 0.4815, 0.519]}, {"w": "of", "b": [0.4878, 0.4992, 0.5088, 0.519]}, {"w": "the", "b": [0.5151, 0.4992, 0.5459, 0.519]}, {"w": "test", "b": [0.5522, 0.4992, 0.5873, 0.519]}, {"w": "set", "b": [0.5936, 0.4992, 0.6216, 0.519]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 6.18. Evaluating the model on the test set", "words": [{"w": "Listing", "b": [0.1483, 0.5269, 0.2198, 0.5466]}, {"w": "6.18.", "b": [0.2261, 0.5269, 0.2766, 0.5466]}, {"w": "Evaluating", "b": [0.2829, 0.5269, 0.3922, 0.5466]}, {"w": "the", "b": [0.3985, 0.5269, 0.4293, 0.5466]}, {"w": "model", "b": [0.4356, 0.5269, 0.4987, 0.5466]}, {"w": "on", "b": [0.505, 0.5269, 0.5302, 0.5466]}, {"w": "the", "b": [0.5365, 0.5269, 0.5674, 0.5466]}, {"w": "test", "b": [0.5737, 0.5269, 0.6087, 0.5466]}, {"w": "set", "b": [0.615, 0.5269, 0.643, 0.5466]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 6.19. Pseudocode RNN", "words": [{"w": "Listing", "b": [0.1483, 0.5545, 0.2198, 0.5742]}, {"w": "6.19.", "b": [0.2261, 0.5545, 0.2766, 0.5742]}, {"w": "Pseudocode", "b": [0.2829, 0.5545, 0.4034, 0.5742]}, {"w": "RNN", "b": [0.4097, 0.5545, 0.4629, 0.5742]}]}, {"id": "b_15", "type": "paragraph", "text": "Listing 6.20. More detailed pseudocode for the RNN", "words": [{"w": "Listing", "b": [0.1483, 0.5821, 0.2198, 0.6019]}, {"w": "6.20.", "b": [0.2261, 0.5821, 0.2766, 0.6019]}, {"w": "More", "b": [0.2829, 0.5821, 0.3375, 0.6019]}, {"w": "detailed", "b": [0.3438, 0.5821, 0.4237, 0.6019]}, {"w": "pseudocode", "b": [0.43, 0.5821, 0.5491, 0.6019]}, {"w": "for", "b": [0.5554, 0.5821, 0.5848, 0.6019]}, {"w": "the", "b": [0.5911, 0.5821, 0.6219, 0.6019]}, {"w": "RNN", "b": [0.6283, 0.5821, 0.6815, 0.6019]}]}, {"id": "b_16", "type": "paragraph", "text": "Listing 6.21. Numpy implementation of a simple RNN", "words": [{"w": "Listing", "b": [0.1483, 0.6098, 0.2198, 0.6295]}, {"w": "6.21.", "b": [0.2261, 0.6098, 0.2766, 0.6295]}, {"w": "Numpy", "b": [0.2829, 0.6098, 0.3586, 0.6295]}, {"w": "implementation", "b": [0.3649, 0.6098, 0.5232, 0.6295]}, {"w": "of", "b": [0.5295, 0.6098, 0.5506, 0.6295]}, {"w": "a", "b": [0.5569, 0.6098, 0.5681, 0.6295]}, {"w": "simple", "b": [0.5744, 0.6098, 0.6416, 0.6295]}, {"w": "RNN", "b": [0.648, 0.6098, 0.7012, 0.6295]}]}, {"id": "b_17", "type": "paragraph", "text": "Listing 6.22. Preparing the IMDB data", "words": [{"w": "Listing", "b": [0.1483, 0.6374, 0.2198, 0.6571]}, {"w": "6.22.", "b": [0.2261, 0.6374, 0.2766, 0.6571]}, {"w": "Preparing", "b": [0.2829, 0.6374, 0.381, 0.6571]}, {"w": "the", "b": [0.3873, 0.6374, 0.4181, 0.6571]}, {"w": "IMDB", "b": [0.4244, 0.6374, 0.4903, 0.6571]}, {"w": "data", "b": [0.4966, 0.6374, 0.5386, 0.6571]}]}, {"id": "b_18", "type": "paragraph", "text": "Listing 6.23. Training the model with Embedding and SimpleRNN layers", "words": [{"w": "Listing", "b": [0.1483, 0.665, 0.2198, 0.6848]}, {"w": "6.23.", "b": [0.2261, 0.665, 0.2766, 0.6848]}, {"w": "Training", "b": [0.2829, 0.665, 0.3689, 0.6848]}, {"w": "the", "b": [0.3752, 0.665, 0.406, 0.6848]}, {"w": "model", "b": [0.4123, 0.665, 0.4754, 0.6848]}, {"w": "with", "b": [0.4817, 0.665, 0.5265, 0.6848]}, {"w": "Embedding", "b": [0.5328, 0.665, 0.6491, 0.6848]}, {"w": "and", "b": [0.6554, 0.665, 0.6919, 0.6848]}, {"w": "SimpleRNN", "b": [0.6982, 0.665, 0.8229, 0.6848]}, {"w": "layers", "b": [0.1483, 0.6855, 0.2086, 0.7053]}]}, {"id": "b_19", "type": "paragraph", "text": "Listing 6.24. Plotting results", "words": [{"w": "Listing", "b": [0.1483, 0.7132, 0.2198, 0.7329]}, {"w": "6.24.", "b": [0.2261, 0.7132, 0.2766, 0.7329]}, {"w": "Plotting", "b": [0.2829, 0.7132, 0.3628, 0.7329]}, {"w": "results", "b": [0.3691, 0.7132, 0.435, 0.7329]}]}, {"id": "b_20", "type": "equation", "text": "Listing 6.25. Pseudocode details of the LSTM architecture (1/2)", "words": [{"w": "Listing", "b": [0.1483, 0.7408, 0.2198, 0.7605]}, {"w": "6.25.", "b": [0.2261, 0.7408, 0.2766, 0.7605]}, {"w": "Pseudocode", "b": [0.2829, 0.7408, 0.4034, 0.7605]}, {"w": "details", "b": [0.4097, 0.7408, 0.4756, 0.7605]}, {"w": "of", "b": [0.4819, 0.7408, 0.5029, 0.7605]}, {"w": "the", "b": [0.5092, 0.7408, 0.54, 0.7605]}, {"w": "LSTM", "b": [0.5463, 0.7408, 0.6136, 0.7605]}, {"w": "architecture", "b": [0.6199, 0.7408, 0.739, 0.7605]}, {"w": "(1/2)", "b": [0.7453, 0.7408, 0.7943, 0.7605]}]}, {"id": "b_21", "type": "equation", "text": "Listing 6.26. Pseudocode details of the LSTM architecture (2/2)", "words": [{"w": "Listing", "b": [0.1483, 0.7684, 0.2198, 0.7882]}, {"w": "6.26.", "b": [0.2261, 0.7684, 0.2766, 0.7882]}, {"w": "Pseudocode", "b": [0.2829, 0.7684, 0.4034, 0.7882]}, {"w": "details", "b": [0.4097, 0.7684, 0.4756, 0.7882]}, {"w": "of", "b": [0.4819, 0.7684, 0.5029, 0.7882]}, {"w": "the", "b": [0.5092, 0.7684, 0.54, 0.7882]}, {"w": "LSTM", "b": [0.5463, 0.7684, 0.6136, 0.7882]}, {"w": "architecture", "b": [0.6199, 0.7684, 0.739, 0.7882]}, {"w": "(2/2)", "b": [0.7453, 0.7684, 0.7943, 0.7882]}]}, {"id": "b_22", "type": "paragraph", "text": "Listing 6.27. Using the LSTM layer in Keras", "words": [{"w": "Listing", "b": [0.1483, 0.7961, 0.2198, 0.8158]}, {"w": "6.27.", "b": [0.2261, 0.7961, 0.2766, 0.8158]}, {"w": "Using", "b": [0.2829, 0.7961, 0.3431, 0.8158]}, {"w": "the", "b": [0.3495, 0.7961, 0.3803, 0.8158]}, {"w": "LSTM", "b": [0.3866, 0.7961, 0.4539, 0.8158]}, {"w": "layer", "b": [0.4602, 0.7961, 0.5106, 0.8158]}, {"w": "in", "b": [0.5169, 0.7961, 0.5365, 0.8158]}, {"w": "Keras", "b": [0.5428, 0.7961, 0.6017, 0.8158]}]}, {"id": "b_23", "type": "paragraph", "text": "Listing 6.28. Inspecting the data of the Jena weather dataset", "words": [{"w": "Listing", "b": [0.1483, 0.8237, 0.2198, 0.8434]}, {"w": "6.28.", "b": [0.2261, 0.8237, 0.2766, 0.8434]}, {"w": "Inspecting", "b": [0.2829, 0.8237, 0.388, 0.8434]}, {"w": "the", "b": [0.3943, 0.8237, 0.4251, 0.8434]}, {"w": "data", "b": [0.4314, 0.8237, 0.4734, 0.8434]}, {"w": "of", "b": [0.4797, 0.8237, 0.5008, 0.8434]}, {"w": "the", "b": [0.5071, 0.8237, 0.5379, 0.8434]}, {"w": "Jena", "b": [0.5442, 0.8237, 0.589, 0.8434]}, {"w": "weather", "b": [0.5953, 0.8237, 0.6752, 0.8434]}, {"w": "dataset", "b": [0.6815, 0.8237, 0.7515, 0.8434]}]}, {"id": "b_24", "type": "paragraph", "text": "Listing 6.29. Parsing the data", "words": [{"w": "Listing", "b": [0.1483, 0.8513, 0.2198, 0.8711]}, {"w": "6.29.", "b": [0.2261, 0.8513, 0.2766, 0.8711]}, {"w": "Parsing", "b": [0.2829, 0.8513, 0.3586, 0.8711]}, {"w": "the", "b": [0.3649, 0.8513, 0.3957, 0.8711]}, {"w": "data", "b": [0.402, 0.8513, 0.444, 0.8711]}]}, {"id": "b_25", "type": "paragraph", "text": "Listing 6.30. Plotting the temperature timeseries", "words": [{"w": "Listing", "b": [0.1483, 0.8789, 0.2198, 0.8987]}, {"w": "6.30.", "b": [0.2261, 0.8789, 0.2766, 0.8987]}, {"w": "Plotting", "b": [0.2829, 0.8789, 0.3628, 0.8987]}, {"w": "the", "b": [0.3691, 0.8789, 0.3999, 0.8987]}, {"w": "temperature", "b": [0.4062, 0.8789, 0.5267, 0.8987]}, {"w": "timeseries", "b": [0.533, 0.8789, 0.6353, 0.8987]}]}]}, {"page": 491, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 6.31. Plotting the first 10 days of the temperature timeseries", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "6.31.", "b": [0.2261, 0.0857, 0.2766, 0.1054]}, {"w": "Plotting", "b": [0.2829, 0.0857, 0.3628, 0.1054]}, {"w": "the", "b": [0.3691, 0.0857, 0.3999, 0.1054]}, {"w": "first", "b": [0.4062, 0.0857, 0.4469, 0.1054]}, {"w": "10", "b": [0.4532, 0.0857, 0.4784, 0.1054]}, {"w": "days", "b": [0.4847, 0.0857, 0.531, 0.1054]}, {"w": "of", "b": [0.5373, 0.0857, 0.5583, 0.1054]}, {"w": "the", "b": [0.5646, 0.0857, 0.5954, 0.1054]}, {"w": "temperature", "b": [0.6017, 0.0857, 0.7222, 0.1054]}, {"w": "timeseries", "b": [0.7285, 0.0857, 0.8308, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 6.32. Normalizing the data", "words": [{"w": "Listing", "b": [0.1483, 0.1133, 0.2198, 0.133]}, {"w": "6.32.", "b": [0.2261, 0.1133, 0.2766, 0.133]}, {"w": "Normalizing", "b": [0.2829, 0.1133, 0.4104, 0.133]}, {"w": "the", "b": [0.4167, 0.1133, 0.4475, 0.133]}, {"w": "data", "b": [0.4538, 0.1133, 0.4959, 0.133]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 6.33. Generator yielding timeseries samples and their targets", "words": [{"w": "Listing", "b": [0.1483, 0.1409, 0.2198, 0.1607]}, {"w": "6.33.", "b": [0.2261, 0.1409, 0.2766, 0.1607]}, {"w": "Generator", "b": [0.2829, 0.1409, 0.3837, 0.1607]}, {"w": "yielding", "b": [0.39, 0.1409, 0.4727, 0.1607]}, {"w": "timeseries", "b": [0.479, 0.1409, 0.5813, 0.1607]}, {"w": "samples", "b": [0.5876, 0.1409, 0.6689, 0.1607]}, {"w": "and", "b": [0.6752, 0.1409, 0.7116, 0.1607]}, {"w": "their", "b": [0.718, 0.1409, 0.7642, 0.1607]}, {"w": "targets", "b": [0.7705, 0.1409, 0.8372, 0.1607]}]}, {"id": "b_3", "type": "paragraph", "text": "Listing 6.34. Preparing the training, validation, and test generators", "words": [{"w": "Listing", "b": [0.1483, 0.1686, 0.2198, 0.1883]}, {"w": "6.34.", "b": [0.2261, 0.1686, 0.2766, 0.1883]}, {"w": "Preparing", "b": [0.2829, 0.1686, 0.381, 0.1883]}, {"w": "the", "b": [0.3873, 0.1686, 0.4181, 0.1883]}, {"w": "training,", "b": [0.4244, 0.1686, 0.5092, 0.1883]}, {"w": "validation,", "b": [0.5155, 0.1686, 0.6227, 0.1883]}, {"w": "and", "b": [0.629, 0.1686, 0.6654, 0.1883]}, {"w": "test", "b": [0.6717, 0.1686, 0.7068, 0.1883]}, {"w": "generators", "b": [0.7131, 0.1686, 0.8182, 0.1883]}]}, {"id": "b_4", "type": "equation", "text": "Listing 6.35. Computing the common-sense baseline MAE", "words": [{"w": "Listing", "b": [0.1483, 0.1962, 0.2198, 0.2159]}, {"w": "6.35.", "b": [0.2261, 0.1962, 0.2766, 0.2159]}, {"w": "Computing", "b": [0.2829, 0.1962, 0.3964, 0.2159]}, {"w": "the", "b": [0.4027, 0.1962, 0.4336, 0.2159]}, {"w": "common-sense", "b": [0.4399, 0.1962, 0.5912, 0.2159]}, {"w": "baseline", "b": [0.5975, 0.1962, 0.6802, 0.2159]}, {"w": "MAE", "b": [0.6865, 0.1962, 0.7425, 0.2159]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 6.36. Converting the MAE back to a Celsius error", "words": [{"w": "Listing", "b": [0.1483, 0.2238, 0.2198, 0.2436]}, {"w": "6.36.", "b": [0.2261, 0.2238, 0.2766, 0.2436]}, {"w": "Converting", "b": [0.2829, 0.2238, 0.3964, 0.2436]}, {"w": "the", "b": [0.4027, 0.2238, 0.4335, 0.2436]}, {"w": "MAE", "b": [0.4398, 0.2238, 0.4959, 0.2436]}, {"w": "back", "b": [0.5022, 0.2238, 0.5498, 0.2436]}, {"w": "to", "b": [0.5561, 0.2238, 0.5758, 0.2436]}, {"w": "a", "b": [0.5821, 0.2238, 0.5933, 0.2436]}, {"w": "Celsius", "b": [0.5996, 0.2238, 0.6739, 0.2436]}, {"w": "error", "b": [0.6802, 0.2238, 0.7292, 0.2436]}]}, {"id": "b_6", "type": "paragraph", "text": "Listing 6.37. Training and evaluating a densely connected model", "words": [{"w": "Listing", "b": [0.1483, 0.2515, 0.2198, 0.2712]}, {"w": "6.37.", "b": [0.2261, 0.2515, 0.2766, 0.2712]}, {"w": "Training", "b": [0.2829, 0.2515, 0.3689, 0.2712]}, {"w": "and", "b": [0.3752, 0.2515, 0.4116, 0.2712]}, {"w": "evaluating", "b": [0.4179, 0.2515, 0.523, 0.2712]}, {"w": "a", "b": [0.5293, 0.2515, 0.5405, 0.2712]}, {"w": "densely", "b": [0.5468, 0.2515, 0.6239, 0.2712]}, {"w": "connected", "b": [0.6302, 0.2515, 0.7324, 0.2712]}, {"w": "model", "b": [0.7387, 0.2515, 0.8018, 0.2712]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 6.38. Plotting results", "words": [{"w": "Listing", "b": [0.1483, 0.2791, 0.2198, 0.2988]}, {"w": "6.38.", "b": [0.2261, 0.2791, 0.2766, 0.2988]}, {"w": "Plotting", "b": [0.2829, 0.2791, 0.3628, 0.2988]}, {"w": "results", "b": [0.3691, 0.2791, 0.435, 0.2988]}]}, {"id": "b_8", "type": "equation", "text": "Listing 6.39. Training and evaluating a GRU-based model", "words": [{"w": "Listing", "b": [0.1483, 0.3067, 0.2198, 0.3265]}, {"w": "6.39.", "b": [0.2261, 0.3067, 0.2766, 0.3265]}, {"w": "Training", "b": [0.2829, 0.3067, 0.3689, 0.3265]}, {"w": "and", "b": [0.3752, 0.3067, 0.4116, 0.3265]}, {"w": "evaluating", "b": [0.4179, 0.3067, 0.523, 0.3265]}, {"w": "a", "b": [0.5293, 0.3067, 0.5405, 0.3265]}, {"w": "GRU-based", "b": [0.5468, 0.3067, 0.6659, 0.3265]}, {"w": "model", "b": [0.6722, 0.3067, 0.7353, 0.3265]}]}, {"id": "b_9", "type": "equation", "text": "Listing 6.40. Training and evaluating a dropout-regularized GRU- based model", "words": [{"w": "Listing", "b": [0.1483, 0.3344, 0.2198, 0.3541]}, {"w": "6.40.", "b": [0.2261, 0.3344, 0.2766, 0.3541]}, {"w": "Training", "b": [0.2829, 0.3344, 0.3689, 0.3541]}, {"w": "and", "b": [0.3752, 0.3344, 0.4116, 0.3541]}, {"w": "evaluating", "b": [0.4179, 0.3344, 0.523, 0.3541]}, {"w": "a", "b": [0.5293, 0.3344, 0.5405, 0.3541]}, {"w": "dropout-regularized", "b": [0.5468, 0.3344, 0.7471, 0.3541]}, {"w": "GRU-", "b": [0.7535, 0.3344, 0.8151, 0.3541]}, {"w": "based", "b": [0.1483, 0.3549, 0.2058, 0.3746]}, {"w": "model", "b": [0.2121, 0.3549, 0.2751, 0.3746]}]}, {"id": "b_10", "type": "equation", "text": "Listing 6.41. Training and evaluating a dropout-regularized, stacked GRU model", "words": [{"w": "Listing", "b": [0.1483, 0.3825, 0.2198, 0.4022]}, {"w": "6.41.", "b": [0.2261, 0.3825, 0.2766, 0.4022]}, {"w": "Training", "b": [0.2829, 0.3825, 0.3689, 0.4022]}, {"w": "and", "b": [0.3752, 0.3825, 0.4116, 0.4022]}, {"w": "evaluating", "b": [0.4179, 0.3825, 0.523, 0.4022]}, {"w": "a", "b": [0.5293, 0.3825, 0.5405, 0.4022]}, {"w": "dropout-regularized,", "b": [0.5468, 0.3825, 0.7535, 0.4022]}, {"w": "stacked", "b": [0.7598, 0.3825, 0.8354, 0.4022]}, {"w": "GRU", "b": [0.1483, 0.403, 0.2016, 0.4227]}, {"w": "model", "b": [0.2079, 0.403, 0.271, 0.4227]}]}, {"id": "b_11", "type": "paragraph", "text": "Listing 6.42. Training and evaluating an LSTM using reversed sequences", "words": [{"w": "Listing", "b": [0.1483, 0.4306, 0.2198, 0.4504]}, {"w": "6.42.", "b": [0.2261, 0.4306, 0.2766, 0.4504]}, {"w": "Training", "b": [0.2829, 0.4306, 0.3689, 0.4504]}, {"w": "and", "b": [0.3752, 0.4306, 0.4116, 0.4504]}, {"w": "evaluating", "b": [0.4179, 0.4306, 0.523, 0.4504]}, {"w": "an", "b": [0.5293, 0.4306, 0.5531, 0.4504]}, {"w": "LSTM", "b": [0.5594, 0.4306, 0.6267, 0.4504]}, {"w": "using", "b": [0.633, 0.4306, 0.6877, 0.4504]}, {"w": "reversed", "b": [0.694, 0.4306, 0.7794, 0.4504]}, {"w": "sequences", "b": [0.1483, 0.4511, 0.2506, 0.4709]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 6.43. Training and evaluating a bidirectional LSTM", "words": [{"w": "Listing", "b": [0.1483, 0.4787, 0.2198, 0.4985]}, {"w": "6.43.", "b": [0.2261, 0.4787, 0.2766, 0.4985]}, {"w": "Training", "b": [0.2829, 0.4787, 0.3689, 0.4985]}, {"w": "and", "b": [0.3752, 0.4787, 0.4116, 0.4985]}, {"w": "evaluating", "b": [0.4179, 0.4787, 0.523, 0.4985]}, {"w": "a", "b": [0.5293, 0.4787, 0.5405, 0.4985]}, {"w": "bidirectional", "b": [0.5468, 0.4787, 0.6743, 0.4985]}, {"w": "LSTM", "b": [0.6806, 0.4787, 0.7479, 0.4985]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 6.44. Training a bidirectional GRU", "words": [{"w": "Listing", "b": [0.1483, 0.5064, 0.2198, 0.5261]}, {"w": "6.44.", "b": [0.2261, 0.5064, 0.2766, 0.5261]}, {"w": "Training", "b": [0.2829, 0.5064, 0.3689, 0.5261]}, {"w": "a", "b": [0.3752, 0.5064, 0.3864, 0.5261]}, {"w": "bidirectional", "b": [0.3927, 0.5064, 0.5202, 0.5261]}, {"w": "GRU", "b": [0.5265, 0.5064, 0.5797, 0.5261]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 6.45. Preparing the IMDB data", "words": [{"w": "Listing", "b": [0.1483, 0.534, 0.2198, 0.5537]}, {"w": "6.45.", "b": [0.2261, 0.534, 0.2766, 0.5537]}, {"w": "Preparing", "b": [0.2829, 0.534, 0.381, 0.5537]}, {"w": "the", "b": [0.3873, 0.534, 0.4181, 0.5537]}, {"w": "IMDB", "b": [0.4244, 0.534, 0.4903, 0.5537]}, {"w": "data", "b": [0.4966, 0.534, 0.5386, 0.5537]}]}, {"id": "b_15", "type": "paragraph", "text": "Listing 6.46. Training and evaluating a simple 1D convnet on the IMDB data", "words": [{"w": "Listing", "b": [0.1483, 0.5616, 0.2198, 0.5814]}, {"w": "6.46.", "b": [0.2261, 0.5616, 0.2766, 0.5814]}, {"w": "Training", "b": [0.2829, 0.5616, 0.3689, 0.5814]}, {"w": "and", "b": [0.3752, 0.5616, 0.4116, 0.5814]}, {"w": "evaluating", "b": [0.4179, 0.5616, 0.523, 0.5814]}, {"w": "a", "b": [0.5293, 0.5616, 0.5405, 0.5814]}, {"w": "simple", "b": [0.5468, 0.5616, 0.6141, 0.5814]}, {"w": "1D", "b": [0.6204, 0.5616, 0.6512, 0.5814]}, {"w": "convnet", "b": [0.6575, 0.5616, 0.7374, 0.5814]}, {"w": "on", "b": [0.7437, 0.5616, 0.7689, 0.5814]}, {"w": "the", "b": [0.7752, 0.5616, 0.806, 0.5814]}, {"w": "IMDB", "b": [0.1483, 0.5821, 0.2142, 0.6019]}, {"w": "data", "b": [0.2205, 0.5821, 0.2625, 0.6019]}]}, {"id": "b_16", "type": "paragraph", "text": "Listing 6.47. Training and evaluating a simple 1D convnet on the Jena data", "words": [{"w": "Listing", "b": [0.1483, 0.6098, 0.2198, 0.6295]}, {"w": "6.47.", "b": [0.2261, 0.6098, 0.2766, 0.6295]}, {"w": "Training", "b": [0.2829, 0.6098, 0.3689, 0.6295]}, {"w": "and", "b": [0.3752, 0.6098, 0.4116, 0.6295]}, {"w": "evaluating", "b": [0.4179, 0.6098, 0.523, 0.6295]}, {"w": "a", "b": [0.5293, 0.6098, 0.5405, 0.6295]}, {"w": "simple", "b": [0.5468, 0.6098, 0.6141, 0.6295]}, {"w": "1D", "b": [0.6204, 0.6098, 0.6512, 0.6295]}, {"w": "convnet", "b": [0.6575, 0.6098, 0.7374, 0.6295]}, {"w": "on", "b": [0.7437, 0.6098, 0.7689, 0.6295]}, {"w": "the", "b": [0.7752, 0.6098, 0.806, 0.6295]}, {"w": "Jena", "b": [0.1483, 0.6303, 0.1932, 0.65]}, {"w": "data", "b": [0.1995, 0.6303, 0.2415, 0.65]}]}, {"id": "b_17", "type": "equation", "text": "Listing 6.48. Preparing higher-resolution data generators for the Jena dataset", "words": [{"w": "Listing", "b": [0.1483, 0.6579, 0.2198, 0.6776]}, {"w": "6.48.", "b": [0.2261, 0.6579, 0.2766, 0.6776]}, {"w": "Preparing", "b": [0.2829, 0.6579, 0.381, 0.6776]}, {"w": "higher-resolution", "b": [0.3873, 0.6579, 0.5605, 0.6776]}, {"w": "data", "b": [0.5668, 0.6579, 0.6088, 0.6776]}, {"w": "generators", "b": [0.6151, 0.6579, 0.7202, 0.6776]}, {"w": "for", "b": [0.7265, 0.6579, 0.7559, 0.6776]}, {"w": "the", "b": [0.7622, 0.6579, 0.793, 0.6776]}, {"w": "Jena", "b": [0.7994, 0.6579, 0.8442, 0.6776]}, {"w": "dataset", "b": [0.1483, 0.6784, 0.2184, 0.6981]}]}, {"id": "b_18", "type": "paragraph", "text": "Listing 6.49. Model combining a 1D convolutional base and a GRU layer", "words": [{"w": "Listing", "b": [0.1483, 0.706, 0.2198, 0.7258]}, {"w": "6.49.", "b": [0.2261, 0.706, 0.2766, 0.7258]}, {"w": "Model", "b": [0.2829, 0.706, 0.3488, 0.7258]}, {"w": "combining", "b": [0.3551, 0.706, 0.463, 0.7258]}, {"w": "a", "b": [0.4693, 0.706, 0.4805, 0.7258]}, {"w": "1D", "b": [0.4868, 0.706, 0.5176, 0.7258]}, {"w": "convolutional", "b": [0.5239, 0.706, 0.6627, 0.7258]}, {"w": "base", "b": [0.669, 0.706, 0.7138, 0.7258]}, {"w": "and", "b": [0.7201, 0.706, 0.7565, 0.7258]}, {"w": "a", "b": [0.7628, 0.706, 0.774, 0.7258]}, {"w": "GRU", "b": [0.7803, 0.706, 0.8336, 0.7258]}, {"w": "layer", "b": [0.1483, 0.7265, 0.1988, 0.7463]}]}, {"id": "b_19", "type": "equation", "text": "Chapter 7. Advanced deep-learning best practices", "words": [{"w": "Chapter", "b": [0.1294, 0.7693, 0.2093, 0.7891]}, {"w": "7.", "b": [0.2156, 0.7693, 0.2345, 0.7891]}, {"w": "Advanced", "b": [0.2408, 0.7693, 0.3431, 0.7891]}, {"w": "deep-learning", "b": [0.3494, 0.7693, 0.4881, 0.7891]}, {"w": "best", "b": [0.4944, 0.7693, 0.535, 0.7891]}, {"w": "practices", "b": [0.5413, 0.7693, 0.631, 0.7891]}]}, {"id": "b_20", "type": "paragraph", "text": "Listing 7.1. Functional API implementation of a two-input question- answering model", "words": [{"w": "Listing", "b": [0.1483, 0.8076, 0.2198, 0.8274]}, {"w": "7.1.", "b": [0.2261, 0.8076, 0.264, 0.8274]}, {"w": "Functional", "b": [0.2703, 0.8076, 0.3782, 0.8274]}, {"w": "API", "b": [0.3845, 0.8076, 0.4251, 0.8274]}, {"w": "implementation", "b": [0.4314, 0.8076, 0.5898, 0.8274]}, {"w": "of", "b": [0.5961, 0.8076, 0.6171, 0.8274]}, {"w": "a", "b": [0.6234, 0.8076, 0.6346, 0.8274]}, {"w": "two-input", "b": [0.6409, 0.8076, 0.739, 0.8274]}, {"w": "question-", "b": [0.7453, 0.8076, 0.8392, 0.8274]}, {"w": "answering", "b": [0.1483, 0.8281, 0.252, 0.8479]}, {"w": "model", "b": [0.2583, 0.8281, 0.3214, 0.8479]}]}, {"id": "b_21", "type": "equation", "text": "Listing 7.2. Feeding data to a multi-input model", "words": [{"w": "Listing", "b": [0.1483, 0.8558, 0.2198, 0.8755]}, {"w": "7.2.", "b": [0.2261, 0.8558, 0.264, 0.8755]}, {"w": "Feeding", "b": [0.2703, 0.8558, 0.3516, 0.8755]}, {"w": "data", "b": [0.3579, 0.8558, 0.3999, 0.8755]}, {"w": "to", "b": [0.4062, 0.8558, 0.4258, 0.8755]}, {"w": "a", "b": [0.4321, 0.8558, 0.4433, 0.8755]}, {"w": "multi-input", "b": [0.4496, 0.8558, 0.5632, 0.8755]}, {"w": "model", "b": [0.5695, 0.8558, 0.6325, 0.8755]}]}, {"id": "b_22", "type": "equation", "text": "Listing 7.3. Functional API implementation of a three-output model", "words": [{"w": "Listing", "b": [0.1483, 0.8834, 0.2198, 0.9031]}, {"w": "7.3.", "b": [0.2261, 0.8834, 0.264, 0.9031]}, {"w": "Functional", "b": [0.2703, 0.8834, 0.3782, 0.9031]}, {"w": "API", "b": [0.3845, 0.8834, 0.4251, 0.9031]}, {"w": "implementation", "b": [0.4314, 0.8834, 0.5898, 0.9031]}, {"w": "of", "b": [0.5961, 0.8834, 0.6171, 0.9031]}, {"w": "a", "b": [0.6234, 0.8834, 0.6346, 0.9031]}, {"w": "three-output", "b": [0.6409, 0.8834, 0.7642, 0.9031]}, {"w": "model", "b": [0.7706, 0.8834, 0.8336, 0.9031]}]}]}, {"page": 492, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "equation", "text": "Listing 7.4. Compilation options of a multi-output model: multiple losses", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "7.4.", "b": [0.2261, 0.0857, 0.264, 0.1054]}, {"w": "Compilation", "b": [0.2703, 0.0857, 0.3964, 0.1054]}, {"w": "options", "b": [0.4027, 0.0857, 0.477, 0.1054]}, {"w": "of", "b": [0.4833, 0.0857, 0.5043, 0.1054]}, {"w": "a", "b": [0.5106, 0.0857, 0.5218, 0.1054]}, {"w": "multi-output", "b": [0.5282, 0.0857, 0.6543, 0.1054]}, {"w": "model:", "b": [0.6606, 0.0857, 0.7307, 0.1054]}, {"w": "multiple", "b": [0.737, 0.0857, 0.8211, 0.1054]}, {"w": "losses", "b": [0.1483, 0.1062, 0.2086, 0.1259]}]}, {"id": "b_1", "type": "equation", "text": "Listing 7.5. Compilation options of a multi-output model: loss weighting", "words": [{"w": "Listing", "b": [0.1483, 0.1338, 0.2198, 0.1535]}, {"w": "7.5.", "b": [0.2261, 0.1338, 0.264, 0.1535]}, {"w": "Compilation", "b": [0.2703, 0.1338, 0.3964, 0.1535]}, {"w": "options", "b": [0.4027, 0.1338, 0.477, 0.1535]}, {"w": "of", "b": [0.4833, 0.1338, 0.5043, 0.1535]}, {"w": "a", "b": [0.5106, 0.1338, 0.5218, 0.1535]}, {"w": "multi-output", "b": [0.5282, 0.1338, 0.6543, 0.1535]}, {"w": "model:", "b": [0.6606, 0.1338, 0.7307, 0.1535]}, {"w": "loss", "b": [0.737, 0.1338, 0.7763, 0.1535]}, {"w": "weighting", "b": [0.1483, 0.1543, 0.2492, 0.174]}]}, {"id": "b_2", "type": "equation", "text": "Listing 7.6. Feeding data to a multi-output model", "words": [{"w": "Listing", "b": [0.1483, 0.1819, 0.2198, 0.2017]}, {"w": "7.6.", "b": [0.2261, 0.1819, 0.264, 0.2017]}, {"w": "Feeding", "b": [0.2703, 0.1819, 0.3516, 0.2017]}, {"w": "data", "b": [0.3579, 0.1819, 0.3999, 0.2017]}, {"w": "to", "b": [0.4062, 0.1819, 0.4258, 0.2017]}, {"w": "a", "b": [0.4321, 0.1819, 0.4433, 0.2017]}, {"w": "multi-output", "b": [0.4496, 0.1819, 0.5758, 0.2017]}, {"w": "model", "b": [0.5821, 0.1819, 0.6452, 0.2017]}]}, {"id": "b_3", "type": "equation", "text": "Listing 7.7. Text-classification model to use with TensorBoard", "words": [{"w": "Listing", "b": [0.1483, 0.2096, 0.2198, 0.2293]}, {"w": "7.7.", "b": [0.2261, 0.2096, 0.264, 0.2293]}, {"w": "Text-classification", "b": [0.2703, 0.2096, 0.4562, 0.2293]}, {"w": "model", "b": [0.4626, 0.2096, 0.5256, 0.2293]}, {"w": "to", "b": [0.5319, 0.2096, 0.5516, 0.2293]}, {"w": "use", "b": [0.5579, 0.2096, 0.5915, 0.2293]}, {"w": "with", "b": [0.5978, 0.2096, 0.6426, 0.2293]}, {"w": "TensorBoard", "b": [0.6489, 0.2096, 0.7788, 0.2293]}]}, {"id": "b_4", "type": "paragraph", "text": "Listing 7.8. Creating a directory for TensorBoard log files", "words": [{"w": "Listing", "b": [0.1483, 0.2372, 0.2198, 0.2569]}, {"w": "7.8.", "b": [0.2261, 0.2372, 0.264, 0.2569]}, {"w": "Creating", "b": [0.2703, 0.2372, 0.3572, 0.2569]}, {"w": "a", "b": [0.3635, 0.2372, 0.3747, 0.2569]}, {"w": "directory", "b": [0.381, 0.2372, 0.472, 0.2569]}, {"w": "for", "b": [0.4783, 0.2372, 0.5077, 0.2569]}, {"w": "TensorBoard", "b": [0.5141, 0.2372, 0.6439, 0.2569]}, {"w": "log", "b": [0.6503, 0.2372, 0.6825, 0.2569]}, {"w": "files", "b": [0.6888, 0.2372, 0.7322, 0.2569]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 7.9. Training the model with a TensorBoard callback", "words": [{"w": "Listing", "b": [0.1483, 0.2648, 0.2198, 0.2846]}, {"w": "7.9.", "b": [0.2261, 0.2648, 0.264, 0.2846]}, {"w": "Training", "b": [0.2703, 0.2648, 0.3562, 0.2846]}, {"w": "the", "b": [0.3626, 0.2648, 0.3934, 0.2846]}, {"w": "model", "b": [0.3997, 0.2648, 0.4627, 0.2846]}, {"w": "with", "b": [0.4691, 0.2648, 0.5139, 0.2846]}, {"w": "a", "b": [0.5202, 0.2648, 0.5314, 0.2846]}, {"w": "TensorBoard", "b": [0.5377, 0.2648, 0.6676, 0.2846]}, {"w": "callback", "b": [0.6739, 0.2648, 0.758, 0.2846]}]}, {"id": "b_7", "type": "paragraph", "text": "Chapter 8. Generative deep learning", "words": [{"w": "Chapter", "b": [0.1294, 0.3076, 0.2093, 0.3274]}, {"w": "8.", "b": [0.2156, 0.3076, 0.2345, 0.3274]}, {"w": "Generative", "b": [0.2408, 0.3076, 0.3515, 0.3274]}, {"w": "deep", "b": [0.3578, 0.3076, 0.4054, 0.3274]}, {"w": "learning", "b": [0.4117, 0.3076, 0.4944, 0.3274]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 8.1. Reweighting a probability distribution to a different temperature", "words": [{"w": "Listing", "b": [0.1483, 0.3459, 0.2198, 0.3657]}, {"w": "8.1.", "b": [0.2261, 0.3459, 0.264, 0.3657]}, {"w": "Reweighting", "b": [0.2703, 0.3459, 0.3992, 0.3657]}, {"w": "a", "b": [0.4055, 0.3459, 0.4167, 0.3657]}, {"w": "probability", "b": [0.423, 0.3459, 0.5337, 0.3657]}, {"w": "distribution", "b": [0.54, 0.3459, 0.6564, 0.3657]}, {"w": "to", "b": [0.6627, 0.3459, 0.6823, 0.3657]}, {"w": "a", "b": [0.6886, 0.3459, 0.6998, 0.3657]}, {"w": "different", "b": [0.7061, 0.3459, 0.7924, 0.3657]}, {"w": "temperature", "b": [0.1483, 0.3664, 0.2688, 0.3862]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 8.2. Downloading and parsing the initial text file", "words": [{"w": "Listing", "b": [0.1483, 0.3941, 0.2198, 0.4138]}, {"w": "8.2.", "b": [0.2261, 0.3941, 0.264, 0.4138]}, {"w": "Downloading", "b": [0.2703, 0.3941, 0.4076, 0.4138]}, {"w": "and", "b": [0.4139, 0.3941, 0.4503, 0.4138]}, {"w": "parsing", "b": [0.4566, 0.3941, 0.5309, 0.4138]}, {"w": "the", "b": [0.5372, 0.3941, 0.568, 0.4138]}, {"w": "initial", "b": [0.5743, 0.3941, 0.6332, 0.4138]}, {"w": "text", "b": [0.6395, 0.3941, 0.6774, 0.4138]}, {"w": "file", "b": [0.6837, 0.3941, 0.7173, 0.4138]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 8.3. Vectorizing sequences of characters", "words": [{"w": "Listing", "b": [0.1483, 0.4217, 0.2198, 0.4414]}, {"w": "8.3.", "b": [0.2261, 0.4217, 0.264, 0.4414]}, {"w": "Vectorizing", "b": [0.2703, 0.4217, 0.3866, 0.4414]}, {"w": "sequences", "b": [0.3929, 0.4217, 0.4951, 0.4414]}, {"w": "of", "b": [0.5014, 0.4217, 0.5225, 0.4414]}, {"w": "characters", "b": [0.5288, 0.4217, 0.631, 0.4414]}]}, {"id": "b_11", "type": "equation", "text": "Listing 8.4. Single-layer LSTM model for next-character prediction", "words": [{"w": "Listing", "b": [0.1483, 0.4493, 0.2198, 0.4691]}, {"w": "8.4.", "b": [0.2261, 0.4493, 0.264, 0.4691]}, {"w": "Single-layer", "b": [0.2703, 0.4493, 0.3936, 0.4691]}, {"w": "LSTM", "b": [0.3999, 0.4493, 0.4672, 0.4691]}, {"w": "model", "b": [0.4735, 0.4493, 0.5365, 0.4691]}, {"w": "for", "b": [0.5428, 0.4493, 0.5723, 0.4691]}, {"w": "next-character", "b": [0.5786, 0.4493, 0.7228, 0.4691]}, {"w": "prediction", "b": [0.7291, 0.4493, 0.8314, 0.4691]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 8.5. Model compilation configuration", "words": [{"w": "Listing", "b": [0.1483, 0.477, 0.2198, 0.4967]}, {"w": "8.5.", "b": [0.2261, 0.477, 0.264, 0.4967]}, {"w": "Model", "b": [0.2703, 0.477, 0.3361, 0.4967]}, {"w": "compilation", "b": [0.3424, 0.477, 0.463, 0.4967]}, {"w": "configuration", "b": [0.4693, 0.477, 0.6052, 0.4967]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 8.6. Function to sample the next character given the model’s predictions", "words": [{"w": "Listing", "b": [0.1483, 0.5046, 0.2198, 0.5243]}, {"w": "8.6.", "b": [0.2261, 0.5046, 0.264, 0.5243]}, {"w": "Function", "b": [0.2703, 0.5046, 0.36, 0.5243]}, {"w": "to", "b": [0.3663, 0.5046, 0.3859, 0.5243]}, {"w": "sample", "b": [0.3922, 0.5046, 0.4637, 0.5243]}, {"w": "the", "b": [0.47, 0.5046, 0.5008, 0.5243]}, {"w": "next", "b": [0.5071, 0.5046, 0.5506, 0.5243]}, {"w": "character", "b": [0.5569, 0.5046, 0.6493, 0.5243]}, {"w": "given", "b": [0.6556, 0.5046, 0.7116, 0.5243]}, {"w": "the", "b": [0.718, 0.5046, 0.7488, 0.5243]}, {"w": "model’s", "b": [0.7551, 0.5046, 0.8349, 0.5243]}, {"w": "predictions", "b": [0.1483, 0.5251, 0.2604, 0.5448]}]}, {"id": "b_14", "type": "equation", "text": "Listing 8.7. Text-generation loop", "words": [{"w": "Listing", "b": [0.1483, 0.5527, 0.2198, 0.5725]}, {"w": "8.7.", "b": [0.2261, 0.5527, 0.264, 0.5725]}, {"w": "Text-generation", "b": [0.2703, 0.5527, 0.4296, 0.5725]}, {"w": "loop", "b": [0.4359, 0.5527, 0.4808, 0.5725]}]}, {"id": "b_15", "type": "paragraph", "text": "Listing 8.8. Loading the pretrained Inception V3 model", "words": [{"w": "Listing", "b": [0.1483, 0.5804, 0.2198, 0.6001]}, {"w": "8.8.", "b": [0.2261, 0.5804, 0.264, 0.6001]}, {"w": "Loading", "b": [0.2703, 0.5804, 0.3544, 0.6001]}, {"w": "the", "b": [0.3607, 0.5804, 0.3915, 0.6001]}, {"w": "pretrained", "b": [0.3978, 0.5804, 0.5001, 0.6001]}, {"w": "Inception", "b": [0.5064, 0.5804, 0.6016, 0.6001]}, {"w": "V3", "b": [0.6079, 0.5804, 0.6388, 0.6001]}, {"w": "model", "b": [0.6451, 0.5804, 0.7081, 0.6001]}]}, {"id": "b_16", "type": "paragraph", "text": "Listing 8.9. Setting up the DeepDream configuration", "words": [{"w": "Listing", "b": [0.1483, 0.608, 0.2198, 0.6277]}, {"w": "8.9.", "b": [0.2261, 0.608, 0.264, 0.6277]}, {"w": "Setting", "b": [0.2703, 0.608, 0.3418, 0.6277]}, {"w": "up", "b": [0.3481, 0.608, 0.3733, 0.6277]}, {"w": "the", "b": [0.3796, 0.608, 0.4104, 0.6277]}, {"w": "DeepDream", "b": [0.4167, 0.608, 0.5386, 0.6277]}, {"w": "configuration", "b": [0.5449, 0.608, 0.6808, 0.6277]}]}, {"id": "b_17", "type": "paragraph", "text": "Listing 8.10. Defining the loss to be maximized", "words": [{"w": "Listing", "b": [0.1483, 0.6356, 0.2198, 0.6554]}, {"w": "8.10.", "b": [0.2261, 0.6356, 0.2766, 0.6554]}, {"w": "Defining", "b": [0.2829, 0.6356, 0.3726, 0.6554]}, {"w": "the", "b": [0.3789, 0.6356, 0.4097, 0.6554]}, {"w": "loss", "b": [0.416, 0.6356, 0.4553, 0.6554]}, {"w": "to", "b": [0.4616, 0.6356, 0.4812, 0.6554]}, {"w": "be", "b": [0.4875, 0.6356, 0.5113, 0.6554]}, {"w": "maximized", "b": [0.5176, 0.6356, 0.6297, 0.6554]}]}, {"id": "b_18", "type": "equation", "text": "Listing 8.11. Gradient-ascent process", "words": [{"w": "Listing", "b": [0.1483, 0.6632, 0.2198, 0.683]}, {"w": "8.11.", "b": [0.2261, 0.6632, 0.2756, 0.683]}, {"w": "Gradient-ascent", "b": [0.2819, 0.6632, 0.4416, 0.683]}, {"w": "process", "b": [0.4479, 0.6632, 0.5236, 0.683]}]}, {"id": "b_19", "type": "paragraph", "text": "Listing 8.12. Running gradient ascent over different successive scales", "words": [{"w": "Listing", "b": [0.1483, 0.6909, 0.2198, 0.7106]}, {"w": "8.12.", "b": [0.2261, 0.6909, 0.2766, 0.7106]}, {"w": "Running", "b": [0.2829, 0.6909, 0.3698, 0.7106]}, {"w": "gradient", "b": [0.3761, 0.6909, 0.4588, 0.7106]}, {"w": "ascent", "b": [0.4651, 0.6909, 0.5281, 0.7106]}, {"w": "over", "b": [0.5344, 0.6909, 0.5792, 0.7106]}, {"w": "different", "b": [0.5855, 0.6909, 0.6719, 0.7106]}, {"w": "successive", "b": [0.6782, 0.6909, 0.7847, 0.7106]}, {"w": "scales", "b": [0.1483, 0.7114, 0.2086, 0.7311]}]}, {"id": "b_20", "type": "paragraph", "text": "Listing 8.13. Auxiliary functions", "words": [{"w": "Listing", "b": [0.1483, 0.739, 0.2198, 0.7588]}, {"w": "8.13.", "b": [0.2261, 0.739, 0.2766, 0.7588]}, {"w": "Auxiliary", "b": [0.2829, 0.739, 0.3796, 0.7588]}, {"w": "functions", "b": [0.3859, 0.739, 0.4798, 0.7588]}]}, {"id": "b_21", "type": "paragraph", "text": "Listing 8.14. Defining initial variables", "words": [{"w": "Listing", "b": [0.1483, 0.7666, 0.2198, 0.7864]}, {"w": "8.14.", "b": [0.2261, 0.7666, 0.2766, 0.7864]}, {"w": "Defining", "b": [0.2829, 0.7666, 0.3726, 0.7864]}, {"w": "initial", "b": [0.3789, 0.7666, 0.4377, 0.7864]}, {"w": "variables", "b": [0.4441, 0.7666, 0.5351, 0.7864]}]}, {"id": "b_22", "type": "paragraph", "text": "Listing 8.15. Auxiliary functions", "words": [{"w": "Listing", "b": [0.1483, 0.7943, 0.2198, 0.814]}, {"w": "8.15.", "b": [0.2261, 0.7943, 0.2766, 0.814]}, {"w": "Auxiliary", "b": [0.2829, 0.7943, 0.3796, 0.814]}, {"w": "functions", "b": [0.3859, 0.7943, 0.4798, 0.814]}]}, {"id": "b_23", "type": "paragraph", "text": "Listing 8.16. Loading the pretrained VGG19 network and applying it to the three images", "words": [{"w": "Listing", "b": [0.1483, 0.8219, 0.2198, 0.8416]}, {"w": "8.16.", "b": [0.2261, 0.8219, 0.2766, 0.8416]}, {"w": "Loading", "b": [0.2829, 0.8219, 0.367, 0.8416]}, {"w": "the", "b": [0.3733, 0.8219, 0.4041, 0.8416]}, {"w": "pretrained", "b": [0.4104, 0.8219, 0.5127, 0.8416]}, {"w": "VGG19", "b": [0.519, 0.8219, 0.5988, 0.8416]}, {"w": "network", "b": [0.6051, 0.8219, 0.6878, 0.8416]}, {"w": "and", "b": [0.6941, 0.8219, 0.7305, 0.8416]}, {"w": "applying", "b": [0.7368, 0.8219, 0.8251, 0.8416]}, {"w": "it", "b": [0.8314, 0.8219, 0.8455, 0.8416]}, {"w": "to", "b": [0.1483, 0.8424, 0.168, 0.8621]}, {"w": "the", "b": [0.1743, 0.8424, 0.2051, 0.8621]}, {"w": "three", "b": [0.2114, 0.8424, 0.2618, 0.8621]}, {"w": "images", "b": [0.2681, 0.8424, 0.3396, 0.8621]}]}, {"id": "b_24", "type": "paragraph", "text": "Listing 8.17. Content loss", "words": [{"w": "Listing", "b": [0.1483, 0.87, 0.2198, 0.8898]}, {"w": "8.17.", "b": [0.2261, 0.87, 0.2766, 0.8898]}, {"w": "Content", "b": [0.2829, 0.87, 0.3628, 0.8898]}, {"w": "loss", "b": [0.3691, 0.87, 0.4083, 0.8898]}]}]}, {"page": 493, "dimensions": {"width": 595.0, "height": 841.9}, "blocks": [{"id": "b_0", "type": "paragraph", "text": "Listing 8.18. Style loss", "words": [{"w": "Listing", "b": [0.1483, 0.0857, 0.2198, 0.1054]}, {"w": "8.18.", "b": [0.2261, 0.0857, 0.2766, 0.1054]}, {"w": "Style", "b": [0.2829, 0.0857, 0.3347, 0.1054]}, {"w": "loss", "b": [0.3411, 0.0857, 0.3803, 0.1054]}]}, {"id": "b_1", "type": "paragraph", "text": "Listing 8.19. Total variation loss", "words": [{"w": "Listing", "b": [0.1483, 0.1133, 0.2198, 0.133]}, {"w": "8.19.", "b": [0.2261, 0.1133, 0.2766, 0.133]}, {"w": "Total", "b": [0.2829, 0.1133, 0.3344, 0.133]}, {"w": "variation", "b": [0.3407, 0.1133, 0.4303, 0.133]}, {"w": "loss", "b": [0.4366, 0.1133, 0.4759, 0.133]}]}, {"id": "b_2", "type": "paragraph", "text": "Listing 8.20. Defining the final loss that you’ll minimize", "words": [{"w": "Listing", "b": [0.1483, 0.1409, 0.2198, 0.1607]}, {"w": "8.20.", "b": [0.2261, 0.1409, 0.2766, 0.1607]}, {"w": "Defining", "b": [0.2829, 0.1409, 0.3726, 0.1607]}, {"w": "the", "b": [0.3789, 0.1409, 0.4097, 0.1607]}, {"w": "final", "b": [0.416, 0.1409, 0.4622, 0.1607]}, {"w": "loss", "b": [0.4685, 0.1409, 0.5078, 0.1607]}, {"w": "that", "b": [0.5141, 0.1409, 0.5519, 0.1607]}, {"w": "you’ll", "b": [0.5582, 0.1409, 0.6185, 0.1607]}, {"w": "minimize", "b": [0.6248, 0.1409, 0.7201, 0.1607]}]}, {"id": "b_3", "type": "equation", "text": "Listing 8.21. Setting up the gradient-descent process", "words": [{"w": "Listing", "b": [0.1483, 0.1686, 0.2198, 0.1883]}, {"w": "8.21.", "b": [0.2261, 0.1686, 0.2766, 0.1883]}, {"w": "Setting", "b": [0.2829, 0.1686, 0.3544, 0.1883]}, {"w": "up", "b": [0.3607, 0.1686, 0.3859, 0.1883]}, {"w": "the", "b": [0.3922, 0.1686, 0.423, 0.1883]}, {"w": "gradient-descent", "b": [0.4293, 0.1686, 0.5961, 0.1883]}, {"w": "process", "b": [0.6024, 0.1686, 0.678, 0.1883]}]}, {"id": "b_4", "type": "equation", "text": "Listing 8.22. Style-transfer loop", "words": [{"w": "Listing", "b": [0.1483, 0.1962, 0.2198, 0.2159]}, {"w": "8.22.", "b": [0.2261, 0.1962, 0.2766, 0.2159]}, {"w": "Style-transfer", "b": [0.2829, 0.1962, 0.4202, 0.2159]}, {"w": "loop", "b": [0.4265, 0.1962, 0.4713, 0.2159]}]}, {"id": "b_5", "type": "paragraph", "text": "Listing 8.23. VAE encoder network", "words": [{"w": "Listing", "b": [0.1483, 0.2238, 0.2198, 0.2436]}, {"w": "8.23.", "b": [0.2261, 0.2238, 0.2766, 0.2436]}, {"w": "VAE", "b": [0.2829, 0.2238, 0.3315, 0.2436]}, {"w": "encoder", "b": [0.3378, 0.2238, 0.4176, 0.2436]}, {"w": "network", "b": [0.4239, 0.2238, 0.5066, 0.2436]}]}, {"id": "b_6", "type": "equation", "text": "Listing 8.24. Latent-space-sampling function", "words": [{"w": "Listing", "b": [0.1483, 0.2515, 0.2198, 0.2712]}, {"w": "8.24.", "b": [0.2261, 0.2515, 0.2766, 0.2712]}, {"w": "Latent-space-sampling", "b": [0.2829, 0.2515, 0.5127, 0.2712]}, {"w": "function", "b": [0.519, 0.2515, 0.6031, 0.2712]}]}, {"id": "b_7", "type": "paragraph", "text": "Listing 8.25. VAE decoder network, mapping latent space points to images", "words": [{"w": "Listing", "b": [0.1483, 0.2791, 0.2198, 0.2988]}, {"w": "8.25.", "b": [0.2261, 0.2791, 0.2766, 0.2988]}, {"w": "VAE", "b": [0.2829, 0.2791, 0.3315, 0.2988]}, {"w": "decoder", "b": [0.3378, 0.2791, 0.4176, 0.2988]}, {"w": "network,", "b": [0.4239, 0.2791, 0.5129, 0.2988]}, {"w": "mapping", "b": [0.5192, 0.2791, 0.6075, 0.2988]}, {"w": "latent", "b": [0.6138, 0.2791, 0.6698, 0.2988]}, {"w": "space", "b": [0.6761, 0.2791, 0.7322, 0.2988]}, {"w": "points", "b": [0.7385, 0.2791, 0.8002, 0.2988]}, {"w": "to", "b": [0.8065, 0.2791, 0.8261, 0.2988]}, {"w": "images", "b": [0.1483, 0.2996, 0.2198, 0.3193]}]}, {"id": "b_8", "type": "paragraph", "text": "Listing 8.26. Custom layer used to compute the VAE loss", "words": [{"w": "Listing", "b": [0.1483, 0.3272, 0.2198, 0.347]}, {"w": "8.26.", "b": [0.2261, 0.3272, 0.2766, 0.347]}, {"w": "Custom", "b": [0.2829, 0.3272, 0.3614, 0.347]}, {"w": "layer", "b": [0.3677, 0.3272, 0.4181, 0.347]}, {"w": "used", "b": [0.4244, 0.3272, 0.4707, 0.347]}, {"w": "to", "b": [0.477, 0.3272, 0.4966, 0.347]}, {"w": "compute", "b": [0.5029, 0.3272, 0.5898, 0.347]}, {"w": "the", "b": [0.5961, 0.3272, 0.6269, 0.347]}, {"w": "VAE", "b": [0.6332, 0.3272, 0.6818, 0.347]}, {"w": "loss", "b": [0.6881, 0.3272, 0.7273, 0.347]}]}, {"id": "b_9", "type": "paragraph", "text": "Listing 8.27. Training the VAE", "words": [{"w": "Listing", "b": [0.1483, 0.3549, 0.2198, 0.3746]}, {"w": "8.27.", "b": [0.2261, 0.3549, 0.2766, 0.3746]}, {"w": "Training", "b": [0.2829, 0.3549, 0.3689, 0.3746]}, {"w": "the", "b": [0.3752, 0.3549, 0.406, 0.3746]}, {"w": "VAE", "b": [0.4123, 0.3549, 0.4609, 0.3746]}]}, {"id": "b_10", "type": "paragraph", "text": "Listing 8.28. Sampling a grid of points from the 2D latent space and decoding them to images", "words": [{"w": "Listing", "b": [0.1483, 0.3825, 0.2198, 0.4022]}, {"w": "8.28.", "b": [0.2261, 0.3825, 0.2766, 0.4022]}, {"w": "Sampling", "b": [0.2829, 0.3825, 0.3796, 0.4022]}, {"w": "a", "b": [0.3859, 0.3825, 0.3971, 0.4022]}, {"w": "grid", "b": [0.4034, 0.3825, 0.4441, 0.4022]}, {"w": "of", "b": [0.4504, 0.3825, 0.4714, 0.4022]}, {"w": "points", "b": [0.4777, 0.3825, 0.5394, 0.4022]}, {"w": "from", "b": [0.5457, 0.3825, 0.5947, 0.4022]}, {"w": "the", "b": [0.601, 0.3825, 0.6318, 0.4022]}, {"w": "2D", "b": [0.6381, 0.3825, 0.669, 0.4022]}, {"w": "latent", "b": [0.6753, 0.3825, 0.7313, 0.4022]}, {"w": "space", "b": [0.7376, 0.3825, 0.7937, 0.4022]}, {"w": "and", "b": [0.8, 0.3825, 0.8364, 0.4022]}, {"w": "decoding", "b": [0.1483, 0.403, 0.2408, 0.4227]}, {"w": "them", "b": [0.2471, 0.403, 0.2976, 0.4227]}, {"w": "to", "b": [0.3039, 0.403, 0.3235, 0.4227]}, {"w": "images", "b": [0.3298, 0.403, 0.4013, 0.4227]}]}, {"id": "b_11", "type": "paragraph", "text": "Listing 8.29. GAN generator network", "words": [{"w": "Listing", "b": [0.1483, 0.4306, 0.2198, 0.4504]}, {"w": "8.29.", "b": [0.2261, 0.4306, 0.2766, 0.4504]}, {"w": "GAN", "b": [0.2829, 0.4306, 0.3375, 0.4504]}, {"w": "generator", "b": [0.3438, 0.4306, 0.4391, 0.4504]}, {"w": "network", "b": [0.4454, 0.4306, 0.5281, 0.4504]}]}, {"id": "b_12", "type": "paragraph", "text": "Listing 8.30. The GAN discriminator network", "words": [{"w": "Listing", "b": [0.1483, 0.4582, 0.2198, 0.478]}, {"w": "8.30.", "b": [0.2261, 0.4582, 0.2766, 0.478]}, {"w": "The", "b": [0.2829, 0.4582, 0.3221, 0.478]}, {"w": "GAN", "b": [0.3284, 0.4582, 0.3831, 0.478]}, {"w": "discriminator", "b": [0.3894, 0.4582, 0.5239, 0.478]}, {"w": "network", "b": [0.5302, 0.4582, 0.6129, 0.478]}]}, {"id": "b_13", "type": "paragraph", "text": "Listing 8.31. Adversarial network", "words": [{"w": "Listing", "b": [0.1483, 0.4859, 0.2198, 0.5056]}, {"w": "8.31.", "b": [0.2261, 0.4859, 0.2766, 0.5056]}, {"w": "Adversarial", "b": [0.2829, 0.4859, 0.4006, 0.5056]}, {"w": "network", "b": [0.4069, 0.4859, 0.4895, 0.5056]}]}, {"id": "b_14", "type": "paragraph", "text": "Listing 8.32. Implementing GAN training", "words": [{"w": "Listing", "b": [0.1483, 0.5135, 0.2198, 0.5332]}, {"w": "8.32.", "b": [0.2261, 0.5135, 0.2766, 0.5332]}, {"w": "Implementing", "b": [0.2829, 0.5135, 0.4244, 0.5332]}, {"w": "GAN", "b": [0.4307, 0.5135, 0.4854, 0.5332]}, {"w": "training", "b": [0.4917, 0.5135, 0.5702, 0.5332]}]}]}]} \ No newline at end of file