Aditya Chatterjee's Blog, page 191
October 16, 2020
Alternatives to CNN (Convolutional Neural Network)

We have all seen the boom of Convolutional neural networks, but we seldom understand that there is something inherently wrong about CNN. This claim is hard to justify easily but the article will make sure that you understand what exactly is wrong and what are the probable solutions.
There are two major alternatives to CNN (Convolutional Neural Network) namely:
Graph Neural Networks
Capsule Neural Network
Convolutional Neural Networks or CNNs are one of those concepts that made the developmenta...
Pass Variable By Reference in Python
In this article, we have explored how to pass a variable by reference to a function in Python. We have demonstrated the ideas by Python code snippets.
There a two types of passing parameters to a function in Python:
Pass By Value
Pass By Reference
Pass By Value:
A copy of the argument passed to the function is made and when any operation is done on the copy the actual value does not change. It only changes the value of the copy which is made inside the function.
def fun(a):
a+=10
print...
October 13, 2020
LogLog (Probabilistic Data Structure for Cardinality)
Imagine you had a probelm where you were asked to find the number of unique elements in a list of data where there could be duplicates. There are 2 quick approaches one could quickly come up with. One option is simply to rely on the library's set but often times they have to deal with reisizing their array, deal with collisions, deal with equality checks. The other option would be simply to sort the list of data then simply iterate through the list and gather non-duplicates. Both of these work f...
MinHash (Probabilistic Data Structure for Similarity)
Lets assume you wanted to find how similar two sets are. You could simply brute force your way by going through the contents of one set and compare those elements with the other set. Sure this method can work but what if you wanted to check a bunch of other sets? This would be rather slow, especially if you are working with a lot of data.
Jaccard Similarity
Some of you may know this equation and how to apply it, so you may skip this section.
For those that are unfamilar with Jaccard similarity,...
Probabilistic Data Structures
This is a general overview of probablistic data structures (with examples of data structures over 5 different categories).
Introduction
When it comes to answers we often want the precise exact answer, but there comes a time and place where getting the exact answer may take too much resources and we would be fine with an approximate answer that is close to the correct answer.
Take for instance, Big Data, as Big Data deals with massive amounts of data and processing time, often times the standard ...
Adversarial Sample Transferability in Machine Learning: Attacks
In this article, we will be exploring a paper titles “Transferability in Machine Learning: from Phenomena to Black-Box Attacks using Adversarial Samples” by Nicolas Papernot, Patric McDaniel and Ian Goodfellow. The paper talks about what adversarial machine learning is and what transferability attacks are. The authors have also presented experimental details on some popular classification systems and have demonstrated adversarial sample transferability. In the end, adversarial crafting technique...
Can Machine Learning (ML) be secure?
We will be talking about a paper titled "Can Machine Learning Be Secure?" by Marco Barreno, Blaine Nelson and others. This paper basically answers the question title itself presents. The paper involves a taxonomy of types of attacks on Machine learning, defense strategies and more.
Introduction
In the modern world, machine learning is finding its application in many important fields. One example is of network Intrusion Detection System (IDS). Machine learning models can be trained on traffic int...
October 12, 2020
Tomohiko Sakamoto Algorithm
The Tomohiko Sakamoto Algorithm is used to find the Day of the week for a given date. The date is provided according to the Gregorian Calendar.
Sample Input and Output format
Input : 09 09 2020 (9th September 2020)
Output : 3 (i.e Wednesday)
Input : 15 08 2012 (15th August 2012)
Output : 3 (i.e Wednesday)
Input : 24 12 2456 (24th December 2046)
Output : (0 i.e Sunday)
Algorithm Explanation/Steps with example:
Consider January 1st 1 AD, which is a Monday as per Gregorian calendar.
Now, fir...
Smallest sum contiguous subarray
You are given an array of n integers. The task is to find the sum of the subarray which has the smallest possible sum.
Note: Subarray is an array formed by a block of contiguous elements of the parent ( or original ) array.
Examples
Input:
No. of elements in the array = 5
Array : -4 3 -1 -6 8
Output:
-8
Explanation: The subarray [-4, 3, -1, -6] gives the minimum sum.
Input:
No. of elements in the array = 5
Array : 3 5 1 2 4
Output:
1
Explanation: The subarray [1] gives the minimum sum.
A...
Find if there exists a path between two nodes in a directed graph
You are given a directed graph and two vertices on it. Your task is to find if there exists a path between the first vertex to the second vertex or not.
Example
Consider the following graph:

Input to construct the above graph:
Input:
No. of nodes in graph = 4
No. of edges in graph = 5
Edges:
1 2
2 3
2 4
3 1
3 4
No. of queries = 2
1 4
4 2
Output:
Yes
No
Explanation:
For the first query, the answer is Yes because we can construct a path as shown in the diagram below ( 1->2->4 ) but for ...