Skip to content

omaclaren/hasktorch

 
 

Repository files navigation

hasktorch

Build Status

Hasktorch is a library-in-development for tensors and neural networks in Haskell. It is an independent open source community project which leverages the core C libraries shared by Torch and PyTorch.

This project is in early development and should only be used by contributing developers. Expect substantial changes to the library API as it evolves. Contributions and PRs are welcome (see details below).

Project Organization

Directory Description
codegen/ Code generation to produce low-level raw Haskell bindings. Also includes experimental aten cwrap file parsing.
core/ Memory-managed tensors and core data types that wrap raw C bindings to TH.
examples/ Examples of basic usage and experimental prototypes
output/ Staging directory for codegen/ output, contents should not be under source control.
raw/ Comprehensive raw bindings to C TorcH (TH) operations.
vendor/ 3rd party dependencies as git submodules (links to TH C and other libraries)

Build Instructions

Currently hasktorch only supports OSX and Linux builds. Building Hasktorch requires retrieving and building C++ torch dependencies as submodules followed by building with the Stack tool. These steps are done automatically using the Makefile:

make init

For manual steps to build the project, see the developer guide for instructions and the vendor/ README for details on external dependencies.

Getting started

For an example of basic end-user API usage, see the example on statically typed tensor usage and the simple gradient descent example.

For details on implementation and usage of raw C bindings and the core library, refer to their respective README documentation in raw/ and core/ package directories. Additional examples can be found in examples/ as well as the test modules.

Contributing

We welcome new contributors. For a rough list of outstanding items on deck (there are many places to contribute), refer to:

https://github.com/austinvhuang/hasktorch/projects/1

Contact Austin Huang for access to the private hasktorch slack channel at:

https://hasktorch.slack.com

Thanks to all hasktorch developers who have contributed to this community effort so far. This project is also indebted to prior work on typed functional programming for deep learning by Justin Le, Huw Campbell, and Kaixi Ruan, as well as to the Torch and PyTorch frameworks.

About

Tensors and neural networks in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 99.6%
  • Other 0.4%