Note - x is a sequence, in time-frequency order (i.e., not in time, and not in frequency order), starting with two [cls] tokens. If you don't care sequence, just return after x = (x[:, 0] + x[:, 1]) / 2, else return x before x = (x[:, 0] + x[:, 1]) / 2 and do your desired operation.
Hi there,
I think the best way is to return
x
at this point.https://github.com/YuanGongND/ast/blob/9e3bd9942210680b833b08c39d09f2284ddc4d1d/src/models/ast_models.py#L184
Note -
x
is a sequence, in time-frequency order (i.e., not in time, and not in frequency order), starting with two[cls]
tokens. If you don't care sequence, just return afterx = (x[:, 0] + x[:, 1]) / 2
, else returnx
beforex = (x[:, 0] + x[:, 1]) / 2
and do your desired operation.-Yuan