R for DNNs

In the previous section, we clarified some key concepts that are at the deep learning base. We also understood the features that make the use of deep learning particularly convenient. Moreover, its rapid diffusion is also due to the great availability of a wide range of frameworks and libraries for various programming languages.

The R programming language is widely used by scientists and programmers, thanks to its extreme ease of use. Additionally, there is an extensive collection of libraries that allow professional data visualization and analysis with the most popular algorithms. The rapid diffusion of deep learning algorithms has led to the creation of an ever-increasing number of packages available for deep learning, even in R.

The following table shows the various packages/interfaces available for deep learning using R:

CRAN package

Supported taxonomy of neural network

Underlying language/ vendor

MXNet

Feed-forward, CNN

C/C++/CUDA

darch

RBM, DBN

C/C++

deepnet

Feed-forward, RBM, DBN, autoencoders

R

h2o

Feed-forward network, autoencoders

Java

nnet and neuralnet

Feed-forward

R

Keras

Variety of DNNs

Python/keras.io

TensorFlow

Variety of DNNs

C++, Python/Google

 

MXNet is a modern, portable, deep learning library that can support multiple machines. The world's largest companies and universities have adopted MXNet as a machine learning framework. These include Amazon, Intel, Data, Baidu, Microsoft, Wolfram Research, Carnegie Mellon, MIT, University of Washington, and Hong Kong University of Science and Technology.
MXNet is an open source framework that allows for fast modeling, and supports a flexible programming model in multiple programming languages ​​(C ++, Python, Julia, MATLAB, JavaScript, Go, R, Scala, Perl, and Wolfram Language).
The MXNet framework supports R programming language. The MXNet R package provides flexible and efficient GPU computing and a state-of-the-art deepening at R. It allows us to write a seamless tensorial/ matrix calculation with multiple GPUs in R. It also allows us to build and customize the state-of-the-art deep learning models in R and apply them to activities such as image classification and data science challenges.

The darch framework is based on the code written by G. E. Hinton and R. R. Salakhutdinov, and is available in the MATLAB environment for DBN. This package can generate neural networks with many levels (deep architectures) and form them with an innovative method developed by the authors. This method provides a pre-formation with the contrasting divergence method published by G. Hinton (2002) and fine-tuning with common training algorithms known as backpropagation or conjugated gradients. In addition, fine-tuning supervision can be improved with maxout and dropout, two recently developed techniques to improve fine-tuning for deep learning.

The deepnet library is a relatively small, yet quite powerful package with variety of architectures to pick from. This library implements some deep learning architectures and neural network algorithms, including backpropagation, RBM, DBN, deep autoencoder, and so on. Unlike the other libraries we have analyzed, it was specifically written for R. It has several functions, including:

  • nn.train: For training single or multiple hidden layers neural network by BP
  • nn.predict: For predicting new samples by trained neural network
  • dbn.dnn.train: For training a DNN with weights initialized by DBN
  • rbm.train: For training an RBM

The h2o R package has functions for building general linear regression, K-means, Naive Bayes, Principal Component Analysis (PCA), forests, and deep learning (multilayer neuralnet models). h2o is an external package to CRAN and is built using Java, and is available for a variety of platforms. It is an open source math engine for big data that computes parallel distributed machine learning algorithms.

The packages nnet and neuralnet have been widely discussed in the previous chapters. These are two packages for the management of neural networks in R. They are also able to build and train multicore neural networks, so they rely on deep learning.

Keras is an open source neural network library written in Python. Designed to enable fast experimentation with DNNs, it focuses on being minimal, modular, and extensible. The library contains numerous implementations of commonly used neural network building blocks, such as layers, objectives, activation functions, optimizers, and a host of tools to make working with image and text data easier. The code is hosted on GitHub, and community support forums include the GitHub issues page, a Gitter channel, and a Slack channel.

TensorFlow is an open source software library for machine learning. It contains a system for building and training neural networks to detect and decipher patterns and correlations, with methods similar to those adopted by human learning. It is used both for search and for Google production.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset