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]
Reading the LLaMA code
The LLaMA and LLaMA 2 model released by Meta/Facebook is available on GitHub and there’s a guide to help you using it. Of course, from Meta, this model is using PyTorch. But surprisingly, the repo on GitHub is very short that you can read and understand it in a day...
[more]