JS-PyTorch is a Deep Learning JavaScript library built from scratch, to closely follow PyTorch's syntax.
Feel free to try out a Web Demo!
...
For further actions, you may consider blocking this person and/or reporting abuse
Okay, but why?
It is much easier to deploy Javascript than Python these days (Unless you want to manage your servers). Javascript is superior to Python when it comes to the project’s isolation, environment and management (it is straight forward while Python is a hot mess). Almost all developers know some Javascript, therefore I raise you the opposite question:
Why not?
Just because something CAN be done doesn’t mean it HAS to be done.
It’s not. You have anything at your disposal from EC2 to Google Colab to providers that specialize at machine learning. No management of “your” servers required. Ever Vercel has a Python runtime
It’s not. Saying that it’s “superior” just shows that you either don’t know or don’t care enough to do even basic research. I’ll just say that venv is a thing.
This is simply hilarious. First, knowing “some JavaScript” has nothing to do with studying machine learning. Second, if you can’t stomach learning a teeny tiny bit of Python syntax, how are you going to study everything else that comes with machine learning?
A few more points:
Well, that is just like, your opinion man (Haha).
Languages are tools, JS is more approachable than Python and has many other advantages over it (In my opinion). I did code in Python (using Venvs mind you) professionally for a while, JS is still much simpler to handle. I can't see why we should not use JS for ML.
Edit: Also, what does Jupyter Notebook have anything to do with? As I said, languages are nothing but tools, some tools are good for some tasks. You wouldn't want to fry an egg using a sledgehammer, right? If a language offers advantages (such as ease of access, popularity, etc) for a given task over a different language, it is worth considering. I advise you not to be so attached to the languages you code with, there is no reason to.
That’s very close to what I’d say: JavaScript can be used more easily for some applications, and while Python will likely remain the most used ML language, there’s a benefit to being able to write PyTorch-like code in native JS. Especially for simpler web demos and educational content.
There are a couple of reasons why I started the project:
Indeed !
I have not had the time to evaluate your library, but I applaud your efforts in implementing it. Well done !
Thank you for the support! If you try it out and have any questions or tips, let me know!
To further ruin our lives and computers with js
just a legit joke
Wow, I got more like to my comment than my post 🙃
Great stuff, I've been keen to add some deep learning to our code stack and would prefer not to litter the source code with multiple languages. This looks to be a great start. I am worried that it will take a lot to maintain though.
Thanks for the feedback! I'm currently working really hard to make it as easy-to-use and easy-to-mantain as possible, with Developer Tools, solid documentation, unit tests and all of that. Hope it'll help you with your needs :D
Yeah, I meant hard to maintain for you too... Extra modules, keeping up to date with something else etc.
That’s true! But having good testing and tools can help with that too.
However, that’s a good thing to keep in mind, you’re right
Really cool library! I’d love to see an integration with GPU.js
Hey, I’m not really an expert on this, it GPU.js similar to WebGPU?
From what I understand about WebGPU, it provides an interface and browser support for GPU usage. GPU.js offers a back-end library to run matrix multiplications on GPU.
Got it. Thanks for the reply!
Thanks for the feedback! Working on it.
Cool! Are you open to pull requests at all on your GitHub? I’d love to get involved
Absolutely, any help is welcome :D
Deep Learning is very much about Python. Period. No need to bring everything to JS, just inappropriate and it doesn’t have any real advantages over it.
As I had replied to another comment, I'm not trying to replace PyTorch or bring Deep Learning to JavaScript. I'm simply creating a tool for DL learners to be able to use.
Sometimes it's easier to have direct access to the browser to run demos or small web-based AI applications. Or, if you don't know Python, this library could be a good place for a JS programmer to start experimenting with Deep Learning as well.
So I do agree with you about Python, I just don't think that these things are mutually exclusive :)
thanks man
Any application that can be written in JavaScript, will eventually be written in JavaScript.
Atwood's Law
Cheers to you brother 👏🏼🥃
Thank you! Guess I’ve become a part of the problem lol
Would like to give this a try sometime, thanks for the well written overview. Is it truly native JS? No bindings at all?
Glad you like it!
The source code is actually in TypeScript, but the deployed package is native JS, ready-to-use!
Thank you!