rge-patch14. This is because the Stable Diffusion pre-training was performed with this CLIP variant. For more details, refer to the documentation.
Next, we prepare a PyTorch nn.Module to compute directional similarity:


	Copied
import torch.nn as nn
import torch.nn.functional as F


class DirectionalSimilarity(nn.Module):
    def __init__(self, tokenizer, text_encoder, image_processor, image_encoder):
        super().__init__()
        self.to