mr2.nn.FiLM
- class mr2.nn.FiLM[source]
-
Feature-wise Linear Modulation.
Feature-wise Linear Modulation from [FiLM] to condition a network on a conditioning tensor.
References
- ..[FiLM] Perez, L., Strub, F., de Vries, H., Dumoulin, V., & Courville, A. “FiLMVisual reasoning with a general
conditioning layer.” AAAI (2018). https://arxiv.org/abs/1709.07871
- __init__(channels: int, cond_dim: int, features_last: bool = False) None[source]
Initialize FiLM.
- Parameters:
channels (
int) – The number of channels in the input tensor.cond_dim (
int) – The dimension of the conditioning tensor.features_last (
bool, default:False) – Whether the features are in the last dimension of the input tensor (e.g. transformer tokens) or in the second dimension (e.g. image tensors).