针对上一篇博客中代码使用到的API,做一个简单的总结。
- 初始化
- 变量 tf.Variable
- 常量 tf.constant
- 占位符 tf.placeholder
tf.placeholder(
dtype,
shape=None,
name=None
)
dtype
: The type of elements in the tensor to be fed.shape
: The shape of the tensor to be fed (optional). If the shape is not specified, you can feed a tensor of any shape.name
: A name for the operation (optional).
2.优化器