There is no black and white. Human perceived black for no visible light, and
some composition of light wavelengths is perceived as white. To measure the
grayscale, we want to quantify what is black and what is white.
[more]
Timezone in Python
The UNIX epoch is always in UTC. There’s no such thing as local epoch. To get
the epoch in command line, you do date +%s, or in Python, time.time(). It
doesn’t matter if time.localtime() and time.gmtime() are different, the
epoch is universally consistent across timezone.
[more]
concurrent.futures in Python
The Python standard library concurrent.futures is the easiest way to run
parallel jobs in the best-effort manner. In case the heavy jobs are run
off-interpreter (e.g., NumPy) using the thread pool from concurrent.futures
can give you some noticeable performance benefit.
[more]
Photo Color Adjustment
Photos are matrices of pixels. Each pixel can be a tuple of RGB values (the most common) or other color spaces such as Lab or HSV. RGB is great for its additive nature. HSV, however, considered hue as an angle in some arbitrary order. It is better than RGB if...
[more]
Peng et al (2023) YaRN: Efficient Context Window Extension of Large Language Models
This paper studies the positional encoding in large language models, since it is the factor that needs to change if we want to support a longer context length than it was pretrained. The original transformer model’s position encoding scheme was called the absolute sinusoidal position encoding. Then, there are models...
[more]