Aditya Chatterjee's Blog, page 191

October 16, 2020

Alternatives to CNN (Convolutional Neural Network)

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...

 •  0 comments  •  flag
Share on Twitter
Published on October 16, 2020 01:39

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...
 •  0 comments  •  flag
Share on Twitter
Published on October 16, 2020 00:07

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...

 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2020 09:32

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.


jaccard


For those that are unfamilar with Jaccard similarity,...

 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2020 07:31

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 ...

 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2020 07:17

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...

 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2020 01:31

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...

 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2020 01:24

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...
 •  0 comments  •  flag
Share on Twitter
Published on October 12, 2020 23:58

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...
 •  0 comments  •  flag
Share on Twitter
Published on October 12, 2020 14:21

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:

graph-1

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 ...
 •  0 comments  •  flag
Share on Twitter
Published on October 12, 2020 14:02