<?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 Sanyam Agarwal on Medium]]></title>
        <description><![CDATA[Stories by Sanyam Agarwal on Medium]]></description>
        <link>https://medium.com/@sanyamagarwal?source=rss-e6b696edbf39------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*33eizDEU0AnyvBdw.jpg</url>
            <title>Stories by Sanyam Agarwal on Medium</title>
            <link>https://medium.com/@sanyamagarwal?source=rss-e6b696edbf39------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:00:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanyamagarwal/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[Probability by counting method: does order matter?]]></title>
            <link>https://medium.com/@sanyamagarwal/probability-by-counting-method-does-order-matter-119244310ed2?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/119244310ed2</guid>
            <category><![CDATA[probability]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Fri, 01 May 2020 17:46:30 GMT</pubDate>
            <atom:updated>2020-05-01T19:20:23.015Z</atom:updated>
            <content:encoded><![CDATA[<p>Short answer: Most of the times it does. To see when it doesn’t read along ;)</p><p><strong>Counting method</strong></p><p>What’s the probability that a dice roll will return an even number. Well it’s 3/6 or 1/2. There are six equally possible outcomes and there are 3 favorable outcomes — 2, 4, and 6. So 3/6 or 1/2. This is what the counting method of probability tells us.</p><p><strong>It’s flawed?</strong></p><p>What’s the probability that a dice roll will return 4. Well it’s 1/6. We all know that. Or do we? What if I say that there are only two possible outcomes — either the dice returns 4or it doesn’t. So the answer should be 1/2. Yeah? Well, the catch is that in the counting method the numerator and denominator counts should be all equally likely. Apples to apples. The dice returning 4 is five times less likely than dice not returning 4.</p><p>If I were you, I’d be curious if there was a formal way of differentiating between apples and oranges. Well I always relied on my intuition until a friend asked me this question. I could see why that’s a hard thing to do. So I’ve set to formalize my intuition a bit. I am not sure if this formalism exists in any book. So take what I say here with a grain of salt and skepticism.</p><p>Okay, you’ve been warned enough. Now I’ll start defining somethings and inventing new words. Here’s one:-</p><p><strong>Basis</strong>: a set of equally likely events.</p><p>In all questions where you are asked to calculate a probability there is always a basis. It may be explicitly written or it may be implicit. Let’s see with examples.</p><p>1 — All dice roll questions have the implicit basis that each face is equally likely to appear. Basis = {1, 2, 3, 4, 5, 6}</p><p>2 — All coin toss (when coin is fair) questions have the implicit basis that tail is as likely to appear as head. Basis = {H, T}</p><p>One important property of a basis is that the cross product of basis with another basis is also a basis. (Aside: The elements of the resultant basis are basically pairs of two event — one from each basis. The events in those pairs follow the AND semantics.)</p><p>By extension, the cross product of a basis with itself is also a basis. For, eg.</p><p>{H, T} x {H, T} = {HH, HT, TH, TT} is also a basis.</p><p>So depending on what the question is asking. You can change into the desired basis.</p><p><strong>Basis count</strong>: The number of elements in a subset of basis.</p><p>Hopefully, you got the gist of what basis is! It’s super important to understand for the punchline — the counting method of probability only works if both numerator and denominator are expressed as <strong>basis counts</strong> of the <strong>same basis</strong>.</p><p>So… does order matter? Well, it matters if your basis (or derived basis) contains different elements for each ordering. And since cross-products are order-sensitive, any orderings arising out of that should be counted separately.</p><p>So… when does order not matter? In my experience, the only place where I have seen order not mattering was where basis was artificially created that way and explicitly defined in the problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=119244310ed2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Happiness vs Meaning? : Life Goals — part 1]]></title>
            <link>https://medium.com/@sanyamagarwal/happiness-vs-meaning-life-goals-part-1-ac34a1ca4630?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac34a1ca4630</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[meaning-of-life]]></category>
            <category><![CDATA[meaning]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Sat, 07 Jul 2018 21:29:38 GMT</pubDate>
            <atom:updated>2018-07-08T19:30:10.544Z</atom:updated>
            <content:encoded><![CDATA[<p>Do we chase happiness in life? Why are so many people unsatisfied in their lives? Is happiness that hard to find? Or do we chase something else which is more elusive than just happiness? Which is it?</p><h3>Happiness?</h3><p>Most people would have you believe that it’s happiness. Okay, cool. But since a lot people are unsatisfied this must mean happiness is hard to find. But these same people would also admit that happiness can be created from within. You can meditate — forget about the petty things in the world, rise above, etc. — and start feeling good about yourself and stay happy. Another set of people would tell you that happiness is to be found in the fact that you are alive, they ask you to wonder at the beauty of life, the fact that it even exists, etc. Yet another set of people would ask you to compare your life to someone who has met with a tragedy, a beggar on the street, to a differently-abled person, etc. so that you feel more grateful for your life and somehow find happiness in that. (Side note: Actually it’s hard for me to believe that some people manage to find happiness in a poor person’s misery. While I do feel grateful for the life I have when I compare my life to an unfortunate person, I do not feel very happy. I feel scared and guilty. Guilty because that poor person could have very well been me and it feels like I owe them my fortune.)</p><p>It’s think its true. Once your basic human needs (air, water, food, shelter, sleep, etc.) are met and you are mostly free of major diseases then getting happiness is just a matter of convincing your own mind! Yet, a vast proportion of the people whose basic needs are met and are disease free are unsatisfied, why?</p><h3>Something else?</h3><p>Then, it’s clearly not just happiness that we seek. At this point some people will jump and say that. Yeah there are other things also that must be considered — need for friends, respect in society, blah blah…. But to me this just seems like beating around the bush. I am a fan of the occam’s razor and I am searching for a single objective that can explain the behavior of humans to a larger degree than by which it makes assumptions.</p><p>So the rules of this search are simple. We need just one rule (one human desire) that explains the phenomena of a lot people being unsatisfied despite having easier alternatives to getting happiness.</p><p>What is the insatiable desire that never gets fulfilled? While I am nowhere close to the complete answer I think I may have made some headway into the problem. A few weeks ago I posted this on my Facebook:</p><blockquote>Random thought: The more I think, the more I realize that humans don’t chase happiness. Happiness is just a temporary side effect. I think the state we really chase can be called “power/freedom to exercise will” for the lack of a better phrase/word. We like to maximize the control we have over our circumstances (even if they are favourable). And this is also synonymous with what life is.</blockquote><blockquote>Life is order in a chaotic universe. Imagine an inverse pendulum trying keep its balance in a randomly changing wind setup. What’s more “alive” according to you: 1) an inverse pendulum that is encased in a glass jar or 2) an inverse pendulum that can stabilize itself even in the random winds (even if it comes dangerously close to tipping over some times)?</blockquote><blockquote>Ps: My thoughts are still fuzzy on this. I hope to write a full blog post on this once I have a clearer perspective.</blockquote><p>As you can see I sound very confused and incoherent above. But one of my friends somehow connected to what I was trying to get at and pointed out that this is exactly what AI researchers refer to as “Empowerment”. But he asked me to NOT look at the literature and continue pursuing my inner thoughts. He also suggested that there might be a third element at play here — meaning. So that’s what I did. I pursued my inner thoughts and tried to see if I could somehow integrate meaning into the equation. I came up with a hypothesis which connects “meaning”, “power/freedom to exercise will” (aka “Empowerment”) and life itself.</p><h3>Hypothesis 1: Humans desire being more “alive”</h3><p><strong>Fact 1: Life is order among chaos.</strong></p><p>If you agree you can jump to the next section. Otherwise, I’ll try to explain this with a home-made intuition.</p><p>It’s a miracle that life exists in a chaotic universe like ours. But it still does because of the fact that life is what people who study chaos theory refer to as an “attractor state”. Without getting too much into the theory I’d like to give you an intuition.</p><p>Imagine that you have a flat and very very wide plate with a shallow depth. Hold the plate horizontally and put a tiny point-sized marble on it. Now if you tilt the plate even slightly the marble starts rolling to one side. If you tilt it back to the other side, the marble rolls back. Now if keep I tilting the plate randomly the marble will keep changing its position. If I ask you to predict the position of the marble at any given time, you’d have no clue (it could be anywhere). Because this system is very chaotic.</p><p>Now, let’s say, I punch a tiny point-sized depression (only slightly bigger than the size of the marble) of a finite depth at some place in the plate. Even though the probability of the point-sized marble ever coming directly over the point-sized depression in the plate is extremely small, once the marble comes over it, it’s going to stay there forever (or until you tilt too much)!. Now, we can confidently say that as time increases, the probability of that marble being in that depression increases.</p><p>In this analogy, the position of the marble is in a very vague sense the state of the universe. The random tilts are the chaotic nature of the universe we live in. And life is the point-sized depression. It’s an attractor state because once the universe reaches that state, it’s likely to stay in it. Think about it, billions of cells in your body constantly try to restore the delicate balance of life in you despite random external events. Almost any other random permutation of the atoms in your body would disintegrate in a nanoseconds. Yet your current state is very stable.</p><p><strong>Fact 2: “Meaning” requires order and control</strong></p><p>This is easy to see. There are less ways to make something meaningful than there are to make it meaningless. A drawing made by scribbling colors at random has no meaning (unless you are a billionaire who buys such paintings for a million dollars). A random sequence of notes does not make a melody. A meaningful creation or a work of art requires careful reiterations to get it perfect. Chaos has no meaning. Meaning requires order.</p><p>This holds true in life as well. A meaningful life requires you to be either very lucky or have excellent control over your circumstances. (Tip: If you want to know whether your life has been meaningful up till now. A summary of it should make up for an exciting story.)</p><p><strong>Claim 1</strong>: Ability to have a meaningful life is a strong signal of being more “alive”. Why? Because</p><p><strong>Fact 1: More “alive” == More control over circumstances</strong></p><p><strong>Fact 2: Meaningful life ==&gt; Ability to control circumstances</strong></p><p>Combining facts 1 and 2 we can directly prove claim 1.</p><p><strong>Note</strong>: Having meaning in life is one of the possibly many possible ways of proving to yourself that you are more “alive”. I am not claiming that this is the only way.</p><h3>What makes for a meaningful life?</h3><p>Let’s ask what sets apart an interesting story from a boring one? In almost all interesting stories you’ll find a hero/heroine/agent who is faced with a situation which they must get out of or face some consequence. The rules of the game are defined and the agent must follow the rules of the game and find a way out.</p><p>Life is quite similar. One must declare a goal ahead of time and strive to achieve it. The rules of the “game” are defined by our moral values. For e.g. you may declare that you will never rob a bank or kill an animal to get the money you need even if takes you to your goal faster.</p><p>The more ambitious goal you keep the more meaningful your life could **potentially** be. You have to follow up your ambitions with your actions to get that full potential. In life you will face a lot of adversarial circumstances. At these times you either adapt and change your goal or find another way to achieve your goal. The less you have to change your goals the more meaningful your life becomes.</p><p><strong>Why are so many people unsatisfied?</strong></p><p>People are unsatisfied because they want to always want to be more “alive” than people around them. In other words, people want their life to be more meaningful than other people’s lives. Now everyone’s life, can’t be more meaningful than everyone else’s. This is almost a zero sum game. Some people will have to lose for others to win. And nobody wants to lose. We are hard-wired to try to win. We have evolved this way.</p><p>But there maybe a ways to make life less zero-sum gamey. If all people did not play the same “game” maybe more people can be happy. Maybe in another blog post I’ll try to explain this.</p><h3>Conclusion</h3><p>In a nutshell, happiness is the feeling you get when things go your way but you feel more “alive” when they go the way YOU wanted. Winning a 1000$ lottery might make you feel happy but it will not make you feel more “alive”. But wanting to earning even 10$ and being able to reliably do exactly that is evidence that YOU are in perfect control over the situation.</p><p>In conclusion, I think now I have even more respect for various forms of art. Everything we humans do from science and engineering to music, acting, painting, dance, etc. is as pure as life itself! It’s all about finding that one specific combination that has meaning among countless meaningless ones!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac34a1ca4630" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My thoughts on Skip-Thoughts]]></title>
            <link>https://medium.com/@sanyamagarwal/my-thoughts-on-skip-thoughts-a3e773605efa?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3e773605efa</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Sun, 31 Dec 2017 18:26:49 GMT</pubDate>
            <atom:updated>2017-12-31T18:26:49.121Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of a project I was working on, I had to read the research paper <a href="https://arxiv.org/abs/1506.06726">Skip-Thought Vectors by Kiros et. al</a> with a magnifying glass and also <a href="https://github.com/sanyam5/skip-thoughts">implement it in PyTorch</a>. In this process, I learnt quite a lot about why Skip-Thought works so well despite being very straightforward in principle. In this blog, I would like to share what goes behind the scenes in Skip-Thoughts — small things that actually make it work.</p><p>My GitHub implementation: <a href="https://github.com/sanyam5/skip-thoughts">https://github.com/sanyam5/skip-thoughts</a></p><h3>Prerequisites</h3><p>This blog assumes basic familiarity with Neural Networks and Back Propagation. If you are not familiar with these terms I strongly suggest reading about them from online resources — <a href="https://www.youtube.com/watch?v=aircAruvnKk">Video: Neural Network </a>, <a href="https://www.youtube.com/watch?v=Ilg3gGewQ5U">Video: Back Propagation</a>, <a href="https://www.youtube.com/watch?v=IHZwWFHWa-w">Video: Gradient Descent</a>, <a href="http://www.deeplearningbook.org/">Book: Deep Learning</a>, <a href="http://colah.github.io/">Blog by Christopher Olah</a></p><h3>Basics</h3><p>If you’ve already read the Skip-Thoughts paper you may skip this part.</p><p><strong>Q. So, what the hell is this Skip-Thought or Thought Vector thingy?</strong></p><p>“Skip-Thought Vectors” or simply “Skip-Thoughts” is name given to a simple Neural Networks model for learning fixed length representations of sentences in any Natural Language without any labelled data or supervised learning. The only supervision/training signal Skip-Thoughts uses is the ordering of sentences in a natural language corpus.</p><p><strong>Q. Why are fixed size representations of sentences needed?</strong></p><p>Fixed representations make it easy to replace any sentence with an equivalent vector of numbers. This makes the process of understanding, acting upon or responding to Natural Language mathematically straightforward. Some examples of such tasks are</p><ul><li>the task of telling whether two sentences are semantically similar in meaning.</li><li>the task of classifying whether a given statement is positive or negative.</li></ul><p>One strategy is to learn fixed length representations of individual words as done in <a href="https://arxiv.org/abs/1310.4546">Word2Vec</a>. One famous result from Word2Vec is the following:</p><p><em>[king] -[man] +[woman] </em>≃<em> [queen]</em></p><p>where [<strong>x</strong>] represents the vector representation of the word <strong>x</strong>. But the order of words in the sentence matters as well — “Ram hit Shyam” and “Shyam hit Ram” are two different sentences. Just having word representations of the constituent words leaves the problem of making sense of the order to the user.</p><p>A better way is to have a Neural Network also take care of the order of words in a complete sentence which is exactly what Skip-Thoughts does. But, why stop at sentences? Why not parse complete paragraphs or documents? True, parsing complete paragraphs could generate even better representations. But in Skip-Thoughts we settle for a middle ground between words and paragraphs.</p><p><strong>Model</strong></p><p>Skip-Thoughts model has three parts:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*fotfcOw7EAAPb4R9Ge3m1A.png" /><figcaption>Skip Thoughts model overview</figcaption></figure><p>Skip-Thoughts model has three parts:-</p><ul><li><strong>Encoder Network</strong>: Takes the sentence <strong>x(i)</strong> at index <strong>i </strong>and generates a fixed length representation <strong>z(i)</strong>. This is a recurrent network (generally GRU or LSTM) that takes the words in a sentence sequentially.</li><li><strong>Previous Decoder Network</strong>: Takes the embedding <strong>z(i)</strong> and “tries” to generate the sentence <strong>x(i-1)</strong>. This also is a recurrent network (generally GRU or LSTM) that generates the sentence sequentially.</li><li><strong>Next Decoder Network</strong>: Takes the embedding <strong>z(i)</strong> and “tries” to generate the sentence <strong>x(i+1)</strong>. Again a recurrent network similar to the Previous Decoder Network.</li></ul><p><strong>Q. How is it trained?</strong></p><p>Skip-Thoughts uses the order of the sentences to “self-supervise” itself. <strong>The underlying assumption here is that whatever, in the content of a sentence, leads to a better reconstruction of the neighbouring sentences is also the essence of the sentence.</strong></p><p>The decoders are trained to minimise the reconstruction error of the previous and the next sentences given the embedding<strong> z(i)</strong>. This reconstruction error is back-propagated to the Encoder which now has a “motivation” to pack as much information about sentence <strong>x(i)</strong> that will help the Decoders minimise the error in generating the previous and next sentences.</p><p><strong>Q. What does it learn?</strong></p><p>The end product of Skip-Thoughts is the Encoder. The Decoders are thrown away after training. The trained encoder can then be used to generate fixed length representations of sentences which can be used for several downstream tasks such as sentiment classification, semantic similarity, etc.</p><p>The <strong>representations of semantically similar sentences are closer</strong>. For example, the representation of 1) “<em>he ran his hand inside his coat , double-checking that the unopened letter was still there</em>” AND 2) “<em>he slipped his hand between his coat and his shirt , where the folded copies lay in a brown envelope</em>” are very close by.</p><p>Seems convincing, right? Well, not so fast…</p><h3>A teeny-tiny problem</h3><p>The Encoder is just fine but the Decoder has been assigned a herculean task. Consider this:-</p><p>Given any sentence it very hard even for a human to tell the sentences, word for word, that can occur before or after that. Try, for example, the sentence “I opened the door”. The possibilities that can precede and succeed this sentence are enormous. Also, sentences similar in meaning such as “We went to the market” and “We went for shopping” are not treated same. The Skip-Thought Decoder is tasked with predicting the <strong><em>exact</em></strong> sentence word for word. So, if a human finds this tough, how is it possible for Skip-Thoughts to predict the neighbouring sentences? How is this even a valid training signal?</p><p>Take a moment to convince yourself of difficulty of predicting exactly the neighbouring sentences because understanding what follows depends on it.</p><h3>Taking a closer look at the Decoder</h3><p>Let’s take a closer look at the model and try to understand why Skip-Thought works.</p><p>Again, Skip-Thoughts Encoder is plain and simple. But the Decoders are a bit tricky. There are two key factors at play here.</p><ol><li>Teacher forcing:- The Decoders generate the sentence word-by-word while being fed the words of the true target sentence from the corpus with a delay of one time-step (see figure below). The teacher forcing is done for 100% of the words being predicted.</li><li>The prediction is a probability distribution over words that could occur at that position given the context z(i) of a neighbouring sentence and the sequence of words that occurred before the current position.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*nPO6fTW2dVdUA0RWpWZAUQ.png" /><figcaption>Unrolling the Decoder in time: The input to the Decoder at every time-step is the Z(i) embedding from the Encoder (in green), the actual words in the target sentence (in blue), the previous hidden state. The output is a distribution over the possibilities of words. In the third time-step, it becomes easy for the Decoder to output “the” instead of “to” as it knows for a fact that the actual word preceding it is “approached” and not “went”.</figcaption></figure><p>Training now becomes easy. Decoding is guided not only by the context of z(i) but also by actual words in the target sentence which convey both the grammatical and semantic cues to the Decoder as it generates the target sequentially.</p><p><strong>Q. But why 100% teacher forcing? Will that not lead to poor generalisation?</strong></p><p>It’s not immediately clear to the reader the reason for supplying true previous words at <strong><em>every</em></strong> time-step. Generally when RNNs are trained for sequence prediction they are randomly (with some probability split) given either i) the true previous label and ii) their own predicted label. Giving RNNs their own predicted labels as feedback helps them generalise better at predicting sequences at inference time (since there are no “true” labels at inference time). There are two possible explanations for why Skip-Thoughts doesn’t used reduced levels of teacher forcing:</p><p><strong>Naive Explanation</strong>: Since we are anyways going throw away Decoders we don’t care for the performance at inference time we <strong>don’t need to reduce</strong> teacher forcing.</p><p><strong>Better Explanation</strong>: Teacher forcing was never meant for producing sequences of words. It exists only as a means for facilitating better word-level predictions by providing the information of preceding words from the true sentences. So <strong>reducing teacher forcing is not a matter of choice</strong> or inconvenience. Reducing teacher forcing will reduce accuracy.</p><p>In the next section I will further motivate why the second explanation makes more sense.</p><h3><strong>Comparison with Imputation of missing words from sentences</strong></h3><p>Let’s modify the model a bit. We will predict just one missing word (can be any word) of the next (or previous) sentences given i) the context <strong>z(i)</strong> of current sentence and ii) the sequence of words and location of the blank (signifying the missing word) in the next (or previous) sentence. See the model architecture below for clarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*kZWv2ornOvPj3q6E5ZGdAA.png" /><figcaption>Imputation: Guessing the missing words given all other words and the context of a neighbouring sentence</figcaption></figure><p>One sensible way to provide all but one element of sequence is by using a bidirectional RNN. The forward RNN captures all words before the blank and a backward RNN captures all words after the blank.</p><ul><li>Why RNNs? Because they are well suited for variable length sequences. CNNs disregard ordering.</li><li>Why two RNNs? It is possible to use just one RNN and provide the complete sentence with a <em>&lt;fill_this_blank&gt;</em> token at the blank position. But a more natural choice is having a forward and backward RNN.</li></ul><p>One possible design of the decoder is as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*u45-9NsHbh9jxgp_8ZWrtw.png" /><figcaption>Imputing the missing word: Decoder model</figcaption></figure><p>Notice something? If we remove the Backward RNN from this model it becomes <strong>essentially the same as the Decoder of Skip-Thoughts model</strong>. What seemed like 100% teacher forcing in Skip-Thoughts was actually an half-way measure to what it was truly trying to achieve — Imputation of missing words in the neighboring sentences.</p><h3>Alternate designs for Decoder</h3><p>Based on our insight that Skip-Thoughts is just half-way to the Imputation of Missing Words model, we can claim that whatever works for Imputation Decoders will also work for Skip-Thoughts Decoders. This means one could easily use CNNs (for getting the context for previous/next k words) for Decoding.</p><p><strong>Q. Why does the Skip-Thoughts not use a Backward RNN?</strong></p><p>Using a Backward RNN would clearly increase accuracy and it is unclear to me why it was not used in the first place. I do not know a concrete answer to that but my guess is that using a Backward RNN would make generating sentences impossible using the Decoders. But there are two counters to this explaination:-</p><ol><li>One can always separately train a one-way Decoder (with just a Forward RNN) <em>after</em> the Encoder has been trained using a Bidirectional Decoder (with both Forward and Backward RNN).</li><li>Skip-Thought burnt the bridge of generating coherent sentences the moment it used 100% teacher forcing. This means generating sentences was probably not that important. Not sure on this one, though.</li></ol><h3>Final thoughts</h3><p><strong>Q. What do the decoders actually learn then?</strong></p><p><strong>TL;DR</strong>: The decoders learn to fill missing words from sentences given neighbouring sentences.</p><p>Both decoders learn primarily two things. First, the grammar. For example knowing that “approached” is not followed by “to”. Learning grammar helps the Decoders avoid grammatical mistakes in an otherwise semantically similar sentence. Second, distribution over words at position <strong>p</strong> given i) the context <strong>z(i)</strong> of a neighbouring sentence and ii) the words<strong> x(i)[0:p] </strong>occurring <em>before</em> the position <strong>p </strong>(0-indexed).</p><p><strong>Q. What does the encoder learn?</strong></p><p>The Encoder learns to extract and pack the information in a sentence that helps decoder better predict the words of the previous/next sentences.</p><p>It is amazing, at least to me, that this information indeed captures some semantics of the sentences as indicated by admirable accuracy on several downstream NLP tasks such as semantic similarity, sentiment classification, etc.</p><p>— — — —</p><p>Thank You!</p><p>Do checkout my implementation at GitHub: <a href="https://github.com/sanyam5/skip-thoughts">https://github.com/sanyam5/skip-thoughts</a></p><p>Please leave comments below. I would love to hear your thoughts on why you think Skip-Thoughts work. Also, let me know if I missed something.</p><p>Note: I originally published this post at my personal blog <a href="http://sanyam5.github.io/my-thoughts-on-skip-thoughts/">http://sanyam5.github.io/my-thoughts-on-skip-thoughts/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3e773605efa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Attentive Recurrent Comparators]]></title>
            <link>https://medium.com/@sanyamagarwal/understanding-attentive-recurrent-comparators-ea1b741da5c3?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1b741da5c3</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Mon, 28 Aug 2017 14:05:13 GMT</pubDate>
            <atom:updated>2017-08-28T14:05:13.131Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently came across an <a href="https://arxiv.org/abs/1703.00767">ICML’17 paper “Attentive Recurrent Comparators”</a> which proposes a simple yet powerful model for data efficient learning. The paper presents the <strong>first super-human </strong>One-shot Classification performance on the Omniglot dataset using only raw pixel information!</p><p>In this blog post I am going to present my understanding of the main ideas of the paper. The authors of the paper also released an <a href="https://github.com/pranv/ARC">implementation using Theano</a>. But I found the implementation a bit difficult to follow. So as an exercise I actually went ahead and <a href="https://github.com/sanyam5/arc-pytorch">re-implemented it in PyTorch</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*H_d1qTYwXEjLW8bF2d4Fjg.gif" /><figcaption>ARC comparing two similar characters from the Omniglot dataset. The ARC uses an attention mechanism to look back and forth between the two images and judge their similarity. Source: <a href="https://github.com/sanyam5/arc-pytorch">https://github.com/sanyam5/arc-pytorch</a></figcaption></figure><h3>Motivation</h3><p>Data-efficient machine learning is the buzz phrase right now. The idea is to design ML algorithms that perform well but don’t require 100’s of thousands of annotated data points. An ideal ML algorithm would require just one data point to learn an entire concept. Such a concept learning system is said to be a One-shot Learning system. The challenge with doing One-shot Learning is due to the difficulty in having <strong><em>Dynamic Representations</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3tYUKDFgqN9Z-QBnkxnpQ.png" /></figure><p>Imagine a system trained on images of buildings, cars and animals. If the new concepts of fruits and faces are introduced, the current feature set consisting of wheels, fur, windshield, trunk etc., are virtually useless to identify them. The authors call the representations that are formed by observing a fixed set of features <strong><em>Static Representations</em></strong>. It is clear that the current feature set must evolve to include features that can recognize the new entities. Ideally, the model should be in control of what features it observes and how lower-level features combine to form higher-level features. The authors call the representations formed by observing a continually evolving set of features <strong><em>Dynamic Representations</em></strong>.</p><h3>Dynamic Representations</h3><p>Dynamic Representation is basically coming up with a feature set on the fly, lazily. When you see an apple — you start thinking of its color, shape. When you see a face — you start thinking about color of eyes, shape of the nose, etc.</p><p>One clever way of having Dynamic Representations is by encoding a given sample in the context of <em>other </em>samples. For example:</p><ol><li>When asked to differentiate between fruits like Apple, Orange, Guava, you try to form a representation of one fruit in terms of all others: How is Apple different from Orange and Guava?</li><li>Similarly, when asked to differentiate between faces, you try to understand how is Face A different from other faces in the dataset.</li></ol><h3>ARCs</h3><p>The paper first presents a simple model — <strong>“Attentive Recurrent Comparators”</strong> (ARCs) — for learning to differentiate between two given images. The model derives its motivation by observing how humans find points of difference between two given images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*uYZUvBHZVzlzbYa8bunwwA.png" /><figcaption>“Spot the difference”. Source <a href="https://commons.wikimedia.org/wiki/File:Spot_the_difference.png">https://commons.wikimedia.org/wiki/File:Spot_the_difference.png</a></figcaption></figure><p>A human trying to differentiate between pair of images will not try to understand everything about the first image before taking a look at the second image. It’s just too much data to process all at once, most of which will be irrelevant to the task. The human instead takes alternating looks to understand <em>what to look at</em>.</p><p>You might see something in the first image simply because it is not present in the other image or vice versa. ARCs incorporate this aspect into them by using attention. The Attention mechanism opens a pathway for the Neural Networks to “ask” for a portion of the data.</p><p>The ARC architecture makes a clever use of the attention mechanism. At every time step it takes “glimpses” alternating between the first image (Image A) and the second image (Image B) similar to the way a human doing ‘Spot The Difference’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*r9U18kOvgEVnNmeabOZW0A.png" /><figcaption>Source: Attentive Recurrent Comparators, ICML’17</figcaption></figure><p>At the heart of ARC is a “controller” which is basically a Recurrent Neural Network (RNN) which at every time step t, in its current hidden state h(t-1) takes as input a glimpse G(t) and moves to a new hidden state h(t). The way this glimpse is generated is interesting. A small Neural Network (not shown in the diagram) converts h(t-1) to omega(t). The omega(t) are what the paper calls the “glimpse parameters”. The omega(t) can be thought of as a tuple (x, y, delta) from which a glimpse centered at (x, y) and with a zoom factor of delta.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*EExpAobCQeBwZ1xgNwRfvA.png" /></figure><p>But, there is more to it. For a Neural Network to learn through gradient descent all functions used by it must be smooth (differentiable). It does not suffice to just <em>crop </em>a portion of the image and feed it as the glimpse. Soft or differentiable attention is used in modern Deep Learning for generating pixels of the glimpse by taking a weighted sum of ALL pixels in the image. The weights smoothly decay as one moves away from the pixels that the glimpse is trying to encode. The paper proposes using Cauchy decay kernels instead of the traditional Gaussian kernels. The reason for this choice is that Cauchy kernel is smoother than the Gaussian kernel (which decays too fast) and Neural Network learn smoother functions faster.</p><p>Though the RNN controller now has full control over where to focus it comes at the cost of “pixelating” if it tries to see larger regions. This is because the number of pixels in the glimpse are fixed and less than the number of pixels in the given image. The RNN controller must carefully choose what to see.</p><h3>ARC Binary Classifier</h3><p>So we have defined the architecture of ARCs. Let’s test it out on the simple binary classification task as a sanity check.</p><p>How about we take the final hidden state H(T) as these encodings and feed them to a simple Neural Network whose task would be to tell if the two images belong to the same class or not? Virtually any dataset with independant classes can be used for this type of training.This paper specifically uses the <a href="https://github.com/brendenlake/omniglot">Omniglot </a>and the CASIA Webface datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*Atg3yIELXm7it6BipLKUfg.png" /><figcaption>Feeding the encoding H(T) from ARC ( in red dotted box) to Linear Layer Classifier</figcaption></figure><p>The Omniglot data-set has alphabets from 50 languages and the challenge is to use only 30 of them for training and validation and test on the 20. This means the network must learn to differentiate between characters it has never even seen. At the risk of slight exaggeration, it’s like letting a Neural Network train on images of various types of Animals, various types of Cars and various types of Buildings and then giving it two different photos of two different fruits (which may or may not belong to the same species) expecting it to correctly predict whether they belong to the same species or not!</p><p>When I put to train my PyTorch <a href="https://github.com/sanyam5/arc-pytorch">implementation</a> of the ARCs , it worked liked a charm. It was so much fun to visualize the attention mechanism at work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*yoYsLHgUxVIcLvmp4w9-mg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*lTkQDF4Imlf6jijELeeW7Q.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Ljq1XcLYC0b1yo4VUD5sTQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*b28X_8tbccGvAGmlbCKTVQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*K1n5rhuebeghuL0MHUIPzA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*iLe7IMS2QzhPx_X3W42r3g.gif" /><figcaption>Attention focuses on seemingly similar areas of dissimilar characters. Source: <a href="https://github.com/sanyam5/arc-pytorch">https://github.com/sanyam5/arc-pytorch</a>.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*7kXkGtt57RUWTT2RarsDug.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*H_d1qTYwXEjLW8bF2d4Fjg.gif" /><figcaption>Attention flawlessly comparing corresponding portions in two images. Source: <a href="https://github.com/sanyam5/arc-pytorch">https://github.com/sanyam5/arc-pytorch</a></figcaption></figure><h3>One-shot Learning</h3><p>Okay, so how does this all tie back up to One-Shot Learning?</p><p>Well, we said we wanted ARCs to learn to encode images of an Apples in terms of images of Oranges and Guava. We want ARCs to learn to encode one data point with respect to the other data points (Dynamic Representations).</p><p>To understand how the authors use ARCs to achieve this, its first necessary to concretely define the objective. The paper’s main result is on the Omniglot One-shot Classification task, detailed below :</p><ol><li>Omniglot dataset contains characters from 50 alphabets or languages. Each language has variable number of characters. All characters in a language are drawn by 20 different individuals. Totally there are 1623 characters in the dataset.</li><li>You may use 30 of 50 languages for training and validation. (Connecting back to our analogy, this would be equivalent of doing training on various types of Animals, various types of Cars and various types of Buildings)</li><li>After training, the network is given a background set which contains just ONE image each for 20 characters in a language chosen at random from the remaining 20 languages. (Connecting this back to our analogy, the remaining 20 “languages” (classes) could be {Fruits, Faces, Tables, Chairs, etc}. Suppose the “language” chosen at random is Fruits then a background set would contain just one image of an apple, just one image of an orange, just one image of guava and so on.)</li><li>The network must now correctly classify a given test image T as belonging to the same class as one of the 20 characters whose images were given as the background set. (Connecting this back to our analogy, the test image could be different image of apple, or a different image of orange, etc. and the network must correctly classify it as an apple, orange, guava, etc..)</li></ol><p>The paper proposes 2 different models based on ARCs for One-shot Learning.</p><p><strong>Naive ARC Model</strong></p><p>Do pair-wise comparison of image T to every other image in the background-set and train a Linear layer (shown in purple in the image) to compute a similarity score (shown as grey circles at the very bottom of the image) very similar to the way we constructed the Binary ARC classifier. And then classify the image T as belonging to the class for which the score is maximum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*hbESKaE8zIYb810vpEpM2w.png" /></figure><p>This model is dead simple and it even gives decent results but there is just one tiny problem — consider you have only seen spherical fruits all your life, it probably doesn’t occur to you that shape of the fruit might be an important feature in classifying a fruit. We converted the pairwise encodings immediately into scores without considering what other features were considered while generating other pair-wise comparisons.</p><p>Let’s take an example. Let’s suppose that Image 1 = Apple, Image 2 = Orange, Image 3 = Guava. Assume that both Orange and Guava are spherical while Apple has a different shape. Assume that T is an another image of Orange which also has leaves attached to it on the top. Here’s what would happen</p><p>T vs. Image 1 (Apple)</p><ul><li>Color: Orange vs. Red(0.2/1), Shape is Different (0.2/1). Score of 0.4/2</li></ul><p>T vs. Image 2 (Orange)</p><ul><li>Leaves on top: Yes vs. No (0/1), Shape is slightly different (0.9/1). Score of 0.9 / 2</li></ul><p>T vs. Image 3 (Guava)</p><ul><li>Color: Orange vs. Green (0.2/1), Shape is slightly different (0.9/1). <strong>Score of 1.1 / 2</strong></li></ul><p>We just classified an image of an Orange as a Guava solely because we failed to consider that color in T vs. Image 2 (Orange) could be an important feature too. This happened because both T and Image 2 were orange in color. The encoding from ARC did not take this to be a valid feature.</p><p>If we had instead <em>combined </em>encodings (or representations) from all pair-wise comparisons it would have been obvious that Color is an important feature.</p><p><strong>21-way ARC</strong></p><p>One could say that this problem arises because we <em>chose </em>to make just a 2-way ARC took a 2 images at time and glanced at them alternatingly. What if we made a 21-way ARC that took 21 images (20 background and 1 test) and cycled through them?</p><p>In theory this should work and we should be able to get a representation of T with respect to the entire background set. It would theoretically be possible to train the network by asking it to predict 20 Yes/No decisions instead of just 1 Yes/No decision as we did in the ARC Binary Classifier.</p><p>All we would need then is a Linear Layer that converts this encoding into 20 outputs for each class in the background set as the probabilities of T belonging to the corresponding classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*CVFmXvK7Amlk8xqSRulD_Q.png" /><figcaption>An example of a 4-way ARC, analogous to a 21-way ARC.</figcaption></figure><p>But unfortunately this will be just to much data for the RNN controller to digest. This especially because the memory requirements of the controller grow quadratically with the increasing number of input images.</p><p><strong>Contextual ARC</strong></p><p>So the authors make a compromise. They suggest making 20 pairwise comparisons and feeding these 20 encodings arranged in any order to Bi-directional LSTM (BD-LSTM). Think of BD-LSTM as a black box that can take information from these 20 pair-wise encodings, merge information from all these encodings and then finally output a 20 <em>contextual</em> <em>encodings</em>. These 20 contextual encodings can then be again mapped to pair-wise similarity scores as before (probabilities of T belonging to the corresponding class).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*bXTvNx9CoiWZ11RW8duXjA.png" /></figure><p>The BD-LSTM approach can potentially deliver better results because of its ability to reconcile the encodings from all 20 pair-wise comparisons.</p><h3>Results</h3><p>Using simple ARC based models the authors achieve first superhuman One-shot Classification performance on the Omniglot dataset with a model that uses just raw pixel data. The Naive ARC model that uses convolutional feature extractors achieves <strong>97.75% </strong>and the Full Context variant gets<strong> 98.5%. </strong>It is remarkable given that human performance is at around<strong> 95.5%.</strong></p><h3>Conclusion</h3><p>I think this really was a novel and simple approach with good results. This is also a positive step towards achieving true Dynamic Representations.</p><p>Hope you liked it! Please leave any comments below. Checkout my implementation of the ARCs at <a href="https://github.com/sanyam5/arc-pytorch">https://github.com/sanyam5/arc-pytorch</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea1b741da5c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Management: Part 1]]></title>
            <link>https://medium.com/@sanyamagarwal/time-management-part-1-126d9a8f118f?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/126d9a8f118f</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[time-management]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Sun, 02 Apr 2017 19:50:12 GMT</pubDate>
            <atom:updated>2017-04-02T19:52:28.828Z</atom:updated>
            <content:encoded><![CDATA[<p>I want to do a startup at some point in my life. So I joined a young startup right out of college so that I could feel what it really takes to do a startup. I have been working there for almost an year now. And as with all young startups there is always a lot of stuff to do. I sleep more than most people. I <em>need </em>to sleep <em>at least</em> 8 hours a day in order to maintain sanity. I work 6 days a week. Working days are long and exhausting which means that whatever time I have left in the day is low quality and I cannot get much done. I just have just one lazy Sunday every week to keep my life in order — decompress, talk to friends and family, think about future plans or buy groceries, supplies, clothes etc.</p><p>Honestly, I find it hard to manage my time. So I have come up with a proposal to deal with it. Being a Computer Science engineer I draw inspirations from the way a CPU does context switch when working on multiple processes and how software engineers write comments while writing code[1]. I am also believer of the scientific method so I would like to clarify that this proposal is just a first draft. It will go through series of tests and improvements.</p><h3>Proposal- version 0.0</h3><p>Observe that:</p><ul><li>there is two types of work items that need to be done — mechanical (buying groceries, etc.) and intellectual — ones that require deep thinking(planning what to work on next, setting short term and long term goals, etc).</li><li>there is two types of time slots that you have in a week — 2 to 4 hours of low quality on every working day and a 14-hour long Sunday.</li></ul><p>Now, all I need to do is somehow match mechanical work items to low quality slots and work items that require some thought to hours on Sunday. Seems pretty straightforward though. Just make two to-do lists — one for mechanical work items and one for intellectual work items. What is the big deal?</p><p>Well, here’s the problem — there’s not as much mechanical work as there is low quality time in my life. So I end up (inefficiently) using the low quality time for intellectual work items.</p><p>I closely looked at the “intellectual” work items and found that some of them can be decomposed into an intellectual part and a mechanical part. But decomposing the intellectual part(done on a Sunday) and the mechanical part(to be done a few days later) is not easy because by the time you get to the mechanical part of the work item you have already lost the mental context that you gained from doing the intellectual part. Depending on the work item you may feel the urge to revisit and redo the intellectual part to make sure that you really remember the right context. But now this becomes inefficient because there is wasted effort.</p><h4>What can we do?</h4><p>Add some context.</p><p>At the time of adding the mechanical counterpart of a part-intellectual work item in a to-do list also include the <strong>context</strong>— answers to some questions that you expect your future self to ask (like a FAQ) before executing the mechanical part[1]. This way your future self can look at the mechanical counterpart and can refer to the context that you wrote earlier in case they have any doubt and go on to execute it.</p><p>Can I trust you?</p><p>But there is a more important ingredient than context in this to-do list — Trust. Think of this to-do list as a conversation between two different people — 1) <strong>Master</strong>: Your self on a Sunday giving out orders and 2) <strong>Slave</strong>: Your self on a working weekday blindly executing those orders. Unless the slave has extreme faith in the decision of the master he/she will keep second-guessing it and often repeating the intellectual work that master has already done. Trust is two-way street. Unless the master knows that the slave will go to great lengths to execute his/her orders he/she will pass redundant orders to make sure the work is done. How should master and slave go about establishing trust? Master must really think through every order that it passes on the slave. Slave must respect the decisions of the master (and not try to check the validity of those decisions by become master in low-quality time) and try its best to execute them without thinking too much.</p><p>That’s pretty much the first version of my proposal. I am going to live it for the next few weeks. If the proposal really turns out to effective I would find time to write Part-2 of this post :P</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=126d9a8f118f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Counting stars - A date with yourself.]]></title>
            <link>https://medium.com/@sanyamagarwal/counting-stars-a-date-with-yourself-b8cd6be71bdc?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8cd6be71bdc</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[meditation]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Tue, 19 Jan 2016 13:17:12 GMT</pubDate>
            <atom:updated>2016-01-19T13:27:21.244Z</atom:updated>
            <content:encoded><![CDATA[<p>Okay, try the following if you haven’t already.</p><p>Wake up in the middle of the night at some time you are least likely to see another soul outdoors. Dress up in comfortable clothes. Do not wear your mobile, watch, wallet, bracelets, wristbands, etc on yourself. Avoid carrying any keys. Hide your apartment keys under doormat or something if you must lock the apartment when you go out. Walk/drive ALONE to a nearby place where you can lie down comfortably. Preferably choose a place where there is there a lots of trees or flowing water or both and which is elevated enough that one can not see surrounding buildings while lying down. Lie down and take deep breaths. Inhale slowly, exhale slower. Try to take your mind off some distant honking of the traffic of the city that never sleeps. Can you see the stars studded in darkest portion of the night sky?</p><p>You feel the cool breeze brush your face. You can hear the rustling of leaves in the background. You feel the flowing water making a familiar noise. Your senses are dancing to the music of nature. Let your mind ease in to this music for sometime. You start feeling yourself. Think about the various parts of your body. You have already been taking deep breaths all this time. Can you feel your heart beat? It is pumping blood to each of the 37.2 trillion cells that form your body.</p><p>Now think of the vastness of the unbounded universe. Think of the immense time scale through it has existed . Think how quiet it it is in outer space. Slowly you feel your perceptions evaporating into nothing. Did your boss shout at you in front of your colleagues? Did you have to wear a fake smile when your friend got promoted? Do you think people will mock you if you try your hand at something new? Are you stuck in life? Do you think there’s enough time? Do you secretly harbor some desires but are too scared of people that you have dropped the whole idea of ever doing it in your life? The stars will keep shining for billions of years. If you are 30 right now you will most probably die of a heart attack after 60 years or so. Your heart… it will simply stop beating. And these 60 years will pass very quickly, much quicker than your previous 30 have elapsed.</p><p>Gazing stars on a cool night with absolutely no one around is my escape from society. It gives me the energy to do what I have to do. I don’t know about you… but when I am 90 years old and gazing at the stars I don’t want to have any regrets. That is why I take a pause from time to time and think of what would my future self would like my current self to do in this situation. This is in no way ensures that I don’t commit any mistakes in life. But I can have peace in the fact that I did what seemed best at every moment according the given knowledge.</p><p>Welcome to your life. Live it !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8cd6be71bdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tell me your mind.]]></title>
            <link>https://medium.com/@sanyamagarwal/tell-me-your-mind-da8f5fb5279d?source=rss-e6b696edbf39------2</link>
            <guid isPermaLink="false">https://medium.com/p/da8f5fb5279d</guid>
            <category><![CDATA[linguistics]]></category>
            <dc:creator><![CDATA[Sanyam Agarwal]]></dc:creator>
            <pubDate>Tue, 17 Mar 2015 11:39:57 GMT</pubDate>
            <atom:updated>2015-03-17T11:48:36.459Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tell me your experiences.</h3><p>For expressing what I have in mind will maybe take 50–100 sentences in English. Thats pretty good actually. Imagine a world where the concept of language is still elusive to man. A father doesn’t want his child to eat dirt. So maybe he would slap him whenever he eats dirt or something like that. Its only after a few iterations of that behavior that the child begins to understand that this organism(his father) does not mean to harm and that he doesn’t want me to eat dirt because thats gonna harm me. A series of “experiences” translated into knowledge.</p><p>Thanks to language. We can now do this in a more elegant way and in lesser time without much of these “experiences”. Now language has been there for tens of thousands of years. It is evolving slowly and till today retains its basic structure. Many other types of languages have been discovered in the mean time though — programming, short-hand,etc.</p><p>Now I am looking for the World A such that World A is to current world what current world was to a language-less world. In other words, I am asking for a new dimension of communication. A new language that will further ease the communication process.</p><p>The new language would be a middle path between the programming languages (that are extremely unambiguous, efficient, machine-readable but very limited in what they can express) and natural language( ambiguous, inefficient, only-human readable, extremely open in what they can express). This new language would be a trade-off between scope of expression and efficiency. People have tried to come up with things like UML for describing a software. But we need better than that. Something with a wider scope. But not so wide that it becomes inefficient. May not be machine readable.</p><p>If such a language is invented then people will not need to “experience” things before they get a full knowledge of a system. The learning curves will be shortened. Students can be trained faster. People will graduate faster. Companies would be less dependent on “experienced” employees. In essence the value of experience will be lessened. The world will be revolutionary and fast changing.</p><p>Are we capable of making such a language?</p><p>Yes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da8f5fb5279d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>