code: def init_losses(self):
      loss_configs = self.config.get("losses", {})
      for loss_name, loss_config in loss_configs.items():
          self.losses[loss_name] = MMFLoss(loss_config)
  
imports: import collections.abc
  import logging
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.models.transformers.heads.utils import build_heads_dict
  from mmf.modules.encoders import TransformerEncoder, ViTEncoder
  from mmf.modules.losses import MMFLoss
  from mmf.utils.build import build_encoder
  from mmf.utils.modeling import get_bert_configured_parameters
  from omegaconf import MISSING, OmegaConf
  from torch import nn, Tensor
label_desc: Use image node_id 3 for calling the ViLT obj's underlying member method code with example usage: obj.init_losses() without return types