Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my neural net only predicts 'ooo'. #2

Open
stevenhao opened this issue Feb 6, 2017 · 3 comments
Open

my neural net only predicts 'ooo'. #2

stevenhao opened this issue Feb 6, 2017 · 3 comments

Comments

@stevenhao
Copy link

stevenhao commented Feb 6, 2017

I implemented the most basic neural net (following the instructions) and it is not performing very well.
I'm using Bag of Means to do document embedding which uses a Word2Vec model trained on the ted text.

I suspect that I have some sort of bug, as I'm a beginner with PyTorch. If the instructors don't mind, I'd like to share my code: [removed]
It is mostly modeled off this tutorial.

@kwea123
Copy link

kwea123 commented Feb 6, 2017

I also experince this problem, I think it's because the distribution is too unbalanced. something like [ 0.01629133, 0.01677048, 0.06947772, 0.1825587 , 0.01149976, 0.08145664, 0.0785817 , 0.53905129]
So if you sample batches as it stands, it's quite probable that your batches contain many instances of label 'ooo' then the model won't learn anything.
It's just my personal thought, don't know if it's correct, but I did the same thing as you and I got both ~54% on training and test sets, which is exactly the ratio of class 'ooo'.
Now I change my way of batching so that the batches contain equal number of each class (e.g. if the batch size is 48 then it contains 6 instances of each class), in this way I can achieve training acc 99% but the test acc is still around 60%. I'm stuck and don't know how to do better. I tried multilayers, different numbers of units and dropouts but they don't help a lot.
I train also the word vectors according to this problem so word representation is not a problem I think.

@iassael
Copy link
Contributor

iassael commented Feb 6, 2017

@stevenhao that's good work but we would kindly ask you not share your code.

The dataset is unbalanced, so the random baseline will be much higher, however, you could still attempt to achieve higher accuracy. How much is your accuracy?

@Tommalla
Copy link

Tommalla commented Feb 6, 2017

I have a similar problem. No matter how many different methods I try, my network always learns to predict ooo regardless of the data.

Is there an important trick we're missing here? Standardizing the data in some way perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants