Nphase4_1_train_AutoEncoderCNN
save_reconstructions(model:nn.Module, dataloader:torch.utils.data.DataLoader, device:torch.device, save_dir:str, epoch:int, num_samples:int)
Save a batch of original and reconstructed images from the dataloader.
Parameters:
model
(nn.Module): The trained autoencoder modeldataloader
(torch.utils.data.DataLoader): DataLoader for validation or test setdevice
(torch.device): Device to run the model onsave_dir
(str): Directory to save the imagesepoch
(int): Current epoch number for namingnum_samples
(int): Number of samples to save from the batch
Returns:
None
: Saves images to the specified directory.Labels:
Projects_Viscosity_P2NeuralNetwork_Nphase4_AutoEncoder_Nphase4_1_train_AutoEncoderCNN_save_reconstructions
Main(EmbeddingSize:int)
Main function to run the training process.
Parameters:
EmbeddingSize
(int): Size of the embedding dimension for the autoencoder.
Labels:
Projects_Viscosity_P2NeuralNetwork_Nphase4_AutoEncoder_Nphase4_1_train_AutoEncoderCNN_Main