rnn (software)

{{Short description|Machine Learning framework written in the R language}}

{{lowercase title}}

{{Infobox software

| title = rnn

| name = rnn

| logo =

| logo caption =

| screenshot = Rnn-software-screenshot-2.png

| caption =

| collapsible =

| author = Bastiaan Quast

| developer =

| released = {{Start date|2015|11|30|df=yes}}

| discontinued =

| latest release version = 1.9.0

| latest release date = {{Start date and age|2023|04|22|df=yes}}

| latest preview version = 1.9.0.9000

| latest preview date = {{Start date and age|2023|04|22|df=yes}}

| repo = {{URL|https://github.com/bquast/rnn}}

| programming language = R

| operating system = macOS, Linux, Windows

| platform =

| size = 564.2 kB (v. 1.9.0)

| language =

| language count =

| language footnote =

| genre =

| license = GPL v3

| alexa =

| website = {{URL|https://cran.r-project.org/web/packages/rnn/}}

}}

rnn is an open-source machine learning framework that implements recurrent neural network architectures, such as LSTM and GRU, natively in the R programming language, that has been downloaded over 100,000 times (from the RStudio servers alone).{{Citation|last=Quast|first=Bastiaan|title=GitHub - bquast/rnn: Recurrent Neural Networks in R.|date=2019-08-30|url=https://github.com/bquast/rnn|access-date=2019-09-19}}

The rnn package is distributed through the Comprehensive R Archive Network{{Citation|last1=Quast|first1=Bastiaan|title=rnn: Recurrent Neural Network|date=2019-05-27|url=https://cran.r-project.org/package=rnn|archive-url=https://web.archive.org/web/20200105091006/https://cran.r-project.org/web/packages/rnn/index.html|access-date=2020-01-05|archive-date=2020-01-05|last2=Fichou|first2=Dimitri}} under the open-source GPL v3 license.

Workflow

File:Rnn demonstration.gif

The below example from the rnn documentation show how to train a recurrent neural network to solve the problem of bit-by-bit binary addition.

> # install the rnn package, including the dependency sigmoid

> install.packages('rnn')

> # load the rnn package

> library(rnn)

> # create input data

> X1 = sample(0:127, 10000, replace=TRUE)

> X2 = sample(0:127, 10000, replace=TRUE)

> # create output data

> Y <- X1 + X2

> # convert from decimal to binary notation

> X1 <- int2bin(X1, length=8)

> X2 <- int2bin(X2, length=8)

> Y <- int2bin(Y, length=8)

> # move input data into single tensor

> X <- array( c(X1,X2), dim=c(dim(X1),2) )

> # train the model

> model <- trainr(Y=Y,

+ X=X,

+ learningrate = 1,

+ hidden_dim = 16 )

Trained epoch: 1 - Learning rate: 1

Epoch error: 0.839787019539748

sigmoid

The sigmoid functions and derivatives used in the package were originally included in the package, from version 0.8.0 onwards, these were released in a separate R package sigmoid, with the intention to enable more general use. The sigmoid package is a dependency of the rnn package and therefore automatically installed with it.{{Citation|last=Quast|first=Bastiaan|title=sigmoid: Sigmoid Functions for Machine Learning|date=2018-06-21|url=https://cran.r-project.org/package=sigmoid|archive-url=https://web.archive.org/web/20200105091653/https://cran.r-project.org/web/packages/sigmoid/index.html|access-date=2020-01-05|archive-date=2020-01-05}}

Reception

With the release of version 0.3.0 in April 2016{{Citation|last=Quast|first=Bastiaan|title=RNN: Recurrent Neural Networks in R releases|date=2020-01-03|url=https://github.com/bquast/rnn|access-date=2020-01-05}} the use in production and research environments became more widespread. The package was reviewed several months later on the R blog The Beginner Programmer as "R provides a simple and very user friendly package named rnn for working with recurrent neural networks.",{{Cite web|url=http://firsttimeprogrammer.blogspot.com/2016/08/plain-vanilla-recurrent-neural-networks.html|title=The Beginner Programmer: Plain vanilla recurrent neural networks in R: waves prediction|last=Mic|date=2016-08-05|website=The Beginner Programmer|url-status=live|archive-url=https://web.archive.org/web/20200105085817/http://firsttimeprogrammer.blogspot.com/2016/08/plain-vanilla-recurrent-neural-networks.html|archive-date=2020-01-05|access-date=2020-01-05}} which further increased usage.{{Cite web|url=https://datascience.stackexchange.com/questions/6964/lstm-or-other-rnn-package-for-r|title=LSTM or other RNN package for R|website=Data Science Stack Exchange|access-date=2018-07-05}}

The book [https://www.oreilly.com/library/view/neural-networks-with/9781788397872/ Neural Networks in R] by Balaji Venkateswaran and Giuseppe Ciaburro uses rnn to demonstrate recurrent neural networks to R users.{{Cite news|url=https://www.oreilly.com/library/view/neural-networks-with/9781788397872/9219bb11-a546-4e48-aa5f-689cc720228e.xhtml|title=Neural Networks with R|date=September 2017|access-date=2018-10-02|archive-url=https://web.archive.org/web/20181002130929/https://www.oreilly.com/library/view/neural-networks-with/9781788397872/9219bb11-a546-4e48-aa5f-689cc720228e.xhtml|archive-date=2018-10-02|publisher=O'Reilly|language=en|isbn=9781788397872}}{{Cite book|url=https://books.google.com/books?id=IppGDwAAQBAJ|title=Neural Networks with R: Smart models using CNN, RNN, deep learning, and artificial intelligence principles|last1=Ciaburro|first1=Giuseppe|last2=Venkateswaran|first2=Balaji|date=2017-09-27|publisher=Packt Publishing Ltd|isbn=978-1-78839-941-8|language=en}} It is also used in the r-exercises.com course "Neural network exercises".{{Cite web|url=https://www.r-exercises.com/2017/06/21/neural-networks-exercises-part-3/|title=R-exercises – Neural networks Exercises (Part-3)|last=Touzin|first=Guillaume|date=2017-06-21|website=www.r-exercises.com|url-status=live|archive-url=https://web.archive.org/web/20200105083114/https://www.r-exercises.com/2017/06/21/neural-networks-exercises-part-3/|archive-date=2020-01-05|access-date=2020-01-05}}{{Cite web|url=https://www.r-bloggers.com/neural-networks-exercises-part-3/|title=Neural networks Exercises (Part-3)|last=Touzin|first=Guillaume|date=2017-06-21|website=R-bloggers|language=en-US|url-status=live|archive-url=https://web.archive.org/web/20200105083018/https://www.r-bloggers.com/neural-networks-exercises-part-3/|archive-date=2020-01-05|access-date=2020-01-05}}

The RStudio CRAN mirror download logs

{{cite web|title=RStudio CRAN logs|url=http://cran-logs.rstudio.com/}} show that the package is downloaded on average about 2,000 per month from those servers

,{{cite web|title=CRANlogs rnn package|url=https://cranlogs.r-pkg.org/badges/rnn}} with a total of over 100,000 downloads since the first release,{{cite web|title=CRANlogs rnn package|url=https://cranlogs.r-pkg.org/badges/grand-total/rnn}} according to RDocumentation.org, this puts the package in the 15th percentile of most popular R packages

.{{cite web|title=RDocumentation rnn|url=https://www.rdocumentation.org/packages/rnn}}

References

{{reflist}}