zysszy / grammarcnn Goto Github PK
View Code? Open in Web Editor NEWA CNN model for code generation.
License: MIT License
A CNN model for code generation.
License: MIT License
I have run python3 run.py train ...
, and when I run python3 run.py pre
, it's slow to generate codes for a card.
It takes about 5-10 minutes for a card.
work begin
search level is 0
..... many times
1th card is finished
Is it normal? I'm assuming that if this can apply to real world applications, it should take less than 3 seconds.
Is it possible to make it faster?
单词和数字之间有什么特殊的关系吗?还是说就只是依次赋值的呀?
I encounter the following error while training the a model using
python3 run.py train [dev|test] [tree|var|func]
(py37) lab@master:~/GrammarCNN/model$ python3 run.py train [dev|test] [tree|var|func]
func]: command not found
Command 'test]' not found, did you mean:
command 'test' from deb coreutils (8.30-3ubuntu2)
command 'testr' from deb python3-testrepository (0.0.20-5)
Try: sudo apt install
Command 'var' not found, but there are 19 similar ones.
/home/lab/anaconda3/envs/py37/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/lab/anaconda3/envs/py37/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/lab/anaconda3/envs/py37/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/lab/anaconda3/envs/py37/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/lab/anaconda3/envs/py37/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/lab/anaconda3/envs/py37/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "run.py", line 215, in
main()
File "run.py", line 195, in main
os.system("tar -zxvf data" + sys.argv[3] + ".tar.gz")
IndexError: list index out of range
Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
Can you please suggest how I should debug the error.
Thank you
你好,请问训练中的rule.txt是怎么得到的呢?Java和python语言分别怎么处理的?
在论文里看到CNN for the Input那里有提到
For code generation of a card in HearthStone, the input is semi-structured data, contain- ing the card’s name, properties, and descriptions, illustrated in Figure 4a.
这里是token化后直接将他们拼接起来然后输入模型的么?
我看见里面有jar 包 ,python代码转ast是java转的? 用了什么程序
请问您是在什么硬件配置下训练该模型的,训练模型大概花了多长时间,谢谢!
all I need to do is:
python3 run.py train test tree
python3 run.py train test var
python3 run.py train test func
python3 run.py test
or instead:
I need to python run.py 3*3=9 times?
I am surprised about the format of your input data which divide in a tree structure.
SO may you provide your code about how to preprocess the data?
I believe it is the most exquisite part in your work, others could draw on the experience of it.
同上
I have another question:
I find that in your code_generate_model.py
the tree-based CNN, tree-path CNN, pre-order CNN all call the same function def my_conv()
in line 119-128?
so what's the difference? (except the input data)
Hello Dear Author,
This is a good implementation! Nowadays, there're not so many program generation works that make their codes open-sourced. At the same time, I see there are several AST-based baselines used in your publication, but I didn't find their official resources. It would be better if could play with some of them (Seq2Tree, SNM, and ASN) together with your GrammarCNN. Could I ask which Github resources (official or unofficial) for these AST-based baseline models are you used?
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.