Code Monkey home page Code Monkey logo

convolutional-attention's People

Contributors

mallamanis avatar udibr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

convolutional-attention's Issues

Import Error

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

Error while executing conv_att_rec_learner.py

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.')

Predicting takes longer than training

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!

Problem regarding the baseline mode (standard attention model)

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

Error occur in runing baseline.py

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)

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.