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): ...@@ -36,12 +36,13 @@ def run(config: CFG):
with open(results_txt, "w") as f: with open(results_txt, "w") as f:
for layer in weights: for layer in weights:
for i in range(8): # for i in range(8):
activation_bit = get_bit(activation, i) # activation_bit = get_bit(activation, 0)
tem = np.matmul(activation_bit, layer.T) tem = np.matmul(activation, layer.T)
for val in tem[0]: # f.write(f"{tem}\n")
f.write(f"{val} ") for val in tem[0]:
f.write("\n") f.write(f"{val} ")
f.write("\n")
# with open(result_manual_txt, "w") as f: # with open(result_manual_txt, "w") as f:
# for layer in matrixs: # for layer in matrixs:
# tem = np.zeros((1, layer.shape[1])) # 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