def applyActivationFunction_PReLU_v2(inputData,PreluActivations) :
""" inputData is a tensor5D with shape:
(batchSize,
Number of feature Maps,
convolvedImageShape[0],
convolvedImageShape[1],
convolvedImageShape[2]) """
# The input is a tensor of shape (batchSize, FeatMaps, xDim, yDim, zDim)
preluActivationsAsRow = PreluActivations.dimshuffle('x', 0, 'x', 'x', 'x')
pos = ((inputData + abs(inputData)) / 2.0 )
neg = preluActivationsAsRow * ((inputData - abs(inputData)) / 2.0 )
output = pos + neg
return ( output)
# --- version 3 ---
评论列表
文章目录