(D)
| 82 | return x |
| 83 | |
| 84 | def rbf(D): |
| 85 | # Distance radial basis function |
| 86 | D_min, D_max, D_count = 0., 20., 36 |
| 87 | D_mu = torch.linspace(D_min, D_max, D_count).to(D.device) |
| 88 | D_mu = D_mu[None,:] |
| 89 | D_sigma = (D_max - D_min) / D_count |
| 90 | D_expand = torch.unsqueeze(D, -1) |
| 91 | RBF = torch.exp(-((D_expand - D_mu) / D_sigma)**2) |
| 92 | return RBF |
| 93 | |
| 94 | def get_seqsep(idx): |
| 95 | ''' |