Running DeepLearning4J on GPU

As we mentioned previously, DeepLearning4j relies on ND4J for numerical calculations. ND4J is an interface, and there are multiple possible implementations. So far, we have used the one based on OpenBLAS, but there are other ones. We also mentioned that ND4J can utilize a Graphics Processing Unit (GPU), which is a lot faster than CPUs for typical Linear Algebra operations used in neural networks such as matrix multiplication. To use it, we need to get the CUDA ND4J backend.

CUDA is an interface used for executing the computations on NVidia's GPUs, and it supports a wide range of graphical cards. Internally, ND4J uses CUDA to run numerical computations on GPUs.

If you have previously executed all the code on the ...

Get Mastering Java for Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.