To align to mxnet,pytorch, tensorflow’s MyInit class should be:
class MyInit(tf.keras.initializers.Initializer):
def call(self, shape, dtype=None):
data=tf.random.uniform(shape,-10, 10, dtype=dtype)
factor=(tf.abs(data)>=5)
factor=tf.cast(factor,tf.float32)
return data*factor
How do I go about training an MLP? Am I printing the gradients and parameters throughout the training process?