Skip to content
MLG 010 Languages & Frameworks episode artwork

Mar 7, 2017 44 min

MLG 010 Languages & Frameworks

from Machine Learning Guide

The best language and framework for machine learning are Python and PyTorch, because Python's libraries replace C++, R, MATLAB and the JVM. Also covers Hadoop vs Spark, TensorFlow, JAX and Keras, retired frameworks, and NVIDIA GPUs. Links Notes and resources at ocdevel.com/mlg/10 Join the free MLG group: listen to my other AI shows, ask me questions, and talk with other listeners Best language and framework for machine learning Python and PyTorch. Python is the language of machine learning, and PyTorch is the default deep learning framework for research and most new work. TensorFlow still ships releases, but Google's own new research has largely moved to JAX. Do you need C or C++ for machine learning? Only if you already know them or write low-level performance code. The heavy math runs on the GPU through NVIDIA's CUDA (a C++ dialect) or similar, and the frameworks' own C++ and CUDA code does that work while you write Python. R vs MATLAB vs Octave vs Julia R: the host's pick of the four, strong in statistics, academia and data analytics. Python leads machine learning. MATLAB: commercial, common in engineering and academia. Octave is its free counterpart. Andrew Ng's original Coursera course taught in Octave; its replacement, the Machine Learning Specialization (2022), teaches in Python. Julia: used in scientific computing, still niche in machine learning. Hadoop vs Spark Data science spans data mining, data analytics and machine learning (MLG 002), and big-data mining runs on distributed pipelines on the JVM, in Java or Scala. Hadoop MapReduce is the older, disk-based batch system. Spark works in memory, on YARN, Kubernetes or a managed service like Databricks or EMR, with Java, Scala, Python and SQL APIs; most Spark work is now PySpark and SQL, and its machine learning library is MLlib. Spark or a cloud data warehouse is the choice for a new pipeline (MLA 021 covers Databricks). Data that fits on one machine needs no pipeline. Why Python for machine learning? Python is slow, but its libraries cover every job: NumPy replaces MATLAB: arrays, slicing, linear algebra (MLA 005). pandas replaces most of R for analytics (MLA 002); Polars is a faster alternative. PySpark replaces the JVM for pipelines. scikit-learn covers shallow learning: linear and logistic regression, support vector machines, naive Bayes. Deep learning frameworks (MLG 009) replace C++ for GPU speed. How deep learning frameworks run Python on the GPU You define the model in Python, and the framework runs each operation as precompiled C++ and CUDA kernels. Theano and TensorFlow 1.x first built a computational graph: Theano compiled the graph into C and CUDA code; TensorFlow 1.x handed it to a C++ runtime. PyTorch and TensorFlow 2 run eagerly, one operation at a time, and compile on request: torch.compile (PyTorch 2.0, 2023) generates Triton kernels, and the XLA compiler serves JAX and TensorFlow. PyTorch vs TensorFlow vs JAX PyTorch: from Facebook (now Meta) in 2017, the Python successor to Lua Torch. TensorFlow: Google's, from 2015. JAX: Google's NumPy-style library with automatic differentiation, compiled for GPUs and TPUs. Keras 3 (2023) is a high-level API over JAX, TensorFlow or PyTorch. All handle convolutional networks (MLG 025), recurrent networks and reinforcement learning (MLG 029). What happened to Theano, Caffe, CNTK and MXNet? All retired. Theano, from Yoshua Bengio's lab in Montreal, stopped development in 2017. Caffe, a C++ framework with Python and MATLAB interfaces, had its last release in 2017, and Caffe2 merged into PyTorch. Microsoft's CNTK ended in 2019 and Apache MXNet in 2023. Best GPU for deep learning NVIDIA, through CUDA (Compute Unified Device Architecture) and its cuDNN library for neural networks. PyTorch also supports AMD's ROCm and Apple Silicon. AWS rents NVIDIA's H100 and H200 as P5 instances and the B200 and B300 as P6. MLG 024 revisits the tech stack. How to learn Python and PyTorch Python: Python Crash Course by Eric Matthes, or another Python pick in the resources. The framework: the free, regularly updated PyTorch Tutorials, or another PyTorch pick in the same section. For TensorFlow, its TensorFlow Tutorials. Language and framework comparisons, 2016–2017 Jason Brownlee's Best Programming Language for Machine Learning Bob Muenchen's Data Science Job Report 2017 Madison May's (indico) An Overview of Python Deep Learning Frameworks Kenneth Tran's Evaluation of Deep Learning Toolkits Next: MLG 012, on shallow learning algorithms.

Episode details come from the podcast's RSS feed.

Embed this episode

Ready to play

MLG 010 Languages & Frameworks

0:00 44:36

No transcript yet.

Requests help us decide what to transcribe next.

Frequently asked questions

How long is this episode of Machine Learning Guide?

This episode is 44 minutes long.

When was this Machine Learning Guide episode published?

This episode was published on March 7, 2017.

Can I download this Machine Learning Guide episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.