{"id":2482,"date":"2019-02-01T17:51:25","date_gmt":"2019-02-01T17:51:25","guid":{"rendered":"https:\/\/gergely.imreh.net\/blog\/?p=2482"},"modified":"2019-02-02T10:26:40","modified_gmt":"2019-02-02T10:26:40","slug":"how-not-to-start-with-machine-learning","status":"publish","type":"post","link":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/","title":{"rendered":"How not to start with machine learning"},"content":{"rendered":"\n<p>I&#8217;m a technical and scientific person. I&#8217;ve done some <a href=\"https:\/\/gergely.imreh.net\/blog\/2012\/01\/adventures-into-online-learning\/\">online courses<\/a> on machine learning, read enough articles about different machine learning projects, I go through the discussions of those projects on <a href=\"https:\/\/news.ycombinator.com\">Hacker News<\/a>, and kept a bunch of ideas what would be cool for the machines to actually learn. I&#8217;m in the right place to actually do some project, right? Right? \ud83d\udea8 Wrong, the Universe says no&#8230;<\/p>\n\n\n\n<p>This is the story of how I&#8217;ve tried one particular project that seemed easy enough, but leading me to go back a few (a bunch of) steps, and rethink my whole approach.<\/p>\n\n\n\n<p>I bet almost everyone in tech (and a lot of people beyond) heard of <a href=\"https:\/\/deepmind.com\/research\/alphago\/\">AlphaGo<\/a>, Deepmind&#8217;s program to play the game of Go beyond what humans can do. That has evolved, and the current state of the art is <a href=\"https:\/\/deepmind.com\/blog\/alphazero-shedding-new-light-grand-games-chess-shogi-and-go\/\">Alpha Zero<\/a>, which takes the approach of starting from scratch, just the rules of the game, and applying self-play, can master games like Go to an even higher level than the previous programmatic champion after relatively brief training (and beating AlphaGo and it&#8217;s successor AlphaGo Zero), but also apply to other games (such as chess and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Shogi\">shogi<\/a>). AlphaZero&#8217;s self-learning (and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Unsupervised_learning\">unsupervised learning<\/a> in general) fascinates me, and I was excited to see that someone published their open source AlphaZero implementation: <a href=\"https:\/\/github.com\/suragnair\/alpha-zero-general\/\">alpha-zero-general<\/a>. That project applies a smaller version of AlphaZero to a number of games, such as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Reversi\">Othello<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tic-tac-toe\">Tic-tac-toe<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Connect_Four\">Connect4<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Gomoku\">Gobang<\/a>. My plan was to learn by adding some features and training some models for some of the games (learn by doing). That sounds much easier to say than to do, and unravelled pretty quickly (but probably not as quickly as it should have been).<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I&#8217;ve picked the game Connect4, because a) I used to play that long time ago, b) feels like a relatively simple game, while still interesting, c) the repository didn&#8217;t have a pre-trained model for the  <a href=\"https:\/\/pytorch.org\/\">PyTorch<\/a> platform, that I wanted to try.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/3e1d2a8ca40cafc455663f79cf66125b98886a70-min.jpg\" alt=\"Connect 4\" class=\"wp-image-2486\" width=\"1000\" height=\"1000\" srcset=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/3e1d2a8ca40cafc455663f79cf66125b98886a70-min.jpg 1000w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/3e1d2a8ca40cafc455663f79cf66125b98886a70-min-150x150.jpg 150w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/3e1d2a8ca40cafc455663f79cf66125b98886a70-min-500x500.jpg 500w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/3e1d2a8ca40cafc455663f79cf66125b98886a70-min-768x768.jpg 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>Connect4, courtesy of <a href=\"https:\/\/shop.hasbro.com\/en-us\/product\/connect-4-game:80FB5BCA-5056-9047-F5F4-5EB5DF88DAF4\">Hasbro<\/a><\/figcaption><\/figure>\n\n\n\n<p>PyTorch was the choice, as it works both on GPUs (as the preferred workhorses of machine learning projects) and also on my laptop that only has a CPU to use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The unraveling<\/h3>\n\n\n\n<p>Getting started was easy enough. The neural network setup seemed to be pretty much the same between the different games, so I&#8217;ve just copied and adapted another PyTorch setup to Connect 4. Run it briefly on my laptop, and it was doing things, it was playing games. The training takes place in 3 phases: first generating some example games (from random valid moves, or existing model, I think); next train the model on those example games to recognize better what it takes to win; finally the new model is pitted against the previous one, and either accepted or rejected as the basis for further training, based on the win-draw-lose percentages.<\/p>\n\n\n\n<p>I&#8217;ve trained for a <g class=\"gr_ gr_8 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep\" id=\"8\" data-gr-id=\"8\">while,<\/g> and then played against the model to see how it feels. Seemed sensible enough, but of course, since I don&#8217;t play the game too well, so didn&#8217;t know what to expect.<\/p>\n\n\n\n<p>I&#8217;ve started to look for some better Connect4-player software that I can pit the trained model against, when realized that it is an already solved game, with a perfect strategy! You can see either <a href=\"https:\/\/tromp.github.io\/c4.html\">Expert Play in Connect-Four<\/a> by James D. Allen, or this entire masters thesis, <a href=\"http:\/\/www.informatik.uni-trier.de\/~fernau\/DSL0607\/Masterthesis-Viergewinnt.pdf\">A Knowledge-based Approach of Connect-Four<\/a> by Victor Allis. I &#8230; am yet to read either, but since I found an online implementation of the <a href=\"https:\/\/connect4.gamesolver.org\/\">Connect 4 Solver<\/a>, I knew that will help me to test how well the trained model work. Since the game is solved, and the first player will always win, that should help simplify and the training a bit, right? For example, I would know when the perfect strategy is achieved: when in the post-training it consistently gets 50% wins, 50% loss, and 0% draw, then it plays perfectly.<\/p>\n\n\n\n<p>Trying to validate this hunch, I was training it on my laptop, but the training times went up tremendously as the number example games are increased in each iteration. My laptop generated example games fast enough, but then the training was getting slower and slower. Needed to search for an alternative. Fortunately, I had access to an idle <a href=\"https:\/\/developer.nvidia.com\/embedded\/develop\/hardware\">NVIDIA Jetson TX2<\/a> machine, which is more-or-less a 64-bit ARM machine with some pretty decent GPU with plenty of <a href=\"https:\/\/www.geforce.co.uk\/hardware\/technology\/cuda\">CUDA<\/a> power attached. Was designed for machine learning, and should be perfect (or rather overkill?) for my application.<\/p>\n\n\n\n<p>Setting up wasn&#8217;t too difficult, though I think the <g class=\"gr_ gr_166 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling\" id=\"166\" data-gr-id=\"166\">pytorch<\/g> module has built for a <g class=\"gr_ gr_216 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling\" id=\"216\" data-gr-id=\"216\">whiiiiiile<\/g>, so I saved it as a Python <a href=\"https:\/\/pythonwheels.com\/\">wheel<\/a> to make it quicker to install next time. Then started the whole training process afresh the TX2. The second, training step was indeed a lot quicker (30-60 minutes instead of 4-8 hours), though now since the ARM core of the device is much slower than my X86 laptop, the first, game generation step and the last, tournament phase were a lot slower (an hour instead 10-15 minutes if I recall). Overall it&#8217;s still a win, so could run a handful of iterations in the process each day. It was the winter holidays, so there were plenty of days for the machine to train.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"241\" src=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-56-44-min-1024x241.png\" alt=\"Console log of training the model on the Jetson TX2\" class=\"wp-image-2488\" srcset=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-56-44-min-1024x241.png 1024w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-56-44-min-500x118.png 500w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-56-44-min-768x181.png 768w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-56-44-min-1568x370.png 1568w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Keep training, little computer<br><\/figcaption><\/figure>\n\n\n\n<p>What I ended up seeing is a kinda static phase. Almost all <g class=\"gr_ gr_221 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace\" id=\"221\" data-gr-id=\"221\">draws<\/g> in the tournament phase, with very few wins. There were many iterations with nothing really changing, new models being rejected for the lack of wins. Then pitting the model against the solver, it starts off well enough, for about 4-5 moves, and after that, the algorithm makes a move that is impossible to recover from&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"668\" src=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-40-14-min-1024x668.png\" alt=\"Screenshot of the Connect 4 solver website with a game that Red cannot win anymore, even though with perfect strategy Red would always win.\" class=\"wp-image-2490\" srcset=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-40-14-min-1024x668.png 1024w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-40-14-min-500x326.png 500w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-40-14-min-768x501.png 768w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-40-14-min-1568x1022.png 1568w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/Screenshot_2019-02-01_16-40-14-min.png 1868w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Playing against the <a href=\"https:\/\/connect4.gamesolver.org\/\">Solver<\/a>. Red always wins with perfect strategy.<\/figcaption><\/figure>\n\n\n\n<p>I was trying to change the code a bit, based on some quite interesting issues opened on the original repo. For example, there&#8217;s <a href=\"https:\/\/github.com\/suragnair\/alpha-zero-general\/issues\/95\">one asking<\/a> why the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Monte_Carlo_tree_search\">Monte Carlo Tree Search<\/a> is set up as it is, and whether another setup would help it train faster? (Faster is good, faster to see both successes and failures in the whole training process. Can&#8217;t waste time, when everything takes hours!). Then there&#8217;s <a href=\"https:\/\/github.com\/suragnair\/alpha-zero-general\/issues\/88\">another question<\/a> regarding the models ending up in draws all the time (that&#8217;s familiar?). Or this very straightforward &#8220;<a href=\"https:\/\/github.com\/suragnair\/alpha-zero-general\/issues\/96\">Connect4 Not <g class=\"gr_ gr_856 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace\" id=\"856\" data-gr-id=\"856\"><g class=\"gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace\" id=\"10\" data-gr-id=\"10\">Learing<\/g><\/g><\/a>&#8220;, which is obviously relevant to my interests. All are open and unsolved questions, so I went to look a bit deeper, that prompted <em>even more<\/em> questions.<\/p>\n\n\n\n<p>Why the implementation uses its neural network setup as it does, and does it work since it is much simpler than the original AlphaZero, as mentioned in the <a href=\"https:\/\/github.com\/suragnair\/alpha-zero-general\/issues\/96\">code author&#8217;s blog<\/a>? What do the different neural network designs mean, and how can I see quickly if I&#8217;ve set up one that has the potential to learn correctly or it&#8217;s a dummy? How does the AlphaZero algorithm actually work? Is it all tied down properly, or some parameters\/implementations are not clearly defined in the papers, as the issues I&#8217;ve mentioned above hint? How does PyTorch work and how do I use properly (and optimize it, much further down the line)?<\/p>\n\n\n\n<p>You might say these questions are very basic, fundamental, and that&#8217;s indeed the case. One misses the fundamentals in the hubris of jumping into a project that just because I have a general birds-eye view of the problem and some code of an unknown quality that someone&#8217;s written. It&#8217;s not all set and garden path to some sweet easy wins. I am not writing off that two weeks of experimentations as waste, but do need to change the approach.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Now what?<\/h3>\n\n\n\n<p>At this point going back to the basics sounds like the right way, and with more humble, step by step learning build up the skills to make more sense of the whole project.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Get to know PyTorch, and make some working examples building on the tutorials (or get inspired by them). Looking at some online courses like <a href=\"https:\/\/www.edx.org\/course\/deep-learning-with-python-and-pytorch\">the one by IBM<\/a> shared on edX. Work until the tools are getting comfortable.<\/li><li>Read the AlphaZero papers (the <a href=\"https:\/\/arxiv.org\/abs\/1712.01815\">original<\/a>, and the follow-up linked from <a href=\"https:\/\/deepmind.com\/blog\/alphazero-shedding-new-light-grand-games-chess-shogi-and-go\/\">their website<\/a>), as well as explore around the topic following their references and articles referring to them<\/li><li>Properly review the source code of the <a href=\"https:\/\/github.com\/suragnair\/alpha-zero-general\">open source implementation<\/a> I was using, and the accompanying <a href=\"http:\/\/web.stanford.edu\/~surag\/posts\/alphazero.html\">tutorial<\/a>. Not just skim and pull code blindly.<\/li><li>Bonus, find some higher <g class=\"gr_ gr_1122 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Grammar only-ins replaceWithoutSep\" id=\"1122\" data-gr-id=\"1122\">level<\/g> inspiration for neural network design (as getting the network right is the big part of the whole thing, that&#8217;s how it look). Sources like <a href=\"http:\/\/www.asimovinstitute.org\/neural-network-zoo\/\">The Neural Network Zoo<\/a> by the Asimov Institute, which shows different networks for different kinds of tasks.<\/li><\/ul>\n\n\n\n<p>This should get me to a point where the original plan has some chance of succeeding. And if it sounds like a common-sense plan, it is because yeah, maybe that&#8217;s what a lot of occasions need, a bit more common sense&#8230; I wonder if it&#8217;s a radical thought, but it took me a while to get to that. \ud83e\udd15<\/p>\n\n\n\n<p>In the future should also probably compare the different machine learning platforms as well, <a href=\"https:\/\/www.tensorflow.org\">TensorFlow<\/a>, <a href=\"https:\/\/keras.io\/\">Keras<\/a>, <a href=\"https:\/\/mxnet.apache.org\/\">MXNet<\/a>, maybe there are other ones as well, and run some sweet-sweet learning in the cloud (have some spare credits here and there, I wonder if they will expire by the time I&#8217;m done with my &#8220;common sense plan&#8221;).<\/p>\n\n\n\n<p>I wonder though if others also run into a wall like me, and if did, what did they do? Is there any other lesson in human learning that this machine learning story can provide?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve tried to teach computers to play Connect4, and they didn&#8217;t like it one bit.<\/p>\n","protected":false},"author":1,"featured_media":2483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[211,71,210],"class_list":["post-2482","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-prog","tag-jetson-tx2","tag-machine-learning","tag-pytorch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How not to start with machine learning - ClickedyClick<\/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:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How not to start with machine learning - ClickedyClick\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve tried to teach computers to play Connect4, and they didn&#039;t like it one bit.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/\" \/>\n<meta property=\"og:site_name\" content=\"ClickedyClick\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/gergely.imreh\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/gergely.imreh\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-01T17:51:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-02T10:26:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/IMAG0420-min.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"4788\" \/>\n\t<meta property=\"og:image:height\" content=\"3342\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gergely Imreh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@imrehg\" \/>\n<meta name=\"twitter:site\" content=\"@imrehg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gergely Imreh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/\"},\"author\":{\"name\":\"Gergely Imreh\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\"},\"headline\":\"How not to start with machine learning\",\"datePublished\":\"2019-02-01T17:51:25+00:00\",\"dateModified\":\"2019-02-02T10:26:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/\"},\"wordCount\":1604,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\"},\"image\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/something-went-wrong.jpg\",\"keywords\":[\"Jetson TX2\",\"Machine learning\",\"PyTorch\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/\",\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/\",\"name\":\"How not to start with machine learning - ClickedyClick\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/something-went-wrong.jpg\",\"datePublished\":\"2019-02-01T17:51:25+00:00\",\"dateModified\":\"2019-02-02T10:26:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/something-went-wrong.jpg\",\"contentUrl\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/something-went-wrong.jpg\",\"width\":4788,\"height\":3342},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2019\\\/02\\\/how-not-to-start-with-machine-learning\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How not to start with machine learning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/\",\"name\":\"ClickedyClick\",\"description\":\"Life in real, complex and digital.\",\"publisher\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\",\"name\":\"Gergely Imreh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\",\"caption\":\"Gergely Imreh\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\"},\"description\":\"Physicist, hacker. Enjoys avant-guarde literature probably a bit too much. Open source advocate and contributor, both for software and hardware. Follow these posts on the Fediverse by @gergely@gergely.imreh.net\",\"sameAs\":[\"https:\\\/\\\/gergely.imreh.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/gergely.imreh\",\"https:\\\/\\\/www.instagram.com\\\/imrehg\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/gergelyimreh\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@GergelyImreh\"],\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/author\\\/gergely\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How not to start with machine learning - ClickedyClick","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:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/","og_locale":"en_GB","og_type":"article","og_title":"How not to start with machine learning - ClickedyClick","og_description":"I've tried to teach computers to play Connect4, and they didn't like it one bit.","og_url":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/","og_site_name":"ClickedyClick","article_publisher":"https:\/\/www.facebook.com\/gergely.imreh","article_author":"https:\/\/www.facebook.com\/gergely.imreh","article_published_time":"2019-02-01T17:51:25+00:00","article_modified_time":"2019-02-02T10:26:40+00:00","og_image":[{"width":4788,"height":3342,"url":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/IMAG0420-min.jpg","type":"image\/jpeg"}],"author":"Gergely Imreh","twitter_card":"summary_large_image","twitter_creator":"@imrehg","twitter_site":"@imrehg","twitter_misc":{"Written by":"Gergely Imreh","Estimated reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#article","isPartOf":{"@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/"},"author":{"name":"Gergely Imreh","@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0"},"headline":"How not to start with machine learning","datePublished":"2019-02-01T17:51:25+00:00","dateModified":"2019-02-02T10:26:40+00:00","mainEntityOfPage":{"@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/"},"wordCount":1604,"commentCount":1,"publisher":{"@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0"},"image":{"@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#primaryimage"},"thumbnailUrl":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/something-went-wrong.jpg","keywords":["Jetson TX2","Machine learning","PyTorch"],"articleSection":["Programming"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/","url":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/","name":"How not to start with machine learning - ClickedyClick","isPartOf":{"@id":"https:\/\/gergely.imreh.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#primaryimage"},"image":{"@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#primaryimage"},"thumbnailUrl":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/something-went-wrong.jpg","datePublished":"2019-02-01T17:51:25+00:00","dateModified":"2019-02-02T10:26:40+00:00","breadcrumb":{"@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#primaryimage","url":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/something-went-wrong.jpg","contentUrl":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2019\/02\/something-went-wrong.jpg","width":4788,"height":3342},{"@type":"BreadcrumbList","@id":"https:\/\/gergely.imreh.net\/blog\/2019\/02\/how-not-to-start-with-machine-learning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gergely.imreh.net\/blog\/"},{"@type":"ListItem","position":2,"name":"How not to start with machine learning"}]},{"@type":"WebSite","@id":"https:\/\/gergely.imreh.net\/blog\/#website","url":"https:\/\/gergely.imreh.net\/blog\/","name":"ClickedyClick","description":"Life in real, complex and digital.","publisher":{"@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gergely.imreh.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0","name":"Gergely Imreh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g","caption":"Gergely Imreh"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g"},"description":"Physicist, hacker. Enjoys avant-guarde literature probably a bit too much. Open source advocate and contributor, both for software and hardware. Follow these posts on the Fediverse by @gergely@gergely.imreh.net","sameAs":["https:\/\/gergely.imreh.net\/","https:\/\/www.facebook.com\/gergely.imreh","https:\/\/www.instagram.com\/imrehg\/","https:\/\/www.linkedin.com\/in\/gergelyimreh\/","https:\/\/www.youtube.com\/@GergelyImreh"],"url":"https:\/\/gergely.imreh.net\/blog\/author\/gergely\/"}]}},"_links":{"self":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts\/2482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/comments?post=2482"}],"version-history":[{"count":11,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts\/2482\/revisions"}],"predecessor-version":[{"id":2498,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts\/2482\/revisions\/2498"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/media\/2483"}],"wp:attachment":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/media?parent=2482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/categories?post=2482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/tags?post=2482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}