Commit 05df0620 by zhengzifu

Refactor activation processing in verify_activation.py to simplify matrix…

Refactor activation processing in verify_activation.py to simplify matrix multiplication and output. Removed commented-out code for clarity.
parent b962fa72
......@@ -36,12 +36,13 @@ def run(config: CFG):
with open(results_txt, "w") as f:
for layer in weights:
for i in range(8):
activation_bit = get_bit(activation, i)
tem = np.matmul(activation_bit, layer.T)
for val in tem[0]:
f.write(f"{val} ")
f.write("\n")
# for i in range(8):
# activation_bit = get_bit(activation, 0)
tem = np.matmul(activation, layer.T)
# f.write(f"{tem}\n")
for val in tem[0]:
f.write(f"{val} ")
f.write("\n")
# with open(result_manual_txt, "w") as f:
# for layer in matrixs:
# tem = np.zeros((1, layer.shape[1]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment