OCaml bindings for PyTorch, providing NumPy-like tensor computations with GPU acceleration and automatic differentiation.
ocaml-torch is a set of OCaml bindings for PyTorch that provides tensor computations with GPU acceleration and automatic differentiation. It enables OCaml developers to perform NumPy-like operations and build neural networks using PyTorch's underlying C++ API. The project brings deep learning capabilities to the OCaml ecosystem while maintaining functional programming paradigms.
OCaml developers and researchers who want to use PyTorch's machine learning capabilities within OCaml projects, particularly those interested in functional programming approaches to deep learning.
Developers choose ocaml-torch because it provides idiomatic OCaml access to PyTorch's full feature set, including GPU acceleration and pre-trained models, without requiring Python. It enables building type-safe, functional neural networks while leveraging PyTorch's performance and ecosystem.
OCaml bindings for PyTorch
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Utilizes PyTorch's CUDA backend for high-performance tensor computations, with explicit instructions for downloading CUDA-enabled libtorch in the alternative installation section.
Includes downloadable weights and implementations for popular computer vision models like ResNet and DenseNet, demonstrated in the predict.exe example for easy inference.
Integrates with utop and ocaml-jupyter for exploratory programming, as shown in the utop screenshot and examples, enabling a functional REPL experience.
Provides tape-based autograd for building neural networks, allowing OCaml-style training loops with manual gradient updates, as illustrated in the MNIST tutorial code.
The README warns that development has moved to janestreet/torch, making this repository potentially outdated with limited future updates or bug fixes.
Requires manual download of specific libtorch versions with CXX11 ABI on Linux and environment variable configuration, adding significant setup overhead compared to Python's pip install.
Has fewer models, tutorials, and community resources than Python PyTorch, relying heavily on example-based learning with sparse high-level guidance.