拆轮子 笔记
来源:互联网 发布:ida pro linux 32 编辑:程序博客网 时间:2024/05/09 06:27
拆程序
[ ] 分析一个发展到半程的DL项目CXXNET
- 开始时间
- 源码阅读,code structure
- coding guide
- 格式,注释文档
- getting started
- src文件夹下的文件夹都有一个.h文件.这个文件是一个模块module,
.h
文件是模块接口interface. - 所有其他的
-inl.hpp
文件是接口的实现implementations.- 所有接口都是对其他模块可视的.
- Templatized class with parameter xpu that can stands for cpu or gpu.
- The project depends on mshadow for tensor operations.
- src文件夹下的文件夹都有一个.h文件.这个文件是一个模块module,
- 项目的逻辑布局
- 依赖顺序:nnet->updater->layer
- 所有模块依赖global.h and utils
- io is an independent module
- ayer is implementation of neural net layers and defines forward and backward propagation
- updater is the parameter updating module,it defines update rule of weights.
- AsyncUpdater is a special updater that handles asynchronize communication and update
- It uses mshadow-ps to do async communication
- nnet is the neural net structure that combines layers together to form a neural net
- Dependency in nnet: CXXNetThreadTrainer->NeuralNetThread->NeuralNet
- io is the input module to handle reading various data and preprocessing.
-( io看来是数据传输模块,涉及底层的操作- io uses iterator pattern to handle data processing pipeline
- The pipeline can be mult-threaded using threadbuffer trick
- 依赖顺序:nnet->updater->layer
- 所有的源码怎么组织工作起来.
- 数据从io模块拉入nnet
- nnet获得已经获取部分数据的#gpu线程,调用层对象来做forwardbackprop(forward and backward propagation)
- 对于每个权重,更新(updater)被创建
- AsyncUpdater.AfterBackprop is called after backprop of the corresponding layer to push out gradient
- AsyncUPdater.UpdateWait is called before forward to the layer
- mshadow-ps does the async trick of parameter communication
- AsyncUpdater will call IUpdater, which does the updating trick
- If update_on_server is on, IUpdater will be created on server-side instead
- 文件命名惯例
- coding guide
- .h files are data structures and interface
- In each folder, there is one .h file that have same name as the folder, this file defines everything needed for other module to use this module
- Interface headers: layer/layer.h, updater/updater.h
- -inl.hpp files are implementations of interface, like cpp file in most project.
- You only need to understand the interface file to understand the usage of that layer
- In each folder, there can be a .cpp file, and .cu file that that compiles the module of that layer
- the .cpp file and .cu file does not contain implementation, but reuse common implementation in file ends with _impl-inl.hpp
分析项目
- automake 工具使用
- 原因是缺少libtool,其实也是缺少aclocal等工具.
- ?但是安装automake时已经自动安装了m4,autoconf.是否可以通过设置 m4_pattern_allow?
configure.ac:16: error: possibly undefined macro: AC_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/bin/autoconf failed with exit status: 1
[ ] 怎么查找错误?
源码阅读
- 源码阅读心得
阅读全文
0 0
- 拆轮子笔记 - OkHttp
- 拆轮子 笔记
- 轮子
- 轮子
- 浅谈源码--“造轮子”与“拆轮子”之间的关系
- 拆轮子系列:拆 OkHttp
- 拆轮子系列:拆 OkHttp
- 拆轮子系列:拆 OkHttp
- 拆轮子系列:拆 RxJava
- 拆轮子系列:拆 RxJava
- 拆轮子系列:拆 OkHttp
- 拆轮子系列:拆 OkHttp
- 拆轮子系列:拆 Retrofit
- 拆轮子之Fish动画分析
- 拆轮子之动态加载DynamicLoadApk
- 拆轮子之热修复框架AndFix
- 拆轮子之动态加载DynamicLoadApk
- 拆轮子之动态加载DynamicLoadApk
- synchronized(class)与synchronized(this)
- java.IO
- Junit —— 单元测试工具基本使用
- 在WinForms程序里实现窗体传值的最佳实践
- 杂谈指针捆绑存储区
- 拆轮子 笔记
- 关于ManyToOne、ManyToMany、OneToOne所对应的表
- js实现轮播图
- Mac homebrew 常用命令
- Codeforces Round #421 (Div. 2) D. Mister B and PR Shifts
- 树状数组求逆序对及离散化
- sqlserver备份还原--备份文件哪去了?为什么还原不了?
- Ubuntua16.04如何安装Django
- 深入浅出|深度学习算法之BP神经网络 详细公式推导