# encoding: utf-8
import numpy as np
def sigmod(x, deriv=False):
if deriv:
return x * (1 - x)
return 1 / (1 + np.exp(-x))
X = np.array([[0.35],[0.9]]) # 输入
y = np.array([[0.5]]) # 真实值
print("X={}".format(X))
print("y={}".format(y))
print("X.shape={}".format(X.shape))
print("y.shape={}".format(y.shape))
W0 = np.array([[0.1, 0.8], [0.4, 0.6]])
W1 = np.array([[0.3, 0.9]]) # W1 = np.array([0.3, 0.9]) # 如果这样定义,定义的是一个列向量,shape 为 (2,)
print("W0.shape={}".format(W0.shape))
print("W1.shape={}".format(W1.shape))
print("original W0={}".format