当前位置:网站首页>paddlepaddle 21 基于dropout实现用4行代码dropblock
paddlepaddle 21 基于dropout实现用4行代码dropblock
2022-06-27 01:58:00 【万里鹏程转瞬至】
dropblock的作用不在累述,这里只分享使用4行代码实现dropblock。dropblock的介绍可以参考博主的另一篇文章pytorch 22 8种Dropout方法的简介 及 基于Dropout用4行代码快速实现DropBlock_万里鹏程转瞬至的博客-CSDN博客
1、基本库方法实现
这里主要实现三个函数,图片展示、图片读取和tensor转img
from PIL import Image
from matplotlib import pyplot as plt
import paddle
from paddle import nn
def myimshows(imgs, titles=False, fname="test.jpg", size=6):
lens = len(imgs)
fig = plt.figure(figsize=(size * lens,size))
if titles == False:
titles="0123456789"
for i in range(1, lens + 1):
cols = 100 + lens * 10 + i
plt.xticks(())
plt.yticks(())
plt.subplot(cols)
if len(imgs[i - 1].shape) == 2:
plt.imshow(imgs[i - 1], cmap='Reds'边栏推荐
- Oracle/PLSQL: VSize Function
- Oracle/PLSQL: Substr Function
- Would rather go to 996 than stay at home! 24 years old, unemployed for 7 months, worse than work, no work
- The listing of Fuyuan pharmaceutical is imminent: the net amount raised will reach 1.6 billion yuan, and hubaifan is the actual controller
- UVM in UVM_ config_ Use of DB in sequence
- SQLite reader plug-in tests SQLite syntax
- Microsoft365开发人员申请
- Oracle/PLSQL: CharToRowid Function
- TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
- Flink学习1:简介
猜你喜欢

Binary tree OJ problem

Flink学习1:简介

宁愿去996也不要待业在家啦!24岁,失业7个月,比上班更惨的,是没班可上

Hot discussion: what are you doing for a meaningless job with a monthly salary of 18000?

按键控制LED状态翻转

Flink学习4:flink技术栈

three.js多米诺骨牌js特效

h5液体动画js特效代码

"All majors are persuading them to quit." is it actually the most friendly to college students?

dat. gui. JS star circle track animation JS special effect
随机推荐
Oracle/PLSQL: Cast Function
STM32入门介绍
简单学习GoogleColab的入门级概念
On the operation mechanism of numpy array
Oracle/PLSQL: Translate Function
递归是会更秀strtok
Addition, deletion, modification and query of ymal file
memcached基础12
YaLM 100B:来自俄罗斯Yandex的1000亿参数开源大模型,允许商业用途
Config in UVM_ How to use the DB mechanism
Why divide the training set and the test set before normalization?
Oracle/PLSQL: From_ Tz function
Oracle/PLSQL: HexToRaw Function
Oracle/PLSQL: Replace Function
Microsoft365开发人员申请
Parameter transfer method between two pages
Browser cache
Oracle/PLSQL: NumToYMInterval Function
C语言--职工信息管理系统设计
H5 liquid animation JS special effect code