We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
用SimNet做了个语义判断的程序 model = ppnlp.models.SimNet( network='gru', emb_dim=256, vocab_size=len(vocab), num_classes=3) model = paddle.Model(model) optimizer = paddle.optimizer.AdamW( parameters=model.parameters(), learning_rate=0.001) criterion = paddle.nn.CrossEntropyLoss() metric = paddle.metric.Accuracy() model.prepare(optimizer, criterion, metric) model.fit( train_loader, evl_loader, epochs=20, save_dir='pretrained_model' ) 发现在eval阶段只是输出loss等信息,并不会打印出整个eval data的评价指标 然后在最后结束时只存了个final model,paddlex会存一个best model,paddlenlp现在会根据eval阶段的最优解指标存一个模型吗?
The text was updated successfully, but these errors were encountered:
你好!paddle.Model.fit在eval阶段会打印eval data的评价指标。并且打印的指标是从一个累积的数值。同时paddle.Model.fit可以指定save_freq参数,间隔epoch数之后保存模型参数,参考 https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/hapi/model/Model_cn.html#model
paddle.Model.fit
save_freq
simnet训练示例代码参考:https://github.com/PaddlePaddle/PaddleNLP/tree/release/2.0-rc/examples/text_matching/simnet
Sorry, something went wrong.
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。
Steffy-zxf
No branches or pull requests
用SimNet做了个语义判断的程序
model = ppnlp.models.SimNet(
network='gru',
emb_dim=256,
vocab_size=len(vocab),
num_classes=3)
model = paddle.Model(model)
optimizer = paddle.optimizer.AdamW(
parameters=model.parameters(), learning_rate=0.001)
criterion = paddle.nn.CrossEntropyLoss()
metric = paddle.metric.Accuracy()
model.prepare(optimizer, criterion, metric)
model.fit(
train_loader,
evl_loader,
epochs=20,
save_dir='pretrained_model' )
发现在eval阶段只是输出loss等信息,并不会打印出整个eval data的评价指标
然后在最后结束时只存了个final model,paddlex会存一个best model,paddlenlp现在会根据eval阶段的最优解指标存一个模型吗?
The text was updated successfully, but these errors were encountered: