-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
Do you actually update your bias in capsule layer in each training iteration? |
* * * | ||
## **Prerequisities** | ||
|
||
MXNet version above (0.11.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the version here, have you tested on some more recent versions like the current master or 1.0.0rc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it on MXNet 0.12.1 and it works well
example/capsnet/capsulenet.py
Outdated
data_flatten = mx.sym.flatten(data=data) | ||
squared_error = mx.sym.square(x_recon-data_flatten) | ||
recon_error = mx.sym.mean(squared_error) | ||
loss = mx.symbol.MakeLoss((1-0.392)*margin_loss(y_onehot, out_caps)+0.392*recon_error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to make 0.392 as part of the function arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for review and I added 0.392 as option named recon_loss_weight
@piiswrong Do you think this example can be merged in? It looks good. |
@sxjscience Thank you for review, |
@piiswrong Can this example be merged? |
@Soonhwan-Kwon Yes. Could you rebase to master? needs CI to pass |
@piiswrong Thank you for review. I rebased to the master. |
* add capsnet example's layer * add capsnet example * add recon_loss_weight option and tensorboard for plot * update readme to install tensorboard * fix print of loss scaled to 1/batchsize
* add capsnet example's layer * add capsnet example * add recon_loss_weight option and tensorboard for plot * update readme to install tensorboard * fix print of loss scaled to 1/batchsize
Description
This example is MXNet implementation of CapsNet:
Sara Sabour, Nicholas Frosst, Geoffrey E Hinton. Dynamic Routing Between Capsules. NIPS 2017
We achieved
the best test error rate=0.29%
andaverage test error=0.303%
. It is the best accuracy and fastest training time result among other implementations(Keras, Tensorflow at 2017-11-23).The result on paper is
0.25% (average test error rate)
.※ tensorflow implementation's batch size is 128 but MXNet and Keras implementation 's batchsize are 100.
Checklist
Essentials
make lint
)Comments