Use kernel_constraint in my custom layer (Subclassing API)

Imagine a custom layer that has a weight vector that multiplies the input vector element-wise (no biases).
I need the weight vector to be such that the norm of the elements along axis=1 can be at max some value say, ‘max_value’.

tf.clip_by_norm(**kwargs) gives the norms to be exactly ‘max_value’ along axis = 1. But I expect the norms along axis = 1 to be anywhere between (0, ‘max_value’).

Any help?

Hi @akshaykiranjose

Welcome to the TensorFlow Forum!

Could you let us know if this issue still persists? If so, please share the minimal reproducible code to replicate and understand the issue. Thank you!