1. 基本概念
- 节点(constant、placeholder、Variable)
2. 细节问题
2.1 tensorflow 张量的阶、形状、数据类型及None在tensor中表示的意思
https://www.cnblogs.com/welhzh/p/6554872.html
x = tf.placeholder(tf.float32, [None, 784])
x isn’t a specific value. It’s a placeholder, a value that we’ll input when we ask TensorFlow to run a computation. We want to be able to input any number of MNIST images, each flattened into a 784-dimensional vector. We represent this as a 2-D tensor of floating-point numbers, with a shape [None, 784]. (Here None means that a dimension can be of any length.
) 注:这里的“None”表示其可以是任意长度
2.2 tensorflow函数解析:Session.run和Tensor.eval
http://blog.csdn.net/zcf1784266476/article/details/70259676
这其中最重要的区别就在于你可以使用sess.run()
在同一步获取多个tensor中的值,例如:
t = tf.constant(42.0)
u = tf.constant(37.0)
tu = tf.mul(t, u)
ut = tf.mul(U, t)
with sess.as_default():
tu.eval() # runs one step
ut.eval() # runs one step
sess.run([tu, ut]) # evaluates both tensors in a single step
3. Numpy学习
4. 博客学习
5. 教程学习
6. 数据预处理
标准化(normalization)
- 数据的标准化(normalization)是将数据按比例缩放,使之落入一个小的特定区间。在一些数据比较和评价中常用到。典型的有归一化法,还有比如极值法、
标准差法
。
归一化
- 归一化方法的主要有两种形式:一种是把数变为(0,1)之间的小数,一种是把有量纲表达式变为无量纲表达式。在数字信号处理中是简化计算的有效方式。
标准差标准化 (z-score standardization)
经过处理的数据符合标准正态分布,均值为,标准差为
# 使用scikit-learn函数
standar_scaler = preprocessing.StandardScaler()
feature_scaled = standar_scaler.fit_transform(feature)
# 使用numpy自定义函数
def min_max_norm(x):
x = np.array(x)
x_norm = (x - np.mean(x)) / np.std(x)
return x_norm
参考Blog