openspeech-team / openspeech

Open-Source Toolkit for End-to-End Speech Recognition leveraging PyTorch-Lightning and Hydra.
https://openspeech-team.github.io/openspeech/
MIT License
670 stars 112 forks source link

relative_multi_head_attention.py 구현 수정 제안 #176

Closed LEEYOONHYUNG closed 1 year ago

LEEYOONHYUNG commented 1 year ago

❓ Questions & Help

relative_multi_head_attention.py 구현 수정 제안드립니다.

Details

  1. self.sqrt_dim: math.sqrt(dim) -> math.sqrt(d_head)
  2. 현재의 _relative_shift는 relative position difference가 -1인 경우 T만큼 떨어져있다고 계산이 되고 있는 것 같습니다. 좀 더 복잡한 형태의 구현이 필요하지 않을까 생각됩니다. (해당 레포를 참고했는데 구현을 다르게 한 것 같습니다, https://github.com/speechbrain/speechbrain/blob/7897537fe929affa8e809b0229f464acbca7632d/speechbrain/nnet/attention.py#L466)
sooftware commented 1 year ago

네 제보 감사합니다. 시간날 때 한 번 살펴보겠습니다!