<?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 Saravanan Rajendran on Medium]]></title>
        <description><![CDATA[Stories by Saravanan Rajendran on Medium]]></description>
        <link>https://medium.com/@saravananrajendran?source=rss-1ea2546d4e30------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*erLNiHb0jRdadZiN.</url>
            <title>Stories by Saravanan Rajendran on Medium</title>
            <link>https://medium.com/@saravananrajendran?source=rss-1ea2546d4e30------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 04:10:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saravananrajendran/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[Building a search engine, A top-down approach.]]></title>
            <link>https://medium.com/hackonhackathon/building-a-search-engine-a-top-down-approach-10a9e78b2019?source=rss-1ea2546d4e30------2</link>
            <guid isPermaLink="false">https://medium.com/p/10a9e78b2019</guid>
            <category><![CDATA[hackon]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[community]]></category>
            <dc:creator><![CDATA[Saravanan Rajendran]]></dc:creator>
            <pubDate>Fri, 26 Jun 2020 16:38:39 GMT</pubDate>
            <atom:updated>2020-06-28T08:52:03.378Z</atom:updated>
            <content:encoded><![CDATA[<p><em>To give you context, I recently participated in </em><a href="https://hackon.tech/"><strong><em>HackOn</em></strong></a><em>, a pan India Hackathon, and won the title</em><strong><em> ‘Best use of </em></strong><a href="http://elastic.co/"><strong><em>Elastic</em></strong></a><strong><em>’</em></strong><em>. We a team of 4 built a production-ready search engine to retrieve data from scientific research papers related to COVID19. I would like to share how we built it.</em></p><p>Here’s the link to the project we made: <a href="https://devfolio.co/submissions/research-3">https://devfolio.co/submissions/research-3</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKvrjvykyfbP04wa_kQHFg.png" /></figure><p>Our search engine is a web app, powered by React, Node, Elastic, RabbitMQ, PyTorch, and web sockets. So yeah we made use of all the hot trending technologies out there, which helped us a lot in getting things up and running quickly instead of re-inventing the wheel.</p><h3>Designing a search engine</h3><p>The idea was simple enough, take a search query, extract keywords from a search query. Use those keywords to search for relevant papers and rank them using deep learning. Also, we had one more feature where we highlight the answer from each paper if its relevant to the search query. Simple enough right?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fd2ZcfODrNWlA5Gg0%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fd2ZcfODrNWlA5Gg0&amp;image=https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2Fd2ZcfODrNWlA5Gg0%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/718b217b63ccbb08a70746cde0e82607/href">https://medium.com/media/718b217b63ccbb08a70746cde0e82607/href</a></iframe><blockquote>To appreciate a solution, you should understand the problem.</blockquote><h4><strong>Let me explain the problems we faced and how we designed it.</strong></h4><p>1. Extracting relevant paper for a keyword from 50,000+ corpus of scientific data in real-time. <br>2. The deep learning model we planned to use occupies around 6 GB of RAM. It took around 3 seconds to process the given search query and the unordered data from the search pipeline. <br>3. The third problem is the cause of the solution to the second problem, go on, keep reading to find what is the last problem.</p><h3>How to extract relevant paper with keywords?</h3><p>We can actually implement simple TF-IDF ourselves. But it should be executed for every search query. We wanted to reduce the time to search for a result. We can write an efficient code to do TF-IDF in c, but it will take some time to get it up and running in a production environment. So we turned towards an optimized solution that would work out of the box. <a href="https://www.elastic.co/">Elasticsearch</a> according to its homepage, is a distributed, open-source <strong>search</strong> and analytics engine for all types of data, including <strong>textual</strong>, numerical, geospatial, structured, and <strong>unstructured</strong>. <br>With elastic, we can do a full-text search with keywords and internally implements TF-IDF. It would return us a ranked list of papers related to the keywords. Since the data is indexed with the abstract of the paper, the search is super fast and the results are relevant to the keywords. This solved the problem of getting results for keywords.</p><blockquote><strong>Bonus problem: </strong>Extracting keywords from query is easy, but what if the query has very little keywords? <br>We can solve that problem by appending similar words from word2vec model trained on the corpus.</blockquote><h3>How to run a deep learning model in a webApp?</h3><p>Why running a deep learning model in production is difficult? Because the model occupied 6GB RAM while inferencing the result. So running multiple instances of the model in a single machine has two disadvantages. <br>1. One machine should have (Number of instance*6)GB of RAM.<br>2. Since we were not training the model, we are using the CPU for inferencing, which is fairly fast. But inferencing two or more instances in a single machine is undesirable and will be slow if multiple instances are used.</p><p>So many requests may come to the server, but we constantly have one instance of deep learning model serving them, which is a bottleneck. You could imagine the consequences, we won’t process other users&#39; request until we process the current one. Or worse we can quickly run out of connections and new requests will be dropped. We need to take the deep learning model out of the web app flow. It required us to put the request in some form of storage, close the request, process it, and return the result. So we used RabbitMQ as our message queue. So whenever a request comes in, the server puts it in RabbitMQ and closes the request with 201 HTTP status (Request received, yet to be processed). We then run the Deep learning model as a separate worker process away from the server, which reads from the message queue whenever it is free and returns the result.</p><p>So yeah, we successfully hosted a deep learning model. Is that it?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FT5QOxf0IRjzYQ%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FT5QOxf0IRjzYQ%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FT5QOxf0IRjzYQ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="327" frameborder="0" scrolling="no"><a href="https://medium.com/media/47db985b5e2841c58169e9c377661ce5/href">https://medium.com/media/47db985b5e2841c58169e9c377661ce5/href</a></iframe><p>We still have one more problem. We were sending 201 to the users but not the results.</p><h3>How to send a search result to a client?</h3><p>We have two solutions, we can poll the server for the result. But polling brings us back to square one, where the server would be flooded with a lot of requests. To make it simple we can use WebSockets. Of course, this will require another WebSocket server, but it is better than polling. It is very efficient on the resources used for the transmission.</p><blockquote><strong>Bonus problem: </strong>How do we synchonize the status and result of the job queued in message queue? <br>We can track the status of a job using an Unique Id in some persistent storage (DB) or in-memory. In our app we will not be doing any concurrent updates to a particular job. So the status and result can be stored or we can have another message queue between the worker and the websocket server which reads from the queue and sends it to the client.</blockquote><p>If you liked the design, feel free to applaud for the post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10a9e78b2019" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackonhackathon/building-a-search-engine-a-top-down-approach-10a9e78b2019">Building a search engine, A top-down approach.</a> was originally published in <a href="https://medium.com/hackonhackathon">HackOn</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“To develop better software, you need SOLID principles.]]></title>
            <link>https://medium.com/swlh/to-develop-better-software-you-need-solid-principles-bb27938cb88f?source=rss-1ea2546d4e30------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb27938cb88f</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[coding-style]]></category>
            <category><![CDATA[object-oriented-design]]></category>
            <category><![CDATA[solid-principles]]></category>
            <dc:creator><![CDATA[Saravanan Rajendran]]></dc:creator>
            <pubDate>Mon, 25 May 2020 15:42:12 GMT</pubDate>
            <atom:updated>2020-05-26T12:58:18.133Z</atom:updated>
            <content:encoded><![CDATA[<h3>To develop better software, you need “SOLID principles”.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8q5Ig2JvUCJZrbU3nEBQw.png" /></figure><p>To develop software without bugs, which is robust and maintainable is no easy task. When you follow OOD (Object-Oriented Design) to achieve good quality of code, you need some SOLID principles, literally.</p><h4>What is “SOLID principles”?</h4><blockquote>In <a href="https://en.wikipedia.org/wiki/Object-oriented_programming">object-oriented computer programming</a>, <strong>SOLID</strong> is a <a href="https://en.wikipedia.org/wiki/Mnemonic">mnemonic</a> <a href="https://en.wikipedia.org/wiki/Acronym">acronym</a> for five design principles intended to make software designs more understandable, flexible and <a href="https://en.wikipedia.org/wiki/Software_maintenance">maintainable</a>. (source: Wikipedia)</blockquote><p>S.O.L.I.D is a <a href="https://en.wikipedia.org/wiki/Mnemonic">mnemonic</a> acronym of five principles, which is helpful in <a href="https://en.wikipedia.org/wiki/Object-oriented_design">OOD</a>. The five principles are as follows.</p><ul><li>Single Responsibility Principle</li><li>Open Closed Principle</li><li>Liskov Substitution Principle</li><li>Interface Segregation Principle</li><li>Dependency Inversion Principle</li></ul><h4>Why SOLID principles?</h4><p>According to Wikipedia following the principles in SOLID should help us write better code. But you should ask your self, I am working in a relatively small requirement and the code change for that is, small. Why should I invest my time in reading random principles and implementing the same? Let us discuss the principles and you will realise the answer at the end.</p><h4>Single Responsibility Principle (SRP):</h4><blockquote>SRP states that every module or class should only have one responsibility.</blockquote><p>In simple terms, if you want to your module or class to follow SRP, then the class or module should be implemented in a way, where modification to that module or class can occur because of only one reason.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D66J0nA3_h_XPFJA2uPNVQ.png" /></figure><p>Observe Fig 1.1. Student class has two methods, getTotalMarks and getAttendance. This class does not follow SRP. Because in future, its code can be changed for two reasons. They are</p><ul><li>Implementation of getTotalMarks might change from cumulative to relative grading.</li><li>Implementation to calculate attendance might change.</li></ul><p>Observe Fig 1.2. Student class has only one method getTotalMarks and getAttendance is given its own class AttendanceManager. So whenever attendance manager changes, it will not affect the Student class as long as the <a href="https://en.wikipedia.org/wiki/Precondition">pre-condition</a> and <a href="https://en.wikipedia.org/wiki/Postcondition">post-condition</a> remain the same.</p><h4>Open-Closed Principle (OCP)</h4><blockquote>OCP states that a class or module should be open for extension and closed for modification</blockquote><p>This principle states that a class or module should be designed and consumed in a way which makes it easy to extend the functionality but discourages the modification to the existing class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGT-bS-Z5jBLPUQKKsqQiQ.png" /></figure><p>In Fig2.1, we have a Student class which has getTimeTable method. But this would depend on the AbstractStream. So whenever a new stream is added in that college, Student will get new timetable without any modification to Student Class. We can just extend the AbstractStream and add new Streams.</p><p>Here BioTechnology, DataScience classes need not be changed whenever a new course is added. Those two classes will never know the existence of other streams. Thus extending AbstractStream is simple and does not modify the already existing code.</p><h4>Liskov Substitution Principle (LSP)</h4><blockquote>Liskov Substitution Principle states that the objects of the Super class should be replaceable with the objects from the subclass.</blockquote><p>To Achieve LSP, we should design the classes and their subclasses with similar methods. In typed languages, most of the rules in this method is taken care of. So one thing we need to note in this principle is that the exceptions thrown by the subclass should be within the range of exceptions that can be thrown by the parent class. Again typed languages takes care of checked exception, but the problem arises in unchecked exceptions.</p><h4>Interface Segregation Principle (ISP)</h4><blockquote>ISP states that no client should be forced to be dependent on the methods it does not use.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UlMEMCb1r2pNscMzfDQuaQ.png" /></figure><p>This principle is straight forward. Let us assume an interface called DataManager as shown in Fig3.1. That has two methods getTeacherData and getStudentsData. Students class is implementing DataManager, so it will implement getStudentdsData with required steps. But it should also implement or at least have an empty declaration for getTeacherData also. So Student class does not have a dependency on getTeacherData method but it is still forced to implement it. To avoid this problem we segregate the interface and Student class implements StudentDataManager and getTeacherData gets its own interface. UML in Fig 3.2 obeys ISP.</p><h4>Dependency Inversion Principle (DIP)</h4><blockquote>Dependency Inversion Principle talks about the high-level classes depending on abstractions instead of low-level implementations.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8k_ChbCaG-PiiqNd4jRneA.png" /></figure><p>Let’s take an example of a team, where a manager has to manage a developer and a designer. Fig 4.1 represents the Manager and his employees. So to get work done manager has to execute getDesignWorkDone and getDeveloperWorkDone respectively on designer and developer. Here Manager is tightly coupled because he is dependant on low-level implementation (designer and developer and concerned about how they get their work done). In other words, this Manager is not a good one, because he is micro-managing things. He only knows to manage only two kinds of employees.</p><p>In Fig 4.2 we have an abstract class Employee, here the Designers and Developers extend employee and implement work in their class. So the Manager just has to call work on Employee class. Even if another Employee is added in his team, the manager would still get the work done from all of them, without affecting the Manager and the other Employees.</p><p>In Fig 4.1 the flow is from Top to bottom, So High-level module Manager is dependant on low-level implementation. But in Fig 4.2, The High-level module is dependant on abstraction instead of implementation. Also, the low-level implementation is also derived from abstractions.</p><p>So those were the five S.O.L.I.D principles. The fact that it makes your code readable, robust and clean does not mean that you should always use them in all the places. These principles are powerful, also designing and implementing them will take more time. It is easy to over-engineer a class that will not change in the immediate future, thus wasting your time. So use these principles wherever they seem fit and not everywhere. I hope you would remember these principles the next time you code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb27938cb88f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/to-develop-better-software-you-need-solid-principles-bb27938cb88f">“To develop better software, you need SOLID principles.</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Perceptron and Visualization]]></title>
            <link>https://medium.com/@saravananrajendran/introduction-to-perceptron-and-visualization-21e640a27c8e?source=rss-1ea2546d4e30------2</link>
            <guid isPermaLink="false">https://medium.com/p/21e640a27c8e</guid>
            <category><![CDATA[perceptron]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[plotly]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Saravanan Rajendran]]></dc:creator>
            <pubDate>Sun, 10 Feb 2019 03:40:00 GMT</pubDate>
            <atom:updated>2024-01-18T10:38:58.823Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*vnMSZ9Oeb3yLFJZG669cCA.png" /></figure><p>Hey there. I hope you are doing well. In my <a href="https://thetechcache.science/dl-series-setup/">last post</a>, we had set up the required environment. Let us get started with today’s post about perceptron.</p><blockquote><em>A perceptron is the fundamental unit of a neural network. It is an algorithm for supervised learning (we say what is right and wrong) for binary classification (either zero or one).</em></blockquote><p>Perceptron is also a basic mathematical model of a neuron. It tries to replicate the work of a neuron. So to implement a perceptron let us study a little bit about neuron.</p><h3>Neuron</h3><p>We know neurons are the basic building block of the brain (A massive and complex neural network).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*3jLssUZoh7uamJfw.png" /><figcaption>Image Source — Wikipedia</figcaption></figure><p>So this was the guy I was talking about. Let us see the functions of this guy on a very high level of abstraction.</p><ul><li>He takes in the signal from other neurons through dendrites.</li><li>It will process the signal in the nucleus.</li><li>Passes the processed information to other cells via the Axon Termina.</li></ul><p>So let us try to come up with a model that replicates the neuron’s activity to some extent.</p><h3>Birth of the perceptron</h3><p>Perceptron <em>tries</em> to do above-mentioned activities. Let us try to model one.</p><p>So what it should do?</p><ul><li>It can take \(n\) number of inputs.</li><li>Does some computation on the input.</li><li>Passes it through a non-linear function (Very important).</li><li>Produces a single output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*KgpipqYR7LyIkQF2.png" /></figure><p>\(x_i\) is the \(i^{th}\) input. \(W_i\) is the weight value corresponding to the \(i^{th}\) input.</p><p>\(\sigma\) is the activation function.</p><p>We multiply all \(x_i\) with \(W_i\) and sum them to produce a single output which is then fed into an activation function to produce the output. This is our model of the neuron.</p><h3>Why Activation?</h3><p>Activation functions are non-linear, meaning their graph is not a straight line. The usage of non-linearity is helpful in approximating any function given we have a sufficient number of units.<br>Let us consider one activation function called as step function.</p><h3>Step function</h3><p>\( S(x) = \begin{cases} 1,&amp; \text{if } x\geq 0 \\ 0,&amp; \text{if } x\lt 0</p><p>\end{cases} \)</p><p>As we see below. \( x \) can take values from \( {-\infty} \) to \( {\infty} \)</p><p>\( S(x) \) can take values from \( 0 \) to \( 1 \)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*H8giiFBYOpoiwaEv.png" /></figure><p>Here the graph is not a straight line and its slope at different points are different.</p><h3>Enough of Theory, Let us start coding.</h3><p><em>We have modelled our perceptron, now let us see what it can do.</em></p><p>Fire up your jupyter notebook by using this command</p><pre>$ jupyter notebook</pre><p>Create a new notebook named Exercise-2</p><h3>Import the following modules</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6349b53bef70d53069a92ee4956b9acf/href">https://medium.com/media/6349b53bef70d53069a92ee4956b9acf/href</a></iframe><h3>Let us create a perceptron</h3><p>Here we model a Perceptron using a class and it has some important methods which are used to mimic the action of the real neuron to some extent. The Complete code is given below for you to try and a break down of the components is also provided.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f24a6bb3121e9542da8c184cf291a68/href">https://medium.com/media/2f24a6bb3121e9542da8c184cf291a68/href</a></iframe><p>Let us break down the code.</p><p>We have an internal State W for our perceptron, which has to be learned. The size of the state is the number of inputs plus one. It is because it gives us a way to integrate the bias inside the W matrix itself if we can pad the input with one. This would be an easy implementation of<br> $$ W*x + b $$</p><p>So the perceptron has been initialized. Now we can know more about the other methods in the perceptron.</p><h3>step_function</h3><p>This takes a single input and applies the step_function which gives us output in binary.</p><h3>forward</h3><p>This takes in an array of input and performs an element-wise multiplication and sums it to give a single output (dot product). Then it is passed to a non-linear activation. This would yield an output, either 1 or 0. This is where the decisions are made about the data.</p><h3>loss</h3><p>This function acts as a critic. This guy has both the predicted value and the original label. He compares both of them and teaches the perceptron on the correct and wrong things.</p><h3>back_propagate</h3><p>This takes the inputs from the loss function and adjusts the weights of \( W \).</p><h3>batch_train</h3><p>This function takes the input and feeds it to the network and trains the perceptron.</p><h3>Analogy</h3><p>Let us consider the forward function as a student who is going to a school.</p><ul><li>Let \( W \) represent his actions in a test.</li><li>So forward is the action of taking the test.</li><li>The loss function is like a teacher who corrects his paper and tells him what is wrong and what is correct.</li><li>back_propagate are the parents of that student. They take input from the teacher and correct his actions so that he can earn more marks in the next exam.</li></ul><p>Now our perceptron is ready. Let us use this to approximate AND function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04544cfb935133b0a808713d9d064e16/href">https://medium.com/media/04544cfb935133b0a808713d9d064e16/href</a></iframe><p>Here the AND gate takes two inputs and its learning rate is 0.5. You can change and see the learning rate and see what happens. The last line prints the value of AND gate’s output when both the inputs are 1. Now try with different inputs.</p><h3>Do you have some burning question about this?</h3><p>Because I had some questions when I first heard about this.</p><h3>How do we know when the perceptron is ready?</h3><p>Since we know all the inputs that this perceptron will ever get and luckily it is small, we can use all the data to train the perceptron. So in this case when the loss value goes to zero, we know that our perceptron is ready for action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*bnY6LuJeIJLg1k_A.png" /></figure><p>We know after the 5 th epoch the perceptron has seen all the possible inputs and correctly classified them.</p><h3>What is the correct number for learning rate and epochs?</h3><p>The answer is we don&#39;t know. They are called as hyperparameter. We can use the trial and error method to find the correct numbers.</p><h3>We know that it works, but how does it work?</h3><p>This is a classification problem, where we should separate the given data into \( 0 \) or \( 1 \). All the inputs yields either \( 0 \) or \( 1 \). So the perceptron classified them correctly. It somehow knows inputs with two one should be classified as one and all other should be zero. So how does it know this? The answer to the above question is that it tries to create a boundary line between data points(Linearly separable). In this case, it creates a plane which divides the input points which yields zero and one separately.</p><p><a href="https://plot.ly/~thunderbo1t/14.embed">Decision plane of And Gate | surface made by Thunderbo1t | plotly</a></p><p>Here three points are separated by the plane. Those three points lie under the plane and one point lies above it. That plane is the decision plane. The inputs to the AND gate is mapped to X and Y in the graph. The XY points below the plane belong to one class and points above the plane belongs to another class.</p><h3>Okay. How does the perceptron know the plane?</h3><p>The perceptron starts with a random plane in 3-Dimension and moves it so that it could separate the inputs based on their class. This is where the loss function and the backpropagation come into the picture. Loss function evaluates the current plane and finds where it goes wrong and by means of backpropagation teaches the perceptron.</p><h3>Where is the code for the graphs and 3D plots?</h3><p>It is this <a href="https://github.com/thunderbo1t/DeepLearningSeries/tree/master/Perceptron">git-repo</a>. Try out the code for yourself and tinker with it. Use this <a href="https://nbviewer.jupyter.org/github/thunderbo1t/DeepLearningSeries/blob/master/Perceptron/Exercise-II.ipynb">link</a> to view the executed outputs. Feel free to ask your questions in comments.</p><h3>In my next blog…</h3><ul><li>Sneak peek at a Neural Network.</li><li>The relation between a perceptron and a Neural Network.</li><li>Training a single layer perceptron network.</li><li>Evaluation and Testing it.</li></ul><p><em>Originally published at </em><a href="https://thetechcache.science/dl-series-i/"><em>thetechcache.science</em></a><em> on February 10, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21e640a27c8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Learning Series — Setup]]></title>
            <link>https://medium.com/@saravananrajendran/deep-learning-series-setup-a807fee887c0?source=rss-1ea2546d4e30------2</link>
            <guid isPermaLink="false">https://medium.com/p/a807fee887c0</guid>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[matplotlib]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Saravanan Rajendran]]></dc:creator>
            <pubDate>Sat, 05 Jan 2019 16:55:19 GMT</pubDate>
            <atom:updated>2019-01-05T16:55:19.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*l_R-xIFzPLzK1-pxv_4A1w.png" /></figure><p>Hey there, you want to become a prodigy in Deep learning or looking out for some cool projects to work on? Then you are in the right place. I welcome you the series of Deep Learning posts.</p><p><strong>What you get out of this series?</strong></p><ul><li>In-Depth knowledge in Deep Learning</li><li>Easy to fiddle code</li><li>Visualization of things happening in the back-end.</li></ul><p>So let&#39;s get started with our setup.</p><p><strong>What do you need to get things started?</strong></p><p><strong>What do you need to get things started?</strong></p><ul><li>Python-3</li><li>Pip3</li><li>Numpy for python-3</li><li>Matplotlib for python-3</li><li>Jupyter-Notebook</li></ul><p>We can use Windows, MAC or Ubuntu. I strongly suggest the use of Ubuntu (It has a lot of community support).</p><h3>Installation in Ubuntu</h3><h3>Installing python3 and pip</h3><ul><li>You will already have python3 installed in Ubuntu.</li><li>Press Ctrl+Alt+t to open a terminal</li><li>Install pip3 by typing this command in terminal.</li></ul><pre>$ sudo python3 -m pip install -U pip</pre><ul><li>To verify install, type in terminal</li></ul><pre>python3 --version </pre><ul><li>Now you are good to proceed.</li></ul><h3>Installing numpy, matplotlib</h3><ul><li>In a terminal, type</li></ul><pre>sudo -H pip3 install numpy matplotlib</pre><ul><li>Now you are done with the installation of numpy and matplotlib</li></ul><h3>Installing jupyter notebook</h3><ul><li>Open a terminal</li><li>Type</li></ul><pre>$ sudo apt update <br>$ sudo apt-get -y install ipython ipython-notebook <br>$ sudo -H pip3 install jupyter</pre><ul><li>To check if it works, type the following in a terminal</li></ul><pre>$ jupyter notebook</pre><ul><li>The above command will open a session of your home directory in your default browser.</li><li>Press, Ctrl+c, type y and hit enter in the terminal to stop the jupyter notebook.</li></ul><h3>Get your hands dirty</h3><ul><li>Lets fire up the jupyter notebook by typing the following in the terminal</li></ul><pre>$ jupyter notebook</pre><ul><li>This would open a session in your default browser. If not, open a browser and type localhost:8888 in the URL bar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tCU27BMIJe_yPJRx-695GA.png" /><figcaption>Start a New notebook in jupyter notebook</figcaption></figure><ul><li>That opens a new tab in the browser. This is where we code. (yes we will code in a browser)</li><li>Rename your notebook by changing the untitled to Exercise-1 in the top left corner</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PIwKHnFqyziUuOwQl6XJpQ.png" /><figcaption>Renaming a Notebook</figcaption></figure><p>Let us get started by importing the required modules. (Type the following lines in the green box and execute the code by pressing shift+enter)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62c17350d86c4eded200f0159213c436/href">https://medium.com/media/62c17350d86c4eded200f0159213c436/href</a></iframe><p>If everything has been installed without error, then you should see</p><blockquote><em>Numpy and matplotlib has been successfully installed</em></blockquote><p>So what? It works. But <em>What is Numpy and matplotlib</em>? <br>Numpy is a fundamental package for scientific computing. It fast and efficient implementation of matrix multiplication. Matplotlib is also a package used for visualisation. (Feel free to google on these packages to know more)</p><p><strong>Let us create a list of integers.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4515396a80f4f9a78972074b76d293f/href">https://medium.com/media/f4515396a80f4f9a78972074b76d293f/href</a></iframe><p>This code will create a list of integers from 0 to 9 and store it in <strong>list_of_integer</strong>. But these list of integers is not efficient to perform mathematical operations. So we shall convert them to numpy array.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bee2cc5d16c0d0705fa52f1d439e6687/href">https://medium.com/media/bee2cc5d16c0d0705fa52f1d439e6687/href</a></iframe><p>This will create the list_of_integer into a numpy array and store it in x_axis. we shall create another numpy array with random values in the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c80197d9e28e43c7134d48a0b891957/href">https://medium.com/media/6c80197d9e28e43c7134d48a0b891957/href</a></iframe><p>Let us plot the x_axis and y_axis in the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14d20617a37df6fa6bdcfd320fe00620/href">https://medium.com/media/14d20617a37df6fa6bdcfd320fe00620/href</a></iframe><p>So with this, the setup is complete. You can now save and shut down the kernel. For the original notebook visit my <a href="https://github.com/thunderbo1t/DeepLearningSeries">github page</a>.</p><h3>In my next post, you can expect</h3><ul><li>Easy-Math behind Neural networks</li><li>Working of a perceptron</li><li>Implementation of a perceptron</li><li>Visualization of a perceptron</li></ul><p><em>Originally published at </em><a href="https://thetechcache.science/dl-series-setup/"><em>thetechcache.science</em></a><em> on January 5, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a807fee887c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Intern]]></title>
            <link>https://medium.com/@saravananrajendran/my-first-intern-a2cb02cd4ef2?source=rss-1ea2546d4e30------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2cb02cd4ef2</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[leadership-development]]></category>
            <dc:creator><![CDATA[Saravanan Rajendran]]></dc:creator>
            <pubDate>Thu, 13 Jul 2017 18:58:51 GMT</pubDate>
            <atom:updated>2017-09-09T05:04:53.661Z</atom:updated>
            <content:encoded><![CDATA[<p>So it was the starting of my fourth semester vacation. Everyone was trying out something new in that vacation. I had no idea of what to do. Then came my department to the rescue (I am actually an under graduate student pursuing B.Tech IT) . They informed us about the test that held in <a href="https://myswots.com/">https://myswots.com/</a> . We ,a team of 6 were selected for the intern. It was the “First Intern Program” , for all of us. We had no idea about this intern and the stuff we were about to do. But for sure, I knew that I will not waste my vacation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5u-JkkZdYpKsrfFy_pqTQ.png" /><figcaption>mySWOTS is a platform where teachers and students come together and make learning much more enjoyable.</figcaption></figure><p>We had two tasks to be completed in this intern. I have learnt the concepts in classes but I was not able to apply them, yet it in my life. But mySWOTs intern provided us with the platform to apply those knowledge to the real life problems in elegant way.</p><h3>Things that I learned.</h3><p>Before this intern , I had never really worked in a team (<a href="https://github.com/thunderbo1t">Except for my projects</a>). So this was my first time I really worked in team. I learned a lot of things about others in my team. We had real diversity in the team. Some of us were interested in front end, some in back end and some interested in content writing. The most important thing I learned from this intern was.</p><p>“Never let anyone feel left-out.”</p><p>I had learned this the hard way. While working in a team , the most important thing is your “Team”. Never let anyone in the team breakdown. At the beginning we had communication issues. Because of this we missed out deadline and we were redoing the same stuff and worse I did not notice the work done by others. This made most of my team mates feel left-out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*kwkXHPMVCdhELPLZsWrPlA.jpeg" /></figure><p>That was the major face palm moment for me. So how did I work this out?(keep reading to find out, it is kind of too late to back off now :P )</p><p>I always share and discuss things with my close friend, who was not a part of this team and he asked me to understand the team mates first and to work next. So I tried observing the team and things I learned follows:</p><h4><strong>How to work in a team, as a team? (And I had to learn this the hard way)</strong></h4><ul><li>Not everyone works in the same pace as others. So the tasks had to be distributed to the team so that no one feels left out.</li><li>Appreciation is very much important in team work. We need to appreciate others for their work.</li><li>Some might know certain things and some may not. <strong>It is okay to not know things. </strong>But we should learn it, if the situation demands it.</li><li>At least once in a week the team should meet, share their work. It would not hurt to crack some jokes and share the experience .</li><li>And most importantly , Team leaders just represent their team and they are not the Team.</li></ul><p>So I always say this to my-self all the time and it turned out to be a pretty good experience for all of us (I hope :P).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2cb02cd4ef2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>