गूगल जैक्स: Difference between revisions
No edit summary |
No edit summary |
||
| Line 32: | Line 32: | ||
}} | }} | ||
'''गूगल जैक्स''' न्यूमेरिकल फ़ंक्शन को परिवर्तित करने के लिए एक प्रकार का मशीन लर्निंग फ्रेमवर्क है।<ref name=":0">{{Citation |title=JAX: Autograd and XLA |date=2022-06-18 |url=https://github.com/google/jax |archive-url=https://web.archive.org/web/20220618205214/https://github.com/google/jax |publisher=Google |bibcode=2021ascl.soft11002B |access-date=2022-06-18 |archive-date=2022-06-18|last1=Bradbury |first1=James |last2=Frostig |first2=Roy |last3=Hawkins |first3=Peter |last4=Johnson |first4=Matthew James |last5=Leary |first5=Chris |last6=MacLaurin |first6=Dougal |last7=Necula |first7=George |last8=Paszke |first8=Adam |last9=Vanderplas |first9=Jake |last10=Wanderman-Milne |first10=Skye |last11=Zhang |first11=Qiao |journal=Astrophysics Source Code Library }}</ref><ref>{{Cite journal |last1=Frostig |first1=Roy |last2=Johnson |first2=Matthew James |last3=Leary |first3=Chris |date=2018-02-02 |year=2018 |title=उच्च-स्तरीय ट्रेसिंग के माध्यम से मशीन लर्निंग प्रोग्राम संकलित करना|url=https://mlsys.org/Conferences/doc/2018/146.pdf |url-status=live |journal=MLsys |pages=1–3 |archive-url=https://web.archive.org/web/20220621153349/https://mlsys.org/Conferences/doc/2018/146.pdf |archive-date=2022-06-21}}</ref><ref>{{Cite web |title=हमारे अनुसंधान में तेजी लाने के लिए JAX का उपयोग करना|url=https://www.deepmind.com/blog/using-jax-to-accelerate-our-research |url-status=live |archive-url=https://web.archive.org/web/20220618205746/https://www.deepmind.com/blog/using-jax-to-accelerate-our-research |archive-date=2022-06-18 |access-date=2022-06-18 |website=www.deepmind.com |language=en}}</ref> इसे [https://github.com/HIPS/autograd ऑटोग्रैड] | '''गूगल जैक्स''' न्यूमेरिकल फ़ंक्शन को परिवर्तित करने के लिए एक प्रकार का मशीन लर्निंग फ्रेमवर्क है।<ref name=":0">{{Citation |title=JAX: Autograd and XLA |date=2022-06-18 |url=https://github.com/google/jax |archive-url=https://web.archive.org/web/20220618205214/https://github.com/google/jax |publisher=Google |bibcode=2021ascl.soft11002B |access-date=2022-06-18 |archive-date=2022-06-18|last1=Bradbury |first1=James |last2=Frostig |first2=Roy |last3=Hawkins |first3=Peter |last4=Johnson |first4=Matthew James |last5=Leary |first5=Chris |last6=MacLaurin |first6=Dougal |last7=Necula |first7=George |last8=Paszke |first8=Adam |last9=Vanderplas |first9=Jake |last10=Wanderman-Milne |first10=Skye |last11=Zhang |first11=Qiao |journal=Astrophysics Source Code Library }}</ref><ref>{{Cite journal |last1=Frostig |first1=Roy |last2=Johnson |first2=Matthew James |last3=Leary |first3=Chris |date=2018-02-02 |year=2018 |title=उच्च-स्तरीय ट्रेसिंग के माध्यम से मशीन लर्निंग प्रोग्राम संकलित करना|url=https://mlsys.org/Conferences/doc/2018/146.pdf |url-status=live |journal=MLsys |pages=1–3 |archive-url=https://web.archive.org/web/20220621153349/https://mlsys.org/Conferences/doc/2018/146.pdf |archive-date=2022-06-21}}</ref><ref>{{Cite web |title=हमारे अनुसंधान में तेजी लाने के लिए JAX का उपयोग करना|url=https://www.deepmind.com/blog/using-jax-to-accelerate-our-research |url-status=live |archive-url=https://web.archive.org/web/20220618205746/https://www.deepmind.com/blog/using-jax-to-accelerate-our-research |archive-date=2022-06-18 |access-date=2022-06-18 |website=www.deepmind.com |language=en}}</ref> इसे [https://github.com/HIPS/autograd ऑटोग्रैड] के माध्यम से ग्रेडिएंट फ़ंक्शन और टेंसरफ्लो फ्रेमवर्क के एक्सएलए फ़ंक्शन के एक संशोधित संस्करण को एक साथ प्रस्तुत करने के लिए वर्णित किया गया है। सामान्यतः इसको {{code|NumPy}} के स्ट्रक्चर और वर्कफ़्लो के ग्रेडिएंट फ़ंक्शन का उपयोग करने के लिए डिज़ाइन किया गया है। इसमे सम्मिलित विभिन्न फ्रेमवर्क टेंसरफ्लो और {{code|PyTorch}} एक साथ कार्य करते है।<ref>{{Cite web |last=Lynley |first=Matthew |title=प्रभुत्व के लिए आखिरी बड़ा धक्का मेटा द्वारा ग्रहण किए जाने के बाद Google चुपचाप अपनी AI उत्पाद रणनीति की रीढ़ को बदल रहा है|url=https://www.businessinsider.com/facebook-pytorch-beat-google-tensorflow-jax-meta-ai-2022-6 |archive-url=https://web.archive.org/web/20220621143905/https://www.businessinsider.com/facebook-pytorch-beat-google-tensorflow-jax-meta-ai-2022-6 |archive-date=2022-06-21 |access-date=2022-06-21 |website=Business Insider |language=en-US}}</ref><ref>{{Cite web |date=2022-04-25 |title=Why is Google's JAX so popular? |url=https://analyticsindiamag.com/why-is-googles-jax-so-popular/ |url-status=live |archive-url=https://web.archive.org/web/20220618210503/https://analyticsindiamag.com/why-is-googles-jax-so-popular/ |archive-date=2022-06-18 |access-date=2022-06-18 |website=Analytics India Magazine |language=en-US}}</ref> जेएएक्स फ़ंक्शन के प्राथमिक संस्करण हैं:<ref name=":0" /> | ||
# ग्रैड: ऑटोडिफरेंसीएसन | # ग्रैड: ऑटोडिफरेंसीएसन | ||
| Line 41: | Line 41: | ||
== ग्रैड == | == ग्रैड == | ||
{{Main|ऑटोडिफरेंसीएसन}} | {{Main|ऑटोडिफरेंसीएसन}} | ||
नीचे दिया गया कोड {{code|grad}} फ़ंक्शन के ऑटोडिफरेंसीएसन को | नीचे दिया गया कोड {{code|grad}} फ़ंक्शन के ऑटोडिफरेंसीएसन को प्रदर्शित करता है: | ||
# imports | # imports | ||
from jax import grad | from jax import grad | ||
| Line 62: | Line 62: | ||
{{Main|कंपाइलेशन }} | {{Main|कंपाइलेशन }} | ||
नीचे दिया गया कोड फ़्यूज़न फ़ंक्शन के माध्यम से जिट फ़ंक्शन के कंपाइलेशन को प्रदर्शित करता | नीचे दिया गया कोड फ़्यूज़न फ़ंक्शन के माध्यम से जिट फ़ंक्शन के कंपाइलेशन को प्रदर्शित करता है: | ||
# imports | # imports | ||
from jax import jit | from jax import jit | ||
| Line 132: | Line 132: | ||
* लक्स, डीपमाइंड द्वारा विकसित रिइंफोर्समेंट लर्निंग के एजेंटों को विकसित करने के लिए लाइब्रेरी।<ref>{{Citation |title=RLax |date=2022-07-29 |url=https://github.com/deepmind/rlax |publisher=DeepMind |access-date=2022-07-29}}</ref> | * लक्स, डीपमाइंड द्वारा विकसित रिइंफोर्समेंट लर्निंग के एजेंटों को विकसित करने के लिए लाइब्रेरी।<ref>{{Citation |title=RLax |date=2022-07-29 |url=https://github.com/deepmind/rlax |publisher=DeepMind |access-date=2022-07-29}}</ref> | ||
* जेराफ, ग्राफ न्यूरल नेटवर्क के लिए एक लाइब्रेरी, जिसे डीपमाइंड द्वारा विकसित किया गया है।<ref>{{Citation |title=Jraph - A library for graph neural networks in jax. |date=2023-08-08 |url=https://github.com/deepmind/jraph |access-date=2023-08-08 |publisher=DeepMind}}</ref> | * जेराफ, ग्राफ न्यूरल नेटवर्क के लिए एक लाइब्रेरी, जिसे डीपमाइंड द्वारा विकसित किया गया है।<ref>{{Citation |title=Jraph - A library for graph neural networks in jax. |date=2023-08-08 |url=https://github.com/deepmind/jraph |access-date=2023-08-08 |publisher=DeepMind}}</ref> | ||
* जैक्सटाइपिंग, टेबल | * जैक्सटाइपिंग, टेबल या टेन्सर्स के आकार और डेटा टाइप ("डीटाइप") के लिए टाइप एनोटेशन इन्सर्ट करने के लिए लाइब्रेरी।<ref>{{Cite web |title=typing — Support for type hints |url=https://docs.python.org/3/library/typing.html |access-date=2023-08-08 |website=Python documentation}}</ref><ref>{{Citation |title=jaxtyping |date=2023-08-08 |url=https://github.com/google/jaxtyping |access-date=2023-08-08 |publisher=Google}}</ref> | ||
कुछ आर (प्रोग्रामिंग लैंग्वेज) लाइब्रेरी जेएएक्स को बैकएंड के रूप में भी उपयोग करती हैं, जिनमें | कुछ आर (प्रोग्रामिंग लैंग्वेज) लाइब्रेरी जेएएक्स को बैकएंड के रूप में भी उपयोग करती हैं, जिनमें प्रायः फास्टरेरैंडमाइज़ सम्मिलित हैं: | ||
* फास्टरेरैंडमाइज़, सामान्यतः यह लाइब्रेरी जेएएक्स में लीनियर ऑप्टिमाइजेशन कंपाइलर का उपयोग करती है जिससे परीक्षण प्रक्रिया के डिजाइन में रैंडमाइजेशन के चयन को अधिक तीव्रता से किया जा सकता है जिसके कारण इसे रीरैंडमाइजेशन के रूप में भी जाना जाता है।<ref>{{Citation |last=Jerzak |first=Connor |title=fastrerandomize |date=2023-10-01 |url=https://github.com/cjerzak/fastrerandomize-software |access-date=2023-10-03}}</ref> | * फास्टरेरैंडमाइज़, सामान्यतः यह लाइब्रेरी जेएएक्स में लीनियर ऑप्टिमाइजेशन कंपाइलर का उपयोग करती है जिससे परीक्षण प्रक्रिया के डिजाइन में रैंडमाइजेशन के चयन को अधिक तीव्रता से किया जा सकता है, जिसके कारण इसे रीरैंडमाइजेशन के रूप में भी जाना जाता है।<ref>{{Citation |last=Jerzak |first=Connor |title=fastrerandomize |date=2023-10-01 |url=https://github.com/cjerzak/fastrerandomize-software |access-date=2023-10-03}}</ref> | ||
== यह भी देखें == | == यह भी देखें == | ||
Revision as of 09:42, 14 December 2023
गूगल जैक्स न्यूमेरिकल फ़ंक्शन को परिवर्तित करने के लिए एक प्रकार का मशीन लर्निंग फ्रेमवर्क है।[1][2][3] इसे ऑटोग्रैड के माध्यम से ग्रेडिएंट फ़ंक्शन और टेंसरफ्लो फ्रेमवर्क के एक्सएलए फ़ंक्शन के एक संशोधित संस्करण को एक साथ प्रस्तुत करने के लिए वर्णित किया गया है। सामान्यतः इसको NumPy के स्ट्रक्चर और वर्कफ़्लो के ग्रेडिएंट फ़ंक्शन का उपयोग करने के लिए डिज़ाइन किया गया है। इसमे सम्मिलित विभिन्न फ्रेमवर्क टेंसरफ्लो और PyTorch एक साथ कार्य करते है।[4][5] जेएएक्स फ़ंक्शन के प्राथमिक संस्करण हैं:[1]
- ग्रैड: ऑटोडिफरेंसीएसन
- जिट: कंपाइलेशन
- वीमैप: ऑटोवेक्टराइजेशन
- पीमैप: एसपीएमडी डेटा प्रोग्रामिंग
ग्रैड
नीचे दिया गया कोड grad फ़ंक्शन के ऑटोडिफरेंसीएसन को प्रदर्शित करता है:
# imports
from jax import grad
import jax.numpy as jnp
# define the logistic function
def logistic(x):
return jnp.exp(x) / (jnp.exp(x) + 1)
# obtain the gradient function of the logistic function
grad_logistic = grad(logistic)
# evaluate the gradient of the logistic function at x = 1
grad_log_out = grad_logistic(1.0)
print(grad_log_out)
0.19661194
जिट
नीचे दिया गया कोड फ़्यूज़न फ़ंक्शन के माध्यम से जिट फ़ंक्शन के कंपाइलेशन को प्रदर्शित करता है:
# imports
from jax import jit
import jax.numpy as jnp
# define the cube function
def cube(x):
return x * x * x
# generate data
x = jnp.ones((10000, 10000))
# create the jit version of the cube function
jit_cube = jit(cube)
# apply the cube and jit_cube functions to the same data for speed comparison
cube(x)
jit_cube(x)
jit_cube फ़ंक्शन (पंक्ति संख्या 17) के लिए कंपाइलर टाइम cube फ़ंक्शन (पंक्ति संख्या 16) की तुलना में अपेक्षाकृत कम होना चाहिए, क्योंकि पंक्ति संख्या 7 पर मान बढ़ने से अंतर बढ़ सकता है।
वीमैप
नीचे दिया गया कोड vmap फ़ंक्शन के वेक्टराइजेशन को प्रदर्शित करता है:
# imports
from functools import partial
from jax import vmap
import jax.numpy as jnp
# define function
def grads(self, inputs):
in_grad_partial = partial(self._net_grads, self._net_params)
grad_vmap = vmap(in_grad_partial)
rich_grads = grad_vmap(inputs)
flat_grads = np.asarray(self._flatten_batch(rich_grads))
assert flat_grads.ndim == 2 and flat_grads.shape[0] == inputs.shape[0]
return flat_grads
प्रायः यह फ़ंक्शन जीआईएफ वेक्टराइज्ड संबंध की धारणा को दर्शाता है।
पीमैप
नीचे दिया गया कोड मैट्रिक्स गुणन के लिए pmap फ़ंक्शन के डिफरेंसीएसन को प्रदर्शित करता है:
# import pmap and random from JAX; import JAX NumPy from jax import pmap, random import jax.numpy as jnp # generate 2 random matrices of dimensions 5000 x 6000, one per device random_keys = random.split(random.PRNGKey(0), 2) matrices = pmap(lambda key: random.normal(key, (5000, 6000)))(random_keys) # without data transfer, in parallel, perform a local matrix multiplication on each CPU/GPU outputs = pmap(lambda x: jnp.dot(x, x.T))(matrices) # without data transfer, in parallel, obtain the mean for both matrices on each CPU/GPU separately means = pmap(jnp.mean)(outputs) print(means)
[1.1566595 1.1805978]
जैक्स का उपयोग करने वाली लाइब्रेरी
कई पायथन लाइब्रेरी जैक्स को बैकएंड के रूप में उपयोग करती हैं, जिनमें निम्नलिखित सम्मिलित हैं:
- फ्लेक्स, यह एक प्रकार की न्यूरल नेटवर्क लाइब्रेरी है जिसे गूगल ब्रेन द्वारा विकसित किया गया था।[6]
- इक्विनॉक्स, एक लाइब्रेरी जो पैरामीटरयुक्त फ़ंक्शन (न्यूरल नेटवर्क सहित) को
PyTreesके रूप में प्रस्तुत करती है।[7] - डिडिफ्रेक्स, साधारण डिफरेंशियल फ़ंक्शन और स्टोकेस्टिक डिफरेंशियल फ़ंक्शन जैसे फ़ंक्शन के संख्यात्मक समाधान के लिए लाइब्रेरी।[8]
- ऑप्टैक्स, डीपमाइंड द्वारा विकसित ग्रेडिएंट प्रोसेसिंग और ऑप्टिमाइज़ेशन के लिए लाइब्रेरी।[9]
- लाइनेक्स, संख्यात्मक रूप से लीनियर सिस्टम को हल करने के लिए लाइब्रेरी।[10]
- लक्स, डीपमाइंड द्वारा विकसित रिइंफोर्समेंट लर्निंग के एजेंटों को विकसित करने के लिए लाइब्रेरी।[11]
- जेराफ, ग्राफ न्यूरल नेटवर्क के लिए एक लाइब्रेरी, जिसे डीपमाइंड द्वारा विकसित किया गया है।[12]
- जैक्सटाइपिंग, टेबल या टेन्सर्स के आकार और डेटा टाइप ("डीटाइप") के लिए टाइप एनोटेशन इन्सर्ट करने के लिए लाइब्रेरी।[13][14]
कुछ आर (प्रोग्रामिंग लैंग्वेज) लाइब्रेरी जेएएक्स को बैकएंड के रूप में भी उपयोग करती हैं, जिनमें प्रायः फास्टरेरैंडमाइज़ सम्मिलित हैं:
- फास्टरेरैंडमाइज़, सामान्यतः यह लाइब्रेरी जेएएक्स में लीनियर ऑप्टिमाइजेशन कंपाइलर का उपयोग करती है जिससे परीक्षण प्रक्रिया के डिजाइन में रैंडमाइजेशन के चयन को अधिक तीव्रता से किया जा सकता है, जिसके कारण इसे रीरैंडमाइजेशन के रूप में भी जाना जाता है।[15]
यह भी देखें
- टेंसरफ्लो
- पाइटॉर्च
- क्यूडा
- ऑटोमैटिक डिफरेंसीएसन
- कंपाइलेशन
- वेक्टराइजेशन
- एक्सेलरेटेड लीनियर एल्जेब्रा (रैखिक बीजगणित)
बाहरी संबंध
- Documentationː jax
.readthedocs .io - Colab (Jupyter/IPython) Quickstart Guideː colab
.research .google .com /github /google /jax /blob /main /docs /notebooks /quickstart .ipynb - TensorFlow's XLAː www
.tensorflow .org /xla (Accelerated Linear Algebra) - Intro to JAX: Accelerating Machine Learning research on YouTube
- Original paperː mlsys
.org /Conferences /doc /2018 /146 .pdf
संदर्भ
- ↑ 1.0 1.1 Bradbury, James; Frostig, Roy; Hawkins, Peter; Johnson, Matthew James; Leary, Chris; MacLaurin, Dougal; Necula, George; Paszke, Adam; Vanderplas, Jake; Wanderman-Milne, Skye; Zhang, Qiao (2022-06-18), "JAX: Autograd and XLA", Astrophysics Source Code Library, Google, Bibcode:2021ascl.soft11002B, archived from the original on 2022-06-18, retrieved 2022-06-18
- ↑ Frostig, Roy; Johnson, Matthew James; Leary, Chris (2018-02-02). "उच्च-स्तरीय ट्रेसिंग के माध्यम से मशीन लर्निंग प्रोग्राम संकलित करना" (PDF). MLsys: 1–3. Archived (PDF) from the original on 2022-06-21.
{{cite journal}}: CS1 maint: date and year (link) - ↑ "हमारे अनुसंधान में तेजी लाने के लिए JAX का उपयोग करना". www.deepmind.com (in English). Archived from the original on 2022-06-18. Retrieved 2022-06-18.
- ↑ Lynley, Matthew. "प्रभुत्व के लिए आखिरी बड़ा धक्का मेटा द्वारा ग्रहण किए जाने के बाद Google चुपचाप अपनी AI उत्पाद रणनीति की रीढ़ को बदल रहा है". Business Insider (in English). Archived from the original on 2022-06-21. Retrieved 2022-06-21.
- ↑ "Why is Google's JAX so popular?". Analytics India Magazine (in English). 2022-04-25. Archived from the original on 2022-06-18. Retrieved 2022-06-18.
- ↑ Flax: A neural network library and ecosystem for JAX designed for flexibility, Google, 2022-07-29, retrieved 2022-07-29
- ↑ Kidger, Patrick (2022-07-29), Equinox, retrieved 2022-07-29
- ↑ Kidger, Patrick (2023-08-05), Diffrax, retrieved 2023-08-08
- ↑ Optax, DeepMind, 2022-07-28, retrieved 2022-07-29
- ↑ Lineax, Google, 2023-08-08, retrieved 2023-08-08
- ↑ RLax, DeepMind, 2022-07-29, retrieved 2022-07-29
- ↑ Jraph - A library for graph neural networks in jax., DeepMind, 2023-08-08, retrieved 2023-08-08
- ↑ "typing — Support for type hints". Python documentation. Retrieved 2023-08-08.
- ↑ jaxtyping, Google, 2023-08-08, retrieved 2023-08-08
- ↑ Jerzak, Connor (2023-10-01), fastrerandomize, retrieved 2023-10-03