4 ms·
Floats seem like a pretty bad data format for ML (Also in general). Infinity, NaN, -0 all useless. NaNs in particular have multiple binary representations so wa
by notnullorvoid 3y ago
Floats seem like a pretty bad data format for ML (Also in general). Infinity, NaN, -0 all useless. NaNs in particular have multiple binary representations so waste extra space.
Not sure why more effort isn't being put toward Posits, or thinking up a different format for ML specifically.
- jcranmer 3y agoWell, if you actually read the document, that's not how NaN is encoded in these data types--these are not IEEE 754-compliant encodings. As for why not posits, I'm not entirely sure, but the "variably-encoded exponent width" nature of posits likely makes several details of their construction in hardware more difficult than things that have fixed exponent and mantissa widths. Although by the time you're talking about 8-bit datatypes, implementing operations by lookup table starts to look appealing.
- notnullorvoid 3y agoAhh okay wasn't aware the encodings were different, after taking a glance at spec it seems much better than what I pessimistically envisioned. 2 NaNs, and -0 still seem like a bad call (-0 could have been the singular NaN), but I guess I understand maybe why they don't want to deviate too much from IEEE754 floats.
- quotemstr 3y agoMeanwhile, people look at you like you have two heads if you suggest using anything other than "float" in certain contexts. "How can you do subpixel positioning without float?!?!?! This is unacceptable!" "You can use 1/1000 of a dp to express fractional pix..." "FLOATS. FLOATS GIVE US FRACTIONS. WHY DO YOU HATE OUR CUSTOMERS?". IEE754 floats should never have been a primitive in any programming language. Library type only.