Category: PyTorch

#009 PyTorch – How to apply Backpropagation With Vectors And Tensors

Highlights: In Machine Learning, a backpropagation algorithm is used to compute the loss for a particular model. The most common starting point is to use the techniques of single-variable calculus and understand how backpropagation works. However, the real challenge is when the inputs are not scalars but of matrices or tensors. In this post [1], we will learn how to deal with inputs like vectors, matrices, and tensors of higher ranks. We will understand how…
Read more

#006 PyTorch – Solving the famous XOR problem using Linear classifiers with PyTorch

Highlights: One of the most historical problems in the Neural Network arena is the classic XOR problem where predicting the output of the ‘Exclusive OR’ gate becomes increasingly difficult using traditional linear classifier methods. In this post, we will study the expressiveness and limitations of Linear Classifiers, and understand how to solve the XOR problem in two different ways. So let’s begin.   Tutorial Overview: Logistic Regression Model Simple Logical Boolean Operator Problems The OR…
Read more

#004 PyTorch – Computational graph and Autograd with Pytorch

Highlights: In this post, we will introduce computation graphs – a systematic and easy way to represent our linear model. A computation graph is a fundamental concept used to better understand and calculate derivatives of gradients and cost function in the large chain of computations. Furthermore, we will conduct an experiment in Microsoft Excel where we will manually calculate gradients and derivatives of our linear model. Finally, we will show you how to calculate gradients…
Read more

#003 PyTorch – How to implement Linear Regression in PyTorch

Highlight: In this post we are going to explain what a Liner regression is. After covering the basic theory behind Linear regression, we are going to code a simple linear regression model in Python using PyTorch library. So, let’s begin. Tutorial overview: What is a linear model? Building a linear model Linear regression Loss function Calculating the Mean Squared Error (MSE) Cost graph Gradient descent Linear regression in PyTorch Intuitive implementation of Linear regression in…
Read more

#005 PyTorch – Logistic Regression in PyTorch

Highlights: In this post, we are going to talk about logistic regression. We will first cover the basic theory behind logistic regression and then we will see how we can apply this knowledge in PyTorch.   Tutorial Overview: What is a binary prediction? Logistic regression – introduction A cost function optimization Cross–entropy loss function Calculating Logistic regression derivatives Logistic regression in Python with PyTorch Simple example Logistic Regression experiment 1. What is a binary prediction?…
Read more