<?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 Liuba on Medium]]></title>
        <description><![CDATA[Stories by Liuba on Medium]]></description>
        <link>https://medium.com/@liuba1156?source=rss-6bfe6f1061c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*d_486HS0gWwgWa39DUy4Lw.png</url>
            <title>Stories by Liuba on Medium</title>
            <link>https://medium.com/@liuba1156?source=rss-6bfe6f1061c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:14:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@liuba1156/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[Why Ramanujan summation is actually -3/32]]></title>
            <link>https://liuba1156.medium.com/why-ramanujan-summation-is-actually-3-32-eebce119202c?source=rss-6bfe6f1061c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/eebce119202c</guid>
            <category><![CDATA[string-theory]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[ramanujan]]></category>
            <category><![CDATA[math]]></category>
            <dc:creator><![CDATA[Liuba]]></dc:creator>
            <pubDate>Mon, 01 Mar 2021 05:10:53 GMT</pubDate>
            <atom:updated>2021-03-01T05:13:00.716Z</atom:updated>
            <content:encoded><![CDATA[<p>Few weeks ago my roommate effusively started telling me that the sum of all natural numbers is –1/12, that is:</p><blockquote><em>1+2+3+4+5+6+7+8 +… = –1/12</em></blockquote><p>I was quite surprised with this statement, specially hearing it from an engineering graduate student.</p><p>I myself have a Math background. I studied infinite series back and forth at the beginning of my career, and know some possible leaks that can appear in a demonstration of series convergence. Hence, I already knew what the trick was here, and also I know for a fact that this polemical sum actually equals -3/32. What most surprised me is discovering that the Ramanujan summation is used in string theory and quantum mechanics. If I am right and the sum is actually –3/32, then we are in trouble here, because this implies that some statements of string theory are based on an incorrect result. Will this impact string theory field?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*DFg-JOQZvBkvKTi5nqmi2A.jpeg" /></figure><p>First, let me convince you that the sum is -3/32.</p><p>I will prove the following two series:</p><blockquote><em>1–1+1–1+1–1+… = 1/2</em></blockquote><blockquote><em>1–2+3–4+5–6+… = 1/4</em></blockquote><p>The two results will then be used to prove that 1+2+3+4+5+6+…=–3/32</p><p>Let’s take the first series and denote it by A:</p><blockquote><em>A = 1–1+1–1+1–1+…</em></blockquote><p>Now substract A from 1:</p><blockquote><em>1–A = 1–(1–1+1–1+1–…) =1–1+1–1+1–1+1–…</em></blockquote><p>Look familiar? You are right, we got A again! Therefore,</p><blockquote><em>1–A = A</em></blockquote><blockquote><em>1=2A</em></blockquote><blockquote><em>A = 1/2</em></blockquote><p>Now, let’s take the second series and denote it by B:</p><blockquote><em>B=1–2+3–4+5–6+…</em></blockquote><p>Then we have that</p><blockquote><em>B–A = (1–2+3–4+5–6+…)–(1–1+1–1+1–…)</em></blockquote><blockquote><em>B–A = (1–2+3–4+5–6+…) –1+1–1+1–1+…</em></blockquote><p>Rearranging a little bit we get:</p><blockquote><em>B–A = (1–1)+(–2+1)+(3–1)+(–4+1)+(5–1)+(–6+1)+…</em></blockquote><blockquote><em>B–A = 0–1+2–3+4–5+6–7+…</em></blockquote><blockquote><em>B–A = –B</em></blockquote><blockquote><em>2B = A</em></blockquote><p>But A = 1/2, therefore</p><blockquote><em>2B = 1/2</em></blockquote><blockquote><em>B = 1/4</em></blockquote><p>Finally, let’s analyze C = 1+2+3+4+5+6+7+8+9+…</p><blockquote><em>C–3B = (1+2+3+4+5+6+7+8+9+…) — (3–6+9–12+15–18+…)</em></blockquote><blockquote><em>C–3B = (1+2+3+4+5+6+7+8+9+…) –3+6–9+12–15+18-…</em></blockquote><p>We will rearrange as follows:</p><blockquote><em>C–3B = (1+2–3) + (3+6) + (4+5–9) + (6+12) + (7+8–15) +(9+18)+ …</em></blockquote><p>where last term comes from the second summand <em>3B</em> and the first one or two terms come from<em> C</em>.</p><p>When realizing the sum inside the parentheses, we get the following:</p><blockquote><em>C–3B= 0 + 9 + 0 + 18+0+27+0+… = 9+18+27+…</em></blockquote><blockquote><em>C–3B = 9(1+2+3+…) = 9C</em></blockquote><blockquote><em>B = –8C</em></blockquote><p>But B = 3/4. So, substituting:</p><blockquote><em>3/4 = –8C</em></blockquote><blockquote><em>C = –3/32</em></blockquote><p>We have proven that</p><blockquote><strong><em>1+2+3+4+5+6+7+8+9+… = –3/32</em></strong></blockquote><p>Mind blowing, isn’t it?</p><p>Obviously, as you might have guessed, this summation has also been proven to be -1/12. Is there a particular reason of why we should choose -1/12 rather than -3/32? What about any other number (yes, by rearranging the series we can actually get to any number we want!).</p><p>The main concern I have is in how would string theory change if we use my proof instead of Ramanujan summation? I know nothing about string theory, but I am really curious of possible effects that might occur. Let me know your opinion about this. I would be happy to have a discussion and learn of what you think about this topic!</p><p>Best,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*PCZHaIuAkHpF9fWOmiaE_Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eebce119202c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Optimal Transport]]></title>
            <link>https://medium.com/analytics-vidhya/introduction-to-optimal-transport-fd1816d51086?source=rss-6bfe6f1061c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd1816d51086</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[optimal-transport]]></category>
            <category><![CDATA[shape-matching]]></category>
            <dc:creator><![CDATA[Liuba]]></dc:creator>
            <pubDate>Sun, 19 Apr 2020 23:27:54 GMT</pubDate>
            <atom:updated>2024-01-23T07:59:35.646Z</atom:updated>
            <content:encoded><![CDATA[<p>Optimal Transport (OT) is a mathematical field used in many interesting and popular tasks, such as image segmentation, image restoration, computer vision, data analysis, etc., and in general, OT can be useful for those tasks involving a density distribution.</p><p>I started using <a href="https://www.analyticsvidhya.com/blog/2022/02/optimal-resource-allocation-using-python/">Optimal Transport</a> tools to characterize the functional neural connections in the brain of patients with different neurological disorders. After appropriate preprocessing, I obtained the eigenvalues of the neural graph of each patient and used it as a feature vector. Since the vector of eigenvalues in Euclidean spaces of different dimensions, it was difficult to compute the distance between the vectors of eigenvalues of each graph. Hence, I decided to take advantage of OT theory, which provides the means to compare distributions in different dimensions <em>(among many other wonderful use cases)</em>. When I started digging into OT, I noticed the lack of introductory information to ease my beginning in the field. After battling my way through, I decided to make this small tutorial of Optimal Transport. With this tutorial, I am fulfilling one of my TODO things of finally creating a Medium post! I am very excited about this and please, feel free to reach to me if anything is unclear.</p><p>It all started with <strong>Gaspart Monge (1746–1818) </strong>when he stated the problem of moving a large pile of sand <em>(which shape can be thought of as a probability distribution)</em> to a target pile with a prescribed shape <em>(or probability distribution) </em>with minimal effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*G9olSlGBDUeAsv6t5xGohQ.png" /><figcaption>How to move pile <strong><em>X</em></strong> to the shape of pile <strong>Y</strong> with minimal effort? I.e. given a cost function <strong>c(x,y)</strong> of moving a grain <strong>x∈X</strong> to the position <strong>y∈Y</strong>, what is the optimal displacement of all <strong>X </strong>to <strong>Y</strong>?</figcaption></figure><p>As repetition always helps for understanding the problem better, I will paraphrase the question: what is the optimal transformation <strong>T </strong>to move several items <em>(discrete distributions) </em>from one place to another? Similarly for the continuous case, what is the <a href="https://www.analyticsvidhya.com/blog/2022/02/optimal-resource-allocation-using-python/">optimal transformation </a><strong>T </strong>to move one density function to another?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeR-e4CeuYE4qnFKEO390g.png" /></figure><p>OT is an optimization problem which goal is to minimize the cost of transportation. We will see that OT is actually a linear program, making the problem more manageable.</p><h3>Optimal Transport between histograms and discrete measures</h3><p><strong>Definition 1: </strong>A <strong>probability vector<em> </em></strong><em>(also known as </em><strong><em>histogram</em></strong><em>) </em><strong>a </strong>is a vector with positive entries that sum to one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*7jfKXkV8IzLyieC7YI1y0A.png" /></figure><p>The <strong>probability simplex </strong>Σₙ is the set of all histograms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*Z2bJkwUYvmdMKvUtm0jXHw.png" /></figure><p><strong>Definition 2: </strong>A <strong>discrete measure α</strong> represents weighted points in space X. Namely,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/147/1*s1V90HXaDK8RHxoQcbTY2g.png" /></figure><p>where <strong>a </strong>is vector of weights and x₁,…, xn ∈X are the locations. As usual, δ<strong>ₓ</strong> is the Dirac’s function, which equals <em>1</em> at location <em>x</em> and<em> 0</em> everywhere else.</p><p>Let us take the simplest case: two uniform probability vectors <strong>a</strong> and <strong>b </strong>of same size <em>n. </em>Let <strong>(Cᵢ ⱼ)</strong> be the associated cost matrix of moving the entry <em>i</em> of <strong>a</strong> to the entry <em>j </em>of <strong>b </strong><em>(sometimes the entries are called bins in the context of OT)</em>. Since each bin of <strong>a</strong> and <strong>b</strong> are uniform and equals 1/n, we are not concerned about mass transportation yet. Therefore, we only seek the optimal permutation σ that minimizes the transport cost.</p><p>Namely, find:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*GGmBXjDz9fax-guCajnREA.png" /></figure><p>Although the factor 1/n is not necessary in this particular optimization problem, we shall keep it for a natural generalization to mass transportation. This problem is called the<strong> assignment problem.</strong></p><p>Let’s point out that the solution is not unique. Consider the following example of transporting x<strong>ᵢ</strong> →y<strong>ⱼ</strong> , for i,j ∈{1,2}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*_CXo7v17JbE7bjD1IKX0HQ.png" /><figcaption>The cost of transporting x<strong>ᵢ</strong> →y<strong>ⱼ</strong> is 1 for all i,j</figcaption></figure><p>The cost matrix is (Cᵢ ⱼ) is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/1*JlLIJ6IXEHINyqAogtTqPQ.png" /></figure><p>Only two permutations are possible in this case, and the cost of both of the permutations is 2. Hence, both are a solution to the assignment problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*l_mn25oPFJJZhEG9.gif" /></figure><p>Let us move on to a more general case: probability vectors/discrete distributions with different masses. Since we cannot transport a bin of some mass to another bin with different mass, we have a new restriction to take care of.</p><p>Namely, if <em>α, β </em>are discrete measures</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*Io8L11A_Q5fzubSnOdRzpg.png" /></figure><p>We have to find a function <em>T</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*8a_789kG9DSK0gCPDze5kQ.png" /></figure><p>This function is called <strong>push forward operator </strong>and the mass conservation condition is compactly denoted as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/117/1*M951jl3SYVwxIuNsaw-SDg.png" /></figure><p>This problem, known as the <strong>Monge problem, </strong>is similar to the assignment problem but with mass conservation addition. In complete form, it is written as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*T4pBzv2OKWT6vJC_PjF7eA.png" /></figure><p><strong>Example of a push forward operator:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*NE4y2ZVFWPWN1TtN6TbGKA.png" /><figcaption>Transporting blue dots to the red dot and fulfilling that the sum of masses of the blue dots equal the mass of the red one.</figcaption></figure><p>What if the probability distributions do not match up? Let us consider a final generalization, which accounts for this problem by allowing the mass at any point x_i to be dispatched across several locations. This flexibility is known as Kantorovich relaxation.</p><p>In place of a permutation<em> σ</em> or a map <em>T</em>, a coupling matrix<em> P</em> ∈ R^{n×m} is sought. P_{i,j} describes the amount of mass flowing from bin<em> i</em> to bin<em> j</em>. Note that, to be admissible, the matrix P must satisfy that the sum of masses outgoing from a location equals to the total mass of that location. Similarly, the sum of masses transported to a location must equal the total mass of the target location.</p><p>Mathematically, the set of admissible couplings is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*x6vBZbl2u9hOIw16fFROMQ.png" /></figure><p>The generalized optimal problem reads as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*g_FJtS7RIxDwWLalvK2a5Q.png" /></figure><p>and it is known<strong> Kantorovich transport problem.</strong></p><p>By allowing mass splitting, we make the problem symmetric, in the sense that if P is a coupling matrix to transport between (a,b) , then the transpose of P is a coupling matrix between (b,a).</p><p>Note that the constraints and the problem is linear, making the Kantorovich optimal problem a linear program.</p><p>Another very interesting and extremely useful result is that, if the cost matrix C encodes the distance D, then the Kantorovich optimal transport is actually a distance, known as the <strong>Wasserstein distance</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*25K9YHSS0p0mx5tbK14HFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*Y7iMSjV2Fuji_n5Q.gif" /></figure><p>The Wasserstein distance is getting increasingly popular in Artificial Neural Networks as a loss function, since it leverages physical ideas (mass displacement) and geometry (cost function). For instance, some types of Generative Adversarial Neural Networks (GANs) use this distance.</p><p>Last thing before ending the introduction to discrete measures, we will state the dual optimization problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*8DX9AIRxLgYznX6wUx3Guw.png" /></figure><p>with the set of admissible dual variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*DXgi2PCLdEPIbg7AcJNl8w.png" /></figure><p>The dual problem is important to calculate the gradient of the Wasserstein distance, which is useful to minimize the loss function in the Neural Network. We will revise it thoroughly through the next tutorials.</p><h3>Optimal Transport between arbitrary measures</h3><p>For the sake of completeness, and in case you need it as I did in some of my projects, I will leave the optimal transport equations for arbitrary measures. The definitions are basically the same as for discrete measures.</p><p><strong>Definition 3</strong>: An arbitrary measure <em>α </em>on <em>(X,d)</em>, being <em>d</em> a distance, can be assessed by integrating it with a continuous function <em>f(x)</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/149/1*IEe_paGVMeaHgMUHQ1zj5w.png" /></figure><p>The set of all measures for which the above integral is finite is known as the set of Radon measures <em>M(X)</em>.</p><p>The <strong>push forward measure:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*qF5T5EaGAYLOR1Q0JtIT8Q.png" /></figure><p><strong>Monge problem for arbitrary measures:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*LGFIszSn93VqskHLGMeOHg.png" /></figure><p><strong>Admissible couplings of arbitrary measures:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*ZJd8D3-BtE_xU2UcvVI_UQ.png" /></figure><p>Below you can see an example of a coupling π between two arbitrary measures. By mentally integrating π on the horizontal axis, one can note that the integral coincides with <em>β</em>. Analogously with <em>α </em>through the integration on the vertical axis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*gK6gBPMar2pdF3ynIjLRRw.png" /><figcaption>Graphs were taken from Computational Optimal Transport book, written by Gabriel Peyré and Marco Cuturi</figcaption></figure><p><strong>Kantorovich optimal transport problem for arbitrary measures:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*PDXPe4bzgnyBy_M4KC33jw.png" /></figure><p>If X=Y and c(x,y)=d(x,y), then the <strong>Wasserstein distance for arbitrary measures </strong>is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*ktkBFwmsIpEuFfkq7vVajQ.png" /></figure><p>Now we know what the Assignment, Monge and Kantorovich problems are, and we have defined the Wasserstein distance. In the following tutorials, I will tell you how to find a solution to those problems. In addition, we will revise the gradients of the Wasserstein distance, which are necessary to find good estimators of distributions.</p><p>I hope that you have enjoyed reading my first post and looking forward to see you next time!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*D-XpX9VSxbvpk-Ay" /></figure><h3><strong>Bibliography</strong></h3><ol><li><a href="http://www.gpeyre.com/">Gabriel Peyré</a> and <a href="http://marcocuturi.net/">Marco Cuturi</a>, <a href="https://arxiv.org/abs/1803.00567"><em>Computational Optimal Transport</em></a>, ArXiv:1803.00567, 2018</li><li><a href="https://optimaltransport.github.io/">https://optimaltransport.github.io/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd1816d51086" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/introduction-to-optimal-transport-fd1816d51086">Introduction to Optimal Transport</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>