File size: 163 Bytes
d4c7aae | 1 2 3 4 5 6 7 8 9 10 11 | import numpy as np
alpha = 0
def un_zero_weight(x):
shape = x.shape
x = x.flatten()
result = np.where(x < 0, 0, x)
return result.reshape(shape)
|
d4c7aae | 1 2 3 4 5 6 7 8 9 10 11 | import numpy as np
alpha = 0
def un_zero_weight(x):
shape = x.shape
x = x.flatten()
result = np.where(x < 0, 0, x)
return result.reshape(shape)
|