LearningModel.OutputFeatures Propiedad

Definición

Una lista de las características de salida del modelo.

public:
 property IVectorView<ILearningModelFeatureDescriptor ^> ^ OutputFeatures { IVectorView<ILearningModelFeatureDescriptor ^> ^ get(); };
IVectorView<ILearningModelFeatureDescriptor> OutputFeatures();
public IReadOnlyList<ILearningModelFeatureDescriptor> OutputFeatures { get; }
var iVectorView = learningModel.outputFeatures;
Public ReadOnly Property OutputFeatures As IReadOnlyList(Of ILearningModelFeatureDescriptor)

Valor de propiedad

Una lista de las características de salida del modelo.

Ejemplos

En el ejemplo siguiente se carga el modelo, se crea una sesión de evaluación con el modelo y se obtienen las características de entrada y salida del modelo.

private async Task LoadModelAsync(string _modelFileName)
{
    LearningModel _model;
    LearningModelSession _session;
    ImageFeatureDescriptor _inputImageDescription;
    TensorFeatureDescriptor _outputImageDescription;

    try
    {
        // Load and create the model
        var modelFile = 
            await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/{_modelFileName}"));
        _model = await LearningModel.LoadFromStorageFileAsync(modelFile);

        // Create the evaluation session with the model
        _session = new LearningModelSession(_model);

        //Get input and output features of the model
        List<ILearningModelFeatureDescriptor> inputFeatures = _model.InputFeatures.ToList();
        List<ILearningModelFeatureDescriptor> outputFeatures = _model.OutputFeatures.ToList();

        // Retrieve the first input feature which is an image
        _inputImageDescription = inputFeatures.FirstOrDefault(
            feature => feature.Kind == LearningModelFeatureKind.Image) as ImageFeatureDescriptor;

        // Retrieve the first output feature which is a tensor
        _outputImageDescription = outputFeatures.FirstOrDefault(
            feature => feature.Kind == LearningModelFeatureKind.Tensor) as TensorFeatureDescriptor;
    }
    catch (Exception ex)
    {
        StatusBlock.Text = $"error: {ex.Message}";
        _model = null;
    }
}

Comentarios

Windows Server

Para usar esta API en Windows Server, debe usar Windows Server 2019 con Experiencia de escritorio.

Seguridad para subprocesos

Esta API es segura para subprocesos.

Se aplica a