Do you plan to implement WebGPU acceleration to make it production-ready?
I am currently studying Typescript and other JavaScript libraries to improve the library’s performance. So adding GPU support is in sight in the future.
Deep Learning in JavaScript
31–40 of 92 posts
Re: Deep Learning in JavaScript
#32See: https://github.com/xenova/transformers.js/blob/8804c36591d11...
This is really old, but added as part of the shape of the vector as well: https://github.com/nicolaspanel/numjs/blob/master/src/dtypes...
Re: Deep Learning in JavaScript
#33Many people seem to be unaware of tensorflow.js, an official JS implementation of TF https://github.com/tensorflow/tfjs I'd love to see PyTorch in JS, but I think unless you get it running on the GPU it won't be able to do much.
Re: Deep Learning in JavaScript
#34Someone needs to do a TypeScript compiler plugin to add multidimensional array slicing and operator overloading to the language, so these libraries can actually work the way PyTorch does. I know operator overloading is controversial, but the way it allows automatic differentiation to work transparently through regular arithmetic expressions is very helpful. Without it these libraries will never feel like PyTorch. Jav…
Could not agree more hahaha! I tried to work around it building methods like “torch.add(a, b)” for operator overloading and “torch.at(index)” for slicing. But it’s definitely not as seamless as these features you proposed.
[edit] nevermind, I missed the cache step. Still not sure it wouldn't be more performant to centralize caches as plain objects somewhere rather than to call new() on every op...?
Re: Deep Learning in JavaScript
#35Earlier quoted context omitted.
Could not agree more hahaha! I tried to work around it building methods like “torch.add(a, b)” for operator overloading and “torch.at(index)” for slicing. But it’s definitely not as seamless as these features you proposed.
You should do it! If you actually had a solution for operator overloading you'd really stand out from the other various JS deep learning libraries. Save me from pip and conda please :)
Re: Deep Learning in JavaScript
#36Earlier quoted context omitted.
Could not agree more hahaha! I tried to work around it building methods like “torch.add(a, b)” for operator overloading and “torch.at(index)” for slicing. But it’s definitely not as seamless as these features you proposed.
Curious, why do you need to construct these as class instances, like operation = new Exp() ? Seems like a lot of extra overhead constructing those objects. Why not just have Exp contain static methods for forwards and backwards? [edit] nevermind, I missed the cache step. Still not sure it wouldn't be more performant to centralize caches as plain objects somewhere rather than to call new() on every op...?
Re: Deep Learning in JavaScript
#37BTW: you might want to add support for typed arrays. See: https://github.com/xenova/transformers.js/blob/8804c36591d11... This is really old, but added as part of the shape of the vector as well: https://github.com/nicolaspanel/numjs/blob/master/src/dtypes...
Re: Deep Learning in JavaScript
#38Someone needs to do a TypeScript compiler plugin to add multidimensional array slicing and operator overloading to the language, so these libraries can actually work the way PyTorch does. I know operator overloading is controversial, but the way it allows automatic differentiation to work transparently through regular arithmetic expressions is very helpful. Without it these libraries will never feel like PyTorch. Jav…
Agreed. My suggestion is for Bun to do that since they are already transforming typescript to JS. But you can do it —- there a babel plugin in the TC39 proposal: https://github.com/tc39/proposal-operator-overloading
Re: Deep Learning in JavaScript
#39Re: Deep Learning in JavaScript
#40Many people seem to be unaware of tensorflow.js, an official JS implementation of TF https://github.com/tensorflow/tfjs I'd love to see PyTorch in JS, but I think unless you get it running on the GPU it won't be able to do much.