(
self,
hidden_states: torch.Tensor, # [n_hidden_states, D]
)
| 709 | return samples |
| 710 | |
| 711 | def compute_logits( |
| 712 | self, |
| 713 | hidden_states: torch.Tensor, # [n_hidden_states, D] |
| 714 | ) -> torch.Tensor: |
| 715 | h_p = hidden_states @ self.rand_mat # [n_hidden_states, k] |
| 716 | return h_p @ self.w_p.T # [n_hidden_states, V] |
| 717 | |
| 718 | def rrt(self) -> torch.Tensor: |
| 719 | """Return R @ Rᵀ, which should be close to the identity matrix.""" |
no outgoing calls