【Hacker News搬运】JavaScript中的深度学习
-
Title: Deep Learning in JavaScript
JavaScript中的深度学习
Text:
Url: https://github.com/eduardoleao052/js-torch
很抱歉,由于连接超时,我无法使用 webscraper 工具抓取指定 URL 的内容。如果您需要该页面的信息,建议您直接访问该 URL 或尝试使用其他工具进行抓取。
Post by: eduardoleao052
Comments:
modeless: Someone needs to do a TypeScript compiler plugin to add multidimensional array slicing and operator overloading to the language, so these libraries can <i>actually</i> work the way PyTorch does.<p>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.<p>JavaScript is so much faster than Python, and the package management experience is so much better, that I really think a JS library would have a chance to take market share from PyTorch in the long term if it had those features.
modeless: 有人需要做一个TypeScript编译器插件,将多维数组切片和运算符重载添加到语言中,这样这些库实际上可以像PyTorch那样工作<p> 我知道运算符重载是有争议的,但它允许自动微分通过正则算术表达式透明地工作的方式非常有帮助。如果没有它,这些库将永远不会感觉像PyTorch<p> JavaScript比Python快得多,包管理体验也要好得多,所以我真的认为,如果JS库具有这些功能,从长远来看,它将有机会从PyTorch那里获得市场份额。
marviel: Very very cool to see!!!<p>So yours is SO MUCH MORE fleshed out than mine, but I have a similar (again very fledgling) one going here that uses Typescript:<p><a href="https://github.com/Marviel/lab-grad">https://github.com/Marviel/lab-grad</a><p>I think there are some really neat opportunities to increase the approachability of ML algorithms when you take advantage of the Typescript templating system to explicitly ensure you're not accidentally composing tensors of incorrect shapes.<p>Unfortunately, my above lib above doesn't yet handle tensors, it's still at the level of individual neurons. Hopefully someday I can bring it further along, use WASM or WebGPU, etc.
marviel: 非常非常酷<p> 所以你的比我的丰富得多,但我有一个类似的(也是刚刚起步的),它使用Typescript:<p><a href=“https://;/;github.com/!Marviel/:lab-grad”>https:///;github.com/;Marviel/;lab grad</a><p>我认为,当你利用Typescript模板系统来明确地确保你;We’你不是无意中合成了形状不正确的张量<p> 不幸的是,我上面的lib没有;还不能处理张量;s仍然处于单个神经元的水平。希望有一天我能进一步发展,使用WASM或WebGPU等:)
eduardoleao052: Learning Machine Learning, I’ve always been interested in PyTorch and its Automatic Backpropagation.<p>In this project, I tried to reimplement most of PyTorch in Javascript. It is implemented from scratch in a well-documented, unit tested, and interpretable way, so it can help other JavaScript learners get into Machine Learning!<p>Hope you enjoy!
eduardoleao052: 学习机器学习,我一直对PyTorch及其自动反向传播感兴趣<p> 在这个项目中,我尝试用Javascript重新实现大部分PyTorch。它是以一种文档齐全、经过单元测试和可解释的方式从头开始实现的,因此它可以帮助其他JavaScript学习者进入机器学习<p> 希望你喜欢!
sroussey: BTW: you might want to add support for typed arrays.<p>See: <a href="https://github.com/xenova/transformers.js/blob/8804c36591d11d8456788d1bb4b16489121b3be2/src/utils/tensor.js#L45">https://github.com/xenova/transformers.js/blob/8804c36591d11...</a><p>This is really old, but added as part of the shape of the vector as well: <a href="https://github.com/nicolaspanel/numjs/blob/master/src/dtypes.js">https://github.com/nicolaspanel/numjs/blob/master/src/dtypes...</a>
sroussey: BTW:您可能需要添加对类型化数组的支持<p> 请参阅:<a href=“https://;/;github.com#xx2F;xenova/!transformers.js#xx2F!blob/:8804c36591d11d8456788d1bb4b16489121b3be2#xx2F:src//;github.com/;xenova;transformers.js;blob;8804c36591d11…</a><p>这确实很旧,但也是作为矢量形状的一部分添加的:<a href=“https://;/;github.comȏ;nicolaspanel/!numjs/:blob/,master/…src/;dtypes.js”>https:///;github.com/;尼科拉斯潘;numjs/;blob;master;src/;数据类型</一
mhuffman: I like to see progress with multiple languages in the space. Julia, R, etc. It does seem though, that python really has a big and commanding lead. So much so that mojo is betting their business on it.
mhuffman: 我希望看到在这个空间中使用多种语言的进展。Julia、R等。不过,这条蟒蛇似乎真的有很大的优势。如此之多,以至于mojo把他们的生意押在了上面。