3 ms·
I mean, that's a strange thing to say since PyTorch and especially Python are much further from the math than Julia and Flux. For example, if I want to regular
by dunefox 6y ago
I mean, that's a strange thing to say since PyTorch and especially Python are much further from the math than Julia and Flux.
For example, if I want to regularise a layer:
PyTorch:
l2 = layer.pow(2).sum()
loss += lambda * l2
Julia:
l2 = sum(layer .^ 2)
loss += λ * l2
I can just use regular Julia functions whereas in PyTorch I need to use special PyTorch functions as to not detach the tape. This only gets worse and less readable the more complex things I want to do.
- stared 6y agoI guess one core thing is that I don't think that the traditional mathematical notation is particularly consistent. (For a reference, I published over a dozen mathematical papers.) I love when the "data-flow" is consistent, from left to right. The Julia code (and traditional mathematical notation) reads: middle, right, left. Plus, instead of inventing infix notation, I find it cleaner to write custom methods/functions rather than rely on (a fixed, limited, and non-apparent) set of built-in inflix operators. Made-up .^