forked from Angel-ML/angel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
89 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
# MLLearner | ||
模型训练接口定义。 | ||
## train | ||
- 定义:```def train(train: DataBlock[LabeledData], vali: DataBlock[LabeledData])``` | ||
|
||
> 模型训练的核心类,理论上,Angel所有模型训练核心逻辑,都应该写在这个类中。通过这个类来实现和调用。它是Train的核心类。 | ||
- 功能描述:使用算法对训练数据进行训练,得到模型 | ||
## 功能 | ||
|
||
* 不断读取DataBlock,训练得到MLModel模型 | ||
|
||
- 参数:train: DataBlock[LabeledData] 训练数据集; vali: DataBlock[LabeledData] 验证数据集 | ||
## 核心接口 | ||
|
||
|
||
- 返回值:训练结果 | ||
1. **train** | ||
- 定义:```def train(train: DataBlock[LabeledData], vali: DataBlock[LabeledData]):MLModel``` | ||
- 功能描述:使用算法对训练数据进行训练,得到模型 | ||
- 参数:train: DataBlock[LabeledData] 训练数据集; vali: DataBlock[LabeledData] 验证数据集 | ||
- 返回值:MLModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,49 @@ | ||
# MLRunner | ||
算法的启动类。它定义了启动Angel app和运行task的接口,需要应用程序根据需要实现这些接口。当然,它在封装了使用 [AngelClient](AngelClient.md)的使用。 | ||
|
||
包括:启动Angel ps,加载和存储模型,和启动task等过程的默认实现。一般情况下,应用程序直接调用它们就可以了。 | ||
> Angel算法的启动入口类。它定义了启动Angel app标准流程,封装了对 [AngelClient](AngelClient.md)的使用。 | ||
## train | ||
- 定义:``` train(conf: Configuration)``` | ||
- 功能描述:启动Angel app训练模型 | ||
- 参数:conf: Configuration Angel任务相关配置和算法配置信息 | ||
- 返回值:无 | ||
## 功能 | ||
|
||
## train(default implementation) | ||
* 启动Angel ps,加载和存储模型,和启动task等过程的默认实现 | ||
* 一般情况下,应用程序直接调用它们就可以了。 | ||
|
||
- **定义**:```train(conf: Configuration, model: MLModel, taskClass: Class[_ <: BaseTask[_, _, _]]): Unit``` | ||
## 核心方法 | ||
|
||
- **功能描述**:启动Angel app训练模型。该方法封装了具体的Angel ps/worker启动以及模型加载/存储过程,子类可直接引用 | ||
- **参数** | ||
* conf: Configuration Angel任务相关配置和算法配置信息 | ||
* model: MLModel 算法模型信息 | ||
* taskClass: Class[_ <: TrainTask[_, _, _]] 表示算法运行过程的Task 类 | ||
* 返回值:无 | ||
1. **train** | ||
- 定义:``` train(conf: Configuration)``` | ||
- 功能描述:启动Angel app训练模型 | ||
- 参数:conf: Configuration Angel任务相关配置和算法配置信息 | ||
- 返回值:无 | ||
|
||
## incTrain | ||
* **定义**:```incTrain(conf: Configuration)``` | ||
- **功能描述**:启动Angel app 并使用增量训练的方式更新一个旧模型 | ||
- **参数** | ||
- conf: Configuration Angel任务相关配置和算法配置信息 | ||
- **返回值**:无 | ||
2. **train(default implementation)** | ||
|
||
## predict | ||
- **定义**:```predict(conf: Configuration)``` | ||
- **定义**: ```train(conf: Configuration, model: MLModel, taskClass: Class[_ <: BaseTask[_, _, _]]): Unit``` | ||
|
||
- **功能描述**:启动Angel app训练模型。该方法封装了具体的Angel ps/worker启动以及模型加载/存储过程,子类可直接引用 | ||
|
||
- **功能描述**:启动Angel app,计算预测结果 | ||
- **参数** | ||
* conf: Configuration Angel任务相关配置和算法配置信息 | ||
* model: MLModel 算法模型信息 | ||
* taskClass: Class[_ <: TrainTask[_, _, _]] 表示算法运行过程的Task 类 | ||
* 返回值:无 | ||
|
||
3. **incTrain** | ||
|
||
- **参数**:conf: Configuration Angel任务相关配置 | ||
* **定义**:```incTrain(conf: Configuration)``` | ||
- **功能描述**:使用增量训练的方式更新一个已有模型 | ||
- **参数:**conf: Configuration Angel任务相关配置和算法配置信息 | ||
- **返回值:**无 | ||
|
||
4. **predict** | ||
|
||
- **返回值**:无 | ||
- **定义**:```predict(conf: Configuration)``` | ||
- **功能描述**:启动Angel app,计算预测结果 | ||
- **参数**:conf: Configuration Angel任务相关配置 | ||
- **返回值**:无 | ||
|
||
## predict(default implementation) | ||
- **定义:**```predict(conf: Configuration, model: MLModel, taskClass: Class[_ <: PredictTask[_, _, _]]): Unit``` | ||
5. **predict(default implementation)** | ||
|
||
|
||
- **功能描述:**启动Angel app 并使用增量训练的方式更新一个旧模型。该方法封装了具体的Angel ps/worker启动以及模型加载/存储过程,子类可直接引用 | ||
|
||
|
||
- **参数:**conf: Configuration Angel任务相关配置 | ||
|
||
|
||
- **返回值:**无 | ||
- **定义:** ```predict(conf: Configuration, model: MLModel, taskClass: Class[_ <: PredictTask[_, _, _]]): Unit``` | ||
- **功能描述:**启动Angel app 并使用增量训练的方式更新一个旧模型。该方法封装了具体的Angel ps/worker启动以及模型加载/存储过程,子类可直接引用 | ||
- **参数:**conf: Configuration Angel任务相关配置 | ||
- **返回值:**无 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 核心接口类 | ||
|
||
--- | ||
|
||
 | ||
|
||
如上图所示,Angel的核心接口类,在Train的过程中,按照调用的顺序,分别为: | ||
|
||
* [MLRunner](MLRunner.md) | ||
* [AngelClient](AngelClient.md) | ||
* [TrainTask](Task.md) | ||
* [DataBlock](DataBlock.md) | ||
* [MLLearner](MLLearner.md) | ||
* [PSModel](PSModel.md) | ||
* [MLModel](MLModel.md) | ||
|
||
了解这些接口类的定义和功能,对于基于Angel实现高性能的机器学习算法,会有不错的帮助。 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.