AIB (Agglomerative Information Bottleneck (AIB)) More...
Go to the source code of this file.
Classes | |
struct | _VlAIB |
Typedefs | |
typedef struct _VlAIB | VlAIB |
Functions | |
VL_INLINE int | vl_aib_get_verbosity (VlAIB const *self) |
Get the verbosity. | |
VL_INLINE void | vl_aib_set_verbosity (VlAIB *self, int verbosity) |
Set the verbosity. | |
Create and destroy | |
VL_EXPORT VlAIB * | vl_aib_new (double *Pcx, vl_uint nvalues, vl_uint nlabels) |
Allocates and initializes the internal data structure. | |
VL_EXPORT void | vl_aib_delete (VlAIB *aib) |
Deletes AIB data structure. | |
Process data | |
VL_EXPORT void | vl_aib_process (VlAIB *aib) |
Runs AIB on Pcx. | |
Retrieve results | |
VL_INLINE vl_uint * | vl_aib_get_parents (VlAIB const *aib) |
Get resulting list of parents. | |
VL_INLINE double * | vl_aib_get_costs (VlAIB const *aib) |
Get a list of merge costs. |
AIB (Agglomerative Information Bottleneck (AIB))
Definition in file aib.h.
VL_EXPORT void vl_aib_delete | ( | VlAIB * | aib | ) |
VL_INLINE double * vl_aib_get_costs | ( | VlAIB const * | aib | ) |
VL_INLINE vl_uint * vl_aib_get_parents | ( | VlAIB const * | aib | ) |
VL_INLINE int vl_aib_get_verbosity | ( | VlAIB const * | self | ) |
VL_EXPORT VlAIB* vl_aib_new | ( | double * | Pcx, |
vl_uint | nvalues, | ||
vl_uint | nlabels | ||
) |
Allocates and initializes the internal data structure.
------------------------------------------------------------------
Pcx | A pointer to a 2D array of probabilities |
nvalues | The number of rows in the array |
nlabels | The number of columns in the array |
Creates a new VlAIB struct containing pointers to all the data that will be used during the AIB process.
Allocates memory for the following:
Since it simply copies to pointer to Pcx, the total additional memory requirement is:
(3*nvalues+nlabels)*sizeof(double) + 4*nvalues*sizeof(vl_uint)
VL_EXPORT void vl_aib_process | ( | VlAIB * | aib | ) |
Runs AIB on Pcx.
------------------------------------------------------------------
aib | AIB object to process |
The function runs Agglomerative Information Bottleneck (AIB) on the joint probability table aib->Pcx which has labels along the columns and feature values along the rows. AIB iteratively merges the two values of the feature x
that causes the smallest decrease in mutual information between the random variables x
and c
.
Merge operations are arranged in a binary tree. The nodes of the tree correspond to the original feature values and any other value obtained as a result of a merge operation. The nodes are indexed in breadth-first order, starting from the leaves. The first index is zero. In this way, the leaves correspond directly to the original feature values. In total there are 2*nvalues-1
nodes.
The results may be accessed through vl_aib_get_parents which returns an array with one element per tree node. Each element is the index the parent node. The root parent is equal to zero. The array has 2*nvalues-1
elements.
Feature values with null probability are ignored by the algorithm and their nodes have parents indexing a non-existent tree node (a value bigger than 2*nvalues-1
).
Then the function will also compute the information level after each merge. vl_get_costs will return a vector with the information level after each merge. cost has nvalues
entries: The first is the value of the cost functional before any merge, and the others are the cost after the nvalues-1
merges.
VL_INLINE void vl_aib_set_verbosity | ( | VlAIB * | self, |
int | verbosity | ||
) |