Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PReLU conversion from CoreML #425

Merged
merged 3 commits into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# license information.
# --------------------------------------------------------------------------

import numpy as np

from ....common._apply_operation import apply_elu, apply_hard_sigmoid, apply_leaky_relu, apply_prelu, apply_relu, \
apply_sigmoid, apply_tanh, apply_affine, apply_parametric_softplus, apply_scaled_tanh
apply_sigmoid, apply_tanh, apply_affine, apply_parametric_softplus, apply_scaled_tanh, apply_thresholded_relu
from ....common._registration import register_converter


Expand All @@ -24,7 +26,7 @@ def convert_activation(scope, operator, container):
elif activation_type == 'ReLU':
apply_relu(scope, inputs, outputs, container, operator_name=attrs['name'])
elif activation_type == 'PReLU':
apply_prelu(scope, inputs, outputs, container, operator_name=attrs['name'], slope=[params.PReLU.alpha])
apply_prelu(scope, inputs[0], outputs, container, operator_name=attrs['name'], slope=np.asarray([params.PReLU.alpha.floatValue]))
elif activation_type == 'ELU':
apply_elu(scope, inputs, outputs, container, operator_name=attrs['name'], alpha=params.ELU.alpha)
elif activation_type == 'tanh':
Expand Down