<?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 Brianna Gopaul on Medium]]></title>
        <description><![CDATA[Stories by Brianna Gopaul on Medium]]></description>
        <link>https://medium.com/@briannagopaul?source=rss-935cc8c0bfb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZQ4s2GbEVetXtW5H_HG_fQ.png</url>
            <title>Stories by Brianna Gopaul on Medium</title>
            <link>https://medium.com/@briannagopaul?source=rss-935cc8c0bfb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:46:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@briannagopaul/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[How do you make decisions? ]]></title>
            <link>https://medium.com/@briannagopaul/how-do-you-make-decisions-5b2b6cb1d628?source=rss-935cc8c0bfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b2b6cb1d628</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[markov-decision-process]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <dc:creator><![CDATA[Brianna Gopaul]]></dc:creator>
            <pubDate>Thu, 09 May 2019 13:24:39 GMT</pubDate>
            <atom:updated>2019-05-09T13:24:39.674Z</atom:updated>
            <content:encoded><![CDATA[<h4>Markov Decision Processes — Reinforcement Learning</h4><h4>We make decisions every single day. But what decides how we make decisions?</h4><p>Why did you decide to eat a bagel with cream cheese? Why did you decide to wear that ugly top? (😆jk, you’re awesome) And why did you decide to read this article?</p><h4>In the context of reinforcement learning, our decision-making process can be formulated as a Markov Decision Process (MDP).</h4><p><strong>An MDP describes a fully observable environment.</strong></p><p>I’ll break it down for you.</p><p>Let’s say that you&#39;re at a restaurant. And you must choose one appetizer ( from the first row), one entree (from the second row) and one dessert (from the third row) from the three displayed.</p><p>We want you, the agent, to pick the best possible meal, in term of healthiness and satisfaction every single time you&#39;re at a restaurant.</p><p>How can we do this?</p><p>First, we can formalize this reinforcement learning problem as an MDP.</p><p>Let’s walk through what an MDP is first.</p><p>Every MDP has a property called the <strong>Markov Property. It’s what makes a Markov Decision Process, a Markov Decision Process.</strong></p><blockquote>The Markov Property tells us that “the future is independent of the past given the present”.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1qBPTQ8JEe_rjWerB9A8g.png" /></figure><p>Let’s say you decide to get fries for your appetizer and a burger as for your entree at the restaurant. Whether you decide to choose ice cream, orange juice or watermelon for dessert isn’t dependent on your past food selection choices, it’s only dependent on your current state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPBFsh1zdYm2ThOptry_JA.png" /><figcaption>The Markov Property | David Silver Lectures</figcaption></figure><p>The above equation illustrates the same idea. The next state S_t+1 is dependent on our current state S_t and not all our previous states.</p><p>But how do we go from a previous state to a future state in the first place? How do we make that decision and what makes that decision?</p><h4>That’s the policy.</h4><blockquote>The policy outlines how our learner (you in this case) is going to make it’s decisions.</blockquote><p><strong>It tells us which actions we’re going to select when we’re in certain states.</strong></p><p>In this case, our policy is going to tell us which food selection to make.</p><blockquote>The goal of reinforcement learning is to find a policy that gives us the most amount of total expected reward.</blockquote><p>To go from one state to another state, we can define the probability of doing so as the state transition probability. In the context of this example, we’re going to say that a state is a food selection. For example, if I pick fries, a burger and ice cream. My two previous states are fries and burger but ice cream is my current state.</p><h4>State transition probabilities</h4><p>This State Transition Probability matrix tells us the probability of going from one state to another state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*qMuSGpexYEG-TwawrvlgQQ.png" /></figure><p>Let’s go back to our example of choosing which meals to pick at a restaurant. When picking which meal we want to eat, there’s an associated probability with picking a certain meal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yRygDG1peDm8AUX7ciEncw.png" /></figure><p>So if we decided to pick the fries appetizer, there’s a 0.3 probability of him then picking the burger, a 0.4 probability of him picking the pizza and a 0.5 probability of him picking the spaghetti. This example has subjective state transition probabilities because we based them off of enjoyability.</p><p>Now that you formally know what the Markov Property is and state transition matrix is, <strong>we can define what a Markov Process is</strong>.</p><h4>There are two components of any Markov Process:</h4><ol><li><strong>S — </strong>The state space where all possible states exist.</li><li><strong>P —</strong> The state transition probability associated with every state and future state.</li></ol><p>The example of you picking your appetizer, main entree and dessert at a restaurant is an example of a Markov Chain. A Markov Chain is just a sequence of possible states that have an associated state transition probability with them.</p><p>Remember when I mentioned that the goal of RL is to find the policy that gives us the most amount of total expected reward. Well, the Markov Reward Process tells us the reward values associated with a Markov Chain.</p><h4>Markov Reward Process</h4><p>A Markov Reward Process has two added elements from our Markov Process.</p><ol><li><strong>S — </strong>The state space where all possible states exist.</li><li><strong>P — </strong>The state transition probability associated with every state and future state.</li><li><strong>R </strong>—The reward function that gives us the reward value of being in certain states.</li><li><strong>γ — </strong>The discount factor, a value that tells us how important future rewards are. γ ∈ [0, 1]</li></ol><p>This is important, but what we really want at the end of a Markov Chain is the return.</p><h4>Return</h4><p>The return is the total expected discounted reward we get from choosing certain actions and ending up in certain states in our MDP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-pP3tdYYOoUnzGUvuGE2g.png" /></figure><p>Here we see that the return is defined as the total reward values multiplied by the discount factor at each time step t. <strong>γ tells us how important we want our future rewards to be considered by the agent.</strong></p><p>If we set γ=0, then we’re having our agent only look at current rewards and not future rewards. We can call this type of learning myopic or short-sighted because it can only look at present rewards and not the future. If γ=1, then it the agent will be far-sighted because it’ll consider future rewards as well.</p><p>Now we know about the Markov Property, the Markov Process and Markov Rewards Process but what do we use to actually evaluate our model.</p><h4>The Value Function</h4><p>The value function tells us how good it is for our agent to be in a certain state.</p><p>There are two types of value functions in RL:</p><p><strong>State Value Function</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJIrt95WAqGHKBy-VNljxg.png" /></figure><p>It tells us how good a state is when following a policy.</p><p><strong>Action Value Function</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yre173noD_UiX393fJcaNQ.png" /></figure><p>The action value function tells us how good an action is when following a policy. It’s the expected return we get when giving an action and a state that follows a certain policy.</p><h4>Now how do we go towards finding the optimal policy?</h4><p>We use a very important equation called the <strong>Bellman Equation.</strong></p><p>Butttt, let’s take a break there. I’m going to be explaining this part in the next article. Don’t worry, you’ll get to make the best food selection choice very soon.</p><p><strong>Thanks for reading! If you’re interested in learning more about my projects/what I’m working on you can…</strong></p><ul><li>Check out <a href="http://www.briannagopaul.com/"><strong><em>www.briannagopaul.com</em></strong></a></li><li>Follow me on <a href="https://twitter.com/briannagopaul"><strong><em>Twitter</em></strong></a></li><li>Connect with me on <a href="https://www.linkedin.com/in/brianna-gopaul-b7a626150/"><strong><em>LinkedIn</em></strong></a></li><li>or just shoot me an email at <strong><em>briannagopaul14</em></strong><a href="/service/mailto:briannagopaul14@gmail.com"><strong><em>@</em></strong></a><strong><em>gmail.com</em></strong>. 😄</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b2b6cb1d628" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I konw you wnat to raed tihs atrilce]]></title>
            <link>https://medium.com/@briannagopaul/i-konw-you-wnat-to-raed-tihs-atrilce-d7362621ac6e?source=rss-935cc8c0bfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7362621ac6e</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[policy-gradient]]></category>
            <dc:creator><![CDATA[Brianna Gopaul]]></dc:creator>
            <pubDate>Tue, 23 Apr 2019 23:27:38 GMT</pubDate>
            <atom:updated>2019-04-23T23:27:38.733Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learning by iteration: Policy Gradient Methods in RL</h4><h4>How could you understand that title??</h4><p>You’re a superior subspecies of homo? 🐒 No. (sorry Mr. Ego)</p><p>You have some invisible voice whispering the answers in your ear? 🙉 Thank goodness, no.</p><p>You are just like everyone else and have just learned how to read. Yes.</p><p>If we take a flashback to 10, 20, 30, 40, 50 years ago to when you were learning how to read. You probably looked something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*GfYq2XnnX2_98DGFNLThZg.gif" /></figure><p>You would be staring at a book… looking at its words, it&#39;s pictures, trying to pronounce words, feeling the pages, how the ink felt against your skin, tasting it…</p><p>Years pass by, and today, you probably look more like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*3tk4Q2aYPsgWvirMf0scAQ.gif" /></figure><p>You can understand words — grasp plotlines, themes, settings, characters.</p><p>Heck, you’ve become so adept at reading that you can even understand words from only seeing their first and last letter. See, I kenw you wntaed to raed tihs atrilce 😄</p><p>The thing that differentiates <em>the you </em>from before and <em>the you </em>now is that you probably had some form of <strong>a teacher. Someone to see your mistakes, correct them and make you improve over time.</strong></p><h4><strong>You were learning by iteration.</strong></h4><p><strong>You made mistakes, iterated on them and became better.</strong></p><p>Similar to how you learned how to read, cute <strong>robotic dogs can learn how to play soccer using iteration.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*uqqG4ewRnL23XOhoK3rDng.gif" /></figure><p>But this form of iteration is very different, <strong>these robots use a subfield of Artificial Intelligence called Reinforcement Learning to learn how to play soccer.</strong></p><h4>There are three different types of Reinforcement Learning algorithms:</h4><ol><li>Value-Based; learns a value function</li><li>Policy Gradient; learns a parametrized policy π_θ</li><li>Actor-Critic; learns both</li></ol><p>We’re going to be focusing on Policy Gradient algorithms.</p><p>But first, why would we want to use a Policy Gradient algorithm over a Value-Based or Actor-Critic algorithm?</p><h4>Policy Gradient Algorithms have three main advantages:</h4><ol><li><strong>Better convergence.</strong></li><li><strong>Effective in high-dimensional and continuous spaces.</strong></li><li><strong>They can learn stochastic policies</strong></li></ol><p>Policy Gradient methods have better convergence properties than a value based method because they’ll always converge to some local maximum. In contrast, value-based methods can diverge. I’ll break down what this really means in a bit.</p><p>Policy Gradient methods can also work in high-dimensional and continuous spaces like the robotics dogs you see above.</p><p>In partially observed environments, deterministic policies can be bad at picking actions that maximize expected reward. Stochastic policies use randomness to select actions and can then get a higher expected reward.</p><p>Now that we understand why we might want to use a Policy Gradient method,</p><p><strong>Let’s break down how a Policy Gradient Method works</strong></p><blockquote>The goal of reinforcement learning is to have a policy that gives us the most total expected reward.</blockquote><p>For policy gradient methods, <strong>we iterate on a parametrized policy π_θ</strong> so that it picks actions that give the agent the largest expected reward.</p><h4>We follow 5 steps:</h4><ol><li>Initialize the value θ for the policy π_θ</li><li>Calculate an objective function J(θ)</li><li>Take the gradient of J(θ)</li><li>Update θ using gradient</li><li>Let your agent play the task at hand and then repeat</li></ol><p><strong><em>If we were to go back to how you learned as a kid, the steps are pretty similar.</em></strong></p><ol><li>You have some initial reading skills.</li><li>Your teacher tells you how good or bad you are at reading.</li><li>They locate your mistakes</li><li>They iterate on your mistakes and improve them</li><li>You keep reading and you repeat this same process.</li></ol><p>Let’s go through each step of this algorithm…</p><h4>1. Parameter π_θ</h4><p>First off, the π represents our policy. <strong>A policy tells our agent what actions to pick, it essentially describes it’s behaviour.</strong></p><blockquote>For policy gradients, the <strong>θ will change how the policy acts</strong> and thus which actions our learner chooses.</blockquote><p>And since the goal of Reinforcement Learning is to <strong>find a policy that picks the most amount of expected reward</strong>, <strong>we want to adjust θ so that our policy chooses such actions</strong>. But before we adjust θ, we need some type of metric. We need some value that tells us how good or bad our model is doing. That’s the objective function.</p><h4>2. Policy Objective Function J(θ)</h4><p>The<strong> policy objective function J(θ) tells us how much expected reward we’re going to receive</strong>. Since we want our model to perform the best it can, we want to <strong>maximize J(θ)</strong>.</p><p>There are different policy objective functions you can use depending on your environment. Let’s look at a couple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*xup_kk89NvDNbVwDV8BC9g.png" /><figcaption>David Silver: Reinforcement Learning 😍</figcaption></figure><p>This is the start value policy objective function, it’s used for episodic environments. An episodic environment is essentially one where actions are taken in episodes so one action isn’t dependent on past actions.</p><p>The start value function measures the total expected reward if we always start in one state s_1.</p><p>There are different policy objective functions for different environments.</p><h4>3. Take the gradient of J(θ)</h4><p>We’re not going to look at exactly how we take the gradient of J(θ). <strong>We follow what’s called the Policy Gradient Theorem because computing the derivative of J(θ) gets tricky. </strong>If you really want to nerd out on the proof, check it out <a href="https://lilianweng.github.io/lil-log/2018/04/08/policy-gradient-algorithms.html">here</a>. 🤓</p><p>All you really need to know is that we take a value of J(θ), and using this value we’re going to update θ.</p><h4>4. Update θ</h4><p>Now we want to <strong>update θ using the gradient of J(θ)</strong>. Since we’re trying to maximize the objective function J(θ), we’re going to use gradient ascent to keep taking steps towards maximizing this function.</p><p>Imagine this…</p><p>You’re in the middle of a blizzard on a mountain. Your goal is to reach the highest point of the mountain to sing Let it Go. 🎵</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*lWmCChs0qC__Q0t8" /></figure><p>To <strong>reach a higher point, you keep taking steps in some direction and then measuring your elevation</strong>. If your elevation increase, you continue to take steps in that direction. If your elevation drops, you go in another direction. And <strong>at some point, you should reach a higher point on the mountain even if it isn’t the highest.</strong></p><p>Gradient ascent uses the same premise. <strong>In this case, we want to maximize our objective function to get the most expected reward.</strong></p><p>So we keep taking a step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*qMeZSxwXFaVBDVpUcdqO2A.png" /></figure><p>And if this step improved our policy so that we would get a higher expected reward, we <strong>keep taking steps until we converge to a local or global maximum</strong>.</p><p>And that’s how policy gradient algorithms work!</p><blockquote>The most <strong>simple example of a Policy Gradient algorithm is called REINFORCE</strong>. I recently implemented it in an OpenAI environment called CartPole.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bd170zVwQZvoYUfutMnXrQ.gif" /></figure><p>The goal is to balance a pendulum on a cart that receives a force of +1 or -1. For every time step that the pendulum remains balanced on the cart, it receives a reward of +1.</p><p><strong>You can check out the implementation here:</strong></p><p>(it’ll be updated soon)</p><p><strong>Thanks for reading! If you’re interested in learning more about my projects/what I’m working on you can…</strong></p><ul><li>Check out <a href="http://www.briannagopaul.com/"><strong><em>www.briannagopaul.com</em></strong></a></li><li>Follow me on <a href="https://twitter.com/briannagopaul"><strong><em>Twitter</em></strong></a></li><li>Connect with me on <a href="https://www.linkedin.com/in/brianna-gopaul-b7a626150/"><strong><em>LinkedIn</em></strong></a></li><li>or just shoot me an email at <strong><em>briannagopaul14</em></strong><a href="/service/mailto:briannagopaul14@gmail.com"><strong><em>@</em></strong></a><strong><em>gmail.com</em></strong>. 😄</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7362621ac6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preventing Deaths From Heart Disease Using Machine Learning]]></title>
            <link>https://medium.com/data-science/preventing-deaths-from-heart-disease-using-machine-learning-c4f8dba250c6?source=rss-935cc8c0bfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4f8dba250c6</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[heart-disease]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Brianna Gopaul]]></dc:creator>
            <pubDate>Tue, 01 Jan 2019 17:49:28 GMT</pubDate>
            <atom:updated>2021-04-16T17:21:04.443Z</atom:updated>
            <content:encoded><![CDATA[<h4>Heart disease is killing millions of people worldwide. And Machine Learning may be able to help solve this problem.</h4><h4><strong>What is the world’s leading cause of death?</strong></h4><p>Cancer?</p><p>No.</p><p>Injury/Accidents?</p><p>No. Keep trying.</p><p>Respiratory diseases, Diabetes, Alzheimer’s Disease?</p><p>Nope, nope and nope.</p><blockquote><strong><em>The leading cause of death is heart disease.</em></strong></blockquote><blockquote><strong><em>And it’s been the leading cause of death since 2000.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2XCSoum2BX4JADcDk0dUGw.png" /><figcaption>Source: <a href="https://www.who.int/news-room/fact-sheets/detail/the-top-10-causes-of-death">WHO</a></figcaption></figure><p>More than half a million Americans die from heart diseases like coronary artery disease, cardiovascular disease, and angina every year. (613,000 to precise). And health care services and medications for heart disease costs the US nearly $200 billion every year.</p><p>So <strong>half a million lives gone and $200 billion dollars spent</strong></p><p><em>every,</em></p><p><em>single,</em></p><p><em>year</em>,</p><p><strong>for heart disease. (in the US alone)</strong></p><h4><strong>Well, it’s pretty bad now but what will the future look like?</strong></h4><p>In 2030, the American Heart Association projects that the costs involved in treating heart disease will rise to <a href="http://www.cardiobrief.org/2011/01/24/aha-estimates-cost-of-heart-disease-will-triple-by-2030/">$818 billion</a>. And <a href="https://www.healio.com/endocrinology/news/print/endocrine-today/%7Bb5a7365d-87e9-41fa-b924-570fbacdbffc%7D/projected-costs-to-treat-heart-disease-in-us-will-triple-by-2030">116 million people</a> in the US will have some form of cardiovascular disease.</p><h4><strong>There are two main reasons that people develop heart disease</strong></h4><p><strong>Half of the problem is genetics. </strong>People are born with genetic mutations that increase their likeliness of developing heart disease. Unfortunately, we can’t control this right now but with gene editing technologies like CRISPR, we may be able to prevent this in the future.</p><p><strong>The other half of the problem is poor lifestyle. </strong>People make poor decisions on a daily basis that cause heart disease.</p><p>We can break these factors into four categories.</p><ol><li>Physical inactivity — cause of 35% of heart diseases.</li><li>Obesity — 27 million Americans have heart disease induced by obesity</li><li>Smoking — 20% of heart disease deaths are directly related to smoking</li><li>Poor Diet 500,000 people in the United States due to heart disease because of high-fat diet. High cholesterol accounts for 15% of heart disease patients. Diabetes accounts for 11% of heart disease patients.</li></ol><p>There’s one thing in common with all of these factors. They’re all in our control. We get to decide whether we want to exercise, smoke and maintain a healthy diet. This is a choice. And thus, <strong>the deaths from these factors could have been prevented if those people made smarter <em>decisions.</em></strong></p><p><em>And to make an informed decision, people need information.</em></p><h4><strong>Let’s prevent deaths from heart disease.</strong></h4><p>First, a quick recap. We know a lot of people are dying from heart disease and that half of these deaths could potentially be prevented if people made better lifestyle choices. So how do we do this?</p><blockquote><em>Using a subset of Artificial Intelligence called Machine Learning, we can predict someone’s likeliness of having heart disease before they die from it. If people know their likeliness of having a fatal disease, this will encourage them to make smarter lifestyle choices. Thus reducing the number of people who die from heart disease.</em></blockquote><h4>How will this work?</h4><p>We can use a machine learning algorithm to take in information and classify if a person is likely to have heart disease.</p><p>Using the Cleveland Dataset from the UCI Machine Learning Repository, I tried this out myself.</p><p>The model took in 13 different data points about each person.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xyw9e13g61ZO0-rW" /><figcaption>13 different attributes in Cleveland Heart Disease Dataset</figcaption></figure><h4>I implemented a Support Vector Machine (SVM)</h4><p>Here is a layman’s explanation of what a Support Vector Machine does.</p><p><strong>An SVM is a supervised learning algorithm that performs classification tasks.</strong> In plain English, it uses labelled data to differentiate between classes of inputs.</p><p>Here is an analogy for how it works.</p><p>You’re a teacher at a middle school. One day, you’re patrolling the middle school grounds, making sure everybody is safe and sound. All of a sudden, a fight breaks out between the sixth graders and eighth graders. As a teacher, there are three things you need to do.</p><ol><li>Separate the eighth and sixth graders</li><li>Don’t engage in any physical contact with either side.</li><li>Protect your life :)</li></ol><p>The field looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p-q7nIfGf-_KvUIv" /><figcaption>Middle school field</figcaption></figure><p>On your first try, you successfully separate the sixth and eighth graders but you make physical contact with them and risk your life by touching the hormonal eighth graders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5V-_sJa2Jswm3_U7" /></figure><p>So you try again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s9iB3bkd0x4Dv2XE" /><figcaption>Excellent SVM</figcaption></figure><p>The second try is a huge success. Not only do you save your life, you are reminded that your years of schooling were finally worth it. Jk, but you do a really good job at 1. Separating the eighth and sixth graders and 2. Maximizing the distance between each middle schooler to yourself.</p><p>This is an example of a really good Support Vector Machine algorithm.</p><p>Our two classes in this example are the eighth graders and sixth graders. We’re trying to classify and divide the two classes from each other.</p><p>The teacher represents a hyperplane. I’m not going to explain what a hyperplane is in this article but it can be thought of as the line that does that classification.</p><p><strong>The objective of an SVM is to find an optimal separating hyperplane.</strong></p><p>In the above example, we did exactly that because we classified the two classes and maximize the distance from the blue line to every input. This also proves why our first try as a teacher didn’t go so well. We didn’t find the optimal separating hyperplane.</p><p>Our teacher (blue line) can be thought of as a hyperplane. The role of an optimal separating hyperplane is to classify the classes, in this case, eighth graders and sixth graders and maximize the distance between each input and the line which was done.</p><p>To recap, a SVM is a machine learning algorithm that uses a hyperplane to separate classes. The optimal separating hyperplane is what it aims to use to classify between classes. It can be distinguished by 1. Accurately separating all the classes and 2. Maximizing the distance between every input and the hyperplane.</p><blockquote><em>Using scikit-learn, a machine learning package, I implemented an SVM to classify between people with high probability of having heart disease and low probability.</em></blockquote><p><a href="https://github.com/BriannaGopaul/heartdisease/blob/master/Heart%20Disease%20Notebook.ipynb">BriannaGopaul/heartdisease</a></p><p>Unfortunately, I got an accuracy rate of around 62% which isn’t good enough to be used in the real world. After some more research, <strong>I learned three things. </strong>First off, Support Vector Machines aren’t the best at multiclass classification tasks. Second, I need to preprocess more of my data better. This is something that I’m learning about now and am reiterating. Third, it’s really difficult to find open-sourced health data online.</p><p>Although machine learning is a very novel field, if data scientists and machine learning experts had access to open-sourced health data, we would be on the path to cracking a lot of the problems we’re currently facing in healthcare. We’re not at the stage to prevent deaths from heart disease right now, but this is the starting point of doing something alike.</p><p><strong>What I’ll be working on next:</strong></p><p>To continue developing a knowledge base in AI, I’ll be making more progress on Andrew Ng’s Machine Learning course and working on more projects to apply my knowledge.</p><p><em>If you’d like to learn more about other projects I’ve worked on, check out my portfolio </em><a href="https://tks.life/profile/brianna.gopaul"><em>here</em></a><em> and connect with me on </em><a href="https://www.linkedin.com/in/brianna-gopaul-b7a626150/"><em>Linkedln</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4f8dba250c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/preventing-deaths-from-heart-disease-using-machine-learning-c4f8dba250c6">Preventing Deaths From Heart Disease Using 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[A Neural What? !— Machine Learning P.1]]></title>
            <link>https://medium.com/@briannagopaul/a-neural-what-machine-learning-p-1-fd077e534966?source=rss-935cc8c0bfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd077e534966</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[singularity]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Brianna Gopaul]]></dc:creator>
            <pubDate>Wed, 05 Dec 2018 03:56:46 GMT</pubDate>
            <atom:updated>2018-12-11T01:54:30.321Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Neural What? !— Machine Learning P.1</h3><p><strong>Quick!</strong></p><p><strong>Think of a technology that has advanced humanity in recent years</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*1qUTAuz8Qe2zMjYSK5BgFQ.gif" /><figcaption>(<a href="https://www.wired.com/2016/09/you-too-can-become-a-machine-learning-rock-star-no-phd-necessary/#.vwqrte4m5">Wired</a>)</figcaption></figure><p>Most people would think of the internet, computers, maybe even cellular devices. And they’re right, these technologies have definitely helped advance humanity. <strong>But the next generation of technologies that will accelerate humanity will be very different.</strong> I’m talking about <strong>Quantum Computing, Artificial Intelligence, Brain Computer Interfaces</strong> and more. Not only do they sound sexy, many of these technologies are in development right now!</p><p>This summer, I had the opportunity to intern at <a href="http://xanadu.ai/">Xanadu</a>, a photonic quantum computing company. There, I learned about Continuous Variable Quantum Computing and I got to work on a couple of <a href="https://strawberryfields.readthedocs.io/en/latest/gallery/gate_visualisation/GateVisualisation.html">projects</a> with the guidance of their team. One interest I had in particular at Xanadu was Quantum Machine Learning (QML). But to really understand QML, you need a solid understanding of Machine Learning. So…here we go!</p><h4>This is the first part of a series of articles and videos on Machine Learning, Deep Learning and Reinforcement Learning.</h4><p>Before we dive in, let’s first define what machine learning is.</p><blockquote>Machine Learning is the ability for a computer to learn a specific task without being explicitly programmed how to do it.</blockquote><p>We want our model to be able to perform tasks based on new data that we have’t already trained it on. In other words, we want our model to generalize.</p><p>Machine learning models can do all sorts of things!</p><h4>WHAT — Machine learning models classifying melanoma better than physicians</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7P1fn5mNjJGBtHEm.png" /><figcaption>Classifying benign and malignant skin cancer. (<a href="https://web.stanford.edu/~kalouche/cs229.html">Stanford CS 229</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDPAKIZo1AXJz5ihaeuguA.png" /><figcaption>“Machines that dream” by Google DeepMind 😮(deep learning) <a href="https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html">(Google AI Blog)</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*Hh4bsKNPy-aPh_OA_9RRNQ.png" /><figcaption>Preventing poachers from killing endangered wildlife during night hours</figcaption></figure><p>What’s insane is that machine learning can carry out some of these tasks better than humans can. Dermatologists were put up against machine learning models to see who could identify melanoma more accurately. The <strong>physicians had an </strong><a href="https://www.sciencedaily.com/releases/2018/05/180528190839.htm"><strong>accuracy of 71.3% while the machine learning model was at 95%</strong></a><strong>.</strong></p><p>I think we can both agree that machine learning is a field worth learning. OK back to the benches, let’s learn.</p><p>Machine learning models can be divided into two categories: <strong>Supervised and Unsupervised Learning.</strong></p><p><strong>Supervised learning is where we have inputs and outputs</strong> and we want to <strong>learn a function that maps our input to an output.</strong></p><p><strong>Unsupervised learning is where we don’t have outputs</strong>. Instead, we’re trying to find the underlying structure behind our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-7DR0Ihb6rHqCAOcxLyew.png" /><figcaption>(<a href="https://blog.statsbot.co/machine-learning-algorithms-183cc73197c?gi=b5f1383172b">Stats and Bots</a>)</figcaption></figure><p>Within supervised learning, two tasks that we can perform are classification and linear regression.</p><p><strong>Linear regression</strong> is where we’re <strong>mapping a function from an input to an output</strong>. A linear regression model can learn a function. <strong>Classification is where we are labelling data based off their similar attributes</strong>. For example, we can label a dataset of cats and dogs.</p><p>Okay so we know that Machine Learning is divided into Unsupervised and Supervised Learning and two tasks within supervised learning are classification and linear regression.</p><p>The simplest neural network is a one-layered neural network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z9Vts9DweGnQRMiw" /><figcaption>(<a href="https://towardsdatascience.com/what-the-hell-is-perceptron-626217814f53">Towards Data Science</a>)</figcaption></figure><ol><li>Input vectors</li><li>Weights</li><li>Activation Function</li></ol><p><strong>Weights play a really important role in neural networks</strong>. Not only are they one of the parameters that we want to keep updating, they also determine how important we want that specific node to be weighed on. For example, if my first node has a weight of 0.5 and my second node has a weight of 0.1. Then my first node is more important in the model.</p><p>The <strong>activation function determines what the output will be for a certain node</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*8Xyk-4zBwE95KCvB" /><figcaption>woot woot activation functions <a href="https://www.google.ca/imgres?imgurl=https://cdn-images-1.medium.com/max/1600/1*XxxiA0jJvPrHEJHD4z893g.png&amp;imgrefurl=https://towardsdatascience.com/activation-functions-neural-networks-1cbd9f8d91d6&amp;h=292&amp;w=726&amp;tbnid=3RA1000keMvcLM:&amp;q=sigmoid+and+relu&amp;tbnh=85&amp;tbnw=214&amp;usg=AI4_-kS6PbYdZWog09voro_AcqXRN9FDDw&amp;vet=12ahUKEwjjreL4zovfAhXTqYMKHR2mCEYQ9QEwAHoECAcQBg..i&amp;docid=vJ2WlTGeao1wGM&amp;sa=X&amp;ved=2ahUKEwjjreL4zovfAhXTqYMKHR2mCEYQ9QEwAHoECAcQBg">(Towards Data Science)</a></figcaption></figure><p><strong>Simoid and ReLU are the two most common activation functions.</strong></p><p>If ReLU receives an input less than 0, it outputs 0. And if it receives an input greater than 0 like 0.1, the output equals the input (it will output 0.1) .</p><p>Sigmoid is a smooth nonlinear function that works a bit differently but we’ll talk more about this in later articles.</p><h4>Uhhh… how does this work?</h4><ol><li>Input x weight = activation</li><li>Sum of all our activations</li><li>Activation x activation function = output</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iGe1d6Qk-F2gUSwx" /><figcaption>bias + input x weight</figcaption></figure><p>The first θ is our <strong>bias vector.</strong> It’s also a <strong>parameter that we train to make our model perform better.</strong></p><p>It essentially moves the threshold of the activation function. On the left, we haven’t applied any bias, on the right, we’ve applied a bias to the sigmoid function and moved the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzcJ9s85hVfG_s1LShG3hw.png" /><figcaption>Bias vector moves the threshold of the sigmoid function.</figcaption></figure><p>Perceptrons are practically useless without being trained. Let’s learn how to train one.</p><blockquote><strong>When we’re training any machine learning model, we’re iterating on parameters and updating them until our error is low.</strong></blockquote><p>For our perceptron,<strong> we’ll be iterating on our weights and bias vector</strong> but to do that we first need to evaluate the accuracy of our model.</p><p>We do this by looking at the error.</p><p>Our<strong> error is our desired ouput-real output.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/0*CcWSHyzADaJZ5v1X" /><figcaption>y is the desired output, ŷ is the real output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOyf77k56NIjH65mvXDVWA.png" /><figcaption>Error</figcaption></figure><p>The distance from our input to the line (our function) is the error. So on the left, our model did a pretty good job at minimizing the error but on the right, our error is high.</p><p><strong>More error means our model is doing a bad job so we always aim to minimize the amount of error our model has.</strong></p><p>The most common way to evaluate the error of our model is to take the Mean Squared Error (MSE). It’s just the average of all our weights squared. Pretty simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*l2SfGAwAvGe_-jiO" /><figcaption>n=number of data points (<a href="https://en.wikipedia.org/wiki/Mean_squared_error">MSE</a>)</figcaption></figure><p>Ok training time! But what do we train our model on?</p><p>In machine learning, we <strong>split our data into training, test and validation sets. </strong>Their functions are pretty self-explanatory.</p><h4>Let’s train that baby!</h4><blockquote><strong>The Perceptron Rule</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*CsH1H_SkRiK15bOq" /></figure><ol><li><strong>Updates weights.</strong> We add the previous weight value to the amount that we want to change the weight by.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*yUOE8eV3-YDKTLTo" /></figure><p>2. The <strong>change in the weight value is the error*input*learning rate</strong>.</p><p>The learning rate determines how large of an update we want our weight to change by. With a smaller learning rate, we’ll slowly change our weights and with a larger learning rate, our weights will change faster.</p><p><strong>This can be dangerous. If we use too large of a learning rate, it’s possible to overfit the model. Similarly, if our learning rate is too small, it’ll take a long for the model to find the local optimum.</strong></p><blockquote><strong>We can also train models using Gradient Descent.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00lq5o6usAkuuMdYcUdc0g.png" /><figcaption>Gradient Descent (<a href="https://www.google.ca/imgres?imgurl=https://cdn-images-1.medium.com/max/1600/1*f9a162GhpMbiTVTAua_lLQ.png&amp;imgrefurl=https://hackernoon.com/gradient-descent-aynk-7cbe95a778da&amp;h=768&amp;w=1366&amp;tbnid=Yiarh4BgHGVUpM:&amp;q=gradient+descent&amp;tbnh=119&amp;tbnw=214&amp;usg=AI4_-kTeiSvjrrWP36LlCem-_J9Q6kk15g&amp;vet=12ahUKEwi06dqUz4vfAhWjrIMKHf4WAswQ9QEwAHoECAQQBg..i&amp;docid=WPS3uPTi7A72oM&amp;sa=X&amp;ved=2ahUKEwi06dqUz4vfAhWjrIMKHf4WAswQ9QEwAHoECAQQBg">Hackernoon)</a></figcaption></figure><p>Gradient descent is the most popular training algorithm in machine learning. To understand Gradient Descent, we first need to define the cost function.</p><p>Our <strong>cost function is a value that tells us how well our model performs</strong>. If we have a really high cost function, our model is doing badly. Likewise, with a smaller cost function our model is doing better. The cost is calculated by taking the sum of our desired value-our actual value. Sounds pretty similar to something eh? Yup, the cost function takes the error of our model, squares it, sums it over all the errors and takes an average. The number we get is called the cost.</p><p><strong>The goal of gradient descent is to minimize the cost.</strong> We want our model to perform the best it can. Let’s use an analogy to really understand what’s happening here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*iwfMC5K4LN2CfrufV7vn6A.png" /></figure><p>Let’s say you’re on mountain trail and you want to reach the lowest point of the mountain trail to take killer selfies. In Gradient Descent, this can be equated to us wanting to reach the smallest possible cost or local optimum.</p><p>So first, you decide to walk to your left, which brings you down to one of the lower mountains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*XRJipydvTujgZZjO4dVQmw.png" /><figcaption>taking steps towards a local optimum</figcaption></figure><p>Your movement left or right is what we call the gradient. It’s essentially a step towards a steeper direction, just like how you took another step to try to find a lower mountain.</p><p>But how do you know if the mountain you’re on is the lowest mountain? Similarly, in machine learning, how do you know that you’ve reached the global optimum and not a local optimum.<strong> That’s a common problem in machine learning, we never know if we’ve reached the global optimum or hit another local optimum.</strong></p><p><strong>The idea of gradient descent is that we keep making steps until we find the lowest point.</strong> When we find the lowest step, our cost will also be low which means our model is performing well!</p><p>Let’s just revisit what we learned.</p><p><strong>Key Takeaways:</strong></p><ul><li>Machine Learning: Ability for a computer to learn a specific task without being explicitly programmed how to do it.</li><li>The simplest neural network is called the perceptron.</li><li>The perceptron is made of nodes that take in an input vector and have an associated weight and activation function.</li><li>Perceptrons train on two parameters: the bias vector and weights.</li><li>We can use the Perceptron Learning Rule and Gradient Descent to train our perceptron. Both training methods minimize a value that tell us how bad our model is.</li></ul><p>Thanks for reading! Clap if you enjoyed the read or learned something new.</p><p>Stay tuned for more! I’ll be working on more machine learning articles and videos in the future.</p><p>If you want to learn more about what I’ve been working on check out my <a href="https://tks.life/profile/brianna.gopaul">portfolio</a> and read my other articles on <a href="https://medium.com/coinmonks/quantum-np-complete-no-problem-9fd5d5f8b2e0">Quantum Computing</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd077e534966" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The World of Photonic Quantum Computing]]></title>
            <link>https://medium.com/@briannagopaul/the-world-of-photonic-quantum-computing-4787a2b12649?source=rss-935cc8c0bfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4787a2b12649</guid>
            <category><![CDATA[xanadu]]></category>
            <category><![CDATA[cv]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[photonics]]></category>
            <dc:creator><![CDATA[Brianna Gopaul]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 11:04:54 GMT</pubDate>
            <atom:updated>2018-07-17T13:10:46.656Z</atom:updated>
            <content:encoded><![CDATA[<p>The past two weeks have been packed with knowledge, excitement, and confusion.</p><p>I’ve been interning at Xanadu, a quantum computing startup in Toronto. Not only have <strong>I met some incredibly intelligent people, I’ve also hit a major learning curve.</strong></p><p>At Xanadu, I’ve been coding quantum circuits and quantum machine learning models but before we dive into my first project, let’s learn about what Xanadu does.</p><h4>Xanadu: Building the world’s first practical quantum computer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k5nwrn1W9P5FgvDpltoDcg.png" /></figure><p><strong>Xanadu has taken an interesting approach to quantum computing.</strong></p><p>While companies like Rigetti and IBM use the qubit model , Xanadu is developing a continuous variable model.</p><p>And there are numerous benefits for adapting the Continuous Variable (CV)model. For example, the CV model requires less coupled systems to perform computations. Nevertheless, while the CV model has certain advantages over the qubit model, it also presents its own problems and limitations.</p><p>The first apparent difference between these two models deal with quantum bits, the information carrying units of a quantum computer. While the qubit model uses discrete-valued qubits, the CV model uses <strong>qumodes that reside in an infinite dimensional space.</strong></p><p>h u h?</p><p>Yes, quantum operations in CV quantum computers operate in an infinite dimensional space called the Hilbert space. In other words, these operations are non-localized. Although this concept sounds abstract, we must remember that things work differently on a quantum level. And if you like the weirdness of Hilbert space, you’ll love what comes next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1qd8PM30HNMOIBrUYz0ZIQ.png" /><figcaption>Physical Interpretation of Hilbert Space</figcaption></figure><p>Qumodes are collections of photons that have been operated on. We’ll see later that you can morph qumodes into new shapes using quantum logic gates. Similar to the qubit model, CV quantum computing also uses quantum logic gates to perform different operations on bits.</p><h4>Visualizing Quantum States</h4><p>My first project at Xanadu developed my intuition behind how CV quantum gates operate on qumodes.</p><h4>Vacuum State</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*aHCacN79vEF6PKAtxr3lnw.png" /></figure><p>To start off, we’ll have a look at the vacuum state. This is the initial state of a qumode. When measuring the vacuum state we get |0 〉</p><p>The probability distribution of the vacuum state is represented on a wigner function. Here all the values are positive.</p><p>The vacuum state can be evolved into different states by applying quantum logic gates to qumodes.</p><h4>Squeezed State</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*52ySiEH2-SOnmdM9T4ZruQ.png" /></figure><p>The gate applied here is called a squeezing gate. It is one of the most basic CV quantum gates. You can think of someone squeezing the vacuum state by a certain force until it becomes a certain shape. It shifts the vacuum states’s quadratures by x^−r x̂ ϕ on quadrature x̂ and e ^r ϕ on quadrature p̂.</p><h4>Cubic Phase Gate</h4><p>The squeezing gate, displacement gate, rotation gate and beamsplitter gates are all Gaussian gates. But the really weird quantum states can be created using Non-Gaussian states such as the Cubic Phase Gate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*OPYlkiDSoehjuSSbJytMYw.png" /></figure><p>This gate works by shifting the p̂ quadrature by γx̂ 2. But the interesting part are the darker purple areas. If you have a look at the colour bar, we can see that those areas represent a location where the qumode has a negative probability distribution.</p><p>This concept baffled me. Although it doesn’t make sense intuitively, the math computes and it has been proven theoretically.</p><p>The implications of using a qumode in a negative probability state are not known. CV quantum computing is in it’s early stages of development. But it brings the opportunity to use the quantum weirdness of photons to potentially solve some of the world’s biggest problems.</p><p>For the next couple of weeks, I’ll be working on developing quantum machine learning models at Xanadu.</p><p>If you want to learn more about continuous variable quantum states and their physical representations, I coded a couple of quantum circuits in the notebook below:</p><p><a href="https://github.com/BriannaGopaul/Strawberry_Fields/blob/master/Gate%20Visualization%20(1).ipynb">BriannaGopaul/Strawberry_Fields</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4787a2b12649" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum + NP-Complete = No problem]]></title>
            <link>https://medium.com/coinmonks/quantum-np-complete-no-problem-9fd5d5f8b2e0?source=rss-935cc8c0bfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fd5d5f8b2e0</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[disruption]]></category>
            <category><![CDATA[quantum-computer]]></category>
            <dc:creator><![CDATA[Brianna Gopaul]]></dc:creator>
            <pubDate>Sat, 30 Jun 2018 05:26:28 GMT</pubDate>
            <atom:updated>2018-07-10T15:19:40.966Z</atom:updated>
            <content:encoded><![CDATA[<h4>We haven’t been able to solve NP-Complete problems since the 1950s. And if solved, some of these problems can change the world.</h4><p><strong>What is an NP-Complete problem?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*ljsRe8myCbjNUcLG7CpBlA.jpeg" /><figcaption>NP vs P vs NP-Complete</figcaption></figure><p>NP-Complete problems are a class of complexity problems that currently have no time-efficient algorithm.</p><p>Here are some real-world examples:</p><h4><strong>Let’s save lives.</strong></h4><p>In gene analysis, genes are clustered by their similar reactions to certain conditions. When a cluster of connected genes are found, we can then use this to gain major insights about specific diseases and conduct drug targeting.</p><h4><strong>Efficient Routes for Transportation Will Benefit the Environment</strong></h4><p>The Travelling Salesman problem asks to find the most efficient route to travel from one destination to another within a city while visiting various destinations on the route. If we solve this problem, we can exponentially decrease the amount of time and resources spent in transportation for companies like FedX and UPS. The environment would love this too; transportation currently produces 26% of GHG in our atmosphere. This percent would drop exponentially.</p><p>These are both NP-Complete problems. Clearly, if we can find a solution to these problems, they will solve many of humanities’ problems. Not to mention that these are only two; there are countless more problems that make major impact when solved.</p><p>Now here is the interesting part:</p><h4><strong>If we can find an efficient algorithm for an NP-Complete problem, an efficient algorithm can be found for all such problems.</strong></h4><p>In other words:</p><ol><li>We find an efficient algorithm to solve one NP-Complete problem</li><li>We use that algorithm to solve the above NP-Complete problems among others</li><li>*boom* we solve many of the world’s problems</li></ol><p>Of course, doing so is easier said than done. ‘</p><p>While thinking about potential solutions, I decided to look at a different approaches to computing that may be able to solve NP-Complete problems.</p><h4>The Quantum Realm: There’s a quantum computing algorithm that can solve specific NP-Complete problems.</h4><h4><strong>Grover’s Algorithm</strong></h4><p>Grover’s algorithm is a quantum algorithm that is used to search through unstructured data sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*A1IqaLC54vdfMxmllUg_MQ.png" /><figcaption>No, not this Grover.</figcaption></figure><h4><strong>Why is this algorithm special?</strong></h4><p>It provides a<strong> quadratic speedup.</strong></p><p>Let’s say we are looking for “4” in a data set of n=10²⁰ numbers. A classical algorithm would use O(10²⁰) [O(n)] operations. But Grover’s algorithm would use O( √10²⁰) [O(√10^n)] operations.</p><p><strong>If you’re interested, here is a deeper dive into how Grover’s algorithm works</strong></p><p>Some search problems can be shown as a function, f, and x as an input.</p><p>f(x) = 1 (if x is the solution) and f(x) = 0 (if x is not the solution to the search problem).</p><p>When applying the oracle (a black box operation), qubits are first put in a uniform superposition using the Hadamard gate.</p><p>The oracle is applied to find the solution to the search problem. If we have a search problem with N problems and M solutions, the oracle is applied O( √N/M) times to find the solution to such problem.</p><h4>Grover’s algorithm can be implemented on a specific class of NP-Complete problems called 3SAT problems:</h4><p>Before we look at 3SAT, let’s understand what SAT is:</p><p>A SAT or satisfiability problem looks for a set of variables that make a boolean formula true. Let’s have a closer look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LTchagpfRJxYf_VdPcZTYA.png" /></figure><p>A 3SAT problem is slightly different. 3SAT problems require 3 variables in each clause. For example, the problem may look like this: (x1∨x2∨x3)∧(x4∨x5∨x6)</p><p><strong>If Grover’s algorithm can solve 3SAT problems, we may be able to solve other NP-Complete problems. And many of these NP-Complete problems can solve some of the world’s biggest problems.</strong></p><p>I recently implemented Grover’s algorithm on a 3SAT problem using IBM’s QISKit and encountered a common problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/1*5Ef3vuUR4tNoKyonKoaLdw.png" /></figure><p>I used the above 3SAT problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/1*5Ef3vuUR4tNoKyonKoaLdw.png" /><figcaption>output</figcaption></figure><p>And I received the above output.</p><p>Clearly, the algorithm didn’t work in this instance. The reason? The quantum simulator could not use a sufficient amount of qubits to solve the problem. This is one of the biggest challenges quantum computers face today. They don’t have enough error-corrected qubits to be applied to substantial problems.</p><p>Nevertheless, IBM is currently working on optimizing Grover’s algorithm so that less qubits are required to run the algorithm on problems.</p><p>Although we can’t solve NP-Complete problems right now, with the advancement of quantum computers and quantum algorithms, it can become a reality in the near future. Solving NP-Complete problems means that we’ll be able to discover more about our genes to combat diseases, optimize transport, energy and more. The possibilities are endless.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fd5d5f8b2e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/quantum-np-complete-no-problem-9fd5d5f8b2e0">Quantum + NP-Complete = No problem</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>