Earlier quoted context omitted.
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.
You might already be familiar, but a GPU.js backend can provide some speedups via good old WebGL -- no need for WebGPU just yet! [0]: https://github.com/gpujs/gpu.js/
Deep Learning in JavaScript
41–50 of 92 posts
Re: Deep Learning in JavaScript
#42BTW: 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
#43This is great. Code seems to have good comments / jsdoc from the bit studied, tests and all. Will take a closer look in the morning but congratulations on the release.
Re: Deep Learning in JavaScript
#44Many 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
#45Many 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.
tfjs is dead, looking at the commit history. The standard now is to convert PyTorch to onnx, then use onnxruntime ( https://github.com/microsoft/onnxruntime/tree/main/js/web ) to run the model on the browser using webassembly/webGL (and nodejs if you wanted to, but why?).
Node.js is better backend than something like Flask.
Re: Deep Learning in JavaScript
#46Needs more layers to be really useful though.
I always thought examples using browser extensions would be neat since their built in JS and you only need to download the model once.
Re: Deep Learning in JavaScript
#47Earlier quoted context omitted.
tfjs is dead, looking at the commit history. The standard now is to convert PyTorch to onnx, then use onnxruntime ( https://github.com/microsoft/onnxruntime/tree/main/js/web ) to run the model on the browser using webassembly/webGL (and nodejs if you wanted to, but why?).
> nodejs if you wanted to, but why? Node.js is better backend than something like Flask.
Re: Deep Learning in JavaScript
#48Someone 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…
Re: Deep Learning in JavaScript
#49Earlier quoted context omitted.
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.
You might already be familiar, but a GPU.js backend can provide some speedups via good old WebGL -- no need for WebGPU just yet! [0]: https://github.com/gpujs/gpu.js/
Re: Deep Learning in JavaScript
#50Are you open to pull requests? If I have the time I'd love to contribute. I'm sure others would as well.
You should write up a short article on this, even something really simple like one of the examples in the README but with some commentary and examples of output and then post it to a few places like https://dev.to/ or maybe https://hashnode.com/ or even Medium (even though I'm not a big fan). There aren't many newer implementations of PyTorch in JS and I've been looking for one to learn from for some time so I'm sure there are a lot of other JS/TS developers out there that would be interested. Getting to the front page of HN certainly helps but having an article somewhere will help everyone after this week find it through a Google search.
Again, thanks so much for doing this work! It's really helpful to have everything spelled out in JS for those of us who haven't used Python much (I'm sure Python devs can relate when they think about JS projects).