Share via


LearningModelBindingPreview Class

Definition

Deprecated. Represents the associations between model inputs and variable instances.

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)
Inheritance
Object Platform::Object IInspectable LearningModelBindingPreview
Attributes
Implements
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 requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract (introduced in v1.0)

Examples

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);
}

Remarks

Warning

This is a deprecated API. Please use the Windows.AI.MachineLearning namespace instead.

Constructors

LearningModelBindingPreview(LearningModelPreview)

Deprecated. Creates a LearningModelBinding from the specified LearningModelSession.

Properties

Size

Deprecated. Gets the number of elements in the map.

Methods

Bind(String, Object, IPropertySet)

Deprecated. Binds a single input or output feature to a defined variable, with specified metadata.

Bind(String, Object)

Deprecated. Binds a single input or output feature to a defined variable.

Clear()

Deprecated. Clears all bound variables.

First()

Deprecated. Returns an iterator that is initialized to the first element in the map view.

HasKey(String)

Deprecated. Determines whether the map view contains the specified key.

Lookup(String)

Deprecated. Returns the item at the specified key in the map view.

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

Deprecated. Splits the map view into two views.

Applies to