Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
4-bit Hamming distance. Computes the number of bit positions where two 4-bit inputs differ.
Function
HD(a, b) = popcount(a XOR b)
Returns 3-bit binary encoding (d2, d1, d0) of the distance 0-4.
Architecture
5-layer circuit:
Layer 1
(8 neurons): For each bit i, compute
diff_hi_i = a_i AND NOT b_i
and
diff_lo_i = NOT a_i AND b_i
Layer 2
(4 neurons): XOR result
diff_i = diff_hi_i OR diff_lo_i
Layer 3
(4 neurons): Threshold detectors
ge_k
= at least k differences
Layer 4
(4 neurons): Binary encoding logic
Layer 5
(1 neuron): Final d0 bit
Parameters
Inputs
8 (a3,a2,a1,a0, b3,b2,b1,b0)
Outputs
3 (d2, d1, d0)
Neurons
21
Layers
5
Parameters
155
Magnitude
76
Truth Table (selected)
a
b
HD
0000
0000
0
1111
0000
4
1010
0101
4
1100
1010
2
1111
1110
1
Usage
from safetensors.torch import load_file
import torch
w = load_file('model.safetensors')
# See model.py for full implementation# Returns (d2, d1, d0) where distance = 4*d2 + 2*d1 + d0
License
MIT
Runs of phanerozoic threshold-hammingdistance4 on huggingface.co
5
Total runs
0
24-hour runs
-3
3-day runs
-4
7-day runs
-1
30-day runs
More Information About threshold-hammingdistance4 huggingface.co Model
More threshold-hammingdistance4 license Visit here:
threshold-hammingdistance4 huggingface.co is an AI model on huggingface.co that provides threshold-hammingdistance4's model effect (), which can be used instantly with this phanerozoic threshold-hammingdistance4 model. huggingface.co supports a free trial of the threshold-hammingdistance4 model, and also provides paid use of the threshold-hammingdistance4. Support call threshold-hammingdistance4 model through api, including Node.js, Python, http.
threshold-hammingdistance4 huggingface.co is an online trial and call api platform, which integrates threshold-hammingdistance4's modeling effects, including api services, and provides a free online trial of threshold-hammingdistance4, you can try threshold-hammingdistance4 online for free by clicking the link below.
phanerozoic threshold-hammingdistance4 online free url in huggingface.co:
threshold-hammingdistance4 is an open source model from GitHub that offers a free installation service, and any user can find threshold-hammingdistance4 on GitHub to install. At the same time, huggingface.co provides the effect of threshold-hammingdistance4 install, users can directly use threshold-hammingdistance4 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
threshold-hammingdistance4 install url in huggingface.co: