Array ( [0] => {{Short description|Open source machine learning library}} [1] => {{Infobox software [2] => | name = PyTorch [3] => | logo = PyTorch logo black.svg [4] => | screenshot = [5] => | caption = [6] => | collapsible = [7] => | author = {{Unbulleted list|Adam Paszke|Sam Gross|Soumith Chintala|Gregory Chanan}} [8] => | developer = [[Meta AI]] [9] => | released = {{Start date and age|2016|9|df=yes}}{{cite web|url=https://github.com/pytorch/pytorch/releases/tag/v0.1.1|title=PyTorch Alpha-1 release|last=Chintala|first=Soumith|date=1 September 2016}} [10] => | latest release version = {{wikidata|property|edit|reference|P348}} [11] => | latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} [12] => | repo = {{URL|github.com/pytorch/pytorch}} [13] => | programming language = {{Unbulleted list|[[Python (programming language)|Python]]|[[C++]]|[[CUDA]]}} [14] => | operating system = {{Unbulleted list|[[Linux]]|[[macOS]]|[[Windows]]}} [15] => | platform = [[IA-32]], [[x86-64]], [[ARM64]] [16] => | language = English [17] => | genre = [[Library (computing)|Library]] for [[machine learning]] and [[deep learning]] [18] => | license = [[BSD-3]]{{cite web |last=Claburn |first=Thomas |date=12 September 2022 |title=PyTorch gets lit under The Linux Foundation |url=https://www.theregister.com/2022/09/12/pytorch_meta_linux_foundation/ |work=[[The Register]]}} [19] => | website = {{URL|https://pytorch.org/}} [20] => }} [21] => {{Machine learning}} [22] => [23] => '''PyTorch''' is a [[machine learning]] [[Library (computing)|library]] based on the [[Torch (machine learning)|Torch]] library,{{cite news|url=https://www.infoworld.com/article/3159120/artificial-intelligence/facebook-brings-gpu-powered-machine-learning-to-python.html|title=Facebook brings GPU-powered machine learning to Python|last=Yegulalp|first=Serdar|date=19 January 2017|work=InfoWorld|access-date=11 December 2017}}{{cite web|url=https://www.oreilly.com/ideas/why-ai-and-machine-learning-researchers-are-beginning-to-embrace-pytorch|title=Why AI and machine learning researchers are beginning to embrace PyTorch|last=Lorica|first=Ben|date=3 August 2017|publisher=O'Reilly Media|access-date=11 December 2017}}{{Cite book|title=Deep Learning with Python|last=Ketkar|first=Nikhil|date=2017|publisher=Apress, Berkeley, CA|isbn=9781484227657|pages=195–208|language=en|doi=10.1007/978-1-4842-2766-4_12|chapter=Introduction to PyTorch}} used for applications such as [[computer vision]] and [[natural language processing]],{{Cite web|url=https://www.datacamp.com/tutorial/nlp-with-pytorch-a-comprehensive-guide|title=NLP with PyTorch: A Comprehensive Guide|author=Moez Ali|date=Jun 2023|website=datacamp.com|language=en|access-date=2024-04-01}} originally developed by [[Meta AI]] and now part of the [[Linux Foundation]] umbrella.{{Cite news|url=https://www.oreilly.com/ideas/when-two-trends-fuse-pytorch-and-recommender-systems|title=When two trends fuse: PyTorch and recommender systems|last=Patel|first=Mo|date=2017-12-07|work=O'Reilly Media|access-date=2017-12-18|language=en}}{{Cite news|url=https://techcrunch.com/2017/09/07/facebook-and-microsoft-collaborate-to-simplify-conversions-from-pytorch-to-caffe2/|title=Facebook and Microsoft collaborate to simplify conversions from PyTorch to Caffe2|last=Mannes|first=John|work=[[TechCrunch]]|access-date=2017-12-18|language=en|quote=FAIR is accustomed to working with PyTorch – a deep learning framework optimized for achieving state of the art results in research, regardless of resource constraints. Unfortunately in the real world, most of us are limited by the computational capabilities of our smartphones and computers.}}{{Cite web|url=https://venturebeat.com/2017/11/29/tech-giants-are-using-open-source-frameworks-to-dominate-the-ai-community/|title=Tech giants are using open source frameworks to dominate the AI community|last=Arakelyan|first=Sophia|date=2017-11-29|website=[[VentureBeat]]|language=en-US|access-date=2017-12-18}}{{Cite web |title=PyTorch strengthens its governance by joining the Linux Foundation |url=https://pytorch.org/blog/PyTorchfoundation/ |access-date=2022-09-13 |website=pytorch.org |language=en}} It is recognized as one of the two most popular machine learning libraries alongside [[TensorFlow]], offering [[free and open-source software]] released under the [[modified BSD license]]. Although the [[Python (programming language)|Python]] interface is more polished and the primary focus of development, PyTorch also has a [[C++]] interface.{{Cite web|url=https://pytorch.org/cppdocs/frontend.html|title=The C++ Frontend|website=PyTorch Master Documentation|access-date=2019-07-29}} [24] => [25] => A number of pieces of [[deep learning]] software are built on top of PyTorch, including [[Tesla Autopilot]],{{Cite web|last=Karpathy|first=Andrej|title=PyTorch at Tesla - Andrej Karpathy, Tesla|url=https://www.youtube.com/watch?v=oBklltKXtDE}} [[Uber]]'s Pyro,{{Cite news|url=https://eng.uber.com/pyro/|title=Uber AI Labs Open Sources Pyro, a Deep Probabilistic Programming Language|date=2017-11-03|work=Uber Engineering Blog|access-date=2017-12-18|language=en-US}} [[Hugging Face]]'s Transformers,{{Citation|title=PYTORCH-TRANSFORMERS: PyTorch implementations of popular NLP Transformers|date=2019-12-01|url=https://pytorch.org/hub/huggingface_pytorch-transformers/|publisher=PyTorch Hub|access-date=2019-12-01}} [[PyTorch Lightning]],{{Citation|title=PYTORCH-Lightning: The lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate|date=2020-06-18|url=https://github.com/PyTorchLightning/pytorch-lightning/|publisher=Lightning-Team|access-date=2020-06-18}}{{Cite web|url=https://pytorch.org/ecosystem/|title=Ecosystem Tools|website=pytorch.org|language=en|access-date=2020-06-18}} and Catalyst.{{Citation|title=GitHub - catalyst-team/catalyst: Accelerated DL & RL|date=2019-12-05|url=https://github.com/catalyst-team/catalyst|publisher=Catalyst-Team|access-date=2019-12-05}}{{Cite web|url=https://pytorch.org/ecosystem/|title= Ecosystem Tools|website=pytorch.org|language=en|access-date=2020-04-04}} [26] => [27] => PyTorch provides two high-level features:{{cite web |url=https://pytorch.org/about/ |title=PyTorch – About |website=pytorch.org |access-date=2018-06-11 |archive-url=https://web.archive.org/web/20180615190804/https://pytorch.org/about/ |archive-date=2018-06-15 |url-status=dead }} [28] => * Tensor computing (like [[NumPy]]) with strong acceleration via [[graphics processing unit]]s (GPU) [29] => * [[Deep neural networks]] built on a tape-based [[automatic differentiation]] system [30] => [31] => ==History== [32] => Meta (formerly known as Facebook) operates both ''PyTorch'' and ''Convolutional Architecture for Fast Feature Embedding'' ([[Caffe (software)|Caffe2]]), but models defined by the two frameworks were mutually incompatible. The Open Neural Network Exchange ([[Open Neural Network Exchange|ONNX]]) project was created by Meta and [[Microsoft]] in September 2017 for converting models between frameworks. Caffe2 was merged into PyTorch at the end of March 2018.{{cite web|url=https://medium.com/@Synced/caffe2-merges-with-pytorch-a89c70ad9eb7|title=Caffe2 Merges With PyTorch|date=2018-04-02}} In September 2022, Meta announced that ''PyTorch'' would be governed by PyTorch Foundation, a newly created independent organization{{snd}}a subsidiary of [[Linux Foundation]].{{cite web |url=https://arstechnica.com/information-technology/2022/09/meta-spins-off-pytorch-foundation-to-make-ai-framework-vendor-neutral/ |title=Meta spins off PyTorch Foundation to make AI framework vendor neutral |date=2022-09-12 |website=[[Ars Technica]] |last=Edwards |first=Benj}} [33] => [34] => PyTorch 2.0 was released on 15 March 2023.{{cite news |title=PyTorch 2.0 brings new fire to open-source machine learning |url=https://venturebeat.com/ai/pytorch-2-0-brings-new-fire-to-open-source-machine-learning/ |access-date=16 March 2023 |work=VentureBeat |date=15 March 2023}} [35] => [36] => ==PyTorch tensors== [37] => {{main|Tensor (machine learning)}} [38] => PyTorch defines a class called Tensor (torch.Tensor) to store and operate on homogeneous multidimensional rectangular arrays of numbers. PyTorch Tensors are similar to [[NumPy]] Arrays, but can also be operated on a [[CUDA]]-capable [[Nvidia|NVIDIA]] GPU. PyTorch has also been developing support for other GPU platforms, for example, AMD's [[ROCm]]{{cite web|url=https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/3rd-party/pytorch-install.html|title=Installing PyTorch for ROCm|date=2024-02-09|website=rocm.docs.amd.com}} and Apple's [[Metal (API)|Metal Framework.]]{{Cite web |title=Introducing Accelerated PyTorch Training on Mac |url=https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/ |access-date=2022-06-04 |website=pytorch.org |language=en}} [39] => [40] => PyTorch supports various sub-types of Tensors.{{cite web |url=https://www.analyticsvidhya.com/blog/2018/02/pytorch-tutorial/ |title=An Introduction to PyTorch – A Simple yet Powerful Deep Learning Library |website=analyticsvidhya.com |access-date=2018-06-11|date=2018-02-22 }} [41] => [42] => Note that the term "tensor" here does not carry the same meaning as tensor in mathematics or physics. The meaning of the word in machine learning is only superficially related to its original meaning as a certain kind of object in [[linear algebra]]. Tensors in PyTorch are simply multi-dimensional arrays. [43] => [44] => == PyTorch neural networks == [45] => {{main|Neural network (machine learning)}} [46] => [47] => PyTorch defines a module called nn (torch.nn) to describe neural networks and to support training. This module offers a comprehensive collection of building blocks for neural networks, including various layers and activation functions, enabling the construction of complex models. [48] => [49] => == Example == [50] => The following program shows the low-level functionality of the library with a simple example [51] => [52] => [53] => import torch [54] => dtype = torch.float [55] => device = torch.device("cpu") # Execute all calculations on the CPU [56] => # device = torch.device("cuda:0") # Executes all calculations on the GPU [57] => [58] => # Create a tensor and fill it with random numbers [59] => a = torch.randn(2, 3, device=device, dtype=dtype) [60] => print(a) [61] => # Output: tensor([[-1.1884, 0.8498, -1.7129], [62] => # [-0.8816, 0.1944, 0.5847]]) [63] => [64] => b = torch.randn(2, 3, device=device, dtype=dtype) [65] => print(b) [66] => # Output: tensor([[ 0.7178, -0.8453, -1.3403], [67] => # [ 1.3262, 1.1512, -1.7070]]) [68] => [69] => print(a * b) [70] => # Output: tensor([[-0.8530, -0.7183, 2.58], [71] => # [-1.1692, 0.2238, -0.9981]]) [72] => [73] => print(a.sum()) [74] => # Output: tensor(-2.1540) [75] => [76] => print(a[1,2]) # Output of the element in the third column of the second row (zero based) [77] => # Output: tensor(0.5847) [78] => [79] => print(a.max()) [80] => # Output: tensor(0.8498) [81] => The following code-block shows an example of the higher level functionality provided nn module. A neural network with linear layers is defined in the example. [82] => import torch [83] => from torch import nn # Import the nn sub-module from PyTorch [84] => [85] => class NeuralNetwork(nn.Module): # Neural networks are defined as classes [86] => def __init__(self): # Layers and variables are defined in the __init__ method [87] => super().__init__() # Must be in every network. [88] => self.flatten = nn.Flatten() # Construct a flattening layer. [89] => self.linear_relu_stack = nn.Sequential( # Construct a stack of layers. [90] => nn.Linear(28*28, 512), # Linear Layers have an input and output shape [91] => nn.ReLU(), # ReLU is one of many activation functions provided by nn [92] => nn.Linear(512, 512), [93] => nn.ReLU(), [94] => nn.Linear(512, 10), [95] => ) [96] => [97] => def forward(self, x): # This function defines the forward pass. [98] => x = self.flatten(x) [99] => logits = self.linear_relu_stack(x) [100] => return logits [101] => [102] => [103] => ==See also== [104] => {{Portal|Free and open-source software}} [105] => * [[Comparison of deep learning software]] [106] => * [[Differentiable programming]] [107] => * [[DeepSpeed]] [108] => [109] => ==References== [110] => {{Reflist}} [111] => [112] => ==External links== [113] => * {{Official website|https://pytorch.org}} [114] => [115] => {{Deep Learning Software}} [116] => {{Differentiable computing}} [117] => [118] => [[Category:Deep learning software]] [119] => [[Category:Facebook software]] [120] => [[Category:Free science software]] [121] => [[Category:Free software programmed in C]] [122] => [[Category:Free software programmed in Python]] [123] => [[Category:Open-source artificial intelligence]] [124] => [[Category:Python (programming language) scientific libraries]] [125] => [[Category:Software using the BSD license]] [] => )
good wiki

PyTorch

PyTorch is an open-source machine learning library for the Python programming language, developed by Facebook's Artificial Intelligence Research lab (FAIR). It provides a flexible and dynamic computational graph system that allows users to build deep learning models.

More about us

About

It provides a flexible and dynamic computational graph system that allows users to build deep learning models. The library offers an extensive range of tools and functions for developing and training various types of neural networks. PyTorch's main feature is its focus on tensor computation, which significantly improves performance and efficiency. It also provides an easy-to-use interface and supports extensive experimentation, making it popular among researchers and developers. The Wikipedia page on PyTorch provides detailed information on its history, features, architecture, applications, and future extensions.

Expert Team

Vivamus eget neque lacus. Pellentesque egauris ex.

Award winning agency

Lorem ipsum, dolor sit amet consectetur elitorceat .

10 Year Exp.

Pellen tesque eget, mauris lorem iupsum neque lacus.