当前位置:网站首页>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'
边栏推荐
- H5 liquid animation JS special effect code
- lottie.js创意开关按钮动物头像
- 别被洗脑了,这才是90%中国人的工资真相
- Memcached basics 14
- Fork (), exec (), waitpid (), $? > > in Perl 8 combination
- TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
- dat. gui. JS star circle track animation JS special effect
- Memcached foundation 9
- Memcached foundations 12
- Memcached Foundation 12
猜你喜欢
Summary of config mechanism and methods in UVM (2)
Recursion will make strtok more attractive
Would rather go to 996 than stay at home! 24 years old, unemployed for 7 months, worse than work, no work
WiFi-IoT 鸿蒙开发套件样例开发
lottie. JS creative switch button animal head
Simply learn the entry-level concepts of googlecolab
达梦数据库安装
在 IDEA 里看个书很过分嘛!
1.44 inch TFT-LCD display screen mold taking tutorial
canvas粒子篇之鼠标跟随js特效
随机推荐
Markdown table (consolidated)
canvas粒子篇之鼠标跟随js特效
图论知识及其应用初步调研
Oracle/PLSQL: Substr Function
Oracle/PLSQL: HexToRaw Function
Binary tree OJ problem
按键控制LED状态翻转
Precautions for using sneakemake
d的appendTo包装
UVM in UVM_ config_ Setting and obtaining DB non-linear
Oracle/PLSQL: NumToDSInterval Function
Oracle/PLSQL: Translate Function
P5.js death planet
Oracle/PLSQL: To_ Clob Function
cookie,sessionstorage,localstorage区别
Oracle/PLSQL: Cast Function
CVPR2022 | PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏
Oracle/PLSQL: Upper Function
I encountered some problems when connecting to the database. How can I solve them?
Sample development of WiFi IOT Hongmeng development kit