Towards Typesafe Deep Learning in Scala
summary
Nexus is a prototype Scala deep‑learning engine that encodes tensor shapes and axis semantics into types so axes of tensors are typed statically and operations either compile or fail. It uses Shapeless HLists, Scala implicits as compiling-as-proofs, and GADTs to enforce rules like matrix multiplication only when inner axes match and sum‑over‑axis producing a removed axis at compile time. Backend bridges target native C++/CUDA (PyTorch/MXNet/TensorFlow), GPU support is preliminary, automatic batching and GC for device memory are planned, and models can shrink from ~1000 lines to under 20 in examples.
AI-written summary · about
chapters (8)
- 0:00Introduction and motivation
- 5:25Problems with Python deep learning
- 10:20Type-safe tensors in Scala
- 19:37Polymorphic symbolic functions
- 26:52Native CUDA integration plans
- 28:43Dynamic neural architectures
- 31:15Lazy and eager evaluation
- 33:40Q&A
related talks
54mWhy Netflix ❤'s Scala for Machine Learning
34mDifferentiable Functional Programming
32mTowards new deep learning abstractions on top of exist frameworks
23mDeep dive in Nx Backends
40mScala and Spark in the New Deep Learning Era
37mMonadic Deep Learning
31mScoring ONNX ML Models with Scala
24mKeynote: Next-generation frameworks for Large-scale AI
