当前位置:网站首页>torch. utils. data. Randomsampler and torch utils. data. Differences between sequentialsampler
torch. utils. data. Randomsampler and torch utils. data. Differences between sequentialsampler
2022-06-27 09:51: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)
# It can be seen from the results RandomSampler Random sampling is used , Output per call
# In different order . and SequentialSampler Sequential sampling , The result is the same every time
Output results :
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
边栏推荐
猜你喜欢

初步认识pytorch

别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!

【系统设计】邻近服务

ucore lab5

谷歌浏览器 chropath插件

反编译jar包,修改后重新编译为jar包

Use aspese slides to convert PPT to PDF

This application failed to start because it could not find or load the QT platform plugin

Advanced mathematics Chapter 7 differential equations

CPU设计(单周期和流水线)
随机推荐
【报名】基础架构设计:从架构热点问题到行业变迁 | TF63
如何获取GC(垃圾回收器)的STW(暂停)时间?
There is no doubt that this is an absolutely elaborate project
Understand neural network structure and optimization methods
QT运行显示 This application failed to start because it could not find or load the Qt platform plugin
别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
Quartz(定时器)
Source insight 工具安装及使用方法
Principle and application of the most complete H-bridge motor drive module L298N
ucore lab5
微信小程序学习之五种页面跳转方法.
前馈-反馈控制系统设计(过程控制课程设计matlab/simulink)
Some exercises about binary tree
R語言plotly可視化:可視化多個數據集歸一化直方圖(historgram)並在直方圖中添加密度曲線kde、設置不同的直方圖使用不同的分箱大小(bin size)、在直方圖的底部邊緣添加邊緣軸須圖
如何获取GC(垃圾回收器)的STW(暂停)时间?
R language uses econcharts package to create microeconomic or macro-economic charts, demand function to visualize demand curve, and customize the parameters of demand function to enrich the visualizat
产品力对标海豹/Model 3,长安深蓝SL03预售17.98万起
Semi-supervised Learning入门学习——Π-Model、Temporal Ensembling、Mean Teacher简介
CPU design (single cycle and pipeline)
Use aspese slides to convert PPT to PDF