Tensorflow学习

1. tf.Variable 类型的变量: v.trainable 仅可读取此属性,不可更改。事实上,所有的tensorflow 变量和算子在创建完后,都不可更改,因此Tensorflow构建的图(graph)是静态图

2. 训练模型,首选SGD优化器,SGD在实际使用中是最优的,只要时间够长,采用SGD一般都能达到全局最优解。(前提是:训练样本必须完全正确,互不冲突)

3. Python Pyplot画曲线图教程:https://blog.csdn.net/jinruoyanxu/article/details/53390943

4. Pyplot轴密度修改(固定轴):

plt.axis([0,n,0,1])
plt.xticks(np.arange(n))

Pyplot 轴密度修改

 5. 获得直方图时需要注意端点问题,值域在[0,n]的,切分需要{0,1,2,...,n+1}的bins:

# use gravity center
def conv(v):
    sum = 0
    for i in range(len(v)):
        sum += i*v[i]
        v[i] = sum
    return v

n = 256
std = 0.03
bins = np.arange(n+1)/255
hist, _ = np.histogram(im, bins)
hist = hist/(ps_h*2*ps_w*2)
hist = conv(hist[0:n])
ratio = std/(hist[-1]/n)
im = im * ratio
print(ratio)

 6. 安卓手机上的深度学习AI应用性能对比:https://zhuanlan.zhihu.com/p/46294109 (AI Benchmark: Running Deep Neural Networks on Android Smartphones )

7. 小米MACE深度学习库:https://github.com/XiaoMi/mace,支持tf.space_to_depth和tf.depth_to_space。

8. 

 

posted @ 2019-03-01 13:15  xchk138  阅读(128)  评论(0)    收藏  举报