Neural Network (C API)

typedef struct _EmlNet EmlNet

Neural Network.

Handle used to do inference. Normally the initialization code is generated by emlearn.

EmlError eml_net_predict_proba(EmlNet *model, const float *features, int32_t features_length, float *out, int32_t out_length)

Run inference and return probabilities. Sum of outputs must be approx. 1.

Parameters:
  • model – EmlNet instance

  • features – Input data values

  • features_length – Length of input data

  • out – Buffer to store output

  • out_length – Length of output buffer

Returns:

EmlOk on success, else an error

int32_t eml_net_predict(EmlNet *model, const float *features, int32_t features_length)

Run inference and return most probable class.

Parameters:
  • model – EmlNet instance

  • features – Input data values

  • features_length – Length of input data

Returns:

The class number, or -EmlError on failure