mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-15 07:20:31 +08:00
small fix
This commit is contained in:
parent
97749b7c7d
commit
6a4fa73a38
@ -51,10 +51,9 @@ class HypernetworkModule(torch.nn.Module):
|
|||||||
if add_layer_norm:
|
if add_layer_norm:
|
||||||
linears.append(torch.nn.LayerNorm(int(dim * layer_structure[i+1])))
|
linears.append(torch.nn.LayerNorm(int(dim * layer_structure[i+1])))
|
||||||
|
|
||||||
# Add dropout
|
# Add dropout expect last layer
|
||||||
if use_dropout:
|
if use_dropout and i < len(layer_structure) - 3:
|
||||||
p = 0.5 if 0 <= i <= len(layer_structure) - 3 else 0.2
|
linears.append(torch.nn.Dropout(p=0.3))
|
||||||
linears.append(torch.nn.Dropout(p=p))
|
|
||||||
|
|
||||||
self.linear = torch.nn.Sequential(*linears)
|
self.linear = torch.nn.Sequential(*linears)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user