Going from def to defn
So far in this chapter, you’ve learned about what a tensor is, how to create and manipulate tensors in Nx, and how to model the real world with tensors. This is all great, but you still haven’t learned how to unlock the true power of Nx just yet.
If you’ve been working with Elixir for a while, you’ve probably heard the argument Elixir and the Erlang Virtual Machine aren’t designed for the type of computations required in machine learning and scientific computing. All the examples you’ve seen in this chapter run in pure Elixir without any acceleration. The lack of acceleration is fine for the examples in this chapter, but for the computations required in machine learning, you’ll need acceleration. Enter the magic of
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access