Aditya Chatterjee's Blog, page 198

August 2, 2020

Sort a stack using another stack

Sort a stack using another stack

In this article, we have explored an algorithm to sort a stack using another stack that is by using stack operations like push and pop only. The time complexity of this approach is O(N^2) and space complexity is O(N).


Stack : It is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).


Mainly the following three basic operations are performed in the stack:


Push: Adds an item in the stac...

 •  0 comments  •  flag
Share on Twitter
Published on August 02, 2020 14:04

July 28, 2020

Gated Graph Sequence Neural Networks (GGSNN)

Gated Graph Sequence Neural Networks (GGSNN)

Gated Graph Sequence Neural Networks (GGSNN) is a modification to Gated Graph Neural Networks which three major changes involving backpropagation, unrolling recurrence and the propagation model. We have explored the idea in depth.


We start with the idea of Graph Neural Network followed by Gated Graph Neural Network and then, Gated Graph Sequence Neural Networks.


Graph Neural Networks are great at some of the most complicated databases like social networking site data or logistic services and ev...

 •  0 comments  •  flag
Share on Twitter
Published on July 28, 2020 00:08

July 27, 2020

Implementation of BERT

Implementation of BERT

Reading time: 30 minutes


In this article, I tried to implement and explain the BERT (Bidirectional Encoder Representations from Transformers) Model .This article mainly consists of defining each component's architecture and implementing a Python code for it.


BERT Model Architecture:

I have discussed in detail about the BERT model architecture in this article but in short , you can understand it as a number of encoder layers stacks on each other taken from Transformers architecture.


Implementation of BERT


Model Buil...
 •  0 comments  •  flag
Share on Twitter
Published on July 27, 2020 03:29

Advantages and Disadvantages of Linear Regression

Linear regression is a simple Supervised Learning algorithm that is used to predict the value of a dependent variable(y) for a given value of the independent variable(x) by effectively modelling a linear relationship(of the form: y = mx + c) between the input(x) and output(y) variables using the given dataset.


linear_regression-1


Linear regression has several applications :



Prediction of housing prices.
Observational Astronomy
Finance

In this article we will be discussing the advantages and disadvantages of lin...

 •  0 comments  •  flag
Share on Twitter
Published on July 27, 2020 03:10

Capsule neural networks or CapsNet

Capsule neural networks or CapsNet

Capsule neural networks or CapsNet is an artificial neural network which consists of capsules(bunch of neurons) which allow us to confirm if entities (components) are present in the image. We will cover Capsule Networks in depth.


Introduction

Convolutional neural networks have proven to be a standard for classifying images. They are the main reason why deep learning has become so popular. However, they are not flawless as they have several disadvantages.


The major disadvantage being that they l...

 •  0 comments  •  flag
Share on Twitter
Published on July 27, 2020 02:45

July 24, 2020

Build a Minesweeper game using JavaScript

Build a Minesweeper game using JavaScript

Minesweeper is a single-player puzzle game. The goal of the player is to clear a rectangular board containing hidden "mines" or bombs without detonating any of them, with help from clues about the number of neighboring mines in each cell.


In this article, we'll learn how to build a basic minesweeper game using JavaScript. This is how it will look:


Build a Minesweeper game using JavaScript


Tech stack: The tech stack that will be used is:



HTML
CSS
JavaScript

Yes, no frameworks or library is to be used, we'll develop the game using Van...

 •  0 comments  •  flag
Share on Twitter
Published on July 24, 2020 08:22

Binary JSON (BSON)

In this post we shall understand the circumstances behind the need for Binary JSON (BSON), it's applications, merits and demerits and also most importantly it's relationship with JSON.


But inorder to understand BSON Let's first get a better understanding of JSON .


What is JSON?

JSON also referred to as Javascript Object Notation is a standard file format consisting of human readable text which is mainly used for asynchronous client and server communication.


Need for JSON

The need for JSON arose...

 •  0 comments  •  flag
Share on Twitter
Published on July 24, 2020 07:54

July 22, 2020

Different ways to add elements in Priority queue in C++

Different ways to add elements in Priority queue in C++

Priority Queue is an STL container. Primarily a container adapter which stores the greatest element at the top; a max-heap.

It is an adapter which uses a vector by default as an underlying container, but a deque can also be used. In this article, we have explored Different ways to add elements in Priority queue container in C++.


Library: queue
1. Using push()
void push (const value_type& val);
void push (value_type&& val);


This method inserts a new element to the container and initializes it ...
 •  0 comments  •  flag
Share on Twitter
Published on July 22, 2020 14:08

July 21, 2020

Developing static webpage application using Flask with no database

Flask is a micro web-framework which is easy to learn and is very simple in usage. Yet, it has the capability of building an enterprise level application which can handle large amount of traffic. In this article, we will build basic static webpage application in Flask with no database.


A static webpage means an single HTML code which does not change with user interaction. It may have CSS and JavaScript code linked with it. In terms of performance, this is one of the preferred webpages.


The idea...

 •  0 comments  •  flag
Share on Twitter
Published on July 21, 2020 00:17

July 20, 2020

Why String is immutable in Java?

Reading time: 10 minutes | Coding time: 5 minutes


An immutable object is an object whose internal state remains constant after it has been entirely created.This means that the public API of an immutable object guarantees us that its behaviour will remain same and will not change during its whole lifetime.


In Java, Strings are immutable which means that the existing String objects can't be changed i.e we can't modify the existing String objects or we can't change the internal state of the String...

 •  0 comments  •  flag
Share on Twitter
Published on July 20, 2020 22:57