INNER CODE UNIT · Python

inverse

lucidrains/vector-quantize-pytorch · vector_quantize_pytorch/binary_mapper.py:36

    def inverse(out, inv_pattern = None):
        inv_pattern = default(inv_pattern, pattern)
        unpacked, = unpack(out, ps, inv_pattern)
        return unpacked

    return packed, inverse

# binary mapper

class BinaryMapper(Module):
    def __init__(
        self,
        bits = 1,
        kl_loss_threshold = NAT, # 1 bit
        deterministic_on_eval = False
    ):
        super().__init__()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…