Skip to content

Instantly share code, notes, and snippets.

@szagoruyko
Last active December 15, 2016 04:47
Show Gist options
  • Save szagoruyko/45472e83421eb42bce64 to your computer and use it in GitHub Desktop.
Save szagoruyko/45472e83421eb42bce64 to your computer and use it in GitHub Desktop.

Using Torch in Atom

Install Atom from https://atom.io or with brew cask install atom

Then install packages (example apm install hydrogen, apm is a package manager for atom):

  • hydrogen
  • autocomplete-paths
  • language-lua
  • vim-mode
  • script
  • language-ipynb

Emacs is supported as well, but I use vim, even though it's not fully supported it is much more handy than using itorch.

Assuming itorch is installed already. I had to do pip install jupyter on a recent install on mac.

Ready to use! start atom from command line, otherwise hydrogen won't work.

Demo

require 'itorch'
itorch.lena()

Lena should pop up right there in atom.

It runs qlua inside so all image.display(image.lena()) works just as in usual terminal. The only unsupported feature from itorch is bokeh plotting, I have to save html and open in a separate window. It is possible to select and run a piece of code and put watches as in Matlab.

It communicates with interpreter so code completion works not just for lua but for torch., nn., image. or any other loaded packages.

@taineleau-zz
Copy link

I have the same question. Does it support auto-completion of packages (such as nn) other than the standard library (math)?
Could you please help me? +1

I think the auto-completion feature is crucial to those who also use Torch in their research. :)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment