Giter Site home page Giter Site logo

alw3-acl2019's People

Contributors

tuhinjubcse avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alw3-acl2019's Issues

dataset

Hello, there is no dataset in this project code. Could you please send me a dataset? Thank you very much! My email is [email protected] .

The context attention question

Hi,author
I‘m now trying to use your model of context attention(AttLayer). When I tried to add it to my model, it can be compile but not fit.
This is my model:
inputs = Input(shape=(MAX_SENTENCE_LENGTH, ), dtype='int32')
embedding = Embedding(len(word_index)+1,
EMBEDDING_DIM,
weights=[embedding_weights])(inputs)
x = Bidirectional(LSTM(256, recurrent_dropout=0.35, return_sequences=True))(embedding)

att = AttLayer()(x) 
output = Dense(2, activation='softmax')(att)
model = Model(inputs=inputs, outputs=output)
model.compile(loss='binary_crossentropy',
              optimizer='adam',
              metrics=['accuracy'])
model.summary()

model.fit(train_pad_data, labels,
batch_size=128,
epochs= 10,
callbacks=[early_stopping],
validation_data=(dev_pad_data, dev_labels))

The error message is as follows:
Train on 9000 samples, validate on 1000 samples
Epoch 1/10
Traceback (most recent call last):

File "", line 5, in
validation_data=(dev_pad_data, dev_labels))

File "D:\Anaconda3\lib\site-packages\keras\engine\training.py", line 1039, in fit
validation_steps=validation_steps)

File "D:\Anaconda3\lib\site-packages\keras\engine\training_arrays.py", line 199, in fit_loop
outs = f(ins_batch)

File "D:\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2715, in call
return self._call(inputs)

File "D:\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2675, in _call
fetched = self._callable_fn(*array_vals)

File "D:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1439, in call
run_metadata_ptr)

File "D:\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))

InvalidArgumentError: Input to reshape is a tensor with 5760 values, but the requested shape requires a multiple of 512
[[{{node attention1_23/Reshape_3}}]]

I don't know how to solve this problem, I hope you can help me.
Thank you.

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.