Articles About Machine Learning

Building a Binary Classification Model in PyTorch

PyTorch library is for deep learning. Some applications of deep learning models are to solve regression or classification problems.In this post, you will discover how to use PyTorch to develop and evaluate neural network models for binary classification problems. After completing this post, you will know: How to load training data and make it available to PyTorch How to design and train a neural network How to evaluate the performance of a neural network model using k-fold cross validation How […]

Read more

Building a Regression Model in PyTorch

PyTorch library is for deep learning. Some applications of deep learning models are to solve regression or classification problems.In this post, you will discover how to use PyTorch to develop and evaluate neural network models for regression problems. After completing this post, you will know: How to load data from scikit-learn and adapt it for PyTorch models How to create a neural network for regerssion problem using PyTorch How to improve model performance with data preparation techniques Kick-start your project […]

Read more

Use PyTorch Deep Learning Models with scikit-learn

The most popular deep learning libraries in Python for research and development are TensorFlow/Keras and PyTorch, due to their simplicity. The scikit-learn library, however, is the most popular library for general machine learning in Python. In this post, you will discover how to use deep learning models from PyTorch with the scikit-learn library in Python. This will allow you to leverage the power of the scikit-learn library for tasks like model evaluation and model hyper-parameter optimization. After completing this lesson […]

Read more

How to Grid Search Hyperparameters for PyTorch Models

The “weights” of a neural network is referred as “parameters” in PyTorch code and it is fine-tuned by optimizer during training. On the contrary, hyperparameters are the parameters of a neural network that is fixed by design and not tuned by training. Examples are the number of hidden layers and the choice of activation functions. Hyperparameter optimization is a big part of deep learning. The reason is that neural networks are notoriously difficult to configure, and a lot of parameters […]

Read more

Save and Load Your PyTorch Models

A deep learning model is a mathematical abstraction of data, in which a lot of parameters are involved. Training these parameters can take hours, days, and even weeks but afterward, you can make use of the result to apply on new data. This is called inference in machine learning. It is important to know how we can preserve the trained model in disk and later, load it for use in inference. In this post, you will discover how to save […]

Read more

Using Activation Functions in Deep Learning Models

A deep learning model in its simplest form are layers of perceptrons connected in tandem. Without any activation functions, they are just matrix multiplications with limited power, regardless how many of them. Activation is the magic why neural network can be an approximation to a wide variety of non-linear function. In PyTorch, there are many activation functions available for use in your deep learning models. In this post, you will see how the choice of activation functions can impact the […]

Read more

Loss Functions in PyTorch Models

The loss metric is very important for neural networks. As all machine learning models are one optimization problem or another, the loss is the objective function to minimize. In neural networks, the optimization is done with gradient descent and backpropagation. But what are loss functions, and how are they affecting your neural networks? In this chapter, you will learn what loss functions are and delve into some commonly used loss functions and how you can apply them to your neural […]

Read more

Using Dropout Regularization in PyTorch Models

Dropout is a simple and powerful regularization technique for neural networks and deep learning models. In this post, you will discover the Dropout regularization technique and how to apply it to your models in PyTorch models. After reading this post, you will know: How the Dropout regularization technique works How to use Dropout on your input layers How to use Dropout on your hidden layers How to tune the dropout level on your problem Kick-start your project with my book […]

Read more

Using Learning Rate Schedule in PyTorch Training

Training a neural network or large deep learning model is a difficult optimization task. The classical algorithm to train neural networks is called stochastic gradient descent. It has been well established that you can achieve increased performance and faster training on some problems by using a learning rate that changes during training. In this post, you will discover what is learning rate schedule and how you can use different learning rate schedules for your neural network models in PyTorch. After […]

Read more

Training a PyTorch Model with DataLoader and Dataset

When you build and train a PyTorch deep learning model, you can provide the training data in several different ways. Ultimately, a PyTorch model works like a function that takes a PyTorch tensor and returns you another tensor. You have a lot of freedom in how to get the input tensors. Probably the easiest is to prepare a large tensor of the entire dataset and extract a small batch from it in each training step. But you will see that […]

Read more
1 32 33 34 35 36 226