版本260406
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 批准模型版本命令。
|
||||
/// </summary>
|
||||
public sealed class ApproveModelVersionCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 模型版本ID。
|
||||
/// </summary>
|
||||
public Guid ModelVersionId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 批准意见。
|
||||
/// </summary>
|
||||
public string ApprovalComment { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 批准者。
|
||||
/// </summary>
|
||||
public string ApprovedBy { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 批准级别。
|
||||
/// </summary>
|
||||
public string ApprovalLevel { get; init; } = "Standard";
|
||||
|
||||
/// <summary>
|
||||
/// 是否强制批准(跳过某些检查)。
|
||||
/// </summary>
|
||||
public bool ForceApprove { get; init; } = false;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 构建数据集命令。
|
||||
/// </summary>
|
||||
public sealed class BuildDatasetCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据集名称。
|
||||
/// </summary>
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 数据集描述。
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 机种ID。
|
||||
/// </summary>
|
||||
public Guid ProductTypeId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 标注任务ID列表。
|
||||
/// </summary>
|
||||
public IReadOnlyList<Guid> AnnotationTaskIds { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 训练集比例(0-1)。
|
||||
/// </summary>
|
||||
public decimal TrainingRatio { get; init; } = 0.7m;
|
||||
|
||||
/// <summary>
|
||||
/// 验证集比例(0-1)。
|
||||
/// </summary>
|
||||
public decimal ValidationRatio { get; init; } = 0.2m;
|
||||
|
||||
/// <summary>
|
||||
/// 测试集比例(0-1)。
|
||||
/// </summary>
|
||||
public decimal TestRatio { get; init; } = 0.1m;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用数据增强。
|
||||
/// </summary>
|
||||
public bool EnableDataAugmentation { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 数据增强参数(JSON)。
|
||||
/// </summary>
|
||||
public string DataAugmentationJson { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 最小图像尺寸。
|
||||
/// </summary>
|
||||
public int MinImageSize { get; init; } = 640;
|
||||
|
||||
/// <summary>
|
||||
/// 最大图像尺寸。
|
||||
/// </summary>
|
||||
public int MaxImageSize { get; init; } = 640;
|
||||
|
||||
/// <summary>
|
||||
/// 创建者。
|
||||
/// </summary>
|
||||
public string CreatedBy { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 构建模型包命令。
|
||||
/// </summary>
|
||||
public sealed class BuildModelPackageCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 模型包名称。
|
||||
/// </summary>
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 模型包描述。
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 模型版本ID。
|
||||
/// </summary>
|
||||
public Guid ModelVersionId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 训练任务ID。
|
||||
/// </summary>
|
||||
public Guid TrainingJobId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 机种ID。
|
||||
/// </summary>
|
||||
public Guid ProductTypeId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 模型文件路径。
|
||||
/// </summary>
|
||||
public string ModelFilePath { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 标签映射文件路径。
|
||||
/// </summary>
|
||||
public string LabelMappingPath { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 配置文件路径。
|
||||
/// </summary>
|
||||
public string ConfigPath { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 模型准确率。
|
||||
/// </summary>
|
||||
public decimal Accuracy { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 模型召回率。
|
||||
/// </summary>
|
||||
public decimal Recall { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 模型F1分数。
|
||||
/// </summary>
|
||||
public decimal F1Score { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证集损失。
|
||||
/// </summary>
|
||||
public decimal ValidationLoss { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 兼容性版本。
|
||||
/// </summary>
|
||||
public string CompatibilityVersion { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 依赖项列表(JSON)。
|
||||
/// </summary>
|
||||
public string DependenciesJson { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 创建者。
|
||||
/// </summary>
|
||||
public string CreatedBy { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 取消训练任务命令。
|
||||
/// </summary>
|
||||
public sealed class CancelTrainingJobCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 训练任务ID。
|
||||
/// </summary>
|
||||
public Guid TrainingJobId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 取消原因。
|
||||
/// </summary>
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 操作者。
|
||||
/// </summary>
|
||||
public string Operator { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 导出模型包命令。
|
||||
/// </summary>
|
||||
public sealed class ExportModelPackageCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 模型包ID。
|
||||
/// </summary>
|
||||
public Guid ModelPackageId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式。
|
||||
/// </summary>
|
||||
public string ExportFormat { get; init; } = "ZIP";
|
||||
|
||||
/// <summary>
|
||||
/// 是否包含源代码。
|
||||
/// </summary>
|
||||
public bool IncludeSourceCode { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否包含测试数据。
|
||||
/// </summary>
|
||||
public bool IncludeTestData { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 导出路径。
|
||||
/// </summary>
|
||||
public string? ExportPath { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作者。
|
||||
/// </summary>
|
||||
public string Operator { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 创建运行时部署快照命令。
|
||||
/// </summary>
|
||||
public sealed class CreateRuntimeDeploymentSnapshotCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 快照名称。
|
||||
/// </summary>
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 快照描述。
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 机种ID。
|
||||
/// </summary>
|
||||
public Guid ProductTypeId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 规则版本ID。
|
||||
/// </summary>
|
||||
public Guid RuleVersionId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 模型包版本ID。
|
||||
/// </summary>
|
||||
public Guid ModelPackageVersionId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 运行时参数版本ID。
|
||||
/// </summary>
|
||||
public Guid RuntimeParameterVersionId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者。
|
||||
/// </summary>
|
||||
public string CreatedBy { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 快照元数据(JSON格式)。
|
||||
/// </summary>
|
||||
public string MetadataJson { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 激活运行时部署快照命令。
|
||||
/// </summary>
|
||||
public sealed class ActivateRuntimeDeploymentSnapshotCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 快照ID。
|
||||
/// </summary>
|
||||
public Guid SnapshotId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 激活者。
|
||||
/// </summary>
|
||||
public string ActivatedBy { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 激活原因。
|
||||
/// </summary>
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 回滚到运行时部署快照命令。
|
||||
/// </summary>
|
||||
public sealed class RollbackToRuntimeDeploymentSnapshotCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 目标快照ID。
|
||||
/// </summary>
|
||||
public Guid TargetSnapshotId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 回滚者。
|
||||
/// </summary>
|
||||
public string RolledBackBy { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 回滚原因。
|
||||
/// </summary>
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
namespace OrpaonVision.Core.Training.Contracts.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 提交训练任务命令。
|
||||
/// </summary>
|
||||
public sealed class SubmitTrainingJobCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 训练任务名称。
|
||||
/// </summary>
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 训练任务描述。
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 数据集版本ID。
|
||||
/// </summary>
|
||||
public Guid DatasetVersionId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 训练算法类型。
|
||||
/// </summary>
|
||||
public string AlgorithmType { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 训练参数(JSON)。
|
||||
/// </summary>
|
||||
public string TrainingParametersJson { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 总轮次。
|
||||
/// </summary>
|
||||
public int TotalEpochs { get; init; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 批次大小。
|
||||
/// </summary>
|
||||
public int BatchSize { get; init; } = 16;
|
||||
|
||||
/// <summary>
|
||||
/// 学习率。
|
||||
/// </summary>
|
||||
public decimal LearningRate { get; init; } = 0.001m;
|
||||
|
||||
/// <summary>
|
||||
/// 早停轮次。
|
||||
/// </summary>
|
||||
public int EarlyStoppingPatience { get; init; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 保存间隔轮次。
|
||||
/// </summary>
|
||||
public int SaveIntervalEpochs { get; init; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 验证间隔轮次。
|
||||
/// </summary>
|
||||
public int ValidationIntervalEpochs { get; init; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用混合精度。
|
||||
/// </summary>
|
||||
public bool EnableMixedPrecision { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// GPU设备ID。
|
||||
/// </summary>
|
||||
public int GpuDeviceId { get; init; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 随机种子。
|
||||
/// </summary>
|
||||
public int? RandomSeed { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者。
|
||||
/// </summary>
|
||||
public string CreatedBy { get; init; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user