首页 >> 大全

jax-ws和jax-rs_用jax和elegy进行深度学习

2024-01-01 大全 17 作者:考证青年

In this post, we will how to Jax and Elegy to Deep . Along the way, we will see how Jax to and , and how Elegy to Keras.

在本文中,我们将探讨如何利用Jax和Elegy创建深度学习模型。 一路上,我们将看到Jax与和的比较,以及类似Elegy与Keras的比较。

什么是贾克斯? (What is Jax?)

a doubt (2015) and (2016) have had a big in the ML , the “arms race” them has made them to a set of (check out State of ML 2019 for a good of their ). Jax (2018) is the to join the party and it a nice of this . But of being a Deep , Jax a super with and XLA that some have Numpy on .

毫无疑问,(2015)和(2016)在ML社区中产生了巨大影响,它们之间的``军备竞赛''使它们趋同于一组类似的功能(查看《 2019年ML框架状态》以获取更多信息)。他们的斗争总结)。 Jax(2018)是最新加入该党的人,它代表了这种融合的一个很好的综合。 但是Jax并没有直接成为深度学习框架,而是创建了一个具有自动区分和XLA支持的超精细线性代数库,有人称其为类固醇Numpy 。

Here are some of the that make Jax .

以下是使Jax变得很棒的一些事情。

Numpy API (The Numpy API)

Jax the Numpy API and makes it the main way to with Jax .

Jax实现了Numpy API,并使其成为使用Jax数组的主要方法。

This is a huge deal since Numpy is the of in and every data has hours of with Numpy of its field of . It makes with Jax a true . Not only that, Jax’s base type from Numpy’s type, that 3rd party can these . You can even start using Jax “just” to speed up your Numpy code with very few .

由于Numpy是中数值计算的通用语言 ,因此,这实际上是一笔不小的数目,并且每个数据科学家都已经拥有无数小时的Numpy经验,无论其具体的实践领域是什么。 它使与Jax一起工作成为真正的乐趣。 不仅如此,Jax的基本类型继承自Numpy的类型,这意味着第三方库可以接受这些结构。 您甚至只需很少的更改就可以开始使用Jax“只是”来加速现有的Numpy代码。

统一的API (A API)

Jax has a clean and API for eager and JIT .

Jax具有一个干净且统一的API,用于渴望和JIT执行。

and have both eager and modes, , each added the mode it was late in the ’s , this has left scars. In for eager mode was added in such a way that it was not 100% with graph mode, rise to a bad . In ’s case, it was to use less (like NCWH on its API) just they were more on eager mode and has kept them for . Jax, on the other hand, was born with and by both of these modes, it on using eager for and JIT to heavy , but you can mix and match these modes where .

如今,和都拥有急切的执行模式和已编译的执行模式,但是,每种模式都添加了在框架生命周期末尾缺少的模式,这留下了伤疤。 例如,在中,急切模式以与图形模式不100%兼容的方式添加,从而导致不良的开发人员体验。 在的情况下,最初被迫使用不太直观的张量格式(例如其视觉API上的NCWH ),只是因为它们在渴望模式下性能更高,并且出于兼容性原因而保留它们。 另一方面,Jax与这两种模式一起诞生并受其影响,它主要侧重于使用急切的调试和JIT实际执行繁重的计算,但是您可以在方便的地方混合使用这些模式。

XLA (XLA)

Jax is based on next gen ML .

Jax基于下一代 ML编译器技术。

Jax uses XLA of to a of C++ and CUDA code. While is the why XLA at all, its use is not wide its code base and still has code. , on the other hand, has a of code to the point where are only on (/xla is a thing but it’s only on TPU ).

Jax专门使用XLA,而不是依赖于设备的C ++和CUDA代码的混合。 虽然根本就是XLA存在的原因,但它的使用并未在其代码库中完全普及,并且仍然具有与设备有关的代码。 另一方面,的设备相关代码数量令人沮丧,以至于某些操作仅在特定设备上受支持( / xla是一回事,但仅专注于TPU支持)。

特别行动 ( )

Jax a set of .

Jax带来了一组独特的功能强大的功能转换。

Jax has some novel, easy-to-use that users to that are hard or even in other . grad for makes n-th order easy, vmap users to write per and apply them to a whole batch, and pmap the user to among . There are more which you can find on Jax’s .

Jax具有一些新颖,易于使用的转换,使用户能够执行复杂的操作,而这些操作在其他框架中是很难甚至是不可能的。 例如, grad使得计算n vmap度非常容易, vmap使用户可以按样本编写操作并将其自动应用于整个批次,而pmap允许用户轻松地在设备之间分配计算。 您可以在Jax的官方文档中找到更多转换。

兼容性

Jax is .

Jax是。

This used to be ’s moto but Jax takes it level by its on and basic types, i.e. Jax can with to types like lists, , and ! This isn’t just a neat trick, many Jax-based on this . Jax also like and which its with the rest of the data .

这曾经是的moto,但是Jax通过基于功能组合和基本类型的体系结构将其提升到另一个层次,即Jax可以区分列表,元组和字典等类型! 这不仅仅是一个巧妙的技巧,许多基于Jax的框架都依赖于此功能。 Jax还实现了诸如和类的协议,从而最大限度地提高了与数据科学生态系统其余部分的兼容性。

关于我们

最火推荐

小编推荐

联系我们


版权声明:本站内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 88@qq.com 举报,一经查实,本站将立刻删除。备案号:桂ICP备2021009421号
Powered By Z-BlogPHP.
复制成功
微信号:
我知道了