simplifying the model

This commit is contained in:
Alejandro Moreo Fernandez 2020-05-13 15:46:11 +02:00
parent b22060fbdc
commit a35f4e76df
2 changed files with 6 additions and 1 deletions

View File

@ -81,6 +81,8 @@ def main(opt):
phi, num_authors=A.size, pad_index=pad_index, pad_length=opt.pad, device=device
)
print(cls)
if opt.name == 'auto':
method = f'{phi.__class__.__name__}_alpha{opt.alpha}'
else:

View File

@ -13,8 +13,11 @@ class AuthorshipAttributionClassifier(nn.Module):
def __init__(self, projector, num_authors, pad_index, pad_length=500, device='cpu'):
super(AuthorshipAttributionClassifier, self).__init__()
self.projector = projector.to(device)
#self.ff = FFProjection(input_size=projector.space_dimensions(),
# hidden_sizes=[1024],
# output_size=num_authors).to(device)
self.ff = FFProjection(input_size=projector.space_dimensions(),
hidden_sizes=[1024],
hidden_sizes=[],
output_size=num_authors).to(device)
self.padder = Padding(pad_index=pad_index, max_length=pad_length, dynamic=True, pad_at_end=False, device=device)
self.device = device