The training of AttentiveMatcher is performed on pairs of input, \(A\)  and \(B\) ,
to predict whether they belong to the same class or not.
The architecture of the model is illustrated in Fig. REF a. We use a convolutional network to embed the input images, obtaining a grid of \(16 \times 16\)  super-pixels, which we treat as 256 features. Similar to the hybrid model in [1]} we use these features as inputs to the Transformer layers.
First, we separately perform self-attention on the features coming from the two images. Next, we perform cross-attention between the features in the two inputs. We apply the above sequence of attention operations twice, in order for information in each feature to propagate across both inputs.
