def __init__(self, image_size, max_classes=None, class_temperature=2.): super().__init__() assert image_size in ( 128, 256, 512), 'image size must be one of 128, 256, or 512' self.biggan = BigGAN.from_pretrained(f'biggan-deep-{image_size}') self.max_classes = max_classes self.class_temperature = class_temperature self.init_latents()
def __init__(self, image_size, max_classes=None, class_temperature=2.0, ema_decay=0.99): super().__init__() assert image_size in ( 128, 256, 512, ), "image size must be one of 128, 256, or 512" self.biggan = BigGAN.from_pretrained(f"biggan-deep-{image_size}") self.max_classes = max_classes self.class_temperature = class_temperature self.ema_decay = ema_decay self.init_latents()
# ladataan latenssitiedot lat1 = torch.load(opt.lat1) lat2 = torch.load(opt.lat2) best1 = lat1.best best2 = lat2.best noise1 = lat1.normu.to(device) noise2 = lat2.normu.to(device) class1 = lat1.cls.to(device) class2 = lat2.cls.to(device) # ladataan biggan # load biggan model = BigGAN.from_pretrained(f'biggan-deep-{imgSize}') model.eval() truncation = opt.trunc model.to(device) #n_delta = (noise2 - noise1) / opt.steps #c_delta = (class2 - class1) / opt.steps #noise_vector = noise1 #class_vector = class1 alphas = np.linspace(0., 1., opt.steps) with torch.no_grad(): for i in range(0, opt.steps):
def __init__(self, image_size): super().__init__() assert image_size in ( 128, 256, 512), 'image size must be one of 128, 256, or 512' self.biggan = BigGAN.from_pretrained(f'biggan-deep-{image_size}') self.init_latents()