Helper method returning the tuple of coordinates corresponding to a step. Parameters ---------- step : int Step. Returns ------- coords : numpy.array of shape (2, batch_size,) of int Coordinates, 0th array in batch dim
(self, step)
| 708 | return np.tile(batch_vect, (self.max_time_step, 1)).transpose() # (batch_size, max_time_step,) of ? |
| 709 | |
| 710 | def coords_of_step (self, step): |
| 711 | """ |
| 712 | Helper method returning the tuple of coordinates corresponding to a step. |
| 713 | Parameters |
| 714 | ---------- |
| 715 | step : int |
| 716 | Step. |
| 717 | Returns |
| 718 | ------- |
| 719 | coords : numpy.array of shape (2, batch_size,) of int |
| 720 | Coordinates, 0th array in batch dim and 1th array in time dim. |
| 721 | """ |
| 722 | coords = np.stack(( # (2, batch_size,) of int |
| 723 | self.tokens.pos_batch [:, step], # batch dim coord |
| 724 | self.tokens.pos [:, step], # time dim coord |
| 725 | ), axis=0) |
| 726 | return coords |
| 727 | |
| 728 | # ----------------------------------------------------------------------------------------------------------------- |
| 729 | # -------------------------------------------- UTILS : TOKEN MANAGEMENT ------------------------------------------- |
no outgoing calls