mexca.video.helper_classes

Helper classes for multi-dimensional edge feature-based AU relation graph (MEFARG) learning.

Implementation of building blocks in the MEFARG model from the paper:

Luo, C., Song, S., Xie, W., Shen, L., Gunes, H. (2022). Learning multi-dimentionsal edge feature-based AU relation graph for facial action unit recognition. arXiv. https://arxiv.org/pdf/2205.01782.pdf

Code adapted from the OpenGraphAU code base (licensed under Apache 2.0).

Module Contents

Classes

LinearBlock

Apply transformations of multiple layers including a linear layer.

AUPredictor

Meta class for predicting action unit (AU) activations

class mexca.video.helper_classes.LinearBlock(in_features: int, out_features: int | None = None, drop: float = 0.0)[source]

Apply transformations of multiple layers including a linear layer.

Parameters:
  • in_features (int) – Size of each input sample.

  • out_features (int, optional, default=None) – Size of each output sample. If None, uses in_features.

  • drop (float, default=0.0) – Probability of dropping (zeroing out) input features.

Notes

Applies four transformations:

  • Linear

  • 1D batch normalization

  • ReLU

  • Drop out regularization

Linear layer weights are initialized with \(N(0, \sqrt{\frac{2}{out\_features}})\). Batch norm weights are initialized as 1 and biases as 0.

class mexca.video.helper_classes.AUPredictor(in_features: int, n_main_nodes: int = 27, n_sub_nodes: int = 14)[source]

Meta class for predicting action unit (AU) activations