Skip to content

Instantly share code, notes, and snippets.

@itsuncheng
Created July 26, 2020 03:53
Show Gist options
  • Select an option

  • Save itsuncheng/9443ce32b7d6fff2c22200f5a779bcff to your computer and use it in GitHub Desktop.

Select an option

Save itsuncheng/9443ce32b7d6fff2c22200f5a779bcff to your computer and use it in GitHub Desktop.
from __future__ import print_function
#%matplotlib inline
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchvision.utils as vutils
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from IPython.display import HTML
# Set random seem for reproducibility
manualSeed = 999
#manualSeed = random.randint(1, 10000) # use if you want new results
print("Random Seed: ", manualSeed)
random.seed(manualSeed)
torch.manual_seed(manualSeed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment