Closed yangdelu855 closed 6 years ago
hi,
input_x = np.zeros((batch_size, sequence_length))
-->should be input_x = np.random.randn((batch_size, sequence_length))
test() function is used to check whether model can run without error, and if possible,
we want to show that model can have some ability to learn simple task in a very short time.
so you can design a new input and output as a toy task.
I used this model for a text classification task, it can works. so you may try to let the model pass toy task first.
toy task: I've just updated this file.
发件人: dulusir notifications@github.com 发送时间: 2018年7月18日 16:18 收件人: brightmart/text_classification 抄送: Subscribed 主题: [brightmart/text_classification] p1_HierarchicalAttention_model_transformer.py (#71)
I have tried your code in text classification in github. Thanks for your sharing. However, I come across with a problem when running the test code in “a05_HierarchicalAttentionNetwork/p1_HierarchicalAttention_model_transformer.py”. In the test code, you have set all the input docs the same. But why the model can predict diffirent label for the docs with same content? And why the accurracy will become 1 after a few iterations? Also, we find that when we give a different input content with same labels in the HAN model, we always get a same result on the test dataset. Looking forword for your reply.
― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/brightmart/text_classification/issues/71, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASuYMCgDdRw2DhGfdox0clAepyJ0omqEks5uHu9YgaJpZM4VUJY7.
In your previous test function, given 10 samples with same content(all zeros) but different labels in a batch, we train the model for several times, the acc can arrive 100%. I just wonder, how the model tells the docs with all zeros from each other, and predict different labels for them?Is there anything wrong?
I have tried your code in text classification in github. Thanks for your sharing. However, I come across with a problem when running the test code in “a05_HierarchicalAttentionNetwork/p1_HierarchicalAttention_model_transformer.py”. In the test code, you have set all the input docs the same. But why the model can predict diffirent label for the docs with same content? And why the accurracy will become 1 after a few iterations? Also, we find that when we give a different input content with same labels in the HAN model, we always get a same result on the test dataset. Looking forword for your reply.