当前位置:网站首页>Step function of activation function
Step function of activation function
2022-04-23 11:40:00 【Hey, little black 15kg】
Step function
The step function is expressed in 0 As a boundary , Output from 0 Switch to a 1( Or from 1 Switch to a 0). Its value changes stepwise , So it's called step function .
import matplotlib.pyplot as plt
import numpy as np
def step_function(x):
y = x>0
print(y.shape,y.dtype)
return y.astype(np.int32)
# def step_function(x):
# print(x>0)
# return np.array(x>0,dtype=np.int32)
if __name__ == '__main__':
x = np.arange(-5,5,0.1)
y = step_function(x)
plt.plot(x,y)
plt.ylim(-0.1,1.1)
plt.show()
Execution results :
(100,) bool

版权声明
本文为[Hey, little black 15kg]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231136046057.html
边栏推荐
- Docker MySQL master-slave backup
- Advanced file IO of system programming (13) -- IO multiplexing - Select
- qt5.8 64 位静态库中想使用sqlite但静态库没有编译支持库的方法
- ImportError: libX11. so. 6: cannot open shared object file: No such file or directory
- 简易投票系统数据库设计
- 获取钉钉考勤机打卡记录
- 创客教育中的统筹方案管理模式
- 积极参与中学机器人竞赛的意义
- 零钱兑换II——【LeetCode】
- GPU, CUDA,cuDNN三者的關系總結
猜你喜欢
随机推荐
Pytorch neural network trainer
怎么进行固定资产盘点,资产盘点报告如何一键生成
Chapter 4: enable and disable im column storage for materialized view (IM 4.6)
激活函数之relu函数
ThinkPHP adds image text watermark to generate promotion poster with QR code
解析幼儿教育中steam教育的融合
Analyzing the role of social robots in basic science
Interpretation of biological recognition in robot programming course
Purpose of IM expression (IM 5.2)
实践数据湖iceberg 第三十课 mysql->iceberg,不同客户端有时区问题
Summary of convolution layer and pooling layer
thinkphp 添加图片文字水印生成带二维码的推广海报
Link sorting of tutorials such as assembly language running environment setting
IFLYTEK's revenue in 2021 was 18.3 billion yuan: a year-on-year increase of 41% and a net profit of 1.556 billion yuan
抓包整理————tcp 协议[八]
Study notes of C [8] SQL [1]
Tclerror: no display name and no $display environment variable
Summary of QT semaphore unresolved errors
第四章 为物化视图启用和禁用IM列存储(IM 4.6)
Redis learning 5 - high concurrency distributed lock practice



![Change exchange II - [leetcode]](/img/ad/33b13a004208d613c9a211fec9e5b1.png)





