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
你好博主,感谢你的分享,我在运行过程中发现单独运行ESimCSE_train.py和单独运行ESimCSE_dataloader.py过程中negative_samples实际表现不一致,代码编辑如下: def negative_samples(self, batch_src_text): batch_size = len(batch_src_text) print('*' * 10) print('len(self.q):', len(self.q)) print('batch_size:', batch_size) negative_samples = None if len(self.q) > 0: negative_samples = self.q[:self.q_size] # print("size of negative_samples", len(negative_samples)) if len(self.q) + batch_size >= self.q_size: del self.q[:batch_size] self.q.extend(batch_src_text) print('len(self.q)2:', len(self.q)) if negative_samples: print('len(negative_samples):', len(negative_samples)) return negative_samples
ESimCSE_train.py打印日志如下:
len(self.q): 0 batch_size: 16 len(self.q)2: 16 ##########
len(self.q): 0 batch_size: 16 len(self.q): 0 len(self.q)2: 16 batch_size: 16 ########## len(self.q)2: 16 ##########
可以发现self.q赋值有问题,一直没找到问题根源在哪,希望可以一起讨论一下
The text was updated successfully, but these errors were encountered:
哎呀我懂了,一个是num_workers=1,num_workers=12
Sorry, something went wrong.
博主,那就有另外一个问题了。在实际训练过程中如果num_workers>1,就会有很多数据实际上负样本不足设定的q_size,这对训练效果是否有影响呢?
这个会有影响的,我这里提供的是一个实现案例参考喔,实际应用中,当然你应该按照你的数据情况做适应的调整了。
No branches or pull requests
你好博主,感谢你的分享,我在运行过程中发现单独运行ESimCSE_train.py和单独运行ESimCSE_dataloader.py过程中negative_samples实际表现不一致,代码编辑如下:
def negative_samples(self, batch_src_text):
batch_size = len(batch_src_text)
print('*' * 10)
print('len(self.q):', len(self.q))
print('batch_size:', batch_size)
negative_samples = None
if len(self.q) > 0:
negative_samples = self.q[:self.q_size]
# print("size of negative_samples", len(negative_samples))
if len(self.q) + batch_size >= self.q_size:
del self.q[:batch_size]
self.q.extend(batch_src_text)
print('len(self.q)2:', len(self.q))
if negative_samples:
print('len(negative_samples):', len(negative_samples))
return negative_samples
ESimCSE_train.py打印日志如下:
len(self.q): 0
batch_size: 16
len(self.q)2: 16
##########
len(self.q): 0
batch_size: 16
len(self.q)2: 16
##########
len(self.q): 0
batch_size: 16
len(self.q): 0
len(self.q)2: 16
batch_size: 16
##########
len(self.q)2: 16
##########
len(self.q): 0
batch_size: 16
len(self.q)2: 16
##########
可以发现self.q赋值有问题,一直没找到问题根源在哪,希望可以一起讨论一下
The text was updated successfully, but these errors were encountered: