Hacker News new | past | comments | ask | show | jobs | submit | muragekibicho's comments login

Just sharing some notes I compiled while building Mediant32, an alternative to fixed-point and floating-point for error-aware fraction computations. I was experimenting with continued fractions, the Stern-Brocot tree, and the field of rationals for my programming language. My overarching goal was to find out if I could efficiently represent floats using integer fractions. Along the way, I compiled these notes to share all the algorithms I found for working with powers, inverses, square roots and logarithms (all without converting to floating point) I call it Mediant32 and the number system features: 1. Integer-only inference. (Zero floating point ops) 2. Error aware training and inference. (You can accumulate errors as you go) 3. Built-in quantization for individual matrix elements. (You're working with fractions so you can choose numerators and denominators that align with your goals)


Other paper implementations have code. I realized the papers I implement using long-form latex math examples tend to do better.

So my pure coding implementation of Blankinship's algorithm : https://leetarxiv.substack.com/p/paper-implementation-blanki...

Performed much worse than my written implementations.

Let me know what you think


Unfortunately I hit a paywall.


My bad. Let me remove it. It's the Substack 2-week autopaywall setting. Try now


Lehmer’s continued fraction factorization algorithm was used to factor the seventh Fermat number in 1975.


The first counteraxample that comes to mid is Idi Amin, the Ugandan dictator. He murdered, pillaged and lived out the rest of his years (happily and luxuriously) in Saudi Arabia.

He lived "in a villa rented for him by the government of Saudi Arabia in the posh Al Hamra district". https://www.dawn.com/news/135283/idi-amin-led-quiet-life-in-...


I'd love to know the results of your test. Plese let me know if there's a social media account where you'll post your results.


Can one copy a firefox profile to Vivaldi? Do you think it's possible?


Probably not since they are based on completely different browsers. You can import bookmarks, passwords, etc. though.


I believe he's describing Orthogonal Matching Pursuit. It's a dictionary learning algorithm that can be used to recover sparse dictionarries using L1 regularization.


Not quite, though very related and I believe both should end up with essentially the same result.

Matching pursuit is essentially a greedy algorithm, if I recall correctly - please do correct me if I am wrong, where you conceptually find the component that explains the most data at each iteration, remove it, and then repeat the process on the residual data. Pardon if that isn’t quite the right explanation, but it’s what my intuition is recalling right now…

What I was describing was a simpler algorithm that can be done with gradient descent or any other vanilla optimizer.

Your model parameters are the coefficients a_i over all basis functions in the frequency ___domain representation. Run them through the synthesis function to get a time ___domain signal, and select the values of the time ___domain signal where your target data is known. Compute the squared error at each of those locations, and take the mean. This is your reconstruction error, and should be trivially differentiable with respect to the coefficients a_i. Compute an additional error term which is a standard L1 regularization, ie sum(|a_i|), which can be added to the reconstruction error term with some weight λ (λ=1 is even fine here, at least for simple problems), and then is also trivially differentiable (provided you haven’t initialized any of the coefficients to 0). As with any L1 regularization term, the resulting solution should be sparse in the L1 regularized parameters (look up visualizations of problems with only 2 model parameters to see how this emerges from the L1 contour lines of equal loss forming “diamonds” with the points on the axes).


ah got it -- thank you!


Not quite - see my response for to GP for what I was describing.


ahi interesting

so residual error derivatives in a sense?

the diamond construct also feels evocative of dimer &/or branched manifold / lattice methods, be that Viterbi or otherwise 2.2 in op post is reminiscent of that, e.g., if we view the DCT reconstruction as implicit matched filter

yes in theory should converge on similar result may quickly get into alternating conic optimization especially depending how the signal pair constructed, e.g., if one signal is an ECC &/or if L1 regularization is operating as an error squasher alternating op,

definitely good stuff


> so residual error derivatives in a sense?

Yep, loss = residuals*2 + lambda*sum(|a_i|), and we take the gradient of that with respect to the a_i to guide our gradient descent steps.


Context He rediscovered Blankinship's algorithm from 1963. He independently learnt that one can factor a number using it's integer partitions and gaussian row operations.

It's pretty impressive given the original 1963 author (hidden behind a Journal paywall) discovered this while working for the US Department of Defense.


Polymarket poll that 'recombobulate' enters Nigerian conversational register before Jan 2027.


For maximum clarity, is there a positive or negative relationship between warranty length and longevity?


Positive and strongly correlated, as long as the part is not a fake from a fly-by-night shop.

I personally buy SD cards and USB memory sticks from bhphotovideo, whose customers (pro and enthusiast photographers), care greatly about not losing their images, so B&H watches their suppliers closely. My 2c.


Positive. A longer warranty means they don’t think it will fail during that period (i.e. higher longevity).


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: