コード例 #1
0
    val_data,
    batch_size=batch_size,
    shuffle=True,
    num_workers=num_dataloader_workers,
    pin_memory=gpu,
)
test_dataloader = torch.utils.data.DataLoader(
    test_data,
    batch_size=batch_size,
    shuffle=True,
    num_workers=num_dataloader_workers,
    pin_memory=gpu,
)

# Creating a sample set to visualize the model's training
sample = data.get_samples_from_data(val_data, 16)

################################################################################
##################################### Model ####################################
################################################################################

# Create Model
model = autoencoder.ConvolutionalAE(
    max_filters=max_filters,
    num_layers=num_layers,
    input_image_dimensions=image_size,
    latent_dim=latent_dim,
    small_conv=small_conv,
)
model.to(device)
コード例 #2
0
    val_fusions,
    batch_size=batch_size,
    shuffle=True,
    num_workers=num_dataloader_workers,
    pin_memory=gpu,
)
test_fusion_dataloader = torch.utils.data.DataLoader(
    test_fusions,
    batch_size=batch_size,
    shuffle=True,
    num_workers=num_dataloader_workers,
    pin_memory=gpu,
)

# Creating a sample set that we visualize every epoch to show the model's training
sample = data.get_samples_from_data(val_data, 16, fusion=False)
test_sample = data.get_samples_from_data(test_data, 16, fusion=False)
fusion_sample = data.get_samples_from_data(val_fusions, 4, fusion=True)
fusion_test_sample = data.get_samples_from_data(test_fusions, 4, fusion=True)

################################################################################
##################################### Model ####################################
################################################################################

# Create Model
model = models.ConvolutionalVAE(
    max_filters=max_filters,
    num_layers=num_layers,
    input_image_dimensions=image_size,
    latent_dim=latent_dim,
    small_conv=small_conv,