LearningModelBindingPreview 类

定义

已弃用。 表示模型输入与变量实例之间的关联。

public ref class LearningModelBindingPreview sealed : IIterable<IKeyValuePair<Platform::String ^, Platform::Object ^> ^>, IMapView<Platform::String ^, Platform::Object ^>
/// [Windows.Foundation.Metadata.Activatable(Windows.AI.MachineLearning.Preview.ILearningModelBindingPreviewFactory, 65536, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract, 65536)]
class LearningModelBindingPreview final : IIterable<IKeyValuePair<winrt::hstring, IInspectable const&>>, IMapView<winrt::hstring, IInspectable const&>
/// [Windows.Foundation.Metadata.Activatable(Windows.AI.MachineLearning.Preview.ILearningModelBindingPreviewFactory, 65536, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("Use LearningModelBinding instead of LearningModelBindingPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
class LearningModelBindingPreview final : IIterable<IKeyValuePair<winrt::hstring, IInspectable const&>>, IMapView<winrt::hstring, IInspectable const&>
[Windows.Foundation.Metadata.Activatable(typeof(Windows.AI.MachineLearning.Preview.ILearningModelBindingPreviewFactory), 65536, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
public sealed class LearningModelBindingPreview : IEnumerable<KeyValuePair<string,object>>, IReadOnlyDictionary<string,object>
[Windows.Foundation.Metadata.Activatable(typeof(Windows.AI.MachineLearning.Preview.ILearningModelBindingPreviewFactory), 65536, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("Use LearningModelBinding instead of LearningModelBindingPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public sealed class LearningModelBindingPreview : IEnumerable<KeyValuePair<string,object>>, IReadOnlyDictionary<string,object>
function LearningModelBindingPreview(model)
Public NotInheritable Class LearningModelBindingPreview
Implements IEnumerable(Of KeyValuePair(Of String, Object)), IReadOnlyDictionary(Of String, Object)
继承
Object Platform::Object IInspectable LearningModelBindingPreview
属性
实现
IIterable<IKeyValuePair<K,V>> IEnumerable<KeyValuePair<K,V>> IIterable<IKeyValuePair<String,Object>> IEnumerable<KeyValuePair<String,Object>> IIterable<IKeyValuePair<Platform::String,Platform::Object>> IIterable<IKeyValuePair<winrt::hstring,IInspectable>> IMapView<String,Object> IReadOnlyDictionary<String,Object> IMapView<Platform::String,Platform::Object> IMapView<winrt::hstring,IInspectable>

Windows 要求

设备系列
Windows 10, version 1803 (在 10.0.17134.0 中引入)
API contract
Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract (在 v1.0 中引入)

示例

public void PrepareBinding(LearningModelPreview model, VideoFrame picture)
{
	ImageVariableDescriptorPreview inputImageDescription;
	List<ILearningModelVariableDescriptorPreview> inputFeatures = model.Description.InputFeatures.ToList();

    inputImageDescription =
         inputFeatures.FirstOrDefault(feature => feature.ModelFeatureKind == LearningModelFeatureKindPreview.Image)
         as ImageVariableDescriptorPreview;

    // Bind the image
    var binding = new LearningModelBindingPreview(model);
    binding.Bind(inputImageDescription, picture);
}

注解

警告

这是一个已弃用的 API。 请改用 Windows.AI.MachineLearning 命名空间。

构造函数

LearningModelBindingPreview(LearningModelPreview)

已弃用。 从指定的 LearningModelSession 创建 LearningModelBinding

属性

Size

已弃用。 获取映射中的元素数。

方法

Bind(String, Object)

已弃用。 将单个输入或输出功能绑定到定义的变量。

Bind(String, Object, IPropertySet)

已弃用。 使用指定的元数据将单个输入或输出功能绑定到定义的变量。

Clear()

已弃用。 清除所有绑定变量。

First()

已弃用。 返回初始化为映射视图中第一个元素的迭代器。

HasKey(String)

已弃用。 确定地图视图是否包含指定的键。

Lookup(String)

已弃用。 返回地图视图中指定键处的项。

Split(IMapView<String,Object>, IMapView<String,Object>)

已弃用。 将地图视图拆分为两个视图。

适用于