Explained with Q, K, V notions

Let's kick off with a little scenario. The earth is like an orange, Orange is a bright color. Now, put a little focus on the words orange in either sentence. It should be pretty obvious that the very same word is conveying meanings that are wildly different from each other. In the first sentence, it denotes orange, the fruit while the second one is telling about orange, the color. But how are we able to tell these apart? After all, they are essentially the same words. That’s where context comes into play.

What is attention?

Context plays a major role in our natural…

Simple, module wise implementation of Decision Trees using Gini index

I’ve talked quite a bit about decision trees. This is the article that we actually implement one. For the very basics, decision trees are a class of supervised learning algorithms in ML that relies on repeatedly splitting the dataset with respect to the “most plausible feature” to construct a graphical structure that has decisions at the level of roots. Since this is implementation-focused writing, there won’t be much of theoretical discussions.

Inner mechanisms

For this article, I’ll refer to the target column of the dataset as Y and the rest as X. …

The door to Epiphenomenalism

Think of a brilliant scientist called Mary made to live in a dark room unable to connect to the external world except via a screen through which she monitors the world and unfortunately the screen is only capable of displaying grayscale images. Mary, a neurophysiologist by profession, excels in the field of human vision, visual perception, and the science of colors. One fine sunny morning, she is released into the wide world that so far existed beyond her physical knowledge. Now the question that arises is whether Mary will learn anything new after being released into the wilderness.

This is…

The data itself is redundant, all that is needed to know is if it was greater than a threshold.

Activation functions are the driving forces of artificial neural networks, as they sit on top of any neuron and administer its behavior such as if it should fire upon a certain input, if it does, to what degree, and so on. Technically speaking, the activation function of a certain node takes as input the data from its predecessors in the network and spits out a certain value that in turn indicates to its successor nodes how “turned on” it was in response to the particular input signal. …

“Computer vision is the science of programming a computer to gain a high-level understanding of digital imagery.”

ConvNets are at the heart of image recognition and computer vision. One of the most fascinating things about this is how a sequence of raw mathematical operations like multiplication and addition goes all the way to process and recognize complex visuals. In this episode, we talk about a few fundamental concepts of computer vision, define and illustrate the working procedure of ConvNets and jot down some technical terms associated with that. First, let's talk of the idea since they are bulletproof(!)

The idea

The idea is simple, detect what’s inside an image, playback video, or a live recording (since all videos are…

Can you beat what you just created?

Wonder why it is virtually impossible for an average person to beat a computer in strategic board games like chess, go, or tic tac toe? That’s because computers can literally see into the future (or futures, to be precise) of the game and decide the upcoming move accordingly. The class of algorithms exploited in this context is known as Adversarial Search. The core motive of such algorithms is to play defensively and resist the opponent from winning at any cost. …

In the previous episodes, we’ve discussed a few clustering strategies like centroid based and hierarchy based (you can find them here, if interested); in this episode, we talk of yet another family of clustering algorithms. Density based clustering algorithms are ones that proceed by finding the areas with a higher concentration of data points and merge those with similar concentration into a single cluster. Now, I know this might seem a little vague, like what’s concentration? How can it be similar? And so on. So without further adieu, let’s dive into the matter.

The intuition

One of the best ways to…

So you’re reading this, but how confident are you that this is the same text from the author stated above and hasn’t been compromised to something else on the way (like I was writing on Data Science and the adversary altered it to a text on cryptography)? Well, networks are quite precarious in nature and such an incidence shouldn’t be surprising at all. In network communications, the integrity of the message to be delivered is just as important as secrecy and other privacy requirements are.

By integrity, we mean that a message (like this article is a message from me…

Over the years, we’ve all grown up and so have Alice and Bob. Now they need more sophisticated and reliable cryptographic standards. That’s where the idea of public key encryption pops in. Public key encryption, in the generic sense, is a scheme that employs one globally shareable public key and an individual private key from each side. The message can be decrypted via a proper combination of the keys on each side. A classic instance of such a scheme is the ElGamal cryptosystem, which we dissect in this episode.

Okay, to study the ElGamal algorithm, we need to have a…

Say you’ve got a bunch of points (or objects, suppose, with reasonable similarity among each) and now you want to arrange them into nice little buckets, but the problem is you don’t know how many different sets to partition them into. So you can’t use k means or any related ones (obviously because the value of k is not known or cant feasibly be guessed). What can you do now? We go HIERARCHICAL then!

Okay, funs aside😉. The idea of hierarchical clustering is to build clusters that have predominant ordering from top to bottom (head on to this site

Hussain Safwan

Developer, writer, artist. Total blend. Visit me at https://safwan.netlify.app/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store