当前位置:网站首页>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
边栏推荐
猜你喜欢

HiTek电源维修X光机高压发生器维修XR150-603-02

邮件系统(基于SMTP协议和POP3协议-C语言实现)

Understand neural network structure and optimization methods

Quick start CherryPy (1)

视频文件太大?使用FFmpeg来无损压缩它

手把手带你玩摄像头模组

2-4Kali下安装nessus

Google browser chropath plug-in

【生动理解】深度学习中常用的各项评价指标含义TP、FP、TN、FN、IoU、Accuracy

前馈-反馈控制系统设计(过程控制课程设计matlab/simulink)
随机推荐
使用Aspose.cells将Excel转成PDF
.NET 中的引用程序集
前馈-反馈控制系统设计(过程控制课程设计matlab/simulink)
JS array splicing "suggested collection"
Use CAS to complete concurrent operations with atomic variables
E+H二次表维修PH变送器二次显示仪修理CPM253-MR0005
Une compréhension facile de la simplicité de la classification bayésienne du lissage laplacien
The R language uses the preprocess function of the caret package for data preprocessing: Center all data columns (subtract the average value from each data column), and set the method parameter to cen
新旧两个界面对比
Hitek power supply maintenance X-ray machine high voltage generator maintenance xr150-603-02
ucore lab3
Source insight 工具安装及使用方法
On anchors in object detection
R language plot visualization: visualize the normalized histograms of multiple data sets, add density curve KDE to the histograms, set different histograms to use different bin sizes, and add edge whi
Collection framework generic LinkedList TreeSet
vector::data() 指针使用细节
std::memory_ order_ seq_ CST memory order
1098 insertion or heap sort (PAT class a)
SVN版本控制器的安装及使用方法
R langage plotly visualisation: visualisation de plusieurs histogrammes normalisés d'ensembles de données et ajout d'une courbe de densité KDE à l'histogramme, réglage de différents histogrammes en ut