tech-srl / code2vec

TensorFlow code for the neural network presented in the paper: "code2vec: Learning Distributed Representations of Code"
https://code2vec.org
MIT License
1.1k stars 286 forks source link

Converting Vector back to Contexts #163

Closed colebuckleyy closed 2 years ago

colebuckleyy commented 2 years ago

I'm wondering if its somehow possible to convert a code vector back into its text format in contexts, is this possible?

urialon commented 2 years ago

Unfortunately no :-)

The closest thing I can think about is encoding the entire training set, and saving a database of <example,vector> pairs.

Then at test time, you can encode the test example, and using the test code vector - look for the nearest neighbor training vector from the database.

colebuckleyy commented 2 years ago

Ok, thank you