public class ExternalCheckpointManager extends Object
| 构造器和说明 |
|---|
ExternalCheckpointManager(String checkpointPath, org.apache.hadoop.fs.FileSystem fs)
此构造函数在指定文件系统中的指定路径处创建一个新的外部检查点管理器。
|
| 修饰符和类型 | 方法和说明 |
|---|---|
void |
cleanPath()
此方法清理检查点路径中存在的所有目录和文件。
|
void |
cleanUpHigherVersions(int currentRound)
此方法清理所有高于当前轮次的检查点版本。
|
List<Integer> |
getCheckpointRounds(int firstRound, int checkpointInterval, int numOfRounds)
获取需要检查点的迭代列表。
|
Booster |
loadCheckpointAsBooster()
从检查点路径读取检查点。
|
void |
updateCheckpoint(Booster boosterToCheckpoint)
此方法将助推器检查点更新为最新或当前版本,并删除所有以前版本的检查点。
|
public ExternalCheckpointManager(String checkpointPath, org.apache.hadoop.fs.FileSystem fs) throws XGBoostError
checkpointPath - 检查点将存储的目录路径。fs - 用于存储检查点的文件系统。XGBoostError - 如果检查点路径为 null 或为空,则抛出此错误。public void cleanPath()
throws IOException
IOException - 删除检查点路径时抛出的异常。public Booster loadCheckpointAsBooster() throws IOException, XGBoostError
IOException - 读取检查点路径时发生的任何异常。XGBoostError - 将模型加载到助推器时发生的任何异常。public void updateCheckpoint(Booster boosterToCheckpoint) throws IOException, XGBoostError
boosterToCheckpoint - 要检查点并保存为模型文件的助推器对象。IOException - 将模型文件写入检查点路径时发生的任何异常。XGBoostError - 从助推器保存模型时发生的任何异常。public void cleanUpHigherVersions(int currentRound)
throws IOException
currentRound - 当前训练轮次。IOException - 删除检查点文件时发生的任何异常。public List<Integer> getCheckpointRounds(int firstRound, int checkpointInterval, int numOfRounds) throws IOException
firstRound - 第一次训练轮次。checkpointInterval - 保存检查点的间隔。numOfRounds - 要训练的轮次数。IOException - 获取轮次列表时发生的任何异常。版权所有 © 2025. 保留所有权利。