<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Deepanshi Sharma on Medium]]></title>
        <description><![CDATA[Stories by Deepanshi Sharma on Medium]]></description>
        <link>https://medium.com/@deecodes?source=rss-30c704cfd6c7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CR623_xk6gUCUhhfulYKcA.jpeg</url>
            <title>Stories by Deepanshi Sharma on Medium</title>
            <link>https://medium.com/@deecodes?source=rss-30c704cfd6c7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:27:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deecodes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Guide to Google Girl Hackathon]]></title>
            <link>https://medium.com/developer-student-clubs-tiet/a-guide-to-google-girl-hackathon-6af4b243d4a8?source=rss-30c704cfd6c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6af4b243d4a8</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[stem]]></category>
            <dc:creator><![CDATA[Deepanshi Sharma]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 13:43:35 GMT</pubDate>
            <atom:updated>2024-04-12T14:17:21.506Z</atom:updated>
            <content:encoded><![CDATA[<p>Last year, I came across this opportunity and thought how great it would be if I won such a prestigious hackathon. Did I win it? Let’s find out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9Gfa2a8v5XlrJpqJ.jpg" /></figure><p>Google Girl Hackathon is not only a hackathon. It is a program designed for girls in Engineering to inculcate problem-solving and innovation skills. It is divided into multiple rounds, which include learning cohorts, problem-solving rounds, quizzes, and the grand finale, a hackathon.</p><h3>Round 1</h3><p>In 2023, Round 1 was a problem-solving round for everyone. It consisted of 2 Medium-Hard Level DSA Questions. The first question was really easy to understand but fairly challenging to optimise. And the second question required Hashmaps. I was able to solve both questions partially.</p><p><em>Tip: Your LinkedIn profile and resume are also considered shortlisting factors, so keep them updated!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*vx3q-M0azkoGrEDpQBsqqA.png" /></figure><h3>Round 2</h3><p>Round 2 was all about learning cohorts, where the Google Team conducted really amazing workshops. Senior software engineers from Google shared their experiences with us and told us about their lives at Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S9pk3nO8Fn9QQa4H" /><figcaption>1st VIrtual Workshop on the Art of Writing Idiomatic Code</figcaption></figure><p>These workshops were different for different branches. Mine was for Computer Science. After these workshops, online assessments were taken, according to respective branches. Some had MCQ Questions, but mine consisted of 2 DSA Questions of hard level. I was able to solve both of them completely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*GlaMv1P_14ud5oKG6k5tNQ.png" /></figure><h3>Round 3</h3><p>Now, this was the final round, the Hackathon. We were given a problem statement according to our branch(again!). We were supposed to submit an algorithm to solve the problem.</p><p>Here is the link to the problem statement provided to me: <a href="https://docs.google.com/document/d/1OmNSV0AmM2mPTz-4FZh2s3HBo95LziZn9aV8VH9DNPI/edit?usp=sharing">Problem Statement</a></p><p>I worked day and night for this round. But alas, I could not make it to the Presentation Round. But what’s the fun in Hackathons if you don’t lose a few eh?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*sOFLD6VqFK5QCasqaypdYw.png" /></figure><p>PS. I also got an opportunity to interview with google because of Google Girl Hackathon.</p><p>Thanks for the read!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6af4b243d4a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/developer-student-clubs-tiet/a-guide-to-google-girl-hackathon-6af4b243d4a8">A Guide to Google Girl Hackathon</a> was originally published in <a href="https://medium.com/developer-student-clubs-tiet">Google Developer Student Clubs TIET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Interview Experience]]></title>
            <link>https://medium.com/@deecodes/salesforce-interview-experience-bc816d38bdc1?source=rss-30c704cfd6c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc816d38bdc1</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Deepanshi Sharma]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 09:51:44 GMT</pubDate>
            <atom:updated>2023-07-03T09:51:44.146Z</atom:updated>
            <content:encoded><![CDATA[<p>This year, I got lucky.</p><p>Lucky enough to be the first person to intern on campus from my batch and to get an intern offer from the first day of a product company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*v9mvyQ4ppQ5DRU4RpWiq5A.png" /><figcaption>cloud cloud cloud</figcaption></figure><h4>What is Salesforce?</h4><p>Salesforce is an American cloud-based software company. It helps businesses keep track of customer interactions and data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/0*YltfaRHBqkuTrvbs.png" /></figure><h4>Round 1: Online Assessment</h4><p>It all started with an Online Assessment Test from Salesforce on 26th June. It consisted of 3 Medium-Hard Level DSA Questions. They give you a mock test a few days before consisting of the previous year&#39;s salesforce questions. If you do that seriously, you pretty much get the idea of how the questions are going to be.</p><p>In my OA, I was able to solve all 3, 2 with ease and 1 with a little debugging.</p><h4>Round 2: Technical Interview 1</h4><p>I received a shortlisting e-mail for the interview on 28th June. According to it, my interview was scheduled for the 30th. I started preparing for it right away. I spent one whole day on Computer Science Fundamentals.</p><blockquote>Object Oriented Programming, Data Structures and Algorithms, Database Management System, Operating System and Computer Networks are all part of Computer Science Fundamentals.</blockquote><p>After revising all my notes and interview questions, I started with DSA. As I was already regular with it, I decided to revise it with the <a href="https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/">Striver SDE Sheet</a>. I spent a whole night on it and completed it by the morning.</p><p>Finally, the most awaited moment came, I joined the interview and I was asked to introduce myself. I gave my introduction with as many technical details as I could. And then straightaway the interviewers started with the DSA questions. The first question I was asked was of dynamic programming. It was similar to <a href="https://www.interviewbit.com/blog/0-1-knapsack-problem/">0–1 knapsack</a> but had other conditions to it too. I was able to solve it, by starting with a basic approach and then taking care of all the edge cases. When I ran the test cases, one got stuck. But the interviewers said that they are satisfied, we can move on.</p><p>The second question I was asked was about <a href="https://leetcode.com/problems/linked-list-cycle/">detecting a cycle</a> in LinkedList. It was an easy question so I passed all the testcases. The interviewers asked me about the Time and Space Complexity and then cross questioned about what the TC will be after changing few things in my code. I was able to answer them correctly too.</p><blockquote>Few common tips for DSA questions: Start discussing the approach with your interviewer as soon as they tell you the question. Even when you are coding it, don’t be quiet. And never get confused in Time Complexity!!!</blockquote><p>Then they moved on to CS Fundamentals. I was asked a few basic questions about them and then the interview was concluded.</p><p>The interviewers were very friendly, they even discussed about their life at Salesforce. In my opinion, this interview was of easy-medium level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*GyBNwuP8JHhbyk3Z3chOlQ.png" /><figcaption>It seems the opposite!</figcaption></figure><h4>Round 3: Technical Interview 2</h4><p>15 minutes after my first interview got over, I got a call to join for a second interview. I joined and this time there was a single interviewer. He asked me about my experiences which I mentioned to him in the introduction. He didn’t seem impressed. Then he asked me few questions about DBMS, I got confused at first but somehow managed to answer them correctly. After that, he asked me a question on Graphs. When I asked him about the input format, he asked me to discuss what input format will be most appropriate with him. I thought of every data structure I knew and discussed it all with him, then I discussed a few approaches for the question as well. He didn’t ask me to code it.</p><blockquote>Prepare all your projects in detail, and explain every little feature with the challenges you faced and how you overcame them.</blockquote><p>Then came a tricky question, He asked me what was my favorite subject. I answered Data Structures and Algorithms and also told him about few technologies I used on my projects. Then he looked somewhat impressed. He asked me to discuss more about my work. I told him about my projects, internships, blogs, hackathons and everything I could think of. Then he became more friendly and asked me questions like what if I embed a HashMap into a LinkedList, will it be used as a Blockchain? So after some discussion on various technologies and my projects, we concluded the interview with a few laughs.</p><blockquote>The second interview was tougher than the first one. The interviewer was friendly but for me the questions were of hard level.</blockquote><h4>Result?</h4><p>Within 4 hours of the completion of the interviews, I received an email that I was the only person they shortlisted from my campus.</p><p>Since then, I am excited to work as an intern for Salesforce in the summer of 2024.</p><p>Thank You!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*Gk2NlTCYGg8Y7VEk5yUuiA.png" /><figcaption>Can’t help!</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc816d38bdc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s experiment with NFTs]]></title>
            <link>https://medium.com/coinmonks/lets-experiment-with-nfts-62283e80d662?source=rss-30c704cfd6c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/62283e80d662</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[polygon]]></category>
            <category><![CDATA[non-fungible-tokens]]></category>
            <category><![CDATA[minting]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Deepanshi Sharma]]></dc:creator>
            <pubDate>Mon, 05 Jun 2023 10:20:07 GMT</pubDate>
            <atom:updated>2023-07-14T12:19:59.778Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Imagine you buy a chocolate bar from the market and get a unique token proving your ownership over the chocolate. Wouldn’t it be great? Nobody can steal your part of joy now. Similarly, NFTs are those chocolate bars with ownership rights.</blockquote><p>NFT stands for <strong>Non-Fungible Tokens</strong>. Non-Fungible stands for the uniqueness of these digital assets. Physical currency or even cryptocurrency is fungible but NFTs are not. They can neither be interchanged nor replaced.</p><p>Anybody can create NFTs, because it requires very minimal or zero programming skills, and they can be made out of any artwork, digital art, photos or even videos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/0*SffjcGgkvnUbDDtL" /><figcaption>The first 5000 days NFT-sold for $69.3M</figcaption></figure><p>NFTs are programmed in a very similar way to cryptocurrencies, like Bitcoin. They are tokenized via blockchain and assigned unique identification codes and some metadata which distinguishes them from others. The key difference between cryptocurrencies and NFTs is that two cryptocurrencies from an identical blockchain can be exchanged with each other but two NFTs can’t be, they are not<strong> mutually exchangeable.</strong></p><h3>How did NFTs come into existence?</h3><p>In 2014, A guy’s wife made a video clip, he registered the video on a blockchain(Namecoin) and sold it to Dash for $4. They called it Monetized Graphics at that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*BDxWAjdJCtWdPmClB0B8CA.png" /><figcaption>Quantum-World’s First NFT By Kevin McCoy</figcaption></figure><p>In October 2015, the first NFT Project, Etheria was launched at Ethereum’s first developer conference, just 3 months after the launch of Ethereum. Soon ERC-721 was also proposed in 2017.</p><p>Later on, in early 2020, NFT Market saw rapid growth and wider usage.</p><h3>How do NFTs work?</h3><p>NFTs are individual tokens with valuable information in them, they reside on any blockchain. ( A Blockchain is nothing but a public ledger that holds information about transactions.) Their unique data makes it easier to verify, validate or transfer ownership. When anyone purchases an NFT, they buy a piece of data that points to a server that hosts that image or digital asset.</p><p>NFTs are created by a process called <strong>minting</strong>, which basically involves the creation of a block, validating the information, recording it on blockchain and closing the block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*vq4AQu5Cf23HkWcaVGg2OA.png" /><figcaption>Meme by me ( I can steal memes even if I can’t steal NFTs)</figcaption></figure><p>As tokens are minted, they are assigned a unique identifier address that is linked to exactly one blockchain address. Each token has an owner and a unique identifier through which it can be distinguished from others.</p><h3>Why should you mint an NFT?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*LRL8G2PIgDjVn7yNKOiTKw.png" /><figcaption>I hope this clears all the doubts.</figcaption></figure><h3>What is the easiest way to make your own NFT(for free)?</h3><p>I would suggest exploring various marketplaces such as OpenSea, Rarible, NFTically and many more.</p><p>For this blog, we will be using Open Sea. Hop on to <a href="https://opensea.io/">OpenSea</a> and connect your <a href="https://metamask.io/">Metamask</a> wallet( If you don’t have one, just create one, very easy piecey).</p><p>Go to create, upload your file (it can be anything image, drawing, audio, video or even 3d model), name it and add a description. For blockchain choose Polygon (if you want to create it for free), and once you have completed all these steps, click on Create.</p><p>Voila! you created your first NFT.</p><h3>How to mint multiple NFTs on a Testnet?</h3><p>In this blog, we will be using Polgon Mumbai Testnet, IPFS and NFT.Storage API.</p><p>Polygon is a layer-2 blockchain, built on Ethereum. Hence, it helps in scalability and enables access to such a big market of Ethereum. NFT.Storage provides cost-effective storage solutions and easy integration. IPFS(Interplanetary File System) ensures that files are immutable and verifiable as it identifies files using unique cryptographic hashes.</p><h4><strong>Step 1: Setting up Pre-requisites</strong></h4><p>Download and Install <a href="https://nodejs.org/en/download/package-manager">Node.js</a>.</p><p>Download and Install <a href="https://metamask.io/">Metamask</a>.</p><p>Receive Matic Tokens using <a href="https://mumbaifaucet.com/">Faucet</a>.</p><p>Copy your <a href="https://support.blockchain.com/hc/en-us/articles/360000951966-What-are-public-and-private-keys-in-crypto-">Private Key</a> from your Metamask wallet.</p><p>Install an IDE like <a href="https://code.visualstudio.com/download">Visual Studio Code</a> with <a href="https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity">Solidity</a> Extension enabled.</p><h4>Step 2: Getting an API Key from NFT.Storage</h4><p>Hop on to <a href="https://nft.storage/">NFT.Storage</a> and login with your e-mail id. It will send a magic link to login and use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*WmxInl0qFeh5zxLgP0PSrA.png" /><figcaption>NFT.Storage Interface</figcaption></figure><p>After that go on to API-Keys on the navbar and create one for yourself.</p><h4>Step 3: Setting up Workspace</h4><p>Installing Node.js Dependencies:</p><pre>npm install hardhat @openzeppelin/contracts nft.storage dotenv @nomiclabs/hardhat-ethers</pre><p>Initialising Hardhat:</p><pre>npx hardhat</pre><p>When it will prompt, choose Create an Empty hardhat.config.js</p><p>Now create a file .env and store your API-Key(from NFT-Storage) and Private Key(from Wallet) in the following format:</p><pre>PRIVATE_KEY=”Your private key”. <br>NFT_STORAGE_API_KEY=&quot;Your api key&quot;</pre><h4>Step 4: Modify the Hardhat-config file to support Mumbai Testnet</h4><p>Import Modules for Hardhat integration with Ether.js Library and dotenv to retrieve data from the .env file(where we can store our API key and our private key).</p><p>Retrieve the private key from the environment using const{PRIVATE_KEY}=process.end;</p><p>Then in exports, we are specifying our network and its configurations, i.e. Configuring it to support Polygon Mumbai Testnet. Then some info for the solidity compiler.</p><pre>/**<br>* @type import(&#39;hardhat/config&#39;).HardhatUserConfig<br>*/<br>require(&quot;@nomiclabs/hardhat-ethers&quot;);<br>require(&#39;dotenv&#39;).config();<br>const { PRIVATE_KEY } = process.env;<br>module.exports = {<br>  defaultNetwork: &quot;PolygonMumbai&quot;,<br>  networks: {<br>    hardhat: {<br>    },<br>     PolygonMumbai: {<br>      url: &quot;https://rpc-mumbai.maticvigil.com&quot;,<br>      accounts: [PRIVATE_KEY]<br>    }<br>  },<br>  solidity: {<br>    version: &quot;0.8.12&quot;,<br>    settings: {<br>      optimizer: {<br>        enabled: true,<br>        runs: 200<br>      }<br>    }<br>  },<br>}</pre><h4>Step 5: Create Folders using mkdir command for keeping track of all files</h4><p>Try to create them using mkdir only, not manually. You can dodge a few errors just because of this change.</p><pre>mkdir contracts assets scripts</pre><p>Download the assets from <a href="https://drive.google.com/drive/folders/1yWLzHVkzhn-0hbM-BuGBQ3_tLlNeRrwa?usp=share_link">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*jWFJIsHcA-EkokW-9bXWCA.png" /><figcaption>File Structure at the end of the project</figcaption></figure><h4>Step 6: Create a script: store-content.mjs in Scripts Directory.</h4><p>Import Required Modules: NFT-Storage, File and dotenv</p><p>Retrieve the value of API-KEY from .env.</p><p>Create an async function named store-asset, and inside it, create a new client to store NFT and its metadata.</p><p>Read the images using File and parse through our CSV files, and store them as attributes on IPFS.</p><pre>dotenv.config()<br>import { NFTStorage, File } from &quot;nft.storage&quot;<br>import fs from &#39;fs&#39;<br>import dotenv from &#39;dotenv&#39;<br>import { parse } from &#39;csv-parse&#39;;<br>const API_KEY = process.env.NFT_STORAGE_API_KEY<br>const POKEMON_CSV_PATH = &#39;assets/pokemon_metadata.csv&#39;<br>const POKEMON_PHOTO_PATH = &#39;assets/original_150_pokemon_photos/&#39;<br><br>// Process CSV file<br>var parser = await parse({columns: true}, async function (err, records) {<br>    for (let index = 0; index &lt; 50; index++) {<br>        var element = records[index]<br>        // Each row of the CSV represents a single Pokemon extract the<br>        // name, description, type, attack, defense, speed, and number.<br>        var name = element[&#39;Pokemon&#39;]<br>        var description = element[&#39;Description&#39;]<br>        var type = element[&#39;Type 1&#39;]<br>        var hp = element[&#39;HP&#39;]<br>        var attack = element[&#39;Attack&#39;]<br>        var defense = element[&#39;Defense&#39;]<br>        var speed = element[&#39;Speed&#39;]<br>        var number = element[&#39;Number&#39;]<br>        var picture = `${POKEMON_PHOTO_PATH}${number}.PNG`<br><br>        var attributes = createAttributes(type, hp, attack, defense, speed)<br>        // store the metadata for this Pokemon<br>        await storeAsset(name, description, attributes, picture)<br>    }<br>});<br><br>fs.createReadStream(POKEMON_CSV_PATH).pipe(parser);<br><br>function createAttributes(type, hp, attack, defense, speed){<br>    let type_attr = JSON.parse(`{ &quot;trait_type&quot;: &quot;Type&quot;, &quot;value&quot;: &quot;${type}&quot; }`)<br>    let hp_attr = JSON.parse(`{ &quot;trait_type&quot;: &quot;HP&quot;, &quot;value&quot;: ${hp} }`)<br>    let attack_attr = JSON.parse(`{ &quot;trait_type&quot;: &quot;Attack&quot;, &quot;value&quot;: ${attack} }`)<br>    let defense_attr = JSON.parse(`{ &quot;trait_type&quot;: &quot;Defense&quot;, &quot;value&quot;: ${defense} }`)<br>    let speed_attr = JSON.parse(`{ &quot;trait_type&quot;: &quot;Speed&quot;, &quot;value&quot;: ${speed} }`)<br>    return [type_attr, hp_attr, attack_attr, defense_attr, speed_attr]<br>}<br><br>// Store metadata for one Pokemon on IPFS<br>async function storeAsset(name, description, attributes, picture_path) {<br>   const client = new NFTStorage({ token: API_KEY })<br>   const metadata = await client.store({<br>       name: `BlockchainBob ${name}`,<br>       description: description,<br>       attributes: attributes,<br>       image: new File(<br>           [await fs.promises.readFile(picture_path)],<br>           `${name}Photo.png`,<br>           { type: &#39;image/png&#39; }<br>       ),<br>   })<br>   console.log(`${name}: ${metadata.url}`)<br>}</pre><p>When we run it, we would be able to see its URL on the console. Run it using:</p><pre>Node scripts/store-content.mjs</pre><h4>Step 7: Create a Smart Contract, nft.sol in Contracts Directory</h4><p>Import various contracts from open zeppelin library:</p><p>ERC-721: for basic implementation of ERC-721 Standard.</p><p>Counters: for managing counters, generate unique token ids</p><p>Ownable: Allows certain functions to be accessible only to the contract owner.</p><p>Create a constructor which gets called when the contract is deployed.The constructor initializes the contract by calling the constructor if ERC-721 contract and passing in the desired name and symbol for NFT. The Function is for the contract owner to mint new NFTs and assign them to recipients and associating metadata URIs with each token.</p><pre>// Contract based on https://docs.openzeppelin.com/contracts/4.x/erc721<br>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.12;<br><br>import &quot;@openzeppelin/contracts/token/ERC721/ERC721.sol&quot;;<br>import &quot;@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol&quot;;<br>import &quot;@openzeppelin/contracts/utils/Counters.sol&quot;;<br>import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;<br><br>contract PokemonNFT is ERC721URIStorage, Ownable {<br>   using Counters for Counters.Counter;<br>   Counters.Counter private _tokenIds;<br><br>   constructor() ERC721(&quot;PokemonNFT&quot;, &quot;PokeNFT&quot;) {}<br><br>   function mintNFT(address recipient, string memory tokenURI)<br>       public onlyOwner<br>       returns (uint256)<br>   {<br>       _tokenIds.increment();<br><br>       uint256 newItemId = _tokenIds.current();<br>       _mint(recipient, newItemId);<br>       _setTokenURI(newItemId, tokenURI);<br><br>       return newItemId;<br>   }<br>}</pre><h4>Step 8: Deploy Smart Contract on Polygon</h4><p>Create a script deploy.js in the Scripts Directory</p><pre>async function deployContract() {<br>    const PokemonNFT = await ethers.getContractFactory(&quot;PokemonNFT&quot;)<br>    const exampleNFT = await PokemonNFT.deploy()<br>    await exampleNFT.deployed()<br>    const txHash = exampleNFT.deployTransaction.hash<br>    const txReceipt = await ethers.provider.waitForTransaction(txHash)<br>    const contractAddress = txReceipt.contractAddress<br>    console.log(&quot;Contract deployed to address:&quot;, contractAddress)<br>   }<br>   <br>deployContract()<br> .then(() =&gt; process.exit(0))<br> .catch((error) =&gt; {<br>   console.error(error);<br>   process.exit(1);<br> });</pre><h4>Step 9: Minting NFTs on Polygon</h4><p>Create a script Mint-NFT.mjs in the Scripts Directory</p><pre>import { parse } from &#39;csv-parse&#39;<br>const CONTRACT_ADDRESS = &quot;xxxxxxxxxxxxx&quot;<br>import fs from &#39;fs&#39;<br>const METADATA_URLS_PATH = &#39;assets/metadata_urls.csv&#39;<br><br>// Process CSV file<br>var parser = parse({columns: true}, async function (err, records) {<br>   console.log(records.length)<br>   for (let index = 0; index &lt; records.length; index++) {<br>      var record = records[index]<br>      console.log(`Minting:${record[&#39;POKEMON&#39;]}`)<br>      await mintNFT(CONTRACT_ADDRESS, record[&#39;IPFS_URL&#39;])<br>   }<br>})<br><br>fs.createReadStream(METADATA_URLS_PATH).pipe(parser)<br><br>async function mintNFT(contractAddress, metaDataURL) {<br>   const ExampleNFT = await ethers.getContractFactory(&quot;PokemonNFT&quot;)<br>   const [owner] = await ethers.getSigners()<br>   await ExampleNFT.attach(contractAddress).mintNFT(owner.address, metaDataURL)<br>   console.log(&quot;NFT minted to: &quot;, owner.address)<br>}</pre><p>Run the script using the following Command:</p><pre>npx hardhat run scripts/mint-nft.mjs --network PolygonMumbai</pre><h4>Step 10: Verify your NFTs</h4><p>Go to <a href="https://testnets.opensea.io/">Opensea Testnets</a> and connect your wallet. Bingo! You will find all your NFTs there.</p><p>If it was this easy,</p><h3>Why did I write this blog?</h3><p>Because I never got all the information when I was learning about the same. No blogs, and no videos clearly explaining this. I realised the need for an informative blog so that it’s easier for other people to learn. Credits to <a href="https://www.linkedin.com/in/chiragsingh1711/">Chirag</a> too, for figuring this out with me.</p><p>Thank You!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*fHnwtH-sNbywdlK0bE-dQg.png" /><figcaption>Meanwhile, people who actually read the blog.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62283e80d662" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/lets-experiment-with-nfts-62283e80d662">Let’s experiment with NFTs</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I eXtended the Reality of Open Source]]></title>
            <link>https://medium.com/@deecodes/i-extended-the-reality-of-open-source-145f81f39b9d?source=rss-30c704cfd6c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/145f81f39b9d</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[xr]]></category>
            <dc:creator><![CDATA[Deepanshi Sharma]]></dc:creator>
            <pubDate>Thu, 20 Apr 2023 17:03:32 GMT</pubDate>
            <atom:updated>2023-04-20T17:03:32.344Z</atom:updated>
            <content:encoded><![CDATA[<h3>I extended the reality of open source</h3><p>Extended Reality Open Source (XROS) Fellowship is a 3-month program where a selected cohort of 100 developers contribute to open source projects related to XR Technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlOvLXewAX7RO_fThpwcTA.png" /></figure><p>When I learned about it, It felt like a dream opportunity. The selection process consists of several phases of profile approval, proposal submission and interviews.</p><h3><strong>Profile Approval</strong></h3><p>I submitted my profile as soon as I got to know about the fellowship. I tried to showcase all my previous work in open source as well as in XR. After 3 days, I got an email from Reskilll that I was selected for proposal submission and I can start working on it.</p><blockquote>I would recommend mentioning any type of open source contributions even if you don’t have any in XR Domain.</blockquote><h3><strong>Proposal Submission</strong></h3><p>We were allowed to submit proposals for 4 organisations at max. There were 31 organisations this year and I researched each one of them and decided to go with Fanisko, CreatAR, Z-Anatomy and NIFT. They already had projects pre-defined so that made my work a lot easier as I knew what I am supposed to do instead of thinking about ideas/changes I would like to add.</p><blockquote>It&#39;s great if you can submit for all four as it increases the chances for selection. Also, try to choose an organisation whose work matches your interests and knowledge, as having extra knowledge about the core field of your organisation is always a cherry on the top.</blockquote><p>I talked to the mentors of each organisation I was applying to on Slack and mailed them my proposals. I discussed my plan of action and how I can add value to their projects. Most of them were very happy answering all my queries and also helped me in improving my proposal.</p><p>A <a href="https://xrosfellowship.ficci.in/assets/xr/template.pdf">template</a> was provided and we were allowed to do any changes to it as per our choice, even using our own template. I used the one they provided and precisely defined the project and my plan of action. I also tried to use charts and infographics to depict my objectives and thinking process clearly and in a creative way. I mentioned all my projects in XR and also my previous experiences.</p><p>Reskilll organised AMA Session with mostly all project bearers, and that was very helpful in my journey. I got to know their perspective on the same projects, and I knew what they wanted and I was able to show that in my proposal.</p><blockquote>I would say asking mentors to review the proposal before submitting it makes your proposal outshine others. They tell you some organisation specific and critical details about the projects which you are not able to identify yourself.</blockquote><h3>Interviews</h3><p>I submitted my 4 proposals a day before the deadline, and they told us to wait for a few days before the selected people would be contacted for Interviews or further rounds. I was very nervous during the whole week, continuously checking my phone for emails. I got contacted by Z-Anatomy to showcase my work in 3d, and by NIFT to describe my plan of action with a hard deadline of 1 day. I again made a document describing everything I could with infographics and charts and submitted timely. Soon the organisations started their interviews and I was hopeful for my other 2 organisations too.</p><p>One Sunday, I was in a hackathon, trying to pitch my project when I got a call, surprised and shocked, I ran outside to answer it and got to know I was selected for an interview with Fanisko. I had 2 days to prepare, I missed all of my classes, refined my projects, learnt a few new skills and made demo videos of my projects. I even tried to gobble up answers to common HR Interview Questions as I was confident in the technical part but not in the Behavioral one. <br>Finally, the day came, I joined the meeting 30 minutes before the time and continuously recited my prayers. The interview started, and all the mentors from Fanisko were present and asked me technical questions and a few about how will I manage this with my studies. I would say my interview went really well. The mentors were really helpful and humble in the interview, they were trying to help me wherever I got stuck. After that interview, I came to know that I am good at answering non-technical questions too, and got more confident about behavioural questions.</p><blockquote>Do research on the tech-stack of the organisation beforehand. Also, a great in-depth understanding of how stuff works in your projects makes your interview a cakewalk.</blockquote><p>After that day, I spent a few days discussing with friends about reasons why will I get selected or why will I get rejected. Those were very nerve-wracking days, but I got through them.</p><p>On 31st March, Just when I entered my home after coming back from college, I got an email. The first thing I did was not read it but show it to my mom who started feeding me rasgullas immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*CgqqMwQfAy-ThexceNQNgg.png" /></figure><p>It was such a beautiful, surprising, nerve-wrenching and fruitful journey. I learned so much from it. I am very thankful to Reskilll for organising it, Fanisko for selecting me, my mentors for guiding me, and all the people who were a part of making this dream come true.</p><h3>Epilogue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqltnmoSzTj8CoqSR_U_OA.jpeg" /></figure><p>I have started working with Fanisko. They gave us a very warm welcome and a wholesome onboarding meeting. The mentors are helping us at every step and I am learning something new every single day.</p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=145f81f39b9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My lightening experience with Pytorch]]></title>
            <link>https://medium.com/developer-student-clubs-tiet/my-lightening-experience-with-pytorch-c8382b2da2ed?source=rss-30c704cfd6c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8382b2da2ed</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Deepanshi Sharma]]></dc:creator>
            <pubDate>Mon, 04 Jul 2022 17:33:08 GMT</pubDate>
            <atom:updated>2022-07-04T17:36:41.450Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Imagine a fine evening, it&#39;s drizzling outside, and you are sitting beside a window, exploring Python( the language one!) while sipping hot coffee.</blockquote><blockquote>You are going through all the articles, blogs, and videos that make you curious but suddenly lightning strikes and you come across an excellent blog about a library called Pytorch.</blockquote><blockquote>Pytorch is a deep learning library for training neural networks using optimised tensors. Plus, it’s open source!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3G90f7g9YfnJl0Haif-s5w.png" /><figcaption>source:pytorch.org</figcaption></figure><p>The year 2016 saw the release of Pytorch by Facebook. Python programmers should find it simpler to use than other deep learning frameworks because its Python interface is more polished and is more narrowly focused. However, PyTorch also comes with a C++ frontend. In addition to that, PyTorch will be simpler to use if you want to tailor your code for certain machine learning issues.</p><p>Given the fact that PyTorch and its rival TensorFlow both employ tensors,but their main distinction is that PyTorch uses dynamic computation graphs, whilst TensorFlow uses static computation graphs which gives Pytorch an extra edge while building complex architectures.<br>Initially, Visdom was a visualisation package that PyTorch used, however now it has subsequently added complete support for TensorBoard.</p><blockquote>The more you scroll the more curious you grow, and finally decide to install pytorch.</blockquote><h3>Installation</h3><p>To install Pytorch locally, head on to <a href="https://pytorch.org/get-started/locally/">the official website</a>, specify the configurations and run the given commands in your terminal.</p><p><em>Note: Pytorch supports both GPU and CPU, The GPU enabled variant includes support for advanced features where as CPU enabled one omits the functions that would require a GPU.</em></p><p>For Conda,</p><pre>conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch</pre><p>For Pip,</p><pre>pip3 install torch torchvision torchaudio --extra-index-url <a href="https://download.pytorch.org/whl/cu113">https://download.pytorch.org/whl/cu113</a></pre><blockquote>Your struggles with Pip and Conda lead you to try something simpler, and Google Colab is the answer!</blockquote><p>Come on, let’s hop on to <a href="https://research.google.com/colaboratory/">Google Colab </a>(if you too are intimidated by local Python environments.)</p><h3>Importing necessary modules</h3><pre><strong>import</strong> torch<br><strong>import</strong> math<br><strong>import</strong> numpy <strong>as</strong> np<br><strong>import</strong> torch.nn <strong>as</strong> nn<br><strong>import</strong> torch.nn.functional <strong>as</strong> F<br><strong>import</strong> matplotlib.pyplot <strong>as</strong> plt<br><strong>from</strong> sklearn <strong>import</strong> datasets<br><strong>from</strong> sklearn.preprocessing <strong>import</strong> StandardScaler<br><strong>from</strong> sklearn.model_selection <strong>import</strong> train_test_split<br><strong>from</strong> torch.utils.data <strong>import</strong> Dataset, DataLoader<br><strong>import</strong> torchvision.transforms <strong>as</strong> transforms</pre><h3>Tensor?</h3><p>In layman’s terms, <a href="https://medium.com/@deecodes/my-lightening-experience-with-pytorch-c8382b2da2ed">Tensor</a> is nothing but a multi-dimensional matrix consisting of homogeneous data type values.</p><p>Simple Mathematical Operations on a tensor,</p><pre>p<strong>=</strong>torch<strong>.</strong>empty(2,2,3)<br>print(p)<br>x<strong>=</strong>torch<strong>.</strong>rand(2,2)<br>y<strong>=</strong>torch<strong>.</strong>rand(2,2)<br>print(x)<br>print(y)<br>z<strong>=</strong>x<strong>+</strong>y<br>z<strong>=</strong>torch<strong>.</strong>add(x,y)<br>print(z)<br><em>#y.add_(x)</em><br><em>#print(y)</em><br><br>q<strong>=</strong>torch<strong>.</strong>mul(x,y)<br>print(q)</pre><p>Using Random,</p><pre>x<strong>=</strong>torch<strong>.</strong>rand(4,4)<br>print(x)<br>y<strong>=</strong>x<strong>.</strong>view(<strong>-</strong>1,8)<br>print(y)</pre><p>Tensor to Numpy Array</p><pre>a<strong>=</strong>torch<strong>.</strong>ones(5)<br>print(a)<br>b<strong>=</strong>a<strong>.</strong>numpy()<br>print(type(b)) <em>#tensor to numpy array</em><br>a<strong>.</strong>add_(1)<br>print(a)<br>print(b)</pre><p>Numpy Array to Tensor</p><pre>a<strong>=</strong>np<strong>.</strong>ones(5)<br>print(a)<br>b<strong>=</strong>torch<strong>.</strong>from_numpy(a)<br>print(b)<br>a<strong>==</strong>1<br>print(a)<br>print(b)</pre><blockquote><strong>Gentle Warning</strong>: Now, as you move closer to the complexities, you decide to grab another cup of coffee to stop you from falling asleep.</blockquote><h3>Autograd Module</h3><p>To calculate the gradients using <a href="https://pytorch.org/tutorials/beginner/introyt/autogradyt_tutorial.html">autograd</a> module, a recorder records the actions that have been taken and then replays them in reverse. This technique is particularly effective for creating neural networks since it can reduce the amount of time spent on one epoch by computing parameter differentiation during the forward pass.</p><pre>weights <strong>=</strong> torch<strong>.</strong>ones(4,requires_grad<strong>=True</strong>)<br><br><strong>for</strong> epoch <strong>in</strong> range(2):<br>  model_output<strong>=</strong>(weights<strong>*</strong>3)<strong>.</strong>sum()<br><br>  model_output<strong>.</strong>backward()<br>  print(weights<strong>.</strong>grad)<br>  weights<strong>.</strong>grad<strong>.</strong>zero_()</pre><h3>Optim Module</h3><p>A PyTorch package called <a href="https://pytorch.org/docs/stable/optim.html">torch.optim</a> contains different optimization techniques. The majority of regularly used optimizers are now supported, and the interface is sufficiently straightforward to allow for future easy integration of more complicated ones.</p><pre>SGD_optimizer <strong>=</strong> optim<strong>.</strong>SGD(model<strong>.</strong>parameters(), lr<strong>=</strong>0.001, momentum<strong>=</strong>0.7)</pre><h3>nn Module</h3><p>Raw autograd can be a little too low-level for creating sophisticated neural networks, but PyTorch makes it simple to define computational graphs and take gradients. The <a href="https://pytorch.org/docs/stable/generated/torch.nn.Module.html">nn module</a> can be useful in this situation. By simply specifying the layers of the network, the nn module offers layers and tools to quickly design neural networks.</p><h3>Forward Propagation</h3><p>In <a href="https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html">forward propagation</a>, the Neural Network tries to predict the right output as accurately as possible. To arrive at this estimation, it passes the supplied data through all of its functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*ER304Wmu-RymZmMWigGYzw.png" /><figcaption>source:jovian.ai</figcaption></figure><pre><strong>prediction</strong> <strong>=</strong> <strong>model(data)</strong></pre><h3>Back Propagation</h3><p><a href="https://pytorch.org/tutorials/beginner/blitz/autograd_tutorial.html">Backprop</a> involves adjusting the NN’s parameters in accordance with the guess’s mistake. This is achieved by travelling backwards from the output, taking the derivatives of the error with respect to the function parameters (gradients), and using gradient descent to optimise the parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*jLYhnsTzXP2db6kImkOyCw.png" /><figcaption>source:jovian.ai</figcaption></figure><pre>loss = (prediction — labels).sum()<br>loss.backward() </pre><h3>Gradient Descent</h3><p>In the simplest terms, <a href="https://en.wikipedia.org/wiki/Gradient_descent">Gradient Descen</a>t can be defined as an optimization algorithm that first calculates the derivative/gradient of the loss function then updates the weights and then tries to reduce the loss by finding the minima of the loss function.</p><p>Gradient Descent was difficult for me until I stumbled onto a helpful PyTorch lesson (link in ref). So I am providing a few steps to make it easier for you.</p><ol><li>Prediction: Pytorch Model</li><li>Gradient Computation: Autograd</li><li>Loss Computation: Pytorch Loss</li><li>Parameters Update: Pytorch Optimizer</li></ol><pre>X<strong>=</strong>torch<strong>.</strong>tensor([[1],[2],[3],[4]],dtype<strong>=</strong>torch<strong>.</strong>float32)<br>Y<strong>=</strong>torch<strong>.</strong>tensor([[2],[4],[6],[8]],dtype<strong>=</strong>torch<strong>.</strong>float32)<br><br>X_test <strong>=</strong> torch<strong>.</strong>tensor([5],dtype<strong>=</strong>torch<strong>.</strong>float32)<br>n_samples, n_features <strong>=</strong> X<strong>.</strong>shape<br>print(n_samples,n_features)<br><br>input_size <strong>=</strong> n_features<br>output_size <strong>=</strong> n_features<br><em>#model=nn.Linear(input_size,output_size)</em><br><br><strong>class</strong> LinearRegression(nn<strong>.</strong>Module):<br>  <strong>def</strong> __init__(self,input_dim, output_dim):<br>    super(LinearRegression,self)<strong>.</strong>__init__()<br>    <em>#define layers</em><br>    self<strong>.</strong>lin<strong>=</strong> nn<strong>.</strong>Linear(input_dim,output_dim)<br><br>  <strong>def</strong> forward(self,x):<br>    <strong>return</strong> self<strong>.</strong>lin(x)<br><br>model <strong>=</strong> LinearRegression(input_size,output_size)<br>print(f&#39;Prediction before training: f(5)={model(X_test)<strong>.</strong>item():.3f}&#39;)<br><br><em>#Training</em><br>learning_rate <strong>=</strong> 0.01<br>n_iters <strong>=</strong> 100<br><br>loss <strong>=</strong> nn<strong>.</strong>MSELoss()<br>optimizer<strong>=</strong>torch<strong>.</strong>optim<strong>.</strong>SGD(model<strong>.</strong>parameters(),lr<strong>=</strong>learning_rate)<br><strong>for</strong> epoch <strong>in</strong> range(n_iters):<br>  <em>#prediction= forward pass</em><br>  y_pred<strong>=</strong>model(X)<br><br>  <em>#loss</em><br>  l<strong>=</strong>loss(Y,y_pred)<br><br>  <em>#gradients=backward pass</em><br>  <em>#dw=gradient(X,Y,y_pred)</em><br>  l<strong>.</strong>backward() <em>#dl/dw</em><br><br>  <em>#update weights</em><br>  optimizer<strong>.</strong>step()<br>  <em>#zero gradients</em><br>  optimizer<strong>.</strong>zero_grad()<br><br>  <strong>if</strong> epoch <strong>%</strong> 10<strong>==</strong>0:<br>    [w,b]<strong>=</strong>model<strong>.</strong>parameters()<br>    print(f&#39;epoch{epoch<strong>+</strong>1}: w = {w[0][0]<strong>.</strong>item():.3f},loss = {l:.8f}&#39;)<br>print(f&#39;Prediction after training: f(5)={model(X_test)<strong>.</strong>item():.3f}&#39;)</pre><h3>Linear Regression</h3><p>Ah! Here it finally comes, <a href="https://en.wikipedia.org/wiki/Linear_regression">Linear Regression</a> is ruling the machine learning with just y=mx+c. It is an attractive model with simple representation but has become a proven way to scientifically and reliably predict the future.</p><p>Now let’s prepare our data first,</p><pre>X_numpy, y_numpy <strong>=</strong> datasets<strong>.</strong>make_regression(n_samples<strong>=</strong>100,n_features<strong>=</strong>1,noise<strong>=</strong>20,random_state<strong>=</strong>1)<br><em>#cast to float tensor</em><br>X<strong>=</strong>torch<strong>.</strong>from_numpy(X_numpy<strong>.</strong>astype(np<strong>.</strong>float32))<br>y<strong>=</strong>torch<strong>.</strong>from_numpy(y_numpy<strong>.</strong>astype(np<strong>.</strong>float32))<br>y<strong>=</strong>y<strong>.</strong>view(y<strong>.</strong>shape[0],1)</pre><p>Linear Model (y=mx+c),</p><pre>input_size <strong>=</strong> n_features<br>output_size <strong>=</strong> 1<br>model <strong>=</strong> nn<strong>.</strong>Linear(input_size, output_size)</pre><p>Calculating Loss and Optimiser,</p><pre>learning_rate <strong>=</strong> 0.01<br><br>criterion <strong>=</strong> nn<strong>.</strong>MSELoss() <em># Mean Square Error</em><br>optimizer <strong>=</strong> torch<strong>.</strong>optim<strong>.</strong>SGD(model<strong>.</strong>parameters(), lr<strong>=</strong>learning_rate)  <em># SGD= Schostic Gradient Descent</em></pre><p>Training the loop,</p><pre>num_epochs <strong>=</strong> 100<br><strong>for</strong> epoch <strong>in</strong> range(num_epochs):<br>    <em># Forward pass and loss</em><br>    y_predicted <strong>=</strong> model(X)<br>    loss <strong>=</strong> criterion(y_predicted, y)<br>    <br>    <em># Backward pass and update</em><br>    loss<strong>.</strong>backward()<br>    optimizer<strong>.</strong>step()<br><br>    <em># zero grad before new step</em><br>    optimizer<strong>.</strong>zero_grad()<br><br>    <strong>if</strong> (epoch<strong>+</strong>1) <strong>%</strong> 10 <strong>==</strong> 0:<br>        print(f&#39;epoch: {epoch<strong>+</strong>1}, loss = {loss<strong>.</strong>item():.4f}&#39;)</pre><p>Plotting……….</p><pre>predicted <strong>=</strong> model(X)<strong>.</strong>detach()<strong>.</strong>numpy()<br><br>plt<strong>.</strong>plot(X_numpy, y_numpy, &#39;ro&#39;)<br>plt<strong>.</strong>plot(X_numpy, predicted, &#39;b&#39;)<br>plt<strong>.</strong>show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*gieUVYDirG572cmVNxJrkw.png" /><figcaption>Output Graph</figcaption></figure><h3>Activation Functions</h3><p>The <a href="https://en.wikipedia.org/wiki/Activation_function">Activation function</a> decides whether a neuron should be activated or not by calculating the weighted sum and further adding bias with it. The purpose of the activation function is to introduce non-linearity into the output of a neuron.</p><p>Initialising a tensor,</p><pre>d <strong>=</strong> torch<strong>.</strong>tensor([<strong>-</strong>1.0, 2.0, 3.0, 4.0])</pre><p><a href="https://en.wikipedia.org/wiki/Softmax_function">SoftMax</a>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*gnbUAzNFKnzCGJ9twEqkDw.png" /><figcaption>source:researchgate</figcaption></figure><pre>output <strong>=</strong> torch<strong>.</strong>softmax(d, dim<strong>=</strong>0)<br>print(output)<br>sm <strong>=</strong> nn<strong>.</strong>Softmax(dim<strong>=</strong>0)<br>h <strong>=</strong> sm(d)<br>print(h)</pre><p><a href="https://en.wikipedia.org/wiki/Sigmoid_function">Sigmoid</a>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*QdaZC650WfQq2q7pyNeovg.png" /><figcaption>source: geeksforgeeks</figcaption></figure><pre>output <strong>=</strong> torch<strong>.</strong>sigmoid(d)<br>print(output)<br>s <strong>=</strong> nn<strong>.</strong>Sigmoid()<br>h <strong>=</strong> s(d)<br>print(h)</pre><p>Tanh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*y2SxHqjrkWhuT4d5fvNlSQ.png" /><figcaption>source: wolfram.mathworld</figcaption></figure><pre>output <strong>=</strong> torch<strong>.</strong>tanh(d)<br>print(output)<br>t <strong>=</strong> nn<strong>.</strong>Tanh()<br>h <strong>=</strong> t(d)<br>print(h)</pre><p><a href="https://en.wikipedia.org/wiki/Rectifier_(neural_networks)">ReLu</a>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*NMHvlagCS5u4FDWJ8jNXLA.png" /><figcaption>source: machinelearningmastery.com</figcaption></figure><pre>output <strong>=</strong> torch<strong>.</strong>relu(d)<br>print(output)<br>relu <strong>=</strong> nn<strong>.</strong>ReLU()<br>h <strong>=</strong> relu(d)<br>print(h)</pre><p><a href="https://en.wikipedia.org/wiki/Rectifier_(neural_networks)">Leaky ReLu</a>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*nNEsRJzxKLg-HH7NOuuDYw.png" /><figcaption>source: machinelearningmastery</figcaption></figure><pre>output <strong>=</strong> F<strong>.</strong>leaky_relu(d)<br>print(output)<br>lrelu <strong>=</strong> nn<strong>.</strong>LeakyReLU()<br>h <strong>=</strong> lrelu(d)<br>print(h)</pre><blockquote>You must be a very tough guy if you ended up reading till here, now jump onto my <a href="https://github.com/deecodess/Pytorch">repository</a> to explore more code!!</blockquote><h3>References</h3><p>For me, the excellent blog mentioned in the story was, <a href="https://blog.paperspace.com/why-use-pytorch-deep-learning-framework/#:~:text=PyTorch%20is%20a%20machine%20learning,for%20deep%20neural%20network%20implementation.">Why Pytorch is the deep learning framework of the future</a>.</p><p>The video which saved me while learning Gradient Descent was <a href="https://www.youtube.com/watch?v=c36lUUr864M&amp;ab_channel=PythonEngineer">Deep Learning with Pytorch.</a></p><p>Additional ref: <a href="https://en.wikipedia.org/wiki/PyTorch#PyTorch_tensors">Wikipedia</a> and <a href="https://pytorch.org/">Official Website of Pytorch</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8382b2da2ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/developer-student-clubs-tiet/my-lightening-experience-with-pytorch-c8382b2da2ed">My lightening experience with Pytorch</a> was originally published in <a href="https://medium.com/developer-student-clubs-tiet">Google Developer Student Clubs TIET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>