GithubHelp home page GithubHelp logo

cyclegan's Introduction

CycleGAN: Horse to Zebra

Current update status

  • Implement basic form of CycleGAN
  • Train discriminators if their loss is bigger than criterion
  • Replay buffer for training discriminator
  • Different GAN loss (ex. WGAN-GP)

Model

Generator: ResNet (9 Residual Blocks)

Encoder(Downsampling) → Transformer(Residual Block x9) → Decoder(Upsampling)

Encoder:

Conv #1: ReflectionPad(3) → Conv(in_channels, 64, 7) → InstanceNorm → ReLU
Conv #2: Conv(64, 128, 3, 2, 1) → InstanceNorm → ReLU
Conv #3: Conv(128, 256, 3, 2, 1) → InstanceNorm → ReLU

Residual Block:

ReflectionPad(1) → Conv(256, 256, 3) → InstanceNorm → ReLU
→ ReflectionPad(1) → Conv(256, 256, 3) → InstanceNorm → Add

Decoder:

Conv #1: ConvT(256, 128, 3, 2, 1, out_padding=1) → InstanceNorm → ReLU
Conv #2: ConvT(128, 64, 3, 2, 1, out_padding=1) → InstanceNorm → ReLU
Conv #3: ReflectionPad(3) → Conv(64, out_channels, 7) → Tanh

Discriminator: PatchGAN (30x30)

Conv #1: Conv(in_channels, 64, 4, 2, 1) → LeakyReLU(0.2)
Conv #2: Conv(64, 128, 4, 2, 1) → BatchNorm → LeakyReLU(0.2)
Conv #3: Conv(128, 256, 4, 2, 1) → BatchNorm → LeakyReLU(0.2)
Conv #4: Conv(256, 512, 4, 1, 1) → BatchNorm → LeakyReLU(0.2)
Conv #5: Conv(512, 1, 4, 1, 1) → Sigmoid

Gan Loss: Mean Squared Error (= LSGAN)


Output images during training

output_img


Loss vs. epoch

loss_img


Test

test_img

cyclegan's People

Contributors

kimjy99 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.