About Prateek Joshi

I want the machines to see the world ... see the world the way I see it!

Homomorphism vs Homeomorphism

1 mainI was recently reading an article and I came across these terms. From the looks of it, they are very close to each other, right? In many fields within mathematics, we talk about objects and the maps between them. Now you may ask why we would want to do that? Well, transformation is one of the most fundamental things in any field. For example, how do we transform a line into a circle, or fuel into mechanical energy, or words into numbers? There are infinitely many types of transformations that can exist. Obviously, we cannot account for every single type of transformation that can possibly exist. So we limit ourselves to only the interesting ones. So what exactly is it all about? How does it even relate to the title of this blog post?   Continue reading

Why Is Python Slow?

1 mainWhen people talk about speed in the world of programming languages, they usually center the discussion around compiled vs interpreted languages. In this post, we will discuss two of the most famous languages on this planet, Python and C. I was recently playing around with this and I made a few pleasant discoveries. So I thought I should share them here. One of the biggest reasons as to why Python is slower than C is because of the dynamic typing feature in Python. While it may be true that dynamically typed programming languages are slower than statically typed languages, it may not be the major factor slowing down your Python code. The dynamic typing feature of programming languages like Python makes the interpreters harder to optimize. I guess this is the cost of having an extremely beginner-friendly language! But one thing to note is that there is a big difference between interpreter being harder to optimize and your code being slow. We’ve had years of research focusing on the best way to perform type checking at runtime in these languages, thus making this overhead negligible. So how do we understand why Python code is slower than C code? How do we write Python code that’s not slow?   Continue reading

Functors In C++

1 mainWhen you look at the word “functor”, the first thing that comes to mind is that it looks very similar to “function”. The word actually comes from a field called category theory, which is an abstract branch of mathematics. A category basically consists of objects that are linked to each other in certain ways. This is an extremely simplistic view of a very complex field of mathematics. But basically, that’s what it’s about! As it turns out, this mathematical concept is really useful in the world of programming. If used in the right way, it can be a very powerful tool in your coding arsenal. So what exactly is a functor in the context of programming? How do we use it?   Continue reading

A Beginner’s Look At Lambda Calculus

1 mainBack in school, you must remember studying differential and integral calculus. Now what on earth is lambda calculus? Well, lambda calculus is basically a simple notation for functions and applications in mathematics and computer science. It has a significant impact in the field of programming language theory. It forms the basis for all the modern functional programming languages like Haskell, Scala, Erlang, etc. The main idea here is to apply a function to an argument and forming functions by abstraction. The good thing about lambda calculus is that the syntax is quite sparse, which makes it an elegant notation for representing functions. Here, we get a well-formed theory of functions as rules of computation. We will discuss this further soon. Even though the syntax of lambda calculus is sparse, it is really flexible and expressive. This feature makes is particularly useful in the field of mathematical logic. So what exactly is lambda calculus? How do we understand it?   Continue reading

Autoencoders In Machine Learning

1 mainWhen we talk about deep neural networks, we tend to focus on feature learning. Traditionally, in the field of machine learning, people use hand-crafted features. What this means is that we look at the data and build a feature vector which we think would be good and discriminative. Once we have that, we train a model to learn from it. But one of the biggest problems with this approach is that we don’t really know if it’s the best possible representation of the data. Ideally, we would want the machine to learn the features by itself, and then use it to build the machine learning model. Autoencoder is one such neural network which aims to learn how to build optimal feature vector for the given data. So how exactly does it work? How is it used in practice?   Continue reading

Why Do We Need Two-Factor Authentication?

1 mainIn the last couple of years, we have encountered quite a few security breaches. A lot of internet companies are being targeted with these kinds of attacks. One of the most common forms of online transactions is that you have an account that’s protected with a password. So whenever you want to access your account, you just enter your username along with the password. But the problem is that this is breakable! As in, people can technically break into these accounts. So people started thinking about different ways in which this could be prevented. Of course, choosing better passwords would help, but we need to way to fundamentally improve the security. How exactly do we do it? Do we just choose bigger and better passwords or is there something new we can do?   Continue reading

Static vs Dynamic Typing

1 mainIf you are a programmer, you must have heard the terms “static typing” and “dynamic typing” being thrown around a lot. When we talk about programming languages, this is an important feature that tends to significantly affect the programs written in that language. In the spirit of simplicity, I will try to keep this post as code-free as possible. Actually, you don’t have to know any programming language in particular to understand this concept. If you are doing a hobby project or doing something simple, this will not come into picture and it will not affect your code as such. As you build bigger systems, static and dynamic typing will become a big concern. If you are not fully aware of the limitations of a given programming language, you will end up spending a lot of time in code maintenance. So it’s always good to know some of these things. Alright, so what exactly is it about? Does it really matter that much?   Continue reading