Ajai Chemmanam

All Blogs

    Solve Permission denied (publickey)
    2022-12-03
    Written by Ajai Chemmanam
    Whenever we take a compute instance from cloud services like AWS, they often provide a .pem file for logging into the instance. When we try to login via ssh using these .pem files using the command ```bash ssh -i filename.pem username@ipaddress ``` We get the following error if the permissions of the .pem file is not correct ```bash @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Solve Target Packages configured multiple times error
    2022-08-15
    Written by Ajai Chemmanam
    Fix: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list error in ubuntu. Sometimes, when you do sudo apt update, you might see an error like this W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:60 and /etc/apt/sources.list.d/cuda-ubuntu2004-x86_64.list Edit the /etc/apt/sources.list file and remove the duplicated lines
    Solve Bazel following signatures were invalid
    2022-08-14
    Written by Ajai Chemmanam
    Fix: GPG error - The following signatures couldn't be verified because the public key is not available: NO_PUBKEY Sometimes, when you do sudo apt update, you might see an error like this The following signatures were invalid: EXPKEYSIG 3D5919B448457EE0 Bazel Developer (Bazel APT repository key) <bazel-dev@googlegroups.com> Open a terminal and do the following: ```bash curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - ``` You should see something
    Solve NO_PUBKEY GPG error in Ubuntu
    2022-08-12
    Written by Ajai Chemmanam
    Fix: GPG error - The following signatures couldn't be verified because the public key is not available: NO_PUBKEY Sometimes, when you do sudo apt update, you might see an error like this An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:/var/cuda-repo-ubuntu2004-11-3-local Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2A
    Solve ENOSPC: System limit for number of file watchers reached Error
    2022-05-26
    Written by Ajai Chemmanam
    When I was working with a reactjs project on Ubuntu system, I received an error like this: ``` Error: ENOSPC: System limit for number of file watchers reached ``` The reason for this error is the kernel limit with the inotify watchers. Temporary Solution ```bash sudo sysctl -w fs.inotify.max_user_watches=524288 ``` This works until you reboot your system. Inorder to persist the fix, Run the following. ```bash echo "fs.inotify.max_user_watches=524288" \ | sudo t
    Dealing with Outliers
    2022-04-14
    Written by Ajai Chemmanam
    Outliers can be a nightmare for you if you donโ€™t treat them properly. Outliers can cause problems during model fitting and also affect the evaluation metrics. Here are some ways you can deal with outliers. Box plots are a visual method to identify outliers. Box plots is one of the many ways to visualize data distribution. Box plot plots the q1 (25th percentile), q2 (50th percentile or median) and q3 (75th percentile) of the data along
    Vanishing and Exploding Gradient Problems
    2022-04-13
    Written by Ajai Chemmanam
    Neural Networks update their weights during Back Propagation. This optimises the weights for better results. There are mainly 2 problems that occur during this optimisation The Vanishing Gradient Problem occurs when the gradients approach zero and weights remains nearly unchanged. As a result the model never converges to the optimum result. This may happen because of small values of the derivatives of the activation f
    Activation Functions
    2022-04-12
    Written by Ajai Chemmanam
    In an artificial neural network, activation functions decide the output of a node for a given input. It decides whether a node should be activated or not. - It adds a non-linearity to Neural Networks - It puts upper and lower bounds in the output of each node - It should be Continuous, Monotonic & Differentiable. Some commonly used Activation Functions are listed below It is a continuous 'S
    Weight Initialisation
    2022-04-11
    Written by Ajai Chemmanam
    Initialising the weights of neural networks during training is a crucial task to get maximum accuracy, it can affect how fast a model converges. If the models are not initialised efficiently it might even give rise to Exploding & Vanishing Gradient Problems. fanin = Number of input to a neuron fanout = Number of output from a neuron In zero initialisation, the weights are set as '0'. This is high
    Image Augmentation
    2022-04-10
    Written by Ajai Chemmanam
    Image Augmentation is the technique of artificially creating more data by altering the existing ones. This manipulation involves operations like shifts, flips, zooms etc. - It expands the training dataset. - It can prevent overfitting - It can add to the generalisation of the model - The model becomes spatially invariant. - Requires evaluation of the created data. - The biases in real data are also reflected in augmented data.
    Learning Rate Hyperparameter in Neural Networks
    2022-04-09
    Written by Ajai Chemmanam
    Learning rate is a hyperparameter which controls the rate at which the weights of a network are updated. It controls how quickly a model adapts to the problem, small learning rate means more training due to smaller changes to weights & larger rates mean rapid changes in weight values. The values or learning rates generally lie in the range (0,1). - If the values of learning rates are too high the model converges to a suboptimal solution - If the lea
    Optimising Neural Networks
    2022-04-09
    Written by Ajai Chemmanam
    Neural Networks are a complex interconnected set of layers used in Deep learning. Often, for the deep learning projects to be deployed, it needs to be optimised in terms of both size & accuracy. Most of the Neural Network models are very large in size and requires some sort of optimisation before usage. There are mainly 2 types of methods we use for model size reduction called quantisation & pruning Quantisation is the process by which the va
    Anchored and Anchorless Object Detection
    2022-04-08
    Written by Ajai Chemmanam
    Object detection is a task in computer vision, which requires the algorithm to predict a bounding box with a category label (class) for each region of interest (ROI) in an image. Anchor Boxes are used to represent ideal shape and size of object the model predicts. Anchor boxes are pre determined boxes at different positions of an image with varying sizes and aspect ratio. These are determined by analysing the training data, where and how the mos
    Computer Vision Tasks
    2022-04-07
    Written by Ajai Chemmanam
    Computer vision is a subarea of AI and ML which deals with images and videos. The algorithms usually helps the machines to understand the contents of the visual media. Computer vision tasks can be classified into different categories It takes in an input image & classifies it into a class label along with some metrics. - Most basic computer vision tasks. - Requires smaller networks when compared to o
    Batch size in Neural Networks
    2022-04-06
    Written by Ajai Chemmanam
    Batch size is a common term used while training a neural network. Ever wondered why we need to pass data to networks in batches? Batch Size defines the amount of data passed through the network in a single propagation. Consider 1000 data with you, You pass it through the network as a set of 100. Then you need to propagate through the network 10 times to complete an epoch. As a common practice, we usually take batch size as a multiple of 8 Eg. 8,16,32 etc. The
    Pooling in CNN
    2022-04-05
    Written by Ajai Chemmanam
    Convolution Layers create feature maps of the input images, but these features are position variant i.e, these features changes according to the position of the object. This problem is addressed by downsampling (reducing the size of feature maps)the images with major features still intact. The 2 common methods of pooling are : It takes the average representation of features in the feature map It calculates
    Adam Optimiser in Neural Networks
    2022-04-04
    Written by Ajai Chemmanam
    Adam is an algorithm used for optimisation technique for gradient descent The Adam optimiser uses momentum to accelerate gradient descent by considering the 'exponential weighted average' of the gradients. This means faster convergence to minima - It also scales the values of the learning rate using squared gradients, making it invariant to the magnitude of the gradient. - These properties make Adam overcome local minima & saddlepoint making it usable in
    ๐…๐จ๐ซ๐ฐ๐š๐ซ๐ ๐•๐ฌ ๐๐š๐œ๐ค๐ฐ๐š๐ซ๐ ๐๐ซ๐จ๐ฉ๐š๐ ๐š๐ญ๐ข๐จ๐ง
    2022-04-03
    Written by Ajai Chemmanam
    - The process of going from Input Layer to Output Layer to adjust or correct the weights is called Forward Propagation. - It calculates the output vector from the input vector from which the loss can be calculated. The weights in the hidden layer are not adjusted in this case. - The process of going backwards i.e, from the Output Layer to the
    ๐— ๐˜‚๐—น๐˜๐—ถ ๐—Ÿ๐—ฎ๐—ฏ๐—ฒ๐—น ๐—ฉ๐˜€ ๐— ๐˜‚๐—น๐˜๐—ถ ๐—–๐—น๐—ฎ๐˜€๐˜€ ๐—–๐—น๐—ฎ๐˜€๐˜€๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป
    2022-04-02
    Written by Ajai Chemmanam
    - It refers to a classification task with more than 2 classes. - The output is always one of the classes in the total class available - The outputs are always mutually exclusive - The output layer generally used is a softmax layer - Here the input is assigned with a set of labels - The output may contain 0 or more labels - The outputs are not mutua
    Receptive Field of a CNN
    2022-04-01
    Written by Ajai Chemmanam
    ๐—ง๐—ต๐—ฒ ๐—ฟ๐—ฒ๐—ฐ๐—ฒ๐—ฝ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ณ๐—ถ๐—ฒ๐—น๐—ฑ is the region on the input side of a layer on which it operates at a time to give output as features. A larger receptive field ensures that larger objects are detected. - Adding more Convolutional Layers can increase the receptive field linearly - Subsampling layers like pooling increase the receptive field multiplicatively - Sequentially placed dilated
    Research Guide - Conferences and Journals
    2022-03-29
    Written by Ajai Chemmanam
    Publishing research findings in top conferences and journals are the most important part of any research. It helps us to disseminate knowledge to others and also get our work peer reviewed. Any researcher who intends to publish papers in conferences and journals should keep a list of top conferences and journals in their fields. Being a Computer Vision researcher, My list of journals is published below. | Journal Name | Publisher
    Research Guide - Featuring Online Tools to Help In Research
    2022-03-28
    Written by Ajai Chemmanam
    This is my first blog on research. Being a researcher, I found that it's always difficult to find the right tools/person to help guide you through the challenging times. In this blog, I try to introduce you to some tools that can be useful to those who are actively in research and as well as for those who are starting their incredible journey. Link : https://www.connectedpapers.com/ With connected papers, we can build a graph of papers
    NextJS Tutorial - PreRendering on NextJS
    2022-03-25
    Written by Ajai Chemmanam
    Next.js pre-renders every page by default. Next.js generates HTML for each page in advance, instead of having it all done by client-side JavaScript. Pre-rendering can result in better performance and SEO. Next.js has two forms of pre-rendering: - Static Generation - Server-side Rendering. The difference between the two is when it generates the HTML for a page. Static Generation is a pre-rendering method that generates the HTML at build time. The pre-rendered HTML is then reused on each requ
    NextJS Tutorial - Metadata and Loading Scripts
    2022-03-24
    Written by Ajai Chemmanam
    You can change the metadata of the webpage using the `<Head>` tag. We know that an html page will have a `<head>` section and a `<body>` section. The sites metadata are usually stored in the `<head>` section. `<Head>` is a React Component that is built into Next.js. It allows you to modify the `<head>` of a page. You can import the `<Head>` tag using the following. `import Head from 'next/head'` ```js export default functio
    NextJS Tutorial - Routing
    2022-03-23
    Written by Ajai Chemmanam
    Each Page of a NextJS Webpage resides in the `/pages` directory In NextJS, Pages are associated with a route based on their file name. Eg. `pages/index.js` corresponds to `/` route. `pages/first-page.js` is associated with the `/first-page` route. `pages/posts/first-post.js` is associated with the `/posts/first-post` route. Create a new file with the route as filename. Eg. `pages/p
    NextJS Tutorial - CSS Styling
    2022-03-22
    Written by Ajai Chemmanam
    Next.js has built-in support for CSS and Sass, which allows you to import `.css` and `.scss` files. Next.js has a built-in library called styled-jsx. Itโ€™s a โ€œCSS-in-JSโ€ library โ€” it lets you write CSS within a React component, and the CSS styles will be scoped (other components wonโ€™t be affected). You can also use other popular CSS-in-JS libraries such as [styled-com
    NextJS Tutorial - Asset Managment
    2022-03-21
    Written by Ajai Chemmanam
    Static Assets like images, robots.txt (a Google Site Verification file) can be served from public folder in the root NextJS directory. Files inside public can be referenced from the root of the application. Create an `images` directory inside the `public` folder in the NextJS root directory. Add the image file in this directory. The file can be accessed in normal
    Use Xquartz On Mac To View Ubuntu GUI
    2022-03-20
    Written by Ajai Chemmanam
    I was working with a remote Ubuntu machine through the VSCode remote SSH. I was stuck at some point that requires some output images or graphs to be displayed when I run some code on the remote machine. When I searched for a solution, I see many other users also face the same issue, especially when they are working with headless cloud servers like AWS EC2 instances that doesn't come with GUI. Let's say I created a simple python script to read and display an image. ```python import cv2 image =
    Heard of Arguments in Python Print command?
    2022-03-17
    Written by Ajai Chemmanam
    Did you know that the commonly used python print command had some useful arguments for all these times? As we all know, The print() prints a string (or any other object - the object will first get converted into a string) onto a screen. This blog introduces you to two arguments of print() in python. The sep and end arguments. Create a simple python .py file and copy the following content. ```python print("Hello", "World") print("This is my second sentence") ``` ``` Hello World This is my sec
    Using Tailwind With ReactJS
    2022-03-15
    Written by Ajai Chemmanam
    Tailwind CSS and ReactJS framework are two most powerful tools for developing awesome frontend webapps available today. This blog guides you to setup Tailwind with ReactJS in just seconds. Once you have followed the contents, you can check the official Tailwind webpage (https://tailwindcss.com/) and React (https://create-react-app.dev/docs/getting-started) for more information. First we will setup a new react app with create-react-app. ```bash npx create-rea
    JavaScript Tips
    2022-03-14
    Written by Ajai Chemmanam
    This blogpost lists some of the handy javascript tips that are useful for beginners and pros alike. I am sure atleast one of these will be a new information to you. Do bookmark this page, as we will add more tips to this space in the future. You can also send more tips that you would love to be featured here. Watch out this space !!! More javascript tips coming up .... UI developers often require to identify whether the users are using the dark mode
    Solving VSCode RemoteSSH Hanging When Accidently Clicking On Large Files
    2022-03-13
    Written by Ajai Chemmanam
    Ever since I started programming, VS Code is my all in one tool, whether it's prograaming, notes taking, writing research papers with latex. When I started using it to access remote machines, through VS Code Remote SSH Extension, everything was working fine until I accidently clicked a large file. The program hangs until the clicked file is downloaded or even disconnects. Often it tries to reconnect again and again. The only way was to wait until large files get downloaded completely or restar
    Prevent Pasting Text On Webpages With Javascript
    2022-03-10
    Written by Ajai Chemmanam
    Ever wondered how certain websites doesn't allow you to copy paste confidential information like credit card numbers etc. on their input field? In this post, we discuss how we can achieve the same on any html input component. The idea is to add an event listner to the input component that always get's executed whenever we paste something into that. ```javascript input.addEventListener("paste", function (e) { e.preventDefault(); }); ``` The e.preventDefault() prevents the default behaviour.
    Understanding Precision and Recall in Machine Learning Context
    2022-03-08
    Written by Ajai Chemmanam
    Measuring the effectiveness of a solution is often relative to the problem it solves. Accuracy is not always the final word in terms of performance metrics of a machine learning model. The costs associated with missing a detection and getting a wrong detection provides the basis of valuing precision and recall. A machine learning classifier model's predictions can have one of four possible outcomes. Ideally we want maximum truth outcomes and minimal false outcomes. #
    Understanding Bias and Variance in Machine Learning Context
    2022-03-03
    Written by Ajai Chemmanam
    Bias and Variance are two most important terms in Machine Learning context. In this blog, we try to understand Bias and Variance tradeoff. Bias is the error between average model prediction and ground truth. The bias of the estimated function tells us the capacity of the underlying model to predict the values. Average variability in the model prediction for a given dataset. The variance of the estimated function tells you how much the function can adj
    Solve Address Already in Use Error
    2022-03-02
    Written by Ajai Chemmanam
    Getting stuck on errors like "Address already in Use"? It is quite common that some ghost processes remain hold of certain ports. The ports may be intentionally or unintensionally blocked. Commonly used ports such as 3000, 5000 etc. are often gets blocked by node/python processes. Open a terminal and do the following for one time usage. - Freeing up a single port. Eg. Port 3000 in this case. ```b
    Action Recogniton With Nvidia TAO Toolkit - Part 1
    2022-02-23
    Written by Ajai Chemmanam
    Nvidia Train Adapt Optimize (TAO) Toolkit is a Python based AI toolkit for development of purpose-built AI models and customizing them with users' own data. The overall architecture consists of two parts Nvidia-TAO (Frontend) and Nvidia Tao Toolkit (Backend). TAO is a is a GUI based AI-model-adaptation framework that simplifies and accelerates the creation of enterpr
    Sending an Email from NextJS API Routes
    2022-02-21
    Written by Ajai Chemmanam
    This blog helps to send an email from your NextJS API Routes by using emailjs library. In order to setup a contact form for my portfolio, I needed to send an email to my personal mail. After a lot of searching, I used EmailJS to send emails. Setup a basic form in /pages/contact.js as following. Ensure onSubmit corresponds to a function that handles the logic on what to
    Introduction To Blog
    2022-01-02
    Written by Ajai Chemmanam
    Hi everyone, This is my first blog post. I have a habit of taking note of every thing I do, for reproducibility of my works. And these notes proved to be very helpful to - find solutions to issues that I had faced earlier and how I solved them - Easier to work on projects based on a new tech stack in which I had tried out earlier - Reproduce works faster But overtime, I started to face difficulties in finding relevant notes, as they were all scattered around on my Macbook, Workstation etc. F