Re:Concise algorithms written in Julia
by discmonkey on Friday July 09, 2021 @12:09PM
(#27785182)
Gradient descent is a pretty common algorithm, and I've seen it implemented in everything from JavaScript to c++. I have to say in this case the notation is significantly more distracting than helpful imo. Or to put it another way, the set of people working in the ml field, is both larger and more diverse than the set of people working purely in math. Everyone in the population of people who can both program and understand this type of notation would also be able to understand the less terse but more readable utf8 based text, the inverse is not true.
Re:Concise algorithms written in Julia
by generalizations on Friday July 09, 2021 @12:12PM
(#27785220)
I think that means this code in particular is not catering to the lowest common denominator of people using the algorithm, but is instead aimed to be easy to use by those already fluent in the domain. It's important for both types of implementations to exist, and as you say, there's lots of other implementations available for those not familiar with the mathematical notation.
> I think that means this code in particular is not catering to the lowest common denominator of people using the algorithm
Maybe the title should have been 'Algorithms that look concise and beautiful to people who already know them'.
Re:Concise algorithms written in Julia
by icedistilled on Friday July 09, 2021 @06:45PM
(#27789362)
>is not catering to the lowest common denominator of people using the algorithm
I don't think an expert in some field who just happens not to be an expert in some other field's jargon and pictographs should be branded "a lowest common denominator of people", this terminology is both judgmental and elitist in all the bad ways.
Re:Concise algorithms written in Julia
by TheTrotters on Friday July 09, 2021 @06:02PM
(#27789031)
Anyone who has even basic fluency with these algorithms has ~never worked with code that uses these symbols and will likely find them distracting in this context.
I've seen plenty of function use, say, `theta` but I have never worked with θ.
Is it easier to use? Or just it just look pretty to a subset of people?
Re:Concise algorithms written in Julia
by generalizations on Friday July 09, 2021 @01:01PM
(#27785841)
It's easier.
There's a reason we use 'y = mx + b' instead of 'range = slope * domain + intercept' when we're doing math calculations. It's nice to use the long form when we're learning what the symbols are, but the symbols enhance readability when you're doing math, once you've become familiar with the meaning of the terms.
I'd be tempted to challenge this assertion. It made sense when handwriting to maximize for not having to spend too much time writing, but with modern auto-complete, I might start to believe that it be clearer to use the long form for everyone, yes even for a person familiar with mathematics. If all math was rewritten long form, I feel it would honestly have second order effect on approachability and being able to understand papers even from other mathematicians.
Re:Concise algorithms written in Julia
by patrick451 on Friday July 09, 2021 @10:48PM
(#27790731)
Hard disagree. Just reading 'range = slope * domain + intercept' is tedious and takes 10 times as long.
If you're branching out into other code, you can always ask Julia itself what a particular character is — just paste it into a help prompt at the REPL: