PatchMerging constructor

PatchMerging({
  1. required int inDim,
})

Implementation

PatchMerging({
  required this.inDim,
})  : outDim = 2 * inDim, // Typically doubles the dimension
      // A 2x2 window means 4 patches are merged, so the input to proj is 4 * inDim
      projection = Layer.fromNeurons(4 * inDim, 2 * inDim),
      norm = LayerNorm(4 * inDim);