PyTorch is a free and opensource machine learning library based on the Torch library. It has numerous in-built functions that allows data scientists to build machine learning algorithms with the shortest lines of code. In this article, I will outline and explain five interesting functions that every beginner in the field of data science will find useful when it comes to building models using PyTorch. These functions include;

  • torch.randn()
  • torch.split()
  • torch.reshape()
  • torch.transpose()

Before we begin, let’s install and import PyTorch

Function 1 —

The function concatenates two or more tensors of the same dimension into a single result tensor.

Malaria is parasitic disease caused by plasmodium parasites and transmitted through a bite of infected mosquitoes. If left untreated, malaria is a fatal disease. In 2019, it was estimated that there were 229 million cases of malaria worldwide (WHO).

Timely diagnosis of malaria is key for effective treatment and control of malaria. Diagnosis is done either through microscopy of rapid diagnostic tests. Use of machine learning techniques in diagnosis of malaria is currently being explored and in this study, we explore the use of Convolutional Neural Networks (CNN) in detection of malaria parasites.


  1. To obtain and prepare malaria parasites…

Michael Ochieng

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