Welcome to Your AI, ML & Python Programming Hub

  • Building my first PC for Deep Learning

    Building my first PC for Deep Learning

    Since starting getting into Deep Learning I have found that increasingly I need to access a server with a GPU. Not any GPU. A GPU that is capable of understanding CUDA. As a Macbook PRO user with only an AMD GPU, that automatically disqualifies me. Therefore after finding myself frequently going on Google Colab just […]

  • What is nn.Conv2d for in Pytorch?

    What is nn.Conv2d for in Pytorch?

    nn.Conv2d is a class in the PyTorch deep learning framework that represents a 2-dimensional convolutional layer. Convolutional layers are a fundamental building block in Convolutional Neural Networks (CNNs), which are widely used for image processing, computer vision, and other tasks involving grid-like input data. The nn.Conv2d class is part of the torch.nn module, which provides […]

  • Google Cloud Architecture Exam Practice Questions – GCloud CLI

    Google Cloud Architecture Exam Practice Questions – GCloud CLI

    As I was preparing for the Google Cloud Certified – Professional Cloud Architect exam, I found that gaining proficiency in the gcloud CLI (Command Line Interface) was absolutely essential. This exam evaluates one’s capability to design and plan cloud solution architecture, manage and provision the cloud solution infrastructure, design for security and compliance, and analyze […]

  • How to write a Jenkinsfile that calls Jenkins REST API to set up a new Job based on a config.xml

    How to write a Jenkinsfile that calls Jenkins REST API to set up a new Job based on a config.xml

    Jenkins, a widely-used open-source automation server, offers a powerful REST API that enables programmatic interaction with Jenkins. This blog post outlines the process of creating a Jenkinsfile that utilizes the Jenkins REST API to set up a new Jenkins job based on a config.xml file. This integration was developed in conjunction with GitHub and Backstage […]

  • How to call a REST API with REACT and Typescript using Axios Library

    How to call a REST API with REACT and Typescript using Axios Library

    In this example, I will show you how to call a REST API using the popular Axios library with React and TypeScript. First, you need to install Axios: Or if you are using Yarn: Now, let’s create a simple React component that fetches data from a REST API and displays it. For this example, we […]

  • VSCode and Docker for Machine Learning

    VSCode and Docker for Machine Learning

    In this article, I want to share my experience using Visual Studio Code (VSCode) for all my machine learning work and how it has significantly improved my productivity. I believe that I am now five times more productive than before, thanks to the use of VSCode, Docker containers, and GitHub Copilot. Working in Different Environments: […]

  • In Pytorch what is nn.Embedding for and how is it different from One Hot Encding for representing categorical data

    In Pytorch what is nn.Embedding for and how is it different from One Hot Encding for representing categorical data

    In PyTorch, nn.Embedding is a class that provides a simple lookup table that maps integers (usually representing discrete items like words, tokens, or categories) to continuous vectors. It is primarily used for working with categorical data in deep learning models, particularly in natural language processing tasks. nn.Embedding is often used to convert discrete tokens (e.g., […]

  • What is the PyTorch permute() function for?

    What is the PyTorch permute() function for?

    In PyTorch, the permute() function is used to rearrange the dimensions of a tensor according to a specified order. This can be useful in various deep learning scenarios, such as when you need to change the dimension order of your input data to match the expected input format of a model. The function takes a […]

  • Pairwise Squared Euclidean Distance Loss function used in “Taming Transformers for high resolution images” paper explained

    Pairwise Squared Euclidean Distance Loss function used in “Taming Transformers for high resolution images” paper explained

    The code snippet using PyTorch library below is found in the Taming Transformers paper: This code snippet is performing a vectorized calculation to compute pairwise squared Euclidean distances between two sets of vectors: z_flattened and the rows of self.embedding.weight. Let’s break down the code: Now let’s analyze the calculations: Finally, the code adds the three […]

  • What is tensor.detach() used for in PyTorch?

    What is tensor.detach() used for in PyTorch?

    Let’s take a closer look at the detach() function in PyTorch, which plays a helpful role when working with Tensors. The detach() function creates a new Tensor that shares the same data as the original one but without the attached computation history. This essentially separates the new Tensor from the computation graph, making it independent […]

  • What does the tensor.view() function do in PyTorch and how is it different from permute?

    What does the tensor.view() function do in PyTorch and how is it different from permute?

    In PyTorch, the view() function is a tensor operation used to reshape a tensor without changing its underlying data. It allows you to change the dimensions of a tensor to fit your desired shape while preserving the original data and maintaining the same number of elements. This is especially useful when you need to change […]

Would you like to contribute with an article?