repos
/ ai-art master

ai-art

mirror archived upstream

Art generation with VQGAN + CLIP in Docker, with a simple web UI for anyone with a GPU. A simplified and expanded take on Kevin Costa's work.

aiai-artclipdockerdocker-composegpuhandcodedimagenetpythonpytorchtorchtorchvisionvqganvqgan-clip

305 B · 11 lines · Python Raw History
 1import torch.nn as nn
 2
 3
 4def weights_init(m):
 5    classname = m.__class__.__name__
 6    if classname.find('Conv') != -1:
 7        nn.init.normal_(m.weight.data, 0.0, 0.02)
 8    elif classname.find('BatchNorm') != -1:
 9        nn.init.normal_(m.weight.data, 1.0, 0.02)
10        nn.init.constant_(m.bias.data, 0)