Giter VIP home page Giter VIP logo

inspect's Introduction

Quickstart

  1. First we will create a virtual environment with anaconda.
    If you do not have anaconda installed, please check the installation instructions here.

       $ conda create --name probe_env python=3.8
    
  2. Next we will activate the virtual environment.

       $ conda activate probe_env
    
  3. Once we are done with that, we will clone this github repository and cd into it.

       $ git clone https://github.com/giganticode/inspect.git && cd inspect/
    
  4. Next we will install all the necessary packages in the requirements.txt file

       $ pip3 install -r requirements.txt
    
  5. We will then begin generating input feature vectors from the pre-trained model weights.

       $ CUDA_VISIBLE_DEVICES=0 python3 probe_extractor.py
    
  6. Finally, we will use the pre-trained vectors to make some predictions.

       $ CUDA_VISIBLE_DEVICES=0 python3 probe_classifier.py > results.txt
    

Hurray! You're done! ๐ŸŽ‰
The final task accuracies of each model (layer by layer) will be saved in results.txt file.

NOTE: In steps 5 & 6, we assume that you have access to a gpu with the cuda toolkit installed. If you are using a cpu instead, you can simply run the python scripts without the CUDA_VISIBLE_DEVICES=0 part.


Model Performance by Tasks

Code Length Prediction Generic badge

Code Length Prediction Results

AST Node Tagging Task Generic badge

AST Node Tagging Results

Cyclomatic Complexity Generic badge

Cyclomatic Complexity Results

Invalid Type Prediction Generic badge

Invalid Type Prediction Results

Overall Results via Heatmaps

Heatmaps for all models and tasks


Acknowledgements

This repository uses and is built upon the following works:

License

MIT license

inspect's People

Contributors

anjandash avatar rrobbes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.