@Livpure_India@LivpureSmart you guys can come take your RO, and please refund me the rest of this year's fund. The service is pathetic, I have been following up since 18th July, it's 30th July now. Your technicians don't pick up. You guys don't follow up. Why should I continue?
In today's episode of programming horror...
In the Python docs of random.seed() def, we're told
"If a is an int, it is used directly." [1]
But if you seed with 3 or -3, you actually get the exact same rng object, producing the same streams. (TIL). In nanochat I was using the sign as a (what I thought was) clever way to get different rng sequences for train/test splits. Hence gnarly bug because now train=test.
I found the CPython code responsible in cpython/Modules/_randommodule.c [2], where on line 321 we see in a comment:
"This algorithm relies on the number being unsigned. So: if the arg is a PyLong, use its absolute value." followed by
n = PyNumber_Absolute(arg);
which explicitly calls abs() on your seed to make it positive, discarding the sign bit.
But this comment is actually wrong/misleading too. Under the hood, Python calls the Mersenne Twister MT19937 algorithm, which in the general case has 19937 (non-zero) bits state. Python takes your int (or other objects) and "spreads out" that information across these bits. In principle, the sign bit could have been used to augment the state bits. There is nothing about the algorithm that "relies on the number being unsigned". A decision was made to not incorporate the sign bit (which imo was a mistake). One trivial example could have been to map n -> 2*abs(n) + int(n < 0).
Finally this leads us to the contract of Python's random, which is also not fully spelled out in the docs. The contract that is mentioned is that:
same seed => same sequence.
But no guarantee is made that different seeds produce different sequences. So in principle, Python makes no promises that e.g. seed(5) and seed(6) are different rng streams. (Though this quite commonly implicitly assumed in many applications.) Indeed, we see that seed(5) and seed(-5) are identical streams. And you should probably not use them to separate your train/test behaviors in machine learning. One of the more amusing programming horror footguns I've encountered recently. We'll see you in the next episode.
[1] https://t.co/srv1ZBlDsi
[2] https://t.co/qpnKdvfVNS
Releasing INTELLECT-1: We’re open-sourcing the first decentralized trained 10B model:
- INTELLECT-1 base model & intermediate checkpoints
- Pre-training dataset
- Post-trained instruct models by @arcee_ai
- PRIME training framework
- Technical paper with all details
Using light as a neural network, as this viral video depicts, is actually closer than you think. In 5-10yrs, we could have matrix multiplications in constant time O(1) with 95% less energy. This is the next era of Moore's Law.
Let's talk about Silicon Photonics...
1/9
The Blindsight device from Neuralink will enable even those who have lost both eyes and their optic nerve to see.
Provided the visual cortex is intact, it will even enable those who have been blind from birth to see for the first time.
To set expectations correctly, the vision will be at first be low resolution, like Atari graphics, but eventually it has the potential be better than natural vision and enable you to see in infrared, ultraviolet or even radar wavelengths, like Geordi La Forge.
Much appreciated, @US_FDA!
The bacterial flagellar motor can spin at 100,000 RPM in one direction, then switch gears and flip to spinning in the other direction.
How does this work?
Cryo-electron microscopy reveals some of the nanoscale mechanics involved:
https://t.co/WwJFDbz2c1
https://t.co/htw1kYf6Uw
RGB image datasets have fueled innovation in computer vision, graphics, and AI. However, it is the RGB intensity format that restricts us to the level of human vision. In our CVPR '24 highlight paper, we explore polarization and spectrum, wave properties of light that animals in harsh environments and with limited brain capacity often rely on. We provide the first spectro-polarimetric image dataset with multiple spectral channels and full Stokes-vector images for diverse real-world scenes. We envision overcoming the capabilities of human vision and hope this dataset will assist in that endeavor.
Work done by Yujin, Eunsue (@EunsueChoi), Youngchan, Yunseong, Khalid, Felix (@_FelixHeide_), and myself.
Project website: https://t.co/ESlVpWiZMR
Yet another #DigitalIndia#FAIL
The idiots at @DigiYatraOffice didn't realise their package name didn't match their org/domain.
in.dataevolve.digiyatra /
https://t.co/plD9fjuE00
ie. "Official" DigiYatra app was no different from malicious apps pretending to be them.
This is me at Microsoft in 1994, posing with the dollar bill I won in a bet over the Windows 95 shell.
I was working with a guy named Bob Day and a few other devs to port the Windows 95 user interface over to Windows NT. Even though a year of work would remain for Unicode conversion and feature work, our first task was to get the code compiling for NT. That meant adapting every system call that differs between 95 and NT, handling cases that just won’t work on NT, and so on. For example, on Windows 95, you can re-initialize a critical section, but on NT, you cannot. And 95 shared a memory section amongst all shell processes, and so on.
After a few weeks of work I finally got it to compile, and out popped explore.exe and shell32.dll. I was so excited that I ran to grab Bob from his office to show him like a little kid.
Bob and I sat in front of my old CRT and did the obvious thing: we ran it to see what happened. But first, we took bets on how far we thought the code might make it. Bob thought it would die in DllAttach, or somewhere similarly early in the shell’s startup code. I was more optimistic. In fact, I bet it’d get all the way to the desktop.
I typed “explorer” and hit Enter. My hard drive churned a while - this was a big debug build after all, and my 486DX2-50 dev machine only had 12M of memory, even though I thought that was a lot at the time! Log messages scrolled up the screen of the amber VT220 that I had attached as a serial debugger, and a few seconds later, the PC’s screen turned that classic sea foam green!
A few seconds after that, icons appeared. They were mostly wrong, and the labels were missing, but it was the desktop! We sat in wonder that it had made it that far for a little while, and then I got greedy, and I think I clicked on the start menu or did something like that, and it crashed. But it had made it to the desktop, and Bob paid me my dollar.
“Well done", he said.
I went to put it in my pocket, but he immediately said “Don’t put it in your pocket, it’s your lucky dollar!”
I asked him, “Well, where do you want me to put it?”.
“Anywhere, but not in your pocket. Or it will get mixed in with the others and become just a dollar. Which it is."
He raised his eyebrows, turned, and left.
And so I pinned it to my cork board, where it stayed the rest of my career at Microsoft!
Follow me for more random Windows trivia tales!
"This patchset takes decoding of a 1080p HEVC clip from 402 fps to 649 fps on an Apple M1."
An astonishing ARM assembly patchset:
https://t.co/Xhr8l8rArO
I wrote this Format dialog back on a rainy Thursday morning at Microsoft in late 1994, I think it was.
We were porting the bajillion lines of code from the Windows95 user interface over to NT, and Format was just one of those areas where WindowsNT was different enough from Windows95 that we had to come up with some custom UI.
I got out a piece of paper and wrote down all the options and choices you could make with respect to formatting a disk, like filesystem, label, cluster size, compression, encryption, and so on.
Then I busted out VC++2.0 and used the Resource Editor to lay out a simple vertical stack of all the choices you had to make, in the approximate order you had to make. It wasn't elegant, but it would do until the elegant UI arrived.
That was some 30 years ago, and the dialog is still my temporary one from that Thursday morning, so be careful about checking in "temporary" solutions!
I also had to decide how much "cluster slack" would be too much, and that wound up constraining the format size of a FAT volume to 32GB. That limit was also an arbitrary choice that morning, and one that has stuck with us as a permanent side effect.
So remember... there are no "temporary" checkins :)
Follow me for more random code musings!