Skip to content

Commit

Permalink
Fix PReLU conversion from CoreML
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Dudalev <michael@dudalev.com>
  • Loading branch information
dudalev committed Oct 14, 2020
1 parent c60d0b5 commit c4547f3
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit c4547f3

Please sign in to comment.