class_docstr: Predictor for the I-JEPA model [0].
  
  Experimental: Support for I-JEPA is experimental, there might be breaking changes
  in the future.
  
  Predict patch embeddings. Code inspired by [1].
  
  - [0]: Joint-Embedding Predictive Architecture, 2023, https://arxiv.org/abs/2301.08243
  - [1]: https://github.com/facebookresearch/ijepa
  
  Attributes:
      seq_length:
          Token sequence length, including the class token.
      num_layers:
          Number of transformer blocks.
      num_heads:
          Number of attention heads.
      hidden_dim:
          Dimension of the input and output tokens.
      predictor_embed_dim:
          Dimension of inner predicted tokens
      mlp_dim:
          Dimension of the MLP in the transformer block.
      dropout:
          Percentage of elements set to zero after the MLP in the transformer.
      attention_dropout:
          Percentage of elements set to zero after the attention head.
class_docstr_tok: ["Predictor","for","the","I-JEPA","model","[","0","]",".","Experimental",":","Support","for","I-JEPA","is","experimental",",","there","might","be","breaking","changes","in","the","future",".","Predict","patch","embeddings",".","Code","inspired","by","[","1","]",".","-","[","0","]",":","Joint-Embedding","Predictive","Architecture",",","2023",",","https",":","\/\/arxiv.org\/abs\/2301.08243","-","[","1","]",":","https",":","\/\/github.com\/facebookresearch\/ijepa","Attributes",":","seq_length",":","Token","sequence","length",",","including","the","class","token",".","num_layers",":","Number","of","transformer","blocks",".","num_heads",":","Number","of","attention","heads",".","hidden_dim",":","Dimension","of","the","input","and","output","tokens",".","predictor_embed_dim",":","Dimension","of","inner","predicted","tokens","mlp_dim",":","Dimension","of","the","MLP","in","the","transformer","block",".","dropout",":","Percentage","of","elements","set","to","zero","after","the","MLP","in","the","transformer",".","attention_dropout",":","Percentage","of","elements","set","to","zero","after","the","attention","head","."]
code: def __init__(
      self,
      seq_length: int,
      num_layers: int,
      num_heads: int,
      hidden_dim: int,
      predictor_embed_dim: int,
      num_patches: int,
      mlp_dim: int,
      dropout: float,
      attention_dropout: float,
      norm_layer: Callable[..., torch.nn.Module] = partial(
          nn.LayerNorm, eps=1e-6
      ),
      **kwargs,
  ):
      super().__init__(
          seq_length=seq_length,
          num_layers=num_layers,
          num_heads=num_heads,
          hidden_dim=hidden_dim,
          mlp_dim=mlp_dim,
          dropout=dropout,
          attention_dropout=attention_dropout,
          norm_layer=norm_layer,
      )
      self.predictor_embed = nn.Linear(
          mlp_dim, predictor_embed_dim, bias=True
      )
      self.mask_token = nn.Parameter(
          torch.zeros(1, 1, predictor_embed_dim)
      )
      self.predictor_proj = nn.Linear(
          predictor_embed_dim, mlp_dim, bias=True
      )
      self.predictor_pos_embed = nn.Parameter(
          torch.zeros(1, num_patches, predictor_embed_dim),
          requires_grad=False,
      )
      predictor_pos_embed = utils.get_2d_sincos_pos_embed(
          self.predictor_pos_embed.shape[-1],
          int(num_patches**0.5),
          cls_token=False,
      )
      self.predictor_pos_embed.data.copy_(
          torch.from_numpy(predictor_pos_embed).float().unsqueeze(0)
      )
  
imports: import math
  from functools import partial
  from typing import Callable, List, Optional
  import numpy
  import torch
  import torch.nn
  from torchvision.models import vision_transformer
  from torchvision.models.vision_transformer import ConvStemConfig
  from lightly.models import utils
label_desc: Use image node_id 1 to create a new IJEPAPredictor object from inherited base classes: vision_transformer with example: obj = IJEPAPredictor(seq_length, num_layers, num_heads, hidden_dim, predictor_embed_dim, num_patches, mlp_dim, dropout, attention_dropout, norm_layer)