Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Capsule layer agrregation from the paper "Dynamic Layer Aggregation for Neural Machine Translation with Routing-by-Agreement" | |
class FFL(nn.Module): | |
def __init__(self, inp_dim,output_dim,n_layers=3): | |
super(FFL, self).__init__() | |
self.n_layers=n_layers | |
self.linear_layers=nn.ModuleList() | |
for j in range(self.n_layers-1): | |
self.linear_layers.append(nn.Linear(inp_dim,inp_dim)) | |
self.linear_layers.append(nn.Linear(inp_dim,output_dim)) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.