How to train you neural net [Image [0]]

How to train your neural net

Import Libraries

import numpy as np
import pandas as pd
import seaborn as sns
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torchvision import transforms, utils, datasets
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler
from sklearn.metrics import classification_report, confusion_matrix
np.random.seed(0)
torch.manual_seed(0)
%matplotlib inline
sns.set_style('darkgrid')

Define Paths and Set GPU

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")


How to train you neural net [Image [0]]

How to train your neural net

This notebook takes you through the implementation of binary image classification with CNNs using the hot-dog/not-dog dataset on PyTorch.

Import Libraries

import numpy as np
import pandas as pd
import seaborn as sns
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torchvision import transforms, utils, datasets
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler
from sklearn.metrics import classification_report, confusion_matrix
np.random.seed(0)
torch.manual_seed(0)
%matplotlib inline
sns.set_style('darkgrid')

Define Paths and Set GPU

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print("We're using =>", device)
root_dir = "../../../data/computer_vision/image_classification/hot-dog-not-hot-dog/"
print("The data lies here =>", root_dir)

###################### OUTPUT ######################
We're using => cuda
The data…


How to train you neural net [Image [0]]

How to train your neural net

Import Libraries

import numpy as np
import pandas as pd
import seaborn as sns
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torchvision import transforms, utils, datasets
from torch.utils.data import Dataset, DataLoader, random_split, SubsetRandomSampler, WeightedRandomSampler
np.random.seed(0)
torch.manual_seed(0)
%matplotlib inline
sns.set_style('darkgrid')

Define Data Path

root_dir = "../../data/computer_vision/image_classification/natural-images/"
print("The data lies here =>", root_dir)
###################### OUTPUT ######################We're…


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through an implementation of regression on tabular data using PyTorch.

Import Libraries

import numpy as np
import pandas as pd
import seaborn as sns
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, r2_score

Read Data

df = pd.read_csv("data/tabular/classification/winequality-red.csv")


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through an implementation of multi-class classification on tabular data using PyTorch.

Import Libraries

import numpy as np
import pandas as pd
import seaborn as sns
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt

import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, WeightedRandomSampler

from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, classification_report

Read Data

df = pd.read_csv("data/tabular/classification/winequality-red.csv")df.head()


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through an implementation of binary classification on tabular data using PyTorch.


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through the different types of RNN operations in PyTorch.


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through Dataloaders and different types of Loss Functions in PyTorch.

Datasets and Dataloaders


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through the different types of CNN operations in PyTorch.

What is a CNN?

Types of CNN operations


How to train you neural net [Image [0]]

How to train your neural net

This blog post takes you through a few of the most commonly used tensor operations and demonstrates the Autograd functionality in PyTorch.

Akshaj Verma

Computer Vision and Deep Learning.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store