<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tejas Morkar on Medium]]></title>
        <description><![CDATA[Stories by Tejas Morkar on Medium]]></description>
        <link>https://medium.com/@tejasmorkar?source=rss-5ff8f877fa62------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JF5syxNuCzOG74kI_A0oyg.jpeg</url>
            <title>Stories by Tejas Morkar on Medium</title>
            <link>https://medium.com/@tejasmorkar?source=rss-5ff8f877fa62------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:20:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tejasmorkar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Software is for Humans]]></title>
            <link>https://medium.com/devscollab/software-is-for-humans-3f3d646b07d0?source=rss-5ff8f877fa62------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f3d646b07d0</guid>
            <category><![CDATA[devscollab]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[humans]]></category>
            <dc:creator><![CDATA[Tejas Morkar]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 16:21:55 GMT</pubDate>
            <atom:updated>2020-11-26T16:23:32.282Z</atom:updated>
            <content:encoded><![CDATA[<h4>Miscellaneous</h4><h4>Software is a set of instructions that a machine follows. But is that it? Is it just the task that we humans assign the machines to do or is it something more than that?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MCIwDmk49PviRkAE" /><figcaption>Photo by <a href="https://unsplash.com/@lukepeters?utm_source=medium&amp;utm_medium=referral">Luke Peters</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Throughout the evolution of life, humans have created numerous things that can assist them, from the stone spearheads to the wheels, and so on. One such invention was machines and the software that they work on. It has proven to be the most helpful creation for humans of all time.</p><p>You cannot find an ecosystem of humans that does not rely on some kind of software. Doctors are saving more lives, engineers are building a better world, governments are developing nations and every person is connecting with every other person for the betterment of this community. All this would have never been possible if it wasn’t for the software that was built for all these tasks. Today, the software has evolved to a stage where it can learn on its own and help humans in unthinkable ways.</p><p><strong><em>‘Software’</em></strong> sounds like a fairy tale wish that we were gifted with, right? But I haven’t come across any fairy tales without some cruel twists in them. And it stands true for this case too. There are people in the technological domain including researchers who believe that the power of machines can soon outgrow our general intelligence. They think that it can stand as a critical threat for human existence not different than any sci-fi movie like <strong><em>The Matrix</em> </strong>or <strong><em>2001: A Space Odyssey</em></strong>.</p><p>It would be wrong to deny the possibility of these threats being true. We must be ready with all the necessary preparations. After all, prevention is better than cure. But we must not forget the fact that software is the most useful invention for humans right now.</p><p>We need to continue researching and making it better. We cannot deny the fact that thousands of lives are being saved because we can detect cancers early on with better accuracy. We cannot deny the fact that software is helping us demystify climate change. And we cannot deny the fact that we must not stop pursuing intelligent software. It has the potential of bringing the world to a great balance.</p><p>Max Tegmark, a physicist and machine learning researcher, has wonderfully depicted in his books that the evolution of life can be divided into three different parts: Life 1.0, Life 2.0, and Life 3.0. Life 1.0 is a simple biological period where organisms existed in the world without any particular meaning. Life 2.0 is the cultural time period where humans learned how to communicate and live together. Life 3.0 is the world where software develops and we all live in symbiosis with machines. We should harness the power of software for our own good and we should be there to support the evolution of software because the <strong><em>software is always going to be there for humans.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f3d646b07d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devscollab/software-is-for-humans-3f3d646b07d0">Software is for Humans</a> was originally published in <a href="https://medium.com/devscollab">DevsCollab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner-friendly resources for Machine Learning]]></title>
            <link>https://medium.com/data-science/beginner-friendly-resources-for-machine-learning-fd198f844dc3?source=rss-5ff8f877fa62------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd198f844dc3</guid>
            <category><![CDATA[upgrad]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Tejas Morkar]]></dc:creator>
            <pubDate>Wed, 11 Nov 2020 16:00:56 GMT</pubDate>
            <atom:updated>2020-11-11T16:00:56.569Z</atom:updated>
            <content:encoded><![CDATA[<h4>Breaking into AI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HJ33RKREkhI1iZ2I" /><figcaption>Photo by <a href="https://unsplash.com/@chuklanov?utm_source=medium&amp;utm_medium=referral">Avel Chuklanov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A traditional program is a set of instructions that we provide to a machine in order to perform a specific task. On the other hand, Machine Learning is quite different and unique. Machine Learning is a subset of Artificial Intelligence where a machine has the ability to learn and improve itself from experience without being programmed explicitly by anyone. Machine Learning is in a stage of booming and there is a lot of interesting research work going on. Everyone wants to understand it and break into AI for utilizing its power. Unfortunately, it is often perceived as a miraculous black box that takes some input data and gives out magical predictions but it has got so much more to it than that. Students and developers from various traits and fields want to start using Machine Learning in their projects but the important question is,</p><blockquote>“Where do I begin with Machine Learning?”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t3i3R3GrFfX-B7QJ6CXkwg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jontyson?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jon Tyson</a> on <a href="https://unsplash.com/s/photos/confusion?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Breaking into this field is not a task of a few days but a lot of resources today have made it easier for beginners to get a head start. Today, you don’t need to be enrolled in a Ph.D. program or you don’t even need to be doing a Computer Science degree for being able to learn about this new technology. Regardless of the background, you have various options to get started with ML. In this article, we will go over some of the best beginner-friendly resources for Machine Learning.</p><p>Before getting straight into it, you should know that there are basically various paths that you can take to get into ML and AI. There is a top-down approach where you just learn high-level things in brief and focus on implementations using frameworks like TensorFlow and Pytorch[we will talk about these frameworks later in the article]. The other approach is that you focus on every algorithm and all the maths and statistics behind it. The latter approach is most beneficial for people who want to get into the research domain of AI and ML. Identify the one that suits you better.</p><p>According to me, a top-down approach is better for most of the beginners who want to break into AI and ML and start working on their projects. In this approach, you can learn the mathematics behind it as and when you need it. Here you can directly experience the practical working and this keeps you motivated to keep learning. Whereas one might lose their interest if they just keep learning the theory of ML and not use it anywhere. One important point to keep in mind is that in this approach, people tend to skip the perception part and just copy-paste some code from the internet or courses. The code will work but it is necessary to understand the intuition and reasoning behind it. You must know the reason for every line of code that you write.</p><p>If you want to start with a top-down approach, then there are many great resources available for free on the internet. The most common question that I get from people is, “I’ve done Python. Now, how do I start with ML?” My answer to that is a series of steps that I’ll go over in this article. If you have the knowledge of Python language then that is great because it has a great pool of Machine Learning libraries that makes it one of the best languages for ML. But if you don’t know anything about this language, don’t be demotivated. It is one of the simplest programming languages to learn.</p><h3>Learning Python</h3><p><strong>1 -</strong> <em>Python for Everybody Specialization</em> by the University of Michigan on Coursera — <a href="https://www.coursera.org/specializations/python">Link<br></a>This is one of the best courses out there on Coursera for getting started with Python Programming Language. It covers all the topics like data structures, databases, and networked application program interfaces.</p><p><a href="https://www.coursera.org/specializations/python">Python for Everybody</a></p><p><strong>2 -</strong> <em>Learn Python from scratch [Python Bootcamp]</em> by Zero to Mastery on YouTube — <a href="https://www.youtube.com/playlist?list=PL2HX_yT71umDkEQdfKFnqJFxSpjMG-Vw5">Link<br></a>Andrei Neagoie is a great instructor and has a wonderful review on Udemy. I personally love all his courses. This is his course for people wanting to get started with Python.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPL2HX_yT71umDkEQdfKFnqJFxSpjMG-Vw5&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPL2HX_yT71umDkEQdfKFnqJFxSpjMG-Vw5&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5IYDvoVNXHc%2Fhqdefault.jpg%3Fsqp%3D-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ%3D%3D%26rs%3DAOn4CLCtO85pMxAD38j-PWlb5MGHKWCTOg%26days_since_epoch%3D18577&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="853" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2988a53792984ed9fe59bf47dbad3cda/href">https://medium.com/media/2988a53792984ed9fe59bf47dbad3cda/href</a></iframe><p><strong>3 -</strong> <em>Learn Python — Full Course for Beginners [Tutorial]</em> by freeCodeCamp on YouTube — <a href="https://youtu.be/rfscVS0vtbw">Link<br></a>This is an approximately 4 hours 30 minutes long video where you’ll get everything you need to get started with Python language. This course is developed by Mike Dane.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrfscVS0vtbw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrfscVS0vtbw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrfscVS0vtbw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1a886e338b12c27a6c07064ebb5e19d/href">https://medium.com/media/e1a886e338b12c27a6c07064ebb5e19d/href</a></iframe><h3>Python for Machine Learning</h3><p>After learning Python, it’s best to first get a good knowledge about libraries you’ll need to use while working on ML and AI projects like Pandas, Matplotlib, Numpy.</p><p><strong>1 -</strong> <em>Python for Data Science and AI</em> by IBM on Coursera — <a href="https://www.coursera.org/learn/python-for-applied-data-science-ai?">Link<br></a>This covers some basics of python in the first week. And then it advances to data structures and playing with data using python. The last week consists of analyzing US economic data and building a dashboard.</p><p><a href="https://www.coursera.org/learn/python-for-applied-data-science-ai?">Python for Data Science and AI</a></p><p><strong>2 -</strong> <em>Applied Data Science with Python Specialization</em> by the University of Michigan on Coursera — <a href="https://www.coursera.org/specializations/data-science-python">Link<br></a>This is a wonderful specialization for all the ML enthusiasts out there. If you complete this course, you’ll be very comfortable with python language for data visualization, mining, manipulation, and other stuff that is required in data science.</p><p><a href="https://www.coursera.org/specializations/data-science-python">Applied Data Science with Python</a></p><p><strong>3 - </strong><em>Python for Data Science</em> on upGrad — <a href="https://www.upgrad.com/free-courses/?utm_source=organicchannels&amp;utm_medium=web&amp;utm_campaign=banner_homepage">Link<br></a>Topics covered in this course are Intro to Python, Programming using python, libraries for data science, and data visualization.</p><p><a href="https://www.upgrad.com/free-courses/?utm_source=organicchannels&amp;utm_medium=web&amp;utm_campaign=banner_homepage">Free Online Courses from upGrad</a></p><p>The best resources for getting familiar with the libraries is to go through their official documentation. They are the best place to explore and get an in-depth understanding of it.</p><p>Numpy — <a href="https://numpy.org/doc/">https://numpy.org/doc/</a><br>Pandas — <a href="https://pandas.pydata.org/docs/">https://pandas.pydata.org/docs/</a><br>Matplotlib — <a href="https://matplotlib.org/3.3.2/contents.html">https://matplotlib.org/3.3.2/contents.html</a></p><h3>Basics of ML and AI</h3><p>While learning python and the libraries, it is better to keep going through very basic courses of AI where you can gain an intuition of what actually it is.</p><p><strong>1 -</strong> <em>Elements of AI</em> by Reaktor and the University of Helsinki — <a href="https://www.elementsofai.com/">Link<br></a>Elements of AI is a free online course curated for all the beginners out there. You’ll get a basic concept of AI and their main goal is to demystify AI.</p><p><a href="https://www.elementsofai.com/">A free online introduction to artificial intelligence for non-experts</a></p><p><strong>2 -</strong> <em>AI For Everyone</em> by deeplearning.ai on Coursera — <a href="https://www.coursera.org/learn/ai-for-everyone">Link<br></a>This is another wonderful course curated by Andrew Ng. It covers all points that anyone might want to know before dipping their toes into AI. This is meant for people from all traits and backgrounds.</p><p><a href="https://www.coursera.org/learn/ai-for-everyone">AI For Everyone</a></p><p><strong>3 -</strong> <em>Machine Learning Recipes</em> by Google Developers on YouTube — <a href="https://www.youtube.com/playlist?list=PLOU2XLYxmsIIuiBfYad6rFYQU_jL2ryal">Link<br></a>Josh Gordon, in this series, nicely explains how anyone can get started with basic code in ML using the libraries like Scikit Learn and TensorFlow by Google.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLOU2XLYxmsIIuiBfYad6rFYQU_jL2ryal&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLOU2XLYxmsIIuiBfYad6rFYQU_jL2ryal&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcKxRvEZd3Mw%2Fhqdefault.jpg%3Fsqp%3D-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ%3D%3D%26rs%3DAOn4CLCvDG5uQRWUlGkfT1tbClJ3lhXxFg%26days_since_epoch%3D18687&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="853" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7af46f17dd15cbcc39c1ea2154f94d81/href">https://medium.com/media/7af46f17dd15cbcc39c1ea2154f94d81/href</a></iframe><p><strong>4 -</strong> <em>Introduction to Machine Learning Concepts</em> on upGrad — <a href="https://www.upgrad.com/free-courses/?utm_source=organicchannels&amp;utm_medium=web&amp;utm_campaign=banner_homepage">Link<br></a>This is a 6 weeks course that covers ML topics like linear regression, logistic regression, clustering, and recommender systems.</p><p><a href="https://www.upgrad.com/free-courses/?utm_source=organicchannels&amp;utm_medium=web&amp;utm_campaign=banner_homepage">Free Online Courses from upGrad</a></p><h3>Machine Learning in-depth</h3><p>After going through the basics of AI and exactly understanding the concepts behind it, ML is no more a magical black box. Now, you should get deeper into it and learn how to use frameworks like TensorFlow and PyTorch to build your own ML models.</p><p><strong>1 -</strong> <em>Machine Learning</em> by Stanford on Coursera — <a href="https://www.coursera.org/learn/machine-learning?">Link<br></a>If you ever want to get deep knowledge about all the types of Machine Learning algorithms out there, this is the go-to course for you. The course content is very amazing and nicely formed. You’ll see the regression, classification, neural networks, anomaly detection, recommender systems, and much more throughout this course. It is filled with great content.</p><p><a href="https://www.coursera.org/learn/machine-learning?">Machine Learning</a></p><p><strong>2 -</strong> <em>Machine Learning Crash Course</em> by Google — <a href="https://developers.google.com/machine-learning/crash-course">Link<br></a>This crash course is a self-study guide for aspiring machine learning practitioners. It features a series of lessons with video lectures, real-world case studies, and hands-on practice exercises.</p><p><a href="https://developers.google.com/machine-learning/crash-course">Machine Learning | Google for Developers</a></p><p><strong>3 -</strong> <em>MIT 6.S19: Introduction to Deep Learning</em> — <a href="http://introtodeeplearning.com/">Link<br></a>MIT’s official introductory course on deep learning methods with applications in robotics, gameplay, art, computer vision, language, medicine, and more! Students will gain foundational knowledge of deep learning algorithms and get practical experience in building neural networks in TensorFlow.</p><p><a href="http://introtodeeplearning.com/">MIT Deep Learning 6.S191</a></p><p><strong>4 -</strong> <em>DeepLearning.AI TensorFlow Developer Professional Certificate</em> — <a href="https://www.coursera.org/professional-certificates/tensorflow-in-practice">Link<br></a>TensorFlow is an open-source Machine Learning library by Google and it makes building deep learning models very easy. It is a very powerful, scalable, and flexible framework. This course will guide you through everything you should know about TensorFlow at a beginner to intermediate level.</p><p><a href="https://www.coursera.org/professional-certificates/tensorflow-in-practice">DeepLearning.AI TensorFlow Developer</a></p><p><strong>5 -</strong> <em>Intro to Deep Learning with PyTorch</em> by Facebook Artificial Intelligence on Udacity — <a href="https://www.udacity.com/course/deep-learning-pytorch--ud188">Link<br></a>PyTorch is another open-source Machine Learning library by Facebook’s AI Research lab. It is based on the Torch library. It allows users to modify and make changes on a lower lever easily so it is mainly popular in the research field. This course covers all the basics that anyone might require for getting started with PyTorch.</p><p><a href="https://www.udacity.com/course/deep-learning-pytorch--ud188">Introduction to PyTorch | Deep Learning | Free Courses | Udacity</a></p><h3>Tailored to domains</h3><p>Once you get familiar with machine learning and all the fundamental algorithms from the previous course, you will want to explore the specific domains in Machine Learning like Deep Learning, Natural Language Processing, Computer Vision, and others. Here are some good courses which will cover these topics from ground zero.</p><p><strong>1 -</strong> <em>Deep Learning Specialization</em> by deeplearning.ai on Coursera — <a href="https://www.coursera.org/specializations/deep-learning">Link<br></a>To get started with neural networks and deep learning, according to me, this is one of the most important courses. The project notebooks that they have are a great way of testing out how much we can apply the knowledge instantly.</p><p><a href="https://www.coursera.org/specializations/deep-learning">Deep Learning</a></p><p><strong>2 -</strong> <em>Natural Language Processing Specialization</em> by deeplearning.ai on Coursera — <a href="https://www.coursera.org/specializations/natural-language-processing">Link<br></a>Another field that has boomed in deep learning is NLP. NLP requires a lot of preprocessing and has a different approach overall. You’ll be confident in this domain after going through this specialization.</p><p><a href="https://www.coursera.org/specializations/natural-language-processing">Natural Language Processing</a></p><p><strong>3 -</strong> <em>Practical Deep Learning for coders</em> by fast.ai — <a href="https://course.fast.ai/">Link<br></a>Fast.ai is another library with the intent to make it easier for everyone from any background to build ML models. This is based on PyTorch and has great features. Their course covers everything about this library and Jeremy, the founder of Fast.ai has also explained most of the important concepts of Machine Learning in a very understandable way.</p><p><a href="https://course.fast.ai/">Practical Deep Learning for Coders - Practical Deep Learning</a></p><p><strong>4 -</strong> <em>AI for Medicine Specialization</em> by deeplearning.ai on Coursera — <a href="https://www.coursera.org/specializations/ai-for-medicine">Link</a> <br>AI for Medicine is not very similar to AI for other purposes. It requires higher precision, higher accuracy and the data available to us is very less. This course shows the power of data augmentation and other methods to build better models with lesser data.</p><p><a href="https://www.coursera.org/specializations/ai-for-medicine">AI for Medicine</a></p><p><strong>5 -</strong> <em>Reinforcement Learning</em> by Georgia Tech on Udacity — <a href="https://www.udacity.com/course/reinforcement-learning--ud600">Link</a></p><p><a href="https://www.udacity.com/course/reinforcement-learning--ud600">What is Reinforcement Learning? | Udacity Free Courses</a></p><p><strong>6 -</strong> <em>The Deep RL course</em> — <a href="https://simoninithomas.github.io/deep-rl-course/">Link<br></a>This course is a series of articles and videos where you’ll master the skills and architectures you need, to become a deep reinforcement learning expert. You’ll build a strong professional portfolio by implementing awesome agents with Tensorflow and PyTorch that learns to play Space invaders, Minecraft, Starcraft, Sonic the hedgehog, and more!</p><p><a href="https://simoninithomas.github.io/deep-rl-course/">Deep Reinforcement Learning Course</a></p><p><strong>7 -</strong> <em>Generative Adversarial Networks</em> by deeplearning.ai on Coursera — <a href="https://www.coursera.org/specializations/generative-adversarial-networks-gans">Link<br></a>GANs are a relatively newer concept introduced by Ian Goodfellow in 2014. The GANs concept has made a tremendous change in the perception of deep learning. This is a good course that you might want to go through later on.</p><p><a href="https://www.coursera.org/specializations/generative-adversarial-networks-gans">Generative Adversarial Networks (GANs)</a></p><p><strong>8 -</strong> <em>Introduction to Deep Learning and Natural Language Processing</em> on upGrad — <a href="https://www.upgrad.com/free-courses/?utm_source=organicchannels&amp;utm_medium=web&amp;utm_campaign=banner_homepage">Link<br></a>To know more about maths behind AI and ML this course includes 4 weeks of content for maths behind data analysis, intro to deep learning and intro to natural language processing.</p><p><a href="https://www.upgrad.com/free-courses/?utm_source=organicchannels&amp;utm_medium=web&amp;utm_campaign=banner_homepage">Free Online Courses from upGrad</a></p><p><strong>9 -</strong> <em>Advanced Certification in Machine Learning and Cloud</em> by IIT Madras on upGrad — <a href="https://www.upgrad.com/advanced-certification-ml-cloud-iitm/">Link<br></a>In this course you will learn to deploy Machine Learning models using Cloud computing with India’s most advanced certification program, exclusively from IIT Madras &amp; upGrad.</p><p><a href="https://www.upgrad.com/advanced-certification-ml-cloud-iitm/">Advanced Certification in Machine Learning and Cloud with IIT Madras | upGrad</a></p><h3>Interesting Podcasts</h3><p>Podcasts are the best resources for being up to date with the Machine Learning domain as it is very active and keeps changing a lot. I’ve mentioned some of the best podcasts that I listen to.</p><p><strong>1 -</strong> <em>Linear Digressions</em> — <a href="http://lineardigressions.com/">Link</a></p><p><strong>2 -</strong> <em>Lex Fridman Podcast</em> — <a href="https://lexfridman.com/podcast/">Link</a></p><p><strong>3 -</strong> <em>Data Skeptic</em> — <a href="https://dataskeptic.libsyn.com/">Link</a></p><h3>Best Books</h3><p>Personally, I’ve found books to be the best source of knowledge after going through the courses. This is where you can strengthen your theoretical understanding of the concepts that you use in your ML projects.</p><p><strong>1 -</strong> <em>The Hundred-Page Machine Learning Book</em> by Andriy Burkov<br>A very short book but with perfect knowledge. Andriy has compressed all the vital points in AI/ ML and put it in this 100 pages book[138 to be precise].</p><p><strong>2 -</strong> <em>Hands-on Machine Learning with Scikit-Learn, Keras and Tensorflow 2.0 Book</em> by Aurelien Geron — O’Reilly<br>According to me, this book is an alternative to the Machine Learning and Deep Learning specializations by deeplearning.ai. I prefer this book as it has perfect explanations and every concept has a good code to try out side by side. You can also access the open-sourced code from this book at the following link —<em> </em><a href="https://github.com/ageron/handson-ml2"><em>https://github.com/ageron/handson-ml2</em></a></p><p><strong>3 -</strong> <em>Deep Learning book</em> by Ian Goodfellow<br>If you want to get deeper into the mathematical side of deep learning then this book has everything that you need. It was published in 2015, so it is relatively old but the content is great.</p><blockquote>Bonus Book</blockquote><p><strong><em>Life 3.0</em></strong> by Max Tegmark<br>Life 3.0 isn’t for learning AI and ML but it is a beautiful book that discusses the impact of Artificial Intelligence on the future of the human race and cosmic influence. The views of the author are interesting and it is indeed a great read.</p><h3>Conclusion</h3><p>Finally, we’ve reached the end of this entire list of resources. These are a lot and there are more! But don’t be overwhelmed. Once, you have gone through most of these resources, you’ll find it interesting to explore more and find new helpful resources on your own. The most important thing to know is that you shouldn’t get stuck in completing courses and books. Keep making projects every now and then. Make it a habit to build projects after every new skill you learn. According to me, that’s how you’ll know what you’ve learned and that’s how you keep yourself motivated — by building interesting projects.</p><p>Also, keep reading technical blogs and articles. Medium, Wired, TechCrunch are some of the great places for such technical blogs. Be up to date with recent research works. You’ll notice that in the start you won’t understand much of it but as you progress, everything starts making sense. It’s good to see recent progress in ML/ AI because everything keeps changing very quickly.</p><blockquote><strong><em>It’s a great journey ahead of you… Keep Learning!</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd198f844dc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/beginner-friendly-resources-for-machine-learning-fd198f844dc3">Beginner-friendly resources for Machine Learning</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Streamlit to deploy your ML models wrapped in beautiful web apps]]></title>
            <link>https://medium.com/data-science/how-to-use-streamlit-to-deploy-your-ml-models-wrapped-in-beautiful-web-apps-66e07c3dd525?source=rss-5ff8f877fa62------2</link>
            <guid isPermaLink="false">https://medium.com/p/66e07c3dd525</guid>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Tejas Morkar]]></dc:creator>
            <pubDate>Tue, 28 Jul 2020 14:53:46 GMT</pubDate>
            <atom:updated>2020-10-11T05:48:23.696Z</atom:updated>
            <content:encoded><![CDATA[<h4>Streamlit for quick and easy Machine Learning Web Apps</h4><h3>How to use Streamlit to deploy your ML models wrapped in beautiful Web Apps</h3><h4>Don’t waste your time learning Django or Flask!</h4><h4>Don’t waste your time learning Django or Flask and focus more on the Machine Learning part!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uA78yeDkD2rVh6HAydxPOQ.png" /><figcaption>California Housing Price Prediction — Streamlit Web App (Image by Author)</figcaption></figure><p>If you are like me or any other Machine Learning enthusiast, the worst nightmare for you, obviously other than the Cuda errors, must be deploying the model elsewhere to present your work to your friends and networks on the internet. There are many ways to go around and achieve this, but in this article, I will share with you why I think Streamlit is the go-to solution for it.</p><p>To keep this article organized and easy to refer, let’s divide it into a few parts so that you can jump directly to whichever part that seems important for you.</p><ul><li><em>What are the alternatives?</em></li><li><em>Why Streamlit?</em></li><li><em>How to make a Streamlit Web App from your existing ML code?</em></li><li><em>How to deploy the Streamlit Web App?</em></li><li><em>Conclusion</em></li></ul><h4>ALTERNATIVES</h4><p>There are a few other ways to deploy ML web apps but all of them have some drawbacks, the most noticeable one being that nothing is as easy and quick as Streamlit.</p><p><strong>TensorFlow.js </strong>is TensorFlow’s official way of deploying ML models using Javascript. This is a very awesome way of quickly* deploying simple ML models to the Web but when it comes to complex models, many of them are not yet supported by this library and not all models that work in Python will guarantee to work in the same way in Javascript.</p><p><em>*Even when I say quickly, it still requires more work and time than what you’ll require for Streamlit!</em></p><p><a href="https://www.tensorflow.org/js">TensorFlow.js | Machine Learning for JavaScript Developers</a></p><p><strong>Flask </strong>is a small framework in python which allows you to use your Python skills to develop and deploy web apps. If you compare this to Streamlit, you’ll require a lot more time to code and also design a decent web app.</p><p><a href="https://flask.palletsprojects.com/en/1.1.x/">Welcome to Flask - Flask Documentation (2.0.x)</a></p><p><strong>Django </strong>is a Python-based web development framework. Using this framework to deploy your ML models is a good way of presenting it wrapped in a web app but this will require a lot of time and understanding of the framework in particular.</p><p><a href="https://www.djangoproject.com/">Django</a></p><h4>WHY STREAMLIT?</h4><p>Machine Learning enthusiasts shouldn’t have to waste their time learning web development, so that they can focus on their target, which is, building better models!</p><p>And that’s exactly how <strong><em>Streamlit</em></strong> helps us. It is the easiest and quickest way to build web apps that can present your ML models and data attractively using it’s awesome UI elements and Markdown.</p><p><a href="https://www.streamlit.io/">Streamlit * The fastest way to build and share data apps</a></p><p>Now after praising Streamlit so many times for being easy and quick to use, what do I mean by it? To understand this, let me share with you how I came across this amazing framework.</p><p>I am interested in Generative Adversarial Networks and currently, I’m exploring and building some projects using different kinds of GANs. To share my journey through this exploration and to document my projects, I started composing a <a href="https://towardsdatascience.com/tagged/gans-series">GANs Series</a>, which is a series of articles about GANs and their implementation.</p><p>The worst roadblock that hit me in the path was not being able to deploy a Conditional-GAN model which converts black and white sketch images to color images. The model architecture which I used for the Generator model was a U-Net model that has quite a few skip connections. You can browse through the detailed explanation with step-by-step code blocks to train the model from <a href="https://towardsdatascience.com/generative-adversarial-networks-gans-89ef35a60b69?source=friends_link&amp;sk=635c457c652ecc8eb92cc6f202565b49">this article</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*or9FJUA_kuDLkN20TV2M_g.png" /><figcaption>U-NET Model Architecture — (Image Source: <a href="https://en.wikipedia.org/wiki/U-Net">https://en.wikipedia.org/wiki/U-Net</a>)</figcaption></figure><p>I tried all the alternatives for web deployment discussed earlier. The model did not seem to work as expected in TensorFlow.js and I spent almost a week learning &amp; trying out the Django Framework.</p><p>This is when I came across <a href="https://towardsdatascience.com/build-an-app-to-synthesize-photorealistic-faces-using-tensorflow-and-streamlit-dd2545828021">this excellent article</a> by <a href="https://medium.com/u/39dfc90d7a34">Adrien Treuille</a> where he shows how he used Streamlit to make an impressive web app with great UI for a TL-GAN in <strong>under 13 lines of Streamlit code!</strong></p><p>It took me around 15 minutes to go through their basic documentation on the website and when I tried implementing it for my model, Adrien wasn’t exaggerating, it only took me 12 lines of Streamlit code to load the trained model, wrap it in the UI shown below and make it ready for deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m61xep88jiggLQLgT5BTIw.png" /><figcaption>Sketch to Color Image Generation using Conditional GAN — Streamlit Web App (Image by author)</figcaption></figure><h4>MAKING A WEB APP FROM THE EXISTING ML CODE</h4><blockquote>Yes, you read it correctly,<br>You Can Just Add a Few Streamlit Function Calls to Your Existing Python File and No Need of Any HTML, CSS or JAVASCRIPT code to Design Your Web App!</blockquote><p>All you have to do is install the Streamlit package from pip and add few Streamlit functions to the existing python file. To <strong>install Streamlit</strong> just use the command:</p><p>pip install streamlit</p><p>To check whether the installation was successful and explore around in their <strong>hello world app</strong>, simply use the command:</p><p>streamlit hello</p><p>Once, you have your Streamlit installed and have made the required changes as per your needs, you just have to use a single command to <strong>run the web app locally</strong>.</p><p>streamlit run file_name.py</p><p><strong><em>It has various cool and helpful features like:</em></strong></p><ul><li><strong><em>Live changes when you save the file</em></strong></li><li><strong><em>Rerun the app by simply pressing R on the keyboard</em></strong></li><li><strong><em>Clear cache by simply pressing C on the keyboard</em></strong></li><li><strong><em>Record the web app and save a video file locally to share with everyone</em></strong></li><li><strong><em>…And much more</em></strong></li></ul><p>I have added a GitHub gist below to show you how I added Streamlit function calls to the existing python code of the Sketch-to-Color Image Generation model to make it a fully functional web app as shown in the image above.</p><p><em>The code which I had before adding the Streamlit code is commented out to make it easier to see what changes were required. If you wish to see the code for the Sketch-to-Color Image Generation model, you can go through the article </em><a href="https://towardsdatascience.com/generative-adversarial-networks-gans-89ef35a60b69?source=friends_link&amp;sk=635c457c652ecc8eb92cc6f202565b49"><em>linked here</em></a><em>.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d84b6070282f514d47f3fd26610866ff/href">https://medium.com/media/d84b6070282f514d47f3fd26610866ff/href</a></iframe><p><strong><em>That’s it! Literally 13 lines of extra code if you include the import statements and if…else conditions that I have implemented.</em></strong></p><h4>DEPLOYING THE STREAMLIT WEB APP</h4><p>There are various options available for you to deploy your web apps built using Streamlit.</p><p><strong>Heroku </strong>is a reliable way to deploy these web apps without needing to use any other cloud services and set up virtual instances on them. Heroku takes care of everything for us. But one drawback of Heroku is that it only allows a size of 512MB in the free version of dynos and TensorFlow 2.2.0 needs a little more space for the installation. You could use any lower versions than 2.0.0 if your code doesn’t break.</p><p><strong>Amazon Web Services</strong> is another great place to deploy the Streamlit apps and it is easier than you’d think. Just launch a new EC2 instance with Ubuntu 18.04 or higher install the dependencies and run the streamlit run file_name.py command. You’ll get a public URL that you can share with your friends and networks online so that they can go through your awesome web app.</p><p><strong>GitHub repository</strong> is another cool way of hosting the code for the Streamlit web app. This cannot be counted as an entire deployment method but one of the excellent features of Streamlite is that <strong>it allows a link to the code in the streamlit run command</strong>. So, if the users have all the dependencies installed on their systems along with the Streamlit package, they can easily run your app by providing a link to the .py file. For example, you can run my Streamlit web app locally on your systems by using the following command:</p><p>streamlit run <a href="https://raw.githubusercontent.com/tejasmorkar/housing_price_prediction_aws/master/CaliforniaHousingPrices.py">https://raw.githubusercontent.com/tejasmorkar/housing_price_prediction_aws/master/CaliforniaHousingPrices.py</a></p><p><strong>Streamlit</strong> is still a new framework and is working to bring new and cool features for its users. Some of which are discussed in their <a href="https://github.com/streamlit/streamlit/wiki/Roadmap">roadmap</a>. And one of the most exciting features that I am waiting for is a one-click easy deployment for Streamlit Web Apps. Read more about it in the <a href="https://discuss.streamlit.io/t/the-streamlit-roadmap-big-plans-for-2020/2054">discussion forum</a>.</p><p><strong><em>Here is a video of a simple Web App that I’ve deployed on the AWS EC2 instance with Ubuntu 18.04.</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQBdgXgLdUtk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQBdgXgLdUtk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQBdgXgLdUtk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d543e23c49315c1f5f7720766d4a72c8/href">https://medium.com/media/d543e23c49315c1f5f7720766d4a72c8/href</a></iframe><h4>CONCLUSION</h4><p>So, this is why I feel that Streamlit is such an impressive framework that can help everyone focus on the important parts of Machine Learning development and release the stress required on the deployment part.</p><blockquote>Focus less on deployment and more on solving Cuda errors!</blockquote><p>To get started with Streamlit just hop onto the official docs provided by them on the link — <a href="https://docs.streamlit.io/en/stable/">https://docs.streamlit.io/en/stable/</a></p><p>And if you have any doubts regarding any of the stuff from getting started to deploying the Streamlit web app, you can search on the discussion forum or shoot a new question. You’ll find solutions to almost all the queries answered by the community members and the Streamlit team — <a href="https://discuss.streamlit.io/">https://discuss.streamlit.io/</a></p><p>If you have any doubts, suggestions, errors, or feedback, feel free to contact me via any medium that best suits you!</p><h4>My Contact Information:</h4><p><strong>Email:<em> </em></strong><a href="/service/mailto:tejasmorkar@gmail.com"><em>tejasmorkar@gmail.com</em></a><em><br></em><strong>LinkedIn</strong>: <a href="https://www.linkedin.com/in/tejasmorkar/"><em>https://www.linkedin.com/in/tejasmorkar</em></a><em>/</em><strong><br>GitHub</strong>: <a href="https://github.com/tejasmorkar"><em>https://github.com/tejasmorka</em></a><em>r</em><br><strong>Twitter</strong>: <a href="https://twitter.com/TejasMorkar"><em>https://twitter.com/TejasMorka</em></a><em>r</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66e07c3dd525" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/how-to-use-streamlit-to-deploy-your-ml-models-wrapped-in-beautiful-web-apps-66e07c3dd525">How to use Streamlit to deploy your ML models wrapped in beautiful web apps</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sketch-to-Color Image Generation | GANs]]></title>
            <link>https://medium.com/data-science/generative-adversarial-networks-gans-89ef35a60b69?source=rss-5ff8f877fa62------2</link>
            <guid isPermaLink="false">https://medium.com/p/89ef35a60b69</guid>
            <category><![CDATA[gans]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gans-series]]></category>
            <dc:creator><![CDATA[Tejas Morkar]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 18:53:35 GMT</pubDate>
            <atom:updated>2022-04-08T19:01:21.746Z</atom:updated>
            <content:encoded><![CDATA[<h4>GANS SERIES</h4><h4>2 — Learning to Build a Model for Sketch-to-Color Image Generation using Conditional GANs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-FnxXrH-ZiWlmIenM6-NvQ.gif" /><figcaption>Outputs from the Generator model after 150 epochs (Gif made by Author)</figcaption></figure><p>This article is a part of the <a href="https://towardsdatascience.com/tagged/gans-series"><strong><em>Gans-Series</em></strong></a> published by me on TowardsDataScience Publication on Medium. If you do not know what GANs are or if you have an idea about it but wish to quickly go over it again, I highly recommend you read the <a href="https://towardsdatascience.com/generative-adversarial-networks-gans-8fc303ad5fa1"><strong><em>previous article</em></strong></a><strong><em> </em></strong>which is just a 7 minutes long read and provides a simple understanding of GANs for people who are new to this amazing domain of Deep Learning.</p><p>As you can tell from the gif shown above, this article is going to be all about learning how to create a Conditional GAN to predict colorful images from the given black and white sketch inputs without knowing the actual ground truth.</p><h3>A little bit of need-to-know stuff before bringing on the coding mode…</h3><p>Sketch to Color Image generation is an image-to-image translation model using Conditional Generative Adversarial Networks as described in the original paper by Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, Alexei A. Efros 2016,<strong><em> </em></strong><a href="https://arxiv.org/abs/1611.07004"><strong><em>Image-to-Image Translation with Conditional Adversarial Networks</em></strong></a>.</p><p>When I first came across this paper, it was amazing to see such great results shown by the authors and the fundamental idea was amazing on its own too.</p><h4>APPLICATIONS</h4><p>There are a lot of application scenarios of Conditional GANs that are depicted in the original paper by the authors. Some of which are listed below.</p><ul><li><strong>Map to Aerial Photos and vice versa</strong></li><li><strong>Cityscapes to Photos</strong></li><li><strong>Building Facades Labels to Photos</strong></li><li><strong>Daylight Photos to Night</strong></li><li><strong>Photo Inpainting</strong></li><li><strong>Sketch to Color Images</strong> <em>(the one which we are going to build in this article)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nRTdhtJM-wpO2sUWsDfQvg.png" /><figcaption>Images were taken from Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, Alexei A. Efros 2016, <a href="https://arxiv.org/abs/1611.07004">Image-to-Image Translation with Conditional Adversarial Networks</a></figcaption></figure><p>We are going to build a Conditional Generative Adversarial Network which accepts a 256x256 px black and white sketch image and predicts the colored version of the image without knowing the ground truth. The model will be trained on the <a href="https://www.kaggle.com/ktaebum/anime-sketch-colorization-pair"><strong><em>Anime Sketch-Colorization Pair Dataset</em></strong></a> available on Kaggle which contains 14.2k pairs of Sketch-Color Anime Images.</p><blockquote>When I trained the model on my system, I ran the model for 150 epochs which took approximately 23 hours on a single GeForce GTX 1060 6GB Graphic Card and 16 GB RAM. After all that hard work and patience, the results were totally worth it!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOHB4IYP-a1T2qBcZCoPow.jpeg" /><figcaption>Outputs of the Trained Generator Model (Image by Author)</figcaption></figure><h3>Let’s get to the interesting part now…</h3><p>To build this model I have used TensorFlow 2.x and most of the code is based on their awesome tutorial on Pix2Pix for <a href="http://cmp.felk.cvut.cz/~tylecr1/facade/"><strong><em>CMP Facade Dataset</em></strong></a><strong><em> </em></strong>which predicts building photos from facade labels. TensorFlow tutorials are a good way to understand the framework and work on some well-known projects. I highly recommend you to go through all the tutorials on the website — <a href="https://www.tensorflow.org/tutorials"><strong><em>https://www.tensorflow.org/tutorials</em></strong></a>.</p><h3>REQUIREMENTS</h3><p>To build this model, there are some basic requirements that you need to install on your system in order for it to work properly.</p><ul><li><a href="https://www.python.org/downloads/release/python-360/"><strong><em>Python 3.6</em></strong></a> and above</li><li><a href="https://pypi.org/project/pip/"><strong><em>pip 19.0</em></strong></a> or later</li><li>Windows 7 or later (64-bit)</li><li><a href="https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads">Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019</a></li><li><a href="https://www.tensorflow.org/install/pip"><strong><em>Tensorflow 2.2</em></strong></a> and above</li><li><a href="https://www.tensorflow.org/install/gpu"><strong><em>GPU support</em></strong></a> requires a CUDA®-enabled card</li></ul><p>If you are planning on using any cloud environments like Google Colab, you need to keep in mind that the training is going to take a lot of time as GANs are computationally quite heavy to run. Google Colab has an absolute timeout of 12 hours which means that the notebook kernel is reset so you’ll need to consider some points like mounting the Google Drive and saving checkpoints after regular intervals so that you can continue training from where it left off before the timeout.</p><h3>DOWNLOADING THE DATASET</h3><p>Download the <a href="https://www.kaggle.com/ktaebum/anime-sketch-colorization-pair"><strong><em>Anime Sketch-Colorization Pair Dataset</em></strong></a> available on Kaggle and save it to a folder directory. The root folder will contain folders colorgram , train , and val . For everyone’s convenience let us call the path to the root folder as path/to/dataset/ .</p><p>Once the basic requirements are checked and the dataset is downloaded to your machine, it’s time for you to get into coding your very own Conditional GAN.</p><p>Before we jump right into it, note that the code which I’m going to provide shouldn&#39;t just be copied and pasted from here if you wish to understand the basic working behind it. And do not hesitate to ask your queries because that’s how things are learned — by asking.</p><h3>FINALLY, THE CODE!</h3><p>First, let’s initialize the parameters to configure the training of the model. As stated earlier, we will be using the TensorFlow framework so we’ll need to import it by using import tensorflow as tf .</p><p>The os module is used to interact with the Operating System. We are going to use this for accessing and modifying the path variables to save checkpoints during training. The time module lets us display relative time and hence, we can check how much time each epoch took during the training.</p><p>matplotlib is another cool python library which we will be using to plot and show images.</p><p>BUFFER_SIZE is used when we shuffle the data samples while training. Higher the value of this more will be the degree of shuffling, and hence, higher will be the accuracy of the model. But with large data, it takes a lot of processing power to shuffle the images. For my system with Intel(R) Core(TM) i7–8750H CPU and 16 GB of RAM, it was possible to set it equal to the size of the train dataset samples i.e. 14,224.</p><blockquote>NOTE: The highest efficiency of shuffle() is when you set buffer_size equal to the size of data samples. This way it takes all the samples [in this case 14,224] in the primary memory and chooses a random one from those. If you set it to 10, it’ll take the 10 samples in the memory and choose a random one from those 10 samples and then repeat it for other remaining examples. So, check you machine capabilities and find out the sweet spot.</blockquote><p>BATCH_SIZE is used to divide the dataset into mini-batches for training. The higher this value is, the faster will be the process of training. But as you might have guessed already, higher batch size means a higher load on the machine.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d396cf0f9371cfaa5ea7d1e1d359a2d/href">https://medium.com/media/5d396cf0f9371cfaa5ea7d1e1d359a2d/href</a></iframe><p>Now, if you take a look at the dataset, you have a single image of size 1024x512 px for one entry which has a colored image of size 512x512 px in the left and a black and white sketch image of size 512x512 px in the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yf3cvV4fouSxyVJ4-k6ug.png" /><figcaption>Visualizing Data (Image from the <a href="https://www.kaggle.com/ktaebum/anime-sketch-colorization-pair"><em>Anime Sketch-Colorization Pair Dataset</em></a>)</figcaption></figure><p>We will define a function load() that takes the image path as a parameter and returns an input_image which is the black and white sketch that we’ll give as an input to the model, and real_image which is the colored image that we want.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f3acafbb99319fd4a8b204601e966a5/href">https://medium.com/media/2f3acafbb99319fd4a8b204601e966a5/href</a></iframe><h4>Preprocessing</h4><p>Now that we have the data loaded, we need to do some preprocessing in order to prepare the data for the model.</p><p>Given below are a few easy functions used for this purpose.</p><p>resize() function is used to return the images as 286x286 px. This is done in order to have a uniform image size if by chance there is a differently sized image in the dataset. And decreasing size from 512x512 px to half of it also helps in speeding up the model training as it is computationally less heavy.</p><p>random_crop() function returns the cropped input and real images which have the desired size of 256x256 px.</p><p>normalize() function, as the name suggests, normalizes images to [-1, 1].</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0be1322bd79417821ae7217d234fcd53/href">https://medium.com/media/0be1322bd79417821ae7217d234fcd53/href</a></iframe><p>In the random_jitter() function shown above, all the previous preprocessing functions are put together and random images are flipped horizontally. You can see what the preprocessing of data returns from images given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*M9Iqal_yFOcDuQxmAIKPrw.png" /><figcaption>Preprocessed Images (Image by Author)</figcaption></figure><h4>Loading the Train &amp; Test Data</h4><p>load_image_train() function is used to put together all the previously seen functions and output the final preprocessed image.</p><p>tf.data.Dataset.list_files() collects the path to all the png files available in the train/ folder of the dataset. Then the collection of these paths is mapped through and every path is sent individually as an argument to the load_image_train() function which returns the final preprocessed image and adds it to the train_dataset .</p><p>Finally, this train_dataset is shuffled using the BUFFER_SIZE and then divided into mini-batches as discussed earlier.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/399ff41df9e924fad1d3bf14af126cc6/href">https://medium.com/media/399ff41df9e924fad1d3bf14af126cc6/href</a></iframe><p>To load the test dataset, we will use a similar process except for a small change. Here we will omit the random_crop() and random_jitter() functions as there is no need to do this for testing the results. Also, we can omit to shuffle the dataset for the same reason.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e4fb36c128f9547840b36551cbce022/href">https://medium.com/media/6e4fb36c128f9547840b36551cbce022/href</a></iframe><h4>Building the Generator Model</h4><p>Let us build the generator model now which takes an input black and white sketch image of 256x256 px and outputs an image that hopefully resembles the colored ground truth image in the training dataset.</p><p>The Generator model is a UNet Architecture Model and has skip connections to other layers than the intermediate one. Take note that it becomes complex to design such an architecture as the output and input shapes need to match to the connected layers, so design this carefully.</p><p>The downsampling stack of layers has Convolutional layers which result in a decrease in the size of the input image. And once the decreased image goes through the upsampling stack of layers which has kind of “reverse” Convolutional layers, the size is restored back to 256x256 px. Hence, the output of the Generator Model is a 256x256 px image with 3 output channels.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9d775d93d50c089066dd09aaaad08b6/href">https://medium.com/media/d9d775d93d50c089066dd09aaaad08b6/href</a></iframe><p>You can take a look at the model summary which is given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*65-VqKt9yaGFQuCaGAghTw.png" /><figcaption>Model Summary for Generator Model (Image by Author)</figcaption></figure><h4>Building the Discriminator Model</h4><p>The primary purpose of the discriminator model is to find out which image is from the actual training dataset and which is an output from the generator model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59c54fbab7fe17c6eea79f3279a3b986/href">https://medium.com/media/59c54fbab7fe17c6eea79f3279a3b986/href</a></iframe><p>You can take a look at the model summary of the Discriminator given below. This is not as complex as the Generator model as it’s fundamental task is just to classify real and fake images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*PhQFejq_-3AEi11dXJiFxA.png" /><figcaption>Discriminator Model Summary (Image by Author)</figcaption></figure><h4>Loss Functions for the Models</h4><p>As we have two models with us, we are going to require two different loss functions to calculate their loss independently.</p><p>The loss for the generator is calculated by finding the sigmoid cross-entropy loss of the output of the generator and an array of ones. This means that we are training it to trick the discriminator in outputting the value as 1, which means that it is a real image. Also, for the output to be structurally similar to the target image, we take L1 loss along with it. The value of LAMBDA is suggested to be kept 100 by authors of the <a href="https://arxiv.org/abs/1611.07004"><strong><em>original paper</em></strong></a>.</p><p>For discriminator loss, we take the same sigmoid cross-entropy loss of the real images and an array of ones and add it with the cross-entropy loss of the output images of the generator model and array of zeros.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/18d821bf586742a33090f5f28ef1daa5/href">https://medium.com/media/18d821bf586742a33090f5f28ef1daa5/href</a></iframe><h4>Optimizers</h4><p>Optimizers are algorithms or methods used to change the attributes of your neural network such as weights and learning rates in order to reduce the losses. Adam Optimizer is one of the best ones to use, in most of the use cases.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eef6944440fc42da4db20d6ed9021478/href">https://medium.com/media/eef6944440fc42da4db20d6ed9021478/href</a></iframe><h4>Creating Checkpoints</h4><p>As discussed earlier, cloud environments have a specific timeout which can interrupt the training process. Also, if you are using your local system, there may arise some cases where the training might be interrupted due to some reasons.</p><p>GANs take a very long time to train and are computationally expensive. So, it is best to keep saving checkpoints at regular intervals so that you can restore to the latest checkpoint and continue from there without losing the previously done hard work by your machines.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e443805158acaefdaf10e9f11d02adf/href">https://medium.com/media/8e443805158acaefdaf10e9f11d02adf/href</a></iframe><h4>Displaying Output Images</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96b0c2014ebdd4a6d169df56530c6c2e/href">https://medium.com/media/96b0c2014ebdd4a6d169df56530c6c2e/href</a></iframe><p>The above-given block of code is a basic python function which uses the pyplot module from matplotlib library to display the predicted images by the generator model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pU9ip76VRmmaKvPkW3hDQ.jpeg" /><figcaption>Displaying the predicted image by untrained Generator Model (Image by Author)</figcaption></figure><h4>Logging the Losses</h4><p>You can log the important metrics like losses in a file so that you can analyze it as the training progresses on tools like Tensorboard.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0119bd672f4e031b0ae1bda9fae7848e/href">https://medium.com/media/0119bd672f4e031b0ae1bda9fae7848e/href</a></iframe><h4>Train Step</h4><p>A basic train step will consist of the following processes:</p><ul><li>The generator outputs a prediction</li><li>The discriminator model is designed to have 2 inputs at a time. For the first time, it is given an input sketch image and the generated image. The next time it is given the real target image and the generated image.</li><li>Now the generator loss and discriminator loss are calculated.</li><li>Then, the gradients are calculated from the losses and applied to the optimizers to help the generator produce a better image and also to help discriminator detect the real and generated image with better insights.</li><li>All the losses are logged using summary_writer defined previously using tf.summary .</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c07b5fb99dda3d2941f0e86e0e5ac04/href">https://medium.com/media/8c07b5fb99dda3d2941f0e86e0e5ac04/href</a></iframe><h4>Model.fit()</h4><p>TensorFlow is an awesome, easy to use framework for training models. And one small command like model.fit() does the magic for us.</p><p>Unfortunately, it will not directly work over here as we have created two models that work together. But it is pretty easy to do this too.</p><p>Here we iterate over for every epoch and assign the relative time to start variable. Then we display an example of the generated image by the generator model. This example helps us visualize how the generator gets better at generating better-colored images with every epoch. Then we call the train_step function for the model to learn from the calculated losses and gradients. And finally, we check if the epoch number is divisible by 5 to save a checkpoint. This means that we are saving a checkpoint after every 5 epochs of training are completed. After this entire epoch is completed, the start time is subtracted from the final relative time to count the time taken for that particular epoch.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30aa4d708b51cce3ea90c95833cfd9e5/href">https://medium.com/media/30aa4d708b51cce3ea90c95833cfd9e5/href</a></iframe><h4><em>Aah! Finally, here we are…</em></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04b059ab5e32851fcd156642b18330fd/href">https://medium.com/media/04b059ab5e32851fcd156642b18330fd/href</a></iframe><p>All we have to do now is run this one line of code and wait for the Model to do its magic on its own. Well let’s not give the entire credit to the model, we have done a lot of hard work and it’s time to see the results.</p><h4>Restoring the Latest Checkpoint</h4><p>Before moving forward, we must restore the latest checkpoint available in order to load the latest version of the trained model before testing it on the images.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c4a7c1b60bf93aecdb807ba45860d8a/href">https://medium.com/media/8c4a7c1b60bf93aecdb807ba45860d8a/href</a></iframe><h4>Testing Outputs</h4><p>This randomly selects 5 images from the test_dataset and inputs them individually to the Generator Model. Now the model is trained well enough and predicts near-perfect colored versions of the input sketch images.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a27e79fd0bb2dc5c3b3b4b3399577bc/href">https://medium.com/media/7a27e79fd0bb2dc5c3b3b4b3399577bc/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHesF-1tG1p2UkjDZS4GSQ.jpeg" /><figcaption>Outputs of Black and White Sketches after going through the trained Generator Model (Image by Author)</figcaption></figure><h4>Saving the Model</h4><p>Let’s not kill the model right after doing so much work, right?</p><blockquote>A model shouldn’t end its life in a Jupyter Notebook!<br>- Rightly said by <a href="https://medium.com/u/dbc019e228f5">Daniel Bourke</a></blockquote><p>It takes only a line of code to save the entire model as a .H5 file which is supported by Keras models.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00f41986b5ed45656589b3a02fe68fe5/href">https://medium.com/media/00f41986b5ed45656589b3a02fe68fe5/href</a></iframe><h3>CONCLUSION</h3><p><em>So, that is it!</em></p><p>We have not only seen how a Conditional GAN works but also have successfully implemented it to predict colored images from the given black and white input sketch images.</p><p>You can go through the entire code and download it to see how it works on your system from my <a href="https://github.com/tejasmorkar/sketch-to-color"><strong><em>GitHub Repository</em></strong></a>.</p><p><a href="https://tejasmorkar.github.io/sketch-to-color/">Sketch to Color Image Generation Using Conditional GANs</a></p><p>If you face any problems, want to suggest some enhancements, or just want to leave a quick feedback, do not hesitate in contacting me through any medium that best suits you.</p><h4>My Contact Information:</h4><p><strong><em>LinkedIn</em></strong>: <a href="https://www.linkedin.com/in/tejasmorkar/"><em>https://www.linkedin.com/in/tejasmorkar/</em></a><strong><br><em>GitHub</em></strong>: <a href="https://github.com/tejasmorkar"><em>https://github.com/tejasmorkar</em></a><br><strong><em>Twitter</em></strong>: <a href="https://twitter.com/TejasMorkar"><em>https://twitter.com/TejasMorkar</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89ef35a60b69" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/generative-adversarial-networks-gans-89ef35a60b69">Sketch-to-Color Image Generation | GANs</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generative Adversarial Networks | GANs]]></title>
            <link>https://medium.com/data-science/generative-adversarial-networks-gans-8fc303ad5fa1?source=rss-5ff8f877fa62------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fc303ad5fa1</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[gans-series]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gans]]></category>
            <dc:creator><![CDATA[Tejas Morkar]]></dc:creator>
            <pubDate>Mon, 25 May 2020 14:02:19 GMT</pubDate>
            <atom:updated>2020-10-11T05:53:19.695Z</atom:updated>
            <content:encoded><![CDATA[<h4>GANs Series</h4><h3>1 — Understanding GANs in a Simpler way</h3><h4>Referring to GANs, Yann LeCun, the chief AI Scientist at Facebook and ACM Turing Award Laureate has publicly quoted that the Adversarial Training is,</h4><blockquote>“The most interesting idea in the last 10 years in ML”</blockquote><p>GANs are a relatively recent invention in the field of ML. It was introduced by Ian Goodfellow et al. in 2014 through this amazing <a href="https://arxiv.org/abs/1406.2661">research paper</a>.</p><h4>Now, what exactly is so amazing about GANs?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*buWplCYinlQPhVUy" /><figcaption>Photo by <a href="https://unsplash.com/@roadtripwithraj?utm_source=medium&amp;utm_medium=referral">Road Trip with Raj</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Let us first look at the terms individually — Generative Adversarial Network <br>What does Generative mean?</p><p>Deep Learning can be divided into two types of model objectives, which are</p><ul><li><strong>Discriminative Models</strong><br>These models are used to map a single possible output from the given input data. The most common example you can think of, in this domain is a classifier. Their goal is to simply identify a class of the input data such as ‘spam or not spam’, or like handwritten character recognition, and others.<br>These models capture the conditional probability P(y|x), which is ‘Probability of y given x’.</li><li><strong>Generative Models</strong><br>These models are used to find a probability distribution of a dataset and generate similarly structured data.<br>Generative models are primarily meant to find the <strong>density function </strong>from the given probability distribution of the data. As shown in the diagram below, the points represent the distribution of the data in a 1-dimensional axis which is fitted by the gaussian density in the right image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JUcHcBGpI3H20LV38uJ1g.png" /><figcaption><strong>Density Estimation</strong> — Image Replicated by Author from the <a href="https://arxiv.org/abs/1701.00160">NIPS 2016 Tutorial: Generative Adversarial Networks</a></figcaption></figure><p>GANs do not focus on finding this density function accurately rather they observe the given dataset and generate new samples that fit the underlying structure in the given data samples by the help of two models which are <strong>adversaries </strong>of each other. Hence the name — <strong><em>Generative Adversarial Networks</em></strong></p><h3>Working of GANs</h3><p>GANs consist of two models, namely:</p><ul><li><strong>Generator</strong><br>Its function is to take an input noise vector (z) and map it to an image that hopefully resembles the images in the training dataset.</li><li><strong>Discriminator</strong><br>The primary purpose of the discriminator model is to find out which image is from the actual training dataset and which is an output from the generator model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VnPsLPFkuRf46wbY1HLkjg.png" /><figcaption>Basic Structure of GANs consisting of the Generator and the Discriminator Models (Image by Author)</figcaption></figure><p>You can imagine the generator model to be counterfeiters who want to generate fake currency and fool everyone in believing that it is real, and the discriminator model is the police who want to identify the fake currency and catch the counterfeiters.</p><p>At the beginning the counterfeiters generate random currency that does not resemble the real currency at all. After being caught by the police, they learn from the mistakes [loss of the models in our case]and generate new currency which is better than the previous one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cz7hUcHourXT49nTUOhPPw.png" /><figcaption><strong>An example where the fake currency is not similar to the real one</strong> (Image by Author)</figcaption></figure><p>This way, the police get better at discriminating the fake money from the real one, and simultaneously, the counterfeiters get better at generating money that looks similar to the real money.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvZcBvhJQWp6RKGNnPei8g.png" /><figcaption><strong>The point where counterfeiters become well trained in generating fake money</strong> (Image by Author)</figcaption></figure><p>This is a min-max 2-player game between the models where the generator model tries to minimize its loss and maximize the discriminator loss.<br>As a result, the generator model maps the input vector (z) to an output which is similar to the data in the training dataset.</p><p>In the end, there comes a point when the discriminator can no longer identify the fake output, making its accuracy approximately 50%. This means that it is now making a random guess in discriminating between fake and real data. This is known as the point of Nash Equilibrium.</p><blockquote>NOTE: In practice, it is very difficult to reach this equilibrium point and there are problems which arise due to this. One of which is the <strong>Mode Collapse problem </strong>where the generator produces a very good output in the early stages of the training and then uses it more oftenly as the discriminator isn’t yet able to classify it as fake. As a result, the generator only learns to output data which has very little diversity in it. There are ways to overcome this by various methods like using a different loss function like the <a href="https://arxiv.org/abs/1701.07875"><strong>Wasserstein loss</strong></a><strong>.</strong></blockquote><h3>What can GANs do?</h3><p>The primary objective of GANs was to generate new samples from the given dataset. And since the invention of GANs, they have grown to accomplish this task with better results and added features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*AyzNHv-ftBzHQ2uwmwG08A.png" /><figcaption>Ian J. Goodfellow et al. 2014, <a href="https://arxiv.org/abs/1406.2661">Generative Adversarial Networks</a></figcaption></figure><p>The images above show the output results from the first paper of GANs by Ian Goodfellow et al. in 2014. Set a) contains the outputs generated on the MNIST Dataset of Handwritten digits, set b) shows results for the Toronto Face Dataset, set c) has the outputs from a fully connected model on the CIFAR-10 Dataset, and set d) contains the outputs generated by a convolutional discriminator and a “deconvolutional” generator model on the CIFAR-10 Dataset.</p><p><strong>Progressive GAN </strong>was introduced in 2017 where the authors showed that the quality of the generated images can be increased significantly by training the generator to output low-resolution images at the beginning and increase the resolution as the training went on. This way, they were able to generate high-quality images of faces of 1024x1024 res from the generator trained on the CelebA HQ Dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*AF5LMg1rzozJvRi5_p2jfA.png" /><figcaption>Tero Karras, Timo Aila, Samuli Laine, Jaakko Lehtinen 2017, <a href="https://arxiv.org/abs/1710.10196">Progressive Growing of GANs for Improved Quality, Stability, and Variation</a></figcaption></figure><p>The paper on <strong>DCGANs </strong>was one of the most important researches which showed that using deep convolutions in the GAN models helped to produce better results. They did not use any fully connected and pooling layers which helped them increase efficiency.</p><p>One interesting point in this paper was the <strong>Vector Space Arithmetic </strong>which showed that the output results could be changed based on simple arithmetic equations such as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NYvilnrM2yrId_nkB5q_Q.png" /><figcaption>Alec Radford et al. 2015, <a href="https://arxiv.org/abs/1511.06434">Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks</a></figcaption></figure><p><strong>Cycle-GANs </strong>were able to map input classes to the desired output set. The training is done on two sets of data and with no other labels required. The model learns to transform one set of images into the other.</p><p>In the images below you can see how the Horse images are transformed into the zebra images. An interesting point to note here is that the model learns that horses are mainly associated with the greener grasslands relative to the zebras. So, the model results in giving an output that has a darker background for zebras. This also results in greener horses when we try to transform a zebra image into a horse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xqG5uC9b4B5OC0hdhxZUag.png" /><figcaption>Jun-Yan Zhu, Taesung Park, Phillip Isola, Alexei A. Efros 2017, <a href="https://arxiv.org/abs/1703.10593">Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks</a></figcaption></figure><p>Finally, one of the most interesting GAN variations is the <strong>StarGAN. </strong>It takes an input image of the face and then maps it to its corresponding elevated facial features.</p><p>For example, you can input a face and transform it into an opposite gender, make it younger or older, change its skin color, and much more.</p><p>The right side of the below-given image shows how it is possible to change the facial expressions of any input face using the StarGAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAMjJ9zPMFlePmhs-1Vs9w.png" /><figcaption>Yunjey Choi et al. 2017, <a href="https://arxiv.org/abs/1711.09020">StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation</a></figcaption></figure><h3>Conclusion</h3><p>So, you’ve seen how powerful GANs are and what are they capable of doing. The most amazing thing about GANs is that it is a very simple implementation of a rather complex objective.</p><p>If you have a basic understanding of how a Convolutional Neural Network works and the base of backpropagation, then you can pretty much start working on GANs right away. This article was for introducing the fundamental working behind a Generative Adversarial Network and how its variation can help to generate different and better results.</p><p><strong><em>In further posts, I’ll be sharing how to build a GAN from scratch and generate wonderful results from it. I’ve built a DCGAN to generate new faces from the CelebA Dataset and a Conditional GAN which learns to take a black and white sketch of an anime and transform it into a colored output as shown below.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*uCabC476SAf8zW5Y4cPsBw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*4jR_s5GPI4qNvH4qfdRCsA.gif" /><figcaption>Training of the DCGAN models on datasets showing <strong>MNIST on the left</strong> and <strong>CelebA on the right </strong>(Images by Author)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5hxKIhqUr8MMzB_CNFHzQ.png" /><figcaption><strong>The left column has the previously unseen test images of black and white sketches, the right column has the colored output images predicted by the model without knowing the ground truth </strong>(Image by Author)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fc303ad5fa1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/generative-adversarial-networks-gans-8fc303ad5fa1">Generative Adversarial Networks | GANs</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>