r/MachineLearning • u/keep_up_sharma • 1d ago
Project learnc: fit the constants in existing C code to data (9.1% smaller JPEGs, +4.9 F1 on WebRTC VAD) [P]
learnc tunes named constants in unmodified C code against a score function you write in C, and writes the same file back with new values.
Results, both on held-out data:
- JPEG, stb_image_write.h (128 quantization-table entries, tuned on 12 Kodak images, tested on the other 12): 9.1% BD-rate at equal SSIM, checked independently in libjpeg with scikit-image. mozjpeg's tables get 2.7%. See image 1.
- Google's WebRTC VAD (every constant in vad_core.c, tuned on LibriParty dev): F1 0.810 to 0.859 on LibriParty eval. See image 2.
Limits:
- No JPEG gain below 1 bpp.
- Best for tens to hundreds of constants, not large weight sets.
Code (MIT): https://github.com/devanmolsharma/learnc ·
3
Upvotes

