GithubHelp home page GithubHelp logo

jmtomczak / intro_dgm Goto Github PK

View Code? Open in Web Editor NEW
957.0 26.0 156.0 7.68 MB

"Deep Generative Modeling": Introductory Examples

License: MIT License

Jupyter Notebook 100.00%
deep-generative-modelling variational-autoencoder flow-based-modeling autoregressive-modeling pytorch generative-adversarial-network energy-based-model neural-compression deep-learning generative-ai

intro_dgm's People

Contributors

bamos avatar generativeai-tue avatar jbrry avatar jmtomczak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intro_dgm's Issues

typo in fm_example

Hi, it seems there is a copy-paste typo in fm_example (not sure if eval/train are needed there at all):
self.vnet.eval() # set the vector field net to train again

arm_example forward pass A option related confusion

Hi,
As far as I understand, the option A in arm_example.ipynb refers to causality. Therefore A = True should signal that the model should not be taking the current time step t as an input. In the code implementation we discard the latest outpout of the convolution layer. I am confused by this since I thought we are supposed to discard the latest input. Are we not supposed to discard the latest (current time step) input to the model. In other words, for example, for the first convolution operation for t = 0, are we not supposed to pad left (for 1D) with F-1 many elements, and feed into the first convolution the {(F-1), (F-2), ..., -1} time step elements to produce the output for t = 0 (initial) ?

if self.A:
# Remember , we cannot be dependent on the current
component; therefore , the last element is removed .
return conv1d_out [:, :, : โˆ’1]

Sorry if I'm off. Just started to learn about these from the book. I will appreciate any help.

The use of tanh in Euler forward sampling

I'm checking your most recent update on conditional flow matching and I see here you passed a tanh function after the Euler forward step. I wonder if there is any reason behind it?

https://github.com/jmtomczak/intro_dgm/blob/main/sbgms/fm_example.ipynb

    def sample(self,  batch_size=64):
        # Euler method
        # sample x_0 first
        x_t = self.sample_base(torch.empty(batch_size, self.D))
        
        # then go step-by-step to x_1 (data)        
        ts = torch.linspace(0., 1., self.T)
        delta_t = ts[1] - ts[0]
        
        for t in ts[1:]:
            t_embedding = self.time_embedding(torch.Tensor([t]))
            x_t = x_t + self.vnet(x_t + t_embedding) * delta_t
            # Stochastic Euler method
            if self.stochastic_euler:
                x_t = x_t + torch.randn_like(x_t) * delta_t
        
        x_final = torch.tanh(x_t) # **here's my question** 
        return x_final

Missing something in DDGM example

Hi,

I might be missing a step here but in your explanation for the reparameterization trick you state the following formula

And I can see $i$ as an argument, but I fail to see how you are using it in this function - could you explain what I missed?

def reparameterization_gaussian_diffusion(self, x, i):
    return torch.sqrt(1. - self.beta) * x + torch.sqrt(self.beta) * torch.randn_like(x)

Learnable modules in ddgm example

In the ddgm example shouldn't the line:

self.p_dnns = p_dnns

be:

self.p_dnns = nn.ModuleList( p_dnns)

My understanding is that by not placing them in a ModuleList the p_dnns networks are not added in the learned parameters and are left unoptimized.

Thanks for an awesome resource by the way!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.