Skip to content

Instantly share code, notes, and snippets.

View tjwei's full-sized avatar

Tzerjen Wei tjwei

View GitHub Profile
@juneoh
juneoh / sample.py
Created October 27, 2018 01:29
PyTorch AlexNet for grayscale images
import torch.nn as nn
from torchvision.models import alexnet
model = alexnet(pretrained=True, num_classes=10)
model.features[0] = nn.Conv2d(1, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))