acids-ircam / pytorch_flows

Implementation and tutorials of normalizing flows with the novel distributions module
GNU General Public License v3.0
160 stars 17 forks source link

Loss function missing in first notebook #1

Closed vinsis closed 5 years ago

vinsis commented 5 years ago

In flows_01.ipynb, the cell below the text Now the only missing ingredient is the loss function that is simply defined as follows is empty. I believe the loss function was defined here.

Can you please share the loss function? Thanks.

vinsis commented 5 years ago

Found it in the previous commit:

def loss(density, zk, log_jacobians):
    sum_of_log_jacobians = sum(log_jacobians)
    return (-sum_of_log_jacobians - torch.log(density(zk) + 1e-9)).mean()