This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
OlderNewer