Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smartpooling #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Smartpooling #7

wants to merge 5 commits into from

Conversation

jdzikowski
Copy link

Initial implementation of smartpooling operation.

fairseq/models/wav2vec/wav2vec2_scribblelens.py Outdated Show resolved Hide resolved
new_lens = new_lens / new_lens.sum(1, keepdim=True) * (features.size(1) / self.smartpooling_factor) # Reducing the original length T by some factor

features, interp_weights = self.warp(features, new_lens)
if padding_mask is not None :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Padding mask oznacza które kolumny są poza danymi, więc paddingu nie skracamy, to co trzeba zrobić to skrócić te cześci unpadded, a potem sprawdzić który jest najdłuższy i spadować resztę.

@jdzikowski jdzikowski force-pushed the jdzikowski/smartpooling branch from c1d6f81 to 2acbd29 Compare December 12, 2020 16:59
@janchorowski
Copy link
Member

Tak na szybko, to to chyba jest OK, natomiast muszę do tego poolingu zrobić jakąś wizualizację żeby zobaczyć jak on działa. To co na pewno chcemy (nie wiem czy tak jest), to żeby pochodna propagowała się do wegtora z nowymi długościami - wyobrażam sobie, że to działa tak, że jak np mamy nowe długości:
1,1,1
i skracamy do dwóch elementów, to
wiemy że nowy element 0 wziął się ze starych 0 i 1 i że jeśli chcilibyśmy tam np. zwiększyć udział starego 0, to musimy zminić wektor długości na 1+eps, 1, 1.
Bez tego, to może się nie uczyć

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants