silver lining's blog

In me the tiger sniffe the rose. --- S.S.


  • Home

  • Archives

  • Categories

  • Tags

  • About

  • Search
silver lining's blog

caffe 层次结构

Posted on 2017-01-13 | In Technical Report | | Visitors

Caffe从四个层次来理解:Blob,Layer,Net,Solver。

Blob

Caffe的基本数据结构,用四维矩阵Batch\*Channel\*Height\*Width表示,存储了包括神经元的激活值、参数、以及相应的梯度(dW,db)。其中包含有cpu_data、gpu_data、cpu_diff、gpu_diff、 mutable_cpu_data、mutable_gpu_data、mutable_cpu_diff、mutable_gpu_diff这一堆很像的东西,分别表示存储在CPU和GPU上的数据(印象中二者的值好像是会自动同步成一致的)。其中带data的里面存
储的是激活值和W、b,diff中存储的是残差和dW、db。另外带mutable和不带mutable的一对指针所指的位置是相同的,只是不带mutable的只读,而带mutable的可写。

for more details

Read more »
silver lining's blog

tensorflow执行流程

Posted on 2017-01-04 | In Technical Report | | Visitors

计算图

在TensorFlow中,算法都被表示成计算图(computational graphs)。计算图也叫数据流图,可以把计算图看做是一种有向图,图中的节点表示操作,图中的边代表在不同操作之间的数据流动。

数据流图


Read more »
silver lining's blog

caffe fc层源码注释

Posted on 2016-12-30 | In Technical Report | | Visitors

基本原理

note : 注意理解反向传播过程中,修改的对象是bottom, 这一点与前向相反,前向修改的top
backpropgatation
矩阵乘法函数

成员变量

1
2
3
4
5
6
protected:
int M_;//样本数量
int K_;//单个输入特征长度
int N_;//输出神经元数量
bool bias_term_;//是否添加偏置,上图中的(+1)。
Blob<Dtype> bias_multiplier_;//偏置的乘子
Read more »
silver lining's blog

tensorflow custom learning rate decay

Posted on 2016-12-26 | In Technical Report | | Visitors

基本原理

通过传递一个常量tensor lr给optimizer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# import related module
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
# implementation of inv decay in caffe base_lr*(1+gamm*itear)^(-power)
def inv_decay(learning_rate, global_step, gamma, power, name=None):
if global_step is None:
raise ValueError("global_step is required for inv_decay.")
with ops.name_scope(name, "InvDecay",
[learning_rate, global_step,
gamma, power]) as name:
learning_rate = ops.convert_to_tensor(learning_rate, name="learning_rate")
dtype = learning_rate.dtype
global_step = math_ops.cast(global_step, dtype)
gamma = math_ops.cast(gamma, dtype)
power = math_ops.cast(power, dtype)
base = math_ops.multiply(gamma, global_step)
return math_ops.multiply(learning_rate, math_ops.pow(1+base, -power),
name=name)
lr = inv_decay(learning_rate=0.0005, global_step=get_global_step_var()-2800000,
gamma=0.0001,
power=0.75)
tf.summary.scalar('lr', lr)
optimizer=tf.train.GradientDescentOptimizer(lr)
silver lining's blog

atom本地安装插件

Posted on 2016-11-25 | In Technical Report | Visitors

Atom 是专门为程序员推出的一个跨平台文本编辑器。具有简洁和直观的图形用户界面,并有很多有趣的特点:支持CSS,HTML,JavaScript等网页编程语言。它支持宏,自动完成分屏功能,集成了文件管理器。更稳重要的它具有很好的扩展性。由于有时候是网络原因会导致在线安装插件失败。

Read more »
123
silver lining

silver lining

Little strokes fell great oaks!

13 posts
3 categories
17 tags
GitHub Zhihu
Links
  • DeepMind
  • Tesla
  • MITTech
  • TED
© 2015 - 2017 silver lining
Powered by Hexo
Theme - NexT.Muse