Skip to Content
Deep Learning with PyTorch
book

Deep Learning with PyTorch

by Vishnu Subramanian
February 2018
Intermediate to advanced
262 pages
6h 59m
English
Packt Publishing
Content preview from Deep Learning with PyTorch

Creating a new dataset for the convoluted features

We can use the same FeaturesDataset class to create the new dataset and data loaders. In the following code, we create the datasets and the loaders:

#Dataset for pre computed features for train and validation data setstrn_feat_dset = FeaturesDataset(trn_features.features,trn_labels)val_feat_dset = FeaturesDataset(val_features.features,val_labels)#Data loaders for pre computed features for train and validation data setstrn_feat_loader = DataLoader(trn_feat_dset,batch_size=64,shuffle=True)val_feat_loader = DataLoader(val_feat_dset,batch_size=64)

Let's create a new model to train on the pre-convoluted features.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Deep Learning with PyTorch

Deep Learning with PyTorch

Eli Stevens, Thomas Viehmann, Luca Pietro Giovanni Antiga
Grokking Deep Learning

Grokking Deep Learning

Andrew W. Trask

Publisher Resources

ISBN: 9781788624336Supplemental Content