Comments (9)
您好,您计算loss函数是一个batch的loss还是一个句子的loss,我更换数据集后训练的loss好大,我换了一个22万行的数据集,训练了一会发现loss上万了,这个需要自己训练好词向量吗,还是在训练中就会一起训练词向量?
from chinsesner-pytorch.
只要训练数据按照目前的格式替换,就可以训练自己的模型
from chinsesner-pytorch.
而且我训练你的数据loss刚开始就只有10多点,我自己的数据loss好大
from chinsesner-pytorch.
你好,请问该代码有用bert产生词向量吗
from chinsesner-pytorch.
而且我训练你的数据loss刚开始就只有10多点,我自己的数据loss好大
我也遇到了,loss一直在5左右,请问您解决这个问题了吗?
from chinsesner-pytorch.
您好,您计算loss函数是一个batch的loss还是一个句子的loss,我更换数据集后训练的loss好大,我换了一个22万行的数据集,训练了一会发现loss上万了,这个需要自己训练好词向量吗,还是在训练中就会一起训练词向量?
计算loss的时候可以做一下平均,比如说:
def neg_log_likelihood(self, sentences, tags, length):
"""
Negative Log-Likelihood (NLL) Loss Function -> - (Real Path Score - Total Score)
:param sentences:
:param tags:
:param length:
:return:
"""
self.batch_size = sentences.size(0)
# Get the output tag_size tensor from the Linear Layer
logits = self.prediction(sentences)
real_path_score = torch.zeros(1)
total_score = torch.zeros(1)
all_length = torch.zeros(1)
for logit, tag, leng in zip(logits, tags, length):
logit = logit[:leng]
tag = tag[:leng]
# Calculate the Real Path Score
real_path_score += self.real_path_score(logit, tag)
# Calculate the total score
total_score += self.total_score(logit, tag)
# Add all the length
all_length += leng
# print("total score ", total_score)
# print("real score ", real_path_score)
# Output the NLL Loss
return (total_score - real_path_score) / all_length
from chinsesner-pytorch.
你好,请问该代码有用bert产生词向量吗
该代码是character-level的字向量,没有用到词向量。字向量是用
self.word_embeddings = nn.Embedding(num_embeddings=vocab_size, embedding_dim=self.embedding_dim)
进行初始化的+训练的,然后可以在网络学习过程中训练字向量。
from chinsesner-pytorch.
而且我训练你的数据loss刚开始就只有10多点,我自己的数据loss好大
我也遇到了,loss一直在5左右,请问您解决这个问题了吗?
我现在遇到的问题是loss不稳定下降,到了后期loss起起伏伏,就算调小学习率也不稳定,是不是因为数据原因呢?
from chinsesner-pytorch.
直接替换为英文数据集可以训练吗
from chinsesner-pytorch.
Related Issues (16)
- 请教用batch计算的原因 HOT 4
- 您好,换成自己的数据集之后,是不是还需要用自己的数据集训练出params.pkl文件
- 怎么开始使用这个code,先运行那个py文件 HOT 5
- 运行完train或者predict没有反应 HOT 2
- 这个是怎么回事啊大佬 HOT 5
- 一个拼写错误tasg": ["ORG", "PER"]
- DELETED
- 为什么训练和验证集的精确和召回都接近1了呢?
- 关于数据处理的问题 HOT 4
- what does the START_TAG and STOP_TAG mean? HOT 1
- How to add word and character信息到features中? HOT 1
- 想请问一下可以按照这个格式换成英文数据集进行训练吗
- 请问您的系统环境是多少呢?对于python、pytorch和CUDA HOT 2
- self.tag 和self.tag_map是否未合并
- 模型训练的疑问
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chinsesner-pytorch.