Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the cross split and channel-continuously split #90

Open
feiyunzhang opened this issue Oct 29, 2019 · 0 comments
Open

About the cross split and channel-continuously split #90

feiyunzhang opened this issue Oct 29, 2019 · 0 comments

Comments

@feiyunzhang
Copy link

hi,

glow/model.py

Lines 576 to 584 in eaff217

@add_arg_scope
def split2d_prior(z):
n_z2 = int(z.get_shape()[3])
n_z1 = n_z2
h = Z.conv2d_zeros("conv", z, 2 * n_z1)
mean = h[:, :, :, 0::2]
logs = h[:, :, :, 1::2]
return Z.gaussian_diag(mean, logs)

Why use cross h to get mean and logs? Is there any difference to get mean and logs from its contiguous splits of h?
I guess maybe you want to "cross split" the featuremap to get the z1, z2 in the previous lines:

glow/model.py

Lines 545 to 555 in eaff217

@add_arg_scope
def split2d(name, z, objective=0.):
with tf.variable_scope(name):
n_z = Z.int_shape(z)[3]
z1 = z[:, :, :, :n_z // 2]
z2 = z[:, :, :, n_z // 2:]
pz = split2d_prior(z1)
objective += pz.logp(z2)
z1 = Z.squeeze2d(z1)
eps = pz.get_eps(z2)
return z1, objective, eps

As feature feed to split2d are concated from two parts of formerly revnet2d layer, the first half and second half of which are not that equal, doing a "cross split" to get z1, z2 may be a better choice.

@feiyunzhang feiyunzhang changed the title about split2d_prior About the cross split and channel-continuously split Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant