Cleanup name and comments

This commit is contained in:
Yin Li 2021-05-29 17:12:35 -04:00
parent 1181ff0f63
commit c7836ad7be
2 changed files with 8 additions and 8 deletions

View File

@ -38,8 +38,8 @@ def lag2eul(
Implementation follows pmesh/cic.py by Yu Feng. Implementation follows pmesh/cic.py by Yu Feng.
""" """
# NOTE the following factor assumes normalized displacements # NOTE the following factor assumes the displacements have been normalized
# and thus undoes it # by data.norms.cosmology.dis, and thus undoes it
dis_norm = dis_std * D(z) * meshsize / boxsize # to mesh unit dis_norm = dis_std * D(z) * meshsize / boxsize # to mesh unit
dis_norm *= eul_scale_factor dis_norm *= eul_scale_factor

View File

@ -2,7 +2,7 @@ from math import log2
import torch import torch
import torch.nn as nn import torch.nn as nn
from .narrow import narrow_by, narrow_like from .narrow import narrow_by
from .resample import Resampler from .resample import Resampler
@ -32,21 +32,21 @@ class G(nn.Module):
for b in range(num_blocks): for b in range(num_blocks):
prev_chan, next_chan = chan(b), chan(b+1) prev_chan, next_chan = chan(b), chan(b+1)
self.blocks.append( self.blocks.append(
SkipBlock(prev_chan, next_chan, out_chan, cat_noise)) HBlock(prev_chan, next_chan, out_chan, cat_noise))
def forward(self, x): def forward(self, x):
y = x y = x # direct upsampling from the input
x = self.block0(x) x = self.block0(x)
#y = None #y = None # no direct upsampling from the input
for block in self.blocks: for block in self.blocks:
x, y = block(x, y) x, y = block(x, y)
return y return y
class SkipBlock(nn.Module): class HBlock(nn.Module):
"""The "I" block of the StyleGAN2 generator. """The "H" block of the StyleGAN2 generator.
x_p y_p x_p y_p
| | | |