Published on

Learning PyTorch: My First Steps

Authors
  • Name
    Dexter Mehta
    Twitter

I’ve just taken my first real step into the world of deep-learning by installing something called PyTorch, and I want to tell you what that felt like in plain English. PyTorch is a toolkit that helps computers learn from data. If you think of a computer program as a recipe, PyTorch is the set of measuring cups, mixing bowls and timers that make the baking less messy.

The very first hurdle was getting PyTorch on my laptop. I pictured a day-long struggle, but in reality it was one command in the terminal and a quick “import” check to be sure it was there. No explosions, no smoke, just a reassuring version number on the screen. That alone gave me a confidence boost.

Once PyTorch was installed I learned about its favourite building block, the tensor. A tensor is just a fancy word for a table of numbers. A list of numbers is a one-dimensional tensor, a spreadsheet-style grid is a two-dimensional tensor, and so on. PyTorch lets you juggle and combine these tables at lightning speed. The magic happens when you ask PyTorch to figure out how changing one number affects another. You give it some example data, ask it to “work backwards,” and it does the math for you. I didn’t need to know calculus; PyTorch quietly handled that in the background.

To see all of this in action I tried a baby experiment: teaching my computer to draw a straight line that fits a handful of dots. The dots followed the rule “double the x-value, then add three,” but with a bit of random noise. After a minute of number crunching PyTorch had discovered that hidden rule on its own. When I peeked inside, the computer’s guess was almost exactly “multiply by two, add three.” Watching it learn something I already knew felt like a small magic trick.

Of course I stumbled. I forgot to label some numbers as “please keep track of these,” so the computer refused to learn. At one point I mixed two different types of numbers and it scolded me with an error message. Each mistake was annoying for about ten seconds, then strangely satisfying once I fixed it and the program ran.

Where do I go next? I want to rent a cloud computer with a beefy graphics card to see how much faster things can run. I plan to feed the model pictures of cats and dogs so it can learn to tell them apart. I’ve also heard there’s an add-on called PyTorch Lightning that cleans up messy code, and I’d love to try that. Above all, I’m keeping my curiosity switched on. Whenever I get stuck I ask an AI helper or skim a tutorial, then I press on.

Here’s my takeaway for anyone curious but intimidated: PyTorch is less like rocket science and more like building with LEGO once you handle the first few bricks. Start tiny, celebrate every small win, and don’t be afraid of error messages—they’re just the computer’s way of saying “ahem, you dropped a piece.” If I can get a simple line to appear out of nowhere, you can too. Happy experimenting!