HNHacker News
TopNewBestAskShowJobs

the_origami_fox

539 karma · joined June 30, 2020

submissionscomments
the_origami_fox··on One Genius' Lonely Crusade to Teach a Computer Common Sense (2016)
2016
the_origami_fox··on Radix Tree in Julia
Author here. While researching this topic I came across this article https://www.geeksforgeeks.org/compressed-tries/ by GeeksForGeeks (compressed trie is another name for radix tree). Currently it is one of the top results on Google for this topic. Generally I've found GeeksForGeeks to be a good resource, but this article is especially poor. The code is bizarre and makes no sense:

- It defines properties like 'bitNumber', 'leftChild' and 'rightChild' which have nothing to do with this type of tree.

- The search function search(k) calls an overloaded version of itself search(root, k) that is (1) illegal in these languages and (2) not defined.

- The insert function does not account for all scenarios.

And more.

I'm fairly convinced this was written with the assistance of a LLM. That would be a logical explanation to all those illogical choices.

the_origami_fox··on Show HN: Name That Nation
The pictures come straight from Wikipedia. From the picture for North Korea (https://en.wikipedia.org/wiki/North_Korea): Territory controlled by North Korea shown in dark green; territory claimed but not controlled shown in light green.
the_origami_fox··on Pythagorean Theorem found on clay tablet 1k years older than Pythagoras (2009)
And if you choose b=x/10, x/100, x/1000 ... then each iteration will add the exact decimal point.
the_origami_fox··on Pythagorean Theorem found on clay tablet 1k years older than Pythagoras (2009)
For anyone wondering how they got the approximation sqrt(2)=1+24/60+51/60^2+10/60^3.

It's based on the simple idea that:

     Z = (a + b)^2 = (a^2 + (2a+b)*b)
  => (2a+b)* b < Z-a^2
Given an initial estimate "a", we need to find the largest "b" such that the term on the left is less than the term on the right. Therefore our estimate will always be slightly less than the actual answer and we can repeat the process to get slightly closer.

For the first iteration, Z=2 and a=1. We choose b=x/60:

  (2+x/60)*x/60 < 2-1^2
  120x + x^2 < 3600
  x = 24 ... 3456 < 3600
  x = 25 ... 3625 > 3600
So our first term is 24/60.

Repeat with a=1+24/60 and b=x/60^2:

  (2(1+24/60)+x/60^2)*x/60^2< 2-(1+24/60)^2
  10080x+x^2 < 518_400
  x = 51 ... 516_681 < 518_400
  x = 52 ... 526_864 > 518_400
Repeat multiple times.

Writing this in code I can easily get: 1;24,51,10,7,46,6,4,44,50,28 = 1.4142135623730951

This whole process can be codified into the long division algorithm for square roots which works quite neatly with base 10.

Edit: formatting

the_origami_fox··on Ask HN: Could you share your personal blog here?
https://liorsinai.github.io/ long detailed posts on mathematics, machine learning and algorithms. Most of the code is in Julia but older posts also feature Python, C# and C++. I recently did posts on Transformers and Diffusion Denoising Probabilistic models.

The most popular post is a Sudoku solver in Python.

the_origami_fox··on Denoising Diffusion models from first principle in Julia
Auuthor here. Will update.
the_origami_fox··on Denoising Diffusion models from first principle in Julia
Author here. I have noticed similar behaviour. As part of this exercise I tried to train a model to generate Pokemon based on This Pokemon Does Not Exist by HuggingFace. However my models only converged to nosiy smudges after 50 iterations and so I excluded it from the posts (I do mention my experiments at the end of part 2).

My first assumption was that the mdoel I was training was too small: 13 million parameters as opposed to the 1.3 billion in ruDALL-E (not sure how much of this is only the diffusion model). So that's a 100x smaller. I want to experiment with upscaling it.

Reading this I'm wondering if there's more I need to do. For example, training a conditioned model - "cheat" by given it in the index of the Pokemon during training but then you sample without an index - or make the model predict the standard deviation (beta tilde). Or as you say, work with loss functions.

More work to be done here.

the_origami_fox··on Grade inflation: What goes up must come down
I went to a university in South Africa which had the opposite problem, grade deflation. The engineering school was masochistic in its obsession with lowering grades and failing students. Despite working extremely hard I went from 90%s to 60%s. But I was considered lucky because most students failed (and by most I mean +90% of the class) and repeated years. I did not. The lecturers repeatedly blamed the students but if even A students are failing I think it's not the students fault, it's the school's.

My university teamed up with an American University, Embray-Riddle, to offer a joint masters. Embray-Riddle required a minimum average grade of 80%; my university came back to them and said no one in the last 10 years qualified for the masters. Eventually they lowered the requirements just so they could have students.

Later I did my masters in the Netherlands. The university made me do extra courses to compensate for my low grades. But I ended up doing reasonably well with an 8/10 average and was the top student in a few subjects.

Grade inflation sounds bad but I can positively say that grade deflation is worse. It badly demotivates students and robs them of years of their life as they repeat courses.

the_origami_fox··on Electrical engineers on the brink of extinction threaten entire tech ecosystems
I'm a mechanical engineer and I can give a similar perspective. I'm now in software engineering and I'm doing well. My other classmates who moved into consulting or finance are doing even better. Those who stayed in engineering have struggled. I live in a developing country: too poor to manufacture anything high-tech, too rich with strong labour laws to manufacture anything low-tech. My friends who stayed in engineering are "installation engineers" or "sales engineers" or "stand-by engineers" since the products they use/sell/watch over are designed elsewhere. Those who are in design firms have suffered layoffs and company bankruptcies.

My friends in engineering are passionate about what they do which is why they stick with it. I like the intellectual challenge I get from software engineering and the people I work with. I'm glad I get paid well for it too. I don't think I would get the same level of stimulation in an "engineering" firm here and certainly not the same salary.

the_origami_fox··on How Websites Die
The automated url # fragments on highlights for this website is a cool but weird feature
the_origami_fox··on Building a transformer in Julia
Author here. Indeed, the HackerNews teams moved this to a second chance pool for me; very nice of them
the_origami_fox··on Cities with Nice Weather
Johannesburg, South Africa. A city with many problems but everyone agrees the weather is great. Average temperature per month ranges from 10C to 20C. Extremes are normally between 0C and 30C. (It can feel very cold when it goes below 0C because the housing is not built for that.) Low humidity. It rains less than 90 days a year and most of that is in short, concentrated afternoon thunderstorms in the summer. I'd have expected this analysis to readily propose a city like this.
the_origami_fox··on Ali, what’s up
In the image it's the grey text in the red bar next to AliExpress. I know Dutch as a second language and it pops out as very rude, like something you would see on a porn site. The Google Translation is accurate.
the_origami_fox··on Help Is This Arabic?
I've seen the same with Hebrew. It's not nearly as widely spoken as Arabic but graphic artists like to include it on their designs and so on because of the unique letters which really contrast to the Latin alphabet.

Mistakes include: 1) Left to right letters 2) Bad translations, especially dating to the days when Google translate was not as good. 3) Incorrect grammar e.g. singular instead of plural, masculine words mixed with feminine. "Welcome" should be plural unless you really only want to welcome one person! 4) Spelling typos

the_origami_fox··on Quaternions
Author here: these typos totally eluded me. Will fix them.
the_origami_fox··on Quaternions
Author here: thanks for the tip. Definitely think this looks better
the_origami_fox··on 100 years to solve an integral: The history of the Mercator map
It matters here in the sense that to show the poles, you need to stretch the Mercator map to infinity, because the function sec(x) is undefined at 90 degrees. This is clearly absurd, so map makers get around the problem by cutting the top of the map off, usually around the 85 degrees parallel. I chose not to include this detail in the article.

To slightly misquote the great Richard Feynman, "It turns out that it's possible to sweep the infinities under the rug by a certain crude skill." :)

the_origami_fox··on 100 years to solve an integral: The history of the Mercator map
This is not what I meant XD You want roads in real life that are straight to look straight on a map. Actually, most global map projections do not meet this simple requirement. For an extreme case, think of how compressed everything is at the top of Lambert's map.

Very long roads are not truly straight because they follow the curvature of the earth, but I was not referring to those. In any case, you're more likely to notice winding around local topology and local elevation changes on long road trips.

Also see roywiggins answer :)

the_origami_fox··on 100 years to solve an integral: The history of the Mercator map
Yes you're right. It has to do with how he derived the approximation formula for the natural logarithm. He needed a function y=sin(x) for his log(y) calculations. But I am not sure when the log(f(x))) tables for the other trigonometric functions came about. As far I understood, initially a single log(y) table sufficed.
← PreviousPage 2 of 2