コード例 #1
0
ファイル: main_ad.py プロジェクト: kajuna0amendez/Pytorch
if __name__ == '__main__':

    #manualSeed = random.randint(1, 10000) # use if you want new results
    print("Random Seed: ", manualSeed)
    random.seed(manualSeed)
    torch.manual_seed(manualSeed)

    # Get data
    dataloader, dataloader, device = data_loader()

    # Generate Autoencoder
    netAE = AutoEncoder(ngpu, activation).to(device)

    # Apply the weights_init function to randomly initialize all weights
    #  to mean=0, stdev=0.2.
    netAE.apply(weights_init)

    if plot_machines == True:
        # Print the model
        print(netAE)

    # Create the Discriminators
    netD = Discriminator(ngpu, activation).to(device)

    netSD = Discriminator(ngpu, activation).to(device)

    # Apply the weights_init function to randomly initialize all weights
    #  to mean=0, stdev=0.2.
    netD.apply(weights_init)

    if plot_machines == True: