def get_bitmask_per_elt(optimal_bits, threshold=0.0, exclude=[]):
result = {}
for key in optimal_bits.probability_matrix:
if key not in exclude:
probs = np.array(optimal_bits.probability_matrix[key])
mask = probs > threshold
result[key] = mask
return result
# Convert an array of bytes to a binary string of 0s and 1s
# The MSB comes first in every byte
评论列表
文章目录