caffe 回调函数分析
2015-08-24 15:33
316 查看
20150824 caffe 中增加回调函数, 在上一篇介绍回调函数的基础上, 这里重点分析caffe中的回调函数
主要涉及 程序为, solver.hpp 定义和解释回调函数
caffe.cpp caffe入口函数, 设置信号类型, 三种不同类型, 所有会产生三种回调函数
定义信号句柄, 其实就是对象的指针
solver.cpp 回调函数 具体使用
作用: 当运行程序过程中 ,出现中断时, 能够保存当前的模型。
下面这段是官方解释
Add signal handler and early exit/snapshot to Solver.
Add signal handler and early exit/snapshot to Solver.
Add signal handler and early exit/snapshot to Solver.
Also check for exit and snapshot when testing.
Skip running test after early exit.
Fix more lint.
Rebase on master.
Finish rebase on master.
Fixups per review comments.
Redress review comments.
Lint.
Correct error message wording.、
Correct error message wording.、
这一次入口函数变化比较大,Add signal handler and early exit/snapshot to Solver. 使用了函数句柄的形式,这个方式 和win32
句柄有点像。可以学习这种用法。
caffe 入口函数初发生了变化,
增加
/**
* @brief Enumeration of actions that a client of the Solver may request by
* implementing the Solver's action request function, which a
* a client may optionally provide in order to request early termination
* or saving a snapshot without exiting. In the executable caffe, this
* mechanism is used to allow the snapshot to be saved when stopping
* execution with a SIGINT (Ctrl-C).
*/
namespace SolverAction {
enum Enum {
NONE = 0, // Take no special action.
STOP = 1, // Stop training. snapshot_after_train controls whether a
// snapshot is created.
SNAPSHOT = 2 // Take a snapshot, and keep training.
};
}
/**
* @brief Type of a function that returns a Solver Action enumeration.
*/
typedef boost::function<SolverAction::Enum()> ActionCallback;
主要涉及 程序为, solver.hpp 定义和解释回调函数
caffe.cpp caffe入口函数, 设置信号类型, 三种不同类型, 所有会产生三种回调函数
定义信号句柄, 其实就是对象的指针
solver.cpp 回调函数 具体使用
作用: 当运行程序过程中 ,出现中断时, 能够保存当前的模型。
下面这段是官方解释
Add signal handler and early exit/snapshot to Solver.
Add signal handler and early exit/snapshot to Solver.
Add signal handler and early exit/snapshot to Solver.
Also check for exit and snapshot when testing.
Skip running test after early exit.
Fix more lint.
Rebase on master.
Finish rebase on master.
Fixups per review comments.
Redress review comments.
Lint.
Correct error message wording.、
Correct error message wording.、
这一次入口函数变化比较大,Add signal handler and early exit/snapshot to Solver. 使用了函数句柄的形式,这个方式 和win32
句柄有点像。可以学习这种用法。
caffe 入口函数初发生了变化,
增加
/**
* @brief Enumeration of actions that a client of the Solver may request by
* implementing the Solver's action request function, which a
* a client may optionally provide in order to request early termination
* or saving a snapshot without exiting. In the executable caffe, this
* mechanism is used to allow the snapshot to be saved when stopping
* execution with a SIGINT (Ctrl-C).
*/
namespace SolverAction {
enum Enum {
NONE = 0, // Take no special action.
STOP = 1, // Stop training. snapshot_after_train controls whether a
// snapshot is created.
SNAPSHOT = 2 // Take a snapshot, and keep training.
};
}
/**
* @brief Type of a function that returns a Solver Action enumeration.
*/
typedef boost::function<SolverAction::Enum()> ActionCallback;
相关文章推荐
- jQuery超酷平面式时钟效果代码分享
- JQuery(二)——简单动画效果
- 在网页上打印,js window.print
- BZOJ 2208: [Jsoi2010]连通数 tarjan bitset
- JS中<img><a>获取绝对路径
- an upstream response is buffered to a temporary file
- 23、Javascript DOM
- jquery无法设置checkbox选中即没有变成选中状态
- 同页面多记录JS倒计时器
- CSS 字体代码
- c++回调函数, caffe新版本新用法
- ReactiveCocoa与Functional Reactive Programming
- CSS中的绝对定位与相对定位
- 你知道用AngularJs怎么定义指令吗?
- jquery实现可横向和竖向展开的动态下滑菜单效果
- jQuery插件手把手教会(一)
- jQuery学习笔记--jQuery Ajax
- 用innerHTML暴力操作节点
- 不使用Sencha Cmd,创建EXT-JS应用
- jQuery支持添加事件的日历特效代码分享(3种样式)