Skip to content

Commit 2cfa53b

Browse files
author
DongHao
committed
simplify
1 parent c910e83 commit 2cfa53b

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

download.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@
66
- LSUN dataset
77
- MNIST dataset
88
"""
9-
109
from __future__ import print_function
11-
import os
12-
import sys
13-
import gzip
14-
import json
15-
import shutil
16-
import zipfile
17-
import argparse
18-
import subprocess
10+
import os, sys, gzip, json, shutil, zipfile, argparse, subprocess
1911
from six.moves import urllib
2012

2113
parser = argparse.ArgumentParser(description='Download dataset for DCGAN.')
@@ -49,7 +41,7 @@ def download(url, dirpath):
4941
f.close()
5042
return filepath
5143

52-
def download_file_from_google_drive(id, destination):
44+
def download_file_from_google_drive(id, destination):
5345
URL = "https://docs.google.com/uc?export=download"
5446
session = requests.Session()
5547

main.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import os
2-
import sys
1+
import os, sys, pprint, time
32
import scipy.misc
4-
import pprint
53
import numpy as np
6-
import time
74
import tensorflow as tf
85
import tensorlayer as tl
96
from tensorlayer.layers import *
@@ -19,7 +16,6 @@
1916
2017
Usage : see README.md
2118
"""
22-
2319
flags = tf.app.flags
2420
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
2521
flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]")
@@ -172,6 +168,5 @@ def main(_):
172168
tl.files.save_npz(net_d.all_params, name=net_d_iter_name, sess=sess)
173169
print("[*] Saving checkpoints SUCCESS!")
174170

175-
176171
if __name__ == '__main__':
177172
tf.app.run()

model.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
import tensorlayer as tl
44
from tensorlayer.layers import *
55

6-
76
flags = tf.app.flags
87
FLAGS = flags.FLAGS
98

10-
11-
129
def generator_simplified_api(inputs, is_train=True, reuse=False):
1310
image_size = 64
1411
s2, s4, s8, s16 = int(image_size/2), int(image_size/4), int(image_size/8), int(image_size/16)

0 commit comments

Comments
 (0)