| 148 | # 3) Projector and SonarLossWrapper |
| 149 | # ------------------------------------------------------------------------ |
| 150 | class Projector(nn.Module): |
| 151 | def __init__(self, in_dim, out_dim): |
| 152 | super().__init__() |
| 153 | self.linear = nn.Linear(in_dim, out_dim) |
| 154 | def forward(self, x): |
| 155 | return self.linear(x) |
| 156 | |
| 157 | class SonarLossWrapper(nn.Module): |
| 158 | def __init__(self, llama_model, forward_proj, reverse_proj, sonar_decoder): |