Re:Deep Learning in JavaScript
by eduardoleao052 on Friday March 29, 2024 @10:18AM
(#39864408)
Thats true, itβs a limitation of working between these languages. I tried to mitigate it by using clear JSDoc, so that each variable pops up alongside an explanation when calling a function.
I feel you - Python has much better (more flexible) argument support than JavaScript in this case. Converting the entire set of arguments into a keyed object is usually what happens, but then it wouldn't look like PyTorch anymore.
Edit: formatting
Making JavaScript look like Python in this case could potentially bite you in the ass.
From the example:
And: For both `requires_grad` and `dropout_p` you wouldn't be able to change the ordering + you're creating global variables.