Visualizing a PyTorch Model

PyTorch is a deep learning library. You can build very sophisticated deep learning models with PyTorch. However, there are times you want to have a graphical representation of your model architecture. In this post, you will learn: How to save your PyTorch model in an exchange format How to use Netron to create a graphical representation. Kick-start your project with my book Deep Learning with PyTorch. It provides self-study tutorials with working code. Let’s get started. Visualizing a PyTorch ModelPhoto […]

Read more

Building a Convolutional Neural Network in PyTorch

Neural networks are built with layers connected to each other. There are many different kind of layers. For image related applications, you can always find convolutional layers. It is a layer with very few parameters but applied over a large sized input. It is powerful because it can preserve the spatial structure of the image. Therefore it is used to produce state-of-the-art results on computer vision neural networks. In this post, you will learn about the convolutional layer and the […]

Read more

Handwritten Digit Recognition with LeNet5 Model in PyTorch

A popular demonstration of the capability of deep learning techniques is object recognition in image data. The “hello world” of object recognition for machine learning and deep learning is the MNIST dataset for handwritten digit recognition. In this post, you will discover how to develop a deep learning model to achieve near state-of-the-art performance on the MNIST handwritten digit recognition task in PyTorch. After completing this chapter, you will know: How to load the MNIST dataset using torchvision How to […]

Read more

LSTM for Time Series Prediction in PyTorch

Long Short-Term Memory (LSTM) is a structure that can be used in neural network. It is a type of recurrent neural network (RNN) that expects the input in the form of a sequence of features. It is useful for data such as time series or string of text. In this post, you will learn about LSTM networks. In particular, What is LSTM and how they are different How to develop LSTM network for time series prediction How to train a […]

Read more

Text Generation with LSTM in PyTorch

Recurrent neural network can be used for time series prediction. In which, a regression neural network is created. It can also be used as generative model, which usually is a classification neural network model. A generative model is to learn certain pattern from data, such that when it is presented with some prompt, it can create a complete output that in the same style as the learned pattern. In this post, you will discover how to build a generative model […]

Read more

Building an Image Classifier with a Single-Layer Neural Network in PyTorch

A single-layer neural network, also known as a single-layer perceptron, is the simplest type of neural network. It consists of only one layer of neurons, which are connected to the input layer and the output layer. In case of an image classifier, the input layer would be an image and the output layer would be a class label. To build an image classifier using a single-layer neural network in PyTorch, you’ll first need to prepare your data. This typically involves […]

Read more

Training Logistic Regression with Cross-Entropy Loss in PyTorch

In the previous session of our PyTorch series, we demonstrated how badly initialized weights can impact the accuracy of a classification model when mean square error (MSE) loss is used. We noticed that the model didn’t converge during training and its accuracy was also significantly reduced. In the following, you will see what happens if you randomly initialize the weights and use cross-entropy as loss function for model training. This loss function fits logistic regression and other categorical classification problems […]

Read more

Building a Logistic Regression Classifier in PyTorch

Logistic regression is a type of regression that predicts the probability of an event. It is used for classification problems and has many applications in the fields of machine learning, artificial intelligence, and data mining. The formula of logistic regression is to apply a sigmoid function to the output of a linear function. This article discusses how you can build a logistic regression classifier. While previously you have been working on a single-varable dataset, here we’ll be using a popular […]

Read more

Deep Learning with PyTorch (9-Day Mini-Course)

Deep learning is a fascinating field of study and the techniques are achieving world class results in a range of challenging machine learning problems. It can be hard to get started in deep learning.Which library should you use and which techniques should you focus on? In this 9-part crash course you will discover applied deep learning in Python with the easy to use and powerful PyTorch library. This mini-course is intended for practitioners that are already comfortable with programming in […]

Read more

Activation Functions in PyTorch

As neural networks become increasingly popular in the field of machine learning, it is important to understand the role that activation functions play in their implementation. In this article, you’ll explore the concept of activation functions that are applied to the output of each neuron in a neural network to introduce non-linearity into the model. Without activation functions, neural networks would simply be a series of linear transformations, which would limit their ability to learn complex patterns and relationships in […]

Read more
1 68 69 70 71 72 908