Skip to content
0:00 / 0:00

#hasktorch#pytorch#tensors

Gradual tensor typing for practical machine learning in Haskell with Hasktorch

Breandan Considine

370 subscribers • 1 video on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.

Advanced. Deep dive for people who know the field.

1.6K views5 years ago1 recommendation

Programming languagesAI and machine learningHaskellNeural networks and deep learningTraining and serving models

An introduction to Hasktorch's gradually typed API, which allows developers to choose the level of type safety for tensors and neural networks.

Abstract from Torsten: Hasktorch is a library for neural networks and tensor math in Haskell. It is leveraging the C++ backend of PyTorch for fast numerical computation with GPU support. Hasktorch’s goal is to provide a platform for machine learning using typed functional programming. Gradually typed Hasktorch is a new API for tensors and neural networks that interpolates between the already existing unchecked (that is, untyped) and checked (typed) Hasktorch APIs. Thus far, users have to choose whether they want to commit fully to either typed or untyped tensors and models. The new gradually typed API relaxes this black-and-white tradeoff and makes the decision more granular. In gradually typed Hasktorch, users can choose whether or not they want type checking for every individual type variable, like a tensor’s compute device (e.g. the CPU or a GPU), its precision (Bool, Int64, Float, etc.), or its shape (the names and sizes of its dimensions). Thus, users can enjoy the flexibility of an unchecked API for rapid prototyping, while they can also add as much type checking as they want later on. Alternatively, users can start with fully checked tensor and model types and relax them when and where they get in the way. Thus, gradually typed Hasktorch combines the best of both worlds, of checked and of unchecked Hasktorch. The talk will use simple examples to demonstrate the benefits of gradual typing for tensor math and machine learning.

Why it's here

1 person recommends this

What people say. Recommended as an insightful talk on combining Haskell's type system with PyTorch-backed machine learning.

u/n00bombin r/haskell • Recommends

Gradual tensor typing for practical machine learning in Haskell with Hasktorch