Shikhar Jaiswal2020-04-28T19:37:23+00:00https://shikharj.github.io/Shikhar JaiswalLiterature Recommendation - An Introduction to Statistical Learning with Applications in R by Gareth James, Daniela Witten, Trevor Hastie and Rob Tibshirani2020-01-15T00:00:00+00:00https://shikharj.github.io//2020/01/15/Literature-Recommendation-An-Introduction-to-Statistical-Learning-with-Applications-in-R-by-Gareth-James-Daniela-Witten-Trevor-Hastie-Rob-Tibshirani<p><img align="middle" src="/assets/AISLAR.png" /></p>
<p>This post should formally begin with a disclaimer, this book is merely intended as a rather easy introduction to applying Statistics and Probability in solving certain problems in Machine Learning. The authors themselves mention that the manuscript was developed as a gentler-sloped prequel to their seminal work <code class="language-plaintext highlighter-rouge">The Elements of Statistical Learning</code> by Hastie, Tibshirani and Friedman, which is a rather heavy-hitting book when it comes to mathematical density and depth.</p>
<p>While the book doesn’t mention any essential prerequisites, I would strongly recommend having prior familiarity with undergraduate level Probability theory, as the book only explains the concepts in passable manner. The chapters are pretty self-contained and can make up for really quick reads. Most of the material covered is a smaller, toned-down, applied version of the mathematical machinery depicted in the book mentioned above. The text is almost purely devoted to supervised learning, with unsupervised methods being introduced only towards the very end.</p>
<h2 id="the-writing-style">The Writing Style</h2>
<p>Since the focus is on Applied Machine Learning, there aren’t any proofs provided in the text. Also, throughout the text, the authors openly mention a concept without ever diving into it, or providing an idea behind the formulation. Concepts like <code class="language-plaintext highlighter-rouge">Confidence Interval</code>, <code class="language-plaintext highlighter-rouge">P-Value</code> and so on are freely used without providing a procedure for calculating them manually. While this can surely be a frustrating experience for less experienced people or folks who have learned and forgotten most of these concepts, the text still provides a reasonable amount of illumination when it comes down to individual topics, which are segregated into separate chapters for a better treatment. Overall, the book is a quite smooth read which focuses on breadth over depth, and shouldn’t pose much of a challenge to a sophomore level student of undergraduate CS.</p>
<h2 id="important-sections">Important Sections</h2>
<h3 id="chapters-1-2">Chapters 1-2</h3>
<p>The first couple of chapters focus on the overview of the field of <code class="language-plaintext highlighter-rouge">Statistical Learning</code>, as well as the notational semantics followed in the text. Broader explanations and examples of <code class="language-plaintext highlighter-rouge">Supervised and Unsupervised Learning</code>, <code class="language-plaintext highlighter-rouge">Prediction vs. Inference</code> dilemma, <code class="language-plaintext highlighter-rouge">Parametric and Non-Parametric</code> methods and <code class="language-plaintext highlighter-rouge">Regression vs. Classification</code> paradigms are provided. The second chapter ends with an introduction to the <code class="language-plaintext highlighter-rouge">Bias-Variance Tradeoff</code>, and how it comes into the broader picture of performance of statistical models. The later part of the book makes steady usage of the above terms in explaining most of the phenomenon that we encounter later.</p>
<h3 id="chapter-3">Chapter 3</h3>
<p>Next, we move onto introductory <code class="language-plaintext highlighter-rouge">Regression Theory</code>, which later gets applied for classification tasks in the next chapter, albeit with some minor subtleties. The initial exposition, along with the example of a single variable regression setting, is complimented with methodology of calculating coefficients estimates, as well as their <code class="language-plaintext highlighter-rouge">Confidence Intervals</code> using <code class="language-plaintext highlighter-rouge">Standard Error</code> estimates. <code class="language-plaintext highlighter-rouge">Null and Alternate Hypothesis</code>, <code class="language-plaintext highlighter-rouge">T-Statistic</code> and <code class="language-plaintext highlighter-rouge">P-Value</code> are also some important concepts introduced. The multivariate linear regression model is also developed from the single variable model, along with its set of measures for hypothesis testing. These linear models are then extended to handle non-linear relationships through the use of composite, non-linear combinations of predictor variables, while focussing on the issues that arise with such approaches.</p>
<h3 id="chapter-4">Chapter 4</h3>
<p>This section exposits the minor subtleties of extending the concepts of regression learnt previously in building classification models, namely through the <code class="language-plaintext highlighter-rouge">Logistic</code> model. This chapter also entails an introduction to <code class="language-plaintext highlighter-rouge">Bayesian Decision Theory</code>, mainly through the concept of <code class="language-plaintext highlighter-rouge">Likelihood Maximization</code> over <code class="language-plaintext highlighter-rouge">Gaussian</code> distributions, which is later used in explaining the rationale behind <code class="language-plaintext highlighter-rouge">Linear Discriminant Analysis</code> and its more flexible alternative - <code class="language-plaintext highlighter-rouge">Quadratic Discriminant Analysis</code>. The end subsection, detailing the performances of different methods on classification tasks under different settings is also particularly insightful.</p>
<h3 id="chapter-5">Chapter 5</h3>
<p>While the previous sections focus mainly on the theory, this chapter mainly deals with the best practises when it comes to fitting the models on real world data. In <code class="language-plaintext highlighter-rouge">Statistical Learning Theory</code>, <code class="language-plaintext highlighter-rouge">Resampling</code> is an indispensable tool when it comes to assessing and selecting models. In situations where data is not abundant, certain strategies such as <code class="language-plaintext highlighter-rouge">Validation</code>, <code class="language-plaintext highlighter-rouge">K-Fold Cross-Validation</code> and <code class="language-plaintext highlighter-rouge">Leave-One-Out Cross-Validation</code>, can be an essential tradeoff between model performance and computational costs while measuring the accuracy of the models. <code class="language-plaintext highlighter-rouge">Bootstrap</code> is yet another important technique coming into play for estimating the uncertainity with model parameters. A deep understanding of the complete material here is absolutely essential.</p>
<h3 id="chapter-6">Chapter 6</h3>
<p>In situations where the predictors outnumber the total observations, or where we simply wish to increase model interpretability through simplification, techniques such as <code class="language-plaintext highlighter-rouge">Subset Selection</code>, <code class="language-plaintext highlighter-rouge">Shrinkage / Regularization</code> and <code class="language-plaintext highlighter-rouge">Dimensionality Reduction</code> play a pivotal role. Such techniques also have their share of problems in the higher dimensional settings. Bear in mind that the authors of this book were also the original inventors of the <code class="language-plaintext highlighter-rouge">Lasso Regularization</code> technique and as such, their ideas are worth a strong look.</p>
<h3 id="chapter-7">Chapter 7</h3>
<p>Next, we focus solely on extending our linear models, in order to equip them with more predictive power through <code class="language-plaintext highlighter-rouge">Polynomial Regression</code>, <code class="language-plaintext highlighter-rouge">Step Function</code> and <code class="language-plaintext highlighter-rouge">Local Regression</code>, <code class="language-plaintext highlighter-rouge">Splines</code> and <code class="language-plaintext highlighter-rouge">Generalized Additive Models (GAMs)</code>. Tibshirani and Hastie were also the original inventors of the GAMs, and have published a book on the topic as well, so it shouldn’t come as a surprise that the coverage of the same is merely introductory in this chapter.</p>
<h3 id="chapter-8">Chapter 8</h3>
<p><code class="language-plaintext highlighter-rouge">Decision Trees</code> are one of the most powerful, yet intuitive, algorithms to be developed for classification and regression tasks. Unlike previous sections on linear models which are quite extensive, this section doesn’t go much broader than explaining a few error indices for classification and regression setting, and contrasting with linear models. The chapter concludes with a rather useful introduction to <code class="language-plaintext highlighter-rouge">Bagging</code>, <code class="language-plaintext highlighter-rouge">Random Forest</code> and <code class="language-plaintext highlighter-rouge">Boosting</code> techniques, and the marked effect of these under various situations.</p>
<h3 id="chapter-9">Chapter 9</h3>
<p><code class="language-plaintext highlighter-rouge">Support Vector Machines (SVMs)</code> are one of the most important concepts in <code class="language-plaintext highlighter-rouge">Statistical ML</code>. SVMs were the state-of-the-art to beat all throughout the mid-1990s to the mid-2000s, right before the <code class="language-plaintext highlighter-rouge">Deep Learning</code> revolution took over. History has it that Vladimir Vapnik (the man behind the <code class="language-plaintext highlighter-rouge">Vapnik-Chervonenkis Theory</code> used heavily throughout <code class="language-plaintext highlighter-rouge">Statistical Learning</code>) had infact invented these techniques back in the early 1960s as a part of his Ph.D. thesis at Moscow University, but couldn’t provide a proof of their empirical prowess, as they didn’t have any computers to run his ideas on. Further on, when Vapnik submitted his work on SVMs to <code class="language-plaintext highlighter-rouge">Neural Information Processing Systems (NeurIPS)</code> conference, his ideas were rejected! SVMs are still heavily used in classical settings, where the data isn’t quite plentiful. Any in-depth exposition of SVMs would atleast take a whole book, and as such, the chapter doesn’t cover as much. However, it does an amazing job introducing <code class="language-plaintext highlighter-rouge">Maximal Margin Classifiers</code> and extending them into <code class="language-plaintext highlighter-rouge">Support Vector Classifiers</code> which later form the basis for <code class="language-plaintext highlighter-rouge">Support Vector Machines</code> and their similarity with <code class="language-plaintext highlighter-rouge">Logistic Regression</code>. Each sub-section of this chapter is worth a heavy read.</p>
<h3 id="chapter-10">Chapter 10</h3>
<p>While the previous chapters solely focussed on the supervised learning paradigm, the last section introduces the nuances of the unsupervised setting, and its use in discovering novel characteristics and patterns in the data itself. <code class="language-plaintext highlighter-rouge">Principal Components Analysis</code> is exposited in more detail here, however, the manuscript still skips over a number of subtleties, and as such, this concept is better learnt elsewhere. The coverage on clustering techniques through <code class="language-plaintext highlighter-rouge">K-Means Clustering</code> and <code class="language-plaintext highlighter-rouge">Hierarchical Clustering</code>, and the shortcomings that accompany such procedures are well explained, and complete from the view of most practitioners, however.</p>
<p>In conclusion, I would like to mention that the fastest way of reading through this book is really to follow the examples given throughout the text and pondering over them, while simultaneously thinking of different general case situations. Additionally, one can simply work through the conceptual problems given at the end of each chapter. I personally found them to be rather easy flowing, though asking difficult questions wasn’t the motive behind why this book was written in the first place. Those focussing on exploring Data Science as a full-time commitment would definitely benefit from this text. For such folks, working through the applied problems might be particularly enlightening as well.</p>
<p><strong>Rage Against The Machine Learning</strong></p>
Literature Recommendation - Naive Set Theory by Paul R. Halmos2019-12-15T00:00:00+00:00https://shikharj.github.io//2019/12/15/Literature-Recommendation-Naive-Set-Theory-by-Paul-Halmos<p><img align="middle" src="/assets/NSTPH.png" /></p>
<p>If you’ve followed my recent blog-posts, you’d notice how I have abstained from providing reviews and recommendations for hard-core machine learning texts. To be honest, this has an ulterior motive. Most people with a decent technical CS background prefer to dive straight into the applied sections of ML, without first understanding the nuances that led to development of ML theory. The first ML algorithms had their roots in Statistics and Probability, not CS. Moreover, set theory forms an important pillar on which most of the logical inference engines of the day are based.</p>
<p>In any formal course on AI, the first topics of discussion are the set-theoretic underpinnings of predicate and propositional logic, followed by a study of classical sets and their mapping to fuzzy sets and fuzzy logic. Hence to get a better insight, Paul Halmos’ seminal work in <code class="language-plaintext highlighter-rouge">Naive Set Theory</code> is both essential and complete, while being a misnomer. It is essential in the sense that almost all of the information presented is extremely foundational and fundamental to getting an overview of modern day <code class="language-plaintext highlighter-rouge">Zermelo-Fraenkel Set Theory</code>. It is complete in the sense that while the book merely provides an outline for the subject, it contains pretty much everything you’ll ever need as a background for most mathematical theory later. It is a misnomer in the sense, that it is a naive introduction to <code class="language-plaintext highlighter-rouge">ZFC</code> rather than being an introduction to <code class="language-plaintext highlighter-rouge">Pre-Axiomatic Set Theory</code>.</p>
<h2 id="the-writing-style">The Writing Style</h2>
<p>It is difficult to comment on the writing style of the author. While the foreword itself states that the writing style is informal to the point of being conversational, I personally found it to be quite formal and dense at the same time. This is not a book which contains many exercises, and that isn’t the end goal of the text either. The material is presented in a way that encourages the reader to develop insights while reading. Note that this can be a hindrance as well. The author omits the <code class="language-plaintext highlighter-rouge">Axiom of Foundation</code> in the formal sense from the book, with only minor hints being provided about the possibility of such an axiom. Moreover, in <code class="language-plaintext highlighter-rouge">ZFC</code> the only object that can be a member of a set, is another set. While the author mentions that the discussion proceeds keeping only sets in mind, nowhere is this fact explicitly mentioned.</p>
<p>The proofs might appear a bit hand-wavy to seasoned enthusiasts, but that shouldn’t be a hindrance to anyone from gaining an idea of how a formal proof might be constructed. The entire manuscript is divided into 25 chapters covering 25 essential topics, with each section contained in not more than 3-4 pages. As such the entire material is contained within a hundred pages, making it an quick and engaging gem of a book.</p>
<h2 id="important-sections">Important Sections</h2>
<h3 id="chapters-1-2">Chapters 1-2</h3>
<h3 id="chapters-3-5">Chapters 3-5</h3>
<h3 id="chapters-6-10">Chapters 6-10</h3>
<h3 id="chapters-11-13">Chapters 11-13</h3>
<h3 id="chapters-14-18">Chapters 14-18</h3>
<h3 id="chapters-19-21">Chapters 19-21</h3>
<h3 id="chapters-22-23">Chapters 22-23</h3>
<h3 id="chapters-24-25">Chapters 24-25</h3>
<p>At the end, I should also mention that I personally cross-checked my understanding of the material by glancing through Christoper Wilson’s <code class="language-plaintext highlighter-rouge">Research Experience for Undergraduates (REU)</code> report <a href="http://math.uchicago.edu/~may/REU2016/REUPapers/Wilson.pdf">A Brief Introduction To ZFC</a> undertaken at University of Chicago in 2016. It should be taken in stride that while Halmos claims that the book isn’t notoriously difficult to master, it can be pretty polarizing to a beginning student of mathematics. However, it is seriously fun to take a look at, and can be read like a novel. In the words of the author, “Generally, set theory is pretty trivial stuff really, but in order to become a mathematician you need some, and here it is: read it, absorb it, and then forget it”.</p>
<p><strong>What’s Outside The Simulation?</strong></p>
Literature Recommendation - Discrete Mathematics And Its Applications by Kenneth H. Rosen2019-10-25T00:00:00+00:00https://shikharj.github.io//2019/10/25/Literature-Recommendation-Discrete-Mathematics-And-Its-Applications-by-Kenneth-Rosen<p><img align="middle" src="/assets/DMAIAKR.png" /></p>
<p>While this book does not serve as a hard-core machine learning resource, I have to confess that I’m yet to come across another book that has helped me better in building a pre-requisite background for higher level mathematics, proof writing techniques and tricks which are heavily used in core computer science. Most undergraduate level courses on discrete mathematics rarely cover the entire material given in the book, given the breadth of the topics covered. So ideally, while you might feel that you would be missing out on crucial information by skipping a few chapters in between, I can assure you that the individual chapters in this book are pretty self-contained as well.</p>
<h2 id="the-writing-style">The Writing Style</h2>
<p>Much like Gilbert Strang’s <code class="language-plaintext highlighter-rouge">Introduction to Linear Algebra</code>, this book introduces a rather intuitional approach to teaching the subject, leaving out proofs for the majority of the book. For people who are just entering college, this is an ideal resource for building a good math background for tackling undergraduate level CS courses. Since this book is mostly geared towards teaching the subject from a CS perspective, if you are more mathematically inclined, you might wish to explore other books that deal with the subject with a bit more mathematical rigour like <code class="language-plaintext highlighter-rouge">Concrete Mathematics: A Foundation for Computer Science</code> by Ronald Graham, Donald Knuth and Oren Patashnik or <code class="language-plaintext highlighter-rouge">Combinatorial Problems and Exercises</code> by László Lovász. For seasoned CS graduates, a vast majority of this book might fail to offer a reasonable amount of intellectual stimulation.</p>
<p>The highlighted theorems and lemmas are the most important feature of the book, especially for the situations where you might be inclined to use it as a quick reference. In addition to this, there are ample number of practice problems per chapter, of varying level of difficulty, to help in grasping the concepts better.</p>
<h2 id="important-sections">Important Sections</h2>
<h3 id="chapter-1">Chapter 1</h3>
<p>The first chapter gently introduces propositional logic and rules of inference. While it may seem a bit redundant from the point of machine learning, I can safely guarantee that logic, and especially propositional logic, occupies a position of much importance, since most of the classical symbolic AI of the previous years heavily utilized propositional logic statements in order to derive further inferences from data. More recently, languages like <code class="language-plaintext highlighter-rouge">Prolog</code> make use of a similar paradigm, requiring regular English sentences to be translated into propositional statements. Equally important are the rules of inference, which help in simplifying these propositional statements and deriving meaningful results. Finally the chapter wraps up with the introduction to various proving methods and strategies that are later used throughout the book. If proof based mathematics wasn’t a part of your regular high school experience, this portion of the book is a must read.</p>
<h3 id="chapter-2">Chapter 2</h3>
<p>Next, we take a dive into naive set theory, and the introduction to functions, sequences and summations through sets. Most of the inference engines of the 1970s and later have made some or the other use of set theory. While many were based on naive set theoretic formulations, many simply transitioned to fuzzy sets and fuzzy logic theory pretty early on. While modern developments in the area, such as axiomatic set theory (of which most popular being <code class="language-plaintext highlighter-rouge">Zermelo-Fraenkel</code> set theory or <code class="language-plaintext highlighter-rouge">ZFC</code>) or fuzzy set theory, are not presented, the chapter does a great job in introducing some of the major developments of the field such as <code class="language-plaintext highlighter-rouge">Cantor diagonalization</code>, <code class="language-plaintext highlighter-rouge">Hilbert Hotel enumeration</code>, and countable and uncountable sets. The chapter ends with a formulation of the <code class="language-plaintext highlighter-rouge">Continuum Hypothesis</code> as stated by Georg Cantor.</p>
<h3 id="chapters-3-4">Chapters 3-4</h3>
<p>The next two chapters focus on algorithmic growth and complexity, and number theory with applications to cryptography respectively. While these chapters can be given a quick read, I personally feel that there are better resources available for these sections, such as <code class="language-plaintext highlighter-rouge">Introduction to Algorithms</code> by Thomas Cormen, Charles Leiserson, Ronald Rivest and Clifford Stein (also known as <code class="language-plaintext highlighter-rouge">CLRS</code>) and <code class="language-plaintext highlighter-rouge">Elementary Number Theory</code> by David Burton respectively, which contain a lot more information and are presented in a lucid manner as well.</p>
<h3 id="chapter-5">Chapter 5</h3>
<p>Mathematical Induction is one of the most heavily used techniques when it comes to college level proof writing, and one should not take it lightly at any cost. While many have whined over time about the dullness of proofs that make use of induction, it nevertheless remains a strong method of theorem-proving. As such, the author has very rightfully dedicated an entire chapter to weak induction, strong induction, structural induction, and laid emphasis on its use in terms of recursive definitions and program correctness.</p>
<h3 id="chapters-6-7">Chapters 6-7</h3>
<p>If you have prior experience with competition style mathematics, I highly doubt that the next two chapters would be of much difficulty to you. The sixth chapter only offers a concise introductory level view of combinatorics, which is quite easily covered in most high schools around the world. While certain portions of the text might be new to you, such as the generalized <code class="language-plaintext highlighter-rouge">Pigeonhole Principle</code> or <code class="language-plaintext highlighter-rouge">Ramsey Theory</code>, anything else should be a comfortable walk in the park. Similarly, the seventh chapter only offers a basic introduction to dicrete probability theory, with most of the emphasis being laid on <code class="language-plaintext highlighter-rouge">Bernoulli</code> and <code class="language-plaintext highlighter-rouge">Binomial</code> trials, and the use of <code class="language-plaintext highlighter-rouge">Bayes' Theorem</code>. While random variables, linearity of expectation and <code class="language-plaintext highlighter-rouge">Chebyshev's Inequality</code> are some of the new concepts which are presented, for a better set of problems and theory related to both combinatorics and discrete probability theory, I highly recommend <code class="language-plaintext highlighter-rouge">The Art of Problem Solving Volume 2: and Beyond</code> by Richard Rusczyk and Sandor Lehoczky.</p>
<h3 id="chapter-8">Chapter 8</h3>
<p>Like the previous two chapters, this section is better learnt through a more focussed text as mentioned above. However, the chapter’s coverage on solving linear recurrence relations is absolute gold, when it comes to clarity and completeness, and must be given a serious look. Recurrence relations occur heavily in real world problems, and more often than not, these relations tend to be linear in nature, and hence can be worked into closed form solutions.</p>
<h3 id="chapter-9">Chapter 9</h3>
<p>This chapter succinctly introduces the notion of relations as a generalization of the concept of functions introduced in the second chapter. The concepts of reflexiveness, symmetricity and transitivity are also presented, along with the generalization to n-ary relations and their representations in terms of matrices. This is supplemented with the presentation of equivalence relations and partial orderings, which are heavily used in pretty much all of pure mathematics of the modern era, including <code class="language-plaintext highlighter-rouge">Real Analysis</code> and <code class="language-plaintext highlighter-rouge">Abstract Algebra</code>.</p>
<h3 id="chapters-10-11">Chapters 10-11</h3>
<p>In my humble opinion, these two chapters are the most well exposited portions of the entire text. While there are other texts which provide a deeper insight into <code class="language-plaintext highlighter-rouge">Graph Theory</code>, I have personally found the book’s treatment of this subject to be complete in terms of utility that an undergraduate might require. The terminologies, and representations introduced are completely self contained, and require no prior knowledge. <code class="language-plaintext highlighter-rouge">Isomorphisms</code>, <code class="language-plaintext highlighter-rouge">Connectivity</code>, <code class="language-plaintext highlighter-rouge">Euler and Hamiltonian Paths</code>, <code class="language-plaintext highlighter-rouge">Planar Graphs</code> and <code class="language-plaintext highlighter-rouge">Four Color Theorem</code> are some of the popular sections presented. Additionally, a reasonable treatment for trees as specialized graphs is also provided through traversal problems and spanning tree formulations. Mastering the material of these chapters are absolutely essential for a good insight into how and why many real-world problems are modelled on graphs and trees.</p>
<h3 id="chapter-12">Chapter 12</h3>
<p>A refresher for boolean functions and logic gates, this chapter focuses heavily on the representation of boolean functions and the associated tricks for minimizing the logic circuits. I personally think this chapter can be given a quick overlook for its content.</p>
<h3 id="chapter-13">Chapter 13</h3>
<p>While I encourage the reader to digest the material provided in the final chapter, it should come with a fair warning that most of the material covered here would be selectively handpicked from a formal course on <code class="language-plaintext highlighter-rouge">Formal Languages and Automata Theory</code>. As such, it is unfair to expect the same level of depth as one would expect from a dedicated book on the topic such as <code class="language-plaintext highlighter-rouge">Introduction to Automata Theory, Languages, and Computation</code> by John Hopcroft, Rajeev Motwani and Jeffrey Ullman, which I highly recommend.</p>
<p>In conclusion, I would like to say that if you are in a time-crunch, and wish to read this book in the fastest way possible, I’d recommend reading through the highlighted theorems and working your way through the starred <strong>( * )</strong> problems at the very least. Be cautious though, these are some pretty neat problems and might come off as too challenging to you, depending on your maturity in proof-based mathematics and problem solving. However, each of these is a must try problem, in order to master the material. Additionally, Prof. Tom Leighton’s <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/">MIT OCW course</a> (from 2010) contains a lot of the material covered in the book, though the course follows an altogether different syllabus compared to the book.</p>
<p><strong>Do Androids Dream Of Eclectic Memes?</strong></p>
Literature Recommendation - Introduction To Linear Algebra by Gilbert Strang2019-10-06T00:00:00+00:00https://shikharj.github.io//2019/10/06/Literature-Recommendation-Introduction-To-Linear-Algebra-by-Gilbert-Strang<p><img align="middle" src="/assets/ILAGS.png" /></p>
<p>For those of you greenhorns that have just made your venture into the world of machine learning, it must not come as a surprise to you that linear algebra is the purest soul of the realm. Most of the ML and optimization world borrows ideas heavily from the same, and it is single-handedly the most important area of mathematics that will dictate your level of thinking while tackling ML problems.</p>
<p>As such, it is altogether fitting to write about a text that has probably helped thousands of undergraduates to get up and running with their knowledge of linear algebra. Prof. Gilbert Strang’s book is one such epitome of awesome insights into the field. There are probably very books out there that are worth reading over and over again, Strang’s book being one such gem. I have personally read this book many times over the course of my undergrad, and have always felt that I learnt something completely new each time. I would not be exaggerating if I said that you should keep this book in your personal collection of self-help books. Here are some of the points which I must mention, which make it such an important read.</p>
<h2 id="the-writing-style">The Writing Style</h2>
<p>Strang takes up a non-rigorous approach to teaching the subject. He mentions a concept dead straight, tells you why it is important and mentions how it relates to the bigger picture of algebraic and geometric meaning. Very few formal proofs are provided in the text, with the author emphasizing on the importance to derive the non-rigorous connections to other fields of mathematics.</p>
<p>While many professionals would argue that this method of teaching is specifically aimed at non-mathematicians (since the flavour is rather numerical than theoretical), I personally think this is an amazing way to approach a deeply theoretical subject without having to raise the bar of abstraction to the level that is incomprehensible to most people. If you have read any standard book on abstract algebra, you would notice that linear algebra and vector fields are typically not even introduced in the first ten or so chapters. This leads to a huge jump in abstraction that most undergraduates would not be prepared to handle. That being said, one should first strive to master the concepts introduced in the text before moving on to a more theory oriented text. The book is entirely self-contained, and the recommended way to learning the material would be to rather forget the concepts of matrices and determinants that one learns during the typical high school system, and approach the book with a fresh mind.</p>
<h2 id="important-sections">Important Sections</h2>
<h3 id="chapters-1-2">Chapters 1-2</h3>
<p>The first couple of chapters act as a refresher material for the concepts of vectors, coordinate geometry and matrix operations that a student typically learns during their high school, while introducing the concepts of <code class="language-plaintext highlighter-rouge">Gaussian</code> elimination techniques for solving systems of equations. Extremely insightful and important, especially from a standpoint of numerical linear algebra.</p>
<h3 id="chapters-3-4">Chapters 3-4</h3>
<p>Next up, we move to the essence of the subject, where the concepts of vector spaces, independence of vectors, basis and dimension of a space, and the general overview of the four fundamental subspaces (rowspace, columnspace, nullspace and left nullspace) of a matrix are introduced. Further, the author introduces the concept of orthogonal subspaces and uses it to develop the intuition regarding projection of vectors and therefore matrices. These concepts are then applied to finding the least squares approximation to regression problems, and the connection between the least squares error criterion and the left nullspace of a matrix is shown. <code class="language-plaintext highlighter-rouge">Gram-Schmidt</code> process is another important concept presented. This material essentially wraps up with what the author calls the <code class="language-plaintext highlighter-rouge">Fundamental Theorem of Linear Algebra</code>, with the general idea regarding the dimensionality and orthogonality of the aforementioned subspaces. Probably the most important section of the book, which is developed further in the next couple of chapters.</p>
<h3 id="chapter-5">Chapter 5</h3>
<p>Primarily deals with the properties of determinants of matrices, and the formulas derived from using those properties are presented as intuitive generalizations. Want to know how determinant formula you learnt back in high school came to be? Want to know the geometric meaning of the determinant of a matrix of arbitrary order? Want to revisit the old formulas regarding the properties of determinants that you once read about, but found exceedingly dry back in school? Give this chapter a solid read.</p>
<h3 id="chapter-6">Chapter 6</h3>
<p>Formally wraps up the conceptual journey presented by the book, and is the most important chapter in the entire manuscript in context of machine learning. Most of the ML that we see today is heavily influenced and derived as a result of the properties of eigenvalues and eigenvectors of the matrices that we model the real world problems on. The focus is mostly on real symmetric matrices in this chapter, with general matrices and complex eigenvalues given formal treatment later in the book. Some important concepts would be the diagonalization criterion of matrices, the properties of matrices sharing similar eigenvalues and eigenvectors, and most importantly the <code class="language-plaintext highlighter-rouge">Spectral Theorem</code> and its consequences when it comes to positive definiteness. The material is covered in a fashion that treats matrices as simple variables, while making use of powers and exponentiation to solve differential equations. This also formally marks the end of the first half of the book, and only the applications of the concepts presented until then are exposited in the following material. Be sure not to miss a single concept presented here, it will only come back to haunt you later.</p>
<h3 id="chapter-7">Chapter 7</h3>
<p><code class="language-plaintext highlighter-rouge">Singular Value Decomposition</code> is the central idea in linear algebra. While diagonalization exists only for a certain type of matrices (whose algebraic and geometric multiplicities are the same), SVD is a much more powerful concept which applies to all matrices. The concept of single basis diagonalization introduced earlier, and applied to real symmetric matrices in <code class="language-plaintext highlighter-rouge">Spectral Theorem</code> gets generalized to the idea of two-bases diagonalization in SVD. Furthermore, this concept is heavily utilized in the decomposition of higher dimensional matrices (called tensors), and is aptly called <code class="language-plaintext highlighter-rouge">Higher Order Singular Value Decomposition</code> or HOSVD. <code class="language-plaintext highlighter-rouge">Principal Components Analysis</code> is another major application of SVD, used heavily in dimensionality reduction in ML. The chapter wraps up with an explanation of the effect of multiplying a matrix with a vector, and the use of pseudoinverse for a reverse analogy.</p>
<h3 id="chapter-8">Chapter 8</h3>
<p><code class="language-plaintext highlighter-rouge">Linear Transforms</code>, <code class="language-plaintext highlighter-rouge">Fourier Series</code>, <code class="language-plaintext highlighter-rouge">Jordan Forms</code> and change of basis are some of the topics covered here. The connection between <code class="language-plaintext highlighter-rouge">Fourier Series</code> and vector expansion in an orthonormal basis, inner product between functional basis vectors and so on is also exposited nicely. This chapter particularly focuses on the origin of matrix objects while computing linear transformations, and goes on to apply the same on some carefully chosen examples.</p>
<h3 id="chapters-9-12">Chapters 9-12</h3>
<p>Heavy on applications of the concepts introduced in the first half. <code class="language-plaintext highlighter-rouge">Fast Fourier Transforms</code>, <code class="language-plaintext highlighter-rouge">Linear Programming</code>, applications in computer graphics, cryptography and so on, are covered in detail. The applications are introduced as generalizations of the previously introduced concepts. The last chapter also doubles up as a subtle introduction to the use of linear algebra in probability theory. While I might suggest to read specific portions from the said chapters, it might be in your interest to cover these depending on your field of interest. You might also be tempted to skip a few chapters in between, and I don’t personally think you would be missing a lot of conceptual understanding while doing so.</p>
<p>In conclusion, I would also like to mention that Prof. Strang’s <a href="https://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/index.htm">MIT OCW course</a> (from 2010) contains a much faster explanation to the text, and is a nice alternative to those who do not have a lot of time on their hands to spare. Be advised, the text covers some material he doesn’t teach in his course, and vice versa. A curious student may also wish to venture into Serge Lang’s <code class="language-plaintext highlighter-rouge">Introduction to Linear Algebra</code> for certain topics that Strang does not cover.</p>
<p><strong>Let’s Cut The Check For Now, Shall We?</strong></p>
Revival of the Blog2019-10-05T00:00:00+00:00https://shikharj.github.io//2019/10/05/Revival-of-the-Blog<p>It’s been more than a couple of years now since I last wrote a <a href="https://shikharj.github.io/2017/08/29/Wrapping-Up-GSoC/">blog post</a> detailing my experiences in <code class="language-plaintext highlighter-rouge">GSoC</code> 2017. After wrapping up with that, I pretty much gave up on writing regular blog posts until now. So what changed in that time?</p>
<h2 id="new-experiences">New Experiences</h2>
<p>My first <code class="language-plaintext highlighter-rouge">GSoC</code> experience gave me a lot of confidence and exposure to the world of open-source and programming. As such, I went on to participate as a student in 2018 under <a href="https://www.mlpack.org/"><code class="language-plaintext highlighter-rouge">mlpack</code></a> and also interned at <a href="https://www.hackerrank.com/"><code class="language-plaintext highlighter-rouge">Hackerrank</code></a> and <a href="https://www.openmainframeproject.org/"><code class="language-plaintext highlighter-rouge">OpenMainframeProject</code></a>. I also wrapped up mentoring two students for <code class="language-plaintext highlighter-rouge">mlpack</code> this year. It has been an enriching experience for me to learn so much while collaborating with the best people around the world.</p>
<h2 id="changed-outlook">Changed Outlook</h2>
<p>During my internship at <code class="language-plaintext highlighter-rouge">Hackerrank</code>, I realized that software development wasn’t something that motivated me heavily. Even though the people I met there were some of the very skilled I had interacted with, I found myself lost and unenergetic (which in part might have also been because of my picky attitude when it comes to working on problems). Since, I was also a <code class="language-plaintext highlighter-rouge">GSoC</code> student that summer, I ended up discovering my love for mathematics, and machine learning while contributing to <code class="language-plaintext highlighter-rouge">mlpack</code>. That experience only made me realize my affinity for theoretical work, which I later affirmed during my internship at University of Southern California’s Institute for Creative Technologies (USC-ICT).</p>
<p>While the work at ICT wasn’t super-theoretical as I had hoped, I thoroughly enjoyed myself working on open ended research problems, while writing code to test out different hypotheses. I’m heavily motivated for a career in theoretical research, and currently I’m building the prerequisite math background for the same.</p>
<h2 id="the-future">The Future</h2>
<p>One of the many reasons why I wanted to revive this blog is to help me exposit and explain the concepts that I spend time learning on in my journey, and help other academic nomads like me to get up and running with a theory heavy background, while not having been already superb at higher level mathematics while in school. As such, I would also try and post resources that I find useful, in hopes that they might help others in their journey.</p>
<p><strong>Let’s Roll For Now, Shall We?</strong></p>
Wrapping Up GSoC2017-08-29T00:00:00+00:00https://shikharj.github.io//2017/08/29/Wrapping-Up-GSoC<p>As I’m writing this post, the deadline for code submission has finally arrived. It has been a wonderful journey, and the experience has certainly left me as a much better programmer than I originally thought I was. From my first <a href="https://github.com/symengine/symengine/pull/1100">bug fix</a>, which despite being a minor issue, took up so much of my time, I wasn’t even sure that I’d be associated with the <code class="language-plaintext highlighter-rouge">SymPy</code> and <code class="language-plaintext highlighter-rouge">SymEngine</code> team for so long.</p>
<p>Google Summer of Code ‘17 has officially ended. It had its own ups and downs, though both being rewarding to say the least. Currently all my work is pushed up to the respective repositories, and should be ready to merge soon. Thanks to Isuru, for allowing me to work on this even after the official period ends.</p>
<h2 id="report">Report</h2>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/182">#182</a> implementing <code class="language-plaintext highlighter-rouge">Expr</code> class and fixing the inheritance of various other classes. Some minor changes still might be required in this repository in the time to come, since it might require some more tweaks to finally get everything running in <code class="language-plaintext highlighter-rouge">SymPy</code>.</p>
<h3 id="sympy">SymPy</h3>
<p>Here is a <a href="https://github.com/sympy/sympy/pulls/ShikharJ">list</a> of all my PRs currently pending in <code class="language-plaintext highlighter-rouge">SymPy</code>. I pushed a lot of them in the last few hours to spare some time before the deadline. These will consequently be worked upon and merged.</p>
<p>I had a great summer, much more exhilarating than I had expected it to be. A more detailed work report can be found <a href="https://github.com/ShikharJ/GSoC-2017-Work-Report">here</a>. A final thanks to the <code class="language-plaintext highlighter-rouge">SymPy</code> community, <code class="language-plaintext highlighter-rouge">Google</code>, and my mentors Isuru Fernando and Sumith Kulal, for giving me the opportunity to be a part of this. I hope to stay around for a while.</p>
<p><strong>पुनर्दर्शनाय</strong></p>
GSoC Progress - Week 11 and Week 122017-08-22T00:00:00+00:00https://shikharj.github.io//2017/08/22/GSoC-Progress-Week-11-12<p>Greetings!</p>
<p>This is the combined post for weeks 11 and 12. As mentioned earlier, Isuru had been unavailable for the last week, during which my focus was entirely fixed on getting the countless assertion failures in <code class="language-plaintext highlighter-rouge">SymPy</code> fixed while using <code class="language-plaintext highlighter-rouge">SymEngine</code> as a core.</p>
<p>I was also able to get all the pending work merged in, namely the Singleton pattern and a host of other miscellaneous additions.</p>
<p>After that, we had to update the <code class="language-plaintext highlighter-rouge">conda</code> binaries for both <code class="language-plaintext highlighter-rouge">SymEngine</code> and <code class="language-plaintext highlighter-rouge">SymEngine.py</code> for through <a href="https://github.com/symengine/symengine-feedstock/pull/3">#3</a> and <a href="https://github.com/symengine/python-symengine-feedstock/pull/2">#2</a> respectively. Currently, we’re good to go for porting over the changes made over the summers for different directories in <code class="language-plaintext highlighter-rouge">SymPy</code>.</p>
<p>This is officially the last week of GSoC 2017. I’ll push all my work as separate PRs on <code class="language-plaintext highlighter-rouge">SymPy</code>, and try to get them merged before the deadline on 29th August.</p>
<p><strong>Mirupafshim</strong></p>
GSoC Progress - Week 102017-08-07T00:00:00+00:00https://shikharj.github.io//2017/08/07/GSoC-Progress-Week-10<p>Greetings!
The GSoC final submissions are about three weeks away and I’m trying my best to get everything sorted out before the deadline. However, we are faced with an issue. Isuru won’t be available for the major part of the penultimate week. As such, I’ll have to reach out to Sumith for reviews, who’s been pretty busy lately. Hence my goal for the next week would be to get everything reviewed and merged as soon as possible. Here is a gist of the work done in the previous week.</p>
<h2 id="report">Report</h2>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I implemented some attributes seeking inspiration from <code class="language-plaintext highlighter-rouge">SymPy</code>’s classes in <a href="https://github.com/symengine/symengine.py/pull/180">#180</a>, which is reviewed and merged. I also took some time fixing the assertion failures in <code class="language-plaintext highlighter-rouge">SymPy</code>’s modules, which would be pushed in soon. More on this next week.</p>
<p>That’s all I have.</p>
<p><strong>Totsiens</strong></p>
GSoC Progress - Week 92017-08-01T00:00:00+00:00https://shikharj.github.io//2017/08/01/GSoC-Progress-Week-9<p>Hi all, we’re in the final month of <code class="language-plaintext highlighter-rouge">GSoC</code> with only about 4 weeks remaining on the development time. Last week was a bit rough because my college semester started off with a heavy schedule on the very first day, and a number of boarding issues, due to which a number of my days were spent in shifting my stuff from one room to another. Add to that the summer heat of this country, and it becomes a total nightmare. Here’s what I could do.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/1316">#1316</a>, resolving some of the scope issues we were facing in <code class="language-plaintext highlighter-rouge">SymEngine.py</code>. I’m expecting a light implementation schedule here in <code class="language-plaintext highlighter-rouge">SymEngine</code> form now on, as we have most of the stuff we need for a sizeable amount of <code class="language-plaintext highlighter-rouge">SymPy</code>’s directories to be ported over <code class="language-plaintext highlighter-rouge">SymEngine</code>.</p>
<h3 id="sympy">SymPy</h3>
<p>Pushed in <a href="https://github.com/sympy/sympy/pull/13051">#13051</a>, fixing a minor piece of code that was previously preventing us from using <code class="language-plaintext highlighter-rouge">SymEngine</code>’s <code class="language-plaintext highlighter-rouge">igcd</code> in <code class="language-plaintext highlighter-rouge">SymPy</code>’s <code class="language-plaintext highlighter-rouge">LieAlgebras</code> module. I had also taken some time updating the work on other directories.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I worked on implementing some miscellaneous missing functionalities in <a href="https://github.com/symengine/symengine.py/pull/179">#179</a>, which should soon be ready to get merged.</p>
<p>Since we are slowly reaching towards the end of the project, I’ll have to request Isuru for a release in <code class="language-plaintext highlighter-rouge">SymEngine</code> and <code class="language-plaintext highlighter-rouge">SymEngine.py</code> so that our latest work becomes available for <code class="language-plaintext highlighter-rouge">SymPy</code>.</p>
<p><strong>Pozdrav</strong></p>
GSoC Progress - Week 82017-07-25T00:00:00+00:00https://shikharj.github.io//2017/07/25/GSoC-Progress-Week-8<p>My first two months under <code class="language-plaintext highlighter-rouge">GSoC</code> have finally ended, and we are right on track towards the completion of the project. I finished up on my log of <code class="language-plaintext highlighter-rouge">SymPy</code>’s directories and have analysed everything that needs to be further implemented or improved upon.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/1313">#1313</a>, implementing <code class="language-plaintext highlighter-rouge">row_insert</code> and <code class="language-plaintext highlighter-rouge">column_insert</code> functions in <code class="language-plaintext highlighter-rouge">DenseMatrix</code> class and <code class="language-plaintext highlighter-rouge">row_del</code> and <code class="language-plaintext highlighter-rouge">col_del</code> functions in <code class="language-plaintext highlighter-rouge">C</code> wrappers, while making <code class="language-plaintext highlighter-rouge">row_join</code>, <code class="language-plaintext highlighter-rouge">col_join</code>, <code class="language-plaintext highlighter-rouge">row_del</code> and <code class="language-plaintext highlighter-rouge">col_del</code> in-place member functions.</p>
<h3 id="sympy">SymPy</h3>
<p>After testing all the viable directories that could use <code class="language-plaintext highlighter-rouge">SymEngine</code> as a backend, only the <code class="language-plaintext highlighter-rouge">LieAlgebras</code> module worked completely out of the box, with no major issues. As such, we were able to achieve the same through <a href="https://github.com/sympy/sympy/pull/13023">#13023</a>, which now marks the beginning of Phase III of my proposal. I have also pushed the work done on other directories as separate branches on my local repository, to be finished upon gradually.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I worked on implementing the <code class="language-plaintext highlighter-rouge">Singleton</code> pattern in the wrappers through <a href="https://github.com/symengine/symengine.py/pull/178">#178</a>, though the work is currently in progress. More on this next week.</p>
<p>That’s all I have for now.</p>
<p><strong>Bidāẏa</strong></p>
GSoC Progress - Week 72017-07-18T00:00:00+00:00https://shikharj.github.io//2017/07/18/GSoC-Progress-Week-7<p>My seventh report on my GSoC progress. It’s been quite a journey so far, full of challenges and rewards. This week, apart from the work, I took some time to write a proposal for a full fledged talk at the upcoming <code class="language-plaintext highlighter-rouge">PyCon India 2017</code> Conference, titled <code class="language-plaintext highlighter-rouge">SymEngine: Leveraging The Power Of A Computer Algebra System (CAS) To Another</code> to be held during the first week of <code class="language-plaintext highlighter-rouge">November 2017</code> in <code class="language-plaintext highlighter-rouge">New Delhi</code>. What’s more exciting is that Sumith and Ranjith would be there as well, hopefully if it gets selected.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/1308">#1308</a> fixing a minor <code class="language-plaintext highlighter-rouge">Travis</code> irregularity.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/176">#176</a>, a minor PR for skipping some of the tests where <code class="language-plaintext highlighter-rouge">SymPy</code> wasn’t being used.</p>
<p>Most of my time this week was spent on finding inconsistencies between <code class="language-plaintext highlighter-rouge">SymEngine</code> and <code class="language-plaintext highlighter-rouge">SymPy</code> objects which arise while using <code class="language-plaintext highlighter-rouge">SymEngine</code> in <code class="language-plaintext highlighter-rouge">SymPy</code>. I’m currently maitaining a log of all the issues that are occuring and their possible solutions. As such, I have decided to make a small change in our strategy. For the coming week, I’ll try and complete the issue log, and implement the possible missing functionalities and attributes in <code class="language-plaintext highlighter-rouge">SymEngine.py</code>, after which a minor release in <code class="language-plaintext highlighter-rouge">SymEngine</code> and <code class="language-plaintext highlighter-rouge">SymEngine.py</code> would be made to make these changes available for <code class="language-plaintext highlighter-rouge">SymPy</code>.</p>
<p>Till Next Time!</p>
<p><strong>Ciao</strong></p>
GSoC Progress - Week 62017-07-11T00:00:00+00:00https://shikharj.github.io//2017/07/11/GSoC-Progress-Week-6<p>This week, quite like the previous week, my work was mostly limited to <code class="language-plaintext highlighter-rouge">SymEngine.py</code>.</p>
<h2 id="report">Report</h2>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/172">#172</a> wrapping off some of the miscellaneous functions, and aliasing some of the existing ones to make them compatible with <code class="language-plaintext highlighter-rouge">SymPy</code>.</p>
<p>Since the above PR practically sums up my work in <code class="language-plaintext highlighter-rouge">SymEngine.py</code>, it’s safe to say no new functionality is expected to be wrapped for now. However, since <code class="language-plaintext highlighter-rouge">sympy/physics/vector</code> and a number of other modules are currently failing with <code class="language-plaintext highlighter-rouge">SymEngine</code>, after the <code class="language-plaintext highlighter-rouge">0.3.0</code> release of <code class="language-plaintext highlighter-rouge">SymEngine.py</code>, some minor tweaks would be required in the wrappers. Also, I’ll try and get all the pending PRs merged as soon as possible.</p>
<p>Till Next Time!</p>
<p><strong>Adéu</strong></p>
GSoC Progress - Week 52017-07-04T00:00:00+00:00https://shikharj.github.io//2017/07/04/GSoC-Progress-Week-5<p>Hello, this post contains the fifth report of my GSoC progress. This week, my work was mostly limited to <code class="language-plaintext highlighter-rouge">SymEngine.py</code>, and as such this post will be rather short.</p>
<h2 id="report">Report</h2>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/168">#168</a> wrapping off <code class="language-plaintext highlighter-rouge">Logic</code> classes as well as the <code class="language-plaintext highlighter-rouge">Set</code> classes. Though the PR is not complete yet, currently only test cases are remaining to be written, along with some probable debugging.</p>
<p>Once this PR is merged in, only some miscellaneous functions from <code class="language-plaintext highlighter-rouge">SymEngine</code> would remain to be wrapped, after which our focus can be shifted to the pending <code class="language-plaintext highlighter-rouge">SymPy</code> PRs using <code class="language-plaintext highlighter-rouge">SymEngine</code>.</p>
<p>Till Next Time!</p>
<p><strong>Tschüs</strong></p>
GSoC Progress - Week 42017-06-27T00:00:00+00:00https://shikharj.github.io//2017/06/27/GSoC-Progress-Week-4<p>Hello, this post contains the fourth report of my GSoC progress. Though I had planned on writing a new blog post every Monday, seems like I’m a bit late on that account.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>Last week I had mentioned that I’d be finishing up my work on <code class="language-plaintext highlighter-rouge">Range</code> set, however, after a talk with Isuru, it was decided to schedule it for the later part of the timeline. Instead I finished up on simplification of <code class="language-plaintext highlighter-rouge">Add</code> objects in <code class="language-plaintext highlighter-rouge">Sign</code> class through the PR <a href="https://github.com/symengine/symengine/pull/1297">#1297</a>.</p>
<p>Also, Isuru suggested implementing parser support for <code class="language-plaintext highlighter-rouge">Relationals</code>, which was required for <code class="language-plaintext highlighter-rouge">PyDy</code>. The work is currently in progress, through PR <a href="https://github.com/symengine/symengine/pull/1298">#1298</a>, after we hit an issue with dual-character operators (<code class="language-plaintext highlighter-rouge"><=</code> and <code class="language-plaintext highlighter-rouge">>=</code>), but we’re working on it.</p>
<p>I sent in another PR <a href="https://github.com/symengine/symengine/pull/1302">#1302</a> removing some redundant includes.</p>
<p>From now my work with <code class="language-plaintext highlighter-rouge">SymEngine</code> will probably be a little slower than usual, as I’ve started off wrapping classes in <code class="language-plaintext highlighter-rouge">SymEngine.py</code>, which is supposed to continue for some time from now.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/162">#162</a> wrapping off a huge portion of the <code class="language-plaintext highlighter-rouge">functions</code> module in <code class="language-plaintext highlighter-rouge">SymEngine</code>.</p>
<p>I’ll be working on wrapping <code class="language-plaintext highlighter-rouge">Logic</code> classes and functions in the coming week, as well as finishing off my work on the parser support in <code class="language-plaintext highlighter-rouge">SymEngine</code>.</p>
<p>See you again!</p>
<p><strong>Vale</strong></p>
GSoC Progress - Week 32017-06-19T00:00:00+00:00https://shikharj.github.io//2017/06/19/GSoC-Progress-Week-3<p>Hello, this post contains the third report of my GSoC progress. This week was mostly spent on learning the internal structures of <code class="language-plaintext highlighter-rouge">SymEngine</code> functionalities and methods on a deeper level.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>This week I worked on implementing <code class="language-plaintext highlighter-rouge">Conjugate</code> class and the related methods in <code class="language-plaintext highlighter-rouge">SymEngine</code>, through PR <a href="https://github.com/symengine/symengine/pull/1295">#1295</a>.</p>
<p>I also worked on implementing the “fancy-set” <code class="language-plaintext highlighter-rouge">Range</code>, the code for which would be complete enough to be pushed sometime in the coming GSoC week.</p>
<p>Also, since it would probably be the last week that I’d be working on <code class="language-plaintext highlighter-rouge">SymEngine</code>, I spent some time going through the codebase and checking for discontinuities between <code class="language-plaintext highlighter-rouge">SymEngine</code> and <code class="language-plaintext highlighter-rouge">SymPy</code>’s implementations.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>I pushed in <a href="https://github.com/symengine/symengine.py/pull/155">#155</a> fixing a trivial change from <code class="language-plaintext highlighter-rouge">_sympify</code> to <code class="language-plaintext highlighter-rouge">sympify</code> in relevant cases throughout the <code class="language-plaintext highlighter-rouge">SymEngine.py</code> codebase. The PR is reviewed and merged.</p>
<p>I reached out to Isuru once again regarding further work to be undertaken for <code class="language-plaintext highlighter-rouge">PyDy</code>, and he suggested wrapping up <code class="language-plaintext highlighter-rouge">Relationals</code> from <code class="language-plaintext highlighter-rouge">SymEngine</code>. The work, which is pushed through <a href="https://github.com/symengine/symengine.py/pull/159">#159</a>, is in itself close to completion, with only specific parsing capabilities left to be implemented (for eg. <code class="language-plaintext highlighter-rouge">x < y</code> should return a <code class="language-plaintext highlighter-rouge">LessThan(x, y)</code> object).</p>
<p>Wrapping <code class="language-plaintext highlighter-rouge">Relationals</code> also marks the initiation of <code class="language-plaintext highlighter-rouge">SymEngine.py</code>’s side of Phase II, which predominantly focuses on bug-fixing and wrapping.</p>
<p>See you again!</p>
<p><strong>Addio</strong></p>
GSoC Progress - Week 22017-06-12T00:00:00+00:00https://shikharj.github.io//2017/06/12/GSoC-Progress-Week-2<p>Hello, this post contains the second report of my GSoC progress.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>This week I mostly worked on implementing specific classes in <code class="language-plaintext highlighter-rouge">SymEngine</code>, namely <code class="language-plaintext highlighter-rouge">Sign</code>, <code class="language-plaintext highlighter-rouge">Floor</code> and <code class="language-plaintext highlighter-rouge">Ceiling</code>, through PRs <a href="https://github.com/symengine/symengine/pull/1287">#1287</a> and <a href="https://github.com/symengine/symengine/pull/1290">#1290</a>. The work is currently under review, but again, mostly complete.</p>
<p>Though I had originally planned to implement more classes in my proposal, after a thorough look, I realised that a number of the mentioned classes could easily be implemented in <code class="language-plaintext highlighter-rouge">SymEngine.py</code> side only. As such, there was no hard requirement for them to be implemented in <code class="language-plaintext highlighter-rouge">SymEngine</code>.
Also, a number of them had been pre-implemented, but rather as <code class="language-plaintext highlighter-rouge">virtual</code> methods, and not standalone classes. There are still a couple of classes that I’d be working on in the coming week, which would effectively finish up a huge part of the planned Phase I of my proposal.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>Isuru and I conversed a bit on whether I’d be interested in working on providing <code class="language-plaintext highlighter-rouge">SymEngine</code> support for <a href="https://github.com/pydy/pydy">PyDy</a> (a multi-body dynamics toolkit), as a part of GSoC. I agreed happily, and Isuru opened a couple of issues in <code class="language-plaintext highlighter-rouge">SymEngine.py</code> for me to work on, as I was completely new to <code class="language-plaintext highlighter-rouge">PyDy</code>.
I started off wrapping up <code class="language-plaintext highlighter-rouge">Infinity</code>, <code class="language-plaintext highlighter-rouge">NegInfinity</code>, <code class="language-plaintext highlighter-rouge">ComplexInfinity</code> and <code class="language-plaintext highlighter-rouge">NaN</code> classes through PR <a href="https://github.com/symengine/symengine.py/pull/151">#151</a>. I also worked on finishing Isuru’s code, wrapping <code class="language-plaintext highlighter-rouge">ccode</code> and <code class="language-plaintext highlighter-rouge">CodePrinter</code> class with an improvised <code class="language-plaintext highlighter-rouge">doprint</code> function through PR <a href="https://github.com/symengine/symengine.py/pull/152">#152</a>.
I also opened <a href="https://github.com/symengine/symengine.py/pull/153">#153</a>, working on acquisition and release of <code class="language-plaintext highlighter-rouge">Global Interpreter Lock</code> or <code class="language-plaintext highlighter-rouge">GIL</code> in <code class="language-plaintext highlighter-rouge">pywrapper.cpp</code> file.</p>
<p>See you again!</p>
<p><strong>Au Revoir</strong></p>
GSoC Progress - Week 12017-06-05T00:00:00+00:00https://shikharj.github.io//2017/06/05/GSoC-Progress-Week-1<p>Ahoy there! This post contains my first GSoC progress report.</p>
<h2 id="report">Report</h2>
<h3 id="symengine">SymEngine</h3>
<p>My previous PR(<a href="https://github.com/symengine/symengine/pull/1276">#1276</a>) on <code class="language-plaintext highlighter-rouge">Relationals</code> is reviewed and merged in. I also worked on introducing additional support for them. The PRs, <a href="https://github.com/symengine/symengine/pull/1279">#1279</a> and <a href="https://github.com/symengine/symengine/pull/1280">#1280</a> are also reviewed and merged, leaving only <a href="https://github.com/symengine/symengine/pull/1282">LLVM support</a> as a work in progress.</p>
<p>I also noticed, that one of the pending requests for <code class="language-plaintext highlighter-rouge">0.3.0</code> milestone for <code class="language-plaintext highlighter-rouge">SymEngine.py</code> was the implementation of vector-specific methods such as <code class="language-plaintext highlighter-rouge">dot()</code> and <code class="language-plaintext highlighter-rouge">cross()</code> in <code class="language-plaintext highlighter-rouge">SymEngine</code>. The work is done <a href="https://github.com/symengine/symengine/pull/1286">here</a> and is mostly complete.</p>
<p>Apart from this, I started the planned implementation of <code class="language-plaintext highlighter-rouge">SymPy</code> classes by implementing the <code class="language-plaintext highlighter-rouge">Dummy</code> class in <code class="language-plaintext highlighter-rouge">SymEngine</code> <a href="https://github.com/symengine/symengine/pull/1284">here</a>.</p>
<p>Most of the above mentioned pending work should be ready to merge within a couple of days.</p>
<h3 id="sympy">SymPy</h3>
<p>Continuing my work on <code class="language-plaintext highlighter-rouge">sympy/physics</code>, I pushed in <a href="https://github.com/sympy/sympy/pull/12703">#12703</a> covering the stand-alone files in <code class="language-plaintext highlighter-rouge">physics</code> module and <a href="https://github.com/symengine/symengine/pull/12700">#12700</a> which is a minor addition to the work done in <code class="language-plaintext highlighter-rouge">physics/mechanics</code>.</p>
<h3 id="symenginepy">SymEngine.py</h3>
<p>Isuru pointed out some inconsistencies in the existing code for <code class="language-plaintext highlighter-rouge">ImmutableMatrix</code> class, which needed to be fixed for <code class="language-plaintext highlighter-rouge">0.3.0</code> milestone. The code was fixed through the PR <a href="https://github.com/symengine/symengine.py/pull/148">#148</a>.</p>
<p>We’ll probably have a <code class="language-plaintext highlighter-rouge">SymEngine.py</code> release next week, after which I plan to port over pre-existing functionalities in <code class="language-plaintext highlighter-rouge">SymEngine.py</code> to <code class="language-plaintext highlighter-rouge">SymPy</code>’s left-over modules.</p>
<p>That’s all for now.</p>
<p><strong>Adiós</strong></p>
Community Bonding - End Report2017-05-30T00:00:00+00:00https://shikharj.github.io//2017/05/30/Community-Bonding-End-Report<p>Greetings!</p>
<p>The Community Bonding period is officially closed and its time for the official coding period to begin. I had a great time reaching out to other fellow GSoCers in the community as well as conversing with my mentors over the project plans.</p>
<h3 id="the-tasks">The Tasks</h3>
<p>Last week, I had mentioned that I’d be working on porting over <code class="language-plaintext highlighter-rouge">SymEngine</code> for <code class="language-plaintext highlighter-rouge">Parsing</code> and <code class="language-plaintext highlighter-rouge">Physics</code> modules. However, as pointed out by <a href="github.com/isuruf">Isuru</a>, there was no real gain in working on <code class="language-plaintext highlighter-rouge">Parsing</code>, as we already had a parser in <code class="language-plaintext highlighter-rouge">SymEngine</code>. Hence, my focus shifted on <code class="language-plaintext highlighter-rouge">Physics</code> and its sub-modules. As such, I’ve pushed in two PRs, covering <code class="language-plaintext highlighter-rouge">ContinuumMechanics</code>(<a href="https://github.com/sympy/sympy/pull/12660">#12660</a>) and <code class="language-plaintext highlighter-rouge">Hep</code>(<a href="https://github.com/sympy/sympy/pull/12655">#12655</a>) sub-modules to keep a track of the work. I’ve also been able to weed out most of the compatibility issues in the standalone files of <code class="language-plaintext highlighter-rouge">Physics</code> module.</p>
<p>Though I had planned on finishing these tasks within the Community Bonding period itself, I realised that the <code class="language-plaintext highlighter-rouge">Quantum</code> and <code class="language-plaintext highlighter-rouge">Optics</code> sub-modules require a bit more work than what I had originally planned for the time. Nevertheless, I started off implementing <code class="language-plaintext highlighter-rouge">Relationals</code> in <code class="language-plaintext highlighter-rouge">SymEngine</code>, which was a task originally planned for the first week of the coding period. The PR(<a href="https://github.com/symengine/symengine/pull/1276">#1276</a>) is currently under review, and would be ready to merge within a day or two. The time gained thus will be devoted to the previously mentioned work, apart from what was originally planned in my proposal.</p>
<p>Besides, I also sent a PR(<a href="https://github.com/symengine/symengine/pull/1277">#1277</a>) fixing some minor grammatical errors which I stumbled upon in the codebase.</p>
<p>See you next week! Goodbye!</p>
Community Bonding - Progress Report2017-05-16T00:00:00+00:00https://shikharj.github.io//2017/05/16/Community-Bonding-Progress-Report<p>Hello there!
It is the half-time in Community Bonding period, which will be officially closed in a couple of weeks. Since its been two weeks since I last posted, I thought it would be better to provide an update about the progress made.</p>
<h3 id="community-bonding">Community Bonding</h3>
<p>I had a number of conversations with <a href="https://github.com/isuruf">Isuru</a>, a lot of which cornered around PR reviews and workarounds, and the plans for the next two weeks.</p>
<p>As a part of the community bonding, I’m becoming comfortable with <code class="language-plaintext highlighter-rouge">Cython</code> syntax and programming nuances by the day. Though I’m not completely thorough with the language, I think undertaking some amount of work would be the best way through.
Here is a gist of the work I undertook till now:</p>
<p><strong>Merged</strong></p>
<p><strong>SymEngine</strong></p>
<p><a href="https://github.com/symengine/symengine/pull/1269">#1269</a> Implemented additional functionalities for class <code class="language-plaintext highlighter-rouge">DenseMatrix</code></p>
<p><strong>SymEngine.py</strong></p>
<p><a href="https://github.com/symengine/symengine.py/pull/140">#140</a> Implemented <code class="language-plaintext highlighter-rouge">Float</code> class and ported functions to <code class="language-plaintext highlighter-rouge">sympy/sympy_compat.py</code></p>
<p><a href="https://github.com/symengine/symengine.py/pull/129">#129</a> Introduced <code class="language-plaintext highlighter-rouge">MutableDenseMatrix</code> and <code class="language-plaintext highlighter-rouge">ImmutableDenseMatrix</code> in <code class="language-plaintext highlighter-rouge">symengine_wrapper.pyx</code></p>
<p><strong>Pending</strong></p>
<p><strong>SymEngine</strong></p>
<p><a href="https://github.com/symengine/symengine/pull/1267">#1267</a> Removing redundant <code class="language-plaintext highlighter-rouge">inline</code> declarations and moving implementations to <code class="language-plaintext highlighter-rouge">.cpp</code> files from the headers</p>
<p><a href="https://github.com/symengine/symengine/pull/1251">#1251</a> Applying <code class="language-plaintext highlighter-rouge">-Wsign-conversion</code> flag and fixing the warnings</p>
<p><strong>SymEngine.py</strong></p>
<p><a href="https://github.com/symengine/symengine.py/pull/128">#128</a> Making <code class="language-plaintext highlighter-rouge">Subs</code> and <code class="language-plaintext highlighter-rouge">Derivative</code> classes closer to their <code class="language-plaintext highlighter-rouge">SymPy</code> implementations</p>
<p><a href="https://github.com/symengine/symengine.py/pull/126">#126</a> Wrapping <code class="language-plaintext highlighter-rouge">Min</code> and <code class="language-plaintext highlighter-rouge">Max</code> functions from SymPy</p>
<p><code class="language-plaintext highlighter-rouge">SymEngine.py</code> has a planned release (<code class="language-plaintext highlighter-rouge">0.3.0</code>) scheduled for the 29th of this month, right before the official coding period begins. Hence, I will most probably be working on the pending PRs in the coming days.</p>
<p>In my proposal, I had also planned on porting over <code class="language-plaintext highlighter-rouge">SymEngine</code> as a backend for simpler modules such as <code class="language-plaintext highlighter-rouge">Physics</code> and <code class="language-plaintext highlighter-rouge">Parsing</code>, which would be my main goal for now, and I’ll continue with this till the Community Bonding period ends.</p>
<p>Catch you later!</p>
Google Summer of Code with SymPy2017-05-04T00:00:00+00:00https://shikharj.github.io//2017/05/04/Google-Summer-of-Code-with-SymPy<p><img align="middle" src="/assets/GSoC.png" /></p>
<p>Hi!</p>
<p>The Google Summer of Code results are out and I have been selected. My project, <code class="language-plaintext highlighter-rouge">Improving SymEngine's Python Wrappers and SymPy-SymEngine Integration</code> has been chosen and I’ll get to work with <a href="https://github.com/symengine/symengine">SymEngine</a> and <a href="https://github.com/sympy/sympy">SymPy</a> communities.</p>
<h3 id="exciting-times">Exciting Times!</h3>
<p>I really thank the community for accepting me as a freshman to work on a project. The community over at <code class="language-plaintext highlighter-rouge">SymPy</code> and <code class="language-plaintext highlighter-rouge">SymEngine</code> is really helpful and motivating.</p>
<p>My mentors are <a href="https://github.com/sumith1896">Sumith Kulal</a> and <a href="https://github.com/isuruf">Isuru Fernando</a>, both of them being previous GSoC-ers at <code class="language-plaintext highlighter-rouge">SymEngine</code> (then <code class="language-plaintext highlighter-rouge">CSymPy</code>).</p>
<p>I’d also like to congratulate <a href="https://github.com/ranjithkumar007">Ranjith</a>, for getting a project under <code class="language-plaintext highlighter-rouge">SymEngine</code> and all others who have been selected under <code class="language-plaintext highlighter-rouge">SymPy</code> in general.</p>
<h3 id="sympy-and-symengine">SymPy and SymEngine</h3>
<p><img style="float: right" src="/assets/sympy.png" /></p>
<blockquote>
<p><code class="language-plaintext highlighter-rouge">SymPy</code> is a Python library for symbolic mathematics. It aims to become a full-featured <a href="http://en.wikipedia.org/wiki/Computer_algebra_system">Computer Algebra System</a> (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible.</p>
</blockquote>
<blockquote>
<p><code class="language-plaintext highlighter-rouge">SymEngine</code> is a fast symbolic manipulation library, written in C++. Optional thin wrappers allow usage of the library from other languages. It plans to serve as a symbolic backend for the <code class="language-plaintext highlighter-rouge">SymPy</code> CAS.</p>
</blockquote>
<p>Looking forward to a great summer!</p>
Hello Blogging!2017-03-15T00:00:00+00:00https://shikharj.github.io//2017/03/15/Hello-Blogging!<p>My very first blog post. This blog’s purpose is primarily to track the progress of my GSoC project and get feedback from my mentors, if my proposal gets selected. I propose to improve upon the Python wrappers for <code class="language-plaintext highlighter-rouge">SymEngine</code>, and work on rooting it as a symbolic backend for <code class="language-plaintext highlighter-rouge">SymPy</code> CAS, the purpose for which it has been in development for a number of years. My proposal can be found <a href="https://github.com/sympy/sympy/wiki/GSoC-2017-Application-Shikhar-Jaiswal:-Improving-SymEngine's-Python-Wrappers-and-SymPy-SymEngine-Integration">here</a>.</p>
<p>Till Next Time!</p>