博客
关于我
pytorch 激活函数
阅读量:89 次
发布时间:2019-02-26

本文共 627 字,大约阅读时间需要 2 分钟。

mobilefacenet:

prelu 平均106ms

relu 平均94ms,快12ms,快10%

relu6 平均97ms,收敛慢

leakyrelu,平均106ms,收敛更慢。

inplace=True会x把输入前的删掉了,都变成了输入后的,

没有inplace,输入还是输入,输出是新的了。

import torchimport torch.nn as nn#inplace为True,将会改变输入的数据 ,否则不会改变原输入,只会产生新的输出m = nn.LeakyReLU(inplace=True)input = torch.randn(7)print("输入处理前图片:")print(input)output = m(input)print("ReLU输出:")print(output)print("输入处理后图片:")print(input)

 

import torchimport torch.nn.functional as Fconf_mask = torch.FloatTensor([0.0, 1.0, 0.0, 1.0, 1.0])conf_data = torch.FloatTensor([-20.1, -0.9, 0.0, 0.2,0.5,0.99, 2.2])import torchimport torch.nn as nn#inplace为True,将会改变输入的数据 ,否则不会改变原输入,只会产生新的输出

转载地址:http://tpak.baihongyu.com/

你可能感兴趣的文章
Nginx实现动静分离
查看>>
Nginx实现反向代理负载均衡
查看>>
nginx实现负载均衡
查看>>
Nginx将https重定向为http进行访问的配置(附Demo)
查看>>
nginx工作笔记004---配置https_ssl证书_视频服务器接口等
查看>>
nginx常用命令及简单配置
查看>>
Nginx常用屏蔽规则,让网站更安全
查看>>
nginx开机启动脚本
查看>>
nginx异常:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf
查看>>
nginx总结及使用Docker创建nginx教程
查看>>
nginx报错:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:128
查看>>
nginx报错:the “ssl“ parameter requires ngx_http_ssl_module in usrlocalnginxconfnginx.conf128
查看>>
nginx日志分割并定期删除
查看>>
Nginx日志分析系统---ElasticStack(ELK)工作笔记001
查看>>
Nginx映射本地json文件,配置解决浏览器跨域问题,提供前端get请求模拟数据
查看>>
Nginx映射本地静态资源时,浏览器提示跨域问题解决
查看>>
nginx最最最详细教程来了
查看>>
Nginx服务器---正向代理
查看>>
Nginx服务器上安装SSL证书
查看>>
Nginx服务器基本配置
查看>>