Readit News logoReadit News
jeremyscanvic commented on The lottery ticket hypothesis: why neural networks work   nearlyright.com/how-ai-re... · Posted by u/076ae80a-3c97-4
gotoeleven · 8 days ago
This article gives a really bad/wrong explanation of the lottery ticket hypothesis. Here's the original paper

https://arxiv.org/abs/1803.03635

jeremyscanvic · 8 days ago
Exactly what I was looking for while reading the post. Thanks!
jeremyscanvic commented on Lazy-brush – smooth drawing with mouse or finger   lazybrush.dulnan.net... · Posted by u/tvdvd
jeremyscanvic · 8 days ago
Neat! This is known as a stabilizer in the digital art community.
jeremyscanvic commented on Ask HN: What trick of the trade took you too long to learn?    · Posted by u/unsupp0rted
pydry · 22 days ago
Damn. I would have written the exact opposite.

Moreover, it is counter intuitive, too. The instinct of most juniors is to build foundations first and it took me a long time to learn to do the opposite.

Each layer serves as a customer for the layer above. If you havent figured out what the layer above needs precisely by building it you're probably going to provide the wrong thing to it in the layer underneath if you write it first.

It's also more resilient to requirements mistakes and requirements changes - it's easier to change course on a feature after showing a UI to a stakeholder if you didnt build the lower layers.

jeremyscanvic · 22 days ago
I think we have different things in mind here - I believe you're thinking of upper vs lower layers of code and I'm thinking of the code being literally at the top or bottom of a script or function. Thanks for sharing your thoughts anyway!
jeremyscanvic commented on Ask HN: What trick of the trade took you too long to learn?    · Posted by u/unsupp0rted
jeremyscanvic · 22 days ago
Writing code from bottom to top instead of from top to bottom. Usually the interesting stuff happens in the bottom part and the top part is merely prepping data and taking care of edge cases: it's way easier to write it once you know how you're gonna end up using it.
jeremyscanvic commented on Perfecting anti-aliasing on signed distance functions   blog.pkh.me/p/44-perfecti... · Posted by u/ibobev
jeremyscanvic · 23 days ago
Really interesting write-up! I'm not very familiar with signed distance functions but aliasing is a major part of my PhD and this is really insightful to me!
jeremyscanvic commented on Parse, Don’t Validate – Some C Safety Tips   lelanthran.com/chap13/con... · Posted by u/lelanthran
hansvm · a month ago
One flaw I've seen in "Parse, Don't Validate" as it pertains to real codebases is that you end up with a combinatorial prolieration of types.

E.g., requiring that a string be base64, have a certain fixed length, and be provided by the user.

E.g., requiring that a file have the correct MIME type, not be too large, and contain no EXIF metadata.

If you really always need all n of those things then life isn't terrible (you can parse your data into some type representing the composition of all of them), but you often only need 1, 2, or 3 and simultaneously don't want to duplicate too much code or runtime work, leading to a combinatorial explosion of intermediate types and parsing code.

As one possible solution, I put together a POC in Zig [0] with one idea, where you abuse comptime to add arbitrary tagging to types, treating a type as valid if it has the subset of tags you care about. I'm very curious what other people do to appropriately model that sort of thing though.

[0] https://github.com/hmusgrave/pdv

jeremyscanvic · a month ago
You might be interested in Lean's way of doing things. They have normal types (e.g. numeric types) and subtypes (e.g. numbers less than zero). An element of the subtype "numbers less than zero" can be understood as a tuple containing the actual number (which has a normal numeric type) and a proof that this specific number is indeed less than zero.

https://lean-lang.org/doc/reference/latest/Basic-Types/Subty...

jeremyscanvic commented on Solving Wordle with uv's dependency resolver   mildbyte.xyz/blog/solving... · Posted by u/mildbyte
davejagoda · 2 months ago
Yet another reason to use `uv`!

I try to avoid bugs like this:

By accident, at first, I omitted the letter u in my list of letters that I was generating packages for, which caused extremely cryptic and long (500KB of uv painstakingly explaining to me why I was wrong) dependency resolution errors on specific guesses:

by doing this:

  import string
  LETTERS = string.ascii_lowercase
instead of this:

  LETTERS = "abcdefghijklmnopqrstuvwxyz"
It's a few more characters to type, but easier to examine for correctness.

jeremyscanvic · 2 months ago
That's really neat. I didn't know about those string constants!
jeremyscanvic commented on My first verified imperative program   markushimmel.de/blog/my-f... · Posted by u/TwoFx
jeremyscanvic · 2 months ago
That's really neat! I'm very excited for the future of Lean.
jeremyscanvic commented on Verified dynamic programming with Σ-types in Lean   tannerduve.github.io/blog... · Posted by u/rck
jeremyscanvic · 2 months ago
Really interesting trick!

u/jeremyscanvic

KarmaCake day125November 4, 2023
About
https://jeremyscanvic.com/
View Original