This MathematicaVsR at GitHub project is for the comparison of the Deep Learning functionalities in R/RStudio and Mathematica/Wolfram Language (WL).
The project is aimed to mirror and aid the talk
"Deep Learning series (session 2)"
of the meetup
Orlando Machine Learning and Data Science.
The focus of the talk is R and Keras, so the project structure is strongly influenced by the content
of the book Deep learning with R,
the corresponding Rmd notebooks, .
Some of Mathematica's notebooks repeat the material in .
Some are original versions.
WL's Neural Nets framework and abilities are fairly well described in the
"Neural Networks in the Wolfram Language overview", ,
and the webinar talks .
The corresponding documentation pages
 (R) and
can be used for a very fruitful comparison of features and abilities.
Remark: With "deep learning with R" here we mean "Keras with R".
Remark: An alternative to R/Keras and Mathematica/MXNet is the library
H2O (that has interfaces to Java, Python, R, Scala.) See project's directory
Mind map for the presentation.
(Has life hyperlinks.)
"Neural network layers primer" slideshow.
The slideshow is part of Sebastian Bodenstein's presentation at Wolfram U. (It was separated/extracted for clarity and convenience during the meetup presentation.)
Recording of the presentation at YouTube: ORLMLDS Deep learning series (2): "Using Keras with R (... and MXNet with WL)".
"Classification of handwritten digits by matrix factorization"
(used in the presentation.)
Deep learning can be used for both supervised and unsupervised learning.
In this project we concentrate on supervised learning.
The following diagram outlines the general, simple classification workflow we have in mind.
Here is a corresponding classification [monadic pipeline](https://en.wikipedia.org/wiki/Monad_(functional_programming))
R-Keras uses monadic pipelines through the library magrittr.
model <- keras_model_sequential()
layer_dense(units = 256, activation = 'relu', input_shape = c(784)) %>%
layer_dropout(rate = 0.4) %>%
layer_dense(units = 128, activation = 'relu') %>%
layer_dropout(rate = 0.3) %>%
layer_dense(units = 10, activation = 'softmax')
The corresponding Mathematica command is:
LinearLayer[256, "Input" -> 784],
The neural networks framework comes with Mathematica. (No additional installation required.)
Pretty straightforward using the directions in . (A short list.)
Some additional Python installation is required.
(Those are links to notebooks in .)
The Mathematica encoders (for neural networks and generally for machine learning tasks) are very well designed
and with a very advanced development.
The encoders in R-Keras are fairly useful but not was advanced as those in Mathematica.
[TBD: Encoder correspondence...]
Wolfram Research repository of neural networks;
can import externally trained networks in
R-Keras: has commands loading for pre-trained models, .
Mathematica: "Neural Networks guide".
R-Keras: "Keras reference",
 F. Chollet, J. J. Allaire, Deep learning with R, (2018).
 J. J. Allaire, Deep Learing with R notebooks, (2018), GitHub.
 RStudio, Keras reference.
 Wolfram Research, "Neural Networks in the Wolfram Language overview".
 Wolfram Research, "Machine Learning Webinar Series".
 Wolfram Research, "Neural Networks guide".
I would like to know why you are comparing these two environments? I think your info is great with some nice links to good material.
Are you evaluating the strengths and weaknesses of both platforms? Or do you just need to work with both for your work and it just is nice to document the differences. Just curious :)
Thanks for your comment!
I volunteered and committed to give a talk about using Deep learning in R through Keras for the Orlando Data Science and Machine Learning Meetup. The people in that group mostly use Python, but R/Keras was considered interesting enough.
While working on the presentation it became apparent that it is much easier to visualize and illustrate the "deep learning as a LEGO set" perspective using Mathematica / WL. (Also, the partitioning of the operations/layers is made in a slightly different way.)
Another thing is that with Mathematica I can much easier illustrate and visualize some analogies to "shallow" non-neural network algorithms.
Since the presentation was going to be relatively short compared to the material I wanted to cover, I decided to start a GitHub project that provides a systematic exposition of the considered functionalities and applications. At that point making a Mathematica-vs-R project made lots of sense. Obviously, comparing the two systems is a good way to learn about neural networks.
After my presentation fair amount of the attendees were interested in Mathematica. I did tell to the group that if they a serious about figuring out and mastering Deep learning they should get hold of Mathematica.
(As for my work I have experimented applying Deep learning with H2O through R for quite some time... And yes I at this point I also use Keras and MXNet.)