Filters
Filter values by
Classification process
  • Training - CNN
  • Training - tree ensemble
  • Prediction - CNN or tree ensemble
| Customize Help
| Save Settings

MclassGetHookInfo



Function Map
Synopsis
Get information about a hooked classification object event.
Syntax
MIL_INT MclassGetHookInfo(
MIL_ID EventId, //in
MIL_INT64 InfoType, //in
void *UserVarPtr //out
)
Description

This function retrieves information about the event that caused the hook-handler function to be called. This function should only be called within the scope of a classification object hook-handler function call (see MclassHookFunction()).

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
EventId

Specifies the classification object event identifier received by the hook-handler function. See MclassHookFunction() for more information. The event will be of the type passed to the HookType parameter of the hook-handler function.

InfoType

Specifies the type of information to get.

See the Parameter associations section for possible values that can be specified.

UserVarPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ]
  • array of type MIL_UUID [optionally, in C++: a reference to a std::vector<MIL_UUID> ]
  • MIL_DOUBLE
  • MIL_ID
  • MIL_INT
  • MIL_INT32
  • MIL_INT64
  • MIL_UUID

Specifies the address in which to write the requested information. Note that when getting parameter values, the UserVarPtr parameter should be of the same data type as value of the selected parameter.

See the Parameter associations section for possible values that can be returned.

If the hook-handler function was called due to an M_EPOCH_TRAINED event type on a CNN training context object, the InfoType parameter can be set to one of the values below.

function map For training (CNN) - retrieving information about a trained epoch event
Click to summarize
InfoType
Description
UserVarPtr
- Possible values returned
Click to summarize M_DEV_DATASET_ACCURACY +

Retrieves the accuracy on the development dataset using the trained context obtained at the end of the epoch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize 0.0 <= Value <= 100.0

Specifies the accuracy on the development dataset, as a percentage.

Click to summarize M_DEV_DATASET_CONFUSION_MATRIX +

Retrieves an array that represents the confusion matrix calculated using the development dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ] MORE
Click to summarize M_DEV_DATASET_CONFUSION_MATRIX_SIZE_X +

Retrieves the X-dimension (number of rows) of the confusion matrix calculated using the development dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize Value >= 1

Specifies the number of rows in the confusion matrix.

Click to summarize M_DEV_DATASET_CONFUSION_MATRIX_SIZE_Y +

Retrieves the Y-dimension (number of columns) of the confusion matrix calculated using the development dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize Value >= 1

Specifies the number of columns in the confusion matrix.

Click to summarize M_DEV_DATASET_EPOCH_ERROR_ENTRIES +

Retrieves the array containing the MIL_UUIDs of each image in the development dataset that could not be loaded.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_UUID [optionally, in C++: a reference to a std::vector<MIL_UUID> ] MORE
Click to summarize M_DEV_DATASET_ERROR_RATE

Retrieves the error rate on the development dataset using the trained context obtained at the end of the epoch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize 0.0 <= Value <= 100.0

Specifies the error on the development dataset, as a percentage.

Click to summarize M_DEV_DATASET_USED_ENTRIES +

Retrieves the array that contains the MIL_UUID of each image in the development dataset used during training.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_UUID [optionally, in C++: a reference to a std::vector<MIL_UUID> ] MORE
Click to summarize M_TRAIN_DATASET_ACCURACY

Retrieves the accuracy of the training dataset using the trained context obtained at the end of the epoch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize 0.0 <= Value <= 100.0

Specifies the accuracy of the training dataset, as a percentage.

Click to summarize M_TRAIN_DATASET_CONFUSION_MATRIX +

Retrieves an array that represents the confusion matrix calculated using the training dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ] MORE
Click to summarize M_TRAIN_DATASET_CONFUSION_MATRIX_SIZE_X +

Retrieves the X-dimension (number of rows) of the confusion matrix calculated using the training dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize Value >= 1

Specifies the number of rows in the confusion matrix.

Click to summarize M_TRAIN_DATASET_CONFUSION_MATRIX_SIZE_Y +

Retrieves the Y-dimension (number of columns) of the confusion matrix calculated using the training dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize Value >= 1

Specifies the number of columns in the confusion matrix.

Click to summarize M_TRAIN_DATASET_EPOCH_ERROR_ENTRIES +

Retrieves the array containing the MIL_UUIDs of each image in the training dataset that could not be loaded.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_UUID [optionally, in C++: a reference to a std::vector<MIL_UUID> ] MORE
Click to summarize M_TRAIN_DATASET_ERROR_RATE

Retrieves the error rate of the training dataset using the trained context obtained at the end of the epoch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize 0.0 <= Value <= 100.0

Specifies the error of the training dataset, as a percentage.

Click to summarize M_TRAIN_DATASET_USED_ENTRIES +

Retrieves the array that contains the MIL_UUID of each image in the training dataset used during the training phase.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_UUID [optionally, in C++: a reference to a std::vector<MIL_UUID> ] MORE
Click to summarize M_TRAINED_CNN_PARAMETERS_UPDATED +

Retrieves whether the current CNN parameters are up to date.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_FALSE

Specifies that the current CNN parameters are not up to date.

Click to summarize M_TRUE

Specifies that the current CNN parameters are up to date.

If the hook-handler function was called due to an M_MINI_BATCH_TRAINED event type on a CNN training context object, the InfoType parameter can be set to one of the values below.

function map For training (CNN) - retrieving information about a trained mini-batch event
Click to summarize
InfoType
Description
UserVarPtr
- Possible values returned
Click to summarize M_MINI_BATCH_INDEX +

Retrieves the index of the last mini-batch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_MINI_BATCH_LOSS +

Retrieves the loss at the end of training a mini-batch. You can use the loss to evaluate the lack of confidence (doubt) associated with the training.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE

If the hook-handler function was called due to an M_EPOCH_TRAINED or an M_MINI_BATCH_TRAINED event type on a CNN training context object, the InfoType parameter can be set to one of the values below.

function map For training (CNN) - retrieving information about a trained epoch or mini-batch event
Click to summarize
InfoType
Description
UserVarPtr
- Possible values returned
Click to summarize M_EPOCH_INDEX +

Retrieves the index of the last epoch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_MINI_BATCH_PER_EPOCH +

Retrieves the number of mini-batches per epoch.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE

If the hook-handler function was called due to an M_TREE_TRAINED event type on a tree ensemble training context object, the InfoType parameter can be set to one of the values below.

Note, bagging information is typically unreliable if your training dataset has augmented entries.

function map For training (tree ensemble) - retrieving information about a trained tree event
Click to summarize
InfoType
Description
UserVarPtr
- Possible values returned
Click to summarize M_TREE_DEPTH_ACHIEVED +

Retrieves the tree depth of the current tree. The current tree is equivalent to the last tree added to the tree ensemble.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_TREE_INDEX +

Retrieves the index of the tree being trained.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_TREE_NUMBER_OF_LEAF_NODES_ACHIEVED +

Retrieves the number of leaf nodes of the current tree. The current tree is equivalent to the last tree added to the tree ensemble.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE

If the hook-handler function was called due to an M_EPOCH_TRAINED, M_MINI_BATCH_TRAINED, or M_TREE_TRAINED event type on a training context object, the InfoType parameter can be set to one of the values below. Note, M_EPOCH_TRAINED and M_MINI_BATCH_TRAINED apply when training a CNN classifier, while M_TREE_TRAINED applies when training a tree ensemble classifier.

function map For training (CNN or tree ensemble) - retrieving information about a trained epoch, mini-batch, or tree event
Click to summarize
InfoType
Description
UserVarPtr
- Possible values returned
Click to summarize M_DEV_DATASET_ID +

Retrieves the identifier of the development dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_ID
Click to summarize M_RESULT_ID +

Retrieves the identifier of the result context.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_ID
Click to summarize M_TRAIN_CONTEXT_ID +

Retrieves the identifier of the training context.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_ID
Click to summarize M_TRAIN_DATASET_ID +

Retrieves the identifier of the training dataset.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_ID

If the hook-handler function was called due to an M_PREDICT_ENTRY event type on a trained CNN or tree ensemble classifier context object used to predict dataset entries (MclassPredict() with ContextClassId), the InfoType parameter can be set to one of the values below.

function map For prediction (CNN or tree ensemble) - retrieving information about a predict entry event
Click to summarize
InfoType
Description
UserVarPtr
- Possible values returned
Click to summarize M_BEST_CLASS_INDEX +

Retrieves the index of the class with the highest score, for the last entry being predicted.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_ENTRY_KEY

Retrieves the key of the last entry being predicted.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_UUID
Click to summarize M_INPUT_DATASET_ID +

Retrieves the identifier of the dataset whose entries get predicted (MclassPredict() with TargetMilObjectId).

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_NUMBER_OF_ENTRIES_IN_ERROR +

Retrieves the current number of entries that could not be predicted.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_NUMBER_OF_PREDICTED_ENTRIES +

Retrieves the current number of entries that were predicted.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_OUTPUT_DATASET_ID +

Retrieves the identifier of the dataset in which the entries and their predictions are written (MclassPredict() with DatasetContextOrResultClassId).

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_PREDICT_CONTEXT_ID +

Retrieves the identifier of the trained classifier context used to predict dataset entries (MclassPredict() with ContextClassId).

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_PREDICT_SCORE +

Retrieves the highest class score of the last entry being predicted.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize M_PREDICT_SCORE_AVERAGE +

Retrieves the average prediction score of the predicted entries.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize M_PREDICT_SCORE_MAX +

Retrieves the maximum prediction score of the predicted entries.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize M_PREDICT_SCORE_MIN +

Retrieves the minimum prediction score of predicted entries.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize M_STATUS +

Retrieves the status of the last predicted entry.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_COMPLETE

Specifies that the prediction completed.

Click to summarize M_IMAGE_FILE_NOT_FOUND

Specifies that the image entry is missing. This only applies to predefined CNNs.

(summarize)
Click to summarize M_INTERNAL_ERROR

Specifies that an internal error occurred during the current entry predict.

Click to summarize M_INVALID_NUMBER_OF_FEATURES

Specifies that the entry has an invalid number of features. This only applies to tree ensembles.

(summarize)

You can add the following value to the above-mentioned values to determine the required number of elements in the array (array size).

function map For determining the required number of elements in the array (array size)
Click to summarizeInfoType combination value Description
UserVarPtr
- Possible values returned
Click to summarize M_NB_ELEMENTS

Retrieves the required array size (number of elements) to store the returned values.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE

You can add one of the following values to the above-mentioned values to cast the requested information to a required data type.

function map For specifying the data type
Click to summarizeInfoType Description
UserVarPtr
- Possible values returned
Click to summarize M_TYPE_MIL_DOUBLE

Casts the requested information to a MIL_DOUBLE.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize M_TYPE_MIL_ID

Casts the requested information to a MIL_ID.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_ID
Click to summarize M_TYPE_MIL_INT

Casts the requested information to a MIL_INT.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_INT
Click to summarize M_TYPE_MIL_INT32

Casts the requested information to a MIL_INT32.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_INT32
Click to summarize M_TYPE_MIL_INT64

Casts the requested information to a MIL_INT64.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_INT64
Return value
The returned value is M_NULL if successful. If the operation fails, a non-null (!M_NULL) value is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milclass.lib.
DLL Requires mil.dll; milclass.dll.
DEV DATASET ACCURACY DEV DATASET CONFUSION MATRIX DEV DATASET CONFUSION MATRIX SIZE X DEV DATASET CONFUSION MATRIX SIZE Y DEV DATASET EPOCH ERROR ENTRIES DEV DATASET ERROR RATE DEV DATASET USED ENTRIES TRAIN DATASET ACCURACY TRAIN DATASET CONFUSION MATRIX TRAIN DATASET CONFUSION MATRIX SIZE X TRAIN DATASET CONFUSION MATRIX SIZE Y TRAIN DATASET EPOCH ERROR ENTRIES TRAIN DATASET ERROR RATE TRAIN DATASET USED ENTRIES TRAINED CNN PARAMETERS UPDATED FALSE TRUE MINI BATCH INDEX MINI BATCH LOSS EPOCH INDEX MINI BATCH PER EPOCH TREE DEPTH ACHIEVED TREE INDEX TREE NUMBER OF LEAF NODES ACHIEVED DEV DATASET ID RESULT ID TRAIN CONTEXT ID TRAIN DATASET ID BEST CLASS INDEX ENTRY KEY INPUT DATASET ID NUMBER OF ENTRIES IN ERROR NUMBER OF PREDICTED ENTRIES OUTPUT DATASET ID PREDICT CONTEXT ID PREDICT SCORE PREDICT SCORE AVERAGE PREDICT SCORE MAX PREDICT SCORE MIN STATUS COMPLETE IMAGE FILE NOT FOUND INTERNAL ERROR INVALID NUMBER OF FEATURES NB ELEMENTS TYPE MIL DOUBLE TYPE MIL ID TYPE MIL INT TYPE MIL INT32 TYPE MIL INT64