mast-group / convolutional-attention Goto Github PK
View Code? Open in Web Editor NEWRepository for the code of the "A Convolutional Attention Network for Extreme Summarization of Source Code" paper
License: BSD 3-Clause "New" or "Revised" License
Repository for the code of the "A Convolutional Attention Network for Extreme Summarization of Source Code" paper
License: BSD 3-Clause "New" or "Revised" License
OS: Ubuntu
command: python copy_conv_rec_learner.py model 10 128 test_result
File "copy_conv_rec_learner.py", line 11, in <module>
from experimenter import ExperimentLogger
ImportError: No module named experimenter
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Extracting data...
/home/sawan/convnet/convolutional-attention-master/convolutional_attention/conv_att_rec_model.py:133: UserWarning: The image_shape
keyword argument to tensor.nnet.conv2d
is deprecated, it has been renamed to input_shape
.
filter_shape=self.conv_layer1_code.get_value().shape)
/home/sawan/convnet/convolutional-attention-master/convolutional_attention/conv_att_rec_model.py:138: UserWarning: The image_shape
keyword argument to tensor.nnet.conv2d
is deprecated, it has been renamed to input_shape
.
filter_shape=self.conv_layer2_code.get_value().shape)
/home/sawan/convnet/convolutional-attention-master/convolutional_attention/conv_att_rec_model.py:152: UserWarning: The image_shape
keyword argument to tensor.nnet.conv2d
is deprecated, it has been renamed to input_shape
.
filter_shape=self.conv_layer3_code.get_value().shape)[:, 0, :, 0]
Traceback (most recent call last):
File "convolutional_attention/conv_att_rec_learner.py", line 235, in
model.train(input_file, max_epochs=max_num_epochs)
File "convolutional_attention/conv_att_rec_learner.py", line 35, in train
self.naming_data.name_empirical_dist)
File "/home/sawan/convnet/convolutional-attention-master/convolutional_attention/conv_att_rec_model.py", line 18, in init
self.__init_parameter(empirical_name_dist)
File "/home/sawan/convnet/convolutional-attention-master/convolutional_attention/conv_att_rec_model.py", line 88, in __init_parameter
self.__compile_model_functions()
File "/home/sawan/convnet/convolutional-attention-master/convolutional_attention/conv_att_rec_model.py", line 227, in __compile_model_functions
self.grad_step = theano.function(inputs=[], updates=step_updates, outputs=ratios)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function.py", line 317, in function
output_keys=output_keys)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 449, in pfunc
no_default_updates=no_default_updates)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 208, in rebuild_collect_shared
raise TypeError(err_msg, err_sug)
TypeError: ('An update must have the same type as the original shared variable (shared_var=sentence_count, shared_var.type=TensorType(float64, scalar), update_val=Alloc.0, update_val.type=TensorType(float64, (True,))).', 'If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.')
Hello!
I used the model in copy_conv_rec_learner.py
in order to train on the method names of round about 160000 methods. The training for 30 epochs took round about a day. However, the calculation of the scores after the model was saved wasn't finished after 8 hours. The validation dataset covered less than 20000 methods.
The json
-files were structured acording to the description here:
[
{"tokens":["<SENTENCE_START>","{","return","project","params",";","}","<SENTENCE_END/>"], "name":["get","project","params"]},
...
]
Therefore my question: is the input json file wrong or is it normal for the scoring to take that long?
Thanks in advance!
Hi there,
I really like your work and I'm trying to work out something based on your project.
I saw your paper mention that you used another baseline model, which is a standard attention model (Bahdanau et al., 2015) with biRNN and fully connected components. But I didn't see the source code in your project here.
Would you please help me with it?
Thanks,
Rui
TypeError Traceback (most recent call last)
D:\Project\convolutional-attention-master\convolutional_attention\baseline.py in ()
85 res = [token_precision_recall(name, real_name) for name in suggested_names]
86 is_correct = [len(real_name) == len(name) and all(k == l for k, l in zip(name, real_name)) for name in suggested_names]
---> 87 eval.add_result([1.] * num_ranks , is_correct, [False] * num_ranks, res)
88 print ''
89 print eval
TypeError: add_result() takes exactly 6 arguments (5 given)
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.