Category: Machine Learning

  • 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: […]

  • 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 […]

  • Lip Synching Head Talking Videos At 4K using Wav2lip and Vqgan

    Lip Synching Head Talking Videos At 4K using Wav2lip and Vqgan

    Hello everyone, in this article I wanted to talk about a paper that is a follow-up of Wav2Lip:: Towards Generating Ultra-High Resolution Talking-Face Videos with Lipsynchronization. This paper makes an improvement of the Wav2Lip model so that it is able to generate lip-synching videos at 4K resolutions. And how does it manage to achieve that? […]

  • What computer for Machine Learning and MLOps

    What computer for Machine Learning and MLOps

    You are new to machine learning and you want to know what kind of computer, either a laptop or a PC you need for working in machine learning.  The short answer is that you can buy or use any old banger laptop and you can learn machine learning by using free services like Google Colab. It […]

  • Visualizing a neural network in 3D with Python, Blender and Tensorflow

    Visualizing a neural network in 3D with Python, Blender and Tensorflow

    I have started recently a new project in which I am trying to visualize a neural network in 3D with Python, Blender and Tensorflow. This is a very interesting challenge and a great way to learn things that I didn’t know I needed to know. For example how to get access to the different layers […]

  • Convert a photo from 2D to 3D model with color with PIFu

    Convert a photo from 2D to 3D model with color with PIFu

    This is a short tutorial on how you can convert and train Pifu to convert a 2D photo to a 3D Model with color. Pifu is the predecessor to PIFuHD.  PIFU in theory can be trained to create 3D Models for any type of object, not just humans, but of course, you will need to […]

  • Google Dataflow Secure Quickstart with Python

    Google Dataflow Secure Quickstart with Python

    In this step-by-step guide I will share the additional steps that I followed to enable Google Dataflow with the least permissions needed, with Google KMS Encryption enabled, and all the necessary service accounts, that one would be expected to employ in a secure production deployment. I will base this guide on the already existing GCP […]