{"id":294,"date":"2016-08-04T16:37:54","date_gmt":"2016-08-04T16:37:54","guid":{"rendered":"http:\/\/deberker.com\/archy\/?p=294"},"modified":"2021-11-06T16:01:30","modified_gmt":"2021-11-06T16:01:30","slug":"deep-learning-practical-2-decoding-mnist","status":"publish","type":"post","link":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/","title":{"rendered":"Deep Learning Practical 2: Decoding MNIST"},"content":{"rendered":"<p>MNIST (Mixed\u00a0National Institute of Standards and Technology) is a database of handwritten digits. Compiled by<a href=\"http:\/\/yann.lecun.com\/exdb\/mnist\/\"> Yann LeCun and colleagues<\/a>, it&#8217;s a classic benchmark problem in machine learning. Pleasingly, you can write a model in Tensorflow that does a decent job of decoding the digits.<\/p>\n<p>Having got to grips with Python and some of the Tensorflow fundamentals, we cannibalised the official\u00a0Tensorflow tutorial 3 (&#8216;MNIST from scratch&#8217;) to make an easy-to-follow tutorial for cracking MNIST using a simple feedforward network. If this is your first time with TF, you might find the <a href=\"http:\/\/deberker.com\/archy\/?p=241\">Tensorflow Tutorial 1 a better starting point.<\/a><\/p>\n<p>We go through the following steps:<\/p>\n<ol>\n<li>\u00a0Import the data<\/li>\n<li>\u00a0Look at the data<\/li>\n<li>\u00a0Figure out normalization<\/li>\n<li>\u00a0Compile training, validation, and test sets<\/li>\n<li>\u00a0Define model in Tensorflow<\/li>\n<li>\u00a0Run the model without training<\/li>\n<li>\u00a0Train and test<\/li>\n<li>\u00a0Evaluate performance<\/li>\n<\/ol>\n<p>Download the iPython notebook<a href=\"http:\/\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/archyZebTF_Tutorial2_MNIST.ipynb_.zip\">\u00a0here.<\/a><\/p>\n<p>Any questions or corrections,<a href=\"mailto:a@deberker.com\"> give me a shout.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MNIST (Mixed\u00a0National Institute of Standards and Technology) is a database of handwritten digits. Compiled by Yann LeCun and colleagues, it&#8217;s a classic benchmark problem in machine learning. Pleasingly, you can write a model in Tensorflow that does a decent job of decoding the digits. Having got to grips with Python and some of the Tensorflow [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":293,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"hide_page_title":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[6],"tags":[],"class_list":["post-294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-neural-networks"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Deep Learning Practical 2: Decoding MNIST - Archy de Berker<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deep Learning Practical 2: Decoding MNIST - Archy de Berker\" \/>\n<meta property=\"og:description\" content=\"MNIST (Mixed\u00a0National Institute of Standards and Technology) is a database of handwritten digits. Compiled by Yann LeCun and colleagues, it&#8217;s a classic benchmark problem in machine learning. Pleasingly, you can write a model in Tensorflow that does a decent job of decoding the digits. Having got to grips with Python and some of the Tensorflow [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\" \/>\n<meta property=\"og:site_name\" content=\"Archy de Berker\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-04T16:37:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-06T16:01:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1140\" \/>\n\t<meta property=\"og:image:height\" content=\"440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"archy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@archydeb\" \/>\n<meta name=\"twitter:site\" content=\"@archydeb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"archy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\"},\"author\":{\"name\":\"archy\",\"@id\":\"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d\"},\"headline\":\"Deep Learning Practical 2: Decoding MNIST\",\"datePublished\":\"2016-08-04T16:37:54+00:00\",\"dateModified\":\"2021-11-06T16:01:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\"},\"wordCount\":152,\"publisher\":{\"@id\":\"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d\"},\"image\":{\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1\",\"articleSection\":[\"Neural networks\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\",\"url\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\",\"name\":\"Deep Learning Practical 2: Decoding MNIST - Archy de Berker\",\"isPartOf\":{\"@id\":\"https:\/\/deberker.com\/archy\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1\",\"datePublished\":\"2016-08-04T16:37:54+00:00\",\"dateModified\":\"2021-11-06T16:01:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1\",\"width\":1140,\"height\":440},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/deberker.com\/archy\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deep Learning Practical 2: Decoding MNIST\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/deberker.com\/archy\/#website\",\"url\":\"https:\/\/deberker.com\/archy\/\",\"name\":\"Archy de Berker\",\"description\":\"Building things with data\",\"publisher\":{\"@id\":\"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/deberker.com\/archy\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d\",\"name\":\"archy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/deberker.com\/archy\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2021\/09\/freelance-logo.png?fit=359%2C311&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2021\/09\/freelance-logo.png?fit=359%2C311&ssl=1\",\"width\":359,\"height\":311,\"caption\":\"archy\"},\"logo\":{\"@id\":\"https:\/\/deberker.com\/archy\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/archydeb\"],\"url\":\"https:\/\/deberker.com\/archy\/author\/archy\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Deep Learning Practical 2: Decoding MNIST - Archy de Berker","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/","og_locale":"en_US","og_type":"article","og_title":"Deep Learning Practical 2: Decoding MNIST - Archy de Berker","og_description":"MNIST (Mixed\u00a0National Institute of Standards and Technology) is a database of handwritten digits. Compiled by Yann LeCun and colleagues, it&#8217;s a classic benchmark problem in machine learning. Pleasingly, you can write a model in Tensorflow that does a decent job of decoding the digits. Having got to grips with Python and some of the Tensorflow [&hellip;]","og_url":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/","og_site_name":"Archy de Berker","article_published_time":"2016-08-04T16:37:54+00:00","article_modified_time":"2021-11-06T16:01:30+00:00","og_image":[{"width":1140,"height":440,"url":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1","type":"image\/png"}],"author":"archy","twitter_card":"summary_large_image","twitter_creator":"@archydeb","twitter_site":"@archydeb","twitter_misc":{"Written by":"archy","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#article","isPartOf":{"@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/"},"author":{"name":"archy","@id":"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d"},"headline":"Deep Learning Practical 2: Decoding MNIST","datePublished":"2016-08-04T16:37:54+00:00","dateModified":"2021-11-06T16:01:30+00:00","mainEntityOfPage":{"@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/"},"wordCount":152,"publisher":{"@id":"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d"},"image":{"@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1","articleSection":["Neural networks"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/","url":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/","name":"Deep Learning Practical 2: Decoding MNIST - Archy de Berker","isPartOf":{"@id":"https:\/\/deberker.com\/archy\/#website"},"primaryImageOfPage":{"@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage"},"image":{"@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1","datePublished":"2016-08-04T16:37:54+00:00","dateModified":"2021-11-06T16:01:30+00:00","breadcrumb":{"@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#primaryimage","url":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1","contentUrl":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1","width":1140,"height":440},{"@type":"BreadcrumbList","@id":"https:\/\/deberker.com\/archy\/deep-learning-practical-2-decoding-mnist\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/deberker.com\/archy\/"},{"@type":"ListItem","position":2,"name":"Deep Learning Practical 2: Decoding MNIST"}]},{"@type":"WebSite","@id":"https:\/\/deberker.com\/archy\/#website","url":"https:\/\/deberker.com\/archy\/","name":"Archy de Berker","description":"Building things with data","publisher":{"@id":"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/deberker.com\/archy\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/deberker.com\/archy\/#\/schema\/person\/01cf8dd0f94a4ba124b26eeeeb59e67d","name":"archy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/deberker.com\/archy\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2021\/09\/freelance-logo.png?fit=359%2C311&ssl=1","contentUrl":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2021\/09\/freelance-logo.png?fit=359%2C311&ssl=1","width":359,"height":311,"caption":"archy"},"logo":{"@id":"https:\/\/deberker.com\/archy\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/x.com\/archydeb"],"url":"https:\/\/deberker.com\/archy\/author\/archy\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/deberker.com\/archy\/wp-content\/uploads\/2016\/08\/deepL_Practical2.png?fit=1140%2C440&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4cGwe-4K","jetpack-related-posts":[],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":2,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":1158,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/posts\/294\/revisions\/1158"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/media\/293"}],"wp:attachment":[{"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deberker.com\/archy\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}