Skip to content

Instantly share code, notes, and snippets.

tcrapse /
Created May 20, 2019 22:26 — forked from andrewjong/
PyTorch Image File Paths With Dataset Dataloader
import torch
from torchvision import datasets
class ImageFolderWithPaths(datasets.ImageFolder):
"""Custom dataset that includes image file paths. Extends
# override the __getitem__ method. this is the method dataloader calls
def __getitem__(self, index):
tcrapse /
Created March 20, 2019 23:22 — forked from bigsnarfdude/
denoising autoencoder pytorch cuda
import os
import torch
from torch import nn
from torch.autograd import Variable
from import DataLoader
from torchvision import transforms
from torchvision.datasets import MNIST
from torchvision.utils import save_image