mtensor / neural_sketch Goto Github PK
View Code? Open in Web Editor NEWneural sketch project, currently in generative regex, list transformation (deepcoder), and text editing (robustfill) domains
neural sketch project, currently in generative regex, list transformation (deepcoder), and text editing (robustfill) domains
Is there some code to generate a basegrammar.p file? There is a comment FixThis near the basegrammar variable. Can you help me with this?
And why did you hard code the vocabulary in the algolispPrimitives.py file? Any specific reason? If I change that section of the code to read from the word.vocab file, what all sections do I need to change.
I pretrained the skech generator and dc synthesizer following the instructions with no problem, but got an error when trying evaluate the full model using python eval/evaluate_deepcoder.py
.
More specifically I got EOFError: Ran out of input
, with more details shown below. I'm using conda environment, and 1 strange thing is it says `No module named 'numpy' despite I have numpy installed in my environment.
Could you please let me know how I can make it run? I'm trying to experiment with this as a research project. Any help would be much appreciated! Thanks a lot!
$ python eval/evaluate_deepcoder.py
loading model with holes
data file: data/T3_test_data_new.p
/home/yliang/miniconda3/envs/sketch/lib/python3.7/site-packages/torch/nn/functional.py:1374: UserWarning: nn.functiona
l.tanh is deprecated. Use torch.tanh instead.
warnings.warn("nn.functional.tanh is deprecated. Use torch.tanh instead.")
25
[(lambda (lambda (COUNT isODD (DROP $1 (MAP SHR $0))))), (lambda (lambda (COUNT isODD (ZIPWITH MIN (DROP $1 $0) $0)))), (lambda (lambda (COUNT isPOS (ZIPWITH MAX (DROP $1 $0) <HOLE>)))), (lambda (lambda (COUNT isODD (DROP <HOLE> (MAP SHR $0))))), (lambda (lambda (COUNT isEVEN (MAP DIV3 (DROP $1 $0))))), (lambda (lambda (COUNT <HOLE> (MAP SHR (DROP $1 $0))))), (lambda (lambda (COUNT isODD (TAKE $1 (MAP SHR $0))))), (lambda (lambda (COUNT isODD (DROP $1 (FILTER isPOS $0))))), (lambda (lambda (COUNT isODD (FILTER isNEG (DROP $1 $0))))), (lambda (lambda (COUNT isEVEN (ZIPWITH MAX (DROP $1 $0) $0)))), (lambda (lambda (COUNT isEVEN (ZIPWITH MIN (DROP $1 $0) $0)))), (lambda (lambda (COUNT isODD (MAP SHR (DROP $1 $0))))), (lambda (lambda (COUNT isODD (DROP $1 (MAP DIV3 $0))))), (lambda (lambda (COUNT isPOS (DROP $1 (REVERSE $0))))), (lambda (lambda (COUNT <HOLE> (DROP $1 (FILTER isPOS $0))))), (lambda (lambda (COUNT isODD (SCANL1 MIN (DROP $1 $0))))), (lambda (lambda (COUNT isODD (ZIPWITH MIN $0 (DROP $1 $0))))), (lambda (lambda (COUNT isEVEN (MAP SHR (DROP $1 $0))))), (lambda (lambda (COUNT isODD (ZIPWITH MAX (DROP $1 $0) $0)))), (lambda (lambda (COUNT isNEG (DROP $1 (FILTER isEVEN $0))))), (lambda (lambda (COUNT isPOS (FILTER isODD (DROP $1 $0))))), (lambda (lambda (COUNT isPOS (DROP $1 (FILTER isODD $0))))), (lambda (lambda (COUNT isPOS (ZIPWITH MIN (DROP $1 $0) $0)))), (lambda (lambda (COUNT isODD (MAP DIV3 (DROP $1 $0))))), (lambda (lambda (COUNT isEVEN (DROP $1 (MAP SHR $0)))))]
Traceback (most recent call last):
File "compiledDriver.py", line 17, in <module>
request = pickle.load(sys.stdin.buffer)
File "/home/yliang/miniconda3/envs/sketch/lib-python/3/pickle.py", line 1571, in _load
encoding=encoding, errors=errors).load()
File "/home/yliang/miniconda3/envs/sketch/lib-python/3/pickle.py", line 1070, in load
dispatch[key[0]](self)
File "/home/yliang/miniconda3/envs/sketch/lib-python/3/pickle.py", line 1358, in load_global
klass = self.find_class(module, name)
File "/home/yliang/miniconda3/envs/sketch/lib-python/3/pickle.py", line 1408, in find_class
__import__(module, level=0)
ModuleNotFoundError: No module named 'numpy'
Traceback (most recent call last):
Traceback (most recent call last):
File "eval/evaluate_deepcoder.py", line 195, in <module>
results = evaluate_dataset(model, dataset, nSamples, mdl, max_to_check, dcModel=dcModel)
File "eval/evaluate_deepcoder.py", line 137, in evaluate_dataset
return {datum: list(evaluate_datum(i, datum, model, dcModel, nRepeats, mdl, max_to_check)) for i, datum in enumerate(dataset)}
File "eval/evaluate_deepcoder.py", line 137, in <dictcomp>
return {datum: list(evaluate_datum(i, datum, model, dcModel, nRepeats, mdl, max_to_check)) for i, datum in enumerate(dataset)}
File "eval/evaluate_deepcoder.py", line 123, in evaluate_datum
enum_results, n_checked, n_hit = pypy_enumerate(untorch(g), datum.tp, datum.IO, mdl, sketchtups, n_checked, n_hit, t, max_to_check)
File "/home/yliang/neural_sketch/util/pypy_util.py", line 50, in pypy_enumerate
return callCompiled(dc_enumerate, tp, IO, mdl, sketchtups, n_checked, n_hit, t, max_to_check)
File "/home/yliang/neural_sketch/ec/utilities.py", line 325, in callCompiled
success, result = pickle.load(p.stdout)
EOFError: Ran out of input
Hi, I tried to run the program, but encoutered problem in loading data data/DeepCoder_data/T2_A2_V512_L10_train.txt
.
I downloaded deepcoder data from their github and the data format is T=2_train.json
. May I know how can I transform it to the correct format?
Thank you.
Hi,
Thank you for your fantastic work.
Can you please provide the pre-trained model for AlgoLisp Dataset
I have a few more queries:
Can you clear these doubts?
I ran the algolisp DC model with the algolisp dataset. It was running smoothly.
I tried running the algolisp DC model code with a new dataset. I took care of the format, file extension, etc. The following error occurred:
KeyError in symbolToIndex for the key 'Once'. I checked the word and it was present in word.vocab in the data/generated folder.
'Once' is the first word of the first instance in the training set. The training and dev data were loaded.
Could you help me in resolving this error?
There is no package by the name of algolispPrimitives and there is no class within the code. Could you help me with this?
For grammar, there is a package of the same name. Have you used that one or something else?
I am having trouble getting started with this project. Do I need to have Anaconda installed to run this?
What version of python do I need?
I just keep running into various dependency issues and I am not sure where to start
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.