以下链接是个人关于stylegan所有见解,如有错误欢迎大家指出,我会第一时间纠正,如有兴趣可以加微信:17575010159 相互讨论技术。若是帮助到了你什么,一定要记得点赞奥!因为这是对我最大的鼓励。 风格迁移0-00:stylegan-目录-史上最全:https://blog.csdn.net/weixin_43013761/article/details/100895333
generate net流程其实,之前做项目的时候,我都不是很在意网络的结构,因为给我的感觉,搞来搞去,无非就是卷积,池化 ,反卷积,跳跃链接等等组合而已。但是这次的网络结构吗,可能是相对来说比较复杂,也考虑到源码的难阅读性,打算好好的深入理解一番,那么我们就开始吧。
根据:风格迁移0-05:stylegan-源码无死角解读(1)-框架总览我们可以知道,其网络实现是从:
def training_loop(
G = tflib.Network('G', num_channels=training_set.shape[0], resolution=training_set.shape[1], label_size=training_set.label_size, **G_args)
D = tflib.Network('D', num_channels=training_set.shape[0], resolution=training_set.shape[1], label_size=training_set.label_size, **D_args)
开始搭建网络的,对于生成网络,其最终会调用到training/networks_stylegan.py文件中的def G_style函数,对于该函数的注释如下:
#----------------------------------------------------------------------------
# Style-based generator used in the StyleGAN paper.
# Composed of two sub-networks (G_mapping and G_synthesis) that are defined below.
def G_style(
latents_in, # First input: Latent vectors (Z) [minibatch, latent_size].
labels_in, # Second input: Conditioning labels [minibatch, label_size].
truncation_psi = 0.7, # Style strength multiplier for the truncation trick. None = disable.
truncation_cutoff = 8, # Number of layers for which to apply the truncation trick. None = disable.
truncation_psi_val = None, # Value for truncation_psi to use during validation.
truncation_cutoff_val = None, # Value for truncation_cutoff to use during validation.
dlatent_avg_beta = 0.995, # Decay for tracking the moving average of W during training. None = disable.
style_mixing_prob = 0.9, # Probability of mixing styles during training. None = disable.
is_training = False, # Network is under training? Enables and disables specific features.
is_validation = False, # Network is under validation? Chooses which value to use for truncation_psi.
is_template_graph = False, # True = template graph constructed by the Network class, False = actual evaluation.
components = dnnlib.EasyDict(), # Container for sub-networks. Retained between calls.
**kwargs): # Arguments for sub-networks (G_mapping and G_synthesis).
# Validate arguments.
assert not is_training or not is_validation
assert isinstance(components, dnnlib.EasyDict)
if is_validation:
truncation_psi = truncation_psi_val
truncation_cutoff = truncation_cutoff_val
if is_training or (truncation_psi is not None and not tflib.is_tf_expression(truncation_psi) and truncation_psi == 1):
truncation_psi = None
if is_training or (truncation_cutoff is not None and not tflib.is_tf_expression(truncation_cutoff) and truncation_cutoff
关注
打赏
热门博文
- 史上最全slam从零开始-总目录
- (01)ORB-SLAM2源码无死角解析-(00)目录_最新无死角讲解
- 目标检测00-00:mmdetection(Foveabox为例)-目录-史上最新无死角讲解
- 风格迁移1-00:Liquid Warping GAN(Impersonator)-目录-史上最新无死角讲解
- 姿态估计1-00:FSA-Net(头部姿态估算)-目录-史上最新无死角讲解
- 姿态估计0-00:DenseFusion(6D姿态估计)-目录-史上最新无死角讲解
- 3D点云重建0-00:MVSNet(R-MVSNet)-目录-史上最新无死角讲解
- 视觉工作项目-为后来的你,提供一份帮助!
- 行人检测0-00:LFFD-目录-史上最新无死角解读
- 行人重识别0-00:DG-Net(ReID)-目录-史上最新无死角讲解