Skip to content

Commit

Permalink
added tensorflow graph to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Armour committed Dec 13, 2016
1 parent 72a6857 commit 07e2f92
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Used pre-trained VGG16 model from [https://github.com/machrisaa/tensorflow-vgg](
* `train.py`: train the residual encoder model using tensorflow build-in GradientDescentOptimizer
* `test.py`: test your own image and save the output image

## Tensorflow graph

![](images/residuall_encoder.png)

## How to use

* First please download pre-trained VGG16 model [vgg16.npy](https://mega.nz/#!YU1FWJrA!O1ywiCS2IiOlUCtCpI6HTJOMrneN-Qdv3ywQP5poecM) to vgg folder
Expand Down
6 changes: 3 additions & 3 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def init_model(train=True):
residual_encoder = ResidualEncoder()

# Color image
color_image_rgb = input_pipeline(file_paths, batch_size)
color_image_rgb = input_pipeline(file_paths, batch_size, test=not train)
color_image_yuv = rgb_to_yuv(color_image_rgb, "rgb2yuv_for_color_image")

# Gray image
Expand Down Expand Up @@ -85,10 +85,10 @@ def init_model(train=True):
exclusive=True, name="cost")

# Using different learning rate in different training steps
lr = tf.div(learning_rate, tf.cast(tf.pow(2, tf.div(global_step, 160000)), tf.float32), name="learning_rate")
# lr = tf.div(learning_rate, tf.cast(tf.pow(2, tf.div(global_step, 160000)), tf.float32), name="learning_rate")

# Optimizer
optimizer = tf.train.GradientDescentOptimizer(learning_rate=lr).minimize(cost, global_step=global_step)
optimizer = tf.train.GradientDescentOptimizer(learning_rate=learning_rate).minimize(cost, global_step=global_step)

# Summaries
print "Init summaries"
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
image_size = 224

# Parameters for neural network
learning_rate = 1e-4 # Initial learning rate, every 5000 step we divide this by 2
learning_rate = 1e-4 # Learning rate
training_iters = 2400000 # The training iterations number
batch_size = 1 # The batch size
display_step = 1 # Display loss for each step
Expand Down

0 comments on commit 07e2f92

Please sign in to comment.