Re:What I wish someone had told me about tensor computation ...
by harperlee on Wednesday December 16, 2020 @03:41AM
(#25440334)
But that's due to named parameters vs. positioning, not parenthesis; I can mirror your argument with:
Python:
model = Sequential()
model.add(Conv2D(32, (3, 3),'relu', (28, 28, 1)))
Clojure: (defonce net-bp
(network (desc :input-shape [128 1 28 28]
:type :float
:something :nchw)
It all depends on how desc is defined.Disclaimer: no idea what those functions mean, I only made syntactic changes.
Re:What I wish someone had told me about tensor computation ...
by susam on Wednesday December 16, 2020 @03:39AM
(#25440324)
> Which one is more readable?
Both are equally readable to me.
Now, granted 128 1 28 28 can be difficult to understand without documentation but that is not due to Lisp's fully parenthesized prefix notation. The Clojure code would also look equally readable if it had used keyword arguments.
Are you sure you are not confounding familiarity with readability? With Lisp, after a while, the parentheses become invisible to the programmer.
Python:
Clojure: Which one is more readable? looking on the Clojure code I see 128 1 28 28 thrown on me, without digging in the documentation I have no idea what's happening.