• 大小: 538KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-10
  • 语言: 其他
  • 标签: GAN  

资源简介

使用深度对抗网络完成马和斑马的互换,也可以用作打码,或者去掉马赛克。

资源截图

代码片段和文件信息

import tensorflow as tf

def lrelu(x leak=0.2 name=“lrelu“ alt_relu_impl=False):

    with tf.variable_scope(name):
        if alt_relu_impl:
            f1 = 0.5 * (1 + leak)
            f2 = 0.5 * (1 - leak)
            # lrelu = 1/2 * (1 + leak) * x + 1/2 * (1 - leak) * |x|
            return f1 * x + f2 * abs(x)
        else:
            return tf.maximum(x leak*x)

def instance_norm(x):

    with tf.variable_scope(“instance_norm“):
        epsilon = 1e-5
        mean var = tf.nn.moments(x [1 2] keep_dims=True)
        scale = tf.get_variable(‘scale‘[x.get_shape()[-1]] 
            initializer=tf.truncated_normal_initializer(mean=1.0 stddev=0.02))
        offset = tf.get_variable(‘offset‘[x.get_shape()[-1]]initializer=tf.constant_initializer(0.0))
        out = scale*tf.di

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-07 18:29  CycleGAN-master\
     文件          39  2017-12-07 18:29  CycleGAN-master\.gitignore
     目录           0  2017-12-07 18:29  CycleGAN-master\.ipynb_checkpoints\
     文件        5261  2017-12-07 18:29  CycleGAN-master\.ipynb_checkpoints\Blog for CycleGan-checkpoint.ipynb
     文件       10511  2017-12-07 18:29  CycleGAN-master\.ipynb_checkpoints\CycleGAN_notebook-checkpoint.ipynb
     文件        2076  2017-12-07 18:29  CycleGAN-master\README.md
     目录           0  2017-12-07 18:29  CycleGAN-master\__pycache__\
     文件        2213  2017-12-07 18:29  CycleGAN-master\__pycache__\layers.cpython-36.pyc
     文件         812  2017-12-07 18:29  CycleGAN-master\download_datasets.sh
     目录           0  2017-12-07 18:29  CycleGAN-master\images\
     文件      115630  2017-12-07 18:29  CycleGAN-master\images\Generator.jpg
     文件      235718  2017-12-07 18:29  CycleGAN-master\images\Results.jpg
     文件       70319  2017-12-07 18:29  CycleGAN-master\images\discriminator.jpg
     文件      115099  2017-12-07 18:29  CycleGAN-master\images\distortion.jpg
     文件       97526  2017-12-07 18:29  CycleGAN-master\images\model.jpg
     文件        2533  2017-12-07 18:29  CycleGAN-master\layers.py
     文件       14485  2017-12-07 18:29  CycleGAN-master\main.py
     文件        4771  2017-12-07 18:29  CycleGAN-master\model.py

评论

共有 条评论