-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
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
【Hackathon 5th No.24】Add SubsetRandomSampler #648
Conversation
@lxd-cumt 劳烦看一下 |
## API实现方案 | ||
|
||
pytorch的sampler整体设计与paddle类似,因此考虑参考pytorch的方案实现 | ||
在 python\paddle\io\sampler.py 中添加对应类。但是由于paddle并没有完全支持`generator`,因此将该参数移除。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subsetrandomsampler中__iter__方法会通过randperm函数将indices打散,并支持设置随机数生成器generator,请确认一下paddle中提供的randperm函数的用法,并且对比一下配置generator和未配置generator的区别
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle 中 randperm 参数如下:
paddle.randperm(n, dtype='int64', name=None)
并不支持 generator。不仅是 randperm,randn、randint 等也不支持。
相关issue:
* add rfc of SubsetRandomSampler * update
add rfc of SubsetRandomSampler
和代码同步修改