(dists, knn_log_probs, lm_log_probs, lmbda)
| 233 | |
| 234 | @staticmethod |
| 235 | def interpolate(dists, knn_log_probs, lm_log_probs, lmbda): |
| 236 | interpolated = torch.logaddexp( |
| 237 | lm_log_probs + np.log(1 - lmbda), |
| 238 | knn_log_probs + np.log(lmbda)) |
| 239 | |
| 240 | return interpolated |
| 241 | |
| 242 | @staticmethod |
| 243 | def get_model_last_layer(model_type): |