pytti-tools / pytti-core

https://pytti-tools.github.io/pytti-book/intro.html
MIT License
78 stars 23 forks source link

deep image prior #192

Open dmarx opened 2 years ago

dmarx commented 2 years ago

still to do:

dmarx commented 2 years ago

re: noise annealing (via https://github.com/LAION-AI/notebooks/blob/main/DALLE2-Prior%2BDeep-Image-Prior.ipynb):

        noise_ramp = 1 - min(1, itt / iterations)
        net_input_noised = net_input

        if input_noise_strength:
            phi = min(1, noise_ramp * input_noise_strength) * math.pi / 2
            noise = torch.randn_like(net_input)
            net_input_noised = net_input * math.cos(phi) + noise * math.sin(phi)

        with torch.cuda.amp.autocast():
            out = net(net_input_noised * input_scale).float()
dmarx commented 2 years ago

current blocker: a lot of dependent code assumes latent is a single tensor. downstream operations on the image representation attempt to call methods on it like "clone" that don't have good analogs with the module dict/list.

I think the solution is instead of adding special cases, generalize the other image reps to expect containers with arbitrarily many image representation components of heterogeneous sizes.

updating EMAImage to operate on parameter dicts/lists could potentially solve a good chunk of this

dmarx commented 2 years ago

migrate to branch dip_ema_simple