The from_tar interface of paddle/v2/parameters.py sets the smaller value to 0.
Created by: NHZlX
The from_tar interface of paddle/v2/parameters.py sets the smaller value to 0.
I did the following tests:
test one
$ od -f ___prelu_layer_0__.w0
0000000 0.000000e+00 5.605194e-45 2.242078e-44 0.000000e+00
0000020 -4.362915e-39 3.391905e-03 -4.271918e-02 5.452635e-02
0000040 -3.064562e-01 -8.415823e-01 -2.167667e-34 2.003883e-03
0000060 1.112373e-34 1.064608e-40 5.219662e-01 2.975052e-02
0000100 6.197284e-38 -6.660666e-40 7.927477e-34 -1.305121e-01
0000120
test two
I print the value in parameter.py,
def deserialize(self, name, f):
"""
:param name:
:param f:
:type f: file
:return:
"""
f.read(16) # header
arr = np.frombuffer(f.read(), dtype=np.float32)
if name == '___prelu_layer_0__.w0':
print arr
self.set(name, arr.reshape(self.get_shape(name)))
the print is :
[ -0.00000000e+00 3.39190545e-03 -4.27191779e-02 5.45263477e-02
-3.06456238e-01 -8.41582298e-01 -2.16766737e-34 2.00388324e-03
1.11237306e-34 0.00000000e+00 5.21966159e-01 2.97505204e-02
6.19728394e-38 -0.00000000e+00 7.92747696e-34 -1.30512059e-01]
though the value is very small, but it's useful for my model.