You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could please someone provide an explanation for the necessity of the SequenceWise operation?
Additionally, if possible, could explain how this operation is similar to TimeDistributedlayer from Keras, as discussed in this thread?
classSequenceWise(nn.Module):
def__init__(self, module):
""" Collapses input of dim T*N*H to (T*N)*H, and applies to a module. Allows handling of variable sequence lengths and minibatch sizes. :param module: Module to apply input to. """super(SequenceWise, self).__init__()
self.module=moduledefforward(self, x):
t, n=x.size(0), x.size(1)
x=x.view(t*n, -1)
x=self.module(x)
x=x.view(t, n, -1)
returnxdef__repr__(self):
tmpstr=self.__class__.__name__+' (\n'tmpstr+=self.module.__repr__()
tmpstr+=')'returntmpstr
The text was updated successfully, but these errors were encountered:
Hi there,
Could please someone provide an explanation for the necessity of the
SequenceWise
operation?Additionally, if possible, could explain how this operation is similar to
TimeDistributed
layer from Keras, as discussed in this thread?The text was updated successfully, but these errors were encountered: