Is GPU much faster than CPU in machine learning?

In the machine learning field, especially deep learning, GPU acceleration has gotten a lot of attention. But is it really that using GPU is faster than using CPU in training every model?

As we all know, GPU is also called Graphics Processing Unit. It was initially designed to speed up the process when creating and rendering graphics, to be more specific, to accelerate when calculating each pixel based on complex mathematics of color and lighting models. Although it is easy for the CPU to calculate one pixel, it is burdensome if it is high-resolution images, not to mention videos, especially when the calculation has to be done one by one. Additionally, CPU also needs to handle a lot of other tasks.

Read More

Setup a virtual Python environment for RStudio

Sometimes there are more than one version of python installed on the computer, and it is not obvious to identify which one is being used by default especially when using another language environment. Thus, it may be the situation that certain packages needed for one project are not needed for others, or the required packages are not installed in the target python environment. So it is better that one project or one type of projects has its own python environment. Anaconda has good environment control system if the project is in python. But if one needs work in another language environment, for example, R studio for many bioinformatics or other types of data analysis projects, with link to python, it is another situation.

Here are the steps to setup a new virtual python environment for projects in R studio by using reticulate:

Read More

Explanation on Paper "Processing Megapixel Images with Deep Attention-Sampling Models"

Welcome! Recently this paper, Processing Megapixel Images with Deep Attention-Sampling Models by Angelos Katharopoulos and Francois Fleuret, which was published on ICML (International Conference on Machine Learning) in 2019 has caught my eyes. I find it very interesting and can provide great help for deep learning tasks on large datasets with high resolution images, especially for small groups or individual researchers. It is also well written and thoroughly proved from mathematical aspect. I will present this paper and try to make it easier and more friendly to read (the mathematical formulations and proves will not be repeated here. In the meanwhile, for those who are interested, it is recommended to read the paper since they are very well presented in the paper). Presenting is also a way of learning myself.

1. Background

The motivation of this paper is to help with computer vision tasks with megapixel images. The traditional CNN architectures usually cannot operate directly on those high resolution images because of the limitation of computational and memory resources.

Read More