Skip to content

Instantly share code, notes, and snippets.

View daniegr's full-sized avatar

Daniel Groos daniegr

View GitHub Profile
@mjstevens777
mjstevens777 / pytorch_bilinear_conv_transpose.py
Last active August 25, 2023 15:06
Conv Transpose 2d for Pytorch initialized with bilinear filter / kernel weights
"""
Copyright 2018 Matt Stevens. See license at end of file.
Defines the BilinearConvTranspose2d class.
"""
import torch
import torch.nn as nn
class BilinearConvTranspose2d(nn.ConvTranspose2d):
"""A conv transpose initialized to bilinear interpolation."""