コード例 #1
0
ファイル: big_sleep.py プロジェクト: putate/big-sleep
    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()
コード例 #2
0
ファイル: big_sleep.py プロジェクト: keisukeurasaki/AIcon
    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()
コード例 #3
0
# 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):
コード例 #4
0
ファイル: big_sleep.py プロジェクト: htoyryla/big-sleep
 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()