README.md in torch-rb-0.1.8 vs README.md in torch-rb-0.2.0
- old
+ new
@@ -1,13 +1,11 @@
-# Torch-rb
+# Torch.rb
:fire: Deep learning for Ruby, powered by [LibTorch](https://pytorch.org)
-This gem is currently experimental. There may be breaking changes between each release. Please report any issues you experience.
+[![Build Status](https://travis-ci.org/ankane/torch.rb.svg?branch=master)](https://travis-ci.org/ankane/torch.rb)
-[![Build Status](https://travis-ci.org/ankane/torch-rb.svg?branch=master)](https://travis-ci.org/ankane/torch-rb)
-
## Installation
First, [install LibTorch](#libtorch-installation). For Homebrew, use:
```sh
@@ -28,12 +26,10 @@
- Methods that perform in-place modifications end with `!` instead of `_` (`add!` instead of `add_`)
- Methods that return booleans use `?` instead of `is_` (`tensor?` instead of `is_tensor`)
- Numo is used instead of NumPy (`x.numo` instead of `x.numpy()`)
-Some methods and options are missing at the moment. PRs welcome!
-
## Tutorial
Some examples below are from [Deep Learning with PyTorch: A 60 Minutes Blitz](https://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html)
### Tensors
@@ -377,20 +373,48 @@
```sh
bundle config build.torch-rb --with-torch-dir=/path/to/libtorch
```
+Here’s the list of compatible versions.
+
+Torch.rb | LibTorch
+--- | ---
+0.2.0 | 1.5.0
+0.1.8 | 1.4.0
+0.1.0-0.1.7 | 1.3.1
+
### Homebrew
For Mac, you can use Homebrew.
```sh
brew install libtorch
```
Then install the gem (no need for `bundle config`).
+## Performance
+
+### Linux
+
+Deep learning is significantly faster on GPUs.
+
+Install [CUDA](https://developer.nvidia.com/cuda-downloads) and [cuDNN](https://developer.nvidia.com/cudnn) and reinstall the gem.
+
+Check if CUDA is available
+
+```ruby
+Torch::CUDA.available?
+```
+
+Move a neural network to a GPU
+
+```ruby
+net.to("cuda")
+```
+
## rbenv
This library uses [Rice](https://github.com/jasonroelofs/rice) to interface with LibTorch. Rice and earlier versions of rbenv don’t play nicely together. If you encounter an error during installation, upgrade ruby-build and reinstall your Ruby version.
```sh
@@ -398,25 +422,25 @@
rbenv install [version]
```
## History
-View the [changelog](https://github.com/ankane/torch-rb/blob/master/CHANGELOG.md)
+View the [changelog](https://github.com/ankane/torch.rb/blob/master/CHANGELOG.md)
## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
-- [Report bugs](https://github.com/ankane/torch-rb/issues)
-- Fix bugs and [submit pull requests](https://github.com/ankane/torch-rb/pulls)
+- [Report bugs](https://github.com/ankane/torch.rb/issues)
+- Fix bugs and [submit pull requests](https://github.com/ankane/torch.rb/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
```sh
-git clone https://github.com/ankane/torch-rb.git
-cd torch-rb
+git clone https://github.com/ankane/torch.rb.git
+cd torch.rb
bundle install
bundle exec rake compile -- --with-torch-dir=/path/to/libtorch
bundle exec rake test
```