SiaNet/TrainPredict.cs
/// <summary>
/// Generates output predictions for the input samples.
/// </summary>
/// <param name="x">The input data frame to run prediction.</param>
/// <returns></returns>
Generates output predictions for the input samples.
Generates output predictions for the input samples .
public DataFrame Predict(DataFrame x)
        {
            List<float> predictions = new List<float>();
            Tensor output = x.GetTensor();
            foreach (var layer in Layers)
            {
                if (layer.SkipPred)
                    continue;
                layer.Forward(output);
                output = layer.Output;
            }
            predictions.AddRange(output.ToArray().Cast<float>());
            DataFrame result = new DataFrame();
            result.Load(predictions.ToArray());
            return result;
        }
public DataFrame Predict ( DataFrame x ) { List < float > predictions = new List < float > ( ) ; Tensor output = x . GetTensor ( ) ; foreach ( var layer in Layers ) { if ( layer . SkipPred ) continue ; layer . Forward ( output ) ; output = layer . Output ; } predictions . AddRange ( output . ToArray ( ) . Cast < float > ( ) ) ; DataFrame result = new DataFrame ( ) ; result . Load ( predictions . ToArray ( ) ) ; return result ; }
Generates output predictions for the input samples.
Generates output predictions for the input samples .
None
x
DataFrame
The input data frame to run prediction.
The input data frame to run prediction .