Nx is a library for building numerical computing applications, the so-called STEM applications, in Elixir. Rather than using basic Elixir numeric datatypes and lists, Nx uses tightly integrated pluggable backends to implement support for efficient types and structures. The result is a seamless and smooth experience.
The Nx project already has an impressive list of smaller projects underway. The LiveBook takes advantage of Phoenix LiveView and Nx to provide a place to collaboratively share research projects with data, code, and prose. The EXLA project provides support for Google’s excelerated linear algebra within a LiveBook. Compiler support and backends provide tight integration to efficient STEM libraries in other langauges.
Nx has been around a short time. In 2020, Sean Moriarity was working on Genetic Algorithms in Elixir. He was using several techniques to do ad-hoc machine learning in Elixir. José Valim, creator of Elixir, connected with him in late 2020 to explore building a robust library for numerical computation. Together, they built the core of Nx and Axon. The project has rapidly made progress with the introduction of LiveBook, and the number of contributors has steadily grown, but the project is still in its infancy.
Over the course of this module, you’ll learn the core abstractions of Nx. Rather than drilling you on the various internal functions that make up the Nx API, you’ll learn the basic core abstractions for working with tensors on backends in Nx, share your work with live plots in a LiveBook, and use those concepts in the context of the Axon machine learning library.
When you’re done, you’ll be able to:
Create, manipulate, shape, and name multi-dimensional data in tensors.
Work with Nx using alternative backends.
Write your own tensor-aware custom code with numeric definitions, and use transformations to broadcast to tensors so that you can tell if two tensors are compatible.
Work with plots within a LiveBook, and use those plots to communicate your results to others.
Build, train, and save Axon models to solve your own machine learning problems.
Understand new Axon models as they emerge.