<?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 Ritvik Mandyam on Medium]]></title>
        <description><![CDATA[Stories by Ritvik Mandyam on Medium]]></description>
        <link>https://medium.com/@ritvik-mandyam?source=rss-438347f74145------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TDf-izrlfbjW0VZ7.</url>
            <title>Stories by Ritvik Mandyam on Medium</title>
            <link>https://medium.com/@ritvik-mandyam?source=rss-438347f74145------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:51:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ritvik-mandyam/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[Chatting With GPT]]></title>
            <link>https://ritvik-mandyam.medium.com/chatting-with-gpt-6cb71c0be439?source=rss-438347f74145------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cb71c0be439</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Ritvik Mandyam]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 04:01:33 GMT</pubDate>
            <atom:updated>2023-03-28T04:01:33.208Z</atom:updated>
            <content:encoded><![CDATA[<p>I tried ChatGPT for the first time a week or so ago. Not in the sense of, “Oh, I went in and made an account and played with it,” but from an actual, professional sense. Frankly, what I found pretty much blew me away.</p><p>ChatGPT is an AI created by OpenAI. It’s one of the most advanced text models currently available to the general public. It’s been trained on an enormous number of documents from the internet, and by reading those documents, it has learned how to answer any questions that a human might ask it.</p><p>There have been AI engines that did this before. Facebook’s “BlenderBot” comes to mind as an example. BlenderBot was a similar text-generation AI, but its capabilities were nowhere near what ChatGPT’s are. BlenderBot could retain information about the conversation it was having, but it didn’t have ChatGPT’s ability to answer questions. The text it produced was also significantly less coherent and relevant than ChatGPT’s responses.</p><p>Before we get too far into this article, I want to point out a couple of things. First of all, ChatGPT is not sentient… Probably. Sure, ChatGPT is just a bunch of numbers represented on some silicon somewhere with electricity running through it. Even so, you could make the argument that the human brain is just a bunch of numbers represented on some carbon somewhere. I’d really like to dig into the philosophy of whether or not an AI model is sentient here. However, I’m not going to, because I’d like to be employed in an AI-related position at some point in the near future. All I’m saying is, if I was a company that had billions of dollars of potential profits contingent on an AI not counting as a sentient individual, I’d say it wasn’t sentient, too.</p><p>The second thing I want to point out is the risk of overreliance on ChatGPT. We live in a world rife with misinformation, and ChatGPT is almost certain to have had some of that misinformation in its training data. As if that wasn’t bad enough, ChatGPT also has a tendency to hallucinate. In the context of AI, that means that sometimes, ChatGPT just makes things up — and it states them confidently in its responses, even going so far as to provide citations. Sometimes, you can point the error out to ChatGPT and it will correct it. Other times, ChatGPT will insist that you and all of StackOverflow are wrong. My point here is, don’t rely on ChatGPT too much, and maybe verify the things it tells you independently.</p><p>Despite those caveats, though, ChatGPT is an extremely useful tool. First of all, there’s it’s ability to generate code. You can ask ChatGPT to generate code to solve a certain problem, and it will generate it for you. The really cool thing is, though, this isn’t limited to short snippets — ChatGPT can keep track of all the files and objects in an entire programming project in its memory. A few days ago, I tried to use ChatGPT to generate code for a Flutter app. The app had 6 screens, and some of them required some pretty advanced state management. Other screens used relatively uncommon Flutter libraries. ChatGPT was able to generate all the screens, as well as the boilerplate code I needed to get it running, no problem. The issue is, though, ChatGPT isn’t perfect. Sometimes, it will rename a variable in your code, or change the name of an object. The good news, though, is that these issues tend to be pretty easy to fix if you have a little programming experience — they’re almost all runtime and syntax errors. I haven’t seen ChatGPT make any logical errors at all so far. Even if you have very limited programming experience, you can literally copy-paste your error message into ChatGPT and it will often help you solve it.</p><p>The other thing I really like ChatGPT for is rubber ducking. Rubber ducking in computer programming is a process where you explain a problem to another person or — since computer programmers famously hate human interaction — an object like a rubber duck. Well, with ChatGPT, you can explain your problem to it and it will actually attempt to give you a working solution! Working this way has actually significantly reduced my debugging time for the code that I write.</p><p>In all, ChatGPT is an incredibly powerful piece of technology. In a lot of ways, it’s also a dangerous one — generating misinformation or propaganda in large quantities is going to be a cinch now. I think ChatGPT, and whatever its successors are, will fundamentally change the way that we work. I think it’s part of a transformation that began in the late 1990s, with the advent of Google. Now that technology like Google Search exists, a key part of being successful in any role is being able to figure out relevant information on your own. In other words, it’s no longer as important WHAT you know. The real question is whether you have the skill and resources to LEARN things that you don’t know. ChatGPT is just one step further along the same process. As these technologies become more refined, understanding the nitty-gritty, low-level details of how your industry works is going to become less and less relevant. Instead, we’re going to have to understand what questions to ask to get the results we want.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cb71c0be439" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MediaPipe on Windows: A Tale of Woe]]></title>
            <link>https://ritvik-mandyam.medium.com/mediapipe-on-windows-a-tale-of-woe-4c4d848b4dab?source=rss-438347f74145------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c4d848b4dab</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[mediapipe]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Ritvik Mandyam]]></dc:creator>
            <pubDate>Mon, 11 Jan 2021 07:38:27 GMT</pubDate>
            <atom:updated>2021-01-11T07:38:27.952Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>One of the big challenges of using AI, and particularly deep learning, in production is the immense amount of processing power that the average deep learning-based model requires in order to run. For instance, the current state-of-the-art model for image classification is called (with no apparent sense of irony) EfficientNet. This model has 480 <em>million</em> parameters. Processing a single image on the average desktop CPU using such a model would take several seconds. This latency is just fine for a research model. In fact, such a large model would typically be run on a GPU, increasing throughput several times over. Challenges begin to arise when you want to use deep learning models on more resource-constrained environments where GPUs are not available. For example, I was recently working on a pipeline that used several neural networks. The pipeline itself was nothing particularly fancy — face detection and recognition, gaze tracking, object detection plus a few other bells and whistles for pre- and post-processing. The issue was, I had to be able to run this pipeline on Intel Atom machines from around a decade ago. These machines did not have GPUs, and internet access was too unreliable for me to stream data to the cloud for processing. As if that wasn’t bad enough, the machines ran Windows. Running a deep learning pipeline on a bare-metal Linux machine without a Docker container keeping things clean is painful enough as it is, but getting it to run on Windows is basically rocket surgery. After many experiments with various models, I found that I could achieve one or two frames per second at BEST with my pipeline in TensorFlow. This was nowhere near fast enough, so I said a hopeless prayer to Yoshua Bengio and dove into MediaPipe.</p><h3>What the heck is a MediaPipe?</h3><p>MediaPipe is Google’s offering for real-time, cross-platform media processing using machine learning. It includes several incredibly fast models purpose-built for resource-constrained environments. There are pre-trained models available for human pose estimation, iris tracking, hair segmentation, object detection and several other tasks. Unfortunately, though, MediaPipe’s Windows support — at least on bare-metal — is experimental. It works extremely well once you get it set up and squeeze a compiled binary out of it, but getting it to compile on Windows without using WSL is… Challenging. After a day of cursing out everyone at Google from Sundar Pichai downwards, I finally managed to get it working. In this post, I want to try and document some of the stumbling blocks I hit.</p><h3>Setting Up</h3><p>Note: For this section, I’ll be using “XX” to represent values which may change based on versions/environments.</p><p>MediaPipe requires several additional pieces of tooling to be installed on Windows before you can compile it. The first of these is <a href="https://www.msys2.org/">MSYS2</a>, a set of tools allowing you to build and run native code more easily on Windows. This one is reasonably straightforward to install — download the installer, run it and let it set itself up. One thing to note, though, is that the path to the folder you install MSYS2 into cannot contain any spaces, accents or non-ASCII characters. It also cannot be a symlink or a network drive. Most of those are not really huge issues, but the no-spaces requirement means that the usual <strong>C:\Program Files</strong> is completely out of the question as an installation directory. I would recommend just going with the installer’s default choice of <strong>C:\msysXX</strong> if you have admin rights. Once the installation is done, add <strong>C:\msysXX\usr\bin</strong> (or whatever install directory you chose) to your <strong>%PATH%</strong> variable. Then, pull up command prompt/powershell and run</p><p><strong>pacman -S git patch unzip</strong></p><p>This will install the packages you need to compile MediaPipe.</p><p>Up next, we need to install <a href="https://www.python.org/downloads/windows/">Python</a>. This, too, is reasonably straightforward, but you do need to make sure you allow the installer to modify your <strong>%PATH%</strong> variable. My install uses Python 3.8.7, I haven’t tested any of the other versions yet.</p><p>Next, we need the Visual C++ Build Tools. This part is rather finicky, so I would suggest paying particularly close attention while doing this step. First, go to <a href="https://visualstudio.microsoft.com/visual-cpp-build-tools">this link</a>, download and install the build tools installer. Once it’s done, open it up and let it load. Under the “Workloads” tab, find “C++ build tools” and select it. Under the optional components section, select “MSVC vXXX — VS 2019 C++ x64/x86 build tools”. Then allow them to install. Do not, repeat, DO NOT install the Windows 10 SDK from here. Seriously, don’t do it, it will almost certainly break things. Instead, go <a href="https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/">here</a>, download the standalone installer and install.</p><p>Once the Build Tools are installed, grab bazel version 3.4 or higher from <a href="https://github.com/bazelbuild/bazel/releases">here</a>. There isn’t really much to install here, it’s just an executable that you can use. However, to keep things simple, I would recommend placing this executable somewhere without spaces or non-ASCII characters in the path as well — personally, I like <strong>C:\development</strong>. Once you’re done, add the directory containing the bazel executable to your <strong>%PATH%</strong> variable. Then, set the following variables for bazel:</p><p><strong>set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools</strong></p><p><strong>set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC</strong></p><p>The official documentation suggests that you manually set variables specifying the WinSDK and Visual C++ versions. I would recommend against doing this, because setting those two variables consistently broke my install. Bazel will automatically figure out the versions of these tools to use from the variables we already set.</p><p>Next, grab <a href="https://opencv.org/releases/">OpenCV</a> and install version 3.4.10. You can install it to wherever you want, but MediaPipe’s default configuration expects it to be at <strong>C:\opencv</strong>, so for simplicity’s sake I suggest installing it there.</p><p>We’re almost done now — checkout the MediaPipe git repository using</p><p><strong>git clone </strong><a href="https://github.com/google/mediapipe.git"><strong>https://github.com/google/mediapipe.git</strong></a></p><p>Once again, I’d suggest following the no-spaces, ASCII-only paths rule. For my installation, I dumped the MediaPipe repository into <strong>C:\development</strong>, too.</p><p>Next, a crucially important step — go into your Python installation directory (<strong>C:\Program Files\Python38 </strong>for me) and copy “python.exe” to a directory that follows the no-spaces, ASCII-only rule. Once again, I used “<strong>C:\development</strong>”.</p><p>At long last, we’re done! You should now be able to <strong>cd</strong> into the MediaPipe repository and build the examples. Some of them have various bugs which need to be patched in order to run on Windows, but the “Hello World” program should let us get our dependencies set up and make sure everything is working correctly. Enter the MediaPipe repository and run</p><p><strong>bazel build -c opt — define MEDIAPIPE_DISABLE_GPU=1 — action_env PYTHON_BIN_PATH=”&lt;wherever you copied python.exe to&gt;” mediapipe/examples/desktop/hello_world</strong></p><p>With a little luck, everything will compile fine. Then, run</p><p><strong>set GLOG_logtostderr=1</strong></p><p>to get it to print output to the console. After that, you can test your compiled executable by running</p><p><strong>bazel-bin\mediapipe\examples\desktop\hello_world\hello_world.exe</strong></p><p>You should see it print the words, “Hello World!” to console a bunch of times.</p><p>I really hope this article makes it a little easier for you to get up and running with MediaPipe than it was for me. If it did, maybe leave me a clap so I can inflate my big head just a little bit more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c4d848b4dab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI Analogy]]></title>
            <link>https://ritvik-mandyam.medium.com/building-an-ai-analogy-d556abf75905?source=rss-438347f74145------2</link>
            <guid isPermaLink="false">https://medium.com/p/d556abf75905</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Ritvik Mandyam]]></dc:creator>
            <pubDate>Tue, 17 Nov 2020 07:17:13 GMT</pubDate>
            <atom:updated>2020-11-17T07:17:13.861Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the things I really struggled with in terms of AI was seeing it in terms of something I already understood. I really like having an intuitive sense of how things work, and there seems to be a shortage of analogies for what exactly a neural network does. So far, the best analogy I’ve come up with is an office building.</p><p>Now, keep in mind that I don’t intend this to be a precise, technical explanation of how AI works. I think the overall picture of what AI does is simple enough to explain without resorting to convoluted pontifications about stochastic gradient descent. Personally, I use this analogy to find problems that I can “throw” AI at: if the hypothetical office building I’m about to describe could be used to perform a certain function, there’s a good chance AI could, too.</p><p>I can already hear the infuriated cries of, “But how?”, so allow me to explain. Let’s pretend our AI is represented by this building:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pv8RWuWjsX8N3soj" /></figure><p>Like any other office building, there are several people who work on each floor of the building. They each perform a slightly different task, and they all contribute to the overall functioning of the building. Given that this blog is about AI, I think we should give our building a more AI-related function — let’s say it looks at your hospital records and predicts the likelihood that you’ll fall ill within a given week. Your hospital records are basically a row in a table detailing when you were at the hospital last, what illness you had then, how many times you’ve been to the hospital and other data in like vein. Your hospital has a similar row in the table for each patient who visits it.</p><p>So one sunny morning, your hospital goes to this building and gives them your records. On the ground floor, each employee looks at one single piece of data from the records — say your date of birth or the number of times you’ve visited the ER in the past year — and comes up with a probability that you will fall ill that week, given only that one piece of data. Let’s say you’ve had a particularly rough year, and you’ve visited the ER nine times so far in 2020. You don’t need to be a machine capable of analysing millions of datapoints to say that you’re rather more likely than most to fall ill within any given week than most people. The employee looking at your ER visit count, in fact, estimates that your propensity for injury means that you have a 70% chance of falling ill that week. The employee looking at your body weight notices that it’s at the outer edges of the healthy range and says that you have a 20% chance of falling ill that week. The rest of the people on the ground floor will come up with probabilities based on each of the remaining pieces of data, as well.</p><p>The people on the first floor look at the probabilities the people on the ground floor give them. The people on the second floor follow a slightly different set of rules when they decide your likelihood of falling ill. For instance, one of the people on the first floor knows that the number of hospital visits you’ve made in recent history is a much bigger factor in whether or not you fall ill than your weight, so they decide that, overall, you’re 60% likely to fall ill. Each of the guys on the first floor perform a similar analysis, coming up with probabilities that you’ll fall ill while taking into account the various probabilities that the people on the ground floor gave them.</p><p>At each floor, the employees do the same thing. Using their knowledge of progressively more complicated probabilities — meta-patterns in probability, as it were — they make sense of the simpler probabilities from the floor below. Eventually, the people on the top floor look at all the probabilities they receive from the floors below them and decide whether or not you’re going to fall sick that week. This week, to your good fortune, they predict that you’ll be just fine.</p><p>Then, on Wednesday evening, you slip and fall in the bath and turn up at the ER once more. Your hospital, naturally, is more than a little upset with our building — they had one job, and they couldn’t even do that right. They go to the people on the top floor and tell them, “Look, you bunch of morons, you told me my client would be as healthy as a horse, but now they’re stuck in bed with a hip injury!” The people on the top floor, being rather more cool-headed than the people from your hospital, decide to look at the probabilities they received from the floor below them again. They notice that three of the probabilities they received estimate a 60% chance, 80% chance and 90% chance of you falling ill, while the remaining estimates all show a 30% or lower chance of you falling sick. Clearly, some of these estimates are closer to the truth than others. The people at the top floor decide to give more importance to probabilities from the three people that said you’d fall sick, and a little less importance to the six who said you wouldn’t. Up and down the building, similar checks are going on, with the people on each floor becoming slightly better at using the probabilities from the floor below them.</p><p>AI works pretty much exactly like this, except the floors of the building are called “layers” and the people are called “neurons”. The neurons in each layer compute probabilities and pass them to successive layers in a process called “forward propagation”. When the AI makes an inaccurate prediction, the neurons, like the people in our building, re-evaluate the way they use the data from the layer below them in order to account for that inaccuracy. This process of re-evaluation is called “backpropagation” and is what makes AI as powerful as it is.</p><p>Now, the interesting thing about this particular office building is that it’s not bound to figuring out how to stop you falling over once a month. In fact, let’s say the hospital eventually stops bringing its custom to this building. Instead, an e-commerce company provides the building with a table containing customer demographics and asks them to find out if that customer will buy a cell phone this week. At first, the people in the building are terrible at it. After all, they only know how to tell if you’re going to hurt yourself this week or not. Over time, though, the people on each floor start to change the way they analyze probabilities. Eventually, they get even better at this new task than they were at their old one. The people working in this office building are supremely adaptable. They can (in theory) figure out a way to map any two sets of related numbers.</p><p>This is what makes AI so neat. In order to translate a sentence from one language to another, all you have to do is assign a number to each word in the languages and then give our office building the numbers, and they’ll work out how to give you the translation. You can give them the numbers that describe an image of a basketball and they can figure out its coordinates in the image.</p><p>The problem with AI lies in the fact that in order to be good at predicting something, our office building needs to see lots of examples of it. In order to tell you whether or not a is a cat or not with accuracy comparable to a human, for instance, it would need to see thousands, perhaps even millions of pictures of cats and also of things which are not cats. In recent years, we have generated enough data to be able to perform analyses like this. The ads that you see on the internet, for example, which seem to be listening to your thoughts… In a sense, they are. They look at the things you’ve searched for recently and predict things you may be interested in, and as a result of the billions of searches that are made on a daily basis, they’ve gotten uncannily good at it.</p><p>Like any analogy, this one is limited in its applicability. It’s not accurate to the math by any means. Even so, I think it’s a useful shortcut for coming up with potential use cases for AI. Maybe it will help you come up with ways to use AI, too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d556abf75905" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Musky Debate]]></title>
            <link>https://ritvik-mandyam.medium.com/a-musky-debate-afa8a005e5f6?source=rss-438347f74145------2</link>
            <guid isPermaLink="false">https://medium.com/p/afa8a005e5f6</guid>
            <category><![CDATA[gpt-2]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[elon-musk]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ritvik Mandyam]]></dc:creator>
            <pubDate>Thu, 18 Jul 2019 13:44:05 GMT</pubDate>
            <atom:updated>2019-07-18T13:44:05.453Z</atom:updated>
            <content:encoded><![CDATA[<p>In early 2019, OpenAI released an extremely controversial model they called GPT-2. GPT stands for Generative Pre-Training. For now, it’s enough to know that GPT is a very effective way to get artificial intelligence to comprehend unstructured English text, such as the contents of this article or the text of a book.</p><p>We’ve wanted computers to be able to write in plain English for a long time now. After all, normal human beings speak English. Even as a computer programmer, I find it annoying to have to figure out what exactly a ProgramBufferStackUnderflowError is. Wouldn’t it be great if our computers could tell us exactly what was wrong with them (“I’m afraid I can’t do that, Dave.”)? GPT-2 is the closest we’ve come to being able to do that. For the record, by the way, the closest we’ve come so far is pretty good — <a href="https://pbs.twimg.com/media/DzYpsJOU0AA1PO9.png:large">this story</a> about English-speaking unicorns is coherent most of the way through, and while there are some things in it that sound a little strange, the sentences make sense, and the article looks like something a human could have produced.</p><p>The controversy around this model has to do with what it means for society when computers are able to generate realistic text. What’s to stop someone with nefarious intent from generating slanderous content <em>en masse</em> using this model, for instance? How are we preventing the Donald Trumps of the world from using GPT-2 to generate their tweets (although, of course, GPT-2 may actually produce more coherent tweets than the dear old POTUS — I still haven’t forgotten <em>covfefe.)</em>? Given that this open-source code, meaning that anyone with a computer can go online and get access to the GPT-2 model, the answer is, not much.</p><p>These are legitimate problems, and they are problems that OpenAI considered. When they released the code for this AI, they refused to release the largest and most effective iteration, electing instead to release a smaller, pared-back version. Personally, I disagree with this decision, but that’s another thought and another post.</p><p>First off, I’d like to say that my goal here is not to dismiss arguments about the ethics of using AI. Over the past few years, we’ve discovered an extremely powerful tool, and like any tool, whether that tool is used for good or evil depends on who wields it. When the bad guys get their hands on AI-guided drones, we’re definitely in deep trouble. Instead, I’d like to point a couple of things out about technology through the ages, and also about OpenAI itself.</p><p>500 years before Christ, there lived a philosopher by the name of Plato. He was, as they say, kind of a big deal. His musings on life, the universe and everything are read and forgotten by philosophy students to this day. When Plato was alive, the newest piece of tech around was writing — committing ideas to paper instead of to memory. This, <a href="https://www.goodreads.com/quotes/259062-if-men-learn-this-it-will-implant-forgetfulness-in-their">Plato wrote</a>, would make us forgetful, because we would resort to reading what we wrote down instead of memorizing. Today, I think most of us would disagree with Plato. Indeed, many of us write things down in order to be able to remember them better in the future. To me, OpenAI — and their personal prophetic equivalent, Elon Musk — are very much like Plato. They look at the technology around them and form opinions about it. We must remember, however, that those opinions — and they are opinions, no matter how experienced the expert who opines may be — can be wrong.</p><p>Throughout history, every new technology, from writing to the smartphone, has been scorned. Humanity’s greatest skill, historically, has been ripping any new piece of tech a new backside. Why, then, do we assume that GPT-2 is different? Is it because it runs on a computer? Is it because it’s more complex than most technology we’ve been called upon to comprehend, and we are therefore more willing to trust the experts? Or is it — and I think it is — because <a href="https://www.vox.com/future-perfect/2018/11/2/18053418/elon-musk-artificial-intelligence-google-deepmind-openai">Elon Musk says it</a>?</p><p>Now, fair warning, I am about to say I disagree with Elon Musk. As such, I would appreciate it very much if Mr. Musk’s more fervent admirers could keep all the offensive things they have to say about me very much to themselves. My problem with Musk’s approach to AI is that he has a horse in the AI race. I mistrust Musk’s pronouncements about AI for the same reason I mistrust McDonald’s comments about obesity or Marlbro’s opinions on cigarettes. After all, Tesla’s much-loved autopilot feature uses AI, not black magic. Musk positions himself as having the good of humanity at heart, but let’s face it, the man is a CEO. Humanity almost certainly comes in a distant second to the health of his companies. By making doomsday predictions about AI, Musk is able to discourage investors from putting their money into other, less ethically-conscious machine learning companies.</p><p>I’m not saying we should all ignore Musk’s claims about the potential for abuse that AI has. We have incredibly powerful technology on our hands, and like any other powerful technology, we must consider the implications for society at large of the things we build. All I’m saying is that no matter how much we like OpenAI and the fact that our Teslas let us nap at the steering wheel, we should still strive to think critically about what we hear. After all, maybe Elon Musk is right, and one day our robot overlords will bring me a copy of this article and I’ll say, “Man, I was an idiot back then.” My only hope is that if that day comes, our robot overlords will be kind enough to let me have a slice of pizza and a cheeseburger every once in a while.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afa8a005e5f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So The AI Didn’t Work…]]></title>
            <link>https://ritvik-mandyam.medium.com/so-the-ai-didnt-work-848aca6e6fb7?source=rss-438347f74145------2</link>
            <guid isPermaLink="false">https://medium.com/p/848aca6e6fb7</guid>
            <category><![CDATA[failure]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Ritvik Mandyam]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 22:19:12 GMT</pubDate>
            <atom:updated>2019-04-08T22:19:12.670Z</atom:updated>
            <content:encoded><![CDATA[<h3>So That AI Didn’t Work…</h3><p>I’m a computer programmer. In 2019, if you’re just getting into computer programming, or even if you’re looking for a field to specialize in, AI’s probably a good one to pick. There’s enough of a gap in demand for AI programmers and supply of them that anyone who can build a neural network is almost guaranteed a job — at least until we finally make ourselves obsolete by creating an AI that can actually build other AIs.</p><p>In early 2018, I started work on an AI-related project. I wanted to build a system where you could take two videos, one of a teacher and one of a student, and compare them to each other. The idea was that you would be able to learn any skill, be that dancing or fencing or Michael Jordan’s three-pointer shot, just from a video of the person you wanted to learn from. You would take a video of, say, Tiger Woods’ golf swing and a video of your own golf swing. The AI would then compare the two and show you what all you were doing wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTnE0ypgLGCa6U4t-kMANQ.jpeg" /><figcaption>The screen for comparing videos</figcaption></figure><p>The system I wanted to build was one in which an AI would look at each of the videos and then perform pose estimation on them. It would figure out how each person was standing/sitting/whatever in each frame of the video in 3D space. It would then map that onto a mesh, just for easier viewing. The AI would go through the poses that it extracted and segment them into individual “motions”, which is essentially a segment during which the direction of movement of each individual limb we track is approximately the same. It would match the motions in each of the two videos to each other, synchronizing them such that the student’s mesh does any given motion at the same time as the teacher’s mesh. This is important because in general, the student’s video will not correspond exactly in length to the teacher’s. Even if they are exactly the same length, the probability is high that the student will do the motion in question at a different time than the teacher. Finally, we’d spit out these synchronized mesh animations for the user to scrub through using a timeline, highlighting for each “motion” the five bones that were most out of whack with each other.</p><p>Back when I was young and naive (ha, ha), I figured this should be a fairly simple project, one that I could accomplish on my own within a few months. Needless to say, I was wrong. Honestly, looking back, this seems less like a “Give me two weeks and a decent laptop” problem and more like a “Give me five years and a research team” problem. Naturally, with my limited knowledge of calculus, trajectories and algorithms, I completely failed to accomplish this lofty ambition. Nonetheless, I did manage to make some progress on the problem.</p><p>I managed to cobble together a pose lifter. I found a paper online called <a href="https://arxiv.org/abs/1701.00295">Lifting from the Deep</a> and implemented a network based loosely on it. By feeding it each frame of the video, one at a time, I was able to lift, frame-by-frame, the poses from each video. The problem was, I intended this to be a commercial endeavour, which meant I couldn’t use the research-only dataset that they used to train it. In my blissful ignorance, I decided that this meant I should create, completely from scratch, my own dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*BiloZ_J85ye8f681x4pEGw.png" /><figcaption>The Poor Man’s Motion Capture Studio</figcaption></figure><p>Creating such a dataset requires two data streams: One RGB data stream, which would be the input for the pose estimation network, and one motion capture stream, which would encapsulate the pose the person was performing in each frame of the video. Without the several thousands of dollars it would have taken to create such a system professionally, we resorted to DIY. We collected 24 smartphones from our neighbours and constructed 8 stands out of PVC pipes, each of which would would carry 3 phones. We also got our hands on the cameras from two XBox Kinects for the motion capture. Several failed experiments with PVC pipes and one really bad python video-recording script later, we came up with a system that has been (poorly) rendered above.</p><p>Each of the kinect cameras connected to a laptop with some software on it to record the motion capture data. Each of the phones also broadcast a video stream over wifi which were (intermittently, due to my abject failure to understand Python’s multithreading system) recorded. The idea was that we would then map from each of the RGB videos to the motion capture data using a neural network. The problem, naturally, was that with that much data flowing over wifi (the kinects were also connected to each other over a wifi connection), our poor, belaboured router had no hope whatever of keeping up. Hours of effort rendered absolutely useless, just like that.</p><p>The component I really got stuck on was the one that is supposed to synchronise the videos. I just don’t understand this tech well enough to be able to segment the videos into motions and then map them onto each other — I figured cosine distance might work, but I’m not sure because frankly, I haven’t gotten that far with it yet. I’m also having trouble constructing a network capable of processing two sets of videos into frames simultaneously. Using the raw video sequences seems altogether too memory intensive, and I really wanted to avoid using the lifted poses because that would make the system slower. One thing I’ve been considering is using a non-machine learning-driven method to do this, maybe split at the points where there is a change of direction of some given magnitude.</p><p>I’m writing this post primarily in the hope that I’ll be able to get in touch with someone with more knowledge and experience in this field. Come to that, someone with as much knowledge and experience as me would probably work, too — after all, two brains are better than one, right? If you have any interest in this, either in terms of working on it or learning more about it, feel free to leave me a response on this post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=848aca6e6fb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>