Download model/weight_activation.py from iaecpsu-1/tdce-basic: direct link, hf CLI and curl.
- Browser
- Download file 163 Bytes
-
https://huggingface.co/iaecpsu-1/tdce-basic/resolve/main/model/weight_activation.py
- Command line
-
hf download hf://iaecpsu-1/tdce-basic/model/weight_activation.py
-
curl -L -o weight_activation.py https://huggingface.co/iaecpsu-1/tdce-basic/resolve/main/model/weight_activation.py
163 Bytes
| 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) | |