I need a specific custom activation function; how can I implement it with Piecewise
?
This is what I've tried (using the recommendation from this question):
p = Function[x, Piecewise[{{Exp[x] - (2 + E)/(2 E), x < -1}, {x/2, x < 0}, {x,
x > 0}}], Listable]
ElementwiseLayer[p]
Is there a systematic workaround to handle the conversion from an aribitrary Piecewise
function into an ElementwiseLayer
?