←back to thread

1901 points l2silver | 1 comments | | HN request time: 0.202s | source

Maybe you've created your own AR program for wearables that shows the definition of a word when you highlight it IRL, or you've built a personal calendar app for your family to display on a monitor in the kitchen. Whatever it is, I'd love to hear it.
1. AlexVN ◴[] No.35765812[source]
I came up with a lot of small custom algorithms for my thesis, all based on np.einsum. I had to estimate the assymptotic complexity for them, and every time I would get a different answer than the last. So at some point I built a system to which you give an einsum expression and a mapping between axis and their names and you get the assymptotic complexity (e.g. for MxN times NxM matrix multiplication 'ij,jk->ik' you would use {'i': 'M', 'j': 'N', 'k': 'M'} to get O(M^2 N) complexity). It also supports chains of einsum expressions, summing the complexities together and symbolically simplifying. And it uses opt_einsum to reorder the operations to get the best possible asymptotics for an expression.