Comments (3)
I think transpose was used because PyTorch expects the batch_size in the second dimension, it's been a while since I have coded this. But, I have checked all the dimensions from the start to the end when I developed it. :)
from attention-networks-for-classification.
Thank you so much 👍
from attention-networks-for-classification.
@Sandeep42 @hungthanhpham94
I wonder whether there is an error due to what Pytorch is expecting.
In the function train_data()
, it's written:
for i in xrange(max_sents):
_s, state_word, _ = word_attn_model(mini_batch[i,:,:].transpose(0,1), state_word)
In this way, after the .transpose(0,1)
, the resulting mini_batch matrix has size (max_tokens, batch_size).
However, the first function to be called is the self.lookup(embed)
, which is expecting a (batch_size, list_of_indeces).
If this is correct, it requires to fix up all the following code.
from attention-networks-for-classification.
Related Issues (18)
- Performance comparison to baseline models HOT 1
- how could I run this on Python 3 HOT 3
- Sentence model bug when GRU are not bidirectional HOT 1
- Dimensionalities of word minibatch and Embedding layer don't match HOT 1
- Having 2 optimizers HOT 3
- Init hidden state for the 2nd sentence onward HOT 2
- RNN mask issue
- the google drive can not open
- imdb_final.json HOT 2
- 你好 可以把数据和文本预处理的代码发我一下么 我这边访问不了
- Could I ask about the dataset `imdb_final.json`
- single lstm for all sentences HOT 1
- An example for save this model HOT 2
- single data prediction HOT 1
- Can not run the script HOT 1
- Loss can start as NaN HOT 5
- the pad_batch function is error? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from attention-networks-for-classification.