Giter VIP home page Giter VIP logo

dcgan's Introduction

DCGAN

The simple dcgan model implemented in Keras with Tensorflow as backend.

The input and output image size of this model is 32 * 32, and in channel-first format, which means the input shape is ( , 3, 32, 32).

Discriminator Model Info

Keras Model Summary

_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv2d_1 (Conv2D)            (None, 128, 16, 16)       1664      
_________________________________________________________________
leaky_re_lu_1 (LeakyReLU)    (None, 128, 16, 16)       0         
_________________________________________________________________
dropout_1 (Dropout)          (None, 128, 16, 16)       0         
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 256, 8, 8)         131328    
_________________________________________________________________
leaky_re_lu_2 (LeakyReLU)    (None, 256, 8, 8)         0         
_________________________________________________________________
dropout_2 (Dropout)          (None, 256, 8, 8)         0         
_________________________________________________________________
conv2d_3 (Conv2D)            (None, 512, 4, 4)         524800    
_________________________________________________________________
leaky_re_lu_3 (LeakyReLU)    (None, 512, 4, 4)         0         
_________________________________________________________________
dropout_3 (Dropout)          (None, 512, 4, 4)         0         
_________________________________________________________________
conv2d_4 (Conv2D)            (None, 1024, 4, 4)        2098176   
_________________________________________________________________
leaky_re_lu_4 (LeakyReLU)    (None, 1024, 4, 4)        0         
_________________________________________________________________
dropout_4 (Dropout)          (None, 1024, 4, 4)        0         
_________________________________________________________________
flatten_1 (Flatten)          (None, 16384)             0         
_________________________________________________________________
dense_1 (Dense)              (None, 1)                 16385     
=================================================================
Total params: 2,772,353
Trainable params: 2,772,353
Non-trainable params: 0
_________________________________________________________________

Generator Model Info

Keras Model Summary

_________________________________________________________________
[INFO] Init generator...
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
dense_2 (Dense)              (None, 16384)             1654784   
_________________________________________________________________
batch_normalization_1 (Batch (None, 16384)             65536     
_________________________________________________________________
activation_1 (Activation)    (None, 16384)             0         
_________________________________________________________________
reshape_1 (Reshape)          (None, 256, 8, 8)         0         
_________________________________________________________________
up_sampling2d_1 (UpSampling2 (None, 256, 16, 16)       0         
_________________________________________________________________
conv2d_transpose_1 (Conv2DTr (None, 128, 16, 16)       819328    
_________________________________________________________________
batch_normalization_2 (Batch (None, 128, 16, 16)       64        
_________________________________________________________________
activation_2 (Activation)    (None, 128, 16, 16)       0         
_________________________________________________________________
up_sampling2d_2 (UpSampling2 (None, 128, 32, 32)       0         
_________________________________________________________________
conv2d_transpose_2 (Conv2DTr (None, 64, 32, 32)        204864    
_________________________________________________________________
batch_normalization_3 (Batch (None, 64, 32, 32)        128       
_________________________________________________________________
activation_3 (Activation)    (None, 64, 32, 32)        0         
_________________________________________________________________
conv2d_transpose_3 (Conv2DTr (None, 32, 32, 32)        51232     
_________________________________________________________________
batch_normalization_4 (Batch (None, 32, 32, 32)        128       
_________________________________________________________________
activation_4 (Activation)    (None, 32, 32, 32)        0         
_________________________________________________________________
conv2d_transpose_4 (Conv2DTr (None, 16, 32, 32)        12816     
_________________________________________________________________
batch_normalization_5 (Batch (None, 16, 32, 32)        128       
_________________________________________________________________
activation_5 (Activation)    (None, 16, 32, 32)        0         
_________________________________________________________________
conv2d_transpose_5 (Conv2DTr (None, 3, 32, 32)         1203      
_________________________________________________________________
activation_6 (Activation)    (None, 3, 32, 32)         0         
=================================================================
Total params: 2,810,211
Trainable params: 2,777,219
Non-trainable params: 32,992
_________________________________________________________________

Usage

To use the model, import the module dcgan.

The constructor of dcgan take your train images as input, and its member function train will do the training work.

And the relative post on my personal blog: Linro

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.