"Hi There, Welcome to my blogs section."

In this page, I'll share my learning experiences and try to put my learnings in simple, short and easy to understand manner.

January 2nd, 2023.

This figure depicts the general BERT pre-training and fine-tuning techniques. The same designs are utilised for pre-training and fine-tuning, with the exception of output layers. Models are initialised for various down-stream activities using the same pre-trained model parameters. All parameters are adjusted during fine-tuning. Every input example now has the special symbol [CLS] before it, and [SEP] is a special token that separates questions and answers.

7th jan 2023


13 jan 2023


GRU stands for Gated Recurrent Unit and is a type of recurrent neural network (RNN) used for processing sequential data. Like other RNNs, GRU networks can handle input sequences of variable length and are designed to model temporal dynamics in the sequence.

GRU networks have a simpler architecture than LSTM networks, with two main gates:

The update and reset gates in GRU networks are used to selectively remember or forget information from previous time steps, allowing the network to model long-term dependencies in the sequence. The network also has a hidden state that is passed from one time step to the next.

GRU networks are similar to LSTM networks in that they can handle long-term dependencies in sequential data. However, they have fewer parameters than LSTM networks and may be faster to train. In some cases, GRU networks may be as effective as LSTM networks for tasks that involve temporal dynamics.

Overall, GRU networks are a useful tool for processing sequential data and may be a good choice for tasks that require a simpler architecture than LSTM networks. They have been used successfully in a range of applications, including speech recognition, natural language processing, and image captioning.

20 jan 2023


RNN, LSTM, and GRU are all types of neural networks used for processing sequential data. Here is a brief comparison of the three:

Overall, LSTM and GRU are both improvements on traditional RNNs that can handle long-term dependencies more effectively. LSTM networks are more complex than GRU networks, but they may be more effective for tasks that involve complex temporal dynamics. The choice of which type of network to use will depend on the specific requirements of the task at hand.


24 jan 23

Descriptors/ Features

In machine learning, a descriptor or feature vector is a numerical representation of an object or data point. The descriptor is constructed by extracting features or characteristics from the object, such as color, texture, shape, or size, and transforming these features into a vector of numbers.

The goal of constructing a descriptor or feature vector is to capture the important information about the object in a compact and standardized format that can be easily processed by machine learning algorithms. Descriptors can be used in a variety of machine learning tasks, such as image recognition, object detection, and natural language processing.

For example, in image recognition, a descriptor may be constructed by extracting color histograms, texture features, and edge information from an image and concatenating these features into a single vector. This vector can then be used as input to a machine learning algorithm to classify the image into different categories.

There are many techniques for constructing descriptors or feature vectors, including hand-crafted features, deep learning-based features, and hybrid methods that combine both approaches. The choice of descriptor will depend on the specific application and the characteristics of the data.

Overall, descriptors or feature vectors are a fundamental concept in machine learning that enable the representation and processing of complex data in a standardized and computationally efficient way.


26 jan 2023

Region vs Boundary Descriptors

In computer vision and image processing, region descriptors and boundary descriptors are two types of feature extraction techniques used to describe objects or regions within an image.

Region descriptors focus on capturing the properties of the interior of an object or region. These descriptors are often based on statistical measures such as color histograms, texture features, or shape properties such as area, perimeter, and compactness. Region descriptors are often used for tasks such as image classification, object recognition, and image segmentation.

Boundary descriptors, on the other hand, focus on capturing the properties of the boundary or contour of an object or region. These descriptors are often based on the shape of the boundary, such as curvature or angle of inclination, or on the texture and color properties of the boundary. Boundary descriptors are often used for tasks such as object detection, edge detection, and image registration.

Both region descriptors and boundary descriptors have their advantages and disadvantages, and the choice of descriptor will depend on the specific application and the characteristics of the data. Region descriptors are generally more robust to noise and occlusion, while boundary descriptors are more sensitive to changes in shape and position. In some cases, combining region and boundary descriptors can provide a more complete and accurate representation of the object or region of interest.


30 jan 2023

Bayes Minimum Risk Classifier

In the context of classification, the Bayes minimum risk classifier calculates the expected loss associated with classifying a given input into each possible class. The classifier then chooses the class that has the lowest expected loss, based on the prior probabilities of each class and the cost associated with each type of misclassification.

The expected loss is calculated as the sum of the product of the loss associated with each possible misclassification and the probability of that misclassification, summed over all possible classes. The loss function can be defined in a variety of ways, depending on the specific application and the costs associated with different types of errors.

The Bayes minimum risk classifier can be used in a variety of applications, such as image classification, natural language processing, and speech recognition. However, it requires knowledge of the prior probabilities of each class and the cost associated with each type of misclassification, which may be difficult to estimate accurately in some cases.

Overall, the Bayes minimum risk classifier is a powerful tool for classification tasks that takes into account the costs associated with different types of misclassifications, and can be used to minimize the expected loss associated with a given classification problem.


3 feb 2023

Discriminant Function and Decision Surface

A discriminant function is a function used in machine learning for classification tasks that takes an input vector and assigns it to one of two or more categories based on a decision boundary. The function computes a score or distance measure for each category based on the input vector, and the category with the highest score is chosen as the predicted class.

The decision surface is the boundary or hyperplane that separates the different categories in the feature space. The discriminant function is used to construct the decision surface, which can be linear or nonlinear depending on the complexity of the classification problem and the number of input features.

For example, in a simple two-class classification problem with two input features, the decision surface can be a straight line that separates the two classes in the feature space. The discriminant function assigns a score or distance measure to each point in the feature space, and the decision surface is defined as the set of points where the scores for each class are equal.

In more complex classification problems with multiple input features, the decision surface may be more complex and nonlinear, and may require more sophisticated discriminant functions, such as neural networks or support vector machines.

The choice of discriminant function and decision surface will depend on the specific application and the characteristics of the data. The goal is to find a function and surface that accurately classify new data points and generalize well to unseen data.


8 feb 2023

Linear Classifier and SVM

A linear classifier is a type of classifier used in machine learning that separates data points into two or more classes based on a linear decision boundary in the feature space. A linear decision boundary is a straight line or a hyperplane that separates the different classes in the feature space.

The linear classifier computes a linear combination of the input features and applies a threshold function to classify the input data into one of two or more categories. The coefficients of the linear combination are learned from a training dataset using optimization techniques such as gradient descent or the normal equation.

One common type of linear classifier is the Support Vector Machine (SVM), which maximizes the margin between the decision boundary and the closest data points, known as support vectors. The margin is the distance between the decision boundary and the support vectors, and maximizing it helps to ensure that the classifier has good generalization performance and is less likely to overfit the training data.

SVMs can handle both linearly separable and non-linearly separable data by using kernel functions to map the input data into a higher-dimensional feature space where the data is linearly separable. The SVM then finds a linear decision boundary in the higher-dimensional feature space that corresponds to a non-linear decision boundary in the original feature space.

Overall, linear classifiers and SVMs are popular and effective techniques for classification tasks that require a simple and interpretable model, and can be used in a variety of applications, such as image classification, text classification, and bioinformatics.

14 feb 2023

ETL stands for Extract, Transform, and Load, which is a process used in data warehousing and data integration to move data from various sources, transform it into a consistent format, and load it into a target system such as a database or a data warehouse. The ETL process is an essential part of building a data pipeline for analysis, reporting, and business intelligence.

The first step of the ETL process is to extract the data from one or more sources, which can be structured or unstructured data, and may reside in various formats such as files, databases, APIs, or web services. The extracted data is then stored in a staging area or a temporary storage location.

The next step is to transform the data into a consistent and usable format, which involves cleaning, filtering, aggregating, and enriching the data to ensure its quality and reliability. This step can also involve merging and joining data from different sources, performing calculations and data manipulations, and creating derived fields and features.

Finally, the transformed data is loaded into the target system, which can be a database, a data warehouse, or a data lake. The loading process can involve indexing and partitioning the data for efficient querying and retrieval, and ensuring the data is properly structured and optimized for analytics and reporting.

The ETL process is crucial for ensuring data quality, consistency, and reliability in a data pipeline, and can help organizations make better-informed decisions based on accurate and reliable data. The process can be automated using various ETL tools and platforms, which can reduce errors, improve efficiency, and save time and resources in data integration and management.


21 feb 2023

Pyspark vs. Pandas

Pyspark and Pandas are both popular tools for working with data, but they have different strengths and weaknesses.

Pandas is a Python library for data manipulation and analysis. It is particularly well-suited for working with small to medium-sized datasets that can fit into memory. Pandas provides a wide range of data structures and functions for manipulating data, including powerful tools for filtering, sorting, grouping, and aggregating data.

Pyspark, on the other hand, is a distributed computing framework that is built on top of Apache Spark. It is designed for working with large datasets that cannot fit into memory on a single machine. Pyspark provides a range of tools for distributed data processing, including functions for filtering, sorting, grouping, and aggregating data across multiple machines.

In general, if you are working with smaller datasets or need to do complex data manipulations, Pandas is a good choice. If you are working with large datasets that require distributed computing, or need to scale up your data processing, Pyspark is a better option.

However, it's worth noting that there is some overlap between the two tools, and they can be used together in some cases. For example, you could use Pandas to do some initial data cleaning and manipulation on a smaller dataset, and then switch to Pyspark for more advanced processing on the full dataset.