MCPcopy Create free account
hub / github.com/ai-techsystems/deepC / prelu

Method prelu

include/operators/PRelu.h:38–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 // bool getAttribute<int>(OPATTR attrName, int& obj) ;
37
38 static T prelu(T x, T slope) {
39 // f(x) = slope * x for x < 0, f(x) = x for x >= 0
40 if (x < 0)
41 return (T)slope * x;
42 else
43 return (T)x;
44 }
45
46 tensor<T> compute(tensor<T> &x /*!< : N D tensor input*/,
47 tensor<T> &slope /*!< : N D tensor input*/) {

Callers 8

test_prelu_1dMethod · 0.80
test_prelu_2dMethod · 0.80
test_prelu_3dMethod · 0.80
test_prelu_4dMethod · 0.80

Calls

no outgoing calls

Tested by 8

test_prelu_1dMethod · 0.64
test_prelu_2dMethod · 0.64
test_prelu_3dMethod · 0.64
test_prelu_4dMethod · 0.64