acnn icon indicating copy to clipboard operation
acnn copied to clipboard

Test accuracy is very low

Open ChenMiya opened this issue 6 years ago • 21 comments

hello,I choose attention_pooling model when I run main.py. But I see a great difference from your results.And the train accuracy is so high, the test accuracy is so low. My result in attention pooling model as follows: Epoch: 1 Train: 28.94% Test: 42.63% Epoch: 10 Train: 67.42% Test: 54.52% Epoch: 50 Train: 92.29% Test: 55.44% Epoch: 100 Train: 94.67% Test: 53.89%

Looking forward to your reply.

ChenMiya avatar Oct 09 '17 03:10 ChenMiya

I can't reproduce the results of the paper, maybe the code is not right. I don't know what's wrong.

FrankWork avatar Oct 10 '17 07:10 FrankWork

@FrankWork my version which has achieved acnn is using pytorch, some data handling code copy from yours. maybe you could see it

dgai91 avatar Oct 17 '17 02:10 dgai91

@FrankWork thanks for your recommendation

dgai91 avatar Oct 17 '17 08:10 dgai91

@lawlietAi What is your test accuracy?

FrankWork avatar Oct 18 '17 04:10 FrankWork

that is the reason i didn't put it on README

dgai91 avatar Oct 18 '17 04:10 dgai91

@FrankWork i think the original paper didn't use test data but use the eval data which divided from train data

dgai91 avatar Oct 18 '17 08:10 dgai91

Is there anyone actually obtaining the results from the original paper? I couldn't reach the performance specified in the paper.

allanj avatar Oct 23 '17 08:10 allanj

@allanj no one.

FrankWork avatar Oct 26 '17 15:10 FrankWork

@lawlietAi I'm not familiar with pytorch while I'm implementing the paper using tensorflow. And I'm stuck on a specific problem. In original paper, the author views an entity as a word and calculate a similarity score between them. But in fact, there're entities composed of several words. How do you deal with that? how to calculate the score in such situation?

GatsbyUSTC avatar Nov 27 '17 10:11 GatsbyUSTC

sorry, i could not understand certainly on “them”. 😂😂

dgai91 avatar Nov 27 '17 13:11 dgai91

@lawlietAi Sorry. In input attention layer, the author calculate a score f between word in entity and word in sentence based on inner product. The question is how to calculate the score if there're several words in an entity.

GatsbyUSTC avatar Nov 28 '17 01:11 GatsbyUSTC

@GatsbyUSTC If an entity contains several words, we just use the last word to represent the entity. It is a common practice.

FrankWork avatar Nov 28 '17 02:11 FrankWork

The question is how to calculate the score if there're several words in an entity.

@GatsbyUSTC In some papers, mean embeddings of those words are often used, too.

some reference

Recurrent Attention Network on Memory for Aspect Sentiment Analysis
Aspect Level Sentiment Classification with Deep Memory Network
Effective LSTMs for Target-Dependent Sentiment Classification

wangtianyiftd avatar Dec 17 '17 16:12 wangtianyiftd

@wangtianyiftd Thanks very much. Could I ask you another question since you seem to read lots of papers about attention. The attention mechanism works well on translation model. A word can focus on several words from another language based on attention. But do you think the attention mechanism will work on relation classification problem? Inner product means euclidean distance between embeddings. when we do relation classification, I don't think more attention on words which are close to entities will help solving the relation classification. I didn't get a better result after adding attention mechanism on cnn model, and I don't know the problem comes from the attention or hyperparameter. It will be nice if you can answer this question.

GatsbyUSTC avatar Dec 20 '17 05:12 GatsbyUSTC

@GatsbyUSTC Attention on words try to find the most relevant words related to the entity pair, of course it will help. Take the relation "President" as an example, the word 'president' itself contribute a lot to the classification results. In theory, attention mechanism will assign a large weight to the word 'president'.

Although we can't reproduce the results of this paper, we can't deny the entire attention mechanism. Maybe you can reproduce other attention based paper.

FrankWork avatar Dec 21 '17 02:12 FrankWork

attention is not almighty. but it can let network get the keywords from articles. this paper used 2 attention layers to increase the depth of nn, but att reduced information a lot. maybe it is the reason of bad performance in addition, maybe this paper gave us a way to process long articles. i would do more experiment further

dgai91 avatar Dec 21 '17 02:12 dgai91

@FrankWork I did not deny the entire attention mechanism. The question is how can the attention learn to find the most relevant words on relation classification task. The attention mechanism in input layer proposed by the author just compute a inner product between entity and words so that words that are similar to entity will be paid more attention. Does it really help relation classification? Take "The school master teaches the lesson with a stick" for example, keyword for relation classification should be "with" since the correct relation is Instrument-Agency. Word "with" is relevant to the relation classification but it doesn't seem to be similar with "master" or "stick" which means we can't get a high attention score based on inner product. I just want to know the function of the attention mechanism here. Of course I know in some applications the attention mechanism will help, but they also get a good reason.

GatsbyUSTC avatar Dec 22 '17 13:12 GatsbyUSTC

@GatsbyUSTC The inner product does not guarantee that the two words must be similar semantically. It can also be interpreted as relevance since the embeddings are learned. "with + n." is common in English, why can't they have higher inner product?

FrankWork avatar Dec 24 '17 07:12 FrankWork

@GatsbyUSTC I agree with you. If we are using pretrained embeddings and not tuning them during training, an attention at the input layer would be meaningless. However, if embeddings are randomly initialized and updated while training, the attention would be useful to choose words which are key indicators for a class. At the same time, this would require a considerably larger training set.

desh2608 avatar Jan 08 '18 06:01 desh2608

@ChenMiya 我想问一下你现在找到你测试集的准确率特别低的原因了吗?

Mariobai avatar Jul 05 '18 06:07 Mariobai

@FrankWork i think the original paper didn't use test data but use the eval data which divided from train data

You codes don't have the train or test data,So how to run your codes?

charlesfufu avatar Oct 10 '18 05:10 charlesfufu