Caffe官网 Tutorial: Nets, Layers, and Blobs caffe模型分解分析
2015-08-19 16:40
537 查看
http://caffe.berkeleyvision.org/tutorial/net_layer_blob.html 官网地址
总概况:
caffe 计算模型:一层层的框架,从bottom 到 top 从输入数据到loss, 数据和梯度流通过 forward
and backward passes 流动。
层的连接信息blobs 。
solver 用于模型配置和优化。
一、
For example, in a 4D blob, the value at index (n, k, h, w) is physically located at index ((n * K + k) * H + h) *
W + w.
因为 n 从0 开始,所以要加上 k 等
Number / N is the batch size of the data. Batch processing achieves better throughput for communication and device processing. For an ImageNet training batch of 256 images N = 256.
Channel / K is the feature dimension e.g. for RGB images K = 3.
二
Blob 存着 data 和 diff
cpu
和 gpu 之间可以同步
If you want to check out when a Blob will copy data, here is an illustrative example:
总概况:
caffe 计算模型:一层层的框架,从bottom 到 top 从输入数据到loss, 数据和梯度流通过 forward
and backward passes 流动。
层的连接信息blobs 。
solver 用于模型配置和优化。
一、
Blob storage and communication
For example, in a 4D blob, the value at index (n, k, h, w) is physically located at index ((n * K + k) * H + h) *W + w.
因为 n 从0 开始,所以要加上 k 等
Number / N is the batch size of the data. Batch processing achieves better throughput for communication and device processing. For an ImageNet training batch of 256 images N = 256.
Channel / K is the feature dimension e.g. for RGB images K = 3.
二
Implementation Details
Blob 存着 data 和 diffcpu
和 gpu 之间可以同步
const Dtype* cpu_data() const; Dtype* mutable_cpu_data()
If you want to check out when a Blob will copy data, here is an illustrative example:
// Assuming that data are on the CPU initially, and we have a blob. const Dtype* foo; Dtype* bar; foo = blob.gpu_data(); // data copied cpu->gpu. foo = blob.cpu_data(); // no data copied since both have up-to-date contents. bar = blob.mutable_gpu_data(); // no data copied. // ... some operations ... bar = blob.mutable_gpu_data(); // no data copied when we are still on GPU. foo = blob.cpu_data(); // data copied gpu->cpu, since the gpu side has modified the data foo = blob.gpu_data(); // no data copied since both have up-to-date contents bar = blob.mutable_cpu_data(); // still no data copied. bar = blob.mutable_gpu_data(); // data copied cpu->gpu. bar = blob.mutable_cpu_data(); // data copied gpu->cpu.
相关文章推荐
- 关于Jsp页面在ww:iterator 标签里面判断的写法是可以直接写数组里面的变量的
- js的结构类型理解
- 举例详解CSS中的text-shadow文字阴影效果使用
- 内存,cache,buffer
- JS日期显示格式 yyyy-MM-dd hh:mm:ss
- [rxjs] Creating An Observable with RxJS
- JavaScript学习笔记之数据类型和("32"+32)和("32"-32)输出结果
- JS文字球状放大效果代码分享
- createjs初学-关于getBounds和getTransformedBounds
- 比较全面的JS验证
- JS创建对象的几种方式
- jquery的each()详细介绍
- Bootstrap--组件之按钮组
- 剑指offer:3-二维数组中的查找
- js 判断文件是否存在
- 13. CSS 链接
- JavaScript实现表格快速变色效果代码
- CSS 超出隐藏实现限制字数的功能代码(多浏览器)
- JavaScript学习笔记之类型之间的判断比较
- CSS3边框阴影,折角效果演示