人工智能TensorFlow-简单的训练示例

import tensorflow as tf import numpy as np # 使用numpy生成100个随机点 x_data = np.random.rand(100) # 下面的公式相当于一条直线,斜率是0.1,偏移量是0.2 y_data = x_data * 0.1 + 0.2 # 构造一个线性模型 b = tf.Variable(0.) k = tf.Variable(0.)
相关文章
相关标签/搜索