草庐IT

20210602

全部标签

20210602 TensorFlow 实现多点线性回归问题

0导包import warningswarnings.filterwarnings("ignore")import numpy as np      # numpy 支持矩阵计算 import tensorflow as tfimport matplotlib.pyplot as plt     # matplotlib 是 Python 的画图工具1-1构造数据np.random.seed(999)     # 设定随机种子,用于控制随机过程def pre(x):    return 2 * x  + 3   # 这里 w 是 2, b 是 3# 多点的线性回归,随机产生500个 0-5 的

20210602 TensorFlow 实现多点线性回归问题

0导包import warningswarnings.filterwarnings("ignore")import numpy as np      # numpy 支持矩阵计算 import tensorflow as tfimport matplotlib.pyplot as plt     # matplotlib 是 Python 的画图工具1-1构造数据np.random.seed(999)     # 设定随机种子,用于控制随机过程def pre(x):    return 2 * x  + 3   # 这里 w 是 2, b 是 3# 多点的线性回归,随机产生500个 0-5 的