Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Add prelu layer support for caffe convert tool #4277

Merged
merged 2 commits into from Jan 11, 2017

Conversation

fengshikun
Copy link
Contributor

I add the support for prelu layer for the caffe convert tool, and use the code to convert the center loss(https://github.com/ydwen/caffe-face/blob/caffe-face/face_example/face_deploy.prototxt) model to mxnet model, which use prelu as its nonlinear activation function. And get the same output between mxnet and caffe.

@@ -165,6 +165,10 @@ def proto2script(proto_file):
type_string = 'mx.symbol.BatchNorm'
param = layer[i].batch_norm_param
param_string = 'use_global_stats=%s' % param.use_global_stats
if layer[i].type == 'PReLU':
type_string = 'mx.symbol.LeakyReLU'
param_string = "act_type='prelu'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to copy slope parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, i will add it later

@piiswrong
Copy link
Contributor

have you tested this on a real .proto?

@fengshikun
Copy link
Contributor Author

fengshikun commented Dec 21, 2016

@piiswrong Yes,i have used the code to convert the center loss(https://github.com/ydwen/caffe-face/blob/caffe-face/face_example/face_deploy.prototxt) model to mxnet model

@piiswrong piiswrong merged commit 541d109 into apache:master Jan 11, 2017
rravu3 pushed a commit to rravu3/mxnet that referenced this pull request Jan 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants