摘要: 须知:使用jupyter notebook食用 阶跃函数 def step_function(x): if x > 0: return 1 else: return 0 转换成支持Numpy数组的实现 import numpy as np def step_function_2(x): y = x> 阅读全文
posted @ 2025-03-04 20:53 屈臣 阅读(14) 评论(0) 推荐(0)
摘要: 与门 def AND(x1,x2): w1,w2,theta = 0.5,0.5,0.7 tmp = w1*x1+w2*x2 if tmp > theta: return 1 else: return 0 print(AND(0,1)) print(AND(1,0)) print(AND(1,1)) 阅读全文
posted @ 2025-03-04 20:30 屈臣 阅读(11) 评论(0) 推荐(0)
摘要: 导入numpy 和 matplotlib import numpy as np import matplotlib.pyplot as plt sinx函数图像 x = np.arange(0,6,0.1)#0.1步长,生成0到6的数据 y = np.sin(x) plt.plot(x,y) sin 阅读全文
posted @ 2025-03-04 20:26 屈臣 阅读(15) 评论(0) 推荐(0)