https://github.com/sugyan/tf-dcgan
DCGAN implementation by TensorFlow
https://github.com/sugyan/tf-dcgan
dcgan tensorflow
Last synced: about 1 year ago
JSON representation
DCGAN implementation by TensorFlow
- Host: GitHub
- URL: https://github.com/sugyan/tf-dcgan
- Owner: sugyan
- License: mit
- Created: 2016-05-25T12:22:42.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T02:10:28.000Z (over 9 years ago)
- Last Synced: 2025-04-22T15:12:34.114Z (about 1 year ago)
- Topics: dcgan, tensorflow
- Language: Python
- Size: 19.5 KB
- Stars: 157
- Watchers: 8
- Forks: 50
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- machine_learning_awesome_zh - sugyan/tf-dcgan: DCGAN implementation by TensorFlow
README
# TensorFlow implementation of DCGAN
### What is DCGAN ? ###
Deep Convolutional Generative Adversarial Networks
- http://arxiv.org/abs/1511.06434
#### Other implementations of DCGAN ####
- https://github.com/Newmu/dcgan_code (Theano)
- https://github.com/soumith/dcgan.torch (Torch)
- https://github.com/mattya/chainer-DCGAN (Chainer)
- https://github.com/carpedm20/DCGAN-tensorflow (TensorFlow)
### Prerequisites ###
- Python >= 2.7 or 3.5
- TensorFlow >= 1.0
### Usage ###
#### Train ####
```python
dcgan = DCGAN()
train_images =
losses = dcgan.loss(train_images)
train_op = dcgan.train(losses)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for step in range(FLAGS.max_steps):
_, g_loss_value, d_loss_value = sess.run([train_op, losses[dcgan.g], losses[dcgan.d]])
# save trained variables
```
#### Generate ####
```python
dcgan = DCGAN()
images = dcgan.sample_images()
with tf.Session() as sess:
# restore trained variables
generated = sess.run(images)
with open('', 'wb') as f:
f.write(generated)
```
### Example ###
- https://github.com/sugyan/face-generator