All Projects → lab-ml → Python_autocomplete

lab-ml / Python_autocomplete

Licence: mit
Use Transformers and LSTMs to learn Python source code

Projects that are alternatives of or similar to Python autocomplete

Practical Deep Learning Book
Official code repo for the O'Reilly Book - Practical Deep Learning for Cloud, Mobile & Edge
Stars: ✭ 441 (+258.54%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Kalasalingam
IEEE "Invited Talk on Deep Learning" 03/02/2018
Stars: ✭ 13 (-89.43%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Deep Learning With Pytorch Chinese
本仓库将PyTorch官方书籍《Deep learning with PyTorch》(基本摘录版)翻译成中文版并给出可运行的相关代码。
Stars: ✭ 517 (+320.33%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Adaptnlp
An easy to use Natural Language Processing library and framework for predicting, training, fine-tuning, and serving up state-of-the-art NLP models.
Stars: ✭ 278 (+126.02%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Bitcoin Price Prediction Using Lstm
Bitcoin price Prediction ( Time Series ) using LSTM Recurrent neural network
Stars: ✭ 67 (-45.53%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Pytorch Tutorials Examples And Books
PyTorch1.x tutorials, examples and some books I found 【不定期更新】整理的PyTorch 1.x 最新版教程、例子和书籍
Stars: ✭ 346 (+181.3%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Ilearndeeplearning.py
This repository contains small projects related to Neural Networks and Deep Learning in general. Subjects are closely linekd with articles I publish on Medium. I encourage you both to read as well as to check how the code works in the action.
Stars: ✭ 896 (+628.46%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Machine Learning Notebooks
Machine Learning notebooks for refreshing concepts.
Stars: ✭ 222 (+80.49%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Sru Deeplearning Workshop
دوره 12 ساعته یادگیری عمیق با چارچوب Keras
Stars: ✭ 66 (-46.34%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Relativistic Average Gan Keras
The implementation of Relativistic average GAN with Keras
Stars: ✭ 36 (-70.73%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Dlpython course
Примеры для курса "Программирование глубоких нейронных сетей на Python"
Stars: ✭ 266 (+116.26%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Deeplearning tutorials
The deeplearning algorithms implemented by tensorflow
Stars: ✭ 1,580 (+1184.55%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Deeplearning.ai Notes
These are my notes which I prepared during deep learning specialization taught by AI guru Andrew NG. I have used diagrams and code snippets from the code whenever needed but following The Honor Code.
Stars: ✭ 262 (+113.01%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Trainyourownyolo
Train a state-of-the-art yolov3 object detector from scratch!
Stars: ✭ 399 (+224.39%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Nn
🧑‍🏫 50! Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠
Stars: ✭ 5,720 (+4550.41%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Stock Analysis Engine
Backtest 1000s of minute-by-minute trading algorithms for training AI with automated pricing data from: IEX, Tradier and FinViz. Datasets and trading performance automatically published to S3 for building AI training datasets for teaching DNNs how to trade. Runs on Kubernetes and docker-compose. >150 million trading history rows generated from +5000 algorithms. Heads up: Yahoo's Finance API was disabled on 2019-01-03 https://developer.yahoo.com/yql/
Stars: ✭ 605 (+391.87%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Dive Into Dl Pytorch
本项目将《动手学深度学习》(Dive into Deep Learning)原书中的MXNet实现改为PyTorch实现。
Stars: ✭ 14,234 (+11472.36%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Gluon Api
A clear, concise, simple yet powerful and efficient API for deep learning.
Stars: ✭ 2,322 (+1787.8%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
Deep Learning Experiments
Notes and experiments to understand deep learning concepts
Stars: ✭ 883 (+617.89%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial
My Journey In The Data Science World
📢 Ready to learn or review your knowledge!
Stars: ✭ 1,175 (+855.28%)
Mutual labels:  jupyter-notebook, deep-learning-tutorial

PyPI - Python Version PyPI Status Join Slack Twitter

Python Autocomplete

The full length Python autocompletion Video and a Twitter thread describing how it works

This is a learning/demo project to show how deep learning can be used to auto complete Python code. You can experiment with LSTM and Transformer models. We also have built a simple VSCode extension to try out the trained models.

Training model: Open In Colab

Evaluating trained model: Open In Colab

It gives quite decent results by saving above 30% key strokes in most files, and close to 50% in some. We calculated key strokes saved by making a single (best) prediction and selecting it with a single key.

The dataset we use is the python code found in repos linked in Awesome-pytorch-list. We download all the repositories as zip files, extract them, remove non python files and split them randomly to build training and validation datasets.

We train a character level model without any tokenization of the source code, since it's the simplest.

Try it yourself

  1. Clone this repo
  2. Install requirements from requirements.txt
  3. Run python_autocomplete/create_dataset.py.
    • It collects repos mentioned in PyTorch awesome list
    • Downloads the zip files of the repos
    • Extract the zips
    • Remove non python files
    • Collect all python code to data/train.py and, data/eval.py
  4. Run python_autocomplete/train.py to train the model. Try changing hyper-parameters like model dimensions and number of layers.
  5. Run evaluate.py to evaluate the model.

You can also run the training notebook on Google Colab.

Open In Colab

VSCode extension

  1. Clone this repo

  2. Install requirements from requirements.txt

  3. Install npm packages

You need to have Node.JS installed

cd vscode_extension
npm install # This will install the NPM packages
  1. Start the server python_autocomplete/serve.py

  2. Open the extension project (folder) in VSCode

cd vscode_extension
code . # This will open vscode_extension in VSCode

If you don't have VSCode command line launcher start VSCode and open the project with File > Open

  1. Run the extension from VSCode
Run > Start Debugging

This will open another VSCode editor window, with the extension

  1. Create or open a python file and start editing!

Sample

Here's a sample evaluation of a trained transformer model.

Colors:

  • yellow: the token predicted is wrong and the user needs to type that character.
  • blue: the token predicted is correct and the user selects it with a special key press, such as TAB or ENTER.
  • green: autocompleted characters based on the prediction

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].