当前位置:网站首页>torch.utils.data.RandomSampler和torch.utils.data.SequentialSampler的区别
torch.utils.data.RandomSampler和torch.utils.data.SequentialSampler的区别
2022-06-27 09:35:00 【jjw_zyfx】
sampler_train = torch.utils.data.RandomSampler(torch.arange(10))
for i in sampler_train:
print(i)
print('=================')
for k in sampler_train:
print(k)
print('--------------')
sampler_val = torch.utils.data.SequentialSampler(torch.arange(10))
for j in sampler_val:
print(j)
print('=================')
for l in sampler_val:
print(l)
# 从结果上可以看出来RandomSampler随机采样在使用的时候,每次调用输出的
# 顺序都不大一样。而SequentialSampler顺序采样,每次结果都一样
输出结果:
3
0
1
6
4
5
9
7
8
2
=================
5
9
6
0
3
4
1
7
8
2
--------------
0
1
2
3
4
5
6
7
8
9
=================
0
1
2
3
4
5
6
7
8
9
边栏推荐
- 【报名】基础架构设计:从架构热点问题到行业变迁 | TF63
- 谷歌浏览器 chropath插件
- [vivid understanding] the meanings of various evaluation indicators commonly used in deep learning TP, FP, TN, FN, IOU and accuracy
- 如何获取GC(垃圾回收器)的STW(暂停)时间?
- This application failed to start because it could not find or load the QT platform plugin
- std::memory_order_seq_cst内存序
- 使用aspose-slides将ppt转pdf
- Installation and use of SVN version controller
- fastadmin 安装后访问后台提示模块不存在
- How much memory does the data type occupy? LongVsObject
猜你喜欢

Advanced mathematics Chapter 7 differential equations

有关二叉树的一些练习题

There is no doubt that this is an absolutely elaborate project

Take you to play with the camera module

E+h secondary meter repair pH transmitter secondary display repair cpm253-mr0005

I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!

Win10 add right-click menu for any file

This, constructor, static, and inter call must be understood!

你睡觉时大脑真在自动学习!首个人体实验证据来了:加速1-4倍重放,深度睡眠阶段效果最好...

隐私计算FATE-离线预测
随机推荐
Design of multiple classes
.NET 中的引用程序集
Google browser chropath plug-in
技术与业务同等重要,偏向任何一方都是错误
Semi supervised learning—— Π- Introduction to model, temporary assembling and mean teacher
How do I get the STW (pause) time of a GC (garbage collector)?
Parameters argc and argv of main()
I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
E+h secondary meter repair pH transmitter secondary display repair cpm253-mr0005
Tdengine invitation: be a superhero who uses technology to change the world and become TD hero
最全H桥电机驱动模块L298N原理及应用
HiTek电源维修X光机高压发生器维修XR150-603-02
使用Aspose.cells将Excel转成PDF
js 所有的网络请求方式
R语言plotly可视化:可视化多个数据集归一化直方图(historgram)并在直方图中添加密度曲线kde、设置不同的直方图使用不同的分箱大小(bin size)、在直方图的底部边缘添加边缘轴须图
更改pip镜像源
Shortcut key bug, reproducible (it seems that bug is the required function [funny.Gif])
分布式文件存储系统的优点和缺点
集合框架 泛型LinkedList TreeSet
Use aspese slides to convert PPT to PDF