feat(BNNBot): add similarity and overlap metrics to output
Output format: <tick> <44 bits> <hamming> <similarity> <overlap> - Similarity: bits that are the same (TOTAL_BITS - hamming) - Overlap: bits that are 1 in both vectors (popcount of bitwise AND) - First tick: all metrics printed as 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -71,3 +71,7 @@ proc popcount*(vec: BinaryVector): int =
|
||||
proc hammingDistance*(a, b: BinaryVector): int =
|
||||
for i in 0..<TOTAL_BITS:
|
||||
result += int(a[i] xor b[i])
|
||||
|
||||
proc bitwiseAnd*(a, b: BinaryVector): BinaryVector =
|
||||
for i in 0..<TOTAL_BITS:
|
||||
result[i] = a[i] and b[i]
|
||||
|
||||
Reference in New Issue
Block a user