

{"id":111118,"date":"2023-01-16T11:00:57","date_gmt":"2023-01-16T05:30:57","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=111118"},"modified":"2023-01-17T11:15:06","modified_gmt":"2023-01-17T05:45:06","slug":"pytorch-cnn","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/","title":{"rendered":"PyTorch CNN"},"content":{"rendered":"<p>CNN stands for Convolutional Neural Networks. Classification has been a popular application of Machine Learning. CNN models are good at detecting patterns and are therefore employed mostly for problems related to image classification\/recognition, such as facial recognition of our smartphones. It detects patterns like edges, circles, bulges etc. and associates them to one of the outputs probabilistically, thereby learning different characteristics of different classes. In this tutorial, learn more about PyTorch CNN.<\/p>\n<h3>Why Convolution Neural Networks?<\/h3>\n<p>Convolution Neural Networks, as powerful as they are, are thought to have been inspired by the idea of mimicking the human brain. In fact, from a bird\u2019s eye view, they perform functions similar to a human brain. Scientists in the 20th century proposed that our brain applies some filter to the image perceived by the eye to identify it. It is exactly how a convolution neural network works. However, the exact picture is somewhat different compared to an elementary level.<\/p>\n<p>Another school of thought believes that it owes its popularity to its ability to identify patterns irrespective of the image&#8217;s scale or orientation. For example, suppose we train a model to identify a nose. Now, if we give an image of an entire face to our trained model, it will correctly identify the nose as it takes into account all the smaller fragments of the input independent of the remaining parts of the image. This property is also known as the regularisation mechanism of the convolutional neural network.<\/p>\n<p>CNNs are also good at identifying images even when rotated or spatially altered. It is called the property of invariance.<\/p>\n<h3>Working of a convolution layer:<\/h3>\n<p>In a convolutional network, the hidden layers consist of multiple (not necessarily all) convolutional layers. These layers have some filters to extract information about patterns. It is done by convolving the filter matrix over the input matrix.<\/p>\n<p><span style=\"font-weight: 400\">Suppose the input matrix is :<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/input-matrix.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111449\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/input-matrix.webp\" alt=\"input matrix\" width=\"210\" height=\"280\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">And the filter matrix is F:<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/filter-matrix.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111450\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/filter-matrix.webp\" alt=\"filter matrix\" width=\"110\" height=\"100\" \/><\/a><\/p>\n<p>The output of this layer will be an activation map obtained by convolving A with F. The convolution operation will be represented as A * F. Let&#8217;s try to understand this operation by applying it to the above matrices.<\/p>\n<p>The number of columns of the activation matrix will be the number of submatrices of matrix A that can be overlapped by the filter matrix F in the horizontal direction.<br \/>\nHere, it will be 4.<\/p>\n<p>Similarly, the number of submatrices of matrix A can be overlapped by the filter matrix F in the vertical direction. In this example, it will also be 4.<\/p>\n<p>So, our activation map\/matrix will be a matrix of dimension 4 x 4.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/activation-matrix.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111451\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/activation-matrix.webp\" alt=\"activation matrix\" width=\"240\" height=\"200\" \/><\/a><\/p>\n<p>Now we will start convolving from the upper left part of the matrix A.<\/p>\n<p>The elements of the activation map can be found as follows.<\/p>\n<p>a<sub>11 <\/sub>= <span style=\"font-weight: 400\">(1*1) + (2*2) + (6*3) + (7*4) = 1 + 4 + 18 + 28 = 51<\/span><sub><br \/>\n<\/sub><\/p>\n<p><span style=\"font-weight: 400\">a<\/span><sub><span style=\"font-weight: 400\">12<\/span><\/sub><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">2*1 + 3*2 + 7*3 + 8*4 = 2+6+21+32 = 61<\/span><\/p>\n<p>Similarly, we can calculate all the values.<\/p>\n<p>Resultant matrix will be <a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/result-1.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111454\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/result-1.webp\" alt=\"result\" width=\"240\" height=\"200\" \/><\/a><\/p>\n<p>The filter matrices are designed so that the activation matrices obtained can help the network to identify some patterns in the input image.<\/p>\n<h3>Implementing a Convolutional Neural Network using Pytorch:<\/h3>\n<p>The good thing about PyTorch is that we do not have to hardcode all the convolution layers, nor do we have to implement the activation functions ourselves. PyTorch has some libraries that can be used for these tasks, as seen in the code example below.<\/p>\n<h4>a. The MNIST Dataset:<\/h4>\n<p>The MNIST dataset contains images of handwritten numbers from 0 to 9, making a total of 10 categories. Furthermore, it consists of all possible ways a person can write these numbers. Therefore, we can train our model using the MNIST dataset to identify handwritten numbers.<\/p>\n<h4>b. Importing the required libraries:<\/h4>\n<p>Firstly, we will import all the libraries which we may need for our model.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import torch\r\nimport torchvision\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nfrom torchvision import transforms,datasets\r\nimport torch.nn.functional as F\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\n<\/pre>\n<h4>c. Loading the data:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">train=datasets.MNIST(\"\", train=True,download=True,transform=transforms.Compose([transforms.ToTensor()]))\r\ntest=datasets.MNIST(\"\", train=False,download=True,transform=transforms.Compose([transforms.ToTensor()]))\r\n\r\ntrainset=torch.utils.data.DataLoader(train,batch_size=64,shuffle=True)\r\ntestset=torch.utils.data.DataLoader(test,batch_size=64,shuffle=True)\r\n<\/pre>\n<h4>d. Playing around with the loaded data:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for i in range(5):\r\n    print(train[34+i][1])\r\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/training-sample.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111414\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/training-sample.webp\" alt=\"training sample\" width=\"1920\" height=\"281\" \/><\/a><\/p>\n<p>Here, we have printed some random labels of the MNIST dataset. We can also print the tensors representing these labels.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">print(train[12][0])<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/train-tensor-rep.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111413\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/train-tensor-rep.webp\" alt=\"train tensor rep\" width=\"1920\" height=\"768\" \/><\/a><\/p>\n<h4>e. Building the Convolutional Model:<\/h4>\n<p>Now that we have our data, we can build our convolutional model. First, we will create a forward function that will sequentially implement the convolution layers, followed by activation and pooling layers and finally, the linear layers.<\/p>\n<p>We will also create a function to validate our predictions and print the accuracy later.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class ConvNet(nn.Module):\r\n    def __init__(self):\r\n    \t    super(ConvNet,self).__init__()\r\n    \r\n    def forward(self):\r\n      \tmodel=nn.Sequential(nn.Conv2d(1,10,5,padding=2),\r\n                    \tnn.ReLU(),\r\n                    \tnn.AvgPool2d(2,stride=2),\r\n                   \t \r\n                    \tnn.Conv2d(10,20,5,padding=0),\r\n                    \tnn.ReLU(),\r\n                    \tnn.AvgPool2d(2,stride=2),\r\n                   \t \r\n                    \tnn.Flatten(),\r\n                    \tnn.Linear(500,250),\r\n                    \tnn.ReLU(),\r\n                    \tnn.Linear(250,100),\r\n                    \tnn.ReLU(),\r\n                    \tnn.Linear(100,10)\r\n                   \t)\r\n    \t     return model\r\n    \r\n    \r\n    def validate(self,model,data):\r\n    \t    total=0\r\n    \t    correct=0\r\n    \t    for i,(images,labels) in enumerate(data):\r\n        \t    x=model(images)\r\n        \t    value,pred=torch.max(x,1)\r\n        \t    total+=x.size(0)\r\n        \t    correct+=torch.sum(pred==labels)\r\n    \r\n    \r\n    \t    return correct\/total\r\n<\/pre>\n<h4>f. Training the model:<\/h4>\n<p>Before training our model, we have to specify the device and the number of epochs we want to use. Also, to use our model, we must create an instance of it.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">device=torch.device(\"cpu\")\r\nepoch=10\r\ncnn_model=ConvNet()\r\n\r\n\r\nFinally we will train our model.\r\ncnn=cnn_model.forward().to(device)\r\ncel=nn.CrossEntropyLoss()\r\noptimizer=optim.Adam(cnn.parameters(),lr=0.01)\r\n    \r\nfor epoch in range(epoch):\r\n  for i,(images,labels) in enumerate(trainset):\r\n    \t    images=images.to(device)\r\n    \t    labels=labels.to(device)\r\n    \t    optimizer.zero_grad()\r\n    \t    pred=cnn(images)\r\n    \t    loss=cel(pred,labels)\r\n    \t    loss.backward()\r\n    \t    optimizer.step()\r\n       \t \r\n  accuracy=cnn_model.validate(cnn,testset)\r\n  print(epoch,accuracy)<\/pre>\n<p>It will take a while to train the model.<\/p>\n<p><strong>Output\u2013<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/model-accuracy.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111412\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/model-accuracy.webp\" alt=\"model accuracy\" width=\"1920\" height=\"233\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>We have successfully implemented a CNN model and achieved remarkable accuracy. It was preprocessed data. Therefore we got such accuracy. However, in practical scenarios, we might not get such accuracy.<\/p>\n<h3>Summary<\/h3>\n<p>PyTorch makes it very convenient for us to implement a Convolutional Neural Network by providing several convolutional layers. These models are mostly used for image-related applications. However, we can also use it for Natural Language Processing, which was previously tackled by RNN, with even better results than RNNs.<br \/>\nAlso, many pre-trained models trained on popular datasets are available on the web. Some of them are -VGG19, ResNet50, GoogleNet. We can play around with these models to predict outputs on new inputs and get a feel of the working of a sophisticated convolutional network.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CNN stands for Convolutional Neural Networks. Classification has been a popular application of Machine Learning. CNN models are good at detecting patterns and are therefore employed mostly for problems related to image classification\/recognition, such&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":111497,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26498],"tags":[27190],"class_list":["post-111118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pytorch-tutorials","tag-pytorch-cnn"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PyTorch CNN - DataFlair<\/title>\n<meta name=\"description\" content=\"PyTorch makes it easy to implement Convolutional Neural Network by providing several convolutional layers. Learn more about PyTorch CNN.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyTorch CNN - DataFlair\" \/>\n<meta property=\"og:description\" content=\"PyTorch makes it easy to implement Convolutional Neural Network by providing several convolutional layers. Learn more about PyTorch CNN.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-16T05:30:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-17T05:45:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/pytorch-cnn.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyTorch CNN - DataFlair","description":"PyTorch makes it easy to implement Convolutional Neural Network by providing several convolutional layers. Learn more about PyTorch CNN.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/","og_locale":"en_US","og_type":"article","og_title":"PyTorch CNN - DataFlair","og_description":"PyTorch makes it easy to implement Convolutional Neural Network by providing several convolutional layers. Learn more about PyTorch CNN.","og_url":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-01-16T05:30:57+00:00","article_modified_time":"2023-01-17T05:45:06+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/pytorch-cnn.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"PyTorch CNN","datePublished":"2023-01-16T05:30:57+00:00","dateModified":"2023-01-17T05:45:06+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/"},"wordCount":872,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/pytorch-cnn.webp","keywords":["PyTorch CNN"],"articleSection":["PyTorch Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/","url":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/","name":"PyTorch CNN - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/pytorch-cnn.webp","datePublished":"2023-01-16T05:30:57+00:00","dateModified":"2023-01-17T05:45:06+00:00","description":"PyTorch makes it easy to implement Convolutional Neural Network by providing several convolutional layers. Learn more about PyTorch CNN.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/pytorch-cnn\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/pytorch-cnn.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/pytorch-cnn.webp","width":1200,"height":628,"caption":"pytorch cnn"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/pytorch-cnn\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"PyTorch Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/pytorch-tutorials\/"},{"@type":"ListItem","position":3,"name":"PyTorch CNN"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/111118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=111118"}],"version-history":[{"count":9,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/111118\/revisions"}],"predecessor-version":[{"id":111499,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/111118\/revisions\/111499"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/111497"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=111118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=111118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=111118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}