Giter VIP home page Giter VIP logo

Comments (11)

padeoe avatar padeoe commented on May 30, 2024

pytorch版本?

from cail2019.

YeNiTing avatar YeNiTing commented on May 30, 2024

不好意思,我手误了,是pytorch版本。
我这里想请问一下,我运行您的代码,其中未加上数据增广部分,运行之后准确率不升反降,其中我将epoch设置为15,bachsize设置为8,from_jsons()方法中use_augment参数设置为FALSE。运行结果如下

Epoch 1/15, Loss 0.6125234: 100%|██████████| 510/510 [07:00<00:00, 1.21it/s]
2020-11-19 12:04:18 - train model - INFO - Epoch 1, train Loss: 350.5714206, eval acc: 0.5009803921568627, eval loss: 87.9807581
Epoch 2/15, Loss 0.6267155: 38%|███▊ | 196/510 [02:41<04:14, 1.24it/s]Gradient overflow. Skipping step, loss scaler 0 reducing loss scale to 32768.0
Epoch 2/15, Loss 0.7077590: 51%|█████▏ | 262/510 [03:35<03:20, 1.23it/s]Gradient overflow. Skipping step, loss scaler 0 reducing loss scale to 16384.0
Epoch 2/15, Loss 0.6255577: 100%|██████████| 510/510 [07:00<00:00, 1.21it/s]
2020-11-19 12:12:03 - train model - INFO - Epoch 2, train Loss: 324.0322941, eval acc: 0.48627450980392156, eval loss: 89.3969226
Epoch 3/15, Loss 0.4028434: 100%|██████████| 510/510 [07:00<00:00, 1.21it/s]
2020-11-19 12:19:48 - train model - INFO - Epoch 3, train Loss: 277.1290905, eval acc: 0.4764705882352941, eval loss: 103.9318169
Epoch 4/15, Loss 0.3176420: 100%|██████████| 510/510 [07:00<00:00, 1.21it/s]
2020-11-19 12:27:33 - train model - INFO - Epoch 4, train Loss: 230.9418191, eval acc: 0.5107843137254902, eval loss: 125.9183470
Epoch 5/15, Loss 0.2223693: 100%|██████████| 510/510 [07:00<00:00, 1.21it/s]
2020-11-19 12:35:18 - train model - INFO - Epoch 5, train Loss: 189.8396636, eval acc: 0.49901960784313726, eval loss: 167.4459955
Epoch 6/15, Loss 0.8055249: 53%|█████▎ | 268/510 [03:40<03:15, 1.24it/s]Gradient overflow. Skipping step, loss scaler 0 reducing loss scale to 16384.0
Epoch 6/15, Loss 0.8786914: 62%|██████▏ | 316/510 [04:20<02:36, 1.24it/s]Gradient overflow. Skipping step, loss scaler 0 reducing loss scale to 8192.0
Epoch 6/15, Loss 1.0068855: 100%|██████████| 510/510 [06:59<00:00, 1.21it/s]
2020-11-19 12:43:02 - train model - INFO - Epoch 6, train Loss: 167.8786180, eval acc: 0.4852941176470588, eval loss: 195.0725200
Epoch 7/15, Loss 0.1222683: 100%|██████████| 510/510 [06:59<00:00, 1.22it/s]
2020-11-19 12:50:47 - train model - INFO - Epoch 7, train Loss: 144.5756744, eval acc: 0.49901960784313726, eval loss: 235.2725336
Epoch 8/15, Loss 0.0200045: 100%|██████████| 510/510 [06:59<00:00, 1.22it/s]
2020-11-19 12:58:31 - train model - INFO - Epoch 8, train Loss: 124.8573526, eval acc: 0.4950980392156863, eval loss: 284.8547707
Epoch 9/15, Loss 0.0241441: 100%|██████████| 510/510 [06:58<00:00, 1.22it/s]
2020-11-19 13:06:14 - train model - INFO - Epoch 9, train Loss: 110.4628077, eval acc: 0.5068627450980392, eval loss: 320.1884821
Epoch 10/15, Loss 0.3061803: 57%|█████▋ | 293/510 [04:01<02:59, 1.21it/s]

from cail2019.

padeoe avatar padeoe commented on May 30, 2024

“未加上数据增广部分,运行之后准确率不升反降”,这应该是预期现象,表明增广可以提高性能,这也是我在README说明中提到的,不知道你的疑问是什么呢?

from cail2019.

YeNiTing avatar YeNiTing commented on May 30, 2024

我的疑问就是,是否您在实验时有对比加数据增广和不加数据增广的实验效果?不加数据增广仅仅用bert实验效果如何?因为我不清楚我得到的实验结果是因为模型本身的原因还是因为我个人代码运行的错误,为何效果会如此差?似乎和预期bert的效果不太相符。
其次我这里想问一下,您训练得到您的实验结果epoch是设为了多少,我复现您的实验epoch设为10,得到最高准确率为0.7(这里是加入了数据增广),与您在README中提到的结果相差较多。

from cail2019.

YeNiTing avatar YeNiTing commented on May 30, 2024

补充一下,我复现您代码得到0.7准确率的结果,其中TRAINING_DATASET读取的是raw中的数据,但是K折教程验证中K设置为1,这样是否会影响实验结果?

from cail2019.

padeoe avatar padeoe commented on May 30, 2024

你好,我来测试下给您回复,我在readme中的结果是基于旧版代码做的,并且是TRAINING_DATASET为第一阶段数据集(主办方最后未公开分发该数据集),kfold=5。比赛最终成绩榜得分为0.7059。

from cail2019.

YeNiTing avatar YeNiTing commented on May 30, 2024

非常感谢您的回复!

from cail2019.

padeoe avatar padeoe commented on May 30, 2024

主要是看了你这个日志结果中loss不降反升,准确率0.5,我怀疑代码最后是不是引入了什么bug

from cail2019.

YeNiTing avatar YeNiTing commented on May 30, 2024

我也怀疑是我在看您代码改写信息增广部分是否有改动什么,所以我又重新下载了您的代码,未改动模型结构进行复现,就是我上面说的运行结果epoch9之后达到最高0.70490。(就是bachsize为8,epoch为9,k为1,training_dataset 为raw)
日志显示train_loss和test_loss都在下降,说明应该是我之前代码改动的问题。
其次我又尝试将training_dataset设为train中的input.txt,k为1,发现模型训练初始即epoch1准确率很低,仅仅为0.4862,(当training_dataset为rwa时,epoch1准确率为0.5725),且准确率提高慢,到epoch3时反而降了一些(epoch1=0.4862,epoch2=0.5098,epoch3=0.5029),是否training_dataset的选择也会影响模型的训练结果?

from cail2019.

padeoe avatar padeoe commented on May 30, 2024

问题找到了#20,原来是数据的问题,原始比赛数据集没有label字段,默认label都是B,而最新下载的数据的label则由新增的label字段决定。因此代码中关于数据加载部分得修改代码才行,不然基于错误的label训练,难怪准确率50%左右。

from cail2019.

padeoe avatar padeoe commented on May 30, 2024

5f8d901 已经修改代码适配最新数据集,准确率在0.5左右的问题不再存在。

from cail2019.

Related Issues (12)

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.