Skip to content

Commit

Permalink
Keep dropout on during inference
Browse files Browse the repository at this point in the history
  • Loading branch information
pbloem committed Apr 16, 2019
1 parent d628f24 commit fc23faa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions train-style.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ def forward(self, z, n0, n1, n2, n3, n4, n5):

if self.dropouts is not None:
dz, d0, d1, d2, d3, d4, d5 = self.dropouts
z = F.dropout(z, p=dz, training=self.training)
n0 = F.dropout(n0, p=d0, training=self.training)
n1 = F.dropout(n1, p=d1, training=self.training)
n2 = F.dropout(n2, p=d2, training=self.training)
n3 = F.dropout(n3, p=d3, training=self.training)
n4 = F.dropout(n4, p=d4, training=self.training)
n5 = F.dropout(n5, p=d5, training=self.training)
z = F.dropout(z, p=dz, training=True)
n0 = F.dropout(n0, p=d0, training=True)
n1 = F.dropout(n1, p=d1, training=True)
n2 = F.dropout(n2, p=d2, training=True)
n3 = F.dropout(n3, p=d3, training=True)
n4 = F.dropout(n4, p=d4, training=True)
n5 = F.dropout(n5, p=d5, training=True)

z = self.mapping(z)

Expand Down

0 comments on commit fc23faa

Please sign in to comment.