Skip to content

Commit

Permalink
update to new result
Browse files Browse the repository at this point in the history
  • Loading branch information
shuokay committed Jan 14, 2016
1 parent a30b182 commit 55e4232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Deep Residual Net
Example code for [Deep Residual Learning for Image Recognition](http://arxiv.org/abs/1512.03385)
* Run this script by ```python resnet-small.py``` for 70 epochs get a train accuracy around 84% and validation accuracy around 93%
* Then change the learning rate to 0.01, running this training from 70th epoch for 40 iterations, and get a train accuracy around 99% and test accuracy around 89%
* Run this script by ```python resnet-small.py``` for 100 epochs get a train accuracy around 89.47% and validation accuracy around 85.95%
* Then change the learning rate to 0.01, running this training from 70th epoch for 50 iterations, and get a train accuracy around 98.72% and test accuracy around 89.77%

## Differences to the Paper
* 1*1 convolution operators are used for increasing dimensions.
Expand Down
4 changes: 2 additions & 2 deletions resnet-small.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_dataiter(batch_size=128):
# g.view()
batch_size = 128
train_dataiter, test_dataiter = get_dataiter(batch_size=batch_size)
finetune=False
finetune=True
if finetune==False:
model = mx.model.FeedForward(ctx=mx.gpu(0), symbol=softmax, num_epoch=70, learning_rate=0.1, momentum=0.9, wd=0.0001, \
initializer=mx.init.Xavier(rnd_type='gaussian', factor_type="in", magnitude=2),
Expand All @@ -103,6 +103,6 @@ def get_dataiter(batch_size=128):
)
model.fit(X=train_dataiter, eval_data=test_dataiter, batch_end_callback=mx.callback.Speedometer(batch_size),epoch_end_callback=mx.callback.do_checkpoint("./models/resnet"))
else:
loaded = mx.model.FeedForward.load('models/resnet', 70)
loaded = mx.model.FeedForward.load('models/resnet', 100)
continue_model = mx.model.FeedForward(ctx=mx.gpu(0), symbol = loaded.symbol, arg_params = loaded.arg_params, aux_params = loaded.aux_params, num_epoch=10000, learning_rate=0.01, momentum=0.9, wd=0.0001)
continue_model.fit(X=train_dataiter, eval_data=test_dataiter, batch_end_callback=mx.callback.Speedometer(batch_size),epoch_end_callback=mx.callback.do_checkpoint("./models/resnet"))

0 comments on commit 55e4232

Please sign in to comment.