class_docstr: ## ConvMixer
  
  This combines the patch embeddings block, a number of ConvMixer layers and a classification head.
class_docstr_tok: ["#","#","ConvMixer","This","combines","the","patch","embeddings","block",",","a","number","of","ConvMixer","layers","and","a","classification","head","."]
docstr: * `conv_mixer_layer` is a copy of a single [ConvMixer layer](#ConvMixerLayer).
   We make copies of it to make ConvMixer with `n_layers`.
  * `n_layers` is the number of ConvMixer layers (or depth), $d$.
  * `patch_emb` is the [patch embeddings layer](#PatchEmbeddings).
  * `classification` is the [classification head](#ClassificationHead).
docstr_tok: ["*","`","conv_mixer_layer","`","is","a","copy","of","a","single","[","ConvMixer","layer","]","(","#","ConvMixerLayer",")",".","We","make","copies","of","it","to","make","ConvMixer","with","`","n_layers","`",".","*","`","n_layers","`","is","the","number","of","ConvMixer","layers","(","or","depth",")",",","$","d","$",".","*","`","patch_emb","`","is","the","[","patch","embeddings","layer","]","(","#","PatchEmbeddings",")",".","*","`","classification","`","is","the","[","classification","head","]","(","#","ClassificationHead",")","."]
code: def __init__(
      self,
      conv_mixer_layer: ConvMixerLayer,
      n_layers: int,
      patch_emb: PatchEmbeddings,
      classification: ClassificationHead,
  ):
      """
      * `conv_mixer_layer` is a copy of a single [ConvMixer layer](#ConvMixerLayer).
       We make copies of it to make ConvMixer with `n_layers`.
      * `n_layers` is the number of ConvMixer layers (or depth), $d$.
      * `patch_emb` is the [patch embeddings layer](#PatchEmbeddings).
      * `classification` is the [classification head](#ClassificationHead).
      """
      super().__init__()
      # Patch embeddings
      self.patch_emb = patch_emb
      # Classification head
      self.classification = classification
      # Make copies of the [ConvMixer layer](#ConvMixerLayer)
      self.conv_mixer_layers = clone_module_list(
          conv_mixer_layer, n_layers
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/conv_mixer/__init__.py
imports: import torch
  from torch import nn
  from labml_helpers.module import Module
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 1 to create a new ConvMixer object from inherited base classes: Module with example: obj = ConvMixer(conv_mixer_layer, n_layers, patch_emb, classification)