ModelOperationsCatalog 类

定义

用于 MLContext 保存和加载已训练模型的类。

public sealed class ModelOperationsCatalog
type ModelOperationsCatalog = class
Public NotInheritable Class ModelOperationsCatalog
继承
ModelOperationsCatalog

方法

CreatePredictionEngine<TSrc,TDst>(ITransformer, Boolean, SchemaDefinition, SchemaDefinition)

为一次性预测创建预测引擎, (默认使用情况) 。

CreatePredictionEngine<TSrc,TDst>(ITransformer, DataViewSchema)

为一次性预测创建预测引擎。 它主要用于 Load(Stream, DataViewSchema)加载模型期间提取输入架构。

CreatePredictionEngine<TSrc,TDst>(ITransformer, PredictionEngineOptions)

为一次性预测创建预测引擎。 它主要用于 Load(Stream, DataViewSchema)加载模型期间提取输入架构。

Load(Stream, DataViewSchema)

从流加载模型及其输入架构。

Load(String, DataViewSchema)

从文件加载模型及其输入架构。

LoadWithDataLoader(Stream, IDataLoader<IMultiStreamSource>)

从流加载转换器模型和数据加载程序模型。

LoadWithDataLoader(String, IDataLoader<IMultiStreamSource>)

从文件加载转换器模型和数据加载程序模型。

Save(ITransformer, DataViewSchema, Stream)

保存转换器模型以及用于将它训练到流的数据的架构。

Save(ITransformer, DataViewSchema, String)

保存转换器模型以及用于将它训练到文件的数据的架构。

Save<TSource>(ITransformer, IDataLoader<TSource>, Stream)

保存转换器模型以及用于创建其输入数据的加载程序到流。

Save<TSource>(ITransformer, IDataLoader<TSource>, String)

保存转换器模型以及用于创建其输入数据的加载程序到文件。

扩展方法

LoadTensorFlowModel(ModelOperationsCatalog, String)

将 TensorFlow 模型加载到内存中。 这是一种方便的方法,允许加载模型一次,然后使用它来查询架构和使用TensorFlowEstimatorScoreTensorFlowModel(String, String, Boolean)。 使用此 API 需要 TensorFlow redist 上的其他 NuGet 依赖项,有关详细信息,请参阅链接文档。 TensorFlowModel 还保留对非托管资源的引用,这些资源需要通过显式调用 Dispose () 或隐式声明带有“using”语法的变量/>

LoadTensorFlowModel(ModelOperationsCatalog, String, Boolean)

将 TensorFlow 模型加载到内存中。 这是一种方便的方法,允许加载模型一次,然后使用它来查询架构和使用TensorFlowEstimatorScoreTensorFlowModel(String, String, Boolean)。 使用此 API 需要 TensorFlow redist 上的其他 NuGet 依赖项,有关详细信息,请参阅链接文档。 TensorFlowModel 还保留对非托管资源的引用,这些资源需要通过显式调用 Dispose () 或隐式声明带有“using”语法的变量/>

适用于