Quibble will use neural networks to learn code formatting style, using a rigorous parsing / pretty printing layer to ensure the NN doesn't change the AST meaning.
-
Install Torch Make sure to install torch following the instructions from torch.ch, not from someplace else. The installer scripts should work. If you want GPU support, make sure to install CUDA beforehand, and make sure the torch installer picks it up.
-
Follow the rest of the char-rnn install instructions
-
For the Haskell side, do
# Put quibble in the same directory as char-rnn git clone git@github.com:eddysystems/quibble.git # Run one of sudo apt-get install ghc cabal-install brew install ghc cabal-install # Build quibble cd quibble cabal update cabal install happy alex cabal install --only-dependencies cabal configure cabal build # Run ln -s dist/build/quibble/quibble ./quibble -m <model> <javascript>
If there is a checkpoint file, run (in the char-rnn directory)
th sample.lua checkpoint-file -temperature 0.6 -gpuid -1 > output.jsThe temperature can usefully be between 0 and 1. If the checkpoint file has been computed on a GPU, it has to be sampled on a GPU (-gpuid >= 0). Pass in a seed with -primetext "...".
Use the instructions for char-rnn for training, except: You can restart training from a checkpoint using -checkpoint.