How to implement RBF activation function in Keras?
问题 I am creating a customized activation function, RBF activation function in particular: from keras import backend as K from keras.layers import Lambda l2_norm = lambda a,b: K.sqrt(K.sum(K.pow((a-b),2), axis=0, keepdims=True)) def rbf2(x): X = #here i need inputs that I receive from previous layer Y = # here I need weights that I should apply for this layer l2 = l2_norm(X,Y) res = K.exp(-1 * gamma * K.pow(l2,2)) return res The function rbf2 receives the previous layer as input: #some keras