Network Module

fairlib.src.networks.__init__

fairlib.src.networks.classifier

class fairlib.src.networks.classifier.BERTClassifier(args)
forward(input_data, group_label=None)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

freeze_roberta_layers(number_of_layers)

number of layers: the first number of layers to be freezed

class fairlib.src.networks.classifier.MLP(args)
forward(input_data, group_label=None)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

fairlib.src.networks.augmentation_layer

class fairlib.src.networks.augmentation_layer.Augmentation_layer(mapping, num_component, device, sample_component)
forward(input_data, group_label)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

fairlib.src.networks.utils

class fairlib.src.networks.utils.BaseModel
zero_cls_grad()

Clears the gradients of cls layers