J'expérimente Autoencoder avec Pytorch. Il semble que lorsque j'utilise un réseau neuronal relativement plus grand, par exemple nn.Linear (250 * 250, 40 * 40) comme première couche, le noyau de Jupyter continue à se bloquer. lorsque j'utilise une taille de couche plus petite, par ex. nn.Linéaire (250 * 250, 20 * 20). le noyau de Jupyter est ok. Une idée de comment résoudre ce problème? Ainsi je peux courir le plus grand réseau. Merci. L'ensemble du réseau est comme ci-dessous.Jupyter Kernel crash/meurt lors de l'utilisation de grande couche de réseau neuronal, toute idée pls?
# model:
class AutoEncoder(nn.Module):
def __init__(self):
super().__init__()
self.encoder = nn.Sequential(
nn.Linear(250*250, 20*20),
nn.BatchNorm1d(20*20,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(20*20, 20*20),
nn.BatchNorm1d(20*20,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(20*20, 20*20),
nn.BatchNorm1d(20*20,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(20*20, 15*15),
nn.BatchNorm1d(15*15,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(15*15, 3),
nn.BatchNorm1d(3,momentum=0.5),
#nn.Dropout(0.5),
#nn.Tanh(),
#nn.Linear(5*5,5),
)
self.decoder = nn.Sequential(
#nn.Linear(5, 5*5),
#nn.BatchNorm1d(5*5,momentum=0.5),
#nn.Dropout(0.5),
#nn.Tanh(),
nn.Linear(3, 15*15),
nn.BatchNorm1d(15*15,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(15*15, 20*20),
nn.BatchNorm1d(20*20,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(20*20, 20*20),
nn.BatchNorm1d(20*20,momentum=0.5),
nn.Dropout(0.5),
nn.LeakyReLU(),
nn.Linear(20*20, 250*250),
nn.BatchNorm1d(250*250,momentum=0.5),
nn.Dropout(0.5),
nn.Sigmoid(),
)
def forward(self, x):
encoded = self.encoder(x)
decoded = self.decoder(encoded)
return encoded, decoded