Skip to content

Instantly share code, notes, and snippets.

View HudsonHuang's full-sized avatar
🌙
DayDreaming

雲夢 HudsonHuang

🌙
DayDreaming
  • Hongkong
View GitHub Profile
@HudsonHuang
HudsonHuang / TransLayer.py
Created October 18, 2020 09:50
Transformer for convlution, replacing SE module
import torch
import math
from torch.nn import functional as F
from torch import nn
class PositionalEncoding(nn.Module):
def __init__(self, d_model, height, width, dropout=0.1):
super().__init__()
self.dropout = nn.Dropout(p=dropout)