←back to thread

170 points judicious | 4 comments | | HN request time: 0.602s | source
Show context
Legend2440 ◴[] No.45406467[source]
Article doesn’t mention this, but I’d consider neural networks a form of branchless programming. It’s all a bunch of multiply and threshold operations.
replies(2): >>45406503 #>>45407289 #
1. abyesilyurt ◴[] No.45406503[source]
Thresholding requires branching no?
replies(3): >>45406688 #>>45406694 #>>45407482 #
2. WJW ◴[] No.45406688[source]
No, you can do that without branching. See https://en.algorithmica.org/hpc/pipelining/branchless/#predi... for example.
3. Legend2440 ◴[] No.45406694[source]
No, it’s just a math operation and can be applied to any amount of data in parallel.
4. bqmjjx0kac ◴[] No.45407482[source]
As demonstrated in the article, you can compute clamp(x, min, max) with straight-line code.