roberta custom head test4

This commit is contained in:
s444501 2023-02-12 19:48:23 +01:00
parent d24d515841
commit bca5d1f177

View File

@ -18,9 +18,8 @@ class RobertaLeakyHead(nn.Module):
hidden_size *= 2 hidden_size *= 2
self.dense_1 = nn.Linear(hidden_size, 2 * hidden_size) self.dense_1 = nn.Linear(hidden_size, 2 * hidden_size)
self.dense_2 = nn.Linear(2 * hidden_size, 4 * hidden_size) self.dense_2 = nn.Linear(2 * hidden_size, 2 * hidden_size)
self.dense_3 = nn.Linear(4 * hidden_size, 2 * hidden_size) self.dense_3 = nn.Linear(2 * hidden_size, hidden_size)
self.dense_4 = nn.Linear(2 * hidden_size, hidden_size)
classifier_dropout = ( classifier_dropout = (
config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
) )
@ -65,10 +64,6 @@ class RobertaLeakyHead(nn.Module):
x = self.leaky_relu(x) x = self.leaky_relu(x)
x = self.dropout(x) x = self.dropout(x)
x = self.dense_4(x)
x = self.leaky_relu(x)
x = self.dropout(x)
x = self.out_proj(x) x = self.out_proj(x)
return x return x