<?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 Prajwol Lamichhane on Medium]]></title>
        <description><![CDATA[Stories by Prajwol Lamichhane on Medium]]></description>
        <link>https://medium.com/@prajwollamichhane11?source=rss-cef56ad575b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*P_d3i09-s5d5T9kH0yuWJg.jpeg</url>
            <title>Stories by Prajwol Lamichhane on Medium</title>
            <link>https://medium.com/@prajwollamichhane11?source=rss-cef56ad575b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:12:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prajwollamichhane11/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[Python PDF Handling Tutorial]]></title>
            <link>https://prajwollamichhane11.medium.com/python-pdf-handling-tutorial-c129a40f0eab?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c129a40f0eab</guid>
            <category><![CDATA[pdf-converter]]></category>
            <category><![CDATA[file-handling]]></category>
            <category><![CDATA[pdf-reader]]></category>
            <category><![CDATA[pdf]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Wed, 28 Jul 2021 13:47:23 GMT</pubDate>
            <atom:updated>2021-07-28T13:47:23.144Z</atom:updated>
            <content:encoded><![CDATA[<p>Python is a highly versatile language with a huge set of libraries. It is a high-level language with simple syntax. Python has a reach in various fields like Machine Learning, Cybersecurity, Web Development, Application Development etc. Thus, this language is mostly preferred among developers and engineers.</p><p>In this tutorial, we will be working on PDFs using Python. PDFs or the Portable Document Format is a file format of a document consisting of texts, images, tables, etc which are generally used when we need to save files that cannot be further modified or be easily shared or printed. This file format was developed by Adobe in 1993 to present documents, including formatted texts and images in a manner that is independent of applications, software, hardware and operating systems.</p><p>Here, we will be performing some serious stuff like: Extracting and Adding Pages, Texts, Images, Tables, Watermark and much more on a PDF file using Python.</p><h3><strong>Popular Python PDF Libraries</strong></h3><p>Python provides a pool of libraries that are used to manipulate a PDF file. Some popular libraries that are used often while working with PDFs are:</p><ul><li>PDFMiner</li><li>PyPDF4</li><li>PyPDF2</li><li>Python-Docx</li><li>PyMuPDF, etc.</li></ul><p>While several libraries are used to perform various functional operations with PDFs in Python, we will only cover the usage of a few libraries like PDFMiner, PyPDF2, PyMuPDF, reportlab, etc in this chapter. PyPDF2 is the most widely preferred Python module while working with PDFs. It is easy to use and it has a lot of features. However, when it comes to extracting texts, PDFMiner is much more accurate and reliable. PDFMiner was specially developed to extract texts from PDF files. There are several cases where one library is better than the other in different aspects when it comes to manipulating PDF files. Thus, based on easiness and reliability, we will discuss various libraries that are used to manipulate PDF files in this tutorial.</p><h3>Extracting Texts from PDFs</h3><p>PDFs are composed of different contents like Texts, Images, Tables, Forms, etc. PDFs are graphical representations of information. They provide information on the exact position of a display or a paper. But, they do not have a logical structure specified for sentences or paragraphs and cannot adapt themselves when the size of the display changes. PDFMiner does the work for us by analyzing the layouts and guessing the position of texts and other contents.</p><p>When it comes to extracting texts from PDFs, PDFMiner is considered to be the most robust library used to perform the text extraction operation. Thus, in this section, we will demonstrate the usage of PDFMiner for Text Extraction.</p><p>First, we have to install PDFMiner.</p><h3>Installing PDFMiner</h3><p>You can install PDFMiner by running the following command.</p><pre>&gt;&gt;&gt; pip install &quot;pdfminer.six==20200124&quot;</pre><p>Here, we are specifying the particular version of PDFMiner after “==”. Some versions might raise incompatibility errors with Python thus, this version is suggested while working with PDFMiner.</p><p>Now, jumping on to the main part, let’s see how we can extract texts using the PDFMiner.</p><pre>from io import StringIO<br>from pdfminer.pdfinterp import PDFPageInterpreter, PDFResourceManager<br>from pdfminer.pdfpage import PDFPage<br>from pdfminer.converter import TextConverter<br>from pdfminer.layout import LAParams<br> <br># PDFMiner Analyzers<br>rsrcmgr = PDFResourceManager()<br>sio = StringIO()<br>codec = &quot;utf-8&quot;<br>laparams = LAParams()<br>device = TextConverter(rsrcmgr, sio, codec=codec, laparams=laparams)<br>interpreter = PDFPageInterpreter(rsrcmgr, device)<br> <br># path to our input file<br>pdf_file = &quot;sample.pdf&quot;<br> <br># Extract text<br>pdfFile = open(pdf_file, &quot;rb&quot;)<br>for page in PDFPage.get_pages(pdfFile):<br>   interpreter.process_page(page)<br>fp.close()<br> <br># Return text from StringIO<br>text = sio.getvalue()<br> <br>print(text)<br> <br># Freeing Up<br>device.close()<br>sio.close()</pre><p>First, we have to import the necessary functions and classes from the PDFMiner module. According to the PDFMiner documentation, PDFPageInterpreter is used to process page contents while PDFResourceManager is used to store shared resources such as fonts or images. PDFPage is used to perform a page-by-page analysis of information. LAParams loads up the Layout analysis of characters, textbox, text lines, images, and figures. Using these, the TextConverter function converts a PDF document into text.</p><p>We are giving “sample.pdf” as a PDF file to be analyzed and processed using PDFMiner. We can extract texts from a PDF file with the help of the process_page function.</p><p>Finally, the print(text) function will print out the extracted text from a PDF. So, in this way, we can extract texts out of a PDF file using the PDFMiner.</p><h3>Extracting Images from PDFs</h3><p>When we have to extract images from PDF, we can use PyMuPDF. This has a fitz module which makes it very easy to extract images from a PDF file. Before going to the module directly, we can install the libraries as follows.</p><h3>Installing PyMuPDF</h3><p>Perform the following.</p><pre>&gt;&gt;&gt; pip install pymupdf<br>&gt;&gt;&gt; pip install fitz</pre><p>PyMuPDF and Fitz libraries will now be installed. Now, let’s get started on extracting images from PDFs.</p><pre># PyMuPDF<br>import fitz<br>import io<br>from PIL import Image<br> <br># path to our input file<br>pdf_file = &quot;sample.pdf&quot;<br> <br># Input PDF file<br>pdf_file = fitz.open(pdf_file)<br> <br>for page_no in range(len(pdf_file)):<br>   curr_page = pdf_file[page_no]<br>   images = curr_page.getImageList()<br> <br>   for image_no, image in enumerate(curr_page.getImageList()):<br>       # get the XREF of the image<br>       xref = image[0]<br>       # extract the image bytes<br>       curr_image = pdf_file.extractImage(xref)<br>       img_bytes = curr_image[&quot;image&quot;]<br>       # get the image extension<br>       img_extension = curr_image[&quot;ext&quot;]<br>       # load it to PIL<br>       image = Image.open(io.BytesIO(img_bytes))<br>       # save it to local disk<br>       image.save(open(f&quot;page{page_no+1}_img{image_no}.{img_extension}&quot;, &quot;wb&quot;))</pre><p>First, we load our sample.pdf file using the fitz module. Then, we go page by page and find the list of images. We convert the image bytes in the PDFs to actual images and save them locally. So, in this way, we can extract images out of a PDF file.</p><h3>Extracting Tables from PDFs</h3><p>Extracting tables is quite easy compared to images and text extraction. There is a predefined library called “camelot” which can be used for table extraction. Before jumping into the coding implementation, we have to install the library first.</p><h3>Installing camelot</h3><p>The camelot module can be installed by performing a simple pip install as follows:</p><pre>&gt;&gt;&gt; pip install camelot</pre><p>The camelot library will now be installed. Now, let’s get started on extracting tables from PDFs.</p><pre>import camelot<br> <br># reading the pdf file<br>tables = camelot.read_pdf(&quot;table.pdf&quot;)<br>print(tables[0].df)</pre><p>Here, we are reading the PDF file with a table using the camelot function read_pdf(). All the tables are stored in the tables variable as a list. In the code, we are printing out the first table on the table.pdf file. So, in this way, we can extract tables from PDF files.</p><h3>Extracting URLs from PDFs</h3><p>URLs extraction is another handy function that Python provides. Python provides a library called “pdfx” which is generally used when we have to extract URLs from a PDF file. We can use the libraries like PyPDF2, PDFMiner, etc to extract texts and use regular expressions to find out the URLs. However, this process is long and hectic. Therefore, we will use the pdfx library for URLs extraction from a PDF file for ease in implementation and shortness of code.</p><h3>Installing pdfx</h3><p>The pdfx module can be installed by performing a simple pip install as follows:</p><pre>&gt;&gt;&gt; pip install pdfx</pre><p>The library will now be installed. Now, let’s get started on extracting URLs from PDFs.</p><pre>import pdfx<br> <br># reading the PDF File<br>pdf = pdfx.PDFx(&quot;sample.pdf&quot;)<br> <br># get list of URLS<br>print(pdf.get_references_as_dict())</pre><p>Here, the input PDF we are giving is sample.pdf. Using the PDFx function and get_references_as_dict() function, we can extract all the URLs that are present on the input PDF file in the form of a dictionary.</p><p>So, this is quite easy to understand and implement as well.</p><h3>Extracting Pages from PDFs as an Image</h3><p>This is the final section of extraction from a PDF file. In this section, we will learn the implementations of how we can extract pages from a PDF file in the form of an image. For this, we will use another short and simple library called pdf2image. This library is generally used when we have to take the PDF files into images. Let’s get started by installing the module.</p><h3>Installing pdf2image</h3><p>The pdf2image module can be installed by performing as follows:</p><pre>&gt;&gt;&gt; pip install pdf2image</pre><p>And, the implementation is as follows:</p><pre>from pdf2image import convert_from_path<br> <br>pages = convert_from_path(&quot;sample.pdf&quot;, 120)<br> <br>i = 0<br># iterating through pages<br>for page in pages:<br>   i += 1<br>   page.save(f&quot;output_{i}.jpg&quot;, &quot;JPEG&quot;)</pre><p>Here, we are giving a sample.pdf file as our input PDF which needs to be converted into images. We are using convert_from_path() function where value 120 is given. This value is known as the DPI or Dots Per Inch. Higher the value, a clearer and bigger-sized image will be formed. We are iterating through each page by saving the pages as JPEG images in the above coding implementation.</p><p>Now, we will discuss furthermore manipulating a PDF file.</p><p>This is all about the extraction of information from a PDF file. For more on manipulation, creation, watermarking, metadata, etc you can follow <a href="https://github.com/prajwollamichhane11/PDF-Handling-With-Python">this</a> Github link.</p><p>If you like the repository, you can also star and fork to create pull requests.</p><p><a href="https://github.com/prajwollamichhane11/PDF-Handling-With-Python">Github Repository</a></p><p>Thank You!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c129a40f0eab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Notebooks to PDFs using Sphinx]]></title>
            <link>https://prajwollamichhane11.medium.com/convert-notebooks-to-pdfs-using-sphinx-8f891f03f8e9?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f891f03f8e9</guid>
            <category><![CDATA[sphinx]]></category>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pdf]]></category>
            <category><![CDATA[documentation]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Wed, 10 Feb 2021 04:25:40 GMT</pubDate>
            <atom:updated>2021-05-26T17:23:56.710Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, in this short article I will be discussing how we can convert jupyter-notebook files into a pdf. Generally, this procedure is very important when we need to create documentation like a book or a course material. I will be implementing the steps in Linux (Ubuntu to be specific). It will be indifferent in Windows however, some extra libraries may be required during installation. So, let’s get started.</p><p><strong>Step 1:</strong> Installing the necessary libraries and applications from the original documentation <a href="https://nbsphinx.readthedocs.io/en/0.8.1/installation.html">here</a>. From this link, follow all the procedures line by line and install all the necessary libraries.</p><p><strong>Step 2: </strong>Now, create a directory and install sphinx files in it. You can follow the following procedure:</p><p><strong>a. Create Directory: </strong>We are creating a directory name `pdf_conversion` on the Documents as:</p><ul><li>mkdir ~/Documents/pdf_conversion</li></ul><p><strong>b. Navigate to the created Directory:</strong> We can do this as:</p><ul><li>cd ~/Documents/pdf_conversion</li></ul><p><strong>Step 3: </strong>Now, start the Sphinx quickstart as:</p><ul><li>python -m sphinx.cmd.quickstart</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*Eldn4e7h7ITr8HiBlgA74A.png" /></figure><p>Then, do as performed here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*L4FUA3bI2jcMKwGg3wzsnQ.png" /></figure><p>We are going to create a separate source and build directories. This will be easy for us to segregate the notebook files and the output pdf files.</p><p>Now,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*sOuae3zeWCLfIHJwt2NT0A.png" /></figure><p>We are working on the Future Sales Prediction project notebook so my project name is `Future Sales Prediction`here. Then, I have written my name as author and fixed the project release date to 2021. With this enough information, you can just advance to other asked questions by pressing the Enter key.</p><p><strong>Step 4: </strong>Add extensions on source/conf.py. The conf.py initially has no extensions and appears as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*EQAcjX_zEQUf0wfp7qS3rg.png" /></figure><p>For conversion of a notebook with latex and math contents, we should add these two extensions:</p><p>extensions = [<br>“nbsphinx”,<br>“sphinx.ext.mathjax”,<br>]</p><p><strong>(Optional)Step 5: </strong>Removing irregular blank pages in pdf converted from notebook file. The pdf file converted from notebook has lot of intentionally left blank spaces in default mode. So, some extra coding steps need to be implemented to avoid those blank spaces. For avoiding these blank spaces, we could add the following code in source/conf.py.</p><p>latex_elements = {<br>“classoptions”: “,openany,oneside”,<br>}</p><p>The implementations from step 4 and step 5 appear as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*xCpGZ2_xvkpI7TQwMp5uEw.png" /></figure><p><strong>Step 6: </strong>Adding up the notebook file for conversion. In this step, we copy the notebook file that we wish to convert into a pdf inside the source folder.</p><p>Initially, our folder and file structure is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*LgrR_1gpj-2Wr-jzzNbFkg.png" /></figure><p>Now, after adding up the notebook file in the source folder for conversion, we have our directory structure as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*d8Vb7X_P6u1K5_P37bUIuA.png" /></figure><p>Here, you can see that we have added a future_sales_prediction.ipynb notebook here in the source directory.</p><p><strong>Step 7: </strong>Editing the source/index.rst. The index.rst file inside the source folder is responsible for creating the table of contents. Here, in this index.rst file, we clear all the contents under the caption: Contents: And, then we add our notebook file name as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*fJXMA0WYV_e6TH2nJbR4Pw.png" /></figure><p>Here, you can see that we have added the exact name of the file as in the notebook. Now, with this, our conversion is ready to build.</p><p><strong>Step 8: </strong>Building the notebook. Now, I will show you some terminal commands that will be used to build the notebook into a pdf.</p><ul><li>python -m sphinx source build -b latex</li></ul><p>Here, we are doing a sphinx latex build from the original source directory into the build directory. We will see several output build files on this directory as well. Let’s see the build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*8aD4J6fUOUXDBAGArnzfzQ.png" /></figure><p>After performing the above command, you may reach here at:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*_GGXS_JYJMLKu57KANKhWg.png" /></figure><p>So, as the sphinx is also suggesting, our final task will be to make the build. For this, we will perform the following command.</p><ul><li>make latexpdf</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*r0oSJrJELkwB73jfv9DLiw.png" /></figure><p>Remember, we may still receive several warnings. However, the proceeding is the best way because after we obtain the pdf file with `make latexpdf` command, we can check out the parts where the pdf has errors. It will be easier for us to find errors in that way.</p><p>Now, to check out your pdf file, you can just navigate to the build/latex and there is your pdf. If your notebook also consists some images, there you can find images from the notebook well. Several files like .tex, .cls etc are latex and document class files.</p><p>So, this is all for this short article. You will still face many issues like image importing error, latex $ spacing error, table of contents error, etc. We could discuss this in the next article.</p><p>Thank You!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f891f03f8e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading on Generative Adversarial Nets]]></title>
            <link>https://medium.com/swlh/paper-reading-on-generative-adversarial-nets-606481030674?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/606481030674</guid>
            <category><![CDATA[generative-adversarial]]></category>
            <category><![CDATA[discriminator]]></category>
            <category><![CDATA[adversarial-network]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Sat, 23 May 2020 07:22:53 GMT</pubDate>
            <atom:updated>2020-09-01T23:20:46.310Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Authors</strong></p><p>Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio</p><h3>Generative Adversarial Nets</h3><p>The main idea is to develop a generative model via an adversarial process. We will discuss what is an adversarial process later. GAN consists of two model. The one is generative model G and the other is discriminative model D. The purpose of a generative model is to generate the closest data as possible for give some input. The purpose of a discriminative model between two classes 0 and 1. 0 meaning the class belongs to Generative output and 1 meaning the class belongs to the true input sample from the original data.</p><p>This architecture corresponds to the minmax two-player game. One tries to create conflict over the other. Such networks are called adversarial networks. In the process of creating conflicts, both of them learn to be better and stronger than each other. When the discriminator makes an output of value ½ or 0.5, it implies that the discriminator is not able to distinguish whether the value came from the generator output or the original sample.</p><p>Here, the G and D are defined by the multilayered perceptron such that the entire system can be trained with back propagation. The training of the discriminator and generator are done separately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*9AVa2AJqe88WxxKS2EDkZw.png" /></figure><p>According to the paper, the generative model can be thought of as analogous to a team of counterfeiters who are trying to produce a fake currency and use them without getting caught.</p><p>While, the discriminative model can be thought of as analogous to the Police who are trying to detect the fake currency. Here, both the teams try to improve their methods until the currencies are indistinguishable from the original currency.</p><h3>Adversarial Networks</h3><p>Straight from the paper,</p><p>To learn the generator’s distribution Pg over data x, we define a prior on input noise variables Pz(z), then represent a mapping to data space as G(z; θg ).</p><p>where G is a differentiable function represented by a multilayer perceptron with parameters θ g .</p><p>We also define a second multilayer perceptron D(x; θd ) that outputs a single scalar.</p><p>Where D(x) represents the probability that x came from the data rather than Pg.</p><p>The architecture of GAN can be explained from the following figure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*mWlRFYp_hP8Q6aJcWoEIFQ.png" /></figure><p>Diving more into the Loss Function:</p><ul><li>z is the representation of the noise which is fed to the Input</li><li>Pz represents the uniform or normal distribution from which the noise z is sampled</li><li>x represents the inputs</li><li>Pr is the representation of the real data from training set</li><li>Pg is the representation of the fake data from the Generator</li></ul><p>Here,</p><p>x~Pr(x) means x is sampled from real distribution Pr.</p><p>x~Pg(x) means x is sampled from generator disctribution Pg.</p><p>z~Pz(z) means z is sample from unifrom distribution Pz.</p><p>We train D to maximize the probability of assigning the correct label to both training examples and samples from G. We simultaneously train G to minimize log(1 − D(G(z))).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*Jq8PDJYdq8FdvUuflF9-rg.png" /></figure><p>Hence, the D and G play the following two player min-max game with value function V(G,D):</p><h3>Understanding the value function</h3><h4>Discriminator LOSS</h4><p>The loss function for the discriminator is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*dmxE2oeK7mM1dagyq-i4iQ.png" /></figure><p>Here, looking at the first term,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/136/1*jgL0KgFTcax9pPwgckFeLA.png" /></figure><p>As already discussed, x~Pr(x) means we are sampling x from the real distribution. D(x) implying we are feeding input x to the discriminator. So, the discriminator will result the probability of the input being a real image. Eventually, since we have to maximize it, it is written as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/141/1*3VTXLpYcV27wi6kzIHyXqA.png" /></figure><p>Again, looking at the second term,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*-fFCXifw-DRK9-yDt9nD3w.png" /></figure><p>As it is very clear that, the Generator outputs the fake image. When D(G(x)) is done, it means that the discriminator is fed the fake input generated by the generator. So, the discriminator will return the probability that the fake image being real image. But, since 1-D(G(x) is done, the discriminator returns the probability that the fake image being fake. So, eventually we maximize it as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*UXU4LjOH7HUq9tmD0Rp6ZQ.png" /></figure><p>Now, Combining both the equations, we obtain the discriminator value function as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*JoB67kIOOZXFYxDjEGBw7Q.png" /></figure><h4>Generator LOSS</h4><p>Since, we described the discriminator loss function as discriminator wants to minimize the probability of fake image being classified as real. And the equation is expressed as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*-fFCXifw-DRK9-yDt9nD3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*UXU4LjOH7HUq9tmD0Rp6ZQ.png" /></figure><p>But, the Generator’s primary objective is to fool the discriminator. The generator wants the fake image to be classified as real. So, the Generator minimizes the above probability as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*iAGrSYIHNhSPxh1PwWMxRA.png" /></figure><p>Now, summing up the loss from the Encoder and Decoder, the total loss is obtained as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*TH0_ROnooJz0ZGMdctTJHQ.png" /></figure><h3>Why GANs ?</h3><p>GANs provide an advancement in domain-specific data augmentation and solutions to problems that require generative solution such as image-to-image translations. They have ability to model high-dimensional data, handle missing data and the capacity to provide multi-modal outputs or multi-plausible answers.</p><p>Some most astonishing examples of GANS are:</p><p>1. New Faces generation on: <a href="https://www.thispersondoesnotexist.com/">https://www.thispersondoesnotexist.com/</a></p><p>2. Super Resolution Images</p><p>3. Image-to-Image Translation</p><p>4. Pose Guided Person Image Generation</p><p>5. Anime Characters Generations</p><p>6. Image Coloring</p><p>7. Deep Fakes, etc</p><p>Examples:</p><p><strong>Deep Fakes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*TJjR15Ckcso9PxkViAoexQ.png" /></figure><p><strong>Image-Image Translation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*FE64Pk4TYdFYGV-JPJhYRg.png" /></figure><p><strong>StyleGAN</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*5c7orH1M83q0JHnnG3D6fQ.gif" /></figure><p><strong>Hyper-Realistic Face Generator</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Vpsm1Os_UCGSuOGbVv4MCw.gif" /></figure><p><strong>Semantic Segmentation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*hvmopwTbZkznVEqnLns4aA.jpeg" /></figure><p>The GANs have tons of applications each of which are able to amaze the whole world with their applications.</p><blockquote>Facebook AI Director, Scientist Yann LeChun says, “Generative Adversarial Networks is the most interesting idea in the last ten years in Machine Learning.”</blockquote><h3>GANs or VAEs:</h3><p>GANs and VAEs are both generative model. They are similar in many aspects and also have a lot of differences from one other.</p><p><strong>VAEs</strong></p><ul><li>Easier to train, easier to implement and robust to hyper parameter choices</li><li>The likelihood is tractable</li><li>The network built is inference network. So, its reconstruction can be done.</li></ul><p><strong>GANs</strong></p><ul><li>Much higher visual fidelity in generated samples</li><li>Better with practical results</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=606481030674" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/paper-reading-on-generative-adversarial-nets-606481030674">Paper Reading on Generative Adversarial Nets</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[Paper Reading on Tacotron: Towards End to End Speech Synthesis]]></title>
            <link>https://prajwollamichhane11.medium.com/paper-reading-on-tacotron-towards-end-to-end-speech-synthesis-5e2c289752b9?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e2c289752b9</guid>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[rnn]]></category>
            <category><![CDATA[attention]]></category>
            <category><![CDATA[gru]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Fri, 24 Apr 2020 04:53:47 GMT</pubDate>
            <atom:updated>2020-04-24T04:53:47.010Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Abstract</strong></h3><p>Text to synthesis system typically consists of multiple stages. They are:</p><p>i. text analysis frontend</p><p>ii. an acoustic model</p><p>iii. An audio synthesis modulePaper Reading on Tacotron: Towards End to End Speech Synthesis<br>Abstract<br>Text to synthesis system typically consists of multiple stages. They are:</p><p>i. text analysis frontend</p><p>ii. an acoustic model</p><p>iii. An audio synthesis module</p><p>Tacotron, and end to end generative text to speech model that synthesizes speech directly from characters. For training the model from scratch a &lt;text, audio&gt; pair is required.</p><p>Tacotron achieves a 3.82 subjective 5-scale mean opinion score on US English, outperforming a production parametric system in terms of naturalness. Since Tacotron generates speech at the frame level, it’s substantially faster than sample-level autoregressive methods.</p><p>Acronyms- TTS(Text To Speech), NMT(Neural Machine Translation)</p><h3><strong>Introduction</strong></h3><p>Modern TTS are complex because it has following:</p><ul><li>a text front end for extracting various linguistic features</li><li>a duration model</li><li>an acoustic feature prediction model</li><li>a complex signal processing based enoder</li></ul><p>(Zen et. al.)</p><p>One component is different from other, since each of them are trained individually, errors from each component ma compound. They require substantial human efforts.</p><p>Thus, integrated TTS have many advantages since they can be trained on &lt;text, audio&gt; pairs with minimal human annotation.</p><ul><li>alleviates the need for feature engineering</li><li>works on sentiment</li><li>adaptation to new data is easier</li><li>single staged model is obtained</li></ul><p>TTS outputs are continuous, and output sequences are usually much longer than those of the input. So, these attributes cause prediction errors to accumulate quickly.</p><p>So, in this paper, TTS model is based on sequence to sequence(seq2seq) (Sutskever et. al.) with attention paradigm (Bahdanau et. al.).</p><p><strong>Inputs</strong>: Characters</p><p><strong>Outputs</strong>: Raw Spectrogram</p><p>With a simple waveform synthesis technique, Tacotron produces a 3.82 mean opinion score (MOS) on an US English eval set, outperforming a production parametric system in terms of naturalness.</p><h3>Model Architecture:</h3><p>The backbone of Tacotron is a seq2seq model with attention (Bahdanau et al).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*5vzIQiWcisz_msrKjzGU8A.jpeg" /></figure><p>At the surface level, we can see that the model consists of:</p><p>I. An encoder</p><p>II. An attention based decoder</p><p>III. Post processing net</p><p>So, model takes characters as inputs, produces spectrogram frames which are then converted to waveforms.</p><h4>CBHG Module</h4><p>(1-D convolution bank + highway network + bidirectional GRU)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*0S-1662TeNj223FZ9rMWzg.jpeg" /></figure><p>It is a powerful model for extracting representations from sequences.</p><p>Here,</p><p><strong>Convolution</strong></p><ul><li>The input sequence is first convolved with K sets of 1-D convolutional filters, where the k-th set contains Ck filters of width k (i.e. k = 1, 2, . . . , K).</li><li>The convolution outputs are stacked together and further max pooled</li><li>Stride is kept 1</li><li>further pass processed sequence to fixed width 1D convolutions, whose outputs are added to original inputs via residual connections</li><li>Batch Normalization done for all convolutional layers</li></ul><p><strong>Multi layer Highway</strong></p><p>Now, the convolution outputs are fed to multilayer highway (Optimizing networks increasing their depths) network to extract high level features.</p><p><strong>GRU RNN</strong></p><p>Once the features are extracted, we stack a bidirectional GRU RNN on top to extract sequential features from both forward and backward context. The Sequential RNN follows the similar implementation used in NMT (Neural Machine Translation) used by Lee et. al.</p><p>Differences from the work of Lee include:</p><ul><li>use of non causal convolutions</li><li>batch normalisation</li><li>residual connections</li><li>stride =1 max pooling</li></ul><p>These modifications are said to have improved the generalizations of the TTS.</p><h4><strong>Encoder</strong></h4><p>Input to the encoder is a character sequence where the character sequence is represented as a one-hot vector which is embedded into context vector.</p><p>Then, “PreNet”(Extension of the ResNet where a recurrent layer is further introduced to exploit the dependencies of deep features across the layers.)</p><p>Hence, the CBHG module transforms the prenet outputs into the final encoder representation later used by the attention module.</p><h4><strong>Decoder</strong></h4><p>The content-based tanh attention decoder is used, query are produced at each decoder time step.</p><p>The context vector produced by the Encoder as well as the decoder time steps are concatenated with the attention RNN cell output to form inputs to the next decoder time steps.</p><p>GRU are used on the decoder with vertical residual connections (passing the gradients through the network without passing them through the activation functions) that improved rate of convergence.</p><p>We use a post-processing network (discussed below) to convert from the seq2seq target to waveform.</p><p>A simple fully-connected output layer is used to predict the decoder targets.</p><p>An important trick we discovered was predicting multiple, non-overlapping output frames at each decoder step. Predicting r frames at once divides the total number of decoder steps by r, which reduces model size, training time, and inference time. This trick improved the convergence speed.</p><p>This is likely because neighboring speech frames are correlated and each character usually corresponds to multiple frames.</p><p>Emitting one frame at a time forces the model to attend to the same input token for multiple time steps; emitting multiple frames allows the attention to move forward early in training.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e2c289752b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading on Sequence to Sequence Learning with Neural Networks]]></title>
            <link>https://prajwollamichhane11.medium.com/paper-reading-on-sequence-to-sequence-learning-with-neural-networks-6a84978bf30f?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a84978bf30f</guid>
            <category><![CDATA[lstm]]></category>
            <category><![CDATA[rnn]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Tue, 07 Apr 2020 13:59:07 GMT</pubDate>
            <atom:updated>2020-04-07T17:57:40.598Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Authors:</strong></p><p>Ilya Sutskever, Oriol Vinyals, Quoc V. Le</p><h3>Abstract:</h3><p>Used <strong>a multilayered Long Short-Term Memory (LSTM) to map the input sequence to a vector </strong>of a fixed dimensionality, and then <strong>another deep LSTM to decode the target sequence from the vector.</strong></p><p>1. On an English to French translation task from the <strong>WMT-14 dataset</strong>, the translations produced by the LSTM (5 Deep LSTMs with 380M parameters each) achieve a BLEU score of <strong>34.8</strong></p><p>2. LSTM’s <strong>BLEU (Bilingual Evaluation Understudy)</strong> score was penalized on out-of-vocabulary words (vocabulary had a collection of 80K words).</p><p>3. A phrase-based SMT system achieves a BLEU score of <strong>33.3</strong> on the same dataset.</p><p><strong>SMT System:</strong></p><p><strong>Statistical Machine Translation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CgW3OT7XPmc1pMuMSXLefw.png" /></figure><p>4. When LSTM was used to rerank the <strong>1000 hypotheses</strong> produced by the aforementioned SMT system, its BLEU score increases to <strong>36.5</strong></p><p>5. Also, reversing the order of the words in all source sentences (but not target sentences) improved the LSTM’s performance markedly</p><h3>Introduction:</h3><p>DNN can only be applied to problems whose inputs and outputs can be represented with a vector of fixed Dimensionality.</p><p>So, the paper is all about showing that the LSTM can be used to solve the sequence to sequence problem.</p><p>The idea is to use <strong>one LSTM to read the input sequence, one timestep at a time, to obtain large fixed- dimensional vector representation</strong>, and then to use <strong>another LSTM to extract the output sequence from that vector</strong></p><p><strong>Choice of using LSTM because it can work on Vanishing Gradient Problems.</strong></p><p>LSTM did not suffer on very Long sentences with <strong>a simple trick of reversing the words</strong> in the source sentences which is one of the key technical contribution of the work</p><p>On evaluation it showed that the model is aware of word order and is fairly invariant to the active and passive voice.</p><h3>Model</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*7DuyyeeTYadmkfts50FRCw.png" /></figure><p>The LSTM computes this conditional probability by <strong>first obtaining the fixed-dimensional representation v of the input sequence (x 1 , . . . , x T )</strong> given by the last hidden state of the LSTM, and <strong>then computing the probability of y 1 , . . . , y T ′ with a standard LSTM-LM formulation</strong> whose initial hidden state is set to the representation v of x 1 , . . . , x T in the above Snap.</p><h3>DataSet Details:</h3><h4>WMT’14 English to French dataset</h4><p>- 12M sentences consisting of 348M French words and 304M English words</p><p>- Used 160,000 of the most frequent words for the source language and 80,000 of the most frequent words for the target language</p><p>- Out of vocabulary words was replaced with “UNK” token</p><h3>Decoding and Rescoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*LZddp__r6ot7e2Z4WU86iA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*VBdhFBQbLrRqv470DdpSfQ.png" /></figure><p>LSTM was also <strong>used to rescore the 1000-best lists</strong> produced by the baseline system.</p><p>To rescore an n-best list, log probability of every hypothesis was computed with the LSTM and an average was taken with their and the LSTM’s score</p><h3>Reversing the Source Sentences</h3><p>Since LSTM is already capable of solving the problems with long term dependencies and works even on vanishing gradient problems, to have a much better accuracy the sentences on the source were reversed keeping the sentences on the target the same following result was obtained:</p><p>- The LSTM’s test perplexity dropped from 5.8 to 4.7</p><p>- The test BLEU scores of its decoded translations increased from 25.9 to 30.6</p><p>The reason for improvement might have been introduction of many short term dependencies among the words on the dataset.</p><h3>Training Details</h3><p>- Deep LSTMs with 4 layers with 1000 cells at each layer and 1000 dimensional word embeddings</p><p>- Input Vocabulary of 160,000 words and output vocabulary of 80,000 words</p><p>- Naive Softmax over each outputs</p><p>Overally, LSTM had <strong>380M parameters </strong>out of which <strong>64M parameters are pure recurrent connections </strong>(32M for encoder and 32M for decoder LSTM)</p><h3>Training Architecure Details:</h3><p>- All of the LSTM’s parameters were initialized with the uniform distribution between -0.08 and 0.08</p><p>- Batches of 128 sequences for the gradient and divided it the size of the batch (namely, 128).</p><p>- Although LSTMs tend to not suffer from the vanishing gradient problem, they can have exploding gradients. Thus a hard constraint was enforced on the norm of the gradient [10, 25] by scaling it when its norm exceeded a threshold. For each training batch, we compute s = ||g||2 , where g is the gradient divided by 128. If s &gt; 5, we set g = 5g/s.</p><p>- Different sentences have different lengths. Most sentences are short (e.g., length 20–30) but some sentences are long (e.g., length &gt; 100), so a minibatch of 128 randomly chosen training sentences will have many short sentences and few long sentences, and as a result, much of the computation in the minibatch is wasted. To address this problem, it was made sure that all sentences within a minibatch were roughly of the same length, which a 2x speedup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*A5Bt1gJCaSJpd4vBALbPQA.png" /></figure><p>The model was able to perform well on both the short and Long Sentences. Which was seen through the PCA projection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a84978bf30f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intermittent Fasting]]></title>
            <link>https://prajwollamichhane11.medium.com/intermittent-fasting-4721fc46c2d2?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4721fc46c2d2</guid>
            <category><![CDATA[intermittent-fasting]]></category>
            <category><![CDATA[health]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Thu, 27 Jun 2019 11:20:58 GMT</pubDate>
            <atom:updated>2019-06-27T11:20:58.525Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Fasting</strong></p><p>Fasting is essentially giving up on food for a particular period of time. People have been performing serious fasting for centuries either for religious reasons or other different reasons. Fasting is good for our body and it can have some major impacts like: weight loss, improvement in blood sugar level, healthy heart, proper brain function and even prevents cancer.</p><p>But, people who fast commonly can experience problems like dehydration due to lack of fluid intake. They can experience increase in stress levels, disruption in sleep, major headaches and even heartburn. So, in the recent years, numerous studies have suggested us that intermittent fasting is good for our body which has made it the most popular dieting trends worldwide.</p><p><strong>What is intermittent fasting ?</strong></p><p>Well, Intermittent fasting is not a diet, it’s just a pattern of eating. That means you do not decide what you eat, you just decide when to eat. It has got some serious advantages that everyone should practice this habitually. Intermittent Fasting is a eating style where we eat within a specific time period and fast for most of the time. Intermittent fasting split the days into eating period and fasting period. As we all fast daily during the period we sleep, the concept of intermittent fasting is to extend that fasting period a little longer.</p><p>It is also considered to be the ancient secret of health as it has been practised throughout all of human history. It had been virtually forgotten. However, many people are searching about the intermittent fasting at the current situation. The number of online searches about the intermittent fasting has also increased by about 10,000 percentage with almost of the percentage increasing in the last few years. By now, we already know what an intermittent fasting is. Now, let’s discuss some of the guidelines and schedules of intermittent fasting and their possible benefits on human body.</p><p><strong>Guidelines and Schedules of Intermittent Fasting</strong></p><p>There are many ways to fast intermittently. The most popular ways to fast intermittently include:</p><p><strong>1. 5/2 Fasting</strong></p><p>Fasting for two non-consecutive days of the week while eating normally and healthfully for the rest of the five days of the week is termed as 5/2 Fasting. About 500 calories of diet on the fasting days are tolerable.</p><p><strong>2. Eat-Stop-Eat</strong></p><p>In this type of fasting one day out of the week is chosen to fast for 24 hours. This includes fasting from particular time of a day to the same time of the next day.</p><p><strong>3. 16/8 Fasting</strong></p><p>In this type of fasting, fasting is done for 16 hours and in the left 8 hours of a day, the calorie needed by the body is fulfilled by eating a normal and healthy diet. This generally means not eating anything after the dinner at 8 PM until the lunch at 12 PM of the next day. This is also considered the best type of intermittent fasting to start with.</p><p><strong>Benefits of Intermittent Fasting</strong></p><p>Intermittent fasting has been very popular among people these days. The most popular benefits of intermittent fasting that have been studied well are as follows:</p><p><strong>1. Decreased Inflammation</strong></p><p>A study in 2015 found out that a longer duration of fasting was associated with the decreased inflammation. Due to intermittent fasting, the body merely undergoes aging compared to the people not performing intermittent fasting. Hence, the rapid regeneration of old and dead cells and tissues are the cause for decreased inflammation on the human body.</p><p><strong>2. Weight loss</strong></p><p>Intermittent fasting helps for weight loss. It allows our body to use fat as fuel instead of sugar which makes it a perfect remedy to lose our body’s weight. Our body will use sugar first and store the remaining as glycogen. Then, the body will move directly to glycogen without any sugar around and then use fat as it’s fuel. Hence, burning of fat causes weight loss.</p><p><strong>3. Blood sugar management</strong></p><p>Intermittent fasting allows our body to process glucose easily and also helps to regulate our insulin and blood sugar levels. When we prevent high amount of insulin, we allow our body to handle sugar. Hence, the sugar level in the blood is maintained too. This is very functional to the person suffering from diabetes.</p><p>These were some famous benefits of intermittent fasting. Besides this, it has several benefits like: mental clarity and concentration, improvement in blood cholesterol level, reduction in the risk of Alzheimer’s disease, longer life, increased energy, etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4721fc46c2d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux and Me]]></title>
            <link>https://prajwollamichhane11.medium.com/linux-and-me-a3fb96ac67a3?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3fb96ac67a3</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Thu, 25 Oct 2018 05:56:01 GMT</pubDate>
            <atom:updated>2018-12-11T05:49:57.304Z</atom:updated>
            <content:encoded><![CDATA[<p>Back in my school days when i was first using Linux as an 11 year old kid, I was totally unaware of it except of a word related to technology and so was the windows. As far back i remembered, i first became familiar with that term when my elder brother who was a computer engineer himself and firm believer of FOSS used to change the Linux distross all the time. Red Hat was the first Linux operating system I ever used. When I was almost familiar with it he used to shift into other distros sometimes Centos sometimes OpenSuse and so and so which was like a nightmare to me because all my friends played games like: GTAs, Need For Speed while I was stuck with a PC which I could barely use because it had an operating system which literally had nothing for me to entertain with.</p><p>Now, I am an undergraduate computer engineer using Linux almost all the time. May be then I did not try to know its actual value or may be I was too young for it. But, now I know the meaning of FOSS. I wish to contribute towards FOSS in the future. Through Linux, I am able to understand the importance of open source. I am studying in Kathmandu University. On 2017 15th of September, on the occasion of Software Freedom Day, a great man Mr. Rob Savoye had come to our university. A man who had been on the field of programming for over 40 years, the primary developer of Gnash and one of the developer of the GNU project. It was a precious speech he gave. He explained why open source is better compared to closed source in terms of cost, service, usability, innovation and security. He said</p><blockquote>When you got a problem on an open source software, you report it and someone on the internet with knowledge of open source could fix it while on a closed source software we have to wait for the next update.</blockquote><p>Software Freedom Day then was celebrated by FOSS talks, git workshop, Openmap workshop, etc.</p><p>Getting all your documents and projects deleted, waking all night configuring Arch, creating daemons eventually killing the memory, I have experienced quite a lot using Linux for such a long time. Currently, I am on to Centos working on configuring the LFS. Whatever system you are using, make sure that makes you happy as they say, “Choose What makes you Happy.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3fb96ac67a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vim vs Emacs: The Editor war]]></title>
            <link>https://prajwollamichhane11.medium.com/vim-vs-emacs-the-editor-war-b63ecb12ea92?source=rss-cef56ad575b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b63ecb12ea92</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source-software]]></category>
            <dc:creator><![CDATA[Prajwol Lamichhane]]></dc:creator>
            <pubDate>Sun, 23 Sep 2018 13:38:15 GMT</pubDate>
            <atom:updated>2018-09-23T13:38:15.966Z</atom:updated>
            <content:encoded><![CDATA[<p>The rivalry between the users of Vim and Emacs is commonly known as the editor war. I would not probably say which is better here but I did start with Emacs few years ago while writing a text searching script. If you are an open source lover you can read this article to decide between Vim and Emacs.</p><p>It is really difficult to take sides when two products are equally good at something. Talking about my personal experience, when I first started using Emacs at first it was rough and difficult. How will you know that</p><p>Ctrl + x and Ctrl + s = save</p><p>Alt + w = Copy</p><p>Ctrl + w = Cut …</p><p>It does not make any sense. Right? But, When I was over with all the basic commands it was easier and so I used it for almost all sorts of programming.</p><p>I wanted to try vim too. I was fully onto it. I used it for a long time. I wrote many programs and scripts on vim too and after few months I again shifted to Emacs. Let’s get down to business and talk about specific editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*AUV9ra-aa1N5XvAh1-r34g.png" /></figure><p><strong>Vim</strong></p><p>Vim is a text editor and acronym for “Vi Improved” because vim was created as an extended version of vi editor with many additional features. It was developed using C and Vim Script in 1991. It supports both command line and graphical interface. It was basically designed to be used on slow terminals. It might be hard to learn for beginners. For a very fast typing and coding movements vim can be a better option because the cursor movements can be controlled using H,J,L,K unlike emacs which uses Ctrl+B or Ctrl+F. Its keybindings, in particular, strike a very nice balance between sane, nicely spaced out, logical to remember, and easy to access on your average QWERTY keyboard — but remember that an editor is more than its keybindings. Moreover, Vim is lighter than Emacs and use<strong>s </strong>less memory. Vim can use GUI libraries such as gtk, gnome, gnome2, motif, athena and neXtaw.</p><p><strong>Emacs</strong></p><p>Emacs is a class of feature-rich text editors, usually characterized by their extensibility. Emacs has over 1,000 editing commands. It also allows the user to combine these commands into macros to automate work. It was developed using C and Emacs Lisp in 1976. It also supports both command line and graphical user interface. Vim is easier to learn since it has a more natural interface especially for users familiar with GUI based text editors. The productivity and editing speed on Emacs is criticized due to the fact that Ctrl + B and Ctrl + F is used for the cursor movements which is more keys than one and comparatively takes more time for fast coders. Although, Emacs uses more memory but a single Emacs process can support several clients which in turn increases the startup speed and decreases the total memory usage narrowing the gap between Vim and Emacs. Emacs also supports a lot more customization of the editor environment. Programmers find Emacs to be far more customizable than Vim as it can be extended in elisp. Emacs uses XDisplay or gtk2 for its GUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*JMgpIjHEX0vTR5CUV2uAKA.png" /></figure><p>In conclusion, I don’t want to overcook this pessimism because there are still some very active Vim and Emacs user groups. They will have their own statement on which one is the better one. Its on you to decide which one you like as both are equally better. As Bertrand Russell said, <em>“War does not determine who is right — only who is left.”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b63ecb12ea92" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>